From: Fabio Lodato Date: Tue, 24 Mar 2020 19:30:00 +0000 (+0100) Subject: Built motion from commit (unavailable).|2.4.12 X-Git-Url: http://repos.xcallymotion.com/base/%22angular-material.themes.css/%22thisimagedoesnotexist.png//%27?a=commitdiff_plain;h=5433310608f7744f295a11cd25b806cc09e186f4;p=motion2.git Built motion from commit (unavailable).|2.4.12 --- diff --git a/apidoc/api_project.js b/apidoc/api_project.js index f09ea42..6e7b4d5 100644 --- a/apidoc/api_project.js +++ b/apidoc/api_project.js @@ -17,7 +17,7 @@ define({ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2020-03-24T15:29:28.522Z", + "time": "2020-03-24T19:18:26.798Z", "url": "http://apidocjs.com", "version": "0.17.7" } diff --git a/apidoc/api_project.json b/apidoc/api_project.json index 05e0aa3..0a3358c 100644 --- a/apidoc/api_project.json +++ b/apidoc/api_project.json @@ -17,7 +17,7 @@ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2020-03-24T15:29:28.522Z", + "time": "2020-03-24T19:18:26.798Z", "url": "http://apidocjs.com", "version": "0.17.7" } diff --git a/server/api/action/action.attributes.js b/server/api/action/action.attributes.js index 033175d..e367a86 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 _0x0325=['contactManager','integration','motionbar','jscripty','browser','script','integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20urlForward[URL]','motionbar[NULL,NULL,WinAppArguments]','TEXT','sequelize','exports','VIRTUAL','STRING'];(function(_0x40ddc0,_0x41c082){var _0x1aebf1=function(_0x3ba1f6){while(--_0x3ba1f6){_0x40ddc0['push'](_0x40ddc0['shift']());}};_0x1aebf1(++_0x41c082);}(_0x0325,0x15b));var _0x5032=function(_0x20d1c0,_0x405aa6){_0x20d1c0=_0x20d1c0-0x0;var _0x5b00f2=_0x0325[_0x20d1c0];return _0x5b00f2;};'use strict';var Sequelize=require(_0x5032('0x0'));module[_0x5032('0x1')]={'name':{'type':Sequelize[_0x5032('0x2')],'get':function(_0x20f81a){return this['getDataValue']('action');}},'action':{'type':Sequelize[_0x5032('0x3')],'allowNull':![],'validate':{'isIn':{'args':[[_0x5032('0x4'),_0x5032('0x5'),_0x5032('0x6'),_0x5032('0x7'),'urlForward',_0x5032('0x8'),'bot',_0x5032('0x9')]],'msg':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'}},'comment':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'},'data1':{'type':Sequelize['STRING'](0x1000),'comment':'contactManager[ListId],\x20integration[intName(zendesk)],\x20motionbar[Popup(0),URL(1),WinApp(2)],\x20urlForward[GET,POST],\x20browser[TemplateId(0),URL(1)]'},'data2':{'type':Sequelize[_0x5032('0x3')](0x1000),'comment':_0x5032('0xa')},'data3':{'type':Sequelize[_0x5032('0x3')](0x1000),'comment':_0x5032('0xb')},'data4':{'type':Sequelize[_0x5032('0x3')](0x1000)},'data5':{'type':Sequelize['STRING'](0x1000)},'data6':{'type':Sequelize[_0x5032('0x3')]},'data7':{'type':Sequelize[_0x5032('0xc')]}}; \ No newline at end of file +var _0x332e=['getDataValue','STRING','contactManager','integration','motionbar','jscripty','urlForward','browser','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20urlForward[URL]','motionbar[NULL,NULL,WinAppArguments]','TEXT','exports'];(function(_0xfbf4c3,_0x30f4ea){var _0x54bf37=function(_0x52aad0){while(--_0x52aad0){_0xfbf4c3['push'](_0xfbf4c3['shift']());}};_0x54bf37(++_0x30f4ea);}(_0x332e,0x1cd));var _0xe332=function(_0x3f9f39,_0x39d8c2){_0x3f9f39=_0x3f9f39-0x0;var _0x3de0b8=_0x332e[_0x3f9f39];return _0x3de0b8;};'use strict';var Sequelize=require('sequelize');module[_0xe332('0x0')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x120a3c){return this[_0xe332('0x1')]('action');}},'action':{'type':Sequelize[_0xe332('0x2')],'allowNull':![],'validate':{'isIn':{'args':[[_0xe332('0x3'),_0xe332('0x4'),_0xe332('0x5'),_0xe332('0x6'),_0xe332('0x7'),_0xe332('0x8'),'bot',_0xe332('0x9')]],'msg':_0xe332('0xa')}},'comment':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'},'data1':{'type':Sequelize[_0xe332('0x2')](0x1000),'comment':'contactManager[ListId],\x20integration[intName(zendesk)],\x20motionbar[Popup(0),URL(1),WinApp(2)],\x20urlForward[GET,POST],\x20browser[TemplateId(0),URL(1)]'},'data2':{'type':Sequelize[_0xe332('0x2')](0x1000),'comment':_0xe332('0xb')},'data3':{'type':Sequelize[_0xe332('0x2')](0x1000),'comment':_0xe332('0xc')},'data4':{'type':Sequelize[_0xe332('0x2')](0x1000)},'data5':{'type':Sequelize['STRING'](0x1000)},'data6':{'type':Sequelize[_0xe332('0x2')]},'data7':{'type':Sequelize[_0xe332('0xd')]}}; \ No newline at end of file diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js index c809c17..5fd2ba1 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 _0xda3f=['../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','count','offset','limit','set','apply','reject','save','update','then','destroy','stack','name','send','body','Action','find','catch','eml-format','rimraf','moment','mustache','util','sox','to-csv','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0xefd519,_0xc62635){var _0x4bb882=function(_0x37e0a1){while(--_0x37e0a1){_0xefd519['push'](_0xefd519['shift']());}};_0x4bb882(++_0xc62635);}(_0xda3f,0xec));var _0xfda3=function(_0x19a5cc,_0x3f9bf7){_0x19a5cc=_0x19a5cc-0x0;var _0x29246c=_0xda3f[_0x19a5cc];return _0x29246c;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xfda3('0x0'));var rimraf=require(_0xfda3('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xfda3('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xfda3('0x3'));var util=require(_0xfda3('0x4'));var path=require('path');var sox=require(_0xfda3('0x5'));var csv=require(_0xfda3('0x6'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0xfda3('0x7'));var crypto=require(_0xfda3('0x8'));var jsforce=require(_0xfda3('0x9'));var deskjs=require(_0xfda3('0xa'));var toCsv=require(_0xfda3('0x6'));var querystring=require(_0xfda3('0xb'));var Papa=require(_0xfda3('0xc'));var Redis=require(_0xfda3('0xd'));var authService=require(_0xfda3('0xe'));var qs=require(_0xfda3('0xf'));var as=require(_0xfda3('0x10'));var hardwareService=require(_0xfda3('0x11'));var logger=require('../../config/logger')(_0xfda3('0x12'));var utils=require(_0xfda3('0x13'));var config=require(_0xfda3('0x14'));var db=require(_0xfda3('0x15'))['db'];function respondWithStatusCode(_0x1443f4,_0x4b77ea){_0x4b77ea=_0x4b77ea||0xcc;return function(_0x583125){if(_0x583125){return _0x1443f4['sendStatus'](_0x4b77ea);}return _0x1443f4[_0xfda3('0x16')](_0x4b77ea)[_0xfda3('0x17')]();};}function respondWithResult(_0x4929fa,_0x501588){_0x501588=_0x501588||0xc8;return function(_0x587e9b){if(_0x587e9b){return _0x4929fa[_0xfda3('0x16')](_0x501588)[_0xfda3('0x18')](_0x587e9b);}};}function respondWithFilteredResult(_0x5ea793,_0x57a229){return function(_0x533365){if(_0x533365){var _0x80ea80=_0x533365[_0xfda3('0x19')],_0x474707=_0x57a229[_0xfda3('0x1a')],_0x249dc6=_0x57a229[_0xfda3('0x1a')]+_0x57a229[_0xfda3('0x1b')],_0x3d8bcd;if(_0x249dc6>=_0x80ea80){_0x249dc6=_0x80ea80;_0x3d8bcd=0xc8;}else{_0x3d8bcd=0xce;}_0x5ea793[_0xfda3('0x16')](_0x3d8bcd);return _0x5ea793[_0xfda3('0x1c')]('Content-Range',_0x474707+'-'+_0x249dc6+'/'+_0x80ea80)[_0xfda3('0x18')](_0x533365);}return null;};}function patchUpdates(_0x1bbdda){return function(_0x12d568){try{jsonpatch[_0xfda3('0x1d')](_0x12d568,_0x1bbdda,!![]);}catch(_0x59a887){return BPromise[_0xfda3('0x1e')](_0x59a887);}return _0x12d568[_0xfda3('0x1f')]();};}function saveUpdates(_0x2ee74c,_0x51e731){return function(_0x5ad52a){if(_0x5ad52a){return _0x5ad52a[_0xfda3('0x20')](_0x2ee74c)[_0xfda3('0x21')](function(_0x4ea9f5){return _0x4ea9f5;});}return null;};}function removeEntity(_0x545320,_0x3cf5a9){return function(_0xef2535){if(_0xef2535){return _0xef2535[_0xfda3('0x22')]()[_0xfda3('0x21')](function(){_0x545320[_0xfda3('0x16')](0xcc)[_0xfda3('0x17')]();});}};}function handleEntityNotFound(_0x2677f6,_0xc6fb9a){return function(_0x16eaa6){if(!_0x16eaa6){_0x2677f6['sendStatus'](0x194);}return _0x16eaa6;};}function handleError(_0x82341b,_0x2d5b44){_0x2d5b44=_0x2d5b44||0x1f4;return function(_0x2e8bf8){logger['error'](_0x2e8bf8[_0xfda3('0x23')]);if(_0x2e8bf8[_0xfda3('0x24')]){delete _0x2e8bf8[_0xfda3('0x24')];}_0x82341b[_0xfda3('0x16')](_0x2d5b44)[_0xfda3('0x25')](_0x2e8bf8);};}exports[_0xfda3('0x20')]=function(_0x514d2a,_0x3c6d7d){if(_0x514d2a[_0xfda3('0x26')]['id']){delete _0x514d2a[_0xfda3('0x26')]['id'];}return db[_0xfda3('0x27')][_0xfda3('0x28')]({'where':{'id':_0x514d2a['params']['id']}})[_0xfda3('0x21')](handleEntityNotFound(_0x3c6d7d,null))[_0xfda3('0x21')](saveUpdates(_0x514d2a[_0xfda3('0x26')],null))[_0xfda3('0x21')](respondWithResult(_0x3c6d7d,null))[_0xfda3('0x29')](handleError(_0x3c6d7d,null));};exports[_0xfda3('0x22')]=function(_0x26e544,_0x538902){return db['Action'][_0xfda3('0x28')]({'where':{'id':_0x26e544['params']['id']}})['then'](handleEntityNotFound(_0x538902,null))[_0xfda3('0x21')](removeEntity(_0x538902,null))[_0xfda3('0x29')](handleError(_0x538902,null));}; \ No newline at end of file +var _0xe706=['set','Content-Range','apply','reject','save','update','then','stack','name','send','body','Action','find','params','catch','destroy','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','end','count','limit'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xe706,0xa3));var _0x6e70=function(_0x580cea,_0x41fab5){_0x580cea=_0x580cea-0x0;var _0x5311c8=_0xe706[_0x580cea];return _0x5311c8;};'use strict';var pdf=require(_0x6e70('0x0'));var emlformat=require(_0x6e70('0x1'));var rimraf=require(_0x6e70('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6e70('0x3'));var rp=require(_0x6e70('0x4'));var moment=require(_0x6e70('0x5'));var BPromise=require(_0x6e70('0x6'));var Mustache=require(_0x6e70('0x7'));var util=require(_0x6e70('0x8'));var path=require(_0x6e70('0x9'));var sox=require(_0x6e70('0xa'));var csv=require(_0x6e70('0xb'));var ejs=require(_0x6e70('0xc'));var fs=require('fs');var _=require(_0x6e70('0xd'));var squel=require(_0x6e70('0xe'));var crypto=require(_0x6e70('0xf'));var jsforce=require(_0x6e70('0x10'));var deskjs=require(_0x6e70('0x11'));var toCsv=require(_0x6e70('0xb'));var querystring=require(_0x6e70('0x12'));var Papa=require(_0x6e70('0x13'));var Redis=require(_0x6e70('0x14'));var authService=require(_0x6e70('0x15'));var qs=require(_0x6e70('0x16'));var as=require(_0x6e70('0x17'));var hardwareService=require(_0x6e70('0x18'));var logger=require(_0x6e70('0x19'))('api');var utils=require('../../config/utils');var config=require(_0x6e70('0x1a'));var db=require(_0x6e70('0x1b'))['db'];function respondWithStatusCode(_0x18cf27,_0x27dd9b){_0x27dd9b=_0x27dd9b||0xcc;return function(_0x3b38f3){if(_0x3b38f3){return _0x18cf27[_0x6e70('0x1c')](_0x27dd9b);}return _0x18cf27[_0x6e70('0x1d')](_0x27dd9b)[_0x6e70('0x1e')]();};}function respondWithResult(_0x5dfbaa,_0x52737e){_0x52737e=_0x52737e||0xc8;return function(_0x48bc72){if(_0x48bc72){return _0x5dfbaa[_0x6e70('0x1d')](_0x52737e)['json'](_0x48bc72);}};}function respondWithFilteredResult(_0x53aed0,_0x304716){return function(_0x22c50c){if(_0x22c50c){var _0x5d9263=_0x22c50c[_0x6e70('0x1f')],_0x24f3ac=_0x304716['offset'],_0x5c3fe7=_0x304716['offset']+_0x304716[_0x6e70('0x20')],_0x2efc0f;if(_0x5c3fe7>=_0x5d9263){_0x5c3fe7=_0x5d9263;_0x2efc0f=0xc8;}else{_0x2efc0f=0xce;}_0x53aed0['status'](_0x2efc0f);return _0x53aed0[_0x6e70('0x21')](_0x6e70('0x22'),_0x24f3ac+'-'+_0x5c3fe7+'/'+_0x5d9263)['json'](_0x22c50c);}return null;};}function patchUpdates(_0x497d61){return function(_0xc238ba){try{jsonpatch[_0x6e70('0x23')](_0xc238ba,_0x497d61,!![]);}catch(_0x2368eb){return BPromise[_0x6e70('0x24')](_0x2368eb);}return _0xc238ba[_0x6e70('0x25')]();};}function saveUpdates(_0xcdf9f2,_0x1b2453){return function(_0x44a49f){if(_0x44a49f){return _0x44a49f[_0x6e70('0x26')](_0xcdf9f2)[_0x6e70('0x27')](function(_0x4a0cfe){return _0x4a0cfe;});}return null;};}function removeEntity(_0x228350,_0x344b65){return function(_0x27b294){if(_0x27b294){return _0x27b294['destroy']()[_0x6e70('0x27')](function(){_0x228350[_0x6e70('0x1d')](0xcc)[_0x6e70('0x1e')]();});}};}function handleEntityNotFound(_0x50da2c,_0x10fc91){return function(_0x538b9c){if(!_0x538b9c){_0x50da2c['sendStatus'](0x194);}return _0x538b9c;};}function handleError(_0x4e97c7,_0x41e352){_0x41e352=_0x41e352||0x1f4;return function(_0x19c5ae){logger['error'](_0x19c5ae[_0x6e70('0x28')]);if(_0x19c5ae[_0x6e70('0x29')]){delete _0x19c5ae['name'];}_0x4e97c7[_0x6e70('0x1d')](_0x41e352)[_0x6e70('0x2a')](_0x19c5ae);};}exports[_0x6e70('0x26')]=function(_0x4a67ac,_0x54a5fe){if(_0x4a67ac[_0x6e70('0x2b')]['id']){delete _0x4a67ac[_0x6e70('0x2b')]['id'];}return db[_0x6e70('0x2c')][_0x6e70('0x2d')]({'where':{'id':_0x4a67ac[_0x6e70('0x2e')]['id']}})['then'](handleEntityNotFound(_0x54a5fe,null))[_0x6e70('0x27')](saveUpdates(_0x4a67ac[_0x6e70('0x2b')],null))[_0x6e70('0x27')](respondWithResult(_0x54a5fe,null))[_0x6e70('0x2f')](handleError(_0x54a5fe,null));};exports[_0x6e70('0x30')]=function(_0x20a225,_0x3f78d2){return db[_0x6e70('0x2c')][_0x6e70('0x2d')]({'where':{'id':_0x20a225[_0x6e70('0x2e')]['id']}})['then'](handleEntityNotFound(_0x3f78d2,null))[_0x6e70('0x27')](removeEntity(_0x3f78d2,null))['catch'](handleError(_0x3f78d2,null));}; \ No newline at end of file diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js index 32343fe..f1ff987 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 _0x250b=['rimraf','../../config/environment','./action.attributes','exports','define','Action','tools_actions','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0x250b,0x166));var _0xb250=function(_0x5628b2,_0x223018){_0x5628b2=_0x5628b2-0x0;var _0x2174a7=_0x250b[_0x5628b2];return _0x2174a7;};'use strict';var _=require('lodash');var util=require(_0xb250('0x0'));var logger=require(_0xb250('0x1'))('api');var moment=require(_0xb250('0x2'));var BPromise=require(_0xb250('0x3'));var rp=require(_0xb250('0x4'));var fs=require('fs');var path=require(_0xb250('0x5'));var rimraf=require(_0xb250('0x6'));var config=require(_0xb250('0x7'));var attributes=require(_0xb250('0x8'));module[_0xb250('0x9')]=function(_0x3fbe41,_0x33a317){return _0x3fbe41[_0xb250('0xa')](_0xb250('0xb'),attributes,{'tableName':_0xb250('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xda85=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','Action','tools_actions','lodash'];(function(_0x301b7a,_0x55fdd0){var _0x1e2fab=function(_0x1d87d1){while(--_0x1d87d1){_0x301b7a['push'](_0x301b7a['shift']());}};_0x1e2fab(++_0x55fdd0);}(_0xda85,0x144));var _0x5da8=function(_0x11efe8,_0xe6ad7e){_0x11efe8=_0x11efe8-0x0;var _0x5954b8=_0xda85[_0x11efe8];return _0x5954b8;};'use strict';var _=require(_0x5da8('0x0'));var util=require(_0x5da8('0x1'));var logger=require(_0x5da8('0x2'))(_0x5da8('0x3'));var moment=require(_0x5da8('0x4'));var BPromise=require(_0x5da8('0x5'));var rp=require(_0x5da8('0x6'));var fs=require('fs');var path=require(_0x5da8('0x7'));var rimraf=require(_0x5da8('0x8'));var config=require(_0x5da8('0x9'));var attributes=require('./action.attributes');module[_0x5da8('0xa')]=function(_0x3ba8d4,_0x35b59f){return _0x3ba8d4['define'](_0x5da8('0xb'),attributes,{'tableName':_0x5da8('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/action/action.rpc.js b/server/api/action/action.rpc.js index 0d3a498..b54d3a5 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 _0xd8b0=['../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','ioredis'];(function(_0x194cb5,_0x479e8a){var _0x55db4b=function(_0x2c8192){while(--_0x2c8192){_0x194cb5['push'](_0x194cb5['shift']());}};_0x55db4b(++_0x479e8a);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0d8b('0x2'));var db=require(_0x0d8b('0x3'))['db'];var utils=require(_0x0d8b('0x4'));var logger=require(_0x0d8b('0x5'))(_0x0d8b('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0d8b('0x7')][_0x0d8b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x39f43a,_0x4a4470,_0x413284){return new BPromise(function(_0x284169,_0x58e4e2){return client[_0x0d8b('0x9')](_0x39f43a,_0x413284)[_0x0d8b('0xa')](function(_0x3b027f){logger[_0x0d8b('0xb')](_0x0d8b('0xc'),_0x4a4470,_0x0d8b('0xd'));logger[_0x0d8b('0xe')](_0x0d8b('0xf'),_0x4a4470,'request\x20sent',JSON[_0x0d8b('0x10')](_0x3b027f));if(_0x3b027f['error']){if(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x12')]===0x1f4){logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);return _0x58e4e2(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);}logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);return _0x284169(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);}else{logger['info'](_0x0d8b('0xc'),_0x4a4470,_0x0d8b('0xd'));_0x284169(_0x3b027f[_0x0d8b('0x14')][_0x0d8b('0x13')]);}})[_0x0d8b('0x15')](function(_0x5cd485){logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x5cd485);_0x58e4e2(_0x5cd485);});});} \ No newline at end of file +var _0xbaf0=['client','http','then','info','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x51674a,_0x77ccff){var _0x13fca6=function(_0x3d6c27){while(--_0x3d6c27){_0x51674a['push'](_0x51674a['shift']());}};_0x13fca6(++_0x77ccff);}(_0xbaf0,0x12a));var _0x0baf=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0xbaf0[_0x465028];return _0xb783d4;};'use strict';var _=require('lodash');var util=require(_0x0baf('0x0'));var moment=require(_0x0baf('0x1'));var BPromise=require(_0x0baf('0x2'));var rs=require(_0x0baf('0x3'));var fs=require('fs');var Redis=require(_0x0baf('0x4'));var db=require(_0x0baf('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0baf('0x6'))(_0x0baf('0x7'));var config=require(_0x0baf('0x8'));var jayson=require(_0x0baf('0x9'));var client=jayson[_0x0baf('0xa')][_0x0baf('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1a10b1,_0x2dcaac,_0x1d0a0d){return new BPromise(function(_0x5f5030,_0x11b947){return client['request'](_0x1a10b1,_0x1d0a0d)[_0x0baf('0xc')](function(_0x2c7442){logger[_0x0baf('0xd')](_0x0baf('0xe'),_0x2dcaac,_0x0baf('0xf'));logger[_0x0baf('0x10')](_0x0baf('0x11'),_0x2dcaac,_0x0baf('0xf'),JSON[_0x0baf('0x12')](_0x2c7442));if(_0x2c7442[_0x0baf('0x13')]){if(_0x2c7442[_0x0baf('0x13')]['code']===0x1f4){logger['error'](_0x0baf('0xe'),_0x2dcaac,_0x2c7442[_0x0baf('0x13')][_0x0baf('0x14')]);return _0x11b947(_0x2c7442[_0x0baf('0x13')]['message']);}logger[_0x0baf('0x13')]('Action,\x20%s,\x20%s',_0x2dcaac,_0x2c7442[_0x0baf('0x13')][_0x0baf('0x14')]);return _0x5f5030(_0x2c7442[_0x0baf('0x13')][_0x0baf('0x14')]);}else{logger[_0x0baf('0xd')](_0x0baf('0xe'),_0x2dcaac,'request\x20sent');_0x5f5030(_0x2c7442['result'][_0x0baf('0x14')]);}})[_0x0baf('0x15')](function(_0x283408){logger[_0x0baf('0x13')](_0x0baf('0xe'),_0x2dcaac,_0x283408);_0x11b947(_0x283408);});});} \ No newline at end of file diff --git a/server/api/action/index.js b/server/api/action/index.js index c72b6bd..bbaf06b 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 _0x52a7=['../../components/auth/service','../../components/interaction/service','../../config/environment','./action.controller','put','isAuthenticated','update','destroy','exports','util','connect-timeout','express','Router'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x52a7,0x127));var _0x752a=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x52a7[_0x19950b];return _0x3c6b41;};'use strict';var multer=require('multer');var util=require(_0x752a('0x0'));var path=require('path');var timeout=require(_0x752a('0x1'));var express=require(_0x752a('0x2'));var router=express[_0x752a('0x3')]();var auth=require(_0x752a('0x4'));var interaction=require(_0x752a('0x5'));var config=require(_0x752a('0x6'));var controller=require(_0x752a('0x7'));router[_0x752a('0x8')]('/:id',auth[_0x752a('0x9')](),controller[_0x752a('0xa')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x752a('0xb')]);module[_0x752a('0xc')]=router; \ No newline at end of file +var _0x8d06=['isAuthenticated','destroy','exports','multer','util','path','express','Router','../../components/interaction/service','../../config/environment','./action.controller','update','delete','/:id'];(function(_0x1ca9e9,_0x1c4391){var _0x309f3c=function(_0x5ab318){while(--_0x5ab318){_0x1ca9e9['push'](_0x1ca9e9['shift']());}};_0x309f3c(++_0x1c4391);}(_0x8d06,0x1b5));var _0x68d0=function(_0x2d9fd5,_0x38ba6e){_0x2d9fd5=_0x2d9fd5-0x0;var _0x451089=_0x8d06[_0x2d9fd5];return _0x451089;};'use strict';var multer=require(_0x68d0('0x0'));var util=require(_0x68d0('0x1'));var path=require(_0x68d0('0x2'));var timeout=require('connect-timeout');var express=require(_0x68d0('0x3'));var router=express[_0x68d0('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x68d0('0x5'));var config=require(_0x68d0('0x6'));var controller=require(_0x68d0('0x7'));router['put']('/:id',auth['isAuthenticated'](),controller[_0x68d0('0x8')]);router[_0x68d0('0x9')](_0x68d0('0xa'),auth[_0x68d0('0xb')](),controller[_0x68d0('0xc')]);module[_0x68d0('0xd')]=router; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js index 0d7e314..644435f 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 _0x73af=['sequelize','STRING','TEXT'];(function(_0x5a0ef5,_0x565082){var _0x2b2487=function(_0x3198ef){while(--_0x3198ef){_0x5a0ef5['push'](_0x5a0ef5['shift']());}};_0x2b2487(++_0x565082);}(_0x73af,0x153));var _0xf73a=function(_0x18f784,_0x2a538f){_0x18f784=_0x18f784-0x0;var _0x4cd072=_0x73af[_0x18f784];return _0x4cd072;};'use strict';var Sequelize=require(_0xf73a('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize[_0xf73a('0x1')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0xf73a('0x2')]}}; \ No newline at end of file +var _0x6668=['sequelize','exports','STRING','TEXT'];(function(_0x31df6f,_0x380e73){var _0x31e353=function(_0x3a434b){while(--_0x3a434b){_0x31df6f['push'](_0x31df6f['shift']());}};_0x31e353(++_0x380e73);}(_0x6668,0x1ac));var _0x8666=function(_0x38f737,_0x54f685){_0x38f737=_0x38f737-0x0;var _0x7afda3=_0x6668[_0x38f737];return _0x7afda3;};'use strict';var Sequelize=require(_0x8666('0x0'));module[_0x8666('0x1')]={'name':{'type':Sequelize[_0x8666('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x8666('0x2')]},'parent':{'type':Sequelize[_0x8666('0x2')]},'table':{'type':Sequelize[_0x8666('0x2')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0x8666('0x3')]}}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js index a6f3be5..3e63142 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 _0x6aa7=['group','condition','value','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','MetricId','metric','function','replace','format','groupBy','orderBy','alias','joins','parse','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','table','parentKey','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','right_join','AVG(%s)','HOUR(%s)','Sequelize','from','SELECT','No\x20available\x20data','output','%s-%s.%s','csv','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','Run\x20Query:','fork','savename','countTable','COUNT(*)','run','runReport','GROUP_CONCAT(%s)','getFields','DESC','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','to-csv','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','reject','save','update','destroy','then','get','CustomReports','UserProfileResource','error','stack','name','index','AnalyticCustomReport','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','where','merge','type','key','VIRTUAL','field','filter','count','includeAll','include','findAll','rows','catch','show','options','find','create','body','role','user','Reports','userProfileId','autoAssociation','params','join','left_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator'];(function(_0x5427c8,_0x18f384){var _0x33a129=function(_0x1940e8){while(--_0x1940e8){_0x5427c8['push'](_0x5427c8['shift']());}};_0x33a129(++_0x18f384);}(_0x6aa7,0x178));var _0x76aa=function(_0x2ac959,_0x2d5bba){_0x2ac959=_0x2ac959-0x0;var _0x5acb43=_0x6aa7[_0x2ac959];return _0x5acb43;};'use strict';var pdf=require(_0x76aa('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x76aa('0x1'));var zipdir=require(_0x76aa('0x2'));var jsonpatch=require(_0x76aa('0x3'));var rp=require(_0x76aa('0x4'));var moment=require('moment');var BPromise=require(_0x76aa('0x5'));var Mustache=require(_0x76aa('0x6'));var util=require(_0x76aa('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x76aa('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x76aa('0x9'));var squel=require(_0x76aa('0xa'));var crypto=require(_0x76aa('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x76aa('0xc'));var toCsv=require(_0x76aa('0x8'));var querystring=require(_0x76aa('0xd'));var Papa=require('papaparse');var Redis=require(_0x76aa('0xe'));var authService=require(_0x76aa('0xf'));var qs=require(_0x76aa('0x10'));var as=require(_0x76aa('0x11'));var hardwareService=require(_0x76aa('0x12'));var logger=require(_0x76aa('0x13'))(_0x76aa('0x14'));var utils=require(_0x76aa('0x15'));var config=require(_0x76aa('0x16'));var db=require(_0x76aa('0x17'))['db'];function respondWithStatusCode(_0x5e5f47,_0x112c39){_0x112c39=_0x112c39||0xcc;return function(_0x5df49c){if(_0x5df49c){return _0x5e5f47[_0x76aa('0x18')](_0x112c39);}return _0x5e5f47[_0x76aa('0x19')](_0x112c39)[_0x76aa('0x1a')]();};}function respondWithResult(_0x8e44ed,_0x10432c){_0x10432c=_0x10432c||0xc8;return function(_0x4e309f){if(_0x4e309f){return _0x8e44ed['status'](_0x10432c)[_0x76aa('0x1b')](_0x4e309f);}};}function respondWithFilteredResult(_0x4cfc34,_0x180d92){return function(_0x319bf1){if(_0x319bf1){var _0x5cf594=_0x319bf1['count'],_0x2111c7=_0x180d92[_0x76aa('0x1c')],_0x550d9a=_0x180d92[_0x76aa('0x1c')]+_0x180d92[_0x76aa('0x1d')],_0x328381;if(_0x550d9a>=_0x5cf594){_0x550d9a=_0x5cf594;_0x328381=0xc8;}else{_0x328381=0xce;}_0x4cfc34[_0x76aa('0x19')](_0x328381);return _0x4cfc34[_0x76aa('0x1e')](_0x76aa('0x1f'),_0x2111c7+'-'+_0x550d9a+'/'+_0x5cf594)['json'](_0x319bf1);}return null;};}function patchUpdates(_0x5d6202){return function(_0x256636){try{jsonpatch[_0x76aa('0x20')](_0x256636,_0x5d6202,!![]);}catch(_0xf0711){return BPromise[_0x76aa('0x21')](_0xf0711);}return _0x256636[_0x76aa('0x22')]();};}function saveUpdates(_0x191560,_0x19af92){return function(_0x2eaf48){if(_0x2eaf48){return _0x2eaf48[_0x76aa('0x23')](_0x191560)['then'](function(_0x39ac5a){return _0x39ac5a;});}return null;};}function removeEntity(_0x21064c,_0x338a6b){return function(_0x5b3f55){if(_0x5b3f55){return _0x5b3f55[_0x76aa('0x24')]()[_0x76aa('0x25')](function(){var _0x31252f=_0x5b3f55[_0x76aa('0x26')]({'plain':!![]});var _0x29c50c=_0x76aa('0x27');return db[_0x76aa('0x28')][_0x76aa('0x24')]({'where':{'type':_0x29c50c,'resourceId':_0x31252f['id']}})[_0x76aa('0x25')](function(){return _0x5b3f55;});})[_0x76aa('0x25')](function(){_0x21064c[_0x76aa('0x19')](0xcc)[_0x76aa('0x1a')]();});}};}function handleEntityNotFound(_0x3599a9,_0x4ef9b0){return function(_0xb5e8a9){if(!_0xb5e8a9){_0x3599a9[_0x76aa('0x18')](0x194);}return _0xb5e8a9;};}function handleError(_0x25c614,_0x2e7ab4){_0x2e7ab4=_0x2e7ab4||0x1f4;return function(_0xa1e6){logger[_0x76aa('0x29')](_0xa1e6[_0x76aa('0x2a')]);if(_0xa1e6[_0x76aa('0x2b')]){delete _0xa1e6[_0x76aa('0x2b')];}_0x25c614[_0x76aa('0x19')](_0x2e7ab4)['send'](_0xa1e6);};}exports[_0x76aa('0x2c')]=function(_0x5a8030,_0x994550){var _0x365ff8={},_0x2dec94={},_0x1e90b9={'count':0x0,'rows':[]};var _0x1eecd9=db[_0x76aa('0x2d')][_0x76aa('0x2e')];_0x2dec94[_0x76aa('0x2f')]=_[_0x76aa('0x30')](_0x1eecd9);_0x2dec94[_0x76aa('0x31')]=_['keys'](_0x5a8030[_0x76aa('0x31')]);_0x2dec94[_0x76aa('0x32')]=_[_0x76aa('0x33')](_0x2dec94[_0x76aa('0x2f')],_0x2dec94[_0x76aa('0x31')]);_0x365ff8[_0x76aa('0x34')]=_[_0x76aa('0x33')](_0x2dec94['model'],qs[_0x76aa('0x35')](_0x5a8030[_0x76aa('0x31')]['fields']));_0x365ff8[_0x76aa('0x34')]=_0x365ff8['attributes'][_0x76aa('0x36')]?_0x365ff8['attributes']:_0x2dec94[_0x76aa('0x2f')];if(!_0x5a8030['query']['hasOwnProperty'](_0x76aa('0x37'))){_0x365ff8[_0x76aa('0x1d')]=qs[_0x76aa('0x1d')](_0x5a8030[_0x76aa('0x31')]['limit']);_0x365ff8['offset']=qs[_0x76aa('0x1c')](_0x5a8030[_0x76aa('0x31')][_0x76aa('0x1c')]);}_0x365ff8[_0x76aa('0x38')]=qs[_0x76aa('0x39')](_0x5a8030['query'][_0x76aa('0x39')]);_0x365ff8['where']=qs['filters'](_[_0x76aa('0x3a')](_0x5a8030[_0x76aa('0x31')],_0x2dec94[_0x76aa('0x32')]));if(_0x5a8030[_0x76aa('0x31')]['filter']){_0x365ff8[_0x76aa('0x3b')]=_[_0x76aa('0x3c')](_0x365ff8[_0x76aa('0x3b')],{'$or':_['map'](_0x1eecd9,function(_0x113770){if(_0x113770[_0x76aa('0x3d')][_0x76aa('0x3e')]!==_0x76aa('0x3f')){var _0x45d7b3={};_0x45d7b3[_0x113770[_0x76aa('0x40')]]={'$like':'%'+_0x5a8030[_0x76aa('0x31')][_0x76aa('0x41')]+'%'};return _0x45d7b3;}})});}_0x365ff8=_[_0x76aa('0x3c')]({},_0x365ff8,_0x5a8030['options']);var _0x1525cb={'where':_0x365ff8[_0x76aa('0x3b')]};return db[_0x76aa('0x2d')][_0x76aa('0x42')](_0x1525cb)[_0x76aa('0x25')](function(_0x2957aa){_0x1e90b9['count']=_0x2957aa;if(_0x5a8030['query'][_0x76aa('0x43')]){_0x365ff8[_0x76aa('0x44')]=[{'all':!![]}];}return db[_0x76aa('0x2d')][_0x76aa('0x45')](_0x365ff8);})['then'](function(_0x174a14){_0x1e90b9[_0x76aa('0x46')]=_0x174a14;return _0x1e90b9;})[_0x76aa('0x25')](respondWithFilteredResult(_0x994550,_0x365ff8))[_0x76aa('0x47')](handleError(_0x994550,null));};exports[_0x76aa('0x48')]=function(_0x4aa2f3,_0x13dafe){var _0x556f59={'raw':![],'where':{'id':_0x4aa2f3['params']['id']}},_0xbb3136={};_0xbb3136['model']=_['keys'](db[_0x76aa('0x2d')]['rawAttributes']);_0xbb3136['query']=_['keys'](_0x4aa2f3[_0x76aa('0x31')]);_0xbb3136[_0x76aa('0x32')]=_[_0x76aa('0x33')](_0xbb3136[_0x76aa('0x2f')],_0xbb3136[_0x76aa('0x31')]);_0x556f59['attributes']=_[_0x76aa('0x33')](_0xbb3136[_0x76aa('0x2f')],qs[_0x76aa('0x35')](_0x4aa2f3[_0x76aa('0x31')][_0x76aa('0x35')]));_0x556f59['attributes']=_0x556f59[_0x76aa('0x34')][_0x76aa('0x36')]?_0x556f59['attributes']:_0xbb3136[_0x76aa('0x2f')];if(_0x4aa2f3['query'][_0x76aa('0x43')]){_0x556f59[_0x76aa('0x44')]=[{'all':!![]}];}_0x556f59=_[_0x76aa('0x3c')]({},_0x556f59,_0x4aa2f3[_0x76aa('0x49')]);return db[_0x76aa('0x2d')][_0x76aa('0x4a')](_0x556f59)[_0x76aa('0x25')](handleEntityNotFound(_0x13dafe,null))[_0x76aa('0x25')](respondWithResult(_0x13dafe,null))[_0x76aa('0x47')](handleError(_0x13dafe,null));};exports[_0x76aa('0x4b')]=function(_0x5e4967,_0xbbd734){return db['AnalyticCustomReport'][_0x76aa('0x4b')](_0x5e4967[_0x76aa('0x4c')],{})[_0x76aa('0x25')](function(_0x156d4e){var _0x5ca721=_0x5e4967['user'][_0x76aa('0x26')]({'plain':!![]});if(!_0x5ca721)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5ca721[_0x76aa('0x4d')]===_0x76aa('0x4e')){var _0x4315b3=_0x156d4e[_0x76aa('0x26')]({'plain':!![]});var _0x30c577=_0x76aa('0x4f');return db['UserProfileSection']['find']({'where':{'name':_0x30c577,'userProfileId':_0x5ca721[_0x76aa('0x50')]},'raw':!![]})[_0x76aa('0x25')](function(_0x1708d4){if(_0x1708d4&&_0x1708d4[_0x76aa('0x51')]===0x0){return db[_0x76aa('0x28')][_0x76aa('0x4b')]({'name':_0x4315b3['name'],'resourceId':_0x4315b3['id'],'type':_0x76aa('0x27'),'sectionId':_0x1708d4['id']},{})[_0x76aa('0x25')](function(){return _0x156d4e;});}else{return _0x156d4e;}})[_0x76aa('0x47')](function(_0x4b3d2a){logger[_0x76aa('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4b3d2a);throw _0x4b3d2a;});}return _0x156d4e;})[_0x76aa('0x25')](respondWithResult(_0xbbd734,0xc9))['catch'](handleError(_0xbbd734,null));};exports[_0x76aa('0x23')]=function(_0x4449c1,_0x3c63e5){if(_0x4449c1[_0x76aa('0x4c')]['id']){delete _0x4449c1[_0x76aa('0x4c')]['id'];}return db[_0x76aa('0x2d')][_0x76aa('0x4a')]({'where':{'id':_0x4449c1['params']['id']}})[_0x76aa('0x25')](handleEntityNotFound(_0x3c63e5,null))['then'](saveUpdates(_0x4449c1[_0x76aa('0x4c')],null))[_0x76aa('0x25')](respondWithResult(_0x3c63e5,null))[_0x76aa('0x47')](handleError(_0x3c63e5,null));};exports[_0x76aa('0x24')]=function(_0x3fa7ec,_0x28f8aa){return db[_0x76aa('0x2d')]['find']({'where':{'id':_0x3fa7ec[_0x76aa('0x52')]['id']}})[_0x76aa('0x25')](handleEntityNotFound(_0x28f8aa,null))[_0x76aa('0x25')](removeEntity(_0x28f8aa,null))[_0x76aa('0x47')](handleError(_0x28f8aa,null));};exports['preview']=function(_0xb9401b,_0x163440){var _0x8dc601=0xa;var _0x410933=[_0x76aa('0x53'),_0x76aa('0x54'),'right_join',_0x76aa('0x55')];var _0xbf78c7={'SUM':_0x76aa('0x56'),'COUNT':_0x76aa('0x57'),'COUNT DISTINCT':_0x76aa('0x58'),'MAX':_0x76aa('0x59'),'MIN':_0x76aa('0x5a'),'AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x76aa('0x5b'),'GROUP_CONCAT DESC':_0x76aa('0x5c')};var _0x5713e7={'SEC_TO_TIME':_0x76aa('0x5d'),'DATE':_0x76aa('0x5e'),'HOUR':'HOUR(%s)','ROUND':_0x76aa('0x5f'),'UNIX_TIMESTAMP':_0x76aa('0x60')};var _0x1928c2=function(_0x22de7c){return!_[_0x76aa('0x61')]([_0x76aa('0x62'),_0x76aa('0x63'),_0x76aa('0x64'),_0x76aa('0x65')],_0x22de7c);};var _0x57d778=function(_0xd337f0){if(!_0xd337f0||!_0xd337f0['rules'][_0x76aa('0x36')]){return'';}for(var _0x46dbac='(',_0x2fef92=0x0;_0x2fef92<_0xd337f0[_0x76aa('0x66')][_0x76aa('0x36')];_0x2fef92+=0x1){_0x2fef92>0x0&&(_0x46dbac+='\x20'+_0xd337f0[_0x76aa('0x67')]+'\x20');_0x46dbac+=_0xd337f0[_0x76aa('0x66')][_0x2fef92][_0x76aa('0x68')]?_0x57d778(_0xd337f0[_0x76aa('0x66')][_0x2fef92]['group']):_0xd337f0[_0x76aa('0x66')][_0x2fef92][_0x76aa('0x40')]+'\x20'+_0xd337f0[_0x76aa('0x66')][_0x2fef92][_0x76aa('0x69')]+(_0x1928c2(_0xd337f0[_0x76aa('0x66')][_0x2fef92][_0x76aa('0x69')])?'\x20'+_0xd337f0[_0x76aa('0x66')][_0x2fef92][_0x76aa('0x6a')]:'');}return _0x46dbac+')';};var _0x5546b6={'where':{'id':_0xb9401b[_0x76aa('0x52')]['id']}},_0x364d05,_0x4d3ad0,_0x35bd2b,_0x35881c,_0x3e97f8;_0x5546b6=_[_0x76aa('0x3c')]({},_0x5546b6,_0xb9401b[_0x76aa('0x49')]);return db[_0x76aa('0x2d')]['find'](_0x5546b6)[_0x76aa('0x25')](function(_0x23e616){if(_0x23e616){_0x364d05=_0x23e616;return _0x23e616['getFields']();}return null;})['then'](function(_0x40429c){if(_0x40429c){if(!_0x40429c[_0x76aa('0x36')]){throw new db['Sequelize'][(_0x76aa('0x6b'))](_0x76aa('0x6c'),0x193);}_0x4d3ad0=_0x40429c;return db[_0x76aa('0x6d')]['findAll']({'raw':!![]});}return null;})[_0x76aa('0x25')](function(_0x47f733){if(_0x47f733){_0x35bd2b=_[_0x76aa('0x6e')](_0x47f733,'id');var _0x1178e5;var _0x2315cf=squel[_0x76aa('0x6f')]();_0x2315cf['from'](_0x364d05['table']);for(var _0x40b8f4=0x0;_0x40b8f4<_0x4d3ad0['length'];_0x40b8f4+=0x1){_0x1178e5=_0x4d3ad0[_0x40b8f4][_0x76aa('0x70')]?_0x35bd2b[_0x4d3ad0[_0x40b8f4][_0x76aa('0x70')]][_0x76aa('0x71')]:_0x4d3ad0[_0x40b8f4][_0x76aa('0x40')];_0x1178e5=_0x4d3ad0[_0x40b8f4][_0x76aa('0x72')]?_[_0x76aa('0x73')](_0xbf78c7[_0x4d3ad0[_0x40b8f4][_0x76aa('0x72')]],'%s',_0x1178e5):_0x1178e5;_0x1178e5=_0x4d3ad0[_0x40b8f4][_0x76aa('0x74')]?_[_0x76aa('0x73')](_0x5713e7[_0x4d3ad0[_0x40b8f4]['format']],'%s',_0x1178e5):_0x1178e5;if(_0x4d3ad0[_0x40b8f4][_0x76aa('0x75')]){_0x2315cf[_0x76aa('0x68')](_0x1178e5);}_0x4d3ad0[_0x40b8f4][_0x76aa('0x76')]&&_0x2315cf[_0x76aa('0x38')](_0x1178e5,_0x4d3ad0[_0x40b8f4]['orderBy']==='DESC'?![]:!![]);_0x2315cf['field'](_0x1178e5,_0x4d3ad0[_0x40b8f4][_0x76aa('0x77')]||_0x1178e5);}if(_0x364d05['joins']){_0x364d05[_0x76aa('0x78')]=JSON[_0x76aa('0x79')](_0x364d05[_0x76aa('0x78')]);for(var _0x3e62b4=0x0;_0x3e62b4<_0x364d05['joins'][_0x76aa('0x36')];_0x3e62b4+=0x1){if(_0x364d05['joins'][_0x3e62b4][_0x76aa('0x3d')]&&_[_0x76aa('0x61')](_0x410933,_0x364d05[_0x76aa('0x78')][_0x3e62b4][_0x76aa('0x3d')])&&_0x364d05[_0x76aa('0x78')][_0x3e62b4]['parentKey']&&_0x364d05[_0x76aa('0x78')][_0x3e62b4][_0x76aa('0x7a')]&&_0x364d05[_0x76aa('0x78')][_0x3e62b4][_0x76aa('0x7b')]){_0x2315cf[_0x364d05[_0x76aa('0x78')][_0x3e62b4][_0x76aa('0x3d')]](_0x364d05[_0x76aa('0x78')][_0x3e62b4][_0x76aa('0x7a')],null,util['format'](_0x76aa('0x7c'),_0x364d05[_0x76aa('0x7d')],_0x364d05['joins'][_0x3e62b4][_0x76aa('0x7e')],_0x364d05[_0x76aa('0x78')][_0x3e62b4][_0x76aa('0x7a')],_0x364d05[_0x76aa('0x78')][_0x3e62b4][_0x76aa('0x7b')]));}}}if(_0x364d05[_0x76aa('0x7f')]){_0x364d05[_0x76aa('0x7f')]=JSON['parse'](_0x364d05[_0x76aa('0x7f')]);_0x2315cf['where'](_0x57d778(_0x364d05['conditions'][_0x76aa('0x68')]));}_0x3e97f8=_0x2315cf[_0x76aa('0x80')]();_0x2315cf['limit'](_0x8dc601);_0x2315cf['offset'](0x0);logger[_0x76aa('0x81')](_0x76aa('0x82'),_0x2315cf[_0x76aa('0x83')]());return db['sequelize']['query'](_0x2315cf[_0x76aa('0x83')](),{'type':db[_0x76aa('0x84')][_0x76aa('0x85')]['SELECT']});}})[_0x76aa('0x25')](respondWithResult(_0x163440,null))['catch'](handleError(_0x163440,null));};function runReport(_0x521bae,_0x306cc6,_0x383290){var _0x325ffa=_0x306cc6[_0x76aa('0x2b')];var _0x486d86=0xa;var _0x5a79ba=[_0x76aa('0x53'),_0x76aa('0x54'),_0x76aa('0x86'),'cross_join'];var _0x424638={'SUM':_0x76aa('0x56'),'COUNT':_0x76aa('0x57'),'COUNT DISTINCT':_0x76aa('0x58'),'MAX':_0x76aa('0x59'),'MIN':'MIN(%s)','AVG':_0x76aa('0x87'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x76aa('0x5b'),'GROUP_CONCAT DESC':_0x76aa('0x5c')};var _0x2785e4={'SEC_TO_TIME':_0x76aa('0x5d'),'DATE':_0x76aa('0x5e'),'HOUR':_0x76aa('0x88'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x547411=function(_0x47dd29){return!_['includes']([_0x76aa('0x62'),_0x76aa('0x63'),'IS\x20EMPTY','IS\x20NOT\x20EMPTY'],_0x47dd29);};var _0x4f01e9=function(_0x3a6326){if(!_0x3a6326||!_0x3a6326[_0x76aa('0x66')][_0x76aa('0x36')]){return'';}for(var _0x506a41='(',_0x48671a=0x0;_0x48671a<_0x3a6326[_0x76aa('0x66')][_0x76aa('0x36')];_0x48671a+=0x1){_0x48671a>0x0&&(_0x506a41+='\x20'+_0x3a6326[_0x76aa('0x67')]+'\x20');_0x506a41+=_0x3a6326[_0x76aa('0x66')][_0x48671a][_0x76aa('0x68')]?_0x4f01e9(_0x3a6326['rules'][_0x48671a]['group']):_0x3a6326[_0x76aa('0x66')][_0x48671a]['field']+'\x20'+_0x3a6326['rules'][_0x48671a]['condition']+(_0x547411(_0x3a6326[_0x76aa('0x66')][_0x48671a][_0x76aa('0x69')])?'\x20'+_0x3a6326['rules'][_0x48671a][_0x76aa('0x6a')]:'');}return _0x506a41+')';};var _0x2da63b={'where':{'id':_0x521bae['id']}},_0x59f9d7,_0x22063f,_0x24331a,_0x11d91f,_0x258e5a;_0x2da63b=_[_0x76aa('0x3c')]({},_0x2da63b,_0x383290);return db[_0x76aa('0x2d')][_0x76aa('0x4a')](_0x2da63b)[_0x76aa('0x25')](function(_0x2243be){if(_0x2243be){_0x59f9d7=_0x2243be;return _0x2243be['getFields']();}return null;})[_0x76aa('0x25')](function(_0xc877b1){if(_0xc877b1){if(!_0xc877b1['length']){throw new db[(_0x76aa('0x89'))][(_0x76aa('0x6b'))](_0x76aa('0x6c'),0x193);}_0x22063f=_0xc877b1;return db['AnalyticMetric'][_0x76aa('0x45')]({'raw':!![]});}return null;})[_0x76aa('0x25')](function(_0x4df4e0){if(_0x4df4e0){_0x24331a=_[_0x76aa('0x6e')](_0x4df4e0,'id');var _0x3320a2;var _0x203b1f=squel['select']();_0x203b1f[_0x76aa('0x8a')](_0x59f9d7[_0x76aa('0x7d')]);for(var _0x50a51f=0x0;_0x50a51f<_0x22063f['length'];_0x50a51f+=0x1){_0x3320a2=_0x22063f[_0x50a51f]['MetricId']?_0x24331a[_0x22063f[_0x50a51f][_0x76aa('0x70')]][_0x76aa('0x71')]:_0x22063f[_0x50a51f][_0x76aa('0x40')];_0x3320a2=_0x22063f[_0x50a51f][_0x76aa('0x72')]?_['replace'](_0x424638[_0x22063f[_0x50a51f]['function']],'%s',_0x3320a2):_0x3320a2;_0x3320a2=_0x22063f[_0x50a51f]['format']?_[_0x76aa('0x73')](_0x2785e4[_0x22063f[_0x50a51f]['format']],'%s',_0x3320a2):_0x3320a2;if(_0x22063f[_0x50a51f][_0x76aa('0x75')]){_0x203b1f[_0x76aa('0x68')](_0x3320a2);}_0x22063f[_0x50a51f]['orderBy']&&_0x203b1f[_0x76aa('0x38')](_0x3320a2,_0x22063f[_0x50a51f][_0x76aa('0x76')]==='DESC'?![]:!![]);_0x203b1f[_0x76aa('0x40')](_0x3320a2,_0x22063f[_0x50a51f][_0x76aa('0x77')]||_0x3320a2);}if(_0x59f9d7[_0x76aa('0x78')]){_0x59f9d7[_0x76aa('0x78')]=JSON[_0x76aa('0x79')](_0x59f9d7[_0x76aa('0x78')]);for(var _0x4aee18=0x0;_0x4aee18<_0x59f9d7[_0x76aa('0x78')]['length'];_0x4aee18+=0x1){if(_0x59f9d7['joins'][_0x4aee18]['type']&&_['includes'](_0x5a79ba,_0x59f9d7['joins'][_0x4aee18][_0x76aa('0x3d')])&&_0x59f9d7[_0x76aa('0x78')][_0x4aee18][_0x76aa('0x7e')]&&_0x59f9d7[_0x76aa('0x78')][_0x4aee18]['foreignTable']&&_0x59f9d7[_0x76aa('0x78')][_0x4aee18][_0x76aa('0x7b')]){_0x203b1f[_0x59f9d7[_0x76aa('0x78')][_0x4aee18][_0x76aa('0x3d')]](_0x59f9d7[_0x76aa('0x78')][_0x4aee18]['foreignTable'],null,util[_0x76aa('0x74')](_0x76aa('0x7c'),_0x59f9d7[_0x76aa('0x7d')],_0x59f9d7[_0x76aa('0x78')][_0x4aee18][_0x76aa('0x7e')],_0x59f9d7[_0x76aa('0x78')][_0x4aee18][_0x76aa('0x7a')],_0x59f9d7['joins'][_0x4aee18][_0x76aa('0x7b')]));}}}if(_0x59f9d7[_0x76aa('0x7f')]){_0x59f9d7['conditions']=JSON['parse'](_0x59f9d7[_0x76aa('0x7f')]);_0x203b1f[_0x76aa('0x3b')](_0x4f01e9(_0x59f9d7['conditions'][_0x76aa('0x68')]));}_0x258e5a=_0x203b1f['clone']();_0x203b1f[_0x76aa('0x1d')](_0x486d86);_0x203b1f['offset'](0x0);logger[_0x76aa('0x81')](_0x76aa('0x82'),_0x203b1f[_0x76aa('0x83')]());return db[_0x76aa('0x84')][_0x76aa('0x31')](_0x203b1f['toString'](),{'type':db[_0x76aa('0x84')]['QueryTypes'][_0x76aa('0x8b')]});}})[_0x76aa('0x25')](function(_0x53ea01){if(!_0x53ea01['length']){throw new db[(_0x76aa('0x89'))][(_0x76aa('0x6b'))](_0x76aa('0x8c'),0xcc);}if(_0x306cc6[_0x76aa('0x8d')]==='web'){return null;}var _0x5a1577=_[_0x76aa('0x3c')](_0x306cc6,{'name':_0x306cc6['fullPath']||_0x306cc6[_0x76aa('0x2b')]||_0x59f9d7['name'],'basename':_0x325ffa,'savename':util[_0x76aa('0x74')](_0x76aa('0x8e'),_0x306cc6['name']||_0x59f9d7[_0x76aa('0x2b')],require('randomstring')['generate'](0x4),_0x306cc6[_0x76aa('0x8d')]||_0x76aa('0x8f')),'reportId':_0x59f9d7['id'],'reportType':'custom'});return db[_0x76aa('0x90')][_0x76aa('0x4b')](_0x5a1577,{'raw':!![]});})[_0x76aa('0x25')](function(_0x52762c){if(_0x59f9d7[_0x76aa('0x7d')]===_0x76aa('0x91')){_0x258e5a[_0x76aa('0x3b')](_0x59f9d7[_0x76aa('0x7d')]+_0x76aa('0x92'),_0x306cc6[_0x76aa('0x93')],_0x306cc6[_0x76aa('0x94')]);}else{_0x258e5a[_0x76aa('0x3b')](_0x59f9d7[_0x76aa('0x7d')]+_0x76aa('0x95'),_0x306cc6[_0x76aa('0x93')],_0x306cc6[_0x76aa('0x94')]);}if(_0x52762c){logger['info'](_0x76aa('0x96'),_0x258e5a[_0x76aa('0x83')]());require('child_process')[_0x76aa('0x97')](path[_0x76aa('0x53')](__dirname,'../../components/export/',_0x52762c['output']),[_0x52762c['id'],_0x258e5a[_0x76aa('0x83')](),path[_0x76aa('0x53')](__dirname,'../../files/reports',_0x52762c[_0x76aa('0x98')]),_0x325ffa]);return _0x52762c;}else{var _0x429500=squel[_0x76aa('0x6f')]();_0x429500['from']('('+_0x258e5a[_0x76aa('0x83')]()+')',_0x76aa('0x99'));_0x429500['field'](_0x76aa('0x9a'),_0x76aa('0x42'));_0x258e5a[_0x76aa('0x1d')](_0x306cc6[_0x76aa('0x1d')]||_0x486d86);_0x258e5a[_0x76aa('0x1c')](_0x306cc6[_0x76aa('0x1c')]||0x0);return db['sequelize'][_0x76aa('0x31')](_0x429500['toString'](),{'type':db[_0x76aa('0x84')][_0x76aa('0x85')][_0x76aa('0x8b')]})['then'](function(_0x4c5f54){if(!_0x4c5f54[_0x76aa('0x36')]){_0x11d91f=0x0;}else{_0x11d91f=_0x4c5f54[0x0][_0x76aa('0x42')]||0x0;}return db[_0x76aa('0x84')][_0x76aa('0x31')](_0x258e5a[_0x76aa('0x83')](),{'type':db[_0x76aa('0x84')]['QueryTypes']['SELECT']});})[_0x76aa('0x25')](function(_0x109bd3){return{'rows':_0x109bd3||[],'count':_0x11d91f};});}});}exports[_0x76aa('0x9b')]=function(_0x46614f,_0x507d7f){return runReport(_0x46614f[_0x76aa('0x52')],_0x46614f['query'],_0x46614f['options'])[_0x76aa('0x25')](respondWithResult(_0x507d7f,null))[_0x76aa('0x47')](handleError(_0x507d7f,null));};exports[_0x76aa('0x9c')]=runReport;exports['query']=function(_0x7aac18,_0x3839aa){var _0x2abcef=0xa;var _0x26a2a7=[_0x76aa('0x53'),_0x76aa('0x54'),_0x76aa('0x86'),'cross_join'];var _0x344ea4={'SUM':_0x76aa('0x56'),'COUNT':_0x76aa('0x57'),'COUNT DISTINCT':_0x76aa('0x58'),'MAX':_0x76aa('0x59'),'MIN':_0x76aa('0x5a'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x76aa('0x9d'),'GROUP_CONCAT ASC':_0x76aa('0x5b'),'GROUP_CONCAT DESC':_0x76aa('0x5c')};var _0x34169e={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x76aa('0x5e'),'HOUR':_0x76aa('0x88'),'ROUND':_0x76aa('0x5f'),'UNIX_TIMESTAMP':_0x76aa('0x60')};var _0x4126c8=function(_0x535cc9){return!_[_0x76aa('0x61')]([_0x76aa('0x62'),'IS\x20NOT\x20NULL','IS\x20EMPTY',_0x76aa('0x65')],_0x535cc9);};var _0x1a8874=function(_0x3faafe){if(!_0x3faafe||!_0x3faafe[_0x76aa('0x66')][_0x76aa('0x36')]){return'';}for(var _0x293221='(',_0x482665=0x0;_0x482665<_0x3faafe[_0x76aa('0x66')][_0x76aa('0x36')];_0x482665+=0x1){_0x482665>0x0&&(_0x293221+='\x20'+_0x3faafe[_0x76aa('0x67')]+'\x20');_0x293221+=_0x3faafe[_0x76aa('0x66')][_0x482665][_0x76aa('0x68')]?_0x1a8874(_0x3faafe[_0x76aa('0x66')][_0x482665]['group']):_0x3faafe[_0x76aa('0x66')][_0x482665][_0x76aa('0x40')]+'\x20'+_0x3faafe[_0x76aa('0x66')][_0x482665][_0x76aa('0x69')]+(_0x4126c8(_0x3faafe[_0x76aa('0x66')][_0x482665][_0x76aa('0x69')])?'\x20'+_0x3faafe['rules'][_0x482665][_0x76aa('0x6a')]:'');}return _0x293221+')';};var _0x4d0d76={'where':{'id':_0x7aac18[_0x76aa('0x52')]['id']}},_0x1482e5,_0x4e136f,_0x37edb8,_0x2f879e,_0x56d6af;_0x4d0d76=_[_0x76aa('0x3c')]({},_0x4d0d76,_0x7aac18[_0x76aa('0x49')]);return db['AnalyticCustomReport'][_0x76aa('0x4a')](_0x4d0d76)[_0x76aa('0x25')](function(_0x5069d8){if(_0x5069d8){_0x1482e5=_0x5069d8;return _0x5069d8[_0x76aa('0x9e')]();}return null;})[_0x76aa('0x25')](function(_0x343adf){if(_0x343adf){if(!_0x343adf[_0x76aa('0x36')]){throw new db[(_0x76aa('0x89'))][(_0x76aa('0x6b'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x4e136f=_0x343adf;return db[_0x76aa('0x6d')][_0x76aa('0x45')]({'raw':!![]});}return null;})[_0x76aa('0x25')](function(_0x840136){if(_0x840136){_0x37edb8=_[_0x76aa('0x6e')](_0x840136,'id');var _0x28e1a4;var _0x8bb516=squel[_0x76aa('0x6f')]();_0x8bb516[_0x76aa('0x8a')](_0x1482e5[_0x76aa('0x7d')]);for(var _0x2a74cf=0x0;_0x2a74cf<_0x4e136f['length'];_0x2a74cf+=0x1){_0x28e1a4=_0x4e136f[_0x2a74cf][_0x76aa('0x70')]?_0x37edb8[_0x4e136f[_0x2a74cf][_0x76aa('0x70')]][_0x76aa('0x71')]:_0x4e136f[_0x2a74cf][_0x76aa('0x40')];_0x28e1a4=_0x4e136f[_0x2a74cf][_0x76aa('0x72')]?_[_0x76aa('0x73')](_0x344ea4[_0x4e136f[_0x2a74cf][_0x76aa('0x72')]],'%s',_0x28e1a4):_0x28e1a4;_0x28e1a4=_0x4e136f[_0x2a74cf][_0x76aa('0x74')]?_['replace'](_0x34169e[_0x4e136f[_0x2a74cf][_0x76aa('0x74')]],'%s',_0x28e1a4):_0x28e1a4;if(_0x4e136f[_0x2a74cf]['groupBy']){_0x8bb516[_0x76aa('0x68')](_0x28e1a4);}_0x4e136f[_0x2a74cf][_0x76aa('0x76')]&&_0x8bb516[_0x76aa('0x38')](_0x28e1a4,_0x4e136f[_0x2a74cf]['orderBy']===_0x76aa('0x9f')?![]:!![]);_0x8bb516[_0x76aa('0x40')](_0x28e1a4,_0x4e136f[_0x2a74cf][_0x76aa('0x77')]||_0x28e1a4);}if(_0x1482e5[_0x76aa('0x78')]){_0x1482e5[_0x76aa('0x78')]=JSON['parse'](_0x1482e5[_0x76aa('0x78')]);for(var _0x4d8c38=0x0;_0x4d8c38<_0x1482e5[_0x76aa('0x78')][_0x76aa('0x36')];_0x4d8c38+=0x1){if(_0x1482e5['joins'][_0x4d8c38][_0x76aa('0x3d')]&&_[_0x76aa('0x61')](_0x26a2a7,_0x1482e5[_0x76aa('0x78')][_0x4d8c38][_0x76aa('0x3d')])&&_0x1482e5[_0x76aa('0x78')][_0x4d8c38][_0x76aa('0x7e')]&&_0x1482e5[_0x76aa('0x78')][_0x4d8c38][_0x76aa('0x7a')]&&_0x1482e5['joins'][_0x4d8c38][_0x76aa('0x7b')]){_0x8bb516[_0x1482e5[_0x76aa('0x78')][_0x4d8c38][_0x76aa('0x3d')]](_0x1482e5[_0x76aa('0x78')][_0x4d8c38][_0x76aa('0x7a')],null,util[_0x76aa('0x74')](_0x76aa('0x7c'),_0x1482e5[_0x76aa('0x7d')],_0x1482e5['joins'][_0x4d8c38][_0x76aa('0x7e')],_0x1482e5[_0x76aa('0x78')][_0x4d8c38][_0x76aa('0x7a')],_0x1482e5['joins'][_0x4d8c38][_0x76aa('0x7b')]));}}}if(_0x1482e5[_0x76aa('0x7f')]){_0x1482e5[_0x76aa('0x7f')]=JSON[_0x76aa('0x79')](_0x1482e5[_0x76aa('0x7f')]);_0x8bb516['where'](_0x1a8874(_0x1482e5[_0x76aa('0x7f')]['group']));}_0x56d6af=_0x8bb516[_0x76aa('0x80')]();_0x8bb516[_0x76aa('0x1d')](_0x2abcef);_0x8bb516[_0x76aa('0x1c')](0x0);logger[_0x76aa('0x81')](_0x76aa('0x82'),_0x8bb516['toString']());return db[_0x76aa('0x84')]['query'](_0x8bb516[_0x76aa('0x83')](),{'type':db[_0x76aa('0x84')][_0x76aa('0x85')]['SELECT']});}})[_0x76aa('0x25')](function(){return{'sql':_0x56d6af['toString']()};})[_0x76aa('0x25')](respondWithResult(_0x3839aa,null))[_0x76aa('0x47')](handleError(_0x3839aa,null));}; \ No newline at end of file +var _0x54ef=['query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','map','VIRTUAL','field','options','AnalyticCustomReport','includeAll','include','findAll','catch','params','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','Reports','UserProfileSection','userProfileId','autoAssociation','CustomReports','body','preview','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','condition','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','keyBy','from','table','MetricId','metric','replace','function','format','groupBy','orderBy','DESC','alias','joins','parse','type','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','clone','debug','Limited\x20Query:','sequelize','toString','SELECT','join','MAX(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','DATE(%s)','IS\x20NULL','IS\x20NOT\x20NULL','select','QueryTypes','No\x20available\x20data','web','fullPath','generate','csv','custom','AnalyticExtractedReport','cdr','startDate','endDate','info','Run\x20Query:','child_process','fork','countTable','COUNT(*)','run','runReport','MIN(%s)','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','lodash','squel','jsforce','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','save','update','then','destroy','UserProfileResource','stack','name','send','index','rawAttributes','model','keys'];(function(_0x580647,_0x43d2c3){var _0x5f0792=function(_0x386cef){while(--_0x386cef){_0x580647['push'](_0x580647['shift']());}};_0x5f0792(++_0x43d2c3);}(_0x54ef,0x112));var _0xf54e=function(_0x45cc77,_0x2b6c30){_0x45cc77=_0x45cc77-0x0;var _0x28402f=_0x54ef[_0x45cc77];return _0x28402f;};'use strict';var pdf=require(_0xf54e('0x0'));var emlformat=require(_0xf54e('0x1'));var rimraf=require(_0xf54e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf54e('0x3'));var rp=require(_0xf54e('0x4'));var moment=require(_0xf54e('0x5'));var BPromise=require(_0xf54e('0x6'));var Mustache=require(_0xf54e('0x7'));var util=require(_0xf54e('0x8'));var path=require(_0xf54e('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xf54e('0xa'));var fs=require('fs');var _=require(_0xf54e('0xb'));var squel=require(_0xf54e('0xc'));var crypto=require('crypto');var jsforce=require(_0xf54e('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xf54e('0xe'));var querystring=require(_0xf54e('0xf'));var Papa=require('papaparse');var Redis=require(_0xf54e('0x10'));var authService=require(_0xf54e('0x11'));var qs=require(_0xf54e('0x12'));var 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 db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x358c88,_0x4b0ee1){_0x4b0ee1=_0x4b0ee1||0xcc;return function(_0x4bd828){if(_0x4bd828){return _0x358c88[_0xf54e('0x18')](_0x4b0ee1);}return _0x358c88[_0xf54e('0x19')](_0x4b0ee1)[_0xf54e('0x1a')]();};}function respondWithResult(_0x380f26,_0x5644aa){_0x5644aa=_0x5644aa||0xc8;return function(_0x331732){if(_0x331732){return _0x380f26[_0xf54e('0x19')](_0x5644aa)[_0xf54e('0x1b')](_0x331732);}};}function respondWithFilteredResult(_0x15f639,_0x56828e){return function(_0x2366ee){if(_0x2366ee){var _0x389abc=_0x2366ee[_0xf54e('0x1c')],_0x3eb415=_0x56828e[_0xf54e('0x1d')],_0x5c5d00=_0x56828e[_0xf54e('0x1d')]+_0x56828e[_0xf54e('0x1e')],_0x4af633;if(_0x5c5d00>=_0x389abc){_0x5c5d00=_0x389abc;_0x4af633=0xc8;}else{_0x4af633=0xce;}_0x15f639[_0xf54e('0x19')](_0x4af633);return _0x15f639[_0xf54e('0x1f')](_0xf54e('0x20'),_0x3eb415+'-'+_0x5c5d00+'/'+_0x389abc)[_0xf54e('0x1b')](_0x2366ee);}return null;};}function patchUpdates(_0x1dcc04){return function(_0x4689fe){try{jsonpatch[_0xf54e('0x21')](_0x4689fe,_0x1dcc04,!![]);}catch(_0x50fc66){return BPromise['reject'](_0x50fc66);}return _0x4689fe[_0xf54e('0x22')]();};}function saveUpdates(_0x59f338,_0x3e1556){return function(_0x1bfe99){if(_0x1bfe99){return _0x1bfe99[_0xf54e('0x23')](_0x59f338)[_0xf54e('0x24')](function(_0xf64f12){return _0xf64f12;});}return null;};}function removeEntity(_0x3887b0,_0x388aa0){return function(_0x11985e){if(_0x11985e){return _0x11985e[_0xf54e('0x25')]()[_0xf54e('0x24')](function(){var _0x1c58bd=_0x11985e['get']({'plain':!![]});var _0x6f6d29='CustomReports';return db[_0xf54e('0x26')][_0xf54e('0x25')]({'where':{'type':_0x6f6d29,'resourceId':_0x1c58bd['id']}})[_0xf54e('0x24')](function(){return _0x11985e;});})[_0xf54e('0x24')](function(){_0x3887b0[_0xf54e('0x19')](0xcc)[_0xf54e('0x1a')]();});}};}function handleEntityNotFound(_0x1e08d1,_0x43488d){return function(_0x2342a9){if(!_0x2342a9){_0x1e08d1[_0xf54e('0x18')](0x194);}return _0x2342a9;};}function handleError(_0xf6cdd7,_0x39c0ae){_0x39c0ae=_0x39c0ae||0x1f4;return function(_0x2ea001){logger['error'](_0x2ea001[_0xf54e('0x27')]);if(_0x2ea001['name']){delete _0x2ea001[_0xf54e('0x28')];}_0xf6cdd7['status'](_0x39c0ae)[_0xf54e('0x29')](_0x2ea001);};}exports[_0xf54e('0x2a')]=function(_0x21ba00,_0xa13cd0){var _0x25b643={},_0x3993e4={},_0x36f985={'count':0x0,'rows':[]};var _0x54bd8f=db['AnalyticCustomReport'][_0xf54e('0x2b')];_0x3993e4[_0xf54e('0x2c')]=_[_0xf54e('0x2d')](_0x54bd8f);_0x3993e4[_0xf54e('0x2e')]=_[_0xf54e('0x2d')](_0x21ba00[_0xf54e('0x2e')]);_0x3993e4[_0xf54e('0x2f')]=_[_0xf54e('0x30')](_0x3993e4[_0xf54e('0x2c')],_0x3993e4[_0xf54e('0x2e')]);_0x25b643['attributes']=_['intersection'](_0x3993e4[_0xf54e('0x2c')],qs[_0xf54e('0x31')](_0x21ba00['query'][_0xf54e('0x31')]));_0x25b643[_0xf54e('0x32')]=_0x25b643[_0xf54e('0x32')][_0xf54e('0x33')]?_0x25b643['attributes']:_0x3993e4['model'];if(!_0x21ba00['query'][_0xf54e('0x34')](_0xf54e('0x35'))){_0x25b643[_0xf54e('0x1e')]=qs[_0xf54e('0x1e')](_0x21ba00[_0xf54e('0x2e')][_0xf54e('0x1e')]);_0x25b643['offset']=qs['offset'](_0x21ba00['query'][_0xf54e('0x1d')]);}_0x25b643[_0xf54e('0x36')]=qs['sort'](_0x21ba00['query'][_0xf54e('0x37')]);_0x25b643[_0xf54e('0x38')]=qs[_0xf54e('0x2f')](_['pick'](_0x21ba00[_0xf54e('0x2e')],_0x3993e4[_0xf54e('0x2f')]));if(_0x21ba00['query'][_0xf54e('0x39')]){_0x25b643[_0xf54e('0x38')]=_[_0xf54e('0x3a')](_0x25b643[_0xf54e('0x38')],{'$or':_[_0xf54e('0x3b')](_0x54bd8f,function(_0x199056){if(_0x199056['type']['key']!==_0xf54e('0x3c')){var _0x3c66b3={};_0x3c66b3[_0x199056[_0xf54e('0x3d')]]={'$like':'%'+_0x21ba00['query'][_0xf54e('0x39')]+'%'};return _0x3c66b3;}})});}_0x25b643=_[_0xf54e('0x3a')]({},_0x25b643,_0x21ba00[_0xf54e('0x3e')]);var _0x1ee884={'where':_0x25b643[_0xf54e('0x38')]};return db[_0xf54e('0x3f')][_0xf54e('0x1c')](_0x1ee884)[_0xf54e('0x24')](function(_0x8b4c){_0x36f985[_0xf54e('0x1c')]=_0x8b4c;if(_0x21ba00[_0xf54e('0x2e')][_0xf54e('0x40')]){_0x25b643[_0xf54e('0x41')]=[{'all':!![]}];}return db[_0xf54e('0x3f')][_0xf54e('0x42')](_0x25b643);})['then'](function(_0x4f311f){_0x36f985['rows']=_0x4f311f;return _0x36f985;})[_0xf54e('0x24')](respondWithFilteredResult(_0xa13cd0,_0x25b643))[_0xf54e('0x43')](handleError(_0xa13cd0,null));};exports['show']=function(_0x3dae9b,_0x311ce1){var _0x381c03={'raw':![],'where':{'id':_0x3dae9b[_0xf54e('0x44')]['id']}},_0x4f61d7={};_0x4f61d7[_0xf54e('0x2c')]=_[_0xf54e('0x2d')](db[_0xf54e('0x3f')][_0xf54e('0x2b')]);_0x4f61d7[_0xf54e('0x2e')]=_[_0xf54e('0x2d')](_0x3dae9b[_0xf54e('0x2e')]);_0x4f61d7[_0xf54e('0x2f')]=_['intersection'](_0x4f61d7[_0xf54e('0x2c')],_0x4f61d7[_0xf54e('0x2e')]);_0x381c03[_0xf54e('0x32')]=_[_0xf54e('0x30')](_0x4f61d7[_0xf54e('0x2c')],qs[_0xf54e('0x31')](_0x3dae9b['query'][_0xf54e('0x31')]));_0x381c03['attributes']=_0x381c03[_0xf54e('0x32')]['length']?_0x381c03[_0xf54e('0x32')]:_0x4f61d7[_0xf54e('0x2c')];if(_0x3dae9b[_0xf54e('0x2e')]['includeAll']){_0x381c03[_0xf54e('0x41')]=[{'all':!![]}];}_0x381c03=_[_0xf54e('0x3a')]({},_0x381c03,_0x3dae9b[_0xf54e('0x3e')]);return db[_0xf54e('0x3f')][_0xf54e('0x45')](_0x381c03)['then'](handleEntityNotFound(_0x311ce1,null))[_0xf54e('0x24')](respondWithResult(_0x311ce1,null))[_0xf54e('0x43')](handleError(_0x311ce1,null));};exports[_0xf54e('0x46')]=function(_0x45592b,_0x5f3438){return db[_0xf54e('0x3f')][_0xf54e('0x46')](_0x45592b['body'],{})[_0xf54e('0x24')](function(_0xd4d956){var _0x3d24c7=_0x45592b[_0xf54e('0x47')]['get']({'plain':!![]});if(!_0x3d24c7)throw new Error(_0xf54e('0x48'));if(_0x3d24c7[_0xf54e('0x49')]===_0xf54e('0x47')){var _0xb4654f=_0xd4d956[_0xf54e('0x4a')]({'plain':!![]});var _0x3237ef=_0xf54e('0x4b');return db[_0xf54e('0x4c')][_0xf54e('0x45')]({'where':{'name':_0x3237ef,'userProfileId':_0x3d24c7[_0xf54e('0x4d')]},'raw':!![]})[_0xf54e('0x24')](function(_0x1f4cf8){if(_0x1f4cf8&&_0x1f4cf8[_0xf54e('0x4e')]===0x0){return db[_0xf54e('0x26')][_0xf54e('0x46')]({'name':_0xb4654f[_0xf54e('0x28')],'resourceId':_0xb4654f['id'],'type':_0xf54e('0x4f'),'sectionId':_0x1f4cf8['id']},{})[_0xf54e('0x24')](function(){return _0xd4d956;});}else{return _0xd4d956;}})[_0xf54e('0x43')](function(_0x480c44){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x480c44);throw _0x480c44;});}return _0xd4d956;})[_0xf54e('0x24')](respondWithResult(_0x5f3438,0xc9))[_0xf54e('0x43')](handleError(_0x5f3438,null));};exports[_0xf54e('0x23')]=function(_0x40557d,_0xba297c){if(_0x40557d[_0xf54e('0x50')]['id']){delete _0x40557d[_0xf54e('0x50')]['id'];}return db[_0xf54e('0x3f')][_0xf54e('0x45')]({'where':{'id':_0x40557d[_0xf54e('0x44')]['id']}})[_0xf54e('0x24')](handleEntityNotFound(_0xba297c,null))['then'](saveUpdates(_0x40557d[_0xf54e('0x50')],null))[_0xf54e('0x24')](respondWithResult(_0xba297c,null))[_0xf54e('0x43')](handleError(_0xba297c,null));};exports[_0xf54e('0x25')]=function(_0x1b8f16,_0x30f53b){return db[_0xf54e('0x3f')]['find']({'where':{'id':_0x1b8f16[_0xf54e('0x44')]['id']}})[_0xf54e('0x24')](handleEntityNotFound(_0x30f53b,null))[_0xf54e('0x24')](removeEntity(_0x30f53b,null))['catch'](handleError(_0x30f53b,null));};exports[_0xf54e('0x51')]=function(_0x54ac1a,_0x465a0f){var _0x400ee0=0xa;var _0x3e2fd1=['join',_0xf54e('0x52'),_0xf54e('0x53'),_0xf54e('0x54')];var _0x4e5059={'SUM':_0xf54e('0x55'),'COUNT':_0xf54e('0x56'),'COUNT DISTINCT':_0xf54e('0x57'),'MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':_0xf54e('0x58'),'GROUP_CONCAT':_0xf54e('0x59'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xf54e('0x5a')};var _0x49fd97={'SEC_TO_TIME':_0xf54e('0x5b'),'DATE':'DATE(%s)','HOUR':_0xf54e('0x5c'),'ROUND':_0xf54e('0x5d'),'UNIX_TIMESTAMP':_0xf54e('0x5e')};var _0x241198=function(_0x44f1de){return!_[_0xf54e('0x5f')](['IS\x20NULL','IS\x20NOT\x20NULL',_0xf54e('0x60'),_0xf54e('0x61')],_0x44f1de);};var _0x493011=function(_0x57a48e){if(!_0x57a48e||!_0x57a48e[_0xf54e('0x62')]['length']){return'';}for(var _0x2b616a='(',_0x43f9bf=0x0;_0x43f9bf<_0x57a48e[_0xf54e('0x62')][_0xf54e('0x33')];_0x43f9bf+=0x1){_0x43f9bf>0x0&&(_0x2b616a+='\x20'+_0x57a48e[_0xf54e('0x63')]+'\x20');_0x2b616a+=_0x57a48e[_0xf54e('0x62')][_0x43f9bf][_0xf54e('0x64')]?_0x493011(_0x57a48e[_0xf54e('0x62')][_0x43f9bf][_0xf54e('0x64')]):_0x57a48e[_0xf54e('0x62')][_0x43f9bf][_0xf54e('0x3d')]+'\x20'+_0x57a48e[_0xf54e('0x62')][_0x43f9bf][_0xf54e('0x65')]+(_0x241198(_0x57a48e[_0xf54e('0x62')][_0x43f9bf]['condition'])?'\x20'+_0x57a48e[_0xf54e('0x62')][_0x43f9bf][_0xf54e('0x66')]:'');}return _0x2b616a+')';};var _0xb7ff4d={'where':{'id':_0x54ac1a['params']['id']}},_0x11908b,_0x1e4c0d,_0x494629,_0xf50b1b,_0x1ede85;_0xb7ff4d=_['merge']({},_0xb7ff4d,_0x54ac1a[_0xf54e('0x3e')]);return db['AnalyticCustomReport'][_0xf54e('0x45')](_0xb7ff4d)[_0xf54e('0x24')](function(_0x105cf4){if(_0x105cf4){_0x11908b=_0x105cf4;return _0x105cf4[_0xf54e('0x67')]();}return null;})['then'](function(_0x2ecda1){if(_0x2ecda1){if(!_0x2ecda1['length']){throw new db[(_0xf54e('0x68'))][(_0xf54e('0x69'))](_0xf54e('0x6a'),0x193);}_0x1e4c0d=_0x2ecda1;return db['AnalyticMetric'][_0xf54e('0x42')]({'raw':!![]});}return null;})['then'](function(_0x3f7224){if(_0x3f7224){_0x494629=_[_0xf54e('0x6b')](_0x3f7224,'id');var _0x5500d7;var _0x380b4f=squel['select']();_0x380b4f[_0xf54e('0x6c')](_0x11908b[_0xf54e('0x6d')]);for(var _0x33acd3=0x0;_0x33acd3<_0x1e4c0d[_0xf54e('0x33')];_0x33acd3+=0x1){_0x5500d7=_0x1e4c0d[_0x33acd3][_0xf54e('0x6e')]?_0x494629[_0x1e4c0d[_0x33acd3]['MetricId']][_0xf54e('0x6f')]:_0x1e4c0d[_0x33acd3][_0xf54e('0x3d')];_0x5500d7=_0x1e4c0d[_0x33acd3]['function']?_[_0xf54e('0x70')](_0x4e5059[_0x1e4c0d[_0x33acd3][_0xf54e('0x71')]],'%s',_0x5500d7):_0x5500d7;_0x5500d7=_0x1e4c0d[_0x33acd3]['format']?_[_0xf54e('0x70')](_0x49fd97[_0x1e4c0d[_0x33acd3][_0xf54e('0x72')]],'%s',_0x5500d7):_0x5500d7;if(_0x1e4c0d[_0x33acd3][_0xf54e('0x73')]){_0x380b4f['group'](_0x5500d7);}_0x1e4c0d[_0x33acd3][_0xf54e('0x74')]&&_0x380b4f['order'](_0x5500d7,_0x1e4c0d[_0x33acd3][_0xf54e('0x74')]===_0xf54e('0x75')?![]:!![]);_0x380b4f['field'](_0x5500d7,_0x1e4c0d[_0x33acd3][_0xf54e('0x76')]||_0x5500d7);}if(_0x11908b[_0xf54e('0x77')]){_0x11908b[_0xf54e('0x77')]=JSON[_0xf54e('0x78')](_0x11908b[_0xf54e('0x77')]);for(var _0xfc1e=0x0;_0xfc1e<_0x11908b[_0xf54e('0x77')][_0xf54e('0x33')];_0xfc1e+=0x1){if(_0x11908b[_0xf54e('0x77')][_0xfc1e][_0xf54e('0x79')]&&_[_0xf54e('0x5f')](_0x3e2fd1,_0x11908b['joins'][_0xfc1e][_0xf54e('0x79')])&&_0x11908b[_0xf54e('0x77')][_0xfc1e][_0xf54e('0x7a')]&&_0x11908b['joins'][_0xfc1e][_0xf54e('0x7b')]&&_0x11908b[_0xf54e('0x77')][_0xfc1e][_0xf54e('0x7c')]){_0x380b4f[_0x11908b[_0xf54e('0x77')][_0xfc1e][_0xf54e('0x79')]](_0x11908b[_0xf54e('0x77')][_0xfc1e][_0xf54e('0x7b')],null,util['format'](_0xf54e('0x7d'),_0x11908b[_0xf54e('0x6d')],_0x11908b[_0xf54e('0x77')][_0xfc1e]['parentKey'],_0x11908b[_0xf54e('0x77')][_0xfc1e][_0xf54e('0x7b')],_0x11908b[_0xf54e('0x77')][_0xfc1e][_0xf54e('0x7c')]));}}}if(_0x11908b['conditions']){_0x11908b['conditions']=JSON[_0xf54e('0x78')](_0x11908b[_0xf54e('0x7e')]);_0x380b4f[_0xf54e('0x38')](_0x493011(_0x11908b[_0xf54e('0x7e')][_0xf54e('0x64')]));}_0x1ede85=_0x380b4f[_0xf54e('0x7f')]();_0x380b4f[_0xf54e('0x1e')](_0x400ee0);_0x380b4f[_0xf54e('0x1d')](0x0);logger[_0xf54e('0x80')](_0xf54e('0x81'),_0x380b4f['toString']());return db[_0xf54e('0x82')][_0xf54e('0x2e')](_0x380b4f[_0xf54e('0x83')](),{'type':db[_0xf54e('0x82')]['QueryTypes'][_0xf54e('0x84')]});}})[_0xf54e('0x24')](respondWithResult(_0x465a0f,null))[_0xf54e('0x43')](handleError(_0x465a0f,null));};function runReport(_0x213206,_0x5dd28e,_0x394862){var _0x4876b5=_0x5dd28e[_0xf54e('0x28')];var _0x506375=0xa;var _0x4a6a8d=[_0xf54e('0x85'),_0xf54e('0x52'),_0xf54e('0x53'),_0xf54e('0x54')];var _0x21e9c1={'SUM':_0xf54e('0x55'),'COUNT':_0xf54e('0x56'),'COUNT DISTINCT':_0xf54e('0x57'),'MAX':_0xf54e('0x86'),'MIN':'MIN(%s)','AVG':_0xf54e('0x58'),'GROUP_CONCAT':_0xf54e('0x59'),'GROUP_CONCAT ASC':_0xf54e('0x87'),'GROUP_CONCAT DESC':_0xf54e('0x5a')};var _0x395513={'SEC_TO_TIME':_0xf54e('0x5b'),'DATE':_0xf54e('0x88'),'HOUR':_0xf54e('0x5c'),'ROUND':_0xf54e('0x5d'),'UNIX_TIMESTAMP':_0xf54e('0x5e')};var _0x11dec2=function(_0x418ecc){return!_['includes']([_0xf54e('0x89'),_0xf54e('0x8a'),'IS\x20EMPTY','IS\x20NOT\x20EMPTY'],_0x418ecc);};var _0x85b108=function(_0x250196){if(!_0x250196||!_0x250196[_0xf54e('0x62')][_0xf54e('0x33')]){return'';}for(var _0x15aec1='(',_0x3c3a97=0x0;_0x3c3a97<_0x250196[_0xf54e('0x62')][_0xf54e('0x33')];_0x3c3a97+=0x1){_0x3c3a97>0x0&&(_0x15aec1+='\x20'+_0x250196[_0xf54e('0x63')]+'\x20');_0x15aec1+=_0x250196['rules'][_0x3c3a97][_0xf54e('0x64')]?_0x85b108(_0x250196[_0xf54e('0x62')][_0x3c3a97][_0xf54e('0x64')]):_0x250196['rules'][_0x3c3a97][_0xf54e('0x3d')]+'\x20'+_0x250196['rules'][_0x3c3a97][_0xf54e('0x65')]+(_0x11dec2(_0x250196['rules'][_0x3c3a97][_0xf54e('0x65')])?'\x20'+_0x250196[_0xf54e('0x62')][_0x3c3a97]['value']:'');}return _0x15aec1+')';};var _0x5b3e27={'where':{'id':_0x213206['id']}},_0x23533b,_0x632240,_0x16672b,_0x406261,_0x389f16;_0x5b3e27=_['merge']({},_0x5b3e27,_0x394862);return db['AnalyticCustomReport'][_0xf54e('0x45')](_0x5b3e27)[_0xf54e('0x24')](function(_0x456159){if(_0x456159){_0x23533b=_0x456159;return _0x456159[_0xf54e('0x67')]();}return null;})[_0xf54e('0x24')](function(_0xe1205){if(_0xe1205){if(!_0xe1205[_0xf54e('0x33')]){throw new db[(_0xf54e('0x68'))][(_0xf54e('0x69'))](_0xf54e('0x6a'),0x193);}_0x632240=_0xe1205;return db['AnalyticMetric'][_0xf54e('0x42')]({'raw':!![]});}return null;})[_0xf54e('0x24')](function(_0x4d4667){if(_0x4d4667){_0x16672b=_['keyBy'](_0x4d4667,'id');var _0x20345b;var _0x42c049=squel[_0xf54e('0x8b')]();_0x42c049[_0xf54e('0x6c')](_0x23533b[_0xf54e('0x6d')]);for(var _0x5e6713=0x0;_0x5e6713<_0x632240[_0xf54e('0x33')];_0x5e6713+=0x1){_0x20345b=_0x632240[_0x5e6713][_0xf54e('0x6e')]?_0x16672b[_0x632240[_0x5e6713][_0xf54e('0x6e')]][_0xf54e('0x6f')]:_0x632240[_0x5e6713]['field'];_0x20345b=_0x632240[_0x5e6713][_0xf54e('0x71')]?_[_0xf54e('0x70')](_0x21e9c1[_0x632240[_0x5e6713][_0xf54e('0x71')]],'%s',_0x20345b):_0x20345b;_0x20345b=_0x632240[_0x5e6713][_0xf54e('0x72')]?_['replace'](_0x395513[_0x632240[_0x5e6713][_0xf54e('0x72')]],'%s',_0x20345b):_0x20345b;if(_0x632240[_0x5e6713][_0xf54e('0x73')]){_0x42c049[_0xf54e('0x64')](_0x20345b);}_0x632240[_0x5e6713][_0xf54e('0x74')]&&_0x42c049[_0xf54e('0x36')](_0x20345b,_0x632240[_0x5e6713]['orderBy']===_0xf54e('0x75')?![]:!![]);_0x42c049['field'](_0x20345b,_0x632240[_0x5e6713]['alias']||_0x20345b);}if(_0x23533b[_0xf54e('0x77')]){_0x23533b[_0xf54e('0x77')]=JSON[_0xf54e('0x78')](_0x23533b[_0xf54e('0x77')]);for(var _0x300cbe=0x0;_0x300cbe<_0x23533b[_0xf54e('0x77')][_0xf54e('0x33')];_0x300cbe+=0x1){if(_0x23533b[_0xf54e('0x77')][_0x300cbe][_0xf54e('0x79')]&&_['includes'](_0x4a6a8d,_0x23533b[_0xf54e('0x77')][_0x300cbe][_0xf54e('0x79')])&&_0x23533b[_0xf54e('0x77')][_0x300cbe][_0xf54e('0x7a')]&&_0x23533b[_0xf54e('0x77')][_0x300cbe][_0xf54e('0x7b')]&&_0x23533b['joins'][_0x300cbe][_0xf54e('0x7c')]){_0x42c049[_0x23533b[_0xf54e('0x77')][_0x300cbe][_0xf54e('0x79')]](_0x23533b[_0xf54e('0x77')][_0x300cbe][_0xf54e('0x7b')],null,util[_0xf54e('0x72')]('%s.%s\x20=\x20%s.%s',_0x23533b[_0xf54e('0x6d')],_0x23533b[_0xf54e('0x77')][_0x300cbe][_0xf54e('0x7a')],_0x23533b[_0xf54e('0x77')][_0x300cbe]['foreignTable'],_0x23533b['joins'][_0x300cbe][_0xf54e('0x7c')]));}}}if(_0x23533b[_0xf54e('0x7e')]){_0x23533b[_0xf54e('0x7e')]=JSON[_0xf54e('0x78')](_0x23533b[_0xf54e('0x7e')]);_0x42c049[_0xf54e('0x38')](_0x85b108(_0x23533b['conditions'][_0xf54e('0x64')]));}_0x389f16=_0x42c049[_0xf54e('0x7f')]();_0x42c049[_0xf54e('0x1e')](_0x506375);_0x42c049[_0xf54e('0x1d')](0x0);logger[_0xf54e('0x80')](_0xf54e('0x81'),_0x42c049['toString']());return db[_0xf54e('0x82')]['query'](_0x42c049[_0xf54e('0x83')](),{'type':db['sequelize'][_0xf54e('0x8c')][_0xf54e('0x84')]});}})[_0xf54e('0x24')](function(_0x2af141){if(!_0x2af141[_0xf54e('0x33')]){throw new db['Sequelize'][(_0xf54e('0x69'))](_0xf54e('0x8d'),0xcc);}if(_0x5dd28e['output']===_0xf54e('0x8e')){return null;}var _0x1b3ca4=_[_0xf54e('0x3a')](_0x5dd28e,{'name':_0x5dd28e[_0xf54e('0x8f')]||_0x5dd28e['name']||_0x23533b[_0xf54e('0x28')],'basename':_0x4876b5,'savename':util[_0xf54e('0x72')]('%s-%s.%s',_0x5dd28e[_0xf54e('0x28')]||_0x23533b['name'],require('randomstring')[_0xf54e('0x90')](0x4),_0x5dd28e['output']||_0xf54e('0x91')),'reportId':_0x23533b['id'],'reportType':_0xf54e('0x92')});return db[_0xf54e('0x93')][_0xf54e('0x46')](_0x1b3ca4,{'raw':!![]});})[_0xf54e('0x24')](function(_0x56f125){if(_0x23533b[_0xf54e('0x6d')]===_0xf54e('0x94')){_0x389f16[_0xf54e('0x38')](_0x23533b[_0xf54e('0x6d')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x5dd28e[_0xf54e('0x95')],_0x5dd28e['endDate']);}else{_0x389f16[_0xf54e('0x38')](_0x23533b[_0xf54e('0x6d')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x5dd28e[_0xf54e('0x95')],_0x5dd28e[_0xf54e('0x96')]);}if(_0x56f125){logger[_0xf54e('0x97')](_0xf54e('0x98'),_0x389f16['toString']());require(_0xf54e('0x99'))[_0xf54e('0x9a')](path[_0xf54e('0x85')](__dirname,'../../components/export/',_0x56f125['output']),[_0x56f125['id'],_0x389f16[_0xf54e('0x83')](),path['join'](__dirname,'../../files/reports',_0x56f125['savename']),_0x4876b5]);return _0x56f125;}else{var _0x3d908b=squel[_0xf54e('0x8b')]();_0x3d908b[_0xf54e('0x6c')]('('+_0x389f16[_0xf54e('0x83')]()+')',_0xf54e('0x9b'));_0x3d908b[_0xf54e('0x3d')](_0xf54e('0x9c'),_0xf54e('0x1c'));_0x389f16[_0xf54e('0x1e')](_0x5dd28e['limit']||_0x506375);_0x389f16[_0xf54e('0x1d')](_0x5dd28e['offset']||0x0);return db[_0xf54e('0x82')][_0xf54e('0x2e')](_0x3d908b['toString'](),{'type':db[_0xf54e('0x82')]['QueryTypes'][_0xf54e('0x84')]})[_0xf54e('0x24')](function(_0x5d8756){if(!_0x5d8756[_0xf54e('0x33')]){_0x406261=0x0;}else{_0x406261=_0x5d8756[0x0][_0xf54e('0x1c')]||0x0;}return db[_0xf54e('0x82')]['query'](_0x389f16['toString'](),{'type':db['sequelize'][_0xf54e('0x8c')]['SELECT']});})[_0xf54e('0x24')](function(_0x3e3bc1){return{'rows':_0x3e3bc1||[],'count':_0x406261};});}});}exports[_0xf54e('0x9d')]=function(_0xf24a7c,_0xf92db2){return runReport(_0xf24a7c['params'],_0xf24a7c[_0xf54e('0x2e')],_0xf24a7c[_0xf54e('0x3e')])[_0xf54e('0x24')](respondWithResult(_0xf92db2,null))[_0xf54e('0x43')](handleError(_0xf92db2,null));};exports[_0xf54e('0x9e')]=runReport;exports[_0xf54e('0x2e')]=function(_0x518dad,_0x996df5){var _0x811fa7=0xa;var _0x1b51a5=[_0xf54e('0x85'),_0xf54e('0x52'),'right_join',_0xf54e('0x54')];var _0x101508={'SUM':_0xf54e('0x55'),'COUNT':_0xf54e('0x56'),'COUNT DISTINCT':_0xf54e('0x57'),'MAX':_0xf54e('0x86'),'MIN':_0xf54e('0x9f'),'AVG':_0xf54e('0x58'),'GROUP_CONCAT':_0xf54e('0x59'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xf54e('0x5a')};var _0x26a293={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0xf54e('0x5c'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xf54e('0x5e')};var _0xd4db77=function(_0x41cd85){return!_[_0xf54e('0x5f')](['IS\x20NULL',_0xf54e('0x8a'),_0xf54e('0x60'),'IS\x20NOT\x20EMPTY'],_0x41cd85);};var _0x90ad88=function(_0x3797bf){if(!_0x3797bf||!_0x3797bf[_0xf54e('0x62')][_0xf54e('0x33')]){return'';}for(var _0x627e9a='(',_0x413b9a=0x0;_0x413b9a<_0x3797bf[_0xf54e('0x62')][_0xf54e('0x33')];_0x413b9a+=0x1){_0x413b9a>0x0&&(_0x627e9a+='\x20'+_0x3797bf[_0xf54e('0x63')]+'\x20');_0x627e9a+=_0x3797bf[_0xf54e('0x62')][_0x413b9a][_0xf54e('0x64')]?_0x90ad88(_0x3797bf['rules'][_0x413b9a]['group']):_0x3797bf[_0xf54e('0x62')][_0x413b9a][_0xf54e('0x3d')]+'\x20'+_0x3797bf[_0xf54e('0x62')][_0x413b9a][_0xf54e('0x65')]+(_0xd4db77(_0x3797bf[_0xf54e('0x62')][_0x413b9a]['condition'])?'\x20'+_0x3797bf[_0xf54e('0x62')][_0x413b9a][_0xf54e('0x66')]:'');}return _0x627e9a+')';};var _0x3a9def={'where':{'id':_0x518dad[_0xf54e('0x44')]['id']}},_0x213dc5,_0x5722a8,_0xccf31d,_0x37f1d6,_0x380efc;_0x3a9def=_[_0xf54e('0x3a')]({},_0x3a9def,_0x518dad[_0xf54e('0x3e')]);return db[_0xf54e('0x3f')][_0xf54e('0x45')](_0x3a9def)[_0xf54e('0x24')](function(_0x3c098a){if(_0x3c098a){_0x213dc5=_0x3c098a;return _0x3c098a[_0xf54e('0x67')]();}return null;})[_0xf54e('0x24')](function(_0xf94c4e){if(_0xf94c4e){if(!_0xf94c4e[_0xf54e('0x33')]){throw new db['Sequelize'][(_0xf54e('0x69'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x5722a8=_0xf94c4e;return db['AnalyticMetric'][_0xf54e('0x42')]({'raw':!![]});}return null;})[_0xf54e('0x24')](function(_0x304cd1){if(_0x304cd1){_0xccf31d=_[_0xf54e('0x6b')](_0x304cd1,'id');var _0x22d3c1;var _0x2609ef=squel[_0xf54e('0x8b')]();_0x2609ef[_0xf54e('0x6c')](_0x213dc5[_0xf54e('0x6d')]);for(var _0x1efe6a=0x0;_0x1efe6a<_0x5722a8[_0xf54e('0x33')];_0x1efe6a+=0x1){_0x22d3c1=_0x5722a8[_0x1efe6a][_0xf54e('0x6e')]?_0xccf31d[_0x5722a8[_0x1efe6a][_0xf54e('0x6e')]]['metric']:_0x5722a8[_0x1efe6a][_0xf54e('0x3d')];_0x22d3c1=_0x5722a8[_0x1efe6a][_0xf54e('0x71')]?_[_0xf54e('0x70')](_0x101508[_0x5722a8[_0x1efe6a][_0xf54e('0x71')]],'%s',_0x22d3c1):_0x22d3c1;_0x22d3c1=_0x5722a8[_0x1efe6a][_0xf54e('0x72')]?_['replace'](_0x26a293[_0x5722a8[_0x1efe6a]['format']],'%s',_0x22d3c1):_0x22d3c1;if(_0x5722a8[_0x1efe6a][_0xf54e('0x73')]){_0x2609ef[_0xf54e('0x64')](_0x22d3c1);}_0x5722a8[_0x1efe6a]['orderBy']&&_0x2609ef['order'](_0x22d3c1,_0x5722a8[_0x1efe6a][_0xf54e('0x74')]==='DESC'?![]:!![]);_0x2609ef[_0xf54e('0x3d')](_0x22d3c1,_0x5722a8[_0x1efe6a][_0xf54e('0x76')]||_0x22d3c1);}if(_0x213dc5[_0xf54e('0x77')]){_0x213dc5[_0xf54e('0x77')]=JSON[_0xf54e('0x78')](_0x213dc5[_0xf54e('0x77')]);for(var _0x50bff9=0x0;_0x50bff9<_0x213dc5[_0xf54e('0x77')][_0xf54e('0x33')];_0x50bff9+=0x1){if(_0x213dc5['joins'][_0x50bff9][_0xf54e('0x79')]&&_[_0xf54e('0x5f')](_0x1b51a5,_0x213dc5['joins'][_0x50bff9][_0xf54e('0x79')])&&_0x213dc5[_0xf54e('0x77')][_0x50bff9][_0xf54e('0x7a')]&&_0x213dc5['joins'][_0x50bff9]['foreignTable']&&_0x213dc5[_0xf54e('0x77')][_0x50bff9][_0xf54e('0x7c')]){_0x2609ef[_0x213dc5['joins'][_0x50bff9]['type']](_0x213dc5['joins'][_0x50bff9][_0xf54e('0x7b')],null,util[_0xf54e('0x72')](_0xf54e('0x7d'),_0x213dc5['table'],_0x213dc5[_0xf54e('0x77')][_0x50bff9][_0xf54e('0x7a')],_0x213dc5[_0xf54e('0x77')][_0x50bff9][_0xf54e('0x7b')],_0x213dc5[_0xf54e('0x77')][_0x50bff9]['foreignKey']));}}}if(_0x213dc5['conditions']){_0x213dc5['conditions']=JSON['parse'](_0x213dc5['conditions']);_0x2609ef[_0xf54e('0x38')](_0x90ad88(_0x213dc5['conditions'][_0xf54e('0x64')]));}_0x380efc=_0x2609ef[_0xf54e('0x7f')]();_0x2609ef['limit'](_0x811fa7);_0x2609ef[_0xf54e('0x1d')](0x0);logger['debug'](_0xf54e('0x81'),_0x2609ef[_0xf54e('0x83')]());return db[_0xf54e('0x82')][_0xf54e('0x2e')](_0x2609ef[_0xf54e('0x83')](),{'type':db[_0xf54e('0x82')][_0xf54e('0x8c')]['SELECT']});}})[_0xf54e('0x24')](function(){return{'sql':_0x380efc[_0xf54e('0x83')]()};})[_0xf54e('0x24')](respondWithResult(_0x996df5,null))[_0xf54e('0x43')](handleError(_0x996df5,null));}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js index 6f6a42d..37cb0ed 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 _0xd104=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./analyticCustomReport.attributes','exports','define','AnalyticCustomReport','analytics_custom_reports','lodash','util'];(function(_0x2c7618,_0x26be9c){var _0x5ce3f0=function(_0x1837b3){while(--_0x1837b3){_0x2c7618['push'](_0x2c7618['shift']());}};_0x5ce3f0(++_0x26be9c);}(_0xd104,0xfa));var _0x4d10=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd104[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x4d10('0x0'));var util=require(_0x4d10('0x1'));var logger=require(_0x4d10('0x2'))(_0x4d10('0x3'));var moment=require(_0x4d10('0x4'));var BPromise=require(_0x4d10('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4d10('0x6'));var rimraf=require(_0x4d10('0x7'));var config=require(_0x4d10('0x8'));var attributes=require(_0x4d10('0x9'));module[_0x4d10('0xa')]=function(_0x52c3bc,_0x16e682){return _0x52c3bc[_0x4d10('0xb')](_0x4d10('0xc'),attributes,{'tableName':_0x4d10('0xd'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8d53=['./analyticCustomReport.attributes','AnalyticCustomReport','lodash','util','moment','bluebird','request-promise','path','rimraf'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8d53,0x18e));var _0x38d5=function(_0x57d5e9,_0x240580){_0x57d5e9=_0x57d5e9-0x0;var _0x5976c5=_0x8d53[_0x57d5e9];return _0x5976c5;};'use strict';var _=require(_0x38d5('0x0'));var util=require(_0x38d5('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x38d5('0x2'));var BPromise=require(_0x38d5('0x3'));var rp=require(_0x38d5('0x4'));var fs=require('fs');var path=require(_0x38d5('0x5'));var rimraf=require(_0x38d5('0x6'));var config=require('../../config/environment');var attributes=require(_0x38d5('0x7'));module['exports']=function(_0x13ed95,_0x13996f){return _0x13ed95['define'](_0x38d5('0x8'),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 d0ab0f7..2536f98 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 _0xdbd9=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment'];(function(_0x33fe40,_0x10d996){var _0x371f9f=function(_0x5bd3b4){while(--_0x5bd3b4){_0x33fe40['push'](_0x33fe40['shift']());}};_0x371f9f(++_0x10d996);}(_0xdbd9,0x1e0));var _0x9dbd=function(_0x44619d,_0x174282){_0x44619d=_0x44619d-0x0;var _0x14104b=_0xdbd9[_0x44619d];return _0x14104b;};'use strict';var _=require(_0x9dbd('0x0'));var util=require(_0x9dbd('0x1'));var moment=require(_0x9dbd('0x2'));var BPromise=require(_0x9dbd('0x3'));var rs=require(_0x9dbd('0x4'));var fs=require('fs');var Redis=require(_0x9dbd('0x5'));var db=require(_0x9dbd('0x6'))['db'];var utils=require(_0x9dbd('0x7'));var logger=require(_0x9dbd('0x8'))(_0x9dbd('0x9'));var config=require('../../config/environment');var jayson=require(_0x9dbd('0xa'));var client=jayson[_0x9dbd('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x125644,_0xc8213b,_0x9a835a){return new BPromise(function(_0x1c67a1,_0x1712af){return client[_0x9dbd('0xc')](_0x125644,_0x9a835a)[_0x9dbd('0xd')](function(_0x2431dc){logger[_0x9dbd('0xe')](_0x9dbd('0xf'),_0xc8213b,_0x9dbd('0x10'));logger['debug']('AnalyticCustomReport,\x20%s,\x20%s,\x20%s',_0xc8213b,_0x9dbd('0x10'),JSON[_0x9dbd('0x11')](_0x2431dc));if(_0x2431dc[_0x9dbd('0x12')]){if(_0x2431dc[_0x9dbd('0x12')][_0x9dbd('0x13')]===0x1f4){logger['error'](_0x9dbd('0xf'),_0xc8213b,_0x2431dc[_0x9dbd('0x12')][_0x9dbd('0x14')]);return _0x1712af(_0x2431dc[_0x9dbd('0x12')][_0x9dbd('0x14')]);}logger[_0x9dbd('0x12')]('AnalyticCustomReport,\x20%s,\x20%s',_0xc8213b,_0x2431dc[_0x9dbd('0x12')]['message']);return _0x1c67a1(_0x2431dc[_0x9dbd('0x12')][_0x9dbd('0x14')]);}else{logger['info'](_0x9dbd('0xf'),_0xc8213b,_0x9dbd('0x10'));_0x1c67a1(_0x2431dc[_0x9dbd('0x15')][_0x9dbd('0x14')]);}})[_0x9dbd('0x16')](function(_0x5b1fc6){logger[_0x9dbd('0x12')](_0x9dbd('0xf'),_0xc8213b,_0x5b1fc6);_0x1712af(_0x5b1fc6);});});} \ No newline at end of file +var _0x675a=['../../config/environment','client','http','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x1caa90,_0x58970d){var _0x48e130=function(_0x2e587d){while(--_0x2e587d){_0x1caa90['push'](_0x1caa90['shift']());}};_0x48e130(++_0x58970d);}(_0x675a,0x75));var _0xa675=function(_0xd04611,_0x6f7365){_0xd04611=_0xd04611-0x0;var _0x72e2db=_0x675a[_0xd04611];return _0x72e2db;};'use strict';var _=require(_0xa675('0x0'));var util=require(_0xa675('0x1'));var moment=require(_0xa675('0x2'));var BPromise=require(_0xa675('0x3'));var rs=require(_0xa675('0x4'));var fs=require('fs');var Redis=require(_0xa675('0x5'));var db=require(_0xa675('0x6'))['db'];var utils=require(_0xa675('0x7'));var logger=require('../../config/logger')(_0xa675('0x8'));var config=require(_0xa675('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xa675('0xa')][_0xa675('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xdf3d76,_0x230f43,_0x4c851a){return new BPromise(function(_0x4d7e49,_0x43f2bc){return client['request'](_0xdf3d76,_0x4c851a)['then'](function(_0x414c8b){logger['info'](_0xa675('0xc'),_0x230f43,'request\x20sent');logger['debug']('AnalyticCustomReport,\x20%s,\x20%s,\x20%s',_0x230f43,_0xa675('0xd'),JSON[_0xa675('0xe')](_0x414c8b));if(_0x414c8b[_0xa675('0xf')]){if(_0x414c8b[_0xa675('0xf')][_0xa675('0x10')]===0x1f4){logger[_0xa675('0xf')]('AnalyticCustomReport,\x20%s,\x20%s',_0x230f43,_0x414c8b[_0xa675('0xf')]['message']);return _0x43f2bc(_0x414c8b[_0xa675('0xf')][_0xa675('0x11')]);}logger[_0xa675('0xf')](_0xa675('0xc'),_0x230f43,_0x414c8b[_0xa675('0xf')][_0xa675('0x11')]);return _0x4d7e49(_0x414c8b[_0xa675('0xf')][_0xa675('0x11')]);}else{logger[_0xa675('0x12')](_0xa675('0xc'),_0x230f43,_0xa675('0xd'));_0x4d7e49(_0x414c8b[_0xa675('0x13')][_0xa675('0x11')]);}})[_0xa675('0x14')](function(_0x4f76e1){logger[_0xa675('0xf')](_0xa675('0xc'),_0x230f43,_0x4f76e1);_0x43f2bc(_0x4f76e1);});});} \ No newline at end of file diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js index 733992d..6a8cdd4 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 _0x7e85=['/:id','show','/:id/preview','preview','/:id/run','/:id/query','query','post','create','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','get','isAuthenticated','index'];(function(_0x13e363,_0x56bb86){var _0x572adc=function(_0x261211){while(--_0x261211){_0x13e363['push'](_0x13e363['shift']());}};_0x572adc(++_0x56bb86);}(_0x7e85,0x137));var _0x57e8=function(_0x34c0bf,_0x3b8460){_0x34c0bf=_0x34c0bf-0x0;var _0x315559=_0x7e85[_0x34c0bf];return _0x315559;};'use strict';var multer=require(_0x57e8('0x0'));var util=require('util');var path=require(_0x57e8('0x1'));var timeout=require(_0x57e8('0x2'));var express=require(_0x57e8('0x3'));var router=express[_0x57e8('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x57e8('0x5'));var config=require(_0x57e8('0x6'));var controller=require(_0x57e8('0x7'));router[_0x57e8('0x8')]('/',auth[_0x57e8('0x9')](),controller[_0x57e8('0xa')]);router['get'](_0x57e8('0xb'),auth[_0x57e8('0x9')](),controller[_0x57e8('0xc')]);router[_0x57e8('0x8')](_0x57e8('0xd'),auth[_0x57e8('0x9')](),controller[_0x57e8('0xe')]);router[_0x57e8('0x8')](_0x57e8('0xf'),auth[_0x57e8('0x9')](),controller['run']);router[_0x57e8('0x8')](_0x57e8('0x10'),auth[_0x57e8('0x9')](),controller[_0x57e8('0x11')]);router[_0x57e8('0x12')]('/',auth[_0x57e8('0x9')](),controller[_0x57e8('0x13')]);router['put']('/:id',auth[_0x57e8('0x9')](),controller['update']);router[_0x57e8('0x14')]('/:id',auth[_0x57e8('0x9')](),controller[_0x57e8('0x15')]);module[_0x57e8('0x16')]=router; \ No newline at end of file +var _0x6fb6=['express','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','isAuthenticated','index','get','/:id','/:id/preview','preview','/:id/run','query','create','put','delete','util','path'];(function(_0x1fc122,_0x5e2c17){var _0xa2cb13=function(_0x263b13){while(--_0x263b13){_0x1fc122['push'](_0x1fc122['shift']());}};_0xa2cb13(++_0x5e2c17);}(_0x6fb6,0x185));var _0x66fb=function(_0x28d18d,_0x55896b){_0x28d18d=_0x28d18d-0x0;var _0x470640=_0x6fb6[_0x28d18d];return _0x470640;};'use strict';var multer=require('multer');var util=require(_0x66fb('0x0'));var path=require(_0x66fb('0x1'));var timeout=require('connect-timeout');var express=require(_0x66fb('0x2'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x66fb('0x3'));var config=require(_0x66fb('0x4'));var controller=require(_0x66fb('0x5'));router['get']('/',auth[_0x66fb('0x6')](),controller[_0x66fb('0x7')]);router[_0x66fb('0x8')](_0x66fb('0x9'),auth['isAuthenticated'](),controller['show']);router[_0x66fb('0x8')](_0x66fb('0xa'),auth[_0x66fb('0x6')](),controller[_0x66fb('0xb')]);router['get'](_0x66fb('0xc'),auth['isAuthenticated'](),controller['run']);router[_0x66fb('0x8')]('/:id/query',auth[_0x66fb('0x6')](),controller[_0x66fb('0xd')]);router['post']('/',auth[_0x66fb('0x6')](),controller[_0x66fb('0xe')]);router[_0x66fb('0xf')](_0x66fb('0x9'),auth['isAuthenticated'](),controller['update']);router[_0x66fb('0x10')]('/:id',auth[_0x66fb('0x6')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js index 4e3585f..9d3790f 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 _0x8b7b=['exports','STRING','TEXT'];(function(_0x15add4,_0x4429c4){var _0x5f037c=function(_0x5dd37b){while(--_0x5dd37b){_0x15add4['push'](_0x15add4['shift']());}};_0x5f037c(++_0x4429c4);}(_0x8b7b,0xab));var _0xb8b7=function(_0x1580a3,_0x954f27){_0x1580a3=_0x1580a3-0x0;var _0x900bd5=_0x8b7b[_0x1580a3];return _0x900bd5;};'use strict';var Sequelize=require('sequelize');module[_0xb8b7('0x0')]={'name':{'type':Sequelize[_0xb8b7('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0xb8b7('0x1')]},'table':{'type':Sequelize[_0xb8b7('0x1')]},'conditions':{'type':Sequelize[_0xb8b7('0x2')]},'joins':{'type':Sequelize[_0xb8b7('0x2')]}}; \ No newline at end of file +var _0x234d=['sequelize','exports','STRING','TEXT'];(function(_0x209ec9,_0x30378c){var _0x129b1b=function(_0x2f2b9e){while(--_0x2f2b9e){_0x209ec9['push'](_0x209ec9['shift']());}};_0x129b1b(++_0x30378c);}(_0x234d,0xac));var _0xd234=function(_0x588b77,_0x28fca2){_0x588b77=_0x588b77-0x0;var _0x561797=_0x234d[_0x588b77];return _0x561797;};'use strict';var Sequelize=require(_0xd234('0x0'));module[_0xd234('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xd234('0x2')]},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize[_0xd234('0x2')]},'conditions':{'type':Sequelize[_0xd234('0x3')]},'joins':{'type':Sequelize[_0xd234('0x3')]}}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js index f7682bd..61579cd 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 _0xb046=['options','includeAll','include','rows','params','length','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','find','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','cross_join','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%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)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','value','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','findAll','keyBy','select','from','table','MetricId','metric','function','format','replace','groupBy','orderBy','alias','joins','parse','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','debug','Limited\x20Query:','toString','sequelize','SELECT','join','left_join','right_join','SUM(%s)','MIN(%s)','AVG(%s)','condition','getFields','Sequelize','clone','QueryTypes','No\x20available\x20data','output','web','fullPath','%s-%s.%s','randomstring','csv','default','AnalyticExtractedReport','cdr','startDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','endDate','Run\x20Query:','../../components/export/','../../files/reports','countTable','COUNT(*)','run','runReport','DESC','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','sox','ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','sendStatus','end','count','offset','limit','status','set','Content-Range','json','apply','reject','save','update','then','destroy','get','DefaultReports','error','stack','name','send','index','AnalyticDefaultReport','rawAttributes','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','merge','map','type','key','VIRTUAL','field','filter'];(function(_0x27e724,_0x11d0ea){var _0x2942cf=function(_0xb14f40){while(--_0xb14f40){_0x27e724['push'](_0x27e724['shift']());}};_0x2942cf(++_0x11d0ea);}(_0xb046,0x1a1));var _0x6b04=function(_0x1e9e56,_0x34a74a){_0x1e9e56=_0x1e9e56-0x0;var _0x5d5e2e=_0xb046[_0x1e9e56];return _0x5d5e2e;};'use strict';var pdf=require(_0x6b04('0x0'));var emlformat=require(_0x6b04('0x1'));var rimraf=require(_0x6b04('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6b04('0x3'));var rp=require(_0x6b04('0x4'));var moment=require(_0x6b04('0x5'));var BPromise=require(_0x6b04('0x6'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x6b04('0x7'));var csv=require('to-csv');var ejs=require(_0x6b04('0x8'));var fs=require('fs');var _=require(_0x6b04('0x9'));var squel=require(_0x6b04('0xa'));var crypto=require('crypto');var jsforce=require(_0x6b04('0xb'));var deskjs=require(_0x6b04('0xc'));var toCsv=require(_0x6b04('0xd'));var querystring=require(_0x6b04('0xe'));var Papa=require(_0x6b04('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x6b04('0x10'));var hardwareService=require(_0x6b04('0x11'));var logger=require('../../config/logger')(_0x6b04('0x12'));var utils=require(_0x6b04('0x13'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x405e2c,_0x1e8d8b){_0x1e8d8b=_0x1e8d8b||0xcc;return function(_0x2ca385){if(_0x2ca385){return _0x405e2c[_0x6b04('0x14')](_0x1e8d8b);}return _0x405e2c['status'](_0x1e8d8b)[_0x6b04('0x15')]();};}function respondWithResult(_0x1b7ae4,_0x2079e7){_0x2079e7=_0x2079e7||0xc8;return function(_0x59c27d){if(_0x59c27d){return _0x1b7ae4['status'](_0x2079e7)['json'](_0x59c27d);}};}function respondWithFilteredResult(_0x9f7aed,_0x4c3a03){return function(_0x4eaf1d){if(_0x4eaf1d){var _0x334e4e=_0x4eaf1d[_0x6b04('0x16')],_0x472752=_0x4c3a03[_0x6b04('0x17')],_0x1f71c0=_0x4c3a03[_0x6b04('0x17')]+_0x4c3a03[_0x6b04('0x18')],_0x3444cd;if(_0x1f71c0>=_0x334e4e){_0x1f71c0=_0x334e4e;_0x3444cd=0xc8;}else{_0x3444cd=0xce;}_0x9f7aed[_0x6b04('0x19')](_0x3444cd);return _0x9f7aed[_0x6b04('0x1a')](_0x6b04('0x1b'),_0x472752+'-'+_0x1f71c0+'/'+_0x334e4e)[_0x6b04('0x1c')](_0x4eaf1d);}return null;};}function patchUpdates(_0x2b07ff){return function(_0x21b184){try{jsonpatch[_0x6b04('0x1d')](_0x21b184,_0x2b07ff,!![]);}catch(_0xc308b0){return BPromise[_0x6b04('0x1e')](_0xc308b0);}return _0x21b184[_0x6b04('0x1f')]();};}function saveUpdates(_0xc43afa,_0x5000de){return function(_0x2ee5d3){if(_0x2ee5d3){return _0x2ee5d3[_0x6b04('0x20')](_0xc43afa)[_0x6b04('0x21')](function(_0x1705d0){return _0x1705d0;});}return null;};}function removeEntity(_0x436522,_0x5b244d){return function(_0x1958c1){if(_0x1958c1){return _0x1958c1[_0x6b04('0x22')]()['then'](function(){var _0x1ec30a=_0x1958c1[_0x6b04('0x23')]({'plain':!![]});var _0x5c8139=_0x6b04('0x24');return db['UserProfileResource'][_0x6b04('0x22')]({'where':{'type':_0x5c8139,'resourceId':_0x1ec30a['id']}})[_0x6b04('0x21')](function(){return _0x1958c1;});})[_0x6b04('0x21')](function(){_0x436522[_0x6b04('0x19')](0xcc)[_0x6b04('0x15')]();});}};}function handleEntityNotFound(_0x519bd2,_0x552deb){return function(_0x6255fe){if(!_0x6255fe){_0x519bd2[_0x6b04('0x14')](0x194);}return _0x6255fe;};}function handleError(_0x4c40fd,_0x1f0307){_0x1f0307=_0x1f0307||0x1f4;return function(_0x5318d4){logger[_0x6b04('0x25')](_0x5318d4[_0x6b04('0x26')]);if(_0x5318d4['name']){delete _0x5318d4[_0x6b04('0x27')];}_0x4c40fd['status'](_0x1f0307)[_0x6b04('0x28')](_0x5318d4);};}exports[_0x6b04('0x29')]=function(_0x25b722,_0x3eff08){var _0x1e9aa5={},_0x2c1fb8={},_0x13543d={'count':0x0,'rows':[]};var _0xe31b6a=db[_0x6b04('0x2a')][_0x6b04('0x2b')];_0x2c1fb8[_0x6b04('0x2c')]=_[_0x6b04('0x2d')](_0xe31b6a);_0x2c1fb8['query']=_['keys'](_0x25b722[_0x6b04('0x2e')]);_0x2c1fb8[_0x6b04('0x2f')]=_[_0x6b04('0x30')](_0x2c1fb8[_0x6b04('0x2c')],_0x2c1fb8[_0x6b04('0x2e')]);_0x1e9aa5[_0x6b04('0x31')]=_[_0x6b04('0x30')](_0x2c1fb8['model'],qs[_0x6b04('0x32')](_0x25b722['query'][_0x6b04('0x32')]));_0x1e9aa5[_0x6b04('0x31')]=_0x1e9aa5[_0x6b04('0x31')]['length']?_0x1e9aa5['attributes']:_0x2c1fb8[_0x6b04('0x2c')];if(!_0x25b722[_0x6b04('0x2e')][_0x6b04('0x33')]('nolimit')){_0x1e9aa5[_0x6b04('0x18')]=qs[_0x6b04('0x18')](_0x25b722['query'][_0x6b04('0x18')]);_0x1e9aa5[_0x6b04('0x17')]=qs[_0x6b04('0x17')](_0x25b722[_0x6b04('0x2e')]['offset']);}_0x1e9aa5[_0x6b04('0x34')]=qs['sort'](_0x25b722[_0x6b04('0x2e')][_0x6b04('0x35')]);_0x1e9aa5[_0x6b04('0x36')]=qs[_0x6b04('0x2f')](_[_0x6b04('0x37')](_0x25b722['query'],_0x2c1fb8['filters']));if(_0x25b722[_0x6b04('0x2e')]['filter']){_0x1e9aa5[_0x6b04('0x36')]=_[_0x6b04('0x38')](_0x1e9aa5[_0x6b04('0x36')],{'$or':_[_0x6b04('0x39')](_0xe31b6a,function(_0x22d5fe){if(_0x22d5fe[_0x6b04('0x3a')][_0x6b04('0x3b')]!==_0x6b04('0x3c')){var _0x57ecb3={};_0x57ecb3[_0x22d5fe[_0x6b04('0x3d')]]={'$like':'%'+_0x25b722[_0x6b04('0x2e')][_0x6b04('0x3e')]+'%'};return _0x57ecb3;}})});}_0x1e9aa5=_['merge']({},_0x1e9aa5,_0x25b722[_0x6b04('0x3f')]);var _0x5e010d={'where':_0x1e9aa5[_0x6b04('0x36')]};return db[_0x6b04('0x2a')][_0x6b04('0x16')](_0x5e010d)[_0x6b04('0x21')](function(_0x3bd745){_0x13543d[_0x6b04('0x16')]=_0x3bd745;if(_0x25b722[_0x6b04('0x2e')][_0x6b04('0x40')]){_0x1e9aa5[_0x6b04('0x41')]=[{'all':!![]}];}return db[_0x6b04('0x2a')]['findAll'](_0x1e9aa5);})[_0x6b04('0x21')](function(_0x3ba52c){_0x13543d[_0x6b04('0x42')]=_0x3ba52c;return _0x13543d;})[_0x6b04('0x21')](respondWithFilteredResult(_0x3eff08,_0x1e9aa5))['catch'](handleError(_0x3eff08,null));};exports['show']=function(_0x4143d0,_0x132278){var _0x505577={'raw':!![],'where':{'id':_0x4143d0[_0x6b04('0x43')]['id']}},_0x253c08={};_0x253c08[_0x6b04('0x2c')]=_[_0x6b04('0x2d')](db[_0x6b04('0x2a')][_0x6b04('0x2b')]);_0x253c08[_0x6b04('0x2e')]=_[_0x6b04('0x2d')](_0x4143d0[_0x6b04('0x2e')]);_0x253c08[_0x6b04('0x2f')]=_[_0x6b04('0x30')](_0x253c08[_0x6b04('0x2c')],_0x253c08['query']);_0x505577[_0x6b04('0x31')]=_[_0x6b04('0x30')](_0x253c08[_0x6b04('0x2c')],qs[_0x6b04('0x32')](_0x4143d0['query'][_0x6b04('0x32')]));_0x505577[_0x6b04('0x31')]=_0x505577['attributes'][_0x6b04('0x44')]?_0x505577['attributes']:_0x253c08[_0x6b04('0x2c')];if(_0x4143d0[_0x6b04('0x2e')][_0x6b04('0x40')]){_0x505577[_0x6b04('0x41')]=[{'all':!![]}];}_0x505577=_[_0x6b04('0x38')]({},_0x505577,_0x4143d0['options']);return db[_0x6b04('0x2a')]['find'](_0x505577)[_0x6b04('0x21')](handleEntityNotFound(_0x132278,null))['then'](respondWithResult(_0x132278,null))[_0x6b04('0x45')](handleError(_0x132278,null));};exports[_0x6b04('0x46')]=function(_0x4da355,_0x5e5426){return db[_0x6b04('0x2a')][_0x6b04('0x46')](_0x4da355[_0x6b04('0x47')],{})['then'](function(_0x568df1){var _0x4547bd=_0x4da355['user'][_0x6b04('0x23')]({'plain':!![]});if(!_0x4547bd)throw new Error(_0x6b04('0x48'));if(_0x4547bd[_0x6b04('0x49')]===_0x6b04('0x4a')){var _0x13d0b6=_0x568df1['get']({'plain':!![]});var _0xaa4e97='Reports';return db['UserProfileSection'][_0x6b04('0x4b')]({'where':{'name':_0xaa4e97,'userProfileId':_0x4547bd['userProfileId']},'raw':!![]})[_0x6b04('0x21')](function(_0x31d85d){if(_0x31d85d&&_0x31d85d[_0x6b04('0x4c')]===0x0){return db[_0x6b04('0x4d')][_0x6b04('0x46')]({'name':_0x13d0b6[_0x6b04('0x27')],'resourceId':_0x13d0b6['id'],'type':_0x6b04('0x24'),'sectionId':_0x31d85d['id']},{})[_0x6b04('0x21')](function(){return _0x568df1;});}else{return _0x568df1;}})[_0x6b04('0x45')](function(_0x4e8b71){logger[_0x6b04('0x25')](_0x6b04('0x4e'),_0x4e8b71);throw _0x4e8b71;});}return _0x568df1;})[_0x6b04('0x21')](respondWithResult(_0x5e5426,0xc9))[_0x6b04('0x45')](handleError(_0x5e5426,null));};exports[_0x6b04('0x20')]=function(_0x3fbcf2,_0x372cba){if(_0x3fbcf2[_0x6b04('0x47')]['id']){delete _0x3fbcf2[_0x6b04('0x47')]['id'];}return db[_0x6b04('0x2a')][_0x6b04('0x4b')]({'where':{'id':_0x3fbcf2[_0x6b04('0x43')]['id']}})['then'](handleEntityNotFound(_0x372cba,null))[_0x6b04('0x21')](saveUpdates(_0x3fbcf2[_0x6b04('0x47')],null))[_0x6b04('0x21')](respondWithResult(_0x372cba,null))['catch'](handleError(_0x372cba,null));};exports[_0x6b04('0x22')]=function(_0x421e92,_0x4adc9c){return db[_0x6b04('0x2a')][_0x6b04('0x4b')]({'where':{'id':_0x421e92[_0x6b04('0x43')]['id']}})[_0x6b04('0x21')](handleEntityNotFound(_0x4adc9c,null))[_0x6b04('0x21')](removeEntity(_0x4adc9c,null))[_0x6b04('0x45')](handleError(_0x4adc9c,null));};exports['preview']=function(_0x1fd23c,_0x48e163){var _0x143026=0xa;var _0x5b1d9d=['join','left_join','right_join',_0x6b04('0x4f')];var _0x3c962e={'SUM':'SUM(%s)','COUNT':_0x6b04('0x50'),'COUNT DISTINCT':_0x6b04('0x51'),'MAX':_0x6b04('0x52'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0x6b04('0x53'),'GROUP_CONCAT ASC':_0x6b04('0x54'),'GROUP_CONCAT DESC':_0x6b04('0x55')};var _0x4078f4={'SEC_TO_TIME':_0x6b04('0x56'),'DATE':_0x6b04('0x57'),'HOUR':_0x6b04('0x58'),'ROUND':_0x6b04('0x59'),'UNIX_TIMESTAMP':_0x6b04('0x5a')};var _0x298e92=function(_0x110cf1){return!_[_0x6b04('0x5b')]([_0x6b04('0x5c'),_0x6b04('0x5d'),_0x6b04('0x5e'),_0x6b04('0x5f')],_0x110cf1);};var _0x4f7eff=function(_0x2c3847){if(!_0x2c3847||!_0x2c3847['rules'][_0x6b04('0x44')]){return'';}for(var _0x4c70e8='(',_0x350e91=0x0;_0x350e91<_0x2c3847[_0x6b04('0x60')][_0x6b04('0x44')];_0x350e91+=0x1){_0x350e91>0x0&&(_0x4c70e8+='\x20'+_0x2c3847[_0x6b04('0x61')]+'\x20');_0x4c70e8+=_0x2c3847[_0x6b04('0x60')][_0x350e91][_0x6b04('0x62')]?_0x4f7eff(_0x2c3847[_0x6b04('0x60')][_0x350e91]['group']):_0x2c3847[_0x6b04('0x60')][_0x350e91][_0x6b04('0x3d')]+'\x20'+_0x2c3847[_0x6b04('0x60')][_0x350e91]['condition']+(_0x298e92(_0x2c3847[_0x6b04('0x60')][_0x350e91]['condition'])?'\x20'+_0x2c3847[_0x6b04('0x60')][_0x350e91][_0x6b04('0x63')]:'');}return _0x4c70e8+')';};var _0x17b9c2={'where':{'id':_0x1fd23c['params']['id']}},_0x495426,_0x122ce5,_0x4e449d,_0x187711,_0x47a091;_0x17b9c2=_[_0x6b04('0x38')]({},_0x17b9c2,_0x1fd23c['options']);return db[_0x6b04('0x2a')][_0x6b04('0x4b')](_0x17b9c2)[_0x6b04('0x21')](function(_0x10e1ad){if(_0x10e1ad){_0x495426=_0x10e1ad;return _0x10e1ad['getFields']();}return null;})['then'](function(_0x182044){if(_0x182044){if(!_0x182044[_0x6b04('0x44')]){throw new db['Sequelize'][(_0x6b04('0x64'))](_0x6b04('0x65'),0x193);}_0x122ce5=_0x182044;return db[_0x6b04('0x66')][_0x6b04('0x67')]({'raw':!![]});}return null;})[_0x6b04('0x21')](function(_0x32e7a3){if(_0x32e7a3){_0x4e449d=_[_0x6b04('0x68')](_0x32e7a3,'id');var _0x1ad119;var _0x5c9cfc=squel[_0x6b04('0x69')]();_0x5c9cfc[_0x6b04('0x6a')](_0x495426[_0x6b04('0x6b')]);for(var _0x376272=0x0;_0x376272<_0x122ce5[_0x6b04('0x44')];_0x376272+=0x1){_0x1ad119=_0x122ce5[_0x376272][_0x6b04('0x6c')]?_0x4e449d[_0x122ce5[_0x376272][_0x6b04('0x6c')]][_0x6b04('0x6d')]:_0x122ce5[_0x376272]['field'];_0x1ad119=_0x122ce5[_0x376272][_0x6b04('0x6e')]?_['replace'](_0x3c962e[_0x122ce5[_0x376272][_0x6b04('0x6e')]],'%s',_0x1ad119):_0x1ad119;_0x1ad119=_0x122ce5[_0x376272][_0x6b04('0x6f')]?_[_0x6b04('0x70')](_0x4078f4[_0x122ce5[_0x376272]['format']],'%s',_0x1ad119):_0x1ad119;if(_0x122ce5[_0x376272][_0x6b04('0x71')]){_0x5c9cfc[_0x6b04('0x62')](_0x1ad119);}_0x122ce5[_0x376272][_0x6b04('0x72')]&&_0x5c9cfc['order'](_0x1ad119,_0x122ce5[_0x376272][_0x6b04('0x72')]==='DESC'?![]:!![]);_0x5c9cfc[_0x6b04('0x3d')](_0x1ad119,_0x122ce5[_0x376272][_0x6b04('0x73')]||_0x1ad119);}if(_0x495426[_0x6b04('0x74')]){_0x495426[_0x6b04('0x74')]=JSON[_0x6b04('0x75')](_0x495426[_0x6b04('0x74')]);for(var _0x54dad6=0x0;_0x54dad6<_0x495426[_0x6b04('0x74')][_0x6b04('0x44')];_0x54dad6+=0x1){if(_0x495426[_0x6b04('0x74')][_0x54dad6][_0x6b04('0x3a')]&&_[_0x6b04('0x5b')](_0x5b1d9d,_0x495426[_0x6b04('0x74')][_0x54dad6]['type'])&&_0x495426[_0x6b04('0x74')][_0x54dad6][_0x6b04('0x76')]&&_0x495426[_0x6b04('0x74')][_0x54dad6][_0x6b04('0x77')]&&_0x495426['joins'][_0x54dad6][_0x6b04('0x78')]){_0x5c9cfc[_0x495426[_0x6b04('0x74')][_0x54dad6][_0x6b04('0x3a')]](_0x495426['joins'][_0x54dad6][_0x6b04('0x77')],null,util['format'](_0x6b04('0x79'),_0x495426[_0x6b04('0x6b')],_0x495426['joins'][_0x54dad6]['parentKey'],_0x495426[_0x6b04('0x74')][_0x54dad6][_0x6b04('0x77')],_0x495426['joins'][_0x54dad6][_0x6b04('0x78')]));}}}if(_0x495426[_0x6b04('0x7a')]){_0x495426[_0x6b04('0x7a')]=JSON[_0x6b04('0x75')](_0x495426[_0x6b04('0x7a')]);_0x5c9cfc[_0x6b04('0x36')](_0x4f7eff(_0x495426[_0x6b04('0x7a')][_0x6b04('0x62')]));}_0x47a091=_0x5c9cfc['clone']();_0x5c9cfc['limit'](_0x143026);_0x5c9cfc[_0x6b04('0x17')](0x0);logger[_0x6b04('0x7b')](_0x6b04('0x7c'),_0x5c9cfc[_0x6b04('0x7d')]());return db['sequelize']['query'](_0x5c9cfc[_0x6b04('0x7d')](),{'type':db[_0x6b04('0x7e')]['QueryTypes'][_0x6b04('0x7f')]});}})[_0x6b04('0x21')](respondWithResult(_0x48e163,null))[_0x6b04('0x45')](handleError(_0x48e163,null));};function runReport(_0x3d9117,_0x1801a7,_0x1dec03){var _0x2c2dc2=_0x1801a7['name'];var _0x567ebd=0xa;var _0x18ac9e=[_0x6b04('0x80'),_0x6b04('0x81'),_0x6b04('0x82'),'cross_join'];var _0x3e985b={'SUM':_0x6b04('0x83'),'COUNT':_0x6b04('0x50'),'COUNT DISTINCT':_0x6b04('0x51'),'MAX':_0x6b04('0x52'),'MIN':_0x6b04('0x84'),'AVG':_0x6b04('0x85'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x6b04('0x54'),'GROUP_CONCAT DESC':_0x6b04('0x55')};var _0x4be71b={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0x6b04('0x59'),'UNIX_TIMESTAMP':_0x6b04('0x5a')};var _0x5118ef=function(_0x5e506a){return!_[_0x6b04('0x5b')]([_0x6b04('0x5c'),'IS\x20NOT\x20NULL',_0x6b04('0x5e'),_0x6b04('0x5f')],_0x5e506a);};var _0x3c9b8b=function(_0x327c49){if(!_0x327c49||!_0x327c49[_0x6b04('0x60')][_0x6b04('0x44')]){return'';}for(var _0x1f4426='(',_0x50b8d7=0x0;_0x50b8d7<_0x327c49[_0x6b04('0x60')][_0x6b04('0x44')];_0x50b8d7+=0x1){_0x50b8d7>0x0&&(_0x1f4426+='\x20'+_0x327c49[_0x6b04('0x61')]+'\x20');_0x1f4426+=_0x327c49['rules'][_0x50b8d7][_0x6b04('0x62')]?_0x3c9b8b(_0x327c49[_0x6b04('0x60')][_0x50b8d7][_0x6b04('0x62')]):_0x327c49[_0x6b04('0x60')][_0x50b8d7][_0x6b04('0x3d')]+'\x20'+_0x327c49[_0x6b04('0x60')][_0x50b8d7]['condition']+(_0x5118ef(_0x327c49[_0x6b04('0x60')][_0x50b8d7][_0x6b04('0x86')])?'\x20'+_0x327c49[_0x6b04('0x60')][_0x50b8d7][_0x6b04('0x63')]:'');}return _0x1f4426+')';};var _0x4f3701={'where':{'id':_0x3d9117['id']}},_0x89653e,_0x172354,_0x145ac6,_0x10057a,_0x4e4920;_0x4f3701=_[_0x6b04('0x38')]({},_0x4f3701,_0x1dec03);return db[_0x6b04('0x2a')][_0x6b04('0x4b')](_0x4f3701)[_0x6b04('0x21')](function(_0x415828){if(_0x415828){_0x89653e=_0x415828;return _0x415828[_0x6b04('0x87')]();}return null;})[_0x6b04('0x21')](function(_0x3b36aa){if(_0x3b36aa){if(!_0x3b36aa[_0x6b04('0x44')]){throw new db[(_0x6b04('0x88'))][(_0x6b04('0x64'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x172354=_0x3b36aa;return db['AnalyticMetric'][_0x6b04('0x67')]({'raw':!![]});}return null;})[_0x6b04('0x21')](function(_0x23c416){if(_0x23c416){_0x145ac6=_['keyBy'](_0x23c416,'id');var _0x3b6597;var _0x2c6bcd=squel[_0x6b04('0x69')]();_0x2c6bcd[_0x6b04('0x6a')](_0x89653e['table']);for(var _0x5913d8=0x0;_0x5913d8<_0x172354[_0x6b04('0x44')];_0x5913d8+=0x1){_0x3b6597=_0x172354[_0x5913d8]['MetricId']?_0x145ac6[_0x172354[_0x5913d8][_0x6b04('0x6c')]][_0x6b04('0x6d')]:_0x172354[_0x5913d8][_0x6b04('0x3d')];_0x3b6597=_0x172354[_0x5913d8][_0x6b04('0x6e')]?_['replace'](_0x3e985b[_0x172354[_0x5913d8][_0x6b04('0x6e')]],'%s',_0x3b6597):_0x3b6597;_0x3b6597=_0x172354[_0x5913d8][_0x6b04('0x6f')]?_[_0x6b04('0x70')](_0x4be71b[_0x172354[_0x5913d8]['format']],'%s',_0x3b6597):_0x3b6597;if(_0x172354[_0x5913d8]['groupBy']){_0x2c6bcd[_0x6b04('0x62')](_0x3b6597);}_0x172354[_0x5913d8][_0x6b04('0x72')]&&_0x2c6bcd[_0x6b04('0x34')](_0x3b6597,_0x172354[_0x5913d8][_0x6b04('0x72')]==='DESC'?![]:!![]);_0x2c6bcd[_0x6b04('0x3d')](_0x3b6597,_0x172354[_0x5913d8][_0x6b04('0x73')]||_0x3b6597);}if(_0x89653e[_0x6b04('0x74')]){_0x89653e[_0x6b04('0x74')]=JSON[_0x6b04('0x75')](_0x89653e[_0x6b04('0x74')]);for(var _0x54bad6=0x0;_0x54bad6<_0x89653e[_0x6b04('0x74')]['length'];_0x54bad6+=0x1){if(_0x89653e[_0x6b04('0x74')][_0x54bad6][_0x6b04('0x3a')]&&_[_0x6b04('0x5b')](_0x18ac9e,_0x89653e[_0x6b04('0x74')][_0x54bad6][_0x6b04('0x3a')])&&_0x89653e[_0x6b04('0x74')][_0x54bad6]['parentKey']&&_0x89653e[_0x6b04('0x74')][_0x54bad6][_0x6b04('0x77')]&&_0x89653e[_0x6b04('0x74')][_0x54bad6][_0x6b04('0x78')]){_0x2c6bcd[_0x89653e[_0x6b04('0x74')][_0x54bad6][_0x6b04('0x3a')]](_0x89653e['joins'][_0x54bad6][_0x6b04('0x77')],null,util[_0x6b04('0x6f')](_0x6b04('0x79'),_0x89653e[_0x6b04('0x6b')],_0x89653e[_0x6b04('0x74')][_0x54bad6][_0x6b04('0x76')],_0x89653e['joins'][_0x54bad6]['foreignTable'],_0x89653e[_0x6b04('0x74')][_0x54bad6]['foreignKey']));}}}if(_0x89653e[_0x6b04('0x7a')]){_0x89653e['conditions']=JSON['parse'](_0x89653e[_0x6b04('0x7a')]);_0x2c6bcd[_0x6b04('0x36')](_0x3c9b8b(_0x89653e[_0x6b04('0x7a')][_0x6b04('0x62')]));}_0x4e4920=_0x2c6bcd[_0x6b04('0x89')]();_0x2c6bcd[_0x6b04('0x18')](_0x567ebd);_0x2c6bcd['offset'](0x0);logger[_0x6b04('0x7b')]('Limited\x20Query:',_0x2c6bcd[_0x6b04('0x7d')]());return db[_0x6b04('0x7e')]['query'](_0x2c6bcd['toString'](),{'type':db[_0x6b04('0x7e')][_0x6b04('0x8a')][_0x6b04('0x7f')]});}})['then'](function(_0x2b2283){if(!_0x2b2283[_0x6b04('0x44')]){throw new db[(_0x6b04('0x88'))][(_0x6b04('0x64'))](_0x6b04('0x8b'),0xcc);}if(_0x1801a7[_0x6b04('0x8c')]===_0x6b04('0x8d')){return null;}var _0x5c6047=_[_0x6b04('0x38')](_0x1801a7,{'name':_0x1801a7[_0x6b04('0x8e')]||_0x1801a7[_0x6b04('0x27')]||_0x89653e[_0x6b04('0x27')],'basename':_0x2c2dc2,'savename':util[_0x6b04('0x6f')](_0x6b04('0x8f'),_0x1801a7['name']||_0x89653e[_0x6b04('0x27')],require(_0x6b04('0x90'))['generate'](0x4),_0x1801a7['output']||_0x6b04('0x91')),'reportId':_0x89653e['id'],'reportType':_0x6b04('0x92')});return db[_0x6b04('0x93')]['create'](_0x5c6047,{'raw':!![]});})['then'](function(_0x555266){if(_0x89653e[_0x6b04('0x6b')]===_0x6b04('0x94')){_0x4e4920[_0x6b04('0x36')](_0x89653e[_0x6b04('0x6b')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x1801a7[_0x6b04('0x95')],_0x1801a7['endDate']);}else{_0x4e4920[_0x6b04('0x36')](_0x89653e[_0x6b04('0x6b')]+_0x6b04('0x96'),_0x1801a7['startDate'],_0x1801a7[_0x6b04('0x97')]);}if(_0x555266){logger['info'](_0x6b04('0x98'),_0x4e4920['toString']());require('child_process')['fork'](path[_0x6b04('0x80')](__dirname,_0x6b04('0x99'),_0x555266[_0x6b04('0x8c')]),[_0x555266['id'],_0x4e4920['toString'](),path[_0x6b04('0x80')](__dirname,_0x6b04('0x9a'),_0x555266['savename']),_0x2c2dc2]);return _0x555266;}else{var _0x37cf2f=squel[_0x6b04('0x69')]();_0x37cf2f['from']('('+_0x4e4920['toString']()+')',_0x6b04('0x9b'));_0x37cf2f[_0x6b04('0x3d')](_0x6b04('0x9c'),_0x6b04('0x16'));_0x4e4920[_0x6b04('0x18')](_0x1801a7[_0x6b04('0x18')]||_0x567ebd);_0x4e4920[_0x6b04('0x17')](_0x1801a7[_0x6b04('0x17')]||0x0);return db[_0x6b04('0x7e')]['query'](_0x37cf2f[_0x6b04('0x7d')](),{'type':db[_0x6b04('0x7e')][_0x6b04('0x8a')][_0x6b04('0x7f')]})[_0x6b04('0x21')](function(_0x1eb307){if(!_0x1eb307['length']){_0x10057a=0x0;}else{_0x10057a=_0x1eb307[0x0][_0x6b04('0x16')]||0x0;}return db['sequelize']['query'](_0x4e4920[_0x6b04('0x7d')](),{'type':db['sequelize'][_0x6b04('0x8a')][_0x6b04('0x7f')]});})[_0x6b04('0x21')](function(_0x51277b){return{'rows':_0x51277b||[],'count':_0x10057a};});}});}exports[_0x6b04('0x9d')]=function(_0x3b6249,_0xfe73e7){return runReport(_0x3b6249[_0x6b04('0x43')],_0x3b6249[_0x6b04('0x2e')],_0x3b6249[_0x6b04('0x3f')])[_0x6b04('0x21')](respondWithResult(_0xfe73e7,null))[_0x6b04('0x45')](handleError(_0xfe73e7,null));};exports[_0x6b04('0x9e')]=runReport;exports[_0x6b04('0x2e')]=function(_0x2e9940,_0x2719e9){var _0x3a7b43=0xa;var _0x482b70=[_0x6b04('0x80'),'left_join',_0x6b04('0x82'),_0x6b04('0x4f')];var _0x177a25={'SUM':'SUM(%s)','COUNT':_0x6b04('0x50'),'COUNT DISTINCT':_0x6b04('0x51'),'MAX':_0x6b04('0x52'),'MIN':_0x6b04('0x84'),'AVG':_0x6b04('0x85'),'GROUP_CONCAT':_0x6b04('0x53'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x6b04('0x55')};var _0x492df9={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x6b04('0x57'),'HOUR':_0x6b04('0x58'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x6b04('0x5a')};var _0x307b76=function(_0x43d314){return!_[_0x6b04('0x5b')]([_0x6b04('0x5c'),'IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY'],_0x43d314);};var _0x455667=function(_0x3a4d40){if(!_0x3a4d40||!_0x3a4d40['rules'][_0x6b04('0x44')]){return'';}for(var _0xac857f='(',_0x2afe12=0x0;_0x2afe12<_0x3a4d40['rules'][_0x6b04('0x44')];_0x2afe12+=0x1){_0x2afe12>0x0&&(_0xac857f+='\x20'+_0x3a4d40['operator']+'\x20');_0xac857f+=_0x3a4d40[_0x6b04('0x60')][_0x2afe12][_0x6b04('0x62')]?_0x455667(_0x3a4d40['rules'][_0x2afe12]['group']):_0x3a4d40[_0x6b04('0x60')][_0x2afe12][_0x6b04('0x3d')]+'\x20'+_0x3a4d40[_0x6b04('0x60')][_0x2afe12][_0x6b04('0x86')]+(_0x307b76(_0x3a4d40['rules'][_0x2afe12]['condition'])?'\x20'+_0x3a4d40['rules'][_0x2afe12][_0x6b04('0x63')]:'');}return _0xac857f+')';};var _0x1ee27e={'where':{'id':_0x2e9940[_0x6b04('0x43')]['id']}},_0x40f6f8,_0x20b955,_0x13c6c9,_0x136293,_0x18bfda;_0x1ee27e=_[_0x6b04('0x38')]({},_0x1ee27e,_0x2e9940['options']);return db['AnalyticDefaultReport'][_0x6b04('0x4b')](_0x1ee27e)[_0x6b04('0x21')](function(_0x11d3e5){if(_0x11d3e5){_0x40f6f8=_0x11d3e5;return _0x11d3e5[_0x6b04('0x87')]();}return null;})['then'](function(_0x7d223e){if(_0x7d223e){if(!_0x7d223e[_0x6b04('0x44')]){throw new db[(_0x6b04('0x88'))]['ValidationErrorItem'](_0x6b04('0x65'),0x193);}_0x20b955=_0x7d223e;return db[_0x6b04('0x66')][_0x6b04('0x67')]({'raw':!![]});}return null;})['then'](function(_0x173198){if(_0x173198){_0x13c6c9=_[_0x6b04('0x68')](_0x173198,'id');var _0x376b55;var _0x18490b=squel[_0x6b04('0x69')]();_0x18490b[_0x6b04('0x6a')](_0x40f6f8[_0x6b04('0x6b')]);for(var _0xa9ef27=0x0;_0xa9ef27<_0x20b955['length'];_0xa9ef27+=0x1){_0x376b55=_0x20b955[_0xa9ef27]['MetricId']?_0x13c6c9[_0x20b955[_0xa9ef27][_0x6b04('0x6c')]][_0x6b04('0x6d')]:_0x20b955[_0xa9ef27][_0x6b04('0x3d')];_0x376b55=_0x20b955[_0xa9ef27][_0x6b04('0x6e')]?_[_0x6b04('0x70')](_0x177a25[_0x20b955[_0xa9ef27]['function']],'%s',_0x376b55):_0x376b55;_0x376b55=_0x20b955[_0xa9ef27][_0x6b04('0x6f')]?_['replace'](_0x492df9[_0x20b955[_0xa9ef27]['format']],'%s',_0x376b55):_0x376b55;if(_0x20b955[_0xa9ef27][_0x6b04('0x71')]){_0x18490b[_0x6b04('0x62')](_0x376b55);}_0x20b955[_0xa9ef27][_0x6b04('0x72')]&&_0x18490b[_0x6b04('0x34')](_0x376b55,_0x20b955[_0xa9ef27][_0x6b04('0x72')]===_0x6b04('0x9f')?![]:!![]);_0x18490b[_0x6b04('0x3d')](_0x376b55,_0x20b955[_0xa9ef27][_0x6b04('0x73')]||_0x376b55);}if(_0x40f6f8['joins']){_0x40f6f8[_0x6b04('0x74')]=JSON['parse'](_0x40f6f8[_0x6b04('0x74')]);for(var _0x46226d=0x0;_0x46226d<_0x40f6f8[_0x6b04('0x74')][_0x6b04('0x44')];_0x46226d+=0x1){if(_0x40f6f8[_0x6b04('0x74')][_0x46226d][_0x6b04('0x3a')]&&_[_0x6b04('0x5b')](_0x482b70,_0x40f6f8[_0x6b04('0x74')][_0x46226d]['type'])&&_0x40f6f8['joins'][_0x46226d]['parentKey']&&_0x40f6f8[_0x6b04('0x74')][_0x46226d][_0x6b04('0x77')]&&_0x40f6f8[_0x6b04('0x74')][_0x46226d]['foreignKey']){_0x18490b[_0x40f6f8['joins'][_0x46226d]['type']](_0x40f6f8[_0x6b04('0x74')][_0x46226d][_0x6b04('0x77')],null,util[_0x6b04('0x6f')](_0x6b04('0x79'),_0x40f6f8['table'],_0x40f6f8['joins'][_0x46226d][_0x6b04('0x76')],_0x40f6f8[_0x6b04('0x74')][_0x46226d][_0x6b04('0x77')],_0x40f6f8[_0x6b04('0x74')][_0x46226d][_0x6b04('0x78')]));}}}if(_0x40f6f8['conditions']){_0x40f6f8[_0x6b04('0x7a')]=JSON['parse'](_0x40f6f8[_0x6b04('0x7a')]);_0x18490b[_0x6b04('0x36')](_0x455667(_0x40f6f8['conditions'][_0x6b04('0x62')]));}_0x18bfda=_0x18490b[_0x6b04('0x89')]();_0x18490b[_0x6b04('0x18')](_0x3a7b43);_0x18490b[_0x6b04('0x17')](0x0);logger[_0x6b04('0x7b')]('Limited\x20Query:',_0x18490b[_0x6b04('0x7d')]());return db[_0x6b04('0x7e')][_0x6b04('0x2e')](_0x18490b[_0x6b04('0x7d')](),{'type':db['sequelize'][_0x6b04('0x8a')][_0x6b04('0x7f')]});}})[_0x6b04('0x21')](function(){return{'sql':_0x18bfda[_0x6b04('0x7d')]()};})['then'](respondWithResult(_0x2719e9,null))[_0x6b04('0x45')](handleError(_0x2719e9,null));}; \ No newline at end of file +var _0x481a=['autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','preview','join','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','condition','value','getFields','Sequelize','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','findAll','keyBy','table','metric','replace','function','format','orderBy','DESC','alias','joins','parse','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','left_join','IS\x20NOT\x20NULL','ValidationErrorItem','select','from','MetricId','order','clone','No\x20available\x20data','output','web','randomstring','generate','csv','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','run','runReport','AVG(%s)','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','apply','save','destroy','then','get','DefaultReports','stack','name','send','index','AnalyticDefaultReport','rawAttributes','model','keys','query','intersection','fields','attributes','length','nolimit','sort','filters','filter','where','type','VIRTUAL','field','merge','options','includeAll','include','rows','catch','show','params','find','create','body','user','role','Reports','UserProfileSection'];(function(_0x55c555,_0x449d7e){var _0x5d51d6=function(_0x5e8dc8){while(--_0x5e8dc8){_0x55c555['push'](_0x55c555['shift']());}};_0x5d51d6(++_0x449d7e);}(_0x481a,0x1a0));var _0xa481=function(_0x5353a7,_0x35c20f){_0x5353a7=_0x5353a7-0x0;var _0x2c86ac=_0x481a[_0x5353a7];return _0x2c86ac;};'use strict';var pdf=require(_0xa481('0x0'));var emlformat=require(_0xa481('0x1'));var rimraf=require(_0xa481('0x2'));var zipdir=require(_0xa481('0x3'));var jsonpatch=require(_0xa481('0x4'));var rp=require(_0xa481('0x5'));var moment=require(_0xa481('0x6'));var BPromise=require(_0xa481('0x7'));var Mustache=require(_0xa481('0x8'));var util=require(_0xa481('0x9'));var path=require(_0xa481('0xa'));var sox=require(_0xa481('0xb'));var csv=require(_0xa481('0xc'));var ejs=require(_0xa481('0xd'));var fs=require('fs');var _=require(_0xa481('0xe'));var squel=require(_0xa481('0xf'));var crypto=require('crypto');var jsforce=require(_0xa481('0x10'));var deskjs=require(_0xa481('0x11'));var toCsv=require(_0xa481('0xc'));var querystring=require(_0xa481('0x12'));var Papa=require(_0xa481('0x13'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xa481('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xa481('0x15'))(_0xa481('0x16'));var utils=require(_0xa481('0x17'));var config=require(_0xa481('0x18'));var db=require(_0xa481('0x19'))['db'];function respondWithStatusCode(_0x52937d,_0x161f80){_0x161f80=_0x161f80||0xcc;return function(_0x3f8969){if(_0x3f8969){return _0x52937d[_0xa481('0x1a')](_0x161f80);}return _0x52937d[_0xa481('0x1b')](_0x161f80)[_0xa481('0x1c')]();};}function respondWithResult(_0x1aabd0,_0x470fe6){_0x470fe6=_0x470fe6||0xc8;return function(_0x57ce28){if(_0x57ce28){return _0x1aabd0[_0xa481('0x1b')](_0x470fe6)[_0xa481('0x1d')](_0x57ce28);}};}function respondWithFilteredResult(_0x105bb7,_0xbc785e){return function(_0x1ff2a1){if(_0x1ff2a1){var _0x2271f0=_0x1ff2a1[_0xa481('0x1e')],_0x5ae1b9=_0xbc785e['offset'],_0x5cd5ae=_0xbc785e[_0xa481('0x1f')]+_0xbc785e[_0xa481('0x20')],_0x431109;if(_0x5cd5ae>=_0x2271f0){_0x5cd5ae=_0x2271f0;_0x431109=0xc8;}else{_0x431109=0xce;}_0x105bb7[_0xa481('0x1b')](_0x431109);return _0x105bb7[_0xa481('0x21')]('Content-Range',_0x5ae1b9+'-'+_0x5cd5ae+'/'+_0x2271f0)[_0xa481('0x1d')](_0x1ff2a1);}return null;};}function patchUpdates(_0x535af3){return function(_0x2c2d6c){try{jsonpatch[_0xa481('0x22')](_0x2c2d6c,_0x535af3,!![]);}catch(_0x1c0316){return BPromise['reject'](_0x1c0316);}return _0x2c2d6c[_0xa481('0x23')]();};}function saveUpdates(_0x12eeb1,_0x1fb155){return function(_0x4609f4){if(_0x4609f4){return _0x4609f4['update'](_0x12eeb1)['then'](function(_0x452647){return _0x452647;});}return null;};}function removeEntity(_0x37e3b9,_0x494450){return function(_0x49ade0){if(_0x49ade0){return _0x49ade0[_0xa481('0x24')]()[_0xa481('0x25')](function(){var _0x462cd4=_0x49ade0[_0xa481('0x26')]({'plain':!![]});var _0x55c2b2=_0xa481('0x27');return db['UserProfileResource']['destroy']({'where':{'type':_0x55c2b2,'resourceId':_0x462cd4['id']}})[_0xa481('0x25')](function(){return _0x49ade0;});})['then'](function(){_0x37e3b9[_0xa481('0x1b')](0xcc)[_0xa481('0x1c')]();});}};}function handleEntityNotFound(_0xd0e4ec,_0x351f5e){return function(_0x26d2a4){if(!_0x26d2a4){_0xd0e4ec[_0xa481('0x1a')](0x194);}return _0x26d2a4;};}function handleError(_0x5790eb,_0x216fff){_0x216fff=_0x216fff||0x1f4;return function(_0x177484){logger['error'](_0x177484[_0xa481('0x28')]);if(_0x177484[_0xa481('0x29')]){delete _0x177484[_0xa481('0x29')];}_0x5790eb[_0xa481('0x1b')](_0x216fff)[_0xa481('0x2a')](_0x177484);};}exports[_0xa481('0x2b')]=function(_0xa4dbfa,_0x4dbb71){var _0x413be4={},_0x20ac70={},_0x5a7033={'count':0x0,'rows':[]};var _0x4c3f0a=db[_0xa481('0x2c')][_0xa481('0x2d')];_0x20ac70[_0xa481('0x2e')]=_['keys'](_0x4c3f0a);_0x20ac70['query']=_[_0xa481('0x2f')](_0xa4dbfa[_0xa481('0x30')]);_0x20ac70['filters']=_[_0xa481('0x31')](_0x20ac70[_0xa481('0x2e')],_0x20ac70['query']);_0x413be4['attributes']=_[_0xa481('0x31')](_0x20ac70[_0xa481('0x2e')],qs[_0xa481('0x32')](_0xa4dbfa[_0xa481('0x30')]['fields']));_0x413be4[_0xa481('0x33')]=_0x413be4[_0xa481('0x33')][_0xa481('0x34')]?_0x413be4[_0xa481('0x33')]:_0x20ac70[_0xa481('0x2e')];if(!_0xa4dbfa[_0xa481('0x30')]['hasOwnProperty'](_0xa481('0x35'))){_0x413be4[_0xa481('0x20')]=qs['limit'](_0xa4dbfa[_0xa481('0x30')][_0xa481('0x20')]);_0x413be4[_0xa481('0x1f')]=qs[_0xa481('0x1f')](_0xa4dbfa[_0xa481('0x30')]['offset']);}_0x413be4['order']=qs[_0xa481('0x36')](_0xa4dbfa['query'][_0xa481('0x36')]);_0x413be4['where']=qs[_0xa481('0x37')](_['pick'](_0xa4dbfa[_0xa481('0x30')],_0x20ac70[_0xa481('0x37')]));if(_0xa4dbfa[_0xa481('0x30')][_0xa481('0x38')]){_0x413be4[_0xa481('0x39')]=_['merge'](_0x413be4[_0xa481('0x39')],{'$or':_['map'](_0x4c3f0a,function(_0x312993){if(_0x312993[_0xa481('0x3a')]['key']!==_0xa481('0x3b')){var _0x1b3eb6={};_0x1b3eb6[_0x312993[_0xa481('0x3c')]]={'$like':'%'+_0xa4dbfa[_0xa481('0x30')][_0xa481('0x38')]+'%'};return _0x1b3eb6;}})});}_0x413be4=_[_0xa481('0x3d')]({},_0x413be4,_0xa4dbfa[_0xa481('0x3e')]);var _0x21e528={'where':_0x413be4[_0xa481('0x39')]};return db[_0xa481('0x2c')][_0xa481('0x1e')](_0x21e528)[_0xa481('0x25')](function(_0x3690ef){_0x5a7033[_0xa481('0x1e')]=_0x3690ef;if(_0xa4dbfa[_0xa481('0x30')][_0xa481('0x3f')]){_0x413be4[_0xa481('0x40')]=[{'all':!![]}];}return db['AnalyticDefaultReport']['findAll'](_0x413be4);})[_0xa481('0x25')](function(_0x1c290a){_0x5a7033[_0xa481('0x41')]=_0x1c290a;return _0x5a7033;})[_0xa481('0x25')](respondWithFilteredResult(_0x4dbb71,_0x413be4))[_0xa481('0x42')](handleError(_0x4dbb71,null));};exports[_0xa481('0x43')]=function(_0x5ec6da,_0x1cf931){var _0x4ca0e5={'raw':!![],'where':{'id':_0x5ec6da[_0xa481('0x44')]['id']}},_0x11a34c={};_0x11a34c[_0xa481('0x2e')]=_[_0xa481('0x2f')](db['AnalyticDefaultReport'][_0xa481('0x2d')]);_0x11a34c['query']=_[_0xa481('0x2f')](_0x5ec6da[_0xa481('0x30')]);_0x11a34c[_0xa481('0x37')]=_['intersection'](_0x11a34c[_0xa481('0x2e')],_0x11a34c[_0xa481('0x30')]);_0x4ca0e5[_0xa481('0x33')]=_[_0xa481('0x31')](_0x11a34c['model'],qs[_0xa481('0x32')](_0x5ec6da['query'][_0xa481('0x32')]));_0x4ca0e5[_0xa481('0x33')]=_0x4ca0e5[_0xa481('0x33')][_0xa481('0x34')]?_0x4ca0e5[_0xa481('0x33')]:_0x11a34c['model'];if(_0x5ec6da[_0xa481('0x30')]['includeAll']){_0x4ca0e5[_0xa481('0x40')]=[{'all':!![]}];}_0x4ca0e5=_[_0xa481('0x3d')]({},_0x4ca0e5,_0x5ec6da['options']);return db['AnalyticDefaultReport'][_0xa481('0x45')](_0x4ca0e5)['then'](handleEntityNotFound(_0x1cf931,null))['then'](respondWithResult(_0x1cf931,null))[_0xa481('0x42')](handleError(_0x1cf931,null));};exports['create']=function(_0x211be0,_0x3bc48f){return db[_0xa481('0x2c')][_0xa481('0x46')](_0x211be0[_0xa481('0x47')],{})[_0xa481('0x25')](function(_0x4f791f){var _0xc4558a=_0x211be0[_0xa481('0x48')][_0xa481('0x26')]({'plain':!![]});if(!_0xc4558a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xc4558a[_0xa481('0x49')]==='user'){var _0x2129bf=_0x4f791f['get']({'plain':!![]});var _0x204727=_0xa481('0x4a');return db[_0xa481('0x4b')][_0xa481('0x45')]({'where':{'name':_0x204727,'userProfileId':_0xc4558a['userProfileId']},'raw':!![]})[_0xa481('0x25')](function(_0x531081){if(_0x531081&&_0x531081[_0xa481('0x4c')]===0x0){return db[_0xa481('0x4d')][_0xa481('0x46')]({'name':_0x2129bf['name'],'resourceId':_0x2129bf['id'],'type':'DefaultReports','sectionId':_0x531081['id']},{})['then'](function(){return _0x4f791f;});}else{return _0x4f791f;}})[_0xa481('0x42')](function(_0x76a2a0){logger[_0xa481('0x4e')](_0xa481('0x4f'),_0x76a2a0);throw _0x76a2a0;});}return _0x4f791f;})[_0xa481('0x25')](respondWithResult(_0x3bc48f,0xc9))['catch'](handleError(_0x3bc48f,null));};exports[_0xa481('0x50')]=function(_0x429da2,_0x23c9a0){if(_0x429da2[_0xa481('0x47')]['id']){delete _0x429da2['body']['id'];}return db['AnalyticDefaultReport'][_0xa481('0x45')]({'where':{'id':_0x429da2[_0xa481('0x44')]['id']}})[_0xa481('0x25')](handleEntityNotFound(_0x23c9a0,null))[_0xa481('0x25')](saveUpdates(_0x429da2['body'],null))[_0xa481('0x25')](respondWithResult(_0x23c9a0,null))[_0xa481('0x42')](handleError(_0x23c9a0,null));};exports['destroy']=function(_0x5880c4,_0x2d27f4){return db[_0xa481('0x2c')][_0xa481('0x45')]({'where':{'id':_0x5880c4[_0xa481('0x44')]['id']}})[_0xa481('0x25')](handleEntityNotFound(_0x2d27f4,null))[_0xa481('0x25')](removeEntity(_0x2d27f4,null))[_0xa481('0x42')](handleError(_0x2d27f4,null));};exports[_0xa481('0x51')]=function(_0x1b337d,_0x5aa45b){var _0x4698a3=0xa;var _0x2c984f=[_0xa481('0x52'),'left_join',_0xa481('0x53'),_0xa481('0x54')];var _0x1ecd36={'SUM':_0xa481('0x55'),'COUNT':_0xa481('0x56'),'COUNT DISTINCT':_0xa481('0x57'),'MAX':_0xa481('0x58'),'MIN':_0xa481('0x59'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xa481('0x5a'),'GROUP_CONCAT ASC':_0xa481('0x5b'),'GROUP_CONCAT DESC':_0xa481('0x5c')};var _0x39c6a0={'SEC_TO_TIME':_0xa481('0x5d'),'DATE':_0xa481('0x5e'),'HOUR':_0xa481('0x5f'),'ROUND':_0xa481('0x60'),'UNIX_TIMESTAMP':_0xa481('0x61')};var _0x7a5d6c=function(_0x290675){return!_[_0xa481('0x62')]([_0xa481('0x63'),'IS\x20NOT\x20NULL',_0xa481('0x64'),_0xa481('0x65')],_0x290675);};var _0x532134=function(_0x1c7e7c){if(!_0x1c7e7c||!_0x1c7e7c[_0xa481('0x66')][_0xa481('0x34')]){return'';}for(var _0x4b45e2='(',_0x374a49=0x0;_0x374a49<_0x1c7e7c[_0xa481('0x66')][_0xa481('0x34')];_0x374a49+=0x1){_0x374a49>0x0&&(_0x4b45e2+='\x20'+_0x1c7e7c[_0xa481('0x67')]+'\x20');_0x4b45e2+=_0x1c7e7c[_0xa481('0x66')][_0x374a49][_0xa481('0x68')]?_0x532134(_0x1c7e7c[_0xa481('0x66')][_0x374a49]['group']):_0x1c7e7c[_0xa481('0x66')][_0x374a49][_0xa481('0x3c')]+'\x20'+_0x1c7e7c[_0xa481('0x66')][_0x374a49]['condition']+(_0x7a5d6c(_0x1c7e7c[_0xa481('0x66')][_0x374a49][_0xa481('0x69')])?'\x20'+_0x1c7e7c[_0xa481('0x66')][_0x374a49][_0xa481('0x6a')]:'');}return _0x4b45e2+')';};var _0x2b3220={'where':{'id':_0x1b337d[_0xa481('0x44')]['id']}},_0x2e21c4,_0x1bbffb,_0x53621c,_0x48c711,_0x5cd839;_0x2b3220=_[_0xa481('0x3d')]({},_0x2b3220,_0x1b337d[_0xa481('0x3e')]);return db['AnalyticDefaultReport'][_0xa481('0x45')](_0x2b3220)['then'](function(_0x58f63a){if(_0x58f63a){_0x2e21c4=_0x58f63a;return _0x58f63a[_0xa481('0x6b')]();}return null;})['then'](function(_0x5d86d9){if(_0x5d86d9){if(!_0x5d86d9[_0xa481('0x34')]){throw new db[(_0xa481('0x6c'))]['ValidationErrorItem'](_0xa481('0x6d'),0x193);}_0x1bbffb=_0x5d86d9;return db[_0xa481('0x6e')][_0xa481('0x6f')]({'raw':!![]});}return null;})[_0xa481('0x25')](function(_0x2fa469){if(_0x2fa469){_0x53621c=_[_0xa481('0x70')](_0x2fa469,'id');var _0x5b7ffb;var _0x1daaee=squel['select']();_0x1daaee['from'](_0x2e21c4[_0xa481('0x71')]);for(var _0x4ebbef=0x0;_0x4ebbef<_0x1bbffb[_0xa481('0x34')];_0x4ebbef+=0x1){_0x5b7ffb=_0x1bbffb[_0x4ebbef]['MetricId']?_0x53621c[_0x1bbffb[_0x4ebbef]['MetricId']][_0xa481('0x72')]:_0x1bbffb[_0x4ebbef][_0xa481('0x3c')];_0x5b7ffb=_0x1bbffb[_0x4ebbef]['function']?_[_0xa481('0x73')](_0x1ecd36[_0x1bbffb[_0x4ebbef][_0xa481('0x74')]],'%s',_0x5b7ffb):_0x5b7ffb;_0x5b7ffb=_0x1bbffb[_0x4ebbef]['format']?_[_0xa481('0x73')](_0x39c6a0[_0x1bbffb[_0x4ebbef][_0xa481('0x75')]],'%s',_0x5b7ffb):_0x5b7ffb;if(_0x1bbffb[_0x4ebbef]['groupBy']){_0x1daaee[_0xa481('0x68')](_0x5b7ffb);}_0x1bbffb[_0x4ebbef][_0xa481('0x76')]&&_0x1daaee['order'](_0x5b7ffb,_0x1bbffb[_0x4ebbef][_0xa481('0x76')]===_0xa481('0x77')?![]:!![]);_0x1daaee['field'](_0x5b7ffb,_0x1bbffb[_0x4ebbef][_0xa481('0x78')]||_0x5b7ffb);}if(_0x2e21c4[_0xa481('0x79')]){_0x2e21c4[_0xa481('0x79')]=JSON[_0xa481('0x7a')](_0x2e21c4['joins']);for(var _0x561a82=0x0;_0x561a82<_0x2e21c4['joins']['length'];_0x561a82+=0x1){if(_0x2e21c4[_0xa481('0x79')][_0x561a82][_0xa481('0x3a')]&&_[_0xa481('0x62')](_0x2c984f,_0x2e21c4[_0xa481('0x79')][_0x561a82][_0xa481('0x3a')])&&_0x2e21c4['joins'][_0x561a82][_0xa481('0x7b')]&&_0x2e21c4[_0xa481('0x79')][_0x561a82][_0xa481('0x7c')]&&_0x2e21c4[_0xa481('0x79')][_0x561a82][_0xa481('0x7d')]){_0x1daaee[_0x2e21c4[_0xa481('0x79')][_0x561a82][_0xa481('0x3a')]](_0x2e21c4[_0xa481('0x79')][_0x561a82]['foreignTable'],null,util[_0xa481('0x75')](_0xa481('0x7e'),_0x2e21c4['table'],_0x2e21c4[_0xa481('0x79')][_0x561a82][_0xa481('0x7b')],_0x2e21c4[_0xa481('0x79')][_0x561a82][_0xa481('0x7c')],_0x2e21c4[_0xa481('0x79')][_0x561a82][_0xa481('0x7d')]));}}}if(_0x2e21c4[_0xa481('0x7f')]){_0x2e21c4[_0xa481('0x7f')]=JSON[_0xa481('0x7a')](_0x2e21c4['conditions']);_0x1daaee[_0xa481('0x39')](_0x532134(_0x2e21c4[_0xa481('0x7f')][_0xa481('0x68')]));}_0x5cd839=_0x1daaee['clone']();_0x1daaee[_0xa481('0x20')](_0x4698a3);_0x1daaee[_0xa481('0x1f')](0x0);logger[_0xa481('0x80')](_0xa481('0x81'),_0x1daaee[_0xa481('0x82')]());return db[_0xa481('0x83')]['query'](_0x1daaee[_0xa481('0x82')](),{'type':db['sequelize'][_0xa481('0x84')][_0xa481('0x85')]});}})[_0xa481('0x25')](respondWithResult(_0x5aa45b,null))[_0xa481('0x42')](handleError(_0x5aa45b,null));};function runReport(_0x5dc654,_0x4687f3,_0x59a732){var _0x4c8538=_0x4687f3['name'];var _0x2404dd=0xa;var _0x38a79a=[_0xa481('0x52'),_0xa481('0x86'),'right_join',_0xa481('0x54')];var _0x872006={'SUM':_0xa481('0x55'),'COUNT':_0xa481('0x56'),'COUNT DISTINCT':_0xa481('0x57'),'MAX':_0xa481('0x58'),'MIN':_0xa481('0x59'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xa481('0x5a'),'GROUP_CONCAT ASC':_0xa481('0x5b'),'GROUP_CONCAT DESC':_0xa481('0x5c')};var _0x56be0e={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xa481('0x5e'),'HOUR':'HOUR(%s)','ROUND':_0xa481('0x60'),'UNIX_TIMESTAMP':_0xa481('0x61')};var _0x9235a4=function(_0x1d3488){return!_[_0xa481('0x62')]([_0xa481('0x63'),_0xa481('0x87'),_0xa481('0x64'),_0xa481('0x65')],_0x1d3488);};var _0x486e8e=function(_0x3b6b09){if(!_0x3b6b09||!_0x3b6b09[_0xa481('0x66')][_0xa481('0x34')]){return'';}for(var _0x3f2ad0='(',_0x2bdd8c=0x0;_0x2bdd8c<_0x3b6b09[_0xa481('0x66')][_0xa481('0x34')];_0x2bdd8c+=0x1){_0x2bdd8c>0x0&&(_0x3f2ad0+='\x20'+_0x3b6b09[_0xa481('0x67')]+'\x20');_0x3f2ad0+=_0x3b6b09[_0xa481('0x66')][_0x2bdd8c][_0xa481('0x68')]?_0x486e8e(_0x3b6b09[_0xa481('0x66')][_0x2bdd8c][_0xa481('0x68')]):_0x3b6b09['rules'][_0x2bdd8c]['field']+'\x20'+_0x3b6b09[_0xa481('0x66')][_0x2bdd8c][_0xa481('0x69')]+(_0x9235a4(_0x3b6b09[_0xa481('0x66')][_0x2bdd8c][_0xa481('0x69')])?'\x20'+_0x3b6b09['rules'][_0x2bdd8c][_0xa481('0x6a')]:'');}return _0x3f2ad0+')';};var _0x1c4538={'where':{'id':_0x5dc654['id']}},_0x13e8ec,_0x2d2046,_0x2a079a,_0x26bea0,_0x115b00;_0x1c4538=_['merge']({},_0x1c4538,_0x59a732);return db['AnalyticDefaultReport'][_0xa481('0x45')](_0x1c4538)[_0xa481('0x25')](function(_0xf47761){if(_0xf47761){_0x13e8ec=_0xf47761;return _0xf47761[_0xa481('0x6b')]();}return null;})[_0xa481('0x25')](function(_0x3c7586){if(_0x3c7586){if(!_0x3c7586[_0xa481('0x34')]){throw new db[(_0xa481('0x6c'))][(_0xa481('0x88'))](_0xa481('0x6d'),0x193);}_0x2d2046=_0x3c7586;return db[_0xa481('0x6e')][_0xa481('0x6f')]({'raw':!![]});}return null;})['then'](function(_0x1132e4){if(_0x1132e4){_0x2a079a=_[_0xa481('0x70')](_0x1132e4,'id');var _0x269b01;var _0x41078d=squel[_0xa481('0x89')]();_0x41078d[_0xa481('0x8a')](_0x13e8ec[_0xa481('0x71')]);for(var _0x1a0080=0x0;_0x1a0080<_0x2d2046[_0xa481('0x34')];_0x1a0080+=0x1){_0x269b01=_0x2d2046[_0x1a0080][_0xa481('0x8b')]?_0x2a079a[_0x2d2046[_0x1a0080][_0xa481('0x8b')]][_0xa481('0x72')]:_0x2d2046[_0x1a0080][_0xa481('0x3c')];_0x269b01=_0x2d2046[_0x1a0080][_0xa481('0x74')]?_[_0xa481('0x73')](_0x872006[_0x2d2046[_0x1a0080][_0xa481('0x74')]],'%s',_0x269b01):_0x269b01;_0x269b01=_0x2d2046[_0x1a0080][_0xa481('0x75')]?_[_0xa481('0x73')](_0x56be0e[_0x2d2046[_0x1a0080]['format']],'%s',_0x269b01):_0x269b01;if(_0x2d2046[_0x1a0080]['groupBy']){_0x41078d[_0xa481('0x68')](_0x269b01);}_0x2d2046[_0x1a0080][_0xa481('0x76')]&&_0x41078d[_0xa481('0x8c')](_0x269b01,_0x2d2046[_0x1a0080]['orderBy']==='DESC'?![]:!![]);_0x41078d['field'](_0x269b01,_0x2d2046[_0x1a0080][_0xa481('0x78')]||_0x269b01);}if(_0x13e8ec[_0xa481('0x79')]){_0x13e8ec['joins']=JSON['parse'](_0x13e8ec[_0xa481('0x79')]);for(var _0x11278d=0x0;_0x11278d<_0x13e8ec[_0xa481('0x79')][_0xa481('0x34')];_0x11278d+=0x1){if(_0x13e8ec[_0xa481('0x79')][_0x11278d][_0xa481('0x3a')]&&_[_0xa481('0x62')](_0x38a79a,_0x13e8ec[_0xa481('0x79')][_0x11278d][_0xa481('0x3a')])&&_0x13e8ec[_0xa481('0x79')][_0x11278d][_0xa481('0x7b')]&&_0x13e8ec['joins'][_0x11278d][_0xa481('0x7c')]&&_0x13e8ec[_0xa481('0x79')][_0x11278d][_0xa481('0x7d')]){_0x41078d[_0x13e8ec['joins'][_0x11278d]['type']](_0x13e8ec[_0xa481('0x79')][_0x11278d][_0xa481('0x7c')],null,util[_0xa481('0x75')](_0xa481('0x7e'),_0x13e8ec['table'],_0x13e8ec['joins'][_0x11278d][_0xa481('0x7b')],_0x13e8ec[_0xa481('0x79')][_0x11278d][_0xa481('0x7c')],_0x13e8ec[_0xa481('0x79')][_0x11278d][_0xa481('0x7d')]));}}}if(_0x13e8ec['conditions']){_0x13e8ec[_0xa481('0x7f')]=JSON['parse'](_0x13e8ec[_0xa481('0x7f')]);_0x41078d['where'](_0x486e8e(_0x13e8ec[_0xa481('0x7f')][_0xa481('0x68')]));}_0x115b00=_0x41078d[_0xa481('0x8d')]();_0x41078d[_0xa481('0x20')](_0x2404dd);_0x41078d['offset'](0x0);logger['debug'](_0xa481('0x81'),_0x41078d[_0xa481('0x82')]());return db[_0xa481('0x83')][_0xa481('0x30')](_0x41078d[_0xa481('0x82')](),{'type':db['sequelize'][_0xa481('0x84')]['SELECT']});}})[_0xa481('0x25')](function(_0x52c30f){if(!_0x52c30f[_0xa481('0x34')]){throw new db['Sequelize'][(_0xa481('0x88'))](_0xa481('0x8e'),0xcc);}if(_0x4687f3[_0xa481('0x8f')]===_0xa481('0x90')){return null;}var _0x1c874a=_[_0xa481('0x3d')](_0x4687f3,{'name':_0x4687f3['fullPath']||_0x4687f3[_0xa481('0x29')]||_0x13e8ec[_0xa481('0x29')],'basename':_0x4c8538,'savename':util[_0xa481('0x75')]('%s-%s.%s',_0x4687f3[_0xa481('0x29')]||_0x13e8ec['name'],require(_0xa481('0x91'))[_0xa481('0x92')](0x4),_0x4687f3[_0xa481('0x8f')]||_0xa481('0x93')),'reportId':_0x13e8ec['id'],'reportType':'default'});return db[_0xa481('0x94')][_0xa481('0x46')](_0x1c874a,{'raw':!![]});})[_0xa481('0x25')](function(_0x530131){if(_0x13e8ec[_0xa481('0x71')]===_0xa481('0x95')){_0x115b00[_0xa481('0x39')](_0x13e8ec[_0xa481('0x71')]+_0xa481('0x96'),_0x4687f3[_0xa481('0x97')],_0x4687f3['endDate']);}else{_0x115b00[_0xa481('0x39')](_0x13e8ec[_0xa481('0x71')]+_0xa481('0x98'),_0x4687f3[_0xa481('0x97')],_0x4687f3['endDate']);}if(_0x530131){logger['info'](_0xa481('0x99'),_0x115b00[_0xa481('0x82')]());require(_0xa481('0x9a'))[_0xa481('0x9b')](path[_0xa481('0x52')](__dirname,_0xa481('0x9c'),_0x530131[_0xa481('0x8f')]),[_0x530131['id'],_0x115b00[_0xa481('0x82')](),path[_0xa481('0x52')](__dirname,_0xa481('0x9d'),_0x530131[_0xa481('0x9e')]),_0x4c8538]);return _0x530131;}else{var _0x3ea440=squel['select']();_0x3ea440['from']('('+_0x115b00['toString']()+')',_0xa481('0x9f'));_0x3ea440[_0xa481('0x3c')](_0xa481('0xa0'),'count');_0x115b00[_0xa481('0x20')](_0x4687f3[_0xa481('0x20')]||_0x2404dd);_0x115b00[_0xa481('0x1f')](_0x4687f3[_0xa481('0x1f')]||0x0);return db[_0xa481('0x83')][_0xa481('0x30')](_0x3ea440[_0xa481('0x82')](),{'type':db['sequelize'][_0xa481('0x84')][_0xa481('0x85')]})[_0xa481('0x25')](function(_0x2d35f0){if(!_0x2d35f0[_0xa481('0x34')]){_0x26bea0=0x0;}else{_0x26bea0=_0x2d35f0[0x0][_0xa481('0x1e')]||0x0;}return db[_0xa481('0x83')][_0xa481('0x30')](_0x115b00[_0xa481('0x82')](),{'type':db[_0xa481('0x83')][_0xa481('0x84')][_0xa481('0x85')]});})['then'](function(_0x2c25a9){return{'rows':_0x2c25a9||[],'count':_0x26bea0};});}});}exports[_0xa481('0xa1')]=function(_0x427c65,_0x2832a8){return runReport(_0x427c65[_0xa481('0x44')],_0x427c65[_0xa481('0x30')],_0x427c65[_0xa481('0x3e')])[_0xa481('0x25')](respondWithResult(_0x2832a8,null))[_0xa481('0x42')](handleError(_0x2832a8,null));};exports[_0xa481('0xa2')]=runReport;exports['query']=function(_0x598ccf,_0x213249){var _0x17cba9=0xa;var _0x38f586=[_0xa481('0x52'),_0xa481('0x86'),_0xa481('0x53'),_0xa481('0x54')];var _0x143149={'SUM':'SUM(%s)','COUNT':_0xa481('0x56'),'COUNT DISTINCT':_0xa481('0x57'),'MAX':'MAX(%s)','MIN':_0xa481('0x59'),'AVG':_0xa481('0xa3'),'GROUP_CONCAT':_0xa481('0x5a'),'GROUP_CONCAT ASC':_0xa481('0x5b'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x49d6b1={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xa481('0x5e'),'HOUR':_0xa481('0x5f'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xa481('0x61')};var _0x1eb238=function(_0x110f3c){return!_['includes']([_0xa481('0x63'),_0xa481('0x87'),'IS\x20EMPTY','IS\x20NOT\x20EMPTY'],_0x110f3c);};var _0x41884b=function(_0x239453){if(!_0x239453||!_0x239453[_0xa481('0x66')]['length']){return'';}for(var _0x1b125b='(',_0x54b6ee=0x0;_0x54b6ee<_0x239453[_0xa481('0x66')][_0xa481('0x34')];_0x54b6ee+=0x1){_0x54b6ee>0x0&&(_0x1b125b+='\x20'+_0x239453['operator']+'\x20');_0x1b125b+=_0x239453[_0xa481('0x66')][_0x54b6ee][_0xa481('0x68')]?_0x41884b(_0x239453['rules'][_0x54b6ee][_0xa481('0x68')]):_0x239453[_0xa481('0x66')][_0x54b6ee][_0xa481('0x3c')]+'\x20'+_0x239453[_0xa481('0x66')][_0x54b6ee][_0xa481('0x69')]+(_0x1eb238(_0x239453[_0xa481('0x66')][_0x54b6ee][_0xa481('0x69')])?'\x20'+_0x239453[_0xa481('0x66')][_0x54b6ee]['value']:'');}return _0x1b125b+')';};var _0x32d9bc={'where':{'id':_0x598ccf['params']['id']}},_0x2729e0,_0x4a5718,_0x220c49,_0x491d55,_0x3cc056;_0x32d9bc=_[_0xa481('0x3d')]({},_0x32d9bc,_0x598ccf[_0xa481('0x3e')]);return db[_0xa481('0x2c')][_0xa481('0x45')](_0x32d9bc)[_0xa481('0x25')](function(_0x371911){if(_0x371911){_0x2729e0=_0x371911;return _0x371911[_0xa481('0x6b')]();}return null;})[_0xa481('0x25')](function(_0x1d4c86){if(_0x1d4c86){if(!_0x1d4c86[_0xa481('0x34')]){throw new db['Sequelize'][(_0xa481('0x88'))](_0xa481('0x6d'),0x193);}_0x4a5718=_0x1d4c86;return db[_0xa481('0x6e')]['findAll']({'raw':!![]});}return null;})[_0xa481('0x25')](function(_0x5615ee){if(_0x5615ee){_0x220c49=_[_0xa481('0x70')](_0x5615ee,'id');var _0x3a90f1;var _0x4551c0=squel['select']();_0x4551c0[_0xa481('0x8a')](_0x2729e0[_0xa481('0x71')]);for(var _0x33cac2=0x0;_0x33cac2<_0x4a5718[_0xa481('0x34')];_0x33cac2+=0x1){_0x3a90f1=_0x4a5718[_0x33cac2][_0xa481('0x8b')]?_0x220c49[_0x4a5718[_0x33cac2][_0xa481('0x8b')]][_0xa481('0x72')]:_0x4a5718[_0x33cac2][_0xa481('0x3c')];_0x3a90f1=_0x4a5718[_0x33cac2][_0xa481('0x74')]?_['replace'](_0x143149[_0x4a5718[_0x33cac2][_0xa481('0x74')]],'%s',_0x3a90f1):_0x3a90f1;_0x3a90f1=_0x4a5718[_0x33cac2][_0xa481('0x75')]?_[_0xa481('0x73')](_0x49d6b1[_0x4a5718[_0x33cac2]['format']],'%s',_0x3a90f1):_0x3a90f1;if(_0x4a5718[_0x33cac2]['groupBy']){_0x4551c0[_0xa481('0x68')](_0x3a90f1);}_0x4a5718[_0x33cac2]['orderBy']&&_0x4551c0['order'](_0x3a90f1,_0x4a5718[_0x33cac2][_0xa481('0x76')]===_0xa481('0x77')?![]:!![]);_0x4551c0[_0xa481('0x3c')](_0x3a90f1,_0x4a5718[_0x33cac2][_0xa481('0x78')]||_0x3a90f1);}if(_0x2729e0['joins']){_0x2729e0[_0xa481('0x79')]=JSON[_0xa481('0x7a')](_0x2729e0[_0xa481('0x79')]);for(var _0x303d06=0x0;_0x303d06<_0x2729e0[_0xa481('0x79')][_0xa481('0x34')];_0x303d06+=0x1){if(_0x2729e0[_0xa481('0x79')][_0x303d06][_0xa481('0x3a')]&&_[_0xa481('0x62')](_0x38f586,_0x2729e0[_0xa481('0x79')][_0x303d06][_0xa481('0x3a')])&&_0x2729e0[_0xa481('0x79')][_0x303d06][_0xa481('0x7b')]&&_0x2729e0[_0xa481('0x79')][_0x303d06][_0xa481('0x7c')]&&_0x2729e0['joins'][_0x303d06][_0xa481('0x7d')]){_0x4551c0[_0x2729e0['joins'][_0x303d06]['type']](_0x2729e0[_0xa481('0x79')][_0x303d06][_0xa481('0x7c')],null,util['format'](_0xa481('0x7e'),_0x2729e0[_0xa481('0x71')],_0x2729e0[_0xa481('0x79')][_0x303d06]['parentKey'],_0x2729e0['joins'][_0x303d06][_0xa481('0x7c')],_0x2729e0[_0xa481('0x79')][_0x303d06][_0xa481('0x7d')]));}}}if(_0x2729e0[_0xa481('0x7f')]){_0x2729e0[_0xa481('0x7f')]=JSON[_0xa481('0x7a')](_0x2729e0['conditions']);_0x4551c0[_0xa481('0x39')](_0x41884b(_0x2729e0['conditions'][_0xa481('0x68')]));}_0x3cc056=_0x4551c0[_0xa481('0x8d')]();_0x4551c0['limit'](_0x17cba9);_0x4551c0[_0xa481('0x1f')](0x0);logger[_0xa481('0x80')](_0xa481('0x81'),_0x4551c0[_0xa481('0x82')]());return db[_0xa481('0x83')][_0xa481('0x30')](_0x4551c0[_0xa481('0x82')](),{'type':db[_0xa481('0x83')]['QueryTypes']['SELECT']});}})[_0xa481('0x25')](function(){return{'sql':_0x3cc056['toString']()};})[_0xa481('0x25')](respondWithResult(_0x213249,null))[_0xa481('0x42')](handleError(_0x213249,null));}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js index 338d006..29208a1 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 _0xf2bc=['util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','exports','define','AnalyticDefaultReport','analytics_default_reports'];(function(_0xa200af,_0x180ca4){var _0x3d485a=function(_0x56ba33){while(--_0x56ba33){_0xa200af['push'](_0xa200af['shift']());}};_0x3d485a(++_0x180ca4);}(_0xf2bc,0x134));var _0xcf2b=function(_0x5d7299,_0x544bc0){_0x5d7299=_0x5d7299-0x0;var _0x3125ea=_0xf2bc[_0x5d7299];return _0x3125ea;};'use strict';var _=require('lodash');var util=require(_0xcf2b('0x0'));var logger=require(_0xcf2b('0x1'))('api');var moment=require(_0xcf2b('0x2'));var BPromise=require('bluebird');var rp=require(_0xcf2b('0x3'));var fs=require('fs');var path=require(_0xcf2b('0x4'));var rimraf=require(_0xcf2b('0x5'));var config=require(_0xcf2b('0x6'));var attributes=require('./analyticDefaultReport.attributes');module[_0xcf2b('0x7')]=function(_0x34615a,_0x5ed704){return _0x34615a[_0xcf2b('0x8')](_0xcf2b('0x9'),attributes,{'tableName':_0xcf2b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x67b3=['rimraf','./analyticDefaultReport.attributes','exports','define','analytics_default_reports','lodash','request-promise'];(function(_0x513254,_0x1305ca){var _0x384c92=function(_0xb22823){while(--_0xb22823){_0x513254['push'](_0x513254['shift']());}};_0x384c92(++_0x1305ca);}(_0x67b3,0x98));var _0x367b=function(_0x23b655,_0x4feb2b){_0x23b655=_0x23b655-0x0;var _0x364b32=_0x67b3[_0x23b655];return _0x364b32;};'use strict';var _=require(_0x367b('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x367b('0x1'));var fs=require('fs');var path=require('path');var rimraf=require(_0x367b('0x2'));var config=require('../../config/environment');var attributes=require(_0x367b('0x3'));module[_0x367b('0x4')]=function(_0x4ab23f,_0x13b65f){return _0x4ab23f[_0x367b('0x5')]('AnalyticDefaultReport',attributes,{'tableName':_0x367b('0x6'),'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 b57dfab..dc960b6 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 _0x61a5=['rpc','../../config/environment','jayson/promise','client','http','then','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','moment','bluebird','ioredis','../../config/utils','../../config/logger'];(function(_0x332de3,_0x38077f){var _0x5ce62d=function(_0x4cabdc){while(--_0x4cabdc){_0x332de3['push'](_0x332de3['shift']());}};_0x5ce62d(++_0x38077f);}(_0x61a5,0x19e));var _0x561a=function(_0x335a62,_0xfafea4){_0x335a62=_0x335a62-0x0;var _0x249a9a=_0x61a5[_0x335a62];return _0x249a9a;};'use strict';var _=require(_0x561a('0x0'));var util=require('util');var moment=require(_0x561a('0x1'));var BPromise=require(_0x561a('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x561a('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x561a('0x4'));var logger=require(_0x561a('0x5'))(_0x561a('0x6'));var config=require(_0x561a('0x7'));var jayson=require(_0x561a('0x8'));var client=jayson[_0x561a('0x9')][_0x561a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2a763a,_0x4c2853,_0x3d020c){return new BPromise(function(_0x27e026,_0xe056b2){return client['request'](_0x2a763a,_0x3d020c)[_0x561a('0xb')](function(_0x2a0fdb){logger['info'](_0x561a('0xc'),_0x4c2853,_0x561a('0xd'));logger[_0x561a('0xe')](_0x561a('0xf'),_0x4c2853,'request\x20sent',JSON['stringify'](_0x2a0fdb));if(_0x2a0fdb[_0x561a('0x10')]){if(_0x2a0fdb[_0x561a('0x10')][_0x561a('0x11')]===0x1f4){logger[_0x561a('0x10')](_0x561a('0xc'),_0x4c2853,_0x2a0fdb[_0x561a('0x10')][_0x561a('0x12')]);return _0xe056b2(_0x2a0fdb[_0x561a('0x10')]['message']);}logger[_0x561a('0x10')](_0x561a('0xc'),_0x4c2853,_0x2a0fdb[_0x561a('0x10')][_0x561a('0x12')]);return _0x27e026(_0x2a0fdb['error'][_0x561a('0x12')]);}else{logger['info'](_0x561a('0xc'),_0x4c2853,_0x561a('0xd'));_0x27e026(_0x2a0fdb[_0x561a('0x13')][_0x561a('0x12')]);}})[_0x561a('0x14')](function(_0xb777ee){logger['error']('AnalyticDefaultReport,\x20%s,\x20%s',_0x4c2853,_0xb777ee);_0xe056b2(_0xb777ee);});});} \ No newline at end of file +var _0x3611=['debug','error','message','result','lodash','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent'];(function(_0x18011b,_0x5e6516){var _0x14722e=function(_0x5d22c7){while(--_0x5d22c7){_0x18011b['push'](_0x18011b['shift']());}};_0x14722e(++_0x5e6516);}(_0x3611,0x136));var _0x1361=function(_0x4ac3da,_0x5e1c98){_0x4ac3da=_0x4ac3da-0x0;var _0x32055d=_0x3611[_0x4ac3da];return _0x32055d;};'use strict';var _=require(_0x1361('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x1361('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1361('0x2'))['db'];var utils=require(_0x1361('0x3'));var logger=require(_0x1361('0x4'))(_0x1361('0x5'));var config=require('../../config/environment');var jayson=require(_0x1361('0x6'));var client=jayson[_0x1361('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x216d22,_0x4da71d,_0x2af7c4){return new BPromise(function(_0x49cfad,_0x5cc29f){return client[_0x1361('0x8')](_0x216d22,_0x2af7c4)[_0x1361('0x9')](function(_0x146242){logger[_0x1361('0xa')](_0x1361('0xb'),_0x4da71d,_0x1361('0xc'));logger[_0x1361('0xd')]('AnalyticDefaultReport,\x20%s,\x20%s,\x20%s',_0x4da71d,_0x1361('0xc'),JSON['stringify'](_0x146242));if(_0x146242['error']){if(_0x146242[_0x1361('0xe')]['code']===0x1f4){logger[_0x1361('0xe')](_0x1361('0xb'),_0x4da71d,_0x146242[_0x1361('0xe')][_0x1361('0xf')]);return _0x5cc29f(_0x146242[_0x1361('0xe')][_0x1361('0xf')]);}logger[_0x1361('0xe')](_0x1361('0xb'),_0x4da71d,_0x146242['error']['message']);return _0x49cfad(_0x146242[_0x1361('0xe')]['message']);}else{logger['info'](_0x1361('0xb'),_0x4da71d,_0x1361('0xc'));_0x49cfad(_0x146242[_0x1361('0x10')][_0x1361('0xf')]);}})['catch'](function(_0x1bb588){logger[_0x1361('0xe')](_0x1361('0xb'),_0x4da71d,_0x1bb588);_0x5cc29f(_0x1bb588);});});} \ No newline at end of file diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js index fc5fbbc..7f963b5 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 _0xab25=['../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','get','isAuthenticated','index','show','/:id/preview','preview','/:id/run','run','/:id/query','query','post','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x125425,_0x4b6bab){var _0xd04dc4=function(_0x37fc01){while(--_0x37fc01){_0x125425['push'](_0x125425['shift']());}};_0xd04dc4(++_0x4b6bab);}(_0xab25,0x1f3));var _0x5ab2=function(_0x562030,_0x535185){_0x562030=_0x562030-0x0;var _0x386332=_0xab25[_0x562030];return _0x386332;};'use strict';var multer=require(_0x5ab2('0x0'));var util=require(_0x5ab2('0x1'));var path=require(_0x5ab2('0x2'));var timeout=require(_0x5ab2('0x3'));var express=require(_0x5ab2('0x4'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x5ab2('0x5'));var config=require(_0x5ab2('0x6'));var controller=require(_0x5ab2('0x7'));router[_0x5ab2('0x8')]('/',auth[_0x5ab2('0x9')](),controller[_0x5ab2('0xa')]);router[_0x5ab2('0x8')]('/:id',auth[_0x5ab2('0x9')](),controller[_0x5ab2('0xb')]);router[_0x5ab2('0x8')](_0x5ab2('0xc'),auth[_0x5ab2('0x9')](),controller[_0x5ab2('0xd')]);router['get'](_0x5ab2('0xe'),auth['isAuthenticated'](),controller[_0x5ab2('0xf')]);router[_0x5ab2('0x8')](_0x5ab2('0x10'),auth[_0x5ab2('0x9')](),controller[_0x5ab2('0x11')]);router[_0x5ab2('0x12')]('/',auth[_0x5ab2('0x9')](),controller['create']);router[_0x5ab2('0x13')]('/:id',auth['isAuthenticated'](),controller[_0x5ab2('0x14')]);router[_0x5ab2('0x15')]('/:id',auth[_0x5ab2('0x9')](),controller[_0x5ab2('0x16')]);module[_0x5ab2('0x17')]=router; \ No newline at end of file +var _0x0465=['put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','isAuthenticated','index','/:id','show','get','/:id/preview','preview','/:id/run','run','/:id/query','query','post'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x0465,0xbb));var _0x5046=function(_0x36b493,_0x47f91d){_0x36b493=_0x36b493-0x0;var _0x147c9e=_0x0465[_0x36b493];return _0x147c9e;};'use strict';var multer=require(_0x5046('0x0'));var util=require(_0x5046('0x1'));var path=require(_0x5046('0x2'));var timeout=require(_0x5046('0x3'));var express=require(_0x5046('0x4'));var router=express['Router']();var auth=require(_0x5046('0x5'));var interaction=require(_0x5046('0x6'));var config=require(_0x5046('0x7'));var controller=require(_0x5046('0x8'));router['get']('/',auth[_0x5046('0x9')](),controller[_0x5046('0xa')]);router['get'](_0x5046('0xb'),auth[_0x5046('0x9')](),controller[_0x5046('0xc')]);router[_0x5046('0xd')](_0x5046('0xe'),auth[_0x5046('0x9')](),controller[_0x5046('0xf')]);router[_0x5046('0xd')](_0x5046('0x10'),auth['isAuthenticated'](),controller[_0x5046('0x11')]);router[_0x5046('0xd')](_0x5046('0x12'),auth[_0x5046('0x9')](),controller[_0x5046('0x13')]);router[_0x5046('0x14')]('/',auth['isAuthenticated'](),controller['create']);router[_0x5046('0x15')](_0x5046('0xb'),auth[_0x5046('0x9')](),controller[_0x5046('0x16')]);router[_0x5046('0x17')](_0x5046('0xb'),auth[_0x5046('0x9')](),controller[_0x5046('0x18')]);module[_0x5046('0x19')]=router; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js index 557863c..ce5272b 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 _0x4031=['UNSIGNED','sequelize','moment','exports','STRING','ENUM','csv','pdf','xlsx','DATE','Loading','manual','INTEGER'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x4031,0x11f));var _0x1403=function(_0x47c70e,_0x3286c5){_0x47c70e=_0x47c70e-0x0;var _0x32d390=_0x4031[_0x47c70e];return _0x32d390;};'use strict';var Sequelize=require(_0x1403('0x0'));var moment=require(_0x1403('0x1'));module[_0x1403('0x2')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'basename':{'type':Sequelize[_0x1403('0x3')],'allowNull':![]},'output':{'type':Sequelize[_0x1403('0x4')](_0x1403('0x5'),_0x1403('0x6'),_0x1403('0x7')),'allowNull':![],'defaultValue':_0x1403('0x5')},'savename':{'type':Sequelize[_0x1403('0x3')],'allowNull':![]},'startDate':{'type':Sequelize[_0x1403('0x8')]},'endDate':{'type':Sequelize[_0x1403('0x8')]},'status':{'type':Sequelize[_0x1403('0x3')],'defaultValue':_0x1403('0x9')},'type':{'type':Sequelize[_0x1403('0x4')](_0x1403('0xa'),'scheduled'),'allowNull':![],'defaultValue':'manual'},'reportId':{'type':Sequelize[_0x1403('0xb')](0xb)[_0x1403('0xc')]},'reportType':{'type':Sequelize[_0x1403('0x3')]}}; \ No newline at end of file +var _0xde38=['DATE','Loading','manual','scheduled','INTEGER','UNSIGNED','sequelize','moment','exports','STRING','ENUM','pdf','xlsx','csv'];(function(_0x32f7d7,_0x54231b){var _0x133d09=function(_0x41a7ab){while(--_0x41a7ab){_0x32f7d7['push'](_0x32f7d7['shift']());}};_0x133d09(++_0x54231b);}(_0xde38,0x13a));var _0x8de3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xde38[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x8de3('0x0'));var moment=require(_0x8de3('0x1'));module[_0x8de3('0x2')]={'name':{'type':Sequelize[_0x8de3('0x3')],'allowNull':![]},'basename':{'type':Sequelize[_0x8de3('0x3')],'allowNull':![]},'output':{'type':Sequelize[_0x8de3('0x4')]('csv',_0x8de3('0x5'),_0x8de3('0x6')),'allowNull':![],'defaultValue':_0x8de3('0x7')},'savename':{'type':Sequelize[_0x8de3('0x3')],'allowNull':![]},'startDate':{'type':Sequelize[_0x8de3('0x8')]},'endDate':{'type':Sequelize['DATE']},'status':{'type':Sequelize[_0x8de3('0x3')],'defaultValue':_0x8de3('0x9')},'type':{'type':Sequelize[_0x8de3('0x4')](_0x8de3('0xa'),_0x8de3('0xb')),'allowNull':![],'defaultValue':_0x8de3('0xa')},'reportId':{'type':Sequelize[_0x8de3('0xc')](0xb)[_0x8de3('0xd')]},'reportType':{'type':Sequelize[_0x8de3('0x3')]}}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js index 526a6ea..c973739 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 _0xf74d=['offset','Content-Range','apply','reject','save','update','then','get','ExtractedReports','UserProfileResource','destroy','error','stack','name','send','index','AnalyticExtractedReport','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','filter','merge','map','type','field','options','count','includeAll','include','findAll','rows','show','params','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','download','basename','savename','output','existsSync','join','root','Sequelize','Report\x20not\x20found\x20or\x20empty','exists','server/files/reports','format','%s.%s','toLowerCase','html-pdf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json'];(function(_0x56aa10,_0x4ed9ad){var _0x55c260=function(_0x4e9266){while(--_0x4e9266){_0x56aa10['push'](_0x56aa10['shift']());}};_0x55c260(++_0x4ed9ad);}(_0xf74d,0x168));var _0xdf74=function(_0x39aea9,_0x4abe65){_0x39aea9=_0x39aea9-0x0;var _0x28e90e=_0xf74d[_0x39aea9];return _0x28e90e;};'use strict';var pdf=require(_0xdf74('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xdf74('0x1'));var jsonpatch=require(_0xdf74('0x2'));var rp=require(_0xdf74('0x3'));var moment=require(_0xdf74('0x4'));var BPromise=require(_0xdf74('0x5'));var Mustache=require(_0xdf74('0x6'));var util=require('util');var path=require(_0xdf74('0x7'));var sox=require(_0xdf74('0x8'));var csv=require(_0xdf74('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0xdf74('0xa'));var crypto=require(_0xdf74('0xb'));var jsforce=require(_0xdf74('0xc'));var deskjs=require(_0xdf74('0xd'));var toCsv=require('to-csv');var querystring=require(_0xdf74('0xe'));var Papa=require(_0xdf74('0xf'));var Redis=require(_0xdf74('0x10'));var authService=require(_0xdf74('0x11'));var qs=require(_0xdf74('0x12'));var as=require(_0xdf74('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xdf74('0x14'))(_0xdf74('0x15'));var utils=require('../../config/utils');var config=require(_0xdf74('0x16'));var db=require(_0xdf74('0x17'))['db'];function respondWithStatusCode(_0x4bd947,_0x556cbc){_0x556cbc=_0x556cbc||0xcc;return function(_0x4880ff){if(_0x4880ff){return _0x4bd947[_0xdf74('0x18')](_0x556cbc);}return _0x4bd947[_0xdf74('0x19')](_0x556cbc)[_0xdf74('0x1a')]();};}function respondWithResult(_0x4813a8,_0x184da5){_0x184da5=_0x184da5||0xc8;return function(_0x560fa7){if(_0x560fa7){return _0x4813a8[_0xdf74('0x19')](_0x184da5)[_0xdf74('0x1b')](_0x560fa7);}};}function respondWithFilteredResult(_0x405153,_0x240fef){return function(_0x33f826){if(_0x33f826){var _0x5bddf2=_0x33f826['count'],_0x2a31cf=_0x240fef[_0xdf74('0x1c')],_0x511dcf=_0x240fef[_0xdf74('0x1c')]+_0x240fef['limit'],_0xd37575;if(_0x511dcf>=_0x5bddf2){_0x511dcf=_0x5bddf2;_0xd37575=0xc8;}else{_0xd37575=0xce;}_0x405153[_0xdf74('0x19')](_0xd37575);return _0x405153['set'](_0xdf74('0x1d'),_0x2a31cf+'-'+_0x511dcf+'/'+_0x5bddf2)[_0xdf74('0x1b')](_0x33f826);}return null;};}function patchUpdates(_0x27c376){return function(_0x375252){try{jsonpatch[_0xdf74('0x1e')](_0x375252,_0x27c376,!![]);}catch(_0x30f2f4){return BPromise[_0xdf74('0x1f')](_0x30f2f4);}return _0x375252[_0xdf74('0x20')]();};}function saveUpdates(_0x5734f1,_0xe5783c){return function(_0x5a3d68){if(_0x5a3d68){return _0x5a3d68[_0xdf74('0x21')](_0x5734f1)[_0xdf74('0x22')](function(_0x45fde0){return _0x45fde0;});}return null;};}function removeEntity(_0x361d08,_0x5b10dd){return function(_0x13db6c){if(_0x13db6c){return _0x13db6c['destroy']()['then'](function(){var _0x4a1321=_0x13db6c[_0xdf74('0x23')]({'plain':!![]});var _0x4fe153=_0xdf74('0x24');return db[_0xdf74('0x25')][_0xdf74('0x26')]({'where':{'type':_0x4fe153,'resourceId':_0x4a1321['id']}})[_0xdf74('0x22')](function(){return _0x13db6c;});})['then'](function(){_0x361d08['status'](0xcc)[_0xdf74('0x1a')]();});}};}function handleEntityNotFound(_0x17cfab,_0x1fe550){return function(_0x30afd4){if(!_0x30afd4){_0x17cfab[_0xdf74('0x18')](0x194);}return _0x30afd4;};}function handleError(_0x41adc6,_0x5b90ed){_0x5b90ed=_0x5b90ed||0x1f4;return function(_0xc56d41){logger[_0xdf74('0x27')](_0xc56d41[_0xdf74('0x28')]);if(_0xc56d41[_0xdf74('0x29')]){delete _0xc56d41[_0xdf74('0x29')];}_0x41adc6[_0xdf74('0x19')](_0x5b90ed)[_0xdf74('0x2a')](_0xc56d41);};}exports[_0xdf74('0x2b')]=function(_0x50d1c7,_0x3a9cbe){var _0x697a8d={},_0x4deec7={},_0x167e5b={'count':0x0,'rows':[]};var _0x43fe02=db[_0xdf74('0x2c')]['rawAttributes'];_0x4deec7[_0xdf74('0x2d')]=_['keys'](_0x43fe02);_0x4deec7[_0xdf74('0x2e')]=_[_0xdf74('0x2f')](_0x50d1c7[_0xdf74('0x2e')]);_0x4deec7['filters']=_['intersection'](_0x4deec7['model'],_0x4deec7[_0xdf74('0x2e')]);_0x697a8d['attributes']=_[_0xdf74('0x30')](_0x4deec7['model'],qs[_0xdf74('0x31')](_0x50d1c7[_0xdf74('0x2e')]['fields']));_0x697a8d[_0xdf74('0x32')]=_0x697a8d[_0xdf74('0x32')][_0xdf74('0x33')]?_0x697a8d[_0xdf74('0x32')]:_0x4deec7['model'];if(!_0x50d1c7['query'][_0xdf74('0x34')](_0xdf74('0x35'))){_0x697a8d[_0xdf74('0x36')]=qs[_0xdf74('0x36')](_0x50d1c7[_0xdf74('0x2e')][_0xdf74('0x36')]);_0x697a8d[_0xdf74('0x1c')]=qs[_0xdf74('0x1c')](_0x50d1c7[_0xdf74('0x2e')][_0xdf74('0x1c')]);}_0x697a8d[_0xdf74('0x37')]=qs[_0xdf74('0x38')](_0x50d1c7[_0xdf74('0x2e')]['sort']);_0x697a8d[_0xdf74('0x39')]=qs[_0xdf74('0x3a')](_['pick'](_0x50d1c7['query'],_0x4deec7['filters']));if(_0x50d1c7[_0xdf74('0x2e')][_0xdf74('0x3b')]){_0x697a8d['where']=_[_0xdf74('0x3c')](_0x697a8d[_0xdf74('0x39')],{'$or':_[_0xdf74('0x3d')](_0x43fe02,function(_0x14abc7){if(_0x14abc7[_0xdf74('0x3e')]['key']!=='VIRTUAL'){var _0xea808e={};_0xea808e[_0x14abc7[_0xdf74('0x3f')]]={'$like':'%'+_0x50d1c7[_0xdf74('0x2e')][_0xdf74('0x3b')]+'%'};return _0xea808e;}})});}_0x697a8d=_[_0xdf74('0x3c')]({},_0x697a8d,_0x50d1c7[_0xdf74('0x40')]);var _0x28b6a1={'where':_0x697a8d[_0xdf74('0x39')]};return db['AnalyticExtractedReport'][_0xdf74('0x41')](_0x28b6a1)[_0xdf74('0x22')](function(_0x45c787){_0x167e5b['count']=_0x45c787;if(_0x50d1c7[_0xdf74('0x2e')][_0xdf74('0x42')]){_0x697a8d[_0xdf74('0x43')]=[{'all':!![]}];}return db[_0xdf74('0x2c')][_0xdf74('0x44')](_0x697a8d);})['then'](function(_0xcb290b){_0x167e5b[_0xdf74('0x45')]=_0xcb290b;return _0x167e5b;})[_0xdf74('0x22')](respondWithFilteredResult(_0x3a9cbe,_0x697a8d))['catch'](handleError(_0x3a9cbe,null));};exports[_0xdf74('0x46')]=function(_0x11bcdc,_0x4b898a){var _0x54f799={'raw':!![],'where':{'id':_0x11bcdc[_0xdf74('0x47')]['id']}},_0x1205a1={};_0x1205a1[_0xdf74('0x2d')]=_[_0xdf74('0x2f')](db['AnalyticExtractedReport']['rawAttributes']);_0x1205a1[_0xdf74('0x2e')]=_[_0xdf74('0x2f')](_0x11bcdc[_0xdf74('0x2e')]);_0x1205a1[_0xdf74('0x3a')]=_[_0xdf74('0x30')](_0x1205a1['model'],_0x1205a1[_0xdf74('0x2e')]);_0x54f799[_0xdf74('0x32')]=_['intersection'](_0x1205a1['model'],qs['fields'](_0x11bcdc[_0xdf74('0x2e')][_0xdf74('0x31')]));_0x54f799['attributes']=_0x54f799[_0xdf74('0x32')][_0xdf74('0x33')]?_0x54f799[_0xdf74('0x32')]:_0x1205a1[_0xdf74('0x2d')];if(_0x11bcdc['query'][_0xdf74('0x42')]){_0x54f799[_0xdf74('0x43')]=[{'all':!![]}];}_0x54f799=_['merge']({},_0x54f799,_0x11bcdc[_0xdf74('0x40')]);return db[_0xdf74('0x2c')][_0xdf74('0x48')](_0x54f799)[_0xdf74('0x22')](handleEntityNotFound(_0x4b898a,null))[_0xdf74('0x22')](respondWithResult(_0x4b898a,null))[_0xdf74('0x49')](handleError(_0x4b898a,null));};exports['create']=function(_0x44b137,_0x3e90d4){return db[_0xdf74('0x2c')][_0xdf74('0x4a')](_0x44b137['body'],{})['then'](function(_0x2d7f58){var _0x2d2074=_0x44b137[_0xdf74('0x4b')]['get']({'plain':!![]});if(!_0x2d2074)throw new Error(_0xdf74('0x4c'));if(_0x2d2074[_0xdf74('0x4d')]===_0xdf74('0x4b')){var _0x31f67d=_0x2d7f58[_0xdf74('0x23')]({'plain':!![]});var _0x241c11=_0xdf74('0x24');return db[_0xdf74('0x4e')]['find']({'where':{'name':_0x241c11,'userProfileId':_0x2d2074[_0xdf74('0x4f')]},'raw':!![]})[_0xdf74('0x22')](function(_0x30edd9){if(_0x30edd9&&_0x30edd9[_0xdf74('0x50')]===0x0){return db['UserProfileResource'][_0xdf74('0x4a')]({'name':_0x31f67d[_0xdf74('0x29')],'resourceId':_0x31f67d['id'],'type':_0x30edd9[_0xdf74('0x29')],'sectionId':_0x30edd9['id']},{})[_0xdf74('0x22')](function(){return _0x2d7f58;});}else{return _0x2d7f58;}})[_0xdf74('0x49')](function(_0x367ead){logger[_0xdf74('0x27')](_0xdf74('0x51'),_0x367ead);throw _0x367ead;});}return _0x2d7f58;})['then'](respondWithResult(_0x3e90d4,0xc9))[_0xdf74('0x49')](handleError(_0x3e90d4,null));};exports['update']=function(_0x1c7746,_0x14f798){if(_0x1c7746[_0xdf74('0x52')]['id']){delete _0x1c7746[_0xdf74('0x52')]['id'];}return db[_0xdf74('0x2c')][_0xdf74('0x48')]({'where':{'id':_0x1c7746[_0xdf74('0x47')]['id']}})[_0xdf74('0x22')](handleEntityNotFound(_0x14f798,null))[_0xdf74('0x22')](saveUpdates(_0x1c7746['body'],null))[_0xdf74('0x22')](respondWithResult(_0x14f798,null))[_0xdf74('0x49')](handleError(_0x14f798,null));};exports['destroy']=function(_0x5a94a8,_0x34a044){return db[_0xdf74('0x2c')][_0xdf74('0x48')]({'where':{'id':_0x5a94a8[_0xdf74('0x47')]['id']}})[_0xdf74('0x22')](handleEntityNotFound(_0x34a044,null))[_0xdf74('0x22')](removeEntity(_0x34a044,null))['catch'](handleError(_0x34a044,null));};exports[_0xdf74('0x53')]=function(_0x2dd34c,_0x5ac332,_0x528d06){return db[_0xdf74('0x2c')]['find']({'where':{'id':_0x2dd34c[_0xdf74('0x47')]['id']},'attributes':[_0xdf74('0x29'),_0xdf74('0x54'),_0xdf74('0x55'),_0xdf74('0x56')],'raw':!![]})['then'](handleEntityNotFound(_0x5ac332,null))[_0xdf74('0x22')](function(_0x1e3e42){if(_0x1e3e42){if(!fs[_0xdf74('0x57')](path[_0xdf74('0x58')](config[_0xdf74('0x59')],'server/files/reports',_0x1e3e42[_0xdf74('0x55')]))){throw new db[(_0xdf74('0x5a'))]['ValidationError'](_0xdf74('0x5b'));}if(_0x2dd34c[_0xdf74('0x2e')][_0xdf74('0x5c')]){return _0x5ac332['sendStatus'](0xc8);}return _0x5ac332['download'](path['join'](config[_0xdf74('0x59')],_0xdf74('0x5d'),_0x1e3e42['savename']),util[_0xdf74('0x5e')](_0xdf74('0x5f'),_0x1e3e42[_0xdf74('0x54')]||_0x1e3e42['name'],_0x1e3e42[_0xdf74('0x56')][_0xdf74('0x60')]()));}})[_0xdf74('0x49')](handleError(_0x5ac332,null));}; \ No newline at end of file +var _0x8cfc=['body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','params','basename','output','existsSync','join','server/files/reports','savename','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','download','root','format','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','reject','update','then','destroy','ExtractedReports','UserProfileResource','error','stack','name','send','index','AnalyticExtractedReport','rawAttributes','keys','query','attributes','intersection','model','fields','length','hasOwnProperty','nolimit','where','pick','filters','filter','merge','map','type','VIRTUAL','field','include','findAll','catch','show','includeAll','find','create'];(function(_0x3b5d58,_0xe4b936){var _0x1613a4=function(_0x5b8d78){while(--_0x5b8d78){_0x3b5d58['push'](_0x3b5d58['shift']());}};_0x1613a4(++_0xe4b936);}(_0x8cfc,0x6f));var _0xc8cf=function(_0x925c71,_0x1023b3){_0x925c71=_0x925c71-0x0;var _0x103e9b=_0x8cfc[_0x925c71];return _0x103e9b;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xc8cf('0x0'));var rimraf=require(_0xc8cf('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc8cf('0x2'));var rp=require(_0xc8cf('0x3'));var moment=require('moment');var BPromise=require(_0xc8cf('0x4'));var Mustache=require(_0xc8cf('0x5'));var util=require(_0xc8cf('0x6'));var path=require('path');var sox=require(_0xc8cf('0x7'));var csv=require(_0xc8cf('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xc8cf('0x9'));var squel=require(_0xc8cf('0xa'));var crypto=require(_0xc8cf('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xc8cf('0x8'));var querystring=require(_0xc8cf('0xc'));var Papa=require(_0xc8cf('0xd'));var Redis=require(_0xc8cf('0xe'));var authService=require(_0xc8cf('0xf'));var qs=require(_0xc8cf('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc8cf('0x11'));var logger=require(_0xc8cf('0x12'))(_0xc8cf('0x13'));var utils=require(_0xc8cf('0x14'));var config=require('../../config/environment');var db=require(_0xc8cf('0x15'))['db'];function respondWithStatusCode(_0x3bc437,_0x1ef4be){_0x1ef4be=_0x1ef4be||0xcc;return function(_0x4e3b8f){if(_0x4e3b8f){return _0x3bc437[_0xc8cf('0x16')](_0x1ef4be);}return _0x3bc437[_0xc8cf('0x17')](_0x1ef4be)[_0xc8cf('0x18')]();};}function respondWithResult(_0x32fa25,_0x51cb10){_0x51cb10=_0x51cb10||0xc8;return function(_0x26eddf){if(_0x26eddf){return _0x32fa25['status'](_0x51cb10)[_0xc8cf('0x19')](_0x26eddf);}};}function respondWithFilteredResult(_0xa11256,_0x331c09){return function(_0x5c2c17){if(_0x5c2c17){var _0x3b61db=_0x5c2c17[_0xc8cf('0x1a')],_0x554c74=_0x331c09[_0xc8cf('0x1b')],_0x1585e9=_0x331c09[_0xc8cf('0x1b')]+_0x331c09[_0xc8cf('0x1c')],_0x3db77a;if(_0x1585e9>=_0x3b61db){_0x1585e9=_0x3b61db;_0x3db77a=0xc8;}else{_0x3db77a=0xce;}_0xa11256[_0xc8cf('0x17')](_0x3db77a);return _0xa11256[_0xc8cf('0x1d')](_0xc8cf('0x1e'),_0x554c74+'-'+_0x1585e9+'/'+_0x3b61db)[_0xc8cf('0x19')](_0x5c2c17);}return null;};}function patchUpdates(_0x335a88){return function(_0x27fab9){try{jsonpatch['apply'](_0x27fab9,_0x335a88,!![]);}catch(_0x555903){return BPromise[_0xc8cf('0x1f')](_0x555903);}return _0x27fab9['save']();};}function saveUpdates(_0x58296a,_0x3b8c2e){return function(_0x5916d2){if(_0x5916d2){return _0x5916d2[_0xc8cf('0x20')](_0x58296a)[_0xc8cf('0x21')](function(_0x24853f){return _0x24853f;});}return null;};}function removeEntity(_0x4bd3c4,_0x3b8bb0){return function(_0xad7d92){if(_0xad7d92){return _0xad7d92[_0xc8cf('0x22')]()[_0xc8cf('0x21')](function(){var _0xa9c5c3=_0xad7d92['get']({'plain':!![]});var _0xf4fc32=_0xc8cf('0x23');return db[_0xc8cf('0x24')][_0xc8cf('0x22')]({'where':{'type':_0xf4fc32,'resourceId':_0xa9c5c3['id']}})[_0xc8cf('0x21')](function(){return _0xad7d92;});})[_0xc8cf('0x21')](function(){_0x4bd3c4[_0xc8cf('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2643ab,_0x4b7613){return function(_0x746ee7){if(!_0x746ee7){_0x2643ab[_0xc8cf('0x16')](0x194);}return _0x746ee7;};}function handleError(_0x6977dd,_0x4cfc31){_0x4cfc31=_0x4cfc31||0x1f4;return function(_0xacc5f){logger[_0xc8cf('0x25')](_0xacc5f[_0xc8cf('0x26')]);if(_0xacc5f[_0xc8cf('0x27')]){delete _0xacc5f[_0xc8cf('0x27')];}_0x6977dd[_0xc8cf('0x17')](_0x4cfc31)[_0xc8cf('0x28')](_0xacc5f);};}exports[_0xc8cf('0x29')]=function(_0x1a6686,_0x5d12eb){var _0x3f04f8={},_0x26dc65={},_0x2e5599={'count':0x0,'rows':[]};var _0x341bde=db[_0xc8cf('0x2a')][_0xc8cf('0x2b')];_0x26dc65['model']=_[_0xc8cf('0x2c')](_0x341bde);_0x26dc65['query']=_[_0xc8cf('0x2c')](_0x1a6686[_0xc8cf('0x2d')]);_0x26dc65['filters']=_['intersection'](_0x26dc65['model'],_0x26dc65[_0xc8cf('0x2d')]);_0x3f04f8[_0xc8cf('0x2e')]=_[_0xc8cf('0x2f')](_0x26dc65[_0xc8cf('0x30')],qs[_0xc8cf('0x31')](_0x1a6686[_0xc8cf('0x2d')][_0xc8cf('0x31')]));_0x3f04f8['attributes']=_0x3f04f8[_0xc8cf('0x2e')][_0xc8cf('0x32')]?_0x3f04f8['attributes']:_0x26dc65[_0xc8cf('0x30')];if(!_0x1a6686[_0xc8cf('0x2d')][_0xc8cf('0x33')](_0xc8cf('0x34'))){_0x3f04f8[_0xc8cf('0x1c')]=qs[_0xc8cf('0x1c')](_0x1a6686[_0xc8cf('0x2d')]['limit']);_0x3f04f8[_0xc8cf('0x1b')]=qs['offset'](_0x1a6686[_0xc8cf('0x2d')][_0xc8cf('0x1b')]);}_0x3f04f8['order']=qs['sort'](_0x1a6686[_0xc8cf('0x2d')]['sort']);_0x3f04f8[_0xc8cf('0x35')]=qs['filters'](_[_0xc8cf('0x36')](_0x1a6686['query'],_0x26dc65[_0xc8cf('0x37')]));if(_0x1a6686[_0xc8cf('0x2d')][_0xc8cf('0x38')]){_0x3f04f8['where']=_[_0xc8cf('0x39')](_0x3f04f8[_0xc8cf('0x35')],{'$or':_[_0xc8cf('0x3a')](_0x341bde,function(_0x3fe6ff){if(_0x3fe6ff[_0xc8cf('0x3b')]['key']!==_0xc8cf('0x3c')){var _0x36c6d4={};_0x36c6d4[_0x3fe6ff[_0xc8cf('0x3d')]]={'$like':'%'+_0x1a6686['query']['filter']+'%'};return _0x36c6d4;}})});}_0x3f04f8=_['merge']({},_0x3f04f8,_0x1a6686['options']);var _0x13d3cf={'where':_0x3f04f8[_0xc8cf('0x35')]};return db[_0xc8cf('0x2a')][_0xc8cf('0x1a')](_0x13d3cf)[_0xc8cf('0x21')](function(_0x3c48c1){_0x2e5599['count']=_0x3c48c1;if(_0x1a6686['query']['includeAll']){_0x3f04f8[_0xc8cf('0x3e')]=[{'all':!![]}];}return db[_0xc8cf('0x2a')][_0xc8cf('0x3f')](_0x3f04f8);})['then'](function(_0x2791fc){_0x2e5599['rows']=_0x2791fc;return _0x2e5599;})['then'](respondWithFilteredResult(_0x5d12eb,_0x3f04f8))[_0xc8cf('0x40')](handleError(_0x5d12eb,null));};exports[_0xc8cf('0x41')]=function(_0x1665fd,_0x5a9eb8){var _0x1ad4f5={'raw':!![],'where':{'id':_0x1665fd['params']['id']}},_0x2acec7={};_0x2acec7[_0xc8cf('0x30')]=_[_0xc8cf('0x2c')](db[_0xc8cf('0x2a')][_0xc8cf('0x2b')]);_0x2acec7[_0xc8cf('0x2d')]=_['keys'](_0x1665fd[_0xc8cf('0x2d')]);_0x2acec7[_0xc8cf('0x37')]=_[_0xc8cf('0x2f')](_0x2acec7[_0xc8cf('0x30')],_0x2acec7['query']);_0x1ad4f5['attributes']=_[_0xc8cf('0x2f')](_0x2acec7[_0xc8cf('0x30')],qs[_0xc8cf('0x31')](_0x1665fd[_0xc8cf('0x2d')]['fields']));_0x1ad4f5[_0xc8cf('0x2e')]=_0x1ad4f5[_0xc8cf('0x2e')][_0xc8cf('0x32')]?_0x1ad4f5[_0xc8cf('0x2e')]:_0x2acec7[_0xc8cf('0x30')];if(_0x1665fd[_0xc8cf('0x2d')][_0xc8cf('0x42')]){_0x1ad4f5[_0xc8cf('0x3e')]=[{'all':!![]}];}_0x1ad4f5=_['merge']({},_0x1ad4f5,_0x1665fd['options']);return db[_0xc8cf('0x2a')][_0xc8cf('0x43')](_0x1ad4f5)[_0xc8cf('0x21')](handleEntityNotFound(_0x5a9eb8,null))[_0xc8cf('0x21')](respondWithResult(_0x5a9eb8,null))[_0xc8cf('0x40')](handleError(_0x5a9eb8,null));};exports[_0xc8cf('0x44')]=function(_0x2b9172,_0x528379){return db['AnalyticExtractedReport']['create'](_0x2b9172[_0xc8cf('0x45')],{})[_0xc8cf('0x21')](function(_0x11ef83){var _0x4c8475=_0x2b9172[_0xc8cf('0x46')][_0xc8cf('0x47')]({'plain':!![]});if(!_0x4c8475)throw new Error(_0xc8cf('0x48'));if(_0x4c8475['role']===_0xc8cf('0x46')){var _0x54dae8=_0x11ef83[_0xc8cf('0x47')]({'plain':!![]});var _0x79b953=_0xc8cf('0x23');return db[_0xc8cf('0x49')][_0xc8cf('0x43')]({'where':{'name':_0x79b953,'userProfileId':_0x4c8475[_0xc8cf('0x4a')]},'raw':!![]})[_0xc8cf('0x21')](function(_0x2228a3){if(_0x2228a3&&_0x2228a3[_0xc8cf('0x4b')]===0x0){return db[_0xc8cf('0x24')][_0xc8cf('0x44')]({'name':_0x54dae8['name'],'resourceId':_0x54dae8['id'],'type':_0x2228a3[_0xc8cf('0x27')],'sectionId':_0x2228a3['id']},{})[_0xc8cf('0x21')](function(){return _0x11ef83;});}else{return _0x11ef83;}})[_0xc8cf('0x40')](function(_0x33c7e2){logger[_0xc8cf('0x25')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x33c7e2);throw _0x33c7e2;});}return _0x11ef83;})[_0xc8cf('0x21')](respondWithResult(_0x528379,0xc9))[_0xc8cf('0x40')](handleError(_0x528379,null));};exports[_0xc8cf('0x20')]=function(_0x26fe22,_0x110f23){if(_0x26fe22[_0xc8cf('0x45')]['id']){delete _0x26fe22['body']['id'];}return db[_0xc8cf('0x2a')][_0xc8cf('0x43')]({'where':{'id':_0x26fe22[_0xc8cf('0x4c')]['id']}})[_0xc8cf('0x21')](handleEntityNotFound(_0x110f23,null))[_0xc8cf('0x21')](saveUpdates(_0x26fe22['body'],null))[_0xc8cf('0x21')](respondWithResult(_0x110f23,null))['catch'](handleError(_0x110f23,null));};exports[_0xc8cf('0x22')]=function(_0x1ba443,_0x2e391b){return db[_0xc8cf('0x2a')][_0xc8cf('0x43')]({'where':{'id':_0x1ba443[_0xc8cf('0x4c')]['id']}})[_0xc8cf('0x21')](handleEntityNotFound(_0x2e391b,null))[_0xc8cf('0x21')](removeEntity(_0x2e391b,null))[_0xc8cf('0x40')](handleError(_0x2e391b,null));};exports['download']=function(_0x1ac9f2,_0x3bc4d7,_0x105577){return db[_0xc8cf('0x2a')][_0xc8cf('0x43')]({'where':{'id':_0x1ac9f2['params']['id']},'attributes':[_0xc8cf('0x27'),_0xc8cf('0x4d'),'savename',_0xc8cf('0x4e')],'raw':!![]})[_0xc8cf('0x21')](handleEntityNotFound(_0x3bc4d7,null))[_0xc8cf('0x21')](function(_0x33859f){if(_0x33859f){if(!fs[_0xc8cf('0x4f')](path[_0xc8cf('0x50')](config['root'],_0xc8cf('0x51'),_0x33859f[_0xc8cf('0x52')]))){throw new db[(_0xc8cf('0x53'))][(_0xc8cf('0x54'))](_0xc8cf('0x55'));}if(_0x1ac9f2[_0xc8cf('0x2d')][_0xc8cf('0x56')]){return _0x3bc4d7[_0xc8cf('0x16')](0xc8);}return _0x3bc4d7[_0xc8cf('0x57')](path[_0xc8cf('0x50')](config[_0xc8cf('0x58')],_0xc8cf('0x51'),_0x33859f[_0xc8cf('0x52')]),util[_0xc8cf('0x59')]('%s.%s',_0x33859f['basename']||_0x33859f['name'],_0x33859f[_0xc8cf('0x4e')]['toLowerCase']()));}})[_0xc8cf('0x40')](handleError(_0x3bc4d7,null));}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js index b0cb36b..6c09a80 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 _0xacea=['bluebird','request-promise','path','rimraf','exports','define','AnalyticExtractedReport','analytics_extracted_reports','util','../../config/logger','api'];(function(_0x455a49,_0x441ef7){var _0x2c1e7a=function(_0x3e4d77){while(--_0x3e4d77){_0x455a49['push'](_0x455a49['shift']());}};_0x2c1e7a(++_0x441ef7);}(_0xacea,0x1aa));var _0xaace=function(_0x111b3a,_0x3da8ca){_0x111b3a=_0x111b3a-0x0;var _0x84738=_0xacea[_0x111b3a];return _0x84738;};'use strict';var _=require('lodash');var util=require(_0xaace('0x0'));var logger=require(_0xaace('0x1'))(_0xaace('0x2'));var moment=require('moment');var BPromise=require(_0xaace('0x3'));var rp=require(_0xaace('0x4'));var fs=require('fs');var path=require(_0xaace('0x5'));var rimraf=require(_0xaace('0x6'));var config=require('../../config/environment');var attributes=require('./analyticExtractedReport.attributes');module[_0xaace('0x7')]=function(_0x4fc429,_0x376e41){return _0x4fc429[_0xaace('0x8')](_0xaace('0x9'),attributes,{'tableName':_0xaace('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe9bb=['moment','bluebird','request-promise','../../config/environment','./analyticExtractedReport.attributes','exports','AnalyticExtractedReport','analytics_extracted_reports','lodash','util','../../config/logger','api'];(function(_0xe92ee7,_0x4673be){var _0x391438=function(_0x8e6352){while(--_0x8e6352){_0xe92ee7['push'](_0xe92ee7['shift']());}};_0x391438(++_0x4673be);}(_0xe9bb,0xe0));var _0xbe9b=function(_0x50352a,_0x3cf37e){_0x50352a=_0x50352a-0x0;var _0x4e1204=_0xe9bb[_0x50352a];return _0x4e1204;};'use strict';var _=require(_0xbe9b('0x0'));var util=require(_0xbe9b('0x1'));var logger=require(_0xbe9b('0x2'))(_0xbe9b('0x3'));var moment=require(_0xbe9b('0x4'));var BPromise=require(_0xbe9b('0x5'));var rp=require(_0xbe9b('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xbe9b('0x7'));var attributes=require(_0xbe9b('0x8'));module[_0xbe9b('0x9')]=function(_0x4b6166,_0x3c1caa){return _0x4b6166['define'](_0xbe9b('0xa'),attributes,{'tableName':_0xbe9b('0xb'),'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 53db8a3..daa24d1 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 _0x614f=['error','code','message','AnalyticExtractedReport,\x20%s,\x20%s','result','lodash','util','moment','randomstring','ioredis','../../config/utils','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify'];(function(_0x439585,_0x2c35f9){var _0x58a8b4=function(_0x1b9b1c){while(--_0x1b9b1c){_0x439585['push'](_0x439585['shift']());}};_0x58a8b4(++_0x2c35f9);}(_0x614f,0xe1));var _0xf614=function(_0x551d78,_0x268406){_0x551d78=_0x551d78-0x0;var _0xeff191=_0x614f[_0x551d78];return _0xeff191;};'use strict';var _=require(_0xf614('0x0'));var util=require(_0xf614('0x1'));var moment=require(_0xf614('0x2'));var BPromise=require('bluebird');var rs=require(_0xf614('0x3'));var fs=require('fs');var Redis=require(_0xf614('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xf614('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xf614('0x6'));var client=jayson[_0xf614('0x7')][_0xf614('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x163439,_0x327ff4,_0x5ef85f){return new BPromise(function(_0xc64bbd,_0x16484c){return client[_0xf614('0x9')](_0x163439,_0x5ef85f)[_0xf614('0xa')](function(_0x30592a){logger[_0xf614('0xb')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x327ff4,_0xf614('0xc'));logger[_0xf614('0xd')]('AnalyticExtractedReport,\x20%s,\x20%s,\x20%s',_0x327ff4,_0xf614('0xc'),JSON[_0xf614('0xe')](_0x30592a));if(_0x30592a[_0xf614('0xf')]){if(_0x30592a[_0xf614('0xf')][_0xf614('0x10')]===0x1f4){logger['error']('AnalyticExtractedReport,\x20%s,\x20%s',_0x327ff4,_0x30592a['error'][_0xf614('0x11')]);return _0x16484c(_0x30592a[_0xf614('0xf')]['message']);}logger[_0xf614('0xf')](_0xf614('0x12'),_0x327ff4,_0x30592a[_0xf614('0xf')][_0xf614('0x11')]);return _0xc64bbd(_0x30592a[_0xf614('0xf')]['message']);}else{logger[_0xf614('0xb')](_0xf614('0x12'),_0x327ff4,'request\x20sent');_0xc64bbd(_0x30592a[_0xf614('0x13')][_0xf614('0x11')]);}})['catch'](function(_0x4eb990){logger[_0xf614('0xf')](_0xf614('0x12'),_0x327ff4,_0x4eb990);_0x16484c(_0x4eb990);});});} \ No newline at end of file +var _0x7801=['catch','lodash','util','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x585ee5,_0x1c9dba){var _0x470808=function(_0x35c90d){while(--_0x35c90d){_0x585ee5['push'](_0x585ee5['shift']());}};_0x470808(++_0x1c9dba);}(_0x7801,0x8d));var _0x1780=function(_0xaa1b3e,_0x47d976){_0xaa1b3e=_0xaa1b3e-0x0;var _0x454d7d=_0x7801[_0xaa1b3e];return _0x454d7d;};'use strict';var _=require(_0x1780('0x0'));var util=require(_0x1780('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x1780('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1780('0x3'))['db'];var utils=require(_0x1780('0x4'));var logger=require(_0x1780('0x5'))(_0x1780('0x6'));var config=require('../../config/environment');var jayson=require(_0x1780('0x7'));var client=jayson[_0x1780('0x8')][_0x1780('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x40409f,_0x47fab3,_0x33cc2a){return new BPromise(function(_0x1d236c,_0x8753c6){return client[_0x1780('0xa')](_0x40409f,_0x33cc2a)[_0x1780('0xb')](function(_0x27db22){logger['info'](_0x1780('0xc'),_0x47fab3,_0x1780('0xd'));logger[_0x1780('0xe')](_0x1780('0xf'),_0x47fab3,_0x1780('0xd'),JSON['stringify'](_0x27db22));if(_0x27db22['error']){if(_0x27db22[_0x1780('0x10')][_0x1780('0x11')]===0x1f4){logger['error'](_0x1780('0xc'),_0x47fab3,_0x27db22['error']['message']);return _0x8753c6(_0x27db22[_0x1780('0x10')][_0x1780('0x12')]);}logger[_0x1780('0x10')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x47fab3,_0x27db22[_0x1780('0x10')]['message']);return _0x1d236c(_0x27db22[_0x1780('0x10')][_0x1780('0x12')]);}else{logger['info'](_0x1780('0xc'),_0x47fab3,_0x1780('0xd'));_0x1d236c(_0x27db22['result']['message']);}})[_0x1780('0x13')](function(_0x59bf93){logger['error'](_0x1780('0xc'),_0x47fab3,_0x59bf93);_0x8753c6(_0x59bf93);});});} \ No newline at end of file diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js index 21a8a76..1a0e8d2 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 _0xe3f3=['isAuthenticated','show','/:id/download','post','create','put','/:id','delete','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','get'];(function(_0x373096,_0x4d37aa){var _0x14a6d0=function(_0xb3b614){while(--_0xb3b614){_0x373096['push'](_0x373096['shift']());}};_0x14a6d0(++_0x4d37aa);}(_0xe3f3,0xed));var _0x3e3f=function(_0x1da527,_0x2dc953){_0x1da527=_0x1da527-0x0;var _0x40fc7c=_0xe3f3[_0x1da527];return _0x40fc7c;};'use strict';var multer=require(_0x3e3f('0x0'));var util=require(_0x3e3f('0x1'));var path=require(_0x3e3f('0x2'));var timeout=require(_0x3e3f('0x3'));var express=require(_0x3e3f('0x4'));var router=express['Router']();var auth=require(_0x3e3f('0x5'));var interaction=require(_0x3e3f('0x6'));var config=require(_0x3e3f('0x7'));var controller=require(_0x3e3f('0x8'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x3e3f('0x9')]('/:id',auth[_0x3e3f('0xa')](),controller[_0x3e3f('0xb')]);router[_0x3e3f('0x9')](_0x3e3f('0xc'),auth[_0x3e3f('0xa')](),controller['download']);router[_0x3e3f('0xd')]('/',auth[_0x3e3f('0xa')](),controller[_0x3e3f('0xe')]);router[_0x3e3f('0xf')](_0x3e3f('0x10'),auth[_0x3e3f('0xa')](),controller['update']);router[_0x3e3f('0x11')](_0x3e3f('0x10'),auth['isAuthenticated'](),controller['destroy']);module[_0x3e3f('0x12')]=router; \ No newline at end of file +var _0x0897=['util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','./analyticExtractedReport.controller','get','isAuthenticated','index','/:id','/:id/download','download','post','create','update','delete','destroy','exports','multer'];(function(_0x88bd2,_0xfc6f02){var _0x3d9d26=function(_0x3349f1){while(--_0x3349f1){_0x88bd2['push'](_0x88bd2['shift']());}};_0x3d9d26(++_0xfc6f02);}(_0x0897,0x167));var _0x7089=function(_0x5bde3b,_0x4544c8){_0x5bde3b=_0x5bde3b-0x0;var _0x488dd6=_0x0897[_0x5bde3b];return _0x488dd6;};'use strict';var multer=require(_0x7089('0x0'));var util=require(_0x7089('0x1'));var path=require(_0x7089('0x2'));var timeout=require(_0x7089('0x3'));var express=require('express');var router=express[_0x7089('0x4')]();var auth=require(_0x7089('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x7089('0x6'));var controller=require(_0x7089('0x7'));router[_0x7089('0x8')]('/',auth[_0x7089('0x9')](),controller[_0x7089('0xa')]);router[_0x7089('0x8')](_0x7089('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x7089('0x8')](_0x7089('0xc'),auth[_0x7089('0x9')](),controller[_0x7089('0xd')]);router[_0x7089('0xe')]('/',auth[_0x7089('0x9')](),controller[_0x7089('0xf')]);router['put'](_0x7089('0xb'),auth[_0x7089('0x9')](),controller[_0x7089('0x10')]);router[_0x7089('0x11')](_0x7089('0xb'),auth['isAuthenticated'](),controller[_0x7089('0x12')]);module[_0x7089('0x13')]=router; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js index 84023dc..6ac41fb 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 _0x814b=['TEXT','STRING','BOOLEAN','sequelize','exports'];(function(_0x51a58c,_0x5b0474){var _0x513149=function(_0x5e374f){while(--_0x5e374f){_0x51a58c['push'](_0x51a58c['shift']());}};_0x513149(++_0x5b0474);}(_0x814b,0x1a2));var _0xb814=function(_0x3213b7,_0x6789ca){_0x3213b7=_0x3213b7-0x0;var _0xb960bf=_0x814b[_0x3213b7];return _0xb960bf;};'use strict';var Sequelize=require(_0xb814('0x0'));module[_0xb814('0x1')]={'field':{'type':Sequelize[_0xb814('0x2')]},'alias':{'type':Sequelize[_0xb814('0x3')]},'function':{'type':Sequelize[_0xb814('0x3')]},'format':{'type':Sequelize[_0xb814('0x3')]},'groupBy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'orderBy':{'type':Sequelize[_0xb814('0x3')]},'custom':{'type':Sequelize[_0xb814('0x4')],'defaultValue':![]}}; \ No newline at end of file +var _0xc4aa=['exports','TEXT','STRING','sequelize'];(function(_0x503481,_0x2c0dfc){var _0x4b8897=function(_0x3704ec){while(--_0x3704ec){_0x503481['push'](_0x503481['shift']());}};_0x4b8897(++_0x2c0dfc);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x2d2c16,_0x4e88b6){_0x2d2c16=_0x2d2c16-0x0;var _0x53f2fb=_0xc4aa[_0x2d2c16];return _0x53f2fb;};'use strict';var Sequelize=require(_0xac4a('0x0'));module[_0xac4a('0x1')]={'field':{'type':Sequelize[_0xac4a('0x2')]},'alias':{'type':Sequelize[_0xac4a('0x3')]},'function':{'type':Sequelize[_0xac4a('0x3')]},'format':{'type':Sequelize[_0xac4a('0x3')]},'groupBy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'orderBy':{'type':Sequelize['STRING']},'custom':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js index 89fef2e..f1cdecd 100644 --- a/server/api/analyticFieldReport/analyticFieldReport.controller.js +++ b/server/api/analyticFieldReport/analyticFieldReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['ejs','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../mysqldb','sendStatus','status','json','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','end','error','name','send','index','AnalyticFieldReport','rawAttributes','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','limit','order','sort','where','filters','filter','merge','map','type','key','field','options','includeAll','findAll','rows','catch','show','include','find','create','body','bulkCreate','params','ids','addFields','AnalyticCustomReport','findOne','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox'];(function(_0x2e1683,_0x10801c){var _0x3600e0=function(_0x55a63c){while(--_0x55a63c){_0x2e1683['push'](_0x2e1683['shift']());}};_0x3600e0(++_0x10801c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0xa9e0[_0x9df060];return _0x338dfe;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var as=require(_0x0a9e('0x11'));var hardwareService=require(_0x0a9e('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x0a9e('0x13'))['db'];function respondWithStatusCode(_0x36471c,_0xd5b662){_0xd5b662=_0xd5b662||0xcc;return function(_0x26d672){if(_0x26d672){return _0x36471c[_0x0a9e('0x14')](_0xd5b662);}return _0x36471c[_0x0a9e('0x15')](_0xd5b662)['end']();};}function respondWithResult(_0x4283ce,_0x239b12){_0x239b12=_0x239b12||0xc8;return function(_0x2b4227){if(_0x2b4227){return _0x4283ce[_0x0a9e('0x15')](_0x239b12)[_0x0a9e('0x16')](_0x2b4227);}};}function respondWithFilteredResult(_0x4d5611,_0x52a03d){return function(_0x22dccb){if(_0x22dccb){var _0x5d0880=_0x22dccb[_0x0a9e('0x17')],_0x1985b6=_0x52a03d['offset'],_0x519dfd=_0x52a03d[_0x0a9e('0x18')]+_0x52a03d['limit'],_0x16033c;if(_0x519dfd>=_0x5d0880){_0x519dfd=_0x5d0880;_0x16033c=0xc8;}else{_0x16033c=0xce;}_0x4d5611[_0x0a9e('0x15')](_0x16033c);return _0x4d5611[_0x0a9e('0x19')](_0x0a9e('0x1a'),_0x1985b6+'-'+_0x519dfd+'/'+_0x5d0880)[_0x0a9e('0x16')](_0x22dccb);}return null;};}function patchUpdates(_0x31b1ca){return function(_0x2eb11f){try{jsonpatch[_0x0a9e('0x1b')](_0x2eb11f,_0x31b1ca,!![]);}catch(_0x20559e){return BPromise[_0x0a9e('0x1c')](_0x20559e);}return _0x2eb11f[_0x0a9e('0x1d')]();};}function saveUpdates(_0x1c696a,_0x105080){return function(_0x4bb1e3){if(_0x4bb1e3){return _0x4bb1e3[_0x0a9e('0x1e')](_0x1c696a)[_0x0a9e('0x1f')](function(_0x53682f){return _0x53682f;});}return null;};}function removeEntity(_0x20f109,_0x5a09ef){return function(_0x588269){if(_0x588269){return _0x588269[_0x0a9e('0x20')]()[_0x0a9e('0x1f')](function(){_0x20f109[_0x0a9e('0x15')](0xcc)[_0x0a9e('0x21')]();});}};}function handleEntityNotFound(_0x4abc77,_0xfb6e48){return function(_0x2fb0e4){if(!_0x2fb0e4){_0x4abc77[_0x0a9e('0x14')](0x194);}return _0x2fb0e4;};}function handleError(_0x4d00e6,_0x370d86){_0x370d86=_0x370d86||0x1f4;return function(_0x42ac8f){logger[_0x0a9e('0x22')](_0x42ac8f['stack']);if(_0x42ac8f['name']){delete _0x42ac8f[_0x0a9e('0x23')];}_0x4d00e6[_0x0a9e('0x15')](_0x370d86)[_0x0a9e('0x24')](_0x42ac8f);};}exports[_0x0a9e('0x25')]=function(_0x526cf3,_0x384319){var _0x479bc4={},_0x45a1e7={},_0x5bfb33={'count':0x0,'rows':[]};var _0x1dc186=db[_0x0a9e('0x26')][_0x0a9e('0x27')];_0x45a1e7[_0x0a9e('0x28')]=_[_0x0a9e('0x29')](_0x1dc186);_0x45a1e7[_0x0a9e('0x2a')]=_[_0x0a9e('0x29')](_0x526cf3[_0x0a9e('0x2a')]);_0x45a1e7['filters']=_[_0x0a9e('0x2b')](_0x45a1e7[_0x0a9e('0x28')],_0x45a1e7[_0x0a9e('0x2a')]);_0x479bc4[_0x0a9e('0x2c')]=_['intersection'](_0x45a1e7[_0x0a9e('0x28')],qs[_0x0a9e('0x2d')](_0x526cf3[_0x0a9e('0x2a')][_0x0a9e('0x2d')]));_0x479bc4[_0x0a9e('0x2c')]=_0x479bc4[_0x0a9e('0x2c')][_0x0a9e('0x2e')]?_0x479bc4[_0x0a9e('0x2c')]:_0x45a1e7[_0x0a9e('0x28')];if(!_0x526cf3['query'][_0x0a9e('0x2f')]('nolimit')){_0x479bc4[_0x0a9e('0x30')]=qs[_0x0a9e('0x30')](_0x526cf3[_0x0a9e('0x2a')][_0x0a9e('0x30')]);_0x479bc4[_0x0a9e('0x18')]=qs['offset'](_0x526cf3[_0x0a9e('0x2a')][_0x0a9e('0x18')]);}_0x479bc4[_0x0a9e('0x31')]=qs[_0x0a9e('0x32')](_0x526cf3[_0x0a9e('0x2a')][_0x0a9e('0x32')]);_0x479bc4[_0x0a9e('0x33')]=qs[_0x0a9e('0x34')](_['pick'](_0x526cf3[_0x0a9e('0x2a')],_0x45a1e7['filters']));if(_0x526cf3[_0x0a9e('0x2a')][_0x0a9e('0x35')]){_0x479bc4[_0x0a9e('0x33')]=_[_0x0a9e('0x36')](_0x479bc4['where'],{'$or':_[_0x0a9e('0x37')](_0x1dc186,function(_0xd1836d){if(_0xd1836d[_0x0a9e('0x38')][_0x0a9e('0x39')]!=='VIRTUAL'){var _0x54135e={};_0x54135e[_0xd1836d[_0x0a9e('0x3a')]]={'$like':'%'+_0x526cf3['query'][_0x0a9e('0x35')]+'%'};return _0x54135e;}})});}_0x479bc4=_[_0x0a9e('0x36')]({},_0x479bc4,_0x526cf3[_0x0a9e('0x3b')]);var _0x1ef87a={'where':_0x479bc4['where']};return db[_0x0a9e('0x26')][_0x0a9e('0x17')](_0x1ef87a)[_0x0a9e('0x1f')](function(_0x533942){_0x5bfb33[_0x0a9e('0x17')]=_0x533942;if(_0x526cf3[_0x0a9e('0x2a')][_0x0a9e('0x3c')]){_0x479bc4['include']=[{'all':!![]}];}return db['AnalyticFieldReport'][_0x0a9e('0x3d')](_0x479bc4);})[_0x0a9e('0x1f')](function(_0x5adda1){_0x5bfb33[_0x0a9e('0x3e')]=_0x5adda1;return _0x5bfb33;})[_0x0a9e('0x1f')](respondWithFilteredResult(_0x384319,_0x479bc4))[_0x0a9e('0x3f')](handleError(_0x384319,null));};exports[_0x0a9e('0x40')]=function(_0x4b38d9,_0x5a594b){var _0x15e37d={'raw':![],'where':{'id':_0x4b38d9['params']['id']}},_0x45b3d0={};_0x45b3d0[_0x0a9e('0x28')]=_[_0x0a9e('0x29')](db[_0x0a9e('0x26')]['rawAttributes']);_0x45b3d0[_0x0a9e('0x2a')]=_[_0x0a9e('0x29')](_0x4b38d9[_0x0a9e('0x2a')]);_0x45b3d0[_0x0a9e('0x34')]=_[_0x0a9e('0x2b')](_0x45b3d0[_0x0a9e('0x28')],_0x45b3d0[_0x0a9e('0x2a')]);_0x15e37d[_0x0a9e('0x2c')]=_[_0x0a9e('0x2b')](_0x45b3d0[_0x0a9e('0x28')],qs[_0x0a9e('0x2d')](_0x4b38d9[_0x0a9e('0x2a')][_0x0a9e('0x2d')]));_0x15e37d[_0x0a9e('0x2c')]=_0x15e37d[_0x0a9e('0x2c')]['length']?_0x15e37d['attributes']:_0x45b3d0[_0x0a9e('0x28')];if(_0x4b38d9[_0x0a9e('0x2a')][_0x0a9e('0x3c')]){_0x15e37d[_0x0a9e('0x41')]=[{'all':!![]}];}_0x15e37d=_[_0x0a9e('0x36')]({},_0x15e37d,_0x4b38d9[_0x0a9e('0x3b')]);return db[_0x0a9e('0x26')][_0x0a9e('0x42')](_0x15e37d)[_0x0a9e('0x1f')](handleEntityNotFound(_0x5a594b,null))[_0x0a9e('0x1f')](respondWithResult(_0x5a594b,null))[_0x0a9e('0x3f')](handleError(_0x5a594b,null));};exports[_0x0a9e('0x43')]=function(_0x5026aa,_0x117c99){return db[_0x0a9e('0x26')][_0x0a9e('0x43')](_0x5026aa[_0x0a9e('0x44')],{})[_0x0a9e('0x1f')](respondWithResult(_0x117c99,0xc9))[_0x0a9e('0x3f')](handleError(_0x117c99,null));};exports[_0x0a9e('0x45')]=function(_0x44dd99,_0x59afe8){return db[_0x0a9e('0x26')]['bulkCreate'](_0x44dd99[_0x0a9e('0x44')],{'raw':![],'individualHooks':!![]})[_0x0a9e('0x1f')](respondWithResult(_0x59afe8,0xc9))[_0x0a9e('0x3f')](handleError(_0x59afe8,null));};exports['update']=function(_0x14bec2,_0x7f6eb1){if(_0x14bec2[_0x0a9e('0x44')]['id']){delete _0x14bec2[_0x0a9e('0x44')]['id'];}return db[_0x0a9e('0x26')][_0x0a9e('0x42')]({'where':{'id':_0x14bec2[_0x0a9e('0x46')]['id']}})['then'](handleEntityNotFound(_0x7f6eb1,null))[_0x0a9e('0x1f')](saveUpdates(_0x14bec2[_0x0a9e('0x44')],null))[_0x0a9e('0x1f')](respondWithResult(_0x7f6eb1,null))[_0x0a9e('0x3f')](handleError(_0x7f6eb1,null));};exports[_0x0a9e('0x20')]=function(_0x992c77,_0x6054ee){return db[_0x0a9e('0x26')][_0x0a9e('0x42')]({'where':{'id':_0x992c77['params']['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x6054ee,null))[_0x0a9e('0x1f')](removeEntity(_0x6054ee,null))['catch'](handleError(_0x6054ee,null));};exports['bulkDestroy']=function(_0x5ddf84,_0x1adfee){return db[_0x0a9e('0x26')][_0x0a9e('0x20')]({'where':{'id':_0x5ddf84[_0x0a9e('0x2a')][_0x0a9e('0x47')]||[]},'raw':![],'individualHooks':!![]})[_0x0a9e('0x1f')](respondWithResult(_0x1adfee,0xcc))[_0x0a9e('0x3f')](handleError(_0x1adfee,null));};exports[_0x0a9e('0x48')]=function(_0x5d38ae,_0x4b1b9f,_0x53975a){return db[_0x0a9e('0x49')][_0x0a9e('0x4a')]({'where':{'id':_0x5d38ae[_0x0a9e('0x46')]['id']}})['then'](handleEntityNotFound(_0x4b1b9f,null))[_0x0a9e('0x1f')](function(_0x161aa7){if(_0x161aa7){return db['sequelize']['transaction'](function(_0x2ef381){return db['AnalyticFieldReport'][_0x0a9e('0x20')]({'where':{'CustomReportId':_0x5d38ae['params']['id']},'transaction':_0x2ef381})[_0x0a9e('0x1f')](function(_0x3c20b2){var _0x439340=_['map'](_0x5d38ae[_0x0a9e('0x44')],function(_0x1bf38a){delete _0x1bf38a['id'];_0x1bf38a['CustomReportId']=_0x5d38ae['params']['id'];return _0x1bf38a;});return db[_0x0a9e('0x26')][_0x0a9e('0x45')](_0x439340,{'transaction':_0x2ef381});});})['then'](function(){return db[_0x0a9e('0x26')]['findAll']({'where':{'CustomReportId':_0x5d38ae[_0x0a9e('0x46')]['id']}});});}})['then'](respondWithResult(_0x4b1b9f,null))[_0x0a9e('0x3f')](handleError(_0x4b1b9f,null));}; \ No newline at end of file +var _0xa9e0=['ejs','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../mysqldb','sendStatus','status','json','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','end','error','name','send','index','AnalyticFieldReport','rawAttributes','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','limit','order','sort','where','filters','filter','merge','map','type','key','field','options','includeAll','findAll','rows','catch','show','include','find','create','body','bulkCreate','params','ids','addFields','AnalyticCustomReport','findOne','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox'];(function(_0xba0407,_0x709097){var _0x503743=function(_0x1e8ac8){while(--_0x1e8ac8){_0xba0407['push'](_0xba0407['shift']());}};_0x503743(++_0x709097);}(_0xa9e0,0x123));var _0x0a9e=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xa9e0[_0x501510];return _0x1e6ee5;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var as=require(_0x0a9e('0x11'));var hardwareService=require(_0x0a9e('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x0a9e('0x13'))['db'];function respondWithStatusCode(_0x36471c,_0xd5b662){_0xd5b662=_0xd5b662||0xcc;return function(_0x26d672){if(_0x26d672){return _0x36471c[_0x0a9e('0x14')](_0xd5b662);}return _0x36471c[_0x0a9e('0x15')](_0xd5b662)['end']();};}function respondWithResult(_0x4283ce,_0x239b12){_0x239b12=_0x239b12||0xc8;return function(_0x2b4227){if(_0x2b4227){return _0x4283ce[_0x0a9e('0x15')](_0x239b12)[_0x0a9e('0x16')](_0x2b4227);}};}function respondWithFilteredResult(_0x4d5611,_0x52a03d){return function(_0x22dccb){if(_0x22dccb){var _0x5d0880=_0x22dccb[_0x0a9e('0x17')],_0x1985b6=_0x52a03d['offset'],_0x519dfd=_0x52a03d[_0x0a9e('0x18')]+_0x52a03d['limit'],_0x16033c;if(_0x519dfd>=_0x5d0880){_0x519dfd=_0x5d0880;_0x16033c=0xc8;}else{_0x16033c=0xce;}_0x4d5611[_0x0a9e('0x15')](_0x16033c);return _0x4d5611[_0x0a9e('0x19')](_0x0a9e('0x1a'),_0x1985b6+'-'+_0x519dfd+'/'+_0x5d0880)[_0x0a9e('0x16')](_0x22dccb);}return null;};}function patchUpdates(_0x31b1ca){return function(_0x2eb11f){try{jsonpatch[_0x0a9e('0x1b')](_0x2eb11f,_0x31b1ca,!![]);}catch(_0x20559e){return BPromise[_0x0a9e('0x1c')](_0x20559e);}return _0x2eb11f[_0x0a9e('0x1d')]();};}function saveUpdates(_0x1c696a,_0x105080){return function(_0x4bb1e3){if(_0x4bb1e3){return _0x4bb1e3[_0x0a9e('0x1e')](_0x1c696a)[_0x0a9e('0x1f')](function(_0x53682f){return _0x53682f;});}return null;};}function removeEntity(_0x20f109,_0x5a09ef){return function(_0x588269){if(_0x588269){return _0x588269[_0x0a9e('0x20')]()[_0x0a9e('0x1f')](function(){_0x20f109[_0x0a9e('0x15')](0xcc)[_0x0a9e('0x21')]();});}};}function handleEntityNotFound(_0x4abc77,_0xfb6e48){return function(_0x2fb0e4){if(!_0x2fb0e4){_0x4abc77[_0x0a9e('0x14')](0x194);}return _0x2fb0e4;};}function handleError(_0x4d00e6,_0x370d86){_0x370d86=_0x370d86||0x1f4;return function(_0x42ac8f){logger[_0x0a9e('0x22')](_0x42ac8f['stack']);if(_0x42ac8f['name']){delete _0x42ac8f[_0x0a9e('0x23')];}_0x4d00e6[_0x0a9e('0x15')](_0x370d86)[_0x0a9e('0x24')](_0x42ac8f);};}exports[_0x0a9e('0x25')]=function(_0x526cf3,_0x384319){var _0x479bc4={},_0x45a1e7={},_0x5bfb33={'count':0x0,'rows':[]};var _0x1dc186=db[_0x0a9e('0x26')][_0x0a9e('0x27')];_0x45a1e7[_0x0a9e('0x28')]=_[_0x0a9e('0x29')](_0x1dc186);_0x45a1e7[_0x0a9e('0x2a')]=_[_0x0a9e('0x29')](_0x526cf3[_0x0a9e('0x2a')]);_0x45a1e7['filters']=_[_0x0a9e('0x2b')](_0x45a1e7[_0x0a9e('0x28')],_0x45a1e7[_0x0a9e('0x2a')]);_0x479bc4[_0x0a9e('0x2c')]=_['intersection'](_0x45a1e7[_0x0a9e('0x28')],qs[_0x0a9e('0x2d')](_0x526cf3[_0x0a9e('0x2a')][_0x0a9e('0x2d')]));_0x479bc4[_0x0a9e('0x2c')]=_0x479bc4[_0x0a9e('0x2c')][_0x0a9e('0x2e')]?_0x479bc4[_0x0a9e('0x2c')]:_0x45a1e7[_0x0a9e('0x28')];if(!_0x526cf3['query'][_0x0a9e('0x2f')]('nolimit')){_0x479bc4[_0x0a9e('0x30')]=qs[_0x0a9e('0x30')](_0x526cf3[_0x0a9e('0x2a')][_0x0a9e('0x30')]);_0x479bc4[_0x0a9e('0x18')]=qs['offset'](_0x526cf3[_0x0a9e('0x2a')][_0x0a9e('0x18')]);}_0x479bc4[_0x0a9e('0x31')]=qs[_0x0a9e('0x32')](_0x526cf3[_0x0a9e('0x2a')][_0x0a9e('0x32')]);_0x479bc4[_0x0a9e('0x33')]=qs[_0x0a9e('0x34')](_['pick'](_0x526cf3[_0x0a9e('0x2a')],_0x45a1e7['filters']));if(_0x526cf3[_0x0a9e('0x2a')][_0x0a9e('0x35')]){_0x479bc4[_0x0a9e('0x33')]=_[_0x0a9e('0x36')](_0x479bc4['where'],{'$or':_[_0x0a9e('0x37')](_0x1dc186,function(_0xd1836d){if(_0xd1836d[_0x0a9e('0x38')][_0x0a9e('0x39')]!=='VIRTUAL'){var _0x54135e={};_0x54135e[_0xd1836d[_0x0a9e('0x3a')]]={'$like':'%'+_0x526cf3['query'][_0x0a9e('0x35')]+'%'};return _0x54135e;}})});}_0x479bc4=_[_0x0a9e('0x36')]({},_0x479bc4,_0x526cf3[_0x0a9e('0x3b')]);var _0x1ef87a={'where':_0x479bc4['where']};return db[_0x0a9e('0x26')][_0x0a9e('0x17')](_0x1ef87a)[_0x0a9e('0x1f')](function(_0x533942){_0x5bfb33[_0x0a9e('0x17')]=_0x533942;if(_0x526cf3[_0x0a9e('0x2a')][_0x0a9e('0x3c')]){_0x479bc4['include']=[{'all':!![]}];}return db['AnalyticFieldReport'][_0x0a9e('0x3d')](_0x479bc4);})[_0x0a9e('0x1f')](function(_0x5adda1){_0x5bfb33[_0x0a9e('0x3e')]=_0x5adda1;return _0x5bfb33;})[_0x0a9e('0x1f')](respondWithFilteredResult(_0x384319,_0x479bc4))[_0x0a9e('0x3f')](handleError(_0x384319,null));};exports[_0x0a9e('0x40')]=function(_0x4b38d9,_0x5a594b){var _0x15e37d={'raw':![],'where':{'id':_0x4b38d9['params']['id']}},_0x45b3d0={};_0x45b3d0[_0x0a9e('0x28')]=_[_0x0a9e('0x29')](db[_0x0a9e('0x26')]['rawAttributes']);_0x45b3d0[_0x0a9e('0x2a')]=_[_0x0a9e('0x29')](_0x4b38d9[_0x0a9e('0x2a')]);_0x45b3d0[_0x0a9e('0x34')]=_[_0x0a9e('0x2b')](_0x45b3d0[_0x0a9e('0x28')],_0x45b3d0[_0x0a9e('0x2a')]);_0x15e37d[_0x0a9e('0x2c')]=_[_0x0a9e('0x2b')](_0x45b3d0[_0x0a9e('0x28')],qs[_0x0a9e('0x2d')](_0x4b38d9[_0x0a9e('0x2a')][_0x0a9e('0x2d')]));_0x15e37d[_0x0a9e('0x2c')]=_0x15e37d[_0x0a9e('0x2c')]['length']?_0x15e37d['attributes']:_0x45b3d0[_0x0a9e('0x28')];if(_0x4b38d9[_0x0a9e('0x2a')][_0x0a9e('0x3c')]){_0x15e37d[_0x0a9e('0x41')]=[{'all':!![]}];}_0x15e37d=_[_0x0a9e('0x36')]({},_0x15e37d,_0x4b38d9[_0x0a9e('0x3b')]);return db[_0x0a9e('0x26')][_0x0a9e('0x42')](_0x15e37d)[_0x0a9e('0x1f')](handleEntityNotFound(_0x5a594b,null))[_0x0a9e('0x1f')](respondWithResult(_0x5a594b,null))[_0x0a9e('0x3f')](handleError(_0x5a594b,null));};exports[_0x0a9e('0x43')]=function(_0x5026aa,_0x117c99){return db[_0x0a9e('0x26')][_0x0a9e('0x43')](_0x5026aa[_0x0a9e('0x44')],{})[_0x0a9e('0x1f')](respondWithResult(_0x117c99,0xc9))[_0x0a9e('0x3f')](handleError(_0x117c99,null));};exports[_0x0a9e('0x45')]=function(_0x44dd99,_0x59afe8){return db[_0x0a9e('0x26')]['bulkCreate'](_0x44dd99[_0x0a9e('0x44')],{'raw':![],'individualHooks':!![]})[_0x0a9e('0x1f')](respondWithResult(_0x59afe8,0xc9))[_0x0a9e('0x3f')](handleError(_0x59afe8,null));};exports['update']=function(_0x14bec2,_0x7f6eb1){if(_0x14bec2[_0x0a9e('0x44')]['id']){delete _0x14bec2[_0x0a9e('0x44')]['id'];}return db[_0x0a9e('0x26')][_0x0a9e('0x42')]({'where':{'id':_0x14bec2[_0x0a9e('0x46')]['id']}})['then'](handleEntityNotFound(_0x7f6eb1,null))[_0x0a9e('0x1f')](saveUpdates(_0x14bec2[_0x0a9e('0x44')],null))[_0x0a9e('0x1f')](respondWithResult(_0x7f6eb1,null))[_0x0a9e('0x3f')](handleError(_0x7f6eb1,null));};exports[_0x0a9e('0x20')]=function(_0x992c77,_0x6054ee){return db[_0x0a9e('0x26')][_0x0a9e('0x42')]({'where':{'id':_0x992c77['params']['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x6054ee,null))[_0x0a9e('0x1f')](removeEntity(_0x6054ee,null))['catch'](handleError(_0x6054ee,null));};exports['bulkDestroy']=function(_0x5ddf84,_0x1adfee){return db[_0x0a9e('0x26')][_0x0a9e('0x20')]({'where':{'id':_0x5ddf84[_0x0a9e('0x2a')][_0x0a9e('0x47')]||[]},'raw':![],'individualHooks':!![]})[_0x0a9e('0x1f')](respondWithResult(_0x1adfee,0xcc))[_0x0a9e('0x3f')](handleError(_0x1adfee,null));};exports[_0x0a9e('0x48')]=function(_0x5d38ae,_0x4b1b9f,_0x53975a){return db[_0x0a9e('0x49')][_0x0a9e('0x4a')]({'where':{'id':_0x5d38ae[_0x0a9e('0x46')]['id']}})['then'](handleEntityNotFound(_0x4b1b9f,null))[_0x0a9e('0x1f')](function(_0x161aa7){if(_0x161aa7){return db['sequelize']['transaction'](function(_0x2ef381){return db['AnalyticFieldReport'][_0x0a9e('0x20')]({'where':{'CustomReportId':_0x5d38ae['params']['id']},'transaction':_0x2ef381})[_0x0a9e('0x1f')](function(_0x3c20b2){var _0x439340=_['map'](_0x5d38ae[_0x0a9e('0x44')],function(_0x1bf38a){delete _0x1bf38a['id'];_0x1bf38a['CustomReportId']=_0x5d38ae['params']['id'];return _0x1bf38a;});return db[_0x0a9e('0x26')][_0x0a9e('0x45')](_0x439340,{'transaction':_0x2ef381});});})['then'](function(){return db[_0x0a9e('0x26')]['findAll']({'where':{'CustomReportId':_0x5d38ae[_0x0a9e('0x46')]['id']}});});}})['then'](respondWithResult(_0x4b1b9f,null))[_0x0a9e('0x3f')](handleError(_0x4b1b9f,null));}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js index 0692e09..ee872a8 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 _0x59cc=['request-promise','path','rimraf','./analyticFieldReport.attributes','exports','define','AnalyticFieldReport','analytics_report_fields','util','api','moment','bluebird'];(function(_0x4a9fb8,_0x24b455){var _0x53659b=function(_0x5e1bfc){while(--_0x5e1bfc){_0x4a9fb8['push'](_0x4a9fb8['shift']());}};_0x53659b(++_0x24b455);}(_0x59cc,0x8c));var _0xc59c=function(_0x560e64,_0x3b0905){_0x560e64=_0x560e64-0x0;var _0x5a9701=_0x59cc[_0x560e64];return _0x5a9701;};'use strict';var _=require('lodash');var util=require(_0xc59c('0x0'));var logger=require('../../config/logger')(_0xc59c('0x1'));var moment=require(_0xc59c('0x2'));var BPromise=require(_0xc59c('0x3'));var rp=require(_0xc59c('0x4'));var fs=require('fs');var path=require(_0xc59c('0x5'));var rimraf=require(_0xc59c('0x6'));var config=require('../../config/environment');var attributes=require(_0xc59c('0x7'));module[_0xc59c('0x8')]=function(_0x4ef97e,_0xe57bcc){return _0x4ef97e[_0xc59c('0x9')](_0xc59c('0xa'),attributes,{'tableName':_0xc59c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe347=['analytics_report_fields','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticFieldReport.attributes','exports','define','AnalyticFieldReport'];(function(_0x59366b,_0x4321b1){var _0x3e9f47=function(_0x1849d1){while(--_0x1849d1){_0x59366b['push'](_0x59366b['shift']());}};_0x3e9f47(++_0x4321b1);}(_0xe347,0x187));var _0x7e34=function(_0x2d2c16,_0x4e88b6){_0x2d2c16=_0x2d2c16-0x0;var _0x53f2fb=_0xe347[_0x2d2c16];return _0x53f2fb;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x7e34('0x0'))(_0x7e34('0x1'));var moment=require(_0x7e34('0x2'));var BPromise=require(_0x7e34('0x3'));var rp=require(_0x7e34('0x4'));var fs=require('fs');var path=require(_0x7e34('0x5'));var rimraf=require(_0x7e34('0x6'));var config=require(_0x7e34('0x7'));var attributes=require(_0x7e34('0x8'));module[_0x7e34('0x9')]=function(_0x172148,_0x7c8905){return _0x172148[_0x7e34('0xa')](_0x7e34('0xb'),attributes,{'tableName':_0x7e34('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 7e23978..9835c4d 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 _0xb07c=['message','result','catch','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x3ed508,_0x5db946){var _0x20d2ee=function(_0x3c6742){while(--_0x3c6742){_0x3ed508['push'](_0x3ed508['shift']());}};_0x20d2ee(++_0x5db946);}(_0xb07c,0x96));var _0xcb07=function(_0x5263a8,_0x32bfa8){_0x5263a8=_0x5263a8-0x0;var _0x57c678=_0xb07c[_0x5263a8];return _0x57c678;};'use strict';var _=require('lodash');var util=require(_0xcb07('0x0'));var moment=require(_0xcb07('0x1'));var BPromise=require('bluebird');var rs=require(_0xcb07('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xcb07('0x3'))['db'];var utils=require(_0xcb07('0x4'));var logger=require(_0xcb07('0x5'))(_0xcb07('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xcb07('0x7')][_0xcb07('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x560318,_0x3e22bf,_0x521187){return new BPromise(function(_0x12dae9,_0x49813b){return client[_0xcb07('0x9')](_0x560318,_0x521187)[_0xcb07('0xa')](function(_0x3b89cb){logger[_0xcb07('0xb')](_0xcb07('0xc'),_0x3e22bf,_0xcb07('0xd'));logger['debug'](_0xcb07('0xe'),_0x3e22bf,'request\x20sent',JSON[_0xcb07('0xf')](_0x3b89cb));if(_0x3b89cb[_0xcb07('0x10')]){if(_0x3b89cb[_0xcb07('0x10')][_0xcb07('0x11')]===0x1f4){logger[_0xcb07('0x10')](_0xcb07('0xc'),_0x3e22bf,_0x3b89cb[_0xcb07('0x10')][_0xcb07('0x12')]);return _0x49813b(_0x3b89cb[_0xcb07('0x10')][_0xcb07('0x12')]);}logger[_0xcb07('0x10')]('AnalyticFieldReport,\x20%s,\x20%s',_0x3e22bf,_0x3b89cb[_0xcb07('0x10')][_0xcb07('0x12')]);return _0x12dae9(_0x3b89cb[_0xcb07('0x10')][_0xcb07('0x12')]);}else{logger['info']('AnalyticFieldReport,\x20%s,\x20%s',_0x3e22bf,_0xcb07('0xd'));_0x12dae9(_0x3b89cb[_0xcb07('0x13')][_0xcb07('0x12')]);}})[_0xcb07('0x14')](function(_0x12f8c2){logger[_0xcb07('0x10')](_0xcb07('0xc'),_0x3e22bf,_0x12f8c2);_0x49813b(_0x12f8c2);});});} \ No newline at end of file +var _0xd619=['request\x20sent','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info','AnalyticFieldReport,\x20%s,\x20%s'];(function(_0x3d9d8e,_0x15909b){var _0x33e19e=function(_0x479cb9){while(--_0x479cb9){_0x3d9d8e['push'](_0x3d9d8e['shift']());}};_0x33e19e(++_0x15909b);}(_0xd619,0x1ea));var _0x9d61=function(_0x255d5b,_0x4f6f35){_0x255d5b=_0x255d5b-0x0;var _0x3e141a=_0xd619[_0x255d5b];return _0x3e141a;};'use strict';var _=require(_0x9d61('0x0'));var util=require('util');var moment=require(_0x9d61('0x1'));var BPromise=require(_0x9d61('0x2'));var rs=require(_0x9d61('0x3'));var fs=require('fs');var Redis=require(_0x9d61('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x9d61('0x5'));var logger=require(_0x9d61('0x6'))('rpc');var config=require(_0x9d61('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x9d61('0x8')][_0x9d61('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3c25e8,_0x275e9b,_0x332dd1){return new BPromise(function(_0x34d062,_0x3f7ead){return client[_0x9d61('0xa')](_0x3c25e8,_0x332dd1)[_0x9d61('0xb')](function(_0x499e97){logger[_0x9d61('0xc')](_0x9d61('0xd'),_0x275e9b,_0x9d61('0xe'));logger['debug'](_0x9d61('0xf'),_0x275e9b,_0x9d61('0xe'),JSON[_0x9d61('0x10')](_0x499e97));if(_0x499e97[_0x9d61('0x11')]){if(_0x499e97['error'][_0x9d61('0x12')]===0x1f4){logger[_0x9d61('0x11')](_0x9d61('0xd'),_0x275e9b,_0x499e97[_0x9d61('0x11')][_0x9d61('0x13')]);return _0x3f7ead(_0x499e97[_0x9d61('0x11')][_0x9d61('0x13')]);}logger[_0x9d61('0x11')](_0x9d61('0xd'),_0x275e9b,_0x499e97['error'][_0x9d61('0x13')]);return _0x34d062(_0x499e97[_0x9d61('0x11')][_0x9d61('0x13')]);}else{logger[_0x9d61('0xc')]('AnalyticFieldReport,\x20%s,\x20%s',_0x275e9b,_0x9d61('0xe'));_0x34d062(_0x499e97['result'][_0x9d61('0x13')]);}})[_0x9d61('0x14')](function(_0x56b09b){logger[_0x9d61('0x11')]('AnalyticFieldReport,\x20%s,\x20%s',_0x275e9b,_0x56b09b);_0x3f7ead(_0x56b09b);});});} \ No newline at end of file diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js index a88f960..c4cb17f 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 _0x326f=['/:id','show','post','/create_many','bulkCreate','/:id/create_many','addFields','update','/destroy_many','delete','destroy','multer','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticFieldReport.controller','get','isAuthenticated','index'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x326f,0xd1));var _0xf326=function(_0x51c44c,_0x3f5c70){_0x51c44c=_0x51c44c-0x0;var _0xda306c=_0x326f[_0x51c44c];return _0xda306c;};'use strict';var multer=require(_0xf326('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xf326('0x1'));var express=require(_0xf326('0x2'));var router=express[_0xf326('0x3')]();var auth=require(_0xf326('0x4'));var interaction=require(_0xf326('0x5'));var config=require(_0xf326('0x6'));var controller=require(_0xf326('0x7'));router[_0xf326('0x8')]('/',auth[_0xf326('0x9')](),controller[_0xf326('0xa')]);router['get'](_0xf326('0xb'),auth[_0xf326('0x9')](),controller[_0xf326('0xc')]);router[_0xf326('0xd')]('/',auth['isAuthenticated'](),controller['create']);router['post'](_0xf326('0xe'),auth[_0xf326('0x9')](),controller[_0xf326('0xf')]);router[_0xf326('0xd')](_0xf326('0x10'),auth['isAuthenticated'](),controller[_0xf326('0x11')]);router['put'](_0xf326('0xb'),auth['isAuthenticated'](),controller[_0xf326('0x12')]);router['delete'](_0xf326('0x13'),auth[_0xf326('0x9')](),controller['bulkDestroy']);router[_0xf326('0x14')](_0xf326('0xb'),auth[_0xf326('0x9')](),controller[_0xf326('0x15')]);module['exports']=router; \ No newline at end of file +var _0x7217=['put','update','delete','bulkDestroy','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','./analyticFieldReport.controller','get','isAuthenticated','index','/:id','show','post','create','/create_many','bulkCreate','/:id/create_many','addFields'];(function(_0x418305,_0xcf9d75){var _0x39a433=function(_0x44dbfb){while(--_0x44dbfb){_0x418305['push'](_0x418305['shift']());}};_0x39a433(++_0xcf9d75);}(_0x7217,0x19e));var _0x7721=function(_0xae7c2f,_0xf31e04){_0xae7c2f=_0xae7c2f-0x0;var _0x5d7001=_0x7217[_0xae7c2f];return _0x5d7001;};'use strict';var multer=require(_0x7721('0x0'));var util=require('util');var path=require(_0x7721('0x1'));var timeout=require(_0x7721('0x2'));var express=require(_0x7721('0x3'));var router=express[_0x7721('0x4')]();var auth=require(_0x7721('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x7721('0x6'));router[_0x7721('0x7')]('/',auth[_0x7721('0x8')](),controller[_0x7721('0x9')]);router[_0x7721('0x7')](_0x7721('0xa'),auth[_0x7721('0x8')](),controller[_0x7721('0xb')]);router[_0x7721('0xc')]('/',auth[_0x7721('0x8')](),controller[_0x7721('0xd')]);router[_0x7721('0xc')](_0x7721('0xe'),auth[_0x7721('0x8')](),controller[_0x7721('0xf')]);router['post'](_0x7721('0x10'),auth[_0x7721('0x8')](),controller[_0x7721('0x11')]);router[_0x7721('0x12')](_0x7721('0xa'),auth[_0x7721('0x8')](),controller[_0x7721('0x13')]);router[_0x7721('0x14')]('/destroy_many',auth[_0x7721('0x8')](),controller[_0x7721('0x15')]);router['delete'](_0x7721('0xa'),auth[_0x7721('0x8')](),controller[_0x7721('0x16')]);module[_0x7721('0x17')]=router; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.attributes.js b/server/api/analyticMetric/analyticMetric.attributes.js index 4be0a20..447a1e2 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 _0x8093=['exports','STRING','name','TEXT','sequelize'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x8093,0xa9));var _0x3809=function(_0x1064bc,_0x206f12){_0x1064bc=_0x1064bc-0x0;var _0x5edc45=_0x8093[_0x1064bc];return _0x5edc45;};'use strict';var Sequelize=require(_0x3809('0x0'));module[_0x3809('0x1')]={'name':{'type':Sequelize[_0x3809('0x2')],'allowNull':![],'unique':_0x3809('0x3')},'table':{'type':Sequelize[_0x3809('0x2')]},'metric':{'type':Sequelize[_0x3809('0x4')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xe3bd=['name','TEXT','exports','STRING'];(function(_0x2b9e50,_0x17a5ff){var _0x50482b=function(_0x43ba03){while(--_0x43ba03){_0x2b9e50['push'](_0x2b9e50['shift']());}};_0x50482b(++_0x17a5ff);}(_0xe3bd,0x126));var _0xde3b=function(_0x53c256,_0x382a24){_0x53c256=_0x53c256-0x0;var _0x25feb6=_0xe3bd[_0x53c256];return _0x25feb6;};'use strict';var Sequelize=require('sequelize');module[_0xde3b('0x0')]={'name':{'type':Sequelize[_0xde3b('0x1')],'allowNull':![],'unique':_0xde3b('0x2')},'table':{'type':Sequelize['STRING']},'metric':{'type':Sequelize[_0xde3b('0x3')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js index 6649eae..a572964 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 _0xa9e0=['status','json','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','get','Metrics','UserProfileResource','end','error','name','send','index','AnalyticMetric','rawAttributes','model','keys','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','limit','sort','where','pick','merge','map','type','key','field','options','includeAll','include','catch','show','params','fields','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','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../mysqldb','sendStatus'];(function(_0x3edf96,_0x11e492){var _0x128e0e=function(_0x2db51f){while(--_0x2db51f){_0x3edf96['push'](_0x3edf96['shift']());}};_0x128e0e(++_0x11e492);}(_0xa9e0,0x123));var _0x0a9e=function(_0x21aec3,_0x5c97e9){_0x21aec3=_0x21aec3-0x0;var _0x288bbc=_0xa9e0[_0x21aec3];return _0x288bbc;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var as=require(_0x0a9e('0x11'));var hardwareService=require(_0x0a9e('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x0a9e('0x13'))['db'];function respondWithStatusCode(_0x36471c,_0xd5b662){_0xd5b662=_0xd5b662||0xcc;return function(_0x26d672){if(_0x26d672){return _0x36471c[_0x0a9e('0x14')](_0xd5b662);}return _0x36471c[_0x0a9e('0x15')](_0xd5b662)['end']();};}function respondWithResult(_0x4283ce,_0x239b12){_0x239b12=_0x239b12||0xc8;return function(_0x2b4227){if(_0x2b4227){return _0x4283ce[_0x0a9e('0x15')](_0x239b12)[_0x0a9e('0x16')](_0x2b4227);}};}function respondWithFilteredResult(_0x4d5611,_0x52a03d){return function(_0x22dccb){if(_0x22dccb){var _0x5d0880=_0x22dccb[_0x0a9e('0x17')],_0x1985b6=_0x52a03d['offset'],_0x519dfd=_0x52a03d[_0x0a9e('0x18')]+_0x52a03d['limit'],_0x16033c;if(_0x519dfd>=_0x5d0880){_0x519dfd=_0x5d0880;_0x16033c=0xc8;}else{_0x16033c=0xce;}_0x4d5611[_0x0a9e('0x15')](_0x16033c);return _0x4d5611[_0x0a9e('0x19')](_0x0a9e('0x1a'),_0x1985b6+'-'+_0x519dfd+'/'+_0x5d0880)[_0x0a9e('0x16')](_0x22dccb);}return null;};}function patchUpdates(_0x31b1ca){return function(_0x2eb11f){try{jsonpatch[_0x0a9e('0x1b')](_0x2eb11f,_0x31b1ca,!![]);}catch(_0x20559e){return BPromise[_0x0a9e('0x1c')](_0x20559e);}return _0x2eb11f[_0x0a9e('0x1d')]();};}function saveUpdates(_0x1c696a,_0x105080){return function(_0x4bb1e3){if(_0x4bb1e3){return _0x4bb1e3[_0x0a9e('0x1e')](_0x1c696a)[_0x0a9e('0x1f')](function(_0x53682f){return _0x53682f;});}return null;};}function removeEntity(_0x20f109,_0x5a09ef){return function(_0x588269){if(_0x588269){return _0x588269[_0x0a9e('0x20')]()[_0x0a9e('0x1f')](function(){var _0x38e7c4=_0x588269[_0x0a9e('0x21')]({'plain':!![]});var _0x4abc77=_0x0a9e('0x22');return db[_0x0a9e('0x23')][_0x0a9e('0x20')]({'where':{'type':_0x4abc77,'resourceId':_0x38e7c4['id']}})[_0x0a9e('0x1f')](function(){return _0x588269;});})[_0x0a9e('0x1f')](function(){_0x20f109[_0x0a9e('0x15')](0xcc)[_0x0a9e('0x24')]();});}};}function handleEntityNotFound(_0x5ea472,_0x59181e){return function(_0x197ec0){if(!_0x197ec0){_0x5ea472[_0x0a9e('0x14')](0x194);}return _0x197ec0;};}function handleError(_0x40c424,_0x33161b){_0x33161b=_0x33161b||0x1f4;return function(_0x526cf3){logger[_0x0a9e('0x25')](_0x526cf3['stack']);if(_0x526cf3[_0x0a9e('0x26')]){delete _0x526cf3['name'];}_0x40c424[_0x0a9e('0x15')](_0x33161b)[_0x0a9e('0x27')](_0x526cf3);};}exports[_0x0a9e('0x28')]=function(_0x14433c,_0x140511){var _0x1538a4={},_0x11c3b6={},_0x14de77={'count':0x0,'rows':[]};var _0x5a101a=db[_0x0a9e('0x29')][_0x0a9e('0x2a')];_0x11c3b6[_0x0a9e('0x2b')]=_[_0x0a9e('0x2c')](_0x5a101a);_0x11c3b6['query']=_[_0x0a9e('0x2c')](_0x14433c[_0x0a9e('0x2d')]);_0x11c3b6[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x11c3b6[_0x0a9e('0x2b')],_0x11c3b6[_0x0a9e('0x2d')]);_0x1538a4[_0x0a9e('0x30')]=_[_0x0a9e('0x2f')](_0x11c3b6[_0x0a9e('0x2b')],qs['fields'](_0x14433c[_0x0a9e('0x2d')]['fields']));_0x1538a4[_0x0a9e('0x30')]=_0x1538a4[_0x0a9e('0x30')][_0x0a9e('0x31')]?_0x1538a4[_0x0a9e('0x30')]:_0x11c3b6[_0x0a9e('0x2b')];if(!_0x14433c['query'][_0x0a9e('0x32')](_0x0a9e('0x33'))){_0x1538a4[_0x0a9e('0x34')]=qs[_0x0a9e('0x34')](_0x14433c[_0x0a9e('0x2d')][_0x0a9e('0x34')]);_0x1538a4[_0x0a9e('0x18')]=qs[_0x0a9e('0x18')](_0x14433c['query'][_0x0a9e('0x18')]);}_0x1538a4['order']=qs[_0x0a9e('0x35')](_0x14433c[_0x0a9e('0x2d')][_0x0a9e('0x35')]);_0x1538a4[_0x0a9e('0x36')]=qs['filters'](_[_0x0a9e('0x37')](_0x14433c[_0x0a9e('0x2d')],_0x11c3b6[_0x0a9e('0x2e')]));if(_0x14433c[_0x0a9e('0x2d')]['filter']){_0x1538a4['where']=_[_0x0a9e('0x38')](_0x1538a4['where'],{'$or':_[_0x0a9e('0x39')](_0x5a101a,function(_0x3d9717){if(_0x3d9717[_0x0a9e('0x3a')][_0x0a9e('0x3b')]!=='VIRTUAL'){var _0x31916f={};_0x31916f[_0x3d9717[_0x0a9e('0x3c')]]={'$like':'%'+_0x14433c[_0x0a9e('0x2d')]['filter']+'%'};return _0x31916f;}})});}_0x1538a4=_[_0x0a9e('0x38')]({},_0x1538a4,_0x14433c[_0x0a9e('0x3d')]);var _0x289467={'where':_0x1538a4['where']};return db['AnalyticMetric'][_0x0a9e('0x17')](_0x289467)[_0x0a9e('0x1f')](function(_0x5adda1){_0x14de77[_0x0a9e('0x17')]=_0x5adda1;if(_0x14433c[_0x0a9e('0x2d')][_0x0a9e('0x3e')]){_0x1538a4[_0x0a9e('0x3f')]=[{'all':!![]}];}return db['AnalyticMetric']['findAll'](_0x1538a4);})[_0x0a9e('0x1f')](function(_0x45b3d0){_0x14de77['rows']=_0x45b3d0;return _0x14de77;})[_0x0a9e('0x1f')](respondWithFilteredResult(_0x140511,_0x1538a4))[_0x0a9e('0x40')](handleError(_0x140511,null));};exports[_0x0a9e('0x41')]=function(_0x5b4f5e,_0x316c8f){var _0x2cfea9={'raw':!![],'where':{'id':_0x5b4f5e[_0x0a9e('0x42')]['id']}},_0x274e8e={};_0x274e8e[_0x0a9e('0x2b')]=_[_0x0a9e('0x2c')](db[_0x0a9e('0x29')][_0x0a9e('0x2a')]);_0x274e8e[_0x0a9e('0x2d')]=_[_0x0a9e('0x2c')](_0x5b4f5e[_0x0a9e('0x2d')]);_0x274e8e[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x274e8e[_0x0a9e('0x2b')],_0x274e8e[_0x0a9e('0x2d')]);_0x2cfea9['attributes']=_['intersection'](_0x274e8e[_0x0a9e('0x2b')],qs[_0x0a9e('0x43')](_0x5b4f5e[_0x0a9e('0x2d')][_0x0a9e('0x43')]));_0x2cfea9[_0x0a9e('0x30')]=_0x2cfea9[_0x0a9e('0x30')][_0x0a9e('0x31')]?_0x2cfea9[_0x0a9e('0x30')]:_0x274e8e[_0x0a9e('0x2b')];if(_0x5b4f5e[_0x0a9e('0x2d')][_0x0a9e('0x3e')]){_0x2cfea9[_0x0a9e('0x3f')]=[{'all':!![]}];}_0x2cfea9=_['merge']({},_0x2cfea9,_0x5b4f5e[_0x0a9e('0x3d')]);return db[_0x0a9e('0x29')][_0x0a9e('0x44')](_0x2cfea9)[_0x0a9e('0x1f')](handleEntityNotFound(_0x316c8f,null))[_0x0a9e('0x1f')](respondWithResult(_0x316c8f,null))[_0x0a9e('0x40')](handleError(_0x316c8f,null));};exports[_0x0a9e('0x45')]=function(_0x44dd99,_0x59afe8){return db[_0x0a9e('0x29')]['create'](_0x44dd99[_0x0a9e('0x46')],{})[_0x0a9e('0x1f')](function(_0x8d6dd1){var _0x562fb4=_0x44dd99[_0x0a9e('0x47')][_0x0a9e('0x21')]({'plain':!![]});if(!_0x562fb4)throw new Error(_0x0a9e('0x48'));if(_0x562fb4[_0x0a9e('0x49')]===_0x0a9e('0x47')){var _0x37be73=_0x8d6dd1[_0x0a9e('0x21')]({'plain':!![]});var _0x5bbcde=_0x0a9e('0x22');return db[_0x0a9e('0x4a')][_0x0a9e('0x44')]({'where':{'name':_0x5bbcde,'userProfileId':_0x562fb4[_0x0a9e('0x4b')]},'raw':!![]})[_0x0a9e('0x1f')](function(_0x992c77){if(_0x992c77&&_0x992c77[_0x0a9e('0x4c')]===0x0){return db[_0x0a9e('0x23')][_0x0a9e('0x45')]({'name':_0x37be73['name'],'resourceId':_0x37be73['id'],'type':_0x992c77[_0x0a9e('0x26')],'sectionId':_0x992c77['id']},{})[_0x0a9e('0x1f')](function(){return _0x8d6dd1;});}else{return _0x8d6dd1;}})['catch'](function(_0x4ae14b){logger['error'](_0x0a9e('0x4d'),_0x4ae14b);throw _0x4ae14b;});}return _0x8d6dd1;})[_0x0a9e('0x1f')](respondWithResult(_0x59afe8,0xc9))[_0x0a9e('0x40')](handleError(_0x59afe8,null));};exports[_0x0a9e('0x1e')]=function(_0x61bb17,_0x30decb){if(_0x61bb17[_0x0a9e('0x46')]['id']){delete _0x61bb17[_0x0a9e('0x46')]['id'];}return db['AnalyticMetric']['find']({'where':{'id':_0x61bb17['params']['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x30decb,null))[_0x0a9e('0x1f')](saveUpdates(_0x61bb17[_0x0a9e('0x46')],null))['then'](respondWithResult(_0x30decb,null))[_0x0a9e('0x40')](handleError(_0x30decb,null));};exports[_0x0a9e('0x20')]=function(_0x53d113,_0x5a88da){return db[_0x0a9e('0x29')]['find']({'where':{'id':_0x53d113[_0x0a9e('0x42')]['id']}})['then'](handleEntityNotFound(_0x5a88da,null))[_0x0a9e('0x1f')](removeEntity(_0x5a88da,null))[_0x0a9e('0x40')](handleError(_0x5a88da,null));}; \ No newline at end of file +var _0xa9e0=['status','json','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','get','Metrics','UserProfileResource','end','error','name','send','index','AnalyticMetric','rawAttributes','model','keys','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','limit','sort','where','pick','merge','map','type','key','field','options','includeAll','include','catch','show','params','fields','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','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../mysqldb','sendStatus'];(function(_0x2b3208,_0x26f23b){var _0xde06e1=function(_0x6d46d1){while(--_0x6d46d1){_0x2b3208['push'](_0x2b3208['shift']());}};_0xde06e1(++_0x26f23b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x138f59,_0x1b53fb){_0x138f59=_0x138f59-0x0;var _0x3d114d=_0xa9e0[_0x138f59];return _0x3d114d;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var as=require(_0x0a9e('0x11'));var hardwareService=require(_0x0a9e('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x0a9e('0x13'))['db'];function respondWithStatusCode(_0x36471c,_0xd5b662){_0xd5b662=_0xd5b662||0xcc;return function(_0x26d672){if(_0x26d672){return _0x36471c[_0x0a9e('0x14')](_0xd5b662);}return _0x36471c[_0x0a9e('0x15')](_0xd5b662)['end']();};}function respondWithResult(_0x4283ce,_0x239b12){_0x239b12=_0x239b12||0xc8;return function(_0x2b4227){if(_0x2b4227){return _0x4283ce[_0x0a9e('0x15')](_0x239b12)[_0x0a9e('0x16')](_0x2b4227);}};}function respondWithFilteredResult(_0x4d5611,_0x52a03d){return function(_0x22dccb){if(_0x22dccb){var _0x5d0880=_0x22dccb[_0x0a9e('0x17')],_0x1985b6=_0x52a03d['offset'],_0x519dfd=_0x52a03d[_0x0a9e('0x18')]+_0x52a03d['limit'],_0x16033c;if(_0x519dfd>=_0x5d0880){_0x519dfd=_0x5d0880;_0x16033c=0xc8;}else{_0x16033c=0xce;}_0x4d5611[_0x0a9e('0x15')](_0x16033c);return _0x4d5611[_0x0a9e('0x19')](_0x0a9e('0x1a'),_0x1985b6+'-'+_0x519dfd+'/'+_0x5d0880)[_0x0a9e('0x16')](_0x22dccb);}return null;};}function patchUpdates(_0x31b1ca){return function(_0x2eb11f){try{jsonpatch[_0x0a9e('0x1b')](_0x2eb11f,_0x31b1ca,!![]);}catch(_0x20559e){return BPromise[_0x0a9e('0x1c')](_0x20559e);}return _0x2eb11f[_0x0a9e('0x1d')]();};}function saveUpdates(_0x1c696a,_0x105080){return function(_0x4bb1e3){if(_0x4bb1e3){return _0x4bb1e3[_0x0a9e('0x1e')](_0x1c696a)[_0x0a9e('0x1f')](function(_0x53682f){return _0x53682f;});}return null;};}function removeEntity(_0x20f109,_0x5a09ef){return function(_0x588269){if(_0x588269){return _0x588269[_0x0a9e('0x20')]()[_0x0a9e('0x1f')](function(){var _0x38e7c4=_0x588269[_0x0a9e('0x21')]({'plain':!![]});var _0x4abc77=_0x0a9e('0x22');return db[_0x0a9e('0x23')][_0x0a9e('0x20')]({'where':{'type':_0x4abc77,'resourceId':_0x38e7c4['id']}})[_0x0a9e('0x1f')](function(){return _0x588269;});})[_0x0a9e('0x1f')](function(){_0x20f109[_0x0a9e('0x15')](0xcc)[_0x0a9e('0x24')]();});}};}function handleEntityNotFound(_0x5ea472,_0x59181e){return function(_0x197ec0){if(!_0x197ec0){_0x5ea472[_0x0a9e('0x14')](0x194);}return _0x197ec0;};}function handleError(_0x40c424,_0x33161b){_0x33161b=_0x33161b||0x1f4;return function(_0x526cf3){logger[_0x0a9e('0x25')](_0x526cf3['stack']);if(_0x526cf3[_0x0a9e('0x26')]){delete _0x526cf3['name'];}_0x40c424[_0x0a9e('0x15')](_0x33161b)[_0x0a9e('0x27')](_0x526cf3);};}exports[_0x0a9e('0x28')]=function(_0x14433c,_0x140511){var _0x1538a4={},_0x11c3b6={},_0x14de77={'count':0x0,'rows':[]};var _0x5a101a=db[_0x0a9e('0x29')][_0x0a9e('0x2a')];_0x11c3b6[_0x0a9e('0x2b')]=_[_0x0a9e('0x2c')](_0x5a101a);_0x11c3b6['query']=_[_0x0a9e('0x2c')](_0x14433c[_0x0a9e('0x2d')]);_0x11c3b6[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x11c3b6[_0x0a9e('0x2b')],_0x11c3b6[_0x0a9e('0x2d')]);_0x1538a4[_0x0a9e('0x30')]=_[_0x0a9e('0x2f')](_0x11c3b6[_0x0a9e('0x2b')],qs['fields'](_0x14433c[_0x0a9e('0x2d')]['fields']));_0x1538a4[_0x0a9e('0x30')]=_0x1538a4[_0x0a9e('0x30')][_0x0a9e('0x31')]?_0x1538a4[_0x0a9e('0x30')]:_0x11c3b6[_0x0a9e('0x2b')];if(!_0x14433c['query'][_0x0a9e('0x32')](_0x0a9e('0x33'))){_0x1538a4[_0x0a9e('0x34')]=qs[_0x0a9e('0x34')](_0x14433c[_0x0a9e('0x2d')][_0x0a9e('0x34')]);_0x1538a4[_0x0a9e('0x18')]=qs[_0x0a9e('0x18')](_0x14433c['query'][_0x0a9e('0x18')]);}_0x1538a4['order']=qs[_0x0a9e('0x35')](_0x14433c[_0x0a9e('0x2d')][_0x0a9e('0x35')]);_0x1538a4[_0x0a9e('0x36')]=qs['filters'](_[_0x0a9e('0x37')](_0x14433c[_0x0a9e('0x2d')],_0x11c3b6[_0x0a9e('0x2e')]));if(_0x14433c[_0x0a9e('0x2d')]['filter']){_0x1538a4['where']=_[_0x0a9e('0x38')](_0x1538a4['where'],{'$or':_[_0x0a9e('0x39')](_0x5a101a,function(_0x3d9717){if(_0x3d9717[_0x0a9e('0x3a')][_0x0a9e('0x3b')]!=='VIRTUAL'){var _0x31916f={};_0x31916f[_0x3d9717[_0x0a9e('0x3c')]]={'$like':'%'+_0x14433c[_0x0a9e('0x2d')]['filter']+'%'};return _0x31916f;}})});}_0x1538a4=_[_0x0a9e('0x38')]({},_0x1538a4,_0x14433c[_0x0a9e('0x3d')]);var _0x289467={'where':_0x1538a4['where']};return db['AnalyticMetric'][_0x0a9e('0x17')](_0x289467)[_0x0a9e('0x1f')](function(_0x5adda1){_0x14de77[_0x0a9e('0x17')]=_0x5adda1;if(_0x14433c[_0x0a9e('0x2d')][_0x0a9e('0x3e')]){_0x1538a4[_0x0a9e('0x3f')]=[{'all':!![]}];}return db['AnalyticMetric']['findAll'](_0x1538a4);})[_0x0a9e('0x1f')](function(_0x45b3d0){_0x14de77['rows']=_0x45b3d0;return _0x14de77;})[_0x0a9e('0x1f')](respondWithFilteredResult(_0x140511,_0x1538a4))[_0x0a9e('0x40')](handleError(_0x140511,null));};exports[_0x0a9e('0x41')]=function(_0x5b4f5e,_0x316c8f){var _0x2cfea9={'raw':!![],'where':{'id':_0x5b4f5e[_0x0a9e('0x42')]['id']}},_0x274e8e={};_0x274e8e[_0x0a9e('0x2b')]=_[_0x0a9e('0x2c')](db[_0x0a9e('0x29')][_0x0a9e('0x2a')]);_0x274e8e[_0x0a9e('0x2d')]=_[_0x0a9e('0x2c')](_0x5b4f5e[_0x0a9e('0x2d')]);_0x274e8e[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x274e8e[_0x0a9e('0x2b')],_0x274e8e[_0x0a9e('0x2d')]);_0x2cfea9['attributes']=_['intersection'](_0x274e8e[_0x0a9e('0x2b')],qs[_0x0a9e('0x43')](_0x5b4f5e[_0x0a9e('0x2d')][_0x0a9e('0x43')]));_0x2cfea9[_0x0a9e('0x30')]=_0x2cfea9[_0x0a9e('0x30')][_0x0a9e('0x31')]?_0x2cfea9[_0x0a9e('0x30')]:_0x274e8e[_0x0a9e('0x2b')];if(_0x5b4f5e[_0x0a9e('0x2d')][_0x0a9e('0x3e')]){_0x2cfea9[_0x0a9e('0x3f')]=[{'all':!![]}];}_0x2cfea9=_['merge']({},_0x2cfea9,_0x5b4f5e[_0x0a9e('0x3d')]);return db[_0x0a9e('0x29')][_0x0a9e('0x44')](_0x2cfea9)[_0x0a9e('0x1f')](handleEntityNotFound(_0x316c8f,null))[_0x0a9e('0x1f')](respondWithResult(_0x316c8f,null))[_0x0a9e('0x40')](handleError(_0x316c8f,null));};exports[_0x0a9e('0x45')]=function(_0x44dd99,_0x59afe8){return db[_0x0a9e('0x29')]['create'](_0x44dd99[_0x0a9e('0x46')],{})[_0x0a9e('0x1f')](function(_0x8d6dd1){var _0x562fb4=_0x44dd99[_0x0a9e('0x47')][_0x0a9e('0x21')]({'plain':!![]});if(!_0x562fb4)throw new Error(_0x0a9e('0x48'));if(_0x562fb4[_0x0a9e('0x49')]===_0x0a9e('0x47')){var _0x37be73=_0x8d6dd1[_0x0a9e('0x21')]({'plain':!![]});var _0x5bbcde=_0x0a9e('0x22');return db[_0x0a9e('0x4a')][_0x0a9e('0x44')]({'where':{'name':_0x5bbcde,'userProfileId':_0x562fb4[_0x0a9e('0x4b')]},'raw':!![]})[_0x0a9e('0x1f')](function(_0x992c77){if(_0x992c77&&_0x992c77[_0x0a9e('0x4c')]===0x0){return db[_0x0a9e('0x23')][_0x0a9e('0x45')]({'name':_0x37be73['name'],'resourceId':_0x37be73['id'],'type':_0x992c77[_0x0a9e('0x26')],'sectionId':_0x992c77['id']},{})[_0x0a9e('0x1f')](function(){return _0x8d6dd1;});}else{return _0x8d6dd1;}})['catch'](function(_0x4ae14b){logger['error'](_0x0a9e('0x4d'),_0x4ae14b);throw _0x4ae14b;});}return _0x8d6dd1;})[_0x0a9e('0x1f')](respondWithResult(_0x59afe8,0xc9))[_0x0a9e('0x40')](handleError(_0x59afe8,null));};exports[_0x0a9e('0x1e')]=function(_0x61bb17,_0x30decb){if(_0x61bb17[_0x0a9e('0x46')]['id']){delete _0x61bb17[_0x0a9e('0x46')]['id'];}return db['AnalyticMetric']['find']({'where':{'id':_0x61bb17['params']['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x30decb,null))[_0x0a9e('0x1f')](saveUpdates(_0x61bb17[_0x0a9e('0x46')],null))['then'](respondWithResult(_0x30decb,null))[_0x0a9e('0x40')](handleError(_0x30decb,null));};exports[_0x0a9e('0x20')]=function(_0x53d113,_0x5a88da){return db[_0x0a9e('0x29')]['find']({'where':{'id':_0x53d113[_0x0a9e('0x42')]['id']}})['then'](handleEntityNotFound(_0x5a88da,null))[_0x0a9e('0x1f')](removeEntity(_0x5a88da,null))[_0x0a9e('0x40')](handleError(_0x5a88da,null));}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js index 0a780a9..45fff7e 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 _0xe442=['path','rimraf','../../config/environment','./analyticMetric.attributes','AnalyticMetric','analytics_metrics','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x50fda9,_0x5ee44b){var _0x36b92b=function(_0x121877){while(--_0x121877){_0x50fda9['push'](_0x50fda9['shift']());}};_0x36b92b(++_0x5ee44b);}(_0xe442,0x132));var _0x2e44=function(_0x32f7d7,_0x54231b){_0x32f7d7=_0x32f7d7-0x0;var _0x133d09=_0xe442[_0x32f7d7];return _0x133d09;};'use strict';var _=require(_0x2e44('0x0'));var util=require(_0x2e44('0x1'));var logger=require(_0x2e44('0x2'))(_0x2e44('0x3'));var moment=require(_0x2e44('0x4'));var BPromise=require(_0x2e44('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2e44('0x6'));var rimraf=require(_0x2e44('0x7'));var config=require(_0x2e44('0x8'));var attributes=require(_0x2e44('0x9'));module['exports']=function(_0x37d6b0,_0x59702b){return _0x37d6b0['define'](_0x2e44('0xa'),attributes,{'tableName':_0x2e44('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x54e8=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticMetric.attributes','exports','define','AnalyticMetric','lodash'];(function(_0x1f0213,_0x3c3c9e){var _0x2048c4=function(_0x26d0c6){while(--_0x26d0c6){_0x1f0213['push'](_0x1f0213['shift']());}};_0x2048c4(++_0x3c3c9e);}(_0x54e8,0x1d3));var _0x854e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x54e8[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x854e('0x0'));var util=require('util');var logger=require(_0x854e('0x1'))(_0x854e('0x2'));var moment=require(_0x854e('0x3'));var BPromise=require(_0x854e('0x4'));var rp=require(_0x854e('0x5'));var fs=require('fs');var path=require(_0x854e('0x6'));var rimraf=require(_0x854e('0x7'));var config=require(_0x854e('0x8'));var attributes=require(_0x854e('0x9'));module[_0x854e('0xa')]=function(_0x4c018c,_0x19df46){return _0x4c018c[_0x854e('0xb')](_0x854e('0xc'),attributes,{'tableName':'analytics_metrics','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.rpc.js b/server/api/analyticMetric/analyticMetric.rpc.js index fecd63c..417330f 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 _0x277e=['code','message','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','jayson/promise','request','then','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x411017,_0x4a8117){var _0x2adeea=function(_0x545222){while(--_0x545222){_0x411017['push'](_0x411017['shift']());}};_0x2adeea(++_0x4a8117);}(_0x277e,0x1ca));var _0xe277=function(_0x1605fc,_0x4b024d){_0x1605fc=_0x1605fc-0x0;var _0x288515=_0x277e[_0x1605fc];return _0x288515;};'use strict';var _=require(_0xe277('0x0'));var util=require(_0xe277('0x1'));var moment=require(_0xe277('0x2'));var BPromise=require(_0xe277('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe277('0x4'));var db=require(_0xe277('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xe277('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xe277('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x456923,_0x387b6e,_0x19a362){return new BPromise(function(_0x2b09a7,_0x19eb1b){return client[_0xe277('0x8')](_0x456923,_0x19a362)[_0xe277('0x9')](function(_0x2fc665){logger[_0xe277('0xa')](_0xe277('0xb'),_0x387b6e,_0xe277('0xc'));logger[_0xe277('0xd')](_0xe277('0xe'),_0x387b6e,'request\x20sent',JSON[_0xe277('0xf')](_0x2fc665));if(_0x2fc665[_0xe277('0x10')]){if(_0x2fc665[_0xe277('0x10')][_0xe277('0x11')]===0x1f4){logger[_0xe277('0x10')](_0xe277('0xb'),_0x387b6e,_0x2fc665['error'][_0xe277('0x12')]);return _0x19eb1b(_0x2fc665[_0xe277('0x10')][_0xe277('0x12')]);}logger['error'](_0xe277('0xb'),_0x387b6e,_0x2fc665['error'][_0xe277('0x12')]);return _0x2b09a7(_0x2fc665[_0xe277('0x10')][_0xe277('0x12')]);}else{logger[_0xe277('0xa')](_0xe277('0xb'),_0x387b6e,_0xe277('0xc'));_0x2b09a7(_0x2fc665['result'][_0xe277('0x12')]);}})['catch'](function(_0x2ccf64){logger['error']('AnalyticMetric,\x20%s,\x20%s',_0x387b6e,_0x2ccf64);_0x19eb1b(_0x2ccf64);});});} \ No newline at end of file +var _0xf02c=['../../config/logger','../../config/environment','client','http','request','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','error','message','result','util','moment','bluebird','ioredis'];(function(_0x912d90,_0x489efb){var _0x2d3709=function(_0x4553f2){while(--_0x4553f2){_0x912d90['push'](_0x912d90['shift']());}};_0x2d3709(++_0x489efb);}(_0xf02c,0x1d8));var _0xcf02=function(_0x5b6805,_0x14ac12){_0x5b6805=_0x5b6805-0x0;var _0x4d143c=_0xf02c[_0x5b6805];return _0x4d143c;};'use strict';var _=require('lodash');var util=require(_0xcf02('0x0'));var moment=require(_0xcf02('0x1'));var BPromise=require(_0xcf02('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xcf02('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xcf02('0x4'))('rpc');var config=require(_0xcf02('0x5'));var jayson=require('jayson/promise');var client=jayson[_0xcf02('0x6')][_0xcf02('0x7')]({'port':0x232a});function respondWithRpcPromise(_0xca9c31,_0x33df64,_0x1af068){return new BPromise(function(_0x327b28,_0x3b9e85){return client[_0xcf02('0x8')](_0xca9c31,_0x1af068)['then'](function(_0x571222){logger[_0xcf02('0x9')](_0xcf02('0xa'),_0x33df64,_0xcf02('0xb'));logger[_0xcf02('0xc')](_0xcf02('0xd'),_0x33df64,_0xcf02('0xb'),JSON['stringify'](_0x571222));if(_0x571222['error']){if(_0x571222[_0xcf02('0xe')]['code']===0x1f4){logger[_0xcf02('0xe')]('AnalyticMetric,\x20%s,\x20%s',_0x33df64,_0x571222[_0xcf02('0xe')][_0xcf02('0xf')]);return _0x3b9e85(_0x571222[_0xcf02('0xe')][_0xcf02('0xf')]);}logger[_0xcf02('0xe')](_0xcf02('0xa'),_0x33df64,_0x571222[_0xcf02('0xe')][_0xcf02('0xf')]);return _0x327b28(_0x571222['error'][_0xcf02('0xf')]);}else{logger[_0xcf02('0x9')](_0xcf02('0xa'),_0x33df64,'request\x20sent');_0x327b28(_0x571222[_0xcf02('0x10')][_0xcf02('0xf')]);}})['catch'](function(_0x477bd5){logger['error'](_0xcf02('0xa'),_0x33df64,_0x477bd5);_0x3b9e85(_0x477bd5);});});} \ No newline at end of file diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js index 4502191..ff5d538 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 _0xc2c7=['update','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','post','create','put','/:id'];(function(_0x4fef5c,_0x1a805b){var _0x35d05c=function(_0x10db61){while(--_0x10db61){_0x4fef5c['push'](_0x4fef5c['shift']());}};_0x35d05c(++_0x1a805b);}(_0xc2c7,0x134));var _0x7c2c=function(_0x494163,_0x1f3669){_0x494163=_0x494163-0x0;var _0x25ef76=_0xc2c7[_0x494163];return _0x25ef76;};'use strict';var multer=require('multer');var util=require(_0x7c2c('0x0'));var path=require(_0x7c2c('0x1'));var timeout=require(_0x7c2c('0x2'));var express=require(_0x7c2c('0x3'));var router=express[_0x7c2c('0x4')]();var auth=require(_0x7c2c('0x5'));var interaction=require(_0x7c2c('0x6'));var config=require(_0x7c2c('0x7'));var controller=require('./analyticMetric.controller');router['get']('/',auth[_0x7c2c('0x8')](),controller[_0x7c2c('0x9')]);router[_0x7c2c('0xa')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x7c2c('0xb')]('/',auth[_0x7c2c('0x8')](),controller[_0x7c2c('0xc')]);router[_0x7c2c('0xd')](_0x7c2c('0xe'),auth['isAuthenticated'](),controller[_0x7c2c('0xf')]);router[_0x7c2c('0x10')](_0x7c2c('0xe'),auth[_0x7c2c('0x8')](),controller[_0x7c2c('0x11')]);module[_0x7c2c('0x12')]=router; \ No newline at end of file +var _0xc4aa=['connect-timeout','express','Router','./analyticMetric.controller','get','isAuthenticated','index','/:id','show','create','put','update','delete','destroy','multer','util','path'];(function(_0xcdfc4f,_0x8a111a){var _0x3f70d1=function(_0xc0f333){while(--_0xc0f333){_0xcdfc4f['push'](_0xcdfc4f['shift']());}};_0x3f70d1(++_0x8a111a);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x4d613c,_0x55f220){_0x4d613c=_0x4d613c-0x0;var _0x301fe3=_0xc4aa[_0x4d613c];return _0x301fe3;};'use strict';var multer=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var path=require(_0xac4a('0x2'));var timeout=require(_0xac4a('0x3'));var express=require(_0xac4a('0x4'));var router=express[_0xac4a('0x5')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xac4a('0x6'));router[_0xac4a('0x7')]('/',auth[_0xac4a('0x8')](),controller[_0xac4a('0x9')]);router[_0xac4a('0x7')](_0xac4a('0xa'),auth[_0xac4a('0x8')](),controller[_0xac4a('0xb')]);router['post']('/',auth['isAuthenticated'](),controller[_0xac4a('0xc')]);router[_0xac4a('0xd')](_0xac4a('0xa'),auth['isAuthenticated'](),controller[_0xac4a('0xe')]);router[_0xac4a('0xf')](_0xac4a('0xa'),auth['isAuthenticated'](),controller[_0xac4a('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js index ac5a7d3..18a8167 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 _0xf413=['TEXT','sequelize','exports'];(function(_0x38fb1a,_0x4e4ab4){var _0x249fb7=function(_0x12a524){while(--_0x12a524){_0x38fb1a['push'](_0x38fb1a['shift']());}};_0x249fb7(++_0x4e4ab4);}(_0xf413,0x1d8));var _0x3f41=function(_0x495649,_0x1e7677){_0x495649=_0x495649-0x0;var _0xab5025=_0xf413[_0x495649];return _0xab5025;};'use strict';var Sequelize=require(_0x3f41('0x0'));module[_0x3f41('0x1')]={'tree':{'type':Sequelize[_0x3f41('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x8ab0=['exports'];(function(_0xf7224d,_0x2b8c21){var _0x525740=function(_0x10278d){while(--_0x10278d){_0xf7224d['push'](_0xf7224d['shift']());}};_0x525740(++_0x2b8c21);}(_0x8ab0,0x19f));var _0x08ab=function(_0x4ce7d2,_0x32e979){_0x4ce7d2=_0x4ce7d2-0x0;var _0x3af51e=_0x8ab0[_0x4ce7d2];return _0x3af51e;};'use strict';var Sequelize=require('sequelize');module[_0x08ab('0x0')]={'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 27e4d0d..d0a6f83 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 _0x9957=['zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','limit','set','Content-Range','reject','save','then','destroy','error','stack','name','send','AnalyticTreeReport','model','query','keys','attributes','intersection','fields','hasOwnProperty','nolimit','sort','where','filters','merge','map','type','key','VIRTUAL','field','filter','count','includeAll','include','findAll','rows','catch','show','params','rawAttributes','options','find','create','body','update','html-pdf','eml-format','rimraf'];(function(_0x2e9450,_0x456dbd){var _0x45c036=function(_0x1674d8){while(--_0x1674d8){_0x2e9450['push'](_0x2e9450['shift']());}};_0x45c036(++_0x456dbd);}(_0x9957,0x93));var _0x7995=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9957[_0x3947c9];return _0x2e7871;};'use strict';var pdf=require(_0x7995('0x0'));var emlformat=require(_0x7995('0x1'));var rimraf=require(_0x7995('0x2'));var zipdir=require(_0x7995('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7995('0x4'));var moment=require(_0x7995('0x5'));var BPromise=require(_0x7995('0x6'));var Mustache=require(_0x7995('0x7'));var util=require('util');var path=require(_0x7995('0x8'));var sox=require(_0x7995('0x9'));var csv=require(_0x7995('0xa'));var ejs=require(_0x7995('0xb'));var fs=require('fs');var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var db=require(_0x7995('0x19'))['db'];function respondWithStatusCode(_0x2cb37a,_0x19a27e){_0x19a27e=_0x19a27e||0xcc;return function(_0x385f00){if(_0x385f00){return _0x2cb37a[_0x7995('0x1a')](_0x19a27e);}return _0x2cb37a[_0x7995('0x1b')](_0x19a27e)[_0x7995('0x1c')]();};}function respondWithResult(_0x4cc004,_0x58f5ad){_0x58f5ad=_0x58f5ad||0xc8;return function(_0x2b4e94){if(_0x2b4e94){return _0x4cc004[_0x7995('0x1b')](_0x58f5ad)[_0x7995('0x1d')](_0x2b4e94);}};}function respondWithFilteredResult(_0x321ae8,_0x3f1d3e){return function(_0x1a5310){if(_0x1a5310){var _0x2202ce=_0x1a5310['count'],_0x41cbf0=_0x3f1d3e[_0x7995('0x1e')],_0x5377e5=_0x3f1d3e[_0x7995('0x1e')]+_0x3f1d3e[_0x7995('0x1f')],_0x2eeacc;if(_0x5377e5>=_0x2202ce){_0x5377e5=_0x2202ce;_0x2eeacc=0xc8;}else{_0x2eeacc=0xce;}_0x321ae8[_0x7995('0x1b')](_0x2eeacc);return _0x321ae8[_0x7995('0x20')](_0x7995('0x21'),_0x41cbf0+'-'+_0x5377e5+'/'+_0x2202ce)['json'](_0x1a5310);}return null;};}function patchUpdates(_0x54c9ae){return function(_0x2536c8){try{jsonpatch['apply'](_0x2536c8,_0x54c9ae,!![]);}catch(_0x555f74){return BPromise[_0x7995('0x22')](_0x555f74);}return _0x2536c8[_0x7995('0x23')]();};}function saveUpdates(_0x4cbe10,_0x3a9b54){return function(_0x51f276){if(_0x51f276){return _0x51f276['update'](_0x4cbe10)[_0x7995('0x24')](function(_0x327b1f){return _0x327b1f;});}return null;};}function removeEntity(_0x350fd9,_0x1a8568){return function(_0x460924){if(_0x460924){return _0x460924[_0x7995('0x25')]()['then'](function(){_0x350fd9[_0x7995('0x1b')](0xcc)[_0x7995('0x1c')]();});}};}function handleEntityNotFound(_0x204507,_0x285437){return function(_0x563799){if(!_0x563799){_0x204507[_0x7995('0x1a')](0x194);}return _0x563799;};}function handleError(_0x475351,_0x472195){_0x472195=_0x472195||0x1f4;return function(_0x59405a){logger[_0x7995('0x26')](_0x59405a[_0x7995('0x27')]);if(_0x59405a[_0x7995('0x28')]){delete _0x59405a[_0x7995('0x28')];}_0x475351[_0x7995('0x1b')](_0x472195)[_0x7995('0x29')](_0x59405a);};}exports['index']=function(_0x47625f,_0x5911c3){var _0x229742={},_0x49bc7e={},_0xf16cc2={'count':0x0,'rows':[]};var _0x132a42=db[_0x7995('0x2a')]['rawAttributes'];_0x49bc7e[_0x7995('0x2b')]=_['keys'](_0x132a42);_0x49bc7e[_0x7995('0x2c')]=_[_0x7995('0x2d')](_0x47625f[_0x7995('0x2c')]);_0x49bc7e['filters']=_['intersection'](_0x49bc7e['model'],_0x49bc7e[_0x7995('0x2c')]);_0x229742[_0x7995('0x2e')]=_[_0x7995('0x2f')](_0x49bc7e[_0x7995('0x2b')],qs[_0x7995('0x30')](_0x47625f[_0x7995('0x2c')]['fields']));_0x229742['attributes']=_0x229742[_0x7995('0x2e')]['length']?_0x229742[_0x7995('0x2e')]:_0x49bc7e[_0x7995('0x2b')];if(!_0x47625f[_0x7995('0x2c')][_0x7995('0x31')](_0x7995('0x32'))){_0x229742['limit']=qs[_0x7995('0x1f')](_0x47625f[_0x7995('0x2c')]['limit']);_0x229742['offset']=qs['offset'](_0x47625f[_0x7995('0x2c')][_0x7995('0x1e')]);}_0x229742['order']=qs[_0x7995('0x33')](_0x47625f['query'][_0x7995('0x33')]);_0x229742[_0x7995('0x34')]=qs[_0x7995('0x35')](_['pick'](_0x47625f['query'],_0x49bc7e[_0x7995('0x35')]));if(_0x47625f['query']['filter']){_0x229742[_0x7995('0x34')]=_[_0x7995('0x36')](_0x229742['where'],{'$or':_[_0x7995('0x37')](_0x132a42,function(_0x1922b4){if(_0x1922b4[_0x7995('0x38')][_0x7995('0x39')]!==_0x7995('0x3a')){var _0x53002a={};_0x53002a[_0x1922b4[_0x7995('0x3b')]]={'$like':'%'+_0x47625f[_0x7995('0x2c')][_0x7995('0x3c')]+'%'};return _0x53002a;}})});}_0x229742=_[_0x7995('0x36')]({},_0x229742,_0x47625f['options']);var _0x2be2c0={'where':_0x229742[_0x7995('0x34')]};return db[_0x7995('0x2a')][_0x7995('0x3d')](_0x2be2c0)[_0x7995('0x24')](function(_0x1035dc){_0xf16cc2['count']=_0x1035dc;if(_0x47625f[_0x7995('0x2c')][_0x7995('0x3e')]){_0x229742[_0x7995('0x3f')]=[{'all':!![]}];}return db[_0x7995('0x2a')][_0x7995('0x40')](_0x229742);})[_0x7995('0x24')](function(_0x14d638){_0xf16cc2[_0x7995('0x41')]=_0x14d638;return _0xf16cc2;})[_0x7995('0x24')](respondWithFilteredResult(_0x5911c3,_0x229742))[_0x7995('0x42')](handleError(_0x5911c3,null));};exports[_0x7995('0x43')]=function(_0x270d52,_0x7b4e67){var _0x53cda2={'raw':!![],'where':{'id':_0x270d52[_0x7995('0x44')]['id']}},_0x50a98e={};_0x50a98e[_0x7995('0x2b')]=_['keys'](db['AnalyticTreeReport'][_0x7995('0x45')]);_0x50a98e['query']=_['keys'](_0x270d52[_0x7995('0x2c')]);_0x50a98e[_0x7995('0x35')]=_[_0x7995('0x2f')](_0x50a98e['model'],_0x50a98e[_0x7995('0x2c')]);_0x53cda2['attributes']=_[_0x7995('0x2f')](_0x50a98e['model'],qs['fields'](_0x270d52[_0x7995('0x2c')][_0x7995('0x30')]));_0x53cda2[_0x7995('0x2e')]=_0x53cda2[_0x7995('0x2e')]['length']?_0x53cda2[_0x7995('0x2e')]:_0x50a98e[_0x7995('0x2b')];if(_0x270d52[_0x7995('0x2c')][_0x7995('0x3e')]){_0x53cda2['include']=[{'all':!![]}];}_0x53cda2=_['merge']({},_0x53cda2,_0x270d52[_0x7995('0x46')]);return db['AnalyticTreeReport'][_0x7995('0x47')](_0x53cda2)['then'](handleEntityNotFound(_0x7b4e67,null))[_0x7995('0x24')](respondWithResult(_0x7b4e67,null))['catch'](handleError(_0x7b4e67,null));};exports[_0x7995('0x48')]=function(_0x1b0373,_0x4d9245){return db[_0x7995('0x2a')][_0x7995('0x48')](_0x1b0373[_0x7995('0x49')],{})[_0x7995('0x24')](respondWithResult(_0x4d9245,0xc9))['catch'](handleError(_0x4d9245,null));};exports[_0x7995('0x4a')]=function(_0x3e787d,_0x237270){if(_0x3e787d['body']['id']){delete _0x3e787d[_0x7995('0x49')]['id'];}return db[_0x7995('0x2a')][_0x7995('0x47')]({'where':{'id':_0x3e787d[_0x7995('0x44')]['id']}})[_0x7995('0x24')](handleEntityNotFound(_0x237270,null))['then'](saveUpdates(_0x3e787d[_0x7995('0x49')],null))[_0x7995('0x24')](respondWithResult(_0x237270,null))['catch'](handleError(_0x237270,null));};exports[_0x7995('0x25')]=function(_0x5843ba,_0x1d87f9){return db[_0x7995('0x2a')][_0x7995('0x47')]({'where':{'id':_0x5843ba[_0x7995('0x44')]['id']}})[_0x7995('0x24')](handleEntityNotFound(_0x1d87f9,null))[_0x7995('0x24')](removeEntity(_0x1d87f9,null))[_0x7995('0x42')](handleError(_0x1d87f9,null));}; \ No newline at end of file +var _0x9957=['zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','limit','set','Content-Range','reject','save','then','destroy','error','stack','name','send','AnalyticTreeReport','model','query','keys','attributes','intersection','fields','hasOwnProperty','nolimit','sort','where','filters','merge','map','type','key','VIRTUAL','field','filter','count','includeAll','include','findAll','rows','catch','show','params','rawAttributes','options','find','create','body','update','html-pdf','eml-format','rimraf'];(function(_0x52502d,_0x91e73e){var _0xd3092d=function(_0x1bac9f){while(--_0x1bac9f){_0x52502d['push'](_0x52502d['shift']());}};_0xd3092d(++_0x91e73e);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'use strict';var pdf=require(_0x7995('0x0'));var emlformat=require(_0x7995('0x1'));var rimraf=require(_0x7995('0x2'));var zipdir=require(_0x7995('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7995('0x4'));var moment=require(_0x7995('0x5'));var BPromise=require(_0x7995('0x6'));var Mustache=require(_0x7995('0x7'));var util=require('util');var path=require(_0x7995('0x8'));var sox=require(_0x7995('0x9'));var csv=require(_0x7995('0xa'));var ejs=require(_0x7995('0xb'));var fs=require('fs');var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var db=require(_0x7995('0x19'))['db'];function respondWithStatusCode(_0x2cb37a,_0x19a27e){_0x19a27e=_0x19a27e||0xcc;return function(_0x385f00){if(_0x385f00){return _0x2cb37a[_0x7995('0x1a')](_0x19a27e);}return _0x2cb37a[_0x7995('0x1b')](_0x19a27e)[_0x7995('0x1c')]();};}function respondWithResult(_0x4cc004,_0x58f5ad){_0x58f5ad=_0x58f5ad||0xc8;return function(_0x2b4e94){if(_0x2b4e94){return _0x4cc004[_0x7995('0x1b')](_0x58f5ad)[_0x7995('0x1d')](_0x2b4e94);}};}function respondWithFilteredResult(_0x321ae8,_0x3f1d3e){return function(_0x1a5310){if(_0x1a5310){var _0x2202ce=_0x1a5310['count'],_0x41cbf0=_0x3f1d3e[_0x7995('0x1e')],_0x5377e5=_0x3f1d3e[_0x7995('0x1e')]+_0x3f1d3e[_0x7995('0x1f')],_0x2eeacc;if(_0x5377e5>=_0x2202ce){_0x5377e5=_0x2202ce;_0x2eeacc=0xc8;}else{_0x2eeacc=0xce;}_0x321ae8[_0x7995('0x1b')](_0x2eeacc);return _0x321ae8[_0x7995('0x20')](_0x7995('0x21'),_0x41cbf0+'-'+_0x5377e5+'/'+_0x2202ce)['json'](_0x1a5310);}return null;};}function patchUpdates(_0x54c9ae){return function(_0x2536c8){try{jsonpatch['apply'](_0x2536c8,_0x54c9ae,!![]);}catch(_0x555f74){return BPromise[_0x7995('0x22')](_0x555f74);}return _0x2536c8[_0x7995('0x23')]();};}function saveUpdates(_0x4cbe10,_0x3a9b54){return function(_0x51f276){if(_0x51f276){return _0x51f276['update'](_0x4cbe10)[_0x7995('0x24')](function(_0x327b1f){return _0x327b1f;});}return null;};}function removeEntity(_0x350fd9,_0x1a8568){return function(_0x460924){if(_0x460924){return _0x460924[_0x7995('0x25')]()['then'](function(){_0x350fd9[_0x7995('0x1b')](0xcc)[_0x7995('0x1c')]();});}};}function handleEntityNotFound(_0x204507,_0x285437){return function(_0x563799){if(!_0x563799){_0x204507[_0x7995('0x1a')](0x194);}return _0x563799;};}function handleError(_0x475351,_0x472195){_0x472195=_0x472195||0x1f4;return function(_0x59405a){logger[_0x7995('0x26')](_0x59405a[_0x7995('0x27')]);if(_0x59405a[_0x7995('0x28')]){delete _0x59405a[_0x7995('0x28')];}_0x475351[_0x7995('0x1b')](_0x472195)[_0x7995('0x29')](_0x59405a);};}exports['index']=function(_0x47625f,_0x5911c3){var _0x229742={},_0x49bc7e={},_0xf16cc2={'count':0x0,'rows':[]};var _0x132a42=db[_0x7995('0x2a')]['rawAttributes'];_0x49bc7e[_0x7995('0x2b')]=_['keys'](_0x132a42);_0x49bc7e[_0x7995('0x2c')]=_[_0x7995('0x2d')](_0x47625f[_0x7995('0x2c')]);_0x49bc7e['filters']=_['intersection'](_0x49bc7e['model'],_0x49bc7e[_0x7995('0x2c')]);_0x229742[_0x7995('0x2e')]=_[_0x7995('0x2f')](_0x49bc7e[_0x7995('0x2b')],qs[_0x7995('0x30')](_0x47625f[_0x7995('0x2c')]['fields']));_0x229742['attributes']=_0x229742[_0x7995('0x2e')]['length']?_0x229742[_0x7995('0x2e')]:_0x49bc7e[_0x7995('0x2b')];if(!_0x47625f[_0x7995('0x2c')][_0x7995('0x31')](_0x7995('0x32'))){_0x229742['limit']=qs[_0x7995('0x1f')](_0x47625f[_0x7995('0x2c')]['limit']);_0x229742['offset']=qs['offset'](_0x47625f[_0x7995('0x2c')][_0x7995('0x1e')]);}_0x229742['order']=qs[_0x7995('0x33')](_0x47625f['query'][_0x7995('0x33')]);_0x229742[_0x7995('0x34')]=qs[_0x7995('0x35')](_['pick'](_0x47625f['query'],_0x49bc7e[_0x7995('0x35')]));if(_0x47625f['query']['filter']){_0x229742[_0x7995('0x34')]=_[_0x7995('0x36')](_0x229742['where'],{'$or':_[_0x7995('0x37')](_0x132a42,function(_0x1922b4){if(_0x1922b4[_0x7995('0x38')][_0x7995('0x39')]!==_0x7995('0x3a')){var _0x53002a={};_0x53002a[_0x1922b4[_0x7995('0x3b')]]={'$like':'%'+_0x47625f[_0x7995('0x2c')][_0x7995('0x3c')]+'%'};return _0x53002a;}})});}_0x229742=_[_0x7995('0x36')]({},_0x229742,_0x47625f['options']);var _0x2be2c0={'where':_0x229742[_0x7995('0x34')]};return db[_0x7995('0x2a')][_0x7995('0x3d')](_0x2be2c0)[_0x7995('0x24')](function(_0x1035dc){_0xf16cc2['count']=_0x1035dc;if(_0x47625f[_0x7995('0x2c')][_0x7995('0x3e')]){_0x229742[_0x7995('0x3f')]=[{'all':!![]}];}return db[_0x7995('0x2a')][_0x7995('0x40')](_0x229742);})[_0x7995('0x24')](function(_0x14d638){_0xf16cc2[_0x7995('0x41')]=_0x14d638;return _0xf16cc2;})[_0x7995('0x24')](respondWithFilteredResult(_0x5911c3,_0x229742))[_0x7995('0x42')](handleError(_0x5911c3,null));};exports[_0x7995('0x43')]=function(_0x270d52,_0x7b4e67){var _0x53cda2={'raw':!![],'where':{'id':_0x270d52[_0x7995('0x44')]['id']}},_0x50a98e={};_0x50a98e[_0x7995('0x2b')]=_['keys'](db['AnalyticTreeReport'][_0x7995('0x45')]);_0x50a98e['query']=_['keys'](_0x270d52[_0x7995('0x2c')]);_0x50a98e[_0x7995('0x35')]=_[_0x7995('0x2f')](_0x50a98e['model'],_0x50a98e[_0x7995('0x2c')]);_0x53cda2['attributes']=_[_0x7995('0x2f')](_0x50a98e['model'],qs['fields'](_0x270d52[_0x7995('0x2c')][_0x7995('0x30')]));_0x53cda2[_0x7995('0x2e')]=_0x53cda2[_0x7995('0x2e')]['length']?_0x53cda2[_0x7995('0x2e')]:_0x50a98e[_0x7995('0x2b')];if(_0x270d52[_0x7995('0x2c')][_0x7995('0x3e')]){_0x53cda2['include']=[{'all':!![]}];}_0x53cda2=_['merge']({},_0x53cda2,_0x270d52[_0x7995('0x46')]);return db['AnalyticTreeReport'][_0x7995('0x47')](_0x53cda2)['then'](handleEntityNotFound(_0x7b4e67,null))[_0x7995('0x24')](respondWithResult(_0x7b4e67,null))['catch'](handleError(_0x7b4e67,null));};exports[_0x7995('0x48')]=function(_0x1b0373,_0x4d9245){return db[_0x7995('0x2a')][_0x7995('0x48')](_0x1b0373[_0x7995('0x49')],{})[_0x7995('0x24')](respondWithResult(_0x4d9245,0xc9))['catch'](handleError(_0x4d9245,null));};exports[_0x7995('0x4a')]=function(_0x3e787d,_0x237270){if(_0x3e787d['body']['id']){delete _0x3e787d[_0x7995('0x49')]['id'];}return db[_0x7995('0x2a')][_0x7995('0x47')]({'where':{'id':_0x3e787d[_0x7995('0x44')]['id']}})[_0x7995('0x24')](handleEntityNotFound(_0x237270,null))['then'](saveUpdates(_0x3e787d[_0x7995('0x49')],null))[_0x7995('0x24')](respondWithResult(_0x237270,null))['catch'](handleError(_0x237270,null));};exports[_0x7995('0x25')]=function(_0x5843ba,_0x1d87f9){return db[_0x7995('0x2a')][_0x7995('0x47')]({'where':{'id':_0x5843ba[_0x7995('0x44')]['id']}})[_0x7995('0x24')](handleEntityNotFound(_0x1d87f9,null))[_0x7995('0x24')](removeEntity(_0x1d87f9,null))[_0x7995('0x42')](handleError(_0x1d87f9,null));}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js index c248984..2ea0922 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 _0x6f44=['bluebird','request-promise','path','rimraf','../../config/environment','./analyticTreeReport.attributes','exports','define','AnalyticTreeReport','lodash','util','api','moment'];(function(_0x422506,_0x1d698c){var _0x5699d1=function(_0x382d7d){while(--_0x382d7d){_0x422506['push'](_0x422506['shift']());}};_0x5699d1(++_0x1d698c);}(_0x6f44,0x1ea));var _0x46f4=function(_0x5853fe,_0x338eb7){_0x5853fe=_0x5853fe-0x0;var _0x251e6f=_0x6f44[_0x5853fe];return _0x251e6f;};'use strict';var _=require(_0x46f4('0x0'));var util=require(_0x46f4('0x1'));var logger=require('../../config/logger')(_0x46f4('0x2'));var moment=require(_0x46f4('0x3'));var BPromise=require(_0x46f4('0x4'));var rp=require(_0x46f4('0x5'));var fs=require('fs');var path=require(_0x46f4('0x6'));var rimraf=require(_0x46f4('0x7'));var config=require(_0x46f4('0x8'));var attributes=require(_0x46f4('0x9'));module[_0x46f4('0xa')]=function(_0x57f1a9,_0x169a5a){return _0x57f1a9[_0x46f4('0xb')](_0x46f4('0xc'),attributes,{'tableName':'analytics_report_trees','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfa9f=['moment','bluebird','path','../../config/environment','./analyticTreeReport.attributes','AnalyticTreeReport','analytics_report_trees','util','../../config/logger','api'];(function(_0x350258,_0x4e0a50){var _0x3714b3=function(_0x8918f7){while(--_0x8918f7){_0x350258['push'](_0x350258['shift']());}};_0x3714b3(++_0x4e0a50);}(_0xfa9f,0x93));var _0xffa9=function(_0x3c504b,_0x437693){_0x3c504b=_0x3c504b-0x0;var _0x2e5354=_0xfa9f[_0x3c504b];return _0x2e5354;};'use strict';var _=require('lodash');var util=require(_0xffa9('0x0'));var logger=require(_0xffa9('0x1'))(_0xffa9('0x2'));var moment=require(_0xffa9('0x3'));var BPromise=require(_0xffa9('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xffa9('0x5'));var rimraf=require('rimraf');var config=require(_0xffa9('0x6'));var attributes=require(_0xffa9('0x7'));module['exports']=function(_0xf1a9c6,_0x4fb309){return _0xf1a9c6['define'](_0xffa9('0x8'),attributes,{'tableName':_0xffa9('0x9'),'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 24e9b78..74bec75 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 _0xed26=['http','request','then','info','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/environment'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0xed26,0xa1));var _0x6ed2=function(_0x2cb21c,_0x4f6028){_0x2cb21c=_0x2cb21c-0x0;var _0x23ea2b=_0xed26[_0x2cb21c];return _0x23ea2b;};'use strict';var _=require(_0x6ed2('0x0'));var util=require(_0x6ed2('0x1'));var moment=require(_0x6ed2('0x2'));var BPromise=require(_0x6ed2('0x3'));var rs=require(_0x6ed2('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x6ed2('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x6ed2('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x6ed2('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x355b08,_0xfc060c,_0x48b99d){return new BPromise(function(_0x5d7e35,_0x42fddc){return client[_0x6ed2('0x8')](_0x355b08,_0x48b99d)[_0x6ed2('0x9')](function(_0x3f495f){logger[_0x6ed2('0xa')](_0x6ed2('0xb'),_0xfc060c,_0x6ed2('0xc'));logger[_0x6ed2('0xd')](_0x6ed2('0xe'),_0xfc060c,'request\x20sent',JSON[_0x6ed2('0xf')](_0x3f495f));if(_0x3f495f[_0x6ed2('0x10')]){if(_0x3f495f[_0x6ed2('0x10')][_0x6ed2('0x11')]===0x1f4){logger[_0x6ed2('0x10')](_0x6ed2('0xb'),_0xfc060c,_0x3f495f['error']['message']);return _0x42fddc(_0x3f495f['error'][_0x6ed2('0x12')]);}logger[_0x6ed2('0x10')](_0x6ed2('0xb'),_0xfc060c,_0x3f495f[_0x6ed2('0x10')][_0x6ed2('0x12')]);return _0x5d7e35(_0x3f495f[_0x6ed2('0x10')][_0x6ed2('0x12')]);}else{logger[_0x6ed2('0xa')](_0x6ed2('0xb'),_0xfc060c,_0x6ed2('0xc'));_0x5d7e35(_0x3f495f[_0x6ed2('0x13')][_0x6ed2('0x12')]);}})[_0x6ed2('0x14')](function(_0x4969cb){logger[_0x6ed2('0x10')](_0x6ed2('0xb'),_0xfc060c,_0x4969cb);_0x42fddc(_0x4969cb);});});} \ No newline at end of file +var _0xbe1e=['request\x20sent','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','AnalyticTreeReport,\x20%s,\x20%s','debug'];(function(_0x1667df,_0x266940){var _0x341abf=function(_0x123c3f){while(--_0x123c3f){_0x1667df['push'](_0x1667df['shift']());}};_0x341abf(++_0x266940);}(_0xbe1e,0x1a9));var _0xebe1=function(_0x1751b3,_0x20798b){_0x1751b3=_0x1751b3-0x0;var _0x1090e5=_0xbe1e[_0x1751b3];return _0x1090e5;};'use strict';var _=require(_0xebe1('0x0'));var util=require(_0xebe1('0x1'));var moment=require('moment');var BPromise=require(_0xebe1('0x2'));var rs=require(_0xebe1('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xebe1('0x4'))['db'];var utils=require(_0xebe1('0x5'));var logger=require(_0xebe1('0x6'))(_0xebe1('0x7'));var config=require(_0xebe1('0x8'));var jayson=require(_0xebe1('0x9'));var client=jayson[_0xebe1('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4d2e4c,_0x1e5637,_0x1c925d){return new BPromise(function(_0x3bea6b,_0x3b8a2a){return client[_0xebe1('0xb')](_0x4d2e4c,_0x1c925d)['then'](function(_0x3c07b4){logger[_0xebe1('0xc')](_0xebe1('0xd'),_0x1e5637,'request\x20sent');logger[_0xebe1('0xe')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x1e5637,_0xebe1('0xf'),JSON[_0xebe1('0x10')](_0x3c07b4));if(_0x3c07b4[_0xebe1('0x11')]){if(_0x3c07b4['error'][_0xebe1('0x12')]===0x1f4){logger[_0xebe1('0x11')](_0xebe1('0xd'),_0x1e5637,_0x3c07b4[_0xebe1('0x11')][_0xebe1('0x13')]);return _0x3b8a2a(_0x3c07b4[_0xebe1('0x11')][_0xebe1('0x13')]);}logger['error'](_0xebe1('0xd'),_0x1e5637,_0x3c07b4[_0xebe1('0x11')]['message']);return _0x3bea6b(_0x3c07b4['error']['message']);}else{logger[_0xebe1('0xc')](_0xebe1('0xd'),_0x1e5637,_0xebe1('0xf'));_0x3bea6b(_0x3c07b4[_0xebe1('0x14')][_0xebe1('0x13')]);}})[_0xebe1('0x15')](function(_0x68b97d){logger['error'](_0xebe1('0xd'),_0x1e5637,_0x68b97d);_0x3b8a2a(_0x68b97d);});});} \ No newline at end of file diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js index 4c4d00d..c7103ad 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 _0x8711=['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(_0x1c2708,_0x7ad2a3){var _0x41a1ed=function(_0x4916d7){while(--_0x4916d7){_0x1c2708['push'](_0x1c2708['shift']());}};_0x41a1ed(++_0x7ad2a3);}(_0x8711,0x1b9));var _0x1871=function(_0x1d7c54,_0x1ac0f7){_0x1d7c54=_0x1d7c54-0x0;var _0xdd6e7a=_0x8711[_0x1d7c54];return _0xdd6e7a;};'use strict';var multer=require(_0x1871('0x0'));var util=require(_0x1871('0x1'));var path=require(_0x1871('0x2'));var timeout=require(_0x1871('0x3'));var express=require(_0x1871('0x4'));var router=express[_0x1871('0x5')]();var auth=require(_0x1871('0x6'));var interaction=require(_0x1871('0x7'));var config=require(_0x1871('0x8'));var controller=require(_0x1871('0x9'));router[_0x1871('0xa')]('/',auth[_0x1871('0xb')](),controller['index']);router[_0x1871('0xa')](_0x1871('0xc'),auth[_0x1871('0xb')](),controller[_0x1871('0xd')]);router[_0x1871('0xe')]('/',auth[_0x1871('0xb')](),controller[_0x1871('0xf')]);router[_0x1871('0x10')]('/:id',auth[_0x1871('0xb')](),controller[_0x1871('0x11')]);router[_0x1871('0x12')](_0x1871('0xc'),auth['isAuthenticated'](),controller[_0x1871('0x13')]);module[_0x1871('0x14')]=router; \ No newline at end of file +var _0x78be=['../../components/auth/service','../../config/environment','./analyticTreeReport.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','destroy','exports','multer','util','path','connect-timeout','Router'];(function(_0x598a7c,_0x419f29){var _0x468a5b=function(_0x410715){while(--_0x410715){_0x598a7c['push'](_0x598a7c['shift']());}};_0x468a5b(++_0x419f29);}(_0x78be,0x151));var _0xe78b=function(_0x189c4d,_0x52e64c){_0x189c4d=_0x189c4d-0x0;var _0x5afe30=_0x78be[_0x189c4d];return _0x5afe30;};'use strict';var multer=require(_0xe78b('0x0'));var util=require(_0xe78b('0x1'));var path=require(_0xe78b('0x2'));var timeout=require(_0xe78b('0x3'));var express=require('express');var router=express[_0xe78b('0x4')]();var auth=require(_0xe78b('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xe78b('0x6'));var controller=require(_0xe78b('0x7'));router[_0xe78b('0x8')]('/',auth[_0xe78b('0x9')](),controller[_0xe78b('0xa')]);router['get'](_0xe78b('0xb'),auth[_0xe78b('0x9')](),controller[_0xe78b('0xc')]);router[_0xe78b('0xd')]('/',auth['isAuthenticated'](),controller[_0xe78b('0xe')]);router[_0xe78b('0xf')]('/:id',auth[_0xe78b('0x9')](),controller[_0xe78b('0x10')]);router['delete'](_0xe78b('0xb'),auth[_0xe78b('0x9')](),controller[_0xe78b('0x11')]);module[_0xe78b('0x12')]=router; \ No newline at end of file diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js index f7170fc..38248ed 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 _0x549e=['exports','STRING','sequelize'];(function(_0x11005e,_0x20c3d2){var _0x29338f=function(_0x3384e9){while(--_0x3384e9){_0x11005e['push'](_0x11005e['shift']());}};_0x29338f(++_0x20c3d2);}(_0x549e,0x1e5));var _0xe549=function(_0x3483fb,_0x2141e6){_0x3483fb=_0x3483fb-0x0;var _0x4ab723=_0x549e[_0x3483fb];return _0x4ab723;};'use strict';var Sequelize=require(_0xe549('0x0'));module[_0xe549('0x1')]={'name':{'type':Sequelize[_0xe549('0x2')]},'basename':{'type':Sequelize[_0xe549('0x2')]},'type':{'type':Sequelize[_0xe549('0x2')]}}; \ No newline at end of file +var _0x3e17=['sequelize','exports','STRING'];(function(_0x521929,_0x479be5){var _0x632436=function(_0x288290){while(--_0x288290){_0x521929['push'](_0x521929['shift']());}};_0x632436(++_0x479be5);}(_0x3e17,0xff));var _0x73e1=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x3e17[_0x4a9fb1];return _0x348672;};'use strict';var Sequelize=require(_0x73e1('0x0'));module[_0x73e1('0x1')]={'name':{'type':Sequelize[_0x73e1('0x2')]},'basename':{'type':Sequelize[_0x73e1('0x2')]},'type':{'type':Sequelize[_0x73e1('0x2')]}}; \ No newline at end of file diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js index b90ef2c..0c602e1 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 _0xabfb=['crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','json','count','offset','limit','status','set','Content-Range','save','update','then','destroy','error','stack','name','send','Attachment','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','map','type','key','VIRTUAL','field','options','include','findAll','rows','catch','show','rawAttributes','includeAll','find','body','params','create','file','originalname','basename','filename','mimetype','download','findOne','join','root','server/files/attachments/','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','lodash'];(function(_0x187d80,_0x5b793f){var _0x498a77=function(_0x633dc9){while(--_0x633dc9){_0x187d80['push'](_0x187d80['shift']());}};_0x498a77(++_0x5b793f);}(_0xabfb,0xf4));var _0xbabf=function(_0x7b173,_0x539d7f){_0x7b173=_0x7b173-0x0;var _0x1c598c=_0xabfb[_0x7b173];return _0x1c598c;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xbabf('0x0'));var rimraf=require(_0xbabf('0x1'));var zipdir=require(_0xbabf('0x2'));var jsonpatch=require(_0xbabf('0x3'));var rp=require(_0xbabf('0x4'));var moment=require(_0xbabf('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xbabf('0x6'));var path=require(_0xbabf('0x7'));var sox=require(_0xbabf('0x8'));var csv=require(_0xbabf('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xbabf('0xa'));var squel=require('squel');var crypto=require(_0xbabf('0xb'));var jsforce=require(_0xbabf('0xc'));var deskjs=require(_0xbabf('0xd'));var toCsv=require('to-csv');var querystring=require(_0xbabf('0xe'));var Papa=require(_0xbabf('0xf'));var Redis=require(_0xbabf('0x10'));var authService=require(_0xbabf('0x11'));var qs=require(_0xbabf('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbabf('0x13'));var logger=require(_0xbabf('0x14'))(_0xbabf('0x15'));var utils=require(_0xbabf('0x16'));var config=require(_0xbabf('0x17'));var db=require(_0xbabf('0x18'))['db'];function respondWithStatusCode(_0x260680,_0x4209b0){_0x4209b0=_0x4209b0||0xcc;return function(_0x3e2a3d){if(_0x3e2a3d){return _0x260680[_0xbabf('0x19')](_0x4209b0);}return _0x260680['status'](_0x4209b0)[_0xbabf('0x1a')]();};}function respondWithResult(_0x131c36,_0x4e2cd2){_0x4e2cd2=_0x4e2cd2||0xc8;return function(_0x4212ab){if(_0x4212ab){return _0x131c36['status'](_0x4e2cd2)[_0xbabf('0x1b')](_0x4212ab);}};}function respondWithFilteredResult(_0x50be86,_0x1e327c){return function(_0x506d99){if(_0x506d99){var _0x2e0c23=_0x506d99[_0xbabf('0x1c')],_0x33769f=_0x1e327c['offset'],_0x2e4d69=_0x1e327c[_0xbabf('0x1d')]+_0x1e327c[_0xbabf('0x1e')],_0x67bf59;if(_0x2e4d69>=_0x2e0c23){_0x2e4d69=_0x2e0c23;_0x67bf59=0xc8;}else{_0x67bf59=0xce;}_0x50be86[_0xbabf('0x1f')](_0x67bf59);return _0x50be86[_0xbabf('0x20')](_0xbabf('0x21'),_0x33769f+'-'+_0x2e4d69+'/'+_0x2e0c23)[_0xbabf('0x1b')](_0x506d99);}return null;};}function patchUpdates(_0x2c857b){return function(_0x199679){try{jsonpatch['apply'](_0x199679,_0x2c857b,!![]);}catch(_0x14d885){return BPromise['reject'](_0x14d885);}return _0x199679[_0xbabf('0x22')]();};}function saveUpdates(_0xbfdb4b,_0x4acab2){return function(_0x229252){if(_0x229252){return _0x229252[_0xbabf('0x23')](_0xbfdb4b)[_0xbabf('0x24')](function(_0x5a3c9f){return _0x5a3c9f;});}return null;};}function removeEntity(_0xe43119,_0x4d3b06){return function(_0x59cb9a){if(_0x59cb9a){return _0x59cb9a[_0xbabf('0x25')]()[_0xbabf('0x24')](function(){_0xe43119[_0xbabf('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5e5c5a,_0x5bf480){return function(_0x4e8325){if(!_0x4e8325){_0x5e5c5a[_0xbabf('0x19')](0x194);}return _0x4e8325;};}function handleError(_0x218d22,_0x501a26){_0x501a26=_0x501a26||0x1f4;return function(_0x3f892a){logger[_0xbabf('0x26')](_0x3f892a[_0xbabf('0x27')]);if(_0x3f892a['name']){delete _0x3f892a[_0xbabf('0x28')];}_0x218d22['status'](_0x501a26)[_0xbabf('0x29')](_0x3f892a);};}exports['index']=function(_0x482755,_0xa6ab3f){var _0x34e0b6={},_0x164245={},_0x530d62={'count':0x0,'rows':[]};var _0x6a0231=db[_0xbabf('0x2a')]['rawAttributes'];_0x164245[_0xbabf('0x2b')]=_[_0xbabf('0x2c')](_0x6a0231);_0x164245['query']=_[_0xbabf('0x2c')](_0x482755[_0xbabf('0x2d')]);_0x164245[_0xbabf('0x2e')]=_[_0xbabf('0x2f')](_0x164245['model'],_0x164245[_0xbabf('0x2d')]);_0x34e0b6[_0xbabf('0x30')]=_['intersection'](_0x164245[_0xbabf('0x2b')],qs[_0xbabf('0x31')](_0x482755[_0xbabf('0x2d')][_0xbabf('0x31')]));_0x34e0b6[_0xbabf('0x30')]=_0x34e0b6[_0xbabf('0x30')]['length']?_0x34e0b6[_0xbabf('0x30')]:_0x164245['model'];if(!_0x482755['query'][_0xbabf('0x32')](_0xbabf('0x33'))){_0x34e0b6[_0xbabf('0x1e')]=qs['limit'](_0x482755[_0xbabf('0x2d')][_0xbabf('0x1e')]);_0x34e0b6[_0xbabf('0x1d')]=qs[_0xbabf('0x1d')](_0x482755[_0xbabf('0x2d')][_0xbabf('0x1d')]);}_0x34e0b6[_0xbabf('0x34')]=qs[_0xbabf('0x35')](_0x482755[_0xbabf('0x2d')]['sort']);_0x34e0b6['where']=qs[_0xbabf('0x2e')](_[_0xbabf('0x36')](_0x482755[_0xbabf('0x2d')],_0x164245[_0xbabf('0x2e')]));if(_0x482755['query'][_0xbabf('0x37')]){_0x34e0b6[_0xbabf('0x38')]=_[_0xbabf('0x39')](_0x34e0b6[_0xbabf('0x38')],{'$or':_[_0xbabf('0x3a')](_0x6a0231,function(_0x2bce16){if(_0x2bce16[_0xbabf('0x3b')][_0xbabf('0x3c')]!==_0xbabf('0x3d')){var _0x41108c={};_0x41108c[_0x2bce16[_0xbabf('0x3e')]]={'$like':'%'+_0x482755[_0xbabf('0x2d')][_0xbabf('0x37')]+'%'};return _0x41108c;}})});}_0x34e0b6=_['merge']({},_0x34e0b6,_0x482755[_0xbabf('0x3f')]);var _0x3b8307={'where':_0x34e0b6[_0xbabf('0x38')]};return db[_0xbabf('0x2a')]['count'](_0x3b8307)[_0xbabf('0x24')](function(_0x4acc58){_0x530d62[_0xbabf('0x1c')]=_0x4acc58;if(_0x482755[_0xbabf('0x2d')]['includeAll']){_0x34e0b6[_0xbabf('0x40')]=[{'all':!![]}];}return db[_0xbabf('0x2a')][_0xbabf('0x41')](_0x34e0b6);})[_0xbabf('0x24')](function(_0x8a1a27){_0x530d62[_0xbabf('0x42')]=_0x8a1a27;return _0x530d62;})[_0xbabf('0x24')](respondWithFilteredResult(_0xa6ab3f,_0x34e0b6))[_0xbabf('0x43')](handleError(_0xa6ab3f,null));};exports[_0xbabf('0x44')]=function(_0x18dcd4,_0x50691a){var _0x255fba={'raw':!![],'where':{'id':_0x18dcd4['params']['id']}},_0x3f2229={};_0x3f2229[_0xbabf('0x2b')]=_[_0xbabf('0x2c')](db[_0xbabf('0x2a')][_0xbabf('0x45')]);_0x3f2229['query']=_[_0xbabf('0x2c')](_0x18dcd4[_0xbabf('0x2d')]);_0x3f2229[_0xbabf('0x2e')]=_[_0xbabf('0x2f')](_0x3f2229[_0xbabf('0x2b')],_0x3f2229[_0xbabf('0x2d')]);_0x255fba[_0xbabf('0x30')]=_['intersection'](_0x3f2229[_0xbabf('0x2b')],qs['fields'](_0x18dcd4[_0xbabf('0x2d')]['fields']));_0x255fba['attributes']=_0x255fba[_0xbabf('0x30')]['length']?_0x255fba[_0xbabf('0x30')]:_0x3f2229[_0xbabf('0x2b')];if(_0x18dcd4[_0xbabf('0x2d')][_0xbabf('0x46')]){_0x255fba[_0xbabf('0x40')]=[{'all':!![]}];}_0x255fba=_[_0xbabf('0x39')]({},_0x255fba,_0x18dcd4[_0xbabf('0x3f')]);return db[_0xbabf('0x2a')][_0xbabf('0x47')](_0x255fba)[_0xbabf('0x24')](handleEntityNotFound(_0x50691a,null))[_0xbabf('0x24')](respondWithResult(_0x50691a,null))[_0xbabf('0x43')](handleError(_0x50691a,null));};exports[_0xbabf('0x23')]=function(_0x5a75b3,_0x550479){if(_0x5a75b3[_0xbabf('0x48')]['id']){delete _0x5a75b3[_0xbabf('0x48')]['id'];}return db[_0xbabf('0x2a')][_0xbabf('0x47')]({'where':{'id':_0x5a75b3['params']['id']}})['then'](handleEntityNotFound(_0x550479,null))[_0xbabf('0x24')](saveUpdates(_0x5a75b3['body'],null))[_0xbabf('0x24')](respondWithResult(_0x550479,null))[_0xbabf('0x43')](handleError(_0x550479,null));};exports[_0xbabf('0x25')]=function(_0x272d4a,_0x43b73d){return db[_0xbabf('0x2a')][_0xbabf('0x47')]({'where':{'id':_0x272d4a[_0xbabf('0x49')]['id']}})['then'](handleEntityNotFound(_0x43b73d,null))[_0xbabf('0x24')](removeEntity(_0x43b73d,null))['catch'](handleError(_0x43b73d,null));};exports[_0xbabf('0x4a')]=function(_0x4584bf,_0x2ef3b0,_0x1d7919){_0x4584bf[_0xbabf('0x48')][_0xbabf('0x28')]=_0x4584bf[_0xbabf('0x4b')][_0xbabf('0x4c')];_0x4584bf[_0xbabf('0x48')][_0xbabf('0x4d')]=_0x4584bf['file'][_0xbabf('0x4e')];_0x4584bf[_0xbabf('0x48')][_0xbabf('0x3b')]=_0x4584bf[_0xbabf('0x4b')][_0xbabf('0x4f')];return db[_0xbabf('0x2a')][_0xbabf('0x4a')](_0x4584bf[_0xbabf('0x48')])[_0xbabf('0x24')](respondWithResult(_0x2ef3b0,0xc9))[_0xbabf('0x43')](handleError(_0x2ef3b0,null));};exports[_0xbabf('0x50')]=function(_0x434a8b,_0x4126de,_0x4f0424){return db[_0xbabf('0x2a')][_0xbabf('0x51')]({'where':{'id':_0x434a8b[_0xbabf('0x49')]['id']},'raw':!![]})[_0xbabf('0x24')](handleEntityNotFound(_0x4126de,null))['then'](function(_0x11d892){if(_0x11d892){return _0x4126de[_0xbabf('0x50')](path[_0xbabf('0x52')](config[_0xbabf('0x53')],_0xbabf('0x54'),_0x11d892[_0xbabf('0x4d')]));}})[_0xbabf('0x43')](handleError(_0x4126de,null));}; \ No newline at end of file +var _0xe673=['rawAttributes','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','merge','map','type','key','filter','options','include','findAll','rows','catch','show','keys','find','params','body','create','originalname','filename','file','findOne','download','join','root','server/files/attachments/','basename','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','sendStatus','status','end','json','count','offset','limit','reject','save','update','then','destroy','name','send','index','Attachment'];(function(_0x12d0c2,_0x420ee2){var _0x3867fd=function(_0x31182e){while(--_0x31182e){_0x12d0c2['push'](_0x12d0c2['shift']());}};_0x3867fd(++_0x420ee2);}(_0xe673,0x151));var _0x3e67=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xe673[_0x42cae2];return _0x5f256f;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x3e67('0x0'));var rimraf=require(_0x3e67('0x1'));var zipdir=require(_0x3e67('0x2'));var jsonpatch=require(_0x3e67('0x3'));var rp=require('request-promise');var moment=require(_0x3e67('0x4'));var BPromise=require(_0x3e67('0x5'));var Mustache=require(_0x3e67('0x6'));var util=require('util');var path=require(_0x3e67('0x7'));var sox=require(_0x3e67('0x8'));var csv=require(_0x3e67('0x9'));var ejs=require(_0x3e67('0xa'));var fs=require('fs');var _=require(_0x3e67('0xb'));var squel=require('squel');var crypto=require(_0x3e67('0xc'));var jsforce=require(_0x3e67('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x3e67('0xe'));var Papa=require(_0x3e67('0xf'));var Redis=require(_0x3e67('0x10'));var authService=require(_0x3e67('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x3e67('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3e67('0x13'))(_0x3e67('0x14'));var utils=require('../../config/utils');var config=require(_0x3e67('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2e602a,_0x1209d8){_0x1209d8=_0x1209d8||0xcc;return function(_0x3ec801){if(_0x3ec801){return _0x2e602a[_0x3e67('0x16')](_0x1209d8);}return _0x2e602a[_0x3e67('0x17')](_0x1209d8)[_0x3e67('0x18')]();};}function respondWithResult(_0x1ff1e6,_0x1c89d1){_0x1c89d1=_0x1c89d1||0xc8;return function(_0xad30c6){if(_0xad30c6){return _0x1ff1e6[_0x3e67('0x17')](_0x1c89d1)[_0x3e67('0x19')](_0xad30c6);}};}function respondWithFilteredResult(_0x4cdbcf,_0x251c49){return function(_0x2e040b){if(_0x2e040b){var _0x25e98e=_0x2e040b[_0x3e67('0x1a')],_0x256592=_0x251c49[_0x3e67('0x1b')],_0x366a9b=_0x251c49[_0x3e67('0x1b')]+_0x251c49[_0x3e67('0x1c')],_0x5e3f98;if(_0x366a9b>=_0x25e98e){_0x366a9b=_0x25e98e;_0x5e3f98=0xc8;}else{_0x5e3f98=0xce;}_0x4cdbcf[_0x3e67('0x17')](_0x5e3f98);return _0x4cdbcf['set']('Content-Range',_0x256592+'-'+_0x366a9b+'/'+_0x25e98e)[_0x3e67('0x19')](_0x2e040b);}return null;};}function patchUpdates(_0xa9bf64){return function(_0x3a6d0a){try{jsonpatch['apply'](_0x3a6d0a,_0xa9bf64,!![]);}catch(_0x40b562){return BPromise[_0x3e67('0x1d')](_0x40b562);}return _0x3a6d0a[_0x3e67('0x1e')]();};}function saveUpdates(_0x11b7b8,_0x26d2f1){return function(_0x4888f4){if(_0x4888f4){return _0x4888f4[_0x3e67('0x1f')](_0x11b7b8)[_0x3e67('0x20')](function(_0x46bf5d){return _0x46bf5d;});}return null;};}function removeEntity(_0x24ab54,_0x53c934){return function(_0xf4a5d0){if(_0xf4a5d0){return _0xf4a5d0[_0x3e67('0x21')]()[_0x3e67('0x20')](function(){_0x24ab54['status'](0xcc)[_0x3e67('0x18')]();});}};}function handleEntityNotFound(_0x59b23e,_0x49b290){return function(_0x3bc27f){if(!_0x3bc27f){_0x59b23e[_0x3e67('0x16')](0x194);}return _0x3bc27f;};}function handleError(_0x4d61ff,_0x24896b){_0x24896b=_0x24896b||0x1f4;return function(_0x201f0c){logger['error'](_0x201f0c['stack']);if(_0x201f0c[_0x3e67('0x22')]){delete _0x201f0c[_0x3e67('0x22')];}_0x4d61ff['status'](_0x24896b)[_0x3e67('0x23')](_0x201f0c);};}exports[_0x3e67('0x24')]=function(_0x5679d0,_0x333ec7){var _0x349144={},_0x410f97={},_0x53d0ba={'count':0x0,'rows':[]};var _0x3abb5e=db[_0x3e67('0x25')][_0x3e67('0x26')];_0x410f97[_0x3e67('0x27')]=_['keys'](_0x3abb5e);_0x410f97[_0x3e67('0x28')]=_['keys'](_0x5679d0[_0x3e67('0x28')]);_0x410f97[_0x3e67('0x29')]=_[_0x3e67('0x2a')](_0x410f97[_0x3e67('0x27')],_0x410f97[_0x3e67('0x28')]);_0x349144[_0x3e67('0x2b')]=_['intersection'](_0x410f97[_0x3e67('0x27')],qs[_0x3e67('0x2c')](_0x5679d0[_0x3e67('0x28')][_0x3e67('0x2c')]));_0x349144[_0x3e67('0x2b')]=_0x349144[_0x3e67('0x2b')][_0x3e67('0x2d')]?_0x349144[_0x3e67('0x2b')]:_0x410f97[_0x3e67('0x27')];if(!_0x5679d0['query'][_0x3e67('0x2e')]('nolimit')){_0x349144['limit']=qs[_0x3e67('0x1c')](_0x5679d0[_0x3e67('0x28')][_0x3e67('0x1c')]);_0x349144[_0x3e67('0x1b')]=qs[_0x3e67('0x1b')](_0x5679d0[_0x3e67('0x28')][_0x3e67('0x1b')]);}_0x349144['order']=qs['sort'](_0x5679d0['query'][_0x3e67('0x2f')]);_0x349144[_0x3e67('0x30')]=qs['filters'](_[_0x3e67('0x31')](_0x5679d0[_0x3e67('0x28')],_0x410f97[_0x3e67('0x29')]));if(_0x5679d0['query']['filter']){_0x349144[_0x3e67('0x30')]=_[_0x3e67('0x32')](_0x349144['where'],{'$or':_[_0x3e67('0x33')](_0x3abb5e,function(_0xa9c96b){if(_0xa9c96b[_0x3e67('0x34')][_0x3e67('0x35')]!=='VIRTUAL'){var _0x404545={};_0x404545[_0xa9c96b['field']]={'$like':'%'+_0x5679d0[_0x3e67('0x28')][_0x3e67('0x36')]+'%'};return _0x404545;}})});}_0x349144=_[_0x3e67('0x32')]({},_0x349144,_0x5679d0[_0x3e67('0x37')]);var _0x3f800a={'where':_0x349144[_0x3e67('0x30')]};return db['Attachment']['count'](_0x3f800a)[_0x3e67('0x20')](function(_0x1f11b6){_0x53d0ba[_0x3e67('0x1a')]=_0x1f11b6;if(_0x5679d0[_0x3e67('0x28')]['includeAll']){_0x349144[_0x3e67('0x38')]=[{'all':!![]}];}return db[_0x3e67('0x25')][_0x3e67('0x39')](_0x349144);})[_0x3e67('0x20')](function(_0x43aeca){_0x53d0ba[_0x3e67('0x3a')]=_0x43aeca;return _0x53d0ba;})[_0x3e67('0x20')](respondWithFilteredResult(_0x333ec7,_0x349144))[_0x3e67('0x3b')](handleError(_0x333ec7,null));};exports[_0x3e67('0x3c')]=function(_0x2bffca,_0x5c4df9){var _0x5788b4={'raw':!![],'where':{'id':_0x2bffca['params']['id']}},_0x5ffbb6={};_0x5ffbb6[_0x3e67('0x27')]=_['keys'](db[_0x3e67('0x25')]['rawAttributes']);_0x5ffbb6[_0x3e67('0x28')]=_[_0x3e67('0x3d')](_0x2bffca[_0x3e67('0x28')]);_0x5ffbb6[_0x3e67('0x29')]=_[_0x3e67('0x2a')](_0x5ffbb6[_0x3e67('0x27')],_0x5ffbb6[_0x3e67('0x28')]);_0x5788b4['attributes']=_[_0x3e67('0x2a')](_0x5ffbb6[_0x3e67('0x27')],qs[_0x3e67('0x2c')](_0x2bffca[_0x3e67('0x28')][_0x3e67('0x2c')]));_0x5788b4[_0x3e67('0x2b')]=_0x5788b4['attributes'][_0x3e67('0x2d')]?_0x5788b4[_0x3e67('0x2b')]:_0x5ffbb6[_0x3e67('0x27')];if(_0x2bffca['query']['includeAll']){_0x5788b4['include']=[{'all':!![]}];}_0x5788b4=_['merge']({},_0x5788b4,_0x2bffca[_0x3e67('0x37')]);return db[_0x3e67('0x25')][_0x3e67('0x3e')](_0x5788b4)[_0x3e67('0x20')](handleEntityNotFound(_0x5c4df9,null))[_0x3e67('0x20')](respondWithResult(_0x5c4df9,null))[_0x3e67('0x3b')](handleError(_0x5c4df9,null));};exports[_0x3e67('0x1f')]=function(_0x56e040,_0x45096c){if(_0x56e040['body']['id']){delete _0x56e040['body']['id'];}return db[_0x3e67('0x25')][_0x3e67('0x3e')]({'where':{'id':_0x56e040[_0x3e67('0x3f')]['id']}})[_0x3e67('0x20')](handleEntityNotFound(_0x45096c,null))[_0x3e67('0x20')](saveUpdates(_0x56e040[_0x3e67('0x40')],null))['then'](respondWithResult(_0x45096c,null))[_0x3e67('0x3b')](handleError(_0x45096c,null));};exports[_0x3e67('0x21')]=function(_0x27210c,_0x4a8daa){return db[_0x3e67('0x25')]['find']({'where':{'id':_0x27210c[_0x3e67('0x3f')]['id']}})['then'](handleEntityNotFound(_0x4a8daa,null))[_0x3e67('0x20')](removeEntity(_0x4a8daa,null))[_0x3e67('0x3b')](handleError(_0x4a8daa,null));};exports[_0x3e67('0x41')]=function(_0x20d37e,_0x336c28,_0x55e98b){_0x20d37e[_0x3e67('0x40')][_0x3e67('0x22')]=_0x20d37e['file'][_0x3e67('0x42')];_0x20d37e[_0x3e67('0x40')]['basename']=_0x20d37e['file'][_0x3e67('0x43')];_0x20d37e['body'][_0x3e67('0x34')]=_0x20d37e[_0x3e67('0x44')]['mimetype'];return db[_0x3e67('0x25')][_0x3e67('0x41')](_0x20d37e['body'])['then'](respondWithResult(_0x336c28,0xc9))[_0x3e67('0x3b')](handleError(_0x336c28,null));};exports['download']=function(_0x3845ae,_0x32706d,_0x101599){return db[_0x3e67('0x25')][_0x3e67('0x45')]({'where':{'id':_0x3845ae[_0x3e67('0x3f')]['id']},'raw':!![]})[_0x3e67('0x20')](handleEntityNotFound(_0x32706d,null))[_0x3e67('0x20')](function(_0x1b096a){if(_0x1b096a){return _0x32706d[_0x3e67('0x46')](path[_0x3e67('0x47')](config[_0x3e67('0x48')],_0x3e67('0x49'),_0x1b096a[_0x3e67('0x4a')]));}})[_0x3e67('0x3b')](handleError(_0x32706d,null));}; \ No newline at end of file diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js index 452967b..e6c69eb 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 _0x02a7=['Attachment','attachments','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./attachment.attributes'];(function(_0x4f6f91,_0x350d77){var _0x19be71=function(_0x7f0b0d){while(--_0x7f0b0d){_0x4f6f91['push'](_0x4f6f91['shift']());}};_0x19be71(++_0x350d77);}(_0x02a7,0x1a6));var _0x702a=function(_0x30b9ec,_0x3cb903){_0x30b9ec=_0x30b9ec-0x0;var _0x33a019=_0x02a7[_0x30b9ec];return _0x33a019;};'use strict';var _=require('lodash');var util=require(_0x702a('0x0'));var logger=require(_0x702a('0x1'))(_0x702a('0x2'));var moment=require(_0x702a('0x3'));var BPromise=require(_0x702a('0x4'));var rp=require(_0x702a('0x5'));var fs=require('fs');var path=require(_0x702a('0x6'));var rimraf=require(_0x702a('0x7'));var config=require(_0x702a('0x8'));var attributes=require(_0x702a('0x9'));module['exports']=function(_0x4d3e8a,_0x804234){return _0x4d3e8a['define'](_0x702a('0xa'),attributes,{'tableName':_0x702a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8d62=['attachments','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./attachment.attributes','exports','define'];(function(_0x6da0a4,_0x45595b){var _0x5cd603=function(_0x40c93e){while(--_0x40c93e){_0x6da0a4['push'](_0x6da0a4['shift']());}};_0x5cd603(++_0x45595b);}(_0x8d62,0xf8));var _0x28d6=function(_0xb2a550,_0x5ee869){_0xb2a550=_0xb2a550-0x0;var _0x27254d=_0x8d62[_0xb2a550];return _0x27254d;};'use strict';var _=require('lodash');var util=require(_0x28d6('0x0'));var logger=require(_0x28d6('0x1'))(_0x28d6('0x2'));var moment=require(_0x28d6('0x3'));var BPromise=require(_0x28d6('0x4'));var rp=require(_0x28d6('0x5'));var fs=require('fs');var path=require(_0x28d6('0x6'));var rimraf=require(_0x28d6('0x7'));var config=require(_0x28d6('0x8'));var attributes=require(_0x28d6('0x9'));module[_0x28d6('0xa')]=function(_0x4385ba,_0x3c827b){return _0x4385ba[_0x28d6('0xb')]('Attachment',attributes,{'tableName':_0x28d6('0xc'),'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 10e32e8..d0d8634 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 _0x7919=['options','raw','then','debug','stringify','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','Attachment,\x20%s,\x20%s','request\x20sent','Attachment,\x20%s,\x20%s,\x20%s','code','error','message','catch','CreateAttachment','Attachment','create','body'];(function(_0x48686f,_0x2afb41){var _0x464e25=function(_0x5a3bff){while(--_0x5a3bff){_0x48686f['push'](_0x48686f['shift']());}};_0x464e25(++_0x2afb41);}(_0x7919,0x9b));var _0x9791=function(_0xd8c9a8,_0x4e4005){_0xd8c9a8=_0xd8c9a8-0x0;var _0x5488cc=_0x7919[_0xd8c9a8];return _0x5488cc;};'use strict';var _=require('lodash');var util=require(_0x9791('0x0'));var moment=require('moment');var BPromise=require(_0x9791('0x1'));var rs=require(_0x9791('0x2'));var fs=require('fs');var Redis=require(_0x9791('0x3'));var db=require(_0x9791('0x4'))['db'];var utils=require(_0x9791('0x5'));var logger=require(_0x9791('0x6'))(_0x9791('0x7'));var config=require(_0x9791('0x8'));var jayson=require(_0x9791('0x9'));var client=jayson[_0x9791('0xa')][_0x9791('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xc1368,_0x34fd09,_0x581fbb){return new BPromise(function(_0x100e6c,_0x25ba57){return client[_0x9791('0xc')](_0xc1368,_0x581fbb)['then'](function(_0x313db5){logger[_0x9791('0xd')](_0x9791('0xe'),_0x34fd09,_0x9791('0xf'));logger['debug'](_0x9791('0x10'),_0x34fd09,_0x9791('0xf'),JSON['stringify'](_0x313db5));if(_0x313db5['error']){if(_0x313db5['error'][_0x9791('0x11')]===0x1f4){logger[_0x9791('0x12')](_0x9791('0xe'),_0x34fd09,_0x313db5[_0x9791('0x12')][_0x9791('0x13')]);return _0x25ba57(_0x313db5[_0x9791('0x12')][_0x9791('0x13')]);}logger[_0x9791('0x12')](_0x9791('0xe'),_0x34fd09,_0x313db5[_0x9791('0x12')][_0x9791('0x13')]);return _0x100e6c(_0x313db5[_0x9791('0x12')][_0x9791('0x13')]);}else{logger[_0x9791('0xd')](_0x9791('0xe'),_0x34fd09,_0x9791('0xf'));_0x100e6c(_0x313db5['result'][_0x9791('0x13')]);}})[_0x9791('0x14')](function(_0x583f92){logger[_0x9791('0x12')](_0x9791('0xe'),_0x34fd09,_0x583f92);_0x25ba57(_0x583f92);});});}exports[_0x9791('0x15')]=function(_0x3da368){var _0x4134fa=this;return new Promise(function(_0x5b8b65,_0x31700d){return db[_0x9791('0x16')][_0x9791('0x17')](_0x3da368[_0x9791('0x18')],{'raw':_0x3da368[_0x9791('0x19')]?_0x3da368[_0x9791('0x19')][_0x9791('0x1a')]===undefined?!![]:![]:!![]})[_0x9791('0x1b')](function(_0x2cc44b){logger[_0x9791('0xd')](_0x9791('0x15'),_0x3da368);logger[_0x9791('0x1c')](_0x9791('0x15'),_0x3da368,JSON[_0x9791('0x1d')](_0x2cc44b));_0x5b8b65(_0x2cc44b);})['catch'](function(_0x32ceda){logger[_0x9791('0x12')](_0x9791('0x15'),_0x32ceda[_0x9791('0x13')],_0x3da368);_0x31700d(_0x4134fa[_0x9791('0x12')](0x1f4,_0x32ceda['message']));});});}; \ No newline at end of file +var _0xda4c=['CreateAttachment','body','options','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xda4c,0x7c));var _0xcda4=function(_0x2d71ec,_0x569175){_0x2d71ec=_0x2d71ec-0x0;var _0x1e65d2=_0xda4c[_0x2d71ec];return _0x1e65d2;};'use strict';var _=require(_0xcda4('0x0'));var util=require(_0xcda4('0x1'));var moment=require(_0xcda4('0x2'));var BPromise=require(_0xcda4('0x3'));var rs=require(_0xcda4('0x4'));var fs=require('fs');var Redis=require(_0xcda4('0x5'));var db=require(_0xcda4('0x6'))['db'];var utils=require(_0xcda4('0x7'));var logger=require('../../config/logger')(_0xcda4('0x8'));var config=require(_0xcda4('0x9'));var jayson=require(_0xcda4('0xa'));var client=jayson[_0xcda4('0xb')][_0xcda4('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3d9138,_0x78299e,_0x6a63ee){return new BPromise(function(_0xdf4344,_0x32a530){return client[_0xcda4('0xd')](_0x3d9138,_0x6a63ee)[_0xcda4('0xe')](function(_0x2ebbf2){logger[_0xcda4('0xf')](_0xcda4('0x10'),_0x78299e,_0xcda4('0x11'));logger[_0xcda4('0x12')](_0xcda4('0x13'),_0x78299e,_0xcda4('0x11'),JSON[_0xcda4('0x14')](_0x2ebbf2));if(_0x2ebbf2['error']){if(_0x2ebbf2['error'][_0xcda4('0x15')]===0x1f4){logger[_0xcda4('0x16')](_0xcda4('0x10'),_0x78299e,_0x2ebbf2[_0xcda4('0x16')][_0xcda4('0x17')]);return _0x32a530(_0x2ebbf2[_0xcda4('0x16')][_0xcda4('0x17')]);}logger[_0xcda4('0x16')](_0xcda4('0x10'),_0x78299e,_0x2ebbf2[_0xcda4('0x16')][_0xcda4('0x17')]);return _0xdf4344(_0x2ebbf2[_0xcda4('0x16')]['message']);}else{logger[_0xcda4('0xf')](_0xcda4('0x10'),_0x78299e,_0xcda4('0x11'));_0xdf4344(_0x2ebbf2[_0xcda4('0x18')][_0xcda4('0x17')]);}})[_0xcda4('0x19')](function(_0x10a96c){logger[_0xcda4('0x16')]('Attachment,\x20%s,\x20%s',_0x78299e,_0x10a96c);_0x32a530(_0x10a96c);});});}exports[_0xcda4('0x1a')]=function(_0x37a0f9){var _0x33820e=this;return new Promise(function(_0xa2cc9b,_0x2662da){return db['Attachment']['create'](_0x37a0f9[_0xcda4('0x1b')],{'raw':_0x37a0f9[_0xcda4('0x1c')]?_0x37a0f9[_0xcda4('0x1c')][_0xcda4('0x1d')]===undefined?!![]:![]:!![]})[_0xcda4('0xe')](function(_0xd4b82e){logger[_0xcda4('0xf')](_0xcda4('0x1a'),_0x37a0f9);logger[_0xcda4('0x12')]('CreateAttachment',_0x37a0f9,JSON[_0xcda4('0x14')](_0xd4b82e));_0xa2cc9b(_0xd4b82e);})[_0xcda4('0x19')](function(_0x22f2ae){logger[_0xcda4('0x16')](_0xcda4('0x1a'),_0x22f2ae[_0xcda4('0x17')],_0x37a0f9);_0x2662da(_0x33820e[_0xcda4('0x16')](0x1f4,_0x22f2ae[_0xcda4('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js index 50409b7..688bc09 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 _0xdbb3=['../../components/interaction/service','../../config/environment','./attachment.controller','get','isAuthenticated','/:id','show','download','root','server/files/attachments/','format','%s-%s','now','post','single','file','destroy','exports','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x213065,_0x3afd09){var _0x50a790=function(_0x5705dd){while(--_0x5705dd){_0x213065['push'](_0x213065['shift']());}};_0x50a790(++_0x3afd09);}(_0xdbb3,0x182));var _0x3dbb=function(_0x12d033,_0x25fa2f){_0x12d033=_0x12d033-0x0;var _0x3b4e80=_0xdbb3[_0x12d033];return _0x3b4e80;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3dbb('0x0'));var timeout=require(_0x3dbb('0x1'));var express=require(_0x3dbb('0x2'));var router=express[_0x3dbb('0x3')]();var auth=require(_0x3dbb('0x4'));var interaction=require(_0x3dbb('0x5'));var config=require(_0x3dbb('0x6'));var controller=require(_0x3dbb('0x7'));router[_0x3dbb('0x8')]('/',auth[_0x3dbb('0x9')](),controller['index']);router[_0x3dbb('0x8')](_0x3dbb('0xa'),auth[_0x3dbb('0x9')](),controller[_0x3dbb('0xb')]);router[_0x3dbb('0x8')]('/:id/download',auth[_0x3dbb('0x9')](),controller[_0x3dbb('0xc')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x4c838c,_0x3d9d41,_0x2fc473){_0x2fc473(null,path['join'](config[_0x3dbb('0xd')],_0x3dbb('0xe')));},'filename':function(_0x5a3d13,_0x25cd4d,_0x5b2eef){_0x5b2eef(null,util[_0x3dbb('0xf')](_0x3dbb('0x10'),Date[_0x3dbb('0x11')](),_0x25cd4d['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x3dbb('0x12')]('/',upload[_0x3dbb('0x13')](_0x3dbb('0x14')),controller['create']);router['put'](_0x3dbb('0xa'),auth[_0x3dbb('0x9')](),controller['update']);router['delete'](_0x3dbb('0xa'),auth[_0x3dbb('0x9')](),controller[_0x3dbb('0x15')]);module[_0x3dbb('0x16')]=router; \ No newline at end of file +var _0x78fa=['server/files/attachments/','format','%s-%s','now','originalname','post','single','file','create','put','update','delete','destroy','exports','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','download','diskStorage','join','root'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x78fa,0x82));var _0xa78f=function(_0x9be738,_0xc3ae98){_0x9be738=_0x9be738-0x0;var _0x1f7dbc=_0x78fa[_0x9be738];return _0x1f7dbc;};'use strict';var multer=require('multer');var util=require(_0xa78f('0x0'));var path=require(_0xa78f('0x1'));var timeout=require('connect-timeout');var express=require(_0xa78f('0x2'));var router=express[_0xa78f('0x3')]();var auth=require(_0xa78f('0x4'));var interaction=require(_0xa78f('0x5'));var config=require(_0xa78f('0x6'));var controller=require('./attachment.controller');router[_0xa78f('0x7')]('/',auth[_0xa78f('0x8')](),controller[_0xa78f('0x9')]);router['get'](_0xa78f('0xa'),auth[_0xa78f('0x8')](),controller['show']);router[_0xa78f('0x7')]('/:id/download',auth[_0xa78f('0x8')](),controller[_0xa78f('0xb')]);var upload=multer({'storage':multer[_0xa78f('0xc')]({'destination':function(_0x57cfe0,_0x427443,_0x19ca74){_0x19ca74(null,path[_0xa78f('0xd')](config[_0xa78f('0xe')],_0xa78f('0xf')));},'filename':function(_0x54313f,_0xde16da,_0x4e0832){_0x4e0832(null,util[_0xa78f('0x10')](_0xa78f('0x11'),Date[_0xa78f('0x12')](),_0xde16da[_0xa78f('0x13')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xa78f('0x14')]('/',upload[_0xa78f('0x15')](_0xa78f('0x16')),controller[_0xa78f('0x17')]);router[_0xa78f('0x18')](_0xa78f('0xa'),auth[_0xa78f('0x8')](),controller[_0xa78f('0x19')]);router[_0xa78f('0x1a')](_0xa78f('0xa'),auth[_0xa78f('0x8')](),controller[_0xa78f('0x1b')]);module[_0xa78f('0x1c')]=router; \ No newline at end of file diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js index e027bb7..008ded3 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 _0x2aa4=['../../mysqldb','../../config/environment','../../components/auth/service','signToken','../../config/utils','login','google','/login','profile','email','authenticate','use','clientID','clientSecret','secret','callbackURL','Setting','findOne','allowedLoginAttempts','then','map','emails','value','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blocked','blockedAt','blockDuration','minutes','clearBlockUser','getLicense','catch','passport-google-oauth20','moment'];(function(_0x497930,_0x206252){var _0x5cdd88=function(_0x1ebc6c){while(--_0x1ebc6c){_0x497930['push'](_0x497930['shift']());}};_0x5cdd88(++_0x206252);}(_0x2aa4,0x1ae));var _0x42aa=function(_0x48f109,_0x43477c){_0x48f109=_0x48f109-0x0;var _0x30f6f3=_0x2aa4[_0x48f109];return _0x30f6f3;};'use strict';var _=require('lodash');var passport=require('passport');var GoogleStrategy=require(_0x42aa('0x0'))['Strategy'];var moment=require(_0x42aa('0x1'));var db=require(_0x42aa('0x2'))['db'];var config=require(_0x42aa('0x3'));var signToken=require(_0x42aa('0x4'))[_0x42aa('0x5')];var utils=require(_0x42aa('0x6'));exports[_0x42aa('0x7')]=passport['authenticate'](_0x42aa('0x8'),{'failureRedirect':_0x42aa('0x9'),'scope':[_0x42aa('0xa'),_0x42aa('0xb')],'session':![]});exports['callback']=passport[_0x42aa('0xc')](_0x42aa('0x8'),{'failureRedirect':'/login','session':![]});passport[_0x42aa('0xd')](new GoogleStrategy({'clientID':config[_0x42aa('0x8')]?config[_0x42aa('0x8')][_0x42aa('0xe')]:'id','clientSecret':config['google']?config[_0x42aa('0x8')][_0x42aa('0xf')]:_0x42aa('0x10'),'callbackURL':config[_0x42aa('0x8')]?config[_0x42aa('0x8')][_0x42aa('0x11')]:''},function(_0x1b292e,_0x531b41,_0x20f5ac,_0x1a67f4){var _0x4fd443,_0x193429;return db[_0x42aa('0x12')][_0x42aa('0x13')]({'where':{'id':0x1},'attributes':[_0x42aa('0x14'),'blockDuration'],'raw':!![]})[_0x42aa('0x15')](function(_0x4bf14f){_0x4fd443=_0x4bf14f;return db['User']['find']({'where':{'email':_[_0x42aa('0x16')](_0x20f5ac[_0x42aa('0x17')],_0x42aa('0x18')),'role':{'$or':[_0x42aa('0x19'),_0x42aa('0x1a'),_0x42aa('0x1b')]}}});})['then'](function(_0x2a2e74){_0x193429=_0x2a2e74;if(_0x193429){if(_0x193429['disabled']){return _0x1a67f4(_0x42aa('0x1c'));}else if(_0x4fd443['blockDuration']>0x0){if(_0x193429[_0x42aa('0x1d')]){if(moment(_0x193429[_0x42aa('0x1e')])['add'](_0x4fd443[_0x42aa('0x1f')],_0x42aa('0x20'))>moment()){return _0x1a67f4('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{return utils[_0x42aa('0x21')](_0x193429,0x0,![],null)[_0x42aa('0x15')](function(){return utils[_0x42aa('0x22')](_0x193429);})[_0x42aa('0x15')](function(){return _0x1a67f4(null,_0x193429);});}}else{return utils[_0x42aa('0x22')](_0x193429)[_0x42aa('0x15')](function(){return _0x1a67f4(null,_0x193429);});}}else{return utils[_0x42aa('0x22')](_0x193429)[_0x42aa('0x15')](function(){return _0x1a67f4(null,_0x193429);});}}return _0x1a67f4(_0x42aa('0x1c'));})[_0x42aa('0x23')](function(_0x3e30db){_0x1a67f4(_0x3e30db);});})); \ No newline at end of file +var _0x967a=['User','find','map','admin','user','disabled','blockDuration','add','minutes','getLicense','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','catch','lodash','passport','passport-google-oauth20','Strategy','moment','../../mysqldb','../../config/environment','../../components/auth/service','signToken','login','google','/login','profile','authenticate','clientID','clientSecret','secret','callbackURL','Setting','findOne','allowedLoginAttempts','then'];(function(_0x27214f,_0x27d2cf){var _0x13dcfd=function(_0x2eb65e){while(--_0x2eb65e){_0x27214f['push'](_0x27214f['shift']());}};_0x13dcfd(++_0x27d2cf);}(_0x967a,0x160));var _0xa967=function(_0x3786f8,_0x3c3675){_0x3786f8=_0x3786f8-0x0;var _0x542370=_0x967a[_0x3786f8];return _0x542370;};'use strict';var _=require(_0xa967('0x0'));var passport=require(_0xa967('0x1'));var GoogleStrategy=require(_0xa967('0x2'))[_0xa967('0x3')];var moment=require(_0xa967('0x4'));var db=require(_0xa967('0x5'))['db'];var config=require(_0xa967('0x6'));var signToken=require(_0xa967('0x7'))[_0xa967('0x8')];var utils=require('../../config/utils');exports[_0xa967('0x9')]=passport['authenticate'](_0xa967('0xa'),{'failureRedirect':_0xa967('0xb'),'scope':[_0xa967('0xc'),'email'],'session':![]});exports['callback']=passport[_0xa967('0xd')]('google',{'failureRedirect':_0xa967('0xb'),'session':![]});passport['use'](new GoogleStrategy({'clientID':config[_0xa967('0xa')]?config['google'][_0xa967('0xe')]:'id','clientSecret':config[_0xa967('0xa')]?config['google'][_0xa967('0xf')]:_0xa967('0x10'),'callbackURL':config[_0xa967('0xa')]?config[_0xa967('0xa')][_0xa967('0x11')]:''},function(_0x21a2ce,_0x7c88a4,_0x45473f,_0x5575c3){var _0x588995,_0x45a795;return db[_0xa967('0x12')][_0xa967('0x13')]({'where':{'id':0x1},'attributes':[_0xa967('0x14'),'blockDuration'],'raw':!![]})[_0xa967('0x15')](function(_0x22914c){_0x588995=_0x22914c;return db[_0xa967('0x16')][_0xa967('0x17')]({'where':{'email':_[_0xa967('0x18')](_0x45473f['emails'],'value'),'role':{'$or':[_0xa967('0x19'),_0xa967('0x1a'),'agent']}}});})['then'](function(_0x3b7b4b){_0x45a795=_0x3b7b4b;if(_0x45a795){if(_0x45a795[_0xa967('0x1b')]){return _0x5575c3('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else if(_0x588995[_0xa967('0x1c')]>0x0){if(_0x45a795['blocked']){if(moment(_0x45a795['blockedAt'])[_0xa967('0x1d')](_0x588995[_0xa967('0x1c')],_0xa967('0x1e'))>moment()){return _0x5575c3('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{return utils['clearBlockUser'](_0x45a795,0x0,![],null)[_0xa967('0x15')](function(){return utils[_0xa967('0x1f')](_0x45a795);})[_0xa967('0x15')](function(){return _0x5575c3(null,_0x45a795);});}}else{return utils[_0xa967('0x1f')](_0x45a795)[_0xa967('0x15')](function(){return _0x5575c3(null,_0x45a795);});}}else{return utils[_0xa967('0x1f')](_0x45a795)['then'](function(){return _0x5575c3(null,_0x45a795);});}}return _0x5575c3(_0xa967('0x20'));})[_0xa967('0x21')](function(_0x202470){_0x5575c3(_0x202470);});})); \ No newline at end of file diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js index 375ab73..0fa2516 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 _0xc125=['login','/callback','callback','isMiddleware','setTokenCookie','exports','passport','./authGoogle.controller','../user/user.controller.js','../../components/auth/service','get'];(function(_0x1762b4,_0x33d836){var _0x29beda=function(_0x31c2fa){while(--_0x31c2fa){_0x1762b4['push'](_0x1762b4['shift']());}};_0x29beda(++_0x33d836);}(_0xc125,0x150));var _0x5c12=function(_0x12b4ed,_0x241e7d){_0x12b4ed=_0x12b4ed-0x0;var _0x3720df=_0xc125[_0x12b4ed];return _0x3720df;};'use strict';var express=require('express');var passport=require(_0x5c12('0x0'));var router=express['Router']();var controller=require(_0x5c12('0x1'));var userController=require(_0x5c12('0x2'));var authService=require(_0x5c12('0x3'));router[_0x5c12('0x4')]('/',controller[_0x5c12('0x5')]);router[_0x5c12('0x4')](_0x5c12('0x6'),controller[_0x5c12('0x7')],authService[_0x5c12('0x8')],userController[_0x5c12('0x5')],authService[_0x5c12('0x9')]);module[_0x5c12('0xa')]=router; \ No newline at end of file +var _0x7794=['../user/user.controller.js','get','login','/callback','setTokenCookie','exports','passport','Router','./authGoogle.controller'];(function(_0x13c523,_0x5648df){var _0x19a977=function(_0x2992b6){while(--_0x2992b6){_0x13c523['push'](_0x13c523['shift']());}};_0x19a977(++_0x5648df);}(_0x7794,0x7b));var _0x4779=function(_0x35fec4,_0x378bb6){_0x35fec4=_0x35fec4-0x0;var _0x21a736=_0x7794[_0x35fec4];return _0x21a736;};'use strict';var express=require('express');var passport=require(_0x4779('0x0'));var router=express[_0x4779('0x1')]();var controller=require(_0x4779('0x2'));var userController=require(_0x4779('0x3'));var authService=require('../../components/auth/service');router[_0x4779('0x4')]('/',controller[_0x4779('0x5')]);router['get'](_0x4779('0x6'),controller['callback'],authService['isMiddleware'],userController['login'],authService[_0x4779('0x7')]);module[_0x4779('0x8')]=router; \ No newline at end of file diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js index 1033221..27d150d 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 _0xf494=['find','MailServerOut','Smtp','service','host','port','secure','authentication','auth','pass','format','\x22%s\x22\x20<%s>','email','request','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','status','send','test','login','authenticate','Something\x20went\x20wrong,\x20please\x20try\x20again.','json','online','forgot','body','Email\x20parameter\x20is\x20missing','trim','disabled','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','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','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','reset','User','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','save','util','passport','passport-local','jayson/promise','lodash','randomstring','moment','../../mysqldb','../../components/auth/service','../../config/utils','client','http','Setting','findOne','allowedLoginAttempts','blockDuration','then','name','password','role','blockedAt','loginAttempts','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blocked','add','clearBlockUser','minutes','getLicense','catch','MailAccount'];(function(_0x2bdcf2,_0x52512b){var _0x216126=function(_0x34ae91){while(--_0x34ae91){_0x2bdcf2['push'](_0x2bdcf2['shift']());}};_0x216126(++_0x52512b);}(_0xf494,0x1c6));var _0x4f49=function(_0x22d4f5,_0x3edb4e){_0x22d4f5=_0x22d4f5-0x0;var _0x5f4d1e=_0xf494[_0x22d4f5];return _0x5f4d1e;};'use strict';var util=require(_0x4f49('0x0'));var passport=require(_0x4f49('0x1'));var LocalStrategy=require(_0x4f49('0x2'))['Strategy'];var jayson=require(_0x4f49('0x3'));var _=require(_0x4f49('0x4'));var rs=require(_0x4f49('0x5'));var moment=require(_0x4f49('0x6'));var db=require(_0x4f49('0x7'))['db'];var authService=require(_0x4f49('0x8'));var utils=require(_0x4f49('0x9'));var client=jayson[_0x4f49('0xa')][_0x4f49('0xb')]({'port':0x232b});function localAuthenticate(_0x413530,_0x42b0e8,_0x5eb186,_0x58e9a0){var _0x169c95,_0x327bd5;return db[_0x4f49('0xc')][_0x4f49('0xd')]({'where':{'id':0x1},'attributes':[_0x4f49('0xe'),_0x4f49('0xf')],'raw':!![]})[_0x4f49('0x10')](function(_0x410884){_0x169c95=_0x410884;return _0x413530['findOne']({'attributes':['id',_0x4f49('0x11'),_0x4f49('0x12'),'salt',_0x4f49('0x13'),'disabled','blocked',_0x4f49('0x14'),_0x4f49('0x15')],'where':{'name':_0x42b0e8,'role':{'$or':['admin',_0x4f49('0x16'),_0x4f49('0x17')]}}});})[_0x4f49('0x10')](function(_0x2efe49){if(!_0x2efe49||_0x2efe49&&_0x2efe49[_0x4f49('0x11')]!==_0x42b0e8){throw new Error(_0x4f49('0x18'));}else{_0x327bd5=_0x2efe49;return _0x327bd5;}})[_0x4f49('0x10')](function(){_0x327bd5['authenticate'](_0x5eb186,function(_0x515ace,_0x1f2d0d){var _0x415e83=_0x327bd5['loginAttempts']+0x1;if(_0x515ace){return _0x58e9a0(_0x515ace);}else if(!_0x1f2d0d){if(_0x327bd5['disabled']){return _0x58e9a0(null,![],{'message':_0x4f49('0x18')});}else if(_0x169c95[_0x4f49('0xe')]>0x0){if(_0x327bd5[_0x4f49('0x19')]){if(_0x169c95['blockDuration']>0x0){if(moment(_0x327bd5[_0x4f49('0x14')])[_0x4f49('0x1a')](_0x169c95[_0x4f49('0xf')],'minutes')>moment()){return _0x58e9a0(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils['clearBlockUser'](_0x327bd5,_0x415e83,![],null)['then'](function(){return _0x58e9a0(null,![],{'message':_0x4f49('0x18')});});}}else{return _0x58e9a0(null,![],{'message':_0x4f49('0x18')});}}else{if(_0x415e83>=_0x169c95[_0x4f49('0xe')]){return utils[_0x4f49('0x1b')](_0x327bd5,0x0,!![],moment())['then'](function(){return _0x58e9a0(null,![],{'message':_0x4f49('0x18')});});}else{return utils[_0x4f49('0x1b')](_0x327bd5,_0x415e83,![],null)[_0x4f49('0x10')](function(){return _0x58e9a0(null,![],{'message':_0x4f49('0x18')});});}}}else{return _0x58e9a0(null,![],{'message':_0x4f49('0x18')});}}else{if(_0x327bd5['disabled']){return _0x58e9a0(null,![],{'message':_0x4f49('0x18')});}else if(_0x169c95[_0x4f49('0xe')]>0x0){if(_0x327bd5[_0x4f49('0x19')]){if(_0x169c95['blockDuration']>0x0){if(moment(_0x327bd5[_0x4f49('0x14')])[_0x4f49('0x1a')](_0x169c95[_0x4f49('0xf')],_0x4f49('0x1c'))>moment()){return _0x58e9a0(null,![],{'message':_0x4f49('0x18')});}else{return utils[_0x4f49('0x1b')](_0x327bd5,0x0,![],null)['then'](function(){return utils['getLicense'](_0x327bd5);})[_0x4f49('0x10')](function(){return _0x58e9a0(null,_0x327bd5);});}}else{return _0x58e9a0(null,![],{'message':_0x4f49('0x18')});}}else{return utils['clearBlockUser'](_0x327bd5,0x0,![],null)[_0x4f49('0x10')](function(){return utils[_0x4f49('0x1d')](_0x327bd5);})[_0x4f49('0x10')](function(){return _0x58e9a0(null,_0x327bd5);})['catch'](function(_0xc54070){return _0x58e9a0(null,![],_0xc54070);});}}else{if(_0x327bd5[_0x4f49('0x19')]){return _0x58e9a0(null,![],{'message':_0x4f49('0x18')});}else{return utils[_0x4f49('0x1d')](_0x327bd5)[_0x4f49('0x10')](function(){return _0x58e9a0(null,_0x327bd5);});}}}});})[_0x4f49('0x1e')](function(_0x4915af){return _0x58e9a0(null,![],_0x4915af);});}function sendServiceMail(_0x50c571){return db[_0x4f49('0x1f')][_0x4f49('0x20')]({'where':{'service':!![]},'attributes':['id',_0x4f49('0x11'),'email'],'include':[{'model':db[_0x4f49('0x21')],'as':_0x4f49('0x22')}]})[_0x4f49('0x10')](function(_0x506b20){if(!_0x506b20){throw new Error('Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!');}var _0x3e207f={'tls':{'rejectUnauthorized':![]}};if(_0x506b20[_0x4f49('0x22')][_0x4f49('0x23')]){_0x3e207f['service']=_0x506b20[_0x4f49('0x22')][_0x4f49('0x23')];}else{_0x3e207f[_0x4f49('0x24')]=_0x506b20[_0x4f49('0x22')][_0x4f49('0x24')];_0x3e207f[_0x4f49('0x25')]=_0x506b20[_0x4f49('0x22')][_0x4f49('0x25')];_0x3e207f[_0x4f49('0x26')]=_0x506b20[_0x4f49('0x22')][_0x4f49('0x26')];}if(_0x506b20[_0x4f49('0x22')][_0x4f49('0x27')]){_0x3e207f[_0x4f49('0x28')]={'user':_0x506b20[_0x4f49('0x22')][_0x4f49('0x16')],'pass':_0x506b20[_0x4f49('0x22')][_0x4f49('0x29')]};}var _0x3e7a08={'account':_0x3e207f,'message':_['merge']({'from':util[_0x4f49('0x2a')](_0x4f49('0x2b'),_0x506b20[_0x4f49('0x11')],_0x506b20[_0x4f49('0x2c')]||_0x506b20[_0x4f49('0x22')][_0x4f49('0x16')])},_0x50c571)};return client[_0x4f49('0x2d')](_0x4f49('0x2e'),_0x3e7a08);})[_0x4f49('0x10')](function(_0x338db8){if(_0x338db8[_0x4f49('0x2f')]){throw new Error(util[_0x4f49('0x2a')](_0x4f49('0x30'),_0x338db8['error'][_0x4f49('0x31')]||JSON[_0x4f49('0x32')](_0x338db8[_0x4f49('0x2f')])));}return!![];});}function handleError(_0x26014f,_0x1c1e9b,_0x3ee818){return _0x26014f[_0x4f49('0x33')](_0x1c1e9b||0x1f4)[_0x4f49('0x34')]({'message':_0x3ee818?_0x3ee818[_0x4f49('0x31')]||_0x3ee818:''});}function checkPasswordPattern(_0xf8c377,_0x173b6e,_0x141db){if(_0x141db){var _0x19219c=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x19219c[_0x4f49('0x35')](_0x173b6e)){return _0xf8c377;}else{throw new Error('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0xf8c377;}}exports[_0x4f49('0x36')]=function(_0xb0e6c2,_0x543605,_0x2b7eed){passport[_0x4f49('0x37')]('local',function(_0x29e762,_0x1dd1a6,_0x2548ad){var _0x200b1d=_0x29e762||_0x2548ad;if(_0x200b1d){return handleError(_0x543605,0x191,_0x200b1d);}if(!_0x1dd1a6){return handleError(_0x543605,0x194,{'message':_0x4f49('0x38')});}else{var _0x3d5cf2={'payload':{'id':_0x1dd1a6['id'],'role':_0x1dd1a6[_0x4f49('0x13')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x3d5cf2)['then'](function(_0x55960a){_0x543605[_0x4f49('0x39')]({'id':_0x1dd1a6['id'],'token':_0x55960a,'statusCall':'','isAlreadyLogged':_0x1dd1a6[_0x4f49('0x3a')]});});}})(_0xb0e6c2,_0x543605,_0x2b7eed);};exports[_0x4f49('0x3b')]=function(_0x373f90,_0x1053b2,_0x1ecf6c){if(!_0x373f90[_0x4f49('0x3c')][_0x4f49('0x2c')]){return handleError(_0x1053b2,0x1f4,{'message':_0x4f49('0x3d')});}var _0x486b82=rs['generate']();_0x373f90[_0x4f49('0x3c')][_0x4f49('0x2c')]=_0x373f90[_0x4f49('0x3c')]['email'][_0x4f49('0x3e')]()['toLowerCase']();var _0x4b1fcc;return db[_0x4f49('0xc')][_0x4f49('0xd')]({'where':{'id':0x1},'attributes':[_0x4f49('0xe'),'blockDuration'],'raw':!![]})[_0x4f49('0x10')](function(_0x11b4df){_0x4b1fcc=_0x11b4df;return db['User'][_0x4f49('0x20')]({'where':{'email':_0x373f90['body'][_0x4f49('0x2c')]}});})[_0x4f49('0x10')](function(_0x133f39){if(!_0x133f39){throw new Error('This\x20email\x20is\x20not\x20registered.');}if(_0x133f39[_0x4f49('0x3f')]){throw new Error(_0x4f49('0x40'));}if(_0x133f39[_0x4f49('0x19')]){if(moment(_0x133f39[_0x4f49('0x14')])[_0x4f49('0x1a')](_0x4b1fcc[_0x4f49('0xf')],_0x4f49('0x1c'))>moment()){throw new Error(_0x4f49('0x41'));}else{_0x133f39[_0x4f49('0x19')]=![];_0x133f39[_0x4f49('0x14')]=null;}}_0x133f39['resetPasswordToken']=_0x486b82;_0x133f39[_0x4f49('0x42')]=Date[_0x4f49('0x43')]()+0x36ee80;return _0x133f39['save']();})[_0x4f49('0x10')](function(){return sendServiceMail({'to':_0x373f90['body'][_0x4f49('0x2c')],'subject':_0x4f49('0x44'),'text':_0x4f49('0x45')+_0x4f49('0x46')+'http://'+_0x373f90[_0x4f49('0x47')][_0x4f49('0x24')]+_0x4f49('0x48')+_0x486b82+'\x0a\x0a'+_0x4f49('0x49')});})[_0x4f49('0x10')](function(){_0x1053b2[_0x4f49('0x33')](0xc8)[_0x4f49('0x34')]({'message':_0x4f49('0x4a')});})[_0x4f49('0x1e')](function(_0x3520b2){return handleError(_0x1053b2,0x1f4,_0x3520b2);});};exports[_0x4f49('0x4b')]=function(_0x4482f7,_0x148031,_0x2104d0){var _0x26464c;return db[_0x4f49('0x4c')]['find']({'where':{'resetPasswordToken':_0x4482f7['params'][_0x4f49('0x4d')],'resetPasswordExpires':{'$gt':Date[_0x4f49('0x43')]()}}})[_0x4f49('0x10')](function(_0xe46c90){_0x26464c=_0xe46c90;if(!_0x26464c){throw new Error(_0x4f49('0x4e'));}return db[_0x4f49('0xc')][_0x4f49('0xd')]({'attributes':['id','securePassword']});})[_0x4f49('0x10')](function(_0x4ff0a2){return checkPasswordPattern(_0x4ff0a2,_0x4482f7[_0x4f49('0x3c')][_0x4f49('0x12')],_0x4ff0a2[_0x4f49('0x4f')]);})[_0x4f49('0x10')](function(){_0x26464c['password']=_0x4482f7[_0x4f49('0x3c')]['password'];_0x26464c['resetPasswordToken']=null;_0x26464c[_0x4f49('0x42')]=null;return _0x26464c[_0x4f49('0x50')]();})[_0x4f49('0x10')](function(){_0x148031[_0x4f49('0x33')](0xc8)['send']({'message':'Password\x20reset!'});})[_0x4f49('0x1e')](function(_0x291a45){return handleError(_0x148031,0x1f4,_0x291a45);});};passport['use'](new LocalStrategy({'usernameField':_0x4f49('0x11'),'passwordField':'password'},function(_0x5a929a,_0xf90696,_0x5f3a80){return localAuthenticate(db[_0x4f49('0x4c')],_0x5a929a,_0xf90696,_0x5f3a80);})); \ No newline at end of file +var _0x7fbe=['reset','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','Password\x20reset!','use','passport-local','Strategy','jayson/promise','lodash','randomstring','moment','../../mysqldb','../../components/auth/service','../../config/utils','client','http','Setting','findOne','then','name','password','salt','role','disabled','blocked','blockedAt','loginAttempts','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','allowedLoginAttempts','blockDuration','clearBlockUser','add','getLicense','catch','MailAccount','email','MailServerOut','Smtp','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','service','port','secure','authentication','auth','pass','merge','format','\x22%s\x22\x20<%s>','request','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','status','send','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','signToken','json','forgot','body','trim','User','find','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','minutes','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','host','Reset\x20Email\x20sent!'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x406ba5,_0x39fa4b){_0x406ba5=_0x406ba5-0x0;var _0x557db7=_0x7fbe[_0x406ba5];return _0x557db7;};'use strict';var util=require('util');var passport=require('passport');var LocalStrategy=require(_0xe7fb('0x0'))[_0xe7fb('0x1')];var jayson=require(_0xe7fb('0x2'));var _=require(_0xe7fb('0x3'));var rs=require(_0xe7fb('0x4'));var moment=require(_0xe7fb('0x5'));var db=require(_0xe7fb('0x6'))['db'];var authService=require(_0xe7fb('0x7'));var utils=require(_0xe7fb('0x8'));var client=jayson[_0xe7fb('0x9')][_0xe7fb('0xa')]({'port':0x232b});function localAuthenticate(_0x12d1b0,_0x24cd67,_0x1f943f,_0x5ad75b){var _0x213ebc,_0x228f6b;return db[_0xe7fb('0xb')][_0xe7fb('0xc')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts','blockDuration'],'raw':!![]})[_0xe7fb('0xd')](function(_0x2f2ea0){_0x213ebc=_0x2f2ea0;return _0x12d1b0[_0xe7fb('0xc')]({'attributes':['id',_0xe7fb('0xe'),_0xe7fb('0xf'),_0xe7fb('0x10'),_0xe7fb('0x11'),_0xe7fb('0x12'),_0xe7fb('0x13'),_0xe7fb('0x14'),_0xe7fb('0x15')],'where':{'name':_0x24cd67,'role':{'$or':[_0xe7fb('0x16'),_0xe7fb('0x17'),_0xe7fb('0x18')]}}});})[_0xe7fb('0xd')](function(_0x598729){if(!_0x598729||_0x598729&&_0x598729[_0xe7fb('0xe')]!==_0x24cd67){throw new Error(_0xe7fb('0x19'));}else{_0x228f6b=_0x598729;return _0x228f6b;}})['then'](function(){_0x228f6b[_0xe7fb('0x1a')](_0x1f943f,function(_0x37eb9f,_0x482f7d){var _0xa76acf=_0x228f6b['loginAttempts']+0x1;if(_0x37eb9f){return _0x5ad75b(_0x37eb9f);}else if(!_0x482f7d){if(_0x228f6b[_0xe7fb('0x12')]){return _0x5ad75b(null,![],{'message':_0xe7fb('0x19')});}else if(_0x213ebc[_0xe7fb('0x1b')]>0x0){if(_0x228f6b[_0xe7fb('0x13')]){if(_0x213ebc['blockDuration']>0x0){if(moment(_0x228f6b[_0xe7fb('0x14')])['add'](_0x213ebc[_0xe7fb('0x1c')],'minutes')>moment()){return _0x5ad75b(null,![],{'message':_0xe7fb('0x19')});}else{return utils[_0xe7fb('0x1d')](_0x228f6b,_0xa76acf,![],null)[_0xe7fb('0xd')](function(){return _0x5ad75b(null,![],{'message':_0xe7fb('0x19')});});}}else{return _0x5ad75b(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0xa76acf>=_0x213ebc[_0xe7fb('0x1b')]){return utils['clearBlockUser'](_0x228f6b,0x0,!![],moment())[_0xe7fb('0xd')](function(){return _0x5ad75b(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}else{return utils[_0xe7fb('0x1d')](_0x228f6b,_0xa76acf,![],null)['then'](function(){return _0x5ad75b(null,![],{'message':_0xe7fb('0x19')});});}}}else{return _0x5ad75b(null,![],{'message':_0xe7fb('0x19')});}}else{if(_0x228f6b['disabled']){return _0x5ad75b(null,![],{'message':_0xe7fb('0x19')});}else if(_0x213ebc[_0xe7fb('0x1b')]>0x0){if(_0x228f6b[_0xe7fb('0x13')]){if(_0x213ebc['blockDuration']>0x0){if(moment(_0x228f6b[_0xe7fb('0x14')])[_0xe7fb('0x1e')](_0x213ebc['blockDuration'],'minutes')>moment()){return _0x5ad75b(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0xe7fb('0x1d')](_0x228f6b,0x0,![],null)['then'](function(){return utils['getLicense'](_0x228f6b);})[_0xe7fb('0xd')](function(){return _0x5ad75b(null,_0x228f6b);});}}else{return _0x5ad75b(null,![],{'message':_0xe7fb('0x19')});}}else{return utils[_0xe7fb('0x1d')](_0x228f6b,0x0,![],null)['then'](function(){return utils[_0xe7fb('0x1f')](_0x228f6b);})[_0xe7fb('0xd')](function(){return _0x5ad75b(null,_0x228f6b);})[_0xe7fb('0x20')](function(_0x1ceed8){return _0x5ad75b(null,![],_0x1ceed8);});}}else{if(_0x228f6b[_0xe7fb('0x13')]){return _0x5ad75b(null,![],{'message':_0xe7fb('0x19')});}else{return utils[_0xe7fb('0x1f')](_0x228f6b)['then'](function(){return _0x5ad75b(null,_0x228f6b);});}}}});})['catch'](function(_0x1086e6){return _0x5ad75b(null,![],_0x1086e6);});}function sendServiceMail(_0x3bdee9){return db[_0xe7fb('0x21')]['find']({'where':{'service':!![]},'attributes':['id',_0xe7fb('0xe'),_0xe7fb('0x22')],'include':[{'model':db[_0xe7fb('0x23')],'as':_0xe7fb('0x24')}]})[_0xe7fb('0xd')](function(_0x1256d4){if(!_0x1256d4){throw new Error(_0xe7fb('0x25'));}var _0x3dd0be={'tls':{'rejectUnauthorized':![]}};if(_0x1256d4['Smtp'][_0xe7fb('0x26')]){_0x3dd0be[_0xe7fb('0x26')]=_0x1256d4[_0xe7fb('0x24')]['service'];}else{_0x3dd0be['host']=_0x1256d4[_0xe7fb('0x24')]['host'];_0x3dd0be[_0xe7fb('0x27')]=_0x1256d4[_0xe7fb('0x24')][_0xe7fb('0x27')];_0x3dd0be[_0xe7fb('0x28')]=_0x1256d4['Smtp'][_0xe7fb('0x28')];}if(_0x1256d4[_0xe7fb('0x24')][_0xe7fb('0x29')]){_0x3dd0be[_0xe7fb('0x2a')]={'user':_0x1256d4[_0xe7fb('0x24')]['user'],'pass':_0x1256d4[_0xe7fb('0x24')][_0xe7fb('0x2b')]};}var _0x209eaa={'account':_0x3dd0be,'message':_[_0xe7fb('0x2c')]({'from':util[_0xe7fb('0x2d')](_0xe7fb('0x2e'),_0x1256d4[_0xe7fb('0xe')],_0x1256d4[_0xe7fb('0x22')]||_0x1256d4[_0xe7fb('0x24')]['user'])},_0x3bdee9)};return client[_0xe7fb('0x2f')](_0xe7fb('0x30'),_0x209eaa);})[_0xe7fb('0xd')](function(_0x56e17b){if(_0x56e17b[_0xe7fb('0x31')]){throw new Error(util[_0xe7fb('0x2d')](_0xe7fb('0x32'),_0x56e17b[_0xe7fb('0x31')][_0xe7fb('0x33')]||JSON[_0xe7fb('0x34')](_0x56e17b[_0xe7fb('0x31')])));}return!![];});}function handleError(_0xc4e271,_0x195c35,_0xebfe1d){return _0xc4e271[_0xe7fb('0x35')](_0x195c35||0x1f4)[_0xe7fb('0x36')]({'message':_0xebfe1d?_0xebfe1d[_0xe7fb('0x33')]||_0xebfe1d:''});}function checkPasswordPattern(_0x1c81fe,_0xeb7c29,_0x41e2d1){if(_0x41e2d1){var _0x30dd5b=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x30dd5b[_0xe7fb('0x37')](_0xeb7c29)){return _0x1c81fe;}else{throw new Error(_0xe7fb('0x38'));}}else{return _0x1c81fe;}}exports['login']=function(_0x261ec5,_0x23f9f9,_0x3f3207){passport[_0xe7fb('0x1a')]('local',function(_0x3426a9,_0x186418,_0xd472d){var _0x413a13=_0x3426a9||_0xd472d;if(_0x413a13){return handleError(_0x23f9f9,0x191,_0x413a13);}if(!_0x186418){return handleError(_0x23f9f9,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x2f976f={'payload':{'id':_0x186418['id'],'role':_0x186418[_0xe7fb('0x11')]},'options':{'expiresIn':0x15180}};return authService[_0xe7fb('0x39')](_0x2f976f)[_0xe7fb('0xd')](function(_0x468d16){_0x23f9f9[_0xe7fb('0x3a')]({'id':_0x186418['id'],'token':_0x468d16,'statusCall':'','isAlreadyLogged':_0x186418['online']});});}})(_0x261ec5,_0x23f9f9,_0x3f3207);};exports[_0xe7fb('0x3b')]=function(_0x35139f,_0x3a96cd,_0x4b263d){if(!_0x35139f[_0xe7fb('0x3c')][_0xe7fb('0x22')]){return handleError(_0x3a96cd,0x1f4,{'message':'Email\x20parameter\x20is\x20missing'});}var _0x490333=rs['generate']();_0x35139f['body']['email']=_0x35139f[_0xe7fb('0x3c')][_0xe7fb('0x22')][_0xe7fb('0x3d')]()['toLowerCase']();var _0x34cdd8;return db['Setting'][_0xe7fb('0xc')]({'where':{'id':0x1},'attributes':[_0xe7fb('0x1b'),'blockDuration'],'raw':!![]})[_0xe7fb('0xd')](function(_0x2a3422){_0x34cdd8=_0x2a3422;return db[_0xe7fb('0x3e')][_0xe7fb('0x3f')]({'where':{'email':_0x35139f['body'][_0xe7fb('0x22')]}});})[_0xe7fb('0xd')](function(_0x1b8a34){if(!_0x1b8a34){throw new Error('This\x20email\x20is\x20not\x20registered.');}if(_0x1b8a34[_0xe7fb('0x12')]){throw new Error(_0xe7fb('0x40'));}if(_0x1b8a34[_0xe7fb('0x13')]){if(moment(_0x1b8a34[_0xe7fb('0x14')])[_0xe7fb('0x1e')](_0x34cdd8['blockDuration'],_0xe7fb('0x41'))>moment()){throw new Error('The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.');}else{_0x1b8a34[_0xe7fb('0x13')]=![];_0x1b8a34[_0xe7fb('0x14')]=null;}}_0x1b8a34[_0xe7fb('0x42')]=_0x490333;_0x1b8a34[_0xe7fb('0x43')]=Date[_0xe7fb('0x44')]()+0x36ee80;return _0x1b8a34['save']();})[_0xe7fb('0xd')](function(){return sendServiceMail({'to':_0x35139f['body']['email'],'subject':_0xe7fb('0x45'),'text':_0xe7fb('0x46')+_0xe7fb('0x47')+'http://'+_0x35139f[_0xe7fb('0x48')][_0xe7fb('0x49')]+'/reset/'+_0x490333+'\x0a\x0a'+'If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a'});})[_0xe7fb('0xd')](function(){_0x3a96cd[_0xe7fb('0x35')](0xc8)[_0xe7fb('0x36')]({'message':_0xe7fb('0x4a')});})[_0xe7fb('0x20')](function(_0x1f0533){return handleError(_0x3a96cd,0x1f4,_0x1f0533);});};exports[_0xe7fb('0x4b')]=function(_0x347177,_0x5cd8e3,_0x925a5e){var _0x5cc28f;return db[_0xe7fb('0x3e')][_0xe7fb('0x3f')]({'where':{'resetPasswordToken':_0x347177['params'][_0xe7fb('0x4c')],'resetPasswordExpires':{'$gt':Date['now']()}}})[_0xe7fb('0xd')](function(_0x484bd8){_0x5cc28f=_0x484bd8;if(!_0x5cc28f){throw new Error(_0xe7fb('0x4d'));}return db['Setting'][_0xe7fb('0xc')]({'attributes':['id','securePassword']});})[_0xe7fb('0xd')](function(_0x1b6442){return checkPasswordPattern(_0x1b6442,_0x347177[_0xe7fb('0x3c')][_0xe7fb('0xf')],_0x1b6442[_0xe7fb('0x4e')]);})[_0xe7fb('0xd')](function(){_0x5cc28f[_0xe7fb('0xf')]=_0x347177['body']['password'];_0x5cc28f[_0xe7fb('0x42')]=null;_0x5cc28f['resetPasswordExpires']=null;return _0x5cc28f['save']();})['then'](function(){_0x5cd8e3['status'](0xc8)['send']({'message':_0xe7fb('0x4f')});})[_0xe7fb('0x20')](function(_0xd2fd76){return handleError(_0x5cd8e3,0x1f4,_0xd2fd76);});};passport[_0xe7fb('0x50')](new LocalStrategy({'usernameField':'name','passwordField':_0xe7fb('0xf')},function(_0x236b35,_0x195e52,_0x4a9372){return localAuthenticate(db['User'],_0x236b35,_0x195e52,_0x4a9372);})); \ No newline at end of file diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js index 26cee9d..2c14931 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 _0xeb6c=['./authLocal.controller','post','login','/forgot','forgot','/reset/:token','reset','express','Router'];(function(_0x23aee8,_0x5a67bd){var _0x39882d=function(_0x57d3a2){while(--_0x57d3a2){_0x23aee8['push'](_0x23aee8['shift']());}};_0x39882d(++_0x5a67bd);}(_0xeb6c,0x85));var _0xceb6=function(_0x5a924f,_0x22d1fa){_0x5a924f=_0x5a924f-0x0;var _0x265ab5=_0xeb6c[_0x5a924f];return _0x265ab5;};'use strict';var express=require(_0xceb6('0x0'));var router=express[_0xceb6('0x1')]();var controller=require(_0xceb6('0x2'));router[_0xceb6('0x3')]('/',controller[_0xceb6('0x4')]);router[_0xceb6('0x3')](_0xceb6('0x5'),controller[_0xceb6('0x6')]);router[_0xceb6('0x3')](_0xceb6('0x7'),controller[_0xceb6('0x8')]);module['exports']=router; \ No newline at end of file +var _0x93b5=['post','/forgot','forgot','/reset/:token','exports','express','Router','./authLocal.controller'];(function(_0x565f9b,_0x3697c0){var _0x1a27f9=function(_0x1ba5de){while(--_0x1ba5de){_0x565f9b['push'](_0x565f9b['shift']());}};_0x1a27f9(++_0x3697c0);}(_0x93b5,0x145));var _0x593b=function(_0x4b5b50,_0x4b3240){_0x4b5b50=_0x4b5b50-0x0;var _0x28a9ab=_0x93b5[_0x4b5b50];return _0x28a9ab;};'use strict';var express=require(_0x593b('0x0'));var router=express[_0x593b('0x1')]();var controller=require(_0x593b('0x2'));router[_0x593b('0x3')]('/',controller['login']);router[_0x593b('0x3')](_0x593b('0x4'),controller[_0x593b('0x5')]);router[_0x593b('0x3')](_0x593b('0x6'),controller['reset']);module[_0x593b('0x7')]=router; \ No newline at end of file diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js index f83223d..8942e79 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 _0xadf4=['exports','STRING','INTEGER','sequelize'];(function(_0x38d832,_0xf2104d){var _0x2e166e=function(_0x26e7d0){while(--_0x26e7d0){_0x38d832['push'](_0x38d832['shift']());}};_0x2e166e(++_0xf2104d);}(_0xadf4,0x6f));var _0x4adf=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0xadf4[_0xc6be3a];return _0x56a310;};'use strict';var Sequelize=require(_0x4adf('0x0'));module[_0x4adf('0x1')]={'name':{'type':Sequelize[_0x4adf('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0x4adf('0x2')]},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timeout':{'type':Sequelize[_0x4adf('0x3')],'defaultValue':0xa}}; \ No newline at end of file +var _0xe32d=['INTEGER','sequelize','STRING','BOOLEAN'];(function(_0x2e3871,_0x3128cf){var _0x169de8=function(_0x77aae3){while(--_0x77aae3){_0x2e3871['push'](_0x2e3871['shift']());}};_0x169de8(++_0x3128cf);}(_0xe32d,0x179));var _0xde32=function(_0x59ade3,_0x5cf215){_0x59ade3=_0x59ade3-0x0;var _0x18e940=_0xe32d[_0x59ade3];return _0x18e940;};'use strict';var Sequelize=require(_0xde32('0x0'));module['exports']={'name':{'type':Sequelize[_0xde32('0x1')],'allowNull':![]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xde32('0x1')]},'status':{'type':Sequelize[_0xde32('0x2')],'defaultValue':![]},'timeout':{'type':Sequelize[_0xde32('0x3')],'defaultValue':0xa}}; \ No newline at end of file diff --git a/server/api/automation/automation.controller.js b/server/api/automation/automation.controller.js index 22e5b3b..c922d35 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 _0xf815=['set','Content-Range','apply','reject','update','then','destroy','sendStatus','error','stack','name','send','index','Automation','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','map','type','key','VIRTUAL','field','options','findAll','catch','show','params','includeAll','find','create','body','Condition','addConditions','ids','order','getConditions','Action','addActions','omit','getActions','findOne','pick','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','status','end','json','count','offset','limit'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xf815,0x1e4));var _0x5f81=function(_0x4346ed,_0xfe0647){_0x4346ed=_0x4346ed-0x0;var _0x3319ca=_0xf815[_0x4346ed];return _0x3319ca;};'use strict';var pdf=require(_0x5f81('0x0'));var emlformat=require(_0x5f81('0x1'));var rimraf=require(_0x5f81('0x2'));var zipdir=require(_0x5f81('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5f81('0x4'));var moment=require(_0x5f81('0x5'));var BPromise=require(_0x5f81('0x6'));var Mustache=require(_0x5f81('0x7'));var util=require(_0x5f81('0x8'));var path=require(_0x5f81('0x9'));var sox=require(_0x5f81('0xa'));var csv=require(_0x5f81('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x5f81('0xc'));var squel=require(_0x5f81('0xd'));var crypto=require(_0x5f81('0xe'));var jsforce=require(_0x5f81('0xf'));var deskjs=require(_0x5f81('0x10'));var toCsv=require('to-csv');var querystring=require(_0x5f81('0x11'));var Papa=require(_0x5f81('0x12'));var Redis=require(_0x5f81('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x5f81('0x14'));var as=require(_0x5f81('0x15'));var hardwareService=require(_0x5f81('0x16'));var logger=require(_0x5f81('0x17'))(_0x5f81('0x18'));var utils=require('../../config/utils');var config=require(_0x5f81('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4518eb,_0x272dc6){_0x272dc6=_0x272dc6||0xcc;return function(_0x37de4e){if(_0x37de4e){return _0x4518eb['sendStatus'](_0x272dc6);}return _0x4518eb[_0x5f81('0x1a')](_0x272dc6)[_0x5f81('0x1b')]();};}function respondWithResult(_0x1c28cb,_0x561a73){_0x561a73=_0x561a73||0xc8;return function(_0x5a3e6d){if(_0x5a3e6d){return _0x1c28cb[_0x5f81('0x1a')](_0x561a73)[_0x5f81('0x1c')](_0x5a3e6d);}};}function respondWithFilteredResult(_0x586df7,_0x3b764d){return function(_0x5e6c21){if(_0x5e6c21){var _0x3fc36e=_0x5e6c21[_0x5f81('0x1d')],_0xdd79e4=_0x3b764d[_0x5f81('0x1e')],_0x30617d=_0x3b764d['offset']+_0x3b764d[_0x5f81('0x1f')],_0x2460bd;if(_0x30617d>=_0x3fc36e){_0x30617d=_0x3fc36e;_0x2460bd=0xc8;}else{_0x2460bd=0xce;}_0x586df7['status'](_0x2460bd);return _0x586df7[_0x5f81('0x20')](_0x5f81('0x21'),_0xdd79e4+'-'+_0x30617d+'/'+_0x3fc36e)['json'](_0x5e6c21);}return null;};}function patchUpdates(_0x51199b){return function(_0x2f0459){try{jsonpatch[_0x5f81('0x22')](_0x2f0459,_0x51199b,!![]);}catch(_0x2a1613){return BPromise[_0x5f81('0x23')](_0x2a1613);}return _0x2f0459['save']();};}function saveUpdates(_0x4842af,_0x4b59b3){return function(_0x826eb7){if(_0x826eb7){return _0x826eb7[_0x5f81('0x24')](_0x4842af)[_0x5f81('0x25')](function(_0x3d96e5){return _0x3d96e5;});}return null;};}function removeEntity(_0x8f110e,_0x573644){return function(_0x19126b){if(_0x19126b){return _0x19126b[_0x5f81('0x26')]()['then'](function(){_0x8f110e[_0x5f81('0x1a')](0xcc)[_0x5f81('0x1b')]();});}};}function handleEntityNotFound(_0x2e5f67,_0x3a1da0){return function(_0x445d32){if(!_0x445d32){_0x2e5f67[_0x5f81('0x27')](0x194);}return _0x445d32;};}function handleError(_0x6eff84,_0x3f9e3e){_0x3f9e3e=_0x3f9e3e||0x1f4;return function(_0x434963){logger[_0x5f81('0x28')](_0x434963[_0x5f81('0x29')]);if(_0x434963[_0x5f81('0x2a')]){delete _0x434963[_0x5f81('0x2a')];}_0x6eff84[_0x5f81('0x1a')](_0x3f9e3e)[_0x5f81('0x2b')](_0x434963);};}exports[_0x5f81('0x2c')]=function(_0x1c6cb9,_0x3de032){var _0x4c4c20={},_0x2502f4={},_0x336a28={'count':0x0,'rows':[]};var _0x42f755=db[_0x5f81('0x2d')][_0x5f81('0x2e')];_0x2502f4[_0x5f81('0x2f')]=_['keys'](_0x42f755);_0x2502f4['query']=_[_0x5f81('0x30')](_0x1c6cb9[_0x5f81('0x31')]);_0x2502f4[_0x5f81('0x32')]=_[_0x5f81('0x33')](_0x2502f4[_0x5f81('0x2f')],_0x2502f4[_0x5f81('0x31')]);_0x4c4c20[_0x5f81('0x34')]=_[_0x5f81('0x33')](_0x2502f4[_0x5f81('0x2f')],qs[_0x5f81('0x35')](_0x1c6cb9[_0x5f81('0x31')][_0x5f81('0x35')]));_0x4c4c20[_0x5f81('0x34')]=_0x4c4c20[_0x5f81('0x34')][_0x5f81('0x36')]?_0x4c4c20['attributes']:_0x2502f4['model'];if(!_0x1c6cb9[_0x5f81('0x31')][_0x5f81('0x37')](_0x5f81('0x38'))){_0x4c4c20[_0x5f81('0x1f')]=qs['limit'](_0x1c6cb9[_0x5f81('0x31')]['limit']);_0x4c4c20[_0x5f81('0x1e')]=qs[_0x5f81('0x1e')](_0x1c6cb9[_0x5f81('0x31')][_0x5f81('0x1e')]);}_0x4c4c20['order']=qs['sort'](_0x1c6cb9[_0x5f81('0x31')][_0x5f81('0x39')]);_0x4c4c20[_0x5f81('0x3a')]=qs[_0x5f81('0x32')](_['pick'](_0x1c6cb9['query'],_0x2502f4['filters']));if(_0x1c6cb9[_0x5f81('0x31')][_0x5f81('0x3b')]){_0x4c4c20[_0x5f81('0x3a')]=_[_0x5f81('0x3c')](_0x4c4c20[_0x5f81('0x3a')],{'$or':_[_0x5f81('0x3d')](_0x42f755,function(_0x19697a){if(_0x19697a[_0x5f81('0x3e')][_0x5f81('0x3f')]!==_0x5f81('0x40')){var _0x2b3394={};_0x2b3394[_0x19697a[_0x5f81('0x41')]]={'$like':'%'+_0x1c6cb9[_0x5f81('0x31')]['filter']+'%'};return _0x2b3394;}})});}_0x4c4c20=_[_0x5f81('0x3c')]({},_0x4c4c20,_0x1c6cb9[_0x5f81('0x42')]);var _0x5080a5={'where':_0x4c4c20[_0x5f81('0x3a')]};return db[_0x5f81('0x2d')]['count'](_0x5080a5)[_0x5f81('0x25')](function(_0x648409){_0x336a28['count']=_0x648409;if(_0x1c6cb9[_0x5f81('0x31')]['includeAll']){_0x4c4c20['include']=[{'all':!![]}];}return db[_0x5f81('0x2d')][_0x5f81('0x43')](_0x4c4c20);})[_0x5f81('0x25')](function(_0x51e2cd){_0x336a28['rows']=_0x51e2cd;return _0x336a28;})['then'](respondWithFilteredResult(_0x3de032,_0x4c4c20))[_0x5f81('0x44')](handleError(_0x3de032,null));};exports[_0x5f81('0x45')]=function(_0x356710,_0x3ffd2c){var _0x3fef42={'raw':![],'where':{'id':_0x356710[_0x5f81('0x46')]['id']}},_0xbc36aa={};_0xbc36aa['model']=_[_0x5f81('0x30')](db[_0x5f81('0x2d')][_0x5f81('0x2e')]);_0xbc36aa[_0x5f81('0x31')]=_[_0x5f81('0x30')](_0x356710['query']);_0xbc36aa['filters']=_[_0x5f81('0x33')](_0xbc36aa[_0x5f81('0x2f')],_0xbc36aa[_0x5f81('0x31')]);_0x3fef42['attributes']=_[_0x5f81('0x33')](_0xbc36aa[_0x5f81('0x2f')],qs[_0x5f81('0x35')](_0x356710[_0x5f81('0x31')]['fields']));_0x3fef42['attributes']=_0x3fef42['attributes'][_0x5f81('0x36')]?_0x3fef42[_0x5f81('0x34')]:_0xbc36aa[_0x5f81('0x2f')];if(_0x356710[_0x5f81('0x31')][_0x5f81('0x47')]){_0x3fef42['include']=[{'all':!![]}];}_0x3fef42=_[_0x5f81('0x3c')]({},_0x3fef42,_0x356710['options']);return db[_0x5f81('0x2d')][_0x5f81('0x48')](_0x3fef42)[_0x5f81('0x25')](handleEntityNotFound(_0x3ffd2c,null))[_0x5f81('0x25')](respondWithResult(_0x3ffd2c,null))[_0x5f81('0x44')](handleError(_0x3ffd2c,null));};exports[_0x5f81('0x49')]=function(_0x115aaa,_0x2fbd82){return db[_0x5f81('0x2d')][_0x5f81('0x49')](_0x115aaa[_0x5f81('0x4a')],{})[_0x5f81('0x25')](respondWithResult(_0x2fbd82,0xc9))[_0x5f81('0x44')](handleError(_0x2fbd82,null));};exports[_0x5f81('0x24')]=function(_0x37900d,_0x4f7eea){if(_0x37900d[_0x5f81('0x4a')]['id']){delete _0x37900d['body']['id'];}return db[_0x5f81('0x2d')][_0x5f81('0x48')]({'where':{'id':_0x37900d[_0x5f81('0x46')]['id']}})[_0x5f81('0x25')](handleEntityNotFound(_0x4f7eea,null))[_0x5f81('0x25')](saveUpdates(_0x37900d[_0x5f81('0x4a')],null))[_0x5f81('0x25')](respondWithResult(_0x4f7eea,null))['catch'](handleError(_0x4f7eea,null));};exports[_0x5f81('0x26')]=function(_0x1d520b,_0x2736dc){return db[_0x5f81('0x2d')][_0x5f81('0x48')]({'where':{'id':_0x1d520b[_0x5f81('0x46')]['id']}})[_0x5f81('0x25')](handleEntityNotFound(_0x2736dc,null))[_0x5f81('0x25')](removeEntity(_0x2736dc,null))['catch'](handleError(_0x2736dc,null));};exports['addConditions']=function(_0x5e0b30,_0x1e990b,_0x1681b8){return db[_0x5f81('0x4b')][_0x5f81('0x48')]({'where':{'id':_0x5e0b30['params']['id']}})[_0x5f81('0x25')](handleEntityNotFound(_0x1e990b,null))[_0x5f81('0x25')](function(_0x13c917){if(_0x13c917){return _0x13c917[_0x5f81('0x4c')](_0x5e0b30[_0x5f81('0x4a')]['ids'],_['omit'](_0x5e0b30[_0x5f81('0x4a')],[_0x5f81('0x4d'),'id'])||{});}})[_0x5f81('0x25')](respondWithResult(_0x1e990b,null))[_0x5f81('0x44')](handleError(_0x1e990b,null));};exports['getConditions']=function(_0x4aab6d,_0x58031f,_0x9d6c9d){var _0x2c4105={};var _0x54bcc1={};var _0x56546a;var _0x18f0ea;return db['Automation']['findOne']({'where':{'id':_0x4aab6d[_0x5f81('0x46')]['id']}})['then'](handleEntityNotFound(_0x58031f,null))[_0x5f81('0x25')](function(_0x5b9e1a){if(_0x5b9e1a){_0x56546a=_0x5b9e1a;_0x54bcc1[_0x5f81('0x2f')]=_['keys'](db[_0x5f81('0x4b')][_0x5f81('0x2e')]);_0x54bcc1['query']=_[_0x5f81('0x30')](_0x4aab6d[_0x5f81('0x31')]);_0x54bcc1[_0x5f81('0x32')]=_['intersection'](_0x54bcc1['model'],_0x54bcc1[_0x5f81('0x31')]);_0x2c4105[_0x5f81('0x34')]=_[_0x5f81('0x33')](_0x54bcc1[_0x5f81('0x2f')],qs[_0x5f81('0x35')](_0x4aab6d[_0x5f81('0x31')]['fields']));_0x2c4105['attributes']=_0x2c4105[_0x5f81('0x34')][_0x5f81('0x36')]?_0x2c4105['attributes']:_0x54bcc1[_0x5f81('0x2f')];_0x2c4105[_0x5f81('0x4e')]=qs[_0x5f81('0x39')](_0x4aab6d[_0x5f81('0x31')][_0x5f81('0x39')]);_0x2c4105[_0x5f81('0x3a')]=qs[_0x5f81('0x32')](_['pick'](_0x4aab6d[_0x5f81('0x31')],_0x54bcc1[_0x5f81('0x32')]));if(_0x4aab6d['query'][_0x5f81('0x3b')]){_0x2c4105['where']=_[_0x5f81('0x3c')](_0x2c4105[_0x5f81('0x3a')],{'$or':_[_0x5f81('0x3d')](_0x2c4105['attributes'],function(_0x43a02a){var _0x2e6de9={};_0x2e6de9[_0x43a02a]={'$like':'%'+_0x4aab6d['query'][_0x5f81('0x3b')]+'%'};return _0x2e6de9;})});}_0x2c4105=_[_0x5f81('0x3c')]({},_0x2c4105,_0x4aab6d[_0x5f81('0x42')]);return _0x56546a[_0x5f81('0x4f')](_0x2c4105);}})['then'](function(_0x931e6a){if(_0x931e6a){_0x18f0ea=_0x931e6a[_0x5f81('0x36')];if(!_0x4aab6d[_0x5f81('0x31')][_0x5f81('0x37')](_0x5f81('0x38'))){_0x2c4105[_0x5f81('0x1f')]=qs['limit'](_0x4aab6d['query']['limit']);_0x2c4105[_0x5f81('0x1e')]=qs[_0x5f81('0x1e')](_0x4aab6d[_0x5f81('0x31')][_0x5f81('0x1e')]);}return _0x56546a[_0x5f81('0x4f')](_0x2c4105);}})['then'](function(_0x3415fb){if(_0x3415fb){return _0x3415fb?{'count':_0x18f0ea,'rows':_0x3415fb}:null;}})[_0x5f81('0x25')](respondWithResult(_0x58031f,null))[_0x5f81('0x44')](handleError(_0x58031f,null));};exports['addActions']=function(_0x1d1285,_0x508b4e,_0x10f481){return db[_0x5f81('0x50')]['find']({'where':{'id':_0x1d1285['params']['id']}})['then'](handleEntityNotFound(_0x508b4e,null))[_0x5f81('0x25')](function(_0x170527){if(_0x170527){return _0x170527[_0x5f81('0x51')](_0x1d1285[_0x5f81('0x4a')][_0x5f81('0x4d')],_[_0x5f81('0x52')](_0x1d1285['body'],[_0x5f81('0x4d'),'id'])||{});}})[_0x5f81('0x25')](respondWithResult(_0x508b4e,null))[_0x5f81('0x44')](handleError(_0x508b4e,null));};exports[_0x5f81('0x53')]=function(_0x41c885,_0x30cd93,_0x214ffa){var _0x4048f1={};var _0x311371={};var _0xa40921;var _0x1fa173;return db['Automation'][_0x5f81('0x54')]({'where':{'id':_0x41c885[_0x5f81('0x46')]['id']}})[_0x5f81('0x25')](handleEntityNotFound(_0x30cd93,null))[_0x5f81('0x25')](function(_0x1a79eb){if(_0x1a79eb){_0xa40921=_0x1a79eb;_0x311371[_0x5f81('0x2f')]=_['keys'](db['Action']['rawAttributes']);_0x311371['query']=_['keys'](_0x41c885[_0x5f81('0x31')]);_0x311371[_0x5f81('0x32')]=_[_0x5f81('0x33')](_0x311371[_0x5f81('0x2f')],_0x311371[_0x5f81('0x31')]);_0x4048f1[_0x5f81('0x34')]=_[_0x5f81('0x33')](_0x311371[_0x5f81('0x2f')],qs[_0x5f81('0x35')](_0x41c885['query'][_0x5f81('0x35')]));_0x4048f1[_0x5f81('0x34')]=_0x4048f1[_0x5f81('0x34')]['length']?_0x4048f1[_0x5f81('0x34')]:_0x311371['model'];_0x4048f1[_0x5f81('0x4e')]=qs[_0x5f81('0x39')](_0x41c885[_0x5f81('0x31')][_0x5f81('0x39')]);_0x4048f1[_0x5f81('0x3a')]=qs[_0x5f81('0x32')](_[_0x5f81('0x55')](_0x41c885[_0x5f81('0x31')],_0x311371['filters']));if(_0x41c885['query'][_0x5f81('0x3b')]){_0x4048f1[_0x5f81('0x3a')]=_[_0x5f81('0x3c')](_0x4048f1[_0x5f81('0x3a')],{'$or':_[_0x5f81('0x3d')](_0x4048f1[_0x5f81('0x34')],function(_0x1b464d){var _0x18c243={};_0x18c243[_0x1b464d]={'$like':'%'+_0x41c885['query'][_0x5f81('0x3b')]+'%'};return _0x18c243;})});}_0x4048f1=_['merge']({},_0x4048f1,_0x41c885[_0x5f81('0x42')]);return _0xa40921[_0x5f81('0x53')](_0x4048f1);}})[_0x5f81('0x25')](function(_0x3963e4){if(_0x3963e4){_0x1fa173=_0x3963e4[_0x5f81('0x36')];if(!_0x41c885[_0x5f81('0x31')][_0x5f81('0x37')]('nolimit')){_0x4048f1['limit']=qs[_0x5f81('0x1f')](_0x41c885[_0x5f81('0x31')][_0x5f81('0x1f')]);_0x4048f1[_0x5f81('0x1e')]=qs[_0x5f81('0x1e')](_0x41c885[_0x5f81('0x31')][_0x5f81('0x1e')]);}return _0xa40921[_0x5f81('0x53')](_0x4048f1);}})[_0x5f81('0x25')](function(_0x5a4941){if(_0x5a4941){return _0x5a4941?{'count':_0x1fa173,'rows':_0x5a4941}:null;}})[_0x5f81('0x25')](respondWithResult(_0x30cd93,null))[_0x5f81('0x44')](handleError(_0x30cd93,null));}; \ No newline at end of file +var _0x165b=['map','getConditions','nolimit','addActions','Action','findOne','getActions','html-pdf','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','apply','reject','save','update','then','destroy','stack','name','send','Automation','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','type','key','field','options','includeAll','include','findAll','rows','catch','find','create','body','params','addConditions','ids','omit'];(function(_0x4b653a,_0x1e0b9c){var _0x5d8021=function(_0x373816){while(--_0x373816){_0x4b653a['push'](_0x4b653a['shift']());}};_0x5d8021(++_0x1e0b9c);}(_0x165b,0x1ed));var _0xb165=function(_0x77779b,_0x21eefe){_0x77779b=_0x77779b-0x0;var _0x16403a=_0x165b[_0x77779b];return _0x16403a;};'use strict';var pdf=require(_0xb165('0x0'));var emlformat=require(_0xb165('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xb165('0x2'));var rp=require(_0xb165('0x3'));var moment=require(_0xb165('0x4'));var BPromise=require(_0xb165('0x5'));var Mustache=require(_0xb165('0x6'));var util=require(_0xb165('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xb165('0x8'));var ejs=require(_0xb165('0x9'));var fs=require('fs');var _=require(_0xb165('0xa'));var squel=require(_0xb165('0xb'));var crypto=require('crypto');var jsforce=require(_0xb165('0xc'));var deskjs=require(_0xb165('0xd'));var toCsv=require(_0xb165('0x8'));var querystring=require(_0xb165('0xe'));var Papa=require(_0xb165('0xf'));var Redis=require(_0xb165('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xb165('0x11'));var as=require(_0xb165('0x12'));var hardwareService=require(_0xb165('0x13'));var logger=require(_0xb165('0x14'))(_0xb165('0x15'));var utils=require(_0xb165('0x16'));var config=require('../../config/environment');var db=require(_0xb165('0x17'))['db'];function respondWithStatusCode(_0x10400f,_0x2ed7b6){_0x2ed7b6=_0x2ed7b6||0xcc;return function(_0x39deb8){if(_0x39deb8){return _0x10400f[_0xb165('0x18')](_0x2ed7b6);}return _0x10400f[_0xb165('0x19')](_0x2ed7b6)[_0xb165('0x1a')]();};}function respondWithResult(_0x457295,_0x3ca058){_0x3ca058=_0x3ca058||0xc8;return function(_0x37bef5){if(_0x37bef5){return _0x457295[_0xb165('0x19')](_0x3ca058)[_0xb165('0x1b')](_0x37bef5);}};}function respondWithFilteredResult(_0x24bfb4,_0x5c36a1){return function(_0x3db84c){if(_0x3db84c){var _0x1c6466=_0x3db84c[_0xb165('0x1c')],_0x1b5170=_0x5c36a1[_0xb165('0x1d')],_0x10f7a8=_0x5c36a1[_0xb165('0x1d')]+_0x5c36a1[_0xb165('0x1e')],_0x334595;if(_0x10f7a8>=_0x1c6466){_0x10f7a8=_0x1c6466;_0x334595=0xc8;}else{_0x334595=0xce;}_0x24bfb4[_0xb165('0x19')](_0x334595);return _0x24bfb4[_0xb165('0x1f')]('Content-Range',_0x1b5170+'-'+_0x10f7a8+'/'+_0x1c6466)[_0xb165('0x1b')](_0x3db84c);}return null;};}function patchUpdates(_0x31bfa6){return function(_0xf1062d){try{jsonpatch[_0xb165('0x20')](_0xf1062d,_0x31bfa6,!![]);}catch(_0x61c2db){return BPromise[_0xb165('0x21')](_0x61c2db);}return _0xf1062d[_0xb165('0x22')]();};}function saveUpdates(_0x2bba30,_0x388165){return function(_0x443006){if(_0x443006){return _0x443006[_0xb165('0x23')](_0x2bba30)[_0xb165('0x24')](function(_0x3f4e00){return _0x3f4e00;});}return null;};}function removeEntity(_0xf7ef25,_0x45c0a0){return function(_0x47c69f){if(_0x47c69f){return _0x47c69f[_0xb165('0x25')]()['then'](function(){_0xf7ef25[_0xb165('0x19')](0xcc)[_0xb165('0x1a')]();});}};}function handleEntityNotFound(_0x14f156,_0x597af1){return function(_0x8e7bd){if(!_0x8e7bd){_0x14f156[_0xb165('0x18')](0x194);}return _0x8e7bd;};}function handleError(_0x35d1a0,_0x47c8a6){_0x47c8a6=_0x47c8a6||0x1f4;return function(_0xb3cf3c){logger['error'](_0xb3cf3c[_0xb165('0x26')]);if(_0xb3cf3c[_0xb165('0x27')]){delete _0xb3cf3c[_0xb165('0x27')];}_0x35d1a0[_0xb165('0x19')](_0x47c8a6)[_0xb165('0x28')](_0xb3cf3c);};}exports['index']=function(_0x533149,_0x5c573e){var _0x4b38a2={},_0x2505d2={},_0x4cecc3={'count':0x0,'rows':[]};var _0x2fd5fe=db[_0xb165('0x29')][_0xb165('0x2a')];_0x2505d2[_0xb165('0x2b')]=_[_0xb165('0x2c')](_0x2fd5fe);_0x2505d2[_0xb165('0x2d')]=_[_0xb165('0x2c')](_0x533149['query']);_0x2505d2[_0xb165('0x2e')]=_[_0xb165('0x2f')](_0x2505d2[_0xb165('0x2b')],_0x2505d2[_0xb165('0x2d')]);_0x4b38a2[_0xb165('0x30')]=_['intersection'](_0x2505d2[_0xb165('0x2b')],qs[_0xb165('0x31')](_0x533149[_0xb165('0x2d')]['fields']));_0x4b38a2[_0xb165('0x30')]=_0x4b38a2[_0xb165('0x30')][_0xb165('0x32')]?_0x4b38a2['attributes']:_0x2505d2[_0xb165('0x2b')];if(!_0x533149['query'][_0xb165('0x33')]('nolimit')){_0x4b38a2[_0xb165('0x1e')]=qs[_0xb165('0x1e')](_0x533149[_0xb165('0x2d')][_0xb165('0x1e')]);_0x4b38a2[_0xb165('0x1d')]=qs[_0xb165('0x1d')](_0x533149[_0xb165('0x2d')][_0xb165('0x1d')]);}_0x4b38a2[_0xb165('0x34')]=qs['sort'](_0x533149[_0xb165('0x2d')][_0xb165('0x35')]);_0x4b38a2[_0xb165('0x36')]=qs[_0xb165('0x2e')](_[_0xb165('0x37')](_0x533149[_0xb165('0x2d')],_0x2505d2[_0xb165('0x2e')]));if(_0x533149[_0xb165('0x2d')][_0xb165('0x38')]){_0x4b38a2[_0xb165('0x36')]=_[_0xb165('0x39')](_0x4b38a2[_0xb165('0x36')],{'$or':_['map'](_0x2fd5fe,function(_0xf2aaf4){if(_0xf2aaf4[_0xb165('0x3a')][_0xb165('0x3b')]!=='VIRTUAL'){var _0x2331e9={};_0x2331e9[_0xf2aaf4[_0xb165('0x3c')]]={'$like':'%'+_0x533149[_0xb165('0x2d')][_0xb165('0x38')]+'%'};return _0x2331e9;}})});}_0x4b38a2=_[_0xb165('0x39')]({},_0x4b38a2,_0x533149[_0xb165('0x3d')]);var _0x290591={'where':_0x4b38a2['where']};return db['Automation'][_0xb165('0x1c')](_0x290591)[_0xb165('0x24')](function(_0x3c1149){_0x4cecc3['count']=_0x3c1149;if(_0x533149[_0xb165('0x2d')][_0xb165('0x3e')]){_0x4b38a2[_0xb165('0x3f')]=[{'all':!![]}];}return db[_0xb165('0x29')][_0xb165('0x40')](_0x4b38a2);})[_0xb165('0x24')](function(_0x64c79b){_0x4cecc3[_0xb165('0x41')]=_0x64c79b;return _0x4cecc3;})[_0xb165('0x24')](respondWithFilteredResult(_0x5c573e,_0x4b38a2))[_0xb165('0x42')](handleError(_0x5c573e,null));};exports['show']=function(_0x4f40b0,_0x3ad01a){var _0x48ce27={'raw':![],'where':{'id':_0x4f40b0['params']['id']}},_0x4b9410={};_0x4b9410[_0xb165('0x2b')]=_[_0xb165('0x2c')](db[_0xb165('0x29')][_0xb165('0x2a')]);_0x4b9410[_0xb165('0x2d')]=_[_0xb165('0x2c')](_0x4f40b0['query']);_0x4b9410[_0xb165('0x2e')]=_[_0xb165('0x2f')](_0x4b9410['model'],_0x4b9410['query']);_0x48ce27[_0xb165('0x30')]=_[_0xb165('0x2f')](_0x4b9410[_0xb165('0x2b')],qs[_0xb165('0x31')](_0x4f40b0[_0xb165('0x2d')]['fields']));_0x48ce27[_0xb165('0x30')]=_0x48ce27['attributes']['length']?_0x48ce27['attributes']:_0x4b9410[_0xb165('0x2b')];if(_0x4f40b0[_0xb165('0x2d')][_0xb165('0x3e')]){_0x48ce27[_0xb165('0x3f')]=[{'all':!![]}];}_0x48ce27=_[_0xb165('0x39')]({},_0x48ce27,_0x4f40b0[_0xb165('0x3d')]);return db[_0xb165('0x29')][_0xb165('0x43')](_0x48ce27)[_0xb165('0x24')](handleEntityNotFound(_0x3ad01a,null))[_0xb165('0x24')](respondWithResult(_0x3ad01a,null))['catch'](handleError(_0x3ad01a,null));};exports[_0xb165('0x44')]=function(_0x5fdbff,_0x1322bc){return db[_0xb165('0x29')][_0xb165('0x44')](_0x5fdbff[_0xb165('0x45')],{})[_0xb165('0x24')](respondWithResult(_0x1322bc,0xc9))[_0xb165('0x42')](handleError(_0x1322bc,null));};exports[_0xb165('0x23')]=function(_0x169e31,_0x1a918e){if(_0x169e31[_0xb165('0x45')]['id']){delete _0x169e31['body']['id'];}return db[_0xb165('0x29')][_0xb165('0x43')]({'where':{'id':_0x169e31[_0xb165('0x46')]['id']}})[_0xb165('0x24')](handleEntityNotFound(_0x1a918e,null))[_0xb165('0x24')](saveUpdates(_0x169e31[_0xb165('0x45')],null))[_0xb165('0x24')](respondWithResult(_0x1a918e,null))[_0xb165('0x42')](handleError(_0x1a918e,null));};exports[_0xb165('0x25')]=function(_0x36bb28,_0x3cd0f0){return db[_0xb165('0x29')][_0xb165('0x43')]({'where':{'id':_0x36bb28[_0xb165('0x46')]['id']}})[_0xb165('0x24')](handleEntityNotFound(_0x3cd0f0,null))[_0xb165('0x24')](removeEntity(_0x3cd0f0,null))[_0xb165('0x42')](handleError(_0x3cd0f0,null));};exports[_0xb165('0x47')]=function(_0xcac622,_0x4b8f2a,_0x17f835){return db['Condition'][_0xb165('0x43')]({'where':{'id':_0xcac622[_0xb165('0x46')]['id']}})[_0xb165('0x24')](handleEntityNotFound(_0x4b8f2a,null))[_0xb165('0x24')](function(_0x55340a){if(_0x55340a){return _0x55340a[_0xb165('0x47')](_0xcac622[_0xb165('0x45')][_0xb165('0x48')],_[_0xb165('0x49')](_0xcac622[_0xb165('0x45')],[_0xb165('0x48'),'id'])||{});}})['then'](respondWithResult(_0x4b8f2a,null))[_0xb165('0x42')](handleError(_0x4b8f2a,null));};exports['getConditions']=function(_0x342c1f,_0x5e63f5,_0x4cabde){var _0x401c6e={};var _0x6a0e4b={};var _0x161df9;var _0x6ee94d;return db[_0xb165('0x29')]['findOne']({'where':{'id':_0x342c1f[_0xb165('0x46')]['id']}})[_0xb165('0x24')](handleEntityNotFound(_0x5e63f5,null))['then'](function(_0x34c60c){if(_0x34c60c){_0x161df9=_0x34c60c;_0x6a0e4b[_0xb165('0x2b')]=_[_0xb165('0x2c')](db['Condition'][_0xb165('0x2a')]);_0x6a0e4b[_0xb165('0x2d')]=_[_0xb165('0x2c')](_0x342c1f[_0xb165('0x2d')]);_0x6a0e4b[_0xb165('0x2e')]=_[_0xb165('0x2f')](_0x6a0e4b[_0xb165('0x2b')],_0x6a0e4b['query']);_0x401c6e[_0xb165('0x30')]=_['intersection'](_0x6a0e4b[_0xb165('0x2b')],qs[_0xb165('0x31')](_0x342c1f['query'][_0xb165('0x31')]));_0x401c6e[_0xb165('0x30')]=_0x401c6e[_0xb165('0x30')][_0xb165('0x32')]?_0x401c6e['attributes']:_0x6a0e4b['model'];_0x401c6e['order']=qs[_0xb165('0x35')](_0x342c1f['query']['sort']);_0x401c6e[_0xb165('0x36')]=qs['filters'](_[_0xb165('0x37')](_0x342c1f[_0xb165('0x2d')],_0x6a0e4b[_0xb165('0x2e')]));if(_0x342c1f[_0xb165('0x2d')][_0xb165('0x38')]){_0x401c6e[_0xb165('0x36')]=_[_0xb165('0x39')](_0x401c6e[_0xb165('0x36')],{'$or':_[_0xb165('0x4a')](_0x401c6e[_0xb165('0x30')],function(_0x2cd6d2){var _0x2df585={};_0x2df585[_0x2cd6d2]={'$like':'%'+_0x342c1f[_0xb165('0x2d')][_0xb165('0x38')]+'%'};return _0x2df585;})});}_0x401c6e=_[_0xb165('0x39')]({},_0x401c6e,_0x342c1f[_0xb165('0x3d')]);return _0x161df9[_0xb165('0x4b')](_0x401c6e);}})['then'](function(_0x58461d){if(_0x58461d){_0x6ee94d=_0x58461d[_0xb165('0x32')];if(!_0x342c1f[_0xb165('0x2d')][_0xb165('0x33')](_0xb165('0x4c'))){_0x401c6e[_0xb165('0x1e')]=qs['limit'](_0x342c1f[_0xb165('0x2d')][_0xb165('0x1e')]);_0x401c6e[_0xb165('0x1d')]=qs['offset'](_0x342c1f[_0xb165('0x2d')][_0xb165('0x1d')]);}return _0x161df9[_0xb165('0x4b')](_0x401c6e);}})[_0xb165('0x24')](function(_0x531c19){if(_0x531c19){return _0x531c19?{'count':_0x6ee94d,'rows':_0x531c19}:null;}})[_0xb165('0x24')](respondWithResult(_0x5e63f5,null))[_0xb165('0x42')](handleError(_0x5e63f5,null));};exports[_0xb165('0x4d')]=function(_0x56a882,_0x3695e1,_0x395368){return db[_0xb165('0x4e')][_0xb165('0x43')]({'where':{'id':_0x56a882[_0xb165('0x46')]['id']}})[_0xb165('0x24')](handleEntityNotFound(_0x3695e1,null))[_0xb165('0x24')](function(_0x1ab29c){if(_0x1ab29c){return _0x1ab29c[_0xb165('0x4d')](_0x56a882['body'][_0xb165('0x48')],_[_0xb165('0x49')](_0x56a882[_0xb165('0x45')],[_0xb165('0x48'),'id'])||{});}})[_0xb165('0x24')](respondWithResult(_0x3695e1,null))[_0xb165('0x42')](handleError(_0x3695e1,null));};exports['getActions']=function(_0x48c03f,_0x38c9a8,_0x37b52b){var _0x1f2612={};var _0x461975={};var _0x1f029c;var _0x2a0667;return db[_0xb165('0x29')][_0xb165('0x4f')]({'where':{'id':_0x48c03f['params']['id']}})[_0xb165('0x24')](handleEntityNotFound(_0x38c9a8,null))[_0xb165('0x24')](function(_0x326118){if(_0x326118){_0x1f029c=_0x326118;_0x461975[_0xb165('0x2b')]=_[_0xb165('0x2c')](db['Action'][_0xb165('0x2a')]);_0x461975[_0xb165('0x2d')]=_[_0xb165('0x2c')](_0x48c03f[_0xb165('0x2d')]);_0x461975[_0xb165('0x2e')]=_[_0xb165('0x2f')](_0x461975[_0xb165('0x2b')],_0x461975[_0xb165('0x2d')]);_0x1f2612[_0xb165('0x30')]=_[_0xb165('0x2f')](_0x461975[_0xb165('0x2b')],qs['fields'](_0x48c03f[_0xb165('0x2d')]['fields']));_0x1f2612[_0xb165('0x30')]=_0x1f2612[_0xb165('0x30')][_0xb165('0x32')]?_0x1f2612[_0xb165('0x30')]:_0x461975[_0xb165('0x2b')];_0x1f2612[_0xb165('0x34')]=qs[_0xb165('0x35')](_0x48c03f[_0xb165('0x2d')]['sort']);_0x1f2612['where']=qs[_0xb165('0x2e')](_[_0xb165('0x37')](_0x48c03f[_0xb165('0x2d')],_0x461975[_0xb165('0x2e')]));if(_0x48c03f[_0xb165('0x2d')][_0xb165('0x38')]){_0x1f2612[_0xb165('0x36')]=_['merge'](_0x1f2612[_0xb165('0x36')],{'$or':_[_0xb165('0x4a')](_0x1f2612['attributes'],function(_0x4cf5ec){var _0x555953={};_0x555953[_0x4cf5ec]={'$like':'%'+_0x48c03f[_0xb165('0x2d')][_0xb165('0x38')]+'%'};return _0x555953;})});}_0x1f2612=_[_0xb165('0x39')]({},_0x1f2612,_0x48c03f[_0xb165('0x3d')]);return _0x1f029c[_0xb165('0x50')](_0x1f2612);}})[_0xb165('0x24')](function(_0x3bf8b7){if(_0x3bf8b7){_0x2a0667=_0x3bf8b7[_0xb165('0x32')];if(!_0x48c03f['query']['hasOwnProperty'](_0xb165('0x4c'))){_0x1f2612[_0xb165('0x1e')]=qs['limit'](_0x48c03f['query'][_0xb165('0x1e')]);_0x1f2612[_0xb165('0x1d')]=qs[_0xb165('0x1d')](_0x48c03f[_0xb165('0x2d')][_0xb165('0x1d')]);}return _0x1f029c[_0xb165('0x50')](_0x1f2612);}})[_0xb165('0x24')](function(_0x137c90){if(_0x137c90){return _0x137c90?{'count':_0x2a0667,'rows':_0x137c90}:null;}})['then'](respondWithResult(_0x38c9a8,null))[_0xb165('0x42')](handleError(_0x38c9a8,null));}; \ No newline at end of file diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js index febbd78..2d387e5 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 _0x0b83=['request-promise','path','rimraf','../../config/environment','define','tools_automations','lodash','util','api','moment','bluebird'];(function(_0x3a9802,_0x4bb06e){var _0x38e32a=function(_0x528565){while(--_0x528565){_0x3a9802['push'](_0x3a9802['shift']());}};_0x38e32a(++_0x4bb06e);}(_0x0b83,0x7f));var _0x30b8=function(_0x34b63c,_0x1ae608){_0x34b63c=_0x34b63c-0x0;var _0x128978=_0x0b83[_0x34b63c];return _0x128978;};'use strict';var _=require(_0x30b8('0x0'));var util=require(_0x30b8('0x1'));var logger=require('../../config/logger')(_0x30b8('0x2'));var moment=require(_0x30b8('0x3'));var BPromise=require(_0x30b8('0x4'));var rp=require(_0x30b8('0x5'));var fs=require('fs');var path=require(_0x30b8('0x6'));var rimraf=require(_0x30b8('0x7'));var config=require(_0x30b8('0x8'));var attributes=require('./automation.attributes');module['exports']=function(_0x25698d,_0x205d4b){return _0x25698d[_0x30b8('0x9')]('Automation',attributes,{'tableName':_0x30b8('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6df5=['util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','define','Automation','lodash'];(function(_0x12fc8d,_0x19ee33){var _0x3f9d04=function(_0x52e51c){while(--_0x52e51c){_0x12fc8d['push'](_0x12fc8d['shift']());}};_0x3f9d04(++_0x19ee33);}(_0x6df5,0x1e9));var _0x56df=function(_0x5e1eae,_0x2d2a56){_0x5e1eae=_0x5e1eae-0x0;var _0x3217c5=_0x6df5[_0x5e1eae];return _0x3217c5;};'use strict';var _=require(_0x56df('0x0'));var util=require(_0x56df('0x1'));var logger=require(_0x56df('0x2'))(_0x56df('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x56df('0x4'));var fs=require('fs');var path=require(_0x56df('0x5'));var rimraf=require(_0x56df('0x6'));var config=require(_0x56df('0x7'));var attributes=require('./automation.attributes');module['exports']=function(_0x5e5538,_0x5f2903){return _0x5e5538[_0x56df('0x8')](_0x56df('0x9'),attributes,{'tableName':'tools_automations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/automation/automation.rpc.js b/server/api/automation/automation.rpc.js index 1e32cca..ea2214b 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 _0x8bfc=['message','result','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','Automation,\x20%s,\x20%s','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0xcae13a,_0x48a74b){var _0x4a2662=function(_0x2d5bb2){while(--_0x2d5bb2){_0xcae13a['push'](_0xcae13a['shift']());}};_0x4a2662(++_0x48a74b);}(_0x8bfc,0xdf));var _0xc8bf=function(_0xbc4560,_0x4020b8){_0xbc4560=_0xbc4560-0x0;var _0x298cfb=_0x8bfc[_0xbc4560];return _0x298cfb;};'use strict';var _=require(_0xc8bf('0x0'));var util=require(_0xc8bf('0x1'));var moment=require(_0xc8bf('0x2'));var BPromise=require(_0xc8bf('0x3'));var rs=require(_0xc8bf('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xc8bf('0x5'));var logger=require(_0xc8bf('0x6'))('rpc');var config=require(_0xc8bf('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xc8bf('0x8')][_0xc8bf('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x32e038,_0x1e5081,_0x47ddb2){return new BPromise(function(_0x3451ed,_0x197241){return client[_0xc8bf('0xa')](_0x32e038,_0x47ddb2)[_0xc8bf('0xb')](function(_0x13bdb0){logger['info'](_0xc8bf('0xc'),_0x1e5081,_0xc8bf('0xd'));logger[_0xc8bf('0xe')](_0xc8bf('0xf'),_0x1e5081,_0xc8bf('0xd'),JSON[_0xc8bf('0x10')](_0x13bdb0));if(_0x13bdb0[_0xc8bf('0x11')]){if(_0x13bdb0['error'][_0xc8bf('0x12')]===0x1f4){logger['error']('Automation,\x20%s,\x20%s',_0x1e5081,_0x13bdb0[_0xc8bf('0x11')][_0xc8bf('0x13')]);return _0x197241(_0x13bdb0[_0xc8bf('0x11')][_0xc8bf('0x13')]);}logger[_0xc8bf('0x11')](_0xc8bf('0xc'),_0x1e5081,_0x13bdb0[_0xc8bf('0x11')][_0xc8bf('0x13')]);return _0x3451ed(_0x13bdb0['error']['message']);}else{logger['info'](_0xc8bf('0xc'),_0x1e5081,_0xc8bf('0xd'));_0x3451ed(_0x13bdb0[_0xc8bf('0x14')][_0xc8bf('0x13')]);}})[_0xc8bf('0x15')](function(_0x17820){logger[_0xc8bf('0x11')](_0xc8bf('0xc'),_0x1e5081,_0x17820);_0x197241(_0x17820);});});} \ No newline at end of file +var _0x7167=['info','Automation,\x20%s,\x20%s','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','jayson/promise','client','http','then'];(function(_0xf7bc,_0x3e2655){var _0x4c0f9d=function(_0x3ce601){while(--_0x3ce601){_0xf7bc['push'](_0xf7bc['shift']());}};_0x4c0f9d(++_0x3e2655);}(_0x7167,0xaa));var _0x7716=function(_0x923ab6,_0x200ec5){_0x923ab6=_0x923ab6-0x0;var _0x484752=_0x7167[_0x923ab6];return _0x484752;};'use strict';var _=require(_0x7716('0x0'));var util=require(_0x7716('0x1'));var moment=require(_0x7716('0x2'));var BPromise=require('bluebird');var rs=require(_0x7716('0x3'));var fs=require('fs');var Redis=require(_0x7716('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x7716('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x7716('0x6'));var client=jayson[_0x7716('0x7')][_0x7716('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2803cb,_0x42c5ef,_0x39add0){return new BPromise(function(_0x3d6afa,_0x51d0bf){return client['request'](_0x2803cb,_0x39add0)[_0x7716('0x9')](function(_0x18e0c9){logger[_0x7716('0xa')](_0x7716('0xb'),_0x42c5ef,_0x7716('0xc'));logger[_0x7716('0xd')](_0x7716('0xe'),_0x42c5ef,_0x7716('0xc'),JSON[_0x7716('0xf')](_0x18e0c9));if(_0x18e0c9['error']){if(_0x18e0c9[_0x7716('0x10')][_0x7716('0x11')]===0x1f4){logger[_0x7716('0x10')](_0x7716('0xb'),_0x42c5ef,_0x18e0c9[_0x7716('0x10')]['message']);return _0x51d0bf(_0x18e0c9[_0x7716('0x10')]['message']);}logger[_0x7716('0x10')]('Automation,\x20%s,\x20%s',_0x42c5ef,_0x18e0c9['error'][_0x7716('0x12')]);return _0x3d6afa(_0x18e0c9['error'][_0x7716('0x12')]);}else{logger[_0x7716('0xa')]('Automation,\x20%s,\x20%s',_0x42c5ef,'request\x20sent');_0x3d6afa(_0x18e0c9['result'][_0x7716('0x12')]);}})[_0x7716('0x13')](function(_0x3173a4){logger[_0x7716('0x10')]('Automation,\x20%s,\x20%s',_0x42c5ef,_0x3173a4);_0x51d0bf(_0x3173a4);});});} \ No newline at end of file diff --git a/server/api/automation/index.js b/server/api/automation/index.js index 27d33e0..214d0a6 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 _0x7cdc=['addActions','put','update','destroy','util','path','express','Router','../../components/auth/service','../../config/environment','./automation.controller','isAuthenticated','index','get','/:id','show','/:id/actions','getActions','create','post','/:id/conditions','addConditions'];(function(_0x393a76,_0x10e845){var _0x2da669=function(_0x11e431){while(--_0x11e431){_0x393a76['push'](_0x393a76['shift']());}};_0x2da669(++_0x10e845);}(_0x7cdc,0x190));var _0xc7cd=function(_0x2758f6,_0x1dbb85){_0x2758f6=_0x2758f6-0x0;var _0x437ccf=_0x7cdc[_0x2758f6];return _0x437ccf;};'use strict';var multer=require('multer');var util=require(_0xc7cd('0x0'));var path=require(_0xc7cd('0x1'));var timeout=require('connect-timeout');var express=require(_0xc7cd('0x2'));var router=express[_0xc7cd('0x3')]();var auth=require(_0xc7cd('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xc7cd('0x5'));var controller=require(_0xc7cd('0x6'));router['get']('/',auth[_0xc7cd('0x7')](),controller[_0xc7cd('0x8')]);router[_0xc7cd('0x9')](_0xc7cd('0xa'),auth[_0xc7cd('0x7')](),controller[_0xc7cd('0xb')]);router[_0xc7cd('0x9')]('/:id/conditions',auth[_0xc7cd('0x7')](),controller['getConditions']);router[_0xc7cd('0x9')](_0xc7cd('0xc'),auth[_0xc7cd('0x7')](),controller[_0xc7cd('0xd')]);router['post']('/',auth[_0xc7cd('0x7')](),controller[_0xc7cd('0xe')]);router[_0xc7cd('0xf')](_0xc7cd('0x10'),auth['isAuthenticated'](),controller[_0xc7cd('0x11')]);router['post'](_0xc7cd('0xc'),auth[_0xc7cd('0x7')](),controller[_0xc7cd('0x12')]);router[_0xc7cd('0x13')]('/:id',auth[_0xc7cd('0x7')](),controller[_0xc7cd('0x14')]);router['delete'](_0xc7cd('0xa'),auth['isAuthenticated'](),controller[_0xc7cd('0x15')]);module['exports']=router; \ No newline at end of file +var _0x952b=['exports','multer','path','connect-timeout','Router','./automation.controller','get','index','/:id','/:id/conditions','isAuthenticated','getConditions','getActions','post','create','addConditions','addActions','put','update'];(function(_0x50748b,_0x3ac11b){var _0x5a73a8=function(_0x596645){while(--_0x596645){_0x50748b['push'](_0x50748b['shift']());}};_0x5a73a8(++_0x3ac11b);}(_0x952b,0x99));var _0xb952=function(_0x14bf63,_0xdbd373){_0x14bf63=_0x14bf63-0x0;var _0x410d22=_0x952b[_0x14bf63];return _0x410d22;};'use strict';var multer=require(_0xb952('0x0'));var util=require('util');var path=require(_0xb952('0x1'));var timeout=require(_0xb952('0x2'));var express=require('express');var router=express[_0xb952('0x3')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xb952('0x4'));router[_0xb952('0x5')]('/',auth['isAuthenticated'](),controller[_0xb952('0x6')]);router[_0xb952('0x5')](_0xb952('0x7'),auth['isAuthenticated'](),controller['show']);router[_0xb952('0x5')](_0xb952('0x8'),auth[_0xb952('0x9')](),controller[_0xb952('0xa')]);router[_0xb952('0x5')]('/:id/actions',auth[_0xb952('0x9')](),controller[_0xb952('0xb')]);router[_0xb952('0xc')]('/',auth['isAuthenticated'](),controller[_0xb952('0xd')]);router[_0xb952('0xc')](_0xb952('0x8'),auth[_0xb952('0x9')](),controller[_0xb952('0xe')]);router[_0xb952('0xc')]('/:id/actions',auth[_0xb952('0x9')](),controller[_0xb952('0xf')]);router[_0xb952('0x10')](_0xb952('0x7'),auth[_0xb952('0x9')](),controller[_0xb952('0x11')]);router['delete'](_0xb952('0x7'),auth[_0xb952('0x9')](),controller['destroy']);module[_0xb952('0x12')]=router; \ No newline at end of file diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js index 4b2be92..17f37d0 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 _0x1b68=['#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','always','never','onlyIfOpen','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','sequelize','exports','name','ENUM','ivr','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Max\x20200\x20calls.','STRING','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'];(function(_0x356127,_0x4873ac){var _0x5d4c75=function(_0x4fe60c){while(--_0x4fe60c){_0x356127['push'](_0x356127['shift']());}};_0x5d4c75(++_0x4873ac);}(_0x1b68,0x118));var _0x81b6=function(_0x529e2a,_0x1f2a17){_0x529e2a=_0x529e2a-0x0;var _0x484244=_0x1b68[_0x529e2a];return _0x484244;};'use strict';var Sequelize=require(_0x81b6('0x0'));module[_0x81b6('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x81b6('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x81b6('0x3')]('ivr'),'allowNull':![],'defaultValue':_0x81b6('0x4')},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0x81b6('0x5')],'defaultValue':0x0,'comment':_0x81b6('0x6')},'limitCalls':{'type':Sequelize[_0x81b6('0x7')](0x4)[_0x81b6('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x81b6('0x9')},'dialOriginateCallerIdName':{'type':Sequelize[_0x81b6('0xa')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x81b6('0xa')]},'dialOriginateTimeout':{'type':Sequelize[_0x81b6('0x7')](0x3)[_0x81b6('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x81b6('0xb')},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x81b6('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x81b6('0xc')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x81b6('0x7')](0x5)[_0x81b6('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x81b6('0xd')},'dialBusyMaxRetry':{'type':Sequelize[_0x81b6('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x81b6('0xe')},'dialBusyRetryFrequency':{'type':Sequelize[_0x81b6('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x81b6('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0x81b6('0xf')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x81b6('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x81b6('0x10')},'dialGlobalMaxRetry':{'type':Sequelize[_0x81b6('0x7')](0x3)[_0x81b6('0x8')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x81b6('0x11')},'dialTimezone':{'type':Sequelize[_0x81b6('0xa')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x81b6('0xa')],'defaultValue':'07:00-22:00,*,*,*'},'dialCheckDuplicateType':{'type':Sequelize[_0x81b6('0x3')](_0x81b6('0x12'),_0x81b6('0x13'),_0x81b6('0x14')),'defaultValue':_0x81b6('0x12')},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0x81b6('0x8')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)[_0x81b6('0x8')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x81b6('0x15')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x81b6('0x7')](0x9)[_0x81b6('0x8')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x81b6('0x16')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x81b6('0x7')](0x9)[_0x81b6('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x81b6('0x17')},'dialAMDMinWordLength':{'type':Sequelize[_0x81b6('0x7')](0x9)[_0x81b6('0x8')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x81b6('0x18')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x81b6('0x7')](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x81b6('0x19')},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)[_0x81b6('0x8')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x81b6('0x1a')},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)[_0x81b6('0x8')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x81b6('0x1b')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x81b6('0x7')](0x9)[_0x81b6('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x81b6('0x1c')},'dialOrderByScheduledAt':{'type':Sequelize[_0x81b6('0x3')](_0x81b6('0x1d'),_0x81b6('0x1e')),'defaultValue':'DESC'},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x81b6('0x7')](0x3)[_0x81b6('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x81b6('0x1f')},'dialCutDigit':{'type':Sequelize[_0x81b6('0x7')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x81b6('0x20')}}; \ No newline at end of file +var _0x284a=['STRING','ENUM','ivr','BOOLEAN','Active/Disactive\x20Campaign','UNSIGNED','Max\x20200\x20calls.','INTEGER','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','always','never','onlyIfOpen','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC','ASC','sequelize','exports'];(function(_0x1ad12c,_0x5bd618){var _0xb60e0f=function(_0x9fb490){while(--_0x9fb490){_0x1ad12c['push'](_0x1ad12c['shift']());}};_0xb60e0f(++_0x5bd618);}(_0x284a,0x1de));var _0xa284=function(_0xdf72e6,_0x487482){_0xdf72e6=_0xdf72e6-0x0;var _0x1bd374=_0x284a[_0xdf72e6];return _0x1bd374;};'use strict';var Sequelize=require(_0xa284('0x0'));module[_0xa284('0x1')]={'name':{'type':Sequelize[_0xa284('0x2')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xa284('0x3')](_0xa284('0x4')),'allowNull':![],'defaultValue':_0xa284('0x4')},'description':{'type':Sequelize[_0xa284('0x2')]},'active':{'type':Sequelize[_0xa284('0x5')],'defaultValue':0x0,'comment':_0xa284('0x6')},'limitCalls':{'type':Sequelize['INTEGER'](0x4)[_0xa284('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xa284('0x8')},'dialOriginateCallerIdName':{'type':Sequelize[_0xa284('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xa284('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0xa284('0x9')](0x3)[_0xa284('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa284('0xa')},'dialCongestionMaxRetry':{'type':Sequelize[_0xa284('0x9')](0x3)[_0xa284('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa284('0xb')},'dialBusyMaxRetry':{'type':Sequelize[_0xa284('0x9')](0x3)[_0xa284('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa284('0xc')},'dialBusyRetryFrequency':{'type':Sequelize[_0xa284('0x9')](0x5)[_0xa284('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa284('0xd')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xa284('0x9')](0x3)[_0xa284('0x7')],'defaultValue':0x3,'comment':_0xa284('0xe')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xa284('0x9')](0x5)[_0xa284('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa284('0xf')},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xa284('0x10')},'dialTimezone':{'type':Sequelize[_0xa284('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xa284('0x2')],'defaultValue':'07:00-22:00,*,*,*'},'dialCheckDuplicateType':{'type':Sequelize[_0xa284('0x3')](_0xa284('0x11'),_0xa284('0x12'),_0xa284('0x13')),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize[_0xa284('0x5')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0xa284('0x7')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xa284('0x14')},'dialAMDGreeting':{'type':Sequelize[_0xa284('0x9')](0x9)[_0xa284('0x7')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xa284('0x15')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xa284('0x9')](0x9)[_0xa284('0x7')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xa284('0x16')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xa284('0x9')](0x9)[_0xa284('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xa284('0x17')},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)[_0xa284('0x7')],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)[_0xa284('0x7')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xa284('0x18')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xa284('0x9')](0x9)[_0xa284('0x7')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xa284('0x19')},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xa284('0x1a')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xa284('0x9')](0x9)[_0xa284('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xa284('0x1b')},'dialOrderByScheduledAt':{'type':Sequelize['ENUM'](_0xa284('0x1c'),_0xa284('0x1d')),'defaultValue':_0xa284('0x1c')},'dialPrefix':{'type':Sequelize[_0xa284('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)[_0xa284('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize[_0xa284('0x9')](0x3)[_0xa284('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'}}; \ No newline at end of file diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js index d7be0ee..8f3bdc6 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 _0xa9e0=['into','cm_hopper','fromQuery','phone','ContactId','ListId','scheduledAt','CmListId','toString','NOW()','from','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','select','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','onlyIfOpen','insert','cm_contacts','deletedAt\x20IS\x20NULL','COALESCE(phone,\x27\x27)','push','all','removeLists','getBlackLists','CmList','addBlackLists','cm_hopper_black','removeBlackLists','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../mysqldb','sendStatus','status','json','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','get','IvrCampaigns','UserProfileResource','end','error','name','send','index','Campaign','rawAttributes','model','keys','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','limit','sort','where','pick','merge','map','type','key','field','options','includeAll','include','catch','show','params','fields','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','clone','omit','updatedAt','createdAt','findOne','CmHopper','CampaignId','filter','findAll','rows','getHopperHistories','CmHopperHistory','order','getHopperFinals','CmHopperFinal','CmHopperBlack','getLists','addLists','ids','spread','dialCheckDuplicateType'];(function(_0x500419,_0x549162){var _0x241c1a=function(_0x3bea1a){while(--_0x3bea1a){_0x500419['push'](_0x500419['shift']());}};_0x241c1a(++_0x549162);}(_0xa9e0,0x123));var _0x0a9e=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0xa9e0[_0x297fd3];return _0x2af381;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var as=require(_0x0a9e('0x11'));var hardwareService=require(_0x0a9e('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x0a9e('0x13'))['db'];function respondWithStatusCode(_0x36471c,_0xd5b662){_0xd5b662=_0xd5b662||0xcc;return function(_0x26d672){if(_0x26d672){return _0x36471c[_0x0a9e('0x14')](_0xd5b662);}return _0x36471c[_0x0a9e('0x15')](_0xd5b662)['end']();};}function respondWithResult(_0x4283ce,_0x239b12){_0x239b12=_0x239b12||0xc8;return function(_0x2b4227){if(_0x2b4227){return _0x4283ce[_0x0a9e('0x15')](_0x239b12)[_0x0a9e('0x16')](_0x2b4227);}};}function respondWithFilteredResult(_0x4d5611,_0x52a03d){return function(_0x22dccb){if(_0x22dccb){var _0x5d0880=_0x22dccb[_0x0a9e('0x17')],_0x1985b6=_0x52a03d['offset'],_0x519dfd=_0x52a03d[_0x0a9e('0x18')]+_0x52a03d['limit'],_0x16033c;if(_0x519dfd>=_0x5d0880){_0x519dfd=_0x5d0880;_0x16033c=0xc8;}else{_0x16033c=0xce;}_0x4d5611[_0x0a9e('0x15')](_0x16033c);return _0x4d5611[_0x0a9e('0x19')](_0x0a9e('0x1a'),_0x1985b6+'-'+_0x519dfd+'/'+_0x5d0880)[_0x0a9e('0x16')](_0x22dccb);}return null;};}function patchUpdates(_0x31b1ca){return function(_0x2eb11f){try{jsonpatch[_0x0a9e('0x1b')](_0x2eb11f,_0x31b1ca,!![]);}catch(_0x20559e){return BPromise[_0x0a9e('0x1c')](_0x20559e);}return _0x2eb11f[_0x0a9e('0x1d')]();};}function saveUpdates(_0x1c696a,_0x105080){return function(_0x4bb1e3){if(_0x4bb1e3){return _0x4bb1e3[_0x0a9e('0x1e')](_0x1c696a)[_0x0a9e('0x1f')](function(_0x53682f){return _0x53682f;});}return null;};}function removeEntity(_0x20f109,_0x5a09ef){return function(_0x588269){if(_0x588269){return _0x588269[_0x0a9e('0x20')]()[_0x0a9e('0x1f')](function(){var _0x38e7c4=_0x588269[_0x0a9e('0x21')]({'plain':!![]});var _0x4abc77=_0x0a9e('0x22');return db[_0x0a9e('0x23')][_0x0a9e('0x20')]({'where':{'type':_0x4abc77,'resourceId':_0x38e7c4['id']}})[_0x0a9e('0x1f')](function(){return _0x588269;});})[_0x0a9e('0x1f')](function(){_0x20f109[_0x0a9e('0x15')](0xcc)[_0x0a9e('0x24')]();});}};}function handleEntityNotFound(_0x5ea472,_0x59181e){return function(_0x197ec0){if(!_0x197ec0){_0x5ea472[_0x0a9e('0x14')](0x194);}return _0x197ec0;};}function handleError(_0x40c424,_0x33161b){_0x33161b=_0x33161b||0x1f4;return function(_0x526cf3){logger[_0x0a9e('0x25')](_0x526cf3['stack']);if(_0x526cf3[_0x0a9e('0x26')]){delete _0x526cf3['name'];}_0x40c424[_0x0a9e('0x15')](_0x33161b)[_0x0a9e('0x27')](_0x526cf3);};}exports[_0x0a9e('0x28')]=function(_0x14433c,_0x140511){var _0x1538a4={},_0x11c3b6={},_0x14de77={'count':0x0,'rows':[]};var _0x5a101a=db[_0x0a9e('0x29')][_0x0a9e('0x2a')];_0x11c3b6[_0x0a9e('0x2b')]=_[_0x0a9e('0x2c')](_0x5a101a);_0x11c3b6['query']=_[_0x0a9e('0x2c')](_0x14433c[_0x0a9e('0x2d')]);_0x11c3b6[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x11c3b6[_0x0a9e('0x2b')],_0x11c3b6[_0x0a9e('0x2d')]);_0x1538a4[_0x0a9e('0x30')]=_[_0x0a9e('0x2f')](_0x11c3b6[_0x0a9e('0x2b')],qs['fields'](_0x14433c[_0x0a9e('0x2d')]['fields']));_0x1538a4[_0x0a9e('0x30')]=_0x1538a4[_0x0a9e('0x30')][_0x0a9e('0x31')]?_0x1538a4[_0x0a9e('0x30')]:_0x11c3b6[_0x0a9e('0x2b')];if(!_0x14433c['query'][_0x0a9e('0x32')](_0x0a9e('0x33'))){_0x1538a4[_0x0a9e('0x34')]=qs[_0x0a9e('0x34')](_0x14433c[_0x0a9e('0x2d')][_0x0a9e('0x34')]);_0x1538a4[_0x0a9e('0x18')]=qs[_0x0a9e('0x18')](_0x14433c['query'][_0x0a9e('0x18')]);}_0x1538a4['order']=qs[_0x0a9e('0x35')](_0x14433c[_0x0a9e('0x2d')][_0x0a9e('0x35')]);_0x1538a4[_0x0a9e('0x36')]=qs['filters'](_[_0x0a9e('0x37')](_0x14433c[_0x0a9e('0x2d')],_0x11c3b6[_0x0a9e('0x2e')]));if(_0x14433c[_0x0a9e('0x2d')]['filter']){_0x1538a4['where']=_[_0x0a9e('0x38')](_0x1538a4['where'],{'$or':_[_0x0a9e('0x39')](_0x5a101a,function(_0x3d9717){if(_0x3d9717[_0x0a9e('0x3a')][_0x0a9e('0x3b')]!=='VIRTUAL'){var _0x31916f={};_0x31916f[_0x3d9717[_0x0a9e('0x3c')]]={'$like':'%'+_0x14433c[_0x0a9e('0x2d')]['filter']+'%'};return _0x31916f;}})});}_0x1538a4=_[_0x0a9e('0x38')]({},_0x1538a4,_0x14433c[_0x0a9e('0x3d')]);var _0x289467={'where':_0x1538a4['where']};return db['Campaign'][_0x0a9e('0x17')](_0x289467)[_0x0a9e('0x1f')](function(_0x5adda1){_0x14de77[_0x0a9e('0x17')]=_0x5adda1;if(_0x14433c[_0x0a9e('0x2d')][_0x0a9e('0x3e')]){_0x1538a4[_0x0a9e('0x3f')]=[{'all':!![]}];}return db['Campaign']['findAll'](_0x1538a4);})[_0x0a9e('0x1f')](function(_0x45b3d0){_0x14de77['rows']=_0x45b3d0;return _0x14de77;})[_0x0a9e('0x1f')](respondWithFilteredResult(_0x140511,_0x1538a4))[_0x0a9e('0x40')](handleError(_0x140511,null));};exports[_0x0a9e('0x41')]=function(_0x5b4f5e,_0x316c8f){var _0x2cfea9={'raw':![],'where':{'id':_0x5b4f5e[_0x0a9e('0x42')]['id']}},_0x274e8e={};_0x274e8e[_0x0a9e('0x2b')]=_[_0x0a9e('0x2c')](db[_0x0a9e('0x29')][_0x0a9e('0x2a')]);_0x274e8e[_0x0a9e('0x2d')]=_[_0x0a9e('0x2c')](_0x5b4f5e[_0x0a9e('0x2d')]);_0x274e8e[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x274e8e[_0x0a9e('0x2b')],_0x274e8e[_0x0a9e('0x2d')]);_0x2cfea9['attributes']=_['intersection'](_0x274e8e[_0x0a9e('0x2b')],qs[_0x0a9e('0x43')](_0x5b4f5e[_0x0a9e('0x2d')][_0x0a9e('0x43')]));_0x2cfea9[_0x0a9e('0x30')]=_0x2cfea9[_0x0a9e('0x30')][_0x0a9e('0x31')]?_0x2cfea9[_0x0a9e('0x30')]:_0x274e8e[_0x0a9e('0x2b')];if(_0x5b4f5e[_0x0a9e('0x2d')][_0x0a9e('0x3e')]){_0x2cfea9[_0x0a9e('0x3f')]=[{'all':!![]}];}_0x2cfea9=_['merge']({},_0x2cfea9,_0x5b4f5e[_0x0a9e('0x3d')]);return db[_0x0a9e('0x29')][_0x0a9e('0x44')](_0x2cfea9)[_0x0a9e('0x1f')](handleEntityNotFound(_0x316c8f,null))[_0x0a9e('0x1f')](respondWithResult(_0x316c8f,null))[_0x0a9e('0x40')](handleError(_0x316c8f,null));};exports[_0x0a9e('0x45')]=function(_0x44dd99,_0x59afe8){return db[_0x0a9e('0x29')]['create'](_0x44dd99[_0x0a9e('0x46')],{})[_0x0a9e('0x1f')](function(_0x8d6dd1){var _0x562fb4=_0x44dd99[_0x0a9e('0x47')][_0x0a9e('0x21')]({'plain':!![]});if(!_0x562fb4)throw new Error(_0x0a9e('0x48'));if(_0x562fb4[_0x0a9e('0x49')]===_0x0a9e('0x47')){var _0x37be73=_0x8d6dd1[_0x0a9e('0x21')]({'plain':!![]});var _0x5bbcde=_0x0a9e('0x22');return db[_0x0a9e('0x4a')][_0x0a9e('0x44')]({'where':{'name':_0x5bbcde,'userProfileId':_0x562fb4[_0x0a9e('0x4b')]},'raw':!![]})[_0x0a9e('0x1f')](function(_0x992c77){if(_0x992c77&&_0x992c77[_0x0a9e('0x4c')]===0x0){return db[_0x0a9e('0x23')][_0x0a9e('0x45')]({'name':_0x37be73['name'],'resourceId':_0x37be73['id'],'type':_0x992c77[_0x0a9e('0x26')],'sectionId':_0x992c77['id']},{})[_0x0a9e('0x1f')](function(){return _0x8d6dd1;});}else{return _0x8d6dd1;}})['catch'](function(_0x4ae14b){logger['error'](_0x0a9e('0x4d'),_0x4ae14b);throw _0x4ae14b;});}return _0x8d6dd1;})[_0x0a9e('0x1f')](respondWithResult(_0x59afe8,0xc9))[_0x0a9e('0x40')](handleError(_0x59afe8,null));};exports[_0x0a9e('0x4e')]=function(_0x61bb17,_0x30decb){var _0x2e5165={'raw':![],'where':{'id':_0x61bb17['params']['id']}},_0x375c18={};_0x375c18['model']=_['keys'](db[_0x0a9e('0x29')][_0x0a9e('0x2a')]);_0x2e5165[_0x0a9e('0x30')]=_['intersection'](_0x375c18[_0x0a9e('0x2b')],qs[_0x0a9e('0x43')](_0x61bb17['query']['fields']));_0x2e5165[_0x0a9e('0x30')]=_0x2e5165['attributes'][_0x0a9e('0x31')]?_0x2e5165['attributes']:_0x375c18[_0x0a9e('0x2b')];if(_0x61bb17[_0x0a9e('0x2d')][_0x0a9e('0x3e')]){_0x2e5165['include']=[{'all':!![]}];}_0x2e5165=_[_0x0a9e('0x38')]({},_0x2e5165,_0x61bb17[_0x0a9e('0x3d')]);return db['Campaign']['find'](_0x2e5165)[_0x0a9e('0x1f')](handleEntityNotFound(_0x30decb,null))[_0x0a9e('0x1f')](function(_0x49c095){if(_0x49c095){var _0x145931=_0x49c095['get']({'plain':!![]});_0x145931=qs[_0x0a9e('0x4f')](_0x145931,['id','createdAt',_0x0a9e('0x50')]);_0x61bb17['body']=_['omit'](_0x61bb17['body'],['id',_0x0a9e('0x51'),'updatedAt']);return db[_0x0a9e('0x29')][_0x0a9e('0x45')](_[_0x0a9e('0x38')](_0x145931,_0x61bb17[_0x0a9e('0x46')]),{'include':_0x61bb17[_0x0a9e('0x2d')][_0x0a9e('0x3e')]?[{'all':!![]}]:undefined})[_0x0a9e('0x1f')](function(_0x28d814){var _0x4e67ab=_0x61bb17[_0x0a9e('0x47')][_0x0a9e('0x21')]({'plain':!![]});if(!_0x4e67ab)throw new Error(_0x0a9e('0x48'));if(_0x4e67ab[_0x0a9e('0x49')]===_0x0a9e('0x47')){var _0x156662=_0x28d814['get']({'plain':!![]});var _0x956fbe=_0x0a9e('0x22');return db['UserProfileSection'][_0x0a9e('0x44')]({'where':{'name':_0x956fbe,'userProfileId':_0x4e67ab['userProfileId']},'raw':!![]})[_0x0a9e('0x1f')](function(_0x5ba1f9){if(_0x5ba1f9&&_0x5ba1f9['autoAssociation']===0x0){return db['UserProfileResource'][_0x0a9e('0x45')]({'name':_0x156662['name'],'resourceId':_0x156662['id'],'type':_0x5ba1f9[_0x0a9e('0x26')],'sectionId':_0x5ba1f9['id']},{})[_0x0a9e('0x1f')](function(){return _0x28d814;});}else{return _0x28d814;}})[_0x0a9e('0x40')](function(_0x7be420){logger[_0x0a9e('0x25')](_0x0a9e('0x4d'),_0x7be420);throw _0x7be420;});}return _0x28d814;});}})['then'](respondWithResult(_0x30decb,0xc9))[_0x0a9e('0x40')](handleError(_0x30decb,null));};exports['update']=function(_0xca4ade,_0x1f07cb){if(_0xca4ade[_0x0a9e('0x46')]['id']){delete _0xca4ade['body']['id'];}return db[_0x0a9e('0x29')][_0x0a9e('0x44')]({'where':{'id':_0xca4ade[_0x0a9e('0x42')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x1f07cb,null))['then'](saveUpdates(_0xca4ade[_0x0a9e('0x46')],null))[_0x0a9e('0x1f')](respondWithResult(_0x1f07cb,null))['catch'](handleError(_0x1f07cb,null));};exports[_0x0a9e('0x20')]=function(_0x17e88c,_0x88dcbf){return db[_0x0a9e('0x29')][_0x0a9e('0x44')]({'where':{'id':_0x17e88c['params']['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x88dcbf,null))[_0x0a9e('0x1f')](removeEntity(_0x88dcbf,null))[_0x0a9e('0x40')](handleError(_0x88dcbf,null));};exports['getHoppers']=function(_0x3528b7,_0x4f1e60,_0x5211e3){var _0x242745={'raw':!![],'where':{}};var _0x4556c5={};var _0x9375fb={'count':0x0,'rows':[]};return db[_0x0a9e('0x29')][_0x0a9e('0x52')]({'where':{'id':_0x3528b7[_0x0a9e('0x42')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x4f1e60,null))[_0x0a9e('0x1f')](function(_0x2d7205){if(_0x2d7205){_0x4556c5[_0x0a9e('0x2b')]=_[_0x0a9e('0x2c')](db[_0x0a9e('0x53')][_0x0a9e('0x2a')]);_0x4556c5[_0x0a9e('0x2d')]=_[_0x0a9e('0x2c')](_0x3528b7[_0x0a9e('0x2d')]);_0x4556c5[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x4556c5['model'],_0x4556c5[_0x0a9e('0x2d')]);_0x242745[_0x0a9e('0x30')]=_[_0x0a9e('0x2f')](_0x4556c5['model'],qs[_0x0a9e('0x43')](_0x3528b7[_0x0a9e('0x2d')]['fields']));_0x242745[_0x0a9e('0x30')]=_0x242745[_0x0a9e('0x30')][_0x0a9e('0x31')]?_0x242745[_0x0a9e('0x30')]:_0x4556c5[_0x0a9e('0x2b')];if(!_0x3528b7['query']['hasOwnProperty']('nolimit')){_0x242745[_0x0a9e('0x34')]=qs[_0x0a9e('0x34')](_0x3528b7[_0x0a9e('0x2d')][_0x0a9e('0x34')]);_0x242745[_0x0a9e('0x18')]=qs[_0x0a9e('0x18')](_0x3528b7[_0x0a9e('0x2d')][_0x0a9e('0x18')]);}_0x242745['order']=qs[_0x0a9e('0x35')](_0x3528b7[_0x0a9e('0x2d')][_0x0a9e('0x35')]);_0x242745['where']=qs[_0x0a9e('0x2e')](_['pick'](_0x3528b7[_0x0a9e('0x2d')],_0x4556c5[_0x0a9e('0x2e')]));_0x242745['where'][_0x0a9e('0x54')]=_0x2d7205['id'];if(_0x3528b7[_0x0a9e('0x2d')][_0x0a9e('0x55')]){_0x242745[_0x0a9e('0x36')]=_['merge'](_0x242745[_0x0a9e('0x36')],{'$or':_[_0x0a9e('0x39')](_0x242745[_0x0a9e('0x30')],function(_0x278ab4){var _0x5b7fc3={};_0x5b7fc3[_0x278ab4]={'$like':'%'+_0x3528b7[_0x0a9e('0x2d')][_0x0a9e('0x55')]+'%'};return _0x5b7fc3;})});}_0x242745=_[_0x0a9e('0x38')]({},_0x242745,_0x3528b7[_0x0a9e('0x3d')]);return db['CmHopper'][_0x0a9e('0x17')]({'where':_0x242745[_0x0a9e('0x36')]})[_0x0a9e('0x1f')](function(_0xf410e5){_0x9375fb[_0x0a9e('0x17')]=_0xf410e5;if(_0x3528b7[_0x0a9e('0x2d')][_0x0a9e('0x3e')]){_0x242745[_0x0a9e('0x3f')]=[{'all':!![]}];}return db[_0x0a9e('0x53')][_0x0a9e('0x56')](_0x242745);})[_0x0a9e('0x1f')](function(_0x1f10ef){_0x9375fb[_0x0a9e('0x57')]=_0x1f10ef;return _0x9375fb;});}})[_0x0a9e('0x1f')](respondWithFilteredResult(_0x4f1e60,_0x242745))['catch'](handleError(_0x4f1e60,null));};exports[_0x0a9e('0x58')]=function(_0x11da9c,_0xc599b3,_0x563627){var _0x3736e0={'raw':!![],'where':{}};var _0x33dda0={};var _0x8cea96={'count':0x0,'rows':[]};return db[_0x0a9e('0x29')]['findOne']({'where':{'id':_0x11da9c['params']['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0xc599b3,null))[_0x0a9e('0x1f')](function(_0x4c54fa){if(_0x4c54fa){_0x33dda0[_0x0a9e('0x2b')]=_['keys'](db[_0x0a9e('0x59')][_0x0a9e('0x2a')]);_0x33dda0['query']=_[_0x0a9e('0x2c')](_0x11da9c[_0x0a9e('0x2d')]);_0x33dda0[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x33dda0[_0x0a9e('0x2b')],_0x33dda0[_0x0a9e('0x2d')]);_0x3736e0[_0x0a9e('0x30')]=_['intersection'](_0x33dda0[_0x0a9e('0x2b')],qs[_0x0a9e('0x43')](_0x11da9c[_0x0a9e('0x2d')][_0x0a9e('0x43')]));_0x3736e0['attributes']=_0x3736e0[_0x0a9e('0x30')][_0x0a9e('0x31')]?_0x3736e0['attributes']:_0x33dda0[_0x0a9e('0x2b')];if(!_0x11da9c['query'][_0x0a9e('0x32')](_0x0a9e('0x33'))){_0x3736e0[_0x0a9e('0x34')]=qs[_0x0a9e('0x34')](_0x11da9c['query']['limit']);_0x3736e0[_0x0a9e('0x18')]=qs[_0x0a9e('0x18')](_0x11da9c[_0x0a9e('0x2d')]['offset']);}_0x3736e0[_0x0a9e('0x5a')]=qs[_0x0a9e('0x35')](_0x11da9c['query']['sort']);_0x3736e0[_0x0a9e('0x36')]=qs['filters'](_['pick'](_0x11da9c['query'],_0x33dda0[_0x0a9e('0x2e')]));_0x3736e0[_0x0a9e('0x36')][_0x0a9e('0x54')]=_0x4c54fa['id'];if(_0x11da9c[_0x0a9e('0x2d')][_0x0a9e('0x55')]){_0x3736e0[_0x0a9e('0x36')]=_['merge'](_0x3736e0[_0x0a9e('0x36')],{'$or':_['map'](_0x3736e0[_0x0a9e('0x30')],function(_0x2aabab){var _0x18ad56={};_0x18ad56[_0x2aabab]={'$like':'%'+_0x11da9c[_0x0a9e('0x2d')]['filter']+'%'};return _0x18ad56;})});}_0x3736e0=_[_0x0a9e('0x38')]({},_0x3736e0,_0x11da9c[_0x0a9e('0x3d')]);return db[_0x0a9e('0x59')]['count']({'where':_0x3736e0[_0x0a9e('0x36')]})[_0x0a9e('0x1f')](function(_0x2a563d){_0x8cea96[_0x0a9e('0x17')]=_0x2a563d;if(_0x11da9c[_0x0a9e('0x2d')][_0x0a9e('0x3e')]){_0x3736e0[_0x0a9e('0x3f')]=[{'all':!![]}];}return db[_0x0a9e('0x59')]['findAll'](_0x3736e0);})[_0x0a9e('0x1f')](function(_0x3325c5){_0x8cea96['rows']=_0x3325c5;return _0x8cea96;});}})[_0x0a9e('0x1f')](respondWithFilteredResult(_0xc599b3,_0x3736e0))[_0x0a9e('0x40')](handleError(_0xc599b3,null));};exports[_0x0a9e('0x5b')]=function(_0x5a26c8,_0x96672f,_0x52ec10){var _0x8c8fbe={'raw':!![],'where':{}};var _0x2b5148={};var _0x558a87={'count':0x0,'rows':[]};return db[_0x0a9e('0x29')][_0x0a9e('0x52')]({'where':{'id':_0x5a26c8[_0x0a9e('0x42')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x96672f,null))[_0x0a9e('0x1f')](function(_0x501050){if(_0x501050){_0x2b5148[_0x0a9e('0x2b')]=_[_0x0a9e('0x2c')](db[_0x0a9e('0x5c')][_0x0a9e('0x2a')]);_0x2b5148[_0x0a9e('0x2d')]=_[_0x0a9e('0x2c')](_0x5a26c8[_0x0a9e('0x2d')]);_0x2b5148[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x2b5148[_0x0a9e('0x2b')],_0x2b5148[_0x0a9e('0x2d')]);_0x8c8fbe[_0x0a9e('0x30')]=_[_0x0a9e('0x2f')](_0x2b5148['model'],qs[_0x0a9e('0x43')](_0x5a26c8[_0x0a9e('0x2d')][_0x0a9e('0x43')]));_0x8c8fbe[_0x0a9e('0x30')]=_0x8c8fbe[_0x0a9e('0x30')]['length']?_0x8c8fbe[_0x0a9e('0x30')]:_0x2b5148[_0x0a9e('0x2b')];if(!_0x5a26c8['query'][_0x0a9e('0x32')]('nolimit')){_0x8c8fbe[_0x0a9e('0x34')]=qs[_0x0a9e('0x34')](_0x5a26c8[_0x0a9e('0x2d')][_0x0a9e('0x34')]);_0x8c8fbe['offset']=qs[_0x0a9e('0x18')](_0x5a26c8['query'][_0x0a9e('0x18')]);}_0x8c8fbe[_0x0a9e('0x5a')]=qs['sort'](_0x5a26c8[_0x0a9e('0x2d')][_0x0a9e('0x35')]);_0x8c8fbe[_0x0a9e('0x36')]=qs['filters'](_['pick'](_0x5a26c8[_0x0a9e('0x2d')],_0x2b5148[_0x0a9e('0x2e')]));_0x8c8fbe[_0x0a9e('0x36')][_0x0a9e('0x54')]=_0x501050['id'];if(_0x5a26c8[_0x0a9e('0x2d')][_0x0a9e('0x55')]){_0x8c8fbe[_0x0a9e('0x36')]=_[_0x0a9e('0x38')](_0x8c8fbe[_0x0a9e('0x36')],{'$or':_['map'](_0x8c8fbe[_0x0a9e('0x30')],function(_0x517081){var _0x287324={};_0x287324[_0x517081]={'$like':'%'+_0x5a26c8[_0x0a9e('0x2d')][_0x0a9e('0x55')]+'%'};return _0x287324;})});}_0x8c8fbe=_[_0x0a9e('0x38')]({},_0x8c8fbe,_0x5a26c8[_0x0a9e('0x3d')]);return db['CmHopperFinal'][_0x0a9e('0x17')]({'where':_0x8c8fbe[_0x0a9e('0x36')]})[_0x0a9e('0x1f')](function(_0x2aa5f2){_0x558a87[_0x0a9e('0x17')]=_0x2aa5f2;if(_0x5a26c8['query']['includeAll']){_0x8c8fbe[_0x0a9e('0x3f')]=[{'all':!![]}];}return db['CmHopperFinal'][_0x0a9e('0x56')](_0x8c8fbe);})[_0x0a9e('0x1f')](function(_0x4672e1){_0x558a87[_0x0a9e('0x57')]=_0x4672e1;return _0x558a87;});}})[_0x0a9e('0x1f')](respondWithFilteredResult(_0x96672f,_0x8c8fbe))[_0x0a9e('0x40')](handleError(_0x96672f,null));};exports['getHopperBlacks']=function(_0x4db918,_0x1889ed,_0x5dfbe2){var _0x2469d1={'raw':!![],'where':{}};var _0x5c689c={};var _0x427ccc={'count':0x0,'rows':[]};return db['Campaign']['findOne']({'where':{'id':_0x4db918[_0x0a9e('0x42')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x1889ed,null))['then'](function(_0x170af6){if(_0x170af6){_0x5c689c[_0x0a9e('0x2b')]=_[_0x0a9e('0x2c')](db[_0x0a9e('0x5d')][_0x0a9e('0x2a')]);_0x5c689c['query']=_['keys'](_0x4db918[_0x0a9e('0x2d')]);_0x5c689c[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x5c689c[_0x0a9e('0x2b')],_0x5c689c[_0x0a9e('0x2d')]);_0x2469d1['attributes']=_[_0x0a9e('0x2f')](_0x5c689c[_0x0a9e('0x2b')],qs['fields'](_0x4db918[_0x0a9e('0x2d')][_0x0a9e('0x43')]));_0x2469d1[_0x0a9e('0x30')]=_0x2469d1[_0x0a9e('0x30')][_0x0a9e('0x31')]?_0x2469d1[_0x0a9e('0x30')]:_0x5c689c[_0x0a9e('0x2b')];if(!_0x4db918[_0x0a9e('0x2d')][_0x0a9e('0x32')](_0x0a9e('0x33'))){_0x2469d1['limit']=qs[_0x0a9e('0x34')](_0x4db918[_0x0a9e('0x2d')][_0x0a9e('0x34')]);_0x2469d1[_0x0a9e('0x18')]=qs[_0x0a9e('0x18')](_0x4db918['query']['offset']);}_0x2469d1[_0x0a9e('0x5a')]=qs[_0x0a9e('0x35')](_0x4db918[_0x0a9e('0x2d')][_0x0a9e('0x35')]);_0x2469d1[_0x0a9e('0x36')]=qs['filters'](_[_0x0a9e('0x37')](_0x4db918[_0x0a9e('0x2d')],_0x5c689c[_0x0a9e('0x2e')]));_0x2469d1['where'][_0x0a9e('0x54')]=_0x170af6['id'];if(_0x4db918['query'][_0x0a9e('0x55')]){_0x2469d1['where']=_[_0x0a9e('0x38')](_0x2469d1[_0x0a9e('0x36')],{'$or':_[_0x0a9e('0x39')](_0x2469d1['attributes'],function(_0xc9529d){var _0x5ed560={};_0x5ed560[_0xc9529d]={'$like':'%'+_0x4db918[_0x0a9e('0x2d')][_0x0a9e('0x55')]+'%'};return _0x5ed560;})});}_0x2469d1=_[_0x0a9e('0x38')]({},_0x2469d1,_0x4db918[_0x0a9e('0x3d')]);return db[_0x0a9e('0x5d')][_0x0a9e('0x17')]({'where':_0x2469d1[_0x0a9e('0x36')]})[_0x0a9e('0x1f')](function(_0x2aaf07){_0x427ccc[_0x0a9e('0x17')]=_0x2aaf07;if(_0x4db918[_0x0a9e('0x2d')][_0x0a9e('0x3e')]){_0x2469d1[_0x0a9e('0x3f')]=[{'all':!![]}];}return db[_0x0a9e('0x5d')][_0x0a9e('0x56')](_0x2469d1);})[_0x0a9e('0x1f')](function(_0x5b93dd){_0x427ccc['rows']=_0x5b93dd;return _0x427ccc;});}})[_0x0a9e('0x1f')](respondWithFilteredResult(_0x1889ed,_0x2469d1))['catch'](handleError(_0x1889ed,null));};exports[_0x0a9e('0x5e')]=function(_0x3428c9,_0x5d6b69,_0x1a3754){var _0xe2b083={};var _0x387bbe={};var _0x18adc8;var _0x5585d5;return db[_0x0a9e('0x29')][_0x0a9e('0x52')]({'where':{'id':_0x3428c9[_0x0a9e('0x42')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x5d6b69,null))['then'](function(_0x19e9ed){if(_0x19e9ed){_0x18adc8=_0x19e9ed;_0x387bbe[_0x0a9e('0x2b')]=_[_0x0a9e('0x2c')](db['CmList'][_0x0a9e('0x2a')]);_0x387bbe[_0x0a9e('0x2d')]=_[_0x0a9e('0x2c')](_0x3428c9['query']);_0x387bbe[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x387bbe[_0x0a9e('0x2b')],_0x387bbe[_0x0a9e('0x2d')]);_0xe2b083[_0x0a9e('0x30')]=_['intersection'](_0x387bbe[_0x0a9e('0x2b')],qs[_0x0a9e('0x43')](_0x3428c9['query'][_0x0a9e('0x43')]));_0xe2b083[_0x0a9e('0x30')]=_0xe2b083[_0x0a9e('0x30')]['length']?_0xe2b083['attributes']:_0x387bbe['model'];_0xe2b083[_0x0a9e('0x5a')]=qs[_0x0a9e('0x35')](_0x3428c9['query'][_0x0a9e('0x35')]);_0xe2b083[_0x0a9e('0x36')]=qs[_0x0a9e('0x2e')](_['pick'](_0x3428c9[_0x0a9e('0x2d')],_0x387bbe[_0x0a9e('0x2e')]));if(_0x3428c9[_0x0a9e('0x2d')][_0x0a9e('0x55')]){_0xe2b083[_0x0a9e('0x36')]=_[_0x0a9e('0x38')](_0xe2b083[_0x0a9e('0x36')],{'$or':_[_0x0a9e('0x39')](_0xe2b083[_0x0a9e('0x30')],function(_0x5a1848){var _0x43c397={};_0x43c397[_0x5a1848]={'$like':'%'+_0x3428c9['query'][_0x0a9e('0x55')]+'%'};return _0x43c397;})});}_0xe2b083=_[_0x0a9e('0x38')]({},_0xe2b083,_0x3428c9[_0x0a9e('0x3d')]);return _0x18adc8[_0x0a9e('0x5e')](_0xe2b083);}})[_0x0a9e('0x1f')](function(_0x344cd4){if(_0x344cd4){_0x5585d5=_0x344cd4['length'];if(!_0x3428c9[_0x0a9e('0x2d')][_0x0a9e('0x32')](_0x0a9e('0x33'))){_0xe2b083[_0x0a9e('0x34')]=qs['limit'](_0x3428c9[_0x0a9e('0x2d')][_0x0a9e('0x34')]);_0xe2b083[_0x0a9e('0x18')]=qs[_0x0a9e('0x18')](_0x3428c9[_0x0a9e('0x2d')][_0x0a9e('0x18')]);}return _0x18adc8[_0x0a9e('0x5e')](_0xe2b083);}})[_0x0a9e('0x1f')](function(_0x3299b7){if(_0x3299b7){return _0x3299b7?{'count':_0x5585d5,'rows':_0x3299b7}:null;}})[_0x0a9e('0x1f')](respondWithResult(_0x5d6b69,null))['catch'](handleError(_0x5d6b69,null));};exports[_0x0a9e('0x5f')]=function(_0x88b25f,_0x2ff265,_0x26b826){var _0xea8bd1,_0x253f74;return db[_0x0a9e('0x29')][_0x0a9e('0x44')]({'where':{'id':_0x88b25f['params']['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x2ff265,null))[_0x0a9e('0x1f')](function(_0x1a9ef1){if(_0x1a9ef1){_0x253f74=_0x1a9ef1;return _0x1a9ef1['addLists'](_0x88b25f[_0x0a9e('0x46')][_0x0a9e('0x60')],_[_0x0a9e('0x4f')](_0x88b25f[_0x0a9e('0x46')],[_0x0a9e('0x60'),'id'])||{});}return null;})[_0x0a9e('0x61')](function(_0x424f1b){var _0x336a19;_0xea8bd1=_0x424f1b||[];var _0x401601=[];if(_0x424f1b){for(var _0x451010=0x0;_0x451010<_0x424f1b['length'];_0x451010+=0x1){var _0x251753=_0x424f1b[_0x451010][_0x0a9e('0x21')]({'plain':!![]});_0x253f74[_0x0a9e('0x62')]=_0x88b25f[_0x0a9e('0x46')][_0x0a9e('0x62')]?_0x88b25f[_0x0a9e('0x46')]['dialCheckDuplicateType']:_0x253f74[_0x0a9e('0x62')];switch(_0x253f74['dialCheckDuplicateType']){case'always':_0x336a19=squel['insert']()[_0x0a9e('0x63')](_0x0a9e('0x64'))[_0x0a9e('0x65')]([_0x0a9e('0x66'),'scheduledAt',_0x0a9e('0x67'),_0x0a9e('0x68'),_0x0a9e('0x54'),_0x0a9e('0x51'),_0x0a9e('0x50')],squel['select']()['field'](_0x0a9e('0x66'),_0x0a9e('0x66'))[_0x0a9e('0x3c')]('NOW()',_0x0a9e('0x69'))[_0x0a9e('0x3c')]('id',_0x0a9e('0x67'))['field'](_0x251753[_0x0a9e('0x6a')][_0x0a9e('0x6b')](),_0x0a9e('0x68'))['field'](_0x88b25f[_0x0a9e('0x42')]['id'][_0x0a9e('0x6b')](),_0x0a9e('0x54'))['field']('NOW()','createdAt')[_0x0a9e('0x3c')](_0x0a9e('0x6c'),_0x0a9e('0x50'))[_0x0a9e('0x6d')]('cm_contacts')[_0x0a9e('0x36')]('deletedAt\x20IS\x20NULL')[_0x0a9e('0x36')](_0x0a9e('0x6e'),_0x251753[_0x0a9e('0x6a')]['toString']())[_0x0a9e('0x36')](_0x0a9e('0x6f'))[_0x0a9e('0x36')]('phone\x20NOT\x20IN\x20(?)',squel[_0x0a9e('0x70')]()['field'](_0x0a9e('0x71'))['from'](_0x0a9e('0x72'))['where'](_0x0a9e('0x73'),_0x88b25f[_0x0a9e('0x42')]['id'][_0x0a9e('0x6b')]()))[_0x0a9e('0x36')](_0x0a9e('0x74'),squel[_0x0a9e('0x70')]()[_0x0a9e('0x3c')]('COALESCE(phone,\x27\x27)')[_0x0a9e('0x6d')](_0x0a9e('0x64'))['where'](_0x0a9e('0x73'),_0x88b25f[_0x0a9e('0x42')]['id']['toString']())))[_0x0a9e('0x6b')]();break;case _0x0a9e('0x75'):_0x336a19=squel[_0x0a9e('0x76')]()['into'](_0x0a9e('0x64'))[_0x0a9e('0x65')]([_0x0a9e('0x66'),_0x0a9e('0x69'),_0x0a9e('0x67'),_0x0a9e('0x68'),_0x0a9e('0x54'),_0x0a9e('0x51'),_0x0a9e('0x50')],squel[_0x0a9e('0x70')]()['field'](_0x0a9e('0x66'),'phone')[_0x0a9e('0x3c')](_0x0a9e('0x6c'),_0x0a9e('0x69'))[_0x0a9e('0x3c')]('id',_0x0a9e('0x67'))[_0x0a9e('0x3c')](_0x251753['CmListId'][_0x0a9e('0x6b')](),_0x0a9e('0x68'))[_0x0a9e('0x3c')](_0x88b25f['params']['id'][_0x0a9e('0x6b')](),_0x0a9e('0x54'))[_0x0a9e('0x3c')](_0x0a9e('0x6c'),_0x0a9e('0x51'))[_0x0a9e('0x3c')](_0x0a9e('0x6c'),'updatedAt')[_0x0a9e('0x6d')](_0x0a9e('0x77'))[_0x0a9e('0x36')](_0x0a9e('0x78'))[_0x0a9e('0x36')](_0x0a9e('0x6e'),_0x251753[_0x0a9e('0x6a')]['toString']())['where'](_0x0a9e('0x6f'))[_0x0a9e('0x36')](_0x0a9e('0x74'),squel[_0x0a9e('0x70')]()[_0x0a9e('0x3c')](_0x0a9e('0x79'))[_0x0a9e('0x6d')]('cm_hopper')[_0x0a9e('0x36')](_0x0a9e('0x73'),_0x88b25f[_0x0a9e('0x42')]['id'][_0x0a9e('0x6b')]())))[_0x0a9e('0x6b')]();break;default:_0x336a19=squel[_0x0a9e('0x76')]()[_0x0a9e('0x63')]('cm_hopper')[_0x0a9e('0x65')]([_0x0a9e('0x66'),_0x0a9e('0x69'),'ContactId',_0x0a9e('0x68'),_0x0a9e('0x54'),_0x0a9e('0x51'),_0x0a9e('0x50')],squel['select']()[_0x0a9e('0x3c')](_0x0a9e('0x66'),_0x0a9e('0x66'))[_0x0a9e('0x3c')](_0x0a9e('0x6c'),_0x0a9e('0x69'))[_0x0a9e('0x3c')]('id',_0x0a9e('0x67'))['field'](_0x251753[_0x0a9e('0x6a')][_0x0a9e('0x6b')](),_0x0a9e('0x68'))[_0x0a9e('0x3c')](_0x88b25f['params']['id']['toString'](),_0x0a9e('0x54'))[_0x0a9e('0x3c')](_0x0a9e('0x6c'),'createdAt')[_0x0a9e('0x3c')](_0x0a9e('0x6c'),'updatedAt')[_0x0a9e('0x6d')]('cm_contacts')[_0x0a9e('0x36')]('deletedAt\x20IS\x20NULL')['where']('ListId\x20=\x20?',_0x251753[_0x0a9e('0x6a')][_0x0a9e('0x6b')]())[_0x0a9e('0x36')](_0x0a9e('0x6f')))[_0x0a9e('0x6b')]();}_0x401601[_0x0a9e('0x7a')](db['sequelize'][_0x0a9e('0x2d')](_0x336a19));}return BPromise[_0x0a9e('0x7b')](_0x401601);}})[_0x0a9e('0x1f')](function(){return _0xea8bd1;})[_0x0a9e('0x1f')](respondWithResult(_0x2ff265,null))[_0x0a9e('0x40')](handleError(_0x2ff265,null));};exports[_0x0a9e('0x7c')]=function(_0x31c937,_0x5312fa,_0x49baaa){return db[_0x0a9e('0x29')]['find']({'where':{'id':_0x31c937[_0x0a9e('0x42')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x5312fa,null))[_0x0a9e('0x1f')](function(_0xa3695f){if(_0xa3695f){return _0xa3695f[_0x0a9e('0x7c')](_0x31c937[_0x0a9e('0x2d')]['ids']);}})[_0x0a9e('0x1f')](function(_0x59b872){if(_0x59b872){return db['CmHopper'][_0x0a9e('0x20')]({'where':{'ListId':_0x31c937['query'][_0x0a9e('0x60')],'CampaignId':_0x31c937['params']['id']}})['then'](function(){return _0x59b872;});}})[_0x0a9e('0x1f')](respondWithStatusCode(_0x5312fa,null))['catch'](handleError(_0x5312fa,null));};exports[_0x0a9e('0x7d')]=function(_0x142e53,_0xe1ab0d,_0x48f532){var _0x4152cd={'raw':!![],'where':{}};var _0x1209c4={};var _0x3ea310={'count':0x0,'rows':[]};return db['Campaign']['findOne']({'where':{'id':_0x142e53[_0x0a9e('0x42')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0xe1ab0d,null))[_0x0a9e('0x1f')](function(_0x2f79fb){if(_0x2f79fb){_0x1209c4[_0x0a9e('0x2b')]=_[_0x0a9e('0x2c')](db[_0x0a9e('0x7e')][_0x0a9e('0x2a')]);_0x1209c4[_0x0a9e('0x2d')]=_[_0x0a9e('0x2c')](_0x142e53['query']);_0x1209c4['filters']=_['intersection'](_0x1209c4[_0x0a9e('0x2b')],_0x1209c4[_0x0a9e('0x2d')]);_0x4152cd[_0x0a9e('0x30')]=_[_0x0a9e('0x2f')](_0x1209c4[_0x0a9e('0x2b')],qs[_0x0a9e('0x43')](_0x142e53[_0x0a9e('0x2d')][_0x0a9e('0x43')]));_0x4152cd['attributes']=_0x4152cd['attributes'][_0x0a9e('0x31')]?_0x4152cd[_0x0a9e('0x30')]:_0x1209c4['model'];if(!_0x142e53[_0x0a9e('0x2d')][_0x0a9e('0x32')](_0x0a9e('0x33'))){_0x4152cd[_0x0a9e('0x34')]=qs[_0x0a9e('0x34')](_0x142e53[_0x0a9e('0x2d')][_0x0a9e('0x34')]);_0x4152cd[_0x0a9e('0x18')]=qs[_0x0a9e('0x18')](_0x142e53[_0x0a9e('0x2d')][_0x0a9e('0x18')]);}_0x4152cd[_0x0a9e('0x5a')]=qs['sort'](_0x142e53[_0x0a9e('0x2d')][_0x0a9e('0x35')]);_0x4152cd[_0x0a9e('0x36')]=qs[_0x0a9e('0x2e')](_[_0x0a9e('0x37')](_0x142e53[_0x0a9e('0x2d')],_0x1209c4[_0x0a9e('0x2e')]));_0x4152cd[_0x0a9e('0x36')][_0x0a9e('0x54')]=_0x2f79fb['id'];if(_0x142e53[_0x0a9e('0x2d')][_0x0a9e('0x55')]){_0x4152cd[_0x0a9e('0x36')]=_['merge'](_0x4152cd['where'],{'$or':_[_0x0a9e('0x39')](_0x4152cd[_0x0a9e('0x30')],function(_0x4545a3){var _0x1ee9d3={};_0x1ee9d3[_0x4545a3]={'$like':'%'+_0x142e53[_0x0a9e('0x2d')][_0x0a9e('0x55')]+'%'};return _0x1ee9d3;})});}_0x4152cd=_[_0x0a9e('0x38')]({},_0x4152cd,_0x142e53['options']);return db[_0x0a9e('0x7e')]['count']({'where':_0x4152cd[_0x0a9e('0x36')]})[_0x0a9e('0x1f')](function(_0x1e9f9f){_0x3ea310[_0x0a9e('0x17')]=_0x1e9f9f;if(_0x142e53[_0x0a9e('0x2d')][_0x0a9e('0x3e')]){_0x4152cd[_0x0a9e('0x3f')]=[{'all':!![]}];}return db[_0x0a9e('0x7e')][_0x0a9e('0x56')](_0x4152cd);})[_0x0a9e('0x1f')](function(_0x39d367){_0x3ea310[_0x0a9e('0x57')]=_0x39d367;return _0x3ea310;});}})[_0x0a9e('0x1f')](respondWithFilteredResult(_0xe1ab0d,_0x4152cd))[_0x0a9e('0x40')](handleError(_0xe1ab0d,null));};exports[_0x0a9e('0x7f')]=function(_0x2d5e00,_0x5b78a8,_0x54cf62){var _0x9dc1de,_0x410e12;return db['Campaign']['find']({'where':{'id':_0x2d5e00[_0x0a9e('0x42')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x5b78a8,null))[_0x0a9e('0x1f')](function(_0x596178){if(_0x596178){_0x410e12=_0x596178;return _0x596178[_0x0a9e('0x7f')](_0x2d5e00['body'][_0x0a9e('0x60')],_['omit'](_0x2d5e00[_0x0a9e('0x46')],['ids','id'])||{});}return null;})[_0x0a9e('0x61')](function(_0x21e210){var _0x1d5432;_0x9dc1de=_0x21e210||[];var _0x50e7cc=[];if(_0x21e210){for(var _0x316b51=0x0;_0x316b51<_0x21e210['length'];_0x316b51+=0x1){var _0x505ffd=_0x21e210[_0x316b51][_0x0a9e('0x21')]({'plain':!![]});_0x1d5432=squel[_0x0a9e('0x76')]()[_0x0a9e('0x63')](_0x0a9e('0x80'))[_0x0a9e('0x65')]([_0x0a9e('0x66'),_0x0a9e('0x67'),_0x0a9e('0x68'),_0x0a9e('0x54'),_0x0a9e('0x51'),_0x0a9e('0x50')],squel[_0x0a9e('0x70')]()[_0x0a9e('0x3c')](_0x0a9e('0x66'),_0x0a9e('0x66'))[_0x0a9e('0x3c')]('id',_0x0a9e('0x67'))[_0x0a9e('0x3c')](_0x505ffd[_0x0a9e('0x6a')]['toString'](),_0x0a9e('0x68'))[_0x0a9e('0x3c')](_0x2d5e00[_0x0a9e('0x42')]['id'][_0x0a9e('0x6b')](),'CampaignId')['field']('NOW()',_0x0a9e('0x51'))['field'](_0x0a9e('0x6c'),_0x0a9e('0x50'))[_0x0a9e('0x6d')](_0x0a9e('0x77'))[_0x0a9e('0x36')](_0x0a9e('0x78'))[_0x0a9e('0x36')](_0x0a9e('0x6e'),_0x505ffd[_0x0a9e('0x6a')][_0x0a9e('0x6b')]())['where'](_0x0a9e('0x6f')))['toString']();_0x50e7cc[_0x0a9e('0x7a')](db['sequelize'][_0x0a9e('0x2d')](_0x1d5432));}return BPromise[_0x0a9e('0x7b')](_0x50e7cc);}})[_0x0a9e('0x1f')](function(){return _0x9dc1de;})['then'](respondWithResult(_0x5b78a8,null))[_0x0a9e('0x40')](handleError(_0x5b78a8,null));};exports[_0x0a9e('0x81')]=function(_0x531377,_0x53c4f0,_0x3fab79){return db[_0x0a9e('0x29')][_0x0a9e('0x44')]({'where':{'id':_0x531377['params']['id']}})['then'](handleEntityNotFound(_0x53c4f0,null))['then'](function(_0x374964){if(_0x374964){return _0x374964[_0x0a9e('0x81')](_0x531377[_0x0a9e('0x2d')][_0x0a9e('0x60')]);}})[_0x0a9e('0x1f')](function(_0x23e6b5){if(_0x23e6b5){return db[_0x0a9e('0x5d')][_0x0a9e('0x20')]({'where':{'ListId':_0x531377[_0x0a9e('0x2d')][_0x0a9e('0x60')],'CampaignId':_0x531377[_0x0a9e('0x42')]['id']}})[_0x0a9e('0x1f')](function(){return _0x23e6b5;});}})[_0x0a9e('0x1f')](respondWithStatusCode(_0x53c4f0,null))[_0x0a9e('0x40')](handleError(_0x53c4f0,null));}; \ No newline at end of file +var _0xa9e0=['into','cm_hopper','fromQuery','phone','ContactId','ListId','scheduledAt','CmListId','toString','NOW()','from','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','select','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','onlyIfOpen','insert','cm_contacts','deletedAt\x20IS\x20NULL','COALESCE(phone,\x27\x27)','push','all','removeLists','getBlackLists','CmList','addBlackLists','cm_hopper_black','removeBlackLists','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../mysqldb','sendStatus','status','json','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','get','IvrCampaigns','UserProfileResource','end','error','name','send','index','Campaign','rawAttributes','model','keys','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','limit','sort','where','pick','merge','map','type','key','field','options','includeAll','include','catch','show','params','fields','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','clone','omit','updatedAt','createdAt','findOne','CmHopper','CampaignId','filter','findAll','rows','getHopperHistories','CmHopperHistory','order','getHopperFinals','CmHopperFinal','CmHopperBlack','getLists','addLists','ids','spread','dialCheckDuplicateType'];(function(_0x22b68a,_0x2bffc3){var _0x1ac67a=function(_0x25f9d5){while(--_0x25f9d5){_0x22b68a['push'](_0x22b68a['shift']());}};_0x1ac67a(++_0x2bffc3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0xa9e0[_0x24237f];return _0x48298e;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var as=require(_0x0a9e('0x11'));var hardwareService=require(_0x0a9e('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x0a9e('0x13'))['db'];function respondWithStatusCode(_0x36471c,_0xd5b662){_0xd5b662=_0xd5b662||0xcc;return function(_0x26d672){if(_0x26d672){return _0x36471c[_0x0a9e('0x14')](_0xd5b662);}return _0x36471c[_0x0a9e('0x15')](_0xd5b662)['end']();};}function respondWithResult(_0x4283ce,_0x239b12){_0x239b12=_0x239b12||0xc8;return function(_0x2b4227){if(_0x2b4227){return _0x4283ce[_0x0a9e('0x15')](_0x239b12)[_0x0a9e('0x16')](_0x2b4227);}};}function respondWithFilteredResult(_0x4d5611,_0x52a03d){return function(_0x22dccb){if(_0x22dccb){var _0x5d0880=_0x22dccb[_0x0a9e('0x17')],_0x1985b6=_0x52a03d['offset'],_0x519dfd=_0x52a03d[_0x0a9e('0x18')]+_0x52a03d['limit'],_0x16033c;if(_0x519dfd>=_0x5d0880){_0x519dfd=_0x5d0880;_0x16033c=0xc8;}else{_0x16033c=0xce;}_0x4d5611[_0x0a9e('0x15')](_0x16033c);return _0x4d5611[_0x0a9e('0x19')](_0x0a9e('0x1a'),_0x1985b6+'-'+_0x519dfd+'/'+_0x5d0880)[_0x0a9e('0x16')](_0x22dccb);}return null;};}function patchUpdates(_0x31b1ca){return function(_0x2eb11f){try{jsonpatch[_0x0a9e('0x1b')](_0x2eb11f,_0x31b1ca,!![]);}catch(_0x20559e){return BPromise[_0x0a9e('0x1c')](_0x20559e);}return _0x2eb11f[_0x0a9e('0x1d')]();};}function saveUpdates(_0x1c696a,_0x105080){return function(_0x4bb1e3){if(_0x4bb1e3){return _0x4bb1e3[_0x0a9e('0x1e')](_0x1c696a)[_0x0a9e('0x1f')](function(_0x53682f){return _0x53682f;});}return null;};}function removeEntity(_0x20f109,_0x5a09ef){return function(_0x588269){if(_0x588269){return _0x588269[_0x0a9e('0x20')]()[_0x0a9e('0x1f')](function(){var _0x38e7c4=_0x588269[_0x0a9e('0x21')]({'plain':!![]});var _0x4abc77=_0x0a9e('0x22');return db[_0x0a9e('0x23')][_0x0a9e('0x20')]({'where':{'type':_0x4abc77,'resourceId':_0x38e7c4['id']}})[_0x0a9e('0x1f')](function(){return _0x588269;});})[_0x0a9e('0x1f')](function(){_0x20f109[_0x0a9e('0x15')](0xcc)[_0x0a9e('0x24')]();});}};}function handleEntityNotFound(_0x5ea472,_0x59181e){return function(_0x197ec0){if(!_0x197ec0){_0x5ea472[_0x0a9e('0x14')](0x194);}return _0x197ec0;};}function handleError(_0x40c424,_0x33161b){_0x33161b=_0x33161b||0x1f4;return function(_0x526cf3){logger[_0x0a9e('0x25')](_0x526cf3['stack']);if(_0x526cf3[_0x0a9e('0x26')]){delete _0x526cf3['name'];}_0x40c424[_0x0a9e('0x15')](_0x33161b)[_0x0a9e('0x27')](_0x526cf3);};}exports[_0x0a9e('0x28')]=function(_0x14433c,_0x140511){var _0x1538a4={},_0x11c3b6={},_0x14de77={'count':0x0,'rows':[]};var _0x5a101a=db[_0x0a9e('0x29')][_0x0a9e('0x2a')];_0x11c3b6[_0x0a9e('0x2b')]=_[_0x0a9e('0x2c')](_0x5a101a);_0x11c3b6['query']=_[_0x0a9e('0x2c')](_0x14433c[_0x0a9e('0x2d')]);_0x11c3b6[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x11c3b6[_0x0a9e('0x2b')],_0x11c3b6[_0x0a9e('0x2d')]);_0x1538a4[_0x0a9e('0x30')]=_[_0x0a9e('0x2f')](_0x11c3b6[_0x0a9e('0x2b')],qs['fields'](_0x14433c[_0x0a9e('0x2d')]['fields']));_0x1538a4[_0x0a9e('0x30')]=_0x1538a4[_0x0a9e('0x30')][_0x0a9e('0x31')]?_0x1538a4[_0x0a9e('0x30')]:_0x11c3b6[_0x0a9e('0x2b')];if(!_0x14433c['query'][_0x0a9e('0x32')](_0x0a9e('0x33'))){_0x1538a4[_0x0a9e('0x34')]=qs[_0x0a9e('0x34')](_0x14433c[_0x0a9e('0x2d')][_0x0a9e('0x34')]);_0x1538a4[_0x0a9e('0x18')]=qs[_0x0a9e('0x18')](_0x14433c['query'][_0x0a9e('0x18')]);}_0x1538a4['order']=qs[_0x0a9e('0x35')](_0x14433c[_0x0a9e('0x2d')][_0x0a9e('0x35')]);_0x1538a4[_0x0a9e('0x36')]=qs['filters'](_[_0x0a9e('0x37')](_0x14433c[_0x0a9e('0x2d')],_0x11c3b6[_0x0a9e('0x2e')]));if(_0x14433c[_0x0a9e('0x2d')]['filter']){_0x1538a4['where']=_[_0x0a9e('0x38')](_0x1538a4['where'],{'$or':_[_0x0a9e('0x39')](_0x5a101a,function(_0x3d9717){if(_0x3d9717[_0x0a9e('0x3a')][_0x0a9e('0x3b')]!=='VIRTUAL'){var _0x31916f={};_0x31916f[_0x3d9717[_0x0a9e('0x3c')]]={'$like':'%'+_0x14433c[_0x0a9e('0x2d')]['filter']+'%'};return _0x31916f;}})});}_0x1538a4=_[_0x0a9e('0x38')]({},_0x1538a4,_0x14433c[_0x0a9e('0x3d')]);var _0x289467={'where':_0x1538a4['where']};return db['Campaign'][_0x0a9e('0x17')](_0x289467)[_0x0a9e('0x1f')](function(_0x5adda1){_0x14de77[_0x0a9e('0x17')]=_0x5adda1;if(_0x14433c[_0x0a9e('0x2d')][_0x0a9e('0x3e')]){_0x1538a4[_0x0a9e('0x3f')]=[{'all':!![]}];}return db['Campaign']['findAll'](_0x1538a4);})[_0x0a9e('0x1f')](function(_0x45b3d0){_0x14de77['rows']=_0x45b3d0;return _0x14de77;})[_0x0a9e('0x1f')](respondWithFilteredResult(_0x140511,_0x1538a4))[_0x0a9e('0x40')](handleError(_0x140511,null));};exports[_0x0a9e('0x41')]=function(_0x5b4f5e,_0x316c8f){var _0x2cfea9={'raw':![],'where':{'id':_0x5b4f5e[_0x0a9e('0x42')]['id']}},_0x274e8e={};_0x274e8e[_0x0a9e('0x2b')]=_[_0x0a9e('0x2c')](db[_0x0a9e('0x29')][_0x0a9e('0x2a')]);_0x274e8e[_0x0a9e('0x2d')]=_[_0x0a9e('0x2c')](_0x5b4f5e[_0x0a9e('0x2d')]);_0x274e8e[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x274e8e[_0x0a9e('0x2b')],_0x274e8e[_0x0a9e('0x2d')]);_0x2cfea9['attributes']=_['intersection'](_0x274e8e[_0x0a9e('0x2b')],qs[_0x0a9e('0x43')](_0x5b4f5e[_0x0a9e('0x2d')][_0x0a9e('0x43')]));_0x2cfea9[_0x0a9e('0x30')]=_0x2cfea9[_0x0a9e('0x30')][_0x0a9e('0x31')]?_0x2cfea9[_0x0a9e('0x30')]:_0x274e8e[_0x0a9e('0x2b')];if(_0x5b4f5e[_0x0a9e('0x2d')][_0x0a9e('0x3e')]){_0x2cfea9[_0x0a9e('0x3f')]=[{'all':!![]}];}_0x2cfea9=_['merge']({},_0x2cfea9,_0x5b4f5e[_0x0a9e('0x3d')]);return db[_0x0a9e('0x29')][_0x0a9e('0x44')](_0x2cfea9)[_0x0a9e('0x1f')](handleEntityNotFound(_0x316c8f,null))[_0x0a9e('0x1f')](respondWithResult(_0x316c8f,null))[_0x0a9e('0x40')](handleError(_0x316c8f,null));};exports[_0x0a9e('0x45')]=function(_0x44dd99,_0x59afe8){return db[_0x0a9e('0x29')]['create'](_0x44dd99[_0x0a9e('0x46')],{})[_0x0a9e('0x1f')](function(_0x8d6dd1){var _0x562fb4=_0x44dd99[_0x0a9e('0x47')][_0x0a9e('0x21')]({'plain':!![]});if(!_0x562fb4)throw new Error(_0x0a9e('0x48'));if(_0x562fb4[_0x0a9e('0x49')]===_0x0a9e('0x47')){var _0x37be73=_0x8d6dd1[_0x0a9e('0x21')]({'plain':!![]});var _0x5bbcde=_0x0a9e('0x22');return db[_0x0a9e('0x4a')][_0x0a9e('0x44')]({'where':{'name':_0x5bbcde,'userProfileId':_0x562fb4[_0x0a9e('0x4b')]},'raw':!![]})[_0x0a9e('0x1f')](function(_0x992c77){if(_0x992c77&&_0x992c77[_0x0a9e('0x4c')]===0x0){return db[_0x0a9e('0x23')][_0x0a9e('0x45')]({'name':_0x37be73['name'],'resourceId':_0x37be73['id'],'type':_0x992c77[_0x0a9e('0x26')],'sectionId':_0x992c77['id']},{})[_0x0a9e('0x1f')](function(){return _0x8d6dd1;});}else{return _0x8d6dd1;}})['catch'](function(_0x4ae14b){logger['error'](_0x0a9e('0x4d'),_0x4ae14b);throw _0x4ae14b;});}return _0x8d6dd1;})[_0x0a9e('0x1f')](respondWithResult(_0x59afe8,0xc9))[_0x0a9e('0x40')](handleError(_0x59afe8,null));};exports[_0x0a9e('0x4e')]=function(_0x61bb17,_0x30decb){var _0x2e5165={'raw':![],'where':{'id':_0x61bb17['params']['id']}},_0x375c18={};_0x375c18['model']=_['keys'](db[_0x0a9e('0x29')][_0x0a9e('0x2a')]);_0x2e5165[_0x0a9e('0x30')]=_['intersection'](_0x375c18[_0x0a9e('0x2b')],qs[_0x0a9e('0x43')](_0x61bb17['query']['fields']));_0x2e5165[_0x0a9e('0x30')]=_0x2e5165['attributes'][_0x0a9e('0x31')]?_0x2e5165['attributes']:_0x375c18[_0x0a9e('0x2b')];if(_0x61bb17[_0x0a9e('0x2d')][_0x0a9e('0x3e')]){_0x2e5165['include']=[{'all':!![]}];}_0x2e5165=_[_0x0a9e('0x38')]({},_0x2e5165,_0x61bb17[_0x0a9e('0x3d')]);return db['Campaign']['find'](_0x2e5165)[_0x0a9e('0x1f')](handleEntityNotFound(_0x30decb,null))[_0x0a9e('0x1f')](function(_0x49c095){if(_0x49c095){var _0x145931=_0x49c095['get']({'plain':!![]});_0x145931=qs[_0x0a9e('0x4f')](_0x145931,['id','createdAt',_0x0a9e('0x50')]);_0x61bb17['body']=_['omit'](_0x61bb17['body'],['id',_0x0a9e('0x51'),'updatedAt']);return db[_0x0a9e('0x29')][_0x0a9e('0x45')](_[_0x0a9e('0x38')](_0x145931,_0x61bb17[_0x0a9e('0x46')]),{'include':_0x61bb17[_0x0a9e('0x2d')][_0x0a9e('0x3e')]?[{'all':!![]}]:undefined})[_0x0a9e('0x1f')](function(_0x28d814){var _0x4e67ab=_0x61bb17[_0x0a9e('0x47')][_0x0a9e('0x21')]({'plain':!![]});if(!_0x4e67ab)throw new Error(_0x0a9e('0x48'));if(_0x4e67ab[_0x0a9e('0x49')]===_0x0a9e('0x47')){var _0x156662=_0x28d814['get']({'plain':!![]});var _0x956fbe=_0x0a9e('0x22');return db['UserProfileSection'][_0x0a9e('0x44')]({'where':{'name':_0x956fbe,'userProfileId':_0x4e67ab['userProfileId']},'raw':!![]})[_0x0a9e('0x1f')](function(_0x5ba1f9){if(_0x5ba1f9&&_0x5ba1f9['autoAssociation']===0x0){return db['UserProfileResource'][_0x0a9e('0x45')]({'name':_0x156662['name'],'resourceId':_0x156662['id'],'type':_0x5ba1f9[_0x0a9e('0x26')],'sectionId':_0x5ba1f9['id']},{})[_0x0a9e('0x1f')](function(){return _0x28d814;});}else{return _0x28d814;}})[_0x0a9e('0x40')](function(_0x7be420){logger[_0x0a9e('0x25')](_0x0a9e('0x4d'),_0x7be420);throw _0x7be420;});}return _0x28d814;});}})['then'](respondWithResult(_0x30decb,0xc9))[_0x0a9e('0x40')](handleError(_0x30decb,null));};exports['update']=function(_0xca4ade,_0x1f07cb){if(_0xca4ade[_0x0a9e('0x46')]['id']){delete _0xca4ade['body']['id'];}return db[_0x0a9e('0x29')][_0x0a9e('0x44')]({'where':{'id':_0xca4ade[_0x0a9e('0x42')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x1f07cb,null))['then'](saveUpdates(_0xca4ade[_0x0a9e('0x46')],null))[_0x0a9e('0x1f')](respondWithResult(_0x1f07cb,null))['catch'](handleError(_0x1f07cb,null));};exports[_0x0a9e('0x20')]=function(_0x17e88c,_0x88dcbf){return db[_0x0a9e('0x29')][_0x0a9e('0x44')]({'where':{'id':_0x17e88c['params']['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x88dcbf,null))[_0x0a9e('0x1f')](removeEntity(_0x88dcbf,null))[_0x0a9e('0x40')](handleError(_0x88dcbf,null));};exports['getHoppers']=function(_0x3528b7,_0x4f1e60,_0x5211e3){var _0x242745={'raw':!![],'where':{}};var _0x4556c5={};var _0x9375fb={'count':0x0,'rows':[]};return db[_0x0a9e('0x29')][_0x0a9e('0x52')]({'where':{'id':_0x3528b7[_0x0a9e('0x42')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x4f1e60,null))[_0x0a9e('0x1f')](function(_0x2d7205){if(_0x2d7205){_0x4556c5[_0x0a9e('0x2b')]=_[_0x0a9e('0x2c')](db[_0x0a9e('0x53')][_0x0a9e('0x2a')]);_0x4556c5[_0x0a9e('0x2d')]=_[_0x0a9e('0x2c')](_0x3528b7[_0x0a9e('0x2d')]);_0x4556c5[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x4556c5['model'],_0x4556c5[_0x0a9e('0x2d')]);_0x242745[_0x0a9e('0x30')]=_[_0x0a9e('0x2f')](_0x4556c5['model'],qs[_0x0a9e('0x43')](_0x3528b7[_0x0a9e('0x2d')]['fields']));_0x242745[_0x0a9e('0x30')]=_0x242745[_0x0a9e('0x30')][_0x0a9e('0x31')]?_0x242745[_0x0a9e('0x30')]:_0x4556c5[_0x0a9e('0x2b')];if(!_0x3528b7['query']['hasOwnProperty']('nolimit')){_0x242745[_0x0a9e('0x34')]=qs[_0x0a9e('0x34')](_0x3528b7[_0x0a9e('0x2d')][_0x0a9e('0x34')]);_0x242745[_0x0a9e('0x18')]=qs[_0x0a9e('0x18')](_0x3528b7[_0x0a9e('0x2d')][_0x0a9e('0x18')]);}_0x242745['order']=qs[_0x0a9e('0x35')](_0x3528b7[_0x0a9e('0x2d')][_0x0a9e('0x35')]);_0x242745['where']=qs[_0x0a9e('0x2e')](_['pick'](_0x3528b7[_0x0a9e('0x2d')],_0x4556c5[_0x0a9e('0x2e')]));_0x242745['where'][_0x0a9e('0x54')]=_0x2d7205['id'];if(_0x3528b7[_0x0a9e('0x2d')][_0x0a9e('0x55')]){_0x242745[_0x0a9e('0x36')]=_['merge'](_0x242745[_0x0a9e('0x36')],{'$or':_[_0x0a9e('0x39')](_0x242745[_0x0a9e('0x30')],function(_0x278ab4){var _0x5b7fc3={};_0x5b7fc3[_0x278ab4]={'$like':'%'+_0x3528b7[_0x0a9e('0x2d')][_0x0a9e('0x55')]+'%'};return _0x5b7fc3;})});}_0x242745=_[_0x0a9e('0x38')]({},_0x242745,_0x3528b7[_0x0a9e('0x3d')]);return db['CmHopper'][_0x0a9e('0x17')]({'where':_0x242745[_0x0a9e('0x36')]})[_0x0a9e('0x1f')](function(_0xf410e5){_0x9375fb[_0x0a9e('0x17')]=_0xf410e5;if(_0x3528b7[_0x0a9e('0x2d')][_0x0a9e('0x3e')]){_0x242745[_0x0a9e('0x3f')]=[{'all':!![]}];}return db[_0x0a9e('0x53')][_0x0a9e('0x56')](_0x242745);})[_0x0a9e('0x1f')](function(_0x1f10ef){_0x9375fb[_0x0a9e('0x57')]=_0x1f10ef;return _0x9375fb;});}})[_0x0a9e('0x1f')](respondWithFilteredResult(_0x4f1e60,_0x242745))['catch'](handleError(_0x4f1e60,null));};exports[_0x0a9e('0x58')]=function(_0x11da9c,_0xc599b3,_0x563627){var _0x3736e0={'raw':!![],'where':{}};var _0x33dda0={};var _0x8cea96={'count':0x0,'rows':[]};return db[_0x0a9e('0x29')]['findOne']({'where':{'id':_0x11da9c['params']['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0xc599b3,null))[_0x0a9e('0x1f')](function(_0x4c54fa){if(_0x4c54fa){_0x33dda0[_0x0a9e('0x2b')]=_['keys'](db[_0x0a9e('0x59')][_0x0a9e('0x2a')]);_0x33dda0['query']=_[_0x0a9e('0x2c')](_0x11da9c[_0x0a9e('0x2d')]);_0x33dda0[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x33dda0[_0x0a9e('0x2b')],_0x33dda0[_0x0a9e('0x2d')]);_0x3736e0[_0x0a9e('0x30')]=_['intersection'](_0x33dda0[_0x0a9e('0x2b')],qs[_0x0a9e('0x43')](_0x11da9c[_0x0a9e('0x2d')][_0x0a9e('0x43')]));_0x3736e0['attributes']=_0x3736e0[_0x0a9e('0x30')][_0x0a9e('0x31')]?_0x3736e0['attributes']:_0x33dda0[_0x0a9e('0x2b')];if(!_0x11da9c['query'][_0x0a9e('0x32')](_0x0a9e('0x33'))){_0x3736e0[_0x0a9e('0x34')]=qs[_0x0a9e('0x34')](_0x11da9c['query']['limit']);_0x3736e0[_0x0a9e('0x18')]=qs[_0x0a9e('0x18')](_0x11da9c[_0x0a9e('0x2d')]['offset']);}_0x3736e0[_0x0a9e('0x5a')]=qs[_0x0a9e('0x35')](_0x11da9c['query']['sort']);_0x3736e0[_0x0a9e('0x36')]=qs['filters'](_['pick'](_0x11da9c['query'],_0x33dda0[_0x0a9e('0x2e')]));_0x3736e0[_0x0a9e('0x36')][_0x0a9e('0x54')]=_0x4c54fa['id'];if(_0x11da9c[_0x0a9e('0x2d')][_0x0a9e('0x55')]){_0x3736e0[_0x0a9e('0x36')]=_['merge'](_0x3736e0[_0x0a9e('0x36')],{'$or':_['map'](_0x3736e0[_0x0a9e('0x30')],function(_0x2aabab){var _0x18ad56={};_0x18ad56[_0x2aabab]={'$like':'%'+_0x11da9c[_0x0a9e('0x2d')]['filter']+'%'};return _0x18ad56;})});}_0x3736e0=_[_0x0a9e('0x38')]({},_0x3736e0,_0x11da9c[_0x0a9e('0x3d')]);return db[_0x0a9e('0x59')]['count']({'where':_0x3736e0[_0x0a9e('0x36')]})[_0x0a9e('0x1f')](function(_0x2a563d){_0x8cea96[_0x0a9e('0x17')]=_0x2a563d;if(_0x11da9c[_0x0a9e('0x2d')][_0x0a9e('0x3e')]){_0x3736e0[_0x0a9e('0x3f')]=[{'all':!![]}];}return db[_0x0a9e('0x59')]['findAll'](_0x3736e0);})[_0x0a9e('0x1f')](function(_0x3325c5){_0x8cea96['rows']=_0x3325c5;return _0x8cea96;});}})[_0x0a9e('0x1f')](respondWithFilteredResult(_0xc599b3,_0x3736e0))[_0x0a9e('0x40')](handleError(_0xc599b3,null));};exports[_0x0a9e('0x5b')]=function(_0x5a26c8,_0x96672f,_0x52ec10){var _0x8c8fbe={'raw':!![],'where':{}};var _0x2b5148={};var _0x558a87={'count':0x0,'rows':[]};return db[_0x0a9e('0x29')][_0x0a9e('0x52')]({'where':{'id':_0x5a26c8[_0x0a9e('0x42')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x96672f,null))[_0x0a9e('0x1f')](function(_0x501050){if(_0x501050){_0x2b5148[_0x0a9e('0x2b')]=_[_0x0a9e('0x2c')](db[_0x0a9e('0x5c')][_0x0a9e('0x2a')]);_0x2b5148[_0x0a9e('0x2d')]=_[_0x0a9e('0x2c')](_0x5a26c8[_0x0a9e('0x2d')]);_0x2b5148[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x2b5148[_0x0a9e('0x2b')],_0x2b5148[_0x0a9e('0x2d')]);_0x8c8fbe[_0x0a9e('0x30')]=_[_0x0a9e('0x2f')](_0x2b5148['model'],qs[_0x0a9e('0x43')](_0x5a26c8[_0x0a9e('0x2d')][_0x0a9e('0x43')]));_0x8c8fbe[_0x0a9e('0x30')]=_0x8c8fbe[_0x0a9e('0x30')]['length']?_0x8c8fbe[_0x0a9e('0x30')]:_0x2b5148[_0x0a9e('0x2b')];if(!_0x5a26c8['query'][_0x0a9e('0x32')]('nolimit')){_0x8c8fbe[_0x0a9e('0x34')]=qs[_0x0a9e('0x34')](_0x5a26c8[_0x0a9e('0x2d')][_0x0a9e('0x34')]);_0x8c8fbe['offset']=qs[_0x0a9e('0x18')](_0x5a26c8['query'][_0x0a9e('0x18')]);}_0x8c8fbe[_0x0a9e('0x5a')]=qs['sort'](_0x5a26c8[_0x0a9e('0x2d')][_0x0a9e('0x35')]);_0x8c8fbe[_0x0a9e('0x36')]=qs['filters'](_['pick'](_0x5a26c8[_0x0a9e('0x2d')],_0x2b5148[_0x0a9e('0x2e')]));_0x8c8fbe[_0x0a9e('0x36')][_0x0a9e('0x54')]=_0x501050['id'];if(_0x5a26c8[_0x0a9e('0x2d')][_0x0a9e('0x55')]){_0x8c8fbe[_0x0a9e('0x36')]=_[_0x0a9e('0x38')](_0x8c8fbe[_0x0a9e('0x36')],{'$or':_['map'](_0x8c8fbe[_0x0a9e('0x30')],function(_0x517081){var _0x287324={};_0x287324[_0x517081]={'$like':'%'+_0x5a26c8[_0x0a9e('0x2d')][_0x0a9e('0x55')]+'%'};return _0x287324;})});}_0x8c8fbe=_[_0x0a9e('0x38')]({},_0x8c8fbe,_0x5a26c8[_0x0a9e('0x3d')]);return db['CmHopperFinal'][_0x0a9e('0x17')]({'where':_0x8c8fbe[_0x0a9e('0x36')]})[_0x0a9e('0x1f')](function(_0x2aa5f2){_0x558a87[_0x0a9e('0x17')]=_0x2aa5f2;if(_0x5a26c8['query']['includeAll']){_0x8c8fbe[_0x0a9e('0x3f')]=[{'all':!![]}];}return db['CmHopperFinal'][_0x0a9e('0x56')](_0x8c8fbe);})[_0x0a9e('0x1f')](function(_0x4672e1){_0x558a87[_0x0a9e('0x57')]=_0x4672e1;return _0x558a87;});}})[_0x0a9e('0x1f')](respondWithFilteredResult(_0x96672f,_0x8c8fbe))[_0x0a9e('0x40')](handleError(_0x96672f,null));};exports['getHopperBlacks']=function(_0x4db918,_0x1889ed,_0x5dfbe2){var _0x2469d1={'raw':!![],'where':{}};var _0x5c689c={};var _0x427ccc={'count':0x0,'rows':[]};return db['Campaign']['findOne']({'where':{'id':_0x4db918[_0x0a9e('0x42')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x1889ed,null))['then'](function(_0x170af6){if(_0x170af6){_0x5c689c[_0x0a9e('0x2b')]=_[_0x0a9e('0x2c')](db[_0x0a9e('0x5d')][_0x0a9e('0x2a')]);_0x5c689c['query']=_['keys'](_0x4db918[_0x0a9e('0x2d')]);_0x5c689c[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x5c689c[_0x0a9e('0x2b')],_0x5c689c[_0x0a9e('0x2d')]);_0x2469d1['attributes']=_[_0x0a9e('0x2f')](_0x5c689c[_0x0a9e('0x2b')],qs['fields'](_0x4db918[_0x0a9e('0x2d')][_0x0a9e('0x43')]));_0x2469d1[_0x0a9e('0x30')]=_0x2469d1[_0x0a9e('0x30')][_0x0a9e('0x31')]?_0x2469d1[_0x0a9e('0x30')]:_0x5c689c[_0x0a9e('0x2b')];if(!_0x4db918[_0x0a9e('0x2d')][_0x0a9e('0x32')](_0x0a9e('0x33'))){_0x2469d1['limit']=qs[_0x0a9e('0x34')](_0x4db918[_0x0a9e('0x2d')][_0x0a9e('0x34')]);_0x2469d1[_0x0a9e('0x18')]=qs[_0x0a9e('0x18')](_0x4db918['query']['offset']);}_0x2469d1[_0x0a9e('0x5a')]=qs[_0x0a9e('0x35')](_0x4db918[_0x0a9e('0x2d')][_0x0a9e('0x35')]);_0x2469d1[_0x0a9e('0x36')]=qs['filters'](_[_0x0a9e('0x37')](_0x4db918[_0x0a9e('0x2d')],_0x5c689c[_0x0a9e('0x2e')]));_0x2469d1['where'][_0x0a9e('0x54')]=_0x170af6['id'];if(_0x4db918['query'][_0x0a9e('0x55')]){_0x2469d1['where']=_[_0x0a9e('0x38')](_0x2469d1[_0x0a9e('0x36')],{'$or':_[_0x0a9e('0x39')](_0x2469d1['attributes'],function(_0xc9529d){var _0x5ed560={};_0x5ed560[_0xc9529d]={'$like':'%'+_0x4db918[_0x0a9e('0x2d')][_0x0a9e('0x55')]+'%'};return _0x5ed560;})});}_0x2469d1=_[_0x0a9e('0x38')]({},_0x2469d1,_0x4db918[_0x0a9e('0x3d')]);return db[_0x0a9e('0x5d')][_0x0a9e('0x17')]({'where':_0x2469d1[_0x0a9e('0x36')]})[_0x0a9e('0x1f')](function(_0x2aaf07){_0x427ccc[_0x0a9e('0x17')]=_0x2aaf07;if(_0x4db918[_0x0a9e('0x2d')][_0x0a9e('0x3e')]){_0x2469d1[_0x0a9e('0x3f')]=[{'all':!![]}];}return db[_0x0a9e('0x5d')][_0x0a9e('0x56')](_0x2469d1);})[_0x0a9e('0x1f')](function(_0x5b93dd){_0x427ccc['rows']=_0x5b93dd;return _0x427ccc;});}})[_0x0a9e('0x1f')](respondWithFilteredResult(_0x1889ed,_0x2469d1))['catch'](handleError(_0x1889ed,null));};exports[_0x0a9e('0x5e')]=function(_0x3428c9,_0x5d6b69,_0x1a3754){var _0xe2b083={};var _0x387bbe={};var _0x18adc8;var _0x5585d5;return db[_0x0a9e('0x29')][_0x0a9e('0x52')]({'where':{'id':_0x3428c9[_0x0a9e('0x42')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x5d6b69,null))['then'](function(_0x19e9ed){if(_0x19e9ed){_0x18adc8=_0x19e9ed;_0x387bbe[_0x0a9e('0x2b')]=_[_0x0a9e('0x2c')](db['CmList'][_0x0a9e('0x2a')]);_0x387bbe[_0x0a9e('0x2d')]=_[_0x0a9e('0x2c')](_0x3428c9['query']);_0x387bbe[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x387bbe[_0x0a9e('0x2b')],_0x387bbe[_0x0a9e('0x2d')]);_0xe2b083[_0x0a9e('0x30')]=_['intersection'](_0x387bbe[_0x0a9e('0x2b')],qs[_0x0a9e('0x43')](_0x3428c9['query'][_0x0a9e('0x43')]));_0xe2b083[_0x0a9e('0x30')]=_0xe2b083[_0x0a9e('0x30')]['length']?_0xe2b083['attributes']:_0x387bbe['model'];_0xe2b083[_0x0a9e('0x5a')]=qs[_0x0a9e('0x35')](_0x3428c9['query'][_0x0a9e('0x35')]);_0xe2b083[_0x0a9e('0x36')]=qs[_0x0a9e('0x2e')](_['pick'](_0x3428c9[_0x0a9e('0x2d')],_0x387bbe[_0x0a9e('0x2e')]));if(_0x3428c9[_0x0a9e('0x2d')][_0x0a9e('0x55')]){_0xe2b083[_0x0a9e('0x36')]=_[_0x0a9e('0x38')](_0xe2b083[_0x0a9e('0x36')],{'$or':_[_0x0a9e('0x39')](_0xe2b083[_0x0a9e('0x30')],function(_0x5a1848){var _0x43c397={};_0x43c397[_0x5a1848]={'$like':'%'+_0x3428c9['query'][_0x0a9e('0x55')]+'%'};return _0x43c397;})});}_0xe2b083=_[_0x0a9e('0x38')]({},_0xe2b083,_0x3428c9[_0x0a9e('0x3d')]);return _0x18adc8[_0x0a9e('0x5e')](_0xe2b083);}})[_0x0a9e('0x1f')](function(_0x344cd4){if(_0x344cd4){_0x5585d5=_0x344cd4['length'];if(!_0x3428c9[_0x0a9e('0x2d')][_0x0a9e('0x32')](_0x0a9e('0x33'))){_0xe2b083[_0x0a9e('0x34')]=qs['limit'](_0x3428c9[_0x0a9e('0x2d')][_0x0a9e('0x34')]);_0xe2b083[_0x0a9e('0x18')]=qs[_0x0a9e('0x18')](_0x3428c9[_0x0a9e('0x2d')][_0x0a9e('0x18')]);}return _0x18adc8[_0x0a9e('0x5e')](_0xe2b083);}})[_0x0a9e('0x1f')](function(_0x3299b7){if(_0x3299b7){return _0x3299b7?{'count':_0x5585d5,'rows':_0x3299b7}:null;}})[_0x0a9e('0x1f')](respondWithResult(_0x5d6b69,null))['catch'](handleError(_0x5d6b69,null));};exports[_0x0a9e('0x5f')]=function(_0x88b25f,_0x2ff265,_0x26b826){var _0xea8bd1,_0x253f74;return db[_0x0a9e('0x29')][_0x0a9e('0x44')]({'where':{'id':_0x88b25f['params']['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x2ff265,null))[_0x0a9e('0x1f')](function(_0x1a9ef1){if(_0x1a9ef1){_0x253f74=_0x1a9ef1;return _0x1a9ef1['addLists'](_0x88b25f[_0x0a9e('0x46')][_0x0a9e('0x60')],_[_0x0a9e('0x4f')](_0x88b25f[_0x0a9e('0x46')],[_0x0a9e('0x60'),'id'])||{});}return null;})[_0x0a9e('0x61')](function(_0x424f1b){var _0x336a19;_0xea8bd1=_0x424f1b||[];var _0x401601=[];if(_0x424f1b){for(var _0x451010=0x0;_0x451010<_0x424f1b['length'];_0x451010+=0x1){var _0x251753=_0x424f1b[_0x451010][_0x0a9e('0x21')]({'plain':!![]});_0x253f74[_0x0a9e('0x62')]=_0x88b25f[_0x0a9e('0x46')][_0x0a9e('0x62')]?_0x88b25f[_0x0a9e('0x46')]['dialCheckDuplicateType']:_0x253f74[_0x0a9e('0x62')];switch(_0x253f74['dialCheckDuplicateType']){case'always':_0x336a19=squel['insert']()[_0x0a9e('0x63')](_0x0a9e('0x64'))[_0x0a9e('0x65')]([_0x0a9e('0x66'),'scheduledAt',_0x0a9e('0x67'),_0x0a9e('0x68'),_0x0a9e('0x54'),_0x0a9e('0x51'),_0x0a9e('0x50')],squel['select']()['field'](_0x0a9e('0x66'),_0x0a9e('0x66'))[_0x0a9e('0x3c')]('NOW()',_0x0a9e('0x69'))[_0x0a9e('0x3c')]('id',_0x0a9e('0x67'))['field'](_0x251753[_0x0a9e('0x6a')][_0x0a9e('0x6b')](),_0x0a9e('0x68'))['field'](_0x88b25f[_0x0a9e('0x42')]['id'][_0x0a9e('0x6b')](),_0x0a9e('0x54'))['field']('NOW()','createdAt')[_0x0a9e('0x3c')](_0x0a9e('0x6c'),_0x0a9e('0x50'))[_0x0a9e('0x6d')]('cm_contacts')[_0x0a9e('0x36')]('deletedAt\x20IS\x20NULL')[_0x0a9e('0x36')](_0x0a9e('0x6e'),_0x251753[_0x0a9e('0x6a')]['toString']())[_0x0a9e('0x36')](_0x0a9e('0x6f'))[_0x0a9e('0x36')]('phone\x20NOT\x20IN\x20(?)',squel[_0x0a9e('0x70')]()['field'](_0x0a9e('0x71'))['from'](_0x0a9e('0x72'))['where'](_0x0a9e('0x73'),_0x88b25f[_0x0a9e('0x42')]['id'][_0x0a9e('0x6b')]()))[_0x0a9e('0x36')](_0x0a9e('0x74'),squel[_0x0a9e('0x70')]()[_0x0a9e('0x3c')]('COALESCE(phone,\x27\x27)')[_0x0a9e('0x6d')](_0x0a9e('0x64'))['where'](_0x0a9e('0x73'),_0x88b25f[_0x0a9e('0x42')]['id']['toString']())))[_0x0a9e('0x6b')]();break;case _0x0a9e('0x75'):_0x336a19=squel[_0x0a9e('0x76')]()['into'](_0x0a9e('0x64'))[_0x0a9e('0x65')]([_0x0a9e('0x66'),_0x0a9e('0x69'),_0x0a9e('0x67'),_0x0a9e('0x68'),_0x0a9e('0x54'),_0x0a9e('0x51'),_0x0a9e('0x50')],squel[_0x0a9e('0x70')]()['field'](_0x0a9e('0x66'),'phone')[_0x0a9e('0x3c')](_0x0a9e('0x6c'),_0x0a9e('0x69'))[_0x0a9e('0x3c')]('id',_0x0a9e('0x67'))[_0x0a9e('0x3c')](_0x251753['CmListId'][_0x0a9e('0x6b')](),_0x0a9e('0x68'))[_0x0a9e('0x3c')](_0x88b25f['params']['id'][_0x0a9e('0x6b')](),_0x0a9e('0x54'))[_0x0a9e('0x3c')](_0x0a9e('0x6c'),_0x0a9e('0x51'))[_0x0a9e('0x3c')](_0x0a9e('0x6c'),'updatedAt')[_0x0a9e('0x6d')](_0x0a9e('0x77'))[_0x0a9e('0x36')](_0x0a9e('0x78'))[_0x0a9e('0x36')](_0x0a9e('0x6e'),_0x251753[_0x0a9e('0x6a')]['toString']())['where'](_0x0a9e('0x6f'))[_0x0a9e('0x36')](_0x0a9e('0x74'),squel[_0x0a9e('0x70')]()[_0x0a9e('0x3c')](_0x0a9e('0x79'))[_0x0a9e('0x6d')]('cm_hopper')[_0x0a9e('0x36')](_0x0a9e('0x73'),_0x88b25f[_0x0a9e('0x42')]['id'][_0x0a9e('0x6b')]())))[_0x0a9e('0x6b')]();break;default:_0x336a19=squel[_0x0a9e('0x76')]()[_0x0a9e('0x63')]('cm_hopper')[_0x0a9e('0x65')]([_0x0a9e('0x66'),_0x0a9e('0x69'),'ContactId',_0x0a9e('0x68'),_0x0a9e('0x54'),_0x0a9e('0x51'),_0x0a9e('0x50')],squel['select']()[_0x0a9e('0x3c')](_0x0a9e('0x66'),_0x0a9e('0x66'))[_0x0a9e('0x3c')](_0x0a9e('0x6c'),_0x0a9e('0x69'))[_0x0a9e('0x3c')]('id',_0x0a9e('0x67'))['field'](_0x251753[_0x0a9e('0x6a')][_0x0a9e('0x6b')](),_0x0a9e('0x68'))[_0x0a9e('0x3c')](_0x88b25f['params']['id']['toString'](),_0x0a9e('0x54'))[_0x0a9e('0x3c')](_0x0a9e('0x6c'),'createdAt')[_0x0a9e('0x3c')](_0x0a9e('0x6c'),'updatedAt')[_0x0a9e('0x6d')]('cm_contacts')[_0x0a9e('0x36')]('deletedAt\x20IS\x20NULL')['where']('ListId\x20=\x20?',_0x251753[_0x0a9e('0x6a')][_0x0a9e('0x6b')]())[_0x0a9e('0x36')](_0x0a9e('0x6f')))[_0x0a9e('0x6b')]();}_0x401601[_0x0a9e('0x7a')](db['sequelize'][_0x0a9e('0x2d')](_0x336a19));}return BPromise[_0x0a9e('0x7b')](_0x401601);}})[_0x0a9e('0x1f')](function(){return _0xea8bd1;})[_0x0a9e('0x1f')](respondWithResult(_0x2ff265,null))[_0x0a9e('0x40')](handleError(_0x2ff265,null));};exports[_0x0a9e('0x7c')]=function(_0x31c937,_0x5312fa,_0x49baaa){return db[_0x0a9e('0x29')]['find']({'where':{'id':_0x31c937[_0x0a9e('0x42')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x5312fa,null))[_0x0a9e('0x1f')](function(_0xa3695f){if(_0xa3695f){return _0xa3695f[_0x0a9e('0x7c')](_0x31c937[_0x0a9e('0x2d')]['ids']);}})[_0x0a9e('0x1f')](function(_0x59b872){if(_0x59b872){return db['CmHopper'][_0x0a9e('0x20')]({'where':{'ListId':_0x31c937['query'][_0x0a9e('0x60')],'CampaignId':_0x31c937['params']['id']}})['then'](function(){return _0x59b872;});}})[_0x0a9e('0x1f')](respondWithStatusCode(_0x5312fa,null))['catch'](handleError(_0x5312fa,null));};exports[_0x0a9e('0x7d')]=function(_0x142e53,_0xe1ab0d,_0x48f532){var _0x4152cd={'raw':!![],'where':{}};var _0x1209c4={};var _0x3ea310={'count':0x0,'rows':[]};return db['Campaign']['findOne']({'where':{'id':_0x142e53[_0x0a9e('0x42')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0xe1ab0d,null))[_0x0a9e('0x1f')](function(_0x2f79fb){if(_0x2f79fb){_0x1209c4[_0x0a9e('0x2b')]=_[_0x0a9e('0x2c')](db[_0x0a9e('0x7e')][_0x0a9e('0x2a')]);_0x1209c4[_0x0a9e('0x2d')]=_[_0x0a9e('0x2c')](_0x142e53['query']);_0x1209c4['filters']=_['intersection'](_0x1209c4[_0x0a9e('0x2b')],_0x1209c4[_0x0a9e('0x2d')]);_0x4152cd[_0x0a9e('0x30')]=_[_0x0a9e('0x2f')](_0x1209c4[_0x0a9e('0x2b')],qs[_0x0a9e('0x43')](_0x142e53[_0x0a9e('0x2d')][_0x0a9e('0x43')]));_0x4152cd['attributes']=_0x4152cd['attributes'][_0x0a9e('0x31')]?_0x4152cd[_0x0a9e('0x30')]:_0x1209c4['model'];if(!_0x142e53[_0x0a9e('0x2d')][_0x0a9e('0x32')](_0x0a9e('0x33'))){_0x4152cd[_0x0a9e('0x34')]=qs[_0x0a9e('0x34')](_0x142e53[_0x0a9e('0x2d')][_0x0a9e('0x34')]);_0x4152cd[_0x0a9e('0x18')]=qs[_0x0a9e('0x18')](_0x142e53[_0x0a9e('0x2d')][_0x0a9e('0x18')]);}_0x4152cd[_0x0a9e('0x5a')]=qs['sort'](_0x142e53[_0x0a9e('0x2d')][_0x0a9e('0x35')]);_0x4152cd[_0x0a9e('0x36')]=qs[_0x0a9e('0x2e')](_[_0x0a9e('0x37')](_0x142e53[_0x0a9e('0x2d')],_0x1209c4[_0x0a9e('0x2e')]));_0x4152cd[_0x0a9e('0x36')][_0x0a9e('0x54')]=_0x2f79fb['id'];if(_0x142e53[_0x0a9e('0x2d')][_0x0a9e('0x55')]){_0x4152cd[_0x0a9e('0x36')]=_['merge'](_0x4152cd['where'],{'$or':_[_0x0a9e('0x39')](_0x4152cd[_0x0a9e('0x30')],function(_0x4545a3){var _0x1ee9d3={};_0x1ee9d3[_0x4545a3]={'$like':'%'+_0x142e53[_0x0a9e('0x2d')][_0x0a9e('0x55')]+'%'};return _0x1ee9d3;})});}_0x4152cd=_[_0x0a9e('0x38')]({},_0x4152cd,_0x142e53['options']);return db[_0x0a9e('0x7e')]['count']({'where':_0x4152cd[_0x0a9e('0x36')]})[_0x0a9e('0x1f')](function(_0x1e9f9f){_0x3ea310[_0x0a9e('0x17')]=_0x1e9f9f;if(_0x142e53[_0x0a9e('0x2d')][_0x0a9e('0x3e')]){_0x4152cd[_0x0a9e('0x3f')]=[{'all':!![]}];}return db[_0x0a9e('0x7e')][_0x0a9e('0x56')](_0x4152cd);})[_0x0a9e('0x1f')](function(_0x39d367){_0x3ea310[_0x0a9e('0x57')]=_0x39d367;return _0x3ea310;});}})[_0x0a9e('0x1f')](respondWithFilteredResult(_0xe1ab0d,_0x4152cd))[_0x0a9e('0x40')](handleError(_0xe1ab0d,null));};exports[_0x0a9e('0x7f')]=function(_0x2d5e00,_0x5b78a8,_0x54cf62){var _0x9dc1de,_0x410e12;return db['Campaign']['find']({'where':{'id':_0x2d5e00[_0x0a9e('0x42')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x5b78a8,null))[_0x0a9e('0x1f')](function(_0x596178){if(_0x596178){_0x410e12=_0x596178;return _0x596178[_0x0a9e('0x7f')](_0x2d5e00['body'][_0x0a9e('0x60')],_['omit'](_0x2d5e00[_0x0a9e('0x46')],['ids','id'])||{});}return null;})[_0x0a9e('0x61')](function(_0x21e210){var _0x1d5432;_0x9dc1de=_0x21e210||[];var _0x50e7cc=[];if(_0x21e210){for(var _0x316b51=0x0;_0x316b51<_0x21e210['length'];_0x316b51+=0x1){var _0x505ffd=_0x21e210[_0x316b51][_0x0a9e('0x21')]({'plain':!![]});_0x1d5432=squel[_0x0a9e('0x76')]()[_0x0a9e('0x63')](_0x0a9e('0x80'))[_0x0a9e('0x65')]([_0x0a9e('0x66'),_0x0a9e('0x67'),_0x0a9e('0x68'),_0x0a9e('0x54'),_0x0a9e('0x51'),_0x0a9e('0x50')],squel[_0x0a9e('0x70')]()[_0x0a9e('0x3c')](_0x0a9e('0x66'),_0x0a9e('0x66'))[_0x0a9e('0x3c')]('id',_0x0a9e('0x67'))[_0x0a9e('0x3c')](_0x505ffd[_0x0a9e('0x6a')]['toString'](),_0x0a9e('0x68'))[_0x0a9e('0x3c')](_0x2d5e00[_0x0a9e('0x42')]['id'][_0x0a9e('0x6b')](),'CampaignId')['field']('NOW()',_0x0a9e('0x51'))['field'](_0x0a9e('0x6c'),_0x0a9e('0x50'))[_0x0a9e('0x6d')](_0x0a9e('0x77'))[_0x0a9e('0x36')](_0x0a9e('0x78'))[_0x0a9e('0x36')](_0x0a9e('0x6e'),_0x505ffd[_0x0a9e('0x6a')][_0x0a9e('0x6b')]())['where'](_0x0a9e('0x6f')))['toString']();_0x50e7cc[_0x0a9e('0x7a')](db['sequelize'][_0x0a9e('0x2d')](_0x1d5432));}return BPromise[_0x0a9e('0x7b')](_0x50e7cc);}})[_0x0a9e('0x1f')](function(){return _0x9dc1de;})['then'](respondWithResult(_0x5b78a8,null))[_0x0a9e('0x40')](handleError(_0x5b78a8,null));};exports[_0x0a9e('0x81')]=function(_0x531377,_0x53c4f0,_0x3fab79){return db[_0x0a9e('0x29')][_0x0a9e('0x44')]({'where':{'id':_0x531377['params']['id']}})['then'](handleEntityNotFound(_0x53c4f0,null))['then'](function(_0x374964){if(_0x374964){return _0x374964[_0x0a9e('0x81')](_0x531377[_0x0a9e('0x2d')][_0x0a9e('0x60')]);}})[_0x0a9e('0x1f')](function(_0x23e6b5){if(_0x23e6b5){return db[_0x0a9e('0x5d')][_0x0a9e('0x20')]({'where':{'ListId':_0x531377[_0x0a9e('0x2d')][_0x0a9e('0x60')],'CampaignId':_0x531377[_0x0a9e('0x42')]['id']}})[_0x0a9e('0x1f')](function(){return _0x23e6b5;});}})[_0x0a9e('0x1f')](respondWithStatusCode(_0x53c4f0,null))[_0x0a9e('0x40')](handleError(_0x53c4f0,null));}; \ No newline at end of file diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js index e19d924..f5c10d5 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 _0xd7e9=['lodash','util','../../config/logger','bluebird','request-promise','path','../../config/environment','exports','define','Campaign'];(function(_0x3763df,_0x5d4818){var _0x2b732e=function(_0x46acdc){while(--_0x46acdc){_0x3763df['push'](_0x3763df['shift']());}};_0x2b732e(++_0x5d4818);}(_0xd7e9,0xc8));var _0x9d7e=function(_0x399e5a,_0x1a6958){_0x399e5a=_0x399e5a-0x0;var _0x480e80=_0xd7e9[_0x399e5a];return _0x480e80;};'use strict';var _=require(_0x9d7e('0x0'));var util=require(_0x9d7e('0x1'));var logger=require(_0x9d7e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x9d7e('0x3'));var rp=require(_0x9d7e('0x4'));var fs=require('fs');var path=require(_0x9d7e('0x5'));var rimraf=require('rimraf');var config=require(_0x9d7e('0x6'));var attributes=require('./campaign.attributes');module[_0x9d7e('0x7')]=function(_0x56ce6d,_0x6a3990){return _0x56ce6d[_0x9d7e('0x8')](_0x9d7e('0x9'),attributes,{'tableName':'campaigns','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x957a=['path','../../config/environment','./campaign.attributes','exports','define','Campaign','campaigns','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x464d1c,_0x45ca2e){var _0x22d8e8=function(_0x114519){while(--_0x114519){_0x464d1c['push'](_0x464d1c['shift']());}};_0x22d8e8(++_0x45ca2e);}(_0x957a,0x1a7));var _0xa957=function(_0x567b21,_0x1b2eea){_0x567b21=_0x567b21-0x0;var _0x5cfd5a=_0x957a[_0x567b21];return _0x5cfd5a;};'use strict';var _=require(_0xa957('0x0'));var util=require(_0xa957('0x1'));var logger=require(_0xa957('0x2'))(_0xa957('0x3'));var moment=require('moment');var BPromise=require(_0xa957('0x4'));var rp=require(_0xa957('0x5'));var fs=require('fs');var path=require(_0xa957('0x6'));var rimraf=require('rimraf');var config=require(_0xa957('0x7'));var attributes=require(_0xa957('0x8'));module[_0xa957('0x9')]=function(_0x2330b7,_0x465acf){return _0x2330b7[_0xa957('0xa')](_0xa957('0xb'),attributes,{'tableName':_0xa957('0xc'),'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 df51e11..8ee16bb 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 _0xa9e0=['catch','Campaign','findAll','options','raw','where','attributes','include','map','model','GetCampaign','stringify','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','code','error','message','result'];(function(_0x588f79,_0x1230d0){var _0x13f2cc=function(_0x312649){while(--_0x312649){_0x588f79['push'](_0x588f79['shift']());}};_0x13f2cc(++_0x1230d0);}(_0xa9e0,0x123));var _0x0a9e=function(_0x13ea00,_0x12f610){_0x13ea00=_0x13ea00-0x0;var _0x1f7347=_0xa9e0[_0x13ea00];return _0x1f7347;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}exports['GetCampaign']=function(_0x459eb1){var _0x478723=this;return new Promise(function(_0x106033,_0x205fd6){return db[_0x0a9e('0x14')][_0x0a9e('0x15')]({'raw':_0x459eb1[_0x0a9e('0x16')]?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x17')]===undefined?!![]:![]:!![],'where':_0x459eb1[_0x0a9e('0x16')]?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x18')]||null:null,'attributes':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x19')]||null:null,'limit':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')]['limit']||null:null,'include':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x459eb1[_0x0a9e('0x16')]['include'],function(_0xfb6e48){return{'model':db[_0xfb6e48[_0x0a9e('0x1c')]],'as':_0xfb6e48['as'],'attributes':_0xfb6e48[_0x0a9e('0x19')],'include':_0xfb6e48[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0xfb6e48[_0x0a9e('0x1a')],function(_0x16b1ca){return{'model':db[_0x16b1ca['model']],'as':_0x16b1ca['as'],'attributes':_0x16b1ca['attributes'],'include':_0x16b1ca[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x16b1ca[_0x0a9e('0x1a')],function(_0x33161b){return{'model':db[_0x33161b['model']],'as':_0x33161b['as'],'attributes':_0x33161b[_0x0a9e('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x45a1e7){logger['info'](_0x0a9e('0x1d'),_0x459eb1);logger[_0x0a9e('0xd')](_0x0a9e('0x1d'),_0x459eb1,JSON[_0x0a9e('0x1e')](_0x45a1e7));_0x106033(_0x45a1e7);})[_0x0a9e('0x13')](function(_0x1538a4){logger[_0x0a9e('0x10')](_0x0a9e('0x1d'),_0x1538a4['message'],_0x459eb1);_0x205fd6(_0x478723[_0x0a9e('0x10')](0x1f4,_0x1538a4[_0x0a9e('0x11')]));});});}; \ No newline at end of file +var _0xa9e0=['catch','Campaign','findAll','options','raw','where','attributes','include','map','model','GetCampaign','stringify','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','code','error','message','result'];(function(_0x5b7903,_0x414d07){var _0x576373=function(_0x1e230b){while(--_0x1e230b){_0x5b7903['push'](_0x5b7903['shift']());}};_0x576373(++_0x414d07);}(_0xa9e0,0x123));var _0x0a9e=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0xa9e0[_0x46aff0];return _0x9d78cf;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}exports['GetCampaign']=function(_0x459eb1){var _0x478723=this;return new Promise(function(_0x106033,_0x205fd6){return db[_0x0a9e('0x14')][_0x0a9e('0x15')]({'raw':_0x459eb1[_0x0a9e('0x16')]?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x17')]===undefined?!![]:![]:!![],'where':_0x459eb1[_0x0a9e('0x16')]?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x18')]||null:null,'attributes':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x19')]||null:null,'limit':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')]['limit']||null:null,'include':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x459eb1[_0x0a9e('0x16')]['include'],function(_0xfb6e48){return{'model':db[_0xfb6e48[_0x0a9e('0x1c')]],'as':_0xfb6e48['as'],'attributes':_0xfb6e48[_0x0a9e('0x19')],'include':_0xfb6e48[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0xfb6e48[_0x0a9e('0x1a')],function(_0x16b1ca){return{'model':db[_0x16b1ca['model']],'as':_0x16b1ca['as'],'attributes':_0x16b1ca['attributes'],'include':_0x16b1ca[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x16b1ca[_0x0a9e('0x1a')],function(_0x33161b){return{'model':db[_0x33161b['model']],'as':_0x33161b['as'],'attributes':_0x33161b[_0x0a9e('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x45a1e7){logger['info'](_0x0a9e('0x1d'),_0x459eb1);logger[_0x0a9e('0xd')](_0x0a9e('0x1d'),_0x459eb1,JSON[_0x0a9e('0x1e')](_0x45a1e7));_0x106033(_0x45a1e7);})[_0x0a9e('0x13')](function(_0x1538a4){logger[_0x0a9e('0x10')](_0x0a9e('0x1d'),_0x1538a4['message'],_0x459eb1);_0x205fd6(_0x478723[_0x0a9e('0x10')](0x1f4,_0x1538a4[_0x0a9e('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js index 1931d39..2ccf12a 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 _0x8cda=['getLists','/:id/blacklists','getBlackLists','post','/:id/clone','addLists','put','update','delete','destroy','removeBlackLists','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./campaign.controller','get','index','/:id','isAuthenticated','show','/:id/hoppers','/:id/hopper_finals','getHopperFinals','getHopperBlacks','/:id/lists'];(function(_0x47abb1,_0x3f5545){var _0x26ef7c=function(_0x1f7d42){while(--_0x1f7d42){_0x47abb1['push'](_0x47abb1['shift']());}};_0x26ef7c(++_0x3f5545);}(_0x8cda,0x1db));var _0xa8cd=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x8cda[_0x14add3];return _0x4a174f;};'use strict';var multer=require('multer');var util=require(_0xa8cd('0x0'));var path=require(_0xa8cd('0x1'));var timeout=require(_0xa8cd('0x2'));var express=require(_0xa8cd('0x3'));var router=express[_0xa8cd('0x4')]();var auth=require(_0xa8cd('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xa8cd('0x6'));var controller=require(_0xa8cd('0x7'));router[_0xa8cd('0x8')]('/',auth['isAuthenticated'](),controller[_0xa8cd('0x9')]);router[_0xa8cd('0x8')](_0xa8cd('0xa'),auth[_0xa8cd('0xb')](),controller[_0xa8cd('0xc')]);router[_0xa8cd('0x8')](_0xa8cd('0xd'),auth[_0xa8cd('0xb')](),controller['getHoppers']);router['get']('/:id/hopper_histories',auth[_0xa8cd('0xb')](),controller['getHopperHistories']);router[_0xa8cd('0x8')](_0xa8cd('0xe'),auth['isAuthenticated'](),controller[_0xa8cd('0xf')]);router[_0xa8cd('0x8')]('/:id/hopper_black',auth['isAuthenticated'](),controller[_0xa8cd('0x10')]);router[_0xa8cd('0x8')](_0xa8cd('0x11'),auth[_0xa8cd('0xb')](),controller[_0xa8cd('0x12')]);router['get'](_0xa8cd('0x13'),auth['isAuthenticated'](),controller[_0xa8cd('0x14')]);router['post']('/',auth[_0xa8cd('0xb')](),controller['create']);router[_0xa8cd('0x15')](_0xa8cd('0x16'),auth[_0xa8cd('0xb')](),controller['clone']);router['post'](_0xa8cd('0x11'),auth[_0xa8cd('0xb')](),controller[_0xa8cd('0x17')]);router[_0xa8cd('0x15')]('/:id/blacklists',auth[_0xa8cd('0xb')](),controller['addBlackLists']);router[_0xa8cd('0x18')](_0xa8cd('0xa'),auth['isAuthenticated'](),controller[_0xa8cd('0x19')]);router[_0xa8cd('0x1a')]('/:id',auth[_0xa8cd('0xb')](),controller[_0xa8cd('0x1b')]);router[_0xa8cd('0x1a')](_0xa8cd('0x11'),auth[_0xa8cd('0xb')](),controller['removeLists']);router[_0xa8cd('0x1a')](_0xa8cd('0x13'),auth[_0xa8cd('0xb')](),controller[_0xa8cd('0x1c')]);module['exports']=router; \ No newline at end of file +var _0x0268=['getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','/:id/hopper_black','getHopperBlacks','/:id/lists','getLists','/:id/blacklists','getBlackLists','post','create','/:id/clone','clone','addLists','addBlackLists','delete','removeBlackLists','exports','multer','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','isAuthenticated','index','/:id','show','get','/:id/hoppers'];(function(_0x1f7b4f,_0x5bffc5){var _0x4c61d0=function(_0x135b0e){while(--_0x135b0e){_0x1f7b4f['push'](_0x1f7b4f['shift']());}};_0x4c61d0(++_0x5bffc5);}(_0x0268,0x17e));var _0x8026=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x0268[_0x501510];return _0x1e6ee5;};'use strict';var multer=require(_0x8026('0x0'));var util=require('util');var path=require(_0x8026('0x1'));var timeout=require(_0x8026('0x2'));var express=require('express');var router=express[_0x8026('0x3')]();var auth=require(_0x8026('0x4'));var interaction=require(_0x8026('0x5'));var config=require(_0x8026('0x6'));var controller=require(_0x8026('0x7'));router['get']('/',auth[_0x8026('0x8')](),controller[_0x8026('0x9')]);router['get'](_0x8026('0xa'),auth[_0x8026('0x8')](),controller[_0x8026('0xb')]);router[_0x8026('0xc')](_0x8026('0xd'),auth[_0x8026('0x8')](),controller[_0x8026('0xe')]);router[_0x8026('0xc')](_0x8026('0xf'),auth[_0x8026('0x8')](),controller[_0x8026('0x10')]);router[_0x8026('0xc')](_0x8026('0x11'),auth['isAuthenticated'](),controller['getHopperFinals']);router['get'](_0x8026('0x12'),auth['isAuthenticated'](),controller[_0x8026('0x13')]);router[_0x8026('0xc')](_0x8026('0x14'),auth[_0x8026('0x8')](),controller[_0x8026('0x15')]);router[_0x8026('0xc')](_0x8026('0x16'),auth[_0x8026('0x8')](),controller[_0x8026('0x17')]);router[_0x8026('0x18')]('/',auth[_0x8026('0x8')](),controller[_0x8026('0x19')]);router[_0x8026('0x18')](_0x8026('0x1a'),auth[_0x8026('0x8')](),controller[_0x8026('0x1b')]);router[_0x8026('0x18')]('/:id/lists',auth['isAuthenticated'](),controller[_0x8026('0x1c')]);router[_0x8026('0x18')](_0x8026('0x16'),auth[_0x8026('0x8')](),controller[_0x8026('0x1d')]);router['put'](_0x8026('0xa'),auth[_0x8026('0x8')](),controller['update']);router[_0x8026('0x1e')](_0x8026('0xa'),auth[_0x8026('0x8')](),controller['destroy']);router['delete'](_0x8026('0x14'),auth[_0x8026('0x8')](),controller['removeLists']);router[_0x8026('0x1e')](_0x8026('0x16'),auth['isAuthenticated'](),controller[_0x8026('0x1f')]);module[_0x8026('0x20')]=router; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js index ee08b65..f08ad5f 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 _0xae1f=['sequelize','exports','STRING','VIRTUAL','key'];(function(_0x2d9e27,_0x5965b2){var _0xd35381=function(_0x343d18){while(--_0x343d18){_0x2d9e27['push'](_0x2d9e27['shift']());}};_0xd35381(++_0x5965b2);}(_0xae1f,0x1b8));var _0xfae1=function(_0x5a187b,_0x1f64fe){_0x5a187b=_0x5a187b-0x0;var _0x14d601=_0xae1f[_0x5a187b];return _0x14d601;};'use strict';var Sequelize=require(_0xfae1('0x0'));module[_0xfae1('0x1')]={'key':{'type':Sequelize[_0xfae1('0x2')],'allowNull':![]},'value':{'type':Sequelize['TEXT'],'allowNull':![]},'description':{'type':Sequelize[_0xfae1('0x2')]},'name':{'type':Sequelize[_0xfae1('0x3')],'get':function(){return this['getDataValue'](_0xfae1('0x4'));}}}; \ No newline at end of file +var _0xd3ff=['sequelize','STRING','TEXT','VIRTUAL','getDataValue','key'];(function(_0x4abe74,_0x5f0c0){var _0x1653f5=function(_0x35de5d){while(--_0x35de5d){_0x4abe74['push'](_0x4abe74['shift']());}};_0x1653f5(++_0x5f0c0);}(_0xd3ff,0x1ce));var _0xfd3f=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xd3ff[_0x17d9e3];return _0x14192d;};'use strict';var Sequelize=require(_0xfd3f('0x0'));module['exports']={'key':{'type':Sequelize[_0xfd3f('0x1')],'allowNull':![]},'value':{'type':Sequelize[_0xfd3f('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xfd3f('0x1')]},'name':{'type':Sequelize[_0xfd3f('0x3')],'get':function(){return this[_0xfd3f('0x4')](_0xfd3f('0x5'));}}}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js index d32fe25..93a6bdc 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 _0x832c=['hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','filter','merge','type','key','VIRTUAL','field','options','findAll','rows','catch','show','params','includeAll','include','find','update','body','create','MailAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','count','offset','set','Content-Range','apply','reject','save','then','destroy','CannedAnswers','sendStatus','stack','name','send','index','CannedAnswer','rawAttributes','model','keys','query','intersection','attributes','fields','length'];(function(_0x1b1ce1,_0x12b132){var _0x4d1645=function(_0x5652a2){while(--_0x5652a2){_0x1b1ce1['push'](_0x1b1ce1['shift']());}};_0x4d1645(++_0x12b132);}(_0x832c,0x193));var _0xc832=function(_0x405599,_0x2db0f5){_0x405599=_0x405599-0x0;var _0x132c5e=_0x832c[_0x405599];return _0x132c5e;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xc832('0x0'));var rimraf=require(_0xc832('0x1'));var zipdir=require(_0xc832('0x2'));var jsonpatch=require(_0xc832('0x3'));var rp=require(_0xc832('0x4'));var moment=require(_0xc832('0x5'));var BPromise=require(_0xc832('0x6'));var Mustache=require(_0xc832('0x7'));var util=require(_0xc832('0x8'));var path=require(_0xc832('0x9'));var sox=require(_0xc832('0xa'));var csv=require(_0xc832('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0xc832('0xc'));var crypto=require(_0xc832('0xd'));var jsforce=require(_0xc832('0xe'));var deskjs=require(_0xc832('0xf'));var toCsv=require(_0xc832('0xb'));var querystring=require('querystring');var Papa=require(_0xc832('0x10'));var Redis=require(_0xc832('0x11'));var authService=require(_0xc832('0x12'));var qs=require(_0xc832('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc832('0x14'));var logger=require('../../config/logger')(_0xc832('0x15'));var utils=require(_0xc832('0x16'));var config=require(_0xc832('0x17'));var db=require(_0xc832('0x18'))['db'];function respondWithStatusCode(_0x32daef,_0x456497){_0x456497=_0x456497||0xcc;return function(_0x3ffdd9){if(_0x3ffdd9){return _0x32daef['sendStatus'](_0x456497);}return _0x32daef[_0xc832('0x19')](_0x456497)[_0xc832('0x1a')]();};}function respondWithResult(_0x35475,_0x5b3949){_0x5b3949=_0x5b3949||0xc8;return function(_0x24f974){if(_0x24f974){return _0x35475[_0xc832('0x19')](_0x5b3949)[_0xc832('0x1b')](_0x24f974);}};}function respondWithFilteredResult(_0x33e590,_0x328d21){return function(_0x480d17){if(_0x480d17){var _0x5de658=_0x480d17[_0xc832('0x1c')],_0x303937=_0x328d21[_0xc832('0x1d')],_0x5215fc=_0x328d21[_0xc832('0x1d')]+_0x328d21['limit'],_0x580cdf;if(_0x5215fc>=_0x5de658){_0x5215fc=_0x5de658;_0x580cdf=0xc8;}else{_0x580cdf=0xce;}_0x33e590[_0xc832('0x19')](_0x580cdf);return _0x33e590[_0xc832('0x1e')](_0xc832('0x1f'),_0x303937+'-'+_0x5215fc+'/'+_0x5de658)['json'](_0x480d17);}return null;};}function patchUpdates(_0x4a4385){return function(_0x1ff037){try{jsonpatch[_0xc832('0x20')](_0x1ff037,_0x4a4385,!![]);}catch(_0x11cb26){return BPromise[_0xc832('0x21')](_0x11cb26);}return _0x1ff037[_0xc832('0x22')]();};}function saveUpdates(_0x510ca8,_0x12e2b1){return function(_0x5dc0f2){if(_0x5dc0f2){return _0x5dc0f2['update'](_0x510ca8)[_0xc832('0x23')](function(_0x18bd06){return _0x18bd06;});}return null;};}function removeEntity(_0x3fa08f,_0x80bf05){return function(_0x12cb55){if(_0x12cb55){return _0x12cb55[_0xc832('0x24')]()[_0xc832('0x23')](function(){var _0x15ce93=_0x12cb55['get']({'plain':!![]});var _0x40262a=_0xc832('0x25');return db['UserProfileResource'][_0xc832('0x24')]({'where':{'type':_0x40262a,'resourceId':_0x15ce93['id']}})[_0xc832('0x23')](function(){return _0x12cb55;});})['then'](function(){_0x3fa08f[_0xc832('0x19')](0xcc)[_0xc832('0x1a')]();});}};}function handleEntityNotFound(_0x4b977c,_0x17d264){return function(_0x1ab248){if(!_0x1ab248){_0x4b977c[_0xc832('0x26')](0x194);}return _0x1ab248;};}function handleError(_0x5f4f62,_0x3f0b2e){_0x3f0b2e=_0x3f0b2e||0x1f4;return function(_0x2091fb){logger['error'](_0x2091fb[_0xc832('0x27')]);if(_0x2091fb[_0xc832('0x28')]){delete _0x2091fb[_0xc832('0x28')];}_0x5f4f62['status'](_0x3f0b2e)[_0xc832('0x29')](_0x2091fb);};}exports[_0xc832('0x2a')]=function(_0x38c1b1,_0x4883fa){var _0x4d10fa={},_0x2d1afd={},_0x4151ad={'count':0x0,'rows':[]};var _0x56ef42=db[_0xc832('0x2b')][_0xc832('0x2c')];_0x2d1afd[_0xc832('0x2d')]=_[_0xc832('0x2e')](_0x56ef42);_0x2d1afd[_0xc832('0x2f')]=_['keys'](_0x38c1b1[_0xc832('0x2f')]);_0x2d1afd['filters']=_[_0xc832('0x30')](_0x2d1afd[_0xc832('0x2d')],_0x2d1afd[_0xc832('0x2f')]);_0x4d10fa[_0xc832('0x31')]=_[_0xc832('0x30')](_0x2d1afd[_0xc832('0x2d')],qs[_0xc832('0x32')](_0x38c1b1[_0xc832('0x2f')][_0xc832('0x32')]));_0x4d10fa['attributes']=_0x4d10fa[_0xc832('0x31')][_0xc832('0x33')]?_0x4d10fa[_0xc832('0x31')]:_0x2d1afd[_0xc832('0x2d')];if(!_0x38c1b1['query'][_0xc832('0x34')](_0xc832('0x35'))){_0x4d10fa[_0xc832('0x36')]=qs[_0xc832('0x36')](_0x38c1b1[_0xc832('0x2f')][_0xc832('0x36')]);_0x4d10fa[_0xc832('0x1d')]=qs[_0xc832('0x1d')](_0x38c1b1['query'][_0xc832('0x1d')]);}_0x4d10fa[_0xc832('0x37')]=qs[_0xc832('0x38')](_0x38c1b1['query'][_0xc832('0x38')]);_0x4d10fa[_0xc832('0x39')]=qs[_0xc832('0x3a')](_[_0xc832('0x3b')](_0x38c1b1[_0xc832('0x2f')],_0x2d1afd['filters']));if(_0x38c1b1[_0xc832('0x2f')][_0xc832('0x3c')]){_0x4d10fa['where']=_[_0xc832('0x3d')](_0x4d10fa[_0xc832('0x39')],{'$or':_['map'](_0x56ef42,function(_0x4bcce8){if(_0x4bcce8[_0xc832('0x3e')][_0xc832('0x3f')]!==_0xc832('0x40')){var _0x3a4850={};_0x3a4850[_0x4bcce8[_0xc832('0x41')]]={'$like':'%'+_0x38c1b1[_0xc832('0x2f')][_0xc832('0x3c')]+'%'};return _0x3a4850;}})});}_0x4d10fa=_[_0xc832('0x3d')]({},_0x4d10fa,_0x38c1b1[_0xc832('0x42')]);var _0x21a380={'where':_0x4d10fa['where']};return db[_0xc832('0x2b')][_0xc832('0x1c')](_0x21a380)[_0xc832('0x23')](function(_0x1728b4){_0x4151ad['count']=_0x1728b4;if(_0x38c1b1['query']['includeAll']){_0x4d10fa['include']=[{'all':!![]}];}return db['CannedAnswer'][_0xc832('0x43')](_0x4d10fa);})[_0xc832('0x23')](function(_0x4ed064){_0x4151ad[_0xc832('0x44')]=_0x4ed064;return _0x4151ad;})[_0xc832('0x23')](respondWithFilteredResult(_0x4883fa,_0x4d10fa))[_0xc832('0x45')](handleError(_0x4883fa,null));};exports[_0xc832('0x46')]=function(_0x4dbdc0,_0x161ea4){var _0x1e5e2a={'raw':!![],'where':{'id':_0x4dbdc0[_0xc832('0x47')]['id']}},_0x14e020={};_0x14e020[_0xc832('0x2d')]=_['keys'](db[_0xc832('0x2b')]['rawAttributes']);_0x14e020[_0xc832('0x2f')]=_[_0xc832('0x2e')](_0x4dbdc0[_0xc832('0x2f')]);_0x14e020['filters']=_[_0xc832('0x30')](_0x14e020['model'],_0x14e020[_0xc832('0x2f')]);_0x1e5e2a[_0xc832('0x31')]=_['intersection'](_0x14e020['model'],qs[_0xc832('0x32')](_0x4dbdc0[_0xc832('0x2f')][_0xc832('0x32')]));_0x1e5e2a[_0xc832('0x31')]=_0x1e5e2a[_0xc832('0x31')][_0xc832('0x33')]?_0x1e5e2a[_0xc832('0x31')]:_0x14e020['model'];if(_0x4dbdc0['query'][_0xc832('0x48')]){_0x1e5e2a[_0xc832('0x49')]=[{'all':!![]}];}_0x1e5e2a=_[_0xc832('0x3d')]({},_0x1e5e2a,_0x4dbdc0[_0xc832('0x42')]);return db[_0xc832('0x2b')][_0xc832('0x4a')](_0x1e5e2a)[_0xc832('0x23')](handleEntityNotFound(_0x161ea4,null))['then'](respondWithResult(_0x161ea4,null))[_0xc832('0x45')](handleError(_0x161ea4,null));};exports[_0xc832('0x4b')]=function(_0x3c4e58,_0x1eb766){if(_0x3c4e58[_0xc832('0x4c')]['id']){delete _0x3c4e58[_0xc832('0x4c')]['id'];}return db[_0xc832('0x2b')][_0xc832('0x4a')]({'where':{'id':_0x3c4e58[_0xc832('0x47')]['id']}})['then'](handleEntityNotFound(_0x1eb766,null))['then'](saveUpdates(_0x3c4e58[_0xc832('0x4c')],null))[_0xc832('0x23')](respondWithResult(_0x1eb766,null))[_0xc832('0x45')](handleError(_0x1eb766,null));};exports['destroy']=function(_0x4398ed,_0x27e15c){return db['CannedAnswer'][_0xc832('0x4a')]({'where':{'id':_0x4398ed[_0xc832('0x47')]['id']}})[_0xc832('0x23')](handleEntityNotFound(_0x27e15c,null))['then'](removeEntity(_0x27e15c,null))[_0xc832('0x45')](handleError(_0x27e15c,null));};exports[_0xc832('0x4d')]=function(_0xfc2a02,_0x35e0bb){var _0x40fe10={'key':_0xfc2a02['body']['key']};if(_0xfc2a02[_0xc832('0x4c')][_0xc832('0x4e')]){_0x40fe10[_0xc832('0x4e')]=_0xfc2a02[_0xc832('0x4c')][_0xc832('0x4e')];}else if(_0xfc2a02[_0xc832('0x4c')]['SmsAccountId']){_0x40fe10['SmsAccountId']=_0xfc2a02['body']['SmsAccountId'];}else if(_0xfc2a02[_0xc832('0x4c')][_0xc832('0x4f')]){_0x40fe10[_0xc832('0x4f')]=_0xfc2a02[_0xc832('0x4c')][_0xc832('0x4f')];}else if(_0xfc2a02[_0xc832('0x4c')][_0xc832('0x50')]){_0x40fe10[_0xc832('0x50')]=_0xfc2a02[_0xc832('0x4c')][_0xc832('0x50')];}return db[_0xc832('0x2b')][_0xc832('0x4a')]({'where':_0x40fe10})[_0xc832('0x23')](function(_0x13ecdd){if(_0x13ecdd){throw new db[(_0xc832('0x51'))][(_0xc832('0x52'))](_0xc832('0x53'));}return db[_0xc832('0x2b')][_0xc832('0x4d')](_0xfc2a02[_0xc832('0x4c')]);})[_0xc832('0x23')](function(_0x2d4a71){var _0x40ab98=_0xfc2a02[_0xc832('0x54')]['get']({'plain':!![]});if(!_0x40ab98)throw new Error(_0xc832('0x55'));if(_0x40ab98[_0xc832('0x56')]===_0xc832('0x54')){var _0xe0ba4c=_0x2d4a71[_0xc832('0x57')]({'plain':!![]});return db[_0xc832('0x58')][_0xc832('0x4a')]({'where':{'name':_0xc832('0x25'),'userProfileId':_0x40ab98[_0xc832('0x59')]},'raw':!![]})[_0xc832('0x23')](function(_0x3ac2a1){if(_0x3ac2a1&&_0x3ac2a1['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0xe0ba4c[_0xc832('0x28')],'resourceId':_0xe0ba4c['id'],'type':_0x3ac2a1[_0xc832('0x28')],'sectionId':_0x3ac2a1['id']},{})[_0xc832('0x23')](function(){return _0x2d4a71;});}else{return _0x2d4a71;}})[_0xc832('0x45')](function(_0x3ada8d){logger['error'](_0xc832('0x5a'),_0x3ada8d);throw _0x3ada8d;});}return _0x2d4a71;})[_0xc832('0x23')](respondWithResult(_0x35e0bb,0xc9))['catch'](handleError(_0x35e0bb,null));}; \ No newline at end of file +var _0x15fe=['filter','merge','options','includeAll','include','CannedAnswer','findAll','rows','catch','show','params','rawAttributes','find','body','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','The\x20inserted\x20key\x20already\x20exists.','user','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','html-pdf','eml-format','rimraf','zip-dir','moment','mustache','sox','to-csv','lodash','squel','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','set','Content-Range','json','apply','reject','save','update','destroy','then','get','CannedAnswers','UserProfileResource','error','stack','name','index','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','where','pick','map','key','field'];(function(_0x20a558,_0x160e0e){var _0x53d3f7=function(_0x259bd8){while(--_0x259bd8){_0x20a558['push'](_0x20a558['shift']());}};_0x53d3f7(++_0x160e0e);}(_0x15fe,0x158));var _0xe15f=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x15fe[_0x501510];return _0x1e6ee5;};'use strict';var pdf=require(_0xe15f('0x0'));var emlformat=require(_0xe15f('0x1'));var rimraf=require(_0xe15f('0x2'));var zipdir=require(_0xe15f('0x3'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xe15f('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xe15f('0x5'));var util=require('util');var path=require('path');var sox=require(_0xe15f('0x6'));var csv=require(_0xe15f('0x7'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xe15f('0x8'));var squel=require(_0xe15f('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xe15f('0xa'));var toCsv=require(_0xe15f('0x7'));var querystring=require(_0xe15f('0xb'));var Papa=require('papaparse');var Redis=require(_0xe15f('0xc'));var authService=require(_0xe15f('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0xe15f('0xe'));var hardwareService=require(_0xe15f('0xf'));var logger=require('../../config/logger')(_0xe15f('0x10'));var utils=require('../../config/utils');var config=require(_0xe15f('0x11'));var db=require(_0xe15f('0x12'))['db'];function respondWithStatusCode(_0x34b0d8,_0x2c7d78){_0x2c7d78=_0x2c7d78||0xcc;return function(_0x476914){if(_0x476914){return _0x34b0d8[_0xe15f('0x13')](_0x2c7d78);}return _0x34b0d8[_0xe15f('0x14')](_0x2c7d78)[_0xe15f('0x15')]();};}function respondWithResult(_0x181d9c,_0x152812){_0x152812=_0x152812||0xc8;return function(_0xb371fc){if(_0xb371fc){return _0x181d9c['status'](_0x152812)['json'](_0xb371fc);}};}function respondWithFilteredResult(_0x1d5fa6,_0x37d7cd){return function(_0x3b1c3e){if(_0x3b1c3e){var _0x4eebfc=_0x3b1c3e[_0xe15f('0x16')],_0x12225d=_0x37d7cd[_0xe15f('0x17')],_0x582589=_0x37d7cd['offset']+_0x37d7cd['limit'],_0x16d48d;if(_0x582589>=_0x4eebfc){_0x582589=_0x4eebfc;_0x16d48d=0xc8;}else{_0x16d48d=0xce;}_0x1d5fa6[_0xe15f('0x14')](_0x16d48d);return _0x1d5fa6[_0xe15f('0x18')](_0xe15f('0x19'),_0x12225d+'-'+_0x582589+'/'+_0x4eebfc)[_0xe15f('0x1a')](_0x3b1c3e);}return null;};}function patchUpdates(_0x56c684){return function(_0x4e3eca){try{jsonpatch[_0xe15f('0x1b')](_0x4e3eca,_0x56c684,!![]);}catch(_0x260963){return BPromise[_0xe15f('0x1c')](_0x260963);}return _0x4e3eca[_0xe15f('0x1d')]();};}function saveUpdates(_0x9e8a8d,_0x4c5d4c){return function(_0x48c732){if(_0x48c732){return _0x48c732[_0xe15f('0x1e')](_0x9e8a8d)['then'](function(_0x5eaa45){return _0x5eaa45;});}return null;};}function removeEntity(_0x2b03a8,_0x1e72fc){return function(_0x3d4f4a){if(_0x3d4f4a){return _0x3d4f4a[_0xe15f('0x1f')]()[_0xe15f('0x20')](function(){var _0x18dede=_0x3d4f4a[_0xe15f('0x21')]({'plain':!![]});var _0x1e1713=_0xe15f('0x22');return db[_0xe15f('0x23')][_0xe15f('0x1f')]({'where':{'type':_0x1e1713,'resourceId':_0x18dede['id']}})[_0xe15f('0x20')](function(){return _0x3d4f4a;});})['then'](function(){_0x2b03a8[_0xe15f('0x14')](0xcc)[_0xe15f('0x15')]();});}};}function handleEntityNotFound(_0x2f6cd8,_0x519dda){return function(_0x18f3c7){if(!_0x18f3c7){_0x2f6cd8[_0xe15f('0x13')](0x194);}return _0x18f3c7;};}function handleError(_0x1b7454,_0x242992){_0x242992=_0x242992||0x1f4;return function(_0x54e311){logger[_0xe15f('0x24')](_0x54e311[_0xe15f('0x25')]);if(_0x54e311[_0xe15f('0x26')]){delete _0x54e311[_0xe15f('0x26')];}_0x1b7454[_0xe15f('0x14')](_0x242992)['send'](_0x54e311);};}exports[_0xe15f('0x27')]=function(_0x5be920,_0x55e91e){var _0x360e35={},_0x28b610={},_0x5b66eb={'count':0x0,'rows':[]};var _0x5030aa=db['CannedAnswer']['rawAttributes'];_0x28b610[_0xe15f('0x28')]=_[_0xe15f('0x29')](_0x5030aa);_0x28b610[_0xe15f('0x2a')]=_['keys'](_0x5be920[_0xe15f('0x2a')]);_0x28b610[_0xe15f('0x2b')]=_[_0xe15f('0x2c')](_0x28b610[_0xe15f('0x28')],_0x28b610[_0xe15f('0x2a')]);_0x360e35[_0xe15f('0x2d')]=_[_0xe15f('0x2c')](_0x28b610[_0xe15f('0x28')],qs[_0xe15f('0x2e')](_0x5be920['query'][_0xe15f('0x2e')]));_0x360e35[_0xe15f('0x2d')]=_0x360e35[_0xe15f('0x2d')]['length']?_0x360e35[_0xe15f('0x2d')]:_0x28b610[_0xe15f('0x28')];if(!_0x5be920[_0xe15f('0x2a')][_0xe15f('0x2f')](_0xe15f('0x30'))){_0x360e35[_0xe15f('0x31')]=qs['limit'](_0x5be920[_0xe15f('0x2a')]['limit']);_0x360e35[_0xe15f('0x17')]=qs[_0xe15f('0x17')](_0x5be920[_0xe15f('0x2a')][_0xe15f('0x17')]);}_0x360e35[_0xe15f('0x32')]=qs['sort'](_0x5be920[_0xe15f('0x2a')]['sort']);_0x360e35[_0xe15f('0x33')]=qs[_0xe15f('0x2b')](_[_0xe15f('0x34')](_0x5be920[_0xe15f('0x2a')],_0x28b610['filters']));if(_0x5be920[_0xe15f('0x2a')]['filter']){_0x360e35[_0xe15f('0x33')]=_['merge'](_0x360e35[_0xe15f('0x33')],{'$or':_[_0xe15f('0x35')](_0x5030aa,function(_0x5d31e9){if(_0x5d31e9['type'][_0xe15f('0x36')]!=='VIRTUAL'){var _0x1fb0a0={};_0x1fb0a0[_0x5d31e9[_0xe15f('0x37')]]={'$like':'%'+_0x5be920[_0xe15f('0x2a')][_0xe15f('0x38')]+'%'};return _0x1fb0a0;}})});}_0x360e35=_[_0xe15f('0x39')]({},_0x360e35,_0x5be920[_0xe15f('0x3a')]);var _0x31c875={'where':_0x360e35[_0xe15f('0x33')]};return db['CannedAnswer'][_0xe15f('0x16')](_0x31c875)[_0xe15f('0x20')](function(_0x3dbc87){_0x5b66eb[_0xe15f('0x16')]=_0x3dbc87;if(_0x5be920[_0xe15f('0x2a')][_0xe15f('0x3b')]){_0x360e35[_0xe15f('0x3c')]=[{'all':!![]}];}return db[_0xe15f('0x3d')][_0xe15f('0x3e')](_0x360e35);})['then'](function(_0x290de1){_0x5b66eb[_0xe15f('0x3f')]=_0x290de1;return _0x5b66eb;})[_0xe15f('0x20')](respondWithFilteredResult(_0x55e91e,_0x360e35))[_0xe15f('0x40')](handleError(_0x55e91e,null));};exports[_0xe15f('0x41')]=function(_0x3efafb,_0x1179ec){var _0x441c0d={'raw':!![],'where':{'id':_0x3efafb[_0xe15f('0x42')]['id']}},_0x44d8d5={};_0x44d8d5['model']=_[_0xe15f('0x29')](db[_0xe15f('0x3d')][_0xe15f('0x43')]);_0x44d8d5[_0xe15f('0x2a')]=_[_0xe15f('0x29')](_0x3efafb[_0xe15f('0x2a')]);_0x44d8d5[_0xe15f('0x2b')]=_[_0xe15f('0x2c')](_0x44d8d5[_0xe15f('0x28')],_0x44d8d5['query']);_0x441c0d['attributes']=_[_0xe15f('0x2c')](_0x44d8d5[_0xe15f('0x28')],qs[_0xe15f('0x2e')](_0x3efafb[_0xe15f('0x2a')][_0xe15f('0x2e')]));_0x441c0d[_0xe15f('0x2d')]=_0x441c0d['attributes']['length']?_0x441c0d['attributes']:_0x44d8d5['model'];if(_0x3efafb[_0xe15f('0x2a')]['includeAll']){_0x441c0d[_0xe15f('0x3c')]=[{'all':!![]}];}_0x441c0d=_[_0xe15f('0x39')]({},_0x441c0d,_0x3efafb['options']);return db[_0xe15f('0x3d')][_0xe15f('0x44')](_0x441c0d)['then'](handleEntityNotFound(_0x1179ec,null))[_0xe15f('0x20')](respondWithResult(_0x1179ec,null))[_0xe15f('0x40')](handleError(_0x1179ec,null));};exports['update']=function(_0x2eebb5,_0x2eaaca){if(_0x2eebb5[_0xe15f('0x45')]['id']){delete _0x2eebb5['body']['id'];}return db[_0xe15f('0x3d')][_0xe15f('0x44')]({'where':{'id':_0x2eebb5[_0xe15f('0x42')]['id']}})[_0xe15f('0x20')](handleEntityNotFound(_0x2eaaca,null))[_0xe15f('0x20')](saveUpdates(_0x2eebb5[_0xe15f('0x45')],null))[_0xe15f('0x20')](respondWithResult(_0x2eaaca,null))[_0xe15f('0x40')](handleError(_0x2eaaca,null));};exports['destroy']=function(_0x159f56,_0x1de5aa){return db[_0xe15f('0x3d')]['find']({'where':{'id':_0x159f56[_0xe15f('0x42')]['id']}})[_0xe15f('0x20')](handleEntityNotFound(_0x1de5aa,null))[_0xe15f('0x20')](removeEntity(_0x1de5aa,null))[_0xe15f('0x40')](handleError(_0x1de5aa,null));};exports[_0xe15f('0x46')]=function(_0x193d52,_0xf64884){var _0x184e6f={'key':_0x193d52[_0xe15f('0x45')][_0xe15f('0x36')]};if(_0x193d52[_0xe15f('0x45')]['MailAccountId']){_0x184e6f[_0xe15f('0x47')]=_0x193d52[_0xe15f('0x45')][_0xe15f('0x47')];}else if(_0x193d52['body'][_0xe15f('0x48')]){_0x184e6f[_0xe15f('0x48')]=_0x193d52[_0xe15f('0x45')][_0xe15f('0x48')];}else if(_0x193d52[_0xe15f('0x45')][_0xe15f('0x49')]){_0x184e6f['OpenchannelAccountId']=_0x193d52[_0xe15f('0x45')]['OpenchannelAccountId'];}else if(_0x193d52[_0xe15f('0x45')][_0xe15f('0x4a')]){_0x184e6f[_0xe15f('0x4a')]=_0x193d52[_0xe15f('0x45')][_0xe15f('0x4a')];}return db[_0xe15f('0x3d')][_0xe15f('0x44')]({'where':_0x184e6f})['then'](function(_0xc2f976){if(_0xc2f976){throw new db[(_0xe15f('0x4b'))]['ValidationError'](_0xe15f('0x4c'));}return db[_0xe15f('0x3d')][_0xe15f('0x46')](_0x193d52[_0xe15f('0x45')]);})[_0xe15f('0x20')](function(_0x153c6e){var _0x1250cc=_0x193d52[_0xe15f('0x4d')]['get']({'plain':!![]});if(!_0x1250cc)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1250cc['role']===_0xe15f('0x4d')){var _0x396432=_0x153c6e[_0xe15f('0x21')]({'plain':!![]});return db[_0xe15f('0x4e')]['find']({'where':{'name':_0xe15f('0x22'),'userProfileId':_0x1250cc['userProfileId']},'raw':!![]})[_0xe15f('0x20')](function(_0x49e0ae){if(_0x49e0ae&&_0x49e0ae['autoAssociation']===0x0){return db[_0xe15f('0x23')][_0xe15f('0x46')]({'name':_0x396432['name'],'resourceId':_0x396432['id'],'type':_0x49e0ae[_0xe15f('0x26')],'sectionId':_0x49e0ae['id']},{})[_0xe15f('0x20')](function(){return _0x153c6e;});}else{return _0x153c6e;}})[_0xe15f('0x40')](function(_0x28d3a4){logger[_0xe15f('0x24')](_0xe15f('0x4f'),_0x28d3a4);throw _0x28d3a4;});}return _0x153c6e;})[_0xe15f('0x20')](respondWithResult(_0xf64884,0xc9))[_0xe15f('0x40')](handleError(_0xf64884,null));}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js index 4ac6854..158a7c8 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 _0x62cc=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cannedAnswer.attributes','exports','CannedAnswer','tools_canned_answers','utf8mb4','lodash','util','../../config/logger'];(function(_0x53c4f8,_0x44ccaf){var _0x416458=function(_0x2632aa){while(--_0x2632aa){_0x53c4f8['push'](_0x53c4f8['shift']());}};_0x416458(++_0x44ccaf);}(_0x62cc,0xb1));var _0xc62c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x62cc[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xc62c('0x0'));var util=require(_0xc62c('0x1'));var logger=require(_0xc62c('0x2'))(_0xc62c('0x3'));var moment=require(_0xc62c('0x4'));var BPromise=require(_0xc62c('0x5'));var rp=require(_0xc62c('0x6'));var fs=require('fs');var path=require(_0xc62c('0x7'));var rimraf=require(_0xc62c('0x8'));var config=require(_0xc62c('0x9'));var attributes=require(_0xc62c('0xa'));module[_0xc62c('0xb')]=function(_0x11ffef,_0x5c21e0){return _0x11ffef['define'](_0xc62c('0xc'),attributes,{'tableName':_0xc62c('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xc62c('0xe'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xe418=['CannedAnswer','utf8mb4','utf8mb4_unicode_ci','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cannedAnswer.attributes','exports','define'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe418,0x73));var _0x8e41=function(_0x4f9423,_0x31aeb9){_0x4f9423=_0x4f9423-0x0;var _0x41799c=_0xe418[_0x4f9423];return _0x41799c;};'use strict';var _=require('lodash');var util=require(_0x8e41('0x0'));var logger=require('../../config/logger')(_0x8e41('0x1'));var moment=require(_0x8e41('0x2'));var BPromise=require(_0x8e41('0x3'));var rp=require(_0x8e41('0x4'));var fs=require('fs');var path=require(_0x8e41('0x5'));var rimraf=require(_0x8e41('0x6'));var config=require(_0x8e41('0x7'));var attributes=require(_0x8e41('0x8'));module[_0x8e41('0x9')]=function(_0x4b2f29,_0x4aad81){return _0x4b2f29[_0x8e41('0xa')](_0x8e41('0xb'),attributes,{'tableName':'tools_canned_answers','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x8e41('0xc'),'collate':_0x8e41('0xd')});}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js index 3a7d22d..4307085 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 _0xb5b2=['catch','bluebird','randomstring','ioredis','../../config/logger','../../config/environment','client','then','info','request\x20sent','debug','CannedAnswer,\x20%s,\x20%s,\x20%s','stringify','error','code','CannedAnswer,\x20%s,\x20%s','message','result'];(function(_0x533110,_0x20937f){var _0xc3c866=function(_0x2d4a68){while(--_0x2d4a68){_0x533110['push'](_0x533110['shift']());}};_0xc3c866(++_0x20937f);}(_0xb5b2,0xa3));var _0x2b5b=function(_0x491efd,_0xcec819){_0x491efd=_0x491efd-0x0;var _0x439bbc=_0xb5b2[_0x491efd];return _0x439bbc;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x2b5b('0x0'));var rs=require(_0x2b5b('0x1'));var fs=require('fs');var Redis=require(_0x2b5b('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x2b5b('0x3'))('rpc');var config=require(_0x2b5b('0x4'));var jayson=require('jayson/promise');var client=jayson[_0x2b5b('0x5')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4db4e2,_0x151f18,_0x538faf){return new BPromise(function(_0x190f30,_0x2bea7a){return client['request'](_0x4db4e2,_0x538faf)[_0x2b5b('0x6')](function(_0x3d91c8){logger[_0x2b5b('0x7')]('CannedAnswer,\x20%s,\x20%s',_0x151f18,_0x2b5b('0x8'));logger[_0x2b5b('0x9')](_0x2b5b('0xa'),_0x151f18,_0x2b5b('0x8'),JSON[_0x2b5b('0xb')](_0x3d91c8));if(_0x3d91c8[_0x2b5b('0xc')]){if(_0x3d91c8[_0x2b5b('0xc')][_0x2b5b('0xd')]===0x1f4){logger['error'](_0x2b5b('0xe'),_0x151f18,_0x3d91c8[_0x2b5b('0xc')][_0x2b5b('0xf')]);return _0x2bea7a(_0x3d91c8[_0x2b5b('0xc')][_0x2b5b('0xf')]);}logger[_0x2b5b('0xc')](_0x2b5b('0xe'),_0x151f18,_0x3d91c8[_0x2b5b('0xc')][_0x2b5b('0xf')]);return _0x190f30(_0x3d91c8[_0x2b5b('0xc')][_0x2b5b('0xf')]);}else{logger['info'](_0x2b5b('0xe'),_0x151f18,_0x2b5b('0x8'));_0x190f30(_0x3d91c8[_0x2b5b('0x10')][_0x2b5b('0xf')]);}})[_0x2b5b('0x11')](function(_0x188000){logger['error']('CannedAnswer,\x20%s,\x20%s',_0x151f18,_0x188000);_0x2bea7a(_0x188000);});});} \ No newline at end of file +var _0xc451=['error','code','message','info','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','CannedAnswer,\x20%s,\x20%s','request\x20sent','debug','CannedAnswer,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x346737,_0x3e6081){var _0x1ade2e=function(_0x15e50e){while(--_0x15e50e){_0x346737['push'](_0x346737['shift']());}};_0x1ade2e(++_0x3e6081);}(_0xc451,0xf5));var _0x1c45=function(_0x4166fc,_0x4fa546){_0x4166fc=_0x4166fc-0x0;var _0x362aec=_0xc451[_0x4166fc];return _0x362aec;};'use strict';var _=require('lodash');var util=require(_0x1c45('0x0'));var moment=require(_0x1c45('0x1'));var BPromise=require('bluebird');var rs=require(_0x1c45('0x2'));var fs=require('fs');var Redis=require(_0x1c45('0x3'));var db=require(_0x1c45('0x4'))['db'];var utils=require(_0x1c45('0x5'));var logger=require(_0x1c45('0x6'))(_0x1c45('0x7'));var config=require(_0x1c45('0x8'));var jayson=require(_0x1c45('0x9'));var client=jayson[_0x1c45('0xa')][_0x1c45('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x337aaf,_0x7fe166,_0x56fb25){return new BPromise(function(_0x113c45,_0x2ba921){return client[_0x1c45('0xc')](_0x337aaf,_0x56fb25)[_0x1c45('0xd')](function(_0x99ead6){logger['info'](_0x1c45('0xe'),_0x7fe166,_0x1c45('0xf'));logger[_0x1c45('0x10')](_0x1c45('0x11'),_0x7fe166,_0x1c45('0xf'),JSON[_0x1c45('0x12')](_0x99ead6));if(_0x99ead6[_0x1c45('0x13')]){if(_0x99ead6['error'][_0x1c45('0x14')]===0x1f4){logger[_0x1c45('0x13')]('CannedAnswer,\x20%s,\x20%s',_0x7fe166,_0x99ead6[_0x1c45('0x13')][_0x1c45('0x15')]);return _0x2ba921(_0x99ead6[_0x1c45('0x13')][_0x1c45('0x15')]);}logger['error']('CannedAnswer,\x20%s,\x20%s',_0x7fe166,_0x99ead6[_0x1c45('0x13')][_0x1c45('0x15')]);return _0x113c45(_0x99ead6['error']['message']);}else{logger[_0x1c45('0x16')](_0x1c45('0xe'),_0x7fe166,_0x1c45('0xf'));_0x113c45(_0x99ead6['result'][_0x1c45('0x15')]);}})[_0x1c45('0x17')](function(_0x185689){logger[_0x1c45('0x13')]('CannedAnswer,\x20%s,\x20%s',_0x7fe166,_0x185689);_0x2ba921(_0x185689);});});} \ No newline at end of file diff --git a/server/api/cannedAnswer/index.js b/server/api/cannedAnswer/index.js index b00e95c..6ebfcfd 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 _0x44b6=['get','show','post','put','/:id','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./cannedAnswer.controller','isAuthenticated','index'];(function(_0x5c4423,_0x4043a9){var _0x38e00b=function(_0x497312){while(--_0x497312){_0x5c4423['push'](_0x5c4423['shift']());}};_0x38e00b(++_0x4043a9);}(_0x44b6,0x14c));var _0x644b=function(_0x4c32f5,_0x3dbbf1){_0x4c32f5=_0x4c32f5-0x0;var _0x19cae9=_0x44b6[_0x4c32f5];return _0x19cae9;};'use strict';var multer=require(_0x644b('0x0'));var util=require('util');var path=require(_0x644b('0x1'));var timeout=require(_0x644b('0x2'));var express=require(_0x644b('0x3'));var router=express[_0x644b('0x4')]();var auth=require(_0x644b('0x5'));var interaction=require(_0x644b('0x6'));var config=require('../../config/environment');var controller=require(_0x644b('0x7'));router['get']('/',auth[_0x644b('0x8')](),controller[_0x644b('0x9')]);router[_0x644b('0xa')]('/:id',auth[_0x644b('0x8')](),controller[_0x644b('0xb')]);router[_0x644b('0xc')]('/',auth['isAuthenticated'](),controller['create']);router[_0x644b('0xd')](_0x644b('0xe'),auth[_0x644b('0x8')](),controller['update']);router[_0x644b('0xf')](_0x644b('0xe'),auth['isAuthenticated'](),controller[_0x644b('0x10')]);module[_0x644b('0x11')]=router; \ No newline at end of file +var _0x01f7=['put','isAuthenticated','update','delete','multer','path','connect-timeout','express','Router','../../config/environment','./cannedAnswer.controller','get','index','/:id','show','post'];(function(_0x5892ff,_0x3d75ea){var _0x54b137=function(_0x51187b){while(--_0x51187b){_0x5892ff['push'](_0x5892ff['shift']());}};_0x54b137(++_0x3d75ea);}(_0x01f7,0x194));var _0x701f=function(_0x5484cf,_0x153f52){_0x5484cf=_0x5484cf-0x0;var _0x5b7de7=_0x01f7[_0x5484cf];return _0x5b7de7;};'use strict';var multer=require(_0x701f('0x0'));var util=require('util');var path=require(_0x701f('0x1'));var timeout=require(_0x701f('0x2'));var express=require(_0x701f('0x3'));var router=express[_0x701f('0x4')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x701f('0x5'));var controller=require(_0x701f('0x6'));router[_0x701f('0x7')]('/',auth['isAuthenticated'](),controller[_0x701f('0x8')]);router[_0x701f('0x7')](_0x701f('0x9'),auth['isAuthenticated'](),controller[_0x701f('0xa')]);router[_0x701f('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0x701f('0xc')]('/:id',auth[_0x701f('0xd')](),controller[_0x701f('0xe')]);router[_0x701f('0xf')]('/:id',auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js index 023a27e..43efd67 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 _0x0f1f=['sequelize','DATE','STRING','INTEGER'];(function(_0x52c8db,_0x3b313a){var _0x4bd7d2=function(_0x4215e1){while(--_0x4215e1){_0x52c8db['push'](_0x52c8db['shift']());}};_0x4bd7d2(++_0x3b313a);}(_0x0f1f,0x12c));var _0xf0f1=function(_0x220fd6,_0x1b5525){_0x220fd6=_0x220fd6-0x0;var _0x176722=_0x0f1f[_0x220fd6];return _0x176722;};'use strict';var Sequelize=require(_0xf0f1('0x0'));module['exports']={'calldate':{'type':Sequelize[_0xf0f1('0x1')],'allowNull':![],'defaultValue':'1970-01-01\x2000:00:01'},'clid':{'type':Sequelize[_0xf0f1('0x2')]},'src':{'type':Sequelize[_0xf0f1('0x2')]},'dst':{'type':Sequelize['STRING']},'dcontext':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xf0f1('0x2')]},'dstchannel':{'type':Sequelize[_0xf0f1('0x2')]},'lastapp':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize[_0xf0f1('0x2')]},'duration':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0xf0f1('0x3')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0xf0f1('0x3')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0xf0f1('0x2')]},'userfield':{'type':Sequelize[_0xf0f1('0x2')]},'uniqueid':{'type':Sequelize[_0xf0f1('0x2')]},'linkedid':{'type':Sequelize[_0xf0f1('0x2')]},'sequence':{'type':Sequelize['STRING']},'peeraccount':{'type':Sequelize[_0xf0f1('0x2')]},'type':{'type':Sequelize[_0xf0f1('0x2')]},'tag':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xde5b=['STRING','INTEGER','1970-01-01\x2000:00:01'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xde5b,0x11f));var _0xbde5=function(_0x2e93a9,_0x1cf12b){_0x2e93a9=_0x2e93a9-0x0;var _0x57375d=_0xde5b[_0x2e93a9];return _0x57375d;};'use strict';var Sequelize=require('sequelize');module['exports']={'calldate':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':_0xbde5('0x0')},'clid':{'type':Sequelize[_0xbde5('0x1')]},'src':{'type':Sequelize[_0xbde5('0x1')]},'dst':{'type':Sequelize[_0xbde5('0x1')]},'dcontext':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xbde5('0x1')]},'dstchannel':{'type':Sequelize[_0xbde5('0x1')]},'lastapp':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize[_0xbde5('0x1')]},'duration':{'type':Sequelize[_0xbde5('0x2')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0xbde5('0x2')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xbde5('0x1')]},'amaflags':{'type':Sequelize[_0xbde5('0x2')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize[_0xbde5('0x1')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0xbde5('0x1')]},'sequence':{'type':Sequelize[_0xbde5('0x1')]},'peeraccount':{'type':Sequelize[_0xbde5('0x1')]},'type':{'type':Sequelize[_0xbde5('0x1')]},'tag':{'type':Sequelize[_0xbde5('0x1')]}}; \ No newline at end of file diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js index dd8e4d5..1863271 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 _0xfbc2=['name','send','index','Cdr','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','pick','filter','where','map','type','key','VIRTUAL','options','includeAll','rows','show','params','include','merge','find','catch','create','body','describe','html-pdf','rimraf','zip-dir','request-promise','moment','bluebird','sox','to-csv','ejs','lodash','squel','crypto','jsforce','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/environment','sendStatus','status','end','count','offset','set','Content-Range','json','update','then','destroy','error'];(function(_0x30fd21,_0x243160){var _0x9b474a=function(_0x20f2b2){while(--_0x20f2b2){_0x30fd21['push'](_0x30fd21['shift']());}};_0x9b474a(++_0x243160);}(_0xfbc2,0xee));var _0x2fbc=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xfbc2[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require(_0x2fbc('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x2fbc('0x1'));var zipdir=require(_0x2fbc('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2fbc('0x3'));var moment=require(_0x2fbc('0x4'));var BPromise=require(_0x2fbc('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x2fbc('0x6'));var csv=require(_0x2fbc('0x7'));var ejs=require(_0x2fbc('0x8'));var fs=require('fs');var _=require(_0x2fbc('0x9'));var squel=require(_0x2fbc('0xa'));var crypto=require(_0x2fbc('0xb'));var jsforce=require(_0x2fbc('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x2fbc('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x2fbc('0xd'));var authService=require(_0x2fbc('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2fbc('0xf'));var logger=require('../../config/logger')(_0x2fbc('0x10'));var utils=require('../../config/utils');var config=require(_0x2fbc('0x11'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x41e42a,_0x5cad47){_0x5cad47=_0x5cad47||0xcc;return function(_0x28c85d){if(_0x28c85d){return _0x41e42a[_0x2fbc('0x12')](_0x5cad47);}return _0x41e42a[_0x2fbc('0x13')](_0x5cad47)[_0x2fbc('0x14')]();};}function respondWithResult(_0x56f9fb,_0x29db66){_0x29db66=_0x29db66||0xc8;return function(_0x9bf37a){if(_0x9bf37a){return _0x56f9fb[_0x2fbc('0x13')](_0x29db66)['json'](_0x9bf37a);}};}function respondWithFilteredResult(_0x1bbb3b,_0x2b84ec){return function(_0x55ed49){if(_0x55ed49){var _0x369b33=_0x55ed49[_0x2fbc('0x15')],_0x360ce7=_0x2b84ec['offset'],_0x5638be=_0x2b84ec[_0x2fbc('0x16')]+_0x2b84ec['limit'],_0x47db45;if(_0x5638be>=_0x369b33){_0x5638be=_0x369b33;_0x47db45=0xc8;}else{_0x47db45=0xce;}_0x1bbb3b['status'](_0x47db45);return _0x1bbb3b[_0x2fbc('0x17')](_0x2fbc('0x18'),_0x360ce7+'-'+_0x5638be+'/'+_0x369b33)[_0x2fbc('0x19')](_0x55ed49);}return null;};}function patchUpdates(_0x3b85ba){return function(_0x18d115){try{jsonpatch['apply'](_0x18d115,_0x3b85ba,!![]);}catch(_0x1f48d4){return BPromise['reject'](_0x1f48d4);}return _0x18d115['save']();};}function saveUpdates(_0x1dbe62,_0xcbd7db){return function(_0xe5fff1){if(_0xe5fff1){return _0xe5fff1[_0x2fbc('0x1a')](_0x1dbe62)[_0x2fbc('0x1b')](function(_0x5848e1){return _0x5848e1;});}return null;};}function removeEntity(_0x5cceff,_0xdc2156){return function(_0x4d63d1){if(_0x4d63d1){return _0x4d63d1[_0x2fbc('0x1c')]()[_0x2fbc('0x1b')](function(){_0x5cceff[_0x2fbc('0x13')](0xcc)['end']();});}};}function handleEntityNotFound(_0x58d0ce,_0x87c829){return function(_0xdcb9c2){if(!_0xdcb9c2){_0x58d0ce[_0x2fbc('0x12')](0x194);}return _0xdcb9c2;};}function handleError(_0x2f3ba9,_0x4a1e18){_0x4a1e18=_0x4a1e18||0x1f4;return function(_0x15e615){logger[_0x2fbc('0x1d')](_0x15e615['stack']);if(_0x15e615[_0x2fbc('0x1e')]){delete _0x15e615[_0x2fbc('0x1e')];}_0x2f3ba9['status'](_0x4a1e18)[_0x2fbc('0x1f')](_0x15e615);};}exports[_0x2fbc('0x20')]=function(_0xefbaf9,_0x1d37d3){var _0x6ae230={},_0x45ab53={},_0x37d67f={'count':0x0,'rows':[]};var _0x334369=db[_0x2fbc('0x21')][_0x2fbc('0x22')];_0x45ab53[_0x2fbc('0x23')]=_[_0x2fbc('0x24')](_0x334369);_0x45ab53[_0x2fbc('0x25')]=_[_0x2fbc('0x24')](_0xefbaf9[_0x2fbc('0x25')]);_0x45ab53[_0x2fbc('0x26')]=_[_0x2fbc('0x27')](_0x45ab53['model'],_0x45ab53[_0x2fbc('0x25')]);_0x6ae230[_0x2fbc('0x28')]=_[_0x2fbc('0x27')](_0x45ab53[_0x2fbc('0x23')],qs[_0x2fbc('0x29')](_0xefbaf9['query'][_0x2fbc('0x29')]));_0x6ae230[_0x2fbc('0x28')]=_0x6ae230[_0x2fbc('0x28')][_0x2fbc('0x2a')]?_0x6ae230[_0x2fbc('0x28')]:_0x45ab53['model'];if(!_0xefbaf9[_0x2fbc('0x25')][_0x2fbc('0x2b')](_0x2fbc('0x2c'))){_0x6ae230[_0x2fbc('0x2d')]=qs['limit'](_0xefbaf9[_0x2fbc('0x25')][_0x2fbc('0x2d')]);_0x6ae230[_0x2fbc('0x16')]=qs[_0x2fbc('0x16')](_0xefbaf9['query'][_0x2fbc('0x16')]);}_0x6ae230[_0x2fbc('0x2e')]=qs[_0x2fbc('0x2f')](_0xefbaf9[_0x2fbc('0x25')]['sort']);_0x6ae230['where']=qs['filters'](_[_0x2fbc('0x30')](_0xefbaf9['query'],_0x45ab53[_0x2fbc('0x26')]));if(_0xefbaf9[_0x2fbc('0x25')][_0x2fbc('0x31')]){_0x6ae230[_0x2fbc('0x32')]=_['merge'](_0x6ae230['where'],{'$or':_[_0x2fbc('0x33')](_0x334369,function(_0x163689){if(_0x163689[_0x2fbc('0x34')][_0x2fbc('0x35')]!==_0x2fbc('0x36')){var _0x1dd050={};_0x1dd050[_0x163689['field']]={'$like':'%'+_0xefbaf9[_0x2fbc('0x25')][_0x2fbc('0x31')]+'%'};return _0x1dd050;}})});}_0x6ae230=_['merge']({},_0x6ae230,_0xefbaf9[_0x2fbc('0x37')]);var _0x4fe52c={'where':_0x6ae230['where']};return db[_0x2fbc('0x21')][_0x2fbc('0x15')](_0x4fe52c)[_0x2fbc('0x1b')](function(_0x94f2fe){_0x37d67f[_0x2fbc('0x15')]=_0x94f2fe;if(_0xefbaf9[_0x2fbc('0x25')][_0x2fbc('0x38')]){_0x6ae230['include']=[{'all':!![]}];}return db[_0x2fbc('0x21')]['findAll'](_0x6ae230);})[_0x2fbc('0x1b')](function(_0x5de350){_0x37d67f[_0x2fbc('0x39')]=_0x5de350;return _0x37d67f;})[_0x2fbc('0x1b')](respondWithFilteredResult(_0x1d37d3,_0x6ae230))['catch'](handleError(_0x1d37d3,null));};exports[_0x2fbc('0x3a')]=function(_0x522d70,_0x5a9464){var _0xb003e5={'raw':!![],'where':{'id':_0x522d70[_0x2fbc('0x3b')]['id']}},_0x4b1aed={};_0x4b1aed[_0x2fbc('0x23')]=_[_0x2fbc('0x24')](db[_0x2fbc('0x21')][_0x2fbc('0x22')]);_0x4b1aed[_0x2fbc('0x25')]=_[_0x2fbc('0x24')](_0x522d70[_0x2fbc('0x25')]);_0x4b1aed[_0x2fbc('0x26')]=_[_0x2fbc('0x27')](_0x4b1aed['model'],_0x4b1aed[_0x2fbc('0x25')]);_0xb003e5[_0x2fbc('0x28')]=_[_0x2fbc('0x27')](_0x4b1aed[_0x2fbc('0x23')],qs[_0x2fbc('0x29')](_0x522d70['query'][_0x2fbc('0x29')]));_0xb003e5['attributes']=_0xb003e5[_0x2fbc('0x28')][_0x2fbc('0x2a')]?_0xb003e5[_0x2fbc('0x28')]:_0x4b1aed[_0x2fbc('0x23')];if(_0x522d70['query'][_0x2fbc('0x38')]){_0xb003e5[_0x2fbc('0x3c')]=[{'all':!![]}];}_0xb003e5=_[_0x2fbc('0x3d')]({},_0xb003e5,_0x522d70[_0x2fbc('0x37')]);return db[_0x2fbc('0x21')][_0x2fbc('0x3e')](_0xb003e5)[_0x2fbc('0x1b')](handleEntityNotFound(_0x5a9464,null))[_0x2fbc('0x1b')](respondWithResult(_0x5a9464,null))[_0x2fbc('0x3f')](handleError(_0x5a9464,null));};exports[_0x2fbc('0x40')]=function(_0x3a7be8,_0x5db50f){return db[_0x2fbc('0x21')][_0x2fbc('0x40')](_0x3a7be8[_0x2fbc('0x41')],{})[_0x2fbc('0x1b')](respondWithResult(_0x5db50f,0xc9))[_0x2fbc('0x3f')](handleError(_0x5db50f,null));};exports['update']=function(_0x2bcdba,_0xbaa65d){if(_0x2bcdba[_0x2fbc('0x41')]['id']){delete _0x2bcdba[_0x2fbc('0x41')]['id'];}return db['Cdr']['find']({'where':{'id':_0x2bcdba[_0x2fbc('0x3b')]['id']}})['then'](handleEntityNotFound(_0xbaa65d,null))[_0x2fbc('0x1b')](saveUpdates(_0x2bcdba[_0x2fbc('0x41')],null))[_0x2fbc('0x1b')](respondWithResult(_0xbaa65d,null))['catch'](handleError(_0xbaa65d,null));};exports['destroy']=function(_0x5dd54b,_0x2ecd39){return db[_0x2fbc('0x21')][_0x2fbc('0x3e')]({'where':{'id':_0x5dd54b['params']['id']}})[_0x2fbc('0x1b')](handleEntityNotFound(_0x2ecd39,null))[_0x2fbc('0x1b')](removeEntity(_0x2ecd39,null))[_0x2fbc('0x3f')](handleError(_0x2ecd39,null));};exports[_0x2fbc('0x42')]=function(_0x2cbe13,_0x39f402){return db[_0x2fbc('0x21')][_0x2fbc('0x42')]()[_0x2fbc('0x1b')](respondWithResult(_0x39f402,null))[_0x2fbc('0x3f')](handleError(_0x39f402,null));}; \ No newline at end of file +var _0xec36=['offset','Content-Range','reject','save','then','destroy','error','name','model','keys','filters','intersection','fields','query','attributes','length','hasOwnProperty','nolimit','limit','order','sort','pick','filter','where','map','VIRTUAL','merge','Cdr','include','findAll','catch','show','params','rawAttributes','includeAll','options','find','create','body','update','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count'];(function(_0x34a223,_0x4704d2){var _0x19cbf0=function(_0x8a82b1){while(--_0x8a82b1){_0x34a223['push'](_0x34a223['shift']());}};_0x19cbf0(++_0x4704d2);}(_0xec36,0xb7));var _0x6ec3=function(_0x54a761,_0x431fd4){_0x54a761=_0x54a761-0x0;var _0x37d1da=_0xec36[_0x54a761];return _0x37d1da;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x6ec3('0x0'));var rimraf=require(_0x6ec3('0x1'));var zipdir=require(_0x6ec3('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6ec3('0x3'));var moment=require(_0x6ec3('0x4'));var BPromise=require(_0x6ec3('0x5'));var Mustache=require(_0x6ec3('0x6'));var util=require('util');var path=require(_0x6ec3('0x7'));var sox=require(_0x6ec3('0x8'));var csv=require('to-csv');var ejs=require(_0x6ec3('0x9'));var fs=require('fs');var _=require(_0x6ec3('0xa'));var squel=require(_0x6ec3('0xb'));var crypto=require(_0x6ec3('0xc'));var jsforce=require(_0x6ec3('0xd'));var deskjs=require(_0x6ec3('0xe'));var toCsv=require(_0x6ec3('0xf'));var querystring=require(_0x6ec3('0x10'));var Papa=require('papaparse');var Redis=require(_0x6ec3('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x6ec3('0x12'));var hardwareService=require(_0x6ec3('0x13'));var logger=require(_0x6ec3('0x14'))(_0x6ec3('0x15'));var utils=require(_0x6ec3('0x16'));var config=require(_0x6ec3('0x17'));var db=require(_0x6ec3('0x18'))['db'];function respondWithStatusCode(_0x1e8382,_0x23e15d){_0x23e15d=_0x23e15d||0xcc;return function(_0x2388c1){if(_0x2388c1){return _0x1e8382[_0x6ec3('0x19')](_0x23e15d);}return _0x1e8382[_0x6ec3('0x1a')](_0x23e15d)[_0x6ec3('0x1b')]();};}function respondWithResult(_0xa630f8,_0x488a85){_0x488a85=_0x488a85||0xc8;return function(_0x12b15e){if(_0x12b15e){return _0xa630f8[_0x6ec3('0x1a')](_0x488a85)[_0x6ec3('0x1c')](_0x12b15e);}};}function respondWithFilteredResult(_0x51fa45,_0x1e9c21){return function(_0x19cfe3){if(_0x19cfe3){var _0x5251e2=_0x19cfe3[_0x6ec3('0x1d')],_0x41ee3d=_0x1e9c21[_0x6ec3('0x1e')],_0x29929e=_0x1e9c21[_0x6ec3('0x1e')]+_0x1e9c21['limit'],_0x5b78b9;if(_0x29929e>=_0x5251e2){_0x29929e=_0x5251e2;_0x5b78b9=0xc8;}else{_0x5b78b9=0xce;}_0x51fa45[_0x6ec3('0x1a')](_0x5b78b9);return _0x51fa45['set'](_0x6ec3('0x1f'),_0x41ee3d+'-'+_0x29929e+'/'+_0x5251e2)[_0x6ec3('0x1c')](_0x19cfe3);}return null;};}function patchUpdates(_0x59e58b){return function(_0x255d11){try{jsonpatch['apply'](_0x255d11,_0x59e58b,!![]);}catch(_0x40bb06){return BPromise[_0x6ec3('0x20')](_0x40bb06);}return _0x255d11[_0x6ec3('0x21')]();};}function saveUpdates(_0x75d4ea,_0x4d7888){return function(_0x58aaf5){if(_0x58aaf5){return _0x58aaf5['update'](_0x75d4ea)[_0x6ec3('0x22')](function(_0x513748){return _0x513748;});}return null;};}function removeEntity(_0x133d01,_0x4139d7){return function(_0x7ed6f6){if(_0x7ed6f6){return _0x7ed6f6[_0x6ec3('0x23')]()[_0x6ec3('0x22')](function(){_0x133d01[_0x6ec3('0x1a')](0xcc)[_0x6ec3('0x1b')]();});}};}function handleEntityNotFound(_0x5d345a,_0x22c5ed){return function(_0x3ad6f5){if(!_0x3ad6f5){_0x5d345a['sendStatus'](0x194);}return _0x3ad6f5;};}function handleError(_0xdf0ab9,_0x315519){_0x315519=_0x315519||0x1f4;return function(_0xe2ea36){logger[_0x6ec3('0x24')](_0xe2ea36['stack']);if(_0xe2ea36['name']){delete _0xe2ea36[_0x6ec3('0x25')];}_0xdf0ab9['status'](_0x315519)['send'](_0xe2ea36);};}exports['index']=function(_0x44959a,_0x58af6a){var _0x5f0cd3={},_0x553839={},_0x43d621={'count':0x0,'rows':[]};var _0x5e29b2=db['Cdr']['rawAttributes'];_0x553839[_0x6ec3('0x26')]=_[_0x6ec3('0x27')](_0x5e29b2);_0x553839['query']=_[_0x6ec3('0x27')](_0x44959a['query']);_0x553839[_0x6ec3('0x28')]=_[_0x6ec3('0x29')](_0x553839['model'],_0x553839['query']);_0x5f0cd3['attributes']=_['intersection'](_0x553839['model'],qs[_0x6ec3('0x2a')](_0x44959a[_0x6ec3('0x2b')]['fields']));_0x5f0cd3[_0x6ec3('0x2c')]=_0x5f0cd3['attributes'][_0x6ec3('0x2d')]?_0x5f0cd3[_0x6ec3('0x2c')]:_0x553839[_0x6ec3('0x26')];if(!_0x44959a[_0x6ec3('0x2b')][_0x6ec3('0x2e')](_0x6ec3('0x2f'))){_0x5f0cd3[_0x6ec3('0x30')]=qs[_0x6ec3('0x30')](_0x44959a[_0x6ec3('0x2b')][_0x6ec3('0x30')]);_0x5f0cd3[_0x6ec3('0x1e')]=qs['offset'](_0x44959a['query'][_0x6ec3('0x1e')]);}_0x5f0cd3[_0x6ec3('0x31')]=qs[_0x6ec3('0x32')](_0x44959a[_0x6ec3('0x2b')][_0x6ec3('0x32')]);_0x5f0cd3['where']=qs['filters'](_[_0x6ec3('0x33')](_0x44959a['query'],_0x553839[_0x6ec3('0x28')]));if(_0x44959a[_0x6ec3('0x2b')][_0x6ec3('0x34')]){_0x5f0cd3['where']=_['merge'](_0x5f0cd3[_0x6ec3('0x35')],{'$or':_[_0x6ec3('0x36')](_0x5e29b2,function(_0x5bbc19){if(_0x5bbc19['type']['key']!==_0x6ec3('0x37')){var _0x4120e4={};_0x4120e4[_0x5bbc19['field']]={'$like':'%'+_0x44959a['query']['filter']+'%'};return _0x4120e4;}})});}_0x5f0cd3=_[_0x6ec3('0x38')]({},_0x5f0cd3,_0x44959a['options']);var _0x3f5af3={'where':_0x5f0cd3[_0x6ec3('0x35')]};return db[_0x6ec3('0x39')][_0x6ec3('0x1d')](_0x3f5af3)['then'](function(_0x9db3de){_0x43d621[_0x6ec3('0x1d')]=_0x9db3de;if(_0x44959a[_0x6ec3('0x2b')]['includeAll']){_0x5f0cd3[_0x6ec3('0x3a')]=[{'all':!![]}];}return db[_0x6ec3('0x39')][_0x6ec3('0x3b')](_0x5f0cd3);})[_0x6ec3('0x22')](function(_0xfe16c1){_0x43d621['rows']=_0xfe16c1;return _0x43d621;})[_0x6ec3('0x22')](respondWithFilteredResult(_0x58af6a,_0x5f0cd3))[_0x6ec3('0x3c')](handleError(_0x58af6a,null));};exports[_0x6ec3('0x3d')]=function(_0x5eec3c,_0x3e51be){var _0x2ffa38={'raw':!![],'where':{'id':_0x5eec3c[_0x6ec3('0x3e')]['id']}},_0xe98b10={};_0xe98b10[_0x6ec3('0x26')]=_['keys'](db[_0x6ec3('0x39')][_0x6ec3('0x3f')]);_0xe98b10['query']=_[_0x6ec3('0x27')](_0x5eec3c[_0x6ec3('0x2b')]);_0xe98b10[_0x6ec3('0x28')]=_['intersection'](_0xe98b10['model'],_0xe98b10['query']);_0x2ffa38[_0x6ec3('0x2c')]=_[_0x6ec3('0x29')](_0xe98b10['model'],qs[_0x6ec3('0x2a')](_0x5eec3c['query']['fields']));_0x2ffa38['attributes']=_0x2ffa38[_0x6ec3('0x2c')][_0x6ec3('0x2d')]?_0x2ffa38[_0x6ec3('0x2c')]:_0xe98b10[_0x6ec3('0x26')];if(_0x5eec3c[_0x6ec3('0x2b')][_0x6ec3('0x40')]){_0x2ffa38[_0x6ec3('0x3a')]=[{'all':!![]}];}_0x2ffa38=_[_0x6ec3('0x38')]({},_0x2ffa38,_0x5eec3c[_0x6ec3('0x41')]);return db['Cdr'][_0x6ec3('0x42')](_0x2ffa38)[_0x6ec3('0x22')](handleEntityNotFound(_0x3e51be,null))[_0x6ec3('0x22')](respondWithResult(_0x3e51be,null))[_0x6ec3('0x3c')](handleError(_0x3e51be,null));};exports[_0x6ec3('0x43')]=function(_0x366b7d,_0x5856f8){return db[_0x6ec3('0x39')][_0x6ec3('0x43')](_0x366b7d[_0x6ec3('0x44')],{})[_0x6ec3('0x22')](respondWithResult(_0x5856f8,0xc9))[_0x6ec3('0x3c')](handleError(_0x5856f8,null));};exports[_0x6ec3('0x45')]=function(_0x188f33,_0x276814){if(_0x188f33['body']['id']){delete _0x188f33['body']['id'];}return db[_0x6ec3('0x39')]['find']({'where':{'id':_0x188f33[_0x6ec3('0x3e')]['id']}})[_0x6ec3('0x22')](handleEntityNotFound(_0x276814,null))[_0x6ec3('0x22')](saveUpdates(_0x188f33[_0x6ec3('0x44')],null))[_0x6ec3('0x22')](respondWithResult(_0x276814,null))[_0x6ec3('0x3c')](handleError(_0x276814,null));};exports[_0x6ec3('0x23')]=function(_0x3a8578,_0x184cbf){return db[_0x6ec3('0x39')][_0x6ec3('0x42')]({'where':{'id':_0x3a8578[_0x6ec3('0x3e')]['id']}})[_0x6ec3('0x22')](handleEntityNotFound(_0x184cbf,null))[_0x6ec3('0x22')](removeEntity(_0x184cbf,null))[_0x6ec3('0x3c')](handleError(_0x184cbf,null));};exports[_0x6ec3('0x46')]=function(_0x5e66d1,_0x2d693e){return db[_0x6ec3('0x39')][_0x6ec3('0x46')]()[_0x6ec3('0x22')](respondWithResult(_0x2d693e,null))['catch'](handleError(_0x2d693e,null));}; \ No newline at end of file diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js index d87cbe9..189cedd 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 _0xfcf0=['accountcode','calldate','disposition','dst','src','uniqueid','lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','./cdr.attributes','exports','define','Cdr'];(function(_0x188dfd,_0x480957){var _0x588d95=function(_0x10984f){while(--_0x10984f){_0x188dfd['push'](_0x188dfd['shift']());}};_0x588d95(++_0x480957);}(_0xfcf0,0x138));var _0x0fcf=function(_0x52666e,_0x5b3776){_0x52666e=_0x52666e-0x0;var _0x515330=_0xfcf0[_0x52666e];return _0x515330;};'use strict';var _=require(_0x0fcf('0x0'));var util=require(_0x0fcf('0x1'));var logger=require('../../config/logger')(_0x0fcf('0x2'));var moment=require(_0x0fcf('0x3'));var BPromise=require(_0x0fcf('0x4'));var rp=require(_0x0fcf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0fcf('0x6'));var config=require(_0x0fcf('0x7'));var attributes=require(_0x0fcf('0x8'));module[_0x0fcf('0x9')]=function(_0x1bace8,_0x1a7b03){return _0x1bace8[_0x0fcf('0xa')](_0x0fcf('0xb'),attributes,{'tableName':'cdr','paranoid':![],'indexes':[{'name':_0x0fcf('0xc'),'fields':[_0x0fcf('0xc')]},{'name':_0x0fcf('0xd'),'fields':['calldate']},{'name':_0x0fcf('0xe'),'fields':[_0x0fcf('0xe')]},{'name':_0x0fcf('0xf'),'fields':['dst']},{'name':_0x0fcf('0x10'),'fields':['src']},{'name':_0x0fcf('0x11'),'fields':[_0x0fcf('0x11')]}],'timestamps':![]});}; \ No newline at end of file +var _0xe3da=['accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cdr.attributes','exports','define','Cdr'];(function(_0x568d0c,_0x29328a){var _0x3f036f=function(_0x13fad7){while(--_0x13fad7){_0x568d0c['push'](_0x568d0c['shift']());}};_0x3f036f(++_0x29328a);}(_0xe3da,0x1cd));var _0xae3d=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xe3da[_0x2641f9];return _0x585741;};'use strict';var _=require(_0xae3d('0x0'));var util=require(_0xae3d('0x1'));var logger=require(_0xae3d('0x2'))(_0xae3d('0x3'));var moment=require(_0xae3d('0x4'));var BPromise=require(_0xae3d('0x5'));var rp=require(_0xae3d('0x6'));var fs=require('fs');var path=require(_0xae3d('0x7'));var rimraf=require(_0xae3d('0x8'));var config=require(_0xae3d('0x9'));var attributes=require(_0xae3d('0xa'));module[_0xae3d('0xb')]=function(_0xa9a1a,_0xa54808){return _0xa9a1a[_0xae3d('0xc')](_0xae3d('0xd'),attributes,{'tableName':'cdr','paranoid':![],'indexes':[{'name':_0xae3d('0xe'),'fields':[_0xae3d('0xe')]},{'name':'calldate','fields':['calldate']},{'name':_0xae3d('0xf'),'fields':[_0xae3d('0xf')]},{'name':_0xae3d('0x10'),'fields':[_0xae3d('0x10')]},{'name':_0xae3d('0x11'),'fields':[_0xae3d('0x11')]},{'name':'uniqueid','fields':[_0xae3d('0x12')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js index 8893085..1e4a004 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 _0xc1c8=['message','result','catch','lodash','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','info','Cdr,\x20%s,\x20%s','request\x20sent','error','code'];(function(_0x3f5f76,_0x15d83a){var _0x5d2c79=function(_0xb3b373){while(--_0xb3b373){_0x3f5f76['push'](_0x3f5f76['shift']());}};_0x5d2c79(++_0x15d83a);}(_0xc1c8,0x179));var _0x8c1c=function(_0x4313cc,_0x3becb9){_0x4313cc=_0x4313cc-0x0;var _0x3f1707=_0xc1c8[_0x4313cc];return _0x3f1707;};'use strict';var _=require(_0x8c1c('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x8c1c('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8c1c('0x2'))['db'];var utils=require(_0x8c1c('0x3'));var logger=require('../../config/logger')(_0x8c1c('0x4'));var config=require(_0x8c1c('0x5'));var jayson=require(_0x8c1c('0x6'));var client=jayson['client'][_0x8c1c('0x7')]({'port':0x232a});function respondWithRpcPromise(_0xb2245,_0x405f76,_0x49c99d){return new BPromise(function(_0xdcce5,_0x68aab){return client[_0x8c1c('0x8')](_0xb2245,_0x49c99d)['then'](function(_0x2be31f){logger[_0x8c1c('0x9')](_0x8c1c('0xa'),_0x405f76,'request\x20sent');logger['debug']('Cdr,\x20%s,\x20%s,\x20%s',_0x405f76,_0x8c1c('0xb'),JSON['stringify'](_0x2be31f));if(_0x2be31f[_0x8c1c('0xc')]){if(_0x2be31f['error'][_0x8c1c('0xd')]===0x1f4){logger[_0x8c1c('0xc')](_0x8c1c('0xa'),_0x405f76,_0x2be31f[_0x8c1c('0xc')][_0x8c1c('0xe')]);return _0x68aab(_0x2be31f[_0x8c1c('0xc')]['message']);}logger[_0x8c1c('0xc')](_0x8c1c('0xa'),_0x405f76,_0x2be31f['error'][_0x8c1c('0xe')]);return _0xdcce5(_0x2be31f['error'][_0x8c1c('0xe')]);}else{logger[_0x8c1c('0x9')]('Cdr,\x20%s,\x20%s',_0x405f76,'request\x20sent');_0xdcce5(_0x2be31f[_0x8c1c('0xf')][_0x8c1c('0xe')]);}})[_0x8c1c('0x10')](function(_0x5c9191){logger[_0x8c1c('0xc')](_0x8c1c('0xa'),_0x405f76,_0x5c9191);_0x68aab(_0x5c9191);});});} \ No newline at end of file +var _0xde2b=['request\x20sent','debug','stringify','error','message','result','catch','util','moment','ioredis','rpc','../../config/environment','jayson/promise','client','http','then','Cdr,\x20%s,\x20%s'];(function(_0xd5275f,_0x1b6eb7){var _0x19cabf=function(_0x10e154){while(--_0x10e154){_0xd5275f['push'](_0xd5275f['shift']());}};_0x19cabf(++_0x1b6eb7);}(_0xde2b,0x6d));var _0xbde2=function(_0x43e5d0,_0x45e9bf){_0x43e5d0=_0x43e5d0-0x0;var _0x284330=_0xde2b[_0x43e5d0];return _0x284330;};'use strict';var _=require('lodash');var util=require(_0xbde2('0x0'));var moment=require(_0xbde2('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbde2('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xbde2('0x3'));var config=require(_0xbde2('0x4'));var jayson=require(_0xbde2('0x5'));var client=jayson[_0xbde2('0x6')][_0xbde2('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x4041c1,_0x327d95,_0x3a974c){return new BPromise(function(_0x406934,_0x326349){return client['request'](_0x4041c1,_0x3a974c)[_0xbde2('0x8')](function(_0x135d3c){logger['info'](_0xbde2('0x9'),_0x327d95,_0xbde2('0xa'));logger[_0xbde2('0xb')]('Cdr,\x20%s,\x20%s,\x20%s',_0x327d95,'request\x20sent',JSON[_0xbde2('0xc')](_0x135d3c));if(_0x135d3c[_0xbde2('0xd')]){if(_0x135d3c[_0xbde2('0xd')]['code']===0x1f4){logger[_0xbde2('0xd')](_0xbde2('0x9'),_0x327d95,_0x135d3c[_0xbde2('0xd')]['message']);return _0x326349(_0x135d3c[_0xbde2('0xd')][_0xbde2('0xe')]);}logger[_0xbde2('0xd')]('Cdr,\x20%s,\x20%s',_0x327d95,_0x135d3c['error']['message']);return _0x406934(_0x135d3c[_0xbde2('0xd')][_0xbde2('0xe')]);}else{logger['info']('Cdr,\x20%s,\x20%s',_0x327d95,_0xbde2('0xa'));_0x406934(_0x135d3c[_0xbde2('0xf')][_0xbde2('0xe')]);}})[_0xbde2('0x10')](function(_0x40e296){logger[_0xbde2('0xd')]('Cdr,\x20%s,\x20%s',_0x327d95,_0x40e296);_0x326349(_0x40e296);});});} \ No newline at end of file diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js index 79b849a..0f3957b 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 _0x528c=['put','update','delete','destroy','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/describe','/:id','show','post'];(function(_0x7bde64,_0x4f3fc5){var _0x14bb79=function(_0x4799e0){while(--_0x4799e0){_0x7bde64['push'](_0x7bde64['shift']());}};_0x14bb79(++_0x4f3fc5);}(_0x528c,0x9d));var _0xc528=function(_0x3de419,_0x16e055){_0x3de419=_0x3de419-0x0;var _0x55874b=_0x528c[_0x3de419];return _0x55874b;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xc528('0x0'));var timeout=require(_0xc528('0x1'));var express=require(_0xc528('0x2'));var router=express[_0xc528('0x3')]();var auth=require(_0xc528('0x4'));var interaction=require(_0xc528('0x5'));var config=require('../../config/environment');var controller=require('./cdr.controller');router[_0xc528('0x6')]('/',auth[_0xc528('0x7')](),controller[_0xc528('0x8')]);router['get'](_0xc528('0x9'),auth[_0xc528('0x7')](),controller['describe']);router[_0xc528('0x6')](_0xc528('0xa'),auth[_0xc528('0x7')](),controller[_0xc528('0xb')]);router[_0xc528('0xc')]('/',auth[_0xc528('0x7')](),controller['create']);router[_0xc528('0xd')](_0xc528('0xa'),auth[_0xc528('0x7')](),controller[_0xc528('0xe')]);router[_0xc528('0xf')](_0xc528('0xa'),auth[_0xc528('0x7')](),controller[_0xc528('0x10')]);module['exports']=router; \ No newline at end of file +var _0x21ee=['./cdr.controller','isAuthenticated','/describe','describe','get','/:id','show','create','put','update','destroy','exports','multer','connect-timeout','express','Router','../../components/interaction/service','../../config/environment'];(function(_0x20c989,_0x228a0a){var _0x3376ca=function(_0x583d71){while(--_0x583d71){_0x20c989['push'](_0x20c989['shift']());}};_0x3376ca(++_0x228a0a);}(_0x21ee,0x11a));var _0xe21e=function(_0x4c3d1e,_0x1e5212){_0x4c3d1e=_0x4c3d1e-0x0;var _0x29dcb1=_0x21ee[_0x4c3d1e];return _0x29dcb1;};'use strict';var multer=require(_0xe21e('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xe21e('0x1'));var express=require(_0xe21e('0x2'));var router=express[_0xe21e('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0xe21e('0x4'));var config=require(_0xe21e('0x5'));var controller=require(_0xe21e('0x6'));router['get']('/',auth[_0xe21e('0x7')](),controller['index']);router['get'](_0xe21e('0x8'),auth[_0xe21e('0x7')](),controller[_0xe21e('0x9')]);router[_0xe21e('0xa')](_0xe21e('0xb'),auth[_0xe21e('0x7')](),controller[_0xe21e('0xc')]);router['post']('/',auth[_0xe21e('0x7')](),controller[_0xe21e('0xd')]);router[_0xe21e('0xe')](_0xe21e('0xb'),auth['isAuthenticated'](),controller[_0xe21e('0xf')]);router['delete'](_0xe21e('0xb'),auth['isAuthenticated'](),controller[_0xe21e('0x10')]);module[_0xe21e('0x11')]=router; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js index f028422..955960c 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 _0xe135=['sequelize','exports','INTEGER','STRING','noop','TEXT','*,*,*,*'];(function(_0x3616bb,_0x86fe00){var _0x1c0994=function(_0x46a1d4){while(--_0x46a1d4){_0x3616bb['push'](_0x3616bb['shift']());}};_0x1c0994(++_0x86fe00);}(_0xe135,0x1e3));var _0x5e13=function(_0x207301,_0x235203){_0x207301=_0x207301-0x0;var _0x10be14=_0xe135[_0x207301];return _0x10be14;};'use strict';var Sequelize=require(_0x5e13('0x0'));module[_0x5e13('0x1')]={'priority':{'type':Sequelize[_0x5e13('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x5e13('0x3')],'allowNull':![],'defaultValue':_0x5e13('0x4')},'appdata':{'type':Sequelize[_0x5e13('0x5')]()},'description':{'type':Sequelize[_0x5e13('0x3')]},'interval':{'type':Sequelize[_0x5e13('0x3')],'defaultValue':_0x5e13('0x6')}}; \ No newline at end of file +var _0x52c6=['STRING','noop','TEXT','sequelize','exports','INTEGER'];(function(_0x210d7f,_0x2abe4f){var _0x42d687=function(_0x46b2ae){while(--_0x46b2ae){_0x210d7f['push'](_0x210d7f['shift']());}};_0x42d687(++_0x2abe4f);}(_0x52c6,0x12f));var _0x652c=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x52c6[_0xbca1b1];return _0x4e1686;};'use strict';var Sequelize=require(_0x652c('0x0'));module[_0x652c('0x1')]={'priority':{'type':Sequelize[_0x652c('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x652c('0x3')],'allowNull':![],'defaultValue':_0x652c('0x4')},'appdata':{'type':Sequelize[_0x652c('0x5')]()},'description':{'type':Sequelize[_0x652c('0x3')]},'interval':{'type':Sequelize[_0x652c('0x3')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js index 12d1ef3..bc497ab 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 _0x2937=['params','model','ChatApplication','query','filters','intersection','attributes','length','includeAll','merge','options','find','catch','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','json','count','limit','status','set','Content-Range','apply','reject','update','destroy','then','error','name','show'];(function(_0x49bb05,_0x2e5caf){var _0x28445c=function(_0x15471b){while(--_0x15471b){_0x49bb05['push'](_0x49bb05['shift']());}};_0x28445c(++_0x2e5caf);}(_0x2937,0x164));var _0x7293=function(_0x2c0efd,_0x52fbbf){_0x2c0efd=_0x2c0efd-0x0;var _0x2864f8=_0x2937[_0x2c0efd];return _0x2864f8;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x7293('0x0'));var rimraf=require(_0x7293('0x1'));var zipdir=require(_0x7293('0x2'));var jsonpatch=require(_0x7293('0x3'));var rp=require(_0x7293('0x4'));var moment=require(_0x7293('0x5'));var BPromise=require(_0x7293('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x7293('0x7'));var sox=require(_0x7293('0x8'));var csv=require(_0x7293('0x9'));var ejs=require(_0x7293('0xa'));var fs=require('fs');var _=require(_0x7293('0xb'));var squel=require(_0x7293('0xc'));var crypto=require(_0x7293('0xd'));var jsforce=require(_0x7293('0xe'));var deskjs=require(_0x7293('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7293('0x10'));var Papa=require(_0x7293('0x11'));var Redis=require('ioredis');var authService=require(_0x7293('0x12'));var qs=require(_0x7293('0x13'));var as=require(_0x7293('0x14'));var hardwareService=require(_0x7293('0x15'));var logger=require(_0x7293('0x16'))(_0x7293('0x17'));var utils=require(_0x7293('0x18'));var config=require(_0x7293('0x19'));var db=require(_0x7293('0x1a'))['db'];function respondWithStatusCode(_0x4b94ce,_0x55b6ac){_0x55b6ac=_0x55b6ac||0xcc;return function(_0x54fa53){if(_0x54fa53){return _0x4b94ce[_0x7293('0x1b')](_0x55b6ac);}return _0x4b94ce['status'](_0x55b6ac)[_0x7293('0x1c')]();};}function respondWithResult(_0xddd819,_0x5037f1){_0x5037f1=_0x5037f1||0xc8;return function(_0xce1b61){if(_0xce1b61){return _0xddd819['status'](_0x5037f1)[_0x7293('0x1d')](_0xce1b61);}};}function respondWithFilteredResult(_0x1a567d,_0x10a598){return function(_0x2c476f){if(_0x2c476f){var _0x5f1667=_0x2c476f[_0x7293('0x1e')],_0x331b95=_0x10a598['offset'],_0x9c9989=_0x10a598['offset']+_0x10a598[_0x7293('0x1f')],_0x4e9600;if(_0x9c9989>=_0x5f1667){_0x9c9989=_0x5f1667;_0x4e9600=0xc8;}else{_0x4e9600=0xce;}_0x1a567d[_0x7293('0x20')](_0x4e9600);return _0x1a567d[_0x7293('0x21')](_0x7293('0x22'),_0x331b95+'-'+_0x9c9989+'/'+_0x5f1667)['json'](_0x2c476f);}return null;};}function patchUpdates(_0x421a65){return function(_0x42ac60){try{jsonpatch[_0x7293('0x23')](_0x42ac60,_0x421a65,!![]);}catch(_0x3673d4){return BPromise[_0x7293('0x24')](_0x3673d4);}return _0x42ac60['save']();};}function saveUpdates(_0x1c634c,_0x3b23a7){return function(_0xe5d47d){if(_0xe5d47d){return _0xe5d47d[_0x7293('0x25')](_0x1c634c)['then'](function(_0x387268){return _0x387268;});}return null;};}function removeEntity(_0x4ce767,_0x5f3f12){return function(_0x2a1fb6){if(_0x2a1fb6){return _0x2a1fb6[_0x7293('0x26')]()[_0x7293('0x27')](function(){_0x4ce767[_0x7293('0x20')](0xcc)[_0x7293('0x1c')]();});}};}function handleEntityNotFound(_0x3f6d54,_0x3c48b1){return function(_0x2a6e17){if(!_0x2a6e17){_0x3f6d54[_0x7293('0x1b')](0x194);}return _0x2a6e17;};}function handleError(_0xe687ae,_0x2e7c9e){_0x2e7c9e=_0x2e7c9e||0x1f4;return function(_0x12c948){logger[_0x7293('0x28')](_0x12c948['stack']);if(_0x12c948[_0x7293('0x29')]){delete _0x12c948['name'];}_0xe687ae[_0x7293('0x20')](_0x2e7c9e)['send'](_0x12c948);};}exports[_0x7293('0x2a')]=function(_0x146185,_0x308e48){var _0x567a0f={'raw':!![],'where':{'id':_0x146185[_0x7293('0x2b')]['id']}},_0x27df0f={};_0x27df0f[_0x7293('0x2c')]=_['keys'](db[_0x7293('0x2d')]['rawAttributes']);_0x27df0f[_0x7293('0x2e')]=_['keys'](_0x146185[_0x7293('0x2e')]);_0x27df0f[_0x7293('0x2f')]=_[_0x7293('0x30')](_0x27df0f[_0x7293('0x2c')],_0x27df0f['query']);_0x567a0f[_0x7293('0x31')]=_[_0x7293('0x30')](_0x27df0f[_0x7293('0x2c')],qs['fields'](_0x146185[_0x7293('0x2e')]['fields']));_0x567a0f[_0x7293('0x31')]=_0x567a0f[_0x7293('0x31')][_0x7293('0x32')]?_0x567a0f[_0x7293('0x31')]:_0x27df0f[_0x7293('0x2c')];if(_0x146185[_0x7293('0x2e')][_0x7293('0x33')]){_0x567a0f['include']=[{'all':!![]}];}_0x567a0f=_[_0x7293('0x34')]({},_0x567a0f,_0x146185[_0x7293('0x35')]);return db[_0x7293('0x2d')][_0x7293('0x36')](_0x567a0f)[_0x7293('0x27')](handleEntityNotFound(_0x308e48,null))[_0x7293('0x27')](respondWithResult(_0x308e48,null))[_0x7293('0x37')](handleError(_0x308e48,null));};exports[_0x7293('0x25')]=function(_0x472faa,_0x1fcaea){if(_0x472faa['body']['id']){delete _0x472faa[_0x7293('0x38')]['id'];}return db[_0x7293('0x2d')]['find']({'where':{'id':_0x472faa[_0x7293('0x2b')]['id']}})[_0x7293('0x27')](handleEntityNotFound(_0x1fcaea,null))[_0x7293('0x27')](saveUpdates(_0x472faa[_0x7293('0x38')],null))['then'](respondWithResult(_0x1fcaea,null))[_0x7293('0x37')](handleError(_0x1fcaea,null));};exports[_0x7293('0x26')]=function(_0x508f8f,_0x13759e){return db[_0x7293('0x2d')][_0x7293('0x36')]({'where':{'id':_0x508f8f[_0x7293('0x2b')]['id']}})[_0x7293('0x27')](handleEntityNotFound(_0x13759e,null))[_0x7293('0x27')](removeEntity(_0x13759e,null))[_0x7293('0x37')](handleError(_0x13759e,null));}; \ No newline at end of file +var _0x188a=['length','include','merge','options','find','catch','body','html-pdf','eml-format','request-promise','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','params','model','keys','ChatApplication','rawAttributes','query','intersection','fields','attributes'];(function(_0x4c227d,_0x511b96){var _0x14df74=function(_0x3be591){while(--_0x3be591){_0x4c227d['push'](_0x4c227d['shift']());}};_0x14df74(++_0x511b96);}(_0x188a,0x19d));var _0xa188=function(_0x17405a,_0x33fce5){_0x17405a=_0x17405a-0x0;var _0x171395=_0x188a[_0x17405a];return _0x171395;};'use strict';var pdf=require(_0xa188('0x0'));var emlformat=require(_0xa188('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xa188('0x2'));var moment=require('moment');var BPromise=require(_0xa188('0x3'));var Mustache=require(_0xa188('0x4'));var util=require(_0xa188('0x5'));var path=require(_0xa188('0x6'));var sox=require(_0xa188('0x7'));var csv=require(_0xa188('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xa188('0x9'));var squel=require(_0xa188('0xa'));var crypto=require(_0xa188('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xa188('0xc'));var toCsv=require(_0xa188('0x8'));var querystring=require(_0xa188('0xd'));var Papa=require('papaparse');var Redis=require(_0xa188('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xa188('0xf'));var as=require(_0xa188('0x10'));var hardwareService=require(_0xa188('0x11'));var logger=require(_0xa188('0x12'))(_0xa188('0x13'));var utils=require(_0xa188('0x14'));var config=require(_0xa188('0x15'));var db=require(_0xa188('0x16'))['db'];function respondWithStatusCode(_0x5e3797,_0x551e85){_0x551e85=_0x551e85||0xcc;return function(_0x297388){if(_0x297388){return _0x5e3797[_0xa188('0x17')](_0x551e85);}return _0x5e3797[_0xa188('0x18')](_0x551e85)[_0xa188('0x19')]();};}function respondWithResult(_0x464564,_0x347dc2){_0x347dc2=_0x347dc2||0xc8;return function(_0x50e2b7){if(_0x50e2b7){return _0x464564['status'](_0x347dc2)[_0xa188('0x1a')](_0x50e2b7);}};}function respondWithFilteredResult(_0x59f711,_0x46c8e4){return function(_0x2efc96){if(_0x2efc96){var _0x2a8832=_0x2efc96[_0xa188('0x1b')],_0x2b9e2f=_0x46c8e4[_0xa188('0x1c')],_0x11c06b=_0x46c8e4[_0xa188('0x1c')]+_0x46c8e4[_0xa188('0x1d')],_0x5914c4;if(_0x11c06b>=_0x2a8832){_0x11c06b=_0x2a8832;_0x5914c4=0xc8;}else{_0x5914c4=0xce;}_0x59f711['status'](_0x5914c4);return _0x59f711[_0xa188('0x1e')](_0xa188('0x1f'),_0x2b9e2f+'-'+_0x11c06b+'/'+_0x2a8832)[_0xa188('0x1a')](_0x2efc96);}return null;};}function patchUpdates(_0x8a5c23){return function(_0x4da97b){try{jsonpatch[_0xa188('0x20')](_0x4da97b,_0x8a5c23,!![]);}catch(_0x3cf8b1){return BPromise[_0xa188('0x21')](_0x3cf8b1);}return _0x4da97b[_0xa188('0x22')]();};}function saveUpdates(_0x1b5c78,_0x2185a7){return function(_0x32b369){if(_0x32b369){return _0x32b369[_0xa188('0x23')](_0x1b5c78)[_0xa188('0x24')](function(_0x378bc1){return _0x378bc1;});}return null;};}function removeEntity(_0x3d9e76,_0x36abbf){return function(_0x497ee2){if(_0x497ee2){return _0x497ee2[_0xa188('0x25')]()['then'](function(){_0x3d9e76[_0xa188('0x18')](0xcc)[_0xa188('0x19')]();});}};}function handleEntityNotFound(_0x104ced,_0x4e7f79){return function(_0x32a211){if(!_0x32a211){_0x104ced['sendStatus'](0x194);}return _0x32a211;};}function handleError(_0x3074cb,_0x4b1189){_0x4b1189=_0x4b1189||0x1f4;return function(_0x2e25bd){logger[_0xa188('0x26')](_0x2e25bd[_0xa188('0x27')]);if(_0x2e25bd[_0xa188('0x28')]){delete _0x2e25bd[_0xa188('0x28')];}_0x3074cb[_0xa188('0x18')](_0x4b1189)[_0xa188('0x29')](_0x2e25bd);};}exports['show']=function(_0x2dd593,_0x5d9b6b){var _0x14b23e={'raw':!![],'where':{'id':_0x2dd593[_0xa188('0x2a')]['id']}},_0x33e1e1={};_0x33e1e1[_0xa188('0x2b')]=_[_0xa188('0x2c')](db[_0xa188('0x2d')][_0xa188('0x2e')]);_0x33e1e1['query']=_[_0xa188('0x2c')](_0x2dd593[_0xa188('0x2f')]);_0x33e1e1['filters']=_[_0xa188('0x30')](_0x33e1e1[_0xa188('0x2b')],_0x33e1e1[_0xa188('0x2f')]);_0x14b23e['attributes']=_[_0xa188('0x30')](_0x33e1e1[_0xa188('0x2b')],qs[_0xa188('0x31')](_0x2dd593[_0xa188('0x2f')]['fields']));_0x14b23e[_0xa188('0x32')]=_0x14b23e['attributes'][_0xa188('0x33')]?_0x14b23e[_0xa188('0x32')]:_0x33e1e1[_0xa188('0x2b')];if(_0x2dd593['query']['includeAll']){_0x14b23e[_0xa188('0x34')]=[{'all':!![]}];}_0x14b23e=_[_0xa188('0x35')]({},_0x14b23e,_0x2dd593[_0xa188('0x36')]);return db[_0xa188('0x2d')][_0xa188('0x37')](_0x14b23e)[_0xa188('0x24')](handleEntityNotFound(_0x5d9b6b,null))[_0xa188('0x24')](respondWithResult(_0x5d9b6b,null))[_0xa188('0x38')](handleError(_0x5d9b6b,null));};exports[_0xa188('0x23')]=function(_0x59a2c8,_0x3409f6){if(_0x59a2c8[_0xa188('0x39')]['id']){delete _0x59a2c8[_0xa188('0x39')]['id'];}return db[_0xa188('0x2d')]['find']({'where':{'id':_0x59a2c8[_0xa188('0x2a')]['id']}})[_0xa188('0x24')](handleEntityNotFound(_0x3409f6,null))[_0xa188('0x24')](saveUpdates(_0x59a2c8[_0xa188('0x39')],null))['then'](respondWithResult(_0x3409f6,null))[_0xa188('0x38')](handleError(_0x3409f6,null));};exports[_0xa188('0x25')]=function(_0x124458,_0x2879fb){return db[_0xa188('0x2d')][_0xa188('0x37')]({'where':{'id':_0x124458[_0xa188('0x2a')]['id']}})[_0xa188('0x24')](handleEntityNotFound(_0x2879fb,null))[_0xa188('0x24')](removeEntity(_0x2879fb,null))[_0xa188('0x38')](handleError(_0x2879fb,null));}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js index cfa43cd..08fdb4e 100644 --- a/server/api/chatApplication/chatApplication.model.js +++ b/server/api/chatApplication/chatApplication.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['define','ChatApplication','utf8mb4_unicode_ci','lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./chatApplication.attributes','exports'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0xa9e0[_0x31e29a];return _0x32d892;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x0a9e('0xb')});}; \ No newline at end of file +var _0xa9e0=['define','ChatApplication','utf8mb4_unicode_ci','lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./chatApplication.attributes','exports'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xa9e0[_0x4cf98e];return _0x1623ac;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x0a9e('0xb')});}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js index 60b9432..6342a62 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 _0x02a8=['client','http','request','then','info','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise'];(function(_0x3c8d76,_0x38f57d){var _0x255482=function(_0x49b33a){while(--_0x49b33a){_0x3c8d76['push'](_0x3c8d76['shift']());}};_0x255482(++_0x38f57d);}(_0x02a8,0xf3));var _0x802a=function(_0x2b2538,_0x4992eb){_0x2b2538=_0x2b2538-0x0;var _0x4d0748=_0x02a8[_0x2b2538];return _0x4d0748;};'use strict';var _=require(_0x802a('0x0'));var util=require(_0x802a('0x1'));var moment=require(_0x802a('0x2'));var BPromise=require(_0x802a('0x3'));var rs=require(_0x802a('0x4'));var fs=require('fs');var Redis=require(_0x802a('0x5'));var db=require(_0x802a('0x6'))['db'];var utils=require(_0x802a('0x7'));var logger=require('../../config/logger')(_0x802a('0x8'));var config=require('../../config/environment');var jayson=require(_0x802a('0x9'));var client=jayson[_0x802a('0xa')][_0x802a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x29af6f,_0xfb27d5,_0x4f890f){return new BPromise(function(_0x470e07,_0x2177e6){return client[_0x802a('0xc')](_0x29af6f,_0x4f890f)[_0x802a('0xd')](function(_0x77fd8){logger[_0x802a('0xe')](_0x802a('0xf'),_0xfb27d5,_0x802a('0x10'));logger[_0x802a('0x11')](_0x802a('0x12'),_0xfb27d5,_0x802a('0x10'),JSON['stringify'](_0x77fd8));if(_0x77fd8['error']){if(_0x77fd8['error']['code']===0x1f4){logger[_0x802a('0x13')](_0x802a('0xf'),_0xfb27d5,_0x77fd8[_0x802a('0x13')][_0x802a('0x14')]);return _0x2177e6(_0x77fd8[_0x802a('0x13')][_0x802a('0x14')]);}logger[_0x802a('0x13')](_0x802a('0xf'),_0xfb27d5,_0x77fd8[_0x802a('0x13')][_0x802a('0x14')]);return _0x470e07(_0x77fd8[_0x802a('0x13')][_0x802a('0x14')]);}else{logger[_0x802a('0xe')](_0x802a('0xf'),_0xfb27d5,_0x802a('0x10'));_0x470e07(_0x77fd8[_0x802a('0x15')]['message']);}})[_0x802a('0x16')](function(_0x15065c){logger[_0x802a('0x13')](_0x802a('0xf'),_0xfb27d5,_0x15065c);_0x2177e6(_0x15065c);});});} \ No newline at end of file +var _0xab27=['ChatApplication,\x20%s,\x20%s','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../config/logger','rpc','jayson/promise','client','request','then','info'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0xab27,0xa4));var _0x7ab2=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xab27[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require(_0x7ab2('0x0'));var util=require(_0x7ab2('0x1'));var moment=require(_0x7ab2('0x2'));var BPromise=require(_0x7ab2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7ab2('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x7ab2('0x5'))(_0x7ab2('0x6'));var config=require('../../config/environment');var jayson=require(_0x7ab2('0x7'));var client=jayson[_0x7ab2('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1f209f,_0x568581,_0x7324a0){return new BPromise(function(_0xc558c2,_0x1f923b){return client[_0x7ab2('0x9')](_0x1f209f,_0x7324a0)[_0x7ab2('0xa')](function(_0x4a2651){logger[_0x7ab2('0xb')](_0x7ab2('0xc'),_0x568581,_0x7ab2('0xd'));logger[_0x7ab2('0xe')](_0x7ab2('0xf'),_0x568581,'request\x20sent',JSON[_0x7ab2('0x10')](_0x4a2651));if(_0x4a2651[_0x7ab2('0x11')]){if(_0x4a2651[_0x7ab2('0x11')][_0x7ab2('0x12')]===0x1f4){logger[_0x7ab2('0x11')](_0x7ab2('0xc'),_0x568581,_0x4a2651[_0x7ab2('0x11')][_0x7ab2('0x13')]);return _0x1f923b(_0x4a2651[_0x7ab2('0x11')][_0x7ab2('0x13')]);}logger[_0x7ab2('0x11')](_0x7ab2('0xc'),_0x568581,_0x4a2651['error'][_0x7ab2('0x13')]);return _0xc558c2(_0x4a2651[_0x7ab2('0x11')]['message']);}else{logger[_0x7ab2('0xb')](_0x7ab2('0xc'),_0x568581,'request\x20sent');_0xc558c2(_0x4a2651[_0x7ab2('0x14')][_0x7ab2('0x13')]);}})[_0x7ab2('0x15')](function(_0x395ce1){logger[_0x7ab2('0x11')]('ChatApplication,\x20%s,\x20%s',_0x568581,_0x395ce1);_0x1f923b(_0x395ce1);});});} \ No newline at end of file diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js index 41115be..22670c1 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 _0x25fb=['util','path','connect-timeout','express','../../components/interaction/service','../../config/environment','./chatApplication.controller','get','/:id','put','isAuthenticated','update','delete','destroy','exports'];(function(_0x2c5a0c,_0x484880){var _0x47f8e9=function(_0x32e6e8){while(--_0x32e6e8){_0x2c5a0c['push'](_0x2c5a0c['shift']());}};_0x47f8e9(++_0x484880);}(_0x25fb,0x1a4));var _0xb25f=function(_0x2ae0d2,_0x4ed4cf){_0x2ae0d2=_0x2ae0d2-0x0;var _0x1ad9a7=_0x25fb[_0x2ae0d2];return _0x1ad9a7;};'use strict';var multer=require('multer');var util=require(_0xb25f('0x0'));var path=require(_0xb25f('0x1'));var timeout=require(_0xb25f('0x2'));var express=require(_0xb25f('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0xb25f('0x4'));var config=require(_0xb25f('0x5'));var controller=require(_0xb25f('0x6'));router[_0xb25f('0x7')](_0xb25f('0x8'),auth['isAuthenticated'](),controller['show']);router[_0xb25f('0x9')](_0xb25f('0x8'),auth[_0xb25f('0xa')](),controller[_0xb25f('0xb')]);router[_0xb25f('0xc')]('/:id',auth[_0xb25f('0xa')](),controller[_0xb25f('0xd')]);module[_0xb25f('0xe')]=router; \ No newline at end of file +var _0x8381=['put','delete','destroy','multer','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/:id','isAuthenticated'];(function(_0x1c0263,_0xfbc52f){var _0x5c5f07=function(_0xd00858){while(--_0xd00858){_0x1c0263['push'](_0x1c0263['shift']());}};_0x5c5f07(++_0xfbc52f);}(_0x8381,0x148));var _0x1838=function(_0x59da0b,_0x798c56){_0x59da0b=_0x59da0b-0x0;var _0x42baf5=_0x8381[_0x59da0b];return _0x42baf5;};'use strict';var multer=require(_0x1838('0x0'));var util=require(_0x1838('0x1'));var path=require(_0x1838('0x2'));var timeout=require('connect-timeout');var express=require(_0x1838('0x3'));var router=express['Router']();var auth=require(_0x1838('0x4'));var interaction=require(_0x1838('0x5'));var config=require(_0x1838('0x6'));var controller=require('./chatApplication.controller');router[_0x1838('0x7')](_0x1838('0x8'),auth[_0x1838('0x9')](),controller['show']);router[_0x1838('0xa')]('/:id',auth[_0x1838('0x9')](),controller['update']);router[_0x1838('0xb')](_0x1838('0x8'),auth[_0x1838('0x9')](),controller[_0x1838('0xc')]);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 d8bba5d..3e73868 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 _0x35db=['sequelize','STRING','BOOLEAN'];(function(_0x244f8a,_0x5d6b6b){var _0x410e61=function(_0xf15e4f){while(--_0xf15e4f){_0x244f8a['push'](_0x244f8a['shift']());}};_0x410e61(++_0x5d6b6b);}(_0x35db,0x9f));var _0xb35d=function(_0x10a0bc,_0xef10cb){_0x10a0bc=_0x10a0bc-0x0;var _0x823d6e=_0x35db[_0x10a0bc];return _0x823d6e;};'use strict';var Sequelize=require(_0xb35d('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xb35d('0x1')]},'write':{'type':Sequelize[_0xb35d('0x2')],'defaultValue':!![]}}; \ No newline at end of file +var _0x306b=['BOOLEAN','sequelize','exports','STRING'];(function(_0x5c93e2,_0x258141){var _0x39ebad=function(_0x40795d){while(--_0x40795d){_0x5c93e2['push'](_0x5c93e2['shift']());}};_0x39ebad(++_0x258141);}(_0x306b,0xf9));var _0xb306=function(_0x3fa16a,_0x5b5af8){_0x3fa16a=_0x3fa16a-0x0;var _0x314345=_0x306b[_0x3fa16a];return _0x314345;};'use strict';var Sequelize=require(_0xb306('0x0'));module[_0xb306('0x1')]={'name':{'type':Sequelize[_0xb306('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xb306('0x2')]},'write':{'type':Sequelize[_0xb306('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 63dfc9a..ab30803 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 _0x40b5=['key','VIRTUAL','field','merge','count','includeAll','include','ChatGroup','findAll','length','find','create','body','update','params','describe','getUnread','user','toInteger','addMembers','ids','omit','User','order','getMembers','hasOwnProperty','removeMembers','addMessage','getMessages','findOne','ChatInternalMessage','$gte','split','format','options','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','./chatGroup.socket','register','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','info','ChatGroup,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','end','offset','limit','Content-Range','json','reject','save','then','destroy','send','index','rawAttributes','model','keys','query','intersection','attributes','fields','nolimit','sort','where','filters','pick','filter','map','type'];(function(_0x24ac99,_0x84fb2d){var _0x596b97=function(_0x1488e6){while(--_0x1488e6){_0x24ac99['push'](_0x24ac99['shift']());}};_0x596b97(++_0x84fb2d);}(_0x40b5,0x1db));var _0x540b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x40b5[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require(_0x540b('0x0'));var emlformat=require(_0x540b('0x1'));var rimraf=require(_0x540b('0x2'));var zipdir=require(_0x540b('0x3'));var jsonpatch=require(_0x540b('0x4'));var rp=require(_0x540b('0x5'));var moment=require(_0x540b('0x6'));var BPromise=require(_0x540b('0x7'));var Mustache=require('mustache');var util=require(_0x540b('0x8'));var path=require(_0x540b('0x9'));var sox=require(_0x540b('0xa'));var csv=require(_0x540b('0xb'));var ejs=require(_0x540b('0xc'));var fs=require('fs');var _=require('lodash');var squel=require(_0x540b('0xd'));var crypto=require(_0x540b('0xe'));var jsforce=require(_0x540b('0xf'));var deskjs=require(_0x540b('0x10'));var toCsv=require(_0x540b('0xb'));var querystring=require(_0x540b('0x11'));var Papa=require(_0x540b('0x12'));var Redis=require(_0x540b('0x13'));var authService=require(_0x540b('0x14'));var qs=require(_0x540b('0x15'));var as=require(_0x540b('0x16'));var hardwareService=require(_0x540b('0x17'));var logger=require(_0x540b('0x18'))('api');var utils=require(_0x540b('0x19'));var config=require(_0x540b('0x1a'));var db=require(_0x540b('0x1b'))['db'];config[_0x540b('0x1c')]=_[_0x540b('0x1d')](config['redis'],{'host':_0x540b('0x1e'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x540b('0x1c')]));require(_0x540b('0x1f'))[_0x540b('0x20')](socket);var jayson=require('jayson/promise');var client=jayson[_0x540b('0x21')][_0x540b('0x22')]({'port':0x232a});function checkPasswordPattern(_0x3cd7f0,_0x442c70,_0x239bfe){if(_0x239bfe){var _0x3792ff=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3792ff[_0x540b('0x23')](_0x442c70)){return _0x3cd7f0;}else{throw new Error(_0x540b('0x24'));}}else{return _0x3cd7f0;}}function respondWithRpcPromise(_0x1aa0cd,_0x210845,_0xc4f99a,_0x3e185c){return new BPromise(function(_0x510602,_0x5c6d3d){var _0x3b3ee2=_0x3e185c||client;return _0x3b3ee2[_0x540b('0x25')](_0x1aa0cd,_0xc4f99a)['then'](function(_0x546a7f){logger[_0x540b('0x26')](_0x540b('0x27'),_0x210845,'request\x20sent');logger['debug']('ChatGroup,\x20%s,\x20%s,\x20%s',_0x210845,_0x540b('0x28'),JSON[_0x540b('0x29')](_0x546a7f));if(_0x546a7f['error']){if(_0x546a7f[_0x540b('0x2a')][_0x540b('0x2b')]===0x1f4){logger[_0x540b('0x2a')](_0x540b('0x27'),_0x210845,_0x546a7f[_0x540b('0x2a')][_0x540b('0x2c')]);return _0x5c6d3d(_0x546a7f[_0x540b('0x2a')]['message']);}logger[_0x540b('0x2a')](_0x540b('0x27'),_0x210845,_0x546a7f[_0x540b('0x2a')][_0x540b('0x2c')]);return _0x510602(_0x546a7f[_0x540b('0x2a')][_0x540b('0x2c')]);}else{logger[_0x540b('0x26')](_0x540b('0x27'),_0x210845,_0x540b('0x28'));_0x510602(_0x546a7f[_0x540b('0x2d')]['message']);}})[_0x540b('0x2e')](function(_0x269a77){logger['error']('ChatGroup,\x20%s,\x20%s',_0x210845,_0x269a77);_0x5c6d3d(_0x269a77);});});}function respondWithStatusCode(_0x2670c3,_0x5cbf91){_0x5cbf91=_0x5cbf91||0xcc;return function(_0x39229a){if(_0x39229a){return _0x2670c3[_0x540b('0x2f')](_0x5cbf91);}return _0x2670c3[_0x540b('0x30')](_0x5cbf91)[_0x540b('0x31')]();};}function respondWithResult(_0x5dbcfc,_0x5ca2c6){_0x5ca2c6=_0x5ca2c6||0xc8;return function(_0xa0af71){if(_0xa0af71){return _0x5dbcfc[_0x540b('0x30')](_0x5ca2c6)['json'](_0xa0af71);}};}function respondWithFilteredResult(_0x21d177,_0x133c95){return function(_0x36ab36){if(_0x36ab36){var _0x5d3024=_0x36ab36['count'],_0x49df69=_0x133c95[_0x540b('0x32')],_0x130dcf=_0x133c95[_0x540b('0x32')]+_0x133c95[_0x540b('0x33')],_0x5c6636;if(_0x130dcf>=_0x5d3024){_0x130dcf=_0x5d3024;_0x5c6636=0xc8;}else{_0x5c6636=0xce;}_0x21d177['status'](_0x5c6636);return _0x21d177['set'](_0x540b('0x34'),_0x49df69+'-'+_0x130dcf+'/'+_0x5d3024)[_0x540b('0x35')](_0x36ab36);}return null;};}function patchUpdates(_0x8b4721){return function(_0x50e5e6){try{jsonpatch['apply'](_0x50e5e6,_0x8b4721,!![]);}catch(_0x1ac3fe){return BPromise[_0x540b('0x36')](_0x1ac3fe);}return _0x50e5e6[_0x540b('0x37')]();};}function saveUpdates(_0xd06e82,_0x2b7a79){return function(_0x3988cc){if(_0x3988cc){return _0x3988cc['update'](_0xd06e82)[_0x540b('0x38')](function(_0x4f8c36){return _0x4f8c36;});}return null;};}function removeEntity(_0x5937b2,_0x1de2a7){return function(_0x4f43ac){if(_0x4f43ac){return _0x4f43ac[_0x540b('0x39')]()[_0x540b('0x38')](function(){_0x5937b2['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x43e59d,_0x481bf2){return function(_0x295078){if(!_0x295078){_0x43e59d[_0x540b('0x2f')](0x194);}return _0x295078;};}function handleError(_0x4b602b,_0x5a6a2d){_0x5a6a2d=_0x5a6a2d||0x1f4;return function(_0x54e4bb){logger['error'](_0x54e4bb['stack']);if(_0x54e4bb['name']){delete _0x54e4bb['name'];}_0x4b602b[_0x540b('0x30')](_0x5a6a2d)[_0x540b('0x3a')](_0x54e4bb);};}exports[_0x540b('0x3b')]=function(_0x4b33a4,_0x2429d3){var _0x217b3e={},_0x3a7f8f={},_0xc13958={'count':0x0,'rows':[]};var _0x181798=db['ChatGroup'][_0x540b('0x3c')];_0x3a7f8f[_0x540b('0x3d')]=_[_0x540b('0x3e')](_0x181798);_0x3a7f8f[_0x540b('0x3f')]=_['keys'](_0x4b33a4[_0x540b('0x3f')]);_0x3a7f8f['filters']=_[_0x540b('0x40')](_0x3a7f8f[_0x540b('0x3d')],_0x3a7f8f[_0x540b('0x3f')]);_0x217b3e[_0x540b('0x41')]=_[_0x540b('0x40')](_0x3a7f8f[_0x540b('0x3d')],qs[_0x540b('0x42')](_0x4b33a4[_0x540b('0x3f')][_0x540b('0x42')]));_0x217b3e['attributes']=_0x217b3e[_0x540b('0x41')]['length']?_0x217b3e[_0x540b('0x41')]:_0x3a7f8f['model'];if(!_0x4b33a4[_0x540b('0x3f')]['hasOwnProperty'](_0x540b('0x43'))){_0x217b3e[_0x540b('0x33')]=qs[_0x540b('0x33')](_0x4b33a4[_0x540b('0x3f')][_0x540b('0x33')]);_0x217b3e[_0x540b('0x32')]=qs['offset'](_0x4b33a4[_0x540b('0x3f')][_0x540b('0x32')]);}_0x217b3e['order']=qs[_0x540b('0x44')](_0x4b33a4[_0x540b('0x3f')][_0x540b('0x44')]);_0x217b3e[_0x540b('0x45')]=qs[_0x540b('0x46')](_[_0x540b('0x47')](_0x4b33a4['query'],_0x3a7f8f[_0x540b('0x46')]));if(_0x4b33a4['query'][_0x540b('0x48')]){_0x217b3e['where']=_['merge'](_0x217b3e[_0x540b('0x45')],{'$or':_[_0x540b('0x49')](_0x181798,function(_0x25d6bd){if(_0x25d6bd[_0x540b('0x4a')][_0x540b('0x4b')]!==_0x540b('0x4c')){var _0x405353={};_0x405353[_0x25d6bd[_0x540b('0x4d')]]={'$like':'%'+_0x4b33a4['query']['filter']+'%'};return _0x405353;}})});}_0x217b3e=_[_0x540b('0x4e')]({},_0x217b3e,_0x4b33a4['options']);var _0x8b4d8c={'where':_0x217b3e[_0x540b('0x45')]};return db['ChatGroup'][_0x540b('0x4f')](_0x8b4d8c)[_0x540b('0x38')](function(_0x4b134d){_0xc13958[_0x540b('0x4f')]=_0x4b134d;if(_0x4b33a4[_0x540b('0x3f')][_0x540b('0x50')]){_0x217b3e[_0x540b('0x51')]=[{'all':!![]}];}return db[_0x540b('0x52')][_0x540b('0x53')](_0x217b3e);})[_0x540b('0x38')](function(_0x27e404){_0xc13958['rows']=_0x27e404;return _0xc13958;})['then'](respondWithFilteredResult(_0x2429d3,_0x217b3e))[_0x540b('0x2e')](handleError(_0x2429d3,null));};exports['show']=function(_0x2e36c1,_0x5c6087){var _0x4d168a={'raw':!![],'where':{'id':_0x2e36c1['params']['id']}},_0x29f340={};_0x29f340[_0x540b('0x3d')]=_['keys'](db[_0x540b('0x52')]['rawAttributes']);_0x29f340[_0x540b('0x3f')]=_[_0x540b('0x3e')](_0x2e36c1['query']);_0x29f340['filters']=_['intersection'](_0x29f340[_0x540b('0x3d')],_0x29f340['query']);_0x4d168a[_0x540b('0x41')]=_[_0x540b('0x40')](_0x29f340[_0x540b('0x3d')],qs[_0x540b('0x42')](_0x2e36c1[_0x540b('0x3f')][_0x540b('0x42')]));_0x4d168a[_0x540b('0x41')]=_0x4d168a['attributes'][_0x540b('0x54')]?_0x4d168a[_0x540b('0x41')]:_0x29f340[_0x540b('0x3d')];if(_0x2e36c1[_0x540b('0x3f')][_0x540b('0x50')]){_0x4d168a['include']=[{'all':!![]}];}_0x4d168a=_[_0x540b('0x4e')]({},_0x4d168a,_0x2e36c1['options']);return db[_0x540b('0x52')][_0x540b('0x55')](_0x4d168a)[_0x540b('0x38')](handleEntityNotFound(_0x5c6087,null))[_0x540b('0x38')](respondWithResult(_0x5c6087,null))[_0x540b('0x2e')](handleError(_0x5c6087,null));};exports[_0x540b('0x56')]=function(_0x5897a8,_0x53d9ef){return db[_0x540b('0x52')][_0x540b('0x56')](_0x5897a8[_0x540b('0x57')],{})['then'](respondWithResult(_0x53d9ef,0xc9))['catch'](handleError(_0x53d9ef,null));};exports[_0x540b('0x58')]=function(_0x204196,_0xff89c3){if(_0x204196[_0x540b('0x57')]['id']){delete _0x204196[_0x540b('0x57')]['id'];}return db[_0x540b('0x52')]['find']({'where':{'id':_0x204196[_0x540b('0x59')]['id']}})[_0x540b('0x38')](handleEntityNotFound(_0xff89c3,null))[_0x540b('0x38')](saveUpdates(_0x204196['body'],null))[_0x540b('0x38')](respondWithResult(_0xff89c3,null))[_0x540b('0x2e')](handleError(_0xff89c3,null));};exports[_0x540b('0x39')]=function(_0x20e22c,_0x2062db){return db['ChatGroup'][_0x540b('0x55')]({'where':{'id':_0x20e22c['params']['id']}})[_0x540b('0x38')](handleEntityNotFound(_0x2062db,null))[_0x540b('0x38')](removeEntity(_0x2062db,null))[_0x540b('0x2e')](handleError(_0x2062db,null));};exports[_0x540b('0x5a')]=function(_0xf22220,_0x2f9c9e){return db[_0x540b('0x52')][_0x540b('0x5a')]()[_0x540b('0x38')](respondWithResult(_0x2f9c9e,null))['catch'](handleError(_0x2f9c9e,null));};exports[_0x540b('0x5b')]=function(_0x49600d,_0x386550,_0x41bf3a){return db['ChatInternalMessage'][_0x540b('0x4f')]({'where':{'ChatGroupId':_0x49600d[_0x540b('0x59')]['id'],'ToId':_0x49600d[_0x540b('0x5c')]['id'],'read':![]}})[_0x540b('0x38')](function(_0x5b7f24){return{'id':_[_0x540b('0x5d')](_0x49600d['params']['id']),'count':_0x5b7f24};})[_0x540b('0x38')](respondWithResult(_0x386550,null))['catch'](handleError(_0x386550,null));};exports[_0x540b('0x5e')]=function(_0x2bff1f,_0x1b0683,_0x3a1e49){return db['ChatGroup'][_0x540b('0x55')]({'where':{'id':_0x2bff1f[_0x540b('0x59')]['id']}})[_0x540b('0x38')](handleEntityNotFound(_0x1b0683,null))[_0x540b('0x38')](function(_0x18289b){if(_0x18289b){return _0x18289b[_0x540b('0x5e')](_0x2bff1f[_0x540b('0x57')][_0x540b('0x5f')],_[_0x540b('0x60')](_0x2bff1f[_0x540b('0x57')],[_0x540b('0x5f'),'id'])||{});}})['then'](respondWithResult(_0x1b0683,null))['catch'](handleError(_0x1b0683,null));};exports['getMembers']=function(_0x4abdf0,_0x2fc3d5,_0x378609){var _0x1af0a1={};var _0x24a2eb={};var _0x20cec3;var _0x31cc7b;return db[_0x540b('0x52')]['findOne']({'where':{'id':_0x4abdf0[_0x540b('0x59')]['id']}})[_0x540b('0x38')](handleEntityNotFound(_0x2fc3d5,null))[_0x540b('0x38')](function(_0x58b1a3){if(_0x58b1a3){_0x20cec3=_0x58b1a3;_0x24a2eb['model']=_[_0x540b('0x3e')](db[_0x540b('0x61')]['rawAttributes']);_0x24a2eb[_0x540b('0x3f')]=_['keys'](_0x4abdf0['query']);_0x24a2eb[_0x540b('0x46')]=_[_0x540b('0x40')](_0x24a2eb[_0x540b('0x3d')],_0x24a2eb[_0x540b('0x3f')]);_0x1af0a1['attributes']=_[_0x540b('0x40')](_0x24a2eb[_0x540b('0x3d')],qs[_0x540b('0x42')](_0x4abdf0[_0x540b('0x3f')]['fields']));_0x1af0a1[_0x540b('0x41')]=_0x1af0a1[_0x540b('0x41')][_0x540b('0x54')]?_0x1af0a1['attributes']:_0x24a2eb[_0x540b('0x3d')];_0x1af0a1[_0x540b('0x62')]=qs[_0x540b('0x44')](_0x4abdf0[_0x540b('0x3f')][_0x540b('0x44')]);_0x1af0a1[_0x540b('0x45')]=qs[_0x540b('0x46')](_[_0x540b('0x47')](_0x4abdf0['query'],_0x24a2eb[_0x540b('0x46')]));if(_0x4abdf0[_0x540b('0x3f')]['filter']){_0x1af0a1['where']=_[_0x540b('0x4e')](_0x1af0a1['where'],{'$or':_[_0x540b('0x49')](_0x1af0a1[_0x540b('0x41')],function(_0x4966e8){var _0x2f5946={};_0x2f5946[_0x4966e8]={'$like':'%'+_0x4abdf0[_0x540b('0x3f')][_0x540b('0x48')]+'%'};return _0x2f5946;})});}_0x1af0a1=_[_0x540b('0x4e')]({},_0x1af0a1,_0x4abdf0['options']);return _0x20cec3[_0x540b('0x63')](_0x1af0a1);}})[_0x540b('0x38')](function(_0x22d56c){if(_0x22d56c){_0x31cc7b=_0x22d56c[_0x540b('0x54')];if(!_0x4abdf0[_0x540b('0x3f')][_0x540b('0x64')](_0x540b('0x43'))){_0x1af0a1[_0x540b('0x33')]=qs['limit'](_0x4abdf0[_0x540b('0x3f')]['limit']);_0x1af0a1[_0x540b('0x32')]=qs['offset'](_0x4abdf0[_0x540b('0x3f')][_0x540b('0x32')]);}return _0x20cec3[_0x540b('0x63')](_0x1af0a1);}})[_0x540b('0x38')](function(_0xe42382){if(_0xe42382){return _0xe42382?{'count':_0x31cc7b,'rows':_0xe42382}:null;}})[_0x540b('0x38')](respondWithResult(_0x2fc3d5,null))[_0x540b('0x2e')](handleError(_0x2fc3d5,null));};exports[_0x540b('0x65')]=function(_0x5d0764,_0x5f475a,_0x937848){return db[_0x540b('0x52')][_0x540b('0x55')]({'where':{'id':_0x5d0764[_0x540b('0x59')]['id']}})[_0x540b('0x38')](handleEntityNotFound(_0x5f475a,null))[_0x540b('0x38')](function(_0x236bfb){if(_0x236bfb){return _0x236bfb['removeMembers'](_0x5d0764[_0x540b('0x3f')][_0x540b('0x5f')]);}})[_0x540b('0x38')](respondWithStatusCode(_0x5f475a,null))[_0x540b('0x2e')](handleError(_0x5f475a,null));};exports[_0x540b('0x66')]=function(_0x53f9f6,_0x20962d,_0x3af234){if(_0x53f9f6[_0x540b('0x57')]['id']){delete _0x53f9f6[_0x540b('0x57')]['id'];}return db['ChatGroup'][_0x540b('0x55')]({'where':{'id':_0x53f9f6[_0x540b('0x59')]['id']}})['then'](handleEntityNotFound(_0x20962d,null))[_0x540b('0x38')](function(_0x5e0f37){if(_0x5e0f37){_0x53f9f6[_0x540b('0x57')]['ChatGroupId']=_0x5e0f37['id'];return db['ChatInternalMessage'][_0x540b('0x56')](_0x53f9f6[_0x540b('0x57')]);}})[_0x540b('0x38')](respondWithResult(_0x20962d,null))[_0x540b('0x2e')](handleError(_0x20962d,null));};exports[_0x540b('0x67')]=function(_0x1167ee,_0x8eeba9,_0x344d18){var _0x178e22={};var _0x127d67={};var _0xac7874;var _0x50008c;return db['ChatGroup'][_0x540b('0x68')]({'where':{'id':_0x1167ee[_0x540b('0x59')]['id']}})[_0x540b('0x38')](handleEntityNotFound(_0x8eeba9,null))[_0x540b('0x38')](function(_0x4c8418){if(_0x4c8418){_0xac7874=_0x4c8418;_0x127d67[_0x540b('0x3d')]=_['keys'](db[_0x540b('0x69')]['rawAttributes']);_0x127d67['query']=_[_0x540b('0x3e')](_0x1167ee[_0x540b('0x3f')]);_0x127d67[_0x540b('0x46')]=_['intersection'](_0x127d67[_0x540b('0x3d')],_0x127d67[_0x540b('0x3f')]);_0x178e22[_0x540b('0x41')]=_[_0x540b('0x40')](_0x127d67['model'],qs['fields'](_0x1167ee[_0x540b('0x3f')][_0x540b('0x42')]));_0x178e22['attributes']=_0x178e22[_0x540b('0x41')][_0x540b('0x54')]?_0x178e22[_0x540b('0x41')]:_0x127d67[_0x540b('0x3d')];_0x178e22[_0x540b('0x62')]=qs[_0x540b('0x44')](_0x1167ee[_0x540b('0x3f')][_0x540b('0x44')]);_0x178e22[_0x540b('0x45')]=qs[_0x540b('0x46')](_[_0x540b('0x47')](_0x1167ee[_0x540b('0x3f')],_0x127d67[_0x540b('0x46')]));if(_0x1167ee[_0x540b('0x3f')][_0x540b('0x48')]){_0x178e22[_0x540b('0x45')]=_['merge'](_0x178e22[_0x540b('0x45')],{'$or':_[_0x540b('0x49')](_0x178e22[_0x540b('0x41')],function(_0x8877ef){var _0x104444={};_0x104444[_0x8877ef]={'$like':'%'+_0x1167ee['query'][_0x540b('0x48')]+'%'};return _0x104444;})});}if(_0x1167ee[_0x540b('0x3f')][_0x540b('0x6a')]){var _0x570867=_0x1167ee[_0x540b('0x3f')][_0x540b('0x6a')][_0x540b('0x6b')](',');var _0x3b4338={};_0x3b4338[_0x570867[0x0]]={'$gte':moment(_0x570867[0x1])[_0x540b('0x6c')]('YYYY-MM-DD\x20HH:mm:ss')};_0x178e22['where']=_[_0x540b('0x4e')](_0x178e22[_0x540b('0x45')],_0x3b4338);}_0x178e22=_[_0x540b('0x4e')]({},_0x178e22,_0x1167ee[_0x540b('0x6d')]);return _0xac7874[_0x540b('0x67')](_0x178e22);}})[_0x540b('0x38')](function(_0xed2e7f){if(_0xed2e7f){_0x50008c=_0xed2e7f['length'];if(!_0x1167ee['query'][_0x540b('0x64')](_0x540b('0x43'))){_0x178e22['limit']=qs[_0x540b('0x33')](_0x1167ee[_0x540b('0x3f')][_0x540b('0x33')]);_0x178e22[_0x540b('0x32')]=qs[_0x540b('0x32')](_0x1167ee['query'][_0x540b('0x32')]);}return _0xac7874[_0x540b('0x67')](_0x178e22);}})['then'](function(_0x1878da){if(_0x1878da){return _0x1878da?{'count':_0x50008c,'rows':_0x1878da}:null;}})[_0x540b('0x38')](respondWithResult(_0x8eeba9,null))[_0x540b('0x2e')](handleError(_0x8eeba9,null));}; \ No newline at end of file +var _0xda80=['destroy','end','sendStatus','stack','name','send','index','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','map','key','VIRTUAL','filter','options','ChatGroup','count','includeAll','include','findAll','rows','show','params','find','create','body','describe','getUnread','ChatInternalMessage','user','addMembers','ids','getMembers','User','pick','removeMembers','addMessage','ChatGroupId','findOne','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','getMessages','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','ejs','lodash','crypto','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','register','jayson/promise','client','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','status','json','offset','limit','set','Content-Range','apply','reject','save','update'];(function(_0x18134e,_0x431cdf){var _0x7d5edf=function(_0x5a8090){while(--_0x5a8090){_0x18134e['push'](_0x18134e['shift']());}};_0x7d5edf(++_0x431cdf);}(_0xda80,0x116));var _0x0da8=function(_0xbbeebe,_0x2b0774){_0xbbeebe=_0xbbeebe-0x0;var _0xb4171e=_0xda80[_0xbbeebe];return _0xb4171e;};'use strict';var pdf=require(_0x0da8('0x0'));var emlformat=require(_0x0da8('0x1'));var rimraf=require(_0x0da8('0x2'));var zipdir=require(_0x0da8('0x3'));var jsonpatch=require(_0x0da8('0x4'));var rp=require('request-promise');var moment=require(_0x0da8('0x5'));var BPromise=require(_0x0da8('0x6'));var Mustache=require(_0x0da8('0x7'));var util=require(_0x0da8('0x8'));var path=require(_0x0da8('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x0da8('0xa'));var fs=require('fs');var _=require(_0x0da8('0xb'));var squel=require('squel');var crypto=require(_0x0da8('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x0da8('0xd'));var querystring=require(_0x0da8('0xe'));var Papa=require(_0x0da8('0xf'));var Redis=require(_0x0da8('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x0da8('0x11'));var as=require(_0x0da8('0x12'));var hardwareService=require(_0x0da8('0x13'));var logger=require(_0x0da8('0x14'))(_0x0da8('0x15'));var utils=require(_0x0da8('0x16'));var config=require(_0x0da8('0x17'));var db=require(_0x0da8('0x18'))['db'];config[_0x0da8('0x19')]=_[_0x0da8('0x1a')](config[_0x0da8('0x19')],{'host':_0x0da8('0x1b'),'port':0x18eb});var socket=require(_0x0da8('0x1c'))(new Redis(config[_0x0da8('0x19')]));require(_0x0da8('0x1d'))[_0x0da8('0x1e')](socket);var jayson=require(_0x0da8('0x1f'));var client=jayson[_0x0da8('0x20')]['http']({'port':0x232a});function checkPasswordPattern(_0x17c2a7,_0x250caf,_0x4fa96d){if(_0x4fa96d){var _0x36cace=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x36cace['test'](_0x250caf)){return _0x17c2a7;}else{throw new Error(_0x0da8('0x21'));}}else{return _0x17c2a7;}}function respondWithRpcPromise(_0x5d4d0e,_0x389158,_0x5e9d2f,_0x5d378a){return new BPromise(function(_0x1994f7,_0x595322){var _0x1572c6=_0x5d378a||client;return _0x1572c6['request'](_0x5d4d0e,_0x5e9d2f)[_0x0da8('0x22')](function(_0x4884e9){logger[_0x0da8('0x23')](_0x0da8('0x24'),_0x389158,_0x0da8('0x25'));logger[_0x0da8('0x26')]('ChatGroup,\x20%s,\x20%s,\x20%s',_0x389158,_0x0da8('0x25'),JSON[_0x0da8('0x27')](_0x4884e9));if(_0x4884e9[_0x0da8('0x28')]){if(_0x4884e9['error'][_0x0da8('0x29')]===0x1f4){logger[_0x0da8('0x28')]('ChatGroup,\x20%s,\x20%s',_0x389158,_0x4884e9[_0x0da8('0x28')][_0x0da8('0x2a')]);return _0x595322(_0x4884e9[_0x0da8('0x28')][_0x0da8('0x2a')]);}logger[_0x0da8('0x28')](_0x0da8('0x24'),_0x389158,_0x4884e9['error']['message']);return _0x1994f7(_0x4884e9[_0x0da8('0x28')]['message']);}else{logger[_0x0da8('0x23')](_0x0da8('0x24'),_0x389158,_0x0da8('0x25'));_0x1994f7(_0x4884e9[_0x0da8('0x2b')]['message']);}})[_0x0da8('0x2c')](function(_0x5cc597){logger[_0x0da8('0x28')](_0x0da8('0x24'),_0x389158,_0x5cc597);_0x595322(_0x5cc597);});});}function respondWithStatusCode(_0x248a2f,_0x44a8c9){_0x44a8c9=_0x44a8c9||0xcc;return function(_0x2675f9){if(_0x2675f9){return _0x248a2f['sendStatus'](_0x44a8c9);}return _0x248a2f['status'](_0x44a8c9)['end']();};}function respondWithResult(_0x423967,_0x279174){_0x279174=_0x279174||0xc8;return function(_0x5910ec){if(_0x5910ec){return _0x423967[_0x0da8('0x2d')](_0x279174)[_0x0da8('0x2e')](_0x5910ec);}};}function respondWithFilteredResult(_0x231424,_0x4fa471){return function(_0x584d57){if(_0x584d57){var _0x3e755a=_0x584d57['count'],_0x2db399=_0x4fa471[_0x0da8('0x2f')],_0x3c54f9=_0x4fa471[_0x0da8('0x2f')]+_0x4fa471[_0x0da8('0x30')],_0x34cc2a;if(_0x3c54f9>=_0x3e755a){_0x3c54f9=_0x3e755a;_0x34cc2a=0xc8;}else{_0x34cc2a=0xce;}_0x231424[_0x0da8('0x2d')](_0x34cc2a);return _0x231424[_0x0da8('0x31')](_0x0da8('0x32'),_0x2db399+'-'+_0x3c54f9+'/'+_0x3e755a)[_0x0da8('0x2e')](_0x584d57);}return null;};}function patchUpdates(_0x5cf5ce){return function(_0x39b938){try{jsonpatch[_0x0da8('0x33')](_0x39b938,_0x5cf5ce,!![]);}catch(_0x263a48){return BPromise[_0x0da8('0x34')](_0x263a48);}return _0x39b938[_0x0da8('0x35')]();};}function saveUpdates(_0x58a87b,_0x547670){return function(_0x21e5ef){if(_0x21e5ef){return _0x21e5ef[_0x0da8('0x36')](_0x58a87b)[_0x0da8('0x22')](function(_0x58f667){return _0x58f667;});}return null;};}function removeEntity(_0x2aa3ee,_0x219928){return function(_0x58fa3b){if(_0x58fa3b){return _0x58fa3b[_0x0da8('0x37')]()[_0x0da8('0x22')](function(){_0x2aa3ee['status'](0xcc)[_0x0da8('0x38')]();});}};}function handleEntityNotFound(_0x21c4f5,_0x334064){return function(_0x380222){if(!_0x380222){_0x21c4f5[_0x0da8('0x39')](0x194);}return _0x380222;};}function handleError(_0x1cefcf,_0x3e6a0b){_0x3e6a0b=_0x3e6a0b||0x1f4;return function(_0xfb72f5){logger[_0x0da8('0x28')](_0xfb72f5[_0x0da8('0x3a')]);if(_0xfb72f5[_0x0da8('0x3b')]){delete _0xfb72f5[_0x0da8('0x3b')];}_0x1cefcf[_0x0da8('0x2d')](_0x3e6a0b)[_0x0da8('0x3c')](_0xfb72f5);};}exports[_0x0da8('0x3d')]=function(_0x428dd6,_0x1c1168){var _0x50ca4f={},_0x5ea27a={},_0x11cb7b={'count':0x0,'rows':[]};var _0xc74a83=db['ChatGroup'][_0x0da8('0x3e')];_0x5ea27a[_0x0da8('0x3f')]=_[_0x0da8('0x40')](_0xc74a83);_0x5ea27a['query']=_[_0x0da8('0x40')](_0x428dd6[_0x0da8('0x41')]);_0x5ea27a[_0x0da8('0x42')]=_[_0x0da8('0x43')](_0x5ea27a['model'],_0x5ea27a[_0x0da8('0x41')]);_0x50ca4f[_0x0da8('0x44')]=_[_0x0da8('0x43')](_0x5ea27a[_0x0da8('0x3f')],qs[_0x0da8('0x45')](_0x428dd6[_0x0da8('0x41')][_0x0da8('0x45')]));_0x50ca4f[_0x0da8('0x44')]=_0x50ca4f['attributes'][_0x0da8('0x46')]?_0x50ca4f[_0x0da8('0x44')]:_0x5ea27a[_0x0da8('0x3f')];if(!_0x428dd6['query'][_0x0da8('0x47')](_0x0da8('0x48'))){_0x50ca4f[_0x0da8('0x30')]=qs[_0x0da8('0x30')](_0x428dd6[_0x0da8('0x41')][_0x0da8('0x30')]);_0x50ca4f['offset']=qs[_0x0da8('0x2f')](_0x428dd6[_0x0da8('0x41')]['offset']);}_0x50ca4f[_0x0da8('0x49')]=qs[_0x0da8('0x4a')](_0x428dd6[_0x0da8('0x41')][_0x0da8('0x4a')]);_0x50ca4f[_0x0da8('0x4b')]=qs[_0x0da8('0x42')](_['pick'](_0x428dd6[_0x0da8('0x41')],_0x5ea27a[_0x0da8('0x42')]));if(_0x428dd6[_0x0da8('0x41')]['filter']){_0x50ca4f['where']=_[_0x0da8('0x4c')](_0x50ca4f[_0x0da8('0x4b')],{'$or':_[_0x0da8('0x4d')](_0xc74a83,function(_0x52350d){if(_0x52350d['type'][_0x0da8('0x4e')]!==_0x0da8('0x4f')){var _0x1768ed={};_0x1768ed[_0x52350d['field']]={'$like':'%'+_0x428dd6[_0x0da8('0x41')][_0x0da8('0x50')]+'%'};return _0x1768ed;}})});}_0x50ca4f=_[_0x0da8('0x4c')]({},_0x50ca4f,_0x428dd6[_0x0da8('0x51')]);var _0x4754e7={'where':_0x50ca4f[_0x0da8('0x4b')]};return db[_0x0da8('0x52')][_0x0da8('0x53')](_0x4754e7)[_0x0da8('0x22')](function(_0x47ab57){_0x11cb7b['count']=_0x47ab57;if(_0x428dd6[_0x0da8('0x41')][_0x0da8('0x54')]){_0x50ca4f[_0x0da8('0x55')]=[{'all':!![]}];}return db[_0x0da8('0x52')][_0x0da8('0x56')](_0x50ca4f);})[_0x0da8('0x22')](function(_0x3e53c9){_0x11cb7b[_0x0da8('0x57')]=_0x3e53c9;return _0x11cb7b;})['then'](respondWithFilteredResult(_0x1c1168,_0x50ca4f))[_0x0da8('0x2c')](handleError(_0x1c1168,null));};exports[_0x0da8('0x58')]=function(_0x107bb3,_0x519b50){var _0x41cdbe={'raw':!![],'where':{'id':_0x107bb3[_0x0da8('0x59')]['id']}},_0x401f79={};_0x401f79[_0x0da8('0x3f')]=_['keys'](db[_0x0da8('0x52')][_0x0da8('0x3e')]);_0x401f79['query']=_['keys'](_0x107bb3[_0x0da8('0x41')]);_0x401f79['filters']=_[_0x0da8('0x43')](_0x401f79[_0x0da8('0x3f')],_0x401f79[_0x0da8('0x41')]);_0x41cdbe['attributes']=_[_0x0da8('0x43')](_0x401f79[_0x0da8('0x3f')],qs[_0x0da8('0x45')](_0x107bb3[_0x0da8('0x41')][_0x0da8('0x45')]));_0x41cdbe['attributes']=_0x41cdbe[_0x0da8('0x44')]['length']?_0x41cdbe[_0x0da8('0x44')]:_0x401f79[_0x0da8('0x3f')];if(_0x107bb3[_0x0da8('0x41')][_0x0da8('0x54')]){_0x41cdbe[_0x0da8('0x55')]=[{'all':!![]}];}_0x41cdbe=_[_0x0da8('0x4c')]({},_0x41cdbe,_0x107bb3['options']);return db[_0x0da8('0x52')][_0x0da8('0x5a')](_0x41cdbe)[_0x0da8('0x22')](handleEntityNotFound(_0x519b50,null))[_0x0da8('0x22')](respondWithResult(_0x519b50,null))[_0x0da8('0x2c')](handleError(_0x519b50,null));};exports[_0x0da8('0x5b')]=function(_0x5073b2,_0x2239da){return db[_0x0da8('0x52')][_0x0da8('0x5b')](_0x5073b2['body'],{})[_0x0da8('0x22')](respondWithResult(_0x2239da,0xc9))[_0x0da8('0x2c')](handleError(_0x2239da,null));};exports[_0x0da8('0x36')]=function(_0x39fc8b,_0x58221c){if(_0x39fc8b['body']['id']){delete _0x39fc8b[_0x0da8('0x5c')]['id'];}return db[_0x0da8('0x52')][_0x0da8('0x5a')]({'where':{'id':_0x39fc8b['params']['id']}})[_0x0da8('0x22')](handleEntityNotFound(_0x58221c,null))[_0x0da8('0x22')](saveUpdates(_0x39fc8b[_0x0da8('0x5c')],null))[_0x0da8('0x22')](respondWithResult(_0x58221c,null))[_0x0da8('0x2c')](handleError(_0x58221c,null));};exports[_0x0da8('0x37')]=function(_0x54de77,_0x6966d5){return db['ChatGroup']['find']({'where':{'id':_0x54de77[_0x0da8('0x59')]['id']}})['then'](handleEntityNotFound(_0x6966d5,null))['then'](removeEntity(_0x6966d5,null))['catch'](handleError(_0x6966d5,null));};exports[_0x0da8('0x5d')]=function(_0x48fb51,_0x1c0232){return db[_0x0da8('0x52')]['describe']()[_0x0da8('0x22')](respondWithResult(_0x1c0232,null))[_0x0da8('0x2c')](handleError(_0x1c0232,null));};exports[_0x0da8('0x5e')]=function(_0x42dc52,_0x111954,_0x136376){return db[_0x0da8('0x5f')]['count']({'where':{'ChatGroupId':_0x42dc52[_0x0da8('0x59')]['id'],'ToId':_0x42dc52[_0x0da8('0x60')]['id'],'read':![]}})[_0x0da8('0x22')](function(_0x1a3eb8){return{'id':_['toInteger'](_0x42dc52['params']['id']),'count':_0x1a3eb8};})[_0x0da8('0x22')](respondWithResult(_0x111954,null))[_0x0da8('0x2c')](handleError(_0x111954,null));};exports['addMembers']=function(_0x10a09e,_0x2b38fb,_0x1f1bd3){return db[_0x0da8('0x52')]['find']({'where':{'id':_0x10a09e[_0x0da8('0x59')]['id']}})[_0x0da8('0x22')](handleEntityNotFound(_0x2b38fb,null))[_0x0da8('0x22')](function(_0x99581e){if(_0x99581e){return _0x99581e[_0x0da8('0x61')](_0x10a09e[_0x0da8('0x5c')][_0x0da8('0x62')],_['omit'](_0x10a09e['body'],['ids','id'])||{});}})[_0x0da8('0x22')](respondWithResult(_0x2b38fb,null))['catch'](handleError(_0x2b38fb,null));};exports[_0x0da8('0x63')]=function(_0x2ed5fd,_0x35a111,_0x55419c){var _0x49de53={};var _0x4b673e={};var _0x59b81f;var _0xc73787;return db[_0x0da8('0x52')]['findOne']({'where':{'id':_0x2ed5fd[_0x0da8('0x59')]['id']}})[_0x0da8('0x22')](handleEntityNotFound(_0x35a111,null))['then'](function(_0x141106){if(_0x141106){_0x59b81f=_0x141106;_0x4b673e[_0x0da8('0x3f')]=_[_0x0da8('0x40')](db[_0x0da8('0x64')][_0x0da8('0x3e')]);_0x4b673e[_0x0da8('0x41')]=_['keys'](_0x2ed5fd[_0x0da8('0x41')]);_0x4b673e[_0x0da8('0x42')]=_['intersection'](_0x4b673e[_0x0da8('0x3f')],_0x4b673e[_0x0da8('0x41')]);_0x49de53[_0x0da8('0x44')]=_[_0x0da8('0x43')](_0x4b673e['model'],qs[_0x0da8('0x45')](_0x2ed5fd[_0x0da8('0x41')][_0x0da8('0x45')]));_0x49de53[_0x0da8('0x44')]=_0x49de53[_0x0da8('0x44')][_0x0da8('0x46')]?_0x49de53[_0x0da8('0x44')]:_0x4b673e[_0x0da8('0x3f')];_0x49de53[_0x0da8('0x49')]=qs['sort'](_0x2ed5fd[_0x0da8('0x41')][_0x0da8('0x4a')]);_0x49de53[_0x0da8('0x4b')]=qs[_0x0da8('0x42')](_[_0x0da8('0x65')](_0x2ed5fd[_0x0da8('0x41')],_0x4b673e['filters']));if(_0x2ed5fd[_0x0da8('0x41')]['filter']){_0x49de53['where']=_[_0x0da8('0x4c')](_0x49de53[_0x0da8('0x4b')],{'$or':_[_0x0da8('0x4d')](_0x49de53[_0x0da8('0x44')],function(_0x464ebb){var _0x53b8c3={};_0x53b8c3[_0x464ebb]={'$like':'%'+_0x2ed5fd[_0x0da8('0x41')][_0x0da8('0x50')]+'%'};return _0x53b8c3;})});}_0x49de53=_[_0x0da8('0x4c')]({},_0x49de53,_0x2ed5fd[_0x0da8('0x51')]);return _0x59b81f[_0x0da8('0x63')](_0x49de53);}})[_0x0da8('0x22')](function(_0x1c0c83){if(_0x1c0c83){_0xc73787=_0x1c0c83[_0x0da8('0x46')];if(!_0x2ed5fd[_0x0da8('0x41')]['hasOwnProperty'](_0x0da8('0x48'))){_0x49de53[_0x0da8('0x30')]=qs['limit'](_0x2ed5fd[_0x0da8('0x41')]['limit']);_0x49de53[_0x0da8('0x2f')]=qs[_0x0da8('0x2f')](_0x2ed5fd[_0x0da8('0x41')][_0x0da8('0x2f')]);}return _0x59b81f[_0x0da8('0x63')](_0x49de53);}})[_0x0da8('0x22')](function(_0x2bd854){if(_0x2bd854){return _0x2bd854?{'count':_0xc73787,'rows':_0x2bd854}:null;}})[_0x0da8('0x22')](respondWithResult(_0x35a111,null))[_0x0da8('0x2c')](handleError(_0x35a111,null));};exports['removeMembers']=function(_0x2ee3d7,_0x17357b,_0x157fde){return db[_0x0da8('0x52')][_0x0da8('0x5a')]({'where':{'id':_0x2ee3d7['params']['id']}})['then'](handleEntityNotFound(_0x17357b,null))['then'](function(_0x267180){if(_0x267180){return _0x267180[_0x0da8('0x66')](_0x2ee3d7[_0x0da8('0x41')]['ids']);}})['then'](respondWithStatusCode(_0x17357b,null))[_0x0da8('0x2c')](handleError(_0x17357b,null));};exports[_0x0da8('0x67')]=function(_0x3f65c7,_0x16850f,_0x3e7ea6){if(_0x3f65c7[_0x0da8('0x5c')]['id']){delete _0x3f65c7['body']['id'];}return db['ChatGroup'][_0x0da8('0x5a')]({'where':{'id':_0x3f65c7[_0x0da8('0x59')]['id']}})[_0x0da8('0x22')](handleEntityNotFound(_0x16850f,null))['then'](function(_0xee4932){if(_0xee4932){_0x3f65c7[_0x0da8('0x5c')][_0x0da8('0x68')]=_0xee4932['id'];return db[_0x0da8('0x5f')]['create'](_0x3f65c7[_0x0da8('0x5c')]);}})[_0x0da8('0x22')](respondWithResult(_0x16850f,null))['catch'](handleError(_0x16850f,null));};exports['getMessages']=function(_0x479966,_0x21decd,_0x38672f){var _0x340e3c={};var _0x552220={};var _0x5e96cb;var _0x30328a;return db['ChatGroup'][_0x0da8('0x69')]({'where':{'id':_0x479966[_0x0da8('0x59')]['id']}})[_0x0da8('0x22')](handleEntityNotFound(_0x21decd,null))[_0x0da8('0x22')](function(_0x39158b){if(_0x39158b){_0x5e96cb=_0x39158b;_0x552220[_0x0da8('0x3f')]=_[_0x0da8('0x40')](db[_0x0da8('0x5f')][_0x0da8('0x3e')]);_0x552220[_0x0da8('0x41')]=_[_0x0da8('0x40')](_0x479966[_0x0da8('0x41')]);_0x552220[_0x0da8('0x42')]=_[_0x0da8('0x43')](_0x552220[_0x0da8('0x3f')],_0x552220[_0x0da8('0x41')]);_0x340e3c[_0x0da8('0x44')]=_[_0x0da8('0x43')](_0x552220[_0x0da8('0x3f')],qs['fields'](_0x479966[_0x0da8('0x41')][_0x0da8('0x45')]));_0x340e3c['attributes']=_0x340e3c[_0x0da8('0x44')][_0x0da8('0x46')]?_0x340e3c[_0x0da8('0x44')]:_0x552220[_0x0da8('0x3f')];_0x340e3c[_0x0da8('0x49')]=qs[_0x0da8('0x4a')](_0x479966[_0x0da8('0x41')][_0x0da8('0x4a')]);_0x340e3c[_0x0da8('0x4b')]=qs[_0x0da8('0x42')](_['pick'](_0x479966['query'],_0x552220[_0x0da8('0x42')]));if(_0x479966[_0x0da8('0x41')]['filter']){_0x340e3c['where']=_[_0x0da8('0x4c')](_0x340e3c[_0x0da8('0x4b')],{'$or':_[_0x0da8('0x4d')](_0x340e3c['attributes'],function(_0x231a2f){var _0x490f5e={};_0x490f5e[_0x231a2f]={'$like':'%'+_0x479966[_0x0da8('0x41')][_0x0da8('0x50')]+'%'};return _0x490f5e;})});}if(_0x479966['query'][_0x0da8('0x6a')]){var _0xcba6fb=_0x479966[_0x0da8('0x41')][_0x0da8('0x6a')][_0x0da8('0x6b')](',');var _0x281c15={};_0x281c15[_0xcba6fb[0x0]]={'$gte':moment(_0xcba6fb[0x1])[_0x0da8('0x6c')](_0x0da8('0x6d'))};_0x340e3c['where']=_[_0x0da8('0x4c')](_0x340e3c[_0x0da8('0x4b')],_0x281c15);}_0x340e3c=_['merge']({},_0x340e3c,_0x479966[_0x0da8('0x51')]);return _0x5e96cb[_0x0da8('0x6e')](_0x340e3c);}})['then'](function(_0x1fdb31){if(_0x1fdb31){_0x30328a=_0x1fdb31[_0x0da8('0x46')];if(!_0x479966['query'][_0x0da8('0x47')]('nolimit')){_0x340e3c[_0x0da8('0x30')]=qs[_0x0da8('0x30')](_0x479966[_0x0da8('0x41')][_0x0da8('0x30')]);_0x340e3c[_0x0da8('0x2f')]=qs[_0x0da8('0x2f')](_0x479966[_0x0da8('0x41')][_0x0da8('0x2f')]);}return _0x5e96cb[_0x0da8('0x6e')](_0x340e3c);}})[_0x0da8('0x22')](function(_0x306511){if(_0x306511){return _0x306511?{'count':_0x30328a,'rows':_0x306511}:null;}})[_0x0da8('0x22')](respondWithResult(_0x21decd,null))['catch'](handleError(_0x21decd,null));}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js index d0a9120..de38c1c 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 _0xe6a8=['update','remove','emit','hasOwnProperty','exports','events','../../mysqldb','ChatGroup','setMaxListeners','save'];(function(_0x38f8d3,_0x4f226b){var _0x24faa3=function(_0x42aa5b){while(--_0x42aa5b){_0x38f8d3['push'](_0x38f8d3['shift']());}};_0x24faa3(++_0x4f226b);}(_0xe6a8,0x1c7));var _0x8e6a=function(_0x6649e7,_0x10e609){_0x6649e7=_0x6649e7-0x0;var _0x1634e8=_0xe6a8[_0x6649e7];return _0x1634e8;};'use strict';var EventEmitter=require(_0x8e6a('0x0'));var ChatGroup=require(_0x8e6a('0x1'))['db'][_0x8e6a('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x8e6a('0x3')](0x0);var events={'afterCreate':_0x8e6a('0x4'),'afterUpdate':_0x8e6a('0x5'),'afterDestroy':_0x8e6a('0x6')};function emitEvent(_0x527988){return function(_0x208608,_0x49399c,_0x2d26fd){ChatGroupEvents[_0x8e6a('0x7')](_0x527988+':'+_0x208608['id'],_0x208608);ChatGroupEvents[_0x8e6a('0x7')](_0x527988,_0x208608);_0x2d26fd(null);};}for(var e in events){if(events[_0x8e6a('0x8')](e)){var event=events[e];ChatGroup['hook'](e,emitEvent(event));}}module[_0x8e6a('0x9')]=ChatGroupEvents; \ No newline at end of file +var _0xceb1=['setMaxListeners','save','update','remove','emit','exports','events','../../mysqldb','ChatGroup'];(function(_0x1c7ce3,_0x560247){var _0x4f57cc=function(_0x2993f6){while(--_0x2993f6){_0x1c7ce3['push'](_0x1c7ce3['shift']());}};_0x4f57cc(++_0x560247);}(_0xceb1,0x8d));var _0x1ceb=function(_0x1c12f8,_0x4d76a9){_0x1c12f8=_0x1c12f8-0x0;var _0x53e492=_0xceb1[_0x1c12f8];return _0x53e492;};'use strict';var EventEmitter=require(_0x1ceb('0x0'));var ChatGroup=require(_0x1ceb('0x1'))['db'][_0x1ceb('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x1ceb('0x3')](0x0);var events={'afterCreate':_0x1ceb('0x4'),'afterUpdate':_0x1ceb('0x5'),'afterDestroy':_0x1ceb('0x6')};function emitEvent(_0x593bc2){return function(_0x435647,_0x43d8ba,_0x323bd0){ChatGroupEvents['emit'](_0x593bc2+':'+_0x435647['id'],_0x435647);ChatGroupEvents[_0x1ceb('0x7')](_0x593bc2,_0x435647);_0x323bd0(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatGroup['hook'](e,emitEvent(event));}}module[_0x1ceb('0x8')]=ChatGroupEvents; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js index 231bd32..4103576 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 _0x7c22=['lodash','util','api','moment','request-promise','path','./chatGroup.attributes','define','ChatGroup'];(function(_0x3c9999,_0x2cfc2d){var _0x3bc334=function(_0x592c7c){while(--_0x592c7c){_0x3c9999['push'](_0x3c9999['shift']());}};_0x3bc334(++_0x2cfc2d);}(_0x7c22,0x6c));var _0x27c2=function(_0x3da448,_0x3ae546){_0x3da448=_0x3da448-0x0;var _0x2e88f8=_0x7c22[_0x3da448];return _0x2e88f8;};'use strict';var _=require(_0x27c2('0x0'));var util=require(_0x27c2('0x1'));var logger=require('../../config/logger')(_0x27c2('0x2'));var moment=require(_0x27c2('0x3'));var BPromise=require('bluebird');var rp=require(_0x27c2('0x4'));var fs=require('fs');var path=require(_0x27c2('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x27c2('0x6'));module['exports']=function(_0x28548d,_0x5006bd){return _0x28548d[_0x27c2('0x7')](_0x27c2('0x8'),attributes,{'tableName':'chat_groups','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x885a=['util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./chatGroup.attributes','exports','define','ChatGroup'];(function(_0x75f869,_0x3690d6){var _0x10af8b=function(_0x22d3ff){while(--_0x22d3ff){_0x75f869['push'](_0x75f869['shift']());}};_0x10af8b(++_0x3690d6);}(_0x885a,0x180));var _0xa885=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x885a[_0x2c91e9];return _0x13f0ff;};'use strict';var _=require('lodash');var util=require(_0xa885('0x0'));var logger=require(_0xa885('0x1'))(_0xa885('0x2'));var moment=require(_0xa885('0x3'));var BPromise=require('bluebird');var rp=require(_0xa885('0x4'));var fs=require('fs');var path=require(_0xa885('0x5'));var rimraf=require(_0xa885('0x6'));var config=require(_0xa885('0x7'));var attributes=require(_0xa885('0x8'));module[_0xa885('0x9')]=function(_0x5dfd7e,_0x7ac6bd){return _0x5dfd7e[_0xa885('0xa')](_0xa885('0xb'),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 55823c0..229a8e5 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 _0x2c12=['then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./chatGroup.socket','register','request'];(function(_0x244a49,_0x22a349){var _0x2519c2=function(_0x3edc63){while(--_0x3edc63){_0x244a49['push'](_0x244a49['shift']());}};_0x2519c2(++_0x22a349);}(_0x2c12,0xf3));var _0x22c1=function(_0x2a0183,_0x3fc93c){_0x2a0183=_0x2a0183-0x0;var _0x158c3a=_0x2c12[_0x2a0183];return _0x158c3a;};'use strict';var _=require(_0x22c1('0x0'));var util=require(_0x22c1('0x1'));var moment=require(_0x22c1('0x2'));var BPromise=require(_0x22c1('0x3'));var rs=require(_0x22c1('0x4'));var fs=require('fs');var Redis=require(_0x22c1('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x22c1('0x6'))(_0x22c1('0x7'));var config=require('../../config/environment');var jayson=require(_0x22c1('0x8'));var client=jayson[_0x22c1('0x9')][_0x22c1('0xa')]({'port':0x232a});config['redis']=_[_0x22c1('0xb')](config[_0x22c1('0xc')],{'host':_0x22c1('0xd'),'port':0x18eb});var socket=require(_0x22c1('0xe'))(new Redis(config[_0x22c1('0xc')]));require(_0x22c1('0xf'))[_0x22c1('0x10')](socket);function respondWithRpcPromise(_0x5081f0,_0x51420a,_0x5abb74){return new BPromise(function(_0x4718fb,_0xe72bc6){return client[_0x22c1('0x11')](_0x5081f0,_0x5abb74)[_0x22c1('0x12')](function(_0x12db96){logger[_0x22c1('0x13')](_0x22c1('0x14'),_0x51420a,_0x22c1('0x15'));logger[_0x22c1('0x16')](_0x22c1('0x17'),_0x51420a,'request\x20sent',JSON[_0x22c1('0x18')](_0x12db96));if(_0x12db96[_0x22c1('0x19')]){if(_0x12db96['error'][_0x22c1('0x1a')]===0x1f4){logger['error']('ChatGroup,\x20%s,\x20%s',_0x51420a,_0x12db96[_0x22c1('0x19')][_0x22c1('0x1b')]);return _0xe72bc6(_0x12db96['error']['message']);}logger[_0x22c1('0x19')](_0x22c1('0x14'),_0x51420a,_0x12db96[_0x22c1('0x19')][_0x22c1('0x1b')]);return _0x4718fb(_0x12db96[_0x22c1('0x19')][_0x22c1('0x1b')]);}else{logger[_0x22c1('0x13')](_0x22c1('0x14'),_0x51420a,'request\x20sent');_0x4718fb(_0x12db96[_0x22c1('0x1c')][_0x22c1('0x1b')]);}})['catch'](function(_0x166cbf){logger[_0x22c1('0x19')](_0x22c1('0x14'),_0x51420a,_0x166cbf);_0xe72bc6(_0x166cbf);});});} \ No newline at end of file +var _0xcdfe=['./chatGroup.socket','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','error','code','message','catch','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter'];(function(_0x5bbfc9,_0x3a0f20){var _0x52a9ba=function(_0x57aff5){while(--_0x57aff5){_0x5bbfc9['push'](_0x5bbfc9['shift']());}};_0x52a9ba(++_0x3a0f20);}(_0xcdfe,0x1c3));var _0xecdf=function(_0x45bcfe,_0x618e1c){_0x45bcfe=_0x45bcfe-0x0;var _0x7a17d4=_0xcdfe[_0x45bcfe];return _0x7a17d4;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xecdf('0x0'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xecdf('0x1'))['db'];var utils=require('../../config/utils');var logger=require(_0xecdf('0x2'))(_0xecdf('0x3'));var config=require(_0xecdf('0x4'));var jayson=require(_0xecdf('0x5'));var client=jayson['client'][_0xecdf('0x6')]({'port':0x232a});config[_0xecdf('0x7')]=_[_0xecdf('0x8')](config[_0xecdf('0x7')],{'host':_0xecdf('0x9'),'port':0x18eb});var socket=require(_0xecdf('0xa'))(new Redis(config[_0xecdf('0x7')]));require(_0xecdf('0xb'))['register'](socket);function respondWithRpcPromise(_0x3e8fae,_0x404df5,_0x58f30b){return new BPromise(function(_0xb3d7ff,_0x21194e){return client['request'](_0x3e8fae,_0x58f30b)[_0xecdf('0xc')](function(_0x335baa){logger[_0xecdf('0xd')](_0xecdf('0xe'),_0x404df5,_0xecdf('0xf'));logger[_0xecdf('0x10')](_0xecdf('0x11'),_0x404df5,_0xecdf('0xf'),JSON['stringify'](_0x335baa));if(_0x335baa[_0xecdf('0x12')]){if(_0x335baa[_0xecdf('0x12')][_0xecdf('0x13')]===0x1f4){logger[_0xecdf('0x12')]('ChatGroup,\x20%s,\x20%s',_0x404df5,_0x335baa[_0xecdf('0x12')][_0xecdf('0x14')]);return _0x21194e(_0x335baa['error'][_0xecdf('0x14')]);}logger[_0xecdf('0x12')]('ChatGroup,\x20%s,\x20%s',_0x404df5,_0x335baa['error'][_0xecdf('0x14')]);return _0xb3d7ff(_0x335baa[_0xecdf('0x12')][_0xecdf('0x14')]);}else{logger['info']('ChatGroup,\x20%s,\x20%s',_0x404df5,'request\x20sent');_0xb3d7ff(_0x335baa['result'][_0xecdf('0x14')]);}})[_0xecdf('0x15')](function(_0x8b8e17){logger['error']('ChatGroup,\x20%s,\x20%s',_0x404df5,_0x8b8e17);_0x21194e(_0x8b8e17);});});} \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js index 9232330..8b05686 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 _0xe603=['save','remove','update','emit','removeListener','register','length','./chatGroup.events'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xe603,0x16f));var _0x3e60=function(_0x29e513,_0x44cb99){_0x29e513=_0x29e513-0x0;var _0x70792b=_0xe603[_0x29e513];return _0x70792b;};'use strict';var ChatGroupEvents=require(_0x3e60('0x0'));var events=[_0x3e60('0x1'),_0x3e60('0x2'),_0x3e60('0x3')];function createListener(_0x581ba1,_0x1d5e39){return function(_0x5663dd){_0x1d5e39[_0x3e60('0x4')](_0x581ba1,_0x5663dd);};}function removeListener(_0xb48900,_0x324ced){return function(){ChatGroupEvents[_0x3e60('0x5')](_0xb48900,_0x324ced);};}exports[_0x3e60('0x6')]=function(_0x195b6e){for(var _0x4d619a=0x0,_0x73dc04=events[_0x3e60('0x7')];_0x4d619a<_0x73dc04;_0x4d619a++){var _0x353dfc=events[_0x4d619a];var _0x5d3467=createListener('chatGroup:'+_0x353dfc,_0x195b6e);ChatGroupEvents['on'](_0x353dfc,_0x5d3467);}}; \ No newline at end of file +var _0xc495=['emit','removeListener','register','length','chatGroup:','remove','update'];(function(_0x4221e0,_0x474373){var _0x3e5d3c=function(_0x1c1874){while(--_0x1c1874){_0x4221e0['push'](_0x4221e0['shift']());}};_0x3e5d3c(++_0x474373);}(_0xc495,0x7c));var _0x5c49=function(_0x2c0af1,_0x4b5709){_0x2c0af1=_0x2c0af1-0x0;var _0x53fe48=_0xc495[_0x2c0af1];return _0x53fe48;};'use strict';var ChatGroupEvents=require('./chatGroup.events');var events=['save',_0x5c49('0x0'),_0x5c49('0x1')];function createListener(_0x17958a,_0x26c214){return function(_0x4ce9ea){_0x26c214[_0x5c49('0x2')](_0x17958a,_0x4ce9ea);};}function removeListener(_0x5f1f27,_0x51ab93){return function(){ChatGroupEvents[_0x5c49('0x3')](_0x5f1f27,_0x51ab93);};}exports[_0x5c49('0x4')]=function(_0x434dfa){for(var _0x40eeb3=0x0,_0x356d76=events[_0x5c49('0x5')];_0x40eeb3<_0x356d76;_0x40eeb3++){var _0xcc0216=events[_0x40eeb3];var _0x157826=createListener(_0x5c49('0x6')+_0xcc0216,_0x434dfa);ChatGroupEvents['on'](_0xcc0216,_0x157826);}}; \ No newline at end of file diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js index 800970e..d7459b0 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 _0xe8f3=['index','get','describe','/:id','/:id/unread','getUnread','/:id/members','getMembers','/:id/messages','getMessages','post','addMembers','addMessage','put','delete','destroy','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatGroup.controller','isAuthenticated'];(function(_0x5c6299,_0x11bd28){var _0x23b564=function(_0x329ed6){while(--_0x329ed6){_0x5c6299['push'](_0x5c6299['shift']());}};_0x23b564(++_0x11bd28);}(_0xe8f3,0xc6));var _0x3e8f=function(_0x3b6320,_0x43164f){_0x3b6320=_0x3b6320-0x0;var _0x5c70a4=_0xe8f3[_0x3b6320];return _0x5c70a4;};'use strict';var multer=require('multer');var util=require(_0x3e8f('0x0'));var path=require(_0x3e8f('0x1'));var timeout=require(_0x3e8f('0x2'));var express=require(_0x3e8f('0x3'));var router=express[_0x3e8f('0x4')]();var auth=require(_0x3e8f('0x5'));var interaction=require(_0x3e8f('0x6'));var config=require(_0x3e8f('0x7'));var controller=require(_0x3e8f('0x8'));router['get']('/',auth[_0x3e8f('0x9')](),controller[_0x3e8f('0xa')]);router[_0x3e8f('0xb')]('/describe',auth[_0x3e8f('0x9')](),controller[_0x3e8f('0xc')]);router[_0x3e8f('0xb')](_0x3e8f('0xd'),auth['isAuthenticated'](),controller['show']);router[_0x3e8f('0xb')](_0x3e8f('0xe'),auth[_0x3e8f('0x9')](),controller[_0x3e8f('0xf')]);router[_0x3e8f('0xb')](_0x3e8f('0x10'),auth[_0x3e8f('0x9')](),controller[_0x3e8f('0x11')]);router[_0x3e8f('0xb')](_0x3e8f('0x12'),auth[_0x3e8f('0x9')](),controller[_0x3e8f('0x13')]);router[_0x3e8f('0x14')]('/',auth[_0x3e8f('0x9')](),controller['create']);router[_0x3e8f('0x14')]('/:id/members',auth[_0x3e8f('0x9')](),controller[_0x3e8f('0x15')]);router[_0x3e8f('0x14')](_0x3e8f('0x12'),auth[_0x3e8f('0x9')](),controller[_0x3e8f('0x16')]);router[_0x3e8f('0x17')](_0x3e8f('0xd'),auth[_0x3e8f('0x9')](),controller['update']);router[_0x3e8f('0x18')](_0x3e8f('0xd'),auth[_0x3e8f('0x9')](),controller[_0x3e8f('0x19')]);router[_0x3e8f('0x18')](_0x3e8f('0x10'),auth[_0x3e8f('0x9')](),controller['removeMembers']);module['exports']=router; \ No newline at end of file +var _0x2ec0=['post','addMembers','addMessage','put','update','delete','destroy','removeMembers','exports','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatGroup.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/unread','getUnread','/:id/members','getMembers','/:id/messages','getMessages'];(function(_0x1c3be5,_0x43a6ae){var _0x57b3a5=function(_0x5e5f3d){while(--_0x5e5f3d){_0x1c3be5['push'](_0x1c3be5['shift']());}};_0x57b3a5(++_0x43a6ae);}(_0x2ec0,0x117));var _0x02ec=function(_0x339129,_0x86dcc6){_0x339129=_0x339129-0x0;var _0x1570df=_0x2ec0[_0x339129];return _0x1570df;};'use strict';var multer=require('multer');var util=require(_0x02ec('0x0'));var path=require(_0x02ec('0x1'));var timeout=require(_0x02ec('0x2'));var express=require(_0x02ec('0x3'));var router=express['Router']();var auth=require(_0x02ec('0x4'));var interaction=require(_0x02ec('0x5'));var config=require(_0x02ec('0x6'));var controller=require(_0x02ec('0x7'));router[_0x02ec('0x8')]('/',auth[_0x02ec('0x9')](),controller[_0x02ec('0xa')]);router[_0x02ec('0x8')](_0x02ec('0xb'),auth[_0x02ec('0x9')](),controller[_0x02ec('0xc')]);router[_0x02ec('0x8')](_0x02ec('0xd'),auth[_0x02ec('0x9')](),controller[_0x02ec('0xe')]);router[_0x02ec('0x8')](_0x02ec('0xf'),auth[_0x02ec('0x9')](),controller[_0x02ec('0x10')]);router['get'](_0x02ec('0x11'),auth[_0x02ec('0x9')](),controller[_0x02ec('0x12')]);router['get'](_0x02ec('0x13'),auth[_0x02ec('0x9')](),controller[_0x02ec('0x14')]);router[_0x02ec('0x15')]('/',auth[_0x02ec('0x9')](),controller['create']);router[_0x02ec('0x15')](_0x02ec('0x11'),auth[_0x02ec('0x9')](),controller[_0x02ec('0x16')]);router[_0x02ec('0x15')](_0x02ec('0x13'),auth[_0x02ec('0x9')](),controller[_0x02ec('0x17')]);router[_0x02ec('0x18')](_0x02ec('0xd'),auth[_0x02ec('0x9')](),controller[_0x02ec('0x19')]);router[_0x02ec('0x1a')](_0x02ec('0xd'),auth[_0x02ec('0x9')](),controller[_0x02ec('0x1b')]);router['delete'](_0x02ec('0x11'),auth[_0x02ec('0x9')](),controller[_0x02ec('0x1c')]);module[_0x02ec('0x1d')]=router; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js index caf930c..9ef0730 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 _0x102b=['thumb','TEXT','STRING','long','DATE','out','exports','INTEGER','ENUM','star'];(function(_0x487c8f,_0x310704){var _0xe20c5f=function(_0x40fc9d){while(--_0x40fc9d){_0x487c8f['push'](_0x487c8f['shift']());}};_0xe20c5f(++_0x310704);}(_0x102b,0x1be));var _0xb102=function(_0x1d02a2,_0x452270){_0x1d02a2=_0x1d02a2-0x0;var _0x1e6d2e=_0x102b[_0x1d02a2];return _0x1e6d2e;};'use strict';var Sequelize=require('sequelize');module[_0xb102('0x0')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0xb102('0x1')]},'ratingType':{'type':Sequelize[_0xb102('0x2')](_0xb102('0x3'),_0xb102('0x4')),'defaultValue':_0xb102('0x3')},'ratingMessage':{'type':Sequelize[_0xb102('0x5')]},'pathTranscript':{'type':Sequelize[_0xb102('0x5')]},'mailTranscript':{'type':Sequelize[_0xb102('0x6')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0xb102('0x6')]},'note':{'type':Sequelize[_0xb102('0x6')]},'browserName':{'type':Sequelize[_0xb102('0x6')]},'browserVersion':{'type':Sequelize[_0xb102('0x6')]},'osName':{'type':Sequelize[_0xb102('0x6')]},'osVersion':{'type':Sequelize['STRING']},'deviceModel':{'type':Sequelize[_0xb102('0x6')]},'deviceVendor':{'type':Sequelize['STRING']},'deviceType':{'type':Sequelize['STRING']},'referer':{'type':Sequelize[_0xb102('0x5')]},'customerIp':{'type':Sequelize['STRING']},'formData':{'type':Sequelize['TEXT'](_0xb102('0x7'))},'read1stAt':{'type':Sequelize[_0xb102('0x8')]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0xb102('0x2')]('in',_0xb102('0x9')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0xb102('0x6')]},'customerPort':{'type':Sequelize[_0xb102('0x6')]}}; \ No newline at end of file +var _0x5e11=['sequelize','BOOLEAN','INTEGER','ENUM','star','thumb','TEXT','DATE','STRING','long','out'];(function(_0x2080a3,_0x48acfa){var _0x8d7d17=function(_0x2dbc06){while(--_0x2dbc06){_0x2080a3['push'](_0x2080a3['shift']());}};_0x8d7d17(++_0x48acfa);}(_0x5e11,0x1c3));var _0x15e1=function(_0x2becba,_0x4ea656){_0x2becba=_0x2becba-0x0;var _0x90b5dd=_0x5e11[_0x2becba];return _0x90b5dd;};'use strict';var Sequelize=require(_0x15e1('0x0'));module['exports']={'closed':{'type':Sequelize[_0x15e1('0x1')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x15e1('0x2')]},'ratingType':{'type':Sequelize[_0x15e1('0x3')](_0x15e1('0x4'),_0x15e1('0x5')),'defaultValue':_0x15e1('0x4')},'ratingMessage':{'type':Sequelize['TEXT']},'pathTranscript':{'type':Sequelize[_0x15e1('0x6')]},'mailTranscript':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x15e1('0x7')]},'disposition':{'type':Sequelize[_0x15e1('0x8')]},'note':{'type':Sequelize[_0x15e1('0x8')]},'browserName':{'type':Sequelize[_0x15e1('0x8')]},'browserVersion':{'type':Sequelize[_0x15e1('0x8')]},'osName':{'type':Sequelize['STRING']},'osVersion':{'type':Sequelize[_0x15e1('0x8')]},'deviceModel':{'type':Sequelize[_0x15e1('0x8')]},'deviceVendor':{'type':Sequelize[_0x15e1('0x8')]},'deviceType':{'type':Sequelize[_0x15e1('0x8')]},'referer':{'type':Sequelize['TEXT']},'customerIp':{'type':Sequelize[_0x15e1('0x8')]},'formData':{'type':Sequelize[_0x15e1('0x6')](_0x15e1('0x9'))},'read1stAt':{'type':Sequelize['DATE']},'lastMsgAt':{'type':Sequelize[_0x15e1('0x7')]},'lastMsgDirection':{'type':Sequelize[_0x15e1('0x3')]('in',_0x15e1('0xa')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x15e1('0x8')]},'customerPort':{'type':Sequelize[_0x15e1('0x8')]}}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js index 97cb060..2c20031 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 _0x3e68=['i.*','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','GROUP_CONCAT(DISTINCT\x20t.id)','it.ChatInteractionId\x20=\x20i.id','ui.ChatInteractionId\x20IN\x20?','groupBy','ChatInteractionId','all','rows','show','params','includeAll','include','create','body','find','describe','customUpdate','abandon','sendStatus','ValidationError','Interaction\x20already\x20assigned','closed','disposition','attachmentUpload','file','basename','filename','type','mimetype','Attachment','findOne','Unauthorized','root','close','mailTranscript','format','pathTranscript','ChatMessage','Messages','User','CmContact','ContactId','UserId','%s%d','agentAlias','customer','agentIdentifier','System','agent_alias','fullname','agent_fullname','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','direction','secret','Smtp','service','host','port','authentication','auth','user','SendMail','sendMail','\x22%s\x22\x20<%s>','email','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','getMessages','$gte','YYYY-MM-DD\x20HH:mm:ss','getMyMessages','includeAgent','alias','findAll','addTags','setTags','Tag','emit','chatInteractionTags:save','removeTags','unix','server','files','tmp','attachments','transcript-%d-%s.zip','Contact','firstName','lastName','ChatWebsite','Owner','get','40px','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
Interaction\x20Transcript
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','30px','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{{page}}/{{pages}}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','YYYY-MM-DD','mkdirSync','Account','N.A.','closedAt','osName','customerIp','customerPort','tail','createReadStream','createWriteStream','out','renderFile','views','downloadInteraction.html','transcript-','.pdf','download','err','unlinkSync','html-pdf','eml-format','rimraf','fast-json-patch','mustache','util','path','sox','to-csv','ejs','squel','jsforce','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','jayson/promise','client','http','test','then','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','end','json','count','offset','limit','Content-Range','apply','reject','save','update','destroy','status','stack','name','send','Users','map','TagIds','split','forEach','Tags','push','ChatInteraction','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','select','field','color','from','u.id','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','me.ChatInteractionId\x20=\x20i.id','expr','advancedFilter','matchType','substr','omit','omitBy','options','custom','columns','hasMultipleConditions','value','values','table','getConditionValue','isRangeCondition','parseOperator','having','$between','`\x20>\x200','isNil','ChatWebsiteId','i.ChatWebsiteId\x20IN\x20?','createdAt','parse','$lte','\x20IS\x20NULL','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','filter','replace','\x27\x27\x27\x27','i.id\x20LIKE\x20?','join','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','Sequelize','QueryTypes','i.id','unreadMessages','DESC','tag','isArray','chat_interaction_has_tags','tools_tags','t.id\x20=\x20it.TagId','t.id\x20IN\x20?','TagId','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','mail_interaction_has_tags','it.MailInteractionId\x20=\x20i.id','sequelize','toString','merge','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.mandatoryDisposition'];(function(_0x41cdcf,_0x5402c7){var _0x57651d=function(_0x26c39b){while(--_0x26c39b){_0x41cdcf['push'](_0x41cdcf['shift']());}};_0x57651d(++_0x5402c7);}(_0x3e68,0x82));var _0x83e6=function(_0x5e4cb0,_0x4dcfd4){_0x5e4cb0=_0x5e4cb0-0x0;var _0x45d913=_0x3e68[_0x5e4cb0];return _0x45d913;};'use strict';var pdf=require(_0x83e6('0x0'));var emlformat=require(_0x83e6('0x1'));var rimraf=require(_0x83e6('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x83e6('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x83e6('0x4'));var util=require(_0x83e6('0x5'));var path=require(_0x83e6('0x6'));var sox=require(_0x83e6('0x7'));var csv=require(_0x83e6('0x8'));var ejs=require(_0x83e6('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0x83e6('0xa'));var crypto=require('crypto');var jsforce=require(_0x83e6('0xb'));var deskjs=require(_0x83e6('0xc'));var toCsv=require(_0x83e6('0x8'));var querystring=require('querystring');var Papa=require(_0x83e6('0xd'));var Redis=require(_0x83e6('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x83e6('0xf'));var hardwareService=require(_0x83e6('0x10'));var logger=require(_0x83e6('0x11'))(_0x83e6('0x12'));var utils=require(_0x83e6('0x13'));var config=require(_0x83e6('0x14'));var db=require('../../mysqldb')['db'];config[_0x83e6('0x15')]=_[_0x83e6('0x16')](config[_0x83e6('0x15')],{'host':_0x83e6('0x17'),'port':0x18eb});var socket=require(_0x83e6('0x18'))(new Redis(config[_0x83e6('0x15')]));require(_0x83e6('0x19'))['register'](socket);var jayson=require(_0x83e6('0x1a'));var client=jayson[_0x83e6('0x1b')][_0x83e6('0x1c')]({'port':0x232b});var client9004=jayson[_0x83e6('0x1b')][_0x83e6('0x1c')]({'port':0x232c});function checkPasswordPattern(_0x393b3d,_0x53b95e,_0x128a90){if(_0x128a90){var _0xfe0ba1=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0xfe0ba1[_0x83e6('0x1d')](_0x53b95e)){return _0x393b3d;}else{throw new Error('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x393b3d;}}function respondWithRpcPromise(_0xe717fb,_0x5659bc,_0x257fbe,_0x22a467){return new BPromise(function(_0x30516c,_0x71fd47){var _0x4e4e0f=_0x22a467||client;return _0x4e4e0f['request'](_0xe717fb,_0x257fbe)[_0x83e6('0x1e')](function(_0x44fe63){logger['info'](_0x83e6('0x1f'),_0x5659bc,_0x83e6('0x20'));logger[_0x83e6('0x21')](_0x83e6('0x22'),_0x5659bc,_0x83e6('0x20'),JSON[_0x83e6('0x23')](_0x44fe63));if(_0x44fe63[_0x83e6('0x24')]){if(_0x44fe63[_0x83e6('0x24')][_0x83e6('0x25')]===0x1f4){logger[_0x83e6('0x24')](_0x83e6('0x1f'),_0x5659bc,_0x44fe63[_0x83e6('0x24')][_0x83e6('0x26')]);return _0x71fd47(_0x44fe63['error']['message']);}logger[_0x83e6('0x24')](_0x83e6('0x1f'),_0x5659bc,_0x44fe63[_0x83e6('0x24')]['message']);return _0x30516c(_0x44fe63[_0x83e6('0x24')]['message']);}else{logger[_0x83e6('0x27')](_0x83e6('0x1f'),_0x5659bc,_0x83e6('0x20'));_0x30516c(_0x44fe63[_0x83e6('0x28')][_0x83e6('0x26')]);}})[_0x83e6('0x29')](function(_0x467ae5){logger[_0x83e6('0x24')]('ChatInteraction,\x20%s,\x20%s',_0x5659bc,_0x467ae5);_0x71fd47(_0x467ae5);});});}function respondWithStatusCode(_0x28e2ce,_0x3d94da){_0x3d94da=_0x3d94da||0xcc;return function(_0x14012a){if(_0x14012a){return _0x28e2ce['sendStatus'](_0x3d94da);}return _0x28e2ce['status'](_0x3d94da)[_0x83e6('0x2a')]();};}function respondWithResult(_0x38fd4d,_0x4b820a){_0x4b820a=_0x4b820a||0xc8;return function(_0x546ed5){if(_0x546ed5){return _0x38fd4d['status'](_0x4b820a)[_0x83e6('0x2b')](_0x546ed5);}};}function respondWithFilteredResult(_0x5026f1,_0x186435){return function(_0x3fbdd9){if(_0x3fbdd9){var _0x2bddb7=_0x3fbdd9[_0x83e6('0x2c')],_0x2a3a25=_0x186435[_0x83e6('0x2d')],_0x308273=_0x186435[_0x83e6('0x2d')]+_0x186435[_0x83e6('0x2e')],_0x540e5f;if(_0x308273>=_0x2bddb7){_0x308273=_0x2bddb7;_0x540e5f=0xc8;}else{_0x540e5f=0xce;}_0x5026f1['status'](_0x540e5f);return _0x5026f1['set'](_0x83e6('0x2f'),_0x2a3a25+'-'+_0x308273+'/'+_0x2bddb7)[_0x83e6('0x2b')](_0x3fbdd9);}return null;};}function patchUpdates(_0x373e26){return function(_0x49afda){try{jsonpatch[_0x83e6('0x30')](_0x49afda,_0x373e26,!![]);}catch(_0x144513){return BPromise[_0x83e6('0x31')](_0x144513);}return _0x49afda[_0x83e6('0x32')]();};}function saveUpdates(_0x26bb09,_0x1ed29f){return function(_0x4ff8b4){if(_0x4ff8b4){return _0x4ff8b4[_0x83e6('0x33')](_0x26bb09)['then'](function(_0x156fb7){return _0x156fb7;});}return null;};}function removeEntity(_0x39efe9,_0x5b4bc5){return function(_0xa279c0){if(_0xa279c0){return _0xa279c0[_0x83e6('0x34')]()['then'](function(){_0x39efe9[_0x83e6('0x35')](0xcc)[_0x83e6('0x2a')]();});}};}function handleEntityNotFound(_0x483f8d,_0x2652ad){return function(_0x171739){if(!_0x171739){_0x483f8d['sendStatus'](0x194);}return _0x171739;};}function handleError(_0x542048,_0x516b34){_0x516b34=_0x516b34||0x1f4;return function(_0x10f199){logger[_0x83e6('0x24')](_0x10f199[_0x83e6('0x36')]);if(_0x10f199[_0x83e6('0x37')]){delete _0x10f199[_0x83e6('0x37')];}_0x542048[_0x83e6('0x35')](_0x516b34)[_0x83e6('0x38')](_0x10f199);};}function getInteractionUsers(_0x56a004,_0x3645c0){return new BPromise(function(_0x43f6ad,_0x436ac3){try{if(_0x3645c0[_0x56a004['id']]){_0x56a004[_0x83e6('0x39')]=_[_0x83e6('0x3a')](_0x3645c0[_0x56a004['id']],function(_0x1f57fd){return{'id':_0x1f57fd['id']};});}}catch(_0x5f2631){_0x436ac3(_0x5f2631);}_0x43f6ad(_0x56a004);});}function getInteractionTags(_0x4811a8,_0x56f51f){return new BPromise(function(_0x1b6344,_0x521fa8){try{if(_0x4811a8[_0x83e6('0x3b')]){_0x4811a8['Tags']=[];_0x4811a8[_0x83e6('0x3b')][_0x83e6('0x3c')](',')[_0x83e6('0x3d')](function(_0x4dd95c){_0x4811a8[_0x83e6('0x3e')][_0x83e6('0x3f')](_0x56f51f[_0x4dd95c]);});}delete _0x4811a8[_0x83e6('0x3b')];}catch(_0x56b370){_0x521fa8(_0x56b370);}_0x1b6344(_0x4811a8);});}function updateChatInteraction(_0x38d016,_0xd2ed9e,_0x1b6c28){return new BPromise(function(_0x5d8333,_0x4b13d2){return getInteractionUsers(_0x38d016,_0x1b6c28)[_0x83e6('0x1e')](function(_0x58c190){return getInteractionTags(_0x58c190,_0xd2ed9e);})[_0x83e6('0x1e')](function(_0x5568fb){_0x5d8333(_0x5568fb);})['catch'](function(_0x3ce12b){_0x4b13d2(_0x3ce12b);});});}exports['index']=function(_0x1f9d7e,_0x27aad){var _0x5e640f={},_0x177ca4={},_0x27a617={'count':0x0,'rows':[]};var _0x3c9ec0=db[_0x83e6('0x40')][_0x83e6('0x41')];_0x177ca4[_0x83e6('0x42')]=_[_0x83e6('0x43')](_0x3c9ec0);_0x177ca4['query']=_[_0x83e6('0x43')](_0x1f9d7e[_0x83e6('0x44')]);_0x177ca4[_0x83e6('0x45')]=_[_0x83e6('0x46')](_0x177ca4[_0x83e6('0x42')],_0x177ca4[_0x83e6('0x44')]);_0x5e640f[_0x83e6('0x47')]=_[_0x83e6('0x46')](_0x177ca4[_0x83e6('0x42')],qs['fields'](_0x1f9d7e[_0x83e6('0x44')][_0x83e6('0x48')]));_0x5e640f[_0x83e6('0x47')]=_0x5e640f[_0x83e6('0x47')][_0x83e6('0x49')]?_0x5e640f[_0x83e6('0x47')]:_0x177ca4[_0x83e6('0x42')];if(!_0x1f9d7e[_0x83e6('0x44')][_0x83e6('0x4a')](_0x83e6('0x4b'))){_0x5e640f[_0x83e6('0x2e')]=qs[_0x83e6('0x2e')](_0x1f9d7e[_0x83e6('0x44')][_0x83e6('0x2e')]);_0x5e640f[_0x83e6('0x2d')]=qs['offset'](_0x1f9d7e[_0x83e6('0x44')][_0x83e6('0x2d')]);}_0x5e640f[_0x83e6('0x4c')]=qs[_0x83e6('0x4d')](_0x1f9d7e[_0x83e6('0x44')][_0x83e6('0x4d')]);_0x5e640f[_0x83e6('0x4e')]=qs[_0x83e6('0x45')](_[_0x83e6('0x4f')](_0x1f9d7e[_0x83e6('0x44')],_0x177ca4['filters']));var _0xdac6e4=[];var _0x107d7d=squel[_0x83e6('0x50')]()[_0x83e6('0x51')]('id')[_0x83e6('0x51')]('name')[_0x83e6('0x51')](_0x83e6('0x52'))[_0x83e6('0x53')]('tools_tags');var _0x2aa358=squel[_0x83e6('0x50')]()[_0x83e6('0x51')](_0x83e6('0x54'))[_0x83e6('0x51')]('ui.ChatInteractionId')[_0x83e6('0x53')](_0x83e6('0x55'),'ui')[_0x83e6('0x56')](_0x83e6('0x57'),'u','u.id\x20=\x20ui.UserId');var _0x4d1a08=squel[_0x83e6('0x50')]()[_0x83e6('0x53')](_0x83e6('0x58'),'i')['left_join'](_0x83e6('0x59'),'c',_0x83e6('0x5a'))['left_join'](_0x83e6('0x57'),'o',_0x83e6('0x5b'))[_0x83e6('0x56')](_0x83e6('0x5c'),'a',_0x83e6('0x5d'))['left_join']('chat_messages','me',_0x83e6('0x5e'));var _0x3d82a4=squel[_0x83e6('0x5f')]();var _0x483ea3=_0x1f9d7e[_0x83e6('0x44')][_0x83e6('0x60')]?JSON['parse'](_0x1f9d7e[_0x83e6('0x44')][_0x83e6('0x60')]):undefined;if(_0x483ea3){var _0x9954a6=_0x483ea3[_0x83e6('0x61')][_0x83e6('0x62')](0x1);_(_0x483ea3)[_0x83e6('0x63')](_0x83e6('0x61'))[_0x83e6('0x64')](function(_0xde46f8,_0x4c28ce){return _0xde46f8[_0x83e6('0x65')][_0x83e6('0x66')]===!![];})[_0x83e6('0x43')]()[_0x83e6('0x3d')](function(_0x5c7969){var _0xd38298=_0x483ea3[_0x5c7969];if(_0xd38298['options'][_0x83e6('0x67')]){var _0x1d789e=squel[_0x83e6('0x5f')]();if(as[_0x83e6('0x68')](_0xd38298[_0x83e6('0x69')])){var _0x2b4816=_[_0x83e6('0x6a')](_0xd38298[_0x83e6('0x69')])[0x0];_0x2b4816['forEach'](function(_0x3945ec){_0xd38298[_0x83e6('0x65')][_0x83e6('0x67')]['forEach'](function(_0x46b195){_0x1d789e['or'](_0xd38298[_0x83e6('0x65')][_0x83e6('0x6b')]+'.'+_0x46b195+'\x20'+as['parseOperator'](_0x3945ec),as[_0x83e6('0x6c')](_0x3945ec));});});}else{var _0x957ce2=as[_0x83e6('0x6d')](_0xd38298['value'])?_0xd38298[_0x83e6('0x69')][0x1]:undefined;_0xd38298[_0x83e6('0x65')]['columns'][_0x83e6('0x3d')](function(_0x4bcdb1){_0x1d789e['or'](_0xd38298[_0x83e6('0x65')][_0x83e6('0x6b')]+'.'+_0x4bcdb1+'\x20'+as[_0x83e6('0x6e')](_0xd38298[_0x83e6('0x69')]),as[_0x83e6('0x6c')](_0xd38298[_0x83e6('0x69')]),_0x957ce2);});}_0x3d82a4[_0x9954a6](_0x1d789e);}else if(as['hasMultipleConditions'](_0xd38298['value'])){var _0x2b4816=_[_0x83e6('0x6a')](_0xd38298[_0x83e6('0x69')])[0x0];_0x2b4816[_0x83e6('0x3d')](function(_0x4c51cf){if(!_0xd38298[_0x83e6('0x65')][_0x83e6('0x6f')]){var _0x160a3c=as[_0x83e6('0x6d')](_0x4c51cf)?_0x4c51cf[_0x83e6('0x70')][0x1]:undefined;_0x3d82a4[_0x9954a6](_0xd38298[_0x83e6('0x65')]['table']+'.'+_0x5c7969+'\x20'+as[_0x83e6('0x6e')](_0x4c51cf),as[_0x83e6('0x6c')](_0x4c51cf),_0x160a3c);}});}else{if(_0xd38298[_0x83e6('0x65')]['having']){var _0x2ffb3d=as[_0x83e6('0x6c')](_0xd38298[_0x83e6('0x69')]);if(_0x2ffb3d['length']===0x1){if(_0x2ffb3d==0x1){_0x4d1a08[_0x83e6('0x6f')]('`'+_0x5c7969+'`\x20=\x200');}else{_0x4d1a08[_0x83e6('0x6f')]('`'+_0x5c7969+_0x83e6('0x71'));}}}else{var _0x957ce2=as[_0x83e6('0x6d')](_0xd38298['value'])?_0xd38298[_0x83e6('0x69')][_0x83e6('0x70')][0x1]:undefined;_0x3d82a4[_0x9954a6](_0xd38298[_0x83e6('0x65')][_0x83e6('0x6b')]+'.'+_0x5c7969+'\x20'+as[_0x83e6('0x6e')](_0xd38298[_0x83e6('0x69')]),as[_0x83e6('0x6c')](_0xd38298['value']),_0x957ce2);}}});}else{var _0x4ce7cc=_(Object[_0x83e6('0x43')](_0x1f9d7e[_0x83e6('0x44')]))[_0x83e6('0x3a')](function(_0x5be714){return _0x3c9ec0[_0x83e6('0x4a')](_0x5be714)?_0x5be714:undefined;})['filter'](function(_0x35fa88){return!_[_0x83e6('0x72')](_0x35fa88);})[_0x83e6('0x69')]();if(!_['isEmpty'](_0x4ce7cc)){_0x4ce7cc[_0x83e6('0x3d')](function(_0x195d9d){if(_0x195d9d===_0x83e6('0x73')){_0x4d1a08['where'](_0x83e6('0x74'),[]['concat'](_0x1f9d7e[_0x83e6('0x44')][_0x195d9d]));}else if(_0x195d9d===_0x83e6('0x75')){var _0x2d70c1=JSON[_0x83e6('0x76')](_0x1f9d7e[_0x83e6('0x44')][_0x195d9d])['$gte'];var _0x4269a3=JSON['parse'](_0x1f9d7e[_0x83e6('0x44')][_0x195d9d])[_0x83e6('0x77')];_0x4d1a08[_0x83e6('0x4e')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x2d70c1,_0x4269a3);}else{if(_0x1f9d7e['query'][_0x195d9d]==='null'){_0x4d1a08[_0x83e6('0x4e')]('i.'+_0x195d9d+_0x83e6('0x78'));}else{_0x4d1a08['where']('i.'+_0x195d9d+'\x20=\x20?',_0x1f9d7e[_0x83e6('0x44')][_0x195d9d]);}}});}if(_0x1f9d7e[_0x83e6('0x44')][_0x83e6('0x79')]){if(_0x1f9d7e[_0x83e6('0x44')][_0x83e6('0x79')]==0x1){_0x4d1a08['having'](_0x83e6('0x7a'));}else{_0x4d1a08['having'](_0x83e6('0x7b'));}}if(_0x1f9d7e[_0x83e6('0x44')][_0x83e6('0x7c')]){var _0x2292c4=_0x1f9d7e[_0x83e6('0x44')]['filter'][_0x83e6('0x7d')]('\x5c','\x5c\x5c')[_0x83e6('0x7d')]('\x27\x27',_0x83e6('0x7e'));if(qs['isNumeric'](_0x2292c4)){_0x3d82a4['or'](_0x83e6('0x7f'),_0x2292c4+'%');}else{var _0x28604d=[];_0x2292c4[_0x83e6('0x3c')]('\x20')[_0x83e6('0x3d')](function(_0x98e3a0){_0x28604d[_0x83e6('0x3f')]('+'+_0x98e3a0['toString']());});var _0x11906f=_0x28604d[_0x83e6('0x80')]('\x20');_0x3d82a4['or'](_0x83e6('0x81'),_0x11906f)['or'](_0x83e6('0x82'),_0x2292c4+'%');}}}_0x4d1a08[_0x83e6('0x4e')](_0x3d82a4);_0x4d1a08['group']('i.id');var _0x24a0e8={'type':db[_0x83e6('0x83')][_0x83e6('0x84')]['SELECT'],'raw':!![]};var _0x4db528=_0x4d1a08['clone']();_0x4db528[_0x83e6('0x51')](_0x83e6('0x85'));_0x4db528[_0x83e6('0x51')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x83e6('0x86'));if(_0x5e640f['order']){_0x5e640f['order'][_0x83e6('0x3d')](function(_0x5134ca){_0x4d1a08[_0x83e6('0x4c')]('i.'+_0x5134ca[0x0],_0x5134ca[0x1]===_0x83e6('0x87')?![]:!![]);});}var _0x43bade=[];var _0x48c9be=squel[_0x83e6('0x5f')]();if(!_0x483ea3){if(_0x1f9d7e[_0x83e6('0x44')][_0x83e6('0x88')]){_0x43bade=_[_0x83e6('0x89')](_0x1f9d7e[_0x83e6('0x44')][_0x83e6('0x88')])?_0x1f9d7e[_0x83e6('0x44')][_0x83e6('0x88')]:new Array(_0x1f9d7e['query'][_0x83e6('0x88')]);_0x43bade['forEach'](function(_0x106ea3){_0x48c9be['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x106ea3+',%');});_0x4d1a08[_0x83e6('0x6f')](_0x48c9be);_0x4db528[_0x83e6('0x56')](_0x83e6('0x8a'),'it','it.ChatInteractionId\x20=\x20i.id');_0x4db528['left_join'](_0x83e6('0x8b'),'t',_0x83e6('0x8c'));_0x4db528[_0x83e6('0x4e')](_0x83e6('0x8d'),_0x43bade);}}else{if(_0x483ea3[_0x83e6('0x4a')]('TagId')){if(as[_0x83e6('0x68')](_0x483ea3[_0x83e6('0x8e')][_0x83e6('0x69')])){var _0x4cad09=_[_0x83e6('0x6a')](_0x483ea3[_0x83e6('0x8e')][_0x83e6('0x69')])[0x0];_0x4cad09[_0x83e6('0x3d')](function(_0x1f5612){as['getConditionValue'](_0x1f5612)[_0x83e6('0x3d')](function(_0x101621){_0x43bade[_0x83e6('0x3f')](_0x101621);});});}else{_0x43bade=as[_0x83e6('0x6c')](_0x483ea3[_0x83e6('0x8e')][_0x83e6('0x69')]);}_0x43bade[_0x83e6('0x3d')](function(_0x3c4fe3){_0x48c9be['or'](_0x83e6('0x8f'),'%,'+_0x3c4fe3+',%');});_0x4d1a08[_0x83e6('0x6f')](_0x48c9be);_0x4db528[_0x83e6('0x56')](_0x83e6('0x90'),'it',_0x83e6('0x91'));_0x4db528['left_join'](_0x83e6('0x8b'),'t',_0x83e6('0x8c'));_0x4db528[_0x83e6('0x4e')](_0x83e6('0x8d'),_0x43bade);}}db[_0x83e6('0x92')]['query'](_0x4db528['toString'](),_0x24a0e8)[_0x83e6('0x1e')](function(_0x1f7c6b){_0x27a617[_0x83e6('0x2c')]=_0x1f7c6b['length'];if(_0x27a617[_0x83e6('0x2c')]===0x0)return[];return db[_0x83e6('0x92')][_0x83e6('0x44')](_0x107d7d[_0x83e6('0x93')](),_0x24a0e8)[_0x83e6('0x1e')](function(_0x9fe8b){_0xdac6e4=_['keyBy'](_0x9fe8b,'id');_0x24a0e8=_[_0x83e6('0x94')](_0x24a0e8,{'model':db[_0x83e6('0x40')],'mapToModel':!![],'raw':!![],'nest':!![]});_0x4d1a08[_0x83e6('0x51')](_0x83e6('0x95'),_0x83e6('0x86'));_0x4d1a08[_0x83e6('0x51')]('a.key','Account.key');_0x4d1a08[_0x83e6('0x51')](_0x83e6('0x96'),'Account.mandatoryDisposition');_0x4d1a08[_0x83e6('0x51')](_0x83e6('0x97'));_0x4d1a08['field']('c.firstName',_0x83e6('0x98'));_0x4d1a08['field'](_0x83e6('0x99'),_0x83e6('0x9a'));_0x4d1a08['field'](_0x83e6('0x9b'),_0x83e6('0x9c'));_0x4d1a08[_0x83e6('0x51')](_0x83e6('0x9d'),_0x83e6('0x9e'));_0x4d1a08['field'](_0x83e6('0x9f'),_0x83e6('0xa0'));_0x4d1a08[_0x83e6('0x51')](_0x83e6('0xa1'),_0x83e6('0xa2'));_0x4d1a08[_0x83e6('0x51')](_0x83e6('0xa3'),_0x83e6('0x3b'));_0x4d1a08['left_join'](_0x83e6('0x8a'),'it',_0x83e6('0xa4'));_0x4d1a08['left_join'](_0x83e6('0x8b'),'t',_0x83e6('0x8c'));_0x4d1a08[_0x83e6('0x2e')](_0x5e640f['limit']);_0x4d1a08['offset'](_0x5e640f[_0x83e6('0x2d')]);return db['sequelize']['query'](_0x4d1a08['toString'](),_0x24a0e8);})[_0x83e6('0x1e')](function(_0x5411df){_0x2aa358[_0x83e6('0x4e')](_0x83e6('0xa5'),_[_0x83e6('0x3a')](_0x5411df,'id'));return db[_0x83e6('0x92')][_0x83e6('0x44')](_0x2aa358[_0x83e6('0x93')](),_0x24a0e8)['then'](function(_0x2e1260){var _0x297dcd=_[_0x83e6('0xa6')](_0x2e1260,_0x83e6('0xa7'));var _0x243b95=[];_0x5411df[_0x83e6('0x3d')](function(_0x5e6296){_0x243b95[_0x83e6('0x3f')](updateChatInteraction(_0x5e6296,_0xdac6e4,_0x297dcd));});return BPromise[_0x83e6('0xa8')](_0x243b95);});});})[_0x83e6('0x1e')](function(_0x404692){_0x27a617[_0x83e6('0xa9')]=_0x404692;return _0x27a617;})[_0x83e6('0x1e')](respondWithFilteredResult(_0x27aad,_0x5e640f))[_0x83e6('0x29')](handleError(_0x27aad,null));};exports[_0x83e6('0xaa')]=function(_0x204463,_0x2659ae){var _0x51d4c5={'raw':![],'where':{'id':_0x204463[_0x83e6('0xab')]['id']}},_0x3c4b56={};_0x3c4b56[_0x83e6('0x42')]=_['keys'](db['ChatInteraction'][_0x83e6('0x41')]);_0x3c4b56[_0x83e6('0x44')]=_['keys'](_0x204463[_0x83e6('0x44')]);_0x3c4b56[_0x83e6('0x45')]=_['intersection'](_0x3c4b56[_0x83e6('0x42')],_0x3c4b56[_0x83e6('0x44')]);_0x51d4c5[_0x83e6('0x47')]=_[_0x83e6('0x46')](_0x3c4b56['model'],qs[_0x83e6('0x48')](_0x204463['query']['fields']));_0x51d4c5[_0x83e6('0x47')]=_0x51d4c5[_0x83e6('0x47')]['length']?_0x51d4c5['attributes']:_0x3c4b56['model'];if(_0x204463[_0x83e6('0x44')][_0x83e6('0xac')]){_0x51d4c5[_0x83e6('0xad')]=[{'all':!![]}];}_0x51d4c5=_[_0x83e6('0x94')]({},_0x51d4c5,_0x204463['options']);return db[_0x83e6('0x40')]['find'](_0x51d4c5)[_0x83e6('0x1e')](handleEntityNotFound(_0x2659ae,null))[_0x83e6('0x1e')](respondWithResult(_0x2659ae,null))[_0x83e6('0x29')](handleError(_0x2659ae,null));};exports[_0x83e6('0xae')]=function(_0x40a0e9,_0x5bd37d){return db[_0x83e6('0x40')][_0x83e6('0xae')](_0x40a0e9['body'],{})[_0x83e6('0x1e')](respondWithResult(_0x5bd37d,0xc9))[_0x83e6('0x29')](handleError(_0x5bd37d,null));};exports[_0x83e6('0x33')]=function(_0x218b0b,_0x4b1536){if(_0x218b0b[_0x83e6('0xaf')]['id']){delete _0x218b0b[_0x83e6('0xaf')]['id'];}return db['ChatInteraction'][_0x83e6('0xb0')]({'where':{'id':_0x218b0b[_0x83e6('0xab')]['id']}})['then'](handleEntityNotFound(_0x4b1536,null))[_0x83e6('0x1e')](saveUpdates(_0x218b0b[_0x83e6('0xaf')],null))['then'](respondWithResult(_0x4b1536,null))[_0x83e6('0x29')](handleError(_0x4b1536,null));};exports[_0x83e6('0x34')]=function(_0x4c8227,_0x34f647){return db[_0x83e6('0x40')][_0x83e6('0xb0')]({'where':{'id':_0x4c8227['params']['id']}})['then'](handleEntityNotFound(_0x34f647,null))[_0x83e6('0x1e')](removeEntity(_0x34f647,null))[_0x83e6('0x29')](handleError(_0x34f647,null));};exports[_0x83e6('0xb1')]=function(_0x3543f5,_0x53932e){return db['ChatInteraction'][_0x83e6('0xb1')]()[_0x83e6('0x1e')](respondWithResult(_0x53932e,null))['catch'](handleError(_0x53932e,null));};exports[_0x83e6('0xb2')]=function(_0x54fdaa,_0x19788e){if(_0x54fdaa[_0x83e6('0xaf')]['id']){delete _0x54fdaa[_0x83e6('0xaf')]['id'];}return db[_0x83e6('0x40')][_0x83e6('0xb0')]({'where':{'id':_0x54fdaa[_0x83e6('0xab')]['id']}})[_0x83e6('0x1e')](handleEntityNotFound(_0x19788e,null))[_0x83e6('0x1e')](saveUpdates(_0x54fdaa[_0x83e6('0xaf')],null))[_0x83e6('0x1e')](respondWithResult(_0x19788e,null))[_0x83e6('0x29')](handleError(_0x19788e,null));};exports[_0x83e6('0xb3')]=function(_0x4f7451,_0x453562,_0x14eb36){if(_0x4f7451[_0x83e6('0xaf')]['id']){delete _0x4f7451[_0x83e6('0xaf')]['id'];}return db[_0x83e6('0x40')][_0x83e6('0xb0')]({'where':{'id':_0x4f7451[_0x83e6('0xab')]['id']}})['then'](function(_0x186fe1){if(!_0x186fe1){logger[_0x83e6('0x24')]('abandonInteraction,\x20%s,\x20%s,\x20%s',_0x83e6('0xb3'),0x194,'entity\x20not\x20found');_0x453562[_0x83e6('0xb4')](0x194);}else{if(_0x186fe1['UserId']){throw new db[(_0x83e6('0x83'))][(_0x83e6('0xb5'))](_0x83e6('0xb6'));}}return _0x186fe1;})[_0x83e6('0x1e')](function(_0x756aa5){if(_0x756aa5){return _0x756aa5['update']({'closed':_0x4f7451['body'][_0x83e6('0xb7')],'disposition':_0x4f7451[_0x83e6('0xaf')][_0x83e6('0xb8')]})[_0x83e6('0x1e')](function(_0x41637b){return _0x41637b;});}})[_0x83e6('0x1e')](function(_0x1f1d3d){return respondWithRpcPromise('AbandonInteraction',_0x83e6('0xb3'),_0x4f7451[_0x83e6('0xaf')],client9004);})['then'](respondWithResult(_0x453562,null))[_0x83e6('0x29')](handleError(_0x453562,null));};exports[_0x83e6('0xb9')]=function(_0x4581d5,_0x5c39f4,_0x49e7af){_0x4581d5[_0x83e6('0xaf')]['name']=_0x4581d5[_0x83e6('0xba')]['originalname'];_0x4581d5['body'][_0x83e6('0xbb')]=_0x4581d5['file'][_0x83e6('0xbc')];_0x4581d5[_0x83e6('0xaf')][_0x83e6('0xbd')]=_0x4581d5[_0x83e6('0xba')][_0x83e6('0xbe')];return db[_0x83e6('0xbf')]['create'](_0x4581d5['body'])['then'](respondWithResult(_0x5c39f4,0xc9))[_0x83e6('0x29')](handleError(_0x5c39f4,null));};exports['attachmentDownload']=function(_0x276f94,_0x41a546,_0x1349f2){return db[_0x83e6('0x40')][_0x83e6('0xc0')]({'where':{'id':_0x276f94[_0x83e6('0xab')]['id']},'raw':!![]})[_0x83e6('0x1e')](handleEntityNotFound(_0x41a546,null))[_0x83e6('0x1e')](function(_0x59cf96){if(_0x59cf96){if(_0x59cf96[_0x83e6('0xb7')]){return _0x41a546[_0x83e6('0x35')](0x193)['json']({'status':0x193,'message':_0x83e6('0xc1')});}return db[_0x83e6('0xbf')][_0x83e6('0xc0')]({'where':{'id':_0x276f94['query']['attachId']},'raw':!![]})[_0x83e6('0x1e')](handleEntityNotFound(_0x41a546,null));}})[_0x83e6('0x1e')](function(_0xfce1ba){if(_0xfce1ba){return _0x41a546['download'](path[_0x83e6('0x80')](config[_0x83e6('0xc2')],'server/files/attachments/',_0xfce1ba[_0x83e6('0xbb')]));}})[_0x83e6('0x29')](handleError(_0x41a546,null));};exports[_0x83e6('0xc3')]=function(_0x2760e3,_0x54182f){var _0xdb864=null;var _0x1f4d9e=null;var _0x35fd02=null;var _0x556795=null;if(_0x2760e3[_0x83e6('0xaf')]['id']){delete _0x2760e3[_0x83e6('0xaf')]['id'];}if(_0x2760e3[_0x83e6('0xaf')][_0x83e6('0xc4')]){_0x556795=path[_0x83e6('0x80')](config[_0x83e6('0xc2')],'server/files/chat/upload/',util[_0x83e6('0xc5')]('transcript-%s.txt',Date['now']()));_0x2760e3['body'][_0x83e6('0xc6')]=_0x556795;}return db['ChatInteraction'][_0x83e6('0xb0')]({'where':{'id':_0x2760e3[_0x83e6('0xab')]['id']},'include':[{'model':db[_0x83e6('0xc7')],'as':_0x83e6('0xc8'),'include':[{'model':db[_0x83e6('0xc9')],'as':'User'}]}]})[_0x83e6('0x1e')](handleEntityNotFound(_0x54182f,null))[_0x83e6('0x1e')](saveUpdates(_0x2760e3[_0x83e6('0xaf')],null))[_0x83e6('0x1e')](function(_0x5aebc7){if(_0x5aebc7){_0xdb864=_0x5aebc7;return db['ChatWebsite'][_0x83e6('0xb0')]({'where':{'id':_0xdb864[_0x83e6('0x73')]}});}})[_0x83e6('0x1e')](function(_0x38d563){if(_0x38d563){_0x35fd02=_0x38d563;return db[_0x83e6('0xca')]['find']({'where':{'id':_0xdb864[_0x83e6('0xcb')]}});}})[_0x83e6('0x1e')](function(_0x56845c){if(_0x56845c){_0x1f4d9e=_0x56845c;if(_0x556795){var _0x500382=null;for(var _0x51aab9=0x1;_0x51aab9<_0xdb864[_0x83e6('0xc8')][_0x83e6('0x49')];++_0x51aab9){_0x500382=_0xdb864[_0x83e6('0xc8')][_0x51aab9];var _0x21709e=_0x500382[_0x83e6('0xcc')]?util[_0x83e6('0xc5')](_0x83e6('0xcd'),_0x35fd02[_0x83e6('0xce')],_0x500382['UserId']):'System';var _0x997794=_0x2760e3['body'][_0x83e6('0xcf')]||util[_0x83e6('0xc5')](_0x83e6('0xcd'),'Visitor',_0x500382[_0x83e6('0xcb')]);switch(_0x35fd02[_0x83e6('0xd0')]){case'website_alias':_0x21709e=_0x500382[_0x83e6('0xcc')]?util[_0x83e6('0xc5')](_0x83e6('0xcd'),_0x35fd02['agentAlias'],_0x500382[_0x83e6('0xcc')]):_0x83e6('0xd1');break;case _0x83e6('0xd2'):_0x21709e=_0x500382[_0x83e6('0xcc')]?_0x500382[_0x83e6('0xc9')]['alias']||_0x500382[_0x83e6('0xc9')][_0x83e6('0xd3')]:_0x83e6('0xd1');break;case _0x83e6('0xd4'):_0x21709e=_0x500382[_0x83e6('0xcc')]?_0x500382['User']['fullname']:'System';break;default:_0x21709e=_0x500382[_0x83e6('0xcc')]?util[_0x83e6('0xc5')](_0x83e6('0xcd'),_0x35fd02[_0x83e6('0xce')],_0x500382[_0x83e6('0xcc')]):_0x83e6('0xd1');}var _0x3c6d31=util['format'](_0x83e6('0xd5'),moment(_0x500382[_0x83e6('0x75')])['format'](_0x83e6('0xd6')),_0x500382[_0x83e6('0xd7')]==='in'?_0x997794:_0x21709e,_0x500382[_0x83e6('0xaf')]);if(!_0x500382[_0x83e6('0xd8')]){fs['appendFileSync'](_0x556795,_0x3c6d31);}}return db['MailAccount']['findOne']({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0x83e6('0xd9'),'raw':!![]}]});}}})['then'](function(_0x5d9a1b){if(_0x5d9a1b&&_0x5d9a1b[_0x83e6('0xd9')]&&_0x2760e3[_0x83e6('0xaf')]){var _0x3865f4={'tls':{'rejectUnauthorized':![]}};if(_0x5d9a1b[_0x83e6('0xd9')][_0x83e6('0xda')]){_0x3865f4[_0x83e6('0xda')]=_0x5d9a1b[_0x83e6('0xd9')][_0x83e6('0xda')];}else{_0x3865f4[_0x83e6('0xdb')]=_0x5d9a1b['Smtp'][_0x83e6('0xdb')];_0x3865f4[_0x83e6('0xdc')]=_0x5d9a1b[_0x83e6('0xd9')][_0x83e6('0xdc')];_0x3865f4['secure']=_0x5d9a1b[_0x83e6('0xd9')]['secure'];}if(_0x5d9a1b[_0x83e6('0xd9')][_0x83e6('0xdd')]){_0x3865f4[_0x83e6('0xde')]={'user':_0x5d9a1b[_0x83e6('0xd9')][_0x83e6('0xdf')],'pass':_0x5d9a1b[_0x83e6('0xd9')]['pass']};}return respondWithRpcPromise(_0x83e6('0xe0'),_0x83e6('0xe1'),{'account':_0x3865f4,'message':{'from':util[_0x83e6('0xc5')](_0x83e6('0xe2'),_0x5d9a1b[_0x83e6('0x37')],_0x5d9a1b[_0x83e6('0xe3')]||_0x5d9a1b[_0x83e6('0xd9')][_0x83e6('0xdf')]),'to':_0x2760e3[_0x83e6('0xaf')][_0x83e6('0xc4')],'subject':_0x83e6('0xe4'),'text':util['format'](_0x83e6('0xe5'),_0x2760e3[_0x83e6('0xaf')][_0x83e6('0xc4')]),'attachments':[{'path':_0x556795}]}})[_0x83e6('0x1e')](function(){return _0xdb864;})[_0x83e6('0x29')](function(_0xfd8311){console['error'](_0xfd8311);});}else{return _0xdb864;}})[_0x83e6('0x1e')](respondWithStatusCode(_0x54182f,0xc8))[_0x83e6('0x29')](handleError(_0x54182f,null));};exports[_0x83e6('0xe6')]=function(_0x22154c,_0x3dd8ef,_0x42eda3){return db[_0x83e6('0xc7')][_0x83e6('0xb0')]({'where':{'id':_0x22154c['params']['id']}})[_0x83e6('0x1e')](handleEntityNotFound(_0x3dd8ef,null))[_0x83e6('0x1e')](function(_0x2c8989){if(_0x2c8989){return _0x2c8989['addMessage'](_0x22154c[_0x83e6('0xaf')][_0x83e6('0xe7')],_['omit'](_0x22154c[_0x83e6('0xaf')],[_0x83e6('0xe7'),'id'])||{});}})[_0x83e6('0x1e')](respondWithResult(_0x3dd8ef,null))[_0x83e6('0x29')](handleError(_0x3dd8ef,null));};exports[_0x83e6('0xe8')]=function(_0x4923d5,_0xd78491,_0x3e9fa9){var _0x5213b2={'raw':![],'where':{}};var _0x568e76={};var _0x438fcc={'count':0x0,'rows':[]};return db[_0x83e6('0x40')][_0x83e6('0xc0')]({'where':{'id':_0x4923d5[_0x83e6('0xab')]['id']}})[_0x83e6('0x1e')](handleEntityNotFound(_0xd78491,null))[_0x83e6('0x1e')](function(_0x465364){if(_0x465364){_0x568e76[_0x83e6('0x42')]=_[_0x83e6('0x43')](db[_0x83e6('0xc7')][_0x83e6('0x41')]);_0x568e76[_0x83e6('0x44')]=_[_0x83e6('0x43')](_0x4923d5[_0x83e6('0x44')]);_0x568e76[_0x83e6('0x45')]=_[_0x83e6('0x46')](_0x568e76['model'],_0x568e76['query']);_0x5213b2['attributes']=_['intersection'](_0x568e76[_0x83e6('0x42')],qs[_0x83e6('0x48')](_0x4923d5['query']['fields']));_0x5213b2[_0x83e6('0x47')]=_0x5213b2[_0x83e6('0x47')][_0x83e6('0x49')]?_0x5213b2[_0x83e6('0x47')]:_0x568e76['model'];if(!_0x4923d5[_0x83e6('0x44')][_0x83e6('0x4a')](_0x83e6('0x4b'))){_0x5213b2[_0x83e6('0x2e')]=qs[_0x83e6('0x2e')](_0x4923d5[_0x83e6('0x44')][_0x83e6('0x2e')]);_0x5213b2['offset']=qs[_0x83e6('0x2d')](_0x4923d5[_0x83e6('0x44')][_0x83e6('0x2d')]);}_0x5213b2[_0x83e6('0x4c')]=qs[_0x83e6('0x4d')](_0x4923d5[_0x83e6('0x44')][_0x83e6('0x4d')]);_0x5213b2[_0x83e6('0x4e')]=qs[_0x83e6('0x45')](_['pick'](_0x4923d5[_0x83e6('0x44')],_0x568e76[_0x83e6('0x45')]));_0x5213b2[_0x83e6('0x4e')][_0x83e6('0xa7')]=_0x465364['id'];if(_0x4923d5[_0x83e6('0x44')][_0x83e6('0x7c')]){_0x5213b2[_0x83e6('0x4e')]=_['merge'](_0x5213b2['where'],{'$or':_[_0x83e6('0x3a')](_0x5213b2[_0x83e6('0x47')],function(_0x3fe966){var _0x5b35ff={};_0x5b35ff[_0x3fe966]={'$like':'%'+_0x4923d5['query'][_0x83e6('0x7c')]+'%'};return _0x5b35ff;})});}if(_0x4923d5[_0x83e6('0x44')][_0x83e6('0xe9')]){var _0x4d3c58=_0x4923d5[_0x83e6('0x44')][_0x83e6('0xe9')]['split'](',');var _0x46ee3a={};_0x46ee3a[_0x4d3c58[0x0]]={'$gte':moment(_0x4d3c58[0x1])[_0x83e6('0xc5')](_0x83e6('0xea'))};_0x5213b2[_0x83e6('0x4e')]=_[_0x83e6('0x94')](_0x5213b2['where'],_0x46ee3a);}_0x5213b2=_[_0x83e6('0x94')]({},_0x5213b2,_0x4923d5['options']);return db[_0x83e6('0xc7')][_0x83e6('0x2c')]({'where':_0x5213b2[_0x83e6('0x4e')]})[_0x83e6('0x1e')](function(_0x3b82ab){_0x438fcc['count']=_0x3b82ab;if(_0x4923d5[_0x83e6('0x44')]['includeAll']){_0x5213b2[_0x83e6('0xad')]=[{'all':!![]}];}return db[_0x83e6('0xc7')]['findAll'](_0x5213b2);})['then'](function(_0x53b72b){_0x438fcc[_0x83e6('0xa9')]=_0x53b72b;return _0x438fcc;});}})[_0x83e6('0x1e')](respondWithFilteredResult(_0xd78491,_0x5213b2))[_0x83e6('0x29')](handleError(_0xd78491,null));};exports[_0x83e6('0xeb')]=function(_0x4e5b17,_0x207b11,_0x13718e){var _0x35c537={'where':{}},_0x5f4b14={},_0x295d82={'count':0x0,'rows':[]};return db[_0x83e6('0x40')][_0x83e6('0xc0')]({'where':{'id':_0x4e5b17[_0x83e6('0xab')]['id']}})[_0x83e6('0x1e')](handleEntityNotFound(_0x207b11,null))[_0x83e6('0x1e')](function(_0x23b837){if(_0x23b837){_0x5f4b14[_0x83e6('0x42')]=_[_0x83e6('0x43')](db['ChatMessage']['rawAttributes']);_0x5f4b14[_0x83e6('0x44')]=_[_0x83e6('0x43')](_0x4e5b17[_0x83e6('0x44')]);_0x5f4b14[_0x83e6('0x45')]=_[_0x83e6('0x46')](_0x5f4b14['model'],_0x5f4b14['query']);_0x35c537['attributes']=_['intersection'](_0x5f4b14[_0x83e6('0x42')],qs[_0x83e6('0x48')](_0x4e5b17[_0x83e6('0x44')][_0x83e6('0x48')]));_0x35c537[_0x83e6('0x47')]=_0x35c537[_0x83e6('0x47')][_0x83e6('0x49')]?_0x35c537['attributes']:_0x5f4b14[_0x83e6('0x42')];if(!_0x4e5b17[_0x83e6('0x44')][_0x83e6('0x4a')](_0x83e6('0x4b'))){_0x35c537[_0x83e6('0x2e')]=qs[_0x83e6('0x2e')](_0x4e5b17[_0x83e6('0x44')][_0x83e6('0x2e')]);_0x35c537[_0x83e6('0x2d')]=qs['offset'](_0x4e5b17[_0x83e6('0x44')][_0x83e6('0x2d')]);}_0x35c537[_0x83e6('0x4c')]=qs[_0x83e6('0x4d')](_0x4e5b17[_0x83e6('0x44')]['sort']);_0x35c537[_0x83e6('0x4e')]=qs[_0x83e6('0x45')](_[_0x83e6('0x4f')](_0x4e5b17['query'],_0x5f4b14['filters']));_0x35c537[_0x83e6('0x4e')][_0x83e6('0xa7')]=_0x23b837['id'];if(_0x4e5b17[_0x83e6('0x44')]['filter']){_0x35c537[_0x83e6('0x4e')]=_['merge'](_0x35c537[_0x83e6('0x4e')],{'$or':_[_0x83e6('0x3a')](_0x35c537[_0x83e6('0x47')],function(_0x461f3d){var _0x515058={};_0x515058[_0x461f3d]={'$like':'%'+_0x4e5b17['query']['filter']+'%'};return _0x515058;})});}_0x35c537[_0x83e6('0x4e')][_0x83e6('0xd8')]=![];if(_0x4e5b17[_0x83e6('0x44')]['id']){_0x35c537[_0x83e6('0x4e')]['id']={'$gt':_0x4e5b17['query']['id']};}_0x35c537=_['merge']({},_0x35c537,_0x4e5b17[_0x83e6('0x65')]);return db[_0x83e6('0xc7')][_0x83e6('0x2c')]({'where':_0x35c537['where']})['then'](function(_0x325ef2){_0x295d82[_0x83e6('0x2c')]=_0x325ef2;_0x35c537[_0x83e6('0xad')]=[];if(_0x4e5b17[_0x83e6('0x44')][_0x83e6('0xec')]){_0x35c537['include'][_0x83e6('0x3f')]({'model':db[_0x83e6('0xc9')],'as':_0x83e6('0xc9'),'attributes':['id',_0x83e6('0xd3'),_0x83e6('0xed')]});}if(_0x4e5b17[_0x83e6('0x44')][_0x83e6('0xac')]){_0x35c537[_0x83e6('0xad')]=[{'all':!![]}];}return db[_0x83e6('0xc7')][_0x83e6('0xee')](_0x35c537);})[_0x83e6('0x1e')](function(_0x2dd6d4){_0x295d82[_0x83e6('0xa9')]=_0x2dd6d4;return _0x295d82;});}})[_0x83e6('0x1e')](respondWithFilteredResult(_0x207b11,_0x35c537))['catch'](handleError(_0x207b11,null));};exports[_0x83e6('0xef')]=function(_0x16a1ac,_0xd9c122,_0x4aead5){return db[_0x83e6('0x40')][_0x83e6('0xb0')]({'where':{'id':_0x16a1ac[_0x83e6('0xab')]['id']}})['then'](handleEntityNotFound(_0xd9c122,null))['then'](function(_0x4d8f0d){if(_0x4d8f0d){return _0x4d8f0d[_0x83e6('0xf0')](_0x16a1ac[_0x83e6('0xaf')][_0x83e6('0xe7')],_[_0x83e6('0x63')](_0x16a1ac[_0x83e6('0xaf')],[_0x83e6('0xe7'),'id'])||{})['spread'](function(){return db[_0x83e6('0xf1')][_0x83e6('0xee')]({'attributes':['id',_0x83e6('0x37'),_0x83e6('0x52')],'where':{'id':_0x16a1ac['body'][_0x83e6('0xe7')]}});})['then'](function(_0x1683fd){socket[_0x83e6('0xf2')](_0x83e6('0xf3'),{'id':Number(_0x16a1ac[_0x83e6('0xab')]['id']),'tags':_0x1683fd||[]});return{'id':Number(_0x16a1ac[_0x83e6('0xab')]['id']),'tags':_0x1683fd||[]};});}})[_0x83e6('0x1e')](respondWithResult(_0xd9c122,null))[_0x83e6('0x29')](handleError(_0xd9c122,null));};exports[_0x83e6('0xf4')]=function(_0x4f7605,_0x3ddc79,_0x4f53ab){return db[_0x83e6('0x40')][_0x83e6('0xb0')]({'where':{'id':_0x4f7605['params']['id']}})[_0x83e6('0x1e')](handleEntityNotFound(_0x3ddc79,null))['then'](function(_0x34bbec){if(_0x34bbec){return _0x34bbec[_0x83e6('0xf4')](_0x4f7605[_0x83e6('0x44')][_0x83e6('0xe7')]);}})['then'](respondWithStatusCode(_0x3ddc79,null))[_0x83e6('0x29')](handleError(_0x3ddc79,null));};exports['download']=function(_0x5c26f8,_0xdcd88f){var _0xf84a4=moment()[_0x83e6('0xf5')]()[_0x83e6('0x93')]();var _0xa13ca4=path[_0x83e6('0x80')](config[_0x83e6('0xc2')],_0x83e6('0xf6'),_0x83e6('0xf7'),_0x83e6('0xf8'));var _0x3e6722=path[_0x83e6('0x80')](config['root'],_0x83e6('0xf6'),_0x83e6('0xf7'),_0x83e6('0xf9'));var _0x7ff37a=path['join'](_0xa13ca4,_0xf84a4);var _0x1f091f=util[_0x83e6('0xc5')](_0x83e6('0xfa'),_0x5c26f8[_0x83e6('0xab')]['id'],_0xf84a4);var _0x429d46=path[_0x83e6('0x80')](_0xa13ca4,_0x1f091f);var _0x17562d=![];return db[_0x83e6('0x40')][_0x83e6('0xb0')]({'where':{'id':_0x5c26f8[_0x83e6('0xab')]['id']},'include':[{'model':db['ChatMessage'],'as':'Messages','attributes':['id',_0x83e6('0xaf'),_0x83e6('0x75'),_0x83e6('0xd7'),_0x83e6('0xd8'),_0x83e6('0x79')],'include':[{'model':db[_0x83e6('0xc9')],'as':_0x83e6('0xc9'),'attributes':['id',_0x83e6('0xd3')],'raw':!![]},{'model':db[_0x83e6('0xca')],'as':_0x83e6('0xfb'),'attributes':['id',_0x83e6('0xfc'),_0x83e6('0xfd')],'raw':!![]},{'model':db[_0x83e6('0xbf')],'as':_0x83e6('0xbf'),'raw':!![]}]},{'model':db[_0x83e6('0xfe')],'as':'Account','attributes':['id',_0x83e6('0x37')]},{'model':db['User'],'as':_0x83e6('0xff'),'attributes':['id',_0x83e6('0xd3')]}]})[_0x83e6('0x1e')](handleEntityNotFound(_0xdcd88f,null))[_0x83e6('0x1e')](function(_0x51f2a6){if(_0x51f2a6){var _0x3cbf5a=_0x51f2a6[_0x83e6('0x100')]({'plain':!![]});_0x17562d=!![];var _0x55f290={'format':'A4','border':'10px','header':{'height':_0x83e6('0x101'),'contents':{'first':_0x83e6('0x102')}},'footer':{'height':_0x83e6('0x103'),'contents':{'default':util[_0x83e6('0xc5')](_0x83e6('0x104'),util['format']('%s\x20#%d','Chat',_0x3cbf5a['id']),moment()[_0x83e6('0xc5')](_0x83e6('0x105'))[_0x83e6('0x93')]())}}};fs[_0x83e6('0x106')](_0x7ff37a);var _0x3a77b9={'channel':'Chat','account':_0x3cbf5a[_0x83e6('0x107')][_0x83e6('0x37')],'agent':_0x3cbf5a[_0x83e6('0xff')]?_0x3cbf5a[_0x83e6('0xff')][_0x83e6('0xd3')]:_0x83e6('0x108'),'createdAt':moment(_0x3cbf5a[_0x83e6('0x75')])['format'](_0x83e6('0xea'))[_0x83e6('0x93')](),'closedAt':_0x3cbf5a[_0x83e6('0xb7')]?moment(_0x3cbf5a[_0x83e6('0x109')])[_0x83e6('0xc5')](_0x83e6('0xea'))[_0x83e6('0x93')]():'','disposition':_0x3cbf5a[_0x83e6('0xb8')],'chatInfo':{'browser':_0x3cbf5a['browserName'],'os':_0x3cbf5a[_0x83e6('0x10a')],'referer':_0x3cbf5a['referer'],'customerIp':_0x3cbf5a[_0x83e6('0x10b')],'customerPort':_0x3cbf5a[_0x83e6('0x10c')]?_0x3cbf5a[_0x83e6('0x10c')]:'N.A.'},'messages':_(_0x3cbf5a['Messages'])[_0x83e6('0x10d')]()[_0x83e6('0x7c')]({'secret':![]})['map'](function(_0x9661eb){if(_0x9661eb[_0x83e6('0xbf')]){var _0x49f002=path[_0x83e6('0x80')](_0x3e6722,_0x9661eb[_0x83e6('0xbf')]['basename']);if(fs['existsSync'](_0x49f002)){fs[_0x83e6('0x10e')](_0x49f002)['pipe'](fs[_0x83e6('0x10f')](path[_0x83e6('0x80')](_0x7ff37a,_0x9661eb[_0x83e6('0xbf')][_0x83e6('0xbb')])));}}return{'date':moment(_0x9661eb[_0x83e6('0x75')])[_0x83e6('0xc5')](_0x83e6('0xea'))['toString'](),'sender':_0x9661eb[_0x83e6('0xd7')]===_0x83e6('0x110')?_0x9661eb[_0x83e6('0xc9')]?_0x9661eb[_0x83e6('0xc9')]['fullname']:_0x83e6('0xd1'):_0x9661eb['Contact']['firstName']+(_0x9661eb[_0x83e6('0xfb')][_0x83e6('0xfd')]?'\x20'+_0x9661eb[_0x83e6('0xfb')][_0x83e6('0xfd')]:''),'body':_0x9661eb[_0x83e6('0xbf')]?_0x9661eb[_0x83e6('0xbf')][_0x83e6('0xbb')]:_0x9661eb[_0x83e6('0xaf')],'direction':_0x9661eb[_0x83e6('0xd7')]===_0x83e6('0x110')?'A':'C','secret':_0x9661eb['secret'],'read':_0x9661eb[_0x83e6('0x79')],'attachment':_0x9661eb[_0x83e6('0xbf')]};})[_0x83e6('0x69')]()};return ejs[_0x83e6('0x111')](path[_0x83e6('0x80')](config[_0x83e6('0xc2')],_0x83e6('0xf6'),_0x83e6('0x112'),_0x83e6('0x113')),{'interaction':_0x3a77b9})['then'](function(_0x3cccbf){return new BPromise(function(_0x7c1db4,_0x8eb731){pdf[_0x83e6('0xae')](_0x3cccbf,_0x55f290)['toFile'](path[_0x83e6('0x80')](_0x7ff37a,_0x83e6('0x114')+_0x3cbf5a['id']+'-'+_0xf84a4+_0x83e6('0x115')),function(_0x93c7b0,_0x1e356d){if(_0x93c7b0)return _0x8eb731(_0x93c7b0);_0x7c1db4(_0x1e356d);});});});}})[_0x83e6('0x1e')](function(){if(_0x17562d){return new BPromise(function(_0x4cccf3,_0x3a767f){zipdir(_0x7ff37a,{'saveTo':_0x429d46},function(_0x290eb7,_0x2b44dd){if(_0x290eb7)return _0x3a767f(_0x290eb7);return _0x4cccf3(_0x2b44dd);});})[_0x83e6('0x1e')](function(){return new BPromise(function(_0x1c1f38,_0x5ce5d9){rimraf(_0x7ff37a,function(_0x1bf252){if(_0x1bf252)_0x5ce5d9(_0x1bf252);return _0x1c1f38();});});})[_0x83e6('0x1e')](function(){return _0xdcd88f[_0x83e6('0x116')](_0x429d46,_0x1f091f,function(_0xc7dc){if(_0xc7dc){console['log'](_0x83e6('0x117'),_0xc7dc);}else{fs[_0x83e6('0x118')](_0x429d46);}});});}else{return _0xdcd88f[_0x83e6('0xb4')](0xc8);}})['catch'](handleError(_0xdcd88f,null));}; \ No newline at end of file +var _0x657b=['transcript-','unlinkSync','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','sox','to-csv','ejs','squel','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','./chatInteraction.socket','register','jayson/promise','client','http','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','ChatInteraction,\x20%s,\x20%s','request\x20sent','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','json','count','offset','limit','apply','reject','save','update','then','destroy','stack','name','send','Users','map','Tags','TagIds','forEach','push','index','ChatInteraction','rawAttributes','model','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','pick','select','field','color','from','tools_tags','user_has_chat_interactions','left_join','users','u.id\x20=\x20ui.UserId','chat_interactions','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','advancedFilter','parse','matchType','options','custom','columns','hasMultipleConditions','value','values','table','getConditionValue','isRangeCondition','parseOperator','having','$between','`\x20>\x200','hasOwnProperty','filter','isNil','isEmpty','ChatWebsiteId','where','concat','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20=\x20?','read','`unreadMessages`\x20=\x200','replace','\x27\x27\x27\x27','isNumeric','i.id\x20LIKE\x20?','toString','join','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','SELECT','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','DESC','expr','tag','isArray','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','it.ChatInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','t.id\x20IN\x20?','TagId','it.MailInteractionId\x20=\x20i.id','sequelize','keyBy','merge','a.key','Account.key','a.mandatoryDisposition','c.firstName','Contact.firstName','c.lastName','Contact.lastName','Contact.email','c.phone','Contact.phone','c.mobile','c.fax','Contact.fax','GROUP_CONCAT(DISTINCT\x20t.id)','chat_interaction_has_tags','ui.ChatInteractionId\x20IN\x20?','groupBy','all','show','includeAll','include','find','create','body','params','describe','customUpdate','abandonInteraction,\x20%s,\x20%s,\x20%s','abandon','entity\x20not\x20found','UserId','ValidationError','Interaction\x20already\x20assigned','disposition','file','originalname','basename','filename','type','mimetype','Attachment','attachmentDownload','findOne','Unauthorized','download','root','server/files/attachments/','close','mailTranscript','server/files/chat/upload/','transcript-%s.txt','now','pathTranscript','ChatMessage','Messages','User','ChatWebsite','CmContact','ContactId','format','%s%d','agentAlias','System','customer','Visitor','website_alias','agent_alias','fullname','agent_fullname','[%s]\x20%s:\x20%s\x0a','createdAt','secret','appendFileSync','MailAccount','MailServerOut','Smtp','service','host','port','secure','authentication','auth','SendMail','\x22%s\x22\x20<%s>','email','user','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','omit','getMessages','ChatInteractionId','$gte','split','YYYY-MM-DD\x20HH:mm:ss','findAll','rows','getMyMessages','includeAgent','alias','addTags','setTags','spread','Tag','emit','chatInteractionTags:save','removeTags','unix','files','server','attachments','transcript-%d-%s.zip','lastName','Account','Owner','get','10px','40px','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
Interaction\x20Transcript
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','30px','%s\x20#%d','Chat','YYYY-MM-DD','mkdirSync','N.A.','browserName','osName','referer','customerIp','customerPort','existsSync','createReadStream','pipe','createWriteStream','direction','out','Contact','firstName','renderFile','views','downloadInteraction.html'];(function(_0x2ee7bc,_0x10bf5a){var _0x1dd0b1=function(_0x55d538){while(--_0x55d538){_0x2ee7bc['push'](_0x2ee7bc['shift']());}};_0x1dd0b1(++_0x10bf5a);}(_0x657b,0x126));var _0xb657=function(_0x336990,_0x4e7eb4){_0x336990=_0x336990-0x0;var _0x52294f=_0x657b[_0x336990];return _0x52294f;};'use strict';var pdf=require(_0xb657('0x0'));var emlformat=require(_0xb657('0x1'));var rimraf=require(_0xb657('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb657('0x3'));var rp=require(_0xb657('0x4'));var moment=require(_0xb657('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xb657('0x6'));var util=require('util');var path=require('path');var sox=require(_0xb657('0x7'));var csv=require(_0xb657('0x8'));var ejs=require(_0xb657('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0xb657('0xa'));var crypto=require('crypto');var jsforce=require(_0xb657('0xb'));var deskjs=require(_0xb657('0xc'));var toCsv=require(_0xb657('0x8'));var querystring=require(_0xb657('0xd'));var Papa=require(_0xb657('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xb657('0xf'));var as=require(_0xb657('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb657('0x11'))('api');var utils=require(_0xb657('0x12'));var config=require(_0xb657('0x13'));var db=require(_0xb657('0x14'))['db'];config[_0xb657('0x15')]=_[_0xb657('0x16')](config[_0xb657('0x15')],{'host':_0xb657('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb657('0x15')]));require(_0xb657('0x18'))[_0xb657('0x19')](socket);var jayson=require(_0xb657('0x1a'));var client=jayson[_0xb657('0x1b')][_0xb657('0x1c')]({'port':0x232b});var client9004=jayson['client']['http']({'port':0x232c});function checkPasswordPattern(_0x375b67,_0x1c4ac5,_0x4ae1e4){if(_0x4ae1e4){var _0xbc9008=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0xbc9008['test'](_0x1c4ac5)){return _0x375b67;}else{throw new Error(_0xb657('0x1d'));}}else{return _0x375b67;}}function respondWithRpcPromise(_0x2aafd6,_0x36755c,_0x41716a,_0x26a39e){return new BPromise(function(_0x16df27,_0x3cc347){var _0x3965c6=_0x26a39e||client;return _0x3965c6[_0xb657('0x1e')](_0x2aafd6,_0x41716a)['then'](function(_0x2e6dd3){logger['info'](_0xb657('0x1f'),_0x36755c,_0xb657('0x20'));logger['debug'](_0xb657('0x21'),_0x36755c,_0xb657('0x20'),JSON[_0xb657('0x22')](_0x2e6dd3));if(_0x2e6dd3[_0xb657('0x23')]){if(_0x2e6dd3['error'][_0xb657('0x24')]===0x1f4){logger[_0xb657('0x23')](_0xb657('0x1f'),_0x36755c,_0x2e6dd3[_0xb657('0x23')][_0xb657('0x25')]);return _0x3cc347(_0x2e6dd3[_0xb657('0x23')][_0xb657('0x25')]);}logger[_0xb657('0x23')](_0xb657('0x1f'),_0x36755c,_0x2e6dd3[_0xb657('0x23')][_0xb657('0x25')]);return _0x16df27(_0x2e6dd3[_0xb657('0x23')]['message']);}else{logger['info'](_0xb657('0x1f'),_0x36755c,'request\x20sent');_0x16df27(_0x2e6dd3[_0xb657('0x26')][_0xb657('0x25')]);}})[_0xb657('0x27')](function(_0x29b6a2){logger[_0xb657('0x23')](_0xb657('0x1f'),_0x36755c,_0x29b6a2);_0x3cc347(_0x29b6a2);});});}function respondWithStatusCode(_0x11249f,_0x334cfd){_0x334cfd=_0x334cfd||0xcc;return function(_0x13de72){if(_0x13de72){return _0x11249f[_0xb657('0x28')](_0x334cfd);}return _0x11249f[_0xb657('0x29')](_0x334cfd)['end']();};}function respondWithResult(_0x5ddc9b,_0x3a26ee){_0x3a26ee=_0x3a26ee||0xc8;return function(_0x549766){if(_0x549766){return _0x5ddc9b[_0xb657('0x29')](_0x3a26ee)[_0xb657('0x2a')](_0x549766);}};}function respondWithFilteredResult(_0x97c40d,_0x296820){return function(_0x47ebc9){if(_0x47ebc9){var _0x48da27=_0x47ebc9[_0xb657('0x2b')],_0x2e6fa5=_0x296820['offset'],_0x184c55=_0x296820[_0xb657('0x2c')]+_0x296820[_0xb657('0x2d')],_0x2bb595;if(_0x184c55>=_0x48da27){_0x184c55=_0x48da27;_0x2bb595=0xc8;}else{_0x2bb595=0xce;}_0x97c40d[_0xb657('0x29')](_0x2bb595);return _0x97c40d['set']('Content-Range',_0x2e6fa5+'-'+_0x184c55+'/'+_0x48da27)['json'](_0x47ebc9);}return null;};}function patchUpdates(_0x11356b){return function(_0x14233b){try{jsonpatch[_0xb657('0x2e')](_0x14233b,_0x11356b,!![]);}catch(_0x2fc4f0){return BPromise[_0xb657('0x2f')](_0x2fc4f0);}return _0x14233b[_0xb657('0x30')]();};}function saveUpdates(_0x1b14ff,_0x50614f){return function(_0x50d6d9){if(_0x50d6d9){return _0x50d6d9[_0xb657('0x31')](_0x1b14ff)[_0xb657('0x32')](function(_0x170a2c){return _0x170a2c;});}return null;};}function removeEntity(_0x3c5d6c,_0x1b1228){return function(_0x18098e){if(_0x18098e){return _0x18098e[_0xb657('0x33')]()[_0xb657('0x32')](function(){_0x3c5d6c[_0xb657('0x29')](0xcc)['end']();});}};}function handleEntityNotFound(_0x55046f,_0x2ffd64){return function(_0x3703d8){if(!_0x3703d8){_0x55046f[_0xb657('0x28')](0x194);}return _0x3703d8;};}function handleError(_0x29d7f3,_0x3649b7){_0x3649b7=_0x3649b7||0x1f4;return function(_0x402479){logger['error'](_0x402479[_0xb657('0x34')]);if(_0x402479['name']){delete _0x402479[_0xb657('0x35')];}_0x29d7f3[_0xb657('0x29')](_0x3649b7)[_0xb657('0x36')](_0x402479);};}function getInteractionUsers(_0x54bcf3,_0x4c917b){return new BPromise(function(_0x20b779,_0x4f0759){try{if(_0x4c917b[_0x54bcf3['id']]){_0x54bcf3[_0xb657('0x37')]=_[_0xb657('0x38')](_0x4c917b[_0x54bcf3['id']],function(_0x36a539){return{'id':_0x36a539['id']};});}}catch(_0x32447e){_0x4f0759(_0x32447e);}_0x20b779(_0x54bcf3);});}function getInteractionTags(_0x41b0bd,_0x32a848){return new BPromise(function(_0x115ba8,_0x5a254a){try{if(_0x41b0bd['TagIds']){_0x41b0bd[_0xb657('0x39')]=[];_0x41b0bd[_0xb657('0x3a')]['split'](',')[_0xb657('0x3b')](function(_0x510f1c){_0x41b0bd[_0xb657('0x39')][_0xb657('0x3c')](_0x32a848[_0x510f1c]);});}delete _0x41b0bd[_0xb657('0x3a')];}catch(_0x30adca){_0x5a254a(_0x30adca);}_0x115ba8(_0x41b0bd);});}function updateChatInteraction(_0x126aca,_0x3a0e83,_0x491179){return new BPromise(function(_0x49f0d7,_0x538039){return getInteractionUsers(_0x126aca,_0x491179)[_0xb657('0x32')](function(_0x243e75){return getInteractionTags(_0x243e75,_0x3a0e83);})[_0xb657('0x32')](function(_0x32defe){_0x49f0d7(_0x32defe);})[_0xb657('0x27')](function(_0x47d488){_0x538039(_0x47d488);});});}exports[_0xb657('0x3d')]=function(_0xfe8310,_0x428447){var _0x7521fd={},_0x54a13e={},_0x2dae02={'count':0x0,'rows':[]};var _0x452b88=db[_0xb657('0x3e')][_0xb657('0x3f')];_0x54a13e[_0xb657('0x40')]=_['keys'](_0x452b88);_0x54a13e[_0xb657('0x41')]=_[_0xb657('0x42')](_0xfe8310['query']);_0x54a13e[_0xb657('0x43')]=_['intersection'](_0x54a13e[_0xb657('0x40')],_0x54a13e[_0xb657('0x41')]);_0x7521fd[_0xb657('0x44')]=_[_0xb657('0x45')](_0x54a13e[_0xb657('0x40')],qs[_0xb657('0x46')](_0xfe8310[_0xb657('0x41')]['fields']));_0x7521fd[_0xb657('0x44')]=_0x7521fd[_0xb657('0x44')][_0xb657('0x47')]?_0x7521fd[_0xb657('0x44')]:_0x54a13e['model'];if(!_0xfe8310[_0xb657('0x41')]['hasOwnProperty'](_0xb657('0x48'))){_0x7521fd['limit']=qs['limit'](_0xfe8310[_0xb657('0x41')][_0xb657('0x2d')]);_0x7521fd[_0xb657('0x2c')]=qs[_0xb657('0x2c')](_0xfe8310[_0xb657('0x41')]['offset']);}_0x7521fd[_0xb657('0x49')]=qs[_0xb657('0x4a')](_0xfe8310[_0xb657('0x41')][_0xb657('0x4a')]);_0x7521fd['where']=qs['filters'](_[_0xb657('0x4b')](_0xfe8310[_0xb657('0x41')],_0x54a13e[_0xb657('0x43')]));var _0x2ffd90=[];var _0x51bebd=squel[_0xb657('0x4c')]()[_0xb657('0x4d')]('id')[_0xb657('0x4d')](_0xb657('0x35'))['field'](_0xb657('0x4e'))[_0xb657('0x4f')](_0xb657('0x50'));var _0x55a178=squel[_0xb657('0x4c')]()[_0xb657('0x4d')]('u.id')[_0xb657('0x4d')]('ui.ChatInteractionId')[_0xb657('0x4f')](_0xb657('0x51'),'ui')[_0xb657('0x52')](_0xb657('0x53'),'u',_0xb657('0x54'));var _0x1fb8f=squel[_0xb657('0x4c')]()[_0xb657('0x4f')](_0xb657('0x55'),'i')[_0xb657('0x52')]('cm_contacts','c',_0xb657('0x56'))[_0xb657('0x52')](_0xb657('0x53'),'o',_0xb657('0x57'))['left_join'](_0xb657('0x58'),'a',_0xb657('0x59'))[_0xb657('0x52')](_0xb657('0x5a'),'me',_0xb657('0x5b'));var _0x57a164=squel['expr']();var _0x2b9982=_0xfe8310[_0xb657('0x41')][_0xb657('0x5c')]?JSON[_0xb657('0x5d')](_0xfe8310[_0xb657('0x41')][_0xb657('0x5c')]):undefined;if(_0x2b9982){var _0x296e3f=_0x2b9982[_0xb657('0x5e')]['substr'](0x1);_(_0x2b9982)['omit'](_0xb657('0x5e'))['omitBy'](function(_0x2a130c,_0x4062cd){return _0x2a130c[_0xb657('0x5f')][_0xb657('0x60')]===!![];})[_0xb657('0x42')]()['forEach'](function(_0x2f3e95){var _0x25743a=_0x2b9982[_0x2f3e95];if(_0x25743a[_0xb657('0x5f')][_0xb657('0x61')]){var _0x1205a6=squel['expr']();if(as[_0xb657('0x62')](_0x25743a[_0xb657('0x63')])){var _0x49d652=_[_0xb657('0x64')](_0x25743a[_0xb657('0x63')])[0x0];_0x49d652[_0xb657('0x3b')](function(_0x1fae69){_0x25743a[_0xb657('0x5f')][_0xb657('0x61')][_0xb657('0x3b')](function(_0x571a52){_0x1205a6['or'](_0x25743a['options'][_0xb657('0x65')]+'.'+_0x571a52+'\x20'+as['parseOperator'](_0x1fae69),as[_0xb657('0x66')](_0x1fae69));});});}else{var _0x7c71c9=as[_0xb657('0x67')](_0x25743a[_0xb657('0x63')])?_0x25743a['value'][0x1]:undefined;_0x25743a['options'][_0xb657('0x61')][_0xb657('0x3b')](function(_0x3c609a){_0x1205a6['or'](_0x25743a[_0xb657('0x5f')][_0xb657('0x65')]+'.'+_0x3c609a+'\x20'+as[_0xb657('0x68')](_0x25743a[_0xb657('0x63')]),as[_0xb657('0x66')](_0x25743a[_0xb657('0x63')]),_0x7c71c9);});}_0x57a164[_0x296e3f](_0x1205a6);}else if(as[_0xb657('0x62')](_0x25743a[_0xb657('0x63')])){var _0x49d652=_[_0xb657('0x64')](_0x25743a[_0xb657('0x63')])[0x0];_0x49d652[_0xb657('0x3b')](function(_0x5a9651){if(!_0x25743a[_0xb657('0x5f')][_0xb657('0x69')]){var _0x34dbbb=as[_0xb657('0x67')](_0x5a9651)?_0x5a9651[_0xb657('0x6a')][0x1]:undefined;_0x57a164[_0x296e3f](_0x25743a['options']['table']+'.'+_0x2f3e95+'\x20'+as[_0xb657('0x68')](_0x5a9651),as[_0xb657('0x66')](_0x5a9651),_0x34dbbb);}});}else{if(_0x25743a[_0xb657('0x5f')][_0xb657('0x69')]){var _0x1c1ea8=as[_0xb657('0x66')](_0x25743a[_0xb657('0x63')]);if(_0x1c1ea8['length']===0x1){if(_0x1c1ea8==0x1){_0x1fb8f['having']('`'+_0x2f3e95+'`\x20=\x200');}else{_0x1fb8f[_0xb657('0x69')]('`'+_0x2f3e95+_0xb657('0x6b'));}}}else{var _0x7c71c9=as[_0xb657('0x67')](_0x25743a[_0xb657('0x63')])?_0x25743a[_0xb657('0x63')][_0xb657('0x6a')][0x1]:undefined;_0x57a164[_0x296e3f](_0x25743a[_0xb657('0x5f')]['table']+'.'+_0x2f3e95+'\x20'+as[_0xb657('0x68')](_0x25743a['value']),as[_0xb657('0x66')](_0x25743a[_0xb657('0x63')]),_0x7c71c9);}}});}else{var _0x1ca676=_(Object[_0xb657('0x42')](_0xfe8310['query']))[_0xb657('0x38')](function(_0x53a8cf){return _0x452b88[_0xb657('0x6c')](_0x53a8cf)?_0x53a8cf:undefined;})[_0xb657('0x6d')](function(_0x14be25){return!_[_0xb657('0x6e')](_0x14be25);})[_0xb657('0x63')]();if(!_[_0xb657('0x6f')](_0x1ca676)){_0x1ca676['forEach'](function(_0x45ea0c){if(_0x45ea0c===_0xb657('0x70')){_0x1fb8f[_0xb657('0x71')]('i.ChatWebsiteId\x20IN\x20?',[][_0xb657('0x72')](_0xfe8310[_0xb657('0x41')][_0x45ea0c]));}else if(_0x45ea0c==='createdAt'){var _0x54d4f5=JSON[_0xb657('0x5d')](_0xfe8310[_0xb657('0x41')][_0x45ea0c])['$gte'];var _0x3b981a=JSON[_0xb657('0x5d')](_0xfe8310[_0xb657('0x41')][_0x45ea0c])[_0xb657('0x73')];_0x1fb8f[_0xb657('0x71')](_0xb657('0x74'),_0x54d4f5,_0x3b981a);}else{if(_0xfe8310['query'][_0x45ea0c]===_0xb657('0x75')){_0x1fb8f[_0xb657('0x71')]('i.'+_0x45ea0c+'\x20IS\x20NULL');}else{_0x1fb8f[_0xb657('0x71')]('i.'+_0x45ea0c+_0xb657('0x76'),_0xfe8310[_0xb657('0x41')][_0x45ea0c]);}}});}if(_0xfe8310['query'][_0xb657('0x77')]){if(_0xfe8310['query']['read']==0x1){_0x1fb8f[_0xb657('0x69')](_0xb657('0x78'));}else{_0x1fb8f[_0xb657('0x69')]('`unreadMessages`\x20>\x200');}}if(_0xfe8310[_0xb657('0x41')][_0xb657('0x6d')]){var _0x3e65ca=_0xfe8310[_0xb657('0x41')][_0xb657('0x6d')]['replace']('\x5c','\x5c\x5c')[_0xb657('0x79')]('\x27\x27',_0xb657('0x7a'));if(qs[_0xb657('0x7b')](_0x3e65ca)){_0x57a164['or'](_0xb657('0x7c'),_0x3e65ca+'%');}else{var _0x1f8c59=[];_0x3e65ca['split']('\x20')[_0xb657('0x3b')](function(_0x195842){_0x1f8c59['push']('+'+_0x195842[_0xb657('0x7d')]());});var _0x6ab7a9=_0x1f8c59[_0xb657('0x7e')]('\x20');_0x57a164['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',_0x6ab7a9)['or'](_0xb657('0x7f'),_0x3e65ca+'%');}}}_0x1fb8f[_0xb657('0x71')](_0x57a164);_0x1fb8f[_0xb657('0x80')](_0xb657('0x81'));var _0xf565c3={'type':db[_0xb657('0x82')][_0xb657('0x83')][_0xb657('0x84')],'raw':!![]};var _0x126b9a=_0x1fb8f['clone']();_0x126b9a[_0xb657('0x4d')]('i.id');_0x126b9a[_0xb657('0x4d')](_0xb657('0x85'),_0xb657('0x86'));if(_0x7521fd['order']){_0x7521fd[_0xb657('0x49')][_0xb657('0x3b')](function(_0x2963b4){_0x1fb8f[_0xb657('0x49')]('i.'+_0x2963b4[0x0],_0x2963b4[0x1]===_0xb657('0x87')?![]:!![]);});}var _0x277548=[];var _0x317cc0=squel[_0xb657('0x88')]();if(!_0x2b9982){if(_0xfe8310[_0xb657('0x41')][_0xb657('0x89')]){_0x277548=_[_0xb657('0x8a')](_0xfe8310['query'][_0xb657('0x89')])?_0xfe8310[_0xb657('0x41')][_0xb657('0x89')]:new Array(_0xfe8310[_0xb657('0x41')][_0xb657('0x89')]);_0x277548[_0xb657('0x3b')](function(_0x385b20){_0x317cc0['or'](_0xb657('0x8b'),'%,'+_0x385b20+',%');});_0x1fb8f[_0xb657('0x69')](_0x317cc0);_0x126b9a['left_join']('chat_interaction_has_tags','it',_0xb657('0x8c'));_0x126b9a[_0xb657('0x52')](_0xb657('0x50'),'t',_0xb657('0x8d'));_0x126b9a[_0xb657('0x71')](_0xb657('0x8e'),_0x277548);}}else{if(_0x2b9982[_0xb657('0x6c')](_0xb657('0x8f'))){if(as[_0xb657('0x62')](_0x2b9982['TagId'][_0xb657('0x63')])){var _0x1bbab9=_[_0xb657('0x64')](_0x2b9982['TagId'][_0xb657('0x63')])[0x0];_0x1bbab9['forEach'](function(_0x136c9d){as[_0xb657('0x66')](_0x136c9d)[_0xb657('0x3b')](function(_0x1d239e){_0x277548['push'](_0x1d239e);});});}else{_0x277548=as[_0xb657('0x66')](_0x2b9982[_0xb657('0x8f')]['value']);}_0x277548[_0xb657('0x3b')](function(_0x50a46f){_0x317cc0['or'](_0xb657('0x8b'),'%,'+_0x50a46f+',%');});_0x1fb8f[_0xb657('0x69')](_0x317cc0);_0x126b9a[_0xb657('0x52')]('mail_interaction_has_tags','it',_0xb657('0x90'));_0x126b9a['left_join'](_0xb657('0x50'),'t',_0xb657('0x8d'));_0x126b9a[_0xb657('0x71')]('t.id\x20IN\x20?',_0x277548);}}db[_0xb657('0x91')][_0xb657('0x41')](_0x126b9a[_0xb657('0x7d')](),_0xf565c3)[_0xb657('0x32')](function(_0x45a6c0){_0x2dae02['count']=_0x45a6c0[_0xb657('0x47')];if(_0x2dae02['count']===0x0)return[];return db[_0xb657('0x91')][_0xb657('0x41')](_0x51bebd[_0xb657('0x7d')](),_0xf565c3)['then'](function(_0x278787){_0x2ffd90=_[_0xb657('0x92')](_0x278787,'id');_0xf565c3=_[_0xb657('0x93')](_0xf565c3,{'model':db['ChatInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});_0x1fb8f['field'](_0xb657('0x85'),_0xb657('0x86'));_0x1fb8f[_0xb657('0x4d')](_0xb657('0x94'),_0xb657('0x95'));_0x1fb8f['field'](_0xb657('0x96'),'Account.mandatoryDisposition');_0x1fb8f[_0xb657('0x4d')]('i.*');_0x1fb8f[_0xb657('0x4d')](_0xb657('0x97'),_0xb657('0x98'));_0x1fb8f[_0xb657('0x4d')](_0xb657('0x99'),_0xb657('0x9a'));_0x1fb8f['field']('c.email',_0xb657('0x9b'));_0x1fb8f[_0xb657('0x4d')](_0xb657('0x9c'),_0xb657('0x9d'));_0x1fb8f[_0xb657('0x4d')](_0xb657('0x9e'),'Contact.mobile');_0x1fb8f['field'](_0xb657('0x9f'),_0xb657('0xa0'));_0x1fb8f[_0xb657('0x4d')](_0xb657('0xa1'),_0xb657('0x3a'));_0x1fb8f['left_join'](_0xb657('0xa2'),'it',_0xb657('0x8c'));_0x1fb8f[_0xb657('0x52')](_0xb657('0x50'),'t','t.id\x20=\x20it.TagId');_0x1fb8f[_0xb657('0x2d')](_0x7521fd[_0xb657('0x2d')]);_0x1fb8f[_0xb657('0x2c')](_0x7521fd[_0xb657('0x2c')]);return db[_0xb657('0x91')][_0xb657('0x41')](_0x1fb8f[_0xb657('0x7d')](),_0xf565c3);})['then'](function(_0xe423e){_0x55a178[_0xb657('0x71')](_0xb657('0xa3'),_['map'](_0xe423e,'id'));return db[_0xb657('0x91')][_0xb657('0x41')](_0x55a178[_0xb657('0x7d')](),_0xf565c3)['then'](function(_0x5cab80){var _0x5a90=_[_0xb657('0xa4')](_0x5cab80,'ChatInteractionId');var _0x4e76d3=[];_0xe423e[_0xb657('0x3b')](function(_0x2ed44c){_0x4e76d3[_0xb657('0x3c')](updateChatInteraction(_0x2ed44c,_0x2ffd90,_0x5a90));});return BPromise[_0xb657('0xa5')](_0x4e76d3);});});})[_0xb657('0x32')](function(_0x31b3cf){_0x2dae02['rows']=_0x31b3cf;return _0x2dae02;})[_0xb657('0x32')](respondWithFilteredResult(_0x428447,_0x7521fd))[_0xb657('0x27')](handleError(_0x428447,null));};exports[_0xb657('0xa6')]=function(_0x102e13,_0x6b597c){var _0x5e272b={'raw':![],'where':{'id':_0x102e13['params']['id']}},_0x32849c={};_0x32849c[_0xb657('0x40')]=_[_0xb657('0x42')](db[_0xb657('0x3e')][_0xb657('0x3f')]);_0x32849c[_0xb657('0x41')]=_['keys'](_0x102e13[_0xb657('0x41')]);_0x32849c[_0xb657('0x43')]=_[_0xb657('0x45')](_0x32849c[_0xb657('0x40')],_0x32849c[_0xb657('0x41')]);_0x5e272b[_0xb657('0x44')]=_[_0xb657('0x45')](_0x32849c['model'],qs[_0xb657('0x46')](_0x102e13[_0xb657('0x41')][_0xb657('0x46')]));_0x5e272b['attributes']=_0x5e272b['attributes'][_0xb657('0x47')]?_0x5e272b[_0xb657('0x44')]:_0x32849c[_0xb657('0x40')];if(_0x102e13[_0xb657('0x41')][_0xb657('0xa7')]){_0x5e272b[_0xb657('0xa8')]=[{'all':!![]}];}_0x5e272b=_[_0xb657('0x93')]({},_0x5e272b,_0x102e13['options']);return db['ChatInteraction'][_0xb657('0xa9')](_0x5e272b)[_0xb657('0x32')](handleEntityNotFound(_0x6b597c,null))[_0xb657('0x32')](respondWithResult(_0x6b597c,null))[_0xb657('0x27')](handleError(_0x6b597c,null));};exports[_0xb657('0xaa')]=function(_0x214631,_0x1a07e1){return db[_0xb657('0x3e')]['create'](_0x214631[_0xb657('0xab')],{})[_0xb657('0x32')](respondWithResult(_0x1a07e1,0xc9))['catch'](handleError(_0x1a07e1,null));};exports[_0xb657('0x31')]=function(_0x111b25,_0x477b9f){if(_0x111b25['body']['id']){delete _0x111b25[_0xb657('0xab')]['id'];}return db[_0xb657('0x3e')][_0xb657('0xa9')]({'where':{'id':_0x111b25['params']['id']}})['then'](handleEntityNotFound(_0x477b9f,null))[_0xb657('0x32')](saveUpdates(_0x111b25[_0xb657('0xab')],null))[_0xb657('0x32')](respondWithResult(_0x477b9f,null))[_0xb657('0x27')](handleError(_0x477b9f,null));};exports[_0xb657('0x33')]=function(_0x28df3d,_0x1a7e93){return db[_0xb657('0x3e')][_0xb657('0xa9')]({'where':{'id':_0x28df3d[_0xb657('0xac')]['id']}})[_0xb657('0x32')](handleEntityNotFound(_0x1a7e93,null))[_0xb657('0x32')](removeEntity(_0x1a7e93,null))['catch'](handleError(_0x1a7e93,null));};exports[_0xb657('0xad')]=function(_0x231383,_0x544d56){return db[_0xb657('0x3e')][_0xb657('0xad')]()[_0xb657('0x32')](respondWithResult(_0x544d56,null))[_0xb657('0x27')](handleError(_0x544d56,null));};exports[_0xb657('0xae')]=function(_0x685a3b,_0x4bae97){if(_0x685a3b[_0xb657('0xab')]['id']){delete _0x685a3b[_0xb657('0xab')]['id'];}return db[_0xb657('0x3e')][_0xb657('0xa9')]({'where':{'id':_0x685a3b[_0xb657('0xac')]['id']}})[_0xb657('0x32')](handleEntityNotFound(_0x4bae97,null))[_0xb657('0x32')](saveUpdates(_0x685a3b[_0xb657('0xab')],null))[_0xb657('0x32')](respondWithResult(_0x4bae97,null))[_0xb657('0x27')](handleError(_0x4bae97,null));};exports['abandon']=function(_0x293546,_0x10f193,_0x1b6389){if(_0x293546['body']['id']){delete _0x293546[_0xb657('0xab')]['id'];}return db[_0xb657('0x3e')]['find']({'where':{'id':_0x293546['params']['id']}})[_0xb657('0x32')](function(_0x2abc4f){if(!_0x2abc4f){logger[_0xb657('0x23')](_0xb657('0xaf'),_0xb657('0xb0'),0x194,_0xb657('0xb1'));_0x10f193[_0xb657('0x28')](0x194);}else{if(_0x2abc4f[_0xb657('0xb2')]){throw new db[(_0xb657('0x82'))][(_0xb657('0xb3'))](_0xb657('0xb4'));}}return _0x2abc4f;})[_0xb657('0x32')](function(_0x54a17c){if(_0x54a17c){return _0x54a17c[_0xb657('0x31')]({'closed':_0x293546[_0xb657('0xab')]['closed'],'disposition':_0x293546['body'][_0xb657('0xb5')]})[_0xb657('0x32')](function(_0x5b8798){return _0x5b8798;});}})[_0xb657('0x32')](function(_0x334d1f){return respondWithRpcPromise('AbandonInteraction',_0xb657('0xb0'),_0x293546[_0xb657('0xab')],client9004);})[_0xb657('0x32')](respondWithResult(_0x10f193,null))[_0xb657('0x27')](handleError(_0x10f193,null));};exports['attachmentUpload']=function(_0x24611f,_0x2789b3,_0x19f6c5){_0x24611f[_0xb657('0xab')][_0xb657('0x35')]=_0x24611f[_0xb657('0xb6')][_0xb657('0xb7')];_0x24611f[_0xb657('0xab')][_0xb657('0xb8')]=_0x24611f[_0xb657('0xb6')][_0xb657('0xb9')];_0x24611f['body'][_0xb657('0xba')]=_0x24611f[_0xb657('0xb6')][_0xb657('0xbb')];return db[_0xb657('0xbc')][_0xb657('0xaa')](_0x24611f[_0xb657('0xab')])[_0xb657('0x32')](respondWithResult(_0x2789b3,0xc9))[_0xb657('0x27')](handleError(_0x2789b3,null));};exports[_0xb657('0xbd')]=function(_0xddfd66,_0x5bda88,_0x50c020){return db['ChatInteraction'][_0xb657('0xbe')]({'where':{'id':_0xddfd66['params']['id']},'raw':!![]})['then'](handleEntityNotFound(_0x5bda88,null))[_0xb657('0x32')](function(_0x56e989){if(_0x56e989){if(_0x56e989['closed']){return _0x5bda88[_0xb657('0x29')](0x193)[_0xb657('0x2a')]({'status':0x193,'message':_0xb657('0xbf')});}return db[_0xb657('0xbc')][_0xb657('0xbe')]({'where':{'id':_0xddfd66['query']['attachId']},'raw':!![]})[_0xb657('0x32')](handleEntityNotFound(_0x5bda88,null));}})['then'](function(_0x47a2c3){if(_0x47a2c3){return _0x5bda88[_0xb657('0xc0')](path[_0xb657('0x7e')](config[_0xb657('0xc1')],_0xb657('0xc2'),_0x47a2c3['basename']));}})['catch'](handleError(_0x5bda88,null));};exports[_0xb657('0xc3')]=function(_0x1b7534,_0x2a151c){var _0x2f0307=null;var _0x5b3e05=null;var _0x12a925=null;var _0x242492=null;if(_0x1b7534[_0xb657('0xab')]['id']){delete _0x1b7534[_0xb657('0xab')]['id'];}if(_0x1b7534['body'][_0xb657('0xc4')]){_0x242492=path[_0xb657('0x7e')](config['root'],_0xb657('0xc5'),util['format'](_0xb657('0xc6'),Date[_0xb657('0xc7')]()));_0x1b7534['body'][_0xb657('0xc8')]=_0x242492;}return db[_0xb657('0x3e')][_0xb657('0xa9')]({'where':{'id':_0x1b7534[_0xb657('0xac')]['id']},'include':[{'model':db[_0xb657('0xc9')],'as':_0xb657('0xca'),'include':[{'model':db[_0xb657('0xcb')],'as':'User'}]}]})[_0xb657('0x32')](handleEntityNotFound(_0x2a151c,null))['then'](saveUpdates(_0x1b7534['body'],null))[_0xb657('0x32')](function(_0x14b0d6){if(_0x14b0d6){_0x2f0307=_0x14b0d6;return db[_0xb657('0xcc')][_0xb657('0xa9')]({'where':{'id':_0x2f0307[_0xb657('0x70')]}});}})[_0xb657('0x32')](function(_0x3f839b){if(_0x3f839b){_0x12a925=_0x3f839b;return db[_0xb657('0xcd')][_0xb657('0xa9')]({'where':{'id':_0x2f0307[_0xb657('0xce')]}});}})['then'](function(_0x544d16){if(_0x544d16){_0x5b3e05=_0x544d16;if(_0x242492){var _0x39f850=null;for(var _0x49460a=0x1;_0x49460a<_0x2f0307[_0xb657('0xca')][_0xb657('0x47')];++_0x49460a){_0x39f850=_0x2f0307[_0xb657('0xca')][_0x49460a];var _0x2cce99=_0x39f850[_0xb657('0xb2')]?util[_0xb657('0xcf')](_0xb657('0xd0'),_0x12a925[_0xb657('0xd1')],_0x39f850['UserId']):_0xb657('0xd2');var _0x27f194=_0x1b7534[_0xb657('0xab')][_0xb657('0xd3')]||util[_0xb657('0xcf')](_0xb657('0xd0'),_0xb657('0xd4'),_0x39f850[_0xb657('0xce')]);switch(_0x12a925['agentIdentifier']){case _0xb657('0xd5'):_0x2cce99=_0x39f850[_0xb657('0xb2')]?util[_0xb657('0xcf')]('%s%d',_0x12a925['agentAlias'],_0x39f850['UserId']):_0xb657('0xd2');break;case _0xb657('0xd6'):_0x2cce99=_0x39f850[_0xb657('0xb2')]?_0x39f850['User']['alias']||_0x39f850[_0xb657('0xcb')][_0xb657('0xd7')]:'System';break;case _0xb657('0xd8'):_0x2cce99=_0x39f850[_0xb657('0xb2')]?_0x39f850[_0xb657('0xcb')][_0xb657('0xd7')]:_0xb657('0xd2');break;default:_0x2cce99=_0x39f850[_0xb657('0xb2')]?util[_0xb657('0xcf')](_0xb657('0xd0'),_0x12a925[_0xb657('0xd1')],_0x39f850[_0xb657('0xb2')]):_0xb657('0xd2');}var _0x3b3ca1=util[_0xb657('0xcf')](_0xb657('0xd9'),moment(_0x39f850[_0xb657('0xda')])[_0xb657('0xcf')]('MM/DD/YYYY\x20HH:mm:ss'),_0x39f850['direction']==='in'?_0x27f194:_0x2cce99,_0x39f850['body']);if(!_0x39f850[_0xb657('0xdb')]){fs[_0xb657('0xdc')](_0x242492,_0x3b3ca1);}}return db[_0xb657('0xdd')][_0xb657('0xbe')]({'where':{'service':!![]},'include':[{'model':db[_0xb657('0xde')],'as':'Smtp','raw':!![]}]});}}})[_0xb657('0x32')](function(_0x5f0394){if(_0x5f0394&&_0x5f0394[_0xb657('0xdf')]&&_0x1b7534[_0xb657('0xab')]){var _0x57ffbf={'tls':{'rejectUnauthorized':![]}};if(_0x5f0394[_0xb657('0xdf')][_0xb657('0xe0')]){_0x57ffbf[_0xb657('0xe0')]=_0x5f0394[_0xb657('0xdf')][_0xb657('0xe0')];}else{_0x57ffbf[_0xb657('0xe1')]=_0x5f0394['Smtp'][_0xb657('0xe1')];_0x57ffbf[_0xb657('0xe2')]=_0x5f0394[_0xb657('0xdf')][_0xb657('0xe2')];_0x57ffbf[_0xb657('0xe3')]=_0x5f0394[_0xb657('0xdf')][_0xb657('0xe3')];}if(_0x5f0394[_0xb657('0xdf')][_0xb657('0xe4')]){_0x57ffbf[_0xb657('0xe5')]={'user':_0x5f0394[_0xb657('0xdf')]['user'],'pass':_0x5f0394[_0xb657('0xdf')]['pass']};}return respondWithRpcPromise(_0xb657('0xe6'),'sendMail',{'account':_0x57ffbf,'message':{'from':util[_0xb657('0xcf')](_0xb657('0xe7'),_0x5f0394['name'],_0x5f0394[_0xb657('0xe8')]||_0x5f0394[_0xb657('0xdf')][_0xb657('0xe9')]),'to':_0x1b7534['body']['mailTranscript'],'subject':_0xb657('0xea'),'text':util[_0xb657('0xcf')](_0xb657('0xeb'),_0x1b7534[_0xb657('0xab')]['mailTranscript']),'attachments':[{'path':_0x242492}]}})[_0xb657('0x32')](function(){return _0x2f0307;})[_0xb657('0x27')](function(_0x26079e){console[_0xb657('0x23')](_0x26079e);});}else{return _0x2f0307;}})[_0xb657('0x32')](respondWithStatusCode(_0x2a151c,0xc8))[_0xb657('0x27')](handleError(_0x2a151c,null));};exports['addMessage']=function(_0x3ea20d,_0x9073b3,_0x250cda){return db['ChatMessage'][_0xb657('0xa9')]({'where':{'id':_0x3ea20d[_0xb657('0xac')]['id']}})[_0xb657('0x32')](handleEntityNotFound(_0x9073b3,null))['then'](function(_0x10e87c){if(_0x10e87c){return _0x10e87c[_0xb657('0xec')](_0x3ea20d['body'][_0xb657('0xed')],_[_0xb657('0xee')](_0x3ea20d[_0xb657('0xab')],[_0xb657('0xed'),'id'])||{});}})[_0xb657('0x32')](respondWithResult(_0x9073b3,null))[_0xb657('0x27')](handleError(_0x9073b3,null));};exports[_0xb657('0xef')]=function(_0x4abb63,_0x49e069,_0x51772a){var _0x3d0763={'raw':![],'where':{}};var _0x55b2c7={};var _0x288baf={'count':0x0,'rows':[]};return db[_0xb657('0x3e')][_0xb657('0xbe')]({'where':{'id':_0x4abb63[_0xb657('0xac')]['id']}})['then'](handleEntityNotFound(_0x49e069,null))[_0xb657('0x32')](function(_0x4d38b6){if(_0x4d38b6){_0x55b2c7[_0xb657('0x40')]=_[_0xb657('0x42')](db['ChatMessage'][_0xb657('0x3f')]);_0x55b2c7[_0xb657('0x41')]=_[_0xb657('0x42')](_0x4abb63[_0xb657('0x41')]);_0x55b2c7[_0xb657('0x43')]=_[_0xb657('0x45')](_0x55b2c7['model'],_0x55b2c7[_0xb657('0x41')]);_0x3d0763[_0xb657('0x44')]=_[_0xb657('0x45')](_0x55b2c7[_0xb657('0x40')],qs['fields'](_0x4abb63[_0xb657('0x41')]['fields']));_0x3d0763[_0xb657('0x44')]=_0x3d0763['attributes'][_0xb657('0x47')]?_0x3d0763[_0xb657('0x44')]:_0x55b2c7['model'];if(!_0x4abb63[_0xb657('0x41')][_0xb657('0x6c')]('nolimit')){_0x3d0763[_0xb657('0x2d')]=qs[_0xb657('0x2d')](_0x4abb63[_0xb657('0x41')][_0xb657('0x2d')]);_0x3d0763[_0xb657('0x2c')]=qs['offset'](_0x4abb63[_0xb657('0x41')]['offset']);}_0x3d0763[_0xb657('0x49')]=qs['sort'](_0x4abb63[_0xb657('0x41')][_0xb657('0x4a')]);_0x3d0763[_0xb657('0x71')]=qs[_0xb657('0x43')](_['pick'](_0x4abb63[_0xb657('0x41')],_0x55b2c7[_0xb657('0x43')]));_0x3d0763[_0xb657('0x71')][_0xb657('0xf0')]=_0x4d38b6['id'];if(_0x4abb63[_0xb657('0x41')][_0xb657('0x6d')]){_0x3d0763[_0xb657('0x71')]=_[_0xb657('0x93')](_0x3d0763[_0xb657('0x71')],{'$or':_[_0xb657('0x38')](_0x3d0763[_0xb657('0x44')],function(_0x2182d5){var _0x414ef4={};_0x414ef4[_0x2182d5]={'$like':'%'+_0x4abb63[_0xb657('0x41')][_0xb657('0x6d')]+'%'};return _0x414ef4;})});}if(_0x4abb63[_0xb657('0x41')][_0xb657('0xf1')]){var _0x4b2072=_0x4abb63['query'][_0xb657('0xf1')][_0xb657('0xf2')](',');var _0x268aa7={};_0x268aa7[_0x4b2072[0x0]]={'$gte':moment(_0x4b2072[0x1])[_0xb657('0xcf')](_0xb657('0xf3'))};_0x3d0763[_0xb657('0x71')]=_['merge'](_0x3d0763[_0xb657('0x71')],_0x268aa7);}_0x3d0763=_[_0xb657('0x93')]({},_0x3d0763,_0x4abb63[_0xb657('0x5f')]);return db[_0xb657('0xc9')][_0xb657('0x2b')]({'where':_0x3d0763[_0xb657('0x71')]})[_0xb657('0x32')](function(_0x5eb1f7){_0x288baf[_0xb657('0x2b')]=_0x5eb1f7;if(_0x4abb63[_0xb657('0x41')][_0xb657('0xa7')]){_0x3d0763[_0xb657('0xa8')]=[{'all':!![]}];}return db[_0xb657('0xc9')][_0xb657('0xf4')](_0x3d0763);})[_0xb657('0x32')](function(_0x296d45){_0x288baf[_0xb657('0xf5')]=_0x296d45;return _0x288baf;});}})[_0xb657('0x32')](respondWithFilteredResult(_0x49e069,_0x3d0763))['catch'](handleError(_0x49e069,null));};exports[_0xb657('0xf6')]=function(_0x248a27,_0x1cf2ee,_0xd207a){var _0x500430={'where':{}},_0x3af1f2={},_0x4bb203={'count':0x0,'rows':[]};return db[_0xb657('0x3e')][_0xb657('0xbe')]({'where':{'id':_0x248a27[_0xb657('0xac')]['id']}})[_0xb657('0x32')](handleEntityNotFound(_0x1cf2ee,null))[_0xb657('0x32')](function(_0x574939){if(_0x574939){_0x3af1f2['model']=_[_0xb657('0x42')](db[_0xb657('0xc9')][_0xb657('0x3f')]);_0x3af1f2[_0xb657('0x41')]=_['keys'](_0x248a27[_0xb657('0x41')]);_0x3af1f2['filters']=_['intersection'](_0x3af1f2[_0xb657('0x40')],_0x3af1f2['query']);_0x500430[_0xb657('0x44')]=_[_0xb657('0x45')](_0x3af1f2['model'],qs[_0xb657('0x46')](_0x248a27[_0xb657('0x41')]['fields']));_0x500430[_0xb657('0x44')]=_0x500430[_0xb657('0x44')][_0xb657('0x47')]?_0x500430[_0xb657('0x44')]:_0x3af1f2[_0xb657('0x40')];if(!_0x248a27[_0xb657('0x41')]['hasOwnProperty'](_0xb657('0x48'))){_0x500430['limit']=qs[_0xb657('0x2d')](_0x248a27['query']['limit']);_0x500430[_0xb657('0x2c')]=qs[_0xb657('0x2c')](_0x248a27['query'][_0xb657('0x2c')]);}_0x500430['order']=qs[_0xb657('0x4a')](_0x248a27[_0xb657('0x41')][_0xb657('0x4a')]);_0x500430['where']=qs[_0xb657('0x43')](_[_0xb657('0x4b')](_0x248a27['query'],_0x3af1f2[_0xb657('0x43')]));_0x500430[_0xb657('0x71')]['ChatInteractionId']=_0x574939['id'];if(_0x248a27[_0xb657('0x41')][_0xb657('0x6d')]){_0x500430['where']=_['merge'](_0x500430[_0xb657('0x71')],{'$or':_[_0xb657('0x38')](_0x500430[_0xb657('0x44')],function(_0x204468){var _0x271a03={};_0x271a03[_0x204468]={'$like':'%'+_0x248a27[_0xb657('0x41')][_0xb657('0x6d')]+'%'};return _0x271a03;})});}_0x500430[_0xb657('0x71')][_0xb657('0xdb')]=![];if(_0x248a27[_0xb657('0x41')]['id']){_0x500430[_0xb657('0x71')]['id']={'$gt':_0x248a27['query']['id']};}_0x500430=_['merge']({},_0x500430,_0x248a27[_0xb657('0x5f')]);return db[_0xb657('0xc9')][_0xb657('0x2b')]({'where':_0x500430[_0xb657('0x71')]})['then'](function(_0x591aa9){_0x4bb203[_0xb657('0x2b')]=_0x591aa9;_0x500430[_0xb657('0xa8')]=[];if(_0x248a27[_0xb657('0x41')][_0xb657('0xf7')]){_0x500430[_0xb657('0xa8')][_0xb657('0x3c')]({'model':db[_0xb657('0xcb')],'as':_0xb657('0xcb'),'attributes':['id',_0xb657('0xd7'),_0xb657('0xf8')]});}if(_0x248a27[_0xb657('0x41')]['includeAll']){_0x500430[_0xb657('0xa8')]=[{'all':!![]}];}return db['ChatMessage'][_0xb657('0xf4')](_0x500430);})['then'](function(_0x4dab6a){_0x4bb203['rows']=_0x4dab6a;return _0x4bb203;});}})[_0xb657('0x32')](respondWithFilteredResult(_0x1cf2ee,_0x500430))[_0xb657('0x27')](handleError(_0x1cf2ee,null));};exports[_0xb657('0xf9')]=function(_0x4782b1,_0x16c7d2,_0x2191bb){return db[_0xb657('0x3e')]['find']({'where':{'id':_0x4782b1[_0xb657('0xac')]['id']}})[_0xb657('0x32')](handleEntityNotFound(_0x16c7d2,null))[_0xb657('0x32')](function(_0x4a496d){if(_0x4a496d){return _0x4a496d[_0xb657('0xfa')](_0x4782b1[_0xb657('0xab')][_0xb657('0xed')],_[_0xb657('0xee')](_0x4782b1[_0xb657('0xab')],[_0xb657('0xed'),'id'])||{})[_0xb657('0xfb')](function(){return db[_0xb657('0xfc')][_0xb657('0xf4')]({'attributes':['id','name',_0xb657('0x4e')],'where':{'id':_0x4782b1[_0xb657('0xab')][_0xb657('0xed')]}});})[_0xb657('0x32')](function(_0x6e8dff){socket[_0xb657('0xfd')](_0xb657('0xfe'),{'id':Number(_0x4782b1['params']['id']),'tags':_0x6e8dff||[]});return{'id':Number(_0x4782b1[_0xb657('0xac')]['id']),'tags':_0x6e8dff||[]};});}})[_0xb657('0x32')](respondWithResult(_0x16c7d2,null))['catch'](handleError(_0x16c7d2,null));};exports['removeTags']=function(_0x4391e4,_0x565aed,_0x41c158){return db[_0xb657('0x3e')][_0xb657('0xa9')]({'where':{'id':_0x4391e4['params']['id']}})[_0xb657('0x32')](handleEntityNotFound(_0x565aed,null))['then'](function(_0x2e89a3){if(_0x2e89a3){return _0x2e89a3[_0xb657('0xff')](_0x4391e4[_0xb657('0x41')]['ids']);}})[_0xb657('0x32')](respondWithStatusCode(_0x565aed,null))['catch'](handleError(_0x565aed,null));};exports['download']=function(_0x3ecf42,_0x542fff){var _0x5c5a79=moment()[_0xb657('0x100')]()['toString']();var _0x1e61cf=path[_0xb657('0x7e')](config[_0xb657('0xc1')],'server',_0xb657('0x101'),'tmp');var _0x3d784a=path[_0xb657('0x7e')](config['root'],_0xb657('0x102'),_0xb657('0x101'),_0xb657('0x103'));var _0x4323f1=path[_0xb657('0x7e')](_0x1e61cf,_0x5c5a79);var _0x497104=util[_0xb657('0xcf')](_0xb657('0x104'),_0x3ecf42[_0xb657('0xac')]['id'],_0x5c5a79);var _0x356056=path['join'](_0x1e61cf,_0x497104);var _0x4b30fe=![];return db['ChatInteraction']['find']({'where':{'id':_0x3ecf42[_0xb657('0xac')]['id']},'include':[{'model':db[_0xb657('0xc9')],'as':_0xb657('0xca'),'attributes':['id',_0xb657('0xab'),_0xb657('0xda'),'direction','secret',_0xb657('0x77')],'include':[{'model':db['User'],'as':'User','attributes':['id',_0xb657('0xd7')],'raw':!![]},{'model':db[_0xb657('0xcd')],'as':'Contact','attributes':['id','firstName',_0xb657('0x105')],'raw':!![]},{'model':db[_0xb657('0xbc')],'as':_0xb657('0xbc'),'raw':!![]}]},{'model':db[_0xb657('0xcc')],'as':_0xb657('0x106'),'attributes':['id','name']},{'model':db[_0xb657('0xcb')],'as':_0xb657('0x107'),'attributes':['id',_0xb657('0xd7')]}]})[_0xb657('0x32')](handleEntityNotFound(_0x542fff,null))[_0xb657('0x32')](function(_0x275d5c){if(_0x275d5c){var _0x5bc8a2=_0x275d5c[_0xb657('0x108')]({'plain':!![]});_0x4b30fe=!![];var _0x39227d={'format':'A4','border':_0xb657('0x109'),'header':{'height':_0xb657('0x10a'),'contents':{'first':_0xb657('0x10b')}},'footer':{'height':_0xb657('0x10c'),'contents':{'default':util[_0xb657('0xcf')]('\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{{page}}/{{pages}}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',util[_0xb657('0xcf')](_0xb657('0x10d'),_0xb657('0x10e'),_0x5bc8a2['id']),moment()[_0xb657('0xcf')](_0xb657('0x10f'))[_0xb657('0x7d')]())}}};fs[_0xb657('0x110')](_0x4323f1);var _0x1a1f5b={'channel':_0xb657('0x10e'),'account':_0x5bc8a2[_0xb657('0x106')][_0xb657('0x35')],'agent':_0x5bc8a2[_0xb657('0x107')]?_0x5bc8a2[_0xb657('0x107')][_0xb657('0xd7')]:_0xb657('0x111'),'createdAt':moment(_0x5bc8a2[_0xb657('0xda')])[_0xb657('0xcf')](_0xb657('0xf3'))[_0xb657('0x7d')](),'closedAt':_0x5bc8a2['closed']?moment(_0x5bc8a2['closedAt'])[_0xb657('0xcf')](_0xb657('0xf3'))[_0xb657('0x7d')]():'','disposition':_0x5bc8a2['disposition'],'chatInfo':{'browser':_0x5bc8a2[_0xb657('0x112')],'os':_0x5bc8a2[_0xb657('0x113')],'referer':_0x5bc8a2[_0xb657('0x114')],'customerIp':_0x5bc8a2[_0xb657('0x115')],'customerPort':_0x5bc8a2[_0xb657('0x116')]?_0x5bc8a2[_0xb657('0x116')]:_0xb657('0x111')},'messages':_(_0x5bc8a2[_0xb657('0xca')])['tail']()[_0xb657('0x6d')]({'secret':![]})[_0xb657('0x38')](function(_0x2641b1){if(_0x2641b1['Attachment']){var _0x25c6e5=path['join'](_0x3d784a,_0x2641b1[_0xb657('0xbc')][_0xb657('0xb8')]);if(fs[_0xb657('0x117')](_0x25c6e5)){fs[_0xb657('0x118')](_0x25c6e5)[_0xb657('0x119')](fs[_0xb657('0x11a')](path[_0xb657('0x7e')](_0x4323f1,_0x2641b1['Attachment']['basename'])));}}return{'date':moment(_0x2641b1[_0xb657('0xda')])[_0xb657('0xcf')](_0xb657('0xf3'))[_0xb657('0x7d')](),'sender':_0x2641b1[_0xb657('0x11b')]===_0xb657('0x11c')?_0x2641b1[_0xb657('0xcb')]?_0x2641b1['User'][_0xb657('0xd7')]:_0xb657('0xd2'):_0x2641b1[_0xb657('0x11d')][_0xb657('0x11e')]+(_0x2641b1[_0xb657('0x11d')][_0xb657('0x105')]?'\x20'+_0x2641b1[_0xb657('0x11d')][_0xb657('0x105')]:''),'body':_0x2641b1[_0xb657('0xbc')]?_0x2641b1[_0xb657('0xbc')][_0xb657('0xb8')]:_0x2641b1[_0xb657('0xab')],'direction':_0x2641b1[_0xb657('0x11b')]===_0xb657('0x11c')?'A':'C','secret':_0x2641b1[_0xb657('0xdb')],'read':_0x2641b1[_0xb657('0x77')],'attachment':_0x2641b1[_0xb657('0xbc')]};})[_0xb657('0x63')]()};return ejs[_0xb657('0x11f')](path[_0xb657('0x7e')](config[_0xb657('0xc1')],_0xb657('0x102'),_0xb657('0x120'),_0xb657('0x121')),{'interaction':_0x1a1f5b})['then'](function(_0x15a28f){return new BPromise(function(_0xeec4c4,_0x50f597){pdf[_0xb657('0xaa')](_0x15a28f,_0x39227d)['toFile'](path[_0xb657('0x7e')](_0x4323f1,_0xb657('0x122')+_0x5bc8a2['id']+'-'+_0x5c5a79+'.pdf'),function(_0x1d3a6c,_0x2ae9ba){if(_0x1d3a6c)return _0x50f597(_0x1d3a6c);_0xeec4c4(_0x2ae9ba);});});});}})[_0xb657('0x32')](function(){if(_0x4b30fe){return new BPromise(function(_0x52838d,_0x1fd455){zipdir(_0x4323f1,{'saveTo':_0x356056},function(_0x4a9600,_0x28eb51){if(_0x4a9600)return _0x1fd455(_0x4a9600);return _0x52838d(_0x28eb51);});})[_0xb657('0x32')](function(){return new BPromise(function(_0x4d1b12,_0x13efc6){rimraf(_0x4323f1,function(_0xe0927b){if(_0xe0927b)_0x13efc6(_0xe0927b);return _0x4d1b12();});});})['then'](function(){return _0x542fff[_0xb657('0xc0')](_0x356056,_0x497104,function(_0x88df4){if(_0x88df4){console['log']('err',_0x88df4);}else{fs[_0xb657('0x123')](_0x356056);}});});}else{return _0x542fff[_0xb657('0x28')](0xc8);}})[_0xb657('0x27')](handleError(_0x542fff,null));}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js index b562c49..ba23d5c 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 _0x07a5=['save','remove','getUsers','then','Users','map','unreadMessages','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','ChatInteraction','ChatMessage','setMaxListeners'];(function(_0x1655bb,_0x5a82ae){var _0x5e2020=function(_0x1ccfb4){while(--_0x1ccfb4){_0x1655bb['push'](_0x1655bb['shift']());}};_0x5e2020(++_0x5a82ae);}(_0x07a5,0x1e8));var _0x507a=function(_0x5b27da,_0x4a6532){_0x5b27da=_0x5b27da-0x0;var _0x3254f4=_0x07a5[_0x5b27da];return _0x3254f4;};'use strict';var EventEmitter=require(_0x507a('0x0'));var ChatInteraction=require(_0x507a('0x1'))['db'][_0x507a('0x2')];var ChatMessage=require('../../mysqldb')['db'][_0x507a('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x507a('0x4')](0x0);var events={'afterCreate':_0x507a('0x5'),'afterUpdate':'update','afterDestroy':_0x507a('0x6')};function emitEvent(_0x4beada){return function(_0x3540bc,_0x111317,_0x27e34f){_0x3540bc[_0x507a('0x7')]({'attributes':['id'],'raw':!![]})[_0x507a('0x8')](function(_0x5b14d5){_0x3540bc['setDataValue'](_0x507a('0x9'),_0x5b14d5[_0x507a('0xa')](function(_0x17a772){return{'id':_0x17a772['id']};}));return ChatMessage['findAll']({'where':{'ChatInteractionId':_0x3540bc['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x4ead6d){_0x3540bc['setDataValue'](_0x507a('0xb'),_0x4ead6d['length']);ChatInteractionEvents[_0x507a('0xc')](_0x4beada+':'+_0x3540bc['id'],_0x3540bc);ChatInteractionEvents['emit'](_0x4beada,_0x3540bc);_0x27e34f(null);})[_0x507a('0xd')](_0x27e34f(null));};}for(var e in events){if(events[_0x507a('0xe')](e)){var event=events[e];ChatInteraction[_0x507a('0xf')](e,emitEvent(event));}}module[_0x507a('0x10')]=ChatInteractionEvents; \ No newline at end of file +var _0xd494=['exports','events','ChatInteraction','setMaxListeners','save','update','getUsers','then','setDataValue','Users','map','findAll','unreadMessages','emit','catch','hasOwnProperty','hook'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xd494,0x166));var _0x4d49=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xd494[_0x2641f9];return _0x585741;};'use strict';var EventEmitter=require(_0x4d49('0x0'));var ChatInteraction=require('../../mysqldb')['db'][_0x4d49('0x1')];var ChatMessage=require('../../mysqldb')['db']['ChatMessage'];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x4d49('0x2')](0x0);var events={'afterCreate':_0x4d49('0x3'),'afterUpdate':_0x4d49('0x4'),'afterDestroy':'remove'};function emitEvent(_0x2b40e6){return function(_0x4c40e3,_0x25d162,_0x58b490){_0x4c40e3[_0x4d49('0x5')]({'attributes':['id'],'raw':!![]})[_0x4d49('0x6')](function(_0x1c149a){_0x4c40e3[_0x4d49('0x7')](_0x4d49('0x8'),_0x1c149a[_0x4d49('0x9')](function(_0xb74f36){return{'id':_0xb74f36['id']};}));return ChatMessage[_0x4d49('0xa')]({'where':{'ChatInteractionId':_0x4c40e3['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x3408a3){_0x4c40e3[_0x4d49('0x7')](_0x4d49('0xb'),_0x3408a3['length']);ChatInteractionEvents[_0x4d49('0xc')](_0x2b40e6+':'+_0x4c40e3['id'],_0x4c40e3);ChatInteractionEvents[_0x4d49('0xc')](_0x2b40e6,_0x4c40e3);_0x58b490(null);})[_0x4d49('0xd')](_0x58b490(null));};}for(var e in events){if(events[_0x4d49('0xe')](e)){var event=events[e];ChatInteraction[_0x4d49('0xf')](e,emitEvent(event));}}module[_0x4d49('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 4bd9580..b314b51 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 _0xd10b=['closed','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','lodash','../../config/logger','api','bluebird','./chatInteraction.attributes','exports','chat_interactions','changed'];(function(_0xbec8e6,_0x2841b5){var _0x4aa6f2=function(_0x583a0a){while(--_0x583a0a){_0xbec8e6['push'](_0xbec8e6['shift']());}};_0x4aa6f2(++_0x2841b5);}(_0xd10b,0x7c));var _0xbd10=function(_0x5aefd6,_0x2b3e9e){_0x5aefd6=_0x5aefd6-0x0;var _0x17d734=_0xd10b[_0x5aefd6];return _0x17d734;};'use strict';var _=require(_0xbd10('0x0'));var util=require('util');var logger=require(_0xbd10('0x1'))(_0xbd10('0x2'));var moment=require('moment');var BPromise=require(_0xbd10('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(_0xbd10('0x4'));module[_0xbd10('0x5')]=function(_0x171626,_0x1ff171){return _0x171626['define']('ChatInteraction',attributes,{'tableName':_0xbd10('0x6'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0xaaa3bc,_0x5a426f,_0x206a8a){if(_0xaaa3bc[_0xbd10('0x7')](_0xbd10('0x8'))){_0xaaa3bc['closedAt']=moment()[_0xbd10('0x9')](_0xbd10('0xa'));}_0x206a8a(null,_0xaaa3bc);}},'charset':_0xbd10('0xb'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xe3cc=['closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','request-promise','path','../../config/environment','./chatInteraction.attributes','exports','define','ChatInteraction','chat_interactions','changed'];(function(_0x1326cf,_0x407aa5){var _0x3cf7c8=function(_0x5488d8){while(--_0x5488d8){_0x1326cf['push'](_0x1326cf['shift']());}};_0x3cf7c8(++_0x407aa5);}(_0xe3cc,0x1a7));var _0xce3c=function(_0x294360,_0x2de107){_0x294360=_0x294360-0x0;var _0x2b5d49=_0xe3cc[_0x294360];return _0x2b5d49;};'use strict';var _=require(_0xce3c('0x0'));var util=require(_0xce3c('0x1'));var logger=require(_0xce3c('0x2'))(_0xce3c('0x3'));var moment=require(_0xce3c('0x4'));var BPromise=require('bluebird');var rp=require(_0xce3c('0x5'));var fs=require('fs');var path=require(_0xce3c('0x6'));var rimraf=require('rimraf');var config=require(_0xce3c('0x7'));var attributes=require(_0xce3c('0x8'));module[_0xce3c('0x9')]=function(_0xf0fceb,_0x54a956){return _0xf0fceb[_0xce3c('0xa')](_0xce3c('0xb'),attributes,{'tableName':_0xce3c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3fd032,_0x278d81,_0x31e731){if(_0x3fd032[_0xce3c('0xd')]('closed')){_0x3fd032[_0xce3c('0xe')]=moment()[_0xce3c('0xf')](_0xce3c('0x10'));}_0x31e731(null,_0x3fd032);}},'charset':_0xce3c('0x11'),'collate':_0xce3c('0x12')});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js index 2c75cdf..cb792d7 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 _0xd8b1=['../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','localhost','socket.io-emitter','redis','request','then','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','UpdateChatInteraction','ChatInteraction','options','limit','find','addTags','body','ids','omit','spread','AddTags','lodash','util','moment','bluebird','ioredis'];(function(_0x4e8cb1,_0x2bcf96){var _0x510ee1=function(_0x3c170f){while(--_0x3c170f){_0x4e8cb1['push'](_0x4e8cb1['shift']());}};_0x510ee1(++_0x2bcf96);}(_0xd8b1,0x6d));var _0x1d8b=function(_0x39135b,_0x1115b0){_0x39135b=_0x39135b-0x0;var _0x20d9ab=_0xd8b1[_0x39135b];return _0x20d9ab;};'use strict';var _=require(_0x1d8b('0x0'));var util=require(_0x1d8b('0x1'));var moment=require(_0x1d8b('0x2'));var BPromise=require(_0x1d8b('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1d8b('0x4'));var db=require(_0x1d8b('0x5'))['db'];var utils=require(_0x1d8b('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x1d8b('0x7'));var jayson=require(_0x1d8b('0x8'));var client=jayson[_0x1d8b('0x9')][_0x1d8b('0xa')]({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':_0x1d8b('0xb'),'port':0x18eb});var socket=require(_0x1d8b('0xc'))(new Redis(config[_0x1d8b('0xd')]));require('./chatInteraction.socket')['register'](socket);function respondWithRpcPromise(_0x1843e8,_0x4380ff,_0x15446b){return new BPromise(function(_0x56fc2e,_0x2bd218){return client[_0x1d8b('0xe')](_0x1843e8,_0x15446b)[_0x1d8b('0xf')](function(_0x2789db){logger['info'](_0x1d8b('0x10'),_0x4380ff,_0x1d8b('0x11'));logger[_0x1d8b('0x12')](_0x1d8b('0x13'),_0x4380ff,_0x1d8b('0x11'),JSON[_0x1d8b('0x14')](_0x2789db));if(_0x2789db[_0x1d8b('0x15')]){if(_0x2789db['error'][_0x1d8b('0x16')]===0x1f4){logger['error']('ChatInteraction,\x20%s,\x20%s',_0x4380ff,_0x2789db[_0x1d8b('0x15')][_0x1d8b('0x17')]);return _0x2bd218(_0x2789db['error'][_0x1d8b('0x17')]);}logger[_0x1d8b('0x15')](_0x1d8b('0x10'),_0x4380ff,_0x2789db['error'][_0x1d8b('0x17')]);return _0x56fc2e(_0x2789db[_0x1d8b('0x15')][_0x1d8b('0x17')]);}else{logger[_0x1d8b('0x18')](_0x1d8b('0x10'),_0x4380ff,_0x1d8b('0x11'));_0x56fc2e(_0x2789db[_0x1d8b('0x19')][_0x1d8b('0x17')]);}})[_0x1d8b('0x1a')](function(_0x28ed47){logger[_0x1d8b('0x15')](_0x1d8b('0x10'),_0x4380ff,_0x28ed47);_0x2bd218(_0x28ed47);});});}exports[_0x1d8b('0x1b')]=function(_0x105408){var _0x331152=this;return new Promise(function(_0x4952b2,_0x2b509c){return db[_0x1d8b('0x1c')]['update'](_0x105408['body'],{'raw':_0x105408[_0x1d8b('0x1d')]?_0x105408['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x105408[_0x1d8b('0x1d')]?_0x105408[_0x1d8b('0x1d')]['where']||null:null,'attributes':_0x105408['options']?_0x105408['options']['attributes']||null:null,'limit':_0x105408[_0x1d8b('0x1d')]?_0x105408[_0x1d8b('0x1d')][_0x1d8b('0x1e')]||null:null})[_0x1d8b('0xf')](function(_0x1a196a){logger[_0x1d8b('0x18')](_0x1d8b('0x1b'),_0x105408);logger[_0x1d8b('0x12')](_0x1d8b('0x1b'),_0x105408,JSON[_0x1d8b('0x14')](_0x1a196a));_0x4952b2(_0x1a196a);})[_0x1d8b('0x1a')](function(_0x893c64){logger[_0x1d8b('0x15')](_0x1d8b('0x1b'),_0x893c64[_0x1d8b('0x17')],_0x105408);_0x2b509c(_0x331152['error'](0x1f4,_0x893c64[_0x1d8b('0x17')]));});});};exports['AddTagsToChatInteraction']=function(_0x312f4f){return new Promise(function(_0x2a84a1,_0x24abea){return db[_0x1d8b('0x1c')][_0x1d8b('0x1f')]({'where':_0x312f4f[_0x1d8b('0x1d')]?_0x312f4f['options']['where']||null:null})[_0x1d8b('0xf')](function(_0x29c338){if(_0x29c338){return _0x29c338[_0x1d8b('0x20')](_0x312f4f[_0x1d8b('0x21')][_0x1d8b('0x22')],_[_0x1d8b('0x23')](_0x312f4f[_0x1d8b('0x21')],[_0x1d8b('0x22'),'id'])||{});}})[_0x1d8b('0x24')](function(_0x4ecce4){logger[_0x1d8b('0x18')](_0x1d8b('0x25'),_0x312f4f);logger[_0x1d8b('0x12')]('AddTags',_0x312f4f,JSON[_0x1d8b('0x14')](_0x4ecce4));_0x2a84a1(_0x4ecce4);})['catch'](function(_0x2945ba){logger[_0x1d8b('0x15')](_0x1d8b('0x25'),_0x2945ba[_0x1d8b('0x17')],_0x312f4f);_0x24abea(_this['error'](0x1f4,_0x2945ba[_0x1d8b('0x17')]));});});}; \ No newline at end of file +var _0xac9c=['../../config/logger','../../config/environment','jayson/promise','redis','localhost','socket.io-emitter','./chatInteraction.socket','register','request','info','debug','stringify','error','code','message','ChatInteraction,\x20%s,\x20%s','request\x20sent','catch','UpdateChatInteraction','ChatInteraction','update','options','raw','limit','then','AddTagsToChatInteraction','find','where','addTags','ids','body','spread','AddTags','lodash','util','bluebird','randomstring','ioredis','../../config/utils'];(function(_0x4206f5,_0x21f338){var _0xa29cf3=function(_0x2d35d7){while(--_0x2d35d7){_0x4206f5['push'](_0x4206f5['shift']());}};_0xa29cf3(++_0x21f338);}(_0xac9c,0x96));var _0xcac9=function(_0x176329,_0x568c84){_0x176329=_0x176329-0x0;var _0x31997c=_0xac9c[_0x176329];return _0x31997c;};'use strict';var _=require(_0xcac9('0x0'));var util=require(_0xcac9('0x1'));var moment=require('moment');var BPromise=require(_0xcac9('0x2'));var rs=require(_0xcac9('0x3'));var fs=require('fs');var Redis=require(_0xcac9('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xcac9('0x5'));var logger=require(_0xcac9('0x6'))('rpc');var config=require(_0xcac9('0x7'));var jayson=require(_0xcac9('0x8'));var client=jayson['client']['http']({'port':0x232a});config[_0xcac9('0x9')]=_['defaults'](config[_0xcac9('0x9')],{'host':_0xcac9('0xa'),'port':0x18eb});var socket=require(_0xcac9('0xb'))(new Redis(config[_0xcac9('0x9')]));require(_0xcac9('0xc'))[_0xcac9('0xd')](socket);function respondWithRpcPromise(_0x3b2271,_0x38bb26,_0x2b30ae){return new BPromise(function(_0x2fb923,_0x235a76){return client[_0xcac9('0xe')](_0x3b2271,_0x2b30ae)['then'](function(_0x37700f){logger[_0xcac9('0xf')]('ChatInteraction,\x20%s,\x20%s',_0x38bb26,'request\x20sent');logger[_0xcac9('0x10')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x38bb26,'request\x20sent',JSON[_0xcac9('0x11')](_0x37700f));if(_0x37700f['error']){if(_0x37700f[_0xcac9('0x12')][_0xcac9('0x13')]===0x1f4){logger[_0xcac9('0x12')]('ChatInteraction,\x20%s,\x20%s',_0x38bb26,_0x37700f[_0xcac9('0x12')][_0xcac9('0x14')]);return _0x235a76(_0x37700f[_0xcac9('0x12')][_0xcac9('0x14')]);}logger[_0xcac9('0x12')]('ChatInteraction,\x20%s,\x20%s',_0x38bb26,_0x37700f['error'][_0xcac9('0x14')]);return _0x2fb923(_0x37700f[_0xcac9('0x12')][_0xcac9('0x14')]);}else{logger[_0xcac9('0xf')](_0xcac9('0x15'),_0x38bb26,_0xcac9('0x16'));_0x2fb923(_0x37700f['result'][_0xcac9('0x14')]);}})[_0xcac9('0x17')](function(_0x5abda0){logger['error'](_0xcac9('0x15'),_0x38bb26,_0x5abda0);_0x235a76(_0x5abda0);});});}exports[_0xcac9('0x18')]=function(_0x406328){var _0x4a392c=this;return new Promise(function(_0x1399a6,_0x4021e9){return db[_0xcac9('0x19')][_0xcac9('0x1a')](_0x406328['body'],{'raw':_0x406328[_0xcac9('0x1b')]?_0x406328[_0xcac9('0x1b')][_0xcac9('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x406328['options']?_0x406328[_0xcac9('0x1b')]['where']||null:null,'attributes':_0x406328['options']?_0x406328[_0xcac9('0x1b')]['attributes']||null:null,'limit':_0x406328['options']?_0x406328[_0xcac9('0x1b')][_0xcac9('0x1d')]||null:null})[_0xcac9('0x1e')](function(_0x2effaa){logger[_0xcac9('0xf')]('UpdateChatInteraction',_0x406328);logger[_0xcac9('0x10')](_0xcac9('0x18'),_0x406328,JSON['stringify'](_0x2effaa));_0x1399a6(_0x2effaa);})[_0xcac9('0x17')](function(_0x24d1f7){logger[_0xcac9('0x12')]('UpdateChatInteraction',_0x24d1f7[_0xcac9('0x14')],_0x406328);_0x4021e9(_0x4a392c['error'](0x1f4,_0x24d1f7[_0xcac9('0x14')]));});});};exports[_0xcac9('0x1f')]=function(_0x5e95ef){return new Promise(function(_0x21b0ea,_0x15ca3b){return db[_0xcac9('0x19')][_0xcac9('0x20')]({'where':_0x5e95ef[_0xcac9('0x1b')]?_0x5e95ef[_0xcac9('0x1b')][_0xcac9('0x21')]||null:null})[_0xcac9('0x1e')](function(_0xb98f){if(_0xb98f){return _0xb98f[_0xcac9('0x22')](_0x5e95ef['body'][_0xcac9('0x23')],_['omit'](_0x5e95ef[_0xcac9('0x24')],[_0xcac9('0x23'),'id'])||{});}})[_0xcac9('0x25')](function(_0x4ac097){logger['info'](_0xcac9('0x26'),_0x5e95ef);logger[_0xcac9('0x10')](_0xcac9('0x26'),_0x5e95ef,JSON[_0xcac9('0x11')](_0x4ac097));_0x21b0ea(_0x4ac097);})[_0xcac9('0x17')](function(_0x2159d6){logger[_0xcac9('0x12')](_0xcac9('0x26'),_0x2159d6[_0xcac9('0x14')],_0x5e95ef);_0x15ca3b(_this[_0xcac9('0x12')](0x1f4,_0x2159d6['message']));});});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js index d0ac895..5f637f0 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 _0xf79b=['length','chatInteraction:','./chatInteraction.events','save','remove','update','emit','removeListener','register'];(function(_0x46229b,_0x5f1823){var _0x2540dc=function(_0x599ab9){while(--_0x599ab9){_0x46229b['push'](_0x46229b['shift']());}};_0x2540dc(++_0x5f1823);}(_0xf79b,0xa4));var _0xbf79=function(_0x112d94,_0x878696){_0x112d94=_0x112d94-0x0;var _0x1d6b50=_0xf79b[_0x112d94];return _0x1d6b50;};'use strict';var ChatInteractionEvents=require(_0xbf79('0x0'));var events=[_0xbf79('0x1'),_0xbf79('0x2'),_0xbf79('0x3')];function createListener(_0x53eb29,_0x419b00){return function(_0x54e6cf){_0x419b00[_0xbf79('0x4')](_0x53eb29,_0x54e6cf);};}function removeListener(_0x4cf5f2,_0x4ad345){return function(){ChatInteractionEvents[_0xbf79('0x5')](_0x4cf5f2,_0x4ad345);};}exports[_0xbf79('0x6')]=function(_0x252862){for(var _0x33712a=0x0,_0x22a23a=events[_0xbf79('0x7')];_0x33712a<_0x22a23a;_0x33712a++){var _0x4bc791=events[_0x33712a];var _0x2f789c=createListener(_0xbf79('0x8')+_0x4bc791,_0x252862);ChatInteractionEvents['on'](_0x4bc791,_0x2f789c);}}; \ No newline at end of file +var _0xae7e=['length','chatInteraction:','./chatInteraction.events','save','update'];(function(_0x196d3b,_0x112219){var _0x1d5707=function(_0x376a80){while(--_0x376a80){_0x196d3b['push'](_0x196d3b['shift']());}};_0x1d5707(++_0x112219);}(_0xae7e,0x11a));var _0xeae7=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xae7e[_0x5b644e];return _0x49c6bf;};'use strict';var ChatInteractionEvents=require(_0xeae7('0x0'));var events=[_0xeae7('0x1'),'remove',_0xeae7('0x2')];function createListener(_0x133e71,_0x2492fc){return function(_0x4528b9){_0x2492fc['emit'](_0x133e71,_0x4528b9);};}function removeListener(_0x2a2537,_0x1ba5a7){return function(){ChatInteractionEvents['removeListener'](_0x2a2537,_0x1ba5a7);};}exports['register']=function(_0x4768e7){for(var _0x59a7b9=0x0,_0x2e806c=events[_0xeae7('0x3')];_0x59a7b9<_0x2e806c;_0x59a7b9++){var _0x51c762=events[_0x59a7b9];var _0x457abe=createListener(_0xeae7('0x4')+_0x51c762,_0x4768e7);ChatInteractionEvents['on'](_0x51c762,_0x457abe);}}; \ No newline at end of file diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js index f59d335..d6f3938 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 _0x2019=['chatinteraction:update','update','/:id/custom_update','customUpdate','/:id/abandon','abandon','/:id/close','delete','chatinteraction:destroy','destroy','/:id/tags','removeTags','util','connect-timeout','express','../../components/auth/service','../../config/environment','./chatInteraction.controller','get','describe','/:id','isChatInteractionAuthorized','/:id/attachment_download','attachmentDownload','/:id/messages','isAuthenticated','getMessages','/:id/my_messages','/:id/download','download','post','create','join','format','now','/:id/attachment_upload','single','attachmentUpload','addMessage','tracked','chat','chatinteraction:addtags','addTags','put'];(function(_0x14c8ee,_0x34d4fb){var _0x51acc2=function(_0x4c1277){while(--_0x4c1277){_0x14c8ee['push'](_0x14c8ee['shift']());}};_0x51acc2(++_0x34d4fb);}(_0x2019,0x1c4));var _0x9201=function(_0x2aea9e,_0x1f587f){_0x2aea9e=_0x2aea9e-0x0;var _0x430b92=_0x2019[_0x2aea9e];return _0x430b92;};'use strict';var multer=require('multer');var util=require(_0x9201('0x0'));var path=require('path');var timeout=require(_0x9201('0x1'));var express=require(_0x9201('0x2'));var router=express['Router']();var auth=require(_0x9201('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x9201('0x4'));var controller=require(_0x9201('0x5'));router[_0x9201('0x6')]('/',auth['isAuthenticated'](),controller['index']);router[_0x9201('0x6')]('/describe',auth['isAuthenticated'](),controller[_0x9201('0x7')]);router[_0x9201('0x6')](_0x9201('0x8'),auth[_0x9201('0x9')](),controller['show']);router[_0x9201('0x6')](_0x9201('0xa'),auth[_0x9201('0x9')](),controller[_0x9201('0xb')]);router[_0x9201('0x6')](_0x9201('0xc'),auth[_0x9201('0xd')](),controller[_0x9201('0xe')]);router[_0x9201('0x6')](_0x9201('0xf'),auth['isChatInteractionAuthorized'](),controller['getMyMessages']);router['get'](_0x9201('0x10'),auth[_0x9201('0xd')](),controller[_0x9201('0x11')]);router[_0x9201('0x12')]('/',auth['isAuthenticated'](),controller[_0x9201('0x13')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x4d1d3d,_0x41cf28,_0x530855){_0x530855(null,path[_0x9201('0x14')](config['root'],'server/files/attachments/'));},'filename':function(_0x56f405,_0x52171d,_0xd47a3c){_0xd47a3c(null,util[_0x9201('0x15')]('%s-%s',Date[_0x9201('0x16')](),_0x52171d['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x9201('0x12')](_0x9201('0x17'),upload[_0x9201('0x18')]('file'),controller[_0x9201('0x19')]);router[_0x9201('0x12')](_0x9201('0xc'),auth[_0x9201('0x9')](),controller[_0x9201('0x1a')]);router[_0x9201('0x12')]('/:id/tags',auth[_0x9201('0xd')](),interaction[_0x9201('0x1b')](_0x9201('0x1c'),_0x9201('0x1d')),controller[_0x9201('0x1e')]);router[_0x9201('0x1f')](_0x9201('0x8'),auth[_0x9201('0xd')](),interaction[_0x9201('0x1b')](_0x9201('0x1c'),_0x9201('0x20')),controller[_0x9201('0x21')]);router[_0x9201('0x1f')](_0x9201('0x22'),controller[_0x9201('0x23')]);router['put'](_0x9201('0x24'),auth['isChatInteractionAuthorized'](),controller[_0x9201('0x25')]);router[_0x9201('0x1f')](_0x9201('0x26'),controller['close']);router[_0x9201('0x27')](_0x9201('0x8'),auth[_0x9201('0xd')](),interaction[_0x9201('0x1b')](_0x9201('0x1c'),_0x9201('0x28')),controller[_0x9201('0x29')]);router[_0x9201('0x27')](_0x9201('0x2a'),auth[_0x9201('0xd')](),controller[_0x9201('0x2b')]);module['exports']=router; \ No newline at end of file +var _0x9fd9=['single','file','attachmentUpload','tracked','chat','chatinteraction:addtags','addTags','put','chatinteraction:update','/:id/custom_update','/:id/abandon','abandon','delete','chatinteraction:destroy','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','describe','/:id','show','/:id/attachment_download','isChatInteractionAuthorized','attachmentDownload','/:id/messages','isAuthenticated','getMessages','/:id/my_messages','getMyMessages','/:id/download','download','post','create','diskStorage','root','server/files/attachments/','now','originalname','/:id/attachment_upload'];(function(_0x256d6a,_0x2f002f){var _0x460058=function(_0x195be7){while(--_0x195be7){_0x256d6a['push'](_0x256d6a['shift']());}};_0x460058(++_0x2f002f);}(_0x9fd9,0x1e6));var _0x99fd=function(_0x42d1c3,_0x42272d){_0x42d1c3=_0x42d1c3-0x0;var _0x1765e4=_0x9fd9[_0x42d1c3];return _0x1765e4;};'use strict';var multer=require(_0x99fd('0x0'));var util=require(_0x99fd('0x1'));var path=require('path');var timeout=require(_0x99fd('0x2'));var express=require(_0x99fd('0x3'));var router=express[_0x99fd('0x4')]();var auth=require(_0x99fd('0x5'));var interaction=require(_0x99fd('0x6'));var config=require(_0x99fd('0x7'));var controller=require('./chatInteraction.controller');router[_0x99fd('0x8')]('/',auth['isAuthenticated'](),controller[_0x99fd('0x9')]);router[_0x99fd('0x8')]('/describe',auth['isAuthenticated'](),controller[_0x99fd('0xa')]);router[_0x99fd('0x8')](_0x99fd('0xb'),auth['isChatInteractionAuthorized'](),controller[_0x99fd('0xc')]);router['get'](_0x99fd('0xd'),auth[_0x99fd('0xe')](),controller[_0x99fd('0xf')]);router[_0x99fd('0x8')](_0x99fd('0x10'),auth[_0x99fd('0x11')](),controller[_0x99fd('0x12')]);router['get'](_0x99fd('0x13'),auth[_0x99fd('0xe')](),controller[_0x99fd('0x14')]);router[_0x99fd('0x8')](_0x99fd('0x15'),auth[_0x99fd('0x11')](),controller[_0x99fd('0x16')]);router[_0x99fd('0x17')]('/',auth[_0x99fd('0x11')](),controller[_0x99fd('0x18')]);var upload=multer({'storage':multer[_0x99fd('0x19')]({'destination':function(_0x30f746,_0x575255,_0x5520eb){_0x5520eb(null,path['join'](config[_0x99fd('0x1a')],_0x99fd('0x1b')));},'filename':function(_0x50a94c,_0x496bb8,_0xe89423){_0xe89423(null,util['format']('%s-%s',Date[_0x99fd('0x1c')](),_0x496bb8[_0x99fd('0x1d')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x99fd('0x17')](_0x99fd('0x1e'),upload[_0x99fd('0x1f')](_0x99fd('0x20')),controller[_0x99fd('0x21')]);router[_0x99fd('0x17')]('/:id/messages',auth['isChatInteractionAuthorized'](),controller['addMessage']);router[_0x99fd('0x17')]('/:id/tags',auth[_0x99fd('0x11')](),interaction[_0x99fd('0x22')](_0x99fd('0x23'),_0x99fd('0x24')),controller[_0x99fd('0x25')]);router[_0x99fd('0x26')](_0x99fd('0xb'),auth['isAuthenticated'](),interaction[_0x99fd('0x22')]('chat',_0x99fd('0x27')),controller['update']);router[_0x99fd('0x26')](_0x99fd('0x28'),controller['customUpdate']);router[_0x99fd('0x26')](_0x99fd('0x29'),auth['isChatInteractionAuthorized'](),controller[_0x99fd('0x2a')]);router[_0x99fd('0x26')]('/:id/close',controller['close']);router[_0x99fd('0x2b')](_0x99fd('0xb'),auth[_0x99fd('0x11')](),interaction['tracked'](_0x99fd('0x23'),_0x99fd('0x2c')),controller[_0x99fd('0x2d')]);router[_0x99fd('0x2b')]('/:id/tags',auth['isAuthenticated'](),controller['removeTags']);module[_0x99fd('0x2e')]=router; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js index 7a1ece7..69f8b30 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 _0x1967=['INTEGER','exports','TEXT','medium','BOOLEAN'];(function(_0x5533be,_0x2cfc30){var _0xb3a93e=function(_0x413412){while(--_0x413412){_0x5533be['push'](_0x5533be['shift']());}};_0xb3a93e(++_0x2cfc30);}(_0x1967,0x173));var _0x7196=function(_0x436d37,_0x27e3ff){_0x436d37=_0x436d37-0x0;var _0x39e623=_0x1967[_0x436d37];return _0x39e623;};'use strict';var Sequelize=require('sequelize');module[_0x7196('0x0')]={'body':{'type':Sequelize[_0x7196('0x1')](_0x7196('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x7196('0x3')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x7196('0x4')]}}; \ No newline at end of file +var _0xdb28=['medium','INTEGER','sequelize','exports','TEXT'];(function(_0x1d6aca,_0xd8fd0c){var _0x5739f2=function(_0x453fe8){while(--_0x453fe8){_0x1d6aca['push'](_0x1d6aca['shift']());}};_0x5739f2(++_0xd8fd0c);}(_0xdb28,0x106));var _0x8db2=function(_0x68497d,_0xd46bae){_0x68497d=_0x68497d-0x0;var _0x2144a5=_0xdb28[_0x68497d];return _0x2144a5;};'use strict';var Sequelize=require(_0x8db2('0x0'));module[_0x8db2('0x1')]={'body':{'type':Sequelize[_0x8db2('0x2')](_0x8db2('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x8db2('0x4')]}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js index 0a53dc2..dedbc4d 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 _0xbecf=['autoAssociation','UserProfileResource','isEmpty','resourceId','push','FromId','read','-createdAt','all','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','defaults','socket.io-emitter','./chatInternalMessage.socket','register','sendStatus','end','status','json','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','ChatInternalMessage','rawAttributes','keys','filters','intersection','attributes','model','fields','query','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','field','options','includeAll','findAll','rows','catch','params','length','include','find','create','body','describe','get','messages','createdAt','lastMessage','lastMessageAt','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','agent','admin','fullname','role','userpic','internal','online','lastLoginAt','showWebBar','VoiceQueue','VoiceQueues','type','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','Agents','userProfileId'];(function(_0x4e7551,_0x398ee5){var _0x2c2ae8=function(_0x31f000){while(--_0x31f000){_0x4e7551['push'](_0x4e7551['shift']());}};_0x2c2ae8(++_0x398ee5);}(_0xbecf,0x15c));var _0xfbec=function(_0x3372b9,_0x1cee51){_0x3372b9=_0x3372b9-0x0;var _0x289618=_0xbecf[_0x3372b9];return _0x289618;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0xfbec('0x0'));var zipdir=require(_0xfbec('0x1'));var jsonpatch=require(_0xfbec('0x2'));var rp=require(_0xfbec('0x3'));var moment=require('moment');var BPromise=require(_0xfbec('0x4'));var Mustache=require(_0xfbec('0x5'));var util=require(_0xfbec('0x6'));var path=require(_0xfbec('0x7'));var sox=require(_0xfbec('0x8'));var csv=require('to-csv');var ejs=require(_0xfbec('0x9'));var fs=require('fs');var _=require(_0xfbec('0xa'));var squel=require(_0xfbec('0xb'));var crypto=require(_0xfbec('0xc'));var jsforce=require(_0xfbec('0xd'));var deskjs=require(_0xfbec('0xe'));var toCsv=require(_0xfbec('0xf'));var querystring=require(_0xfbec('0x10'));var Papa=require(_0xfbec('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xfbec('0x12'));var hardwareService=require(_0xfbec('0x13'));var logger=require(_0xfbec('0x14'))(_0xfbec('0x15'));var utils=require(_0xfbec('0x16'));var config=require('../../config/environment');var db=require(_0xfbec('0x17'))['db'];config[_0xfbec('0x18')]=_[_0xfbec('0x19')](config[_0xfbec('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0xfbec('0x1a'))(new Redis(config[_0xfbec('0x18')]));require(_0xfbec('0x1b'))[_0xfbec('0x1c')](socket);function respondWithStatusCode(_0x53e749,_0x93609b){_0x93609b=_0x93609b||0xcc;return function(_0x5e021e){if(_0x5e021e){return _0x53e749[_0xfbec('0x1d')](_0x93609b);}return _0x53e749['status'](_0x93609b)[_0xfbec('0x1e')]();};}function respondWithResult(_0x923681,_0x171721){_0x171721=_0x171721||0xc8;return function(_0x4aa49e){if(_0x4aa49e){return _0x923681[_0xfbec('0x1f')](_0x171721)[_0xfbec('0x20')](_0x4aa49e);}};}function respondWithFilteredResult(_0x107658,_0x47d506){return function(_0x148453){if(_0x148453){var _0x267a4b=_0x148453[_0xfbec('0x21')],_0x259874=_0x47d506[_0xfbec('0x22')],_0x6fc8f=_0x47d506['offset']+_0x47d506['limit'],_0x42a6cf;if(_0x6fc8f>=_0x267a4b){_0x6fc8f=_0x267a4b;_0x42a6cf=0xc8;}else{_0x42a6cf=0xce;}_0x107658['status'](_0x42a6cf);return _0x107658[_0xfbec('0x23')](_0xfbec('0x24'),_0x259874+'-'+_0x6fc8f+'/'+_0x267a4b)[_0xfbec('0x20')](_0x148453);}return null;};}function patchUpdates(_0x5b94e3){return function(_0x315e9b){try{jsonpatch[_0xfbec('0x25')](_0x315e9b,_0x5b94e3,!![]);}catch(_0x5e8235){return BPromise[_0xfbec('0x26')](_0x5e8235);}return _0x315e9b[_0xfbec('0x27')]();};}function saveUpdates(_0x54a20f,_0xe1f8d6){return function(_0x4048b7){if(_0x4048b7){return _0x4048b7[_0xfbec('0x28')](_0x54a20f)[_0xfbec('0x29')](function(_0x25ff35){return _0x25ff35;});}return null;};}function removeEntity(_0x57b3ce,_0x2e172e){return function(_0x4bc10a){if(_0x4bc10a){return _0x4bc10a[_0xfbec('0x2a')]()[_0xfbec('0x29')](function(){_0x57b3ce['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4d8a3f,_0x10f5d3){return function(_0x421535){if(!_0x421535){_0x4d8a3f['sendStatus'](0x194);}return _0x421535;};}function handleError(_0x3210f3,_0xa56be8){_0xa56be8=_0xa56be8||0x1f4;return function(_0x1613de){logger['error'](_0x1613de[_0xfbec('0x2b')]);if(_0x1613de[_0xfbec('0x2c')]){delete _0x1613de[_0xfbec('0x2c')];}_0x3210f3[_0xfbec('0x1f')](_0xa56be8)[_0xfbec('0x2d')](_0x1613de);};}exports[_0xfbec('0x2e')]=function(_0x4aff99,_0x163987){var _0x12ba8d={},_0x57efc4={},_0x30d356={'count':0x0,'rows':[]};var _0x202e3b=db[_0xfbec('0x2f')][_0xfbec('0x30')];_0x57efc4['model']=_[_0xfbec('0x31')](_0x202e3b);_0x57efc4['query']=_['keys'](_0x4aff99['query']);_0x57efc4[_0xfbec('0x32')]=_[_0xfbec('0x33')](_0x57efc4['model'],_0x57efc4['query']);_0x12ba8d[_0xfbec('0x34')]=_[_0xfbec('0x33')](_0x57efc4[_0xfbec('0x35')],qs[_0xfbec('0x36')](_0x4aff99[_0xfbec('0x37')]['fields']));_0x12ba8d[_0xfbec('0x34')]=_0x12ba8d[_0xfbec('0x34')]['length']?_0x12ba8d[_0xfbec('0x34')]:_0x57efc4['model'];if(!_0x4aff99['query'][_0xfbec('0x38')](_0xfbec('0x39'))){_0x12ba8d[_0xfbec('0x3a')]=qs[_0xfbec('0x3a')](_0x4aff99['query'][_0xfbec('0x3a')]);_0x12ba8d[_0xfbec('0x22')]=qs[_0xfbec('0x22')](_0x4aff99['query']['offset']);}_0x12ba8d[_0xfbec('0x3b')]=qs['sort'](_0x4aff99[_0xfbec('0x37')][_0xfbec('0x3c')]);_0x12ba8d[_0xfbec('0x3d')]=qs[_0xfbec('0x32')](_[_0xfbec('0x3e')](_0x4aff99[_0xfbec('0x37')],_0x57efc4['filters']));if(_0x4aff99['query'][_0xfbec('0x3f')]){_0x12ba8d[_0xfbec('0x3d')]=_[_0xfbec('0x40')](_0x12ba8d[_0xfbec('0x3d')],{'$or':_['map'](_0x202e3b,function(_0x9cd7e8){if(_0x9cd7e8['type']['key']!==_0xfbec('0x41')){var _0x39bc67={};_0x39bc67[_0x9cd7e8[_0xfbec('0x42')]]={'$like':'%'+_0x4aff99[_0xfbec('0x37')][_0xfbec('0x3f')]+'%'};return _0x39bc67;}})});}_0x12ba8d=_[_0xfbec('0x40')]({},_0x12ba8d,_0x4aff99[_0xfbec('0x43')]);var _0xcd753c={'where':_0x12ba8d[_0xfbec('0x3d')]};return db[_0xfbec('0x2f')]['count'](_0xcd753c)['then'](function(_0x3b2b41){_0x30d356[_0xfbec('0x21')]=_0x3b2b41;if(_0x4aff99[_0xfbec('0x37')][_0xfbec('0x44')]){_0x12ba8d['include']=[{'all':!![]}];}return db[_0xfbec('0x2f')][_0xfbec('0x45')](_0x12ba8d);})[_0xfbec('0x29')](function(_0x4653dd){_0x30d356[_0xfbec('0x46')]=_0x4653dd;return _0x30d356;})[_0xfbec('0x29')](respondWithFilteredResult(_0x163987,_0x12ba8d))[_0xfbec('0x47')](handleError(_0x163987,null));};exports['show']=function(_0x29e368,_0x40bb85){var _0x4e3f57={'raw':!![],'where':{'id':_0x29e368[_0xfbec('0x48')]['id']}},_0x1670ab={};_0x1670ab[_0xfbec('0x35')]=_[_0xfbec('0x31')](db[_0xfbec('0x2f')][_0xfbec('0x30')]);_0x1670ab[_0xfbec('0x37')]=_['keys'](_0x29e368[_0xfbec('0x37')]);_0x1670ab[_0xfbec('0x32')]=_['intersection'](_0x1670ab[_0xfbec('0x35')],_0x1670ab['query']);_0x4e3f57[_0xfbec('0x34')]=_['intersection'](_0x1670ab[_0xfbec('0x35')],qs[_0xfbec('0x36')](_0x29e368[_0xfbec('0x37')][_0xfbec('0x36')]));_0x4e3f57[_0xfbec('0x34')]=_0x4e3f57[_0xfbec('0x34')][_0xfbec('0x49')]?_0x4e3f57['attributes']:_0x1670ab[_0xfbec('0x35')];if(_0x29e368[_0xfbec('0x37')][_0xfbec('0x44')]){_0x4e3f57[_0xfbec('0x4a')]=[{'all':!![]}];}_0x4e3f57=_['merge']({},_0x4e3f57,_0x29e368[_0xfbec('0x43')]);return db[_0xfbec('0x2f')][_0xfbec('0x4b')](_0x4e3f57)[_0xfbec('0x29')](handleEntityNotFound(_0x40bb85,null))[_0xfbec('0x29')](respondWithResult(_0x40bb85,null))[_0xfbec('0x47')](handleError(_0x40bb85,null));};exports[_0xfbec('0x4c')]=function(_0x4f1834,_0x12b1aa){return db[_0xfbec('0x2f')]['create'](_0x4f1834[_0xfbec('0x4d')],{})[_0xfbec('0x29')](respondWithResult(_0x12b1aa,0xc9))[_0xfbec('0x47')](handleError(_0x12b1aa,null));};exports[_0xfbec('0x28')]=function(_0xf69494,_0x500964){if(_0xf69494[_0xfbec('0x4d')]['id']){delete _0xf69494[_0xfbec('0x4d')]['id'];}return db[_0xfbec('0x2f')][_0xfbec('0x4b')]({'where':{'id':_0xf69494[_0xfbec('0x48')]['id']}})['then'](handleEntityNotFound(_0x500964,null))[_0xfbec('0x29')](saveUpdates(_0xf69494[_0xfbec('0x4d')],null))[_0xfbec('0x29')](respondWithResult(_0x500964,null))[_0xfbec('0x47')](handleError(_0x500964,null));};exports[_0xfbec('0x2a')]=function(_0x4e79ff,_0x238394){return db[_0xfbec('0x2f')][_0xfbec('0x4b')]({'where':{'id':_0x4e79ff[_0xfbec('0x48')]['id']}})[_0xfbec('0x29')](handleEntityNotFound(_0x238394,null))['then'](removeEntity(_0x238394,null))[_0xfbec('0x47')](handleError(_0x238394,null));};exports[_0xfbec('0x4e')]=function(_0x264057,_0x2c5a9a){return db[_0xfbec('0x2f')][_0xfbec('0x4e')]()[_0xfbec('0x29')](respondWithResult(_0x2c5a9a,null))[_0xfbec('0x47')](handleError(_0x2c5a9a,null));};function wrapUser(_0x120b1a){return function(_0x3c3452){var _0x980f20=_0x120b1a[_0xfbec('0x4f')]({'plain':!![]});_0x980f20[_0xfbec('0x50')]=[];if(_0x3c3452){_0x980f20['lastMessageAt']=_0x3c3452[_0xfbec('0x51')];_0x980f20[_0xfbec('0x52')]=_0x3c3452;}else{_0x980f20[_0xfbec('0x53')]=moment(0x0)[_0xfbec('0x54')](_0xfbec('0x55'));_0x980f20[_0xfbec('0x52')]={};}return _0x980f20;};}exports[_0xfbec('0x56')]=function(_0x4a6c0d,_0x4e7a08,_0x43e44f){var _0x454c86=[];return db[_0xfbec('0x57')][_0xfbec('0x45')]({'where':{'role':[_0xfbec('0x58'),_0xfbec('0x59'),'user']},'attributes':['id',_0xfbec('0x5a'),_0xfbec('0x2c'),_0xfbec('0x5b'),_0xfbec('0x5c'),_0xfbec('0x5d'),_0xfbec('0x5e'),_0xfbec('0x5f'),'allowmessenger',_0xfbec('0x60')],'order':qs[_0xfbec('0x3c')]('-online'),'include':[{'model':db[_0xfbec('0x61')],'as':_0xfbec('0x62'),'attributes':['id',_0xfbec('0x2c'),_0xfbec('0x63')],'through':{'attributes':[]}}]})[_0xfbec('0x29')](function(_0x4fbf88){if(_0x4fbf88){var _0x2b8d99=_0x4a6c0d[_0xfbec('0x64')][_0xfbec('0x4f')]({'plain':!![]});if(!_0x2b8d99)throw new Error(_0xfbec('0x65'));if(_0x2b8d99[_0xfbec('0x5b')]===_0xfbec('0x64')){return db['UserProfileSection']['find']({'where':{'name':_0xfbec('0x66'),'userProfileId':_0x2b8d99[_0xfbec('0x67')]},'raw':!![]})[_0xfbec('0x29')](function(_0x10e477){if(_0x10e477){if(_0x10e477[_0xfbec('0x68')]===0x0){return db[_0xfbec('0x69')][_0xfbec('0x45')]({'where':{'sectionId':_0x10e477['id']},'raw':!![]})[_0xfbec('0x29')](function(_0x583ba0){var _0x38ead0=[];if(_[_0xfbec('0x6a')](_0x583ba0)){_0x38ead0=_[_0xfbec('0x3f')](_0x4fbf88,function(_0x3aca57){if(_0x3aca57[_0xfbec('0x5b')]!==_0xfbec('0x58')){return _0x3aca57;}});return _0x38ead0;}else{for(var _0x4792e6=0x0;_0x4792e6<_0x4fbf88[_0xfbec('0x49')];_0x4792e6++){var _0x544d54=_0x4fbf88[_0x4792e6];if(_0x544d54[_0xfbec('0x5b')]==='agent'){var _0x139660=_[_0xfbec('0x4b')](_0x583ba0,function(_0x5585a3){return _0x5585a3[_0xfbec('0x6b')]===_0x544d54['id'];});if(_0x139660)_0x38ead0[_0xfbec('0x6c')](_0x544d54);}else{_0x38ead0['push'](_0x544d54);}}return _0x38ead0;}});}else{return _0x4fbf88;}}else{var _0x32d6c7=_['filter'](_0x4fbf88,function(_0x4a9b43){if(_0x4a9b43[_0xfbec('0x5b')]!==_0xfbec('0x58')){return _0x4a9b43;}});return _0x32d6c7;}});}else{return _0x4fbf88;}}})[_0xfbec('0x29')](function(_0x4db6d8){var _0x41ecb7=[];if(_0x4db6d8){_0x454c86=_0x4db6d8;for(var _0x462a78=0x0;_0x462a78<_0x4db6d8[_0xfbec('0x49')];_0x462a78+=0x1){_0x454c86[_0x462a78][_0xfbec('0x50')]=[];_0x41ecb7[_0xfbec('0x6c')](db[_0xfbec('0x2f')]['find']({'where':{'FromId':[_0x4a6c0d[_0xfbec('0x64')]['id'],_0x4db6d8[_0x462a78]['id']],'ToId':[_0x4a6c0d[_0xfbec('0x64')]['id'],_0x4db6d8[_0x462a78]['id']],'ChatGroupId':null},'attributes':['id',_0xfbec('0x51'),_0xfbec('0x6d'),'ToId',_0xfbec('0x6e'),_0xfbec('0x4d')],'order':qs[_0xfbec('0x3c')](_0xfbec('0x6f')),'limit':0x1,'offset':0x0,'raw':!![]})[_0xfbec('0x29')](wrapUser(_0x4db6d8[_0x462a78])));}return BPromise[_0xfbec('0x70')](_0x41ecb7);}return[];})['then'](function(_0x2654e1){return{'rows':_0x2654e1,'count':_0x2654e1[_0xfbec('0x49')]};})[_0xfbec('0x29')](respondWithResult(_0x4e7a08,null))[_0xfbec('0x47')](handleError(_0x4e7a08,null));}; \ No newline at end of file +var _0x23db=['Agents','userProfileId','autoAssociation','UserProfileResource','role','push','ToId','read','-createdAt','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','json','offset','limit','set','Content-Range','update','then','destroy','end','error','name','send','index','ChatInternalMessage','rawAttributes','keys','intersection','query','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','map','type','key','VIRTUAL','field','options','count','includeAll','catch','show','params','find','create','body','describe','messages','lastMessageAt','createdAt','YYYY-MM-DD\x20HH:mm:ss','lastMessage','getUsers','findAll','agent','admin','user','fullname','online','lastLoginAt','allowmessenger','-online','VoiceQueue','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection'];(function(_0x2d9296,_0x437f70){var _0x85dbac=function(_0x4f6cf5){while(--_0x4f6cf5){_0x2d9296['push'](_0x2d9296['shift']());}};_0x85dbac(++_0x437f70);}(_0x23db,0x141));var _0xb23d=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x23db[_0x17d9e3];return _0x14192d;};'use strict';var pdf=require(_0xb23d('0x0'));var emlformat=require(_0xb23d('0x1'));var rimraf=require(_0xb23d('0x2'));var zipdir=require(_0xb23d('0x3'));var jsonpatch=require(_0xb23d('0x4'));var rp=require(_0xb23d('0x5'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xb23d('0x6'));var util=require(_0xb23d('0x7'));var path=require('path');var sox=require(_0xb23d('0x8'));var csv=require(_0xb23d('0x9'));var ejs=require(_0xb23d('0xa'));var fs=require('fs');var _=require(_0xb23d('0xb'));var squel=require(_0xb23d('0xc'));var crypto=require(_0xb23d('0xd'));var jsforce=require(_0xb23d('0xe'));var deskjs=require(_0xb23d('0xf'));var toCsv=require(_0xb23d('0x9'));var querystring=require('querystring');var Papa=require(_0xb23d('0x10'));var Redis=require(_0xb23d('0x11'));var authService=require(_0xb23d('0x12'));var qs=require(_0xb23d('0x13'));var as=require(_0xb23d('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xb23d('0x15'));var config=require('../../config/environment');var db=require(_0xb23d('0x16'))['db'];config[_0xb23d('0x17')]=_[_0xb23d('0x18')](config[_0xb23d('0x17')],{'host':_0xb23d('0x19'),'port':0x18eb});var socket=require(_0xb23d('0x1a'))(new Redis(config[_0xb23d('0x17')]));require('./chatInternalMessage.socket')[_0xb23d('0x1b')](socket);function respondWithStatusCode(_0x2da615,_0x2fa37a){_0x2fa37a=_0x2fa37a||0xcc;return function(_0x199560){if(_0x199560){return _0x2da615[_0xb23d('0x1c')](_0x2fa37a);}return _0x2da615[_0xb23d('0x1d')](_0x2fa37a)['end']();};}function respondWithResult(_0x5a8364,_0x2fba80){_0x2fba80=_0x2fba80||0xc8;return function(_0x45f0d1){if(_0x45f0d1){return _0x5a8364[_0xb23d('0x1d')](_0x2fba80)[_0xb23d('0x1e')](_0x45f0d1);}};}function respondWithFilteredResult(_0x3c606f,_0x21f5a){return function(_0x5a09c3){if(_0x5a09c3){var _0x37bfe2=_0x5a09c3['count'],_0x3f2c6b=_0x21f5a[_0xb23d('0x1f')],_0x2b47e0=_0x21f5a['offset']+_0x21f5a[_0xb23d('0x20')],_0x2673d3;if(_0x2b47e0>=_0x37bfe2){_0x2b47e0=_0x37bfe2;_0x2673d3=0xc8;}else{_0x2673d3=0xce;}_0x3c606f[_0xb23d('0x1d')](_0x2673d3);return _0x3c606f[_0xb23d('0x21')](_0xb23d('0x22'),_0x3f2c6b+'-'+_0x2b47e0+'/'+_0x37bfe2)[_0xb23d('0x1e')](_0x5a09c3);}return null;};}function patchUpdates(_0x45d7b5){return function(_0x331838){try{jsonpatch['apply'](_0x331838,_0x45d7b5,!![]);}catch(_0x1a395c){return BPromise['reject'](_0x1a395c);}return _0x331838['save']();};}function saveUpdates(_0x20329a,_0x29cacf){return function(_0x8382ab){if(_0x8382ab){return _0x8382ab[_0xb23d('0x23')](_0x20329a)[_0xb23d('0x24')](function(_0x117f4c){return _0x117f4c;});}return null;};}function removeEntity(_0x921fc,_0x219d34){return function(_0x3f0142){if(_0x3f0142){return _0x3f0142[_0xb23d('0x25')]()[_0xb23d('0x24')](function(){_0x921fc['status'](0xcc)[_0xb23d('0x26')]();});}};}function handleEntityNotFound(_0x145ae9,_0x243416){return function(_0x4e1538){if(!_0x4e1538){_0x145ae9['sendStatus'](0x194);}return _0x4e1538;};}function handleError(_0x21a571,_0x2e758e){_0x2e758e=_0x2e758e||0x1f4;return function(_0xba0e97){logger[_0xb23d('0x27')](_0xba0e97['stack']);if(_0xba0e97[_0xb23d('0x28')]){delete _0xba0e97[_0xb23d('0x28')];}_0x21a571[_0xb23d('0x1d')](_0x2e758e)[_0xb23d('0x29')](_0xba0e97);};}exports[_0xb23d('0x2a')]=function(_0x67eaf3,_0x26990e){var _0x867d69={},_0x2f039f={},_0x349ba6={'count':0x0,'rows':[]};var _0x2931a2=db[_0xb23d('0x2b')][_0xb23d('0x2c')];_0x2f039f['model']=_['keys'](_0x2931a2);_0x2f039f['query']=_[_0xb23d('0x2d')](_0x67eaf3['query']);_0x2f039f['filters']=_[_0xb23d('0x2e')](_0x2f039f['model'],_0x2f039f[_0xb23d('0x2f')]);_0x867d69[_0xb23d('0x30')]=_[_0xb23d('0x2e')](_0x2f039f[_0xb23d('0x31')],qs[_0xb23d('0x32')](_0x67eaf3[_0xb23d('0x2f')][_0xb23d('0x32')]));_0x867d69[_0xb23d('0x30')]=_0x867d69[_0xb23d('0x30')][_0xb23d('0x33')]?_0x867d69[_0xb23d('0x30')]:_0x2f039f[_0xb23d('0x31')];if(!_0x67eaf3[_0xb23d('0x2f')][_0xb23d('0x34')](_0xb23d('0x35'))){_0x867d69[_0xb23d('0x20')]=qs['limit'](_0x67eaf3[_0xb23d('0x2f')][_0xb23d('0x20')]);_0x867d69[_0xb23d('0x1f')]=qs[_0xb23d('0x1f')](_0x67eaf3[_0xb23d('0x2f')][_0xb23d('0x1f')]);}_0x867d69[_0xb23d('0x36')]=qs[_0xb23d('0x37')](_0x67eaf3['query'][_0xb23d('0x37')]);_0x867d69[_0xb23d('0x38')]=qs[_0xb23d('0x39')](_[_0xb23d('0x3a')](_0x67eaf3[_0xb23d('0x2f')],_0x2f039f[_0xb23d('0x39')]));if(_0x67eaf3[_0xb23d('0x2f')][_0xb23d('0x3b')]){_0x867d69[_0xb23d('0x38')]=_[_0xb23d('0x3c')](_0x867d69[_0xb23d('0x38')],{'$or':_[_0xb23d('0x3d')](_0x2931a2,function(_0x4f84fb){if(_0x4f84fb[_0xb23d('0x3e')][_0xb23d('0x3f')]!==_0xb23d('0x40')){var _0x4dae03={};_0x4dae03[_0x4f84fb[_0xb23d('0x41')]]={'$like':'%'+_0x67eaf3[_0xb23d('0x2f')][_0xb23d('0x3b')]+'%'};return _0x4dae03;}})});}_0x867d69=_[_0xb23d('0x3c')]({},_0x867d69,_0x67eaf3[_0xb23d('0x42')]);var _0x3812c3={'where':_0x867d69[_0xb23d('0x38')]};return db[_0xb23d('0x2b')][_0xb23d('0x43')](_0x3812c3)['then'](function(_0x2c741e){_0x349ba6[_0xb23d('0x43')]=_0x2c741e;if(_0x67eaf3[_0xb23d('0x2f')][_0xb23d('0x44')]){_0x867d69['include']=[{'all':!![]}];}return db[_0xb23d('0x2b')]['findAll'](_0x867d69);})['then'](function(_0x7c9f47){_0x349ba6['rows']=_0x7c9f47;return _0x349ba6;})[_0xb23d('0x24')](respondWithFilteredResult(_0x26990e,_0x867d69))[_0xb23d('0x45')](handleError(_0x26990e,null));};exports[_0xb23d('0x46')]=function(_0x2ba970,_0x510947){var _0x12d7e8={'raw':!![],'where':{'id':_0x2ba970[_0xb23d('0x47')]['id']}},_0x4f747e={};_0x4f747e['model']=_[_0xb23d('0x2d')](db['ChatInternalMessage']['rawAttributes']);_0x4f747e['query']=_['keys'](_0x2ba970[_0xb23d('0x2f')]);_0x4f747e[_0xb23d('0x39')]=_['intersection'](_0x4f747e[_0xb23d('0x31')],_0x4f747e[_0xb23d('0x2f')]);_0x12d7e8[_0xb23d('0x30')]=_[_0xb23d('0x2e')](_0x4f747e['model'],qs['fields'](_0x2ba970[_0xb23d('0x2f')][_0xb23d('0x32')]));_0x12d7e8[_0xb23d('0x30')]=_0x12d7e8[_0xb23d('0x30')]['length']?_0x12d7e8[_0xb23d('0x30')]:_0x4f747e[_0xb23d('0x31')];if(_0x2ba970[_0xb23d('0x2f')][_0xb23d('0x44')]){_0x12d7e8['include']=[{'all':!![]}];}_0x12d7e8=_[_0xb23d('0x3c')]({},_0x12d7e8,_0x2ba970['options']);return db[_0xb23d('0x2b')][_0xb23d('0x48')](_0x12d7e8)[_0xb23d('0x24')](handleEntityNotFound(_0x510947,null))['then'](respondWithResult(_0x510947,null))[_0xb23d('0x45')](handleError(_0x510947,null));};exports['create']=function(_0x45303e,_0x5ec48e){return db[_0xb23d('0x2b')][_0xb23d('0x49')](_0x45303e[_0xb23d('0x4a')],{})[_0xb23d('0x24')](respondWithResult(_0x5ec48e,0xc9))[_0xb23d('0x45')](handleError(_0x5ec48e,null));};exports[_0xb23d('0x23')]=function(_0xca0470,_0x30c499){if(_0xca0470[_0xb23d('0x4a')]['id']){delete _0xca0470['body']['id'];}return db[_0xb23d('0x2b')][_0xb23d('0x48')]({'where':{'id':_0xca0470['params']['id']}})[_0xb23d('0x24')](handleEntityNotFound(_0x30c499,null))['then'](saveUpdates(_0xca0470[_0xb23d('0x4a')],null))[_0xb23d('0x24')](respondWithResult(_0x30c499,null))[_0xb23d('0x45')](handleError(_0x30c499,null));};exports['destroy']=function(_0xc78b28,_0x232f78){return db['ChatInternalMessage'][_0xb23d('0x48')]({'where':{'id':_0xc78b28[_0xb23d('0x47')]['id']}})[_0xb23d('0x24')](handleEntityNotFound(_0x232f78,null))[_0xb23d('0x24')](removeEntity(_0x232f78,null))[_0xb23d('0x45')](handleError(_0x232f78,null));};exports[_0xb23d('0x4b')]=function(_0x12ef37,_0x37e257){return db['ChatInternalMessage']['describe']()[_0xb23d('0x24')](respondWithResult(_0x37e257,null))['catch'](handleError(_0x37e257,null));};function wrapUser(_0x1edb03){return function(_0x40715f){var _0x39a713=_0x1edb03['get']({'plain':!![]});_0x39a713[_0xb23d('0x4c')]=[];if(_0x40715f){_0x39a713[_0xb23d('0x4d')]=_0x40715f[_0xb23d('0x4e')];_0x39a713['lastMessage']=_0x40715f;}else{_0x39a713[_0xb23d('0x4d')]=moment(0x0)['format'](_0xb23d('0x4f'));_0x39a713[_0xb23d('0x50')]={};}return _0x39a713;};}exports[_0xb23d('0x51')]=function(_0x2fc4d5,_0x3666f9,_0x5ea562){var _0xc59a8c=[];return db['User'][_0xb23d('0x52')]({'where':{'role':[_0xb23d('0x53'),_0xb23d('0x54'),_0xb23d('0x55')]},'attributes':['id',_0xb23d('0x56'),_0xb23d('0x28'),'role','userpic','internal',_0xb23d('0x57'),_0xb23d('0x58'),_0xb23d('0x59'),'showWebBar'],'order':qs[_0xb23d('0x37')](_0xb23d('0x5a')),'include':[{'model':db[_0xb23d('0x5b')],'as':'VoiceQueues','attributes':['id',_0xb23d('0x28'),_0xb23d('0x3e')],'through':{'attributes':[]}}]})[_0xb23d('0x24')](function(_0xefd2ee){if(_0xefd2ee){var _0x35b9fc=_0x2fc4d5['user'][_0xb23d('0x5c')]({'plain':!![]});if(!_0x35b9fc)throw new Error(_0xb23d('0x5d'));if(_0x35b9fc['role']===_0xb23d('0x55')){return db[_0xb23d('0x5e')]['find']({'where':{'name':_0xb23d('0x5f'),'userProfileId':_0x35b9fc[_0xb23d('0x60')]},'raw':!![]})[_0xb23d('0x24')](function(_0x337986){if(_0x337986){if(_0x337986[_0xb23d('0x61')]===0x0){return db[_0xb23d('0x62')][_0xb23d('0x52')]({'where':{'sectionId':_0x337986['id']},'raw':!![]})['then'](function(_0x18d80d){var _0x529150=[];if(_['isEmpty'](_0x18d80d)){_0x529150=_[_0xb23d('0x3b')](_0xefd2ee,function(_0x2fcecb){if(_0x2fcecb[_0xb23d('0x63')]!==_0xb23d('0x53')){return _0x2fcecb;}});return _0x529150;}else{for(var _0x12c60b=0x0;_0x12c60b<_0xefd2ee[_0xb23d('0x33')];_0x12c60b++){var _0x4fdcde=_0xefd2ee[_0x12c60b];if(_0x4fdcde[_0xb23d('0x63')]===_0xb23d('0x53')){var _0x3ff8a7=_[_0xb23d('0x48')](_0x18d80d,function(_0x93b08a){return _0x93b08a['resourceId']===_0x4fdcde['id'];});if(_0x3ff8a7)_0x529150[_0xb23d('0x64')](_0x4fdcde);}else{_0x529150['push'](_0x4fdcde);}}return _0x529150;}});}else{return _0xefd2ee;}}else{var _0x3462f9=_[_0xb23d('0x3b')](_0xefd2ee,function(_0xcbac6e){if(_0xcbac6e['role']!==_0xb23d('0x53')){return _0xcbac6e;}});return _0x3462f9;}});}else{return _0xefd2ee;}}})[_0xb23d('0x24')](function(_0x5d44c5){var _0x20bbc1=[];if(_0x5d44c5){_0xc59a8c=_0x5d44c5;for(var _0x186bfc=0x0;_0x186bfc<_0x5d44c5[_0xb23d('0x33')];_0x186bfc+=0x1){_0xc59a8c[_0x186bfc]['messages']=[];_0x20bbc1[_0xb23d('0x64')](db['ChatInternalMessage'][_0xb23d('0x48')]({'where':{'FromId':[_0x2fc4d5[_0xb23d('0x55')]['id'],_0x5d44c5[_0x186bfc]['id']],'ToId':[_0x2fc4d5[_0xb23d('0x55')]['id'],_0x5d44c5[_0x186bfc]['id']],'ChatGroupId':null},'attributes':['id',_0xb23d('0x4e'),'FromId',_0xb23d('0x65'),_0xb23d('0x66'),_0xb23d('0x4a')],'order':qs[_0xb23d('0x37')](_0xb23d('0x67')),'limit':0x1,'offset':0x0,'raw':!![]})[_0xb23d('0x24')](wrapUser(_0x5d44c5[_0x186bfc])));}return BPromise['all'](_0x20bbc1);}return[];})[_0xb23d('0x24')](function(_0x2e16d2){return{'rows':_0x2e16d2,'count':_0x2e16d2[_0xb23d('0x33')]};})['then'](respondWithResult(_0x3666f9,null))[_0xb23d('0x45')](handleError(_0x3666f9,null));}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js index a202d68..0a39425 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 _0x6e90=['../../mysqldb','ChatInternalMessage','setMaxListeners','save','update','emit','hasOwnProperty','hook','exports','events'];(function(_0x5a86fc,_0x2e0cab){var _0x1c121f=function(_0x36cc62){while(--_0x36cc62){_0x5a86fc['push'](_0x5a86fc['shift']());}};_0x1c121f(++_0x2e0cab);}(_0x6e90,0x9f));var _0x06e9=function(_0x51f032,_0x1ececc){_0x51f032=_0x51f032-0x0;var _0x397471=_0x6e90[_0x51f032];return _0x397471;};'use strict';var EventEmitter=require(_0x06e9('0x0'));var ChatInternalMessage=require(_0x06e9('0x1'))['db'][_0x06e9('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x06e9('0x3')](0x0);var events={'afterCreate':_0x06e9('0x4'),'afterUpdate':_0x06e9('0x5'),'afterDestroy':'remove'};function emitEvent(_0x29d2c6){return function(_0x480212,_0x1773a8,_0x481049){ChatInternalMessageEvents[_0x06e9('0x6')](_0x29d2c6+':'+_0x480212['id'],_0x480212);ChatInternalMessageEvents[_0x06e9('0x6')](_0x29d2c6,_0x480212);_0x481049(null);};}for(var e in events){if(events[_0x06e9('0x7')](e)){var event=events[e];ChatInternalMessage[_0x06e9('0x8')](e,emitEvent(event));}}module[_0x06e9('0x9')]=ChatInternalMessageEvents; \ No newline at end of file +var _0x88b5=['../../mysqldb','ChatInternalMessage','save','update','remove','emit','exports','events'];(function(_0x1e50a4,_0x5bdfc2){var _0x1e13c5=function(_0x32024b){while(--_0x32024b){_0x1e50a4['push'](_0x1e50a4['shift']());}};_0x1e13c5(++_0x5bdfc2);}(_0x88b5,0x10f));var _0x588b=function(_0x320717,_0x5d670f){_0x320717=_0x320717-0x0;var _0x2c099b=_0x88b5[_0x320717];return _0x2c099b;};'use strict';var EventEmitter=require(_0x588b('0x0'));var ChatInternalMessage=require(_0x588b('0x1'))['db'][_0x588b('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x588b('0x3'),'afterUpdate':_0x588b('0x4'),'afterDestroy':_0x588b('0x5')};function emitEvent(_0x289f63){return function(_0x119d23,_0x2e59db,_0x502add){ChatInternalMessageEvents[_0x588b('0x6')](_0x289f63+':'+_0x119d23['id'],_0x119d23);ChatInternalMessageEvents[_0x588b('0x6')](_0x289f63,_0x119d23);_0x502add(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInternalMessage['hook'](e,emitEvent(event));}}module[_0x588b('0x7')]=ChatInternalMessageEvents; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js index b9f0388..f76fd37 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 _0xd8b0=['define','chat_internal_messages','utf8mb4','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x23fd26,_0x4c42c7){var _0x4c6d08=function(_0x1cb6e2){while(--_0x1cb6e2){_0x23fd26['push'](_0x23fd26['shift']());}};_0x4c6d08(++_0x4c42c7);}(_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('./chatInternalMessage.attributes');module['exports']=function(_0x3f8b6f,_0x227c63){return _0x3f8b6f[_0x0d8b('0x7')]('ChatInternalMessage',attributes,{'tableName':_0x0d8b('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x0d8b('0x9'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x0713=['../../config/environment','./chatInternalMessage.attributes','exports','define','ChatInternalMessage','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0x43b487,_0x21893a){var _0x2f707a=function(_0x477ee0){while(--_0x477ee0){_0x43b487['push'](_0x43b487['shift']());}};_0x2f707a(++_0x21893a);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3071('0x0'))(_0x3071('0x1'));var moment=require(_0x3071('0x2'));var BPromise=require(_0x3071('0x3'));var rp=require(_0x3071('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));var attributes=require(_0x3071('0x7'));module[_0x3071('0x8')]=function(_0xabd7b6,_0x41cf76){return _0xabd7b6[_0x3071('0x9')](_0x3071('0xa'),attributes,{'tableName':_0x3071('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x3071('0xc'),'collate':_0x3071('0xd')});}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js index c4fd741..cb673a0 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 _0x3bbf=['ChatInternalMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','http','redis','localhost','socket.io-emitter','./chatInternalMessage.socket','register','then','ChatInternalMessage,\x20%s,\x20%s','request\x20sent'];(function(_0x44fde1,_0x3f34f5){var _0x4d2227=function(_0x54d8f2){while(--_0x54d8f2){_0x44fde1['push'](_0x44fde1['shift']());}};_0x4d2227(++_0x3f34f5);}(_0x3bbf,0x1e1));var _0xf3bb=function(_0x743400,_0x5879a2){_0x743400=_0x743400-0x0;var _0x2be62e=_0x3bbf[_0x743400];return _0x2be62e;};'use strict';var _=require(_0xf3bb('0x0'));var util=require(_0xf3bb('0x1'));var moment=require(_0xf3bb('0x2'));var BPromise=require(_0xf3bb('0x3'));var rs=require(_0xf3bb('0x4'));var fs=require('fs');var Redis=require(_0xf3bb('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xf3bb('0x6'));var logger=require(_0xf3bb('0x7'))(_0xf3bb('0x8'));var config=require('../../config/environment');var jayson=require(_0xf3bb('0x9'));var client=jayson['client'][_0xf3bb('0xa')]({'port':0x232a});config[_0xf3bb('0xb')]=_['defaults'](config['redis'],{'host':_0xf3bb('0xc'),'port':0x18eb});var socket=require(_0xf3bb('0xd'))(new Redis(config[_0xf3bb('0xb')]));require(_0xf3bb('0xe'))[_0xf3bb('0xf')](socket);function respondWithRpcPromise(_0x52431c,_0x548505,_0x27fd3f){return new BPromise(function(_0x26be40,_0x267f46){return client['request'](_0x52431c,_0x27fd3f)[_0xf3bb('0x10')](function(_0x25a22b){logger['info'](_0xf3bb('0x11'),_0x548505,_0xf3bb('0x12'));logger['debug'](_0xf3bb('0x13'),_0x548505,'request\x20sent',JSON['stringify'](_0x25a22b));if(_0x25a22b[_0xf3bb('0x14')]){if(_0x25a22b[_0xf3bb('0x14')][_0xf3bb('0x15')]===0x1f4){logger[_0xf3bb('0x14')](_0xf3bb('0x11'),_0x548505,_0x25a22b[_0xf3bb('0x14')][_0xf3bb('0x16')]);return _0x267f46(_0x25a22b[_0xf3bb('0x14')][_0xf3bb('0x16')]);}logger[_0xf3bb('0x14')](_0xf3bb('0x11'),_0x548505,_0x25a22b[_0xf3bb('0x14')]['message']);return _0x26be40(_0x25a22b[_0xf3bb('0x14')][_0xf3bb('0x16')]);}else{logger['info'](_0xf3bb('0x11'),_0x548505,'request\x20sent');_0x26be40(_0x25a22b[_0xf3bb('0x17')][_0xf3bb('0x16')]);}})[_0xf3bb('0x18')](function(_0x2ed320){logger[_0xf3bb('0x14')](_0xf3bb('0x11'),_0x548505,_0x2ed320);_0x267f46(_0x2ed320);});});} \ No newline at end of file +var _0xd628=['../../config/logger','../../config/environment','jayson/promise','client','redis','socket.io-emitter','./chatInternalMessage.socket','request','info','ChatInternalMessage,\x20%s,\x20%s','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x4e1a48,_0x3d5077){var _0x1aed69=function(_0xfb19eb){while(--_0xfb19eb){_0x4e1a48['push'](_0x4e1a48['shift']());}};_0x1aed69(++_0x3d5077);}(_0xd628,0x102));var _0x8d62=function(_0x409a63,_0x15e787){_0x409a63=_0x409a63-0x0;var _0x3056a0=_0xd628[_0x409a63];return _0x3056a0;};'use strict';var _=require('lodash');var util=require(_0x8d62('0x0'));var moment=require(_0x8d62('0x1'));var BPromise=require('bluebird');var rs=require(_0x8d62('0x2'));var fs=require('fs');var Redis=require(_0x8d62('0x3'));var db=require(_0x8d62('0x4'))['db'];var utils=require(_0x8d62('0x5'));var logger=require(_0x8d62('0x6'))('rpc');var config=require(_0x8d62('0x7'));var jayson=require(_0x8d62('0x8'));var client=jayson[_0x8d62('0x9')]['http']({'port':0x232a});config[_0x8d62('0xa')]=_['defaults'](config[_0x8d62('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x8d62('0xb'))(new Redis(config['redis']));require(_0x8d62('0xc'))['register'](socket);function respondWithRpcPromise(_0x31cf3c,_0x170e06,_0x25b445){return new BPromise(function(_0x44f164,_0x1f9be5){return client[_0x8d62('0xd')](_0x31cf3c,_0x25b445)['then'](function(_0x391ff1){logger[_0x8d62('0xe')](_0x8d62('0xf'),_0x170e06,'request\x20sent');logger[_0x8d62('0x10')](_0x8d62('0x11'),_0x170e06,_0x8d62('0x12'),JSON[_0x8d62('0x13')](_0x391ff1));if(_0x391ff1[_0x8d62('0x14')]){if(_0x391ff1['error']['code']===0x1f4){logger['error'](_0x8d62('0xf'),_0x170e06,_0x391ff1[_0x8d62('0x14')][_0x8d62('0x15')]);return _0x1f9be5(_0x391ff1['error']['message']);}logger[_0x8d62('0x14')]('ChatInternalMessage,\x20%s,\x20%s',_0x170e06,_0x391ff1['error']['message']);return _0x44f164(_0x391ff1[_0x8d62('0x14')][_0x8d62('0x15')]);}else{logger[_0x8d62('0xe')](_0x8d62('0xf'),_0x170e06,_0x8d62('0x12'));_0x44f164(_0x391ff1[_0x8d62('0x16')][_0x8d62('0x15')]);}})[_0x8d62('0x17')](function(_0x318aea){logger['error'](_0x8d62('0xf'),_0x170e06,_0x318aea);_0x1f9be5(_0x318aea);});});} \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js index f572380..8e874cb 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 _0x562d=['./chatInternalMessage.events','save','remove','emit','length'];(function(_0x51594d,_0x110073){var _0x107268=function(_0x4c7a35){while(--_0x4c7a35){_0x51594d['push'](_0x51594d['shift']());}};_0x107268(++_0x110073);}(_0x562d,0xe1));var _0xd562=function(_0x59e893,_0x3adcb9){_0x59e893=_0x59e893-0x0;var _0x56046e=_0x562d[_0x59e893];return _0x56046e;};'use strict';var ChatInternalMessageEvents=require(_0xd562('0x0'));var events=[_0xd562('0x1'),_0xd562('0x2'),'update'];function createListener(_0x517c30,_0x3ea08c){return function(_0x29f939){_0x3ea08c[_0xd562('0x3')](_0x517c30,_0x29f939);};}function removeListener(_0x4c6430,_0xf71ee1){return function(){ChatInternalMessageEvents['removeListener'](_0x4c6430,_0xf71ee1);};}exports['register']=function(_0x1d05e9){for(var _0x46bf9b=0x0,_0x3e6465=events[_0xd562('0x4')];_0x46bf9b<_0x3e6465;_0x46bf9b++){var _0x21f82a=events[_0x46bf9b];var _0x38e1a7=createListener('chatInternalMessage:'+_0x21f82a,_0x1d05e9);ChatInternalMessageEvents['on'](_0x21f82a,_0x38e1a7);}}; \ No newline at end of file +var _0xc9b7=['register','length','chatInternalMessage:','./chatInternalMessage.events','save','remove','update','removeListener'];(function(_0x509eca,_0x53b8ad){var _0x511c25=function(_0x1e3f70){while(--_0x1e3f70){_0x509eca['push'](_0x509eca['shift']());}};_0x511c25(++_0x53b8ad);}(_0xc9b7,0x1ab));var _0x7c9b=function(_0x214266,_0x1f6f52){_0x214266=_0x214266-0x0;var _0x568f75=_0xc9b7[_0x214266];return _0x568f75;};'use strict';var ChatInternalMessageEvents=require(_0x7c9b('0x0'));var events=[_0x7c9b('0x1'),_0x7c9b('0x2'),_0x7c9b('0x3')];function createListener(_0x49bfb8,_0x46f817){return function(_0x1ed731){_0x46f817['emit'](_0x49bfb8,_0x1ed731);};}function removeListener(_0x474486,_0x365dd6){return function(){ChatInternalMessageEvents[_0x7c9b('0x4')](_0x474486,_0x365dd6);};}exports[_0x7c9b('0x5')]=function(_0x3d19d7){for(var _0x4714e0=0x0,_0x351532=events[_0x7c9b('0x6')];_0x4714e0<_0x351532;_0x4714e0++){var _0x456555=events[_0x4714e0];var _0x440561=createListener(_0x7c9b('0x7')+_0x456555,_0x3d19d7);ChatInternalMessageEvents['on'](_0x456555,_0x440561);}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js index 82fe3d5..5932c4f 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 _0xb7e7=['exports','multer','path','express','../../components/auth/service','../../config/environment','./chatInternalMessage.controller','get','/describe','isAuthenticated','/users','getUsers','/:id','post','create','put','update','delete'];(function(_0x34032c,_0x34f33b){var _0x4146e1=function(_0x62cf40){while(--_0x62cf40){_0x34032c['push'](_0x34032c['shift']());}};_0x4146e1(++_0x34f33b);}(_0xb7e7,0x121));var _0x7b7e=function(_0x187ee1,_0x3fd1e6){_0x187ee1=_0x187ee1-0x0;var _0x388160=_0xb7e7[_0x187ee1];return _0x388160;};'use strict';var multer=require(_0x7b7e('0x0'));var util=require('util');var path=require(_0x7b7e('0x1'));var timeout=require('connect-timeout');var express=require(_0x7b7e('0x2'));var router=express['Router']();var auth=require(_0x7b7e('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x7b7e('0x4'));var controller=require(_0x7b7e('0x5'));router[_0x7b7e('0x6')]('/',auth['isAuthenticated'](),controller['index']);router[_0x7b7e('0x6')](_0x7b7e('0x7'),auth[_0x7b7e('0x8')](),controller['describe']);router[_0x7b7e('0x6')](_0x7b7e('0x9'),auth[_0x7b7e('0x8')](),controller[_0x7b7e('0xa')]);router[_0x7b7e('0x6')](_0x7b7e('0xb'),auth[_0x7b7e('0x8')](),controller['show']);router[_0x7b7e('0xc')]('/',auth[_0x7b7e('0x8')](),controller[_0x7b7e('0xd')]);router[_0x7b7e('0xe')](_0x7b7e('0xb'),controller[_0x7b7e('0xf')]);router[_0x7b7e('0x10')](_0x7b7e('0xb'),auth[_0x7b7e('0x8')](),controller['destroy']);module[_0x7b7e('0x11')]=router; \ No newline at end of file +var _0xb7e7=['exports','multer','path','express','../../components/auth/service','../../config/environment','./chatInternalMessage.controller','get','/describe','isAuthenticated','/users','getUsers','/:id','post','create','put','update','delete'];(function(_0x3633f1,_0x5c7c23){var _0x3bbf02=function(_0x2d7c92){while(--_0x2d7c92){_0x3633f1['push'](_0x3633f1['shift']());}};_0x3bbf02(++_0x5c7c23);}(_0xb7e7,0x121));var _0x7b7e=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xb7e7[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x7b7e('0x0'));var util=require('util');var path=require(_0x7b7e('0x1'));var timeout=require('connect-timeout');var express=require(_0x7b7e('0x2'));var router=express['Router']();var auth=require(_0x7b7e('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x7b7e('0x4'));var controller=require(_0x7b7e('0x5'));router[_0x7b7e('0x6')]('/',auth['isAuthenticated'](),controller['index']);router[_0x7b7e('0x6')](_0x7b7e('0x7'),auth[_0x7b7e('0x8')](),controller['describe']);router[_0x7b7e('0x6')](_0x7b7e('0x9'),auth[_0x7b7e('0x8')](),controller[_0x7b7e('0xa')]);router[_0x7b7e('0x6')](_0x7b7e('0xb'),auth[_0x7b7e('0x8')](),controller['show']);router[_0x7b7e('0xc')]('/',auth[_0x7b7e('0x8')](),controller[_0x7b7e('0xd')]);router[_0x7b7e('0xe')](_0x7b7e('0xb'),controller[_0x7b7e('0xf')]);router[_0x7b7e('0x10')](_0x7b7e('0xb'),auth[_0x7b7e('0x8')](),controller['destroy']);module[_0x7b7e('0x11')]=router; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js index 916f2c3..a6d4dfc 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 _0xfff0=['BOOLEAN','out','DATE','sequelize','TEXT','medium'];(function(_0x133277,_0xb1d6b2){var _0x5b4a22=function(_0x484c26){while(--_0x484c26){_0x133277['push'](_0x133277['shift']());}};_0x5b4a22(++_0xb1d6b2);}(_0xfff0,0x159));var _0x0fff=function(_0x2905d2,_0x2337cb){_0x2905d2=_0x2905d2-0x0;var _0x8aa718=_0xfff0[_0x2905d2];return _0x8aa718;};'use strict';var Sequelize=require(_0x0fff('0x0'));module['exports']={'body':{'type':Sequelize[_0x0fff('0x1')](_0x0fff('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x0fff('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0x0fff('0x3')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x0fff('0x4')),'defaultValue':_0x0fff('0x4'),'allowNull':![]},'readAt':{'type':Sequelize[_0x0fff('0x5')]}}; \ No newline at end of file +var _0x8854=['out','DATE','exports','TEXT','BOOLEAN','ENUM'];(function(_0x16ce9e,_0x13abb9){var _0x2c29f5=function(_0x5050c8){while(--_0x5050c8){_0x16ce9e['push'](_0x16ce9e['shift']());}};_0x2c29f5(++_0x13abb9);}(_0x8854,0x1e2));var _0x4885=function(_0x562601,_0x3e379d){_0x562601=_0x562601-0x0;var _0xbbe2a3=_0x8854[_0x562601];return _0xbbe2a3;};'use strict';var Sequelize=require('sequelize');module[_0x4885('0x0')]={'body':{'type':Sequelize[_0x4885('0x1')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x4885('0x2')],'defaultValue':![]},'secret':{'type':Sequelize[_0x4885('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0x4885('0x3')]('in','out'),'defaultValue':_0x4885('0x4'),'allowNull':![]},'readAt':{'type':Sequelize[_0x4885('0x5')]}}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js index 4c65332..36020a7 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 _0x3d2c=['querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','redis','localhost','socket.io-emitter','register','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','save','update','stack','name','index','ChatMessage','rawAttributes','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','field','options','count','includeAll','include','findAll','rows','params','create','body','describe','chat-interactions','accept','chat','read','YYYY-MM-DD\x20HH:mm:ss','UserId','user','find','ChatInteractionId','read1stAt','format','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','acceptMessage','manual','interface','SIP/%s','channel','event','EventManager','parse','formData','reject','agent','get','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage','rejectmessage','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','to-csv','ejs','squel','crypto','jsforce'];(function(_0x508685,_0x9f94af){var _0x976a76=function(_0x1bcb05){while(--_0x1bcb05){_0x508685['push'](_0x508685['shift']());}};_0x976a76(++_0x9f94af);}(_0x3d2c,0xdc));var _0xc3d2=function(_0xfa2bd9,_0xf304a6){_0xfa2bd9=_0xfa2bd9-0x0;var _0x7f17ba=_0x3d2c[_0xfa2bd9];return _0x7f17ba;};'use strict';var pdf=require(_0xc3d2('0x0'));var emlformat=require(_0xc3d2('0x1'));var rimraf=require(_0xc3d2('0x2'));var zipdir=require(_0xc3d2('0x3'));var jsonpatch=require(_0xc3d2('0x4'));var rp=require(_0xc3d2('0x5'));var moment=require(_0xc3d2('0x6'));var BPromise=require('bluebird');var Mustache=require(_0xc3d2('0x7'));var util=require('util');var path=require(_0xc3d2('0x8'));var sox=require('sox');var csv=require(_0xc3d2('0x9'));var ejs=require(_0xc3d2('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0xc3d2('0xb'));var crypto=require(_0xc3d2('0xc'));var jsforce=require(_0xc3d2('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xc3d2('0xe'));var Papa=require(_0xc3d2('0xf'));var Redis=require(_0xc3d2('0x10'));var authService=require(_0xc3d2('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xc3d2('0x12'));var hardwareService=require(_0xc3d2('0x13'));var logger=require(_0xc3d2('0x14'))(_0xc3d2('0x15'));var utils=require(_0xc3d2('0x16'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0xc3d2('0x17')]=_['defaults'](config['redis'],{'host':_0xc3d2('0x18'),'port':0x18eb});var socket=require(_0xc3d2('0x19'))(new Redis(config[_0xc3d2('0x17')]));require('./chatMessage.socket')[_0xc3d2('0x1a')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0xc3d2('0x1b')]({'port':0x232c});var client9002=jayson['client'][_0xc3d2('0x1b')]({'port':0x232a});function checkPasswordPattern(_0x2b033,_0x5eacf7,_0xcf6474){if(_0xcf6474){var _0x1f1200=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1f1200[_0xc3d2('0x1c')](_0x5eacf7)){return _0x2b033;}else{throw new Error(_0xc3d2('0x1d'));}}else{return _0x2b033;}}function respondWithRpcPromise(_0x57e27c,_0x5ac9f0,_0x5d2140,_0x5a9c19){return new BPromise(function(_0x355c04,_0x42f5e4){var _0x2073f4=_0x5a9c19||client;return _0x2073f4[_0xc3d2('0x1e')](_0x57e27c,_0x5d2140)[_0xc3d2('0x1f')](function(_0x42da6b){logger[_0xc3d2('0x20')](_0xc3d2('0x21'),_0x5ac9f0,_0xc3d2('0x22'));logger[_0xc3d2('0x23')](_0xc3d2('0x24'),_0x5ac9f0,_0xc3d2('0x22'),JSON[_0xc3d2('0x25')](_0x42da6b));if(_0x42da6b['error']){if(_0x42da6b[_0xc3d2('0x26')]['code']===0x1f4){logger[_0xc3d2('0x26')]('ChatMessage,\x20%s,\x20%s',_0x5ac9f0,_0x42da6b[_0xc3d2('0x26')][_0xc3d2('0x27')]);return _0x42f5e4(_0x42da6b[_0xc3d2('0x26')][_0xc3d2('0x27')]);}logger[_0xc3d2('0x26')]('ChatMessage,\x20%s,\x20%s',_0x5ac9f0,_0x42da6b[_0xc3d2('0x26')][_0xc3d2('0x27')]);return _0x355c04(_0x42da6b[_0xc3d2('0x26')]['message']);}else{logger[_0xc3d2('0x20')](_0xc3d2('0x21'),_0x5ac9f0,_0xc3d2('0x22'));_0x355c04(_0x42da6b[_0xc3d2('0x28')][_0xc3d2('0x27')]);}})[_0xc3d2('0x29')](function(_0x5c967d){logger['error'](_0xc3d2('0x21'),_0x5ac9f0,_0x5c967d);_0x42f5e4(_0x5c967d);});});}function respondWithStatusCode(_0x3a71db,_0x27162b){_0x27162b=_0x27162b||0xcc;return function(_0x1c0e3c){if(_0x1c0e3c){return _0x3a71db[_0xc3d2('0x2a')](_0x27162b);}return _0x3a71db[_0xc3d2('0x2b')](_0x27162b)[_0xc3d2('0x2c')]();};}function respondWithResult(_0x2ff866,_0x199278){_0x199278=_0x199278||0xc8;return function(_0x20780f){if(_0x20780f){return _0x2ff866[_0xc3d2('0x2b')](_0x199278)[_0xc3d2('0x2d')](_0x20780f);}};}function respondWithFilteredResult(_0x353524,_0x468dc1){return function(_0x42c7ff){if(_0x42c7ff){var _0x5464d4=_0x42c7ff['count'],_0x41a66f=_0x468dc1[_0xc3d2('0x2e')],_0x126ac0=_0x468dc1[_0xc3d2('0x2e')]+_0x468dc1[_0xc3d2('0x2f')],_0x5e5a3c;if(_0x126ac0>=_0x5464d4){_0x126ac0=_0x5464d4;_0x5e5a3c=0xc8;}else{_0x5e5a3c=0xce;}_0x353524[_0xc3d2('0x2b')](_0x5e5a3c);return _0x353524[_0xc3d2('0x30')](_0xc3d2('0x31'),_0x41a66f+'-'+_0x126ac0+'/'+_0x5464d4)[_0xc3d2('0x2d')](_0x42c7ff);}return null;};}function patchUpdates(_0x32243c){return function(_0x3a9c04){try{jsonpatch[_0xc3d2('0x32')](_0x3a9c04,_0x32243c,!![]);}catch(_0x476778){return BPromise['reject'](_0x476778);}return _0x3a9c04[_0xc3d2('0x33')]();};}function saveUpdates(_0x5e4a38,_0x693d99){return function(_0x260aa1){if(_0x260aa1){return _0x260aa1[_0xc3d2('0x34')](_0x5e4a38)[_0xc3d2('0x1f')](function(_0x49998){return _0x49998;});}return null;};}function removeEntity(_0x44034a,_0x9a2218){return function(_0x42527c){if(_0x42527c){return _0x42527c['destroy']()[_0xc3d2('0x1f')](function(){_0x44034a[_0xc3d2('0x2b')](0xcc)[_0xc3d2('0x2c')]();});}};}function handleEntityNotFound(_0x18c22b,_0x350446){return function(_0x1b1b79){if(!_0x1b1b79){_0x18c22b[_0xc3d2('0x2a')](0x194);}return _0x1b1b79;};}function handleError(_0x5c8932,_0x563730){_0x563730=_0x563730||0x1f4;return function(_0x5a7bc0){logger['error'](_0x5a7bc0[_0xc3d2('0x35')]);if(_0x5a7bc0[_0xc3d2('0x36')]){delete _0x5a7bc0[_0xc3d2('0x36')];}_0x5c8932[_0xc3d2('0x2b')](_0x563730)['send'](_0x5a7bc0);};}exports[_0xc3d2('0x37')]=function(_0x4e65c9,_0x971881){var _0x232d8d={},_0x127395={},_0x5958a8={'count':0x0,'rows':[]};var _0x563ff6=db[_0xc3d2('0x38')][_0xc3d2('0x39')];_0x127395['model']=_[_0xc3d2('0x3a')](_0x563ff6);_0x127395['query']=_[_0xc3d2('0x3a')](_0x4e65c9[_0xc3d2('0x3b')]);_0x127395[_0xc3d2('0x3c')]=_[_0xc3d2('0x3d')](_0x127395[_0xc3d2('0x3e')],_0x127395['query']);_0x232d8d[_0xc3d2('0x3f')]=_[_0xc3d2('0x3d')](_0x127395[_0xc3d2('0x3e')],qs[_0xc3d2('0x40')](_0x4e65c9[_0xc3d2('0x3b')][_0xc3d2('0x40')]));_0x232d8d[_0xc3d2('0x3f')]=_0x232d8d['attributes'][_0xc3d2('0x41')]?_0x232d8d[_0xc3d2('0x3f')]:_0x127395[_0xc3d2('0x3e')];if(!_0x4e65c9[_0xc3d2('0x3b')][_0xc3d2('0x42')](_0xc3d2('0x43'))){_0x232d8d[_0xc3d2('0x2f')]=qs[_0xc3d2('0x2f')](_0x4e65c9[_0xc3d2('0x3b')][_0xc3d2('0x2f')]);_0x232d8d[_0xc3d2('0x2e')]=qs[_0xc3d2('0x2e')](_0x4e65c9['query'][_0xc3d2('0x2e')]);}_0x232d8d[_0xc3d2('0x44')]=qs[_0xc3d2('0x45')](_0x4e65c9[_0xc3d2('0x3b')]['sort']);_0x232d8d[_0xc3d2('0x46')]=qs[_0xc3d2('0x3c')](_[_0xc3d2('0x47')](_0x4e65c9['query'],_0x127395[_0xc3d2('0x3c')]));if(_0x4e65c9[_0xc3d2('0x3b')][_0xc3d2('0x48')]){_0x232d8d[_0xc3d2('0x46')]=_[_0xc3d2('0x49')](_0x232d8d[_0xc3d2('0x46')],{'$or':_[_0xc3d2('0x4a')](_0x563ff6,function(_0x5a1b74){if(_0x5a1b74['type']['key']!==_0xc3d2('0x4b')){var _0x24d315={};_0x24d315[_0x5a1b74[_0xc3d2('0x4c')]]={'$like':'%'+_0x4e65c9[_0xc3d2('0x3b')][_0xc3d2('0x48')]+'%'};return _0x24d315;}})});}_0x232d8d=_[_0xc3d2('0x49')]({},_0x232d8d,_0x4e65c9[_0xc3d2('0x4d')]);var _0x4b625f={'where':_0x232d8d[_0xc3d2('0x46')]};return db[_0xc3d2('0x38')][_0xc3d2('0x4e')](_0x4b625f)[_0xc3d2('0x1f')](function(_0x4a2f39){_0x5958a8[_0xc3d2('0x4e')]=_0x4a2f39;if(_0x4e65c9[_0xc3d2('0x3b')][_0xc3d2('0x4f')]){_0x232d8d[_0xc3d2('0x50')]=[{'all':!![]}];}return db[_0xc3d2('0x38')][_0xc3d2('0x51')](_0x232d8d);})['then'](function(_0x3a0ce8){_0x5958a8[_0xc3d2('0x52')]=_0x3a0ce8;return _0x5958a8;})[_0xc3d2('0x1f')](respondWithFilteredResult(_0x971881,_0x232d8d))['catch'](handleError(_0x971881,null));};exports['show']=function(_0xde2cd7,_0x3c4f4e){var _0x3b06f6={'raw':!![],'where':{'id':_0xde2cd7[_0xc3d2('0x53')]['id']}},_0x19be7a={};_0x19be7a[_0xc3d2('0x3e')]=_['keys'](db[_0xc3d2('0x38')]['rawAttributes']);_0x19be7a[_0xc3d2('0x3b')]=_[_0xc3d2('0x3a')](_0xde2cd7['query']);_0x19be7a[_0xc3d2('0x3c')]=_['intersection'](_0x19be7a['model'],_0x19be7a[_0xc3d2('0x3b')]);_0x3b06f6[_0xc3d2('0x3f')]=_['intersection'](_0x19be7a[_0xc3d2('0x3e')],qs['fields'](_0xde2cd7[_0xc3d2('0x3b')][_0xc3d2('0x40')]));_0x3b06f6[_0xc3d2('0x3f')]=_0x3b06f6[_0xc3d2('0x3f')][_0xc3d2('0x41')]?_0x3b06f6[_0xc3d2('0x3f')]:_0x19be7a['model'];if(_0xde2cd7[_0xc3d2('0x3b')][_0xc3d2('0x4f')]){_0x3b06f6[_0xc3d2('0x50')]=[{'all':!![]}];}_0x3b06f6=_[_0xc3d2('0x49')]({},_0x3b06f6,_0xde2cd7['options']);return db[_0xc3d2('0x38')]['find'](_0x3b06f6)[_0xc3d2('0x1f')](handleEntityNotFound(_0x3c4f4e,null))[_0xc3d2('0x1f')](respondWithResult(_0x3c4f4e,null))[_0xc3d2('0x29')](handleError(_0x3c4f4e,null));};exports[_0xc3d2('0x54')]=function(_0x12f4d3,_0x1c0429){return db[_0xc3d2('0x38')][_0xc3d2('0x54')](_0x12f4d3[_0xc3d2('0x55')],{})[_0xc3d2('0x1f')](respondWithResult(_0x1c0429,0xc9))[_0xc3d2('0x29')](handleError(_0x1c0429,null));};exports[_0xc3d2('0x34')]=function(_0x4b2ee5,_0x234874){if(_0x4b2ee5['body']['id']){delete _0x4b2ee5[_0xc3d2('0x55')]['id'];}return db['ChatMessage']['find']({'where':{'id':_0x4b2ee5['params']['id']}})['then'](handleEntityNotFound(_0x234874,null))[_0xc3d2('0x1f')](saveUpdates(_0x4b2ee5[_0xc3d2('0x55')],null))[_0xc3d2('0x1f')](respondWithResult(_0x234874,null))['catch'](handleError(_0x234874,null));};exports['destroy']=function(_0x5c7ec7,_0x3d95d0){return db[_0xc3d2('0x38')]['find']({'where':{'id':_0x5c7ec7['params']['id']}})['then'](handleEntityNotFound(_0x3d95d0,null))[_0xc3d2('0x1f')](removeEntity(_0x3d95d0,null))['catch'](handleError(_0x3d95d0,null));};exports[_0xc3d2('0x56')]=function(_0x119241,_0x2318ba){return db[_0xc3d2('0x38')][_0xc3d2('0x56')]()['then'](respondWithResult(_0x2318ba,null))['catch'](handleError(_0x2318ba,null));};var interaction_log=require('../../config/logger')(_0xc3d2('0x57'));exports[_0xc3d2('0x58')]=function(_0x300f2e,_0x45031e,_0x245d54){var _0x3499d2={'channel':_0xc3d2('0x59')};if(_0x300f2e[_0xc3d2('0x55')]['id']){delete _0x300f2e[_0xc3d2('0x55')]['id'];}_0x300f2e[_0xc3d2('0x55')][_0xc3d2('0x5a')]=!![];_0x300f2e[_0xc3d2('0x55')]['readAt']=moment()['format'](_0xc3d2('0x5b'));_0x300f2e['body']['UserId']=_0x300f2e[_0xc3d2('0x55')][_0xc3d2('0x5c')]||_0x300f2e[_0xc3d2('0x5d')]['id'];return db[_0xc3d2('0x38')][_0xc3d2('0x5e')]({'where':{'id':_0x300f2e[_0xc3d2('0x53')]['id'],'UserId':null},'include':[{'model':db['CmContact'],'as':'Contact'}]})[_0xc3d2('0x1f')](handleEntityNotFound(_0x45031e,null))[_0xc3d2('0x1f')](saveUpdates(_0x300f2e[_0xc3d2('0x55')],null))['then'](function(_0x1424ae){if(_0x1424ae){_0x3499d2['message']=_0x1424ae['get']({'plain':!![]});return db['ChatInteraction'][_0xc3d2('0x5e')]({'where':{'id':_0x1424ae[_0xc3d2('0x5f')]}});}return null;})[_0xc3d2('0x1f')](handleEntityNotFound(_0x45031e,null))[_0xc3d2('0x1f')](function(_0x239462){if(_0x239462){return _0x239462[_0xc3d2('0x34')]({'UserId':_0x300f2e['body']['UserId'],'read1stAt':_['isNil'](_0x239462[_0xc3d2('0x60')])?moment()[_0xc3d2('0x61')](_0xc3d2('0x5b')):undefined});}return null;})[_0xc3d2('0x1f')](function(_0x13009c){if(_0x13009c){_0x3499d2[_0xc3d2('0x62')]=_0x13009c['get']({'plain':!![]});interaction_log[_0xc3d2('0x20')](_0xc3d2('0x63'),_0x300f2e[_0xc3d2('0x5d')]['id'],_0x300f2e[_0xc3d2('0x5d')][_0xc3d2('0x36')],_0x300f2e[_0xc3d2('0x5d')][_0xc3d2('0x64')],_0x3499d2[_0xc3d2('0x62')]['id'],_0x300f2e['body']?JSON['stringify'](_0x300f2e[_0xc3d2('0x55')]):_0xc3d2('0x65'));return respondWithRpcPromise('AcceptMessage',_0xc3d2('0x66'),_0x3499d2);}return null;})[_0xc3d2('0x1f')](function(_0x97c779){if(_0x97c779){if(_0x300f2e[_0xc3d2('0x55')][_0xc3d2('0x67')]){_0x3499d2[_0xc3d2('0x27')][_0xc3d2('0x68')]=util[_0xc3d2('0x61')](_0xc3d2('0x69'),_0x300f2e['user'][_0xc3d2('0x36')]);_0x3499d2['message'][_0xc3d2('0x6a')]=_0x3499d2[_0xc3d2('0x6a')];_0x3499d2['message'][_0xc3d2('0x6b')]='accept';return respondWithRpcPromise(_0xc3d2('0x6c'),_0xc3d2('0x6c'),{'event':'acceptmessage','message':_[_0xc3d2('0x49')](_0x3499d2[_0xc3d2('0x27')],JSON[_0xc3d2('0x6d')](_0x3499d2[_0xc3d2('0x62')][_0xc3d2('0x6e')]))},client9002)[_0xc3d2('0x1f')](function(){return _0x3499d2;});}return _0x3499d2;}return null;})['then'](respondWithResult(_0x45031e,null))[_0xc3d2('0x29')](handleError(_0x45031e,null));};var interaction_log=require(_0xc3d2('0x14'))(_0xc3d2('0x57'));exports[_0xc3d2('0x6f')]=function(_0x32a057,_0xf43d2,_0x10c0df){var _0x433d0c={'agent':{},'channel':_0xc3d2('0x59')};if(_0x32a057[_0xc3d2('0x55')]['id']){delete _0x32a057[_0xc3d2('0x55')]['id'];}_0x32a057[_0xc3d2('0x55')][_0xc3d2('0x5c')]=_0x32a057[_0xc3d2('0x55')]['UserId']||_0x32a057[_0xc3d2('0x5d')]['id'];_0x433d0c[_0xc3d2('0x70')]['id']=_0x32a057[_0xc3d2('0x55')][_0xc3d2('0x5c')];return db[_0xc3d2('0x38')]['find']({'where':{'id':_0x32a057[_0xc3d2('0x53')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0xf43d2,null))[_0xc3d2('0x1f')](function(_0x5b027f){if(_0x5b027f){_0x433d0c[_0xc3d2('0x27')]=_0x5b027f[_0xc3d2('0x71')]({'plain':!![]});return db['ChatInteraction']['find']({'where':{'id':_0x5b027f['ChatInteractionId']}});}return null;})[_0xc3d2('0x1f')](handleEntityNotFound(_0xf43d2,null))[_0xc3d2('0x1f')](function(_0x5efcbc){if(_0x5efcbc){_0x433d0c['interaction']=_0x5efcbc['get']({'plain':!![]});interaction_log[_0xc3d2('0x20')](_0xc3d2('0x72'),_0x32a057[_0xc3d2('0x5d')]['id'],_0x32a057['user'][_0xc3d2('0x36')],_0x32a057[_0xc3d2('0x5d')][_0xc3d2('0x64')],_0x433d0c[_0xc3d2('0x62')]['id'],_0x32a057[_0xc3d2('0x55')]?JSON[_0xc3d2('0x25')](_0x32a057[_0xc3d2('0x55')]):'null');return respondWithRpcPromise('RejectMessage',_0xc3d2('0x73'),_0x433d0c);}return null;})[_0xc3d2('0x1f')](function(_0x386b03){if(_0x386b03){_0x386b03[_0xc3d2('0x27')][_0xc3d2('0x68')]=util[_0xc3d2('0x61')](_0xc3d2('0x69'),_0x32a057[_0xc3d2('0x5d')][_0xc3d2('0x36')]);_0x386b03[_0xc3d2('0x27')][_0xc3d2('0x6a')]=_0x433d0c[_0xc3d2('0x6a')];_0x386b03[_0xc3d2('0x27')][_0xc3d2('0x6b')]=_0xc3d2('0x6f');respondWithRpcPromise(_0xc3d2('0x6c'),_0xc3d2('0x6c'),{'event':_0xc3d2('0x74'),'message':_0x386b03[_0xc3d2('0x27')]},client9002);return _0x433d0c;}return null;})['then'](respondWithResult(_0xf43d2,null))[_0xc3d2('0x29')](handleError(_0xf43d2,null));}; \ No newline at end of file +var _0x86ae=['sort','where','pick','merge','type','key','VIRTUAL','options','includeAll','include','rows','params','create','body','catch','update','find','describe','../../config/logger','chat-interactions','accept','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','Contact','get','ChatInteraction','ChatInteractionId','isNil','read1stAt','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','manual','interface','channel','EventManager','acceptmessage','parse','formData','chat','agent','RejectMessage','rejectMessage','SIP/%s','event','rejectmessage','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','redis','socket.io-emitter','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','ChatMessage,\x20%s,\x20%s','request\x20sent','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','destroy','then','stack','name','send','index','ChatMessage','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit'];(function(_0x122cc1,_0x5c956e){var _0x1e33af=function(_0x949b75){while(--_0x949b75){_0x122cc1['push'](_0x122cc1['shift']());}};_0x1e33af(++_0x5c956e);}(_0x86ae,0x1a9));var _0xe86a=function(_0xd6d189,_0x16674f){_0xd6d189=_0xd6d189-0x0;var _0xb84d8d=_0x86ae[_0xd6d189];return _0xb84d8d;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xe86a('0x0'));var rimraf=require(_0xe86a('0x1'));var zipdir=require(_0xe86a('0x2'));var jsonpatch=require(_0xe86a('0x3'));var rp=require(_0xe86a('0x4'));var moment=require(_0xe86a('0x5'));var BPromise=require(_0xe86a('0x6'));var Mustache=require(_0xe86a('0x7'));var util=require(_0xe86a('0x8'));var path=require(_0xe86a('0x9'));var sox=require(_0xe86a('0xa'));var csv=require(_0xe86a('0xb'));var ejs=require(_0xe86a('0xc'));var fs=require('fs');var _=require(_0xe86a('0xd'));var squel=require(_0xe86a('0xe'));var crypto=require(_0xe86a('0xf'));var jsforce=require(_0xe86a('0x10'));var deskjs=require(_0xe86a('0x11'));var toCsv=require(_0xe86a('0xb'));var querystring=require(_0xe86a('0x12'));var Papa=require(_0xe86a('0x13'));var Redis=require('ioredis');var authService=require(_0xe86a('0x14'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe86a('0x15'));var logger=require('../../config/logger')(_0xe86a('0x16'));var utils=require(_0xe86a('0x17'));var config=require(_0xe86a('0x18'));var db=require('../../mysqldb')['db'];config[_0xe86a('0x19')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xe86a('0x1a'))(new Redis(config[_0xe86a('0x19')]));require('./chatMessage.socket')['register'](socket);var jayson=require(_0xe86a('0x1b'));var client=jayson[_0xe86a('0x1c')][_0xe86a('0x1d')]({'port':0x232c});var client9002=jayson[_0xe86a('0x1c')][_0xe86a('0x1d')]({'port':0x232a});function checkPasswordPattern(_0x30debc,_0x4590a3,_0x24a1ae){if(_0x24a1ae){var _0x3833fc=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3833fc[_0xe86a('0x1e')](_0x4590a3)){return _0x30debc;}else{throw new Error(_0xe86a('0x1f'));}}else{return _0x30debc;}}function respondWithRpcPromise(_0x615ad2,_0x4ffcee,_0x1c37f5,_0x4cc4e3){return new BPromise(function(_0x20bf1e,_0xe6ad96){var _0x3a81b5=_0x4cc4e3||client;return _0x3a81b5['request'](_0x615ad2,_0x1c37f5)['then'](function(_0x318f36){logger['info'](_0xe86a('0x20'),_0x4ffcee,_0xe86a('0x21'));logger['debug'](_0xe86a('0x22'),_0x4ffcee,_0xe86a('0x21'),JSON[_0xe86a('0x23')](_0x318f36));if(_0x318f36[_0xe86a('0x24')]){if(_0x318f36[_0xe86a('0x24')][_0xe86a('0x25')]===0x1f4){logger[_0xe86a('0x24')](_0xe86a('0x20'),_0x4ffcee,_0x318f36[_0xe86a('0x24')]['message']);return _0xe6ad96(_0x318f36['error']['message']);}logger['error']('ChatMessage,\x20%s,\x20%s',_0x4ffcee,_0x318f36[_0xe86a('0x24')]['message']);return _0x20bf1e(_0x318f36[_0xe86a('0x24')][_0xe86a('0x26')]);}else{logger[_0xe86a('0x27')](_0xe86a('0x20'),_0x4ffcee,_0xe86a('0x21'));_0x20bf1e(_0x318f36[_0xe86a('0x28')][_0xe86a('0x26')]);}})['catch'](function(_0x425ee9){logger[_0xe86a('0x24')](_0xe86a('0x20'),_0x4ffcee,_0x425ee9);_0xe6ad96(_0x425ee9);});});}function respondWithStatusCode(_0x2e861e,_0x3e1a1c){_0x3e1a1c=_0x3e1a1c||0xcc;return function(_0x27e06b){if(_0x27e06b){return _0x2e861e[_0xe86a('0x29')](_0x3e1a1c);}return _0x2e861e[_0xe86a('0x2a')](_0x3e1a1c)[_0xe86a('0x2b')]();};}function respondWithResult(_0x59a20d,_0x3e4bce){_0x3e4bce=_0x3e4bce||0xc8;return function(_0x44a949){if(_0x44a949){return _0x59a20d[_0xe86a('0x2a')](_0x3e4bce)[_0xe86a('0x2c')](_0x44a949);}};}function respondWithFilteredResult(_0x2b3b15,_0x562e54){return function(_0x3cf9a2){if(_0x3cf9a2){var _0x18bbc6=_0x3cf9a2[_0xe86a('0x2d')],_0x25ffec=_0x562e54[_0xe86a('0x2e')],_0x5068a9=_0x562e54[_0xe86a('0x2e')]+_0x562e54[_0xe86a('0x2f')],_0x45a94b;if(_0x5068a9>=_0x18bbc6){_0x5068a9=_0x18bbc6;_0x45a94b=0xc8;}else{_0x45a94b=0xce;}_0x2b3b15[_0xe86a('0x2a')](_0x45a94b);return _0x2b3b15[_0xe86a('0x30')](_0xe86a('0x31'),_0x25ffec+'-'+_0x5068a9+'/'+_0x18bbc6)['json'](_0x3cf9a2);}return null;};}function patchUpdates(_0x497172){return function(_0x255692){try{jsonpatch[_0xe86a('0x32')](_0x255692,_0x497172,!![]);}catch(_0x24181b){return BPromise[_0xe86a('0x33')](_0x24181b);}return _0x255692[_0xe86a('0x34')]();};}function saveUpdates(_0x4b22f0,_0x23661f){return function(_0x146bb2){if(_0x146bb2){return _0x146bb2['update'](_0x4b22f0)['then'](function(_0x39e626){return _0x39e626;});}return null;};}function removeEntity(_0x8ed5fa,_0x501ec3){return function(_0x1ece6d){if(_0x1ece6d){return _0x1ece6d[_0xe86a('0x35')]()[_0xe86a('0x36')](function(){_0x8ed5fa[_0xe86a('0x2a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x41a838,_0x4957c4){return function(_0x389572){if(!_0x389572){_0x41a838[_0xe86a('0x29')](0x194);}return _0x389572;};}function handleError(_0x2a20a4,_0x202e2c){_0x202e2c=_0x202e2c||0x1f4;return function(_0x43343e){logger['error'](_0x43343e[_0xe86a('0x37')]);if(_0x43343e[_0xe86a('0x38')]){delete _0x43343e['name'];}_0x2a20a4[_0xe86a('0x2a')](_0x202e2c)[_0xe86a('0x39')](_0x43343e);};}exports[_0xe86a('0x3a')]=function(_0xdeeeeb,_0x5ad07b){var _0x172d39={},_0x3a0ed7={},_0xa89298={'count':0x0,'rows':[]};var _0x5bbcb9=db[_0xe86a('0x3b')][_0xe86a('0x3c')];_0x3a0ed7[_0xe86a('0x3d')]=_[_0xe86a('0x3e')](_0x5bbcb9);_0x3a0ed7[_0xe86a('0x3f')]=_[_0xe86a('0x3e')](_0xdeeeeb['query']);_0x3a0ed7[_0xe86a('0x40')]=_[_0xe86a('0x41')](_0x3a0ed7[_0xe86a('0x3d')],_0x3a0ed7[_0xe86a('0x3f')]);_0x172d39[_0xe86a('0x42')]=_[_0xe86a('0x41')](_0x3a0ed7['model'],qs['fields'](_0xdeeeeb[_0xe86a('0x3f')][_0xe86a('0x43')]));_0x172d39[_0xe86a('0x42')]=_0x172d39['attributes'][_0xe86a('0x44')]?_0x172d39[_0xe86a('0x42')]:_0x3a0ed7[_0xe86a('0x3d')];if(!_0xdeeeeb[_0xe86a('0x3f')][_0xe86a('0x45')](_0xe86a('0x46'))){_0x172d39[_0xe86a('0x2f')]=qs[_0xe86a('0x2f')](_0xdeeeeb[_0xe86a('0x3f')][_0xe86a('0x2f')]);_0x172d39[_0xe86a('0x2e')]=qs[_0xe86a('0x2e')](_0xdeeeeb[_0xe86a('0x3f')][_0xe86a('0x2e')]);}_0x172d39['order']=qs[_0xe86a('0x47')](_0xdeeeeb[_0xe86a('0x3f')][_0xe86a('0x47')]);_0x172d39[_0xe86a('0x48')]=qs['filters'](_[_0xe86a('0x49')](_0xdeeeeb[_0xe86a('0x3f')],_0x3a0ed7['filters']));if(_0xdeeeeb[_0xe86a('0x3f')]['filter']){_0x172d39[_0xe86a('0x48')]=_[_0xe86a('0x4a')](_0x172d39[_0xe86a('0x48')],{'$or':_['map'](_0x5bbcb9,function(_0xe48494){if(_0xe48494[_0xe86a('0x4b')][_0xe86a('0x4c')]!==_0xe86a('0x4d')){var _0x5c291e={};_0x5c291e[_0xe48494['field']]={'$like':'%'+_0xdeeeeb['query']['filter']+'%'};return _0x5c291e;}})});}_0x172d39=_['merge']({},_0x172d39,_0xdeeeeb[_0xe86a('0x4e')]);var _0x50cba1={'where':_0x172d39['where']};return db['ChatMessage'][_0xe86a('0x2d')](_0x50cba1)[_0xe86a('0x36')](function(_0x56339f){_0xa89298['count']=_0x56339f;if(_0xdeeeeb[_0xe86a('0x3f')][_0xe86a('0x4f')]){_0x172d39[_0xe86a('0x50')]=[{'all':!![]}];}return db[_0xe86a('0x3b')]['findAll'](_0x172d39);})[_0xe86a('0x36')](function(_0x2c9d0e){_0xa89298[_0xe86a('0x51')]=_0x2c9d0e;return _0xa89298;})[_0xe86a('0x36')](respondWithFilteredResult(_0x5ad07b,_0x172d39))['catch'](handleError(_0x5ad07b,null));};exports['show']=function(_0x22217d,_0x15622c){var _0x58a207={'raw':!![],'where':{'id':_0x22217d[_0xe86a('0x52')]['id']}},_0x361a90={};_0x361a90[_0xe86a('0x3d')]=_['keys'](db['ChatMessage'][_0xe86a('0x3c')]);_0x361a90['query']=_[_0xe86a('0x3e')](_0x22217d[_0xe86a('0x3f')]);_0x361a90[_0xe86a('0x40')]=_[_0xe86a('0x41')](_0x361a90[_0xe86a('0x3d')],_0x361a90[_0xe86a('0x3f')]);_0x58a207[_0xe86a('0x42')]=_['intersection'](_0x361a90[_0xe86a('0x3d')],qs[_0xe86a('0x43')](_0x22217d[_0xe86a('0x3f')][_0xe86a('0x43')]));_0x58a207['attributes']=_0x58a207[_0xe86a('0x42')][_0xe86a('0x44')]?_0x58a207[_0xe86a('0x42')]:_0x361a90[_0xe86a('0x3d')];if(_0x22217d['query']['includeAll']){_0x58a207[_0xe86a('0x50')]=[{'all':!![]}];}_0x58a207=_[_0xe86a('0x4a')]({},_0x58a207,_0x22217d[_0xe86a('0x4e')]);return db[_0xe86a('0x3b')]['find'](_0x58a207)[_0xe86a('0x36')](handleEntityNotFound(_0x15622c,null))[_0xe86a('0x36')](respondWithResult(_0x15622c,null))['catch'](handleError(_0x15622c,null));};exports[_0xe86a('0x53')]=function(_0x429eac,_0xb4c14b){return db[_0xe86a('0x3b')][_0xe86a('0x53')](_0x429eac[_0xe86a('0x54')],{})[_0xe86a('0x36')](respondWithResult(_0xb4c14b,0xc9))[_0xe86a('0x55')](handleError(_0xb4c14b,null));};exports[_0xe86a('0x56')]=function(_0x3ec046,_0x44d3fb){if(_0x3ec046['body']['id']){delete _0x3ec046[_0xe86a('0x54')]['id'];}return db[_0xe86a('0x3b')][_0xe86a('0x57')]({'where':{'id':_0x3ec046[_0xe86a('0x52')]['id']}})[_0xe86a('0x36')](handleEntityNotFound(_0x44d3fb,null))['then'](saveUpdates(_0x3ec046[_0xe86a('0x54')],null))[_0xe86a('0x36')](respondWithResult(_0x44d3fb,null))[_0xe86a('0x55')](handleError(_0x44d3fb,null));};exports[_0xe86a('0x35')]=function(_0x9ad84b,_0xeafab4){return db[_0xe86a('0x3b')][_0xe86a('0x57')]({'where':{'id':_0x9ad84b['params']['id']}})[_0xe86a('0x36')](handleEntityNotFound(_0xeafab4,null))[_0xe86a('0x36')](removeEntity(_0xeafab4,null))[_0xe86a('0x55')](handleError(_0xeafab4,null));};exports[_0xe86a('0x58')]=function(_0x15c294,_0x1cade1){return db[_0xe86a('0x3b')]['describe']()[_0xe86a('0x36')](respondWithResult(_0x1cade1,null))[_0xe86a('0x55')](handleError(_0x1cade1,null));};var interaction_log=require(_0xe86a('0x59'))(_0xe86a('0x5a'));exports[_0xe86a('0x5b')]=function(_0x325460,_0x267cdc,_0x425124){var _0x3e008e={'channel':'chat'};if(_0x325460[_0xe86a('0x54')]['id']){delete _0x325460[_0xe86a('0x54')]['id'];}_0x325460[_0xe86a('0x54')][_0xe86a('0x5c')]=!![];_0x325460[_0xe86a('0x54')][_0xe86a('0x5d')]=moment()[_0xe86a('0x5e')](_0xe86a('0x5f'));_0x325460[_0xe86a('0x54')]['UserId']=_0x325460[_0xe86a('0x54')][_0xe86a('0x60')]||_0x325460[_0xe86a('0x61')]['id'];return db[_0xe86a('0x3b')]['find']({'where':{'id':_0x325460[_0xe86a('0x52')]['id'],'UserId':null},'include':[{'model':db['CmContact'],'as':_0xe86a('0x62')}]})[_0xe86a('0x36')](handleEntityNotFound(_0x267cdc,null))[_0xe86a('0x36')](saveUpdates(_0x325460['body'],null))[_0xe86a('0x36')](function(_0x214ea7){if(_0x214ea7){_0x3e008e[_0xe86a('0x26')]=_0x214ea7[_0xe86a('0x63')]({'plain':!![]});return db[_0xe86a('0x64')][_0xe86a('0x57')]({'where':{'id':_0x214ea7[_0xe86a('0x65')]}});}return null;})[_0xe86a('0x36')](handleEntityNotFound(_0x267cdc,null))['then'](function(_0x1b9c11){if(_0x1b9c11){return _0x1b9c11[_0xe86a('0x56')]({'UserId':_0x325460[_0xe86a('0x54')]['UserId'],'read1stAt':_[_0xe86a('0x66')](_0x1b9c11[_0xe86a('0x67')])?moment()['format'](_0xe86a('0x5f')):undefined});}return null;})[_0xe86a('0x36')](function(_0x245562){if(_0x245562){_0x3e008e[_0xe86a('0x68')]=_0x245562[_0xe86a('0x63')]({'plain':!![]});interaction_log[_0xe86a('0x27')](_0xe86a('0x69'),_0x325460[_0xe86a('0x61')]['id'],_0x325460['user']['name'],_0x325460[_0xe86a('0x61')][_0xe86a('0x6a')],_0x3e008e['interaction']['id'],_0x325460['body']?JSON[_0xe86a('0x23')](_0x325460[_0xe86a('0x54')]):_0xe86a('0x6b'));return respondWithRpcPromise(_0xe86a('0x6c'),_0xe86a('0x6d'),_0x3e008e);}return null;})['then'](function(_0xaf2ee1){if(_0xaf2ee1){if(_0x325460[_0xe86a('0x54')][_0xe86a('0x6e')]){_0x3e008e[_0xe86a('0x26')][_0xe86a('0x6f')]=util[_0xe86a('0x5e')]('SIP/%s',_0x325460['user']['name']);_0x3e008e[_0xe86a('0x26')][_0xe86a('0x70')]=_0x3e008e[_0xe86a('0x70')];_0x3e008e[_0xe86a('0x26')]['event']=_0xe86a('0x5b');return respondWithRpcPromise(_0xe86a('0x71'),_0xe86a('0x71'),{'event':_0xe86a('0x72'),'message':_[_0xe86a('0x4a')](_0x3e008e['message'],JSON[_0xe86a('0x73')](_0x3e008e['interaction'][_0xe86a('0x74')]))},client9002)[_0xe86a('0x36')](function(){return _0x3e008e;});}return _0x3e008e;}return null;})[_0xe86a('0x36')](respondWithResult(_0x267cdc,null))['catch'](handleError(_0x267cdc,null));};var interaction_log=require(_0xe86a('0x59'))(_0xe86a('0x5a'));exports['reject']=function(_0x181262,_0x19fa5f,_0x1e920e){var _0x32be3d={'agent':{},'channel':_0xe86a('0x75')};if(_0x181262['body']['id']){delete _0x181262['body']['id'];}_0x181262[_0xe86a('0x54')][_0xe86a('0x60')]=_0x181262[_0xe86a('0x54')][_0xe86a('0x60')]||_0x181262[_0xe86a('0x61')]['id'];_0x32be3d[_0xe86a('0x76')]['id']=_0x181262['body']['UserId'];return db[_0xe86a('0x3b')][_0xe86a('0x57')]({'where':{'id':_0x181262[_0xe86a('0x52')]['id'],'UserId':null}})[_0xe86a('0x36')](handleEntityNotFound(_0x19fa5f,null))[_0xe86a('0x36')](function(_0x151f83){if(_0x151f83){_0x32be3d[_0xe86a('0x26')]=_0x151f83[_0xe86a('0x63')]({'plain':!![]});return db[_0xe86a('0x64')][_0xe86a('0x57')]({'where':{'id':_0x151f83[_0xe86a('0x65')]}});}return null;})[_0xe86a('0x36')](handleEntityNotFound(_0x19fa5f,null))['then'](function(_0x2b1327){if(_0x2b1327){_0x32be3d['interaction']=_0x2b1327[_0xe86a('0x63')]({'plain':!![]});interaction_log[_0xe86a('0x27')]('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x181262[_0xe86a('0x61')]['id'],_0x181262['user'][_0xe86a('0x38')],_0x181262[_0xe86a('0x61')][_0xe86a('0x6a')],_0x32be3d[_0xe86a('0x68')]['id'],_0x181262['body']?JSON[_0xe86a('0x23')](_0x181262[_0xe86a('0x54')]):_0xe86a('0x6b'));return respondWithRpcPromise(_0xe86a('0x77'),_0xe86a('0x78'),_0x32be3d);}return null;})[_0xe86a('0x36')](function(_0x3d16e4){if(_0x3d16e4){_0x3d16e4['message'][_0xe86a('0x6f')]=util['format'](_0xe86a('0x79'),_0x181262[_0xe86a('0x61')]['name']);_0x3d16e4['message']['channel']=_0x32be3d[_0xe86a('0x70')];_0x3d16e4[_0xe86a('0x26')][_0xe86a('0x7a')]=_0xe86a('0x33');respondWithRpcPromise('EventManager',_0xe86a('0x71'),{'event':_0xe86a('0x7b'),'message':_0x3d16e4[_0xe86a('0x26')]},client9002);return _0x32be3d;}return null;})['then'](respondWithResult(_0x19fa5f,null))[_0xe86a('0x55')](handleError(_0x19fa5f,null));}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js index 070b9d2..1727750 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 _0x29b6=['exports','events','../../mysqldb','setMaxListeners','save','update','remove','emit','hook'];(function(_0x5d707a,_0x4b283d){var _0x5a6cac=function(_0x21ca6a){while(--_0x21ca6a){_0x5d707a['push'](_0x5d707a['shift']());}};_0x5a6cac(++_0x4b283d);}(_0x29b6,0x172));var _0x629b=function(_0x59bf70,_0x54e5e7){_0x59bf70=_0x59bf70-0x0;var _0x5e004e=_0x29b6[_0x59bf70];return _0x5e004e;};'use strict';var EventEmitter=require(_0x629b('0x0'));var ChatMessage=require(_0x629b('0x1'))['db']['ChatMessage'];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x629b('0x2')](0x0);var events={'afterCreate':_0x629b('0x3'),'afterUpdate':_0x629b('0x4'),'afterDestroy':_0x629b('0x5')};function emitEvent(_0x4a0a84){return function(_0x222652,_0x48e855,_0x4a9d45){ChatMessageEvents[_0x629b('0x6')](_0x4a0a84+':'+_0x222652['id'],_0x222652);ChatMessageEvents[_0x629b('0x6')](_0x4a0a84,_0x222652);_0x4a9d45(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatMessage[_0x629b('0x7')](e,emitEvent(event));}}module[_0x629b('0x8')]=ChatMessageEvents; \ No newline at end of file +var _0x7b06=['hook','exports','ChatMessage','save','update','remove','emit','hasOwnProperty'];(function(_0x35ed88,_0x25a1ee){var _0x41d1ec=function(_0x133da5){while(--_0x133da5){_0x35ed88['push'](_0x35ed88['shift']());}};_0x41d1ec(++_0x25a1ee);}(_0x7b06,0x1b2));var _0x67b0=function(_0xfd1945,_0x29827d){_0xfd1945=_0xfd1945-0x0;var _0x53d788=_0x7b06[_0xfd1945];return _0x53d788;};'use strict';var EventEmitter=require('events');var ChatMessage=require('../../mysqldb')['db'][_0x67b0('0x0')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x67b0('0x1'),'afterUpdate':_0x67b0('0x2'),'afterDestroy':_0x67b0('0x3')};function emitEvent(_0x4fff20){return function(_0x4766cc,_0x44df75,_0x4b6afd){ChatMessageEvents['emit'](_0x4fff20+':'+_0x4766cc['id'],_0x4766cc);ChatMessageEvents[_0x67b0('0x4')](_0x4fff20,_0x4766cc);_0x4b6afd(null);};}for(var e in events){if(events[_0x67b0('0x5')](e)){var event=events[e];ChatMessage[_0x67b0('0x6')](e,emitEvent(event));}}module[_0x67b0('0x7')]=ChatMessageEvents; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js index fdf822b..54956ef 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 _0x868f=['../../config/logger','api','bluebird','request-promise','path','rimraf','define','ChatMessage','fti_chat_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','isNil','UserId','ChatInteraction','findOne','then','update','catch','utf8mb4','utf8mb4_unicode_ci','lodash','util'];(function(_0x19b83b,_0x41b4d7){var _0x2d9d07=function(_0x2e50a0){while(--_0x2e50a0){_0x19b83b['push'](_0x19b83b['shift']());}};_0x2d9d07(++_0x41b4d7);}(_0x868f,0x1ae));var _0xf868=function(_0x4afc06,_0x1499bf){_0x4afc06=_0x4afc06-0x0;var _0x24c1ca=_0x868f[_0x4afc06];return _0x24c1ca;};'use strict';var _=require(_0xf868('0x0'));var util=require(_0xf868('0x1'));var logger=require(_0xf868('0x2'))(_0xf868('0x3'));var moment=require('moment');var BPromise=require(_0xf868('0x4'));var rp=require(_0xf868('0x5'));var fs=require('fs');var path=require(_0xf868('0x6'));var rimraf=require(_0xf868('0x7'));var config=require('../../config/environment');var attributes=require('./chatMessage.attributes');module['exports']=function(_0x2c12fb,_0x145d35){return _0x2c12fb[_0xf868('0x8')](_0xf868('0x9'),attributes,{'tableName':'chat_messages','paranoid':![],'indexes':[{'name':_0xf868('0xa'),'fields':[_0xf868('0xb')],'type':_0xf868('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x54b943,_0x31fb51,_0x17f50e){var _0x4cbbb0=_0x2c12fb[_0xf868('0xd')];var _0x4ed673=_0x54b943[_0xf868('0xe')]({'plain':!![]});if(_0x4ed673[_0xf868('0xf')][_0xf868('0x10')]()==='in'||_0x4ed673['direction'][_0xf868('0x10')]()===_0xf868('0x11')&&!_0x4ed673['secret']&&!_[_0xf868('0x12')](_0x4ed673[_0xf868('0x13')])){_0x4cbbb0[_0xf868('0x14')][_0xf868('0x15')]({'where':{'id':_0x4ed673['ChatInteractionId']}})[_0xf868('0x16')](function(_0x11e24d){if(_0x11e24d){_0x11e24d[_0xf868('0x17')]({'lastMsgAt':_0x4ed673['createdAt'],'lastMsgDirection':_0x4ed673[_0xf868('0xf')][_0xf868('0x10')]()});}})[_0xf868('0x18')](function(_0x394515){console['error'](_0x394515);});}_0x17f50e();}},'charset':_0xf868('0x19'),'collate':_0xf868('0x1a')});}; \ No newline at end of file +var _0x9f32=['findOne','then','update','catch','error','utf8mb4_unicode_ci','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','./chatMessage.attributes','exports','define','ChatMessage','chat_messages','fti_chat_messages','FULLTEXT','models','get','direction','toLowerCase','out','isNil','UserId'];(function(_0x3e3508,_0x11a30e){var _0x23dce6=function(_0x2e3b47){while(--_0x2e3b47){_0x3e3508['push'](_0x3e3508['shift']());}};_0x23dce6(++_0x11a30e);}(_0x9f32,0xc3));var _0x29f3=function(_0x4b3682,_0x1725d9){_0x4b3682=_0x4b3682-0x0;var _0x3421ba=_0x9f32[_0x4b3682];return _0x3421ba;};'use strict';var _=require(_0x29f3('0x0'));var util=require('util');var logger=require(_0x29f3('0x1'))(_0x29f3('0x2'));var moment=require('moment');var BPromise=require(_0x29f3('0x3'));var rp=require(_0x29f3('0x4'));var fs=require('fs');var path=require(_0x29f3('0x5'));var rimraf=require(_0x29f3('0x6'));var config=require('../../config/environment');var attributes=require(_0x29f3('0x7'));module[_0x29f3('0x8')]=function(_0x2eb0ee,_0xba7964){return _0x2eb0ee[_0x29f3('0x9')](_0x29f3('0xa'),attributes,{'tableName':_0x29f3('0xb'),'paranoid':![],'indexes':[{'name':_0x29f3('0xc'),'fields':['body'],'type':_0x29f3('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x578589,_0x2955d3,_0x2ceb3c){var _0x52b409=_0x2eb0ee[_0x29f3('0xe')];var _0x25a9d1=_0x578589[_0x29f3('0xf')]({'plain':!![]});if(_0x25a9d1[_0x29f3('0x10')]['toLowerCase']()==='in'||_0x25a9d1['direction'][_0x29f3('0x11')]()===_0x29f3('0x12')&&!_0x25a9d1['secret']&&!_[_0x29f3('0x13')](_0x25a9d1[_0x29f3('0x14')])){_0x52b409['ChatInteraction'][_0x29f3('0x15')]({'where':{'id':_0x25a9d1['ChatInteractionId']}})[_0x29f3('0x16')](function(_0x33bbd3){if(_0x33bbd3){_0x33bbd3[_0x29f3('0x17')]({'lastMsgAt':_0x25a9d1['createdAt'],'lastMsgDirection':_0x25a9d1[_0x29f3('0x10')][_0x29f3('0x11')]()});}})[_0x29f3('0x18')](function(_0x312da8){console[_0x29f3('0x19')](_0x312da8);});}_0x2ceb3c();}},'charset':'utf8mb4','collate':_0x29f3('0x1a')});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js index 96f1ada..5095c84 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 _0x5d98=['raw','stringify','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./chatMessage.socket','register','then','info','request\x20sent','ChatMessage,\x20%s,\x20%s,\x20%s','error','code','ChatMessage,\x20%s,\x20%s','message','result','CreateChatMessage','ChatMessage','create','body','options'];(function(_0x470a14,_0x349610){var _0x58c12c=function(_0x4cfb7d){while(--_0x4cfb7d){_0x470a14['push'](_0x470a14['shift']());}};_0x58c12c(++_0x349610);}(_0x5d98,0x178));var _0x85d9=function(_0xe628ce,_0x4c8fc4){_0xe628ce=_0xe628ce-0x0;var _0xc744=_0x5d98[_0xe628ce];return _0xc744;};'use strict';var _=require(_0x85d9('0x0'));var util=require(_0x85d9('0x1'));var moment=require(_0x85d9('0x2'));var BPromise=require(_0x85d9('0x3'));var rs=require(_0x85d9('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x85d9('0x5'))['db'];var utils=require(_0x85d9('0x6'));var logger=require(_0x85d9('0x7'))(_0x85d9('0x8'));var config=require(_0x85d9('0x9'));var jayson=require(_0x85d9('0xa'));var client=jayson[_0x85d9('0xb')][_0x85d9('0xc')]({'port':0x232a});config[_0x85d9('0xd')]=_[_0x85d9('0xe')](config[_0x85d9('0xd')],{'host':_0x85d9('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x85d9('0xd')]));require(_0x85d9('0x10'))[_0x85d9('0x11')](socket);function respondWithRpcPromise(_0x2f0cd9,_0x1b1728,_0x12b4ce){return new BPromise(function(_0xe5179e,_0x2a4a5b){return client['request'](_0x2f0cd9,_0x12b4ce)[_0x85d9('0x12')](function(_0x2960b4){logger[_0x85d9('0x13')]('ChatMessage,\x20%s,\x20%s',_0x1b1728,_0x85d9('0x14'));logger['debug'](_0x85d9('0x15'),_0x1b1728,_0x85d9('0x14'),JSON['stringify'](_0x2960b4));if(_0x2960b4['error']){if(_0x2960b4[_0x85d9('0x16')][_0x85d9('0x17')]===0x1f4){logger['error'](_0x85d9('0x18'),_0x1b1728,_0x2960b4[_0x85d9('0x16')][_0x85d9('0x19')]);return _0x2a4a5b(_0x2960b4[_0x85d9('0x16')]['message']);}logger[_0x85d9('0x16')]('ChatMessage,\x20%s,\x20%s',_0x1b1728,_0x2960b4[_0x85d9('0x16')]['message']);return _0xe5179e(_0x2960b4[_0x85d9('0x16')][_0x85d9('0x19')]);}else{logger[_0x85d9('0x13')]('ChatMessage,\x20%s,\x20%s',_0x1b1728,_0x85d9('0x14'));_0xe5179e(_0x2960b4[_0x85d9('0x1a')][_0x85d9('0x19')]);}})['catch'](function(_0x2a7089){logger[_0x85d9('0x16')](_0x85d9('0x18'),_0x1b1728,_0x2a7089);_0x2a4a5b(_0x2a7089);});});}exports[_0x85d9('0x1b')]=function(_0x116af3){var _0x5a0128=this;return new Promise(function(_0x16a6ca,_0x32da36){return db[_0x85d9('0x1c')][_0x85d9('0x1d')](_0x116af3[_0x85d9('0x1e')],{'raw':_0x116af3[_0x85d9('0x1f')]?_0x116af3[_0x85d9('0x1f')][_0x85d9('0x20')]===undefined?!![]:![]:!![]})[_0x85d9('0x12')](function(_0x1def30){logger[_0x85d9('0x13')]('CreateChatMessage',_0x116af3);logger['debug'](_0x85d9('0x1b'),_0x116af3,JSON[_0x85d9('0x21')](_0x1def30));_0x16a6ca(_0x1def30);})['catch'](function(_0x16b0a9){logger[_0x85d9('0x16')](_0x85d9('0x1b'),_0x16b0a9[_0x85d9('0x19')],_0x116af3);_0x32da36(_0x5a0128[_0x85d9('0x16')](0x1f4,_0x16b0a9[_0x85d9('0x19')]));});});}; \ No newline at end of file +var _0x9e86=['code','message','catch','CreateChatMessage','ChatMessage','body','options','raw','then','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./chatMessage.socket','register','request','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x204d21,_0x5d3952){var _0x55df50=function(_0x52de7a){while(--_0x52de7a){_0x204d21['push'](_0x204d21['shift']());}};_0x55df50(++_0x5d3952);}(_0x9e86,0x15d));var _0x69e8=function(_0x269dd7,_0x3f893c){_0x269dd7=_0x269dd7-0x0;var _0x4fed23=_0x9e86[_0x269dd7];return _0x4fed23;};'use strict';var _=require('lodash');var util=require(_0x69e8('0x0'));var moment=require('moment');var BPromise=require(_0x69e8('0x1'));var rs=require(_0x69e8('0x2'));var fs=require('fs');var Redis=require(_0x69e8('0x3'));var db=require(_0x69e8('0x4'))['db'];var utils=require(_0x69e8('0x5'));var logger=require(_0x69e8('0x6'))(_0x69e8('0x7'));var config=require(_0x69e8('0x8'));var jayson=require(_0x69e8('0x9'));var client=jayson[_0x69e8('0xa')][_0x69e8('0xb')]({'port':0x232a});config[_0x69e8('0xc')]=_[_0x69e8('0xd')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x69e8('0xe'))(new Redis(config[_0x69e8('0xc')]));require(_0x69e8('0xf'))[_0x69e8('0x10')](socket);function respondWithRpcPromise(_0x1535cb,_0x21096d,_0x31660a){return new BPromise(function(_0x21061c,_0x77e799){return client[_0x69e8('0x11')](_0x1535cb,_0x31660a)['then'](function(_0x67151){logger[_0x69e8('0x12')](_0x69e8('0x13'),_0x21096d,_0x69e8('0x14'));logger[_0x69e8('0x15')](_0x69e8('0x16'),_0x21096d,_0x69e8('0x14'),JSON[_0x69e8('0x17')](_0x67151));if(_0x67151['error']){if(_0x67151[_0x69e8('0x18')][_0x69e8('0x19')]===0x1f4){logger[_0x69e8('0x18')](_0x69e8('0x13'),_0x21096d,_0x67151['error'][_0x69e8('0x1a')]);return _0x77e799(_0x67151[_0x69e8('0x18')]['message']);}logger[_0x69e8('0x18')](_0x69e8('0x13'),_0x21096d,_0x67151[_0x69e8('0x18')]['message']);return _0x21061c(_0x67151[_0x69e8('0x18')][_0x69e8('0x1a')]);}else{logger[_0x69e8('0x12')](_0x69e8('0x13'),_0x21096d,'request\x20sent');_0x21061c(_0x67151['result']['message']);}})[_0x69e8('0x1b')](function(_0x586ba4){logger[_0x69e8('0x18')](_0x69e8('0x13'),_0x21096d,_0x586ba4);_0x77e799(_0x586ba4);});});}exports[_0x69e8('0x1c')]=function(_0x133777){var _0x3e672d=this;return new Promise(function(_0x3bb5ee,_0x253519){return db[_0x69e8('0x1d')]['create'](_0x133777[_0x69e8('0x1e')],{'raw':_0x133777[_0x69e8('0x1f')]?_0x133777[_0x69e8('0x1f')][_0x69e8('0x20')]===undefined?!![]:![]:!![]})[_0x69e8('0x21')](function(_0x457ae0){logger['info'](_0x69e8('0x1c'),_0x133777);logger[_0x69e8('0x15')](_0x69e8('0x1c'),_0x133777,JSON[_0x69e8('0x17')](_0x457ae0));_0x3bb5ee(_0x457ae0);})[_0x69e8('0x1b')](function(_0x58261e){logger[_0x69e8('0x18')]('CreateChatMessage',_0x58261e['message'],_0x133777);_0x253519(_0x3e672d[_0x69e8('0x18')](0x1f4,_0x58261e['message']));});});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js index ad46d7c..675eae3 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 _0x1623=['removeListener','length','chatMessage:','./chatMessage.events','update','emit'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1623,0xab));var _0x3162=function(_0x15551d,_0x51ef90){_0x15551d=_0x15551d-0x0;var _0x38a2cf=_0x1623[_0x15551d];return _0x38a2cf;};'use strict';var ChatMessageEvents=require(_0x3162('0x0'));var events=['save','remove',_0x3162('0x1')];function createListener(_0x27ee21,_0x36ccc3){return function(_0x2cc4d7){_0x36ccc3[_0x3162('0x2')](_0x27ee21,_0x2cc4d7);};}function removeListener(_0x4ce2bd,_0x5d49d0){return function(){ChatMessageEvents[_0x3162('0x3')](_0x4ce2bd,_0x5d49d0);};}exports['register']=function(_0x1b55f2){for(var _0x428de6=0x0,_0x53260d=events[_0x3162('0x4')];_0x428de6<_0x53260d;_0x428de6++){var _0x2dc07e=events[_0x428de6];var _0x26ee32=createListener(_0x3162('0x5')+_0x2dc07e,_0x1b55f2);ChatMessageEvents['on'](_0x2dc07e,_0x26ee32);}}; \ No newline at end of file +var _0x4991=['length','chatMessage:','./chatMessage.events','remove','emit','removeListener','register'];(function(_0x13d6fe,_0x11956f){var _0x320fe6=function(_0x2063e7){while(--_0x2063e7){_0x13d6fe['push'](_0x13d6fe['shift']());}};_0x320fe6(++_0x11956f);}(_0x4991,0xf7));var _0x1499=function(_0x1e2a4c,_0x482ae7){_0x1e2a4c=_0x1e2a4c-0x0;var _0x38c9c8=_0x4991[_0x1e2a4c];return _0x38c9c8;};'use strict';var ChatMessageEvents=require(_0x1499('0x0'));var events=['save',_0x1499('0x1'),'update'];function createListener(_0x30d640,_0x256e41){return function(_0x16ac22){_0x256e41[_0x1499('0x2')](_0x30d640,_0x16ac22);};}function removeListener(_0x1b291f,_0x158134){return function(){ChatMessageEvents[_0x1499('0x3')](_0x1b291f,_0x158134);};}exports[_0x1499('0x4')]=function(_0x4b6154){for(var _0x2a8e96=0x0,_0x1c3bd7=events[_0x1499('0x5')];_0x2a8e96<_0x1c3bd7;_0x2a8e96++){var _0x33b261=events[_0x2a8e96];var _0x133bae=createListener(_0x1499('0x6')+_0x33b261,_0x4b6154);ChatMessageEvents['on'](_0x33b261,_0x133bae);}}; \ No newline at end of file diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js index 973aa02..c0f0bb2 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 _0x168c=['destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatMessage.controller','isAuthenticated','index','get','/describe','describe','/:id','show','post','tracked','chat','chatmessage:create','create','update','put','/:id/accept','accept','delete'];(function(_0x5a852d,_0x77e846){var _0x191725=function(_0x3e87a0){while(--_0x3e87a0){_0x5a852d['push'](_0x5a852d['shift']());}};_0x191725(++_0x77e846);}(_0x168c,0x93));var _0xc168=function(_0x39a663,_0x23a6b5){_0x39a663=_0x39a663-0x0;var _0x3ff948=_0x168c[_0x39a663];return _0x3ff948;};'use strict';var multer=require(_0xc168('0x0'));var util=require(_0xc168('0x1'));var path=require(_0xc168('0x2'));var timeout=require(_0xc168('0x3'));var express=require(_0xc168('0x4'));var router=express[_0xc168('0x5')]();var auth=require(_0xc168('0x6'));var interaction=require(_0xc168('0x7'));var config=require(_0xc168('0x8'));var controller=require(_0xc168('0x9'));router['get']('/',auth[_0xc168('0xa')](),controller[_0xc168('0xb')]);router[_0xc168('0xc')](_0xc168('0xd'),auth[_0xc168('0xa')](),controller[_0xc168('0xe')]);router['get'](_0xc168('0xf'),auth['isAuthenticated'](),controller[_0xc168('0x10')]);router[_0xc168('0x11')]('/',auth[_0xc168('0xa')](),interaction[_0xc168('0x12')](_0xc168('0x13'),_0xc168('0x14')),controller[_0xc168('0x15')]);router['put']('/:id',controller[_0xc168('0x16')]);router[_0xc168('0x17')](_0xc168('0x18'),auth[_0xc168('0xa')](),controller[_0xc168('0x19')]);router[_0xc168('0x17')]('/:id/reject',auth['isAuthenticated'](),controller['reject']);router[_0xc168('0x1a')](_0xc168('0xf'),auth[_0xc168('0xa')](),controller[_0xc168('0x1b')]);module[_0xc168('0x1c')]=router; \ No newline at end of file +var _0x410e=['util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatMessage.controller','get','index','/describe','isAuthenticated','describe','/:id','show','post','tracked','chatmessage:create','create','put','update','/:id/accept','accept','/:id/reject','reject','destroy'];(function(_0x302320,_0x1e21f2){var _0x47ac0b=function(_0x4565cc){while(--_0x4565cc){_0x302320['push'](_0x302320['shift']());}};_0x47ac0b(++_0x1e21f2);}(_0x410e,0x68));var _0xe410=function(_0x1b7c17,_0x3db643){_0x1b7c17=_0x1b7c17-0x0;var _0x155d7b=_0x410e[_0x1b7c17];return _0x155d7b;};'use strict';var multer=require('multer');var util=require(_0xe410('0x0'));var path=require('path');var timeout=require(_0xe410('0x1'));var express=require(_0xe410('0x2'));var router=express[_0xe410('0x3')]();var auth=require(_0xe410('0x4'));var interaction=require(_0xe410('0x5'));var config=require(_0xe410('0x6'));var controller=require(_0xe410('0x7'));router[_0xe410('0x8')]('/',auth['isAuthenticated'](),controller[_0xe410('0x9')]);router[_0xe410('0x8')](_0xe410('0xa'),auth[_0xe410('0xb')](),controller[_0xe410('0xc')]);router[_0xe410('0x8')](_0xe410('0xd'),auth[_0xe410('0xb')](),controller[_0xe410('0xe')]);router[_0xe410('0xf')]('/',auth[_0xe410('0xb')](),interaction[_0xe410('0x10')]('chat',_0xe410('0x11')),controller[_0xe410('0x12')]);router[_0xe410('0x13')](_0xe410('0xd'),controller[_0xe410('0x14')]);router['put'](_0xe410('0x15'),auth[_0xe410('0xb')](),controller[_0xe410('0x16')]);router[_0xe410('0x13')](_0xe410('0x17'),auth['isAuthenticated'](),controller[_0xe410('0x18')]);router['delete'](_0xe410('0xd'),auth[_0xe410('0xb')](),controller[_0xe410('0x19')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js index 25d9afd..2b1c776 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 _0x6bef=['medium','sequelize','exports'];(function(_0x9dfc10,_0x19c2d5){var _0x4f938a=function(_0x12b1e5){while(--_0x12b1e5){_0x9dfc10['push'](_0x9dfc10['shift']());}};_0x4f938a(++_0x19c2d5);}(_0x6bef,0x15d));var _0xf6be=function(_0x539428,_0x17309c){_0x539428=_0x539428-0x0;var _0x368257=_0x6bef[_0x539428];return _0x368257;};'use strict';var Sequelize=require(_0xf6be('0x0'));module[_0xf6be('0x1')]={'body':{'type':Sequelize['TEXT'](_0xf6be('0x2')),'allowNull':![]}}; \ No newline at end of file +var _0xf50d=['medium','sequelize','exports'];(function(_0x2e4aa2,_0x11956a){var _0x5e6092=function(_0x4c12c2){while(--_0x4c12c2){_0x2e4aa2['push'](_0x2e4aa2['shift']());}};_0x5e6092(++_0x11956a);}(_0xf50d,0x190));var _0xdf50=function(_0x62c958,_0x2bfdbc){_0x62c958=_0x62c958-0x0;var _0x57ec61=_0xf50d[_0x62c958];return _0x57ec61;};'use strict';var Sequelize=require(_0xdf50('0x0'));module[_0xdf50('0x1')]={'body':{'type':Sequelize['TEXT'](_0xdf50('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 3892259..5e00ec8 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 _0xa734=['../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','end','stack','name','index','ChatOfflineMessage','rawAttributes','keys','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','where','pick','filter','merge','map','key','VIRTUAL','then','includeAll','include','rows','catch','show','options','create','body','find','params','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','jsforce','querystring','papaparse'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa734,0x80));var _0x4a73=function(_0x2ed840,_0x4ca88b){_0x2ed840=_0x2ed840-0x0;var _0x1d2ea1=_0xa734[_0x2ed840];return _0x1d2ea1;};'use strict';var pdf=require(_0x4a73('0x0'));var emlformat=require(_0x4a73('0x1'));var rimraf=require(_0x4a73('0x2'));var zipdir=require(_0x4a73('0x3'));var jsonpatch=require(_0x4a73('0x4'));var rp=require(_0x4a73('0x5'));var moment=require(_0x4a73('0x6'));var BPromise=require(_0x4a73('0x7'));var Mustache=require(_0x4a73('0x8'));var util=require(_0x4a73('0x9'));var path=require(_0x4a73('0xa'));var sox=require('sox');var csv=require(_0x4a73('0xb'));var ejs=require(_0x4a73('0xc'));var fs=require('fs');var _=require(_0x4a73('0xd'));var squel=require(_0x4a73('0xe'));var crypto=require('crypto');var jsforce=require(_0x4a73('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x4a73('0xb'));var querystring=require(_0x4a73('0x10'));var Papa=require(_0x4a73('0x11'));var Redis=require('ioredis');var authService=require(_0x4a73('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x4a73('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4a73('0x14'))(_0x4a73('0x15'));var utils=require(_0x4a73('0x16'));var config=require(_0x4a73('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x509454,_0x5e05a1){_0x5e05a1=_0x5e05a1||0xcc;return function(_0x5ce2b0){if(_0x5ce2b0){return _0x509454[_0x4a73('0x18')](_0x5e05a1);}return _0x509454[_0x4a73('0x19')](_0x5e05a1)['end']();};}function respondWithResult(_0x13f2f1,_0x54631e){_0x54631e=_0x54631e||0xc8;return function(_0xa668c3){if(_0xa668c3){return _0x13f2f1['status'](_0x54631e)[_0x4a73('0x1a')](_0xa668c3);}};}function respondWithFilteredResult(_0x263e15,_0x2546d6){return function(_0x5eedf9){if(_0x5eedf9){var _0x506b2b=_0x5eedf9[_0x4a73('0x1b')],_0x4fb44f=_0x2546d6[_0x4a73('0x1c')],_0x58782c=_0x2546d6[_0x4a73('0x1c')]+_0x2546d6[_0x4a73('0x1d')],_0x124fb6;if(_0x58782c>=_0x506b2b){_0x58782c=_0x506b2b;_0x124fb6=0xc8;}else{_0x124fb6=0xce;}_0x263e15['status'](_0x124fb6);return _0x263e15[_0x4a73('0x1e')](_0x4a73('0x1f'),_0x4fb44f+'-'+_0x58782c+'/'+_0x506b2b)[_0x4a73('0x1a')](_0x5eedf9);}return null;};}function patchUpdates(_0x1485f4){return function(_0x2e9fec){try{jsonpatch[_0x4a73('0x20')](_0x2e9fec,_0x1485f4,!![]);}catch(_0x95c119){return BPromise[_0x4a73('0x21')](_0x95c119);}return _0x2e9fec[_0x4a73('0x22')]();};}function saveUpdates(_0xc50a02,_0x429103){return function(_0x1d73a4){if(_0x1d73a4){return _0x1d73a4[_0x4a73('0x23')](_0xc50a02)['then'](function(_0x27755b){return _0x27755b;});}return null;};}function removeEntity(_0x58811f,_0x3ceec8){return function(_0x4b1826){if(_0x4b1826){return _0x4b1826[_0x4a73('0x24')]()['then'](function(){_0x58811f[_0x4a73('0x19')](0xcc)[_0x4a73('0x25')]();});}};}function handleEntityNotFound(_0x2005f5,_0x38520a){return function(_0x2c772a){if(!_0x2c772a){_0x2005f5['sendStatus'](0x194);}return _0x2c772a;};}function handleError(_0x3b800a,_0x571185){_0x571185=_0x571185||0x1f4;return function(_0x1e02b4){logger['error'](_0x1e02b4[_0x4a73('0x26')]);if(_0x1e02b4[_0x4a73('0x27')]){delete _0x1e02b4[_0x4a73('0x27')];}_0x3b800a[_0x4a73('0x19')](_0x571185)['send'](_0x1e02b4);};}exports[_0x4a73('0x28')]=function(_0xa1b7fe,_0x34f794){var _0x2efac1={},_0x23b377={},_0xe37523={'count':0x0,'rows':[]};var _0x2521ab=db[_0x4a73('0x29')][_0x4a73('0x2a')];_0x23b377['model']=_[_0x4a73('0x2b')](_0x2521ab);_0x23b377['query']=_[_0x4a73('0x2b')](_0xa1b7fe[_0x4a73('0x2c')]);_0x23b377[_0x4a73('0x2d')]=_['intersection'](_0x23b377[_0x4a73('0x2e')],_0x23b377[_0x4a73('0x2c')]);_0x2efac1[_0x4a73('0x2f')]=_[_0x4a73('0x30')](_0x23b377[_0x4a73('0x2e')],qs['fields'](_0xa1b7fe[_0x4a73('0x2c')][_0x4a73('0x31')]));_0x2efac1[_0x4a73('0x2f')]=_0x2efac1['attributes'][_0x4a73('0x32')]?_0x2efac1['attributes']:_0x23b377[_0x4a73('0x2e')];if(!_0xa1b7fe[_0x4a73('0x2c')][_0x4a73('0x33')](_0x4a73('0x34'))){_0x2efac1['limit']=qs[_0x4a73('0x1d')](_0xa1b7fe[_0x4a73('0x2c')][_0x4a73('0x1d')]);_0x2efac1[_0x4a73('0x1c')]=qs['offset'](_0xa1b7fe[_0x4a73('0x2c')][_0x4a73('0x1c')]);}_0x2efac1[_0x4a73('0x35')]=qs['sort'](_0xa1b7fe[_0x4a73('0x2c')]['sort']);_0x2efac1[_0x4a73('0x36')]=qs['filters'](_[_0x4a73('0x37')](_0xa1b7fe[_0x4a73('0x2c')],_0x23b377[_0x4a73('0x2d')]));if(_0xa1b7fe['query'][_0x4a73('0x38')]){_0x2efac1[_0x4a73('0x36')]=_[_0x4a73('0x39')](_0x2efac1['where'],{'$or':_[_0x4a73('0x3a')](_0x2521ab,function(_0x4a22de){if(_0x4a22de['type'][_0x4a73('0x3b')]!==_0x4a73('0x3c')){var _0x5874be={};_0x5874be[_0x4a22de['field']]={'$like':'%'+_0xa1b7fe[_0x4a73('0x2c')][_0x4a73('0x38')]+'%'};return _0x5874be;}})});}_0x2efac1=_['merge']({},_0x2efac1,_0xa1b7fe['options']);var _0xb1a8e4={'where':_0x2efac1[_0x4a73('0x36')]};return db[_0x4a73('0x29')]['count'](_0xb1a8e4)[_0x4a73('0x3d')](function(_0x4d970f){_0xe37523[_0x4a73('0x1b')]=_0x4d970f;if(_0xa1b7fe[_0x4a73('0x2c')][_0x4a73('0x3e')]){_0x2efac1[_0x4a73('0x3f')]=[{'all':!![]}];}return db[_0x4a73('0x29')]['findAll'](_0x2efac1);})[_0x4a73('0x3d')](function(_0x48b13b){_0xe37523[_0x4a73('0x40')]=_0x48b13b;return _0xe37523;})['then'](respondWithFilteredResult(_0x34f794,_0x2efac1))[_0x4a73('0x41')](handleError(_0x34f794,null));};exports[_0x4a73('0x42')]=function(_0x1728b0,_0xacdb6b){var _0xce870c={'raw':!![],'where':{'id':_0x1728b0['params']['id']}},_0x44eff2={};_0x44eff2[_0x4a73('0x2e')]=_[_0x4a73('0x2b')](db[_0x4a73('0x29')][_0x4a73('0x2a')]);_0x44eff2[_0x4a73('0x2c')]=_[_0x4a73('0x2b')](_0x1728b0[_0x4a73('0x2c')]);_0x44eff2[_0x4a73('0x2d')]=_[_0x4a73('0x30')](_0x44eff2[_0x4a73('0x2e')],_0x44eff2[_0x4a73('0x2c')]);_0xce870c[_0x4a73('0x2f')]=_[_0x4a73('0x30')](_0x44eff2['model'],qs[_0x4a73('0x31')](_0x1728b0['query'][_0x4a73('0x31')]));_0xce870c[_0x4a73('0x2f')]=_0xce870c[_0x4a73('0x2f')][_0x4a73('0x32')]?_0xce870c[_0x4a73('0x2f')]:_0x44eff2[_0x4a73('0x2e')];if(_0x1728b0['query'][_0x4a73('0x3e')]){_0xce870c[_0x4a73('0x3f')]=[{'all':!![]}];}_0xce870c=_[_0x4a73('0x39')]({},_0xce870c,_0x1728b0[_0x4a73('0x43')]);return db[_0x4a73('0x29')]['find'](_0xce870c)[_0x4a73('0x3d')](handleEntityNotFound(_0xacdb6b,null))[_0x4a73('0x3d')](respondWithResult(_0xacdb6b,null))[_0x4a73('0x41')](handleError(_0xacdb6b,null));};exports[_0x4a73('0x44')]=function(_0x5ed8ce,_0xb1e683){return db['ChatOfflineMessage'][_0x4a73('0x44')](_0x5ed8ce[_0x4a73('0x45')],{})[_0x4a73('0x3d')](respondWithResult(_0xb1e683,0xc9))[_0x4a73('0x41')](handleError(_0xb1e683,null));};exports[_0x4a73('0x23')]=function(_0x159dd1,_0x1c9b65){if(_0x159dd1[_0x4a73('0x45')]['id']){delete _0x159dd1[_0x4a73('0x45')]['id'];}return db[_0x4a73('0x29')][_0x4a73('0x46')]({'where':{'id':_0x159dd1[_0x4a73('0x47')]['id']}})['then'](handleEntityNotFound(_0x1c9b65,null))['then'](saveUpdates(_0x159dd1[_0x4a73('0x45')],null))[_0x4a73('0x3d')](respondWithResult(_0x1c9b65,null))[_0x4a73('0x41')](handleError(_0x1c9b65,null));};exports['destroy']=function(_0xe0fac6,_0x36c4a6){return db['ChatOfflineMessage'][_0x4a73('0x46')]({'where':{'id':_0xe0fac6['params']['id']}})['then'](handleEntityNotFound(_0x36c4a6,null))[_0x4a73('0x3d')](removeEntity(_0x36c4a6,null))['catch'](handleError(_0x36c4a6,null));};exports[_0x4a73('0x48')]=function(_0x299658,_0x144e2a){return db[_0x4a73('0x29')][_0x4a73('0x48')]()[_0x4a73('0x3d')](respondWithResult(_0x144e2a,null))[_0x4a73('0x41')](handleError(_0x144e2a,null));}; \ No newline at end of file +var _0xb3e5=['api','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','ChatOfflineMessage','rawAttributes','keys','query','filters','intersection','attributes','model','fields','hasOwnProperty','nolimit','order','where','pick','filter','merge','map','type','key','VIRTUAL','options','includeAll','include','rows','catch','params','length','find','create','body','describe','rimraf','zip-dir','moment','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger'];(function(_0x24cc59,_0x470f5f){var _0x1d621f=function(_0x4895be){while(--_0x4895be){_0x24cc59['push'](_0x24cc59['shift']());}};_0x1d621f(++_0x470f5f);}(_0xb3e5,0x1df));var _0x5b3e=function(_0x7d854f,_0x133df5){_0x7d854f=_0x7d854f-0x0;var _0x39a9da=_0xb3e5[_0x7d854f];return _0x39a9da;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x5b3e('0x0'));var zipdir=require(_0x5b3e('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x5b3e('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x5b3e('0x3'));var util=require(_0x5b3e('0x4'));var path=require('path');var sox=require(_0x5b3e('0x5'));var csv=require(_0x5b3e('0x6'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x5b3e('0x7'));var squel=require(_0x5b3e('0x8'));var crypto=require(_0x5b3e('0x9'));var jsforce=require(_0x5b3e('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x5b3e('0x6'));var querystring=require(_0x5b3e('0xb'));var Papa=require(_0x5b3e('0xc'));var Redis=require(_0x5b3e('0xd'));var authService=require(_0x5b3e('0xe'));var qs=require(_0x5b3e('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5b3e('0x10'));var logger=require(_0x5b3e('0x11'))(_0x5b3e('0x12'));var utils=require(_0x5b3e('0x13'));var config=require('../../config/environment');var db=require(_0x5b3e('0x14'))['db'];function respondWithStatusCode(_0x5a42da,_0x541666){_0x541666=_0x541666||0xcc;return function(_0x27bee7){if(_0x27bee7){return _0x5a42da[_0x5b3e('0x15')](_0x541666);}return _0x5a42da[_0x5b3e('0x16')](_0x541666)[_0x5b3e('0x17')]();};}function respondWithResult(_0x11d667,_0x145428){_0x145428=_0x145428||0xc8;return function(_0xe21ba8){if(_0xe21ba8){return _0x11d667[_0x5b3e('0x16')](_0x145428)[_0x5b3e('0x18')](_0xe21ba8);}};}function respondWithFilteredResult(_0x35814f,_0x4dc888){return function(_0x1308ef){if(_0x1308ef){var _0x2db2f2=_0x1308ef[_0x5b3e('0x19')],_0x3d6a9c=_0x4dc888[_0x5b3e('0x1a')],_0x1285db=_0x4dc888[_0x5b3e('0x1a')]+_0x4dc888[_0x5b3e('0x1b')],_0x1d5f84;if(_0x1285db>=_0x2db2f2){_0x1285db=_0x2db2f2;_0x1d5f84=0xc8;}else{_0x1d5f84=0xce;}_0x35814f[_0x5b3e('0x16')](_0x1d5f84);return _0x35814f['set'](_0x5b3e('0x1c'),_0x3d6a9c+'-'+_0x1285db+'/'+_0x2db2f2)[_0x5b3e('0x18')](_0x1308ef);}return null;};}function patchUpdates(_0xb546a0){return function(_0x3d78bd){try{jsonpatch[_0x5b3e('0x1d')](_0x3d78bd,_0xb546a0,!![]);}catch(_0x47ee60){return BPromise[_0x5b3e('0x1e')](_0x47ee60);}return _0x3d78bd[_0x5b3e('0x1f')]();};}function saveUpdates(_0x4e9536,_0x38fd63){return function(_0x432fc1){if(_0x432fc1){return _0x432fc1[_0x5b3e('0x20')](_0x4e9536)[_0x5b3e('0x21')](function(_0x40d97f){return _0x40d97f;});}return null;};}function removeEntity(_0x52a67a,_0xe15139){return function(_0x35bd90){if(_0x35bd90){return _0x35bd90[_0x5b3e('0x22')]()[_0x5b3e('0x21')](function(){_0x52a67a[_0x5b3e('0x16')](0xcc)[_0x5b3e('0x17')]();});}};}function handleEntityNotFound(_0x21244c,_0x20a2ae){return function(_0x557032){if(!_0x557032){_0x21244c['sendStatus'](0x194);}return _0x557032;};}function handleError(_0x49511c,_0x50c2c){_0x50c2c=_0x50c2c||0x1f4;return function(_0x5f5412){logger[_0x5b3e('0x23')](_0x5f5412[_0x5b3e('0x24')]);if(_0x5f5412[_0x5b3e('0x25')]){delete _0x5f5412['name'];}_0x49511c['status'](_0x50c2c)[_0x5b3e('0x26')](_0x5f5412);};}exports[_0x5b3e('0x27')]=function(_0x18f617,_0x3f2557){var _0x53dd52={},_0xe06574={},_0x51db44={'count':0x0,'rows':[]};var _0x5e385d=db[_0x5b3e('0x28')][_0x5b3e('0x29')];_0xe06574['model']=_[_0x5b3e('0x2a')](_0x5e385d);_0xe06574[_0x5b3e('0x2b')]=_[_0x5b3e('0x2a')](_0x18f617[_0x5b3e('0x2b')]);_0xe06574[_0x5b3e('0x2c')]=_[_0x5b3e('0x2d')](_0xe06574['model'],_0xe06574[_0x5b3e('0x2b')]);_0x53dd52[_0x5b3e('0x2e')]=_[_0x5b3e('0x2d')](_0xe06574[_0x5b3e('0x2f')],qs['fields'](_0x18f617[_0x5b3e('0x2b')][_0x5b3e('0x30')]));_0x53dd52[_0x5b3e('0x2e')]=_0x53dd52[_0x5b3e('0x2e')]['length']?_0x53dd52[_0x5b3e('0x2e')]:_0xe06574[_0x5b3e('0x2f')];if(!_0x18f617[_0x5b3e('0x2b')][_0x5b3e('0x31')](_0x5b3e('0x32'))){_0x53dd52[_0x5b3e('0x1b')]=qs[_0x5b3e('0x1b')](_0x18f617[_0x5b3e('0x2b')][_0x5b3e('0x1b')]);_0x53dd52[_0x5b3e('0x1a')]=qs['offset'](_0x18f617[_0x5b3e('0x2b')][_0x5b3e('0x1a')]);}_0x53dd52[_0x5b3e('0x33')]=qs['sort'](_0x18f617[_0x5b3e('0x2b')]['sort']);_0x53dd52[_0x5b3e('0x34')]=qs[_0x5b3e('0x2c')](_[_0x5b3e('0x35')](_0x18f617['query'],_0xe06574[_0x5b3e('0x2c')]));if(_0x18f617[_0x5b3e('0x2b')][_0x5b3e('0x36')]){_0x53dd52[_0x5b3e('0x34')]=_[_0x5b3e('0x37')](_0x53dd52[_0x5b3e('0x34')],{'$or':_[_0x5b3e('0x38')](_0x5e385d,function(_0x5ac74a){if(_0x5ac74a[_0x5b3e('0x39')][_0x5b3e('0x3a')]!==_0x5b3e('0x3b')){var _0x270512={};_0x270512[_0x5ac74a['field']]={'$like':'%'+_0x18f617['query'][_0x5b3e('0x36')]+'%'};return _0x270512;}})});}_0x53dd52=_[_0x5b3e('0x37')]({},_0x53dd52,_0x18f617[_0x5b3e('0x3c')]);var _0x290ff2={'where':_0x53dd52[_0x5b3e('0x34')]};return db[_0x5b3e('0x28')]['count'](_0x290ff2)[_0x5b3e('0x21')](function(_0x1a1eb0){_0x51db44[_0x5b3e('0x19')]=_0x1a1eb0;if(_0x18f617[_0x5b3e('0x2b')][_0x5b3e('0x3d')]){_0x53dd52[_0x5b3e('0x3e')]=[{'all':!![]}];}return db[_0x5b3e('0x28')]['findAll'](_0x53dd52);})[_0x5b3e('0x21')](function(_0x4f9cc0){_0x51db44[_0x5b3e('0x3f')]=_0x4f9cc0;return _0x51db44;})[_0x5b3e('0x21')](respondWithFilteredResult(_0x3f2557,_0x53dd52))[_0x5b3e('0x40')](handleError(_0x3f2557,null));};exports['show']=function(_0x53d632,_0xfacc8a){var _0xe2231c={'raw':!![],'where':{'id':_0x53d632[_0x5b3e('0x41')]['id']}},_0x27c417={};_0x27c417[_0x5b3e('0x2f')]=_['keys'](db[_0x5b3e('0x28')][_0x5b3e('0x29')]);_0x27c417[_0x5b3e('0x2b')]=_[_0x5b3e('0x2a')](_0x53d632[_0x5b3e('0x2b')]);_0x27c417[_0x5b3e('0x2c')]=_[_0x5b3e('0x2d')](_0x27c417['model'],_0x27c417[_0x5b3e('0x2b')]);_0xe2231c['attributes']=_[_0x5b3e('0x2d')](_0x27c417['model'],qs['fields'](_0x53d632[_0x5b3e('0x2b')][_0x5b3e('0x30')]));_0xe2231c[_0x5b3e('0x2e')]=_0xe2231c['attributes'][_0x5b3e('0x42')]?_0xe2231c[_0x5b3e('0x2e')]:_0x27c417['model'];if(_0x53d632[_0x5b3e('0x2b')][_0x5b3e('0x3d')]){_0xe2231c[_0x5b3e('0x3e')]=[{'all':!![]}];}_0xe2231c=_[_0x5b3e('0x37')]({},_0xe2231c,_0x53d632[_0x5b3e('0x3c')]);return db[_0x5b3e('0x28')][_0x5b3e('0x43')](_0xe2231c)[_0x5b3e('0x21')](handleEntityNotFound(_0xfacc8a,null))['then'](respondWithResult(_0xfacc8a,null))[_0x5b3e('0x40')](handleError(_0xfacc8a,null));};exports['create']=function(_0x3bd7c7,_0x40a0ff){return db['ChatOfflineMessage'][_0x5b3e('0x44')](_0x3bd7c7[_0x5b3e('0x45')],{})['then'](respondWithResult(_0x40a0ff,0xc9))[_0x5b3e('0x40')](handleError(_0x40a0ff,null));};exports['update']=function(_0x458543,_0x21a5d0){if(_0x458543[_0x5b3e('0x45')]['id']){delete _0x458543[_0x5b3e('0x45')]['id'];}return db[_0x5b3e('0x28')][_0x5b3e('0x43')]({'where':{'id':_0x458543[_0x5b3e('0x41')]['id']}})[_0x5b3e('0x21')](handleEntityNotFound(_0x21a5d0,null))[_0x5b3e('0x21')](saveUpdates(_0x458543[_0x5b3e('0x45')],null))[_0x5b3e('0x21')](respondWithResult(_0x21a5d0,null))[_0x5b3e('0x40')](handleError(_0x21a5d0,null));};exports[_0x5b3e('0x22')]=function(_0x2a00ca,_0x597aee){return db[_0x5b3e('0x28')][_0x5b3e('0x43')]({'where':{'id':_0x2a00ca[_0x5b3e('0x41')]['id']}})[_0x5b3e('0x21')](handleEntityNotFound(_0x597aee,null))[_0x5b3e('0x21')](removeEntity(_0x597aee,null))[_0x5b3e('0x40')](handleError(_0x597aee,null));};exports[_0x5b3e('0x46')]=function(_0x43ca79,_0xe7a223){return db[_0x5b3e('0x28')][_0x5b3e('0x46')]()[_0x5b3e('0x21')](respondWithResult(_0xe7a223,null))[_0x5b3e('0x40')](handleError(_0xe7a223,null));}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js index 7369918..4590653 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 _0x9c44=['chat_offline_messages','utf8mb4_unicode_ci','../../config/logger','api','moment','bluebird','request-promise','path','./chatOfflineMessage.attributes','define','ChatOfflineMessage'];(function(_0x2e84f3,_0x4140a2){var _0x4c1a38=function(_0x57978d){while(--_0x57978d){_0x2e84f3['push'](_0x2e84f3['shift']());}};_0x4c1a38(++_0x4140a2);}(_0x9c44,0x178));var _0x49c4=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0x9c44[_0x53ccf2];return _0x5a2964;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x49c4('0x0'))(_0x49c4('0x1'));var moment=require(_0x49c4('0x2'));var BPromise=require(_0x49c4('0x3'));var rp=require(_0x49c4('0x4'));var fs=require('fs');var path=require(_0x49c4('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x49c4('0x6'));module['exports']=function(_0xc1278f,_0x6030ae){return _0xc1278f[_0x49c4('0x7')](_0x49c4('0x8'),attributes,{'tableName':_0x49c4('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x49c4('0xa')});}; \ No newline at end of file +var _0xc368=['./chatOfflineMessage.attributes','exports','ChatOfflineMessage','chat_offline_messages','utf8mb4','utf8mb4_unicode_ci','util','api','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x549fb4,_0x57140c){var _0xc64c37=function(_0x40e702){while(--_0x40e702){_0x549fb4['push'](_0x549fb4['shift']());}};_0xc64c37(++_0x57140c);}(_0xc368,0x7b));var _0x8c36=function(_0xa885d6,_0x19c713){_0xa885d6=_0xa885d6-0x0;var _0x2d0187=_0xc368[_0xa885d6];return _0x2d0187;};'use strict';var _=require('lodash');var util=require(_0x8c36('0x0'));var logger=require('../../config/logger')(_0x8c36('0x1'));var moment=require(_0x8c36('0x2'));var BPromise=require(_0x8c36('0x3'));var rp=require(_0x8c36('0x4'));var fs=require('fs');var path=require(_0x8c36('0x5'));var rimraf=require('rimraf');var config=require(_0x8c36('0x6'));var attributes=require(_0x8c36('0x7'));module[_0x8c36('0x8')]=function(_0x1d3660,_0x5ebfc1){return _0x1d3660['define'](_0x8c36('0x9'),attributes,{'tableName':_0x8c36('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x8c36('0xb'),'collate':_0x8c36('0xc')});}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js index df4b55d..2fbf2c7 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 _0x349e=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','ChatOfflineMessage,\x20%s,\x20%s','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','moment'];(function(_0x68c979,_0x431cff){var _0x4f0001=function(_0xa7595d){while(--_0xa7595d){_0x68c979['push'](_0x68c979['shift']());}};_0x4f0001(++_0x431cff);}(_0x349e,0x157));var _0xe349=function(_0x13fc13,_0x4e895f){_0x13fc13=_0x13fc13-0x0;var _0x18bfaa=_0x349e[_0x13fc13];return _0x18bfaa;};'use strict';var _=require(_0xe349('0x0'));var util=require('util');var moment=require(_0xe349('0x1'));var BPromise=require(_0xe349('0x2'));var rs=require(_0xe349('0x3'));var fs=require('fs');var Redis=require(_0xe349('0x4'));var db=require(_0xe349('0x5'))['db'];var utils=require(_0xe349('0x6'));var logger=require(_0xe349('0x7'))(_0xe349('0x8'));var config=require(_0xe349('0x9'));var jayson=require(_0xe349('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1a69f9,_0x48427a,_0x51ceab){return new BPromise(function(_0x1e43f5,_0x4f1cfe){return client[_0xe349('0xb')](_0x1a69f9,_0x51ceab)[_0xe349('0xc')](function(_0x2058c6){logger[_0xe349('0xd')](_0xe349('0xe'),_0x48427a,'request\x20sent');logger[_0xe349('0xf')](_0xe349('0x10'),_0x48427a,_0xe349('0x11'),JSON[_0xe349('0x12')](_0x2058c6));if(_0x2058c6[_0xe349('0x13')]){if(_0x2058c6[_0xe349('0x13')]['code']===0x1f4){logger[_0xe349('0x13')](_0xe349('0xe'),_0x48427a,_0x2058c6['error']['message']);return _0x4f1cfe(_0x2058c6[_0xe349('0x13')]['message']);}logger[_0xe349('0x13')](_0xe349('0xe'),_0x48427a,_0x2058c6[_0xe349('0x13')][_0xe349('0x14')]);return _0x1e43f5(_0x2058c6[_0xe349('0x13')]['message']);}else{logger[_0xe349('0xd')]('ChatOfflineMessage,\x20%s,\x20%s',_0x48427a,_0xe349('0x11'));_0x1e43f5(_0x2058c6[_0xe349('0x15')]['message']);}})[_0xe349('0x16')](function(_0x152722){logger[_0xe349('0x13')](_0xe349('0xe'),_0x48427a,_0x152722);_0x4f1cfe(_0x152722);});});} \ No newline at end of file +var _0xe2e9=['code','ChatOfflineMessage,\x20%s,\x20%s','message','info','result','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','request','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0xe0b81f,_0x1fb734){var _0x290e5e=function(_0x19b8d3){while(--_0x19b8d3){_0xe0b81f['push'](_0xe0b81f['shift']());}};_0x290e5e(++_0x1fb734);}(_0xe2e9,0xad));var _0x9e2e=function(_0x491544,_0x5874f1){_0x491544=_0x491544-0x0;var _0x33cbdb=_0xe2e9[_0x491544];return _0x33cbdb;};'use strict';var _=require('lodash');var util=require(_0x9e2e('0x0'));var moment=require(_0x9e2e('0x1'));var BPromise=require(_0x9e2e('0x2'));var rs=require(_0x9e2e('0x3'));var fs=require('fs');var Redis=require(_0x9e2e('0x4'));var db=require(_0x9e2e('0x5'))['db'];var utils=require(_0x9e2e('0x6'));var logger=require(_0x9e2e('0x7'))(_0x9e2e('0x8'));var config=require('../../config/environment');var jayson=require(_0x9e2e('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4d1a65,_0x2114cc,_0x1d0c6d){return new BPromise(function(_0x21f9c4,_0x40ad5b){return client[_0x9e2e('0xa')](_0x4d1a65,_0x1d0c6d)['then'](function(_0x4883ee){logger['info']('ChatOfflineMessage,\x20%s,\x20%s',_0x2114cc,_0x9e2e('0xb'));logger[_0x9e2e('0xc')](_0x9e2e('0xd'),_0x2114cc,'request\x20sent',JSON[_0x9e2e('0xe')](_0x4883ee));if(_0x4883ee[_0x9e2e('0xf')]){if(_0x4883ee[_0x9e2e('0xf')][_0x9e2e('0x10')]===0x1f4){logger['error'](_0x9e2e('0x11'),_0x2114cc,_0x4883ee[_0x9e2e('0xf')][_0x9e2e('0x12')]);return _0x40ad5b(_0x4883ee[_0x9e2e('0xf')][_0x9e2e('0x12')]);}logger[_0x9e2e('0xf')]('ChatOfflineMessage,\x20%s,\x20%s',_0x2114cc,_0x4883ee[_0x9e2e('0xf')]['message']);return _0x21f9c4(_0x4883ee['error'][_0x9e2e('0x12')]);}else{logger[_0x9e2e('0x13')](_0x9e2e('0x11'),_0x2114cc,_0x9e2e('0xb'));_0x21f9c4(_0x4883ee[_0x9e2e('0x14')]['message']);}})['catch'](function(_0x2b55f0){logger['error']('ChatOfflineMessage,\x20%s,\x20%s',_0x2114cc,_0x2b55f0);_0x40ad5b(_0x2b55f0);});});} \ No newline at end of file diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js index 1361048..b85698f 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 _0x74e6=['./chatOfflineMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','post','create','put','destroy','exports','multer','util','connect-timeout','express','Router','../../components/interaction/service','../../config/environment'];(function(_0x5bc281,_0x65466d){var _0x25e43a=function(_0x12990e){while(--_0x12990e){_0x5bc281['push'](_0x5bc281['shift']());}};_0x25e43a(++_0x65466d);}(_0x74e6,0x1e7));var _0x674e=function(_0x49aeea,_0x88a64b){_0x49aeea=_0x49aeea-0x0;var _0x143cb6=_0x74e6[_0x49aeea];return _0x143cb6;};'use strict';var multer=require(_0x674e('0x0'));var util=require(_0x674e('0x1'));var path=require('path');var timeout=require(_0x674e('0x2'));var express=require(_0x674e('0x3'));var router=express[_0x674e('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x674e('0x5'));var config=require(_0x674e('0x6'));var controller=require(_0x674e('0x7'));router[_0x674e('0x8')]('/',auth[_0x674e('0x9')](),controller[_0x674e('0xa')]);router[_0x674e('0x8')](_0x674e('0xb'),auth['isAuthenticated'](),controller[_0x674e('0xc')]);router[_0x674e('0x8')](_0x674e('0xd'),auth[_0x674e('0x9')](),controller['show']);router[_0x674e('0xe')]('/',auth[_0x674e('0x9')](),controller[_0x674e('0xf')]);router[_0x674e('0x10')](_0x674e('0xd'),auth[_0x674e('0x9')](),controller['update']);router['delete']('/:id',auth[_0x674e('0x9')](),controller[_0x674e('0x11')]);module[_0x674e('0x12')]=router; \ No newline at end of file +var _0x5afb=['exports','multer','util','path','connect-timeout','Router','../../components/auth/service','get','isAuthenticated','index','/describe','describe','/:id','show','post','update','delete'];(function(_0x9edfd5,_0x286486){var _0x330738=function(_0x4aceb3){while(--_0x4aceb3){_0x9edfd5['push'](_0x9edfd5['shift']());}};_0x330738(++_0x286486);}(_0x5afb,0xcd));var _0xb5af=function(_0x5cd51d,_0x20d4fa){_0x5cd51d=_0x5cd51d-0x0;var _0x444608=_0x5afb[_0x5cd51d];return _0x444608;};'use strict';var multer=require(_0xb5af('0x0'));var util=require(_0xb5af('0x1'));var path=require(_0xb5af('0x2'));var timeout=require(_0xb5af('0x3'));var express=require('express');var router=express[_0xb5af('0x4')]();var auth=require(_0xb5af('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./chatOfflineMessage.controller');router[_0xb5af('0x6')]('/',auth[_0xb5af('0x7')](),controller[_0xb5af('0x8')]);router[_0xb5af('0x6')](_0xb5af('0x9'),auth[_0xb5af('0x7')](),controller[_0xb5af('0xa')]);router[_0xb5af('0x6')](_0xb5af('0xb'),auth[_0xb5af('0x7')](),controller[_0xb5af('0xc')]);router[_0xb5af('0xd')]('/',auth[_0xb5af('0x7')](),controller['create']);router['put'](_0xb5af('0xb'),auth[_0xb5af('0x7')](),controller[_0xb5af('0xe')]);router[_0xb5af('0xf')](_0xb5af('0xb'),auth[_0xb5af('0x7')](),controller['destroy']);module[_0xb5af('0x10')]=router; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js index 6244940..6a55a19 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 _0x1b8b=['exports','ENUM','mouseOver','timeout','STRING','INTEGER','sequelize'];(function(_0x49fcfb,_0x504dec){var _0x964926=function(_0x327977){while(--_0x327977){_0x49fcfb['push'](_0x49fcfb['shift']());}};_0x964926(++_0x504dec);}(_0x1b8b,0xc3));var _0xb1b8=function(_0x4929f8,_0xc8f56a){_0x4929f8=_0x4929f8-0x0;var _0x354230=_0x1b8b[_0x4929f8];return _0x354230;};'use strict';var Sequelize=require(_0xb1b8('0x0'));module[_0xb1b8('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xb1b8('0x2')](_0xb1b8('0x3'),_0xb1b8('0x4')),'defaultValue':_0xb1b8('0x3')},'selector':{'type':Sequelize[_0xb1b8('0x5')]},'timeout':{'type':Sequelize[_0xb1b8('0x6')]}}; \ No newline at end of file +var _0x39d3=['INTEGER','sequelize','exports','STRING','ENUM','mouseOver'];(function(_0x3c04ef,_0x9d110c){var _0x6a3a69=function(_0x333514){while(--_0x333514){_0x3c04ef['push'](_0x3c04ef['shift']());}};_0x6a3a69(++_0x9d110c);}(_0x39d3,0xaf));var _0x339d=function(_0x57dcc3,_0x346edb){_0x57dcc3=_0x57dcc3-0x0;var _0x4e0061=_0x39d3[_0x57dcc3];return _0x4e0061;};'use strict';var Sequelize=require(_0x339d('0x0'));module[_0x339d('0x1')]={'name':{'type':Sequelize[_0x339d('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x339d('0x3')]('mouseOver','timeout'),'defaultValue':_0x339d('0x4')},'selector':{'type':Sequelize[_0x339d('0x2')]},'timeout':{'type':Sequelize[_0x339d('0x5')]}}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js index 36041bb..c2f37ca 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 _0xbea5=['attributes','fields','includeAll','merge','options','ChatProactiveAction','catch','create','body','find','destroy','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','to-csv','squel','desk.js','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','json','offset','limit','set','Content-Range','apply','reject','update','then','end','error','stack','name','show','params','keys','query','filters','intersection','model'];(function(_0x1f5303,_0x354414){var _0x84ef1a=function(_0x27e275){while(--_0x27e275){_0x1f5303['push'](_0x1f5303['shift']());}};_0x84ef1a(++_0x354414);}(_0xbea5,0x177));var _0x5bea=function(_0x296897,_0x4d23ea){_0x296897=_0x296897-0x0;var _0x2b44ab=_0xbea5[_0x296897];return _0x2b44ab;};'use strict';var pdf=require(_0x5bea('0x0'));var emlformat=require(_0x5bea('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x5bea('0x2'));var jsonpatch=require(_0x5bea('0x3'));var rp=require(_0x5bea('0x4'));var moment=require(_0x5bea('0x5'));var BPromise=require(_0x5bea('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x5bea('0x7'));var sox=require('sox');var csv=require(_0x5bea('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x5bea('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x5bea('0xa'));var toCsv=require(_0x5bea('0x8'));var querystring=require(_0x5bea('0xb'));var Papa=require('papaparse');var Redis=require(_0x5bea('0xc'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x5bea('0xd'));var hardwareService=require(_0x5bea('0xe'));var logger=require(_0x5bea('0xf'))(_0x5bea('0x10'));var utils=require(_0x5bea('0x11'));var config=require(_0x5bea('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x9190f9,_0x1f49a0){_0x1f49a0=_0x1f49a0||0xcc;return function(_0x5aef2d){if(_0x5aef2d){return _0x9190f9[_0x5bea('0x13')](_0x1f49a0);}return _0x9190f9[_0x5bea('0x14')](_0x1f49a0)['end']();};}function respondWithResult(_0xcf4b7e,_0x229e09){_0x229e09=_0x229e09||0xc8;return function(_0x26cfca){if(_0x26cfca){return _0xcf4b7e[_0x5bea('0x14')](_0x229e09)[_0x5bea('0x15')](_0x26cfca);}};}function respondWithFilteredResult(_0x464d29,_0x14d46c){return function(_0x5e0518){if(_0x5e0518){var _0x492190=_0x5e0518['count'],_0x1ad017=_0x14d46c[_0x5bea('0x16')],_0x1590f4=_0x14d46c[_0x5bea('0x16')]+_0x14d46c[_0x5bea('0x17')],_0x22f509;if(_0x1590f4>=_0x492190){_0x1590f4=_0x492190;_0x22f509=0xc8;}else{_0x22f509=0xce;}_0x464d29['status'](_0x22f509);return _0x464d29[_0x5bea('0x18')](_0x5bea('0x19'),_0x1ad017+'-'+_0x1590f4+'/'+_0x492190)['json'](_0x5e0518);}return null;};}function patchUpdates(_0x163bf7){return function(_0x55d6d1){try{jsonpatch[_0x5bea('0x1a')](_0x55d6d1,_0x163bf7,!![]);}catch(_0x358ad0){return BPromise[_0x5bea('0x1b')](_0x358ad0);}return _0x55d6d1['save']();};}function saveUpdates(_0x57667c,_0x4169e5){return function(_0x2bf974){if(_0x2bf974){return _0x2bf974[_0x5bea('0x1c')](_0x57667c)['then'](function(_0x1d328a){return _0x1d328a;});}return null;};}function removeEntity(_0x451eec,_0x146177){return function(_0xda92cf){if(_0xda92cf){return _0xda92cf['destroy']()[_0x5bea('0x1d')](function(){_0x451eec[_0x5bea('0x14')](0xcc)[_0x5bea('0x1e')]();});}};}function handleEntityNotFound(_0x245c81,_0x5984f8){return function(_0x406ac8){if(!_0x406ac8){_0x245c81['sendStatus'](0x194);}return _0x406ac8;};}function handleError(_0x274f19,_0x56cb86){_0x56cb86=_0x56cb86||0x1f4;return function(_0x1e4f97){logger[_0x5bea('0x1f')](_0x1e4f97[_0x5bea('0x20')]);if(_0x1e4f97[_0x5bea('0x21')]){delete _0x1e4f97['name'];}_0x274f19['status'](_0x56cb86)['send'](_0x1e4f97);};}exports[_0x5bea('0x22')]=function(_0x358cf3,_0x4d5dd5){var _0x4aa9a1={'raw':!![],'where':{'id':_0x358cf3[_0x5bea('0x23')]['id']}},_0x35059f={};_0x35059f['model']=_[_0x5bea('0x24')](db['ChatProactiveAction']['rawAttributes']);_0x35059f[_0x5bea('0x25')]=_[_0x5bea('0x24')](_0x358cf3[_0x5bea('0x25')]);_0x35059f[_0x5bea('0x26')]=_[_0x5bea('0x27')](_0x35059f[_0x5bea('0x28')],_0x35059f[_0x5bea('0x25')]);_0x4aa9a1[_0x5bea('0x29')]=_[_0x5bea('0x27')](_0x35059f['model'],qs['fields'](_0x358cf3[_0x5bea('0x25')][_0x5bea('0x2a')]));_0x4aa9a1[_0x5bea('0x29')]=_0x4aa9a1[_0x5bea('0x29')]['length']?_0x4aa9a1[_0x5bea('0x29')]:_0x35059f[_0x5bea('0x28')];if(_0x358cf3[_0x5bea('0x25')][_0x5bea('0x2b')]){_0x4aa9a1['include']=[{'all':!![]}];}_0x4aa9a1=_[_0x5bea('0x2c')]({},_0x4aa9a1,_0x358cf3[_0x5bea('0x2d')]);return db[_0x5bea('0x2e')]['find'](_0x4aa9a1)[_0x5bea('0x1d')](handleEntityNotFound(_0x4d5dd5,null))[_0x5bea('0x1d')](respondWithResult(_0x4d5dd5,null))[_0x5bea('0x2f')](handleError(_0x4d5dd5,null));};exports[_0x5bea('0x30')]=function(_0x691435,_0xe796bf){return db['ChatProactiveAction']['create'](_0x691435[_0x5bea('0x31')],{})[_0x5bea('0x1d')](respondWithResult(_0xe796bf,0xc9))['catch'](handleError(_0xe796bf,null));};exports[_0x5bea('0x1c')]=function(_0x54a831,_0x2f439c){if(_0x54a831[_0x5bea('0x31')]['id']){delete _0x54a831['body']['id'];}return db[_0x5bea('0x2e')][_0x5bea('0x32')]({'where':{'id':_0x54a831[_0x5bea('0x23')]['id']}})['then'](handleEntityNotFound(_0x2f439c,null))['then'](saveUpdates(_0x54a831[_0x5bea('0x31')],null))[_0x5bea('0x1d')](respondWithResult(_0x2f439c,null))[_0x5bea('0x2f')](handleError(_0x2f439c,null));};exports[_0x5bea('0x33')]=function(_0xa4270f,_0x4c6594){return db[_0x5bea('0x2e')]['find']({'where':{'id':_0xa4270f[_0x5bea('0x23')]['id']}})[_0x5bea('0x1d')](handleEntityNotFound(_0x4c6594,null))[_0x5bea('0x1d')](removeEntity(_0x4c6594,null))[_0x5bea('0x2f')](handleError(_0x4c6594,null));}; \ No newline at end of file +var _0x2dc3=['stack','name','model','keys','ChatProactiveAction','rawAttributes','query','intersection','fields','attributes','length','includeAll','include','merge','options','find','catch','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','ejs','squel','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','Content-Range','reject','save','update','then','destroy'];(function(_0x2812a5,_0x850394){var _0x58b102=function(_0x27ba7d){while(--_0x27ba7d){_0x2812a5['push'](_0x2812a5['shift']());}};_0x58b102(++_0x850394);}(_0x2dc3,0x127));var _0x32dc=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x2dc3[_0x2f5ac5];return _0x37c9a8;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x32dc('0x0'));var rimraf=require(_0x32dc('0x1'));var zipdir=require(_0x32dc('0x2'));var jsonpatch=require(_0x32dc('0x3'));var rp=require(_0x32dc('0x4'));var moment=require(_0x32dc('0x5'));var BPromise=require(_0x32dc('0x6'));var Mustache=require(_0x32dc('0x7'));var util=require('util');var path=require('path');var sox=require(_0x32dc('0x8'));var csv=require('to-csv');var ejs=require(_0x32dc('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0x32dc('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x32dc('0xb'));var toCsv=require('to-csv');var querystring=require(_0x32dc('0xc'));var Papa=require(_0x32dc('0xd'));var Redis=require(_0x32dc('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x32dc('0xf'));var hardwareService=require(_0x32dc('0x10'));var logger=require(_0x32dc('0x11'))(_0x32dc('0x12'));var utils=require(_0x32dc('0x13'));var config=require(_0x32dc('0x14'));var db=require(_0x32dc('0x15'))['db'];function respondWithStatusCode(_0x5f0482,_0x36ab9f){_0x36ab9f=_0x36ab9f||0xcc;return function(_0x480027){if(_0x480027){return _0x5f0482[_0x32dc('0x16')](_0x36ab9f);}return _0x5f0482[_0x32dc('0x17')](_0x36ab9f)[_0x32dc('0x18')]();};}function respondWithResult(_0x5c54c2,_0x355d98){_0x355d98=_0x355d98||0xc8;return function(_0x10f169){if(_0x10f169){return _0x5c54c2['status'](_0x355d98)[_0x32dc('0x19')](_0x10f169);}};}function respondWithFilteredResult(_0x4bf4ca,_0x2dee08){return function(_0x5954f3){if(_0x5954f3){var _0x47fe19=_0x5954f3[_0x32dc('0x1a')],_0x497b11=_0x2dee08['offset'],_0x2e1a9d=_0x2dee08[_0x32dc('0x1b')]+_0x2dee08[_0x32dc('0x1c')],_0x328940;if(_0x2e1a9d>=_0x47fe19){_0x2e1a9d=_0x47fe19;_0x328940=0xc8;}else{_0x328940=0xce;}_0x4bf4ca[_0x32dc('0x17')](_0x328940);return _0x4bf4ca['set'](_0x32dc('0x1d'),_0x497b11+'-'+_0x2e1a9d+'/'+_0x47fe19)[_0x32dc('0x19')](_0x5954f3);}return null;};}function patchUpdates(_0x2671b1){return function(_0x1710a5){try{jsonpatch['apply'](_0x1710a5,_0x2671b1,!![]);}catch(_0x7e27ea){return BPromise[_0x32dc('0x1e')](_0x7e27ea);}return _0x1710a5[_0x32dc('0x1f')]();};}function saveUpdates(_0xc07d3b,_0x43b4a3){return function(_0x445c79){if(_0x445c79){return _0x445c79[_0x32dc('0x20')](_0xc07d3b)[_0x32dc('0x21')](function(_0x5ed1d9){return _0x5ed1d9;});}return null;};}function removeEntity(_0x227563,_0x37e2d1){return function(_0xd8dd68){if(_0xd8dd68){return _0xd8dd68[_0x32dc('0x22')]()['then'](function(){_0x227563[_0x32dc('0x17')](0xcc)[_0x32dc('0x18')]();});}};}function handleEntityNotFound(_0x36398c,_0x39182b){return function(_0x57e1e3){if(!_0x57e1e3){_0x36398c[_0x32dc('0x16')](0x194);}return _0x57e1e3;};}function handleError(_0x18fc9c,_0x11d7d0){_0x11d7d0=_0x11d7d0||0x1f4;return function(_0x5f2b99){logger['error'](_0x5f2b99[_0x32dc('0x23')]);if(_0x5f2b99['name']){delete _0x5f2b99[_0x32dc('0x24')];}_0x18fc9c['status'](_0x11d7d0)['send'](_0x5f2b99);};}exports['show']=function(_0x2664db,_0x4a1e63){var _0x6f190e={'raw':!![],'where':{'id':_0x2664db['params']['id']}},_0x26e348={};_0x26e348[_0x32dc('0x25')]=_[_0x32dc('0x26')](db[_0x32dc('0x27')][_0x32dc('0x28')]);_0x26e348[_0x32dc('0x29')]=_[_0x32dc('0x26')](_0x2664db[_0x32dc('0x29')]);_0x26e348['filters']=_[_0x32dc('0x2a')](_0x26e348[_0x32dc('0x25')],_0x26e348['query']);_0x6f190e['attributes']=_[_0x32dc('0x2a')](_0x26e348['model'],qs[_0x32dc('0x2b')](_0x2664db['query'][_0x32dc('0x2b')]));_0x6f190e[_0x32dc('0x2c')]=_0x6f190e['attributes'][_0x32dc('0x2d')]?_0x6f190e[_0x32dc('0x2c')]:_0x26e348[_0x32dc('0x25')];if(_0x2664db['query'][_0x32dc('0x2e')]){_0x6f190e[_0x32dc('0x2f')]=[{'all':!![]}];}_0x6f190e=_[_0x32dc('0x30')]({},_0x6f190e,_0x2664db[_0x32dc('0x31')]);return db[_0x32dc('0x27')][_0x32dc('0x32')](_0x6f190e)[_0x32dc('0x21')](handleEntityNotFound(_0x4a1e63,null))[_0x32dc('0x21')](respondWithResult(_0x4a1e63,null))[_0x32dc('0x33')](handleError(_0x4a1e63,null));};exports[_0x32dc('0x34')]=function(_0x4846be,_0x33a602){return db[_0x32dc('0x27')][_0x32dc('0x34')](_0x4846be[_0x32dc('0x35')],{})[_0x32dc('0x21')](respondWithResult(_0x33a602,0xc9))['catch'](handleError(_0x33a602,null));};exports[_0x32dc('0x20')]=function(_0x56a93e,_0x26c987){if(_0x56a93e['body']['id']){delete _0x56a93e[_0x32dc('0x35')]['id'];}return db['ChatProactiveAction']['find']({'where':{'id':_0x56a93e[_0x32dc('0x36')]['id']}})[_0x32dc('0x21')](handleEntityNotFound(_0x26c987,null))[_0x32dc('0x21')](saveUpdates(_0x56a93e[_0x32dc('0x35')],null))['then'](respondWithResult(_0x26c987,null))[_0x32dc('0x33')](handleError(_0x26c987,null));};exports[_0x32dc('0x22')]=function(_0x62c2cb,_0x477004){return db['ChatProactiveAction'][_0x32dc('0x32')]({'where':{'id':_0x62c2cb[_0x32dc('0x36')]['id']}})[_0x32dc('0x21')](handleEntityNotFound(_0x477004,null))[_0x32dc('0x21')](removeEntity(_0x477004,null))[_0x32dc('0x33')](handleError(_0x477004,null));}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js index 8471144..31743a4 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 _0x9bf2=['api','moment','rimraf','../../config/environment','./chatProactiveAction.attributes','exports','define','ChatProactiveAction','chat_proactive_actions'];(function(_0x1af415,_0x488cf7){var _0x442de9=function(_0xcc3d94){while(--_0xcc3d94){_0x1af415['push'](_0x1af415['shift']());}};_0x442de9(++_0x488cf7);}(_0x9bf2,0x6c));var _0x29bf=function(_0x170e91,_0x2ee5d0){_0x170e91=_0x170e91-0x0;var _0x5a4e86=_0x9bf2[_0x170e91];return _0x5a4e86;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x29bf('0x0'));var moment=require(_0x29bf('0x1'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x29bf('0x2'));var config=require(_0x29bf('0x3'));var attributes=require(_0x29bf('0x4'));module[_0x29bf('0x5')]=function(_0x5055a3,_0xc9ce74){return _0x5055a3[_0x29bf('0x6')](_0x29bf('0x7'),attributes,{'tableName':_0x29bf('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4c2a=['request-promise','path','rimraf','../../config/environment','./chatProactiveAction.attributes','exports','define','ChatProactiveAction','chat_proactive_actions','util','moment','bluebird'];(function(_0x1b227f,_0x127701){var _0x43f712=function(_0x1bad23){while(--_0x1bad23){_0x1b227f['push'](_0x1b227f['shift']());}};_0x43f712(++_0x127701);}(_0x4c2a,0x1c5));var _0xa4c2=function(_0x30c63d,_0x44d49a){_0x30c63d=_0x30c63d-0x0;var _0x8b3b92=_0x4c2a[_0x30c63d];return _0x8b3b92;};'use strict';var _=require('lodash');var util=require(_0xa4c2('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0xa4c2('0x1'));var BPromise=require(_0xa4c2('0x2'));var rp=require(_0xa4c2('0x3'));var fs=require('fs');var path=require(_0xa4c2('0x4'));var rimraf=require(_0xa4c2('0x5'));var config=require(_0xa4c2('0x6'));var attributes=require(_0xa4c2('0x7'));module[_0xa4c2('0x8')]=function(_0x1dbbe0,_0x27fab5){return _0x1dbbe0[_0xa4c2('0x9')](_0xa4c2('0xa'),attributes,{'tableName':_0xa4c2('0xb'),'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 7ff6c97..8bba539 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 _0x9a0c=['message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','ChatProactiveAction,\x20%s,\x20%s','ChatProactiveAction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x52065c,_0x2449d2){var _0x5da1e=function(_0xfc6f8b){while(--_0xfc6f8b){_0x52065c['push'](_0x52065c['shift']());}};_0x5da1e(++_0x2449d2);}(_0x9a0c,0xea));var _0xc9a0=function(_0x580de6,_0x178c0e){_0x580de6=_0x580de6-0x0;var _0x5849e0=_0x9a0c[_0x580de6];return _0x5849e0;};'use strict';var _=require(_0xc9a0('0x0'));var util=require(_0xc9a0('0x1'));var moment=require(_0xc9a0('0x2'));var BPromise=require(_0xc9a0('0x3'));var rs=require(_0xc9a0('0x4'));var fs=require('fs');var Redis=require(_0xc9a0('0x5'));var db=require(_0xc9a0('0x6'))['db'];var utils=require(_0xc9a0('0x7'));var logger=require(_0xc9a0('0x8'))(_0xc9a0('0x9'));var config=require('../../config/environment');var jayson=require(_0xc9a0('0xa'));var client=jayson['client'][_0xc9a0('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5d3c05,_0x429654,_0x15ceb4){return new BPromise(function(_0x2cac41,_0x4c3192){return client[_0xc9a0('0xc')](_0x5d3c05,_0x15ceb4)[_0xc9a0('0xd')](function(_0xa13cb6){logger['info'](_0xc9a0('0xe'),_0x429654,'request\x20sent');logger['debug'](_0xc9a0('0xf'),_0x429654,_0xc9a0('0x10'),JSON[_0xc9a0('0x11')](_0xa13cb6));if(_0xa13cb6['error']){if(_0xa13cb6[_0xc9a0('0x12')]['code']===0x1f4){logger['error'](_0xc9a0('0xe'),_0x429654,_0xa13cb6['error'][_0xc9a0('0x13')]);return _0x4c3192(_0xa13cb6[_0xc9a0('0x12')][_0xc9a0('0x13')]);}logger[_0xc9a0('0x12')](_0xc9a0('0xe'),_0x429654,_0xa13cb6['error'][_0xc9a0('0x13')]);return _0x2cac41(_0xa13cb6[_0xc9a0('0x12')][_0xc9a0('0x13')]);}else{logger[_0xc9a0('0x14')](_0xc9a0('0xe'),_0x429654,_0xc9a0('0x10'));_0x2cac41(_0xa13cb6[_0xc9a0('0x15')][_0xc9a0('0x13')]);}})[_0xc9a0('0x16')](function(_0x347370){logger['error']('ChatProactiveAction,\x20%s,\x20%s',_0x429654,_0x347370);_0x4c3192(_0x347370);});});} \ No newline at end of file +var _0x90db=['../../config/environment','jayson/promise','client','request','then','info','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','message','ChatProactiveAction,\x20%s,\x20%s','result','catch','lodash','util','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x58547b,_0x4b89c2){var _0x1d3fd2=function(_0x4ac500){while(--_0x4ac500){_0x58547b['push'](_0x58547b['shift']());}};_0x1d3fd2(++_0x4b89c2);}(_0x90db,0x1b3));var _0xb90d=function(_0x1b5aea,_0x3f04b7){_0x1b5aea=_0x1b5aea-0x0;var _0x15cfc6=_0x90db[_0x1b5aea];return _0x15cfc6;};'use strict';var _=require(_0xb90d('0x0'));var util=require(_0xb90d('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xb90d('0x2'));var fs=require('fs');var Redis=require(_0xb90d('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xb90d('0x4'));var logger=require(_0xb90d('0x5'))('rpc');var config=require(_0xb90d('0x6'));var jayson=require(_0xb90d('0x7'));var client=jayson[_0xb90d('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3482ec,_0xbbd9e8,_0x3e106e){return new BPromise(function(_0x179440,_0x139e90){return client[_0xb90d('0x9')](_0x3482ec,_0x3e106e)[_0xb90d('0xa')](function(_0x24a40f){logger[_0xb90d('0xb')]('ChatProactiveAction,\x20%s,\x20%s',_0xbbd9e8,_0xb90d('0xc'));logger[_0xb90d('0xd')](_0xb90d('0xe'),_0xbbd9e8,_0xb90d('0xc'),JSON[_0xb90d('0xf')](_0x24a40f));if(_0x24a40f[_0xb90d('0x10')]){if(_0x24a40f[_0xb90d('0x10')]['code']===0x1f4){logger[_0xb90d('0x10')]('ChatProactiveAction,\x20%s,\x20%s',_0xbbd9e8,_0x24a40f[_0xb90d('0x10')][_0xb90d('0x11')]);return _0x139e90(_0x24a40f['error'][_0xb90d('0x11')]);}logger[_0xb90d('0x10')](_0xb90d('0x12'),_0xbbd9e8,_0x24a40f['error'][_0xb90d('0x11')]);return _0x179440(_0x24a40f[_0xb90d('0x10')]['message']);}else{logger['info'](_0xb90d('0x12'),_0xbbd9e8,_0xb90d('0xc'));_0x179440(_0x24a40f[_0xb90d('0x13')]['message']);}})[_0xb90d('0x14')](function(_0x1da57a){logger[_0xb90d('0x10')](_0xb90d('0x12'),_0xbbd9e8,_0x1da57a);_0x139e90(_0x1da57a);});});} \ No newline at end of file diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js index 8501415..a091b43 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 _0x3291=['delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','isAuthenticated','show','post','create','put','/:id','update'];(function(_0x551d84,_0x4ab862){var _0x581062=function(_0x1e65a9){while(--_0x1e65a9){_0x551d84['push'](_0x551d84['shift']());}};_0x581062(++_0x4ab862);}(_0x3291,0x1cb));var _0x1329=function(_0x5f3c83,_0x4b3b2d){_0x5f3c83=_0x5f3c83-0x0;var _0x1a5574=_0x3291[_0x5f3c83];return _0x1a5574;};'use strict';var multer=require(_0x1329('0x0'));var util=require(_0x1329('0x1'));var path=require(_0x1329('0x2'));var timeout=require('connect-timeout');var express=require(_0x1329('0x3'));var router=express[_0x1329('0x4')]();var auth=require(_0x1329('0x5'));var interaction=require(_0x1329('0x6'));var config=require(_0x1329('0x7'));var controller=require(_0x1329('0x8'));router['get']('/:id',auth[_0x1329('0x9')](),controller[_0x1329('0xa')]);router[_0x1329('0xb')]('/',auth[_0x1329('0x9')](),controller[_0x1329('0xc')]);router[_0x1329('0xd')](_0x1329('0xe'),auth[_0x1329('0x9')](),controller[_0x1329('0xf')]);router[_0x1329('0x10')]('/:id',auth[_0x1329('0x9')](),controller[_0x1329('0x11')]);module[_0x1329('0x12')]=router; \ No newline at end of file +var _0xa8de=['path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./chatProactiveAction.controller','/:id','show','create','put','isAuthenticated','update','delete','multer','util'];(function(_0xb376cb,_0x364ca7){var _0x5452c1=function(_0x444e84){while(--_0x444e84){_0xb376cb['push'](_0xb376cb['shift']());}};_0x5452c1(++_0x364ca7);}(_0xa8de,0x17e));var _0xea8d=function(_0x279d97,_0x1b7180){_0x279d97=_0x279d97-0x0;var _0x12163d=_0xa8de[_0x279d97];return _0x12163d;};'use strict';var multer=require(_0xea8d('0x0'));var util=require(_0xea8d('0x1'));var path=require(_0xea8d('0x2'));var timeout=require(_0xea8d('0x3'));var express=require(_0xea8d('0x4'));var router=express[_0xea8d('0x5')]();var auth=require(_0xea8d('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xea8d('0x7'));var controller=require(_0xea8d('0x8'));router['get'](_0xea8d('0x9'),auth['isAuthenticated'](),controller[_0xea8d('0xa')]);router['post']('/',auth['isAuthenticated'](),controller[_0xea8d('0xb')]);router[_0xea8d('0xc')]('/:id',auth[_0xea8d('0xd')](),controller[_0xea8d('0xe')]);router[_0xea8d('0xf')](_0xea8d('0x9'),auth[_0xea8d('0xd')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js index 43fcf14..53fd38a 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 _0xee81=['exports','STRING','INTEGER','ENUM','rrmemory','roundrobin','sequelize'];(function(_0x20fb24,_0x4f8ed9){var _0x9c451=function(_0x10eeb6){while(--_0x10eeb6){_0x20fb24['push'](_0x20fb24['shift']());}};_0x9c451(++_0x4f8ed9);}(_0xee81,0x19c));var _0x1ee8=function(_0x2bf699,_0x5ce8b8){_0x2bf699=_0x2bf699-0x0;var _0x57aea0=_0xee81[_0x2bf699];return _0x57aea0;};'use strict';var Sequelize=require(_0x1ee8('0x0'));module[_0x1ee8('0x1')]={'name':{'type':Sequelize[_0x1ee8('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x1ee8('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x1ee8('0x4')](_0x1ee8('0x5'),'beepall',_0x1ee8('0x6'))}}; \ No newline at end of file +var _0x14f1=['ENUM','beepall','roundrobin','sequelize','exports','STRING','name','INTEGER'];(function(_0x1c8c28,_0x3ee093){var _0x1f59b4=function(_0x29bcc0){while(--_0x29bcc0){_0x1c8c28['push'](_0x1c8c28['shift']());}};_0x1f59b4(++_0x3ee093);}(_0x14f1,0x18b));var _0x114f=function(_0x30988a,_0x36c871){_0x30988a=_0x30988a-0x0;var _0x5dbca2=_0x14f1[_0x30988a];return _0x5dbca2;};'use strict';var Sequelize=require(_0x114f('0x0'));module[_0x114f('0x1')]={'name':{'type':Sequelize[_0x114f('0x2')],'unique':_0x114f('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x114f('0x2')]},'timeout':{'type':Sequelize[_0x114f('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x114f('0x5')]('rrmemory',_0x114f('0x6'),_0x114f('0x7'))}}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js index 21078dd..a8d64a9 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 _0xdc9c=['addAgents','omit','spread','getAgents','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','count','offset','set','Content-Range','json','apply','save','update','destroy','ChatQueues','UserProfileResource','end','stack','name','send','rawAttributes','model','keys','query','filters','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','pick','merge','where','map','type','key','field','filter','ChatQueue','include','findAll','rows','show','params','length','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','intersection','ChatQueueId','options','UserChatQueue','UserId','updatedAt','format','%s/%s','SIP','chatPause','getTeams','findOne','Team','addTeams','ids','User','Agents','online','voicePause','transaction','each','forEach','emit','userChatQueue:save','select','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','sequelize','toString','QueryTypes','every','TeamId','includes','all','compact','value','removeAgents','userChatQueue:remove'];(function(_0x234f7a,_0x42db6f){var _0x4fbd23=function(_0x1f2733){while(--_0x1f2733){_0x234f7a['push'](_0x234f7a['shift']());}};_0x4fbd23(++_0x42db6f);}(_0xdc9c,0x122));var _0xcdc9=function(_0x5622b1,_0xddf988){_0x5622b1=_0x5622b1-0x0;var _0x3bde7f=_0xdc9c[_0x5622b1];return _0x3bde7f;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xcdc9('0x0'));var rimraf=require(_0xcdc9('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xcdc9('0x2'));var rp=require(_0xcdc9('0x3'));var moment=require('moment');var BPromise=require(_0xcdc9('0x4'));var Mustache=require(_0xcdc9('0x5'));var util=require(_0xcdc9('0x6'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xcdc9('0x7'));var fs=require('fs');var _=require(_0xcdc9('0x8'));var squel=require(_0xcdc9('0x9'));var crypto=require(_0xcdc9('0xa'));var jsforce=require(_0xcdc9('0xb'));var deskjs=require(_0xcdc9('0xc'));var toCsv=require('to-csv');var querystring=require(_0xcdc9('0xd'));var Papa=require(_0xcdc9('0xe'));var Redis=require(_0xcdc9('0xf'));var authService=require(_0xcdc9('0x10'));var qs=require(_0xcdc9('0x11'));var as=require(_0xcdc9('0x12'));var hardwareService=require(_0xcdc9('0x13'));var logger=require(_0xcdc9('0x14'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0xcdc9('0x15'))['db'];config[_0xcdc9('0x16')]=_[_0xcdc9('0x17')](config[_0xcdc9('0x16')],{'host':_0xcdc9('0x18'),'port':0x18eb});var socket=require(_0xcdc9('0x19'))(new Redis(config['redis']));require(_0xcdc9('0x1a'))[_0xcdc9('0x1b')](socket);var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function checkPasswordPattern(_0x331d84,_0x4d1ba4,_0x35e9af){if(_0x35e9af){var _0x2ef8b2=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2ef8b2['test'](_0x4d1ba4)){return _0x331d84;}else{throw new Error(_0xcdc9('0x1c'));}}else{return _0x331d84;}}function respondWithRpcPromise(_0x423741,_0x40b3b6,_0x366f38,_0x210264){return new BPromise(function(_0x2bea5e,_0x2de901){var _0x4475d0=_0x210264||client;return _0x4475d0[_0xcdc9('0x1d')](_0x423741,_0x366f38)[_0xcdc9('0x1e')](function(_0xbe24e4){logger[_0xcdc9('0x1f')](_0xcdc9('0x20'),_0x40b3b6,_0xcdc9('0x21'));logger[_0xcdc9('0x22')](_0xcdc9('0x23'),_0x40b3b6,_0xcdc9('0x21'),JSON['stringify'](_0xbe24e4));if(_0xbe24e4[_0xcdc9('0x24')]){if(_0xbe24e4['error'][_0xcdc9('0x25')]===0x1f4){logger['error'](_0xcdc9('0x20'),_0x40b3b6,_0xbe24e4['error'][_0xcdc9('0x26')]);return _0x2de901(_0xbe24e4[_0xcdc9('0x24')]['message']);}logger[_0xcdc9('0x24')]('ChatQueue,\x20%s,\x20%s',_0x40b3b6,_0xbe24e4[_0xcdc9('0x24')][_0xcdc9('0x26')]);return _0x2bea5e(_0xbe24e4[_0xcdc9('0x24')][_0xcdc9('0x26')]);}else{logger['info'](_0xcdc9('0x20'),_0x40b3b6,'request\x20sent');_0x2bea5e(_0xbe24e4[_0xcdc9('0x27')]['message']);}})[_0xcdc9('0x28')](function(_0x2aa737){logger[_0xcdc9('0x24')](_0xcdc9('0x20'),_0x40b3b6,_0x2aa737);_0x2de901(_0x2aa737);});});}function respondWithStatusCode(_0xcb4789,_0x4973fe){_0x4973fe=_0x4973fe||0xcc;return function(_0xb453f9){if(_0xb453f9){return _0xcb4789[_0xcdc9('0x29')](_0x4973fe);}return _0xcb4789[_0xcdc9('0x2a')](_0x4973fe)['end']();};}function respondWithResult(_0x13d4ab,_0x6371f4){_0x6371f4=_0x6371f4||0xc8;return function(_0x110800){if(_0x110800){return _0x13d4ab['status'](_0x6371f4)['json'](_0x110800);}};}function respondWithFilteredResult(_0x35f93e,_0x4c8c2d){return function(_0xbad43f){if(_0xbad43f){var _0xe1ff8b=_0xbad43f[_0xcdc9('0x2b')],_0x487d5f=_0x4c8c2d[_0xcdc9('0x2c')],_0x13a56f=_0x4c8c2d['offset']+_0x4c8c2d['limit'],_0x169961;if(_0x13a56f>=_0xe1ff8b){_0x13a56f=_0xe1ff8b;_0x169961=0xc8;}else{_0x169961=0xce;}_0x35f93e[_0xcdc9('0x2a')](_0x169961);return _0x35f93e[_0xcdc9('0x2d')](_0xcdc9('0x2e'),_0x487d5f+'-'+_0x13a56f+'/'+_0xe1ff8b)[_0xcdc9('0x2f')](_0xbad43f);}return null;};}function patchUpdates(_0x233487){return function(_0x4fca63){try{jsonpatch[_0xcdc9('0x30')](_0x4fca63,_0x233487,!![]);}catch(_0x4a5f35){return BPromise['reject'](_0x4a5f35);}return _0x4fca63[_0xcdc9('0x31')]();};}function saveUpdates(_0x482de5,_0x104619){return function(_0x518ab6){if(_0x518ab6){return _0x518ab6[_0xcdc9('0x32')](_0x482de5)[_0xcdc9('0x1e')](function(_0x6f2939){return _0x6f2939;});}return null;};}function removeEntity(_0x4b1c4d,_0x2b9a69){return function(_0x223fcf){if(_0x223fcf){return _0x223fcf[_0xcdc9('0x33')]()[_0xcdc9('0x1e')](function(){var _0xe3dac6=_0x223fcf['get']({'plain':!![]});var _0x2238b7=_0xcdc9('0x34');return db[_0xcdc9('0x35')][_0xcdc9('0x33')]({'where':{'type':_0x2238b7,'resourceId':_0xe3dac6['id']}})['then'](function(){return _0x223fcf;});})[_0xcdc9('0x1e')](function(){_0x4b1c4d[_0xcdc9('0x2a')](0xcc)[_0xcdc9('0x36')]();});}};}function handleEntityNotFound(_0x19e959,_0x6b6b84){return function(_0x43b015){if(!_0x43b015){_0x19e959[_0xcdc9('0x29')](0x194);}return _0x43b015;};}function handleError(_0x1b1577,_0x4723d0){_0x4723d0=_0x4723d0||0x1f4;return function(_0x30558f){logger[_0xcdc9('0x24')](_0x30558f[_0xcdc9('0x37')]);if(_0x30558f[_0xcdc9('0x38')]){delete _0x30558f[_0xcdc9('0x38')];}_0x1b1577[_0xcdc9('0x2a')](_0x4723d0)[_0xcdc9('0x39')](_0x30558f);};}exports['index']=function(_0x86915a,_0x452c91){var _0xa8994d={},_0x208fec={},_0x8f083a={'count':0x0,'rows':[]};var _0x3886d5=db['ChatQueue'][_0xcdc9('0x3a')];_0x208fec[_0xcdc9('0x3b')]=_[_0xcdc9('0x3c')](_0x3886d5);_0x208fec[_0xcdc9('0x3d')]=_[_0xcdc9('0x3c')](_0x86915a[_0xcdc9('0x3d')]);_0x208fec[_0xcdc9('0x3e')]=_['intersection'](_0x208fec['model'],_0x208fec[_0xcdc9('0x3d')]);_0xa8994d[_0xcdc9('0x3f')]=_['intersection'](_0x208fec[_0xcdc9('0x3b')],qs[_0xcdc9('0x40')](_0x86915a[_0xcdc9('0x3d')]['fields']));_0xa8994d[_0xcdc9('0x3f')]=_0xa8994d[_0xcdc9('0x3f')]['length']?_0xa8994d[_0xcdc9('0x3f')]:_0x208fec[_0xcdc9('0x3b')];if(!_0x86915a[_0xcdc9('0x3d')][_0xcdc9('0x41')](_0xcdc9('0x42'))){_0xa8994d[_0xcdc9('0x43')]=qs[_0xcdc9('0x43')](_0x86915a[_0xcdc9('0x3d')][_0xcdc9('0x43')]);_0xa8994d['offset']=qs[_0xcdc9('0x2c')](_0x86915a['query'][_0xcdc9('0x2c')]);}_0xa8994d[_0xcdc9('0x44')]=qs[_0xcdc9('0x45')](_0x86915a[_0xcdc9('0x3d')][_0xcdc9('0x45')]);_0xa8994d['where']=qs[_0xcdc9('0x3e')](_[_0xcdc9('0x46')](_0x86915a['query'],_0x208fec['filters']));if(_0x86915a[_0xcdc9('0x3d')]['filter']){_0xa8994d['where']=_[_0xcdc9('0x47')](_0xa8994d[_0xcdc9('0x48')],{'$or':_[_0xcdc9('0x49')](_0x3886d5,function(_0x1250e7){if(_0x1250e7[_0xcdc9('0x4a')][_0xcdc9('0x4b')]!=='VIRTUAL'){var _0x5bb577={};_0x5bb577[_0x1250e7[_0xcdc9('0x4c')]]={'$like':'%'+_0x86915a[_0xcdc9('0x3d')][_0xcdc9('0x4d')]+'%'};return _0x5bb577;}})});}_0xa8994d=_['merge']({},_0xa8994d,_0x86915a['options']);var _0x37332b={'where':_0xa8994d['where']};return db[_0xcdc9('0x4e')]['count'](_0x37332b)[_0xcdc9('0x1e')](function(_0x2f11db){_0x8f083a['count']=_0x2f11db;if(_0x86915a[_0xcdc9('0x3d')]['includeAll']){_0xa8994d[_0xcdc9('0x4f')]=[{'all':!![]}];}return db[_0xcdc9('0x4e')][_0xcdc9('0x50')](_0xa8994d);})['then'](function(_0x1e4079){_0x8f083a[_0xcdc9('0x51')]=_0x1e4079;return _0x8f083a;})['then'](respondWithFilteredResult(_0x452c91,_0xa8994d))[_0xcdc9('0x28')](handleError(_0x452c91,null));};exports[_0xcdc9('0x52')]=function(_0x55a0cc,_0xce8f99){var _0x58604e={'raw':!![],'where':{'id':_0x55a0cc[_0xcdc9('0x53')]['id']}},_0x4d35b0={};_0x4d35b0['model']=_['keys'](db[_0xcdc9('0x4e')][_0xcdc9('0x3a')]);_0x4d35b0['query']=_[_0xcdc9('0x3c')](_0x55a0cc[_0xcdc9('0x3d')]);_0x4d35b0[_0xcdc9('0x3e')]=_['intersection'](_0x4d35b0[_0xcdc9('0x3b')],_0x4d35b0[_0xcdc9('0x3d')]);_0x58604e[_0xcdc9('0x3f')]=_['intersection'](_0x4d35b0[_0xcdc9('0x3b')],qs['fields'](_0x55a0cc[_0xcdc9('0x3d')][_0xcdc9('0x40')]));_0x58604e['attributes']=_0x58604e['attributes'][_0xcdc9('0x54')]?_0x58604e['attributes']:_0x4d35b0[_0xcdc9('0x3b')];if(_0x55a0cc['query']['includeAll']){_0x58604e['include']=[{'all':!![]}];}_0x58604e=_[_0xcdc9('0x47')]({},_0x58604e,_0x55a0cc['options']);return db[_0xcdc9('0x4e')]['find'](_0x58604e)[_0xcdc9('0x1e')](handleEntityNotFound(_0xce8f99,null))[_0xcdc9('0x1e')](respondWithResult(_0xce8f99,null))['catch'](handleError(_0xce8f99,null));};exports['create']=function(_0x4e6e1d,_0x24a07c){return db['ChatQueue'][_0xcdc9('0x55')](_0x4e6e1d[_0xcdc9('0x56')],{})['then'](function(_0x577323){var _0x306dd7=_0x4e6e1d[_0xcdc9('0x57')][_0xcdc9('0x58')]({'plain':!![]});if(!_0x306dd7)throw new Error(_0xcdc9('0x59'));if(_0x306dd7[_0xcdc9('0x5a')]==='user'){var _0x185b75=_0x577323['get']({'plain':!![]});var _0xbd379f=_0xcdc9('0x34');return db['UserProfileSection'][_0xcdc9('0x5b')]({'where':{'name':_0xbd379f,'userProfileId':_0x306dd7[_0xcdc9('0x5c')]},'raw':!![]})[_0xcdc9('0x1e')](function(_0x59d9d8){if(_0x59d9d8&&_0x59d9d8[_0xcdc9('0x5d')]===0x0){return db[_0xcdc9('0x35')][_0xcdc9('0x55')]({'name':_0x185b75[_0xcdc9('0x38')],'resourceId':_0x185b75['id'],'type':_0x59d9d8['name'],'sectionId':_0x59d9d8['id']},{})[_0xcdc9('0x1e')](function(){return _0x577323;});}else{return _0x577323;}})['catch'](function(_0x8dfb91){logger['error'](_0xcdc9('0x5e'),_0x8dfb91);throw _0x8dfb91;});}return _0x577323;})['then'](respondWithResult(_0x24a07c,0xc9))[_0xcdc9('0x28')](handleError(_0x24a07c,null));};exports[_0xcdc9('0x32')]=function(_0xc563ae,_0x434407){if(_0xc563ae[_0xcdc9('0x56')]['id']){delete _0xc563ae[_0xcdc9('0x56')]['id'];}return db[_0xcdc9('0x4e')][_0xcdc9('0x5b')]({'where':{'id':_0xc563ae[_0xcdc9('0x53')]['id']}})[_0xcdc9('0x1e')](handleEntityNotFound(_0x434407,null))[_0xcdc9('0x1e')](saveUpdates(_0xc563ae[_0xcdc9('0x56')],null))[_0xcdc9('0x1e')](respondWithResult(_0x434407,null))['catch'](handleError(_0x434407,null));};exports[_0xcdc9('0x33')]=function(_0x221af9,_0xa0e1eb){return db[_0xcdc9('0x4e')]['find']({'where':{'id':_0x221af9[_0xcdc9('0x53')]['id']}})[_0xcdc9('0x1e')](handleEntityNotFound(_0xa0e1eb,null))[_0xcdc9('0x1e')](removeEntity(_0xa0e1eb,null))[_0xcdc9('0x28')](handleError(_0xa0e1eb,null));};exports[_0xcdc9('0x5f')]=function(_0x857fb0,_0x19bb62){return db['ChatQueue'][_0xcdc9('0x5f')]()[_0xcdc9('0x1e')](respondWithResult(_0x19bb62,null))[_0xcdc9('0x28')](handleError(_0x19bb62,null));};exports[_0xcdc9('0x60')]=function(_0x59c3b5,_0x581e37,_0x31d0e8){var _0xb9815b={'raw':!![],'where':{}},_0x4397b8={},_0xaac0a8;return db[_0xcdc9('0x4e')]['findOne']({'where':{'id':_0x59c3b5[_0xcdc9('0x53')]['id']}})[_0xcdc9('0x1e')](handleEntityNotFound(_0x581e37,null))[_0xcdc9('0x1e')](function(_0xeb3d0a){if(_0xeb3d0a){_0xaac0a8=_0xeb3d0a[_0xcdc9('0x58')]({'plain':!![]});_0x4397b8[_0xcdc9('0x3b')]=_[_0xcdc9('0x3c')](db['UserChatQueue'][_0xcdc9('0x3a')]);_0x4397b8['query']=_['keys'](_0x59c3b5[_0xcdc9('0x3d')]);_0x4397b8['filters']=_[_0xcdc9('0x61')](_0x4397b8[_0xcdc9('0x3b')],_0x4397b8[_0xcdc9('0x3d')]);_0xb9815b[_0xcdc9('0x3f')]=_[_0xcdc9('0x61')](_0x4397b8[_0xcdc9('0x3b')],qs[_0xcdc9('0x40')](_0x59c3b5[_0xcdc9('0x3d')][_0xcdc9('0x40')]));_0xb9815b[_0xcdc9('0x3f')]=_0xb9815b[_0xcdc9('0x3f')][_0xcdc9('0x54')]?_0xb9815b['attributes']:_0x4397b8[_0xcdc9('0x3b')];if(!_0x59c3b5[_0xcdc9('0x3d')][_0xcdc9('0x41')]('nolimit')){_0xb9815b['limit']=qs[_0xcdc9('0x43')](_0x59c3b5[_0xcdc9('0x3d')]['limit']);_0xb9815b[_0xcdc9('0x2c')]=qs['offset'](_0x59c3b5[_0xcdc9('0x3d')][_0xcdc9('0x2c')]);}_0xb9815b[_0xcdc9('0x44')]=qs[_0xcdc9('0x45')](_0x59c3b5['query'][_0xcdc9('0x45')]);_0xb9815b[_0xcdc9('0x48')]=qs[_0xcdc9('0x3e')](_[_0xcdc9('0x46')](_0x59c3b5[_0xcdc9('0x3d')],_0x4397b8[_0xcdc9('0x3e')]));_0xb9815b[_0xcdc9('0x48')][_0xcdc9('0x62')]=_0xeb3d0a['id'];if(_0x59c3b5[_0xcdc9('0x3d')]['filter']){_0xb9815b[_0xcdc9('0x48')]=_[_0xcdc9('0x47')](_0xb9815b['where'],{'$or':_[_0xcdc9('0x49')](_0xb9815b[_0xcdc9('0x3f')],function(_0x543ddf){var _0x16d2d8={};_0x16d2d8[_0x543ddf]={'$like':'%'+_0x59c3b5[_0xcdc9('0x3d')][_0xcdc9('0x4d')]+'%'};return _0x16d2d8;})});}_0xb9815b=_[_0xcdc9('0x47')]({},_0xb9815b,_0x59c3b5[_0xcdc9('0x63')]);return db[_0xcdc9('0x64')][_0xcdc9('0x50')](_0xb9815b);}})[_0xcdc9('0x1e')](function(_0x1c0ac1){if(_0x1c0ac1){return db['User']['findAndCountAll']({'where':{'id':_[_0xcdc9('0x49')](_0x1c0ac1,_0xcdc9('0x65')),'role':'agent'},'attributes':['id',_0xcdc9('0x38'),'chatPause',_0xcdc9('0x66'),'createdAt']});}})[_0xcdc9('0x1e')](function(_0x230b04){if(_0x230b04){return{'count':_0x230b04[_0xcdc9('0x2b')],'rows':_[_0xcdc9('0x49')](_0x230b04['rows'],function(_0x588c4e){return{'membername':_0x588c4e[_0xcdc9('0x38')],'UserId':_0x588c4e['id'],'queue_name':_0xaac0a8[_0xcdc9('0x38')],'ChatQueueId':_0xaac0a8['id'],'interface':util[_0xcdc9('0x67')](_0xcdc9('0x68'),_0xcdc9('0x69'),_0x588c4e[_0xcdc9('0x38')]),'penalty':0x0,'paused':_0x588c4e[_0xcdc9('0x6a')],'createdAt':_0x588c4e['createdAt'],'updatedAt':_0x588c4e[_0xcdc9('0x66')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x581e37,_0xb9815b))[_0xcdc9('0x28')](handleError(_0x581e37,null));};exports[_0xcdc9('0x6b')]=function(_0x3a9022,_0x26af92,_0x5d12e9){var _0x567871={};var _0x53ab6a={};var _0x54f658;var _0x121f30;return db[_0xcdc9('0x4e')][_0xcdc9('0x6c')]({'where':{'id':_0x3a9022[_0xcdc9('0x53')]['id']}})[_0xcdc9('0x1e')](handleEntityNotFound(_0x26af92,null))['then'](function(_0x571e3f){if(_0x571e3f){_0x54f658=_0x571e3f;_0x53ab6a[_0xcdc9('0x3b')]=_[_0xcdc9('0x3c')](db[_0xcdc9('0x6d')]['rawAttributes']);_0x53ab6a[_0xcdc9('0x3d')]=_['keys'](_0x3a9022[_0xcdc9('0x3d')]);_0x53ab6a[_0xcdc9('0x3e')]=_['intersection'](_0x53ab6a[_0xcdc9('0x3b')],_0x53ab6a[_0xcdc9('0x3d')]);_0x567871['attributes']=_['intersection'](_0x53ab6a['model'],qs[_0xcdc9('0x40')](_0x3a9022['query'][_0xcdc9('0x40')]));_0x567871['attributes']=_0x567871['attributes'][_0xcdc9('0x54')]?_0x567871['attributes']:_0x53ab6a['model'];_0x567871[_0xcdc9('0x44')]=qs[_0xcdc9('0x45')](_0x3a9022['query'][_0xcdc9('0x45')]);_0x567871[_0xcdc9('0x48')]=qs[_0xcdc9('0x3e')](_['pick'](_0x3a9022[_0xcdc9('0x3d')],_0x53ab6a[_0xcdc9('0x3e')]));if(_0x3a9022[_0xcdc9('0x3d')][_0xcdc9('0x4d')]){_0x567871[_0xcdc9('0x48')]=_[_0xcdc9('0x47')](_0x567871['where'],{'$or':_[_0xcdc9('0x49')](_0x567871[_0xcdc9('0x3f')],function(_0x30c45d){var _0x2dac20={};_0x2dac20[_0x30c45d]={'$like':'%'+_0x3a9022[_0xcdc9('0x3d')][_0xcdc9('0x4d')]+'%'};return _0x2dac20;})});}_0x567871=_[_0xcdc9('0x47')]({},_0x567871,_0x3a9022['options']);return _0x54f658[_0xcdc9('0x6b')](_0x567871);}})[_0xcdc9('0x1e')](function(_0x377a56){if(_0x377a56){_0x121f30=_0x377a56[_0xcdc9('0x54')];if(!_0x3a9022[_0xcdc9('0x3d')][_0xcdc9('0x41')](_0xcdc9('0x42'))){_0x567871[_0xcdc9('0x43')]=qs['limit'](_0x3a9022[_0xcdc9('0x3d')]['limit']);_0x567871[_0xcdc9('0x2c')]=qs[_0xcdc9('0x2c')](_0x3a9022['query'][_0xcdc9('0x2c')]);}return _0x54f658[_0xcdc9('0x6b')](_0x567871);}})[_0xcdc9('0x1e')](function(_0x1e1a33){if(_0x1e1a33){return _0x1e1a33?{'count':_0x121f30,'rows':_0x1e1a33}:null;}})['then'](respondWithResult(_0x26af92,null))[_0xcdc9('0x28')](handleError(_0x26af92,null));};exports[_0xcdc9('0x6e')]=function(_0x5c518f,_0x40623b,_0x1e47a9){var _0x5a7c7b=_0x5c518f[_0xcdc9('0x56')][_0xcdc9('0x6f')];return db[_0xcdc9('0x6d')][_0xcdc9('0x50')]({'where':{'id':_0x5a7c7b},'attributes':['id'],'include':[{'model':db[_0xcdc9('0x70')],'as':_0xcdc9('0x71'),'attributes':['id',_0xcdc9('0x38'),_0xcdc9('0x72'),_0xcdc9('0x73'),'interface'],'raw':!![]}]})[_0xcdc9('0x1e')](function(_0x39357e){if(_0x39357e){var _0x4893ee=_['flatMap'](_0x39357e,function(_0x3fc5d1){var _0x34c880=_0x3fc5d1[_0xcdc9('0x58')]({'plain':!![]});return _0x34c880[_0xcdc9('0x71')];});return db[_0xcdc9('0x4e')]['find']({'where':{'id':_0x5c518f['params']['id']}})[_0xcdc9('0x1e')](function(_0x287c22){return db['sequelize'][_0xcdc9('0x74')](function(_0x3e3a62){return _0x287c22[_0xcdc9('0x6e')](_0x5a7c7b,{'transaction':_0x3e3a62})[_0xcdc9('0x1e')](function(){return BPromise[_0xcdc9('0x75')](_0x4893ee,function(_0x46fb11){return db['UserChatQueue']['findOrCreate']({'where':{'UserId':_0x46fb11['id'],'ChatQueueId':_0x5c518f['params']['id']},'transaction':_0x3e3a62});});})[_0xcdc9('0x1e')](function(){_0x4893ee[_0xcdc9('0x76')](function(_0x975c8){socket[_0xcdc9('0x77')](_0xcdc9('0x78'),{'UserId':_0x975c8['id'],'ChatQueueId':_0x287c22['id']});});});});});}})[_0xcdc9('0x1e')](respondWithStatusCode(_0x40623b,null))[_0xcdc9('0x28')](handleError(_0x40623b,null));};exports['removeTeams']=function(_0x914631,_0x2e9d04,_0x5924e7){return db[_0xcdc9('0x6d')][_0xcdc9('0x50')]({'where':{'id':_0x914631['query']['ids']},'attributes':['id'],'include':[{'model':db[_0xcdc9('0x70')],'as':_0xcdc9('0x71'),'attributes':['id'],'raw':!![]}]})[_0xcdc9('0x1e')](handleEntityNotFound(_0x2e9d04,null))[_0xcdc9('0x1e')](function(_0x226f3e){var _0x56af09=_[_0xcdc9('0x49')](_0x226f3e,'id');var _0x356f8f=[];var _0x3454f6=[];var _0x245849=squel[_0xcdc9('0x79')]();_0x245849[_0xcdc9('0x4c')]('tq.TeamId')['from']('team_has_chat_queues','tq')[_0xcdc9('0x7a')](_0xcdc9('0x7b'),'ut',_0xcdc9('0x7c'))[_0xcdc9('0x48')](_0xcdc9('0x7d'),_0x914631['params']['id']);for(var _0x523c64=0x0;_0x523c64<_0x226f3e[_0xcdc9('0x54')];_0x523c64+=0x1){let _0x444059=_0x226f3e[_0x523c64];for(var _0x41c08f=0x0;_0x41c08f<_0x444059['Agents']['length'];_0x41c08f+=0x1){let _0x297d41=_0x444059['Agents'][_0x41c08f];var _0x6e0434=_0x245849['clone']();_0x6e0434['where'](_0xcdc9('0x7e'),_0x297d41['id']);_0x3454f6[_0xcdc9('0x7f')](db[_0xcdc9('0x80')][_0xcdc9('0x3d')](_0x6e0434[_0xcdc9('0x81')](),{'type':db[_0xcdc9('0x80')][_0xcdc9('0x82')]['SELECT']})[_0xcdc9('0x1e')](function(_0x4b748f){if(_0x4b748f[_0xcdc9('0x54')]===0x1){return _0x297d41['id'];}else{var _0x4b2d71=_[_0xcdc9('0x83')](_[_0xcdc9('0x49')](_0x4b748f,_0xcdc9('0x84')),function(_0x2a4a76){return _[_0xcdc9('0x85')](_0x56af09,_0x2a4a76);});if(_0x4b2d71){return _0x297d41['id'];}}}));}}return BPromise[_0xcdc9('0x86')](_0x3454f6)[_0xcdc9('0x1e')](function(_0x1324d1){_0x356f8f=_(_0x356f8f)['union'](_0x1324d1)[_0xcdc9('0x87')]()[_0xcdc9('0x88')]();return db['ChatQueue']['find']({'where':{'id':_0x914631[_0xcdc9('0x53')]['id']}})[_0xcdc9('0x1e')](function(_0x6ffaaa){return db['sequelize']['transaction'](function(_0x286fbd){return _0x6ffaaa['removeTeams'](_0x914631[_0xcdc9('0x3d')][_0xcdc9('0x6f')],{'transaction':_0x286fbd})['then'](function(){if(!_['isEmpty'](_0x356f8f)){return _0x6ffaaa[_0xcdc9('0x89')](_0x356f8f,{'transaction':_0x286fbd});}})['then'](function(){_0x356f8f[_0xcdc9('0x76')](function(_0xe9cff8){socket[_0xcdc9('0x77')](_0xcdc9('0x8a'),{'UserId':_0xe9cff8,'ChatQueueId':_0x6ffaaa['id']});});});});});});})[_0xcdc9('0x1e')](respondWithStatusCode(_0x2e9d04,null))[_0xcdc9('0x28')](handleError(_0x2e9d04,null));};exports[_0xcdc9('0x8b')]=function(_0x26d035,_0x24539d,_0x4b6c51){return db['ChatQueue'][_0xcdc9('0x5b')]({'where':{'id':_0x26d035[_0xcdc9('0x53')]['id']}})['then'](handleEntityNotFound(_0x24539d,null))[_0xcdc9('0x1e')](function(_0x35cacf){if(_0x35cacf){return _0x35cacf[_0xcdc9('0x8b')](_0x26d035[_0xcdc9('0x56')][_0xcdc9('0x6f')],_[_0xcdc9('0x8c')](_0x26d035[_0xcdc9('0x56')],[_0xcdc9('0x6f'),'id'])||{})[_0xcdc9('0x8d')](function(_0x10a01d){for(var _0x2e6185=0x0;_0x2e6185<_0x26d035[_0xcdc9('0x56')][_0xcdc9('0x6f')]['length'];_0x2e6185+=0x1){socket[_0xcdc9('0x77')]('userChatQueue:save',{'UserId':_0x26d035[_0xcdc9('0x56')][_0xcdc9('0x6f')][_0x2e6185],'ChatQueueId':_0x26d035[_0xcdc9('0x53')]['id']});}return _0x10a01d;});}})[_0xcdc9('0x1e')](respondWithResult(_0x24539d,null))['catch'](handleError(_0x24539d,null));};exports[_0xcdc9('0x89')]=function(_0x99d96b,_0x586a2f,_0x5e676c){return db[_0xcdc9('0x4e')][_0xcdc9('0x5b')]({'where':{'id':_0x99d96b[_0xcdc9('0x53')]['id']}})[_0xcdc9('0x1e')](handleEntityNotFound(_0x586a2f,null))['then'](function(_0x65b951){if(_0x65b951){return _0x65b951[_0xcdc9('0x89')](_0x99d96b['query'][_0xcdc9('0x6f')])[_0xcdc9('0x1e')](function(){if(_['isArray'](_0x99d96b[_0xcdc9('0x3d')]['ids'])){for(var _0x534130=0x0;_0x534130<_0x99d96b[_0xcdc9('0x3d')][_0xcdc9('0x6f')][_0xcdc9('0x54')];_0x534130+=0x1){socket[_0xcdc9('0x77')]('userChatQueue:remove',{'UserId':Number(_0x99d96b[_0xcdc9('0x3d')][_0xcdc9('0x6f')][_0x534130]),'ChatQueueId':Number(_0x99d96b[_0xcdc9('0x53')]['id'])});}}else{socket[_0xcdc9('0x77')](_0xcdc9('0x8a'),{'UserId':Number(_0x99d96b['query']['ids']),'ChatQueueId':Number(_0x99d96b[_0xcdc9('0x53')]['id'])});}});}})['then'](respondWithStatusCode(_0x586a2f,null))['catch'](handleError(_0x586a2f,null));};exports[_0xcdc9('0x8e')]=function(_0x2cc644,_0x18c2b9,_0x341d2b){var _0x272648={};var _0xd88782={};var _0x11c90e;var _0x7a9a27;return db[_0xcdc9('0x4e')][_0xcdc9('0x6c')]({'where':{'id':_0x2cc644[_0xcdc9('0x53')]['id']}})[_0xcdc9('0x1e')](handleEntityNotFound(_0x18c2b9,null))['then'](function(_0x820eff){if(_0x820eff){_0x11c90e=_0x820eff;_0xd88782[_0xcdc9('0x3b')]=_[_0xcdc9('0x3c')](db[_0xcdc9('0x70')][_0xcdc9('0x3a')]);_0xd88782[_0xcdc9('0x3d')]=_[_0xcdc9('0x3c')](_0x2cc644[_0xcdc9('0x3d')]);_0xd88782[_0xcdc9('0x3e')]=_[_0xcdc9('0x61')](_0xd88782[_0xcdc9('0x3b')],_0xd88782[_0xcdc9('0x3d')]);_0x272648[_0xcdc9('0x3f')]=_['intersection'](_0xd88782[_0xcdc9('0x3b')],qs[_0xcdc9('0x40')](_0x2cc644[_0xcdc9('0x3d')][_0xcdc9('0x40')]));_0x272648['attributes']=_0x272648[_0xcdc9('0x3f')]['length']?_0x272648['attributes']:_0xd88782[_0xcdc9('0x3b')];_0x272648[_0xcdc9('0x44')]=qs[_0xcdc9('0x45')](_0x2cc644[_0xcdc9('0x3d')][_0xcdc9('0x45')]);_0x272648[_0xcdc9('0x48')]=qs[_0xcdc9('0x3e')](_['pick'](_0x2cc644['query'],_0xd88782[_0xcdc9('0x3e')]));if(_0x2cc644[_0xcdc9('0x3d')][_0xcdc9('0x4d')]){_0x272648[_0xcdc9('0x48')]=_['merge'](_0x272648[_0xcdc9('0x48')],{'$or':_[_0xcdc9('0x49')](_0x272648[_0xcdc9('0x3f')],function(_0x46e8da){var _0xb443b1={};_0xb443b1[_0x46e8da]={'$like':'%'+_0x2cc644[_0xcdc9('0x3d')][_0xcdc9('0x4d')]+'%'};return _0xb443b1;})});}_0x272648=_[_0xcdc9('0x47')]({},_0x272648,_0x2cc644[_0xcdc9('0x63')]);return _0x11c90e[_0xcdc9('0x8e')](_0x272648);}})[_0xcdc9('0x1e')](function(_0x4a1573){if(_0x4a1573){_0x7a9a27=_0x4a1573[_0xcdc9('0x54')];if(!_0x2cc644['query']['hasOwnProperty'](_0xcdc9('0x42'))){_0x272648['limit']=qs[_0xcdc9('0x43')](_0x2cc644['query'][_0xcdc9('0x43')]);_0x272648[_0xcdc9('0x2c')]=qs[_0xcdc9('0x2c')](_0x2cc644[_0xcdc9('0x3d')]['offset']);}return _0x11c90e[_0xcdc9('0x8e')](_0x272648);}})['then'](function(_0x244f04){if(_0x244f04){return _0x244f04?{'count':_0x7a9a27,'rows':_0x244f04}:null;}})[_0xcdc9('0x1e')](respondWithResult(_0x18c2b9,null))[_0xcdc9('0x28')](handleError(_0x18c2b9,null));}; \ No newline at end of file +var _0xf6ab=['stack','name','send','index','model','keys','query','intersection','attributes','length','hasOwnProperty','nolimit','limit','order','sort','filters','pick','filter','where','merge','map','type','key','VIRTUAL','field','options','ChatQueue','count','include','findAll','catch','show','params','fields','includeAll','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','describe','getMembers','UserChatQueue','rawAttributes','ChatQueueId','User','UserId','agent','chatPause','createdAt','rows','format','%s/%s','getTeams','Team','addTeams','ids','Agents','online','voicePause','interface','transaction','each','findOrCreate','emit','userChatQueue:save','select','tq.TeamId','from','team_has_chat_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','sequelize','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','value','removeTeams','isEmpty','removeAgents','forEach','userChatQueue:remove','addAgents','omit','spread','isArray','getAgents','findOne','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./chatQueue.socket','register','client','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','request\x20sent','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatQueue,\x20%s,\x20%s','message','result','status','end','json','offset','Content-Range','save','update','destroy','get','ChatQueues','UserProfileResource'];(function(_0x499210,_0x325b29){var _0x2e153d=function(_0x951263){while(--_0x951263){_0x499210['push'](_0x499210['shift']());}};_0x2e153d(++_0x325b29);}(_0xf6ab,0xfe));var _0xbf6a=function(_0x11054b,_0x353e1a){_0x11054b=_0x11054b-0x0;var _0x21a096=_0xf6ab[_0x11054b];return _0x21a096;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0xbf6a('0x0'));var zipdir=require(_0xbf6a('0x1'));var jsonpatch=require(_0xbf6a('0x2'));var rp=require(_0xbf6a('0x3'));var moment=require('moment');var BPromise=require(_0xbf6a('0x4'));var Mustache=require('mustache');var util=require(_0xbf6a('0x5'));var path=require(_0xbf6a('0x6'));var sox=require('sox');var csv=require(_0xbf6a('0x7'));var ejs=require(_0xbf6a('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0xbf6a('0x9'));var crypto=require(_0xbf6a('0xa'));var jsforce=require(_0xbf6a('0xb'));var deskjs=require(_0xbf6a('0xc'));var toCsv=require(_0xbf6a('0x7'));var querystring=require(_0xbf6a('0xd'));var Papa=require(_0xbf6a('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbf6a('0xf'));var logger=require(_0xbf6a('0x10'))(_0xbf6a('0x11'));var utils=require(_0xbf6a('0x12'));var config=require(_0xbf6a('0x13'));var db=require(_0xbf6a('0x14'))['db'];config['redis']=_[_0xbf6a('0x15')](config[_0xbf6a('0x16')],{'host':_0xbf6a('0x17'),'port':0x18eb});var socket=require(_0xbf6a('0x18'))(new Redis(config[_0xbf6a('0x16')]));require(_0xbf6a('0x19'))[_0xbf6a('0x1a')](socket);var jayson=require('jayson/promise');var client=jayson[_0xbf6a('0x1b')]['http']({'port':0x232a});function checkPasswordPattern(_0x40a16a,_0x320e41,_0x1ba266){if(_0x1ba266){var _0x225d7c=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x225d7c[_0xbf6a('0x1c')](_0x320e41)){return _0x40a16a;}else{throw new Error(_0xbf6a('0x1d'));}}else{return _0x40a16a;}}function respondWithRpcPromise(_0x9572b8,_0x44f45b,_0x59334e,_0xc2555b){return new BPromise(function(_0x1fc1ce,_0x41b005){var _0x1b67a2=_0xc2555b||client;return _0x1b67a2[_0xbf6a('0x1e')](_0x9572b8,_0x59334e)[_0xbf6a('0x1f')](function(_0x559530){logger[_0xbf6a('0x20')]('ChatQueue,\x20%s,\x20%s',_0x44f45b,_0xbf6a('0x21'));logger['debug'](_0xbf6a('0x22'),_0x44f45b,_0xbf6a('0x21'),JSON[_0xbf6a('0x23')](_0x559530));if(_0x559530['error']){if(_0x559530[_0xbf6a('0x24')][_0xbf6a('0x25')]===0x1f4){logger[_0xbf6a('0x24')](_0xbf6a('0x26'),_0x44f45b,_0x559530[_0xbf6a('0x24')][_0xbf6a('0x27')]);return _0x41b005(_0x559530[_0xbf6a('0x24')][_0xbf6a('0x27')]);}logger['error']('ChatQueue,\x20%s,\x20%s',_0x44f45b,_0x559530[_0xbf6a('0x24')][_0xbf6a('0x27')]);return _0x1fc1ce(_0x559530[_0xbf6a('0x24')][_0xbf6a('0x27')]);}else{logger[_0xbf6a('0x20')](_0xbf6a('0x26'),_0x44f45b,_0xbf6a('0x21'));_0x1fc1ce(_0x559530[_0xbf6a('0x28')][_0xbf6a('0x27')]);}})['catch'](function(_0xfcf884){logger[_0xbf6a('0x24')]('ChatQueue,\x20%s,\x20%s',_0x44f45b,_0xfcf884);_0x41b005(_0xfcf884);});});}function respondWithStatusCode(_0x4aa804,_0x4484cf){_0x4484cf=_0x4484cf||0xcc;return function(_0xdad428){if(_0xdad428){return _0x4aa804['sendStatus'](_0x4484cf);}return _0x4aa804[_0xbf6a('0x29')](_0x4484cf)[_0xbf6a('0x2a')]();};}function respondWithResult(_0x4a6b6b,_0x5322f2){_0x5322f2=_0x5322f2||0xc8;return function(_0x4f1178){if(_0x4f1178){return _0x4a6b6b[_0xbf6a('0x29')](_0x5322f2)[_0xbf6a('0x2b')](_0x4f1178);}};}function respondWithFilteredResult(_0x8fe541,_0x4a5c8e){return function(_0x4cbfe9){if(_0x4cbfe9){var _0x57f8ed=_0x4cbfe9['count'],_0xbb6e43=_0x4a5c8e[_0xbf6a('0x2c')],_0x1b6928=_0x4a5c8e[_0xbf6a('0x2c')]+_0x4a5c8e['limit'],_0x481636;if(_0x1b6928>=_0x57f8ed){_0x1b6928=_0x57f8ed;_0x481636=0xc8;}else{_0x481636=0xce;}_0x8fe541[_0xbf6a('0x29')](_0x481636);return _0x8fe541['set'](_0xbf6a('0x2d'),_0xbb6e43+'-'+_0x1b6928+'/'+_0x57f8ed)[_0xbf6a('0x2b')](_0x4cbfe9);}return null;};}function patchUpdates(_0x356afa){return function(_0x9f6df9){try{jsonpatch['apply'](_0x9f6df9,_0x356afa,!![]);}catch(_0xce2469){return BPromise['reject'](_0xce2469);}return _0x9f6df9[_0xbf6a('0x2e')]();};}function saveUpdates(_0x2ede2e,_0x501358){return function(_0x191b21){if(_0x191b21){return _0x191b21[_0xbf6a('0x2f')](_0x2ede2e)[_0xbf6a('0x1f')](function(_0x55e407){return _0x55e407;});}return null;};}function removeEntity(_0x5109a4,_0x190c01){return function(_0x2d7bb6){if(_0x2d7bb6){return _0x2d7bb6[_0xbf6a('0x30')]()[_0xbf6a('0x1f')](function(){var _0x35e4c6=_0x2d7bb6[_0xbf6a('0x31')]({'plain':!![]});var _0x37d7b0=_0xbf6a('0x32');return db[_0xbf6a('0x33')][_0xbf6a('0x30')]({'where':{'type':_0x37d7b0,'resourceId':_0x35e4c6['id']}})['then'](function(){return _0x2d7bb6;});})[_0xbf6a('0x1f')](function(){_0x5109a4[_0xbf6a('0x29')](0xcc)[_0xbf6a('0x2a')]();});}};}function handleEntityNotFound(_0x274f95,_0x4cac0f){return function(_0x319f56){if(!_0x319f56){_0x274f95['sendStatus'](0x194);}return _0x319f56;};}function handleError(_0x15bb10,_0x534c22){_0x534c22=_0x534c22||0x1f4;return function(_0x596986){logger[_0xbf6a('0x24')](_0x596986[_0xbf6a('0x34')]);if(_0x596986[_0xbf6a('0x35')]){delete _0x596986['name'];}_0x15bb10[_0xbf6a('0x29')](_0x534c22)[_0xbf6a('0x36')](_0x596986);};}exports[_0xbf6a('0x37')]=function(_0x778336,_0x92ade6){var _0x558064={},_0x483e66={},_0x538e7d={'count':0x0,'rows':[]};var _0x10d405=db['ChatQueue']['rawAttributes'];_0x483e66[_0xbf6a('0x38')]=_['keys'](_0x10d405);_0x483e66['query']=_[_0xbf6a('0x39')](_0x778336[_0xbf6a('0x3a')]);_0x483e66['filters']=_[_0xbf6a('0x3b')](_0x483e66[_0xbf6a('0x38')],_0x483e66[_0xbf6a('0x3a')]);_0x558064[_0xbf6a('0x3c')]=_[_0xbf6a('0x3b')](_0x483e66[_0xbf6a('0x38')],qs['fields'](_0x778336['query']['fields']));_0x558064[_0xbf6a('0x3c')]=_0x558064[_0xbf6a('0x3c')][_0xbf6a('0x3d')]?_0x558064[_0xbf6a('0x3c')]:_0x483e66['model'];if(!_0x778336[_0xbf6a('0x3a')][_0xbf6a('0x3e')](_0xbf6a('0x3f'))){_0x558064[_0xbf6a('0x40')]=qs['limit'](_0x778336['query']['limit']);_0x558064[_0xbf6a('0x2c')]=qs[_0xbf6a('0x2c')](_0x778336[_0xbf6a('0x3a')]['offset']);}_0x558064[_0xbf6a('0x41')]=qs[_0xbf6a('0x42')](_0x778336[_0xbf6a('0x3a')][_0xbf6a('0x42')]);_0x558064['where']=qs[_0xbf6a('0x43')](_[_0xbf6a('0x44')](_0x778336[_0xbf6a('0x3a')],_0x483e66[_0xbf6a('0x43')]));if(_0x778336[_0xbf6a('0x3a')][_0xbf6a('0x45')]){_0x558064[_0xbf6a('0x46')]=_[_0xbf6a('0x47')](_0x558064[_0xbf6a('0x46')],{'$or':_[_0xbf6a('0x48')](_0x10d405,function(_0x194876){if(_0x194876[_0xbf6a('0x49')][_0xbf6a('0x4a')]!==_0xbf6a('0x4b')){var _0x536365={};_0x536365[_0x194876[_0xbf6a('0x4c')]]={'$like':'%'+_0x778336[_0xbf6a('0x3a')]['filter']+'%'};return _0x536365;}})});}_0x558064=_[_0xbf6a('0x47')]({},_0x558064,_0x778336[_0xbf6a('0x4d')]);var _0x14d532={'where':_0x558064[_0xbf6a('0x46')]};return db[_0xbf6a('0x4e')][_0xbf6a('0x4f')](_0x14d532)[_0xbf6a('0x1f')](function(_0x3ab7f1){_0x538e7d[_0xbf6a('0x4f')]=_0x3ab7f1;if(_0x778336[_0xbf6a('0x3a')]['includeAll']){_0x558064[_0xbf6a('0x50')]=[{'all':!![]}];}return db[_0xbf6a('0x4e')][_0xbf6a('0x51')](_0x558064);})[_0xbf6a('0x1f')](function(_0xde9dea){_0x538e7d['rows']=_0xde9dea;return _0x538e7d;})['then'](respondWithFilteredResult(_0x92ade6,_0x558064))[_0xbf6a('0x52')](handleError(_0x92ade6,null));};exports[_0xbf6a('0x53')]=function(_0x52e5c7,_0x25d036){var _0x89d1cb={'raw':!![],'where':{'id':_0x52e5c7[_0xbf6a('0x54')]['id']}},_0x479763={};_0x479763[_0xbf6a('0x38')]=_['keys'](db[_0xbf6a('0x4e')]['rawAttributes']);_0x479763[_0xbf6a('0x3a')]=_[_0xbf6a('0x39')](_0x52e5c7[_0xbf6a('0x3a')]);_0x479763[_0xbf6a('0x43')]=_[_0xbf6a('0x3b')](_0x479763[_0xbf6a('0x38')],_0x479763['query']);_0x89d1cb['attributes']=_['intersection'](_0x479763['model'],qs[_0xbf6a('0x55')](_0x52e5c7[_0xbf6a('0x3a')][_0xbf6a('0x55')]));_0x89d1cb[_0xbf6a('0x3c')]=_0x89d1cb['attributes']['length']?_0x89d1cb['attributes']:_0x479763[_0xbf6a('0x38')];if(_0x52e5c7[_0xbf6a('0x3a')][_0xbf6a('0x56')]){_0x89d1cb[_0xbf6a('0x50')]=[{'all':!![]}];}_0x89d1cb=_[_0xbf6a('0x47')]({},_0x89d1cb,_0x52e5c7[_0xbf6a('0x4d')]);return db[_0xbf6a('0x4e')]['find'](_0x89d1cb)[_0xbf6a('0x1f')](handleEntityNotFound(_0x25d036,null))[_0xbf6a('0x1f')](respondWithResult(_0x25d036,null))[_0xbf6a('0x52')](handleError(_0x25d036,null));};exports['create']=function(_0x5e6d0a,_0x2ceeeb){return db['ChatQueue'][_0xbf6a('0x57')](_0x5e6d0a[_0xbf6a('0x58')],{})[_0xbf6a('0x1f')](function(_0x572c6b){var _0x3b1e7e=_0x5e6d0a[_0xbf6a('0x59')][_0xbf6a('0x31')]({'plain':!![]});if(!_0x3b1e7e)throw new Error(_0xbf6a('0x5a'));if(_0x3b1e7e[_0xbf6a('0x5b')]===_0xbf6a('0x59')){var _0x1642de=_0x572c6b[_0xbf6a('0x31')]({'plain':!![]});var _0x246570=_0xbf6a('0x32');return db[_0xbf6a('0x5c')][_0xbf6a('0x5d')]({'where':{'name':_0x246570,'userProfileId':_0x3b1e7e[_0xbf6a('0x5e')]},'raw':!![]})[_0xbf6a('0x1f')](function(_0x28b642){if(_0x28b642&&_0x28b642[_0xbf6a('0x5f')]===0x0){return db[_0xbf6a('0x33')][_0xbf6a('0x57')]({'name':_0x1642de[_0xbf6a('0x35')],'resourceId':_0x1642de['id'],'type':_0x28b642['name'],'sectionId':_0x28b642['id']},{})[_0xbf6a('0x1f')](function(){return _0x572c6b;});}else{return _0x572c6b;}})[_0xbf6a('0x52')](function(_0x200ca8){logger[_0xbf6a('0x24')](_0xbf6a('0x60'),_0x200ca8);throw _0x200ca8;});}return _0x572c6b;})['then'](respondWithResult(_0x2ceeeb,0xc9))['catch'](handleError(_0x2ceeeb,null));};exports[_0xbf6a('0x2f')]=function(_0x79d0f9,_0x1a4348){if(_0x79d0f9[_0xbf6a('0x58')]['id']){delete _0x79d0f9[_0xbf6a('0x58')]['id'];}return db[_0xbf6a('0x4e')][_0xbf6a('0x5d')]({'where':{'id':_0x79d0f9[_0xbf6a('0x54')]['id']}})[_0xbf6a('0x1f')](handleEntityNotFound(_0x1a4348,null))['then'](saveUpdates(_0x79d0f9['body'],null))[_0xbf6a('0x1f')](respondWithResult(_0x1a4348,null))[_0xbf6a('0x52')](handleError(_0x1a4348,null));};exports[_0xbf6a('0x30')]=function(_0x4e9f2f,_0x2690a6){return db[_0xbf6a('0x4e')][_0xbf6a('0x5d')]({'where':{'id':_0x4e9f2f[_0xbf6a('0x54')]['id']}})[_0xbf6a('0x1f')](handleEntityNotFound(_0x2690a6,null))[_0xbf6a('0x1f')](removeEntity(_0x2690a6,null))[_0xbf6a('0x52')](handleError(_0x2690a6,null));};exports[_0xbf6a('0x61')]=function(_0xd2177a,_0x53cbf8){return db[_0xbf6a('0x4e')][_0xbf6a('0x61')]()[_0xbf6a('0x1f')](respondWithResult(_0x53cbf8,null))['catch'](handleError(_0x53cbf8,null));};exports[_0xbf6a('0x62')]=function(_0x543c72,_0x2d8fd9,_0xf3d988){var _0x3b6487={'raw':!![],'where':{}},_0x34b7c2={},_0x453301;return db[_0xbf6a('0x4e')]['findOne']({'where':{'id':_0x543c72[_0xbf6a('0x54')]['id']}})[_0xbf6a('0x1f')](handleEntityNotFound(_0x2d8fd9,null))['then'](function(_0x568ce6){if(_0x568ce6){_0x453301=_0x568ce6[_0xbf6a('0x31')]({'plain':!![]});_0x34b7c2[_0xbf6a('0x38')]=_['keys'](db[_0xbf6a('0x63')][_0xbf6a('0x64')]);_0x34b7c2[_0xbf6a('0x3a')]=_[_0xbf6a('0x39')](_0x543c72[_0xbf6a('0x3a')]);_0x34b7c2[_0xbf6a('0x43')]=_[_0xbf6a('0x3b')](_0x34b7c2[_0xbf6a('0x38')],_0x34b7c2[_0xbf6a('0x3a')]);_0x3b6487[_0xbf6a('0x3c')]=_[_0xbf6a('0x3b')](_0x34b7c2[_0xbf6a('0x38')],qs[_0xbf6a('0x55')](_0x543c72[_0xbf6a('0x3a')][_0xbf6a('0x55')]));_0x3b6487[_0xbf6a('0x3c')]=_0x3b6487[_0xbf6a('0x3c')][_0xbf6a('0x3d')]?_0x3b6487['attributes']:_0x34b7c2['model'];if(!_0x543c72[_0xbf6a('0x3a')]['hasOwnProperty'](_0xbf6a('0x3f'))){_0x3b6487[_0xbf6a('0x40')]=qs[_0xbf6a('0x40')](_0x543c72[_0xbf6a('0x3a')][_0xbf6a('0x40')]);_0x3b6487[_0xbf6a('0x2c')]=qs[_0xbf6a('0x2c')](_0x543c72[_0xbf6a('0x3a')]['offset']);}_0x3b6487[_0xbf6a('0x41')]=qs[_0xbf6a('0x42')](_0x543c72[_0xbf6a('0x3a')]['sort']);_0x3b6487[_0xbf6a('0x46')]=qs['filters'](_[_0xbf6a('0x44')](_0x543c72[_0xbf6a('0x3a')],_0x34b7c2[_0xbf6a('0x43')]));_0x3b6487[_0xbf6a('0x46')][_0xbf6a('0x65')]=_0x568ce6['id'];if(_0x543c72[_0xbf6a('0x3a')][_0xbf6a('0x45')]){_0x3b6487[_0xbf6a('0x46')]=_[_0xbf6a('0x47')](_0x3b6487['where'],{'$or':_['map'](_0x3b6487[_0xbf6a('0x3c')],function(_0x5f2dff){var _0x2a3122={};_0x2a3122[_0x5f2dff]={'$like':'%'+_0x543c72[_0xbf6a('0x3a')][_0xbf6a('0x45')]+'%'};return _0x2a3122;})});}_0x3b6487=_[_0xbf6a('0x47')]({},_0x3b6487,_0x543c72[_0xbf6a('0x4d')]);return db['UserChatQueue']['findAll'](_0x3b6487);}})['then'](function(_0x2161ee){if(_0x2161ee){return db[_0xbf6a('0x66')]['findAndCountAll']({'where':{'id':_['map'](_0x2161ee,_0xbf6a('0x67')),'role':_0xbf6a('0x68')},'attributes':['id','name',_0xbf6a('0x69'),'updatedAt',_0xbf6a('0x6a')]});}})['then'](function(_0x22386e){if(_0x22386e){return{'count':_0x22386e['count'],'rows':_[_0xbf6a('0x48')](_0x22386e[_0xbf6a('0x6b')],function(_0x2cebc0){return{'membername':_0x2cebc0[_0xbf6a('0x35')],'UserId':_0x2cebc0['id'],'queue_name':_0x453301[_0xbf6a('0x35')],'ChatQueueId':_0x453301['id'],'interface':util[_0xbf6a('0x6c')](_0xbf6a('0x6d'),'SIP',_0x2cebc0['name']),'penalty':0x0,'paused':_0x2cebc0[_0xbf6a('0x69')],'createdAt':_0x2cebc0[_0xbf6a('0x6a')],'updatedAt':_0x2cebc0['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0xbf6a('0x1f')](respondWithFilteredResult(_0x2d8fd9,_0x3b6487))[_0xbf6a('0x52')](handleError(_0x2d8fd9,null));};exports[_0xbf6a('0x6e')]=function(_0x3ec344,_0x723250,_0x369dbc){var _0x1b2ee2={};var _0x9079e8={};var _0x42f9f7;var _0x352924;return db[_0xbf6a('0x4e')]['findOne']({'where':{'id':_0x3ec344[_0xbf6a('0x54')]['id']}})[_0xbf6a('0x1f')](handleEntityNotFound(_0x723250,null))[_0xbf6a('0x1f')](function(_0x309dda){if(_0x309dda){_0x42f9f7=_0x309dda;_0x9079e8[_0xbf6a('0x38')]=_[_0xbf6a('0x39')](db[_0xbf6a('0x6f')][_0xbf6a('0x64')]);_0x9079e8[_0xbf6a('0x3a')]=_[_0xbf6a('0x39')](_0x3ec344[_0xbf6a('0x3a')]);_0x9079e8['filters']=_[_0xbf6a('0x3b')](_0x9079e8['model'],_0x9079e8[_0xbf6a('0x3a')]);_0x1b2ee2['attributes']=_[_0xbf6a('0x3b')](_0x9079e8[_0xbf6a('0x38')],qs[_0xbf6a('0x55')](_0x3ec344[_0xbf6a('0x3a')][_0xbf6a('0x55')]));_0x1b2ee2['attributes']=_0x1b2ee2[_0xbf6a('0x3c')]['length']?_0x1b2ee2[_0xbf6a('0x3c')]:_0x9079e8[_0xbf6a('0x38')];_0x1b2ee2[_0xbf6a('0x41')]=qs[_0xbf6a('0x42')](_0x3ec344[_0xbf6a('0x3a')][_0xbf6a('0x42')]);_0x1b2ee2['where']=qs[_0xbf6a('0x43')](_[_0xbf6a('0x44')](_0x3ec344[_0xbf6a('0x3a')],_0x9079e8[_0xbf6a('0x43')]));if(_0x3ec344[_0xbf6a('0x3a')]['filter']){_0x1b2ee2[_0xbf6a('0x46')]=_['merge'](_0x1b2ee2[_0xbf6a('0x46')],{'$or':_[_0xbf6a('0x48')](_0x1b2ee2[_0xbf6a('0x3c')],function(_0x574569){var _0xd22e10={};_0xd22e10[_0x574569]={'$like':'%'+_0x3ec344[_0xbf6a('0x3a')][_0xbf6a('0x45')]+'%'};return _0xd22e10;})});}_0x1b2ee2=_[_0xbf6a('0x47')]({},_0x1b2ee2,_0x3ec344[_0xbf6a('0x4d')]);return _0x42f9f7[_0xbf6a('0x6e')](_0x1b2ee2);}})['then'](function(_0x39fed4){if(_0x39fed4){_0x352924=_0x39fed4[_0xbf6a('0x3d')];if(!_0x3ec344[_0xbf6a('0x3a')][_0xbf6a('0x3e')](_0xbf6a('0x3f'))){_0x1b2ee2[_0xbf6a('0x40')]=qs[_0xbf6a('0x40')](_0x3ec344[_0xbf6a('0x3a')][_0xbf6a('0x40')]);_0x1b2ee2[_0xbf6a('0x2c')]=qs[_0xbf6a('0x2c')](_0x3ec344[_0xbf6a('0x3a')][_0xbf6a('0x2c')]);}return _0x42f9f7[_0xbf6a('0x6e')](_0x1b2ee2);}})['then'](function(_0x474da2){if(_0x474da2){return _0x474da2?{'count':_0x352924,'rows':_0x474da2}:null;}})[_0xbf6a('0x1f')](respondWithResult(_0x723250,null))[_0xbf6a('0x52')](handleError(_0x723250,null));};exports[_0xbf6a('0x70')]=function(_0x2025ce,_0x530c6d,_0x3e47bf){var _0x395b6e=_0x2025ce['body'][_0xbf6a('0x71')];return db['Team'][_0xbf6a('0x51')]({'where':{'id':_0x395b6e},'attributes':['id'],'include':[{'model':db[_0xbf6a('0x66')],'as':_0xbf6a('0x72'),'attributes':['id',_0xbf6a('0x35'),_0xbf6a('0x73'),_0xbf6a('0x74'),_0xbf6a('0x75')],'raw':!![]}]})[_0xbf6a('0x1f')](function(_0x50c772){if(_0x50c772){var _0x4c2412=_['flatMap'](_0x50c772,function(_0x3e4ebe){var _0x1604d7=_0x3e4ebe[_0xbf6a('0x31')]({'plain':!![]});return _0x1604d7[_0xbf6a('0x72')];});return db[_0xbf6a('0x4e')][_0xbf6a('0x5d')]({'where':{'id':_0x2025ce[_0xbf6a('0x54')]['id']}})[_0xbf6a('0x1f')](function(_0x47cbb8){return db['sequelize'][_0xbf6a('0x76')](function(_0x1c4e6b){return _0x47cbb8[_0xbf6a('0x70')](_0x395b6e,{'transaction':_0x1c4e6b})[_0xbf6a('0x1f')](function(){return BPromise[_0xbf6a('0x77')](_0x4c2412,function(_0x2cad40){return db[_0xbf6a('0x63')][_0xbf6a('0x78')]({'where':{'UserId':_0x2cad40['id'],'ChatQueueId':_0x2025ce[_0xbf6a('0x54')]['id']},'transaction':_0x1c4e6b});});})[_0xbf6a('0x1f')](function(){_0x4c2412['forEach'](function(_0x2f72d6){socket[_0xbf6a('0x79')](_0xbf6a('0x7a'),{'UserId':_0x2f72d6['id'],'ChatQueueId':_0x47cbb8['id']});});});});});}})[_0xbf6a('0x1f')](respondWithStatusCode(_0x530c6d,null))['catch'](handleError(_0x530c6d,null));};exports['removeTeams']=function(_0x547da2,_0x3134c9,_0x2ee222){return db['Team'][_0xbf6a('0x51')]({'where':{'id':_0x547da2[_0xbf6a('0x3a')][_0xbf6a('0x71')]},'attributes':['id'],'include':[{'model':db[_0xbf6a('0x66')],'as':_0xbf6a('0x72'),'attributes':['id'],'raw':!![]}]})[_0xbf6a('0x1f')](handleEntityNotFound(_0x3134c9,null))[_0xbf6a('0x1f')](function(_0x282c8c){var _0x318cd9=_[_0xbf6a('0x48')](_0x282c8c,'id');var _0x1f3532=[];var _0xb4251c=[];var _0x2c49a6=squel[_0xbf6a('0x7b')]();_0x2c49a6['field'](_0xbf6a('0x7c'))[_0xbf6a('0x7d')](_0xbf6a('0x7e'),'tq')['join'](_0xbf6a('0x7f'),'ut',_0xbf6a('0x80'))[_0xbf6a('0x46')](_0xbf6a('0x81'),_0x547da2[_0xbf6a('0x54')]['id']);for(var _0x31a018=0x0;_0x31a018<_0x282c8c[_0xbf6a('0x3d')];_0x31a018+=0x1){let _0x301cba=_0x282c8c[_0x31a018];for(var _0x5c03ec=0x0;_0x5c03ec<_0x301cba[_0xbf6a('0x72')][_0xbf6a('0x3d')];_0x5c03ec+=0x1){let _0x12ebe0=_0x301cba[_0xbf6a('0x72')][_0x5c03ec];var _0x524717=_0x2c49a6['clone']();_0x524717[_0xbf6a('0x46')](_0xbf6a('0x82'),_0x12ebe0['id']);_0xb4251c[_0xbf6a('0x83')](db[_0xbf6a('0x84')][_0xbf6a('0x3a')](_0x524717['toString'](),{'type':db[_0xbf6a('0x84')][_0xbf6a('0x85')][_0xbf6a('0x86')]})['then'](function(_0x244637){if(_0x244637[_0xbf6a('0x3d')]===0x1){return _0x12ebe0['id'];}else{var _0x2046de=_[_0xbf6a('0x87')](_['map'](_0x244637,_0xbf6a('0x88')),function(_0x24cbf8){return _[_0xbf6a('0x89')](_0x318cd9,_0x24cbf8);});if(_0x2046de){return _0x12ebe0['id'];}}}));}}return BPromise[_0xbf6a('0x8a')](_0xb4251c)['then'](function(_0x11454e){_0x1f3532=_(_0x1f3532)[_0xbf6a('0x8b')](_0x11454e)[_0xbf6a('0x8c')]()[_0xbf6a('0x8d')]();return db[_0xbf6a('0x4e')][_0xbf6a('0x5d')]({'where':{'id':_0x547da2[_0xbf6a('0x54')]['id']}})[_0xbf6a('0x1f')](function(_0x34ccd2){return db[_0xbf6a('0x84')]['transaction'](function(_0x574340){return _0x34ccd2[_0xbf6a('0x8e')](_0x547da2[_0xbf6a('0x3a')][_0xbf6a('0x71')],{'transaction':_0x574340})[_0xbf6a('0x1f')](function(){if(!_[_0xbf6a('0x8f')](_0x1f3532)){return _0x34ccd2[_0xbf6a('0x90')](_0x1f3532,{'transaction':_0x574340});}})[_0xbf6a('0x1f')](function(){_0x1f3532[_0xbf6a('0x91')](function(_0x30a21){socket[_0xbf6a('0x79')](_0xbf6a('0x92'),{'UserId':_0x30a21,'ChatQueueId':_0x34ccd2['id']});});});});});});})[_0xbf6a('0x1f')](respondWithStatusCode(_0x3134c9,null))[_0xbf6a('0x52')](handleError(_0x3134c9,null));};exports['addAgents']=function(_0x1e2b4e,_0x1ce1b8,_0x5b72b2){return db[_0xbf6a('0x4e')][_0xbf6a('0x5d')]({'where':{'id':_0x1e2b4e[_0xbf6a('0x54')]['id']}})[_0xbf6a('0x1f')](handleEntityNotFound(_0x1ce1b8,null))[_0xbf6a('0x1f')](function(_0x474655){if(_0x474655){return _0x474655[_0xbf6a('0x93')](_0x1e2b4e[_0xbf6a('0x58')]['ids'],_[_0xbf6a('0x94')](_0x1e2b4e['body'],[_0xbf6a('0x71'),'id'])||{})[_0xbf6a('0x95')](function(_0x2b12d6){for(var _0xb4ecda=0x0;_0xb4ecda<_0x1e2b4e[_0xbf6a('0x58')][_0xbf6a('0x71')]['length'];_0xb4ecda+=0x1){socket['emit'](_0xbf6a('0x7a'),{'UserId':_0x1e2b4e[_0xbf6a('0x58')][_0xbf6a('0x71')][_0xb4ecda],'ChatQueueId':_0x1e2b4e[_0xbf6a('0x54')]['id']});}return _0x2b12d6;});}})['then'](respondWithResult(_0x1ce1b8,null))['catch'](handleError(_0x1ce1b8,null));};exports['removeAgents']=function(_0x32463b,_0x1c740b,_0x581357){return db[_0xbf6a('0x4e')][_0xbf6a('0x5d')]({'where':{'id':_0x32463b[_0xbf6a('0x54')]['id']}})[_0xbf6a('0x1f')](handleEntityNotFound(_0x1c740b,null))[_0xbf6a('0x1f')](function(_0x456a8a){if(_0x456a8a){return _0x456a8a[_0xbf6a('0x90')](_0x32463b['query'][_0xbf6a('0x71')])['then'](function(){if(_[_0xbf6a('0x96')](_0x32463b[_0xbf6a('0x3a')][_0xbf6a('0x71')])){for(var _0x4f80c0=0x0;_0x4f80c0<_0x32463b['query'][_0xbf6a('0x71')][_0xbf6a('0x3d')];_0x4f80c0+=0x1){socket[_0xbf6a('0x79')](_0xbf6a('0x92'),{'UserId':Number(_0x32463b[_0xbf6a('0x3a')]['ids'][_0x4f80c0]),'ChatQueueId':Number(_0x32463b[_0xbf6a('0x54')]['id'])});}}else{socket[_0xbf6a('0x79')](_0xbf6a('0x92'),{'UserId':Number(_0x32463b[_0xbf6a('0x3a')][_0xbf6a('0x71')]),'ChatQueueId':Number(_0x32463b[_0xbf6a('0x54')]['id'])});}});}})['then'](respondWithStatusCode(_0x1c740b,null))[_0xbf6a('0x52')](handleError(_0x1c740b,null));};exports[_0xbf6a('0x97')]=function(_0x46f9ad,_0x274644,_0x136e4d){var _0x3f978d={};var _0x584526={};var _0x1930dc;var _0x2e1a9e;return db[_0xbf6a('0x4e')][_0xbf6a('0x98')]({'where':{'id':_0x46f9ad[_0xbf6a('0x54')]['id']}})[_0xbf6a('0x1f')](handleEntityNotFound(_0x274644,null))[_0xbf6a('0x1f')](function(_0x2e7f36){if(_0x2e7f36){_0x1930dc=_0x2e7f36;_0x584526['model']=_[_0xbf6a('0x39')](db[_0xbf6a('0x66')]['rawAttributes']);_0x584526[_0xbf6a('0x3a')]=_['keys'](_0x46f9ad[_0xbf6a('0x3a')]);_0x584526['filters']=_[_0xbf6a('0x3b')](_0x584526['model'],_0x584526['query']);_0x3f978d[_0xbf6a('0x3c')]=_['intersection'](_0x584526[_0xbf6a('0x38')],qs[_0xbf6a('0x55')](_0x46f9ad['query'][_0xbf6a('0x55')]));_0x3f978d['attributes']=_0x3f978d['attributes']['length']?_0x3f978d[_0xbf6a('0x3c')]:_0x584526[_0xbf6a('0x38')];_0x3f978d[_0xbf6a('0x41')]=qs[_0xbf6a('0x42')](_0x46f9ad[_0xbf6a('0x3a')][_0xbf6a('0x42')]);_0x3f978d[_0xbf6a('0x46')]=qs[_0xbf6a('0x43')](_['pick'](_0x46f9ad[_0xbf6a('0x3a')],_0x584526[_0xbf6a('0x43')]));if(_0x46f9ad[_0xbf6a('0x3a')][_0xbf6a('0x45')]){_0x3f978d[_0xbf6a('0x46')]=_['merge'](_0x3f978d['where'],{'$or':_[_0xbf6a('0x48')](_0x3f978d[_0xbf6a('0x3c')],function(_0x258f8a){var _0x5ce17c={};_0x5ce17c[_0x258f8a]={'$like':'%'+_0x46f9ad['query'][_0xbf6a('0x45')]+'%'};return _0x5ce17c;})});}_0x3f978d=_[_0xbf6a('0x47')]({},_0x3f978d,_0x46f9ad['options']);return _0x1930dc['getAgents'](_0x3f978d);}})[_0xbf6a('0x1f')](function(_0x29e312){if(_0x29e312){_0x2e1a9e=_0x29e312[_0xbf6a('0x3d')];if(!_0x46f9ad[_0xbf6a('0x3a')]['hasOwnProperty'](_0xbf6a('0x3f'))){_0x3f978d[_0xbf6a('0x40')]=qs[_0xbf6a('0x40')](_0x46f9ad[_0xbf6a('0x3a')][_0xbf6a('0x40')]);_0x3f978d[_0xbf6a('0x2c')]=qs[_0xbf6a('0x2c')](_0x46f9ad[_0xbf6a('0x3a')]['offset']);}return _0x1930dc['getAgents'](_0x3f978d);}})[_0xbf6a('0x1f')](function(_0x28dfcc){if(_0x28dfcc){return _0x28dfcc?{'count':_0x2e1a9e,'rows':_0x28dfcc}:null;}})[_0xbf6a('0x1f')](respondWithResult(_0x274644,null))[_0xbf6a('0x52')](handleError(_0x274644,null));}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js index 6297d52..5f31f78 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 _0xe49a=['ChatQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty','exports','../../mysqldb'];(function(_0x2b1413,_0x2ce9d0){var _0x69a7fb=function(_0x54cb7b){while(--_0x54cb7b){_0x2b1413['push'](_0x2b1413['shift']());}};_0x69a7fb(++_0x2ce9d0);}(_0xe49a,0xd7));var _0xae49=function(_0x295342,_0x56a8ce){_0x295342=_0x295342-0x0;var _0x21d2af=_0xe49a[_0x295342];return _0x21d2af;};'use strict';var EventEmitter=require('events');var ChatQueue=require(_0xae49('0x0'))['db'][_0xae49('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xae49('0x2')](0x0);var events={'afterCreate':_0xae49('0x3'),'afterUpdate':_0xae49('0x4'),'afterDestroy':_0xae49('0x5')};function emitEvent(_0x82a917){return function(_0x526f75,_0x33ce72,_0x1a0dd1){ChatQueueEvents[_0xae49('0x6')](_0x82a917+':'+_0x526f75['id'],_0x526f75);ChatQueueEvents['emit'](_0x82a917,_0x526f75);_0x1a0dd1(null);};}for(var e in events){if(events[_0xae49('0x7')](e)){var event=events[e];ChatQueue['hook'](e,emitEvent(event));}}module[_0xae49('0x8')]=ChatQueueEvents; \ No newline at end of file +var _0x6455=['exports','events','ChatQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x43d067,_0x64756d){var _0x46958c=function(_0x585fc2){while(--_0x585fc2){_0x43d067['push'](_0x43d067['shift']());}};_0x46958c(++_0x64756d);}(_0x6455,0x97));var _0x5645=function(_0x1f66e1,_0x131e6a){_0x1f66e1=_0x1f66e1-0x0;var _0x3a283a=_0x6455[_0x1f66e1];return _0x3a283a;};'use strict';var EventEmitter=require(_0x5645('0x0'));var ChatQueue=require('../../mysqldb')['db'][_0x5645('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x5645('0x2')](0x0);var events={'afterCreate':_0x5645('0x3'),'afterUpdate':_0x5645('0x4'),'afterDestroy':_0x5645('0x5')};function emitEvent(_0x35c21e){return function(_0x5388ff,_0x233875,_0x29cefe){ChatQueueEvents[_0x5645('0x6')](_0x35c21e+':'+_0x5388ff['id'],_0x5388ff);ChatQueueEvents[_0x5645('0x6')](_0x35c21e,_0x5388ff);_0x29cefe(null);};}for(var e in events){if(events[_0x5645('0x7')](e)){var event=events[e];ChatQueue[_0x5645('0x8')](e,emitEvent(event));}}module[_0x5645('0x9')]=ChatQueueEvents; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js index 0ecfa3f..94ea6eb 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 _0xc437=['chat_queues','lodash','util','../../config/logger','api','request-promise','path','./chatQueue.attributes','exports','define','ChatQueue'];(function(_0x2dffe0,_0x5a4d22){var _0x51ad55=function(_0x3228bf){while(--_0x3228bf){_0x2dffe0['push'](_0x2dffe0['shift']());}};_0x51ad55(++_0x5a4d22);}(_0xc437,0xe8));var _0x7c43=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xc437[_0x2641f9];return _0x585741;};'use strict';var _=require(_0x7c43('0x0'));var util=require(_0x7c43('0x1'));var logger=require(_0x7c43('0x2'))(_0x7c43('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x7c43('0x4'));var fs=require('fs');var path=require(_0x7c43('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x7c43('0x6'));module[_0x7c43('0x7')]=function(_0x4642e3,_0x252ebc){return _0x4642e3[_0x7c43('0x8')](_0x7c43('0x9'),attributes,{'tableName':_0x7c43('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc4e9=['exports','define','ChatQueue','chat_queues','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatQueue.attributes'];(function(_0x530325,_0x477be4){var _0x13e765=function(_0x474fe9){while(--_0x474fe9){_0x530325['push'](_0x530325['shift']());}};_0x13e765(++_0x477be4);}(_0xc4e9,0x19a));var _0x9c4e=function(_0x189b3b,_0x484de8){_0x189b3b=_0x189b3b-0x0;var _0x7c4721=_0xc4e9[_0x189b3b];return _0x7c4721;};'use strict';var _=require(_0x9c4e('0x0'));var util=require(_0x9c4e('0x1'));var logger=require(_0x9c4e('0x2'))('api');var moment=require(_0x9c4e('0x3'));var BPromise=require(_0x9c4e('0x4'));var rp=require(_0x9c4e('0x5'));var fs=require('fs');var path=require(_0x9c4e('0x6'));var rimraf=require(_0x9c4e('0x7'));var config=require(_0x9c4e('0x8'));var attributes=require(_0x9c4e('0x9'));module[_0x9c4e('0xa')]=function(_0x137055,_0x202cf0){return _0x137055[_0x9c4e('0xb')](_0x9c4e('0xc'),attributes,{'tableName':_0x9c4e('0xd'),'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 30ee163..6e70217 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 _0x969e=['bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','redis','defaults','socket.io-emitter','./chatQueue.socket','register','request','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','GetChatQueue','ChatQueue','options','where','attributes','limit','include','map','model','then','ShowChatQueue','find','raw','lodash','util'];(function(_0x18b85e,_0x1a4727){var _0xdb0129=function(_0xf673c2){while(--_0xf673c2){_0x18b85e['push'](_0x18b85e['shift']());}};_0xdb0129(++_0x1a4727);}(_0x969e,0x136));var _0xe969=function(_0x68e0ee,_0x1523b2){_0x68e0ee=_0x68e0ee-0x0;var _0x5e4abb=_0x969e[_0x68e0ee];return _0x5e4abb;};'use strict';var _=require(_0xe969('0x0'));var util=require(_0xe969('0x1'));var moment=require('moment');var BPromise=require(_0xe969('0x2'));var rs=require(_0xe969('0x3'));var fs=require('fs');var Redis=require(_0xe969('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xe969('0x5'));var config=require(_0xe969('0x6'));var jayson=require(_0xe969('0x7'));var client=jayson[_0xe969('0x8')]['http']({'port':0x232a});config[_0xe969('0x9')]=_[_0xe969('0xa')](config[_0xe969('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0xe969('0xb'))(new Redis(config['redis']));require(_0xe969('0xc'))[_0xe969('0xd')](socket);function respondWithRpcPromise(_0x5d9841,_0x431f1c,_0x4ced4b){return new BPromise(function(_0x32d427,_0x2991d6){return client[_0xe969('0xe')](_0x5d9841,_0x4ced4b)['then'](function(_0x80b852){logger[_0xe969('0xf')](_0xe969('0x10'),_0x431f1c,_0xe969('0x11'));logger[_0xe969('0x12')](_0xe969('0x13'),_0x431f1c,'request\x20sent',JSON[_0xe969('0x14')](_0x80b852));if(_0x80b852['error']){if(_0x80b852['error'][_0xe969('0x15')]===0x1f4){logger[_0xe969('0x16')](_0xe969('0x10'),_0x431f1c,_0x80b852[_0xe969('0x16')]['message']);return _0x2991d6(_0x80b852[_0xe969('0x16')][_0xe969('0x17')]);}logger[_0xe969('0x16')](_0xe969('0x10'),_0x431f1c,_0x80b852[_0xe969('0x16')][_0xe969('0x17')]);return _0x32d427(_0x80b852['error']['message']);}else{logger[_0xe969('0xf')](_0xe969('0x10'),_0x431f1c,_0xe969('0x11'));_0x32d427(_0x80b852[_0xe969('0x18')][_0xe969('0x17')]);}})[_0xe969('0x19')](function(_0x5aa68c){logger['error'](_0xe969('0x10'),_0x431f1c,_0x5aa68c);_0x2991d6(_0x5aa68c);});});}exports[_0xe969('0x1a')]=function(_0x295b44){var _0x5dd070=this;return new Promise(function(_0x1f6e31,_0x524542){return db[_0xe969('0x1b')]['findAll']({'raw':_0x295b44[_0xe969('0x1c')]?_0x295b44['options']['raw']===undefined?!![]:![]:!![],'where':_0x295b44[_0xe969('0x1c')]?_0x295b44[_0xe969('0x1c')][_0xe969('0x1d')]||null:null,'attributes':_0x295b44[_0xe969('0x1c')]?_0x295b44[_0xe969('0x1c')][_0xe969('0x1e')]||null:null,'limit':_0x295b44[_0xe969('0x1c')]?_0x295b44[_0xe969('0x1c')][_0xe969('0x1f')]||null:null,'include':_0x295b44[_0xe969('0x1c')]?_0x295b44[_0xe969('0x1c')][_0xe969('0x20')]?_[_0xe969('0x21')](_0x295b44['options']['include'],function(_0x522f8f){return{'model':db[_0x522f8f[_0xe969('0x22')]],'as':_0x522f8f['as'],'attributes':_0x522f8f[_0xe969('0x1e')],'include':_0x522f8f[_0xe969('0x20')]?_[_0xe969('0x21')](_0x522f8f[_0xe969('0x20')],function(_0x2c9ee1){return{'model':db[_0x2c9ee1[_0xe969('0x22')]],'as':_0x2c9ee1['as'],'attributes':_0x2c9ee1[_0xe969('0x1e')],'include':_0x2c9ee1['include']?_[_0xe969('0x21')](_0x2c9ee1[_0xe969('0x20')],function(_0x241639){return{'model':db[_0x241639[_0xe969('0x22')]],'as':_0x241639['as'],'attributes':_0x241639[_0xe969('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xe969('0x23')](function(_0x4c9c3a){logger['info'](_0xe969('0x1a'),_0x295b44);logger[_0xe969('0x12')](_0xe969('0x1a'),_0x295b44,JSON[_0xe969('0x14')](_0x4c9c3a));_0x1f6e31(_0x4c9c3a);})[_0xe969('0x19')](function(_0x514ee8){logger['error'](_0xe969('0x1a'),_0x514ee8[_0xe969('0x17')],_0x295b44);_0x524542(_0x5dd070[_0xe969('0x16')](0x1f4,_0x514ee8[_0xe969('0x17')]));});});};exports[_0xe969('0x24')]=function(_0xca6728){var _0x1dff3e=this;return new Promise(function(_0x4b0af3,_0x2a1c7f){return db[_0xe969('0x1b')][_0xe969('0x25')]({'raw':_0xca6728[_0xe969('0x1c')]?_0xca6728['options'][_0xe969('0x26')]===undefined?!![]:![]:!![],'where':_0xca6728[_0xe969('0x1c')]?_0xca6728[_0xe969('0x1c')]['where']||null:null,'attributes':_0xca6728['options']?_0xca6728[_0xe969('0x1c')][_0xe969('0x1e')]||null:null,'include':_0xca6728[_0xe969('0x1c')]?_0xca6728[_0xe969('0x1c')][_0xe969('0x20')]?_['map'](_0xca6728[_0xe969('0x1c')]['include'],function(_0x4e8142){return{'model':db[_0x4e8142['model']],'as':_0x4e8142['as'],'attributes':_0x4e8142[_0xe969('0x1e')],'include':_0x4e8142['include']?_['map'](_0x4e8142[_0xe969('0x20')],function(_0x16be53){return{'model':db[_0x16be53['model']],'as':_0x16be53['as'],'attributes':_0x16be53['attributes'],'include':_0x16be53[_0xe969('0x20')]?_['map'](_0x16be53[_0xe969('0x20')],function(_0x4f8fa5){return{'model':db[_0x4f8fa5[_0xe969('0x22')]],'as':_0x4f8fa5['as'],'attributes':_0x4f8fa5[_0xe969('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xe969('0x23')](function(_0x30a4eb){logger[_0xe969('0xf')]('ShowChatQueue',_0xca6728);logger[_0xe969('0x12')]('ShowChatQueue',_0xca6728,JSON[_0xe969('0x14')](_0x30a4eb));_0x4b0af3(_0x30a4eb);})[_0xe969('0x19')](function(_0x4a44f2){logger['error'](_0xe969('0x24'),_0x4a44f2['message'],_0xca6728);_0x2a1c7f(_0x1dff3e[_0xe969('0x16')](0x1f4,_0x4a44f2[_0xe969('0x17')]));});});}; \ No newline at end of file +var _0x99e7=['socket.io-emitter','register','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetChatQueue','ChatQueue','findAll','options','raw','where','limit','include','map','model','attributes','debug','ShowChatQueue','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','defaults','redis','localhost'];(function(_0x269ee8,_0x477226){var _0x4d98bd=function(_0x20d4c4){while(--_0x20d4c4){_0x269ee8['push'](_0x269ee8['shift']());}};_0x4d98bd(++_0x477226);}(_0x99e7,0x1b5));var _0x799e=function(_0x25b24a,_0x1c0163){_0x25b24a=_0x25b24a-0x0;var _0x224e68=_0x99e7[_0x25b24a];return _0x224e68;};'use strict';var _=require(_0x799e('0x0'));var util=require(_0x799e('0x1'));var moment=require(_0x799e('0x2'));var BPromise=require(_0x799e('0x3'));var rs=require(_0x799e('0x4'));var fs=require('fs');var Redis=require(_0x799e('0x5'));var db=require(_0x799e('0x6'))['db'];var utils=require(_0x799e('0x7'));var logger=require(_0x799e('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0x799e('0x9'));var client=jayson['client'][_0x799e('0xa')]({'port':0x232a});config['redis']=_[_0x799e('0xb')](config[_0x799e('0xc')],{'host':_0x799e('0xd'),'port':0x18eb});var socket=require(_0x799e('0xe'))(new Redis(config[_0x799e('0xc')]));require('./chatQueue.socket')[_0x799e('0xf')](socket);function respondWithRpcPromise(_0x3477f3,_0x38cd71,_0x388e5c){return new BPromise(function(_0x5cf95e,_0x11615a){return client[_0x799e('0x10')](_0x3477f3,_0x388e5c)[_0x799e('0x11')](function(_0x108aa9){logger[_0x799e('0x12')](_0x799e('0x13'),_0x38cd71,_0x799e('0x14'));logger['debug'](_0x799e('0x15'),_0x38cd71,_0x799e('0x14'),JSON[_0x799e('0x16')](_0x108aa9));if(_0x108aa9[_0x799e('0x17')]){if(_0x108aa9[_0x799e('0x17')][_0x799e('0x18')]===0x1f4){logger[_0x799e('0x17')](_0x799e('0x13'),_0x38cd71,_0x108aa9[_0x799e('0x17')][_0x799e('0x19')]);return _0x11615a(_0x108aa9['error']['message']);}logger[_0x799e('0x17')](_0x799e('0x13'),_0x38cd71,_0x108aa9[_0x799e('0x17')]['message']);return _0x5cf95e(_0x108aa9[_0x799e('0x17')][_0x799e('0x19')]);}else{logger[_0x799e('0x12')](_0x799e('0x13'),_0x38cd71,_0x799e('0x14'));_0x5cf95e(_0x108aa9['result'][_0x799e('0x19')]);}})[_0x799e('0x1a')](function(_0x27f335){logger[_0x799e('0x17')]('ChatQueue,\x20%s,\x20%s',_0x38cd71,_0x27f335);_0x11615a(_0x27f335);});});}exports[_0x799e('0x1b')]=function(_0x4c5500){var _0x1b1478=this;return new Promise(function(_0x29f9d9,_0x42e195){return db[_0x799e('0x1c')][_0x799e('0x1d')]({'raw':_0x4c5500[_0x799e('0x1e')]?_0x4c5500[_0x799e('0x1e')][_0x799e('0x1f')]===undefined?!![]:![]:!![],'where':_0x4c5500[_0x799e('0x1e')]?_0x4c5500[_0x799e('0x1e')][_0x799e('0x20')]||null:null,'attributes':_0x4c5500[_0x799e('0x1e')]?_0x4c5500[_0x799e('0x1e')]['attributes']||null:null,'limit':_0x4c5500[_0x799e('0x1e')]?_0x4c5500[_0x799e('0x1e')][_0x799e('0x21')]||null:null,'include':_0x4c5500['options']?_0x4c5500['options'][_0x799e('0x22')]?_[_0x799e('0x23')](_0x4c5500[_0x799e('0x1e')][_0x799e('0x22')],function(_0x39c61f){return{'model':db[_0x39c61f[_0x799e('0x24')]],'as':_0x39c61f['as'],'attributes':_0x39c61f[_0x799e('0x25')],'include':_0x39c61f[_0x799e('0x22')]?_[_0x799e('0x23')](_0x39c61f[_0x799e('0x22')],function(_0xde9d3c){return{'model':db[_0xde9d3c[_0x799e('0x24')]],'as':_0xde9d3c['as'],'attributes':_0xde9d3c['attributes'],'include':_0xde9d3c[_0x799e('0x22')]?_['map'](_0xde9d3c[_0x799e('0x22')],function(_0x2a5cf0){return{'model':db[_0x2a5cf0[_0x799e('0x24')]],'as':_0x2a5cf0['as'],'attributes':_0x2a5cf0['attributes']};}):[]};}):[]};}):[]:[]})[_0x799e('0x11')](function(_0x423728){logger[_0x799e('0x12')](_0x799e('0x1b'),_0x4c5500);logger[_0x799e('0x26')](_0x799e('0x1b'),_0x4c5500,JSON[_0x799e('0x16')](_0x423728));_0x29f9d9(_0x423728);})[_0x799e('0x1a')](function(_0x87d384){logger[_0x799e('0x17')](_0x799e('0x1b'),_0x87d384[_0x799e('0x19')],_0x4c5500);_0x42e195(_0x1b1478[_0x799e('0x17')](0x1f4,_0x87d384[_0x799e('0x19')]));});});};exports[_0x799e('0x27')]=function(_0x40acd3){var _0x486a2b=this;return new Promise(function(_0x206ad2,_0x2cc497){return db[_0x799e('0x1c')][_0x799e('0x28')]({'raw':_0x40acd3[_0x799e('0x1e')]?_0x40acd3[_0x799e('0x1e')][_0x799e('0x1f')]===undefined?!![]:![]:!![],'where':_0x40acd3[_0x799e('0x1e')]?_0x40acd3[_0x799e('0x1e')][_0x799e('0x20')]||null:null,'attributes':_0x40acd3['options']?_0x40acd3[_0x799e('0x1e')]['attributes']||null:null,'include':_0x40acd3[_0x799e('0x1e')]?_0x40acd3[_0x799e('0x1e')][_0x799e('0x22')]?_['map'](_0x40acd3[_0x799e('0x1e')]['include'],function(_0x1ff802){return{'model':db[_0x1ff802['model']],'as':_0x1ff802['as'],'attributes':_0x1ff802[_0x799e('0x25')],'include':_0x1ff802['include']?_[_0x799e('0x23')](_0x1ff802[_0x799e('0x22')],function(_0x47071d){return{'model':db[_0x47071d[_0x799e('0x24')]],'as':_0x47071d['as'],'attributes':_0x47071d['attributes'],'include':_0x47071d[_0x799e('0x22')]?_[_0x799e('0x23')](_0x47071d[_0x799e('0x22')],function(_0xad5cfa){return{'model':db[_0xad5cfa['model']],'as':_0xad5cfa['as'],'attributes':_0xad5cfa[_0x799e('0x25')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5b00db){logger[_0x799e('0x12')](_0x799e('0x27'),_0x40acd3);logger[_0x799e('0x26')](_0x799e('0x27'),_0x40acd3,JSON[_0x799e('0x16')](_0x5b00db));_0x206ad2(_0x5b00db);})[_0x799e('0x1a')](function(_0x51ae05){logger[_0x799e('0x17')]('ShowChatQueue',_0x51ae05[_0x799e('0x19')],_0x40acd3);_0x2cc497(_0x486a2b[_0x799e('0x17')](0x1f4,_0x51ae05[_0x799e('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js index 24889a9..de1f8ed 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 _0x0b0e=['chatQueue:','./chatQueue.events','remove','emit','removeListener','register'];(function(_0x3813d1,_0x1a3c34){var _0x3234a4=function(_0x3cbc92){while(--_0x3cbc92){_0x3813d1['push'](_0x3813d1['shift']());}};_0x3234a4(++_0x1a3c34);}(_0x0b0e,0x187));var _0xe0b0=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0x0b0e[_0x8c43de];return _0xa6591b;};'use strict';var ChatQueueEvents=require(_0xe0b0('0x0'));var events=['save',_0xe0b0('0x1'),'update'];function createListener(_0x7e5a8a,_0xdf715e){return function(_0x3b5e2b){_0xdf715e[_0xe0b0('0x2')](_0x7e5a8a,_0x3b5e2b);};}function removeListener(_0x28040c,_0x38a058){return function(){ChatQueueEvents[_0xe0b0('0x3')](_0x28040c,_0x38a058);};}exports[_0xe0b0('0x4')]=function(_0x30e20d){for(var _0x28e40f=0x0,_0x219b1c=events['length'];_0x28e40f<_0x219b1c;_0x28e40f++){var _0x50be7f=events[_0x28e40f];var _0x11effc=createListener(_0xe0b0('0x5')+_0x50be7f,_0x30e20d);ChatQueueEvents['on'](_0x50be7f,_0x11effc);}}; \ No newline at end of file +var _0xadb5=['update','emit','register','length','chatQueue:','save'];(function(_0x139b3d,_0x41cd2e){var _0x39c727=function(_0x6a310c){while(--_0x6a310c){_0x139b3d['push'](_0x139b3d['shift']());}};_0x39c727(++_0x41cd2e);}(_0xadb5,0xad));var _0x5adb=function(_0x3fd1b8,_0x1cfacf){_0x3fd1b8=_0x3fd1b8-0x0;var _0xdef695=_0xadb5[_0x3fd1b8];return _0xdef695;};'use strict';var ChatQueueEvents=require('./chatQueue.events');var events=[_0x5adb('0x0'),'remove',_0x5adb('0x1')];function createListener(_0x38f67f,_0x3129c3){return function(_0x4aecec){_0x3129c3[_0x5adb('0x2')](_0x38f67f,_0x4aecec);};}function removeListener(_0x31457,_0x2e3ef4){return function(){ChatQueueEvents['removeListener'](_0x31457,_0x2e3ef4);};}exports[_0x5adb('0x3')]=function(_0x168d89){for(var _0x3e2555=0x0,_0x3213e8=events[_0x5adb('0x4')];_0x3e2555<_0x3213e8;_0x3e2555++){var _0x353885=events[_0x3e2555];var _0x47228a=createListener(_0x5adb('0x5')+_0x353885,_0x168d89);ChatQueueEvents['on'](_0x353885,_0x47228a);}}; \ No newline at end of file diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js index af6d764..b227bcb 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 _0x76f1=['addAgents','put','update','delete','destroy','removeTeams','removeAgents','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','isAuthenticated','describe','/:id','getMembers','/:id/teams','getTeams','create','post','addTeams'];(function(_0xe1a964,_0x5ec09d){var _0x3de37b=function(_0x406ffc){while(--_0x406ffc){_0xe1a964['push'](_0xe1a964['shift']());}};_0x3de37b(++_0x5ec09d);}(_0x76f1,0x167));var _0x176f=function(_0x3666a0,_0x36636c){_0x3666a0=_0x3666a0-0x0;var _0x47882d=_0x76f1[_0x3666a0];return _0x47882d;};'use strict';var multer=require(_0x176f('0x0'));var util=require(_0x176f('0x1'));var path=require(_0x176f('0x2'));var timeout=require('connect-timeout');var express=require(_0x176f('0x3'));var router=express[_0x176f('0x4')]();var auth=require(_0x176f('0x5'));var interaction=require(_0x176f('0x6'));var config=require(_0x176f('0x7'));var controller=require('./chatQueue.controller');router[_0x176f('0x8')]('/',auth['isAuthenticated'](),controller[_0x176f('0x9')]);router[_0x176f('0x8')]('/describe',auth[_0x176f('0xa')](),controller[_0x176f('0xb')]);router['get'](_0x176f('0xc'),auth[_0x176f('0xa')](),controller['show']);router['get']('/:id/members',auth[_0x176f('0xa')](),controller[_0x176f('0xd')]);router[_0x176f('0x8')](_0x176f('0xe'),auth['isAuthenticated'](),controller[_0x176f('0xf')]);router['get']('/:id/users',auth[_0x176f('0xa')](),controller['getAgents']);router['post']('/',auth[_0x176f('0xa')](),controller[_0x176f('0x10')]);router[_0x176f('0x11')](_0x176f('0xe'),auth[_0x176f('0xa')](),controller[_0x176f('0x12')]);router['post']('/:id/users',auth[_0x176f('0xa')](),controller[_0x176f('0x13')]);router[_0x176f('0x14')]('/:id',auth[_0x176f('0xa')](),controller[_0x176f('0x15')]);router[_0x176f('0x16')](_0x176f('0xc'),auth['isAuthenticated'](),controller[_0x176f('0x17')]);router[_0x176f('0x16')]('/:id/teams',auth['isAuthenticated'](),controller[_0x176f('0x18')]);router['delete']('/:id/users',auth['isAuthenticated'](),controller[_0x176f('0x19')]);module[_0x176f('0x1a')]=router; \ No newline at end of file +var _0x12fa=['removeTeams','multer','util','path','express','../../components/auth/service','index','get','/:id','/:id/members','isAuthenticated','getMembers','/:id/teams','/:id/users','getAgents','post','create','addTeams','put','update','delete','destroy'];(function(_0x3f43ef,_0x4c2ba9){var _0x20af43=function(_0x17fb2b){while(--_0x17fb2b){_0x3f43ef['push'](_0x3f43ef['shift']());}};_0x20af43(++_0x4c2ba9);}(_0x12fa,0x6f));var _0xa12f=function(_0x91bcac,_0x562d02){_0x91bcac=_0x91bcac-0x0;var _0x4cd502=_0x12fa[_0x91bcac];return _0x4cd502;};'use strict';var multer=require(_0xa12f('0x0'));var util=require(_0xa12f('0x1'));var path=require(_0xa12f('0x2'));var timeout=require('connect-timeout');var express=require(_0xa12f('0x3'));var router=express['Router']();var auth=require(_0xa12f('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./chatQueue.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xa12f('0x5')]);router['get']('/describe',auth['isAuthenticated'](),controller['describe']);router[_0xa12f('0x6')](_0xa12f('0x7'),auth['isAuthenticated'](),controller['show']);router[_0xa12f('0x6')](_0xa12f('0x8'),auth[_0xa12f('0x9')](),controller[_0xa12f('0xa')]);router[_0xa12f('0x6')](_0xa12f('0xb'),auth[_0xa12f('0x9')](),controller['getTeams']);router[_0xa12f('0x6')](_0xa12f('0xc'),auth[_0xa12f('0x9')](),controller[_0xa12f('0xd')]);router[_0xa12f('0xe')]('/',auth['isAuthenticated'](),controller[_0xa12f('0xf')]);router[_0xa12f('0xe')]('/:id/teams',auth[_0xa12f('0x9')](),controller[_0xa12f('0x10')]);router[_0xa12f('0xe')](_0xa12f('0xc'),auth[_0xa12f('0x9')](),controller['addAgents']);router[_0xa12f('0x11')](_0xa12f('0x7'),auth['isAuthenticated'](),controller[_0xa12f('0x12')]);router[_0xa12f('0x13')]('/:id',auth[_0xa12f('0x9')](),controller[_0xa12f('0x14')]);router['delete'](_0xa12f('0xb'),auth['isAuthenticated'](),controller[_0xa12f('0x15')]);router['delete'](_0xa12f('0xc'),auth['isAuthenticated'](),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 6d9c997..0056a62 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 _0x0990=['moment','sequelize','exports','STRING','DATE'];(function(_0x7d579a,_0x1580b){var _0x3b06cb=function(_0x4ba063){while(--_0x4ba063){_0x7d579a['push'](_0x7d579a['shift']());}};_0x3b06cb(++_0x1580b);}(_0x0990,0x64));var _0x0099=function(_0x39bc44,_0x1d4373){_0x39bc44=_0x39bc44-0x0;var _0x2916d8=_0x0990[_0x39bc44];return _0x2916d8;};'use strict';var moment=require(_0x0099('0x0'));var Sequelize=require(_0x0099('0x1'));module[_0x0099('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x0099('0x3')]},'joinAt':{'type':Sequelize[_0x0099('0x4')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x0099('0x4')]},'exitAt':{'type':Sequelize[_0x0099('0x4')]},'reason':{'type':Sequelize[_0x0099('0x3')]}}; \ No newline at end of file +var _0x309c=['exports','STRING','DATE','sequelize'];(function(_0x1ca5a3,_0x40b024){var _0xc8acbf=function(_0x5b50df){while(--_0x5b50df){_0x1ca5a3['push'](_0x1ca5a3['shift']());}};_0xc8acbf(++_0x40b024);}(_0x309c,0x1a7));var _0xc309=function(_0x184027,_0x8018f6){_0x184027=_0x184027-0x0;var _0xf0e06c=_0x309c[_0x184027];return _0xf0e06c;};'use strict';var moment=require('moment');var Sequelize=require(_0xc309('0x0'));module[_0xc309('0x1')]={'uniqueid':{'type':Sequelize[_0xc309('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0xc309('0x3')]},'leaveAt':{'type':Sequelize[_0xc309('0x3')]},'acceptAt':{'type':Sequelize[_0xc309('0x3')]},'exitAt':{'type':Sequelize[_0xc309('0x3')]},'reason':{'type':Sequelize[_0xc309('0x2')]}}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js index e45df15..0874740 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 _0x1674=['rows','catch','show','find','create','body','update','params','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','to-csv','ejs','squel','crypto','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','set','Content-Range','apply','save','then','destroy','stack','name','send','index','ChatQueueReport','rawAttributes','query','keys','filters','model','intersection','fields','attributes','length','hasOwnProperty','limit','order','sort','where','pick','filter','merge','map','type','key','VIRTUAL','field','options','count','includeAll','findAll'];(function(_0x4e2359,_0x52ea8f){var _0x450821=function(_0x20b293){while(--_0x20b293){_0x4e2359['push'](_0x4e2359['shift']());}};_0x450821(++_0x52ea8f);}(_0x1674,0x139));var _0x4167=function(_0x153aae,_0x28cf2c){_0x153aae=_0x153aae-0x0;var _0xb918f7=_0x1674[_0x153aae];return _0xb918f7;};'use strict';var pdf=require(_0x4167('0x0'));var emlformat=require(_0x4167('0x1'));var rimraf=require(_0x4167('0x2'));var zipdir=require(_0x4167('0x3'));var jsonpatch=require(_0x4167('0x4'));var rp=require('request-promise');var moment=require(_0x4167('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x4167('0x6'));var util=require(_0x4167('0x7'));var path=require(_0x4167('0x8'));var sox=require('sox');var csv=require(_0x4167('0x9'));var ejs=require(_0x4167('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x4167('0xb'));var crypto=require(_0x4167('0xc'));var jsforce=require(_0x4167('0xd'));var deskjs=require(_0x4167('0xe'));var toCsv=require(_0x4167('0x9'));var querystring=require(_0x4167('0xf'));var Papa=require(_0x4167('0x10'));var Redis=require(_0x4167('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x4167('0x12'));var as=require(_0x4167('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4167('0x14'))(_0x4167('0x15'));var utils=require(_0x4167('0x16'));var config=require(_0x4167('0x17'));var db=require(_0x4167('0x18'))['db'];function respondWithStatusCode(_0x29010e,_0x280845){_0x280845=_0x280845||0xcc;return function(_0xa0aeb0){if(_0xa0aeb0){return _0x29010e[_0x4167('0x19')](_0x280845);}return _0x29010e[_0x4167('0x1a')](_0x280845)[_0x4167('0x1b')]();};}function respondWithResult(_0x353fa6,_0x10ca2b){_0x10ca2b=_0x10ca2b||0xc8;return function(_0xa12e9d){if(_0xa12e9d){return _0x353fa6['status'](_0x10ca2b)[_0x4167('0x1c')](_0xa12e9d);}};}function respondWithFilteredResult(_0x3a074a,_0x1096b3){return function(_0x22d9c4){if(_0x22d9c4){var _0x38be37=_0x22d9c4['count'],_0x154f53=_0x1096b3['offset'],_0x1ca433=_0x1096b3[_0x4167('0x1d')]+_0x1096b3['limit'],_0x2056f5;if(_0x1ca433>=_0x38be37){_0x1ca433=_0x38be37;_0x2056f5=0xc8;}else{_0x2056f5=0xce;}_0x3a074a['status'](_0x2056f5);return _0x3a074a[_0x4167('0x1e')](_0x4167('0x1f'),_0x154f53+'-'+_0x1ca433+'/'+_0x38be37)[_0x4167('0x1c')](_0x22d9c4);}return null;};}function patchUpdates(_0x21b795){return function(_0x377b96){try{jsonpatch[_0x4167('0x20')](_0x377b96,_0x21b795,!![]);}catch(_0x362d5a){return BPromise['reject'](_0x362d5a);}return _0x377b96[_0x4167('0x21')]();};}function saveUpdates(_0x40cb01,_0x1d8d22){return function(_0x22072b){if(_0x22072b){return _0x22072b['update'](_0x40cb01)[_0x4167('0x22')](function(_0x2a2fd4){return _0x2a2fd4;});}return null;};}function removeEntity(_0x10e7bb,_0x39f272){return function(_0x47cf1f){if(_0x47cf1f){return _0x47cf1f[_0x4167('0x23')]()[_0x4167('0x22')](function(){_0x10e7bb['status'](0xcc)[_0x4167('0x1b')]();});}};}function handleEntityNotFound(_0x55db84,_0x76a02a){return function(_0x27b649){if(!_0x27b649){_0x55db84[_0x4167('0x19')](0x194);}return _0x27b649;};}function handleError(_0x38681a,_0x51b4cf){_0x51b4cf=_0x51b4cf||0x1f4;return function(_0x435bfd){logger['error'](_0x435bfd[_0x4167('0x24')]);if(_0x435bfd[_0x4167('0x25')]){delete _0x435bfd[_0x4167('0x25')];}_0x38681a['status'](_0x51b4cf)[_0x4167('0x26')](_0x435bfd);};}exports[_0x4167('0x27')]=function(_0x12b364,_0x3eaea0){var _0x489e90={},_0x3028b2={},_0x3a9ab1={'count':0x0,'rows':[]};var _0x585767=db[_0x4167('0x28')][_0x4167('0x29')];_0x3028b2['model']=_['keys'](_0x585767);_0x3028b2[_0x4167('0x2a')]=_[_0x4167('0x2b')](_0x12b364['query']);_0x3028b2[_0x4167('0x2c')]=_['intersection'](_0x3028b2[_0x4167('0x2d')],_0x3028b2[_0x4167('0x2a')]);_0x489e90['attributes']=_[_0x4167('0x2e')](_0x3028b2[_0x4167('0x2d')],qs['fields'](_0x12b364[_0x4167('0x2a')][_0x4167('0x2f')]));_0x489e90[_0x4167('0x30')]=_0x489e90[_0x4167('0x30')][_0x4167('0x31')]?_0x489e90[_0x4167('0x30')]:_0x3028b2[_0x4167('0x2d')];if(!_0x12b364[_0x4167('0x2a')][_0x4167('0x32')]('nolimit')){_0x489e90['limit']=qs[_0x4167('0x33')](_0x12b364[_0x4167('0x2a')]['limit']);_0x489e90[_0x4167('0x1d')]=qs[_0x4167('0x1d')](_0x12b364[_0x4167('0x2a')][_0x4167('0x1d')]);}_0x489e90[_0x4167('0x34')]=qs[_0x4167('0x35')](_0x12b364[_0x4167('0x2a')][_0x4167('0x35')]);_0x489e90[_0x4167('0x36')]=qs[_0x4167('0x2c')](_[_0x4167('0x37')](_0x12b364[_0x4167('0x2a')],_0x3028b2[_0x4167('0x2c')]));if(_0x12b364['query'][_0x4167('0x38')]){_0x489e90[_0x4167('0x36')]=_[_0x4167('0x39')](_0x489e90[_0x4167('0x36')],{'$or':_[_0x4167('0x3a')](_0x585767,function(_0x20608b){if(_0x20608b[_0x4167('0x3b')][_0x4167('0x3c')]!==_0x4167('0x3d')){var _0x504c0c={};_0x504c0c[_0x20608b[_0x4167('0x3e')]]={'$like':'%'+_0x12b364[_0x4167('0x2a')]['filter']+'%'};return _0x504c0c;}})});}_0x489e90=_[_0x4167('0x39')]({},_0x489e90,_0x12b364[_0x4167('0x3f')]);var _0x33e3ac={'where':_0x489e90[_0x4167('0x36')]};return db[_0x4167('0x28')][_0x4167('0x40')](_0x33e3ac)[_0x4167('0x22')](function(_0x45abd8){_0x3a9ab1[_0x4167('0x40')]=_0x45abd8;if(_0x12b364[_0x4167('0x2a')][_0x4167('0x41')]){_0x489e90['include']=[{'all':!![]}];}return db[_0x4167('0x28')][_0x4167('0x42')](_0x489e90);})[_0x4167('0x22')](function(_0x2b2de5){_0x3a9ab1[_0x4167('0x43')]=_0x2b2de5;return _0x3a9ab1;})['then'](respondWithFilteredResult(_0x3eaea0,_0x489e90))[_0x4167('0x44')](handleError(_0x3eaea0,null));};exports[_0x4167('0x45')]=function(_0x250702,_0x4313fd){var _0x525841={'raw':!![],'where':{'id':_0x250702['params']['id']}},_0x464854={};_0x464854[_0x4167('0x2d')]=_[_0x4167('0x2b')](db[_0x4167('0x28')][_0x4167('0x29')]);_0x464854[_0x4167('0x2a')]=_[_0x4167('0x2b')](_0x250702['query']);_0x464854[_0x4167('0x2c')]=_[_0x4167('0x2e')](_0x464854[_0x4167('0x2d')],_0x464854[_0x4167('0x2a')]);_0x525841['attributes']=_[_0x4167('0x2e')](_0x464854[_0x4167('0x2d')],qs[_0x4167('0x2f')](_0x250702[_0x4167('0x2a')][_0x4167('0x2f')]));_0x525841[_0x4167('0x30')]=_0x525841[_0x4167('0x30')][_0x4167('0x31')]?_0x525841['attributes']:_0x464854[_0x4167('0x2d')];if(_0x250702['query'][_0x4167('0x41')]){_0x525841['include']=[{'all':!![]}];}_0x525841=_[_0x4167('0x39')]({},_0x525841,_0x250702['options']);return db[_0x4167('0x28')][_0x4167('0x46')](_0x525841)[_0x4167('0x22')](handleEntityNotFound(_0x4313fd,null))[_0x4167('0x22')](respondWithResult(_0x4313fd,null))[_0x4167('0x44')](handleError(_0x4313fd,null));};exports[_0x4167('0x47')]=function(_0xa3df06,_0xdbba01){return db[_0x4167('0x28')][_0x4167('0x47')](_0xa3df06[_0x4167('0x48')],{})[_0x4167('0x22')](respondWithResult(_0xdbba01,0xc9))[_0x4167('0x44')](handleError(_0xdbba01,null));};exports[_0x4167('0x49')]=function(_0x241327,_0x5ef9c5){if(_0x241327[_0x4167('0x48')]['id']){delete _0x241327[_0x4167('0x48')]['id'];}return db[_0x4167('0x28')][_0x4167('0x46')]({'where':{'id':_0x241327[_0x4167('0x4a')]['id']}})['then'](handleEntityNotFound(_0x5ef9c5,null))[_0x4167('0x22')](saveUpdates(_0x241327[_0x4167('0x48')],null))[_0x4167('0x22')](respondWithResult(_0x5ef9c5,null))[_0x4167('0x44')](handleError(_0x5ef9c5,null));};exports['destroy']=function(_0x27bd4d,_0x4633ce){return db[_0x4167('0x28')][_0x4167('0x46')]({'where':{'id':_0x27bd4d[_0x4167('0x4a')]['id']}})[_0x4167('0x22')](handleEntityNotFound(_0x4633ce,null))[_0x4167('0x22')](removeEntity(_0x4633ce,null))[_0x4167('0x44')](handleError(_0x4633ce,null));};exports['describe']=function(_0x5253d9,_0x13e8be){return db[_0x4167('0x28')][_0x4167('0x4b')]()[_0x4167('0x22')](respondWithResult(_0x13e8be,null))[_0x4167('0x44')](handleError(_0x13e8be,null));}; \ No newline at end of file +var _0xd9a8=['squel','crypto','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','count','offset','limit','set','Content-Range','json','apply','reject','update','then','destroy','sendStatus','error','stack','name','send','index','ChatQueueReport','rawAttributes','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','map','type','VIRTUAL','field','includeAll','include','findAll','catch','show','options','find','create','body','params','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','lodash'];(function(_0x56d0aa,_0x455804){var _0x38e885=function(_0x3d6254){while(--_0x3d6254){_0x56d0aa['push'](_0x56d0aa['shift']());}};_0x38e885(++_0x455804);}(_0xd9a8,0x12c));var _0x8d9a=function(_0x5daea6,_0x4e7c17){_0x5daea6=_0x5daea6-0x0;var _0x23d522=_0xd9a8[_0x5daea6];return _0x23d522;};'use strict';var pdf=require(_0x8d9a('0x0'));var emlformat=require(_0x8d9a('0x1'));var rimraf=require(_0x8d9a('0x2'));var zipdir=require(_0x8d9a('0x3'));var jsonpatch=require(_0x8d9a('0x4'));var rp=require(_0x8d9a('0x5'));var moment=require(_0x8d9a('0x6'));var BPromise=require(_0x8d9a('0x7'));var Mustache=require('mustache');var util=require(_0x8d9a('0x8'));var path=require(_0x8d9a('0x9'));var sox=require(_0x8d9a('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x8d9a('0xb'));var squel=require(_0x8d9a('0xc'));var crypto=require(_0x8d9a('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x8d9a('0xe'));var querystring=require(_0x8d9a('0xf'));var Papa=require(_0x8d9a('0x10'));var Redis=require(_0x8d9a('0x11'));var authService=require(_0x8d9a('0x12'));var qs=require(_0x8d9a('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8d9a('0x14'));var logger=require(_0x8d9a('0x15'))(_0x8d9a('0x16'));var utils=require(_0x8d9a('0x17'));var config=require(_0x8d9a('0x18'));var db=require(_0x8d9a('0x19'))['db'];function respondWithStatusCode(_0xd08567,_0x185b16){_0x185b16=_0x185b16||0xcc;return function(_0x2dae86){if(_0x2dae86){return _0xd08567['sendStatus'](_0x185b16);}return _0xd08567[_0x8d9a('0x1a')](_0x185b16)[_0x8d9a('0x1b')]();};}function respondWithResult(_0x1caad4,_0x4a17b7){_0x4a17b7=_0x4a17b7||0xc8;return function(_0xbff0d7){if(_0xbff0d7){return _0x1caad4[_0x8d9a('0x1a')](_0x4a17b7)['json'](_0xbff0d7);}};}function respondWithFilteredResult(_0x16f2ed,_0x41b518){return function(_0x415782){if(_0x415782){var _0x1befc6=_0x415782[_0x8d9a('0x1c')],_0x35a1b9=_0x41b518[_0x8d9a('0x1d')],_0xdd4730=_0x41b518[_0x8d9a('0x1d')]+_0x41b518[_0x8d9a('0x1e')],_0x25205a;if(_0xdd4730>=_0x1befc6){_0xdd4730=_0x1befc6;_0x25205a=0xc8;}else{_0x25205a=0xce;}_0x16f2ed[_0x8d9a('0x1a')](_0x25205a);return _0x16f2ed[_0x8d9a('0x1f')](_0x8d9a('0x20'),_0x35a1b9+'-'+_0xdd4730+'/'+_0x1befc6)[_0x8d9a('0x21')](_0x415782);}return null;};}function patchUpdates(_0x409b0e){return function(_0xa9134a){try{jsonpatch[_0x8d9a('0x22')](_0xa9134a,_0x409b0e,!![]);}catch(_0x57b6a3){return BPromise[_0x8d9a('0x23')](_0x57b6a3);}return _0xa9134a['save']();};}function saveUpdates(_0x217c02,_0x5a6383){return function(_0x5dae72){if(_0x5dae72){return _0x5dae72[_0x8d9a('0x24')](_0x217c02)[_0x8d9a('0x25')](function(_0x3aaf46){return _0x3aaf46;});}return null;};}function removeEntity(_0x5acfd5,_0x43fa38){return function(_0x569c2d){if(_0x569c2d){return _0x569c2d[_0x8d9a('0x26')]()['then'](function(){_0x5acfd5['status'](0xcc)[_0x8d9a('0x1b')]();});}};}function handleEntityNotFound(_0x3c024a,_0x127afa){return function(_0x3c8536){if(!_0x3c8536){_0x3c024a[_0x8d9a('0x27')](0x194);}return _0x3c8536;};}function handleError(_0x119421,_0x36bee9){_0x36bee9=_0x36bee9||0x1f4;return function(_0xabf22d){logger[_0x8d9a('0x28')](_0xabf22d[_0x8d9a('0x29')]);if(_0xabf22d[_0x8d9a('0x2a')]){delete _0xabf22d[_0x8d9a('0x2a')];}_0x119421[_0x8d9a('0x1a')](_0x36bee9)[_0x8d9a('0x2b')](_0xabf22d);};}exports[_0x8d9a('0x2c')]=function(_0x3b2730,_0x2da76a){var _0x162053={},_0x31b946={},_0x261a7a={'count':0x0,'rows':[]};var _0x261a34=db[_0x8d9a('0x2d')][_0x8d9a('0x2e')];_0x31b946[_0x8d9a('0x2f')]=_['keys'](_0x261a34);_0x31b946['query']=_[_0x8d9a('0x30')](_0x3b2730[_0x8d9a('0x31')]);_0x31b946['filters']=_[_0x8d9a('0x32')](_0x31b946[_0x8d9a('0x2f')],_0x31b946['query']);_0x162053[_0x8d9a('0x33')]=_[_0x8d9a('0x32')](_0x31b946[_0x8d9a('0x2f')],qs[_0x8d9a('0x34')](_0x3b2730['query'][_0x8d9a('0x34')]));_0x162053[_0x8d9a('0x33')]=_0x162053[_0x8d9a('0x33')][_0x8d9a('0x35')]?_0x162053[_0x8d9a('0x33')]:_0x31b946[_0x8d9a('0x2f')];if(!_0x3b2730[_0x8d9a('0x31')][_0x8d9a('0x36')](_0x8d9a('0x37'))){_0x162053[_0x8d9a('0x1e')]=qs[_0x8d9a('0x1e')](_0x3b2730[_0x8d9a('0x31')]['limit']);_0x162053[_0x8d9a('0x1d')]=qs['offset'](_0x3b2730['query']['offset']);}_0x162053[_0x8d9a('0x38')]=qs[_0x8d9a('0x39')](_0x3b2730[_0x8d9a('0x31')][_0x8d9a('0x39')]);_0x162053['where']=qs[_0x8d9a('0x3a')](_[_0x8d9a('0x3b')](_0x3b2730['query'],_0x31b946[_0x8d9a('0x3a')]));if(_0x3b2730[_0x8d9a('0x31')][_0x8d9a('0x3c')]){_0x162053[_0x8d9a('0x3d')]=_[_0x8d9a('0x3e')](_0x162053[_0x8d9a('0x3d')],{'$or':_[_0x8d9a('0x3f')](_0x261a34,function(_0x338e58){if(_0x338e58[_0x8d9a('0x40')]['key']!==_0x8d9a('0x41')){var _0x3cd3ca={};_0x3cd3ca[_0x338e58[_0x8d9a('0x42')]]={'$like':'%'+_0x3b2730[_0x8d9a('0x31')][_0x8d9a('0x3c')]+'%'};return _0x3cd3ca;}})});}_0x162053=_[_0x8d9a('0x3e')]({},_0x162053,_0x3b2730['options']);var _0x420f47={'where':_0x162053['where']};return db['ChatQueueReport']['count'](_0x420f47)[_0x8d9a('0x25')](function(_0x5235a6){_0x261a7a[_0x8d9a('0x1c')]=_0x5235a6;if(_0x3b2730[_0x8d9a('0x31')][_0x8d9a('0x43')]){_0x162053[_0x8d9a('0x44')]=[{'all':!![]}];}return db[_0x8d9a('0x2d')][_0x8d9a('0x45')](_0x162053);})[_0x8d9a('0x25')](function(_0x2dc046){_0x261a7a['rows']=_0x2dc046;return _0x261a7a;})[_0x8d9a('0x25')](respondWithFilteredResult(_0x2da76a,_0x162053))[_0x8d9a('0x46')](handleError(_0x2da76a,null));};exports[_0x8d9a('0x47')]=function(_0x131eab,_0x211465){var _0x70eaa5={'raw':!![],'where':{'id':_0x131eab['params']['id']}},_0x33d5cd={};_0x33d5cd[_0x8d9a('0x2f')]=_['keys'](db['ChatQueueReport'][_0x8d9a('0x2e')]);_0x33d5cd['query']=_[_0x8d9a('0x30')](_0x131eab[_0x8d9a('0x31')]);_0x33d5cd[_0x8d9a('0x3a')]=_[_0x8d9a('0x32')](_0x33d5cd['model'],_0x33d5cd[_0x8d9a('0x31')]);_0x70eaa5[_0x8d9a('0x33')]=_[_0x8d9a('0x32')](_0x33d5cd['model'],qs['fields'](_0x131eab['query']['fields']));_0x70eaa5['attributes']=_0x70eaa5[_0x8d9a('0x33')]['length']?_0x70eaa5[_0x8d9a('0x33')]:_0x33d5cd[_0x8d9a('0x2f')];if(_0x131eab['query'][_0x8d9a('0x43')]){_0x70eaa5[_0x8d9a('0x44')]=[{'all':!![]}];}_0x70eaa5=_[_0x8d9a('0x3e')]({},_0x70eaa5,_0x131eab[_0x8d9a('0x48')]);return db[_0x8d9a('0x2d')][_0x8d9a('0x49')](_0x70eaa5)[_0x8d9a('0x25')](handleEntityNotFound(_0x211465,null))[_0x8d9a('0x25')](respondWithResult(_0x211465,null))[_0x8d9a('0x46')](handleError(_0x211465,null));};exports[_0x8d9a('0x4a')]=function(_0x462f67,_0x47c007){return db[_0x8d9a('0x2d')][_0x8d9a('0x4a')](_0x462f67['body'],{})[_0x8d9a('0x25')](respondWithResult(_0x47c007,0xc9))[_0x8d9a('0x46')](handleError(_0x47c007,null));};exports[_0x8d9a('0x24')]=function(_0x58434a,_0x4d0ca8){if(_0x58434a[_0x8d9a('0x4b')]['id']){delete _0x58434a[_0x8d9a('0x4b')]['id'];}return db[_0x8d9a('0x2d')][_0x8d9a('0x49')]({'where':{'id':_0x58434a[_0x8d9a('0x4c')]['id']}})[_0x8d9a('0x25')](handleEntityNotFound(_0x4d0ca8,null))[_0x8d9a('0x25')](saveUpdates(_0x58434a['body'],null))[_0x8d9a('0x25')](respondWithResult(_0x4d0ca8,null))['catch'](handleError(_0x4d0ca8,null));};exports[_0x8d9a('0x26')]=function(_0x1c2a19,_0x5eec45){return db[_0x8d9a('0x2d')][_0x8d9a('0x49')]({'where':{'id':_0x1c2a19[_0x8d9a('0x4c')]['id']}})[_0x8d9a('0x25')](handleEntityNotFound(_0x5eec45,null))[_0x8d9a('0x25')](removeEntity(_0x5eec45,null))[_0x8d9a('0x46')](handleError(_0x5eec45,null));};exports['describe']=function(_0x14cb64,_0x2f40a8){return db[_0x8d9a('0x2d')][_0x8d9a('0x4d')]()['then'](respondWithResult(_0x2f40a8,null))['catch'](handleError(_0x2f40a8,null));}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js index 8b2073c..b8534a6 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 _0x1a0a=['./chatQueueReport.attributes','exports','define','ChatQueueReport','report_chat_queue','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0x390947,_0x172077){var _0x18c126=function(_0x3caeae){while(--_0x3caeae){_0x390947['push'](_0x390947['shift']());}};_0x18c126(++_0x172077);}(_0x1a0a,0x1e6));var _0xa1a0=function(_0x3727a9,_0x1c2edb){_0x3727a9=_0x3727a9-0x0;var _0xa16806=_0x1a0a[_0x3727a9];return _0xa16806;};'use strict';var _=require(_0xa1a0('0x0'));var util=require(_0xa1a0('0x1'));var logger=require(_0xa1a0('0x2'))(_0xa1a0('0x3'));var moment=require(_0xa1a0('0x4'));var BPromise=require(_0xa1a0('0x5'));var rp=require(_0xa1a0('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa1a0('0x7'));var config=require('../../config/environment');var attributes=require(_0xa1a0('0x8'));module[_0xa1a0('0x9')]=function(_0x2670a9,_0x4435b6){return _0x2670a9[_0xa1a0('0xa')](_0xa1a0('0xb'),attributes,{'tableName':_0xa1a0('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x3ddd=['report_chat_queue','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','./chatQueueReport.attributes','exports','define','ChatQueueReport'];(function(_0x49d467,_0x8149a3){var _0x46d7de=function(_0x2b1df7){while(--_0x2b1df7){_0x49d467['push'](_0x49d467['shift']());}};_0x46d7de(++_0x8149a3);}(_0x3ddd,0xd1));var _0xd3dd=function(_0x316e35,_0x15a76a){_0x316e35=_0x316e35-0x0;var _0x3713f6=_0x3ddd[_0x316e35];return _0x3713f6;};'use strict';var _=require(_0xd3dd('0x0'));var util=require(_0xd3dd('0x1'));var logger=require(_0xd3dd('0x2'))(_0xd3dd('0x3'));var moment=require(_0xd3dd('0x4'));var BPromise=require('bluebird');var rp=require(_0xd3dd('0x5'));var fs=require('fs');var path=require(_0xd3dd('0x6'));var rimraf=require(_0xd3dd('0x7'));var config=require('../../config/environment');var attributes=require(_0xd3dd('0x8'));module[_0xd3dd('0x9')]=function(_0x106e82,_0x5242e3){return _0x106e82[_0xd3dd('0xa')](_0xd3dd('0xb'),attributes,{'tableName':_0xd3dd('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js index 450361e..97828c7 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 _0x76a7=['then','update','where','attributes','limit','UpdateChatQueueReport','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatQueueReport,\x20%s,\x20%s','message','result','catch','CreateChatQueueReport','ChatQueueReport','create','body','options','raw'];(function(_0x2a57b9,_0x30cfed){var _0x20b6cc=function(_0x1fd421){while(--_0x1fd421){_0x2a57b9['push'](_0x2a57b9['shift']());}};_0x20b6cc(++_0x30cfed);}(_0x76a7,0xd2));var _0x776a=function(_0xc7b26f,_0x1cb695){_0xc7b26f=_0xc7b26f-0x0;var _0x5750f6=_0x76a7[_0xc7b26f];return _0x5750f6;};'use strict';var _=require(_0x776a('0x0'));var util=require('util');var moment=require(_0x776a('0x1'));var BPromise=require('bluebird');var rs=require(_0x776a('0x2'));var fs=require('fs');var Redis=require(_0x776a('0x3'));var db=require(_0x776a('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x776a('0x5'))('rpc');var config=require(_0x776a('0x6'));var jayson=require(_0x776a('0x7'));var client=jayson[_0x776a('0x8')][_0x776a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2fd3ac,_0x16b624,_0x22615f){return new BPromise(function(_0x199c95,_0x3559a7){return client[_0x776a('0xa')](_0x2fd3ac,_0x22615f)['then'](function(_0x813c1a){logger[_0x776a('0xb')]('ChatQueueReport,\x20%s,\x20%s',_0x16b624,_0x776a('0xc'));logger[_0x776a('0xd')](_0x776a('0xe'),_0x16b624,_0x776a('0xc'),JSON[_0x776a('0xf')](_0x813c1a));if(_0x813c1a[_0x776a('0x10')]){if(_0x813c1a['error'][_0x776a('0x11')]===0x1f4){logger['error'](_0x776a('0x12'),_0x16b624,_0x813c1a[_0x776a('0x10')][_0x776a('0x13')]);return _0x3559a7(_0x813c1a[_0x776a('0x10')]['message']);}logger[_0x776a('0x10')](_0x776a('0x12'),_0x16b624,_0x813c1a[_0x776a('0x10')][_0x776a('0x13')]);return _0x199c95(_0x813c1a['error'][_0x776a('0x13')]);}else{logger[_0x776a('0xb')](_0x776a('0x12'),_0x16b624,_0x776a('0xc'));_0x199c95(_0x813c1a[_0x776a('0x14')]['message']);}})[_0x776a('0x15')](function(_0x48329b){logger[_0x776a('0x10')]('ChatQueueReport,\x20%s,\x20%s',_0x16b624,_0x48329b);_0x3559a7(_0x48329b);});});}exports[_0x776a('0x16')]=function(_0x5b7d65){var _0x344f3b=this;return new Promise(function(_0x225287,_0x58c1e3){return db[_0x776a('0x17')][_0x776a('0x18')](_0x5b7d65[_0x776a('0x19')],{'raw':_0x5b7d65[_0x776a('0x1a')]?_0x5b7d65['options'][_0x776a('0x1b')]===undefined?!![]:![]:!![]})[_0x776a('0x1c')](function(_0x5eca7c){logger[_0x776a('0xb')](_0x776a('0x16'),_0x5b7d65);logger[_0x776a('0xd')](_0x776a('0x16'),_0x5b7d65,JSON[_0x776a('0xf')](_0x5eca7c));_0x225287(_0x5eca7c);})['catch'](function(_0x1a35cc){logger[_0x776a('0x10')](_0x776a('0x16'),_0x1a35cc['message'],_0x5b7d65);_0x58c1e3(_0x344f3b[_0x776a('0x10')](0x1f4,_0x1a35cc['message']));});});};exports['UpdateChatQueueReport']=function(_0x5929d1){var _0x263537=this;return new Promise(function(_0x428320,_0xa28940){return db['ChatQueueReport'][_0x776a('0x1d')](_0x5929d1[_0x776a('0x19')],{'raw':_0x5929d1[_0x776a('0x1a')]?_0x5929d1[_0x776a('0x1a')][_0x776a('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5929d1[_0x776a('0x1a')]?_0x5929d1[_0x776a('0x1a')][_0x776a('0x1e')]||null:null,'attributes':_0x5929d1['options']?_0x5929d1[_0x776a('0x1a')][_0x776a('0x1f')]||null:null,'limit':_0x5929d1[_0x776a('0x1a')]?_0x5929d1[_0x776a('0x1a')][_0x776a('0x20')]||null:null})[_0x776a('0x1c')](function(_0x39f0fd){logger[_0x776a('0xb')](_0x776a('0x21'),_0x5929d1);logger['debug'](_0x776a('0x21'),_0x5929d1,JSON[_0x776a('0xf')](_0x39f0fd));_0x428320(_0x39f0fd);})[_0x776a('0x15')](function(_0x55ffe6){logger[_0x776a('0x10')]('UpdateChatQueueReport',_0x55ffe6['message'],_0x5929d1);_0xa28940(_0x263537['error'](0x1f4,_0x55ffe6[_0x776a('0x13')]));});});}; \ No newline at end of file +var _0x10b9=['result','catch','ChatQueueReport','create','body','options','raw','CreateChatQueueReport','UpdateChatQueueReport','update','where','attributes','limit','util','bluebird','ioredis','../../config/utils','../../config/logger','rpc','client','http','request','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','code','error','message'];(function(_0x28d97d,_0x3abe64){var _0x2c538e=function(_0x31e746){while(--_0x31e746){_0x28d97d['push'](_0x28d97d['shift']());}};_0x2c538e(++_0x3abe64);}(_0x10b9,0x16d));var _0x910b=function(_0xb5b373,_0xd2d06){_0xb5b373=_0xb5b373-0x0;var _0xa3d925=_0x10b9[_0xb5b373];return _0xa3d925;};'use strict';var _=require('lodash');var util=require(_0x910b('0x0'));var moment=require('moment');var BPromise=require(_0x910b('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x910b('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x910b('0x3'));var logger=require(_0x910b('0x4'))(_0x910b('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x910b('0x6')][_0x910b('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x2bc611,_0x30990d,_0x2c894e){return new BPromise(function(_0x1a405d,_0x3a94b0){return client[_0x910b('0x8')](_0x2bc611,_0x2c894e)[_0x910b('0x9')](function(_0x176f55){logger[_0x910b('0xa')](_0x910b('0xb'),_0x30990d,_0x910b('0xc'));logger[_0x910b('0xd')](_0x910b('0xe'),_0x30990d,_0x910b('0xc'),JSON[_0x910b('0xf')](_0x176f55));if(_0x176f55['error']){if(_0x176f55['error'][_0x910b('0x10')]===0x1f4){logger[_0x910b('0x11')](_0x910b('0xb'),_0x30990d,_0x176f55[_0x910b('0x11')]['message']);return _0x3a94b0(_0x176f55[_0x910b('0x11')][_0x910b('0x12')]);}logger[_0x910b('0x11')]('ChatQueueReport,\x20%s,\x20%s',_0x30990d,_0x176f55[_0x910b('0x11')][_0x910b('0x12')]);return _0x1a405d(_0x176f55['error']['message']);}else{logger['info'](_0x910b('0xb'),_0x30990d,_0x910b('0xc'));_0x1a405d(_0x176f55[_0x910b('0x13')][_0x910b('0x12')]);}})[_0x910b('0x14')](function(_0x4b1c76){logger['error'](_0x910b('0xb'),_0x30990d,_0x4b1c76);_0x3a94b0(_0x4b1c76);});});}exports['CreateChatQueueReport']=function(_0x5626ee){var _0xf5cc76=this;return new Promise(function(_0x54ba88,_0x11c161){return db[_0x910b('0x15')][_0x910b('0x16')](_0x5626ee[_0x910b('0x17')],{'raw':_0x5626ee[_0x910b('0x18')]?_0x5626ee[_0x910b('0x18')][_0x910b('0x19')]===undefined?!![]:![]:!![]})[_0x910b('0x9')](function(_0x34a378){logger[_0x910b('0xa')](_0x910b('0x1a'),_0x5626ee);logger[_0x910b('0xd')](_0x910b('0x1a'),_0x5626ee,JSON[_0x910b('0xf')](_0x34a378));_0x54ba88(_0x34a378);})[_0x910b('0x14')](function(_0x17e8bb){logger['error'](_0x910b('0x1a'),_0x17e8bb[_0x910b('0x12')],_0x5626ee);_0x11c161(_0xf5cc76[_0x910b('0x11')](0x1f4,_0x17e8bb[_0x910b('0x12')]));});});};exports[_0x910b('0x1b')]=function(_0x3d32ff){var _0x11e7d5=this;return new Promise(function(_0x3fd7a5,_0x57b44a){return db[_0x910b('0x15')][_0x910b('0x1c')](_0x3d32ff[_0x910b('0x17')],{'raw':_0x3d32ff['options']?_0x3d32ff[_0x910b('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3d32ff[_0x910b('0x18')]?_0x3d32ff[_0x910b('0x18')][_0x910b('0x1d')]||null:null,'attributes':_0x3d32ff[_0x910b('0x18')]?_0x3d32ff['options'][_0x910b('0x1e')]||null:null,'limit':_0x3d32ff[_0x910b('0x18')]?_0x3d32ff['options'][_0x910b('0x1f')]||null:null})[_0x910b('0x9')](function(_0x5dd89a){logger[_0x910b('0xa')]('UpdateChatQueueReport',_0x3d32ff);logger[_0x910b('0xd')](_0x910b('0x1b'),_0x3d32ff,JSON[_0x910b('0xf')](_0x5dd89a));_0x3fd7a5(_0x5dd89a);})[_0x910b('0x14')](function(_0x32c292){logger[_0x910b('0x11')](_0x910b('0x1b'),_0x32c292[_0x910b('0x12')],_0x3d32ff);_0x57b44a(_0x11e7d5[_0x910b('0x11')](0x1f4,_0x32c292[_0x910b('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js index afb1ee6..627fae1 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 _0x45e7=['Router','../../components/auth/service','./chatQueueReport.controller','get','isAuthenticated','/describe','/:id','show','create','update','destroy','exports','multer','util','connect-timeout','express'];(function(_0x164eca,_0x555e28){var _0x2ce562=function(_0x148ca6){while(--_0x148ca6){_0x164eca['push'](_0x164eca['shift']());}};_0x2ce562(++_0x555e28);}(_0x45e7,0x1bc));var _0x745e=function(_0x11f226,_0x491e30){_0x11f226=_0x11f226-0x0;var _0x30be77=_0x45e7[_0x11f226];return _0x30be77;};'use strict';var multer=require(_0x745e('0x0'));var util=require(_0x745e('0x1'));var path=require('path');var timeout=require(_0x745e('0x2'));var express=require(_0x745e('0x3'));var router=express[_0x745e('0x4')]();var auth=require(_0x745e('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x745e('0x6'));router[_0x745e('0x7')]('/',auth[_0x745e('0x8')](),controller['index']);router[_0x745e('0x7')](_0x745e('0x9'),auth['isAuthenticated'](),controller['describe']);router[_0x745e('0x7')](_0x745e('0xa'),auth['isAuthenticated'](),controller[_0x745e('0xb')]);router['post']('/',auth[_0x745e('0x8')](),controller[_0x745e('0xc')]);router['put'](_0x745e('0xa'),auth[_0x745e('0x8')](),controller[_0x745e('0xd')]);router['delete'](_0x745e('0xa'),auth[_0x745e('0x8')](),controller[_0x745e('0xe')]);module[_0x745e('0xf')]=router; \ No newline at end of file +var _0xbdcb=['post','create','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','./chatQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show'];(function(_0x4b4889,_0x41cc03){var _0x38aac9=function(_0x514501){while(--_0x514501){_0x4b4889['push'](_0x4b4889['shift']());}};_0x38aac9(++_0x41cc03);}(_0xbdcb,0x141));var _0xbbdc=function(_0x40220a,_0x22feb1){_0x40220a=_0x40220a-0x0;var _0x3903cc=_0xbdcb[_0x40220a];return _0x3903cc;};'use strict';var multer=require(_0xbbdc('0x0'));var util=require(_0xbbdc('0x1'));var path=require(_0xbbdc('0x2'));var timeout=require(_0xbbdc('0x3'));var express=require(_0xbbdc('0x4'));var router=express[_0xbbdc('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0xbbdc('0x6'));var config=require('../../config/environment');var controller=require(_0xbbdc('0x7'));router[_0xbbdc('0x8')]('/',auth[_0xbbdc('0x9')](),controller[_0xbbdc('0xa')]);router[_0xbbdc('0x8')](_0xbbdc('0xb'),auth['isAuthenticated'](),controller[_0xbbdc('0xc')]);router[_0xbbdc('0x8')](_0xbbdc('0xd'),auth[_0xbbdc('0x9')](),controller[_0xbbdc('0xe')]);router[_0xbbdc('0xf')]('/',auth[_0xbbdc('0x9')](),controller[_0xbbdc('0x10')]);router[_0xbbdc('0x11')](_0xbbdc('0xd'),auth[_0xbbdc('0x9')](),controller[_0xbbdc('0x12')]);router[_0xbbdc('0x13')](_0xbbdc('0xd'),auth[_0xbbdc('0x9')](),controller['destroy']);module[_0xbbdc('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 dcf1db5..a0332ec 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 _0xe26d=['DATE','NOW','STRING','agent','queue'];(function(_0x13b8f3,_0x442821){var _0x1a6d06=function(_0x5126f2){while(--_0x5126f2){_0x13b8f3['push'](_0x13b8f3['shift']());}};_0x1a6d06(++_0x442821);}(_0xe26d,0xb6));var _0xde26=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xe26d[_0x20a584];return _0x4b41a8;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0xde26('0x0')],'allowNull':![]},'type':{'type':Sequelize['ENUM']('account',_0xde26('0x1'),_0xde26('0x2')),'allowNull':![],'defaultValue':_0xde26('0x2')},'transferredAt':{'type':Sequelize[_0xde26('0x3')],'allowNull':![],'defaultValue':Sequelize[_0xde26('0x4')]}}; \ No newline at end of file +var _0x5bb3=['exports','STRING','ENUM','account','agent','queue','DATE','moment'];(function(_0x39099b,_0x5722b3){var _0x26c171=function(_0x4eadc1){while(--_0x4eadc1){_0x39099b['push'](_0x39099b['shift']());}};_0x26c171(++_0x5722b3);}(_0x5bb3,0xdf));var _0x35bb=function(_0x40dc9b,_0x43b3ba){_0x40dc9b=_0x40dc9b-0x0;var _0x552fcd=_0x5bb3[_0x40dc9b];return _0x552fcd;};'use strict';var moment=require(_0x35bb('0x0'));var Sequelize=require('sequelize');module[_0x35bb('0x1')]={'uniqueid':{'type':Sequelize[_0x35bb('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x35bb('0x3')](_0x35bb('0x4'),_0x35bb('0x5'),_0x35bb('0x6')),'allowNull':![],'defaultValue':_0x35bb('0x6')},'transferredAt':{'type':Sequelize[_0x35bb('0x7')],'allowNull':![],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js index 4503f89..21917be 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 _0x70e1=['squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','sendStatus','status','end','json','count','offset','limit','set','apply','reject','save','update','then','destroy','name','send','index','model','keys','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','map','VIRTUAL','field','filter','options','ChatTransferReport','includeAll','findAll','rows','catch','params','rawAttributes','length','include','find','create','body','describe','html-pdf','eml-format','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv'];(function(_0x2bd992,_0x468766){var _0x1cd071=function(_0x3e2a71){while(--_0x3e2a71){_0x2bd992['push'](_0x2bd992['shift']());}};_0x1cd071(++_0x468766);}(_0x70e1,0x1e1));var _0x170e=function(_0x335f5c,_0xce622c){_0x335f5c=_0x335f5c-0x0;var _0x27458c=_0x70e1[_0x335f5c];return _0x27458c;};'use strict';var pdf=require(_0x170e('0x0'));var emlformat=require(_0x170e('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x170e('0x2'));var rp=require('request-promise');var moment=require(_0x170e('0x3'));var BPromise=require(_0x170e('0x4'));var Mustache=require(_0x170e('0x5'));var util=require('util');var path=require(_0x170e('0x6'));var sox=require(_0x170e('0x7'));var csv=require(_0x170e('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x170e('0x9'));var crypto=require(_0x170e('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x170e('0xb'));var toCsv=require(_0x170e('0x8'));var querystring=require(_0x170e('0xc'));var Papa=require(_0x170e('0xd'));var Redis=require(_0x170e('0xe'));var authService=require(_0x170e('0xf'));var qs=require(_0x170e('0x10'));var as=require(_0x170e('0x11'));var hardwareService=require(_0x170e('0x12'));var logger=require(_0x170e('0x13'))(_0x170e('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3804aa,_0x147add){_0x147add=_0x147add||0xcc;return function(_0x4b17af){if(_0x4b17af){return _0x3804aa[_0x170e('0x15')](_0x147add);}return _0x3804aa[_0x170e('0x16')](_0x147add)[_0x170e('0x17')]();};}function respondWithResult(_0x5bdfbc,_0x4a2021){_0x4a2021=_0x4a2021||0xc8;return function(_0x4018ac){if(_0x4018ac){return _0x5bdfbc[_0x170e('0x16')](_0x4a2021)[_0x170e('0x18')](_0x4018ac);}};}function respondWithFilteredResult(_0x2708e3,_0x142daa){return function(_0x4e2d8c){if(_0x4e2d8c){var _0x4397c0=_0x4e2d8c[_0x170e('0x19')],_0x180d93=_0x142daa[_0x170e('0x1a')],_0x924094=_0x142daa['offset']+_0x142daa[_0x170e('0x1b')],_0x1e6a04;if(_0x924094>=_0x4397c0){_0x924094=_0x4397c0;_0x1e6a04=0xc8;}else{_0x1e6a04=0xce;}_0x2708e3[_0x170e('0x16')](_0x1e6a04);return _0x2708e3[_0x170e('0x1c')]('Content-Range',_0x180d93+'-'+_0x924094+'/'+_0x4397c0)[_0x170e('0x18')](_0x4e2d8c);}return null;};}function patchUpdates(_0x18debf){return function(_0x4c4b4d){try{jsonpatch[_0x170e('0x1d')](_0x4c4b4d,_0x18debf,!![]);}catch(_0x507b91){return BPromise[_0x170e('0x1e')](_0x507b91);}return _0x4c4b4d[_0x170e('0x1f')]();};}function saveUpdates(_0x45ded4,_0x3d46b3){return function(_0x13c6f7){if(_0x13c6f7){return _0x13c6f7[_0x170e('0x20')](_0x45ded4)[_0x170e('0x21')](function(_0x34d31d){return _0x34d31d;});}return null;};}function removeEntity(_0x4fce05,_0x450b97){return function(_0x1f2b4a){if(_0x1f2b4a){return _0x1f2b4a[_0x170e('0x22')]()[_0x170e('0x21')](function(){_0x4fce05[_0x170e('0x16')](0xcc)[_0x170e('0x17')]();});}};}function handleEntityNotFound(_0x197979,_0x562943){return function(_0x249b65){if(!_0x249b65){_0x197979[_0x170e('0x15')](0x194);}return _0x249b65;};}function handleError(_0x453c15,_0x4c3e56){_0x4c3e56=_0x4c3e56||0x1f4;return function(_0x265148){logger['error'](_0x265148['stack']);if(_0x265148['name']){delete _0x265148[_0x170e('0x23')];}_0x453c15[_0x170e('0x16')](_0x4c3e56)[_0x170e('0x24')](_0x265148);};}exports[_0x170e('0x25')]=function(_0x57853e,_0x5bc25c){var _0x48b7f4={},_0x59ba35={},_0x16a305={'count':0x0,'rows':[]};var _0x4d9d88=db['ChatTransferReport']['rawAttributes'];_0x59ba35[_0x170e('0x26')]=_[_0x170e('0x27')](_0x4d9d88);_0x59ba35[_0x170e('0x28')]=_[_0x170e('0x27')](_0x57853e[_0x170e('0x28')]);_0x59ba35[_0x170e('0x29')]=_['intersection'](_0x59ba35[_0x170e('0x26')],_0x59ba35[_0x170e('0x28')]);_0x48b7f4[_0x170e('0x2a')]=_[_0x170e('0x2b')](_0x59ba35[_0x170e('0x26')],qs[_0x170e('0x2c')](_0x57853e[_0x170e('0x28')][_0x170e('0x2c')]));_0x48b7f4['attributes']=_0x48b7f4[_0x170e('0x2a')]['length']?_0x48b7f4[_0x170e('0x2a')]:_0x59ba35[_0x170e('0x26')];if(!_0x57853e[_0x170e('0x28')][_0x170e('0x2d')](_0x170e('0x2e'))){_0x48b7f4['limit']=qs[_0x170e('0x1b')](_0x57853e[_0x170e('0x28')][_0x170e('0x1b')]);_0x48b7f4[_0x170e('0x1a')]=qs[_0x170e('0x1a')](_0x57853e['query'][_0x170e('0x1a')]);}_0x48b7f4[_0x170e('0x2f')]=qs['sort'](_0x57853e['query'][_0x170e('0x30')]);_0x48b7f4[_0x170e('0x31')]=qs[_0x170e('0x29')](_[_0x170e('0x32')](_0x57853e[_0x170e('0x28')],_0x59ba35[_0x170e('0x29')]));if(_0x57853e[_0x170e('0x28')]['filter']){_0x48b7f4[_0x170e('0x31')]=_[_0x170e('0x33')](_0x48b7f4[_0x170e('0x31')],{'$or':_[_0x170e('0x34')](_0x4d9d88,function(_0x10555f){if(_0x10555f['type']['key']!==_0x170e('0x35')){var _0x1ac80d={};_0x1ac80d[_0x10555f[_0x170e('0x36')]]={'$like':'%'+_0x57853e[_0x170e('0x28')][_0x170e('0x37')]+'%'};return _0x1ac80d;}})});}_0x48b7f4=_[_0x170e('0x33')]({},_0x48b7f4,_0x57853e[_0x170e('0x38')]);var _0x4a4116={'where':_0x48b7f4[_0x170e('0x31')]};return db[_0x170e('0x39')]['count'](_0x4a4116)['then'](function(_0x556e98){_0x16a305[_0x170e('0x19')]=_0x556e98;if(_0x57853e[_0x170e('0x28')][_0x170e('0x3a')]){_0x48b7f4['include']=[{'all':!![]}];}return db[_0x170e('0x39')][_0x170e('0x3b')](_0x48b7f4);})[_0x170e('0x21')](function(_0x2fc1b1){_0x16a305[_0x170e('0x3c')]=_0x2fc1b1;return _0x16a305;})[_0x170e('0x21')](respondWithFilteredResult(_0x5bc25c,_0x48b7f4))[_0x170e('0x3d')](handleError(_0x5bc25c,null));};exports['show']=function(_0x28bce3,_0x281325){var _0x4d2371={'raw':!![],'where':{'id':_0x28bce3[_0x170e('0x3e')]['id']}},_0x1d4b2c={};_0x1d4b2c[_0x170e('0x26')]=_[_0x170e('0x27')](db['ChatTransferReport'][_0x170e('0x3f')]);_0x1d4b2c['query']=_[_0x170e('0x27')](_0x28bce3[_0x170e('0x28')]);_0x1d4b2c['filters']=_[_0x170e('0x2b')](_0x1d4b2c[_0x170e('0x26')],_0x1d4b2c[_0x170e('0x28')]);_0x4d2371[_0x170e('0x2a')]=_[_0x170e('0x2b')](_0x1d4b2c['model'],qs[_0x170e('0x2c')](_0x28bce3[_0x170e('0x28')][_0x170e('0x2c')]));_0x4d2371[_0x170e('0x2a')]=_0x4d2371['attributes'][_0x170e('0x40')]?_0x4d2371[_0x170e('0x2a')]:_0x1d4b2c[_0x170e('0x26')];if(_0x28bce3['query'][_0x170e('0x3a')]){_0x4d2371[_0x170e('0x41')]=[{'all':!![]}];}_0x4d2371=_[_0x170e('0x33')]({},_0x4d2371,_0x28bce3[_0x170e('0x38')]);return db[_0x170e('0x39')][_0x170e('0x42')](_0x4d2371)[_0x170e('0x21')](handleEntityNotFound(_0x281325,null))[_0x170e('0x21')](respondWithResult(_0x281325,null))['catch'](handleError(_0x281325,null));};exports[_0x170e('0x43')]=function(_0x35e4b1,_0x559e76){return db[_0x170e('0x39')][_0x170e('0x43')](_0x35e4b1[_0x170e('0x44')],{})[_0x170e('0x21')](respondWithResult(_0x559e76,0xc9))['catch'](handleError(_0x559e76,null));};exports[_0x170e('0x20')]=function(_0x544f33,_0x1fd35c){if(_0x544f33[_0x170e('0x44')]['id']){delete _0x544f33[_0x170e('0x44')]['id'];}return db[_0x170e('0x39')][_0x170e('0x42')]({'where':{'id':_0x544f33[_0x170e('0x3e')]['id']}})[_0x170e('0x21')](handleEntityNotFound(_0x1fd35c,null))['then'](saveUpdates(_0x544f33['body'],null))[_0x170e('0x21')](respondWithResult(_0x1fd35c,null))[_0x170e('0x3d')](handleError(_0x1fd35c,null));};exports[_0x170e('0x22')]=function(_0x4e5c9c,_0x40cda1){return db[_0x170e('0x39')]['find']({'where':{'id':_0x4e5c9c['params']['id']}})[_0x170e('0x21')](handleEntityNotFound(_0x40cda1,null))[_0x170e('0x21')](removeEntity(_0x40cda1,null))['catch'](handleError(_0x40cda1,null));};exports[_0x170e('0x45')]=function(_0x2eb1a6,_0x3e01b5){return db['ChatTransferReport']['describe']()[_0x170e('0x21')](respondWithResult(_0x3e01b5,null))[_0x170e('0x3d')](handleError(_0x3e01b5,null));}; \ No newline at end of file +var _0xd2ad=['to-csv','ejs','crypto','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','set','Content-Range','json','apply','reject','update','then','destroy','error','name','send','rawAttributes','model','query','keys','intersection','attributes','fields','nolimit','limit','sort','where','filters','pick','filter','merge','map','type','key','VIRTUAL','options','ChatTransferReport','count','includeAll','findAll','rows','catch','show','params','include','find','create','body','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd2ad,0x1e7));var _0xdd2a=function(_0x1f8053,_0x111077){_0x1f8053=_0x1f8053-0x0;var _0x174fd8=_0xd2ad[_0x1f8053];return _0x174fd8;};'use strict';var pdf=require(_0xdd2a('0x0'));var emlformat=require(_0xdd2a('0x1'));var rimraf=require(_0xdd2a('0x2'));var zipdir=require(_0xdd2a('0x3'));var jsonpatch=require(_0xdd2a('0x4'));var rp=require(_0xdd2a('0x5'));var moment=require(_0xdd2a('0x6'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xdd2a('0x7'));var path=require(_0xdd2a('0x8'));var sox=require(_0xdd2a('0x9'));var csv=require(_0xdd2a('0xa'));var ejs=require(_0xdd2a('0xb'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0xdd2a('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xdd2a('0xd'));var toCsv=require('to-csv');var querystring=require(_0xdd2a('0xe'));var Papa=require(_0xdd2a('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xdd2a('0x10'));var as=require(_0xdd2a('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xdd2a('0x12'))(_0xdd2a('0x13'));var utils=require(_0xdd2a('0x14'));var config=require(_0xdd2a('0x15'));var db=require(_0xdd2a('0x16'))['db'];function respondWithStatusCode(_0x4896f9,_0x5157d1){_0x5157d1=_0x5157d1||0xcc;return function(_0x51e0df){if(_0x51e0df){return _0x4896f9[_0xdd2a('0x17')](_0x5157d1);}return _0x4896f9[_0xdd2a('0x18')](_0x5157d1)[_0xdd2a('0x19')]();};}function respondWithResult(_0x59b144,_0x7c5bbc){_0x7c5bbc=_0x7c5bbc||0xc8;return function(_0x29a705){if(_0x29a705){return _0x59b144['status'](_0x7c5bbc)['json'](_0x29a705);}};}function respondWithFilteredResult(_0x2ee4ce,_0x4d6245){return function(_0x5cc894){if(_0x5cc894){var _0x23e2ba=_0x5cc894['count'],_0x46a43b=_0x4d6245[_0xdd2a('0x1a')],_0x3d1a35=_0x4d6245[_0xdd2a('0x1a')]+_0x4d6245['limit'],_0x2d4f18;if(_0x3d1a35>=_0x23e2ba){_0x3d1a35=_0x23e2ba;_0x2d4f18=0xc8;}else{_0x2d4f18=0xce;}_0x2ee4ce['status'](_0x2d4f18);return _0x2ee4ce[_0xdd2a('0x1b')](_0xdd2a('0x1c'),_0x46a43b+'-'+_0x3d1a35+'/'+_0x23e2ba)[_0xdd2a('0x1d')](_0x5cc894);}return null;};}function patchUpdates(_0x3db851){return function(_0x5d8d50){try{jsonpatch[_0xdd2a('0x1e')](_0x5d8d50,_0x3db851,!![]);}catch(_0x2152d0){return BPromise[_0xdd2a('0x1f')](_0x2152d0);}return _0x5d8d50['save']();};}function saveUpdates(_0x1a2ca9,_0x51b601){return function(_0x29d51d){if(_0x29d51d){return _0x29d51d[_0xdd2a('0x20')](_0x1a2ca9)[_0xdd2a('0x21')](function(_0xe49c0b){return _0xe49c0b;});}return null;};}function removeEntity(_0x278c92,_0x3beb07){return function(_0x57d58a){if(_0x57d58a){return _0x57d58a[_0xdd2a('0x22')]()[_0xdd2a('0x21')](function(){_0x278c92[_0xdd2a('0x18')](0xcc)[_0xdd2a('0x19')]();});}};}function handleEntityNotFound(_0x178ceb,_0x36f61f){return function(_0x45b634){if(!_0x45b634){_0x178ceb[_0xdd2a('0x17')](0x194);}return _0x45b634;};}function handleError(_0x27b811,_0x86a7a0){_0x86a7a0=_0x86a7a0||0x1f4;return function(_0xd0ab09){logger[_0xdd2a('0x23')](_0xd0ab09['stack']);if(_0xd0ab09[_0xdd2a('0x24')]){delete _0xd0ab09[_0xdd2a('0x24')];}_0x27b811['status'](_0x86a7a0)[_0xdd2a('0x25')](_0xd0ab09);};}exports['index']=function(_0x322d71,_0x92eccb){var _0x282c34={},_0x4a6f61={},_0x250e39={'count':0x0,'rows':[]};var _0x42b506=db['ChatTransferReport'][_0xdd2a('0x26')];_0x4a6f61[_0xdd2a('0x27')]=_['keys'](_0x42b506);_0x4a6f61[_0xdd2a('0x28')]=_[_0xdd2a('0x29')](_0x322d71[_0xdd2a('0x28')]);_0x4a6f61['filters']=_[_0xdd2a('0x2a')](_0x4a6f61[_0xdd2a('0x27')],_0x4a6f61['query']);_0x282c34[_0xdd2a('0x2b')]=_[_0xdd2a('0x2a')](_0x4a6f61[_0xdd2a('0x27')],qs[_0xdd2a('0x2c')](_0x322d71['query']['fields']));_0x282c34[_0xdd2a('0x2b')]=_0x282c34[_0xdd2a('0x2b')]['length']?_0x282c34[_0xdd2a('0x2b')]:_0x4a6f61[_0xdd2a('0x27')];if(!_0x322d71[_0xdd2a('0x28')]['hasOwnProperty'](_0xdd2a('0x2d'))){_0x282c34[_0xdd2a('0x2e')]=qs['limit'](_0x322d71['query'][_0xdd2a('0x2e')]);_0x282c34[_0xdd2a('0x1a')]=qs['offset'](_0x322d71[_0xdd2a('0x28')]['offset']);}_0x282c34['order']=qs['sort'](_0x322d71[_0xdd2a('0x28')][_0xdd2a('0x2f')]);_0x282c34[_0xdd2a('0x30')]=qs[_0xdd2a('0x31')](_[_0xdd2a('0x32')](_0x322d71[_0xdd2a('0x28')],_0x4a6f61[_0xdd2a('0x31')]));if(_0x322d71[_0xdd2a('0x28')][_0xdd2a('0x33')]){_0x282c34[_0xdd2a('0x30')]=_[_0xdd2a('0x34')](_0x282c34[_0xdd2a('0x30')],{'$or':_[_0xdd2a('0x35')](_0x42b506,function(_0x32cbbc){if(_0x32cbbc[_0xdd2a('0x36')][_0xdd2a('0x37')]!==_0xdd2a('0x38')){var _0x464f48={};_0x464f48[_0x32cbbc['field']]={'$like':'%'+_0x322d71['query'][_0xdd2a('0x33')]+'%'};return _0x464f48;}})});}_0x282c34=_[_0xdd2a('0x34')]({},_0x282c34,_0x322d71[_0xdd2a('0x39')]);var _0x2cf67f={'where':_0x282c34[_0xdd2a('0x30')]};return db[_0xdd2a('0x3a')][_0xdd2a('0x3b')](_0x2cf67f)[_0xdd2a('0x21')](function(_0x1ffee0){_0x250e39[_0xdd2a('0x3b')]=_0x1ffee0;if(_0x322d71[_0xdd2a('0x28')][_0xdd2a('0x3c')]){_0x282c34['include']=[{'all':!![]}];}return db[_0xdd2a('0x3a')][_0xdd2a('0x3d')](_0x282c34);})['then'](function(_0x4934fc){_0x250e39[_0xdd2a('0x3e')]=_0x4934fc;return _0x250e39;})[_0xdd2a('0x21')](respondWithFilteredResult(_0x92eccb,_0x282c34))[_0xdd2a('0x3f')](handleError(_0x92eccb,null));};exports[_0xdd2a('0x40')]=function(_0x51bc3b,_0x146aa4){var _0x3d21ca={'raw':!![],'where':{'id':_0x51bc3b[_0xdd2a('0x41')]['id']}},_0x204495={};_0x204495['model']=_[_0xdd2a('0x29')](db['ChatTransferReport'][_0xdd2a('0x26')]);_0x204495['query']=_['keys'](_0x51bc3b['query']);_0x204495['filters']=_[_0xdd2a('0x2a')](_0x204495[_0xdd2a('0x27')],_0x204495[_0xdd2a('0x28')]);_0x3d21ca[_0xdd2a('0x2b')]=_[_0xdd2a('0x2a')](_0x204495[_0xdd2a('0x27')],qs[_0xdd2a('0x2c')](_0x51bc3b['query'][_0xdd2a('0x2c')]));_0x3d21ca[_0xdd2a('0x2b')]=_0x3d21ca[_0xdd2a('0x2b')]['length']?_0x3d21ca[_0xdd2a('0x2b')]:_0x204495[_0xdd2a('0x27')];if(_0x51bc3b[_0xdd2a('0x28')][_0xdd2a('0x3c')]){_0x3d21ca[_0xdd2a('0x42')]=[{'all':!![]}];}_0x3d21ca=_[_0xdd2a('0x34')]({},_0x3d21ca,_0x51bc3b['options']);return db[_0xdd2a('0x3a')][_0xdd2a('0x43')](_0x3d21ca)[_0xdd2a('0x21')](handleEntityNotFound(_0x146aa4,null))[_0xdd2a('0x21')](respondWithResult(_0x146aa4,null))[_0xdd2a('0x3f')](handleError(_0x146aa4,null));};exports[_0xdd2a('0x44')]=function(_0xaf0773,_0x483541){return db[_0xdd2a('0x3a')][_0xdd2a('0x44')](_0xaf0773[_0xdd2a('0x45')],{})[_0xdd2a('0x21')](respondWithResult(_0x483541,0xc9))['catch'](handleError(_0x483541,null));};exports[_0xdd2a('0x20')]=function(_0x189fd8,_0x2badca){if(_0x189fd8[_0xdd2a('0x45')]['id']){delete _0x189fd8[_0xdd2a('0x45')]['id'];}return db[_0xdd2a('0x3a')][_0xdd2a('0x43')]({'where':{'id':_0x189fd8[_0xdd2a('0x41')]['id']}})['then'](handleEntityNotFound(_0x2badca,null))[_0xdd2a('0x21')](saveUpdates(_0x189fd8['body'],null))[_0xdd2a('0x21')](respondWithResult(_0x2badca,null))[_0xdd2a('0x3f')](handleError(_0x2badca,null));};exports[_0xdd2a('0x22')]=function(_0x596e61,_0x518cd5){return db[_0xdd2a('0x3a')]['find']({'where':{'id':_0x596e61['params']['id']}})['then'](handleEntityNotFound(_0x518cd5,null))[_0xdd2a('0x21')](removeEntity(_0x518cd5,null))['catch'](handleError(_0x518cd5,null));};exports[_0xdd2a('0x46')]=function(_0x51c920,_0x3b0d88){return db[_0xdd2a('0x3a')]['describe']()['then'](respondWithResult(_0x3b0d88,null))['catch'](handleError(_0x3b0d88,null));}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js index c794be9..0c225a0 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 _0xa73e=['report_chat_transfer','uniqueid','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','ChatTransferReport'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa73e,0x1be));var _0xea73=function(_0x4118bb,_0x13c41c){_0x4118bb=_0x4118bb-0x0;var _0x5c9df2=_0xa73e[_0x4118bb];return _0x5c9df2;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xea73('0x0'));var moment=require(_0xea73('0x1'));var BPromise=require(_0xea73('0x2'));var rp=require(_0xea73('0x3'));var fs=require('fs');var path=require(_0xea73('0x4'));var rimraf=require(_0xea73('0x5'));var config=require(_0xea73('0x6'));var attributes=require('./chatTransferReport.attributes');module[_0xea73('0x7')]=function(_0x40077e,_0x2a0f64){return _0x40077e[_0xea73('0x8')](_0xea73('0x9'),attributes,{'tableName':_0xea73('0xa'),'paranoid':![],'indexes':[{'name':_0xea73('0xb'),'fields':[_0xea73('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x9601=['util','../../config/logger','api','request-promise','path','exports','ChatTransferReport','report_chat_transfer','uniqueid','lodash'];(function(_0xc6eed2,_0xbc2550){var _0x5e9611=function(_0x28adc6){while(--_0x28adc6){_0xc6eed2['push'](_0xc6eed2['shift']());}};_0x5e9611(++_0xbc2550);}(_0x9601,0xdb));var _0x1960=function(_0x42819,_0x536bf0){_0x42819=_0x42819-0x0;var _0x333751=_0x9601[_0x42819];return _0x333751;};'use strict';var _=require(_0x1960('0x0'));var util=require(_0x1960('0x1'));var logger=require(_0x1960('0x2'))(_0x1960('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x1960('0x4'));var fs=require('fs');var path=require(_0x1960('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./chatTransferReport.attributes');module[_0x1960('0x6')]=function(_0x2d9eba,_0x258f19){return _0x2d9eba['define'](_0x1960('0x7'),attributes,{'tableName':_0x1960('0x8'),'paranoid':![],'indexes':[{'name':_0x1960('0x9'),'fields':[_0x1960('0x9')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js index fb6a579..14e7682 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 _0x1dab=['catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','then','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0xaee1ab,_0x260f30){var _0x4f0ed5=function(_0x2e65c5){while(--_0x2e65c5){_0xaee1ab['push'](_0xaee1ab['shift']());}};_0x4f0ed5(++_0x260f30);}(_0x1dab,0x143));var _0xb1da=function(_0x10a29d,_0x6b51d3){_0x10a29d=_0x10a29d-0x0;var _0xff1b77=_0x1dab[_0x10a29d];return _0xff1b77;};'use strict';var _=require(_0xb1da('0x0'));var util=require(_0xb1da('0x1'));var moment=require('moment');var BPromise=require(_0xb1da('0x2'));var rs=require(_0xb1da('0x3'));var fs=require('fs');var Redis=require(_0xb1da('0x4'));var db=require(_0xb1da('0x5'))['db'];var utils=require(_0xb1da('0x6'));var logger=require(_0xb1da('0x7'))(_0xb1da('0x8'));var config=require('../../config/environment');var jayson=require(_0xb1da('0x9'));var client=jayson[_0xb1da('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3de965,_0x28ef31,_0x28060f){return new BPromise(function(_0x10dbcf,_0x654dfb){return client['request'](_0x3de965,_0x28060f)[_0xb1da('0xb')](function(_0x51ffef){logger[_0xb1da('0xc')](_0xb1da('0xd'),_0x28ef31,_0xb1da('0xe'));logger[_0xb1da('0xf')](_0xb1da('0x10'),_0x28ef31,_0xb1da('0xe'),JSON[_0xb1da('0x11')](_0x51ffef));if(_0x51ffef[_0xb1da('0x12')]){if(_0x51ffef[_0xb1da('0x12')][_0xb1da('0x13')]===0x1f4){logger[_0xb1da('0x12')](_0xb1da('0xd'),_0x28ef31,_0x51ffef[_0xb1da('0x12')][_0xb1da('0x14')]);return _0x654dfb(_0x51ffef['error'][_0xb1da('0x14')]);}logger['error']('ChatTransferReport,\x20%s,\x20%s',_0x28ef31,_0x51ffef[_0xb1da('0x12')][_0xb1da('0x14')]);return _0x10dbcf(_0x51ffef[_0xb1da('0x12')][_0xb1da('0x14')]);}else{logger[_0xb1da('0xc')](_0xb1da('0xd'),_0x28ef31,_0xb1da('0xe'));_0x10dbcf(_0x51ffef[_0xb1da('0x15')][_0xb1da('0x14')]);}})[_0xb1da('0x16')](function(_0x362a96){logger['error']('ChatTransferReport,\x20%s,\x20%s',_0x28ef31,_0x362a96);_0x654dfb(_0x362a96);});});} \ No newline at end of file +var _0x75ec=['message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','ChatTransferReport,\x20%s,\x20%s','ChatTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x53976f,_0x2bc57b){var _0x423224=function(_0x25fb09){while(--_0x25fb09){_0x53976f['push'](_0x53976f['shift']());}};_0x423224(++_0x2bc57b);}(_0x75ec,0x1e6));var _0xc75e=function(_0x4a747d,_0x3b747f){_0x4a747d=_0x4a747d-0x0;var _0x3a5b5c=_0x75ec[_0x4a747d];return _0x3a5b5c;};'use strict';var _=require(_0xc75e('0x0'));var util=require('util');var moment=require(_0xc75e('0x1'));var BPromise=require(_0xc75e('0x2'));var rs=require(_0xc75e('0x3'));var fs=require('fs');var Redis=require(_0xc75e('0x4'));var db=require(_0xc75e('0x5'))['db'];var utils=require(_0xc75e('0x6'));var logger=require(_0xc75e('0x7'))(_0xc75e('0x8'));var config=require(_0xc75e('0x9'));var jayson=require(_0xc75e('0xa'));var client=jayson['client'][_0xc75e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1f54ce,_0x5ee6bd,_0x2d13dc){return new BPromise(function(_0x23db38,_0x25580e){return client['request'](_0x1f54ce,_0x2d13dc)[_0xc75e('0xc')](function(_0x187d30){logger[_0xc75e('0xd')](_0xc75e('0xe'),_0x5ee6bd,'request\x20sent');logger['debug'](_0xc75e('0xf'),_0x5ee6bd,_0xc75e('0x10'),JSON[_0xc75e('0x11')](_0x187d30));if(_0x187d30[_0xc75e('0x12')]){if(_0x187d30[_0xc75e('0x12')][_0xc75e('0x13')]===0x1f4){logger[_0xc75e('0x12')](_0xc75e('0xe'),_0x5ee6bd,_0x187d30[_0xc75e('0x12')]['message']);return _0x25580e(_0x187d30[_0xc75e('0x12')][_0xc75e('0x14')]);}logger[_0xc75e('0x12')](_0xc75e('0xe'),_0x5ee6bd,_0x187d30[_0xc75e('0x12')][_0xc75e('0x14')]);return _0x23db38(_0x187d30[_0xc75e('0x12')][_0xc75e('0x14')]);}else{logger[_0xc75e('0xd')]('ChatTransferReport,\x20%s,\x20%s',_0x5ee6bd,_0xc75e('0x10'));_0x23db38(_0x187d30[_0xc75e('0x15')][_0xc75e('0x14')]);}})[_0xc75e('0x16')](function(_0x54b30d){logger['error']('ChatTransferReport,\x20%s,\x20%s',_0x5ee6bd,_0x54b30d);_0x25580e(_0x54b30d);});});} \ No newline at end of file diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js index ade1dba..fae63dc 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 _0xb10b=['../../config/environment','./chatTransferReport.controller','get','isAuthenticated','/describe','describe','/:id','show','post','create','update','delete','exports','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service'];(function(_0x4a96ca,_0x13754e){var _0x2aed48=function(_0x361330){while(--_0x361330){_0x4a96ca['push'](_0x4a96ca['shift']());}};_0x2aed48(++_0x13754e);}(_0xb10b,0x12a));var _0xbb10=function(_0x19e9a7,_0x57e686){_0x19e9a7=_0x19e9a7-0x0;var _0x3a8442=_0xb10b[_0x19e9a7];return _0x3a8442;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var auth=require(_0xbb10('0x4'));var interaction=require(_0xbb10('0x5'));var config=require(_0xbb10('0x6'));var controller=require(_0xbb10('0x7'));router[_0xbb10('0x8')]('/',auth[_0xbb10('0x9')](),controller['index']);router[_0xbb10('0x8')](_0xbb10('0xa'),auth['isAuthenticated'](),controller[_0xbb10('0xb')]);router[_0xbb10('0x8')](_0xbb10('0xc'),auth[_0xbb10('0x9')](),controller[_0xbb10('0xd')]);router[_0xbb10('0xe')]('/',auth[_0xbb10('0x9')](),controller[_0xbb10('0xf')]);router['put']('/:id',auth[_0xbb10('0x9')](),controller[_0xbb10('0x10')]);router[_0xbb10('0x11')]('/:id',auth[_0xbb10('0x9')](),controller['destroy']);module[_0xbb10('0x12')]=router; \ No newline at end of file +var _0x5f66=['describe','get','/:id','show','create','put','delete','destroy','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./chatTransferReport.controller','isAuthenticated','index'];(function(_0x22f8ab,_0x15d8ff){var _0x2a70e5=function(_0x5e6895){while(--_0x5e6895){_0x22f8ab['push'](_0x22f8ab['shift']());}};_0x2a70e5(++_0x15d8ff);}(_0x5f66,0x1a0));var _0x65f6=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0x5f66[_0x465028];return _0xb783d4;};'use strict';var multer=require('multer');var util=require(_0x65f6('0x0'));var path=require('path');var timeout=require(_0x65f6('0x1'));var express=require(_0x65f6('0x2'));var router=express[_0x65f6('0x3')]();var auth=require(_0x65f6('0x4'));var interaction=require(_0x65f6('0x5'));var config=require('../../config/environment');var controller=require(_0x65f6('0x6'));router['get']('/',auth[_0x65f6('0x7')](),controller[_0x65f6('0x8')]);router['get']('/describe',auth[_0x65f6('0x7')](),controller[_0x65f6('0x9')]);router[_0x65f6('0xa')](_0x65f6('0xb'),auth[_0x65f6('0x7')](),controller[_0x65f6('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0x65f6('0xd')]);router[_0x65f6('0xe')](_0x65f6('0xb'),auth[_0x65f6('0x7')](),controller['update']);router[_0x65f6('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x65f6('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js index e049e06..f71a9b9 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 _0xa600=['#9f946a','#ffffff','INTEGER','BOOLEAN','rounded','squared','We\x20are\x20here!','Chat','Contact\x20us','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Type\x20a\x20message','Send','Skip','Feedback','ENUM','thumb','star','stringify','name','text','getDataValue','onlineForm','parse','input','textarea','Comments','Leave\x20your\x20comments','offlineForm','setDataValue','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','alternate','#fafafa','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDisposition','sequelize','randomstring','exports','STRING','email','Agent'];(function(_0x359068,_0x5bf191){var _0x1175f1=function(_0x44fbb9){while(--_0x44fbb9){_0x359068['push'](_0x359068['shift']());}};_0x1175f1(++_0x5bf191);}(_0xa600,0x1ee));var _0x0a60=function(_0x31295c,_0x2f2b82){_0x31295c=_0x31295c-0x0;var _0x2c150e=_0xa600[_0x31295c];return _0x2c150e;};'use strict';var Sequelize=require(_0x0a60('0x0'));var rs=require(_0x0a60('0x1'));module[_0x0a60('0x2')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'address':{'type':Sequelize[_0x0a60('0x3')],'allowNull':![],'unique':'address'},'description':{'type':Sequelize[_0x0a60('0x3')]},'mapKey':{'type':Sequelize[_0x0a60('0x3')],'defaultValue':'email'},'mapKeyOffline':{'type':Sequelize[_0x0a60('0x3')],'defaultValue':_0x0a60('0x4')},'key':{'type':Sequelize[_0x0a60('0x3')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x0a60('0x3')],'defaultValue':_0x0a60('0x5')},'customerAlias':{'type':Sequelize[_0x0a60('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x0a60('0x6'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x0a60('0x6'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x0a60('0x7'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x0a60('0x8')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x0a60('0x3')]},'animation':{'type':Sequelize[_0x0a60('0x9')],'defaultValue':!![]},'header_shape':{'type':Sequelize['ENUM'](_0x0a60('0xa'),_0x0a60('0xb')),'defaultValue':_0x0a60('0xa')},'header_online':{'type':Sequelize['STRING'],'defaultValue':_0x0a60('0xc')},'start_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0x0a60('0xd')},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':'Send'},'header_offline':{'type':Sequelize[_0x0a60('0x3')],'defaultValue':_0x0a60('0xe')},'download_transcript':{'type':Sequelize[_0x0a60('0x9')],'defaultValue':!![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whiteLabel':{'type':Sequelize['STRING'],'defaultValue':'Powered\x20by\x20xCALLY'},'defaultWhiteLabel':{'type':Sequelize[_0x0a60('0x9')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x0a60('0xf')]},'closingQuestion':{'type':Sequelize[_0x0a60('0x3')],'defaultValue':_0x0a60('0x10')},'formSubmitSuccessMessage':{'type':Sequelize[_0x0a60('0x3')],'defaultValue':_0x0a60('0x11')},'formSubmitFailureMessage':{'type':Sequelize[_0x0a60('0x3')],'defaultValue':_0x0a60('0x12')},'noteTitle':{'type':Sequelize[_0x0a60('0x3')],'defaultValue':_0x0a60('0x13')},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':_0x0a60('0x14')},'closingMessage':{'type':Sequelize[_0x0a60('0x3')],'defaultValue':'Thanks\x20you\x20for\x20your\x20time!'},'closingMessageButton':{'type':Sequelize[_0x0a60('0x3')],'defaultValue':_0x0a60('0x15')},'skipMessageButton':{'type':Sequelize[_0x0a60('0x3')],'defaultValue':_0x0a60('0x16')},'conditionAgreement':{'type':Sequelize[_0x0a60('0x9')],'defaultValue':![]},'enableRating':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x0a60('0x9')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x0a60('0x9')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x0a60('0x3')],'defaultValue':_0x0a60('0x17')},'ratingType':{'type':Sequelize[_0x0a60('0x18')]('star',_0x0a60('0x19')),'defaultValue':_0x0a60('0x1a')},'ratingStarsNumber':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x0a60('0xf')],'defaultValue':function(){return JSON[_0x0a60('0x1b')]({'items':[{'type':'input','variable':null,'config':{'placeholder':_0x0a60('0x1c'),'type':_0x0a60('0x1d'),'required':!![]},'props':{'title':_0x0a60('0x1c'),'helpText':''}},{'type':'input','props':{'title':_0x0a60('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0x0a60('0x4'),'type':'email'},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x0a60('0x1e')](_0x0a60('0x1f'))?JSON[_0x0a60('0x20')](this[_0x0a60('0x1e')](_0x0a60('0x1f'))):{};},'set':function(_0x2f3559){return this['setDataValue'](_0x0a60('0x1f'),JSON['stringify'](_0x2f3559));}},'offlineForm':{'type':Sequelize[_0x0a60('0xf')],'defaultValue':function(){return JSON[_0x0a60('0x1b')]({'items':[{'type':_0x0a60('0x21'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':'email','type':_0x0a60('0x4')},'variable':null},{'type':_0x0a60('0x22'),'config':{'placeholder':_0x0a60('0x23')},'props':{'title':'Comments','helpText':_0x0a60('0x24')}}],'fromKey':0x0});},'get':function(){return this[_0x0a60('0x1e')](_0x0a60('0x25'))?JSON['parse'](this[_0x0a60('0x1e')](_0x0a60('0x25'))):{};},'set':function(_0xd019c7){return this[_0x0a60('0x26')](_0x0a60('0x25'),JSON['stringify'](_0xd019c7));}},'token':{'type':Sequelize[_0x0a60('0x3')],'defaultValue':function(){return rs['generate']();}},'autoclose':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x0a60('0x9')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize['STRING']},'forwardOffline':{'type':Sequelize[_0x0a60('0x9')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x0a60('0x3')]},'waitingTitle':{'type':Sequelize[_0x0a60('0x3')],'defaultValue':_0x0a60('0x27')},'waitingMessage':{'type':Sequelize['STRING'],'defaultValue':_0x0a60('0x28')},'offlineMessageSubject':{'type':Sequelize['STRING'],'defaultValue':_0x0a60('0x29')},'offlineMessageBody':{'type':Sequelize['STRING'],'defaultValue':'You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:'},'enableUnmanagedNote':{'type':Sequelize[_0x0a60('0x9')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x0a60('0x3')],'defaultValue':_0x0a60('0x2a')},'skipUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0x0a60('0x16')},'sendUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0x0a60('0x15')},'enableCustomerAttachment':{'type':Sequelize[_0x0a60('0x9')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x0a60('0x9')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x0a60('0xf')]},'showAgentAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timezone':{'type':Sequelize[_0x0a60('0x3')]},'notificationTemplate':{'type':Sequelize[_0x0a60('0xf')],'defaultValue':function(){return _0x0a60('0x2b');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x0a60('0x9')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x0a60('0x9')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x0a60('0x3')],'defaultValue':_0x0a60('0x2c')},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x0a60('0x3')],'defaultValue':'bottom_right'},'verticalAlignment':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':_0x0a60('0x2d')},'defaultTitle':{'type':Sequelize['STRING']},'customerAvatar':{'type':Sequelize[_0x0a60('0xf')]},'showCustomerAvatar':{'type':Sequelize[_0x0a60('0x9')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x0a60('0x8')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x0a60('0x3')],'allowNull':![],'defaultValue':_0x0a60('0x2e'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x0a60('0x9')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x0a60('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x0a60('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x0a60('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize['STRING'],'defaultValue':'System'},'systemAvatar':{'type':Sequelize['TEXT']},'mandatoryDispositionPauseId':{'type':Sequelize[_0x0a60('0x8')],'comment':_0x0a60('0x2f')},'mandatoryDisposition':{'type':Sequelize[_0x0a60('0x9')],'defaultValue':![],'comment':_0x0a60('0x30'),'set':function(_0x3d5aa2){if(!_0x3d5aa2)this[_0x0a60('0x26')]('mandatoryDispositionPauseId',null);this[_0x0a60('0x26')](_0x0a60('0x31'),_0x3d5aa2);}}}; \ No newline at end of file +var _0xef89=['Skip','Feedback','thumb','star','stringify','input','name','text','getDataValue','onlineForm','parse','setDataValue','textarea','Comments','Leave\x20your\x20comments','offlineForm','generate','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','bottom_right','alternate','System','mandatoryDisposition','randomstring','exports','STRING','address','email','Agent','#9f946a','BOOLEAN','ENUM','rounded','We\x20are\x20here!','Send','Contact\x20us','INTEGER','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20submission\x20error','Type\x20a\x20message'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xef89,0x71));var _0x9ef8=function(_0x21d355,_0x3ff119){_0x21d355=_0x21d355-0x0;var _0x2caaa3=_0xef89[_0x21d355];return _0x2caaa3;};'use strict';var Sequelize=require('sequelize');var rs=require(_0x9ef8('0x0'));module[_0x9ef8('0x1')]={'name':{'type':Sequelize[_0x9ef8('0x2')],'allowNull':![]},'address':{'type':Sequelize[_0x9ef8('0x2')],'allowNull':![],'unique':_0x9ef8('0x3')},'description':{'type':Sequelize['STRING']},'mapKey':{'type':Sequelize[_0x9ef8('0x2')],'defaultValue':_0x9ef8('0x4')},'mapKeyOffline':{'type':Sequelize[_0x9ef8('0x2')],'defaultValue':_0x9ef8('0x4')},'key':{'type':Sequelize[_0x9ef8('0x2')],'allowNull':![]},'agentAlias':{'type':Sequelize['STRING'],'defaultValue':_0x9ef8('0x5')},'customerAlias':{'type':Sequelize[_0x9ef8('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x9ef8('0x2')],'allowNull':![],'defaultValue':'#9f946a','validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x9ef8('0x2')],'allowNull':![],'defaultValue':_0x9ef8('0x6'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x9ef8('0x2')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xf},'remote':{'type':Sequelize[_0x9ef8('0x2')]},'animation':{'type':Sequelize[_0x9ef8('0x7')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x9ef8('0x8')](_0x9ef8('0x9'),'squared'),'defaultValue':_0x9ef8('0x9')},'header_online':{'type':Sequelize[_0x9ef8('0x2')],'defaultValue':_0x9ef8('0xa')},'start_chat_button':{'type':Sequelize[_0x9ef8('0x2')],'defaultValue':'Chat'},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0x9ef8('0xb')},'header_offline':{'type':Sequelize[_0x9ef8('0x2')],'defaultValue':_0x9ef8('0xc')},'download_transcript':{'type':Sequelize[_0x9ef8('0x7')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x9ef8('0xd')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize['STRING'],'defaultValue':_0x9ef8('0xe')},'defaultWhiteLabel':{'type':Sequelize[_0x9ef8('0x7')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x9ef8('0xf')]},'closingQuestion':{'type':Sequelize[_0x9ef8('0x2')],'defaultValue':_0x9ef8('0x10')},'formSubmitSuccessMessage':{'type':Sequelize['STRING'],'defaultValue':'Form\x20properly\x20submitted'},'formSubmitFailureMessage':{'type':Sequelize[_0x9ef8('0x2')],'defaultValue':_0x9ef8('0x11')},'noteTitle':{'type':Sequelize['STRING'],'defaultValue':'Note'},'placeholderMessage':{'type':Sequelize[_0x9ef8('0x2')],'defaultValue':_0x9ef8('0x12')},'closingMessage':{'type':Sequelize[_0x9ef8('0x2')],'defaultValue':'Thanks\x20you\x20for\x20your\x20time!'},'closingMessageButton':{'type':Sequelize[_0x9ef8('0x2')],'defaultValue':_0x9ef8('0xb')},'skipMessageButton':{'type':Sequelize[_0x9ef8('0x2')],'defaultValue':_0x9ef8('0x13')},'conditionAgreement':{'type':Sequelize[_0x9ef8('0x7')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x9ef8('0x7')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x9ef8('0x7')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x9ef8('0x7')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x9ef8('0x2')],'defaultValue':_0x9ef8('0x14')},'ratingType':{'type':Sequelize[_0x9ef8('0x8')]('star',_0x9ef8('0x15')),'defaultValue':_0x9ef8('0x16')},'ratingStarsNumber':{'type':Sequelize[_0x9ef8('0xd')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x9ef8('0xf')],'defaultValue':function(){return JSON[_0x9ef8('0x17')]({'items':[{'type':_0x9ef8('0x18'),'variable':null,'config':{'placeholder':_0x9ef8('0x19'),'type':_0x9ef8('0x1a'),'required':!![]},'props':{'title':'name','helpText':''}},{'type':_0x9ef8('0x18'),'props':{'title':_0x9ef8('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0x9ef8('0x4'),'type':_0x9ef8('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x9ef8('0x1b')](_0x9ef8('0x1c'))?JSON[_0x9ef8('0x1d')](this['getDataValue'](_0x9ef8('0x1c'))):{};},'set':function(_0xe142){return this[_0x9ef8('0x1e')](_0x9ef8('0x1c'),JSON[_0x9ef8('0x17')](_0xe142));}},'offlineForm':{'type':Sequelize[_0x9ef8('0xf')],'defaultValue':function(){return JSON[_0x9ef8('0x17')]({'items':[{'type':_0x9ef8('0x18'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0x9ef8('0x4'),'type':_0x9ef8('0x4')},'variable':null},{'type':_0x9ef8('0x1f'),'config':{'placeholder':'Comments'},'props':{'title':_0x9ef8('0x20'),'helpText':_0x9ef8('0x21')}}],'fromKey':0x0});},'get':function(){return this[_0x9ef8('0x1b')](_0x9ef8('0x22'))?JSON[_0x9ef8('0x1d')](this['getDataValue']('offlineForm')):{};},'set':function(_0x2267ed){return this[_0x9ef8('0x1e')](_0x9ef8('0x22'),JSON[_0x9ef8('0x17')](_0x2267ed));}},'token':{'type':Sequelize[_0x9ef8('0x2')],'defaultValue':function(){return rs[_0x9ef8('0x23')]();}},'autoclose':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x9ef8('0x7')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x9ef8('0x7')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize['STRING']},'forwardOffline':{'type':Sequelize[_0x9ef8('0x7')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x9ef8('0x2')]},'waitingTitle':{'type':Sequelize[_0x9ef8('0x2')],'defaultValue':'All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.'},'waitingMessage':{'type':Sequelize['STRING'],'defaultValue':_0x9ef8('0x24')},'offlineMessageSubject':{'type':Sequelize[_0x9ef8('0x2')],'defaultValue':_0x9ef8('0x25')},'offlineMessageBody':{'type':Sequelize[_0x9ef8('0x2')],'defaultValue':_0x9ef8('0x26')},'enableUnmanagedNote':{'type':Sequelize[_0x9ef8('0x7')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x9ef8('0x2')],'defaultValue':'Your\x20request\x20has\x20not\x20been\x20processed.'},'skipUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0x9ef8('0x13')},'sendUnmanaged':{'type':Sequelize[_0x9ef8('0x2')],'defaultValue':_0x9ef8('0xb')},'enableCustomerAttachment':{'type':Sequelize[_0x9ef8('0x7')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x9ef8('0x7')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x9ef8('0xf')]},'showAgentAvatar':{'type':Sequelize[_0x9ef8('0x7')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x9ef8('0x2')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x9ef8('0x27');}},'notificationSound':{'type':Sequelize[_0x9ef8('0x7')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x9ef8('0x7')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x9ef8('0x2')],'defaultValue':'website_alias'},'waitForTheAssignedAgent':{'type':Sequelize[_0x9ef8('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x9ef8('0x2')],'defaultValue':_0x9ef8('0x28')},'verticalAlignment':{'type':Sequelize[_0x9ef8('0xd')],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize[_0x9ef8('0x2')],'defaultValue':_0x9ef8('0x29')},'defaultTitle':{'type':Sequelize['STRING']},'customerAvatar':{'type':Sequelize[_0x9ef8('0xf')]},'showCustomerAvatar':{'type':Sequelize[_0x9ef8('0x7')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x9ef8('0xd')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x9ef8('0x2')],'allowNull':![],'defaultValue':'#fafafa','validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x9ef8('0x7')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x9ef8('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x9ef8('0x7')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x9ef8('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x9ef8('0x2')],'defaultValue':_0x9ef8('0x2a')},'systemAvatar':{'type':Sequelize['TEXT']},'mandatoryDispositionPauseId':{'type':Sequelize[_0x9ef8('0xd')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x511859){if(!_0x511859)this[_0x9ef8('0x1e')]('mandatoryDispositionPauseId',null);this[_0x9ef8('0x1e')](_0x9ef8('0x2b'),_0x511859);}}}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js index 62e9c2b..737a368 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 _0xb7b3=['lastName','x-real-port','referer','browser','version','unknown','%s\x20%s','device','vendor','format','%s\x20%s\x20%s','stringify','threadId','ChatInteraction','externalUrl','ContactId','interaction','firstName','messageId','created','autoclose','push','unmanaged','*,*,*,*','ChatMessage','AttachmentId','UserId','agent','waitForTheAssignedAgent','startRouting','Start','EventManager','notify','no\x20available\x20attributes','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','findOrCreate','spread','server/files/templates/chatOfflineMessage.ejs','utf8','render','offlineMessageBody','ChatOfflineMessage','MailAccount','Smtp','forwardOfflineAddress','service','host','port','secure','authentication','pass','SendMail','sendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','addInteraction','omit','getInteractions','Contact','User','Owner','fullname','internal','Tag','Tags','color','tag','getSnippet','timezone','iftime\x20%s,%s','interval','iftime\x20%s','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','No\x20timezone','Interval','Intervals','getProactiveActions','getLicense','virtual','License','chatLicenseExceeded','all','some','readFileSync','server/files/chat/iframe.js','remote','remoteAddress','replace','alignment','verticalAlignment','sequelize','transaction','bulkCreate','findAndCountAll','getApplications','addProactiveActions','chatProactiveAction','ChatProactiveAction','getFields','online','false','onlineForm','items','fromKey','getOfflineMessages','addAgents','emit','removeAgents','isArray','userChatWebsite:remove','getAgents','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','./chatWebsite.socket','register','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','ChatWebsite,\x20%s,\x20%s','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','status','json','count','offset','limit','reject','update','destroy','get','ChatWebsites','UserProfileResource','end','sendStatus','stack','send','index','rawAttributes','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','map','type','key','field','options','ChatWebsite','includeAll','findAll','show','params','Pause','keys','include','find','create','body','user','role','UserProfileSection','name','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','ChatWebsiteId','Disposition','findOne','removeDispositions','ids','CannedAnswer','getAnswers','rows','removeAnswers','addLogo','file','filename','addCustomerAvatar','addSystemAvatar','systemAvatar','getLogo','join','root','sitepic','../../config/license/util','custom','existsSync','server/files/images/logos/','server/files/images/avatars/default_avatar.png','agentAvatar','isNil','server/files/images/avatars/','download','server/files/images/avatars/customer_avatar.png','customerAvatar','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','user-agent-parser','setUA','headers','user-agent','chat','CmContact','ValidationError','difference','createdAt','CompanyId','ListId','from','Sequelize','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','Contacts','updatedAt','DESC','ChatApplication','Applications','account','applications','list','orderBy','priority','asc','contact','customerIp','x-forwarded-for','first','split'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xb7b3,0x75));var _0x3b7b=function(_0x5e42a7,_0x3eba35){_0x5e42a7=_0x5e42a7-0x0;var _0x36d21b=_0xb7b3[_0x5e42a7];return _0x36d21b;};'use strict';var pdf=require(_0x3b7b('0x0'));var emlformat=require(_0x3b7b('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x3b7b('0x2'));var jsonpatch=require(_0x3b7b('0x3'));var rp=require(_0x3b7b('0x4'));var moment=require(_0x3b7b('0x5'));var BPromise=require(_0x3b7b('0x6'));var Mustache=require(_0x3b7b('0x7'));var util=require(_0x3b7b('0x8'));var path=require('path');var sox=require(_0x3b7b('0x9'));var csv=require(_0x3b7b('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x3b7b('0xb'));var squel=require(_0x3b7b('0xc'));var crypto=require(_0x3b7b('0xd'));var jsforce=require(_0x3b7b('0xe'));var deskjs=require(_0x3b7b('0xf'));var toCsv=require(_0x3b7b('0xa'));var querystring=require(_0x3b7b('0x10'));var Papa=require(_0x3b7b('0x11'));var Redis=require(_0x3b7b('0x12'));var authService=require(_0x3b7b('0x13'));var qs=require(_0x3b7b('0x14'));var as=require(_0x3b7b('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x3b7b('0x16'));var utils=require(_0x3b7b('0x17'));var config=require(_0x3b7b('0x18'));var db=require(_0x3b7b('0x19'))['db'];config[_0x3b7b('0x1a')]=_[_0x3b7b('0x1b')](config[_0x3b7b('0x1a')],{'host':_0x3b7b('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x3b7b('0x1d'))[_0x3b7b('0x1e')](socket);var jayson=require(_0x3b7b('0x1f'));var client=jayson[_0x3b7b('0x20')][_0x3b7b('0x21')]({'port':0x232c});var client9002=jayson['client'][_0x3b7b('0x21')]({'port':0x232a});var client9003=jayson[_0x3b7b('0x20')][_0x3b7b('0x21')]({'port':0x232b});function checkPasswordPattern(_0x1fcc98,_0x4ab966,_0x39aa84){if(_0x39aa84){var _0x48228b=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x48228b[_0x3b7b('0x22')](_0x4ab966)){return _0x1fcc98;}else{throw new Error(_0x3b7b('0x23'));}}else{return _0x1fcc98;}}function respondWithRpcPromise(_0x143fbb,_0x55baf3,_0x45b2dd,_0x3d2e44){return new BPromise(function(_0x94a946,_0x1837f7){var _0x4ea300=_0x3d2e44||client;return _0x4ea300[_0x3b7b('0x24')](_0x143fbb,_0x45b2dd)[_0x3b7b('0x25')](function(_0x3afa49){logger[_0x3b7b('0x26')](_0x3b7b('0x27'),_0x55baf3,'request\x20sent');logger[_0x3b7b('0x28')](_0x3b7b('0x29'),_0x55baf3,_0x3b7b('0x2a'),JSON['stringify'](_0x3afa49));if(_0x3afa49['error']){if(_0x3afa49[_0x3b7b('0x2b')][_0x3b7b('0x2c')]===0x1f4){logger[_0x3b7b('0x2b')](_0x3b7b('0x27'),_0x55baf3,_0x3afa49['error'][_0x3b7b('0x2d')]);return _0x1837f7(_0x3afa49[_0x3b7b('0x2b')][_0x3b7b('0x2d')]);}logger[_0x3b7b('0x2b')](_0x3b7b('0x27'),_0x55baf3,_0x3afa49['error'][_0x3b7b('0x2d')]);return _0x94a946(_0x3afa49[_0x3b7b('0x2b')][_0x3b7b('0x2d')]);}else{logger[_0x3b7b('0x26')](_0x3b7b('0x27'),_0x55baf3,'request\x20sent');_0x94a946(_0x3afa49[_0x3b7b('0x2e')][_0x3b7b('0x2d')]);}})[_0x3b7b('0x2f')](function(_0x5d06db){logger[_0x3b7b('0x2b')](_0x3b7b('0x27'),_0x55baf3,_0x5d06db);_0x1837f7(_0x5d06db);});});}function respondWithStatusCode(_0x2a50ee,_0x37db69){_0x37db69=_0x37db69||0xcc;return function(_0x20e5c7){if(_0x20e5c7){return _0x2a50ee['sendStatus'](_0x37db69);}return _0x2a50ee[_0x3b7b('0x30')](_0x37db69)['end']();};}function respondWithResult(_0x39d6d1,_0x1c9618){_0x1c9618=_0x1c9618||0xc8;return function(_0x25ac23){if(_0x25ac23){return _0x39d6d1[_0x3b7b('0x30')](_0x1c9618)[_0x3b7b('0x31')](_0x25ac23);}};}function respondWithFilteredResult(_0x2df972,_0xe53a22){return function(_0x460314){if(_0x460314){var _0x303dd4=_0x460314[_0x3b7b('0x32')],_0x54472d=_0xe53a22[_0x3b7b('0x33')],_0x19f2f4=_0xe53a22[_0x3b7b('0x33')]+_0xe53a22[_0x3b7b('0x34')],_0x165d11;if(_0x19f2f4>=_0x303dd4){_0x19f2f4=_0x303dd4;_0x165d11=0xc8;}else{_0x165d11=0xce;}_0x2df972['status'](_0x165d11);return _0x2df972['set']('Content-Range',_0x54472d+'-'+_0x19f2f4+'/'+_0x303dd4)[_0x3b7b('0x31')](_0x460314);}return null;};}function patchUpdates(_0x8eee07){return function(_0x3654aa){try{jsonpatch['apply'](_0x3654aa,_0x8eee07,!![]);}catch(_0x483d07){return BPromise[_0x3b7b('0x35')](_0x483d07);}return _0x3654aa['save']();};}function saveUpdates(_0x34fd25,_0x32a804){return function(_0xdc75d3){if(_0xdc75d3){return _0xdc75d3[_0x3b7b('0x36')](_0x34fd25)['then'](function(_0x3b567f){return _0x3b567f;});}return null;};}function removeEntity(_0x40a8a8,_0x3e4230){return function(_0x13ac0a){if(_0x13ac0a){return _0x13ac0a[_0x3b7b('0x37')]()[_0x3b7b('0x25')](function(){var _0x40ecce=_0x13ac0a[_0x3b7b('0x38')]({'plain':!![]});var _0x3e4887=_0x3b7b('0x39');return db[_0x3b7b('0x3a')][_0x3b7b('0x37')]({'where':{'type':_0x3e4887,'resourceId':_0x40ecce['id']}})[_0x3b7b('0x25')](function(){return _0x13ac0a;});})[_0x3b7b('0x25')](function(){_0x40a8a8[_0x3b7b('0x30')](0xcc)[_0x3b7b('0x3b')]();});}};}function handleEntityNotFound(_0x4ad9ca,_0x379f3a){return function(_0x4ef38f){if(!_0x4ef38f){_0x4ad9ca[_0x3b7b('0x3c')](0x194);}return _0x4ef38f;};}function handleError(_0x5239a0,_0xce3743){_0xce3743=_0xce3743||0x1f4;return function(_0x3238d8){logger[_0x3b7b('0x2b')](_0x3238d8[_0x3b7b('0x3d')]);if(_0x3238d8['name']){delete _0x3238d8['name'];}_0x5239a0[_0x3b7b('0x30')](_0xce3743)[_0x3b7b('0x3e')](_0x3238d8);};}exports[_0x3b7b('0x3f')]=function(_0x24f7d6,_0x1d16c0){var _0x3dd295={'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x3ea76e={},_0x6079d6={'count':0x0,'rows':[]};var _0x3d9657=db['ChatWebsite'][_0x3b7b('0x40')];_0x3ea76e['model']=_['keys'](_0x3d9657);_0x3ea76e[_0x3b7b('0x41')]=_['keys'](_0x24f7d6['query']);_0x3ea76e['filters']=_[_0x3b7b('0x42')](_0x3ea76e[_0x3b7b('0x43')],_0x3ea76e[_0x3b7b('0x41')]);_0x3dd295[_0x3b7b('0x44')]=_[_0x3b7b('0x42')](_0x3ea76e['model'],qs[_0x3b7b('0x45')](_0x24f7d6['query'][_0x3b7b('0x45')]));_0x3dd295[_0x3b7b('0x44')]=_0x3dd295[_0x3b7b('0x44')][_0x3b7b('0x46')]?_0x3dd295[_0x3b7b('0x44')]:_0x3ea76e[_0x3b7b('0x43')];if(!_0x24f7d6[_0x3b7b('0x41')][_0x3b7b('0x47')](_0x3b7b('0x48'))){_0x3dd295[_0x3b7b('0x34')]=qs['limit'](_0x24f7d6[_0x3b7b('0x41')][_0x3b7b('0x34')]);_0x3dd295['offset']=qs['offset'](_0x24f7d6[_0x3b7b('0x41')]['offset']);}_0x3dd295[_0x3b7b('0x49')]=qs[_0x3b7b('0x4a')](_0x24f7d6[_0x3b7b('0x41')][_0x3b7b('0x4a')]);_0x3dd295[_0x3b7b('0x4b')]=qs['filters'](_[_0x3b7b('0x4c')](_0x24f7d6[_0x3b7b('0x41')],_0x3ea76e[_0x3b7b('0x4d')]));if(_0x24f7d6[_0x3b7b('0x41')][_0x3b7b('0x4e')]){_0x3dd295[_0x3b7b('0x4b')]=_[_0x3b7b('0x4f')](_0x3dd295[_0x3b7b('0x4b')],{'$or':_[_0x3b7b('0x50')](_0x3d9657,function(_0x594f0f){if(_0x594f0f[_0x3b7b('0x51')][_0x3b7b('0x52')]!=='VIRTUAL'){var _0x389778={};_0x389778[_0x594f0f[_0x3b7b('0x53')]]={'$like':'%'+_0x24f7d6[_0x3b7b('0x41')][_0x3b7b('0x4e')]+'%'};return _0x389778;}})});}_0x3dd295=_[_0x3b7b('0x4f')]({},_0x3dd295,_0x24f7d6[_0x3b7b('0x54')]);var _0x41b955={'where':_0x3dd295[_0x3b7b('0x4b')]};return db[_0x3b7b('0x55')][_0x3b7b('0x32')](_0x41b955)['then'](function(_0xc669e0){_0x6079d6[_0x3b7b('0x32')]=_0xc669e0;if(_0x24f7d6[_0x3b7b('0x41')][_0x3b7b('0x56')]){_0x3dd295['include']=[{'all':!![]}];}return db[_0x3b7b('0x55')][_0x3b7b('0x57')](_0x3dd295);})[_0x3b7b('0x25')](function(_0x31760a){_0x6079d6['rows']=_0x31760a;return _0x6079d6;})[_0x3b7b('0x25')](respondWithFilteredResult(_0x1d16c0,_0x3dd295))['catch'](handleError(_0x1d16c0,null));};exports[_0x3b7b('0x58')]=function(_0xcd610a,_0x5265c6){var _0x41e550={'raw':![],'where':{'id':_0xcd610a[_0x3b7b('0x59')]['id']},'include':[{'model':db[_0x3b7b('0x5a')],'as':'mandatoryDispositionPause'}]},_0x5ddfbd={};_0x5ddfbd[_0x3b7b('0x43')]=_[_0x3b7b('0x5b')](db[_0x3b7b('0x55')][_0x3b7b('0x40')]);_0x5ddfbd[_0x3b7b('0x41')]=_['keys'](_0xcd610a[_0x3b7b('0x41')]);_0x5ddfbd['filters']=_[_0x3b7b('0x42')](_0x5ddfbd['model'],_0x5ddfbd[_0x3b7b('0x41')]);_0x41e550['attributes']=_['intersection'](_0x5ddfbd[_0x3b7b('0x43')],qs[_0x3b7b('0x45')](_0xcd610a['query']['fields']));_0x41e550[_0x3b7b('0x44')]=_0x41e550[_0x3b7b('0x44')]['length']?_0x41e550[_0x3b7b('0x44')]:_0x5ddfbd['model'];if(_0xcd610a['query'][_0x3b7b('0x56')]){_0x41e550[_0x3b7b('0x5c')]=[{'all':!![]}];}_0x41e550=_[_0x3b7b('0x4f')]({},_0x41e550,_0xcd610a[_0x3b7b('0x54')]);return db['ChatWebsite'][_0x3b7b('0x5d')](_0x41e550)[_0x3b7b('0x25')](handleEntityNotFound(_0x5265c6,null))['then'](respondWithResult(_0x5265c6,null))['catch'](handleError(_0x5265c6,null));};exports[_0x3b7b('0x5e')]=function(_0x2daef7,_0x3b84a6){return db[_0x3b7b('0x55')][_0x3b7b('0x5e')](_0x2daef7[_0x3b7b('0x5f')],{})[_0x3b7b('0x25')](function(_0x2723a9){var _0x40915f=_0x2daef7[_0x3b7b('0x60')][_0x3b7b('0x38')]({'plain':!![]});if(!_0x40915f)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x40915f[_0x3b7b('0x61')]===_0x3b7b('0x60')){var _0x2c6fac=_0x2723a9[_0x3b7b('0x38')]({'plain':!![]});var _0x4522e2=_0x3b7b('0x39');return db[_0x3b7b('0x62')][_0x3b7b('0x5d')]({'where':{'name':_0x4522e2,'userProfileId':_0x40915f['userProfileId']},'raw':!![]})[_0x3b7b('0x25')](function(_0x3d0ec9){if(_0x3d0ec9&&_0x3d0ec9['autoAssociation']===0x0){return db['UserProfileResource'][_0x3b7b('0x5e')]({'name':_0x2c6fac['name'],'resourceId':_0x2c6fac['id'],'type':_0x3d0ec9[_0x3b7b('0x63')],'sectionId':_0x3d0ec9['id']},{})['then'](function(){return _0x2723a9;});}else{return _0x2723a9;}})['catch'](function(_0x588e99){logger[_0x3b7b('0x2b')](_0x3b7b('0x64'),_0x588e99);throw _0x588e99;});}return _0x2723a9;})[_0x3b7b('0x25')](respondWithResult(_0x3b84a6,0xc9))[_0x3b7b('0x2f')](handleError(_0x3b84a6,null));};exports['update']=function(_0x5df0a8,_0x5c04a7){if(_0x5df0a8[_0x3b7b('0x5f')]['id']){delete _0x5df0a8['body']['id'];}return db[_0x3b7b('0x55')][_0x3b7b('0x5d')]({'where':{'id':_0x5df0a8[_0x3b7b('0x59')]['id']},'include':[{'model':db[_0x3b7b('0x5a')],'as':'mandatoryDispositionPause'}]})['then'](handleEntityNotFound(_0x5c04a7,null))[_0x3b7b('0x25')](saveUpdates(_0x5df0a8[_0x3b7b('0x5f')],null))[_0x3b7b('0x25')](respondWithResult(_0x5c04a7,null))[_0x3b7b('0x2f')](handleError(_0x5c04a7,null));};exports[_0x3b7b('0x37')]=function(_0x2da043,_0xf2823c){return db[_0x3b7b('0x55')]['find']({'where':{'id':_0x2da043[_0x3b7b('0x59')]['id']}})[_0x3b7b('0x25')](handleEntityNotFound(_0xf2823c,null))[_0x3b7b('0x25')](removeEntity(_0xf2823c,null))[_0x3b7b('0x2f')](handleError(_0xf2823c,null));};exports[_0x3b7b('0x65')]=function(_0x20ee46,_0x45a544){return db[_0x3b7b('0x55')][_0x3b7b('0x65')]()[_0x3b7b('0x25')](respondWithResult(_0x45a544,null))[_0x3b7b('0x2f')](handleError(_0x45a544,null));};exports['addDisposition']=function(_0x2de100,_0xb587b2,_0x1a884c){if(_0x2de100[_0x3b7b('0x5f')]['id']){delete _0x2de100[_0x3b7b('0x5f')]['id'];}return db[_0x3b7b('0x55')]['find']({'where':{'id':_0x2de100[_0x3b7b('0x59')]['id']}})[_0x3b7b('0x25')](handleEntityNotFound(_0xb587b2,null))['then'](function(_0x5b7eb1){if(_0x5b7eb1){_0x2de100[_0x3b7b('0x5f')][_0x3b7b('0x66')]=_0x5b7eb1['id'];return db[_0x3b7b('0x67')][_0x3b7b('0x5e')](_0x2de100['body']);}})[_0x3b7b('0x25')](respondWithResult(_0xb587b2,null))[_0x3b7b('0x2f')](handleError(_0xb587b2,null));};exports['getDispositions']=function(_0x4a5b09,_0xc979d1,_0x1bea3b){var _0x1832b4={'raw':![],'where':{}};var _0x3c126e={};var _0x1fc38f={'count':0x0,'rows':[]};return db[_0x3b7b('0x55')][_0x3b7b('0x68')]({'where':{'id':_0x4a5b09[_0x3b7b('0x59')]['id']}})['then'](handleEntityNotFound(_0xc979d1,null))['then'](function(_0x73508){if(_0x73508){_0x3c126e[_0x3b7b('0x43')]=_['keys'](db[_0x3b7b('0x67')]['rawAttributes']);_0x3c126e[_0x3b7b('0x41')]=_[_0x3b7b('0x5b')](_0x4a5b09['query']);_0x3c126e[_0x3b7b('0x4d')]=_[_0x3b7b('0x42')](_0x3c126e[_0x3b7b('0x43')],_0x3c126e[_0x3b7b('0x41')]);_0x1832b4[_0x3b7b('0x44')]=_[_0x3b7b('0x42')](_0x3c126e[_0x3b7b('0x43')],qs[_0x3b7b('0x45')](_0x4a5b09['query']['fields']));_0x1832b4[_0x3b7b('0x44')]=_0x1832b4['attributes'][_0x3b7b('0x46')]?_0x1832b4[_0x3b7b('0x44')]:_0x3c126e[_0x3b7b('0x43')];if(!_0x4a5b09[_0x3b7b('0x41')][_0x3b7b('0x47')](_0x3b7b('0x48'))){_0x1832b4[_0x3b7b('0x34')]=qs[_0x3b7b('0x34')](_0x4a5b09['query'][_0x3b7b('0x34')]);_0x1832b4[_0x3b7b('0x33')]=qs[_0x3b7b('0x33')](_0x4a5b09[_0x3b7b('0x41')][_0x3b7b('0x33')]);}_0x1832b4[_0x3b7b('0x49')]=qs[_0x3b7b('0x4a')](_0x4a5b09[_0x3b7b('0x41')][_0x3b7b('0x4a')]);_0x1832b4[_0x3b7b('0x4b')]=qs[_0x3b7b('0x4d')](_[_0x3b7b('0x4c')](_0x4a5b09[_0x3b7b('0x41')],_0x3c126e['filters']));_0x1832b4[_0x3b7b('0x4b')][_0x3b7b('0x66')]=_0x73508['id'];if(_0x4a5b09['query']['filter']){_0x1832b4[_0x3b7b('0x4b')]=_['merge'](_0x1832b4[_0x3b7b('0x4b')],{'$or':_['map'](_0x1832b4[_0x3b7b('0x44')],function(_0x3a1f3a){var _0x15da2d={};_0x15da2d[_0x3a1f3a]={'$like':'%'+_0x4a5b09[_0x3b7b('0x41')][_0x3b7b('0x4e')]+'%'};return _0x15da2d;})});}_0x1832b4=_['merge']({},_0x1832b4,_0x4a5b09['options']);return db[_0x3b7b('0x67')]['count']({'where':_0x1832b4['where']})[_0x3b7b('0x25')](function(_0x4cfe09){_0x1fc38f[_0x3b7b('0x32')]=_0x4cfe09;if(_0x4a5b09[_0x3b7b('0x41')][_0x3b7b('0x56')]){_0x1832b4[_0x3b7b('0x5c')]=[{'all':!![]}];}return db[_0x3b7b('0x67')][_0x3b7b('0x57')](_0x1832b4);})[_0x3b7b('0x25')](function(_0x45ba32){_0x1fc38f['rows']=_0x45ba32;return _0x1fc38f;});}})[_0x3b7b('0x25')](respondWithFilteredResult(_0xc979d1,_0x1832b4))['catch'](handleError(_0xc979d1,null));};exports[_0x3b7b('0x69')]=function(_0x4d59ae,_0x452e6b,_0x207995){return db[_0x3b7b('0x55')]['find']({'where':{'id':_0x4d59ae[_0x3b7b('0x59')]['id']}})['then'](handleEntityNotFound(_0x452e6b,null))[_0x3b7b('0x25')](function(_0x1f665f){if(_0x1f665f){return _0x1f665f[_0x3b7b('0x69')](_0x4d59ae[_0x3b7b('0x41')][_0x3b7b('0x6a')]);}})['then'](respondWithStatusCode(_0x452e6b,null))[_0x3b7b('0x2f')](handleError(_0x452e6b,null));};exports['addAnswer']=function(_0x57d777,_0x28c0c8,_0x292a72){if(_0x57d777[_0x3b7b('0x5f')]['id']){delete _0x57d777[_0x3b7b('0x5f')]['id'];}return db[_0x3b7b('0x55')][_0x3b7b('0x5d')]({'where':{'id':_0x57d777[_0x3b7b('0x59')]['id']}})[_0x3b7b('0x25')](handleEntityNotFound(_0x28c0c8,null))[_0x3b7b('0x25')](function(_0x4f2db6){if(_0x4f2db6){_0x57d777[_0x3b7b('0x5f')][_0x3b7b('0x66')]=_0x4f2db6['id'];return db[_0x3b7b('0x6b')][_0x3b7b('0x5e')](_0x57d777['body']);}})['then'](respondWithResult(_0x28c0c8,null))[_0x3b7b('0x2f')](handleError(_0x28c0c8,null));};exports[_0x3b7b('0x6c')]=function(_0x183ed9,_0x2aa6ba,_0x422315){var _0x469636={'raw':![],'where':{}};var _0x1eb6df={};var _0x4fd319={'count':0x0,'rows':[]};return db[_0x3b7b('0x55')]['findOne']({'where':{'id':_0x183ed9['params']['id']}})[_0x3b7b('0x25')](handleEntityNotFound(_0x2aa6ba,null))[_0x3b7b('0x25')](function(_0x2ca6ff){if(_0x2ca6ff){_0x1eb6df['model']=_[_0x3b7b('0x5b')](db['CannedAnswer'][_0x3b7b('0x40')]);_0x1eb6df[_0x3b7b('0x41')]=_['keys'](_0x183ed9['query']);_0x1eb6df['filters']=_['intersection'](_0x1eb6df[_0x3b7b('0x43')],_0x1eb6df[_0x3b7b('0x41')]);_0x469636[_0x3b7b('0x44')]=_['intersection'](_0x1eb6df[_0x3b7b('0x43')],qs[_0x3b7b('0x45')](_0x183ed9['query'][_0x3b7b('0x45')]));_0x469636[_0x3b7b('0x44')]=_0x469636[_0x3b7b('0x44')]['length']?_0x469636['attributes']:_0x1eb6df['model'];if(!_0x183ed9[_0x3b7b('0x41')][_0x3b7b('0x47')](_0x3b7b('0x48'))){_0x469636[_0x3b7b('0x34')]=qs[_0x3b7b('0x34')](_0x183ed9[_0x3b7b('0x41')][_0x3b7b('0x34')]);_0x469636[_0x3b7b('0x33')]=qs[_0x3b7b('0x33')](_0x183ed9[_0x3b7b('0x41')][_0x3b7b('0x33')]);}_0x469636['order']=qs[_0x3b7b('0x4a')](_0x183ed9[_0x3b7b('0x41')]['sort']);_0x469636[_0x3b7b('0x4b')]=qs[_0x3b7b('0x4d')](_['pick'](_0x183ed9[_0x3b7b('0x41')],_0x1eb6df['filters']));_0x469636[_0x3b7b('0x4b')][_0x3b7b('0x66')]=_0x2ca6ff['id'];if(_0x183ed9[_0x3b7b('0x41')]['filter']){_0x469636[_0x3b7b('0x4b')]=_[_0x3b7b('0x4f')](_0x469636[_0x3b7b('0x4b')],{'$or':_['map'](_0x469636['attributes'],function(_0x1ee9ec){var _0x531f98={};_0x531f98[_0x1ee9ec]={'$like':'%'+_0x183ed9['query']['filter']+'%'};return _0x531f98;})});}_0x469636=_[_0x3b7b('0x4f')]({},_0x469636,_0x183ed9[_0x3b7b('0x54')]);return db[_0x3b7b('0x6b')][_0x3b7b('0x32')]({'where':_0x469636[_0x3b7b('0x4b')]})[_0x3b7b('0x25')](function(_0x5da924){_0x4fd319['count']=_0x5da924;if(_0x183ed9[_0x3b7b('0x41')][_0x3b7b('0x56')]){_0x469636[_0x3b7b('0x5c')]=[{'all':!![]}];}return db[_0x3b7b('0x6b')][_0x3b7b('0x57')](_0x469636);})[_0x3b7b('0x25')](function(_0x18f6bc){_0x4fd319[_0x3b7b('0x6d')]=_0x18f6bc;return _0x4fd319;});}})['then'](respondWithFilteredResult(_0x2aa6ba,_0x469636))['catch'](handleError(_0x2aa6ba,null));};exports[_0x3b7b('0x6e')]=function(_0x32edc8,_0x25cc97,_0x2d68a8){return db[_0x3b7b('0x55')][_0x3b7b('0x5d')]({'where':{'id':_0x32edc8[_0x3b7b('0x59')]['id']}})[_0x3b7b('0x25')](handleEntityNotFound(_0x25cc97,null))[_0x3b7b('0x25')](function(_0x308468){if(_0x308468){return _0x308468[_0x3b7b('0x6e')](_0x32edc8[_0x3b7b('0x41')][_0x3b7b('0x6a')]);}})['then'](respondWithStatusCode(_0x25cc97,null))[_0x3b7b('0x2f')](handleError(_0x25cc97,null));};exports[_0x3b7b('0x6f')]=function(_0x442250,_0xf96a53,_0x2f3f80){_0x442250[_0x3b7b('0x5f')]['sitepic']=_0x442250['file']['filename'];return db[_0x3b7b('0x55')][_0x3b7b('0x5d')]({'where':{'id':_0x442250[_0x3b7b('0x59')]['id']}})[_0x3b7b('0x25')](handleEntityNotFound(_0xf96a53,null))['then'](saveUpdates(_0x442250[_0x3b7b('0x5f')],null))[_0x3b7b('0x25')](respondWithResult(_0xf96a53,null))[_0x3b7b('0x2f')](handleError(_0xf96a53,null));};exports['addAvatar']=function(_0x3f8ed6,_0x114bb3,_0x281e18){_0x3f8ed6['body']['agentAvatar']=_0x3f8ed6[_0x3b7b('0x70')][_0x3b7b('0x71')];return db[_0x3b7b('0x55')][_0x3b7b('0x5d')]({'where':{'id':_0x3f8ed6[_0x3b7b('0x59')]['id']}})[_0x3b7b('0x25')](handleEntityNotFound(_0x114bb3,null))[_0x3b7b('0x25')](saveUpdates(_0x3f8ed6[_0x3b7b('0x5f')],null))[_0x3b7b('0x25')](respondWithResult(_0x114bb3,null))[_0x3b7b('0x2f')](handleError(_0x114bb3,null));};exports[_0x3b7b('0x72')]=function(_0x42a29a,_0x47513a,_0x4e0388){_0x42a29a[_0x3b7b('0x5f')]['customerAvatar']=_0x42a29a[_0x3b7b('0x70')][_0x3b7b('0x71')];return db[_0x3b7b('0x55')][_0x3b7b('0x5d')]({'where':{'id':_0x42a29a[_0x3b7b('0x59')]['id']}})[_0x3b7b('0x25')](handleEntityNotFound(_0x47513a,null))[_0x3b7b('0x25')](saveUpdates(_0x42a29a[_0x3b7b('0x5f')],null))[_0x3b7b('0x25')](respondWithResult(_0x47513a,null))[_0x3b7b('0x2f')](handleError(_0x47513a,null));};exports[_0x3b7b('0x73')]=function(_0x22420d,_0x16b30a,_0x392a5d){_0x22420d[_0x3b7b('0x5f')][_0x3b7b('0x74')]=_0x22420d['file'][_0x3b7b('0x71')];return db[_0x3b7b('0x55')]['find']({'where':{'id':_0x22420d[_0x3b7b('0x59')]['id']}})[_0x3b7b('0x25')](handleEntityNotFound(_0x16b30a,null))[_0x3b7b('0x25')](saveUpdates(_0x22420d[_0x3b7b('0x5f')],null))[_0x3b7b('0x25')](respondWithResult(_0x16b30a,null))[_0x3b7b('0x2f')](handleError(_0x16b30a,null));};exports[_0x3b7b('0x75')]=function(_0x23432d,_0x1bd020,_0x11cf20){var _0x534d24=path[_0x3b7b('0x76')](config[_0x3b7b('0x77')],'server/files/images/logos/default_logo.png');var _0x2c3011={'where':{'id':_0x23432d[_0x3b7b('0x59')]['id']},'attributes':['id',_0x3b7b('0x78')],'raw':!![]};var _0x118668=![];return require(_0x3b7b('0x79'))['getLicense']()[_0x3b7b('0x25')](function(_0x2d79fa){if(_0x2d79fa){_0x118668=_0x2d79fa[_0x3b7b('0x7a')];}})[_0x3b7b('0x25')](function(){return db[_0x3b7b('0x55')]['find'](_0x2c3011);})['then'](handleEntityNotFound(_0x1bd020,null))['then'](function(_0x3fdf61){if(_0x3fdf61){if(!_['isNil'](_0x3fdf61['sitepic'])){if(fs[_0x3b7b('0x7b')](path[_0x3b7b('0x76')](config['root'],_0x3b7b('0x7c'),_0x3fdf61['sitepic']))&&_0x118668){_0x534d24=path[_0x3b7b('0x76')](config[_0x3b7b('0x77')],_0x3b7b('0x7c'),_0x3fdf61[_0x3b7b('0x78')]);}}return _0x1bd020['download'](_0x534d24);}})[_0x3b7b('0x2f')](handleError(_0x1bd020,null));};exports['getAvatar']=function(_0x4b8e32,_0xac65f2,_0x51027b){var _0x7e6c1a=path['join'](config['root'],_0x3b7b('0x7d'));var _0x14ba3a={'where':{'id':_0x4b8e32['params']['id']},'attributes':['id',_0x3b7b('0x7e')],'raw':!![]};return db[_0x3b7b('0x55')][_0x3b7b('0x5d')](_0x14ba3a)['then'](handleEntityNotFound(_0xac65f2,null))[_0x3b7b('0x25')](function(_0x37e13e){if(_0x37e13e){if(!_[_0x3b7b('0x7f')](_0x37e13e[_0x3b7b('0x7e')])){if(fs[_0x3b7b('0x7b')](path[_0x3b7b('0x76')](config['root'],_0x3b7b('0x80'),_0x37e13e[_0x3b7b('0x7e')]))){_0x7e6c1a=path[_0x3b7b('0x76')](config[_0x3b7b('0x77')],'server/files/images/avatars/',_0x37e13e[_0x3b7b('0x7e')]);}}return _0xac65f2[_0x3b7b('0x81')](_0x7e6c1a);}})[_0x3b7b('0x2f')](handleError(_0xac65f2,null));};exports['getCustomerAvatar']=function(_0x115c56,_0x4c45d2,_0x141910){var _0x55d8f0=path[_0x3b7b('0x76')](config['root'],_0x3b7b('0x82'));var _0x41f7b3={'where':{'id':_0x115c56[_0x3b7b('0x59')]['id']},'attributes':['id',_0x3b7b('0x83'),_0x3b7b('0x84')],'raw':!![]};return db[_0x3b7b('0x55')][_0x3b7b('0x5d')](_0x41f7b3)[_0x3b7b('0x25')](handleEntityNotFound(_0x4c45d2,null))[_0x3b7b('0x25')](function(_0x3c5cfd){if(_0x3c5cfd){if(!_[_0x3b7b('0x7f')](_0x3c5cfd[_0x3b7b('0x83')])){if(fs[_0x3b7b('0x7b')](path[_0x3b7b('0x76')](config[_0x3b7b('0x77')],_0x3b7b('0x80'),_0x3c5cfd[_0x3b7b('0x83')]))&&_0x3c5cfd[_0x3b7b('0x84')]){_0x55d8f0=path[_0x3b7b('0x76')](config[_0x3b7b('0x77')],_0x3b7b('0x80'),_0x3c5cfd[_0x3b7b('0x83')]);}}return _0x4c45d2[_0x3b7b('0x81')](_0x55d8f0);}})[_0x3b7b('0x2f')](handleError(_0x4c45d2,null));};exports[_0x3b7b('0x85')]=function(_0x2cfd16,_0x2016c5,_0x20abaa){var _0x1ebb7f=path[_0x3b7b('0x76')](config[_0x3b7b('0x77')],_0x3b7b('0x86'));var _0x5e4d2d={'where':{'id':_0x2cfd16[_0x3b7b('0x59')]['id']},'attributes':['id',_0x3b7b('0x74')],'raw':!![]};return db[_0x3b7b('0x55')][_0x3b7b('0x5d')](_0x5e4d2d)[_0x3b7b('0x25')](handleEntityNotFound(_0x2016c5,null))[_0x3b7b('0x25')](function(_0x34dcdc){if(_0x34dcdc){if(!_[_0x3b7b('0x7f')](_0x34dcdc[_0x3b7b('0x74')])){if(fs[_0x3b7b('0x7b')](path[_0x3b7b('0x76')](config[_0x3b7b('0x77')],'server/files/images/avatars/',_0x34dcdc[_0x3b7b('0x74')]))){_0x1ebb7f=path[_0x3b7b('0x76')](config[_0x3b7b('0x77')],_0x3b7b('0x80'),_0x34dcdc[_0x3b7b('0x74')]);}}return _0x2016c5[_0x3b7b('0x81')](_0x1ebb7f);}})[_0x3b7b('0x2f')](handleError(_0x2016c5,null));};exports['notify']=function(_0x34ac89,_0x1db168,_0x1374e9){var _0xbe923=require(_0x3b7b('0x87'));var _0x533553=new _0xbe923();var _0x8fca6=_0x533553[_0x3b7b('0x88')](_0x34ac89[_0x3b7b('0x89')][_0x3b7b('0x8a')])['getResult']();var _0x2ab974={'body':_0x34ac89[_0x3b7b('0x5f')],'channel':_0x3b7b('0x8b')};var _0x2cadf3=[];var _0x3182e0=[];var _0x5231b6={};var _0x131c54=![];return db[_0x3b7b('0x8c')]['describe']()[_0x3b7b('0x25')](function(_0x4f8b86){if(!_0x4f8b86){throw new db['Sequelize'][(_0x3b7b('0x8d'))]('no\x20available\x20attributes');}_0x2cadf3=_[_0x3b7b('0x8e')](_[_0x3b7b('0x5b')](_0x4f8b86),[_0x3b7b('0x8f'),'updatedAt']);_0x3182e0=_[_0x3b7b('0x8e')](_[_0x3b7b('0x5b')](_0x4f8b86),[_0x3b7b('0x8f'),'updatedAt',_0x3b7b('0x90'),_0x3b7b('0x91')]);if(_0x34ac89[_0x3b7b('0x5f')]['id']){delete _0x34ac89[_0x3b7b('0x5f')]['id'];}if(_[_0x3b7b('0x7f')](_0x34ac89[_0x3b7b('0x5f')][_0x3b7b('0x92')])){throw new db[(_0x3b7b('0x93'))][(_0x3b7b('0x8d'))](_0x3b7b('0x94'));}if(_[_0x3b7b('0x7f')](_0x34ac89[_0x3b7b('0x5f')][_0x3b7b('0x5f')])||_0x34ac89[_0x3b7b('0x5f')]['body']===''){throw new db[(_0x3b7b('0x93'))][(_0x3b7b('0x8d'))](_0x3b7b('0x95'));}if(_['isNil'](_0x34ac89[_0x3b7b('0x5f')][_0x3b7b('0x96')])){throw new db[(_0x3b7b('0x93'))][(_0x3b7b('0x8d'))](_0x3b7b('0x97')+_0x3182e0);}if(!_[_0x3b7b('0x98')](_0x3182e0,_0x34ac89[_0x3b7b('0x5f')]['mapKey'])){throw new db['Sequelize'][(_0x3b7b('0x8d'))](_0x3b7b('0x99')+_0x3182e0);}_0x5231b6[_0x34ac89[_0x3b7b('0x5f')][_0x3b7b('0x96')]]=_0x34ac89[_0x3b7b('0x5f')]['from'];})['then'](function(){return db[_0x3b7b('0x55')][_0x3b7b('0x5d')]({'where':{'id':_0x34ac89[_0x3b7b('0x59')]['id']},'include':[{'model':db[_0x3b7b('0x9a')],'as':_0x3b7b('0x9b'),'include':[{'model':db[_0x3b7b('0x8c')],'as':_0x3b7b('0x9c'),'where':_0x5231b6,'limit':0x1,'order':[[_0x3b7b('0x9d'),_0x3b7b('0x9e')]]}]},{'model':db[_0x3b7b('0x9f')],'as':_0x3b7b('0xa0')}]});})['then'](handleEntityNotFound(_0x1db168,null))[_0x3b7b('0x25')](function(_0x5368ca){if(_0x5368ca&&_0x5368ca[_0x3b7b('0x9b')]){_0x2ab974[_0x3b7b('0xa1')]=_0x5368ca;_0x2ab974[_0x3b7b('0xa2')]=_0x5368ca[_0x3b7b('0xa0')];_0x2ab974[_0x3b7b('0xa3')]=_0x5368ca['List'];_0x2ab974['applications']=_[_0x3b7b('0xa4')](_0x2ab974[_0x3b7b('0xa2')],[_0x3b7b('0xa5')],[_0x3b7b('0xa6')]);if(_0x2ab974[_0x3b7b('0xa1')][_0x3b7b('0xa0')]){delete _0x2ab974['account'][_0x3b7b('0xa0')];}if(_0x2ab974[_0x3b7b('0xa1')]['List']&&_0x2ab974['account'][_0x3b7b('0x9b')][_0x3b7b('0x9c')][_0x3b7b('0x46')]){return _0x2ab974[_0x3b7b('0xa1')][_0x3b7b('0x9b')][_0x3b7b('0x9c')][0x0];}var _0x5b854b=_[_0x3b7b('0x1b')](_0x34ac89[_0x3b7b('0x5f')],{'firstName':_0x34ac89[_0x3b7b('0x5f')][_0x3b7b('0x92')],'ListId':_0x5368ca[_0x3b7b('0x91')]});_0x5b854b[_0x34ac89[_0x3b7b('0x5f')]['mapKey']]=_0x34ac89[_0x3b7b('0x5f')][_0x3b7b('0x92')];return db[_0x3b7b('0x8c')][_0x3b7b('0x5e')](_0x5b854b,{'fields':_0x2cadf3,'raw':!![]});}})['then'](handleEntityNotFound(_0x1db168,null))[_0x3b7b('0x25')](function(_0x3c8a87){_0x2ab974[_0x3b7b('0xa7')]=_0x3c8a87;var _0x1ff42a=_0x34ac89[_0x3b7b('0x5f')][_0x3b7b('0xa8')];if(_0x34ac89['headers']['cf-connecting-ip']){_0x1ff42a=_0x34ac89[_0x3b7b('0x89')]['cf-connecting-ip'];}else if(_0x34ac89[_0x3b7b('0x89')][_0x3b7b('0xa9')]){_0x1ff42a=_[_0x3b7b('0xaa')](_0x34ac89[_0x3b7b('0x89')][_0x3b7b('0xa9')][_0x3b7b('0xab')](','));}if(_0x3c8a87){var _0x6f9977={'ContactId':_0x3c8a87['id'],'ChatWebsiteId':_0x34ac89[_0x3b7b('0x59')]['id'],'from':(_0x3c8a87['firstName']||'')+'\x20'+(_0x3c8a87[_0x3b7b('0xac')]||''),'customerIp':_0x1ff42a,'customerPort':_0x34ac89['headers'][_0x3b7b('0xad')]?_0x34ac89[_0x3b7b('0x89')][_0x3b7b('0xad')]:null,'referer':_0x34ac89[_0x3b7b('0x5f')][_0x3b7b('0xae')],'browserName':_0x8fca6[_0x3b7b('0xaf')]['name']&&_0x8fca6[_0x3b7b('0xaf')][_0x3b7b('0xb0')]?util['format']('%s\x20%s',_0x8fca6[_0x3b7b('0xaf')]['name'],_0x8fca6['browser'][_0x3b7b('0xb0')]):_0x3b7b('0xb1'),'browserVersion':_0x8fca6[_0x3b7b('0xaf')][_0x3b7b('0xb0')]||_0x3b7b('0xb1'),'osName':util['format'](_0x3b7b('0xb2'),_0x8fca6['os']['name'],_0x8fca6['os'][_0x3b7b('0xb0')]),'osVersion':_0x8fca6['os'][_0x3b7b('0xb0')],'deviceModel':_0x8fca6[_0x3b7b('0xb3')]['model']&&_0x8fca6[_0x3b7b('0xb3')][_0x3b7b('0xb4')]?util[_0x3b7b('0xb5')](_0x3b7b('0xb6'),_0x8fca6[_0x3b7b('0xb3')][_0x3b7b('0x43')],_0x8fca6['device'][_0x3b7b('0xb4')],_0x8fca6['device'][_0x3b7b('0x51')]):null,'deviceVendor':_0x8fca6[_0x3b7b('0xb3')][_0x3b7b('0xb4')],'deviceType':_0x8fca6[_0x3b7b('0xb3')][_0x3b7b('0x51')],'formData':JSON[_0x3b7b('0xb7')](_0x34ac89[_0x3b7b('0x5f')])};var _0x16d416={'ChatWebsiteId':_0x34ac89['params']['id'],'closed':![]};if(_0x34ac89[_0x3b7b('0x5f')][_0x3b7b('0xb8')]){_0x16d416[_0x3b7b('0xb8')]=_0x34ac89['body'][_0x3b7b('0xb8')];return db[_0x3b7b('0xb9')][_0x3b7b('0x5d')]({'where':_0x16d416})[_0x3b7b('0x25')](function(_0x34d3ab){if(_0x34d3ab){return[_0x34d3ab,![]];}_0x6f9977[_0x3b7b('0xb8')]=_0x34ac89['body']['threadId'];_0x6f9977['externalUrl']=_0x34ac89['body'][_0x3b7b('0xba')];return db[_0x3b7b('0xb9')][_0x3b7b('0x5e')](_0x6f9977)['then'](function(_0x41868c){return[_0x41868c,!![]];});});}_0x16d416[_0x3b7b('0xbb')]=_0x3c8a87['id'];if(_0x34ac89[_0x3b7b('0x5f')][_0x3b7b('0xbc')]&&_0x34ac89[_0x3b7b('0x5f')][_0x3b7b('0xbc')]['id']){_0x16d416['id']=_0x34ac89[_0x3b7b('0x5f')][_0x3b7b('0xbc')]['id'];return db['ChatInteraction'][_0x3b7b('0x5d')]({'where':_0x16d416})[_0x3b7b('0x25')](function(_0x5ebca6){if(_0x5ebca6){return[_0x5ebca6,![]];}return db['ChatInteraction'][_0x3b7b('0x5e')](_0x6f9977)['then'](function(_0x26811b){return[_0x26811b,!![]];});});}return db[_0x3b7b('0xb9')][_0x3b7b('0x5e')](_0x6f9977)[_0x3b7b('0x25')](function(_0x1295fe){return[_0x1295fe,!![]];});}})['spread'](function(_0xc57368,_0x3fd845){if(_0xc57368){_0x131c54=_0x3fd845;if(!_0x3fd845){var _0x335d52={'from':(_0x2ab974[_0x3b7b('0xa7')][_0x3b7b('0xbd')]||'')+'\x20'+(_0x2ab974[_0x3b7b('0xa7')][_0x3b7b('0xac')]||'')};if(_0x34ac89[_0x3b7b('0x5f')][_0x3b7b('0xb8')]&&_0x34ac89['body'][_0x3b7b('0xbe')]&&_0x34ac89['body'][_0x3b7b('0xb8')]!=_0x34ac89['body'][_0x3b7b('0xbe')]){_0x335d52[_0x3b7b('0xb8')]=_0x34ac89[_0x3b7b('0x5f')][_0x3b7b('0xbe')];}return _0xc57368['update'](_0x335d52);}else{return _0xc57368;}}})[_0x3b7b('0x25')](function(_0x14d48d){_0x2ab974['interaction']=_0x14d48d[_0x3b7b('0x38')]({'plain':!![]});_0x2ab974[_0x3b7b('0xbc')][_0x3b7b('0xbf')]=_0x131c54;if(_0x2ab974[_0x3b7b('0xbc')]['created']){if(_0x2ab974[_0x3b7b('0xa1')][_0x3b7b('0xc0')]){_0x2ab974['applications'][_0x3b7b('0xc1')]({'id':0x0,'priority':_0x2ab974[_0x3b7b('0xa2')][_0x3b7b('0x46')]+0x1,'app':'close','appdata':_0x3b7b('0xc2'),'interval':_0x3b7b('0xc3')});}}return db[_0x3b7b('0xc4')][_0x3b7b('0x5e')]({'body':_0x34ac89[_0x3b7b('0x5f')][_0x3b7b('0x5f')],'ChatWebsiteId':_0x34ac89[_0x3b7b('0x59')]['id'],'ChatInteractionId':_0x14d48d['id'],'direction':'in','ContactId':_0x2ab974[_0x3b7b('0xa7')]['id'],'AttachmentId':_0x34ac89[_0x3b7b('0x5f')][_0x3b7b('0xc5')]});})[_0x3b7b('0x25')](function(_0x30031f){_0x2ab974[_0x3b7b('0x2d')]=_0x30031f;if(_0x2ab974['interaction'][_0x3b7b('0xc6')]){return db['User']['find']({'attributes':['id',_0x3b7b('0x63')],'where':{'id':_0x2ab974[_0x3b7b('0xbc')]['UserId']}})[_0x3b7b('0x25')](function(_0x4616bb){if(_0x4616bb){_0x2ab974[_0x3b7b('0xa2')]['unshift']({'id':0x0,'priority':0x0,'app':_0x3b7b('0xc7'),'appdata':_0x4616bb[_0x3b7b('0x63')]+','+(_0x2ab974[_0x3b7b('0xa1')][_0x3b7b('0xc8')]||0xa),'interval':'*,*,*,*'});_0x2ab974['forcedOwnership']=!![];}return respondWithRpcPromise('Start',_0x3b7b('0xc9'),_0x2ab974);});}return respondWithRpcPromise(_0x3b7b('0xca'),_0x3b7b('0xc9'),_0x2ab974);})[_0x3b7b('0x25')](function(_0x359125){respondWithRpcPromise(_0x3b7b('0xcb'),'EventManager',{'event':_0x3b7b('0xcc'),'message':_0x359125},client9002);return _0x359125;})[_0x3b7b('0x25')](respondWithResult(_0x1db168,null))['catch'](handleError(_0x1db168,null));};exports['offline']=function(_0xf86887,_0x2265ba,_0x2f59cf){var _0x163d8e,_0x1541b4,_0x27688c;var _0x33e4d0=[];var _0x269f92=[];var _0x15ecd8={};return db[_0x3b7b('0x8c')][_0x3b7b('0x65')]()[_0x3b7b('0x25')](function(_0x414c6e){if(!_0x414c6e){throw new db['Sequelize'][(_0x3b7b('0x8d'))](_0x3b7b('0xcd'));}_0x269f92=_[_0x3b7b('0x8e')](_[_0x3b7b('0x5b')](_0x414c6e),['createdAt',_0x3b7b('0x9d')]);_0x33e4d0=_[_0x3b7b('0x8e')](_[_0x3b7b('0x5b')](_0x414c6e),[_0x3b7b('0x8f'),'updatedAt',_0x3b7b('0x90'),'ListId']);if(_0xf86887[_0x3b7b('0x5f')]['id']){delete _0xf86887[_0x3b7b('0x5f')]['id'];}if(_[_0x3b7b('0x7f')](_0xf86887['body'][_0x3b7b('0x92')])){throw _0x2265ba[_0x3b7b('0x30')](0x1f4)[_0x3b7b('0x3e')](new db[(_0x3b7b('0x93'))][(_0x3b7b('0x8d'))]('from\x20is\x20mandatory'));}if(_[_0x3b7b('0x7f')](_0xf86887[_0x3b7b('0x5f')][_0x3b7b('0x5f')])||_0xf86887[_0x3b7b('0x5f')]['body']===''){throw _0x2265ba[_0x3b7b('0x30')](0x1f4)[_0x3b7b('0x3e')](new db[(_0x3b7b('0x93'))][(_0x3b7b('0x8d'))](_0x3b7b('0x95')));}if(_['isNil'](_0xf86887[_0x3b7b('0x5f')][_0x3b7b('0xce')])){throw _0x2265ba[_0x3b7b('0x30')](0x1f4)[_0x3b7b('0x3e')](new db[(_0x3b7b('0x93'))][(_0x3b7b('0x8d'))](_0x3b7b('0xcf')+_0x33e4d0));}if(!_[_0x3b7b('0x98')](_0x33e4d0,_0xf86887[_0x3b7b('0x5f')][_0x3b7b('0xce')])){throw _0x2265ba[_0x3b7b('0x30')](0x1f4)[_0x3b7b('0x3e')](new db['Sequelize'][(_0x3b7b('0x8d'))]('mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x33e4d0));}_0x15ecd8[_0xf86887[_0x3b7b('0x5f')][_0x3b7b('0xce')]]=_0xf86887[_0x3b7b('0x5f')][_0x3b7b('0x92')];})[_0x3b7b('0x25')](function(){return db[_0x3b7b('0x55')][_0x3b7b('0x5d')]({'where':{'id':_0xf86887['params']['id']},'include':[{'model':db['CmList'],'as':'List'}]});})[_0x3b7b('0x25')](handleEntityNotFound(_0x2265ba,null))['then'](function(_0x3b8292){if(_0x3b8292&&_0x3b8292[_0x3b7b('0x9b')]){_0x1541b4=_0x3b8292;var _0xc0e145=_[_0x3b7b('0x1b')](_0xf86887['body'],{'firstName':_0xf86887['body']['from'],'phone':_0xf86887[_0x3b7b('0x5f')][_0x3b7b('0x92')],'ListId':_0x3b8292[_0x3b7b('0x91')]});_0xc0e145[_0xf86887[_0x3b7b('0x5f')][_0x3b7b('0xce')]]=_0xf86887[_0x3b7b('0x5f')][_0x3b7b('0x92')];return db[_0x3b7b('0x8c')][_0x3b7b('0xd0')]({'where':_0x15ecd8,'defaults':_0xc0e145});}})[_0x3b7b('0xd1')](function(_0x4e5f0e){if(_0x4e5f0e){_0x27688c=_0x4e5f0e;var _0x3950f5=fs['readFileSync'](path[_0x3b7b('0x76')](config['root'],_0x3b7b('0xd2')),_0x3b7b('0xd3'));var _0x32621c=ejs[_0x3b7b('0xd4')](_0x3950f5,{'body':_['toPairs'](_0xf86887[_0x3b7b('0x5f')][_0x3b7b('0x5f')]),'bodyTitle':_0x1541b4[_0x3b7b('0xd5')]});return db[_0x3b7b('0xd6')][_0x3b7b('0x5e')]({'body':_0x32621c,'ContactId':_0x4e5f0e['id'],'ChatWebsiteId':_0x1541b4['id']});}})['then'](function(_0x736474){if(_0x736474){_0x163d8e=_0x736474;return db[_0x3b7b('0xd7')]['findOne']({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':'Smtp','raw':!![]}]});}})['then'](function(_0x37652a){if(_0x37652a&&_0x37652a[_0x3b7b('0xd8')]&&_0x1541b4[_0x3b7b('0xd9')]){var _0x50c9e2={'tls':{'rejectUnauthorized':![]}};if(_0x37652a[_0x3b7b('0xd8')][_0x3b7b('0xda')]){_0x50c9e2[_0x3b7b('0xda')]=_0x37652a[_0x3b7b('0xd8')][_0x3b7b('0xda')];}else{_0x50c9e2[_0x3b7b('0xdb')]=_0x37652a[_0x3b7b('0xd8')][_0x3b7b('0xdb')];_0x50c9e2[_0x3b7b('0xdc')]=_0x37652a['Smtp'][_0x3b7b('0xdc')];_0x50c9e2[_0x3b7b('0xdd')]=_0x37652a[_0x3b7b('0xd8')][_0x3b7b('0xdd')];}if(_0x37652a['Smtp'][_0x3b7b('0xde')]){_0x50c9e2['auth']={'user':_0x37652a[_0x3b7b('0xd8')][_0x3b7b('0x60')],'pass':_0x37652a[_0x3b7b('0xd8')][_0x3b7b('0xdf')]};}return respondWithRpcPromise(_0x3b7b('0xe0'),_0x3b7b('0xe1'),{'account':_0x50c9e2,'message':{'from':util[_0x3b7b('0xb5')](_0x3b7b('0xe2'),_0x37652a[_0x3b7b('0x63')],_0x37652a[_0x3b7b('0xe3')]||_0x37652a[_0x3b7b('0xd8')]['user']),'to':_0x1541b4[_0x3b7b('0xd9')],'subject':_0x1541b4[_0x3b7b('0xe4')],'text':_0x163d8e[_0x3b7b('0x5f')]}},client9003)['then'](function(){return _0x163d8e;})['catch'](function(_0x536b6d){console[_0x3b7b('0x2b')](_0x536b6d);});}})[_0x3b7b('0x25')](function(){if(_0x163d8e){return _0x163d8e;}})['then'](respondWithResult(_0x2265ba,null))['catch'](handleError(_0x2265ba,null));};exports[_0x3b7b('0xe5')]=function(_0x4ccfe2,_0x166493,_0x79293){return db[_0x3b7b('0xb9')][_0x3b7b('0x5d')]({'where':{'id':_0x4ccfe2['params']['id']}})['then'](handleEntityNotFound(_0x166493,null))[_0x3b7b('0x25')](function(_0x208fca){if(_0x208fca){return _0x208fca[_0x3b7b('0xe5')](_0x4ccfe2[_0x3b7b('0x5f')][_0x3b7b('0x6a')],_[_0x3b7b('0xe6')](_0x4ccfe2['body'],[_0x3b7b('0x6a'),'id'])||{});}})[_0x3b7b('0x25')](respondWithResult(_0x166493,null))[_0x3b7b('0x2f')](handleError(_0x166493,null));};exports[_0x3b7b('0xe7')]=function(_0x4dfa16,_0x58d5e8,_0x549621){var _0xf61eac={'raw':![],'where':{}};var _0x20d694={};var _0x541346={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x3b7b('0x68')]({'where':{'id':_0x4dfa16[_0x3b7b('0x59')]['id']}})[_0x3b7b('0x25')](handleEntityNotFound(_0x58d5e8,null))['then'](function(_0xd070db){if(_0xd070db){_0x20d694[_0x3b7b('0x43')]=_[_0x3b7b('0x5b')](db['ChatInteraction'][_0x3b7b('0x40')]);_0x20d694[_0x3b7b('0x41')]=_[_0x3b7b('0x5b')](_0x4dfa16['query']);_0x20d694[_0x3b7b('0x4d')]=_[_0x3b7b('0x42')](_0x20d694[_0x3b7b('0x43')],_0x20d694[_0x3b7b('0x41')]);_0xf61eac[_0x3b7b('0x44')]=_['intersection'](_0x20d694[_0x3b7b('0x43')],qs['fields'](_0x4dfa16[_0x3b7b('0x41')]['fields']));_0xf61eac[_0x3b7b('0x44')]=_0xf61eac['attributes'][_0x3b7b('0x46')]?_0xf61eac[_0x3b7b('0x44')]:_0x20d694[_0x3b7b('0x43')];if(!_0x4dfa16[_0x3b7b('0x41')][_0x3b7b('0x47')](_0x3b7b('0x48'))){_0xf61eac[_0x3b7b('0x34')]=qs[_0x3b7b('0x34')](_0x4dfa16[_0x3b7b('0x41')]['limit']);_0xf61eac['offset']=qs['offset'](_0x4dfa16['query'][_0x3b7b('0x33')]);}_0xf61eac[_0x3b7b('0x49')]=qs[_0x3b7b('0x4a')](_0x4dfa16['query']['sort']);_0xf61eac[_0x3b7b('0x4b')]=qs[_0x3b7b('0x4d')](_['pick'](_0x4dfa16[_0x3b7b('0x41')],_0x20d694[_0x3b7b('0x4d')]));_0xf61eac[_0x3b7b('0x4b')][_0x3b7b('0x66')]=_0xd070db['id'];if(_0x4dfa16[_0x3b7b('0x41')]['filter']){_0xf61eac[_0x3b7b('0x4b')]=_[_0x3b7b('0x4f')](_0xf61eac[_0x3b7b('0x4b')],{'$or':_[_0x3b7b('0x50')](_0xf61eac['attributes'],function(_0x4bbb5b){var _0x40d96c={};_0x40d96c[_0x4bbb5b]={'$like':'%'+_0x4dfa16[_0x3b7b('0x41')][_0x3b7b('0x4e')]+'%'};return _0x40d96c;})});}_0xf61eac=_[_0x3b7b('0x4f')]({},_0xf61eac,_0x4dfa16['options']);return db['ChatInteraction'][_0x3b7b('0x32')]({'where':_0xf61eac['where']})[_0x3b7b('0x25')](function(_0x2521e3){_0x541346[_0x3b7b('0x32')]=_0x2521e3;if(_0x4dfa16['query'][_0x3b7b('0x56')]){_0xf61eac[_0x3b7b('0x5c')]=[{'model':db[_0x3b7b('0x8c')],'as':_0x3b7b('0xe8'),'required':![]},{'model':db[_0x3b7b('0xe9')],'as':_0x3b7b('0xea'),'attributes':[_0x3b7b('0x63'),_0x3b7b('0xeb'),_0x3b7b('0xec')],'required':![]},{'model':db[_0x3b7b('0xed')],'as':_0x3b7b('0xee'),'attributes':['id',_0x3b7b('0x63'),_0x3b7b('0xef')],'where':_0x4dfa16['query'][_0x3b7b('0xf0')]?{'id':_0x4dfa16['query']['tag']}:undefined,'required':_0x4dfa16['query'][_0x3b7b('0xf0')]?!![]:![]}];}return db[_0x3b7b('0xb9')]['findAll'](_0xf61eac);})[_0x3b7b('0x25')](function(_0x599695){_0x541346[_0x3b7b('0x6d')]=_0x599695;return _0x541346;});}})[_0x3b7b('0x25')](respondWithFilteredResult(_0x58d5e8,_0xf61eac))[_0x3b7b('0x2f')](handleError(_0x58d5e8,null));};function iftimePromise(_0x4861fe,_0x24c7c1){return respondWithRpcPromise('Command',_0x3b7b('0xf1'),{'command':_0x24c7c1[_0x3b7b('0xf2')]?util['format'](_0x3b7b('0xf3'),_0x4861fe[_0x3b7b('0xf4')],_0x24c7c1[_0x3b7b('0xf2')]):util[_0x3b7b('0xb5')](_0x3b7b('0xf5'),_0x4861fe[_0x3b7b('0xf4')])},client9002)['then'](function(_0x50a052){var _0x59cf6c=_0x50a052&&_0x50a052[_0x3b7b('0xf6')](_0x3b7b('0xf7'))>=0x0?!![]:![];logger[_0x3b7b('0x26')](_0x3b7b('0xf8'),_0x24c7c1['id'],_0x4861fe['id'],_0x4861fe['interval'],_0x59cf6c?_0x3b7b('0xf9'):_0x3b7b('0xfa'),_0x24c7c1[_0x3b7b('0xf2')]?_0x24c7c1[_0x3b7b('0xf2')]:'No\x20timezone');return _0x59cf6c;})[_0x3b7b('0x2f')](function(_0xcc7b9b){logger['error'](_0x3b7b('0xf8'),_0x24c7c1['id'],_0x4861fe['id'],_0x4861fe[_0x3b7b('0xf4')],util['inspect'](_0xcc7b9b,{'showHidden':![],'depth':null}),_0x24c7c1[_0x3b7b('0xf2')]?_0x24c7c1[_0x3b7b('0xf2')]:_0x3b7b('0xfb'));return![];});}exports['getSnippet']=function(_0x2cc4bf,_0x5a2771,_0x584461){var _0x1aadd2=0x0;var _0x328de6=0x0;var _0x1b1e4b=![];var _0xdabe37;var _0x130ce4;return db[_0x3b7b('0x55')][_0x3b7b('0x5d')]({'where':{'id':_0x2cc4bf[_0x3b7b('0x59')]['id']},'include':[{'model':db[_0x3b7b('0xfc')],'as':_0x3b7b('0xfc'),'include':[{'model':db[_0x3b7b('0xfc')],'as':_0x3b7b('0xfd'),'attributes':['id',_0x3b7b('0xf4')],'raw':!![]}]}]})[_0x3b7b('0x25')](handleEntityNotFound(_0x5a2771,null))[_0x3b7b('0x25')](function(_0x17834c){if(_0x17834c){_0xdabe37=_0x17834c;return _0x17834c[_0x3b7b('0xfe')]({'raw':!![]});}})['then'](function(_0x5f55e3){if(_0xdabe37){if(_0x5f55e3){_0x130ce4=_0x5f55e3;}}return require(_0x3b7b('0x79'))[_0x3b7b('0xff')]();})[_0x3b7b('0x25')](function(_0x2726cd){if(_0x2726cd){_0x328de6=_0x2726cd[_0x3b7b('0x100')];_0x1b1e4b=_0x2726cd[_0x3b7b('0x7a')];}})['then'](function(){return db[_0x3b7b('0xb9')][_0x3b7b('0x32')]({'where':{'closed':![]}});})[_0x3b7b('0x25')](function(_0x5d376b){_0x1aadd2=_0x5d376b;if(_0x328de6&&_0x5d376b>_0x328de6){return db[_0x3b7b('0x101')][_0x3b7b('0x68')]({'where':{'id':0x1}})[_0x3b7b('0x25')](function(_0x1bed9a){if(_0x1bed9a){_0x1bed9a['increment'](_0x3b7b('0x102'));}});}})[_0x3b7b('0x25')](function(){if(_0xdabe37['Interval']&&_0xdabe37[_0x3b7b('0xfc')][_0x3b7b('0xfd')]){var _0x4e2ccc=[];for(var _0x34dd1a=0x0;_0x34dd1a<_0xdabe37[_0x3b7b('0xfc')][_0x3b7b('0xfd')][_0x3b7b('0x46')];_0x34dd1a++){var _0x266d94=_0xdabe37['Interval'][_0x3b7b('0xfd')][_0x34dd1a][_0x3b7b('0x38')]({'plain':!![]});_0x4e2ccc[_0x3b7b('0xc1')](iftimePromise(_0x266d94,_0xdabe37));}return BPromise[_0x3b7b('0x103')](_0x4e2ccc)[_0x3b7b('0x25')](function(_0x42e828){return _[_0x3b7b('0x104')](_0x42e828);});}else{return!![];}})[_0x3b7b('0x25')](function(_0x46958d){var _0x12dbf2=fs[_0x3b7b('0x105')](path['join'](config[_0x3b7b('0x77')],_0x3b7b('0x106')),_0x3b7b('0xd3'));var _0x2a68a5={'remote':_0xdabe37[_0x3b7b('0x107')],'query':querystring[_0x3b7b('0xb7')](_[_0x3b7b('0x4f')](_0xdabe37[_0x3b7b('0x38')]({'plain':!![]}),{'customerIp':_0x2cc4bf[_0x3b7b('0x89')]['x-forwarded-for']||_0x2cc4bf['headers']['x-real-ip']||_0x2cc4bf['connection'][_0x3b7b('0x108')]||_0x2cc4bf['ip'],'referer':_0x2cc4bf[_0x3b7b('0x89')][_0x3b7b('0xae')],'openedInteractions':_0x1aadd2,'maxInteractions':_0x328de6,'virtual':_0x1b1e4b[_0x3b7b('0x100')],'online':_0x46958d,'custom':_0x1b1e4b}))[_0x3b7b('0x109')](/'/g,'\x5c\x27')};_0x5a2771[_0x3b7b('0x3e')](ejs[_0x3b7b('0xd4')](Mustache[_0x3b7b('0xd4')](_0x12dbf2,_0x2a68a5),{'proactiveActions':_0x130ce4,'alignment':_0xdabe37[_0x3b7b('0x10a')],'verticalAlignment':_0xdabe37[_0x3b7b('0x10b')]}));})[_0x3b7b('0x2f')](handleError(_0x5a2771,null));};exports['addApplications']=function(_0xea9bfa,_0xbd8813,_0x3fa60d){return db[_0x3b7b('0x55')][_0x3b7b('0x68')]({'where':{'id':_0xea9bfa[_0x3b7b('0x59')]['id']}})['then'](handleEntityNotFound(_0xbd8813,null))[_0x3b7b('0x25')](function(_0x5d2e16){if(_0x5d2e16){return db[_0x3b7b('0x10c')][_0x3b7b('0x10d')](function(_0x9cd313){return db[_0x3b7b('0x9f')][_0x3b7b('0x37')]({'where':{'ChatWebsiteId':_0xea9bfa[_0x3b7b('0x59')]['id']},'transaction':_0x9cd313})[_0x3b7b('0x25')](function(_0x53154e){var _0x181ed3=_[_0x3b7b('0x50')](_0xea9bfa[_0x3b7b('0x5f')],function(_0x42fbbe){_0x42fbbe[_0x3b7b('0x66')]=_0xea9bfa[_0x3b7b('0x59')]['id'];return _0x42fbbe;});return db[_0x3b7b('0x9f')][_0x3b7b('0x10e')](_0x181ed3,{'transaction':_0x9cd313});});})['then'](function(){return db[_0x3b7b('0x9f')][_0x3b7b('0x10f')]({'where':{'ChatWebsiteId':_0xea9bfa[_0x3b7b('0x59')]['id']},'order':_0x3b7b('0xa5')});});}})[_0x3b7b('0x25')](respondWithResult(_0xbd8813,null))[_0x3b7b('0x2f')](handleError(_0xbd8813,null));};exports[_0x3b7b('0x110')]=function(_0x2f8afc,_0xb17a4e,_0x1cc30c){var _0x205b54={};var _0x2c3582={};var _0x21c3bb;var _0x63cac0;return db[_0x3b7b('0x55')][_0x3b7b('0x68')]({'where':{'id':_0x2f8afc[_0x3b7b('0x59')]['id']}})[_0x3b7b('0x25')](handleEntityNotFound(_0xb17a4e,null))[_0x3b7b('0x25')](function(_0x15a5f2){if(_0x15a5f2){_0x21c3bb=_0x15a5f2;_0x2c3582[_0x3b7b('0x43')]=_['keys'](db[_0x3b7b('0x9f')][_0x3b7b('0x40')]);_0x2c3582[_0x3b7b('0x41')]=_[_0x3b7b('0x5b')](_0x2f8afc['query']);_0x2c3582[_0x3b7b('0x4d')]=_['intersection'](_0x2c3582[_0x3b7b('0x43')],_0x2c3582[_0x3b7b('0x41')]);_0x205b54['attributes']=_['intersection'](_0x2c3582[_0x3b7b('0x43')],qs[_0x3b7b('0x45')](_0x2f8afc[_0x3b7b('0x41')][_0x3b7b('0x45')]));_0x205b54[_0x3b7b('0x44')]=_0x205b54[_0x3b7b('0x44')][_0x3b7b('0x46')]?_0x205b54['attributes']:_0x2c3582[_0x3b7b('0x43')];_0x205b54[_0x3b7b('0x49')]=qs['sort'](_0x2f8afc[_0x3b7b('0x41')][_0x3b7b('0x4a')]);_0x205b54[_0x3b7b('0x4b')]=qs['filters'](_['pick'](_0x2f8afc[_0x3b7b('0x41')],_0x2c3582[_0x3b7b('0x4d')]));if(_0x2f8afc[_0x3b7b('0x41')]['filter']){_0x205b54['where']=_[_0x3b7b('0x4f')](_0x205b54[_0x3b7b('0x4b')],{'$or':_[_0x3b7b('0x50')](_0x205b54[_0x3b7b('0x44')],function(_0x1ddefd){var _0x99261b={};_0x99261b[_0x1ddefd]={'$like':'%'+_0x2f8afc[_0x3b7b('0x41')][_0x3b7b('0x4e')]+'%'};return _0x99261b;})});}_0x205b54=_[_0x3b7b('0x4f')]({},_0x205b54,_0x2f8afc[_0x3b7b('0x54')]);return _0x21c3bb['getApplications'](_0x205b54);}})[_0x3b7b('0x25')](function(_0x42b27d){if(_0x42b27d){_0x63cac0=_0x42b27d['length'];if(!_0x2f8afc[_0x3b7b('0x41')]['hasOwnProperty'](_0x3b7b('0x48'))){_0x205b54[_0x3b7b('0x34')]=qs[_0x3b7b('0x34')](_0x2f8afc[_0x3b7b('0x41')][_0x3b7b('0x34')]);_0x205b54['offset']=qs['offset'](_0x2f8afc[_0x3b7b('0x41')][_0x3b7b('0x33')]);}return _0x21c3bb['getApplications'](_0x205b54);}})[_0x3b7b('0x25')](function(_0x4d7930){if(_0x4d7930){return _0x4d7930?{'count':_0x63cac0,'rows':_0x4d7930}:null;}})[_0x3b7b('0x25')](respondWithResult(_0xb17a4e,null))[_0x3b7b('0x2f')](handleError(_0xb17a4e,null));};exports[_0x3b7b('0x111')]=function(_0x1b470d,_0x39be0a,_0x387d44){return db[_0x3b7b('0x112')][_0x3b7b('0x5d')]({'where':{'id':_0x1b470d[_0x3b7b('0x59')]['id']}})['then'](handleEntityNotFound(_0x39be0a,null))['then'](function(_0x5af8ae){if(_0x5af8ae){return _0x5af8ae[_0x3b7b('0x111')](_0x1b470d[_0x3b7b('0x5f')]['ids'],_[_0x3b7b('0xe6')](_0x1b470d[_0x3b7b('0x5f')],[_0x3b7b('0x6a'),'id'])||{});}})[_0x3b7b('0x25')](respondWithResult(_0x39be0a,null))[_0x3b7b('0x2f')](handleError(_0x39be0a,null));};exports[_0x3b7b('0xfe')]=function(_0x31af31,_0x45f40c,_0x2e2620){var _0x2e18f6={};var _0x5ccd92={};var _0x11e169;var _0x58420d;return db[_0x3b7b('0x55')][_0x3b7b('0x68')]({'where':{'id':_0x31af31[_0x3b7b('0x59')]['id']}})[_0x3b7b('0x25')](handleEntityNotFound(_0x45f40c,null))[_0x3b7b('0x25')](function(_0xd78144){if(_0xd78144){_0x11e169=_0xd78144;_0x5ccd92[_0x3b7b('0x43')]=_[_0x3b7b('0x5b')](db[_0x3b7b('0x113')][_0x3b7b('0x40')]);_0x5ccd92[_0x3b7b('0x41')]=_[_0x3b7b('0x5b')](_0x31af31[_0x3b7b('0x41')]);_0x5ccd92[_0x3b7b('0x4d')]=_[_0x3b7b('0x42')](_0x5ccd92['model'],_0x5ccd92[_0x3b7b('0x41')]);_0x2e18f6[_0x3b7b('0x44')]=_['intersection'](_0x5ccd92[_0x3b7b('0x43')],qs[_0x3b7b('0x45')](_0x31af31['query']['fields']));_0x2e18f6['attributes']=_0x2e18f6[_0x3b7b('0x44')][_0x3b7b('0x46')]?_0x2e18f6[_0x3b7b('0x44')]:_0x5ccd92[_0x3b7b('0x43')];_0x2e18f6[_0x3b7b('0x49')]=qs[_0x3b7b('0x4a')](_0x31af31[_0x3b7b('0x41')]['sort']);_0x2e18f6[_0x3b7b('0x4b')]=qs['filters'](_[_0x3b7b('0x4c')](_0x31af31[_0x3b7b('0x41')],_0x5ccd92[_0x3b7b('0x4d')]));if(_0x31af31['query'][_0x3b7b('0x4e')]){_0x2e18f6[_0x3b7b('0x4b')]=_[_0x3b7b('0x4f')](_0x2e18f6[_0x3b7b('0x4b')],{'$or':_[_0x3b7b('0x50')](_0x2e18f6['attributes'],function(_0x5644a0){var _0x19662d={};_0x19662d[_0x5644a0]={'$like':'%'+_0x31af31[_0x3b7b('0x41')][_0x3b7b('0x4e')]+'%'};return _0x19662d;})});}_0x2e18f6=_[_0x3b7b('0x4f')]({},_0x2e18f6,_0x31af31[_0x3b7b('0x54')]);return _0x11e169['getProactiveActions'](_0x2e18f6);}})[_0x3b7b('0x25')](function(_0x382de6){if(_0x382de6){_0x58420d=_0x382de6['length'];if(!_0x31af31[_0x3b7b('0x41')][_0x3b7b('0x47')]('nolimit')){_0x2e18f6[_0x3b7b('0x34')]=qs['limit'](_0x31af31[_0x3b7b('0x41')][_0x3b7b('0x34')]);_0x2e18f6[_0x3b7b('0x33')]=qs[_0x3b7b('0x33')](_0x31af31['query']['offset']);}return _0x11e169[_0x3b7b('0xfe')](_0x2e18f6);}})[_0x3b7b('0x25')](function(_0x4de246){if(_0x4de246){return _0x4de246?{'count':_0x58420d,'rows':_0x4de246}:null;}})[_0x3b7b('0x25')](respondWithResult(_0x45f40c,null))['catch'](handleError(_0x45f40c,null));};exports[_0x3b7b('0x114')]=function(_0x524a01,_0x2b7139,_0x34822c){var _0x41d3d0=_0x524a01[_0x3b7b('0x41')][_0x3b7b('0x115')]===_0x3b7b('0x116')?'offlineForm':_0x3b7b('0x117');return db[_0x3b7b('0x55')][_0x3b7b('0x5d')]({'attributes':['id',_0x41d3d0],'where':{'id':_0x524a01[_0x3b7b('0x59')]['id']}})[_0x3b7b('0x25')](handleEntityNotFound(_0x2b7139,null))[_0x3b7b('0x25')](function(_0x2517b4){if(_0x2517b4){var _0x54bfcf=_0x2517b4[_0x41d3d0];var _0x5a4529=_0x54bfcf&&_0x54bfcf[_0x3b7b('0x118')]?_0x54bfcf[_0x3b7b('0x118')]:[];_0x2b7139[_0x3b7b('0x3e')]({'fromKey':_[_0x3b7b('0x7f')](_0x54bfcf['fromKey'])?undefined:_0x54bfcf[_0x3b7b('0x119')],'count':_0x5a4529[_0x3b7b('0x46')],'rows':_0x5a4529});}})[_0x3b7b('0x2f')](handleError(_0x2b7139,null));};exports[_0x3b7b('0x11a')]=function(_0x648b16,_0x1a8642,_0x5dd048){var _0x4f7a0f={'raw':!![],'where':{}};var _0x57a3ad={};var _0x268015={'count':0x0,'rows':[]};return db[_0x3b7b('0x55')][_0x3b7b('0x68')]({'where':{'id':_0x648b16[_0x3b7b('0x59')]['id']}})['then'](handleEntityNotFound(_0x1a8642,null))[_0x3b7b('0x25')](function(_0x51c6a2){if(_0x51c6a2){_0x57a3ad[_0x3b7b('0x43')]=_[_0x3b7b('0x5b')](db[_0x3b7b('0xd6')][_0x3b7b('0x40')]);_0x57a3ad[_0x3b7b('0x41')]=_[_0x3b7b('0x5b')](_0x648b16[_0x3b7b('0x41')]);_0x57a3ad['filters']=_[_0x3b7b('0x42')](_0x57a3ad[_0x3b7b('0x43')],_0x57a3ad[_0x3b7b('0x41')]);_0x4f7a0f[_0x3b7b('0x44')]=_[_0x3b7b('0x42')](_0x57a3ad[_0x3b7b('0x43')],qs['fields'](_0x648b16[_0x3b7b('0x41')][_0x3b7b('0x45')]));_0x4f7a0f[_0x3b7b('0x44')]=_0x4f7a0f[_0x3b7b('0x44')]['length']?_0x4f7a0f['attributes']:_0x57a3ad[_0x3b7b('0x43')];if(!_0x648b16[_0x3b7b('0x41')][_0x3b7b('0x47')](_0x3b7b('0x48'))){_0x4f7a0f[_0x3b7b('0x34')]=qs[_0x3b7b('0x34')](_0x648b16[_0x3b7b('0x41')][_0x3b7b('0x34')]);_0x4f7a0f[_0x3b7b('0x33')]=qs[_0x3b7b('0x33')](_0x648b16[_0x3b7b('0x41')][_0x3b7b('0x33')]);}_0x4f7a0f['order']=qs[_0x3b7b('0x4a')](_0x648b16['query'][_0x3b7b('0x4a')]);_0x4f7a0f[_0x3b7b('0x4b')]=qs[_0x3b7b('0x4d')](_['pick'](_0x648b16[_0x3b7b('0x41')],_0x57a3ad[_0x3b7b('0x4d')]));_0x4f7a0f['where']['ChatWebsiteId']=_0x51c6a2['id'];if(_0x648b16[_0x3b7b('0x41')][_0x3b7b('0x4e')]){_0x4f7a0f[_0x3b7b('0x4b')]=_[_0x3b7b('0x4f')](_0x4f7a0f[_0x3b7b('0x4b')],{'$or':_['map'](_0x4f7a0f[_0x3b7b('0x44')],function(_0x533171){var _0x4ac2d8={};_0x4ac2d8[_0x533171]={'$like':'%'+_0x648b16['query'][_0x3b7b('0x4e')]+'%'};return _0x4ac2d8;})});}_0x4f7a0f=_[_0x3b7b('0x4f')]({},_0x4f7a0f,_0x648b16[_0x3b7b('0x54')]);return db[_0x3b7b('0xd6')][_0x3b7b('0x32')]({'where':_0x4f7a0f['where']})[_0x3b7b('0x25')](function(_0x2a0369){_0x268015['count']=_0x2a0369;if(_0x648b16[_0x3b7b('0x41')]['includeAll']){_0x4f7a0f[_0x3b7b('0x5c')]=[{'all':!![]}];}return db[_0x3b7b('0xd6')][_0x3b7b('0x57')](_0x4f7a0f);})[_0x3b7b('0x25')](function(_0x5ed0fb){_0x268015[_0x3b7b('0x6d')]=_0x5ed0fb;return _0x268015;});}})[_0x3b7b('0x25')](respondWithFilteredResult(_0x1a8642,_0x4f7a0f))[_0x3b7b('0x2f')](handleError(_0x1a8642,null));};exports[_0x3b7b('0x11b')]=function(_0x25c149,_0x490b2f,_0x1ad2e0){return db[_0x3b7b('0x55')][_0x3b7b('0x5d')]({'where':{'id':_0x25c149[_0x3b7b('0x59')]['id']}})['then'](handleEntityNotFound(_0x490b2f,null))[_0x3b7b('0x25')](function(_0x541515){if(_0x541515){return _0x541515['addAgents'](_0x25c149[_0x3b7b('0x5f')][_0x3b7b('0x6a')],_[_0x3b7b('0xe6')](_0x25c149['body'],[_0x3b7b('0x6a'),'id'])||{})[_0x3b7b('0xd1')](function(_0x5427ce){for(var _0x2eef88=0x0;_0x2eef88<_0x25c149['body'][_0x3b7b('0x6a')][_0x3b7b('0x46')];_0x2eef88+=0x1){socket[_0x3b7b('0x11c')]('userChatWebsite:save',{'UserId':_0x25c149['body'][_0x3b7b('0x6a')][_0x2eef88],'ChatWebsiteId':_0x25c149[_0x3b7b('0x59')]['id']});}return _0x5427ce;});}})[_0x3b7b('0x25')](respondWithResult(_0x490b2f,null))[_0x3b7b('0x2f')](handleError(_0x490b2f,null));};exports['removeAgents']=function(_0x2c8a4c,_0x2583eb,_0x465d7d){return db['ChatWebsite'][_0x3b7b('0x5d')]({'where':{'id':_0x2c8a4c[_0x3b7b('0x59')]['id']}})[_0x3b7b('0x25')](handleEntityNotFound(_0x2583eb,null))['then'](function(_0x5f2449){if(_0x5f2449){return _0x5f2449[_0x3b7b('0x11d')](_0x2c8a4c['query'][_0x3b7b('0x6a')])['then'](function(){if(_[_0x3b7b('0x11e')](_0x2c8a4c['query'][_0x3b7b('0x6a')])){for(var _0xf97102=0x0;_0xf97102<_0x2c8a4c[_0x3b7b('0x41')][_0x3b7b('0x6a')][_0x3b7b('0x46')];_0xf97102+=0x1){socket[_0x3b7b('0x11c')](_0x3b7b('0x11f'),{'UserId':Number(_0x2c8a4c[_0x3b7b('0x41')][_0x3b7b('0x6a')][_0xf97102]),'ChatWebsiteId':Number(_0x2c8a4c[_0x3b7b('0x59')]['id'])});}}else{socket[_0x3b7b('0x11c')](_0x3b7b('0x11f'),{'UserId':Number(_0x2c8a4c[_0x3b7b('0x41')][_0x3b7b('0x6a')]),'ChatWebsiteId':Number(_0x2c8a4c['params']['id'])});}});}})['then'](respondWithStatusCode(_0x2583eb,null))[_0x3b7b('0x2f')](handleError(_0x2583eb,null));};exports[_0x3b7b('0x120')]=function(_0x552f85,_0x127e3e,_0x113069){var _0x25bf64={};var _0x2e1701={};var _0x484e0d;var _0x58d481;return db[_0x3b7b('0x55')]['findOne']({'where':{'id':_0x552f85['params']['id']}})['then'](handleEntityNotFound(_0x127e3e,null))[_0x3b7b('0x25')](function(_0x4d4156){if(_0x4d4156){_0x484e0d=_0x4d4156;_0x2e1701[_0x3b7b('0x43')]=_['keys'](db['User'][_0x3b7b('0x40')]);_0x2e1701[_0x3b7b('0x41')]=_[_0x3b7b('0x5b')](_0x552f85[_0x3b7b('0x41')]);_0x2e1701[_0x3b7b('0x4d')]=_['intersection'](_0x2e1701[_0x3b7b('0x43')],_0x2e1701[_0x3b7b('0x41')]);_0x25bf64['attributes']=_['intersection'](_0x2e1701[_0x3b7b('0x43')],qs['fields'](_0x552f85[_0x3b7b('0x41')][_0x3b7b('0x45')]));_0x25bf64[_0x3b7b('0x44')]=_0x25bf64[_0x3b7b('0x44')][_0x3b7b('0x46')]?_0x25bf64[_0x3b7b('0x44')]:_0x2e1701['model'];_0x25bf64[_0x3b7b('0x49')]=qs[_0x3b7b('0x4a')](_0x552f85[_0x3b7b('0x41')][_0x3b7b('0x4a')]);_0x25bf64[_0x3b7b('0x4b')]=qs[_0x3b7b('0x4d')](_[_0x3b7b('0x4c')](_0x552f85[_0x3b7b('0x41')],_0x2e1701[_0x3b7b('0x4d')]));if(_0x552f85[_0x3b7b('0x41')][_0x3b7b('0x4e')]){_0x25bf64[_0x3b7b('0x4b')]=_['merge'](_0x25bf64[_0x3b7b('0x4b')],{'$or':_['map'](_0x25bf64[_0x3b7b('0x44')],function(_0x24b865){var _0xefa6da={};_0xefa6da[_0x24b865]={'$like':'%'+_0x552f85[_0x3b7b('0x41')][_0x3b7b('0x4e')]+'%'};return _0xefa6da;})});}_0x25bf64=_['merge']({},_0x25bf64,_0x552f85['options']);return _0x484e0d['getAgents'](_0x25bf64);}})[_0x3b7b('0x25')](function(_0x57cd5d){if(_0x57cd5d){_0x58d481=_0x57cd5d['length'];if(!_0x552f85[_0x3b7b('0x41')][_0x3b7b('0x47')](_0x3b7b('0x48'))){_0x25bf64[_0x3b7b('0x34')]=qs[_0x3b7b('0x34')](_0x552f85[_0x3b7b('0x41')][_0x3b7b('0x34')]);_0x25bf64[_0x3b7b('0x33')]=qs[_0x3b7b('0x33')](_0x552f85[_0x3b7b('0x41')][_0x3b7b('0x33')]);}return _0x484e0d['getAgents'](_0x25bf64);}})['then'](function(_0x5188e9){if(_0x5188e9){return _0x5188e9?{'count':_0x58d481,'rows':_0x5188e9}:null;}})[_0x3b7b('0x25')](respondWithResult(_0x127e3e,null))[_0x3b7b('0x2f')](handleError(_0x127e3e,null));}; \ No newline at end of file +var _0x2839=['CannedAnswer','getAnswers','map','removeAnswers','sitepic','file','filename','agentAvatar','addCustomerAvatar','customerAvatar','getLogo','join','root','server/files/images/logos/default_logo.png','../../config/license/util','getLicense','custom','isNil','existsSync','server/files/images/logos/','download','getAvatar','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','getSystemAvatar','systemAvatar','notify','setUA','headers','user-agent','getResult','Sequelize','ValidationError','no\x20available\x20attributes','difference','updatedAt','createdAt','ListId','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','CmList','List','Contacts','Applications','list','applications','orderBy','priority','asc','account','defaults','mapKey','CmContact','contact','customerIp','cf-connecting-ip','first','x-forwarded-for','split','firstName','lastName','x-real-port','referer','browser','version','format','%s\x20%s','unknown','vendor','%s\x20%s\x20%s','device','threadId','externalUrl','ChatInteraction','ContactId','interaction','messageId','created','autoclose','push','*,*,*,*','AttachmentId','User','UserId','unshift','forcedOwnership','Start','startRouting','EventManager','offline','CompanyId','send','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','spread','server/files/templates/chatOfflineMessage.ejs','render','toPairs','offlineMessageBody','ChatOfflineMessage','MailAccount','MailServerOut','Smtp','forwardOfflineAddress','service','host','port','secure','authentication','SendMail','sendMail','\x22%s\x22\x20<%s>','offlineMessageSubject','getInteractions','Contact','Owner','fullname','internal','color','tag','getSnippet','iftime\x20%s,%s','interval','iftime\x20%s','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','timezone','inspect','No\x20timezone','Interval','Intervals','getProactiveActions','License','increment','chatLicenseExceeded','some','server/files/chat/iframe.js','utf8','remoteAddress','virtual','replace','alignment','verticalAlignment','addApplications','sequelize','transaction','ChatApplication','findAndCountAll','getApplications','chatProactiveAction','addProactiveActions','omit','getFields','online','false','offlineForm','onlineForm','items','fromKey','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','rimraf','request-promise','moment','mustache','path','to-csv','ejs','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','register','client','http','test','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','status','end','offset','limit','set','Content-Range','json','save','update','ChatWebsites','UserProfileResource','destroy','stack','name','index','Pause','mandatoryDispositionPause','ChatWebsite','rawAttributes','model','query','keys','filters','intersection','fields','attributes','length','nolimit','sort','pick','filter','where','merge','type','VIRTUAL','field','options','count','includeAll','include','findAll','rows','catch','params','find','create','body','user','get','UserProfileSection','userProfileId','autoAssociation','describe','addDisposition','getDispositions','findOne','Disposition','hasOwnProperty','order','ChatWebsiteId','removeDispositions','ids','addAnswer'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x2839,0xae));var _0x9283=function(_0x313db1,_0x10120d){_0x313db1=_0x313db1-0x0;var _0x2d9e9e=_0x2839[_0x313db1];return _0x2d9e9e;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x9283('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x9283('0x1'));var moment=require(_0x9283('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x9283('0x3'));var util=require('util');var path=require(_0x9283('0x4'));var sox=require('sox');var csv=require(_0x9283('0x5'));var ejs=require(_0x9283('0x6'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x9283('0x7'));var jsforce=require(_0x9283('0x8'));var deskjs=require(_0x9283('0x9'));var toCsv=require(_0x9283('0x5'));var querystring=require(_0x9283('0xa'));var Papa=require(_0x9283('0xb'));var Redis=require(_0x9283('0xc'));var authService=require(_0x9283('0xd'));var qs=require(_0x9283('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x9283('0xf'))(_0x9283('0x10'));var utils=require(_0x9283('0x11'));var config=require(_0x9283('0x12'));var db=require(_0x9283('0x13'))['db'];config[_0x9283('0x14')]=_['defaults'](config[_0x9283('0x14')],{'host':_0x9283('0x15'),'port':0x18eb});var socket=require(_0x9283('0x16'))(new Redis(config['redis']));require('./chatWebsite.socket')[_0x9283('0x17')](socket);var jayson=require('jayson/promise');var client=jayson[_0x9283('0x18')][_0x9283('0x19')]({'port':0x232c});var client9002=jayson[_0x9283('0x18')][_0x9283('0x19')]({'port':0x232a});var client9003=jayson['client'][_0x9283('0x19')]({'port':0x232b});function checkPasswordPattern(_0x3f8f6d,_0x26537d,_0x31f082){if(_0x31f082){var _0x329746=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x329746[_0x9283('0x1a')](_0x26537d)){return _0x3f8f6d;}else{throw new Error('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x3f8f6d;}}function respondWithRpcPromise(_0x213cac,_0x310411,_0x4d0162,_0x5b069f){return new BPromise(function(_0x4cf9ec,_0x329be6){var _0xb87224=_0x5b069f||client;return _0xb87224[_0x9283('0x1b')](_0x213cac,_0x4d0162)[_0x9283('0x1c')](function(_0x3978e2){logger[_0x9283('0x1d')](_0x9283('0x1e'),_0x310411,_0x9283('0x1f'));logger[_0x9283('0x20')](_0x9283('0x21'),_0x310411,_0x9283('0x1f'),JSON[_0x9283('0x22')](_0x3978e2));if(_0x3978e2[_0x9283('0x23')]){if(_0x3978e2[_0x9283('0x23')][_0x9283('0x24')]===0x1f4){logger[_0x9283('0x23')](_0x9283('0x1e'),_0x310411,_0x3978e2['error']['message']);return _0x329be6(_0x3978e2[_0x9283('0x23')][_0x9283('0x25')]);}logger[_0x9283('0x23')](_0x9283('0x1e'),_0x310411,_0x3978e2[_0x9283('0x23')][_0x9283('0x25')]);return _0x4cf9ec(_0x3978e2[_0x9283('0x23')][_0x9283('0x25')]);}else{logger[_0x9283('0x1d')](_0x9283('0x1e'),_0x310411,'request\x20sent');_0x4cf9ec(_0x3978e2[_0x9283('0x26')][_0x9283('0x25')]);}})['catch'](function(_0x4dfbf1){logger[_0x9283('0x23')]('ChatWebsite,\x20%s,\x20%s',_0x310411,_0x4dfbf1);_0x329be6(_0x4dfbf1);});});}function respondWithStatusCode(_0xe1cb41,_0x4698a1){_0x4698a1=_0x4698a1||0xcc;return function(_0x3c676c){if(_0x3c676c){return _0xe1cb41[_0x9283('0x27')](_0x4698a1);}return _0xe1cb41[_0x9283('0x28')](_0x4698a1)[_0x9283('0x29')]();};}function respondWithResult(_0x568526,_0x292286){_0x292286=_0x292286||0xc8;return function(_0x2eb16c){if(_0x2eb16c){return _0x568526[_0x9283('0x28')](_0x292286)['json'](_0x2eb16c);}};}function respondWithFilteredResult(_0x5315c0,_0x33ce47){return function(_0x3d6120){if(_0x3d6120){var _0x8bff70=_0x3d6120['count'],_0x48123f=_0x33ce47['offset'],_0x298b22=_0x33ce47[_0x9283('0x2a')]+_0x33ce47[_0x9283('0x2b')],_0x15fb87;if(_0x298b22>=_0x8bff70){_0x298b22=_0x8bff70;_0x15fb87=0xc8;}else{_0x15fb87=0xce;}_0x5315c0[_0x9283('0x28')](_0x15fb87);return _0x5315c0[_0x9283('0x2c')](_0x9283('0x2d'),_0x48123f+'-'+_0x298b22+'/'+_0x8bff70)[_0x9283('0x2e')](_0x3d6120);}return null;};}function patchUpdates(_0x1ea86b){return function(_0x39efac){try{jsonpatch['apply'](_0x39efac,_0x1ea86b,!![]);}catch(_0x4c98b1){return BPromise['reject'](_0x4c98b1);}return _0x39efac[_0x9283('0x2f')]();};}function saveUpdates(_0x5f3645,_0x3badf9){return function(_0x2afe53){if(_0x2afe53){return _0x2afe53[_0x9283('0x30')](_0x5f3645)['then'](function(_0x5e27d5){return _0x5e27d5;});}return null;};}function removeEntity(_0x2c0814,_0x55285c){return function(_0x35ec61){if(_0x35ec61){return _0x35ec61['destroy']()['then'](function(){var _0x502d3d=_0x35ec61['get']({'plain':!![]});var _0x306149=_0x9283('0x31');return db[_0x9283('0x32')][_0x9283('0x33')]({'where':{'type':_0x306149,'resourceId':_0x502d3d['id']}})[_0x9283('0x1c')](function(){return _0x35ec61;});})['then'](function(){_0x2c0814[_0x9283('0x28')](0xcc)[_0x9283('0x29')]();});}};}function handleEntityNotFound(_0x41699f,_0x1a088a){return function(_0x48285f){if(!_0x48285f){_0x41699f[_0x9283('0x27')](0x194);}return _0x48285f;};}function handleError(_0x2f8d3c,_0x240594){_0x240594=_0x240594||0x1f4;return function(_0x10774d){logger[_0x9283('0x23')](_0x10774d[_0x9283('0x34')]);if(_0x10774d[_0x9283('0x35')]){delete _0x10774d[_0x9283('0x35')];}_0x2f8d3c[_0x9283('0x28')](_0x240594)['send'](_0x10774d);};}exports[_0x9283('0x36')]=function(_0x52e057,_0x22771b){var _0x4b7f2e={'include':[{'model':db[_0x9283('0x37')],'as':_0x9283('0x38')}]},_0x34a517={},_0x53fccb={'count':0x0,'rows':[]};var _0xcd170e=db[_0x9283('0x39')][_0x9283('0x3a')];_0x34a517[_0x9283('0x3b')]=_['keys'](_0xcd170e);_0x34a517[_0x9283('0x3c')]=_[_0x9283('0x3d')](_0x52e057[_0x9283('0x3c')]);_0x34a517[_0x9283('0x3e')]=_[_0x9283('0x3f')](_0x34a517[_0x9283('0x3b')],_0x34a517[_0x9283('0x3c')]);_0x4b7f2e['attributes']=_[_0x9283('0x3f')](_0x34a517['model'],qs[_0x9283('0x40')](_0x52e057[_0x9283('0x3c')][_0x9283('0x40')]));_0x4b7f2e[_0x9283('0x41')]=_0x4b7f2e[_0x9283('0x41')][_0x9283('0x42')]?_0x4b7f2e[_0x9283('0x41')]:_0x34a517[_0x9283('0x3b')];if(!_0x52e057[_0x9283('0x3c')]['hasOwnProperty'](_0x9283('0x43'))){_0x4b7f2e[_0x9283('0x2b')]=qs[_0x9283('0x2b')](_0x52e057[_0x9283('0x3c')][_0x9283('0x2b')]);_0x4b7f2e[_0x9283('0x2a')]=qs[_0x9283('0x2a')](_0x52e057[_0x9283('0x3c')]['offset']);}_0x4b7f2e['order']=qs['sort'](_0x52e057[_0x9283('0x3c')][_0x9283('0x44')]);_0x4b7f2e['where']=qs[_0x9283('0x3e')](_[_0x9283('0x45')](_0x52e057[_0x9283('0x3c')],_0x34a517[_0x9283('0x3e')]));if(_0x52e057[_0x9283('0x3c')][_0x9283('0x46')]){_0x4b7f2e[_0x9283('0x47')]=_[_0x9283('0x48')](_0x4b7f2e['where'],{'$or':_['map'](_0xcd170e,function(_0x10625d){if(_0x10625d[_0x9283('0x49')]['key']!==_0x9283('0x4a')){var _0xa01367={};_0xa01367[_0x10625d[_0x9283('0x4b')]]={'$like':'%'+_0x52e057[_0x9283('0x3c')][_0x9283('0x46')]+'%'};return _0xa01367;}})});}_0x4b7f2e=_[_0x9283('0x48')]({},_0x4b7f2e,_0x52e057[_0x9283('0x4c')]);var _0x757b22={'where':_0x4b7f2e[_0x9283('0x47')]};return db[_0x9283('0x39')][_0x9283('0x4d')](_0x757b22)['then'](function(_0x55598d){_0x53fccb['count']=_0x55598d;if(_0x52e057[_0x9283('0x3c')][_0x9283('0x4e')]){_0x4b7f2e[_0x9283('0x4f')]=[{'all':!![]}];}return db[_0x9283('0x39')][_0x9283('0x50')](_0x4b7f2e);})[_0x9283('0x1c')](function(_0x5c4a4a){_0x53fccb[_0x9283('0x51')]=_0x5c4a4a;return _0x53fccb;})[_0x9283('0x1c')](respondWithFilteredResult(_0x22771b,_0x4b7f2e))[_0x9283('0x52')](handleError(_0x22771b,null));};exports['show']=function(_0x1650c9,_0x1d5923){var _0x2a25ef={'raw':![],'where':{'id':_0x1650c9[_0x9283('0x53')]['id']},'include':[{'model':db[_0x9283('0x37')],'as':_0x9283('0x38')}]},_0x9c2185={};_0x9c2185[_0x9283('0x3b')]=_[_0x9283('0x3d')](db['ChatWebsite']['rawAttributes']);_0x9c2185[_0x9283('0x3c')]=_[_0x9283('0x3d')](_0x1650c9[_0x9283('0x3c')]);_0x9c2185['filters']=_[_0x9283('0x3f')](_0x9c2185[_0x9283('0x3b')],_0x9c2185[_0x9283('0x3c')]);_0x2a25ef[_0x9283('0x41')]=_[_0x9283('0x3f')](_0x9c2185[_0x9283('0x3b')],qs[_0x9283('0x40')](_0x1650c9[_0x9283('0x3c')]['fields']));_0x2a25ef[_0x9283('0x41')]=_0x2a25ef[_0x9283('0x41')][_0x9283('0x42')]?_0x2a25ef['attributes']:_0x9c2185['model'];if(_0x1650c9[_0x9283('0x3c')]['includeAll']){_0x2a25ef['include']=[{'all':!![]}];}_0x2a25ef=_['merge']({},_0x2a25ef,_0x1650c9[_0x9283('0x4c')]);return db['ChatWebsite'][_0x9283('0x54')](_0x2a25ef)['then'](handleEntityNotFound(_0x1d5923,null))[_0x9283('0x1c')](respondWithResult(_0x1d5923,null))[_0x9283('0x52')](handleError(_0x1d5923,null));};exports[_0x9283('0x55')]=function(_0x3b3b8e,_0x139e4e){return db[_0x9283('0x39')][_0x9283('0x55')](_0x3b3b8e[_0x9283('0x56')],{})[_0x9283('0x1c')](function(_0x848a39){var _0x48c023=_0x3b3b8e[_0x9283('0x57')][_0x9283('0x58')]({'plain':!![]});if(!_0x48c023)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x48c023['role']===_0x9283('0x57')){var _0x8c2324=_0x848a39[_0x9283('0x58')]({'plain':!![]});var _0x20aec3='ChatWebsites';return db[_0x9283('0x59')]['find']({'where':{'name':_0x20aec3,'userProfileId':_0x48c023[_0x9283('0x5a')]},'raw':!![]})[_0x9283('0x1c')](function(_0x264edd){if(_0x264edd&&_0x264edd[_0x9283('0x5b')]===0x0){return db[_0x9283('0x32')][_0x9283('0x55')]({'name':_0x8c2324[_0x9283('0x35')],'resourceId':_0x8c2324['id'],'type':_0x264edd[_0x9283('0x35')],'sectionId':_0x264edd['id']},{})[_0x9283('0x1c')](function(){return _0x848a39;});}else{return _0x848a39;}})[_0x9283('0x52')](function(_0x5214fa){logger[_0x9283('0x23')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5214fa);throw _0x5214fa;});}return _0x848a39;})[_0x9283('0x1c')](respondWithResult(_0x139e4e,0xc9))[_0x9283('0x52')](handleError(_0x139e4e,null));};exports[_0x9283('0x30')]=function(_0x30f3c4,_0x4aff67){if(_0x30f3c4['body']['id']){delete _0x30f3c4['body']['id'];}return db[_0x9283('0x39')]['find']({'where':{'id':_0x30f3c4[_0x9283('0x53')]['id']},'include':[{'model':db[_0x9283('0x37')],'as':_0x9283('0x38')}]})[_0x9283('0x1c')](handleEntityNotFound(_0x4aff67,null))[_0x9283('0x1c')](saveUpdates(_0x30f3c4[_0x9283('0x56')],null))[_0x9283('0x1c')](respondWithResult(_0x4aff67,null))[_0x9283('0x52')](handleError(_0x4aff67,null));};exports[_0x9283('0x33')]=function(_0x5cf52e,_0x52ac23){return db[_0x9283('0x39')][_0x9283('0x54')]({'where':{'id':_0x5cf52e['params']['id']}})[_0x9283('0x1c')](handleEntityNotFound(_0x52ac23,null))['then'](removeEntity(_0x52ac23,null))['catch'](handleError(_0x52ac23,null));};exports['describe']=function(_0x28aa9d,_0x43b148){return db['ChatWebsite'][_0x9283('0x5c')]()[_0x9283('0x1c')](respondWithResult(_0x43b148,null))[_0x9283('0x52')](handleError(_0x43b148,null));};exports[_0x9283('0x5d')]=function(_0x49a199,_0x244642,_0x788452){if(_0x49a199[_0x9283('0x56')]['id']){delete _0x49a199[_0x9283('0x56')]['id'];}return db[_0x9283('0x39')][_0x9283('0x54')]({'where':{'id':_0x49a199[_0x9283('0x53')]['id']}})[_0x9283('0x1c')](handleEntityNotFound(_0x244642,null))[_0x9283('0x1c')](function(_0xb6397b){if(_0xb6397b){_0x49a199[_0x9283('0x56')]['ChatWebsiteId']=_0xb6397b['id'];return db['Disposition']['create'](_0x49a199[_0x9283('0x56')]);}})[_0x9283('0x1c')](respondWithResult(_0x244642,null))[_0x9283('0x52')](handleError(_0x244642,null));};exports[_0x9283('0x5e')]=function(_0x512a68,_0x7f146b,_0x2efb57){var _0x2e4467={'raw':![],'where':{}};var _0x1cfbb0={};var _0x2b8d3c={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x9283('0x5f')]({'where':{'id':_0x512a68['params']['id']}})['then'](handleEntityNotFound(_0x7f146b,null))['then'](function(_0x4b1bb7){if(_0x4b1bb7){_0x1cfbb0['model']=_[_0x9283('0x3d')](db[_0x9283('0x60')][_0x9283('0x3a')]);_0x1cfbb0['query']=_[_0x9283('0x3d')](_0x512a68[_0x9283('0x3c')]);_0x1cfbb0[_0x9283('0x3e')]=_['intersection'](_0x1cfbb0[_0x9283('0x3b')],_0x1cfbb0[_0x9283('0x3c')]);_0x2e4467[_0x9283('0x41')]=_[_0x9283('0x3f')](_0x1cfbb0[_0x9283('0x3b')],qs[_0x9283('0x40')](_0x512a68[_0x9283('0x3c')]['fields']));_0x2e4467['attributes']=_0x2e4467['attributes'][_0x9283('0x42')]?_0x2e4467[_0x9283('0x41')]:_0x1cfbb0[_0x9283('0x3b')];if(!_0x512a68[_0x9283('0x3c')][_0x9283('0x61')](_0x9283('0x43'))){_0x2e4467[_0x9283('0x2b')]=qs[_0x9283('0x2b')](_0x512a68['query'][_0x9283('0x2b')]);_0x2e4467[_0x9283('0x2a')]=qs['offset'](_0x512a68[_0x9283('0x3c')][_0x9283('0x2a')]);}_0x2e4467[_0x9283('0x62')]=qs['sort'](_0x512a68[_0x9283('0x3c')]['sort']);_0x2e4467[_0x9283('0x47')]=qs[_0x9283('0x3e')](_[_0x9283('0x45')](_0x512a68[_0x9283('0x3c')],_0x1cfbb0[_0x9283('0x3e')]));_0x2e4467[_0x9283('0x47')][_0x9283('0x63')]=_0x4b1bb7['id'];if(_0x512a68['query'][_0x9283('0x46')]){_0x2e4467['where']=_[_0x9283('0x48')](_0x2e4467['where'],{'$or':_['map'](_0x2e4467[_0x9283('0x41')],function(_0x2a9b4c){var _0x48983b={};_0x48983b[_0x2a9b4c]={'$like':'%'+_0x512a68['query']['filter']+'%'};return _0x48983b;})});}_0x2e4467=_[_0x9283('0x48')]({},_0x2e4467,_0x512a68[_0x9283('0x4c')]);return db['Disposition'][_0x9283('0x4d')]({'where':_0x2e4467[_0x9283('0x47')]})[_0x9283('0x1c')](function(_0x4dc722){_0x2b8d3c['count']=_0x4dc722;if(_0x512a68[_0x9283('0x3c')][_0x9283('0x4e')]){_0x2e4467[_0x9283('0x4f')]=[{'all':!![]}];}return db[_0x9283('0x60')]['findAll'](_0x2e4467);})['then'](function(_0x41aa64){_0x2b8d3c[_0x9283('0x51')]=_0x41aa64;return _0x2b8d3c;});}})[_0x9283('0x1c')](respondWithFilteredResult(_0x7f146b,_0x2e4467))[_0x9283('0x52')](handleError(_0x7f146b,null));};exports[_0x9283('0x64')]=function(_0x1ddab0,_0xa265f4,_0x205a47){return db[_0x9283('0x39')][_0x9283('0x54')]({'where':{'id':_0x1ddab0['params']['id']}})[_0x9283('0x1c')](handleEntityNotFound(_0xa265f4,null))[_0x9283('0x1c')](function(_0x4c917e){if(_0x4c917e){return _0x4c917e[_0x9283('0x64')](_0x1ddab0['query'][_0x9283('0x65')]);}})[_0x9283('0x1c')](respondWithStatusCode(_0xa265f4,null))['catch'](handleError(_0xa265f4,null));};exports[_0x9283('0x66')]=function(_0x179fb9,_0x42a466,_0x48e985){if(_0x179fb9[_0x9283('0x56')]['id']){delete _0x179fb9[_0x9283('0x56')]['id'];}return db[_0x9283('0x39')][_0x9283('0x54')]({'where':{'id':_0x179fb9[_0x9283('0x53')]['id']}})[_0x9283('0x1c')](handleEntityNotFound(_0x42a466,null))[_0x9283('0x1c')](function(_0x4b9aa3){if(_0x4b9aa3){_0x179fb9[_0x9283('0x56')]['ChatWebsiteId']=_0x4b9aa3['id'];return db[_0x9283('0x67')][_0x9283('0x55')](_0x179fb9[_0x9283('0x56')]);}})[_0x9283('0x1c')](respondWithResult(_0x42a466,null))[_0x9283('0x52')](handleError(_0x42a466,null));};exports[_0x9283('0x68')]=function(_0x49502c,_0x26eb57,_0x2733ec){var _0x4efefc={'raw':![],'where':{}};var _0x30725d={};var _0x113588={'count':0x0,'rows':[]};return db[_0x9283('0x39')]['findOne']({'where':{'id':_0x49502c[_0x9283('0x53')]['id']}})[_0x9283('0x1c')](handleEntityNotFound(_0x26eb57,null))[_0x9283('0x1c')](function(_0x145a2d){if(_0x145a2d){_0x30725d['model']=_[_0x9283('0x3d')](db[_0x9283('0x67')][_0x9283('0x3a')]);_0x30725d[_0x9283('0x3c')]=_[_0x9283('0x3d')](_0x49502c[_0x9283('0x3c')]);_0x30725d[_0x9283('0x3e')]=_[_0x9283('0x3f')](_0x30725d[_0x9283('0x3b')],_0x30725d[_0x9283('0x3c')]);_0x4efefc[_0x9283('0x41')]=_['intersection'](_0x30725d[_0x9283('0x3b')],qs[_0x9283('0x40')](_0x49502c['query'][_0x9283('0x40')]));_0x4efefc[_0x9283('0x41')]=_0x4efefc['attributes']['length']?_0x4efefc[_0x9283('0x41')]:_0x30725d[_0x9283('0x3b')];if(!_0x49502c['query'][_0x9283('0x61')]('nolimit')){_0x4efefc[_0x9283('0x2b')]=qs[_0x9283('0x2b')](_0x49502c['query']['limit']);_0x4efefc[_0x9283('0x2a')]=qs[_0x9283('0x2a')](_0x49502c[_0x9283('0x3c')][_0x9283('0x2a')]);}_0x4efefc[_0x9283('0x62')]=qs[_0x9283('0x44')](_0x49502c[_0x9283('0x3c')][_0x9283('0x44')]);_0x4efefc[_0x9283('0x47')]=qs['filters'](_['pick'](_0x49502c[_0x9283('0x3c')],_0x30725d[_0x9283('0x3e')]));_0x4efefc['where'][_0x9283('0x63')]=_0x145a2d['id'];if(_0x49502c[_0x9283('0x3c')][_0x9283('0x46')]){_0x4efefc[_0x9283('0x47')]=_[_0x9283('0x48')](_0x4efefc['where'],{'$or':_[_0x9283('0x69')](_0x4efefc[_0x9283('0x41')],function(_0x31275d){var _0x511f31={};_0x511f31[_0x31275d]={'$like':'%'+_0x49502c[_0x9283('0x3c')][_0x9283('0x46')]+'%'};return _0x511f31;})});}_0x4efefc=_[_0x9283('0x48')]({},_0x4efefc,_0x49502c['options']);return db['CannedAnswer']['count']({'where':_0x4efefc['where']})['then'](function(_0xdd9002){_0x113588[_0x9283('0x4d')]=_0xdd9002;if(_0x49502c[_0x9283('0x3c')][_0x9283('0x4e')]){_0x4efefc[_0x9283('0x4f')]=[{'all':!![]}];}return db[_0x9283('0x67')][_0x9283('0x50')](_0x4efefc);})['then'](function(_0x339d94){_0x113588[_0x9283('0x51')]=_0x339d94;return _0x113588;});}})[_0x9283('0x1c')](respondWithFilteredResult(_0x26eb57,_0x4efefc))[_0x9283('0x52')](handleError(_0x26eb57,null));};exports[_0x9283('0x6a')]=function(_0x4228e1,_0x27b4b4,_0x1d826e){return db[_0x9283('0x39')][_0x9283('0x54')]({'where':{'id':_0x4228e1[_0x9283('0x53')]['id']}})[_0x9283('0x1c')](handleEntityNotFound(_0x27b4b4,null))[_0x9283('0x1c')](function(_0x1fe86b){if(_0x1fe86b){return _0x1fe86b[_0x9283('0x6a')](_0x4228e1[_0x9283('0x3c')][_0x9283('0x65')]);}})[_0x9283('0x1c')](respondWithStatusCode(_0x27b4b4,null))['catch'](handleError(_0x27b4b4,null));};exports['addLogo']=function(_0x42213f,_0x2f1426,_0x2f29f6){_0x42213f['body'][_0x9283('0x6b')]=_0x42213f[_0x9283('0x6c')][_0x9283('0x6d')];return db[_0x9283('0x39')][_0x9283('0x54')]({'where':{'id':_0x42213f[_0x9283('0x53')]['id']}})['then'](handleEntityNotFound(_0x2f1426,null))[_0x9283('0x1c')](saveUpdates(_0x42213f['body'],null))['then'](respondWithResult(_0x2f1426,null))[_0x9283('0x52')](handleError(_0x2f1426,null));};exports['addAvatar']=function(_0x1b976c,_0x48d86f,_0x5158d0){_0x1b976c[_0x9283('0x56')][_0x9283('0x6e')]=_0x1b976c[_0x9283('0x6c')][_0x9283('0x6d')];return db[_0x9283('0x39')][_0x9283('0x54')]({'where':{'id':_0x1b976c['params']['id']}})['then'](handleEntityNotFound(_0x48d86f,null))[_0x9283('0x1c')](saveUpdates(_0x1b976c['body'],null))[_0x9283('0x1c')](respondWithResult(_0x48d86f,null))[_0x9283('0x52')](handleError(_0x48d86f,null));};exports[_0x9283('0x6f')]=function(_0x3641ff,_0x17d19c,_0x4c6c2b){_0x3641ff[_0x9283('0x56')][_0x9283('0x70')]=_0x3641ff[_0x9283('0x6c')][_0x9283('0x6d')];return db[_0x9283('0x39')][_0x9283('0x54')]({'where':{'id':_0x3641ff[_0x9283('0x53')]['id']}})[_0x9283('0x1c')](handleEntityNotFound(_0x17d19c,null))[_0x9283('0x1c')](saveUpdates(_0x3641ff[_0x9283('0x56')],null))[_0x9283('0x1c')](respondWithResult(_0x17d19c,null))[_0x9283('0x52')](handleError(_0x17d19c,null));};exports['addSystemAvatar']=function(_0x3f4d15,_0xf327e6,_0x121e98){_0x3f4d15[_0x9283('0x56')]['systemAvatar']=_0x3f4d15[_0x9283('0x6c')]['filename'];return db[_0x9283('0x39')][_0x9283('0x54')]({'where':{'id':_0x3f4d15[_0x9283('0x53')]['id']}})[_0x9283('0x1c')](handleEntityNotFound(_0xf327e6,null))[_0x9283('0x1c')](saveUpdates(_0x3f4d15['body'],null))[_0x9283('0x1c')](respondWithResult(_0xf327e6,null))[_0x9283('0x52')](handleError(_0xf327e6,null));};exports[_0x9283('0x71')]=function(_0xb6df7e,_0x185baa,_0x254605){var _0x5a3a7d=path[_0x9283('0x72')](config[_0x9283('0x73')],_0x9283('0x74'));var _0x1c9a50={'where':{'id':_0xb6df7e[_0x9283('0x53')]['id']},'attributes':['id',_0x9283('0x6b')],'raw':!![]};var _0x37bcb9=![];return require(_0x9283('0x75'))[_0x9283('0x76')]()[_0x9283('0x1c')](function(_0x3fcc3b){if(_0x3fcc3b){_0x37bcb9=_0x3fcc3b[_0x9283('0x77')];}})['then'](function(){return db['ChatWebsite'][_0x9283('0x54')](_0x1c9a50);})[_0x9283('0x1c')](handleEntityNotFound(_0x185baa,null))[_0x9283('0x1c')](function(_0x1dc29b){if(_0x1dc29b){if(!_[_0x9283('0x78')](_0x1dc29b['sitepic'])){if(fs[_0x9283('0x79')](path[_0x9283('0x72')](config['root'],_0x9283('0x7a'),_0x1dc29b['sitepic']))&&_0x37bcb9){_0x5a3a7d=path[_0x9283('0x72')](config[_0x9283('0x73')],_0x9283('0x7a'),_0x1dc29b[_0x9283('0x6b')]);}}return _0x185baa[_0x9283('0x7b')](_0x5a3a7d);}})[_0x9283('0x52')](handleError(_0x185baa,null));};exports[_0x9283('0x7c')]=function(_0x18ae94,_0x962ba7,_0x319365){var _0xc2b304=path[_0x9283('0x72')](config[_0x9283('0x73')],'server/files/images/avatars/default_avatar.png');var _0x1b0867={'where':{'id':_0x18ae94[_0x9283('0x53')]['id']},'attributes':['id','agentAvatar'],'raw':!![]};return db[_0x9283('0x39')]['find'](_0x1b0867)[_0x9283('0x1c')](handleEntityNotFound(_0x962ba7,null))[_0x9283('0x1c')](function(_0x139e7f){if(_0x139e7f){if(!_[_0x9283('0x78')](_0x139e7f[_0x9283('0x6e')])){if(fs['existsSync'](path[_0x9283('0x72')](config['root'],_0x9283('0x7d'),_0x139e7f[_0x9283('0x6e')]))){_0xc2b304=path['join'](config[_0x9283('0x73')],_0x9283('0x7d'),_0x139e7f[_0x9283('0x6e')]);}}return _0x962ba7[_0x9283('0x7b')](_0xc2b304);}})[_0x9283('0x52')](handleError(_0x962ba7,null));};exports[_0x9283('0x7e')]=function(_0x5d2e10,_0xd39903,_0x5229bc){var _0x20ee9e=path[_0x9283('0x72')](config[_0x9283('0x73')],_0x9283('0x7f'));var _0x1eea63={'where':{'id':_0x5d2e10[_0x9283('0x53')]['id']},'attributes':['id',_0x9283('0x70'),_0x9283('0x80')],'raw':!![]};return db['ChatWebsite'][_0x9283('0x54')](_0x1eea63)[_0x9283('0x1c')](handleEntityNotFound(_0xd39903,null))[_0x9283('0x1c')](function(_0x150289){if(_0x150289){if(!_[_0x9283('0x78')](_0x150289[_0x9283('0x70')])){if(fs[_0x9283('0x79')](path[_0x9283('0x72')](config[_0x9283('0x73')],_0x9283('0x7d'),_0x150289[_0x9283('0x70')]))&&_0x150289[_0x9283('0x80')]){_0x20ee9e=path['join'](config[_0x9283('0x73')],'server/files/images/avatars/',_0x150289[_0x9283('0x70')]);}}return _0xd39903['download'](_0x20ee9e);}})['catch'](handleError(_0xd39903,null));};exports[_0x9283('0x81')]=function(_0x261bbd,_0x4ae0d1,_0x50a77f){var _0x34bbea=path['join'](config[_0x9283('0x73')],'server/files/images/avatars/system_avatar.png');var _0x54152f={'where':{'id':_0x261bbd['params']['id']},'attributes':['id','systemAvatar'],'raw':!![]};return db[_0x9283('0x39')]['find'](_0x54152f)['then'](handleEntityNotFound(_0x4ae0d1,null))['then'](function(_0x23196a){if(_0x23196a){if(!_[_0x9283('0x78')](_0x23196a[_0x9283('0x82')])){if(fs['existsSync'](path[_0x9283('0x72')](config[_0x9283('0x73')],_0x9283('0x7d'),_0x23196a[_0x9283('0x82')]))){_0x34bbea=path[_0x9283('0x72')](config['root'],_0x9283('0x7d'),_0x23196a[_0x9283('0x82')]);}}return _0x4ae0d1['download'](_0x34bbea);}})[_0x9283('0x52')](handleError(_0x4ae0d1,null));};exports[_0x9283('0x83')]=function(_0x278150,_0x100570,_0x34a36c){var _0x4f4c0d=require('user-agent-parser');var _0x4956de=new _0x4f4c0d();var _0x130f91=_0x4956de[_0x9283('0x84')](_0x278150[_0x9283('0x85')][_0x9283('0x86')])[_0x9283('0x87')]();var _0x17c117={'body':_0x278150[_0x9283('0x56')],'channel':'chat'};var _0x5991c4=[];var _0x2e11d2=[];var _0x1b0dda={};var _0x34400b=![];return db['CmContact']['describe']()[_0x9283('0x1c')](function(_0x36e630){if(!_0x36e630){throw new db[(_0x9283('0x88'))][(_0x9283('0x89'))](_0x9283('0x8a'));}_0x5991c4=_[_0x9283('0x8b')](_[_0x9283('0x3d')](_0x36e630),['createdAt',_0x9283('0x8c')]);_0x2e11d2=_[_0x9283('0x8b')](_[_0x9283('0x3d')](_0x36e630),[_0x9283('0x8d'),'updatedAt','CompanyId',_0x9283('0x8e')]);if(_0x278150[_0x9283('0x56')]['id']){delete _0x278150[_0x9283('0x56')]['id'];}if(_['isNil'](_0x278150[_0x9283('0x56')]['from'])){throw new db['Sequelize'][(_0x9283('0x89'))]('from\x20is\x20mandatory');}if(_[_0x9283('0x78')](_0x278150['body']['body'])||_0x278150[_0x9283('0x56')][_0x9283('0x56')]===''){throw new db[(_0x9283('0x88'))][(_0x9283('0x89'))](_0x9283('0x8f'));}if(_[_0x9283('0x78')](_0x278150[_0x9283('0x56')]['mapKey'])){throw new db[(_0x9283('0x88'))][(_0x9283('0x89'))](_0x9283('0x90')+_0x2e11d2);}if(!_[_0x9283('0x91')](_0x2e11d2,_0x278150[_0x9283('0x56')]['mapKey'])){throw new db[(_0x9283('0x88'))][(_0x9283('0x89'))](_0x9283('0x92')+_0x2e11d2);}_0x1b0dda[_0x278150[_0x9283('0x56')]['mapKey']]=_0x278150['body'][_0x9283('0x93')];})[_0x9283('0x1c')](function(){return db[_0x9283('0x39')][_0x9283('0x54')]({'where':{'id':_0x278150[_0x9283('0x53')]['id']},'include':[{'model':db[_0x9283('0x94')],'as':_0x9283('0x95'),'include':[{'model':db['CmContact'],'as':_0x9283('0x96'),'where':_0x1b0dda,'limit':0x1,'order':[[_0x9283('0x8c'),'DESC']]}]},{'model':db['ChatApplication'],'as':_0x9283('0x97')}]});})[_0x9283('0x1c')](handleEntityNotFound(_0x100570,null))[_0x9283('0x1c')](function(_0x511942){if(_0x511942&&_0x511942['List']){_0x17c117['account']=_0x511942;_0x17c117['applications']=_0x511942['Applications'];_0x17c117[_0x9283('0x98')]=_0x511942[_0x9283('0x95')];_0x17c117[_0x9283('0x99')]=_[_0x9283('0x9a')](_0x17c117[_0x9283('0x99')],[_0x9283('0x9b')],[_0x9283('0x9c')]);if(_0x17c117[_0x9283('0x9d')]['Applications']){delete _0x17c117['account']['Applications'];}if(_0x17c117[_0x9283('0x9d')][_0x9283('0x95')]&&_0x17c117[_0x9283('0x9d')][_0x9283('0x95')]['Contacts'][_0x9283('0x42')]){return _0x17c117['account']['List']['Contacts'][0x0];}var _0x279a16=_[_0x9283('0x9e')](_0x278150[_0x9283('0x56')],{'firstName':_0x278150['body']['from'],'ListId':_0x511942[_0x9283('0x8e')]});_0x279a16[_0x278150['body'][_0x9283('0x9f')]]=_0x278150[_0x9283('0x56')][_0x9283('0x93')];return db[_0x9283('0xa0')][_0x9283('0x55')](_0x279a16,{'fields':_0x5991c4,'raw':!![]});}})['then'](handleEntityNotFound(_0x100570,null))[_0x9283('0x1c')](function(_0xd9829e){_0x17c117[_0x9283('0xa1')]=_0xd9829e;var _0x4a8c86=_0x278150[_0x9283('0x56')][_0x9283('0xa2')];if(_0x278150['headers'][_0x9283('0xa3')]){_0x4a8c86=_0x278150[_0x9283('0x85')][_0x9283('0xa3')];}else if(_0x278150['headers']['x-forwarded-for']){_0x4a8c86=_[_0x9283('0xa4')](_0x278150[_0x9283('0x85')][_0x9283('0xa5')][_0x9283('0xa6')](','));}if(_0xd9829e){var _0x5e05e9={'ContactId':_0xd9829e['id'],'ChatWebsiteId':_0x278150[_0x9283('0x53')]['id'],'from':(_0xd9829e[_0x9283('0xa7')]||'')+'\x20'+(_0xd9829e[_0x9283('0xa8')]||''),'customerIp':_0x4a8c86,'customerPort':_0x278150[_0x9283('0x85')]['x-real-port']?_0x278150[_0x9283('0x85')][_0x9283('0xa9')]:null,'referer':_0x278150[_0x9283('0x56')][_0x9283('0xaa')],'browserName':_0x130f91[_0x9283('0xab')][_0x9283('0x35')]&&_0x130f91['browser'][_0x9283('0xac')]?util[_0x9283('0xad')](_0x9283('0xae'),_0x130f91[_0x9283('0xab')][_0x9283('0x35')],_0x130f91[_0x9283('0xab')][_0x9283('0xac')]):_0x9283('0xaf'),'browserVersion':_0x130f91[_0x9283('0xab')]['version']||_0x9283('0xaf'),'osName':util[_0x9283('0xad')](_0x9283('0xae'),_0x130f91['os']['name'],_0x130f91['os'][_0x9283('0xac')]),'osVersion':_0x130f91['os'][_0x9283('0xac')],'deviceModel':_0x130f91['device'][_0x9283('0x3b')]&&_0x130f91['device'][_0x9283('0xb0')]?util[_0x9283('0xad')](_0x9283('0xb1'),_0x130f91[_0x9283('0xb2')][_0x9283('0x3b')],_0x130f91['device'][_0x9283('0xb0')],_0x130f91[_0x9283('0xb2')]['type']):null,'deviceVendor':_0x130f91['device'][_0x9283('0xb0')],'deviceType':_0x130f91[_0x9283('0xb2')][_0x9283('0x49')],'formData':JSON['stringify'](_0x278150[_0x9283('0x56')])};var _0x2015db={'ChatWebsiteId':_0x278150['params']['id'],'closed':![]};if(_0x278150[_0x9283('0x56')][_0x9283('0xb3')]){_0x2015db[_0x9283('0xb3')]=_0x278150['body'][_0x9283('0xb3')];return db['ChatInteraction']['find']({'where':_0x2015db})[_0x9283('0x1c')](function(_0x24f9cb){if(_0x24f9cb){return[_0x24f9cb,![]];}_0x5e05e9[_0x9283('0xb3')]=_0x278150[_0x9283('0x56')]['threadId'];_0x5e05e9[_0x9283('0xb4')]=_0x278150['body'][_0x9283('0xb4')];return db[_0x9283('0xb5')][_0x9283('0x55')](_0x5e05e9)[_0x9283('0x1c')](function(_0x2dffb8){return[_0x2dffb8,!![]];});});}_0x2015db[_0x9283('0xb6')]=_0xd9829e['id'];if(_0x278150['body'][_0x9283('0xb7')]&&_0x278150['body'][_0x9283('0xb7')]['id']){_0x2015db['id']=_0x278150['body'][_0x9283('0xb7')]['id'];return db[_0x9283('0xb5')]['find']({'where':_0x2015db})['then'](function(_0x27df41){if(_0x27df41){return[_0x27df41,![]];}return db['ChatInteraction'][_0x9283('0x55')](_0x5e05e9)[_0x9283('0x1c')](function(_0x5bb796){return[_0x5bb796,!![]];});});}return db[_0x9283('0xb5')][_0x9283('0x55')](_0x5e05e9)[_0x9283('0x1c')](function(_0x5e45f3){return[_0x5e45f3,!![]];});}})['spread'](function(_0x1988d7,_0x2fa81c){if(_0x1988d7){_0x34400b=_0x2fa81c;if(!_0x2fa81c){var _0x17eb29={'from':(_0x17c117[_0x9283('0xa1')][_0x9283('0xa7')]||'')+'\x20'+(_0x17c117['contact'][_0x9283('0xa8')]||'')};if(_0x278150[_0x9283('0x56')][_0x9283('0xb3')]&&_0x278150[_0x9283('0x56')][_0x9283('0xb8')]&&_0x278150[_0x9283('0x56')][_0x9283('0xb3')]!=_0x278150[_0x9283('0x56')]['messageId']){_0x17eb29['threadId']=_0x278150[_0x9283('0x56')][_0x9283('0xb8')];}return _0x1988d7[_0x9283('0x30')](_0x17eb29);}else{return _0x1988d7;}}})[_0x9283('0x1c')](function(_0x3ab0f6){_0x17c117[_0x9283('0xb7')]=_0x3ab0f6[_0x9283('0x58')]({'plain':!![]});_0x17c117[_0x9283('0xb7')][_0x9283('0xb9')]=_0x34400b;if(_0x17c117['interaction']['created']){if(_0x17c117['account'][_0x9283('0xba')]){_0x17c117[_0x9283('0x99')][_0x9283('0xbb')]({'id':0x0,'priority':_0x17c117[_0x9283('0x99')]['length']+0x1,'app':'close','appdata':'unmanaged','interval':_0x9283('0xbc')});}}return db['ChatMessage']['create']({'body':_0x278150[_0x9283('0x56')][_0x9283('0x56')],'ChatWebsiteId':_0x278150['params']['id'],'ChatInteractionId':_0x3ab0f6['id'],'direction':'in','ContactId':_0x17c117['contact']['id'],'AttachmentId':_0x278150[_0x9283('0x56')][_0x9283('0xbd')]});})[_0x9283('0x1c')](function(_0x410731){_0x17c117['message']=_0x410731;if(_0x17c117[_0x9283('0xb7')]['UserId']){return db[_0x9283('0xbe')]['find']({'attributes':['id','name'],'where':{'id':_0x17c117[_0x9283('0xb7')][_0x9283('0xbf')]}})['then'](function(_0x588078){if(_0x588078){_0x17c117[_0x9283('0x99')][_0x9283('0xc0')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x588078[_0x9283('0x35')]+','+(_0x17c117[_0x9283('0x9d')]['waitForTheAssignedAgent']||0xa),'interval':_0x9283('0xbc')});_0x17c117[_0x9283('0xc1')]=!![];}return respondWithRpcPromise(_0x9283('0xc2'),'startRouting',_0x17c117);});}return respondWithRpcPromise(_0x9283('0xc2'),_0x9283('0xc3'),_0x17c117);})[_0x9283('0x1c')](function(_0xe6b913){respondWithRpcPromise('EventManager',_0x9283('0xc4'),{'event':_0x9283('0x83'),'message':_0xe6b913},client9002);return _0xe6b913;})[_0x9283('0x1c')](respondWithResult(_0x100570,null))[_0x9283('0x52')](handleError(_0x100570,null));};exports[_0x9283('0xc5')]=function(_0x4b0dd7,_0x588b14,_0x4118b5){var _0x46192c,_0x99fb3d,_0x2ecd43;var _0x5e066c=[];var _0x43351a=[];var _0x525092={};return db[_0x9283('0xa0')][_0x9283('0x5c')]()[_0x9283('0x1c')](function(_0x35a443){if(!_0x35a443){throw new db['Sequelize'][(_0x9283('0x89'))](_0x9283('0x8a'));}_0x43351a=_[_0x9283('0x8b')](_[_0x9283('0x3d')](_0x35a443),[_0x9283('0x8d'),'updatedAt']);_0x5e066c=_['difference'](_[_0x9283('0x3d')](_0x35a443),['createdAt',_0x9283('0x8c'),_0x9283('0xc6'),_0x9283('0x8e')]);if(_0x4b0dd7['body']['id']){delete _0x4b0dd7[_0x9283('0x56')]['id'];}if(_[_0x9283('0x78')](_0x4b0dd7['body'][_0x9283('0x93')])){throw _0x588b14[_0x9283('0x28')](0x1f4)[_0x9283('0xc7')](new db[(_0x9283('0x88'))][(_0x9283('0x89'))]('from\x20is\x20mandatory'));}if(_[_0x9283('0x78')](_0x4b0dd7[_0x9283('0x56')][_0x9283('0x56')])||_0x4b0dd7[_0x9283('0x56')][_0x9283('0x56')]===''){throw _0x588b14[_0x9283('0x28')](0x1f4)[_0x9283('0xc7')](new db['Sequelize'][(_0x9283('0x89'))](_0x9283('0x8f')));}if(_['isNil'](_0x4b0dd7[_0x9283('0x56')][_0x9283('0xc8')])){throw _0x588b14['status'](0x1f4)[_0x9283('0xc7')](new db['Sequelize'][(_0x9283('0x89'))](_0x9283('0xc9')+_0x5e066c));}if(!_[_0x9283('0x91')](_0x5e066c,_0x4b0dd7[_0x9283('0x56')][_0x9283('0xc8')])){throw _0x588b14['status'](0x1f4)[_0x9283('0xc7')](new db[(_0x9283('0x88'))][(_0x9283('0x89'))](_0x9283('0xca')+_0x5e066c));}_0x525092[_0x4b0dd7[_0x9283('0x56')]['mapKeyOffline']]=_0x4b0dd7['body']['from'];})[_0x9283('0x1c')](function(){return db[_0x9283('0x39')][_0x9283('0x54')]({'where':{'id':_0x4b0dd7[_0x9283('0x53')]['id']},'include':[{'model':db[_0x9283('0x94')],'as':_0x9283('0x95')}]});})[_0x9283('0x1c')](handleEntityNotFound(_0x588b14,null))[_0x9283('0x1c')](function(_0x348b6d){if(_0x348b6d&&_0x348b6d['List']){_0x99fb3d=_0x348b6d;var _0x4d07de=_[_0x9283('0x9e')](_0x4b0dd7[_0x9283('0x56')],{'firstName':_0x4b0dd7[_0x9283('0x56')][_0x9283('0x93')],'phone':_0x4b0dd7[_0x9283('0x56')][_0x9283('0x93')],'ListId':_0x348b6d[_0x9283('0x8e')]});_0x4d07de[_0x4b0dd7['body']['mapKeyOffline']]=_0x4b0dd7['body']['from'];return db[_0x9283('0xa0')]['findOrCreate']({'where':_0x525092,'defaults':_0x4d07de});}})[_0x9283('0xcb')](function(_0x449619){if(_0x449619){_0x2ecd43=_0x449619;var _0x3caa13=fs['readFileSync'](path[_0x9283('0x72')](config[_0x9283('0x73')],_0x9283('0xcc')),'utf8');var _0x3bdae0=ejs[_0x9283('0xcd')](_0x3caa13,{'body':_[_0x9283('0xce')](_0x4b0dd7[_0x9283('0x56')][_0x9283('0x56')]),'bodyTitle':_0x99fb3d[_0x9283('0xcf')]});return db[_0x9283('0xd0')][_0x9283('0x55')]({'body':_0x3bdae0,'ContactId':_0x449619['id'],'ChatWebsiteId':_0x99fb3d['id']});}})[_0x9283('0x1c')](function(_0x276f58){if(_0x276f58){_0x46192c=_0x276f58;return db[_0x9283('0xd1')][_0x9283('0x5f')]({'where':{'service':!![]},'include':[{'model':db[_0x9283('0xd2')],'as':_0x9283('0xd3'),'raw':!![]}]});}})[_0x9283('0x1c')](function(_0x272942){if(_0x272942&&_0x272942[_0x9283('0xd3')]&&_0x99fb3d[_0x9283('0xd4')]){var _0x428315={'tls':{'rejectUnauthorized':![]}};if(_0x272942[_0x9283('0xd3')][_0x9283('0xd5')]){_0x428315['service']=_0x272942[_0x9283('0xd3')]['service'];}else{_0x428315['host']=_0x272942[_0x9283('0xd3')][_0x9283('0xd6')];_0x428315[_0x9283('0xd7')]=_0x272942[_0x9283('0xd3')][_0x9283('0xd7')];_0x428315[_0x9283('0xd8')]=_0x272942[_0x9283('0xd3')][_0x9283('0xd8')];}if(_0x272942[_0x9283('0xd3')][_0x9283('0xd9')]){_0x428315['auth']={'user':_0x272942[_0x9283('0xd3')][_0x9283('0x57')],'pass':_0x272942[_0x9283('0xd3')]['pass']};}return respondWithRpcPromise(_0x9283('0xda'),_0x9283('0xdb'),{'account':_0x428315,'message':{'from':util[_0x9283('0xad')](_0x9283('0xdc'),_0x272942['name'],_0x272942['email']||_0x272942['Smtp'][_0x9283('0x57')]),'to':_0x99fb3d[_0x9283('0xd4')],'subject':_0x99fb3d[_0x9283('0xdd')],'text':_0x46192c['body']}},client9003)[_0x9283('0x1c')](function(){return _0x46192c;})[_0x9283('0x52')](function(_0x14bcc2){console['error'](_0x14bcc2);});}})[_0x9283('0x1c')](function(){if(_0x46192c){return _0x46192c;}})[_0x9283('0x1c')](respondWithResult(_0x588b14,null))[_0x9283('0x52')](handleError(_0x588b14,null));};exports['addInteraction']=function(_0x38bb0b,_0x1a9d59,_0x3af3c3){return db[_0x9283('0xb5')][_0x9283('0x54')]({'where':{'id':_0x38bb0b[_0x9283('0x53')]['id']}})[_0x9283('0x1c')](handleEntityNotFound(_0x1a9d59,null))[_0x9283('0x1c')](function(_0xbf8713){if(_0xbf8713){return _0xbf8713['addInteraction'](_0x38bb0b[_0x9283('0x56')][_0x9283('0x65')],_['omit'](_0x38bb0b[_0x9283('0x56')],['ids','id'])||{});}})[_0x9283('0x1c')](respondWithResult(_0x1a9d59,null))['catch'](handleError(_0x1a9d59,null));};exports[_0x9283('0xde')]=function(_0x5c367a,_0x2197f4,_0x58c84a){var _0x3e997a={'raw':![],'where':{}};var _0x1f4e22={};var _0x42be9d={'count':0x0,'rows':[]};return db[_0x9283('0x39')][_0x9283('0x5f')]({'where':{'id':_0x5c367a[_0x9283('0x53')]['id']}})[_0x9283('0x1c')](handleEntityNotFound(_0x2197f4,null))['then'](function(_0x564870){if(_0x564870){_0x1f4e22['model']=_[_0x9283('0x3d')](db[_0x9283('0xb5')]['rawAttributes']);_0x1f4e22[_0x9283('0x3c')]=_[_0x9283('0x3d')](_0x5c367a[_0x9283('0x3c')]);_0x1f4e22[_0x9283('0x3e')]=_[_0x9283('0x3f')](_0x1f4e22['model'],_0x1f4e22[_0x9283('0x3c')]);_0x3e997a[_0x9283('0x41')]=_[_0x9283('0x3f')](_0x1f4e22[_0x9283('0x3b')],qs[_0x9283('0x40')](_0x5c367a[_0x9283('0x3c')][_0x9283('0x40')]));_0x3e997a[_0x9283('0x41')]=_0x3e997a[_0x9283('0x41')]['length']?_0x3e997a[_0x9283('0x41')]:_0x1f4e22[_0x9283('0x3b')];if(!_0x5c367a[_0x9283('0x3c')][_0x9283('0x61')](_0x9283('0x43'))){_0x3e997a['limit']=qs[_0x9283('0x2b')](_0x5c367a[_0x9283('0x3c')][_0x9283('0x2b')]);_0x3e997a[_0x9283('0x2a')]=qs[_0x9283('0x2a')](_0x5c367a[_0x9283('0x3c')][_0x9283('0x2a')]);}_0x3e997a[_0x9283('0x62')]=qs[_0x9283('0x44')](_0x5c367a[_0x9283('0x3c')]['sort']);_0x3e997a[_0x9283('0x47')]=qs[_0x9283('0x3e')](_[_0x9283('0x45')](_0x5c367a[_0x9283('0x3c')],_0x1f4e22[_0x9283('0x3e')]));_0x3e997a[_0x9283('0x47')][_0x9283('0x63')]=_0x564870['id'];if(_0x5c367a['query'][_0x9283('0x46')]){_0x3e997a[_0x9283('0x47')]=_['merge'](_0x3e997a['where'],{'$or':_['map'](_0x3e997a[_0x9283('0x41')],function(_0x1546c4){var _0x3f4873={};_0x3f4873[_0x1546c4]={'$like':'%'+_0x5c367a[_0x9283('0x3c')]['filter']+'%'};return _0x3f4873;})});}_0x3e997a=_[_0x9283('0x48')]({},_0x3e997a,_0x5c367a[_0x9283('0x4c')]);return db[_0x9283('0xb5')][_0x9283('0x4d')]({'where':_0x3e997a['where']})[_0x9283('0x1c')](function(_0x2b89dc){_0x42be9d['count']=_0x2b89dc;if(_0x5c367a[_0x9283('0x3c')][_0x9283('0x4e')]){_0x3e997a['include']=[{'model':db[_0x9283('0xa0')],'as':_0x9283('0xdf'),'required':![]},{'model':db[_0x9283('0xbe')],'as':_0x9283('0xe0'),'attributes':[_0x9283('0x35'),_0x9283('0xe1'),_0x9283('0xe2')],'required':![]},{'model':db['Tag'],'as':'Tags','attributes':['id',_0x9283('0x35'),_0x9283('0xe3')],'where':_0x5c367a[_0x9283('0x3c')][_0x9283('0xe4')]?{'id':_0x5c367a[_0x9283('0x3c')][_0x9283('0xe4')]}:undefined,'required':_0x5c367a['query'][_0x9283('0xe4')]?!![]:![]}];}return db[_0x9283('0xb5')][_0x9283('0x50')](_0x3e997a);})['then'](function(_0x48530f){_0x42be9d[_0x9283('0x51')]=_0x48530f;return _0x42be9d;});}})['then'](respondWithFilteredResult(_0x2197f4,_0x3e997a))[_0x9283('0x52')](handleError(_0x2197f4,null));};function iftimePromise(_0x2bb757,_0x25f961){return respondWithRpcPromise('Command',_0x9283('0xe5'),{'command':_0x25f961['timezone']?util[_0x9283('0xad')](_0x9283('0xe6'),_0x2bb757[_0x9283('0xe7')],_0x25f961['timezone']):util['format'](_0x9283('0xe8'),_0x2bb757[_0x9283('0xe7')])},client9002)[_0x9283('0x1c')](function(_0x462db2){var _0x720781=_0x462db2&&_0x462db2['indexOf'](_0x9283('0xe9'))>=0x0?!![]:![];logger['info'](_0x9283('0xea'),_0x25f961['id'],_0x2bb757['id'],_0x2bb757[_0x9283('0xe7')],_0x720781?_0x9283('0xeb'):_0x9283('0xec'),_0x25f961[_0x9283('0xed')]?_0x25f961[_0x9283('0xed')]:'No\x20timezone');return _0x720781;})['catch'](function(_0x4cf7d7){logger[_0x9283('0x23')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x25f961['id'],_0x2bb757['id'],_0x2bb757[_0x9283('0xe7')],util[_0x9283('0xee')](_0x4cf7d7,{'showHidden':![],'depth':null}),_0x25f961[_0x9283('0xed')]?_0x25f961[_0x9283('0xed')]:_0x9283('0xef'));return![];});}exports[_0x9283('0xe5')]=function(_0x4c931a,_0x469b9a,_0x12b5c7){var _0x4aee98=0x0;var _0x4f72e4=0x0;var _0x385c19=![];var _0x11244f;var _0x5dd440;return db[_0x9283('0x39')][_0x9283('0x54')]({'where':{'id':_0x4c931a[_0x9283('0x53')]['id']},'include':[{'model':db[_0x9283('0xf0')],'as':'Interval','include':[{'model':db[_0x9283('0xf0')],'as':_0x9283('0xf1'),'attributes':['id',_0x9283('0xe7')],'raw':!![]}]}]})[_0x9283('0x1c')](handleEntityNotFound(_0x469b9a,null))[_0x9283('0x1c')](function(_0x394996){if(_0x394996){_0x11244f=_0x394996;return _0x394996[_0x9283('0xf2')]({'raw':!![]});}})[_0x9283('0x1c')](function(_0x3bd54a){if(_0x11244f){if(_0x3bd54a){_0x5dd440=_0x3bd54a;}}return require(_0x9283('0x75'))[_0x9283('0x76')]();})[_0x9283('0x1c')](function(_0x3d1e4b){if(_0x3d1e4b){_0x4f72e4=_0x3d1e4b['virtual'];_0x385c19=_0x3d1e4b[_0x9283('0x77')];}})['then'](function(){return db[_0x9283('0xb5')][_0x9283('0x4d')]({'where':{'closed':![]}});})[_0x9283('0x1c')](function(_0x4eb4ab){_0x4aee98=_0x4eb4ab;if(_0x4f72e4&&_0x4eb4ab>_0x4f72e4){return db[_0x9283('0xf3')][_0x9283('0x5f')]({'where':{'id':0x1}})['then'](function(_0x4bde4e){if(_0x4bde4e){_0x4bde4e[_0x9283('0xf4')](_0x9283('0xf5'));}});}})[_0x9283('0x1c')](function(){if(_0x11244f[_0x9283('0xf0')]&&_0x11244f['Interval'][_0x9283('0xf1')]){var _0x5736d7=[];for(var _0xabdd2a=0x0;_0xabdd2a<_0x11244f[_0x9283('0xf0')][_0x9283('0xf1')]['length'];_0xabdd2a++){var _0xa236bd=_0x11244f[_0x9283('0xf0')]['Intervals'][_0xabdd2a]['get']({'plain':!![]});_0x5736d7[_0x9283('0xbb')](iftimePromise(_0xa236bd,_0x11244f));}return BPromise['all'](_0x5736d7)[_0x9283('0x1c')](function(_0x3a8d8e){return _[_0x9283('0xf6')](_0x3a8d8e);});}else{return!![];}})[_0x9283('0x1c')](function(_0x15881d){var _0x15f005=fs['readFileSync'](path[_0x9283('0x72')](config[_0x9283('0x73')],_0x9283('0xf7')),_0x9283('0xf8'));var _0x5a82b1={'remote':_0x11244f['remote'],'query':querystring['stringify'](_[_0x9283('0x48')](_0x11244f[_0x9283('0x58')]({'plain':!![]}),{'customerIp':_0x4c931a[_0x9283('0x85')][_0x9283('0xa5')]||_0x4c931a[_0x9283('0x85')]['x-real-ip']||_0x4c931a['connection'][_0x9283('0xf9')]||_0x4c931a['ip'],'referer':_0x4c931a[_0x9283('0x85')][_0x9283('0xaa')],'openedInteractions':_0x4aee98,'maxInteractions':_0x4f72e4,'virtual':_0x385c19[_0x9283('0xfa')],'online':_0x15881d,'custom':_0x385c19}))[_0x9283('0xfb')](/'/g,'\x5c\x27')};_0x469b9a[_0x9283('0xc7')](ejs[_0x9283('0xcd')](Mustache[_0x9283('0xcd')](_0x15f005,_0x5a82b1),{'proactiveActions':_0x5dd440,'alignment':_0x11244f[_0x9283('0xfc')],'verticalAlignment':_0x11244f[_0x9283('0xfd')]}));})[_0x9283('0x52')](handleError(_0x469b9a,null));};exports[_0x9283('0xfe')]=function(_0x1ee05b,_0x3e2073,_0x43eec3){return db[_0x9283('0x39')][_0x9283('0x5f')]({'where':{'id':_0x1ee05b['params']['id']}})[_0x9283('0x1c')](handleEntityNotFound(_0x3e2073,null))[_0x9283('0x1c')](function(_0x38654f){if(_0x38654f){return db[_0x9283('0xff')][_0x9283('0x100')](function(_0x1421f1){return db[_0x9283('0x101')][_0x9283('0x33')]({'where':{'ChatWebsiteId':_0x1ee05b[_0x9283('0x53')]['id']},'transaction':_0x1421f1})['then'](function(_0x419358){var _0x11c955=_['map'](_0x1ee05b[_0x9283('0x56')],function(_0x1c9db2){_0x1c9db2['ChatWebsiteId']=_0x1ee05b[_0x9283('0x53')]['id'];return _0x1c9db2;});return db[_0x9283('0x101')]['bulkCreate'](_0x11c955,{'transaction':_0x1421f1});});})[_0x9283('0x1c')](function(){return db[_0x9283('0x101')][_0x9283('0x102')]({'where':{'ChatWebsiteId':_0x1ee05b['params']['id']},'order':_0x9283('0x9b')});});}})['then'](respondWithResult(_0x3e2073,null))['catch'](handleError(_0x3e2073,null));};exports[_0x9283('0x103')]=function(_0x3e77c6,_0x39d3a5,_0xac3896){var _0x46fbb5={};var _0x27a42a={};var _0x30937f;var _0x406226;return db['ChatWebsite'][_0x9283('0x5f')]({'where':{'id':_0x3e77c6['params']['id']}})[_0x9283('0x1c')](handleEntityNotFound(_0x39d3a5,null))['then'](function(_0x14a841){if(_0x14a841){_0x30937f=_0x14a841;_0x27a42a[_0x9283('0x3b')]=_[_0x9283('0x3d')](db[_0x9283('0x101')][_0x9283('0x3a')]);_0x27a42a[_0x9283('0x3c')]=_[_0x9283('0x3d')](_0x3e77c6[_0x9283('0x3c')]);_0x27a42a[_0x9283('0x3e')]=_['intersection'](_0x27a42a['model'],_0x27a42a[_0x9283('0x3c')]);_0x46fbb5['attributes']=_['intersection'](_0x27a42a['model'],qs[_0x9283('0x40')](_0x3e77c6['query'][_0x9283('0x40')]));_0x46fbb5[_0x9283('0x41')]=_0x46fbb5[_0x9283('0x41')][_0x9283('0x42')]?_0x46fbb5[_0x9283('0x41')]:_0x27a42a['model'];_0x46fbb5[_0x9283('0x62')]=qs[_0x9283('0x44')](_0x3e77c6[_0x9283('0x3c')][_0x9283('0x44')]);_0x46fbb5['where']=qs[_0x9283('0x3e')](_[_0x9283('0x45')](_0x3e77c6['query'],_0x27a42a['filters']));if(_0x3e77c6[_0x9283('0x3c')]['filter']){_0x46fbb5[_0x9283('0x47')]=_['merge'](_0x46fbb5[_0x9283('0x47')],{'$or':_[_0x9283('0x69')](_0x46fbb5['attributes'],function(_0x33486a){var _0x4fdc14={};_0x4fdc14[_0x33486a]={'$like':'%'+_0x3e77c6['query'][_0x9283('0x46')]+'%'};return _0x4fdc14;})});}_0x46fbb5=_[_0x9283('0x48')]({},_0x46fbb5,_0x3e77c6[_0x9283('0x4c')]);return _0x30937f[_0x9283('0x103')](_0x46fbb5);}})[_0x9283('0x1c')](function(_0x4f2055){if(_0x4f2055){_0x406226=_0x4f2055['length'];if(!_0x3e77c6['query'][_0x9283('0x61')](_0x9283('0x43'))){_0x46fbb5['limit']=qs[_0x9283('0x2b')](_0x3e77c6[_0x9283('0x3c')][_0x9283('0x2b')]);_0x46fbb5['offset']=qs[_0x9283('0x2a')](_0x3e77c6[_0x9283('0x3c')][_0x9283('0x2a')]);}return _0x30937f[_0x9283('0x103')](_0x46fbb5);}})[_0x9283('0x1c')](function(_0x42dd4e){if(_0x42dd4e){return _0x42dd4e?{'count':_0x406226,'rows':_0x42dd4e}:null;}})[_0x9283('0x1c')](respondWithResult(_0x39d3a5,null))[_0x9283('0x52')](handleError(_0x39d3a5,null));};exports['addProactiveActions']=function(_0x198e1a,_0xe6308,_0x3fa5b4){return db[_0x9283('0x104')][_0x9283('0x54')]({'where':{'id':_0x198e1a['params']['id']}})[_0x9283('0x1c')](handleEntityNotFound(_0xe6308,null))[_0x9283('0x1c')](function(_0x4d9f0a){if(_0x4d9f0a){return _0x4d9f0a[_0x9283('0x105')](_0x198e1a[_0x9283('0x56')][_0x9283('0x65')],_[_0x9283('0x106')](_0x198e1a[_0x9283('0x56')],[_0x9283('0x65'),'id'])||{});}})[_0x9283('0x1c')](respondWithResult(_0xe6308,null))[_0x9283('0x52')](handleError(_0xe6308,null));};exports[_0x9283('0xf2')]=function(_0x1a1055,_0x596c97,_0x57fe87){var _0x4d8cc4={};var _0x3d33ab={};var _0x3d4144;var _0x4d0932;return db[_0x9283('0x39')][_0x9283('0x5f')]({'where':{'id':_0x1a1055[_0x9283('0x53')]['id']}})[_0x9283('0x1c')](handleEntityNotFound(_0x596c97,null))['then'](function(_0x308f03){if(_0x308f03){_0x3d4144=_0x308f03;_0x3d33ab[_0x9283('0x3b')]=_[_0x9283('0x3d')](db['ChatProactiveAction'][_0x9283('0x3a')]);_0x3d33ab[_0x9283('0x3c')]=_[_0x9283('0x3d')](_0x1a1055['query']);_0x3d33ab[_0x9283('0x3e')]=_['intersection'](_0x3d33ab['model'],_0x3d33ab['query']);_0x4d8cc4[_0x9283('0x41')]=_[_0x9283('0x3f')](_0x3d33ab['model'],qs[_0x9283('0x40')](_0x1a1055[_0x9283('0x3c')][_0x9283('0x40')]));_0x4d8cc4[_0x9283('0x41')]=_0x4d8cc4[_0x9283('0x41')][_0x9283('0x42')]?_0x4d8cc4[_0x9283('0x41')]:_0x3d33ab[_0x9283('0x3b')];_0x4d8cc4[_0x9283('0x62')]=qs[_0x9283('0x44')](_0x1a1055['query'][_0x9283('0x44')]);_0x4d8cc4[_0x9283('0x47')]=qs[_0x9283('0x3e')](_[_0x9283('0x45')](_0x1a1055[_0x9283('0x3c')],_0x3d33ab[_0x9283('0x3e')]));if(_0x1a1055[_0x9283('0x3c')][_0x9283('0x46')]){_0x4d8cc4[_0x9283('0x47')]=_[_0x9283('0x48')](_0x4d8cc4[_0x9283('0x47')],{'$or':_['map'](_0x4d8cc4[_0x9283('0x41')],function(_0x2aab07){var _0x12da76={};_0x12da76[_0x2aab07]={'$like':'%'+_0x1a1055[_0x9283('0x3c')]['filter']+'%'};return _0x12da76;})});}_0x4d8cc4=_[_0x9283('0x48')]({},_0x4d8cc4,_0x1a1055[_0x9283('0x4c')]);return _0x3d4144[_0x9283('0xf2')](_0x4d8cc4);}})['then'](function(_0x4af69d){if(_0x4af69d){_0x4d0932=_0x4af69d['length'];if(!_0x1a1055[_0x9283('0x3c')][_0x9283('0x61')](_0x9283('0x43'))){_0x4d8cc4[_0x9283('0x2b')]=qs[_0x9283('0x2b')](_0x1a1055[_0x9283('0x3c')]['limit']);_0x4d8cc4['offset']=qs['offset'](_0x1a1055[_0x9283('0x3c')]['offset']);}return _0x3d4144[_0x9283('0xf2')](_0x4d8cc4);}})[_0x9283('0x1c')](function(_0x33e257){if(_0x33e257){return _0x33e257?{'count':_0x4d0932,'rows':_0x33e257}:null;}})[_0x9283('0x1c')](respondWithResult(_0x596c97,null))['catch'](handleError(_0x596c97,null));};exports[_0x9283('0x107')]=function(_0x2d6fd1,_0x56b7a0,_0x145377){var _0x5eafbd=_0x2d6fd1[_0x9283('0x3c')][_0x9283('0x108')]===_0x9283('0x109')?_0x9283('0x10a'):_0x9283('0x10b');return db[_0x9283('0x39')][_0x9283('0x54')]({'attributes':['id',_0x5eafbd],'where':{'id':_0x2d6fd1['params']['id']}})[_0x9283('0x1c')](handleEntityNotFound(_0x56b7a0,null))[_0x9283('0x1c')](function(_0x550b3a){if(_0x550b3a){var _0x3aa459=_0x550b3a[_0x5eafbd];var _0x42a5f7=_0x3aa459&&_0x3aa459[_0x9283('0x10c')]?_0x3aa459['items']:[];_0x56b7a0[_0x9283('0xc7')]({'fromKey':_[_0x9283('0x78')](_0x3aa459[_0x9283('0x10d')])?undefined:_0x3aa459['fromKey'],'count':_0x42a5f7[_0x9283('0x42')],'rows':_0x42a5f7});}})[_0x9283('0x52')](handleError(_0x56b7a0,null));};exports['getOfflineMessages']=function(_0x4d7f79,_0x543201,_0x16213c){var _0x429191={'raw':!![],'where':{}};var _0x2bfe77={};var _0x11ff3a={'count':0x0,'rows':[]};return db[_0x9283('0x39')][_0x9283('0x5f')]({'where':{'id':_0x4d7f79[_0x9283('0x53')]['id']}})[_0x9283('0x1c')](handleEntityNotFound(_0x543201,null))[_0x9283('0x1c')](function(_0x21a640){if(_0x21a640){_0x2bfe77[_0x9283('0x3b')]=_['keys'](db[_0x9283('0xd0')][_0x9283('0x3a')]);_0x2bfe77[_0x9283('0x3c')]=_['keys'](_0x4d7f79[_0x9283('0x3c')]);_0x2bfe77[_0x9283('0x3e')]=_[_0x9283('0x3f')](_0x2bfe77[_0x9283('0x3b')],_0x2bfe77[_0x9283('0x3c')]);_0x429191[_0x9283('0x41')]=_[_0x9283('0x3f')](_0x2bfe77[_0x9283('0x3b')],qs[_0x9283('0x40')](_0x4d7f79[_0x9283('0x3c')][_0x9283('0x40')]));_0x429191['attributes']=_0x429191[_0x9283('0x41')][_0x9283('0x42')]?_0x429191[_0x9283('0x41')]:_0x2bfe77[_0x9283('0x3b')];if(!_0x4d7f79[_0x9283('0x3c')][_0x9283('0x61')]('nolimit')){_0x429191[_0x9283('0x2b')]=qs[_0x9283('0x2b')](_0x4d7f79[_0x9283('0x3c')][_0x9283('0x2b')]);_0x429191[_0x9283('0x2a')]=qs[_0x9283('0x2a')](_0x4d7f79[_0x9283('0x3c')][_0x9283('0x2a')]);}_0x429191[_0x9283('0x62')]=qs[_0x9283('0x44')](_0x4d7f79[_0x9283('0x3c')]['sort']);_0x429191[_0x9283('0x47')]=qs[_0x9283('0x3e')](_['pick'](_0x4d7f79[_0x9283('0x3c')],_0x2bfe77[_0x9283('0x3e')]));_0x429191['where'][_0x9283('0x63')]=_0x21a640['id'];if(_0x4d7f79[_0x9283('0x3c')][_0x9283('0x46')]){_0x429191[_0x9283('0x47')]=_[_0x9283('0x48')](_0x429191['where'],{'$or':_['map'](_0x429191[_0x9283('0x41')],function(_0x22c456){var _0x4e3d7c={};_0x4e3d7c[_0x22c456]={'$like':'%'+_0x4d7f79[_0x9283('0x3c')][_0x9283('0x46')]+'%'};return _0x4e3d7c;})});}_0x429191=_[_0x9283('0x48')]({},_0x429191,_0x4d7f79[_0x9283('0x4c')]);return db[_0x9283('0xd0')][_0x9283('0x4d')]({'where':_0x429191[_0x9283('0x47')]})[_0x9283('0x1c')](function(_0x334f73){_0x11ff3a[_0x9283('0x4d')]=_0x334f73;if(_0x4d7f79[_0x9283('0x3c')][_0x9283('0x4e')]){_0x429191[_0x9283('0x4f')]=[{'all':!![]}];}return db[_0x9283('0xd0')][_0x9283('0x50')](_0x429191);})[_0x9283('0x1c')](function(_0x5610e5){_0x11ff3a[_0x9283('0x51')]=_0x5610e5;return _0x11ff3a;});}})[_0x9283('0x1c')](respondWithFilteredResult(_0x543201,_0x429191))[_0x9283('0x52')](handleError(_0x543201,null));};exports['addAgents']=function(_0x53cf77,_0x30fc85,_0x4add6a){return db[_0x9283('0x39')][_0x9283('0x54')]({'where':{'id':_0x53cf77['params']['id']}})[_0x9283('0x1c')](handleEntityNotFound(_0x30fc85,null))[_0x9283('0x1c')](function(_0x2dd045){if(_0x2dd045){return _0x2dd045[_0x9283('0x10e')](_0x53cf77[_0x9283('0x56')]['ids'],_[_0x9283('0x106')](_0x53cf77[_0x9283('0x56')],['ids','id'])||{})[_0x9283('0xcb')](function(_0x55a7b0){for(var _0xccf42=0x0;_0xccf42<_0x53cf77[_0x9283('0x56')][_0x9283('0x65')][_0x9283('0x42')];_0xccf42+=0x1){socket[_0x9283('0x10f')](_0x9283('0x110'),{'UserId':_0x53cf77[_0x9283('0x56')][_0x9283('0x65')][_0xccf42],'ChatWebsiteId':_0x53cf77[_0x9283('0x53')]['id']});}return _0x55a7b0;});}})[_0x9283('0x1c')](respondWithResult(_0x30fc85,null))[_0x9283('0x52')](handleError(_0x30fc85,null));};exports['removeAgents']=function(_0x563274,_0x29a38c,_0x47cd79){return db[_0x9283('0x39')][_0x9283('0x54')]({'where':{'id':_0x563274[_0x9283('0x53')]['id']}})[_0x9283('0x1c')](handleEntityNotFound(_0x29a38c,null))['then'](function(_0x3cf1e5){if(_0x3cf1e5){return _0x3cf1e5[_0x9283('0x111')](_0x563274[_0x9283('0x3c')][_0x9283('0x65')])[_0x9283('0x1c')](function(){if(_[_0x9283('0x112')](_0x563274[_0x9283('0x3c')][_0x9283('0x65')])){for(var _0x51d64a=0x0;_0x51d64a<_0x563274[_0x9283('0x3c')][_0x9283('0x65')][_0x9283('0x42')];_0x51d64a+=0x1){socket[_0x9283('0x10f')](_0x9283('0x113'),{'UserId':Number(_0x563274[_0x9283('0x3c')][_0x9283('0x65')][_0x51d64a]),'ChatWebsiteId':Number(_0x563274[_0x9283('0x53')]['id'])});}}else{socket[_0x9283('0x10f')](_0x9283('0x113'),{'UserId':Number(_0x563274['query'][_0x9283('0x65')]),'ChatWebsiteId':Number(_0x563274['params']['id'])});}});}})['then'](respondWithStatusCode(_0x29a38c,null))[_0x9283('0x52')](handleError(_0x29a38c,null));};exports['getAgents']=function(_0x405c19,_0x5728a1,_0x5400ae){var _0x28f0d7={};var _0x4f35b4={};var _0x1cc164;var _0x25d618;return db[_0x9283('0x39')][_0x9283('0x5f')]({'where':{'id':_0x405c19['params']['id']}})[_0x9283('0x1c')](handleEntityNotFound(_0x5728a1,null))[_0x9283('0x1c')](function(_0x4f95be){if(_0x4f95be){_0x1cc164=_0x4f95be;_0x4f35b4[_0x9283('0x3b')]=_[_0x9283('0x3d')](db[_0x9283('0xbe')][_0x9283('0x3a')]);_0x4f35b4[_0x9283('0x3c')]=_[_0x9283('0x3d')](_0x405c19['query']);_0x4f35b4[_0x9283('0x3e')]=_[_0x9283('0x3f')](_0x4f35b4[_0x9283('0x3b')],_0x4f35b4[_0x9283('0x3c')]);_0x28f0d7[_0x9283('0x41')]=_[_0x9283('0x3f')](_0x4f35b4[_0x9283('0x3b')],qs['fields'](_0x405c19[_0x9283('0x3c')]['fields']));_0x28f0d7['attributes']=_0x28f0d7[_0x9283('0x41')]['length']?_0x28f0d7[_0x9283('0x41')]:_0x4f35b4[_0x9283('0x3b')];_0x28f0d7['order']=qs[_0x9283('0x44')](_0x405c19[_0x9283('0x3c')][_0x9283('0x44')]);_0x28f0d7[_0x9283('0x47')]=qs[_0x9283('0x3e')](_['pick'](_0x405c19['query'],_0x4f35b4[_0x9283('0x3e')]));if(_0x405c19['query'][_0x9283('0x46')]){_0x28f0d7[_0x9283('0x47')]=_['merge'](_0x28f0d7['where'],{'$or':_[_0x9283('0x69')](_0x28f0d7['attributes'],function(_0x13435c){var _0x594908={};_0x594908[_0x13435c]={'$like':'%'+_0x405c19['query'][_0x9283('0x46')]+'%'};return _0x594908;})});}_0x28f0d7=_[_0x9283('0x48')]({},_0x28f0d7,_0x405c19['options']);return _0x1cc164[_0x9283('0x114')](_0x28f0d7);}})[_0x9283('0x1c')](function(_0x56cc59){if(_0x56cc59){_0x25d618=_0x56cc59['length'];if(!_0x405c19['query'][_0x9283('0x61')]('nolimit')){_0x28f0d7[_0x9283('0x2b')]=qs[_0x9283('0x2b')](_0x405c19[_0x9283('0x3c')]['limit']);_0x28f0d7['offset']=qs[_0x9283('0x2a')](_0x405c19[_0x9283('0x3c')][_0x9283('0x2a')]);}return _0x1cc164[_0x9283('0x114')](_0x28f0d7);}})[_0x9283('0x1c')](function(_0x196a6d){if(_0x196a6d){return _0x196a6d?{'count':_0x25d618,'rows':_0x196a6d}:null;}})[_0x9283('0x1c')](respondWithResult(_0x5728a1,null))['catch'](handleError(_0x5728a1,null));}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js index 46e49c5..a268e3d 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 _0x89c7=['emit','hasOwnProperty','exports','events','../../mysqldb','ChatWebsite','setMaxListeners','update','remove'];(function(_0x4ac41d,_0x797f24){var _0x5b9770=function(_0x164fe4){while(--_0x164fe4){_0x4ac41d['push'](_0x4ac41d['shift']());}};_0x5b9770(++_0x797f24);}(_0x89c7,0x135));var _0x789c=function(_0x264d4d,_0x118fb5){_0x264d4d=_0x264d4d-0x0;var _0xc917e2=_0x89c7[_0x264d4d];return _0xc917e2;};'use strict';var EventEmitter=require(_0x789c('0x0'));var ChatWebsite=require(_0x789c('0x1'))['db'][_0x789c('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x789c('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x789c('0x4'),'afterDestroy':_0x789c('0x5')};function emitEvent(_0x49f846){return function(_0x2682e2,_0x2e085e,_0x3bcf8c){ChatWebsiteEvents[_0x789c('0x6')](_0x49f846+':'+_0x2682e2['id'],_0x2682e2);ChatWebsiteEvents['emit'](_0x49f846,_0x2682e2);_0x3bcf8c(null);};}for(var e in events){if(events[_0x789c('0x7')](e)){var event=events[e];ChatWebsite['hook'](e,emitEvent(event));}}module[_0x789c('0x8')]=ChatWebsiteEvents; \ No newline at end of file +var _0x5c4e=['events','../../mysqldb','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x974518,_0x497ecf){var _0x3221f7=function(_0x17834a){while(--_0x17834a){_0x974518['push'](_0x974518['shift']());}};_0x3221f7(++_0x497ecf);}(_0x5c4e,0xea));var _0xe5c4=function(_0x46e4e6,_0x45e2cc){_0x46e4e6=_0x46e4e6-0x0;var _0x33a6da=_0x5c4e[_0x46e4e6];return _0x33a6da;};'use strict';var EventEmitter=require(_0xe5c4('0x0'));var ChatWebsite=require(_0xe5c4('0x1'))['db']['ChatWebsite'];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xe5c4('0x2'),'afterUpdate':_0xe5c4('0x3'),'afterDestroy':_0xe5c4('0x4')};function emitEvent(_0x36d260){return function(_0xa35382,_0x22022e,_0x2d2429){ChatWebsiteEvents[_0xe5c4('0x5')](_0x36d260+':'+_0xa35382['id'],_0xa35382);ChatWebsiteEvents[_0xe5c4('0x5')](_0x36d260,_0xa35382);_0x2d2429(null);};}for(var e in events){if(events[_0xe5c4('0x6')](e)){var event=events[e];ChatWebsite[_0xe5c4('0x7')](e,emitEvent(event));}}module[_0xe5c4('0x8')]=ChatWebsiteEvents; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js index 9c5ebb6..8b38860 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 _0x6215=['lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','define','ChatWebsite','chat_websites'];(function(_0xba3578,_0xc6c0a9){var _0x488411=function(_0x588de1){while(--_0x588de1){_0xba3578['push'](_0xba3578['shift']());}};_0x488411(++_0xc6c0a9);}(_0x6215,0x198));var _0x5621=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6215[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x5621('0x0'));var util=require(_0x5621('0x1'));var logger=require(_0x5621('0x2'))('api');var moment=require(_0x5621('0x3'));var BPromise=require(_0x5621('0x4'));var rp=require(_0x5621('0x5'));var fs=require('fs');var path=require(_0x5621('0x6'));var rimraf=require(_0x5621('0x7'));var config=require(_0x5621('0x8'));var attributes=require('./chatWebsite.attributes');module['exports']=function(_0x52f3c6,_0x5ae3af){return _0x52f3c6[_0x5621('0x9')](_0x5621('0xa'),attributes,{'tableName':_0x5621('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc2da=['exports','define','ChatWebsite','chat_websites','lodash','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./chatWebsite.attributes'];(function(_0x1187b2,_0x56f2bf){var _0x20c567=function(_0x5d9f8c){while(--_0x5d9f8c){_0x1187b2['push'](_0x1187b2['shift']());}};_0x20c567(++_0x56f2bf);}(_0xc2da,0x124));var _0xac2d=function(_0xb99421,_0xaab133){_0xb99421=_0xb99421-0x0;var _0x4b3ec7=_0xc2da[_0xb99421];return _0x4b3ec7;};'use strict';var _=require(_0xac2d('0x0'));var util=require('util');var logger=require(_0xac2d('0x1'))('api');var moment=require(_0xac2d('0x2'));var BPromise=require('bluebird');var rp=require(_0xac2d('0x3'));var fs=require('fs');var path=require(_0xac2d('0x4'));var rimraf=require(_0xac2d('0x5'));var config=require(_0xac2d('0x6'));var attributes=require(_0xac2d('0x7'));module[_0xac2d('0x8')]=function(_0x3db400,_0x133e22){return _0x3db400[_0xac2d('0x9')](_0xac2d('0xa'),attributes,{'tableName':_0xac2d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.rpc.js b/server/api/chatWebsite/chatWebsite.rpc.js index c5972c0..e6dc82b 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 _0xd943=['util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','redis','localhost','./chatWebsite.socket','register','request','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash'];(function(_0x59ffbb,_0x2e6896){var _0x479c56=function(_0x2f7ce5){while(--_0x2f7ce5){_0x59ffbb['push'](_0x59ffbb['shift']());}};_0x479c56(++_0x2e6896);}(_0xd943,0x15d));var _0x3d94=function(_0x3c4202,_0x1fbcf3){_0x3c4202=_0x3c4202-0x0;var _0x157707=_0xd943[_0x3c4202];return _0x157707;};'use strict';var _=require(_0x3d94('0x0'));var util=require(_0x3d94('0x1'));var moment=require(_0x3d94('0x2'));var BPromise=require(_0x3d94('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3d94('0x4'));var db=require(_0x3d94('0x5'))['db'];var utils=require(_0x3d94('0x6'));var logger=require(_0x3d94('0x7'))(_0x3d94('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x3d94('0x9')]['http']({'port':0x232a});config['redis']=_['defaults'](config[_0x3d94('0xa')],{'host':_0x3d94('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x3d94('0xc'))[_0x3d94('0xd')](socket);function respondWithRpcPromise(_0x1cc58c,_0x5908a7,_0x182066){return new BPromise(function(_0x4ac968,_0x39e2fa){return client[_0x3d94('0xe')](_0x1cc58c,_0x182066)['then'](function(_0x1897de){logger[_0x3d94('0xf')](_0x3d94('0x10'),_0x5908a7,_0x3d94('0x11'));logger[_0x3d94('0x12')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x5908a7,_0x3d94('0x11'),JSON[_0x3d94('0x13')](_0x1897de));if(_0x1897de[_0x3d94('0x14')]){if(_0x1897de['error'][_0x3d94('0x15')]===0x1f4){logger[_0x3d94('0x14')](_0x3d94('0x10'),_0x5908a7,_0x1897de['error'][_0x3d94('0x16')]);return _0x39e2fa(_0x1897de[_0x3d94('0x14')][_0x3d94('0x16')]);}logger[_0x3d94('0x14')](_0x3d94('0x10'),_0x5908a7,_0x1897de[_0x3d94('0x14')][_0x3d94('0x16')]);return _0x4ac968(_0x1897de[_0x3d94('0x14')]['message']);}else{logger[_0x3d94('0xf')](_0x3d94('0x10'),_0x5908a7,_0x3d94('0x11'));_0x4ac968(_0x1897de[_0x3d94('0x17')][_0x3d94('0x16')]);}})[_0x3d94('0x18')](function(_0xef8b3){logger['error'](_0x3d94('0x10'),_0x5908a7,_0xef8b3);_0x39e2fa(_0xef8b3);});});} \ No newline at end of file +var _0x8952=['jayson/promise','client','http','redis','localhost','socket.io-emitter','./chatWebsite.socket','then','info','request\x20sent','debug','stringify','code','error','message','ChatWebsite,\x20%s,\x20%s','result','catch','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x48999d,_0x1e02cb){var _0x1ad0d1=function(_0x3f974e){while(--_0x3f974e){_0x48999d['push'](_0x48999d['shift']());}};_0x1ad0d1(++_0x1e02cb);}(_0x8952,0x17e));var _0x2895=function(_0xae57ae,_0x51d19b){_0xae57ae=_0xae57ae-0x0;var _0x2325fb=_0x8952[_0xae57ae];return _0x2325fb;};'use strict';var _=require('lodash');var util=require(_0x2895('0x0'));var moment=require(_0x2895('0x1'));var BPromise=require(_0x2895('0x2'));var rs=require(_0x2895('0x3'));var fs=require('fs');var Redis=require(_0x2895('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x2895('0x5'));var logger=require(_0x2895('0x6'))(_0x2895('0x7'));var config=require('../../config/environment');var jayson=require(_0x2895('0x8'));var client=jayson[_0x2895('0x9')][_0x2895('0xa')]({'port':0x232a});config['redis']=_['defaults'](config[_0x2895('0xb')],{'host':_0x2895('0xc'),'port':0x18eb});var socket=require(_0x2895('0xd'))(new Redis(config[_0x2895('0xb')]));require(_0x2895('0xe'))['register'](socket);function respondWithRpcPromise(_0x14fb67,_0x5f2632,_0x428772){return new BPromise(function(_0x5af454,_0x5e66fc){return client['request'](_0x14fb67,_0x428772)[_0x2895('0xf')](function(_0x1829a2){logger[_0x2895('0x10')]('ChatWebsite,\x20%s,\x20%s',_0x5f2632,_0x2895('0x11'));logger[_0x2895('0x12')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x5f2632,_0x2895('0x11'),JSON[_0x2895('0x13')](_0x1829a2));if(_0x1829a2['error']){if(_0x1829a2['error'][_0x2895('0x14')]===0x1f4){logger[_0x2895('0x15')]('ChatWebsite,\x20%s,\x20%s',_0x5f2632,_0x1829a2[_0x2895('0x15')][_0x2895('0x16')]);return _0x5e66fc(_0x1829a2[_0x2895('0x15')][_0x2895('0x16')]);}logger[_0x2895('0x15')](_0x2895('0x17'),_0x5f2632,_0x1829a2[_0x2895('0x15')][_0x2895('0x16')]);return _0x5af454(_0x1829a2[_0x2895('0x15')][_0x2895('0x16')]);}else{logger[_0x2895('0x10')](_0x2895('0x17'),_0x5f2632,_0x2895('0x11'));_0x5af454(_0x1829a2[_0x2895('0x18')][_0x2895('0x16')]);}})[_0x2895('0x19')](function(_0x2fe8fe){logger[_0x2895('0x15')]('ChatWebsite,\x20%s,\x20%s',_0x5f2632,_0x2fe8fe);_0x5e66fc(_0x2fe8fe);});});} \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js index d961824..78283b1 100644 --- a/server/api/chatWebsite/chatWebsite.socket.js +++ b/server/api/chatWebsite/chatWebsite.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5f2f=['remove','update','emit','removeListener','register','length','chatWebsite:','./chatWebsite.events','save'];(function(_0x5694d3,_0x2e3008){var _0x1ca96e=function(_0x33a079){while(--_0x33a079){_0x5694d3['push'](_0x5694d3['shift']());}};_0x1ca96e(++_0x2e3008);}(_0x5f2f,0x73));var _0xf5f2=function(_0x18f5a1,_0x15d109){_0x18f5a1=_0x18f5a1-0x0;var _0x564804=_0x5f2f[_0x18f5a1];return _0x564804;};'use strict';var ChatWebsiteEvents=require(_0xf5f2('0x0'));var events=[_0xf5f2('0x1'),_0xf5f2('0x2'),_0xf5f2('0x3')];function createListener(_0x1172dd,_0x174bc7){return function(_0x3c72ee){_0x174bc7[_0xf5f2('0x4')](_0x1172dd,_0x3c72ee);};}function removeListener(_0x501fbd,_0x4854b6){return function(){ChatWebsiteEvents[_0xf5f2('0x5')](_0x501fbd,_0x4854b6);};}exports[_0xf5f2('0x6')]=function(_0xad7f65){for(var _0x3eebf6=0x0,_0x3133bc=events[_0xf5f2('0x7')];_0x3eebf6<_0x3133bc;_0x3eebf6++){var _0x5907aa=events[_0x3eebf6];var _0x466882=createListener(_0xf5f2('0x8')+_0x5907aa,_0xad7f65);ChatWebsiteEvents['on'](_0x5907aa,_0x466882);}}; \ No newline at end of file +var _0x5f2f=['remove','update','emit','removeListener','register','length','chatWebsite:','./chatWebsite.events','save'];(function(_0x29d6f1,_0x4465c0){var _0x3cd8b8=function(_0x4b8069){while(--_0x4b8069){_0x29d6f1['push'](_0x29d6f1['shift']());}};_0x3cd8b8(++_0x4465c0);}(_0x5f2f,0x73));var _0xf5f2=function(_0xb59a47,_0x3702d1){_0xb59a47=_0xb59a47-0x0;var _0x5057d4=_0x5f2f[_0xb59a47];return _0x5057d4;};'use strict';var ChatWebsiteEvents=require(_0xf5f2('0x0'));var events=[_0xf5f2('0x1'),_0xf5f2('0x2'),_0xf5f2('0x3')];function createListener(_0x1172dd,_0x174bc7){return function(_0x3c72ee){_0x174bc7[_0xf5f2('0x4')](_0x1172dd,_0x3c72ee);};}function removeListener(_0x501fbd,_0x4854b6){return function(){ChatWebsiteEvents[_0xf5f2('0x5')](_0x501fbd,_0x4854b6);};}exports[_0xf5f2('0x6')]=function(_0xad7f65){for(var _0x3eebf6=0x0,_0x3133bc=events[_0xf5f2('0x7')];_0x3eebf6<_0x3133bc;_0x3eebf6++){var _0x5907aa=events[_0x3eebf6];var _0x466882=createListener(_0xf5f2('0x8')+_0x5907aa,_0xad7f65);ChatWebsiteEvents['on'](_0x5907aa,_0x466882);}}; \ No newline at end of file diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js index a0264ad..3b6d604 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 _0x35ea=['/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','getLogo','getAvatar','getCustomerAvatar','getSystemAvatar','/:id/interactions','getSnippet','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','getAgents','post','addDisposition','addAnswer','join','root','server/files/images/logos/','format','%s-%s','now','originalname','single','file','addLogo','diskStorage','server/files/images/avatars/','/:id/avatar','addAvatar','/:id/customer_avatar','addCustomerAvatar','/:id/system_avatar','addSystemAvatar','/:id/notify','notify','offline','addInteraction','addApplications','/:id/users','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','/:id'];(function(_0x39596d,_0x302824){var _0x55f3cc=function(_0x4e0d41){while(--_0x4e0d41){_0x39596d['push'](_0x39596d['shift']());}};_0x55f3cc(++_0x302824);}(_0x35ea,0x185));var _0xa35e=function(_0x2e752b,_0x5cb17d){_0x2e752b=_0x2e752b-0x0;var _0x40a0b4=_0x35ea[_0x2e752b];return _0x40a0b4;};'use strict';var multer=require(_0xa35e('0x0'));var util=require(_0xa35e('0x1'));var path=require(_0xa35e('0x2'));var timeout=require(_0xa35e('0x3'));var express=require(_0xa35e('0x4'));var router=express[_0xa35e('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0xa35e('0x6'));var config=require(_0xa35e('0x7'));var controller=require('./chatWebsite.controller');router[_0xa35e('0x8')]('/',auth[_0xa35e('0x9')](),controller[_0xa35e('0xa')]);router['get'](_0xa35e('0xb'),auth[_0xa35e('0x9')](),controller['describe']);router[_0xa35e('0x8')](_0xa35e('0xc'),auth[_0xa35e('0x9')](),controller['show']);router[_0xa35e('0x8')](_0xa35e('0xd'),auth[_0xa35e('0x9')](),controller[_0xa35e('0xe')]);router[_0xa35e('0x8')](_0xa35e('0xf'),auth[_0xa35e('0x9')](),controller[_0xa35e('0x10')]);router['get'](_0xa35e('0x11'),controller[_0xa35e('0x12')]);router[_0xa35e('0x8')]('/:id/avatar',controller[_0xa35e('0x13')]);router[_0xa35e('0x8')]('/:id/customer_avatar',controller[_0xa35e('0x14')]);router[_0xa35e('0x8')]('/:id/system_avatar',controller[_0xa35e('0x15')]);router[_0xa35e('0x8')](_0xa35e('0x16'),auth[_0xa35e('0x9')](),controller['getInteractions']);router[_0xa35e('0x8')]('/:id/snippet',controller[_0xa35e('0x17')]);router['get'](_0xa35e('0x18'),auth['isAuthenticated'](),controller[_0xa35e('0x19')]);router[_0xa35e('0x8')](_0xa35e('0x1a'),auth[_0xa35e('0x9')](),controller[_0xa35e('0x1b')]);router[_0xa35e('0x8')](_0xa35e('0x1c'),controller[_0xa35e('0x1d')]);router[_0xa35e('0x8')](_0xa35e('0x1e'),auth[_0xa35e('0x9')](),controller[_0xa35e('0x1f')]);router[_0xa35e('0x8')]('/:id/users',auth[_0xa35e('0x9')](),controller[_0xa35e('0x20')]);router[_0xa35e('0x21')]('/',auth[_0xa35e('0x9')](),controller['create']);router['post'](_0xa35e('0xd'),auth[_0xa35e('0x9')](),controller[_0xa35e('0x22')]);router['post'](_0xa35e('0xf'),auth[_0xa35e('0x9')](),controller[_0xa35e('0x23')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x2655f7,_0x903d5e,_0x2e9ee2){_0x2e9ee2(null,path[_0xa35e('0x24')](config[_0xa35e('0x25')],_0xa35e('0x26')));},'filename':function(_0x310b24,_0x4a2c77,_0x1871db){_0x1871db(null,util[_0xa35e('0x27')](_0xa35e('0x28'),Date[_0xa35e('0x29')](),_0x4a2c77[_0xa35e('0x2a')]));}})});router['post'](_0xa35e('0x11'),upload[_0xa35e('0x2b')](_0xa35e('0x2c')),controller[_0xa35e('0x2d')]);var upload=multer({'storage':multer[_0xa35e('0x2e')]({'destination':function(_0x5c1111,_0x46a7f4,_0x12aad5){_0x12aad5(null,path[_0xa35e('0x24')](config[_0xa35e('0x25')],_0xa35e('0x2f')));},'filename':function(_0x429680,_0x3918ba,_0x1d9bc7){_0x1d9bc7(null,util[_0xa35e('0x27')](_0xa35e('0x28'),Date[_0xa35e('0x29')](),_0x3918ba[_0xa35e('0x2a')]));}})});router[_0xa35e('0x21')](_0xa35e('0x30'),upload[_0xa35e('0x2b')]('file'),controller[_0xa35e('0x31')]);var upload=multer({'storage':multer[_0xa35e('0x2e')]({'destination':function(_0x5c7979,_0x4bfd70,_0x277032){_0x277032(null,path[_0xa35e('0x24')](config[_0xa35e('0x25')],'server/files/images/avatars/'));},'filename':function(_0x360eb8,_0xf8dd11,_0x76a107){_0x76a107(null,util['format'](_0xa35e('0x28'),Date[_0xa35e('0x29')](),_0xf8dd11[_0xa35e('0x2a')]));}})});router[_0xa35e('0x21')](_0xa35e('0x32'),upload[_0xa35e('0x2b')]('file'),controller[_0xa35e('0x33')]);var upload=multer({'storage':multer[_0xa35e('0x2e')]({'destination':function(_0x1a5f17,_0x25646d,_0x52be19){_0x52be19(null,path['join'](config[_0xa35e('0x25')],_0xa35e('0x2f')));},'filename':function(_0x1a2591,_0xc5b95f,_0x5c6958){_0x5c6958(null,util['format'](_0xa35e('0x28'),Date[_0xa35e('0x29')](),_0xc5b95f['originalname']));}})});router[_0xa35e('0x21')](_0xa35e('0x34'),upload[_0xa35e('0x2b')]('file'),controller[_0xa35e('0x35')]);router[_0xa35e('0x21')](_0xa35e('0x36'),controller[_0xa35e('0x37')]);router['post']('/:id/offline',controller[_0xa35e('0x38')]);router['post'](_0xa35e('0x16'),auth[_0xa35e('0x9')](),controller[_0xa35e('0x39')]);router['post'](_0xa35e('0x18'),auth[_0xa35e('0x9')](),controller[_0xa35e('0x3a')]);router[_0xa35e('0x21')](_0xa35e('0x1a'),auth[_0xa35e('0x9')](),controller['addProactiveActions']);router[_0xa35e('0x21')](_0xa35e('0x3b'),auth['isAuthenticated'](),controller['addAgents']);router['put'](_0xa35e('0xc'),auth[_0xa35e('0x9')](),controller[_0xa35e('0x3c')]);router[_0xa35e('0x3d')](_0xa35e('0xc'),auth[_0xa35e('0x9')](),controller[_0xa35e('0x3e')]);router['delete'](_0xa35e('0xd'),auth[_0xa35e('0x9')](),controller[_0xa35e('0x3f')]);router[_0xa35e('0x3d')](_0xa35e('0xf'),auth['isAuthenticated'](),controller[_0xa35e('0x40')]);router[_0xa35e('0x3d')](_0xa35e('0x3b'),auth['isAuthenticated'](),controller[_0xa35e('0x41')]);module[_0xa35e('0x42')]=router; \ No newline at end of file +var _0x60c7=['join','root','server/files/images/logos/','format','%s-%s','now','file','addLogo','server/files/images/avatars/','originalname','single','addAvatar','addCustomerAvatar','/:id/system_avatar','/:id/notify','offline','/:id/interactions','addInteraction','addApplications','addProactiveActions','put','update','delete','removeDispositions','removeAgents','multer','util','Router','../../components/auth/service','../../components/interaction/service','./chatWebsite.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','/:id/canned_answers','getAnswers','/:id/logo','getLogo','getAvatar','/:id/customer_avatar','getCustomerAvatar','getSystemAvatar','getInteractions','/:id/snippet','getSnippet','/:id/applications','getApplications','/:id/proactive_actions','/:id/fields','getOfflineMessages','/:id/users','getAgents','post','create','addAnswer','diskStorage'];(function(_0x264545,_0x214037){var _0x114d10=function(_0x9e3461){while(--_0x9e3461){_0x264545['push'](_0x264545['shift']());}};_0x114d10(++_0x214037);}(_0x60c7,0xd0));var _0x760c=function(_0x7b33ae,_0x3a1ef5){_0x7b33ae=_0x7b33ae-0x0;var _0x58f2d3=_0x60c7[_0x7b33ae];return _0x58f2d3;};'use strict';var multer=require(_0x760c('0x0'));var util=require(_0x760c('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x760c('0x2')]();var auth=require(_0x760c('0x3'));var interaction=require(_0x760c('0x4'));var config=require('../../config/environment');var controller=require(_0x760c('0x5'));router[_0x760c('0x6')]('/',auth[_0x760c('0x7')](),controller[_0x760c('0x8')]);router[_0x760c('0x6')](_0x760c('0x9'),auth['isAuthenticated'](),controller[_0x760c('0xa')]);router[_0x760c('0x6')](_0x760c('0xb'),auth['isAuthenticated'](),controller[_0x760c('0xc')]);router[_0x760c('0x6')](_0x760c('0xd'),auth[_0x760c('0x7')](),controller['getDispositions']);router[_0x760c('0x6')](_0x760c('0xe'),auth[_0x760c('0x7')](),controller[_0x760c('0xf')]);router['get'](_0x760c('0x10'),controller[_0x760c('0x11')]);router[_0x760c('0x6')]('/:id/avatar',controller[_0x760c('0x12')]);router[_0x760c('0x6')](_0x760c('0x13'),controller[_0x760c('0x14')]);router[_0x760c('0x6')]('/:id/system_avatar',controller[_0x760c('0x15')]);router[_0x760c('0x6')]('/:id/interactions',auth['isAuthenticated'](),controller[_0x760c('0x16')]);router[_0x760c('0x6')](_0x760c('0x17'),controller[_0x760c('0x18')]);router[_0x760c('0x6')](_0x760c('0x19'),auth['isAuthenticated'](),controller[_0x760c('0x1a')]);router[_0x760c('0x6')](_0x760c('0x1b'),auth[_0x760c('0x7')](),controller['getProactiveActions']);router[_0x760c('0x6')](_0x760c('0x1c'),controller['getFields']);router['get']('/:id/offline_messages',auth[_0x760c('0x7')](),controller[_0x760c('0x1d')]);router['get'](_0x760c('0x1e'),auth[_0x760c('0x7')](),controller[_0x760c('0x1f')]);router[_0x760c('0x20')]('/',auth[_0x760c('0x7')](),controller[_0x760c('0x21')]);router[_0x760c('0x20')]('/:id/dispositions',auth[_0x760c('0x7')](),controller['addDisposition']);router['post'](_0x760c('0xe'),auth[_0x760c('0x7')](),controller[_0x760c('0x22')]);var upload=multer({'storage':multer[_0x760c('0x23')]({'destination':function(_0x35463b,_0x2c9433,_0x2448d5){_0x2448d5(null,path[_0x760c('0x24')](config[_0x760c('0x25')],_0x760c('0x26')));},'filename':function(_0x1a260a,_0x19fd98,_0x1c2f5d){_0x1c2f5d(null,util[_0x760c('0x27')](_0x760c('0x28'),Date[_0x760c('0x29')](),_0x19fd98['originalname']));}})});router['post'](_0x760c('0x10'),upload['single'](_0x760c('0x2a')),controller[_0x760c('0x2b')]);var upload=multer({'storage':multer[_0x760c('0x23')]({'destination':function(_0x4593cf,_0xff9a79,_0x2bc1a4){_0x2bc1a4(null,path[_0x760c('0x24')](config[_0x760c('0x25')],_0x760c('0x2c')));},'filename':function(_0xd0238f,_0x345538,_0x16ef0e){_0x16ef0e(null,util[_0x760c('0x27')](_0x760c('0x28'),Date['now'](),_0x345538[_0x760c('0x2d')]));}})});router['post']('/:id/avatar',upload[_0x760c('0x2e')](_0x760c('0x2a')),controller[_0x760c('0x2f')]);var upload=multer({'storage':multer[_0x760c('0x23')]({'destination':function(_0x1bca0c,_0x420725,_0x26334f){_0x26334f(null,path[_0x760c('0x24')](config[_0x760c('0x25')],_0x760c('0x2c')));},'filename':function(_0x9434bd,_0x1cdbde,_0x5618c6){_0x5618c6(null,util['format'](_0x760c('0x28'),Date[_0x760c('0x29')](),_0x1cdbde['originalname']));}})});router[_0x760c('0x20')](_0x760c('0x13'),upload[_0x760c('0x2e')]('file'),controller[_0x760c('0x30')]);var upload=multer({'storage':multer[_0x760c('0x23')]({'destination':function(_0x43796f,_0x12953f,_0x3d5ad5){_0x3d5ad5(null,path[_0x760c('0x24')](config[_0x760c('0x25')],'server/files/images/avatars/'));},'filename':function(_0x139c3c,_0x125303,_0x25ecc0){_0x25ecc0(null,util['format']('%s-%s',Date[_0x760c('0x29')](),_0x125303['originalname']));}})});router[_0x760c('0x20')](_0x760c('0x31'),upload[_0x760c('0x2e')](_0x760c('0x2a')),controller['addSystemAvatar']);router[_0x760c('0x20')](_0x760c('0x32'),controller['notify']);router[_0x760c('0x20')]('/:id/offline',controller[_0x760c('0x33')]);router[_0x760c('0x20')](_0x760c('0x34'),auth['isAuthenticated'](),controller[_0x760c('0x35')]);router[_0x760c('0x20')](_0x760c('0x19'),auth[_0x760c('0x7')](),controller[_0x760c('0x36')]);router[_0x760c('0x20')](_0x760c('0x1b'),auth[_0x760c('0x7')](),controller[_0x760c('0x37')]);router[_0x760c('0x20')](_0x760c('0x1e'),auth[_0x760c('0x7')](),controller['addAgents']);router[_0x760c('0x38')](_0x760c('0xb'),auth['isAuthenticated'](),controller[_0x760c('0x39')]);router[_0x760c('0x3a')](_0x760c('0xb'),auth[_0x760c('0x7')](),controller['destroy']);router[_0x760c('0x3a')](_0x760c('0xd'),auth[_0x760c('0x7')](),controller[_0x760c('0x3b')]);router['delete'](_0x760c('0xe'),auth[_0x760c('0x7')](),controller['removeAnswers']);router[_0x760c('0x3a')]('/:id/users',auth[_0x760c('0x7')](),controller[_0x760c('0x3c')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js index f7ad91b..d87e897 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 _0x6e29=['name','STRING','exports'];(function(_0x3113ea,_0x34708b){var _0x3d5310=function(_0x4b886d){while(--_0x4b886d){_0x3113ea['push'](_0x3113ea['shift']());}};_0x3d5310(++_0x34708b);}(_0x6e29,0x140));var _0x96e2=function(_0x5784cb,_0x3e380c){_0x5784cb=_0x5784cb-0x0;var _0x3626a7=_0x6e29[_0x5784cb];return _0x3626a7;};'use strict';var Sequelize=require('sequelize');module[_0x96e2('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0x96e2('0x1'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x96e2('0x2')]},'companyId':{'type':Sequelize['STRING']},'website':{'type':Sequelize[_0x96e2('0x2')]},'phone':{'type':Sequelize[_0x96e2('0x2')]},'fax':{'type':Sequelize[_0x96e2('0x2')]},'type':{'type':Sequelize[_0x96e2('0x2')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0x96e2('0x2')]},'city':{'type':Sequelize[_0x96e2('0x2')]},'country':{'type':Sequelize[_0x96e2('0x2')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x96e2('0x2')]},'sStreet':{'type':Sequelize[_0x96e2('0x2')]},'sPostalCode':{'type':Sequelize[_0x96e2('0x2')]},'sCity':{'type':Sequelize[_0x96e2('0x2')]},'sCountry':{'type':Sequelize[_0x96e2('0x2')]},'description':{'type':Sequelize[_0x96e2('0x2')]}}; \ No newline at end of file +var _0x0c3f=['STRING','sequelize'];(function(_0x368bba,_0x1f625b){var _0x409f8f=function(_0x463373){while(--_0x463373){_0x368bba['push'](_0x368bba['shift']());}};_0x409f8f(++_0x1f625b);}(_0x0c3f,0x1cb));var _0xf0c3=function(_0x2eebeb,_0x256ae8){_0x2eebeb=_0x2eebeb-0x0;var _0x19f428=_0x0c3f[_0x2eebeb];return _0x19f428;};'use strict';var Sequelize=require(_0xf0c3('0x0'));module['exports']={'name':{'type':Sequelize[_0xf0c3('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xf0c3('0x1')]},'companyId':{'type':Sequelize[_0xf0c3('0x1')]},'website':{'type':Sequelize[_0xf0c3('0x1')]},'phone':{'type':Sequelize['STRING']},'fax':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xf0c3('0x1')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0xf0c3('0x1')]},'city':{'type':Sequelize[_0xf0c3('0x1')]},'country':{'type':Sequelize[_0xf0c3('0x1')]},'email':{'type':Sequelize[_0xf0c3('0x1')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0xf0c3('0x1')]},'sStreet':{'type':Sequelize[_0xf0c3('0x1')]},'sPostalCode':{'type':Sequelize[_0xf0c3('0x1')]},'sCity':{'type':Sequelize[_0xf0c3('0x1')]},'sCountry':{'type':Sequelize[_0xf0c3('0x1')]},'description':{'type':Sequelize[_0xf0c3('0x1')]}}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js index 5a14235..8c17418 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 _0xe7ea=['squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus','status','end','json','offset','limit','set','apply','reject','save','update','then','destroy','get','Companies','stack','name','send','index','CmCompany','describe','model','query','keys','filters','intersection','attributes','fields','length','order','sort','pick','filter','where','merge','map','options','count','includeAll','include','findAll','rows','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addContacts','CmContact','omit','findOne','rawAttributes','getContacts','hasOwnProperty','nolimit','html-pdf','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','ejs','lodash'];(function(_0x5d1b80,_0x3725d){var _0x32ba6b=function(_0x135def){while(--_0x135def){_0x5d1b80['push'](_0x5d1b80['shift']());}};_0x32ba6b(++_0x3725d);}(_0xe7ea,0x151));var _0xae7e=function(_0x398841,_0xfa02fe){_0x398841=_0x398841-0x0;var _0x171adc=_0xe7ea[_0x398841];return _0x171adc;};'use strict';var pdf=require(_0xae7e('0x0'));var emlformat=require(_0xae7e('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xae7e('0x2'));var jsonpatch=require(_0xae7e('0x3'));var rp=require('request-promise');var moment=require(_0xae7e('0x4'));var BPromise=require(_0xae7e('0x5'));var Mustache=require(_0xae7e('0x6'));var util=require(_0xae7e('0x7'));var path=require(_0xae7e('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xae7e('0x9'));var fs=require('fs');var _=require(_0xae7e('0xa'));var squel=require(_0xae7e('0xb'));var crypto=require(_0xae7e('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xae7e('0xd'));var toCsv=require(_0xae7e('0xe'));var querystring=require(_0xae7e('0xf'));var Papa=require(_0xae7e('0x10'));var Redis=require(_0xae7e('0x11'));var authService=require(_0xae7e('0x12'));var qs=require(_0xae7e('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xae7e('0x14'));var logger=require(_0xae7e('0x15'))(_0xae7e('0x16'));var utils=require('../../config/utils');var config=require(_0xae7e('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x68fc00,_0x2c7d26){_0x2c7d26=_0x2c7d26||0xcc;return function(_0x13b715){if(_0x13b715){return _0x68fc00[_0xae7e('0x18')](_0x2c7d26);}return _0x68fc00[_0xae7e('0x19')](_0x2c7d26)[_0xae7e('0x1a')]();};}function respondWithResult(_0x1019f0,_0x142950){_0x142950=_0x142950||0xc8;return function(_0x4a2e0d){if(_0x4a2e0d){return _0x1019f0['status'](_0x142950)[_0xae7e('0x1b')](_0x4a2e0d);}};}function respondWithFilteredResult(_0x36cd84,_0x566209){return function(_0x1304e7){if(_0x1304e7){var _0x2bd691=_0x1304e7['count'],_0x56503a=_0x566209[_0xae7e('0x1c')],_0x9fff17=_0x566209[_0xae7e('0x1c')]+_0x566209[_0xae7e('0x1d')],_0x458134;if(_0x9fff17>=_0x2bd691){_0x9fff17=_0x2bd691;_0x458134=0xc8;}else{_0x458134=0xce;}_0x36cd84[_0xae7e('0x19')](_0x458134);return _0x36cd84[_0xae7e('0x1e')]('Content-Range',_0x56503a+'-'+_0x9fff17+'/'+_0x2bd691)['json'](_0x1304e7);}return null;};}function patchUpdates(_0x42a3b0){return function(_0x16b997){try{jsonpatch[_0xae7e('0x1f')](_0x16b997,_0x42a3b0,!![]);}catch(_0x577e74){return BPromise[_0xae7e('0x20')](_0x577e74);}return _0x16b997[_0xae7e('0x21')]();};}function saveUpdates(_0x1c3285,_0x56933d){return function(_0x232cb0){if(_0x232cb0){return _0x232cb0[_0xae7e('0x22')](_0x1c3285)[_0xae7e('0x23')](function(_0x221854){return _0x221854;});}return null;};}function removeEntity(_0x1a9d4,_0x1a4a35){return function(_0x2d6ce4){if(_0x2d6ce4){return _0x2d6ce4[_0xae7e('0x24')]()['then'](function(){var _0xfe36b8=_0x2d6ce4[_0xae7e('0x25')]({'plain':!![]});var _0x4dc5d9=_0xae7e('0x26');return db['UserProfileResource'][_0xae7e('0x24')]({'where':{'type':_0x4dc5d9,'resourceId':_0xfe36b8['id']}})[_0xae7e('0x23')](function(){return _0x2d6ce4;});})[_0xae7e('0x23')](function(){_0x1a9d4[_0xae7e('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x566dbd,_0x1dbe83){return function(_0xdaedd2){if(!_0xdaedd2){_0x566dbd['sendStatus'](0x194);}return _0xdaedd2;};}function handleError(_0x44266e,_0x1811e8){_0x1811e8=_0x1811e8||0x1f4;return function(_0x88f628){logger['error'](_0x88f628[_0xae7e('0x27')]);if(_0x88f628['name']){delete _0x88f628[_0xae7e('0x28')];}_0x44266e[_0xae7e('0x19')](_0x1811e8)[_0xae7e('0x29')](_0x88f628);};}exports[_0xae7e('0x2a')]=function(_0x1688cf,_0x1adc35){var _0xf864db={},_0x7bc690={},_0x3fa488={'count':0x0,'rows':[]};return db[_0xae7e('0x2b')][_0xae7e('0x2c')]()[_0xae7e('0x23')](function(_0x5bd1fd){_0x7bc690[_0xae7e('0x2d')]=_['keys'](_0x5bd1fd);_0x7bc690[_0xae7e('0x2e')]=_[_0xae7e('0x2f')](_0x1688cf[_0xae7e('0x2e')]);_0x7bc690[_0xae7e('0x30')]=_[_0xae7e('0x31')](_0x7bc690['model'],_0x7bc690[_0xae7e('0x2e')]);_0xf864db[_0xae7e('0x32')]=_[_0xae7e('0x31')](_0x7bc690[_0xae7e('0x2d')],qs[_0xae7e('0x33')](_0x1688cf[_0xae7e('0x2e')][_0xae7e('0x33')]));_0xf864db[_0xae7e('0x32')]=_0xf864db[_0xae7e('0x32')][_0xae7e('0x34')]?_0xf864db[_0xae7e('0x32')]:_0x7bc690['model'];if(!_0x1688cf['query']['hasOwnProperty']('nolimit')){_0xf864db['limit']=qs['limit'](_0x1688cf[_0xae7e('0x2e')][_0xae7e('0x1d')]);_0xf864db[_0xae7e('0x1c')]=qs[_0xae7e('0x1c')](_0x1688cf[_0xae7e('0x2e')][_0xae7e('0x1c')]);}_0xf864db[_0xae7e('0x35')]=qs[_0xae7e('0x36')](_0x1688cf[_0xae7e('0x2e')][_0xae7e('0x36')]);_0xf864db['where']=qs['filters'](_[_0xae7e('0x37')](_0x1688cf[_0xae7e('0x2e')],_0x7bc690['filters']));if(_0x1688cf[_0xae7e('0x2e')][_0xae7e('0x38')]){_0xf864db[_0xae7e('0x39')]=_[_0xae7e('0x3a')](_0xf864db[_0xae7e('0x39')],{'$or':_[_0xae7e('0x3b')](_0xf864db[_0xae7e('0x32')],function(_0x3c70ef){var _0x41f753={};_0x41f753[_0x3c70ef]={'$like':'%'+_0x1688cf[_0xae7e('0x2e')][_0xae7e('0x38')]+'%'};return _0x41f753;})});}_0xf864db=_['merge']({},_0xf864db,_0x1688cf[_0xae7e('0x3c')]);var _0x1bbae7={'where':_0xf864db['where']};return db[_0xae7e('0x2b')]['count'](_0x1bbae7)['then'](function(_0x5b8caf){_0x3fa488[_0xae7e('0x3d')]=_0x5b8caf;if(_0x1688cf[_0xae7e('0x2e')][_0xae7e('0x3e')]){_0xf864db[_0xae7e('0x3f')]=[{'all':!![]}];}return db[_0xae7e('0x2b')][_0xae7e('0x40')](_0xf864db);})['then'](function(_0x1191ee){_0x3fa488[_0xae7e('0x41')]=_0x1191ee;return _0x3fa488;})[_0xae7e('0x23')](respondWithFilteredResult(_0x1adc35,_0xf864db))[_0xae7e('0x42')](handleError(_0x1adc35,null));});};exports[_0xae7e('0x43')]=function(_0x56bdc8,_0x174bc4){var _0x25190b={'raw':![],'where':{'id':_0x56bdc8[_0xae7e('0x44')]['id']}},_0x39aae6={};_0x39aae6[_0xae7e('0x2d')]=_['keys'](db['CmCompany']['rawAttributes']);_0x39aae6['query']=_[_0xae7e('0x2f')](_0x56bdc8['query']);_0x39aae6[_0xae7e('0x30')]=_[_0xae7e('0x31')](_0x39aae6[_0xae7e('0x2d')],_0x39aae6[_0xae7e('0x2e')]);_0x25190b[_0xae7e('0x32')]=_['intersection'](_0x39aae6[_0xae7e('0x2d')],qs[_0xae7e('0x33')](_0x56bdc8['query'][_0xae7e('0x33')]));_0x25190b[_0xae7e('0x32')]=_0x25190b['attributes'][_0xae7e('0x34')]?_0x25190b[_0xae7e('0x32')]:_0x39aae6[_0xae7e('0x2d')];if(_0x56bdc8[_0xae7e('0x2e')][_0xae7e('0x3e')]){_0x25190b[_0xae7e('0x3f')]=[{'all':!![]}];}_0x25190b=_[_0xae7e('0x3a')]({},_0x25190b,_0x56bdc8[_0xae7e('0x3c')]);return db[_0xae7e('0x2b')][_0xae7e('0x45')](_0x25190b)[_0xae7e('0x23')](handleEntityNotFound(_0x174bc4,null))[_0xae7e('0x23')](respondWithResult(_0x174bc4,null))['catch'](handleError(_0x174bc4,null));};exports[_0xae7e('0x46')]=function(_0xec9c9f,_0x3796f9){return db['CmCompany']['create'](_0xec9c9f[_0xae7e('0x47')],{})[_0xae7e('0x23')](function(_0x3c905f){var _0x5881ce=_0xec9c9f[_0xae7e('0x48')][_0xae7e('0x25')]({'plain':!![]});if(!_0x5881ce)throw new Error(_0xae7e('0x49'));if(_0x5881ce[_0xae7e('0x4a')]==='user'){var _0x2d00c5=_0x3c905f['get']({'plain':!![]});var _0x4c20dc=_0xae7e('0x26');return db[_0xae7e('0x4b')][_0xae7e('0x45')]({'where':{'name':_0x4c20dc,'userProfileId':_0x5881ce['userProfileId']},'raw':!![]})[_0xae7e('0x23')](function(_0x40a3a8){if(_0x40a3a8&&_0x40a3a8[_0xae7e('0x4c')]===0x0){return db['UserProfileResource'][_0xae7e('0x46')]({'name':_0x2d00c5[_0xae7e('0x28')],'resourceId':_0x2d00c5['id'],'type':_0x40a3a8['name'],'sectionId':_0x40a3a8['id']},{})[_0xae7e('0x23')](function(){return _0x3c905f;});}else{return _0x3c905f;}})[_0xae7e('0x42')](function(_0xcfd1ac){logger[_0xae7e('0x4d')](_0xae7e('0x4e'),_0xcfd1ac);throw _0xcfd1ac;});}return _0x3c905f;})['then'](respondWithResult(_0x3796f9,0xc9))[_0xae7e('0x42')](handleError(_0x3796f9,null));};exports[_0xae7e('0x22')]=function(_0x201401,_0x42ce7f){if(_0x201401[_0xae7e('0x47')]['id']){delete _0x201401[_0xae7e('0x47')]['id'];}return db[_0xae7e('0x2b')][_0xae7e('0x45')]({'where':{'id':_0x201401['params']['id']}})[_0xae7e('0x23')](handleEntityNotFound(_0x42ce7f,null))['then'](saveUpdates(_0x201401[_0xae7e('0x47')],null))['then'](respondWithResult(_0x42ce7f,null))[_0xae7e('0x42')](handleError(_0x42ce7f,null));};exports[_0xae7e('0x24')]=function(_0x1fc9fb,_0xcfb763){return db[_0xae7e('0x2b')]['find']({'where':{'id':_0x1fc9fb['params']['id']}})[_0xae7e('0x23')](handleEntityNotFound(_0xcfb763,null))[_0xae7e('0x23')](removeEntity(_0xcfb763,null))['catch'](handleError(_0xcfb763,null));};exports[_0xae7e('0x2c')]=function(_0x2ab8d8,_0xea277e){return db[_0xae7e('0x2b')][_0xae7e('0x2c')]()['then'](respondWithResult(_0xea277e,null))[_0xae7e('0x42')](handleError(_0xea277e,null));};exports[_0xae7e('0x4f')]=function(_0x20c7a8,_0x4af1e9,_0x11f8a0){return db[_0xae7e('0x50')][_0xae7e('0x45')]({'where':{'id':_0x20c7a8[_0xae7e('0x44')]['id']}})[_0xae7e('0x23')](handleEntityNotFound(_0x4af1e9,null))[_0xae7e('0x23')](function(_0x3d0525){if(_0x3d0525){return _0x3d0525['addContacts'](_0x20c7a8[_0xae7e('0x47')]['ids'],_[_0xae7e('0x51')](_0x20c7a8[_0xae7e('0x47')],['ids','id'])||{});}})[_0xae7e('0x23')](respondWithResult(_0x4af1e9,null))[_0xae7e('0x42')](handleError(_0x4af1e9,null));};exports['getContacts']=function(_0x23efa2,_0x1af830,_0xc63352){var _0x5f10c0={};var _0x5bf5d3={};var _0x5ec6aa;var _0x47a607;return db[_0xae7e('0x2b')][_0xae7e('0x52')]({'where':{'id':_0x23efa2['params']['id']}})[_0xae7e('0x23')](handleEntityNotFound(_0x1af830,null))[_0xae7e('0x23')](function(_0x281120){if(_0x281120){_0x5ec6aa=_0x281120;_0x5bf5d3[_0xae7e('0x2d')]=_[_0xae7e('0x2f')](db[_0xae7e('0x50')][_0xae7e('0x53')]);_0x5bf5d3[_0xae7e('0x2e')]=_[_0xae7e('0x2f')](_0x23efa2[_0xae7e('0x2e')]);_0x5bf5d3[_0xae7e('0x30')]=_[_0xae7e('0x31')](_0x5bf5d3[_0xae7e('0x2d')],_0x5bf5d3[_0xae7e('0x2e')]);_0x5f10c0[_0xae7e('0x32')]=_[_0xae7e('0x31')](_0x5bf5d3[_0xae7e('0x2d')],qs[_0xae7e('0x33')](_0x23efa2[_0xae7e('0x2e')][_0xae7e('0x33')]));_0x5f10c0[_0xae7e('0x32')]=_0x5f10c0['attributes'][_0xae7e('0x34')]?_0x5f10c0[_0xae7e('0x32')]:_0x5bf5d3[_0xae7e('0x2d')];_0x5f10c0['order']=qs[_0xae7e('0x36')](_0x23efa2[_0xae7e('0x2e')][_0xae7e('0x36')]);_0x5f10c0[_0xae7e('0x39')]=qs[_0xae7e('0x30')](_[_0xae7e('0x37')](_0x23efa2[_0xae7e('0x2e')],_0x5bf5d3['filters']));if(_0x23efa2[_0xae7e('0x2e')][_0xae7e('0x38')]){_0x5f10c0['where']=_[_0xae7e('0x3a')](_0x5f10c0['where'],{'$or':_[_0xae7e('0x3b')](_0x5f10c0[_0xae7e('0x32')],function(_0x1cb92f){var _0x5b5248={};_0x5b5248[_0x1cb92f]={'$like':'%'+_0x23efa2[_0xae7e('0x2e')][_0xae7e('0x38')]+'%'};return _0x5b5248;})});}_0x5f10c0=_[_0xae7e('0x3a')]({},_0x5f10c0,_0x23efa2[_0xae7e('0x3c')]);return _0x5ec6aa[_0xae7e('0x54')](_0x5f10c0);}})[_0xae7e('0x23')](function(_0x2c2c20){if(_0x2c2c20){_0x47a607=_0x2c2c20['length'];if(!_0x23efa2['query'][_0xae7e('0x55')](_0xae7e('0x56'))){_0x5f10c0['limit']=qs[_0xae7e('0x1d')](_0x23efa2[_0xae7e('0x2e')][_0xae7e('0x1d')]);_0x5f10c0[_0xae7e('0x1c')]=qs[_0xae7e('0x1c')](_0x23efa2[_0xae7e('0x2e')][_0xae7e('0x1c')]);}return _0x5ec6aa[_0xae7e('0x54')](_0x5f10c0);}})[_0xae7e('0x23')](function(_0x1af29d){if(_0x1af29d){return _0x1af29d?{'count':_0x47a607,'rows':_0x1af29d}:null;}})[_0xae7e('0x23')](respondWithResult(_0x1af830,null))[_0xae7e('0x42')](handleError(_0x1af830,null));}; \ No newline at end of file +var _0x1f8c=['CmCompany','findAll','rows','catch','show','includeAll','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','addContacts','CmContact','ids','omit','getContacts','findOne','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','count','offset','limit','set','json','apply','reject','then','get','Companies','UserProfileResource','destroy','end','error','stack','name','send','describe','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','map','filter','options'];(function(_0x3ebff4,_0x5efe9a){var _0x6331b7=function(_0x4860d6){while(--_0x4860d6){_0x3ebff4['push'](_0x3ebff4['shift']());}};_0x6331b7(++_0x5efe9a);}(_0x1f8c,0x6d));var _0xc1f8=function(_0x4996d5,_0x123daf){_0x4996d5=_0x4996d5-0x0;var _0x4793f9=_0x1f8c[_0x4996d5];return _0x4793f9;};'use strict';var pdf=require(_0xc1f8('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xc1f8('0x1'));var zipdir=require(_0xc1f8('0x2'));var jsonpatch=require(_0xc1f8('0x3'));var rp=require(_0xc1f8('0x4'));var moment=require('moment');var BPromise=require(_0xc1f8('0x5'));var Mustache=require(_0xc1f8('0x6'));var util=require(_0xc1f8('0x7'));var path=require(_0xc1f8('0x8'));var sox=require(_0xc1f8('0x9'));var csv=require(_0xc1f8('0xa'));var ejs=require(_0xc1f8('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0xc1f8('0xc'));var crypto=require(_0xc1f8('0xd'));var jsforce=require(_0xc1f8('0xe'));var deskjs=require(_0xc1f8('0xf'));var toCsv=require(_0xc1f8('0xa'));var querystring=require('querystring');var Papa=require(_0xc1f8('0x10'));var Redis=require(_0xc1f8('0x11'));var authService=require(_0xc1f8('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xc1f8('0x13'));var hardwareService=require(_0xc1f8('0x14'));var logger=require(_0xc1f8('0x15'))(_0xc1f8('0x16'));var utils=require(_0xc1f8('0x17'));var config=require(_0xc1f8('0x18'));var db=require(_0xc1f8('0x19'))['db'];function respondWithStatusCode(_0x26964d,_0x391333){_0x391333=_0x391333||0xcc;return function(_0x17e3c8){if(_0x17e3c8){return _0x26964d['sendStatus'](_0x391333);}return _0x26964d[_0xc1f8('0x1a')](_0x391333)['end']();};}function respondWithResult(_0x20fc07,_0x48618e){_0x48618e=_0x48618e||0xc8;return function(_0x2df9ee){if(_0x2df9ee){return _0x20fc07[_0xc1f8('0x1a')](_0x48618e)['json'](_0x2df9ee);}};}function respondWithFilteredResult(_0x122686,_0x292649){return function(_0x57d716){if(_0x57d716){var _0x15fc76=_0x57d716[_0xc1f8('0x1b')],_0x132dac=_0x292649[_0xc1f8('0x1c')],_0x1e209d=_0x292649['offset']+_0x292649[_0xc1f8('0x1d')],_0x1d8016;if(_0x1e209d>=_0x15fc76){_0x1e209d=_0x15fc76;_0x1d8016=0xc8;}else{_0x1d8016=0xce;}_0x122686['status'](_0x1d8016);return _0x122686[_0xc1f8('0x1e')]('Content-Range',_0x132dac+'-'+_0x1e209d+'/'+_0x15fc76)[_0xc1f8('0x1f')](_0x57d716);}return null;};}function patchUpdates(_0x187d4b){return function(_0x145aea){try{jsonpatch[_0xc1f8('0x20')](_0x145aea,_0x187d4b,!![]);}catch(_0x3918c9){return BPromise[_0xc1f8('0x21')](_0x3918c9);}return _0x145aea['save']();};}function saveUpdates(_0x13cab7,_0x32b469){return function(_0x51f287){if(_0x51f287){return _0x51f287['update'](_0x13cab7)['then'](function(_0x58443c){return _0x58443c;});}return null;};}function removeEntity(_0x5f428a,_0x10d7fe){return function(_0x544970){if(_0x544970){return _0x544970['destroy']()[_0xc1f8('0x22')](function(){var _0x103753=_0x544970[_0xc1f8('0x23')]({'plain':!![]});var _0x352a2b=_0xc1f8('0x24');return db[_0xc1f8('0x25')][_0xc1f8('0x26')]({'where':{'type':_0x352a2b,'resourceId':_0x103753['id']}})[_0xc1f8('0x22')](function(){return _0x544970;});})[_0xc1f8('0x22')](function(){_0x5f428a['status'](0xcc)[_0xc1f8('0x27')]();});}};}function handleEntityNotFound(_0x53da10,_0x5b6a5d){return function(_0x28cbf9){if(!_0x28cbf9){_0x53da10['sendStatus'](0x194);}return _0x28cbf9;};}function handleError(_0x58ca93,_0x39cd3f){_0x39cd3f=_0x39cd3f||0x1f4;return function(_0x2c547d){logger[_0xc1f8('0x28')](_0x2c547d[_0xc1f8('0x29')]);if(_0x2c547d[_0xc1f8('0x2a')]){delete _0x2c547d[_0xc1f8('0x2a')];}_0x58ca93[_0xc1f8('0x1a')](_0x39cd3f)[_0xc1f8('0x2b')](_0x2c547d);};}exports['index']=function(_0x537f30,_0x477c7e){var _0x46d2ea={},_0x221c53={},_0x1b276a={'count':0x0,'rows':[]};return db['CmCompany'][_0xc1f8('0x2c')]()['then'](function(_0xf8ba58){_0x221c53['model']=_[_0xc1f8('0x2d')](_0xf8ba58);_0x221c53[_0xc1f8('0x2e')]=_[_0xc1f8('0x2d')](_0x537f30[_0xc1f8('0x2e')]);_0x221c53[_0xc1f8('0x2f')]=_[_0xc1f8('0x30')](_0x221c53[_0xc1f8('0x31')],_0x221c53['query']);_0x46d2ea[_0xc1f8('0x32')]=_[_0xc1f8('0x30')](_0x221c53[_0xc1f8('0x31')],qs[_0xc1f8('0x33')](_0x537f30[_0xc1f8('0x2e')][_0xc1f8('0x33')]));_0x46d2ea[_0xc1f8('0x32')]=_0x46d2ea[_0xc1f8('0x32')][_0xc1f8('0x34')]?_0x46d2ea['attributes']:_0x221c53[_0xc1f8('0x31')];if(!_0x537f30[_0xc1f8('0x2e')][_0xc1f8('0x35')](_0xc1f8('0x36'))){_0x46d2ea[_0xc1f8('0x1d')]=qs['limit'](_0x537f30['query'][_0xc1f8('0x1d')]);_0x46d2ea[_0xc1f8('0x1c')]=qs[_0xc1f8('0x1c')](_0x537f30[_0xc1f8('0x2e')][_0xc1f8('0x1c')]);}_0x46d2ea[_0xc1f8('0x37')]=qs[_0xc1f8('0x38')](_0x537f30[_0xc1f8('0x2e')][_0xc1f8('0x38')]);_0x46d2ea[_0xc1f8('0x39')]=qs[_0xc1f8('0x2f')](_[_0xc1f8('0x3a')](_0x537f30[_0xc1f8('0x2e')],_0x221c53[_0xc1f8('0x2f')]));if(_0x537f30[_0xc1f8('0x2e')]['filter']){_0x46d2ea[_0xc1f8('0x39')]=_[_0xc1f8('0x3b')](_0x46d2ea[_0xc1f8('0x39')],{'$or':_[_0xc1f8('0x3c')](_0x46d2ea[_0xc1f8('0x32')],function(_0x227d42){var _0xc16985={};_0xc16985[_0x227d42]={'$like':'%'+_0x537f30[_0xc1f8('0x2e')][_0xc1f8('0x3d')]+'%'};return _0xc16985;})});}_0x46d2ea=_[_0xc1f8('0x3b')]({},_0x46d2ea,_0x537f30[_0xc1f8('0x3e')]);var _0x12f571={'where':_0x46d2ea[_0xc1f8('0x39')]};return db[_0xc1f8('0x3f')][_0xc1f8('0x1b')](_0x12f571)['then'](function(_0x5df01f){_0x1b276a[_0xc1f8('0x1b')]=_0x5df01f;if(_0x537f30[_0xc1f8('0x2e')]['includeAll']){_0x46d2ea['include']=[{'all':!![]}];}return db[_0xc1f8('0x3f')][_0xc1f8('0x40')](_0x46d2ea);})[_0xc1f8('0x22')](function(_0x47857c){_0x1b276a[_0xc1f8('0x41')]=_0x47857c;return _0x1b276a;})[_0xc1f8('0x22')](respondWithFilteredResult(_0x477c7e,_0x46d2ea))[_0xc1f8('0x42')](handleError(_0x477c7e,null));});};exports[_0xc1f8('0x43')]=function(_0x17dae6,_0x103924){var _0x309fc5={'raw':![],'where':{'id':_0x17dae6['params']['id']}},_0x2f04e1={};_0x2f04e1[_0xc1f8('0x31')]=_[_0xc1f8('0x2d')](db[_0xc1f8('0x3f')]['rawAttributes']);_0x2f04e1[_0xc1f8('0x2e')]=_[_0xc1f8('0x2d')](_0x17dae6[_0xc1f8('0x2e')]);_0x2f04e1[_0xc1f8('0x2f')]=_[_0xc1f8('0x30')](_0x2f04e1[_0xc1f8('0x31')],_0x2f04e1[_0xc1f8('0x2e')]);_0x309fc5[_0xc1f8('0x32')]=_[_0xc1f8('0x30')](_0x2f04e1[_0xc1f8('0x31')],qs[_0xc1f8('0x33')](_0x17dae6[_0xc1f8('0x2e')][_0xc1f8('0x33')]));_0x309fc5[_0xc1f8('0x32')]=_0x309fc5[_0xc1f8('0x32')][_0xc1f8('0x34')]?_0x309fc5['attributes']:_0x2f04e1[_0xc1f8('0x31')];if(_0x17dae6[_0xc1f8('0x2e')][_0xc1f8('0x44')]){_0x309fc5['include']=[{'all':!![]}];}_0x309fc5=_[_0xc1f8('0x3b')]({},_0x309fc5,_0x17dae6[_0xc1f8('0x3e')]);return db[_0xc1f8('0x3f')]['find'](_0x309fc5)['then'](handleEntityNotFound(_0x103924,null))[_0xc1f8('0x22')](respondWithResult(_0x103924,null))[_0xc1f8('0x42')](handleError(_0x103924,null));};exports['create']=function(_0x2f26ec,_0x1300d3){return db[_0xc1f8('0x3f')][_0xc1f8('0x45')](_0x2f26ec[_0xc1f8('0x46')],{})[_0xc1f8('0x22')](function(_0x27d43c){var _0x55b6e9=_0x2f26ec[_0xc1f8('0x47')][_0xc1f8('0x23')]({'plain':!![]});if(!_0x55b6e9)throw new Error(_0xc1f8('0x48'));if(_0x55b6e9[_0xc1f8('0x49')]===_0xc1f8('0x47')){var _0x37a9d2=_0x27d43c[_0xc1f8('0x23')]({'plain':!![]});var _0x32d5cd='Companies';return db['UserProfileSection'][_0xc1f8('0x4a')]({'where':{'name':_0x32d5cd,'userProfileId':_0x55b6e9[_0xc1f8('0x4b')]},'raw':!![]})[_0xc1f8('0x22')](function(_0x4111a7){if(_0x4111a7&&_0x4111a7[_0xc1f8('0x4c')]===0x0){return db[_0xc1f8('0x25')][_0xc1f8('0x45')]({'name':_0x37a9d2[_0xc1f8('0x2a')],'resourceId':_0x37a9d2['id'],'type':_0x4111a7[_0xc1f8('0x2a')],'sectionId':_0x4111a7['id']},{})[_0xc1f8('0x22')](function(){return _0x27d43c;});}else{return _0x27d43c;}})[_0xc1f8('0x42')](function(_0x1f0c6f){logger[_0xc1f8('0x28')](_0xc1f8('0x4d'),_0x1f0c6f);throw _0x1f0c6f;});}return _0x27d43c;})[_0xc1f8('0x22')](respondWithResult(_0x1300d3,0xc9))[_0xc1f8('0x42')](handleError(_0x1300d3,null));};exports[_0xc1f8('0x4e')]=function(_0x82fefc,_0x140bd){if(_0x82fefc[_0xc1f8('0x46')]['id']){delete _0x82fefc[_0xc1f8('0x46')]['id'];}return db[_0xc1f8('0x3f')][_0xc1f8('0x4a')]({'where':{'id':_0x82fefc[_0xc1f8('0x4f')]['id']}})[_0xc1f8('0x22')](handleEntityNotFound(_0x140bd,null))[_0xc1f8('0x22')](saveUpdates(_0x82fefc[_0xc1f8('0x46')],null))['then'](respondWithResult(_0x140bd,null))[_0xc1f8('0x42')](handleError(_0x140bd,null));};exports[_0xc1f8('0x26')]=function(_0x179f79,_0x3b2808){return db['CmCompany'][_0xc1f8('0x4a')]({'where':{'id':_0x179f79[_0xc1f8('0x4f')]['id']}})[_0xc1f8('0x22')](handleEntityNotFound(_0x3b2808,null))['then'](removeEntity(_0x3b2808,null))[_0xc1f8('0x42')](handleError(_0x3b2808,null));};exports[_0xc1f8('0x2c')]=function(_0x51cf48,_0x596eab){return db[_0xc1f8('0x3f')][_0xc1f8('0x2c')]()[_0xc1f8('0x22')](respondWithResult(_0x596eab,null))[_0xc1f8('0x42')](handleError(_0x596eab,null));};exports[_0xc1f8('0x50')]=function(_0x42125f,_0x31616f,_0x1b2d33){return db[_0xc1f8('0x51')][_0xc1f8('0x4a')]({'where':{'id':_0x42125f[_0xc1f8('0x4f')]['id']}})[_0xc1f8('0x22')](handleEntityNotFound(_0x31616f,null))[_0xc1f8('0x22')](function(_0x341ca0){if(_0x341ca0){return _0x341ca0[_0xc1f8('0x50')](_0x42125f[_0xc1f8('0x46')][_0xc1f8('0x52')],_[_0xc1f8('0x53')](_0x42125f[_0xc1f8('0x46')],[_0xc1f8('0x52'),'id'])||{});}})[_0xc1f8('0x22')](respondWithResult(_0x31616f,null))[_0xc1f8('0x42')](handleError(_0x31616f,null));};exports[_0xc1f8('0x54')]=function(_0x4c2fba,_0x1b8e89,_0x2a9f59){var _0x45fec7={};var _0x1343f2={};var _0xca772f;var _0x2996a0;return db[_0xc1f8('0x3f')][_0xc1f8('0x55')]({'where':{'id':_0x4c2fba[_0xc1f8('0x4f')]['id']}})[_0xc1f8('0x22')](handleEntityNotFound(_0x1b8e89,null))[_0xc1f8('0x22')](function(_0x359f74){if(_0x359f74){_0xca772f=_0x359f74;_0x1343f2[_0xc1f8('0x31')]=_[_0xc1f8('0x2d')](db[_0xc1f8('0x51')]['rawAttributes']);_0x1343f2[_0xc1f8('0x2e')]=_['keys'](_0x4c2fba['query']);_0x1343f2[_0xc1f8('0x2f')]=_[_0xc1f8('0x30')](_0x1343f2[_0xc1f8('0x31')],_0x1343f2[_0xc1f8('0x2e')]);_0x45fec7[_0xc1f8('0x32')]=_[_0xc1f8('0x30')](_0x1343f2[_0xc1f8('0x31')],qs[_0xc1f8('0x33')](_0x4c2fba['query'][_0xc1f8('0x33')]));_0x45fec7[_0xc1f8('0x32')]=_0x45fec7[_0xc1f8('0x32')][_0xc1f8('0x34')]?_0x45fec7['attributes']:_0x1343f2[_0xc1f8('0x31')];_0x45fec7[_0xc1f8('0x37')]=qs[_0xc1f8('0x38')](_0x4c2fba['query'][_0xc1f8('0x38')]);_0x45fec7[_0xc1f8('0x39')]=qs[_0xc1f8('0x2f')](_[_0xc1f8('0x3a')](_0x4c2fba[_0xc1f8('0x2e')],_0x1343f2[_0xc1f8('0x2f')]));if(_0x4c2fba[_0xc1f8('0x2e')][_0xc1f8('0x3d')]){_0x45fec7[_0xc1f8('0x39')]=_['merge'](_0x45fec7[_0xc1f8('0x39')],{'$or':_[_0xc1f8('0x3c')](_0x45fec7[_0xc1f8('0x32')],function(_0x1306f6){var _0x49d21c={};_0x49d21c[_0x1306f6]={'$like':'%'+_0x4c2fba[_0xc1f8('0x2e')][_0xc1f8('0x3d')]+'%'};return _0x49d21c;})});}_0x45fec7=_[_0xc1f8('0x3b')]({},_0x45fec7,_0x4c2fba[_0xc1f8('0x3e')]);return _0xca772f['getContacts'](_0x45fec7);}})[_0xc1f8('0x22')](function(_0x132af7){if(_0x132af7){_0x2996a0=_0x132af7[_0xc1f8('0x34')];if(!_0x4c2fba['query'][_0xc1f8('0x35')](_0xc1f8('0x36'))){_0x45fec7[_0xc1f8('0x1d')]=qs['limit'](_0x4c2fba[_0xc1f8('0x2e')][_0xc1f8('0x1d')]);_0x45fec7[_0xc1f8('0x1c')]=qs[_0xc1f8('0x1c')](_0x4c2fba[_0xc1f8('0x2e')][_0xc1f8('0x1c')]);}return _0xca772f[_0xc1f8('0x54')](_0x45fec7);}})[_0xc1f8('0x22')](function(_0x414f65){if(_0x414f65){return _0x414f65?{'count':_0x2996a0,'rows':_0x414f65}:null;}})[_0xc1f8('0x22')](respondWithResult(_0x1b8e89,null))['catch'](handleError(_0x1b8e89,null));}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js index 2fdef32..8a8b1cc 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 _0x3edc=['cm_companies','lodash','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./cmCompany.attributes','exports','define','CmCompany'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x3edc,0x1ae));var _0xc3ed=function(_0x338224,_0x1fb425){_0x338224=_0x338224-0x0;var _0x1d5fc5=_0x3edc[_0x338224];return _0x1d5fc5;};'use strict';var _=require(_0xc3ed('0x0'));var util=require(_0xc3ed('0x1'));var logger=require(_0xc3ed('0x2'))(_0xc3ed('0x3'));var moment=require(_0xc3ed('0x4'));var BPromise=require('bluebird');var rp=require(_0xc3ed('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc3ed('0x6'));var config=require(_0xc3ed('0x7'));var attributes=require(_0xc3ed('0x8'));module[_0xc3ed('0x9')]=function(_0x3f8468,_0x50b95c){return _0x3f8468[_0xc3ed('0xa')](_0xc3ed('0xb'),attributes,{'tableName':_0xc3ed('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x34aa=['./cmCompany.attributes','exports','define','CmCompany','cm_companies','lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x2b7646,_0x2a17ae){var _0x1af89e=function(_0x5734e2){while(--_0x5734e2){_0x2b7646['push'](_0x2b7646['shift']());}};_0x1af89e(++_0x2a17ae);}(_0x34aa,0x171));var _0xa34a=function(_0x25a0b9,_0x86e28f){_0x25a0b9=_0x25a0b9-0x0;var _0x30b9ab=_0x34aa[_0x25a0b9];return _0x30b9ab;};'use strict';var _=require(_0xa34a('0x0'));var util=require('util');var logger=require(_0xa34a('0x1'))(_0xa34a('0x2'));var moment=require(_0xa34a('0x3'));var BPromise=require(_0xa34a('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa34a('0x5'));var rimraf=require(_0xa34a('0x6'));var config=require(_0xa34a('0x7'));var attributes=require(_0xa34a('0x8'));module[_0xa34a('0x9')]=function(_0x475f8f,_0x27349c){return _0x475f8f[_0xa34a('0xa')](_0xa34a('0xb'),attributes,{'tableName':_0xa34a('0xc'),'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 7f10cd4..a7ccae7 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 _0x5d10=['lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','code','CmCompany,\x20%s,\x20%s','message','catch'];(function(_0x427352,_0x1bce61){var _0x23e0e6=function(_0x2a42a9){while(--_0x2a42a9){_0x427352['push'](_0x427352['shift']());}};_0x23e0e6(++_0x1bce61);}(_0x5d10,0x90));var _0x05d1=function(_0x5a58db,_0x2d7f41){_0x5a58db=_0x5a58db-0x0;var _0x42dd9a=_0x5d10[_0x5a58db];return _0x42dd9a;};'use strict';var _=require(_0x05d1('0x0'));var util=require(_0x05d1('0x1'));var moment=require(_0x05d1('0x2'));var BPromise=require(_0x05d1('0x3'));var rs=require(_0x05d1('0x4'));var fs=require('fs');var Redis=require(_0x05d1('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x05d1('0x6'));var logger=require(_0x05d1('0x7'))(_0x05d1('0x8'));var config=require('../../config/environment');var jayson=require(_0x05d1('0x9'));var client=jayson[_0x05d1('0xa')][_0x05d1('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x16feeb,_0x567537,_0x56eec3){return new BPromise(function(_0x514e0e,_0x1fa3ca){return client[_0x05d1('0xc')](_0x16feeb,_0x56eec3)[_0x05d1('0xd')](function(_0x5290fd){logger[_0x05d1('0xe')]('CmCompany,\x20%s,\x20%s',_0x567537,_0x05d1('0xf'));logger[_0x05d1('0x10')](_0x05d1('0x11'),_0x567537,'request\x20sent',JSON[_0x05d1('0x12')](_0x5290fd));if(_0x5290fd['error']){if(_0x5290fd[_0x05d1('0x13')][_0x05d1('0x14')]===0x1f4){logger[_0x05d1('0x13')](_0x05d1('0x15'),_0x567537,_0x5290fd[_0x05d1('0x13')][_0x05d1('0x16')]);return _0x1fa3ca(_0x5290fd[_0x05d1('0x13')][_0x05d1('0x16')]);}logger['error']('CmCompany,\x20%s,\x20%s',_0x567537,_0x5290fd[_0x05d1('0x13')][_0x05d1('0x16')]);return _0x514e0e(_0x5290fd[_0x05d1('0x13')][_0x05d1('0x16')]);}else{logger['info'](_0x05d1('0x15'),_0x567537,_0x05d1('0xf'));_0x514e0e(_0x5290fd['result'][_0x05d1('0x16')]);}})[_0x05d1('0x17')](function(_0xe3786a){logger[_0x05d1('0x13')](_0x05d1('0x15'),_0x567537,_0xe3786a);_0x1fa3ca(_0xe3786a);});});} \ No newline at end of file +var _0xb444=['util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','CmCompany,\x20%s,\x20%s','debug','CmCompany,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','catch','lodash'];(function(_0x380aec,_0x496aa2){var _0x322921=function(_0x4dd863){while(--_0x4dd863){_0x380aec['push'](_0x380aec['shift']());}};_0x322921(++_0x496aa2);}(_0xb444,0x1b4));var _0x4b44=function(_0x2c54cc,_0x32161b){_0x2c54cc=_0x2c54cc-0x0;var _0x4cde90=_0xb444[_0x2c54cc];return _0x4cde90;};'use strict';var _=require(_0x4b44('0x0'));var util=require(_0x4b44('0x1'));var moment=require(_0x4b44('0x2'));var BPromise=require(_0x4b44('0x3'));var rs=require(_0x4b44('0x4'));var fs=require('fs');var Redis=require(_0x4b44('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x4b44('0x6'));var logger=require(_0x4b44('0x7'))(_0x4b44('0x8'));var config=require(_0x4b44('0x9'));var jayson=require(_0x4b44('0xa'));var client=jayson[_0x4b44('0xb')][_0x4b44('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xf9c68a,_0x9ac929,_0x5b5a21){return new BPromise(function(_0x41367c,_0x1d8a23){return client[_0x4b44('0xd')](_0xf9c68a,_0x5b5a21)['then'](function(_0x59fcb8){logger[_0x4b44('0xe')](_0x4b44('0xf'),_0x9ac929,'request\x20sent');logger[_0x4b44('0x10')](_0x4b44('0x11'),_0x9ac929,_0x4b44('0x12'),JSON['stringify'](_0x59fcb8));if(_0x59fcb8[_0x4b44('0x13')]){if(_0x59fcb8['error']['code']===0x1f4){logger[_0x4b44('0x13')](_0x4b44('0xf'),_0x9ac929,_0x59fcb8[_0x4b44('0x13')][_0x4b44('0x14')]);return _0x1d8a23(_0x59fcb8[_0x4b44('0x13')][_0x4b44('0x14')]);}logger['error'](_0x4b44('0xf'),_0x9ac929,_0x59fcb8[_0x4b44('0x13')][_0x4b44('0x14')]);return _0x41367c(_0x59fcb8[_0x4b44('0x13')][_0x4b44('0x14')]);}else{logger[_0x4b44('0xe')](_0x4b44('0xf'),_0x9ac929,_0x4b44('0x12'));_0x41367c(_0x59fcb8[_0x4b44('0x15')][_0x4b44('0x14')]);}})[_0x4b44('0x16')](function(_0x5184f2){logger[_0x4b44('0x13')]('CmCompany,\x20%s,\x20%s',_0x9ac929,_0x5184f2);_0x1d8a23(_0x5184f2);});});} \ No newline at end of file diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js index d54ca98..2e6f7e4 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 _0xd943=['get','show','/:id/contacts','getContacts','isAuthenticated','create','addContacts','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCompany.controller','index','describe'];(function(_0x50e0b4,_0x1057f7){var _0x2fa8b0=function(_0x3766bc){while(--_0x3766bc){_0x50e0b4['push'](_0x50e0b4['shift']());}};_0x2fa8b0(++_0x1057f7);}(_0xd943,0x15d));var _0x3d94=function(_0x4a16c5,_0x536da5){_0x4a16c5=_0x4a16c5-0x0;var _0xec71cf=_0xd943[_0x4a16c5];return _0xec71cf;};'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 auth=require(_0x3d94('0x5'));var interaction=require(_0x3d94('0x6'));var config=require(_0x3d94('0x7'));var controller=require(_0x3d94('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x3d94('0x9')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0x3d94('0xa')]);router[_0x3d94('0xb')]('/:id',auth['isAuthenticated'](),controller[_0x3d94('0xc')]);router[_0x3d94('0xb')](_0x3d94('0xd'),auth['isAuthenticated'](),controller[_0x3d94('0xe')]);router['post']('/',auth[_0x3d94('0xf')](),controller[_0x3d94('0x10')]);router['post'](_0x3d94('0xd'),auth[_0x3d94('0xf')](),controller[_0x3d94('0x11')]);router[_0x3d94('0x12')](_0x3d94('0x13'),auth['isAuthenticated'](),controller[_0x3d94('0x14')]);router[_0x3d94('0x15')](_0x3d94('0x13'),auth['isAuthenticated'](),controller[_0x3d94('0x16')]);module[_0x3d94('0x17')]=router; \ No newline at end of file +var _0xed1c=['../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','/:id','show','/:id/contacts','getContacts','create','post','addContacts','put','update','delete','destroy','exports','multer','util','../../components/auth/service'];(function(_0x238dea,_0x14b7d7){var _0x4d2231=function(_0x57a158){while(--_0x57a158){_0x238dea['push'](_0x238dea['shift']());}};_0x4d2231(++_0x14b7d7);}(_0xed1c,0xe4));var _0xced1=function(_0x16c685,_0x41e68b){_0x16c685=_0x16c685-0x0;var _0x10217e=_0xed1c[_0x16c685];return _0x10217e;};'use strict';var multer=require(_0xced1('0x0'));var util=require(_0xced1('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var auth=require(_0xced1('0x2'));var interaction=require(_0xced1('0x3'));var config=require(_0xced1('0x4'));var controller=require('./cmCompany.controller');router[_0xced1('0x5')]('/',auth[_0xced1('0x6')](),controller[_0xced1('0x7')]);router[_0xced1('0x5')]('/describe',auth[_0xced1('0x6')](),controller[_0xced1('0x8')]);router[_0xced1('0x5')](_0xced1('0x9'),auth[_0xced1('0x6')](),controller[_0xced1('0xa')]);router[_0xced1('0x5')](_0xced1('0xb'),auth['isAuthenticated'](),controller[_0xced1('0xc')]);router['post']('/',auth[_0xced1('0x6')](),controller[_0xced1('0xd')]);router[_0xced1('0xe')](_0xced1('0xb'),auth[_0xced1('0x6')](),controller[_0xced1('0xf')]);router[_0xced1('0x10')]('/:id',auth[_0xced1('0x6')](),controller[_0xced1('0x11')]);router[_0xced1('0x12')](_0xced1('0x9'),auth['isAuthenticated'](),controller[_0xced1('0x13')]);module[_0xced1('0x14')]=router; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js index 349e623..8cfcc1e 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 _0xe674=['DATE','NOW','lodash','sequelize','STRING','TEXT','INTEGER','UNSIGNED'];(function(_0x527233,_0x2ec398){var _0x39eeeb=function(_0x10f3b8){while(--_0x10f3b8){_0x527233['push'](_0x527233['shift']());}};_0x39eeeb(++_0x2ec398);}(_0xe674,0x18a));var _0x4e67=function(_0x2b6559,_0x3e515c){_0x2b6559=_0x2b6559-0x0;var _0x36bddc=_0xe674[_0x2b6559];return _0x36bddc;};'use strict';var _=require(_0x4e67('0x0'));var Sequelize=require(_0x4e67('0x1'));module['exports']={'firstName':{'type':Sequelize[_0x4e67('0x2')],'allowNull':![]},'lastName':{'type':Sequelize[_0x4e67('0x2')]},'street':{'type':Sequelize[_0x4e67('0x2')]},'postalCode':{'type':Sequelize[_0x4e67('0x2')]},'city':{'type':Sequelize[_0x4e67('0x2')]},'country':{'type':Sequelize[_0x4e67('0x2')]},'dateOfBirth':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x4e67('0x3')]},'phone':{'type':Sequelize[_0x4e67('0x2')]},'mobile':{'type':Sequelize[_0x4e67('0x2')]},'fax':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x4e67('0x2')]},'url':{'type':Sequelize['STRING']},'facebook':{'type':Sequelize['STRING']},'fb_data':{'type':Sequelize[_0x4e67('0x2')]},'twitter':{'type':Sequelize[_0x4e67('0x2')]},'skype':{'type':Sequelize[_0x4e67('0x2')]},'teams':{'type':Sequelize[_0x4e67('0x2')]},'viber':{'type':Sequelize[_0x4e67('0x2')]},'line':{'type':Sequelize[_0x4e67('0x2')]},'wechat':{'type':Sequelize[_0x4e67('0x2')]},'telegram':{'type':Sequelize[_0x4e67('0x2')]},'UserId':{'type':Sequelize[_0x4e67('0x4')]},'priority':{'type':Sequelize[_0x4e67('0x4')](0x2)[_0x4e67('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x4e67('0x6')],'defaultValue':Sequelize[_0x4e67('0x7')]}}; \ No newline at end of file +var _0x83b2=['STRING','INTEGER','UNSIGNED','lodash','exports'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x83b2,0x1a7));var _0x283b=function(_0x1381ce,_0x57a5b0){_0x1381ce=_0x1381ce-0x0;var _0x11dd79=_0x83b2[_0x1381ce];return _0x11dd79;};'use strict';var _=require(_0x283b('0x0'));var Sequelize=require('sequelize');module[_0x283b('0x1')]={'firstName':{'type':Sequelize['STRING'],'allowNull':![]},'lastName':{'type':Sequelize[_0x283b('0x2')]},'street':{'type':Sequelize[_0x283b('0x2')]},'postalCode':{'type':Sequelize[_0x283b('0x2')]},'city':{'type':Sequelize[_0x283b('0x2')]},'country':{'type':Sequelize['STRING']},'dateOfBirth':{'type':Sequelize[_0x283b('0x2')]},'description':{'type':Sequelize['TEXT']},'phone':{'type':Sequelize[_0x283b('0x2')]},'mobile':{'type':Sequelize[_0x283b('0x2')]},'fax':{'type':Sequelize[_0x283b('0x2')]},'email':{'type':Sequelize[_0x283b('0x2')]},'url':{'type':Sequelize[_0x283b('0x2')]},'facebook':{'type':Sequelize[_0x283b('0x2')]},'fb_data':{'type':Sequelize[_0x283b('0x2')]},'twitter':{'type':Sequelize[_0x283b('0x2')]},'skype':{'type':Sequelize[_0x283b('0x2')]},'teams':{'type':Sequelize[_0x283b('0x2')]},'viber':{'type':Sequelize[_0x283b('0x2')]},'line':{'type':Sequelize[_0x283b('0x2')]},'wechat':{'type':Sequelize[_0x283b('0x2')]},'telegram':{'type':Sequelize[_0x283b('0x2')]},'UserId':{'type':Sequelize[_0x283b('0x3')]},'priority':{'type':Sequelize[_0x283b('0x3')](0x2)[_0x283b('0x4')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js index d575021..91e4647 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 _0x814b=['CmContact','model','keys','filters','intersection','query','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','pick','field','color','tools_tags','cm_user_has_contacts','uc.CmContactId\x20=\x20c.id','where','c.deletedAt\x20IS\x20NULL','advancedFilter','parse','matchType','substr','omit','options','hasMultipleConditions','value','values','forEach','having','table','parseOperator','getConditionValue','isRangeCondition','$gte','$lte','`\x20=\x200','`\x20>\x200','map','filter','Contact','push','isEmpty','c.ListId\x20IN\x20?','concat','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','replace','isNumeric','c.mobile\x20LIKE\x20?','c.fax\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','c.lastName\x20LIKE\x20?','c.id','uc.UserId','Sequelize','QueryTypes','SELECT','clone','isArray','tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','left_join','cm_contact_has_tags','ct.CmContactId\x20=\x20c.id','t.id\x20=\x20ct.TagId','t.id\x20IN\x20?','TagId','toString','keyBy','sequelize','merge','c.mobile','c.email','c.UserId','c.deletedAt','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','Tags','split','catch','params','describe','startsWith','columnName','displayName','CmCustomField','cf_','alias','custom','type','body','from','get','mergeWith','tags','join','info','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatInteraction','ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','FaxMessage','OpenchannelInteraction','OpenchannelMessage','CmHopperFinal','CmHopperHistory','ReportAgentPreview','VoiceCallReport','ChatQueueReport','FaxQueueReport','MailQueueReport','OpenchannelQueueReport','bulkCreate','each','duplicates','ListId','findOrCreate','spread','show','find','findAll','$and','pickBy','format','cf_%d','setFields','id\x20=\x20?','toParam','text','phone','getTags','findOne','rawAttributes','setTags','ids','getHoppers','ContactId','count','includeAll','rows','getHopperHistories','include','getHopperFinals','getJscriptySessions','JscriptySessionReport','uploadCsv','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','binding_values','No\x20association\x20values\x20specified!','socket_timestamp','No\x20phone\x20column\x20specified','firstName','root','server/files/tmp','file','filename','chmodSync','0777','child_process','fork','../../components/import/cm/csv','upload','import','User','agent','binding','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','stringify','message','start\x20child\x20process\x20correctly!','pid','exit','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./cmContact.socket','register','sendStatus','status','end','json','offset','set','Content-Range','reject','save','update','destroy','then','error','stack','name','send'];(function(_0x4dab14,_0x164ea0){var _0xf41aa=function(_0x305d50){while(--_0x305d50){_0x4dab14['push'](_0x4dab14['shift']());}};_0xf41aa(++_0x164ea0);}(_0x814b,0x1a2));var _0xb814=function(_0x301064,_0x1985aa){_0x301064=_0x301064-0x0;var _0x5bc841=_0x814b[_0x301064];return _0x5bc841;};'use strict';var pdf=require(_0xb814('0x0'));var emlformat=require(_0xb814('0x1'));var rimraf=require(_0xb814('0x2'));var zipdir=require(_0xb814('0x3'));var jsonpatch=require(_0xb814('0x4'));var rp=require(_0xb814('0x5'));var moment=require('moment');var BPromise=require(_0xb814('0x6'));var Mustache=require(_0xb814('0x7'));var util=require(_0xb814('0x8'));var path=require(_0xb814('0x9'));var sox=require(_0xb814('0xa'));var csv=require(_0xb814('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xb814('0xc'));var squel=require(_0xb814('0xd'));var crypto=require('crypto');var jsforce=require(_0xb814('0xe'));var deskjs=require(_0xb814('0xf'));var toCsv=require(_0xb814('0xb'));var querystring=require(_0xb814('0x10'));var Papa=require(_0xb814('0x11'));var Redis=require(_0xb814('0x12'));var authService=require(_0xb814('0x13'));var qs=require(_0xb814('0x14'));var as=require(_0xb814('0x15'));var hardwareService=require(_0xb814('0x16'));var logger=require(_0xb814('0x17'))('api');var utils=require(_0xb814('0x18'));var config=require('../../config/environment');var db=require(_0xb814('0x19'))['db'];config[_0xb814('0x1a')]=_[_0xb814('0x1b')](config[_0xb814('0x1a')],{'host':_0xb814('0x1c'),'port':0x18eb});var socket=require(_0xb814('0x1d'))(new Redis(config[_0xb814('0x1a')]));require(_0xb814('0x1e'))[_0xb814('0x1f')](socket);function respondWithStatusCode(_0x2ab627,_0x3f4881){_0x3f4881=_0x3f4881||0xcc;return function(_0x44fb96){if(_0x44fb96){return _0x2ab627[_0xb814('0x20')](_0x3f4881);}return _0x2ab627[_0xb814('0x21')](_0x3f4881)[_0xb814('0x22')]();};}function respondWithResult(_0x3a71d6,_0x45e0d0){_0x45e0d0=_0x45e0d0||0xc8;return function(_0x265a83){if(_0x265a83){return _0x3a71d6[_0xb814('0x21')](_0x45e0d0)[_0xb814('0x23')](_0x265a83);}};}function respondWithFilteredResult(_0x7a21ef,_0x48c9df){return function(_0x168a48){if(_0x168a48){var _0x55ba16=_0x168a48['count'],_0x270598=_0x48c9df['offset'],_0xfac75b=_0x48c9df[_0xb814('0x24')]+_0x48c9df['limit'],_0x4c3007;if(_0xfac75b>=_0x55ba16){_0xfac75b=_0x55ba16;_0x4c3007=0xc8;}else{_0x4c3007=0xce;}_0x7a21ef['status'](_0x4c3007);return _0x7a21ef[_0xb814('0x25')](_0xb814('0x26'),_0x270598+'-'+_0xfac75b+'/'+_0x55ba16)[_0xb814('0x23')](_0x168a48);}return null;};}function patchUpdates(_0x4e139e){return function(_0xf5b8aa){try{jsonpatch['apply'](_0xf5b8aa,_0x4e139e,!![]);}catch(_0x1e6393){return BPromise[_0xb814('0x27')](_0x1e6393);}return _0xf5b8aa[_0xb814('0x28')]();};}function saveUpdates(_0x470e81,_0x27352e){return function(_0x2bd039){if(_0x2bd039){return _0x2bd039[_0xb814('0x29')](_0x470e81)['then'](function(_0x2ead86){return _0x2ead86;});}return null;};}function removeEntity(_0x52b7a3,_0x3f81d0){return function(_0x457dac){if(_0x457dac){return _0x457dac[_0xb814('0x2a')]()[_0xb814('0x2b')](function(){_0x52b7a3[_0xb814('0x21')](0xcc)[_0xb814('0x22')]();});}};}function handleEntityNotFound(_0x3d836c,_0x5755ea){return function(_0x392222){if(!_0x392222){_0x3d836c[_0xb814('0x20')](0x194);}return _0x392222;};}function handleError(_0x1c2625,_0x349394){_0x349394=_0x349394||0x1f4;return function(_0x32ed56){logger[_0xb814('0x2c')](_0x32ed56[_0xb814('0x2d')]);if(_0x32ed56[_0xb814('0x2e')]){delete _0x32ed56['name'];}_0x1c2625[_0xb814('0x21')](_0x349394)[_0xb814('0x2f')](_0x32ed56);};}exports['index']=function(_0x9008b2,_0x37d24d){var _0x530744={},_0x499f22={},_0x20577b={'count':0x0,'rows':[]};return db[_0xb814('0x30')]['describe']()[_0xb814('0x2b')](function(_0x526610){_0x499f22[_0xb814('0x31')]=_['keys'](_0x526610);_0x499f22['query']=_[_0xb814('0x32')](_0x9008b2['query']);_0x499f22[_0xb814('0x33')]=_[_0xb814('0x34')](_0x499f22[_0xb814('0x31')],_0x499f22['query']);_0x530744['attributes']=_[_0xb814('0x34')](_0x499f22[_0xb814('0x31')],qs['fields'](_0x9008b2[_0xb814('0x35')][_0xb814('0x36')]));_0x530744[_0xb814('0x37')]=_0x530744[_0xb814('0x37')][_0xb814('0x38')]?_0x530744[_0xb814('0x37')]:_0x499f22[_0xb814('0x31')];if(!_0x9008b2['query'][_0xb814('0x39')](_0xb814('0x3a'))){_0x530744[_0xb814('0x3b')]=qs[_0xb814('0x3b')](_0x9008b2[_0xb814('0x35')]['limit']);_0x530744[_0xb814('0x24')]=qs['offset'](_0x9008b2[_0xb814('0x35')][_0xb814('0x24')]);}_0x530744[_0xb814('0x3c')]=qs['sort'](_0x9008b2[_0xb814('0x35')][_0xb814('0x3d')]);_0x530744['where']=qs[_0xb814('0x33')](_[_0xb814('0x3e')](_0x9008b2[_0xb814('0x35')],_0x499f22[_0xb814('0x33')]));var _0xd77d96=[];var _0x467cf9=squel['select']()[_0xb814('0x3f')]('id')['field'](_0xb814('0x2e'))['field'](_0xb814('0x40'))['from'](_0xb814('0x41'));var _0x26675a=squel['select']()['from']('cm_contacts','c')['left_join'](_0xb814('0x42'),'uc',_0xb814('0x43'))[_0xb814('0x44')](_0xb814('0x45'));var _0x51cdba=squel['expr']();var _0x6f15d3=_0x9008b2['query'][_0xb814('0x46')]?JSON[_0xb814('0x47')](_0x9008b2[_0xb814('0x35')][_0xb814('0x46')]):undefined;if(_0x6f15d3){var _0x42653f=_0x6f15d3[_0xb814('0x48')][_0xb814('0x49')](0x1);_(_0x6f15d3)[_0xb814('0x4a')](_0xb814('0x48'))['omitBy'](function(_0x544d36,_0x5d26be){return _0x544d36[_0xb814('0x4b')]['custom']===!![];})[_0xb814('0x32')]()['forEach'](function(_0x411723){var _0x44ff56=_0x6f15d3[_0x411723];if(as[_0xb814('0x4c')](_0x44ff56[_0xb814('0x4d')])){var _0x4fae23=_[_0xb814('0x4e')](_0x44ff56[_0xb814('0x4d')])[0x0];_0x4fae23[_0xb814('0x4f')](function(_0x22cf27){if(!_0x44ff56[_0xb814('0x4b')][_0xb814('0x50')]){_0x51cdba[_0x42653f](_0x44ff56['options'][_0xb814('0x51')]+'.'+_0x411723+'\x20'+as[_0xb814('0x52')](_0x22cf27),as[_0xb814('0x53')](_0x22cf27));}});}else if(as[_0xb814('0x54')](_0x44ff56[_0xb814('0x4d')])){_0x51cdba[_0x42653f](_0x44ff56[_0xb814('0x4b')][_0xb814('0x51')]+'.'+_0x411723+'\x20BETWEEN\x20?\x20AND\x20?',_0x44ff56['value'][_0xb814('0x55')],_0x44ff56[_0xb814('0x4d')][_0xb814('0x56')]);}else{if(_0x44ff56[_0xb814('0x4b')][_0xb814('0x50')]){var _0x40e627=as[_0xb814('0x53')](_0x44ff56[_0xb814('0x4d')]);if(_0x40e627[_0xb814('0x38')]===0x1){if(_0x40e627==0x1){_0x26675a[_0xb814('0x50')]('`'+_0x411723+_0xb814('0x57'));}else{_0x26675a['having']('`'+_0x411723+_0xb814('0x58'));}}}else{_0x51cdba[_0x42653f](_0x44ff56[_0xb814('0x4b')]['table']+'.'+_0x411723+'\x20'+as[_0xb814('0x52')](_0x44ff56['value']),as[_0xb814('0x53')](_0x44ff56[_0xb814('0x4d')]));}}});}else{var _0xc71270=_(Object[_0xb814('0x32')](_0x9008b2[_0xb814('0x35')]))[_0xb814('0x59')](function(_0x2cc806){return _0x526610[_0xb814('0x39')](_0x2cc806)?_0x2cc806:undefined;})[_0xb814('0x5a')](function(_0x2a422a){return!_['isNil'](_0x2a422a);})['value']();if(_0x9008b2[_0xb814('0x35')][_0xb814('0x5b')])_0xc71270[_0xb814('0x5c')](_0xb814('0x5b'));if(!_[_0xb814('0x5d')](_0xc71270)){_0xc71270[_0xb814('0x4f')](function(_0x135208){if(_0x135208==='ListId'){_0x26675a[_0xb814('0x44')](_0xb814('0x5e'),[][_0xb814('0x5f')](_0x9008b2['query'][_0x135208]));}else if(_0x135208===_0xb814('0x5b')){var _0x4e6f3c='%'+_0x9008b2[_0xb814('0x35')][_0x135208]+'%';_0x26675a['where'](_0xb814('0x60'),_0x4e6f3c,_0x4e6f3c,_0x4e6f3c);}else{_0x26675a[_0xb814('0x44')]('c.'+_0x135208+'\x20=\x20?',_0x9008b2[_0xb814('0x35')][_0x135208]);}});}if(_0x9008b2[_0xb814('0x35')][_0xb814('0x5a')]){var _0x5209d1=_0x9008b2[_0xb814('0x35')]['filter'][_0xb814('0x61')]('\x5c','\x5c\x5c')[_0xb814('0x61')]('\x27\x27','\x27\x27\x27\x27');if(qs[_0xb814('0x62')](_0x5209d1)){_0x51cdba['or']('c.id\x20LIKE\x20?',_0x5209d1+'%');_0x51cdba['or']('c.phone\x20LIKE\x20?',_0x5209d1+'%');_0x51cdba['or'](_0xb814('0x63'),_0x5209d1+'%');_0x51cdba['or'](_0xb814('0x64'),_0x5209d1+'%');}else if(qs[_0xb814('0x65')](_0x5209d1)){_0x51cdba['or']('c.email\x20LIKE\x20?',_0x5209d1+'%');}else{_0x51cdba['or'](_0xb814('0x66'),_0x5209d1+'%');_0x51cdba['or']('c.firstName\x20LIKE\x20?',_0x5209d1+'%');_0x51cdba['or'](_0xb814('0x67'),_0x5209d1+'%');}}}_0x26675a[_0xb814('0x44')](_0x51cdba);_0x26675a['group'](_0xb814('0x68'));_0x26675a['group'](_0xb814('0x69'));var _0x1656ed={'type':db[_0xb814('0x6a')][_0xb814('0x6b')][_0xb814('0x6c')],'raw':!![]};var _0x34acca=_0x26675a[_0xb814('0x6d')]()[_0xb814('0x3f')]('c.id');if(_0x530744[_0xb814('0x3c')]){_0x530744[_0xb814('0x3c')]['forEach'](function(_0x29a127){_0x26675a[_0xb814('0x3c')]('c.'+_0x29a127[0x0],_0x29a127[0x1]==='DESC'?![]:!![]);});}var _0x371000=[];var _0x58b9a6=squel['expr']();if(!_0x6f15d3){if(_0x9008b2[_0xb814('0x35')]['tag']){_0x371000=_[_0xb814('0x6e')](_0x9008b2[_0xb814('0x35')][_0xb814('0x6f')])?_0x9008b2['query'][_0xb814('0x6f')]:new Array(_0x9008b2['query'][_0xb814('0x6f')]);_0x371000[_0xb814('0x4f')](function(_0x1236d4){_0x58b9a6['or'](_0xb814('0x70'),'%,'+_0x1236d4+',%');});_0x26675a[_0xb814('0x50')](_0x58b9a6);_0x34acca[_0xb814('0x71')](_0xb814('0x72'),'ct',_0xb814('0x73'));_0x34acca[_0xb814('0x71')]('tools_tags','t',_0xb814('0x74'));_0x34acca[_0xb814('0x44')](_0xb814('0x75'),_0x371000);}}else{if(_0x6f15d3[_0xb814('0x39')](_0xb814('0x76'))){if(as[_0xb814('0x4c')](_0x6f15d3['TagId'][_0xb814('0x4d')])){var _0x4ccd94=_[_0xb814('0x4e')](_0x6f15d3[_0xb814('0x76')][_0xb814('0x4d')])[0x0];_0x4ccd94['forEach'](function(_0x150e73){as['getConditionValue'](_0x150e73)[_0xb814('0x4f')](function(_0x4a65d0){_0x371000[_0xb814('0x5c')](_0x4a65d0);});});}else{_0x371000=as[_0xb814('0x53')](_0x6f15d3[_0xb814('0x76')][_0xb814('0x4d')]);}_0x371000[_0xb814('0x4f')](function(_0x167d82){_0x58b9a6['or'](_0xb814('0x70'),'%,'+_0x167d82+',%');});_0x26675a['having'](_0x58b9a6);_0x34acca[_0xb814('0x71')]('cm_contact_has_tags','ct',_0xb814('0x73'));_0x34acca[_0xb814('0x71')](_0xb814('0x41'),'t',_0xb814('0x74'));_0x34acca[_0xb814('0x44')](_0xb814('0x75'),_0x371000);}}db['sequelize'][_0xb814('0x35')](_0x467cf9[_0xb814('0x77')](),_0x1656ed)['then'](function(_0x3bb2b4){_0xd77d96=_[_0xb814('0x78')](_0x3bb2b4,'id');return db[_0xb814('0x79')][_0xb814('0x35')](_0x34acca[_0xb814('0x77')](),_0x1656ed);})['then'](function(_0x3a4d4b){_0x20577b['count']=_0x3a4d4b[_0xb814('0x38')];_0x1656ed=_[_0xb814('0x7a')](_0x1656ed,{'model':db[_0xb814('0x30')],'mapToModel':!![],'raw':!![],'nest':!![]});_0x26675a[_0xb814('0x3f')](_0xb814('0x68'));_0x26675a[_0xb814('0x3f')]('c.firstName');_0x26675a['field']('c.lastName');_0x26675a[_0xb814('0x3f')]('c.phone');_0x26675a[_0xb814('0x3f')](_0xb814('0x7b'));_0x26675a[_0xb814('0x3f')]('c.fax');_0x26675a[_0xb814('0x3f')](_0xb814('0x7c'));_0x26675a[_0xb814('0x3f')]('c.ListId');_0x26675a[_0xb814('0x3f')](_0xb814('0x7d'));_0x26675a[_0xb814('0x3f')](_0xb814('0x7e'));_0x26675a['field']('uc.UserId');_0x26675a[_0xb814('0x3f')](_0xb814('0x7f'),_0xb814('0x80'));_0x26675a[_0xb814('0x71')](_0xb814('0x72'),'ct',_0xb814('0x73'));_0x26675a[_0xb814('0x71')](_0xb814('0x41'),'t',_0xb814('0x74'));if(_0x530744[_0xb814('0x3b')]){_0x26675a[_0xb814('0x3b')](_0x530744[_0xb814('0x3b')]);}if(_0x530744[_0xb814('0x24')]){_0x26675a[_0xb814('0x24')](_0x530744[_0xb814('0x24')]);}db['sequelize'][_0xb814('0x35')](_0x26675a[_0xb814('0x77')](),_0x1656ed)[_0xb814('0x2b')](function(_0x357b90){_0x357b90[_0xb814('0x4f')](function(_0x283b0f){if(_0x283b0f['TagIds']){_0x283b0f[_0xb814('0x81')]=[];_0x283b0f['TagIds'][_0xb814('0x82')](',')[_0xb814('0x4f')](function(_0x3c5a58){_0x283b0f[_0xb814('0x81')][_0xb814('0x5c')](_0xd77d96[_0x3c5a58]);});}delete _0x283b0f['TagIds'];});_0x20577b['rows']=_0x357b90;return _0x20577b;})[_0xb814('0x2b')](respondWithFilteredResult(_0x37d24d,_0x530744))[_0xb814('0x83')](handleError(_0x37d24d,null));});});};exports[_0xb814('0x2a')]=function(_0x1cbf0c,_0x488ef2){return db[_0xb814('0x30')]['find']({'where':{'id':_0x1cbf0c[_0xb814('0x84')]['id']}})[_0xb814('0x2b')](handleEntityNotFound(_0x488ef2,null))['then'](removeEntity(_0x488ef2,null))['catch'](handleError(_0x488ef2,null));};exports[_0xb814('0x85')]=function(_0x52e17a,_0x3e9222){return db[_0xb814('0x30')][_0xb814('0x85')]()[_0xb814('0x2b')](function(_0x46784f){for(var _0x420bde=0x0;_0x420bde=_0x459eb1){_0x106033=_0x459eb1;_0x205fd6=0xc8;}else{_0x205fd6=0xce;}_0x48f32d[_0x0a9e('0x1c')](_0x205fd6);return _0x48f32d[_0x0a9e('0x21')](_0x0a9e('0x22'),_0x478723+'-'+_0x106033+'/'+_0x459eb1)[_0x0a9e('0x1d')](_0x5a0a06);}return null;};}function patchUpdates(_0x4bb1e3){return function(_0x2c3407){try{jsonpatch[_0x0a9e('0x23')](_0x2c3407,_0x4bb1e3,!![]);}catch(_0x53682f){return BPromise[_0x0a9e('0x24')](_0x53682f);}return _0x2c3407['save']();};}function saveUpdates(_0x588269,_0x3a02e1){return function(_0x432e56){if(_0x432e56){return _0x432e56[_0x0a9e('0x25')](_0x588269)[_0x0a9e('0x26')](function(_0x4abc77){return _0x4abc77;});}return null;};}function removeEntity(_0xfb6e48,_0x2fb0e4){return function(_0x3b45bc){if(_0x3b45bc){return _0x3b45bc[_0x0a9e('0x27')]()[_0x0a9e('0x26')](function(){_0xfb6e48[_0x0a9e('0x1c')](0xcc)[_0x0a9e('0x1b')]();});}};}function handleEntityNotFound(_0x5ea472,_0x59181e){return function(_0x197ec0){if(!_0x197ec0){_0x5ea472[_0x0a9e('0x1a')](0x194);}return _0x197ec0;};}function handleError(_0x40c424,_0x33161b){_0x33161b=_0x33161b||0x1f4;return function(_0x526cf3){logger[_0x0a9e('0x28')](_0x526cf3['stack']);if(_0x526cf3[_0x0a9e('0x29')]){delete _0x526cf3['name'];}_0x40c424[_0x0a9e('0x1c')](_0x33161b)[_0x0a9e('0x2a')](_0x526cf3);};}exports[_0x0a9e('0x2b')]=function(_0x14433c,_0x140511){var _0x1538a4={},_0x11c3b6={},_0x14de77={'count':0x0,'rows':[]};return db['CmContact'][_0x0a9e('0x2c')]()[_0x0a9e('0x26')](function(_0x2b1f27){_0x11c3b6[_0x0a9e('0x2d')]=_['keys'](_0x2b1f27);_0x11c3b6[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x14433c[_0x0a9e('0x2e')]);_0x11c3b6[_0x0a9e('0x30')]=_[_0x0a9e('0x31')](_0x11c3b6[_0x0a9e('0x2d')],_0x11c3b6[_0x0a9e('0x2e')]);_0x1538a4[_0x0a9e('0x32')]=_[_0x0a9e('0x31')](_0x11c3b6['model'],qs[_0x0a9e('0x33')](_0x14433c['query'][_0x0a9e('0x33')]));_0x1538a4[_0x0a9e('0x32')]=_0x1538a4[_0x0a9e('0x32')][_0x0a9e('0x34')]?_0x1538a4[_0x0a9e('0x32')]:_0x11c3b6['model'];if(!_0x14433c[_0x0a9e('0x2e')][_0x0a9e('0x35')](_0x0a9e('0x36'))){_0x1538a4[_0x0a9e('0x20')]=qs[_0x0a9e('0x20')](_0x14433c[_0x0a9e('0x2e')][_0x0a9e('0x20')]);_0x1538a4[_0x0a9e('0x1f')]=qs['offset'](_0x14433c[_0x0a9e('0x2e')]['offset']);}_0x1538a4[_0x0a9e('0x37')]=qs[_0x0a9e('0x38')](_0x14433c[_0x0a9e('0x2e')][_0x0a9e('0x38')]);_0x1538a4['where']=qs[_0x0a9e('0x30')](_[_0x0a9e('0x39')](_0x14433c[_0x0a9e('0x2e')],_0x11c3b6[_0x0a9e('0x30')]));var _0x4853b1=[];var _0x54135e=squel[_0x0a9e('0x3a')]()['field']('id')[_0x0a9e('0x3b')](_0x0a9e('0x29'))[_0x0a9e('0x3b')](_0x0a9e('0x3c'))['from'](_0x0a9e('0x3d'));var _0x3bfce8=squel[_0x0a9e('0x3a')]()['from'](_0x0a9e('0x3e'),'c')[_0x0a9e('0x3f')](_0x0a9e('0x40'),'uc','uc.CmContactId\x20=\x20c.id')['where'](_0x0a9e('0x41'));var _0x40d766=squel['expr']();var _0x2b814e=_0x14433c[_0x0a9e('0x2e')][_0x0a9e('0x42')]?JSON[_0x0a9e('0x43')](_0x14433c['query']['advancedFilter']):undefined;if(_0x2b814e){var _0x15e37d=_0x2b814e[_0x0a9e('0x44')]['substr'](0x1);_(_0x2b814e)[_0x0a9e('0x45')](_0x0a9e('0x44'))[_0x0a9e('0x46')](function(_0x5b4f5e,_0x316c8f){return _0x5b4f5e[_0x0a9e('0x47')][_0x0a9e('0x48')]===!![];})[_0x0a9e('0x2f')]()[_0x0a9e('0x49')](function(_0xeaa5e5){var _0x2881b3=_0x2b814e[_0xeaa5e5];if(as[_0x0a9e('0x4a')](_0x2881b3[_0x0a9e('0x4b')])){var _0x3da2cd=_[_0x0a9e('0x4c')](_0x2881b3[_0x0a9e('0x4b')])[0x0];_0x3da2cd[_0x0a9e('0x49')](function(_0x11ca30){if(!_0x2881b3[_0x0a9e('0x47')]['having']){_0x40d766[_0x15e37d](_0x2881b3['options'][_0x0a9e('0x4d')]+'.'+_0xeaa5e5+'\x20'+as[_0x0a9e('0x4e')](_0x11ca30),as[_0x0a9e('0x4f')](_0x11ca30));}});}else if(as[_0x0a9e('0x50')](_0x2881b3[_0x0a9e('0x4b')])){_0x40d766[_0x15e37d](_0x2881b3[_0x0a9e('0x47')][_0x0a9e('0x4d')]+'.'+_0xeaa5e5+_0x0a9e('0x51'),_0x2881b3[_0x0a9e('0x4b')][_0x0a9e('0x52')],_0x2881b3[_0x0a9e('0x4b')][_0x0a9e('0x53')]);}else{if(_0x2881b3['options'][_0x0a9e('0x54')]){var _0x138b8b=as[_0x0a9e('0x4f')](_0x2881b3[_0x0a9e('0x4b')]);if(_0x138b8b[_0x0a9e('0x34')]===0x1){if(_0x138b8b==0x1){_0x3bfce8[_0x0a9e('0x54')]('`'+_0xeaa5e5+_0x0a9e('0x55'));}else{_0x3bfce8[_0x0a9e('0x54')]('`'+_0xeaa5e5+'`\x20>\x200');}}}else{_0x40d766[_0x15e37d](_0x2881b3[_0x0a9e('0x47')]['table']+'.'+_0xeaa5e5+'\x20'+as[_0x0a9e('0x4e')](_0x2881b3[_0x0a9e('0x4b')]),as[_0x0a9e('0x4f')](_0x2881b3['value']));}}});}else{var _0x14bec2=_(Object[_0x0a9e('0x2f')](_0x14433c[_0x0a9e('0x2e')]))[_0x0a9e('0x56')](function(_0x45c845){return _0x2b1f27[_0x0a9e('0x35')](_0x45c845)?_0x45c845:undefined;})[_0x0a9e('0x57')](function(_0x5bbcde){return!_[_0x0a9e('0x58')](_0x5bbcde);})[_0x0a9e('0x4b')]();if(_0x14433c[_0x0a9e('0x2e')][_0x0a9e('0x59')])_0x14bec2[_0x0a9e('0x5a')](_0x0a9e('0x59'));if(!_[_0x0a9e('0x5b')](_0x14bec2)){_0x14bec2[_0x0a9e('0x49')](function(_0x34febd){if(_0x34febd==='ListId'){_0x3bfce8[_0x0a9e('0x5c')](_0x0a9e('0x5d'),[]['concat'](_0x14433c['query'][_0x34febd]));}else if(_0x34febd==='Contact'){var _0x1adfee='%'+_0x14433c[_0x0a9e('0x2e')][_0x34febd]+'%';_0x3bfce8[_0x0a9e('0x5c')](_0x0a9e('0x5e'),_0x1adfee,_0x1adfee,_0x1adfee);}else{_0x3bfce8[_0x0a9e('0x5c')]('c.'+_0x34febd+_0x0a9e('0x5f'),_0x14433c[_0x0a9e('0x2e')][_0x34febd]);}});}if(_0x14433c[_0x0a9e('0x2e')]['filter']){var _0x4b1b9f=_0x14433c['query'][_0x0a9e('0x57')][_0x0a9e('0x60')]('\x5c','\x5c\x5c')[_0x0a9e('0x60')]('\x27\x27','\x27\x27\x27\x27');if(qs[_0x0a9e('0x61')](_0x4b1b9f)){_0x40d766['or'](_0x0a9e('0x62'),_0x4b1b9f+'%');_0x40d766['or']('c.phone\x20LIKE\x20?',_0x4b1b9f+'%');_0x40d766['or']('c.mobile\x20LIKE\x20?',_0x4b1b9f+'%');_0x40d766['or'](_0x0a9e('0x63'),_0x4b1b9f+'%');}else if(qs['isEmail'](_0x4b1b9f)){_0x40d766['or'](_0x0a9e('0x64'),_0x4b1b9f+'%');}else{_0x40d766['or']('c.email\x20LIKE\x20?',_0x4b1b9f+'%');_0x40d766['or'](_0x0a9e('0x65'),_0x4b1b9f+'%');_0x40d766['or'](_0x0a9e('0x66'),_0x4b1b9f+'%');}}}_0x3bfce8[_0x0a9e('0x5c')](_0x40d766);_0x3bfce8['group'](_0x0a9e('0x67'));var _0x1bf38a={'type':db['Sequelize']['QueryTypes'][_0x0a9e('0x68')],'raw':!![]};var _0x3aedd0=_0x3bfce8['clone']()[_0x0a9e('0x3b')]('c.id');if(_0x1538a4[_0x0a9e('0x37')]){_0x1538a4['order'][_0x0a9e('0x49')](function(_0x4a6deb){_0x3bfce8['order']('c.'+_0x4a6deb[0x0],_0x4a6deb[0x1]==='DESC'?![]:!![]);});}var _0x2da03c=[];var _0x47de4c=squel[_0x0a9e('0x69')]();if(!_0x2b814e){if(_0x14433c[_0x0a9e('0x2e')][_0x0a9e('0x6a')]){_0x2da03c=_[_0x0a9e('0x6b')](_0x14433c[_0x0a9e('0x2e')][_0x0a9e('0x6a')])?_0x14433c[_0x0a9e('0x2e')][_0x0a9e('0x6a')]:new Array(_0x14433c['query'][_0x0a9e('0x6a')]);_0x2da03c[_0x0a9e('0x49')](function(_0x2642bb){_0x47de4c['or'](_0x0a9e('0x6c'),'%,'+_0x2642bb+',%');});_0x3bfce8[_0x0a9e('0x54')](_0x47de4c);_0x3aedd0[_0x0a9e('0x3f')]('cm_contact_has_tags','ct',_0x0a9e('0x6d'));_0x3aedd0[_0x0a9e('0x3f')]('tools_tags','t',_0x0a9e('0x6e'));_0x3aedd0['where'](_0x0a9e('0x6f'),_0x2da03c);}}else{if(_0x2b814e['hasOwnProperty']('TagId')){if(as['hasMultipleConditions'](_0x2b814e[_0x0a9e('0x70')]['value'])){var _0x2244d6=_[_0x0a9e('0x4c')](_0x2b814e[_0x0a9e('0x70')][_0x0a9e('0x4b')])[0x0];_0x2244d6[_0x0a9e('0x49')](function(_0x26d7db){as['getConditionValue'](_0x26d7db)[_0x0a9e('0x49')](function(_0x5854cc){_0x2da03c[_0x0a9e('0x5a')](_0x5854cc);});});}else{_0x2da03c=as[_0x0a9e('0x4f')](_0x2b814e[_0x0a9e('0x70')]['value']);}_0x2da03c[_0x0a9e('0x49')](function(_0x156f1c){_0x47de4c['or'](_0x0a9e('0x6c'),'%,'+_0x156f1c+',%');});_0x3bfce8[_0x0a9e('0x54')](_0x47de4c);_0x3aedd0['left_join'](_0x0a9e('0x71'),'ct',_0x0a9e('0x6d'));_0x3aedd0['left_join'](_0x0a9e('0x3d'),'t',_0x0a9e('0x6e'));_0x3aedd0[_0x0a9e('0x5c')](_0x0a9e('0x6f'),_0x2da03c);}}db[_0x0a9e('0x72')]['query'](_0x54135e[_0x0a9e('0x73')](),_0x1bf38a)[_0x0a9e('0x26')](function(_0x281c7d){_0x4853b1=_['keyBy'](_0x281c7d,'id');return db[_0x0a9e('0x72')]['query'](_0x3aedd0['toString'](),_0x1bf38a);})[_0x0a9e('0x26')](function(_0x4556c5){_0x14de77[_0x0a9e('0x1e')]=_0x4556c5[_0x0a9e('0x34')];_0x1bf38a=_[_0x0a9e('0x74')](_0x1bf38a,{'model':db[_0x0a9e('0x75')],'mapToModel':!![],'raw':!![],'nest':!![]});_0x3bfce8[_0x0a9e('0x3b')](_0x0a9e('0x67'));_0x3bfce8[_0x0a9e('0x3b')](_0x0a9e('0x76'));_0x3bfce8[_0x0a9e('0x3b')](_0x0a9e('0x77'));_0x3bfce8[_0x0a9e('0x3b')](_0x0a9e('0x78'));_0x3bfce8[_0x0a9e('0x3b')](_0x0a9e('0x79'));_0x3bfce8[_0x0a9e('0x3b')](_0x0a9e('0x7a'));_0x3bfce8['field'](_0x0a9e('0x7b'));_0x3bfce8[_0x0a9e('0x3b')](_0x0a9e('0x7c'));_0x3bfce8['field'](_0x0a9e('0x7d'));_0x3bfce8[_0x0a9e('0x3b')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x0a9e('0x7e'));_0x3bfce8[_0x0a9e('0x3f')](_0x0a9e('0x71'),'ct',_0x0a9e('0x6d'));_0x3bfce8[_0x0a9e('0x3f')]('tools_tags','t','t.id\x20=\x20ct.TagId');if(_0x1538a4['limit']){_0x3bfce8[_0x0a9e('0x20')](_0x1538a4[_0x0a9e('0x20')]);}if(_0x1538a4[_0x0a9e('0x1f')]){_0x3bfce8[_0x0a9e('0x1f')](_0x1538a4[_0x0a9e('0x1f')]);}db[_0x0a9e('0x72')][_0x0a9e('0x2e')](_0x3bfce8[_0x0a9e('0x73')](),_0x1bf38a)['then'](function(_0x235f8f){_0x235f8f[_0x0a9e('0x49')](function(_0x12ccdb){if(_0x12ccdb['TagIds']){_0x12ccdb[_0x0a9e('0x7f')]=[];_0x12ccdb['TagIds'][_0x0a9e('0x80')](',')[_0x0a9e('0x49')](function(_0x4c46c1){_0x12ccdb[_0x0a9e('0x7f')][_0x0a9e('0x5a')](_0x4853b1[_0x4c46c1]);});}delete _0x12ccdb[_0x0a9e('0x7e')];});_0x14de77[_0x0a9e('0x81')]=_0x235f8f;return _0x14de77;})['then'](respondWithFilteredResult(_0x140511,_0x1538a4))[_0x0a9e('0x82')](handleError(_0x140511,null));});});};exports[_0x0a9e('0x27')]=function(_0x371533,_0x278ab4){return db['CmContact'][_0x0a9e('0x83')]({'where':{'id':_0x371533[_0x0a9e('0x84')]['id']}})[_0x0a9e('0x26')](handleEntityNotFound(_0x278ab4,null))[_0x0a9e('0x26')](removeEntity(_0x278ab4,null))['catch'](handleError(_0x278ab4,null));};exports[_0x0a9e('0x2c')]=function(_0x3511c9,_0x30a4c7){return db[_0x0a9e('0x75')][_0x0a9e('0x2c')]()[_0x0a9e('0x26')](function(_0x40fc56){for(var _0x3df0e3=0x0;_0x3df0e3{}\s\\|]/g,'-');_0x29dd6e(null,util[_0x031f('0x21')]('%s-%s%s',path['basename'](_0x345bde[_0x031f('0x1f')],path['extname'](_0x345bde[_0x031f('0x1f')])),Date['now'](),path['extname'](_0x345bde['originalname'])));}})});router[_0x031f('0x16')](_0x031f('0x22'),upload[_0x031f('0x23')](_0x031f('0x24')),controller['uploadCsv']);var upload=multer({'storage':multer[_0x031f('0x1b')]({'destination':function(_0x5a64c0,_0x40cb1c,_0x1f5a14){_0x1f5a14(null,path[_0x031f('0x1c')](config['root'],_0x031f('0x1e')));},'filename':function(_0x3b2a51,_0x54b44e,_0x3847b2){_0x54b44e[_0x031f('0x1f')]=_0x54b44e[_0x031f('0x1f')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x3847b2(null,util[_0x031f('0x21')](_0x031f('0x25'),path[_0x031f('0x26')](_0x54b44e[_0x031f('0x1f')],path[_0x031f('0x27')](_0x54b44e[_0x031f('0x1f')])),Date['now'](),path[_0x031f('0x27')](_0x54b44e[_0x031f('0x1f')])));}})});router[_0x031f('0x16')](_0x031f('0x28'),upload[_0x031f('0x23')](_0x031f('0x24')),controller[_0x031f('0x29')]);router[_0x031f('0x16')](_0x031f('0x2a'),auth[_0x031f('0xb')](),controller[_0x031f('0x2b')]);router['put'](_0x031f('0xa'),auth[_0x031f('0xb')](),controller[_0x031f('0x2c')]);router[_0x031f('0x2d')](_0x031f('0xa'),auth[_0x031f('0xb')](),controller[_0x031f('0x2e')]);module[_0x031f('0x2f')]=router; \ No newline at end of file +var _0xa630=['%s-%s%s','now','extname','/csv','single','file','server/files/tmp','basename','upload','/upload/:id','import','update','delete','destroy','multer','util','express','../../components/auth/service','../../config/environment','./cmContact.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/tags','getTags','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getJscriptySessions','post','/merge','merge','bulkCreate','setTags','diskStorage','join','originalname','replace','format'];(function(_0x30063a,_0x4a55c8){var _0x2024d2=function(_0x54df95){while(--_0x54df95){_0x30063a['push'](_0x30063a['shift']());}};_0x2024d2(++_0x4a55c8);}(_0xa630,0xbe));var _0x0a63=function(_0x50da12,_0x539fc7){_0x50da12=_0x50da12-0x0;var _0x39f689=_0xa630[_0x50da12];return _0x39f689;};'use strict';var multer=require(_0x0a63('0x0'));var util=require(_0x0a63('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x0a63('0x2'));var router=express['Router']();var auth=require(_0x0a63('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x0a63('0x4'));var controller=require(_0x0a63('0x5'));router[_0x0a63('0x6')]('/',auth[_0x0a63('0x7')](),controller[_0x0a63('0x8')]);router['get'](_0x0a63('0x9'),auth[_0x0a63('0x7')](),controller[_0x0a63('0xa')]);router[_0x0a63('0x6')](_0x0a63('0xb'),auth[_0x0a63('0x7')](),controller['show']);router[_0x0a63('0x6')](_0x0a63('0xc'),auth[_0x0a63('0x7')](),controller[_0x0a63('0xd')]);router[_0x0a63('0x6')](_0x0a63('0xe'),auth[_0x0a63('0x7')](),controller[_0x0a63('0xf')]);router[_0x0a63('0x6')](_0x0a63('0x10'),auth['isAuthenticated'](),controller[_0x0a63('0x11')]);router[_0x0a63('0x6')](_0x0a63('0x12'),auth[_0x0a63('0x7')](),controller['getHopperFinals']);router[_0x0a63('0x6')]('/:id/jscripty_sessions',auth[_0x0a63('0x7')](),controller[_0x0a63('0x13')]);router[_0x0a63('0x14')](_0x0a63('0x15'),auth[_0x0a63('0x7')](),controller[_0x0a63('0x16')]);router[_0x0a63('0x14')]('/',auth[_0x0a63('0x7')](),controller['create']);router[_0x0a63('0x14')]('/create_many',auth[_0x0a63('0x7')](),controller[_0x0a63('0x17')]);router[_0x0a63('0x14')](_0x0a63('0xc'),auth[_0x0a63('0x7')](),controller[_0x0a63('0x18')]);var upload=multer({'storage':multer[_0x0a63('0x19')]({'destination':function(_0x374c52,_0x2fd06c,_0x3cc74d){_0x3cc74d(null,path[_0x0a63('0x1a')](config['root'],'server/files/tmp'));},'filename':function(_0x7b2ccd,_0x586190,_0x2fc87c){_0x586190['originalname']=_0x586190[_0x0a63('0x1b')][_0x0a63('0x1c')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x2fc87c(null,util[_0x0a63('0x1d')](_0x0a63('0x1e'),path['basename'](_0x586190[_0x0a63('0x1b')],path['extname'](_0x586190[_0x0a63('0x1b')])),Date[_0x0a63('0x1f')](),path[_0x0a63('0x20')](_0x586190[_0x0a63('0x1b')])));}})});router[_0x0a63('0x14')](_0x0a63('0x21'),upload[_0x0a63('0x22')](_0x0a63('0x23')),controller['uploadCsv']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x55fb70,_0x4c8637,_0xeacfc9){_0xeacfc9(null,path['join'](config['root'],_0x0a63('0x24')));},'filename':function(_0x1d5448,_0x362d6a,_0x2e2526){_0x362d6a['originalname']=_0x362d6a[_0x0a63('0x1b')][_0x0a63('0x1c')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x2e2526(null,util[_0x0a63('0x1d')]('%s-%s%s',path[_0x0a63('0x25')](_0x362d6a[_0x0a63('0x1b')],path[_0x0a63('0x20')](_0x362d6a[_0x0a63('0x1b')])),Date[_0x0a63('0x1f')](),path[_0x0a63('0x20')](_0x362d6a[_0x0a63('0x1b')])));}})});router[_0x0a63('0x14')]('/upload',upload[_0x0a63('0x22')]('file'),controller[_0x0a63('0x26')]);router[_0x0a63('0x14')](_0x0a63('0x27'),auth[_0x0a63('0x7')](),controller[_0x0a63('0x28')]);router['put'](_0x0a63('0xb'),auth[_0x0a63('0x7')](),controller[_0x0a63('0x29')]);router[_0x0a63('0x2a')]('/:id',auth[_0x0a63('0x7')](),controller[_0x0a63('0x2b')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.attributes.js b/server/api/cmCustomField/cmCustomField.attributes.js index 61ab522..2f7dbbd 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 _0xbc9c=['alias','STRING','setDataValue','name','TEXT','long','getDataValue','type','select','parse','values','stringify','BOOLEAN','sequelize','lodash','exports','VIRTUAL'];(function(_0x2c9dcd,_0x130a83){var _0x21ae9f=function(_0x5ae48b){while(--_0x5ae48b){_0x2c9dcd['push'](_0x2c9dcd['shift']());}};_0x21ae9f(++_0x130a83);}(_0xbc9c,0x84));var _0xcbc9=function(_0x5826ea,_0x244064){_0x5826ea=_0x5826ea-0x0;var _0x105fec=_0xbc9c[_0x5826ea];return _0x105fec;};'use strict';var Sequelize=require(_0xcbc9('0x0'));var _=require(_0xcbc9('0x1'));module[_0xcbc9('0x2')]={'name':{'type':Sequelize[_0xcbc9('0x3')],'get':function(_0x229269){return this['getDataValue'](_0xcbc9('0x4'));}},'alias':{'type':Sequelize[_0xcbc9('0x5')],'allowNull':![],'set':function(_0x3fbc8c){this[_0xcbc9('0x6')]('alias',_0x3fbc8c?_0x3fbc8c:this['getDataValue'](_0xcbc9('0x7')));}},'type':{'type':Sequelize[_0xcbc9('0x5')],'allowNull':![]},'values':{'type':Sequelize[_0xcbc9('0x8')](_0xcbc9('0x9')),'get':function(){if(this[_0xcbc9('0xa')](_0xcbc9('0xb'))===_0xcbc9('0xc')){return JSON[_0xcbc9('0xd')](this[_0xcbc9('0xa')](_0xcbc9('0xe')));}else{return this['getDataValue'](_0xcbc9('0xe'));}},'set':function(_0x1db6eb){if(Array['isArray'](_0x1db6eb)){this[_0xcbc9('0x6')]('values',JSON[_0xcbc9('0xf')](_0x1db6eb));}else{this[_0xcbc9('0x6')](_0xcbc9('0xe'),_0x1db6eb);}}},'required':{'type':Sequelize[_0xcbc9('0x10')],'defaultValue':![]}}; \ No newline at end of file +var _0x4ae8=['parse','isArray','setDataValue','values','BOOLEAN','sequelize','exports','getDataValue','alias','STRING','name','TEXT','select'];(function(_0x342700,_0x569f75){var _0x53406f=function(_0x3b3c32){while(--_0x3b3c32){_0x342700['push'](_0x342700['shift']());}};_0x53406f(++_0x569f75);}(_0x4ae8,0x18b));var _0x84ae=function(_0x2d184f,_0x47ab54){_0x2d184f=_0x2d184f-0x0;var _0x282cad=_0x4ae8[_0x2d184f];return _0x282cad;};'use strict';var Sequelize=require(_0x84ae('0x0'));var _=require('lodash');module[_0x84ae('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x425e28){return this[_0x84ae('0x2')](_0x84ae('0x3'));}},'alias':{'type':Sequelize[_0x84ae('0x4')],'allowNull':![],'set':function(_0x2028ba){this['setDataValue'](_0x84ae('0x3'),_0x2028ba?_0x2028ba:this[_0x84ae('0x2')](_0x84ae('0x5')));}},'type':{'type':Sequelize[_0x84ae('0x4')],'allowNull':![]},'values':{'type':Sequelize[_0x84ae('0x6')]('long'),'get':function(){if(this['getDataValue']('type')===_0x84ae('0x7')){return JSON[_0x84ae('0x8')](this[_0x84ae('0x2')]('values'));}else{return this['getDataValue']('values');}},'set':function(_0x16c6ca){if(Array[_0x84ae('0x9')](_0x16c6ca)){this[_0x84ae('0xa')](_0x84ae('0xb'),JSON['stringify'](_0x16c6ca));}else{this[_0x84ae('0xa')](_0x84ae('0xb'),_0x16c6ca);}}},'required':{'type':Sequelize[_0x84ae('0xc')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.controller.js b/server/api/cmCustomField/cmCustomField.controller.js index ba388fc..fa4aef6 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 _0x8856=['desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','end','count','offset','status','set','json','apply','save','update','then','destroy','error','stack','name','CmCustomField','rawAttributes','model','differenceBy','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filter','merge','map','type','key','VIRTUAL','field','includeAll','include','findAll','catch','show','params','find','body','create','sequelize','transaction','TEXT','text','Sequelize','INTEGER','switch','BOOLEAN','defaultValue','addColumn','cf_%d','html-pdf','eml-format','fast-json-patch','request-promise','moment','util','path','sox','to-csv','lodash','squel'];(function(_0x255d5b,_0x4f6f35){var _0x3e141a=function(_0x249ee2){while(--_0x249ee2){_0x255d5b['push'](_0x255d5b['shift']());}};_0x3e141a(++_0x4f6f35);}(_0x8856,0xe2));var _0x6885=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x8856[_0x321bb2];return _0x9c12ed;};'use strict';var pdf=require(_0x6885('0x0'));var emlformat=require(_0x6885('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x6885('0x2'));var rp=require(_0x6885('0x3'));var moment=require(_0x6885('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x6885('0x5'));var path=require(_0x6885('0x6'));var sox=require(_0x6885('0x7'));var csv=require(_0x6885('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x6885('0x9'));var squel=require(_0x6885('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x6885('0xb'));var toCsv=require(_0x6885('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x6885('0xc'));var authService=require(_0x6885('0xd'));var qs=require(_0x6885('0xe'));var as=require(_0x6885('0xf'));var hardwareService=require(_0x6885('0x10'));var logger=require(_0x6885('0x11'))('api');var utils=require(_0x6885('0x12'));var config=require(_0x6885('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x67bcf5,_0x39755c){_0x39755c=_0x39755c||0xcc;return function(_0x131f06){if(_0x131f06){return _0x67bcf5[_0x6885('0x14')](_0x39755c);}return _0x67bcf5['status'](_0x39755c)[_0x6885('0x15')]();};}function respondWithResult(_0x3c11ec,_0x996fb7){_0x996fb7=_0x996fb7||0xc8;return function(_0xbf126e){if(_0xbf126e){return _0x3c11ec['status'](_0x996fb7)['json'](_0xbf126e);}};}function respondWithFilteredResult(_0x39e309,_0x3c4b1c){return function(_0x1fa763){if(_0x1fa763){var _0xfc0ec1=_0x1fa763[_0x6885('0x16')],_0x59b6fd=_0x3c4b1c[_0x6885('0x17')],_0x36ed0b=_0x3c4b1c[_0x6885('0x17')]+_0x3c4b1c['limit'],_0x6e2c3f;if(_0x36ed0b>=_0xfc0ec1){_0x36ed0b=_0xfc0ec1;_0x6e2c3f=0xc8;}else{_0x6e2c3f=0xce;}_0x39e309[_0x6885('0x18')](_0x6e2c3f);return _0x39e309[_0x6885('0x19')]('Content-Range',_0x59b6fd+'-'+_0x36ed0b+'/'+_0xfc0ec1)[_0x6885('0x1a')](_0x1fa763);}return null;};}function patchUpdates(_0x51cc02){return function(_0x24d43b){try{jsonpatch[_0x6885('0x1b')](_0x24d43b,_0x51cc02,!![]);}catch(_0x50b175){return BPromise['reject'](_0x50b175);}return _0x24d43b[_0x6885('0x1c')]();};}function saveUpdates(_0x4caed7,_0xfef076){return function(_0x2e95d7){if(_0x2e95d7){return _0x2e95d7[_0x6885('0x1d')](_0x4caed7)[_0x6885('0x1e')](function(_0x53c991){return _0x53c991;});}return null;};}function removeEntity(_0x445984,_0x55cd94){return function(_0x5981e7){if(_0x5981e7){return _0x5981e7[_0x6885('0x1f')]()[_0x6885('0x1e')](function(){_0x445984[_0x6885('0x18')](0xcc)[_0x6885('0x15')]();});}};}function handleEntityNotFound(_0x41bebb,_0xda996f){return function(_0x3472d0){if(!_0x3472d0){_0x41bebb['sendStatus'](0x194);}return _0x3472d0;};}function handleError(_0x291c5b,_0x746410){_0x746410=_0x746410||0x1f4;return function(_0x408ae5){logger[_0x6885('0x20')](_0x408ae5[_0x6885('0x21')]);if(_0x408ae5[_0x6885('0x22')]){delete _0x408ae5[_0x6885('0x22')];}_0x291c5b[_0x6885('0x18')](_0x746410)['send'](_0x408ae5);};}exports['index']=function(_0x56e846,_0x76adc){var _0x4cd158={},_0x3bc779={},_0x6ce2b2={'count':0x0,'rows':[]};var _0x5392bd=db[_0x6885('0x23')][_0x6885('0x24')];_0x3bc779[_0x6885('0x25')]=_[_0x6885('0x26')](_[_0x6885('0x27')](_0x5392bd),[_0x6885('0x22')]);_0x3bc779[_0x6885('0x28')]=_[_0x6885('0x27')](_0x56e846[_0x6885('0x28')]);_0x3bc779[_0x6885('0x29')]=_[_0x6885('0x2a')](_0x3bc779['model'],_0x3bc779[_0x6885('0x28')]);_0x4cd158[_0x6885('0x2b')]=_[_0x6885('0x2a')](_0x3bc779[_0x6885('0x25')],qs[_0x6885('0x2c')](_0x56e846[_0x6885('0x28')][_0x6885('0x2c')]));_0x4cd158[_0x6885('0x2b')]=_0x4cd158[_0x6885('0x2b')][_0x6885('0x2d')]?_0x4cd158[_0x6885('0x2b')]:_0x3bc779[_0x6885('0x25')];if(!_0x56e846['query'][_0x6885('0x2e')](_0x6885('0x2f'))){_0x4cd158[_0x6885('0x30')]=qs[_0x6885('0x30')](_0x56e846[_0x6885('0x28')]['limit']);_0x4cd158['offset']=qs[_0x6885('0x17')](_0x56e846[_0x6885('0x28')]['offset']);}_0x4cd158[_0x6885('0x31')]=qs[_0x6885('0x32')](_0x56e846[_0x6885('0x28')][_0x6885('0x32')]);_0x4cd158[_0x6885('0x33')]=qs['filters'](_['pick'](_0x56e846[_0x6885('0x28')],_0x3bc779[_0x6885('0x29')]));if(_0x56e846['query'][_0x6885('0x34')]){_0x4cd158['where']=_[_0x6885('0x35')](_0x4cd158[_0x6885('0x33')],{'$or':_[_0x6885('0x36')](_0x5392bd,function(_0x4d0229){if(_0x4d0229[_0x6885('0x37')][_0x6885('0x38')]!==_0x6885('0x39')){var _0x51b124={};_0x51b124[_0x4d0229[_0x6885('0x3a')]]={'$like':'%'+_0x56e846[_0x6885('0x28')][_0x6885('0x34')]+'%'};return _0x51b124;}})});}_0x4cd158=_[_0x6885('0x35')]({},_0x4cd158,_0x56e846['options']);var _0x3185d4={'where':_0x4cd158[_0x6885('0x33')]};return db[_0x6885('0x23')][_0x6885('0x16')](_0x3185d4)[_0x6885('0x1e')](function(_0x5bc212){_0x6ce2b2[_0x6885('0x16')]=_0x5bc212;if(_0x56e846[_0x6885('0x28')][_0x6885('0x3b')]){_0x4cd158[_0x6885('0x3c')]=[{'all':!![]}];}return db[_0x6885('0x23')][_0x6885('0x3d')](_0x4cd158);})[_0x6885('0x1e')](function(_0x22ce75){_0x6ce2b2['rows']=_0x22ce75;return _0x6ce2b2;})[_0x6885('0x1e')](respondWithFilteredResult(_0x76adc,_0x4cd158))[_0x6885('0x3e')](handleError(_0x76adc,null));};exports[_0x6885('0x3f')]=function(_0x3b92b8,_0x3e41cf){var _0x484dd7={'raw':!![],'where':{'id':_0x3b92b8[_0x6885('0x40')]['id']}},_0x27dcd3={};_0x27dcd3[_0x6885('0x25')]=_[_0x6885('0x27')](db[_0x6885('0x23')][_0x6885('0x24')]);_0x27dcd3[_0x6885('0x28')]=_[_0x6885('0x27')](_0x3b92b8[_0x6885('0x28')]);_0x27dcd3[_0x6885('0x29')]=_['intersection'](_0x27dcd3['model'],_0x27dcd3[_0x6885('0x28')]);_0x484dd7[_0x6885('0x2b')]=_[_0x6885('0x2a')](_0x27dcd3[_0x6885('0x25')],qs[_0x6885('0x2c')](_0x3b92b8[_0x6885('0x28')][_0x6885('0x2c')]));_0x484dd7['attributes']=_0x484dd7[_0x6885('0x2b')][_0x6885('0x2d')]?_0x484dd7[_0x6885('0x2b')]:_0x27dcd3[_0x6885('0x25')];if(_0x3b92b8[_0x6885('0x28')]['includeAll']){_0x484dd7[_0x6885('0x3c')]=[{'all':!![]}];}_0x484dd7=_[_0x6885('0x35')]({},_0x484dd7,_0x3b92b8['options']);return db[_0x6885('0x23')][_0x6885('0x41')](_0x484dd7)[_0x6885('0x1e')](handleEntityNotFound(_0x3e41cf,null))[_0x6885('0x1e')](respondWithResult(_0x3e41cf,null))['catch'](handleError(_0x3e41cf,null));};exports['update']=function(_0x4773c8,_0x1e893e){if(_0x4773c8[_0x6885('0x42')]['id']){delete _0x4773c8[_0x6885('0x42')]['id'];}return db[_0x6885('0x23')][_0x6885('0x41')]({'where':{'id':_0x4773c8[_0x6885('0x40')]['id']}})['then'](handleEntityNotFound(_0x1e893e,null))[_0x6885('0x1e')](saveUpdates(_0x4773c8[_0x6885('0x42')],null))[_0x6885('0x1e')](respondWithResult(_0x1e893e,null))[_0x6885('0x3e')](handleError(_0x1e893e,null));};exports['destroy']=function(_0x10c736,_0x3d7d4b){return db[_0x6885('0x23')][_0x6885('0x41')]({'where':{'id':_0x10c736[_0x6885('0x40')]['id']}})['then'](handleEntityNotFound(_0x3d7d4b,null))['then'](removeEntity(_0x3d7d4b,null))[_0x6885('0x3e')](handleError(_0x3d7d4b,null));};exports[_0x6885('0x43')]=function(_0x3db273,_0x4515a3){var _0x3fe569;return db[_0x6885('0x44')][_0x6885('0x45')](function(_0x1954dc){return db[_0x6885('0x23')][_0x6885('0x43')](_0x3db273['body'],{'transaction':_0x1954dc})[_0x6885('0x1e')](function(_0xabd6f1){_0x3fe569=_0xabd6f1;var _0x229b09={'type':db['Sequelize'][_0x6885('0x46')],'transaction':_0x1954dc};switch(_0x3db273[_0x6885('0x42')][_0x6885('0x37')]){case _0x6885('0x47'):_0x229b09[_0x6885('0x37')]=db[_0x6885('0x48')][_0x6885('0x46')];break;case'number':_0x229b09[_0x6885('0x37')]=db[_0x6885('0x48')][_0x6885('0x49')];break;case _0x6885('0x4a'):_0x229b09['type']=db[_0x6885('0x48')][_0x6885('0x4b')];_0x229b09[_0x6885('0x4c')]=![];break;default:}return db[_0x6885('0x44')]['queryInterface'][_0x6885('0x4d')]('cm_contacts',util['format'](_0x6885('0x4e'),_0x3fe569['id']),_0x229b09);})[_0x6885('0x1e')](function(){return _0x3fe569;});})['then'](respondWithResult(_0x4515a3,0xc9))[_0x6885('0x3e')](handleError(_0x4515a3,null));}; \ No newline at end of file +var _0xb62e=['then','includeAll','include','findAll','rows','show','length','options','find','update','params','body','catch','create','sequelize','transaction','TEXT','text','Sequelize','number','INTEGER','BOOLEAN','defaultValue','queryInterface','addColumn','cm_contacts','format','cf_%d','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','save','destroy','end','error','name','send','index','CmCustomField','model','differenceBy','query','keys','filters','attributes','intersection','fields','nolimit','order','sort','where','merge','map','type','key','field','filter'];(function(_0x2a565e,_0x315c87){var _0x240697=function(_0x4eabe7){while(--_0x4eabe7){_0x2a565e['push'](_0x2a565e['shift']());}};_0x240697(++_0x315c87);}(_0xb62e,0x1de));var _0xeb62=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0xb62e[_0x3bf83f];return _0x22c4a9;};'use strict';var pdf=require(_0xeb62('0x0'));var emlformat=require(_0xeb62('0x1'));var rimraf=require(_0xeb62('0x2'));var zipdir=require(_0xeb62('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xeb62('0x4'));var moment=require(_0xeb62('0x5'));var BPromise=require(_0xeb62('0x6'));var Mustache=require(_0xeb62('0x7'));var util=require(_0xeb62('0x8'));var path=require(_0xeb62('0x9'));var sox=require('sox');var csv=require(_0xeb62('0xa'));var ejs=require(_0xeb62('0xb'));var fs=require('fs');var _=require(_0xeb62('0xc'));var squel=require('squel');var crypto=require(_0xeb62('0xd'));var jsforce=require(_0xeb62('0xe'));var deskjs=require(_0xeb62('0xf'));var toCsv=require(_0xeb62('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xeb62('0x10'));var authService=require(_0xeb62('0x11'));var qs=require(_0xeb62('0x12'));var as=require(_0xeb62('0x13'));var hardwareService=require(_0xeb62('0x14'));var logger=require(_0xeb62('0x15'))(_0xeb62('0x16'));var utils=require(_0xeb62('0x17'));var config=require(_0xeb62('0x18'));var db=require(_0xeb62('0x19'))['db'];function respondWithStatusCode(_0x4a493c,_0x422daf){_0x422daf=_0x422daf||0xcc;return function(_0xcc11c4){if(_0xcc11c4){return _0x4a493c[_0xeb62('0x1a')](_0x422daf);}return _0x4a493c[_0xeb62('0x1b')](_0x422daf)['end']();};}function respondWithResult(_0x333126,_0x2fbad2){_0x2fbad2=_0x2fbad2||0xc8;return function(_0x23fb15){if(_0x23fb15){return _0x333126['status'](_0x2fbad2)[_0xeb62('0x1c')](_0x23fb15);}};}function respondWithFilteredResult(_0x195837,_0x2fd4c7){return function(_0x4ce9fa){if(_0x4ce9fa){var _0x1f6a1f=_0x4ce9fa[_0xeb62('0x1d')],_0x15b3e8=_0x2fd4c7[_0xeb62('0x1e')],_0x184106=_0x2fd4c7[_0xeb62('0x1e')]+_0x2fd4c7[_0xeb62('0x1f')],_0x353e2c;if(_0x184106>=_0x1f6a1f){_0x184106=_0x1f6a1f;_0x353e2c=0xc8;}else{_0x353e2c=0xce;}_0x195837[_0xeb62('0x1b')](_0x353e2c);return _0x195837[_0xeb62('0x20')](_0xeb62('0x21'),_0x15b3e8+'-'+_0x184106+'/'+_0x1f6a1f)[_0xeb62('0x1c')](_0x4ce9fa);}return null;};}function patchUpdates(_0x3cdf76){return function(_0x5a07bb){try{jsonpatch[_0xeb62('0x22')](_0x5a07bb,_0x3cdf76,!![]);}catch(_0x130e2f){return BPromise[_0xeb62('0x23')](_0x130e2f);}return _0x5a07bb[_0xeb62('0x24')]();};}function saveUpdates(_0x425817,_0x24cbf3){return function(_0x2ed96d){if(_0x2ed96d){return _0x2ed96d['update'](_0x425817)['then'](function(_0x1fbfaa){return _0x1fbfaa;});}return null;};}function removeEntity(_0x154451,_0x11ed9c){return function(_0x13243f){if(_0x13243f){return _0x13243f[_0xeb62('0x25')]()['then'](function(){_0x154451['status'](0xcc)[_0xeb62('0x26')]();});}};}function handleEntityNotFound(_0x132861,_0x182781){return function(_0x395b70){if(!_0x395b70){_0x132861['sendStatus'](0x194);}return _0x395b70;};}function handleError(_0x4e92f5,_0x3ef988){_0x3ef988=_0x3ef988||0x1f4;return function(_0x4dbc2c){logger[_0xeb62('0x27')](_0x4dbc2c['stack']);if(_0x4dbc2c[_0xeb62('0x28')]){delete _0x4dbc2c['name'];}_0x4e92f5[_0xeb62('0x1b')](_0x3ef988)[_0xeb62('0x29')](_0x4dbc2c);};}exports[_0xeb62('0x2a')]=function(_0x4e4268,_0x3ef784){var _0x3ae031={},_0x5222f4={},_0xe8872c={'count':0x0,'rows':[]};var _0x42f486=db[_0xeb62('0x2b')]['rawAttributes'];_0x5222f4[_0xeb62('0x2c')]=_[_0xeb62('0x2d')](_['keys'](_0x42f486),[_0xeb62('0x28')]);_0x5222f4[_0xeb62('0x2e')]=_[_0xeb62('0x2f')](_0x4e4268[_0xeb62('0x2e')]);_0x5222f4[_0xeb62('0x30')]=_['intersection'](_0x5222f4['model'],_0x5222f4[_0xeb62('0x2e')]);_0x3ae031[_0xeb62('0x31')]=_[_0xeb62('0x32')](_0x5222f4[_0xeb62('0x2c')],qs[_0xeb62('0x33')](_0x4e4268[_0xeb62('0x2e')][_0xeb62('0x33')]));_0x3ae031['attributes']=_0x3ae031[_0xeb62('0x31')]['length']?_0x3ae031['attributes']:_0x5222f4[_0xeb62('0x2c')];if(!_0x4e4268[_0xeb62('0x2e')]['hasOwnProperty'](_0xeb62('0x34'))){_0x3ae031['limit']=qs[_0xeb62('0x1f')](_0x4e4268[_0xeb62('0x2e')]['limit']);_0x3ae031[_0xeb62('0x1e')]=qs[_0xeb62('0x1e')](_0x4e4268['query'][_0xeb62('0x1e')]);}_0x3ae031[_0xeb62('0x35')]=qs[_0xeb62('0x36')](_0x4e4268[_0xeb62('0x2e')]['sort']);_0x3ae031[_0xeb62('0x37')]=qs[_0xeb62('0x30')](_['pick'](_0x4e4268['query'],_0x5222f4[_0xeb62('0x30')]));if(_0x4e4268[_0xeb62('0x2e')]['filter']){_0x3ae031[_0xeb62('0x37')]=_[_0xeb62('0x38')](_0x3ae031[_0xeb62('0x37')],{'$or':_[_0xeb62('0x39')](_0x42f486,function(_0x21f604){if(_0x21f604[_0xeb62('0x3a')][_0xeb62('0x3b')]!=='VIRTUAL'){var _0x54ea4b={};_0x54ea4b[_0x21f604[_0xeb62('0x3c')]]={'$like':'%'+_0x4e4268[_0xeb62('0x2e')][_0xeb62('0x3d')]+'%'};return _0x54ea4b;}})});}_0x3ae031=_[_0xeb62('0x38')]({},_0x3ae031,_0x4e4268['options']);var _0x834232={'where':_0x3ae031['where']};return db[_0xeb62('0x2b')][_0xeb62('0x1d')](_0x834232)[_0xeb62('0x3e')](function(_0x136c5a){_0xe8872c[_0xeb62('0x1d')]=_0x136c5a;if(_0x4e4268[_0xeb62('0x2e')][_0xeb62('0x3f')]){_0x3ae031[_0xeb62('0x40')]=[{'all':!![]}];}return db['CmCustomField'][_0xeb62('0x41')](_0x3ae031);})[_0xeb62('0x3e')](function(_0x429fe4){_0xe8872c[_0xeb62('0x42')]=_0x429fe4;return _0xe8872c;})['then'](respondWithFilteredResult(_0x3ef784,_0x3ae031))['catch'](handleError(_0x3ef784,null));};exports[_0xeb62('0x43')]=function(_0x41fb7d,_0x5e86d8){var _0x1f7036={'raw':!![],'where':{'id':_0x41fb7d['params']['id']}},_0x44a325={};_0x44a325[_0xeb62('0x2c')]=_['keys'](db[_0xeb62('0x2b')]['rawAttributes']);_0x44a325[_0xeb62('0x2e')]=_['keys'](_0x41fb7d[_0xeb62('0x2e')]);_0x44a325[_0xeb62('0x30')]=_[_0xeb62('0x32')](_0x44a325['model'],_0x44a325['query']);_0x1f7036[_0xeb62('0x31')]=_[_0xeb62('0x32')](_0x44a325[_0xeb62('0x2c')],qs[_0xeb62('0x33')](_0x41fb7d[_0xeb62('0x2e')]['fields']));_0x1f7036[_0xeb62('0x31')]=_0x1f7036['attributes'][_0xeb62('0x44')]?_0x1f7036['attributes']:_0x44a325[_0xeb62('0x2c')];if(_0x41fb7d['query'][_0xeb62('0x3f')]){_0x1f7036['include']=[{'all':!![]}];}_0x1f7036=_[_0xeb62('0x38')]({},_0x1f7036,_0x41fb7d[_0xeb62('0x45')]);return db[_0xeb62('0x2b')][_0xeb62('0x46')](_0x1f7036)[_0xeb62('0x3e')](handleEntityNotFound(_0x5e86d8,null))[_0xeb62('0x3e')](respondWithResult(_0x5e86d8,null))['catch'](handleError(_0x5e86d8,null));};exports[_0xeb62('0x47')]=function(_0x1b3e2c,_0x574573){if(_0x1b3e2c['body']['id']){delete _0x1b3e2c['body']['id'];}return db['CmCustomField'][_0xeb62('0x46')]({'where':{'id':_0x1b3e2c[_0xeb62('0x48')]['id']}})['then'](handleEntityNotFound(_0x574573,null))[_0xeb62('0x3e')](saveUpdates(_0x1b3e2c[_0xeb62('0x49')],null))[_0xeb62('0x3e')](respondWithResult(_0x574573,null))[_0xeb62('0x4a')](handleError(_0x574573,null));};exports[_0xeb62('0x25')]=function(_0x555812,_0xfb8cc7){return db['CmCustomField'][_0xeb62('0x46')]({'where':{'id':_0x555812[_0xeb62('0x48')]['id']}})[_0xeb62('0x3e')](handleEntityNotFound(_0xfb8cc7,null))[_0xeb62('0x3e')](removeEntity(_0xfb8cc7,null))[_0xeb62('0x4a')](handleError(_0xfb8cc7,null));};exports[_0xeb62('0x4b')]=function(_0x321e55,_0x184c01){var _0x19c6fb;return db[_0xeb62('0x4c')][_0xeb62('0x4d')](function(_0x13e102){return db['CmCustomField'][_0xeb62('0x4b')](_0x321e55['body'],{'transaction':_0x13e102})['then'](function(_0x2dcb2d){_0x19c6fb=_0x2dcb2d;var _0x31fd4a={'type':db['Sequelize'][_0xeb62('0x4e')],'transaction':_0x13e102};switch(_0x321e55[_0xeb62('0x49')]['type']){case _0xeb62('0x4f'):_0x31fd4a[_0xeb62('0x3a')]=db[_0xeb62('0x50')][_0xeb62('0x4e')];break;case _0xeb62('0x51'):_0x31fd4a[_0xeb62('0x3a')]=db[_0xeb62('0x50')][_0xeb62('0x52')];break;case'switch':_0x31fd4a[_0xeb62('0x3a')]=db['Sequelize'][_0xeb62('0x53')];_0x31fd4a[_0xeb62('0x54')]=![];break;default:}return db[_0xeb62('0x4c')][_0xeb62('0x55')][_0xeb62('0x56')](_0xeb62('0x57'),util[_0xeb62('0x58')](_0xeb62('0x59'),_0x19c6fb['id']),_0x31fd4a);})['then'](function(){return _0x19c6fb;});})['then'](respondWithResult(_0x184c01,0xc9))['catch'](handleError(_0x184c01,null));}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.model.js b/server/api/cmCustomField/cmCustomField.model.js index ad93fbb..349df3a 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 _0x1d91=['lodash','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./cmCustomField.attributes','exports','CmCustomField','cm_custom_fields'];(function(_0x40dc0a,_0x25a76f){var _0x158c04=function(_0x428e14){while(--_0x428e14){_0x40dc0a['push'](_0x40dc0a['shift']());}};_0x158c04(++_0x25a76f);}(_0x1d91,0x150));var _0x11d9=function(_0x5640cf,_0x49a56e){_0x5640cf=_0x5640cf-0x0;var _0x332a58=_0x1d91[_0x5640cf];return _0x332a58;};'use strict';var _=require(_0x11d9('0x0'));var util=require(_0x11d9('0x1'));var logger=require(_0x11d9('0x2'))('api');var moment=require(_0x11d9('0x3'));var BPromise=require(_0x11d9('0x4'));var rp=require(_0x11d9('0x5'));var fs=require('fs');var path=require(_0x11d9('0x6'));var rimraf=require('rimraf');var config=require(_0x11d9('0x7'));var attributes=require(_0x11d9('0x8'));module[_0x11d9('0x9')]=function(_0x4b27dd,_0x564b2b){return _0x4b27dd['define'](_0x11d9('0xa'),attributes,{'tableName':_0x11d9('0xb'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x552c=['path','rimraf','../../config/environment','exports','define','CmCustomField','cm_custom_fields','lodash','util','api','moment','bluebird','request-promise'];(function(_0x2642cb,_0x4b917f){var _0xe6e41=function(_0x281676){while(--_0x281676){_0x2642cb['push'](_0x2642cb['shift']());}};_0xe6e41(++_0x4b917f);}(_0x552c,0x6f));var _0xc552=function(_0x91d498,_0x482a89){_0x91d498=_0x91d498-0x0;var _0x1e0294=_0x552c[_0x91d498];return _0x1e0294;};'use strict';var _=require(_0xc552('0x0'));var util=require(_0xc552('0x1'));var logger=require('../../config/logger')(_0xc552('0x2'));var moment=require(_0xc552('0x3'));var BPromise=require(_0xc552('0x4'));var rp=require(_0xc552('0x5'));var fs=require('fs');var path=require(_0xc552('0x6'));var rimraf=require(_0xc552('0x7'));var config=require(_0xc552('0x8'));var attributes=require('./cmCustomField.attributes');module[_0xc552('0x9')]=function(_0x539535,_0x5ee408){return _0x539535[_0xc552('0xa')](_0xc552('0xb'),attributes,{'tableName':_0xc552('0xc'),'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 336320b..b006a7d 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 _0xec56=['http','request','then','CmCustomField,\x20%s,\x20%s','request\x20sent','debug','CmCustomField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x2235bf,_0x3a06a7){var _0x4c3a64=function(_0x3b3bb6){while(--_0x3b3bb6){_0x2235bf['push'](_0x2235bf['shift']());}};_0x4c3a64(++_0x3a06a7);}(_0xec56,0x1bd));var _0x6ec5=function(_0xd7bc7a,_0x437f58){_0xd7bc7a=_0xd7bc7a-0x0;var _0x5153d5=_0xec56[_0xd7bc7a];return _0x5153d5;};'use strict';var _=require(_0x6ec5('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x6ec5('0x1'));var rs=require(_0x6ec5('0x2'));var fs=require('fs');var Redis=require(_0x6ec5('0x3'));var db=require(_0x6ec5('0x4'))['db'];var utils=require(_0x6ec5('0x5'));var logger=require(_0x6ec5('0x6'))(_0x6ec5('0x7'));var config=require(_0x6ec5('0x8'));var jayson=require(_0x6ec5('0x9'));var client=jayson[_0x6ec5('0xa')][_0x6ec5('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3bb683,_0x35be4e,_0x1f59cd){return new BPromise(function(_0x3dd891,_0x225d2f){return client[_0x6ec5('0xc')](_0x3bb683,_0x1f59cd)[_0x6ec5('0xd')](function(_0x3ff17c){logger['info'](_0x6ec5('0xe'),_0x35be4e,_0x6ec5('0xf'));logger[_0x6ec5('0x10')](_0x6ec5('0x11'),_0x35be4e,_0x6ec5('0xf'),JSON[_0x6ec5('0x12')](_0x3ff17c));if(_0x3ff17c[_0x6ec5('0x13')]){if(_0x3ff17c['error'][_0x6ec5('0x14')]===0x1f4){logger[_0x6ec5('0x13')](_0x6ec5('0xe'),_0x35be4e,_0x3ff17c[_0x6ec5('0x13')][_0x6ec5('0x15')]);return _0x225d2f(_0x3ff17c[_0x6ec5('0x13')][_0x6ec5('0x15')]);}logger[_0x6ec5('0x13')]('CmCustomField,\x20%s,\x20%s',_0x35be4e,_0x3ff17c[_0x6ec5('0x13')]['message']);return _0x3dd891(_0x3ff17c[_0x6ec5('0x13')][_0x6ec5('0x15')]);}else{logger[_0x6ec5('0x16')](_0x6ec5('0xe'),_0x35be4e,_0x6ec5('0xf'));_0x3dd891(_0x3ff17c['result'][_0x6ec5('0x15')]);}})[_0x6ec5('0x17')](function(_0x125ae6){logger[_0x6ec5('0x13')](_0x6ec5('0xe'),_0x35be4e,_0x125ae6);_0x225d2f(_0x125ae6);});});} \ No newline at end of file +var _0x00bb=['stringify','error','message','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','request','info','CmCustomField,\x20%s,\x20%s','request\x20sent','debug','CmCustomField,\x20%s,\x20%s,\x20%s'];(function(_0x5e721f,_0x440c13){var _0x3030a2=function(_0x4dc025){while(--_0x4dc025){_0x5e721f['push'](_0x5e721f['shift']());}};_0x3030a2(++_0x440c13);}(_0x00bb,0x1d8));var _0xb00b=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0x00bb[_0x4fc9e6];return _0x551d28;};'use strict';var _=require(_0xb00b('0x0'));var util=require(_0xb00b('0x1'));var moment=require(_0xb00b('0x2'));var BPromise=require('bluebird');var rs=require(_0xb00b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb00b('0x4'))['db'];var utils=require(_0xb00b('0x5'));var logger=require('../../config/logger')(_0xb00b('0x6'));var config=require(_0xb00b('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x36e363,_0xf737d0,_0x41dfc9){return new BPromise(function(_0x37f07d,_0xfa4181){return client[_0xb00b('0x8')](_0x36e363,_0x41dfc9)['then'](function(_0x51d12b){logger[_0xb00b('0x9')](_0xb00b('0xa'),_0xf737d0,_0xb00b('0xb'));logger[_0xb00b('0xc')](_0xb00b('0xd'),_0xf737d0,'request\x20sent',JSON[_0xb00b('0xe')](_0x51d12b));if(_0x51d12b['error']){if(_0x51d12b['error']['code']===0x1f4){logger[_0xb00b('0xf')](_0xb00b('0xa'),_0xf737d0,_0x51d12b[_0xb00b('0xf')][_0xb00b('0x10')]);return _0xfa4181(_0x51d12b[_0xb00b('0xf')][_0xb00b('0x10')]);}logger['error'](_0xb00b('0xa'),_0xf737d0,_0x51d12b[_0xb00b('0xf')]['message']);return _0x37f07d(_0x51d12b[_0xb00b('0xf')][_0xb00b('0x10')]);}else{logger['info']('CmCustomField,\x20%s,\x20%s',_0xf737d0,_0xb00b('0xb'));_0x37f07d(_0x51d12b['result']['message']);}})[_0xb00b('0x11')](function(_0x638443){logger[_0xb00b('0xf')](_0xb00b('0xa'),_0xf737d0,_0x638443);_0xfa4181(_0x638443);});});} \ No newline at end of file diff --git a/server/api/cmCustomField/index.js b/server/api/cmCustomField/index.js index e13290f..af2d155 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 _0xd9b4=['isAuthenticated','show','post','create','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','index','/:id'];(function(_0x5f3f88,_0x562baf){var _0xd08119=function(_0x42dbf7){while(--_0x42dbf7){_0x5f3f88['push'](_0x5f3f88['shift']());}};_0xd08119(++_0x562baf);}(_0xd9b4,0x1c0));var _0x4d9b=function(_0x354ecb,_0x1e1f92){_0x354ecb=_0x354ecb-0x0;var _0x4f1ca7=_0xd9b4[_0x354ecb];return _0x4f1ca7;};'use strict';var multer=require(_0x4d9b('0x0'));var util=require(_0x4d9b('0x1'));var path=require(_0x4d9b('0x2'));var timeout=require(_0x4d9b('0x3'));var express=require(_0x4d9b('0x4'));var router=express[_0x4d9b('0x5')]();var auth=require(_0x4d9b('0x6'));var interaction=require(_0x4d9b('0x7'));var config=require('../../config/environment');var controller=require('./cmCustomField.controller');router[_0x4d9b('0x8')]('/',auth['isAuthenticated'](),controller[_0x4d9b('0x9')]);router[_0x4d9b('0x8')](_0x4d9b('0xa'),auth[_0x4d9b('0xb')](),controller[_0x4d9b('0xc')]);router[_0x4d9b('0xd')]('/',auth['isAuthenticated'](),controller[_0x4d9b('0xe')]);router['put'](_0x4d9b('0xa'),auth['isAuthenticated'](),controller['update']);router[_0x4d9b('0xf')]('/:id',auth[_0x4d9b('0xb')](),controller[_0x4d9b('0x10')]);module['exports']=router; \ No newline at end of file +var _0xd5b0=['create','put','update','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCustomField.controller','get','isAuthenticated','index','/:id','post'];(function(_0x3c8dcb,_0x59fa0d){var _0x140ecb=function(_0x4fa2dd){while(--_0x4fa2dd){_0x3c8dcb['push'](_0x3c8dcb['shift']());}};_0x140ecb(++_0x59fa0d);}(_0xd5b0,0x16e));var _0x0d5b=function(_0x186b63,_0x11fe78){_0x186b63=_0x186b63-0x0;var _0xe99d43=_0xd5b0[_0x186b63];return _0xe99d43;};'use strict';var multer=require(_0x0d5b('0x0'));var util=require(_0x0d5b('0x1'));var path=require(_0x0d5b('0x2'));var timeout=require(_0x0d5b('0x3'));var express=require('express');var router=express[_0x0d5b('0x4')]();var auth=require(_0x0d5b('0x5'));var interaction=require(_0x0d5b('0x6'));var config=require(_0x0d5b('0x7'));var controller=require(_0x0d5b('0x8'));router[_0x0d5b('0x9')]('/',auth[_0x0d5b('0xa')](),controller[_0x0d5b('0xb')]);router[_0x0d5b('0x9')](_0x0d5b('0xc'),auth['isAuthenticated'](),controller['show']);router[_0x0d5b('0xd')]('/',auth[_0x0d5b('0xa')](),controller[_0x0d5b('0xe')]);router[_0x0d5b('0xf')](_0x0d5b('0xc'),auth[_0x0d5b('0xa')](),controller[_0x0d5b('0x10')]);router['delete'](_0x0d5b('0xc'),auth['isAuthenticated'](),controller[_0x0d5b('0x11')]);module[_0x0d5b('0x12')]=router; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.attributes.js b/server/api/cmHopper/cmHopper.attributes.js index 5f9f6de..59ed1ab 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 _0x245c=['format','YYYY-MM-DD\x20HH:mm:ss','INTEGER','UNSIGNED','contactListQueue','sequelize','STRING','BOOLEAN','DATE'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x245c,0x10a));var _0xc245=function(_0x561569,_0x8efc61){_0x561569=_0x561569-0x0;var _0x1e7480=_0x245c[_0x561569];return _0x1e7480;};'use strict';var moment=require('moment');var Sequelize=require(_0xc245('0x0'));module['exports']={'phone':{'type':Sequelize[_0xc245('0x1')],'allowNull':![]},'active':{'type':Sequelize[_0xc245('0x2')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0xc245('0x3')],'defaultValue':moment()[_0xc245('0x4')](_0xc245('0x5'))},'countbusyretry':{'type':Sequelize[_0xc245('0x6')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xc245('0x6')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xc245('0x6')],'defaultValue':0x0},'callback':{'type':Sequelize[_0xc245('0x2')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'priority':{'type':Sequelize['INTEGER'](0x2)[_0xc245('0x7')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0xc245('0x2')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0xc245('0x6')],'unique':'contactListQueue'},'ListId':{'type':Sequelize[_0xc245('0x6')],'unique':_0xc245('0x8')},'UserId':{'type':Sequelize['INTEGER']},'VoiceQueueId':{'type':Sequelize[_0xc245('0x6')],'unique':_0xc245('0x8')},'CampaignId':{'type':Sequelize[_0xc245('0x6')]}}; \ No newline at end of file +var _0x2239=['STRING','BOOLEAN','DATE','format','YYYY-MM-DD\x20HH:mm:ss','INTEGER','UNSIGNED','contactListQueue','sequelize'];(function(_0x2c6949,_0x308b69){var _0x286b41=function(_0x43d44f){while(--_0x43d44f){_0x2c6949['push'](_0x2c6949['shift']());}};_0x286b41(++_0x308b69);}(_0x2239,0x18b));var _0x9223=function(_0x180e04,_0x256b4f){_0x180e04=_0x180e04-0x0;var _0x37f4fa=_0x2239[_0x180e04];return _0x37f4fa;};'use strict';var moment=require('moment');var Sequelize=require(_0x9223('0x0'));module['exports']={'phone':{'type':Sequelize[_0x9223('0x1')],'allowNull':![]},'active':{'type':Sequelize[_0x9223('0x2')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0x9223('0x3')],'defaultValue':moment()[_0x9223('0x4')](_0x9223('0x5'))},'countbusyretry':{'type':Sequelize[_0x9223('0x6')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x9223('0x6')],'defaultValue':0x0},'callback':{'type':Sequelize[_0x9223('0x2')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x9223('0x1')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x9223('0x3')]},'priority':{'type':Sequelize[_0x9223('0x6')](0x2)[_0x9223('0x7')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ContactId':{'type':Sequelize[_0x9223('0x6')],'unique':_0x9223('0x8')},'ListId':{'type':Sequelize['INTEGER'],'unique':_0x9223('0x8')},'UserId':{'type':Sequelize['INTEGER']},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':_0x9223('0x8')},'CampaignId':{'type':Sequelize[_0x9223('0x6')]}}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.controller.js b/server/api/cmHopper/cmHopper.controller.js index 040c2e7..6813d2a 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 _0x6777=['util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','limit','set','Content-Range','json','apply','reject','update','then','destroy','error','stack','name','send','index','rawAttributes','model','keys','query','filters','intersection','concat','$and','$or','$gt','$gte','$lt','$lte','$ne','$eq','$not','$notIn','$like','$iLike','$notILike','$overlap','$contains','$contained','$any','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','type','VIRTUAL','options','CmHopper','findAll','catch','show','params','includeAll','include','find','create','body','describe','CampaignId','VoiceQueue','Campaign','VoiceQueueId','omit','dataValues','createdAt','updatedAt','user','UserId','deleted','YYYY-MM-DD\x20HH:mm:ss','calleridnum','phone','campaigntype','CmContact','firstName','lastName','isNil','calleridname','finally','CmHopperFinal','getVoiceQueues','preview','dialOrderByScheduledAt','sequelize','direction','hopperIds','priority','ASC','scheduledAt','DESC','literal','COALESCE(CmHopper.UserId,\x200)\x20ASC','COALESCE(CmHopper.UserId,\x200)\x20DESC','LOCK','UPDATE','Contact','CmCompany','Company','CmList','Queue','getOpenContacts','format','isNumber','CmHopper,\x20%s,\x20%s,\x20%s','html-pdf','rimraf','fast-json-patch','moment','mustache'];(function(_0x29acf8,_0x5dbf0c){var _0x1b9af5=function(_0x760b53){while(--_0x760b53){_0x29acf8['push'](_0x29acf8['shift']());}};_0x1b9af5(++_0x5dbf0c);}(_0x6777,0x19c));var _0x7677=function(_0x200aa5,_0x197802){_0x200aa5=_0x200aa5-0x0;var _0x458200=_0x6777[_0x200aa5];return _0x458200;};'use strict';var pdf=require(_0x7677('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x7677('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7677('0x2'));var rp=require('request-promise');var moment=require(_0x7677('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x7677('0x4'));var util=require(_0x7677('0x5'));var path=require(_0x7677('0x6'));var sox=require(_0x7677('0x7'));var csv=require(_0x7677('0x8'));var ejs=require(_0x7677('0x9'));var fs=require('fs');var _=require(_0x7677('0xa'));var squel=require(_0x7677('0xb'));var crypto=require('crypto');var jsforce=require(_0x7677('0xc'));var deskjs=require(_0x7677('0xd'));var toCsv=require(_0x7677('0x8'));var querystring=require(_0x7677('0xe'));var Papa=require(_0x7677('0xf'));var Redis=require(_0x7677('0x10'));var authService=require(_0x7677('0x11'));var qs=require(_0x7677('0x12'));var as=require(_0x7677('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7677('0x14'))(_0x7677('0x15'));var utils=require('../../config/utils');var config=require(_0x7677('0x16'));var db=require(_0x7677('0x17'))['db'];function respondWithStatusCode(_0x29ddd2,_0x31af9b){_0x31af9b=_0x31af9b||0xcc;return function(_0x12ef5c){if(_0x12ef5c){return _0x29ddd2[_0x7677('0x18')](_0x31af9b);}return _0x29ddd2[_0x7677('0x19')](_0x31af9b)[_0x7677('0x1a')]();};}function respondWithResult(_0x3d26c1,_0x5cba2c){_0x5cba2c=_0x5cba2c||0xc8;return function(_0xb974ce){if(_0xb974ce){return _0x3d26c1[_0x7677('0x19')](_0x5cba2c)['json'](_0xb974ce);}};}function respondWithFilteredResult(_0x14e653,_0x13538a){return function(_0x3f4dfc){if(_0x3f4dfc){var _0x43175c=_0x3f4dfc[_0x7677('0x1b')],_0x153b51=_0x13538a[_0x7677('0x1c')],_0x27b114=_0x13538a[_0x7677('0x1c')]+_0x13538a[_0x7677('0x1d')],_0x361e51;if(_0x27b114>=_0x43175c){_0x27b114=_0x43175c;_0x361e51=0xc8;}else{_0x361e51=0xce;}_0x14e653[_0x7677('0x19')](_0x361e51);return _0x14e653[_0x7677('0x1e')](_0x7677('0x1f'),_0x153b51+'-'+_0x27b114+'/'+_0x43175c)[_0x7677('0x20')](_0x3f4dfc);}return null;};}function patchUpdates(_0xc5056f){return function(_0x3b778c){try{jsonpatch[_0x7677('0x21')](_0x3b778c,_0xc5056f,!![]);}catch(_0x36e0dd){return BPromise[_0x7677('0x22')](_0x36e0dd);}return _0x3b778c['save']();};}function saveUpdates(_0xd2cb8f,_0x2f9ffa){return function(_0x5ab022){if(_0x5ab022){return _0x5ab022[_0x7677('0x23')](_0xd2cb8f)[_0x7677('0x24')](function(_0xa15d41){return _0xa15d41;});}return null;};}function removeEntity(_0x5ace17,_0x59b533){return function(_0x577a8f){if(_0x577a8f){return _0x577a8f[_0x7677('0x25')]()[_0x7677('0x24')](function(){_0x5ace17['status'](0xcc)[_0x7677('0x1a')]();});}};}function handleEntityNotFound(_0x5e1f1d,_0x3e1dbf){return function(_0x3d7869){if(!_0x3d7869){_0x5e1f1d[_0x7677('0x18')](0x194);}return _0x3d7869;};}function handleError(_0x369652,_0x437417){_0x437417=_0x437417||0x1f4;return function(_0x1ce35b){logger[_0x7677('0x26')](_0x1ce35b[_0x7677('0x27')]);if(_0x1ce35b[_0x7677('0x28')]){delete _0x1ce35b[_0x7677('0x28')];}_0x369652[_0x7677('0x19')](_0x437417)[_0x7677('0x29')](_0x1ce35b);};}exports[_0x7677('0x2a')]=function(_0x221f0a,_0x433c3d){var _0x12436d={},_0x42b78e={},_0x571536={'count':0x0,'rows':[]};var _0x11d4a0=db['CmHopper'][_0x7677('0x2b')];_0x42b78e[_0x7677('0x2c')]=_[_0x7677('0x2d')](_0x11d4a0);_0x42b78e[_0x7677('0x2e')]=_[_0x7677('0x2d')](_0x221f0a[_0x7677('0x2e')]);_0x42b78e[_0x7677('0x2f')]=_[_0x7677('0x30')](_0x42b78e[_0x7677('0x2c')],_0x42b78e[_0x7677('0x2e')]);_0x42b78e['filters']=_[_0x7677('0x31')](_0x42b78e['filters'],[_0x7677('0x32'),_0x7677('0x33'),_0x7677('0x34'),_0x7677('0x35'),_0x7677('0x36'),_0x7677('0x37'),_0x7677('0x38'),_0x7677('0x39'),_0x7677('0x3a'),'$between','$notBetween','$in',_0x7677('0x3b'),_0x7677('0x3c'),'$notLike',_0x7677('0x3d'),_0x7677('0x3e'),_0x7677('0x3c'),_0x7677('0x3f'),_0x7677('0x40'),_0x7677('0x41'),_0x7677('0x42')]);_0x12436d[_0x7677('0x43')]=_[_0x7677('0x30')](_0x42b78e[_0x7677('0x2c')],qs[_0x7677('0x44')](_0x221f0a[_0x7677('0x2e')]['fields']));_0x12436d[_0x7677('0x43')]=_0x12436d[_0x7677('0x43')][_0x7677('0x45')]?_0x12436d[_0x7677('0x43')]:_0x42b78e[_0x7677('0x2c')];if(!_0x221f0a[_0x7677('0x2e')][_0x7677('0x46')](_0x7677('0x47'))){_0x12436d[_0x7677('0x1d')]=qs['limit'](_0x221f0a[_0x7677('0x2e')]['limit']);_0x12436d[_0x7677('0x1c')]=qs[_0x7677('0x1c')](_0x221f0a['query'][_0x7677('0x1c')]);}_0x12436d[_0x7677('0x48')]=qs[_0x7677('0x49')](_0x221f0a[_0x7677('0x2e')][_0x7677('0x49')]);_0x12436d[_0x7677('0x4a')]=qs['filters'](_[_0x7677('0x4b')](_0x221f0a[_0x7677('0x2e')],_0x42b78e[_0x7677('0x2f')]));if(_0x221f0a[_0x7677('0x2e')][_0x7677('0x4c')]){_0x12436d['where']=_[_0x7677('0x4d')](_0x12436d[_0x7677('0x4a')],{'$or':_[_0x7677('0x4e')](_0x11d4a0,function(_0x338f88){if(_0x338f88[_0x7677('0x4f')]['key']!==_0x7677('0x50')){var _0x54d625={};_0x54d625[_0x338f88['field']]={'$like':'%'+_0x221f0a[_0x7677('0x2e')][_0x7677('0x4c')]+'%'};return _0x54d625;}})});}_0x12436d=_[_0x7677('0x4d')]({},_0x12436d,_0x221f0a[_0x7677('0x51')]);var _0x3936c6={'where':_0x12436d[_0x7677('0x4a')]};return db[_0x7677('0x52')]['count'](_0x3936c6)[_0x7677('0x24')](function(_0x27d41b){_0x571536['count']=_0x27d41b;if(_0x221f0a[_0x7677('0x2e')]['includeAll']){_0x12436d['include']=[{'all':!![]}];}return db[_0x7677('0x52')][_0x7677('0x53')](_0x12436d);})[_0x7677('0x24')](function(_0x51c52e){_0x571536['rows']=_0x51c52e;return _0x571536;})[_0x7677('0x24')](respondWithFilteredResult(_0x433c3d,_0x12436d))[_0x7677('0x54')](handleError(_0x433c3d,null));};exports[_0x7677('0x55')]=function(_0x5e5e77,_0x2ce12e){var _0x17380a={'raw':!![],'where':{'id':_0x5e5e77[_0x7677('0x56')]['id']}},_0x39d2d9={};_0x39d2d9[_0x7677('0x2c')]=_[_0x7677('0x2d')](db[_0x7677('0x52')][_0x7677('0x2b')]);_0x39d2d9[_0x7677('0x2e')]=_[_0x7677('0x2d')](_0x5e5e77[_0x7677('0x2e')]);_0x39d2d9[_0x7677('0x2f')]=_[_0x7677('0x30')](_0x39d2d9[_0x7677('0x2c')],_0x39d2d9[_0x7677('0x2e')]);_0x17380a['attributes']=_[_0x7677('0x30')](_0x39d2d9[_0x7677('0x2c')],qs[_0x7677('0x44')](_0x5e5e77[_0x7677('0x2e')][_0x7677('0x44')]));_0x17380a['attributes']=_0x17380a[_0x7677('0x43')]['length']?_0x17380a[_0x7677('0x43')]:_0x39d2d9[_0x7677('0x2c')];if(_0x5e5e77[_0x7677('0x2e')][_0x7677('0x57')]){_0x17380a[_0x7677('0x58')]=[{'all':!![]}];}_0x17380a=_[_0x7677('0x4d')]({},_0x17380a,_0x5e5e77['options']);return db['CmHopper'][_0x7677('0x59')](_0x17380a)[_0x7677('0x24')](handleEntityNotFound(_0x2ce12e,null))['then'](respondWithResult(_0x2ce12e,null))[_0x7677('0x54')](handleError(_0x2ce12e,null));};exports[_0x7677('0x5a')]=function(_0x5abbc8,_0x4c10c8){return db['CmHopper']['create'](_0x5abbc8[_0x7677('0x5b')],{})['then'](respondWithResult(_0x4c10c8,0xc9))[_0x7677('0x54')](handleError(_0x4c10c8,null));};exports[_0x7677('0x23')]=function(_0x20dc9a,_0x383872){if(_0x20dc9a[_0x7677('0x5b')]['id']){delete _0x20dc9a[_0x7677('0x5b')]['id'];}return db[_0x7677('0x52')][_0x7677('0x59')]({'where':{'id':_0x20dc9a[_0x7677('0x56')]['id']}})[_0x7677('0x24')](handleEntityNotFound(_0x383872,null))[_0x7677('0x24')](saveUpdates(_0x20dc9a['body'],null))[_0x7677('0x24')](respondWithResult(_0x383872,null))[_0x7677('0x54')](handleError(_0x383872,null));};exports[_0x7677('0x5c')]=function(_0x375f37,_0x1c40e8){return db[_0x7677('0x52')][_0x7677('0x5c')]()['then'](respondWithResult(_0x1c40e8,null))['catch'](handleError(_0x1c40e8,null));};exports[_0x7677('0x25')]=function(_0x5dfa53,_0x568052){var _0x560ea3;return db[_0x7677('0x52')][_0x7677('0x59')]({'where':{'id':_0x5dfa53['params']['id']}})[_0x7677('0x24')](handleEntityNotFound(_0x568052,null))[_0x7677('0x24')](function(_0x1731d7){if(_0x1731d7){return _0x1731d7[_0x7677('0x25')]()['then'](function(_0x3d5133){return _0x3d5133;});}})[_0x7677('0x24')](function(_0x2bd8e4){_0x560ea3=_0x2bd8e4;if(_0x2bd8e4){if(_0x2bd8e4['VoiceQueueId']||_0x2bd8e4[_0x7677('0x5d')]){return db[_0x2bd8e4['VoiceQueueId']?_0x7677('0x5e'):_0x7677('0x5f')][_0x7677('0x59')]({'where':{'id':_0x2bd8e4[_0x7677('0x60')]?_0x2bd8e4[_0x7677('0x60')]:_0x2bd8e4[_0x7677('0x5d')]},'attributes':['id',_0x7677('0x28')],'raw':!![]});}}})[_0x7677('0x24')](function(_0x2756a7){var _0x277d27={};if(_0x2756a7){_[_0x7677('0x4d')](_0x277d27,_[_0x7677('0x61')](_0x560ea3[_0x7677('0x62')],[_0x7677('0x63'),_0x7677('0x64'),'id']));_0x277d27['state']=0x15;_0x277d27['statedesc']='deleted';_0x277d27['campaign']=_0x2756a7['name'];_0x277d27['membername']=_0x5dfa53[_0x7677('0x65')]['name'];_0x277d27[_0x7677('0x66')]=_0x5dfa53[_0x7677('0x65')]['id'];_0x277d27[_0x7677('0x67')]=!![];_0x277d27['deletedat']=moment()['format'](_0x7677('0x68'));_0x277d27[_0x7677('0x69')]=_0x560ea3[_0x7677('0x6a')];_0x277d27[_0x7677('0x6b')]=_0x560ea3['VoiceQueueId']?'queue':'ivr';return db[_0x7677('0x6c')][_0x7677('0x59')]({'where':{'id':_0x277d27['ContactId']},'attributes':[_0x7677('0x6d'),_0x7677('0x6e')]})[_0x7677('0x24')](function(_0x26e727){if(!_[_0x7677('0x6f')](_0x568052)&&!_[_0x7677('0x6f')](_0x26e727[_0x7677('0x6d')])){_0x277d27['calleridname']=_0x26e727[_0x7677('0x6d')];if(!_[_0x7677('0x6f')](_0x26e727[_0x7677('0x6e')])){_0x277d27[_0x7677('0x70')]+='\x20'+_0x26e727[_0x7677('0x6e')];}}})[_0x7677('0x71')](function(){return db[_0x7677('0x72')][_0x7677('0x5a')](_0x277d27);});}})[_0x7677('0x24')](function(){return _0x568052['status'](0xcc)[_0x7677('0x1a')]();})[_0x7677('0x54')](handleError(_0x568052,null));};exports['getPreview']=function(_0x4aa205,_0xdefab,_0x3dcbd8){var _0x2e2c88=[];return db['CmContact'][_0x7677('0x5c')]()[_0x7677('0x24')](function(_0x234c0b){_0x2e2c88=_[_0x7677('0x2d')](_0x234c0b);return _0x4aa205['user'][_0x7677('0x73')]({'where':{'type':'outbound','dialActive':!![],'dialMethod':_0x7677('0x74')},'attributes':['id',_0x7677('0x75')],'raw':!![]});})[_0x7677('0x24')](function(_0x1fb295){if(_0x1fb295&&_0x1fb295[_0x7677('0x45')]){return db[_0x7677('0x76')]['transaction'](function(_0x13471e){var _0x333bbb={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format'](_0x7677('0x68'))},'VoiceQueueId':{'$in':_[_0x7677('0x4e')](_0x1fb295,'id')},'$or':[{'UserId':null},{'UserId':_0x4aa205[_0x7677('0x65')]['id']}]};var _0xd58c50=[];if(_0x4aa205[_0x7677('0x5b')]['direction']&&_0x4aa205[_0x7677('0x5b')][_0x7677('0x77')]==='prev'){if(!_['isEmpty'](_0x4aa205[_0x7677('0x5b')][_0x7677('0x78')])){_0x333bbb['id']={'$in':_0x4aa205[_0x7677('0x5b')][_0x7677('0x78')]};}_0xd58c50=[[_0x7677('0x79'),_0x7677('0x7a')],[_0x7677('0x7b'),_0x1fb295[0x0]['dialOrderByScheduledAt']===_0x7677('0x7a')?_0x7677('0x7c'):_0x7677('0x7a')],db[_0x7677('0x76')][_0x7677('0x7d')](_0x7677('0x7e')),['id',_0x7677('0x7c')]];}else{if(!_['isEmpty'](_0x4aa205[_0x7677('0x5b')]['hopperIds'])){_0x333bbb['id']={'$notIn':_0x4aa205[_0x7677('0x5b')][_0x7677('0x78')]};}_0xd58c50=[[_0x7677('0x79'),_0x7677('0x7c')],[_0x7677('0x7b'),_0x1fb295[0x0]['dialOrderByScheduledAt']],db[_0x7677('0x76')][_0x7677('0x7d')](_0x7677('0x7f')),['id',_0x7677('0x7a')]];}return db[_0x7677('0x52')]['findOne']({'attributes':['id','scheduledat'],'where':_0x333bbb,'order':_0xd58c50,'transaction':_0x13471e,'lock':_0x13471e[_0x7677('0x80')][_0x7677('0x81')],'include':[{'model':db[_0x7677('0x6c')],'as':_0x7677('0x82'),'attributes':_0x2e2c88,'include':[{'model':db[_0x7677('0x83')],'as':_0x7677('0x84'),'attributes':['id',_0x7677('0x28')]}]},{'model':db[_0x7677('0x85')],'as':'List','attributes':['id',_0x7677('0x28')]},{'model':db[_0x7677('0x5e')],'as':_0x7677('0x86'),'attributes':['id',_0x7677('0x28'),'dialActive']}]})['then'](function(_0x1fcf49){if(_0x1fcf49){return _0x1fcf49['update']({'UserId':_0x4aa205[_0x7677('0x65')]['id']},{'transaction':_0x13471e});}});});}})[_0x7677('0x24')](handleEntityNotFound(_0xdefab,null))['then'](respondWithResult(_0xdefab,null))[_0x7677('0x54')](handleError(_0xdefab,null));};exports[_0x7677('0x87')]=function(_0x38dc6c,_0x26a180,_0x497daf){return _0x38dc6c['user'][_0x7677('0x73')]({'where':{'type':'outbound','dialActive':!![],'dialMethod':_0x7677('0x74')},'attributes':['id'],'raw':!![]})['then'](function(_0x1354f0){if(_0x1354f0&&_0x1354f0[_0x7677('0x45')]){return db[_0x7677('0x52')][_0x7677('0x1b')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x7677('0x88')]('YYYY-MM-DD\x20HH:mm:ss')},'VoiceQueueId':{'$in':_['map'](_0x1354f0,'id')},'$or':[{'UserId':null},{'UserId':_0x38dc6c[_0x7677('0x65')]['id']}]}});}return 0x0;})[_0x7677('0x24')](function(_0x545821){if(!_['isNil'](_0x545821)&&_[_0x7677('0x89')](_0x545821)){return _0x26a180[_0x7677('0x19')](0xc8)['json']({'contacts':_0x545821});}else{logger['error'](_0x7677('0x8a'),_0x7677('0x87'),0x194,'entity\x20not\x20found');_0x26a180[_0x7677('0x18')](0x194);}})['catch'](handleError(_0x26a180,null));}; \ No newline at end of file +var _0xf78d=['ContactId','firstName','isNil','calleridname','lastName','finally','CmHopperFinal','getPreview','CmContact','describe','getVoiceQueues','preview','transaction','format','YYYY-MM-DD\x20HH:mm:ss','map','direction','prev','isEmpty','hopperIds','priority','ASC','dialOrderByScheduledAt','DESC','COALESCE(CmHopper.UserId,\x200)\x20ASC','sequelize','literal','COALESCE(CmHopper.UserId,\x200)\x20DESC','findOne','scheduledat','LOCK','UPDATE','Contact','CmCompany','CmList','List','Queue','dialActive','update','getOpenContacts','outbound','isNumber','error','CmHopper,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','html-pdf','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','reject','then','destroy','name','send','index','CmHopper','rawAttributes','model','keys','query','filters','intersection','concat','$and','$or','$gt','$gte','$lt','$ne','$not','$notBetween','$in','$notIn','$like','$notLike','$iLike','$overlap','$contains','$contained','$any','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','type','key','VIRTUAL','field','count','includeAll','include','findAll','catch','show','params','options','find','create','body','CampaignId','VoiceQueueId','VoiceQueue','Campaign','omit','dataValues','createdAt','updatedAt','state','statedesc','deleted','campaign','user','UserId','deletedat','campaigntype','queue','ivr'];(function(_0x1176da,_0x1a1350){var _0x5715f2=function(_0x231571){while(--_0x231571){_0x1176da['push'](_0x1176da['shift']());}};_0x5715f2(++_0x1a1350);}(_0xf78d,0x1f2));var _0xdf78=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf78d[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require(_0xdf78('0x0'));var emlformat=require(_0xdf78('0x1'));var rimraf=require(_0xdf78('0x2'));var zipdir=require(_0xdf78('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xdf78('0x4'));var moment=require('moment');var BPromise=require(_0xdf78('0x5'));var Mustache=require(_0xdf78('0x6'));var util=require(_0xdf78('0x7'));var path=require(_0xdf78('0x8'));var sox=require(_0xdf78('0x9'));var csv=require(_0xdf78('0xa'));var ejs=require(_0xdf78('0xb'));var fs=require('fs');var _=require(_0xdf78('0xc'));var squel=require(_0xdf78('0xd'));var crypto=require('crypto');var jsforce=require(_0xdf78('0xe'));var deskjs=require(_0xdf78('0xf'));var toCsv=require(_0xdf78('0xa'));var querystring=require('querystring');var Papa=require(_0xdf78('0x10'));var Redis=require('ioredis');var authService=require(_0xdf78('0x11'));var qs=require(_0xdf78('0x12'));var as=require(_0xdf78('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xdf78('0x14'))(_0xdf78('0x15'));var utils=require(_0xdf78('0x16'));var config=require(_0xdf78('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x460d43,_0x4c9e4b){_0x4c9e4b=_0x4c9e4b||0xcc;return function(_0x4f592f){if(_0x4f592f){return _0x460d43[_0xdf78('0x18')](_0x4c9e4b);}return _0x460d43[_0xdf78('0x19')](_0x4c9e4b)[_0xdf78('0x1a')]();};}function respondWithResult(_0x4c87de,_0x578f52){_0x578f52=_0x578f52||0xc8;return function(_0x3a17a0){if(_0x3a17a0){return _0x4c87de[_0xdf78('0x19')](_0x578f52)[_0xdf78('0x1b')](_0x3a17a0);}};}function respondWithFilteredResult(_0x1c1869,_0x377c5c){return function(_0x7291fc){if(_0x7291fc){var _0x196652=_0x7291fc['count'],_0x12ab08=_0x377c5c[_0xdf78('0x1c')],_0x490099=_0x377c5c[_0xdf78('0x1c')]+_0x377c5c[_0xdf78('0x1d')],_0x5cdb47;if(_0x490099>=_0x196652){_0x490099=_0x196652;_0x5cdb47=0xc8;}else{_0x5cdb47=0xce;}_0x1c1869[_0xdf78('0x19')](_0x5cdb47);return _0x1c1869[_0xdf78('0x1e')](_0xdf78('0x1f'),_0x12ab08+'-'+_0x490099+'/'+_0x196652)[_0xdf78('0x1b')](_0x7291fc);}return null;};}function patchUpdates(_0x51aac5){return function(_0x440f2e){try{jsonpatch[_0xdf78('0x20')](_0x440f2e,_0x51aac5,!![]);}catch(_0x9e200b){return BPromise[_0xdf78('0x21')](_0x9e200b);}return _0x440f2e['save']();};}function saveUpdates(_0x5e776a,_0x277cab){return function(_0x1ccd39){if(_0x1ccd39){return _0x1ccd39['update'](_0x5e776a)[_0xdf78('0x22')](function(_0x502f61){return _0x502f61;});}return null;};}function removeEntity(_0x59eab7,_0x17d013){return function(_0x26a053){if(_0x26a053){return _0x26a053[_0xdf78('0x23')]()[_0xdf78('0x22')](function(){_0x59eab7[_0xdf78('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5f394f,_0x309e8e){return function(_0x4fb945){if(!_0x4fb945){_0x5f394f[_0xdf78('0x18')](0x194);}return _0x4fb945;};}function handleError(_0x1bb330,_0x6ce5c){_0x6ce5c=_0x6ce5c||0x1f4;return function(_0x28e100){logger['error'](_0x28e100['stack']);if(_0x28e100['name']){delete _0x28e100[_0xdf78('0x24')];}_0x1bb330['status'](_0x6ce5c)[_0xdf78('0x25')](_0x28e100);};}exports[_0xdf78('0x26')]=function(_0x21c244,_0x167e92){var _0x44f30f={},_0xcdf12a={},_0x278163={'count':0x0,'rows':[]};var _0x3d25f6=db[_0xdf78('0x27')][_0xdf78('0x28')];_0xcdf12a[_0xdf78('0x29')]=_[_0xdf78('0x2a')](_0x3d25f6);_0xcdf12a['query']=_[_0xdf78('0x2a')](_0x21c244[_0xdf78('0x2b')]);_0xcdf12a[_0xdf78('0x2c')]=_[_0xdf78('0x2d')](_0xcdf12a[_0xdf78('0x29')],_0xcdf12a[_0xdf78('0x2b')]);_0xcdf12a[_0xdf78('0x2c')]=_[_0xdf78('0x2e')](_0xcdf12a[_0xdf78('0x2c')],[_0xdf78('0x2f'),_0xdf78('0x30'),_0xdf78('0x31'),_0xdf78('0x32'),_0xdf78('0x33'),'$lte',_0xdf78('0x34'),'$eq',_0xdf78('0x35'),'$between',_0xdf78('0x36'),_0xdf78('0x37'),_0xdf78('0x38'),_0xdf78('0x39'),_0xdf78('0x3a'),_0xdf78('0x3b'),'$notILike',_0xdf78('0x39'),_0xdf78('0x3c'),_0xdf78('0x3d'),_0xdf78('0x3e'),_0xdf78('0x3f')]);_0x44f30f[_0xdf78('0x40')]=_[_0xdf78('0x2d')](_0xcdf12a[_0xdf78('0x29')],qs[_0xdf78('0x41')](_0x21c244[_0xdf78('0x2b')][_0xdf78('0x41')]));_0x44f30f[_0xdf78('0x40')]=_0x44f30f[_0xdf78('0x40')][_0xdf78('0x42')]?_0x44f30f[_0xdf78('0x40')]:_0xcdf12a['model'];if(!_0x21c244['query'][_0xdf78('0x43')]('nolimit')){_0x44f30f[_0xdf78('0x1d')]=qs[_0xdf78('0x1d')](_0x21c244[_0xdf78('0x2b')]['limit']);_0x44f30f[_0xdf78('0x1c')]=qs[_0xdf78('0x1c')](_0x21c244['query'][_0xdf78('0x1c')]);}_0x44f30f[_0xdf78('0x44')]=qs[_0xdf78('0x45')](_0x21c244[_0xdf78('0x2b')][_0xdf78('0x45')]);_0x44f30f[_0xdf78('0x46')]=qs[_0xdf78('0x2c')](_['pick'](_0x21c244[_0xdf78('0x2b')],_0xcdf12a[_0xdf78('0x2c')]));if(_0x21c244['query'][_0xdf78('0x47')]){_0x44f30f['where']=_[_0xdf78('0x48')](_0x44f30f[_0xdf78('0x46')],{'$or':_['map'](_0x3d25f6,function(_0x536fd5){if(_0x536fd5[_0xdf78('0x49')][_0xdf78('0x4a')]!==_0xdf78('0x4b')){var _0x1da390={};_0x1da390[_0x536fd5[_0xdf78('0x4c')]]={'$like':'%'+_0x21c244[_0xdf78('0x2b')][_0xdf78('0x47')]+'%'};return _0x1da390;}})});}_0x44f30f=_[_0xdf78('0x48')]({},_0x44f30f,_0x21c244['options']);var _0x98fb2d={'where':_0x44f30f[_0xdf78('0x46')]};return db[_0xdf78('0x27')][_0xdf78('0x4d')](_0x98fb2d)[_0xdf78('0x22')](function(_0x47217c){_0x278163[_0xdf78('0x4d')]=_0x47217c;if(_0x21c244[_0xdf78('0x2b')][_0xdf78('0x4e')]){_0x44f30f[_0xdf78('0x4f')]=[{'all':!![]}];}return db[_0xdf78('0x27')][_0xdf78('0x50')](_0x44f30f);})[_0xdf78('0x22')](function(_0x5816b8){_0x278163['rows']=_0x5816b8;return _0x278163;})[_0xdf78('0x22')](respondWithFilteredResult(_0x167e92,_0x44f30f))[_0xdf78('0x51')](handleError(_0x167e92,null));};exports[_0xdf78('0x52')]=function(_0x5dd902,_0x32b74b){var _0x540d4e={'raw':!![],'where':{'id':_0x5dd902[_0xdf78('0x53')]['id']}},_0x41f0b1={};_0x41f0b1[_0xdf78('0x29')]=_[_0xdf78('0x2a')](db[_0xdf78('0x27')][_0xdf78('0x28')]);_0x41f0b1[_0xdf78('0x2b')]=_[_0xdf78('0x2a')](_0x5dd902[_0xdf78('0x2b')]);_0x41f0b1[_0xdf78('0x2c')]=_[_0xdf78('0x2d')](_0x41f0b1[_0xdf78('0x29')],_0x41f0b1[_0xdf78('0x2b')]);_0x540d4e[_0xdf78('0x40')]=_[_0xdf78('0x2d')](_0x41f0b1[_0xdf78('0x29')],qs[_0xdf78('0x41')](_0x5dd902[_0xdf78('0x2b')][_0xdf78('0x41')]));_0x540d4e[_0xdf78('0x40')]=_0x540d4e[_0xdf78('0x40')][_0xdf78('0x42')]?_0x540d4e['attributes']:_0x41f0b1['model'];if(_0x5dd902[_0xdf78('0x2b')][_0xdf78('0x4e')]){_0x540d4e[_0xdf78('0x4f')]=[{'all':!![]}];}_0x540d4e=_[_0xdf78('0x48')]({},_0x540d4e,_0x5dd902[_0xdf78('0x54')]);return db[_0xdf78('0x27')][_0xdf78('0x55')](_0x540d4e)['then'](handleEntityNotFound(_0x32b74b,null))[_0xdf78('0x22')](respondWithResult(_0x32b74b,null))[_0xdf78('0x51')](handleError(_0x32b74b,null));};exports['create']=function(_0x1fadd2,_0x6fcda7){return db['CmHopper'][_0xdf78('0x56')](_0x1fadd2[_0xdf78('0x57')],{})[_0xdf78('0x22')](respondWithResult(_0x6fcda7,0xc9))[_0xdf78('0x51')](handleError(_0x6fcda7,null));};exports['update']=function(_0x1e16e3,_0x1e39b4){if(_0x1e16e3[_0xdf78('0x57')]['id']){delete _0x1e16e3['body']['id'];}return db[_0xdf78('0x27')]['find']({'where':{'id':_0x1e16e3['params']['id']}})[_0xdf78('0x22')](handleEntityNotFound(_0x1e39b4,null))[_0xdf78('0x22')](saveUpdates(_0x1e16e3[_0xdf78('0x57')],null))['then'](respondWithResult(_0x1e39b4,null))[_0xdf78('0x51')](handleError(_0x1e39b4,null));};exports['describe']=function(_0x116ffb,_0x4d8797){return db[_0xdf78('0x27')]['describe']()[_0xdf78('0x22')](respondWithResult(_0x4d8797,null))[_0xdf78('0x51')](handleError(_0x4d8797,null));};exports['destroy']=function(_0x2a8ff2,_0x4331cf){var _0x1d0170;return db[_0xdf78('0x27')][_0xdf78('0x55')]({'where':{'id':_0x2a8ff2['params']['id']}})[_0xdf78('0x22')](handleEntityNotFound(_0x4331cf,null))[_0xdf78('0x22')](function(_0x2a9593){if(_0x2a9593){return _0x2a9593[_0xdf78('0x23')]()[_0xdf78('0x22')](function(_0x288322){return _0x288322;});}})[_0xdf78('0x22')](function(_0x2f789c){_0x1d0170=_0x2f789c;if(_0x2f789c){if(_0x2f789c['VoiceQueueId']||_0x2f789c[_0xdf78('0x58')]){return db[_0x2f789c[_0xdf78('0x59')]?_0xdf78('0x5a'):_0xdf78('0x5b')][_0xdf78('0x55')]({'where':{'id':_0x2f789c['VoiceQueueId']?_0x2f789c[_0xdf78('0x59')]:_0x2f789c[_0xdf78('0x58')]},'attributes':['id',_0xdf78('0x24')],'raw':!![]});}}})['then'](function(_0x4cf74b){var _0x486409={};if(_0x4cf74b){_[_0xdf78('0x48')](_0x486409,_[_0xdf78('0x5c')](_0x1d0170[_0xdf78('0x5d')],[_0xdf78('0x5e'),_0xdf78('0x5f'),'id']));_0x486409[_0xdf78('0x60')]=0x15;_0x486409[_0xdf78('0x61')]=_0xdf78('0x62');_0x486409[_0xdf78('0x63')]=_0x4cf74b['name'];_0x486409['membername']=_0x2a8ff2[_0xdf78('0x64')][_0xdf78('0x24')];_0x486409[_0xdf78('0x65')]=_0x2a8ff2[_0xdf78('0x64')]['id'];_0x486409[_0xdf78('0x62')]=!![];_0x486409[_0xdf78('0x66')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x486409['calleridnum']=_0x1d0170['phone'];_0x486409[_0xdf78('0x67')]=_0x1d0170[_0xdf78('0x59')]?_0xdf78('0x68'):_0xdf78('0x69');return db['CmContact'][_0xdf78('0x55')]({'where':{'id':_0x486409[_0xdf78('0x6a')]},'attributes':[_0xdf78('0x6b'),'lastName']})[_0xdf78('0x22')](function(_0x19677b){if(!_[_0xdf78('0x6c')](_0x4331cf)&&!_[_0xdf78('0x6c')](_0x19677b[_0xdf78('0x6b')])){_0x486409[_0xdf78('0x6d')]=_0x19677b['firstName'];if(!_[_0xdf78('0x6c')](_0x19677b[_0xdf78('0x6e')])){_0x486409[_0xdf78('0x6d')]+='\x20'+_0x19677b[_0xdf78('0x6e')];}}})[_0xdf78('0x6f')](function(){return db[_0xdf78('0x70')][_0xdf78('0x56')](_0x486409);});}})[_0xdf78('0x22')](function(){return _0x4331cf['status'](0xcc)[_0xdf78('0x1a')]();})['catch'](handleError(_0x4331cf,null));};exports[_0xdf78('0x71')]=function(_0x52bd15,_0x4140a5,_0x307d2b){var _0x5b87b1=[];return db[_0xdf78('0x72')][_0xdf78('0x73')]()[_0xdf78('0x22')](function(_0x4489b4){_0x5b87b1=_[_0xdf78('0x2a')](_0x4489b4);return _0x52bd15[_0xdf78('0x64')][_0xdf78('0x74')]({'where':{'type':'outbound','dialActive':!![],'dialMethod':_0xdf78('0x75')},'attributes':['id','dialOrderByScheduledAt'],'raw':!![]});})['then'](function(_0x33c7dd){if(_0x33c7dd&&_0x33c7dd[_0xdf78('0x42')]){return db['sequelize'][_0xdf78('0x76')](function(_0x269287){var _0x2264be={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0xdf78('0x77')](_0xdf78('0x78'))},'VoiceQueueId':{'$in':_[_0xdf78('0x79')](_0x33c7dd,'id')},'$or':[{'UserId':null},{'UserId':_0x52bd15[_0xdf78('0x64')]['id']}]};var _0x1a5e4c=[];if(_0x52bd15[_0xdf78('0x57')][_0xdf78('0x7a')]&&_0x52bd15[_0xdf78('0x57')][_0xdf78('0x7a')]===_0xdf78('0x7b')){if(!_[_0xdf78('0x7c')](_0x52bd15[_0xdf78('0x57')][_0xdf78('0x7d')])){_0x2264be['id']={'$in':_0x52bd15[_0xdf78('0x57')][_0xdf78('0x7d')]};}_0x1a5e4c=[[_0xdf78('0x7e'),_0xdf78('0x7f')],['scheduledAt',_0x33c7dd[0x0][_0xdf78('0x80')]===_0xdf78('0x7f')?_0xdf78('0x81'):_0xdf78('0x7f')],db['sequelize']['literal'](_0xdf78('0x82')),['id','DESC']];}else{if(!_[_0xdf78('0x7c')](_0x52bd15['body']['hopperIds'])){_0x2264be['id']={'$notIn':_0x52bd15[_0xdf78('0x57')]['hopperIds']};}_0x1a5e4c=[['priority',_0xdf78('0x81')],['scheduledAt',_0x33c7dd[0x0]['dialOrderByScheduledAt']],db[_0xdf78('0x83')][_0xdf78('0x84')](_0xdf78('0x85')),['id','ASC']];}return db[_0xdf78('0x27')][_0xdf78('0x86')]({'attributes':['id',_0xdf78('0x87')],'where':_0x2264be,'order':_0x1a5e4c,'transaction':_0x269287,'lock':_0x269287[_0xdf78('0x88')][_0xdf78('0x89')],'include':[{'model':db[_0xdf78('0x72')],'as':_0xdf78('0x8a'),'attributes':_0x5b87b1,'include':[{'model':db[_0xdf78('0x8b')],'as':'Company','attributes':['id',_0xdf78('0x24')]}]},{'model':db[_0xdf78('0x8c')],'as':_0xdf78('0x8d'),'attributes':['id','name']},{'model':db['VoiceQueue'],'as':_0xdf78('0x8e'),'attributes':['id',_0xdf78('0x24'),_0xdf78('0x8f')]}]})[_0xdf78('0x22')](function(_0x524cd2){if(_0x524cd2){return _0x524cd2[_0xdf78('0x90')]({'UserId':_0x52bd15[_0xdf78('0x64')]['id']},{'transaction':_0x269287});}});});}})[_0xdf78('0x22')](handleEntityNotFound(_0x4140a5,null))[_0xdf78('0x22')](respondWithResult(_0x4140a5,null))['catch'](handleError(_0x4140a5,null));};exports[_0xdf78('0x91')]=function(_0x125e32,_0x5a865b,_0x344e4d){return _0x125e32['user']['getVoiceQueues']({'where':{'type':_0xdf78('0x92'),'dialActive':!![],'dialMethod':'preview'},'attributes':['id'],'raw':!![]})['then'](function(_0x70822f){if(_0x70822f&&_0x70822f[_0xdf78('0x42')]){return db[_0xdf78('0x27')][_0xdf78('0x4d')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format'](_0xdf78('0x78'))},'VoiceQueueId':{'$in':_[_0xdf78('0x79')](_0x70822f,'id')},'$or':[{'UserId':null},{'UserId':_0x125e32[_0xdf78('0x64')]['id']}]}});}return 0x0;})[_0xdf78('0x22')](function(_0x396476){if(!_[_0xdf78('0x6c')](_0x396476)&&_[_0xdf78('0x93')](_0x396476)){return _0x5a865b[_0xdf78('0x19')](0xc8)['json']({'contacts':_0x396476});}else{logger[_0xdf78('0x94')](_0xdf78('0x95'),_0xdf78('0x91'),0x194,_0xdf78('0x96'));_0x5a865b[_0xdf78('0x18')](0x194);}})['catch'](handleError(_0x5a865b,null));}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.model.js b/server/api/cmHopper/cmHopper.model.js index 70cd9f7..50ee106 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 _0xb9ab=['rimraf','./cmHopper.attributes','define','CmHopper','scheduledat','phone','util','../../config/logger','api','moment','bluebird'];(function(_0x94a2bb,_0x5935b9){var _0x444b1f=function(_0x108e02){while(--_0x108e02){_0x94a2bb['push'](_0x94a2bb['shift']());}};_0x444b1f(++_0x5935b9);}(_0xb9ab,0xc1));var _0xbb9a=function(_0x7870ff,_0x21c985){_0x7870ff=_0x7870ff-0x0;var _0x5d66d6=_0xb9ab[_0x7870ff];return _0x5d66d6;};'use strict';var _=require('lodash');var util=require(_0xbb9a('0x0'));var logger=require(_0xbb9a('0x1'))(_0xbb9a('0x2'));var moment=require(_0xbb9a('0x3'));var BPromise=require(_0xbb9a('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xbb9a('0x5'));var config=require('../../config/environment');var attributes=require(_0xbb9a('0x6'));module['exports']=function(_0x44d6b1,_0x555d3c){return _0x44d6b1[_0xbb9a('0x7')](_0xbb9a('0x8'),attributes,{'tableName':'cm_hopper','paranoid':![],'indexes':[{'name':'scheduledat','fields':[_0xbb9a('0x9')]},{'name':_0xbb9a('0xa'),'fields':[_0xbb9a('0xa')]},{'name':'priority','fields':['priority']}],'timestamps':!![]});}; \ No newline at end of file +var _0x4766=['util','api','moment','request-promise','path','rimraf','../../config/environment','./cmHopper.attributes','exports','define','cm_hopper','scheduledat','phone','priority'];(function(_0x10df18,_0x13338c){var _0x1f9a1d=function(_0x3157f4){while(--_0x3157f4){_0x10df18['push'](_0x10df18['shift']());}};_0x1f9a1d(++_0x13338c);}(_0x4766,0x1ea));var _0x6476=function(_0x2fb5b4,_0x68da21){_0x2fb5b4=_0x2fb5b4-0x0;var _0x40a3da=_0x4766[_0x2fb5b4];return _0x40a3da;};'use strict';var _=require('lodash');var util=require(_0x6476('0x0'));var logger=require('../../config/logger')(_0x6476('0x1'));var moment=require(_0x6476('0x2'));var BPromise=require('bluebird');var rp=require(_0x6476('0x3'));var fs=require('fs');var path=require(_0x6476('0x4'));var rimraf=require(_0x6476('0x5'));var config=require(_0x6476('0x6'));var attributes=require(_0x6476('0x7'));module[_0x6476('0x8')]=function(_0xe77250,_0x33ffb0){return _0xe77250[_0x6476('0x9')]('CmHopper',attributes,{'tableName':_0x6476('0xa'),'paranoid':![],'indexes':[{'name':_0x6476('0xb'),'fields':[_0x6476('0xb')]},{'name':'phone','fields':[_0x6476('0xc')]},{'name':_0x6476('0xd'),'fields':[_0x6476('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.rpc.js b/server/api/cmHopper/cmHopper.rpc.js index 5017125..dc47892 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 _0x9b40=['format','\x22%s\x22','\x20,\x201,\x20null','contactsRescheduled','GetContactRecallMe','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','CmHopper,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','GetCmHopper','CmHopper','findAll','options','where','attributes','limit','include','model','map','catch','ShowCmHopper','find','raw','CreateCmHopper','create','body','UpdateCmHopper','destroy','DestroyCmHopper','GetContactDialer','CmContact','describe','sequelize','transaction','order','LOCK','UPDATE','Contact','keys','length','push','all','MoveContactManagedDialer','CountReScheduled','COUNT','literal','`scheduledat`\x20>=\x20'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x9b40,0x17f));var _0x09b4=function(_0x54299,_0x365a90){_0x54299=_0x54299-0x0;var _0x34a7c2=_0x9b40[_0x54299];return _0x34a7c2;};'use strict';var _=require('lodash');var util=require(_0x09b4('0x0'));var moment=require(_0x09b4('0x1'));var BPromise=require(_0x09b4('0x2'));var rs=require(_0x09b4('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x09b4('0x4'));var logger=require(_0x09b4('0x5'))(_0x09b4('0x6'));var config=require(_0x09b4('0x7'));var jayson=require(_0x09b4('0x8'));var client=jayson[_0x09b4('0x9')][_0x09b4('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x32ab39,_0x410692,_0x45c171){return new BPromise(function(_0x5954d5,_0x56be20){return client['request'](_0x32ab39,_0x45c171)[_0x09b4('0xb')](function(_0x2a1346){logger[_0x09b4('0xc')](_0x09b4('0xd'),_0x410692,_0x09b4('0xe'));logger[_0x09b4('0xf')]('CmHopper,\x20%s,\x20%s,\x20%s',_0x410692,_0x09b4('0xe'),JSON[_0x09b4('0x10')](_0x2a1346));if(_0x2a1346['error']){if(_0x2a1346['error']['code']===0x1f4){logger[_0x09b4('0x11')](_0x09b4('0xd'),_0x410692,_0x2a1346['error']['message']);return _0x56be20(_0x2a1346[_0x09b4('0x11')][_0x09b4('0x12')]);}logger[_0x09b4('0x11')](_0x09b4('0xd'),_0x410692,_0x2a1346['error'][_0x09b4('0x12')]);return _0x5954d5(_0x2a1346['error'][_0x09b4('0x12')]);}else{logger[_0x09b4('0xc')](_0x09b4('0xd'),_0x410692,_0x09b4('0xe'));_0x5954d5(_0x2a1346[_0x09b4('0x13')][_0x09b4('0x12')]);}})['catch'](function(_0x25941b){logger['error'](_0x09b4('0xd'),_0x410692,_0x25941b);_0x56be20(_0x25941b);});});}exports[_0x09b4('0x14')]=function(_0x32d674){var _0x54fdbc=this;return new Promise(function(_0x447c00,_0x11dea3){return db[_0x09b4('0x15')][_0x09b4('0x16')]({'raw':_0x32d674[_0x09b4('0x17')]?_0x32d674['options']['raw']===undefined?!![]:![]:!![],'where':_0x32d674[_0x09b4('0x17')]?_0x32d674[_0x09b4('0x17')][_0x09b4('0x18')]||null:null,'attributes':_0x32d674['options']?_0x32d674['options'][_0x09b4('0x19')]||null:null,'limit':_0x32d674[_0x09b4('0x17')]?_0x32d674['options'][_0x09b4('0x1a')]||null:null,'include':_0x32d674[_0x09b4('0x17')]?_0x32d674[_0x09b4('0x17')][_0x09b4('0x1b')]?_['map'](_0x32d674[_0x09b4('0x17')][_0x09b4('0x1b')],function(_0x568b00){return{'model':db[_0x568b00[_0x09b4('0x1c')]],'as':_0x568b00['as'],'attributes':_0x568b00['attributes'],'include':_0x568b00[_0x09b4('0x1b')]?_[_0x09b4('0x1d')](_0x568b00['include'],function(_0x208b75){return{'model':db[_0x208b75[_0x09b4('0x1c')]],'as':_0x208b75['as'],'attributes':_0x208b75[_0x09b4('0x19')],'include':_0x208b75[_0x09b4('0x1b')]?_['map'](_0x208b75[_0x09b4('0x1b')],function(_0x2a6a98){return{'model':db[_0x2a6a98[_0x09b4('0x1c')]],'as':_0x2a6a98['as'],'attributes':_0x2a6a98['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x487c8a){logger[_0x09b4('0xc')](_0x09b4('0x14'),_0x32d674);logger[_0x09b4('0xf')](_0x09b4('0x14'),_0x32d674,JSON['stringify'](_0x487c8a));_0x447c00(_0x487c8a);})[_0x09b4('0x1e')](function(_0x49b18e){logger[_0x09b4('0x11')](_0x09b4('0x14'),_0x49b18e['message'],_0x32d674);_0x11dea3(_0x54fdbc[_0x09b4('0x11')](0x1f4,_0x49b18e[_0x09b4('0x12')]));});});};exports[_0x09b4('0x1f')]=function(_0x1b0519){var _0x422c34=this;return new Promise(function(_0x43c79f,_0x7c3c){return db['CmHopper'][_0x09b4('0x20')]({'raw':_0x1b0519[_0x09b4('0x17')]?_0x1b0519[_0x09b4('0x17')][_0x09b4('0x21')]===undefined?!![]:![]:!![],'where':_0x1b0519['options']?_0x1b0519[_0x09b4('0x17')][_0x09b4('0x18')]||null:null,'attributes':_0x1b0519[_0x09b4('0x17')]?_0x1b0519[_0x09b4('0x17')]['attributes']||null:null,'include':_0x1b0519['options']?_0x1b0519[_0x09b4('0x17')]['include']?_['map'](_0x1b0519[_0x09b4('0x17')][_0x09b4('0x1b')],function(_0x1e82da){return{'model':db[_0x1e82da[_0x09b4('0x1c')]],'as':_0x1e82da['as'],'attributes':_0x1e82da['attributes'],'include':_0x1e82da[_0x09b4('0x1b')]?_[_0x09b4('0x1d')](_0x1e82da[_0x09b4('0x1b')],function(_0x391078){return{'model':db[_0x391078[_0x09b4('0x1c')]],'as':_0x391078['as'],'attributes':_0x391078['attributes'],'include':_0x391078[_0x09b4('0x1b')]?_[_0x09b4('0x1d')](_0x391078[_0x09b4('0x1b')],function(_0x8fc5ce){return{'model':db[_0x8fc5ce[_0x09b4('0x1c')]],'as':_0x8fc5ce['as'],'attributes':_0x8fc5ce[_0x09b4('0x19')]};}):[]};}):[]};}):[]:[]})[_0x09b4('0xb')](function(_0x513586){logger[_0x09b4('0xc')](_0x09b4('0x1f'),_0x1b0519);logger[_0x09b4('0xf')](_0x09b4('0x1f'),_0x1b0519,JSON[_0x09b4('0x10')](_0x513586));_0x43c79f(_0x513586);})['catch'](function(_0x16caab){logger['error'](_0x09b4('0x1f'),_0x16caab['message'],_0x1b0519);_0x7c3c(_0x422c34[_0x09b4('0x11')](0x1f4,_0x16caab[_0x09b4('0x12')]));});});};exports[_0x09b4('0x22')]=function(_0x1feb68){var _0x551f39=this;return new Promise(function(_0x488668,_0x360904){return db['CmHopper'][_0x09b4('0x23')](_0x1feb68[_0x09b4('0x24')],{'raw':_0x1feb68[_0x09b4('0x17')]?_0x1feb68[_0x09b4('0x17')]['raw']===undefined?!![]:![]:!![]})[_0x09b4('0xb')](function(_0x314312){logger[_0x09b4('0xc')](_0x09b4('0x22'),_0x1feb68);logger['debug']('CreateCmHopper',_0x1feb68,JSON[_0x09b4('0x10')](_0x314312));_0x488668(_0x314312);})['catch'](function(_0x3910da){logger[_0x09b4('0x11')](_0x09b4('0x22'),_0x3910da[_0x09b4('0x12')],_0x1feb68);_0x360904(_0x551f39[_0x09b4('0x11')](0x1f4,_0x3910da[_0x09b4('0x12')]));});});};exports[_0x09b4('0x25')]=function(_0x540329){var _0x3195a3=this;return new Promise(function(_0x98972f,_0x2046be){return db[_0x09b4('0x15')]['update'](_0x540329[_0x09b4('0x24')],{'raw':_0x540329['options']?_0x540329[_0x09b4('0x17')][_0x09b4('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x540329[_0x09b4('0x17')]?_0x540329[_0x09b4('0x17')][_0x09b4('0x18')]||null:null,'attributes':_0x540329['options']?_0x540329[_0x09b4('0x17')][_0x09b4('0x19')]||null:null,'limit':_0x540329['options']?_0x540329[_0x09b4('0x17')][_0x09b4('0x1a')]||null:null})[_0x09b4('0xb')](function(_0x5c45eb){logger[_0x09b4('0xc')](_0x09b4('0x25'),_0x540329);logger[_0x09b4('0xf')]('UpdateCmHopper',_0x540329,JSON[_0x09b4('0x10')](_0x5c45eb));_0x98972f(_0x5c45eb);})[_0x09b4('0x1e')](function(_0x3715f4){logger[_0x09b4('0x11')](_0x09b4('0x25'),_0x3715f4[_0x09b4('0x12')],_0x540329);_0x2046be(_0x3195a3[_0x09b4('0x11')](0x1f4,_0x3715f4[_0x09b4('0x12')]));});});};exports['DestroyCmHopper']=function(_0x4bbbb8){var _0x5bf3ff=this;return new Promise(function(_0x19f758,_0x2e9c51){return db[_0x09b4('0x15')][_0x09b4('0x26')]({'where':_0x4bbbb8[_0x09b4('0x17')]?_0x4bbbb8['options'][_0x09b4('0x18')]||null:null})[_0x09b4('0xb')](function(_0x5cf51e){logger['info'](_0x09b4('0x27'),_0x4bbbb8);logger[_0x09b4('0xf')]('DestroyCmHopper',_0x4bbbb8,JSON[_0x09b4('0x10')](_0x5cf51e));_0x19f758(_0x5cf51e);})[_0x09b4('0x1e')](function(_0x55a91d){logger[_0x09b4('0x11')](_0x09b4('0x27'),_0x55a91d[_0x09b4('0x12')],_0x4bbbb8);_0x2e9c51(_0x5bf3ff[_0x09b4('0x11')](0x1f4,_0x55a91d[_0x09b4('0x12')]));});});};exports[_0x09b4('0x28')]=function(_0x18d073){var _0x3666c8=this;return new Promise(function(_0x197738,_0x253241){return db[_0x09b4('0x29')][_0x09b4('0x2a')]()['then'](function(_0x3125da){return db[_0x09b4('0x2b')][_0x09b4('0x2c')](function(_0x1e7524){return db['CmHopper']['findAll']({'where':_0x18d073[_0x09b4('0x17')]?_0x18d073['options'][_0x09b4('0x18')]||null:null,'attributes':_0x18d073['options']?_0x18d073[_0x09b4('0x17')][_0x09b4('0x19')]||null:null,'limit':_0x18d073['options']?_0x18d073[_0x09b4('0x17')][_0x09b4('0x1a')]||null:null,'order':_0x18d073[_0x09b4('0x17')]?_0x18d073[_0x09b4('0x17')][_0x09b4('0x2d')]||null:null,'transaction':_0x1e7524,'lock':_0x1e7524[_0x09b4('0x2e')][_0x09b4('0x2f')],'include':[{'model':db[_0x09b4('0x29')],'as':_0x09b4('0x30'),'attributes':_[_0x09b4('0x31')](_0x3125da)}]})[_0x09b4('0xb')](function(_0x53ad0d){var _0x58165f=[];for(var _0x2530eb=0x0;_0x2530eb<_0x53ad0d[_0x09b4('0x32')];_0x2530eb+=0x1){_0x58165f[_0x09b4('0x33')](_0x53ad0d[_0x2530eb]['update'](_0x18d073['body'],{'transaction':_0x1e7524}));}return BPromise[_0x09b4('0x34')](_0x58165f);});})['then'](function(_0x2f1d71){logger[_0x09b4('0xc')](_0x09b4('0x28'),_0x18d073);logger[_0x09b4('0xf')](_0x09b4('0x28'),_0x18d073,JSON[_0x09b4('0x10')](_0x2f1d71));_0x197738(_0x2f1d71);})[_0x09b4('0x1e')](function(_0xfa8421){logger[_0x09b4('0x11')](_0x09b4('0x28'),_0xfa8421[_0x09b4('0x12')],_0x18d073);_0x253241(_0x3666c8[_0x09b4('0x11')](0x1f4,_0xfa8421[_0x09b4('0x12')]));});});});};exports['MoveContactManagedDialer']=function(_0x3caf6f){var _0x3ae766=this;return new Promise(function(_0x38b329,_0x27f224){return db[_0x09b4('0x2b')][_0x09b4('0x2c')](function(_0x394db1){return db['CmHopperFinal'][_0x09b4('0x23')](_0x3caf6f[_0x09b4('0x24')],{'raw':_0x3caf6f[_0x09b4('0x17')]?_0x3caf6f[_0x09b4('0x17')]['raw']===undefined?!![]:![]:!![],'transaction':_0x394db1})[_0x09b4('0xb')](function(){return db[_0x09b4('0x15')]['destroy']({'where':_0x3caf6f['options']?_0x3caf6f[_0x09b4('0x17')][_0x09b4('0x18')]||null:null,'transaction':_0x394db1});});})[_0x09b4('0xb')](function(_0x3695e8){logger[_0x09b4('0xc')](_0x09b4('0x35'),_0x3caf6f);logger['debug']('MoveContactManagedDialer',_0x3caf6f,JSON[_0x09b4('0x10')](_0x3695e8));_0x38b329(_0x3695e8);})[_0x09b4('0x1e')](function(_0x40d334){logger['error'](_0x09b4('0x35'),_0x40d334[_0x09b4('0x12')],_0x3caf6f);_0x27f224(_0x3ae766[_0x09b4('0x11')](0x1f4,_0x40d334['message']));});});};exports[_0x09b4('0x36')]=function(_0x5829d3){var _0x292145=this;return new Promise(function(_0x1cc2fe,_0x53111e){return db['CmHopper'][_0x09b4('0x16')]({'raw':_0x5829d3[_0x09b4('0x17')]?_0x5829d3[_0x09b4('0x17')][_0x09b4('0x21')]===undefined?!![]:![]:!![],'where':_0x5829d3[_0x09b4('0x17')]?_0x5829d3[_0x09b4('0x17')][_0x09b4('0x18')]||null:null,'attributes':[[db[_0x09b4('0x2b')]['fn'](_0x09b4('0x37'),db[_0x09b4('0x2b')]['fn']('IF',db[_0x09b4('0x2b')][_0x09b4('0x38')](_0x09b4('0x39')+util[_0x09b4('0x3a')](_0x09b4('0x3b'),moment()[_0x09b4('0x3a')]('YYYY-MM-DD\x20HH:mm:ss'))+_0x09b4('0x3c')))),_0x09b4('0x3d')]]})['then'](function(_0x1947ef){logger[_0x09b4('0xc')](_0x09b4('0x36'),_0x5829d3);logger[_0x09b4('0xf')](_0x09b4('0x36'),_0x5829d3,JSON[_0x09b4('0x10')](_0x1947ef));_0x1cc2fe(_0x1947ef);})[_0x09b4('0x1e')](function(_0x4f2c4f){logger[_0x09b4('0x11')](_0x09b4('0x36'),_0x4f2c4f['message'],_0x5829d3);_0x53111e(_0x292145[_0x09b4('0x11')](0x1f4,_0x4f2c4f['message']));});});};exports['GetContactRecallMe']=function(_0x18e051){var _0x588d5b=this;return new Promise(function(_0x47a660,_0x2e7e2d){return db[_0x09b4('0x29')]['describe']()[_0x09b4('0xb')](function(_0x5796f9){return db[_0x09b4('0x2b')]['transaction'](function(_0x25b2a0){return db[_0x09b4('0x15')]['findAll']({'where':_0x18e051['options']?_0x18e051[_0x09b4('0x17')]['where']||null:null,'attributes':_0x18e051['options']?_0x18e051[_0x09b4('0x17')][_0x09b4('0x19')]||null:null,'limit':0x1,'order':_0x18e051[_0x09b4('0x17')]?_0x18e051['options']['order']||null:null,'group':db[_0x09b4('0x15')]['UserId'],'transaction':_0x25b2a0,'lock':_0x25b2a0['LOCK'][_0x09b4('0x2f')],'include':_0x18e051['options']?_0x18e051[_0x09b4('0x17')][_0x09b4('0x1b')]?_['map'](_0x18e051[_0x09b4('0x17')]['include'],function(_0x1fcbad){return{'model':db[_0x1fcbad['model']],'as':_0x1fcbad['as'],'attributes':_0x1fcbad['attributes'],'include':_0x1fcbad[_0x09b4('0x1b')]?_[_0x09b4('0x1d')](_0x1fcbad['include'],function(_0x5cf176){return{'model':db[_0x5cf176[_0x09b4('0x1c')]],'as':_0x5cf176['as'],'attributes':_0x5cf176[_0x09b4('0x19')],'include':_0x5cf176[_0x09b4('0x1b')]?_[_0x09b4('0x1d')](_0x5cf176[_0x09b4('0x1b')],function(_0x35a5b9){return{'model':db[_0x35a5b9[_0x09b4('0x1c')]],'as':_0x35a5b9['as'],'attributes':_0x35a5b9[_0x09b4('0x19')]};}):[]};}):[]};}):[]:[]})[_0x09b4('0xb')](function(_0x1dc3b5){var _0x169719=[];for(var _0xe59197=0x0;_0xe59197<_0x1dc3b5['length'];_0xe59197+=0x1){_0x169719['push'](_0x1dc3b5[_0xe59197]['update'](_0x18e051['body'],{'transaction':_0x25b2a0}));}return BPromise[_0x09b4('0x34')](_0x169719);});})[_0x09b4('0xb')](function(_0x277e4b){logger[_0x09b4('0xc')](_0x09b4('0x3e'),_0x18e051);logger[_0x09b4('0xf')]('GetContactRecallMe',_0x18e051,JSON[_0x09b4('0x10')](_0x277e4b));_0x47a660(_0x277e4b);})[_0x09b4('0x1e')](function(_0xbdd4fc){logger[_0x09b4('0x11')]('GetContactRecallMe',_0xbdd4fc['message'],_0x18e051);_0x2e7e2d(_0x588d5b[_0x09b4('0x11')](0x1f4,_0xbdd4fc[_0x09b4('0x12')]));});});});}; \ No newline at end of file +var _0x7150=['update','body','UpdateCmHopper','destroy','DestroyCmHopper','CmContact','sequelize','transaction','findAll','order','LOCK','UPDATE','Contact','keys','push','all','GetContactDialer','MoveContactManagedDialer','CmHopperFinal','COUNT','\x22%s\x22','YYYY-MM-DD\x20HH:mm:ss','contactsRescheduled','CountReScheduled','GetContactRecallMe','UserId','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','CmHopper,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','info','result','catch','GetCmHopper','CmHopper','options','raw','where','attributes','limit','map','model','include','ShowCmHopper','create','CreateCmHopper'];(function(_0x229f5e,_0x433f0f){var _0x2d62ff=function(_0xe4d381){while(--_0xe4d381){_0x229f5e['push'](_0x229f5e['shift']());}};_0x2d62ff(++_0x433f0f);}(_0x7150,0x96));var _0x0715=function(_0x55b252,_0xad8500){_0x55b252=_0x55b252-0x0;var _0x5d0705=_0x7150[_0x55b252];return _0x5d0705;};'use strict';var _=require(_0x0715('0x0'));var util=require(_0x0715('0x1'));var moment=require(_0x0715('0x2'));var BPromise=require(_0x0715('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0715('0x4'));var db=require(_0x0715('0x5'))['db'];var utils=require(_0x0715('0x6'));var logger=require('../../config/logger')(_0x0715('0x7'));var config=require(_0x0715('0x8'));var jayson=require(_0x0715('0x9'));var client=jayson[_0x0715('0xa')][_0x0715('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4006b4,_0x58f3f8,_0x2b3623){return new BPromise(function(_0x5ee852,_0x22b57d){return client[_0x0715('0xc')](_0x4006b4,_0x2b3623)[_0x0715('0xd')](function(_0x18c80e){logger['info'](_0x0715('0xe'),_0x58f3f8,_0x0715('0xf'));logger[_0x0715('0x10')]('CmHopper,\x20%s,\x20%s,\x20%s',_0x58f3f8,_0x0715('0xf'),JSON[_0x0715('0x11')](_0x18c80e));if(_0x18c80e[_0x0715('0x12')]){if(_0x18c80e[_0x0715('0x12')]['code']===0x1f4){logger[_0x0715('0x12')](_0x0715('0xe'),_0x58f3f8,_0x18c80e[_0x0715('0x12')][_0x0715('0x13')]);return _0x22b57d(_0x18c80e[_0x0715('0x12')][_0x0715('0x13')]);}logger[_0x0715('0x12')](_0x0715('0xe'),_0x58f3f8,_0x18c80e[_0x0715('0x12')][_0x0715('0x13')]);return _0x5ee852(_0x18c80e[_0x0715('0x12')][_0x0715('0x13')]);}else{logger[_0x0715('0x14')](_0x0715('0xe'),_0x58f3f8,_0x0715('0xf'));_0x5ee852(_0x18c80e[_0x0715('0x15')][_0x0715('0x13')]);}})[_0x0715('0x16')](function(_0xe6b53){logger[_0x0715('0x12')](_0x0715('0xe'),_0x58f3f8,_0xe6b53);_0x22b57d(_0xe6b53);});});}exports[_0x0715('0x17')]=function(_0x44634a){var _0x9b2c2=this;return new Promise(function(_0x487b82,_0x1c4c08){return db[_0x0715('0x18')]['findAll']({'raw':_0x44634a[_0x0715('0x19')]?_0x44634a[_0x0715('0x19')][_0x0715('0x1a')]===undefined?!![]:![]:!![],'where':_0x44634a[_0x0715('0x19')]?_0x44634a[_0x0715('0x19')][_0x0715('0x1b')]||null:null,'attributes':_0x44634a[_0x0715('0x19')]?_0x44634a[_0x0715('0x19')][_0x0715('0x1c')]||null:null,'limit':_0x44634a[_0x0715('0x19')]?_0x44634a[_0x0715('0x19')][_0x0715('0x1d')]||null:null,'include':_0x44634a[_0x0715('0x19')]?_0x44634a[_0x0715('0x19')]['include']?_[_0x0715('0x1e')](_0x44634a[_0x0715('0x19')]['include'],function(_0x390cf8){return{'model':db[_0x390cf8[_0x0715('0x1f')]],'as':_0x390cf8['as'],'attributes':_0x390cf8[_0x0715('0x1c')],'include':_0x390cf8[_0x0715('0x20')]?_[_0x0715('0x1e')](_0x390cf8[_0x0715('0x20')],function(_0x1160c4){return{'model':db[_0x1160c4['model']],'as':_0x1160c4['as'],'attributes':_0x1160c4[_0x0715('0x1c')],'include':_0x1160c4[_0x0715('0x20')]?_[_0x0715('0x1e')](_0x1160c4[_0x0715('0x20')],function(_0x1b3b0e){return{'model':db[_0x1b3b0e['model']],'as':_0x1b3b0e['as'],'attributes':_0x1b3b0e['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x343b81){logger[_0x0715('0x14')](_0x0715('0x17'),_0x44634a);logger['debug']('GetCmHopper',_0x44634a,JSON[_0x0715('0x11')](_0x343b81));_0x487b82(_0x343b81);})[_0x0715('0x16')](function(_0x5b6d15){logger[_0x0715('0x12')](_0x0715('0x17'),_0x5b6d15[_0x0715('0x13')],_0x44634a);_0x1c4c08(_0x9b2c2[_0x0715('0x12')](0x1f4,_0x5b6d15[_0x0715('0x13')]));});});};exports[_0x0715('0x21')]=function(_0x12a1c7){var _0x578062=this;return new Promise(function(_0xceb23c,_0x2f1c7b){return db['CmHopper']['find']({'raw':_0x12a1c7[_0x0715('0x19')]?_0x12a1c7[_0x0715('0x19')][_0x0715('0x1a')]===undefined?!![]:![]:!![],'where':_0x12a1c7[_0x0715('0x19')]?_0x12a1c7[_0x0715('0x19')][_0x0715('0x1b')]||null:null,'attributes':_0x12a1c7[_0x0715('0x19')]?_0x12a1c7[_0x0715('0x19')][_0x0715('0x1c')]||null:null,'include':_0x12a1c7[_0x0715('0x19')]?_0x12a1c7['options'][_0x0715('0x20')]?_[_0x0715('0x1e')](_0x12a1c7[_0x0715('0x19')][_0x0715('0x20')],function(_0x2a07c8){return{'model':db[_0x2a07c8[_0x0715('0x1f')]],'as':_0x2a07c8['as'],'attributes':_0x2a07c8['attributes'],'include':_0x2a07c8[_0x0715('0x20')]?_[_0x0715('0x1e')](_0x2a07c8[_0x0715('0x20')],function(_0x5b6388){return{'model':db[_0x5b6388[_0x0715('0x1f')]],'as':_0x5b6388['as'],'attributes':_0x5b6388['attributes'],'include':_0x5b6388[_0x0715('0x20')]?_[_0x0715('0x1e')](_0x5b6388[_0x0715('0x20')],function(_0x42519c){return{'model':db[_0x42519c['model']],'as':_0x42519c['as'],'attributes':_0x42519c['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x3fc564){logger['info'](_0x0715('0x21'),_0x12a1c7);logger[_0x0715('0x10')](_0x0715('0x21'),_0x12a1c7,JSON[_0x0715('0x11')](_0x3fc564));_0xceb23c(_0x3fc564);})[_0x0715('0x16')](function(_0x37ff9b){logger[_0x0715('0x12')]('ShowCmHopper',_0x37ff9b[_0x0715('0x13')],_0x12a1c7);_0x2f1c7b(_0x578062[_0x0715('0x12')](0x1f4,_0x37ff9b['message']));});});};exports['CreateCmHopper']=function(_0x2d6ac8){var _0x40ccfa=this;return new Promise(function(_0x12fdb7,_0x44b7c9){return db[_0x0715('0x18')][_0x0715('0x22')](_0x2d6ac8['body'],{'raw':_0x2d6ac8['options']?_0x2d6ac8[_0x0715('0x19')]['raw']===undefined?!![]:![]:!![]})[_0x0715('0xd')](function(_0x180841){logger[_0x0715('0x14')](_0x0715('0x23'),_0x2d6ac8);logger[_0x0715('0x10')](_0x0715('0x23'),_0x2d6ac8,JSON[_0x0715('0x11')](_0x180841));_0x12fdb7(_0x180841);})[_0x0715('0x16')](function(_0x463752){logger[_0x0715('0x12')]('CreateCmHopper',_0x463752[_0x0715('0x13')],_0x2d6ac8);_0x44b7c9(_0x40ccfa[_0x0715('0x12')](0x1f4,_0x463752[_0x0715('0x13')]));});});};exports['UpdateCmHopper']=function(_0x2698d4){var _0x276fb3=this;return new Promise(function(_0x4bd886,_0x133388){return db[_0x0715('0x18')][_0x0715('0x24')](_0x2698d4[_0x0715('0x25')],{'raw':_0x2698d4['options']?_0x2698d4['options'][_0x0715('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2698d4[_0x0715('0x19')]?_0x2698d4['options'][_0x0715('0x1b')]||null:null,'attributes':_0x2698d4[_0x0715('0x19')]?_0x2698d4[_0x0715('0x19')][_0x0715('0x1c')]||null:null,'limit':_0x2698d4[_0x0715('0x19')]?_0x2698d4['options'][_0x0715('0x1d')]||null:null})[_0x0715('0xd')](function(_0xb1d4bb){logger['info']('UpdateCmHopper',_0x2698d4);logger['debug'](_0x0715('0x26'),_0x2698d4,JSON['stringify'](_0xb1d4bb));_0x4bd886(_0xb1d4bb);})['catch'](function(_0x72c128){logger['error'](_0x0715('0x26'),_0x72c128[_0x0715('0x13')],_0x2698d4);_0x133388(_0x276fb3[_0x0715('0x12')](0x1f4,_0x72c128['message']));});});};exports['DestroyCmHopper']=function(_0xc2119b){var _0x2980f2=this;return new Promise(function(_0x249415,_0x3086e1){return db['CmHopper'][_0x0715('0x27')]({'where':_0xc2119b['options']?_0xc2119b['options']['where']||null:null})[_0x0715('0xd')](function(_0x18db7a){logger[_0x0715('0x14')](_0x0715('0x28'),_0xc2119b);logger['debug'](_0x0715('0x28'),_0xc2119b,JSON[_0x0715('0x11')](_0x18db7a));_0x249415(_0x18db7a);})[_0x0715('0x16')](function(_0x4e84b7){logger[_0x0715('0x12')](_0x0715('0x28'),_0x4e84b7[_0x0715('0x13')],_0xc2119b);_0x3086e1(_0x2980f2[_0x0715('0x12')](0x1f4,_0x4e84b7[_0x0715('0x13')]));});});};exports['GetContactDialer']=function(_0x301513){var _0x457699=this;return new Promise(function(_0x22873f,_0x41cb66){return db[_0x0715('0x29')]['describe']()[_0x0715('0xd')](function(_0x1bd0d2){return db[_0x0715('0x2a')][_0x0715('0x2b')](function(_0x647f65){return db[_0x0715('0x18')][_0x0715('0x2c')]({'where':_0x301513[_0x0715('0x19')]?_0x301513[_0x0715('0x19')][_0x0715('0x1b')]||null:null,'attributes':_0x301513[_0x0715('0x19')]?_0x301513['options'][_0x0715('0x1c')]||null:null,'limit':_0x301513['options']?_0x301513[_0x0715('0x19')][_0x0715('0x1d')]||null:null,'order':_0x301513[_0x0715('0x19')]?_0x301513['options'][_0x0715('0x2d')]||null:null,'transaction':_0x647f65,'lock':_0x647f65[_0x0715('0x2e')][_0x0715('0x2f')],'include':[{'model':db[_0x0715('0x29')],'as':_0x0715('0x30'),'attributes':_[_0x0715('0x31')](_0x1bd0d2)}]})[_0x0715('0xd')](function(_0x5b70ae){var _0x4d93c2=[];for(var _0xd0009e=0x0;_0xd0009e<_0x5b70ae['length'];_0xd0009e+=0x1){_0x4d93c2[_0x0715('0x32')](_0x5b70ae[_0xd0009e][_0x0715('0x24')](_0x301513[_0x0715('0x25')],{'transaction':_0x647f65}));}return BPromise[_0x0715('0x33')](_0x4d93c2);});})[_0x0715('0xd')](function(_0x4624cd){logger[_0x0715('0x14')](_0x0715('0x34'),_0x301513);logger[_0x0715('0x10')](_0x0715('0x34'),_0x301513,JSON[_0x0715('0x11')](_0x4624cd));_0x22873f(_0x4624cd);})['catch'](function(_0x5a3c35){logger['error']('GetContactDialer',_0x5a3c35['message'],_0x301513);_0x41cb66(_0x457699['error'](0x1f4,_0x5a3c35[_0x0715('0x13')]));});});});};exports[_0x0715('0x35')]=function(_0x3c08c5){var _0x268d09=this;return new Promise(function(_0x513a1b,_0x3adfe2){return db[_0x0715('0x2a')]['transaction'](function(_0x4c6afb){return db[_0x0715('0x36')][_0x0715('0x22')](_0x3c08c5['body'],{'raw':_0x3c08c5[_0x0715('0x19')]?_0x3c08c5[_0x0715('0x19')]['raw']===undefined?!![]:![]:!![],'transaction':_0x4c6afb})[_0x0715('0xd')](function(){return db[_0x0715('0x18')][_0x0715('0x27')]({'where':_0x3c08c5[_0x0715('0x19')]?_0x3c08c5[_0x0715('0x19')]['where']||null:null,'transaction':_0x4c6afb});});})[_0x0715('0xd')](function(_0x5f49a2){logger[_0x0715('0x14')](_0x0715('0x35'),_0x3c08c5);logger[_0x0715('0x10')]('MoveContactManagedDialer',_0x3c08c5,JSON[_0x0715('0x11')](_0x5f49a2));_0x513a1b(_0x5f49a2);})['catch'](function(_0x44bf61){logger['error'](_0x0715('0x35'),_0x44bf61[_0x0715('0x13')],_0x3c08c5);_0x3adfe2(_0x268d09[_0x0715('0x12')](0x1f4,_0x44bf61[_0x0715('0x13')]));});});};exports['CountReScheduled']=function(_0x484e28){var _0x3bdf3f=this;return new Promise(function(_0x474996,_0x4a22d1){return db[_0x0715('0x18')][_0x0715('0x2c')]({'raw':_0x484e28['options']?_0x484e28[_0x0715('0x19')][_0x0715('0x1a')]===undefined?!![]:![]:!![],'where':_0x484e28[_0x0715('0x19')]?_0x484e28['options'][_0x0715('0x1b')]||null:null,'attributes':[[db[_0x0715('0x2a')]['fn'](_0x0715('0x37'),db[_0x0715('0x2a')]['fn']('IF',db['sequelize']['literal']('`scheduledat`\x20>=\x20'+util['format'](_0x0715('0x38'),moment()['format'](_0x0715('0x39')))+'\x20,\x201,\x20null'))),_0x0715('0x3a')]]})[_0x0715('0xd')](function(_0x36403b){logger[_0x0715('0x14')](_0x0715('0x3b'),_0x484e28);logger[_0x0715('0x10')](_0x0715('0x3b'),_0x484e28,JSON['stringify'](_0x36403b));_0x474996(_0x36403b);})['catch'](function(_0x5030f0){logger[_0x0715('0x12')](_0x0715('0x3b'),_0x5030f0[_0x0715('0x13')],_0x484e28);_0x4a22d1(_0x3bdf3f['error'](0x1f4,_0x5030f0['message']));});});};exports[_0x0715('0x3c')]=function(_0x183e06){var _0x59b1c3=this;return new Promise(function(_0x290ee7,_0x1dd9aa){return db[_0x0715('0x29')]['describe']()[_0x0715('0xd')](function(_0x4f53ff){return db['sequelize'][_0x0715('0x2b')](function(_0x4c3490){return db['CmHopper'][_0x0715('0x2c')]({'where':_0x183e06[_0x0715('0x19')]?_0x183e06['options'][_0x0715('0x1b')]||null:null,'attributes':_0x183e06[_0x0715('0x19')]?_0x183e06[_0x0715('0x19')][_0x0715('0x1c')]||null:null,'limit':0x1,'order':_0x183e06[_0x0715('0x19')]?_0x183e06['options'][_0x0715('0x2d')]||null:null,'group':db[_0x0715('0x18')][_0x0715('0x3d')],'transaction':_0x4c3490,'lock':_0x4c3490['LOCK'][_0x0715('0x2f')],'include':_0x183e06['options']?_0x183e06[_0x0715('0x19')][_0x0715('0x20')]?_['map'](_0x183e06[_0x0715('0x19')][_0x0715('0x20')],function(_0xeb224f){return{'model':db[_0xeb224f['model']],'as':_0xeb224f['as'],'attributes':_0xeb224f[_0x0715('0x1c')],'include':_0xeb224f['include']?_[_0x0715('0x1e')](_0xeb224f[_0x0715('0x20')],function(_0x3c267a){return{'model':db[_0x3c267a[_0x0715('0x1f')]],'as':_0x3c267a['as'],'attributes':_0x3c267a[_0x0715('0x1c')],'include':_0x3c267a[_0x0715('0x20')]?_[_0x0715('0x1e')](_0x3c267a[_0x0715('0x20')],function(_0x3cb221){return{'model':db[_0x3cb221['model']],'as':_0x3cb221['as'],'attributes':_0x3cb221[_0x0715('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xb61925){var _0x176ee1=[];for(var _0x14dfa4=0x0;_0x14dfa4<_0xb61925['length'];_0x14dfa4+=0x1){_0x176ee1[_0x0715('0x32')](_0xb61925[_0x14dfa4]['update'](_0x183e06[_0x0715('0x25')],{'transaction':_0x4c3490}));}return BPromise[_0x0715('0x33')](_0x176ee1);});})['then'](function(_0x432d7b){logger[_0x0715('0x14')](_0x0715('0x3c'),_0x183e06);logger[_0x0715('0x10')](_0x0715('0x3c'),_0x183e06,JSON[_0x0715('0x11')](_0x432d7b));_0x290ee7(_0x432d7b);})[_0x0715('0x16')](function(_0x54323e){logger[_0x0715('0x12')]('GetContactRecallMe',_0x54323e[_0x0715('0x13')],_0x183e06);_0x1dd9aa(_0x59b1c3[_0x0715('0x12')](0x1f4,_0x54323e[_0x0715('0x13')]));});});});}; \ No newline at end of file diff --git a/server/api/cmHopper/index.js b/server/api/cmHopper/index.js index fbe869a..98934ee 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 _0x63a2=['getPreview','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../config/environment','./cmHopper.controller','isAuthenticated','index','/describe','describe','get','/opencontacts','/:id','show','/preview'];(function(_0x316c42,_0x3391f0){var _0x2b38f7=function(_0x38d2cf){while(--_0x38d2cf){_0x316c42['push'](_0x316c42['shift']());}};_0x2b38f7(++_0x3391f0);}(_0x63a2,0x1be));var _0x263a=function(_0x2bf623,_0x39e334){_0x2bf623=_0x2bf623-0x0;var _0x32c626=_0x63a2[_0x2bf623];return _0x32c626;};'use strict';var multer=require(_0x263a('0x0'));var util=require(_0x263a('0x1'));var path=require(_0x263a('0x2'));var timeout=require(_0x263a('0x3'));var express=require('express');var router=express[_0x263a('0x4')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x263a('0x5'));var controller=require(_0x263a('0x6'));router['get']('/',auth[_0x263a('0x7')](),controller[_0x263a('0x8')]);router['get'](_0x263a('0x9'),auth['isAuthenticated'](),controller[_0x263a('0xa')]);router[_0x263a('0xb')](_0x263a('0xc'),auth[_0x263a('0x7')](),controller['getOpenContacts']);router[_0x263a('0xb')](_0x263a('0xd'),auth[_0x263a('0x7')](),controller[_0x263a('0xe')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router['post'](_0x263a('0xf'),auth[_0x263a('0x7')](),controller[_0x263a('0x10')]);router[_0x263a('0x11')](_0x263a('0xd'),auth[_0x263a('0x7')](),controller[_0x263a('0x12')]);router[_0x263a('0x13')](_0x263a('0xd'),auth[_0x263a('0x7')](),controller[_0x263a('0x14')]);module[_0x263a('0x15')]=router; \ No newline at end of file +var _0x4a2a=['../../components/interaction/service','get','isAuthenticated','/describe','describe','/opencontacts','getOpenContacts','/:id','show','post','create','/preview','getPreview','destroy','exports','multer','util','path','express','Router','../../components/auth/service'];(function(_0x5953d7,_0x50c410){var _0x2763f1=function(_0x53fd70){while(--_0x53fd70){_0x5953d7['push'](_0x5953d7['shift']());}};_0x2763f1(++_0x50c410);}(_0x4a2a,0x120));var _0xa4a2=function(_0x139db6,_0x4eb52c){_0x139db6=_0x139db6-0x0;var _0x3efcfc=_0x4a2a[_0x139db6];return _0x3efcfc;};'use strict';var multer=require(_0xa4a2('0x0'));var util=require(_0xa4a2('0x1'));var path=require(_0xa4a2('0x2'));var timeout=require('connect-timeout');var express=require(_0xa4a2('0x3'));var router=express[_0xa4a2('0x4')]();var auth=require(_0xa4a2('0x5'));var interaction=require(_0xa4a2('0x6'));var config=require('../../config/environment');var controller=require('./cmHopper.controller');router[_0xa4a2('0x7')]('/',auth[_0xa4a2('0x8')](),controller['index']);router[_0xa4a2('0x7')](_0xa4a2('0x9'),auth[_0xa4a2('0x8')](),controller[_0xa4a2('0xa')]);router[_0xa4a2('0x7')](_0xa4a2('0xb'),auth['isAuthenticated'](),controller[_0xa4a2('0xc')]);router[_0xa4a2('0x7')](_0xa4a2('0xd'),auth[_0xa4a2('0x8')](),controller[_0xa4a2('0xe')]);router[_0xa4a2('0xf')]('/',auth[_0xa4a2('0x8')](),controller[_0xa4a2('0x10')]);router['post'](_0xa4a2('0x11'),auth[_0xa4a2('0x8')](),controller[_0xa4a2('0x12')]);router['put']('/:id',auth[_0xa4a2('0x8')](),controller['update']);router['delete']('/:id',auth[_0xa4a2('0x8')](),controller[_0xa4a2('0x13')]);module[_0xa4a2('0x14')]=router; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.attributes.js b/server/api/cmHopperBlack/cmHopperBlack.attributes.js index 206d03a..27cb75b 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 _0x29e1=['exports','STRING','contactListQueue','INTEGER','moment','sequelize'];(function(_0xaeef7d,_0x1d0a68){var _0x173fb2=function(_0x1c3ae7){while(--_0x1c3ae7){_0xaeef7d['push'](_0xaeef7d['shift']());}};_0x173fb2(++_0x1d0a68);}(_0x29e1,0xa6));var _0x129e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x29e1[_0x3dd15e];return _0x231fd0;};'use strict';var moment=require(_0x129e('0x0'));var Sequelize=require(_0x129e('0x1'));module[_0x129e('0x2')]={'phone':{'type':Sequelize[_0x129e('0x3')],'allowNull':![]},'ContactId':{'type':Sequelize['INTEGER'],'unique':'contactListQueue'},'ListId':{'type':Sequelize['INTEGER'],'unique':_0x129e('0x4')},'VoiceQueueId':{'type':Sequelize[_0x129e('0x5')],'unique':_0x129e('0x4')}}; \ No newline at end of file +var _0x193c=['exports','INTEGER','contactListQueue','moment','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x193c,0xad));var _0xc193=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x193c[_0x167cc1];return _0x10bc4b;};'use strict';var moment=require(_0xc193('0x0'));var Sequelize=require(_0xc193('0x1'));module[_0xc193('0x2')]={'phone':{'type':Sequelize['STRING'],'allowNull':![]},'ContactId':{'type':Sequelize[_0xc193('0x3')],'unique':_0xc193('0x4')},'ListId':{'type':Sequelize['INTEGER'],'unique':_0xc193('0x4')},'VoiceQueueId':{'type':Sequelize[_0xc193('0x3')],'unique':_0xc193('0x4')}}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.controller.js b/server/api/cmHopperBlack/cmHopperBlack.controller.js index ac76365..ad95340 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 _0xbfb6=['to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset','limit','set','Content-Range','update','then','error','name','send','index','CmHopperBlack','rawAttributes','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','map','type','key','VIRTUAL','field','merge','options','includeAll','include','findAll','rows','catch','params','length','find','body','destroy','describe','html-pdf','eml-format','zip-dir','fast-json-patch','moment','mustache','sox'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0xbfb6,0x89));var _0x6bfb=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0xbfb6[_0x59ee6f];return _0x4c0979;};'use strict';var pdf=require(_0x6bfb('0x0'));var emlformat=require(_0x6bfb('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x6bfb('0x2'));var jsonpatch=require(_0x6bfb('0x3'));var rp=require('request-promise');var moment=require(_0x6bfb('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x6bfb('0x5'));var util=require('util');var path=require('path');var sox=require(_0x6bfb('0x6'));var csv=require(_0x6bfb('0x7'));var ejs=require(_0x6bfb('0x8'));var fs=require('fs');var _=require(_0x6bfb('0x9'));var squel=require(_0x6bfb('0xa'));var crypto=require(_0x6bfb('0xb'));var jsforce=require(_0x6bfb('0xc'));var deskjs=require(_0x6bfb('0xd'));var toCsv=require(_0x6bfb('0x7'));var querystring=require(_0x6bfb('0xe'));var Papa=require(_0x6bfb('0xf'));var Redis=require(_0x6bfb('0x10'));var authService=require(_0x6bfb('0x11'));var qs=require(_0x6bfb('0x12'));var as=require(_0x6bfb('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6bfb('0x14'))(_0x6bfb('0x15'));var utils=require(_0x6bfb('0x16'));var config=require(_0x6bfb('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2abbb4,_0x3cd941){_0x3cd941=_0x3cd941||0xcc;return function(_0x492f08){if(_0x492f08){return _0x2abbb4[_0x6bfb('0x18')](_0x3cd941);}return _0x2abbb4[_0x6bfb('0x19')](_0x3cd941)[_0x6bfb('0x1a')]();};}function respondWithResult(_0x5aea51,_0xe7f1b){_0xe7f1b=_0xe7f1b||0xc8;return function(_0x5873b0){if(_0x5873b0){return _0x5aea51[_0x6bfb('0x19')](_0xe7f1b)[_0x6bfb('0x1b')](_0x5873b0);}};}function respondWithFilteredResult(_0x269a34,_0x1d0030){return function(_0x114ab8){if(_0x114ab8){var _0x619a49=_0x114ab8[_0x6bfb('0x1c')],_0x2bf3fe=_0x1d0030['offset'],_0x3e7fe9=_0x1d0030[_0x6bfb('0x1d')]+_0x1d0030[_0x6bfb('0x1e')],_0x1db980;if(_0x3e7fe9>=_0x619a49){_0x3e7fe9=_0x619a49;_0x1db980=0xc8;}else{_0x1db980=0xce;}_0x269a34[_0x6bfb('0x19')](_0x1db980);return _0x269a34[_0x6bfb('0x1f')](_0x6bfb('0x20'),_0x2bf3fe+'-'+_0x3e7fe9+'/'+_0x619a49)[_0x6bfb('0x1b')](_0x114ab8);}return null;};}function patchUpdates(_0x53c003){return function(_0x5c2c39){try{jsonpatch['apply'](_0x5c2c39,_0x53c003,!![]);}catch(_0x3d117f){return BPromise['reject'](_0x3d117f);}return _0x5c2c39['save']();};}function saveUpdates(_0xff11d7,_0x235534){return function(_0x4c40a0){if(_0x4c40a0){return _0x4c40a0[_0x6bfb('0x21')](_0xff11d7)[_0x6bfb('0x22')](function(_0x4bd23f){return _0x4bd23f;});}return null;};}function removeEntity(_0xa1da97,_0x5a2ede){return function(_0x45cc06){if(_0x45cc06){return _0x45cc06['destroy']()[_0x6bfb('0x22')](function(){_0xa1da97[_0x6bfb('0x19')](0xcc)[_0x6bfb('0x1a')]();});}};}function handleEntityNotFound(_0x4beb43,_0x1bc1cc){return function(_0x112187){if(!_0x112187){_0x4beb43[_0x6bfb('0x18')](0x194);}return _0x112187;};}function handleError(_0x3e9cef,_0x5a1faa){_0x5a1faa=_0x5a1faa||0x1f4;return function(_0x39d558){logger[_0x6bfb('0x23')](_0x39d558['stack']);if(_0x39d558[_0x6bfb('0x24')]){delete _0x39d558[_0x6bfb('0x24')];}_0x3e9cef[_0x6bfb('0x19')](_0x5a1faa)[_0x6bfb('0x25')](_0x39d558);};}exports[_0x6bfb('0x26')]=function(_0x4b2317,_0x998ffc){var _0x1c1971={},_0x4b6ee4={},_0x4ea675={'count':0x0,'rows':[]};var _0x79f69=db[_0x6bfb('0x27')][_0x6bfb('0x28')];_0x4b6ee4[_0x6bfb('0x29')]=_[_0x6bfb('0x2a')](_0x79f69);_0x4b6ee4['query']=_[_0x6bfb('0x2a')](_0x4b2317[_0x6bfb('0x2b')]);_0x4b6ee4[_0x6bfb('0x2c')]=_[_0x6bfb('0x2d')](_0x4b6ee4[_0x6bfb('0x29')],_0x4b6ee4[_0x6bfb('0x2b')]);_0x1c1971[_0x6bfb('0x2e')]=_[_0x6bfb('0x2d')](_0x4b6ee4[_0x6bfb('0x29')],qs[_0x6bfb('0x2f')](_0x4b2317[_0x6bfb('0x2b')][_0x6bfb('0x2f')]));_0x1c1971[_0x6bfb('0x2e')]=_0x1c1971[_0x6bfb('0x2e')]['length']?_0x1c1971[_0x6bfb('0x2e')]:_0x4b6ee4['model'];if(!_0x4b2317[_0x6bfb('0x2b')][_0x6bfb('0x30')](_0x6bfb('0x31'))){_0x1c1971['limit']=qs[_0x6bfb('0x1e')](_0x4b2317[_0x6bfb('0x2b')][_0x6bfb('0x1e')]);_0x1c1971[_0x6bfb('0x1d')]=qs[_0x6bfb('0x1d')](_0x4b2317[_0x6bfb('0x2b')]['offset']);}_0x1c1971['order']=qs['sort'](_0x4b2317[_0x6bfb('0x2b')][_0x6bfb('0x32')]);_0x1c1971[_0x6bfb('0x33')]=qs[_0x6bfb('0x2c')](_[_0x6bfb('0x34')](_0x4b2317['query'],_0x4b6ee4[_0x6bfb('0x2c')]));if(_0x4b2317['query'][_0x6bfb('0x35')]){_0x1c1971[_0x6bfb('0x33')]=_['merge'](_0x1c1971[_0x6bfb('0x33')],{'$or':_[_0x6bfb('0x36')](_0x79f69,function(_0x51ec67){if(_0x51ec67[_0x6bfb('0x37')][_0x6bfb('0x38')]!==_0x6bfb('0x39')){var _0x31766b={};_0x31766b[_0x51ec67[_0x6bfb('0x3a')]]={'$like':'%'+_0x4b2317['query']['filter']+'%'};return _0x31766b;}})});}_0x1c1971=_[_0x6bfb('0x3b')]({},_0x1c1971,_0x4b2317[_0x6bfb('0x3c')]);var _0x2ffdbe={'where':_0x1c1971[_0x6bfb('0x33')]};return db[_0x6bfb('0x27')][_0x6bfb('0x1c')](_0x2ffdbe)[_0x6bfb('0x22')](function(_0x5935e9){_0x4ea675[_0x6bfb('0x1c')]=_0x5935e9;if(_0x4b2317[_0x6bfb('0x2b')][_0x6bfb('0x3d')]){_0x1c1971[_0x6bfb('0x3e')]=[{'all':!![]}];}return db[_0x6bfb('0x27')][_0x6bfb('0x3f')](_0x1c1971);})[_0x6bfb('0x22')](function(_0x462065){_0x4ea675[_0x6bfb('0x40')]=_0x462065;return _0x4ea675;})['then'](respondWithFilteredResult(_0x998ffc,_0x1c1971))[_0x6bfb('0x41')](handleError(_0x998ffc,null));};exports['show']=function(_0x47aa68,_0x5ae6f1){var _0x32b731={'raw':!![],'where':{'id':_0x47aa68[_0x6bfb('0x42')]['id']}},_0x499a53={};_0x499a53[_0x6bfb('0x29')]=_[_0x6bfb('0x2a')](db[_0x6bfb('0x27')][_0x6bfb('0x28')]);_0x499a53[_0x6bfb('0x2b')]=_['keys'](_0x47aa68[_0x6bfb('0x2b')]);_0x499a53['filters']=_[_0x6bfb('0x2d')](_0x499a53[_0x6bfb('0x29')],_0x499a53[_0x6bfb('0x2b')]);_0x32b731[_0x6bfb('0x2e')]=_['intersection'](_0x499a53[_0x6bfb('0x29')],qs[_0x6bfb('0x2f')](_0x47aa68[_0x6bfb('0x2b')][_0x6bfb('0x2f')]));_0x32b731['attributes']=_0x32b731[_0x6bfb('0x2e')][_0x6bfb('0x43')]?_0x32b731[_0x6bfb('0x2e')]:_0x499a53[_0x6bfb('0x29')];if(_0x47aa68[_0x6bfb('0x2b')][_0x6bfb('0x3d')]){_0x32b731['include']=[{'all':!![]}];}_0x32b731=_['merge']({},_0x32b731,_0x47aa68[_0x6bfb('0x3c')]);return db[_0x6bfb('0x27')][_0x6bfb('0x44')](_0x32b731)['then'](handleEntityNotFound(_0x5ae6f1,null))[_0x6bfb('0x22')](respondWithResult(_0x5ae6f1,null))[_0x6bfb('0x41')](handleError(_0x5ae6f1,null));};exports[_0x6bfb('0x21')]=function(_0x5db45f,_0xb0e159){if(_0x5db45f['body']['id']){delete _0x5db45f[_0x6bfb('0x45')]['id'];}return db[_0x6bfb('0x27')]['find']({'where':{'id':_0x5db45f[_0x6bfb('0x42')]['id']}})[_0x6bfb('0x22')](handleEntityNotFound(_0xb0e159,null))[_0x6bfb('0x22')](saveUpdates(_0x5db45f[_0x6bfb('0x45')],null))[_0x6bfb('0x22')](respondWithResult(_0xb0e159,null))[_0x6bfb('0x41')](handleError(_0xb0e159,null));};exports[_0x6bfb('0x46')]=function(_0x369f51,_0xac0724){return db['CmHopperBlack']['find']({'where':{'id':_0x369f51[_0x6bfb('0x42')]['id']}})[_0x6bfb('0x22')](handleEntityNotFound(_0xac0724,null))[_0x6bfb('0x22')](removeEntity(_0xac0724,null))['catch'](handleError(_0xac0724,null));};exports[_0x6bfb('0x47')]=function(_0x2c01bb,_0x6621b4){return db[_0x6bfb('0x27')][_0x6bfb('0x47')]()[_0x6bfb('0x22')](respondWithResult(_0x6621b4,null))[_0x6bfb('0x41')](handleError(_0x6621b4,null));}; \ No newline at end of file +var _0x3ab0=['describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','count','offset','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','CmHopperBlack','rawAttributes','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','limit','order','sort','where','pick','filter','merge','map','type','key','VIRTUAL','field','options','includeAll','include','findAll','rows','show','params','find','catch','body'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0x3ab0,0xeb));var _0x03ab=function(_0x10be6c,_0x23b67f){_0x10be6c=_0x10be6c-0x0;var _0x587180=_0x3ab0[_0x10be6c];return _0x587180;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x03ab('0x0'));var rimraf=require(_0x03ab('0x1'));var zipdir=require(_0x03ab('0x2'));var jsonpatch=require(_0x03ab('0x3'));var rp=require(_0x03ab('0x4'));var moment=require(_0x03ab('0x5'));var BPromise=require(_0x03ab('0x6'));var Mustache=require(_0x03ab('0x7'));var util=require(_0x03ab('0x8'));var path=require(_0x03ab('0x9'));var sox=require(_0x03ab('0xa'));var csv=require(_0x03ab('0xb'));var ejs=require(_0x03ab('0xc'));var fs=require('fs');var _=require(_0x03ab('0xd'));var squel=require('squel');var crypto=require(_0x03ab('0xe'));var jsforce=require(_0x03ab('0xf'));var deskjs=require(_0x03ab('0x10'));var toCsv=require('to-csv');var querystring=require(_0x03ab('0x11'));var Papa=require(_0x03ab('0x12'));var Redis=require(_0x03ab('0x13'));var authService=require(_0x03ab('0x14'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x03ab('0x15'));var logger=require('../../config/logger')(_0x03ab('0x16'));var utils=require(_0x03ab('0x17'));var config=require(_0x03ab('0x18'));var db=require(_0x03ab('0x19'))['db'];function respondWithStatusCode(_0x31fb93,_0x5ea304){_0x5ea304=_0x5ea304||0xcc;return function(_0x408fe0){if(_0x408fe0){return _0x31fb93[_0x03ab('0x1a')](_0x5ea304);}return _0x31fb93['status'](_0x5ea304)[_0x03ab('0x1b')]();};}function respondWithResult(_0x5f4d2b,_0x26606f){_0x26606f=_0x26606f||0xc8;return function(_0x1b499e){if(_0x1b499e){return _0x5f4d2b[_0x03ab('0x1c')](_0x26606f)[_0x03ab('0x1d')](_0x1b499e);}};}function respondWithFilteredResult(_0x58fc67,_0x3ffd30){return function(_0x24d2b4){if(_0x24d2b4){var _0x14de29=_0x24d2b4[_0x03ab('0x1e')],_0x252c32=_0x3ffd30[_0x03ab('0x1f')],_0x246990=_0x3ffd30['offset']+_0x3ffd30['limit'],_0x565e65;if(_0x246990>=_0x14de29){_0x246990=_0x14de29;_0x565e65=0xc8;}else{_0x565e65=0xce;}_0x58fc67[_0x03ab('0x1c')](_0x565e65);return _0x58fc67[_0x03ab('0x20')](_0x03ab('0x21'),_0x252c32+'-'+_0x246990+'/'+_0x14de29)[_0x03ab('0x1d')](_0x24d2b4);}return null;};}function patchUpdates(_0x5e3a6e){return function(_0x294544){try{jsonpatch[_0x03ab('0x22')](_0x294544,_0x5e3a6e,!![]);}catch(_0x1bdf63){return BPromise[_0x03ab('0x23')](_0x1bdf63);}return _0x294544[_0x03ab('0x24')]();};}function saveUpdates(_0x335662,_0x198504){return function(_0x4e3f5f){if(_0x4e3f5f){return _0x4e3f5f[_0x03ab('0x25')](_0x335662)['then'](function(_0x3b08aa){return _0x3b08aa;});}return null;};}function removeEntity(_0x81908f,_0x493eb3){return function(_0x10aea9){if(_0x10aea9){return _0x10aea9[_0x03ab('0x26')]()[_0x03ab('0x27')](function(){_0x81908f[_0x03ab('0x1c')](0xcc)[_0x03ab('0x1b')]();});}};}function handleEntityNotFound(_0x83e383,_0x1bb2e3){return function(_0x3d83ca){if(!_0x3d83ca){_0x83e383[_0x03ab('0x1a')](0x194);}return _0x3d83ca;};}function handleError(_0xf98e07,_0x4a0076){_0x4a0076=_0x4a0076||0x1f4;return function(_0x26859b){logger[_0x03ab('0x28')](_0x26859b[_0x03ab('0x29')]);if(_0x26859b[_0x03ab('0x2a')]){delete _0x26859b[_0x03ab('0x2a')];}_0xf98e07[_0x03ab('0x1c')](_0x4a0076)[_0x03ab('0x2b')](_0x26859b);};}exports['index']=function(_0x31703c,_0x11a6e8){var _0x134fd8={},_0xcac33f={},_0x1156f3={'count':0x0,'rows':[]};var _0x560df3=db[_0x03ab('0x2c')][_0x03ab('0x2d')];_0xcac33f['model']=_[_0x03ab('0x2e')](_0x560df3);_0xcac33f[_0x03ab('0x2f')]=_[_0x03ab('0x2e')](_0x31703c[_0x03ab('0x2f')]);_0xcac33f[_0x03ab('0x30')]=_[_0x03ab('0x31')](_0xcac33f[_0x03ab('0x32')],_0xcac33f[_0x03ab('0x2f')]);_0x134fd8[_0x03ab('0x33')]=_[_0x03ab('0x31')](_0xcac33f['model'],qs[_0x03ab('0x34')](_0x31703c[_0x03ab('0x2f')]['fields']));_0x134fd8[_0x03ab('0x33')]=_0x134fd8[_0x03ab('0x33')][_0x03ab('0x35')]?_0x134fd8[_0x03ab('0x33')]:_0xcac33f[_0x03ab('0x32')];if(!_0x31703c[_0x03ab('0x2f')][_0x03ab('0x36')]('nolimit')){_0x134fd8['limit']=qs[_0x03ab('0x37')](_0x31703c[_0x03ab('0x2f')][_0x03ab('0x37')]);_0x134fd8['offset']=qs[_0x03ab('0x1f')](_0x31703c[_0x03ab('0x2f')]['offset']);}_0x134fd8[_0x03ab('0x38')]=qs[_0x03ab('0x39')](_0x31703c[_0x03ab('0x2f')]['sort']);_0x134fd8[_0x03ab('0x3a')]=qs['filters'](_[_0x03ab('0x3b')](_0x31703c[_0x03ab('0x2f')],_0xcac33f[_0x03ab('0x30')]));if(_0x31703c[_0x03ab('0x2f')][_0x03ab('0x3c')]){_0x134fd8[_0x03ab('0x3a')]=_[_0x03ab('0x3d')](_0x134fd8[_0x03ab('0x3a')],{'$or':_[_0x03ab('0x3e')](_0x560df3,function(_0x4512cc){if(_0x4512cc[_0x03ab('0x3f')][_0x03ab('0x40')]!==_0x03ab('0x41')){var _0x5ce4fb={};_0x5ce4fb[_0x4512cc[_0x03ab('0x42')]]={'$like':'%'+_0x31703c[_0x03ab('0x2f')]['filter']+'%'};return _0x5ce4fb;}})});}_0x134fd8=_['merge']({},_0x134fd8,_0x31703c[_0x03ab('0x43')]);var _0xfd7288={'where':_0x134fd8[_0x03ab('0x3a')]};return db[_0x03ab('0x2c')]['count'](_0xfd7288)[_0x03ab('0x27')](function(_0x1b2e87){_0x1156f3[_0x03ab('0x1e')]=_0x1b2e87;if(_0x31703c['query'][_0x03ab('0x44')]){_0x134fd8[_0x03ab('0x45')]=[{'all':!![]}];}return db['CmHopperBlack'][_0x03ab('0x46')](_0x134fd8);})['then'](function(_0x4491d4){_0x1156f3[_0x03ab('0x47')]=_0x4491d4;return _0x1156f3;})[_0x03ab('0x27')](respondWithFilteredResult(_0x11a6e8,_0x134fd8))['catch'](handleError(_0x11a6e8,null));};exports[_0x03ab('0x48')]=function(_0x3c4232,_0x1f95ec){var _0x74ff5e={'raw':!![],'where':{'id':_0x3c4232[_0x03ab('0x49')]['id']}},_0x5adc32={};_0x5adc32['model']=_[_0x03ab('0x2e')](db[_0x03ab('0x2c')][_0x03ab('0x2d')]);_0x5adc32[_0x03ab('0x2f')]=_[_0x03ab('0x2e')](_0x3c4232['query']);_0x5adc32['filters']=_[_0x03ab('0x31')](_0x5adc32[_0x03ab('0x32')],_0x5adc32[_0x03ab('0x2f')]);_0x74ff5e['attributes']=_[_0x03ab('0x31')](_0x5adc32[_0x03ab('0x32')],qs[_0x03ab('0x34')](_0x3c4232[_0x03ab('0x2f')]['fields']));_0x74ff5e[_0x03ab('0x33')]=_0x74ff5e[_0x03ab('0x33')][_0x03ab('0x35')]?_0x74ff5e[_0x03ab('0x33')]:_0x5adc32['model'];if(_0x3c4232[_0x03ab('0x2f')][_0x03ab('0x44')]){_0x74ff5e['include']=[{'all':!![]}];}_0x74ff5e=_[_0x03ab('0x3d')]({},_0x74ff5e,_0x3c4232[_0x03ab('0x43')]);return db[_0x03ab('0x2c')][_0x03ab('0x4a')](_0x74ff5e)['then'](handleEntityNotFound(_0x1f95ec,null))['then'](respondWithResult(_0x1f95ec,null))[_0x03ab('0x4b')](handleError(_0x1f95ec,null));};exports['update']=function(_0x14d8f5,_0x193b11){if(_0x14d8f5[_0x03ab('0x4c')]['id']){delete _0x14d8f5[_0x03ab('0x4c')]['id'];}return db[_0x03ab('0x2c')][_0x03ab('0x4a')]({'where':{'id':_0x14d8f5[_0x03ab('0x49')]['id']}})['then'](handleEntityNotFound(_0x193b11,null))[_0x03ab('0x27')](saveUpdates(_0x14d8f5['body'],null))[_0x03ab('0x27')](respondWithResult(_0x193b11,null))['catch'](handleError(_0x193b11,null));};exports[_0x03ab('0x26')]=function(_0x10e14e,_0x4c9fda){return db[_0x03ab('0x2c')][_0x03ab('0x4a')]({'where':{'id':_0x10e14e[_0x03ab('0x49')]['id']}})[_0x03ab('0x27')](handleEntityNotFound(_0x4c9fda,null))['then'](removeEntity(_0x4c9fda,null))[_0x03ab('0x4b')](handleError(_0x4c9fda,null));};exports[_0x03ab('0x4d')]=function(_0x5cd110,_0x2f46ac){return db[_0x03ab('0x2c')][_0x03ab('0x4d')]()[_0x03ab('0x27')](respondWithResult(_0x2f46ac,null))[_0x03ab('0x4b')](handleError(_0x2f46ac,null));}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.model.js b/server/api/cmHopperBlack/cmHopperBlack.model.js index bf67242..18eb715 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 _0x1683=['path','../../config/environment','./cmHopperBlack.attributes','exports','define','CmHopperBlack','cm_hopper_black','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x33155c,_0x3fdde1){var _0x5becf7=function(_0x2f7a2f){while(--_0x2f7a2f){_0x33155c['push'](_0x33155c['shift']());}};_0x5becf7(++_0x3fdde1);}(_0x1683,0x165));var _0x3168=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x1683[_0x6131cd];return _0x47e916;};'use strict';var _=require(_0x3168('0x0'));var util=require(_0x3168('0x1'));var logger=require(_0x3168('0x2'))(_0x3168('0x3'));var moment=require(_0x3168('0x4'));var BPromise=require(_0x3168('0x5'));var rp=require(_0x3168('0x6'));var fs=require('fs');var path=require(_0x3168('0x7'));var rimraf=require('rimraf');var config=require(_0x3168('0x8'));var attributes=require(_0x3168('0x9'));module[_0x3168('0xa')]=function(_0x1696a6,_0x29e101){return _0x1696a6[_0x3168('0xb')](_0x3168('0xc'),attributes,{'tableName':_0x3168('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb70d=['../../config/environment','exports','define','CmHopperBlack','util','../../config/logger','bluebird','request-promise','path','rimraf'];(function(_0xae7c2f,_0xf31e04){var _0x5d7001=function(_0x4eeadb){while(--_0x4eeadb){_0xae7c2f['push'](_0xae7c2f['shift']());}};_0x5d7001(++_0xf31e04);}(_0xb70d,0xc2));var _0xdb70=function(_0x120e34,_0x12c267){_0x120e34=_0x120e34-0x0;var _0x194705=_0xb70d[_0x120e34];return _0x194705;};'use strict';var _=require('lodash');var util=require(_0xdb70('0x0'));var logger=require(_0xdb70('0x1'))('api');var moment=require('moment');var BPromise=require(_0xdb70('0x2'));var rp=require(_0xdb70('0x3'));var fs=require('fs');var path=require(_0xdb70('0x4'));var rimraf=require(_0xdb70('0x5'));var config=require(_0xdb70('0x6'));var attributes=require('./cmHopperBlack.attributes');module[_0xdb70('0x7')]=function(_0x5200df,_0x54bc8c){return _0x5200df[_0xdb70('0x8')](_0xdb70('0x9'),attributes,{'tableName':'cm_hopper_black','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.rpc.js b/server/api/cmHopperBlack/cmHopperBlack.rpc.js index 465e032..b5595b7 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 _0x51c9=['attributes','GetCmHopperBlack','body','UpdateCmHopperBlack','catch','DestroyCmHopperBlack','destroy','lodash','util','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','CmHopperBlack,\x20%s,\x20%s','request\x20sent','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','stringify','error','code','message','CmHopperBlack','options','raw','where','limit','include','map','model'];(function(_0x3e87bf,_0x565dfa){var _0x5c80b4=function(_0x28062d){while(--_0x28062d){_0x3e87bf['push'](_0x3e87bf['shift']());}};_0x5c80b4(++_0x565dfa);}(_0x51c9,0x193));var _0x951c=function(_0x2c519a,_0x13fe4a){_0x2c519a=_0x2c519a-0x0;var _0x12cc30=_0x51c9[_0x2c519a];return _0x12cc30;};'use strict';var _=require(_0x951c('0x0'));var util=require(_0x951c('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x951c('0x2'));var fs=require('fs');var Redis=require(_0x951c('0x3'));var db=require(_0x951c('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x951c('0x5'));var config=require(_0x951c('0x6'));var jayson=require(_0x951c('0x7'));var client=jayson[_0x951c('0x8')][_0x951c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x55f8a1,_0x154568,_0x3c56ba){return new BPromise(function(_0x5edccf,_0x499bbd){return client[_0x951c('0xa')](_0x55f8a1,_0x3c56ba)[_0x951c('0xb')](function(_0x4ea577){logger[_0x951c('0xc')](_0x951c('0xd'),_0x154568,_0x951c('0xe'));logger[_0x951c('0xf')](_0x951c('0x10'),_0x154568,'request\x20sent',JSON[_0x951c('0x11')](_0x4ea577));if(_0x4ea577[_0x951c('0x12')]){if(_0x4ea577[_0x951c('0x12')][_0x951c('0x13')]===0x1f4){logger[_0x951c('0x12')]('CmHopperBlack,\x20%s,\x20%s',_0x154568,_0x4ea577[_0x951c('0x12')][_0x951c('0x14')]);return _0x499bbd(_0x4ea577['error'][_0x951c('0x14')]);}logger['error'](_0x951c('0xd'),_0x154568,_0x4ea577[_0x951c('0x12')][_0x951c('0x14')]);return _0x5edccf(_0x4ea577['error'][_0x951c('0x14')]);}else{logger['info']('CmHopperBlack,\x20%s,\x20%s',_0x154568,_0x951c('0xe'));_0x5edccf(_0x4ea577['result'][_0x951c('0x14')]);}})['catch'](function(_0x340491){logger[_0x951c('0x12')](_0x951c('0xd'),_0x154568,_0x340491);_0x499bbd(_0x340491);});});}exports['GetCmHopperBlack']=function(_0x375a3e){var _0x1fee92=this;return new Promise(function(_0x5256ad,_0x5a2db6){return db[_0x951c('0x15')]['findAll']({'raw':_0x375a3e[_0x951c('0x16')]?_0x375a3e[_0x951c('0x16')][_0x951c('0x17')]===undefined?!![]:![]:!![],'where':_0x375a3e[_0x951c('0x16')]?_0x375a3e['options'][_0x951c('0x18')]||null:null,'attributes':_0x375a3e[_0x951c('0x16')]?_0x375a3e[_0x951c('0x16')]['attributes']||null:null,'limit':_0x375a3e['options']?_0x375a3e[_0x951c('0x16')][_0x951c('0x19')]||null:null,'include':_0x375a3e[_0x951c('0x16')]?_0x375a3e[_0x951c('0x16')][_0x951c('0x1a')]?_[_0x951c('0x1b')](_0x375a3e[_0x951c('0x16')]['include'],function(_0x1936bf){return{'model':db[_0x1936bf[_0x951c('0x1c')]],'as':_0x1936bf['as'],'attributes':_0x1936bf[_0x951c('0x1d')],'include':_0x1936bf[_0x951c('0x1a')]?_[_0x951c('0x1b')](_0x1936bf[_0x951c('0x1a')],function(_0x4c0ae5){return{'model':db[_0x4c0ae5['model']],'as':_0x4c0ae5['as'],'attributes':_0x4c0ae5['attributes'],'include':_0x4c0ae5[_0x951c('0x1a')]?_[_0x951c('0x1b')](_0x4c0ae5[_0x951c('0x1a')],function(_0x6dc3a){return{'model':db[_0x6dc3a[_0x951c('0x1c')]],'as':_0x6dc3a['as'],'attributes':_0x6dc3a[_0x951c('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x951c('0xb')](function(_0x2feca8){logger[_0x951c('0xc')](_0x951c('0x1e'),_0x375a3e);logger[_0x951c('0xf')](_0x951c('0x1e'),_0x375a3e,JSON[_0x951c('0x11')](_0x2feca8));_0x5256ad(_0x2feca8);})['catch'](function(_0x579109){logger[_0x951c('0x12')]('GetCmHopperBlack',_0x579109[_0x951c('0x14')],_0x375a3e);_0x5a2db6(_0x1fee92[_0x951c('0x12')](0x1f4,_0x579109[_0x951c('0x14')]));});});};exports['UpdateCmHopperBlack']=function(_0x19368e){var _0x4a6c2e=this;return new Promise(function(_0x7fb62d,_0x16d8b6){return db[_0x951c('0x15')]['update'](_0x19368e[_0x951c('0x1f')],{'raw':_0x19368e[_0x951c('0x16')]?_0x19368e[_0x951c('0x16')][_0x951c('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x19368e['options']?_0x19368e['options']['where']||null:null,'attributes':_0x19368e['options']?_0x19368e[_0x951c('0x16')][_0x951c('0x1d')]||null:null,'limit':_0x19368e['options']?_0x19368e['options'][_0x951c('0x19')]||null:null})['then'](function(_0x151656){logger[_0x951c('0xc')](_0x951c('0x20'),_0x19368e);logger[_0x951c('0xf')](_0x951c('0x20'),_0x19368e,JSON['stringify'](_0x151656));_0x7fb62d(_0x151656);})[_0x951c('0x21')](function(_0x225c66){logger['error']('UpdateCmHopperBlack',_0x225c66['message'],_0x19368e);_0x16d8b6(_0x4a6c2e[_0x951c('0x12')](0x1f4,_0x225c66[_0x951c('0x14')]));});});};exports[_0x951c('0x22')]=function(_0x274ab7){var _0x3d08c0=this;return new Promise(function(_0x46a1e1,_0x21d754){return db['CmHopperBlack'][_0x951c('0x23')]({'where':_0x274ab7[_0x951c('0x16')]?_0x274ab7[_0x951c('0x16')][_0x951c('0x18')]||null:null})[_0x951c('0xb')](function(_0x4befaf){logger[_0x951c('0xc')]('DestroyCmHopperBlack',_0x274ab7);logger[_0x951c('0xf')](_0x951c('0x22'),_0x274ab7,JSON[_0x951c('0x11')](_0x4befaf));_0x46a1e1(_0x4befaf);})['catch'](function(_0x48b05b){logger[_0x951c('0x12')](_0x951c('0x22'),_0x48b05b[_0x951c('0x14')],_0x274ab7);_0x21d754(_0x3d08c0[_0x951c('0x12')](0x1f4,_0x48b05b['message']));});});}; \ No newline at end of file +var _0xc265=['rpc','../../config/environment','jayson/promise','client','http','then','info','CmHopperBlack,\x20%s,\x20%s','request\x20sent','CmHopperBlack,\x20%s,\x20%s,\x20%s','error','message','result','catch','GetCmHopperBlack','CmHopperBlack','options','limit','include','map','model','attributes','debug','stringify','UpdateCmHopperBlack','update','body','raw','where','DestroyCmHopperBlack','lodash','util','randomstring','../../config/utils'];(function(_0x7d324f,_0x33cd55){var _0x4c54db=function(_0xf6a52c){while(--_0xf6a52c){_0x7d324f['push'](_0x7d324f['shift']());}};_0x4c54db(++_0x33cd55);}(_0xc265,0x172));var _0x5c26=function(_0x57fae2,_0x369ec1){_0x57fae2=_0x57fae2-0x0;var _0x4f076a=_0xc265[_0x57fae2];return _0x4f076a;};'use strict';var _=require(_0x5c26('0x0'));var util=require(_0x5c26('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x5c26('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x5c26('0x3'));var logger=require('../../config/logger')(_0x5c26('0x4'));var config=require(_0x5c26('0x5'));var jayson=require(_0x5c26('0x6'));var client=jayson[_0x5c26('0x7')][_0x5c26('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x33c329,_0x25c4d9,_0x1404ec){return new BPromise(function(_0x5a794a,_0x250c0e){return client['request'](_0x33c329,_0x1404ec)[_0x5c26('0x9')](function(_0x46bfb3){logger[_0x5c26('0xa')](_0x5c26('0xb'),_0x25c4d9,_0x5c26('0xc'));logger['debug'](_0x5c26('0xd'),_0x25c4d9,_0x5c26('0xc'),JSON['stringify'](_0x46bfb3));if(_0x46bfb3[_0x5c26('0xe')]){if(_0x46bfb3[_0x5c26('0xe')]['code']===0x1f4){logger[_0x5c26('0xe')]('CmHopperBlack,\x20%s,\x20%s',_0x25c4d9,_0x46bfb3['error'][_0x5c26('0xf')]);return _0x250c0e(_0x46bfb3[_0x5c26('0xe')]['message']);}logger[_0x5c26('0xe')](_0x5c26('0xb'),_0x25c4d9,_0x46bfb3[_0x5c26('0xe')]['message']);return _0x5a794a(_0x46bfb3[_0x5c26('0xe')][_0x5c26('0xf')]);}else{logger[_0x5c26('0xa')](_0x5c26('0xb'),_0x25c4d9,'request\x20sent');_0x5a794a(_0x46bfb3[_0x5c26('0x10')][_0x5c26('0xf')]);}})[_0x5c26('0x11')](function(_0x348b60){logger[_0x5c26('0xe')](_0x5c26('0xb'),_0x25c4d9,_0x348b60);_0x250c0e(_0x348b60);});});}exports[_0x5c26('0x12')]=function(_0xfb539){var _0x4e4cd7=this;return new Promise(function(_0x404133,_0x4b983a){return db[_0x5c26('0x13')]['findAll']({'raw':_0xfb539['options']?_0xfb539[_0x5c26('0x14')]['raw']===undefined?!![]:![]:!![],'where':_0xfb539[_0x5c26('0x14')]?_0xfb539[_0x5c26('0x14')]['where']||null:null,'attributes':_0xfb539[_0x5c26('0x14')]?_0xfb539['options']['attributes']||null:null,'limit':_0xfb539[_0x5c26('0x14')]?_0xfb539[_0x5c26('0x14')][_0x5c26('0x15')]||null:null,'include':_0xfb539[_0x5c26('0x14')]?_0xfb539[_0x5c26('0x14')][_0x5c26('0x16')]?_[_0x5c26('0x17')](_0xfb539[_0x5c26('0x14')][_0x5c26('0x16')],function(_0x181d3c){return{'model':db[_0x181d3c[_0x5c26('0x18')]],'as':_0x181d3c['as'],'attributes':_0x181d3c['attributes'],'include':_0x181d3c[_0x5c26('0x16')]?_[_0x5c26('0x17')](_0x181d3c[_0x5c26('0x16')],function(_0x65c396){return{'model':db[_0x65c396[_0x5c26('0x18')]],'as':_0x65c396['as'],'attributes':_0x65c396[_0x5c26('0x19')],'include':_0x65c396[_0x5c26('0x16')]?_['map'](_0x65c396[_0x5c26('0x16')],function(_0x1d0e67){return{'model':db[_0x1d0e67[_0x5c26('0x18')]],'as':_0x1d0e67['as'],'attributes':_0x1d0e67['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x49155b){logger[_0x5c26('0xa')]('GetCmHopperBlack',_0xfb539);logger[_0x5c26('0x1a')](_0x5c26('0x12'),_0xfb539,JSON[_0x5c26('0x1b')](_0x49155b));_0x404133(_0x49155b);})[_0x5c26('0x11')](function(_0x5763f5){logger[_0x5c26('0xe')]('GetCmHopperBlack',_0x5763f5[_0x5c26('0xf')],_0xfb539);_0x4b983a(_0x4e4cd7[_0x5c26('0xe')](0x1f4,_0x5763f5[_0x5c26('0xf')]));});});};exports[_0x5c26('0x1c')]=function(_0x5b7787){var _0x211b31=this;return new Promise(function(_0x1a9e4c,_0x89c50e){return db[_0x5c26('0x13')][_0x5c26('0x1d')](_0x5b7787[_0x5c26('0x1e')],{'raw':_0x5b7787[_0x5c26('0x14')]?_0x5b7787[_0x5c26('0x14')][_0x5c26('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5b7787[_0x5c26('0x14')]?_0x5b7787['options'][_0x5c26('0x20')]||null:null,'attributes':_0x5b7787[_0x5c26('0x14')]?_0x5b7787[_0x5c26('0x14')][_0x5c26('0x19')]||null:null,'limit':_0x5b7787[_0x5c26('0x14')]?_0x5b7787[_0x5c26('0x14')][_0x5c26('0x15')]||null:null})[_0x5c26('0x9')](function(_0x651b7b){logger['info'](_0x5c26('0x1c'),_0x5b7787);logger[_0x5c26('0x1a')](_0x5c26('0x1c'),_0x5b7787,JSON[_0x5c26('0x1b')](_0x651b7b));_0x1a9e4c(_0x651b7b);})[_0x5c26('0x11')](function(_0x23f1b3){logger[_0x5c26('0xe')](_0x5c26('0x1c'),_0x23f1b3['message'],_0x5b7787);_0x89c50e(_0x211b31['error'](0x1f4,_0x23f1b3['message']));});});};exports[_0x5c26('0x21')]=function(_0x1c9398){var _0x4ed410=this;return new Promise(function(_0x3e559a,_0x1e6d0e){return db['CmHopperBlack']['destroy']({'where':_0x1c9398[_0x5c26('0x14')]?_0x1c9398[_0x5c26('0x14')][_0x5c26('0x20')]||null:null})['then'](function(_0x2b909c){logger[_0x5c26('0xa')](_0x5c26('0x21'),_0x1c9398);logger[_0x5c26('0x1a')](_0x5c26('0x21'),_0x1c9398,JSON[_0x5c26('0x1b')](_0x2b909c));_0x3e559a(_0x2b909c);})[_0x5c26('0x11')](function(_0x254f63){logger[_0x5c26('0xe')](_0x5c26('0x21'),_0x254f63['message'],_0x1c9398);_0x1e6d0e(_0x4ed410[_0x5c26('0xe')](0x1f4,_0x254f63[_0x5c26('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/index.js b/server/api/cmHopperBlack/index.js index 4f34da3..1d7d420 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 _0x5c12=['../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperBlack.controller','get','index','/describe','/:id','isAuthenticated','show','put','update','delete','exports','util','path','express','Router'];(function(_0x59752f,_0x13f23b){var _0x2faac1=function(_0x40082a){while(--_0x40082a){_0x59752f['push'](_0x59752f['shift']());}};_0x2faac1(++_0x13f23b);}(_0x5c12,0x188));var _0x25c1=function(_0x57cc22,_0x2d351f){_0x57cc22=_0x57cc22-0x0;var _0x6f7bdc=_0x5c12[_0x57cc22];return _0x6f7bdc;};'use strict';var multer=require('multer');var util=require(_0x25c1('0x0'));var path=require(_0x25c1('0x1'));var timeout=require('connect-timeout');var express=require(_0x25c1('0x2'));var router=express[_0x25c1('0x3')]();var auth=require(_0x25c1('0x4'));var interaction=require(_0x25c1('0x5'));var config=require(_0x25c1('0x6'));var controller=require(_0x25c1('0x7'));router[_0x25c1('0x8')]('/',auth['isAuthenticated'](),controller[_0x25c1('0x9')]);router[_0x25c1('0x8')](_0x25c1('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x25c1('0x8')](_0x25c1('0xb'),auth[_0x25c1('0xc')](),controller[_0x25c1('0xd')]);router[_0x25c1('0xe')]('/:id',auth[_0x25c1('0xc')](),controller[_0x25c1('0xf')]);router[_0x25c1('0x10')](_0x25c1('0xb'),auth[_0x25c1('0xc')](),controller['destroy']);module[_0x25c1('0x11')]=router; \ No newline at end of file +var _0x032e=['put','delete','destroy','exports','multer','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperBlack.controller','get','isAuthenticated','index','/describe','describe','/:id','show'];(function(_0x47183e,_0x45a117){var _0x3a053e=function(_0x2711ff){while(--_0x2711ff){_0x47183e['push'](_0x47183e['shift']());}};_0x3a053e(++_0x45a117);}(_0x032e,0x124));var _0xe032=function(_0x2b5eae,_0x55010d){_0x2b5eae=_0x2b5eae-0x0;var _0x5f3ac9=_0x032e[_0x2b5eae];return _0x5f3ac9;};'use strict';var multer=require(_0xe032('0x0'));var util=require('util');var path=require(_0xe032('0x1'));var timeout=require(_0xe032('0x2'));var express=require('express');var router=express['Router']();var auth=require(_0xe032('0x3'));var interaction=require(_0xe032('0x4'));var config=require(_0xe032('0x5'));var controller=require(_0xe032('0x6'));router[_0xe032('0x7')]('/',auth[_0xe032('0x8')](),controller[_0xe032('0x9')]);router[_0xe032('0x7')](_0xe032('0xa'),auth[_0xe032('0x8')](),controller[_0xe032('0xb')]);router[_0xe032('0x7')](_0xe032('0xc'),auth[_0xe032('0x8')](),controller[_0xe032('0xd')]);router[_0xe032('0xe')](_0xe032('0xc'),auth[_0xe032('0x8')](),controller['update']);router[_0xe032('0xf')](_0xe032('0xc'),auth[_0xe032('0x8')](),controller[_0xe032('0x10')]);module[_0xe032('0x11')]=router; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.attributes.js b/server/api/cmHopperFinal/cmHopperFinal.attributes.js index 03ddc3c..3ed7bda 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 _0x7715=['sequelize','moment','INTEGER','STRING','DATE','endtime','setDataValue','followuptime','BOOLEAN'];(function(_0x110479,_0x492d7b){var _0x55335=function(_0xe4731b){while(--_0xe4731b){_0x110479['push'](_0x110479['shift']());}};_0x55335(++_0x492d7b);}(_0x7715,0x19e));var _0x5771=function(_0x3ae2dc,_0x4d694a){_0x3ae2dc=_0x3ae2dc-0x0;var _0x197e63=_0x7715[_0x3ae2dc];return _0x197e63;};'use strict';var Sequelize=require(_0x5771('0x0'));var moment=require(_0x5771('0x1'));module['exports']={'state':{'type':Sequelize[_0x5771('0x2')](0x2)},'statedesc':{'type':Sequelize[_0x5771('0x3')]},'scheduledat':{'type':Sequelize[_0x5771('0x4')]},'countbusyretry':{'type':Sequelize[_0x5771('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x5771('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x5771('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x5771('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize['STRING']},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize[_0x5771('0x3')]},'calleridnum':{'type':Sequelize[_0x5771('0x3')]},'calleridname':{'type':Sequelize[_0x5771('0x3')]},'starttime':{'type':Sequelize[_0x5771('0x4')]},'responsetime':{'type':Sequelize[_0x5771('0x4')]},'answertime':{'type':Sequelize[_0x5771('0x4')]},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize[_0x5771('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x5771('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x5771('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x5771('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x5771('0x3')]},'campaign':{'type':Sequelize[_0x5771('0x3')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize['STRING']},'reason':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize[_0x5771('0x3')]},'dispositionat':{'type':Sequelize[_0x5771('0x4')],'set':function(_0x319705){var _0x2818bb=this['getDataValue'](_0x5771('0x5'));if(_0x2818bb&&_0x319705){this[_0x5771('0x6')](_0x5771('0x7'),moment(_0x319705)['diff'](moment(_0x2818bb),'seconds'));}return this[_0x5771('0x6')]('dispositionat',_0x319705);}},'amd':{'type':Sequelize[_0x5771('0x8')],'defaultValue':![]},'fax':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'blacklist':{'type':Sequelize[_0x5771('0x8')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0x5771('0x8')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0x5771('0x4')]},'callback':{'type':Sequelize[_0x5771('0x8')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x5771('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'deleted':{'type':Sequelize[_0x5771('0x3')],'defaultValue':null},'deletedat':{'type':Sequelize['DATE']},'recallme':{'type':Sequelize[_0x5771('0x8')],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0x5771('0x4')]}}; \ No newline at end of file +var _0x5d74=['exports','INTEGER','STRING','DATE','getDataValue','setDataValue','followuptime','seconds','dispositionat','BOOLEAN'];(function(_0x2e0e4d,_0x1522b8){var _0x547015=function(_0x492ab4){while(--_0x492ab4){_0x2e0e4d['push'](_0x2e0e4d['shift']());}};_0x547015(++_0x1522b8);}(_0x5d74,0x14a));var _0x45d7=function(_0x490650,_0x54c7e4){_0x490650=_0x490650-0x0;var _0x3b7e1f=_0x5d74[_0x490650];return _0x3b7e1f;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module[_0x45d7('0x0')]={'state':{'type':Sequelize[_0x45d7('0x1')](0x2)},'statedesc':{'type':Sequelize[_0x45d7('0x2')]},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x45d7('0x1')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x45d7('0x1')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x45d7('0x1')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x45d7('0x2')]},'originatecalleridnum':{'type':Sequelize[_0x45d7('0x2')]},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x45d7('0x2')]},'starttime':{'type':Sequelize[_0x45d7('0x3')]},'responsetime':{'type':Sequelize[_0x45d7('0x3')]},'answertime':{'type':Sequelize['DATE']},'droptime':{'type':Sequelize[_0x45d7('0x3')]},'endtime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize[_0x45d7('0x1')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x45d7('0x1')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x45d7('0x1')],'defaultValue':0x0},'followuptime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x45d7('0x2')]},'campaign':{'type':Sequelize[_0x45d7('0x2')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x45d7('0x2')]},'reason':{'type':Sequelize[_0x45d7('0x2')]},'disposition':{'type':Sequelize[_0x45d7('0x2')]},'dispositionat':{'type':Sequelize[_0x45d7('0x3')],'set':function(_0x292f7d){var _0x180635=this[_0x45d7('0x4')]('endtime');if(_0x180635&&_0x292f7d){this[_0x45d7('0x5')](_0x45d7('0x6'),moment(_0x292f7d)['diff'](moment(_0x180635),_0x45d7('0x7')));}return this['setDataValue'](_0x45d7('0x8'),_0x292f7d);}},'amd':{'type':Sequelize[_0x45d7('0x9')],'defaultValue':![]},'fax':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'blacklist':{'type':Sequelize[_0x45d7('0x9')],'defaultValue':![]},'rescheduled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduledat':{'type':Sequelize['DATE']},'callback':{'type':Sequelize[_0x45d7('0x9')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x45d7('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x45d7('0x3')]},'deleted':{'type':Sequelize[_0x45d7('0x2')],'defaultValue':null},'deletedat':{'type':Sequelize['DATE']},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0x45d7('0x3')]}}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.controller.js b/server/api/cmHopperFinal/cmHopperFinal.controller.js index 3f16790..f2e4fbb 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 _0x6e32=['answeringMachine','countContactsIvrCampaignHopperFinal','`state`\x20=\x205,\x201,\x20null','busyContacts','moveContactsQueueCampaignHopperFinal','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','VoiceQueueId','createdAt','updatedAt','field','ANY_VALUE(calleridnum)','NOW()','ANY_VALUE(ListId)','from','cm_hopper_final','VoiceQueueId\x20=\x20?','toString','state\x20=\x20?','state','calleridnum\x20IS\x20NOT\x20NULL','select','calleridnum\x20NOT\x20IN\x20(?)','calleridnum','state\x20=\x204','group','Campaign','CampaignId','ANY_VALUE(ContactId)','ANY_VALUE(CampaignId)','CampaignId\x20=\x20?','checkContactHopper','findOne','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','set','apply','save','update','then','destroy','error','name','send','CmHopperFinal','rawAttributes','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','map','type','key','options','count','include','findAll','rows','keys','filters','includeAll','find','catch','describe','body','uniqueid','params','countContactsQueueCampaignHopperFinal','sequelize','COUNT','literal','`state`\x20=\x200,\x201,\x20null','noSuchContacts','noAnswerContacts','`state`\x20=\x208,\x201,\x20null','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','reCallContacts','`state`\x20=\x2019,\x201,\x20null'];(function(_0x2ca616,_0x384ec8){var _0x53155f=function(_0x108627){while(--_0x108627){_0x2ca616['push'](_0x2ca616['shift']());}};_0x53155f(++_0x384ec8);}(_0x6e32,0x19e));var _0x26e3=function(_0x4c7289,_0x434503){_0x4c7289=_0x4c7289-0x0;var _0x5d7944=_0x6e32[_0x4c7289];return _0x5d7944;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x26e3('0x0'));var rimraf=require(_0x26e3('0x1'));var zipdir=require(_0x26e3('0x2'));var jsonpatch=require(_0x26e3('0x3'));var rp=require(_0x26e3('0x4'));var moment=require('moment');var BPromise=require(_0x26e3('0x5'));var Mustache=require(_0x26e3('0x6'));var util=require('util');var path=require('path');var sox=require(_0x26e3('0x7'));var csv=require(_0x26e3('0x8'));var ejs=require(_0x26e3('0x9'));var fs=require('fs');var _=require(_0x26e3('0xa'));var squel=require(_0x26e3('0xb'));var crypto=require(_0x26e3('0xc'));var jsforce=require(_0x26e3('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x26e3('0xe'));var Papa=require(_0x26e3('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x26e3('0x10'));var as=require(_0x26e3('0x11'));var hardwareService=require(_0x26e3('0x12'));var logger=require('../../config/logger')(_0x26e3('0x13'));var utils=require(_0x26e3('0x14'));var config=require(_0x26e3('0x15'));var db=require(_0x26e3('0x16'))['db'];function respondWithStatusCode(_0x2dd7e5,_0x1cd952){_0x1cd952=_0x1cd952||0xcc;return function(_0x42da58){if(_0x42da58){return _0x2dd7e5[_0x26e3('0x17')](_0x1cd952);}return _0x2dd7e5[_0x26e3('0x18')](_0x1cd952)[_0x26e3('0x19')]();};}function respondWithResult(_0x178cc4,_0x312142){_0x312142=_0x312142||0xc8;return function(_0x11b5e9){if(_0x11b5e9){return _0x178cc4['status'](_0x312142)[_0x26e3('0x1a')](_0x11b5e9);}};}function respondWithFilteredResult(_0x5e3dda,_0x329e29){return function(_0x53fb91){if(_0x53fb91){var _0x31ae26=_0x53fb91['count'],_0x549290=_0x329e29[_0x26e3('0x1b')],_0x3a8c02=_0x329e29[_0x26e3('0x1b')]+_0x329e29[_0x26e3('0x1c')],_0x530370;if(_0x3a8c02>=_0x31ae26){_0x3a8c02=_0x31ae26;_0x530370=0xc8;}else{_0x530370=0xce;}_0x5e3dda[_0x26e3('0x18')](_0x530370);return _0x5e3dda[_0x26e3('0x1d')]('Content-Range',_0x549290+'-'+_0x3a8c02+'/'+_0x31ae26)['json'](_0x53fb91);}return null;};}function patchUpdates(_0x5307ef){return function(_0x3f53bb){try{jsonpatch[_0x26e3('0x1e')](_0x3f53bb,_0x5307ef,!![]);}catch(_0x509670){return BPromise['reject'](_0x509670);}return _0x3f53bb[_0x26e3('0x1f')]();};}function saveUpdates(_0x470fe3,_0x322616){return function(_0x5939f3){if(_0x5939f3){return _0x5939f3[_0x26e3('0x20')](_0x470fe3)[_0x26e3('0x21')](function(_0x1bfce2){return _0x1bfce2;});}return null;};}function removeEntity(_0x2e65bb,_0xf04250){return function(_0x184b8d){if(_0x184b8d){return _0x184b8d[_0x26e3('0x22')]()['then'](function(){_0x2e65bb[_0x26e3('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1b44a0,_0x2b7df1){return function(_0x211fa2){if(!_0x211fa2){_0x1b44a0[_0x26e3('0x17')](0x194);}return _0x211fa2;};}function handleError(_0x487e61,_0x4de948){_0x4de948=_0x4de948||0x1f4;return function(_0x2e0857){logger[_0x26e3('0x23')](_0x2e0857['stack']);if(_0x2e0857[_0x26e3('0x24')]){delete _0x2e0857['name'];}_0x487e61[_0x26e3('0x18')](_0x4de948)[_0x26e3('0x25')](_0x2e0857);};}exports['index']=function(_0x1949c6,_0x398993){var _0x42f0ca={},_0x17c11a={},_0x707b0b={'count':0x0,'rows':[]};var _0xc9c700=db[_0x26e3('0x26')][_0x26e3('0x27')];_0x17c11a[_0x26e3('0x28')]=_['keys'](_0xc9c700);_0x17c11a['query']=_['keys'](_0x1949c6[_0x26e3('0x29')]);_0x17c11a['filters']=_[_0x26e3('0x2a')](_0x17c11a[_0x26e3('0x28')],_0x17c11a[_0x26e3('0x29')]);_0x42f0ca[_0x26e3('0x2b')]=_[_0x26e3('0x2a')](_0x17c11a[_0x26e3('0x28')],qs[_0x26e3('0x2c')](_0x1949c6[_0x26e3('0x29')][_0x26e3('0x2c')]));_0x42f0ca[_0x26e3('0x2b')]=_0x42f0ca['attributes'][_0x26e3('0x2d')]?_0x42f0ca[_0x26e3('0x2b')]:_0x17c11a['model'];if(!_0x1949c6[_0x26e3('0x29')][_0x26e3('0x2e')](_0x26e3('0x2f'))){_0x42f0ca[_0x26e3('0x1c')]=qs['limit'](_0x1949c6['query'][_0x26e3('0x1c')]);_0x42f0ca[_0x26e3('0x1b')]=qs['offset'](_0x1949c6['query'][_0x26e3('0x1b')]);}_0x42f0ca[_0x26e3('0x30')]=qs[_0x26e3('0x31')](_0x1949c6['query'][_0x26e3('0x31')]);_0x42f0ca[_0x26e3('0x32')]=qs['filters'](_['pick'](_0x1949c6['query'],_0x17c11a['filters']));if(_0x1949c6[_0x26e3('0x29')][_0x26e3('0x33')]){_0x42f0ca[_0x26e3('0x32')]=_[_0x26e3('0x34')](_0x42f0ca[_0x26e3('0x32')],{'$or':_[_0x26e3('0x35')](_0xc9c700,function(_0x51fa7e){if(_0x51fa7e[_0x26e3('0x36')][_0x26e3('0x37')]!=='VIRTUAL'){var _0x661336={};_0x661336[_0x51fa7e['field']]={'$like':'%'+_0x1949c6[_0x26e3('0x29')][_0x26e3('0x33')]+'%'};return _0x661336;}})});}_0x42f0ca=_['merge']({},_0x42f0ca,_0x1949c6[_0x26e3('0x38')]);var _0xa6062={'where':_0x42f0ca[_0x26e3('0x32')]};return db[_0x26e3('0x26')]['count'](_0xa6062)[_0x26e3('0x21')](function(_0x4aac29){_0x707b0b[_0x26e3('0x39')]=_0x4aac29;if(_0x1949c6['query']['includeAll']){_0x42f0ca[_0x26e3('0x3a')]=[{'all':!![]}];}return db['CmHopperFinal'][_0x26e3('0x3b')](_0x42f0ca);})[_0x26e3('0x21')](function(_0x5bf95b){_0x707b0b[_0x26e3('0x3c')]=_0x5bf95b;return _0x707b0b;})['then'](respondWithFilteredResult(_0x398993,_0x42f0ca))['catch'](handleError(_0x398993,null));};exports['show']=function(_0x32a454,_0x7b4e60){var _0x5c6445={'raw':!![],'where':{'id':_0x32a454['params']['id']}},_0x3fa17b={};_0x3fa17b[_0x26e3('0x28')]=_['keys'](db[_0x26e3('0x26')][_0x26e3('0x27')]);_0x3fa17b[_0x26e3('0x29')]=_[_0x26e3('0x3d')](_0x32a454[_0x26e3('0x29')]);_0x3fa17b[_0x26e3('0x3e')]=_[_0x26e3('0x2a')](_0x3fa17b[_0x26e3('0x28')],_0x3fa17b[_0x26e3('0x29')]);_0x5c6445[_0x26e3('0x2b')]=_[_0x26e3('0x2a')](_0x3fa17b[_0x26e3('0x28')],qs[_0x26e3('0x2c')](_0x32a454['query']['fields']));_0x5c6445[_0x26e3('0x2b')]=_0x5c6445[_0x26e3('0x2b')][_0x26e3('0x2d')]?_0x5c6445[_0x26e3('0x2b')]:_0x3fa17b[_0x26e3('0x28')];if(_0x32a454[_0x26e3('0x29')][_0x26e3('0x3f')]){_0x5c6445[_0x26e3('0x3a')]=[{'all':!![]}];}_0x5c6445=_[_0x26e3('0x34')]({},_0x5c6445,_0x32a454['options']);return db[_0x26e3('0x26')][_0x26e3('0x40')](_0x5c6445)[_0x26e3('0x21')](handleEntityNotFound(_0x7b4e60,null))[_0x26e3('0x21')](respondWithResult(_0x7b4e60,null))[_0x26e3('0x41')](handleError(_0x7b4e60,null));};exports[_0x26e3('0x42')]=function(_0x20bd3c,_0x18ed25){return db[_0x26e3('0x26')][_0x26e3('0x42')]()[_0x26e3('0x21')](respondWithResult(_0x18ed25,null))[_0x26e3('0x41')](handleError(_0x18ed25,null));};exports[_0x26e3('0x20')]=function(_0x51e6de,_0x582efb){if(_0x51e6de[_0x26e3('0x43')][_0x26e3('0x44')]){delete _0x51e6de[_0x26e3('0x43')][_0x26e3('0x44')];}return db[_0x26e3('0x26')][_0x26e3('0x40')]({'where':{'uniqueid':_0x51e6de[_0x26e3('0x45')]['id']}})[_0x26e3('0x21')](handleEntityNotFound(_0x582efb,null))[_0x26e3('0x21')](saveUpdates(_0x51e6de[_0x26e3('0x43')],null))[_0x26e3('0x21')](respondWithResult(_0x582efb,null))['catch'](handleError(_0x582efb,null));};exports[_0x26e3('0x46')]=function(_0x87eb6b,_0x5af0f1,_0xc414f7){return db['CmHopperFinal'][_0x26e3('0x3b')]({'raw':![],'where':{'VoiceQueueId':_0x87eb6b[_0x26e3('0x45')]['id']},'attributes':[[db[_0x26e3('0x47')]['fn'](_0x26e3('0x48'),db[_0x26e3('0x47')]['fn']('IF',db[_0x26e3('0x47')][_0x26e3('0x49')](_0x26e3('0x4a')))),_0x26e3('0x4b')],[db[_0x26e3('0x47')]['fn'](_0x26e3('0x48'),db[_0x26e3('0x47')]['fn']('IF',db[_0x26e3('0x47')][_0x26e3('0x49')]('`state`\x20=\x203,\x201,\x20null'))),_0x26e3('0x4c')],[db[_0x26e3('0x47')]['fn'](_0x26e3('0x48'),db[_0x26e3('0x47')]['fn']('IF',db['sequelize']['literal']('`state`\x20=\x205,\x201,\x20null'))),'busyContacts'],[db[_0x26e3('0x47')]['fn'](_0x26e3('0x48'),db['sequelize']['fn']('IF',db[_0x26e3('0x47')]['literal'](_0x26e3('0x4d')))),_0x26e3('0x4e')],[db[_0x26e3('0x47')]['fn'](_0x26e3('0x48'),db[_0x26e3('0x47')]['fn']('IF',db[_0x26e3('0x47')][_0x26e3('0x49')](_0x26e3('0x4f')))),_0x26e3('0x50')],[db[_0x26e3('0x47')]['fn']('COUNT',db[_0x26e3('0x47')]['fn']('IF',db[_0x26e3('0x47')][_0x26e3('0x49')](_0x26e3('0x51')))),_0x26e3('0x52')],[db[_0x26e3('0x47')]['fn'](_0x26e3('0x48'),db[_0x26e3('0x47')]['fn']('IF',db[_0x26e3('0x47')]['literal'](_0x26e3('0x53')))),_0x26e3('0x54')],[db['sequelize']['fn'](_0x26e3('0x48'),db[_0x26e3('0x47')]['fn']('IF',db['sequelize'][_0x26e3('0x49')](_0x26e3('0x55')))),_0x26e3('0x56')]]})[_0x26e3('0x21')](handleEntityNotFound(_0x5af0f1,null))[_0x26e3('0x21')](respondWithResult(_0x5af0f1,null))['catch'](handleError(_0x5af0f1,null));};exports[_0x26e3('0x57')]=function(_0x332313,_0x4a337c,_0x1fe8c2){return db[_0x26e3('0x26')][_0x26e3('0x3b')]({'raw':![],'where':{'CampaignId':_0x332313[_0x26e3('0x45')]['id']},'attributes':[[db['sequelize']['fn']('COUNT',db[_0x26e3('0x47')]['fn']('IF',db[_0x26e3('0x47')][_0x26e3('0x49')](_0x26e3('0x4a')))),_0x26e3('0x4b')],[db['sequelize']['fn']('COUNT',db[_0x26e3('0x47')]['fn']('IF',db[_0x26e3('0x47')][_0x26e3('0x49')]('`state`\x20=\x203,\x201,\x20null'))),_0x26e3('0x4c')],[db[_0x26e3('0x47')]['fn'](_0x26e3('0x48'),db[_0x26e3('0x47')]['fn']('IF',db['sequelize'][_0x26e3('0x49')](_0x26e3('0x58')))),_0x26e3('0x59')],[db[_0x26e3('0x47')]['fn'](_0x26e3('0x48'),db['sequelize']['fn']('IF',db[_0x26e3('0x47')]['literal']('`state`\x20=\x208,\x201,\x20null'))),_0x26e3('0x4e')],[db[_0x26e3('0x47')]['fn'](_0x26e3('0x48'),db['sequelize']['fn']('IF',db['sequelize'][_0x26e3('0x49')](_0x26e3('0x4f')))),_0x26e3('0x50')],[db['sequelize']['fn'](_0x26e3('0x48'),db['sequelize']['fn']('IF',db['sequelize'][_0x26e3('0x49')]('`state`\x20=\x2011\x20,\x201,\x20null'))),_0x26e3('0x52')],[db[_0x26e3('0x47')]['fn'](_0x26e3('0x48'),db['sequelize']['fn']('IF',db[_0x26e3('0x47')][_0x26e3('0x49')](_0x26e3('0x53')))),_0x26e3('0x54')],[db[_0x26e3('0x47')]['fn'](_0x26e3('0x48'),db['sequelize']['fn']('IF',db[_0x26e3('0x47')][_0x26e3('0x49')](_0x26e3('0x55')))),_0x26e3('0x56')]]})[_0x26e3('0x21')](handleEntityNotFound(_0x4a337c,null))[_0x26e3('0x21')](respondWithResult(_0x4a337c,null))[_0x26e3('0x41')](handleError(_0x4a337c,null));};exports[_0x26e3('0x5a')]=function(_0x1acc4e,_0x30e4dd,_0x488071){return db['VoiceQueue']['find']({'where':{'id':_0x1acc4e[_0x26e3('0x45')]['id']}})['then'](handleEntityNotFound(_0x30e4dd,null))['then'](function(_0x8d6de3){var _0x264b6d;if(_0x8d6de3){_0x264b6d=squel[_0x26e3('0x5b')]()[_0x26e3('0x5c')](_0x26e3('0x5d'))[_0x26e3('0x5e')]([_0x26e3('0x5f'),_0x26e3('0x60'),_0x26e3('0x61'),_0x26e3('0x62'),_0x26e3('0x63'),_0x26e3('0x64'),_0x26e3('0x65')],squel['select']()[_0x26e3('0x66')](_0x26e3('0x67'),'phone')[_0x26e3('0x66')](_0x26e3('0x68'),_0x26e3('0x60'))[_0x26e3('0x66')]('ANY_VALUE(ContactId)',_0x26e3('0x61'))[_0x26e3('0x66')](_0x26e3('0x69'),_0x26e3('0x62'))['field']('ANY_VALUE(VoiceQueueId)',_0x26e3('0x63'))[_0x26e3('0x66')](_0x26e3('0x68'),'createdAt')[_0x26e3('0x66')](_0x26e3('0x68'),_0x26e3('0x65'))[_0x26e3('0x6a')](_0x26e3('0x6b'))[_0x26e3('0x32')](_0x26e3('0x6c'),_0x1acc4e[_0x26e3('0x45')]['id'][_0x26e3('0x6d')]())[_0x26e3('0x32')](_0x26e3('0x6e'),_0x1acc4e['body'][_0x26e3('0x6f')]['toString']())[_0x26e3('0x32')](_0x26e3('0x70'))[_0x26e3('0x32')]('calleridnum\x20NOT\x20IN\x20(?)',squel[_0x26e3('0x71')]()[_0x26e3('0x66')](_0x26e3('0x5f'))[_0x26e3('0x6a')]('cm_hopper')['where'](_0x26e3('0x6c'),_0x1acc4e[_0x26e3('0x45')]['id'][_0x26e3('0x6d')]()))[_0x26e3('0x32')](_0x26e3('0x72'),squel[_0x26e3('0x71')]()['field'](_0x26e3('0x73'))[_0x26e3('0x6a')](_0x26e3('0x6b'))[_0x26e3('0x32')](_0x26e3('0x6c'),_0x1acc4e['params']['id'][_0x26e3('0x6d')]())[_0x26e3('0x32')](_0x26e3('0x74')))[_0x26e3('0x75')](_0x26e3('0x61')))['toString']();return db[_0x26e3('0x47')][_0x26e3('0x29')](_0x264b6d);}return[];})[_0x26e3('0x21')](respondWithResult(_0x30e4dd,null))[_0x26e3('0x41')](handleError(_0x30e4dd,null));};exports['moveContactsIvrCampaignHopperFinal']=function(_0x59e79c,_0x2f9fc9,_0x43e53f){return db[_0x26e3('0x76')][_0x26e3('0x40')]({'where':{'id':_0x59e79c['params']['id']}})[_0x26e3('0x21')](handleEntityNotFound(_0x2f9fc9,null))['then'](function(_0x499f64){var _0x1a5ed0;if(_0x499f64){_0x1a5ed0=squel[_0x26e3('0x5b')]()['into'](_0x26e3('0x5d'))['fromQuery']([_0x26e3('0x5f'),_0x26e3('0x60'),'ContactId',_0x26e3('0x62'),_0x26e3('0x77'),_0x26e3('0x64'),_0x26e3('0x65')],squel['select']()['field'](_0x26e3('0x67'),_0x26e3('0x5f'))['field'](_0x26e3('0x68'),_0x26e3('0x60'))['field'](_0x26e3('0x78'),'ContactId')[_0x26e3('0x66')](_0x26e3('0x69'),_0x26e3('0x62'))[_0x26e3('0x66')](_0x26e3('0x79'),'CampaignId')['field']('NOW()',_0x26e3('0x64'))[_0x26e3('0x66')](_0x26e3('0x68'),_0x26e3('0x65'))[_0x26e3('0x6a')](_0x26e3('0x6b'))['where'](_0x26e3('0x7a'),_0x59e79c[_0x26e3('0x45')]['id'][_0x26e3('0x6d')]())['where'](_0x26e3('0x6e'),_0x59e79c[_0x26e3('0x43')][_0x26e3('0x6f')][_0x26e3('0x6d')]())[_0x26e3('0x32')](_0x26e3('0x70'))[_0x26e3('0x32')](_0x26e3('0x72'),squel[_0x26e3('0x71')]()[_0x26e3('0x66')](_0x26e3('0x5f'))[_0x26e3('0x6a')](_0x26e3('0x5d'))[_0x26e3('0x32')](_0x26e3('0x7a'),_0x59e79c[_0x26e3('0x45')]['id']['toString']()))[_0x26e3('0x32')]('calleridnum\x20NOT\x20IN\x20(?)',squel[_0x26e3('0x71')]()[_0x26e3('0x66')](_0x26e3('0x73'))[_0x26e3('0x6a')](_0x26e3('0x6b'))[_0x26e3('0x32')](_0x26e3('0x7a'),_0x59e79c['params']['id'][_0x26e3('0x6d')]())[_0x26e3('0x32')](_0x26e3('0x74')))['group']('ContactId'))[_0x26e3('0x6d')]();return db[_0x26e3('0x47')][_0x26e3('0x29')](_0x1a5ed0);}return[];})[_0x26e3('0x21')](respondWithResult(_0x2f9fc9,null))[_0x26e3('0x41')](handleError(_0x2f9fc9,null));};exports[_0x26e3('0x7b')]=function(_0x1d881d,_0x271e69,_0x33dec3){return db['CmHopper'][_0x26e3('0x7c')]({'where':{'VoiceQueueId':_0x1d881d[_0x26e3('0x43')]['VoiceQueueId'],'CampaignId':_0x1d881d[_0x26e3('0x43')][_0x26e3('0x77')],'ContactId':_0x1d881d[_0x26e3('0x43')]['ContactId']}})[_0x26e3('0x21')](handleEntityNotFound(_0x271e69,null))[_0x26e3('0x21')](function(_0x5ab8f3){if(_0x5ab8f3){return _0x5ab8f3;}return null;})[_0x26e3('0x21')](respondWithResult(_0x271e69,null))[_0x26e3('0x41')](handleError(_0x271e69,null));}; \ No newline at end of file +var _0xb36d=['ANY_VALUE(calleridnum)','ANY_VALUE(ContactId)','ListId','ANY_VALUE(VoiceQueueId)','NOW()','from','cm_hopper_final','VoiceQueueId\x20=\x20?','toString','calleridnum\x20NOT\x20IN\x20(?)','cm_hopper','select','calleridnum','state\x20=\x204','moveContactsIvrCampaignHopperFinal','ANY_VALUE(ListId)','ANY_VALUE(CampaignId)','CampaignId','CampaignId\x20=\x20?','state\x20=\x20?','group','findOne','html-pdf','eml-format','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','end','status','offset','limit','set','Content-Range','reject','update','then','destroy','sendStatus','error','stack','name','send','CmHopperFinal','rawAttributes','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','type','key','VIRTUAL','options','count','includeAll','include','findAll','catch','params','find','body','uniqueid','sequelize','COUNT','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','dropContacts','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','reCallContacts','`state`\x20=\x2019,\x201,\x20null','answeringMachine','countContactsIvrCampaignHopperFinal','`state`\x20=\x208,\x201,\x20null','VoiceQueue','fromQuery','phone','scheduledAt','ContactId','VoiceQueueId','createdAt','updatedAt','field'];(function(_0x3ba543,_0x4e8a10){var _0x4fcdcf=function(_0xb4aec4){while(--_0xb4aec4){_0x3ba543['push'](_0x3ba543['shift']());}};_0x4fcdcf(++_0x4e8a10);}(_0xb36d,0x10c));var _0xdb36=function(_0x2d7313,_0x541d51){_0x2d7313=_0x2d7313-0x0;var _0x102717=_0xb36d[_0x2d7313];return _0x102717;};'use strict';var pdf=require(_0xdb36('0x0'));var emlformat=require(_0xdb36('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xdb36('0x2'));var jsonpatch=require(_0xdb36('0x3'));var rp=require('request-promise');var moment=require(_0xdb36('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xdb36('0x5'));var util=require(_0xdb36('0x6'));var path=require(_0xdb36('0x7'));var sox=require(_0xdb36('0x8'));var csv=require(_0xdb36('0x9'));var ejs=require(_0xdb36('0xa'));var fs=require('fs');var _=require(_0xdb36('0xb'));var squel=require(_0xdb36('0xc'));var crypto=require(_0xdb36('0xd'));var jsforce=require(_0xdb36('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xdb36('0x9'));var querystring=require(_0xdb36('0xf'));var Papa=require(_0xdb36('0x10'));var Redis=require(_0xdb36('0x11'));var authService=require(_0xdb36('0x12'));var qs=require(_0xdb36('0x13'));var as=require(_0xdb36('0x14'));var hardwareService=require(_0xdb36('0x15'));var logger=require(_0xdb36('0x16'))(_0xdb36('0x17'));var utils=require(_0xdb36('0x18'));var config=require(_0xdb36('0x19'));var db=require(_0xdb36('0x1a'))['db'];function respondWithStatusCode(_0x55e140,_0x1106ac){_0x1106ac=_0x1106ac||0xcc;return function(_0x63e3d0){if(_0x63e3d0){return _0x55e140['sendStatus'](_0x1106ac);}return _0x55e140['status'](_0x1106ac)[_0xdb36('0x1b')]();};}function respondWithResult(_0xfac1be,_0x3621a9){_0x3621a9=_0x3621a9||0xc8;return function(_0x48590d){if(_0x48590d){return _0xfac1be[_0xdb36('0x1c')](_0x3621a9)['json'](_0x48590d);}};}function respondWithFilteredResult(_0x1eb2e7,_0x2b18f1){return function(_0x3431d){if(_0x3431d){var _0xa65600=_0x3431d['count'],_0x196af6=_0x2b18f1[_0xdb36('0x1d')],_0x1608d6=_0x2b18f1[_0xdb36('0x1d')]+_0x2b18f1[_0xdb36('0x1e')],_0x4aaed9;if(_0x1608d6>=_0xa65600){_0x1608d6=_0xa65600;_0x4aaed9=0xc8;}else{_0x4aaed9=0xce;}_0x1eb2e7[_0xdb36('0x1c')](_0x4aaed9);return _0x1eb2e7[_0xdb36('0x1f')](_0xdb36('0x20'),_0x196af6+'-'+_0x1608d6+'/'+_0xa65600)['json'](_0x3431d);}return null;};}function patchUpdates(_0x38ecd7){return function(_0x45b3fc){try{jsonpatch['apply'](_0x45b3fc,_0x38ecd7,!![]);}catch(_0x20e71e){return BPromise[_0xdb36('0x21')](_0x20e71e);}return _0x45b3fc['save']();};}function saveUpdates(_0x59d4b4,_0x10e522){return function(_0x29529e){if(_0x29529e){return _0x29529e[_0xdb36('0x22')](_0x59d4b4)[_0xdb36('0x23')](function(_0xd5c884){return _0xd5c884;});}return null;};}function removeEntity(_0x570704,_0x2a7736){return function(_0x4acc7b){if(_0x4acc7b){return _0x4acc7b[_0xdb36('0x24')]()[_0xdb36('0x23')](function(){_0x570704[_0xdb36('0x1c')](0xcc)[_0xdb36('0x1b')]();});}};}function handleEntityNotFound(_0x37b5a9,_0x41b7ed){return function(_0x15805c){if(!_0x15805c){_0x37b5a9[_0xdb36('0x25')](0x194);}return _0x15805c;};}function handleError(_0x3e54a6,_0x92c8b8){_0x92c8b8=_0x92c8b8||0x1f4;return function(_0xeb31cd){logger[_0xdb36('0x26')](_0xeb31cd[_0xdb36('0x27')]);if(_0xeb31cd[_0xdb36('0x28')]){delete _0xeb31cd[_0xdb36('0x28')];}_0x3e54a6[_0xdb36('0x1c')](_0x92c8b8)[_0xdb36('0x29')](_0xeb31cd);};}exports['index']=function(_0xfba219,_0x239c16){var _0x12784c={},_0x59c231={},_0x585783={'count':0x0,'rows':[]};var _0x127557=db[_0xdb36('0x2a')][_0xdb36('0x2b')];_0x59c231[_0xdb36('0x2c')]=_['keys'](_0x127557);_0x59c231[_0xdb36('0x2d')]=_[_0xdb36('0x2e')](_0xfba219[_0xdb36('0x2d')]);_0x59c231[_0xdb36('0x2f')]=_[_0xdb36('0x30')](_0x59c231['model'],_0x59c231['query']);_0x12784c[_0xdb36('0x31')]=_['intersection'](_0x59c231[_0xdb36('0x2c')],qs[_0xdb36('0x32')](_0xfba219[_0xdb36('0x2d')]['fields']));_0x12784c[_0xdb36('0x31')]=_0x12784c[_0xdb36('0x31')][_0xdb36('0x33')]?_0x12784c['attributes']:_0x59c231[_0xdb36('0x2c')];if(!_0xfba219[_0xdb36('0x2d')][_0xdb36('0x34')](_0xdb36('0x35'))){_0x12784c[_0xdb36('0x1e')]=qs[_0xdb36('0x1e')](_0xfba219[_0xdb36('0x2d')][_0xdb36('0x1e')]);_0x12784c[_0xdb36('0x1d')]=qs[_0xdb36('0x1d')](_0xfba219[_0xdb36('0x2d')][_0xdb36('0x1d')]);}_0x12784c[_0xdb36('0x36')]=qs[_0xdb36('0x37')](_0xfba219['query']['sort']);_0x12784c['where']=qs['filters'](_[_0xdb36('0x38')](_0xfba219[_0xdb36('0x2d')],_0x59c231[_0xdb36('0x2f')]));if(_0xfba219[_0xdb36('0x2d')][_0xdb36('0x39')]){_0x12784c[_0xdb36('0x3a')]=_[_0xdb36('0x3b')](_0x12784c[_0xdb36('0x3a')],{'$or':_['map'](_0x127557,function(_0x4172ec){if(_0x4172ec[_0xdb36('0x3c')][_0xdb36('0x3d')]!==_0xdb36('0x3e')){var _0x494c94={};_0x494c94[_0x4172ec['field']]={'$like':'%'+_0xfba219['query'][_0xdb36('0x39')]+'%'};return _0x494c94;}})});}_0x12784c=_['merge']({},_0x12784c,_0xfba219[_0xdb36('0x3f')]);var _0x591d28={'where':_0x12784c['where']};return db[_0xdb36('0x2a')][_0xdb36('0x40')](_0x591d28)[_0xdb36('0x23')](function(_0x29f7d6){_0x585783[_0xdb36('0x40')]=_0x29f7d6;if(_0xfba219[_0xdb36('0x2d')][_0xdb36('0x41')]){_0x12784c[_0xdb36('0x42')]=[{'all':!![]}];}return db[_0xdb36('0x2a')][_0xdb36('0x43')](_0x12784c);})['then'](function(_0x39b6bb){_0x585783['rows']=_0x39b6bb;return _0x585783;})[_0xdb36('0x23')](respondWithFilteredResult(_0x239c16,_0x12784c))[_0xdb36('0x44')](handleError(_0x239c16,null));};exports['show']=function(_0x266077,_0x3dc161){var _0x3f6dc4={'raw':!![],'where':{'id':_0x266077[_0xdb36('0x45')]['id']}},_0x4234b2={};_0x4234b2[_0xdb36('0x2c')]=_[_0xdb36('0x2e')](db['CmHopperFinal']['rawAttributes']);_0x4234b2[_0xdb36('0x2d')]=_[_0xdb36('0x2e')](_0x266077[_0xdb36('0x2d')]);_0x4234b2['filters']=_['intersection'](_0x4234b2[_0xdb36('0x2c')],_0x4234b2[_0xdb36('0x2d')]);_0x3f6dc4[_0xdb36('0x31')]=_[_0xdb36('0x30')](_0x4234b2[_0xdb36('0x2c')],qs[_0xdb36('0x32')](_0x266077[_0xdb36('0x2d')]['fields']));_0x3f6dc4[_0xdb36('0x31')]=_0x3f6dc4[_0xdb36('0x31')]['length']?_0x3f6dc4[_0xdb36('0x31')]:_0x4234b2['model'];if(_0x266077['query'][_0xdb36('0x41')]){_0x3f6dc4[_0xdb36('0x42')]=[{'all':!![]}];}_0x3f6dc4=_[_0xdb36('0x3b')]({},_0x3f6dc4,_0x266077[_0xdb36('0x3f')]);return db[_0xdb36('0x2a')][_0xdb36('0x46')](_0x3f6dc4)[_0xdb36('0x23')](handleEntityNotFound(_0x3dc161,null))['then'](respondWithResult(_0x3dc161,null))[_0xdb36('0x44')](handleError(_0x3dc161,null));};exports['describe']=function(_0xf2eca1,_0x5bc754){return db[_0xdb36('0x2a')]['describe']()['then'](respondWithResult(_0x5bc754,null))[_0xdb36('0x44')](handleError(_0x5bc754,null));};exports['update']=function(_0x375181,_0x23f3ca){if(_0x375181[_0xdb36('0x47')][_0xdb36('0x48')]){delete _0x375181['body'][_0xdb36('0x48')];}return db['CmHopperFinal'][_0xdb36('0x46')]({'where':{'uniqueid':_0x375181['params']['id']}})['then'](handleEntityNotFound(_0x23f3ca,null))[_0xdb36('0x23')](saveUpdates(_0x375181[_0xdb36('0x47')],null))[_0xdb36('0x23')](respondWithResult(_0x23f3ca,null))[_0xdb36('0x44')](handleError(_0x23f3ca,null));};exports['countContactsQueueCampaignHopperFinal']=function(_0x28aef3,_0x552259,_0x10a747){return db[_0xdb36('0x2a')][_0xdb36('0x43')]({'raw':![],'where':{'VoiceQueueId':_0x28aef3[_0xdb36('0x45')]['id']},'attributes':[[db[_0xdb36('0x49')]['fn'](_0xdb36('0x4a'),db[_0xdb36('0x49')]['fn']('IF',db[_0xdb36('0x49')][_0xdb36('0x4b')](_0xdb36('0x4c')))),_0xdb36('0x4d')],[db[_0xdb36('0x49')]['fn'](_0xdb36('0x4a'),db[_0xdb36('0x49')]['fn']('IF',db[_0xdb36('0x49')]['literal'](_0xdb36('0x4e')))),_0xdb36('0x4f')],[db[_0xdb36('0x49')]['fn'](_0xdb36('0x4a'),db[_0xdb36('0x49')]['fn']('IF',db[_0xdb36('0x49')]['literal'](_0xdb36('0x50')))),_0xdb36('0x51')],[db[_0xdb36('0x49')]['fn'](_0xdb36('0x4a'),db[_0xdb36('0x49')]['fn']('IF',db['sequelize'][_0xdb36('0x4b')]('`state`\x20=\x208,\x201,\x20null'))),_0xdb36('0x52')],[db[_0xdb36('0x49')]['fn'](_0xdb36('0x4a'),db[_0xdb36('0x49')]['fn']('IF',db[_0xdb36('0x49')][_0xdb36('0x4b')](_0xdb36('0x53')))),_0xdb36('0x54')],[db[_0xdb36('0x49')]['fn']('COUNT',db[_0xdb36('0x49')]['fn']('IF',db[_0xdb36('0x49')][_0xdb36('0x4b')]('`state`\x20=\x2011\x20,\x201,\x20null'))),_0xdb36('0x55')],[db[_0xdb36('0x49')]['fn'](_0xdb36('0x4a'),db['sequelize']['fn']('IF',db[_0xdb36('0x49')][_0xdb36('0x4b')](_0xdb36('0x56')))),_0xdb36('0x57')],[db['sequelize']['fn']('COUNT',db[_0xdb36('0x49')]['fn']('IF',db[_0xdb36('0x49')]['literal'](_0xdb36('0x58')))),_0xdb36('0x59')]]})[_0xdb36('0x23')](handleEntityNotFound(_0x552259,null))[_0xdb36('0x23')](respondWithResult(_0x552259,null))[_0xdb36('0x44')](handleError(_0x552259,null));};exports[_0xdb36('0x5a')]=function(_0x304209,_0x363fed,_0x1501a6){return db['CmHopperFinal'][_0xdb36('0x43')]({'raw':![],'where':{'CampaignId':_0x304209[_0xdb36('0x45')]['id']},'attributes':[[db[_0xdb36('0x49')]['fn'](_0xdb36('0x4a'),db['sequelize']['fn']('IF',db[_0xdb36('0x49')]['literal'](_0xdb36('0x4c')))),'noSuchContacts'],[db[_0xdb36('0x49')]['fn'](_0xdb36('0x4a'),db[_0xdb36('0x49')]['fn']('IF',db['sequelize'][_0xdb36('0x4b')]('`state`\x20=\x203,\x201,\x20null'))),_0xdb36('0x4f')],[db[_0xdb36('0x49')]['fn'](_0xdb36('0x4a'),db[_0xdb36('0x49')]['fn']('IF',db[_0xdb36('0x49')][_0xdb36('0x4b')](_0xdb36('0x50')))),_0xdb36('0x51')],[db[_0xdb36('0x49')]['fn'](_0xdb36('0x4a'),db['sequelize']['fn']('IF',db[_0xdb36('0x49')][_0xdb36('0x4b')](_0xdb36('0x5b')))),'congestionContacts'],[db[_0xdb36('0x49')]['fn'](_0xdb36('0x4a'),db[_0xdb36('0x49')]['fn']('IF',db[_0xdb36('0x49')][_0xdb36('0x4b')](_0xdb36('0x53')))),'dropContacts'],[db[_0xdb36('0x49')]['fn'](_0xdb36('0x4a'),db[_0xdb36('0x49')]['fn']('IF',db[_0xdb36('0x49')][_0xdb36('0x4b')]('`state`\x20=\x2011\x20,\x201,\x20null'))),_0xdb36('0x55')],[db['sequelize']['fn']('COUNT',db[_0xdb36('0x49')]['fn']('IF',db[_0xdb36('0x49')][_0xdb36('0x4b')](_0xdb36('0x56')))),'reCallContacts'],[db['sequelize']['fn'](_0xdb36('0x4a'),db[_0xdb36('0x49')]['fn']('IF',db[_0xdb36('0x49')][_0xdb36('0x4b')]('`state`\x20=\x2019,\x201,\x20null'))),_0xdb36('0x59')]]})[_0xdb36('0x23')](handleEntityNotFound(_0x363fed,null))[_0xdb36('0x23')](respondWithResult(_0x363fed,null))[_0xdb36('0x44')](handleError(_0x363fed,null));};exports['moveContactsQueueCampaignHopperFinal']=function(_0x181222,_0x589231,_0x3d788c){return db[_0xdb36('0x5c')][_0xdb36('0x46')]({'where':{'id':_0x181222['params']['id']}})[_0xdb36('0x23')](handleEntityNotFound(_0x589231,null))['then'](function(_0x2c188a){var _0x4e02b2;if(_0x2c188a){_0x4e02b2=squel['insert']()['into']('cm_hopper')[_0xdb36('0x5d')]([_0xdb36('0x5e'),_0xdb36('0x5f'),_0xdb36('0x60'),'ListId',_0xdb36('0x61'),_0xdb36('0x62'),_0xdb36('0x63')],squel['select']()[_0xdb36('0x64')](_0xdb36('0x65'),_0xdb36('0x5e'))[_0xdb36('0x64')]('NOW()','scheduledAt')[_0xdb36('0x64')](_0xdb36('0x66'),'ContactId')[_0xdb36('0x64')]('ANY_VALUE(ListId)',_0xdb36('0x67'))[_0xdb36('0x64')](_0xdb36('0x68'),_0xdb36('0x61'))[_0xdb36('0x64')](_0xdb36('0x69'),_0xdb36('0x62'))[_0xdb36('0x64')](_0xdb36('0x69'),_0xdb36('0x63'))[_0xdb36('0x6a')](_0xdb36('0x6b'))['where'](_0xdb36('0x6c'),_0x181222['params']['id'][_0xdb36('0x6d')]())['where']('state\x20=\x20?',_0x181222[_0xdb36('0x47')]['state']['toString']())[_0xdb36('0x3a')]('calleridnum\x20IS\x20NOT\x20NULL')[_0xdb36('0x3a')](_0xdb36('0x6e'),squel['select']()[_0xdb36('0x64')](_0xdb36('0x5e'))[_0xdb36('0x6a')](_0xdb36('0x6f'))[_0xdb36('0x3a')]('VoiceQueueId\x20=\x20?',_0x181222[_0xdb36('0x45')]['id'][_0xdb36('0x6d')]()))[_0xdb36('0x3a')]('calleridnum\x20NOT\x20IN\x20(?)',squel[_0xdb36('0x70')]()[_0xdb36('0x64')](_0xdb36('0x71'))['from'](_0xdb36('0x6b'))[_0xdb36('0x3a')](_0xdb36('0x6c'),_0x181222[_0xdb36('0x45')]['id'][_0xdb36('0x6d')]())[_0xdb36('0x3a')](_0xdb36('0x72')))['group'](_0xdb36('0x60')))[_0xdb36('0x6d')]();return db[_0xdb36('0x49')]['query'](_0x4e02b2);}return[];})[_0xdb36('0x23')](respondWithResult(_0x589231,null))[_0xdb36('0x44')](handleError(_0x589231,null));};exports[_0xdb36('0x73')]=function(_0x191af9,_0x4afcb4,_0x2d29f4){return db['Campaign']['find']({'where':{'id':_0x191af9[_0xdb36('0x45')]['id']}})['then'](handleEntityNotFound(_0x4afcb4,null))['then'](function(_0x445d7d){var _0x1c7410;if(_0x445d7d){_0x1c7410=squel['insert']()['into']('cm_hopper')[_0xdb36('0x5d')]([_0xdb36('0x5e'),_0xdb36('0x5f'),'ContactId',_0xdb36('0x67'),'CampaignId','createdAt','updatedAt'],squel['select']()[_0xdb36('0x64')]('ANY_VALUE(calleridnum)',_0xdb36('0x5e'))[_0xdb36('0x64')](_0xdb36('0x69'),_0xdb36('0x5f'))[_0xdb36('0x64')](_0xdb36('0x66'),_0xdb36('0x60'))[_0xdb36('0x64')](_0xdb36('0x74'),_0xdb36('0x67'))[_0xdb36('0x64')](_0xdb36('0x75'),_0xdb36('0x76'))[_0xdb36('0x64')](_0xdb36('0x69'),_0xdb36('0x62'))[_0xdb36('0x64')](_0xdb36('0x69'),_0xdb36('0x63'))['from'](_0xdb36('0x6b'))[_0xdb36('0x3a')](_0xdb36('0x77'),_0x191af9[_0xdb36('0x45')]['id']['toString']())[_0xdb36('0x3a')](_0xdb36('0x78'),_0x191af9[_0xdb36('0x47')]['state']['toString']())['where']('calleridnum\x20IS\x20NOT\x20NULL')[_0xdb36('0x3a')]('calleridnum\x20NOT\x20IN\x20(?)',squel[_0xdb36('0x70')]()[_0xdb36('0x64')](_0xdb36('0x5e'))[_0xdb36('0x6a')](_0xdb36('0x6f'))['where'](_0xdb36('0x77'),_0x191af9[_0xdb36('0x45')]['id'][_0xdb36('0x6d')]()))[_0xdb36('0x3a')](_0xdb36('0x6e'),squel[_0xdb36('0x70')]()[_0xdb36('0x64')](_0xdb36('0x71'))[_0xdb36('0x6a')]('cm_hopper_final')['where'](_0xdb36('0x77'),_0x191af9[_0xdb36('0x45')]['id'][_0xdb36('0x6d')]())[_0xdb36('0x3a')](_0xdb36('0x72')))[_0xdb36('0x79')](_0xdb36('0x60')))[_0xdb36('0x6d')]();return db[_0xdb36('0x49')][_0xdb36('0x2d')](_0x1c7410);}return[];})['then'](respondWithResult(_0x4afcb4,null))[_0xdb36('0x44')](handleError(_0x4afcb4,null));};exports['checkContactHopper']=function(_0x4f04c5,_0x442ee6,_0xdc44){return db['CmHopper'][_0xdb36('0x7a')]({'where':{'VoiceQueueId':_0x4f04c5[_0xdb36('0x47')][_0xdb36('0x61')],'CampaignId':_0x4f04c5[_0xdb36('0x47')]['CampaignId'],'ContactId':_0x4f04c5[_0xdb36('0x47')]['ContactId']}})[_0xdb36('0x23')](handleEntityNotFound(_0x442ee6,null))[_0xdb36('0x23')](function(_0x1c1ab3){if(_0x1c1ab3){return _0x1c1ab3;}return null;})[_0xdb36('0x23')](respondWithResult(_0x442ee6,null))[_0xdb36('0x44')](handleError(_0x442ee6,null));}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.model.js b/server/api/cmHopperFinal/cmHopperFinal.model.js index 4f599fc..9480e9f 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 _0x29e3=['exports','define','CmHopperFinal','cm_hopper_final','calleridnum','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmHopperFinal.attributes'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x29e3,0xd2));var _0x329e=function(_0x5c82fb,_0x26551b){_0x5c82fb=_0x5c82fb-0x0;var _0x1d937d=_0x29e3[_0x5c82fb];return _0x1d937d;};'use strict';var _=require(_0x329e('0x0'));var util=require(_0x329e('0x1'));var logger=require(_0x329e('0x2'))(_0x329e('0x3'));var moment=require(_0x329e('0x4'));var BPromise=require(_0x329e('0x5'));var rp=require(_0x329e('0x6'));var fs=require('fs');var path=require(_0x329e('0x7'));var rimraf=require(_0x329e('0x8'));var config=require(_0x329e('0x9'));var attributes=require(_0x329e('0xa'));module[_0x329e('0xb')]=function(_0x2fc368,_0x76a330){return _0x2fc368[_0x329e('0xc')](_0x329e('0xd'),attributes,{'tableName':_0x329e('0xe'),'paranoid':![],'indexes':[{'name':_0x329e('0xf'),'fields':[_0x329e('0xf')]},{'name':'uniqueid','fields':[_0x329e('0x10')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x0836=['../../config/environment','./cmHopperFinal.attributes','exports','define','CmHopperFinal','cm_hopper_final','calleridnum','uniqueid','lodash','util','request-promise','path','rimraf'];(function(_0x23a8fe,_0x1f2f76){var _0x30048d=function(_0x7a3db1){while(--_0x7a3db1){_0x23a8fe['push'](_0x23a8fe['shift']());}};_0x30048d(++_0x1f2f76);}(_0x0836,0x14d));var _0x6083=function(_0x587a2c,_0x4d93a9){_0x587a2c=_0x587a2c-0x0;var _0x52e94e=_0x0836[_0x587a2c];return _0x52e94e;};'use strict';var _=require(_0x6083('0x0'));var util=require(_0x6083('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x6083('0x2'));var fs=require('fs');var path=require(_0x6083('0x3'));var rimraf=require(_0x6083('0x4'));var config=require(_0x6083('0x5'));var attributes=require(_0x6083('0x6'));module[_0x6083('0x7')]=function(_0x22f148,_0x5a08c2){return _0x22f148[_0x6083('0x8')](_0x6083('0x9'),attributes,{'tableName':_0x6083('0xa'),'paranoid':![],'indexes':[{'name':'calleridnum','fields':[_0x6083('0xb')]},{'name':_0x6083('0xc'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.rpc.js b/server/api/cmHopperFinal/cmHopperFinal.rpc.js index 378fc28..ca6259d 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 _0xbbc2=['info','request\x20sent','CmHopperFinal,\x20%s,\x20%s,\x20%s','stringify','error','code','message','CmHopperFinal,\x20%s,\x20%s','catch','CreateCmHopperFinal','CmHopperFinal','body','options','raw','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then'];(function(_0x20cfdc,_0x178cb9){var _0x9e141c=function(_0xbd5ddd){while(--_0xbd5ddd){_0x20cfdc['push'](_0x20cfdc['shift']());}};_0x9e141c(++_0x178cb9);}(_0xbbc2,0xa0));var _0x2bbc=function(_0x2f05f8,_0xbb93ab){_0x2f05f8=_0x2f05f8-0x0;var _0x373d66=_0xbbc2[_0x2f05f8];return _0x373d66;};'use strict';var _=require(_0x2bbc('0x0'));var util=require(_0x2bbc('0x1'));var moment=require(_0x2bbc('0x2'));var BPromise=require(_0x2bbc('0x3'));var rs=require(_0x2bbc('0x4'));var fs=require('fs');var Redis=require(_0x2bbc('0x5'));var db=require(_0x2bbc('0x6'))['db'];var utils=require(_0x2bbc('0x7'));var logger=require(_0x2bbc('0x8'))(_0x2bbc('0x9'));var config=require('../../config/environment');var jayson=require(_0x2bbc('0xa'));var client=jayson[_0x2bbc('0xb')][_0x2bbc('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x42f1c8,_0x68ee2e,_0xadc754){return new BPromise(function(_0xed6f9a,_0x3f9e91){return client['request'](_0x42f1c8,_0xadc754)[_0x2bbc('0xd')](function(_0x3103ed){logger[_0x2bbc('0xe')]('CmHopperFinal,\x20%s,\x20%s',_0x68ee2e,_0x2bbc('0xf'));logger['debug'](_0x2bbc('0x10'),_0x68ee2e,_0x2bbc('0xf'),JSON[_0x2bbc('0x11')](_0x3103ed));if(_0x3103ed[_0x2bbc('0x12')]){if(_0x3103ed[_0x2bbc('0x12')][_0x2bbc('0x13')]===0x1f4){logger[_0x2bbc('0x12')]('CmHopperFinal,\x20%s,\x20%s',_0x68ee2e,_0x3103ed[_0x2bbc('0x12')][_0x2bbc('0x14')]);return _0x3f9e91(_0x3103ed[_0x2bbc('0x12')][_0x2bbc('0x14')]);}logger['error'](_0x2bbc('0x15'),_0x68ee2e,_0x3103ed[_0x2bbc('0x12')]['message']);return _0xed6f9a(_0x3103ed['error']['message']);}else{logger[_0x2bbc('0xe')](_0x2bbc('0x15'),_0x68ee2e,_0x2bbc('0xf'));_0xed6f9a(_0x3103ed['result'][_0x2bbc('0x14')]);}})[_0x2bbc('0x16')](function(_0x5649d5){logger[_0x2bbc('0x12')](_0x2bbc('0x15'),_0x68ee2e,_0x5649d5);_0x3f9e91(_0x5649d5);});});}exports[_0x2bbc('0x17')]=function(_0x4c3549){var _0x4c9612=this;return new Promise(function(_0x3e3dd6,_0x31a918){return db[_0x2bbc('0x18')]['create'](_0x4c3549[_0x2bbc('0x19')],{'raw':_0x4c3549[_0x2bbc('0x1a')]?_0x4c3549[_0x2bbc('0x1a')][_0x2bbc('0x1b')]===undefined?!![]:![]:!![]})[_0x2bbc('0xd')](function(_0x308633){logger[_0x2bbc('0xe')](_0x2bbc('0x17'),_0x4c3549);logger[_0x2bbc('0x1c')](_0x2bbc('0x17'),_0x4c3549,JSON[_0x2bbc('0x11')](_0x308633));_0x3e3dd6(_0x308633);})[_0x2bbc('0x16')](function(_0x99fce4){logger['error'](_0x2bbc('0x17'),_0x99fce4[_0x2bbc('0x14')],_0x4c3549);_0x31a918(_0x4c9612[_0x2bbc('0x12')](0x1f4,_0x99fce4[_0x2bbc('0x14')]));});});}; \ No newline at end of file +var _0xf463=['debug','CmHopperFinal,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CmHopperFinal','create','body','options','raw','CreateCmHopperFinal','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','info','CmHopperFinal,\x20%s,\x20%s','request\x20sent'];(function(_0xdd88a4,_0x32b8c6){var _0xf09452=function(_0x3ee208){while(--_0x3ee208){_0xdd88a4['push'](_0xdd88a4['shift']());}};_0xf09452(++_0x32b8c6);}(_0xf463,0x94));var _0x3f46=function(_0x4d51d5,_0x3421d8){_0x4d51d5=_0x4d51d5-0x0;var _0x24de83=_0xf463[_0x4d51d5];return _0x24de83;};'use strict';var _=require('lodash');var util=require(_0x3f46('0x0'));var moment=require('moment');var BPromise=require(_0x3f46('0x1'));var rs=require(_0x3f46('0x2'));var fs=require('fs');var Redis=require(_0x3f46('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x3f46('0x4'));var logger=require(_0x3f46('0x5'))(_0x3f46('0x6'));var config=require('../../config/environment');var jayson=require(_0x3f46('0x7'));var client=jayson[_0x3f46('0x8')][_0x3f46('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5626d5,_0x3ba556,_0x288523){return new BPromise(function(_0x43b630,_0x3d1c58){return client[_0x3f46('0xa')](_0x5626d5,_0x288523)['then'](function(_0x27985d){logger[_0x3f46('0xb')](_0x3f46('0xc'),_0x3ba556,_0x3f46('0xd'));logger[_0x3f46('0xe')](_0x3f46('0xf'),_0x3ba556,_0x3f46('0xd'),JSON[_0x3f46('0x10')](_0x27985d));if(_0x27985d[_0x3f46('0x11')]){if(_0x27985d[_0x3f46('0x11')][_0x3f46('0x12')]===0x1f4){logger[_0x3f46('0x11')](_0x3f46('0xc'),_0x3ba556,_0x27985d['error']['message']);return _0x3d1c58(_0x27985d[_0x3f46('0x11')][_0x3f46('0x13')]);}logger[_0x3f46('0x11')](_0x3f46('0xc'),_0x3ba556,_0x27985d['error'][_0x3f46('0x13')]);return _0x43b630(_0x27985d['error'][_0x3f46('0x13')]);}else{logger[_0x3f46('0xb')](_0x3f46('0xc'),_0x3ba556,'request\x20sent');_0x43b630(_0x27985d[_0x3f46('0x14')][_0x3f46('0x13')]);}})['catch'](function(_0x186678){logger[_0x3f46('0x11')]('CmHopperFinal,\x20%s,\x20%s',_0x3ba556,_0x186678);_0x3d1c58(_0x186678);});});}exports['CreateCmHopperFinal']=function(_0xfe12d3){var _0x551ee7=this;return new Promise(function(_0x532bdb,_0x3ff9fe){return db[_0x3f46('0x15')][_0x3f46('0x16')](_0xfe12d3[_0x3f46('0x17')],{'raw':_0xfe12d3['options']?_0xfe12d3[_0x3f46('0x18')][_0x3f46('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x4b9875){logger['info'](_0x3f46('0x1a'),_0xfe12d3);logger[_0x3f46('0xe')](_0x3f46('0x1a'),_0xfe12d3,JSON[_0x3f46('0x10')](_0x4b9875));_0x532bdb(_0x4b9875);})['catch'](function(_0x4cff45){logger[_0x3f46('0x11')](_0x3f46('0x1a'),_0x4cff45[_0x3f46('0x13')],_0xfe12d3);_0x3ff9fe(_0x551ee7[_0x3f46('0x11')](0x1f4,_0x4cff45[_0x3f46('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/index.js b/server/api/cmHopperFinal/index.js index 7d5faf8..a7bf4dd 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 _0xd5bc=['checkContactHopper','put','exports','path','connect-timeout','express','../../components/auth/service','../../config/environment','./cmHopperFinal.controller','isAuthenticated','index','get','/describe','describe','/:id','show','/voice/queue/countAttributes/:id','post','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','/voice/campaign/moveContacts/:id'];(function(_0x53b7ca,_0x7b041d){var _0x4a64bd=function(_0x2f2d03){while(--_0x2f2d03){_0x53b7ca['push'](_0x53b7ca['shift']());}};_0x4a64bd(++_0x7b041d);}(_0xd5bc,0x1d1));var _0xcd5b=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xd5bc[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xcd5b('0x0'));var timeout=require(_0xcd5b('0x1'));var express=require(_0xcd5b('0x2'));var router=express['Router']();var auth=require(_0xcd5b('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xcd5b('0x4'));var controller=require(_0xcd5b('0x5'));router['get']('/',auth[_0xcd5b('0x6')](),controller[_0xcd5b('0x7')]);router[_0xcd5b('0x8')](_0xcd5b('0x9'),auth['isAuthenticated'](),controller[_0xcd5b('0xa')]);router[_0xcd5b('0x8')](_0xcd5b('0xb'),auth[_0xcd5b('0x6')](),controller[_0xcd5b('0xc')]);router[_0xcd5b('0x8')](_0xcd5b('0xd'),auth[_0xcd5b('0x6')](),controller['countContactsQueueCampaignHopperFinal']);router[_0xcd5b('0x8')]('/campaign/countAttributes/:id',auth[_0xcd5b('0x6')](),controller['countContactsIvrCampaignHopperFinal']);router[_0xcd5b('0xe')](_0xcd5b('0xf'),auth['isAuthenticated'](),controller[_0xcd5b('0x10')]);router[_0xcd5b('0xe')](_0xcd5b('0x11'),auth[_0xcd5b('0x6')](),controller['moveContactsIvrCampaignHopperFinal']);router[_0xcd5b('0xe')]('/checkContactHopper',auth[_0xcd5b('0x6')](),controller[_0xcd5b('0x12')]);router[_0xcd5b('0x13')](_0xcd5b('0xb'),auth['isAuthenticated'](),controller['update']);module[_0xcd5b('0x14')]=router; \ No newline at end of file +var _0xecf5=['get','isAuthenticated','index','/describe','describe','/:id','show','countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','post','moveContactsIvrCampaignHopperFinal','/checkContactHopper','checkContactHopper','put','update','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperFinal.controller'];(function(_0x18f5d4,_0x4b5aa6){var _0x50cde2=function(_0x1faf7a){while(--_0x1faf7a){_0x18f5d4['push'](_0x18f5d4['shift']());}};_0x50cde2(++_0x4b5aa6);}(_0xecf5,0x162));var _0x5ecf=function(_0x30a9f0,_0x51801a){_0x30a9f0=_0x30a9f0-0x0;var _0x2304ba=_0xecf5[_0x30a9f0];return _0x2304ba;};'use strict';var multer=require(_0x5ecf('0x0'));var util=require(_0x5ecf('0x1'));var path=require(_0x5ecf('0x2'));var timeout=require(_0x5ecf('0x3'));var express=require(_0x5ecf('0x4'));var router=express[_0x5ecf('0x5')]();var auth=require(_0x5ecf('0x6'));var interaction=require(_0x5ecf('0x7'));var config=require(_0x5ecf('0x8'));var controller=require(_0x5ecf('0x9'));router[_0x5ecf('0xa')]('/',auth[_0x5ecf('0xb')](),controller[_0x5ecf('0xc')]);router[_0x5ecf('0xa')](_0x5ecf('0xd'),auth[_0x5ecf('0xb')](),controller[_0x5ecf('0xe')]);router['get'](_0x5ecf('0xf'),auth[_0x5ecf('0xb')](),controller[_0x5ecf('0x10')]);router[_0x5ecf('0xa')]('/voice/queue/countAttributes/:id',auth[_0x5ecf('0xb')](),controller[_0x5ecf('0x11')]);router[_0x5ecf('0xa')](_0x5ecf('0x12'),auth[_0x5ecf('0xb')](),controller[_0x5ecf('0x13')]);router[_0x5ecf('0x14')]('/voice/queue/moveContacts/:id',auth[_0x5ecf('0xb')](),controller['moveContactsQueueCampaignHopperFinal']);router[_0x5ecf('0x14')]('/voice/campaign/moveContacts/:id',auth[_0x5ecf('0xb')](),controller[_0x5ecf('0x15')]);router['post'](_0x5ecf('0x16'),auth['isAuthenticated'](),controller[_0x5ecf('0x17')]);router[_0x5ecf('0x18')](_0x5ecf('0xf'),auth[_0x5ecf('0xb')](),controller[_0x5ecf('0x19')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.attributes.js b/server/api/cmHopperHistory/cmHopperHistory.attributes.js index 4feccd5..b3cf867 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 _0xbbef=['STRING','DATE','BOOLEAN','sequelize','INTEGER'];(function(_0x43d69d,_0x5b4551){var _0x237952=function(_0x89bea){while(--_0x89bea){_0x43d69d['push'](_0x43d69d['shift']());}};_0x237952(++_0x5b4551);}(_0xbbef,0x1cf));var _0xfbbe=function(_0x48437d,_0x5e30a7){_0x48437d=_0x48437d-0x0;var _0x4727f7=_0xbbef[_0x48437d];return _0x4727f7;};'use strict';var Sequelize=require(_0xfbbe('0x0'));module['exports']={'state':{'type':Sequelize[_0xfbbe('0x1')](0x2)},'statedesc':{'type':Sequelize[_0xfbbe('0x2')]},'scheduledat':{'type':Sequelize[_0xfbbe('0x3')]},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xfbbe('0x1')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xfbbe('0x1')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xfbbe('0x1')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xfbbe('0x2')]},'originatecalleridnum':{'type':Sequelize[_0xfbbe('0x2')]},'originatecalleridname':{'type':Sequelize[_0xfbbe('0x2')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xfbbe('0x2')]},'starttime':{'type':Sequelize[_0xfbbe('0x3')]},'responsetime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0xfbbe('0x3')]},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0xfbbe('0x3')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xfbbe('0x1')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xfbbe('0x1')],'defaultValue':0x0},'followuptime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xfbbe('0x2')]},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize['STRING']},'reason':{'type':Sequelize[_0xfbbe('0x2')]},'amd':{'type':Sequelize[_0xfbbe('0x4')],'defaultValue':![]},'fax':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callback':{'type':Sequelize[_0xfbbe('0x4')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xfbbe('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xfbbe('0x3')]},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'editedat':{'type':Sequelize['DATE']},'edited':{'type':Sequelize[_0xfbbe('0x4')],'defaultValue':![]}}; \ No newline at end of file +var _0x3fe6=['exports','INTEGER','DATE','STRING','BOOLEAN','sequelize'];(function(_0x3a5daf,_0x2ab3ff){var _0x4fa0be=function(_0x2d21fd){while(--_0x2d21fd){_0x3a5daf['push'](_0x3a5daf['shift']());}};_0x4fa0be(++_0x2ab3ff);}(_0x3fe6,0x143));var _0x63fe=function(_0x9a3e0f,_0x2f796d){_0x9a3e0f=_0x9a3e0f-0x0;var _0x3d2a9a=_0x3fe6[_0x9a3e0f];return _0x3d2a9a;};'use strict';var Sequelize=require(_0x63fe('0x0'));module[_0x63fe('0x1')]={'state':{'type':Sequelize[_0x63fe('0x2')](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0x63fe('0x3')]},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x63fe('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x63fe('0x4')]},'originatecalleridnum':{'type':Sequelize[_0x63fe('0x4')]},'originatecalleridname':{'type':Sequelize[_0x63fe('0x4')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x63fe('0x4')]},'starttime':{'type':Sequelize[_0x63fe('0x3')]},'responsetime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize['DATE']},'droptime':{'type':Sequelize[_0x63fe('0x3')]},'endtime':{'type':Sequelize[_0x63fe('0x3')]},'ringtime':{'type':Sequelize[_0x63fe('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'talktime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x63fe('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize['STRING']},'campaign':{'type':Sequelize[_0x63fe('0x4')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x63fe('0x4')]},'reason':{'type':Sequelize['STRING']},'amd':{'type':Sequelize[_0x63fe('0x5')],'defaultValue':![]},'fax':{'type':Sequelize[_0x63fe('0x5')],'defaultValue':![]},'callback':{'type':Sequelize[_0x63fe('0x5')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x63fe('0x4')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x63fe('0x3')]},'recallme':{'type':Sequelize[_0x63fe('0x5')],'defaultValue':![]},'editedat':{'type':Sequelize[_0x63fe('0x3')]},'edited':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.controller.js b/server/api/cmHopperHistory/cmHopperHistory.controller.js index 193646d..835e7f9 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 _0x609e=['show','params','options','find','create','describe','body','uniqueid','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','CmHopperHistory','model','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','where','pick','merge','type','key','count','includeAll','include','findAll','rows','catch'];(function(_0x38eb23,_0x196e8b){var _0x48506a=function(_0x36edb0){while(--_0x36edb0){_0x38eb23['push'](_0x38eb23['shift']());}};_0x48506a(++_0x196e8b);}(_0x609e,0x16b));var _0xe609=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0x609e[_0x5c351c];return _0x26f3b3;};'use strict';var pdf=require(_0xe609('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xe609('0x1'));var zipdir=require(_0xe609('0x2'));var jsonpatch=require(_0xe609('0x3'));var rp=require(_0xe609('0x4'));var moment=require(_0xe609('0x5'));var BPromise=require(_0xe609('0x6'));var Mustache=require(_0xe609('0x7'));var util=require(_0xe609('0x8'));var path=require('path');var sox=require(_0xe609('0x9'));var csv=require(_0xe609('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0xe609('0xb'));var crypto=require(_0xe609('0xc'));var jsforce=require(_0xe609('0xd'));var deskjs=require(_0xe609('0xe'));var toCsv=require(_0xe609('0xa'));var querystring=require(_0xe609('0xf'));var Papa=require('papaparse');var Redis=require(_0xe609('0x10'));var authService=require(_0xe609('0x11'));var qs=require(_0xe609('0x12'));var as=require(_0xe609('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe609('0x14'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3462d9,_0x30e7c0){_0x30e7c0=_0x30e7c0||0xcc;return function(_0x444b74){if(_0x444b74){return _0x3462d9[_0xe609('0x15')](_0x30e7c0);}return _0x3462d9[_0xe609('0x16')](_0x30e7c0)[_0xe609('0x17')]();};}function respondWithResult(_0x1dc0a3,_0x33cdba){_0x33cdba=_0x33cdba||0xc8;return function(_0x1e05cb){if(_0x1e05cb){return _0x1dc0a3['status'](_0x33cdba)[_0xe609('0x18')](_0x1e05cb);}};}function respondWithFilteredResult(_0x1401a7,_0x37f9b8){return function(_0x12ca11){if(_0x12ca11){var _0x2cfae0=_0x12ca11['count'],_0x2fe842=_0x37f9b8['offset'],_0x1a9ed0=_0x37f9b8[_0xe609('0x19')]+_0x37f9b8[_0xe609('0x1a')],_0x747941;if(_0x1a9ed0>=_0x2cfae0){_0x1a9ed0=_0x2cfae0;_0x747941=0xc8;}else{_0x747941=0xce;}_0x1401a7[_0xe609('0x16')](_0x747941);return _0x1401a7[_0xe609('0x1b')](_0xe609('0x1c'),_0x2fe842+'-'+_0x1a9ed0+'/'+_0x2cfae0)[_0xe609('0x18')](_0x12ca11);}return null;};}function patchUpdates(_0x3cd199){return function(_0x53c00f){try{jsonpatch[_0xe609('0x1d')](_0x53c00f,_0x3cd199,!![]);}catch(_0x1c22e9){return BPromise[_0xe609('0x1e')](_0x1c22e9);}return _0x53c00f[_0xe609('0x1f')]();};}function saveUpdates(_0x3db99e,_0x1e7165){return function(_0x202d5d){if(_0x202d5d){return _0x202d5d[_0xe609('0x20')](_0x3db99e)[_0xe609('0x21')](function(_0x3a8798){return _0x3a8798;});}return null;};}function removeEntity(_0x4f0ac7,_0x3d979a){return function(_0x305648){if(_0x305648){return _0x305648[_0xe609('0x22')]()[_0xe609('0x21')](function(){_0x4f0ac7[_0xe609('0x16')](0xcc)[_0xe609('0x17')]();});}};}function handleEntityNotFound(_0x557648,_0x11a28b){return function(_0x195a3b){if(!_0x195a3b){_0x557648[_0xe609('0x15')](0x194);}return _0x195a3b;};}function handleError(_0x48e4a8,_0x2f5325){_0x2f5325=_0x2f5325||0x1f4;return function(_0x4c4e74){logger[_0xe609('0x23')](_0x4c4e74[_0xe609('0x24')]);if(_0x4c4e74[_0xe609('0x25')]){delete _0x4c4e74[_0xe609('0x25')];}_0x48e4a8[_0xe609('0x16')](_0x2f5325)[_0xe609('0x26')](_0x4c4e74);};}exports[_0xe609('0x27')]=function(_0xf31753,_0x209338){var _0x597ff3={},_0x1b9e05={},_0x447e9f={'count':0x0,'rows':[]};var _0x262587=db[_0xe609('0x28')]['rawAttributes'];_0x1b9e05[_0xe609('0x29')]=_['keys'](_0x262587);_0x1b9e05[_0xe609('0x2a')]=_[_0xe609('0x2b')](_0xf31753[_0xe609('0x2a')]);_0x1b9e05[_0xe609('0x2c')]=_['intersection'](_0x1b9e05[_0xe609('0x29')],_0x1b9e05['query']);_0x597ff3[_0xe609('0x2d')]=_[_0xe609('0x2e')](_0x1b9e05[_0xe609('0x29')],qs[_0xe609('0x2f')](_0xf31753[_0xe609('0x2a')][_0xe609('0x2f')]));_0x597ff3[_0xe609('0x2d')]=_0x597ff3[_0xe609('0x2d')][_0xe609('0x30')]?_0x597ff3['attributes']:_0x1b9e05[_0xe609('0x29')];if(!_0xf31753[_0xe609('0x2a')]['hasOwnProperty'](_0xe609('0x31'))){_0x597ff3[_0xe609('0x1a')]=qs[_0xe609('0x1a')](_0xf31753[_0xe609('0x2a')][_0xe609('0x1a')]);_0x597ff3[_0xe609('0x19')]=qs[_0xe609('0x19')](_0xf31753[_0xe609('0x2a')][_0xe609('0x19')]);}_0x597ff3[_0xe609('0x32')]=qs[_0xe609('0x33')](_0xf31753[_0xe609('0x2a')][_0xe609('0x33')]);_0x597ff3[_0xe609('0x34')]=qs[_0xe609('0x2c')](_[_0xe609('0x35')](_0xf31753['query'],_0x1b9e05[_0xe609('0x2c')]));if(_0xf31753[_0xe609('0x2a')]['filter']){_0x597ff3['where']=_[_0xe609('0x36')](_0x597ff3[_0xe609('0x34')],{'$or':_['map'](_0x262587,function(_0x27fe8a){if(_0x27fe8a[_0xe609('0x37')][_0xe609('0x38')]!=='VIRTUAL'){var _0x253979={};_0x253979[_0x27fe8a['field']]={'$like':'%'+_0xf31753[_0xe609('0x2a')]['filter']+'%'};return _0x253979;}})});}_0x597ff3=_[_0xe609('0x36')]({},_0x597ff3,_0xf31753['options']);var _0x26e6b5={'where':_0x597ff3[_0xe609('0x34')]};return db[_0xe609('0x28')][_0xe609('0x39')](_0x26e6b5)['then'](function(_0x1cc323){_0x447e9f['count']=_0x1cc323;if(_0xf31753[_0xe609('0x2a')][_0xe609('0x3a')]){_0x597ff3[_0xe609('0x3b')]=[{'all':!![]}];}return db[_0xe609('0x28')][_0xe609('0x3c')](_0x597ff3);})[_0xe609('0x21')](function(_0x102182){_0x447e9f[_0xe609('0x3d')]=_0x102182;return _0x447e9f;})[_0xe609('0x21')](respondWithFilteredResult(_0x209338,_0x597ff3))[_0xe609('0x3e')](handleError(_0x209338,null));};exports[_0xe609('0x3f')]=function(_0x4c8486,_0x469d21){var _0x1056fd={'raw':!![],'where':{'id':_0x4c8486[_0xe609('0x40')]['id']}},_0x55e7d5={};_0x55e7d5[_0xe609('0x29')]=_['keys'](db[_0xe609('0x28')]['rawAttributes']);_0x55e7d5[_0xe609('0x2a')]=_[_0xe609('0x2b')](_0x4c8486['query']);_0x55e7d5[_0xe609('0x2c')]=_[_0xe609('0x2e')](_0x55e7d5[_0xe609('0x29')],_0x55e7d5['query']);_0x1056fd[_0xe609('0x2d')]=_[_0xe609('0x2e')](_0x55e7d5[_0xe609('0x29')],qs[_0xe609('0x2f')](_0x4c8486[_0xe609('0x2a')][_0xe609('0x2f')]));_0x1056fd[_0xe609('0x2d')]=_0x1056fd[_0xe609('0x2d')][_0xe609('0x30')]?_0x1056fd[_0xe609('0x2d')]:_0x55e7d5[_0xe609('0x29')];if(_0x4c8486['query'][_0xe609('0x3a')]){_0x1056fd[_0xe609('0x3b')]=[{'all':!![]}];}_0x1056fd=_[_0xe609('0x36')]({},_0x1056fd,_0x4c8486[_0xe609('0x41')]);return db[_0xe609('0x28')][_0xe609('0x42')](_0x1056fd)[_0xe609('0x21')](handleEntityNotFound(_0x469d21,null))['then'](respondWithResult(_0x469d21,null))[_0xe609('0x3e')](handleError(_0x469d21,null));};exports['create']=function(_0x49b1de,_0x8661e2){return db[_0xe609('0x28')][_0xe609('0x43')](_0x49b1de['body'],{})['then'](respondWithResult(_0x8661e2,0xc9))[_0xe609('0x3e')](handleError(_0x8661e2,null));};exports[_0xe609('0x44')]=function(_0x53571e,_0x3bddbd){return db[_0xe609('0x28')][_0xe609('0x44')]()[_0xe609('0x21')](respondWithResult(_0x3bddbd,null))['catch'](handleError(_0x3bddbd,null));};exports[_0xe609('0x20')]=function(_0x3c34df,_0x15ed83){if(_0x3c34df['body']['uniqueid']){delete _0x3c34df[_0xe609('0x45')][_0xe609('0x46')];}return db[_0xe609('0x28')]['find']({'where':{'uniqueid':_0x3c34df['params']['id']}})[_0xe609('0x21')](handleEntityNotFound(_0x15ed83,null))[_0xe609('0x21')](saveUpdates(_0x3c34df[_0xe609('0x45')],null))[_0xe609('0x21')](respondWithResult(_0x15ed83,null))[_0xe609('0x3e')](handleError(_0x15ed83,null));}; \ No newline at end of file +var _0x8229=['moment','bluebird','mustache','util','path','sox','ejs','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','../../mysqldb','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','reject','then','destroy','error','name','send','index','CmHopperHistory','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','merge','map','type','key','VIRTUAL','field','count','includeAll','include','findAll','catch','params','options','body','describe','update','uniqueid','find','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0x74925d,_0x5fcb5e){var _0x517d17=function(_0x51cc38){while(--_0x51cc38){_0x74925d['push'](_0x74925d['shift']());}};_0x517d17(++_0x5fcb5e);}(_0x8229,0x1c4));var _0x9822=function(_0x1829c8,_0x48bd6e){_0x1829c8=_0x1829c8-0x0;var _0x52f92b=_0x8229[_0x1829c8];return _0x52f92b;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x9822('0x0'));var rimraf=require(_0x9822('0x1'));var zipdir=require(_0x9822('0x2'));var jsonpatch=require(_0x9822('0x3'));var rp=require('request-promise');var moment=require(_0x9822('0x4'));var BPromise=require(_0x9822('0x5'));var Mustache=require(_0x9822('0x6'));var util=require(_0x9822('0x7'));var path=require(_0x9822('0x8'));var sox=require(_0x9822('0x9'));var csv=require('to-csv');var ejs=require(_0x9822('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x9822('0xb'));var crypto=require(_0x9822('0xc'));var jsforce=require(_0x9822('0xd'));var deskjs=require(_0x9822('0xe'));var toCsv=require(_0x9822('0xf'));var querystring=require(_0x9822('0x10'));var Papa=require(_0x9822('0x11'));var Redis=require(_0x9822('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x9822('0x13'));var as=require(_0x9822('0x14'));var hardwareService=require(_0x9822('0x15'));var logger=require(_0x9822('0x16'))(_0x9822('0x17'));var utils=require(_0x9822('0x18'));var config=require(_0x9822('0x19'));var db=require(_0x9822('0x1a'))['db'];function respondWithStatusCode(_0x29a6b2,_0x436144){_0x436144=_0x436144||0xcc;return function(_0x12dd5e){if(_0x12dd5e){return _0x29a6b2[_0x9822('0x1b')](_0x436144);}return _0x29a6b2[_0x9822('0x1c')](_0x436144)[_0x9822('0x1d')]();};}function respondWithResult(_0x39bc2e,_0x50c002){_0x50c002=_0x50c002||0xc8;return function(_0x21c010){if(_0x21c010){return _0x39bc2e[_0x9822('0x1c')](_0x50c002)[_0x9822('0x1e')](_0x21c010);}};}function respondWithFilteredResult(_0x2765f5,_0x1b8bff){return function(_0x36e6c3){if(_0x36e6c3){var _0x4c89f0=_0x36e6c3['count'],_0x3dc6d6=_0x1b8bff[_0x9822('0x1f')],_0x7d90cb=_0x1b8bff[_0x9822('0x1f')]+_0x1b8bff[_0x9822('0x20')],_0x138cc4;if(_0x7d90cb>=_0x4c89f0){_0x7d90cb=_0x4c89f0;_0x138cc4=0xc8;}else{_0x138cc4=0xce;}_0x2765f5[_0x9822('0x1c')](_0x138cc4);return _0x2765f5[_0x9822('0x21')](_0x9822('0x22'),_0x3dc6d6+'-'+_0x7d90cb+'/'+_0x4c89f0)[_0x9822('0x1e')](_0x36e6c3);}return null;};}function patchUpdates(_0x44af59){return function(_0x5df110){try{jsonpatch[_0x9822('0x23')](_0x5df110,_0x44af59,!![]);}catch(_0x2d93fe){return BPromise[_0x9822('0x24')](_0x2d93fe);}return _0x5df110['save']();};}function saveUpdates(_0x15cb0e,_0x4f178e){return function(_0x2122c9){if(_0x2122c9){return _0x2122c9['update'](_0x15cb0e)[_0x9822('0x25')](function(_0x39e996){return _0x39e996;});}return null;};}function removeEntity(_0x439306,_0x35a4e5){return function(_0x59a4a9){if(_0x59a4a9){return _0x59a4a9[_0x9822('0x26')]()[_0x9822('0x25')](function(){_0x439306['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x369052,_0x2d31a7){return function(_0x1f2d25){if(!_0x1f2d25){_0x369052['sendStatus'](0x194);}return _0x1f2d25;};}function handleError(_0x8949e7,_0x3fcff5){_0x3fcff5=_0x3fcff5||0x1f4;return function(_0x3a0f3c){logger[_0x9822('0x27')](_0x3a0f3c['stack']);if(_0x3a0f3c[_0x9822('0x28')]){delete _0x3a0f3c['name'];}_0x8949e7[_0x9822('0x1c')](_0x3fcff5)[_0x9822('0x29')](_0x3a0f3c);};}exports[_0x9822('0x2a')]=function(_0x441765,_0x35e0c7){var _0xdc9511={},_0x5c36f1={},_0x23a894={'count':0x0,'rows':[]};var _0x16bcd7=db[_0x9822('0x2b')][_0x9822('0x2c')];_0x5c36f1[_0x9822('0x2d')]=_[_0x9822('0x2e')](_0x16bcd7);_0x5c36f1[_0x9822('0x2f')]=_[_0x9822('0x2e')](_0x441765[_0x9822('0x2f')]);_0x5c36f1[_0x9822('0x30')]=_[_0x9822('0x31')](_0x5c36f1['model'],_0x5c36f1['query']);_0xdc9511[_0x9822('0x32')]=_[_0x9822('0x31')](_0x5c36f1[_0x9822('0x2d')],qs['fields'](_0x441765['query'][_0x9822('0x33')]));_0xdc9511[_0x9822('0x32')]=_0xdc9511[_0x9822('0x32')][_0x9822('0x34')]?_0xdc9511['attributes']:_0x5c36f1[_0x9822('0x2d')];if(!_0x441765[_0x9822('0x2f')][_0x9822('0x35')](_0x9822('0x36'))){_0xdc9511['limit']=qs[_0x9822('0x20')](_0x441765[_0x9822('0x2f')][_0x9822('0x20')]);_0xdc9511[_0x9822('0x1f')]=qs[_0x9822('0x1f')](_0x441765[_0x9822('0x2f')][_0x9822('0x1f')]);}_0xdc9511[_0x9822('0x37')]=qs['sort'](_0x441765[_0x9822('0x2f')]['sort']);_0xdc9511[_0x9822('0x38')]=qs[_0x9822('0x30')](_[_0x9822('0x39')](_0x441765[_0x9822('0x2f')],_0x5c36f1[_0x9822('0x30')]));if(_0x441765[_0x9822('0x2f')]['filter']){_0xdc9511[_0x9822('0x38')]=_[_0x9822('0x3a')](_0xdc9511[_0x9822('0x38')],{'$or':_[_0x9822('0x3b')](_0x16bcd7,function(_0x5eb83a){if(_0x5eb83a[_0x9822('0x3c')][_0x9822('0x3d')]!==_0x9822('0x3e')){var _0x548dfa={};_0x548dfa[_0x5eb83a[_0x9822('0x3f')]]={'$like':'%'+_0x441765[_0x9822('0x2f')]['filter']+'%'};return _0x548dfa;}})});}_0xdc9511=_[_0x9822('0x3a')]({},_0xdc9511,_0x441765['options']);var _0x118881={'where':_0xdc9511[_0x9822('0x38')]};return db['CmHopperHistory'][_0x9822('0x40')](_0x118881)[_0x9822('0x25')](function(_0x3c15e5){_0x23a894[_0x9822('0x40')]=_0x3c15e5;if(_0x441765['query'][_0x9822('0x41')]){_0xdc9511[_0x9822('0x42')]=[{'all':!![]}];}return db[_0x9822('0x2b')][_0x9822('0x43')](_0xdc9511);})[_0x9822('0x25')](function(_0x3c5955){_0x23a894['rows']=_0x3c5955;return _0x23a894;})[_0x9822('0x25')](respondWithFilteredResult(_0x35e0c7,_0xdc9511))[_0x9822('0x44')](handleError(_0x35e0c7,null));};exports['show']=function(_0x5d1233,_0x18cbdf){var _0x371ef0={'raw':!![],'where':{'id':_0x5d1233[_0x9822('0x45')]['id']}},_0x4e2aee={};_0x4e2aee[_0x9822('0x2d')]=_[_0x9822('0x2e')](db['CmHopperHistory'][_0x9822('0x2c')]);_0x4e2aee[_0x9822('0x2f')]=_['keys'](_0x5d1233[_0x9822('0x2f')]);_0x4e2aee[_0x9822('0x30')]=_[_0x9822('0x31')](_0x4e2aee[_0x9822('0x2d')],_0x4e2aee[_0x9822('0x2f')]);_0x371ef0['attributes']=_[_0x9822('0x31')](_0x4e2aee[_0x9822('0x2d')],qs[_0x9822('0x33')](_0x5d1233[_0x9822('0x2f')]['fields']));_0x371ef0[_0x9822('0x32')]=_0x371ef0[_0x9822('0x32')][_0x9822('0x34')]?_0x371ef0[_0x9822('0x32')]:_0x4e2aee[_0x9822('0x2d')];if(_0x5d1233['query']['includeAll']){_0x371ef0[_0x9822('0x42')]=[{'all':!![]}];}_0x371ef0=_['merge']({},_0x371ef0,_0x5d1233[_0x9822('0x46')]);return db[_0x9822('0x2b')]['find'](_0x371ef0)['then'](handleEntityNotFound(_0x18cbdf,null))[_0x9822('0x25')](respondWithResult(_0x18cbdf,null))[_0x9822('0x44')](handleError(_0x18cbdf,null));};exports['create']=function(_0x115549,_0x540801){return db[_0x9822('0x2b')]['create'](_0x115549[_0x9822('0x47')],{})[_0x9822('0x25')](respondWithResult(_0x540801,0xc9))[_0x9822('0x44')](handleError(_0x540801,null));};exports['describe']=function(_0x309f06,_0xcf446c){return db[_0x9822('0x2b')][_0x9822('0x48')]()[_0x9822('0x25')](respondWithResult(_0xcf446c,null))[_0x9822('0x44')](handleError(_0xcf446c,null));};exports[_0x9822('0x49')]=function(_0x3748aa,_0x459c15){if(_0x3748aa[_0x9822('0x47')][_0x9822('0x4a')]){delete _0x3748aa[_0x9822('0x47')]['uniqueid'];}return db[_0x9822('0x2b')][_0x9822('0x4b')]({'where':{'uniqueid':_0x3748aa[_0x9822('0x45')]['id']}})[_0x9822('0x25')](handleEntityNotFound(_0x459c15,null))['then'](saveUpdates(_0x3748aa[_0x9822('0x47')],null))['then'](respondWithResult(_0x459c15,null))[_0x9822('0x44')](handleError(_0x459c15,null));}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.model.js b/server/api/cmHopperHistory/cmHopperHistory.model.js index c19aa26..5c6734d 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 _0xa92e=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','exports','define','CmHopperHistory','cm_hopper_history','endtime','uniqueid','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa92e,0x1cd));var _0xea92=function(_0x16fe0c,_0x1143b5){_0x16fe0c=_0x16fe0c-0x0;var _0x20c315=_0xa92e[_0x16fe0c];return _0x20c315;};'use strict';var _=require('lodash');var util=require(_0xea92('0x0'));var logger=require(_0xea92('0x1'))(_0xea92('0x2'));var moment=require(_0xea92('0x3'));var BPromise=require(_0xea92('0x4'));var rp=require(_0xea92('0x5'));var fs=require('fs');var path=require(_0xea92('0x6'));var rimraf=require(_0xea92('0x7'));var config=require('../../config/environment');var attributes=require('./cmHopperHistory.attributes');module[_0xea92('0x8')]=function(_0x45cb18,_0x28395c){return _0x45cb18[_0xea92('0x9')](_0xea92('0xa'),attributes,{'tableName':_0xea92('0xb'),'paranoid':![],'indexes':[{'name':_0xea92('0xc'),'fields':[_0xea92('0xc')]},{'name':_0xea92('0xd'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x2d1b=['../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./cmHopperHistory.attributes','CmHopperHistory','cm_hopper_history','endtime','uniqueid','lodash','util'];(function(_0x230f2f,_0x4a2380){var _0x140664=function(_0x52efad){while(--_0x52efad){_0x230f2f['push'](_0x230f2f['shift']());}};_0x140664(++_0x4a2380);}(_0x2d1b,0x1ec));var _0xb2d1=function(_0x393308,_0x8c4b55){_0x393308=_0x393308-0x0;var _0x4bc41e=_0x2d1b[_0x393308];return _0x4bc41e;};'use strict';var _=require(_0xb2d1('0x0'));var util=require(_0xb2d1('0x1'));var logger=require(_0xb2d1('0x2'))('api');var moment=require(_0xb2d1('0x3'));var BPromise=require('bluebird');var rp=require(_0xb2d1('0x4'));var fs=require('fs');var path=require(_0xb2d1('0x5'));var rimraf=require(_0xb2d1('0x6'));var config=require(_0xb2d1('0x7'));var attributes=require(_0xb2d1('0x8'));module['exports']=function(_0x2ee0dc,_0x238b7b){return _0x2ee0dc['define'](_0xb2d1('0x9'),attributes,{'tableName':_0xb2d1('0xa'),'paranoid':![],'indexes':[{'name':_0xb2d1('0xb'),'fields':[_0xb2d1('0xb')]},{'name':'uniqueid','fields':[_0xb2d1('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.rpc.js b/server/api/cmHopperHistory/cmHopperHistory.rpc.js index fb7d320..8babc24 100644 --- a/server/api/cmHopperHistory/cmHopperHistory.rpc.js +++ b/server/api/cmHopperHistory/cmHopperHistory.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5eb8=['raw','then','CreateCmHopperHistory','stringify','AvgHandleTime','sequelize','COUNT','col','predictiveIntervalTotalCalls','`state`\x20=\x204,\x201,\x20null','literal','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsTimeout','AVG','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','`state`\x20=\x204,\x20`talktime`,\x20null','GetVoiceQueueHopperHistory','findAll','campaign','`state`\x20=\x200,\x201,\x20null','outboundNoAnswerCallsDay','outboundAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','`state`\x20=\x2011\x20,\x201,\x20null','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','GetCampaignHopperHistory','where','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','CmHopperHistory,\x20%s,\x20%s','request\x20sent','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','error','message','catch','CmHopperHistory','create','body','options'];(function(_0x4d6ac0,_0x201628){var _0x5296c4=function(_0x3d0b3d){while(--_0x3d0b3d){_0x4d6ac0['push'](_0x4d6ac0['shift']());}};_0x5296c4(++_0x201628);}(_0x5eb8,0xb0));var _0x85eb=function(_0x4d515d,_0x108c96){_0x4d515d=_0x4d515d-0x0;var _0x58fe07=_0x5eb8[_0x4d515d];return _0x58fe07;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x85eb('0x0'));var BPromise=require(_0x85eb('0x1'));var rs=require(_0x85eb('0x2'));var fs=require('fs');var Redis=require(_0x85eb('0x3'));var db=require(_0x85eb('0x4'))['db'];var utils=require(_0x85eb('0x5'));var logger=require(_0x85eb('0x6'))(_0x85eb('0x7'));var config=require(_0x85eb('0x8'));var jayson=require(_0x85eb('0x9'));var client=jayson[_0x85eb('0xa')][_0x85eb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4a8814,_0x16d7b9,_0x3af658){return new BPromise(function(_0x448345,_0x5cd4ec){return client[_0x85eb('0xc')](_0x4a8814,_0x3af658)['then'](function(_0x1f0036){logger[_0x85eb('0xd')](_0x85eb('0xe'),_0x16d7b9,_0x85eb('0xf'));logger[_0x85eb('0x10')](_0x85eb('0x11'),_0x16d7b9,_0x85eb('0xf'),JSON['stringify'](_0x1f0036));if(_0x1f0036[_0x85eb('0x12')]){if(_0x1f0036[_0x85eb('0x12')]['code']===0x1f4){logger[_0x85eb('0x12')](_0x85eb('0xe'),_0x16d7b9,_0x1f0036[_0x85eb('0x12')][_0x85eb('0x13')]);return _0x5cd4ec(_0x1f0036['error']['message']);}logger[_0x85eb('0x12')]('CmHopperHistory,\x20%s,\x20%s',_0x16d7b9,_0x1f0036[_0x85eb('0x12')][_0x85eb('0x13')]);return _0x448345(_0x1f0036[_0x85eb('0x12')][_0x85eb('0x13')]);}else{logger[_0x85eb('0xd')]('CmHopperHistory,\x20%s,\x20%s',_0x16d7b9,_0x85eb('0xf'));_0x448345(_0x1f0036['result'][_0x85eb('0x13')]);}})[_0x85eb('0x14')](function(_0x3e23e8){logger[_0x85eb('0x12')]('CmHopperHistory,\x20%s,\x20%s',_0x16d7b9,_0x3e23e8);_0x5cd4ec(_0x3e23e8);});});}exports['CreateCmHopperHistory']=function(_0x50d2a8){var _0xe198ca=this;return new Promise(function(_0x39ca96,_0x10cf2f){return db[_0x85eb('0x15')][_0x85eb('0x16')](_0x50d2a8[_0x85eb('0x17')],{'raw':_0x50d2a8['options']?_0x50d2a8[_0x85eb('0x18')][_0x85eb('0x19')]===undefined?!![]:![]:!![]})[_0x85eb('0x1a')](function(_0x4e8041){logger['info']('CreateCmHopperHistory',_0x50d2a8);logger['debug'](_0x85eb('0x1b'),_0x50d2a8,JSON[_0x85eb('0x1c')](_0x4e8041));_0x39ca96(_0x4e8041);})[_0x85eb('0x14')](function(_0x255ca7){logger[_0x85eb('0x12')](_0x85eb('0x1b'),_0x255ca7['message'],_0x50d2a8);_0x10cf2f(_0xe198ca['error'](0x1f4,_0x255ca7['message']));});});};exports[_0x85eb('0x1d')]=function(_0x1426c8){var _0x3f7a4d=this;return new Promise(function(_0x28b87d,_0x312b3e){return db[_0x85eb('0x15')]['findAll']({'raw':_0x1426c8[_0x85eb('0x18')]?_0x1426c8[_0x85eb('0x18')][_0x85eb('0x19')]===undefined?!![]:![]:!![],'where':_0x1426c8[_0x85eb('0x18')]?_0x1426c8[_0x85eb('0x18')]['where']||null:null,'attributes':[[db[_0x85eb('0x1e')]['fn'](_0x85eb('0x1f'),db[_0x85eb('0x1e')][_0x85eb('0x20')]('id')),_0x85eb('0x21')],[db[_0x85eb('0x1e')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x85eb('0x1e')]['literal'](_0x85eb('0x22')))),'predictiveIntervalAnsweredCalls'],[db[_0x85eb('0x1e')]['fn'](_0x85eb('0x1f'),db[_0x85eb('0x1e')]['fn']('IF',db[_0x85eb('0x1e')][_0x85eb('0x23')](_0x85eb('0x24')))),_0x85eb('0x25')],[db['sequelize']['fn'](_0x85eb('0x1f'),db[_0x85eb('0x1e')]['fn']('IF',db['sequelize'][_0x85eb('0x23')]('`state`\x20=\x2011,\x201,\x20null'))),'predictiveIntervalDroppedCallsCallersExit'],[db[_0x85eb('0x1e')]['fn'](_0x85eb('0x26'),db[_0x85eb('0x1e')]['fn']('IF',db[_0x85eb('0x1e')][_0x85eb('0x23')](_0x85eb('0x27')))),_0x85eb('0x28')],[db[_0x85eb('0x1e')]['fn'](_0x85eb('0x26'),db[_0x85eb('0x1e')]['fn']('IF',db['sequelize'][_0x85eb('0x23')](_0x85eb('0x29')))),'predictiveIntervalAvgTalktime']]})['then'](function(_0x340745){logger[_0x85eb('0xd')](_0x85eb('0x1d'),_0x1426c8);logger[_0x85eb('0x10')](_0x85eb('0x1d'),_0x1426c8,JSON[_0x85eb('0x1c')](_0x340745));_0x28b87d(_0x340745);})[_0x85eb('0x14')](function(_0x35f092){logger[_0x85eb('0x12')](_0x85eb('0x1d'),_0x35f092[_0x85eb('0x13')],_0x1426c8);_0x312b3e(_0x3f7a4d[_0x85eb('0x12')](0x1f4,_0x35f092[_0x85eb('0x13')]));});});};exports[_0x85eb('0x2a')]=function(_0x4b69a7){var _0x4361e2=this;return new Promise(function(_0x3dfe74,_0x58f091){return db['CmHopperHistory'][_0x85eb('0x2b')]({'raw':_0x4b69a7[_0x85eb('0x18')]?_0x4b69a7['options'][_0x85eb('0x19')]===undefined?!![]:![]:!![],'where':_0x4b69a7['options']?_0x4b69a7[_0x85eb('0x18')]['where']||null:null,'attributes':[[_0x85eb('0x2c'),'name'],[db[_0x85eb('0x1e')]['fn']('COUNT',db[_0x85eb('0x1e')]['fn']('IF',db[_0x85eb('0x1e')]['literal'](_0x85eb('0x2d')))),'outboundNoSuchCallsDay'],[db[_0x85eb('0x1e')]['fn'](_0x85eb('0x1f'),db['sequelize']['fn']('IF',db[_0x85eb('0x1e')]['literal']('`state`\x20=\x203,\x201,\x20null'))),_0x85eb('0x2e')],[db['sequelize']['fn'](_0x85eb('0x1f'),db[_0x85eb('0x1e')]['fn']('IF',db['sequelize']['literal'](_0x85eb('0x22')))),_0x85eb('0x2f')],[db['sequelize']['fn']('COUNT',db[_0x85eb('0x1e')]['fn']('IF',db[_0x85eb('0x1e')][_0x85eb('0x23')](_0x85eb('0x30')))),_0x85eb('0x31')],[db['sequelize']['fn'](_0x85eb('0x1f'),db[_0x85eb('0x1e')]['fn']('IF',db[_0x85eb('0x1e')][_0x85eb('0x23')](_0x85eb('0x32')))),_0x85eb('0x33')],[db[_0x85eb('0x1e')]['fn'](_0x85eb('0x1f'),db[_0x85eb('0x1e')]['fn']('IF',db['sequelize'][_0x85eb('0x23')](_0x85eb('0x34')))),'outboundDropCallsDayTimeout'],[db[_0x85eb('0x1e')]['fn'](_0x85eb('0x1f'),db[_0x85eb('0x1e')]['fn']('IF',db[_0x85eb('0x1e')][_0x85eb('0x23')](_0x85eb('0x35')))),'outboundDropCallsDayCallersExit'],[db[_0x85eb('0x1e')]['fn'](_0x85eb('0x1f'),db[_0x85eb('0x1e')]['fn']('IF',db[_0x85eb('0x1e')][_0x85eb('0x23')](_0x85eb('0x36')))),_0x85eb('0x37')],[db[_0x85eb('0x1e')]['fn']('COUNT',db[_0x85eb('0x1e')]['fn']('IF',db[_0x85eb('0x1e')][_0x85eb('0x23')](_0x85eb('0x38')))),_0x85eb('0x39')],[db[_0x85eb('0x1e')]['fn'](_0x85eb('0x1f'),db[_0x85eb('0x1e')]['fn']('IF',db[_0x85eb('0x1e')][_0x85eb('0x23')](_0x85eb('0x3a')))),_0x85eb('0x3b')],[db['sequelize']['fn'](_0x85eb('0x1f'),db[_0x85eb('0x1e')]['fn']('IF',db[_0x85eb('0x1e')]['literal'](_0x85eb('0x3c')))),_0x85eb('0x3d')],[db[_0x85eb('0x1e')]['fn'](_0x85eb('0x1f'),db[_0x85eb('0x1e')]['fn']('IF',db['sequelize'][_0x85eb('0x23')](_0x85eb('0x3e')))),_0x85eb('0x3f')],[db['sequelize']['fn'](_0x85eb('0x1f'),db[_0x85eb('0x1e')]['fn']('IF',db[_0x85eb('0x1e')]['literal']('`state`\x20=\x2020,\x201,\x20null'))),_0x85eb('0x3d')],[db['sequelize']['fn']('COUNT',db[_0x85eb('0x1e')]['fn']('IF',db['sequelize'][_0x85eb('0x23')](_0x85eb('0x40')))),'outboundReCallsDay']],'group':['campaign']})[_0x85eb('0x1a')](function(_0x249511){logger[_0x85eb('0xd')](_0x85eb('0x2a'),_0x4b69a7);logger[_0x85eb('0x10')]('GetVoiceQueueHopperHistory',_0x4b69a7,JSON[_0x85eb('0x1c')](_0x249511));_0x3dfe74(_0x249511);})[_0x85eb('0x14')](function(_0x270bb2){logger[_0x85eb('0x12')](_0x85eb('0x2a'),_0x270bb2['message'],_0x4b69a7);_0x58f091(_0x4361e2[_0x85eb('0x12')](0x1f4,_0x270bb2['message']));});});};exports[_0x85eb('0x41')]=function(_0x40d846){var _0x4ee529=this;return new Promise(function(_0x341ddb,_0xd04f24){return db[_0x85eb('0x15')][_0x85eb('0x2b')]({'raw':_0x40d846[_0x85eb('0x18')]?_0x40d846[_0x85eb('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x40d846[_0x85eb('0x18')]?_0x40d846['options'][_0x85eb('0x42')]||null:null,'attributes':[[_0x85eb('0x2c'),'name'],[db[_0x85eb('0x1e')]['fn'](_0x85eb('0x1f'),db['sequelize'][_0x85eb('0x20')]('id')),'ivrTotalCallsDays'],[db[_0x85eb('0x1e')]['fn'](_0x85eb('0x1f'),db[_0x85eb('0x1e')]['fn']('IF',db[_0x85eb('0x1e')][_0x85eb('0x23')](_0x85eb('0x22')))),'ivrAnswerCallsDay']],'group':[_0x85eb('0x2c')]})[_0x85eb('0x1a')](function(_0x1d3204){logger[_0x85eb('0xd')](_0x85eb('0x41'),_0x40d846);logger[_0x85eb('0x10')](_0x85eb('0x41'),_0x40d846,JSON[_0x85eb('0x1c')](_0x1d3204));_0x341ddb(_0x1d3204);})[_0x85eb('0x14')](function(_0x13cc2a){logger[_0x85eb('0x12')]('GetCampaignHopperHistory',_0x13cc2a[_0x85eb('0x13')],_0x40d846);_0xd04f24(_0x4ee529[_0x85eb('0x12')](0x1f4,_0x13cc2a[_0x85eb('0x13')]));});});}; \ No newline at end of file +var _0x13f6=['lodash','util','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','CmHopperHistory,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','CreateCmHopperHistory','CmHopperHistory','create','body','raw','catch','AvgHandleTime','findAll','options','sequelize','predictiveIntervalTotalCalls','COUNT','literal','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsTimeout','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','AVG','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','GetVoiceQueueHopperHistory','campaign','name','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','`state`\x20=\x203,\x201,\x20null','outboundNoAnswerCallsDay','`state`\x20=\x204,\x201,\x20null','outboundAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','outboundDropCallsDayTimeout','`state`\x20=\x2011\x20,\x201,\x20null','outboundDropCallsDayCallersExit','`state`\x20=\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','where','col','ivrTotalCallsDays','ivrAnswerCallsDay'];(function(_0x349385,_0xd4c423){var _0x74001a=function(_0x5aca12){while(--_0x5aca12){_0x349385['push'](_0x349385['shift']());}};_0x74001a(++_0xd4c423);}(_0x13f6,0x124));var _0x613f=function(_0x4305db,_0x2812a2){_0x4305db=_0x4305db-0x0;var _0x432b2d=_0x13f6[_0x4305db];return _0x432b2d;};'use strict';var _=require(_0x613f('0x0'));var util=require(_0x613f('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x613f('0x2'));var fs=require('fs');var Redis=require(_0x613f('0x3'));var db=require(_0x613f('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x613f('0x5'))(_0x613f('0x6'));var config=require(_0x613f('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x613f('0x8')][_0x613f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5618fa,_0x4b546b,_0x5a84f2){return new BPromise(function(_0x5c93c0,_0x2d5973){return client[_0x613f('0xa')](_0x5618fa,_0x5a84f2)[_0x613f('0xb')](function(_0x35b672){logger['info'](_0x613f('0xc'),_0x4b546b,_0x613f('0xd'));logger[_0x613f('0xe')]('CmHopperHistory,\x20%s,\x20%s,\x20%s',_0x4b546b,_0x613f('0xd'),JSON[_0x613f('0xf')](_0x35b672));if(_0x35b672[_0x613f('0x10')]){if(_0x35b672['error'][_0x613f('0x11')]===0x1f4){logger[_0x613f('0x10')]('CmHopperHistory,\x20%s,\x20%s',_0x4b546b,_0x35b672['error']['message']);return _0x2d5973(_0x35b672[_0x613f('0x10')][_0x613f('0x12')]);}logger[_0x613f('0x10')](_0x613f('0xc'),_0x4b546b,_0x35b672[_0x613f('0x10')][_0x613f('0x12')]);return _0x5c93c0(_0x35b672[_0x613f('0x10')][_0x613f('0x12')]);}else{logger[_0x613f('0x13')](_0x613f('0xc'),_0x4b546b,'request\x20sent');_0x5c93c0(_0x35b672[_0x613f('0x14')]['message']);}})['catch'](function(_0x1bc605){logger[_0x613f('0x10')]('CmHopperHistory,\x20%s,\x20%s',_0x4b546b,_0x1bc605);_0x2d5973(_0x1bc605);});});}exports[_0x613f('0x15')]=function(_0x4f9dae){var _0x62ebfe=this;return new Promise(function(_0x1e5a11,_0x431266){return db[_0x613f('0x16')][_0x613f('0x17')](_0x4f9dae[_0x613f('0x18')],{'raw':_0x4f9dae['options']?_0x4f9dae['options'][_0x613f('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x48493c){logger[_0x613f('0x13')](_0x613f('0x15'),_0x4f9dae);logger['debug'](_0x613f('0x15'),_0x4f9dae,JSON[_0x613f('0xf')](_0x48493c));_0x1e5a11(_0x48493c);})[_0x613f('0x1a')](function(_0x48b28a){logger['error'](_0x613f('0x15'),_0x48b28a[_0x613f('0x12')],_0x4f9dae);_0x431266(_0x62ebfe[_0x613f('0x10')](0x1f4,_0x48b28a['message']));});});};exports[_0x613f('0x1b')]=function(_0x33e0c6){var _0x30de90=this;return new Promise(function(_0x1ee050,_0x3013a1){return db['CmHopperHistory'][_0x613f('0x1c')]({'raw':_0x33e0c6[_0x613f('0x1d')]?_0x33e0c6['options'][_0x613f('0x19')]===undefined?!![]:![]:!![],'where':_0x33e0c6[_0x613f('0x1d')]?_0x33e0c6[_0x613f('0x1d')]['where']||null:null,'attributes':[[db['sequelize']['fn']('COUNT',db[_0x613f('0x1e')]['col']('id')),_0x613f('0x1f')],[db[_0x613f('0x1e')]['fn']('COUNT',db[_0x613f('0x1e')]['fn']('IF',db[_0x613f('0x1e')]['literal']('`state`\x20=\x204,\x201,\x20null'))),'predictiveIntervalAnsweredCalls'],[db[_0x613f('0x1e')]['fn'](_0x613f('0x20'),db[_0x613f('0x1e')]['fn']('IF',db['sequelize'][_0x613f('0x21')](_0x613f('0x22')))),_0x613f('0x23')],[db[_0x613f('0x1e')]['fn']('COUNT',db[_0x613f('0x1e')]['fn']('IF',db[_0x613f('0x1e')][_0x613f('0x21')](_0x613f('0x24')))),_0x613f('0x25')],[db[_0x613f('0x1e')]['fn']('AVG',db[_0x613f('0x1e')]['fn']('IF',db[_0x613f('0x1e')][_0x613f('0x21')]('`state`\x20=\x204,\x20`holdtime`,\x20null'))),_0x613f('0x26')],[db['sequelize']['fn'](_0x613f('0x27'),db[_0x613f('0x1e')]['fn']('IF',db[_0x613f('0x1e')][_0x613f('0x21')](_0x613f('0x28')))),_0x613f('0x29')]]})['then'](function(_0x1a18ce){logger[_0x613f('0x13')](_0x613f('0x1b'),_0x33e0c6);logger[_0x613f('0xe')](_0x613f('0x1b'),_0x33e0c6,JSON['stringify'](_0x1a18ce));_0x1ee050(_0x1a18ce);})['catch'](function(_0x4eea2c){logger[_0x613f('0x10')](_0x613f('0x1b'),_0x4eea2c[_0x613f('0x12')],_0x33e0c6);_0x3013a1(_0x30de90[_0x613f('0x10')](0x1f4,_0x4eea2c['message']));});});};exports[_0x613f('0x2a')]=function(_0xaedbbd){var _0x4ed25f=this;return new Promise(function(_0x45e6df,_0x550cea){return db[_0x613f('0x16')]['findAll']({'raw':_0xaedbbd[_0x613f('0x1d')]?_0xaedbbd['options'][_0x613f('0x19')]===undefined?!![]:![]:!![],'where':_0xaedbbd[_0x613f('0x1d')]?_0xaedbbd[_0x613f('0x1d')]['where']||null:null,'attributes':[[_0x613f('0x2b'),_0x613f('0x2c')],[db[_0x613f('0x1e')]['fn'](_0x613f('0x20'),db[_0x613f('0x1e')]['fn']('IF',db[_0x613f('0x1e')][_0x613f('0x21')](_0x613f('0x2d')))),_0x613f('0x2e')],[db[_0x613f('0x1e')]['fn']('COUNT',db[_0x613f('0x1e')]['fn']('IF',db[_0x613f('0x1e')][_0x613f('0x21')](_0x613f('0x2f')))),_0x613f('0x30')],[db[_0x613f('0x1e')]['fn'](_0x613f('0x20'),db['sequelize']['fn']('IF',db[_0x613f('0x1e')][_0x613f('0x21')](_0x613f('0x31')))),_0x613f('0x32')],[db[_0x613f('0x1e')]['fn'](_0x613f('0x20'),db[_0x613f('0x1e')]['fn']('IF',db['sequelize'][_0x613f('0x21')](_0x613f('0x33')))),_0x613f('0x34')],[db[_0x613f('0x1e')]['fn'](_0x613f('0x20'),db[_0x613f('0x1e')]['fn']('IF',db[_0x613f('0x1e')][_0x613f('0x21')](_0x613f('0x35')))),_0x613f('0x36')],[db[_0x613f('0x1e')]['fn'](_0x613f('0x20'),db[_0x613f('0x1e')]['fn']('IF',db['sequelize'][_0x613f('0x21')](_0x613f('0x37')))),_0x613f('0x38')],[db[_0x613f('0x1e')]['fn']('COUNT',db[_0x613f('0x1e')]['fn']('IF',db[_0x613f('0x1e')][_0x613f('0x21')](_0x613f('0x39')))),_0x613f('0x3a')],[db[_0x613f('0x1e')]['fn'](_0x613f('0x20'),db[_0x613f('0x1e')]['fn']('IF',db[_0x613f('0x1e')][_0x613f('0x21')]('`state`\x20=\x2012,\x201,\x20null'))),'outboundUnknownCallsDay'],[db[_0x613f('0x1e')]['fn'](_0x613f('0x20'),db['sequelize']['fn']('IF',db[_0x613f('0x1e')][_0x613f('0x21')](_0x613f('0x3b')))),_0x613f('0x3c')],[db[_0x613f('0x1e')]['fn'](_0x613f('0x20'),db[_0x613f('0x1e')]['fn']('IF',db[_0x613f('0x1e')][_0x613f('0x21')](_0x613f('0x3d')))),_0x613f('0x3e')],[db[_0x613f('0x1e')]['fn'](_0x613f('0x20'),db[_0x613f('0x1e')]['fn']('IF',db[_0x613f('0x1e')][_0x613f('0x21')](_0x613f('0x3f')))),_0x613f('0x40')],[db['sequelize']['fn']('COUNT',db[_0x613f('0x1e')]['fn']('IF',db[_0x613f('0x1e')]['literal']('`state`\x20=\x2016,\x201,\x20null'))),_0x613f('0x41')],[db['sequelize']['fn']('COUNT',db[_0x613f('0x1e')]['fn']('IF',db[_0x613f('0x1e')][_0x613f('0x21')]('`state`\x20=\x2020,\x201,\x20null'))),_0x613f('0x40')],[db[_0x613f('0x1e')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x613f('0x1e')][_0x613f('0x21')](_0x613f('0x42')))),_0x613f('0x43')]],'group':[_0x613f('0x2b')]})[_0x613f('0xb')](function(_0x24d162){logger['info']('GetVoiceQueueHopperHistory',_0xaedbbd);logger[_0x613f('0xe')]('GetVoiceQueueHopperHistory',_0xaedbbd,JSON['stringify'](_0x24d162));_0x45e6df(_0x24d162);})[_0x613f('0x1a')](function(_0x52c2a6){logger[_0x613f('0x10')]('GetVoiceQueueHopperHistory',_0x52c2a6[_0x613f('0x12')],_0xaedbbd);_0x550cea(_0x4ed25f[_0x613f('0x10')](0x1f4,_0x52c2a6[_0x613f('0x12')]));});});};exports[_0x613f('0x44')]=function(_0x11e4a4){var _0x2cb4a1=this;return new Promise(function(_0x346e2c,_0x4a49a1){return db[_0x613f('0x16')]['findAll']({'raw':_0x11e4a4[_0x613f('0x1d')]?_0x11e4a4[_0x613f('0x1d')][_0x613f('0x19')]===undefined?!![]:![]:!![],'where':_0x11e4a4[_0x613f('0x1d')]?_0x11e4a4[_0x613f('0x1d')][_0x613f('0x45')]||null:null,'attributes':[[_0x613f('0x2b'),_0x613f('0x2c')],[db[_0x613f('0x1e')]['fn'](_0x613f('0x20'),db[_0x613f('0x1e')][_0x613f('0x46')]('id')),_0x613f('0x47')],[db['sequelize']['fn']('COUNT',db[_0x613f('0x1e')]['fn']('IF',db['sequelize'][_0x613f('0x21')](_0x613f('0x31')))),_0x613f('0x48')]],'group':[_0x613f('0x2b')]})[_0x613f('0xb')](function(_0x46a945){logger[_0x613f('0x13')](_0x613f('0x44'),_0x11e4a4);logger[_0x613f('0xe')](_0x613f('0x44'),_0x11e4a4,JSON[_0x613f('0xf')](_0x46a945));_0x346e2c(_0x46a945);})['catch'](function(_0xbc2c8f){logger[_0x613f('0x10')](_0x613f('0x44'),_0xbc2c8f[_0x613f('0x12')],_0x11e4a4);_0x4a49a1(_0x2cb4a1['error'](0x1f4,_0xbc2c8f[_0x613f('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/index.js b/server/api/cmHopperHistory/index.js index cdcc7b0..be41bd4 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 _0x2c12=['express','Router','../../components/interaction/service','../../config/environment','isAuthenticated','index','/describe','get','/:id','show','create','update','util','path','connect-timeout'];(function(_0x444d59,_0x2fbf92){var _0x452419=function(_0x323566){while(--_0x323566){_0x444d59['push'](_0x444d59['shift']());}};_0x452419(++_0x2fbf92);}(_0x2c12,0x138));var _0x22c1=function(_0x1e1965,_0x55785c){_0x1e1965=_0x1e1965-0x0;var _0x1a2e96=_0x2c12[_0x1e1965];return _0x1a2e96;};'use strict';var multer=require('multer');var util=require(_0x22c1('0x0'));var path=require(_0x22c1('0x1'));var timeout=require(_0x22c1('0x2'));var express=require(_0x22c1('0x3'));var router=express[_0x22c1('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x22c1('0x5'));var config=require(_0x22c1('0x6'));var controller=require('./cmHopperHistory.controller');router['get']('/',auth[_0x22c1('0x7')](),controller[_0x22c1('0x8')]);router['get'](_0x22c1('0x9'),auth[_0x22c1('0x7')](),controller['describe']);router[_0x22c1('0xa')](_0x22c1('0xb'),auth['isAuthenticated'](),controller[_0x22c1('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0x22c1('0xd')]);router['put'](_0x22c1('0xb'),auth['isAuthenticated'](),controller[_0x22c1('0xe')]);module['exports']=router; \ No newline at end of file +var _0x3ae3=['../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperHistory.controller','isAuthenticated','/describe','describe','get','/:id','show','post','create','put','update','multer','path','connect-timeout','express','Router'];(function(_0x50007c,_0x1cbf11){var _0x5c1ec7=function(_0x52d038){while(--_0x52d038){_0x50007c['push'](_0x50007c['shift']());}};_0x5c1ec7(++_0x1cbf11);}(_0x3ae3,0x13e));var _0x33ae=function(_0x3c9fd4,_0x5c8ca6){_0x3c9fd4=_0x3c9fd4-0x0;var _0x2e9729=_0x3ae3[_0x3c9fd4];return _0x2e9729;};'use strict';var multer=require(_0x33ae('0x0'));var util=require('util');var path=require(_0x33ae('0x1'));var timeout=require(_0x33ae('0x2'));var express=require(_0x33ae('0x3'));var router=express[_0x33ae('0x4')]();var auth=require(_0x33ae('0x5'));var interaction=require(_0x33ae('0x6'));var config=require(_0x33ae('0x7'));var controller=require(_0x33ae('0x8'));router['get']('/',auth[_0x33ae('0x9')](),controller['index']);router['get'](_0x33ae('0xa'),auth[_0x33ae('0x9')](),controller[_0x33ae('0xb')]);router[_0x33ae('0xc')](_0x33ae('0xd'),auth[_0x33ae('0x9')](),controller[_0x33ae('0xe')]);router[_0x33ae('0xf')]('/',auth[_0x33ae('0x9')](),controller[_0x33ae('0x10')]);router[_0x33ae('0x11')]('/:id',auth[_0x33ae('0x9')](),controller[_0x33ae('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmList/cmList.attributes.js b/server/api/cmList/cmList.attributes.js index ba94f45..776da38 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 _0xa15d=['STRING','name','sequelize'];(function(_0xac151d,_0x4ea1d2){var _0x111dba=function(_0x13d7f4){while(--_0x13d7f4){_0xac151d['push'](_0xac151d['shift']());}};_0x111dba(++_0x4ea1d2);}(_0xa15d,0x13d));var _0xda15=function(_0x2db12b,_0x30ab1d){_0x2db12b=_0x2db12b-0x0;var _0x20990b=_0xa15d[_0x2db12b];return _0x20990b;};'use strict';var Sequelize=require(_0xda15('0x0'));module['exports']={'name':{'type':Sequelize[_0xda15('0x1')],'unique':_0xda15('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xda15('0x1')]},'dialPrefix':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x84b1=['STRING','name','sequelize'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x84b1,0x1a6));var _0x184b=function(_0x11bba6,_0x7bb9d7){_0x11bba6=_0x11bba6-0x0;var _0x2adff4=_0x84b1[_0x11bba6];return _0x2adff4;};'use strict';var Sequelize=require(_0x184b('0x0'));module['exports']={'name':{'type':Sequelize[_0x184b('0x1')],'unique':_0x184b('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x184b('0x1')]},'dialPrefix':{'type':Sequelize[_0x184b('0x1')]}}; \ No newline at end of file diff --git a/server/api/cmList/cmList.controller.js b/server/api/cmList/cmList.controller.js index 8c3882a..05327a9 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 _0x5fab=['index','CmList','rawAttributes','model','keys','query','intersection','fields','length','attributes','hasOwnProperty','nolimit','sort','where','map','type','key','VIRTUAL','filter','options','includeAll','include','findAll','catch','show','params','filters','merge','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','ListId','getDispositions','findOne','Disposition','order','pick','rows','removeDispositions','addContacts','CmContact','tags','isArray','omit','success','errors','push','message','Malformed\x20request\x20syntax','CustomFields','concat','format','cf_%d','raw','now','/tmp/list_%d_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','list_%d_%s.csv','Content-type','text/csv','download','sequelize','transaction','CmCustomField','addCustomFields','Sequelize','TEXT','text','number','INTEGER','BOOLEAN','defaultValue','queryInterface','addColumn','cm_contacts','findAndCountAll','addAgents','ids','spread','emit','userCmList:save','removeAgents','userCmList:remove','getAgents','User','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','squel','crypto','jsforce','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','register','sendStatus','status','count','offset','limit','set','json','reject','then','get','Lists','UserProfileResource','destroy','error','stack','name','send'];(function(_0x1b8d87,_0x4168fb){var _0x182b74=function(_0x12b570){while(--_0x12b570){_0x1b8d87['push'](_0x1b8d87['shift']());}};_0x182b74(++_0x4168fb);}(_0x5fab,0x177));var _0xb5fa=function(_0x303862,_0x20b5ab){_0x303862=_0x303862-0x0;var _0xe6f228=_0x5fab[_0x303862];return _0xe6f228;};'use strict';var pdf=require(_0xb5fa('0x0'));var emlformat=require(_0xb5fa('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xb5fa('0x2'));var jsonpatch=require(_0xb5fa('0x3'));var rp=require(_0xb5fa('0x4'));var moment=require(_0xb5fa('0x5'));var BPromise=require(_0xb5fa('0x6'));var Mustache=require(_0xb5fa('0x7'));var util=require(_0xb5fa('0x8'));var path=require(_0xb5fa('0x9'));var sox=require(_0xb5fa('0xa'));var csv=require(_0xb5fa('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0xb5fa('0xc'));var crypto=require(_0xb5fa('0xd'));var jsforce=require(_0xb5fa('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xb5fa('0xb'));var querystring=require(_0xb5fa('0xf'));var Papa=require(_0xb5fa('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xb5fa('0x11'));var as=require(_0xb5fa('0x12'));var hardwareService=require(_0xb5fa('0x13'));var logger=require(_0xb5fa('0x14'))(_0xb5fa('0x15'));var utils=require(_0xb5fa('0x16'));var config=require(_0xb5fa('0x17'));var db=require(_0xb5fa('0x18'))['db'];config[_0xb5fa('0x19')]=_['defaults'](config[_0xb5fa('0x19')],{'host':_0xb5fa('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb5fa('0x19')]));require('./cmList.socket')[_0xb5fa('0x1b')](socket);function respondWithStatusCode(_0x3fc372,_0x40c914){_0x40c914=_0x40c914||0xcc;return function(_0xca8d82){if(_0xca8d82){return _0x3fc372[_0xb5fa('0x1c')](_0x40c914);}return _0x3fc372['status'](_0x40c914)['end']();};}function respondWithResult(_0x38e964,_0x587043){_0x587043=_0x587043||0xc8;return function(_0x31f252){if(_0x31f252){return _0x38e964[_0xb5fa('0x1d')](_0x587043)['json'](_0x31f252);}};}function respondWithFilteredResult(_0x4fabcc,_0x451a55){return function(_0x1f7f05){if(_0x1f7f05){var _0x32e9e5=_0x1f7f05[_0xb5fa('0x1e')],_0x46eef0=_0x451a55[_0xb5fa('0x1f')],_0x324ba5=_0x451a55[_0xb5fa('0x1f')]+_0x451a55[_0xb5fa('0x20')],_0x13e82b;if(_0x324ba5>=_0x32e9e5){_0x324ba5=_0x32e9e5;_0x13e82b=0xc8;}else{_0x13e82b=0xce;}_0x4fabcc[_0xb5fa('0x1d')](_0x13e82b);return _0x4fabcc[_0xb5fa('0x21')]('Content-Range',_0x46eef0+'-'+_0x324ba5+'/'+_0x32e9e5)[_0xb5fa('0x22')](_0x1f7f05);}return null;};}function patchUpdates(_0x519e20){return function(_0x37ae06){try{jsonpatch['apply'](_0x37ae06,_0x519e20,!![]);}catch(_0xd0fe2b){return BPromise[_0xb5fa('0x23')](_0xd0fe2b);}return _0x37ae06['save']();};}function saveUpdates(_0x40dfdf,_0x3a2ab9){return function(_0x283a56){if(_0x283a56){return _0x283a56['update'](_0x40dfdf)[_0xb5fa('0x24')](function(_0xec108f){return _0xec108f;});}return null;};}function removeEntity(_0x444237,_0x542348){return function(_0x224ec8){if(_0x224ec8){return _0x224ec8['destroy']()[_0xb5fa('0x24')](function(){var _0x264591=_0x224ec8[_0xb5fa('0x25')]({'plain':!![]});var _0x543edf=_0xb5fa('0x26');return db[_0xb5fa('0x27')][_0xb5fa('0x28')]({'where':{'type':_0x543edf,'resourceId':_0x264591['id']}})[_0xb5fa('0x24')](function(){return _0x224ec8;});})['then'](function(){_0x444237['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5a1c39,_0x28a350){return function(_0x460b54){if(!_0x460b54){_0x5a1c39[_0xb5fa('0x1c')](0x194);}return _0x460b54;};}function handleError(_0x2bdf50,_0x534884){_0x534884=_0x534884||0x1f4;return function(_0x3506a4){logger[_0xb5fa('0x29')](_0x3506a4[_0xb5fa('0x2a')]);if(_0x3506a4[_0xb5fa('0x2b')]){delete _0x3506a4[_0xb5fa('0x2b')];}_0x2bdf50[_0xb5fa('0x1d')](_0x534884)[_0xb5fa('0x2c')](_0x3506a4);};}exports[_0xb5fa('0x2d')]=function(_0x1f4380,_0xed02e){var _0x116773={},_0x5a0152={},_0x3fd1fb={'count':0x0,'rows':[]};var _0x21fc7e=db[_0xb5fa('0x2e')][_0xb5fa('0x2f')];_0x5a0152[_0xb5fa('0x30')]=_[_0xb5fa('0x31')](_0x21fc7e);_0x5a0152[_0xb5fa('0x32')]=_['keys'](_0x1f4380[_0xb5fa('0x32')]);_0x5a0152['filters']=_['intersection'](_0x5a0152['model'],_0x5a0152[_0xb5fa('0x32')]);_0x116773['attributes']=_[_0xb5fa('0x33')](_0x5a0152['model'],qs['fields'](_0x1f4380[_0xb5fa('0x32')][_0xb5fa('0x34')]));_0x116773['attributes']=_0x116773['attributes'][_0xb5fa('0x35')]?_0x116773[_0xb5fa('0x36')]:_0x5a0152[_0xb5fa('0x30')];if(!_0x1f4380['query'][_0xb5fa('0x37')](_0xb5fa('0x38'))){_0x116773['limit']=qs[_0xb5fa('0x20')](_0x1f4380[_0xb5fa('0x32')][_0xb5fa('0x20')]);_0x116773['offset']=qs[_0xb5fa('0x1f')](_0x1f4380[_0xb5fa('0x32')][_0xb5fa('0x1f')]);}_0x116773['order']=qs[_0xb5fa('0x39')](_0x1f4380[_0xb5fa('0x32')][_0xb5fa('0x39')]);_0x116773[_0xb5fa('0x3a')]=qs['filters'](_['pick'](_0x1f4380['query'],_0x5a0152['filters']));if(_0x1f4380['query']['filter']){_0x116773[_0xb5fa('0x3a')]=_['merge'](_0x116773[_0xb5fa('0x3a')],{'$or':_[_0xb5fa('0x3b')](_0x21fc7e,function(_0x36db1a){if(_0x36db1a[_0xb5fa('0x3c')][_0xb5fa('0x3d')]!==_0xb5fa('0x3e')){var _0x4b4c4c={};_0x4b4c4c[_0x36db1a['field']]={'$like':'%'+_0x1f4380['query'][_0xb5fa('0x3f')]+'%'};return _0x4b4c4c;}})});}_0x116773=_['merge']({},_0x116773,_0x1f4380[_0xb5fa('0x40')]);var _0x5addd5={'where':_0x116773['where']};return db[_0xb5fa('0x2e')][_0xb5fa('0x1e')](_0x5addd5)[_0xb5fa('0x24')](function(_0x36c345){_0x3fd1fb[_0xb5fa('0x1e')]=_0x36c345;if(_0x1f4380[_0xb5fa('0x32')][_0xb5fa('0x41')]){_0x116773[_0xb5fa('0x42')]=[{'all':!![]}];}return db[_0xb5fa('0x2e')][_0xb5fa('0x43')](_0x116773);})['then'](function(_0x284bbb){_0x3fd1fb['rows']=_0x284bbb;return _0x3fd1fb;})[_0xb5fa('0x24')](respondWithFilteredResult(_0xed02e,_0x116773))[_0xb5fa('0x44')](handleError(_0xed02e,null));};exports[_0xb5fa('0x45')]=function(_0x2ef359,_0x1c706b){var _0x3954b2={'raw':![],'where':{'id':_0x2ef359[_0xb5fa('0x46')]['id']}},_0x3414b2={};_0x3414b2['model']=_[_0xb5fa('0x31')](db[_0xb5fa('0x2e')]['rawAttributes']);_0x3414b2[_0xb5fa('0x32')]=_['keys'](_0x2ef359[_0xb5fa('0x32')]);_0x3414b2[_0xb5fa('0x47')]=_['intersection'](_0x3414b2['model'],_0x3414b2[_0xb5fa('0x32')]);_0x3954b2[_0xb5fa('0x36')]=_[_0xb5fa('0x33')](_0x3414b2[_0xb5fa('0x30')],qs[_0xb5fa('0x34')](_0x2ef359[_0xb5fa('0x32')][_0xb5fa('0x34')]));_0x3954b2[_0xb5fa('0x36')]=_0x3954b2['attributes'][_0xb5fa('0x35')]?_0x3954b2[_0xb5fa('0x36')]:_0x3414b2['model'];if(_0x2ef359[_0xb5fa('0x32')][_0xb5fa('0x41')]){_0x3954b2[_0xb5fa('0x42')]=[{'all':!![]}];}_0x3954b2=_[_0xb5fa('0x48')]({},_0x3954b2,_0x2ef359[_0xb5fa('0x40')]);return db[_0xb5fa('0x2e')][_0xb5fa('0x49')](_0x3954b2)[_0xb5fa('0x24')](handleEntityNotFound(_0x1c706b,null))[_0xb5fa('0x24')](respondWithResult(_0x1c706b,null))[_0xb5fa('0x44')](handleError(_0x1c706b,null));};exports[_0xb5fa('0x4a')]=function(_0x2bafe4,_0x6ae261){return db[_0xb5fa('0x2e')][_0xb5fa('0x4a')](_0x2bafe4[_0xb5fa('0x4b')],{})['then'](function(_0x56dceb){var _0x46194d=_0x2bafe4['user'][_0xb5fa('0x25')]({'plain':!![]});if(!_0x46194d)throw new Error(_0xb5fa('0x4c'));if(_0x46194d['role']===_0xb5fa('0x4d')){var _0x2931a7=_0x56dceb[_0xb5fa('0x25')]({'plain':!![]});var _0x3159e9=_0xb5fa('0x26');return db[_0xb5fa('0x4e')]['find']({'where':{'name':_0x3159e9,'userProfileId':_0x46194d[_0xb5fa('0x4f')]},'raw':!![]})['then'](function(_0x251d36){if(_0x251d36&&_0x251d36[_0xb5fa('0x50')]===0x0){return db[_0xb5fa('0x27')]['create']({'name':_0x2931a7[_0xb5fa('0x2b')],'resourceId':_0x2931a7['id'],'type':_0x251d36[_0xb5fa('0x2b')],'sectionId':_0x251d36['id']},{})['then'](function(){return _0x56dceb;});}else{return _0x56dceb;}})['catch'](function(_0x3f19ee){logger[_0xb5fa('0x29')](_0xb5fa('0x51'),_0x3f19ee);throw _0x3f19ee;});}return _0x56dceb;})[_0xb5fa('0x24')](respondWithResult(_0x6ae261,0xc9))[_0xb5fa('0x44')](handleError(_0x6ae261,null));};exports[_0xb5fa('0x52')]=function(_0x31c91f,_0x3b092a){if(_0x31c91f[_0xb5fa('0x4b')]['id']){delete _0x31c91f[_0xb5fa('0x4b')]['id'];}return db[_0xb5fa('0x2e')][_0xb5fa('0x49')]({'where':{'id':_0x31c91f[_0xb5fa('0x46')]['id']}})[_0xb5fa('0x24')](handleEntityNotFound(_0x3b092a,null))[_0xb5fa('0x24')](saveUpdates(_0x31c91f[_0xb5fa('0x4b')],null))[_0xb5fa('0x24')](respondWithResult(_0x3b092a,null))[_0xb5fa('0x44')](handleError(_0x3b092a,null));};exports['destroy']=function(_0x1900a5,_0x347791){return db[_0xb5fa('0x2e')][_0xb5fa('0x49')]({'where':{'id':_0x1900a5[_0xb5fa('0x46')]['id']}})[_0xb5fa('0x24')](handleEntityNotFound(_0x347791,null))[_0xb5fa('0x24')](removeEntity(_0x347791,null))[_0xb5fa('0x44')](handleError(_0x347791,null));};exports[_0xb5fa('0x53')]=function(_0x1e0547,_0x4ea97d){return db['CmList'][_0xb5fa('0x53')]()[_0xb5fa('0x24')](respondWithResult(_0x4ea97d,null))[_0xb5fa('0x44')](handleError(_0x4ea97d,null));};exports['addDisposition']=function(_0x441c41,_0x367f7a,_0x1572fb){if(_0x441c41[_0xb5fa('0x4b')]['id']){delete _0x441c41[_0xb5fa('0x4b')]['id'];}return db[_0xb5fa('0x2e')][_0xb5fa('0x49')]({'where':{'id':_0x441c41['params']['id']}})[_0xb5fa('0x24')](handleEntityNotFound(_0x367f7a,null))[_0xb5fa('0x24')](function(_0x4afc02){if(_0x4afc02){_0x441c41[_0xb5fa('0x4b')][_0xb5fa('0x54')]=_0x4afc02['id'];return db['Disposition'][_0xb5fa('0x4a')](_0x441c41[_0xb5fa('0x4b')]);}})[_0xb5fa('0x24')](respondWithResult(_0x367f7a,null))[_0xb5fa('0x44')](handleError(_0x367f7a,null));};exports[_0xb5fa('0x55')]=function(_0x435721,_0x18cde9,_0x40d7d5){var _0xd2ba4e={'raw':![],'where':{}};var _0x1c24e3={};var _0xfb88cc={'count':0x0,'rows':[]};return db[_0xb5fa('0x2e')][_0xb5fa('0x56')]({'where':{'id':_0x435721[_0xb5fa('0x46')]['id']}})[_0xb5fa('0x24')](handleEntityNotFound(_0x18cde9,null))[_0xb5fa('0x24')](function(_0x41cce9){if(_0x41cce9){_0x1c24e3[_0xb5fa('0x30')]=_[_0xb5fa('0x31')](db[_0xb5fa('0x57')][_0xb5fa('0x2f')]);_0x1c24e3[_0xb5fa('0x32')]=_['keys'](_0x435721[_0xb5fa('0x32')]);_0x1c24e3[_0xb5fa('0x47')]=_[_0xb5fa('0x33')](_0x1c24e3['model'],_0x1c24e3[_0xb5fa('0x32')]);_0xd2ba4e[_0xb5fa('0x36')]=_['intersection'](_0x1c24e3[_0xb5fa('0x30')],qs[_0xb5fa('0x34')](_0x435721[_0xb5fa('0x32')]['fields']));_0xd2ba4e['attributes']=_0xd2ba4e[_0xb5fa('0x36')][_0xb5fa('0x35')]?_0xd2ba4e[_0xb5fa('0x36')]:_0x1c24e3['model'];if(!_0x435721[_0xb5fa('0x32')][_0xb5fa('0x37')](_0xb5fa('0x38'))){_0xd2ba4e[_0xb5fa('0x20')]=qs['limit'](_0x435721['query']['limit']);_0xd2ba4e[_0xb5fa('0x1f')]=qs[_0xb5fa('0x1f')](_0x435721[_0xb5fa('0x32')]['offset']);}_0xd2ba4e[_0xb5fa('0x58')]=qs[_0xb5fa('0x39')](_0x435721[_0xb5fa('0x32')][_0xb5fa('0x39')]);_0xd2ba4e[_0xb5fa('0x3a')]=qs[_0xb5fa('0x47')](_[_0xb5fa('0x59')](_0x435721[_0xb5fa('0x32')],_0x1c24e3[_0xb5fa('0x47')]));_0xd2ba4e[_0xb5fa('0x3a')][_0xb5fa('0x54')]=_0x41cce9['id'];if(_0x435721[_0xb5fa('0x32')][_0xb5fa('0x3f')]){_0xd2ba4e[_0xb5fa('0x3a')]=_[_0xb5fa('0x48')](_0xd2ba4e['where'],{'$or':_[_0xb5fa('0x3b')](_0xd2ba4e['attributes'],function(_0x47193c){var _0x209213={};_0x209213[_0x47193c]={'$like':'%'+_0x435721[_0xb5fa('0x32')][_0xb5fa('0x3f')]+'%'};return _0x209213;})});}_0xd2ba4e=_[_0xb5fa('0x48')]({},_0xd2ba4e,_0x435721['options']);return db[_0xb5fa('0x57')]['count']({'where':_0xd2ba4e[_0xb5fa('0x3a')]})[_0xb5fa('0x24')](function(_0x118a0e){_0xfb88cc[_0xb5fa('0x1e')]=_0x118a0e;if(_0x435721['query']['includeAll']){_0xd2ba4e['include']=[{'all':!![]}];}return db[_0xb5fa('0x57')][_0xb5fa('0x43')](_0xd2ba4e);})[_0xb5fa('0x24')](function(_0x32e329){_0xfb88cc[_0xb5fa('0x5a')]=_0x32e329;return _0xfb88cc;});}})[_0xb5fa('0x24')](respondWithFilteredResult(_0x18cde9,_0xd2ba4e))['catch'](handleError(_0x18cde9,null));};exports[_0xb5fa('0x5b')]=function(_0x5c08e1,_0x4ca73e,_0x234b95){return db['CmList']['find']({'where':{'id':_0x5c08e1['params']['id']}})[_0xb5fa('0x24')](handleEntityNotFound(_0x4ca73e,null))['then'](function(_0x46c973){if(_0x46c973){return _0x46c973[_0xb5fa('0x5b')](_0x5c08e1[_0xb5fa('0x32')]['ids']);}})['then'](respondWithStatusCode(_0x4ca73e,null))[_0xb5fa('0x44')](handleError(_0x4ca73e,null));};exports[_0xb5fa('0x5c')]=function(_0x4c70d1,_0x2d0c95,_0x3c7cb4){return db[_0xb5fa('0x2e')][_0xb5fa('0x49')]({'where':{'id':_0x4c70d1['params']['id']}})[_0xb5fa('0x24')](handleEntityNotFound(_0x2d0c95,null))[_0xb5fa('0x24')](function(_0x29273a){if(_0x29273a){var _0x180e63=[];var _0x1c0f49={'success':[],'errors':[]};return db[_0xb5fa('0x5d')][_0xb5fa('0x53')]()['then'](function(_0x1e707a){if(_0x4c70d1['body'][_0xb5fa('0x5e')]&&_[_0xb5fa('0x5f')](_0x4c70d1['body'][_0xb5fa('0x5e')])){if(_0x4c70d1[_0xb5fa('0x4b')][_0xb5fa('0x5e')][_0xb5fa('0x35')]){_0x4c70d1[_0xb5fa('0x4b')][_0xb5fa('0x5e')]=_0x4c70d1[_0xb5fa('0x4b')][_0xb5fa('0x5e')]['join'](';')+';';}else{_0x4c70d1[_0xb5fa('0x4b')][_0xb5fa('0x5e')]=null;}}else{_0x4c70d1[_0xb5fa('0x4b')][_0xb5fa('0x5e')]=null;}if(_0x4c70d1['body']&&_['isArray'](_0x4c70d1['body'])){for(var _0x5557a3=0x0;_0x5557a3<_0x4c70d1[_0xb5fa('0x4b')][_0xb5fa('0x35')];_0x5557a3+=0x1){_0x4c70d1[_0xb5fa('0x4b')][_0x5557a3][_0xb5fa('0x54')]=_0x4c70d1['params']['id'];_0x180e63['push'](_0x4c70d1[_0xb5fa('0x4b')][_0x5557a3]);}return BPromise['each'](_0x180e63,function(_0x32eebd){return db[_0xb5fa('0x5d')][_0xb5fa('0x4a')](_[_0xb5fa('0x60')](_0x32eebd,['ids','id'])||{},{'fields':_[_0xb5fa('0x31')](_0x1e707a),'raw':!![]})['then'](function(_0x46b0a8){_0x1c0f49[_0xb5fa('0x61')]['push'](_0x46b0a8['dataValues']);})[_0xb5fa('0x44')](function(_0x3150ac){_0x1c0f49[_0xb5fa('0x62')][_0xb5fa('0x63')]({'data':_0x32eebd,'error':_0x3150ac[_0xb5fa('0x64')]});});})[_0xb5fa('0x24')](function(_0x42e210){return _0x1c0f49;})[_0xb5fa('0x44')](function(_0x1a0255){return _0x1a0255;});}else{_0x2d0c95[_0xb5fa('0x1d')](0x190)[_0xb5fa('0x22')]({'message':_0xb5fa('0x65')});}});}})[_0xb5fa('0x24')](respondWithResult(_0x2d0c95,null))['catch'](handleError(_0x2d0c95,null));};exports['getContacts']=function(_0x3dd9ab,_0x52384b,_0x1cb113){var _0x18528c;return db['CmList'][_0xb5fa('0x49')]({'where':{'id':_0x3dd9ab[_0xb5fa('0x46')]['id']},'include':[{'model':db['CmCustomField'],'as':_0xb5fa('0x66')}]})[_0xb5fa('0x24')](handleEntityNotFound(_0x52384b,null))['then'](function(_0x138c60){if(_0x138c60){_0x18528c=_0x138c60;return db[_0xb5fa('0x5d')][_0xb5fa('0x2f')];}})['then'](function(_0x55c1c0){if(_0x55c1c0){var _0x9dca71={};var _0x1a24a2={};_0x1a24a2[_0xb5fa('0x30')]=_[_0xb5fa('0x67')](_[_0xb5fa('0x31')](_0x55c1c0),_[_0xb5fa('0x3b')](_0x18528c[_0xb5fa('0x66')],function(_0x1eec65){return util[_0xb5fa('0x68')](_0xb5fa('0x69'),_0x1eec65['id']);}));_0x1a24a2['query']=_['keys'](_0x3dd9ab[_0xb5fa('0x32')]);_0x1a24a2[_0xb5fa('0x47')]=_[_0xb5fa('0x33')](_0x1a24a2[_0xb5fa('0x30')],_0x1a24a2['query']);_0x9dca71[_0xb5fa('0x36')]=_[_0xb5fa('0x33')](_0x1a24a2[_0xb5fa('0x30')],qs['fields'](_0x3dd9ab[_0xb5fa('0x32')][_0xb5fa('0x34')]));_0x9dca71[_0xb5fa('0x36')]=_0x9dca71[_0xb5fa('0x36')]['length']?_0x9dca71[_0xb5fa('0x36')]:_0x1a24a2[_0xb5fa('0x30')];if(!_0x3dd9ab[_0xb5fa('0x32')][_0xb5fa('0x37')](_0xb5fa('0x38'))){_0x9dca71[_0xb5fa('0x20')]=qs[_0xb5fa('0x20')](_0x3dd9ab[_0xb5fa('0x32')][_0xb5fa('0x20')]);_0x9dca71[_0xb5fa('0x1f')]=qs[_0xb5fa('0x1f')](_0x3dd9ab[_0xb5fa('0x32')][_0xb5fa('0x1f')]);}_0x9dca71[_0xb5fa('0x58')]=qs[_0xb5fa('0x39')](_0x3dd9ab['query'][_0xb5fa('0x39')]);_0x9dca71[_0xb5fa('0x3a')]=qs[_0xb5fa('0x47')](_[_0xb5fa('0x59')](_0x3dd9ab[_0xb5fa('0x32')],_0x1a24a2[_0xb5fa('0x47')]));_0x9dca71[_0xb5fa('0x6a')]=!![];if(_0x3dd9ab[_0xb5fa('0x32')]['filter']){_0x9dca71['where']=_[_0xb5fa('0x48')](_0x9dca71['where'],{'$or':_['map'](_0x9dca71[_0xb5fa('0x36')],function(_0x27dbe8){var _0x2faf23={};_0x2faf23[_0x27dbe8]={'$like':'%'+_0x3dd9ab['query'][_0xb5fa('0x3f')]+'%'};return _0x2faf23;})});}_0x9dca71=_[_0xb5fa('0x48')]({},_0x9dca71,_0x3dd9ab[_0xb5fa('0x40')]);return _0x18528c['getContacts'](_0x9dca71);}})[_0xb5fa('0x24')](respondWithResult(_0x52384b,null))[_0xb5fa('0x44')](handleError(_0x52384b,null));};exports['getContactsCsv']=function(_0x27ca06,_0x3217b0,_0x3791e7){var _0xf15d5c;return db[_0xb5fa('0x2e')][_0xb5fa('0x49')]({'where':{'id':_0x27ca06[_0xb5fa('0x46')]['id']},'include':[{'model':db['CmCustomField'],'as':_0xb5fa('0x66')}]})[_0xb5fa('0x24')](handleEntityNotFound(_0x3217b0,null))[_0xb5fa('0x24')](function(_0x320eda){if(_0x320eda){_0xf15d5c=_0x320eda;return db['CmContact']['rawAttributes'];}})[_0xb5fa('0x24')](function(_0x21fa37){if(_0x21fa37){var _0x3b1fe2={};var _0x1a889a={};_0x1a889a['model']=_['concat'](_['keys'](_0x21fa37),_['map'](_0xf15d5c[_0xb5fa('0x66')],function(_0x46a651){return util[_0xb5fa('0x68')](_0xb5fa('0x69'),_0x46a651['id']);}));_0x1a889a[_0xb5fa('0x32')]=_[_0xb5fa('0x31')](_0x27ca06[_0xb5fa('0x32')]);_0x1a889a[_0xb5fa('0x47')]=_[_0xb5fa('0x33')](_0x1a889a[_0xb5fa('0x30')],_0x1a889a[_0xb5fa('0x32')]);_0x3b1fe2['attributes']=_[_0xb5fa('0x33')](_0x1a889a[_0xb5fa('0x30')],qs['fields'](_0x27ca06[_0xb5fa('0x32')][_0xb5fa('0x34')]));_0x3b1fe2['attributes']=_0x3b1fe2[_0xb5fa('0x36')][_0xb5fa('0x35')]?_0x3b1fe2[_0xb5fa('0x36')]:_0x1a889a[_0xb5fa('0x30')];if(!_0x27ca06[_0xb5fa('0x32')][_0xb5fa('0x37')](_0xb5fa('0x38'))){_0x3b1fe2[_0xb5fa('0x20')]=qs[_0xb5fa('0x20')](_0x27ca06['query'][_0xb5fa('0x20')]);_0x3b1fe2[_0xb5fa('0x1f')]=qs[_0xb5fa('0x1f')](_0x27ca06[_0xb5fa('0x32')][_0xb5fa('0x1f')]);}_0x3b1fe2[_0xb5fa('0x58')]=qs[_0xb5fa('0x39')](_0x27ca06[_0xb5fa('0x32')]['sort']);_0x3b1fe2[_0xb5fa('0x3a')]=qs['filters'](_[_0xb5fa('0x59')](_0x27ca06[_0xb5fa('0x32')],_0x1a889a[_0xb5fa('0x47')]));_0x3b1fe2[_0xb5fa('0x6a')]=!![];if(_0x27ca06[_0xb5fa('0x32')][_0xb5fa('0x3f')]){_0x3b1fe2[_0xb5fa('0x3a')]=_[_0xb5fa('0x48')](_0x3b1fe2[_0xb5fa('0x3a')],{'$or':_['map'](_0x3b1fe2['attributes'],function(_0x49ee07){var _0x226fe6={};_0x226fe6[_0x49ee07]={'$like':'%'+_0x27ca06[_0xb5fa('0x32')][_0xb5fa('0x3f')]+'%'};return _0x226fe6;})});}_0x3b1fe2=_['merge']({},_0x3b1fe2,_0x27ca06[_0xb5fa('0x40')]);return _0xf15d5c['getContacts'](_0x3b1fe2);}})[_0xb5fa('0x24')](function(_0x4311be){if(!_['isEmpty'](_0x4311be)){var _0x1156d2=toCsv(_0x4311be);var _0x49f12d=Date[_0xb5fa('0x6b')]();fs['writeFileSync'](util[_0xb5fa('0x68')](_0xb5fa('0x6c'),_0xf15d5c['id'],_0x49f12d),_0x1156d2);_0x3217b0[_0xb5fa('0x6d')](_0xb5fa('0x6e'),_0xb5fa('0x6f')+util[_0xb5fa('0x68')](_0xb5fa('0x70'),_0xf15d5c['id'],_0x49f12d));_0x3217b0[_0xb5fa('0x6d')](_0xb5fa('0x71'),_0xb5fa('0x72'));return _0x3217b0[_0xb5fa('0x73')](util['format'](_0xb5fa('0x6c'),_0xf15d5c['id'],_0x49f12d));}else{return _0x3217b0[_0xb5fa('0x1c')](0xcc);}})[_0xb5fa('0x44')](handleError(_0x3217b0,null));};exports['addCustomField']=function(_0x2145d8,_0x2ca7d5,_0x1e11bc){var _0x1509da;delete _0x2145d8[_0xb5fa('0x4b')]['id'];return db[_0xb5fa('0x2e')][_0xb5fa('0x56')]({'where':{'id':_0x2145d8[_0xb5fa('0x46')]['id']}})['then'](handleEntityNotFound(_0x2ca7d5,null))[_0xb5fa('0x24')](function(_0x5c1e1f){if(_0x5c1e1f){return db[_0xb5fa('0x74')][_0xb5fa('0x75')](function(_0x148875){return db[_0xb5fa('0x76')][_0xb5fa('0x4a')](_0x2145d8[_0xb5fa('0x4b')],{'transaction':_0x148875})[_0xb5fa('0x24')](function(_0x826234){_0x1509da=_0x826234;return _0x5c1e1f[_0xb5fa('0x77')](_0x826234,{'transaction':_0x148875});})[_0xb5fa('0x24')](function(){var _0x1feb1d={'type':db[_0xb5fa('0x78')][_0xb5fa('0x79')],'transaction':_0x148875};switch(_0x2145d8[_0xb5fa('0x4b')][_0xb5fa('0x3c')]){case _0xb5fa('0x7a'):_0x1feb1d[_0xb5fa('0x3c')]=db['Sequelize'][_0xb5fa('0x79')];break;case _0xb5fa('0x7b'):_0x1feb1d['type']=db[_0xb5fa('0x78')][_0xb5fa('0x7c')];break;case'switch':_0x1feb1d['type']=db['Sequelize'][_0xb5fa('0x7d')];_0x1feb1d[_0xb5fa('0x7e')]=![];break;default:}return db[_0xb5fa('0x74')][_0xb5fa('0x7f')][_0xb5fa('0x80')](_0xb5fa('0x81'),util[_0xb5fa('0x68')]('cf_%s',_0x1509da['id']),_0x1feb1d);})['then'](function(){return _0x1509da;});});}})['then'](respondWithResult(_0x2ca7d5,null))[_0xb5fa('0x44')](handleError(_0x2ca7d5,null));};exports['getCustomFields']=function(_0x4d1ba6,_0x2c7076,_0x5ab2ba){var _0x8b9718={};var _0x1dc663={};var _0x267737;var _0x310a86;return db[_0xb5fa('0x2e')]['findOne']({'where':{'id':_0x4d1ba6[_0xb5fa('0x46')]['id']}})[_0xb5fa('0x24')](handleEntityNotFound(_0x2c7076,null))[_0xb5fa('0x24')](function(_0x3c5ac4){if(_0x3c5ac4){_0x267737=_0x3c5ac4;_0x1dc663[_0xb5fa('0x30')]=_['keys'](db[_0xb5fa('0x76')][_0xb5fa('0x2f')]);_0x1dc663[_0xb5fa('0x32')]=_[_0xb5fa('0x31')](_0x4d1ba6[_0xb5fa('0x32')]);_0x1dc663[_0xb5fa('0x47')]=_['intersection'](_0x1dc663[_0xb5fa('0x30')],_0x1dc663[_0xb5fa('0x32')]);_0x8b9718[_0xb5fa('0x36')]=_[_0xb5fa('0x33')](_0x1dc663[_0xb5fa('0x30')],qs[_0xb5fa('0x34')](_0x4d1ba6[_0xb5fa('0x32')][_0xb5fa('0x34')]));_0x8b9718[_0xb5fa('0x36')]=_0x8b9718[_0xb5fa('0x36')][_0xb5fa('0x35')]?_0x8b9718[_0xb5fa('0x36')]:_0x1dc663[_0xb5fa('0x30')];_0x8b9718[_0xb5fa('0x58')]=qs[_0xb5fa('0x39')](_0x4d1ba6[_0xb5fa('0x32')][_0xb5fa('0x39')]);_0x8b9718[_0xb5fa('0x3a')]=qs[_0xb5fa('0x47')](_[_0xb5fa('0x59')](_0x4d1ba6[_0xb5fa('0x32')],_0x1dc663[_0xb5fa('0x47')]));_0x8b9718['where']=_['merge'](_0x8b9718[_0xb5fa('0x3a')],{'$or':[{'ListId':_0x3c5ac4['id']},{'ListId':null}]});if(_0x4d1ba6[_0xb5fa('0x32')][_0xb5fa('0x3f')]){_0x8b9718[_0xb5fa('0x3a')]=_[_0xb5fa('0x48')](_0x8b9718[_0xb5fa('0x3a')],{'$or':_['map'](_0x8b9718['attributes'],function(_0x52e1e2){var _0x44f198={};_0x44f198[_0x52e1e2]={'$like':'%'+_0x4d1ba6[_0xb5fa('0x32')]['filter']+'%'};return _0x44f198;})});}_0x8b9718=_[_0xb5fa('0x48')]({},_0x8b9718,_0x4d1ba6[_0xb5fa('0x40')]);return db['CmCustomField'][_0xb5fa('0x82')](_0x8b9718);}})[_0xb5fa('0x24')](respondWithResult(_0x2c7076,null))[_0xb5fa('0x44')](handleError(_0x2c7076,null));};exports[_0xb5fa('0x83')]=function(_0x10dbdf,_0xe85817,_0x1580d5){return db[_0xb5fa('0x2e')]['find']({'where':{'id':_0x10dbdf[_0xb5fa('0x46')]['id']}})['then'](handleEntityNotFound(_0xe85817,null))[_0xb5fa('0x24')](function(_0x5bfb10){if(_0x5bfb10){return _0x5bfb10[_0xb5fa('0x83')](_0x10dbdf[_0xb5fa('0x4b')]['ids'],_[_0xb5fa('0x60')](_0x10dbdf[_0xb5fa('0x4b')],[_0xb5fa('0x84'),'id'])||{})[_0xb5fa('0x85')](function(_0x5445be){for(var _0xa1b25a=0x0;_0xa1b25a<_0x10dbdf[_0xb5fa('0x4b')][_0xb5fa('0x84')][_0xb5fa('0x35')];_0xa1b25a+=0x1){socket[_0xb5fa('0x86')](_0xb5fa('0x87'),{'UserId':_0x10dbdf[_0xb5fa('0x4b')]['ids'][_0xa1b25a],'CmListId':_0x10dbdf[_0xb5fa('0x46')]['id']});}return _0x5445be;});}})['then'](respondWithResult(_0xe85817,null))[_0xb5fa('0x44')](handleError(_0xe85817,null));};exports[_0xb5fa('0x88')]=function(_0x412dd1,_0xf7d659,_0x28aeb2){return db[_0xb5fa('0x2e')][_0xb5fa('0x49')]({'where':{'id':_0x412dd1['params']['id']}})['then'](handleEntityNotFound(_0xf7d659,null))[_0xb5fa('0x24')](function(_0x3d9563){if(_0x3d9563){return _0x3d9563[_0xb5fa('0x88')](_0x412dd1[_0xb5fa('0x32')][_0xb5fa('0x84')])[_0xb5fa('0x24')](function(){if(_[_0xb5fa('0x5f')](_0x412dd1[_0xb5fa('0x32')]['ids'])){for(var _0x160e78=0x0;_0x160e78<_0x412dd1[_0xb5fa('0x32')][_0xb5fa('0x84')][_0xb5fa('0x35')];_0x160e78+=0x1){socket[_0xb5fa('0x86')](_0xb5fa('0x89'),{'UserId':Number(_0x412dd1[_0xb5fa('0x32')][_0xb5fa('0x84')][_0x160e78]),'CmListId':Number(_0x412dd1[_0xb5fa('0x46')]['id'])});}}else{socket['emit'](_0xb5fa('0x89'),{'UserId':Number(_0x412dd1['query'][_0xb5fa('0x84')]),'CmListId':Number(_0x412dd1[_0xb5fa('0x46')]['id'])});}});}})[_0xb5fa('0x24')](respondWithStatusCode(_0xf7d659,null))[_0xb5fa('0x44')](handleError(_0xf7d659,null));};exports[_0xb5fa('0x8a')]=function(_0x3327bd,_0x5dc790,_0x9618fc){var _0x3170c1={};var _0xa10bd={};var _0x327f35;var _0x365087;return db[_0xb5fa('0x2e')][_0xb5fa('0x56')]({'where':{'id':_0x3327bd['params']['id']}})['then'](handleEntityNotFound(_0x5dc790,null))[_0xb5fa('0x24')](function(_0x3a8dad){if(_0x3a8dad){_0x327f35=_0x3a8dad;_0xa10bd[_0xb5fa('0x30')]=_[_0xb5fa('0x31')](db[_0xb5fa('0x8b')][_0xb5fa('0x2f')]);_0xa10bd[_0xb5fa('0x32')]=_[_0xb5fa('0x31')](_0x3327bd[_0xb5fa('0x32')]);_0xa10bd[_0xb5fa('0x47')]=_['intersection'](_0xa10bd[_0xb5fa('0x30')],_0xa10bd[_0xb5fa('0x32')]);_0x3170c1[_0xb5fa('0x36')]=_[_0xb5fa('0x33')](_0xa10bd[_0xb5fa('0x30')],qs[_0xb5fa('0x34')](_0x3327bd[_0xb5fa('0x32')][_0xb5fa('0x34')]));_0x3170c1[_0xb5fa('0x36')]=_0x3170c1[_0xb5fa('0x36')][_0xb5fa('0x35')]?_0x3170c1[_0xb5fa('0x36')]:_0xa10bd[_0xb5fa('0x30')];_0x3170c1[_0xb5fa('0x58')]=qs['sort'](_0x3327bd['query'][_0xb5fa('0x39')]);_0x3170c1[_0xb5fa('0x3a')]=qs['filters'](_[_0xb5fa('0x59')](_0x3327bd[_0xb5fa('0x32')],_0xa10bd[_0xb5fa('0x47')]));if(_0x3327bd['query'][_0xb5fa('0x3f')]){_0x3170c1[_0xb5fa('0x3a')]=_[_0xb5fa('0x48')](_0x3170c1[_0xb5fa('0x3a')],{'$or':_[_0xb5fa('0x3b')](_0x3170c1[_0xb5fa('0x36')],function(_0x105f01){var _0x3c3590={};_0x3c3590[_0x105f01]={'$like':'%'+_0x3327bd['query'][_0xb5fa('0x3f')]+'%'};return _0x3c3590;})});}_0x3170c1=_[_0xb5fa('0x48')]({},_0x3170c1,_0x3327bd['options']);return _0x327f35[_0xb5fa('0x8a')](_0x3170c1);}})[_0xb5fa('0x24')](function(_0x567ad1){if(_0x567ad1){_0x365087=_0x567ad1[_0xb5fa('0x35')];if(!_0x3327bd[_0xb5fa('0x32')][_0xb5fa('0x37')](_0xb5fa('0x38'))){_0x3170c1[_0xb5fa('0x20')]=qs[_0xb5fa('0x20')](_0x3327bd[_0xb5fa('0x32')][_0xb5fa('0x20')]);_0x3170c1['offset']=qs[_0xb5fa('0x1f')](_0x3327bd[_0xb5fa('0x32')][_0xb5fa('0x1f')]);}return _0x327f35[_0xb5fa('0x8a')](_0x3170c1);}})[_0xb5fa('0x24')](function(_0x486620){if(_0x486620){return _0x486620?{'count':_0x365087,'rows':_0x486620}:null;}})[_0xb5fa('0x24')](respondWithResult(_0x5dc790,null))[_0xb5fa('0x44')](handleError(_0x5dc790,null));}; \ No newline at end of file +var _0x3f8a=['Content-type','text/csv','download','findOne','sequelize','transaction','CmCustomField','addCustomFields','Sequelize','TEXT','number','BOOLEAN','defaultValue','queryInterface','cf_%s','getCustomFields','findAndCountAll','addAgents','spread','emit','userCmList:save','removeAgents','userCmList:remove','getAgents','User','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./cmList.socket','register','sendStatus','status','json','offset','limit','Content-Range','apply','reject','save','then','destroy','get','Lists','UserProfileResource','stack','name','send','index','CmList','rawAttributes','model','keys','query','filters','intersection','fields','attributes','hasOwnProperty','order','sort','pick','filter','merge','where','map','type','key','options','include','findAll','catch','show','params','length','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','addDisposition','ListId','Disposition','getDispositions','nolimit','count','removeDispositions','ids','addContacts','tags','join','isArray','push','CmContact','omit','success','dataValues','errors','message','Malformed\x20request\x20syntax','getContacts','CustomFields','concat','cf_%d','raw','format','isEmpty','now','writeFileSync','/tmp/list_%d_%s.csv','setHeader','list_%d_%s.csv'];(function(_0x50e76a,_0x27302d){var _0x2d3b2d=function(_0x15b5f6){while(--_0x15b5f6){_0x50e76a['push'](_0x50e76a['shift']());}};_0x2d3b2d(++_0x27302d);}(_0x3f8a,0x1d5));var _0xa3f8=function(_0x43e226,_0x1e045b){_0x43e226=_0x43e226-0x0;var _0x42e235=_0x3f8a[_0x43e226];return _0x42e235;};'use strict';var pdf=require(_0xa3f8('0x0'));var emlformat=require(_0xa3f8('0x1'));var rimraf=require(_0xa3f8('0x2'));var zipdir=require(_0xa3f8('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa3f8('0x4'));var moment=require(_0xa3f8('0x5'));var BPromise=require(_0xa3f8('0x6'));var Mustache=require(_0xa3f8('0x7'));var util=require(_0xa3f8('0x8'));var path=require(_0xa3f8('0x9'));var sox=require(_0xa3f8('0xa'));var csv=require(_0xa3f8('0xb'));var ejs=require(_0xa3f8('0xc'));var fs=require('fs');var _=require(_0xa3f8('0xd'));var squel=require(_0xa3f8('0xe'));var crypto=require(_0xa3f8('0xf'));var jsforce=require(_0xa3f8('0x10'));var deskjs=require(_0xa3f8('0x11'));var toCsv=require(_0xa3f8('0xb'));var querystring=require(_0xa3f8('0x12'));var Papa=require(_0xa3f8('0x13'));var Redis=require('ioredis');var authService=require(_0xa3f8('0x14'));var qs=require(_0xa3f8('0x15'));var as=require(_0xa3f8('0x16'));var hardwareService=require(_0xa3f8('0x17'));var logger=require('../../config/logger')(_0xa3f8('0x18'));var utils=require(_0xa3f8('0x19'));var config=require(_0xa3f8('0x1a'));var db=require(_0xa3f8('0x1b'))['db'];config[_0xa3f8('0x1c')]=_[_0xa3f8('0x1d')](config[_0xa3f8('0x1c')],{'host':_0xa3f8('0x1e'),'port':0x18eb});var socket=require(_0xa3f8('0x1f'))(new Redis(config[_0xa3f8('0x1c')]));require(_0xa3f8('0x20'))[_0xa3f8('0x21')](socket);function respondWithStatusCode(_0x5b2c33,_0x2d8f74){_0x2d8f74=_0x2d8f74||0xcc;return function(_0xe55848){if(_0xe55848){return _0x5b2c33[_0xa3f8('0x22')](_0x2d8f74);}return _0x5b2c33[_0xa3f8('0x23')](_0x2d8f74)['end']();};}function respondWithResult(_0x39c450,_0x33b98e){_0x33b98e=_0x33b98e||0xc8;return function(_0x46a8d9){if(_0x46a8d9){return _0x39c450[_0xa3f8('0x23')](_0x33b98e)[_0xa3f8('0x24')](_0x46a8d9);}};}function respondWithFilteredResult(_0x259efe,_0x2f0659){return function(_0x3e2e1c){if(_0x3e2e1c){var _0x2cb49f=_0x3e2e1c['count'],_0x267e73=_0x2f0659[_0xa3f8('0x25')],_0x54b870=_0x2f0659[_0xa3f8('0x25')]+_0x2f0659[_0xa3f8('0x26')],_0x3ad8cd;if(_0x54b870>=_0x2cb49f){_0x54b870=_0x2cb49f;_0x3ad8cd=0xc8;}else{_0x3ad8cd=0xce;}_0x259efe[_0xa3f8('0x23')](_0x3ad8cd);return _0x259efe['set'](_0xa3f8('0x27'),_0x267e73+'-'+_0x54b870+'/'+_0x2cb49f)['json'](_0x3e2e1c);}return null;};}function patchUpdates(_0x43c393){return function(_0x58336d){try{jsonpatch[_0xa3f8('0x28')](_0x58336d,_0x43c393,!![]);}catch(_0x1a89d4){return BPromise[_0xa3f8('0x29')](_0x1a89d4);}return _0x58336d[_0xa3f8('0x2a')]();};}function saveUpdates(_0x3a6a57,_0x1e5f30){return function(_0x187352){if(_0x187352){return _0x187352['update'](_0x3a6a57)[_0xa3f8('0x2b')](function(_0x4d0e72){return _0x4d0e72;});}return null;};}function removeEntity(_0x3ce57b,_0xa5a697){return function(_0x24985a){if(_0x24985a){return _0x24985a[_0xa3f8('0x2c')]()[_0xa3f8('0x2b')](function(){var _0x2c5d10=_0x24985a[_0xa3f8('0x2d')]({'plain':!![]});var _0x34884d=_0xa3f8('0x2e');return db[_0xa3f8('0x2f')]['destroy']({'where':{'type':_0x34884d,'resourceId':_0x2c5d10['id']}})[_0xa3f8('0x2b')](function(){return _0x24985a;});})[_0xa3f8('0x2b')](function(){_0x3ce57b[_0xa3f8('0x23')](0xcc)['end']();});}};}function handleEntityNotFound(_0x40f5cc,_0x57f6be){return function(_0xbad6a6){if(!_0xbad6a6){_0x40f5cc[_0xa3f8('0x22')](0x194);}return _0xbad6a6;};}function handleError(_0x3c1128,_0x4ea213){_0x4ea213=_0x4ea213||0x1f4;return function(_0x458824){logger['error'](_0x458824[_0xa3f8('0x30')]);if(_0x458824[_0xa3f8('0x31')]){delete _0x458824[_0xa3f8('0x31')];}_0x3c1128[_0xa3f8('0x23')](_0x4ea213)[_0xa3f8('0x32')](_0x458824);};}exports[_0xa3f8('0x33')]=function(_0x23c854,_0x424a3e){var _0x25f9f5={},_0x290a4e={},_0x6e83b0={'count':0x0,'rows':[]};var _0x57c465=db[_0xa3f8('0x34')][_0xa3f8('0x35')];_0x290a4e[_0xa3f8('0x36')]=_[_0xa3f8('0x37')](_0x57c465);_0x290a4e[_0xa3f8('0x38')]=_['keys'](_0x23c854[_0xa3f8('0x38')]);_0x290a4e[_0xa3f8('0x39')]=_['intersection'](_0x290a4e[_0xa3f8('0x36')],_0x290a4e[_0xa3f8('0x38')]);_0x25f9f5['attributes']=_[_0xa3f8('0x3a')](_0x290a4e['model'],qs['fields'](_0x23c854[_0xa3f8('0x38')][_0xa3f8('0x3b')]));_0x25f9f5['attributes']=_0x25f9f5[_0xa3f8('0x3c')]['length']?_0x25f9f5[_0xa3f8('0x3c')]:_0x290a4e[_0xa3f8('0x36')];if(!_0x23c854[_0xa3f8('0x38')][_0xa3f8('0x3d')]('nolimit')){_0x25f9f5[_0xa3f8('0x26')]=qs['limit'](_0x23c854[_0xa3f8('0x38')]['limit']);_0x25f9f5[_0xa3f8('0x25')]=qs['offset'](_0x23c854['query']['offset']);}_0x25f9f5[_0xa3f8('0x3e')]=qs[_0xa3f8('0x3f')](_0x23c854[_0xa3f8('0x38')][_0xa3f8('0x3f')]);_0x25f9f5['where']=qs[_0xa3f8('0x39')](_[_0xa3f8('0x40')](_0x23c854[_0xa3f8('0x38')],_0x290a4e[_0xa3f8('0x39')]));if(_0x23c854[_0xa3f8('0x38')][_0xa3f8('0x41')]){_0x25f9f5['where']=_[_0xa3f8('0x42')](_0x25f9f5[_0xa3f8('0x43')],{'$or':_[_0xa3f8('0x44')](_0x57c465,function(_0x51de10){if(_0x51de10[_0xa3f8('0x45')][_0xa3f8('0x46')]!=='VIRTUAL'){var _0xdc3c67={};_0xdc3c67[_0x51de10['field']]={'$like':'%'+_0x23c854[_0xa3f8('0x38')]['filter']+'%'};return _0xdc3c67;}})});}_0x25f9f5=_[_0xa3f8('0x42')]({},_0x25f9f5,_0x23c854[_0xa3f8('0x47')]);var _0x9a00e7={'where':_0x25f9f5[_0xa3f8('0x43')]};return db[_0xa3f8('0x34')]['count'](_0x9a00e7)[_0xa3f8('0x2b')](function(_0x88108){_0x6e83b0['count']=_0x88108;if(_0x23c854[_0xa3f8('0x38')]['includeAll']){_0x25f9f5[_0xa3f8('0x48')]=[{'all':!![]}];}return db[_0xa3f8('0x34')][_0xa3f8('0x49')](_0x25f9f5);})[_0xa3f8('0x2b')](function(_0x357712){_0x6e83b0['rows']=_0x357712;return _0x6e83b0;})[_0xa3f8('0x2b')](respondWithFilteredResult(_0x424a3e,_0x25f9f5))[_0xa3f8('0x4a')](handleError(_0x424a3e,null));};exports[_0xa3f8('0x4b')]=function(_0x182cc8,_0x337808){var _0x54608c={'raw':![],'where':{'id':_0x182cc8[_0xa3f8('0x4c')]['id']}},_0x306f08={};_0x306f08[_0xa3f8('0x36')]=_[_0xa3f8('0x37')](db[_0xa3f8('0x34')][_0xa3f8('0x35')]);_0x306f08[_0xa3f8('0x38')]=_[_0xa3f8('0x37')](_0x182cc8[_0xa3f8('0x38')]);_0x306f08[_0xa3f8('0x39')]=_[_0xa3f8('0x3a')](_0x306f08[_0xa3f8('0x36')],_0x306f08[_0xa3f8('0x38')]);_0x54608c['attributes']=_['intersection'](_0x306f08['model'],qs[_0xa3f8('0x3b')](_0x182cc8[_0xa3f8('0x38')][_0xa3f8('0x3b')]));_0x54608c[_0xa3f8('0x3c')]=_0x54608c[_0xa3f8('0x3c')][_0xa3f8('0x4d')]?_0x54608c['attributes']:_0x306f08[_0xa3f8('0x36')];if(_0x182cc8[_0xa3f8('0x38')][_0xa3f8('0x4e')]){_0x54608c[_0xa3f8('0x48')]=[{'all':!![]}];}_0x54608c=_['merge']({},_0x54608c,_0x182cc8[_0xa3f8('0x47')]);return db[_0xa3f8('0x34')][_0xa3f8('0x4f')](_0x54608c)['then'](handleEntityNotFound(_0x337808,null))['then'](respondWithResult(_0x337808,null))['catch'](handleError(_0x337808,null));};exports[_0xa3f8('0x50')]=function(_0xd3bbc8,_0x5a2a7c){return db[_0xa3f8('0x34')][_0xa3f8('0x50')](_0xd3bbc8[_0xa3f8('0x51')],{})[_0xa3f8('0x2b')](function(_0x14932f){var _0x3c74b5=_0xd3bbc8[_0xa3f8('0x52')][_0xa3f8('0x2d')]({'plain':!![]});if(!_0x3c74b5)throw new Error(_0xa3f8('0x53'));if(_0x3c74b5[_0xa3f8('0x54')]===_0xa3f8('0x52')){var _0x29d8f5=_0x14932f[_0xa3f8('0x2d')]({'plain':!![]});var _0x44121f=_0xa3f8('0x2e');return db[_0xa3f8('0x55')][_0xa3f8('0x4f')]({'where':{'name':_0x44121f,'userProfileId':_0x3c74b5['userProfileId']},'raw':!![]})['then'](function(_0x1fad80){if(_0x1fad80&&_0x1fad80[_0xa3f8('0x56')]===0x0){return db['UserProfileResource'][_0xa3f8('0x50')]({'name':_0x29d8f5[_0xa3f8('0x31')],'resourceId':_0x29d8f5['id'],'type':_0x1fad80[_0xa3f8('0x31')],'sectionId':_0x1fad80['id']},{})[_0xa3f8('0x2b')](function(){return _0x14932f;});}else{return _0x14932f;}})[_0xa3f8('0x4a')](function(_0x3b85a3){logger[_0xa3f8('0x57')](_0xa3f8('0x58'),_0x3b85a3);throw _0x3b85a3;});}return _0x14932f;})[_0xa3f8('0x2b')](respondWithResult(_0x5a2a7c,0xc9))[_0xa3f8('0x4a')](handleError(_0x5a2a7c,null));};exports[_0xa3f8('0x59')]=function(_0x3752fa,_0x26df9d){if(_0x3752fa[_0xa3f8('0x51')]['id']){delete _0x3752fa[_0xa3f8('0x51')]['id'];}return db[_0xa3f8('0x34')]['find']({'where':{'id':_0x3752fa['params']['id']}})[_0xa3f8('0x2b')](handleEntityNotFound(_0x26df9d,null))['then'](saveUpdates(_0x3752fa[_0xa3f8('0x51')],null))[_0xa3f8('0x2b')](respondWithResult(_0x26df9d,null))[_0xa3f8('0x4a')](handleError(_0x26df9d,null));};exports['destroy']=function(_0x36ec3c,_0x39695f){return db[_0xa3f8('0x34')][_0xa3f8('0x4f')]({'where':{'id':_0x36ec3c['params']['id']}})[_0xa3f8('0x2b')](handleEntityNotFound(_0x39695f,null))['then'](removeEntity(_0x39695f,null))[_0xa3f8('0x4a')](handleError(_0x39695f,null));};exports[_0xa3f8('0x5a')]=function(_0x312ea7,_0x5c663b){return db['CmList'][_0xa3f8('0x5a')]()[_0xa3f8('0x2b')](respondWithResult(_0x5c663b,null))[_0xa3f8('0x4a')](handleError(_0x5c663b,null));};exports[_0xa3f8('0x5b')]=function(_0x48f5a6,_0x36eac9,_0x3478e8){if(_0x48f5a6[_0xa3f8('0x51')]['id']){delete _0x48f5a6[_0xa3f8('0x51')]['id'];}return db[_0xa3f8('0x34')]['find']({'where':{'id':_0x48f5a6['params']['id']}})[_0xa3f8('0x2b')](handleEntityNotFound(_0x36eac9,null))[_0xa3f8('0x2b')](function(_0x384da0){if(_0x384da0){_0x48f5a6[_0xa3f8('0x51')][_0xa3f8('0x5c')]=_0x384da0['id'];return db[_0xa3f8('0x5d')][_0xa3f8('0x50')](_0x48f5a6['body']);}})['then'](respondWithResult(_0x36eac9,null))['catch'](handleError(_0x36eac9,null));};exports[_0xa3f8('0x5e')]=function(_0x45bcac,_0x3096d0,_0x398f64){var _0x185b38={'raw':![],'where':{}};var _0x27de61={};var _0x356643={'count':0x0,'rows':[]};return db[_0xa3f8('0x34')]['findOne']({'where':{'id':_0x45bcac[_0xa3f8('0x4c')]['id']}})[_0xa3f8('0x2b')](handleEntityNotFound(_0x3096d0,null))[_0xa3f8('0x2b')](function(_0x42e3f8){if(_0x42e3f8){_0x27de61[_0xa3f8('0x36')]=_[_0xa3f8('0x37')](db[_0xa3f8('0x5d')]['rawAttributes']);_0x27de61[_0xa3f8('0x38')]=_[_0xa3f8('0x37')](_0x45bcac['query']);_0x27de61[_0xa3f8('0x39')]=_[_0xa3f8('0x3a')](_0x27de61[_0xa3f8('0x36')],_0x27de61[_0xa3f8('0x38')]);_0x185b38[_0xa3f8('0x3c')]=_[_0xa3f8('0x3a')](_0x27de61[_0xa3f8('0x36')],qs['fields'](_0x45bcac['query'][_0xa3f8('0x3b')]));_0x185b38['attributes']=_0x185b38[_0xa3f8('0x3c')][_0xa3f8('0x4d')]?_0x185b38[_0xa3f8('0x3c')]:_0x27de61[_0xa3f8('0x36')];if(!_0x45bcac[_0xa3f8('0x38')][_0xa3f8('0x3d')](_0xa3f8('0x5f'))){_0x185b38[_0xa3f8('0x26')]=qs[_0xa3f8('0x26')](_0x45bcac[_0xa3f8('0x38')][_0xa3f8('0x26')]);_0x185b38[_0xa3f8('0x25')]=qs[_0xa3f8('0x25')](_0x45bcac['query'][_0xa3f8('0x25')]);}_0x185b38[_0xa3f8('0x3e')]=qs[_0xa3f8('0x3f')](_0x45bcac[_0xa3f8('0x38')][_0xa3f8('0x3f')]);_0x185b38[_0xa3f8('0x43')]=qs['filters'](_[_0xa3f8('0x40')](_0x45bcac[_0xa3f8('0x38')],_0x27de61[_0xa3f8('0x39')]));_0x185b38[_0xa3f8('0x43')][_0xa3f8('0x5c')]=_0x42e3f8['id'];if(_0x45bcac[_0xa3f8('0x38')][_0xa3f8('0x41')]){_0x185b38[_0xa3f8('0x43')]=_[_0xa3f8('0x42')](_0x185b38[_0xa3f8('0x43')],{'$or':_[_0xa3f8('0x44')](_0x185b38['attributes'],function(_0x14de37){var _0x1b6343={};_0x1b6343[_0x14de37]={'$like':'%'+_0x45bcac['query']['filter']+'%'};return _0x1b6343;})});}_0x185b38=_[_0xa3f8('0x42')]({},_0x185b38,_0x45bcac[_0xa3f8('0x47')]);return db[_0xa3f8('0x5d')][_0xa3f8('0x60')]({'where':_0x185b38[_0xa3f8('0x43')]})[_0xa3f8('0x2b')](function(_0xe06bc2){_0x356643[_0xa3f8('0x60')]=_0xe06bc2;if(_0x45bcac['query'][_0xa3f8('0x4e')]){_0x185b38[_0xa3f8('0x48')]=[{'all':!![]}];}return db[_0xa3f8('0x5d')]['findAll'](_0x185b38);})[_0xa3f8('0x2b')](function(_0x150446){_0x356643['rows']=_0x150446;return _0x356643;});}})[_0xa3f8('0x2b')](respondWithFilteredResult(_0x3096d0,_0x185b38))[_0xa3f8('0x4a')](handleError(_0x3096d0,null));};exports[_0xa3f8('0x61')]=function(_0x14a5b5,_0x162436,_0x1c17b9){return db[_0xa3f8('0x34')][_0xa3f8('0x4f')]({'where':{'id':_0x14a5b5[_0xa3f8('0x4c')]['id']}})['then'](handleEntityNotFound(_0x162436,null))[_0xa3f8('0x2b')](function(_0x57841d){if(_0x57841d){return _0x57841d[_0xa3f8('0x61')](_0x14a5b5['query'][_0xa3f8('0x62')]);}})[_0xa3f8('0x2b')](respondWithStatusCode(_0x162436,null))[_0xa3f8('0x4a')](handleError(_0x162436,null));};exports[_0xa3f8('0x63')]=function(_0x1f7354,_0x54a972,_0x1d7604){return db[_0xa3f8('0x34')]['find']({'where':{'id':_0x1f7354[_0xa3f8('0x4c')]['id']}})[_0xa3f8('0x2b')](handleEntityNotFound(_0x54a972,null))[_0xa3f8('0x2b')](function(_0x3cdbc8){if(_0x3cdbc8){var _0x281009=[];var _0x41e9c2={'success':[],'errors':[]};return db['CmContact'][_0xa3f8('0x5a')]()[_0xa3f8('0x2b')](function(_0x42534e){if(_0x1f7354['body'][_0xa3f8('0x64')]&&_['isArray'](_0x1f7354[_0xa3f8('0x51')]['tags'])){if(_0x1f7354['body'][_0xa3f8('0x64')]['length']){_0x1f7354[_0xa3f8('0x51')]['tags']=_0x1f7354[_0xa3f8('0x51')][_0xa3f8('0x64')][_0xa3f8('0x65')](';')+';';}else{_0x1f7354[_0xa3f8('0x51')]['tags']=null;}}else{_0x1f7354[_0xa3f8('0x51')][_0xa3f8('0x64')]=null;}if(_0x1f7354['body']&&_[_0xa3f8('0x66')](_0x1f7354[_0xa3f8('0x51')])){for(var _0x3715ea=0x0;_0x3715ea<_0x1f7354[_0xa3f8('0x51')][_0xa3f8('0x4d')];_0x3715ea+=0x1){_0x1f7354[_0xa3f8('0x51')][_0x3715ea][_0xa3f8('0x5c')]=_0x1f7354[_0xa3f8('0x4c')]['id'];_0x281009[_0xa3f8('0x67')](_0x1f7354[_0xa3f8('0x51')][_0x3715ea]);}return BPromise['each'](_0x281009,function(_0x7dc5ec){return db[_0xa3f8('0x68')][_0xa3f8('0x50')](_[_0xa3f8('0x69')](_0x7dc5ec,[_0xa3f8('0x62'),'id'])||{},{'fields':_[_0xa3f8('0x37')](_0x42534e),'raw':!![]})[_0xa3f8('0x2b')](function(_0x315ef1){_0x41e9c2[_0xa3f8('0x6a')]['push'](_0x315ef1[_0xa3f8('0x6b')]);})[_0xa3f8('0x4a')](function(_0x3f6834){_0x41e9c2[_0xa3f8('0x6c')][_0xa3f8('0x67')]({'data':_0x7dc5ec,'error':_0x3f6834[_0xa3f8('0x6d')]});});})['then'](function(_0x24fe62){return _0x41e9c2;})[_0xa3f8('0x4a')](function(_0x224199){return _0x224199;});}else{_0x54a972[_0xa3f8('0x23')](0x190)['json']({'message':_0xa3f8('0x6e')});}});}})[_0xa3f8('0x2b')](respondWithResult(_0x54a972,null))[_0xa3f8('0x4a')](handleError(_0x54a972,null));};exports[_0xa3f8('0x6f')]=function(_0x21e530,_0x2db7dd,_0x12fe03){var _0x21a676;return db[_0xa3f8('0x34')][_0xa3f8('0x4f')]({'where':{'id':_0x21e530[_0xa3f8('0x4c')]['id']},'include':[{'model':db['CmCustomField'],'as':_0xa3f8('0x70')}]})['then'](handleEntityNotFound(_0x2db7dd,null))[_0xa3f8('0x2b')](function(_0x355922){if(_0x355922){_0x21a676=_0x355922;return db[_0xa3f8('0x68')][_0xa3f8('0x35')];}})[_0xa3f8('0x2b')](function(_0x324c8b){if(_0x324c8b){var _0x3d9702={};var _0x365688={};_0x365688['model']=_[_0xa3f8('0x71')](_['keys'](_0x324c8b),_[_0xa3f8('0x44')](_0x21a676['CustomFields'],function(_0x2d2883){return util['format'](_0xa3f8('0x72'),_0x2d2883['id']);}));_0x365688[_0xa3f8('0x38')]=_[_0xa3f8('0x37')](_0x21e530[_0xa3f8('0x38')]);_0x365688['filters']=_[_0xa3f8('0x3a')](_0x365688[_0xa3f8('0x36')],_0x365688[_0xa3f8('0x38')]);_0x3d9702[_0xa3f8('0x3c')]=_[_0xa3f8('0x3a')](_0x365688[_0xa3f8('0x36')],qs['fields'](_0x21e530[_0xa3f8('0x38')][_0xa3f8('0x3b')]));_0x3d9702[_0xa3f8('0x3c')]=_0x3d9702[_0xa3f8('0x3c')][_0xa3f8('0x4d')]?_0x3d9702['attributes']:_0x365688[_0xa3f8('0x36')];if(!_0x21e530[_0xa3f8('0x38')]['hasOwnProperty'](_0xa3f8('0x5f'))){_0x3d9702[_0xa3f8('0x26')]=qs[_0xa3f8('0x26')](_0x21e530['query'][_0xa3f8('0x26')]);_0x3d9702[_0xa3f8('0x25')]=qs[_0xa3f8('0x25')](_0x21e530[_0xa3f8('0x38')][_0xa3f8('0x25')]);}_0x3d9702[_0xa3f8('0x3e')]=qs[_0xa3f8('0x3f')](_0x21e530['query'][_0xa3f8('0x3f')]);_0x3d9702[_0xa3f8('0x43')]=qs['filters'](_[_0xa3f8('0x40')](_0x21e530[_0xa3f8('0x38')],_0x365688[_0xa3f8('0x39')]));_0x3d9702[_0xa3f8('0x73')]=!![];if(_0x21e530[_0xa3f8('0x38')][_0xa3f8('0x41')]){_0x3d9702[_0xa3f8('0x43')]=_['merge'](_0x3d9702[_0xa3f8('0x43')],{'$or':_[_0xa3f8('0x44')](_0x3d9702[_0xa3f8('0x3c')],function(_0x2eaf1e){var _0x39494d={};_0x39494d[_0x2eaf1e]={'$like':'%'+_0x21e530[_0xa3f8('0x38')][_0xa3f8('0x41')]+'%'};return _0x39494d;})});}_0x3d9702=_['merge']({},_0x3d9702,_0x21e530[_0xa3f8('0x47')]);return _0x21a676[_0xa3f8('0x6f')](_0x3d9702);}})[_0xa3f8('0x2b')](respondWithResult(_0x2db7dd,null))[_0xa3f8('0x4a')](handleError(_0x2db7dd,null));};exports['getContactsCsv']=function(_0x5098df,_0x223cd5,_0x5152a1){var _0x36f6c4;return db[_0xa3f8('0x34')][_0xa3f8('0x4f')]({'where':{'id':_0x5098df['params']['id']},'include':[{'model':db['CmCustomField'],'as':_0xa3f8('0x70')}]})[_0xa3f8('0x2b')](handleEntityNotFound(_0x223cd5,null))[_0xa3f8('0x2b')](function(_0x2edbad){if(_0x2edbad){_0x36f6c4=_0x2edbad;return db['CmContact'][_0xa3f8('0x35')];}})['then'](function(_0x1f7488){if(_0x1f7488){var _0x12abed={};var _0x285497={};_0x285497['model']=_['concat'](_['keys'](_0x1f7488),_[_0xa3f8('0x44')](_0x36f6c4[_0xa3f8('0x70')],function(_0x2635c4){return util[_0xa3f8('0x74')](_0xa3f8('0x72'),_0x2635c4['id']);}));_0x285497[_0xa3f8('0x38')]=_[_0xa3f8('0x37')](_0x5098df[_0xa3f8('0x38')]);_0x285497['filters']=_[_0xa3f8('0x3a')](_0x285497[_0xa3f8('0x36')],_0x285497[_0xa3f8('0x38')]);_0x12abed['attributes']=_[_0xa3f8('0x3a')](_0x285497[_0xa3f8('0x36')],qs['fields'](_0x5098df[_0xa3f8('0x38')][_0xa3f8('0x3b')]));_0x12abed['attributes']=_0x12abed[_0xa3f8('0x3c')][_0xa3f8('0x4d')]?_0x12abed['attributes']:_0x285497[_0xa3f8('0x36')];if(!_0x5098df[_0xa3f8('0x38')][_0xa3f8('0x3d')]('nolimit')){_0x12abed[_0xa3f8('0x26')]=qs[_0xa3f8('0x26')](_0x5098df[_0xa3f8('0x38')][_0xa3f8('0x26')]);_0x12abed[_0xa3f8('0x25')]=qs['offset'](_0x5098df['query'][_0xa3f8('0x25')]);}_0x12abed[_0xa3f8('0x3e')]=qs[_0xa3f8('0x3f')](_0x5098df[_0xa3f8('0x38')]['sort']);_0x12abed[_0xa3f8('0x43')]=qs[_0xa3f8('0x39')](_[_0xa3f8('0x40')](_0x5098df[_0xa3f8('0x38')],_0x285497[_0xa3f8('0x39')]));_0x12abed[_0xa3f8('0x73')]=!![];if(_0x5098df[_0xa3f8('0x38')][_0xa3f8('0x41')]){_0x12abed['where']=_[_0xa3f8('0x42')](_0x12abed['where'],{'$or':_[_0xa3f8('0x44')](_0x12abed['attributes'],function(_0x48b9e2){var _0x1be3de={};_0x1be3de[_0x48b9e2]={'$like':'%'+_0x5098df[_0xa3f8('0x38')][_0xa3f8('0x41')]+'%'};return _0x1be3de;})});}_0x12abed=_[_0xa3f8('0x42')]({},_0x12abed,_0x5098df[_0xa3f8('0x47')]);return _0x36f6c4['getContacts'](_0x12abed);}})['then'](function(_0x10c7ee){if(!_[_0xa3f8('0x75')](_0x10c7ee)){var _0x350c73=toCsv(_0x10c7ee);var _0x1b8240=Date[_0xa3f8('0x76')]();fs[_0xa3f8('0x77')](util['format'](_0xa3f8('0x78'),_0x36f6c4['id'],_0x1b8240),_0x350c73);_0x223cd5[_0xa3f8('0x79')]('Content-disposition','attachment;\x20filename='+util[_0xa3f8('0x74')](_0xa3f8('0x7a'),_0x36f6c4['id'],_0x1b8240));_0x223cd5['setHeader'](_0xa3f8('0x7b'),_0xa3f8('0x7c'));return _0x223cd5[_0xa3f8('0x7d')](util[_0xa3f8('0x74')](_0xa3f8('0x78'),_0x36f6c4['id'],_0x1b8240));}else{return _0x223cd5[_0xa3f8('0x22')](0xcc);}})[_0xa3f8('0x4a')](handleError(_0x223cd5,null));};exports['addCustomField']=function(_0x234636,_0x44bcff,_0x56f2cf){var _0x4f888b;delete _0x234636[_0xa3f8('0x51')]['id'];return db[_0xa3f8('0x34')][_0xa3f8('0x7e')]({'where':{'id':_0x234636[_0xa3f8('0x4c')]['id']}})[_0xa3f8('0x2b')](handleEntityNotFound(_0x44bcff,null))[_0xa3f8('0x2b')](function(_0x18ab67){if(_0x18ab67){return db[_0xa3f8('0x7f')][_0xa3f8('0x80')](function(_0x1b84bc){return db[_0xa3f8('0x81')]['create'](_0x234636[_0xa3f8('0x51')],{'transaction':_0x1b84bc})['then'](function(_0x4931b6){_0x4f888b=_0x4931b6;return _0x18ab67[_0xa3f8('0x82')](_0x4931b6,{'transaction':_0x1b84bc});})[_0xa3f8('0x2b')](function(){var _0x3314cc={'type':db[_0xa3f8('0x83')][_0xa3f8('0x84')],'transaction':_0x1b84bc};switch(_0x234636[_0xa3f8('0x51')]['type']){case'text':_0x3314cc[_0xa3f8('0x45')]=db[_0xa3f8('0x83')][_0xa3f8('0x84')];break;case _0xa3f8('0x85'):_0x3314cc[_0xa3f8('0x45')]=db[_0xa3f8('0x83')]['INTEGER'];break;case'switch':_0x3314cc[_0xa3f8('0x45')]=db[_0xa3f8('0x83')][_0xa3f8('0x86')];_0x3314cc[_0xa3f8('0x87')]=![];break;default:}return db[_0xa3f8('0x7f')][_0xa3f8('0x88')]['addColumn']('cm_contacts',util[_0xa3f8('0x74')](_0xa3f8('0x89'),_0x4f888b['id']),_0x3314cc);})[_0xa3f8('0x2b')](function(){return _0x4f888b;});});}})['then'](respondWithResult(_0x44bcff,null))[_0xa3f8('0x4a')](handleError(_0x44bcff,null));};exports[_0xa3f8('0x8a')]=function(_0x4afe30,_0x10d644,_0x4ec83f){var _0x44a1c5={};var _0x47ac1e={};var _0x4a4404;var _0x3367f3;return db[_0xa3f8('0x34')][_0xa3f8('0x7e')]({'where':{'id':_0x4afe30[_0xa3f8('0x4c')]['id']}})['then'](handleEntityNotFound(_0x10d644,null))[_0xa3f8('0x2b')](function(_0x1669be){if(_0x1669be){_0x4a4404=_0x1669be;_0x47ac1e['model']=_[_0xa3f8('0x37')](db[_0xa3f8('0x81')][_0xa3f8('0x35')]);_0x47ac1e[_0xa3f8('0x38')]=_[_0xa3f8('0x37')](_0x4afe30[_0xa3f8('0x38')]);_0x47ac1e[_0xa3f8('0x39')]=_[_0xa3f8('0x3a')](_0x47ac1e[_0xa3f8('0x36')],_0x47ac1e['query']);_0x44a1c5[_0xa3f8('0x3c')]=_[_0xa3f8('0x3a')](_0x47ac1e[_0xa3f8('0x36')],qs[_0xa3f8('0x3b')](_0x4afe30[_0xa3f8('0x38')][_0xa3f8('0x3b')]));_0x44a1c5[_0xa3f8('0x3c')]=_0x44a1c5[_0xa3f8('0x3c')]['length']?_0x44a1c5[_0xa3f8('0x3c')]:_0x47ac1e[_0xa3f8('0x36')];_0x44a1c5['order']=qs[_0xa3f8('0x3f')](_0x4afe30[_0xa3f8('0x38')]['sort']);_0x44a1c5[_0xa3f8('0x43')]=qs[_0xa3f8('0x39')](_['pick'](_0x4afe30[_0xa3f8('0x38')],_0x47ac1e[_0xa3f8('0x39')]));_0x44a1c5['where']=_[_0xa3f8('0x42')](_0x44a1c5[_0xa3f8('0x43')],{'$or':[{'ListId':_0x1669be['id']},{'ListId':null}]});if(_0x4afe30['query']['filter']){_0x44a1c5[_0xa3f8('0x43')]=_[_0xa3f8('0x42')](_0x44a1c5[_0xa3f8('0x43')],{'$or':_['map'](_0x44a1c5['attributes'],function(_0x2cfaa2){var _0x1ad4d8={};_0x1ad4d8[_0x2cfaa2]={'$like':'%'+_0x4afe30['query'][_0xa3f8('0x41')]+'%'};return _0x1ad4d8;})});}_0x44a1c5=_['merge']({},_0x44a1c5,_0x4afe30[_0xa3f8('0x47')]);return db['CmCustomField'][_0xa3f8('0x8b')](_0x44a1c5);}})['then'](respondWithResult(_0x10d644,null))['catch'](handleError(_0x10d644,null));};exports[_0xa3f8('0x8c')]=function(_0x5ac693,_0x44da32,_0x2e1f5e){return db[_0xa3f8('0x34')][_0xa3f8('0x4f')]({'where':{'id':_0x5ac693[_0xa3f8('0x4c')]['id']}})[_0xa3f8('0x2b')](handleEntityNotFound(_0x44da32,null))[_0xa3f8('0x2b')](function(_0xc0b505){if(_0xc0b505){return _0xc0b505[_0xa3f8('0x8c')](_0x5ac693['body'][_0xa3f8('0x62')],_[_0xa3f8('0x69')](_0x5ac693[_0xa3f8('0x51')],[_0xa3f8('0x62'),'id'])||{})[_0xa3f8('0x8d')](function(_0x3147ca){for(var _0x29c730=0x0;_0x29c730<_0x5ac693[_0xa3f8('0x51')][_0xa3f8('0x62')][_0xa3f8('0x4d')];_0x29c730+=0x1){socket[_0xa3f8('0x8e')](_0xa3f8('0x8f'),{'UserId':_0x5ac693[_0xa3f8('0x51')]['ids'][_0x29c730],'CmListId':_0x5ac693[_0xa3f8('0x4c')]['id']});}return _0x3147ca;});}})[_0xa3f8('0x2b')](respondWithResult(_0x44da32,null))[_0xa3f8('0x4a')](handleError(_0x44da32,null));};exports[_0xa3f8('0x90')]=function(_0x38b4ef,_0x24b0af,_0x58ba21){return db[_0xa3f8('0x34')][_0xa3f8('0x4f')]({'where':{'id':_0x38b4ef[_0xa3f8('0x4c')]['id']}})[_0xa3f8('0x2b')](handleEntityNotFound(_0x24b0af,null))[_0xa3f8('0x2b')](function(_0x7cc3d0){if(_0x7cc3d0){return _0x7cc3d0[_0xa3f8('0x90')](_0x38b4ef[_0xa3f8('0x38')][_0xa3f8('0x62')])[_0xa3f8('0x2b')](function(){if(_[_0xa3f8('0x66')](_0x38b4ef[_0xa3f8('0x38')][_0xa3f8('0x62')])){for(var _0x8def6a=0x0;_0x8def6a<_0x38b4ef[_0xa3f8('0x38')][_0xa3f8('0x62')][_0xa3f8('0x4d')];_0x8def6a+=0x1){socket[_0xa3f8('0x8e')](_0xa3f8('0x91'),{'UserId':Number(_0x38b4ef[_0xa3f8('0x38')][_0xa3f8('0x62')][_0x8def6a]),'CmListId':Number(_0x38b4ef[_0xa3f8('0x4c')]['id'])});}}else{socket[_0xa3f8('0x8e')](_0xa3f8('0x91'),{'UserId':Number(_0x38b4ef['query'][_0xa3f8('0x62')]),'CmListId':Number(_0x38b4ef['params']['id'])});}});}})[_0xa3f8('0x2b')](respondWithStatusCode(_0x24b0af,null))[_0xa3f8('0x4a')](handleError(_0x24b0af,null));};exports[_0xa3f8('0x92')]=function(_0x3753bf,_0x351885,_0x1cc3a8){var _0x28b4d8={};var _0x3fd139={};var _0x2295cc;var _0x25e64c;return db[_0xa3f8('0x34')][_0xa3f8('0x7e')]({'where':{'id':_0x3753bf[_0xa3f8('0x4c')]['id']}})[_0xa3f8('0x2b')](handleEntityNotFound(_0x351885,null))[_0xa3f8('0x2b')](function(_0x39debb){if(_0x39debb){_0x2295cc=_0x39debb;_0x3fd139[_0xa3f8('0x36')]=_['keys'](db[_0xa3f8('0x93')][_0xa3f8('0x35')]);_0x3fd139['query']=_[_0xa3f8('0x37')](_0x3753bf[_0xa3f8('0x38')]);_0x3fd139[_0xa3f8('0x39')]=_[_0xa3f8('0x3a')](_0x3fd139['model'],_0x3fd139['query']);_0x28b4d8[_0xa3f8('0x3c')]=_[_0xa3f8('0x3a')](_0x3fd139[_0xa3f8('0x36')],qs['fields'](_0x3753bf[_0xa3f8('0x38')][_0xa3f8('0x3b')]));_0x28b4d8['attributes']=_0x28b4d8[_0xa3f8('0x3c')][_0xa3f8('0x4d')]?_0x28b4d8[_0xa3f8('0x3c')]:_0x3fd139[_0xa3f8('0x36')];_0x28b4d8['order']=qs[_0xa3f8('0x3f')](_0x3753bf[_0xa3f8('0x38')][_0xa3f8('0x3f')]);_0x28b4d8[_0xa3f8('0x43')]=qs[_0xa3f8('0x39')](_[_0xa3f8('0x40')](_0x3753bf['query'],_0x3fd139['filters']));if(_0x3753bf[_0xa3f8('0x38')]['filter']){_0x28b4d8[_0xa3f8('0x43')]=_[_0xa3f8('0x42')](_0x28b4d8[_0xa3f8('0x43')],{'$or':_['map'](_0x28b4d8[_0xa3f8('0x3c')],function(_0x53a067){var _0x5a12c7={};_0x5a12c7[_0x53a067]={'$like':'%'+_0x3753bf[_0xa3f8('0x38')]['filter']+'%'};return _0x5a12c7;})});}_0x28b4d8=_['merge']({},_0x28b4d8,_0x3753bf[_0xa3f8('0x47')]);return _0x2295cc[_0xa3f8('0x92')](_0x28b4d8);}})[_0xa3f8('0x2b')](function(_0x148877){if(_0x148877){_0x25e64c=_0x148877[_0xa3f8('0x4d')];if(!_0x3753bf[_0xa3f8('0x38')][_0xa3f8('0x3d')](_0xa3f8('0x5f'))){_0x28b4d8[_0xa3f8('0x26')]=qs[_0xa3f8('0x26')](_0x3753bf[_0xa3f8('0x38')]['limit']);_0x28b4d8[_0xa3f8('0x25')]=qs[_0xa3f8('0x25')](_0x3753bf['query'][_0xa3f8('0x25')]);}return _0x2295cc[_0xa3f8('0x92')](_0x28b4d8);}})['then'](function(_0x195209){if(_0x195209){return _0x195209?{'count':_0x25e64c,'rows':_0x195209}:null;}})[_0xa3f8('0x2b')](respondWithResult(_0x351885,null))[_0xa3f8('0x4a')](handleError(_0x351885,null));}; \ No newline at end of file diff --git a/server/api/cmList/cmList.events.js b/server/api/cmList/cmList.events.js index 5e978ce..fdff99b 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 _0x83fa=['hook','exports','events','../../mysqldb','save','remove'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x83fa,0x134));var _0xa83f=function(_0x54d4a8,_0x585a59){_0x54d4a8=_0x54d4a8-0x0;var _0x3b321b=_0x83fa[_0x54d4a8];return _0x3b321b;};'use strict';var EventEmitter=require(_0xa83f('0x0'));var CmList=require(_0xa83f('0x1'))['db']['CmList'];var CmListEvents=new EventEmitter();CmListEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xa83f('0x2'),'afterUpdate':'update','afterDestroy':_0xa83f('0x3')};function emitEvent(_0x4f6c15){return function(_0x33c951,_0x1c58fa,_0x103363){CmListEvents['emit'](_0x4f6c15+':'+_0x33c951['id'],_0x33c951);CmListEvents['emit'](_0x4f6c15,_0x33c951);_0x103363(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];CmList[_0xa83f('0x4')](e,emitEvent(event));}}module[_0xa83f('0x5')]=CmListEvents; \ No newline at end of file +var _0x9f17=['hook','events','../../mysqldb','CmList','setMaxListeners','save','update','remove','emit'];(function(_0x4dc770,_0x362b51){var _0x4ccc4d=function(_0x438b1a){while(--_0x438b1a){_0x4dc770['push'](_0x4dc770['shift']());}};_0x4ccc4d(++_0x362b51);}(_0x9f17,0x1cc));var _0x79f1=function(_0x53292e,_0x427913){_0x53292e=_0x53292e-0x0;var _0x4f0c61=_0x9f17[_0x53292e];return _0x4f0c61;};'use strict';var EventEmitter=require(_0x79f1('0x0'));var CmList=require(_0x79f1('0x1'))['db'][_0x79f1('0x2')];var CmListEvents=new EventEmitter();CmListEvents[_0x79f1('0x3')](0x0);var events={'afterCreate':_0x79f1('0x4'),'afterUpdate':_0x79f1('0x5'),'afterDestroy':_0x79f1('0x6')};function emitEvent(_0xd6a2ca){return function(_0x208208,_0x48af02,_0x23e506){CmListEvents['emit'](_0xd6a2ca+':'+_0x208208['id'],_0x208208);CmListEvents[_0x79f1('0x7')](_0xd6a2ca,_0x208208);_0x23e506(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];CmList[_0x79f1('0x8')](e,emitEvent(event));}}module['exports']=CmListEvents; \ No newline at end of file diff --git a/server/api/cmList/cmList.model.js b/server/api/cmList/cmList.model.js index 62dfe76..4286d60 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 _0x83eb=['util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmList.attributes','exports','define','CmList','lodash'];(function(_0x92910,_0x263c7b){var _0x9690b3=function(_0x126273){while(--_0x126273){_0x92910['push'](_0x92910['shift']());}};_0x9690b3(++_0x263c7b);}(_0x83eb,0x1b9));var _0xb83e=function(_0x353f22,_0x3293cd){_0x353f22=_0x353f22-0x0;var _0x4cabe4=_0x83eb[_0x353f22];return _0x4cabe4;};'use strict';var _=require(_0xb83e('0x0'));var util=require(_0xb83e('0x1'));var logger=require(_0xb83e('0x2'))('api');var moment=require(_0xb83e('0x3'));var BPromise=require(_0xb83e('0x4'));var rp=require(_0xb83e('0x5'));var fs=require('fs');var path=require(_0xb83e('0x6'));var rimraf=require(_0xb83e('0x7'));var config=require(_0xb83e('0x8'));var attributes=require(_0xb83e('0x9'));module[_0xb83e('0xa')]=function(_0x2a6cdb,_0xda01e6){return _0x2a6cdb[_0xb83e('0xb')](_0xb83e('0xc'),attributes,{'tableName':'cm_lists','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe722=['request-promise','rimraf','../../config/environment','./cmList.attributes','exports','CmList','cm_lists','lodash','util','../../config/logger','api','moment'];(function(_0x4455bc,_0x25c254){var _0x721c22=function(_0x29e62e){while(--_0x29e62e){_0x4455bc['push'](_0x4455bc['shift']());}};_0x721c22(++_0x25c254);}(_0xe722,0x1b7));var _0x2e72=function(_0x51c819,_0xd812db){_0x51c819=_0x51c819-0x0;var _0x15c5d2=_0xe722[_0x51c819];return _0x15c5d2;};'use strict';var _=require(_0x2e72('0x0'));var util=require(_0x2e72('0x1'));var logger=require(_0x2e72('0x2'))(_0x2e72('0x3'));var moment=require(_0x2e72('0x4'));var BPromise=require('bluebird');var rp=require(_0x2e72('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2e72('0x6'));var config=require(_0x2e72('0x7'));var attributes=require(_0x2e72('0x8'));module[_0x2e72('0x9')]=function(_0x39c64,_0xb508ae){return _0x39c64['define'](_0x2e72('0xa'),attributes,{'tableName':_0x2e72('0xb'),'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 c0bc968..e395112 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 _0xc639=['code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./cmList.socket','register','request','then','info','CmList,\x20%s,\x20%s','request\x20sent','debug','CmList,\x20%s,\x20%s,\x20%s','error'];(function(_0x20ef49,_0x544e35){var _0x34966c=function(_0x1532ef){while(--_0x1532ef){_0x20ef49['push'](_0x20ef49['shift']());}};_0x34966c(++_0x544e35);}(_0xc639,0xfc));var _0x9c63=function(_0x37777e,_0x3584f7){_0x37777e=_0x37777e-0x0;var _0x4782bc=_0xc639[_0x37777e];return _0x4782bc;};'use strict';var _=require(_0x9c63('0x0'));var util=require(_0x9c63('0x1'));var moment=require(_0x9c63('0x2'));var BPromise=require(_0x9c63('0x3'));var rs=require(_0x9c63('0x4'));var fs=require('fs');var Redis=require(_0x9c63('0x5'));var db=require(_0x9c63('0x6'))['db'];var utils=require(_0x9c63('0x7'));var logger=require(_0x9c63('0x8'))(_0x9c63('0x9'));var config=require(_0x9c63('0xa'));var jayson=require(_0x9c63('0xb'));var client=jayson[_0x9c63('0xc')][_0x9c63('0xd')]({'port':0x232a});config[_0x9c63('0xe')]=_[_0x9c63('0xf')](config[_0x9c63('0xe')],{'host':_0x9c63('0x10'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9c63('0xe')]));require(_0x9c63('0x11'))[_0x9c63('0x12')](socket);function respondWithRpcPromise(_0x173f01,_0x318f1b,_0x51cfb3){return new BPromise(function(_0x202b54,_0x2241cc){return client[_0x9c63('0x13')](_0x173f01,_0x51cfb3)[_0x9c63('0x14')](function(_0x3c1fd8){logger[_0x9c63('0x15')](_0x9c63('0x16'),_0x318f1b,_0x9c63('0x17'));logger[_0x9c63('0x18')](_0x9c63('0x19'),_0x318f1b,'request\x20sent',JSON['stringify'](_0x3c1fd8));if(_0x3c1fd8['error']){if(_0x3c1fd8[_0x9c63('0x1a')][_0x9c63('0x1b')]===0x1f4){logger['error'](_0x9c63('0x16'),_0x318f1b,_0x3c1fd8['error']['message']);return _0x2241cc(_0x3c1fd8[_0x9c63('0x1a')][_0x9c63('0x1c')]);}logger['error'](_0x9c63('0x16'),_0x318f1b,_0x3c1fd8[_0x9c63('0x1a')][_0x9c63('0x1c')]);return _0x202b54(_0x3c1fd8['error'][_0x9c63('0x1c')]);}else{logger['info'](_0x9c63('0x16'),_0x318f1b,_0x9c63('0x17'));_0x202b54(_0x3c1fd8[_0x9c63('0x1d')][_0x9c63('0x1c')]);}})[_0x9c63('0x1e')](function(_0x91f40c){logger['error'](_0x9c63('0x16'),_0x318f1b,_0x91f40c);_0x2241cc(_0x91f40c);});});} \ No newline at end of file +var _0x7ddc=['../../config/environment','client','redis','defaults','localhost','socket.io-emitter','./cmList.socket','register','then','info','CmList,\x20%s,\x20%s','request\x20sent','debug','CmList,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x7ddc,0xe3));var _0xc7dd=function(_0x3b8f9a,_0x370acf){_0x3b8f9a=_0x3b8f9a-0x0;var _0xdc6021=_0x7ddc[_0x3b8f9a];return _0xdc6021;};'use strict';var _=require(_0xc7dd('0x0'));var util=require(_0xc7dd('0x1'));var moment=require(_0xc7dd('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc7dd('0x3'));var db=require(_0xc7dd('0x4'))['db'];var utils=require(_0xc7dd('0x5'));var logger=require('../../config/logger')(_0xc7dd('0x6'));var config=require(_0xc7dd('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xc7dd('0x8')]['http']({'port':0x232a});config[_0xc7dd('0x9')]=_[_0xc7dd('0xa')](config[_0xc7dd('0x9')],{'host':_0xc7dd('0xb'),'port':0x18eb});var socket=require(_0xc7dd('0xc'))(new Redis(config['redis']));require(_0xc7dd('0xd'))[_0xc7dd('0xe')](socket);function respondWithRpcPromise(_0x27a89d,_0x283a80,_0x4a0b3c){return new BPromise(function(_0x172195,_0x4bdec7){return client['request'](_0x27a89d,_0x4a0b3c)[_0xc7dd('0xf')](function(_0x2ca881){logger[_0xc7dd('0x10')](_0xc7dd('0x11'),_0x283a80,_0xc7dd('0x12'));logger[_0xc7dd('0x13')](_0xc7dd('0x14'),_0x283a80,_0xc7dd('0x12'),JSON[_0xc7dd('0x15')](_0x2ca881));if(_0x2ca881['error']){if(_0x2ca881[_0xc7dd('0x16')]['code']===0x1f4){logger['error'](_0xc7dd('0x11'),_0x283a80,_0x2ca881[_0xc7dd('0x16')]['message']);return _0x4bdec7(_0x2ca881[_0xc7dd('0x16')][_0xc7dd('0x17')]);}logger[_0xc7dd('0x16')](_0xc7dd('0x11'),_0x283a80,_0x2ca881['error'][_0xc7dd('0x17')]);return _0x172195(_0x2ca881[_0xc7dd('0x16')][_0xc7dd('0x17')]);}else{logger['info']('CmList,\x20%s,\x20%s',_0x283a80,'request\x20sent');_0x172195(_0x2ca881[_0xc7dd('0x18')][_0xc7dd('0x17')]);}})[_0xc7dd('0x19')](function(_0x3b980d){logger[_0xc7dd('0x16')](_0xc7dd('0x11'),_0x283a80,_0x3b980d);_0x4bdec7(_0x3b980d);});});} \ No newline at end of file diff --git a/server/api/cmList/cmList.socket.js b/server/api/cmList/cmList.socket.js index 74709fe..8de8ab6 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 _0xdfa0=['./cmList.events','remove','update','emit','register','length','cmList:'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xdfa0,0x69));var _0x0dfa=function(_0xc95a5d,_0x5ee92a){_0xc95a5d=_0xc95a5d-0x0;var _0x20aae7=_0xdfa0[_0xc95a5d];return _0x20aae7;};'use strict';var CmListEvents=require(_0x0dfa('0x0'));var events=['save',_0x0dfa('0x1'),_0x0dfa('0x2')];function createListener(_0x4cd9ac,_0x139d96){return function(_0x45a28e){_0x139d96[_0x0dfa('0x3')](_0x4cd9ac,_0x45a28e);};}function removeListener(_0x4dbbab,_0x373c4e){return function(){CmListEvents['removeListener'](_0x4dbbab,_0x373c4e);};}exports[_0x0dfa('0x4')]=function(_0x2efe20){for(var _0x4830b6=0x0,_0x417f7a=events[_0x0dfa('0x5')];_0x4830b6<_0x417f7a;_0x4830b6++){var _0x32280b=events[_0x4830b6];var _0x16070c=createListener(_0x0dfa('0x6')+_0x32280b,_0x2efe20);CmListEvents['on'](_0x32280b,_0x16070c);}}; \ No newline at end of file +var _0x5697=['remove','update','removeListener','length','cmList:','./cmList.events'];(function(_0x2984d0,_0x1a7211){var _0x2885f2=function(_0x42f3da){while(--_0x42f3da){_0x2984d0['push'](_0x2984d0['shift']());}};_0x2885f2(++_0x1a7211);}(_0x5697,0x1b5));var _0x7569=function(_0x2b5ee5,_0x3741bf){_0x2b5ee5=_0x2b5ee5-0x0;var _0x1c480b=_0x5697[_0x2b5ee5];return _0x1c480b;};'use strict';var CmListEvents=require(_0x7569('0x0'));var events=['save',_0x7569('0x1'),_0x7569('0x2')];function createListener(_0x14218a,_0x5c6bbc){return function(_0x5a06a6){_0x5c6bbc['emit'](_0x14218a,_0x5a06a6);};}function removeListener(_0x499e06,_0x48340f){return function(){CmListEvents[_0x7569('0x3')](_0x499e06,_0x48340f);};}exports['register']=function(_0x5705bd){for(var _0x5afe12=0x0,_0x149fa1=events[_0x7569('0x4')];_0x5afe12<_0x149fa1;_0x5afe12++){var _0x30b7e2=events[_0x5afe12];var _0xee5a4=createListener(_0x7569('0x5')+_0x30b7e2,_0x5705bd);CmListEvents['on'](_0x30b7e2,_0xee5a4);}}; \ No newline at end of file diff --git a/server/api/cmList/index.js b/server/api/cmList/index.js index db8b273..c5bcf76 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 _0xcf38=['getAgents','post','create','addDisposition','/:id/fields','addAgents','put','update','destroy','delete','removeAgents','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/dispositions','getDispositions','/:id/contacts','getContacts','/:id/contacts/csv','getContactsCsv','getCustomFields','/:id/users'];(function(_0x3530f8,_0xff5208){var _0x5dfc08=function(_0x3d75dc){while(--_0x3d75dc){_0x3530f8['push'](_0x3530f8['shift']());}};_0x5dfc08(++_0xff5208);}(_0xcf38,0xd7));var _0x8cf3=function(_0x261054,_0x34bb90){_0x261054=_0x261054-0x0;var _0x5a32d2=_0xcf38[_0x261054];return _0x5a32d2;};'use strict';var multer=require(_0x8cf3('0x0'));var util=require(_0x8cf3('0x1'));var path=require(_0x8cf3('0x2'));var timeout=require(_0x8cf3('0x3'));var express=require(_0x8cf3('0x4'));var router=express[_0x8cf3('0x5')]();var auth=require(_0x8cf3('0x6'));var interaction=require(_0x8cf3('0x7'));var config=require('../../config/environment');var controller=require('./cmList.controller');router[_0x8cf3('0x8')]('/',auth['isAuthenticated'](),controller[_0x8cf3('0x9')]);router[_0x8cf3('0x8')](_0x8cf3('0xa'),auth[_0x8cf3('0xb')](),controller[_0x8cf3('0xc')]);router[_0x8cf3('0x8')](_0x8cf3('0xd'),auth[_0x8cf3('0xb')](),controller[_0x8cf3('0xe')]);router['get'](_0x8cf3('0xf'),auth[_0x8cf3('0xb')](),controller[_0x8cf3('0x10')]);router[_0x8cf3('0x8')](_0x8cf3('0x11'),auth['isAuthenticated'](),controller[_0x8cf3('0x12')]);router[_0x8cf3('0x8')](_0x8cf3('0x13'),auth[_0x8cf3('0xb')](),controller[_0x8cf3('0x14')]);router[_0x8cf3('0x8')]('/:id/fields',auth[_0x8cf3('0xb')](),controller[_0x8cf3('0x15')]);router[_0x8cf3('0x8')](_0x8cf3('0x16'),auth['isAuthenticated'](),controller[_0x8cf3('0x17')]);router[_0x8cf3('0x18')]('/',auth[_0x8cf3('0xb')](),controller[_0x8cf3('0x19')]);router['post'](_0x8cf3('0xf'),auth[_0x8cf3('0xb')](),controller[_0x8cf3('0x1a')]);router['post'](_0x8cf3('0x11'),auth[_0x8cf3('0xb')](),controller['addContacts']);router[_0x8cf3('0x18')](_0x8cf3('0x1b'),auth[_0x8cf3('0xb')](),controller['addCustomField']);router[_0x8cf3('0x18')](_0x8cf3('0x16'),auth[_0x8cf3('0xb')](),controller[_0x8cf3('0x1c')]);router[_0x8cf3('0x1d')]('/:id',auth[_0x8cf3('0xb')](),controller[_0x8cf3('0x1e')]);router['delete'](_0x8cf3('0xd'),auth[_0x8cf3('0xb')](),controller[_0x8cf3('0x1f')]);router['delete'](_0x8cf3('0xf'),auth['isAuthenticated'](),controller['removeDispositions']);router[_0x8cf3('0x20')](_0x8cf3('0x16'),auth['isAuthenticated'](),controller[_0x8cf3('0x21')]);module['exports']=router; \ No newline at end of file +var _0xbde3=['/:id/contacts','/:id/contacts/csv','getContactsCsv','/:id/users','getAgents','post','create','addContacts','/:id/fields','addCustomField','addAgents','delete','destroy','removeDispositions','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmList.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/dispositions','getDispositions'];(function(_0x1cfa0d,_0x4391f2){var _0xe33279=function(_0x3ce7c1){while(--_0x3ce7c1){_0x1cfa0d['push'](_0x1cfa0d['shift']());}};_0xe33279(++_0x4391f2);}(_0xbde3,0x18e));var _0x3bde=function(_0x2c1a27,_0x4cd2d9){_0x2c1a27=_0x2c1a27-0x0;var _0x58a7f7=_0xbde3[_0x2c1a27];return _0x58a7f7;};'use strict';var multer=require(_0x3bde('0x0'));var util=require(_0x3bde('0x1'));var path=require(_0x3bde('0x2'));var timeout=require(_0x3bde('0x3'));var express=require(_0x3bde('0x4'));var router=express[_0x3bde('0x5')]();var auth=require(_0x3bde('0x6'));var interaction=require(_0x3bde('0x7'));var config=require(_0x3bde('0x8'));var controller=require(_0x3bde('0x9'));router[_0x3bde('0xa')]('/',auth[_0x3bde('0xb')](),controller['index']);router['get'](_0x3bde('0xc'),auth[_0x3bde('0xb')](),controller[_0x3bde('0xd')]);router[_0x3bde('0xa')](_0x3bde('0xe'),auth['isAuthenticated'](),controller[_0x3bde('0xf')]);router[_0x3bde('0xa')](_0x3bde('0x10'),auth[_0x3bde('0xb')](),controller[_0x3bde('0x11')]);router[_0x3bde('0xa')](_0x3bde('0x12'),auth[_0x3bde('0xb')](),controller['getContacts']);router[_0x3bde('0xa')](_0x3bde('0x13'),auth[_0x3bde('0xb')](),controller[_0x3bde('0x14')]);router['get']('/:id/fields',auth[_0x3bde('0xb')](),controller['getCustomFields']);router[_0x3bde('0xa')](_0x3bde('0x15'),auth[_0x3bde('0xb')](),controller[_0x3bde('0x16')]);router[_0x3bde('0x17')]('/',auth['isAuthenticated'](),controller[_0x3bde('0x18')]);router[_0x3bde('0x17')]('/:id/dispositions',auth[_0x3bde('0xb')](),controller['addDisposition']);router['post'](_0x3bde('0x12'),auth[_0x3bde('0xb')](),controller[_0x3bde('0x19')]);router[_0x3bde('0x17')](_0x3bde('0x1a'),auth['isAuthenticated'](),controller[_0x3bde('0x1b')]);router['post'](_0x3bde('0x15'),auth[_0x3bde('0xb')](),controller[_0x3bde('0x1c')]);router['put'](_0x3bde('0xe'),auth[_0x3bde('0xb')](),controller['update']);router[_0x3bde('0x1d')](_0x3bde('0xe'),auth[_0x3bde('0xb')](),controller[_0x3bde('0x1e')]);router[_0x3bde('0x1d')](_0x3bde('0x10'),auth['isAuthenticated'](),controller[_0x3bde('0x1f')]);router[_0x3bde('0x1d')](_0x3bde('0x15'),auth[_0x3bde('0xb')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file diff --git a/server/api/condition/condition.attributes.js b/server/api/condition/condition.attributes.js index dc3a913..aad0580 100644 --- a/server/api/condition/condition.attributes.js +++ b/server/api/condition/condition.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['field','STRING','sequelize','exports','VIRTUAL'];(function(_0x23f59e,_0x1152dc){var _0x2c3c1e=function(_0x3b128a){while(--_0x3b128a){_0x23f59e['push'](_0x23f59e['shift']());}};_0x2c3c1e(++_0x1152dc);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'use strict';var Sequelize=require(_0x7995('0x0'));module[_0x7995('0x1')]={'name':{'type':Sequelize[_0x7995('0x2')],'get':function(_0x10a05d){return this['getDataValue'](_0x7995('0x3'));}},'field':{'type':Sequelize[_0x7995('0x4')],'allowNull':![]},'operator':{'type':Sequelize[_0x7995('0x4')],'allowNull':![]},'value':{'type':Sequelize[_0x7995('0x4')],'allowNull':![]}}; \ No newline at end of file +var _0xa9e0=['STRING','sequelize','exports','VIRTUAL','field'];(function(_0x22f151,_0x8a1637){var _0x16a7b4=function(_0x584f4a){while(--_0x584f4a){_0x22f151['push'](_0x22f151['shift']());}};_0x16a7b4(++_0x8a1637);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3e112d,_0x2bb132){_0x3e112d=_0x3e112d-0x0;var _0x531c31=_0xa9e0[_0x3e112d];return _0x531c31;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'name':{'type':Sequelize[_0x0a9e('0x2')],'get':function(_0x5dd881){return this['getDataValue'](_0x0a9e('0x3'));}},'field':{'type':Sequelize['STRING'],'allowNull':![]},'operator':{'type':Sequelize[_0x0a9e('0x4')],'allowNull':![]},'value':{'type':Sequelize[_0x0a9e('0x4')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/condition/condition.controller.js b/server/api/condition/condition.controller.js index b318254..6c0d108 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 _0x0132=['reject','save','update','then','destroy','sendStatus','name','body','Condition','find','catch','params','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','path','sox','ejs','lodash','crypto','jsforce','to-csv','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','count','offset','set','Content-Range','apply'];(function(_0x24259d,_0x64a194){var _0x5a701=function(_0x204516){while(--_0x204516){_0x24259d['push'](_0x24259d['shift']());}};_0x5a701(++_0x64a194);}(_0x0132,0xfc));var _0x2013=function(_0x428f5f,_0x335ec1){_0x428f5f=_0x428f5f-0x0;var _0x5f18cf=_0x0132[_0x428f5f];return _0x5f18cf;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x2013('0x0'));var rimraf=require(_0x2013('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2013('0x2'));var rp=require('request-promise');var moment=require(_0x2013('0x3'));var BPromise=require(_0x2013('0x4'));var Mustache=require(_0x2013('0x5'));var util=require('util');var path=require(_0x2013('0x6'));var sox=require(_0x2013('0x7'));var csv=require('to-csv');var ejs=require(_0x2013('0x8'));var fs=require('fs');var _=require(_0x2013('0x9'));var squel=require('squel');var crypto=require(_0x2013('0xa'));var jsforce=require(_0x2013('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x2013('0xc'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x2013('0xd'));var authService=require(_0x2013('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2013('0xf'));var logger=require('../../config/logger')(_0x2013('0x10'));var utils=require(_0x2013('0x11'));var config=require(_0x2013('0x12'));var db=require(_0x2013('0x13'))['db'];function respondWithStatusCode(_0x21c420,_0x3be569){_0x3be569=_0x3be569||0xcc;return function(_0x5100b1){if(_0x5100b1){return _0x21c420['sendStatus'](_0x3be569);}return _0x21c420[_0x2013('0x14')](_0x3be569)[_0x2013('0x15')]();};}function respondWithResult(_0x18c911,_0x3b427c){_0x3b427c=_0x3b427c||0xc8;return function(_0x3663ab){if(_0x3663ab){return _0x18c911[_0x2013('0x14')](_0x3b427c)[_0x2013('0x16')](_0x3663ab);}};}function respondWithFilteredResult(_0x1b8f77,_0x46911d){return function(_0x76fc7e){if(_0x76fc7e){var _0x465db9=_0x76fc7e[_0x2013('0x17')],_0x434fee=_0x46911d[_0x2013('0x18')],_0x246bc3=_0x46911d['offset']+_0x46911d['limit'],_0x4a1e2e;if(_0x246bc3>=_0x465db9){_0x246bc3=_0x465db9;_0x4a1e2e=0xc8;}else{_0x4a1e2e=0xce;}_0x1b8f77['status'](_0x4a1e2e);return _0x1b8f77[_0x2013('0x19')](_0x2013('0x1a'),_0x434fee+'-'+_0x246bc3+'/'+_0x465db9)[_0x2013('0x16')](_0x76fc7e);}return null;};}function patchUpdates(_0x144385){return function(_0x1c1651){try{jsonpatch[_0x2013('0x1b')](_0x1c1651,_0x144385,!![]);}catch(_0x54a5be){return BPromise[_0x2013('0x1c')](_0x54a5be);}return _0x1c1651[_0x2013('0x1d')]();};}function saveUpdates(_0x226e38,_0x59b0b6){return function(_0x545f39){if(_0x545f39){return _0x545f39[_0x2013('0x1e')](_0x226e38)[_0x2013('0x1f')](function(_0x4f6ff5){return _0x4f6ff5;});}return null;};}function removeEntity(_0x2b5cc4,_0x2abf8b){return function(_0x186ccd){if(_0x186ccd){return _0x186ccd[_0x2013('0x20')]()[_0x2013('0x1f')](function(){_0x2b5cc4[_0x2013('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5ac77f,_0x245574){return function(_0x59be09){if(!_0x59be09){_0x5ac77f[_0x2013('0x21')](0x194);}return _0x59be09;};}function handleError(_0x29ba11,_0x5e52a4){_0x5e52a4=_0x5e52a4||0x1f4;return function(_0x1932cd){logger['error'](_0x1932cd['stack']);if(_0x1932cd[_0x2013('0x22')]){delete _0x1932cd[_0x2013('0x22')];}_0x29ba11[_0x2013('0x14')](_0x5e52a4)['send'](_0x1932cd);};}exports[_0x2013('0x1e')]=function(_0x583b53,_0x458199){if(_0x583b53[_0x2013('0x23')]['id']){delete _0x583b53[_0x2013('0x23')]['id'];}return db[_0x2013('0x24')][_0x2013('0x25')]({'where':{'id':_0x583b53['params']['id']}})[_0x2013('0x1f')](handleEntityNotFound(_0x458199,null))['then'](saveUpdates(_0x583b53[_0x2013('0x23')],null))[_0x2013('0x1f')](respondWithResult(_0x458199,null))[_0x2013('0x26')](handleError(_0x458199,null));};exports[_0x2013('0x20')]=function(_0x3854c1,_0x4fac06){return db[_0x2013('0x24')][_0x2013('0x25')]({'where':{'id':_0x3854c1[_0x2013('0x27')]['id']}})[_0x2013('0x1f')](handleEntityNotFound(_0x4fac06,null))[_0x2013('0x1f')](removeEntity(_0x4fac06,null))['catch'](handleError(_0x4fac06,null));}; \ No newline at end of file +var _0x90c1=['mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','Content-Range','apply','save','update','then','destroy','end','error','name','send','body','Condition','find','params','catch','html-pdf','zip-dir','fast-json-patch','request-promise','bluebird'];(function(_0x4237da,_0x48b1fd){var _0x343b83=function(_0x515574){while(--_0x515574){_0x4237da['push'](_0x4237da['shift']());}};_0x343b83(++_0x48b1fd);}(_0x90c1,0x109));var _0x190c=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x90c1[_0x17d9e3];return _0x14192d;};'use strict';var pdf=require(_0x190c('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x190c('0x1'));var jsonpatch=require(_0x190c('0x2'));var rp=require(_0x190c('0x3'));var moment=require('moment');var BPromise=require(_0x190c('0x4'));var Mustache=require(_0x190c('0x5'));var util=require(_0x190c('0x6'));var path=require(_0x190c('0x7'));var sox=require(_0x190c('0x8'));var csv=require(_0x190c('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x190c('0xa'));var squel=require(_0x190c('0xb'));var crypto=require(_0x190c('0xc'));var jsforce=require(_0x190c('0xd'));var deskjs=require(_0x190c('0xe'));var toCsv=require(_0x190c('0x9'));var querystring=require(_0x190c('0xf'));var Papa=require(_0x190c('0x10'));var Redis=require(_0x190c('0x11'));var authService=require(_0x190c('0x12'));var qs=require(_0x190c('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x190c('0x14'));var logger=require('../../config/logger')(_0x190c('0x15'));var utils=require(_0x190c('0x16'));var config=require(_0x190c('0x17'));var db=require(_0x190c('0x18'))['db'];function respondWithStatusCode(_0x2a1912,_0x35b23b){_0x35b23b=_0x35b23b||0xcc;return function(_0x14db29){if(_0x14db29){return _0x2a1912[_0x190c('0x19')](_0x35b23b);}return _0x2a1912[_0x190c('0x1a')](_0x35b23b)['end']();};}function respondWithResult(_0x573540,_0x16b8a5){_0x16b8a5=_0x16b8a5||0xc8;return function(_0x53f08c){if(_0x53f08c){return _0x573540[_0x190c('0x1a')](_0x16b8a5)[_0x190c('0x1b')](_0x53f08c);}};}function respondWithFilteredResult(_0x523ac8,_0x34319d){return function(_0x179e96){if(_0x179e96){var _0x24333c=_0x179e96[_0x190c('0x1c')],_0x532d22=_0x34319d[_0x190c('0x1d')],_0x6dcd46=_0x34319d['offset']+_0x34319d['limit'],_0xecd22a;if(_0x6dcd46>=_0x24333c){_0x6dcd46=_0x24333c;_0xecd22a=0xc8;}else{_0xecd22a=0xce;}_0x523ac8[_0x190c('0x1a')](_0xecd22a);return _0x523ac8['set'](_0x190c('0x1e'),_0x532d22+'-'+_0x6dcd46+'/'+_0x24333c)[_0x190c('0x1b')](_0x179e96);}return null;};}function patchUpdates(_0x274c6f){return function(_0x4ecb04){try{jsonpatch[_0x190c('0x1f')](_0x4ecb04,_0x274c6f,!![]);}catch(_0x4067ce){return BPromise['reject'](_0x4067ce);}return _0x4ecb04[_0x190c('0x20')]();};}function saveUpdates(_0x2796d1,_0x4fd59f){return function(_0x745b0b){if(_0x745b0b){return _0x745b0b[_0x190c('0x21')](_0x2796d1)[_0x190c('0x22')](function(_0x4e6432){return _0x4e6432;});}return null;};}function removeEntity(_0x54cac2,_0x591a16){return function(_0x1fa8ce){if(_0x1fa8ce){return _0x1fa8ce[_0x190c('0x23')]()[_0x190c('0x22')](function(){_0x54cac2[_0x190c('0x1a')](0xcc)[_0x190c('0x24')]();});}};}function handleEntityNotFound(_0x4f4a56,_0x2ee7c3){return function(_0x3ca7f9){if(!_0x3ca7f9){_0x4f4a56[_0x190c('0x19')](0x194);}return _0x3ca7f9;};}function handleError(_0x339829,_0x1df41b){_0x1df41b=_0x1df41b||0x1f4;return function(_0x45a0a7){logger[_0x190c('0x25')](_0x45a0a7['stack']);if(_0x45a0a7['name']){delete _0x45a0a7[_0x190c('0x26')];}_0x339829[_0x190c('0x1a')](_0x1df41b)[_0x190c('0x27')](_0x45a0a7);};}exports[_0x190c('0x21')]=function(_0x4d91a8,_0x2a47a9){if(_0x4d91a8[_0x190c('0x28')]['id']){delete _0x4d91a8['body']['id'];}return db[_0x190c('0x29')][_0x190c('0x2a')]({'where':{'id':_0x4d91a8[_0x190c('0x2b')]['id']}})[_0x190c('0x22')](handleEntityNotFound(_0x2a47a9,null))[_0x190c('0x22')](saveUpdates(_0x4d91a8[_0x190c('0x28')],null))['then'](respondWithResult(_0x2a47a9,null))[_0x190c('0x2c')](handleError(_0x2a47a9,null));};exports['destroy']=function(_0x322ed9,_0x90008a){return db[_0x190c('0x29')][_0x190c('0x2a')]({'where':{'id':_0x322ed9['params']['id']}})[_0x190c('0x22')](handleEntityNotFound(_0x90008a,null))[_0x190c('0x22')](removeEntity(_0x90008a,null))[_0x190c('0x2c')](handleError(_0x90008a,null));}; \ No newline at end of file diff --git a/server/api/condition/condition.model.js b/server/api/condition/condition.model.js index d07803d..705ec80 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 _0xd2fe=['../../config/environment','define','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x1080bd,_0xdb61fe){var _0x5c1331=function(_0x452bfd){while(--_0x452bfd){_0x1080bd['push'](_0x1080bd['shift']());}};_0x5c1331(++_0xdb61fe);}(_0xd2fe,0x11a));var _0xed2f=function(_0x184bc7,_0x526cb7){_0x184bc7=_0x184bc7-0x0;var _0x3b1b69=_0xd2fe[_0x184bc7];return _0x3b1b69;};'use strict';var _=require(_0xed2f('0x0'));var util=require(_0xed2f('0x1'));var logger=require(_0xed2f('0x2'))(_0xed2f('0x3'));var moment=require(_0xed2f('0x4'));var BPromise=require(_0xed2f('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xed2f('0x6'));var rimraf=require(_0xed2f('0x7'));var config=require(_0xed2f('0x8'));var attributes=require('./condition.attributes');module['exports']=function(_0xcaf13a,_0x4b069a){return _0xcaf13a[_0xed2f('0x9')]('Condition',attributes,{'tableName':'tools_conditions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7264=['exports','define','Condition','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./condition.attributes'];(function(_0x48f813,_0x3f6625){var _0x4864e5=function(_0x164c3d){while(--_0x164c3d){_0x48f813['push'](_0x48f813['shift']());}};_0x4864e5(++_0x3f6625);}(_0x7264,0xab));var _0x4726=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x7264[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0x4726('0x0'));var util=require('util');var logger=require(_0x4726('0x1'))('api');var moment=require(_0x4726('0x2'));var BPromise=require(_0x4726('0x3'));var rp=require(_0x4726('0x4'));var fs=require('fs');var path=require(_0x4726('0x5'));var rimraf=require(_0x4726('0x6'));var config=require(_0x4726('0x7'));var attributes=require(_0x4726('0x8'));module[_0x4726('0x9')]=function(_0x1eedf4,_0x49c261){return _0x1eedf4[_0x4726('0xa')](_0x4726('0xb'),attributes,{'tableName':'tools_conditions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/condition/condition.rpc.js b/server/api/condition/condition.rpc.js index bdf366f..9261459 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 _0x3fd6=['then','info','Condition,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http'];(function(_0x19f9e6,_0x4f59a6){var _0x45c862=function(_0x3447fb){while(--_0x3447fb){_0x19f9e6['push'](_0x19f9e6['shift']());}};_0x45c862(++_0x4f59a6);}(_0x3fd6,0xda));var _0x63fd=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x3fd6[_0x3ab51d];return _0x29a04e;};'use strict';var _=require(_0x63fd('0x0'));var util=require('util');var moment=require(_0x63fd('0x1'));var BPromise=require(_0x63fd('0x2'));var rs=require(_0x63fd('0x3'));var fs=require('fs');var Redis=require(_0x63fd('0x4'));var db=require(_0x63fd('0x5'))['db'];var utils=require(_0x63fd('0x6'));var logger=require(_0x63fd('0x7'))(_0x63fd('0x8'));var config=require('../../config/environment');var jayson=require(_0x63fd('0x9'));var client=jayson[_0x63fd('0xa')][_0x63fd('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1b9605,_0x3a5d9d,_0x535f69){return new BPromise(function(_0x526f04,_0x44be80){return client['request'](_0x1b9605,_0x535f69)[_0x63fd('0xc')](function(_0x39bb4a){logger[_0x63fd('0xd')](_0x63fd('0xe'),_0x3a5d9d,_0x63fd('0xf'));logger[_0x63fd('0x10')]('Condition,\x20%s,\x20%s,\x20%s',_0x3a5d9d,_0x63fd('0xf'),JSON[_0x63fd('0x11')](_0x39bb4a));if(_0x39bb4a[_0x63fd('0x12')]){if(_0x39bb4a[_0x63fd('0x12')][_0x63fd('0x13')]===0x1f4){logger[_0x63fd('0x12')](_0x63fd('0xe'),_0x3a5d9d,_0x39bb4a[_0x63fd('0x12')][_0x63fd('0x14')]);return _0x44be80(_0x39bb4a[_0x63fd('0x12')][_0x63fd('0x14')]);}logger[_0x63fd('0x12')](_0x63fd('0xe'),_0x3a5d9d,_0x39bb4a[_0x63fd('0x12')]['message']);return _0x526f04(_0x39bb4a[_0x63fd('0x12')][_0x63fd('0x14')]);}else{logger['info']('Condition,\x20%s,\x20%s',_0x3a5d9d,_0x63fd('0xf'));_0x526f04(_0x39bb4a[_0x63fd('0x15')][_0x63fd('0x14')]);}})[_0x63fd('0x16')](function(_0x146f5d){logger['error'](_0x63fd('0xe'),_0x3a5d9d,_0x146f5d);_0x44be80(_0x146f5d);});});} \ No newline at end of file +var _0x6673=['jayson/promise','client','http','request','then','debug','Condition,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','Condition,\x20%s,\x20%s','message','info','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment'];(function(_0x56a0d0,_0xbedd1f){var _0x48ed26=function(_0x1e13e3){while(--_0x1e13e3){_0x56a0d0['push'](_0x56a0d0['shift']());}};_0x48ed26(++_0xbedd1f);}(_0x6673,0x1ee));var _0x3667=function(_0x273c39,_0x1052e6){_0x273c39=_0x273c39-0x0;var _0x46d6b5=_0x6673[_0x273c39];return _0x46d6b5;};'use strict';var _=require(_0x3667('0x0'));var util=require(_0x3667('0x1'));var moment=require(_0x3667('0x2'));var BPromise=require(_0x3667('0x3'));var rs=require(_0x3667('0x4'));var fs=require('fs');var Redis=require(_0x3667('0x5'));var db=require(_0x3667('0x6'))['db'];var utils=require(_0x3667('0x7'));var logger=require(_0x3667('0x8'))('rpc');var config=require(_0x3667('0x9'));var jayson=require(_0x3667('0xa'));var client=jayson[_0x3667('0xb')][_0x3667('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1401ab,_0x35e997,_0x415e54){return new BPromise(function(_0x4ab7e8,_0x58470a){return client[_0x3667('0xd')](_0x1401ab,_0x415e54)[_0x3667('0xe')](function(_0xdaac74){logger['info']('Condition,\x20%s,\x20%s',_0x35e997,'request\x20sent');logger[_0x3667('0xf')](_0x3667('0x10'),_0x35e997,_0x3667('0x11'),JSON[_0x3667('0x12')](_0xdaac74));if(_0xdaac74[_0x3667('0x13')]){if(_0xdaac74[_0x3667('0x13')][_0x3667('0x14')]===0x1f4){logger['error'](_0x3667('0x15'),_0x35e997,_0xdaac74['error'][_0x3667('0x16')]);return _0x58470a(_0xdaac74[_0x3667('0x13')][_0x3667('0x16')]);}logger[_0x3667('0x13')](_0x3667('0x15'),_0x35e997,_0xdaac74[_0x3667('0x13')]['message']);return _0x4ab7e8(_0xdaac74[_0x3667('0x13')]['message']);}else{logger[_0x3667('0x17')](_0x3667('0x15'),_0x35e997,_0x3667('0x11'));_0x4ab7e8(_0xdaac74['result'][_0x3667('0x16')]);}})['catch'](function(_0x539683){logger[_0x3667('0x13')](_0x3667('0x15'),_0x35e997,_0x539683);_0x58470a(_0x539683);});});} \ No newline at end of file diff --git a/server/api/condition/index.js b/server/api/condition/index.js index dc6b1ce..c043c3e 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 _0x657a=['update','delete','destroy','exports','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./condition.controller','put','/:id','isAuthenticated'];(function(_0x458d60,_0x218dd5){var _0x5b12e6=function(_0x6aaa42){while(--_0x6aaa42){_0x458d60['push'](_0x458d60['shift']());}};_0x5b12e6(++_0x218dd5);}(_0x657a,0x6d));var _0xa657=function(_0x46c9cc,_0xd27dca){_0x46c9cc=_0x46c9cc-0x0;var _0x21b46e=_0x657a[_0x46c9cc];return _0x21b46e;};'use strict';var multer=require('multer');var util=require(_0xa657('0x0'));var path=require('path');var timeout=require(_0xa657('0x1'));var express=require(_0xa657('0x2'));var router=express[_0xa657('0x3')]();var auth=require(_0xa657('0x4'));var interaction=require(_0xa657('0x5'));var config=require(_0xa657('0x6'));var controller=require(_0xa657('0x7'));router[_0xa657('0x8')](_0xa657('0x9'),auth[_0xa657('0xa')](),controller[_0xa657('0xb')]);router[_0xa657('0xc')](_0xa657('0x9'),auth[_0xa657('0xa')](),controller[_0xa657('0xd')]);module[_0xa657('0xe')]=router; \ No newline at end of file +var _0x7f26=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./condition.controller','put','/:id','isAuthenticated','update','delete','exports','multer','util','connect-timeout','express'];(function(_0x92b0a,_0x334664){var _0x35a537=function(_0x223263){while(--_0x223263){_0x92b0a['push'](_0x92b0a['shift']());}};_0x35a537(++_0x334664);}(_0x7f26,0x182));var _0x67f2=function(_0x482d0e,_0x46da02){_0x482d0e=_0x482d0e-0x0;var _0x4b5bdc=_0x7f26[_0x482d0e];return _0x4b5bdc;};'use strict';var multer=require(_0x67f2('0x0'));var util=require(_0x67f2('0x1'));var path=require('path');var timeout=require(_0x67f2('0x2'));var express=require(_0x67f2('0x3'));var router=express[_0x67f2('0x4')]();var auth=require(_0x67f2('0x5'));var interaction=require(_0x67f2('0x6'));var config=require(_0x67f2('0x7'));var controller=require(_0x67f2('0x8'));router[_0x67f2('0x9')](_0x67f2('0xa'),auth[_0x67f2('0xb')](),controller[_0x67f2('0xc')]);router[_0x67f2('0xd')]('/:id',auth[_0x67f2('0xb')](),controller['destroy']);module[_0x67f2('0xe')]=router; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.attributes.js b/server/api/dashboard/dashboard.attributes.js index ab6592e..16d2dc8 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 _0xcfeb=['STRING','name','sequelize','exports'];(function(_0x4f44ed,_0x3ada7f){var _0x2cceea=function(_0x13f174){while(--_0x13f174){_0x4f44ed['push'](_0x4f44ed['shift']());}};_0x2cceea(++_0x3ada7f);}(_0xcfeb,0x1b2));var _0xbcfe=function(_0x925b23,_0x2c501e){_0x925b23=_0x925b23-0x0;var _0x4a8019=_0xcfeb[_0x925b23];return _0x4a8019;};'use strict';var Sequelize=require(_0xbcfe('0x0'));module[_0xbcfe('0x1')]={'name':{'type':Sequelize[_0xbcfe('0x2')],'allowNull':![],'unique':_0xbcfe('0x3')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x536e=['name','sequelize','exports','STRING'];(function(_0x5ac0f0,_0xee4d98){var _0x4aceec=function(_0x3a9044){while(--_0x3a9044){_0x5ac0f0['push'](_0x5ac0f0['shift']());}};_0x4aceec(++_0xee4d98);}(_0x536e,0x155));var _0xe536=function(_0x5fe5ca,_0x4e92d3){_0x5fe5ca=_0x5fe5ca-0x0;var _0x42f45f=_0x536e[_0x5fe5ca];return _0x42f45f;};'use strict';var Sequelize=require(_0xe536('0x0'));module[_0xe536('0x1')]={'name':{'type':Sequelize[_0xe536('0x2')],'allowNull':![],'unique':_0xe536('0x3')},'description':{'type':Sequelize[_0xe536('0x2')]}}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.controller.js b/server/api/dashboard/dashboard.controller.js index 09aba9b..0ea78f4 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 _0xa53a=['key','VIRTUAL','field','options','Dashboard','include','rows','catch','params','length','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','UserProfileResource','clone','omit','createdAt','updatedAt','role','update','type','iframe','attrUrl','attrs','value','https://','custom','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','web-report','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','stringify','DashboardId','DashboardItem','getItems','order','sort','filter','hasOwnProperty','html-pdf','zip-dir','fast-json-patch','request-promise','mustache','util','path','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','status','json','count','set','Content-Range','apply','reject','save','destroy','then','get','CustomDashboards','end','sendStatus','error','name','send','index','rawAttributes','model','query','keys','filters','intersection','attributes','fields','nolimit','limit','offset','where','pick','merge','map'];(function(_0x4bd950,_0x184ed5){var _0x5dc59a=function(_0x6ff30f){while(--_0x6ff30f){_0x4bd950['push'](_0x4bd950['shift']());}};_0x5dc59a(++_0x184ed5);}(_0xa53a,0xb8));var _0xaa53=function(_0x14ad09,_0x48d29b){_0x14ad09=_0x14ad09-0x0;var _0x4b5ce3=_0xa53a[_0x14ad09];return _0x4b5ce3;};'use strict';var pdf=require(_0xaa53('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xaa53('0x1'));var jsonpatch=require(_0xaa53('0x2'));var rp=require(_0xaa53('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xaa53('0x4'));var util=require(_0xaa53('0x5'));var path=require(_0xaa53('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xaa53('0x7'));var fs=require('fs');var _=require(_0xaa53('0x8'));var squel=require(_0xaa53('0x9'));var crypto=require(_0xaa53('0xa'));var jsforce=require(_0xaa53('0xb'));var deskjs=require(_0xaa53('0xc'));var toCsv=require(_0xaa53('0xd'));var querystring=require('querystring');var Papa=require(_0xaa53('0xe'));var Redis=require(_0xaa53('0xf'));var authService=require(_0xaa53('0x10'));var qs=require(_0xaa53('0x11'));var as=require(_0xaa53('0x12'));var hardwareService=require(_0xaa53('0x13'));var logger=require('../../config/logger')(_0xaa53('0x14'));var utils=require(_0xaa53('0x15'));var config=require(_0xaa53('0x16'));var db=require(_0xaa53('0x17'))['db'];config[_0xaa53('0x18')]=_[_0xaa53('0x19')](config[_0xaa53('0x18')],{'host':_0xaa53('0x1a'),'port':0x18eb});var socket=require(_0xaa53('0x1b'))(new Redis(config[_0xaa53('0x18')]));require('./dashboard.socket')[_0xaa53('0x1c')](socket);function respondWithStatusCode(_0x277706,_0x4c381d){_0x4c381d=_0x4c381d||0xcc;return function(_0x29ab20){if(_0x29ab20){return _0x277706['sendStatus'](_0x4c381d);}return _0x277706[_0xaa53('0x1d')](_0x4c381d)['end']();};}function respondWithResult(_0x46be55,_0x137744){_0x137744=_0x137744||0xc8;return function(_0x242c21){if(_0x242c21){return _0x46be55[_0xaa53('0x1d')](_0x137744)[_0xaa53('0x1e')](_0x242c21);}};}function respondWithFilteredResult(_0x3238ce,_0xfe1f28){return function(_0x67a733){if(_0x67a733){var _0x11a702=_0x67a733[_0xaa53('0x1f')],_0x40e0a4=_0xfe1f28['offset'],_0x37eefe=_0xfe1f28['offset']+_0xfe1f28['limit'],_0x46b390;if(_0x37eefe>=_0x11a702){_0x37eefe=_0x11a702;_0x46b390=0xc8;}else{_0x46b390=0xce;}_0x3238ce[_0xaa53('0x1d')](_0x46b390);return _0x3238ce[_0xaa53('0x20')](_0xaa53('0x21'),_0x40e0a4+'-'+_0x37eefe+'/'+_0x11a702)[_0xaa53('0x1e')](_0x67a733);}return null;};}function patchUpdates(_0x4b6e33){return function(_0x485480){try{jsonpatch[_0xaa53('0x22')](_0x485480,_0x4b6e33,!![]);}catch(_0x3d6c30){return BPromise[_0xaa53('0x23')](_0x3d6c30);}return _0x485480[_0xaa53('0x24')]();};}function saveUpdates(_0x5cd392,_0x170540){return function(_0x300750){if(_0x300750){return _0x300750['update'](_0x5cd392)['then'](function(_0x477470){return _0x477470;});}return null;};}function removeEntity(_0x38fc64,_0x4d8edb){return function(_0xf2aebc){if(_0xf2aebc){return _0xf2aebc[_0xaa53('0x25')]()[_0xaa53('0x26')](function(){var _0x167279=_0xf2aebc[_0xaa53('0x27')]({'plain':!![]});var _0x5ae59c=_0xaa53('0x28');return db['UserProfileResource'][_0xaa53('0x25')]({'where':{'type':_0x5ae59c,'resourceId':_0x167279['id']}})[_0xaa53('0x26')](function(){return _0xf2aebc;});})[_0xaa53('0x26')](function(){_0x38fc64[_0xaa53('0x1d')](0xcc)[_0xaa53('0x29')]();});}};}function handleEntityNotFound(_0x355823,_0x248aa4){return function(_0x3238e0){if(!_0x3238e0){_0x355823[_0xaa53('0x2a')](0x194);}return _0x3238e0;};}function handleError(_0x56fe5e,_0x35e9cc){_0x35e9cc=_0x35e9cc||0x1f4;return function(_0x124ee5){logger[_0xaa53('0x2b')](_0x124ee5['stack']);if(_0x124ee5[_0xaa53('0x2c')]){delete _0x124ee5['name'];}_0x56fe5e[_0xaa53('0x1d')](_0x35e9cc)[_0xaa53('0x2d')](_0x124ee5);};}exports[_0xaa53('0x2e')]=function(_0x5a96be,_0x5e2128){var _0x27494f={},_0x23a55d={},_0xcac2d={'count':0x0,'rows':[]};var _0xacc7cc=db['Dashboard'][_0xaa53('0x2f')];_0x23a55d[_0xaa53('0x30')]=_['keys'](_0xacc7cc);_0x23a55d[_0xaa53('0x31')]=_[_0xaa53('0x32')](_0x5a96be[_0xaa53('0x31')]);_0x23a55d[_0xaa53('0x33')]=_[_0xaa53('0x34')](_0x23a55d[_0xaa53('0x30')],_0x23a55d[_0xaa53('0x31')]);_0x27494f[_0xaa53('0x35')]=_['intersection'](_0x23a55d[_0xaa53('0x30')],qs[_0xaa53('0x36')](_0x5a96be['query'][_0xaa53('0x36')]));_0x27494f[_0xaa53('0x35')]=_0x27494f[_0xaa53('0x35')]['length']?_0x27494f[_0xaa53('0x35')]:_0x23a55d[_0xaa53('0x30')];if(!_0x5a96be[_0xaa53('0x31')]['hasOwnProperty'](_0xaa53('0x37'))){_0x27494f[_0xaa53('0x38')]=qs[_0xaa53('0x38')](_0x5a96be[_0xaa53('0x31')]['limit']);_0x27494f[_0xaa53('0x39')]=qs[_0xaa53('0x39')](_0x5a96be[_0xaa53('0x31')][_0xaa53('0x39')]);}_0x27494f['order']=qs['sort'](_0x5a96be[_0xaa53('0x31')]['sort']);_0x27494f[_0xaa53('0x3a')]=qs[_0xaa53('0x33')](_[_0xaa53('0x3b')](_0x5a96be[_0xaa53('0x31')],_0x23a55d[_0xaa53('0x33')]));if(_0x5a96be['query']['filter']){_0x27494f[_0xaa53('0x3a')]=_[_0xaa53('0x3c')](_0x27494f[_0xaa53('0x3a')],{'$or':_[_0xaa53('0x3d')](_0xacc7cc,function(_0x45bd0b){if(_0x45bd0b['type'][_0xaa53('0x3e')]!==_0xaa53('0x3f')){var _0x3f7e25={};_0x3f7e25[_0x45bd0b[_0xaa53('0x40')]]={'$like':'%'+_0x5a96be['query']['filter']+'%'};return _0x3f7e25;}})});}_0x27494f=_['merge']({},_0x27494f,_0x5a96be[_0xaa53('0x41')]);var _0x430feb={'where':_0x27494f[_0xaa53('0x3a')]};return db[_0xaa53('0x42')][_0xaa53('0x1f')](_0x430feb)['then'](function(_0x1b59d2){_0xcac2d['count']=_0x1b59d2;if(_0x5a96be[_0xaa53('0x31')]['includeAll']){_0x27494f[_0xaa53('0x43')]=[{'all':!![]}];}return db[_0xaa53('0x42')]['findAll'](_0x27494f);})['then'](function(_0x44ad2b){_0xcac2d[_0xaa53('0x44')]=_0x44ad2b;return _0xcac2d;})[_0xaa53('0x26')](respondWithFilteredResult(_0x5e2128,_0x27494f))[_0xaa53('0x45')](handleError(_0x5e2128,null));};exports['show']=function(_0xc2eefa,_0x1370ec){var _0xcbeef={'raw':![],'where':{'id':_0xc2eefa[_0xaa53('0x46')]['id']}},_0x223bb8={};_0x223bb8[_0xaa53('0x30')]=_[_0xaa53('0x32')](db[_0xaa53('0x42')][_0xaa53('0x2f')]);_0x223bb8['query']=_[_0xaa53('0x32')](_0xc2eefa[_0xaa53('0x31')]);_0x223bb8[_0xaa53('0x33')]=_[_0xaa53('0x34')](_0x223bb8[_0xaa53('0x30')],_0x223bb8['query']);_0xcbeef[_0xaa53('0x35')]=_[_0xaa53('0x34')](_0x223bb8[_0xaa53('0x30')],qs[_0xaa53('0x36')](_0xc2eefa[_0xaa53('0x31')]['fields']));_0xcbeef[_0xaa53('0x35')]=_0xcbeef[_0xaa53('0x35')][_0xaa53('0x47')]?_0xcbeef['attributes']:_0x223bb8[_0xaa53('0x30')];if(_0xc2eefa[_0xaa53('0x31')][_0xaa53('0x48')]){_0xcbeef[_0xaa53('0x43')]=[{'all':!![]}];}_0xcbeef=_[_0xaa53('0x3c')]({},_0xcbeef,_0xc2eefa[_0xaa53('0x41')]);return db[_0xaa53('0x42')][_0xaa53('0x49')](_0xcbeef)[_0xaa53('0x26')](handleEntityNotFound(_0x1370ec,null))[_0xaa53('0x26')](respondWithResult(_0x1370ec,null))[_0xaa53('0x45')](handleError(_0x1370ec,null));};exports[_0xaa53('0x4a')]=function(_0xa58a5a,_0x2a89f6){return db[_0xaa53('0x42')][_0xaa53('0x4a')](_0xa58a5a[_0xaa53('0x4b')],{})[_0xaa53('0x26')](function(_0x285766){var _0x9e436f=_0xa58a5a[_0xaa53('0x4c')][_0xaa53('0x27')]({'plain':!![]});if(!_0x9e436f)throw new Error(_0xaa53('0x4d'));if(_0x9e436f['role']==='user'){var _0x5946e2=_0x285766[_0xaa53('0x27')]({'plain':!![]});var _0x3ac77b=_0xaa53('0x28');return db[_0xaa53('0x4e')][_0xaa53('0x49')]({'where':{'name':_0x3ac77b,'userProfileId':_0x9e436f['userProfileId']},'raw':!![]})['then'](function(_0x114aaf){if(_0x114aaf&&_0x114aaf[_0xaa53('0x4f')]===0x0){return db[_0xaa53('0x50')][_0xaa53('0x4a')]({'name':_0x5946e2['name'],'resourceId':_0x5946e2['id'],'type':_0x114aaf['name'],'sectionId':_0x114aaf['id']},{})[_0xaa53('0x26')](function(){return _0x285766;});}else{return _0x285766;}})['catch'](function(_0x1283bd){logger[_0xaa53('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1283bd);throw _0x1283bd;});}return _0x285766;})['then'](respondWithResult(_0x2a89f6,0xc9))['catch'](handleError(_0x2a89f6,null));};exports[_0xaa53('0x51')]=function(_0x338fb8,_0x32ec8c){var _0x475ea8={'raw':![],'where':{'id':_0x338fb8[_0xaa53('0x46')]['id']}},_0x4b7793={};_0x4b7793[_0xaa53('0x30')]=_['keys'](db[_0xaa53('0x42')][_0xaa53('0x2f')]);_0x475ea8[_0xaa53('0x35')]=_[_0xaa53('0x34')](_0x4b7793[_0xaa53('0x30')],qs[_0xaa53('0x36')](_0x338fb8['query'][_0xaa53('0x36')]));_0x475ea8[_0xaa53('0x35')]=_0x475ea8[_0xaa53('0x35')][_0xaa53('0x47')]?_0x475ea8[_0xaa53('0x35')]:_0x4b7793[_0xaa53('0x30')];if(_0x338fb8[_0xaa53('0x31')][_0xaa53('0x48')]){_0x475ea8[_0xaa53('0x43')]=[{'all':!![]}];}_0x475ea8=_['merge']({},_0x475ea8,_0x338fb8['options']);return db[_0xaa53('0x42')][_0xaa53('0x49')](_0x475ea8)[_0xaa53('0x26')](handleEntityNotFound(_0x32ec8c,null))[_0xaa53('0x26')](function(_0x127504){if(_0x127504){var _0x1f270b=_0x127504['get']({'plain':!![]});_0x1f270b=qs[_0xaa53('0x52')](_0x1f270b,['id',_0xaa53('0x53'),_0xaa53('0x54')]);_0x338fb8['body']=_[_0xaa53('0x52')](_0x338fb8[_0xaa53('0x4b')],['id','createdAt',_0xaa53('0x54')]);return db['Dashboard'][_0xaa53('0x4a')](_['merge'](_0x1f270b,_0x338fb8[_0xaa53('0x4b')]),{'include':_0x338fb8[_0xaa53('0x31')]['includeAll']?[{'all':!![]}]:undefined})[_0xaa53('0x26')](function(_0xff3d72){var _0x2a64a5=_0x338fb8[_0xaa53('0x4c')][_0xaa53('0x27')]({'plain':!![]});if(!_0x2a64a5)throw new Error(_0xaa53('0x4d'));if(_0x2a64a5[_0xaa53('0x55')]===_0xaa53('0x4c')){var _0x3e45e6=_0xff3d72[_0xaa53('0x27')]({'plain':!![]});var _0x4507d0=_0xaa53('0x28');return db[_0xaa53('0x4e')][_0xaa53('0x49')]({'where':{'name':_0x4507d0,'userProfileId':_0x2a64a5['userProfileId']},'raw':!![]})['then'](function(_0x37cbbf){if(_0x37cbbf&&_0x37cbbf[_0xaa53('0x4f')]===0x0){return db[_0xaa53('0x50')]['create']({'name':_0x3e45e6[_0xaa53('0x2c')],'resourceId':_0x3e45e6['id'],'type':_0x37cbbf[_0xaa53('0x2c')],'sectionId':_0x37cbbf['id']},{})[_0xaa53('0x26')](function(){return _0xff3d72;});}else{return _0xff3d72;}})[_0xaa53('0x45')](function(_0x1f84ee){logger[_0xaa53('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1f84ee);throw _0x1f84ee;});}return _0xff3d72;});}})[_0xaa53('0x26')](respondWithResult(_0x32ec8c,0xc9))[_0xaa53('0x45')](handleError(_0x32ec8c,null));};exports[_0xaa53('0x56')]=function(_0x1e9372,_0x3acf3a){if(_0x1e9372[_0xaa53('0x4b')]['id']){delete _0x1e9372[_0xaa53('0x4b')]['id'];}return db['Dashboard'][_0xaa53('0x49')]({'where':{'id':_0x1e9372[_0xaa53('0x46')]['id']}})['then'](handleEntityNotFound(_0x3acf3a,null))[_0xaa53('0x26')](saveUpdates(_0x1e9372[_0xaa53('0x4b')],null))[_0xaa53('0x26')](respondWithResult(_0x3acf3a,null))[_0xaa53('0x45')](handleError(_0x3acf3a,null));};exports[_0xaa53('0x25')]=function(_0x142394,_0x185205){return db[_0xaa53('0x42')][_0xaa53('0x49')]({'where':{'id':_0x142394[_0xaa53('0x46')]['id']}})[_0xaa53('0x26')](handleEntityNotFound(_0x185205,null))[_0xaa53('0x26')](removeEntity(_0x185205,null))[_0xaa53('0x45')](handleError(_0x185205,null));};function widgetAttributes(_0x26a380){try{switch(_0x26a380[_0xaa53('0x57')]){case _0xaa53('0x58'):return[{'name':'attrUrl','value':_0x26a380[_0xaa53('0x59')]||(_0x26a380[_0xaa53('0x5a')]&&_0x26a380[_0xaa53('0x5a')][0x0]?_0x26a380[_0xaa53('0x5a')][0x0][_0xaa53('0x5b')]:undefined)||_0xaa53('0x5c')}];case _0xaa53('0x5d'):return[{'name':_0xaa53('0x5e'),'value':_0x26a380[_0xaa53('0x5e')]||(_0x26a380['attrs']&&_0x26a380[_0xaa53('0x5a')][0x0]?_0x26a380[_0xaa53('0x5a')][0x0][_0xaa53('0x5b')]:undefined)||''}];case _0xaa53('0x5f'):return[{'name':_0xaa53('0x60'),'value':_0x26a380['attrHourFormat']||(_0x26a380[_0xaa53('0x5a')]&&_0x26a380[_0xaa53('0x5a')][0x0]?_0x26a380['attrs'][0x0][_0xaa53('0x5b')]:undefined)||_0xaa53('0x61')},{'name':_0xaa53('0x62'),'value':_0x26a380[_0xaa53('0x62')]||(_0x26a380[_0xaa53('0x5a')]&&_0x26a380[_0xaa53('0x5a')][0x1]?_0x26a380[_0xaa53('0x5a')][0x1][_0xaa53('0x5b')]:undefined)||_0xaa53('0x63')},{'name':_0xaa53('0x64'),'value':_0x26a380['attrFontSize']||(_0x26a380[_0xaa53('0x5a')]&&_0x26a380[_0xaa53('0x5a')][0x2]?_0x26a380[_0xaa53('0x5a')][0x2]['value']:undefined)||0xc}];case _0xaa53('0x65'):return[{'name':'attrMetric','value':_0x26a380[_0xaa53('0x66')]||(_0x26a380[_0xaa53('0x5a')]&&_0x26a380[_0xaa53('0x5a')][0x0]?_0x26a380['attrs'][0x0]['value']:undefined)||_0xaa53('0x67')},{'name':_0xaa53('0x68'),'value':_0x26a380[_0xaa53('0x68')]||(_0x26a380[_0xaa53('0x5a')]&&_0x26a380[_0xaa53('0x5a')][0x1]?_0x26a380['attrs'][0x1]['value']:undefined)||[]},{'name':'attrFontSize','value':_0x26a380['attrFontSize']||(_0x26a380[_0xaa53('0x5a')]&&_0x26a380[_0xaa53('0x5a')][0x2]?_0x26a380[_0xaa53('0x5a')][0x2][_0xaa53('0x5b')]:undefined)||0x14}];case _0xaa53('0x69'):case _0xaa53('0x6a'):return[{'name':_0xaa53('0x6b'),'value':_0x26a380['attrSerie1']||(_0x26a380[_0xaa53('0x5a')]&&_0x26a380['attrs'][0x0]?_0x26a380[_0xaa53('0x5a')][0x0][_0xaa53('0x5b')]:undefined)||_0xaa53('0x67')},{'name':_0xaa53('0x6c'),'value':_0x26a380[_0xaa53('0x6c')]||(_0x26a380[_0xaa53('0x5a')]&&_0x26a380[_0xaa53('0x5a')][0x1]?_0x26a380['attrs'][0x1][_0xaa53('0x5b')]:undefined)||null},{'name':_0xaa53('0x6d'),'value':_0x26a380['attrSerie3']||(_0x26a380[_0xaa53('0x5a')]&&_0x26a380['attrs'][0x2]?_0x26a380[_0xaa53('0x5a')][0x2][_0xaa53('0x5b')]:undefined)||null},{'name':'attrVoiceQueues','value':_0x26a380['attrVoiceQueues']||(_0x26a380['attrs']&&_0x26a380[_0xaa53('0x5a')][0x3]?_0x26a380['attrs'][0x3][_0xaa53('0x5b')]:undefined)||[]}];case _0xaa53('0x6e'):return[{'name':_0xaa53('0x6f'),'type':_0x26a380[_0xaa53('0x70')]||(_0x26a380[_0xaa53('0x5a')]&&_0x26a380[_0xaa53('0x5a')][0x0]?_0x26a380[_0xaa53('0x5a')][0x0][_0xaa53('0x57')]:undefined)||null,'value':_0x26a380[_0xaa53('0x6f')]||(_0x26a380[_0xaa53('0x5a')]&&_0x26a380[_0xaa53('0x5a')][0x0]?_0x26a380[_0xaa53('0x5a')][0x0][_0xaa53('0x5b')]:undefined)||null},{'name':_0xaa53('0x71'),'value':_0x26a380[_0xaa53('0x71')]||(_0x26a380['attrs']&&_0x26a380[_0xaa53('0x5a')][0x1]?_0x26a380[_0xaa53('0x5a')][0x1][_0xaa53('0x5b')]:undefined)||0x0}];default:return[];}}catch(_0x176a80){logger[_0xaa53('0x2b')](_0xaa53('0x72'),JSON[_0xaa53('0x73')](_0x176a80));return[];}}exports['addItem']=function(_0x46d77a,_0x5679ab,_0x44412f){if(_0x46d77a[_0xaa53('0x4b')]['id']){delete _0x46d77a[_0xaa53('0x4b')]['id'];}return db[_0xaa53('0x42')]['find']({'where':{'id':_0x46d77a['params']['id']}})[_0xaa53('0x26')](handleEntityNotFound(_0x5679ab,null))[_0xaa53('0x26')](function(_0x363f33){if(_0x363f33){_0x46d77a[_0xaa53('0x4b')][_0xaa53('0x74')]=_0x363f33['id'];_0x46d77a['body'][_0xaa53('0x5a')]=widgetAttributes(_0x46d77a['body']);return db[_0xaa53('0x75')][_0xaa53('0x4a')](_0x46d77a['body']);}})[_0xaa53('0x26')](respondWithResult(_0x5679ab,null))[_0xaa53('0x45')](handleError(_0x5679ab,null));};exports[_0xaa53('0x76')]=function(_0x54f3f0,_0xae4606,_0x21669c){var _0x445ba6={};var _0x885a75={};var _0x2572a0;var _0x30f5e9;return db[_0xaa53('0x42')]['findOne']({'where':{'id':_0x54f3f0[_0xaa53('0x46')]['id']}})[_0xaa53('0x26')](handleEntityNotFound(_0xae4606,null))[_0xaa53('0x26')](function(_0x253877){if(_0x253877){_0x2572a0=_0x253877;_0x885a75[_0xaa53('0x30')]=_[_0xaa53('0x32')](db[_0xaa53('0x75')][_0xaa53('0x2f')]);_0x885a75[_0xaa53('0x31')]=_['keys'](_0x54f3f0[_0xaa53('0x31')]);_0x885a75[_0xaa53('0x33')]=_[_0xaa53('0x34')](_0x885a75['model'],_0x885a75[_0xaa53('0x31')]);_0x445ba6['attributes']=_[_0xaa53('0x34')](_0x885a75['model'],qs[_0xaa53('0x36')](_0x54f3f0[_0xaa53('0x31')]['fields']));_0x445ba6['attributes']=_0x445ba6[_0xaa53('0x35')]['length']?_0x445ba6['attributes']:_0x885a75['model'];_0x445ba6[_0xaa53('0x77')]=qs[_0xaa53('0x78')](_0x54f3f0[_0xaa53('0x31')][_0xaa53('0x78')]);_0x445ba6[_0xaa53('0x3a')]=qs[_0xaa53('0x33')](_[_0xaa53('0x3b')](_0x54f3f0[_0xaa53('0x31')],_0x885a75['filters']));if(_0x54f3f0[_0xaa53('0x31')][_0xaa53('0x79')]){_0x445ba6[_0xaa53('0x3a')]=_['merge'](_0x445ba6[_0xaa53('0x3a')],{'$or':_[_0xaa53('0x3d')](_0x445ba6['attributes'],function(_0x234cf3){var _0xb0a3e6={};_0xb0a3e6[_0x234cf3]={'$like':'%'+_0x54f3f0[_0xaa53('0x31')][_0xaa53('0x79')]+'%'};return _0xb0a3e6;})});}_0x445ba6=_[_0xaa53('0x3c')]({},_0x445ba6,_0x54f3f0[_0xaa53('0x41')]);return _0x2572a0[_0xaa53('0x76')](_0x445ba6);}})['then'](function(_0x571ae9){if(_0x571ae9){_0x30f5e9=_0x571ae9[_0xaa53('0x47')];if(!_0x54f3f0[_0xaa53('0x31')][_0xaa53('0x7a')]('nolimit')){_0x445ba6[_0xaa53('0x38')]=qs[_0xaa53('0x38')](_0x54f3f0[_0xaa53('0x31')][_0xaa53('0x38')]);_0x445ba6[_0xaa53('0x39')]=qs[_0xaa53('0x39')](_0x54f3f0[_0xaa53('0x31')][_0xaa53('0x39')]);}return _0x2572a0[_0xaa53('0x76')](_0x445ba6);}})[_0xaa53('0x26')](function(_0x71bf93){if(_0x71bf93){return _0x71bf93?{'count':_0x30f5e9,'rows':_0x71bf93}:null;}})[_0xaa53('0x26')](respondWithResult(_0xae4606,null))['catch'](handleError(_0xae4606,null));}; \ No newline at end of file +var _0x25e3=['catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','get','CustomDashboards','UserProfileSection','find','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','include','omit','createdAt','updatedAt','role','userProfileId','iframe','attrUrl','attrs','value','https://','custom','attrPath','clock','attrTimezone','attrFontSize','counter','total','attrVoiceQueues','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','web-report','attrReport','reportType','attrRefresh','stringify','addItem','DashboardId','DashboardItem','getItems','findOne','pick','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./dashboard.socket','sendStatus','status','end','json','count','offset','limit','Content-Range','update','then','destroy','error','stack','name','send','index','Dashboard','rawAttributes','keys','query','intersection','model','attributes','fields','length','hasOwnProperty','sort','filters','filter','where','merge','map','type','key','VIRTUAL','field','options','includeAll','findAll','rows','show','params'];(function(_0x1b70f7,_0xd1d2c8){var _0x18f09f=function(_0x2c4eac){while(--_0x2c4eac){_0x1b70f7['push'](_0x1b70f7['shift']());}};_0x18f09f(++_0xd1d2c8);}(_0x25e3,0x197));var _0x325e=function(_0x1b01e7,_0x2854f5){_0x1b01e7=_0x1b01e7-0x0;var _0x2a586f=_0x25e3[_0x1b01e7];return _0x2a586f;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x325e('0x0'));var rimraf=require(_0x325e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x325e('0x2'));var rp=require(_0x325e('0x3'));var moment=require('moment');var BPromise=require(_0x325e('0x4'));var Mustache=require(_0x325e('0x5'));var util=require(_0x325e('0x6'));var path=require(_0x325e('0x7'));var sox=require(_0x325e('0x8'));var csv=require(_0x325e('0x9'));var ejs=require(_0x325e('0xa'));var fs=require('fs');var _=require(_0x325e('0xb'));var squel=require(_0x325e('0xc'));var crypto=require(_0x325e('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x325e('0xe'));var toCsv=require(_0x325e('0x9'));var querystring=require(_0x325e('0xf'));var Papa=require(_0x325e('0x10'));var Redis=require(_0x325e('0x11'));var authService=require(_0x325e('0x12'));var qs=require(_0x325e('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x325e('0x14'));var logger=require(_0x325e('0x15'))(_0x325e('0x16'));var utils=require(_0x325e('0x17'));var config=require(_0x325e('0x18'));var db=require(_0x325e('0x19'))['db'];config[_0x325e('0x1a')]=_[_0x325e('0x1b')](config[_0x325e('0x1a')],{'host':_0x325e('0x1c'),'port':0x18eb});var socket=require(_0x325e('0x1d'))(new Redis(config[_0x325e('0x1a')]));require(_0x325e('0x1e'))['register'](socket);function respondWithStatusCode(_0x372098,_0x395abf){_0x395abf=_0x395abf||0xcc;return function(_0x56cd33){if(_0x56cd33){return _0x372098[_0x325e('0x1f')](_0x395abf);}return _0x372098[_0x325e('0x20')](_0x395abf)[_0x325e('0x21')]();};}function respondWithResult(_0x556320,_0x475737){_0x475737=_0x475737||0xc8;return function(_0x306679){if(_0x306679){return _0x556320[_0x325e('0x20')](_0x475737)[_0x325e('0x22')](_0x306679);}};}function respondWithFilteredResult(_0x1597f4,_0x1fd014){return function(_0x5d558d){if(_0x5d558d){var _0x72d80b=_0x5d558d[_0x325e('0x23')],_0x4285c3=_0x1fd014[_0x325e('0x24')],_0x4dced2=_0x1fd014[_0x325e('0x24')]+_0x1fd014[_0x325e('0x25')],_0x1f2470;if(_0x4dced2>=_0x72d80b){_0x4dced2=_0x72d80b;_0x1f2470=0xc8;}else{_0x1f2470=0xce;}_0x1597f4[_0x325e('0x20')](_0x1f2470);return _0x1597f4['set'](_0x325e('0x26'),_0x4285c3+'-'+_0x4dced2+'/'+_0x72d80b)[_0x325e('0x22')](_0x5d558d);}return null;};}function patchUpdates(_0x549c1f){return function(_0x20e2e2){try{jsonpatch['apply'](_0x20e2e2,_0x549c1f,!![]);}catch(_0x2268d1){return BPromise['reject'](_0x2268d1);}return _0x20e2e2['save']();};}function saveUpdates(_0x2e0a3e,_0x44a9de){return function(_0x34c67e){if(_0x34c67e){return _0x34c67e[_0x325e('0x27')](_0x2e0a3e)[_0x325e('0x28')](function(_0x2c64ff){return _0x2c64ff;});}return null;};}function removeEntity(_0x17e376,_0x10279e){return function(_0x1445e0){if(_0x1445e0){return _0x1445e0['destroy']()[_0x325e('0x28')](function(){var _0x44a8e0=_0x1445e0['get']({'plain':!![]});var _0x29601f='CustomDashboards';return db['UserProfileResource'][_0x325e('0x29')]({'where':{'type':_0x29601f,'resourceId':_0x44a8e0['id']}})['then'](function(){return _0x1445e0;});})[_0x325e('0x28')](function(){_0x17e376[_0x325e('0x20')](0xcc)[_0x325e('0x21')]();});}};}function handleEntityNotFound(_0xf1c4fb,_0xb2368){return function(_0x92e7db){if(!_0x92e7db){_0xf1c4fb[_0x325e('0x1f')](0x194);}return _0x92e7db;};}function handleError(_0x50999d,_0x16efbe){_0x16efbe=_0x16efbe||0x1f4;return function(_0x33ebd7){logger[_0x325e('0x2a')](_0x33ebd7[_0x325e('0x2b')]);if(_0x33ebd7[_0x325e('0x2c')]){delete _0x33ebd7[_0x325e('0x2c')];}_0x50999d['status'](_0x16efbe)[_0x325e('0x2d')](_0x33ebd7);};}exports[_0x325e('0x2e')]=function(_0x2c55ec,_0x902f26){var _0x12edc6={},_0x4f4421={},_0x4c638c={'count':0x0,'rows':[]};var _0x2cfa9b=db[_0x325e('0x2f')][_0x325e('0x30')];_0x4f4421['model']=_[_0x325e('0x31')](_0x2cfa9b);_0x4f4421[_0x325e('0x32')]=_['keys'](_0x2c55ec['query']);_0x4f4421['filters']=_[_0x325e('0x33')](_0x4f4421[_0x325e('0x34')],_0x4f4421[_0x325e('0x32')]);_0x12edc6[_0x325e('0x35')]=_[_0x325e('0x33')](_0x4f4421[_0x325e('0x34')],qs[_0x325e('0x36')](_0x2c55ec[_0x325e('0x32')][_0x325e('0x36')]));_0x12edc6['attributes']=_0x12edc6[_0x325e('0x35')][_0x325e('0x37')]?_0x12edc6['attributes']:_0x4f4421['model'];if(!_0x2c55ec[_0x325e('0x32')][_0x325e('0x38')]('nolimit')){_0x12edc6[_0x325e('0x25')]=qs[_0x325e('0x25')](_0x2c55ec[_0x325e('0x32')]['limit']);_0x12edc6[_0x325e('0x24')]=qs[_0x325e('0x24')](_0x2c55ec[_0x325e('0x32')][_0x325e('0x24')]);}_0x12edc6['order']=qs['sort'](_0x2c55ec[_0x325e('0x32')][_0x325e('0x39')]);_0x12edc6['where']=qs[_0x325e('0x3a')](_['pick'](_0x2c55ec[_0x325e('0x32')],_0x4f4421[_0x325e('0x3a')]));if(_0x2c55ec[_0x325e('0x32')][_0x325e('0x3b')]){_0x12edc6[_0x325e('0x3c')]=_[_0x325e('0x3d')](_0x12edc6[_0x325e('0x3c')],{'$or':_[_0x325e('0x3e')](_0x2cfa9b,function(_0x53b534){if(_0x53b534[_0x325e('0x3f')][_0x325e('0x40')]!==_0x325e('0x41')){var _0x19cb2c={};_0x19cb2c[_0x53b534[_0x325e('0x42')]]={'$like':'%'+_0x2c55ec[_0x325e('0x32')][_0x325e('0x3b')]+'%'};return _0x19cb2c;}})});}_0x12edc6=_['merge']({},_0x12edc6,_0x2c55ec[_0x325e('0x43')]);var _0x66b2ad={'where':_0x12edc6[_0x325e('0x3c')]};return db[_0x325e('0x2f')][_0x325e('0x23')](_0x66b2ad)[_0x325e('0x28')](function(_0x2d81b7){_0x4c638c[_0x325e('0x23')]=_0x2d81b7;if(_0x2c55ec[_0x325e('0x32')][_0x325e('0x44')]){_0x12edc6['include']=[{'all':!![]}];}return db[_0x325e('0x2f')][_0x325e('0x45')](_0x12edc6);})[_0x325e('0x28')](function(_0x49c475){_0x4c638c[_0x325e('0x46')]=_0x49c475;return _0x4c638c;})[_0x325e('0x28')](respondWithFilteredResult(_0x902f26,_0x12edc6))['catch'](handleError(_0x902f26,null));};exports[_0x325e('0x47')]=function(_0x4d5941,_0x250155){var _0x40f8ea={'raw':![],'where':{'id':_0x4d5941[_0x325e('0x48')]['id']}},_0x5b5af7={};_0x5b5af7[_0x325e('0x34')]=_[_0x325e('0x31')](db[_0x325e('0x2f')][_0x325e('0x30')]);_0x5b5af7[_0x325e('0x32')]=_[_0x325e('0x31')](_0x4d5941[_0x325e('0x32')]);_0x5b5af7[_0x325e('0x3a')]=_[_0x325e('0x33')](_0x5b5af7['model'],_0x5b5af7[_0x325e('0x32')]);_0x40f8ea[_0x325e('0x35')]=_[_0x325e('0x33')](_0x5b5af7[_0x325e('0x34')],qs[_0x325e('0x36')](_0x4d5941[_0x325e('0x32')][_0x325e('0x36')]));_0x40f8ea[_0x325e('0x35')]=_0x40f8ea[_0x325e('0x35')][_0x325e('0x37')]?_0x40f8ea[_0x325e('0x35')]:_0x5b5af7[_0x325e('0x34')];if(_0x4d5941['query'][_0x325e('0x44')]){_0x40f8ea['include']=[{'all':!![]}];}_0x40f8ea=_[_0x325e('0x3d')]({},_0x40f8ea,_0x4d5941[_0x325e('0x43')]);return db[_0x325e('0x2f')]['find'](_0x40f8ea)[_0x325e('0x28')](handleEntityNotFound(_0x250155,null))['then'](respondWithResult(_0x250155,null))[_0x325e('0x49')](handleError(_0x250155,null));};exports[_0x325e('0x4a')]=function(_0x3fa17f,_0x4fa15e){return db[_0x325e('0x2f')]['create'](_0x3fa17f[_0x325e('0x4b')],{})[_0x325e('0x28')](function(_0x3b0fb5){var _0x50f0a5=_0x3fa17f[_0x325e('0x4c')]['get']({'plain':!![]});if(!_0x50f0a5)throw new Error(_0x325e('0x4d'));if(_0x50f0a5['role']===_0x325e('0x4c')){var _0x32cb2f=_0x3b0fb5[_0x325e('0x4e')]({'plain':!![]});var _0x83291f=_0x325e('0x4f');return db[_0x325e('0x50')][_0x325e('0x51')]({'where':{'name':_0x83291f,'userProfileId':_0x50f0a5['userProfileId']},'raw':!![]})[_0x325e('0x28')](function(_0x3648f2){if(_0x3648f2&&_0x3648f2[_0x325e('0x52')]===0x0){return db[_0x325e('0x53')][_0x325e('0x4a')]({'name':_0x32cb2f[_0x325e('0x2c')],'resourceId':_0x32cb2f['id'],'type':_0x3648f2['name'],'sectionId':_0x3648f2['id']},{})[_0x325e('0x28')](function(){return _0x3b0fb5;});}else{return _0x3b0fb5;}})[_0x325e('0x49')](function(_0x4adc46){logger[_0x325e('0x2a')](_0x325e('0x54'),_0x4adc46);throw _0x4adc46;});}return _0x3b0fb5;})[_0x325e('0x28')](respondWithResult(_0x4fa15e,0xc9))[_0x325e('0x49')](handleError(_0x4fa15e,null));};exports['clone']=function(_0x39180c,_0x28f82e){var _0x4bd0fc={'raw':![],'where':{'id':_0x39180c['params']['id']}},_0x58bc31={};_0x58bc31['model']=_[_0x325e('0x31')](db[_0x325e('0x2f')][_0x325e('0x30')]);_0x4bd0fc[_0x325e('0x35')]=_['intersection'](_0x58bc31['model'],qs['fields'](_0x39180c[_0x325e('0x32')][_0x325e('0x36')]));_0x4bd0fc[_0x325e('0x35')]=_0x4bd0fc[_0x325e('0x35')][_0x325e('0x37')]?_0x4bd0fc['attributes']:_0x58bc31['model'];if(_0x39180c['query'][_0x325e('0x44')]){_0x4bd0fc[_0x325e('0x55')]=[{'all':!![]}];}_0x4bd0fc=_[_0x325e('0x3d')]({},_0x4bd0fc,_0x39180c[_0x325e('0x43')]);return db[_0x325e('0x2f')][_0x325e('0x51')](_0x4bd0fc)[_0x325e('0x28')](handleEntityNotFound(_0x28f82e,null))[_0x325e('0x28')](function(_0x311db5){if(_0x311db5){var _0x3f0693=_0x311db5[_0x325e('0x4e')]({'plain':!![]});_0x3f0693=qs[_0x325e('0x56')](_0x3f0693,['id',_0x325e('0x57'),_0x325e('0x58')]);_0x39180c['body']=_[_0x325e('0x56')](_0x39180c[_0x325e('0x4b')],['id',_0x325e('0x57'),'updatedAt']);return db[_0x325e('0x2f')][_0x325e('0x4a')](_[_0x325e('0x3d')](_0x3f0693,_0x39180c[_0x325e('0x4b')]),{'include':_0x39180c['query'][_0x325e('0x44')]?[{'all':!![]}]:undefined})[_0x325e('0x28')](function(_0x1645e0){var _0x1d3896=_0x39180c[_0x325e('0x4c')][_0x325e('0x4e')]({'plain':!![]});if(!_0x1d3896)throw new Error(_0x325e('0x4d'));if(_0x1d3896[_0x325e('0x59')]===_0x325e('0x4c')){var _0x5eb224=_0x1645e0[_0x325e('0x4e')]({'plain':!![]});var _0x1b4ba7=_0x325e('0x4f');return db[_0x325e('0x50')]['find']({'where':{'name':_0x1b4ba7,'userProfileId':_0x1d3896[_0x325e('0x5a')]},'raw':!![]})[_0x325e('0x28')](function(_0x14d8a4){if(_0x14d8a4&&_0x14d8a4[_0x325e('0x52')]===0x0){return db[_0x325e('0x53')]['create']({'name':_0x5eb224[_0x325e('0x2c')],'resourceId':_0x5eb224['id'],'type':_0x14d8a4[_0x325e('0x2c')],'sectionId':_0x14d8a4['id']},{})[_0x325e('0x28')](function(){return _0x1645e0;});}else{return _0x1645e0;}})['catch'](function(_0x1ef26d){logger['error'](_0x325e('0x54'),_0x1ef26d);throw _0x1ef26d;});}return _0x1645e0;});}})[_0x325e('0x28')](respondWithResult(_0x28f82e,0xc9))[_0x325e('0x49')](handleError(_0x28f82e,null));};exports[_0x325e('0x27')]=function(_0x3970d7,_0x5236ac){if(_0x3970d7[_0x325e('0x4b')]['id']){delete _0x3970d7[_0x325e('0x4b')]['id'];}return db['Dashboard'][_0x325e('0x51')]({'where':{'id':_0x3970d7[_0x325e('0x48')]['id']}})[_0x325e('0x28')](handleEntityNotFound(_0x5236ac,null))[_0x325e('0x28')](saveUpdates(_0x3970d7[_0x325e('0x4b')],null))[_0x325e('0x28')](respondWithResult(_0x5236ac,null))[_0x325e('0x49')](handleError(_0x5236ac,null));};exports['destroy']=function(_0x24b236,_0x27b447){return db['Dashboard']['find']({'where':{'id':_0x24b236[_0x325e('0x48')]['id']}})['then'](handleEntityNotFound(_0x27b447,null))[_0x325e('0x28')](removeEntity(_0x27b447,null))[_0x325e('0x49')](handleError(_0x27b447,null));};function widgetAttributes(_0x383550){try{switch(_0x383550[_0x325e('0x3f')]){case _0x325e('0x5b'):return[{'name':'attrUrl','value':_0x383550[_0x325e('0x5c')]||(_0x383550['attrs']&&_0x383550[_0x325e('0x5d')][0x0]?_0x383550[_0x325e('0x5d')][0x0][_0x325e('0x5e')]:undefined)||_0x325e('0x5f')}];case _0x325e('0x60'):return[{'name':_0x325e('0x61'),'value':_0x383550['attrPath']||(_0x383550[_0x325e('0x5d')]&&_0x383550[_0x325e('0x5d')][0x0]?_0x383550[_0x325e('0x5d')][0x0][_0x325e('0x5e')]:undefined)||''}];case _0x325e('0x62'):return[{'name':'attrHourFormat','value':_0x383550['attrHourFormat']||(_0x383550['attrs']&&_0x383550[_0x325e('0x5d')][0x0]?_0x383550['attrs'][0x0][_0x325e('0x5e')]:undefined)||'HH:mm:ss'},{'name':'attrTimezone','value':_0x383550[_0x325e('0x63')]||(_0x383550['attrs']&&_0x383550['attrs'][0x1]?_0x383550[_0x325e('0x5d')][0x1][_0x325e('0x5e')]:undefined)||'0.00'},{'name':'attrFontSize','value':_0x383550[_0x325e('0x64')]||(_0x383550[_0x325e('0x5d')]&&_0x383550[_0x325e('0x5d')][0x2]?_0x383550['attrs'][0x2][_0x325e('0x5e')]:undefined)||0xc}];case _0x325e('0x65'):return[{'name':'attrMetric','value':_0x383550['attrMetric']||(_0x383550[_0x325e('0x5d')]&&_0x383550[_0x325e('0x5d')][0x0]?_0x383550[_0x325e('0x5d')][0x0]['value']:undefined)||_0x325e('0x66')},{'name':_0x325e('0x67'),'value':_0x383550[_0x325e('0x67')]||(_0x383550[_0x325e('0x5d')]&&_0x383550[_0x325e('0x5d')][0x1]?_0x383550['attrs'][0x1]['value']:undefined)||[]},{'name':_0x325e('0x64'),'value':_0x383550[_0x325e('0x64')]||(_0x383550['attrs']&&_0x383550[_0x325e('0x5d')][0x2]?_0x383550[_0x325e('0x5d')][0x2][_0x325e('0x5e')]:undefined)||0x14}];case _0x325e('0x68'):case _0x325e('0x69'):return[{'name':_0x325e('0x6a'),'value':_0x383550[_0x325e('0x6a')]||(_0x383550[_0x325e('0x5d')]&&_0x383550[_0x325e('0x5d')][0x0]?_0x383550[_0x325e('0x5d')][0x0][_0x325e('0x5e')]:undefined)||_0x325e('0x66')},{'name':_0x325e('0x6b'),'value':_0x383550[_0x325e('0x6b')]||(_0x383550['attrs']&&_0x383550[_0x325e('0x5d')][0x1]?_0x383550['attrs'][0x1][_0x325e('0x5e')]:undefined)||null},{'name':_0x325e('0x6c'),'value':_0x383550['attrSerie3']||(_0x383550[_0x325e('0x5d')]&&_0x383550[_0x325e('0x5d')][0x2]?_0x383550['attrs'][0x2]['value']:undefined)||null},{'name':_0x325e('0x67'),'value':_0x383550[_0x325e('0x67')]||(_0x383550[_0x325e('0x5d')]&&_0x383550[_0x325e('0x5d')][0x3]?_0x383550[_0x325e('0x5d')][0x3]['value']:undefined)||[]}];case _0x325e('0x6d'):return[{'name':_0x325e('0x6e'),'type':_0x383550[_0x325e('0x6f')]||(_0x383550['attrs']&&_0x383550[_0x325e('0x5d')][0x0]?_0x383550['attrs'][0x0]['type']:undefined)||null,'value':_0x383550[_0x325e('0x6e')]||(_0x383550[_0x325e('0x5d')]&&_0x383550[_0x325e('0x5d')][0x0]?_0x383550[_0x325e('0x5d')][0x0][_0x325e('0x5e')]:undefined)||null},{'name':'attrRefresh','value':_0x383550[_0x325e('0x70')]||(_0x383550[_0x325e('0x5d')]&&_0x383550[_0x325e('0x5d')][0x1]?_0x383550[_0x325e('0x5d')][0x1]['value']:undefined)||0x0}];default:return[];}}catch(_0x1001aa){logger[_0x325e('0x2a')]('widgetAttributes:\x20%s',JSON[_0x325e('0x71')](_0x1001aa));return[];}}exports[_0x325e('0x72')]=function(_0x4499c8,_0x2e0ece,_0x11a397){if(_0x4499c8['body']['id']){delete _0x4499c8['body']['id'];}return db[_0x325e('0x2f')][_0x325e('0x51')]({'where':{'id':_0x4499c8['params']['id']}})[_0x325e('0x28')](handleEntityNotFound(_0x2e0ece,null))['then'](function(_0x3c7e7c){if(_0x3c7e7c){_0x4499c8[_0x325e('0x4b')][_0x325e('0x73')]=_0x3c7e7c['id'];_0x4499c8[_0x325e('0x4b')][_0x325e('0x5d')]=widgetAttributes(_0x4499c8[_0x325e('0x4b')]);return db[_0x325e('0x74')][_0x325e('0x4a')](_0x4499c8[_0x325e('0x4b')]);}})[_0x325e('0x28')](respondWithResult(_0x2e0ece,null))['catch'](handleError(_0x2e0ece,null));};exports[_0x325e('0x75')]=function(_0x1790ee,_0x4c1dc7,_0x19d2e2){var _0x59bbe4={};var _0x129438={};var _0x592ec9;var _0x55ef41;return db[_0x325e('0x2f')][_0x325e('0x76')]({'where':{'id':_0x1790ee[_0x325e('0x48')]['id']}})['then'](handleEntityNotFound(_0x4c1dc7,null))['then'](function(_0x3e3e22){if(_0x3e3e22){_0x592ec9=_0x3e3e22;_0x129438[_0x325e('0x34')]=_[_0x325e('0x31')](db['DashboardItem'][_0x325e('0x30')]);_0x129438['query']=_['keys'](_0x1790ee[_0x325e('0x32')]);_0x129438['filters']=_[_0x325e('0x33')](_0x129438[_0x325e('0x34')],_0x129438[_0x325e('0x32')]);_0x59bbe4[_0x325e('0x35')]=_[_0x325e('0x33')](_0x129438[_0x325e('0x34')],qs['fields'](_0x1790ee['query']['fields']));_0x59bbe4[_0x325e('0x35')]=_0x59bbe4['attributes']['length']?_0x59bbe4['attributes']:_0x129438['model'];_0x59bbe4['order']=qs[_0x325e('0x39')](_0x1790ee[_0x325e('0x32')][_0x325e('0x39')]);_0x59bbe4['where']=qs['filters'](_[_0x325e('0x77')](_0x1790ee['query'],_0x129438[_0x325e('0x3a')]));if(_0x1790ee[_0x325e('0x32')][_0x325e('0x3b')]){_0x59bbe4[_0x325e('0x3c')]=_[_0x325e('0x3d')](_0x59bbe4[_0x325e('0x3c')],{'$or':_['map'](_0x59bbe4[_0x325e('0x35')],function(_0x16ed47){var _0xa75097={};_0xa75097[_0x16ed47]={'$like':'%'+_0x1790ee['query'][_0x325e('0x3b')]+'%'};return _0xa75097;})});}_0x59bbe4=_[_0x325e('0x3d')]({},_0x59bbe4,_0x1790ee[_0x325e('0x43')]);return _0x592ec9[_0x325e('0x75')](_0x59bbe4);}})[_0x325e('0x28')](function(_0x4998ba){if(_0x4998ba){_0x55ef41=_0x4998ba[_0x325e('0x37')];if(!_0x1790ee[_0x325e('0x32')][_0x325e('0x38')]('nolimit')){_0x59bbe4[_0x325e('0x25')]=qs[_0x325e('0x25')](_0x1790ee[_0x325e('0x32')][_0x325e('0x25')]);_0x59bbe4['offset']=qs[_0x325e('0x24')](_0x1790ee[_0x325e('0x32')][_0x325e('0x24')]);}return _0x592ec9[_0x325e('0x75')](_0x59bbe4);}})['then'](function(_0x390000){if(_0x390000){return _0x390000?{'count':_0x55ef41,'rows':_0x390000}:null;}})[_0x325e('0x28')](respondWithResult(_0x4c1dc7,null))['catch'](handleError(_0x4c1dc7,null));}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.events.js b/server/api/dashboard/dashboard.events.js index 93f9ed6..c75bf1d 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 _0x41ba=['Dashboard','setMaxListeners','update','remove','emit','hasOwnProperty','exports','events','../../mysqldb'];(function(_0x567dfd,_0x219aa9){var _0x35ceb5=function(_0x4e6de4){while(--_0x4e6de4){_0x567dfd['push'](_0x567dfd['shift']());}};_0x35ceb5(++_0x219aa9);}(_0x41ba,0x6a));var _0xa41b=function(_0x43f915,_0x6edd04){_0x43f915=_0x43f915-0x0;var _0x68aabb=_0x41ba[_0x43f915];return _0x68aabb;};'use strict';var EventEmitter=require(_0xa41b('0x0'));var Dashboard=require(_0xa41b('0x1'))['db'][_0xa41b('0x2')];var DashboardEvents=new EventEmitter();DashboardEvents[_0xa41b('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xa41b('0x4'),'afterDestroy':_0xa41b('0x5')};function emitEvent(_0x5cc0d2){return function(_0xa7f408,_0x59fb5f,_0x47a1eb){DashboardEvents[_0xa41b('0x6')](_0x5cc0d2+':'+_0xa7f408['id'],_0xa7f408);DashboardEvents['emit'](_0x5cc0d2,_0xa7f408);_0x47a1eb(null);};}for(var e in events){if(events[_0xa41b('0x7')](e)){var event=events[e];Dashboard['hook'](e,emitEvent(event));}}module[_0xa41b('0x8')]=DashboardEvents; \ No newline at end of file +var _0xe202=['save','emit','hasOwnProperty','hook','events','../../mysqldb','Dashboard','setMaxListeners'];(function(_0x2d6ab0,_0xf2fd8d){var _0x32277e=function(_0x1663b4){while(--_0x1663b4){_0x2d6ab0['push'](_0x2d6ab0['shift']());}};_0x32277e(++_0xf2fd8d);}(_0xe202,0x194));var _0x2e20=function(_0x4fc55a,_0x43165e){_0x4fc55a=_0x4fc55a-0x0;var _0x30ece4=_0xe202[_0x4fc55a];return _0x30ece4;};'use strict';var EventEmitter=require(_0x2e20('0x0'));var Dashboard=require(_0x2e20('0x1'))['db'][_0x2e20('0x2')];var DashboardEvents=new EventEmitter();DashboardEvents[_0x2e20('0x3')](0x0);var events={'afterCreate':_0x2e20('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x1c2e88){return function(_0x1b640b,_0x4f1dfb,_0x13e9e9){DashboardEvents[_0x2e20('0x5')](_0x1c2e88+':'+_0x1b640b['id'],_0x1b640b);DashboardEvents[_0x2e20('0x5')](_0x1c2e88,_0x1b640b);_0x13e9e9(null);};}for(var e in events){if(events[_0x2e20('0x6')](e)){var event=events[e];Dashboard[_0x2e20('0x7')](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 f0707a2..15487b4 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 _0x3444=['exports','define','Dashboard','dashboards','lodash','util','moment','bluebird','request-promise','path','rimraf'];(function(_0x22ff69,_0x1ecf72){var _0x9a4c82=function(_0x40ff45){while(--_0x40ff45){_0x22ff69['push'](_0x22ff69['shift']());}};_0x9a4c82(++_0x1ecf72);}(_0x3444,0x122));var _0x4344=function(_0x3f3ef4,_0x1265c9){_0x3f3ef4=_0x3f3ef4-0x0;var _0xa676bd=_0x3444[_0x3f3ef4];return _0xa676bd;};'use strict';var _=require(_0x4344('0x0'));var util=require(_0x4344('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x4344('0x2'));var BPromise=require(_0x4344('0x3'));var rp=require(_0x4344('0x4'));var fs=require('fs');var path=require(_0x4344('0x5'));var rimraf=require(_0x4344('0x6'));var config=require('../../config/environment');var attributes=require('./dashboard.attributes');module[_0x4344('0x7')]=function(_0x59d64d,_0x332159){return _0x59d64d[_0x4344('0x8')](_0x4344('0x9'),attributes,{'tableName':_0x4344('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6688=['dashboards','lodash','util','api','moment','bluebird','request-promise','../../config/environment','./dashboard.attributes','define'];(function(_0x59a3f9,_0x14988d){var _0x5772c8=function(_0x1da34c){while(--_0x1da34c){_0x59a3f9['push'](_0x59a3f9['shift']());}};_0x5772c8(++_0x14988d);}(_0x6688,0x65));var _0x8668=function(_0x5d5f2c,_0x20eeff){_0x5d5f2c=_0x5d5f2c-0x0;var _0x346cd0=_0x6688[_0x5d5f2c];return _0x346cd0;};'use strict';var _=require(_0x8668('0x0'));var util=require(_0x8668('0x1'));var logger=require('../../config/logger')(_0x8668('0x2'));var moment=require(_0x8668('0x3'));var BPromise=require(_0x8668('0x4'));var rp=require(_0x8668('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x8668('0x6'));var attributes=require(_0x8668('0x7'));module['exports']=function(_0x37e453,_0x510dd2){return _0x37e453[_0x8668('0x8')]('Dashboard',attributes,{'tableName':_0x8668('0x9'),'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 2549d63..1a599fb 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 _0xb5ec=['redis','defaults','localhost','socket.io-emitter','./dashboard.socket','request','then','Dashboard,\x20%s,\x20%s','request\x20sent','debug','Dashboard,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http'];(function(_0x26cc2a,_0x4aefd6){var _0x1135dc=function(_0xf040b0){while(--_0xf040b0){_0x26cc2a['push'](_0x26cc2a['shift']());}};_0x1135dc(++_0x4aefd6);}(_0xb5ec,0x97));var _0xcb5e=function(_0x1daaa6,_0x57b89c){_0x1daaa6=_0x1daaa6-0x0;var _0x58b152=_0xb5ec[_0x1daaa6];return _0x58b152;};'use strict';var _=require(_0xcb5e('0x0'));var util=require(_0xcb5e('0x1'));var moment=require(_0xcb5e('0x2'));var BPromise=require(_0xcb5e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xcb5e('0x4'));var db=require(_0xcb5e('0x5'))['db'];var utils=require(_0xcb5e('0x6'));var logger=require('../../config/logger')(_0xcb5e('0x7'));var config=require('../../config/environment');var jayson=require(_0xcb5e('0x8'));var client=jayson[_0xcb5e('0x9')][_0xcb5e('0xa')]({'port':0x232a});config[_0xcb5e('0xb')]=_[_0xcb5e('0xc')](config[_0xcb5e('0xb')],{'host':_0xcb5e('0xd'),'port':0x18eb});var socket=require(_0xcb5e('0xe'))(new Redis(config[_0xcb5e('0xb')]));require(_0xcb5e('0xf'))['register'](socket);function respondWithRpcPromise(_0x12342f,_0x51dca4,_0x2b1461){return new BPromise(function(_0x24a3a4,_0x2c8048){return client[_0xcb5e('0x10')](_0x12342f,_0x2b1461)[_0xcb5e('0x11')](function(_0x9f6d75){logger['info'](_0xcb5e('0x12'),_0x51dca4,_0xcb5e('0x13'));logger[_0xcb5e('0x14')](_0xcb5e('0x15'),_0x51dca4,_0xcb5e('0x13'),JSON[_0xcb5e('0x16')](_0x9f6d75));if(_0x9f6d75['error']){if(_0x9f6d75[_0xcb5e('0x17')][_0xcb5e('0x18')]===0x1f4){logger['error'](_0xcb5e('0x12'),_0x51dca4,_0x9f6d75[_0xcb5e('0x17')][_0xcb5e('0x19')]);return _0x2c8048(_0x9f6d75[_0xcb5e('0x17')][_0xcb5e('0x19')]);}logger[_0xcb5e('0x17')](_0xcb5e('0x12'),_0x51dca4,_0x9f6d75[_0xcb5e('0x17')][_0xcb5e('0x19')]);return _0x24a3a4(_0x9f6d75[_0xcb5e('0x17')][_0xcb5e('0x19')]);}else{logger['info'](_0xcb5e('0x12'),_0x51dca4,'request\x20sent');_0x24a3a4(_0x9f6d75['result'][_0xcb5e('0x19')]);}})[_0xcb5e('0x1a')](function(_0x5edd80){logger[_0xcb5e('0x17')](_0xcb5e('0x12'),_0x51dca4,_0x5edd80);_0x2c8048(_0x5edd80);});});} \ No newline at end of file +var _0x1ce4=['rpc','jayson/promise','client','http','redis','defaults','register','request','info','Dashboard,\x20%s,\x20%s','request\x20sent','debug','Dashboard,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x5c078e,_0x2fe4cf){var _0x815d85=function(_0x2f5306){while(--_0x2f5306){_0x5c078e['push'](_0x5c078e['shift']());}};_0x815d85(++_0x2fe4cf);}(_0x1ce4,0x75));var _0x41ce=function(_0xcd0890,_0xa33e26){_0xcd0890=_0xcd0890-0x0;var _0xc94f5d=_0x1ce4[_0xcd0890];return _0xc94f5d;};'use strict';var _=require('lodash');var util=require(_0x41ce('0x0'));var moment=require(_0x41ce('0x1'));var BPromise=require(_0x41ce('0x2'));var rs=require(_0x41ce('0x3'));var fs=require('fs');var Redis=require(_0x41ce('0x4'));var db=require(_0x41ce('0x5'))['db'];var utils=require(_0x41ce('0x6'));var logger=require(_0x41ce('0x7'))(_0x41ce('0x8'));var config=require('../../config/environment');var jayson=require(_0x41ce('0x9'));var client=jayson[_0x41ce('0xa')][_0x41ce('0xb')]({'port':0x232a});config[_0x41ce('0xc')]=_[_0x41ce('0xd')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x41ce('0xc')]));require('./dashboard.socket')[_0x41ce('0xe')](socket);function respondWithRpcPromise(_0x555dc3,_0x52bfb6,_0x26092b){return new BPromise(function(_0x1e9f73,_0x6987a7){return client[_0x41ce('0xf')](_0x555dc3,_0x26092b)['then'](function(_0x1f8052){logger[_0x41ce('0x10')](_0x41ce('0x11'),_0x52bfb6,_0x41ce('0x12'));logger[_0x41ce('0x13')](_0x41ce('0x14'),_0x52bfb6,_0x41ce('0x12'),JSON['stringify'](_0x1f8052));if(_0x1f8052[_0x41ce('0x15')]){if(_0x1f8052[_0x41ce('0x15')][_0x41ce('0x16')]===0x1f4){logger['error']('Dashboard,\x20%s,\x20%s',_0x52bfb6,_0x1f8052['error'][_0x41ce('0x17')]);return _0x6987a7(_0x1f8052[_0x41ce('0x15')][_0x41ce('0x17')]);}logger[_0x41ce('0x15')](_0x41ce('0x11'),_0x52bfb6,_0x1f8052[_0x41ce('0x15')][_0x41ce('0x17')]);return _0x1e9f73(_0x1f8052[_0x41ce('0x15')][_0x41ce('0x17')]);}else{logger[_0x41ce('0x10')](_0x41ce('0x11'),_0x52bfb6,_0x41ce('0x12'));_0x1e9f73(_0x1f8052['result'][_0x41ce('0x17')]);}})[_0x41ce('0x18')](function(_0x28e60f){logger[_0x41ce('0x15')]('Dashboard,\x20%s,\x20%s',_0x52bfb6,_0x28e60f);_0x6987a7(_0x28e60f);});});} \ No newline at end of file diff --git a/server/api/dashboard/dashboard.socket.js b/server/api/dashboard/dashboard.socket.js index 6d82e14..63d779c 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 _0xfb9a=['dashboard:','save','emit','register','length'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xfb9a,0xec));var _0xafb9=function(_0x550df5,_0x18d3f3){_0x550df5=_0x550df5-0x0;var _0x4ae1cf=_0xfb9a[_0x550df5];return _0x4ae1cf;};'use strict';var DashboardEvents=require('./dashboard.events');var events=[_0xafb9('0x0'),'remove','update'];function createListener(_0x33a268,_0x36b2bf){return function(_0x5b6925){_0x36b2bf[_0xafb9('0x1')](_0x33a268,_0x5b6925);};}function removeListener(_0x2cbf73,_0x36cd59){return function(){DashboardEvents['removeListener'](_0x2cbf73,_0x36cd59);};}exports[_0xafb9('0x2')]=function(_0x2c5f11){for(var _0x30e73a=0x0,_0x8381c3=events[_0xafb9('0x3')];_0x30e73a<_0x8381c3;_0x30e73a++){var _0xda46ee=events[_0x30e73a];var _0x379cfe=createListener(_0xafb9('0x4')+_0xda46ee,_0x2c5f11);DashboardEvents['on'](_0xda46ee,_0x379cfe);}}; \ No newline at end of file +var _0x2112=['update','emit','removeListener','length','save','remove'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x2112,0x136));var _0x2211=function(_0x45314c,_0x2da86b){_0x45314c=_0x45314c-0x0;var _0x557633=_0x2112[_0x45314c];return _0x557633;};'use strict';var DashboardEvents=require('./dashboard.events');var events=[_0x2211('0x0'),_0x2211('0x1'),_0x2211('0x2')];function createListener(_0x3d719b,_0x177b6b){return function(_0x58e442){_0x177b6b[_0x2211('0x3')](_0x3d719b,_0x58e442);};}function removeListener(_0x52f094,_0x584daa){return function(){DashboardEvents[_0x2211('0x4')](_0x52f094,_0x584daa);};}exports['register']=function(_0x39b978){for(var _0x147afa=0x0,_0x5a3e11=events[_0x2211('0x5')];_0x147afa<_0x5a3e11;_0x147afa++){var _0x43e14a=events[_0x147afa];var _0x558d2d=createListener('dashboard:'+_0x43e14a,_0x39b978);DashboardEvents['on'](_0x43e14a,_0x558d2d);}}; \ No newline at end of file diff --git a/server/api/dashboard/index.js b/server/api/dashboard/index.js index 80ebd51..12af6fc 100644 --- a/server/api/dashboard/index.js +++ b/server/api/dashboard/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0713=['exports','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./dashboard.controller','get','isAuthenticated','index','/:id','show','/:id/items','getItems','create','post','/:id/clone','addItem','put','update'];(function(_0xb21a94,_0x36287f){var _0x3f6872=function(_0x15f0e1){while(--_0x15f0e1){_0xb21a94['push'](_0xb21a94['shift']());}};_0x3f6872(++_0x36287f);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var auth=require(_0x3071('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x3071('0x5'));var controller=require(_0x3071('0x6'));router[_0x3071('0x7')]('/',auth[_0x3071('0x8')](),controller[_0x3071('0x9')]);router[_0x3071('0x7')](_0x3071('0xa'),auth[_0x3071('0x8')](),controller[_0x3071('0xb')]);router[_0x3071('0x7')](_0x3071('0xc'),auth[_0x3071('0x8')](),controller[_0x3071('0xd')]);router['post']('/',auth[_0x3071('0x8')](),controller[_0x3071('0xe')]);router[_0x3071('0xf')](_0x3071('0x10'),auth[_0x3071('0x8')](),controller['clone']);router[_0x3071('0xf')](_0x3071('0xc'),auth[_0x3071('0x8')](),controller[_0x3071('0x11')]);router[_0x3071('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x3071('0x13')]);router['delete'](_0x3071('0xa'),auth[_0x3071('0x8')](),controller['destroy']);module[_0x3071('0x14')]=router; \ No newline at end of file +var _0x0713=['exports','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./dashboard.controller','get','isAuthenticated','index','/:id','show','/:id/items','getItems','create','post','/:id/clone','addItem','put','update'];(function(_0x27c4d4,_0x313527){var _0x5b9c77=function(_0x4ad2b5){while(--_0x4ad2b5){_0x27c4d4['push'](_0x27c4d4['shift']());}};_0x5b9c77(++_0x313527);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var auth=require(_0x3071('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x3071('0x5'));var controller=require(_0x3071('0x6'));router[_0x3071('0x7')]('/',auth[_0x3071('0x8')](),controller[_0x3071('0x9')]);router[_0x3071('0x7')](_0x3071('0xa'),auth[_0x3071('0x8')](),controller[_0x3071('0xb')]);router[_0x3071('0x7')](_0x3071('0xc'),auth[_0x3071('0x8')](),controller[_0x3071('0xd')]);router['post']('/',auth[_0x3071('0x8')](),controller[_0x3071('0xe')]);router[_0x3071('0xf')](_0x3071('0x10'),auth[_0x3071('0x8')](),controller['clone']);router[_0x3071('0xf')](_0x3071('0xc'),auth[_0x3071('0x8')](),controller[_0x3071('0x11')]);router[_0x3071('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x3071('0x13')]);router['delete'](_0x3071('0xa'),auth[_0x3071('0x8')](),controller['destroy']);module[_0x3071('0x14')]=router; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.attributes.js b/server/api/dashboardItem/dashboardItem.attributes.js index 0e352fb..931b937 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 _0x87db=['getDataValue','attrs','stringify','setDataValue','INTEGER','#2196f3','sequelize','lodash','exports','STRING','TEXT','long'];(function(_0x152c9d,_0x371656){var _0x462f34=function(_0x5a0f6b){while(--_0x5a0f6b){_0x152c9d['push'](_0x152c9d['shift']());}};_0x462f34(++_0x371656);}(_0x87db,0x1da));var _0xb87d=function(_0x4461b,_0x5dc2bd){_0x4461b=_0x4461b-0x0;var _0x2c541=_0x87db[_0x4461b];return _0x2c541;};'use strict';var Sequelize=require(_0xb87d('0x0'));var squel=require('squel');var _=require(_0xb87d('0x1'));module[_0xb87d('0x2')]={'title':{'type':Sequelize[_0xb87d('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xb87d('0x3')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0xb87d('0x4')](_0xb87d('0x5')),'get':function(){try{return JSON['parse'](this[_0xb87d('0x6')](_0xb87d('0x7')));}catch(_0x444cc7){return[];}},'set':function(_0x57b2c8){try{this['setDataValue']('attrs',JSON[_0xb87d('0x8')](_0x57b2c8));}catch(_0x3bff7b){this[_0xb87d('0x9')](_0xb87d('0x7'),JSON['stringify']([]));}}},'sizeX':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0xb87d('0xa')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize['INTEGER']},'col':{'type':Sequelize[_0xb87d('0xa')]},'background':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0xb87d('0x3')],'allowNull':![],'defaultValue':_0xb87d('0xb'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0xb87d('0x3')]}}; \ No newline at end of file +var _0x22e1=['#ffffff','#2196f3','sequelize','squel','STRING','attrs','setDataValue','stringify','INTEGER'];(function(_0x362e60,_0xda75bf){var _0x15a4b4=function(_0x162579){while(--_0x162579){_0x362e60['push'](_0x362e60['shift']());}};_0x15a4b4(++_0xda75bf);}(_0x22e1,0x9b));var _0x122e=function(_0x402070,_0x4f1dd5){_0x402070=_0x402070-0x0;var _0x4bfc14=_0x22e1[_0x402070];return _0x4bfc14;};'use strict';var Sequelize=require(_0x122e('0x0'));var squel=require(_0x122e('0x1'));var _=require('lodash');module['exports']={'title':{'type':Sequelize[_0x122e('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x122e('0x2')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize['TEXT']('long'),'get':function(){try{return JSON['parse'](this['getDataValue'](_0x122e('0x3')));}catch(_0x1fd090){return[];}},'set':function(_0x2a4fca){try{this[_0x122e('0x4')](_0x122e('0x3'),JSON[_0x122e('0x5')](_0x2a4fca));}catch(_0x2d63e){this[_0x122e('0x4')](_0x122e('0x3'),JSON[_0x122e('0x5')]([]));}}},'sizeX':{'type':Sequelize[_0x122e('0x6')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0x122e('0x6')]},'col':{'type':Sequelize[_0x122e('0x6')]},'background':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x122e('0x7'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x122e('0x8'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0x122e('0x2')]}}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.controller.js b/server/api/dashboardItem/dashboardItem.controller.js index 8d2411d..a103cba 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 _0x1d8a=['redis','localhost','register','sendStatus','status','end','json','count','offset','set','Content-Range','apply','reject','save','destroy','then','stack','show','params','model','keys','DashboardItem','rawAttributes','query','filters','attributes','intersection','fields','includeAll','merge','options','find','catch','type','iframe','attrUrl','attrs','value','custom','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','attrMetric','total','attrVoiceQueues','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','attrReport','reportType','attrRefresh','error','widgetAttributes:\x20%s','stringify','body','update','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment'];(function(_0x338205,_0x367ed8){var _0x160849=function(_0x376015){while(--_0x376015){_0x338205['push'](_0x338205['shift']());}};_0x160849(++_0x367ed8);}(_0x1d8a,0x1f1));var _0xa1d8=function(_0x543f4c,_0x285338){_0x543f4c=_0x543f4c-0x0;var _0x5ba786=_0x1d8a[_0x543f4c];return _0x5ba786;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xa1d8('0x0'));var rimraf=require(_0xa1d8('0x1'));var zipdir=require(_0xa1d8('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa1d8('0x3'));var moment=require(_0xa1d8('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xa1d8('0x5'));var util=require(_0xa1d8('0x6'));var path=require(_0xa1d8('0x7'));var sox=require(_0xa1d8('0x8'));var csv=require(_0xa1d8('0x9'));var ejs=require(_0xa1d8('0xa'));var fs=require('fs');var _=require(_0xa1d8('0xb'));var squel=require('squel');var crypto=require(_0xa1d8('0xc'));var jsforce=require(_0xa1d8('0xd'));var deskjs=require(_0xa1d8('0xe'));var toCsv=require(_0xa1d8('0x9'));var querystring=require('querystring');var Papa=require(_0xa1d8('0xf'));var Redis=require(_0xa1d8('0x10'));var authService=require(_0xa1d8('0x11'));var qs=require(_0xa1d8('0x12'));var as=require(_0xa1d8('0x13'));var hardwareService=require(_0xa1d8('0x14'));var logger=require(_0xa1d8('0x15'))(_0xa1d8('0x16'));var utils=require(_0xa1d8('0x17'));var config=require(_0xa1d8('0x18'));var db=require('../../mysqldb')['db'];config[_0xa1d8('0x19')]=_['defaults'](config['redis'],{'host':_0xa1d8('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa1d8('0x19')]));require('./dashboardItem.socket')[_0xa1d8('0x1b')](socket);function respondWithStatusCode(_0x820b97,_0x33cf83){_0x33cf83=_0x33cf83||0xcc;return function(_0x18e7d6){if(_0x18e7d6){return _0x820b97[_0xa1d8('0x1c')](_0x33cf83);}return _0x820b97[_0xa1d8('0x1d')](_0x33cf83)[_0xa1d8('0x1e')]();};}function respondWithResult(_0x1f5e84,_0x423ac0){_0x423ac0=_0x423ac0||0xc8;return function(_0x2efc95){if(_0x2efc95){return _0x1f5e84[_0xa1d8('0x1d')](_0x423ac0)[_0xa1d8('0x1f')](_0x2efc95);}};}function respondWithFilteredResult(_0x38c3fc,_0x3a7ca8){return function(_0xede6cc){if(_0xede6cc){var _0x5d70c9=_0xede6cc[_0xa1d8('0x20')],_0x30e44d=_0x3a7ca8[_0xa1d8('0x21')],_0x2821e8=_0x3a7ca8['offset']+_0x3a7ca8['limit'],_0x351249;if(_0x2821e8>=_0x5d70c9){_0x2821e8=_0x5d70c9;_0x351249=0xc8;}else{_0x351249=0xce;}_0x38c3fc[_0xa1d8('0x1d')](_0x351249);return _0x38c3fc[_0xa1d8('0x22')](_0xa1d8('0x23'),_0x30e44d+'-'+_0x2821e8+'/'+_0x5d70c9)[_0xa1d8('0x1f')](_0xede6cc);}return null;};}function patchUpdates(_0x20788f){return function(_0x5bff2e){try{jsonpatch[_0xa1d8('0x24')](_0x5bff2e,_0x20788f,!![]);}catch(_0xf365e4){return BPromise[_0xa1d8('0x25')](_0xf365e4);}return _0x5bff2e[_0xa1d8('0x26')]();};}function saveUpdates(_0x4c2a8b,_0x425519){return function(_0x562d58){if(_0x562d58){return _0x562d58['update'](_0x4c2a8b)['then'](function(_0x73da2b){return _0x73da2b;});}return null;};}function removeEntity(_0x4b379c,_0x42021a){return function(_0x72613f){if(_0x72613f){return _0x72613f[_0xa1d8('0x27')]()[_0xa1d8('0x28')](function(){_0x4b379c['status'](0xcc)[_0xa1d8('0x1e')]();});}};}function handleEntityNotFound(_0x346216,_0x42b18b){return function(_0x109e93){if(!_0x109e93){_0x346216[_0xa1d8('0x1c')](0x194);}return _0x109e93;};}function handleError(_0x1026ca,_0x575a7c){_0x575a7c=_0x575a7c||0x1f4;return function(_0x4e32c0){logger['error'](_0x4e32c0[_0xa1d8('0x29')]);if(_0x4e32c0['name']){delete _0x4e32c0['name'];}_0x1026ca['status'](_0x575a7c)['send'](_0x4e32c0);};}exports[_0xa1d8('0x2a')]=function(_0x297778,_0x233dfc){var _0x41b6dc={'raw':![],'where':{'id':_0x297778[_0xa1d8('0x2b')]['id']}},_0x44062a={};_0x44062a[_0xa1d8('0x2c')]=_[_0xa1d8('0x2d')](db[_0xa1d8('0x2e')][_0xa1d8('0x2f')]);_0x44062a[_0xa1d8('0x30')]=_[_0xa1d8('0x2d')](_0x297778[_0xa1d8('0x30')]);_0x44062a[_0xa1d8('0x31')]=_['intersection'](_0x44062a[_0xa1d8('0x2c')],_0x44062a[_0xa1d8('0x30')]);_0x41b6dc[_0xa1d8('0x32')]=_[_0xa1d8('0x33')](_0x44062a[_0xa1d8('0x2c')],qs[_0xa1d8('0x34')](_0x297778[_0xa1d8('0x30')][_0xa1d8('0x34')]));_0x41b6dc[_0xa1d8('0x32')]=_0x41b6dc['attributes']['length']?_0x41b6dc['attributes']:_0x44062a[_0xa1d8('0x2c')];if(_0x297778[_0xa1d8('0x30')][_0xa1d8('0x35')]){_0x41b6dc['include']=[{'all':!![]}];}_0x41b6dc=_[_0xa1d8('0x36')]({},_0x41b6dc,_0x297778[_0xa1d8('0x37')]);return db[_0xa1d8('0x2e')][_0xa1d8('0x38')](_0x41b6dc)[_0xa1d8('0x28')](handleEntityNotFound(_0x233dfc,null))[_0xa1d8('0x28')](respondWithResult(_0x233dfc,null))[_0xa1d8('0x39')](handleError(_0x233dfc,null));};exports[_0xa1d8('0x27')]=function(_0x2d2d77,_0x376cfd){return db[_0xa1d8('0x2e')][_0xa1d8('0x38')]({'where':{'id':_0x2d2d77[_0xa1d8('0x2b')]['id']}})['then'](handleEntityNotFound(_0x376cfd,null))[_0xa1d8('0x28')](removeEntity(_0x376cfd,null))[_0xa1d8('0x39')](handleError(_0x376cfd,null));};function widgetAttributes(_0x57a0f4){try{switch(_0x57a0f4[_0xa1d8('0x3a')]){case _0xa1d8('0x3b'):return[{'name':_0xa1d8('0x3c'),'value':_0x57a0f4[_0xa1d8('0x3c')]||(_0x57a0f4[_0xa1d8('0x3d')]&&_0x57a0f4['attrs'][0x0]?_0x57a0f4[_0xa1d8('0x3d')][0x0][_0xa1d8('0x3e')]:undefined)||'https://'}];case _0xa1d8('0x3f'):return[{'name':_0xa1d8('0x40'),'value':_0x57a0f4[_0xa1d8('0x40')]||(_0x57a0f4[_0xa1d8('0x3d')]&&_0x57a0f4[_0xa1d8('0x3d')][0x0]?_0x57a0f4['attrs'][0x0][_0xa1d8('0x3e')]:undefined)||''}];case _0xa1d8('0x41'):return[{'name':_0xa1d8('0x42'),'value':_0x57a0f4[_0xa1d8('0x42')]||(_0x57a0f4[_0xa1d8('0x3d')]&&_0x57a0f4[_0xa1d8('0x3d')][0x0]?_0x57a0f4[_0xa1d8('0x3d')][0x0][_0xa1d8('0x3e')]:undefined)||_0xa1d8('0x43')},{'name':_0xa1d8('0x44'),'value':_0x57a0f4[_0xa1d8('0x44')]||(_0x57a0f4[_0xa1d8('0x3d')]&&_0x57a0f4[_0xa1d8('0x3d')][0x1]?_0x57a0f4[_0xa1d8('0x3d')][0x1][_0xa1d8('0x3e')]:undefined)||_0xa1d8('0x45')},{'name':_0xa1d8('0x46'),'value':_0x57a0f4[_0xa1d8('0x46')]||(_0x57a0f4[_0xa1d8('0x3d')]&&_0x57a0f4[_0xa1d8('0x3d')][0x2]?_0x57a0f4[_0xa1d8('0x3d')][0x2][_0xa1d8('0x3e')]:undefined)||0xc}];case'counter':return[{'name':_0xa1d8('0x47'),'value':_0x57a0f4[_0xa1d8('0x47')]||(_0x57a0f4['attrs']&&_0x57a0f4[_0xa1d8('0x3d')][0x0]?_0x57a0f4['attrs'][0x0][_0xa1d8('0x3e')]:undefined)||_0xa1d8('0x48')},{'name':'attrVoiceQueues','value':_0x57a0f4[_0xa1d8('0x49')]||(_0x57a0f4[_0xa1d8('0x3d')]&&_0x57a0f4[_0xa1d8('0x3d')][0x1]?_0x57a0f4[_0xa1d8('0x3d')][0x1][_0xa1d8('0x3e')]:undefined)||[]},{'name':_0xa1d8('0x46'),'value':_0x57a0f4[_0xa1d8('0x46')]||(_0x57a0f4[_0xa1d8('0x3d')]&&_0x57a0f4[_0xa1d8('0x3d')][0x2]?_0x57a0f4['attrs'][0x2][_0xa1d8('0x3e')]:undefined)||0x14}];case _0xa1d8('0x4a'):case _0xa1d8('0x4b'):return[{'name':_0xa1d8('0x4c'),'value':_0x57a0f4[_0xa1d8('0x4c')]||(_0x57a0f4[_0xa1d8('0x3d')]&&_0x57a0f4[_0xa1d8('0x3d')][0x0]?_0x57a0f4[_0xa1d8('0x3d')][0x0][_0xa1d8('0x3e')]:undefined)||_0xa1d8('0x48')},{'name':_0xa1d8('0x4d'),'value':_0x57a0f4['attrSerie2']||(_0x57a0f4[_0xa1d8('0x3d')]&&_0x57a0f4['attrs'][0x1]?_0x57a0f4[_0xa1d8('0x3d')][0x1]['value']:undefined)||null},{'name':_0xa1d8('0x4e'),'value':_0x57a0f4['attrSerie3']||(_0x57a0f4['attrs']&&_0x57a0f4['attrs'][0x2]?_0x57a0f4[_0xa1d8('0x3d')][0x2][_0xa1d8('0x3e')]:undefined)||null},{'name':_0xa1d8('0x49'),'value':_0x57a0f4[_0xa1d8('0x49')]||(_0x57a0f4[_0xa1d8('0x3d')]&&_0x57a0f4[_0xa1d8('0x3d')][0x3]?_0x57a0f4[_0xa1d8('0x3d')][0x3][_0xa1d8('0x3e')]:undefined)||[]}];case'web-report':return[{'name':_0xa1d8('0x4f'),'type':_0x57a0f4[_0xa1d8('0x50')]||(_0x57a0f4['attrs']&&_0x57a0f4['attrs'][0x0]?_0x57a0f4['attrs'][0x0]['type']:undefined)||null,'value':_0x57a0f4[_0xa1d8('0x4f')]||(_0x57a0f4[_0xa1d8('0x3d')]&&_0x57a0f4['attrs'][0x0]?_0x57a0f4[_0xa1d8('0x3d')][0x0]['value']:undefined)||null},{'name':_0xa1d8('0x51'),'value':_0x57a0f4[_0xa1d8('0x51')]||(_0x57a0f4[_0xa1d8('0x3d')]&&_0x57a0f4[_0xa1d8('0x3d')][0x1]?_0x57a0f4['attrs'][0x1][_0xa1d8('0x3e')]:undefined)||0x0}];default:return[];}}catch(_0x5a589e){logger[_0xa1d8('0x52')](_0xa1d8('0x53'),JSON[_0xa1d8('0x54')](_0x5a589e));return[];}}exports['create']=function(_0x2c69ca,_0xd65df1){if(_0x2c69ca[_0xa1d8('0x55')]){_0x2c69ca['body'][_0xa1d8('0x3d')]=widgetAttributes(_0x2c69ca['body']);}return db[_0xa1d8('0x2e')]['create'](_0x2c69ca[_0xa1d8('0x55')],{})[_0xa1d8('0x28')](respondWithResult(_0xd65df1,0xc9))[_0xa1d8('0x39')](handleError(_0xd65df1,null));};exports[_0xa1d8('0x56')]=function(_0x57be40,_0x48fbc3){if(_0x57be40[_0xa1d8('0x55')]['id']){delete _0x57be40['body']['id'];}_0x57be40[_0xa1d8('0x55')][_0xa1d8('0x3d')]=widgetAttributes(_0x57be40[_0xa1d8('0x55')]);return db[_0xa1d8('0x2e')][_0xa1d8('0x38')]({'where':{'id':_0x57be40['params']['id']}})[_0xa1d8('0x28')](handleEntityNotFound(_0x48fbc3,null))[_0xa1d8('0x28')](saveUpdates(_0x57be40[_0xa1d8('0x55')],null))[_0xa1d8('0x28')](respondWithResult(_0x48fbc3,null))[_0xa1d8('0x39')](handleError(_0x48fbc3,null));}; \ No newline at end of file +var _0xede3=['querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','localhost','./dashboardItem.socket','register','end','status','json','offset','limit','set','Content-Range','apply','reject','save','then','sendStatus','error','name','send','params','keys','rawAttributes','query','filters','intersection','model','attributes','fields','includeAll','merge','options','DashboardItem','find','catch','type','iframe','attrUrl','attrs','https://','custom','attrPath','value','clock','attrHourFormat','attrTimezone','attrFontSize','attrMetric','attrVoiceQueues','multibar-chart','pie-chart','attrSerie1','total','attrSerie2','attrSerie3','web-report','attrReport','attrRefresh','widgetAttributes:\x20%s','stringify','body','create','update','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','squel','crypto','jsforce','desk.js','to-csv'];(function(_0x3d4a53,_0x5e474f){var _0x884363=function(_0x3629c2){while(--_0x3629c2){_0x3d4a53['push'](_0x3d4a53['shift']());}};_0x884363(++_0x5e474f);}(_0xede3,0xf3));var _0x3ede=function(_0x5484a0,_0x5546cf){_0x5484a0=_0x5484a0-0x0;var _0x827c63=_0xede3[_0x5484a0];return _0x827c63;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x3ede('0x0'));var zipdir=require(_0x3ede('0x1'));var jsonpatch=require(_0x3ede('0x2'));var rp=require(_0x3ede('0x3'));var moment=require(_0x3ede('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x3ede('0x5'));var util=require(_0x3ede('0x6'));var path=require(_0x3ede('0x7'));var sox=require(_0x3ede('0x8'));var csv=require('to-csv');var ejs=require(_0x3ede('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0x3ede('0xa'));var crypto=require(_0x3ede('0xb'));var jsforce=require(_0x3ede('0xc'));var deskjs=require(_0x3ede('0xd'));var toCsv=require(_0x3ede('0xe'));var querystring=require(_0x3ede('0xf'));var Papa=require(_0x3ede('0x10'));var Redis=require(_0x3ede('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x3ede('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3ede('0x13'));var logger=require(_0x3ede('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x3ede('0x15'));var db=require(_0x3ede('0x16'))['db'];config[_0x3ede('0x17')]=_[_0x3ede('0x18')](config[_0x3ede('0x17')],{'host':_0x3ede('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3ede('0x17')]));require(_0x3ede('0x1a'))[_0x3ede('0x1b')](socket);function respondWithStatusCode(_0x5bc400,_0x33830){_0x33830=_0x33830||0xcc;return function(_0x3f4494){if(_0x3f4494){return _0x5bc400['sendStatus'](_0x33830);}return _0x5bc400['status'](_0x33830)[_0x3ede('0x1c')]();};}function respondWithResult(_0x1d3f1e,_0x45909e){_0x45909e=_0x45909e||0xc8;return function(_0x3ec44e){if(_0x3ec44e){return _0x1d3f1e[_0x3ede('0x1d')](_0x45909e)[_0x3ede('0x1e')](_0x3ec44e);}};}function respondWithFilteredResult(_0x1a7746,_0x3fb9ac){return function(_0xdad1eb){if(_0xdad1eb){var _0xf24b82=_0xdad1eb['count'],_0x28d7dc=_0x3fb9ac['offset'],_0x428333=_0x3fb9ac[_0x3ede('0x1f')]+_0x3fb9ac[_0x3ede('0x20')],_0x10a124;if(_0x428333>=_0xf24b82){_0x428333=_0xf24b82;_0x10a124=0xc8;}else{_0x10a124=0xce;}_0x1a7746['status'](_0x10a124);return _0x1a7746[_0x3ede('0x21')](_0x3ede('0x22'),_0x28d7dc+'-'+_0x428333+'/'+_0xf24b82)[_0x3ede('0x1e')](_0xdad1eb);}return null;};}function patchUpdates(_0xb06ecd){return function(_0x17b299){try{jsonpatch[_0x3ede('0x23')](_0x17b299,_0xb06ecd,!![]);}catch(_0x7e593a){return BPromise[_0x3ede('0x24')](_0x7e593a);}return _0x17b299[_0x3ede('0x25')]();};}function saveUpdates(_0xf45821,_0x2356e7){return function(_0x241a2d){if(_0x241a2d){return _0x241a2d['update'](_0xf45821)[_0x3ede('0x26')](function(_0x2df81d){return _0x2df81d;});}return null;};}function removeEntity(_0x2a7e3c,_0x422b81){return function(_0x1d97b9){if(_0x1d97b9){return _0x1d97b9['destroy']()['then'](function(){_0x2a7e3c[_0x3ede('0x1d')](0xcc)[_0x3ede('0x1c')]();});}};}function handleEntityNotFound(_0x2dc0a6,_0x4d06b1){return function(_0x2db192){if(!_0x2db192){_0x2dc0a6[_0x3ede('0x27')](0x194);}return _0x2db192;};}function handleError(_0x4ff984,_0x6d0ad8){_0x6d0ad8=_0x6d0ad8||0x1f4;return function(_0x5e26d9){logger[_0x3ede('0x28')](_0x5e26d9['stack']);if(_0x5e26d9[_0x3ede('0x29')]){delete _0x5e26d9[_0x3ede('0x29')];}_0x4ff984[_0x3ede('0x1d')](_0x6d0ad8)[_0x3ede('0x2a')](_0x5e26d9);};}exports['show']=function(_0x1549ec,_0x4082aa){var _0x3b945b={'raw':![],'where':{'id':_0x1549ec[_0x3ede('0x2b')]['id']}},_0x62daee={};_0x62daee['model']=_[_0x3ede('0x2c')](db['DashboardItem'][_0x3ede('0x2d')]);_0x62daee['query']=_[_0x3ede('0x2c')](_0x1549ec[_0x3ede('0x2e')]);_0x62daee[_0x3ede('0x2f')]=_[_0x3ede('0x30')](_0x62daee[_0x3ede('0x31')],_0x62daee[_0x3ede('0x2e')]);_0x3b945b[_0x3ede('0x32')]=_[_0x3ede('0x30')](_0x62daee[_0x3ede('0x31')],qs[_0x3ede('0x33')](_0x1549ec[_0x3ede('0x2e')]['fields']));_0x3b945b[_0x3ede('0x32')]=_0x3b945b[_0x3ede('0x32')]['length']?_0x3b945b[_0x3ede('0x32')]:_0x62daee[_0x3ede('0x31')];if(_0x1549ec[_0x3ede('0x2e')][_0x3ede('0x34')]){_0x3b945b['include']=[{'all':!![]}];}_0x3b945b=_[_0x3ede('0x35')]({},_0x3b945b,_0x1549ec[_0x3ede('0x36')]);return db[_0x3ede('0x37')][_0x3ede('0x38')](_0x3b945b)['then'](handleEntityNotFound(_0x4082aa,null))[_0x3ede('0x26')](respondWithResult(_0x4082aa,null))['catch'](handleError(_0x4082aa,null));};exports['destroy']=function(_0x5152a7,_0x72d4bb){return db[_0x3ede('0x37')]['find']({'where':{'id':_0x5152a7[_0x3ede('0x2b')]['id']}})[_0x3ede('0x26')](handleEntityNotFound(_0x72d4bb,null))[_0x3ede('0x26')](removeEntity(_0x72d4bb,null))[_0x3ede('0x39')](handleError(_0x72d4bb,null));};function widgetAttributes(_0x348dcb){try{switch(_0x348dcb[_0x3ede('0x3a')]){case _0x3ede('0x3b'):return[{'name':_0x3ede('0x3c'),'value':_0x348dcb[_0x3ede('0x3c')]||(_0x348dcb[_0x3ede('0x3d')]&&_0x348dcb['attrs'][0x0]?_0x348dcb['attrs'][0x0]['value']:undefined)||_0x3ede('0x3e')}];case _0x3ede('0x3f'):return[{'name':_0x3ede('0x40'),'value':_0x348dcb[_0x3ede('0x40')]||(_0x348dcb[_0x3ede('0x3d')]&&_0x348dcb[_0x3ede('0x3d')][0x0]?_0x348dcb['attrs'][0x0][_0x3ede('0x41')]:undefined)||''}];case _0x3ede('0x42'):return[{'name':_0x3ede('0x43'),'value':_0x348dcb[_0x3ede('0x43')]||(_0x348dcb[_0x3ede('0x3d')]&&_0x348dcb[_0x3ede('0x3d')][0x0]?_0x348dcb['attrs'][0x0]['value']:undefined)||'HH:mm:ss'},{'name':_0x3ede('0x44'),'value':_0x348dcb['attrTimezone']||(_0x348dcb[_0x3ede('0x3d')]&&_0x348dcb[_0x3ede('0x3d')][0x1]?_0x348dcb[_0x3ede('0x3d')][0x1]['value']:undefined)||'0.00'},{'name':_0x3ede('0x45'),'value':_0x348dcb[_0x3ede('0x45')]||(_0x348dcb['attrs']&&_0x348dcb[_0x3ede('0x3d')][0x2]?_0x348dcb['attrs'][0x2][_0x3ede('0x41')]:undefined)||0xc}];case'counter':return[{'name':_0x3ede('0x46'),'value':_0x348dcb[_0x3ede('0x46')]||(_0x348dcb[_0x3ede('0x3d')]&&_0x348dcb[_0x3ede('0x3d')][0x0]?_0x348dcb['attrs'][0x0][_0x3ede('0x41')]:undefined)||'total'},{'name':_0x3ede('0x47'),'value':_0x348dcb[_0x3ede('0x47')]||(_0x348dcb[_0x3ede('0x3d')]&&_0x348dcb[_0x3ede('0x3d')][0x1]?_0x348dcb[_0x3ede('0x3d')][0x1]['value']:undefined)||[]},{'name':_0x3ede('0x45'),'value':_0x348dcb[_0x3ede('0x45')]||(_0x348dcb[_0x3ede('0x3d')]&&_0x348dcb[_0x3ede('0x3d')][0x2]?_0x348dcb[_0x3ede('0x3d')][0x2][_0x3ede('0x41')]:undefined)||0x14}];case _0x3ede('0x48'):case _0x3ede('0x49'):return[{'name':_0x3ede('0x4a'),'value':_0x348dcb[_0x3ede('0x4a')]||(_0x348dcb[_0x3ede('0x3d')]&&_0x348dcb[_0x3ede('0x3d')][0x0]?_0x348dcb[_0x3ede('0x3d')][0x0][_0x3ede('0x41')]:undefined)||_0x3ede('0x4b')},{'name':_0x3ede('0x4c'),'value':_0x348dcb['attrSerie2']||(_0x348dcb['attrs']&&_0x348dcb[_0x3ede('0x3d')][0x1]?_0x348dcb[_0x3ede('0x3d')][0x1][_0x3ede('0x41')]:undefined)||null},{'name':_0x3ede('0x4d'),'value':_0x348dcb[_0x3ede('0x4d')]||(_0x348dcb[_0x3ede('0x3d')]&&_0x348dcb[_0x3ede('0x3d')][0x2]?_0x348dcb[_0x3ede('0x3d')][0x2][_0x3ede('0x41')]:undefined)||null},{'name':'attrVoiceQueues','value':_0x348dcb[_0x3ede('0x47')]||(_0x348dcb[_0x3ede('0x3d')]&&_0x348dcb['attrs'][0x3]?_0x348dcb['attrs'][0x3]['value']:undefined)||[]}];case _0x3ede('0x4e'):return[{'name':_0x3ede('0x4f'),'type':_0x348dcb['reportType']||(_0x348dcb[_0x3ede('0x3d')]&&_0x348dcb['attrs'][0x0]?_0x348dcb['attrs'][0x0][_0x3ede('0x3a')]:undefined)||null,'value':_0x348dcb[_0x3ede('0x4f')]||(_0x348dcb['attrs']&&_0x348dcb[_0x3ede('0x3d')][0x0]?_0x348dcb[_0x3ede('0x3d')][0x0][_0x3ede('0x41')]:undefined)||null},{'name':_0x3ede('0x50'),'value':_0x348dcb[_0x3ede('0x50')]||(_0x348dcb[_0x3ede('0x3d')]&&_0x348dcb['attrs'][0x1]?_0x348dcb[_0x3ede('0x3d')][0x1][_0x3ede('0x41')]:undefined)||0x0}];default:return[];}}catch(_0x23a9e1){logger[_0x3ede('0x28')](_0x3ede('0x51'),JSON[_0x3ede('0x52')](_0x23a9e1));return[];}}exports['create']=function(_0xd611b7,_0x389a12){if(_0xd611b7[_0x3ede('0x53')]){_0xd611b7['body'][_0x3ede('0x3d')]=widgetAttributes(_0xd611b7[_0x3ede('0x53')]);}return db['DashboardItem'][_0x3ede('0x54')](_0xd611b7[_0x3ede('0x53')],{})[_0x3ede('0x26')](respondWithResult(_0x389a12,0xc9))[_0x3ede('0x39')](handleError(_0x389a12,null));};exports[_0x3ede('0x55')]=function(_0x4cb5c0,_0x38f10c){if(_0x4cb5c0[_0x3ede('0x53')]['id']){delete _0x4cb5c0[_0x3ede('0x53')]['id'];}_0x4cb5c0[_0x3ede('0x53')][_0x3ede('0x3d')]=widgetAttributes(_0x4cb5c0[_0x3ede('0x53')]);return db[_0x3ede('0x37')]['find']({'where':{'id':_0x4cb5c0[_0x3ede('0x2b')]['id']}})[_0x3ede('0x26')](handleEntityNotFound(_0x38f10c,null))[_0x3ede('0x26')](saveUpdates(_0x4cb5c0[_0x3ede('0x53')],null))[_0x3ede('0x26')](respondWithResult(_0x38f10c,null))[_0x3ede('0x39')](handleError(_0x38f10c,null));}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.events.js b/server/api/dashboardItem/dashboardItem.events.js index cd27954..62dd8e1 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 _0xbdf3=['events','../../mysqldb','DashboardItem','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0xf89c3,_0x351bf1){var _0x274fc8=function(_0x5e0c91){while(--_0x5e0c91){_0xf89c3['push'](_0xf89c3['shift']());}};_0x274fc8(++_0x351bf1);}(_0xbdf3,0x155));var _0x3bdf=function(_0x32cf96,_0x7502d5){_0x32cf96=_0x32cf96-0x0;var _0x125cc1=_0xbdf3[_0x32cf96];return _0x125cc1;};'use strict';var EventEmitter=require(_0x3bdf('0x0'));var DashboardItem=require(_0x3bdf('0x1'))['db'][_0x3bdf('0x2')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0x3bdf('0x3')](0x0);var events={'afterCreate':_0x3bdf('0x4'),'afterUpdate':_0x3bdf('0x5'),'afterDestroy':_0x3bdf('0x6')};function emitEvent(_0x1fcbcd){return function(_0x5d2c68,_0x405100,_0x2bceca){DashboardItemEvents['emit'](_0x1fcbcd+':'+_0x5d2c68['id'],_0x5d2c68);DashboardItemEvents[_0x3bdf('0x7')](_0x1fcbcd,_0x5d2c68);_0x2bceca(null);};}for(var e in events){if(events[_0x3bdf('0x8')](e)){var event=events[e];DashboardItem[_0x3bdf('0x9')](e,emitEvent(event));}}module[_0x3bdf('0xa')]=DashboardItemEvents; \ No newline at end of file +var _0x3061=['remove','emit','hasOwnProperty','../../mysqldb','DashboardItem','setMaxListeners','save'];(function(_0x118b45,_0x502b16){var _0x2b2b5a=function(_0x41b5ae){while(--_0x41b5ae){_0x118b45['push'](_0x118b45['shift']());}};_0x2b2b5a(++_0x502b16);}(_0x3061,0x176));var _0x1306=function(_0x5a3cf0,_0x160a68){_0x5a3cf0=_0x5a3cf0-0x0;var _0x5a64ee=_0x3061[_0x5a3cf0];return _0x5a64ee;};'use strict';var EventEmitter=require('events');var DashboardItem=require(_0x1306('0x0'))['db'][_0x1306('0x1')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0x1306('0x2')](0x0);var events={'afterCreate':_0x1306('0x3'),'afterUpdate':'update','afterDestroy':_0x1306('0x4')};function emitEvent(_0x3c29da){return function(_0x336a5d,_0x5c37b1,_0x5a29b4){DashboardItemEvents[_0x1306('0x5')](_0x3c29da+':'+_0x336a5d['id'],_0x336a5d);DashboardItemEvents[_0x1306('0x5')](_0x3c29da,_0x336a5d);_0x5a29b4(null);};}for(var e in events){if(events[_0x1306('0x6')](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 d963e26..f6b1b83 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 _0x832b=['util','../../config/logger','api','moment','path','rimraf','../../config/environment','./dashboardItem.attributes','exports','DashboardItem','dashboard_items'];(function(_0x5c9d75,_0xbfb706){var _0x3debef=function(_0x5b5939){while(--_0x5b5939){_0x5c9d75['push'](_0x5c9d75['shift']());}};_0x3debef(++_0xbfb706);}(_0x832b,0x8f));var _0xb832=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x832b[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0xb832('0x0'));var logger=require(_0xb832('0x1'))(_0xb832('0x2'));var moment=require(_0xb832('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xb832('0x4'));var rimraf=require(_0xb832('0x5'));var config=require(_0xb832('0x6'));var attributes=require(_0xb832('0x7'));module[_0xb832('0x8')]=function(_0x592a39,_0x4d59b7){return _0x592a39['define'](_0xb832('0x9'),attributes,{'tableName':_0xb832('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xca95=['dashboard_items','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','./dashboardItem.attributes','exports','define','DashboardItem'];(function(_0x51ff11,_0x2fd277){var _0x5b5b04=function(_0x226a31){while(--_0x226a31){_0x51ff11['push'](_0x51ff11['shift']());}};_0x5b5b04(++_0x2fd277);}(_0xca95,0x121));var _0x5ca9=function(_0xcbcd25,_0x24b282){_0xcbcd25=_0xcbcd25-0x0;var _0x4bd555=_0xca95[_0xcbcd25];return _0x4bd555;};'use strict';var _=require(_0x5ca9('0x0'));var util=require('util');var logger=require(_0x5ca9('0x1'))(_0x5ca9('0x2'));var moment=require('moment');var BPromise=require(_0x5ca9('0x3'));var rp=require(_0x5ca9('0x4'));var fs=require('fs');var path=require(_0x5ca9('0x5'));var rimraf=require(_0x5ca9('0x6'));var config=require('../../config/environment');var attributes=require(_0x5ca9('0x7'));module[_0x5ca9('0x8')]=function(_0x367856,_0x4d6c55){return _0x367856[_0x5ca9('0x9')](_0x5ca9('0xa'),attributes,{'tableName':_0x5ca9('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.rpc.js b/server/api/dashboardItem/dashboardItem.rpc.js index a859428..60d3496 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 _0x39c1=['client','redis','defaults','socket.io-emitter','./dashboardItem.socket','register','request','then','info','DashboardItem,\x20%s,\x20%s','request\x20sent','debug','DashboardItem,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x4d7abc,_0x46ff96){var _0x2ee259=function(_0x79bafb){while(--_0x79bafb){_0x4d7abc['push'](_0x4d7abc['shift']());}};_0x2ee259(++_0x46ff96);}(_0x39c1,0xde));var _0x139c=function(_0xcd389e,_0xaa53b4){_0xcd389e=_0xcd389e-0x0;var _0x3bef5c=_0x39c1[_0xcd389e];return _0x3bef5c;};'use strict';var _=require(_0x139c('0x0'));var util=require(_0x139c('0x1'));var moment=require(_0x139c('0x2'));var BPromise=require(_0x139c('0x3'));var rs=require(_0x139c('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x139c('0x5'));var logger=require(_0x139c('0x6'))(_0x139c('0x7'));var config=require(_0x139c('0x8'));var jayson=require(_0x139c('0x9'));var client=jayson[_0x139c('0xa')]['http']({'port':0x232a});config[_0x139c('0xb')]=_[_0x139c('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x139c('0xd'))(new Redis(config[_0x139c('0xb')]));require(_0x139c('0xe'))[_0x139c('0xf')](socket);function respondWithRpcPromise(_0x3152a5,_0x4bf9e1,_0x54692f){return new BPromise(function(_0x348255,_0x38a3f5){return client[_0x139c('0x10')](_0x3152a5,_0x54692f)[_0x139c('0x11')](function(_0x68f85d){logger[_0x139c('0x12')](_0x139c('0x13'),_0x4bf9e1,_0x139c('0x14'));logger[_0x139c('0x15')](_0x139c('0x16'),_0x4bf9e1,_0x139c('0x14'),JSON[_0x139c('0x17')](_0x68f85d));if(_0x68f85d[_0x139c('0x18')]){if(_0x68f85d['error'][_0x139c('0x19')]===0x1f4){logger[_0x139c('0x18')]('DashboardItem,\x20%s,\x20%s',_0x4bf9e1,_0x68f85d[_0x139c('0x18')][_0x139c('0x1a')]);return _0x38a3f5(_0x68f85d['error'][_0x139c('0x1a')]);}logger[_0x139c('0x18')](_0x139c('0x13'),_0x4bf9e1,_0x68f85d[_0x139c('0x18')]['message']);return _0x348255(_0x68f85d[_0x139c('0x18')][_0x139c('0x1a')]);}else{logger[_0x139c('0x12')](_0x139c('0x13'),_0x4bf9e1,_0x139c('0x14'));_0x348255(_0x68f85d[_0x139c('0x1b')][_0x139c('0x1a')]);}})[_0x139c('0x1c')](function(_0x5afd14){logger['error'](_0x139c('0x13'),_0x4bf9e1,_0x5afd14);_0x38a3f5(_0x5afd14);});});} \ No newline at end of file +var _0x575b=['code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','defaults','redis','localhost','socket.io-emitter','register','then','info','DashboardItem,\x20%s,\x20%s','request\x20sent','debug','DashboardItem,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x193be1,_0x3e1726){var _0x4dda07=function(_0x5cda9c){while(--_0x5cda9c){_0x193be1['push'](_0x193be1['shift']());}};_0x4dda07(++_0x3e1726);}(_0x575b,0xc8));var _0xb575=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x575b[_0x4565bf];return _0x5610ba;};'use strict';var _=require(_0xb575('0x0'));var util=require(_0xb575('0x1'));var moment=require(_0xb575('0x2'));var BPromise=require(_0xb575('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb575('0x4'));var db=require(_0xb575('0x5'))['db'];var utils=require(_0xb575('0x6'));var logger=require('../../config/logger')(_0xb575('0x7'));var config=require(_0xb575('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xb575('0x9')][_0xb575('0xa')]({'port':0x232a});config['redis']=_[_0xb575('0xb')](config[_0xb575('0xc')],{'host':_0xb575('0xd'),'port':0x18eb});var socket=require(_0xb575('0xe'))(new Redis(config[_0xb575('0xc')]));require('./dashboardItem.socket')[_0xb575('0xf')](socket);function respondWithRpcPromise(_0xc79c47,_0x545aac,_0x1590df){return new BPromise(function(_0x916a25,_0x2c0a45){return client['request'](_0xc79c47,_0x1590df)[_0xb575('0x10')](function(_0x12fdad){logger[_0xb575('0x11')](_0xb575('0x12'),_0x545aac,_0xb575('0x13'));logger[_0xb575('0x14')](_0xb575('0x15'),_0x545aac,'request\x20sent',JSON[_0xb575('0x16')](_0x12fdad));if(_0x12fdad[_0xb575('0x17')]){if(_0x12fdad[_0xb575('0x17')][_0xb575('0x18')]===0x1f4){logger[_0xb575('0x17')](_0xb575('0x12'),_0x545aac,_0x12fdad[_0xb575('0x17')][_0xb575('0x19')]);return _0x2c0a45(_0x12fdad['error']['message']);}logger[_0xb575('0x17')](_0xb575('0x12'),_0x545aac,_0x12fdad[_0xb575('0x17')]['message']);return _0x916a25(_0x12fdad[_0xb575('0x17')]['message']);}else{logger[_0xb575('0x11')](_0xb575('0x12'),_0x545aac,_0xb575('0x13'));_0x916a25(_0x12fdad[_0xb575('0x1a')]['message']);}})[_0xb575('0x1b')](function(_0x2dad60){logger[_0xb575('0x17')]('DashboardItem,\x20%s,\x20%s',_0x545aac,_0x2dad60);_0x2c0a45(_0x2dad60);});});} \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.socket.js b/server/api/dashboardItem/dashboardItem.socket.js index c65f036..3d4e0a1 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 _0xfbf7=['dashboardItem:','save','remove','emit','removeListener','register'];(function(_0x594867,_0x2ee5d3){var _0x9ac5b1=function(_0x4609ec){while(--_0x4609ec){_0x594867['push'](_0x594867['shift']());}};_0x9ac5b1(++_0x2ee5d3);}(_0xfbf7,0x14b));var _0x7fbf=function(_0x4e424d,_0x49f933){_0x4e424d=_0x4e424d-0x0;var _0x510b84=_0xfbf7[_0x4e424d];return _0x510b84;};'use strict';var DashboardItemEvents=require('./dashboardItem.events');var events=[_0x7fbf('0x0'),_0x7fbf('0x1'),'update'];function createListener(_0x231206,_0x413711){return function(_0x175e36){_0x413711[_0x7fbf('0x2')](_0x231206,_0x175e36);};}function removeListener(_0x23f292,_0x5f13e2){return function(){DashboardItemEvents[_0x7fbf('0x3')](_0x23f292,_0x5f13e2);};}exports[_0x7fbf('0x4')]=function(_0x12d9cb){for(var _0x44c8fc=0x0,_0x44c812=events['length'];_0x44c8fc<_0x44c812;_0x44c8fc++){var _0x4be777=events[_0x44c8fc];var _0x58a9c6=createListener(_0x7fbf('0x5')+_0x4be777,_0x12d9cb);DashboardItemEvents['on'](_0x4be777,_0x58a9c6);}}; \ No newline at end of file +var _0xef4e=['dashboardItem:','./dashboardItem.events','remove','update','emit','removeListener','register','length'];(function(_0x4d29eb,_0x5ba766){var _0x53cadb=function(_0x121326){while(--_0x121326){_0x4d29eb['push'](_0x4d29eb['shift']());}};_0x53cadb(++_0x5ba766);}(_0xef4e,0x179));var _0xeef4=function(_0x3c78e7,_0x19a615){_0x3c78e7=_0x3c78e7-0x0;var _0x46c763=_0xef4e[_0x3c78e7];return _0x46c763;};'use strict';var DashboardItemEvents=require(_0xeef4('0x0'));var events=['save',_0xeef4('0x1'),_0xeef4('0x2')];function createListener(_0x3a8c33,_0x2029df){return function(_0x31bb95){_0x2029df[_0xeef4('0x3')](_0x3a8c33,_0x31bb95);};}function removeListener(_0x55b9dd,_0x20d863){return function(){DashboardItemEvents[_0xeef4('0x4')](_0x55b9dd,_0x20d863);};}exports[_0xeef4('0x5')]=function(_0x4be30b){for(var _0xf6d579=0x0,_0x486354=events[_0xeef4('0x6')];_0xf6d579<_0x486354;_0xf6d579++){var _0x1bc46e=events[_0xf6d579];var _0x2412fe=createListener(_0xeef4('0x7')+_0x1bc46e,_0x4be30b);DashboardItemEvents['on'](_0x1bc46e,_0x2412fe);}}; \ No newline at end of file diff --git a/server/api/dashboardItem/index.js b/server/api/dashboardItem/index.js index b6e9d71..f422896 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 _0x4819=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboardItem.controller','get','isAuthenticated','create','put','/:id','delete','exports','util','path','connect-timeout'];(function(_0xd511d,_0x3546b9){var _0x3f148e=function(_0x51f35f){while(--_0x51f35f){_0xd511d['push'](_0xd511d['shift']());}};_0x3f148e(++_0x3546b9);}(_0x4819,0xcd));var _0x9481=function(_0x58a975,_0x4f7451){_0x58a975=_0x58a975-0x0;var _0x47f055=_0x4819[_0x58a975];return _0x47f055;};'use strict';var multer=require('multer');var util=require(_0x9481('0x0'));var path=require(_0x9481('0x1'));var timeout=require(_0x9481('0x2'));var express=require(_0x9481('0x3'));var router=express[_0x9481('0x4')]();var auth=require(_0x9481('0x5'));var interaction=require(_0x9481('0x6'));var config=require(_0x9481('0x7'));var controller=require(_0x9481('0x8'));router[_0x9481('0x9')]('/:id',auth[_0x9481('0xa')](),controller['show']);router['post']('/',auth[_0x9481('0xa')](),controller[_0x9481('0xb')]);router[_0x9481('0xc')](_0x9481('0xd'),auth[_0x9481('0xa')](),controller['update']);router[_0x9481('0xe')]('/:id',auth[_0x9481('0xa')](),controller['destroy']);module[_0x9481('0xf')]=router; \ No newline at end of file +var _0x1261=['util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboardItem.controller','get','show','post','create','put','/:id','isAuthenticated','update','destroy'];(function(_0x367447,_0x53cd50){var _0x26484c=function(_0x2443b2){while(--_0x2443b2){_0x367447['push'](_0x367447['shift']());}};_0x26484c(++_0x53cd50);}(_0x1261,0x144));var _0x1126=function(_0x13c4eb,_0x5d218c){_0x13c4eb=_0x13c4eb-0x0;var _0x421546=_0x1261[_0x13c4eb];return _0x421546;};'use strict';var multer=require('multer');var util=require(_0x1126('0x0'));var path=require(_0x1126('0x1'));var timeout=require(_0x1126('0x2'));var express=require(_0x1126('0x3'));var router=express[_0x1126('0x4')]();var auth=require(_0x1126('0x5'));var interaction=require(_0x1126('0x6'));var config=require(_0x1126('0x7'));var controller=require(_0x1126('0x8'));router[_0x1126('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x1126('0xa')]);router[_0x1126('0xb')]('/',auth['isAuthenticated'](),controller[_0x1126('0xc')]);router[_0x1126('0xd')](_0x1126('0xe'),auth[_0x1126('0xf')](),controller[_0x1126('0x10')]);router['delete'](_0x1126('0xe'),auth[_0x1126('0xf')](),controller[_0x1126('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/disposition/disposition.attributes.js b/server/api/disposition/disposition.attributes.js index b4d0129..92c5396 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 _0xec65=['STRING','exports'];(function(_0x10d6c8,_0x10ca4c){var _0x371bc2=function(_0xf0d5f6){while(--_0xf0d5f6){_0x10d6c8['push'](_0x10d6c8['shift']());}};_0x371bc2(++_0x10ca4c);}(_0xec65,0x17b));var _0x5ec6=function(_0x5037ab,_0x43209e){_0x5037ab=_0x5037ab-0x0;var _0x512adb=_0xec65[_0x5037ab];return _0x512adb;};'use strict';var Sequelize=require('sequelize');module[_0x5ec6('0x0')]={'name':{'type':Sequelize[_0x5ec6('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0x8960=['exports','STRING'];(function(_0x4e0ca5,_0x48b3b9){var _0x4c3032=function(_0x1406b8){while(--_0x1406b8){_0x4e0ca5['push'](_0x4e0ca5['shift']());}};_0x4c3032(++_0x48b3b9);}(_0x8960,0xa8));var _0x0896=function(_0x447b4c,_0x289c6d){_0x447b4c=_0x447b4c-0x0;var _0x16132a=_0x8960[_0x447b4c];return _0x16132a;};'use strict';var Sequelize=require('sequelize');module[_0x0896('0x0')]={'name':{'type':Sequelize[_0x0896('0x1')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/disposition/disposition.controller.js b/server/api/disposition/disposition.controller.js index 8e762ab..92bf604 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 _0xa0a1=['send','index','Disposition','rawAttributes','model','keys','query','filters','intersection','attributes','fields','nolimit','limit','order','sort','where','pick','filter','key','VIRTUAL','merge','options','count','includeAll','include','catch','params','length','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','find','html-pdf','rimraf','zip-dir','fast-json-patch','bluebird','mustache','path','sox','ejs','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','set','Content-Range','apply','reject','update','then','destroy','Dispositions','UserProfileResource','error','stack','name'];(function(_0x21d88d,_0x4ff19c){var _0x30a579=function(_0x24cf7a){while(--_0x24cf7a){_0x21d88d['push'](_0x21d88d['shift']());}};_0x30a579(++_0x4ff19c);}(_0xa0a1,0x15b));var _0x1a0a=function(_0x46ce00,_0x1a09bc){_0x46ce00=_0x46ce00-0x0;var _0x194846=_0xa0a1[_0x46ce00];return _0x194846;};'use strict';var pdf=require(_0x1a0a('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x1a0a('0x1'));var zipdir=require(_0x1a0a('0x2'));var jsonpatch=require(_0x1a0a('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x1a0a('0x4'));var Mustache=require(_0x1a0a('0x5'));var util=require('util');var path=require(_0x1a0a('0x6'));var sox=require(_0x1a0a('0x7'));var csv=require('to-csv');var ejs=require(_0x1a0a('0x8'));var fs=require('fs');var _=require(_0x1a0a('0x9'));var squel=require(_0x1a0a('0xa'));var crypto=require(_0x1a0a('0xb'));var jsforce=require(_0x1a0a('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x1a0a('0xd'));var querystring=require(_0x1a0a('0xe'));var Papa=require(_0x1a0a('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x1a0a('0x10'));var hardwareService=require(_0x1a0a('0x11'));var logger=require(_0x1a0a('0x12'))('api');var utils=require(_0x1a0a('0x13'));var config=require('../../config/environment');var db=require(_0x1a0a('0x14'))['db'];function respondWithStatusCode(_0x111e90,_0x461b36){_0x461b36=_0x461b36||0xcc;return function(_0x1877bf){if(_0x1877bf){return _0x111e90[_0x1a0a('0x15')](_0x461b36);}return _0x111e90[_0x1a0a('0x16')](_0x461b36)[_0x1a0a('0x17')]();};}function respondWithResult(_0x4f2b35,_0x88d191){_0x88d191=_0x88d191||0xc8;return function(_0x3b0b2d){if(_0x3b0b2d){return _0x4f2b35[_0x1a0a('0x16')](_0x88d191)[_0x1a0a('0x18')](_0x3b0b2d);}};}function respondWithFilteredResult(_0xe1fd03,_0x4c8080){return function(_0x16b8c9){if(_0x16b8c9){var _0x80627b=_0x16b8c9['count'],_0x157b74=_0x4c8080[_0x1a0a('0x19')],_0x5b6d15=_0x4c8080['offset']+_0x4c8080['limit'],_0x326e59;if(_0x5b6d15>=_0x80627b){_0x5b6d15=_0x80627b;_0x326e59=0xc8;}else{_0x326e59=0xce;}_0xe1fd03[_0x1a0a('0x16')](_0x326e59);return _0xe1fd03[_0x1a0a('0x1a')](_0x1a0a('0x1b'),_0x157b74+'-'+_0x5b6d15+'/'+_0x80627b)[_0x1a0a('0x18')](_0x16b8c9);}return null;};}function patchUpdates(_0x4d11a4){return function(_0x56b8a5){try{jsonpatch[_0x1a0a('0x1c')](_0x56b8a5,_0x4d11a4,!![]);}catch(_0x40903a){return BPromise[_0x1a0a('0x1d')](_0x40903a);}return _0x56b8a5['save']();};}function saveUpdates(_0x1976ba,_0x3547fe){return function(_0x5bb4bd){if(_0x5bb4bd){return _0x5bb4bd[_0x1a0a('0x1e')](_0x1976ba)[_0x1a0a('0x1f')](function(_0x316ae3){return _0x316ae3;});}return null;};}function removeEntity(_0x53e569,_0x159a2a){return function(_0xc33284){if(_0xc33284){return _0xc33284[_0x1a0a('0x20')]()['then'](function(){var _0x33fcf4=_0xc33284['get']({'plain':!![]});var _0x28c094=_0x1a0a('0x21');return db[_0x1a0a('0x22')][_0x1a0a('0x20')]({'where':{'type':_0x28c094,'resourceId':_0x33fcf4['id']}})[_0x1a0a('0x1f')](function(){return _0xc33284;});})['then'](function(){_0x53e569[_0x1a0a('0x16')](0xcc)[_0x1a0a('0x17')]();});}};}function handleEntityNotFound(_0x561407,_0x4cf939){return function(_0x55065f){if(!_0x55065f){_0x561407[_0x1a0a('0x15')](0x194);}return _0x55065f;};}function handleError(_0x3f61e4,_0x365ab5){_0x365ab5=_0x365ab5||0x1f4;return function(_0x4483a3){logger[_0x1a0a('0x23')](_0x4483a3[_0x1a0a('0x24')]);if(_0x4483a3[_0x1a0a('0x25')]){delete _0x4483a3[_0x1a0a('0x25')];}_0x3f61e4[_0x1a0a('0x16')](_0x365ab5)[_0x1a0a('0x26')](_0x4483a3);};}exports[_0x1a0a('0x27')]=function(_0x354d89,_0x385f2b){var _0x396c01={},_0x3069ab={},_0x297b12={'count':0x0,'rows':[]};var _0x4d44b0=db[_0x1a0a('0x28')][_0x1a0a('0x29')];_0x3069ab[_0x1a0a('0x2a')]=_[_0x1a0a('0x2b')](_0x4d44b0);_0x3069ab[_0x1a0a('0x2c')]=_[_0x1a0a('0x2b')](_0x354d89[_0x1a0a('0x2c')]);_0x3069ab[_0x1a0a('0x2d')]=_[_0x1a0a('0x2e')](_0x3069ab[_0x1a0a('0x2a')],_0x3069ab['query']);_0x396c01[_0x1a0a('0x2f')]=_[_0x1a0a('0x2e')](_0x3069ab['model'],qs[_0x1a0a('0x30')](_0x354d89['query']['fields']));_0x396c01[_0x1a0a('0x2f')]=_0x396c01[_0x1a0a('0x2f')]['length']?_0x396c01[_0x1a0a('0x2f')]:_0x3069ab[_0x1a0a('0x2a')];if(!_0x354d89[_0x1a0a('0x2c')]['hasOwnProperty'](_0x1a0a('0x31'))){_0x396c01[_0x1a0a('0x32')]=qs['limit'](_0x354d89[_0x1a0a('0x2c')][_0x1a0a('0x32')]);_0x396c01['offset']=qs[_0x1a0a('0x19')](_0x354d89[_0x1a0a('0x2c')][_0x1a0a('0x19')]);}_0x396c01[_0x1a0a('0x33')]=qs['sort'](_0x354d89[_0x1a0a('0x2c')][_0x1a0a('0x34')]);_0x396c01[_0x1a0a('0x35')]=qs[_0x1a0a('0x2d')](_[_0x1a0a('0x36')](_0x354d89[_0x1a0a('0x2c')],_0x3069ab[_0x1a0a('0x2d')]));if(_0x354d89[_0x1a0a('0x2c')][_0x1a0a('0x37')]){_0x396c01['where']=_['merge'](_0x396c01['where'],{'$or':_['map'](_0x4d44b0,function(_0x3be113){if(_0x3be113['type'][_0x1a0a('0x38')]!==_0x1a0a('0x39')){var _0x57605a={};_0x57605a[_0x3be113['field']]={'$like':'%'+_0x354d89[_0x1a0a('0x2c')][_0x1a0a('0x37')]+'%'};return _0x57605a;}})});}_0x396c01=_[_0x1a0a('0x3a')]({},_0x396c01,_0x354d89[_0x1a0a('0x3b')]);var _0x4e3960={'where':_0x396c01[_0x1a0a('0x35')]};return db['Disposition']['count'](_0x4e3960)['then'](function(_0x1411a8){_0x297b12[_0x1a0a('0x3c')]=_0x1411a8;if(_0x354d89['query'][_0x1a0a('0x3d')]){_0x396c01[_0x1a0a('0x3e')]=[{'all':!![]}];}return db['Disposition']['findAll'](_0x396c01);})[_0x1a0a('0x1f')](function(_0x14ff2a){_0x297b12['rows']=_0x14ff2a;return _0x297b12;})[_0x1a0a('0x1f')](respondWithFilteredResult(_0x385f2b,_0x396c01))[_0x1a0a('0x3f')](handleError(_0x385f2b,null));};exports['show']=function(_0x2f3ba1,_0x59bad4){var _0x3a80be={'raw':!![],'where':{'id':_0x2f3ba1[_0x1a0a('0x40')]['id']}},_0x522400={};_0x522400[_0x1a0a('0x2a')]=_[_0x1a0a('0x2b')](db[_0x1a0a('0x28')]['rawAttributes']);_0x522400[_0x1a0a('0x2c')]=_[_0x1a0a('0x2b')](_0x2f3ba1[_0x1a0a('0x2c')]);_0x522400[_0x1a0a('0x2d')]=_['intersection'](_0x522400[_0x1a0a('0x2a')],_0x522400[_0x1a0a('0x2c')]);_0x3a80be['attributes']=_[_0x1a0a('0x2e')](_0x522400[_0x1a0a('0x2a')],qs[_0x1a0a('0x30')](_0x2f3ba1[_0x1a0a('0x2c')][_0x1a0a('0x30')]));_0x3a80be[_0x1a0a('0x2f')]=_0x3a80be[_0x1a0a('0x2f')][_0x1a0a('0x41')]?_0x3a80be[_0x1a0a('0x2f')]:_0x522400[_0x1a0a('0x2a')];if(_0x2f3ba1['query'][_0x1a0a('0x3d')]){_0x3a80be[_0x1a0a('0x3e')]=[{'all':!![]}];}_0x3a80be=_['merge']({},_0x3a80be,_0x2f3ba1['options']);return db['Disposition']['find'](_0x3a80be)[_0x1a0a('0x1f')](handleEntityNotFound(_0x59bad4,null))[_0x1a0a('0x1f')](respondWithResult(_0x59bad4,null))['catch'](handleError(_0x59bad4,null));};exports['create']=function(_0x599d6e,_0x423f52){return db[_0x1a0a('0x28')][_0x1a0a('0x42')](_0x599d6e[_0x1a0a('0x43')],{})[_0x1a0a('0x1f')](function(_0x167a5e){var _0x94189=_0x599d6e[_0x1a0a('0x44')][_0x1a0a('0x45')]({'plain':!![]});if(!_0x94189)throw new Error(_0x1a0a('0x46'));if(_0x94189[_0x1a0a('0x47')]===_0x1a0a('0x44')){var _0x23a985=_0x167a5e['get']({'plain':!![]});var _0x3d0c86=_0x1a0a('0x21');return db[_0x1a0a('0x48')]['find']({'where':{'name':_0x3d0c86,'userProfileId':_0x94189[_0x1a0a('0x49')]},'raw':!![]})[_0x1a0a('0x1f')](function(_0x5eeefc){if(_0x5eeefc&&_0x5eeefc[_0x1a0a('0x4a')]===0x0){return db[_0x1a0a('0x22')]['create']({'name':_0x23a985['name'],'resourceId':_0x23a985['id'],'type':_0x5eeefc[_0x1a0a('0x25')],'sectionId':_0x5eeefc['id']},{})['then'](function(){return _0x167a5e;});}else{return _0x167a5e;}})['catch'](function(_0x115995){logger['error'](_0x1a0a('0x4b'),_0x115995);throw _0x115995;});}return _0x167a5e;})[_0x1a0a('0x1f')](respondWithResult(_0x423f52,0xc9))[_0x1a0a('0x3f')](handleError(_0x423f52,null));};exports[_0x1a0a('0x1e')]=function(_0x22a0f9,_0x38cfc5){if(_0x22a0f9[_0x1a0a('0x43')]['id']){delete _0x22a0f9[_0x1a0a('0x43')]['id'];}return db[_0x1a0a('0x28')][_0x1a0a('0x4c')]({'where':{'id':_0x22a0f9['params']['id']}})[_0x1a0a('0x1f')](handleEntityNotFound(_0x38cfc5,null))['then'](saveUpdates(_0x22a0f9[_0x1a0a('0x43')],null))[_0x1a0a('0x1f')](respondWithResult(_0x38cfc5,null))['catch'](handleError(_0x38cfc5,null));};exports['destroy']=function(_0x155f44,_0xc56705){return db['Disposition']['find']({'where':{'id':_0x155f44[_0x1a0a('0x40')]['id']}})['then'](handleEntityNotFound(_0xc56705,null))[_0x1a0a('0x1f')](removeEntity(_0xc56705,null))[_0x1a0a('0x3f')](handleError(_0xc56705,null));}; \ No newline at end of file +var _0x1574=['role','userProfileId','autoAssociation','UserProfileResource','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','apply','reject','save','update','then','destroy','get','Dispositions','error','stack','name','index','Disposition','rawAttributes','model','keys','query','attributes','fields','hasOwnProperty','order','sort','where','filters','pick','filter','merge','map','type','key','field','options','includeAll','findAll','rows','catch','params','length','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user'];(function(_0x3427b6,_0x3567e6){var _0x3dcf63=function(_0x44fa77){while(--_0x44fa77){_0x3427b6['push'](_0x3427b6['shift']());}};_0x3dcf63(++_0x3567e6);}(_0x1574,0x148));var _0x4157=function(_0x31e1b5,_0x28c926){_0x31e1b5=_0x31e1b5-0x0;var _0x39443a=_0x1574[_0x31e1b5];return _0x39443a;};'use strict';var pdf=require(_0x4157('0x0'));var emlformat=require(_0x4157('0x1'));var rimraf=require(_0x4157('0x2'));var zipdir=require(_0x4157('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4157('0x4'));var moment=require(_0x4157('0x5'));var BPromise=require(_0x4157('0x6'));var Mustache=require(_0x4157('0x7'));var util=require(_0x4157('0x8'));var path=require(_0x4157('0x9'));var sox=require(_0x4157('0xa'));var csv=require(_0x4157('0xb'));var ejs=require(_0x4157('0xc'));var fs=require('fs');var _=require(_0x4157('0xd'));var squel=require(_0x4157('0xe'));var crypto=require(_0x4157('0xf'));var jsforce=require(_0x4157('0x10'));var deskjs=require(_0x4157('0x11'));var toCsv=require(_0x4157('0xb'));var querystring=require('querystring');var Papa=require(_0x4157('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x4157('0x13'));var hardwareService=require(_0x4157('0x14'));var logger=require(_0x4157('0x15'))('api');var utils=require(_0x4157('0x16'));var config=require(_0x4157('0x17'));var db=require(_0x4157('0x18'))['db'];function respondWithStatusCode(_0x44de30,_0x151434){_0x151434=_0x151434||0xcc;return function(_0x1fd81f){if(_0x1fd81f){return _0x44de30[_0x4157('0x19')](_0x151434);}return _0x44de30[_0x4157('0x1a')](_0x151434)[_0x4157('0x1b')]();};}function respondWithResult(_0x123e55,_0x6b6301){_0x6b6301=_0x6b6301||0xc8;return function(_0x287afb){if(_0x287afb){return _0x123e55['status'](_0x6b6301)[_0x4157('0x1c')](_0x287afb);}};}function respondWithFilteredResult(_0x58a27f,_0x6c497e){return function(_0x382423){if(_0x382423){var _0x397f4e=_0x382423[_0x4157('0x1d')],_0x30598b=_0x6c497e[_0x4157('0x1e')],_0x41351e=_0x6c497e[_0x4157('0x1e')]+_0x6c497e[_0x4157('0x1f')],_0xbfe210;if(_0x41351e>=_0x397f4e){_0x41351e=_0x397f4e;_0xbfe210=0xc8;}else{_0xbfe210=0xce;}_0x58a27f[_0x4157('0x1a')](_0xbfe210);return _0x58a27f[_0x4157('0x20')]('Content-Range',_0x30598b+'-'+_0x41351e+'/'+_0x397f4e)[_0x4157('0x1c')](_0x382423);}return null;};}function patchUpdates(_0x4f9de8){return function(_0x3c1c44){try{jsonpatch[_0x4157('0x21')](_0x3c1c44,_0x4f9de8,!![]);}catch(_0x4a60bf){return BPromise[_0x4157('0x22')](_0x4a60bf);}return _0x3c1c44[_0x4157('0x23')]();};}function saveUpdates(_0x4cf4d0,_0x3912b4){return function(_0x2df9e4){if(_0x2df9e4){return _0x2df9e4[_0x4157('0x24')](_0x4cf4d0)[_0x4157('0x25')](function(_0x2cb68a){return _0x2cb68a;});}return null;};}function removeEntity(_0x16608f,_0x4af6ae){return function(_0x47b3e2){if(_0x47b3e2){return _0x47b3e2[_0x4157('0x26')]()[_0x4157('0x25')](function(){var _0x2cdba7=_0x47b3e2[_0x4157('0x27')]({'plain':!![]});var _0x535835=_0x4157('0x28');return db['UserProfileResource'][_0x4157('0x26')]({'where':{'type':_0x535835,'resourceId':_0x2cdba7['id']}})[_0x4157('0x25')](function(){return _0x47b3e2;});})[_0x4157('0x25')](function(){_0x16608f[_0x4157('0x1a')](0xcc)[_0x4157('0x1b')]();});}};}function handleEntityNotFound(_0x3940a0,_0xd548a8){return function(_0x3cef69){if(!_0x3cef69){_0x3940a0[_0x4157('0x19')](0x194);}return _0x3cef69;};}function handleError(_0x2e758b,_0x101e8f){_0x101e8f=_0x101e8f||0x1f4;return function(_0x3633fc){logger[_0x4157('0x29')](_0x3633fc[_0x4157('0x2a')]);if(_0x3633fc[_0x4157('0x2b')]){delete _0x3633fc['name'];}_0x2e758b[_0x4157('0x1a')](_0x101e8f)['send'](_0x3633fc);};}exports[_0x4157('0x2c')]=function(_0x8c3a8f,_0x3088cb){var _0x8da5a6={},_0xdddb1f={},_0x460ae9={'count':0x0,'rows':[]};var _0x3929b7=db[_0x4157('0x2d')][_0x4157('0x2e')];_0xdddb1f[_0x4157('0x2f')]=_[_0x4157('0x30')](_0x3929b7);_0xdddb1f['query']=_[_0x4157('0x30')](_0x8c3a8f['query']);_0xdddb1f['filters']=_['intersection'](_0xdddb1f[_0x4157('0x2f')],_0xdddb1f[_0x4157('0x31')]);_0x8da5a6[_0x4157('0x32')]=_['intersection'](_0xdddb1f[_0x4157('0x2f')],qs['fields'](_0x8c3a8f[_0x4157('0x31')][_0x4157('0x33')]));_0x8da5a6[_0x4157('0x32')]=_0x8da5a6[_0x4157('0x32')]['length']?_0x8da5a6['attributes']:_0xdddb1f[_0x4157('0x2f')];if(!_0x8c3a8f[_0x4157('0x31')][_0x4157('0x34')]('nolimit')){_0x8da5a6[_0x4157('0x1f')]=qs[_0x4157('0x1f')](_0x8c3a8f[_0x4157('0x31')][_0x4157('0x1f')]);_0x8da5a6['offset']=qs['offset'](_0x8c3a8f[_0x4157('0x31')][_0x4157('0x1e')]);}_0x8da5a6[_0x4157('0x35')]=qs[_0x4157('0x36')](_0x8c3a8f[_0x4157('0x31')][_0x4157('0x36')]);_0x8da5a6[_0x4157('0x37')]=qs[_0x4157('0x38')](_[_0x4157('0x39')](_0x8c3a8f[_0x4157('0x31')],_0xdddb1f['filters']));if(_0x8c3a8f[_0x4157('0x31')][_0x4157('0x3a')]){_0x8da5a6[_0x4157('0x37')]=_[_0x4157('0x3b')](_0x8da5a6[_0x4157('0x37')],{'$or':_[_0x4157('0x3c')](_0x3929b7,function(_0x1af720){if(_0x1af720[_0x4157('0x3d')][_0x4157('0x3e')]!=='VIRTUAL'){var _0x5cb3c5={};_0x5cb3c5[_0x1af720[_0x4157('0x3f')]]={'$like':'%'+_0x8c3a8f[_0x4157('0x31')][_0x4157('0x3a')]+'%'};return _0x5cb3c5;}})});}_0x8da5a6=_[_0x4157('0x3b')]({},_0x8da5a6,_0x8c3a8f[_0x4157('0x40')]);var _0x3d41be={'where':_0x8da5a6['where']};return db[_0x4157('0x2d')][_0x4157('0x1d')](_0x3d41be)['then'](function(_0x3da45d){_0x460ae9[_0x4157('0x1d')]=_0x3da45d;if(_0x8c3a8f[_0x4157('0x31')][_0x4157('0x41')]){_0x8da5a6['include']=[{'all':!![]}];}return db[_0x4157('0x2d')][_0x4157('0x42')](_0x8da5a6);})[_0x4157('0x25')](function(_0x48d30c){_0x460ae9[_0x4157('0x43')]=_0x48d30c;return _0x460ae9;})[_0x4157('0x25')](respondWithFilteredResult(_0x3088cb,_0x8da5a6))[_0x4157('0x44')](handleError(_0x3088cb,null));};exports['show']=function(_0x1664c6,_0x53dfda){var _0x81cb12={'raw':!![],'where':{'id':_0x1664c6[_0x4157('0x45')]['id']}},_0x2cfbcb={};_0x2cfbcb[_0x4157('0x2f')]=_[_0x4157('0x30')](db[_0x4157('0x2d')]['rawAttributes']);_0x2cfbcb[_0x4157('0x31')]=_[_0x4157('0x30')](_0x1664c6[_0x4157('0x31')]);_0x2cfbcb[_0x4157('0x38')]=_['intersection'](_0x2cfbcb[_0x4157('0x2f')],_0x2cfbcb['query']);_0x81cb12['attributes']=_['intersection'](_0x2cfbcb[_0x4157('0x2f')],qs[_0x4157('0x33')](_0x1664c6[_0x4157('0x31')]['fields']));_0x81cb12[_0x4157('0x32')]=_0x81cb12['attributes'][_0x4157('0x46')]?_0x81cb12[_0x4157('0x32')]:_0x2cfbcb[_0x4157('0x2f')];if(_0x1664c6['query'][_0x4157('0x41')]){_0x81cb12[_0x4157('0x47')]=[{'all':!![]}];}_0x81cb12=_[_0x4157('0x3b')]({},_0x81cb12,_0x1664c6['options']);return db[_0x4157('0x2d')][_0x4157('0x48')](_0x81cb12)[_0x4157('0x25')](handleEntityNotFound(_0x53dfda,null))[_0x4157('0x25')](respondWithResult(_0x53dfda,null))[_0x4157('0x44')](handleError(_0x53dfda,null));};exports['create']=function(_0x566e43,_0x582fe9){return db[_0x4157('0x2d')][_0x4157('0x49')](_0x566e43[_0x4157('0x4a')],{})['then'](function(_0x4496f8){var _0x1bbcec=_0x566e43[_0x4157('0x4b')][_0x4157('0x27')]({'plain':!![]});if(!_0x1bbcec)throw new Error(_0x4157('0x4c'));if(_0x1bbcec[_0x4157('0x4d')]==='user'){var _0x3dacad=_0x4496f8[_0x4157('0x27')]({'plain':!![]});var _0x320979='Dispositions';return db['UserProfileSection']['find']({'where':{'name':_0x320979,'userProfileId':_0x1bbcec[_0x4157('0x4e')]},'raw':!![]})[_0x4157('0x25')](function(_0x22da67){if(_0x22da67&&_0x22da67[_0x4157('0x4f')]===0x0){return db[_0x4157('0x50')][_0x4157('0x49')]({'name':_0x3dacad[_0x4157('0x2b')],'resourceId':_0x3dacad['id'],'type':_0x22da67[_0x4157('0x2b')],'sectionId':_0x22da67['id']},{})[_0x4157('0x25')](function(){return _0x4496f8;});}else{return _0x4496f8;}})['catch'](function(_0x1294ff){logger[_0x4157('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1294ff);throw _0x1294ff;});}return _0x4496f8;})['then'](respondWithResult(_0x582fe9,0xc9))[_0x4157('0x44')](handleError(_0x582fe9,null));};exports['update']=function(_0x15bdcd,_0x5754c3){if(_0x15bdcd[_0x4157('0x4a')]['id']){delete _0x15bdcd['body']['id'];}return db[_0x4157('0x2d')][_0x4157('0x48')]({'where':{'id':_0x15bdcd[_0x4157('0x45')]['id']}})[_0x4157('0x25')](handleEntityNotFound(_0x5754c3,null))[_0x4157('0x25')](saveUpdates(_0x15bdcd[_0x4157('0x4a')],null))['then'](respondWithResult(_0x5754c3,null))[_0x4157('0x44')](handleError(_0x5754c3,null));};exports['destroy']=function(_0x2d9fdc,_0x57ba25){return db['Disposition'][_0x4157('0x48')]({'where':{'id':_0x2d9fdc[_0x4157('0x45')]['id']}})[_0x4157('0x25')](handleEntityNotFound(_0x57ba25,null))[_0x4157('0x25')](removeEntity(_0x57ba25,null))['catch'](handleError(_0x57ba25,null));}; \ No newline at end of file diff --git a/server/api/disposition/disposition.model.js b/server/api/disposition/disposition.model.js index afcd6af..60e2463 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 _0xe510=['name_sms','SmsAccountId','name_fax','OpenchannelAccountId','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./disposition.attributes','exports','define','name_voice','name_chat','name','ChatWebsiteId','name_mail','MailAccountId'];(function(_0x316f5e,_0x179352){var _0x14e6fb=function(_0x15d1cf){while(--_0x15d1cf){_0x316f5e['push'](_0x316f5e['shift']());}};_0x14e6fb(++_0x179352);}(_0xe510,0x190));var _0x0e51=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0xe510[_0x27af45];return _0x18df21;};'use strict';var _=require(_0x0e51('0x0'));var util=require(_0x0e51('0x1'));var logger=require(_0x0e51('0x2'))(_0x0e51('0x3'));var moment=require('moment');var BPromise=require(_0x0e51('0x4'));var rp=require(_0x0e51('0x5'));var fs=require('fs');var path=require(_0x0e51('0x6'));var rimraf=require(_0x0e51('0x7'));var config=require(_0x0e51('0x8'));var attributes=require(_0x0e51('0x9'));module[_0x0e51('0xa')]=function(_0x1a080c,_0x4c848d){return _0x1a080c[_0x0e51('0xb')]('Disposition',attributes,{'tableName':'tools_dispositions','paranoid':![],'indexes':[{'unique':!![],'name':_0x0e51('0xc'),'fields':['name','ListId']},{'unique':!![],'name':_0x0e51('0xd'),'fields':[_0x0e51('0xe'),_0x0e51('0xf')]},{'unique':!![],'name':_0x0e51('0x10'),'fields':['name',_0x0e51('0x11')]},{'unique':!![],'name':_0x0e51('0x12'),'fields':[_0x0e51('0xe'),_0x0e51('0x13')]},{'unique':!![],'name':_0x0e51('0x14'),'fields':[_0x0e51('0xe'),'FaxAccountId']},{'unique':!![],'name':'name_openchannel','fields':[_0x0e51('0xe'),_0x0e51('0x15')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x11bb=['Disposition','name','ListId','name_mail','name_sms','SmsAccountId','name_fax','FaxAccountId','name_openchannel','OpenchannelAccountId','lodash','util','api','bluebird','request-promise','path','../../config/environment','./disposition.attributes','exports','define'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x11bb,0x19a));var _0xb11b=function(_0x3fa97e,_0x26f30b){_0x3fa97e=_0x3fa97e-0x0;var _0x5ab208=_0x11bb[_0x3fa97e];return _0x5ab208;};'use strict';var _=require(_0xb11b('0x0'));var util=require(_0xb11b('0x1'));var logger=require('../../config/logger')(_0xb11b('0x2'));var moment=require('moment');var BPromise=require(_0xb11b('0x3'));var rp=require(_0xb11b('0x4'));var fs=require('fs');var path=require(_0xb11b('0x5'));var rimraf=require('rimraf');var config=require(_0xb11b('0x6'));var attributes=require(_0xb11b('0x7'));module[_0xb11b('0x8')]=function(_0x518ed1,_0x5c4040){return _0x518ed1[_0xb11b('0x9')](_0xb11b('0xa'),attributes,{'tableName':'tools_dispositions','paranoid':![],'indexes':[{'unique':!![],'name':'name_voice','fields':[_0xb11b('0xb'),_0xb11b('0xc')]},{'unique':!![],'name':'name_chat','fields':[_0xb11b('0xb'),'ChatWebsiteId']},{'unique':!![],'name':_0xb11b('0xd'),'fields':['name','MailAccountId']},{'unique':!![],'name':_0xb11b('0xe'),'fields':['name',_0xb11b('0xf')]},{'unique':!![],'name':_0xb11b('0x10'),'fields':[_0xb11b('0xb'),_0xb11b('0x11')]},{'unique':!![],'name':_0xb11b('0x12'),'fields':[_0xb11b('0xb'),_0xb11b('0x13')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/disposition/disposition.rpc.js b/server/api/disposition/disposition.rpc.js index ee5d408..667b04f 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 _0xd635=['info','Disposition,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then'];(function(_0x5311a1,_0x304912){var _0x2acb9f=function(_0x4803e7){while(--_0x4803e7){_0x5311a1['push'](_0x5311a1['shift']());}};_0x2acb9f(++_0x304912);}(_0xd635,0x11d));var _0x5d63=function(_0x8e992d,_0x5dd91c){_0x8e992d=_0x8e992d-0x0;var _0x41dd7f=_0xd635[_0x8e992d];return _0x41dd7f;};'use strict';var _=require(_0x5d63('0x0'));var util=require(_0x5d63('0x1'));var moment=require(_0x5d63('0x2'));var BPromise=require(_0x5d63('0x3'));var rs=require(_0x5d63('0x4'));var fs=require('fs');var Redis=require(_0x5d63('0x5'));var db=require(_0x5d63('0x6'))['db'];var utils=require(_0x5d63('0x7'));var logger=require(_0x5d63('0x8'))(_0x5d63('0x9'));var config=require(_0x5d63('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x5d63('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x115178,_0x5992ae,_0x2e4dfb){return new BPromise(function(_0xdf9ef3,_0x16551e){return client[_0x5d63('0xc')](_0x115178,_0x2e4dfb)[_0x5d63('0xd')](function(_0x2880dc){logger[_0x5d63('0xe')](_0x5d63('0xf'),_0x5992ae,_0x5d63('0x10'));logger[_0x5d63('0x11')]('Disposition,\x20%s,\x20%s,\x20%s',_0x5992ae,_0x5d63('0x10'),JSON[_0x5d63('0x12')](_0x2880dc));if(_0x2880dc[_0x5d63('0x13')]){if(_0x2880dc[_0x5d63('0x13')]['code']===0x1f4){logger[_0x5d63('0x13')](_0x5d63('0xf'),_0x5992ae,_0x2880dc[_0x5d63('0x13')][_0x5d63('0x14')]);return _0x16551e(_0x2880dc[_0x5d63('0x13')]['message']);}logger[_0x5d63('0x13')](_0x5d63('0xf'),_0x5992ae,_0x2880dc['error'][_0x5d63('0x14')]);return _0xdf9ef3(_0x2880dc[_0x5d63('0x13')][_0x5d63('0x14')]);}else{logger[_0x5d63('0xe')]('Disposition,\x20%s,\x20%s',_0x5992ae,_0x5d63('0x10'));_0xdf9ef3(_0x2880dc[_0x5d63('0x15')][_0x5d63('0x14')]);}})[_0x5d63('0x16')](function(_0xc36945){logger[_0x5d63('0x13')](_0x5d63('0xf'),_0x5992ae,_0xc36945);_0x16551e(_0xc36945);});});} \ No newline at end of file +var _0x4598=['catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','debug','Disposition,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','Disposition,\x20%s,\x20%s','result'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0x4598,0x1dc));var _0x8459=function(_0x433f08,_0x3d915b){_0x433f08=_0x433f08-0x0;var _0x253741=_0x4598[_0x433f08];return _0x253741;};'use strict';var _=require(_0x8459('0x0'));var util=require(_0x8459('0x1'));var moment=require('moment');var BPromise=require(_0x8459('0x2'));var rs=require(_0x8459('0x3'));var fs=require('fs');var Redis=require(_0x8459('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x8459('0x5'));var logger=require(_0x8459('0x6'))(_0x8459('0x7'));var config=require(_0x8459('0x8'));var jayson=require(_0x8459('0x9'));var client=jayson[_0x8459('0xa')][_0x8459('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2783b0,_0x111c9d,_0x5c2fde){return new BPromise(function(_0x224867,_0x35454c){return client[_0x8459('0xc')](_0x2783b0,_0x5c2fde)[_0x8459('0xd')](function(_0x281c46){logger[_0x8459('0xe')]('Disposition,\x20%s,\x20%s',_0x111c9d,'request\x20sent');logger[_0x8459('0xf')](_0x8459('0x10'),_0x111c9d,_0x8459('0x11'),JSON[_0x8459('0x12')](_0x281c46));if(_0x281c46[_0x8459('0x13')]){if(_0x281c46[_0x8459('0x13')][_0x8459('0x14')]===0x1f4){logger[_0x8459('0x13')]('Disposition,\x20%s,\x20%s',_0x111c9d,_0x281c46[_0x8459('0x13')]['message']);return _0x35454c(_0x281c46['error'][_0x8459('0x15')]);}logger[_0x8459('0x13')](_0x8459('0x16'),_0x111c9d,_0x281c46[_0x8459('0x13')][_0x8459('0x15')]);return _0x224867(_0x281c46[_0x8459('0x13')]['message']);}else{logger[_0x8459('0xe')](_0x8459('0x16'),_0x111c9d,_0x8459('0x11'));_0x224867(_0x281c46[_0x8459('0x17')]['message']);}})[_0x8459('0x18')](function(_0x1ca785){logger['error'](_0x8459('0x16'),_0x111c9d,_0x1ca785);_0x35454c(_0x1ca785);});});} \ No newline at end of file diff --git a/server/api/disposition/index.js b/server/api/disposition/index.js index c76600b..29ee9f7 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 _0xed3c=['post','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index'];(function(_0x24b42a,_0x406509){var _0x4172d0=function(_0x1dde25){while(--_0x1dde25){_0x24b42a['push'](_0x24b42a['shift']());}};_0x4172d0(++_0x406509);}(_0xed3c,0x1a6));var _0xced3=function(_0x511d17,_0x9ad3ba){_0x511d17=_0x511d17-0x0;var _0x4f42e3=_0xed3c[_0x511d17];return _0x4f42e3;};'use strict';var multer=require(_0xced3('0x0'));var util=require(_0xced3('0x1'));var path=require(_0xced3('0x2'));var timeout=require(_0xced3('0x3'));var express=require('express');var router=express[_0xced3('0x4')]();var auth=require(_0xced3('0x5'));var interaction=require(_0xced3('0x6'));var config=require('../../config/environment');var controller=require('./disposition.controller');router[_0xced3('0x7')]('/',auth[_0xced3('0x8')](),controller[_0xced3('0x9')]);router[_0xced3('0x7')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0xced3('0xa')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0xced3('0xb'),auth[_0xced3('0x8')](),controller[_0xced3('0xc')]);router[_0xced3('0xd')](_0xced3('0xb'),auth['isAuthenticated'](),controller[_0xced3('0xe')]);module[_0xced3('0xf')]=router; \ No newline at end of file +var _0x3419=['isAuthenticated','show','post','create','put','delete','/:id','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./disposition.controller','get','index'];(function(_0x3b085,_0x250543){var _0x476a57=function(_0x480941){while(--_0x480941){_0x3b085['push'](_0x3b085['shift']());}};_0x476a57(++_0x250543);}(_0x3419,0xb3));var _0x9341=function(_0x5bd98b,_0x22bf1c){_0x5bd98b=_0x5bd98b-0x0;var _0x49efe7=_0x3419[_0x5bd98b];return _0x49efe7;};'use strict';var multer=require(_0x9341('0x0'));var util=require(_0x9341('0x1'));var path=require(_0x9341('0x2'));var timeout=require(_0x9341('0x3'));var express=require(_0x9341('0x4'));var router=express['Router']();var auth=require(_0x9341('0x5'));var interaction=require(_0x9341('0x6'));var config=require(_0x9341('0x7'));var controller=require(_0x9341('0x8'));router[_0x9341('0x9')]('/',auth['isAuthenticated'](),controller[_0x9341('0xa')]);router[_0x9341('0x9')]('/:id',auth[_0x9341('0xb')](),controller[_0x9341('0xc')]);router[_0x9341('0xd')]('/',auth[_0x9341('0xb')](),controller[_0x9341('0xe')]);router[_0x9341('0xf')]('/:id',auth[_0x9341('0xb')](),controller['update']);router[_0x9341('0x10')](_0x9341('0x11'),auth[_0x9341('0xb')](),controller['destroy']);module[_0x9341('0x12')]=router; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.attributes.js b/server/api/faxAccount/faxAccount.attributes.js index 648cc71..cbad6ea 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 _0x342d=['2400','7200','9600','12000','4800','14400','v17,v27,v29','SIP','IAX','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','exports','STRING','ENUM','yes'];(function(_0x152dbc,_0x5c114f){var _0x45b165=function(_0x550d9d){while(--_0x550d9d){_0x152dbc['push'](_0x152dbc['shift']());}};_0x45b165(++_0x5c114f);}(_0x342d,0xd7));var _0xd342=function(_0x20b2f1,_0x5deabf){_0x20b2f1=_0x20b2f1-0x0;var _0x36006f=_0x342d[_0x20b2f1];return _0x36006f;};'use strict';var Sequelize=require(_0xd342('0x0'));module[_0xd342('0x1')]={'name':{'type':Sequelize[_0xd342('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']},'ecm':{'type':Sequelize[_0xd342('0x3')](_0xd342('0x4'),'no'),'defaultValue':_0xd342('0x4')},'headerinfo':{'type':Sequelize[_0xd342('0x2')],'defaultValue':'xCALLY\x20Motion\x20Fax'},'localstationid':{'type':Sequelize[_0xd342('0x2')],'unique':'localstationid'},'minrate':{'type':Sequelize['ENUM'](_0xd342('0x5'),'4800',_0xd342('0x6'),_0xd342('0x7'),_0xd342('0x8'),'14400'),'defaultValue':_0xd342('0x9')},'maxrate':{'type':Sequelize[_0xd342('0x3')](_0xd342('0x5'),_0xd342('0x9'),_0xd342('0x6'),_0xd342('0x7'),_0xd342('0x8'),_0xd342('0xa')),'defaultValue':_0xd342('0xa')},'modem':{'type':Sequelize[_0xd342('0x2')],'defaultValue':_0xd342('0xb')},'gateway':{'type':Sequelize['STRING'],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize['STRING'],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0xd342('0x3')](_0xd342('0xc'),_0xd342('0xd'),'DADHI','KHOMP'),'defaultValue':_0xd342('0xc')},'key':{'type':Sequelize[_0xd342('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xd342('0xe')],'defaultValue':function(){return _0xd342('0xf');}},'notificationSound':{'type':Sequelize[_0xd342('0x10')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xd342('0x10')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xd342('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xd342('0x10')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xd342('0x11')],'allowNull':!![],'defaultValue':null,'comment':_0xd342('0x12')},'mandatoryDisposition':{'type':Sequelize[_0xd342('0x10')],'defaultValue':![],'comment':_0xd342('0x13'),'set':function(_0x493194){if(!_0x493194)this[_0xd342('0x14')](_0xd342('0x15'),null);this[_0xd342('0x14')]('mandatoryDisposition',_0x493194);}}}; \ No newline at end of file +var _0x11e5=['xCALLY\x20Motion\x20Fax','localstationid','2400','7200','9600','12000','ENUM','4800','14400','v17,v27,v29','INTEGER','SIP','IAX','DADHI','KHOMP','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','yes'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x11e5,0x18c));var _0x511e=function(_0x2ea6c1,_0x13c12b){_0x2ea6c1=_0x2ea6c1-0x0;var _0x11cf31=_0x11e5[_0x2ea6c1];return _0x11cf31;};'use strict';var Sequelize=require(_0x511e('0x0'));module[_0x511e('0x1')]={'name':{'type':Sequelize[_0x511e('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x511e('0x2')]},'ecm':{'type':Sequelize['ENUM'](_0x511e('0x3'),'no'),'defaultValue':'yes'},'headerinfo':{'type':Sequelize[_0x511e('0x2')],'defaultValue':_0x511e('0x4')},'localstationid':{'type':Sequelize[_0x511e('0x2')],'unique':_0x511e('0x5')},'minrate':{'type':Sequelize['ENUM'](_0x511e('0x6'),'4800',_0x511e('0x7'),_0x511e('0x8'),_0x511e('0x9'),'14400'),'defaultValue':'4800'},'maxrate':{'type':Sequelize[_0x511e('0xa')]('2400',_0x511e('0xb'),'7200',_0x511e('0x8'),_0x511e('0x9'),_0x511e('0xc')),'defaultValue':_0x511e('0xc')},'modem':{'type':Sequelize['STRING'],'defaultValue':_0x511e('0xd')},'gateway':{'type':Sequelize[_0x511e('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0x511e('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0x511e('0xe')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0x511e('0xa')](_0x511e('0xf'),_0x511e('0x10'),_0x511e('0x11'),_0x511e('0x12')),'defaultValue':_0x511e('0xf')},'key':{'type':Sequelize[_0x511e('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x511e('0x13');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x511e('0x14')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x511e('0x14')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x511e('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x511e('0x14')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0x511e('0x15')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x511e('0x16'),'set':function(_0xa9e278){if(!_0xa9e278)this['setDataValue'](_0x511e('0x17'),null);this['setDataValue'](_0x511e('0x18'),_0xa9e278);}}}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.controller.js b/server/api/faxAccount/faxAccount.controller.js index 6336f63..adb4f56 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 _0x7d7b=['bulkCreate','findAndCountAll','priority','getApplications','context','from-voip-provider','exten','localstationid','system','description','Fax\x20Extension','push','CDR(type)=inbound-fax','ecm','faxdetect','maxrate','minrate','modem','t38timeout','FAXOPT(','Set','Wait','/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d','ReceiveFax','addAccountApplications','get','updateAccountApplications','VoiceExtension','tech','key','createdAt','updatedAt','TrunkId','ListId','findById','getMessages','FaxMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','CmList','List','Contacts','DESC','attachments','join','root','server/files/attachments','basename','CheckAfterSend','isNil','from','\x22%s\x22\x20<%s>','fax','List\x20not\x20found','out','filename','Messages','spread','ContactId','SendFax','SendFaxRpc,\x20%s','addAgents','userFaxAccount:save','removeAgents','isArray','emit','userFaxAccount:remove','getAgents','html-pdf','eml-format','zip-dir','request-promise','moment','mustache','path','sox','to-csv','lodash','squel','jsforce','desk.js','querystring','papaparse','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./faxAccount.socket','register','client','http','test','request','then','FaxAccount,\x20%s,\x20%s','debug','FaxAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','catch','status','end','json','count','offset','limit','Content-Range','apply','reject','save','update','destroy','FaxAccounts','UserProfileResource','sendStatus','stack','name','send','index','Pause','mandatoryDispositionPause','FaxAccount','rawAttributes','query','keys','filters','intersection','model','fields','attributes','length','nolimit','sort','where','filter','map','type','VIRTUAL','options','includeAll','include','rows','show','params','merge','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','Disposition','getDispositions','findOne','hasOwnProperty','order','pick','FaxAccountId','findAll','removeDispositions','ids','getAnswers','CannedAnswer','removeAnswers','addInteraction','omit','getInteractions','CmContact','Contact','fullname','internal','Tag','Tags','color','tag','FaxInteraction','sequelize','transaction','FaxApplication'];(function(_0x44c935,_0x3653f0){var _0x465bee=function(_0x211d20){while(--_0x211d20){_0x44c935['push'](_0x44c935['shift']());}};_0x465bee(++_0x3653f0);}(_0x7d7b,0x106));var _0xb7d7=function(_0x48ee28,_0x8b1c36){_0x48ee28=_0x48ee28-0x0;var _0xfc2e00=_0x7d7b[_0x48ee28];return _0xfc2e00;};'use strict';var pdf=require(_0xb7d7('0x0'));var emlformat=require(_0xb7d7('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xb7d7('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb7d7('0x3'));var moment=require(_0xb7d7('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xb7d7('0x5'));var util=require('util');var path=require(_0xb7d7('0x6'));var sox=require(_0xb7d7('0x7'));var csv=require(_0xb7d7('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xb7d7('0x9'));var squel=require(_0xb7d7('0xa'));var crypto=require('crypto');var jsforce=require(_0xb7d7('0xb'));var deskjs=require(_0xb7d7('0xc'));var toCsv=require('to-csv');var querystring=require(_0xb7d7('0xd'));var Papa=require(_0xb7d7('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb7d7('0xf'));var logger=require(_0xb7d7('0x10'))('api');var utils=require('../../config/utils');var config=require(_0xb7d7('0x11'));var db=require(_0xb7d7('0x12'))['db'];config[_0xb7d7('0x13')]=_['defaults'](config[_0xb7d7('0x13')],{'host':_0xb7d7('0x14'),'port':0x18eb});var socket=require(_0xb7d7('0x15'))(new Redis(config[_0xb7d7('0x13')]));require(_0xb7d7('0x16'))[_0xb7d7('0x17')](socket);var jayson=require('jayson/promise');var client=jayson[_0xb7d7('0x18')][_0xb7d7('0x19')]({'port':0x232c});var client9002=jayson[_0xb7d7('0x18')][_0xb7d7('0x19')]({'port':0x232a});function checkPasswordPattern(_0x2469e1,_0x3f2a69,_0x2dee2b){if(_0x2dee2b){var _0x59763a=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x59763a[_0xb7d7('0x1a')](_0x3f2a69)){return _0x2469e1;}else{throw new Error('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x2469e1;}}function respondWithRpcPromise(_0xf37ed0,_0x478991,_0x20179f,_0x4004d2){return new BPromise(function(_0x58e7c6,_0x1386fc){var _0x547fe8=_0x4004d2||client;return _0x547fe8[_0xb7d7('0x1b')](_0xf37ed0,_0x20179f)[_0xb7d7('0x1c')](function(_0x38109c){logger['info'](_0xb7d7('0x1d'),_0x478991,'request\x20sent');logger[_0xb7d7('0x1e')](_0xb7d7('0x1f'),_0x478991,_0xb7d7('0x20'),JSON[_0xb7d7('0x21')](_0x38109c));if(_0x38109c[_0xb7d7('0x22')]){if(_0x38109c[_0xb7d7('0x22')][_0xb7d7('0x23')]===0x1f4){logger['error'](_0xb7d7('0x1d'),_0x478991,_0x38109c['error'][_0xb7d7('0x24')]);return _0x1386fc(_0x38109c[_0xb7d7('0x22')][_0xb7d7('0x24')]);}logger[_0xb7d7('0x22')]('FaxAccount,\x20%s,\x20%s',_0x478991,_0x38109c[_0xb7d7('0x22')][_0xb7d7('0x24')]);return _0x58e7c6(_0x38109c['error'][_0xb7d7('0x24')]);}else{logger[_0xb7d7('0x25')]('FaxAccount,\x20%s,\x20%s',_0x478991,'request\x20sent');_0x58e7c6(_0x38109c['result'][_0xb7d7('0x24')]);}})[_0xb7d7('0x26')](function(_0x13c22e){logger[_0xb7d7('0x22')](_0xb7d7('0x1d'),_0x478991,_0x13c22e);_0x1386fc(_0x13c22e);});});}function respondWithStatusCode(_0x3971fd,_0x45aabc){_0x45aabc=_0x45aabc||0xcc;return function(_0x36a4b4){if(_0x36a4b4){return _0x3971fd['sendStatus'](_0x45aabc);}return _0x3971fd[_0xb7d7('0x27')](_0x45aabc)[_0xb7d7('0x28')]();};}function respondWithResult(_0x157247,_0x5dcdcb){_0x5dcdcb=_0x5dcdcb||0xc8;return function(_0x20eb6d){if(_0x20eb6d){return _0x157247[_0xb7d7('0x27')](_0x5dcdcb)[_0xb7d7('0x29')](_0x20eb6d);}};}function respondWithFilteredResult(_0x3b95cc,_0x24ffeb){return function(_0x43bd8b){if(_0x43bd8b){var _0x22de1c=_0x43bd8b[_0xb7d7('0x2a')],_0x530d03=_0x24ffeb[_0xb7d7('0x2b')],_0x6d7227=_0x24ffeb[_0xb7d7('0x2b')]+_0x24ffeb[_0xb7d7('0x2c')],_0x455f8b;if(_0x6d7227>=_0x22de1c){_0x6d7227=_0x22de1c;_0x455f8b=0xc8;}else{_0x455f8b=0xce;}_0x3b95cc[_0xb7d7('0x27')](_0x455f8b);return _0x3b95cc['set'](_0xb7d7('0x2d'),_0x530d03+'-'+_0x6d7227+'/'+_0x22de1c)[_0xb7d7('0x29')](_0x43bd8b);}return null;};}function patchUpdates(_0x78ae31){return function(_0x55aaef){try{jsonpatch[_0xb7d7('0x2e')](_0x55aaef,_0x78ae31,!![]);}catch(_0x69f46d){return BPromise[_0xb7d7('0x2f')](_0x69f46d);}return _0x55aaef[_0xb7d7('0x30')]();};}function saveUpdates(_0x11740f,_0x3938da){return function(_0x4dba1c){if(_0x4dba1c){return _0x4dba1c[_0xb7d7('0x31')](_0x11740f)[_0xb7d7('0x1c')](function(_0x53f6c1){return _0x53f6c1;});}return null;};}function removeEntity(_0x27d88b,_0xfb9f2a){return function(_0x1ab415){if(_0x1ab415){return _0x1ab415[_0xb7d7('0x32')]()[_0xb7d7('0x1c')](function(){var _0x15cb93=_0x1ab415['get']({'plain':!![]});var _0x4e6e57=_0xb7d7('0x33');return db[_0xb7d7('0x34')][_0xb7d7('0x32')]({'where':{'type':_0x4e6e57,'resourceId':_0x15cb93['id']}})[_0xb7d7('0x1c')](function(){return _0x1ab415;});})[_0xb7d7('0x1c')](function(){_0x27d88b[_0xb7d7('0x27')](0xcc)[_0xb7d7('0x28')]();});}};}function handleEntityNotFound(_0x5a5caf,_0x3cc031){return function(_0x1bb001){if(!_0x1bb001){_0x5a5caf[_0xb7d7('0x35')](0x194);}return _0x1bb001;};}function handleError(_0x5b48e9,_0x1fb17f){_0x1fb17f=_0x1fb17f||0x1f4;return function(_0x11fdd5){logger['error'](_0x11fdd5[_0xb7d7('0x36')]);if(_0x11fdd5['name']){delete _0x11fdd5[_0xb7d7('0x37')];}_0x5b48e9[_0xb7d7('0x27')](_0x1fb17f)[_0xb7d7('0x38')](_0x11fdd5);};}exports[_0xb7d7('0x39')]=function(_0x3ebd43,_0x363763){var _0x4cf165={'include':[{'model':db[_0xb7d7('0x3a')],'as':_0xb7d7('0x3b')}]},_0x2ea05c={},_0x52dae0={'count':0x0,'rows':[]};var _0x4eca12=db[_0xb7d7('0x3c')][_0xb7d7('0x3d')];_0x2ea05c['model']=_['keys'](_0x4eca12);_0x2ea05c[_0xb7d7('0x3e')]=_[_0xb7d7('0x3f')](_0x3ebd43[_0xb7d7('0x3e')]);_0x2ea05c[_0xb7d7('0x40')]=_[_0xb7d7('0x41')](_0x2ea05c[_0xb7d7('0x42')],_0x2ea05c[_0xb7d7('0x3e')]);_0x4cf165['attributes']=_[_0xb7d7('0x41')](_0x2ea05c[_0xb7d7('0x42')],qs[_0xb7d7('0x43')](_0x3ebd43[_0xb7d7('0x3e')]['fields']));_0x4cf165['attributes']=_0x4cf165[_0xb7d7('0x44')][_0xb7d7('0x45')]?_0x4cf165[_0xb7d7('0x44')]:_0x2ea05c[_0xb7d7('0x42')];if(!_0x3ebd43[_0xb7d7('0x3e')]['hasOwnProperty'](_0xb7d7('0x46'))){_0x4cf165[_0xb7d7('0x2c')]=qs[_0xb7d7('0x2c')](_0x3ebd43[_0xb7d7('0x3e')]['limit']);_0x4cf165['offset']=qs[_0xb7d7('0x2b')](_0x3ebd43[_0xb7d7('0x3e')][_0xb7d7('0x2b')]);}_0x4cf165['order']=qs[_0xb7d7('0x47')](_0x3ebd43[_0xb7d7('0x3e')]['sort']);_0x4cf165[_0xb7d7('0x48')]=qs[_0xb7d7('0x40')](_['pick'](_0x3ebd43[_0xb7d7('0x3e')],_0x2ea05c['filters']));if(_0x3ebd43['query'][_0xb7d7('0x49')]){_0x4cf165[_0xb7d7('0x48')]=_['merge'](_0x4cf165[_0xb7d7('0x48')],{'$or':_[_0xb7d7('0x4a')](_0x4eca12,function(_0x51dbda){if(_0x51dbda[_0xb7d7('0x4b')]['key']!==_0xb7d7('0x4c')){var _0xd8c6d2={};_0xd8c6d2[_0x51dbda['field']]={'$like':'%'+_0x3ebd43[_0xb7d7('0x3e')][_0xb7d7('0x49')]+'%'};return _0xd8c6d2;}})});}_0x4cf165=_['merge']({},_0x4cf165,_0x3ebd43[_0xb7d7('0x4d')]);var _0x1a02f7={'where':_0x4cf165[_0xb7d7('0x48')]};return db[_0xb7d7('0x3c')]['count'](_0x1a02f7)['then'](function(_0x56bd1f){_0x52dae0[_0xb7d7('0x2a')]=_0x56bd1f;if(_0x3ebd43[_0xb7d7('0x3e')][_0xb7d7('0x4e')]){_0x4cf165[_0xb7d7('0x4f')]=[{'all':!![]}];}return db['FaxAccount']['findAll'](_0x4cf165);})[_0xb7d7('0x1c')](function(_0x2db45f){_0x52dae0[_0xb7d7('0x50')]=_0x2db45f;return _0x52dae0;})[_0xb7d7('0x1c')](respondWithFilteredResult(_0x363763,_0x4cf165))[_0xb7d7('0x26')](handleError(_0x363763,null));};exports[_0xb7d7('0x51')]=function(_0x5ee6a4,_0x434f85){var _0x411eb9={'raw':![],'where':{'id':_0x5ee6a4[_0xb7d7('0x52')]['id']},'include':[{'model':db[_0xb7d7('0x3a')],'as':_0xb7d7('0x3b')}]},_0x84afe8={};_0x84afe8['model']=_[_0xb7d7('0x3f')](db[_0xb7d7('0x3c')][_0xb7d7('0x3d')]);_0x84afe8[_0xb7d7('0x3e')]=_[_0xb7d7('0x3f')](_0x5ee6a4[_0xb7d7('0x3e')]);_0x84afe8['filters']=_[_0xb7d7('0x41')](_0x84afe8['model'],_0x84afe8['query']);_0x411eb9[_0xb7d7('0x44')]=_['intersection'](_0x84afe8['model'],qs[_0xb7d7('0x43')](_0x5ee6a4[_0xb7d7('0x3e')][_0xb7d7('0x43')]));_0x411eb9[_0xb7d7('0x44')]=_0x411eb9[_0xb7d7('0x44')]['length']?_0x411eb9['attributes']:_0x84afe8[_0xb7d7('0x42')];if(_0x5ee6a4[_0xb7d7('0x3e')][_0xb7d7('0x4e')]){_0x411eb9[_0xb7d7('0x4f')]=[{'all':!![]}];}_0x411eb9=_[_0xb7d7('0x53')]({},_0x411eb9,_0x5ee6a4[_0xb7d7('0x4d')]);return db[_0xb7d7('0x3c')][_0xb7d7('0x54')](_0x411eb9)[_0xb7d7('0x1c')](handleEntityNotFound(_0x434f85,null))[_0xb7d7('0x1c')](respondWithResult(_0x434f85,null))['catch'](handleError(_0x434f85,null));};exports[_0xb7d7('0x55')]=function(_0x449fc7,_0x2dd1ec){return db['FaxAccount'][_0xb7d7('0x55')](_0x449fc7[_0xb7d7('0x56')],{})[_0xb7d7('0x1c')](function(_0x3118d3){var _0x378ff9=_0x449fc7[_0xb7d7('0x57')]['get']({'plain':!![]});if(!_0x378ff9)throw new Error(_0xb7d7('0x58'));if(_0x378ff9['role']===_0xb7d7('0x57')){var _0x41cb15=_0x3118d3['get']({'plain':!![]});var _0x99d185=_0xb7d7('0x33');return db[_0xb7d7('0x59')]['find']({'where':{'name':_0x99d185,'userProfileId':_0x378ff9['userProfileId']},'raw':!![]})[_0xb7d7('0x1c')](function(_0x51102c){if(_0x51102c&&_0x51102c[_0xb7d7('0x5a')]===0x0){return db[_0xb7d7('0x34')][_0xb7d7('0x55')]({'name':_0x41cb15[_0xb7d7('0x37')],'resourceId':_0x41cb15['id'],'type':_0x51102c[_0xb7d7('0x37')],'sectionId':_0x51102c['id']},{})[_0xb7d7('0x1c')](function(){return _0x3118d3;});}else{return _0x3118d3;}})['catch'](function(_0x2cc5e0){logger[_0xb7d7('0x22')](_0xb7d7('0x5b'),_0x2cc5e0);throw _0x2cc5e0;});}return _0x3118d3;})[_0xb7d7('0x1c')](respondWithResult(_0x2dd1ec,0xc9))['catch'](handleError(_0x2dd1ec,null));};exports['update']=function(_0x3cc11b,_0x2874e3){if(_0x3cc11b[_0xb7d7('0x56')]['id']){delete _0x3cc11b[_0xb7d7('0x56')]['id'];}return db[_0xb7d7('0x3c')][_0xb7d7('0x54')]({'where':{'id':_0x3cc11b['params']['id']},'include':[{'model':db[_0xb7d7('0x3a')],'as':'mandatoryDispositionPause'}]})['then'](handleEntityNotFound(_0x2874e3,null))[_0xb7d7('0x1c')](saveUpdates(_0x3cc11b['body'],null))[_0xb7d7('0x1c')](respondWithResult(_0x2874e3,null))[_0xb7d7('0x26')](handleError(_0x2874e3,null));};exports[_0xb7d7('0x32')]=function(_0x3a011c,_0x22cc40){return db[_0xb7d7('0x3c')]['find']({'where':{'id':_0x3a011c['params']['id']}})[_0xb7d7('0x1c')](handleEntityNotFound(_0x22cc40,null))[_0xb7d7('0x1c')](removeEntity(_0x22cc40,null))[_0xb7d7('0x26')](handleError(_0x22cc40,null));};exports[_0xb7d7('0x5c')]=function(_0x21d722,_0x7559a8){return db['FaxAccount'][_0xb7d7('0x5c')]()['then'](respondWithResult(_0x7559a8,null))[_0xb7d7('0x26')](handleError(_0x7559a8,null));};exports[_0xb7d7('0x5d')]=function(_0xb0b3d0,_0x613de7,_0x27e0b0){if(_0xb0b3d0['body']['id']){delete _0xb0b3d0[_0xb7d7('0x56')]['id'];}return db[_0xb7d7('0x3c')][_0xb7d7('0x54')]({'where':{'id':_0xb0b3d0[_0xb7d7('0x52')]['id']}})['then'](handleEntityNotFound(_0x613de7,null))['then'](function(_0x5549f0){if(_0x5549f0){_0xb0b3d0['body']['FaxAccountId']=_0x5549f0['id'];return db[_0xb7d7('0x5e')][_0xb7d7('0x55')](_0xb0b3d0[_0xb7d7('0x56')]);}})[_0xb7d7('0x1c')](respondWithResult(_0x613de7,null))[_0xb7d7('0x26')](handleError(_0x613de7,null));};exports[_0xb7d7('0x5f')]=function(_0x38af66,_0x545f86,_0x54d2c8){var _0x491286={'raw':![],'where':{}};var _0x38dc8c={};var _0x210331={'count':0x0,'rows':[]};return db[_0xb7d7('0x3c')][_0xb7d7('0x60')]({'where':{'id':_0x38af66[_0xb7d7('0x52')]['id']}})[_0xb7d7('0x1c')](handleEntityNotFound(_0x545f86,null))[_0xb7d7('0x1c')](function(_0x4c02b4){if(_0x4c02b4){_0x38dc8c[_0xb7d7('0x42')]=_[_0xb7d7('0x3f')](db[_0xb7d7('0x5e')][_0xb7d7('0x3d')]);_0x38dc8c['query']=_[_0xb7d7('0x3f')](_0x38af66[_0xb7d7('0x3e')]);_0x38dc8c[_0xb7d7('0x40')]=_[_0xb7d7('0x41')](_0x38dc8c[_0xb7d7('0x42')],_0x38dc8c['query']);_0x491286[_0xb7d7('0x44')]=_[_0xb7d7('0x41')](_0x38dc8c['model'],qs[_0xb7d7('0x43')](_0x38af66[_0xb7d7('0x3e')][_0xb7d7('0x43')]));_0x491286['attributes']=_0x491286['attributes'][_0xb7d7('0x45')]?_0x491286['attributes']:_0x38dc8c[_0xb7d7('0x42')];if(!_0x38af66[_0xb7d7('0x3e')][_0xb7d7('0x61')](_0xb7d7('0x46'))){_0x491286[_0xb7d7('0x2c')]=qs[_0xb7d7('0x2c')](_0x38af66[_0xb7d7('0x3e')][_0xb7d7('0x2c')]);_0x491286[_0xb7d7('0x2b')]=qs['offset'](_0x38af66['query'][_0xb7d7('0x2b')]);}_0x491286[_0xb7d7('0x62')]=qs[_0xb7d7('0x47')](_0x38af66[_0xb7d7('0x3e')]['sort']);_0x491286[_0xb7d7('0x48')]=qs[_0xb7d7('0x40')](_[_0xb7d7('0x63')](_0x38af66[_0xb7d7('0x3e')],_0x38dc8c['filters']));_0x491286[_0xb7d7('0x48')][_0xb7d7('0x64')]=_0x4c02b4['id'];if(_0x38af66[_0xb7d7('0x3e')][_0xb7d7('0x49')]){_0x491286[_0xb7d7('0x48')]=_[_0xb7d7('0x53')](_0x491286[_0xb7d7('0x48')],{'$or':_[_0xb7d7('0x4a')](_0x491286[_0xb7d7('0x44')],function(_0x40fce6){var _0x4e9e9d={};_0x4e9e9d[_0x40fce6]={'$like':'%'+_0x38af66[_0xb7d7('0x3e')][_0xb7d7('0x49')]+'%'};return _0x4e9e9d;})});}_0x491286=_['merge']({},_0x491286,_0x38af66[_0xb7d7('0x4d')]);return db[_0xb7d7('0x5e')][_0xb7d7('0x2a')]({'where':_0x491286[_0xb7d7('0x48')]})[_0xb7d7('0x1c')](function(_0x4d3077){_0x210331[_0xb7d7('0x2a')]=_0x4d3077;if(_0x38af66[_0xb7d7('0x3e')][_0xb7d7('0x4e')]){_0x491286['include']=[{'all':!![]}];}return db[_0xb7d7('0x5e')][_0xb7d7('0x65')](_0x491286);})['then'](function(_0x178156){_0x210331[_0xb7d7('0x50')]=_0x178156;return _0x210331;});}})[_0xb7d7('0x1c')](respondWithFilteredResult(_0x545f86,_0x491286))[_0xb7d7('0x26')](handleError(_0x545f86,null));};exports[_0xb7d7('0x66')]=function(_0x1b2e41,_0x24186c,_0x30078f){return db[_0xb7d7('0x3c')][_0xb7d7('0x54')]({'where':{'id':_0x1b2e41['params']['id']}})[_0xb7d7('0x1c')](handleEntityNotFound(_0x24186c,null))[_0xb7d7('0x1c')](function(_0x4ad411){if(_0x4ad411){return _0x4ad411[_0xb7d7('0x66')](_0x1b2e41[_0xb7d7('0x3e')][_0xb7d7('0x67')]);}})[_0xb7d7('0x1c')](respondWithStatusCode(_0x24186c,null))[_0xb7d7('0x26')](handleError(_0x24186c,null));};exports['addAnswer']=function(_0x4790dc,_0x59c1ed,_0x1325e0){if(_0x4790dc['body']['id']){delete _0x4790dc[_0xb7d7('0x56')]['id'];}return db[_0xb7d7('0x3c')][_0xb7d7('0x54')]({'where':{'id':_0x4790dc['params']['id']}})['then'](handleEntityNotFound(_0x59c1ed,null))[_0xb7d7('0x1c')](function(_0x483512){if(_0x483512){_0x4790dc[_0xb7d7('0x56')][_0xb7d7('0x64')]=_0x483512['id'];return db['CannedAnswer'][_0xb7d7('0x55')](_0x4790dc[_0xb7d7('0x56')]);}})['then'](respondWithResult(_0x59c1ed,null))[_0xb7d7('0x26')](handleError(_0x59c1ed,null));};exports[_0xb7d7('0x68')]=function(_0x3994e4,_0x20765c,_0x36f0ac){var _0x2c4978={'raw':![],'where':{}};var _0x382f60={};var _0x17fa10={'count':0x0,'rows':[]};return db[_0xb7d7('0x3c')][_0xb7d7('0x60')]({'where':{'id':_0x3994e4[_0xb7d7('0x52')]['id']}})[_0xb7d7('0x1c')](handleEntityNotFound(_0x20765c,null))[_0xb7d7('0x1c')](function(_0x4db37e){if(_0x4db37e){_0x382f60[_0xb7d7('0x42')]=_[_0xb7d7('0x3f')](db[_0xb7d7('0x69')][_0xb7d7('0x3d')]);_0x382f60[_0xb7d7('0x3e')]=_['keys'](_0x3994e4[_0xb7d7('0x3e')]);_0x382f60[_0xb7d7('0x40')]=_[_0xb7d7('0x41')](_0x382f60[_0xb7d7('0x42')],_0x382f60[_0xb7d7('0x3e')]);_0x2c4978[_0xb7d7('0x44')]=_['intersection'](_0x382f60[_0xb7d7('0x42')],qs['fields'](_0x3994e4[_0xb7d7('0x3e')][_0xb7d7('0x43')]));_0x2c4978[_0xb7d7('0x44')]=_0x2c4978['attributes'][_0xb7d7('0x45')]?_0x2c4978[_0xb7d7('0x44')]:_0x382f60[_0xb7d7('0x42')];if(!_0x3994e4['query'][_0xb7d7('0x61')](_0xb7d7('0x46'))){_0x2c4978[_0xb7d7('0x2c')]=qs[_0xb7d7('0x2c')](_0x3994e4['query'][_0xb7d7('0x2c')]);_0x2c4978['offset']=qs['offset'](_0x3994e4[_0xb7d7('0x3e')][_0xb7d7('0x2b')]);}_0x2c4978[_0xb7d7('0x62')]=qs[_0xb7d7('0x47')](_0x3994e4['query'][_0xb7d7('0x47')]);_0x2c4978['where']=qs[_0xb7d7('0x40')](_[_0xb7d7('0x63')](_0x3994e4[_0xb7d7('0x3e')],_0x382f60[_0xb7d7('0x40')]));_0x2c4978['where'][_0xb7d7('0x64')]=_0x4db37e['id'];if(_0x3994e4[_0xb7d7('0x3e')][_0xb7d7('0x49')]){_0x2c4978['where']=_['merge'](_0x2c4978[_0xb7d7('0x48')],{'$or':_[_0xb7d7('0x4a')](_0x2c4978[_0xb7d7('0x44')],function(_0x3acd9b){var _0x1e363b={};_0x1e363b[_0x3acd9b]={'$like':'%'+_0x3994e4[_0xb7d7('0x3e')]['filter']+'%'};return _0x1e363b;})});}_0x2c4978=_[_0xb7d7('0x53')]({},_0x2c4978,_0x3994e4['options']);return db[_0xb7d7('0x69')]['count']({'where':_0x2c4978[_0xb7d7('0x48')]})[_0xb7d7('0x1c')](function(_0xdf478b){_0x17fa10[_0xb7d7('0x2a')]=_0xdf478b;if(_0x3994e4[_0xb7d7('0x3e')][_0xb7d7('0x4e')]){_0x2c4978[_0xb7d7('0x4f')]=[{'all':!![]}];}return db[_0xb7d7('0x69')][_0xb7d7('0x65')](_0x2c4978);})['then'](function(_0x199084){_0x17fa10['rows']=_0x199084;return _0x17fa10;});}})['then'](respondWithFilteredResult(_0x20765c,_0x2c4978))['catch'](handleError(_0x20765c,null));};exports[_0xb7d7('0x6a')]=function(_0x351d31,_0x34f79d,_0x55021e){return db[_0xb7d7('0x3c')][_0xb7d7('0x54')]({'where':{'id':_0x351d31[_0xb7d7('0x52')]['id']}})['then'](handleEntityNotFound(_0x34f79d,null))[_0xb7d7('0x1c')](function(_0x2d59bf){if(_0x2d59bf){return _0x2d59bf[_0xb7d7('0x6a')](_0x351d31['query'][_0xb7d7('0x67')]);}})['then'](respondWithStatusCode(_0x34f79d,null))['catch'](handleError(_0x34f79d,null));};exports[_0xb7d7('0x6b')]=function(_0x54628f,_0x3bfac2,_0x4e11a1){return db['FaxInteraction']['find']({'where':{'id':_0x54628f[_0xb7d7('0x52')]['id']}})[_0xb7d7('0x1c')](handleEntityNotFound(_0x3bfac2,null))[_0xb7d7('0x1c')](function(_0x11c76c){if(_0x11c76c){return _0x11c76c['addInteraction'](_0x54628f[_0xb7d7('0x56')][_0xb7d7('0x67')],_[_0xb7d7('0x6c')](_0x54628f[_0xb7d7('0x56')],['ids','id'])||{});}})['then'](respondWithResult(_0x3bfac2,null))['catch'](handleError(_0x3bfac2,null));};exports[_0xb7d7('0x6d')]=function(_0x4256d9,_0x160a6f,_0xc0376f){var _0x177ea6={'raw':![],'where':{}};var _0x3383c6={};var _0xa49304={'count':0x0,'rows':[]};return db[_0xb7d7('0x3c')][_0xb7d7('0x60')]({'where':{'id':_0x4256d9[_0xb7d7('0x52')]['id']}})[_0xb7d7('0x1c')](handleEntityNotFound(_0x160a6f,null))[_0xb7d7('0x1c')](function(_0x2fee17){if(_0x2fee17){_0x3383c6[_0xb7d7('0x42')]=_[_0xb7d7('0x3f')](db['FaxInteraction'][_0xb7d7('0x3d')]);_0x3383c6[_0xb7d7('0x3e')]=_['keys'](_0x4256d9[_0xb7d7('0x3e')]);_0x3383c6[_0xb7d7('0x40')]=_[_0xb7d7('0x41')](_0x3383c6[_0xb7d7('0x42')],_0x3383c6[_0xb7d7('0x3e')]);_0x177ea6['attributes']=_[_0xb7d7('0x41')](_0x3383c6['model'],qs[_0xb7d7('0x43')](_0x4256d9[_0xb7d7('0x3e')]['fields']));_0x177ea6[_0xb7d7('0x44')]=_0x177ea6[_0xb7d7('0x44')][_0xb7d7('0x45')]?_0x177ea6[_0xb7d7('0x44')]:_0x3383c6[_0xb7d7('0x42')];if(!_0x4256d9[_0xb7d7('0x3e')][_0xb7d7('0x61')](_0xb7d7('0x46'))){_0x177ea6[_0xb7d7('0x2c')]=qs[_0xb7d7('0x2c')](_0x4256d9[_0xb7d7('0x3e')][_0xb7d7('0x2c')]);_0x177ea6[_0xb7d7('0x2b')]=qs[_0xb7d7('0x2b')](_0x4256d9[_0xb7d7('0x3e')][_0xb7d7('0x2b')]);}_0x177ea6[_0xb7d7('0x62')]=qs['sort'](_0x4256d9[_0xb7d7('0x3e')][_0xb7d7('0x47')]);_0x177ea6[_0xb7d7('0x48')]=qs[_0xb7d7('0x40')](_[_0xb7d7('0x63')](_0x4256d9[_0xb7d7('0x3e')],_0x3383c6[_0xb7d7('0x40')]));_0x177ea6[_0xb7d7('0x48')]['FaxAccountId']=_0x2fee17['id'];if(_0x4256d9['query'][_0xb7d7('0x49')]){_0x177ea6[_0xb7d7('0x48')]=_[_0xb7d7('0x53')](_0x177ea6['where'],{'$or':_[_0xb7d7('0x4a')](_0x177ea6[_0xb7d7('0x44')],function(_0x24ee20){var _0x5cd190={};_0x5cd190[_0x24ee20]={'$like':'%'+_0x4256d9[_0xb7d7('0x3e')]['filter']+'%'};return _0x5cd190;})});}_0x177ea6=_[_0xb7d7('0x53')]({},_0x177ea6,_0x4256d9[_0xb7d7('0x4d')]);return db['FaxInteraction'][_0xb7d7('0x2a')]({'where':_0x177ea6[_0xb7d7('0x48')]})['then'](function(_0x1e4e20){_0xa49304['count']=_0x1e4e20;if(_0x4256d9['query'][_0xb7d7('0x4e')]){_0x177ea6['include']=[{'model':db[_0xb7d7('0x6e')],'as':_0xb7d7('0x6f'),'required':![]},{'model':db['User'],'as':'Owner','attributes':[_0xb7d7('0x37'),_0xb7d7('0x70'),_0xb7d7('0x71')],'required':![]},{'model':db[_0xb7d7('0x72')],'as':_0xb7d7('0x73'),'attributes':['id',_0xb7d7('0x37'),_0xb7d7('0x74')],'where':_0x4256d9['query']['tag']?{'id':_0x4256d9['query'][_0xb7d7('0x75')]}:undefined,'required':_0x4256d9[_0xb7d7('0x3e')][_0xb7d7('0x75')]?!![]:![]}];}return db[_0xb7d7('0x76')][_0xb7d7('0x65')](_0x177ea6);})[_0xb7d7('0x1c')](function(_0x399785){_0xa49304[_0xb7d7('0x50')]=_0x399785;return _0xa49304;});}})[_0xb7d7('0x1c')](respondWithFilteredResult(_0x160a6f,_0x177ea6))['catch'](handleError(_0x160a6f,null));};exports['addApplications']=function(_0x4efa4f,_0x299563,_0x1dd29e){return db[_0xb7d7('0x3c')][_0xb7d7('0x60')]({'where':{'id':_0x4efa4f[_0xb7d7('0x52')]['id']}})['then'](handleEntityNotFound(_0x299563,null))[_0xb7d7('0x1c')](function(_0x1ec600){if(_0x1ec600){return db[_0xb7d7('0x77')][_0xb7d7('0x78')](function(_0x36d405){return db['FaxApplication'][_0xb7d7('0x32')]({'where':{'FaxAccountId':_0x4efa4f[_0xb7d7('0x52')]['id']},'transaction':_0x36d405})[_0xb7d7('0x1c')](function(_0x3a1a2f){var _0x8dc7da=_['map'](_0x4efa4f[_0xb7d7('0x56')],function(_0x3df0ed){_0x3df0ed['FaxAccountId']=_0x4efa4f[_0xb7d7('0x52')]['id'];return _0x3df0ed;});return db[_0xb7d7('0x79')][_0xb7d7('0x7a')](_0x8dc7da,{'transaction':_0x36d405});});})['then'](function(){return db['FaxApplication'][_0xb7d7('0x7b')]({'where':{'FaxAccountId':_0x4efa4f['params']['id']},'order':_0xb7d7('0x7c')});});}})[_0xb7d7('0x1c')](respondWithResult(_0x299563,null))[_0xb7d7('0x26')](handleError(_0x299563,null));};exports[_0xb7d7('0x7d')]=function(_0x299036,_0x3bfcd4,_0x34165a){var _0x3bcf36={};var _0x2f2b52={};var _0x6f0370;var _0x1214c3;return db[_0xb7d7('0x3c')][_0xb7d7('0x60')]({'where':{'id':_0x299036[_0xb7d7('0x52')]['id']}})[_0xb7d7('0x1c')](handleEntityNotFound(_0x3bfcd4,null))[_0xb7d7('0x1c')](function(_0x11726){if(_0x11726){_0x6f0370=_0x11726;_0x2f2b52['model']=_[_0xb7d7('0x3f')](db[_0xb7d7('0x79')]['rawAttributes']);_0x2f2b52['query']=_['keys'](_0x299036[_0xb7d7('0x3e')]);_0x2f2b52[_0xb7d7('0x40')]=_[_0xb7d7('0x41')](_0x2f2b52[_0xb7d7('0x42')],_0x2f2b52[_0xb7d7('0x3e')]);_0x3bcf36[_0xb7d7('0x44')]=_[_0xb7d7('0x41')](_0x2f2b52[_0xb7d7('0x42')],qs[_0xb7d7('0x43')](_0x299036[_0xb7d7('0x3e')][_0xb7d7('0x43')]));_0x3bcf36['attributes']=_0x3bcf36[_0xb7d7('0x44')]['length']?_0x3bcf36[_0xb7d7('0x44')]:_0x2f2b52['model'];_0x3bcf36['order']=qs[_0xb7d7('0x47')](_0x299036[_0xb7d7('0x3e')][_0xb7d7('0x47')]);_0x3bcf36[_0xb7d7('0x48')]=qs['filters'](_['pick'](_0x299036['query'],_0x2f2b52['filters']));if(_0x299036[_0xb7d7('0x3e')][_0xb7d7('0x49')]){_0x3bcf36[_0xb7d7('0x48')]=_[_0xb7d7('0x53')](_0x3bcf36[_0xb7d7('0x48')],{'$or':_[_0xb7d7('0x4a')](_0x3bcf36['attributes'],function(_0x307e61){var _0x41dc0b={};_0x41dc0b[_0x307e61]={'$like':'%'+_0x299036['query'][_0xb7d7('0x49')]+'%'};return _0x41dc0b;})});}_0x3bcf36=_[_0xb7d7('0x53')]({},_0x3bcf36,_0x299036[_0xb7d7('0x4d')]);return _0x6f0370['getApplications'](_0x3bcf36);}})['then'](function(_0x5f1a30){if(_0x5f1a30){_0x1214c3=_0x5f1a30[_0xb7d7('0x45')];if(!_0x299036['query'][_0xb7d7('0x61')](_0xb7d7('0x46'))){_0x3bcf36[_0xb7d7('0x2c')]=qs['limit'](_0x299036[_0xb7d7('0x3e')][_0xb7d7('0x2c')]);_0x3bcf36[_0xb7d7('0x2b')]=qs[_0xb7d7('0x2b')](_0x299036[_0xb7d7('0x3e')]['offset']);}return _0x6f0370[_0xb7d7('0x7d')](_0x3bcf36);}})[_0xb7d7('0x1c')](function(_0x5785d0){if(_0x5785d0){return _0x5785d0?{'count':_0x1214c3,'rows':_0x5785d0}:null;}})[_0xb7d7('0x1c')](respondWithResult(_0x3bfcd4,null))['catch'](handleError(_0x3bfcd4,null));};function Extension(_0x2cf0a9,_0x32eaac,_0x3ce4ce,_0x398a9b){this[_0xb7d7('0x7e')]=_0xb7d7('0x7f');this[_0xb7d7('0x80')]=_0x2cf0a9[_0xb7d7('0x81')];this['app']=_0x398a9b;this[_0xb7d7('0x4b')]=_0xb7d7('0x82');this[_0xb7d7('0x83')]=_0xb7d7('0x84');this[_0xb7d7('0x64')]=_0x2cf0a9['id'];this[_0xb7d7('0x7c')]=_0x32eaac;this['appdata']=_0x3ce4ce;}function createExtensionsReciveFax(_0x250507){var _0x4dc0ed=0x1;var _0x1ed655=[];_0x1ed655[_0xb7d7('0x85')](new Extension(_0x250507,_0x4dc0ed,'','Answer'));_0x4dc0ed+=0x1;_0x1ed655[_0xb7d7('0x85')](new Extension(_0x250507,_0x4dc0ed,_0xb7d7('0x86'),'Set'));_0x4dc0ed+=0x1;for(var _0x204bf8 in _0x250507){if(_0x250507[_0xb7d7('0x61')](_0x204bf8)&&(_0x204bf8===_0xb7d7('0x87')||_0x204bf8===_0xb7d7('0x81')||_0x204bf8==='gateway'||_0x204bf8===_0xb7d7('0x88')||_0x204bf8==='headerinfo'||_0x204bf8===_0xb7d7('0x89')||_0x204bf8===_0xb7d7('0x8a')||_0x204bf8===_0xb7d7('0x8b')||_0x204bf8===_0xb7d7('0x8c'))){_0x1ed655[_0xb7d7('0x85')](new Extension(_0x250507,_0x4dc0ed,_0xb7d7('0x8d')+_0x204bf8+')='+_0x250507[_0x204bf8],_0xb7d7('0x8e')));_0x4dc0ed+=0x1;}}_0x1ed655['push'](new Extension(_0x250507,_0x4dc0ed,'6',_0xb7d7('0x8f')));_0x4dc0ed+=0x1;_0x1ed655[_0xb7d7('0x85')](new Extension(_0x250507,_0x4dc0ed,_0xb7d7('0x90'),_0xb7d7('0x91')));_0x4dc0ed=0x0;return _0x1ed655;}exports[_0xb7d7('0x92')]=function(_0x57d970,_0x488a32,_0x17c78e){var _0x41bab6;return db['sequelize'][_0xb7d7('0x78')](function(_0xd885e0){return db['FaxAccount'][_0xb7d7('0x55')](_0x57d970[_0xb7d7('0x56')],{'transaction':_0xd885e0})[_0xb7d7('0x1c')](function(_0x29079d){_0x41bab6=_0x29079d[_0xb7d7('0x93')]({'plain':!![]});return db['VoiceExtension']['bulkCreate'](createExtensionsReciveFax(_0x41bab6),{'transaction':_0xd885e0});});})[_0xb7d7('0x1c')](function(){return _0x41bab6;})['then'](respondWithResult(_0x488a32,null))[_0xb7d7('0x26')](handleError(_0x488a32,null));};exports[_0xb7d7('0x94')]=function(_0x371c64,_0x4f8bf8,_0x5ba9f9){var _0xa37d2d;return db[_0xb7d7('0x77')]['transaction'](function(_0x4a0702){return db['FaxAccount'][_0xb7d7('0x31')](_0x371c64[_0xb7d7('0x56')],{'where':{'id':_0x371c64[_0xb7d7('0x56')]['id']},'transaction':_0x4a0702})[_0xb7d7('0x1c')](function(_0x1b3c9b){return db[_0xb7d7('0x95')]['destroy']({'where':{'FaxAccountId':_0x371c64[_0xb7d7('0x56')]['id']},'transaction':_0x4a0702})[_0xb7d7('0x1c')](function(_0x440250){return db[_0xb7d7('0x95')][_0xb7d7('0x7a')](createExtensionsReciveFax(_['omit'](_0x371c64[_0xb7d7('0x56')],[_0xb7d7('0x96'),_0xb7d7('0x97'),_0xb7d7('0x98'),_0xb7d7('0x99'),_0xb7d7('0x9a'),_0xb7d7('0x9b')])),{'transaction':_0x4a0702});});});})[_0xb7d7('0x1c')](function(){return db[_0xb7d7('0x3c')][_0xb7d7('0x9c')](_0x371c64[_0xb7d7('0x56')]['id']);})[_0xb7d7('0x1c')](respondWithResult(_0x4f8bf8,null))[_0xb7d7('0x26')](handleError(_0x4f8bf8,null));};exports[_0xb7d7('0x9d')]=function(_0x3a6bad,_0x229d84,_0x6ae97f){var _0x3d3010={'raw':!![],'where':{}};var _0x1dbaa9={};var _0x40c586={'count':0x0,'rows':[]};return db[_0xb7d7('0x3c')][_0xb7d7('0x60')]({'where':{'id':_0x3a6bad[_0xb7d7('0x52')]['id']}})[_0xb7d7('0x1c')](handleEntityNotFound(_0x229d84,null))[_0xb7d7('0x1c')](function(_0x24551e){if(_0x24551e){_0x1dbaa9[_0xb7d7('0x42')]=_[_0xb7d7('0x3f')](db[_0xb7d7('0x9e')][_0xb7d7('0x3d')]);_0x1dbaa9[_0xb7d7('0x3e')]=_[_0xb7d7('0x3f')](_0x3a6bad[_0xb7d7('0x3e')]);_0x1dbaa9[_0xb7d7('0x40')]=_['intersection'](_0x1dbaa9[_0xb7d7('0x42')],_0x1dbaa9[_0xb7d7('0x3e')]);_0x3d3010[_0xb7d7('0x44')]=_['intersection'](_0x1dbaa9[_0xb7d7('0x42')],qs[_0xb7d7('0x43')](_0x3a6bad[_0xb7d7('0x3e')][_0xb7d7('0x43')]));_0x3d3010['attributes']=_0x3d3010[_0xb7d7('0x44')][_0xb7d7('0x45')]?_0x3d3010['attributes']:_0x1dbaa9[_0xb7d7('0x42')];if(!_0x3a6bad[_0xb7d7('0x3e')]['hasOwnProperty'](_0xb7d7('0x46'))){_0x3d3010[_0xb7d7('0x2c')]=qs[_0xb7d7('0x2c')](_0x3a6bad['query'][_0xb7d7('0x2c')]);_0x3d3010[_0xb7d7('0x2b')]=qs[_0xb7d7('0x2b')](_0x3a6bad[_0xb7d7('0x3e')]['offset']);}_0x3d3010[_0xb7d7('0x62')]=qs[_0xb7d7('0x47')](_0x3a6bad[_0xb7d7('0x3e')][_0xb7d7('0x47')]);_0x3d3010['where']=qs['filters'](_[_0xb7d7('0x63')](_0x3a6bad['query'],_0x1dbaa9[_0xb7d7('0x40')]));_0x3d3010[_0xb7d7('0x48')][_0xb7d7('0x64')]=_0x24551e['id'];if(_0x3a6bad[_0xb7d7('0x3e')][_0xb7d7('0x49')]){_0x3d3010[_0xb7d7('0x48')]=_['merge'](_0x3d3010[_0xb7d7('0x48')],{'$or':_[_0xb7d7('0x4a')](_0x3d3010[_0xb7d7('0x44')],function(_0xdda09f){var _0x3ec1d1={};_0x3ec1d1[_0xdda09f]={'$like':'%'+_0x3a6bad[_0xb7d7('0x3e')][_0xb7d7('0x49')]+'%'};return _0x3ec1d1;})});}if(_0x3a6bad[_0xb7d7('0x3e')][_0xb7d7('0x9f')]){var _0x3c5b21=_0x3a6bad[_0xb7d7('0x3e')]['$gte'][_0xb7d7('0xa0')](',');var _0x79ceba={};_0x79ceba[_0x3c5b21[0x0]]={'$gte':moment(_0x3c5b21[0x1])[_0xb7d7('0xa1')](_0xb7d7('0xa2'))};_0x3d3010[_0xb7d7('0x48')]=_[_0xb7d7('0x53')](_0x3d3010[_0xb7d7('0x48')],_0x79ceba);}_0x3d3010=_[_0xb7d7('0x53')]({},_0x3d3010,_0x3a6bad[_0xb7d7('0x4d')]);return db[_0xb7d7('0x9e')][_0xb7d7('0x2a')]({'where':_0x3d3010[_0xb7d7('0x48')]})['then'](function(_0x53dc96){_0x40c586[_0xb7d7('0x2a')]=_0x53dc96;if(_0x3a6bad['query'][_0xb7d7('0x4e')]){_0x3d3010['include']=[{'all':!![]}];}return db[_0xb7d7('0x9e')][_0xb7d7('0x65')](_0x3d3010);})[_0xb7d7('0x1c')](function(_0x5c9569){_0x40c586[_0xb7d7('0x50')]=_0x5c9569;return _0x40c586;});}})[_0xb7d7('0x1c')](respondWithFilteredResult(_0x229d84,_0x3d3010))[_0xb7d7('0x26')](handleError(_0x229d84,null));};exports[_0xb7d7('0x38')]=function(_0x124a82,_0x8b25e2,_0x4fade7){var _0x222b52,_0x5a2a01={},_0x87dcb9;if(_0x124a82['body']['to']){_0x87dcb9=_0x124a82['body']['to'][0x0];}return db['FaxAccount'][_0xb7d7('0x54')]({'where':{'id':_0x124a82[_0xb7d7('0x52')]['id']},'include':[{'model':db[_0xb7d7('0xa3')],'as':_0xb7d7('0xa4'),'include':[{'model':db[_0xb7d7('0x6e')],'as':_0xb7d7('0xa5'),'where':{'fax':_0x87dcb9},'limit':0x1,'order':[['updatedAt',_0xb7d7('0xa6')]]}]}]})[_0xb7d7('0x1c')](handleEntityNotFound(_0x8b25e2,null))['then'](function(_0x1dbb2f){_0x222b52=_0x1dbb2f;if(_0x124a82[_0xb7d7('0x56')]['attachments']&&_0x124a82[_0xb7d7('0x56')][_0xb7d7('0xa7')]['length']){for(var _0xc76690=0x0;_0xc76690<_0x124a82[_0xb7d7('0x56')][_0xb7d7('0xa7')][_0xb7d7('0x45')];_0xc76690+=0x1){_0x124a82[_0xb7d7('0x56')]['attachments'][_0xc76690]={'filename':_0x124a82[_0xb7d7('0x56')]['attachments'][_0xc76690][_0xb7d7('0x37')],'id':_0x124a82[_0xb7d7('0x56')][_0xb7d7('0xa7')][_0xc76690]['id'],'path':path[_0xb7d7('0xa8')](config[_0xb7d7('0xa9')],_0xb7d7('0xaa'),_0x124a82[_0xb7d7('0x56')][_0xb7d7('0xa7')][_0xc76690][_0xb7d7('0xab')])};}}return respondWithRpcPromise(_0xb7d7('0xac'),'CheckAfterSend',{'FaxAccountId':_[_0xb7d7('0xad')](_0x124a82[_0xb7d7('0x52')]['id'])?undefined:_0x124a82[_0xb7d7('0x52')]['id'],'path':_['isNil'](_0x124a82['body'][_0xb7d7('0xa7')][0x0][_0xb7d7('0x6')])?undefined:_0x124a82['body'][_0xb7d7('0xa7')][0x0]['path'],'fax':_['isNil'](_0x124a82['body']['to'][0x0])?undefined:_0x124a82[_0xb7d7('0x56')]['to'][0x0]},client9002);})[_0xb7d7('0x1c')](function(){if(_0x222b52){if(_[_0xb7d7('0xad')](_0x124a82[_0xb7d7('0x56')][_0xb7d7('0xae')])){_0x124a82[_0xb7d7('0x56')][_0xb7d7('0xae')]=util[_0xb7d7('0xa1')](_0xb7d7('0xaf'),_0x222b52[_0xb7d7('0x37')],_0x222b52[_0xb7d7('0xb0')]);}if(_0x222b52[_0xb7d7('0xa4')]){if(_0x222b52[_0xb7d7('0xa4')]['Contacts']['length']){return _0x222b52[_0xb7d7('0xa4')]['Contacts'][0x0];}else{return db[_0xb7d7('0x6e')][_0xb7d7('0x55')](_['defaults'](_0x124a82['body'],{'firstName':_0x124a82[_0xb7d7('0x56')]['to'][0x0],'phone':_0x124a82['body']['to'][0x0],'fax':_0x124a82['body']['to'][0x0],'ListId':_0x222b52[_0xb7d7('0x9b')]}));}}else{throw new Error(_0xb7d7('0xb1'));}}else{throw new Error('Send\x20Fax\x20failed');}})['then'](function(_0x3482da){if(_0x3482da){return db[_0xb7d7('0x76')][_0xb7d7('0x54')]({'where':{'ContactId':_0x3482da['id'],'closed':![],'FaxAccountId':_0x222b52['id']}})[_0xb7d7('0x1c')](function(_0x3eb9d3){if(_0x3eb9d3){return[_0x3eb9d3,![]];}return db['FaxInteraction'][_0xb7d7('0x55')]({'UserId':_0x124a82['user']['id'],'ContactId':_0x3482da['id'],'FaxAccountId':_0x222b52['id'],'fax':_0x124a82[_0xb7d7('0x56')]['to'][0x0],'firstMsgDirection':_0xb7d7('0xb2'),'Messages':[_['merge'](_0x124a82['body'],{'read':![],'body':_0x124a82[_0xb7d7('0x56')][_0xb7d7('0xa7')][0x0][_0xb7d7('0xb3')],'FaxAccountId':_0x222b52['id'],'UserId':_0x124a82[_0xb7d7('0x57')]['id'],'ContactId':_0x3482da['id'],'AttachmentId':_0x124a82[_0xb7d7('0x56')][_0xb7d7('0xa7')][0x0]['id']})]},{'include':[{'model':db[_0xb7d7('0x9e')],'as':_0xb7d7('0xb4')}]})[_0xb7d7('0x1c')](function(_0xb135b7){return[_0xb135b7,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0xb7d7('0xb5')](function(_0x51cff8,_0xc1586a){if(_0xc1586a){return _0x51cff8;}return db[_0xb7d7('0x9e')][_0xb7d7('0x55')]({'direction':_0xb7d7('0xb2'),'read':![],'body':_0x124a82[_0xb7d7('0x56')][_0xb7d7('0xa7')][0x0][_0xb7d7('0xb3')],'FaxAccountId':_0x222b52['id'],'FaxInteractionId':_0x51cff8['id'],'UserId':_0x124a82['user']['id'],'ContactId':_0x51cff8[_0xb7d7('0xb6')],'AttachmentId':_0x124a82['body'][_0xb7d7('0xa7')][0x0]['id']})['then'](function(_0x20871d){_0x51cff8['dataValues'][_0xb7d7('0xb4')]=[];_0x51cff8['dataValues'][_0xb7d7('0xb4')][_0xb7d7('0x85')](_0x20871d['dataValues']);return _0x51cff8;});})['then'](function(_0x1f82ca){respondWithRpcPromise(_0xb7d7('0xb7'),_0xb7d7('0xb7'),{'FaxAccountId':_[_0xb7d7('0xad')](_0x124a82[_0xb7d7('0x52')]['id'])?undefined:_0x124a82['params']['id'],'path':_[_0xb7d7('0xad')](_0x124a82[_0xb7d7('0x56')][_0xb7d7('0xa7')][0x0]['path'])?undefined:_0x124a82[_0xb7d7('0x56')][_0xb7d7('0xa7')][0x0][_0xb7d7('0x6')],'fax':_[_0xb7d7('0xad')](_0x124a82[_0xb7d7('0x56')]['to'][0x0])?undefined:_0x124a82['body']['to'][0x0],'AttachmentId':_0x124a82['body'][_0xb7d7('0xa7')][0x0]['id']},client9002)[_0xb7d7('0x1c')](function(_0x414183){logger[_0xb7d7('0x25')](_0xb7d7('0xb8'),_0x414183);})[_0xb7d7('0x26')](function(_0x260088){logger[_0xb7d7('0x25')]('SendFaxRpc,\x20%s',_0x260088);});return _0x1f82ca;})[_0xb7d7('0x1c')](respondWithResult(_0x8b25e2,null))[_0xb7d7('0x26')](handleError(_0x8b25e2,null));};exports[_0xb7d7('0xb9')]=function(_0x50d243,_0x179400,_0x321e46){return db[_0xb7d7('0x3c')][_0xb7d7('0x54')]({'where':{'id':_0x50d243[_0xb7d7('0x52')]['id']}})[_0xb7d7('0x1c')](handleEntityNotFound(_0x179400,null))[_0xb7d7('0x1c')](function(_0xb0e8d6){if(_0xb0e8d6){return _0xb0e8d6['addAgents'](_0x50d243['body'][_0xb7d7('0x67')],_['omit'](_0x50d243[_0xb7d7('0x56')],['ids','id'])||{})[_0xb7d7('0xb5')](function(_0x1bb26a){for(var _0x3aa704=0x0;_0x3aa704<_0x50d243[_0xb7d7('0x56')][_0xb7d7('0x67')]['length'];_0x3aa704+=0x1){socket['emit'](_0xb7d7('0xba'),{'UserId':_0x50d243['body'][_0xb7d7('0x67')][_0x3aa704],'FaxAccountId':_0x50d243[_0xb7d7('0x52')]['id']});}return _0x1bb26a;});}})[_0xb7d7('0x1c')](respondWithResult(_0x179400,null))[_0xb7d7('0x26')](handleError(_0x179400,null));};exports[_0xb7d7('0xbb')]=function(_0x5b3ba9,_0x3524ed,_0xefa6b9){return db[_0xb7d7('0x3c')][_0xb7d7('0x54')]({'where':{'id':_0x5b3ba9['params']['id']}})[_0xb7d7('0x1c')](handleEntityNotFound(_0x3524ed,null))[_0xb7d7('0x1c')](function(_0x33b5d5){if(_0x33b5d5){return _0x33b5d5[_0xb7d7('0xbb')](_0x5b3ba9[_0xb7d7('0x3e')][_0xb7d7('0x67')])['then'](function(){if(_[_0xb7d7('0xbc')](_0x5b3ba9['query'][_0xb7d7('0x67')])){for(var _0x50ec55=0x0;_0x50ec55<_0x5b3ba9[_0xb7d7('0x3e')]['ids'][_0xb7d7('0x45')];_0x50ec55+=0x1){socket[_0xb7d7('0xbd')](_0xb7d7('0xbe'),{'UserId':Number(_0x5b3ba9[_0xb7d7('0x3e')][_0xb7d7('0x67')][_0x50ec55]),'FaxAccountId':Number(_0x5b3ba9['params']['id'])});}}else{socket['emit'](_0xb7d7('0xbe'),{'UserId':Number(_0x5b3ba9[_0xb7d7('0x3e')][_0xb7d7('0x67')]),'FaxAccountId':Number(_0x5b3ba9[_0xb7d7('0x52')]['id'])});}});}})['then'](respondWithStatusCode(_0x3524ed,null))['catch'](handleError(_0x3524ed,null));};exports[_0xb7d7('0xbf')]=function(_0x5bb3fe,_0x22a23b,_0x5498ef){var _0x1245fd={};var _0x4db371={};var _0x39428e;var _0x5c220c;return db[_0xb7d7('0x3c')]['findOne']({'where':{'id':_0x5bb3fe[_0xb7d7('0x52')]['id']}})[_0xb7d7('0x1c')](handleEntityNotFound(_0x22a23b,null))[_0xb7d7('0x1c')](function(_0x59ce76){if(_0x59ce76){_0x39428e=_0x59ce76;_0x4db371[_0xb7d7('0x42')]=_[_0xb7d7('0x3f')](db['User']['rawAttributes']);_0x4db371[_0xb7d7('0x3e')]=_[_0xb7d7('0x3f')](_0x5bb3fe[_0xb7d7('0x3e')]);_0x4db371[_0xb7d7('0x40')]=_['intersection'](_0x4db371['model'],_0x4db371[_0xb7d7('0x3e')]);_0x1245fd[_0xb7d7('0x44')]=_[_0xb7d7('0x41')](_0x4db371[_0xb7d7('0x42')],qs[_0xb7d7('0x43')](_0x5bb3fe[_0xb7d7('0x3e')][_0xb7d7('0x43')]));_0x1245fd[_0xb7d7('0x44')]=_0x1245fd[_0xb7d7('0x44')][_0xb7d7('0x45')]?_0x1245fd[_0xb7d7('0x44')]:_0x4db371[_0xb7d7('0x42')];_0x1245fd[_0xb7d7('0x62')]=qs[_0xb7d7('0x47')](_0x5bb3fe[_0xb7d7('0x3e')][_0xb7d7('0x47')]);_0x1245fd[_0xb7d7('0x48')]=qs[_0xb7d7('0x40')](_[_0xb7d7('0x63')](_0x5bb3fe[_0xb7d7('0x3e')],_0x4db371[_0xb7d7('0x40')]));if(_0x5bb3fe[_0xb7d7('0x3e')]['filter']){_0x1245fd['where']=_[_0xb7d7('0x53')](_0x1245fd['where'],{'$or':_['map'](_0x1245fd['attributes'],function(_0x48e3da){var _0x12d2d4={};_0x12d2d4[_0x48e3da]={'$like':'%'+_0x5bb3fe[_0xb7d7('0x3e')]['filter']+'%'};return _0x12d2d4;})});}_0x1245fd=_[_0xb7d7('0x53')]({},_0x1245fd,_0x5bb3fe['options']);return _0x39428e[_0xb7d7('0xbf')](_0x1245fd);}})['then'](function(_0x4c6bd9){if(_0x4c6bd9){_0x5c220c=_0x4c6bd9[_0xb7d7('0x45')];if(!_0x5bb3fe[_0xb7d7('0x3e')][_0xb7d7('0x61')]('nolimit')){_0x1245fd[_0xb7d7('0x2c')]=qs[_0xb7d7('0x2c')](_0x5bb3fe[_0xb7d7('0x3e')][_0xb7d7('0x2c')]);_0x1245fd[_0xb7d7('0x2b')]=qs[_0xb7d7('0x2b')](_0x5bb3fe[_0xb7d7('0x3e')][_0xb7d7('0x2b')]);}return _0x39428e['getAgents'](_0x1245fd);}})[_0xb7d7('0x1c')](function(_0x4b8ad7){if(_0x4b8ad7){return _0x4b8ad7?{'count':_0x5c220c,'rows':_0x4b8ad7}:null;}})[_0xb7d7('0x1c')](respondWithResult(_0x22a23b,null))[_0xb7d7('0x26')](handleError(_0x22a23b,null));}; \ No newline at end of file +var _0xdab3=['TrunkId','ListId','findById','FaxMessage','split','YYYY-MM-DD\x20HH:mm:ss','CmList','Contacts','DESC','attachments','join','root','basename','CheckAfterSend','isNil','from','format','List','List\x20not\x20found','Send\x20Fax\x20failed','filename','Messages','Contact\x20not\x20found','spread','ContactId','dataValues','SendFax','SendFaxRpc,\x20%s','userFaxAccount:save','removeAgents','emit','userFaxAccount:remove','User','getAgents','html-pdf','eml-format','rimraf','zip-dir','moment','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/environment','../../mysqldb','redis','defaults','./faxAccount.socket','register','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','info','request\x20sent','debug','stringify','error','FaxAccount,\x20%s,\x20%s','message','catch','status','end','json','count','offset','set','Content-Range','apply','reject','save','then','destroy','FaxAccounts','UserProfileResource','stack','name','send','index','Pause','mandatoryDispositionPause','FaxAccount','rawAttributes','model','keys','query','filters','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','where','pick','merge','map','type','key','VIRTUAL','field','options','includeAll','include','findAll','rows','show','params','intersection','find','create','body','get','role','user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','addDisposition','Disposition','getDispositions','findOne','order','FaxAccountId','filter','removeDispositions','addAnswer','CannedAnswer','removeAnswers','FaxInteraction','addInteraction','ids','omit','getInteractions','CmContact','fullname','internal','Tag','Tags','color','tag','sequelize','transaction','FaxApplication','bulkCreate','findAndCountAll','priority','getApplications','from-voip-provider','exten','localstationid','app','system','description','Fax\x20Extension','appdata','Answer','push','CDR(type)=inbound-fax','Set','ecm','gateway','faxdetect','headerinfo','minrate','modem','FAXOPT(','Wait','ReceiveFax','addAccountApplications','VoiceExtension','updateAccountApplications','tech'];(function(_0x1f5143,_0x5e31e6){var _0x383a38=function(_0x2c123c){while(--_0x2c123c){_0x1f5143['push'](_0x1f5143['shift']());}};_0x383a38(++_0x5e31e6);}(_0xdab3,0x1a2));var _0x3dab=function(_0x5cd482,_0x56afbf){_0x5cd482=_0x5cd482-0x0;var _0x40d490=_0xdab3[_0x5cd482];return _0x40d490;};'use strict';var pdf=require(_0x3dab('0x0'));var emlformat=require(_0x3dab('0x1'));var rimraf=require(_0x3dab('0x2'));var zipdir=require(_0x3dab('0x3'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x3dab('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x3dab('0x5'));var util=require(_0x3dab('0x6'));var path=require(_0x3dab('0x7'));var sox=require(_0x3dab('0x8'));var csv=require(_0x3dab('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x3dab('0xa'));var squel=require(_0x3dab('0xb'));var crypto=require(_0x3dab('0xc'));var jsforce=require(_0x3dab('0xd'));var deskjs=require(_0x3dab('0xe'));var toCsv=require(_0x3dab('0x9'));var querystring=require(_0x3dab('0xf'));var Papa=require('papaparse');var Redis=require(_0x3dab('0x10'));var authService=require(_0x3dab('0x11'));var qs=require(_0x3dab('0x12'));var as=require(_0x3dab('0x13'));var hardwareService=require(_0x3dab('0x14'));var logger=require(_0x3dab('0x15'))(_0x3dab('0x16'));var utils=require('../../config/utils');var config=require(_0x3dab('0x17'));var db=require(_0x3dab('0x18'))['db'];config[_0x3dab('0x19')]=_[_0x3dab('0x1a')](config[_0x3dab('0x19')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3dab('0x19')]));require(_0x3dab('0x1b'))[_0x3dab('0x1c')](socket);var jayson=require(_0x3dab('0x1d'));var client=jayson[_0x3dab('0x1e')]['http']({'port':0x232c});var client9002=jayson['client'][_0x3dab('0x1f')]({'port':0x232a});function checkPasswordPattern(_0x19c1f4,_0x2a40ef,_0x5b7978){if(_0x5b7978){var _0x89f6d2=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x89f6d2[_0x3dab('0x20')](_0x2a40ef)){return _0x19c1f4;}else{throw new Error(_0x3dab('0x21'));}}else{return _0x19c1f4;}}function respondWithRpcPromise(_0x22c7e0,_0x267bc5,_0x4f51a3,_0x21635a){return new BPromise(function(_0x40da5d,_0x18d795){var _0x461170=_0x21635a||client;return _0x461170[_0x3dab('0x22')](_0x22c7e0,_0x4f51a3)['then'](function(_0x2da910){logger[_0x3dab('0x23')]('FaxAccount,\x20%s,\x20%s',_0x267bc5,_0x3dab('0x24'));logger[_0x3dab('0x25')]('FaxAccount,\x20%s,\x20%s,\x20%s',_0x267bc5,'request\x20sent',JSON[_0x3dab('0x26')](_0x2da910));if(_0x2da910[_0x3dab('0x27')]){if(_0x2da910[_0x3dab('0x27')]['code']===0x1f4){logger[_0x3dab('0x27')](_0x3dab('0x28'),_0x267bc5,_0x2da910[_0x3dab('0x27')][_0x3dab('0x29')]);return _0x18d795(_0x2da910[_0x3dab('0x27')][_0x3dab('0x29')]);}logger['error']('FaxAccount,\x20%s,\x20%s',_0x267bc5,_0x2da910[_0x3dab('0x27')]['message']);return _0x40da5d(_0x2da910[_0x3dab('0x27')][_0x3dab('0x29')]);}else{logger[_0x3dab('0x23')](_0x3dab('0x28'),_0x267bc5,_0x3dab('0x24'));_0x40da5d(_0x2da910['result'][_0x3dab('0x29')]);}})[_0x3dab('0x2a')](function(_0x27f1ce){logger[_0x3dab('0x27')](_0x3dab('0x28'),_0x267bc5,_0x27f1ce);_0x18d795(_0x27f1ce);});});}function respondWithStatusCode(_0x49120b,_0x20cb7f){_0x20cb7f=_0x20cb7f||0xcc;return function(_0x441eeb){if(_0x441eeb){return _0x49120b['sendStatus'](_0x20cb7f);}return _0x49120b[_0x3dab('0x2b')](_0x20cb7f)[_0x3dab('0x2c')]();};}function respondWithResult(_0x41d068,_0x531ab0){_0x531ab0=_0x531ab0||0xc8;return function(_0x4e503e){if(_0x4e503e){return _0x41d068[_0x3dab('0x2b')](_0x531ab0)[_0x3dab('0x2d')](_0x4e503e);}};}function respondWithFilteredResult(_0x38b12e,_0x420be5){return function(_0x48d4a9){if(_0x48d4a9){var _0x2aa452=_0x48d4a9[_0x3dab('0x2e')],_0x2a4a4c=_0x420be5[_0x3dab('0x2f')],_0x3aaafa=_0x420be5[_0x3dab('0x2f')]+_0x420be5['limit'],_0x1bf214;if(_0x3aaafa>=_0x2aa452){_0x3aaafa=_0x2aa452;_0x1bf214=0xc8;}else{_0x1bf214=0xce;}_0x38b12e['status'](_0x1bf214);return _0x38b12e[_0x3dab('0x30')](_0x3dab('0x31'),_0x2a4a4c+'-'+_0x3aaafa+'/'+_0x2aa452)[_0x3dab('0x2d')](_0x48d4a9);}return null;};}function patchUpdates(_0x3ca5f0){return function(_0x243b83){try{jsonpatch[_0x3dab('0x32')](_0x243b83,_0x3ca5f0,!![]);}catch(_0x5624bd){return BPromise[_0x3dab('0x33')](_0x5624bd);}return _0x243b83[_0x3dab('0x34')]();};}function saveUpdates(_0x322dd6,_0x4b95de){return function(_0x266131){if(_0x266131){return _0x266131['update'](_0x322dd6)[_0x3dab('0x35')](function(_0x42981b){return _0x42981b;});}return null;};}function removeEntity(_0xb9f192,_0x9b6732){return function(_0x4239da){if(_0x4239da){return _0x4239da[_0x3dab('0x36')]()[_0x3dab('0x35')](function(){var _0x3880a1=_0x4239da['get']({'plain':!![]});var _0x3e3ab7=_0x3dab('0x37');return db[_0x3dab('0x38')][_0x3dab('0x36')]({'where':{'type':_0x3e3ab7,'resourceId':_0x3880a1['id']}})[_0x3dab('0x35')](function(){return _0x4239da;});})[_0x3dab('0x35')](function(){_0xb9f192[_0x3dab('0x2b')](0xcc)[_0x3dab('0x2c')]();});}};}function handleEntityNotFound(_0x3116e5,_0x177fa9){return function(_0x1aa59e){if(!_0x1aa59e){_0x3116e5['sendStatus'](0x194);}return _0x1aa59e;};}function handleError(_0x46d47e,_0x5241a1){_0x5241a1=_0x5241a1||0x1f4;return function(_0x55b273){logger[_0x3dab('0x27')](_0x55b273[_0x3dab('0x39')]);if(_0x55b273['name']){delete _0x55b273[_0x3dab('0x3a')];}_0x46d47e['status'](_0x5241a1)[_0x3dab('0x3b')](_0x55b273);};}exports[_0x3dab('0x3c')]=function(_0x2ac840,_0x24d0fe){var _0x164013={'include':[{'model':db[_0x3dab('0x3d')],'as':_0x3dab('0x3e')}]},_0x160040={},_0x517c67={'count':0x0,'rows':[]};var _0x5bbf27=db[_0x3dab('0x3f')][_0x3dab('0x40')];_0x160040[_0x3dab('0x41')]=_[_0x3dab('0x42')](_0x5bbf27);_0x160040[_0x3dab('0x43')]=_['keys'](_0x2ac840[_0x3dab('0x43')]);_0x160040[_0x3dab('0x44')]=_['intersection'](_0x160040[_0x3dab('0x41')],_0x160040[_0x3dab('0x43')]);_0x164013[_0x3dab('0x45')]=_['intersection'](_0x160040[_0x3dab('0x41')],qs[_0x3dab('0x46')](_0x2ac840[_0x3dab('0x43')][_0x3dab('0x46')]));_0x164013['attributes']=_0x164013[_0x3dab('0x45')][_0x3dab('0x47')]?_0x164013[_0x3dab('0x45')]:_0x160040[_0x3dab('0x41')];if(!_0x2ac840[_0x3dab('0x43')][_0x3dab('0x48')](_0x3dab('0x49'))){_0x164013[_0x3dab('0x4a')]=qs['limit'](_0x2ac840['query'][_0x3dab('0x4a')]);_0x164013[_0x3dab('0x2f')]=qs[_0x3dab('0x2f')](_0x2ac840[_0x3dab('0x43')][_0x3dab('0x2f')]);}_0x164013['order']=qs[_0x3dab('0x4b')](_0x2ac840['query'][_0x3dab('0x4b')]);_0x164013[_0x3dab('0x4c')]=qs[_0x3dab('0x44')](_[_0x3dab('0x4d')](_0x2ac840['query'],_0x160040['filters']));if(_0x2ac840[_0x3dab('0x43')]['filter']){_0x164013[_0x3dab('0x4c')]=_[_0x3dab('0x4e')](_0x164013[_0x3dab('0x4c')],{'$or':_[_0x3dab('0x4f')](_0x5bbf27,function(_0x97d746){if(_0x97d746[_0x3dab('0x50')][_0x3dab('0x51')]!==_0x3dab('0x52')){var _0x32b02c={};_0x32b02c[_0x97d746[_0x3dab('0x53')]]={'$like':'%'+_0x2ac840['query']['filter']+'%'};return _0x32b02c;}})});}_0x164013=_[_0x3dab('0x4e')]({},_0x164013,_0x2ac840[_0x3dab('0x54')]);var _0x199b9d={'where':_0x164013[_0x3dab('0x4c')]};return db[_0x3dab('0x3f')][_0x3dab('0x2e')](_0x199b9d)['then'](function(_0x3f4981){_0x517c67[_0x3dab('0x2e')]=_0x3f4981;if(_0x2ac840[_0x3dab('0x43')][_0x3dab('0x55')]){_0x164013[_0x3dab('0x56')]=[{'all':!![]}];}return db[_0x3dab('0x3f')][_0x3dab('0x57')](_0x164013);})[_0x3dab('0x35')](function(_0x4d6a4b){_0x517c67[_0x3dab('0x58')]=_0x4d6a4b;return _0x517c67;})['then'](respondWithFilteredResult(_0x24d0fe,_0x164013))[_0x3dab('0x2a')](handleError(_0x24d0fe,null));};exports[_0x3dab('0x59')]=function(_0x42fcce,_0x1c394e){var _0x543177={'raw':![],'where':{'id':_0x42fcce[_0x3dab('0x5a')]['id']},'include':[{'model':db['Pause'],'as':_0x3dab('0x3e')}]},_0x576aa9={};_0x576aa9['model']=_[_0x3dab('0x42')](db[_0x3dab('0x3f')]['rawAttributes']);_0x576aa9[_0x3dab('0x43')]=_[_0x3dab('0x42')](_0x42fcce['query']);_0x576aa9[_0x3dab('0x44')]=_[_0x3dab('0x5b')](_0x576aa9[_0x3dab('0x41')],_0x576aa9['query']);_0x543177['attributes']=_[_0x3dab('0x5b')](_0x576aa9[_0x3dab('0x41')],qs[_0x3dab('0x46')](_0x42fcce[_0x3dab('0x43')][_0x3dab('0x46')]));_0x543177[_0x3dab('0x45')]=_0x543177[_0x3dab('0x45')]['length']?_0x543177[_0x3dab('0x45')]:_0x576aa9['model'];if(_0x42fcce[_0x3dab('0x43')][_0x3dab('0x55')]){_0x543177[_0x3dab('0x56')]=[{'all':!![]}];}_0x543177=_['merge']({},_0x543177,_0x42fcce[_0x3dab('0x54')]);return db['FaxAccount'][_0x3dab('0x5c')](_0x543177)['then'](handleEntityNotFound(_0x1c394e,null))[_0x3dab('0x35')](respondWithResult(_0x1c394e,null))['catch'](handleError(_0x1c394e,null));};exports[_0x3dab('0x5d')]=function(_0x3b3ad0,_0x61c8d9){return db[_0x3dab('0x3f')][_0x3dab('0x5d')](_0x3b3ad0[_0x3dab('0x5e')],{})['then'](function(_0x15758d){var _0x58b73c=_0x3b3ad0['user'][_0x3dab('0x5f')]({'plain':!![]});if(!_0x58b73c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x58b73c[_0x3dab('0x60')]===_0x3dab('0x61')){var _0x134ca9=_0x15758d[_0x3dab('0x5f')]({'plain':!![]});var _0x1ceba8=_0x3dab('0x37');return db['UserProfileSection'][_0x3dab('0x5c')]({'where':{'name':_0x1ceba8,'userProfileId':_0x58b73c[_0x3dab('0x62')]},'raw':!![]})[_0x3dab('0x35')](function(_0x454754){if(_0x454754&&_0x454754[_0x3dab('0x63')]===0x0){return db['UserProfileResource'][_0x3dab('0x5d')]({'name':_0x134ca9['name'],'resourceId':_0x134ca9['id'],'type':_0x454754[_0x3dab('0x3a')],'sectionId':_0x454754['id']},{})[_0x3dab('0x35')](function(){return _0x15758d;});}else{return _0x15758d;}})[_0x3dab('0x2a')](function(_0x14c12c){logger[_0x3dab('0x27')](_0x3dab('0x64'),_0x14c12c);throw _0x14c12c;});}return _0x15758d;})[_0x3dab('0x35')](respondWithResult(_0x61c8d9,0xc9))[_0x3dab('0x2a')](handleError(_0x61c8d9,null));};exports[_0x3dab('0x65')]=function(_0x4724c1,_0x18554c){if(_0x4724c1[_0x3dab('0x5e')]['id']){delete _0x4724c1[_0x3dab('0x5e')]['id'];}return db['FaxAccount']['find']({'where':{'id':_0x4724c1[_0x3dab('0x5a')]['id']},'include':[{'model':db[_0x3dab('0x3d')],'as':_0x3dab('0x3e')}]})['then'](handleEntityNotFound(_0x18554c,null))['then'](saveUpdates(_0x4724c1[_0x3dab('0x5e')],null))['then'](respondWithResult(_0x18554c,null))[_0x3dab('0x2a')](handleError(_0x18554c,null));};exports[_0x3dab('0x36')]=function(_0x569ecc,_0x545712){return db['FaxAccount'][_0x3dab('0x5c')]({'where':{'id':_0x569ecc['params']['id']}})[_0x3dab('0x35')](handleEntityNotFound(_0x545712,null))['then'](removeEntity(_0x545712,null))[_0x3dab('0x2a')](handleError(_0x545712,null));};exports[_0x3dab('0x66')]=function(_0x2a61b6,_0x373001){return db['FaxAccount'][_0x3dab('0x66')]()[_0x3dab('0x35')](respondWithResult(_0x373001,null))[_0x3dab('0x2a')](handleError(_0x373001,null));};exports[_0x3dab('0x67')]=function(_0x2ce959,_0x38dc0f,_0x5ca76f){if(_0x2ce959[_0x3dab('0x5e')]['id']){delete _0x2ce959[_0x3dab('0x5e')]['id'];}return db[_0x3dab('0x3f')][_0x3dab('0x5c')]({'where':{'id':_0x2ce959[_0x3dab('0x5a')]['id']}})[_0x3dab('0x35')](handleEntityNotFound(_0x38dc0f,null))[_0x3dab('0x35')](function(_0x39f4b5){if(_0x39f4b5){_0x2ce959[_0x3dab('0x5e')]['FaxAccountId']=_0x39f4b5['id'];return db[_0x3dab('0x68')][_0x3dab('0x5d')](_0x2ce959[_0x3dab('0x5e')]);}})[_0x3dab('0x35')](respondWithResult(_0x38dc0f,null))[_0x3dab('0x2a')](handleError(_0x38dc0f,null));};exports[_0x3dab('0x69')]=function(_0x524d7f,_0x5555b8,_0x400992){var _0x80d8d2={'raw':![],'where':{}};var _0x389cb6={};var _0x568aad={'count':0x0,'rows':[]};return db[_0x3dab('0x3f')][_0x3dab('0x6a')]({'where':{'id':_0x524d7f[_0x3dab('0x5a')]['id']}})[_0x3dab('0x35')](handleEntityNotFound(_0x5555b8,null))[_0x3dab('0x35')](function(_0x4e527c){if(_0x4e527c){_0x389cb6[_0x3dab('0x41')]=_[_0x3dab('0x42')](db['Disposition'][_0x3dab('0x40')]);_0x389cb6[_0x3dab('0x43')]=_['keys'](_0x524d7f[_0x3dab('0x43')]);_0x389cb6[_0x3dab('0x44')]=_['intersection'](_0x389cb6[_0x3dab('0x41')],_0x389cb6[_0x3dab('0x43')]);_0x80d8d2[_0x3dab('0x45')]=_[_0x3dab('0x5b')](_0x389cb6[_0x3dab('0x41')],qs[_0x3dab('0x46')](_0x524d7f[_0x3dab('0x43')][_0x3dab('0x46')]));_0x80d8d2['attributes']=_0x80d8d2[_0x3dab('0x45')][_0x3dab('0x47')]?_0x80d8d2[_0x3dab('0x45')]:_0x389cb6[_0x3dab('0x41')];if(!_0x524d7f[_0x3dab('0x43')]['hasOwnProperty'](_0x3dab('0x49'))){_0x80d8d2[_0x3dab('0x4a')]=qs[_0x3dab('0x4a')](_0x524d7f[_0x3dab('0x43')]['limit']);_0x80d8d2[_0x3dab('0x2f')]=qs[_0x3dab('0x2f')](_0x524d7f[_0x3dab('0x43')][_0x3dab('0x2f')]);}_0x80d8d2[_0x3dab('0x6b')]=qs[_0x3dab('0x4b')](_0x524d7f['query'][_0x3dab('0x4b')]);_0x80d8d2[_0x3dab('0x4c')]=qs[_0x3dab('0x44')](_[_0x3dab('0x4d')](_0x524d7f[_0x3dab('0x43')],_0x389cb6[_0x3dab('0x44')]));_0x80d8d2[_0x3dab('0x4c')][_0x3dab('0x6c')]=_0x4e527c['id'];if(_0x524d7f[_0x3dab('0x43')][_0x3dab('0x6d')]){_0x80d8d2[_0x3dab('0x4c')]=_[_0x3dab('0x4e')](_0x80d8d2[_0x3dab('0x4c')],{'$or':_[_0x3dab('0x4f')](_0x80d8d2[_0x3dab('0x45')],function(_0x2247de){var _0x1c0ff5={};_0x1c0ff5[_0x2247de]={'$like':'%'+_0x524d7f[_0x3dab('0x43')][_0x3dab('0x6d')]+'%'};return _0x1c0ff5;})});}_0x80d8d2=_[_0x3dab('0x4e')]({},_0x80d8d2,_0x524d7f[_0x3dab('0x54')]);return db['Disposition'][_0x3dab('0x2e')]({'where':_0x80d8d2['where']})[_0x3dab('0x35')](function(_0x1dc348){_0x568aad[_0x3dab('0x2e')]=_0x1dc348;if(_0x524d7f[_0x3dab('0x43')]['includeAll']){_0x80d8d2[_0x3dab('0x56')]=[{'all':!![]}];}return db['Disposition'][_0x3dab('0x57')](_0x80d8d2);})[_0x3dab('0x35')](function(_0x3be585){_0x568aad[_0x3dab('0x58')]=_0x3be585;return _0x568aad;});}})['then'](respondWithFilteredResult(_0x5555b8,_0x80d8d2))['catch'](handleError(_0x5555b8,null));};exports[_0x3dab('0x6e')]=function(_0x2867e0,_0x3fd86c,_0x688eea){return db[_0x3dab('0x3f')][_0x3dab('0x5c')]({'where':{'id':_0x2867e0[_0x3dab('0x5a')]['id']}})['then'](handleEntityNotFound(_0x3fd86c,null))[_0x3dab('0x35')](function(_0x95efbb){if(_0x95efbb){return _0x95efbb['removeDispositions'](_0x2867e0[_0x3dab('0x43')]['ids']);}})[_0x3dab('0x35')](respondWithStatusCode(_0x3fd86c,null))['catch'](handleError(_0x3fd86c,null));};exports[_0x3dab('0x6f')]=function(_0x1714c4,_0x3cc84d,_0x51fea0){if(_0x1714c4[_0x3dab('0x5e')]['id']){delete _0x1714c4[_0x3dab('0x5e')]['id'];}return db['FaxAccount'][_0x3dab('0x5c')]({'where':{'id':_0x1714c4['params']['id']}})[_0x3dab('0x35')](handleEntityNotFound(_0x3cc84d,null))[_0x3dab('0x35')](function(_0x506b7f){if(_0x506b7f){_0x1714c4[_0x3dab('0x5e')]['FaxAccountId']=_0x506b7f['id'];return db[_0x3dab('0x70')][_0x3dab('0x5d')](_0x1714c4[_0x3dab('0x5e')]);}})[_0x3dab('0x35')](respondWithResult(_0x3cc84d,null))[_0x3dab('0x2a')](handleError(_0x3cc84d,null));};exports['getAnswers']=function(_0x664665,_0x1410c1,_0x4937f8){var _0x677d82={'raw':![],'where':{}};var _0x133b08={};var _0x348c93={'count':0x0,'rows':[]};return db[_0x3dab('0x3f')]['findOne']({'where':{'id':_0x664665['params']['id']}})[_0x3dab('0x35')](handleEntityNotFound(_0x1410c1,null))[_0x3dab('0x35')](function(_0x4dc5a3){if(_0x4dc5a3){_0x133b08['model']=_[_0x3dab('0x42')](db[_0x3dab('0x70')][_0x3dab('0x40')]);_0x133b08[_0x3dab('0x43')]=_[_0x3dab('0x42')](_0x664665['query']);_0x133b08[_0x3dab('0x44')]=_['intersection'](_0x133b08['model'],_0x133b08[_0x3dab('0x43')]);_0x677d82[_0x3dab('0x45')]=_[_0x3dab('0x5b')](_0x133b08['model'],qs[_0x3dab('0x46')](_0x664665['query'][_0x3dab('0x46')]));_0x677d82[_0x3dab('0x45')]=_0x677d82[_0x3dab('0x45')][_0x3dab('0x47')]?_0x677d82[_0x3dab('0x45')]:_0x133b08[_0x3dab('0x41')];if(!_0x664665[_0x3dab('0x43')][_0x3dab('0x48')]('nolimit')){_0x677d82[_0x3dab('0x4a')]=qs['limit'](_0x664665[_0x3dab('0x43')][_0x3dab('0x4a')]);_0x677d82[_0x3dab('0x2f')]=qs[_0x3dab('0x2f')](_0x664665[_0x3dab('0x43')][_0x3dab('0x2f')]);}_0x677d82[_0x3dab('0x6b')]=qs[_0x3dab('0x4b')](_0x664665['query']['sort']);_0x677d82[_0x3dab('0x4c')]=qs[_0x3dab('0x44')](_[_0x3dab('0x4d')](_0x664665[_0x3dab('0x43')],_0x133b08[_0x3dab('0x44')]));_0x677d82[_0x3dab('0x4c')][_0x3dab('0x6c')]=_0x4dc5a3['id'];if(_0x664665[_0x3dab('0x43')][_0x3dab('0x6d')]){_0x677d82[_0x3dab('0x4c')]=_[_0x3dab('0x4e')](_0x677d82[_0x3dab('0x4c')],{'$or':_[_0x3dab('0x4f')](_0x677d82[_0x3dab('0x45')],function(_0xb4a0f0){var _0x244eb7={};_0x244eb7[_0xb4a0f0]={'$like':'%'+_0x664665[_0x3dab('0x43')]['filter']+'%'};return _0x244eb7;})});}_0x677d82=_[_0x3dab('0x4e')]({},_0x677d82,_0x664665[_0x3dab('0x54')]);return db[_0x3dab('0x70')][_0x3dab('0x2e')]({'where':_0x677d82[_0x3dab('0x4c')]})['then'](function(_0x4e5e63){_0x348c93[_0x3dab('0x2e')]=_0x4e5e63;if(_0x664665['query']['includeAll']){_0x677d82[_0x3dab('0x56')]=[{'all':!![]}];}return db['CannedAnswer'][_0x3dab('0x57')](_0x677d82);})[_0x3dab('0x35')](function(_0x1ed179){_0x348c93[_0x3dab('0x58')]=_0x1ed179;return _0x348c93;});}})[_0x3dab('0x35')](respondWithFilteredResult(_0x1410c1,_0x677d82))[_0x3dab('0x2a')](handleError(_0x1410c1,null));};exports[_0x3dab('0x71')]=function(_0x2ce572,_0x50fd8f,_0x42aa23){return db[_0x3dab('0x3f')][_0x3dab('0x5c')]({'where':{'id':_0x2ce572[_0x3dab('0x5a')]['id']}})[_0x3dab('0x35')](handleEntityNotFound(_0x50fd8f,null))[_0x3dab('0x35')](function(_0x2ff7d8){if(_0x2ff7d8){return _0x2ff7d8[_0x3dab('0x71')](_0x2ce572[_0x3dab('0x43')]['ids']);}})[_0x3dab('0x35')](respondWithStatusCode(_0x50fd8f,null))['catch'](handleError(_0x50fd8f,null));};exports['addInteraction']=function(_0x5c370c,_0xd9f4e0,_0x2ebf0c){return db[_0x3dab('0x72')][_0x3dab('0x5c')]({'where':{'id':_0x5c370c[_0x3dab('0x5a')]['id']}})['then'](handleEntityNotFound(_0xd9f4e0,null))[_0x3dab('0x35')](function(_0x483ed6){if(_0x483ed6){return _0x483ed6[_0x3dab('0x73')](_0x5c370c['body'][_0x3dab('0x74')],_[_0x3dab('0x75')](_0x5c370c[_0x3dab('0x5e')],['ids','id'])||{});}})['then'](respondWithResult(_0xd9f4e0,null))[_0x3dab('0x2a')](handleError(_0xd9f4e0,null));};exports[_0x3dab('0x76')]=function(_0xcefb64,_0x29e84a,_0x37c354){var _0x3a8077={'raw':![],'where':{}};var _0x737d01={};var _0x14254d={'count':0x0,'rows':[]};return db[_0x3dab('0x3f')][_0x3dab('0x6a')]({'where':{'id':_0xcefb64['params']['id']}})[_0x3dab('0x35')](handleEntityNotFound(_0x29e84a,null))[_0x3dab('0x35')](function(_0x42723e){if(_0x42723e){_0x737d01[_0x3dab('0x41')]=_[_0x3dab('0x42')](db[_0x3dab('0x72')][_0x3dab('0x40')]);_0x737d01[_0x3dab('0x43')]=_[_0x3dab('0x42')](_0xcefb64[_0x3dab('0x43')]);_0x737d01['filters']=_[_0x3dab('0x5b')](_0x737d01[_0x3dab('0x41')],_0x737d01[_0x3dab('0x43')]);_0x3a8077[_0x3dab('0x45')]=_[_0x3dab('0x5b')](_0x737d01[_0x3dab('0x41')],qs[_0x3dab('0x46')](_0xcefb64['query'][_0x3dab('0x46')]));_0x3a8077['attributes']=_0x3a8077[_0x3dab('0x45')]['length']?_0x3a8077['attributes']:_0x737d01[_0x3dab('0x41')];if(!_0xcefb64[_0x3dab('0x43')]['hasOwnProperty']('nolimit')){_0x3a8077[_0x3dab('0x4a')]=qs[_0x3dab('0x4a')](_0xcefb64[_0x3dab('0x43')][_0x3dab('0x4a')]);_0x3a8077[_0x3dab('0x2f')]=qs[_0x3dab('0x2f')](_0xcefb64[_0x3dab('0x43')]['offset']);}_0x3a8077[_0x3dab('0x6b')]=qs[_0x3dab('0x4b')](_0xcefb64[_0x3dab('0x43')][_0x3dab('0x4b')]);_0x3a8077[_0x3dab('0x4c')]=qs['filters'](_[_0x3dab('0x4d')](_0xcefb64['query'],_0x737d01[_0x3dab('0x44')]));_0x3a8077['where']['FaxAccountId']=_0x42723e['id'];if(_0xcefb64[_0x3dab('0x43')]['filter']){_0x3a8077[_0x3dab('0x4c')]=_['merge'](_0x3a8077[_0x3dab('0x4c')],{'$or':_[_0x3dab('0x4f')](_0x3a8077[_0x3dab('0x45')],function(_0x507ff9){var _0x2b2dfa={};_0x2b2dfa[_0x507ff9]={'$like':'%'+_0xcefb64[_0x3dab('0x43')][_0x3dab('0x6d')]+'%'};return _0x2b2dfa;})});}_0x3a8077=_[_0x3dab('0x4e')]({},_0x3a8077,_0xcefb64['options']);return db['FaxInteraction'][_0x3dab('0x2e')]({'where':_0x3a8077[_0x3dab('0x4c')]})[_0x3dab('0x35')](function(_0x5310a1){_0x14254d[_0x3dab('0x2e')]=_0x5310a1;if(_0xcefb64[_0x3dab('0x43')][_0x3dab('0x55')]){_0x3a8077[_0x3dab('0x56')]=[{'model':db[_0x3dab('0x77')],'as':'Contact','required':![]},{'model':db['User'],'as':'Owner','attributes':[_0x3dab('0x3a'),_0x3dab('0x78'),_0x3dab('0x79')],'required':![]},{'model':db[_0x3dab('0x7a')],'as':_0x3dab('0x7b'),'attributes':['id',_0x3dab('0x3a'),_0x3dab('0x7c')],'where':_0xcefb64[_0x3dab('0x43')][_0x3dab('0x7d')]?{'id':_0xcefb64['query'][_0x3dab('0x7d')]}:undefined,'required':_0xcefb64[_0x3dab('0x43')][_0x3dab('0x7d')]?!![]:![]}];}return db['FaxInteraction'][_0x3dab('0x57')](_0x3a8077);})[_0x3dab('0x35')](function(_0x4eb8b5){_0x14254d['rows']=_0x4eb8b5;return _0x14254d;});}})[_0x3dab('0x35')](respondWithFilteredResult(_0x29e84a,_0x3a8077))[_0x3dab('0x2a')](handleError(_0x29e84a,null));};exports['addApplications']=function(_0x32aead,_0x5e3dbe,_0x3b72ac){return db[_0x3dab('0x3f')][_0x3dab('0x6a')]({'where':{'id':_0x32aead['params']['id']}})[_0x3dab('0x35')](handleEntityNotFound(_0x5e3dbe,null))[_0x3dab('0x35')](function(_0xc5d2b4){if(_0xc5d2b4){return db[_0x3dab('0x7e')][_0x3dab('0x7f')](function(_0x3ce99e){return db[_0x3dab('0x80')][_0x3dab('0x36')]({'where':{'FaxAccountId':_0x32aead[_0x3dab('0x5a')]['id']},'transaction':_0x3ce99e})[_0x3dab('0x35')](function(_0x1d11bb){var _0x45c204=_['map'](_0x32aead[_0x3dab('0x5e')],function(_0xa439f){_0xa439f[_0x3dab('0x6c')]=_0x32aead[_0x3dab('0x5a')]['id'];return _0xa439f;});return db[_0x3dab('0x80')][_0x3dab('0x81')](_0x45c204,{'transaction':_0x3ce99e});});})[_0x3dab('0x35')](function(){return db[_0x3dab('0x80')][_0x3dab('0x82')]({'where':{'FaxAccountId':_0x32aead[_0x3dab('0x5a')]['id']},'order':_0x3dab('0x83')});});}})[_0x3dab('0x35')](respondWithResult(_0x5e3dbe,null))[_0x3dab('0x2a')](handleError(_0x5e3dbe,null));};exports[_0x3dab('0x84')]=function(_0x2aca03,_0x3ce987,_0x19d26f){var _0x52ed57={};var _0x52e405={};var _0x2d16fb;var _0x381e27;return db['FaxAccount']['findOne']({'where':{'id':_0x2aca03[_0x3dab('0x5a')]['id']}})['then'](handleEntityNotFound(_0x3ce987,null))[_0x3dab('0x35')](function(_0x355ae9){if(_0x355ae9){_0x2d16fb=_0x355ae9;_0x52e405['model']=_[_0x3dab('0x42')](db[_0x3dab('0x80')]['rawAttributes']);_0x52e405[_0x3dab('0x43')]=_[_0x3dab('0x42')](_0x2aca03[_0x3dab('0x43')]);_0x52e405[_0x3dab('0x44')]=_[_0x3dab('0x5b')](_0x52e405['model'],_0x52e405[_0x3dab('0x43')]);_0x52ed57[_0x3dab('0x45')]=_[_0x3dab('0x5b')](_0x52e405[_0x3dab('0x41')],qs[_0x3dab('0x46')](_0x2aca03[_0x3dab('0x43')]['fields']));_0x52ed57[_0x3dab('0x45')]=_0x52ed57[_0x3dab('0x45')][_0x3dab('0x47')]?_0x52ed57[_0x3dab('0x45')]:_0x52e405['model'];_0x52ed57[_0x3dab('0x6b')]=qs[_0x3dab('0x4b')](_0x2aca03[_0x3dab('0x43')]['sort']);_0x52ed57[_0x3dab('0x4c')]=qs['filters'](_[_0x3dab('0x4d')](_0x2aca03[_0x3dab('0x43')],_0x52e405[_0x3dab('0x44')]));if(_0x2aca03[_0x3dab('0x43')][_0x3dab('0x6d')]){_0x52ed57[_0x3dab('0x4c')]=_[_0x3dab('0x4e')](_0x52ed57['where'],{'$or':_[_0x3dab('0x4f')](_0x52ed57[_0x3dab('0x45')],function(_0x330383){var _0x123a3a={};_0x123a3a[_0x330383]={'$like':'%'+_0x2aca03[_0x3dab('0x43')][_0x3dab('0x6d')]+'%'};return _0x123a3a;})});}_0x52ed57=_[_0x3dab('0x4e')]({},_0x52ed57,_0x2aca03[_0x3dab('0x54')]);return _0x2d16fb[_0x3dab('0x84')](_0x52ed57);}})[_0x3dab('0x35')](function(_0x13d238){if(_0x13d238){_0x381e27=_0x13d238[_0x3dab('0x47')];if(!_0x2aca03[_0x3dab('0x43')][_0x3dab('0x48')](_0x3dab('0x49'))){_0x52ed57['limit']=qs['limit'](_0x2aca03['query']['limit']);_0x52ed57[_0x3dab('0x2f')]=qs[_0x3dab('0x2f')](_0x2aca03[_0x3dab('0x43')][_0x3dab('0x2f')]);}return _0x2d16fb[_0x3dab('0x84')](_0x52ed57);}})[_0x3dab('0x35')](function(_0x3920b1){if(_0x3920b1){return _0x3920b1?{'count':_0x381e27,'rows':_0x3920b1}:null;}})[_0x3dab('0x35')](respondWithResult(_0x3ce987,null))[_0x3dab('0x2a')](handleError(_0x3ce987,null));};function Extension(_0x56faaf,_0x8d0275,_0x4a4645,_0x2d1c35){this['context']=_0x3dab('0x85');this[_0x3dab('0x86')]=_0x56faaf[_0x3dab('0x87')];this[_0x3dab('0x88')]=_0x2d1c35;this[_0x3dab('0x50')]=_0x3dab('0x89');this[_0x3dab('0x8a')]=_0x3dab('0x8b');this[_0x3dab('0x6c')]=_0x56faaf['id'];this[_0x3dab('0x83')]=_0x8d0275;this[_0x3dab('0x8c')]=_0x4a4645;}function createExtensionsReciveFax(_0x28caf5){var _0x490c4b=0x1;var _0x4cb507=[];_0x4cb507['push'](new Extension(_0x28caf5,_0x490c4b,'',_0x3dab('0x8d')));_0x490c4b+=0x1;_0x4cb507[_0x3dab('0x8e')](new Extension(_0x28caf5,_0x490c4b,_0x3dab('0x8f'),_0x3dab('0x90')));_0x490c4b+=0x1;for(var _0x12c723 in _0x28caf5){if(_0x28caf5[_0x3dab('0x48')](_0x12c723)&&(_0x12c723===_0x3dab('0x91')||_0x12c723==='localstationid'||_0x12c723===_0x3dab('0x92')||_0x12c723===_0x3dab('0x93')||_0x12c723===_0x3dab('0x94')||_0x12c723==='maxrate'||_0x12c723===_0x3dab('0x95')||_0x12c723===_0x3dab('0x96')||_0x12c723==='t38timeout')){_0x4cb507[_0x3dab('0x8e')](new Extension(_0x28caf5,_0x490c4b,_0x3dab('0x97')+_0x12c723+')='+_0x28caf5[_0x12c723],_0x3dab('0x90')));_0x490c4b+=0x1;}}_0x4cb507[_0x3dab('0x8e')](new Extension(_0x28caf5,_0x490c4b,'6',_0x3dab('0x98')));_0x490c4b+=0x1;_0x4cb507['push'](new Extension(_0x28caf5,_0x490c4b,'/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',_0x3dab('0x99')));_0x490c4b=0x0;return _0x4cb507;}exports[_0x3dab('0x9a')]=function(_0x23d191,_0x2afa49,_0x1c3999){var _0x325071;return db[_0x3dab('0x7e')][_0x3dab('0x7f')](function(_0x3ab156){return db['FaxAccount'][_0x3dab('0x5d')](_0x23d191[_0x3dab('0x5e')],{'transaction':_0x3ab156})['then'](function(_0xed7966){_0x325071=_0xed7966[_0x3dab('0x5f')]({'plain':!![]});return db[_0x3dab('0x9b')]['bulkCreate'](createExtensionsReciveFax(_0x325071),{'transaction':_0x3ab156});});})[_0x3dab('0x35')](function(){return _0x325071;})[_0x3dab('0x35')](respondWithResult(_0x2afa49,null))[_0x3dab('0x2a')](handleError(_0x2afa49,null));};exports[_0x3dab('0x9c')]=function(_0x12f6c4,_0x341692,_0x3bad13){var _0x4930a6;return db[_0x3dab('0x7e')][_0x3dab('0x7f')](function(_0x1fa7a7){return db[_0x3dab('0x3f')][_0x3dab('0x65')](_0x12f6c4[_0x3dab('0x5e')],{'where':{'id':_0x12f6c4[_0x3dab('0x5e')]['id']},'transaction':_0x1fa7a7})[_0x3dab('0x35')](function(_0x595dae){return db[_0x3dab('0x9b')][_0x3dab('0x36')]({'where':{'FaxAccountId':_0x12f6c4[_0x3dab('0x5e')]['id']},'transaction':_0x1fa7a7})[_0x3dab('0x35')](function(_0xa1df8){return db[_0x3dab('0x9b')][_0x3dab('0x81')](createExtensionsReciveFax(_[_0x3dab('0x75')](_0x12f6c4[_0x3dab('0x5e')],[_0x3dab('0x9d'),_0x3dab('0x51'),'createdAt','updatedAt',_0x3dab('0x9e'),_0x3dab('0x9f')])),{'transaction':_0x1fa7a7});});});})['then'](function(){return db['FaxAccount'][_0x3dab('0xa0')](_0x12f6c4[_0x3dab('0x5e')]['id']);})[_0x3dab('0x35')](respondWithResult(_0x341692,null))[_0x3dab('0x2a')](handleError(_0x341692,null));};exports['getMessages']=function(_0x8b33f8,_0x57c504,_0x4a2a0c){var _0x3da511={'raw':!![],'where':{}};var _0x551f20={};var _0x3d19b8={'count':0x0,'rows':[]};return db[_0x3dab('0x3f')][_0x3dab('0x6a')]({'where':{'id':_0x8b33f8['params']['id']}})[_0x3dab('0x35')](handleEntityNotFound(_0x57c504,null))[_0x3dab('0x35')](function(_0x1a6123){if(_0x1a6123){_0x551f20['model']=_[_0x3dab('0x42')](db[_0x3dab('0xa1')][_0x3dab('0x40')]);_0x551f20['query']=_[_0x3dab('0x42')](_0x8b33f8[_0x3dab('0x43')]);_0x551f20[_0x3dab('0x44')]=_[_0x3dab('0x5b')](_0x551f20[_0x3dab('0x41')],_0x551f20[_0x3dab('0x43')]);_0x3da511[_0x3dab('0x45')]=_[_0x3dab('0x5b')](_0x551f20[_0x3dab('0x41')],qs[_0x3dab('0x46')](_0x8b33f8['query'][_0x3dab('0x46')]));_0x3da511['attributes']=_0x3da511[_0x3dab('0x45')]['length']?_0x3da511['attributes']:_0x551f20[_0x3dab('0x41')];if(!_0x8b33f8['query'][_0x3dab('0x48')](_0x3dab('0x49'))){_0x3da511[_0x3dab('0x4a')]=qs[_0x3dab('0x4a')](_0x8b33f8[_0x3dab('0x43')][_0x3dab('0x4a')]);_0x3da511[_0x3dab('0x2f')]=qs['offset'](_0x8b33f8[_0x3dab('0x43')][_0x3dab('0x2f')]);}_0x3da511[_0x3dab('0x6b')]=qs['sort'](_0x8b33f8['query'][_0x3dab('0x4b')]);_0x3da511['where']=qs[_0x3dab('0x44')](_['pick'](_0x8b33f8[_0x3dab('0x43')],_0x551f20[_0x3dab('0x44')]));_0x3da511['where']['FaxAccountId']=_0x1a6123['id'];if(_0x8b33f8['query']['filter']){_0x3da511['where']=_[_0x3dab('0x4e')](_0x3da511[_0x3dab('0x4c')],{'$or':_[_0x3dab('0x4f')](_0x3da511['attributes'],function(_0x5095ed){var _0x57040c={};_0x57040c[_0x5095ed]={'$like':'%'+_0x8b33f8[_0x3dab('0x43')]['filter']+'%'};return _0x57040c;})});}if(_0x8b33f8[_0x3dab('0x43')]['$gte']){var _0xaf3e21=_0x8b33f8[_0x3dab('0x43')]['$gte'][_0x3dab('0xa2')](',');var _0x4ccdf5={};_0x4ccdf5[_0xaf3e21[0x0]]={'$gte':moment(_0xaf3e21[0x1])['format'](_0x3dab('0xa3'))};_0x3da511[_0x3dab('0x4c')]=_[_0x3dab('0x4e')](_0x3da511[_0x3dab('0x4c')],_0x4ccdf5);}_0x3da511=_[_0x3dab('0x4e')]({},_0x3da511,_0x8b33f8[_0x3dab('0x54')]);return db['FaxMessage'][_0x3dab('0x2e')]({'where':_0x3da511['where']})[_0x3dab('0x35')](function(_0x3672b9){_0x3d19b8[_0x3dab('0x2e')]=_0x3672b9;if(_0x8b33f8[_0x3dab('0x43')]['includeAll']){_0x3da511['include']=[{'all':!![]}];}return db[_0x3dab('0xa1')][_0x3dab('0x57')](_0x3da511);})[_0x3dab('0x35')](function(_0x3bb651){_0x3d19b8['rows']=_0x3bb651;return _0x3d19b8;});}})[_0x3dab('0x35')](respondWithFilteredResult(_0x57c504,_0x3da511))[_0x3dab('0x2a')](handleError(_0x57c504,null));};exports[_0x3dab('0x3b')]=function(_0x140374,_0x4a6888,_0x31763a){var _0x14ffb3,_0x4c4a86={},_0x191637;if(_0x140374[_0x3dab('0x5e')]['to']){_0x191637=_0x140374[_0x3dab('0x5e')]['to'][0x0];}return db[_0x3dab('0x3f')][_0x3dab('0x5c')]({'where':{'id':_0x140374[_0x3dab('0x5a')]['id']},'include':[{'model':db[_0x3dab('0xa4')],'as':'List','include':[{'model':db['CmContact'],'as':_0x3dab('0xa5'),'where':{'fax':_0x191637},'limit':0x1,'order':[['updatedAt',_0x3dab('0xa6')]]}]}]})['then'](handleEntityNotFound(_0x4a6888,null))[_0x3dab('0x35')](function(_0x44a8a8){_0x14ffb3=_0x44a8a8;if(_0x140374[_0x3dab('0x5e')][_0x3dab('0xa7')]&&_0x140374[_0x3dab('0x5e')][_0x3dab('0xa7')][_0x3dab('0x47')]){for(var _0x565243=0x0;_0x565243<_0x140374[_0x3dab('0x5e')][_0x3dab('0xa7')][_0x3dab('0x47')];_0x565243+=0x1){_0x140374[_0x3dab('0x5e')]['attachments'][_0x565243]={'filename':_0x140374[_0x3dab('0x5e')][_0x3dab('0xa7')][_0x565243][_0x3dab('0x3a')],'id':_0x140374['body'][_0x3dab('0xa7')][_0x565243]['id'],'path':path[_0x3dab('0xa8')](config[_0x3dab('0xa9')],'server/files/attachments',_0x140374[_0x3dab('0x5e')][_0x3dab('0xa7')][_0x565243][_0x3dab('0xaa')])};}}return respondWithRpcPromise(_0x3dab('0xab'),'CheckAfterSend',{'FaxAccountId':_['isNil'](_0x140374[_0x3dab('0x5a')]['id'])?undefined:_0x140374[_0x3dab('0x5a')]['id'],'path':_['isNil'](_0x140374[_0x3dab('0x5e')]['attachments'][0x0][_0x3dab('0x7')])?undefined:_0x140374[_0x3dab('0x5e')]['attachments'][0x0]['path'],'fax':_[_0x3dab('0xac')](_0x140374[_0x3dab('0x5e')]['to'][0x0])?undefined:_0x140374[_0x3dab('0x5e')]['to'][0x0]},client9002);})['then'](function(){if(_0x14ffb3){if(_[_0x3dab('0xac')](_0x140374[_0x3dab('0x5e')]['from'])){_0x140374[_0x3dab('0x5e')][_0x3dab('0xad')]=util[_0x3dab('0xae')]('\x22%s\x22\x20<%s>',_0x14ffb3[_0x3dab('0x3a')],_0x14ffb3['fax']);}if(_0x14ffb3['List']){if(_0x14ffb3['List'][_0x3dab('0xa5')][_0x3dab('0x47')]){return _0x14ffb3[_0x3dab('0xaf')]['Contacts'][0x0];}else{return db[_0x3dab('0x77')][_0x3dab('0x5d')](_[_0x3dab('0x1a')](_0x140374[_0x3dab('0x5e')],{'firstName':_0x140374[_0x3dab('0x5e')]['to'][0x0],'phone':_0x140374[_0x3dab('0x5e')]['to'][0x0],'fax':_0x140374[_0x3dab('0x5e')]['to'][0x0],'ListId':_0x14ffb3[_0x3dab('0x9f')]}));}}else{throw new Error(_0x3dab('0xb0'));}}else{throw new Error(_0x3dab('0xb1'));}})[_0x3dab('0x35')](function(_0x37b2d9){if(_0x37b2d9){return db['FaxInteraction']['find']({'where':{'ContactId':_0x37b2d9['id'],'closed':![],'FaxAccountId':_0x14ffb3['id']}})[_0x3dab('0x35')](function(_0xbdd782){if(_0xbdd782){return[_0xbdd782,![]];}return db[_0x3dab('0x72')][_0x3dab('0x5d')]({'UserId':_0x140374['user']['id'],'ContactId':_0x37b2d9['id'],'FaxAccountId':_0x14ffb3['id'],'fax':_0x140374[_0x3dab('0x5e')]['to'][0x0],'firstMsgDirection':'out','Messages':[_[_0x3dab('0x4e')](_0x140374[_0x3dab('0x5e')],{'read':![],'body':_0x140374[_0x3dab('0x5e')]['attachments'][0x0][_0x3dab('0xb2')],'FaxAccountId':_0x14ffb3['id'],'UserId':_0x140374[_0x3dab('0x61')]['id'],'ContactId':_0x37b2d9['id'],'AttachmentId':_0x140374[_0x3dab('0x5e')][_0x3dab('0xa7')][0x0]['id']})]},{'include':[{'model':db['FaxMessage'],'as':_0x3dab('0xb3')}]})[_0x3dab('0x35')](function(_0x38ae6a){return[_0x38ae6a,!![]];});});}else{throw new Error(_0x3dab('0xb4'));}})[_0x3dab('0xb5')](function(_0x5e294e,_0x43cfd6){if(_0x43cfd6){return _0x5e294e;}return db[_0x3dab('0xa1')][_0x3dab('0x5d')]({'direction':'out','read':![],'body':_0x140374['body'][_0x3dab('0xa7')][0x0]['filename'],'FaxAccountId':_0x14ffb3['id'],'FaxInteractionId':_0x5e294e['id'],'UserId':_0x140374[_0x3dab('0x61')]['id'],'ContactId':_0x5e294e[_0x3dab('0xb6')],'AttachmentId':_0x140374['body']['attachments'][0x0]['id']})[_0x3dab('0x35')](function(_0x3efdeb){_0x5e294e[_0x3dab('0xb7')][_0x3dab('0xb3')]=[];_0x5e294e[_0x3dab('0xb7')]['Messages']['push'](_0x3efdeb[_0x3dab('0xb7')]);return _0x5e294e;});})[_0x3dab('0x35')](function(_0x2639b7){respondWithRpcPromise(_0x3dab('0xb8'),_0x3dab('0xb8'),{'FaxAccountId':_[_0x3dab('0xac')](_0x140374['params']['id'])?undefined:_0x140374[_0x3dab('0x5a')]['id'],'path':_[_0x3dab('0xac')](_0x140374[_0x3dab('0x5e')]['attachments'][0x0][_0x3dab('0x7')])?undefined:_0x140374['body']['attachments'][0x0][_0x3dab('0x7')],'fax':_['isNil'](_0x140374[_0x3dab('0x5e')]['to'][0x0])?undefined:_0x140374[_0x3dab('0x5e')]['to'][0x0],'AttachmentId':_0x140374[_0x3dab('0x5e')][_0x3dab('0xa7')][0x0]['id']},client9002)[_0x3dab('0x35')](function(_0x5b7d32){logger[_0x3dab('0x23')](_0x3dab('0xb9'),_0x5b7d32);})[_0x3dab('0x2a')](function(_0x594836){logger[_0x3dab('0x23')]('SendFaxRpc,\x20%s',_0x594836);});return _0x2639b7;})['then'](respondWithResult(_0x4a6888,null))[_0x3dab('0x2a')](handleError(_0x4a6888,null));};exports['addAgents']=function(_0x410bed,_0x348ae3,_0x2cc51d){return db[_0x3dab('0x3f')][_0x3dab('0x5c')]({'where':{'id':_0x410bed[_0x3dab('0x5a')]['id']}})[_0x3dab('0x35')](handleEntityNotFound(_0x348ae3,null))[_0x3dab('0x35')](function(_0x3e70a9){if(_0x3e70a9){return _0x3e70a9['addAgents'](_0x410bed[_0x3dab('0x5e')][_0x3dab('0x74')],_[_0x3dab('0x75')](_0x410bed[_0x3dab('0x5e')],[_0x3dab('0x74'),'id'])||{})[_0x3dab('0xb5')](function(_0x2e884e){for(var _0x1e4647=0x0;_0x1e4647<_0x410bed['body'][_0x3dab('0x74')]['length'];_0x1e4647+=0x1){socket['emit'](_0x3dab('0xba'),{'UserId':_0x410bed['body']['ids'][_0x1e4647],'FaxAccountId':_0x410bed[_0x3dab('0x5a')]['id']});}return _0x2e884e;});}})[_0x3dab('0x35')](respondWithResult(_0x348ae3,null))[_0x3dab('0x2a')](handleError(_0x348ae3,null));};exports[_0x3dab('0xbb')]=function(_0x5784a8,_0x312bab,_0x573b78){return db[_0x3dab('0x3f')][_0x3dab('0x5c')]({'where':{'id':_0x5784a8['params']['id']}})[_0x3dab('0x35')](handleEntityNotFound(_0x312bab,null))[_0x3dab('0x35')](function(_0x59855f){if(_0x59855f){return _0x59855f[_0x3dab('0xbb')](_0x5784a8['query'][_0x3dab('0x74')])['then'](function(){if(_['isArray'](_0x5784a8[_0x3dab('0x43')][_0x3dab('0x74')])){for(var _0x3c4fde=0x0;_0x3c4fde<_0x5784a8[_0x3dab('0x43')]['ids'][_0x3dab('0x47')];_0x3c4fde+=0x1){socket[_0x3dab('0xbc')](_0x3dab('0xbd'),{'UserId':Number(_0x5784a8[_0x3dab('0x43')]['ids'][_0x3c4fde]),'FaxAccountId':Number(_0x5784a8[_0x3dab('0x5a')]['id'])});}}else{socket[_0x3dab('0xbc')](_0x3dab('0xbd'),{'UserId':Number(_0x5784a8[_0x3dab('0x43')][_0x3dab('0x74')]),'FaxAccountId':Number(_0x5784a8[_0x3dab('0x5a')]['id'])});}});}})[_0x3dab('0x35')](respondWithStatusCode(_0x312bab,null))[_0x3dab('0x2a')](handleError(_0x312bab,null));};exports['getAgents']=function(_0x637dab,_0x56e427,_0x286a0f){var _0x4db515={};var _0x3bf548={};var _0xbe4123;var _0x2b25e3;return db[_0x3dab('0x3f')]['findOne']({'where':{'id':_0x637dab[_0x3dab('0x5a')]['id']}})[_0x3dab('0x35')](handleEntityNotFound(_0x56e427,null))[_0x3dab('0x35')](function(_0x48edc2){if(_0x48edc2){_0xbe4123=_0x48edc2;_0x3bf548[_0x3dab('0x41')]=_[_0x3dab('0x42')](db[_0x3dab('0xbe')][_0x3dab('0x40')]);_0x3bf548[_0x3dab('0x43')]=_[_0x3dab('0x42')](_0x637dab['query']);_0x3bf548[_0x3dab('0x44')]=_[_0x3dab('0x5b')](_0x3bf548['model'],_0x3bf548[_0x3dab('0x43')]);_0x4db515[_0x3dab('0x45')]=_['intersection'](_0x3bf548[_0x3dab('0x41')],qs[_0x3dab('0x46')](_0x637dab[_0x3dab('0x43')][_0x3dab('0x46')]));_0x4db515[_0x3dab('0x45')]=_0x4db515[_0x3dab('0x45')]['length']?_0x4db515[_0x3dab('0x45')]:_0x3bf548[_0x3dab('0x41')];_0x4db515[_0x3dab('0x6b')]=qs[_0x3dab('0x4b')](_0x637dab[_0x3dab('0x43')][_0x3dab('0x4b')]);_0x4db515[_0x3dab('0x4c')]=qs[_0x3dab('0x44')](_[_0x3dab('0x4d')](_0x637dab[_0x3dab('0x43')],_0x3bf548[_0x3dab('0x44')]));if(_0x637dab[_0x3dab('0x43')][_0x3dab('0x6d')]){_0x4db515[_0x3dab('0x4c')]=_['merge'](_0x4db515['where'],{'$or':_[_0x3dab('0x4f')](_0x4db515[_0x3dab('0x45')],function(_0x3c0aea){var _0x509b12={};_0x509b12[_0x3c0aea]={'$like':'%'+_0x637dab[_0x3dab('0x43')]['filter']+'%'};return _0x509b12;})});}_0x4db515=_[_0x3dab('0x4e')]({},_0x4db515,_0x637dab[_0x3dab('0x54')]);return _0xbe4123[_0x3dab('0xbf')](_0x4db515);}})[_0x3dab('0x35')](function(_0x54f1a9){if(_0x54f1a9){_0x2b25e3=_0x54f1a9[_0x3dab('0x47')];if(!_0x637dab[_0x3dab('0x43')]['hasOwnProperty'](_0x3dab('0x49'))){_0x4db515[_0x3dab('0x4a')]=qs[_0x3dab('0x4a')](_0x637dab[_0x3dab('0x43')][_0x3dab('0x4a')]);_0x4db515['offset']=qs[_0x3dab('0x2f')](_0x637dab[_0x3dab('0x43')][_0x3dab('0x2f')]);}return _0xbe4123['getAgents'](_0x4db515);}})[_0x3dab('0x35')](function(_0x5476a8){if(_0x5476a8){return _0x5476a8?{'count':_0x2b25e3,'rows':_0x5476a8}:null;}})[_0x3dab('0x35')](respondWithResult(_0x56e427,null))['catch'](handleError(_0x56e427,null));}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.events.js b/server/api/faxAccount/faxAccount.events.js index d3efdae..a2a370b 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 _0x2f1f=['save','update','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x57a2bb,_0x3e4f07){var _0x35fdcb=function(_0x11ef14){while(--_0x11ef14){_0x57a2bb['push'](_0x57a2bb['shift']());}};_0x35fdcb(++_0x3e4f07);}(_0x2f1f,0x17e));var _0xf2f1=function(_0x23fdc4,_0x16037b){_0x23fdc4=_0x23fdc4-0x0;var _0x281045=_0x2f1f[_0x23fdc4];return _0x281045;};'use strict';var EventEmitter=require(_0xf2f1('0x0'));var FaxAccount=require(_0xf2f1('0x1'))['db']['FaxAccount'];var FaxAccountEvents=new EventEmitter();FaxAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xf2f1('0x2'),'afterUpdate':_0xf2f1('0x3'),'afterDestroy':'remove'};function emitEvent(_0x58d055){return function(_0x16198e,_0x24758c,_0x3536a4){FaxAccountEvents[_0xf2f1('0x4')](_0x58d055+':'+_0x16198e['id'],_0x16198e);FaxAccountEvents[_0xf2f1('0x4')](_0x58d055,_0x16198e);_0x3536a4(null);};}for(var e in events){if(events[_0xf2f1('0x5')](e)){var event=events[e];FaxAccount[_0xf2f1('0x6')](e,emitEvent(event));}}module[_0xf2f1('0x7')]=FaxAccountEvents; \ No newline at end of file +var _0xe74d=['hasOwnProperty','hook','FaxAccount','save','update','remove','emit'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xe74d,0x1bb));var _0xde74=function(_0x5c3432,_0x46c2b2){_0x5c3432=_0x5c3432-0x0;var _0x2985cd=_0xe74d[_0x5c3432];return _0x2985cd;};'use strict';var EventEmitter=require('events');var FaxAccount=require('../../mysqldb')['db'][_0xde74('0x0')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xde74('0x1'),'afterUpdate':_0xde74('0x2'),'afterDestroy':_0xde74('0x3')};function emitEvent(_0x3a8ad9){return function(_0x2aab9b,_0x1e04b5,_0x2c20f3){FaxAccountEvents['emit'](_0x3a8ad9+':'+_0x2aab9b['id'],_0x2aab9b);FaxAccountEvents[_0xde74('0x4')](_0x3a8ad9,_0x2aab9b);_0x2c20f3(null);};}for(var e in events){if(events[_0xde74('0x5')](e)){var event=events[e];FaxAccount[_0xde74('0x6')](e,emitEvent(event));}}module['exports']=FaxAccountEvents; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.model.js b/server/api/faxAccount/faxAccount.model.js index 573f4af..e5007ad 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 _0x2bcb=['define','FaxAccount','util','api','moment','bluebird','path','rimraf','./faxAccount.attributes','exports'];(function(_0x340380,_0x4bd2a8){var _0x49ce1c=function(_0x4cb9e2){while(--_0x4cb9e2){_0x340380['push'](_0x340380['shift']());}};_0x49ce1c(++_0x4bd2a8);}(_0x2bcb,0x7a));var _0xb2bc=function(_0x236ce3,_0x210db6){_0x236ce3=_0x236ce3-0x0;var _0x2b9fc5=_0x2bcb[_0x236ce3];return _0x2b9fc5;};'use strict';var _=require('lodash');var util=require(_0xb2bc('0x0'));var logger=require('../../config/logger')(_0xb2bc('0x1'));var moment=require(_0xb2bc('0x2'));var BPromise=require(_0xb2bc('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb2bc('0x4'));var rimraf=require(_0xb2bc('0x5'));var config=require('../../config/environment');var attributes=require(_0xb2bc('0x6'));module[_0xb2bc('0x7')]=function(_0x2d3f19,_0x445c21){return _0x2d3f19[_0xb2bc('0x8')](_0xb2bc('0x9'),attributes,{'tableName':'fax_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xba7f=['../../config/logger','moment','path','rimraf','../../config/environment','exports','FaxAccount','lodash','util'];(function(_0x204309,_0x12d735){var _0xc1e688=function(_0x3873ec){while(--_0x3873ec){_0x204309['push'](_0x204309['shift']());}};_0xc1e688(++_0x12d735);}(_0xba7f,0x1ae));var _0xfba7=function(_0x8a0574,_0x910ef8){_0x8a0574=_0x8a0574-0x0;var _0x231b83=_0xba7f[_0x8a0574];return _0x231b83;};'use strict';var _=require(_0xfba7('0x0'));var util=require(_0xfba7('0x1'));var logger=require(_0xfba7('0x2'))('api');var moment=require(_0xfba7('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xfba7('0x4'));var rimraf=require(_0xfba7('0x5'));var config=require(_0xfba7('0x6'));var attributes=require('./faxAccount.attributes');module[_0xfba7('0x7')]=function(_0x305535,_0x13ddf0){return _0x305535['define'](_0xfba7('0x8'),attributes,{'tableName':'fax_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.rpc.js b/server/api/faxAccount/faxAccount.rpc.js index 9b2af32..fb3b4fe 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 _0x7aeb=['Contact\x20not\x20found','spread','autoclose','push','close','unmanaged','*,*,*,*','created','FaxMessage','ContactId','AttachmentId','interaction','UserId','User','name','agent','waitForTheAssignedAgent','Start','startRouting','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','./faxAccount.socket','register','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','GetFaxAccount','FaxAccount','options','raw','where','attributes','limit','include','model','map','NotifyFaxAccount','fax','CmContact','describe','Sequelize','ValidationError','no\x20available\x20attributes','difference','keys','createdAt','updatedAt','ListId','body','from','from\x20is\x20mandatory','isNil','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','find','account','CmList','List','Contacts','DESC','FaxApplication','get','applications','list','orderBy','priority','asc','Applications','length','defaults','create','contact','FaxInteraction'];(function(_0x22d990,_0x21962c){var _0x18de87=function(_0x55a0f3){while(--_0x55a0f3){_0x22d990['push'](_0x22d990['shift']());}};_0x18de87(++_0x21962c);}(_0x7aeb,0x18f));var _0xb7ae=function(_0x1da527,_0x2dc953){_0x1da527=_0x1da527-0x0;var _0x40fc7c=_0x7aeb[_0x1da527];return _0x40fc7c;};'use strict';var _=require('lodash');var util=require(_0xb7ae('0x0'));var moment=require(_0xb7ae('0x1'));var BPromise=require(_0xb7ae('0x2'));var rs=require(_0xb7ae('0x3'));var fs=require('fs');var Redis=require(_0xb7ae('0x4'));var db=require(_0xb7ae('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xb7ae('0x6'))(_0xb7ae('0x7'));var config=require(_0xb7ae('0x8'));var jayson=require(_0xb7ae('0x9'));var client=jayson[_0xb7ae('0xa')]['http']({'port':0x232c});config['redis']=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb7ae('0xb')]));require(_0xb7ae('0xc'))[_0xb7ae('0xd')](socket);function respondWithRpcPromise(_0x39728c,_0x1d6c89,_0x31779a){return new BPromise(function(_0x285c1f,_0x25103d){return client['request'](_0x39728c,_0x31779a)[_0xb7ae('0xe')](function(_0x51d10e){logger[_0xb7ae('0xf')](_0xb7ae('0x10'),_0x1d6c89,_0xb7ae('0x11'));logger[_0xb7ae('0x12')](_0xb7ae('0x13'),_0x1d6c89,_0xb7ae('0x11'),JSON[_0xb7ae('0x14')](_0x51d10e));if(_0x51d10e['error']){if(_0x51d10e['error'][_0xb7ae('0x15')]===0x1f4){logger[_0xb7ae('0x16')](_0xb7ae('0x10'),_0x1d6c89,_0x51d10e['error'][_0xb7ae('0x17')]);return _0x25103d(_0x51d10e[_0xb7ae('0x16')]['message']);}logger[_0xb7ae('0x16')](_0xb7ae('0x10'),_0x1d6c89,_0x51d10e[_0xb7ae('0x16')]['message']);return _0x285c1f(_0x51d10e[_0xb7ae('0x16')]['message']);}else{logger[_0xb7ae('0xf')](_0xb7ae('0x10'),_0x1d6c89,_0xb7ae('0x11'));_0x285c1f(_0x51d10e[_0xb7ae('0x18')][_0xb7ae('0x17')]);}})[_0xb7ae('0x19')](function(_0x103fcf){logger['error'](_0xb7ae('0x10'),_0x1d6c89,_0x103fcf);_0x25103d(_0x103fcf);});});}exports[_0xb7ae('0x1a')]=function(_0x710bfa){var _0x1f5c2c=this;return new Promise(function(_0x3f8800,_0x46b972){return db[_0xb7ae('0x1b')]['findAll']({'raw':_0x710bfa[_0xb7ae('0x1c')]?_0x710bfa[_0xb7ae('0x1c')][_0xb7ae('0x1d')]===undefined?!![]:![]:!![],'where':_0x710bfa[_0xb7ae('0x1c')]?_0x710bfa[_0xb7ae('0x1c')][_0xb7ae('0x1e')]||null:null,'attributes':_0x710bfa[_0xb7ae('0x1c')]?_0x710bfa[_0xb7ae('0x1c')][_0xb7ae('0x1f')]||null:null,'limit':_0x710bfa[_0xb7ae('0x1c')]?_0x710bfa[_0xb7ae('0x1c')][_0xb7ae('0x20')]||null:null,'include':_0x710bfa[_0xb7ae('0x1c')]?_0x710bfa['options']['include']?_['map'](_0x710bfa[_0xb7ae('0x1c')][_0xb7ae('0x21')],function(_0x3150a7){return{'model':db[_0x3150a7[_0xb7ae('0x22')]],'as':_0x3150a7['as'],'attributes':_0x3150a7['attributes'],'include':_0x3150a7[_0xb7ae('0x21')]?_[_0xb7ae('0x23')](_0x3150a7[_0xb7ae('0x21')],function(_0x265c59){return{'model':db[_0x265c59[_0xb7ae('0x22')]],'as':_0x265c59['as'],'attributes':_0x265c59[_0xb7ae('0x1f')],'include':_0x265c59[_0xb7ae('0x21')]?_['map'](_0x265c59[_0xb7ae('0x21')],function(_0x5b2bf6){return{'model':db[_0x5b2bf6['model']],'as':_0x5b2bf6['as'],'attributes':_0x5b2bf6[_0xb7ae('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xb7ae('0xe')](function(_0x5f5eb4){logger[_0xb7ae('0xf')](_0xb7ae('0x1a'),_0x710bfa);logger['debug'](_0xb7ae('0x1a'),_0x710bfa,JSON[_0xb7ae('0x14')](_0x5f5eb4));_0x3f8800(_0x5f5eb4);})[_0xb7ae('0x19')](function(_0x21aa9f){logger[_0xb7ae('0x16')](_0xb7ae('0x1a'),_0x21aa9f[_0xb7ae('0x17')],_0x710bfa);_0x46b972(_0x1f5c2c['error'](0x1f4,_0x21aa9f[_0xb7ae('0x17')]));});});};exports[_0xb7ae('0x24')]=function(_0x28e8a4,_0x2d7ae5,_0x255e5b){var _0x170277=this;return new Promise(function(_0x36e060,_0x322a7b){var _0x34ac21={'body':_0x28e8a4['body'],'channel':_0xb7ae('0x25')};var _0x4e5dff=[];var _0x12f94c=[];var _0x2dba69={};return db[_0xb7ae('0x26')][_0xb7ae('0x27')]()['then'](function(_0x107829){if(!_0x107829){throw new db[(_0xb7ae('0x28'))][(_0xb7ae('0x29'))](_0xb7ae('0x2a'));}_0x4e5dff=_[_0xb7ae('0x2b')](_[_0xb7ae('0x2c')](_0x107829),[_0xb7ae('0x2d'),'updatedAt']);_0x12f94c=_[_0xb7ae('0x2b')](_[_0xb7ae('0x2c')](_0x107829),[_0xb7ae('0x2d'),_0xb7ae('0x2e'),'CompanyId',_0xb7ae('0x2f')]);if(_0x28e8a4['body']['id']){delete _0x28e8a4[_0xb7ae('0x30')]['id'];}if(_['isNil'](_0x28e8a4['body'][_0xb7ae('0x31')])){throw new db[(_0xb7ae('0x28'))][(_0xb7ae('0x29'))](_0xb7ae('0x32'));}if(_[_0xb7ae('0x33')](_0x28e8a4[_0xb7ae('0x30')][_0xb7ae('0x30')])||_0x28e8a4[_0xb7ae('0x30')][_0xb7ae('0x30')]===''){throw new db[(_0xb7ae('0x28'))][(_0xb7ae('0x29'))](_0xb7ae('0x34'));}if(_['isNil'](_0x28e8a4[_0xb7ae('0x30')][_0xb7ae('0x35')])){throw new db[(_0xb7ae('0x28'))][(_0xb7ae('0x29'))](_0xb7ae('0x36')+_0x12f94c);}if(!_[_0xb7ae('0x37')](_0x12f94c,_0x28e8a4[_0xb7ae('0x30')]['mapKey'])){throw new db[(_0xb7ae('0x28'))][(_0xb7ae('0x29'))](_0xb7ae('0x38')+_0x12f94c);}_0x2dba69[_0x28e8a4[_0xb7ae('0x30')][_0xb7ae('0x35')]]=_0x28e8a4['body'][_0xb7ae('0x31')];})['then'](function(){return db['FaxAccount'][_0xb7ae('0x39')]({'where':{'id':_0x28e8a4[_0xb7ae('0x3a')]['id']},'include':[{'model':db[_0xb7ae('0x3b')],'as':_0xb7ae('0x3c'),'include':[{'model':db['CmContact'],'as':_0xb7ae('0x3d'),'where':_0x2dba69,'limit':0x1,'order':[[_0xb7ae('0x2e'),_0xb7ae('0x3e')]]}]},{'model':db[_0xb7ae('0x3f')],'as':'Applications'}]});})['then'](function(_0x139a5f){if(_0x139a5f&&_0x139a5f[_0xb7ae('0x3c')]){var _0x2e3f9d=_0x139a5f[_0xb7ae('0x40')]({'plain':!![]});_0x34ac21[_0xb7ae('0x3a')]=_0x2e3f9d;_0x34ac21[_0xb7ae('0x41')]=_0x2e3f9d['Applications'];_0x34ac21[_0xb7ae('0x42')]=_0x2e3f9d[_0xb7ae('0x3c')];_0x34ac21[_0xb7ae('0x41')]=_[_0xb7ae('0x43')](_0x34ac21[_0xb7ae('0x41')],[_0xb7ae('0x44')],[_0xb7ae('0x45')]);if(_0x34ac21['account'][_0xb7ae('0x46')]){delete _0x34ac21['account']['Applications'];}if(_0x34ac21['account']['List']&&_0x34ac21[_0xb7ae('0x3a')]['List']['Contacts'][_0xb7ae('0x47')]){return _0x34ac21['account'][_0xb7ae('0x3c')]['Contacts'][0x0];}var _0x63b68=_[_0xb7ae('0x48')](_0x28e8a4[_0xb7ae('0x30')],{'firstName':_0x28e8a4[_0xb7ae('0x30')][_0xb7ae('0x31')],'ListId':_0x2e3f9d[_0xb7ae('0x2f')]});_0x63b68[_0x28e8a4[_0xb7ae('0x30')][_0xb7ae('0x35')]]=_0x28e8a4[_0xb7ae('0x30')][_0xb7ae('0x31')];return db[_0xb7ae('0x26')][_0xb7ae('0x49')](_0x63b68,{'fields':_0x4e5dff,'raw':!![]});}})[_0xb7ae('0xe')](function(_0x26ad0c){_0x34ac21[_0xb7ae('0x4a')]=_0x26ad0c;if(_0x26ad0c){var _0x590107={'ContactId':_0x26ad0c['id'],'FaxAccountId':_0x28e8a4[_0xb7ae('0x3a')]['id'],'fax':_0x26ad0c[_0xb7ae('0x25')]};return db[_0xb7ae('0x4b')][_0xb7ae('0x39')]({'where':{'ContactId':_0x26ad0c['id'],'closed':![],'FaxAccountId':_0x28e8a4['account']['id']}})[_0xb7ae('0xe')](function(_0x4d66e6){if(_0x4d66e6){return[_0x4d66e6,![]];}return db[_0xb7ae('0x4b')][_0xb7ae('0x49')](_0x590107)[_0xb7ae('0xe')](function(_0x2c0f5c){return[_0x2c0f5c,!![]];});});}else{throw new Error(_0xb7ae('0x4c'));}})[_0xb7ae('0x4d')](function(_0x441c2d,_0x1f37c0){var _0x339561=_0x441c2d[_0xb7ae('0x40')]({'plain':!![]});if(_0x1f37c0){if(_0x34ac21[_0xb7ae('0x3a')][_0xb7ae('0x4e')]){_0x34ac21[_0xb7ae('0x41')][_0xb7ae('0x4f')]({'id':0x0,'priority':_0x34ac21[_0xb7ae('0x41')][_0xb7ae('0x47')]+0x1,'app':_0xb7ae('0x50'),'appdata':_0xb7ae('0x51'),'interval':_0xb7ae('0x52')});}_0x339561[_0xb7ae('0x53')]=!![];}else{_0x339561[_0xb7ae('0x53')]=![];}_0x34ac21['interaction']=_0x339561;return db[_0xb7ae('0x54')][_0xb7ae('0x49')]({'body':_0x28e8a4[_0xb7ae('0x30')][_0xb7ae('0x30')],'FaxAccountId':_0x28e8a4[_0xb7ae('0x3a')]['id'],'FaxInteractionId':_0x441c2d['id'],'direction':'in','ContactId':_0x441c2d[_0xb7ae('0x55')],'AttachmentId':_0x28e8a4['body'][_0xb7ae('0x56')]});})[_0xb7ae('0xe')](function(_0x24e862){_0x34ac21[_0xb7ae('0x17')]=_0x24e862;if(_0x34ac21[_0xb7ae('0x57')][_0xb7ae('0x58')]){return db[_0xb7ae('0x59')][_0xb7ae('0x39')]({'attributes':['id',_0xb7ae('0x5a')],'where':{'id':_0x34ac21['interaction']['UserId']}})[_0xb7ae('0xe')](function(_0x41748b){if(_0x41748b){_0x34ac21['applications']['unshift']({'id':0x0,'priority':0x0,'app':_0xb7ae('0x5b'),'appdata':_0x41748b[_0xb7ae('0x5a')]+','+(_0x34ac21[_0xb7ae('0x3a')][_0xb7ae('0x5c')]||0xa),'interval':_0xb7ae('0x52')});}return respondWithRpcPromise(_0xb7ae('0x5d'),_0xb7ae('0x5e'),_0x34ac21);});}return respondWithRpcPromise(_0xb7ae('0x5d'),_0xb7ae('0x5e'),_0x34ac21);})['then'](function(_0x2bec7c){_0x36e060(_0x2bec7c);})[_0xb7ae('0x19')](function(_0x4e09d4){_0x322a7b(_0x170277[_0xb7ae('0x16')](0x1f4,_0x4e09d4[_0xb7ae('0x17')]));});});}; \ No newline at end of file +var _0x76cb=['fax','FaxInteraction','Contact\x20not\x20found','autoclose','push','length','close','*,*,*,*','created','interaction','FaxMessage','ContactId','AttachmentId','User','name','UserId','unshift','agent','waitForTheAssignedAgent','startRouting','catch','lodash','util','moment','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./faxAccount.socket','request','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetFaxAccount','FaxAccount','findAll','options','where','attributes','limit','include','map','model','then','NotifyFaxAccount','body','Sequelize','no\x20available\x20attributes','difference','keys','createdAt','updatedAt','ListId','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','ValidationError','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','find','account','CmList','List','CmContact','Contacts','DESC','FaxApplication','Applications','get','applications','list','orderBy','priority','asc','create','contact'];(function(_0x423580,_0x428ba2){var _0x24f651=function(_0x22ab74){while(--_0x22ab74){_0x423580['push'](_0x423580['shift']());}};_0x24f651(++_0x428ba2);}(_0x76cb,0x129));var _0xb76c=function(_0x2adbeb,_0x5581be){_0x2adbeb=_0x2adbeb-0x0;var _0x5e18a6=_0x76cb[_0x2adbeb];return _0x5e18a6;};'use strict';var _=require(_0xb76c('0x0'));var util=require(_0xb76c('0x1'));var moment=require(_0xb76c('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb76c('0x3'))['db'];var utils=require(_0xb76c('0x4'));var logger=require(_0xb76c('0x5'))('rpc');var config=require(_0xb76c('0x6'));var jayson=require(_0xb76c('0x7'));var client=jayson['client'][_0xb76c('0x8')]({'port':0x232c});config[_0xb76c('0x9')]=_[_0xb76c('0xa')](config[_0xb76c('0x9')],{'host':_0xb76c('0xb'),'port':0x18eb});var socket=require(_0xb76c('0xc'))(new Redis(config[_0xb76c('0x9')]));require(_0xb76c('0xd'))['register'](socket);function respondWithRpcPromise(_0x198554,_0x741581,_0x773991){return new BPromise(function(_0x3fce99,_0x1d886a){return client[_0xb76c('0xe')](_0x198554,_0x773991)['then'](function(_0x426f9f){logger[_0xb76c('0xf')](_0xb76c('0x10'),_0x741581,_0xb76c('0x11'));logger[_0xb76c('0x12')](_0xb76c('0x13'),_0x741581,'request\x20sent',JSON[_0xb76c('0x14')](_0x426f9f));if(_0x426f9f[_0xb76c('0x15')]){if(_0x426f9f[_0xb76c('0x15')][_0xb76c('0x16')]===0x1f4){logger['error'](_0xb76c('0x10'),_0x741581,_0x426f9f[_0xb76c('0x15')][_0xb76c('0x17')]);return _0x1d886a(_0x426f9f[_0xb76c('0x15')][_0xb76c('0x17')]);}logger[_0xb76c('0x15')]('FaxAccount,\x20%s,\x20%s',_0x741581,_0x426f9f[_0xb76c('0x15')][_0xb76c('0x17')]);return _0x3fce99(_0x426f9f['error'][_0xb76c('0x17')]);}else{logger[_0xb76c('0xf')]('FaxAccount,\x20%s,\x20%s',_0x741581,_0xb76c('0x11'));_0x3fce99(_0x426f9f[_0xb76c('0x18')][_0xb76c('0x17')]);}})['catch'](function(_0x3536fe){logger[_0xb76c('0x15')](_0xb76c('0x10'),_0x741581,_0x3536fe);_0x1d886a(_0x3536fe);});});}exports[_0xb76c('0x19')]=function(_0x3bca4b){var _0x10a73e=this;return new Promise(function(_0x53ed94,_0x3128da){return db[_0xb76c('0x1a')][_0xb76c('0x1b')]({'raw':_0x3bca4b['options']?_0x3bca4b[_0xb76c('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x3bca4b[_0xb76c('0x1c')]?_0x3bca4b[_0xb76c('0x1c')][_0xb76c('0x1d')]||null:null,'attributes':_0x3bca4b['options']?_0x3bca4b[_0xb76c('0x1c')][_0xb76c('0x1e')]||null:null,'limit':_0x3bca4b[_0xb76c('0x1c')]?_0x3bca4b['options'][_0xb76c('0x1f')]||null:null,'include':_0x3bca4b[_0xb76c('0x1c')]?_0x3bca4b[_0xb76c('0x1c')][_0xb76c('0x20')]?_[_0xb76c('0x21')](_0x3bca4b[_0xb76c('0x1c')]['include'],function(_0xe47563){return{'model':db[_0xe47563[_0xb76c('0x22')]],'as':_0xe47563['as'],'attributes':_0xe47563['attributes'],'include':_0xe47563['include']?_[_0xb76c('0x21')](_0xe47563[_0xb76c('0x20')],function(_0x792f93){return{'model':db[_0x792f93[_0xb76c('0x22')]],'as':_0x792f93['as'],'attributes':_0x792f93['attributes'],'include':_0x792f93['include']?_[_0xb76c('0x21')](_0x792f93['include'],function(_0x56c495){return{'model':db[_0x56c495[_0xb76c('0x22')]],'as':_0x56c495['as'],'attributes':_0x56c495[_0xb76c('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xb76c('0x23')](function(_0x5e92af){logger['info'](_0xb76c('0x19'),_0x3bca4b);logger[_0xb76c('0x12')]('GetFaxAccount',_0x3bca4b,JSON[_0xb76c('0x14')](_0x5e92af));_0x53ed94(_0x5e92af);})['catch'](function(_0x281546){logger['error'](_0xb76c('0x19'),_0x281546['message'],_0x3bca4b);_0x3128da(_0x10a73e[_0xb76c('0x15')](0x1f4,_0x281546['message']));});});};exports[_0xb76c('0x24')]=function(_0x50824a,_0x31b83b,_0x22de0d){var _0x946139=this;return new Promise(function(_0xc98809,_0x1b6e35){var _0x1a04df={'body':_0x50824a[_0xb76c('0x25')],'channel':'fax'};var _0x242ac8=[];var _0x461127=[];var _0x4ffa34={};return db['CmContact']['describe']()[_0xb76c('0x23')](function(_0x246d47){if(!_0x246d47){throw new db[(_0xb76c('0x26'))]['ValidationError'](_0xb76c('0x27'));}_0x242ac8=_[_0xb76c('0x28')](_[_0xb76c('0x29')](_0x246d47),[_0xb76c('0x2a'),_0xb76c('0x2b')]);_0x461127=_[_0xb76c('0x28')](_[_0xb76c('0x29')](_0x246d47),[_0xb76c('0x2a'),_0xb76c('0x2b'),'CompanyId',_0xb76c('0x2c')]);if(_0x50824a[_0xb76c('0x25')]['id']){delete _0x50824a['body']['id'];}if(_[_0xb76c('0x2d')](_0x50824a[_0xb76c('0x25')]['from'])){throw new db[(_0xb76c('0x26'))]['ValidationError'](_0xb76c('0x2e'));}if(_['isNil'](_0x50824a[_0xb76c('0x25')][_0xb76c('0x25')])||_0x50824a[_0xb76c('0x25')][_0xb76c('0x25')]===''){throw new db[(_0xb76c('0x26'))]['ValidationError'](_0xb76c('0x2f'));}if(_['isNil'](_0x50824a[_0xb76c('0x25')]['mapKey'])){throw new db[(_0xb76c('0x26'))][(_0xb76c('0x30'))](_0xb76c('0x31')+_0x461127);}if(!_[_0xb76c('0x32')](_0x461127,_0x50824a[_0xb76c('0x25')][_0xb76c('0x33')])){throw new db['Sequelize'][(_0xb76c('0x30'))](_0xb76c('0x34')+_0x461127);}_0x4ffa34[_0x50824a[_0xb76c('0x25')]['mapKey']]=_0x50824a[_0xb76c('0x25')][_0xb76c('0x35')];})['then'](function(){return db[_0xb76c('0x1a')][_0xb76c('0x36')]({'where':{'id':_0x50824a[_0xb76c('0x37')]['id']},'include':[{'model':db[_0xb76c('0x38')],'as':_0xb76c('0x39'),'include':[{'model':db[_0xb76c('0x3a')],'as':_0xb76c('0x3b'),'where':_0x4ffa34,'limit':0x1,'order':[['updatedAt',_0xb76c('0x3c')]]}]},{'model':db[_0xb76c('0x3d')],'as':_0xb76c('0x3e')}]});})[_0xb76c('0x23')](function(_0x2bd820){if(_0x2bd820&&_0x2bd820[_0xb76c('0x39')]){var _0x2bf5e9=_0x2bd820[_0xb76c('0x3f')]({'plain':!![]});_0x1a04df[_0xb76c('0x37')]=_0x2bf5e9;_0x1a04df[_0xb76c('0x40')]=_0x2bf5e9[_0xb76c('0x3e')];_0x1a04df[_0xb76c('0x41')]=_0x2bf5e9['List'];_0x1a04df[_0xb76c('0x40')]=_[_0xb76c('0x42')](_0x1a04df[_0xb76c('0x40')],[_0xb76c('0x43')],[_0xb76c('0x44')]);if(_0x1a04df[_0xb76c('0x37')][_0xb76c('0x3e')]){delete _0x1a04df[_0xb76c('0x37')][_0xb76c('0x3e')];}if(_0x1a04df[_0xb76c('0x37')][_0xb76c('0x39')]&&_0x1a04df[_0xb76c('0x37')]['List'][_0xb76c('0x3b')]['length']){return _0x1a04df[_0xb76c('0x37')][_0xb76c('0x39')][_0xb76c('0x3b')][0x0];}var _0x5e4a4a=_[_0xb76c('0xa')](_0x50824a[_0xb76c('0x25')],{'firstName':_0x50824a[_0xb76c('0x25')]['from'],'ListId':_0x2bf5e9['ListId']});_0x5e4a4a[_0x50824a['body'][_0xb76c('0x33')]]=_0x50824a['body'][_0xb76c('0x35')];return db['CmContact'][_0xb76c('0x45')](_0x5e4a4a,{'fields':_0x242ac8,'raw':!![]});}})['then'](function(_0x53ef1f){_0x1a04df[_0xb76c('0x46')]=_0x53ef1f;if(_0x53ef1f){var _0x271313={'ContactId':_0x53ef1f['id'],'FaxAccountId':_0x50824a[_0xb76c('0x37')]['id'],'fax':_0x53ef1f[_0xb76c('0x47')]};return db[_0xb76c('0x48')]['find']({'where':{'ContactId':_0x53ef1f['id'],'closed':![],'FaxAccountId':_0x50824a[_0xb76c('0x37')]['id']}})[_0xb76c('0x23')](function(_0x24aee8){if(_0x24aee8){return[_0x24aee8,![]];}return db['FaxInteraction'][_0xb76c('0x45')](_0x271313)[_0xb76c('0x23')](function(_0x5f5a4e){return[_0x5f5a4e,!![]];});});}else{throw new Error(_0xb76c('0x49'));}})['spread'](function(_0x57270e,_0x17fc52){var _0x51fdb2=_0x57270e['get']({'plain':!![]});if(_0x17fc52){if(_0x1a04df[_0xb76c('0x37')][_0xb76c('0x4a')]){_0x1a04df[_0xb76c('0x40')][_0xb76c('0x4b')]({'id':0x0,'priority':_0x1a04df[_0xb76c('0x40')][_0xb76c('0x4c')]+0x1,'app':_0xb76c('0x4d'),'appdata':'unmanaged','interval':_0xb76c('0x4e')});}_0x51fdb2[_0xb76c('0x4f')]=!![];}else{_0x51fdb2[_0xb76c('0x4f')]=![];}_0x1a04df[_0xb76c('0x50')]=_0x51fdb2;return db[_0xb76c('0x51')]['create']({'body':_0x50824a[_0xb76c('0x25')][_0xb76c('0x25')],'FaxAccountId':_0x50824a[_0xb76c('0x37')]['id'],'FaxInteractionId':_0x57270e['id'],'direction':'in','ContactId':_0x57270e[_0xb76c('0x52')],'AttachmentId':_0x50824a[_0xb76c('0x25')][_0xb76c('0x53')]});})['then'](function(_0x233c02){_0x1a04df[_0xb76c('0x17')]=_0x233c02;if(_0x1a04df[_0xb76c('0x50')]['UserId']){return db[_0xb76c('0x54')][_0xb76c('0x36')]({'attributes':['id',_0xb76c('0x55')],'where':{'id':_0x1a04df[_0xb76c('0x50')][_0xb76c('0x56')]}})['then'](function(_0x5d656c){if(_0x5d656c){_0x1a04df['applications'][_0xb76c('0x57')]({'id':0x0,'priority':0x0,'app':_0xb76c('0x58'),'appdata':_0x5d656c[_0xb76c('0x55')]+','+(_0x1a04df[_0xb76c('0x37')][_0xb76c('0x59')]||0xa),'interval':_0xb76c('0x4e')});}return respondWithRpcPromise('Start',_0xb76c('0x5a'),_0x1a04df);});}return respondWithRpcPromise('Start',_0xb76c('0x5a'),_0x1a04df);})[_0xb76c('0x23')](function(_0x582561){_0xc98809(_0x582561);})[_0xb76c('0x5b')](function(_0x4aa61e){_0x1b6e35(_0x946139['error'](0x1f4,_0x4aa61e['message']));});});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.socket.js b/server/api/faxAccount/faxAccount.socket.js index d2d4597..d832af3 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 _0x4975=['length','./faxAccount.events','remove','update','emit','removeListener','register'];(function(_0x58c07d,_0x5de4cb){var _0x2edd6d=function(_0x3d5438){while(--_0x3d5438){_0x58c07d['push'](_0x58c07d['shift']());}};_0x2edd6d(++_0x5de4cb);}(_0x4975,0x86));var _0x5497=function(_0x34909d,_0x3fe3f6){_0x34909d=_0x34909d-0x0;var _0x5183fd=_0x4975[_0x34909d];return _0x5183fd;};'use strict';var FaxAccountEvents=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(){FaxAccountEvents[_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('faxAccount:'+_0x674a2a,_0x539a27);FaxAccountEvents['on'](_0x674a2a,_0x368e8b);}}; \ No newline at end of file +var _0x32b6=['faxAccount:','./faxAccount.events','save','update','emit','removeListener','register','length'];(function(_0x376332,_0x4de82c){var _0x2e47cc=function(_0x1b972e){while(--_0x1b972e){_0x376332['push'](_0x376332['shift']());}};_0x2e47cc(++_0x4de82c);}(_0x32b6,0x1d1));var _0x632b=function(_0x456464,_0x5515b1){_0x456464=_0x456464-0x0;var _0x1d49cb=_0x32b6[_0x456464];return _0x1d49cb;};'use strict';var FaxAccountEvents=require(_0x632b('0x0'));var events=[_0x632b('0x1'),'remove',_0x632b('0x2')];function createListener(_0x1d100a,_0x51c210){return function(_0x5ad871){_0x51c210[_0x632b('0x3')](_0x1d100a,_0x5ad871);};}function removeListener(_0x3435e8,_0x3ba3a7){return function(){FaxAccountEvents[_0x632b('0x4')](_0x3435e8,_0x3ba3a7);};}exports[_0x632b('0x5')]=function(_0x122768){for(var _0x24ceab=0x0,_0x10458a=events[_0x632b('0x6')];_0x24ceab<_0x10458a;_0x24ceab++){var _0x43d6c7=events[_0x24ceab];var _0x5128f5=createListener(_0x632b('0x7')+_0x43d6c7,_0x122768);FaxAccountEvents['on'](_0x43d6c7,_0x5128f5);}}; \ No newline at end of file diff --git a/server/api/faxAccount/index.js b/server/api/faxAccount/index.js index 4c59bd9..0775c72 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 _0x5ff3=['create','addDisposition','addAnswer','addInteraction','/:id/applications','addApplications','/addaccountapplications','addAccountApplications','/updateaccountapplications','send','addAgents','put','/:id','destroy','delete','/:id/dispositions','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./faxAccount.controller','get','isAuthenticated','/describe','show','/:id/canned_answers','/:id/interactions','getInteractions','/:id/messages','getMessages','getAgents','post'];(function(_0x27170a,_0x21530c){var _0x50c81d=function(_0x52f487){while(--_0x52f487){_0x27170a['push'](_0x27170a['shift']());}};_0x50c81d(++_0x21530c);}(_0x5ff3,0xdc));var _0x35ff=function(_0x22bccc,_0x26ec1b){_0x22bccc=_0x22bccc-0x0;var _0x3b84fb=_0x5ff3[_0x22bccc];return _0x3b84fb;};'use strict';var multer=require(_0x35ff('0x0'));var util=require(_0x35ff('0x1'));var path=require(_0x35ff('0x2'));var timeout=require(_0x35ff('0x3'));var express=require(_0x35ff('0x4'));var router=express[_0x35ff('0x5')]();var auth=require(_0x35ff('0x6'));var interaction=require(_0x35ff('0x7'));var config=require('../../config/environment');var controller=require(_0x35ff('0x8'));router[_0x35ff('0x9')]('/',auth[_0x35ff('0xa')](),controller['index']);router[_0x35ff('0x9')](_0x35ff('0xb'),auth[_0x35ff('0xa')](),controller['describe']);router[_0x35ff('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x35ff('0xc')]);router[_0x35ff('0x9')]('/:id/dispositions',auth[_0x35ff('0xa')](),controller['getDispositions']);router[_0x35ff('0x9')](_0x35ff('0xd'),auth['isAuthenticated'](),controller['getAnswers']);router[_0x35ff('0x9')](_0x35ff('0xe'),auth[_0x35ff('0xa')](),controller[_0x35ff('0xf')]);router[_0x35ff('0x9')]('/:id/applications',auth[_0x35ff('0xa')](),controller['getApplications']);router[_0x35ff('0x9')](_0x35ff('0x10'),auth[_0x35ff('0xa')](),controller[_0x35ff('0x11')]);router['get']('/:id/users',auth['isAuthenticated'](),controller[_0x35ff('0x12')]);router[_0x35ff('0x13')]('/',auth[_0x35ff('0xa')](),controller[_0x35ff('0x14')]);router[_0x35ff('0x13')]('/:id/dispositions',auth[_0x35ff('0xa')](),controller[_0x35ff('0x15')]);router[_0x35ff('0x13')](_0x35ff('0xd'),auth[_0x35ff('0xa')](),controller[_0x35ff('0x16')]);router[_0x35ff('0x13')](_0x35ff('0xe'),auth['isAuthenticated'](),controller[_0x35ff('0x17')]);router['post'](_0x35ff('0x18'),auth[_0x35ff('0xa')](),controller[_0x35ff('0x19')]);router[_0x35ff('0x13')](_0x35ff('0x1a'),auth[_0x35ff('0xa')](),controller[_0x35ff('0x1b')]);router[_0x35ff('0x13')](_0x35ff('0x1c'),auth[_0x35ff('0xa')](),controller['updateAccountApplications']);router[_0x35ff('0x13')]('/:id/send',auth[_0x35ff('0xa')](),controller[_0x35ff('0x1d')]);router[_0x35ff('0x13')]('/:id/users',auth[_0x35ff('0xa')](),controller[_0x35ff('0x1e')]);router[_0x35ff('0x1f')]('/:id',auth[_0x35ff('0xa')](),controller['update']);router['delete'](_0x35ff('0x20'),auth[_0x35ff('0xa')](),controller[_0x35ff('0x21')]);router[_0x35ff('0x22')](_0x35ff('0x23'),auth['isAuthenticated'](),controller[_0x35ff('0x24')]);router[_0x35ff('0x22')](_0x35ff('0xd'),auth[_0x35ff('0xa')](),controller[_0x35ff('0x25')]);router[_0x35ff('0x22')]('/:id/users',auth['isAuthenticated'](),controller[_0x35ff('0x26')]);module[_0x35ff('0x27')]=router; \ No newline at end of file +var _0x90a8=['./faxAccount.controller','get','isAuthenticated','index','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','/:id/interactions','/:id/applications','getApplications','getMessages','/:id/users','post','create','addDisposition','addAnswer','addInteraction','addApplications','/addaccountapplications','updateAccountApplications','/:id/send','addAgents','put','update','delete','destroy','removeDispositions','removeAgents','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x90a8,0x17e));var _0x890a=function(_0xb54e0c,_0x3b821e){_0xb54e0c=_0xb54e0c-0x0;var _0x5c26ad=_0x90a8[_0xb54e0c];return _0x5c26ad;};'use strict';var multer=require(_0x890a('0x0'));var util=require(_0x890a('0x1'));var path=require(_0x890a('0x2'));var timeout=require(_0x890a('0x3'));var express=require(_0x890a('0x4'));var router=express['Router']();var auth=require(_0x890a('0x5'));var interaction=require(_0x890a('0x6'));var config=require(_0x890a('0x7'));var controller=require(_0x890a('0x8'));router[_0x890a('0x9')]('/',auth[_0x890a('0xa')](),controller[_0x890a('0xb')]);router[_0x890a('0x9')]('/describe',auth[_0x890a('0xa')](),controller['describe']);router[_0x890a('0x9')](_0x890a('0xc'),auth[_0x890a('0xa')](),controller[_0x890a('0xd')]);router[_0x890a('0x9')](_0x890a('0xe'),auth['isAuthenticated'](),controller[_0x890a('0xf')]);router['get'](_0x890a('0x10'),auth[_0x890a('0xa')](),controller['getAnswers']);router['get'](_0x890a('0x11'),auth[_0x890a('0xa')](),controller['getInteractions']);router[_0x890a('0x9')](_0x890a('0x12'),auth[_0x890a('0xa')](),controller[_0x890a('0x13')]);router[_0x890a('0x9')]('/:id/messages',auth['isAuthenticated'](),controller[_0x890a('0x14')]);router[_0x890a('0x9')](_0x890a('0x15'),auth['isAuthenticated'](),controller['getAgents']);router[_0x890a('0x16')]('/',auth['isAuthenticated'](),controller[_0x890a('0x17')]);router[_0x890a('0x16')](_0x890a('0xe'),auth[_0x890a('0xa')](),controller[_0x890a('0x18')]);router['post'](_0x890a('0x10'),auth[_0x890a('0xa')](),controller[_0x890a('0x19')]);router[_0x890a('0x16')](_0x890a('0x11'),auth['isAuthenticated'](),controller[_0x890a('0x1a')]);router[_0x890a('0x16')](_0x890a('0x12'),auth[_0x890a('0xa')](),controller[_0x890a('0x1b')]);router[_0x890a('0x16')](_0x890a('0x1c'),auth[_0x890a('0xa')](),controller['addAccountApplications']);router[_0x890a('0x16')]('/updateaccountapplications',auth['isAuthenticated'](),controller[_0x890a('0x1d')]);router['post'](_0x890a('0x1e'),auth[_0x890a('0xa')](),controller['send']);router[_0x890a('0x16')](_0x890a('0x15'),auth[_0x890a('0xa')](),controller[_0x890a('0x1f')]);router[_0x890a('0x20')]('/:id',auth[_0x890a('0xa')](),controller[_0x890a('0x21')]);router[_0x890a('0x22')](_0x890a('0xc'),auth[_0x890a('0xa')](),controller[_0x890a('0x23')]);router['delete'](_0x890a('0xe'),auth['isAuthenticated'](),controller[_0x890a('0x24')]);router[_0x890a('0x22')]('/:id/canned_answers',auth[_0x890a('0xa')](),controller['removeAnswers']);router[_0x890a('0x22')]('/:id/users',auth[_0x890a('0xa')](),controller[_0x890a('0x25')]);module[_0x890a('0x26')]=router; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.attributes.js b/server/api/faxApplication/faxApplication.attributes.js index 0db6ad0..da5e33e 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 _0xdce5=['STRING','TEXT','*,*,*,*','exports'];(function(_0x149755,_0x5176b3){var _0x469799=function(_0x211522){while(--_0x211522){_0x149755['push'](_0x149755['shift']());}};_0x469799(++_0x5176b3);}(_0xdce5,0xc7));var _0x5dce=function(_0xf4c96d,_0x12490f){_0xf4c96d=_0xf4c96d-0x0;var _0x5e1ba7=_0xdce5[_0xf4c96d];return _0x5e1ba7;};'use strict';var Sequelize=require('sequelize');module[_0x5dce('0x0')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x5dce('0x1')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x5dce('0x2')]()},'description':{'type':Sequelize[_0x5dce('0x1')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x5dce('0x3')}}; \ No newline at end of file +var _0x1a21=['STRING','noop','TEXT','*,*,*,*','sequelize','exports','INTEGER'];(function(_0x397ddb,_0x5ea989){var _0x5eb1c5=function(_0x4032c6){while(--_0x4032c6){_0x397ddb['push'](_0x397ddb['shift']());}};_0x5eb1c5(++_0x5ea989);}(_0x1a21,0x1d9));var _0x11a2=function(_0x71b765,_0x3053f8){_0x71b765=_0x71b765-0x0;var _0x34cb24=_0x1a21[_0x71b765];return _0x34cb24;};'use strict';var Sequelize=require(_0x11a2('0x0'));module[_0x11a2('0x1')]={'priority':{'type':Sequelize[_0x11a2('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x11a2('0x3')],'allowNull':![],'defaultValue':_0x11a2('0x4')},'appdata':{'type':Sequelize[_0x11a2('0x5')]()},'description':{'type':Sequelize[_0x11a2('0x3')]},'interval':{'type':Sequelize[_0x11a2('0x3')],'defaultValue':_0x11a2('0x6')}}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.controller.js b/server/api/faxApplication/faxApplication.controller.js index 61f9fb0..87fe032 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 _0x7a54=['ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','set','Content-Range','apply','reject','save','then','destroy','sendStatus','error','name','send','FaxApplication','rawAttributes','model','keys','query','intersection','attributes','fields','nolimit','limit','order','sort','where','pick','map','type','key','VIRTUAL','field','merge','options','count','includeAll','include','catch','show','params','filters','length','find','create','body','update','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','squel','crypto','desk.js'];(function(_0xa8369a,_0x3d2319){var _0x4b74b7=function(_0x11d138){while(--_0x11d138){_0xa8369a['push'](_0xa8369a['shift']());}};_0x4b74b7(++_0x3d2319);}(_0x7a54,0x106));var _0x47a5=function(_0x21ab3b,_0x263743){_0x21ab3b=_0x21ab3b-0x0;var _0x517747=_0x7a54[_0x21ab3b];return _0x517747;};'use strict';var pdf=require(_0x47a5('0x0'));var emlformat=require(_0x47a5('0x1'));var rimraf=require(_0x47a5('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x47a5('0x3'));var rp=require(_0x47a5('0x4'));var moment=require('moment');var BPromise=require(_0x47a5('0x5'));var Mustache=require(_0x47a5('0x6'));var util=require(_0x47a5('0x7'));var path=require(_0x47a5('0x8'));var sox=require(_0x47a5('0x9'));var csv=require('to-csv');var ejs=require(_0x47a5('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var db=require(_0x47a5('0x14'))['db'];function respondWithStatusCode(_0xd612dd,_0xd308b8){_0xd308b8=_0xd308b8||0xcc;return function(_0x1eae59){if(_0x1eae59){return _0xd612dd['sendStatus'](_0xd308b8);}return _0xd612dd[_0x47a5('0x15')](_0xd308b8)[_0x47a5('0x16')]();};}function respondWithResult(_0x1cf309,_0x711793){_0x711793=_0x711793||0xc8;return function(_0x139f25){if(_0x139f25){return _0x1cf309[_0x47a5('0x15')](_0x711793)[_0x47a5('0x17')](_0x139f25);}};}function respondWithFilteredResult(_0x190faa,_0x4e99a8){return function(_0x362359){if(_0x362359){var _0x11faf5=_0x362359['count'],_0x3b001e=_0x4e99a8['offset'],_0x2a2cbb=_0x4e99a8[_0x47a5('0x18')]+_0x4e99a8['limit'],_0x1ef44c;if(_0x2a2cbb>=_0x11faf5){_0x2a2cbb=_0x11faf5;_0x1ef44c=0xc8;}else{_0x1ef44c=0xce;}_0x190faa['status'](_0x1ef44c);return _0x190faa[_0x47a5('0x19')](_0x47a5('0x1a'),_0x3b001e+'-'+_0x2a2cbb+'/'+_0x11faf5)[_0x47a5('0x17')](_0x362359);}return null;};}function patchUpdates(_0x1ef371){return function(_0x477b1d){try{jsonpatch[_0x47a5('0x1b')](_0x477b1d,_0x1ef371,!![]);}catch(_0x2763d6){return BPromise[_0x47a5('0x1c')](_0x2763d6);}return _0x477b1d[_0x47a5('0x1d')]();};}function saveUpdates(_0x4a9fcb,_0x1570bc){return function(_0xf160ba){if(_0xf160ba){return _0xf160ba['update'](_0x4a9fcb)[_0x47a5('0x1e')](function(_0x1f03f7){return _0x1f03f7;});}return null;};}function removeEntity(_0x36874d,_0x4c5910){return function(_0xb8ae6c){if(_0xb8ae6c){return _0xb8ae6c[_0x47a5('0x1f')]()[_0x47a5('0x1e')](function(){_0x36874d[_0x47a5('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0xe2dea9,_0x385687){return function(_0x513981){if(!_0x513981){_0xe2dea9[_0x47a5('0x20')](0x194);}return _0x513981;};}function handleError(_0xc4cd63,_0x4437f1){_0x4437f1=_0x4437f1||0x1f4;return function(_0x129ce5){logger[_0x47a5('0x21')](_0x129ce5['stack']);if(_0x129ce5['name']){delete _0x129ce5[_0x47a5('0x22')];}_0xc4cd63['status'](_0x4437f1)[_0x47a5('0x23')](_0x129ce5);};}exports['index']=function(_0x23cb77,_0x378208){var _0x36ad34={},_0x1dac65={},_0x21f296={'count':0x0,'rows':[]};var _0x3ba0b7=db[_0x47a5('0x24')][_0x47a5('0x25')];_0x1dac65[_0x47a5('0x26')]=_[_0x47a5('0x27')](_0x3ba0b7);_0x1dac65[_0x47a5('0x28')]=_[_0x47a5('0x27')](_0x23cb77[_0x47a5('0x28')]);_0x1dac65['filters']=_[_0x47a5('0x29')](_0x1dac65['model'],_0x1dac65[_0x47a5('0x28')]);_0x36ad34[_0x47a5('0x2a')]=_[_0x47a5('0x29')](_0x1dac65['model'],qs[_0x47a5('0x2b')](_0x23cb77[_0x47a5('0x28')][_0x47a5('0x2b')]));_0x36ad34[_0x47a5('0x2a')]=_0x36ad34['attributes']['length']?_0x36ad34[_0x47a5('0x2a')]:_0x1dac65[_0x47a5('0x26')];if(!_0x23cb77['query']['hasOwnProperty'](_0x47a5('0x2c'))){_0x36ad34[_0x47a5('0x2d')]=qs['limit'](_0x23cb77[_0x47a5('0x28')]['limit']);_0x36ad34[_0x47a5('0x18')]=qs[_0x47a5('0x18')](_0x23cb77['query']['offset']);}_0x36ad34[_0x47a5('0x2e')]=qs['sort'](_0x23cb77[_0x47a5('0x28')][_0x47a5('0x2f')]);_0x36ad34[_0x47a5('0x30')]=qs['filters'](_[_0x47a5('0x31')](_0x23cb77['query'],_0x1dac65['filters']));if(_0x23cb77[_0x47a5('0x28')]['filter']){_0x36ad34[_0x47a5('0x30')]=_['merge'](_0x36ad34[_0x47a5('0x30')],{'$or':_[_0x47a5('0x32')](_0x3ba0b7,function(_0x38c8d4){if(_0x38c8d4[_0x47a5('0x33')][_0x47a5('0x34')]!==_0x47a5('0x35')){var _0xee582c={};_0xee582c[_0x38c8d4[_0x47a5('0x36')]]={'$like':'%'+_0x23cb77[_0x47a5('0x28')]['filter']+'%'};return _0xee582c;}})});}_0x36ad34=_[_0x47a5('0x37')]({},_0x36ad34,_0x23cb77[_0x47a5('0x38')]);var _0x511c06={'where':_0x36ad34[_0x47a5('0x30')]};return db[_0x47a5('0x24')][_0x47a5('0x39')](_0x511c06)['then'](function(_0x101f70){_0x21f296[_0x47a5('0x39')]=_0x101f70;if(_0x23cb77['query'][_0x47a5('0x3a')]){_0x36ad34[_0x47a5('0x3b')]=[{'all':!![]}];}return db['FaxApplication']['findAll'](_0x36ad34);})['then'](function(_0x12d9f2){_0x21f296['rows']=_0x12d9f2;return _0x21f296;})[_0x47a5('0x1e')](respondWithFilteredResult(_0x378208,_0x36ad34))[_0x47a5('0x3c')](handleError(_0x378208,null));};exports[_0x47a5('0x3d')]=function(_0x111f0d,_0x1b2c80){var _0xcb5243={'raw':!![],'where':{'id':_0x111f0d[_0x47a5('0x3e')]['id']}},_0x2003b0={};_0x2003b0[_0x47a5('0x26')]=_[_0x47a5('0x27')](db[_0x47a5('0x24')][_0x47a5('0x25')]);_0x2003b0[_0x47a5('0x28')]=_['keys'](_0x111f0d[_0x47a5('0x28')]);_0x2003b0[_0x47a5('0x3f')]=_[_0x47a5('0x29')](_0x2003b0[_0x47a5('0x26')],_0x2003b0['query']);_0xcb5243[_0x47a5('0x2a')]=_['intersection'](_0x2003b0['model'],qs['fields'](_0x111f0d['query'][_0x47a5('0x2b')]));_0xcb5243['attributes']=_0xcb5243[_0x47a5('0x2a')][_0x47a5('0x40')]?_0xcb5243[_0x47a5('0x2a')]:_0x2003b0['model'];if(_0x111f0d[_0x47a5('0x28')][_0x47a5('0x3a')]){_0xcb5243['include']=[{'all':!![]}];}_0xcb5243=_['merge']({},_0xcb5243,_0x111f0d[_0x47a5('0x38')]);return db['FaxApplication'][_0x47a5('0x41')](_0xcb5243)[_0x47a5('0x1e')](handleEntityNotFound(_0x1b2c80,null))[_0x47a5('0x1e')](respondWithResult(_0x1b2c80,null))[_0x47a5('0x3c')](handleError(_0x1b2c80,null));};exports[_0x47a5('0x42')]=function(_0xf0edbb,_0x434227){return db[_0x47a5('0x24')][_0x47a5('0x42')](_0xf0edbb[_0x47a5('0x43')],{})[_0x47a5('0x1e')](respondWithResult(_0x434227,0xc9))[_0x47a5('0x3c')](handleError(_0x434227,null));};exports[_0x47a5('0x44')]=function(_0x3574d4,_0x4e5e7){if(_0x3574d4[_0x47a5('0x43')]['id']){delete _0x3574d4['body']['id'];}return db[_0x47a5('0x24')][_0x47a5('0x41')]({'where':{'id':_0x3574d4['params']['id']}})['then'](handleEntityNotFound(_0x4e5e7,null))[_0x47a5('0x1e')](saveUpdates(_0x3574d4['body'],null))[_0x47a5('0x1e')](respondWithResult(_0x4e5e7,null))[_0x47a5('0x3c')](handleError(_0x4e5e7,null));};exports['destroy']=function(_0x4f62d3,_0x3d85cc){return db['FaxApplication'][_0x47a5('0x41')]({'where':{'id':_0x4f62d3[_0x47a5('0x3e')]['id']}})[_0x47a5('0x1e')](handleEntityNotFound(_0x3d85cc,null))[_0x47a5('0x1e')](removeEntity(_0x3d85cc,null))[_0x47a5('0x3c')](handleError(_0x3d85cc,null));}; \ No newline at end of file +var _0x7a54=['ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','set','Content-Range','apply','reject','save','then','destroy','sendStatus','error','name','send','FaxApplication','rawAttributes','model','keys','query','intersection','attributes','fields','nolimit','limit','order','sort','where','pick','map','type','key','VIRTUAL','field','merge','options','count','includeAll','include','catch','show','params','filters','length','find','create','body','update','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','squel','crypto','desk.js'];(function(_0x193ddf,_0x6f30bb){var _0x5bc6df=function(_0x70fd9e){while(--_0x70fd9e){_0x193ddf['push'](_0x193ddf['shift']());}};_0x5bc6df(++_0x6f30bb);}(_0x7a54,0x106));var _0x47a5=function(_0x2aea2f,_0x3056d5){_0x2aea2f=_0x2aea2f-0x0;var _0x48102a=_0x7a54[_0x2aea2f];return _0x48102a;};'use strict';var pdf=require(_0x47a5('0x0'));var emlformat=require(_0x47a5('0x1'));var rimraf=require(_0x47a5('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x47a5('0x3'));var rp=require(_0x47a5('0x4'));var moment=require('moment');var BPromise=require(_0x47a5('0x5'));var Mustache=require(_0x47a5('0x6'));var util=require(_0x47a5('0x7'));var path=require(_0x47a5('0x8'));var sox=require(_0x47a5('0x9'));var csv=require('to-csv');var ejs=require(_0x47a5('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var db=require(_0x47a5('0x14'))['db'];function respondWithStatusCode(_0xd612dd,_0xd308b8){_0xd308b8=_0xd308b8||0xcc;return function(_0x1eae59){if(_0x1eae59){return _0xd612dd['sendStatus'](_0xd308b8);}return _0xd612dd[_0x47a5('0x15')](_0xd308b8)[_0x47a5('0x16')]();};}function respondWithResult(_0x1cf309,_0x711793){_0x711793=_0x711793||0xc8;return function(_0x139f25){if(_0x139f25){return _0x1cf309[_0x47a5('0x15')](_0x711793)[_0x47a5('0x17')](_0x139f25);}};}function respondWithFilteredResult(_0x190faa,_0x4e99a8){return function(_0x362359){if(_0x362359){var _0x11faf5=_0x362359['count'],_0x3b001e=_0x4e99a8['offset'],_0x2a2cbb=_0x4e99a8[_0x47a5('0x18')]+_0x4e99a8['limit'],_0x1ef44c;if(_0x2a2cbb>=_0x11faf5){_0x2a2cbb=_0x11faf5;_0x1ef44c=0xc8;}else{_0x1ef44c=0xce;}_0x190faa['status'](_0x1ef44c);return _0x190faa[_0x47a5('0x19')](_0x47a5('0x1a'),_0x3b001e+'-'+_0x2a2cbb+'/'+_0x11faf5)[_0x47a5('0x17')](_0x362359);}return null;};}function patchUpdates(_0x1ef371){return function(_0x477b1d){try{jsonpatch[_0x47a5('0x1b')](_0x477b1d,_0x1ef371,!![]);}catch(_0x2763d6){return BPromise[_0x47a5('0x1c')](_0x2763d6);}return _0x477b1d[_0x47a5('0x1d')]();};}function saveUpdates(_0x4a9fcb,_0x1570bc){return function(_0xf160ba){if(_0xf160ba){return _0xf160ba['update'](_0x4a9fcb)[_0x47a5('0x1e')](function(_0x1f03f7){return _0x1f03f7;});}return null;};}function removeEntity(_0x36874d,_0x4c5910){return function(_0xb8ae6c){if(_0xb8ae6c){return _0xb8ae6c[_0x47a5('0x1f')]()[_0x47a5('0x1e')](function(){_0x36874d[_0x47a5('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0xe2dea9,_0x385687){return function(_0x513981){if(!_0x513981){_0xe2dea9[_0x47a5('0x20')](0x194);}return _0x513981;};}function handleError(_0xc4cd63,_0x4437f1){_0x4437f1=_0x4437f1||0x1f4;return function(_0x129ce5){logger[_0x47a5('0x21')](_0x129ce5['stack']);if(_0x129ce5['name']){delete _0x129ce5[_0x47a5('0x22')];}_0xc4cd63['status'](_0x4437f1)[_0x47a5('0x23')](_0x129ce5);};}exports['index']=function(_0x23cb77,_0x378208){var _0x36ad34={},_0x1dac65={},_0x21f296={'count':0x0,'rows':[]};var _0x3ba0b7=db[_0x47a5('0x24')][_0x47a5('0x25')];_0x1dac65[_0x47a5('0x26')]=_[_0x47a5('0x27')](_0x3ba0b7);_0x1dac65[_0x47a5('0x28')]=_[_0x47a5('0x27')](_0x23cb77[_0x47a5('0x28')]);_0x1dac65['filters']=_[_0x47a5('0x29')](_0x1dac65['model'],_0x1dac65[_0x47a5('0x28')]);_0x36ad34[_0x47a5('0x2a')]=_[_0x47a5('0x29')](_0x1dac65['model'],qs[_0x47a5('0x2b')](_0x23cb77[_0x47a5('0x28')][_0x47a5('0x2b')]));_0x36ad34[_0x47a5('0x2a')]=_0x36ad34['attributes']['length']?_0x36ad34[_0x47a5('0x2a')]:_0x1dac65[_0x47a5('0x26')];if(!_0x23cb77['query']['hasOwnProperty'](_0x47a5('0x2c'))){_0x36ad34[_0x47a5('0x2d')]=qs['limit'](_0x23cb77[_0x47a5('0x28')]['limit']);_0x36ad34[_0x47a5('0x18')]=qs[_0x47a5('0x18')](_0x23cb77['query']['offset']);}_0x36ad34[_0x47a5('0x2e')]=qs['sort'](_0x23cb77[_0x47a5('0x28')][_0x47a5('0x2f')]);_0x36ad34[_0x47a5('0x30')]=qs['filters'](_[_0x47a5('0x31')](_0x23cb77['query'],_0x1dac65['filters']));if(_0x23cb77[_0x47a5('0x28')]['filter']){_0x36ad34[_0x47a5('0x30')]=_['merge'](_0x36ad34[_0x47a5('0x30')],{'$or':_[_0x47a5('0x32')](_0x3ba0b7,function(_0x38c8d4){if(_0x38c8d4[_0x47a5('0x33')][_0x47a5('0x34')]!==_0x47a5('0x35')){var _0xee582c={};_0xee582c[_0x38c8d4[_0x47a5('0x36')]]={'$like':'%'+_0x23cb77[_0x47a5('0x28')]['filter']+'%'};return _0xee582c;}})});}_0x36ad34=_[_0x47a5('0x37')]({},_0x36ad34,_0x23cb77[_0x47a5('0x38')]);var _0x511c06={'where':_0x36ad34[_0x47a5('0x30')]};return db[_0x47a5('0x24')][_0x47a5('0x39')](_0x511c06)['then'](function(_0x101f70){_0x21f296[_0x47a5('0x39')]=_0x101f70;if(_0x23cb77['query'][_0x47a5('0x3a')]){_0x36ad34[_0x47a5('0x3b')]=[{'all':!![]}];}return db['FaxApplication']['findAll'](_0x36ad34);})['then'](function(_0x12d9f2){_0x21f296['rows']=_0x12d9f2;return _0x21f296;})[_0x47a5('0x1e')](respondWithFilteredResult(_0x378208,_0x36ad34))[_0x47a5('0x3c')](handleError(_0x378208,null));};exports[_0x47a5('0x3d')]=function(_0x111f0d,_0x1b2c80){var _0xcb5243={'raw':!![],'where':{'id':_0x111f0d[_0x47a5('0x3e')]['id']}},_0x2003b0={};_0x2003b0[_0x47a5('0x26')]=_[_0x47a5('0x27')](db[_0x47a5('0x24')][_0x47a5('0x25')]);_0x2003b0[_0x47a5('0x28')]=_['keys'](_0x111f0d[_0x47a5('0x28')]);_0x2003b0[_0x47a5('0x3f')]=_[_0x47a5('0x29')](_0x2003b0[_0x47a5('0x26')],_0x2003b0['query']);_0xcb5243[_0x47a5('0x2a')]=_['intersection'](_0x2003b0['model'],qs['fields'](_0x111f0d['query'][_0x47a5('0x2b')]));_0xcb5243['attributes']=_0xcb5243[_0x47a5('0x2a')][_0x47a5('0x40')]?_0xcb5243[_0x47a5('0x2a')]:_0x2003b0['model'];if(_0x111f0d[_0x47a5('0x28')][_0x47a5('0x3a')]){_0xcb5243['include']=[{'all':!![]}];}_0xcb5243=_['merge']({},_0xcb5243,_0x111f0d[_0x47a5('0x38')]);return db['FaxApplication'][_0x47a5('0x41')](_0xcb5243)[_0x47a5('0x1e')](handleEntityNotFound(_0x1b2c80,null))[_0x47a5('0x1e')](respondWithResult(_0x1b2c80,null))[_0x47a5('0x3c')](handleError(_0x1b2c80,null));};exports[_0x47a5('0x42')]=function(_0xf0edbb,_0x434227){return db[_0x47a5('0x24')][_0x47a5('0x42')](_0xf0edbb[_0x47a5('0x43')],{})[_0x47a5('0x1e')](respondWithResult(_0x434227,0xc9))[_0x47a5('0x3c')](handleError(_0x434227,null));};exports[_0x47a5('0x44')]=function(_0x3574d4,_0x4e5e7){if(_0x3574d4[_0x47a5('0x43')]['id']){delete _0x3574d4['body']['id'];}return db[_0x47a5('0x24')][_0x47a5('0x41')]({'where':{'id':_0x3574d4['params']['id']}})['then'](handleEntityNotFound(_0x4e5e7,null))[_0x47a5('0x1e')](saveUpdates(_0x3574d4['body'],null))[_0x47a5('0x1e')](respondWithResult(_0x4e5e7,null))[_0x47a5('0x3c')](handleError(_0x4e5e7,null));};exports['destroy']=function(_0x4f62d3,_0x3d85cc){return db['FaxApplication'][_0x47a5('0x41')]({'where':{'id':_0x4f62d3[_0x47a5('0x3e')]['id']}})[_0x47a5('0x1e')](handleEntityNotFound(_0x3d85cc,null))[_0x47a5('0x1e')](removeEntity(_0x3d85cc,null))[_0x47a5('0x3c')](handleError(_0x3d85cc,null));}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.model.js b/server/api/faxApplication/faxApplication.model.js index 1a34d37..27ccb51 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 _0xa7ed=['utf8mb4_unicode_ci','lodash','util','api','moment','request-promise','path','rimraf','../../config/environment','./faxApplication.attributes','exports','define','fax_applications','utf8mb4'];(function(_0x4bfcd2,_0x523d81){var _0x2b6225=function(_0x4e90d3){while(--_0x4e90d3){_0x4bfcd2['push'](_0x4bfcd2['shift']());}};_0x2b6225(++_0x523d81);}(_0xa7ed,0x135));var _0xda7e=function(_0x592eaa,_0x26d920){_0x592eaa=_0x592eaa-0x0;var _0x502849=_0xa7ed[_0x592eaa];return _0x502849;};'use strict';var _=require(_0xda7e('0x0'));var util=require(_0xda7e('0x1'));var logger=require('../../config/logger')(_0xda7e('0x2'));var moment=require(_0xda7e('0x3'));var BPromise=require('bluebird');var rp=require(_0xda7e('0x4'));var fs=require('fs');var path=require(_0xda7e('0x5'));var rimraf=require(_0xda7e('0x6'));var config=require(_0xda7e('0x7'));var attributes=require(_0xda7e('0x8'));module[_0xda7e('0x9')]=function(_0x4c373a,_0x54716f){return _0x4c373a[_0xda7e('0xa')]('FaxApplication',attributes,{'tableName':_0xda7e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xda7e('0xc'),'collate':_0xda7e('0xd')});}; \ No newline at end of file +var _0x925e=['fax_applications','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','exports','define','FaxApplication'];(function(_0x5b0788,_0x25d7d4){var _0x224deb=function(_0x5dbd58){while(--_0x5dbd58){_0x5b0788['push'](_0x5b0788['shift']());}};_0x224deb(++_0x25d7d4);}(_0x925e,0x146));var _0xe925=function(_0xb547d0,_0x3ba484){_0xb547d0=_0xb547d0-0x0;var _0x4a4f23=_0x925e[_0xb547d0];return _0x4a4f23;};'use strict';var _=require(_0xe925('0x0'));var util=require('util');var logger=require(_0xe925('0x1'))(_0xe925('0x2'));var moment=require(_0xe925('0x3'));var BPromise=require(_0xe925('0x4'));var rp=require(_0xe925('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe925('0x6'));var config=require('../../config/environment');var attributes=require('./faxApplication.attributes');module[_0xe925('0x7')]=function(_0x43f5f4,_0x1d15ae){return _0x43f5f4[_0xe925('0x8')](_0xe925('0x9'),attributes,{'tableName':_0xe925('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xe925('0xb')});}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.rpc.js b/server/api/faxApplication/faxApplication.rpc.js index 3a784ec..127e24c 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 _0xbaf4=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','error','code','FaxApplication,\x20%s,\x20%s','message','result','catch','FaxApplication','body','options','raw','where','limit','UpdateFaxApplication','stringify','moment'];(function(_0x30d465,_0x250e48){var _0x2c6d68=function(_0x48eec8){while(--_0x48eec8){_0x30d465['push'](_0x30d465['shift']());}};_0x2c6d68(++_0x250e48);}(_0xbaf4,0x6f));var _0x4baf=function(_0xc70a03,_0x3d702e){_0xc70a03=_0xc70a03-0x0;var _0x1acbef=_0xbaf4[_0xc70a03];return _0x1acbef;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x4baf('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4baf('0x1'));var db=require(_0x4baf('0x2'))['db'];var utils=require(_0x4baf('0x3'));var logger=require(_0x4baf('0x4'))(_0x4baf('0x5'));var config=require(_0x4baf('0x6'));var jayson=require(_0x4baf('0x7'));var client=jayson[_0x4baf('0x8')][_0x4baf('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x59cfb8,_0xd279b2,_0x25aad5){return new BPromise(function(_0x32106e,_0x19bba5){return client['request'](_0x59cfb8,_0x25aad5)[_0x4baf('0xa')](function(_0x1a8adb){logger[_0x4baf('0xb')]('FaxApplication,\x20%s,\x20%s',_0xd279b2,_0x4baf('0xc'));logger[_0x4baf('0xd')]('FaxApplication,\x20%s,\x20%s,\x20%s',_0xd279b2,_0x4baf('0xc'),JSON['stringify'](_0x1a8adb));if(_0x1a8adb[_0x4baf('0xe')]){if(_0x1a8adb[_0x4baf('0xe')][_0x4baf('0xf')]===0x1f4){logger[_0x4baf('0xe')](_0x4baf('0x10'),_0xd279b2,_0x1a8adb['error'][_0x4baf('0x11')]);return _0x19bba5(_0x1a8adb[_0x4baf('0xe')][_0x4baf('0x11')]);}logger[_0x4baf('0xe')](_0x4baf('0x10'),_0xd279b2,_0x1a8adb['error'][_0x4baf('0x11')]);return _0x32106e(_0x1a8adb[_0x4baf('0xe')][_0x4baf('0x11')]);}else{logger[_0x4baf('0xb')](_0x4baf('0x10'),_0xd279b2,_0x4baf('0xc'));_0x32106e(_0x1a8adb[_0x4baf('0x12')][_0x4baf('0x11')]);}})[_0x4baf('0x13')](function(_0x342d3f){logger[_0x4baf('0xe')]('FaxApplication,\x20%s,\x20%s',_0xd279b2,_0x342d3f);_0x19bba5(_0x342d3f);});});}exports['UpdateFaxApplication']=function(_0x1ea85f){var _0x46fe93=this;return new Promise(function(_0x48235d,_0x5b8011){return db[_0x4baf('0x14')]['update'](_0x1ea85f[_0x4baf('0x15')],{'raw':_0x1ea85f[_0x4baf('0x16')]?_0x1ea85f[_0x4baf('0x16')][_0x4baf('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1ea85f[_0x4baf('0x16')]?_0x1ea85f[_0x4baf('0x16')][_0x4baf('0x18')]||null:null,'attributes':_0x1ea85f[_0x4baf('0x16')]?_0x1ea85f[_0x4baf('0x16')]['attributes']||null:null,'limit':_0x1ea85f[_0x4baf('0x16')]?_0x1ea85f[_0x4baf('0x16')][_0x4baf('0x19')]||null:null})[_0x4baf('0xa')](function(_0x136059){logger[_0x4baf('0xb')](_0x4baf('0x1a'),_0x1ea85f);logger[_0x4baf('0xd')](_0x4baf('0x1a'),_0x1ea85f,JSON[_0x4baf('0x1b')](_0x136059));_0x48235d(_0x136059);})['catch'](function(_0x47b551){logger['error'](_0x4baf('0x1a'),_0x47b551[_0x4baf('0x11')],_0x1ea85f);_0x5b8011(_0x46fe93[_0x4baf('0xe')](0x1f4,_0x47b551[_0x4baf('0x11')]));});});}; \ No newline at end of file +var _0x1d8e=['UpdateFaxApplication','FaxApplication','options','raw','attributes','limit','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','then','info','FaxApplication,\x20%s,\x20%s','request\x20sent','debug','FaxApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x1642ff,_0x3cea12){var _0x2f2761=function(_0x162f27){while(--_0x162f27){_0x1642ff['push'](_0x1642ff['shift']());}};_0x2f2761(++_0x3cea12);}(_0x1d8e,0xd2));var _0xe1d8=function(_0x50007c,_0x1cbf11){_0x50007c=_0x50007c-0x0;var _0x5c1ec7=_0x1d8e[_0x50007c];return _0x5c1ec7;};'use strict';var _=require('lodash');var util=require(_0xe1d8('0x0'));var moment=require('moment');var BPromise=require(_0xe1d8('0x1'));var rs=require(_0xe1d8('0x2'));var fs=require('fs');var Redis=require(_0xe1d8('0x3'));var db=require(_0xe1d8('0x4'))['db'];var utils=require(_0xe1d8('0x5'));var logger=require('../../config/logger')(_0xe1d8('0x6'));var config=require('../../config/environment');var jayson=require(_0xe1d8('0x7'));var client=jayson[_0xe1d8('0x8')][_0xe1d8('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x199646,_0x28699d,_0x25eb38){return new BPromise(function(_0x2146a2,_0x200399){return client[_0xe1d8('0xa')](_0x199646,_0x25eb38)[_0xe1d8('0xb')](function(_0x284907){logger[_0xe1d8('0xc')](_0xe1d8('0xd'),_0x28699d,_0xe1d8('0xe'));logger[_0xe1d8('0xf')](_0xe1d8('0x10'),_0x28699d,_0xe1d8('0xe'),JSON[_0xe1d8('0x11')](_0x284907));if(_0x284907['error']){if(_0x284907[_0xe1d8('0x12')][_0xe1d8('0x13')]===0x1f4){logger[_0xe1d8('0x12')](_0xe1d8('0xd'),_0x28699d,_0x284907[_0xe1d8('0x12')]['message']);return _0x200399(_0x284907['error'][_0xe1d8('0x14')]);}logger[_0xe1d8('0x12')]('FaxApplication,\x20%s,\x20%s',_0x28699d,_0x284907[_0xe1d8('0x12')]['message']);return _0x2146a2(_0x284907['error'][_0xe1d8('0x14')]);}else{logger[_0xe1d8('0xc')](_0xe1d8('0xd'),_0x28699d,'request\x20sent');_0x2146a2(_0x284907[_0xe1d8('0x15')][_0xe1d8('0x14')]);}})['catch'](function(_0x4a3bf4){logger[_0xe1d8('0x12')](_0xe1d8('0xd'),_0x28699d,_0x4a3bf4);_0x200399(_0x4a3bf4);});});}exports[_0xe1d8('0x16')]=function(_0x323e4e){var _0x55cf2d=this;return new Promise(function(_0x86af1a,_0x97d0da){return db[_0xe1d8('0x17')]['update'](_0x323e4e['body'],{'raw':_0x323e4e[_0xe1d8('0x18')]?_0x323e4e[_0xe1d8('0x18')][_0xe1d8('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x323e4e[_0xe1d8('0x18')]?_0x323e4e[_0xe1d8('0x18')]['where']||null:null,'attributes':_0x323e4e[_0xe1d8('0x18')]?_0x323e4e[_0xe1d8('0x18')][_0xe1d8('0x1a')]||null:null,'limit':_0x323e4e[_0xe1d8('0x18')]?_0x323e4e[_0xe1d8('0x18')][_0xe1d8('0x1b')]||null:null})[_0xe1d8('0xb')](function(_0x2d27db){logger[_0xe1d8('0xc')](_0xe1d8('0x16'),_0x323e4e);logger[_0xe1d8('0xf')](_0xe1d8('0x16'),_0x323e4e,JSON[_0xe1d8('0x11')](_0x2d27db));_0x86af1a(_0x2d27db);})[_0xe1d8('0x1c')](function(_0x291d9d){logger[_0xe1d8('0x12')](_0xe1d8('0x16'),_0x291d9d['message'],_0x323e4e);_0x97d0da(_0x55cf2d['error'](0x1f4,_0x291d9d[_0xe1d8('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/faxApplication/index.js b/server/api/faxApplication/index.js index 2b64336..df2737b 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 _0x8ef6=['Router','../../components/auth/service','../../config/environment','./faxApplication.controller','get','isAuthenticated','/:id','show','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x24f0b8,_0x3ce0ab){var _0x43b0d4=function(_0x19fcfc){while(--_0x19fcfc){_0x24f0b8['push'](_0x24f0b8['shift']());}};_0x43b0d4(++_0x3ce0ab);}(_0x8ef6,0xf2));var _0x68ef=function(_0x9f1757,_0x4af963){_0x9f1757=_0x9f1757-0x0;var _0x2df48d=_0x8ef6[_0x9f1757];return _0x2df48d;};'use strict';var multer=require(_0x68ef('0x0'));var util=require(_0x68ef('0x1'));var path=require(_0x68ef('0x2'));var timeout=require(_0x68ef('0x3'));var express=require(_0x68ef('0x4'));var router=express[_0x68ef('0x5')]();var auth=require(_0x68ef('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x68ef('0x7'));var controller=require(_0x68ef('0x8'));router[_0x68ef('0x9')]('/',auth[_0x68ef('0xa')](),controller['index']);router['get'](_0x68ef('0xb'),auth[_0x68ef('0xa')](),controller[_0x68ef('0xc')]);router['post']('/',auth[_0x68ef('0xa')](),controller[_0x68ef('0xd')]);router[_0x68ef('0xe')](_0x68ef('0xb'),auth[_0x68ef('0xa')](),controller[_0x68ef('0xf')]);router[_0x68ef('0x10')](_0x68ef('0xb'),auth[_0x68ef('0xa')](),controller[_0x68ef('0x11')]);module[_0x68ef('0x12')]=router; \ No newline at end of file +var _0xdc97=['index','/:id','post','create','put','update','delete','destroy','exports','multer','util','path','express','../../components/auth/service','../../components/interaction/service','./faxApplication.controller','get','isAuthenticated'];(function(_0x1627ae,_0x2aaa24){var _0x34b38f=function(_0x5c4332){while(--_0x5c4332){_0x1627ae['push'](_0x1627ae['shift']());}};_0x34b38f(++_0x2aaa24);}(_0xdc97,0x13b));var _0x7dc9=function(_0x3aaf4f,_0x5aa78a){_0x3aaf4f=_0x3aaf4f-0x0;var _0x220932=_0xdc97[_0x3aaf4f];return _0x220932;};'use strict';var multer=require(_0x7dc9('0x0'));var util=require(_0x7dc9('0x1'));var path=require(_0x7dc9('0x2'));var timeout=require('connect-timeout');var express=require(_0x7dc9('0x3'));var router=express['Router']();var auth=require(_0x7dc9('0x4'));var interaction=require(_0x7dc9('0x5'));var config=require('../../config/environment');var controller=require(_0x7dc9('0x6'));router[_0x7dc9('0x7')]('/',auth[_0x7dc9('0x8')](),controller[_0x7dc9('0x9')]);router['get'](_0x7dc9('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x7dc9('0xb')]('/',auth[_0x7dc9('0x8')](),controller[_0x7dc9('0xc')]);router[_0x7dc9('0xd')](_0x7dc9('0xa'),auth['isAuthenticated'](),controller[_0x7dc9('0xe')]);router[_0x7dc9('0xf')](_0x7dc9('0xa'),auth[_0x7dc9('0x8')](),controller[_0x7dc9('0x10')]);module[_0x7dc9('0x11')]=router; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.attributes.js b/server/api/faxInteraction/faxInteraction.attributes.js index d120b15..9398c75 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 _0x7f7d=['DATE','STRING','out','ENUM','sequelize','exports','BOOLEAN'];(function(_0x24c02c,_0x24dbde){var _0x2f3f82=function(_0x12e483){while(--_0x12e483){_0x24c02c['push'](_0x24c02c['shift']());}};_0x2f3f82(++_0x24dbde);}(_0x7f7d,0x18c));var _0xd7f7=function(_0x50f392,_0x1d8441){_0x50f392=_0x50f392-0x0;var _0x5926f2=_0x7f7d[_0x50f392];return _0x5926f2;};'use strict';var Sequelize=require(_0xd7f7('0x0'));module[_0xd7f7('0x1')]={'closed':{'type':Sequelize[_0xd7f7('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xd7f7('0x3')]},'disposition':{'type':Sequelize[_0xd7f7('0x4')]},'note':{'type':Sequelize[_0xd7f7('0x4')]},'read1stAt':{'type':Sequelize[_0xd7f7('0x3')]},'fax':{'type':Sequelize[_0xd7f7('0x4')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0xd7f7('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0xd7f7('0x6')]('in',_0xd7f7('0x5')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file +var _0x3e3c=['exports','BOOLEAN','DATE','STRING','ENUM','out','sequelize'];(function(_0x3d4876,_0x366386){var _0x58ca9d=function(_0x5bd045){while(--_0x5bd045){_0x3d4876['push'](_0x3d4876['shift']());}};_0x58ca9d(++_0x366386);}(_0x3e3c,0x1b1));var _0xc3e3=function(_0x49541b,_0x4b35fb){_0x49541b=_0x49541b-0x0;var _0x20cd00=_0x3e3c[_0x49541b];return _0x20cd00;};'use strict';var Sequelize=require(_0xc3e3('0x0'));module[_0xc3e3('0x1')]={'closed':{'type':Sequelize[_0xc3e3('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xc3e3('0x3')]},'disposition':{'type':Sequelize[_0xc3e3('0x4')]},'note':{'type':Sequelize[_0xc3e3('0x4')]},'read1stAt':{'type':Sequelize[_0xc3e3('0x3')]},'fax':{'type':Sequelize[_0xc3e3('0x4')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xc3e3('0x3')]},'lastMsgDirection':{'type':Sequelize[_0xc3e3('0x5')]('in',_0xc3e3('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 6878ed2..e33c0e3 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 _0x5c2e=['error','stack','name','send','Users','map','Tags','forEach','push','TagIds','index','model','keys','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','pick','select','field','from','tools_tags','ui.FaxInteractionId','user_has_fax_interactions','left_join','fax_interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','users','o.id\x20=\x20i.UserId','a.id\x20=\x20i.FaxAccountId','fax_messages','me.FaxInteractionId\x20=\x20i.id','expr','parse','matchType','substr','omitBy','custom','options','columns','hasMultipleConditions','values','value','table','parseOperator','getConditionValue','$between','having','`\x20=\x200','`\x20>\x200','isRangeCondition','isNil','i.FaxAccountId\x20IN\x20?','concat','createdAt','$gte','$lte','null','where','\x20IS\x20NULL','read','`unreadMessages`\x20>\x200','filter','replace','\x27\x27\x27\x27','i.fax\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','clone','unreadMessages','DESC','tag','isArray','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','fax_interaction_has_tags','it.FaxInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','t.id\x20IN\x20?','TagId','mail_interaction_has_tags','sequelize','toString','count','merge','FaxInteraction','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','i.*','Contact.firstName','Contact.lastName','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','Contact.fax','GROUP_CONCAT(DISTINCT\x20t.id)','ui.FaxInteractionId\x20IN\x20?','groupBy','all','rows','catch','rawAttributes','fields','includeAll','include','find','create','body','destroy','params','describe','addMessage','FaxMessage','ids','getMessages','findOne','FaxInteractionId','split','format','YYYY-MM-DD\x20HH:mm:ss','findAll','addTags','setTags','omit','Tag','color','emit','removeTags','download','unix','join','root','files','attachments','server','interaction-%s.zip','Attachment','mkdirSync','existsSync','createReadStream','createWriteStream','log','err','unlinkSync','html-pdf','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','./faxInteraction.socket','register','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','reject','update','then'];(function(_0x3c0a33,_0x413967){var _0x5ab98e=function(_0x446acf){while(--_0x446acf){_0x3c0a33['push'](_0x3c0a33['shift']());}};_0x5ab98e(++_0x413967);}(_0x5c2e,0x158));var _0xe5c2=function(_0x42bc91,_0x41f40a){_0x42bc91=_0x42bc91-0x0;var _0x3f5507=_0x5c2e[_0x42bc91];return _0x3f5507;};'use strict';var pdf=require(_0xe5c2('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xe5c2('0x1'));var zipdir=require(_0xe5c2('0x2'));var jsonpatch=require(_0xe5c2('0x3'));var rp=require('request-promise');var moment=require(_0xe5c2('0x4'));var BPromise=require(_0xe5c2('0x5'));var Mustache=require('mustache');var util=require(_0xe5c2('0x6'));var path=require(_0xe5c2('0x7'));var sox=require(_0xe5c2('0x8'));var csv=require(_0xe5c2('0x9'));var ejs=require(_0xe5c2('0xa'));var fs=require('fs');var _=require(_0xe5c2('0xb'));var squel=require('squel');var crypto=require(_0xe5c2('0xc'));var jsforce=require(_0xe5c2('0xd'));var deskjs=require(_0xe5c2('0xe'));var toCsv=require(_0xe5c2('0x9'));var querystring=require(_0xe5c2('0xf'));var Papa=require(_0xe5c2('0x10'));var Redis=require(_0xe5c2('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xe5c2('0x12'))(_0xe5c2('0x13'));var utils=require(_0xe5c2('0x14'));var config=require(_0xe5c2('0x15'));var db=require(_0xe5c2('0x16'))['db'];config[_0xe5c2('0x17')]=_[_0xe5c2('0x18')](config['redis'],{'host':_0xe5c2('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xe5c2('0x1a'))[_0xe5c2('0x1b')](socket);function respondWithStatusCode(_0x198d06,_0x3bb341){_0x3bb341=_0x3bb341||0xcc;return function(_0x21b590){if(_0x21b590){return _0x198d06[_0xe5c2('0x1c')](_0x3bb341);}return _0x198d06[_0xe5c2('0x1d')](_0x3bb341)[_0xe5c2('0x1e')]();};}function respondWithResult(_0x21e74e,_0x4af837){_0x4af837=_0x4af837||0xc8;return function(_0x1ccd85){if(_0x1ccd85){return _0x21e74e[_0xe5c2('0x1d')](_0x4af837)[_0xe5c2('0x1f')](_0x1ccd85);}};}function respondWithFilteredResult(_0x58082c,_0x42c2a8){return function(_0x5a0194){if(_0x5a0194){var _0x2bdbaf=_0x5a0194['count'],_0x2a624d=_0x42c2a8[_0xe5c2('0x20')],_0xacafdd=_0x42c2a8[_0xe5c2('0x20')]+_0x42c2a8[_0xe5c2('0x21')],_0x328327;if(_0xacafdd>=_0x2bdbaf){_0xacafdd=_0x2bdbaf;_0x328327=0xc8;}else{_0x328327=0xce;}_0x58082c[_0xe5c2('0x1d')](_0x328327);return _0x58082c[_0xe5c2('0x22')](_0xe5c2('0x23'),_0x2a624d+'-'+_0xacafdd+'/'+_0x2bdbaf)[_0xe5c2('0x1f')](_0x5a0194);}return null;};}function patchUpdates(_0x449a3c){return function(_0x1762d9){try{jsonpatch[_0xe5c2('0x24')](_0x1762d9,_0x449a3c,!![]);}catch(_0x34eab5){return BPromise[_0xe5c2('0x25')](_0x34eab5);}return _0x1762d9['save']();};}function saveUpdates(_0x434926,_0x49ce28){return function(_0x410516){if(_0x410516){return _0x410516[_0xe5c2('0x26')](_0x434926)[_0xe5c2('0x27')](function(_0x4527ce){return _0x4527ce;});}return null;};}function removeEntity(_0x2c62b8,_0x1eca97){return function(_0x531d1a){if(_0x531d1a){return _0x531d1a['destroy']()[_0xe5c2('0x27')](function(){_0x2c62b8[_0xe5c2('0x1d')](0xcc)[_0xe5c2('0x1e')]();});}};}function handleEntityNotFound(_0x2e383a,_0x1033c4){return function(_0x14fcb6){if(!_0x14fcb6){_0x2e383a['sendStatus'](0x194);}return _0x14fcb6;};}function handleError(_0x1a0ddf,_0x598883){_0x598883=_0x598883||0x1f4;return function(_0x3bc195){logger[_0xe5c2('0x28')](_0x3bc195[_0xe5c2('0x29')]);if(_0x3bc195[_0xe5c2('0x2a')]){delete _0x3bc195[_0xe5c2('0x2a')];}_0x1a0ddf['status'](_0x598883)[_0xe5c2('0x2b')](_0x3bc195);};}function getInteractionUsers(_0x55b090,_0x4b5423){return new BPromise(function(_0x5110c6,_0x1325bc){try{if(_0x4b5423[_0x55b090['id']]){_0x55b090[_0xe5c2('0x2c')]=_[_0xe5c2('0x2d')](_0x4b5423[_0x55b090['id']],function(_0x5e18bb){return{'id':_0x5e18bb['id']};});}}catch(_0x537b93){_0x1325bc(_0x537b93);}_0x5110c6(_0x55b090);});}function getInteractionTags(_0x17bb1b,_0x1fbff4){return new BPromise(function(_0x354231,_0x3bacd9){try{if(_0x17bb1b['TagIds']){_0x17bb1b[_0xe5c2('0x2e')]=[];_0x17bb1b['TagIds']['split'](',')[_0xe5c2('0x2f')](function(_0x5c2ac6){_0x17bb1b[_0xe5c2('0x2e')][_0xe5c2('0x30')](_0x1fbff4[_0x5c2ac6]);});}delete _0x17bb1b[_0xe5c2('0x31')];}catch(_0x4171aa){_0x3bacd9(_0x4171aa);}_0x354231(_0x17bb1b);});}function updateFaxInteraction(_0x26e441,_0x4ab1c0,_0x59ad7e){return new BPromise(function(_0x5d9bc1,_0x4125db){return getInteractionUsers(_0x26e441,_0x59ad7e)['then'](function(_0x6fea7d){return getInteractionTags(_0x6fea7d,_0x4ab1c0);})[_0xe5c2('0x27')](function(_0x52bb24){_0x5d9bc1(_0x52bb24);})['catch'](function(_0x2a77e8){_0x4125db(_0x2a77e8);});});}exports[_0xe5c2('0x32')]=function(_0xb88a1b,_0x368d78){var _0x2e892a={},_0x14d0a7={},_0x3f739e={'count':0x0,'rows':[]};var _0x3045f4=db['FaxInteraction']['rawAttributes'];_0x14d0a7[_0xe5c2('0x33')]=_[_0xe5c2('0x34')](_0x3045f4);_0x14d0a7[_0xe5c2('0x35')]=_[_0xe5c2('0x34')](_0xb88a1b[_0xe5c2('0x35')]);_0x14d0a7[_0xe5c2('0x36')]=_[_0xe5c2('0x37')](_0x14d0a7[_0xe5c2('0x33')],_0x14d0a7[_0xe5c2('0x35')]);_0x2e892a[_0xe5c2('0x38')]=_[_0xe5c2('0x37')](_0x14d0a7[_0xe5c2('0x33')],qs['fields'](_0xb88a1b[_0xe5c2('0x35')]['fields']));_0x2e892a[_0xe5c2('0x38')]=_0x2e892a[_0xe5c2('0x38')][_0xe5c2('0x39')]?_0x2e892a[_0xe5c2('0x38')]:_0x14d0a7[_0xe5c2('0x33')];if(!_0xb88a1b[_0xe5c2('0x35')][_0xe5c2('0x3a')](_0xe5c2('0x3b'))){_0x2e892a['limit']=qs[_0xe5c2('0x21')](_0xb88a1b[_0xe5c2('0x35')][_0xe5c2('0x21')]);_0x2e892a[_0xe5c2('0x20')]=qs[_0xe5c2('0x20')](_0xb88a1b[_0xe5c2('0x35')][_0xe5c2('0x20')]);}_0x2e892a[_0xe5c2('0x3c')]=qs[_0xe5c2('0x3d')](_0xb88a1b[_0xe5c2('0x35')][_0xe5c2('0x3d')]);_0x2e892a['where']=qs[_0xe5c2('0x36')](_[_0xe5c2('0x3e')](_0xb88a1b['query'],_0x14d0a7[_0xe5c2('0x36')]));var _0x585c70=[];var _0x2e4638=squel[_0xe5c2('0x3f')]()[_0xe5c2('0x40')]('id')[_0xe5c2('0x40')](_0xe5c2('0x2a'))[_0xe5c2('0x40')]('color')[_0xe5c2('0x41')](_0xe5c2('0x42'));var _0xceb736=squel[_0xe5c2('0x3f')]()[_0xe5c2('0x40')]('u.id')[_0xe5c2('0x40')](_0xe5c2('0x43'))[_0xe5c2('0x41')](_0xe5c2('0x44'),'ui')[_0xe5c2('0x45')]('users','u','u.id\x20=\x20ui.UserId');var _0x40cf42=squel[_0xe5c2('0x3f')]()['from'](_0xe5c2('0x46'),'i')['left_join']('cm_contacts','c',_0xe5c2('0x47'))[_0xe5c2('0x45')](_0xe5c2('0x48'),'o',_0xe5c2('0x49'))['left_join']('fax_accounts','a',_0xe5c2('0x4a'))['left_join'](_0xe5c2('0x4b'),'me',_0xe5c2('0x4c'));var _0x11c058=squel[_0xe5c2('0x4d')]();var _0xca6411=_0xb88a1b[_0xe5c2('0x35')]['advancedFilter']?JSON[_0xe5c2('0x4e')](_0xb88a1b[_0xe5c2('0x35')]['advancedFilter']):undefined;if(_0xca6411){var _0x358ab2=_0xca6411[_0xe5c2('0x4f')][_0xe5c2('0x50')](0x1);_(_0xca6411)['omit']('matchType')[_0xe5c2('0x51')](function(_0xb04073,_0x529815){return _0xb04073['options'][_0xe5c2('0x52')]===!![];})['keys']()['forEach'](function(_0x32e08a){var _0x51ab19=_0xca6411[_0x32e08a];if(_0x51ab19[_0xe5c2('0x53')][_0xe5c2('0x54')]){var _0x1a3858=squel[_0xe5c2('0x4d')]();if(as[_0xe5c2('0x55')](_0x51ab19['value'])){var _0x1ad275=_[_0xe5c2('0x56')](_0x51ab19[_0xe5c2('0x57')])[0x0];_0x1ad275[_0xe5c2('0x2f')](function(_0x193379){_0x51ab19[_0xe5c2('0x53')][_0xe5c2('0x54')][_0xe5c2('0x2f')](function(_0x11e9a9){_0x1a3858['or'](_0x51ab19[_0xe5c2('0x53')][_0xe5c2('0x58')]+'.'+_0x11e9a9+'\x20'+as[_0xe5c2('0x59')](_0x193379),as['getConditionValue'](_0x193379));});});}else{var _0x2fcb68=as['isRangeCondition'](_0x51ab19['value'])?_0x51ab19[_0xe5c2('0x57')][0x1]:undefined;_0x51ab19[_0xe5c2('0x53')]['columns']['forEach'](function(_0x5d9652){_0x1a3858['or'](_0x51ab19[_0xe5c2('0x53')][_0xe5c2('0x58')]+'.'+_0x5d9652+'\x20'+as[_0xe5c2('0x59')](_0x51ab19[_0xe5c2('0x57')]),as[_0xe5c2('0x5a')](_0x51ab19[_0xe5c2('0x57')]),_0x2fcb68);});}_0x11c058[_0x358ab2](_0x1a3858);}else if(as['hasMultipleConditions'](_0x51ab19[_0xe5c2('0x57')])){var _0x1ad275=_[_0xe5c2('0x56')](_0x51ab19[_0xe5c2('0x57')])[0x0];_0x1ad275[_0xe5c2('0x2f')](function(_0x4d6272){if(!_0x51ab19[_0xe5c2('0x53')]['having']){var _0x1010ad=as['isRangeCondition'](_0x4d6272)?_0x4d6272[_0xe5c2('0x5b')][0x1]:undefined;_0x11c058[_0x358ab2](_0x51ab19[_0xe5c2('0x53')][_0xe5c2('0x58')]+'.'+_0x32e08a+'\x20'+as['parseOperator'](_0x4d6272),as[_0xe5c2('0x5a')](_0x4d6272),_0x1010ad);}});}else{if(_0x51ab19[_0xe5c2('0x53')][_0xe5c2('0x5c')]){var _0x5bb4f9=as['getConditionValue'](_0x51ab19[_0xe5c2('0x57')]);if(_0x5bb4f9[_0xe5c2('0x39')]===0x1){if(_0x5bb4f9==0x1){_0x40cf42['having']('`'+_0x32e08a+_0xe5c2('0x5d'));}else{_0x40cf42[_0xe5c2('0x5c')]('`'+_0x32e08a+_0xe5c2('0x5e'));}}}else{var _0x2fcb68=as[_0xe5c2('0x5f')](_0x51ab19[_0xe5c2('0x57')])?_0x51ab19[_0xe5c2('0x57')][_0xe5c2('0x5b')][0x1]:undefined;_0x11c058[_0x358ab2](_0x51ab19[_0xe5c2('0x53')][_0xe5c2('0x58')]+'.'+_0x32e08a+'\x20'+as[_0xe5c2('0x59')](_0x51ab19[_0xe5c2('0x57')]),as[_0xe5c2('0x5a')](_0x51ab19[_0xe5c2('0x57')]),_0x2fcb68);}}});}else{var _0x38b7fd=_(Object[_0xe5c2('0x34')](_0xb88a1b[_0xe5c2('0x35')]))['map'](function(_0x5a8e03){return _0x3045f4['hasOwnProperty'](_0x5a8e03)?_0x5a8e03:undefined;})['filter'](function(_0x5e80a2){return!_[_0xe5c2('0x60')](_0x5e80a2);})[_0xe5c2('0x57')]();if(!_['isEmpty'](_0x38b7fd)){_0x38b7fd[_0xe5c2('0x2f')](function(_0x4f4de1){if(_0x4f4de1==='FaxAccountId'){_0x40cf42['where'](_0xe5c2('0x61'),[][_0xe5c2('0x62')](_0xb88a1b[_0xe5c2('0x35')][_0x4f4de1]));}else if(_0x4f4de1===_0xe5c2('0x63')){var _0x3cbe33=JSON['parse'](_0xb88a1b[_0xe5c2('0x35')][_0x4f4de1])[_0xe5c2('0x64')];var _0x2004ef=JSON[_0xe5c2('0x4e')](_0xb88a1b[_0xe5c2('0x35')][_0x4f4de1])[_0xe5c2('0x65')];_0x40cf42['where']('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x3cbe33,_0x2004ef);}else{if(_0xb88a1b['query'][_0x4f4de1]===_0xe5c2('0x66')){_0x40cf42[_0xe5c2('0x67')]('i.'+_0x4f4de1+_0xe5c2('0x68'));}else{_0x40cf42['where']('i.'+_0x4f4de1+'\x20=\x20?',_0xb88a1b[_0xe5c2('0x35')][_0x4f4de1]);}}});}if(_0xb88a1b[_0xe5c2('0x35')][_0xe5c2('0x69')]){if(_0xb88a1b[_0xe5c2('0x35')]['read']==0x1){_0x40cf42[_0xe5c2('0x5c')]('`unreadMessages`\x20=\x200');}else{_0x40cf42[_0xe5c2('0x5c')](_0xe5c2('0x6a'));}}if(_0xb88a1b[_0xe5c2('0x35')][_0xe5c2('0x6b')]){var _0x37cdd2=_0xb88a1b[_0xe5c2('0x35')][_0xe5c2('0x6b')][_0xe5c2('0x6c')]('\x5c','\x5c\x5c')[_0xe5c2('0x6c')]('\x27\x27',_0xe5c2('0x6d'));if(qs['isNumeric'](_0x37cdd2)){_0x11c058['or']('i.id\x20LIKE\x20?',_0x37cdd2+'%')['or'](_0xe5c2('0x6e'),_0x37cdd2+'%');}_0x11c058['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x37cdd2+'%');}}_0x40cf42[_0xe5c2('0x67')](_0x11c058);_0x40cf42[_0xe5c2('0x6f')](_0xe5c2('0x70'));var _0x3e8f1d={'type':db[_0xe5c2('0x71')][_0xe5c2('0x72')]['SELECT'],'raw':!![]};var _0x10ea94=_0x40cf42[_0xe5c2('0x73')]();_0x10ea94['field']('i.id');_0x10ea94['field']('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xe5c2('0x74'));if(_0x2e892a[_0xe5c2('0x3c')]){_0x2e892a['order'][_0xe5c2('0x2f')](function(_0x345426){_0x40cf42[_0xe5c2('0x3c')]('i.'+_0x345426[0x0],_0x345426[0x1]===_0xe5c2('0x75')?![]:!![]);});}var _0x191252=[];var _0x57922b=squel[_0xe5c2('0x4d')]();if(!_0xca6411){if(_0xb88a1b['query'][_0xe5c2('0x76')]){_0x191252=_[_0xe5c2('0x77')](_0xb88a1b[_0xe5c2('0x35')][_0xe5c2('0x76')])?_0xb88a1b[_0xe5c2('0x35')][_0xe5c2('0x76')]:new Array(_0xb88a1b[_0xe5c2('0x35')][_0xe5c2('0x76')]);_0x191252[_0xe5c2('0x2f')](function(_0x554f21){_0x57922b['or'](_0xe5c2('0x78'),'%,'+_0x554f21+',%');});_0x40cf42[_0xe5c2('0x5c')](_0x57922b);_0x10ea94[_0xe5c2('0x45')](_0xe5c2('0x79'),'it',_0xe5c2('0x7a'));_0x10ea94[_0xe5c2('0x45')]('tools_tags','t',_0xe5c2('0x7b'));_0x10ea94[_0xe5c2('0x67')](_0xe5c2('0x7c'),_0x191252);}}else{if(_0xca6411[_0xe5c2('0x3a')](_0xe5c2('0x7d'))){if(as['hasMultipleConditions'](_0xca6411[_0xe5c2('0x7d')]['value'])){var _0x5f054b=_[_0xe5c2('0x56')](_0xca6411[_0xe5c2('0x7d')][_0xe5c2('0x57')])[0x0];_0x5f054b[_0xe5c2('0x2f')](function(_0x27dc80){as[_0xe5c2('0x5a')](_0x27dc80)[_0xe5c2('0x2f')](function(_0x2b67d1){_0x191252['push'](_0x2b67d1);});});}else{_0x191252=as['getConditionValue'](_0xca6411['TagId'][_0xe5c2('0x57')]);}_0x191252[_0xe5c2('0x2f')](function(_0x63f509){_0x57922b['or'](_0xe5c2('0x78'),'%,'+_0x63f509+',%');});_0x40cf42['having'](_0x57922b);_0x10ea94[_0xe5c2('0x45')](_0xe5c2('0x7e'),'it','it.MailInteractionId\x20=\x20i.id');_0x10ea94['left_join'](_0xe5c2('0x42'),'t','t.id\x20=\x20it.TagId');_0x10ea94[_0xe5c2('0x67')](_0xe5c2('0x7c'),_0x191252);}}db[_0xe5c2('0x7f')][_0xe5c2('0x35')](_0x10ea94[_0xe5c2('0x80')](),_0x3e8f1d)[_0xe5c2('0x27')](function(_0x534987){_0x3f739e[_0xe5c2('0x81')]=_0x534987[_0xe5c2('0x39')];if(_0x3f739e[_0xe5c2('0x81')]===0x0)return[];return db[_0xe5c2('0x7f')][_0xe5c2('0x35')](_0x2e4638[_0xe5c2('0x80')](),_0x3e8f1d)['then'](function(_0x64af28){_0x585c70=_['keyBy'](_0x64af28,'id');_0x3e8f1d=_[_0xe5c2('0x82')](_0x3e8f1d,{'model':db[_0xe5c2('0x83')],'mapToModel':!![],'raw':!![],'nest':!![]});_0x40cf42[_0xe5c2('0x40')](_0xe5c2('0x84'),_0xe5c2('0x74'));_0x40cf42[_0xe5c2('0x40')](_0xe5c2('0x85'),'Account.key');_0x40cf42[_0xe5c2('0x40')]('a.mandatoryDisposition','Account.mandatoryDisposition');_0x40cf42[_0xe5c2('0x40')](_0xe5c2('0x86'));_0x40cf42[_0xe5c2('0x40')]('c.firstName',_0xe5c2('0x87'));_0x40cf42[_0xe5c2('0x40')]('c.lastName',_0xe5c2('0x88'));_0x40cf42[_0xe5c2('0x40')]('c.email',_0xe5c2('0x89'));_0x40cf42[_0xe5c2('0x40')](_0xe5c2('0x8a'),_0xe5c2('0x8b'));_0x40cf42[_0xe5c2('0x40')](_0xe5c2('0x8c'),_0xe5c2('0x8d'));_0x40cf42[_0xe5c2('0x40')]('c.fax',_0xe5c2('0x8e'));_0x40cf42['field'](_0xe5c2('0x8f'),_0xe5c2('0x31'));_0x40cf42['left_join'](_0xe5c2('0x79'),'it',_0xe5c2('0x7a'));_0x40cf42['left_join']('tools_tags','t',_0xe5c2('0x7b'));_0x40cf42[_0xe5c2('0x21')](_0x2e892a[_0xe5c2('0x21')]);_0x40cf42[_0xe5c2('0x20')](_0x2e892a[_0xe5c2('0x20')]);return db[_0xe5c2('0x7f')][_0xe5c2('0x35')](_0x40cf42[_0xe5c2('0x80')](),_0x3e8f1d);})[_0xe5c2('0x27')](function(_0xfc9401){_0xceb736[_0xe5c2('0x67')](_0xe5c2('0x90'),_['map'](_0xfc9401,'id'));return db[_0xe5c2('0x7f')][_0xe5c2('0x35')](_0xceb736[_0xe5c2('0x80')](),_0x3e8f1d)[_0xe5c2('0x27')](function(_0x3f487a){var _0x397f84=_[_0xe5c2('0x91')](_0x3f487a,'FaxInteractionId');var _0x502981=[];_0xfc9401[_0xe5c2('0x2f')](function(_0x1444d7){_0x502981['push'](updateFaxInteraction(_0x1444d7,_0x585c70,_0x397f84));});return BPromise[_0xe5c2('0x92')](_0x502981);});});})['then'](function(_0x520f8b){_0x3f739e[_0xe5c2('0x93')]=_0x520f8b;return _0x3f739e;})['then'](respondWithFilteredResult(_0x368d78,_0x2e892a))[_0xe5c2('0x94')](handleError(_0x368d78,null));};exports['show']=function(_0x61705f,_0x5e11eb){var _0xf6f332={'raw':![],'where':{'id':_0x61705f['params']['id']}},_0x456eb3={};_0x456eb3[_0xe5c2('0x33')]=_[_0xe5c2('0x34')](db[_0xe5c2('0x83')][_0xe5c2('0x95')]);_0x456eb3[_0xe5c2('0x35')]=_['keys'](_0x61705f[_0xe5c2('0x35')]);_0x456eb3[_0xe5c2('0x36')]=_[_0xe5c2('0x37')](_0x456eb3['model'],_0x456eb3[_0xe5c2('0x35')]);_0xf6f332[_0xe5c2('0x38')]=_[_0xe5c2('0x37')](_0x456eb3['model'],qs[_0xe5c2('0x96')](_0x61705f['query'][_0xe5c2('0x96')]));_0xf6f332[_0xe5c2('0x38')]=_0xf6f332[_0xe5c2('0x38')][_0xe5c2('0x39')]?_0xf6f332[_0xe5c2('0x38')]:_0x456eb3[_0xe5c2('0x33')];if(_0x61705f[_0xe5c2('0x35')][_0xe5c2('0x97')]){_0xf6f332[_0xe5c2('0x98')]=[{'all':!![]}];}_0xf6f332=_[_0xe5c2('0x82')]({},_0xf6f332,_0x61705f[_0xe5c2('0x53')]);return db[_0xe5c2('0x83')][_0xe5c2('0x99')](_0xf6f332)[_0xe5c2('0x27')](handleEntityNotFound(_0x5e11eb,null))[_0xe5c2('0x27')](respondWithResult(_0x5e11eb,null))[_0xe5c2('0x94')](handleError(_0x5e11eb,null));};exports[_0xe5c2('0x9a')]=function(_0x4f766b,_0x12e6cd){return db[_0xe5c2('0x83')][_0xe5c2('0x9a')](_0x4f766b[_0xe5c2('0x9b')],{})[_0xe5c2('0x27')](respondWithResult(_0x12e6cd,0xc9))[_0xe5c2('0x94')](handleError(_0x12e6cd,null));};exports[_0xe5c2('0x26')]=function(_0x3fb9c6,_0x419156){if(_0x3fb9c6[_0xe5c2('0x9b')]['id']){delete _0x3fb9c6[_0xe5c2('0x9b')]['id'];}return db[_0xe5c2('0x83')][_0xe5c2('0x99')]({'where':{'id':_0x3fb9c6['params']['id']}})[_0xe5c2('0x27')](handleEntityNotFound(_0x419156,null))[_0xe5c2('0x27')](saveUpdates(_0x3fb9c6['body'],null))[_0xe5c2('0x27')](respondWithResult(_0x419156,null))['catch'](handleError(_0x419156,null));};exports[_0xe5c2('0x9c')]=function(_0x166336,_0x21a494){return db[_0xe5c2('0x83')][_0xe5c2('0x99')]({'where':{'id':_0x166336[_0xe5c2('0x9d')]['id']}})[_0xe5c2('0x27')](handleEntityNotFound(_0x21a494,null))[_0xe5c2('0x27')](removeEntity(_0x21a494,null))[_0xe5c2('0x94')](handleError(_0x21a494,null));};exports[_0xe5c2('0x9e')]=function(_0x51bc6c,_0x5a8d5a){return db[_0xe5c2('0x83')]['describe']()[_0xe5c2('0x27')](respondWithResult(_0x5a8d5a,null))['catch'](handleError(_0x5a8d5a,null));};exports[_0xe5c2('0x9f')]=function(_0x382411,_0x15ea6d,_0x53d6c0){return db[_0xe5c2('0xa0')][_0xe5c2('0x99')]({'where':{'id':_0x382411[_0xe5c2('0x9d')]['id']}})[_0xe5c2('0x27')](handleEntityNotFound(_0x15ea6d,null))['then'](function(_0x56291d){if(_0x56291d){return _0x56291d[_0xe5c2('0x9f')](_0x382411['body'][_0xe5c2('0xa1')],_['omit'](_0x382411[_0xe5c2('0x9b')],['ids','id'])||{});}})[_0xe5c2('0x27')](respondWithResult(_0x15ea6d,null))[_0xe5c2('0x94')](handleError(_0x15ea6d,null));};exports[_0xe5c2('0xa2')]=function(_0x46d814,_0x261b6a,_0x966188){var _0x3ea6b2={'raw':![],'where':{}};var _0x38ec7d={};var _0x32bb7a={'count':0x0,'rows':[]};return db[_0xe5c2('0x83')][_0xe5c2('0xa3')]({'where':{'id':_0x46d814[_0xe5c2('0x9d')]['id']}})[_0xe5c2('0x27')](handleEntityNotFound(_0x261b6a,null))[_0xe5c2('0x27')](function(_0x176009){if(_0x176009){_0x38ec7d[_0xe5c2('0x33')]=_[_0xe5c2('0x34')](db[_0xe5c2('0xa0')][_0xe5c2('0x95')]);_0x38ec7d[_0xe5c2('0x35')]=_[_0xe5c2('0x34')](_0x46d814['query']);_0x38ec7d[_0xe5c2('0x36')]=_['intersection'](_0x38ec7d['model'],_0x38ec7d[_0xe5c2('0x35')]);_0x3ea6b2[_0xe5c2('0x38')]=_['intersection'](_0x38ec7d[_0xe5c2('0x33')],qs[_0xe5c2('0x96')](_0x46d814[_0xe5c2('0x35')][_0xe5c2('0x96')]));_0x3ea6b2[_0xe5c2('0x38')]=_0x3ea6b2['attributes'][_0xe5c2('0x39')]?_0x3ea6b2[_0xe5c2('0x38')]:_0x38ec7d[_0xe5c2('0x33')];if(!_0x46d814['query'][_0xe5c2('0x3a')](_0xe5c2('0x3b'))){_0x3ea6b2['limit']=qs[_0xe5c2('0x21')](_0x46d814[_0xe5c2('0x35')]['limit']);_0x3ea6b2[_0xe5c2('0x20')]=qs[_0xe5c2('0x20')](_0x46d814[_0xe5c2('0x35')][_0xe5c2('0x20')]);}_0x3ea6b2[_0xe5c2('0x3c')]=qs[_0xe5c2('0x3d')](_0x46d814['query'][_0xe5c2('0x3d')]);_0x3ea6b2['where']=qs[_0xe5c2('0x36')](_[_0xe5c2('0x3e')](_0x46d814[_0xe5c2('0x35')],_0x38ec7d[_0xe5c2('0x36')]));_0x3ea6b2[_0xe5c2('0x67')][_0xe5c2('0xa4')]=_0x176009['id'];if(_0x46d814[_0xe5c2('0x35')][_0xe5c2('0x6b')]){_0x3ea6b2[_0xe5c2('0x67')]=_[_0xe5c2('0x82')](_0x3ea6b2[_0xe5c2('0x67')],{'$or':_[_0xe5c2('0x2d')](_0x3ea6b2['attributes'],function(_0x5d1038){var _0x4cf953={};_0x4cf953[_0x5d1038]={'$like':'%'+_0x46d814[_0xe5c2('0x35')][_0xe5c2('0x6b')]+'%'};return _0x4cf953;})});}if(_0x46d814[_0xe5c2('0x35')]['$gte']){var _0x3cbc32=_0x46d814['query'][_0xe5c2('0x64')][_0xe5c2('0xa5')](',');var _0x3b6c4d={};_0x3b6c4d[_0x3cbc32[0x0]]={'$gte':moment(_0x3cbc32[0x1])[_0xe5c2('0xa6')](_0xe5c2('0xa7'))};_0x3ea6b2['where']=_[_0xe5c2('0x82')](_0x3ea6b2['where'],_0x3b6c4d);}_0x3ea6b2=_['merge']({},_0x3ea6b2,_0x46d814[_0xe5c2('0x53')]);return db[_0xe5c2('0xa0')][_0xe5c2('0x81')]({'where':_0x3ea6b2[_0xe5c2('0x67')]})[_0xe5c2('0x27')](function(_0x188128){_0x32bb7a[_0xe5c2('0x81')]=_0x188128;if(_0x46d814[_0xe5c2('0x35')]['includeAll']){_0x3ea6b2[_0xe5c2('0x98')]=[{'all':!![]}];}return db['FaxMessage'][_0xe5c2('0xa8')](_0x3ea6b2);})['then'](function(_0x2ac989){_0x32bb7a[_0xe5c2('0x93')]=_0x2ac989;return _0x32bb7a;});}})[_0xe5c2('0x27')](respondWithFilteredResult(_0x261b6a,_0x3ea6b2))[_0xe5c2('0x94')](handleError(_0x261b6a,null));};exports[_0xe5c2('0xa9')]=function(_0x1edb69,_0x3a9285,_0x50f78d){return db[_0xe5c2('0x83')][_0xe5c2('0x99')]({'where':{'id':_0x1edb69[_0xe5c2('0x9d')]['id']}})[_0xe5c2('0x27')](handleEntityNotFound(_0x3a9285,null))[_0xe5c2('0x27')](function(_0x3388ea){if(_0x3388ea){return _0x3388ea[_0xe5c2('0xaa')](_0x1edb69[_0xe5c2('0x9b')][_0xe5c2('0xa1')],_[_0xe5c2('0xab')](_0x1edb69[_0xe5c2('0x9b')],[_0xe5c2('0xa1'),'id'])||{})['spread'](function(){return db[_0xe5c2('0xac')][_0xe5c2('0xa8')]({'attributes':['id','name',_0xe5c2('0xad')],'where':{'id':_0x1edb69[_0xe5c2('0x9b')]['ids']}});})['then'](function(_0x40d7ea){socket[_0xe5c2('0xae')]('faxInteractionTags:save',{'id':Number(_0x1edb69['params']['id']),'tags':_0x40d7ea||[]});return{'id':Number(_0x1edb69[_0xe5c2('0x9d')]['id']),'tags':_0x40d7ea||[]};});}})[_0xe5c2('0x27')](respondWithResult(_0x3a9285,null))[_0xe5c2('0x94')](handleError(_0x3a9285,null));};exports[_0xe5c2('0xaf')]=function(_0x158e41,_0x168421,_0x4c2b42){return db['FaxInteraction'][_0xe5c2('0x99')]({'where':{'id':_0x158e41['params']['id']}})['then'](handleEntityNotFound(_0x168421,null))['then'](function(_0xcef6d1){if(_0xcef6d1){return _0xcef6d1[_0xe5c2('0xaf')](_0x158e41[_0xe5c2('0x35')][_0xe5c2('0xa1')]);}})[_0xe5c2('0x27')](respondWithStatusCode(_0x168421,null))['catch'](handleError(_0x168421,null));};exports[_0xe5c2('0xb0')]=function(_0x155646,_0x3cd635){var _0x2d0691=moment()[_0xe5c2('0xb1')]()['toString']();var _0x362e41=path[_0xe5c2('0xb2')](config[_0xe5c2('0xb3')],'server',_0xe5c2('0xb4'),_0xe5c2('0xb5'));var _0x393cbd=path[_0xe5c2('0xb2')](config[_0xe5c2('0xb3')],_0xe5c2('0xb6'),'files','tmp');var _0x41c383=path[_0xe5c2('0xb2')](_0x393cbd,_0x2d0691);var _0x1eb1d5=util['format'](_0xe5c2('0xb7'),_0x2d0691);var _0x537dce=path[_0xe5c2('0xb2')](_0x393cbd,_0x1eb1d5);var _0x428221=![];return db[_0xe5c2('0x83')][_0xe5c2('0x99')]({'where':{'id':_0x155646[_0xe5c2('0x9d')]['id']}})[_0xe5c2('0x27')](handleEntityNotFound(_0x3cd635,null))[_0xe5c2('0x27')](function(_0x15492c){if(_0x15492c){return _0x15492c[_0xe5c2('0xa2')]({'attributes':['id',_0xe5c2('0x9b'),_0xe5c2('0x63')],'include':[{'model':db[_0xe5c2('0xb8')],'as':_0xe5c2('0xb8')}]});}return[];})[_0xe5c2('0x27')](function(_0x1767a6){_0x428221=_0x1767a6[_0xe5c2('0x39')];if(_0x1767a6[_0xe5c2('0x39')]){fs[_0xe5c2('0xb9')](_0x41c383);for(var _0x3ebc6b=0x0;_0x3ebc6b<_0x1767a6[_0xe5c2('0x39')];_0x3ebc6b++){var _0x364836=_0x1767a6[_0x3ebc6b];var _0x55e7d7=_0x364836['Attachment'];if(_0x55e7d7){var _0x50e2bd=path['join'](_0x362e41,_0x55e7d7['basename']);if(fs[_0xe5c2('0xba')](_0x50e2bd)){fs[_0xe5c2('0xbb')](_0x50e2bd)['pipe'](fs[_0xe5c2('0xbc')](path['join'](_0x41c383,_0x55e7d7['basename'])));}}}}})[_0xe5c2('0x27')](function(){if(_0x428221){return new BPromise(function(_0x25ac66,_0x37ba63){zipdir(_0x41c383,{'saveTo':_0x537dce},function(_0x2b1e7f,_0x2f98d0){if(_0x2b1e7f)return _0x37ba63(_0x2b1e7f);return _0x25ac66(_0x2f98d0);});});}})['then'](function(){if(_0x428221){return new BPromise(function(_0x5c6a2d,_0xc5fdc0){rimraf(_0x41c383,function(_0x4ee2ee){if(_0x4ee2ee)_0xc5fdc0(_0x4ee2ee);return _0x5c6a2d();});});}})[_0xe5c2('0x27')](function(){if(_0x428221){return _0x3cd635[_0xe5c2('0xb0')](_0x537dce,_0x1eb1d5,function(_0x301c9d){if(_0x301c9d){console[_0xe5c2('0xbd')](_0xe5c2('0xbe'),_0x301c9d);}else{fs[_0xe5c2('0xbf')](_0x537dce);}});}else{return _0x3cd635['sendStatus'](0xc8);}})['catch'](handleError(_0x3cd635,null));}; \ No newline at end of file +var _0x0178=['getConditionValue','isRangeCondition','table','$between','having','length','`\x20=\x200','`\x20>\x200','filter','isNil','isEmpty','FaxAccountId','i.FaxAccountId\x20IN\x20?','concat','createdAt','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20>\x200','replace','\x27\x27\x27\x27','i.id\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','SELECT','clone','unreadMessages','DESC','isArray','tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','fax_interaction_has_tags','it.FaxInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','TagId','mail_interaction_has_tags','it.MailInteractionId\x20=\x20i.id','t.id\x20IN\x20?','sequelize','keyBy','merge','FaxInteraction','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','Account.key','Account.mandatoryDisposition','c.firstName','Contact.firstName','c.lastName','Contact.lastName','Contact.phone','c.fax','Contact.fax','toString','ui.FaxInteractionId\x20IN\x20?','groupBy','FaxInteractionId','all','rows','show','params','rawAttributes','include','find','create','body','describe','addMessage','ids','getMessages','findOne','nolimit','split','YYYY-MM-DD\x20HH:mm:ss','FaxMessage','includeAll','addTags','setTags','spread','findAll','color','faxInteractionTags:save','removeTags','download','unix','join','server','files','attachments','root','tmp','Attachment','mkdirSync','basename','createWriteStream','err','unlinkSync','html-pdf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./faxInteraction.socket','status','end','count','offset','limit','set','apply','reject','save','destroy','then','sendStatus','error','stack','name','Users','map','TagIds','forEach','Tags','push','catch','keys','query','filters','intersection','attributes','model','fields','hasOwnProperty','order','sort','where','pick','select','field','from','tools_tags','u.id','ui.FaxInteractionId','left_join','fax_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','users','o.id\x20=\x20i.UserId','a.id\x20=\x20i.FaxAccountId','fax_messages','me.FaxInteractionId\x20=\x20i.id','advancedFilter','parse','omit','matchType','omitBy','options','custom','columns','expr','hasMultipleConditions','value','values','parseOperator'];(function(_0x1241ee,_0x42086e){var _0x53c0d4=function(_0x4be589){while(--_0x4be589){_0x1241ee['push'](_0x1241ee['shift']());}};_0x53c0d4(++_0x42086e);}(_0x0178,0x1e6));var _0x8017=function(_0x55a77,_0x53446a){_0x55a77=_0x55a77-0x0;var _0x1c4f87=_0x0178[_0x55a77];return _0x1c4f87;};'use strict';var pdf=require(_0x8017('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x8017('0x1'));var jsonpatch=require(_0x8017('0x2'));var rp=require(_0x8017('0x3'));var moment=require(_0x8017('0x4'));var BPromise=require(_0x8017('0x5'));var Mustache=require(_0x8017('0x6'));var util=require('util');var path=require(_0x8017('0x7'));var sox=require(_0x8017('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x8017('0x9'));var crypto=require(_0x8017('0xa'));var jsforce=require(_0x8017('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x8017('0xc'));var querystring=require(_0x8017('0xd'));var Papa=require(_0x8017('0xe'));var Redis=require(_0x8017('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x8017('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x8017('0x11'))('api');var utils=require(_0x8017('0x12'));var config=require(_0x8017('0x13'));var db=require(_0x8017('0x14'))['db'];config[_0x8017('0x15')]=_[_0x8017('0x16')](config[_0x8017('0x15')],{'host':'localhost','port':0x18eb});var socket=require(_0x8017('0x17'))(new Redis(config[_0x8017('0x15')]));require(_0x8017('0x18'))['register'](socket);function respondWithStatusCode(_0x38ef49,_0x444981){_0x444981=_0x444981||0xcc;return function(_0x5a21c0){if(_0x5a21c0){return _0x38ef49['sendStatus'](_0x444981);}return _0x38ef49[_0x8017('0x19')](_0x444981)[_0x8017('0x1a')]();};}function respondWithResult(_0x3d7bda,_0x142760){_0x142760=_0x142760||0xc8;return function(_0xe85267){if(_0xe85267){return _0x3d7bda['status'](_0x142760)['json'](_0xe85267);}};}function respondWithFilteredResult(_0x37cfdf,_0x38458c){return function(_0xb90de3){if(_0xb90de3){var _0x1538e6=_0xb90de3[_0x8017('0x1b')],_0x3d676b=_0x38458c['offset'],_0x1f5c5c=_0x38458c[_0x8017('0x1c')]+_0x38458c[_0x8017('0x1d')],_0x9038f5;if(_0x1f5c5c>=_0x1538e6){_0x1f5c5c=_0x1538e6;_0x9038f5=0xc8;}else{_0x9038f5=0xce;}_0x37cfdf['status'](_0x9038f5);return _0x37cfdf[_0x8017('0x1e')]('Content-Range',_0x3d676b+'-'+_0x1f5c5c+'/'+_0x1538e6)['json'](_0xb90de3);}return null;};}function patchUpdates(_0x2a5d2b){return function(_0x5ac156){try{jsonpatch[_0x8017('0x1f')](_0x5ac156,_0x2a5d2b,!![]);}catch(_0x42811f){return BPromise[_0x8017('0x20')](_0x42811f);}return _0x5ac156[_0x8017('0x21')]();};}function saveUpdates(_0x2ea88a,_0x358523){return function(_0x27642f){if(_0x27642f){return _0x27642f['update'](_0x2ea88a)['then'](function(_0x972b95){return _0x972b95;});}return null;};}function removeEntity(_0x1f7386,_0x31f849){return function(_0x4683b2){if(_0x4683b2){return _0x4683b2[_0x8017('0x22')]()[_0x8017('0x23')](function(){_0x1f7386['status'](0xcc)[_0x8017('0x1a')]();});}};}function handleEntityNotFound(_0x816371,_0x3f9e06){return function(_0x2a482c){if(!_0x2a482c){_0x816371[_0x8017('0x24')](0x194);}return _0x2a482c;};}function handleError(_0x446c73,_0x23b723){_0x23b723=_0x23b723||0x1f4;return function(_0x366815){logger[_0x8017('0x25')](_0x366815[_0x8017('0x26')]);if(_0x366815[_0x8017('0x27')]){delete _0x366815[_0x8017('0x27')];}_0x446c73[_0x8017('0x19')](_0x23b723)['send'](_0x366815);};}function getInteractionUsers(_0x1b4596,_0xe4eef0){return new BPromise(function(_0x34408a,_0x556708){try{if(_0xe4eef0[_0x1b4596['id']]){_0x1b4596[_0x8017('0x28')]=_[_0x8017('0x29')](_0xe4eef0[_0x1b4596['id']],function(_0x375ac1){return{'id':_0x375ac1['id']};});}}catch(_0x602ffd){_0x556708(_0x602ffd);}_0x34408a(_0x1b4596);});}function getInteractionTags(_0x1bf050,_0x45c82c){return new BPromise(function(_0x739ace,_0x47402f){try{if(_0x1bf050[_0x8017('0x2a')]){_0x1bf050['Tags']=[];_0x1bf050[_0x8017('0x2a')]['split'](',')[_0x8017('0x2b')](function(_0x197aec){_0x1bf050[_0x8017('0x2c')][_0x8017('0x2d')](_0x45c82c[_0x197aec]);});}delete _0x1bf050[_0x8017('0x2a')];}catch(_0x4c04a5){_0x47402f(_0x4c04a5);}_0x739ace(_0x1bf050);});}function updateFaxInteraction(_0x164fd4,_0x15b52f,_0x362b5a){return new BPromise(function(_0x39a716,_0x3ac79b){return getInteractionUsers(_0x164fd4,_0x362b5a)['then'](function(_0xd1115a){return getInteractionTags(_0xd1115a,_0x15b52f);})[_0x8017('0x23')](function(_0x4fbba5){_0x39a716(_0x4fbba5);})[_0x8017('0x2e')](function(_0x24a38c){_0x3ac79b(_0x24a38c);});});}exports['index']=function(_0x5443e3,_0x2c5dca){var _0xf515b2={},_0x1abaef={},_0x228043={'count':0x0,'rows':[]};var _0x232c71=db['FaxInteraction']['rawAttributes'];_0x1abaef['model']=_[_0x8017('0x2f')](_0x232c71);_0x1abaef[_0x8017('0x30')]=_[_0x8017('0x2f')](_0x5443e3[_0x8017('0x30')]);_0x1abaef[_0x8017('0x31')]=_[_0x8017('0x32')](_0x1abaef['model'],_0x1abaef[_0x8017('0x30')]);_0xf515b2[_0x8017('0x33')]=_[_0x8017('0x32')](_0x1abaef[_0x8017('0x34')],qs[_0x8017('0x35')](_0x5443e3[_0x8017('0x30')][_0x8017('0x35')]));_0xf515b2[_0x8017('0x33')]=_0xf515b2[_0x8017('0x33')]['length']?_0xf515b2['attributes']:_0x1abaef[_0x8017('0x34')];if(!_0x5443e3[_0x8017('0x30')][_0x8017('0x36')]('nolimit')){_0xf515b2[_0x8017('0x1d')]=qs[_0x8017('0x1d')](_0x5443e3[_0x8017('0x30')][_0x8017('0x1d')]);_0xf515b2[_0x8017('0x1c')]=qs['offset'](_0x5443e3[_0x8017('0x30')][_0x8017('0x1c')]);}_0xf515b2[_0x8017('0x37')]=qs[_0x8017('0x38')](_0x5443e3[_0x8017('0x30')][_0x8017('0x38')]);_0xf515b2[_0x8017('0x39')]=qs['filters'](_[_0x8017('0x3a')](_0x5443e3['query'],_0x1abaef[_0x8017('0x31')]));var _0x2ba6af=[];var _0x34b524=squel[_0x8017('0x3b')]()[_0x8017('0x3c')]('id')[_0x8017('0x3c')](_0x8017('0x27'))['field']('color')[_0x8017('0x3d')](_0x8017('0x3e'));var _0x35e1f8=squel[_0x8017('0x3b')]()[_0x8017('0x3c')](_0x8017('0x3f'))[_0x8017('0x3c')](_0x8017('0x40'))['from']('user_has_fax_interactions','ui')[_0x8017('0x41')]('users','u','u.id\x20=\x20ui.UserId');var _0x219d6c=squel[_0x8017('0x3b')]()[_0x8017('0x3d')](_0x8017('0x42'),'i')[_0x8017('0x41')](_0x8017('0x43'),'c',_0x8017('0x44'))[_0x8017('0x41')](_0x8017('0x45'),'o',_0x8017('0x46'))[_0x8017('0x41')]('fax_accounts','a',_0x8017('0x47'))['left_join'](_0x8017('0x48'),'me',_0x8017('0x49'));var _0x13e6c2=squel['expr']();var _0x9a1af7=_0x5443e3[_0x8017('0x30')][_0x8017('0x4a')]?JSON[_0x8017('0x4b')](_0x5443e3['query'][_0x8017('0x4a')]):undefined;if(_0x9a1af7){var _0x3afc6a=_0x9a1af7['matchType']['substr'](0x1);_(_0x9a1af7)[_0x8017('0x4c')](_0x8017('0x4d'))[_0x8017('0x4e')](function(_0x271cf6,_0x417031){return _0x271cf6[_0x8017('0x4f')][_0x8017('0x50')]===!![];})[_0x8017('0x2f')]()[_0x8017('0x2b')](function(_0x27c17a){var _0x52400b=_0x9a1af7[_0x27c17a];if(_0x52400b[_0x8017('0x4f')][_0x8017('0x51')]){var _0xb4a9c9=squel[_0x8017('0x52')]();if(as[_0x8017('0x53')](_0x52400b[_0x8017('0x54')])){var _0x2a8227=_[_0x8017('0x55')](_0x52400b['value'])[0x0];_0x2a8227[_0x8017('0x2b')](function(_0x5a19a7){_0x52400b[_0x8017('0x4f')][_0x8017('0x51')][_0x8017('0x2b')](function(_0x4ac455){_0xb4a9c9['or'](_0x52400b[_0x8017('0x4f')]['table']+'.'+_0x4ac455+'\x20'+as[_0x8017('0x56')](_0x5a19a7),as[_0x8017('0x57')](_0x5a19a7));});});}else{var _0x1fda66=as[_0x8017('0x58')](_0x52400b[_0x8017('0x54')])?_0x52400b[_0x8017('0x54')][0x1]:undefined;_0x52400b[_0x8017('0x4f')][_0x8017('0x51')][_0x8017('0x2b')](function(_0x244fb3){_0xb4a9c9['or'](_0x52400b[_0x8017('0x4f')][_0x8017('0x59')]+'.'+_0x244fb3+'\x20'+as['parseOperator'](_0x52400b[_0x8017('0x54')]),as['getConditionValue'](_0x52400b['value']),_0x1fda66);});}_0x13e6c2[_0x3afc6a](_0xb4a9c9);}else if(as[_0x8017('0x53')](_0x52400b['value'])){var _0x2a8227=_[_0x8017('0x55')](_0x52400b['value'])[0x0];_0x2a8227[_0x8017('0x2b')](function(_0x4844d7){if(!_0x52400b[_0x8017('0x4f')]['having']){var _0x51d282=as[_0x8017('0x58')](_0x4844d7)?_0x4844d7[_0x8017('0x5a')][0x1]:undefined;_0x13e6c2[_0x3afc6a](_0x52400b[_0x8017('0x4f')][_0x8017('0x59')]+'.'+_0x27c17a+'\x20'+as[_0x8017('0x56')](_0x4844d7),as[_0x8017('0x57')](_0x4844d7),_0x51d282);}});}else{if(_0x52400b[_0x8017('0x4f')][_0x8017('0x5b')]){var _0x480d34=as[_0x8017('0x57')](_0x52400b['value']);if(_0x480d34[_0x8017('0x5c')]===0x1){if(_0x480d34==0x1){_0x219d6c[_0x8017('0x5b')]('`'+_0x27c17a+_0x8017('0x5d'));}else{_0x219d6c[_0x8017('0x5b')]('`'+_0x27c17a+_0x8017('0x5e'));}}}else{var _0x1fda66=as['isRangeCondition'](_0x52400b[_0x8017('0x54')])?_0x52400b['value']['$between'][0x1]:undefined;_0x13e6c2[_0x3afc6a](_0x52400b[_0x8017('0x4f')]['table']+'.'+_0x27c17a+'\x20'+as[_0x8017('0x56')](_0x52400b[_0x8017('0x54')]),as[_0x8017('0x57')](_0x52400b['value']),_0x1fda66);}}});}else{var _0x2209a6=_(Object[_0x8017('0x2f')](_0x5443e3[_0x8017('0x30')]))[_0x8017('0x29')](function(_0x50e3a4){return _0x232c71[_0x8017('0x36')](_0x50e3a4)?_0x50e3a4:undefined;})[_0x8017('0x5f')](function(_0x533a56){return!_[_0x8017('0x60')](_0x533a56);})['value']();if(!_[_0x8017('0x61')](_0x2209a6)){_0x2209a6[_0x8017('0x2b')](function(_0x56e756){if(_0x56e756===_0x8017('0x62')){_0x219d6c[_0x8017('0x39')](_0x8017('0x63'),[][_0x8017('0x64')](_0x5443e3[_0x8017('0x30')][_0x56e756]));}else if(_0x56e756===_0x8017('0x65')){var _0x46a719=JSON[_0x8017('0x4b')](_0x5443e3[_0x8017('0x30')][_0x56e756])[_0x8017('0x66')];var _0x3798e7=JSON[_0x8017('0x4b')](_0x5443e3['query'][_0x56e756])[_0x8017('0x67')];_0x219d6c[_0x8017('0x39')](_0x8017('0x68'),_0x46a719,_0x3798e7);}else{if(_0x5443e3[_0x8017('0x30')][_0x56e756]===_0x8017('0x69')){_0x219d6c[_0x8017('0x39')]('i.'+_0x56e756+_0x8017('0x6a'));}else{_0x219d6c[_0x8017('0x39')]('i.'+_0x56e756+_0x8017('0x6b'),_0x5443e3[_0x8017('0x30')][_0x56e756]);}}});}if(_0x5443e3['query'][_0x8017('0x6c')]){if(_0x5443e3['query'][_0x8017('0x6c')]==0x1){_0x219d6c[_0x8017('0x5b')]('`unreadMessages`\x20=\x200');}else{_0x219d6c['having'](_0x8017('0x6d'));}}if(_0x5443e3[_0x8017('0x30')][_0x8017('0x5f')]){var _0x48c8d0=_0x5443e3[_0x8017('0x30')][_0x8017('0x5f')][_0x8017('0x6e')]('\x5c','\x5c\x5c')[_0x8017('0x6e')]('\x27\x27',_0x8017('0x6f'));if(qs['isNumeric'](_0x48c8d0)){_0x13e6c2['or'](_0x8017('0x70'),_0x48c8d0+'%')['or']('i.fax\x20LIKE\x20?',_0x48c8d0+'%');}_0x13e6c2['or'](_0x8017('0x71'),_0x48c8d0+'%');}}_0x219d6c[_0x8017('0x39')](_0x13e6c2);_0x219d6c[_0x8017('0x72')](_0x8017('0x73'));var _0x3e0383={'type':db[_0x8017('0x74')][_0x8017('0x75')][_0x8017('0x76')],'raw':!![]};var _0x321e43=_0x219d6c[_0x8017('0x77')]();_0x321e43['field'](_0x8017('0x73'));_0x321e43[_0x8017('0x3c')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x8017('0x78'));if(_0xf515b2['order']){_0xf515b2[_0x8017('0x37')][_0x8017('0x2b')](function(_0x40aff1){_0x219d6c[_0x8017('0x37')]('i.'+_0x40aff1[0x0],_0x40aff1[0x1]===_0x8017('0x79')?![]:!![]);});}var _0x4da848=[];var _0xbf1cc6=squel[_0x8017('0x52')]();if(!_0x9a1af7){if(_0x5443e3[_0x8017('0x30')]['tag']){_0x4da848=_[_0x8017('0x7a')](_0x5443e3[_0x8017('0x30')][_0x8017('0x7b')])?_0x5443e3[_0x8017('0x30')][_0x8017('0x7b')]:new Array(_0x5443e3['query'][_0x8017('0x7b')]);_0x4da848[_0x8017('0x2b')](function(_0x1b71cd){_0xbf1cc6['or'](_0x8017('0x7c'),'%,'+_0x1b71cd+',%');});_0x219d6c[_0x8017('0x5b')](_0xbf1cc6);_0x321e43[_0x8017('0x41')](_0x8017('0x7d'),'it',_0x8017('0x7e'));_0x321e43[_0x8017('0x41')](_0x8017('0x3e'),'t',_0x8017('0x7f'));_0x321e43[_0x8017('0x39')]('t.id\x20IN\x20?',_0x4da848);}}else{if(_0x9a1af7[_0x8017('0x36')](_0x8017('0x80'))){if(as[_0x8017('0x53')](_0x9a1af7[_0x8017('0x80')]['value'])){var _0x5017b6=_[_0x8017('0x55')](_0x9a1af7[_0x8017('0x80')][_0x8017('0x54')])[0x0];_0x5017b6[_0x8017('0x2b')](function(_0x3e471c){as[_0x8017('0x57')](_0x3e471c)['forEach'](function(_0x3011b8){_0x4da848[_0x8017('0x2d')](_0x3011b8);});});}else{_0x4da848=as['getConditionValue'](_0x9a1af7[_0x8017('0x80')]['value']);}_0x4da848[_0x8017('0x2b')](function(_0x58273a){_0xbf1cc6['or'](_0x8017('0x7c'),'%,'+_0x58273a+',%');});_0x219d6c[_0x8017('0x5b')](_0xbf1cc6);_0x321e43[_0x8017('0x41')](_0x8017('0x81'),'it',_0x8017('0x82'));_0x321e43[_0x8017('0x41')]('tools_tags','t','t.id\x20=\x20it.TagId');_0x321e43['where'](_0x8017('0x83'),_0x4da848);}}db[_0x8017('0x84')][_0x8017('0x30')](_0x321e43['toString'](),_0x3e0383)[_0x8017('0x23')](function(_0xb4b4df){_0x228043[_0x8017('0x1b')]=_0xb4b4df['length'];if(_0x228043[_0x8017('0x1b')]===0x0)return[];return db['sequelize'][_0x8017('0x30')](_0x34b524['toString'](),_0x3e0383)[_0x8017('0x23')](function(_0x5eb2c8){_0x2ba6af=_[_0x8017('0x85')](_0x5eb2c8,'id');_0x3e0383=_[_0x8017('0x86')](_0x3e0383,{'model':db[_0x8017('0x87')],'mapToModel':!![],'raw':!![],'nest':!![]});_0x219d6c[_0x8017('0x3c')](_0x8017('0x88'),_0x8017('0x78'));_0x219d6c[_0x8017('0x3c')](_0x8017('0x89'),_0x8017('0x8a'));_0x219d6c[_0x8017('0x3c')]('a.mandatoryDisposition',_0x8017('0x8b'));_0x219d6c[_0x8017('0x3c')]('i.*');_0x219d6c[_0x8017('0x3c')](_0x8017('0x8c'),_0x8017('0x8d'));_0x219d6c[_0x8017('0x3c')](_0x8017('0x8e'),_0x8017('0x8f'));_0x219d6c['field']('c.email','Contact.email');_0x219d6c[_0x8017('0x3c')]('c.phone',_0x8017('0x90'));_0x219d6c[_0x8017('0x3c')]('c.mobile','Contact.mobile');_0x219d6c[_0x8017('0x3c')](_0x8017('0x91'),_0x8017('0x92'));_0x219d6c[_0x8017('0x3c')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x8017('0x2a'));_0x219d6c[_0x8017('0x41')]('fax_interaction_has_tags','it',_0x8017('0x7e'));_0x219d6c['left_join'](_0x8017('0x3e'),'t','t.id\x20=\x20it.TagId');_0x219d6c['limit'](_0xf515b2[_0x8017('0x1d')]);_0x219d6c['offset'](_0xf515b2[_0x8017('0x1c')]);return db[_0x8017('0x84')][_0x8017('0x30')](_0x219d6c[_0x8017('0x93')](),_0x3e0383);})[_0x8017('0x23')](function(_0x5dbc3f){_0x35e1f8['where'](_0x8017('0x94'),_[_0x8017('0x29')](_0x5dbc3f,'id'));return db['sequelize'][_0x8017('0x30')](_0x35e1f8['toString'](),_0x3e0383)['then'](function(_0xddf714){var _0x2b8903=_[_0x8017('0x95')](_0xddf714,_0x8017('0x96'));var _0x5b7b53=[];_0x5dbc3f[_0x8017('0x2b')](function(_0x872604){_0x5b7b53['push'](updateFaxInteraction(_0x872604,_0x2ba6af,_0x2b8903));});return BPromise[_0x8017('0x97')](_0x5b7b53);});});})[_0x8017('0x23')](function(_0x48dd2){_0x228043[_0x8017('0x98')]=_0x48dd2;return _0x228043;})[_0x8017('0x23')](respondWithFilteredResult(_0x2c5dca,_0xf515b2))[_0x8017('0x2e')](handleError(_0x2c5dca,null));};exports[_0x8017('0x99')]=function(_0x3d01ce,_0x117708){var _0xed1ffc={'raw':![],'where':{'id':_0x3d01ce[_0x8017('0x9a')]['id']}},_0x43b867={};_0x43b867[_0x8017('0x34')]=_[_0x8017('0x2f')](db[_0x8017('0x87')][_0x8017('0x9b')]);_0x43b867['query']=_[_0x8017('0x2f')](_0x3d01ce['query']);_0x43b867['filters']=_['intersection'](_0x43b867[_0x8017('0x34')],_0x43b867[_0x8017('0x30')]);_0xed1ffc[_0x8017('0x33')]=_['intersection'](_0x43b867[_0x8017('0x34')],qs[_0x8017('0x35')](_0x3d01ce[_0x8017('0x30')][_0x8017('0x35')]));_0xed1ffc[_0x8017('0x33')]=_0xed1ffc['attributes']['length']?_0xed1ffc[_0x8017('0x33')]:_0x43b867[_0x8017('0x34')];if(_0x3d01ce[_0x8017('0x30')]['includeAll']){_0xed1ffc[_0x8017('0x9c')]=[{'all':!![]}];}_0xed1ffc=_['merge']({},_0xed1ffc,_0x3d01ce[_0x8017('0x4f')]);return db[_0x8017('0x87')][_0x8017('0x9d')](_0xed1ffc)[_0x8017('0x23')](handleEntityNotFound(_0x117708,null))[_0x8017('0x23')](respondWithResult(_0x117708,null))[_0x8017('0x2e')](handleError(_0x117708,null));};exports['create']=function(_0x2c1355,_0x23c796){return db[_0x8017('0x87')][_0x8017('0x9e')](_0x2c1355[_0x8017('0x9f')],{})[_0x8017('0x23')](respondWithResult(_0x23c796,0xc9))[_0x8017('0x2e')](handleError(_0x23c796,null));};exports['update']=function(_0x549cf0,_0x440fb4){if(_0x549cf0[_0x8017('0x9f')]['id']){delete _0x549cf0[_0x8017('0x9f')]['id'];}return db[_0x8017('0x87')][_0x8017('0x9d')]({'where':{'id':_0x549cf0[_0x8017('0x9a')]['id']}})[_0x8017('0x23')](handleEntityNotFound(_0x440fb4,null))[_0x8017('0x23')](saveUpdates(_0x549cf0['body'],null))[_0x8017('0x23')](respondWithResult(_0x440fb4,null))['catch'](handleError(_0x440fb4,null));};exports[_0x8017('0x22')]=function(_0x2b66b5,_0x1ea2e9){return db[_0x8017('0x87')][_0x8017('0x9d')]({'where':{'id':_0x2b66b5[_0x8017('0x9a')]['id']}})[_0x8017('0x23')](handleEntityNotFound(_0x1ea2e9,null))[_0x8017('0x23')](removeEntity(_0x1ea2e9,null))[_0x8017('0x2e')](handleError(_0x1ea2e9,null));};exports[_0x8017('0xa0')]=function(_0x439d69,_0x18bd17){return db[_0x8017('0x87')][_0x8017('0xa0')]()['then'](respondWithResult(_0x18bd17,null))[_0x8017('0x2e')](handleError(_0x18bd17,null));};exports[_0x8017('0xa1')]=function(_0x208349,_0x43e44a,_0x4cf51e){return db['FaxMessage'][_0x8017('0x9d')]({'where':{'id':_0x208349[_0x8017('0x9a')]['id']}})[_0x8017('0x23')](handleEntityNotFound(_0x43e44a,null))['then'](function(_0xa7453d){if(_0xa7453d){return _0xa7453d[_0x8017('0xa1')](_0x208349['body'][_0x8017('0xa2')],_[_0x8017('0x4c')](_0x208349[_0x8017('0x9f')],['ids','id'])||{});}})['then'](respondWithResult(_0x43e44a,null))[_0x8017('0x2e')](handleError(_0x43e44a,null));};exports[_0x8017('0xa3')]=function(_0x45e48b,_0xa7d23a,_0x518ed4){var _0x376895={'raw':![],'where':{}};var _0x5d083e={};var _0x3ebf0e={'count':0x0,'rows':[]};return db[_0x8017('0x87')][_0x8017('0xa4')]({'where':{'id':_0x45e48b['params']['id']}})['then'](handleEntityNotFound(_0xa7d23a,null))[_0x8017('0x23')](function(_0xc71bf4){if(_0xc71bf4){_0x5d083e[_0x8017('0x34')]=_[_0x8017('0x2f')](db['FaxMessage'][_0x8017('0x9b')]);_0x5d083e[_0x8017('0x30')]=_[_0x8017('0x2f')](_0x45e48b[_0x8017('0x30')]);_0x5d083e[_0x8017('0x31')]=_[_0x8017('0x32')](_0x5d083e[_0x8017('0x34')],_0x5d083e[_0x8017('0x30')]);_0x376895['attributes']=_[_0x8017('0x32')](_0x5d083e[_0x8017('0x34')],qs[_0x8017('0x35')](_0x45e48b[_0x8017('0x30')][_0x8017('0x35')]));_0x376895[_0x8017('0x33')]=_0x376895[_0x8017('0x33')][_0x8017('0x5c')]?_0x376895['attributes']:_0x5d083e[_0x8017('0x34')];if(!_0x45e48b[_0x8017('0x30')][_0x8017('0x36')](_0x8017('0xa5'))){_0x376895[_0x8017('0x1d')]=qs['limit'](_0x45e48b[_0x8017('0x30')][_0x8017('0x1d')]);_0x376895[_0x8017('0x1c')]=qs[_0x8017('0x1c')](_0x45e48b[_0x8017('0x30')][_0x8017('0x1c')]);}_0x376895[_0x8017('0x37')]=qs[_0x8017('0x38')](_0x45e48b[_0x8017('0x30')][_0x8017('0x38')]);_0x376895[_0x8017('0x39')]=qs[_0x8017('0x31')](_[_0x8017('0x3a')](_0x45e48b['query'],_0x5d083e[_0x8017('0x31')]));_0x376895[_0x8017('0x39')][_0x8017('0x96')]=_0xc71bf4['id'];if(_0x45e48b[_0x8017('0x30')][_0x8017('0x5f')]){_0x376895[_0x8017('0x39')]=_[_0x8017('0x86')](_0x376895[_0x8017('0x39')],{'$or':_['map'](_0x376895['attributes'],function(_0xea017f){var _0x2d126c={};_0x2d126c[_0xea017f]={'$like':'%'+_0x45e48b[_0x8017('0x30')]['filter']+'%'};return _0x2d126c;})});}if(_0x45e48b[_0x8017('0x30')][_0x8017('0x66')]){var _0x33398a=_0x45e48b['query'][_0x8017('0x66')][_0x8017('0xa6')](',');var _0x279c6f={};_0x279c6f[_0x33398a[0x0]]={'$gte':moment(_0x33398a[0x1])['format'](_0x8017('0xa7'))};_0x376895[_0x8017('0x39')]=_[_0x8017('0x86')](_0x376895[_0x8017('0x39')],_0x279c6f);}_0x376895=_['merge']({},_0x376895,_0x45e48b['options']);return db[_0x8017('0xa8')]['count']({'where':_0x376895[_0x8017('0x39')]})[_0x8017('0x23')](function(_0x13bd3e){_0x3ebf0e[_0x8017('0x1b')]=_0x13bd3e;if(_0x45e48b[_0x8017('0x30')][_0x8017('0xa9')]){_0x376895[_0x8017('0x9c')]=[{'all':!![]}];}return db[_0x8017('0xa8')]['findAll'](_0x376895);})[_0x8017('0x23')](function(_0x5ba4bf){_0x3ebf0e[_0x8017('0x98')]=_0x5ba4bf;return _0x3ebf0e;});}})[_0x8017('0x23')](respondWithFilteredResult(_0xa7d23a,_0x376895))[_0x8017('0x2e')](handleError(_0xa7d23a,null));};exports[_0x8017('0xaa')]=function(_0x3b16b8,_0x202656,_0x3170cc){return db[_0x8017('0x87')][_0x8017('0x9d')]({'where':{'id':_0x3b16b8[_0x8017('0x9a')]['id']}})['then'](handleEntityNotFound(_0x202656,null))[_0x8017('0x23')](function(_0x180bc0){if(_0x180bc0){return _0x180bc0[_0x8017('0xab')](_0x3b16b8['body'][_0x8017('0xa2')],_['omit'](_0x3b16b8[_0x8017('0x9f')],[_0x8017('0xa2'),'id'])||{})[_0x8017('0xac')](function(){return db['Tag'][_0x8017('0xad')]({'attributes':['id',_0x8017('0x27'),_0x8017('0xae')],'where':{'id':_0x3b16b8[_0x8017('0x9f')]['ids']}});})[_0x8017('0x23')](function(_0x11f4cb){socket['emit'](_0x8017('0xaf'),{'id':Number(_0x3b16b8[_0x8017('0x9a')]['id']),'tags':_0x11f4cb||[]});return{'id':Number(_0x3b16b8[_0x8017('0x9a')]['id']),'tags':_0x11f4cb||[]};});}})[_0x8017('0x23')](respondWithResult(_0x202656,null))[_0x8017('0x2e')](handleError(_0x202656,null));};exports[_0x8017('0xb0')]=function(_0x574a4c,_0x57029a,_0x32efeb){return db[_0x8017('0x87')]['find']({'where':{'id':_0x574a4c[_0x8017('0x9a')]['id']}})['then'](handleEntityNotFound(_0x57029a,null))[_0x8017('0x23')](function(_0x1f40a4){if(_0x1f40a4){return _0x1f40a4[_0x8017('0xb0')](_0x574a4c[_0x8017('0x30')][_0x8017('0xa2')]);}})[_0x8017('0x23')](respondWithStatusCode(_0x57029a,null))[_0x8017('0x2e')](handleError(_0x57029a,null));};exports[_0x8017('0xb1')]=function(_0x3f5a2a,_0x5c3d05){var _0x10c511=moment()[_0x8017('0xb2')]()[_0x8017('0x93')]();var _0x32c666=path[_0x8017('0xb3')](config['root'],_0x8017('0xb4'),_0x8017('0xb5'),_0x8017('0xb6'));var _0x8571c6=path[_0x8017('0xb3')](config[_0x8017('0xb7')],_0x8017('0xb4'),'files',_0x8017('0xb8'));var _0x3dbe93=path[_0x8017('0xb3')](_0x8571c6,_0x10c511);var _0x15fae7=util['format']('interaction-%s.zip',_0x10c511);var _0xc735ba=path['join'](_0x8571c6,_0x15fae7);var _0x24bef4=![];return db[_0x8017('0x87')]['find']({'where':{'id':_0x3f5a2a[_0x8017('0x9a')]['id']}})[_0x8017('0x23')](handleEntityNotFound(_0x5c3d05,null))[_0x8017('0x23')](function(_0x16119b){if(_0x16119b){return _0x16119b[_0x8017('0xa3')]({'attributes':['id',_0x8017('0x9f'),_0x8017('0x65')],'include':[{'model':db['Attachment'],'as':_0x8017('0xb9')}]});}return[];})[_0x8017('0x23')](function(_0x20f5d3){_0x24bef4=_0x20f5d3[_0x8017('0x5c')];if(_0x20f5d3[_0x8017('0x5c')]){fs[_0x8017('0xba')](_0x3dbe93);for(var _0x38d798=0x0;_0x38d798<_0x20f5d3[_0x8017('0x5c')];_0x38d798++){var _0x4f2531=_0x20f5d3[_0x38d798];var _0x3709c1=_0x4f2531[_0x8017('0xb9')];if(_0x3709c1){var _0x55e600=path['join'](_0x32c666,_0x3709c1[_0x8017('0xbb')]);if(fs['existsSync'](_0x55e600)){fs['createReadStream'](_0x55e600)['pipe'](fs[_0x8017('0xbc')](path[_0x8017('0xb3')](_0x3dbe93,_0x3709c1['basename'])));}}}}})[_0x8017('0x23')](function(){if(_0x24bef4){return new BPromise(function(_0x2bfaf5,_0x2a58cb){zipdir(_0x3dbe93,{'saveTo':_0xc735ba},function(_0x438d63,_0x101b74){if(_0x438d63)return _0x2a58cb(_0x438d63);return _0x2bfaf5(_0x101b74);});});}})[_0x8017('0x23')](function(){if(_0x24bef4){return new BPromise(function(_0x3c2a37,_0x375e1f){rimraf(_0x3dbe93,function(_0x2c612b){if(_0x2c612b)_0x375e1f(_0x2c612b);return _0x3c2a37();});});}})[_0x8017('0x23')](function(){if(_0x24bef4){return _0x5c3d05[_0x8017('0xb1')](_0xc735ba,_0x15fae7,function(_0x2fc15f){if(_0x2fc15f){console['log'](_0x8017('0xbd'),_0x2fc15f);}else{fs[_0x8017('0xbe')](_0xc735ba);}});}else{return _0x5c3d05[_0x8017('0x24')](0xc8);}})[_0x8017('0x2e')](handleError(_0x5c3d05,null));}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.events.js b/server/api/faxInteraction/faxInteraction.events.js index b6173d6..81da1de 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 _0x6256=['update','remove','getUsers','then','setDataValue','Users','unreadMessages','length','emit','catch','hasOwnProperty','hook','events','../../mysqldb','FaxMessage','setMaxListeners','save'];(function(_0x425271,_0x421918){var _0x386cf4=function(_0x5d8277){while(--_0x5d8277){_0x425271['push'](_0x425271['shift']());}};_0x386cf4(++_0x421918);}(_0x6256,0x182));var _0x6625=function(_0x2d2c16,_0x4e88b6){_0x2d2c16=_0x2d2c16-0x0;var _0x53f2fb=_0x6256[_0x2d2c16];return _0x53f2fb;};'use strict';var EventEmitter=require(_0x6625('0x0'));var FaxInteraction=require('../../mysqldb')['db']['FaxInteraction'];var FaxMessage=require(_0x6625('0x1'))['db'][_0x6625('0x2')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0x6625('0x3')](0x0);var events={'afterCreate':_0x6625('0x4'),'afterUpdate':_0x6625('0x5'),'afterDestroy':_0x6625('0x6')};function emitEvent(_0x1f6f24){return function(_0x210482,_0x12a423,_0x19891e){_0x210482[_0x6625('0x7')]({'attributes':['id'],'raw':!![]})[_0x6625('0x8')](function(_0x4beac7){_0x210482[_0x6625('0x9')](_0x6625('0xa'),_0x4beac7['map'](function(_0x1b8587){return{'id':_0x1b8587['id']};}));return FaxMessage['findAll']({'where':{'FaxInteractionId':_0x210482['id'],'direction':'in','read':![]},'raw':!![]});})[_0x6625('0x8')](function(_0x462aad){_0x210482['setDataValue'](_0x6625('0xb'),_0x462aad[_0x6625('0xc')]);FaxInteractionEvents['emit'](_0x1f6f24+':'+_0x210482['id'],_0x210482);FaxInteractionEvents[_0x6625('0xd')](_0x1f6f24,_0x210482);_0x19891e(null);})[_0x6625('0xe')](_0x19891e(null));};}for(var e in events){if(events[_0x6625('0xf')](e)){var event=events[e];FaxInteraction[_0x6625('0x10')](e,emitEvent(event));}}module['exports']=FaxInteractionEvents; \ No newline at end of file +var _0x8e56=['unreadMessages','length','emit','hasOwnProperty','exports','events','../../mysqldb','FaxInteraction','setMaxListeners','save','remove','getUsers','setDataValue','Users','findAll','then'];(function(_0x3ebf8d,_0x2b0c31){var _0x59d8ae=function(_0x26a51d){while(--_0x26a51d){_0x3ebf8d['push'](_0x3ebf8d['shift']());}};_0x59d8ae(++_0x2b0c31);}(_0x8e56,0x75));var _0x68e5=function(_0x113ed1,_0xc41a7c){_0x113ed1=_0x113ed1-0x0;var _0x5f08a7=_0x8e56[_0x113ed1];return _0x5f08a7;};'use strict';var EventEmitter=require(_0x68e5('0x0'));var FaxInteraction=require(_0x68e5('0x1'))['db'][_0x68e5('0x2')];var FaxMessage=require('../../mysqldb')['db']['FaxMessage'];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0x68e5('0x3')](0x0);var events={'afterCreate':_0x68e5('0x4'),'afterUpdate':'update','afterDestroy':_0x68e5('0x5')};function emitEvent(_0x188860){return function(_0x52231f,_0x117099,_0xf7b973){_0x52231f[_0x68e5('0x6')]({'attributes':['id'],'raw':!![]})['then'](function(_0x51cf36){_0x52231f[_0x68e5('0x7')](_0x68e5('0x8'),_0x51cf36['map'](function(_0x2a00e4){return{'id':_0x2a00e4['id']};}));return FaxMessage[_0x68e5('0x9')]({'where':{'FaxInteractionId':_0x52231f['id'],'direction':'in','read':![]},'raw':!![]});})[_0x68e5('0xa')](function(_0x11b039){_0x52231f[_0x68e5('0x7')](_0x68e5('0xb'),_0x11b039[_0x68e5('0xc')]);FaxInteractionEvents['emit'](_0x188860+':'+_0x52231f['id'],_0x52231f);FaxInteractionEvents[_0x68e5('0xd')](_0x188860,_0x52231f);_0xf7b973(null);})['catch'](_0xf7b973(null));};}for(var e in events){if(events[_0x68e5('0xe')](e)){var event=events[e];FaxInteraction['hook'](e,emitEvent(event));}}module[_0x68e5('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 21a091a..1ebd0d8 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 _0x2c93=['FaxInteraction','fax_interactions','changed','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxInteraction.attributes','exports','define'];(function(_0x53a109,_0x48ea22){var _0x59231=function(_0x270a20){while(--_0x270a20){_0x53a109['push'](_0x53a109['shift']());}};_0x59231(++_0x48ea22);}(_0x2c93,0x16e));var _0x32c9=function(_0x411017,_0x4a8117){_0x411017=_0x411017-0x0;var _0x2adeea=_0x2c93[_0x411017];return _0x2adeea;};'use strict';var _=require(_0x32c9('0x0'));var util=require(_0x32c9('0x1'));var logger=require(_0x32c9('0x2'))('api');var moment=require(_0x32c9('0x3'));var BPromise=require(_0x32c9('0x4'));var rp=require(_0x32c9('0x5'));var fs=require('fs');var path=require(_0x32c9('0x6'));var rimraf=require(_0x32c9('0x7'));var config=require(_0x32c9('0x8'));var attributes=require(_0x32c9('0x9'));module[_0x32c9('0xa')]=function(_0x51d6e5,_0x4b8e95){return _0x51d6e5[_0x32c9('0xb')](_0x32c9('0xc'),attributes,{'tableName':_0x32c9('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x5b5d5e,_0x83376c,_0x3f041c){if(_0x5b5d5e[_0x32c9('0xe')](_0x32c9('0xf'))){_0x5b5d5e[_0x32c9('0x10')]=moment()['format'](_0x32c9('0x11'));}_0x3f041c(null,_0x5b5d5e);}}});}; \ No newline at end of file +var _0xf829=['exports','define','FaxInteraction','fax_interactions','changed','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','bluebird','request-promise','rimraf','../../config/environment','./faxInteraction.attributes'];(function(_0x2e9ca7,_0x476d6f){var _0x33679b=function(_0x48a2f8){while(--_0x48a2f8){_0x2e9ca7['push'](_0x2e9ca7['shift']());}};_0x33679b(++_0x476d6f);}(_0xf829,0x18d));var _0x9f82=function(_0x24ccd7,_0x2eeca9){_0x24ccd7=_0x24ccd7-0x0;var _0x26aa79=_0xf829[_0x24ccd7];return _0x26aa79;};'use strict';var _=require(_0x9f82('0x0'));var util=require(_0x9f82('0x1'));var logger=require(_0x9f82('0x2'))('api');var moment=require('moment');var BPromise=require(_0x9f82('0x3'));var rp=require(_0x9f82('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9f82('0x5'));var config=require(_0x9f82('0x6'));var attributes=require(_0x9f82('0x7'));module[_0x9f82('0x8')]=function(_0xa2e818,_0x5dbe8e){return _0xa2e818[_0x9f82('0x9')](_0x9f82('0xa'),attributes,{'tableName':_0x9f82('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x446c15,_0x1479ab,_0x2241b3){if(_0x446c15[_0x9f82('0xc')]('closed')){_0x446c15['closedAt']=moment()[_0x9f82('0xd')](_0x9f82('0xe'));}_0x2241b3(null,_0x446c15);}}});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.rpc.js b/server/api/faxInteraction/faxInteraction.rpc.js index 1728587..c51fab4 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 _0x199b=['stringify','error','code','message','result','catch','UpdateFaxInteraction','options','raw','where','attributes','limit','then','AddTagsToFaxInteraction','FaxInteraction','find','body','omit','spread','AddTags','debug','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','./faxInteraction.socket','info','FaxInteraction,\x20%s,\x20%s','request\x20sent','FaxInteraction,\x20%s,\x20%s,\x20%s'];(function(_0x549c56,_0xc02b6a){var _0x385a97=function(_0x5f5c22){while(--_0x5f5c22){_0x549c56['push'](_0x549c56['shift']());}};_0x385a97(++_0xc02b6a);}(_0x199b,0x65));var _0xb199=function(_0x9bb752,_0x307f42){_0x9bb752=_0x9bb752-0x0;var _0x227c1d=_0x199b[_0x9bb752];return _0x227c1d;};'use strict';var _=require(_0xb199('0x0'));var util=require('util');var moment=require(_0xb199('0x1'));var BPromise=require(_0xb199('0x2'));var rs=require(_0xb199('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb199('0x4'))['db'];var utils=require(_0xb199('0x5'));var logger=require(_0xb199('0x6'))(_0xb199('0x7'));var config=require(_0xb199('0x8'));var jayson=require(_0xb199('0x9'));var client=jayson['client'][_0xb199('0xa')]({'port':0x232a});config[_0xb199('0xb')]=_['defaults'](config[_0xb199('0xb')],{'host':_0xb199('0xc'),'port':0x18eb});var socket=require(_0xb199('0xd'))(new Redis(config[_0xb199('0xb')]));require(_0xb199('0xe'))['register'](socket);function respondWithRpcPromise(_0x2cab3c,_0x5d55ee,_0x536808){return new BPromise(function(_0x1d1496,_0x331817){return client['request'](_0x2cab3c,_0x536808)['then'](function(_0x77e3ea){logger[_0xb199('0xf')](_0xb199('0x10'),_0x5d55ee,_0xb199('0x11'));logger['debug'](_0xb199('0x12'),_0x5d55ee,_0xb199('0x11'),JSON[_0xb199('0x13')](_0x77e3ea));if(_0x77e3ea[_0xb199('0x14')]){if(_0x77e3ea['error'][_0xb199('0x15')]===0x1f4){logger[_0xb199('0x14')](_0xb199('0x10'),_0x5d55ee,_0x77e3ea[_0xb199('0x14')][_0xb199('0x16')]);return _0x331817(_0x77e3ea[_0xb199('0x14')]['message']);}logger[_0xb199('0x14')](_0xb199('0x10'),_0x5d55ee,_0x77e3ea['error']['message']);return _0x1d1496(_0x77e3ea['error'][_0xb199('0x16')]);}else{logger['info'](_0xb199('0x10'),_0x5d55ee,_0xb199('0x11'));_0x1d1496(_0x77e3ea[_0xb199('0x17')][_0xb199('0x16')]);}})[_0xb199('0x18')](function(_0x4a3369){logger['error'](_0xb199('0x10'),_0x5d55ee,_0x4a3369);_0x331817(_0x4a3369);});});}exports[_0xb199('0x19')]=function(_0x26cc54){var _0x4cb63b=this;return new Promise(function(_0x5463be,_0x56219b){return db['FaxInteraction']['update'](_0x26cc54['body'],{'raw':_0x26cc54['options']?_0x26cc54[_0xb199('0x1a')][_0xb199('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x26cc54['options']?_0x26cc54['options'][_0xb199('0x1c')]||null:null,'attributes':_0x26cc54['options']?_0x26cc54[_0xb199('0x1a')][_0xb199('0x1d')]||null:null,'limit':_0x26cc54[_0xb199('0x1a')]?_0x26cc54[_0xb199('0x1a')][_0xb199('0x1e')]||null:null})[_0xb199('0x1f')](function(_0x5bdb3e){logger[_0xb199('0xf')](_0xb199('0x19'),_0x26cc54);logger['debug'](_0xb199('0x19'),_0x26cc54,JSON['stringify'](_0x5bdb3e));_0x5463be(_0x5bdb3e);})[_0xb199('0x18')](function(_0x3acd77){logger[_0xb199('0x14')](_0xb199('0x19'),_0x3acd77[_0xb199('0x16')],_0x26cc54);_0x56219b(_0x4cb63b[_0xb199('0x14')](0x1f4,_0x3acd77[_0xb199('0x16')]));});});};exports[_0xb199('0x20')]=function(_0x2ec388){return new Promise(function(_0x3fe407,_0xcbd645){return db[_0xb199('0x21')][_0xb199('0x22')]({'where':_0x2ec388[_0xb199('0x1a')]?_0x2ec388[_0xb199('0x1a')][_0xb199('0x1c')]||null:null})[_0xb199('0x1f')](function(_0x2ec657){if(_0x2ec657){return _0x2ec657['addTags'](_0x2ec388[_0xb199('0x23')]['ids'],_[_0xb199('0x24')](_0x2ec388[_0xb199('0x23')],['ids','id'])||{});}})[_0xb199('0x25')](function(_0x50f87d){logger['info'](_0xb199('0x26'),_0x2ec388);logger[_0xb199('0x27')](_0xb199('0x26'),_0x2ec388,JSON[_0xb199('0x13')](_0x50f87d));_0x3fe407(_0x50f87d);})[_0xb199('0x18')](function(_0x5630d3){logger[_0xb199('0x14')](_0xb199('0x26'),_0x5630d3[_0xb199('0x16')],_0x2ec388);_0xcbd645(_this[_0xb199('0x14')](0x1f4,_0x5630d3['message']));});});}; \ No newline at end of file +var _0xc02c=['omit','spread','AddTags','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./faxInteraction.socket','then','info','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','FaxInteraction,\x20%s,\x20%s','message','result','UpdateFaxInteraction','body','options','where','attributes','find','addTags','ids'];(function(_0x109f8a,_0x4580c7){var _0x477d93=function(_0x5a94c8){while(--_0x5a94c8){_0x109f8a['push'](_0x109f8a['shift']());}};_0x477d93(++_0x4580c7);}(_0xc02c,0x123));var _0xcc02=function(_0x1e4920,_0x1d0856){_0x1e4920=_0x1e4920-0x0;var _0x530fe7=_0xc02c[_0x1e4920];return _0x530fe7;};'use strict';var _=require('lodash');var util=require(_0xcc02('0x0'));var moment=require(_0xcc02('0x1'));var BPromise=require(_0xcc02('0x2'));var rs=require(_0xcc02('0x3'));var fs=require('fs');var Redis=require(_0xcc02('0x4'));var db=require(_0xcc02('0x5'))['db'];var utils=require(_0xcc02('0x6'));var logger=require(_0xcc02('0x7'))(_0xcc02('0x8'));var config=require(_0xcc02('0x9'));var jayson=require(_0xcc02('0xa'));var client=jayson[_0xcc02('0xb')][_0xcc02('0xc')]({'port':0x232a});config[_0xcc02('0xd')]=_[_0xcc02('0xe')](config['redis'],{'host':_0xcc02('0xf'),'port':0x18eb});var socket=require(_0xcc02('0x10'))(new Redis(config['redis']));require(_0xcc02('0x11'))['register'](socket);function respondWithRpcPromise(_0x501f73,_0x506c46,_0x15fb86){return new BPromise(function(_0xebd091,_0x1e77ad){return client['request'](_0x501f73,_0x15fb86)[_0xcc02('0x12')](function(_0x3a20e0){logger[_0xcc02('0x13')]('FaxInteraction,\x20%s,\x20%s',_0x506c46,'request\x20sent');logger[_0xcc02('0x14')](_0xcc02('0x15'),_0x506c46,_0xcc02('0x16'),JSON[_0xcc02('0x17')](_0x3a20e0));if(_0x3a20e0[_0xcc02('0x18')]){if(_0x3a20e0['error'][_0xcc02('0x19')]===0x1f4){logger[_0xcc02('0x18')](_0xcc02('0x1a'),_0x506c46,_0x3a20e0['error'][_0xcc02('0x1b')]);return _0x1e77ad(_0x3a20e0[_0xcc02('0x18')][_0xcc02('0x1b')]);}logger[_0xcc02('0x18')](_0xcc02('0x1a'),_0x506c46,_0x3a20e0[_0xcc02('0x18')][_0xcc02('0x1b')]);return _0xebd091(_0x3a20e0['error']['message']);}else{logger[_0xcc02('0x13')](_0xcc02('0x1a'),_0x506c46,_0xcc02('0x16'));_0xebd091(_0x3a20e0[_0xcc02('0x1c')]['message']);}})['catch'](function(_0x41cd66){logger[_0xcc02('0x18')](_0xcc02('0x1a'),_0x506c46,_0x41cd66);_0x1e77ad(_0x41cd66);});});}exports[_0xcc02('0x1d')]=function(_0x5b5724){var _0x45d3e7=this;return new Promise(function(_0xfb1397,_0x14d051){return db['FaxInteraction']['update'](_0x5b5724[_0xcc02('0x1e')],{'raw':_0x5b5724[_0xcc02('0x1f')]?_0x5b5724[_0xcc02('0x1f')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5b5724[_0xcc02('0x1f')]?_0x5b5724[_0xcc02('0x1f')][_0xcc02('0x20')]||null:null,'attributes':_0x5b5724[_0xcc02('0x1f')]?_0x5b5724[_0xcc02('0x1f')][_0xcc02('0x21')]||null:null,'limit':_0x5b5724[_0xcc02('0x1f')]?_0x5b5724[_0xcc02('0x1f')]['limit']||null:null})['then'](function(_0x8d40df){logger[_0xcc02('0x13')]('UpdateFaxInteraction',_0x5b5724);logger[_0xcc02('0x14')](_0xcc02('0x1d'),_0x5b5724,JSON['stringify'](_0x8d40df));_0xfb1397(_0x8d40df);})['catch'](function(_0x5025ab){logger['error'](_0xcc02('0x1d'),_0x5025ab[_0xcc02('0x1b')],_0x5b5724);_0x14d051(_0x45d3e7[_0xcc02('0x18')](0x1f4,_0x5025ab[_0xcc02('0x1b')]));});});};exports['AddTagsToFaxInteraction']=function(_0x5eb049){return new Promise(function(_0x3e4615,_0x44c4cf){return db['FaxInteraction'][_0xcc02('0x22')]({'where':_0x5eb049[_0xcc02('0x1f')]?_0x5eb049[_0xcc02('0x1f')][_0xcc02('0x20')]||null:null})[_0xcc02('0x12')](function(_0x19dbbf){if(_0x19dbbf){return _0x19dbbf[_0xcc02('0x23')](_0x5eb049[_0xcc02('0x1e')][_0xcc02('0x24')],_[_0xcc02('0x25')](_0x5eb049['body'],['ids','id'])||{});}})[_0xcc02('0x26')](function(_0xd6d4f5){logger[_0xcc02('0x13')](_0xcc02('0x27'),_0x5eb049);logger[_0xcc02('0x14')](_0xcc02('0x27'),_0x5eb049,JSON[_0xcc02('0x17')](_0xd6d4f5));_0x3e4615(_0xd6d4f5);})[_0xcc02('0x28')](function(_0x251348){logger[_0xcc02('0x18')](_0xcc02('0x27'),_0x251348['message'],_0x5eb049);_0x44c4cf(_this[_0xcc02('0x18')](0x1f4,_0x251348[_0xcc02('0x1b')]));});});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.socket.js b/server/api/faxInteraction/faxInteraction.socket.js index 784cd0c..2e1047d 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 _0xa428=['removeListener','register','length','faxInteraction:','./faxInteraction.events','save','update'];(function(_0x3bf925,_0x4dd8e4){var _0x2128a1=function(_0x4d2049){while(--_0x4d2049){_0x3bf925['push'](_0x3bf925['shift']());}};_0x2128a1(++_0x4dd8e4);}(_0xa428,0x185));var _0x8a42=function(_0x3e1b25,_0x540df3){_0x3e1b25=_0x3e1b25-0x0;var _0x498725=_0xa428[_0x3e1b25];return _0x498725;};'use strict';var FaxInteractionEvents=require(_0x8a42('0x0'));var events=[_0x8a42('0x1'),'remove',_0x8a42('0x2')];function createListener(_0x477e4e,_0x237286){return function(_0x5e6cff){_0x237286['emit'](_0x477e4e,_0x5e6cff);};}function removeListener(_0x198e9b,_0x396e3d){return function(){FaxInteractionEvents[_0x8a42('0x3')](_0x198e9b,_0x396e3d);};}exports[_0x8a42('0x4')]=function(_0x11e1dc){for(var _0x3d8829=0x0,_0x1a3b4e=events[_0x8a42('0x5')];_0x3d8829<_0x1a3b4e;_0x3d8829++){var _0x463eab=events[_0x3d8829];var _0x5b6dab=createListener(_0x8a42('0x6')+_0x463eab,_0x11e1dc);FaxInteractionEvents['on'](_0x463eab,_0x5b6dab);}}; \ No newline at end of file +var _0x4412=['register','length','./faxInteraction.events','remove','update','emit','removeListener'];(function(_0x2e7691,_0x7f8dc8){var _0x2da321=function(_0x5d0487){while(--_0x5d0487){_0x2e7691['push'](_0x2e7691['shift']());}};_0x2da321(++_0x7f8dc8);}(_0x4412,0xaa));var _0x2441=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0x4412[_0x5b561d];return _0x431060;};'use strict';var FaxInteractionEvents=require(_0x2441('0x0'));var events=['save',_0x2441('0x1'),_0x2441('0x2')];function createListener(_0x4ae9e7,_0x48197b){return function(_0x594aba){_0x48197b[_0x2441('0x3')](_0x4ae9e7,_0x594aba);};}function removeListener(_0x5b4415,_0x40744b){return function(){FaxInteractionEvents[_0x2441('0x4')](_0x5b4415,_0x40744b);};}exports[_0x2441('0x5')]=function(_0x5b0584){for(var _0x25c3f3=0x0,_0x37ff80=events[_0x2441('0x6')];_0x25c3f3<_0x37ff80;_0x25c3f3++){var _0x58fa63=events[_0x25c3f3];var _0x49d20d=createListener('faxInteraction:'+_0x58fa63,_0x5b0584);FaxInteractionEvents['on'](_0x58fa63,_0x49d20d);}}; \ No newline at end of file diff --git a/server/api/faxInteraction/index.js b/server/api/faxInteraction/index.js index bf33816..6d0cb61 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 _0xa7d3=['addTags','put','/:id','faxinteraction:update','update','delete','faxinteraction:destroy','destroy','removeTags','exports','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxInteraction.controller','get','isAuthenticated','index','/describe','describe','show','getMessages','/:id/download','create','addMessage','post','/:id/tags','tracked','fax','faxinteraction:addtags'];(function(_0x47e436,_0x4d7669){var _0x366c06=function(_0x50371a){while(--_0x50371a){_0x47e436['push'](_0x47e436['shift']());}};_0x366c06(++_0x4d7669);}(_0xa7d3,0x1ea));var _0x3a7d=function(_0x568d32,_0x25edf9){_0x568d32=_0x568d32-0x0;var _0x59d096=_0xa7d3[_0x568d32];return _0x59d096;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x3a7d('0x0'));var express=require(_0x3a7d('0x1'));var router=express[_0x3a7d('0x2')]();var auth=require(_0x3a7d('0x3'));var interaction=require(_0x3a7d('0x4'));var config=require(_0x3a7d('0x5'));var controller=require(_0x3a7d('0x6'));router[_0x3a7d('0x7')]('/',auth[_0x3a7d('0x8')](),controller[_0x3a7d('0x9')]);router[_0x3a7d('0x7')](_0x3a7d('0xa'),auth['isAuthenticated'](),controller[_0x3a7d('0xb')]);router[_0x3a7d('0x7')]('/:id',auth[_0x3a7d('0x8')](),controller[_0x3a7d('0xc')]);router[_0x3a7d('0x7')]('/:id/messages',auth[_0x3a7d('0x8')](),controller[_0x3a7d('0xd')]);router[_0x3a7d('0x7')](_0x3a7d('0xe'),auth['isAuthenticated'](),controller['download']);router['post']('/',auth['isAuthenticated'](),controller[_0x3a7d('0xf')]);router['post']('/:id/messages',auth[_0x3a7d('0x8')](),controller[_0x3a7d('0x10')]);router[_0x3a7d('0x11')](_0x3a7d('0x12'),auth[_0x3a7d('0x8')](),interaction[_0x3a7d('0x13')](_0x3a7d('0x14'),_0x3a7d('0x15')),controller[_0x3a7d('0x16')]);router[_0x3a7d('0x17')](_0x3a7d('0x18'),auth['isAuthenticated'](),interaction[_0x3a7d('0x13')]('fax',_0x3a7d('0x19')),controller[_0x3a7d('0x1a')]);router[_0x3a7d('0x1b')](_0x3a7d('0x18'),auth[_0x3a7d('0x8')](),interaction[_0x3a7d('0x13')](_0x3a7d('0x14'),_0x3a7d('0x1c')),controller[_0x3a7d('0x1d')]);router[_0x3a7d('0x1b')]('/:id/tags',auth[_0x3a7d('0x8')](),controller[_0x3a7d('0x1e')]);module[_0x3a7d('0x1f')]=router; \ No newline at end of file +var _0x5cd8=['getMessages','/:id/download','post','create','addMessage','/:id/tags','tracked','fax','faxinteraction:addtags','put','update','faxinteraction:destroy','destroy','delete','removeTags','exports','multer','path','connect-timeout','express','Router','../../components/interaction/service','./faxInteraction.controller','get','isAuthenticated','index','describe','/:id','show','/:id/messages'];(function(_0x158ba0,_0x6267df){var _0xf66e2a=function(_0x1cfdcb){while(--_0x1cfdcb){_0x158ba0['push'](_0x158ba0['shift']());}};_0xf66e2a(++_0x6267df);}(_0x5cd8,0x1d2));var _0x85cd=function(_0x45da07,_0x25c755){_0x45da07=_0x45da07-0x0;var _0x36c905=_0x5cd8[_0x45da07];return _0x36c905;};'use strict';var multer=require(_0x85cd('0x0'));var util=require('util');var path=require(_0x85cd('0x1'));var timeout=require(_0x85cd('0x2'));var express=require(_0x85cd('0x3'));var router=express[_0x85cd('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x85cd('0x5'));var config=require('../../config/environment');var controller=require(_0x85cd('0x6'));router[_0x85cd('0x7')]('/',auth[_0x85cd('0x8')](),controller[_0x85cd('0x9')]);router[_0x85cd('0x7')]('/describe',auth[_0x85cd('0x8')](),controller[_0x85cd('0xa')]);router['get'](_0x85cd('0xb'),auth[_0x85cd('0x8')](),controller[_0x85cd('0xc')]);router[_0x85cd('0x7')](_0x85cd('0xd'),auth[_0x85cd('0x8')](),controller[_0x85cd('0xe')]);router[_0x85cd('0x7')](_0x85cd('0xf'),auth['isAuthenticated'](),controller['download']);router[_0x85cd('0x10')]('/',auth[_0x85cd('0x8')](),controller[_0x85cd('0x11')]);router[_0x85cd('0x10')]('/:id/messages',auth[_0x85cd('0x8')](),controller[_0x85cd('0x12')]);router[_0x85cd('0x10')](_0x85cd('0x13'),auth[_0x85cd('0x8')](),interaction[_0x85cd('0x14')](_0x85cd('0x15'),_0x85cd('0x16')),controller['addTags']);router[_0x85cd('0x17')](_0x85cd('0xb'),auth[_0x85cd('0x8')](),interaction[_0x85cd('0x14')](_0x85cd('0x15'),'faxinteraction:update'),controller[_0x85cd('0x18')]);router['delete'](_0x85cd('0xb'),auth['isAuthenticated'](),interaction[_0x85cd('0x14')]('fax',_0x85cd('0x19')),controller[_0x85cd('0x1a')]);router[_0x85cd('0x1b')](_0x85cd('0x13'),auth[_0x85cd('0x8')](),controller[_0x85cd('0x1c')]);module[_0x85cd('0x1d')]=router; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.attributes.js b/server/api/faxMessage/faxMessage.attributes.js index acf79be..2ab6d6c 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 _0x02a7=['ENUM','out','DATE','sequelize','exports','TEXT','medium','BOOLEAN'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x02a7,0x1db));var _0x702a=function(_0x1e40f9,_0x59e102){_0x1e40f9=_0x1e40f9-0x0;var _0x194fd6=_0x02a7[_0x1e40f9];return _0x194fd6;};'use strict';var Sequelize=require(_0x702a('0x0'));module[_0x702a('0x1')]={'body':{'type':Sequelize[_0x702a('0x2')](_0x702a('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x702a('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x702a('0x5')]('in',_0x702a('0x6')),'defaultValue':_0x702a('0x6'),'allowNull':![]},'failMessage':{'type':Sequelize['TEXT'],'defaultValue':null},'readAt':{'type':Sequelize[_0x702a('0x7')]}}; \ No newline at end of file +var _0x1237=['DATE','exports','medium','ENUM','out','TEXT'];(function(_0x56e4e7,_0x1db098){var _0x383618=function(_0xb088c6){while(--_0xb088c6){_0x56e4e7['push'](_0x56e4e7['shift']());}};_0x383618(++_0x1db098);}(_0x1237,0xf7));var _0x7123=function(_0x196f7a,_0x250b01){_0x196f7a=_0x196f7a-0x0;var _0x197243=_0x1237[_0x196f7a];return _0x197243;};'use strict';var Sequelize=require('sequelize');module[_0x7123('0x0')]={'body':{'type':Sequelize['TEXT'](_0x7123('0x1')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x7123('0x2')]('in','out'),'defaultValue':_0x7123('0x3'),'allowNull':![]},'failMessage':{'type':Sequelize[_0x7123('0x4')],'defaultValue':null},'readAt':{'type':Sequelize[_0x7123('0x5')]}}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.controller.js b/server/api/faxMessage/faxMessage.controller.js index 8733f00..3176ca0 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 _0x6ee6=['manual','interface','SIP/%s','channel','accept','EventManager','acceptmessage','fax-interactions','agent','FaxInteractionId','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','event','create','findOne','ContactId','Attachment','AttachmentId','SendFax','/var/opt/motion2/server/files/attachments/%s','join','root','server','files','attachments','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','squel','jsforce','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','defaults','redis','localhost','socket.io-emitter','./faxMessage.socket','register','client','http','test','request','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','destroy','stack','name','send','FaxMessage','rawAttributes','model','keys','query','intersection','fields','attributes','nolimit','order','where','filters','pick','type','key','VIRTUAL','field','filter','merge','options','include','findAll','rows','show','length','includeAll','find','body','params','describe','fax','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','CmContact','Contact','get','FaxInteraction','update','isNil','format','interaction','null','AcceptMessage'];(function(_0xc2b4c8,_0x756a49){var _0x402443=function(_0x571bae){while(--_0x571bae){_0xc2b4c8['push'](_0xc2b4c8['shift']());}};_0x402443(++_0x756a49);}(_0x6ee6,0x9c));var _0x66ee=function(_0x16dbcd,_0x274516){_0x16dbcd=_0x16dbcd-0x0;var _0x34706e=_0x6ee6[_0x16dbcd];return _0x34706e;};'use strict';var pdf=require(_0x66ee('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x66ee('0x1'));var zipdir=require(_0x66ee('0x2'));var jsonpatch=require(_0x66ee('0x3'));var rp=require(_0x66ee('0x4'));var moment=require(_0x66ee('0x5'));var BPromise=require(_0x66ee('0x6'));var Mustache=require(_0x66ee('0x7'));var util=require(_0x66ee('0x8'));var path=require('path');var sox=require(_0x66ee('0x9'));var csv=require('to-csv');var ejs=require(_0x66ee('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x66ee('0xb'));var crypto=require('crypto');var jsforce=require(_0x66ee('0xc'));var deskjs=require(_0x66ee('0xd'));var toCsv=require(_0x66ee('0xe'));var querystring=require(_0x66ee('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x66ee('0x10'));var qs=require(_0x66ee('0x11'));var as=require(_0x66ee('0x12'));var hardwareService=require(_0x66ee('0x13'));var logger=require(_0x66ee('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x66ee('0x15'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x66ee('0x16')](config[_0x66ee('0x17')],{'host':_0x66ee('0x18'),'port':0x18eb});var socket=require(_0x66ee('0x19'))(new Redis(config[_0x66ee('0x17')]));require(_0x66ee('0x1a'))[_0x66ee('0x1b')](socket);var jayson=require('jayson/promise');var client=jayson[_0x66ee('0x1c')][_0x66ee('0x1d')]({'port':0x232c});var client9002=jayson[_0x66ee('0x1c')]['http']({'port':0x232a});function checkPasswordPattern(_0x3d49ac,_0xd2b8a7,_0x4ce936){if(_0x4ce936){var _0x432d6c=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x432d6c[_0x66ee('0x1e')](_0xd2b8a7)){return _0x3d49ac;}else{throw new Error('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x3d49ac;}}function respondWithRpcPromise(_0xcb7cf9,_0x3ad86b,_0x2a0c9b,_0x3e56ef){return new BPromise(function(_0x2a793d,_0x11bddd){var _0x31cb93=_0x3e56ef||client;return _0x31cb93[_0x66ee('0x1f')](_0xcb7cf9,_0x2a0c9b)[_0x66ee('0x20')](function(_0x5d744d){logger[_0x66ee('0x21')](_0x66ee('0x22'),_0x3ad86b,_0x66ee('0x23'));logger[_0x66ee('0x24')](_0x66ee('0x25'),_0x3ad86b,'request\x20sent',JSON[_0x66ee('0x26')](_0x5d744d));if(_0x5d744d[_0x66ee('0x27')]){if(_0x5d744d[_0x66ee('0x27')][_0x66ee('0x28')]===0x1f4){logger['error']('FaxMessage,\x20%s,\x20%s',_0x3ad86b,_0x5d744d[_0x66ee('0x27')][_0x66ee('0x29')]);return _0x11bddd(_0x5d744d[_0x66ee('0x27')]['message']);}logger[_0x66ee('0x27')](_0x66ee('0x22'),_0x3ad86b,_0x5d744d[_0x66ee('0x27')]['message']);return _0x2a793d(_0x5d744d[_0x66ee('0x27')][_0x66ee('0x29')]);}else{logger[_0x66ee('0x21')](_0x66ee('0x22'),_0x3ad86b,_0x66ee('0x23'));_0x2a793d(_0x5d744d['result'][_0x66ee('0x29')]);}})[_0x66ee('0x2a')](function(_0x460336){logger['error'](_0x66ee('0x22'),_0x3ad86b,_0x460336);_0x11bddd(_0x460336);});});}function respondWithStatusCode(_0x380999,_0x47b78c){_0x47b78c=_0x47b78c||0xcc;return function(_0x4f7e66){if(_0x4f7e66){return _0x380999[_0x66ee('0x2b')](_0x47b78c);}return _0x380999[_0x66ee('0x2c')](_0x47b78c)[_0x66ee('0x2d')]();};}function respondWithResult(_0x4e9249,_0x48a5fc){_0x48a5fc=_0x48a5fc||0xc8;return function(_0xc819c8){if(_0xc819c8){return _0x4e9249[_0x66ee('0x2c')](_0x48a5fc)[_0x66ee('0x2e')](_0xc819c8);}};}function respondWithFilteredResult(_0x4f421c,_0x342ff9){return function(_0x4541fb){if(_0x4541fb){var _0x506bc2=_0x4541fb[_0x66ee('0x2f')],_0x21e28e=_0x342ff9[_0x66ee('0x30')],_0x208ce5=_0x342ff9[_0x66ee('0x30')]+_0x342ff9[_0x66ee('0x31')],_0x74cbbe;if(_0x208ce5>=_0x506bc2){_0x208ce5=_0x506bc2;_0x74cbbe=0xc8;}else{_0x74cbbe=0xce;}_0x4f421c[_0x66ee('0x2c')](_0x74cbbe);return _0x4f421c[_0x66ee('0x32')](_0x66ee('0x33'),_0x21e28e+'-'+_0x208ce5+'/'+_0x506bc2)['json'](_0x4541fb);}return null;};}function patchUpdates(_0x4396e9){return function(_0x3a18f1){try{jsonpatch[_0x66ee('0x34')](_0x3a18f1,_0x4396e9,!![]);}catch(_0x418389){return BPromise[_0x66ee('0x35')](_0x418389);}return _0x3a18f1['save']();};}function saveUpdates(_0x40f173,_0x5dbb00){return function(_0x11487f){if(_0x11487f){return _0x11487f['update'](_0x40f173)['then'](function(_0x4f41fb){return _0x4f41fb;});}return null;};}function removeEntity(_0x179607,_0x5acbdd){return function(_0x500f69){if(_0x500f69){return _0x500f69[_0x66ee('0x36')]()[_0x66ee('0x20')](function(){_0x179607['status'](0xcc)[_0x66ee('0x2d')]();});}};}function handleEntityNotFound(_0x45872f,_0x3501de){return function(_0x5b5a63){if(!_0x5b5a63){_0x45872f[_0x66ee('0x2b')](0x194);}return _0x5b5a63;};}function handleError(_0x120866,_0x11770b){_0x11770b=_0x11770b||0x1f4;return function(_0x83b5b9){logger[_0x66ee('0x27')](_0x83b5b9[_0x66ee('0x37')]);if(_0x83b5b9[_0x66ee('0x38')]){delete _0x83b5b9[_0x66ee('0x38')];}_0x120866[_0x66ee('0x2c')](_0x11770b)[_0x66ee('0x39')](_0x83b5b9);};}exports['index']=function(_0x2cb199,_0x432a71){var _0x29b080={},_0x2818d3={},_0x2a1496={'count':0x0,'rows':[]};var _0x55f95c=db[_0x66ee('0x3a')][_0x66ee('0x3b')];_0x2818d3[_0x66ee('0x3c')]=_[_0x66ee('0x3d')](_0x55f95c);_0x2818d3[_0x66ee('0x3e')]=_[_0x66ee('0x3d')](_0x2cb199['query']);_0x2818d3['filters']=_[_0x66ee('0x3f')](_0x2818d3[_0x66ee('0x3c')],_0x2818d3['query']);_0x29b080['attributes']=_[_0x66ee('0x3f')](_0x2818d3[_0x66ee('0x3c')],qs[_0x66ee('0x40')](_0x2cb199[_0x66ee('0x3e')][_0x66ee('0x40')]));_0x29b080[_0x66ee('0x41')]=_0x29b080[_0x66ee('0x41')]['length']?_0x29b080[_0x66ee('0x41')]:_0x2818d3[_0x66ee('0x3c')];if(!_0x2cb199[_0x66ee('0x3e')]['hasOwnProperty'](_0x66ee('0x42'))){_0x29b080['limit']=qs['limit'](_0x2cb199[_0x66ee('0x3e')][_0x66ee('0x31')]);_0x29b080[_0x66ee('0x30')]=qs['offset'](_0x2cb199['query'][_0x66ee('0x30')]);}_0x29b080[_0x66ee('0x43')]=qs['sort'](_0x2cb199[_0x66ee('0x3e')]['sort']);_0x29b080[_0x66ee('0x44')]=qs[_0x66ee('0x45')](_[_0x66ee('0x46')](_0x2cb199[_0x66ee('0x3e')],_0x2818d3[_0x66ee('0x45')]));if(_0x2cb199[_0x66ee('0x3e')]['filter']){_0x29b080['where']=_['merge'](_0x29b080[_0x66ee('0x44')],{'$or':_['map'](_0x55f95c,function(_0x5ec05a){if(_0x5ec05a[_0x66ee('0x47')][_0x66ee('0x48')]!==_0x66ee('0x49')){var _0x3dec35={};_0x3dec35[_0x5ec05a[_0x66ee('0x4a')]]={'$like':'%'+_0x2cb199[_0x66ee('0x3e')][_0x66ee('0x4b')]+'%'};return _0x3dec35;}})});}_0x29b080=_[_0x66ee('0x4c')]({},_0x29b080,_0x2cb199[_0x66ee('0x4d')]);var _0x5990a0={'where':_0x29b080[_0x66ee('0x44')]};return db[_0x66ee('0x3a')][_0x66ee('0x2f')](_0x5990a0)['then'](function(_0x575f45){_0x2a1496['count']=_0x575f45;if(_0x2cb199[_0x66ee('0x3e')]['includeAll']){_0x29b080[_0x66ee('0x4e')]=[{'all':!![]}];}return db[_0x66ee('0x3a')][_0x66ee('0x4f')](_0x29b080);})['then'](function(_0x1e7271){_0x2a1496[_0x66ee('0x50')]=_0x1e7271;return _0x2a1496;})[_0x66ee('0x20')](respondWithFilteredResult(_0x432a71,_0x29b080))['catch'](handleError(_0x432a71,null));};exports[_0x66ee('0x51')]=function(_0x43ea6e,_0x3a1f2e){var _0x2eb854={'raw':!![],'where':{'id':_0x43ea6e['params']['id']}},_0x15a1a2={};_0x15a1a2['model']=_['keys'](db[_0x66ee('0x3a')][_0x66ee('0x3b')]);_0x15a1a2[_0x66ee('0x3e')]=_[_0x66ee('0x3d')](_0x43ea6e[_0x66ee('0x3e')]);_0x15a1a2[_0x66ee('0x45')]=_[_0x66ee('0x3f')](_0x15a1a2['model'],_0x15a1a2['query']);_0x2eb854['attributes']=_[_0x66ee('0x3f')](_0x15a1a2[_0x66ee('0x3c')],qs['fields'](_0x43ea6e['query']['fields']));_0x2eb854[_0x66ee('0x41')]=_0x2eb854[_0x66ee('0x41')][_0x66ee('0x52')]?_0x2eb854['attributes']:_0x15a1a2[_0x66ee('0x3c')];if(_0x43ea6e[_0x66ee('0x3e')][_0x66ee('0x53')]){_0x2eb854[_0x66ee('0x4e')]=[{'all':!![]}];}_0x2eb854=_[_0x66ee('0x4c')]({},_0x2eb854,_0x43ea6e[_0x66ee('0x4d')]);return db['FaxMessage'][_0x66ee('0x54')](_0x2eb854)[_0x66ee('0x20')](handleEntityNotFound(_0x3a1f2e,null))[_0x66ee('0x20')](respondWithResult(_0x3a1f2e,null))['catch'](handleError(_0x3a1f2e,null));};exports['update']=function(_0x1872e7,_0xe1b81b){if(_0x1872e7[_0x66ee('0x55')]['id']){delete _0x1872e7[_0x66ee('0x55')]['id'];}return db[_0x66ee('0x3a')][_0x66ee('0x54')]({'where':{'id':_0x1872e7[_0x66ee('0x56')]['id']}})[_0x66ee('0x20')](handleEntityNotFound(_0xe1b81b,null))[_0x66ee('0x20')](saveUpdates(_0x1872e7[_0x66ee('0x55')],null))[_0x66ee('0x20')](respondWithResult(_0xe1b81b,null))[_0x66ee('0x2a')](handleError(_0xe1b81b,null));};exports[_0x66ee('0x36')]=function(_0x2e054b,_0x133fd3){return db[_0x66ee('0x3a')]['find']({'where':{'id':_0x2e054b['params']['id']}})[_0x66ee('0x20')](handleEntityNotFound(_0x133fd3,null))[_0x66ee('0x20')](removeEntity(_0x133fd3,null))[_0x66ee('0x2a')](handleError(_0x133fd3,null));};exports[_0x66ee('0x57')]=function(_0x5f07c7,_0x10e28c){return db['FaxMessage'][_0x66ee('0x57')]()[_0x66ee('0x20')](respondWithResult(_0x10e28c,null))[_0x66ee('0x2a')](handleError(_0x10e28c,null));};var interaction_log=require(_0x66ee('0x14'))('fax-interactions');exports['accept']=function(_0xd142c6,_0x324c86,_0x36d6d2){var _0x5c252f={'channel':_0x66ee('0x58')};if(_0xd142c6[_0x66ee('0x55')]['id']){delete _0xd142c6[_0x66ee('0x55')]['id'];}_0xd142c6[_0x66ee('0x55')][_0x66ee('0x59')]=!![];_0xd142c6[_0x66ee('0x55')][_0x66ee('0x5a')]=moment()['format'](_0x66ee('0x5b'));_0xd142c6['body'][_0x66ee('0x5c')]=_0xd142c6[_0x66ee('0x55')]['UserId']||_0xd142c6[_0x66ee('0x5d')]['id'];return db[_0x66ee('0x3a')][_0x66ee('0x54')]({'where':{'id':_0xd142c6[_0x66ee('0x56')]['id'],'UserId':null},'include':[{'model':db[_0x66ee('0x5e')],'as':_0x66ee('0x5f')}]})[_0x66ee('0x20')](handleEntityNotFound(_0x324c86,null))[_0x66ee('0x20')](saveUpdates(_0xd142c6[_0x66ee('0x55')],null))[_0x66ee('0x20')](function(_0x40443c){if(_0x40443c){_0x5c252f[_0x66ee('0x29')]=_0x40443c[_0x66ee('0x60')]({'plain':!![]});return db[_0x66ee('0x61')][_0x66ee('0x54')]({'where':{'id':_0x40443c['FaxInteractionId']}});}return null;})[_0x66ee('0x20')](handleEntityNotFound(_0x324c86,null))[_0x66ee('0x20')](function(_0x267b0d){if(_0x267b0d){return _0x267b0d[_0x66ee('0x62')]({'UserId':_0xd142c6[_0x66ee('0x55')][_0x66ee('0x5c')],'read1stAt':_[_0x66ee('0x63')](_0x267b0d['read1stAt'])?moment()[_0x66ee('0x64')](_0x66ee('0x5b')):undefined});}return null;})[_0x66ee('0x20')](function(_0x54b5ed){if(_0x54b5ed){_0x5c252f[_0x66ee('0x65')]=_0x54b5ed[_0x66ee('0x60')]({'plain':!![]});interaction_log[_0x66ee('0x21')]('[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0xd142c6['user']['id'],_0xd142c6[_0x66ee('0x5d')][_0x66ee('0x38')],_0xd142c6[_0x66ee('0x5d')]['role'],_0x5c252f['interaction']['id'],_0xd142c6[_0x66ee('0x55')]?JSON['stringify'](_0xd142c6[_0x66ee('0x55')]):_0x66ee('0x66'));return respondWithRpcPromise(_0x66ee('0x67'),'acceptMessage',_0x5c252f);}return null;})[_0x66ee('0x20')](function(_0x4d3a75){if(_0x4d3a75){if(_0xd142c6['body'][_0x66ee('0x68')]){_0x5c252f['message'][_0x66ee('0x69')]=util[_0x66ee('0x64')](_0x66ee('0x6a'),_0xd142c6[_0x66ee('0x5d')][_0x66ee('0x38')]);_0x5c252f['message'][_0x66ee('0x6b')]=_0x5c252f[_0x66ee('0x6b')];_0x5c252f[_0x66ee('0x29')]['event']=_0x66ee('0x6c');return respondWithRpcPromise('EventManager',_0x66ee('0x6d'),{'event':_0x66ee('0x6e'),'message':_0x5c252f['message']},client9002)['then'](function(){return _0x5c252f;});}return _0x5c252f;}return null;})[_0x66ee('0x20')](respondWithResult(_0x324c86,null))['catch'](handleError(_0x324c86,null));};var interaction_log=require(_0x66ee('0x14'))(_0x66ee('0x6f'));exports['reject']=function(_0x1d83da,_0x34f5ce,_0x335fe7){var _0x984a52={'agent':{},'channel':_0x66ee('0x58')};if(_0x1d83da[_0x66ee('0x55')]['id']){delete _0x1d83da['body']['id'];}_0x1d83da['body']['UserId']=_0x1d83da['body'][_0x66ee('0x5c')]||_0x1d83da['user']['id'];_0x984a52[_0x66ee('0x70')]['id']=_0x1d83da[_0x66ee('0x55')]['UserId'];return db[_0x66ee('0x3a')][_0x66ee('0x54')]({'where':{'id':_0x1d83da[_0x66ee('0x56')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x34f5ce,null))['then'](function(_0x9f2e40){if(_0x9f2e40){_0x984a52[_0x66ee('0x29')]=_0x9f2e40['get']({'plain':!![]});return db[_0x66ee('0x61')][_0x66ee('0x54')]({'where':{'id':_0x9f2e40[_0x66ee('0x71')]}});}return null;})['then'](handleEntityNotFound(_0x34f5ce,null))[_0x66ee('0x20')](function(_0x228f11){if(_0x228f11){_0x984a52[_0x66ee('0x65')]=_0x228f11[_0x66ee('0x60')]({'plain':!![]});interaction_log[_0x66ee('0x21')](_0x66ee('0x72'),_0x1d83da['user']['id'],_0x1d83da[_0x66ee('0x5d')][_0x66ee('0x38')],_0x1d83da[_0x66ee('0x5d')]['role'],_0x984a52[_0x66ee('0x65')]['id'],_0x1d83da[_0x66ee('0x55')]?JSON['stringify'](_0x1d83da[_0x66ee('0x55')]):'null');return respondWithRpcPromise(_0x66ee('0x73'),_0x66ee('0x74'),_0x984a52);}return null;})['then'](function(_0x55ff2f){if(_0x55ff2f){_0x55ff2f[_0x66ee('0x29')][_0x66ee('0x69')]=util[_0x66ee('0x64')](_0x66ee('0x6a'),_0x1d83da['user'][_0x66ee('0x38')]);_0x55ff2f[_0x66ee('0x29')][_0x66ee('0x6b')]=_0x984a52['channel'];_0x55ff2f[_0x66ee('0x29')][_0x66ee('0x75')]=_0x66ee('0x35');respondWithRpcPromise('EventManager',_0x66ee('0x6d'),{'event':'rejectmessage','message':_0x55ff2f['message']},client9002);return _0x984a52;}return null;})[_0x66ee('0x20')](respondWithResult(_0x34f5ce,null))[_0x66ee('0x2a')](handleError(_0x34f5ce,null));};exports[_0x66ee('0x76')]=function(_0x6d0af4,_0x52d0e7){var _0x5486b2;return db[_0x66ee('0x3a')][_0x66ee('0x76')](_0x6d0af4[_0x66ee('0x55')],{})['then'](function(_0x14d9c2){_0x5486b2=_0x14d9c2;return db[_0x66ee('0x5e')][_0x66ee('0x77')]({'where':{'id':_0x5486b2[_0x66ee('0x78')]}});})[_0x66ee('0x20')](function(_0x33caf1){if(_[_0x66ee('0x63')](_0x33caf1)){return;}else{_0x5486b2['fax']=_0x33caf1[_0x66ee('0x58')];return db[_0x66ee('0x79')][_0x66ee('0x77')]({'where':{'id':_0x5486b2[_0x66ee('0x7a')]}});}})[_0x66ee('0x20')](function(_0x472da2){return respondWithRpcPromise(_0x66ee('0x7b'),'SendFax',{'FaxAccountId':_[_0x66ee('0x63')](_0x6d0af4[_0x66ee('0x55')])?undefined:_0x6d0af4[_0x66ee('0x55')]['FaxAccountId'],'path':_[_0x66ee('0x63')](_0x472da2)?undefined:util[_0x66ee('0x64')](_0x66ee('0x7c'),_0x472da2['basename']),'fax':_[_0x66ee('0x63')](_0x5486b2[_0x66ee('0x58')])?undefined:_0x5486b2[_0x66ee('0x58')],'AttachmentId':_0x5486b2[_0x66ee('0x7a')]},client9002);})[_0x66ee('0x20')](respondWithResult(_0x52d0e7,0xc9))[_0x66ee('0x2a')](handleError(_0x52d0e7,null));};exports['download']=function(_0x3adc7e,_0x3385f2){var _0x44aff5=path[_0x66ee('0x7d')](config[_0x66ee('0x7e')],_0x66ee('0x7f'),_0x66ee('0x80'),_0x66ee('0x81'));return db['FaxMessage'][_0x66ee('0x54')]({'where':{'id':_0x3adc7e[_0x66ee('0x56')]['id']},'include':[{'model':db[_0x66ee('0x79')],'as':_0x66ee('0x79')}]})[_0x66ee('0x20')](handleEntityNotFound(_0x3385f2,null))[_0x66ee('0x20')](function(_0xb5f8d7){if(_0xb5f8d7){return _0x3385f2['download'](path['join'](_0x44aff5,_0xb5f8d7['Attachment']['basename']));}})[_0x66ee('0x2a')](handleError(_0x3385f2,null));}; \ No newline at end of file +var _0x373d=['rawAttributes','model','keys','query','filters','intersection','fields','length','attributes','nolimit','limit','sort','where','pick','filter','merge','map','key','VIRTUAL','field','options','FaxMessage','findAll','rows','includeAll','include','find','params','body','describe','../../config/logger','fax-interactions','fax','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','CmContact','Contact','get','FaxInteraction','FaxInteractionId','isNil','read1stAt','interaction','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','manual','channel','event','EventManager','acceptmessage','agent','RejectMessage','rejectMessage','interface','SIP/%s','rejectmessage','create','findOne','ContactId','AttachmentId','SendFax','FaxAccountId','/var/opt/motion2/server/files/attachments/%s','join','root','server','files','attachments','Attachment','basename','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','to-csv','ejs','lodash','squel','jsforce','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','localhost','socket.io-emitter','./faxMessage.socket','register','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','info','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','count','offset','set','apply','reject','save','update','then','destroy','stack','name','send','index'];(function(_0x54e333,_0x4ba478){var _0x47279e=function(_0x8e4f0b){while(--_0x8e4f0b){_0x54e333['push'](_0x54e333['shift']());}};_0x47279e(++_0x4ba478);}(_0x373d,0x1e2));var _0xd373=function(_0x3c5972,_0x5e0f8a){_0x3c5972=_0x3c5972-0x0;var _0xb5a85a=_0x373d[_0x3c5972];return _0xb5a85a;};'use strict';var pdf=require(_0xd373('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xd373('0x1'));var zipdir=require(_0xd373('0x2'));var jsonpatch=require(_0xd373('0x3'));var rp=require(_0xd373('0x4'));var moment=require('moment');var BPromise=require(_0xd373('0x5'));var Mustache=require(_0xd373('0x6'));var util=require(_0xd373('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xd373('0x8'));var ejs=require(_0xd373('0x9'));var fs=require('fs');var _=require(_0xd373('0xa'));var squel=require(_0xd373('0xb'));var crypto=require('crypto');var jsforce=require(_0xd373('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xd373('0xd'));var Redis=require(_0xd373('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xd373('0xf'));var as=require(_0xd373('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xd373('0x11'));var utils=require(_0xd373('0x12'));var config=require(_0xd373('0x13'));var db=require(_0xd373('0x14'))['db'];config['redis']=_['defaults'](config['redis'],{'host':_0xd373('0x15'),'port':0x18eb});var socket=require(_0xd373('0x16'))(new Redis(config['redis']));require(_0xd373('0x17'))[_0xd373('0x18')](socket);var jayson=require(_0xd373('0x19'));var client=jayson[_0xd373('0x1a')][_0xd373('0x1b')]({'port':0x232c});var client9002=jayson[_0xd373('0x1a')][_0xd373('0x1b')]({'port':0x232a});function checkPasswordPattern(_0x2eacb1,_0x5a286a,_0x2c5854){if(_0x2c5854){var _0x3a5316=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3a5316[_0xd373('0x1c')](_0x5a286a)){return _0x2eacb1;}else{throw new Error(_0xd373('0x1d'));}}else{return _0x2eacb1;}}function respondWithRpcPromise(_0x4e5768,_0x1e26cf,_0x5eab00,_0x460259){return new BPromise(function(_0x36d47a,_0x55c5c7){var _0x1bbdbd=_0x460259||client;return _0x1bbdbd['request'](_0x4e5768,_0x5eab00)['then'](function(_0x23fada){logger[_0xd373('0x1e')](_0xd373('0x1f'),_0x1e26cf,_0xd373('0x20'));logger[_0xd373('0x21')](_0xd373('0x22'),_0x1e26cf,'request\x20sent',JSON[_0xd373('0x23')](_0x23fada));if(_0x23fada[_0xd373('0x24')]){if(_0x23fada[_0xd373('0x24')][_0xd373('0x25')]===0x1f4){logger[_0xd373('0x24')](_0xd373('0x1f'),_0x1e26cf,_0x23fada['error'][_0xd373('0x26')]);return _0x55c5c7(_0x23fada[_0xd373('0x24')][_0xd373('0x26')]);}logger[_0xd373('0x24')](_0xd373('0x1f'),_0x1e26cf,_0x23fada[_0xd373('0x24')][_0xd373('0x26')]);return _0x36d47a(_0x23fada[_0xd373('0x24')][_0xd373('0x26')]);}else{logger[_0xd373('0x1e')](_0xd373('0x1f'),_0x1e26cf,_0xd373('0x20'));_0x36d47a(_0x23fada[_0xd373('0x27')][_0xd373('0x26')]);}})[_0xd373('0x28')](function(_0x38ba50){logger[_0xd373('0x24')](_0xd373('0x1f'),_0x1e26cf,_0x38ba50);_0x55c5c7(_0x38ba50);});});}function respondWithStatusCode(_0x3e657b,_0x470612){_0x470612=_0x470612||0xcc;return function(_0x45ee58){if(_0x45ee58){return _0x3e657b[_0xd373('0x29')](_0x470612);}return _0x3e657b[_0xd373('0x2a')](_0x470612)[_0xd373('0x2b')]();};}function respondWithResult(_0xf85ca8,_0x2869e5){_0x2869e5=_0x2869e5||0xc8;return function(_0x158825){if(_0x158825){return _0xf85ca8[_0xd373('0x2a')](_0x2869e5)[_0xd373('0x2c')](_0x158825);}};}function respondWithFilteredResult(_0x7dad3e,_0x5287e7){return function(_0x7ca56e){if(_0x7ca56e){var _0x490842=_0x7ca56e[_0xd373('0x2d')],_0x498aaa=_0x5287e7[_0xd373('0x2e')],_0xedc8f3=_0x5287e7[_0xd373('0x2e')]+_0x5287e7['limit'],_0x15da6c;if(_0xedc8f3>=_0x490842){_0xedc8f3=_0x490842;_0x15da6c=0xc8;}else{_0x15da6c=0xce;}_0x7dad3e[_0xd373('0x2a')](_0x15da6c);return _0x7dad3e[_0xd373('0x2f')]('Content-Range',_0x498aaa+'-'+_0xedc8f3+'/'+_0x490842)[_0xd373('0x2c')](_0x7ca56e);}return null;};}function patchUpdates(_0x8e4884){return function(_0x146e24){try{jsonpatch[_0xd373('0x30')](_0x146e24,_0x8e4884,!![]);}catch(_0x26538a){return BPromise[_0xd373('0x31')](_0x26538a);}return _0x146e24[_0xd373('0x32')]();};}function saveUpdates(_0x470d6e,_0x42faaa){return function(_0x52ff26){if(_0x52ff26){return _0x52ff26[_0xd373('0x33')](_0x470d6e)[_0xd373('0x34')](function(_0x420c73){return _0x420c73;});}return null;};}function removeEntity(_0x2cb761,_0x2da192){return function(_0x28da03){if(_0x28da03){return _0x28da03[_0xd373('0x35')]()[_0xd373('0x34')](function(){_0x2cb761[_0xd373('0x2a')](0xcc)[_0xd373('0x2b')]();});}};}function handleEntityNotFound(_0x38e0ea,_0x13a1cd){return function(_0x143080){if(!_0x143080){_0x38e0ea[_0xd373('0x29')](0x194);}return _0x143080;};}function handleError(_0x22429c,_0x527558){_0x527558=_0x527558||0x1f4;return function(_0x3a1eb4){logger[_0xd373('0x24')](_0x3a1eb4[_0xd373('0x36')]);if(_0x3a1eb4[_0xd373('0x37')]){delete _0x3a1eb4['name'];}_0x22429c[_0xd373('0x2a')](_0x527558)[_0xd373('0x38')](_0x3a1eb4);};}exports[_0xd373('0x39')]=function(_0x3af9f7,_0x38d8ec){var _0x104fa6={},_0x4aab80={},_0x4a2fc5={'count':0x0,'rows':[]};var _0x10368d=db['FaxMessage'][_0xd373('0x3a')];_0x4aab80[_0xd373('0x3b')]=_[_0xd373('0x3c')](_0x10368d);_0x4aab80['query']=_[_0xd373('0x3c')](_0x3af9f7[_0xd373('0x3d')]);_0x4aab80[_0xd373('0x3e')]=_[_0xd373('0x3f')](_0x4aab80['model'],_0x4aab80['query']);_0x104fa6['attributes']=_[_0xd373('0x3f')](_0x4aab80['model'],qs[_0xd373('0x40')](_0x3af9f7[_0xd373('0x3d')]['fields']));_0x104fa6['attributes']=_0x104fa6['attributes'][_0xd373('0x41')]?_0x104fa6[_0xd373('0x42')]:_0x4aab80[_0xd373('0x3b')];if(!_0x3af9f7['query']['hasOwnProperty'](_0xd373('0x43'))){_0x104fa6[_0xd373('0x44')]=qs['limit'](_0x3af9f7[_0xd373('0x3d')][_0xd373('0x44')]);_0x104fa6[_0xd373('0x2e')]=qs[_0xd373('0x2e')](_0x3af9f7[_0xd373('0x3d')]['offset']);}_0x104fa6['order']=qs[_0xd373('0x45')](_0x3af9f7[_0xd373('0x3d')][_0xd373('0x45')]);_0x104fa6[_0xd373('0x46')]=qs['filters'](_[_0xd373('0x47')](_0x3af9f7['query'],_0x4aab80[_0xd373('0x3e')]));if(_0x3af9f7[_0xd373('0x3d')][_0xd373('0x48')]){_0x104fa6[_0xd373('0x46')]=_[_0xd373('0x49')](_0x104fa6['where'],{'$or':_[_0xd373('0x4a')](_0x10368d,function(_0x1cff51){if(_0x1cff51['type'][_0xd373('0x4b')]!==_0xd373('0x4c')){var _0x427310={};_0x427310[_0x1cff51[_0xd373('0x4d')]]={'$like':'%'+_0x3af9f7[_0xd373('0x3d')][_0xd373('0x48')]+'%'};return _0x427310;}})});}_0x104fa6=_[_0xd373('0x49')]({},_0x104fa6,_0x3af9f7[_0xd373('0x4e')]);var _0x9f2a2e={'where':_0x104fa6[_0xd373('0x46')]};return db['FaxMessage']['count'](_0x9f2a2e)[_0xd373('0x34')](function(_0x53cd82){_0x4a2fc5[_0xd373('0x2d')]=_0x53cd82;if(_0x3af9f7['query']['includeAll']){_0x104fa6['include']=[{'all':!![]}];}return db[_0xd373('0x4f')][_0xd373('0x50')](_0x104fa6);})[_0xd373('0x34')](function(_0xead46f){_0x4a2fc5[_0xd373('0x51')]=_0xead46f;return _0x4a2fc5;})[_0xd373('0x34')](respondWithFilteredResult(_0x38d8ec,_0x104fa6))[_0xd373('0x28')](handleError(_0x38d8ec,null));};exports['show']=function(_0x28ec3e,_0x57c705){var _0x4076e0={'raw':!![],'where':{'id':_0x28ec3e['params']['id']}},_0x224196={};_0x224196[_0xd373('0x3b')]=_['keys'](db[_0xd373('0x4f')][_0xd373('0x3a')]);_0x224196[_0xd373('0x3d')]=_[_0xd373('0x3c')](_0x28ec3e[_0xd373('0x3d')]);_0x224196['filters']=_['intersection'](_0x224196['model'],_0x224196[_0xd373('0x3d')]);_0x4076e0[_0xd373('0x42')]=_['intersection'](_0x224196[_0xd373('0x3b')],qs[_0xd373('0x40')](_0x28ec3e['query'][_0xd373('0x40')]));_0x4076e0[_0xd373('0x42')]=_0x4076e0[_0xd373('0x42')][_0xd373('0x41')]?_0x4076e0[_0xd373('0x42')]:_0x224196[_0xd373('0x3b')];if(_0x28ec3e[_0xd373('0x3d')][_0xd373('0x52')]){_0x4076e0[_0xd373('0x53')]=[{'all':!![]}];}_0x4076e0=_[_0xd373('0x49')]({},_0x4076e0,_0x28ec3e[_0xd373('0x4e')]);return db['FaxMessage']['find'](_0x4076e0)['then'](handleEntityNotFound(_0x57c705,null))['then'](respondWithResult(_0x57c705,null))['catch'](handleError(_0x57c705,null));};exports['update']=function(_0x409246,_0x289ec2){if(_0x409246['body']['id']){delete _0x409246['body']['id'];}return db['FaxMessage'][_0xd373('0x54')]({'where':{'id':_0x409246[_0xd373('0x55')]['id']}})['then'](handleEntityNotFound(_0x289ec2,null))['then'](saveUpdates(_0x409246[_0xd373('0x56')],null))[_0xd373('0x34')](respondWithResult(_0x289ec2,null))[_0xd373('0x28')](handleError(_0x289ec2,null));};exports[_0xd373('0x35')]=function(_0x38c01c,_0x59da03){return db[_0xd373('0x4f')][_0xd373('0x54')]({'where':{'id':_0x38c01c[_0xd373('0x55')]['id']}})[_0xd373('0x34')](handleEntityNotFound(_0x59da03,null))[_0xd373('0x34')](removeEntity(_0x59da03,null))[_0xd373('0x28')](handleError(_0x59da03,null));};exports[_0xd373('0x57')]=function(_0x2e4298,_0x10fffb){return db[_0xd373('0x4f')][_0xd373('0x57')]()[_0xd373('0x34')](respondWithResult(_0x10fffb,null))[_0xd373('0x28')](handleError(_0x10fffb,null));};var interaction_log=require(_0xd373('0x58'))(_0xd373('0x59'));exports['accept']=function(_0xc41581,_0x1f775c,_0x1de907){var _0x4dba1d={'channel':_0xd373('0x5a')};if(_0xc41581['body']['id']){delete _0xc41581[_0xd373('0x56')]['id'];}_0xc41581['body'][_0xd373('0x5b')]=!![];_0xc41581[_0xd373('0x56')][_0xd373('0x5c')]=moment()[_0xd373('0x5d')](_0xd373('0x5e'));_0xc41581[_0xd373('0x56')][_0xd373('0x5f')]=_0xc41581[_0xd373('0x56')][_0xd373('0x5f')]||_0xc41581[_0xd373('0x60')]['id'];return db[_0xd373('0x4f')][_0xd373('0x54')]({'where':{'id':_0xc41581[_0xd373('0x55')]['id'],'UserId':null},'include':[{'model':db[_0xd373('0x61')],'as':_0xd373('0x62')}]})[_0xd373('0x34')](handleEntityNotFound(_0x1f775c,null))[_0xd373('0x34')](saveUpdates(_0xc41581[_0xd373('0x56')],null))[_0xd373('0x34')](function(_0x31542c){if(_0x31542c){_0x4dba1d[_0xd373('0x26')]=_0x31542c[_0xd373('0x63')]({'plain':!![]});return db[_0xd373('0x64')][_0xd373('0x54')]({'where':{'id':_0x31542c[_0xd373('0x65')]}});}return null;})[_0xd373('0x34')](handleEntityNotFound(_0x1f775c,null))['then'](function(_0x18f0e9){if(_0x18f0e9){return _0x18f0e9[_0xd373('0x33')]({'UserId':_0xc41581[_0xd373('0x56')]['UserId'],'read1stAt':_[_0xd373('0x66')](_0x18f0e9[_0xd373('0x67')])?moment()[_0xd373('0x5d')](_0xd373('0x5e')):undefined});}return null;})[_0xd373('0x34')](function(_0x3a7fe3){if(_0x3a7fe3){_0x4dba1d[_0xd373('0x68')]=_0x3a7fe3['get']({'plain':!![]});interaction_log[_0xd373('0x1e')](_0xd373('0x69'),_0xc41581[_0xd373('0x60')]['id'],_0xc41581[_0xd373('0x60')][_0xd373('0x37')],_0xc41581[_0xd373('0x60')][_0xd373('0x6a')],_0x4dba1d[_0xd373('0x68')]['id'],_0xc41581['body']?JSON[_0xd373('0x23')](_0xc41581['body']):_0xd373('0x6b'));return respondWithRpcPromise(_0xd373('0x6c'),_0xd373('0x6d'),_0x4dba1d);}return null;})[_0xd373('0x34')](function(_0x36e7cc){if(_0x36e7cc){if(_0xc41581[_0xd373('0x56')][_0xd373('0x6e')]){_0x4dba1d[_0xd373('0x26')]['interface']=util[_0xd373('0x5d')]('SIP/%s',_0xc41581[_0xd373('0x60')][_0xd373('0x37')]);_0x4dba1d[_0xd373('0x26')][_0xd373('0x6f')]=_0x4dba1d[_0xd373('0x6f')];_0x4dba1d[_0xd373('0x26')][_0xd373('0x70')]='accept';return respondWithRpcPromise(_0xd373('0x71'),_0xd373('0x71'),{'event':_0xd373('0x72'),'message':_0x4dba1d['message']},client9002)[_0xd373('0x34')](function(){return _0x4dba1d;});}return _0x4dba1d;}return null;})[_0xd373('0x34')](respondWithResult(_0x1f775c,null))[_0xd373('0x28')](handleError(_0x1f775c,null));};var interaction_log=require(_0xd373('0x58'))(_0xd373('0x59'));exports[_0xd373('0x31')]=function(_0x6c7c8d,_0x29462f,_0x239c20){var _0x727541={'agent':{},'channel':_0xd373('0x5a')};if(_0x6c7c8d[_0xd373('0x56')]['id']){delete _0x6c7c8d['body']['id'];}_0x6c7c8d[_0xd373('0x56')][_0xd373('0x5f')]=_0x6c7c8d[_0xd373('0x56')]['UserId']||_0x6c7c8d[_0xd373('0x60')]['id'];_0x727541[_0xd373('0x73')]['id']=_0x6c7c8d[_0xd373('0x56')]['UserId'];return db[_0xd373('0x4f')]['find']({'where':{'id':_0x6c7c8d[_0xd373('0x55')]['id'],'UserId':null}})[_0xd373('0x34')](handleEntityNotFound(_0x29462f,null))[_0xd373('0x34')](function(_0x240dd1){if(_0x240dd1){_0x727541['message']=_0x240dd1[_0xd373('0x63')]({'plain':!![]});return db['FaxInteraction'][_0xd373('0x54')]({'where':{'id':_0x240dd1[_0xd373('0x65')]}});}return null;})[_0xd373('0x34')](handleEntityNotFound(_0x29462f,null))[_0xd373('0x34')](function(_0x183565){if(_0x183565){_0x727541[_0xd373('0x68')]=_0x183565['get']({'plain':!![]});interaction_log[_0xd373('0x1e')]('[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x6c7c8d[_0xd373('0x60')]['id'],_0x6c7c8d['user']['name'],_0x6c7c8d[_0xd373('0x60')][_0xd373('0x6a')],_0x727541[_0xd373('0x68')]['id'],_0x6c7c8d[_0xd373('0x56')]?JSON['stringify'](_0x6c7c8d['body']):_0xd373('0x6b'));return respondWithRpcPromise(_0xd373('0x74'),_0xd373('0x75'),_0x727541);}return null;})[_0xd373('0x34')](function(_0x452b28){if(_0x452b28){_0x452b28[_0xd373('0x26')][_0xd373('0x76')]=util[_0xd373('0x5d')](_0xd373('0x77'),_0x6c7c8d[_0xd373('0x60')]['name']);_0x452b28[_0xd373('0x26')][_0xd373('0x6f')]=_0x727541[_0xd373('0x6f')];_0x452b28[_0xd373('0x26')][_0xd373('0x70')]=_0xd373('0x31');respondWithRpcPromise(_0xd373('0x71'),'EventManager',{'event':_0xd373('0x78'),'message':_0x452b28['message']},client9002);return _0x727541;}return null;})['then'](respondWithResult(_0x29462f,null))[_0xd373('0x28')](handleError(_0x29462f,null));};exports[_0xd373('0x79')]=function(_0x2d84af,_0x406b9e){var _0xf11577;return db[_0xd373('0x4f')]['create'](_0x2d84af[_0xd373('0x56')],{})[_0xd373('0x34')](function(_0x6114a5){_0xf11577=_0x6114a5;return db['CmContact'][_0xd373('0x7a')]({'where':{'id':_0xf11577[_0xd373('0x7b')]}});})[_0xd373('0x34')](function(_0x47ae4c){if(_[_0xd373('0x66')](_0x47ae4c)){return;}else{_0xf11577[_0xd373('0x5a')]=_0x47ae4c[_0xd373('0x5a')];return db['Attachment'][_0xd373('0x7a')]({'where':{'id':_0xf11577[_0xd373('0x7c')]}});}})[_0xd373('0x34')](function(_0x33ca89){return respondWithRpcPromise(_0xd373('0x7d'),_0xd373('0x7d'),{'FaxAccountId':_[_0xd373('0x66')](_0x2d84af[_0xd373('0x56')])?undefined:_0x2d84af[_0xd373('0x56')][_0xd373('0x7e')],'path':_[_0xd373('0x66')](_0x33ca89)?undefined:util[_0xd373('0x5d')](_0xd373('0x7f'),_0x33ca89['basename']),'fax':_[_0xd373('0x66')](_0xf11577[_0xd373('0x5a')])?undefined:_0xf11577[_0xd373('0x5a')],'AttachmentId':_0xf11577['AttachmentId']},client9002);})[_0xd373('0x34')](respondWithResult(_0x406b9e,0xc9))[_0xd373('0x28')](handleError(_0x406b9e,null));};exports['download']=function(_0x476501,_0x578096){var _0xf93f6b=path[_0xd373('0x80')](config[_0xd373('0x81')],_0xd373('0x82'),_0xd373('0x83'),_0xd373('0x84'));return db['FaxMessage'][_0xd373('0x54')]({'where':{'id':_0x476501['params']['id']},'include':[{'model':db[_0xd373('0x85')],'as':_0xd373('0x85')}]})[_0xd373('0x34')](handleEntityNotFound(_0x578096,null))[_0xd373('0x34')](function(_0x418f22){if(_0x418f22){return _0x578096['download'](path[_0xd373('0x80')](_0xf93f6b,_0x418f22[_0xd373('0x85')][_0xd373('0x86')]));}})[_0xd373('0x28')](handleError(_0x578096,null));}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.events.js b/server/api/faxMessage/faxMessage.events.js index dc316f2..355a40c 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 _0xfb47=['remove','hasOwnProperty','hook','exports','events','FaxMessage','setMaxListeners','update'];(function(_0x344877,_0x4a3921){var _0x3259cc=function(_0x589691){while(--_0x589691){_0x344877['push'](_0x344877['shift']());}};_0x3259cc(++_0x4a3921);}(_0xfb47,0x1bc));var _0x7fb4=function(_0x4958a7,_0x359668){_0x4958a7=_0x4958a7-0x0;var _0x2bed01=_0xfb47[_0x4958a7];return _0x2bed01;};'use strict';var EventEmitter=require(_0x7fb4('0x0'));var FaxMessage=require('../../mysqldb')['db'][_0x7fb4('0x1')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x7fb4('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x7fb4('0x3'),'afterDestroy':_0x7fb4('0x4')};function emitEvent(_0x45ad74){return function(_0x3a1640,_0x262b70,_0x537bf2){FaxMessageEvents['emit'](_0x45ad74+':'+_0x3a1640['id'],_0x3a1640);FaxMessageEvents['emit'](_0x45ad74,_0x3a1640);_0x537bf2(null);};}for(var e in events){if(events[_0x7fb4('0x5')](e)){var event=events[e];FaxMessage[_0x7fb4('0x6')](e,emitEvent(event));}}module[_0x7fb4('0x7')]=FaxMessageEvents; \ No newline at end of file +var _0xb6a7=['FaxMessage','setMaxListeners','remove','emit','hasOwnProperty','exports','events','../../mysqldb'];(function(_0x4da356,_0x5235e1){var _0x321b07=function(_0x2bc6f4){while(--_0x2bc6f4){_0x4da356['push'](_0x4da356['shift']());}};_0x321b07(++_0x5235e1);}(_0xb6a7,0x15e));var _0x7b6a=function(_0x12f688,_0x585c25){_0x12f688=_0x12f688-0x0;var _0x59c3de=_0xb6a7[_0x12f688];return _0x59c3de;};'use strict';var EventEmitter=require(_0x7b6a('0x0'));var FaxMessage=require(_0x7b6a('0x1'))['db'][_0x7b6a('0x2')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x7b6a('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x7b6a('0x4')};function emitEvent(_0x5d47bc){return function(_0x2499fd,_0x3813f9,_0xec2372){FaxMessageEvents[_0x7b6a('0x5')](_0x5d47bc+':'+_0x2499fd['id'],_0x2499fd);FaxMessageEvents[_0x7b6a('0x5')](_0x5d47bc,_0x2499fd);_0xec2372(null);};}for(var e in events){if(events[_0x7b6a('0x6')](e)){var event=events[e];FaxMessage['hook'](e,emitEvent(event));}}module[_0x7b6a('0x7')]=FaxMessageEvents; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.model.js b/server/api/faxMessage/faxMessage.model.js index d1694ee..7958129 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 _0x879b=['request-promise','path','./faxMessage.attributes','exports','FaxMessage','fax_messages','fti_fax_messages','body','FULLTEXT','models','get','direction','toLowerCase','secret','isNil','UserId','FaxInteraction','findOne','FaxInteractionId','then','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x4bd90d,_0x32001b){var _0x3948ed=function(_0x32eaf9){while(--_0x32eaf9){_0x4bd90d['push'](_0x4bd90d['shift']());}};_0x3948ed(++_0x32001b);}(_0x879b,0xd3));var _0xb879=function(_0x254744,_0x219e6b){_0x254744=_0x254744-0x0;var _0x2a6a96=_0x879b[_0x254744];return _0x2a6a96;};'use strict';var _=require(_0xb879('0x0'));var util=require(_0xb879('0x1'));var logger=require(_0xb879('0x2'))(_0xb879('0x3'));var moment=require(_0xb879('0x4'));var BPromise=require(_0xb879('0x5'));var rp=require(_0xb879('0x6'));var fs=require('fs');var path=require(_0xb879('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xb879('0x8'));module[_0xb879('0x9')]=function(_0x185f73,_0x105491){return _0x185f73['define'](_0xb879('0xa'),attributes,{'tableName':_0xb879('0xb'),'paranoid':![],'indexes':[{'name':_0xb879('0xc'),'fields':[_0xb879('0xd')],'type':_0xb879('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x4bcce1,_0x3cc771,_0x2e7cae){var _0x13b4a5=_0x185f73[_0xb879('0xf')];var _0x480d30=_0x4bcce1[_0xb879('0x10')]({'plain':!![]});if(_0x480d30[_0xb879('0x11')][_0xb879('0x12')]()==='in'||_0x480d30[_0xb879('0x11')]['toLowerCase']()==='out'&&!_0x480d30[_0xb879('0x13')]&&!_[_0xb879('0x14')](_0x480d30[_0xb879('0x15')])){_0x13b4a5[_0xb879('0x16')][_0xb879('0x17')]({'where':{'id':_0x480d30[_0xb879('0x18')]}})[_0xb879('0x19')](function(_0x5cec96){if(_0x5cec96){_0x5cec96['update']({'lastMsgAt':_0x480d30[_0xb879('0x1a')],'lastMsgDirection':_0x480d30[_0xb879('0x11')][_0xb879('0x12')]()});}})[_0xb879('0x1b')](function(_0x306a8b){console[_0xb879('0x1c')](_0x306a8b);});}_0x2e7cae();}},'charset':_0xb879('0x1d'),'collate':_0xb879('0x1e')});}; \ No newline at end of file +var _0x642a=['models','get','toLowerCase','direction','out','isNil','UserId','FaxInteractionId','then','update','catch','utf8mb4','utf8mb4_unicode_ci','lodash','api','bluebird','request-promise','path','rimraf','../../config/environment','./faxMessage.attributes','exports','define','fax_messages','fti_fax_messages','body','FULLTEXT'];(function(_0x21875e,_0x10d26f){var _0xcd1780=function(_0x57e290){while(--_0x57e290){_0x21875e['push'](_0x21875e['shift']());}};_0xcd1780(++_0x10d26f);}(_0x642a,0x94));var _0xa642=function(_0x1a6100,_0x9aa6bd){_0x1a6100=_0x1a6100-0x0;var _0x259e63=_0x642a[_0x1a6100];return _0x259e63;};'use strict';var _=require(_0xa642('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xa642('0x1'));var moment=require('moment');var BPromise=require(_0xa642('0x2'));var rp=require(_0xa642('0x3'));var fs=require('fs');var path=require(_0xa642('0x4'));var rimraf=require(_0xa642('0x5'));var config=require(_0xa642('0x6'));var attributes=require(_0xa642('0x7'));module[_0xa642('0x8')]=function(_0x354047,_0xc54286){return _0x354047[_0xa642('0x9')]('FaxMessage',attributes,{'tableName':_0xa642('0xa'),'paranoid':![],'indexes':[{'name':_0xa642('0xb'),'fields':[_0xa642('0xc')],'type':_0xa642('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0xee44c5,_0x4e806f,_0x4aca78){var _0x1e8f9b=_0x354047[_0xa642('0xe')];var _0xfe4c8f=_0xee44c5[_0xa642('0xf')]({'plain':!![]});if(_0xfe4c8f['direction'][_0xa642('0x10')]()==='in'||_0xfe4c8f[_0xa642('0x11')][_0xa642('0x10')]()===_0xa642('0x12')&&!_0xfe4c8f['secret']&&!_[_0xa642('0x13')](_0xfe4c8f[_0xa642('0x14')])){_0x1e8f9b['FaxInteraction']['findOne']({'where':{'id':_0xfe4c8f[_0xa642('0x15')]}})[_0xa642('0x16')](function(_0x39ab62){if(_0x39ab62){_0x39ab62[_0xa642('0x17')]({'lastMsgAt':_0xfe4c8f['createdAt'],'lastMsgDirection':_0xfe4c8f[_0xa642('0x11')][_0xa642('0x10')]()});}})[_0xa642('0x18')](function(_0xefe6e7){console['error'](_0xefe6e7);});}_0x4aca78();}},'charset':_0xa642('0x19'),'collate':_0xa642('0x1a')});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.rpc.js b/server/api/faxMessage/faxMessage.rpc.js index ad50411..68b040a 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 _0x1b08=['ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./faxMessage.socket','register','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateFaxMessage','FaxMessage','create','body','options','raw','UpdateFaxMessage','update','where','attributes','util','bluebird','randomstring'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x1b08,0x1c5));var _0x81b0=function(_0x1e500e,_0x2c9d74){_0x1e500e=_0x1e500e-0x0;var _0x10dc5e=_0x1b08[_0x1e500e];return _0x10dc5e;};'use strict';var _=require('lodash');var util=require(_0x81b0('0x0'));var moment=require('moment');var BPromise=require(_0x81b0('0x1'));var rs=require(_0x81b0('0x2'));var fs=require('fs');var Redis=require(_0x81b0('0x3'));var db=require(_0x81b0('0x4'))['db'];var utils=require(_0x81b0('0x5'));var logger=require(_0x81b0('0x6'))('rpc');var config=require(_0x81b0('0x7'));var jayson=require(_0x81b0('0x8'));var client=jayson[_0x81b0('0x9')][_0x81b0('0xa')]({'port':0x232a});config[_0x81b0('0xb')]=_['defaults'](config[_0x81b0('0xb')],{'host':_0x81b0('0xc'),'port':0x18eb});var socket=require(_0x81b0('0xd'))(new Redis(config[_0x81b0('0xb')]));require(_0x81b0('0xe'))[_0x81b0('0xf')](socket);function respondWithRpcPromise(_0xb43373,_0x36c505,_0x1d0e8d){return new BPromise(function(_0xb2ecc7,_0x237e1d){return client['request'](_0xb43373,_0x1d0e8d)[_0x81b0('0x10')](function(_0x11fb70){logger[_0x81b0('0x11')](_0x81b0('0x12'),_0x36c505,_0x81b0('0x13'));logger[_0x81b0('0x14')](_0x81b0('0x15'),_0x36c505,_0x81b0('0x13'),JSON[_0x81b0('0x16')](_0x11fb70));if(_0x11fb70[_0x81b0('0x17')]){if(_0x11fb70['error'][_0x81b0('0x18')]===0x1f4){logger[_0x81b0('0x17')](_0x81b0('0x12'),_0x36c505,_0x11fb70[_0x81b0('0x17')][_0x81b0('0x19')]);return _0x237e1d(_0x11fb70[_0x81b0('0x17')]['message']);}logger['error'](_0x81b0('0x12'),_0x36c505,_0x11fb70['error'][_0x81b0('0x19')]);return _0xb2ecc7(_0x11fb70[_0x81b0('0x17')]['message']);}else{logger[_0x81b0('0x11')](_0x81b0('0x12'),_0x36c505,_0x81b0('0x13'));_0xb2ecc7(_0x11fb70[_0x81b0('0x1a')][_0x81b0('0x19')]);}})[_0x81b0('0x1b')](function(_0x16d170){logger[_0x81b0('0x17')](_0x81b0('0x12'),_0x36c505,_0x16d170);_0x237e1d(_0x16d170);});});}exports[_0x81b0('0x1c')]=function(_0x49cac7){var _0x4e9c2e=this;return new Promise(function(_0x4543ab,_0x6186da){return db[_0x81b0('0x1d')][_0x81b0('0x1e')](_0x49cac7[_0x81b0('0x1f')],{'raw':_0x49cac7['options']?_0x49cac7[_0x81b0('0x20')][_0x81b0('0x21')]===undefined?!![]:![]:!![]})[_0x81b0('0x10')](function(_0x2bcca2){logger[_0x81b0('0x11')](_0x81b0('0x1c'),_0x49cac7);logger[_0x81b0('0x14')](_0x81b0('0x1c'),_0x49cac7,JSON[_0x81b0('0x16')](_0x2bcca2));_0x4543ab(_0x2bcca2);})[_0x81b0('0x1b')](function(_0x5b14b3){logger[_0x81b0('0x17')](_0x81b0('0x1c'),_0x5b14b3['message'],_0x49cac7);_0x6186da(_0x4e9c2e[_0x81b0('0x17')](0x1f4,_0x5b14b3[_0x81b0('0x19')]));});});};exports[_0x81b0('0x22')]=function(_0x24ee5a){var _0x2540f8=this;return new Promise(function(_0x2ee2dd,_0x1826c5){return db[_0x81b0('0x1d')][_0x81b0('0x23')](_0x24ee5a['body'],{'raw':_0x24ee5a[_0x81b0('0x20')]?_0x24ee5a['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x24ee5a['options']?_0x24ee5a[_0x81b0('0x20')][_0x81b0('0x24')]||null:null,'attributes':_0x24ee5a[_0x81b0('0x20')]?_0x24ee5a[_0x81b0('0x20')][_0x81b0('0x25')]||null:null,'limit':_0x24ee5a[_0x81b0('0x20')]?_0x24ee5a[_0x81b0('0x20')]['limit']||null:null})[_0x81b0('0x10')](function(_0x2e0bba){logger['info']('UpdateFaxMessage',_0x24ee5a);logger[_0x81b0('0x14')](_0x81b0('0x22'),_0x24ee5a,JSON[_0x81b0('0x16')](_0x2e0bba));_0x2ee2dd(_0x2e0bba);})[_0x81b0('0x1b')](function(_0x484b72){logger['error'](_0x81b0('0x22'),_0x484b72[_0x81b0('0x19')],_0x24ee5a);_0x1826c5(_0x2540f8[_0x81b0('0x17')](0x1f4,_0x484b72[_0x81b0('0x19')]));});});}; \ No newline at end of file +var _0xf902=['then','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','result','catch','CreateFaxMessage','FaxMessage','create','options','stringify','UpdateFaxMessage','update','where','attributes','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request'];(function(_0x3f578f,_0x51f172){var _0x32c754=function(_0x1bd873){while(--_0x1bd873){_0x3f578f['push'](_0x3f578f['shift']());}};_0x32c754(++_0x51f172);}(_0xf902,0x12b));var _0x2f90=function(_0x2a80ca,_0x7fcbc8){_0x2a80ca=_0x2a80ca-0x0;var _0x4d5df9=_0xf902[_0x2a80ca];return _0x4d5df9;};'use strict';var _=require('lodash');var util=require(_0x2f90('0x0'));var moment=require(_0x2f90('0x1'));var BPromise=require(_0x2f90('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2f90('0x3'))['db'];var utils=require(_0x2f90('0x4'));var logger=require(_0x2f90('0x5'))(_0x2f90('0x6'));var config=require('../../config/environment');var jayson=require(_0x2f90('0x7'));var client=jayson[_0x2f90('0x8')][_0x2f90('0x9')]({'port':0x232a});config[_0x2f90('0xa')]=_[_0x2f90('0xb')](config['redis'],{'host':_0x2f90('0xc'),'port':0x18eb});var socket=require(_0x2f90('0xd'))(new Redis(config[_0x2f90('0xa')]));require('./faxMessage.socket')[_0x2f90('0xe')](socket);function respondWithRpcPromise(_0x54cd66,_0x42ddea,_0x3d156f){return new BPromise(function(_0x4cc942,_0x167bc4){return client[_0x2f90('0xf')](_0x54cd66,_0x3d156f)[_0x2f90('0x10')](function(_0x3696e3){logger['info'](_0x2f90('0x11'),_0x42ddea,_0x2f90('0x12'));logger[_0x2f90('0x13')]('FaxMessage,\x20%s,\x20%s,\x20%s',_0x42ddea,_0x2f90('0x12'),JSON['stringify'](_0x3696e3));if(_0x3696e3['error']){if(_0x3696e3[_0x2f90('0x14')][_0x2f90('0x15')]===0x1f4){logger['error'](_0x2f90('0x11'),_0x42ddea,_0x3696e3[_0x2f90('0x14')][_0x2f90('0x16')]);return _0x167bc4(_0x3696e3[_0x2f90('0x14')][_0x2f90('0x16')]);}logger[_0x2f90('0x14')](_0x2f90('0x11'),_0x42ddea,_0x3696e3[_0x2f90('0x14')][_0x2f90('0x16')]);return _0x4cc942(_0x3696e3[_0x2f90('0x14')][_0x2f90('0x16')]);}else{logger[_0x2f90('0x17')](_0x2f90('0x11'),_0x42ddea,_0x2f90('0x12'));_0x4cc942(_0x3696e3[_0x2f90('0x18')][_0x2f90('0x16')]);}})[_0x2f90('0x19')](function(_0x5a0d96){logger[_0x2f90('0x14')](_0x2f90('0x11'),_0x42ddea,_0x5a0d96);_0x167bc4(_0x5a0d96);});});}exports[_0x2f90('0x1a')]=function(_0x18f9c9){var _0x5ce5ae=this;return new Promise(function(_0x52098d,_0x4dde85){return db[_0x2f90('0x1b')][_0x2f90('0x1c')](_0x18f9c9['body'],{'raw':_0x18f9c9[_0x2f90('0x1d')]?_0x18f9c9[_0x2f90('0x1d')]['raw']===undefined?!![]:![]:!![]})[_0x2f90('0x10')](function(_0x303735){logger['info'](_0x2f90('0x1a'),_0x18f9c9);logger[_0x2f90('0x13')](_0x2f90('0x1a'),_0x18f9c9,JSON[_0x2f90('0x1e')](_0x303735));_0x52098d(_0x303735);})['catch'](function(_0x4d39c4){logger[_0x2f90('0x14')](_0x2f90('0x1a'),_0x4d39c4['message'],_0x18f9c9);_0x4dde85(_0x5ce5ae[_0x2f90('0x14')](0x1f4,_0x4d39c4[_0x2f90('0x16')]));});});};exports[_0x2f90('0x1f')]=function(_0x36e37b){var _0x322229=this;return new Promise(function(_0x582c51,_0x3e90c3){return db[_0x2f90('0x1b')][_0x2f90('0x20')](_0x36e37b['body'],{'raw':_0x36e37b[_0x2f90('0x1d')]?_0x36e37b[_0x2f90('0x1d')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x36e37b['options']?_0x36e37b[_0x2f90('0x1d')][_0x2f90('0x21')]||null:null,'attributes':_0x36e37b[_0x2f90('0x1d')]?_0x36e37b[_0x2f90('0x1d')][_0x2f90('0x22')]||null:null,'limit':_0x36e37b[_0x2f90('0x1d')]?_0x36e37b[_0x2f90('0x1d')]['limit']||null:null})[_0x2f90('0x10')](function(_0x35b9e5){logger[_0x2f90('0x17')](_0x2f90('0x1f'),_0x36e37b);logger[_0x2f90('0x13')](_0x2f90('0x1f'),_0x36e37b,JSON[_0x2f90('0x1e')](_0x35b9e5));_0x582c51(_0x35b9e5);})[_0x2f90('0x19')](function(_0x49a8c3){logger[_0x2f90('0x14')](_0x2f90('0x1f'),_0x49a8c3['message'],_0x36e37b);_0x3e90c3(_0x322229['error'](0x1f4,_0x49a8c3[_0x2f90('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.socket.js b/server/api/faxMessage/faxMessage.socket.js index 6df7529..3b6d680 100644 --- a/server/api/faxMessage/faxMessage.socket.js +++ b/server/api/faxMessage/faxMessage.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['register','length','faxMessage:','./faxMessage.events','save','remove','emit','removeListener'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3899d1,_0x4aa04c){_0x3899d1=_0x3899d1-0x0;var _0xeb4a7d=_0xa9e0[_0x3899d1];return _0xeb4a7d;};'use strict';var FaxMessageEvents=require(_0x0a9e('0x0'));var events=[_0x0a9e('0x1'),_0x0a9e('0x2'),'update'];function createListener(_0x550fbc,_0x18d5c9){return function(_0x4ce2f1){_0x18d5c9[_0x0a9e('0x3')](_0x550fbc,_0x4ce2f1);};}function removeListener(_0x432180,_0x2ab90b){return function(){FaxMessageEvents[_0x0a9e('0x4')](_0x432180,_0x2ab90b);};}exports[_0x0a9e('0x5')]=function(_0x57b080){for(var _0x219af0=0x0,_0x441e3a=events[_0x0a9e('0x6')];_0x219af0<_0x441e3a;_0x219af0++){var _0x5f41ea=events[_0x219af0];var _0x503809=createListener(_0x0a9e('0x7')+_0x5f41ea,_0x57b080);FaxMessageEvents['on'](_0x5f41ea,_0x503809);}}; \ No newline at end of file +var _0x9957=['register','length','faxMessage:','./faxMessage.events','save','remove','update','emit','removeListener'];(function(_0x40a77f,_0x1d5f8d){var _0x415aa1=function(_0x1e45bc){while(--_0x1e45bc){_0x40a77f['push'](_0x40a77f['shift']());}};_0x415aa1(++_0x1d5f8d);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'use strict';var FaxMessageEvents=require(_0x7995('0x0'));var events=[_0x7995('0x1'),_0x7995('0x2'),_0x7995('0x3')];function createListener(_0x5b96eb,_0x86c128){return function(_0x3c58eb){_0x86c128[_0x7995('0x4')](_0x5b96eb,_0x3c58eb);};}function removeListener(_0x462a03,_0x576d89){return function(){FaxMessageEvents[_0x7995('0x5')](_0x462a03,_0x576d89);};}exports[_0x7995('0x6')]=function(_0x137b6b){for(var _0x219534=0x0,_0xbda126=events[_0x7995('0x7')];_0x219534<_0xbda126;_0x219534++){var _0x4996ca=events[_0x219534];var _0x465276=createListener(_0x7995('0x8')+_0x4996ca,_0x137b6b);FaxMessageEvents['on'](_0x4996ca,_0x465276);}}; \ No newline at end of file diff --git a/server/api/faxMessage/index.js b/server/api/faxMessage/index.js index 87f2c54..3c1ae84 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 _0xc75f=['/:id/download','post','fax','faxmessage:create','put','update','accept','/:id/reject','reject','delete','destroy','exports','multer','util','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxMessage.controller','get','index','/describe','isAuthenticated','/:id','show'];(function(_0xc6be3a,_0x540e05){var _0x56a310=function(_0x50a144){while(--_0x50a144){_0xc6be3a['push'](_0xc6be3a['shift']());}};_0x56a310(++_0x540e05);}(_0xc75f,0xf6));var _0xfc75=function(_0x3e626d,_0x1621fe){_0x3e626d=_0x3e626d-0x0;var _0x251e7d=_0xc75f[_0x3e626d];return _0x251e7d;};'use strict';var multer=require(_0xfc75('0x0'));var util=require(_0xfc75('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xfc75('0x2'));var router=express[_0xfc75('0x3')]();var auth=require(_0xfc75('0x4'));var interaction=require(_0xfc75('0x5'));var config=require(_0xfc75('0x6'));var controller=require(_0xfc75('0x7'));router[_0xfc75('0x8')]('/',auth['isAuthenticated'](),controller[_0xfc75('0x9')]);router[_0xfc75('0x8')](_0xfc75('0xa'),auth[_0xfc75('0xb')](),controller['describe']);router['get'](_0xfc75('0xc'),auth[_0xfc75('0xb')](),controller[_0xfc75('0xd')]);router[_0xfc75('0x8')](_0xfc75('0xe'),auth[_0xfc75('0xb')](),controller['download']);router[_0xfc75('0xf')]('/',auth[_0xfc75('0xb')](),interaction['tracked'](_0xfc75('0x10'),_0xfc75('0x11')),controller['create']);router[_0xfc75('0x12')](_0xfc75('0xc'),auth['isAuthenticated'](),controller[_0xfc75('0x13')]);router['put']('/:id/accept',auth[_0xfc75('0xb')](),controller[_0xfc75('0x14')]);router[_0xfc75('0x12')](_0xfc75('0x15'),auth[_0xfc75('0xb')](),controller[_0xfc75('0x16')]);router[_0xfc75('0x17')]('/:id',auth[_0xfc75('0xb')](),controller[_0xfc75('0x18')]);module[_0xfc75('0x19')]=router; \ No newline at end of file +var _0x6b74=['../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','/describe','get','/:id','show','/:id/download','download','post','tracked','fax','faxmessage:create','create','put','update','/:id/accept','reject','delete','exports','multer','util','connect-timeout','express'];(function(_0x4a6b43,_0x5cc625){var _0x462362=function(_0x572ba6){while(--_0x572ba6){_0x4a6b43['push'](_0x4a6b43['shift']());}};_0x462362(++_0x5cc625);}(_0x6b74,0xcc));var _0x46b7=function(_0x18f152,_0x41585a){_0x18f152=_0x18f152-0x0;var _0xa10b34=_0x6b74[_0x18f152];return _0xa10b34;};'use strict';var multer=require(_0x46b7('0x0'));var util=require(_0x46b7('0x1'));var path=require('path');var timeout=require(_0x46b7('0x2'));var express=require(_0x46b7('0x3'));var router=express['Router']();var auth=require(_0x46b7('0x4'));var interaction=require(_0x46b7('0x5'));var config=require(_0x46b7('0x6'));var controller=require('./faxMessage.controller');router['get']('/',auth[_0x46b7('0x7')](),controller[_0x46b7('0x8')]);router['get'](_0x46b7('0x9'),auth[_0x46b7('0x7')](),controller['describe']);router[_0x46b7('0xa')](_0x46b7('0xb'),auth[_0x46b7('0x7')](),controller[_0x46b7('0xc')]);router['get'](_0x46b7('0xd'),auth[_0x46b7('0x7')](),controller[_0x46b7('0xe')]);router[_0x46b7('0xf')]('/',auth[_0x46b7('0x7')](),interaction[_0x46b7('0x10')](_0x46b7('0x11'),_0x46b7('0x12')),controller[_0x46b7('0x13')]);router[_0x46b7('0x14')]('/:id',auth[_0x46b7('0x7')](),controller[_0x46b7('0x15')]);router[_0x46b7('0x14')](_0x46b7('0x16'),auth[_0x46b7('0x7')](),controller['accept']);router[_0x46b7('0x14')]('/:id/reject',auth[_0x46b7('0x7')](),controller[_0x46b7('0x17')]);router[_0x46b7('0x18')](_0x46b7('0xb'),auth[_0x46b7('0x7')](),controller['destroy']);module[_0x46b7('0x19')]=router; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.attributes.js b/server/api/faxQueue/faxQueue.attributes.js index 0a162e2..ed04a09 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 _0xf28f=['INTEGER','ENUM','roundrobin','sequelize','STRING','name'];(function(_0x5d008b,_0x12b7b2){var _0x381807=function(_0x270f75){while(--_0x270f75){_0x5d008b['push'](_0x5d008b['shift']());}};_0x381807(++_0x12b7b2);}(_0xf28f,0x6f));var _0xff28=function(_0x1cfa0d,_0x4391f2){_0x1cfa0d=_0x1cfa0d-0x0;var _0xe33279=_0xf28f[_0x1cfa0d];return _0xe33279;};'use strict';var Sequelize=require(_0xff28('0x0'));module['exports']={'name':{'type':Sequelize[_0xff28('0x1')],'unique':_0xff28('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0xff28('0x3')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xff28('0x4')]('rrmemory','beepall',_0xff28('0x5')),'allowNull':![]},'lastAgent':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x617a=['sequelize','exports','STRING','INTEGER','ENUM','beepall','roundrobin'];(function(_0x545b71,_0x4f44eb){var _0x26e587=function(_0x293b81){while(--_0x293b81){_0x545b71['push'](_0x545b71['shift']());}};_0x26e587(++_0x4f44eb);}(_0x617a,0x150));var _0xa617=function(_0x1bdda0,_0x29dedf){_0x1bdda0=_0x1bdda0-0x0;var _0x269a8f=_0x617a[_0x1bdda0];return _0x269a8f;};'use strict';var Sequelize=require(_0xa617('0x0'));module[_0xa617('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xa617('0x2')]},'timeout':{'type':Sequelize[_0xa617('0x3')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xa617('0x4')]('rrmemory',_0xa617('0x5'),_0xa617('0x6')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0xa617('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 9099e68..f9b1785 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 _0xfbc5=['from','team_has_fax_queues','join','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','every','all','union','compact','value','isEmpty','removeAgents','userFaxQueue:remove','omit','spread','isArray','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','to-csv','ejs','squel','jsforce','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','localhost','redis','./faxQueue.socket','register','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','reject','save','update','then','get','FaxQueues','UserProfileResource','error','stack','name','send','index','FaxQueue','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','key','VIRTUAL','field','filter','count','includeAll','include','findAll','rows','catch','params','options','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','destroy','describe','getMembers','findOne','UserFaxQueue','map','User','findAndCountAll','updatedAt','format','SIP','createdAt','Team','rawAttributes','getTeams','ids','Agents','voicePause','interface','flatMap','sequelize','transaction','addTeams','each','findOrCreate','forEach','emit','removeTeams','select','tq.TeamId'];(function(_0x5cd08e,_0x8eb94c){var _0x523d0c=function(_0x3db586){while(--_0x3db586){_0x5cd08e['push'](_0x5cd08e['shift']());}};_0x523d0c(++_0x8eb94c);}(_0xfbc5,0x1ab));var _0x5fbc=function(_0x273826,_0x446d19){_0x273826=_0x273826-0x0;var _0x3a4b70=_0xfbc5[_0x273826];return _0x3a4b70;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x5fbc('0x0'));var zipdir=require(_0x5fbc('0x1'));var jsonpatch=require(_0x5fbc('0x2'));var rp=require(_0x5fbc('0x3'));var moment=require('moment');var BPromise=require(_0x5fbc('0x4'));var Mustache=require(_0x5fbc('0x5'));var util=require(_0x5fbc('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x5fbc('0x7'));var ejs=require(_0x5fbc('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0x5fbc('0x9'));var crypto=require('crypto');var jsforce=require(_0x5fbc('0xa'));var deskjs=require(_0x5fbc('0xb'));var toCsv=require(_0x5fbc('0x7'));var querystring=require('querystring');var Papa=require(_0x5fbc('0xc'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x5fbc('0xd'));var as=require(_0x5fbc('0xe'));var hardwareService=require(_0x5fbc('0xf'));var logger=require(_0x5fbc('0x10'))(_0x5fbc('0x11'));var utils=require(_0x5fbc('0x12'));var config=require(_0x5fbc('0x13'));var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config['redis'],{'host':_0x5fbc('0x14'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5fbc('0x15')]));require(_0x5fbc('0x16'))[_0x5fbc('0x17')](socket);function respondWithStatusCode(_0x49d18a,_0x367407){_0x367407=_0x367407||0xcc;return function(_0x3f657){if(_0x3f657){return _0x49d18a[_0x5fbc('0x18')](_0x367407);}return _0x49d18a[_0x5fbc('0x19')](_0x367407)[_0x5fbc('0x1a')]();};}function respondWithResult(_0x1dc455,_0xc6092f){_0xc6092f=_0xc6092f||0xc8;return function(_0x4cbd9e){if(_0x4cbd9e){return _0x1dc455[_0x5fbc('0x19')](_0xc6092f)[_0x5fbc('0x1b')](_0x4cbd9e);}};}function respondWithFilteredResult(_0x547564,_0xb175bb){return function(_0x14103e){if(_0x14103e){var _0x554bf9=_0x14103e['count'],_0x10a156=_0xb175bb[_0x5fbc('0x1c')],_0x112e81=_0xb175bb[_0x5fbc('0x1c')]+_0xb175bb[_0x5fbc('0x1d')],_0x4280fb;if(_0x112e81>=_0x554bf9){_0x112e81=_0x554bf9;_0x4280fb=0xc8;}else{_0x4280fb=0xce;}_0x547564[_0x5fbc('0x19')](_0x4280fb);return _0x547564[_0x5fbc('0x1e')](_0x5fbc('0x1f'),_0x10a156+'-'+_0x112e81+'/'+_0x554bf9)[_0x5fbc('0x1b')](_0x14103e);}return null;};}function patchUpdates(_0x415cb6){return function(_0x41700c){try{jsonpatch[_0x5fbc('0x20')](_0x41700c,_0x415cb6,!![]);}catch(_0x1f8ebf){return BPromise[_0x5fbc('0x21')](_0x1f8ebf);}return _0x41700c[_0x5fbc('0x22')]();};}function saveUpdates(_0x5d0d1b,_0x2fb4bc){return function(_0x273a98){if(_0x273a98){return _0x273a98[_0x5fbc('0x23')](_0x5d0d1b)[_0x5fbc('0x24')](function(_0x5a1c71){return _0x5a1c71;});}return null;};}function removeEntity(_0x49b0ba,_0x513ade){return function(_0x4df3cb){if(_0x4df3cb){return _0x4df3cb['destroy']()[_0x5fbc('0x24')](function(){var _0x330ff9=_0x4df3cb[_0x5fbc('0x25')]({'plain':!![]});var _0x34be45=_0x5fbc('0x26');return db[_0x5fbc('0x27')]['destroy']({'where':{'type':_0x34be45,'resourceId':_0x330ff9['id']}})[_0x5fbc('0x24')](function(){return _0x4df3cb;});})[_0x5fbc('0x24')](function(){_0x49b0ba[_0x5fbc('0x19')](0xcc)[_0x5fbc('0x1a')]();});}};}function handleEntityNotFound(_0x35766a,_0xf4b75d){return function(_0x2d7357){if(!_0x2d7357){_0x35766a[_0x5fbc('0x18')](0x194);}return _0x2d7357;};}function handleError(_0x1d53c5,_0xa88442){_0xa88442=_0xa88442||0x1f4;return function(_0x1b3b73){logger[_0x5fbc('0x28')](_0x1b3b73[_0x5fbc('0x29')]);if(_0x1b3b73[_0x5fbc('0x2a')]){delete _0x1b3b73[_0x5fbc('0x2a')];}_0x1d53c5[_0x5fbc('0x19')](_0xa88442)[_0x5fbc('0x2b')](_0x1b3b73);};}exports[_0x5fbc('0x2c')]=function(_0x298e55,_0x324500){var _0x4e39bb={},_0x19571c={},_0x14620c={'count':0x0,'rows':[]};var _0x526f8e=db[_0x5fbc('0x2d')]['rawAttributes'];_0x19571c['model']=_['keys'](_0x526f8e);_0x19571c[_0x5fbc('0x2e')]=_[_0x5fbc('0x2f')](_0x298e55['query']);_0x19571c[_0x5fbc('0x30')]=_[_0x5fbc('0x31')](_0x19571c[_0x5fbc('0x32')],_0x19571c[_0x5fbc('0x2e')]);_0x4e39bb[_0x5fbc('0x33')]=_[_0x5fbc('0x31')](_0x19571c[_0x5fbc('0x32')],qs[_0x5fbc('0x34')](_0x298e55[_0x5fbc('0x2e')][_0x5fbc('0x34')]));_0x4e39bb[_0x5fbc('0x33')]=_0x4e39bb['attributes'][_0x5fbc('0x35')]?_0x4e39bb[_0x5fbc('0x33')]:_0x19571c['model'];if(!_0x298e55[_0x5fbc('0x2e')][_0x5fbc('0x36')](_0x5fbc('0x37'))){_0x4e39bb['limit']=qs[_0x5fbc('0x1d')](_0x298e55[_0x5fbc('0x2e')][_0x5fbc('0x1d')]);_0x4e39bb[_0x5fbc('0x1c')]=qs[_0x5fbc('0x1c')](_0x298e55[_0x5fbc('0x2e')][_0x5fbc('0x1c')]);}_0x4e39bb[_0x5fbc('0x38')]=qs[_0x5fbc('0x39')](_0x298e55[_0x5fbc('0x2e')][_0x5fbc('0x39')]);_0x4e39bb[_0x5fbc('0x3a')]=qs[_0x5fbc('0x30')](_[_0x5fbc('0x3b')](_0x298e55[_0x5fbc('0x2e')],_0x19571c[_0x5fbc('0x30')]));if(_0x298e55[_0x5fbc('0x2e')]['filter']){_0x4e39bb[_0x5fbc('0x3a')]=_[_0x5fbc('0x3c')](_0x4e39bb[_0x5fbc('0x3a')],{'$or':_['map'](_0x526f8e,function(_0x34591e){if(_0x34591e[_0x5fbc('0x3d')][_0x5fbc('0x3e')]!==_0x5fbc('0x3f')){var _0x3193ed={};_0x3193ed[_0x34591e[_0x5fbc('0x40')]]={'$like':'%'+_0x298e55['query'][_0x5fbc('0x41')]+'%'};return _0x3193ed;}})});}_0x4e39bb=_[_0x5fbc('0x3c')]({},_0x4e39bb,_0x298e55['options']);var _0x111a9c={'where':_0x4e39bb[_0x5fbc('0x3a')]};return db[_0x5fbc('0x2d')]['count'](_0x111a9c)['then'](function(_0x1e08ab){_0x14620c[_0x5fbc('0x42')]=_0x1e08ab;if(_0x298e55[_0x5fbc('0x2e')][_0x5fbc('0x43')]){_0x4e39bb[_0x5fbc('0x44')]=[{'all':!![]}];}return db['FaxQueue'][_0x5fbc('0x45')](_0x4e39bb);})[_0x5fbc('0x24')](function(_0xf36291){_0x14620c[_0x5fbc('0x46')]=_0xf36291;return _0x14620c;})['then'](respondWithFilteredResult(_0x324500,_0x4e39bb))[_0x5fbc('0x47')](handleError(_0x324500,null));};exports['show']=function(_0x38f25f,_0x24472a){var _0x5c3712={'raw':!![],'where':{'id':_0x38f25f[_0x5fbc('0x48')]['id']}},_0x4e0fff={};_0x4e0fff[_0x5fbc('0x32')]=_['keys'](db[_0x5fbc('0x2d')]['rawAttributes']);_0x4e0fff[_0x5fbc('0x2e')]=_['keys'](_0x38f25f[_0x5fbc('0x2e')]);_0x4e0fff[_0x5fbc('0x30')]=_[_0x5fbc('0x31')](_0x4e0fff['model'],_0x4e0fff[_0x5fbc('0x2e')]);_0x5c3712[_0x5fbc('0x33')]=_[_0x5fbc('0x31')](_0x4e0fff['model'],qs[_0x5fbc('0x34')](_0x38f25f['query']['fields']));_0x5c3712[_0x5fbc('0x33')]=_0x5c3712[_0x5fbc('0x33')][_0x5fbc('0x35')]?_0x5c3712['attributes']:_0x4e0fff[_0x5fbc('0x32')];if(_0x38f25f[_0x5fbc('0x2e')][_0x5fbc('0x43')]){_0x5c3712[_0x5fbc('0x44')]=[{'all':!![]}];}_0x5c3712=_[_0x5fbc('0x3c')]({},_0x5c3712,_0x38f25f[_0x5fbc('0x49')]);return db[_0x5fbc('0x2d')]['find'](_0x5c3712)['then'](handleEntityNotFound(_0x24472a,null))[_0x5fbc('0x24')](respondWithResult(_0x24472a,null))[_0x5fbc('0x47')](handleError(_0x24472a,null));};exports[_0x5fbc('0x4a')]=function(_0x515293,_0x3c5428){return db['FaxQueue']['create'](_0x515293[_0x5fbc('0x4b')],{})[_0x5fbc('0x24')](function(_0x3bf327){var _0x46192f=_0x515293[_0x5fbc('0x4c')]['get']({'plain':!![]});if(!_0x46192f)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x46192f[_0x5fbc('0x4d')]==='user'){var _0xab30d1=_0x3bf327[_0x5fbc('0x25')]({'plain':!![]});var _0x5407f5=_0x5fbc('0x26');return db[_0x5fbc('0x4e')]['find']({'where':{'name':_0x5407f5,'userProfileId':_0x46192f[_0x5fbc('0x4f')]},'raw':!![]})[_0x5fbc('0x24')](function(_0x450124){if(_0x450124&&_0x450124[_0x5fbc('0x50')]===0x0){return db[_0x5fbc('0x27')][_0x5fbc('0x4a')]({'name':_0xab30d1[_0x5fbc('0x2a')],'resourceId':_0xab30d1['id'],'type':_0x450124[_0x5fbc('0x2a')],'sectionId':_0x450124['id']},{})[_0x5fbc('0x24')](function(){return _0x3bf327;});}else{return _0x3bf327;}})[_0x5fbc('0x47')](function(_0x2eb6aa){logger[_0x5fbc('0x28')](_0x5fbc('0x51'),_0x2eb6aa);throw _0x2eb6aa;});}return _0x3bf327;})[_0x5fbc('0x24')](respondWithResult(_0x3c5428,0xc9))['catch'](handleError(_0x3c5428,null));};exports[_0x5fbc('0x23')]=function(_0x14186a,_0x8993e0){if(_0x14186a[_0x5fbc('0x4b')]['id']){delete _0x14186a['body']['id'];}return db['FaxQueue'][_0x5fbc('0x52')]({'where':{'id':_0x14186a[_0x5fbc('0x48')]['id']}})[_0x5fbc('0x24')](handleEntityNotFound(_0x8993e0,null))[_0x5fbc('0x24')](saveUpdates(_0x14186a['body'],null))[_0x5fbc('0x24')](respondWithResult(_0x8993e0,null))[_0x5fbc('0x47')](handleError(_0x8993e0,null));};exports[_0x5fbc('0x53')]=function(_0x5a8ded,_0x3d0659){return db[_0x5fbc('0x2d')][_0x5fbc('0x52')]({'where':{'id':_0x5a8ded['params']['id']}})[_0x5fbc('0x24')](handleEntityNotFound(_0x3d0659,null))['then'](removeEntity(_0x3d0659,null))['catch'](handleError(_0x3d0659,null));};exports[_0x5fbc('0x54')]=function(_0x41d275,_0x4044ab){return db[_0x5fbc('0x2d')]['describe']()['then'](respondWithResult(_0x4044ab,null))[_0x5fbc('0x47')](handleError(_0x4044ab,null));};exports[_0x5fbc('0x55')]=function(_0x4598d9,_0x6ada5a,_0x36b549){var _0x578365={'raw':!![],'where':{}},_0x3a071a={},_0x5384e3;return db[_0x5fbc('0x2d')][_0x5fbc('0x56')]({'where':{'id':_0x4598d9[_0x5fbc('0x48')]['id']}})[_0x5fbc('0x24')](handleEntityNotFound(_0x6ada5a,null))[_0x5fbc('0x24')](function(_0x29d046){if(_0x29d046){_0x5384e3=_0x29d046[_0x5fbc('0x25')]({'plain':!![]});_0x3a071a[_0x5fbc('0x32')]=_['keys'](db[_0x5fbc('0x57')]['rawAttributes']);_0x3a071a['query']=_[_0x5fbc('0x2f')](_0x4598d9[_0x5fbc('0x2e')]);_0x3a071a['filters']=_[_0x5fbc('0x31')](_0x3a071a['model'],_0x3a071a[_0x5fbc('0x2e')]);_0x578365[_0x5fbc('0x33')]=_[_0x5fbc('0x31')](_0x3a071a[_0x5fbc('0x32')],qs[_0x5fbc('0x34')](_0x4598d9[_0x5fbc('0x2e')][_0x5fbc('0x34')]));_0x578365[_0x5fbc('0x33')]=_0x578365[_0x5fbc('0x33')][_0x5fbc('0x35')]?_0x578365['attributes']:_0x3a071a[_0x5fbc('0x32')];if(!_0x4598d9['query']['hasOwnProperty'](_0x5fbc('0x37'))){_0x578365[_0x5fbc('0x1d')]=qs['limit'](_0x4598d9[_0x5fbc('0x2e')][_0x5fbc('0x1d')]);_0x578365[_0x5fbc('0x1c')]=qs['offset'](_0x4598d9[_0x5fbc('0x2e')][_0x5fbc('0x1c')]);}_0x578365[_0x5fbc('0x38')]=qs['sort'](_0x4598d9[_0x5fbc('0x2e')]['sort']);_0x578365[_0x5fbc('0x3a')]=qs[_0x5fbc('0x30')](_[_0x5fbc('0x3b')](_0x4598d9[_0x5fbc('0x2e')],_0x3a071a[_0x5fbc('0x30')]));_0x578365['where']['FaxQueueId']=_0x29d046['id'];if(_0x4598d9['query']['filter']){_0x578365['where']=_[_0x5fbc('0x3c')](_0x578365[_0x5fbc('0x3a')],{'$or':_[_0x5fbc('0x58')](_0x578365[_0x5fbc('0x33')],function(_0x1757cd){var _0x18d33b={};_0x18d33b[_0x1757cd]={'$like':'%'+_0x4598d9['query'][_0x5fbc('0x41')]+'%'};return _0x18d33b;})});}_0x578365=_['merge']({},_0x578365,_0x4598d9[_0x5fbc('0x49')]);return db[_0x5fbc('0x57')][_0x5fbc('0x45')](_0x578365);}})[_0x5fbc('0x24')](function(_0xc522f3){if(_0xc522f3){return db[_0x5fbc('0x59')][_0x5fbc('0x5a')]({'where':{'id':_[_0x5fbc('0x58')](_0xc522f3,'UserId'),'role':'agent'},'attributes':['id','name','faxPause',_0x5fbc('0x5b'),'createdAt']});}})[_0x5fbc('0x24')](function(_0x235f22){if(_0x235f22){return{'count':_0x235f22['count'],'rows':_[_0x5fbc('0x58')](_0x235f22[_0x5fbc('0x46')],function(_0x21617f){return{'membername':_0x21617f[_0x5fbc('0x2a')],'UserId':_0x21617f['id'],'queue_name':_0x5384e3['name'],'FaxQueueId':_0x5384e3['id'],'interface':util[_0x5fbc('0x5c')]('%s/%s',_0x5fbc('0x5d'),_0x21617f[_0x5fbc('0x2a')]),'penalty':0x0,'paused':_0x21617f['faxPause'],'createdAt':_0x21617f[_0x5fbc('0x5e')],'updatedAt':_0x21617f['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x5fbc('0x24')](respondWithFilteredResult(_0x6ada5a,_0x578365))[_0x5fbc('0x47')](handleError(_0x6ada5a,null));};exports['getTeams']=function(_0x5e8c53,_0x3d9e44,_0x319d34){var _0x521d0d={};var _0x4d8c1e={};var _0x3de608;var _0x377f06;return db[_0x5fbc('0x2d')][_0x5fbc('0x56')]({'where':{'id':_0x5e8c53[_0x5fbc('0x48')]['id']}})[_0x5fbc('0x24')](handleEntityNotFound(_0x3d9e44,null))['then'](function(_0x3f6e7d){if(_0x3f6e7d){_0x3de608=_0x3f6e7d;_0x4d8c1e[_0x5fbc('0x32')]=_['keys'](db[_0x5fbc('0x5f')][_0x5fbc('0x60')]);_0x4d8c1e[_0x5fbc('0x2e')]=_[_0x5fbc('0x2f')](_0x5e8c53[_0x5fbc('0x2e')]);_0x4d8c1e['filters']=_['intersection'](_0x4d8c1e[_0x5fbc('0x32')],_0x4d8c1e[_0x5fbc('0x2e')]);_0x521d0d['attributes']=_[_0x5fbc('0x31')](_0x4d8c1e['model'],qs[_0x5fbc('0x34')](_0x5e8c53[_0x5fbc('0x2e')][_0x5fbc('0x34')]));_0x521d0d[_0x5fbc('0x33')]=_0x521d0d[_0x5fbc('0x33')][_0x5fbc('0x35')]?_0x521d0d[_0x5fbc('0x33')]:_0x4d8c1e[_0x5fbc('0x32')];_0x521d0d['order']=qs['sort'](_0x5e8c53[_0x5fbc('0x2e')]['sort']);_0x521d0d[_0x5fbc('0x3a')]=qs['filters'](_[_0x5fbc('0x3b')](_0x5e8c53[_0x5fbc('0x2e')],_0x4d8c1e[_0x5fbc('0x30')]));if(_0x5e8c53[_0x5fbc('0x2e')][_0x5fbc('0x41')]){_0x521d0d[_0x5fbc('0x3a')]=_['merge'](_0x521d0d['where'],{'$or':_[_0x5fbc('0x58')](_0x521d0d[_0x5fbc('0x33')],function(_0xaa4789){var _0x24b637={};_0x24b637[_0xaa4789]={'$like':'%'+_0x5e8c53[_0x5fbc('0x2e')][_0x5fbc('0x41')]+'%'};return _0x24b637;})});}_0x521d0d=_[_0x5fbc('0x3c')]({},_0x521d0d,_0x5e8c53[_0x5fbc('0x49')]);return _0x3de608[_0x5fbc('0x61')](_0x521d0d);}})[_0x5fbc('0x24')](function(_0x1ef9df){if(_0x1ef9df){_0x377f06=_0x1ef9df[_0x5fbc('0x35')];if(!_0x5e8c53['query'][_0x5fbc('0x36')](_0x5fbc('0x37'))){_0x521d0d[_0x5fbc('0x1d')]=qs[_0x5fbc('0x1d')](_0x5e8c53['query'][_0x5fbc('0x1d')]);_0x521d0d[_0x5fbc('0x1c')]=qs[_0x5fbc('0x1c')](_0x5e8c53[_0x5fbc('0x2e')]['offset']);}return _0x3de608[_0x5fbc('0x61')](_0x521d0d);}})[_0x5fbc('0x24')](function(_0x33bbf8){if(_0x33bbf8){return _0x33bbf8?{'count':_0x377f06,'rows':_0x33bbf8}:null;}})[_0x5fbc('0x24')](respondWithResult(_0x3d9e44,null))[_0x5fbc('0x47')](handleError(_0x3d9e44,null));};exports['addTeams']=function(_0x464ef9,_0x489bc5,_0x48525c){var _0x101bc3=_0x464ef9[_0x5fbc('0x4b')][_0x5fbc('0x62')];return db[_0x5fbc('0x5f')][_0x5fbc('0x45')]({'where':{'id':_0x101bc3},'attributes':['id'],'include':[{'model':db[_0x5fbc('0x59')],'as':_0x5fbc('0x63'),'attributes':['id',_0x5fbc('0x2a'),'online',_0x5fbc('0x64'),_0x5fbc('0x65')],'raw':!![]}]})[_0x5fbc('0x24')](function(_0xe1ed69){if(_0xe1ed69){var _0x38c36d=_[_0x5fbc('0x66')](_0xe1ed69,function(_0x125c82){var _0x213c96=_0x125c82[_0x5fbc('0x25')]({'plain':!![]});return _0x213c96[_0x5fbc('0x63')];});return db[_0x5fbc('0x2d')][_0x5fbc('0x52')]({'where':{'id':_0x464ef9[_0x5fbc('0x48')]['id']}})[_0x5fbc('0x24')](function(_0x5646ad){return db[_0x5fbc('0x67')][_0x5fbc('0x68')](function(_0x5cb845){return _0x5646ad[_0x5fbc('0x69')](_0x101bc3,{'transaction':_0x5cb845})[_0x5fbc('0x24')](function(){return BPromise[_0x5fbc('0x6a')](_0x38c36d,function(_0x4976cc){return db[_0x5fbc('0x57')][_0x5fbc('0x6b')]({'where':{'UserId':_0x4976cc['id'],'FaxQueueId':_0x464ef9[_0x5fbc('0x48')]['id']},'transaction':_0x5cb845});});})[_0x5fbc('0x24')](function(){_0x38c36d[_0x5fbc('0x6c')](function(_0xeaaa2b){socket[_0x5fbc('0x6d')]('userFaxQueue:save',{'UserId':_0xeaaa2b['id'],'FaxQueueId':_0x5646ad['id']});});});});});}})[_0x5fbc('0x24')](respondWithStatusCode(_0x489bc5,null))[_0x5fbc('0x47')](handleError(_0x489bc5,null));};exports[_0x5fbc('0x6e')]=function(_0x4da241,_0x2ac17c,_0x25d9cc){return db[_0x5fbc('0x5f')][_0x5fbc('0x45')]({'where':{'id':_0x4da241[_0x5fbc('0x2e')][_0x5fbc('0x62')]},'attributes':['id'],'include':[{'model':db[_0x5fbc('0x59')],'as':_0x5fbc('0x63'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x2ac17c,null))[_0x5fbc('0x24')](function(_0x4b5b93){var _0x3d5a9c=_['map'](_0x4b5b93,'id');var _0x221170=[];var _0x350e04=[];var _0x303e4c=squel[_0x5fbc('0x6f')]();_0x303e4c['field'](_0x5fbc('0x70'))[_0x5fbc('0x71')](_0x5fbc('0x72'),'tq')[_0x5fbc('0x73')]('user_has_teams','ut',_0x5fbc('0x74'))['where'](_0x5fbc('0x75'),_0x4da241['params']['id']);for(var _0x1b574a=0x0;_0x1b574a<_0x4b5b93['length'];_0x1b574a+=0x1){let _0xf0ee54=_0x4b5b93[_0x1b574a];for(var _0x54f352=0x0;_0x54f352<_0xf0ee54[_0x5fbc('0x63')][_0x5fbc('0x35')];_0x54f352+=0x1){let _0xb6ca7e=_0xf0ee54[_0x5fbc('0x63')][_0x54f352];var _0x3568b0=_0x303e4c[_0x5fbc('0x76')]();_0x3568b0[_0x5fbc('0x3a')](_0x5fbc('0x77'),_0xb6ca7e['id']);_0x350e04[_0x5fbc('0x78')](db['sequelize']['query'](_0x3568b0[_0x5fbc('0x79')](),{'type':db[_0x5fbc('0x67')][_0x5fbc('0x7a')]['SELECT']})[_0x5fbc('0x24')](function(_0x3d81f9){if(_0x3d81f9[_0x5fbc('0x35')]===0x1){return _0xb6ca7e['id'];}else{var _0xdfac9=_[_0x5fbc('0x7b')](_[_0x5fbc('0x58')](_0x3d81f9,'TeamId'),function(_0x5e63b2){return _['includes'](_0x3d5a9c,_0x5e63b2);});if(_0xdfac9){return _0xb6ca7e['id'];}}}));}}return BPromise[_0x5fbc('0x7c')](_0x350e04)[_0x5fbc('0x24')](function(_0x4b47ad){_0x221170=_(_0x221170)[_0x5fbc('0x7d')](_0x4b47ad)[_0x5fbc('0x7e')]()[_0x5fbc('0x7f')]();return db[_0x5fbc('0x2d')][_0x5fbc('0x52')]({'where':{'id':_0x4da241[_0x5fbc('0x48')]['id']}})[_0x5fbc('0x24')](function(_0x1e5cd1){return db[_0x5fbc('0x67')][_0x5fbc('0x68')](function(_0xfa9730){return _0x1e5cd1['removeTeams'](_0x4da241[_0x5fbc('0x2e')][_0x5fbc('0x62')],{'transaction':_0xfa9730})[_0x5fbc('0x24')](function(){if(!_[_0x5fbc('0x80')](_0x221170)){return _0x1e5cd1[_0x5fbc('0x81')](_0x221170,{'transaction':_0xfa9730});}})['then'](function(){_0x221170[_0x5fbc('0x6c')](function(_0x2dca15){socket['emit'](_0x5fbc('0x82'),{'UserId':_0x2dca15,'FaxQueueId':_0x1e5cd1['id']});});});});});});})[_0x5fbc('0x24')](respondWithStatusCode(_0x2ac17c,null))[_0x5fbc('0x47')](handleError(_0x2ac17c,null));};exports['addAgents']=function(_0x59bc51,_0x39b5e3,_0xf0645c){return db['FaxQueue'][_0x5fbc('0x52')]({'where':{'id':_0x59bc51[_0x5fbc('0x48')]['id']}})[_0x5fbc('0x24')](handleEntityNotFound(_0x39b5e3,null))[_0x5fbc('0x24')](function(_0x2d0656){if(_0x2d0656){return _0x2d0656['addAgents'](_0x59bc51[_0x5fbc('0x4b')][_0x5fbc('0x62')],_[_0x5fbc('0x83')](_0x59bc51[_0x5fbc('0x4b')],[_0x5fbc('0x62'),'id'])||{})[_0x5fbc('0x84')](function(_0x4e3b75){for(var _0x5a98c9=0x0;_0x5a98c9<_0x59bc51[_0x5fbc('0x4b')][_0x5fbc('0x62')][_0x5fbc('0x35')];_0x5a98c9+=0x1){socket['emit']('userFaxQueue:save',{'UserId':_0x59bc51['body'][_0x5fbc('0x62')][_0x5a98c9],'FaxQueueId':_0x59bc51[_0x5fbc('0x48')]['id']});}return _0x4e3b75;});}})[_0x5fbc('0x24')](respondWithResult(_0x39b5e3,null))[_0x5fbc('0x47')](handleError(_0x39b5e3,null));};exports[_0x5fbc('0x81')]=function(_0x5788ad,_0x52f80e,_0x10d4d1){return db[_0x5fbc('0x2d')][_0x5fbc('0x52')]({'where':{'id':_0x5788ad[_0x5fbc('0x48')]['id']}})[_0x5fbc('0x24')](handleEntityNotFound(_0x52f80e,null))[_0x5fbc('0x24')](function(_0x5d52fe){if(_0x5d52fe){return _0x5d52fe[_0x5fbc('0x81')](_0x5788ad[_0x5fbc('0x2e')]['ids'])[_0x5fbc('0x24')](function(){if(_[_0x5fbc('0x85')](_0x5788ad[_0x5fbc('0x2e')][_0x5fbc('0x62')])){for(var _0x1a01bb=0x0;_0x1a01bb<_0x5788ad[_0x5fbc('0x2e')][_0x5fbc('0x62')]['length'];_0x1a01bb+=0x1){socket[_0x5fbc('0x6d')](_0x5fbc('0x82'),{'UserId':Number(_0x5788ad[_0x5fbc('0x2e')][_0x5fbc('0x62')][_0x1a01bb]),'FaxQueueId':Number(_0x5788ad[_0x5fbc('0x48')]['id'])});}}else{socket[_0x5fbc('0x6d')](_0x5fbc('0x82'),{'UserId':Number(_0x5788ad[_0x5fbc('0x2e')][_0x5fbc('0x62')]),'FaxQueueId':Number(_0x5788ad[_0x5fbc('0x48')]['id'])});}});}})[_0x5fbc('0x24')](respondWithStatusCode(_0x52f80e,null))['catch'](handleError(_0x52f80e,null));};exports[_0x5fbc('0x86')]=function(_0x3f6cda,_0x760ac2,_0x277b3b){var _0x1adf32={};var _0x3312d8={};var _0x6bef0b;var _0x1368d9;return db['FaxQueue'][_0x5fbc('0x56')]({'where':{'id':_0x3f6cda['params']['id']}})[_0x5fbc('0x24')](handleEntityNotFound(_0x760ac2,null))[_0x5fbc('0x24')](function(_0x35e978){if(_0x35e978){_0x6bef0b=_0x35e978;_0x3312d8['model']=_[_0x5fbc('0x2f')](db[_0x5fbc('0x59')][_0x5fbc('0x60')]);_0x3312d8[_0x5fbc('0x2e')]=_['keys'](_0x3f6cda['query']);_0x3312d8['filters']=_['intersection'](_0x3312d8[_0x5fbc('0x32')],_0x3312d8['query']);_0x1adf32[_0x5fbc('0x33')]=_['intersection'](_0x3312d8[_0x5fbc('0x32')],qs['fields'](_0x3f6cda[_0x5fbc('0x2e')][_0x5fbc('0x34')]));_0x1adf32['attributes']=_0x1adf32[_0x5fbc('0x33')][_0x5fbc('0x35')]?_0x1adf32[_0x5fbc('0x33')]:_0x3312d8[_0x5fbc('0x32')];_0x1adf32['order']=qs[_0x5fbc('0x39')](_0x3f6cda[_0x5fbc('0x2e')]['sort']);_0x1adf32[_0x5fbc('0x3a')]=qs[_0x5fbc('0x30')](_[_0x5fbc('0x3b')](_0x3f6cda[_0x5fbc('0x2e')],_0x3312d8[_0x5fbc('0x30')]));if(_0x3f6cda[_0x5fbc('0x2e')]['filter']){_0x1adf32['where']=_[_0x5fbc('0x3c')](_0x1adf32[_0x5fbc('0x3a')],{'$or':_['map'](_0x1adf32['attributes'],function(_0x47a60d){var _0x116b29={};_0x116b29[_0x47a60d]={'$like':'%'+_0x3f6cda['query']['filter']+'%'};return _0x116b29;})});}_0x1adf32=_[_0x5fbc('0x3c')]({},_0x1adf32,_0x3f6cda['options']);return _0x6bef0b[_0x5fbc('0x86')](_0x1adf32);}})['then'](function(_0x30b9cd){if(_0x30b9cd){_0x1368d9=_0x30b9cd['length'];if(!_0x3f6cda[_0x5fbc('0x2e')]['hasOwnProperty'](_0x5fbc('0x37'))){_0x1adf32[_0x5fbc('0x1d')]=qs[_0x5fbc('0x1d')](_0x3f6cda['query']['limit']);_0x1adf32['offset']=qs['offset'](_0x3f6cda[_0x5fbc('0x2e')][_0x5fbc('0x1c')]);}return _0x6bef0b[_0x5fbc('0x86')](_0x1adf32);}})[_0x5fbc('0x24')](function(_0x3c6dc4){if(_0x3c6dc4){return _0x3c6dc4?{'count':_0x1368d9,'rows':_0x3c6dc4}:null;}})['then'](respondWithResult(_0x760ac2,null))[_0x5fbc('0x47')](handleError(_0x760ac2,null));}; \ No newline at end of file +var _0xff99=['every','TeamId','includes','all','union','compact','value','removeTeams','isEmpty','removeAgents','forEach','userFaxQueue:remove','addAgents','omit','spread','isArray','getAgents','eml-format','zip-dir','bluebird','mustache','util','path','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','socket.io-emitter','./faxQueue.socket','register','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','save','then','destroy','FaxQueues','end','error','stack','name','send','index','rawAttributes','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','field','includeAll','include','FaxQueue','rows','show','params','options','find','catch','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','update','describe','getMembers','findOne','UserFaxQueue','findAll','User','findAndCountAll','UserId','agent','faxPause','updatedAt','format','SIP','createdAt','getTeams','Team','addTeams','ids','Agents','interface','flatMap','sequelize','transaction','each','emit','userFaxQueue:save','select','tq.TeamId','from','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT'];(function(_0x5528c3,_0x35a416){var _0x47ec1b=function(_0x54a18e){while(--_0x54a18e){_0x5528c3['push'](_0x5528c3['shift']());}};_0x47ec1b(++_0x35a416);}(_0xff99,0x129));var _0x9ff9=function(_0x39591d,_0x23b0de){_0x39591d=_0x39591d-0x0;var _0x2e2fe3=_0xff99[_0x39591d];return _0x2e2fe3;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x9ff9('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9ff9('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x9ff9('0x2'));var Mustache=require(_0x9ff9('0x3'));var util=require(_0x9ff9('0x4'));var path=require(_0x9ff9('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x9ff9('0x6'));var fs=require('fs');var _=require(_0x9ff9('0x7'));var squel=require(_0x9ff9('0x8'));var crypto=require(_0x9ff9('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x9ff9('0xa'));var toCsv=require('to-csv');var querystring=require(_0x9ff9('0xb'));var Papa=require(_0x9ff9('0xc'));var Redis=require(_0x9ff9('0xd'));var authService=require(_0x9ff9('0xe'));var qs=require(_0x9ff9('0xf'));var as=require(_0x9ff9('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9ff9('0x11'))('api');var utils=require(_0x9ff9('0x12'));var config=require(_0x9ff9('0x13'));var db=require(_0x9ff9('0x14'))['db'];config[_0x9ff9('0x15')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x9ff9('0x16'))(new Redis(config[_0x9ff9('0x15')]));require(_0x9ff9('0x17'))[_0x9ff9('0x18')](socket);function respondWithStatusCode(_0x36d793,_0x38a44f){_0x38a44f=_0x38a44f||0xcc;return function(_0x32ce7d){if(_0x32ce7d){return _0x36d793[_0x9ff9('0x19')](_0x38a44f);}return _0x36d793[_0x9ff9('0x1a')](_0x38a44f)['end']();};}function respondWithResult(_0x1ea28c,_0x177542){_0x177542=_0x177542||0xc8;return function(_0x34c159){if(_0x34c159){return _0x1ea28c[_0x9ff9('0x1a')](_0x177542)[_0x9ff9('0x1b')](_0x34c159);}};}function respondWithFilteredResult(_0x45935c,_0x42b7da){return function(_0x2cc54d){if(_0x2cc54d){var _0xd46e75=_0x2cc54d[_0x9ff9('0x1c')],_0x3e720c=_0x42b7da[_0x9ff9('0x1d')],_0x2400ac=_0x42b7da[_0x9ff9('0x1d')]+_0x42b7da[_0x9ff9('0x1e')],_0xbadc67;if(_0x2400ac>=_0xd46e75){_0x2400ac=_0xd46e75;_0xbadc67=0xc8;}else{_0xbadc67=0xce;}_0x45935c['status'](_0xbadc67);return _0x45935c[_0x9ff9('0x1f')](_0x9ff9('0x20'),_0x3e720c+'-'+_0x2400ac+'/'+_0xd46e75)[_0x9ff9('0x1b')](_0x2cc54d);}return null;};}function patchUpdates(_0x51cee9){return function(_0x13e7d4){try{jsonpatch[_0x9ff9('0x21')](_0x13e7d4,_0x51cee9,!![]);}catch(_0x1470d1){return BPromise[_0x9ff9('0x22')](_0x1470d1);}return _0x13e7d4[_0x9ff9('0x23')]();};}function saveUpdates(_0x1e93c4,_0x387038){return function(_0xb152a3){if(_0xb152a3){return _0xb152a3['update'](_0x1e93c4)[_0x9ff9('0x24')](function(_0x46748b){return _0x46748b;});}return null;};}function removeEntity(_0x59a6b4,_0x63e2ae){return function(_0xc4e543){if(_0xc4e543){return _0xc4e543[_0x9ff9('0x25')]()[_0x9ff9('0x24')](function(){var _0x4895ff=_0xc4e543['get']({'plain':!![]});var _0x12e818=_0x9ff9('0x26');return db['UserProfileResource'][_0x9ff9('0x25')]({'where':{'type':_0x12e818,'resourceId':_0x4895ff['id']}})['then'](function(){return _0xc4e543;});})['then'](function(){_0x59a6b4[_0x9ff9('0x1a')](0xcc)[_0x9ff9('0x27')]();});}};}function handleEntityNotFound(_0x194669,_0x58676d){return function(_0x59643){if(!_0x59643){_0x194669[_0x9ff9('0x19')](0x194);}return _0x59643;};}function handleError(_0x2d4970,_0x66ad20){_0x66ad20=_0x66ad20||0x1f4;return function(_0x23b00d){logger[_0x9ff9('0x28')](_0x23b00d[_0x9ff9('0x29')]);if(_0x23b00d[_0x9ff9('0x2a')]){delete _0x23b00d[_0x9ff9('0x2a')];}_0x2d4970[_0x9ff9('0x1a')](_0x66ad20)[_0x9ff9('0x2b')](_0x23b00d);};}exports[_0x9ff9('0x2c')]=function(_0x11b9e3,_0x5e7f82){var _0x4d6fdc={},_0x51f85c={},_0x3fae0c={'count':0x0,'rows':[]};var _0x97f652=db['FaxQueue'][_0x9ff9('0x2d')];_0x51f85c[_0x9ff9('0x2e')]=_[_0x9ff9('0x2f')](_0x97f652);_0x51f85c[_0x9ff9('0x30')]=_['keys'](_0x11b9e3['query']);_0x51f85c[_0x9ff9('0x31')]=_['intersection'](_0x51f85c['model'],_0x51f85c[_0x9ff9('0x30')]);_0x4d6fdc['attributes']=_[_0x9ff9('0x32')](_0x51f85c[_0x9ff9('0x2e')],qs['fields'](_0x11b9e3['query'][_0x9ff9('0x33')]));_0x4d6fdc[_0x9ff9('0x34')]=_0x4d6fdc[_0x9ff9('0x34')][_0x9ff9('0x35')]?_0x4d6fdc[_0x9ff9('0x34')]:_0x51f85c[_0x9ff9('0x2e')];if(!_0x11b9e3[_0x9ff9('0x30')][_0x9ff9('0x36')](_0x9ff9('0x37'))){_0x4d6fdc['limit']=qs[_0x9ff9('0x1e')](_0x11b9e3[_0x9ff9('0x30')]['limit']);_0x4d6fdc[_0x9ff9('0x1d')]=qs[_0x9ff9('0x1d')](_0x11b9e3[_0x9ff9('0x30')][_0x9ff9('0x1d')]);}_0x4d6fdc[_0x9ff9('0x38')]=qs[_0x9ff9('0x39')](_0x11b9e3['query'][_0x9ff9('0x39')]);_0x4d6fdc[_0x9ff9('0x3a')]=qs[_0x9ff9('0x31')](_[_0x9ff9('0x3b')](_0x11b9e3[_0x9ff9('0x30')],_0x51f85c[_0x9ff9('0x31')]));if(_0x11b9e3[_0x9ff9('0x30')][_0x9ff9('0x3c')]){_0x4d6fdc[_0x9ff9('0x3a')]=_[_0x9ff9('0x3d')](_0x4d6fdc[_0x9ff9('0x3a')],{'$or':_[_0x9ff9('0x3e')](_0x97f652,function(_0x376c37){if(_0x376c37['type']['key']!==_0x9ff9('0x3f')){var _0x9ce9fe={};_0x9ce9fe[_0x376c37[_0x9ff9('0x40')]]={'$like':'%'+_0x11b9e3[_0x9ff9('0x30')]['filter']+'%'};return _0x9ce9fe;}})});}_0x4d6fdc=_['merge']({},_0x4d6fdc,_0x11b9e3['options']);var _0x4cfe62={'where':_0x4d6fdc[_0x9ff9('0x3a')]};return db['FaxQueue']['count'](_0x4cfe62)['then'](function(_0x3a59ea){_0x3fae0c['count']=_0x3a59ea;if(_0x11b9e3['query'][_0x9ff9('0x41')]){_0x4d6fdc[_0x9ff9('0x42')]=[{'all':!![]}];}return db[_0x9ff9('0x43')]['findAll'](_0x4d6fdc);})['then'](function(_0x3b8080){_0x3fae0c[_0x9ff9('0x44')]=_0x3b8080;return _0x3fae0c;})[_0x9ff9('0x24')](respondWithFilteredResult(_0x5e7f82,_0x4d6fdc))['catch'](handleError(_0x5e7f82,null));};exports[_0x9ff9('0x45')]=function(_0x1cc8e2,_0x4bcd6b){var _0x3092aa={'raw':!![],'where':{'id':_0x1cc8e2[_0x9ff9('0x46')]['id']}},_0x3a8bc7={};_0x3a8bc7['model']=_[_0x9ff9('0x2f')](db['FaxQueue'][_0x9ff9('0x2d')]);_0x3a8bc7[_0x9ff9('0x30')]=_['keys'](_0x1cc8e2[_0x9ff9('0x30')]);_0x3a8bc7[_0x9ff9('0x31')]=_[_0x9ff9('0x32')](_0x3a8bc7['model'],_0x3a8bc7['query']);_0x3092aa[_0x9ff9('0x34')]=_[_0x9ff9('0x32')](_0x3a8bc7[_0x9ff9('0x2e')],qs[_0x9ff9('0x33')](_0x1cc8e2[_0x9ff9('0x30')][_0x9ff9('0x33')]));_0x3092aa[_0x9ff9('0x34')]=_0x3092aa[_0x9ff9('0x34')]['length']?_0x3092aa[_0x9ff9('0x34')]:_0x3a8bc7[_0x9ff9('0x2e')];if(_0x1cc8e2[_0x9ff9('0x30')][_0x9ff9('0x41')]){_0x3092aa[_0x9ff9('0x42')]=[{'all':!![]}];}_0x3092aa=_[_0x9ff9('0x3d')]({},_0x3092aa,_0x1cc8e2[_0x9ff9('0x47')]);return db['FaxQueue'][_0x9ff9('0x48')](_0x3092aa)[_0x9ff9('0x24')](handleEntityNotFound(_0x4bcd6b,null))[_0x9ff9('0x24')](respondWithResult(_0x4bcd6b,null))[_0x9ff9('0x49')](handleError(_0x4bcd6b,null));};exports['create']=function(_0x59bf42,_0x37be40){return db[_0x9ff9('0x43')][_0x9ff9('0x4a')](_0x59bf42[_0x9ff9('0x4b')],{})[_0x9ff9('0x24')](function(_0x2ace12){var _0x184875=_0x59bf42[_0x9ff9('0x4c')][_0x9ff9('0x4d')]({'plain':!![]});if(!_0x184875)throw new Error(_0x9ff9('0x4e'));if(_0x184875[_0x9ff9('0x4f')]===_0x9ff9('0x4c')){var _0x3e6154=_0x2ace12[_0x9ff9('0x4d')]({'plain':!![]});var _0x542dce='FaxQueues';return db[_0x9ff9('0x50')][_0x9ff9('0x48')]({'where':{'name':_0x542dce,'userProfileId':_0x184875[_0x9ff9('0x51')]},'raw':!![]})[_0x9ff9('0x24')](function(_0x1dc605){if(_0x1dc605&&_0x1dc605[_0x9ff9('0x52')]===0x0){return db[_0x9ff9('0x53')][_0x9ff9('0x4a')]({'name':_0x3e6154['name'],'resourceId':_0x3e6154['id'],'type':_0x1dc605[_0x9ff9('0x2a')],'sectionId':_0x1dc605['id']},{})[_0x9ff9('0x24')](function(){return _0x2ace12;});}else{return _0x2ace12;}})[_0x9ff9('0x49')](function(_0xb44005){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xb44005);throw _0xb44005;});}return _0x2ace12;})['then'](respondWithResult(_0x37be40,0xc9))[_0x9ff9('0x49')](handleError(_0x37be40,null));};exports[_0x9ff9('0x54')]=function(_0x2e1bac,_0x51c1c7){if(_0x2e1bac[_0x9ff9('0x4b')]['id']){delete _0x2e1bac['body']['id'];}return db[_0x9ff9('0x43')][_0x9ff9('0x48')]({'where':{'id':_0x2e1bac[_0x9ff9('0x46')]['id']}})[_0x9ff9('0x24')](handleEntityNotFound(_0x51c1c7,null))[_0x9ff9('0x24')](saveUpdates(_0x2e1bac[_0x9ff9('0x4b')],null))[_0x9ff9('0x24')](respondWithResult(_0x51c1c7,null))['catch'](handleError(_0x51c1c7,null));};exports[_0x9ff9('0x25')]=function(_0x6ea5e9,_0x505c2e){return db[_0x9ff9('0x43')][_0x9ff9('0x48')]({'where':{'id':_0x6ea5e9[_0x9ff9('0x46')]['id']}})['then'](handleEntityNotFound(_0x505c2e,null))[_0x9ff9('0x24')](removeEntity(_0x505c2e,null))['catch'](handleError(_0x505c2e,null));};exports['describe']=function(_0x242431,_0x18cc27){return db[_0x9ff9('0x43')][_0x9ff9('0x55')]()[_0x9ff9('0x24')](respondWithResult(_0x18cc27,null))['catch'](handleError(_0x18cc27,null));};exports[_0x9ff9('0x56')]=function(_0x122d0e,_0x1338e1,_0x23e5c9){var _0x316042={'raw':!![],'where':{}},_0x481a91={},_0xed7f1b;return db[_0x9ff9('0x43')][_0x9ff9('0x57')]({'where':{'id':_0x122d0e[_0x9ff9('0x46')]['id']}})[_0x9ff9('0x24')](handleEntityNotFound(_0x1338e1,null))[_0x9ff9('0x24')](function(_0x4e3d26){if(_0x4e3d26){_0xed7f1b=_0x4e3d26[_0x9ff9('0x4d')]({'plain':!![]});_0x481a91[_0x9ff9('0x2e')]=_['keys'](db['UserFaxQueue'][_0x9ff9('0x2d')]);_0x481a91['query']=_[_0x9ff9('0x2f')](_0x122d0e[_0x9ff9('0x30')]);_0x481a91['filters']=_[_0x9ff9('0x32')](_0x481a91[_0x9ff9('0x2e')],_0x481a91['query']);_0x316042[_0x9ff9('0x34')]=_['intersection'](_0x481a91['model'],qs[_0x9ff9('0x33')](_0x122d0e[_0x9ff9('0x30')][_0x9ff9('0x33')]));_0x316042[_0x9ff9('0x34')]=_0x316042[_0x9ff9('0x34')]['length']?_0x316042[_0x9ff9('0x34')]:_0x481a91[_0x9ff9('0x2e')];if(!_0x122d0e[_0x9ff9('0x30')]['hasOwnProperty'](_0x9ff9('0x37'))){_0x316042[_0x9ff9('0x1e')]=qs[_0x9ff9('0x1e')](_0x122d0e['query']['limit']);_0x316042['offset']=qs['offset'](_0x122d0e[_0x9ff9('0x30')][_0x9ff9('0x1d')]);}_0x316042[_0x9ff9('0x38')]=qs[_0x9ff9('0x39')](_0x122d0e[_0x9ff9('0x30')][_0x9ff9('0x39')]);_0x316042['where']=qs['filters'](_[_0x9ff9('0x3b')](_0x122d0e[_0x9ff9('0x30')],_0x481a91[_0x9ff9('0x31')]));_0x316042[_0x9ff9('0x3a')]['FaxQueueId']=_0x4e3d26['id'];if(_0x122d0e[_0x9ff9('0x30')][_0x9ff9('0x3c')]){_0x316042['where']=_[_0x9ff9('0x3d')](_0x316042[_0x9ff9('0x3a')],{'$or':_[_0x9ff9('0x3e')](_0x316042[_0x9ff9('0x34')],function(_0x56eceb){var _0x213d47={};_0x213d47[_0x56eceb]={'$like':'%'+_0x122d0e[_0x9ff9('0x30')][_0x9ff9('0x3c')]+'%'};return _0x213d47;})});}_0x316042=_[_0x9ff9('0x3d')]({},_0x316042,_0x122d0e['options']);return db[_0x9ff9('0x58')][_0x9ff9('0x59')](_0x316042);}})[_0x9ff9('0x24')](function(_0x21f012){if(_0x21f012){return db[_0x9ff9('0x5a')][_0x9ff9('0x5b')]({'where':{'id':_[_0x9ff9('0x3e')](_0x21f012,_0x9ff9('0x5c')),'role':_0x9ff9('0x5d')},'attributes':['id',_0x9ff9('0x2a'),_0x9ff9('0x5e'),_0x9ff9('0x5f'),'createdAt']});}})['then'](function(_0x485ac5){if(_0x485ac5){return{'count':_0x485ac5['count'],'rows':_[_0x9ff9('0x3e')](_0x485ac5[_0x9ff9('0x44')],function(_0x15099e){return{'membername':_0x15099e['name'],'UserId':_0x15099e['id'],'queue_name':_0xed7f1b[_0x9ff9('0x2a')],'FaxQueueId':_0xed7f1b['id'],'interface':util[_0x9ff9('0x60')]('%s/%s',_0x9ff9('0x61'),_0x15099e[_0x9ff9('0x2a')]),'penalty':0x0,'paused':_0x15099e['faxPause'],'createdAt':_0x15099e[_0x9ff9('0x62')],'updatedAt':_0x15099e[_0x9ff9('0x5f')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x9ff9('0x24')](respondWithFilteredResult(_0x1338e1,_0x316042))['catch'](handleError(_0x1338e1,null));};exports[_0x9ff9('0x63')]=function(_0x4ca560,_0x289487,_0x310f16){var _0x29801d={};var _0x548f89={};var _0x46c7a7;var _0x4e0582;return db['FaxQueue'][_0x9ff9('0x57')]({'where':{'id':_0x4ca560[_0x9ff9('0x46')]['id']}})[_0x9ff9('0x24')](handleEntityNotFound(_0x289487,null))[_0x9ff9('0x24')](function(_0x221014){if(_0x221014){_0x46c7a7=_0x221014;_0x548f89[_0x9ff9('0x2e')]=_[_0x9ff9('0x2f')](db[_0x9ff9('0x64')][_0x9ff9('0x2d')]);_0x548f89['query']=_[_0x9ff9('0x2f')](_0x4ca560[_0x9ff9('0x30')]);_0x548f89[_0x9ff9('0x31')]=_[_0x9ff9('0x32')](_0x548f89[_0x9ff9('0x2e')],_0x548f89[_0x9ff9('0x30')]);_0x29801d[_0x9ff9('0x34')]=_[_0x9ff9('0x32')](_0x548f89['model'],qs[_0x9ff9('0x33')](_0x4ca560[_0x9ff9('0x30')][_0x9ff9('0x33')]));_0x29801d[_0x9ff9('0x34')]=_0x29801d['attributes'][_0x9ff9('0x35')]?_0x29801d['attributes']:_0x548f89[_0x9ff9('0x2e')];_0x29801d[_0x9ff9('0x38')]=qs['sort'](_0x4ca560[_0x9ff9('0x30')][_0x9ff9('0x39')]);_0x29801d['where']=qs[_0x9ff9('0x31')](_[_0x9ff9('0x3b')](_0x4ca560[_0x9ff9('0x30')],_0x548f89[_0x9ff9('0x31')]));if(_0x4ca560[_0x9ff9('0x30')][_0x9ff9('0x3c')]){_0x29801d['where']=_[_0x9ff9('0x3d')](_0x29801d[_0x9ff9('0x3a')],{'$or':_[_0x9ff9('0x3e')](_0x29801d[_0x9ff9('0x34')],function(_0x6ab119){var _0x5d976c={};_0x5d976c[_0x6ab119]={'$like':'%'+_0x4ca560['query'][_0x9ff9('0x3c')]+'%'};return _0x5d976c;})});}_0x29801d=_[_0x9ff9('0x3d')]({},_0x29801d,_0x4ca560[_0x9ff9('0x47')]);return _0x46c7a7[_0x9ff9('0x63')](_0x29801d);}})[_0x9ff9('0x24')](function(_0x5d5517){if(_0x5d5517){_0x4e0582=_0x5d5517[_0x9ff9('0x35')];if(!_0x4ca560[_0x9ff9('0x30')]['hasOwnProperty'](_0x9ff9('0x37'))){_0x29801d[_0x9ff9('0x1e')]=qs[_0x9ff9('0x1e')](_0x4ca560['query'][_0x9ff9('0x1e')]);_0x29801d[_0x9ff9('0x1d')]=qs[_0x9ff9('0x1d')](_0x4ca560[_0x9ff9('0x30')]['offset']);}return _0x46c7a7[_0x9ff9('0x63')](_0x29801d);}})['then'](function(_0x45aae3){if(_0x45aae3){return _0x45aae3?{'count':_0x4e0582,'rows':_0x45aae3}:null;}})['then'](respondWithResult(_0x289487,null))[_0x9ff9('0x49')](handleError(_0x289487,null));};exports[_0x9ff9('0x65')]=function(_0xe5a815,_0x450a19,_0x2230de){var _0x5cfd2d=_0xe5a815[_0x9ff9('0x4b')][_0x9ff9('0x66')];return db['Team'][_0x9ff9('0x59')]({'where':{'id':_0x5cfd2d},'attributes':['id'],'include':[{'model':db[_0x9ff9('0x5a')],'as':_0x9ff9('0x67'),'attributes':['id','name','online','voicePause',_0x9ff9('0x68')],'raw':!![]}]})[_0x9ff9('0x24')](function(_0x15ab84){if(_0x15ab84){var _0xd5f04=_[_0x9ff9('0x69')](_0x15ab84,function(_0x41831a){var _0x426a47=_0x41831a['get']({'plain':!![]});return _0x426a47[_0x9ff9('0x67')];});return db['FaxQueue']['find']({'where':{'id':_0xe5a815['params']['id']}})[_0x9ff9('0x24')](function(_0x841d9b){return db[_0x9ff9('0x6a')][_0x9ff9('0x6b')](function(_0x66adc7){return _0x841d9b['addTeams'](_0x5cfd2d,{'transaction':_0x66adc7})[_0x9ff9('0x24')](function(){return BPromise[_0x9ff9('0x6c')](_0xd5f04,function(_0x58ae3c){return db['UserFaxQueue']['findOrCreate']({'where':{'UserId':_0x58ae3c['id'],'FaxQueueId':_0xe5a815[_0x9ff9('0x46')]['id']},'transaction':_0x66adc7});});})[_0x9ff9('0x24')](function(){_0xd5f04['forEach'](function(_0x29f517){socket[_0x9ff9('0x6d')](_0x9ff9('0x6e'),{'UserId':_0x29f517['id'],'FaxQueueId':_0x841d9b['id']});});});});});}})['then'](respondWithStatusCode(_0x450a19,null))['catch'](handleError(_0x450a19,null));};exports['removeTeams']=function(_0x5e032c,_0x5252a2,_0x2d7dad){return db[_0x9ff9('0x64')][_0x9ff9('0x59')]({'where':{'id':_0x5e032c['query']['ids']},'attributes':['id'],'include':[{'model':db[_0x9ff9('0x5a')],'as':_0x9ff9('0x67'),'attributes':['id'],'raw':!![]}]})[_0x9ff9('0x24')](handleEntityNotFound(_0x5252a2,null))[_0x9ff9('0x24')](function(_0x551e8c){var _0x24b9e1=_[_0x9ff9('0x3e')](_0x551e8c,'id');var _0x1bd370=[];var _0x3b8f65=[];var _0x288aea=squel[_0x9ff9('0x6f')]();_0x288aea[_0x9ff9('0x40')](_0x9ff9('0x70'))[_0x9ff9('0x71')]('team_has_fax_queues','tq')['join'](_0x9ff9('0x72'),'ut',_0x9ff9('0x73'))['where'](_0x9ff9('0x74'),_0x5e032c[_0x9ff9('0x46')]['id']);for(var _0x33bce4=0x0;_0x33bce4<_0x551e8c[_0x9ff9('0x35')];_0x33bce4+=0x1){let _0x483b34=_0x551e8c[_0x33bce4];for(var _0x2bfd70=0x0;_0x2bfd70<_0x483b34[_0x9ff9('0x67')]['length'];_0x2bfd70+=0x1){let _0x23779a=_0x483b34['Agents'][_0x2bfd70];var _0x49683c=_0x288aea[_0x9ff9('0x75')]();_0x49683c[_0x9ff9('0x3a')](_0x9ff9('0x76'),_0x23779a['id']);_0x3b8f65[_0x9ff9('0x77')](db[_0x9ff9('0x6a')][_0x9ff9('0x30')](_0x49683c[_0x9ff9('0x78')](),{'type':db[_0x9ff9('0x6a')][_0x9ff9('0x79')][_0x9ff9('0x7a')]})[_0x9ff9('0x24')](function(_0x5929cc){if(_0x5929cc[_0x9ff9('0x35')]===0x1){return _0x23779a['id'];}else{var _0x1e8150=_[_0x9ff9('0x7b')](_[_0x9ff9('0x3e')](_0x5929cc,_0x9ff9('0x7c')),function(_0x5bef37){return _[_0x9ff9('0x7d')](_0x24b9e1,_0x5bef37);});if(_0x1e8150){return _0x23779a['id'];}}}));}}return BPromise[_0x9ff9('0x7e')](_0x3b8f65)[_0x9ff9('0x24')](function(_0x3c8eab){_0x1bd370=_(_0x1bd370)[_0x9ff9('0x7f')](_0x3c8eab)[_0x9ff9('0x80')]()[_0x9ff9('0x81')]();return db['FaxQueue'][_0x9ff9('0x48')]({'where':{'id':_0x5e032c[_0x9ff9('0x46')]['id']}})[_0x9ff9('0x24')](function(_0x12c814){return db['sequelize'][_0x9ff9('0x6b')](function(_0x343c33){return _0x12c814[_0x9ff9('0x82')](_0x5e032c[_0x9ff9('0x30')]['ids'],{'transaction':_0x343c33})[_0x9ff9('0x24')](function(){if(!_[_0x9ff9('0x83')](_0x1bd370)){return _0x12c814[_0x9ff9('0x84')](_0x1bd370,{'transaction':_0x343c33});}})['then'](function(){_0x1bd370[_0x9ff9('0x85')](function(_0x5aec7c){socket['emit'](_0x9ff9('0x86'),{'UserId':_0x5aec7c,'FaxQueueId':_0x12c814['id']});});});});});});})[_0x9ff9('0x24')](respondWithStatusCode(_0x5252a2,null))[_0x9ff9('0x49')](handleError(_0x5252a2,null));};exports[_0x9ff9('0x87')]=function(_0x2fc74d,_0x17015a,_0x51e9d9){return db[_0x9ff9('0x43')][_0x9ff9('0x48')]({'where':{'id':_0x2fc74d[_0x9ff9('0x46')]['id']}})[_0x9ff9('0x24')](handleEntityNotFound(_0x17015a,null))[_0x9ff9('0x24')](function(_0xfeec3b){if(_0xfeec3b){return _0xfeec3b[_0x9ff9('0x87')](_0x2fc74d[_0x9ff9('0x4b')][_0x9ff9('0x66')],_[_0x9ff9('0x88')](_0x2fc74d[_0x9ff9('0x4b')],[_0x9ff9('0x66'),'id'])||{})[_0x9ff9('0x89')](function(_0x3d731a){for(var _0x539f44=0x0;_0x539f44<_0x2fc74d[_0x9ff9('0x4b')][_0x9ff9('0x66')]['length'];_0x539f44+=0x1){socket['emit']('userFaxQueue:save',{'UserId':_0x2fc74d[_0x9ff9('0x4b')][_0x9ff9('0x66')][_0x539f44],'FaxQueueId':_0x2fc74d[_0x9ff9('0x46')]['id']});}return _0x3d731a;});}})[_0x9ff9('0x24')](respondWithResult(_0x17015a,null))[_0x9ff9('0x49')](handleError(_0x17015a,null));};exports['removeAgents']=function(_0x5c9c5f,_0x29a6a3,_0x4e98c4){return db['FaxQueue'][_0x9ff9('0x48')]({'where':{'id':_0x5c9c5f[_0x9ff9('0x46')]['id']}})[_0x9ff9('0x24')](handleEntityNotFound(_0x29a6a3,null))['then'](function(_0x286155){if(_0x286155){return _0x286155['removeAgents'](_0x5c9c5f[_0x9ff9('0x30')]['ids'])[_0x9ff9('0x24')](function(){if(_[_0x9ff9('0x8a')](_0x5c9c5f[_0x9ff9('0x30')][_0x9ff9('0x66')])){for(var _0x5a2a75=0x0;_0x5a2a75<_0x5c9c5f['query'][_0x9ff9('0x66')]['length'];_0x5a2a75+=0x1){socket['emit']('userFaxQueue:remove',{'UserId':Number(_0x5c9c5f['query'][_0x9ff9('0x66')][_0x5a2a75]),'FaxQueueId':Number(_0x5c9c5f[_0x9ff9('0x46')]['id'])});}}else{socket['emit'](_0x9ff9('0x86'),{'UserId':Number(_0x5c9c5f[_0x9ff9('0x30')][_0x9ff9('0x66')]),'FaxQueueId':Number(_0x5c9c5f[_0x9ff9('0x46')]['id'])});}});}})['then'](respondWithStatusCode(_0x29a6a3,null))['catch'](handleError(_0x29a6a3,null));};exports[_0x9ff9('0x8b')]=function(_0x169e23,_0x22f1ee,_0x145e04){var _0x50d049={};var _0x1821a4={};var _0x1aa48f;var _0x301659;return db[_0x9ff9('0x43')][_0x9ff9('0x57')]({'where':{'id':_0x169e23[_0x9ff9('0x46')]['id']}})[_0x9ff9('0x24')](handleEntityNotFound(_0x22f1ee,null))[_0x9ff9('0x24')](function(_0x319d47){if(_0x319d47){_0x1aa48f=_0x319d47;_0x1821a4[_0x9ff9('0x2e')]=_[_0x9ff9('0x2f')](db[_0x9ff9('0x5a')]['rawAttributes']);_0x1821a4[_0x9ff9('0x30')]=_['keys'](_0x169e23[_0x9ff9('0x30')]);_0x1821a4[_0x9ff9('0x31')]=_[_0x9ff9('0x32')](_0x1821a4[_0x9ff9('0x2e')],_0x1821a4[_0x9ff9('0x30')]);_0x50d049['attributes']=_[_0x9ff9('0x32')](_0x1821a4['model'],qs[_0x9ff9('0x33')](_0x169e23['query'][_0x9ff9('0x33')]));_0x50d049[_0x9ff9('0x34')]=_0x50d049['attributes']['length']?_0x50d049[_0x9ff9('0x34')]:_0x1821a4[_0x9ff9('0x2e')];_0x50d049[_0x9ff9('0x38')]=qs[_0x9ff9('0x39')](_0x169e23[_0x9ff9('0x30')][_0x9ff9('0x39')]);_0x50d049[_0x9ff9('0x3a')]=qs[_0x9ff9('0x31')](_['pick'](_0x169e23[_0x9ff9('0x30')],_0x1821a4[_0x9ff9('0x31')]));if(_0x169e23[_0x9ff9('0x30')][_0x9ff9('0x3c')]){_0x50d049[_0x9ff9('0x3a')]=_[_0x9ff9('0x3d')](_0x50d049[_0x9ff9('0x3a')],{'$or':_['map'](_0x50d049[_0x9ff9('0x34')],function(_0x4e2396){var _0x2af1a3={};_0x2af1a3[_0x4e2396]={'$like':'%'+_0x169e23[_0x9ff9('0x30')][_0x9ff9('0x3c')]+'%'};return _0x2af1a3;})});}_0x50d049=_[_0x9ff9('0x3d')]({},_0x50d049,_0x169e23[_0x9ff9('0x47')]);return _0x1aa48f['getAgents'](_0x50d049);}})[_0x9ff9('0x24')](function(_0x332551){if(_0x332551){_0x301659=_0x332551[_0x9ff9('0x35')];if(!_0x169e23[_0x9ff9('0x30')][_0x9ff9('0x36')](_0x9ff9('0x37'))){_0x50d049[_0x9ff9('0x1e')]=qs['limit'](_0x169e23[_0x9ff9('0x30')]['limit']);_0x50d049[_0x9ff9('0x1d')]=qs['offset'](_0x169e23[_0x9ff9('0x30')]['offset']);}return _0x1aa48f['getAgents'](_0x50d049);}})[_0x9ff9('0x24')](function(_0x18e226){if(_0x18e226){return _0x18e226?{'count':_0x301659,'rows':_0x18e226}:null;}})[_0x9ff9('0x24')](respondWithResult(_0x22f1ee,null))[_0x9ff9('0x49')](handleError(_0x22f1ee,null));}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.events.js b/server/api/faxQueue/faxQueue.events.js index fa3879a..c23ae38 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 _0xfc46=['exports','events','FaxQueue','setMaxListeners','save','remove','emit','hasOwnProperty','hook'];(function(_0x4451bb,_0x498784){var _0x1837b9=function(_0x4bf3a8){while(--_0x4bf3a8){_0x4451bb['push'](_0x4451bb['shift']());}};_0x1837b9(++_0x498784);}(_0xfc46,0x9a));var _0x6fc4=function(_0x5af97c,_0x24a49f){_0x5af97c=_0x5af97c-0x0;var _0x3472ae=_0xfc46[_0x5af97c];return _0x3472ae;};'use strict';var EventEmitter=require(_0x6fc4('0x0'));var FaxQueue=require('../../mysqldb')['db'][_0x6fc4('0x1')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0x6fc4('0x2')](0x0);var events={'afterCreate':_0x6fc4('0x3'),'afterUpdate':'update','afterDestroy':_0x6fc4('0x4')};function emitEvent(_0x45e0e0){return function(_0x29e213,_0x3491f2,_0x52b4c0){FaxQueueEvents[_0x6fc4('0x5')](_0x45e0e0+':'+_0x29e213['id'],_0x29e213);FaxQueueEvents[_0x6fc4('0x5')](_0x45e0e0,_0x29e213);_0x52b4c0(null);};}for(var e in events){if(events[_0x6fc4('0x6')](e)){var event=events[e];FaxQueue[_0x6fc4('0x7')](e,emitEvent(event));}}module[_0x6fc4('0x8')]=FaxQueueEvents; \ No newline at end of file +var _0x7fbe=['update','remove','emit','hasOwnProperty','hook','exports','FaxQueue','setMaxListeners','save'];(function(_0x482a1d,_0x35fee6){var _0x59c1a1=function(_0x37d748){while(--_0x37d748){_0x482a1d['push'](_0x482a1d['shift']());}};_0x59c1a1(++_0x35fee6);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x329397,_0x102228){_0x329397=_0x329397-0x0;var _0x126bf9=_0x7fbe[_0x329397];return _0x126bf9;};'use strict';var EventEmitter=require('events');var FaxQueue=require('../../mysqldb')['db'][_0xe7fb('0x0')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0xe7fb('0x1')](0x0);var events={'afterCreate':_0xe7fb('0x2'),'afterUpdate':_0xe7fb('0x3'),'afterDestroy':_0xe7fb('0x4')};function emitEvent(_0x47625b){return function(_0x11d2c4,_0x4524ff,_0x36ab90){FaxQueueEvents[_0xe7fb('0x5')](_0x47625b+':'+_0x11d2c4['id'],_0x11d2c4);FaxQueueEvents[_0xe7fb('0x5')](_0x47625b,_0x11d2c4);_0x36ab90(null);};}for(var e in events){if(events[_0xe7fb('0x6')](e)){var event=events[e];FaxQueue[_0xe7fb('0x7')](e,emitEvent(event));}}module[_0xe7fb('0x8')]=FaxQueueEvents; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.model.js b/server/api/faxQueue/faxQueue.model.js index 7f7fb9e..f5e3d39 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 _0xfffc=['lodash','util','moment','bluebird','request-promise','rimraf','../../config/environment','./faxQueue.attributes','exports','define','FaxQueue','fax_queues'];(function(_0x3be7c3,_0x494f27){var _0x34b1b9=function(_0x2855c2){while(--_0x2855c2){_0x3be7c3['push'](_0x3be7c3['shift']());}};_0x34b1b9(++_0x494f27);}(_0xfffc,0xe4));var _0xcfff=function(_0x357398,_0x5727f9){_0x357398=_0x357398-0x0;var _0x561d9a=_0xfffc[_0x357398];return _0x561d9a;};'use strict';var _=require(_0xcfff('0x0'));var util=require(_0xcfff('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xcfff('0x2'));var BPromise=require(_0xcfff('0x3'));var rp=require(_0xcfff('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xcfff('0x5'));var config=require(_0xcfff('0x6'));var attributes=require(_0xcfff('0x7'));module[_0xcfff('0x8')]=function(_0x78380c,_0x55b914){return _0x78380c[_0xcfff('0x9')](_0xcfff('0xa'),attributes,{'tableName':_0xcfff('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xefb5=['define','FaxQueue','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxQueue.attributes','exports'];(function(_0x4327c5,_0x34fd51){var _0x693f12=function(_0x54901b){while(--_0x54901b){_0x4327c5['push'](_0x4327c5['shift']());}};_0x693f12(++_0x34fd51);}(_0xefb5,0x161));var _0x5efb=function(_0x1d50f2,_0x3c3ec6){_0x1d50f2=_0x1d50f2-0x0;var _0x3769b8=_0xefb5[_0x1d50f2];return _0x3769b8;};'use strict';var _=require('lodash');var util=require(_0x5efb('0x0'));var logger=require(_0x5efb('0x1'))(_0x5efb('0x2'));var moment=require(_0x5efb('0x3'));var BPromise=require(_0x5efb('0x4'));var rp=require(_0x5efb('0x5'));var fs=require('fs');var path=require(_0x5efb('0x6'));var rimraf=require(_0x5efb('0x7'));var config=require(_0x5efb('0x8'));var attributes=require(_0x5efb('0x9'));module[_0x5efb('0xa')]=function(_0x4aadf4,_0x13ece6){return _0x4aadf4[_0x5efb('0xb')](_0x5efb('0xc'),attributes,{'tableName':'fax_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.rpc.js b/server/api/faxQueue/faxQueue.rpc.js index 44f4ea9..1472b38 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 _0xaa11=['code','message','result','catch','GetFaxQueue','FaxQueue','findAll','options','raw','where','attributes','limit','include','map','model','ShowFaxQueue','find','stringify','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./faxQueue.socket','register','request','then','info','FaxQueue,\x20%s,\x20%s','request\x20sent','debug','error'];(function(_0x4a65be,_0x3124ae){var _0xa53f14=function(_0x26cdca){while(--_0x26cdca){_0x4a65be['push'](_0x4a65be['shift']());}};_0xa53f14(++_0x3124ae);}(_0xaa11,0x1ac));var _0x1aa1=function(_0x5dfe9b,_0x318b85){_0x5dfe9b=_0x5dfe9b-0x0;var _0x3bb0f4=_0xaa11[_0x5dfe9b];return _0x3bb0f4;};'use strict';var _=require(_0x1aa1('0x0'));var util=require('util');var moment=require(_0x1aa1('0x1'));var BPromise=require(_0x1aa1('0x2'));var rs=require(_0x1aa1('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1aa1('0x4'))['db'];var utils=require(_0x1aa1('0x5'));var logger=require(_0x1aa1('0x6'))('rpc');var config=require(_0x1aa1('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x1aa1('0x8')][_0x1aa1('0x9')]({'port':0x232a});config[_0x1aa1('0xa')]=_[_0x1aa1('0xb')](config['redis'],{'host':_0x1aa1('0xc'),'port':0x18eb});var socket=require(_0x1aa1('0xd'))(new Redis(config['redis']));require(_0x1aa1('0xe'))[_0x1aa1('0xf')](socket);function respondWithRpcPromise(_0x3d2910,_0x2038bc,_0x136b64){return new BPromise(function(_0x2e2885,_0x19d153){return client[_0x1aa1('0x10')](_0x3d2910,_0x136b64)[_0x1aa1('0x11')](function(_0x4b78ab){logger[_0x1aa1('0x12')](_0x1aa1('0x13'),_0x2038bc,_0x1aa1('0x14'));logger[_0x1aa1('0x15')]('FaxQueue,\x20%s,\x20%s,\x20%s',_0x2038bc,'request\x20sent',JSON['stringify'](_0x4b78ab));if(_0x4b78ab[_0x1aa1('0x16')]){if(_0x4b78ab['error'][_0x1aa1('0x17')]===0x1f4){logger[_0x1aa1('0x16')](_0x1aa1('0x13'),_0x2038bc,_0x4b78ab[_0x1aa1('0x16')][_0x1aa1('0x18')]);return _0x19d153(_0x4b78ab[_0x1aa1('0x16')][_0x1aa1('0x18')]);}logger[_0x1aa1('0x16')](_0x1aa1('0x13'),_0x2038bc,_0x4b78ab[_0x1aa1('0x16')][_0x1aa1('0x18')]);return _0x2e2885(_0x4b78ab[_0x1aa1('0x16')][_0x1aa1('0x18')]);}else{logger[_0x1aa1('0x12')](_0x1aa1('0x13'),_0x2038bc,_0x1aa1('0x14'));_0x2e2885(_0x4b78ab[_0x1aa1('0x19')][_0x1aa1('0x18')]);}})[_0x1aa1('0x1a')](function(_0x4f6d1f){logger[_0x1aa1('0x16')](_0x1aa1('0x13'),_0x2038bc,_0x4f6d1f);_0x19d153(_0x4f6d1f);});});}exports[_0x1aa1('0x1b')]=function(_0x42c6a4){var _0x58d011=this;return new Promise(function(_0x20c88b,_0x336f9f){return db[_0x1aa1('0x1c')][_0x1aa1('0x1d')]({'raw':_0x42c6a4[_0x1aa1('0x1e')]?_0x42c6a4['options'][_0x1aa1('0x1f')]===undefined?!![]:![]:!![],'where':_0x42c6a4[_0x1aa1('0x1e')]?_0x42c6a4['options'][_0x1aa1('0x20')]||null:null,'attributes':_0x42c6a4[_0x1aa1('0x1e')]?_0x42c6a4[_0x1aa1('0x1e')][_0x1aa1('0x21')]||null:null,'limit':_0x42c6a4[_0x1aa1('0x1e')]?_0x42c6a4[_0x1aa1('0x1e')][_0x1aa1('0x22')]||null:null,'include':_0x42c6a4[_0x1aa1('0x1e')]?_0x42c6a4[_0x1aa1('0x1e')][_0x1aa1('0x23')]?_[_0x1aa1('0x24')](_0x42c6a4['options'][_0x1aa1('0x23')],function(_0x20198c){return{'model':db[_0x20198c[_0x1aa1('0x25')]],'as':_0x20198c['as'],'attributes':_0x20198c[_0x1aa1('0x21')],'include':_0x20198c[_0x1aa1('0x23')]?_['map'](_0x20198c['include'],function(_0x3248b5){return{'model':db[_0x3248b5[_0x1aa1('0x25')]],'as':_0x3248b5['as'],'attributes':_0x3248b5[_0x1aa1('0x21')],'include':_0x3248b5['include']?_['map'](_0x3248b5[_0x1aa1('0x23')],function(_0x68f899){return{'model':db[_0x68f899[_0x1aa1('0x25')]],'as':_0x68f899['as'],'attributes':_0x68f899[_0x1aa1('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x14830d){logger[_0x1aa1('0x12')](_0x1aa1('0x1b'),_0x42c6a4);logger[_0x1aa1('0x15')](_0x1aa1('0x1b'),_0x42c6a4,JSON['stringify'](_0x14830d));_0x20c88b(_0x14830d);})[_0x1aa1('0x1a')](function(_0x190b9f){logger['error'](_0x1aa1('0x1b'),_0x190b9f[_0x1aa1('0x18')],_0x42c6a4);_0x336f9f(_0x58d011[_0x1aa1('0x16')](0x1f4,_0x190b9f['message']));});});};exports[_0x1aa1('0x26')]=function(_0x1b00ff){var _0x4c501a=this;return new Promise(function(_0x2f471f,_0x4729eb){return db[_0x1aa1('0x1c')][_0x1aa1('0x27')]({'raw':_0x1b00ff['options']?_0x1b00ff[_0x1aa1('0x1e')][_0x1aa1('0x1f')]===undefined?!![]:![]:!![],'where':_0x1b00ff[_0x1aa1('0x1e')]?_0x1b00ff[_0x1aa1('0x1e')]['where']||null:null,'attributes':_0x1b00ff[_0x1aa1('0x1e')]?_0x1b00ff['options'][_0x1aa1('0x21')]||null:null,'include':_0x1b00ff[_0x1aa1('0x1e')]?_0x1b00ff[_0x1aa1('0x1e')][_0x1aa1('0x23')]?_[_0x1aa1('0x24')](_0x1b00ff['options']['include'],function(_0x397dff){return{'model':db[_0x397dff[_0x1aa1('0x25')]],'as':_0x397dff['as'],'attributes':_0x397dff[_0x1aa1('0x21')],'include':_0x397dff[_0x1aa1('0x23')]?_[_0x1aa1('0x24')](_0x397dff['include'],function(_0x56f597){return{'model':db[_0x56f597['model']],'as':_0x56f597['as'],'attributes':_0x56f597[_0x1aa1('0x21')],'include':_0x56f597[_0x1aa1('0x23')]?_[_0x1aa1('0x24')](_0x56f597[_0x1aa1('0x23')],function(_0x5773c5){return{'model':db[_0x5773c5[_0x1aa1('0x25')]],'as':_0x5773c5['as'],'attributes':_0x5773c5['attributes']};}):[]};}):[]};}):[]:[]})[_0x1aa1('0x11')](function(_0x4b3655){logger[_0x1aa1('0x12')]('ShowFaxQueue',_0x1b00ff);logger['debug'](_0x1aa1('0x26'),_0x1b00ff,JSON[_0x1aa1('0x28')](_0x4b3655));_0x2f471f(_0x4b3655);})[_0x1aa1('0x1a')](function(_0x4dff5b){logger[_0x1aa1('0x16')](_0x1aa1('0x26'),_0x4dff5b[_0x1aa1('0x18')],_0x1b00ff);_0x4729eb(_0x4c501a['error'](0x1f4,_0x4dff5b[_0x1aa1('0x18')]));});});}; \ No newline at end of file +var _0x84a4=['../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./faxQueue.socket','register','request','then','FaxQueue,\x20%s,\x20%s','debug','FaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','request\x20sent','result','catch','FaxQueue','options','where','limit','include','map','model','attributes','GetFaxQueue','ShowFaxQueue','raw','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x725a4c,_0x102507){var _0x37b2cc=function(_0x505fc9){while(--_0x505fc9){_0x725a4c['push'](_0x725a4c['shift']());}};_0x37b2cc(++_0x102507);}(_0x84a4,0x71));var _0x484a=function(_0x41a0d4,_0x11f273){_0x41a0d4=_0x41a0d4-0x0;var _0x3db9bd=_0x84a4[_0x41a0d4];return _0x3db9bd;};'use strict';var _=require('lodash');var util=require(_0x484a('0x0'));var moment=require(_0x484a('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x484a('0x2'));var db=require(_0x484a('0x3'))['db'];var utils=require(_0x484a('0x4'));var logger=require(_0x484a('0x5'))(_0x484a('0x6'));var config=require(_0x484a('0x7'));var jayson=require(_0x484a('0x8'));var client=jayson[_0x484a('0x9')][_0x484a('0xa')]({'port':0x232a});config['redis']=_['defaults'](config[_0x484a('0xb')],{'host':_0x484a('0xc'),'port':0x18eb});var socket=require(_0x484a('0xd'))(new Redis(config['redis']));require(_0x484a('0xe'))[_0x484a('0xf')](socket);function respondWithRpcPromise(_0x441cf2,_0x1723c2,_0x176684){return new BPromise(function(_0x19059e,_0x173622){return client[_0x484a('0x10')](_0x441cf2,_0x176684)[_0x484a('0x11')](function(_0x15b8d8){logger['info'](_0x484a('0x12'),_0x1723c2,'request\x20sent');logger[_0x484a('0x13')](_0x484a('0x14'),_0x1723c2,'request\x20sent',JSON[_0x484a('0x15')](_0x15b8d8));if(_0x15b8d8[_0x484a('0x16')]){if(_0x15b8d8[_0x484a('0x16')][_0x484a('0x17')]===0x1f4){logger[_0x484a('0x16')]('FaxQueue,\x20%s,\x20%s',_0x1723c2,_0x15b8d8[_0x484a('0x16')]['message']);return _0x173622(_0x15b8d8[_0x484a('0x16')][_0x484a('0x18')]);}logger[_0x484a('0x16')](_0x484a('0x12'),_0x1723c2,_0x15b8d8[_0x484a('0x16')][_0x484a('0x18')]);return _0x19059e(_0x15b8d8[_0x484a('0x16')]['message']);}else{logger[_0x484a('0x19')]('FaxQueue,\x20%s,\x20%s',_0x1723c2,_0x484a('0x1a'));_0x19059e(_0x15b8d8[_0x484a('0x1b')]['message']);}})[_0x484a('0x1c')](function(_0x3a06ad){logger[_0x484a('0x16')](_0x484a('0x12'),_0x1723c2,_0x3a06ad);_0x173622(_0x3a06ad);});});}exports['GetFaxQueue']=function(_0x1be135){var _0x3644a3=this;return new Promise(function(_0x5b913b,_0x45dfed){return db[_0x484a('0x1d')]['findAll']({'raw':_0x1be135[_0x484a('0x1e')]?_0x1be135[_0x484a('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x1be135[_0x484a('0x1e')]?_0x1be135[_0x484a('0x1e')][_0x484a('0x1f')]||null:null,'attributes':_0x1be135[_0x484a('0x1e')]?_0x1be135[_0x484a('0x1e')]['attributes']||null:null,'limit':_0x1be135[_0x484a('0x1e')]?_0x1be135['options'][_0x484a('0x20')]||null:null,'include':_0x1be135[_0x484a('0x1e')]?_0x1be135[_0x484a('0x1e')][_0x484a('0x21')]?_[_0x484a('0x22')](_0x1be135[_0x484a('0x1e')][_0x484a('0x21')],function(_0x3a6cc9){return{'model':db[_0x3a6cc9[_0x484a('0x23')]],'as':_0x3a6cc9['as'],'attributes':_0x3a6cc9[_0x484a('0x24')],'include':_0x3a6cc9['include']?_['map'](_0x3a6cc9[_0x484a('0x21')],function(_0x5b8971){return{'model':db[_0x5b8971['model']],'as':_0x5b8971['as'],'attributes':_0x5b8971[_0x484a('0x24')],'include':_0x5b8971[_0x484a('0x21')]?_['map'](_0x5b8971['include'],function(_0x1bc0d3){return{'model':db[_0x1bc0d3[_0x484a('0x23')]],'as':_0x1bc0d3['as'],'attributes':_0x1bc0d3['attributes']};}):[]};}):[]};}):[]:[]})[_0x484a('0x11')](function(_0x38dbde){logger['info']('GetFaxQueue',_0x1be135);logger[_0x484a('0x13')](_0x484a('0x25'),_0x1be135,JSON[_0x484a('0x15')](_0x38dbde));_0x5b913b(_0x38dbde);})[_0x484a('0x1c')](function(_0x51a367){logger['error'](_0x484a('0x25'),_0x51a367[_0x484a('0x18')],_0x1be135);_0x45dfed(_0x3644a3[_0x484a('0x16')](0x1f4,_0x51a367['message']));});});};exports[_0x484a('0x26')]=function(_0x6f2407){var _0xd6d9e6=this;return new Promise(function(_0x4b8ee5,_0x35e3d8){return db[_0x484a('0x1d')]['find']({'raw':_0x6f2407[_0x484a('0x1e')]?_0x6f2407[_0x484a('0x1e')][_0x484a('0x27')]===undefined?!![]:![]:!![],'where':_0x6f2407[_0x484a('0x1e')]?_0x6f2407[_0x484a('0x1e')][_0x484a('0x1f')]||null:null,'attributes':_0x6f2407[_0x484a('0x1e')]?_0x6f2407['options'][_0x484a('0x24')]||null:null,'include':_0x6f2407['options']?_0x6f2407['options'][_0x484a('0x21')]?_['map'](_0x6f2407[_0x484a('0x1e')][_0x484a('0x21')],function(_0x40109a){return{'model':db[_0x40109a[_0x484a('0x23')]],'as':_0x40109a['as'],'attributes':_0x40109a['attributes'],'include':_0x40109a[_0x484a('0x21')]?_['map'](_0x40109a[_0x484a('0x21')],function(_0x4764bb){return{'model':db[_0x4764bb['model']],'as':_0x4764bb['as'],'attributes':_0x4764bb[_0x484a('0x24')],'include':_0x4764bb[_0x484a('0x21')]?_[_0x484a('0x22')](_0x4764bb['include'],function(_0x1d7404){return{'model':db[_0x1d7404['model']],'as':_0x1d7404['as'],'attributes':_0x1d7404[_0x484a('0x24')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x306a2f){logger[_0x484a('0x19')](_0x484a('0x26'),_0x6f2407);logger[_0x484a('0x13')](_0x484a('0x26'),_0x6f2407,JSON[_0x484a('0x15')](_0x306a2f));_0x4b8ee5(_0x306a2f);})[_0x484a('0x1c')](function(_0x53ceea){logger[_0x484a('0x16')](_0x484a('0x26'),_0x53ceea['message'],_0x6f2407);_0x35e3d8(_0xd6d9e6[_0x484a('0x16')](0x1f4,_0x53ceea['message']));});});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.socket.js b/server/api/faxQueue/faxQueue.socket.js index c481990..ad8c613 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 _0x4766=['length','faxQueue:','update','register'];(function(_0x53c72b,_0x4c1c14){var _0x4528ea=function(_0x2b003c){while(--_0x2b003c){_0x53c72b['push'](_0x53c72b['shift']());}};_0x4528ea(++_0x4c1c14);}(_0x4766,0x72));var _0x6476=function(_0x11bb2b,_0x29fcce){_0x11bb2b=_0x11bb2b-0x0;var _0x4c03e2=_0x4766[_0x11bb2b];return _0x4c03e2;};'use strict';var FaxQueueEvents=require('./faxQueue.events');var events=['save','remove',_0x6476('0x0')];function createListener(_0x2178cd,_0xa2ab1a){return function(_0x35b090){_0xa2ab1a['emit'](_0x2178cd,_0x35b090);};}function removeListener(_0x74377d,_0x712ec8){return function(){FaxQueueEvents['removeListener'](_0x74377d,_0x712ec8);};}exports[_0x6476('0x1')]=function(_0x48fbd4){for(var _0x52cf63=0x0,_0x255eec=events[_0x6476('0x2')];_0x52cf63<_0x255eec;_0x52cf63++){var _0x374654=events[_0x52cf63];var _0x52e94c=createListener(_0x6476('0x3')+_0x374654,_0x48fbd4);FaxQueueEvents['on'](_0x374654,_0x52e94c);}}; \ No newline at end of file +var _0x5562=['emit','removeListener','register','length','faxQueue:','./faxQueue.events','save','remove','update'];(function(_0x17bfca,_0x4ded7a){var _0x53853d=function(_0x34a266){while(--_0x34a266){_0x17bfca['push'](_0x17bfca['shift']());}};_0x53853d(++_0x4ded7a);}(_0x5562,0xd4));var _0x2556=function(_0x221eda,_0xcf03bf){_0x221eda=_0x221eda-0x0;var _0x132929=_0x5562[_0x221eda];return _0x132929;};'use strict';var FaxQueueEvents=require(_0x2556('0x0'));var events=[_0x2556('0x1'),_0x2556('0x2'),_0x2556('0x3')];function createListener(_0x36fc08,_0x4bebd1){return function(_0x325eea){_0x4bebd1[_0x2556('0x4')](_0x36fc08,_0x325eea);};}function removeListener(_0x427300,_0xff271a){return function(){FaxQueueEvents[_0x2556('0x5')](_0x427300,_0xff271a);};}exports[_0x2556('0x6')]=function(_0x2c0d4a){for(var _0xe669cc=0x0,_0x44f462=events[_0x2556('0x7')];_0xe669cc<_0x44f462;_0xe669cc++){var _0x1f7306=events[_0xe669cc];var _0x489dee=createListener(_0x2556('0x8')+_0x1f7306,_0x2c0d4a);FaxQueueEvents['on'](_0x1f7306,_0x489dee);}}; \ No newline at end of file diff --git a/server/api/faxQueue/index.js b/server/api/faxQueue/index.js index 0da9c55..eeee4b8 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 _0xb10b=['addTeams','addAgents','put','update','delete','destroy','removeTeams','removeAgents','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueue.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/members','/:id/teams','getTeams','/:id/users','getAgents','post','create'];(function(_0x202c61,_0x3673e0){var _0x540691=function(_0x409610){while(--_0x409610){_0x202c61['push'](_0x202c61['shift']());}};_0x540691(++_0x3673e0);}(_0xb10b,0x12a));var _0xbb10=function(_0x2f1ee0,_0x4ca1f4){_0x2f1ee0=_0x2f1ee0-0x0;var _0x576314=_0xb10b[_0x2f1ee0];return _0x576314;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var auth=require(_0xbb10('0x4'));var interaction=require(_0xbb10('0x5'));var config=require(_0xbb10('0x6'));var controller=require(_0xbb10('0x7'));router[_0xbb10('0x8')]('/',auth[_0xbb10('0x9')](),controller['index']);router[_0xbb10('0x8')](_0xbb10('0xa'),auth['isAuthenticated'](),controller[_0xbb10('0xb')]);router[_0xbb10('0x8')](_0xbb10('0xc'),auth[_0xbb10('0x9')](),controller[_0xbb10('0xd')]);router[_0xbb10('0x8')](_0xbb10('0xe'),auth[_0xbb10('0x9')](),controller['getMembers']);router['get'](_0xbb10('0xf'),auth[_0xbb10('0x9')](),controller[_0xbb10('0x10')]);router['get'](_0xbb10('0x11'),auth['isAuthenticated'](),controller[_0xbb10('0x12')]);router[_0xbb10('0x13')]('/',auth[_0xbb10('0x9')](),controller[_0xbb10('0x14')]);router[_0xbb10('0x13')](_0xbb10('0xf'),auth['isAuthenticated'](),controller[_0xbb10('0x15')]);router[_0xbb10('0x13')](_0xbb10('0x11'),auth[_0xbb10('0x9')](),controller[_0xbb10('0x16')]);router[_0xbb10('0x17')](_0xbb10('0xc'),auth[_0xbb10('0x9')](),controller[_0xbb10('0x18')]);router[_0xbb10('0x19')]('/:id',auth[_0xbb10('0x9')](),controller[_0xbb10('0x1a')]);router[_0xbb10('0x19')](_0xbb10('0xf'),auth[_0xbb10('0x9')](),controller[_0xbb10('0x1b')]);router[_0xbb10('0x19')](_0xbb10('0x11'),auth[_0xbb10('0x9')](),controller[_0xbb10('0x1c')]);module['exports']=router; \ No newline at end of file +var _0xb10b=['addTeams','addAgents','put','update','delete','destroy','removeTeams','removeAgents','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueue.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/members','/:id/teams','getTeams','/:id/users','getAgents','post','create'];(function(_0x1e7b16,_0x4607a1){var _0x37fadc=function(_0x1fc9ce){while(--_0x1fc9ce){_0x1e7b16['push'](_0x1e7b16['shift']());}};_0x37fadc(++_0x4607a1);}(_0xb10b,0x12a));var _0xbb10=function(_0x2da3fe,_0x55ad2d){_0x2da3fe=_0x2da3fe-0x0;var _0x564b34=_0xb10b[_0x2da3fe];return _0x564b34;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var auth=require(_0xbb10('0x4'));var interaction=require(_0xbb10('0x5'));var config=require(_0xbb10('0x6'));var controller=require(_0xbb10('0x7'));router[_0xbb10('0x8')]('/',auth[_0xbb10('0x9')](),controller['index']);router[_0xbb10('0x8')](_0xbb10('0xa'),auth['isAuthenticated'](),controller[_0xbb10('0xb')]);router[_0xbb10('0x8')](_0xbb10('0xc'),auth[_0xbb10('0x9')](),controller[_0xbb10('0xd')]);router[_0xbb10('0x8')](_0xbb10('0xe'),auth[_0xbb10('0x9')](),controller['getMembers']);router['get'](_0xbb10('0xf'),auth[_0xbb10('0x9')](),controller[_0xbb10('0x10')]);router['get'](_0xbb10('0x11'),auth['isAuthenticated'](),controller[_0xbb10('0x12')]);router[_0xbb10('0x13')]('/',auth[_0xbb10('0x9')](),controller[_0xbb10('0x14')]);router[_0xbb10('0x13')](_0xbb10('0xf'),auth['isAuthenticated'](),controller[_0xbb10('0x15')]);router[_0xbb10('0x13')](_0xbb10('0x11'),auth[_0xbb10('0x9')](),controller[_0xbb10('0x16')]);router[_0xbb10('0x17')](_0xbb10('0xc'),auth[_0xbb10('0x9')](),controller[_0xbb10('0x18')]);router[_0xbb10('0x19')]('/:id',auth[_0xbb10('0x9')](),controller[_0xbb10('0x1a')]);router[_0xbb10('0x19')](_0xbb10('0xf'),auth[_0xbb10('0x9')](),controller[_0xbb10('0x1b')]);router[_0xbb10('0x19')](_0xbb10('0x11'),auth[_0xbb10('0x9')](),controller[_0xbb10('0x1c')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.attributes.js b/server/api/faxQueueReport/faxQueueReport.attributes.js index 3889f49..92602ef 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 _0x9c79=['STRING','DATE','moment','sequelize','exports'];(function(_0x3f4c87,_0x51d6e7){var _0x576a37=function(_0xf68077){while(--_0xf68077){_0x3f4c87['push'](_0x3f4c87['shift']());}};_0x576a37(++_0x51d6e7);}(_0x9c79,0x19c));var _0x99c7=function(_0x673722,_0x275d7e){_0x673722=_0x673722-0x0;var _0x21249c=_0x9c79[_0x673722];return _0x21249c;};'use strict';var moment=require(_0x99c7('0x0'));var Sequelize=require(_0x99c7('0x1'));module[_0x99c7('0x2')]={'uniqueid':{'type':Sequelize[_0x99c7('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x99c7('0x3')]},'joinAt':{'type':Sequelize[_0x99c7('0x4')]},'leaveAt':{'type':Sequelize[_0x99c7('0x4')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x99c7('0x3')]}}; \ No newline at end of file +var _0x86ae=['DATE','moment','sequelize','exports','STRING'];(function(_0x23d2a0,_0x516174){var _0x409e80=function(_0x432940){while(--_0x432940){_0x23d2a0['push'](_0x23d2a0['shift']());}};_0x409e80(++_0x516174);}(_0x86ae,0xf6));var _0xe86a=function(_0x15483b,_0x3b9e92){_0x15483b=_0x15483b-0x0;var _0x90fa=_0x86ae[_0x15483b];return _0x90fa;};'use strict';var moment=require(_0xe86a('0x0'));var Sequelize=require(_0xe86a('0x1'));module[_0xe86a('0x2')]={'uniqueid':{'type':Sequelize[_0xe86a('0x3')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0xe86a('0x4')]},'leaveAt':{'type':Sequelize[_0xe86a('0x4')]},'acceptAt':{'type':Sequelize[_0xe86a('0x4')]},'exitAt':{'type':Sequelize[_0xe86a('0x4')]},'reason':{'type':Sequelize[_0xe86a('0x3')]}}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.controller.js b/server/api/faxQueueReport/faxQueueReport.controller.js index 4f9b44d..5d8c2d2 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 _0xa7cf=['apply','reject','save','update','then','error','stack','name','index','FaxQueueReport','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','map','type','key','VIRTUAL','field','filter','merge','count','includeAll','include','findAll','rows','params','rawAttributes','find','catch','create','body','destroy','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','crypto','desk.js','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','set','Content-Range'];(function(_0x3db919,_0x393b08){var _0x7ccb0a=function(_0x378828){while(--_0x378828){_0x3db919['push'](_0x3db919['shift']());}};_0x7ccb0a(++_0x393b08);}(_0xa7cf,0x1a3));var _0xfa7c=function(_0x631a3c,_0x1b61b6){_0x631a3c=_0x631a3c-0x0;var _0x2bdfa3=_0xa7cf[_0x631a3c];return _0x2bdfa3;};'use strict';var pdf=require(_0xfa7c('0x0'));var emlformat=require(_0xfa7c('0x1'));var rimraf=require(_0xfa7c('0x2'));var zipdir=require(_0xfa7c('0x3'));var jsonpatch=require(_0xfa7c('0x4'));var rp=require(_0xfa7c('0x5'));var moment=require(_0xfa7c('0x6'));var BPromise=require('bluebird');var Mustache=require(_0xfa7c('0x7'));var util=require(_0xfa7c('0x8'));var path=require(_0xfa7c('0x9'));var sox=require(_0xfa7c('0xa'));var csv=require(_0xfa7c('0xb'));var ejs=require(_0xfa7c('0xc'));var fs=require('fs');var _=require(_0xfa7c('0xd'));var squel=require('squel');var crypto=require(_0xfa7c('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xfa7c('0xf'));var toCsv=require(_0xfa7c('0xb'));var querystring=require('querystring');var Papa=require(_0xfa7c('0x10'));var Redis=require('ioredis');var authService=require(_0xfa7c('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xfa7c('0x12'));var hardwareService=require(_0xfa7c('0x13'));var logger=require(_0xfa7c('0x14'))('api');var utils=require('../../config/utils');var config=require(_0xfa7c('0x15'));var db=require(_0xfa7c('0x16'))['db'];function respondWithStatusCode(_0x28ab67,_0x4f25bb){_0x4f25bb=_0x4f25bb||0xcc;return function(_0x30e3c5){if(_0x30e3c5){return _0x28ab67[_0xfa7c('0x17')](_0x4f25bb);}return _0x28ab67[_0xfa7c('0x18')](_0x4f25bb)[_0xfa7c('0x19')]();};}function respondWithResult(_0x4f11bd,_0x2814df){_0x2814df=_0x2814df||0xc8;return function(_0x3d1f5f){if(_0x3d1f5f){return _0x4f11bd[_0xfa7c('0x18')](_0x2814df)[_0xfa7c('0x1a')](_0x3d1f5f);}};}function respondWithFilteredResult(_0x51c400,_0x4b33a2){return function(_0x417b2f){if(_0x417b2f){var _0x530d62=_0x417b2f['count'],_0x376b88=_0x4b33a2[_0xfa7c('0x1b')],_0x251cd8=_0x4b33a2[_0xfa7c('0x1b')]+_0x4b33a2[_0xfa7c('0x1c')],_0x43ad40;if(_0x251cd8>=_0x530d62){_0x251cd8=_0x530d62;_0x43ad40=0xc8;}else{_0x43ad40=0xce;}_0x51c400[_0xfa7c('0x18')](_0x43ad40);return _0x51c400[_0xfa7c('0x1d')](_0xfa7c('0x1e'),_0x376b88+'-'+_0x251cd8+'/'+_0x530d62)[_0xfa7c('0x1a')](_0x417b2f);}return null;};}function patchUpdates(_0x336c5a){return function(_0x587b58){try{jsonpatch[_0xfa7c('0x1f')](_0x587b58,_0x336c5a,!![]);}catch(_0x4a4c55){return BPromise[_0xfa7c('0x20')](_0x4a4c55);}return _0x587b58[_0xfa7c('0x21')]();};}function saveUpdates(_0x1f83a7,_0x53e3ec){return function(_0x3d7e45){if(_0x3d7e45){return _0x3d7e45[_0xfa7c('0x22')](_0x1f83a7)[_0xfa7c('0x23')](function(_0x31326e){return _0x31326e;});}return null;};}function removeEntity(_0x104be8,_0x4e2403){return function(_0x2823a7){if(_0x2823a7){return _0x2823a7['destroy']()[_0xfa7c('0x23')](function(){_0x104be8[_0xfa7c('0x18')](0xcc)[_0xfa7c('0x19')]();});}};}function handleEntityNotFound(_0x3ba1b1,_0x419b8a){return function(_0x7dea1c){if(!_0x7dea1c){_0x3ba1b1['sendStatus'](0x194);}return _0x7dea1c;};}function handleError(_0x3e8b95,_0x4f77d4){_0x4f77d4=_0x4f77d4||0x1f4;return function(_0x118d71){logger[_0xfa7c('0x24')](_0x118d71[_0xfa7c('0x25')]);if(_0x118d71[_0xfa7c('0x26')]){delete _0x118d71[_0xfa7c('0x26')];}_0x3e8b95[_0xfa7c('0x18')](_0x4f77d4)['send'](_0x118d71);};}exports[_0xfa7c('0x27')]=function(_0x25e326,_0x30647b){var _0x3f1b03={},_0x33bd61={},_0xf279dd={'count':0x0,'rows':[]};var _0x55b9b2=db[_0xfa7c('0x28')]['rawAttributes'];_0x33bd61[_0xfa7c('0x29')]=_[_0xfa7c('0x2a')](_0x55b9b2);_0x33bd61[_0xfa7c('0x2b')]=_[_0xfa7c('0x2a')](_0x25e326[_0xfa7c('0x2b')]);_0x33bd61[_0xfa7c('0x2c')]=_['intersection'](_0x33bd61[_0xfa7c('0x29')],_0x33bd61[_0xfa7c('0x2b')]);_0x3f1b03[_0xfa7c('0x2d')]=_[_0xfa7c('0x2e')](_0x33bd61[_0xfa7c('0x29')],qs[_0xfa7c('0x2f')](_0x25e326['query'][_0xfa7c('0x2f')]));_0x3f1b03['attributes']=_0x3f1b03[_0xfa7c('0x2d')][_0xfa7c('0x30')]?_0x3f1b03['attributes']:_0x33bd61[_0xfa7c('0x29')];if(!_0x25e326[_0xfa7c('0x2b')][_0xfa7c('0x31')](_0xfa7c('0x32'))){_0x3f1b03[_0xfa7c('0x1c')]=qs[_0xfa7c('0x1c')](_0x25e326[_0xfa7c('0x2b')][_0xfa7c('0x1c')]);_0x3f1b03[_0xfa7c('0x1b')]=qs[_0xfa7c('0x1b')](_0x25e326[_0xfa7c('0x2b')]['offset']);}_0x3f1b03[_0xfa7c('0x33')]=qs[_0xfa7c('0x34')](_0x25e326[_0xfa7c('0x2b')][_0xfa7c('0x34')]);_0x3f1b03[_0xfa7c('0x35')]=qs[_0xfa7c('0x2c')](_[_0xfa7c('0x36')](_0x25e326[_0xfa7c('0x2b')],_0x33bd61[_0xfa7c('0x2c')]));if(_0x25e326[_0xfa7c('0x2b')]['filter']){_0x3f1b03[_0xfa7c('0x35')]=_['merge'](_0x3f1b03[_0xfa7c('0x35')],{'$or':_[_0xfa7c('0x37')](_0x55b9b2,function(_0x4fd251){if(_0x4fd251[_0xfa7c('0x38')][_0xfa7c('0x39')]!==_0xfa7c('0x3a')){var _0x17e564={};_0x17e564[_0x4fd251[_0xfa7c('0x3b')]]={'$like':'%'+_0x25e326[_0xfa7c('0x2b')][_0xfa7c('0x3c')]+'%'};return _0x17e564;}})});}_0x3f1b03=_[_0xfa7c('0x3d')]({},_0x3f1b03,_0x25e326['options']);var _0x23d52b={'where':_0x3f1b03[_0xfa7c('0x35')]};return db['FaxQueueReport'][_0xfa7c('0x3e')](_0x23d52b)['then'](function(_0x5908a6){_0xf279dd['count']=_0x5908a6;if(_0x25e326[_0xfa7c('0x2b')][_0xfa7c('0x3f')]){_0x3f1b03[_0xfa7c('0x40')]=[{'all':!![]}];}return db[_0xfa7c('0x28')][_0xfa7c('0x41')](_0x3f1b03);})[_0xfa7c('0x23')](function(_0xd6a611){_0xf279dd[_0xfa7c('0x42')]=_0xd6a611;return _0xf279dd;})[_0xfa7c('0x23')](respondWithFilteredResult(_0x30647b,_0x3f1b03))['catch'](handleError(_0x30647b,null));};exports['show']=function(_0x38b7fc,_0x46823c){var _0x550b2={'raw':!![],'where':{'id':_0x38b7fc[_0xfa7c('0x43')]['id']}},_0x514fa4={};_0x514fa4[_0xfa7c('0x29')]=_[_0xfa7c('0x2a')](db[_0xfa7c('0x28')][_0xfa7c('0x44')]);_0x514fa4['query']=_['keys'](_0x38b7fc[_0xfa7c('0x2b')]);_0x514fa4[_0xfa7c('0x2c')]=_[_0xfa7c('0x2e')](_0x514fa4[_0xfa7c('0x29')],_0x514fa4[_0xfa7c('0x2b')]);_0x550b2[_0xfa7c('0x2d')]=_[_0xfa7c('0x2e')](_0x514fa4[_0xfa7c('0x29')],qs[_0xfa7c('0x2f')](_0x38b7fc[_0xfa7c('0x2b')][_0xfa7c('0x2f')]));_0x550b2[_0xfa7c('0x2d')]=_0x550b2[_0xfa7c('0x2d')][_0xfa7c('0x30')]?_0x550b2['attributes']:_0x514fa4[_0xfa7c('0x29')];if(_0x38b7fc[_0xfa7c('0x2b')][_0xfa7c('0x3f')]){_0x550b2[_0xfa7c('0x40')]=[{'all':!![]}];}_0x550b2=_['merge']({},_0x550b2,_0x38b7fc['options']);return db['FaxQueueReport'][_0xfa7c('0x45')](_0x550b2)[_0xfa7c('0x23')](handleEntityNotFound(_0x46823c,null))[_0xfa7c('0x23')](respondWithResult(_0x46823c,null))[_0xfa7c('0x46')](handleError(_0x46823c,null));};exports[_0xfa7c('0x47')]=function(_0x184d4a,_0x37d3c8){return db[_0xfa7c('0x28')][_0xfa7c('0x47')](_0x184d4a[_0xfa7c('0x48')],{})[_0xfa7c('0x23')](respondWithResult(_0x37d3c8,0xc9))[_0xfa7c('0x46')](handleError(_0x37d3c8,null));};exports[_0xfa7c('0x22')]=function(_0x37919a,_0x172c26){if(_0x37919a[_0xfa7c('0x48')]['id']){delete _0x37919a['body']['id'];}return db[_0xfa7c('0x28')][_0xfa7c('0x45')]({'where':{'id':_0x37919a[_0xfa7c('0x43')]['id']}})['then'](handleEntityNotFound(_0x172c26,null))['then'](saveUpdates(_0x37919a[_0xfa7c('0x48')],null))[_0xfa7c('0x23')](respondWithResult(_0x172c26,null))[_0xfa7c('0x46')](handleError(_0x172c26,null));};exports[_0xfa7c('0x49')]=function(_0x2ba177,_0x566ec4){return db[_0xfa7c('0x28')][_0xfa7c('0x45')]({'where':{'id':_0x2ba177[_0xfa7c('0x43')]['id']}})[_0xfa7c('0x23')](handleEntityNotFound(_0x566ec4,null))[_0xfa7c('0x23')](removeEntity(_0x566ec4,null))[_0xfa7c('0x46')](handleError(_0x566ec4,null));};exports['describe']=function(_0x2e6ddc,_0x4856b0){return db[_0xfa7c('0x28')][_0xfa7c('0x4a')]()[_0xfa7c('0x23')](respondWithResult(_0x4856b0,null))[_0xfa7c('0x46')](handleError(_0x4856b0,null));}; \ No newline at end of file +var _0x4e32=['offset','limit','set','Content-Range','update','destroy','then','stack','name','index','FaxQueueReport','rawAttributes','model','keys','query','intersection','attributes','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','map','type','key','VIRTUAL','options','include','rows','catch','show','params','fields','includeAll','find','create','body','describe','html-pdf','eml-format','rimraf','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','../../mysqldb','sendStatus','status','end','json','count'];(function(_0x3fc854,_0x534993){var _0x398e97=function(_0x34c170){while(--_0x34c170){_0x3fc854['push'](_0x3fc854['shift']());}};_0x398e97(++_0x534993);}(_0x4e32,0x18d));var _0x24e3=function(_0x3dae6c,_0x156b90){_0x3dae6c=_0x3dae6c-0x0;var _0x29bd0c=_0x4e32[_0x3dae6c];return _0x29bd0c;};'use strict';var pdf=require(_0x24e3('0x0'));var emlformat=require(_0x24e3('0x1'));var rimraf=require(_0x24e3('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x24e3('0x3'));var util=require(_0x24e3('0x4'));var path=require(_0x24e3('0x5'));var sox=require(_0x24e3('0x6'));var csv=require(_0x24e3('0x7'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x24e3('0x8'));var squel=require(_0x24e3('0x9'));var crypto=require(_0x24e3('0xa'));var jsforce=require(_0x24e3('0xb'));var deskjs=require(_0x24e3('0xc'));var toCsv=require(_0x24e3('0x7'));var querystring=require(_0x24e3('0xd'));var Papa=require(_0x24e3('0xe'));var Redis=require(_0x24e3('0xf'));var authService=require(_0x24e3('0x10'));var qs=require(_0x24e3('0x11'));var as=require(_0x24e3('0x12'));var hardwareService=require(_0x24e3('0x13'));var logger=require(_0x24e3('0x14'))(_0x24e3('0x15'));var utils=require(_0x24e3('0x16'));var config=require('../../config/environment');var db=require(_0x24e3('0x17'))['db'];function respondWithStatusCode(_0x1abff4,_0x237167){_0x237167=_0x237167||0xcc;return function(_0x18f920){if(_0x18f920){return _0x1abff4[_0x24e3('0x18')](_0x237167);}return _0x1abff4[_0x24e3('0x19')](_0x237167)[_0x24e3('0x1a')]();};}function respondWithResult(_0x9c1335,_0x2091e5){_0x2091e5=_0x2091e5||0xc8;return function(_0x2bcb16){if(_0x2bcb16){return _0x9c1335[_0x24e3('0x19')](_0x2091e5)[_0x24e3('0x1b')](_0x2bcb16);}};}function respondWithFilteredResult(_0x19072f,_0x221741){return function(_0x6b1275){if(_0x6b1275){var _0x1ab1c1=_0x6b1275[_0x24e3('0x1c')],_0xe862b8=_0x221741[_0x24e3('0x1d')],_0x6f1699=_0x221741['offset']+_0x221741[_0x24e3('0x1e')],_0x284b92;if(_0x6f1699>=_0x1ab1c1){_0x6f1699=_0x1ab1c1;_0x284b92=0xc8;}else{_0x284b92=0xce;}_0x19072f[_0x24e3('0x19')](_0x284b92);return _0x19072f[_0x24e3('0x1f')](_0x24e3('0x20'),_0xe862b8+'-'+_0x6f1699+'/'+_0x1ab1c1)[_0x24e3('0x1b')](_0x6b1275);}return null;};}function patchUpdates(_0x4c7ddd){return function(_0x4b8139){try{jsonpatch['apply'](_0x4b8139,_0x4c7ddd,!![]);}catch(_0x44cbeb){return BPromise['reject'](_0x44cbeb);}return _0x4b8139['save']();};}function saveUpdates(_0x1ef8db,_0x199f25){return function(_0x4a29bb){if(_0x4a29bb){return _0x4a29bb[_0x24e3('0x21')](_0x1ef8db)['then'](function(_0x58a272){return _0x58a272;});}return null;};}function removeEntity(_0x3ad0c9,_0x5c77ea){return function(_0xb6e366){if(_0xb6e366){return _0xb6e366[_0x24e3('0x22')]()[_0x24e3('0x23')](function(){_0x3ad0c9[_0x24e3('0x19')](0xcc)[_0x24e3('0x1a')]();});}};}function handleEntityNotFound(_0x441d05,_0x42da88){return function(_0x246fe1){if(!_0x246fe1){_0x441d05[_0x24e3('0x18')](0x194);}return _0x246fe1;};}function handleError(_0x15e66d,_0x244459){_0x244459=_0x244459||0x1f4;return function(_0xe74b16){logger['error'](_0xe74b16[_0x24e3('0x24')]);if(_0xe74b16[_0x24e3('0x25')]){delete _0xe74b16[_0x24e3('0x25')];}_0x15e66d[_0x24e3('0x19')](_0x244459)['send'](_0xe74b16);};}exports[_0x24e3('0x26')]=function(_0x40cc5d,_0x2039f9){var _0x2c1c74={},_0x9bbc71={},_0x31d207={'count':0x0,'rows':[]};var _0x32bdb4=db[_0x24e3('0x27')][_0x24e3('0x28')];_0x9bbc71[_0x24e3('0x29')]=_[_0x24e3('0x2a')](_0x32bdb4);_0x9bbc71[_0x24e3('0x2b')]=_['keys'](_0x40cc5d['query']);_0x9bbc71['filters']=_[_0x24e3('0x2c')](_0x9bbc71[_0x24e3('0x29')],_0x9bbc71[_0x24e3('0x2b')]);_0x2c1c74[_0x24e3('0x2d')]=_[_0x24e3('0x2c')](_0x9bbc71[_0x24e3('0x29')],qs['fields'](_0x40cc5d[_0x24e3('0x2b')]['fields']));_0x2c1c74[_0x24e3('0x2d')]=_0x2c1c74[_0x24e3('0x2d')]['length']?_0x2c1c74[_0x24e3('0x2d')]:_0x9bbc71[_0x24e3('0x29')];if(!_0x40cc5d[_0x24e3('0x2b')][_0x24e3('0x2e')](_0x24e3('0x2f'))){_0x2c1c74[_0x24e3('0x1e')]=qs[_0x24e3('0x1e')](_0x40cc5d[_0x24e3('0x2b')][_0x24e3('0x1e')]);_0x2c1c74[_0x24e3('0x1d')]=qs[_0x24e3('0x1d')](_0x40cc5d[_0x24e3('0x2b')][_0x24e3('0x1d')]);}_0x2c1c74[_0x24e3('0x30')]=qs['sort'](_0x40cc5d[_0x24e3('0x2b')][_0x24e3('0x31')]);_0x2c1c74[_0x24e3('0x32')]=qs[_0x24e3('0x33')](_[_0x24e3('0x34')](_0x40cc5d[_0x24e3('0x2b')],_0x9bbc71['filters']));if(_0x40cc5d['query'][_0x24e3('0x35')]){_0x2c1c74['where']=_[_0x24e3('0x36')](_0x2c1c74[_0x24e3('0x32')],{'$or':_[_0x24e3('0x37')](_0x32bdb4,function(_0x25048b){if(_0x25048b[_0x24e3('0x38')][_0x24e3('0x39')]!==_0x24e3('0x3a')){var _0xc9cdbd={};_0xc9cdbd[_0x25048b['field']]={'$like':'%'+_0x40cc5d['query']['filter']+'%'};return _0xc9cdbd;}})});}_0x2c1c74=_[_0x24e3('0x36')]({},_0x2c1c74,_0x40cc5d[_0x24e3('0x3b')]);var _0x520fe={'where':_0x2c1c74[_0x24e3('0x32')]};return db[_0x24e3('0x27')][_0x24e3('0x1c')](_0x520fe)[_0x24e3('0x23')](function(_0x1b1274){_0x31d207['count']=_0x1b1274;if(_0x40cc5d[_0x24e3('0x2b')]['includeAll']){_0x2c1c74[_0x24e3('0x3c')]=[{'all':!![]}];}return db[_0x24e3('0x27')]['findAll'](_0x2c1c74);})[_0x24e3('0x23')](function(_0x142465){_0x31d207[_0x24e3('0x3d')]=_0x142465;return _0x31d207;})[_0x24e3('0x23')](respondWithFilteredResult(_0x2039f9,_0x2c1c74))[_0x24e3('0x3e')](handleError(_0x2039f9,null));};exports[_0x24e3('0x3f')]=function(_0x13b2cc,_0x4b6135){var _0x5caf46={'raw':!![],'where':{'id':_0x13b2cc[_0x24e3('0x40')]['id']}},_0x4e319c={};_0x4e319c[_0x24e3('0x29')]=_[_0x24e3('0x2a')](db[_0x24e3('0x27')][_0x24e3('0x28')]);_0x4e319c[_0x24e3('0x2b')]=_[_0x24e3('0x2a')](_0x13b2cc[_0x24e3('0x2b')]);_0x4e319c[_0x24e3('0x33')]=_[_0x24e3('0x2c')](_0x4e319c['model'],_0x4e319c[_0x24e3('0x2b')]);_0x5caf46[_0x24e3('0x2d')]=_[_0x24e3('0x2c')](_0x4e319c[_0x24e3('0x29')],qs[_0x24e3('0x41')](_0x13b2cc[_0x24e3('0x2b')][_0x24e3('0x41')]));_0x5caf46[_0x24e3('0x2d')]=_0x5caf46[_0x24e3('0x2d')]['length']?_0x5caf46[_0x24e3('0x2d')]:_0x4e319c[_0x24e3('0x29')];if(_0x13b2cc[_0x24e3('0x2b')][_0x24e3('0x42')]){_0x5caf46['include']=[{'all':!![]}];}_0x5caf46=_[_0x24e3('0x36')]({},_0x5caf46,_0x13b2cc[_0x24e3('0x3b')]);return db['FaxQueueReport'][_0x24e3('0x43')](_0x5caf46)[_0x24e3('0x23')](handleEntityNotFound(_0x4b6135,null))['then'](respondWithResult(_0x4b6135,null))[_0x24e3('0x3e')](handleError(_0x4b6135,null));};exports['create']=function(_0x37bfe1,_0x5c7a09){return db['FaxQueueReport'][_0x24e3('0x44')](_0x37bfe1[_0x24e3('0x45')],{})[_0x24e3('0x23')](respondWithResult(_0x5c7a09,0xc9))['catch'](handleError(_0x5c7a09,null));};exports[_0x24e3('0x21')]=function(_0x5129fb,_0x337a6d){if(_0x5129fb['body']['id']){delete _0x5129fb[_0x24e3('0x45')]['id'];}return db['FaxQueueReport'][_0x24e3('0x43')]({'where':{'id':_0x5129fb[_0x24e3('0x40')]['id']}})[_0x24e3('0x23')](handleEntityNotFound(_0x337a6d,null))[_0x24e3('0x23')](saveUpdates(_0x5129fb[_0x24e3('0x45')],null))[_0x24e3('0x23')](respondWithResult(_0x337a6d,null))[_0x24e3('0x3e')](handleError(_0x337a6d,null));};exports[_0x24e3('0x22')]=function(_0x3e977f,_0x48c2d2){return db[_0x24e3('0x27')]['find']({'where':{'id':_0x3e977f[_0x24e3('0x40')]['id']}})[_0x24e3('0x23')](handleEntityNotFound(_0x48c2d2,null))[_0x24e3('0x23')](removeEntity(_0x48c2d2,null))[_0x24e3('0x3e')](handleError(_0x48c2d2,null));};exports[_0x24e3('0x46')]=function(_0x4ae308,_0xc800c){return db[_0x24e3('0x27')]['describe']()[_0x24e3('0x23')](respondWithResult(_0xc800c,null))[_0x24e3('0x3e')](handleError(_0xc800c,null));}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.model.js b/server/api/faxQueueReport/faxQueueReport.model.js index f11477a..ce57612 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 _0x905b=['report_fax_queue','uniqueid','lodash','util','../../config/logger','api','moment','request-promise','path','../../config/environment','./faxQueueReport.attributes','exports','FaxQueueReport'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x905b,0x13a));var _0xb905=function(_0x484c89,_0x41e941){_0x484c89=_0x484c89-0x0;var _0x2a96a7=_0x905b[_0x484c89];return _0x2a96a7;};'use strict';var _=require(_0xb905('0x0'));var util=require(_0xb905('0x1'));var logger=require(_0xb905('0x2'))(_0xb905('0x3'));var moment=require(_0xb905('0x4'));var BPromise=require('bluebird');var rp=require(_0xb905('0x5'));var fs=require('fs');var path=require(_0xb905('0x6'));var rimraf=require('rimraf');var config=require(_0xb905('0x7'));var attributes=require(_0xb905('0x8'));module[_0xb905('0x9')]=function(_0x1d01fe,_0x379abc){return _0x1d01fe['define'](_0xb905('0xa'),attributes,{'tableName':_0xb905('0xb'),'paranoid':![],'indexes':[{'name':_0xb905('0xc'),'fields':[_0xb905('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xad21=['util','api','bluebird','request-promise','path','rimraf','../../config/environment','./faxQueueReport.attributes','exports','define','FaxQueueReport','uniqueid'];(function(_0x511b76,_0x4727fa){var _0x5424ff=function(_0x24b7c0){while(--_0x24b7c0){_0x511b76['push'](_0x511b76['shift']());}};_0x5424ff(++_0x4727fa);}(_0xad21,0xc0));var _0x1ad2=function(_0x3f6bcf,_0x531e79){_0x3f6bcf=_0x3f6bcf-0x0;var _0x1c5350=_0xad21[_0x3f6bcf];return _0x1c5350;};'use strict';var _=require('lodash');var util=require(_0x1ad2('0x0'));var logger=require('../../config/logger')(_0x1ad2('0x1'));var moment=require('moment');var BPromise=require(_0x1ad2('0x2'));var rp=require(_0x1ad2('0x3'));var fs=require('fs');var path=require(_0x1ad2('0x4'));var rimraf=require(_0x1ad2('0x5'));var config=require(_0x1ad2('0x6'));var attributes=require(_0x1ad2('0x7'));module[_0x1ad2('0x8')]=function(_0x386fe6,_0x3eab24){return _0x386fe6[_0x1ad2('0x9')](_0x1ad2('0xa'),attributes,{'tableName':'report_fax_queue','paranoid':![],'indexes':[{'name':_0x1ad2('0xb'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.rpc.js b/server/api/faxQueueReport/faxQueueReport.rpc.js index 06c95ce..6ae57cb 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 _0x9eda=['result','catch','CreateFaxQueueReport','FaxQueueReport','options','debug','stringify','update','body','raw','where','UpdateFaxQueueReport','lodash','moment','bluebird','randomstring','../../config/logger','rpc','../../config/environment','client','http','then','info','FaxQueueReport,\x20%s,\x20%s','request\x20sent','FaxQueueReport,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x401fcc,_0x4a9b51){var _0x215949=function(_0x183fea){while(--_0x183fea){_0x401fcc['push'](_0x401fcc['shift']());}};_0x215949(++_0x4a9b51);}(_0x9eda,0x1dc));var _0xa9ed=function(_0x1233a7,_0xd6b38f){_0x1233a7=_0x1233a7-0x0;var _0x56d64b=_0x9eda[_0x1233a7];return _0x56d64b;};'use strict';var _=require(_0xa9ed('0x0'));var util=require('util');var moment=require(_0xa9ed('0x1'));var BPromise=require(_0xa9ed('0x2'));var rs=require(_0xa9ed('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xa9ed('0x4'))(_0xa9ed('0x5'));var config=require(_0xa9ed('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xa9ed('0x7')][_0xa9ed('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x39558f,_0xe66b5c,_0xbbe4b2){return new BPromise(function(_0x522caa,_0x383863){return client['request'](_0x39558f,_0xbbe4b2)[_0xa9ed('0x9')](function(_0x4e5800){logger[_0xa9ed('0xa')](_0xa9ed('0xb'),_0xe66b5c,_0xa9ed('0xc'));logger['debug'](_0xa9ed('0xd'),_0xe66b5c,'request\x20sent',JSON['stringify'](_0x4e5800));if(_0x4e5800[_0xa9ed('0xe')]){if(_0x4e5800[_0xa9ed('0xe')][_0xa9ed('0xf')]===0x1f4){logger[_0xa9ed('0xe')](_0xa9ed('0xb'),_0xe66b5c,_0x4e5800[_0xa9ed('0xe')]['message']);return _0x383863(_0x4e5800[_0xa9ed('0xe')][_0xa9ed('0x10')]);}logger[_0xa9ed('0xe')](_0xa9ed('0xb'),_0xe66b5c,_0x4e5800[_0xa9ed('0xe')][_0xa9ed('0x10')]);return _0x522caa(_0x4e5800[_0xa9ed('0xe')]['message']);}else{logger[_0xa9ed('0xa')](_0xa9ed('0xb'),_0xe66b5c,_0xa9ed('0xc'));_0x522caa(_0x4e5800[_0xa9ed('0x11')][_0xa9ed('0x10')]);}})[_0xa9ed('0x12')](function(_0x451d41){logger[_0xa9ed('0xe')](_0xa9ed('0xb'),_0xe66b5c,_0x451d41);_0x383863(_0x451d41);});});}exports[_0xa9ed('0x13')]=function(_0x184c10){var _0x4e9327=this;return new Promise(function(_0xdbee88,_0xd5a457){return db[_0xa9ed('0x14')]['create'](_0x184c10['body'],{'raw':_0x184c10[_0xa9ed('0x15')]?_0x184c10[_0xa9ed('0x15')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x1c67d8){logger[_0xa9ed('0xa')]('CreateFaxQueueReport',_0x184c10);logger[_0xa9ed('0x16')](_0xa9ed('0x13'),_0x184c10,JSON[_0xa9ed('0x17')](_0x1c67d8));_0xdbee88(_0x1c67d8);})[_0xa9ed('0x12')](function(_0xed9654){logger[_0xa9ed('0xe')](_0xa9ed('0x13'),_0xed9654['message'],_0x184c10);_0xd5a457(_0x4e9327[_0xa9ed('0xe')](0x1f4,_0xed9654[_0xa9ed('0x10')]));});});};exports['UpdateFaxQueueReport']=function(_0x5c80df){var _0x5972a2=this;return new Promise(function(_0xbda304,_0x184c2f){return db['FaxQueueReport'][_0xa9ed('0x18')](_0x5c80df[_0xa9ed('0x19')],{'raw':_0x5c80df[_0xa9ed('0x15')]?_0x5c80df[_0xa9ed('0x15')][_0xa9ed('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5c80df[_0xa9ed('0x15')]?_0x5c80df[_0xa9ed('0x15')][_0xa9ed('0x1b')]||null:null,'attributes':_0x5c80df[_0xa9ed('0x15')]?_0x5c80df[_0xa9ed('0x15')]['attributes']||null:null,'limit':_0x5c80df[_0xa9ed('0x15')]?_0x5c80df[_0xa9ed('0x15')]['limit']||null:null})[_0xa9ed('0x9')](function(_0x37c2ad){logger['info'](_0xa9ed('0x1c'),_0x5c80df);logger[_0xa9ed('0x16')](_0xa9ed('0x1c'),_0x5c80df,JSON[_0xa9ed('0x17')](_0x37c2ad));_0xbda304(_0x37c2ad);})['catch'](function(_0x22861b){logger[_0xa9ed('0xe')](_0xa9ed('0x1c'),_0x22861b[_0xa9ed('0x10')],_0x5c80df);_0x184c2f(_0x5972a2[_0xa9ed('0xe')](0x1f4,_0x22861b[_0xa9ed('0x10')]));});});}; \ No newline at end of file +var _0x9c29=['request','then','info','FaxQueueReport,\x20%s,\x20%s','request\x20sent','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CreateFaxQueueReport','FaxQueueReport','create','options','raw','stringify','UpdateFaxQueueReport','update','body','where','attributes','limit','lodash','util','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http'];(function(_0x1b49ff,_0x358598){var _0x24e703=function(_0x2b03d7){while(--_0x2b03d7){_0x1b49ff['push'](_0x1b49ff['shift']());}};_0x24e703(++_0x358598);}(_0x9c29,0x162));var _0x99c2=function(_0x265018,_0x579c78){_0x265018=_0x265018-0x0;var _0x22dac2=_0x9c29[_0x265018];return _0x22dac2;};'use strict';var _=require(_0x99c2('0x0'));var util=require(_0x99c2('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x99c2('0x2'));var db=require(_0x99c2('0x3'))['db'];var utils=require(_0x99c2('0x4'));var logger=require(_0x99c2('0x5'))('rpc');var config=require(_0x99c2('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x99c2('0x7')][_0x99c2('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x203b38,_0x4187c5,_0x2aad8b){return new BPromise(function(_0x40a131,_0x3edde6){return client[_0x99c2('0x9')](_0x203b38,_0x2aad8b)[_0x99c2('0xa')](function(_0x1ef212){logger[_0x99c2('0xb')](_0x99c2('0xc'),_0x4187c5,_0x99c2('0xd'));logger[_0x99c2('0xe')](_0x99c2('0xf'),_0x4187c5,_0x99c2('0xd'),JSON['stringify'](_0x1ef212));if(_0x1ef212[_0x99c2('0x10')]){if(_0x1ef212['error'][_0x99c2('0x11')]===0x1f4){logger[_0x99c2('0x10')](_0x99c2('0xc'),_0x4187c5,_0x1ef212[_0x99c2('0x10')][_0x99c2('0x12')]);return _0x3edde6(_0x1ef212[_0x99c2('0x10')][_0x99c2('0x12')]);}logger['error'](_0x99c2('0xc'),_0x4187c5,_0x1ef212[_0x99c2('0x10')]['message']);return _0x40a131(_0x1ef212[_0x99c2('0x10')][_0x99c2('0x12')]);}else{logger['info'](_0x99c2('0xc'),_0x4187c5,'request\x20sent');_0x40a131(_0x1ef212[_0x99c2('0x13')][_0x99c2('0x12')]);}})[_0x99c2('0x14')](function(_0x3b3d5e){logger[_0x99c2('0x10')]('FaxQueueReport,\x20%s,\x20%s',_0x4187c5,_0x3b3d5e);_0x3edde6(_0x3b3d5e);});});}exports[_0x99c2('0x15')]=function(_0x127254){var _0x5b5981=this;return new Promise(function(_0x55f8a4,_0x57bd4a){return db[_0x99c2('0x16')][_0x99c2('0x17')](_0x127254['body'],{'raw':_0x127254[_0x99c2('0x18')]?_0x127254[_0x99c2('0x18')][_0x99c2('0x19')]===undefined?!![]:![]:!![]})[_0x99c2('0xa')](function(_0x4304dd){logger[_0x99c2('0xb')](_0x99c2('0x15'),_0x127254);logger[_0x99c2('0xe')](_0x99c2('0x15'),_0x127254,JSON[_0x99c2('0x1a')](_0x4304dd));_0x55f8a4(_0x4304dd);})[_0x99c2('0x14')](function(_0x489a7b){logger[_0x99c2('0x10')](_0x99c2('0x15'),_0x489a7b[_0x99c2('0x12')],_0x127254);_0x57bd4a(_0x5b5981[_0x99c2('0x10')](0x1f4,_0x489a7b[_0x99c2('0x12')]));});});};exports[_0x99c2('0x1b')]=function(_0x197220){var _0x58ebf8=this;return new Promise(function(_0x5e5a6f,_0x17a416){return db[_0x99c2('0x16')][_0x99c2('0x1c')](_0x197220[_0x99c2('0x1d')],{'raw':_0x197220[_0x99c2('0x18')]?_0x197220[_0x99c2('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x197220[_0x99c2('0x18')]?_0x197220['options'][_0x99c2('0x1e')]||null:null,'attributes':_0x197220['options']?_0x197220[_0x99c2('0x18')][_0x99c2('0x1f')]||null:null,'limit':_0x197220[_0x99c2('0x18')]?_0x197220[_0x99c2('0x18')][_0x99c2('0x20')]||null:null})[_0x99c2('0xa')](function(_0x4a5a5c){logger['info']('UpdateFaxQueueReport',_0x197220);logger[_0x99c2('0xe')](_0x99c2('0x1b'),_0x197220,JSON['stringify'](_0x4a5a5c));_0x5e5a6f(_0x4a5a5c);})[_0x99c2('0x14')](function(_0x362dd0){logger['error'](_0x99c2('0x1b'),_0x362dd0[_0x99c2('0x12')],_0x197220);_0x17a416(_0x58ebf8[_0x99c2('0x10')](0x1f4,_0x362dd0['message']));});});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/index.js b/server/api/faxQueueReport/index.js index 3b31232..9ff1b91 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 _0x633b=['connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueueReport.controller','get','isAuthenticated','index','/describe','show','post','put','/:id','update','delete','destroy','exports','util','path'];(function(_0x2283dc,_0x2fcfc5){var _0x16db90=function(_0x376c35){while(--_0x376c35){_0x2283dc['push'](_0x2283dc['shift']());}};_0x16db90(++_0x2fcfc5);}(_0x633b,0x166));var _0xb633=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x633b[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require('multer');var util=require(_0xb633('0x0'));var path=require(_0xb633('0x1'));var timeout=require(_0xb633('0x2'));var express=require(_0xb633('0x3'));var router=express['Router']();var auth=require(_0xb633('0x4'));var interaction=require(_0xb633('0x5'));var config=require(_0xb633('0x6'));var controller=require(_0xb633('0x7'));router[_0xb633('0x8')]('/',auth[_0xb633('0x9')](),controller[_0xb633('0xa')]);router[_0xb633('0x8')](_0xb633('0xb'),auth[_0xb633('0x9')](),controller['describe']);router[_0xb633('0x8')]('/:id',auth[_0xb633('0x9')](),controller[_0xb633('0xc')]);router[_0xb633('0xd')]('/',auth[_0xb633('0x9')](),controller['create']);router[_0xb633('0xe')](_0xb633('0xf'),auth[_0xb633('0x9')](),controller[_0xb633('0x10')]);router[_0xb633('0x11')](_0xb633('0xf'),auth['isAuthenticated'](),controller[_0xb633('0x12')]);module[_0xb633('0x13')]=router; \ No newline at end of file +var _0xa3c6=['index','/describe','/:id','show','post','create','put','update','delete','destroy','multer','connect-timeout','../../components/auth/service','../../components/interaction/service','./faxQueueReport.controller','get','isAuthenticated'];(function(_0x14c06e,_0x38749e){var _0x11ffbd=function(_0x50ca43){while(--_0x50ca43){_0x14c06e['push'](_0x14c06e['shift']());}};_0x11ffbd(++_0x38749e);}(_0xa3c6,0x70));var _0x6a3c=function(_0x5ace99,_0x5e72b6){_0x5ace99=_0x5ace99-0x0;var _0x4377b0=_0xa3c6[_0x5ace99];return _0x4377b0;};'use strict';var multer=require(_0x6a3c('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x6a3c('0x1'));var express=require('express');var router=express['Router']();var auth=require(_0x6a3c('0x2'));var interaction=require(_0x6a3c('0x3'));var config=require('../../config/environment');var controller=require(_0x6a3c('0x4'));router[_0x6a3c('0x5')]('/',auth[_0x6a3c('0x6')](),controller[_0x6a3c('0x7')]);router[_0x6a3c('0x5')](_0x6a3c('0x8'),auth[_0x6a3c('0x6')](),controller['describe']);router[_0x6a3c('0x5')](_0x6a3c('0x9'),auth['isAuthenticated'](),controller[_0x6a3c('0xa')]);router[_0x6a3c('0xb')]('/',auth[_0x6a3c('0x6')](),controller[_0x6a3c('0xc')]);router[_0x6a3c('0xd')](_0x6a3c('0x9'),auth['isAuthenticated'](),controller[_0x6a3c('0xe')]);router[_0x6a3c('0xf')](_0x6a3c('0x9'),auth[_0x6a3c('0x6')](),controller[_0x6a3c('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.attributes.js b/server/api/faxTransferReport/faxTransferReport.attributes.js index caa28d9..f374d36 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 _0xe225=['sequelize','exports','STRING','ENUM','account','agent','queue','DATE','NOW','moment'];(function(_0x2348a7,_0x156acf){var _0x2d9fc8=function(_0x2d8915){while(--_0x2d8915){_0x2348a7['push'](_0x2348a7['shift']());}};_0x2d9fc8(++_0x156acf);}(_0xe225,0x149));var _0x5e22=function(_0x517db2,_0x22e5f6){_0x517db2=_0x517db2-0x0;var _0x636271=_0xe225[_0x517db2];return _0x636271;};'use strict';var moment=require(_0x5e22('0x0'));var Sequelize=require(_0x5e22('0x1'));module[_0x5e22('0x2')]={'uniqueid':{'type':Sequelize[_0x5e22('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x5e22('0x4')](_0x5e22('0x5'),_0x5e22('0x6'),_0x5e22('0x7')),'allowNull':![],'defaultValue':_0x5e22('0x7')},'transferredAt':{'type':Sequelize[_0x5e22('0x8')],'allowNull':![],'defaultValue':Sequelize[_0x5e22('0x9')]}}; \ No newline at end of file +var _0xb0a8=['account','agent','queue','NOW','moment','sequelize','STRING'];(function(_0x3e8b18,_0x37b004){var _0x16c05b=function(_0x2fb0c3){while(--_0x2fb0c3){_0x3e8b18['push'](_0x3e8b18['shift']());}};_0x16c05b(++_0x37b004);}(_0xb0a8,0x100));var _0x8b0a=function(_0x39b8d,_0x56d0b9){_0x39b8d=_0x39b8d-0x0;var _0x1e56bc=_0xb0a8[_0x39b8d];return _0x1e56bc;};'use strict';var moment=require(_0x8b0a('0x0'));var Sequelize=require(_0x8b0a('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0x8b0a('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x8b0a('0x3'),_0x8b0a('0x4'),_0x8b0a('0x5')),'allowNull':![],'defaultValue':_0x8b0a('0x5')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x8b0a('0x6')]}}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.controller.js b/server/api/faxTransferReport/faxTransferReport.controller.js index d656e63..e904a0f 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 _0x6f04=['mustache','path','sox','to-csv','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','set','reject','save','update','then','destroy','name','send','index','FaxTransferReport','model','query','filters','intersection','attributes','hasOwnProperty','nolimit','limit','sort','where','map','type','VIRTUAL','field','filter','merge','options','count','includeAll','include','findAll','rows','params','keys','fields','find','catch','create','body','describe','html-pdf','eml-format','zip-dir','request-promise','moment','bluebird'];(function(_0x376c7b,_0xb3be2a){var _0x581386=function(_0x265319){while(--_0x265319){_0x376c7b['push'](_0x376c7b['shift']());}};_0x581386(++_0xb3be2a);}(_0x6f04,0x102));var _0x46f0=function(_0x8f690b,_0x4d5d58){_0x8f690b=_0x8f690b-0x0;var _0x3a3e95=_0x6f04[_0x8f690b];return _0x3a3e95;};'use strict';var pdf=require(_0x46f0('0x0'));var emlformat=require(_0x46f0('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x46f0('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x46f0('0x3'));var moment=require(_0x46f0('0x4'));var BPromise=require(_0x46f0('0x5'));var Mustache=require(_0x46f0('0x6'));var util=require('util');var path=require(_0x46f0('0x7'));var sox=require(_0x46f0('0x8'));var csv=require(_0x46f0('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x46f0('0xa'));var squel=require(_0x46f0('0xb'));var crypto=require(_0x46f0('0xc'));var jsforce=require(_0x46f0('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x46f0('0x9'));var querystring=require(_0x46f0('0xe'));var Papa=require('papaparse');var Redis=require(_0x46f0('0xf'));var authService=require(_0x46f0('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x46f0('0x11'));var logger=require('../../config/logger')(_0x46f0('0x12'));var utils=require(_0x46f0('0x13'));var config=require(_0x46f0('0x14'));var db=require(_0x46f0('0x15'))['db'];function respondWithStatusCode(_0x49641a,_0x2e9403){_0x2e9403=_0x2e9403||0xcc;return function(_0x425b34){if(_0x425b34){return _0x49641a[_0x46f0('0x16')](_0x2e9403);}return _0x49641a[_0x46f0('0x17')](_0x2e9403)['end']();};}function respondWithResult(_0x1facdf,_0x4f39be){_0x4f39be=_0x4f39be||0xc8;return function(_0x314369){if(_0x314369){return _0x1facdf[_0x46f0('0x17')](_0x4f39be)[_0x46f0('0x18')](_0x314369);}};}function respondWithFilteredResult(_0x4193e3,_0x3f30e3){return function(_0x2c2919){if(_0x2c2919){var _0x23c47f=_0x2c2919['count'],_0x5e5445=_0x3f30e3[_0x46f0('0x19')],_0x3ecb18=_0x3f30e3[_0x46f0('0x19')]+_0x3f30e3['limit'],_0x1c1513;if(_0x3ecb18>=_0x23c47f){_0x3ecb18=_0x23c47f;_0x1c1513=0xc8;}else{_0x1c1513=0xce;}_0x4193e3[_0x46f0('0x17')](_0x1c1513);return _0x4193e3[_0x46f0('0x1a')]('Content-Range',_0x5e5445+'-'+_0x3ecb18+'/'+_0x23c47f)[_0x46f0('0x18')](_0x2c2919);}return null;};}function patchUpdates(_0x64b14d){return function(_0x121a64){try{jsonpatch['apply'](_0x121a64,_0x64b14d,!![]);}catch(_0x464013){return BPromise[_0x46f0('0x1b')](_0x464013);}return _0x121a64[_0x46f0('0x1c')]();};}function saveUpdates(_0x21f2df,_0x577433){return function(_0x2c4a19){if(_0x2c4a19){return _0x2c4a19[_0x46f0('0x1d')](_0x21f2df)[_0x46f0('0x1e')](function(_0x2b1a56){return _0x2b1a56;});}return null;};}function removeEntity(_0x278733,_0xb17407){return function(_0x1cbdb0){if(_0x1cbdb0){return _0x1cbdb0[_0x46f0('0x1f')]()['then'](function(){_0x278733[_0x46f0('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4ce2bd,_0x2c9219){return function(_0x487fd6){if(!_0x487fd6){_0x4ce2bd[_0x46f0('0x16')](0x194);}return _0x487fd6;};}function handleError(_0x24cb4d,_0x5ace9d){_0x5ace9d=_0x5ace9d||0x1f4;return function(_0x2d1308){logger['error'](_0x2d1308['stack']);if(_0x2d1308['name']){delete _0x2d1308[_0x46f0('0x20')];}_0x24cb4d[_0x46f0('0x17')](_0x5ace9d)[_0x46f0('0x21')](_0x2d1308);};}exports[_0x46f0('0x22')]=function(_0x32e1c2,_0x53b8ed){var _0x1012af={},_0x3087ff={},_0x38642d={'count':0x0,'rows':[]};var _0xb67553=db[_0x46f0('0x23')]['rawAttributes'];_0x3087ff[_0x46f0('0x24')]=_['keys'](_0xb67553);_0x3087ff[_0x46f0('0x25')]=_['keys'](_0x32e1c2[_0x46f0('0x25')]);_0x3087ff[_0x46f0('0x26')]=_[_0x46f0('0x27')](_0x3087ff[_0x46f0('0x24')],_0x3087ff[_0x46f0('0x25')]);_0x1012af[_0x46f0('0x28')]=_[_0x46f0('0x27')](_0x3087ff['model'],qs['fields'](_0x32e1c2[_0x46f0('0x25')]['fields']));_0x1012af[_0x46f0('0x28')]=_0x1012af[_0x46f0('0x28')]['length']?_0x1012af[_0x46f0('0x28')]:_0x3087ff[_0x46f0('0x24')];if(!_0x32e1c2[_0x46f0('0x25')][_0x46f0('0x29')](_0x46f0('0x2a'))){_0x1012af[_0x46f0('0x2b')]=qs[_0x46f0('0x2b')](_0x32e1c2[_0x46f0('0x25')][_0x46f0('0x2b')]);_0x1012af[_0x46f0('0x19')]=qs[_0x46f0('0x19')](_0x32e1c2[_0x46f0('0x25')]['offset']);}_0x1012af['order']=qs[_0x46f0('0x2c')](_0x32e1c2[_0x46f0('0x25')][_0x46f0('0x2c')]);_0x1012af[_0x46f0('0x2d')]=qs[_0x46f0('0x26')](_['pick'](_0x32e1c2[_0x46f0('0x25')],_0x3087ff[_0x46f0('0x26')]));if(_0x32e1c2[_0x46f0('0x25')]['filter']){_0x1012af[_0x46f0('0x2d')]=_['merge'](_0x1012af[_0x46f0('0x2d')],{'$or':_[_0x46f0('0x2e')](_0xb67553,function(_0x9c954f){if(_0x9c954f[_0x46f0('0x2f')]['key']!==_0x46f0('0x30')){var _0x307fc2={};_0x307fc2[_0x9c954f[_0x46f0('0x31')]]={'$like':'%'+_0x32e1c2[_0x46f0('0x25')][_0x46f0('0x32')]+'%'};return _0x307fc2;}})});}_0x1012af=_[_0x46f0('0x33')]({},_0x1012af,_0x32e1c2[_0x46f0('0x34')]);var _0x150748={'where':_0x1012af[_0x46f0('0x2d')]};return db[_0x46f0('0x23')][_0x46f0('0x35')](_0x150748)[_0x46f0('0x1e')](function(_0x5c41fa){_0x38642d['count']=_0x5c41fa;if(_0x32e1c2[_0x46f0('0x25')][_0x46f0('0x36')]){_0x1012af[_0x46f0('0x37')]=[{'all':!![]}];}return db[_0x46f0('0x23')][_0x46f0('0x38')](_0x1012af);})['then'](function(_0x3b8c05){_0x38642d[_0x46f0('0x39')]=_0x3b8c05;return _0x38642d;})[_0x46f0('0x1e')](respondWithFilteredResult(_0x53b8ed,_0x1012af))['catch'](handleError(_0x53b8ed,null));};exports['show']=function(_0x12cb53,_0x32bce6){var _0x2c607b={'raw':!![],'where':{'id':_0x12cb53[_0x46f0('0x3a')]['id']}},_0x3f3482={};_0x3f3482[_0x46f0('0x24')]=_[_0x46f0('0x3b')](db[_0x46f0('0x23')]['rawAttributes']);_0x3f3482[_0x46f0('0x25')]=_['keys'](_0x12cb53[_0x46f0('0x25')]);_0x3f3482[_0x46f0('0x26')]=_[_0x46f0('0x27')](_0x3f3482[_0x46f0('0x24')],_0x3f3482[_0x46f0('0x25')]);_0x2c607b[_0x46f0('0x28')]=_[_0x46f0('0x27')](_0x3f3482[_0x46f0('0x24')],qs[_0x46f0('0x3c')](_0x12cb53[_0x46f0('0x25')][_0x46f0('0x3c')]));_0x2c607b[_0x46f0('0x28')]=_0x2c607b['attributes']['length']?_0x2c607b['attributes']:_0x3f3482[_0x46f0('0x24')];if(_0x12cb53[_0x46f0('0x25')][_0x46f0('0x36')]){_0x2c607b[_0x46f0('0x37')]=[{'all':!![]}];}_0x2c607b=_[_0x46f0('0x33')]({},_0x2c607b,_0x12cb53['options']);return db[_0x46f0('0x23')][_0x46f0('0x3d')](_0x2c607b)[_0x46f0('0x1e')](handleEntityNotFound(_0x32bce6,null))['then'](respondWithResult(_0x32bce6,null))[_0x46f0('0x3e')](handleError(_0x32bce6,null));};exports['create']=function(_0x4eb958,_0x2d5098){return db[_0x46f0('0x23')][_0x46f0('0x3f')](_0x4eb958[_0x46f0('0x40')],{})['then'](respondWithResult(_0x2d5098,0xc9))[_0x46f0('0x3e')](handleError(_0x2d5098,null));};exports[_0x46f0('0x1d')]=function(_0x5c686a,_0x4c8c6f){if(_0x5c686a[_0x46f0('0x40')]['id']){delete _0x5c686a['body']['id'];}return db[_0x46f0('0x23')][_0x46f0('0x3d')]({'where':{'id':_0x5c686a['params']['id']}})[_0x46f0('0x1e')](handleEntityNotFound(_0x4c8c6f,null))[_0x46f0('0x1e')](saveUpdates(_0x5c686a[_0x46f0('0x40')],null))[_0x46f0('0x1e')](respondWithResult(_0x4c8c6f,null))['catch'](handleError(_0x4c8c6f,null));};exports[_0x46f0('0x1f')]=function(_0x25671e,_0x186d3d){return db[_0x46f0('0x23')]['find']({'where':{'id':_0x25671e['params']['id']}})[_0x46f0('0x1e')](handleEntityNotFound(_0x186d3d,null))[_0x46f0('0x1e')](removeEntity(_0x186d3d,null))[_0x46f0('0x3e')](handleError(_0x186d3d,null));};exports[_0x46f0('0x41')]=function(_0x5a0fb9,_0x2602b1){return db[_0x46f0('0x23')][_0x46f0('0x41')]()['then'](respondWithResult(_0x2602b1,null))[_0x46f0('0x3e')](handleError(_0x2602b1,null));}; \ No newline at end of file +var _0x101c=['request-promise','mustache','sox','to-csv','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','status','end','json','offset','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','FaxTransferReport','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','pick','where','map','type','key','field','filter','options','count','include','findAll','rows','show','params','includeAll','merge','find','catch','create','body','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0x504da0,_0x434965){var _0x5d8c38=function(_0x19e22c){while(--_0x19e22c){_0x504da0['push'](_0x504da0['shift']());}};_0x5d8c38(++_0x434965);}(_0x101c,0xd0));var _0xc101=function(_0x46d0c9,_0x526bfa){_0x46d0c9=_0x46d0c9-0x0;var _0x174506=_0x101c[_0x46d0c9];return _0x174506;};'use strict';var pdf=require(_0xc101('0x0'));var emlformat=require(_0xc101('0x1'));var rimraf=require(_0xc101('0x2'));var zipdir=require(_0xc101('0x3'));var jsonpatch=require(_0xc101('0x4'));var rp=require(_0xc101('0x5'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xc101('0x6'));var util=require('util');var path=require('path');var sox=require(_0xc101('0x7'));var csv=require(_0xc101('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xc101('0x9'));var squel=require(_0xc101('0xa'));var crypto=require(_0xc101('0xb'));var jsforce=require(_0xc101('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xc101('0x8'));var querystring=require(_0xc101('0xd'));var Papa=require(_0xc101('0xe'));var Redis=require(_0xc101('0xf'));var authService=require(_0xc101('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc101('0x11'));var logger=require(_0xc101('0x12'))(_0xc101('0x13'));var utils=require(_0xc101('0x14'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xe548f3,_0x21668e){_0x21668e=_0x21668e||0xcc;return function(_0x51008a){if(_0x51008a){return _0xe548f3[_0xc101('0x15')](_0x21668e);}return _0xe548f3[_0xc101('0x16')](_0x21668e)[_0xc101('0x17')]();};}function respondWithResult(_0x3a53e8,_0x5481f3){_0x5481f3=_0x5481f3||0xc8;return function(_0x4e6359){if(_0x4e6359){return _0x3a53e8[_0xc101('0x16')](_0x5481f3)[_0xc101('0x18')](_0x4e6359);}};}function respondWithFilteredResult(_0x4cb9f3,_0x210599){return function(_0x3dd828){if(_0x3dd828){var _0x332351=_0x3dd828['count'],_0x19339c=_0x210599[_0xc101('0x19')],_0x2cd19f=_0x210599[_0xc101('0x19')]+_0x210599['limit'],_0x135dc2;if(_0x2cd19f>=_0x332351){_0x2cd19f=_0x332351;_0x135dc2=0xc8;}else{_0x135dc2=0xce;}_0x4cb9f3[_0xc101('0x16')](_0x135dc2);return _0x4cb9f3['set'](_0xc101('0x1a'),_0x19339c+'-'+_0x2cd19f+'/'+_0x332351)[_0xc101('0x18')](_0x3dd828);}return null;};}function patchUpdates(_0x45c0ef){return function(_0x2ffff0){try{jsonpatch[_0xc101('0x1b')](_0x2ffff0,_0x45c0ef,!![]);}catch(_0x1c5a3a){return BPromise[_0xc101('0x1c')](_0x1c5a3a);}return _0x2ffff0[_0xc101('0x1d')]();};}function saveUpdates(_0x1aef59,_0x434ee7){return function(_0x497732){if(_0x497732){return _0x497732[_0xc101('0x1e')](_0x1aef59)['then'](function(_0x2c4976){return _0x2c4976;});}return null;};}function removeEntity(_0x1402bc,_0x2a769f){return function(_0xb12ba4){if(_0xb12ba4){return _0xb12ba4[_0xc101('0x1f')]()[_0xc101('0x20')](function(){_0x1402bc[_0xc101('0x16')](0xcc)[_0xc101('0x17')]();});}};}function handleEntityNotFound(_0x2f039b,_0x466da1){return function(_0x270851){if(!_0x270851){_0x2f039b[_0xc101('0x15')](0x194);}return _0x270851;};}function handleError(_0x5cf068,_0x5b6a8b){_0x5b6a8b=_0x5b6a8b||0x1f4;return function(_0x4fe246){logger[_0xc101('0x21')](_0x4fe246[_0xc101('0x22')]);if(_0x4fe246['name']){delete _0x4fe246[_0xc101('0x23')];}_0x5cf068[_0xc101('0x16')](_0x5b6a8b)['send'](_0x4fe246);};}exports['index']=function(_0x3ca35a,_0xd061e3){var _0x548c39={},_0xdaa4b4={},_0x2b378f={'count':0x0,'rows':[]};var _0x249740=db[_0xc101('0x24')][_0xc101('0x25')];_0xdaa4b4[_0xc101('0x26')]=_[_0xc101('0x27')](_0x249740);_0xdaa4b4[_0xc101('0x28')]=_[_0xc101('0x27')](_0x3ca35a[_0xc101('0x28')]);_0xdaa4b4[_0xc101('0x29')]=_[_0xc101('0x2a')](_0xdaa4b4['model'],_0xdaa4b4[_0xc101('0x28')]);_0x548c39[_0xc101('0x2b')]=_['intersection'](_0xdaa4b4[_0xc101('0x26')],qs['fields'](_0x3ca35a['query'][_0xc101('0x2c')]));_0x548c39[_0xc101('0x2b')]=_0x548c39['attributes'][_0xc101('0x2d')]?_0x548c39[_0xc101('0x2b')]:_0xdaa4b4['model'];if(!_0x3ca35a[_0xc101('0x28')][_0xc101('0x2e')](_0xc101('0x2f'))){_0x548c39['limit']=qs[_0xc101('0x30')](_0x3ca35a[_0xc101('0x28')][_0xc101('0x30')]);_0x548c39['offset']=qs['offset'](_0x3ca35a['query'][_0xc101('0x19')]);}_0x548c39[_0xc101('0x31')]=qs['sort'](_0x3ca35a[_0xc101('0x28')]['sort']);_0x548c39['where']=qs[_0xc101('0x29')](_[_0xc101('0x32')](_0x3ca35a['query'],_0xdaa4b4[_0xc101('0x29')]));if(_0x3ca35a[_0xc101('0x28')]['filter']){_0x548c39['where']=_['merge'](_0x548c39[_0xc101('0x33')],{'$or':_[_0xc101('0x34')](_0x249740,function(_0x556e86){if(_0x556e86[_0xc101('0x35')][_0xc101('0x36')]!=='VIRTUAL'){var _0x47c810={};_0x47c810[_0x556e86[_0xc101('0x37')]]={'$like':'%'+_0x3ca35a['query'][_0xc101('0x38')]+'%'};return _0x47c810;}})});}_0x548c39=_['merge']({},_0x548c39,_0x3ca35a[_0xc101('0x39')]);var _0x5bd6f3={'where':_0x548c39[_0xc101('0x33')]};return db[_0xc101('0x24')][_0xc101('0x3a')](_0x5bd6f3)[_0xc101('0x20')](function(_0x397a5f){_0x2b378f[_0xc101('0x3a')]=_0x397a5f;if(_0x3ca35a[_0xc101('0x28')]['includeAll']){_0x548c39[_0xc101('0x3b')]=[{'all':!![]}];}return db[_0xc101('0x24')][_0xc101('0x3c')](_0x548c39);})['then'](function(_0x4f229b){_0x2b378f[_0xc101('0x3d')]=_0x4f229b;return _0x2b378f;})[_0xc101('0x20')](respondWithFilteredResult(_0xd061e3,_0x548c39))['catch'](handleError(_0xd061e3,null));};exports[_0xc101('0x3e')]=function(_0x3c4455,_0x4a64f3){var _0x5125d3={'raw':!![],'where':{'id':_0x3c4455[_0xc101('0x3f')]['id']}},_0x3d0495={};_0x3d0495[_0xc101('0x26')]=_[_0xc101('0x27')](db[_0xc101('0x24')][_0xc101('0x25')]);_0x3d0495[_0xc101('0x28')]=_[_0xc101('0x27')](_0x3c4455[_0xc101('0x28')]);_0x3d0495[_0xc101('0x29')]=_['intersection'](_0x3d0495[_0xc101('0x26')],_0x3d0495[_0xc101('0x28')]);_0x5125d3[_0xc101('0x2b')]=_[_0xc101('0x2a')](_0x3d0495['model'],qs[_0xc101('0x2c')](_0x3c4455[_0xc101('0x28')]['fields']));_0x5125d3[_0xc101('0x2b')]=_0x5125d3['attributes'][_0xc101('0x2d')]?_0x5125d3[_0xc101('0x2b')]:_0x3d0495[_0xc101('0x26')];if(_0x3c4455[_0xc101('0x28')][_0xc101('0x40')]){_0x5125d3[_0xc101('0x3b')]=[{'all':!![]}];}_0x5125d3=_[_0xc101('0x41')]({},_0x5125d3,_0x3c4455[_0xc101('0x39')]);return db[_0xc101('0x24')][_0xc101('0x42')](_0x5125d3)['then'](handleEntityNotFound(_0x4a64f3,null))['then'](respondWithResult(_0x4a64f3,null))[_0xc101('0x43')](handleError(_0x4a64f3,null));};exports[_0xc101('0x44')]=function(_0x5e4d90,_0x37c305){return db[_0xc101('0x24')][_0xc101('0x44')](_0x5e4d90[_0xc101('0x45')],{})[_0xc101('0x20')](respondWithResult(_0x37c305,0xc9))['catch'](handleError(_0x37c305,null));};exports[_0xc101('0x1e')]=function(_0x4aae9a,_0x4ef8d8){if(_0x4aae9a[_0xc101('0x45')]['id']){delete _0x4aae9a[_0xc101('0x45')]['id'];}return db['FaxTransferReport'][_0xc101('0x42')]({'where':{'id':_0x4aae9a[_0xc101('0x3f')]['id']}})[_0xc101('0x20')](handleEntityNotFound(_0x4ef8d8,null))[_0xc101('0x20')](saveUpdates(_0x4aae9a[_0xc101('0x45')],null))['then'](respondWithResult(_0x4ef8d8,null))[_0xc101('0x43')](handleError(_0x4ef8d8,null));};exports[_0xc101('0x1f')]=function(_0x2dfb98,_0x2571c3){return db['FaxTransferReport'][_0xc101('0x42')]({'where':{'id':_0x2dfb98[_0xc101('0x3f')]['id']}})[_0xc101('0x20')](handleEntityNotFound(_0x2571c3,null))[_0xc101('0x20')](removeEntity(_0x2571c3,null))[_0xc101('0x43')](handleError(_0x2571c3,null));};exports[_0xc101('0x46')]=function(_0x29eb40,_0x29f8de){return db['FaxTransferReport']['describe']()[_0xc101('0x20')](respondWithResult(_0x29f8de,null))[_0xc101('0x43')](handleError(_0x29f8de,null));}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.model.js b/server/api/faxTransferReport/faxTransferReport.model.js index c3dc26b..b39d291 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 _0x5e94=['./faxTransferReport.attributes','exports','define','FaxTransferReport','report_fax_transfer','uniqueid','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0x3fba9f,_0x3b7b9b){var _0x192cf1=function(_0x557290){while(--_0x557290){_0x3fba9f['push'](_0x3fba9f['shift']());}};_0x192cf1(++_0x3b7b9b);}(_0x5e94,0x1e6));var _0x45e9=function(_0x6bc678,_0x4611a1){_0x6bc678=_0x6bc678-0x0;var _0x332f93=_0x5e94[_0x6bc678];return _0x332f93;};'use strict';var _=require('lodash');var util=require(_0x45e9('0x0'));var logger=require(_0x45e9('0x1'))(_0x45e9('0x2'));var moment=require('moment');var BPromise=require(_0x45e9('0x3'));var rp=require(_0x45e9('0x4'));var fs=require('fs');var path=require(_0x45e9('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x45e9('0x6'));module[_0x45e9('0x7')]=function(_0x954e7e,_0x31b50a){return _0x954e7e[_0x45e9('0x8')](_0x45e9('0x9'),attributes,{'tableName':_0x45e9('0xa'),'paranoid':![],'indexes':[{'name':_0x45e9('0xb'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x3401=['moment','bluebird','request-promise','rimraf','../../config/environment','./faxTransferReport.attributes','exports','define','FaxTransferReport','uniqueid','lodash','util','../../config/logger','api'];(function(_0x347e9f,_0x7fe01c){var _0x1e8b04=function(_0x54db27){while(--_0x54db27){_0x347e9f['push'](_0x347e9f['shift']());}};_0x1e8b04(++_0x7fe01c);}(_0x3401,0xc0));var _0x1340=function(_0x5c42c9,_0x30b54e){_0x5c42c9=_0x5c42c9-0x0;var _0x15fcb5=_0x3401[_0x5c42c9];return _0x15fcb5;};'use strict';var _=require(_0x1340('0x0'));var util=require(_0x1340('0x1'));var logger=require(_0x1340('0x2'))(_0x1340('0x3'));var moment=require(_0x1340('0x4'));var BPromise=require(_0x1340('0x5'));var rp=require(_0x1340('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1340('0x7'));var config=require(_0x1340('0x8'));var attributes=require(_0x1340('0x9'));module[_0x1340('0xa')]=function(_0x2c9752,_0xb32299){return _0x2c9752[_0x1340('0xb')](_0x1340('0xc'),attributes,{'tableName':'report_fax_transfer','paranoid':![],'indexes':[{'name':_0x1340('0xd'),'fields':[_0x1340('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 bfe7490..4db29fb 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 _0x4218=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','info','FaxTransferReport,\x20%s,\x20%s','request\x20sent','debug','FaxTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash'];(function(_0x4b8f37,_0x25f74a){var _0x133101=function(_0x1225a4){while(--_0x1225a4){_0x4b8f37['push'](_0x4b8f37['shift']());}};_0x133101(++_0x25f74a);}(_0x4218,0xe5));var _0x8421=function(_0x20de85,_0x4911de){_0x20de85=_0x20de85-0x0;var _0x4a7c97=_0x4218[_0x20de85];return _0x4a7c97;};'use strict';var _=require(_0x8421('0x0'));var util=require(_0x8421('0x1'));var moment=require(_0x8421('0x2'));var BPromise=require(_0x8421('0x3'));var rs=require(_0x8421('0x4'));var fs=require('fs');var Redis=require(_0x8421('0x5'));var db=require(_0x8421('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x8421('0x7'));var config=require(_0x8421('0x8'));var jayson=require(_0x8421('0x9'));var client=jayson[_0x8421('0xa')][_0x8421('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4fcdcd,_0x1c6d9d,_0x40e70b){return new BPromise(function(_0x5c12ee,_0x1bb4a9){return client[_0x8421('0xc')](_0x4fcdcd,_0x40e70b)['then'](function(_0x397348){logger[_0x8421('0xd')](_0x8421('0xe'),_0x1c6d9d,_0x8421('0xf'));logger[_0x8421('0x10')](_0x8421('0x11'),_0x1c6d9d,_0x8421('0xf'),JSON[_0x8421('0x12')](_0x397348));if(_0x397348['error']){if(_0x397348[_0x8421('0x13')]['code']===0x1f4){logger[_0x8421('0x13')]('FaxTransferReport,\x20%s,\x20%s',_0x1c6d9d,_0x397348[_0x8421('0x13')][_0x8421('0x14')]);return _0x1bb4a9(_0x397348[_0x8421('0x13')]['message']);}logger[_0x8421('0x13')]('FaxTransferReport,\x20%s,\x20%s',_0x1c6d9d,_0x397348[_0x8421('0x13')][_0x8421('0x14')]);return _0x5c12ee(_0x397348[_0x8421('0x13')][_0x8421('0x14')]);}else{logger[_0x8421('0xd')](_0x8421('0xe'),_0x1c6d9d,_0x8421('0xf'));_0x5c12ee(_0x397348[_0x8421('0x15')][_0x8421('0x14')]);}})[_0x8421('0x16')](function(_0x245305){logger['error'](_0x8421('0xe'),_0x1c6d9d,_0x245305);_0x1bb4a9(_0x245305);});});} \ No newline at end of file +var _0x35d8=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','then','info','FaxTransferReport,\x20%s,\x20%s','request\x20sent','error','code','message','lodash','util','moment','randomstring'];(function(_0x5e579b,_0x51e1bb){var _0xf0cd40=function(_0x3813fb){while(--_0x3813fb){_0x5e579b['push'](_0x5e579b['shift']());}};_0xf0cd40(++_0x51e1bb);}(_0x35d8,0x73));var _0x835d=function(_0x889d76,_0x174bcf){_0x889d76=_0x889d76-0x0;var _0x51d771=_0x35d8[_0x889d76];return _0x51d771;};'use strict';var _=require(_0x835d('0x0'));var util=require(_0x835d('0x1'));var moment=require(_0x835d('0x2'));var BPromise=require('bluebird');var rs=require(_0x835d('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x835d('0x4'))['db'];var utils=require(_0x835d('0x5'));var logger=require(_0x835d('0x6'))(_0x835d('0x7'));var config=require(_0x835d('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x835d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x19f2cb,_0x53b290,_0x4f26f1){return new BPromise(function(_0x4f9cbf,_0x4ab5c4){return client['request'](_0x19f2cb,_0x4f26f1)[_0x835d('0xa')](function(_0x2a027a){logger[_0x835d('0xb')](_0x835d('0xc'),_0x53b290,'request\x20sent');logger['debug']('FaxTransferReport,\x20%s,\x20%s,\x20%s',_0x53b290,_0x835d('0xd'),JSON['stringify'](_0x2a027a));if(_0x2a027a[_0x835d('0xe')]){if(_0x2a027a[_0x835d('0xe')][_0x835d('0xf')]===0x1f4){logger[_0x835d('0xe')]('FaxTransferReport,\x20%s,\x20%s',_0x53b290,_0x2a027a[_0x835d('0xe')][_0x835d('0x10')]);return _0x4ab5c4(_0x2a027a[_0x835d('0xe')][_0x835d('0x10')]);}logger[_0x835d('0xe')](_0x835d('0xc'),_0x53b290,_0x2a027a[_0x835d('0xe')][_0x835d('0x10')]);return _0x4f9cbf(_0x2a027a[_0x835d('0xe')]['message']);}else{logger[_0x835d('0xb')]('FaxTransferReport,\x20%s,\x20%s',_0x53b290,_0x835d('0xd'));_0x4f9cbf(_0x2a027a['result'][_0x835d('0x10')]);}})['catch'](function(_0x1a8420){logger[_0x835d('0xe')](_0x835d('0xc'),_0x53b290,_0x1a8420);_0x4ab5c4(_0x1a8420);});});} \ No newline at end of file diff --git a/server/api/faxTransferReport/index.js b/server/api/faxTransferReport/index.js index 49f6e8f..713eb6f 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 _0x00a6=['multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxTransferReport.controller','get','isAuthenticated','index','/describe','/:id','show','create','put','update','destroy'];(function(_0x5f1391,_0x19c132){var _0x50ebe3=function(_0x3d00a3){while(--_0x3d00a3){_0x5f1391['push'](_0x5f1391['shift']());}};_0x50ebe3(++_0x19c132);}(_0x00a6,0x169));var _0x600a=function(_0x22928c,_0x5ed50f){_0x22928c=_0x22928c-0x0;var _0x5f3fee=_0x00a6[_0x22928c];return _0x5f3fee;};'use strict';var multer=require(_0x600a('0x0'));var util=require(_0x600a('0x1'));var path=require('path');var timeout=require(_0x600a('0x2'));var express=require(_0x600a('0x3'));var router=express[_0x600a('0x4')]();var auth=require(_0x600a('0x5'));var interaction=require(_0x600a('0x6'));var config=require(_0x600a('0x7'));var controller=require(_0x600a('0x8'));router[_0x600a('0x9')]('/',auth[_0x600a('0xa')](),controller[_0x600a('0xb')]);router[_0x600a('0x9')](_0x600a('0xc'),auth[_0x600a('0xa')](),controller['describe']);router[_0x600a('0x9')](_0x600a('0xd'),auth[_0x600a('0xa')](),controller[_0x600a('0xe')]);router['post']('/',auth[_0x600a('0xa')](),controller[_0x600a('0xf')]);router[_0x600a('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x600a('0x11')]);router['delete']('/:id',auth[_0x600a('0xa')](),controller[_0x600a('0x12')]);module['exports']=router; \ No newline at end of file +var _0xc381=['path','connect-timeout','express','Router','../../config/environment','./faxTransferReport.controller','get','isAuthenticated','index','describe','/:id','show','post','create','put','delete','destroy','exports','multer','util'];(function(_0x20d4e7,_0x5f29f7){var _0x125131=function(_0x10dc57){while(--_0x10dc57){_0x20d4e7['push'](_0x20d4e7['shift']());}};_0x125131(++_0x5f29f7);}(_0xc381,0x8a));var _0x1c38=function(_0x3fb6ea,_0x1fe641){_0x3fb6ea=_0x3fb6ea-0x0;var _0x2d6d7b=_0xc381[_0x3fb6ea];return _0x2d6d7b;};'use strict';var multer=require(_0x1c38('0x0'));var util=require(_0x1c38('0x1'));var path=require(_0x1c38('0x2'));var timeout=require(_0x1c38('0x3'));var express=require(_0x1c38('0x4'));var router=express[_0x1c38('0x5')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x1c38('0x6'));var controller=require(_0x1c38('0x7'));router[_0x1c38('0x8')]('/',auth[_0x1c38('0x9')](),controller[_0x1c38('0xa')]);router[_0x1c38('0x8')]('/describe',auth['isAuthenticated'](),controller[_0x1c38('0xb')]);router[_0x1c38('0x8')](_0x1c38('0xc'),auth['isAuthenticated'](),controller[_0x1c38('0xd')]);router[_0x1c38('0xe')]('/',auth['isAuthenticated'](),controller[_0x1c38('0xf')]);router[_0x1c38('0x10')](_0x1c38('0xc'),auth[_0x1c38('0x9')](),controller['update']);router[_0x1c38('0x11')](_0x1c38('0xc'),auth[_0x1c38('0x9')](),controller[_0x1c38('0x12')]);module[_0x1c38('0x13')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/index.js b/server/api/intDeskAccount/index.js index e03dae4..eb979a8 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 _0x3baf=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskAccount.controller','get','isAuthenticated','index','/:id','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','multer','util','path'];(function(_0x4c9380,_0x2fefc0){var _0x49a523=function(_0x165e85){while(--_0x165e85){_0x4c9380['push'](_0x4c9380['shift']());}};_0x49a523(++_0x2fefc0);}(_0x3baf,0xf7));var _0xf3ba=function(_0x5a66b7,_0x517636){_0x5a66b7=_0x5a66b7-0x0;var _0x5f56e3=_0x3baf[_0x5a66b7];return _0x5f56e3;};'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 auth=require(_0xf3ba('0x6'));var interaction=require(_0xf3ba('0x7'));var config=require(_0xf3ba('0x8'));var controller=require(_0xf3ba('0x9'));router[_0xf3ba('0xa')]('/',auth[_0xf3ba('0xb')](),controller[_0xf3ba('0xc')]);router[_0xf3ba('0xa')](_0xf3ba('0xd'),auth['isAuthenticated'](),controller['show']);router['get'](_0xf3ba('0xe'),auth['isAuthenticated'](),controller[_0xf3ba('0xf')]);router[_0xf3ba('0xa')](_0xf3ba('0x10'),auth[_0xf3ba('0xb')](),controller[_0xf3ba('0x11')]);router[_0xf3ba('0x12')]('/',auth[_0xf3ba('0xb')](),controller[_0xf3ba('0x13')]);router[_0xf3ba('0x12')](_0xf3ba('0xe'),auth[_0xf3ba('0xb')](),controller[_0xf3ba('0x14')]);router[_0xf3ba('0x15')](_0xf3ba('0xd'),auth[_0xf3ba('0xb')](),controller[_0xf3ba('0x16')]);router[_0xf3ba('0x17')](_0xf3ba('0xd'),auth['isAuthenticated'](),controller[_0xf3ba('0x18')]);module['exports']=router; \ No newline at end of file +var _0x4074=['path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskAccount.controller','get','isAuthenticated','index','/:id/configurations','getFields','post','create','addConfiguration','put','/:id','update','delete','exports','multer','util'];(function(_0x501cf7,_0x35e4a2){var _0x4817b5=function(_0x144305){while(--_0x144305){_0x501cf7['push'](_0x501cf7['shift']());}};_0x4817b5(++_0x35e4a2);}(_0x4074,0xf0));var _0x4407=function(_0x27a36d,_0x4f298d){_0x27a36d=_0x27a36d-0x0;var _0x2cc892=_0x4074[_0x27a36d];return _0x2cc892;};'use strict';var multer=require(_0x4407('0x0'));var util=require(_0x4407('0x1'));var path=require(_0x4407('0x2'));var timeout=require('connect-timeout');var express=require(_0x4407('0x3'));var router=express[_0x4407('0x4')]();var auth=require(_0x4407('0x5'));var interaction=require(_0x4407('0x6'));var config=require(_0x4407('0x7'));var controller=require(_0x4407('0x8'));router[_0x4407('0x9')]('/',auth[_0x4407('0xa')](),controller[_0x4407('0xb')]);router[_0x4407('0x9')]('/:id',auth[_0x4407('0xa')](),controller['show']);router[_0x4407('0x9')](_0x4407('0xc'),auth[_0x4407('0xa')](),controller['getConfigurations']);router['get']('/:id/fields',auth[_0x4407('0xa')](),controller[_0x4407('0xd')]);router[_0x4407('0xe')]('/',auth[_0x4407('0xa')](),controller[_0x4407('0xf')]);router[_0x4407('0xe')](_0x4407('0xc'),auth[_0x4407('0xa')](),controller[_0x4407('0x10')]);router[_0x4407('0x11')](_0x4407('0x12'),auth['isAuthenticated'](),controller[_0x4407('0x13')]);router[_0x4407('0x14')]('/:id',auth[_0x4407('0xa')](),controller['destroy']);module[_0x4407('0x15')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.attributes.js b/server/api/intDeskAccount/intDeskAccount.attributes.js index f147f64..04ef490 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 _0x1d45=['ENUM','basic','integrationTab','newTab','sequelize','exports','STRING'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x1d45,0xe4));var _0x51d4=function(_0x5a79e2,_0x319b1a){_0x5a79e2=_0x5a79e2-0x0;var _0x266c45=_0x1d45[_0x5a79e2];return _0x266c45;};'use strict';var Sequelize=require(_0x51d4('0x0'));module[_0x51d4('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x51d4('0x2')]},'username':{'type':Sequelize[_0x51d4('0x2')]},'remoteUri':{'type':Sequelize[_0x51d4('0x2')]},'authType':{'type':Sequelize[_0x51d4('0x3')](_0x51d4('0x4')),'defaultValue':_0x51d4('0x4')},'password':{'type':Sequelize[_0x51d4('0x2')]},'consumerKey':{'type':Sequelize[_0x51d4('0x2')]},'consumerSecret':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0x51d4('0x2')]},'tokenSecret':{'type':Sequelize[_0x51d4('0x2')]},'serverUrl':{'type':Sequelize['STRING']},'type':{'type':Sequelize['ENUM'](_0x51d4('0x5'),_0x51d4('0x6')),'defaultValue':_0x51d4('0x5')}}; \ No newline at end of file +var _0x3078=['integrationTab','newTab','sequelize','exports','STRING','ENUM','basic'];(function(_0x1a3e97,_0x2ea512){var _0x487099=function(_0x52360d){while(--_0x52360d){_0x1a3e97['push'](_0x1a3e97['shift']());}};_0x487099(++_0x2ea512);}(_0x3078,0x152));var _0x8307=function(_0x24df34,_0x50aa1a){_0x24df34=_0x24df34-0x0;var _0x3980e8=_0x3078[_0x24df34];return _0x3980e8;};'use strict';var Sequelize=require(_0x8307('0x0'));module[_0x8307('0x1')]={'name':{'type':Sequelize[_0x8307('0x2')]},'description':{'type':Sequelize[_0x8307('0x2')]},'username':{'type':Sequelize[_0x8307('0x2')]},'remoteUri':{'type':Sequelize[_0x8307('0x2')]},'authType':{'type':Sequelize[_0x8307('0x3')](_0x8307('0x4')),'defaultValue':_0x8307('0x4')},'password':{'type':Sequelize[_0x8307('0x2')]},'consumerKey':{'type':Sequelize[_0x8307('0x2')]},'consumerSecret':{'type':Sequelize[_0x8307('0x2')]},'token':{'type':Sequelize['STRING']},'tokenSecret':{'type':Sequelize[_0x8307('0x2')]},'serverUrl':{'type':Sequelize[_0x8307('0x2')]},'type':{'type':Sequelize[_0x8307('0x3')](_0x8307('0x5'),_0x8307('0x6')),'defaultValue':_0x8307('0x5')}}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.controller.js b/server/api/intDeskAccount/intDeskAccount.controller.js index e4f9986..22e5ee9 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 _0x076d=['Descriptions','getDescriptions','DeskField','getFields','priority','authType','username','password','consumerKey','consumerSecret','token','tokenSecret','remoteUri','slice','substring','lastIndexOf','GET','format','%s/custom_fields','application/json','basic','headers','Authorization','Basic\x20%s','%s:%s','base64','map','_embedded','entries','active','label','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','html-pdf','rimraf','zip-dir','fast-json-patch','bluebird','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','DeskAccount,\x20%s,\x20%s','DeskAccount,\x20%s,\x20%s,\x20%s','error','message','info','request\x20sent','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','save','update','destroy','name','send','index','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','pick','where','merge','type','key','VIRTUAL','field','filter','options','DeskAccount','includeAll','findAll','rows','show','include','catch','create','body','find','params','getConfigurations','findOne','DeskConfiguration','order','sort','addConfiguration','AccountId','getSubjects','channel'];(function(_0x4c80d7,_0x2bef29){var _0x3c5095=function(_0x1b0e67){while(--_0x1b0e67){_0x4c80d7['push'](_0x4c80d7['shift']());}};_0x3c5095(++_0x2bef29);}(_0x076d,0x1a9));var _0xd076=function(_0x173441,_0x26b0d9){_0x173441=_0x173441-0x0;var _0x2423a8=_0x076d[_0x173441];return _0x2423a8;};'use strict';var pdf=require(_0xd076('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xd076('0x1'));var zipdir=require(_0xd076('0x2'));var jsonpatch=require(_0xd076('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xd076('0x4'));var Mustache=require('mustache');var util=require(_0xd076('0x5'));var path=require('path');var sox=require(_0xd076('0x6'));var csv=require(_0xd076('0x7'));var ejs=require(_0xd076('0x8'));var fs=require('fs');var _=require(_0xd076('0x9'));var squel=require(_0xd076('0xa'));var crypto=require(_0xd076('0xb'));var jsforce=require(_0xd076('0xc'));var deskjs=require(_0xd076('0xd'));var toCsv=require(_0xd076('0x7'));var querystring=require(_0xd076('0xe'));var Papa=require(_0xd076('0xf'));var Redis=require(_0xd076('0x10'));var authService=require(_0xd076('0x11'));var qs=require(_0xd076('0x12'));var as=require(_0xd076('0x13'));var hardwareService=require(_0xd076('0x14'));var logger=require(_0xd076('0x15'))(_0xd076('0x16'));var utils=require(_0xd076('0x17'));var config=require(_0xd076('0x18'));var db=require(_0xd076('0x19'))['db'];var integrations=require(_0xd076('0x1a'));var jayson=require(_0xd076('0x1b'));var client=jayson[_0xd076('0x1c')][_0xd076('0x1d')]({'port':0x232a});function checkPasswordPattern(_0x56f971,_0x4c1145,_0x58aaf8){if(_0x58aaf8){var _0x511f70=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x511f70[_0xd076('0x1e')](_0x4c1145)){return _0x56f971;}else{throw new Error(_0xd076('0x1f'));}}else{return _0x56f971;}}function respondWithRpcPromise(_0x46818d,_0x3c3803,_0x5d3e41,_0x4585e2){return new BPromise(function(_0x2778ff,_0x32f5af){var _0x2353d2=_0x4585e2||client;return _0x2353d2[_0xd076('0x20')](_0x46818d,_0x5d3e41)[_0xd076('0x21')](function(_0x2b0ea7){logger['info'](_0xd076('0x22'),_0x3c3803,'request\x20sent');logger['debug'](_0xd076('0x23'),_0x3c3803,'request\x20sent',JSON['stringify'](_0x2b0ea7));if(_0x2b0ea7[_0xd076('0x24')]){if(_0x2b0ea7['error']['code']===0x1f4){logger[_0xd076('0x24')](_0xd076('0x22'),_0x3c3803,_0x2b0ea7['error']['message']);return _0x32f5af(_0x2b0ea7[_0xd076('0x24')][_0xd076('0x25')]);}logger['error']('DeskAccount,\x20%s,\x20%s',_0x3c3803,_0x2b0ea7[_0xd076('0x24')]['message']);return _0x2778ff(_0x2b0ea7[_0xd076('0x24')][_0xd076('0x25')]);}else{logger[_0xd076('0x26')](_0xd076('0x22'),_0x3c3803,_0xd076('0x27'));_0x2778ff(_0x2b0ea7['result'][_0xd076('0x25')]);}})['catch'](function(_0xd4f713){logger[_0xd076('0x24')](_0xd076('0x22'),_0x3c3803,_0xd4f713);_0x32f5af(_0xd4f713);});});}function respondWithStatusCode(_0xd1ca,_0x265e70){_0x265e70=_0x265e70||0xcc;return function(_0x4d8ba0){if(_0x4d8ba0){return _0xd1ca[_0xd076('0x28')](_0x265e70);}return _0xd1ca['status'](_0x265e70)['end']();};}function respondWithResult(_0x2f332e,_0x51987d){_0x51987d=_0x51987d||0xc8;return function(_0x57b664){if(_0x57b664){return _0x2f332e[_0xd076('0x29')](_0x51987d)[_0xd076('0x2a')](_0x57b664);}};}function respondWithFilteredResult(_0x3250ee,_0x511b25){return function(_0x5e3e10){if(_0x5e3e10){var _0x337cd3=_0x5e3e10[_0xd076('0x2b')],_0x4da832=_0x511b25['offset'],_0x41d86e=_0x511b25[_0xd076('0x2c')]+_0x511b25[_0xd076('0x2d')],_0x141496;if(_0x41d86e>=_0x337cd3){_0x41d86e=_0x337cd3;_0x141496=0xc8;}else{_0x141496=0xce;}_0x3250ee[_0xd076('0x29')](_0x141496);return _0x3250ee[_0xd076('0x2e')](_0xd076('0x2f'),_0x4da832+'-'+_0x41d86e+'/'+_0x337cd3)['json'](_0x5e3e10);}return null;};}function patchUpdates(_0x424615){return function(_0xf5c150){try{jsonpatch[_0xd076('0x30')](_0xf5c150,_0x424615,!![]);}catch(_0x242ffd){return BPromise['reject'](_0x242ffd);}return _0xf5c150[_0xd076('0x31')]();};}function saveUpdates(_0x163a2b,_0x1f9b60){return function(_0x52d475){if(_0x52d475){return _0x52d475[_0xd076('0x32')](_0x163a2b)[_0xd076('0x21')](function(_0xaa2370){return _0xaa2370;});}return null;};}function removeEntity(_0xa6a3c5,_0x177a09){return function(_0x270844){if(_0x270844){return _0x270844[_0xd076('0x33')]()[_0xd076('0x21')](function(){_0xa6a3c5[_0xd076('0x29')](0xcc)['end']();});}};}function handleEntityNotFound(_0x363df6,_0x474a9e){return function(_0x1c4d2a){if(!_0x1c4d2a){_0x363df6[_0xd076('0x28')](0x194);}return _0x1c4d2a;};}function handleError(_0x517e84,_0x338942){_0x338942=_0x338942||0x1f4;return function(_0x522fae){logger[_0xd076('0x24')](_0x522fae['stack']);if(_0x522fae[_0xd076('0x34')]){delete _0x522fae[_0xd076('0x34')];}_0x517e84[_0xd076('0x29')](_0x338942)[_0xd076('0x35')](_0x522fae);};}exports[_0xd076('0x36')]=function(_0x5f4116,_0x143887){var _0x1ffdde={},_0x3ad74a={},_0x34bac4={'count':0x0,'rows':[]};var _0x435c38=db['DeskAccount'][_0xd076('0x37')];_0x3ad74a[_0xd076('0x38')]=_['keys'](_0x435c38);_0x3ad74a['query']=_[_0xd076('0x39')](_0x5f4116[_0xd076('0x3a')]);_0x3ad74a[_0xd076('0x3b')]=_[_0xd076('0x3c')](_0x3ad74a[_0xd076('0x38')],_0x3ad74a[_0xd076('0x3a')]);_0x1ffdde[_0xd076('0x3d')]=_[_0xd076('0x3c')](_0x3ad74a[_0xd076('0x38')],qs[_0xd076('0x3e')](_0x5f4116[_0xd076('0x3a')]['fields']));_0x1ffdde[_0xd076('0x3d')]=_0x1ffdde[_0xd076('0x3d')][_0xd076('0x3f')]?_0x1ffdde[_0xd076('0x3d')]:_0x3ad74a[_0xd076('0x38')];if(!_0x5f4116['query'][_0xd076('0x40')](_0xd076('0x41'))){_0x1ffdde[_0xd076('0x2d')]=qs[_0xd076('0x2d')](_0x5f4116['query'][_0xd076('0x2d')]);_0x1ffdde[_0xd076('0x2c')]=qs[_0xd076('0x2c')](_0x5f4116[_0xd076('0x3a')][_0xd076('0x2c')]);}_0x1ffdde['order']=qs['sort'](_0x5f4116[_0xd076('0x3a')]['sort']);_0x1ffdde['where']=qs[_0xd076('0x3b')](_[_0xd076('0x42')](_0x5f4116[_0xd076('0x3a')],_0x3ad74a['filters']));if(_0x5f4116['query']['filter']){_0x1ffdde[_0xd076('0x43')]=_[_0xd076('0x44')](_0x1ffdde[_0xd076('0x43')],{'$or':_['map'](_0x435c38,function(_0x5a4157){if(_0x5a4157[_0xd076('0x45')][_0xd076('0x46')]!==_0xd076('0x47')){var _0x5c777f={};_0x5c777f[_0x5a4157[_0xd076('0x48')]]={'$like':'%'+_0x5f4116[_0xd076('0x3a')][_0xd076('0x49')]+'%'};return _0x5c777f;}})});}_0x1ffdde=_[_0xd076('0x44')]({},_0x1ffdde,_0x5f4116[_0xd076('0x4a')]);var _0x5b4fec={'where':_0x1ffdde[_0xd076('0x43')]};return db[_0xd076('0x4b')][_0xd076('0x2b')](_0x5b4fec)[_0xd076('0x21')](function(_0x17aaca){_0x34bac4[_0xd076('0x2b')]=_0x17aaca;if(_0x5f4116[_0xd076('0x3a')][_0xd076('0x4c')]){_0x1ffdde['include']=[{'all':!![]}];}return db[_0xd076('0x4b')][_0xd076('0x4d')](_0x1ffdde);})[_0xd076('0x21')](function(_0x280df2){_0x34bac4[_0xd076('0x4e')]=_0x280df2;return _0x34bac4;})[_0xd076('0x21')](respondWithFilteredResult(_0x143887,_0x1ffdde))['catch'](handleError(_0x143887,null));};exports[_0xd076('0x4f')]=function(_0x54ed80,_0x4bbe87){var _0x2d2527={'raw':![],'where':{'id':_0x54ed80['params']['id']}},_0x207314={};_0x207314[_0xd076('0x38')]=_[_0xd076('0x39')](db[_0xd076('0x4b')][_0xd076('0x37')]);_0x207314['query']=_['keys'](_0x54ed80[_0xd076('0x3a')]);_0x207314[_0xd076('0x3b')]=_[_0xd076('0x3c')](_0x207314[_0xd076('0x38')],_0x207314[_0xd076('0x3a')]);_0x2d2527[_0xd076('0x3d')]=_[_0xd076('0x3c')](_0x207314[_0xd076('0x38')],qs['fields'](_0x54ed80[_0xd076('0x3a')][_0xd076('0x3e')]));_0x2d2527[_0xd076('0x3d')]=_0x2d2527[_0xd076('0x3d')][_0xd076('0x3f')]?_0x2d2527[_0xd076('0x3d')]:_0x207314[_0xd076('0x38')];if(_0x54ed80[_0xd076('0x3a')][_0xd076('0x4c')]){_0x2d2527[_0xd076('0x50')]=[{'all':!![]}];}_0x2d2527=_[_0xd076('0x44')]({},_0x2d2527,_0x54ed80[_0xd076('0x4a')]);return db['DeskAccount']['find'](_0x2d2527)[_0xd076('0x21')](handleEntityNotFound(_0x4bbe87,null))['then'](respondWithResult(_0x4bbe87,null))[_0xd076('0x51')](handleError(_0x4bbe87,null));};exports[_0xd076('0x52')]=function(_0x4ef862,_0xbfdb2b){return db['DeskAccount'][_0xd076('0x52')](_0x4ef862[_0xd076('0x53')],{})['then'](respondWithResult(_0xbfdb2b,0xc9))[_0xd076('0x51')](handleError(_0xbfdb2b,null));};exports['update']=function(_0x33ec82,_0x228c63){if(_0x33ec82['body']['id']){delete _0x33ec82[_0xd076('0x53')]['id'];}return db[_0xd076('0x4b')]['find']({'where':{'id':_0x33ec82['params']['id']}})[_0xd076('0x21')](handleEntityNotFound(_0x228c63,null))[_0xd076('0x21')](saveUpdates(_0x33ec82[_0xd076('0x53')],null))[_0xd076('0x21')](respondWithResult(_0x228c63,null))[_0xd076('0x51')](handleError(_0x228c63,null));};exports[_0xd076('0x33')]=function(_0x8dc066,_0x546685){return db['DeskAccount'][_0xd076('0x54')]({'where':{'id':_0x8dc066[_0xd076('0x55')]['id']}})[_0xd076('0x21')](handleEntityNotFound(_0x546685,null))[_0xd076('0x21')](removeEntity(_0x546685,null))[_0xd076('0x51')](handleError(_0x546685,null));};exports[_0xd076('0x56')]=function(_0x1a5fe7,_0x168514,_0x57a770){var _0xaf0b79={};var _0x1b0faf={};var _0x3c9eff;var _0x2d627c;return db[_0xd076('0x4b')][_0xd076('0x57')]({'where':{'id':_0x1a5fe7['params']['id']}})[_0xd076('0x21')](handleEntityNotFound(_0x168514,null))['then'](function(_0x822e17){if(_0x822e17){_0x3c9eff=_0x822e17;_0x1b0faf['model']=_[_0xd076('0x39')](db[_0xd076('0x58')]['rawAttributes']);_0x1b0faf[_0xd076('0x3a')]=_[_0xd076('0x39')](_0x1a5fe7[_0xd076('0x3a')]);_0x1b0faf[_0xd076('0x3b')]=_['intersection'](_0x1b0faf[_0xd076('0x38')],_0x1b0faf[_0xd076('0x3a')]);_0xaf0b79[_0xd076('0x3d')]=_['intersection'](_0x1b0faf[_0xd076('0x38')],qs['fields'](_0x1a5fe7['query'][_0xd076('0x3e')]));_0xaf0b79[_0xd076('0x3d')]=_0xaf0b79[_0xd076('0x3d')][_0xd076('0x3f')]?_0xaf0b79[_0xd076('0x3d')]:_0x1b0faf['model'];_0xaf0b79[_0xd076('0x59')]=qs[_0xd076('0x5a')](_0x1a5fe7[_0xd076('0x3a')]['sort']);_0xaf0b79[_0xd076('0x43')]=qs[_0xd076('0x3b')](_['pick'](_0x1a5fe7['query'],_0x1b0faf[_0xd076('0x3b')]));if(_0x1a5fe7['query'][_0xd076('0x49')]){_0xaf0b79['where']=_['merge'](_0xaf0b79['where'],{'$or':_['map'](_0xaf0b79[_0xd076('0x3d')],function(_0x3a321a){var _0x2605be={};_0x2605be[_0x3a321a]={'$like':'%'+_0x1a5fe7[_0xd076('0x3a')][_0xd076('0x49')]+'%'};return _0x2605be;})});}_0xaf0b79=_[_0xd076('0x44')]({},_0xaf0b79,_0x1a5fe7[_0xd076('0x4a')]);return _0x3c9eff[_0xd076('0x56')](_0xaf0b79);}})[_0xd076('0x21')](function(_0x72d7c7){if(_0x72d7c7){_0x2d627c=_0x72d7c7[_0xd076('0x3f')];if(!_0x1a5fe7[_0xd076('0x3a')][_0xd076('0x40')]('nolimit')){_0xaf0b79[_0xd076('0x2d')]=qs[_0xd076('0x2d')](_0x1a5fe7['query'][_0xd076('0x2d')]);_0xaf0b79[_0xd076('0x2c')]=qs[_0xd076('0x2c')](_0x1a5fe7[_0xd076('0x3a')][_0xd076('0x2c')]);}return _0x3c9eff[_0xd076('0x56')](_0xaf0b79);}})[_0xd076('0x21')](function(_0x42cd5e){if(_0x42cd5e){return _0x42cd5e?{'count':_0x2d627c,'rows':_0x42cd5e}:null;}})[_0xd076('0x21')](respondWithResult(_0x168514,null))[_0xd076('0x51')](handleError(_0x168514,null));};exports[_0xd076('0x5b')]=function(_0x456031,_0x27a2fc,_0x1e608a){if(_0x456031[_0xd076('0x53')]['id']){delete _0x456031[_0xd076('0x53')]['id'];}return db[_0xd076('0x4b')][_0xd076('0x57')]({'where':{'id':_0x456031[_0xd076('0x55')]['id']}})['then'](handleEntityNotFound(_0x27a2fc,null))[_0xd076('0x21')](function(_0x505089){if(_0x505089){_0x456031[_0xd076('0x53')][_0xd076('0x5c')]=_0x505089['id'];_0x456031[_0xd076('0x53')]['Subjects']=integrations[_0xd076('0x5d')](_0x456031[_0xd076('0x53')][_0xd076('0x5e')],_0x456031[_0xd076('0x53')]['type']);_0x456031[_0xd076('0x53')][_0xd076('0x5f')]=integrations[_0xd076('0x60')](_0x456031[_0xd076('0x53')]['channel'],_0x456031['body'][_0xd076('0x45')]);return db[_0xd076('0x58')][_0xd076('0x52')](_0x456031[_0xd076('0x53')],{'include':[{'model':db[_0xd076('0x61')],'as':'Subjects'},{'model':db[_0xd076('0x61')],'as':'Descriptions'}]});}return null;})[_0xd076('0x21')](respondWithResult(_0x27a2fc,null))[_0xd076('0x51')](handleError(_0x27a2fc,null));};exports[_0xd076('0x62')]=function(_0x3d468d,_0x1eab86,_0x3cb8da){var _0x1e025f=[{'name':_0xd076('0x63'),'label':_0xd076('0x63'),'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 _0x516c0a='';return db[_0xd076('0x4b')]['findOne']({'where':{'id':_0x3d468d[_0xd076('0x55')]['id']},'attributes':['id','remoteUri',_0xd076('0x64'),_0xd076('0x65'),_0xd076('0x66'),_0xd076('0x67'),_0xd076('0x68'),_0xd076('0x69'),_0xd076('0x6a')]})[_0xd076('0x21')](handleEntityNotFound(_0x1eab86,null))[_0xd076('0x21')](function(_0xdd887c){if(_0xdd887c){_0x516c0a=_0xdd887c[_0xd076('0x6b')];var _0x59c5c0=_0x516c0a[_0xd076('0x6c')](-0x1);if(_0x59c5c0==='/'){_0x516c0a=_0x516c0a[_0xd076('0x6d')](0x0,_0x516c0a[_0xd076('0x6e')](_0x59c5c0));}var _0x378b7c={'method':_0xd076('0x6f'),'uri':util[_0xd076('0x70')](_0xd076('0x71'),_0x516c0a),'headers':{'Content-Type':'application/json','Accept':_0xd076('0x72')},'json':!![]};if(_0xdd887c[_0xd076('0x64')]===_0xd076('0x73')){_0x378b7c[_0xd076('0x74')][_0xd076('0x75')]=util[_0xd076('0x70')](_0xd076('0x76'),new Buffer(util[_0xd076('0x70')](_0xd076('0x77'),_0xdd887c[_0xd076('0x65')],_0xdd887c[_0xd076('0x66')]))['toString'](_0xd076('0x78')));}return rp(_0x378b7c)[_0xd076('0x21')](function(_0xecbc6){return _0x1e025f['concat'](_[_0xd076('0x79')](_0xecbc6[_0xd076('0x7a')][_0xd076('0x7b')],function(_0x33a1a5){return{'id':_0x33a1a5[_0xd076('0x34')],'name':_0x33a1a5[_0xd076('0x34')],'type':_0x33a1a5[_0xd076('0x45')],'active':_0x33a1a5[_0xd076('0x7c')],'label':_0x33a1a5[_0xd076('0x7d')],'custom':!![]};}));});}})[_0xd076('0x21')](function(_0x5d3dbb){return{'count':_0x5d3dbb['length'],'rows':_0x5d3dbb};})[_0xd076('0x21')](respondWithResult(_0x1eab86,null))['catch'](function(_0x25c1a5){var _0x206dec=_0x3d468d[_0xd076('0x3a')]['test']?0x1f4:_0x25c1a5[_0xd076('0x7e')]||0x1f4;logger[_0xd076('0x24')](_0xd076('0x7f'),'getFields',_0x206dec,JSON[_0xd076('0x80')](_0x25c1a5));delete _0x25c1a5[_0xd076('0x34')];if(_0x206dec===0x191){_0x206dec=0x190;}_0x1eab86[_0xd076('0x29')](_0x206dec)[_0xd076('0x35')](_0x3d468d[_0xd076('0x3a')][_0xd076('0x1e')]?{'message':_0xd076('0x81'),'statusCode':_0x25c1a5[_0xd076('0x7e')]}:_0x25c1a5);});}; \ No newline at end of file +var _0xf780=['debug','stringify','error','code','message','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','name','send','index','DeskAccount','model','query','filters','intersection','fields','length','attributes','hasOwnProperty','nolimit','order','sort','where','pick','merge','map','type','VIRTUAL','field','filter','count','rows','catch','params','keys','rawAttributes','include','options','find','create','body','getConfigurations','findOne','DeskConfiguration','addConfiguration','Subjects','getSubjects','channel','Descriptions','getDescriptions','DeskField','getFields','priority','remoteUri','authType','consumerSecret','token','tokenSecret','slice','substring','lastIndexOf','GET','format','%s/custom_fields','application/json','basic','headers','Authorization','Basic\x20%s','username','password','base64','concat','_embedded','label','test','statusCode','Wrong\x20credentials','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','jayson/promise','client','http','request','info','DeskAccount,\x20%s,\x20%s','request\x20sent'];(function(_0x2e33e7,_0xf4da65){var _0x53b459=function(_0x18ad58){while(--_0x18ad58){_0x2e33e7['push'](_0x2e33e7['shift']());}};_0x53b459(++_0xf4da65);}(_0xf780,0xd3));var _0x0f78=function(_0x3d0eec,_0x481f20){_0x3d0eec=_0x3d0eec-0x0;var _0x3acfed=_0xf780[_0x3d0eec];return _0x3acfed;};'use strict';var pdf=require(_0x0f78('0x0'));var emlformat=require(_0x0f78('0x1'));var rimraf=require(_0x0f78('0x2'));var zipdir=require(_0x0f78('0x3'));var jsonpatch=require(_0x0f78('0x4'));var rp=require(_0x0f78('0x5'));var moment=require(_0x0f78('0x6'));var BPromise=require(_0x0f78('0x7'));var Mustache=require('mustache');var util=require(_0x0f78('0x8'));var path=require(_0x0f78('0x9'));var sox=require('sox');var csv=require(_0x0f78('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x0f78('0xb'));var squel=require(_0x0f78('0xc'));var crypto=require(_0x0f78('0xd'));var jsforce=require(_0x0f78('0xe'));var deskjs=require(_0x0f78('0xf'));var toCsv=require(_0x0f78('0xa'));var querystring=require(_0x0f78('0x10'));var Papa=require(_0x0f78('0x11'));var Redis=require(_0x0f78('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x0f78('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0f78('0x14'))(_0x0f78('0x15'));var utils=require('../../config/utils');var config=require(_0x0f78('0x16'));var db=require(_0x0f78('0x17'))['db'];var integrations=require('../../components/integrations/configuration');var jayson=require(_0x0f78('0x18'));var client=jayson[_0x0f78('0x19')][_0x0f78('0x1a')]({'port':0x232a});function checkPasswordPattern(_0x399899,_0x482497,_0x1b0c0e){if(_0x1b0c0e){var _0x4a90ff=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4a90ff['test'](_0x482497)){return _0x399899;}else{throw new Error('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x399899;}}function respondWithRpcPromise(_0x519d2c,_0x556960,_0xfb422e,_0x1d15ef){return new BPromise(function(_0x13aed3,_0x39a834){var _0x46ea4e=_0x1d15ef||client;return _0x46ea4e[_0x0f78('0x1b')](_0x519d2c,_0xfb422e)['then'](function(_0x11dd5a){logger[_0x0f78('0x1c')](_0x0f78('0x1d'),_0x556960,_0x0f78('0x1e'));logger[_0x0f78('0x1f')]('DeskAccount,\x20%s,\x20%s,\x20%s',_0x556960,_0x0f78('0x1e'),JSON[_0x0f78('0x20')](_0x11dd5a));if(_0x11dd5a[_0x0f78('0x21')]){if(_0x11dd5a[_0x0f78('0x21')][_0x0f78('0x22')]===0x1f4){logger['error'](_0x0f78('0x1d'),_0x556960,_0x11dd5a[_0x0f78('0x21')]['message']);return _0x39a834(_0x11dd5a[_0x0f78('0x21')][_0x0f78('0x23')]);}logger[_0x0f78('0x21')](_0x0f78('0x1d'),_0x556960,_0x11dd5a[_0x0f78('0x21')][_0x0f78('0x23')]);return _0x13aed3(_0x11dd5a[_0x0f78('0x21')][_0x0f78('0x23')]);}else{logger[_0x0f78('0x1c')]('DeskAccount,\x20%s,\x20%s',_0x556960,_0x0f78('0x1e'));_0x13aed3(_0x11dd5a['result']['message']);}})['catch'](function(_0x353c10){logger['error'](_0x0f78('0x1d'),_0x556960,_0x353c10);_0x39a834(_0x353c10);});});}function respondWithStatusCode(_0x5cf785,_0x1eb02c){_0x1eb02c=_0x1eb02c||0xcc;return function(_0x3658d1){if(_0x3658d1){return _0x5cf785[_0x0f78('0x24')](_0x1eb02c);}return _0x5cf785[_0x0f78('0x25')](_0x1eb02c)[_0x0f78('0x26')]();};}function respondWithResult(_0x492216,_0x4c4c16){_0x4c4c16=_0x4c4c16||0xc8;return function(_0x3d27aa){if(_0x3d27aa){return _0x492216['status'](_0x4c4c16)[_0x0f78('0x27')](_0x3d27aa);}};}function respondWithFilteredResult(_0x56d09b,_0x2200fd){return function(_0x2cb2d1){if(_0x2cb2d1){var _0x39deaa=_0x2cb2d1['count'],_0x43cd4b=_0x2200fd[_0x0f78('0x28')],_0x50b8ae=_0x2200fd[_0x0f78('0x28')]+_0x2200fd[_0x0f78('0x29')],_0x4ace85;if(_0x50b8ae>=_0x39deaa){_0x50b8ae=_0x39deaa;_0x4ace85=0xc8;}else{_0x4ace85=0xce;}_0x56d09b['status'](_0x4ace85);return _0x56d09b[_0x0f78('0x2a')](_0x0f78('0x2b'),_0x43cd4b+'-'+_0x50b8ae+'/'+_0x39deaa)[_0x0f78('0x27')](_0x2cb2d1);}return null;};}function patchUpdates(_0xd11365){return function(_0x52dba3){try{jsonpatch[_0x0f78('0x2c')](_0x52dba3,_0xd11365,!![]);}catch(_0x472d25){return BPromise[_0x0f78('0x2d')](_0x472d25);}return _0x52dba3[_0x0f78('0x2e')]();};}function saveUpdates(_0x45cbb0,_0x2dd29c){return function(_0x3954eb){if(_0x3954eb){return _0x3954eb[_0x0f78('0x2f')](_0x45cbb0)[_0x0f78('0x30')](function(_0x405cbf){return _0x405cbf;});}return null;};}function removeEntity(_0x48d34c,_0x186e3b){return function(_0x51a94d){if(_0x51a94d){return _0x51a94d[_0x0f78('0x31')]()[_0x0f78('0x30')](function(){_0x48d34c[_0x0f78('0x25')](0xcc)[_0x0f78('0x26')]();});}};}function handleEntityNotFound(_0x4e0cd6,_0x395bec){return function(_0x51b620){if(!_0x51b620){_0x4e0cd6['sendStatus'](0x194);}return _0x51b620;};}function handleError(_0x1be771,_0x42c912){_0x42c912=_0x42c912||0x1f4;return function(_0x1a7958){logger[_0x0f78('0x21')](_0x1a7958['stack']);if(_0x1a7958[_0x0f78('0x32')]){delete _0x1a7958[_0x0f78('0x32')];}_0x1be771[_0x0f78('0x25')](_0x42c912)[_0x0f78('0x33')](_0x1a7958);};}exports[_0x0f78('0x34')]=function(_0x1ed914,_0x1d7137){var _0x53d547={},_0x530248={},_0x5d7c84={'count':0x0,'rows':[]};var _0x44d271=db[_0x0f78('0x35')]['rawAttributes'];_0x530248[_0x0f78('0x36')]=_['keys'](_0x44d271);_0x530248['query']=_['keys'](_0x1ed914[_0x0f78('0x37')]);_0x530248[_0x0f78('0x38')]=_[_0x0f78('0x39')](_0x530248[_0x0f78('0x36')],_0x530248['query']);_0x53d547['attributes']=_[_0x0f78('0x39')](_0x530248[_0x0f78('0x36')],qs[_0x0f78('0x3a')](_0x1ed914['query'][_0x0f78('0x3a')]));_0x53d547['attributes']=_0x53d547['attributes'][_0x0f78('0x3b')]?_0x53d547[_0x0f78('0x3c')]:_0x530248[_0x0f78('0x36')];if(!_0x1ed914[_0x0f78('0x37')][_0x0f78('0x3d')](_0x0f78('0x3e'))){_0x53d547[_0x0f78('0x29')]=qs[_0x0f78('0x29')](_0x1ed914[_0x0f78('0x37')][_0x0f78('0x29')]);_0x53d547['offset']=qs['offset'](_0x1ed914[_0x0f78('0x37')][_0x0f78('0x28')]);}_0x53d547[_0x0f78('0x3f')]=qs[_0x0f78('0x40')](_0x1ed914[_0x0f78('0x37')][_0x0f78('0x40')]);_0x53d547[_0x0f78('0x41')]=qs[_0x0f78('0x38')](_[_0x0f78('0x42')](_0x1ed914[_0x0f78('0x37')],_0x530248[_0x0f78('0x38')]));if(_0x1ed914[_0x0f78('0x37')]['filter']){_0x53d547['where']=_[_0x0f78('0x43')](_0x53d547['where'],{'$or':_[_0x0f78('0x44')](_0x44d271,function(_0x1adbf3){if(_0x1adbf3[_0x0f78('0x45')]['key']!==_0x0f78('0x46')){var _0x4073d9={};_0x4073d9[_0x1adbf3[_0x0f78('0x47')]]={'$like':'%'+_0x1ed914['query'][_0x0f78('0x48')]+'%'};return _0x4073d9;}})});}_0x53d547=_[_0x0f78('0x43')]({},_0x53d547,_0x1ed914['options']);var _0x3b404a={'where':_0x53d547[_0x0f78('0x41')]};return db[_0x0f78('0x35')][_0x0f78('0x49')](_0x3b404a)['then'](function(_0x11e111){_0x5d7c84[_0x0f78('0x49')]=_0x11e111;if(_0x1ed914['query']['includeAll']){_0x53d547['include']=[{'all':!![]}];}return db[_0x0f78('0x35')]['findAll'](_0x53d547);})[_0x0f78('0x30')](function(_0x381848){_0x5d7c84[_0x0f78('0x4a')]=_0x381848;return _0x5d7c84;})[_0x0f78('0x30')](respondWithFilteredResult(_0x1d7137,_0x53d547))[_0x0f78('0x4b')](handleError(_0x1d7137,null));};exports['show']=function(_0x302123,_0xde8bc3){var _0x345178={'raw':![],'where':{'id':_0x302123[_0x0f78('0x4c')]['id']}},_0x67a944={};_0x67a944[_0x0f78('0x36')]=_[_0x0f78('0x4d')](db[_0x0f78('0x35')][_0x0f78('0x4e')]);_0x67a944[_0x0f78('0x37')]=_[_0x0f78('0x4d')](_0x302123[_0x0f78('0x37')]);_0x67a944['filters']=_[_0x0f78('0x39')](_0x67a944['model'],_0x67a944[_0x0f78('0x37')]);_0x345178[_0x0f78('0x3c')]=_[_0x0f78('0x39')](_0x67a944[_0x0f78('0x36')],qs[_0x0f78('0x3a')](_0x302123[_0x0f78('0x37')][_0x0f78('0x3a')]));_0x345178[_0x0f78('0x3c')]=_0x345178[_0x0f78('0x3c')]['length']?_0x345178[_0x0f78('0x3c')]:_0x67a944[_0x0f78('0x36')];if(_0x302123[_0x0f78('0x37')]['includeAll']){_0x345178[_0x0f78('0x4f')]=[{'all':!![]}];}_0x345178=_[_0x0f78('0x43')]({},_0x345178,_0x302123[_0x0f78('0x50')]);return db[_0x0f78('0x35')][_0x0f78('0x51')](_0x345178)[_0x0f78('0x30')](handleEntityNotFound(_0xde8bc3,null))['then'](respondWithResult(_0xde8bc3,null))['catch'](handleError(_0xde8bc3,null));};exports[_0x0f78('0x52')]=function(_0x29c780,_0xb8d421){return db[_0x0f78('0x35')][_0x0f78('0x52')](_0x29c780[_0x0f78('0x53')],{})['then'](respondWithResult(_0xb8d421,0xc9))['catch'](handleError(_0xb8d421,null));};exports[_0x0f78('0x2f')]=function(_0x4b8f2c,_0x78f3ea){if(_0x4b8f2c[_0x0f78('0x53')]['id']){delete _0x4b8f2c['body']['id'];}return db[_0x0f78('0x35')][_0x0f78('0x51')]({'where':{'id':_0x4b8f2c[_0x0f78('0x4c')]['id']}})['then'](handleEntityNotFound(_0x78f3ea,null))[_0x0f78('0x30')](saveUpdates(_0x4b8f2c[_0x0f78('0x53')],null))['then'](respondWithResult(_0x78f3ea,null))['catch'](handleError(_0x78f3ea,null));};exports['destroy']=function(_0x2cf31b,_0x43e5dd){return db[_0x0f78('0x35')][_0x0f78('0x51')]({'where':{'id':_0x2cf31b['params']['id']}})['then'](handleEntityNotFound(_0x43e5dd,null))[_0x0f78('0x30')](removeEntity(_0x43e5dd,null))['catch'](handleError(_0x43e5dd,null));};exports[_0x0f78('0x54')]=function(_0x3c8dff,_0x2667b3,_0x1c85c4){var _0x16fc5f={};var _0x1efe7e={};var _0x5e4663;var _0x2c46c5;return db[_0x0f78('0x35')][_0x0f78('0x55')]({'where':{'id':_0x3c8dff[_0x0f78('0x4c')]['id']}})[_0x0f78('0x30')](handleEntityNotFound(_0x2667b3,null))['then'](function(_0x261bb0){if(_0x261bb0){_0x5e4663=_0x261bb0;_0x1efe7e[_0x0f78('0x36')]=_['keys'](db[_0x0f78('0x56')][_0x0f78('0x4e')]);_0x1efe7e['query']=_[_0x0f78('0x4d')](_0x3c8dff[_0x0f78('0x37')]);_0x1efe7e[_0x0f78('0x38')]=_[_0x0f78('0x39')](_0x1efe7e['model'],_0x1efe7e['query']);_0x16fc5f['attributes']=_[_0x0f78('0x39')](_0x1efe7e[_0x0f78('0x36')],qs['fields'](_0x3c8dff[_0x0f78('0x37')]['fields']));_0x16fc5f[_0x0f78('0x3c')]=_0x16fc5f[_0x0f78('0x3c')][_0x0f78('0x3b')]?_0x16fc5f[_0x0f78('0x3c')]:_0x1efe7e[_0x0f78('0x36')];_0x16fc5f[_0x0f78('0x3f')]=qs['sort'](_0x3c8dff[_0x0f78('0x37')]['sort']);_0x16fc5f[_0x0f78('0x41')]=qs[_0x0f78('0x38')](_[_0x0f78('0x42')](_0x3c8dff[_0x0f78('0x37')],_0x1efe7e[_0x0f78('0x38')]));if(_0x3c8dff[_0x0f78('0x37')][_0x0f78('0x48')]){_0x16fc5f[_0x0f78('0x41')]=_[_0x0f78('0x43')](_0x16fc5f[_0x0f78('0x41')],{'$or':_[_0x0f78('0x44')](_0x16fc5f[_0x0f78('0x3c')],function(_0x18cb80){var _0x37aef5={};_0x37aef5[_0x18cb80]={'$like':'%'+_0x3c8dff[_0x0f78('0x37')]['filter']+'%'};return _0x37aef5;})});}_0x16fc5f=_['merge']({},_0x16fc5f,_0x3c8dff[_0x0f78('0x50')]);return _0x5e4663[_0x0f78('0x54')](_0x16fc5f);}})['then'](function(_0x25b451){if(_0x25b451){_0x2c46c5=_0x25b451[_0x0f78('0x3b')];if(!_0x3c8dff[_0x0f78('0x37')][_0x0f78('0x3d')](_0x0f78('0x3e'))){_0x16fc5f['limit']=qs['limit'](_0x3c8dff['query'][_0x0f78('0x29')]);_0x16fc5f['offset']=qs[_0x0f78('0x28')](_0x3c8dff['query'][_0x0f78('0x28')]);}return _0x5e4663['getConfigurations'](_0x16fc5f);}})[_0x0f78('0x30')](function(_0x24cc96){if(_0x24cc96){return _0x24cc96?{'count':_0x2c46c5,'rows':_0x24cc96}:null;}})[_0x0f78('0x30')](respondWithResult(_0x2667b3,null))[_0x0f78('0x4b')](handleError(_0x2667b3,null));};exports[_0x0f78('0x57')]=function(_0x4f7e4a,_0x36df3d,_0x58e154){if(_0x4f7e4a['body']['id']){delete _0x4f7e4a[_0x0f78('0x53')]['id'];}return db['DeskAccount'][_0x0f78('0x55')]({'where':{'id':_0x4f7e4a[_0x0f78('0x4c')]['id']}})['then'](handleEntityNotFound(_0x36df3d,null))['then'](function(_0x3a6355){if(_0x3a6355){_0x4f7e4a[_0x0f78('0x53')]['AccountId']=_0x3a6355['id'];_0x4f7e4a[_0x0f78('0x53')][_0x0f78('0x58')]=integrations[_0x0f78('0x59')](_0x4f7e4a[_0x0f78('0x53')][_0x0f78('0x5a')],_0x4f7e4a[_0x0f78('0x53')]['type']);_0x4f7e4a[_0x0f78('0x53')][_0x0f78('0x5b')]=integrations[_0x0f78('0x5c')](_0x4f7e4a['body'][_0x0f78('0x5a')],_0x4f7e4a[_0x0f78('0x53')][_0x0f78('0x45')]);return db[_0x0f78('0x56')][_0x0f78('0x52')](_0x4f7e4a[_0x0f78('0x53')],{'include':[{'model':db['DeskField'],'as':_0x0f78('0x58')},{'model':db[_0x0f78('0x5d')],'as':_0x0f78('0x5b')}]});}return null;})[_0x0f78('0x30')](respondWithResult(_0x36df3d,null))[_0x0f78('0x4b')](handleError(_0x36df3d,null));};exports[_0x0f78('0x5e')]=function(_0x3d1162,_0x5cbe1f,_0x39ff6d){var _0x35bce7=[{'name':'priority','label':_0x0f78('0x5f'),'custom':![],'options':[{'name':0x1,'value':0x1},{'name':0x2,'value':0x2},{'name':0x3,'value':0x3},{'name':0x4,'value':0x4},{'name':0x5,'value':0x5},{'name':0x6,'value':0x6},{'name':0x7,'value':0x7},{'name':0x8,'value':0x8},{'name':0x9,'value':0x9},{'name':0xa,'value':0xa}]}];var _0x25bb26='';return db[_0x0f78('0x35')]['findOne']({'where':{'id':_0x3d1162[_0x0f78('0x4c')]['id']},'attributes':['id',_0x0f78('0x60'),_0x0f78('0x61'),'username','password','consumerKey',_0x0f78('0x62'),_0x0f78('0x63'),_0x0f78('0x64')]})[_0x0f78('0x30')](handleEntityNotFound(_0x5cbe1f,null))[_0x0f78('0x30')](function(_0x4f2019){if(_0x4f2019){_0x25bb26=_0x4f2019['remoteUri'];var _0x52fc6b=_0x25bb26[_0x0f78('0x65')](-0x1);if(_0x52fc6b==='/'){_0x25bb26=_0x25bb26[_0x0f78('0x66')](0x0,_0x25bb26[_0x0f78('0x67')](_0x52fc6b));}var _0x27faf9={'method':_0x0f78('0x68'),'uri':util[_0x0f78('0x69')](_0x0f78('0x6a'),_0x25bb26),'headers':{'Content-Type':'application/json','Accept':_0x0f78('0x6b')},'json':!![]};if(_0x4f2019[_0x0f78('0x61')]===_0x0f78('0x6c')){_0x27faf9[_0x0f78('0x6d')][_0x0f78('0x6e')]=util[_0x0f78('0x69')](_0x0f78('0x6f'),new Buffer(util['format']('%s:%s',_0x4f2019[_0x0f78('0x70')],_0x4f2019[_0x0f78('0x71')]))['toString'](_0x0f78('0x72')));}return rp(_0x27faf9)[_0x0f78('0x30')](function(_0x2fae3a){return _0x35bce7[_0x0f78('0x73')](_['map'](_0x2fae3a[_0x0f78('0x74')]['entries'],function(_0x5ef5d4){return{'id':_0x5ef5d4[_0x0f78('0x32')],'name':_0x5ef5d4[_0x0f78('0x32')],'type':_0x5ef5d4[_0x0f78('0x45')],'active':_0x5ef5d4['active'],'label':_0x5ef5d4[_0x0f78('0x75')],'custom':!![]};}));});}})[_0x0f78('0x30')](function(_0x245391){return{'count':_0x245391[_0x0f78('0x3b')],'rows':_0x245391};})['then'](respondWithResult(_0x5cbe1f,null))['catch'](function(_0x26f4d5){var _0xaa6a7c=_0x3d1162['query'][_0x0f78('0x76')]?0x1f4:_0x26f4d5[_0x0f78('0x77')]||0x1f4;logger[_0x0f78('0x21')]('getFields,\x20%s,\x20%s,\x20%s',_0x0f78('0x5e'),_0xaa6a7c,JSON[_0x0f78('0x20')](_0x26f4d5));delete _0x26f4d5[_0x0f78('0x32')];if(_0xaa6a7c===0x191){_0xaa6a7c=0x190;}_0x5cbe1f[_0x0f78('0x25')](_0xaa6a7c)['send'](_0x3d1162['query'][_0x0f78('0x76')]?{'message':_0x0f78('0x78'),'statusCode':_0x26f4d5[_0x0f78('0x77')]}:_0x26f4d5);});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.model.js b/server/api/intDeskAccount/intDeskAccount.model.js index 4cec03a..e9fe826 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 _0xe428=['path','rimraf','../../config/environment','../../components/integrations/configuration','exports','define','int_desk_accounts','lodash','util','../../config/logger','api','bluebird'];(function(_0x44bcb0,_0x235aa9){var _0xfaf881=function(_0x25d81d){while(--_0x25d81d){_0x44bcb0['push'](_0x44bcb0['shift']());}};_0xfaf881(++_0x235aa9);}(_0xe428,0x10f));var _0x8e42=function(_0x19ae47,_0x100d87){_0x19ae47=_0x19ae47-0x0;var _0x20c1c2=_0xe428[_0x19ae47];return _0x20c1c2;};'use strict';var _=require(_0x8e42('0x0'));var util=require(_0x8e42('0x1'));var logger=require(_0x8e42('0x2'))(_0x8e42('0x3'));var moment=require('moment');var BPromise=require(_0x8e42('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8e42('0x5'));var rimraf=require(_0x8e42('0x6'));var config=require(_0x8e42('0x7'));var attributes=require('./intDeskAccount.attributes');var integrations=require(_0x8e42('0x8'));module[_0x8e42('0x9')]=function(_0x213fdf,_0x1c1a1b){return _0x213fdf[_0x8e42('0xa')]('DeskAccount',attributes,{'tableName':_0x8e42('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6c2b=['util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./intDeskAccount.attributes','../../components/integrations/configuration','exports','define'];(function(_0x120bc2,_0x57a253){var _0x454a41=function(_0x21adfe){while(--_0x21adfe){_0x120bc2['push'](_0x120bc2['shift']());}};_0x454a41(++_0x57a253);}(_0x6c2b,0xcc));var _0xb6c2=function(_0x33975c,_0x50d085){_0x33975c=_0x33975c-0x0;var _0x1c15ab=_0x6c2b[_0x33975c];return _0x1c15ab;};'use strict';var _=require('lodash');var util=require(_0xb6c2('0x0'));var logger=require(_0xb6c2('0x1'))(_0xb6c2('0x2'));var moment=require(_0xb6c2('0x3'));var BPromise=require(_0xb6c2('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb6c2('0x5'));var rimraf=require(_0xb6c2('0x6'));var config=require(_0xb6c2('0x7'));var attributes=require(_0xb6c2('0x8'));var integrations=require(_0xb6c2('0x9'));module[_0xb6c2('0xa')]=function(_0xfa1cea,_0x25549c){return _0xfa1cea[_0xb6c2('0xb')]('DeskAccount',attributes,{'tableName':'int_desk_accounts','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 2e1b3f4..81d2ab2 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 _0xec1d=['include','map','model','debug','ShowDeskAccount','find','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','http','request','then','request\x20sent','stringify','error','code','DeskAccount,\x20%s,\x20%s','message','info','result','catch','GetDeskAccount','DeskAccount','findAll','options','raw','where','attributes'];(function(_0x7dda42,_0x31357d){var _0x3d413c=function(_0x407267){while(--_0x407267){_0x7dda42['push'](_0x7dda42['shift']());}};_0x3d413c(++_0x31357d);}(_0xec1d,0xab));var _0xdec1=function(_0x29ebdd,_0x1a514a){_0x29ebdd=_0x29ebdd-0x0;var _0x147fa4=_0xec1d[_0x29ebdd];return _0x147fa4;};'use strict';var _=require(_0xdec1('0x0'));var util=require('util');var moment=require(_0xdec1('0x1'));var BPromise=require('bluebird');var rs=require(_0xdec1('0x2'));var fs=require('fs');var Redis=require(_0xdec1('0x3'));var db=require(_0xdec1('0x4'))['db'];var utils=require(_0xdec1('0x5'));var logger=require(_0xdec1('0x6'))(_0xdec1('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xdec1('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5a30ee,_0x4306e1,_0x56a53f){return new BPromise(function(_0x164779,_0x5a6e6b){return client[_0xdec1('0x9')](_0x5a30ee,_0x56a53f)[_0xdec1('0xa')](function(_0x22ae5f){logger['info']('DeskAccount,\x20%s,\x20%s',_0x4306e1,'request\x20sent');logger['debug']('DeskAccount,\x20%s,\x20%s,\x20%s',_0x4306e1,_0xdec1('0xb'),JSON[_0xdec1('0xc')](_0x22ae5f));if(_0x22ae5f[_0xdec1('0xd')]){if(_0x22ae5f[_0xdec1('0xd')][_0xdec1('0xe')]===0x1f4){logger[_0xdec1('0xd')](_0xdec1('0xf'),_0x4306e1,_0x22ae5f[_0xdec1('0xd')][_0xdec1('0x10')]);return _0x5a6e6b(_0x22ae5f[_0xdec1('0xd')][_0xdec1('0x10')]);}logger[_0xdec1('0xd')](_0xdec1('0xf'),_0x4306e1,_0x22ae5f['error'][_0xdec1('0x10')]);return _0x164779(_0x22ae5f[_0xdec1('0xd')][_0xdec1('0x10')]);}else{logger[_0xdec1('0x11')](_0xdec1('0xf'),_0x4306e1,'request\x20sent');_0x164779(_0x22ae5f[_0xdec1('0x12')]['message']);}})[_0xdec1('0x13')](function(_0x31e1cb){logger[_0xdec1('0xd')](_0xdec1('0xf'),_0x4306e1,_0x31e1cb);_0x5a6e6b(_0x31e1cb);});});}exports[_0xdec1('0x14')]=function(_0x487e71){var _0x31d367=this;return new Promise(function(_0xdd6d72,_0x5868ce){return db[_0xdec1('0x15')][_0xdec1('0x16')]({'raw':_0x487e71[_0xdec1('0x17')]?_0x487e71[_0xdec1('0x17')][_0xdec1('0x18')]===undefined?!![]:![]:!![],'where':_0x487e71[_0xdec1('0x17')]?_0x487e71['options'][_0xdec1('0x19')]||null:null,'attributes':_0x487e71['options']?_0x487e71['options'][_0xdec1('0x1a')]||null:null,'limit':_0x487e71[_0xdec1('0x17')]?_0x487e71['options']['limit']||null:null,'include':_0x487e71[_0xdec1('0x17')]?_0x487e71[_0xdec1('0x17')][_0xdec1('0x1b')]?_[_0xdec1('0x1c')](_0x487e71[_0xdec1('0x17')][_0xdec1('0x1b')],function(_0x10f95e){return{'model':db[_0x10f95e[_0xdec1('0x1d')]],'as':_0x10f95e['as'],'attributes':_0x10f95e[_0xdec1('0x1a')],'include':_0x10f95e[_0xdec1('0x1b')]?_[_0xdec1('0x1c')](_0x10f95e['include'],function(_0x5411ef){return{'model':db[_0x5411ef[_0xdec1('0x1d')]],'as':_0x5411ef['as'],'attributes':_0x5411ef[_0xdec1('0x1a')],'include':_0x5411ef[_0xdec1('0x1b')]?_[_0xdec1('0x1c')](_0x5411ef[_0xdec1('0x1b')],function(_0xf9c0ef){return{'model':db[_0xf9c0ef[_0xdec1('0x1d')]],'as':_0xf9c0ef['as'],'attributes':_0xf9c0ef[_0xdec1('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xdec1('0xa')](function(_0x2467e8){logger[_0xdec1('0x11')]('GetDeskAccount',_0x487e71);logger[_0xdec1('0x1e')](_0xdec1('0x14'),_0x487e71,JSON[_0xdec1('0xc')](_0x2467e8));_0xdd6d72(_0x2467e8);})[_0xdec1('0x13')](function(_0x213bcb){logger['error']('GetDeskAccount',_0x213bcb['message'],_0x487e71);_0x5868ce(_0x31d367[_0xdec1('0xd')](0x1f4,_0x213bcb[_0xdec1('0x10')]));});});};exports[_0xdec1('0x1f')]=function(_0x30fecb){var _0x1a7709=this;return new Promise(function(_0x1eba42,_0x3f8dbd){return db[_0xdec1('0x15')][_0xdec1('0x20')]({'raw':_0x30fecb[_0xdec1('0x17')]?_0x30fecb[_0xdec1('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x30fecb['options']?_0x30fecb[_0xdec1('0x17')][_0xdec1('0x19')]||null:null,'attributes':_0x30fecb['options']?_0x30fecb[_0xdec1('0x17')]['attributes']||null:null,'include':_0x30fecb['options']?_0x30fecb[_0xdec1('0x17')][_0xdec1('0x1b')]?_[_0xdec1('0x1c')](_0x30fecb['options'][_0xdec1('0x1b')],function(_0x91b4d5){return{'model':db[_0x91b4d5[_0xdec1('0x1d')]],'as':_0x91b4d5['as'],'attributes':_0x91b4d5[_0xdec1('0x1a')],'include':_0x91b4d5[_0xdec1('0x1b')]?_[_0xdec1('0x1c')](_0x91b4d5['include'],function(_0x393727){return{'model':db[_0x393727[_0xdec1('0x1d')]],'as':_0x393727['as'],'attributes':_0x393727[_0xdec1('0x1a')],'include':_0x393727[_0xdec1('0x1b')]?_[_0xdec1('0x1c')](_0x393727[_0xdec1('0x1b')],function(_0x251413){return{'model':db[_0x251413[_0xdec1('0x1d')]],'as':_0x251413['as'],'attributes':_0x251413[_0xdec1('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xdec1('0xa')](function(_0x1c5b73){logger[_0xdec1('0x11')]('ShowDeskAccount',_0x30fecb);logger[_0xdec1('0x1e')](_0xdec1('0x1f'),_0x30fecb,JSON[_0xdec1('0xc')](_0x1c5b73));_0x1eba42(_0x1c5b73);})[_0xdec1('0x13')](function(_0xfe44d6){logger['error'](_0xdec1('0x1f'),_0xfe44d6['message'],_0x30fecb);_0x3f8dbd(_0x1a7709['error'](0x1f4,_0xfe44d6['message']));});});}; \ No newline at end of file +var _0x9e9c=['raw','ShowDeskAccount','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','DeskAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','GetDeskAccount','findAll','options','where','attributes','limit','map','include','model','catch','DeskAccount'];(function(_0x4e93e0,_0x2abea6){var _0x3d41b0=function(_0x5371e0){while(--_0x5371e0){_0x4e93e0['push'](_0x4e93e0['shift']());}};_0x3d41b0(++_0x2abea6);}(_0x9e9c,0x16d));var _0xc9e9=function(_0x3b0c9d,_0x3ddeb5){_0x3b0c9d=_0x3b0c9d-0x0;var _0xcfc8d7=_0x9e9c[_0x3b0c9d];return _0xcfc8d7;};'use strict';var _=require(_0xc9e9('0x0'));var util=require(_0xc9e9('0x1'));var moment=require('moment');var BPromise=require(_0xc9e9('0x2'));var rs=require(_0xc9e9('0x3'));var fs=require('fs');var Redis=require(_0xc9e9('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xc9e9('0x5'));var logger=require(_0xc9e9('0x6'))(_0xc9e9('0x7'));var config=require(_0xc9e9('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xc9e9('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5b57a2,_0x4d9f5e,_0x2a41ae){return new BPromise(function(_0xda5cc9,_0x55cd45){return client[_0xc9e9('0xa')](_0x5b57a2,_0x2a41ae)[_0xc9e9('0xb')](function(_0x1e8259){logger[_0xc9e9('0xc')](_0xc9e9('0xd'),_0x4d9f5e,_0xc9e9('0xe'));logger[_0xc9e9('0xf')]('DeskAccount,\x20%s,\x20%s,\x20%s',_0x4d9f5e,_0xc9e9('0xe'),JSON[_0xc9e9('0x10')](_0x1e8259));if(_0x1e8259[_0xc9e9('0x11')]){if(_0x1e8259[_0xc9e9('0x11')][_0xc9e9('0x12')]===0x1f4){logger[_0xc9e9('0x11')]('DeskAccount,\x20%s,\x20%s',_0x4d9f5e,_0x1e8259[_0xc9e9('0x11')][_0xc9e9('0x13')]);return _0x55cd45(_0x1e8259['error'][_0xc9e9('0x13')]);}logger[_0xc9e9('0x11')](_0xc9e9('0xd'),_0x4d9f5e,_0x1e8259[_0xc9e9('0x11')][_0xc9e9('0x13')]);return _0xda5cc9(_0x1e8259['error'][_0xc9e9('0x13')]);}else{logger[_0xc9e9('0xc')](_0xc9e9('0xd'),_0x4d9f5e,_0xc9e9('0xe'));_0xda5cc9(_0x1e8259['result'][_0xc9e9('0x13')]);}})['catch'](function(_0x53e40e){logger[_0xc9e9('0x11')](_0xc9e9('0xd'),_0x4d9f5e,_0x53e40e);_0x55cd45(_0x53e40e);});});}exports[_0xc9e9('0x14')]=function(_0x55a949){var _0x46bc90=this;return new Promise(function(_0xb03479,_0x107efa){return db['DeskAccount'][_0xc9e9('0x15')]({'raw':_0x55a949[_0xc9e9('0x16')]?_0x55a949[_0xc9e9('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x55a949['options']?_0x55a949['options'][_0xc9e9('0x17')]||null:null,'attributes':_0x55a949['options']?_0x55a949[_0xc9e9('0x16')][_0xc9e9('0x18')]||null:null,'limit':_0x55a949[_0xc9e9('0x16')]?_0x55a949[_0xc9e9('0x16')][_0xc9e9('0x19')]||null:null,'include':_0x55a949[_0xc9e9('0x16')]?_0x55a949[_0xc9e9('0x16')]['include']?_[_0xc9e9('0x1a')](_0x55a949[_0xc9e9('0x16')][_0xc9e9('0x1b')],function(_0x129b97){return{'model':db[_0x129b97[_0xc9e9('0x1c')]],'as':_0x129b97['as'],'attributes':_0x129b97['attributes'],'include':_0x129b97['include']?_[_0xc9e9('0x1a')](_0x129b97[_0xc9e9('0x1b')],function(_0x373c9b){return{'model':db[_0x373c9b['model']],'as':_0x373c9b['as'],'attributes':_0x373c9b[_0xc9e9('0x18')],'include':_0x373c9b[_0xc9e9('0x1b')]?_[_0xc9e9('0x1a')](_0x373c9b[_0xc9e9('0x1b')],function(_0x2c10e9){return{'model':db[_0x2c10e9[_0xc9e9('0x1c')]],'as':_0x2c10e9['as'],'attributes':_0x2c10e9[_0xc9e9('0x18')]};}):[]};}):[]};}):[]:[]})[_0xc9e9('0xb')](function(_0xeac0ae){logger[_0xc9e9('0xc')](_0xc9e9('0x14'),_0x55a949);logger['debug'](_0xc9e9('0x14'),_0x55a949,JSON[_0xc9e9('0x10')](_0xeac0ae));_0xb03479(_0xeac0ae);})[_0xc9e9('0x1d')](function(_0x68dbaf){logger[_0xc9e9('0x11')](_0xc9e9('0x14'),_0x68dbaf[_0xc9e9('0x13')],_0x55a949);_0x107efa(_0x46bc90['error'](0x1f4,_0x68dbaf[_0xc9e9('0x13')]));});});};exports['ShowDeskAccount']=function(_0x222073){var _0x270026=this;return new Promise(function(_0x290f9c,_0x3dbc96){return db[_0xc9e9('0x1e')]['find']({'raw':_0x222073['options']?_0x222073[_0xc9e9('0x16')][_0xc9e9('0x1f')]===undefined?!![]:![]:!![],'where':_0x222073[_0xc9e9('0x16')]?_0x222073[_0xc9e9('0x16')][_0xc9e9('0x17')]||null:null,'attributes':_0x222073['options']?_0x222073[_0xc9e9('0x16')][_0xc9e9('0x18')]||null:null,'include':_0x222073[_0xc9e9('0x16')]?_0x222073[_0xc9e9('0x16')][_0xc9e9('0x1b')]?_[_0xc9e9('0x1a')](_0x222073[_0xc9e9('0x16')][_0xc9e9('0x1b')],function(_0x453982){return{'model':db[_0x453982[_0xc9e9('0x1c')]],'as':_0x453982['as'],'attributes':_0x453982[_0xc9e9('0x18')],'include':_0x453982[_0xc9e9('0x1b')]?_['map'](_0x453982[_0xc9e9('0x1b')],function(_0x2e580b){return{'model':db[_0x2e580b[_0xc9e9('0x1c')]],'as':_0x2e580b['as'],'attributes':_0x2e580b[_0xc9e9('0x18')],'include':_0x2e580b[_0xc9e9('0x1b')]?_[_0xc9e9('0x1a')](_0x2e580b[_0xc9e9('0x1b')],function(_0xe2101b){return{'model':db[_0xe2101b[_0xc9e9('0x1c')]],'as':_0xe2101b['as'],'attributes':_0xe2101b[_0xc9e9('0x18')]};}):[]};}):[]};}):[]:[]})[_0xc9e9('0xb')](function(_0x269053){logger[_0xc9e9('0xc')](_0xc9e9('0x20'),_0x222073);logger[_0xc9e9('0xf')](_0xc9e9('0x20'),_0x222073,JSON[_0xc9e9('0x10')](_0x269053));_0x290f9c(_0x269053);})[_0xc9e9('0x1d')](function(_0xf6fe0b){logger['error'](_0xc9e9('0x20'),_0xf6fe0b[_0xc9e9('0x13')],_0x222073);_0x3dbc96(_0x270026[_0xc9e9('0x11')](0x1f4,_0xf6fe0b[_0xc9e9('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/index.js b/server/api/intDeskConfiguration/index.js index 74dc027..31ba066 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 _0x0d91=['setTags','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./intDeskConfiguration.controller','get','isAuthenticated','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','getTags','post','create','/:id/tags'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0d91,0x76));var _0x10d9=function(_0x5af709,_0x1481ca){_0x5af709=_0x5af709-0x0;var _0x190c50=_0x0d91[_0x5af709];return _0x190c50;};'use strict';var multer=require(_0x10d9('0x0'));var util=require(_0x10d9('0x1'));var path=require(_0x10d9('0x2'));var timeout=require(_0x10d9('0x3'));var express=require('express');var router=express[_0x10d9('0x4')]();var auth=require(_0x10d9('0x5'));var interaction=require(_0x10d9('0x6'));var config=require('../../config/environment');var controller=require(_0x10d9('0x7'));router[_0x10d9('0x8')]('/',auth[_0x10d9('0x9')](),controller['index']);router[_0x10d9('0x8')](_0x10d9('0xa'),auth[_0x10d9('0x9')](),controller[_0x10d9('0xb')]);router[_0x10d9('0x8')](_0x10d9('0xc'),auth[_0x10d9('0x9')](),controller[_0x10d9('0xd')]);router[_0x10d9('0x8')](_0x10d9('0xe'),auth[_0x10d9('0x9')](),controller[_0x10d9('0xf')]);router[_0x10d9('0x8')](_0x10d9('0x10'),auth[_0x10d9('0x9')](),controller[_0x10d9('0x11')]);router[_0x10d9('0x8')]('/:id/tags',auth[_0x10d9('0x9')](),controller[_0x10d9('0x12')]);router[_0x10d9('0x13')]('/',auth[_0x10d9('0x9')](),controller[_0x10d9('0x14')]);router['post'](_0x10d9('0x15'),auth['isAuthenticated'](),controller[_0x10d9('0x16')]);router[_0x10d9('0x17')](_0x10d9('0xa'),auth[_0x10d9('0x9')](),controller[_0x10d9('0x18')]);router[_0x10d9('0x19')](_0x10d9('0xa'),auth[_0x10d9('0x9')](),controller[_0x10d9('0x1a')]);module[_0x10d9('0x1b')]=router; \ No newline at end of file +var _0xc1db=['isAuthenticated','getSubjects','/:id/descriptions','getDescriptions','post','/:id/tags','setTags','put','delete','/:id','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./intDeskConfiguration.controller','get','show','/:id/fields'];(function(_0x6977db,_0xf1b5a4){var _0x28409d=function(_0x433a62){while(--_0x433a62){_0x6977db['push'](_0x6977db['shift']());}};_0x28409d(++_0xf1b5a4);}(_0xc1db,0x120));var _0xbc1d=function(_0x173c52,_0x5225bc){_0x173c52=_0x173c52-0x0;var _0x50d2f8=_0xc1db[_0x173c52];return _0x50d2f8;};'use strict';var multer=require(_0xbc1d('0x0'));var util=require('util');var path=require(_0xbc1d('0x1'));var timeout=require(_0xbc1d('0x2'));var express=require(_0xbc1d('0x3'));var router=express[_0xbc1d('0x4')]();var auth=require(_0xbc1d('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xbc1d('0x6'));var controller=require(_0xbc1d('0x7'));router[_0xbc1d('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xbc1d('0x8')]('/:id',auth['isAuthenticated'](),controller[_0xbc1d('0x9')]);router['get'](_0xbc1d('0xa'),auth[_0xbc1d('0xb')](),controller['getFields']);router[_0xbc1d('0x8')]('/:id/subjects',auth[_0xbc1d('0xb')](),controller[_0xbc1d('0xc')]);router['get'](_0xbc1d('0xd'),auth[_0xbc1d('0xb')](),controller[_0xbc1d('0xe')]);router[_0xbc1d('0x8')]('/:id/tags',auth[_0xbc1d('0xb')](),controller['getTags']);router[_0xbc1d('0xf')]('/',auth[_0xbc1d('0xb')](),controller['create']);router[_0xbc1d('0xf')](_0xbc1d('0x10'),auth['isAuthenticated'](),controller[_0xbc1d('0x11')]);router[_0xbc1d('0x12')]('/:id',auth[_0xbc1d('0xb')](),controller['update']);router[_0xbc1d('0x13')](_0xbc1d('0x14'),auth[_0xbc1d('0xb')](),controller[_0xbc1d('0x15')]);module[_0xbc1d('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 17641ba..de89c18 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 _0xd476=['exports','STRING'];(function(_0x43821f,_0x323882){var _0x241e63=function(_0x3c94b8){while(--_0x3c94b8){_0x43821f['push'](_0x43821f['shift']());}};_0x241e63(++_0x323882);}(_0xd476,0x1c0));var _0x6d47=function(_0x56198e,_0x4cd756){_0x56198e=_0x56198e-0x0;var _0x522bea=_0xd476[_0x56198e];return _0x522bea;};'use strict';var Sequelize=require('sequelize');module[_0x6d47('0x0')]={'name':{'type':Sequelize[_0x6d47('0x1')]},'description':{'type':Sequelize[_0x6d47('0x1')]}}; \ No newline at end of file +var _0xcdb5=['STRING','sequelize','exports'];(function(_0x47be5e,_0x31d493){var _0x48342e=function(_0x477a9f){while(--_0x477a9f){_0x47be5e['push'](_0x47be5e['shift']());}};_0x48342e(++_0x31d493);}(_0xcdb5,0x1b1));var _0x5cdb=function(_0xd85a1f,_0x3a7e77){_0xd85a1f=_0xd85a1f-0x0;var _0x109b83=_0xcdb5[_0xd85a1f];return _0x109b83;};'use strict';var Sequelize=require(_0x5cdb('0x0'));module[_0x5cdb('0x1')]={'name':{'type':Sequelize[_0x5cdb('0x2')]},'description':{'type':Sequelize[_0x5cdb('0x2')]}}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.controller.js b/server/api/intDeskConfiguration/intDeskConfiguration.controller.js index 7ac41b1..4be4c72 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 _0xeea5=['client','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','end','sendStatus','stack','name','send','index','DeskConfiguration','rawAttributes','model','keys','query','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','filters','merge','map','key','VIRTUAL','filter','options','include','findAll','params','includeAll','find','catch','create','body','findOne','DeskField','pick','nolimit','getFields','getSubjects','getDescriptions','getTags','Tag','setTags','ids','html-pdf','rimraf','zip-dir','request-promise','bluebird','path','to-csv','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb'];(function(_0xae1a00,_0x24dd7b){var _0x19e48b=function(_0x167987){while(--_0x167987){_0xae1a00['push'](_0xae1a00['shift']());}};_0x19e48b(++_0x24dd7b);}(_0xeea5,0xa2));var _0x5eea=function(_0x266e2b,_0x83b30){_0x266e2b=_0x266e2b-0x0;var _0x1ec3a8=_0xeea5[_0x266e2b];return _0x1ec3a8;};'use strict';var pdf=require(_0x5eea('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x5eea('0x1'));var zipdir=require(_0x5eea('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5eea('0x3'));var moment=require('moment');var BPromise=require(_0x5eea('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x5eea('0x5'));var sox=require('sox');var csv=require(_0x5eea('0x6'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x5eea('0x7'));var crypto=require(_0x5eea('0x8'));var jsforce=require(_0x5eea('0x9'));var deskjs=require(_0x5eea('0xa'));var toCsv=require(_0x5eea('0x6'));var querystring=require(_0x5eea('0xb'));var Papa=require(_0x5eea('0xc'));var Redis=require(_0x5eea('0xd'));var authService=require(_0x5eea('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x5eea('0xf'));var hardwareService=require(_0x5eea('0x10'));var logger=require('../../config/logger')(_0x5eea('0x11'));var utils=require(_0x5eea('0x12'));var config=require('../../config/environment');var db=require(_0x5eea('0x13'))['db'];var jayson=require('jayson/promise');var client=jayson[_0x5eea('0x14')]['http']({'port':0x232a});function checkPasswordPattern(_0x487104,_0x229fac,_0x26e113){if(_0x26e113){var _0x3ccd3a=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3ccd3a[_0x5eea('0x15')](_0x229fac)){return _0x487104;}else{throw new Error(_0x5eea('0x16'));}}else{return _0x487104;}}function respondWithRpcPromise(_0x57565f,_0x5d3c50,_0x25de15,_0x48ee3e){return new BPromise(function(_0x50b9cc,_0x24d56c){var _0x4a35fc=_0x48ee3e||client;return _0x4a35fc[_0x5eea('0x17')](_0x57565f,_0x25de15)[_0x5eea('0x18')](function(_0x396fb4){logger[_0x5eea('0x19')](_0x5eea('0x1a'),_0x5d3c50,_0x5eea('0x1b'));logger[_0x5eea('0x1c')](_0x5eea('0x1d'),_0x5d3c50,_0x5eea('0x1b'),JSON[_0x5eea('0x1e')](_0x396fb4));if(_0x396fb4[_0x5eea('0x1f')]){if(_0x396fb4[_0x5eea('0x1f')]['code']===0x1f4){logger[_0x5eea('0x1f')](_0x5eea('0x1a'),_0x5d3c50,_0x396fb4[_0x5eea('0x1f')][_0x5eea('0x20')]);return _0x24d56c(_0x396fb4['error']['message']);}logger['error'](_0x5eea('0x1a'),_0x5d3c50,_0x396fb4[_0x5eea('0x1f')][_0x5eea('0x20')]);return _0x50b9cc(_0x396fb4['error'][_0x5eea('0x20')]);}else{logger[_0x5eea('0x19')](_0x5eea('0x1a'),_0x5d3c50,_0x5eea('0x1b'));_0x50b9cc(_0x396fb4[_0x5eea('0x21')][_0x5eea('0x20')]);}})['catch'](function(_0x7fdbcd){logger[_0x5eea('0x1f')]('DeskConfiguration,\x20%s,\x20%s',_0x5d3c50,_0x7fdbcd);_0x24d56c(_0x7fdbcd);});});}function respondWithStatusCode(_0x3971b5,_0x317626){_0x317626=_0x317626||0xcc;return function(_0x46aa54){if(_0x46aa54){return _0x3971b5['sendStatus'](_0x317626);}return _0x3971b5[_0x5eea('0x22')](_0x317626)['end']();};}function respondWithResult(_0x1a5f61,_0x587858){_0x587858=_0x587858||0xc8;return function(_0xbcf11e){if(_0xbcf11e){return _0x1a5f61[_0x5eea('0x22')](_0x587858)[_0x5eea('0x23')](_0xbcf11e);}};}function respondWithFilteredResult(_0x37cc47,_0x17d3f3){return function(_0x3e5c69){if(_0x3e5c69){var _0x281b79=_0x3e5c69[_0x5eea('0x24')],_0x21eaf5=_0x17d3f3[_0x5eea('0x25')],_0x5e1fc8=_0x17d3f3[_0x5eea('0x25')]+_0x17d3f3[_0x5eea('0x26')],_0x5c556c;if(_0x5e1fc8>=_0x281b79){_0x5e1fc8=_0x281b79;_0x5c556c=0xc8;}else{_0x5c556c=0xce;}_0x37cc47[_0x5eea('0x22')](_0x5c556c);return _0x37cc47[_0x5eea('0x27')](_0x5eea('0x28'),_0x21eaf5+'-'+_0x5e1fc8+'/'+_0x281b79)[_0x5eea('0x23')](_0x3e5c69);}return null;};}function patchUpdates(_0x64ca2f){return function(_0x32ae7d){try{jsonpatch[_0x5eea('0x29')](_0x32ae7d,_0x64ca2f,!![]);}catch(_0x4c8195){return BPromise[_0x5eea('0x2a')](_0x4c8195);}return _0x32ae7d[_0x5eea('0x2b')]();};}function saveUpdates(_0x51f8f9,_0x408677){return function(_0x3b378f){if(_0x3b378f){return _0x3b378f[_0x5eea('0x2c')](_0x51f8f9)['then'](function(_0x29aa2a){return _0x29aa2a;});}return null;};}function removeEntity(_0x394b30,_0x34ae48){return function(_0x2d823c){if(_0x2d823c){return _0x2d823c[_0x5eea('0x2d')]()[_0x5eea('0x18')](function(){_0x394b30['status'](0xcc)[_0x5eea('0x2e')]();});}};}function handleEntityNotFound(_0x2ac114,_0x34cfd7){return function(_0x1acc4d){if(!_0x1acc4d){_0x2ac114[_0x5eea('0x2f')](0x194);}return _0x1acc4d;};}function handleError(_0x599627,_0x3c1039){_0x3c1039=_0x3c1039||0x1f4;return function(_0x398f63){logger['error'](_0x398f63[_0x5eea('0x30')]);if(_0x398f63['name']){delete _0x398f63[_0x5eea('0x31')];}_0x599627[_0x5eea('0x22')](_0x3c1039)[_0x5eea('0x32')](_0x398f63);};}exports[_0x5eea('0x33')]=function(_0xbef086,_0x53a287){var _0x347be7={},_0x358ada={},_0x3d2c29={'count':0x0,'rows':[]};var _0x38b084=db[_0x5eea('0x34')][_0x5eea('0x35')];_0x358ada[_0x5eea('0x36')]=_[_0x5eea('0x37')](_0x38b084);_0x358ada[_0x5eea('0x38')]=_[_0x5eea('0x37')](_0xbef086['query']);_0x358ada['filters']=_['intersection'](_0x358ada[_0x5eea('0x36')],_0x358ada[_0x5eea('0x38')]);_0x347be7[_0x5eea('0x39')]=_[_0x5eea('0x3a')](_0x358ada[_0x5eea('0x36')],qs[_0x5eea('0x3b')](_0xbef086[_0x5eea('0x38')]['fields']));_0x347be7[_0x5eea('0x39')]=_0x347be7['attributes'][_0x5eea('0x3c')]?_0x347be7[_0x5eea('0x39')]:_0x358ada[_0x5eea('0x36')];if(!_0xbef086[_0x5eea('0x38')][_0x5eea('0x3d')]('nolimit')){_0x347be7['limit']=qs[_0x5eea('0x26')](_0xbef086[_0x5eea('0x38')][_0x5eea('0x26')]);_0x347be7[_0x5eea('0x25')]=qs[_0x5eea('0x25')](_0xbef086[_0x5eea('0x38')][_0x5eea('0x25')]);}_0x347be7[_0x5eea('0x3e')]=qs[_0x5eea('0x3f')](_0xbef086['query'][_0x5eea('0x3f')]);_0x347be7[_0x5eea('0x40')]=qs['filters'](_['pick'](_0xbef086[_0x5eea('0x38')],_0x358ada[_0x5eea('0x41')]));if(_0xbef086[_0x5eea('0x38')]['filter']){_0x347be7[_0x5eea('0x40')]=_[_0x5eea('0x42')](_0x347be7[_0x5eea('0x40')],{'$or':_[_0x5eea('0x43')](_0x38b084,function(_0x409c69){if(_0x409c69['type'][_0x5eea('0x44')]!==_0x5eea('0x45')){var _0x4c70b8={};_0x4c70b8[_0x409c69['field']]={'$like':'%'+_0xbef086[_0x5eea('0x38')][_0x5eea('0x46')]+'%'};return _0x4c70b8;}})});}_0x347be7=_['merge']({},_0x347be7,_0xbef086[_0x5eea('0x47')]);var _0xe48b00={'where':_0x347be7[_0x5eea('0x40')]};return db['DeskConfiguration']['count'](_0xe48b00)[_0x5eea('0x18')](function(_0x2cb552){_0x3d2c29[_0x5eea('0x24')]=_0x2cb552;if(_0xbef086[_0x5eea('0x38')]['includeAll']){_0x347be7[_0x5eea('0x48')]=[{'all':!![]}];}return db[_0x5eea('0x34')][_0x5eea('0x49')](_0x347be7);})[_0x5eea('0x18')](function(_0x236012){_0x3d2c29['rows']=_0x236012;return _0x3d2c29;})['then'](respondWithFilteredResult(_0x53a287,_0x347be7))['catch'](handleError(_0x53a287,null));};exports['show']=function(_0x40dd85,_0xf611df){var _0x18fcdf={'raw':![],'where':{'id':_0x40dd85[_0x5eea('0x4a')]['id']}},_0x4281f9={};_0x4281f9['model']=_[_0x5eea('0x37')](db[_0x5eea('0x34')]['rawAttributes']);_0x4281f9[_0x5eea('0x38')]=_['keys'](_0x40dd85[_0x5eea('0x38')]);_0x4281f9['filters']=_[_0x5eea('0x3a')](_0x4281f9[_0x5eea('0x36')],_0x4281f9[_0x5eea('0x38')]);_0x18fcdf['attributes']=_[_0x5eea('0x3a')](_0x4281f9[_0x5eea('0x36')],qs[_0x5eea('0x3b')](_0x40dd85[_0x5eea('0x38')]['fields']));_0x18fcdf[_0x5eea('0x39')]=_0x18fcdf[_0x5eea('0x39')]['length']?_0x18fcdf[_0x5eea('0x39')]:_0x4281f9[_0x5eea('0x36')];if(_0x40dd85[_0x5eea('0x38')][_0x5eea('0x4b')]){_0x18fcdf[_0x5eea('0x48')]=[{'all':!![]}];}_0x18fcdf=_['merge']({},_0x18fcdf,_0x40dd85['options']);return db['DeskConfiguration'][_0x5eea('0x4c')](_0x18fcdf)[_0x5eea('0x18')](handleEntityNotFound(_0xf611df,null))[_0x5eea('0x18')](respondWithResult(_0xf611df,null))[_0x5eea('0x4d')](handleError(_0xf611df,null));};exports[_0x5eea('0x4e')]=function(_0x56a5e4,_0x3157c9){return db['DeskConfiguration'][_0x5eea('0x4e')](_0x56a5e4[_0x5eea('0x4f')],{})[_0x5eea('0x18')](respondWithResult(_0x3157c9,0xc9))['catch'](handleError(_0x3157c9,null));};exports['update']=function(_0xa4fc95,_0x159186){if(_0xa4fc95[_0x5eea('0x4f')]['id']){delete _0xa4fc95[_0x5eea('0x4f')]['id'];}return db[_0x5eea('0x34')][_0x5eea('0x4c')]({'where':{'id':_0xa4fc95[_0x5eea('0x4a')]['id']}})[_0x5eea('0x18')](handleEntityNotFound(_0x159186,null))['then'](saveUpdates(_0xa4fc95[_0x5eea('0x4f')],null))[_0x5eea('0x18')](respondWithResult(_0x159186,null))[_0x5eea('0x4d')](handleError(_0x159186,null));};exports[_0x5eea('0x2d')]=function(_0x181125,_0x1032b8){return db[_0x5eea('0x34')][_0x5eea('0x4c')]({'where':{'id':_0x181125['params']['id']}})[_0x5eea('0x18')](handleEntityNotFound(_0x1032b8,null))['then'](removeEntity(_0x1032b8,null))[_0x5eea('0x4d')](handleError(_0x1032b8,null));};exports['getFields']=function(_0x56621a,_0x549924,_0x159966){var _0x20f878={};var _0x2d7142={};var _0x25d009;var _0x35688e;return db['DeskConfiguration'][_0x5eea('0x50')]({'where':{'id':_0x56621a['params']['id']}})[_0x5eea('0x18')](handleEntityNotFound(_0x549924,null))['then'](function(_0x54541e){if(_0x54541e){_0x25d009=_0x54541e;_0x2d7142['model']=_[_0x5eea('0x37')](db[_0x5eea('0x51')][_0x5eea('0x35')]);_0x2d7142[_0x5eea('0x38')]=_[_0x5eea('0x37')](_0x56621a[_0x5eea('0x38')]);_0x2d7142[_0x5eea('0x41')]=_[_0x5eea('0x3a')](_0x2d7142[_0x5eea('0x36')],_0x2d7142['query']);_0x20f878[_0x5eea('0x39')]=_[_0x5eea('0x3a')](_0x2d7142[_0x5eea('0x36')],qs[_0x5eea('0x3b')](_0x56621a[_0x5eea('0x38')][_0x5eea('0x3b')]));_0x20f878[_0x5eea('0x39')]=_0x20f878[_0x5eea('0x39')][_0x5eea('0x3c')]?_0x20f878[_0x5eea('0x39')]:_0x2d7142[_0x5eea('0x36')];_0x20f878['order']=qs['sort'](_0x56621a['query']['sort']);_0x20f878['where']=qs[_0x5eea('0x41')](_[_0x5eea('0x52')](_0x56621a[_0x5eea('0x38')],_0x2d7142['filters']));if(_0x56621a[_0x5eea('0x38')]['filter']){_0x20f878['where']=_[_0x5eea('0x42')](_0x20f878[_0x5eea('0x40')],{'$or':_['map'](_0x20f878['attributes'],function(_0x2dd976){var _0x2ada94={};_0x2ada94[_0x2dd976]={'$like':'%'+_0x56621a['query'][_0x5eea('0x46')]+'%'};return _0x2ada94;})});}_0x20f878=_['merge']({},_0x20f878,_0x56621a[_0x5eea('0x47')]);return _0x25d009['getFields'](_0x20f878);}})[_0x5eea('0x18')](function(_0x4b7aef){if(_0x4b7aef){_0x35688e=_0x4b7aef['length'];if(!_0x56621a[_0x5eea('0x38')][_0x5eea('0x3d')](_0x5eea('0x53'))){_0x20f878[_0x5eea('0x26')]=qs[_0x5eea('0x26')](_0x56621a[_0x5eea('0x38')][_0x5eea('0x26')]);_0x20f878[_0x5eea('0x25')]=qs[_0x5eea('0x25')](_0x56621a[_0x5eea('0x38')][_0x5eea('0x25')]);}return _0x25d009[_0x5eea('0x54')](_0x20f878);}})['then'](function(_0x396fd8){if(_0x396fd8){return _0x396fd8?{'count':_0x35688e,'rows':_0x396fd8}:null;}})[_0x5eea('0x18')](respondWithResult(_0x549924,null))[_0x5eea('0x4d')](handleError(_0x549924,null));};exports[_0x5eea('0x55')]=function(_0x3603aa,_0x2e1706,_0x2dcb2e){var _0x16efd0={};var _0x4e31af={};var _0x1a01f8;var _0x6bbe61;return db[_0x5eea('0x34')][_0x5eea('0x50')]({'where':{'id':_0x3603aa[_0x5eea('0x4a')]['id']}})[_0x5eea('0x18')](handleEntityNotFound(_0x2e1706,null))['then'](function(_0x3bf5c4){if(_0x3bf5c4){_0x1a01f8=_0x3bf5c4;_0x4e31af[_0x5eea('0x36')]=_[_0x5eea('0x37')](db[_0x5eea('0x51')][_0x5eea('0x35')]);_0x4e31af[_0x5eea('0x38')]=_[_0x5eea('0x37')](_0x3603aa['query']);_0x4e31af['filters']=_[_0x5eea('0x3a')](_0x4e31af[_0x5eea('0x36')],_0x4e31af[_0x5eea('0x38')]);_0x16efd0['attributes']=_[_0x5eea('0x3a')](_0x4e31af[_0x5eea('0x36')],qs[_0x5eea('0x3b')](_0x3603aa[_0x5eea('0x38')][_0x5eea('0x3b')]));_0x16efd0[_0x5eea('0x39')]=_0x16efd0[_0x5eea('0x39')][_0x5eea('0x3c')]?_0x16efd0[_0x5eea('0x39')]:_0x4e31af[_0x5eea('0x36')];_0x16efd0['order']=qs['sort'](_0x3603aa[_0x5eea('0x38')][_0x5eea('0x3f')]);_0x16efd0[_0x5eea('0x40')]=qs[_0x5eea('0x41')](_[_0x5eea('0x52')](_0x3603aa[_0x5eea('0x38')],_0x4e31af[_0x5eea('0x41')]));if(_0x3603aa[_0x5eea('0x38')][_0x5eea('0x46')]){_0x16efd0[_0x5eea('0x40')]=_['merge'](_0x16efd0[_0x5eea('0x40')],{'$or':_['map'](_0x16efd0['attributes'],function(_0x5c2e4e){var _0x235b54={};_0x235b54[_0x5c2e4e]={'$like':'%'+_0x3603aa[_0x5eea('0x38')][_0x5eea('0x46')]+'%'};return _0x235b54;})});}_0x16efd0=_[_0x5eea('0x42')]({},_0x16efd0,_0x3603aa['options']);return _0x1a01f8['getSubjects'](_0x16efd0);}})['then'](function(_0x4b87df){if(_0x4b87df){_0x6bbe61=_0x4b87df[_0x5eea('0x3c')];if(!_0x3603aa[_0x5eea('0x38')][_0x5eea('0x3d')](_0x5eea('0x53'))){_0x16efd0[_0x5eea('0x26')]=qs[_0x5eea('0x26')](_0x3603aa[_0x5eea('0x38')][_0x5eea('0x26')]);_0x16efd0[_0x5eea('0x25')]=qs['offset'](_0x3603aa[_0x5eea('0x38')]['offset']);}return _0x1a01f8['getSubjects'](_0x16efd0);}})[_0x5eea('0x18')](function(_0x49285a){if(_0x49285a){return _0x49285a?{'count':_0x6bbe61,'rows':_0x49285a}:null;}})[_0x5eea('0x18')](respondWithResult(_0x2e1706,null))[_0x5eea('0x4d')](handleError(_0x2e1706,null));};exports[_0x5eea('0x56')]=function(_0xa3069d,_0x5b7ede,_0x20dde5){var _0x5249c0={};var _0x50ac67={};var _0x48c56b;var _0x4c48c1;return db[_0x5eea('0x34')]['findOne']({'where':{'id':_0xa3069d[_0x5eea('0x4a')]['id']}})[_0x5eea('0x18')](handleEntityNotFound(_0x5b7ede,null))[_0x5eea('0x18')](function(_0x35f311){if(_0x35f311){_0x48c56b=_0x35f311;_0x50ac67[_0x5eea('0x36')]=_[_0x5eea('0x37')](db[_0x5eea('0x51')]['rawAttributes']);_0x50ac67[_0x5eea('0x38')]=_['keys'](_0xa3069d['query']);_0x50ac67['filters']=_['intersection'](_0x50ac67[_0x5eea('0x36')],_0x50ac67[_0x5eea('0x38')]);_0x5249c0[_0x5eea('0x39')]=_[_0x5eea('0x3a')](_0x50ac67[_0x5eea('0x36')],qs[_0x5eea('0x3b')](_0xa3069d['query'][_0x5eea('0x3b')]));_0x5249c0[_0x5eea('0x39')]=_0x5249c0[_0x5eea('0x39')][_0x5eea('0x3c')]?_0x5249c0[_0x5eea('0x39')]:_0x50ac67[_0x5eea('0x36')];_0x5249c0['order']=qs[_0x5eea('0x3f')](_0xa3069d[_0x5eea('0x38')][_0x5eea('0x3f')]);_0x5249c0['where']=qs['filters'](_[_0x5eea('0x52')](_0xa3069d[_0x5eea('0x38')],_0x50ac67[_0x5eea('0x41')]));if(_0xa3069d['query'][_0x5eea('0x46')]){_0x5249c0['where']=_[_0x5eea('0x42')](_0x5249c0[_0x5eea('0x40')],{'$or':_['map'](_0x5249c0[_0x5eea('0x39')],function(_0x5c6c49){var _0x20e2c3={};_0x20e2c3[_0x5c6c49]={'$like':'%'+_0xa3069d[_0x5eea('0x38')][_0x5eea('0x46')]+'%'};return _0x20e2c3;})});}_0x5249c0=_[_0x5eea('0x42')]({},_0x5249c0,_0xa3069d[_0x5eea('0x47')]);return _0x48c56b[_0x5eea('0x56')](_0x5249c0);}})[_0x5eea('0x18')](function(_0x5df342){if(_0x5df342){_0x4c48c1=_0x5df342[_0x5eea('0x3c')];if(!_0xa3069d['query'][_0x5eea('0x3d')](_0x5eea('0x53'))){_0x5249c0[_0x5eea('0x26')]=qs['limit'](_0xa3069d['query']['limit']);_0x5249c0[_0x5eea('0x25')]=qs[_0x5eea('0x25')](_0xa3069d[_0x5eea('0x38')][_0x5eea('0x25')]);}return _0x48c56b[_0x5eea('0x56')](_0x5249c0);}})['then'](function(_0x1c92d8){if(_0x1c92d8){return _0x1c92d8?{'count':_0x4c48c1,'rows':_0x1c92d8}:null;}})[_0x5eea('0x18')](respondWithResult(_0x5b7ede,null))['catch'](handleError(_0x5b7ede,null));};exports[_0x5eea('0x57')]=function(_0x548fed,_0x54a1a0,_0x20d7ed){var _0x1e4bac={};var _0xdaf5c6={};var _0x142cbd;var _0x2eea77;return db[_0x5eea('0x34')]['findOne']({'where':{'id':_0x548fed[_0x5eea('0x4a')]['id']}})[_0x5eea('0x18')](handleEntityNotFound(_0x54a1a0,null))[_0x5eea('0x18')](function(_0x5b29b9){if(_0x5b29b9){_0x142cbd=_0x5b29b9;_0xdaf5c6[_0x5eea('0x36')]=_[_0x5eea('0x37')](db[_0x5eea('0x58')][_0x5eea('0x35')]);_0xdaf5c6[_0x5eea('0x38')]=_[_0x5eea('0x37')](_0x548fed['query']);_0xdaf5c6[_0x5eea('0x41')]=_[_0x5eea('0x3a')](_0xdaf5c6[_0x5eea('0x36')],_0xdaf5c6[_0x5eea('0x38')]);_0x1e4bac['attributes']=_[_0x5eea('0x3a')](_0xdaf5c6[_0x5eea('0x36')],qs[_0x5eea('0x3b')](_0x548fed['query'][_0x5eea('0x3b')]));_0x1e4bac[_0x5eea('0x39')]=_0x1e4bac[_0x5eea('0x39')][_0x5eea('0x3c')]?_0x1e4bac[_0x5eea('0x39')]:_0xdaf5c6[_0x5eea('0x36')];_0x1e4bac[_0x5eea('0x3e')]=qs[_0x5eea('0x3f')](_0x548fed['query'][_0x5eea('0x3f')]);_0x1e4bac[_0x5eea('0x40')]=qs['filters'](_['pick'](_0x548fed[_0x5eea('0x38')],_0xdaf5c6['filters']));if(_0x548fed[_0x5eea('0x38')][_0x5eea('0x46')]){_0x1e4bac[_0x5eea('0x40')]=_[_0x5eea('0x42')](_0x1e4bac[_0x5eea('0x40')],{'$or':_['map'](_0x1e4bac[_0x5eea('0x39')],function(_0x209610){var _0x5d9a2c={};_0x5d9a2c[_0x209610]={'$like':'%'+_0x548fed[_0x5eea('0x38')][_0x5eea('0x46')]+'%'};return _0x5d9a2c;})});}_0x1e4bac=_[_0x5eea('0x42')]({},_0x1e4bac,_0x548fed['options']);return _0x142cbd[_0x5eea('0x57')](_0x1e4bac);}})['then'](function(_0x56e134){if(_0x56e134){_0x2eea77=_0x56e134[_0x5eea('0x3c')];if(!_0x548fed[_0x5eea('0x38')][_0x5eea('0x3d')](_0x5eea('0x53'))){_0x1e4bac[_0x5eea('0x26')]=qs[_0x5eea('0x26')](_0x548fed['query'][_0x5eea('0x26')]);_0x1e4bac['offset']=qs['offset'](_0x548fed[_0x5eea('0x38')][_0x5eea('0x25')]);}return _0x142cbd[_0x5eea('0x57')](_0x1e4bac);}})[_0x5eea('0x18')](function(_0x4affa0){if(_0x4affa0){return _0x4affa0?{'count':_0x2eea77,'rows':_0x4affa0}:null;}})[_0x5eea('0x18')](respondWithResult(_0x54a1a0,null))['catch'](handleError(_0x54a1a0,null));};exports[_0x5eea('0x59')]=function(_0x50d01c,_0x305ff9,_0x348b74){if(_0x50d01c[_0x5eea('0x4f')]['id']){delete _0x50d01c['body']['id'];}return db['DeskConfiguration'][_0x5eea('0x50')]({'where':{'id':_0x50d01c[_0x5eea('0x4a')]['id']}})[_0x5eea('0x18')](handleEntityNotFound(_0x305ff9,null))['then'](function(_0x44b214){if(_0x44b214){return _0x44b214[_0x5eea('0x59')](_0x50d01c[_0x5eea('0x4f')][_0x5eea('0x5a')]||[]);}return null;})[_0x5eea('0x18')](respondWithResult(_0x305ff9,null))['catch'](handleError(_0x305ff9,null));}; \ No newline at end of file +var _0x03e8=['filters','pick','filter','merge','map','type','key','VIRTUAL','field','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','getFields','DeskField','sort','findOne','getSubjects','getDescriptions','getTags','Tag','setTags','ids','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','DeskConfiguration,\x20%s,\x20%s','info','message','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','update','destroy','stack','name','index','DeskConfiguration','rawAttributes','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where'];(function(_0x3ec271,_0x304bad){var _0x4648e5=function(_0x133dd1){while(--_0x133dd1){_0x3ec271['push'](_0x3ec271['shift']());}};_0x4648e5(++_0x304bad);}(_0x03e8,0x1a6));var _0x803e=function(_0x1cab14,_0x11ba43){_0x1cab14=_0x1cab14-0x0;var _0x5ce382=_0x03e8[_0x1cab14];return _0x5ce382;};'use strict';var pdf=require(_0x803e('0x0'));var emlformat=require(_0x803e('0x1'));var rimraf=require(_0x803e('0x2'));var zipdir=require(_0x803e('0x3'));var jsonpatch=require(_0x803e('0x4'));var rp=require(_0x803e('0x5'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x803e('0x6'));var path=require('path');var sox=require(_0x803e('0x7'));var csv=require(_0x803e('0x8'));var ejs=require(_0x803e('0x9'));var fs=require('fs');var _=require(_0x803e('0xa'));var squel=require(_0x803e('0xb'));var crypto=require(_0x803e('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x803e('0xd'));var toCsv=require(_0x803e('0x8'));var querystring=require(_0x803e('0xe'));var Papa=require(_0x803e('0xf'));var Redis=require(_0x803e('0x10'));var authService=require(_0x803e('0x11'));var qs=require(_0x803e('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x803e('0x13'));var logger=require(_0x803e('0x14'))(_0x803e('0x15'));var utils=require(_0x803e('0x16'));var config=require(_0x803e('0x17'));var db=require(_0x803e('0x18'))['db'];var jayson=require(_0x803e('0x19'));var client=jayson[_0x803e('0x1a')]['http']({'port':0x232a});function checkPasswordPattern(_0xf25cfa,_0x2c6c80,_0x3b6ee3){if(_0x3b6ee3){var _0x41a9fa=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x41a9fa[_0x803e('0x1b')](_0x2c6c80)){return _0xf25cfa;}else{throw new Error(_0x803e('0x1c'));}}else{return _0xf25cfa;}}function respondWithRpcPromise(_0x50af65,_0x5d1e4a,_0x4d0c56,_0x69ac70){return new BPromise(function(_0x157c94,_0x46e073){var _0x2f15f7=_0x69ac70||client;return _0x2f15f7[_0x803e('0x1d')](_0x50af65,_0x4d0c56)[_0x803e('0x1e')](function(_0x4c1fae){logger['info']('DeskConfiguration,\x20%s,\x20%s',_0x5d1e4a,_0x803e('0x1f'));logger[_0x803e('0x20')](_0x803e('0x21'),_0x5d1e4a,_0x803e('0x1f'),JSON[_0x803e('0x22')](_0x4c1fae));if(_0x4c1fae[_0x803e('0x23')]){if(_0x4c1fae[_0x803e('0x23')][_0x803e('0x24')]===0x1f4){logger['error'](_0x803e('0x25'),_0x5d1e4a,_0x4c1fae[_0x803e('0x23')]['message']);return _0x46e073(_0x4c1fae[_0x803e('0x23')]['message']);}logger[_0x803e('0x23')](_0x803e('0x25'),_0x5d1e4a,_0x4c1fae['error']['message']);return _0x157c94(_0x4c1fae['error']['message']);}else{logger[_0x803e('0x26')](_0x803e('0x25'),_0x5d1e4a,_0x803e('0x1f'));_0x157c94(_0x4c1fae['result'][_0x803e('0x27')]);}})['catch'](function(_0x23195e){logger[_0x803e('0x23')](_0x803e('0x25'),_0x5d1e4a,_0x23195e);_0x46e073(_0x23195e);});});}function respondWithStatusCode(_0x159da0,_0x50b9cc){_0x50b9cc=_0x50b9cc||0xcc;return function(_0x43f378){if(_0x43f378){return _0x159da0[_0x803e('0x28')](_0x50b9cc);}return _0x159da0[_0x803e('0x29')](_0x50b9cc)[_0x803e('0x2a')]();};}function respondWithResult(_0x67b2e7,_0x193f9a){_0x193f9a=_0x193f9a||0xc8;return function(_0xc2bd19){if(_0xc2bd19){return _0x67b2e7[_0x803e('0x29')](_0x193f9a)[_0x803e('0x2b')](_0xc2bd19);}};}function respondWithFilteredResult(_0x1125f4,_0x3d2eb1){return function(_0x51ffa2){if(_0x51ffa2){var _0x573725=_0x51ffa2[_0x803e('0x2c')],_0x411bca=_0x3d2eb1[_0x803e('0x2d')],_0x3ed40b=_0x3d2eb1[_0x803e('0x2d')]+_0x3d2eb1[_0x803e('0x2e')],_0x3d2664;if(_0x3ed40b>=_0x573725){_0x3ed40b=_0x573725;_0x3d2664=0xc8;}else{_0x3d2664=0xce;}_0x1125f4[_0x803e('0x29')](_0x3d2664);return _0x1125f4[_0x803e('0x2f')](_0x803e('0x30'),_0x411bca+'-'+_0x3ed40b+'/'+_0x573725)['json'](_0x51ffa2);}return null;};}function patchUpdates(_0x5ebe33){return function(_0x1bf7c4){try{jsonpatch[_0x803e('0x31')](_0x1bf7c4,_0x5ebe33,!![]);}catch(_0x220de5){return BPromise['reject'](_0x220de5);}return _0x1bf7c4['save']();};}function saveUpdates(_0x4fb516,_0x14e6b0){return function(_0x48c682){if(_0x48c682){return _0x48c682[_0x803e('0x32')](_0x4fb516)[_0x803e('0x1e')](function(_0x22e977){return _0x22e977;});}return null;};}function removeEntity(_0x513e50,_0x443873){return function(_0x2d2e4c){if(_0x2d2e4c){return _0x2d2e4c[_0x803e('0x33')]()[_0x803e('0x1e')](function(){_0x513e50[_0x803e('0x29')](0xcc)[_0x803e('0x2a')]();});}};}function handleEntityNotFound(_0x6274bd,_0x40b1a3){return function(_0x20df0b){if(!_0x20df0b){_0x6274bd[_0x803e('0x28')](0x194);}return _0x20df0b;};}function handleError(_0x469a25,_0x59e385){_0x59e385=_0x59e385||0x1f4;return function(_0x2d60dc){logger[_0x803e('0x23')](_0x2d60dc[_0x803e('0x34')]);if(_0x2d60dc[_0x803e('0x35')]){delete _0x2d60dc[_0x803e('0x35')];}_0x469a25[_0x803e('0x29')](_0x59e385)['send'](_0x2d60dc);};}exports[_0x803e('0x36')]=function(_0x4758c8,_0x3ea3cf){var _0x1dc69d={},_0x26c412={},_0x26a5db={'count':0x0,'rows':[]};var _0x8352ca=db[_0x803e('0x37')][_0x803e('0x38')];_0x26c412[_0x803e('0x39')]=_[_0x803e('0x3a')](_0x8352ca);_0x26c412['query']=_['keys'](_0x4758c8[_0x803e('0x3b')]);_0x26c412['filters']=_[_0x803e('0x3c')](_0x26c412['model'],_0x26c412[_0x803e('0x3b')]);_0x1dc69d[_0x803e('0x3d')]=_['intersection'](_0x26c412[_0x803e('0x39')],qs[_0x803e('0x3e')](_0x4758c8[_0x803e('0x3b')]['fields']));_0x1dc69d[_0x803e('0x3d')]=_0x1dc69d[_0x803e('0x3d')][_0x803e('0x3f')]?_0x1dc69d[_0x803e('0x3d')]:_0x26c412[_0x803e('0x39')];if(!_0x4758c8[_0x803e('0x3b')][_0x803e('0x40')](_0x803e('0x41'))){_0x1dc69d[_0x803e('0x2e')]=qs[_0x803e('0x2e')](_0x4758c8[_0x803e('0x3b')][_0x803e('0x2e')]);_0x1dc69d[_0x803e('0x2d')]=qs[_0x803e('0x2d')](_0x4758c8[_0x803e('0x3b')][_0x803e('0x2d')]);}_0x1dc69d[_0x803e('0x42')]=qs['sort'](_0x4758c8[_0x803e('0x3b')]['sort']);_0x1dc69d[_0x803e('0x43')]=qs[_0x803e('0x44')](_[_0x803e('0x45')](_0x4758c8[_0x803e('0x3b')],_0x26c412[_0x803e('0x44')]));if(_0x4758c8['query'][_0x803e('0x46')]){_0x1dc69d['where']=_[_0x803e('0x47')](_0x1dc69d[_0x803e('0x43')],{'$or':_[_0x803e('0x48')](_0x8352ca,function(_0x42fb13){if(_0x42fb13[_0x803e('0x49')][_0x803e('0x4a')]!==_0x803e('0x4b')){var _0x66df6e={};_0x66df6e[_0x42fb13[_0x803e('0x4c')]]={'$like':'%'+_0x4758c8['query'][_0x803e('0x46')]+'%'};return _0x66df6e;}})});}_0x1dc69d=_[_0x803e('0x47')]({},_0x1dc69d,_0x4758c8[_0x803e('0x4d')]);var _0x5f39b9={'where':_0x1dc69d[_0x803e('0x43')]};return db[_0x803e('0x37')][_0x803e('0x2c')](_0x5f39b9)[_0x803e('0x1e')](function(_0x32713d){_0x26a5db[_0x803e('0x2c')]=_0x32713d;if(_0x4758c8[_0x803e('0x3b')][_0x803e('0x4e')]){_0x1dc69d[_0x803e('0x4f')]=[{'all':!![]}];}return db[_0x803e('0x37')][_0x803e('0x50')](_0x1dc69d);})[_0x803e('0x1e')](function(_0xb4072){_0x26a5db[_0x803e('0x51')]=_0xb4072;return _0x26a5db;})[_0x803e('0x1e')](respondWithFilteredResult(_0x3ea3cf,_0x1dc69d))[_0x803e('0x52')](handleError(_0x3ea3cf,null));};exports[_0x803e('0x53')]=function(_0x18e5a7,_0x1c823e){var _0x44888a={'raw':![],'where':{'id':_0x18e5a7[_0x803e('0x54')]['id']}},_0x3cafc2={};_0x3cafc2[_0x803e('0x39')]=_['keys'](db[_0x803e('0x37')][_0x803e('0x38')]);_0x3cafc2[_0x803e('0x3b')]=_['keys'](_0x18e5a7[_0x803e('0x3b')]);_0x3cafc2[_0x803e('0x44')]=_[_0x803e('0x3c')](_0x3cafc2[_0x803e('0x39')],_0x3cafc2[_0x803e('0x3b')]);_0x44888a[_0x803e('0x3d')]=_[_0x803e('0x3c')](_0x3cafc2['model'],qs['fields'](_0x18e5a7['query'][_0x803e('0x3e')]));_0x44888a[_0x803e('0x3d')]=_0x44888a['attributes'][_0x803e('0x3f')]?_0x44888a['attributes']:_0x3cafc2[_0x803e('0x39')];if(_0x18e5a7[_0x803e('0x3b')][_0x803e('0x4e')]){_0x44888a[_0x803e('0x4f')]=[{'all':!![]}];}_0x44888a=_[_0x803e('0x47')]({},_0x44888a,_0x18e5a7[_0x803e('0x4d')]);return db['DeskConfiguration'][_0x803e('0x55')](_0x44888a)[_0x803e('0x1e')](handleEntityNotFound(_0x1c823e,null))[_0x803e('0x1e')](respondWithResult(_0x1c823e,null))[_0x803e('0x52')](handleError(_0x1c823e,null));};exports[_0x803e('0x56')]=function(_0xb69ead,_0x394cc8){return db['DeskConfiguration'][_0x803e('0x56')](_0xb69ead[_0x803e('0x57')],{})['then'](respondWithResult(_0x394cc8,0xc9))['catch'](handleError(_0x394cc8,null));};exports[_0x803e('0x32')]=function(_0x2355bf,_0x34171d){if(_0x2355bf[_0x803e('0x57')]['id']){delete _0x2355bf[_0x803e('0x57')]['id'];}return db['DeskConfiguration'][_0x803e('0x55')]({'where':{'id':_0x2355bf[_0x803e('0x54')]['id']}})['then'](handleEntityNotFound(_0x34171d,null))[_0x803e('0x1e')](saveUpdates(_0x2355bf[_0x803e('0x57')],null))[_0x803e('0x1e')](respondWithResult(_0x34171d,null))[_0x803e('0x52')](handleError(_0x34171d,null));};exports[_0x803e('0x33')]=function(_0x55167f,_0x144e3c){return db['DeskConfiguration']['find']({'where':{'id':_0x55167f[_0x803e('0x54')]['id']}})[_0x803e('0x1e')](handleEntityNotFound(_0x144e3c,null))['then'](removeEntity(_0x144e3c,null))[_0x803e('0x52')](handleError(_0x144e3c,null));};exports[_0x803e('0x58')]=function(_0x2a725a,_0x20da77,_0x5d3b41){var _0xcccae8={};var _0x48f367={};var _0x3ac299;var _0x4b43b1;return db[_0x803e('0x37')]['findOne']({'where':{'id':_0x2a725a[_0x803e('0x54')]['id']}})[_0x803e('0x1e')](handleEntityNotFound(_0x20da77,null))[_0x803e('0x1e')](function(_0x4b7541){if(_0x4b7541){_0x3ac299=_0x4b7541;_0x48f367[_0x803e('0x39')]=_[_0x803e('0x3a')](db[_0x803e('0x59')]['rawAttributes']);_0x48f367['query']=_[_0x803e('0x3a')](_0x2a725a[_0x803e('0x3b')]);_0x48f367[_0x803e('0x44')]=_[_0x803e('0x3c')](_0x48f367[_0x803e('0x39')],_0x48f367[_0x803e('0x3b')]);_0xcccae8[_0x803e('0x3d')]=_[_0x803e('0x3c')](_0x48f367[_0x803e('0x39')],qs[_0x803e('0x3e')](_0x2a725a['query']['fields']));_0xcccae8['attributes']=_0xcccae8[_0x803e('0x3d')][_0x803e('0x3f')]?_0xcccae8[_0x803e('0x3d')]:_0x48f367['model'];_0xcccae8[_0x803e('0x42')]=qs[_0x803e('0x5a')](_0x2a725a[_0x803e('0x3b')]['sort']);_0xcccae8[_0x803e('0x43')]=qs[_0x803e('0x44')](_[_0x803e('0x45')](_0x2a725a[_0x803e('0x3b')],_0x48f367[_0x803e('0x44')]));if(_0x2a725a[_0x803e('0x3b')][_0x803e('0x46')]){_0xcccae8[_0x803e('0x43')]=_['merge'](_0xcccae8['where'],{'$or':_['map'](_0xcccae8[_0x803e('0x3d')],function(_0x3c727a){var _0x6da3cc={};_0x6da3cc[_0x3c727a]={'$like':'%'+_0x2a725a[_0x803e('0x3b')][_0x803e('0x46')]+'%'};return _0x6da3cc;})});}_0xcccae8=_[_0x803e('0x47')]({},_0xcccae8,_0x2a725a[_0x803e('0x4d')]);return _0x3ac299['getFields'](_0xcccae8);}})[_0x803e('0x1e')](function(_0x3bc269){if(_0x3bc269){_0x4b43b1=_0x3bc269['length'];if(!_0x2a725a[_0x803e('0x3b')]['hasOwnProperty'](_0x803e('0x41'))){_0xcccae8[_0x803e('0x2e')]=qs[_0x803e('0x2e')](_0x2a725a[_0x803e('0x3b')][_0x803e('0x2e')]);_0xcccae8['offset']=qs['offset'](_0x2a725a[_0x803e('0x3b')][_0x803e('0x2d')]);}return _0x3ac299[_0x803e('0x58')](_0xcccae8);}})['then'](function(_0x549683){if(_0x549683){return _0x549683?{'count':_0x4b43b1,'rows':_0x549683}:null;}})[_0x803e('0x1e')](respondWithResult(_0x20da77,null))[_0x803e('0x52')](handleError(_0x20da77,null));};exports['getSubjects']=function(_0x3d1261,_0xe2dd9d,_0x3fded5){var _0x5c6f96={};var _0x34a220={};var _0x2f5d95;var _0x272198;return db[_0x803e('0x37')][_0x803e('0x5b')]({'where':{'id':_0x3d1261[_0x803e('0x54')]['id']}})[_0x803e('0x1e')](handleEntityNotFound(_0xe2dd9d,null))[_0x803e('0x1e')](function(_0x40d8db){if(_0x40d8db){_0x2f5d95=_0x40d8db;_0x34a220[_0x803e('0x39')]=_['keys'](db[_0x803e('0x59')][_0x803e('0x38')]);_0x34a220['query']=_['keys'](_0x3d1261['query']);_0x34a220[_0x803e('0x44')]=_[_0x803e('0x3c')](_0x34a220['model'],_0x34a220[_0x803e('0x3b')]);_0x5c6f96[_0x803e('0x3d')]=_[_0x803e('0x3c')](_0x34a220[_0x803e('0x39')],qs[_0x803e('0x3e')](_0x3d1261[_0x803e('0x3b')]['fields']));_0x5c6f96[_0x803e('0x3d')]=_0x5c6f96[_0x803e('0x3d')][_0x803e('0x3f')]?_0x5c6f96[_0x803e('0x3d')]:_0x34a220[_0x803e('0x39')];_0x5c6f96['order']=qs[_0x803e('0x5a')](_0x3d1261[_0x803e('0x3b')][_0x803e('0x5a')]);_0x5c6f96['where']=qs[_0x803e('0x44')](_[_0x803e('0x45')](_0x3d1261[_0x803e('0x3b')],_0x34a220[_0x803e('0x44')]));if(_0x3d1261['query'][_0x803e('0x46')]){_0x5c6f96[_0x803e('0x43')]=_[_0x803e('0x47')](_0x5c6f96[_0x803e('0x43')],{'$or':_['map'](_0x5c6f96['attributes'],function(_0x197a5e){var _0x49db3a={};_0x49db3a[_0x197a5e]={'$like':'%'+_0x3d1261['query']['filter']+'%'};return _0x49db3a;})});}_0x5c6f96=_[_0x803e('0x47')]({},_0x5c6f96,_0x3d1261[_0x803e('0x4d')]);return _0x2f5d95[_0x803e('0x5c')](_0x5c6f96);}})[_0x803e('0x1e')](function(_0x121b33){if(_0x121b33){_0x272198=_0x121b33[_0x803e('0x3f')];if(!_0x3d1261['query'][_0x803e('0x40')](_0x803e('0x41'))){_0x5c6f96[_0x803e('0x2e')]=qs[_0x803e('0x2e')](_0x3d1261[_0x803e('0x3b')]['limit']);_0x5c6f96[_0x803e('0x2d')]=qs[_0x803e('0x2d')](_0x3d1261[_0x803e('0x3b')][_0x803e('0x2d')]);}return _0x2f5d95['getSubjects'](_0x5c6f96);}})['then'](function(_0x281a55){if(_0x281a55){return _0x281a55?{'count':_0x272198,'rows':_0x281a55}:null;}})[_0x803e('0x1e')](respondWithResult(_0xe2dd9d,null))[_0x803e('0x52')](handleError(_0xe2dd9d,null));};exports[_0x803e('0x5d')]=function(_0x4496ff,_0xbfa67b,_0x2826f3){var _0x352cf2={};var _0x51a43d={};var _0x4c74bf;var _0x58c7dc;return db[_0x803e('0x37')][_0x803e('0x5b')]({'where':{'id':_0x4496ff[_0x803e('0x54')]['id']}})[_0x803e('0x1e')](handleEntityNotFound(_0xbfa67b,null))[_0x803e('0x1e')](function(_0x2d43bc){if(_0x2d43bc){_0x4c74bf=_0x2d43bc;_0x51a43d[_0x803e('0x39')]=_[_0x803e('0x3a')](db[_0x803e('0x59')][_0x803e('0x38')]);_0x51a43d[_0x803e('0x3b')]=_[_0x803e('0x3a')](_0x4496ff[_0x803e('0x3b')]);_0x51a43d[_0x803e('0x44')]=_['intersection'](_0x51a43d[_0x803e('0x39')],_0x51a43d[_0x803e('0x3b')]);_0x352cf2[_0x803e('0x3d')]=_[_0x803e('0x3c')](_0x51a43d[_0x803e('0x39')],qs[_0x803e('0x3e')](_0x4496ff['query'][_0x803e('0x3e')]));_0x352cf2[_0x803e('0x3d')]=_0x352cf2[_0x803e('0x3d')][_0x803e('0x3f')]?_0x352cf2[_0x803e('0x3d')]:_0x51a43d['model'];_0x352cf2[_0x803e('0x42')]=qs[_0x803e('0x5a')](_0x4496ff[_0x803e('0x3b')][_0x803e('0x5a')]);_0x352cf2[_0x803e('0x43')]=qs[_0x803e('0x44')](_[_0x803e('0x45')](_0x4496ff[_0x803e('0x3b')],_0x51a43d['filters']));if(_0x4496ff['query'][_0x803e('0x46')]){_0x352cf2[_0x803e('0x43')]=_[_0x803e('0x47')](_0x352cf2[_0x803e('0x43')],{'$or':_['map'](_0x352cf2[_0x803e('0x3d')],function(_0x4a0c65){var _0x5aaca6={};_0x5aaca6[_0x4a0c65]={'$like':'%'+_0x4496ff[_0x803e('0x3b')][_0x803e('0x46')]+'%'};return _0x5aaca6;})});}_0x352cf2=_[_0x803e('0x47')]({},_0x352cf2,_0x4496ff[_0x803e('0x4d')]);return _0x4c74bf[_0x803e('0x5d')](_0x352cf2);}})['then'](function(_0x485f02){if(_0x485f02){_0x58c7dc=_0x485f02[_0x803e('0x3f')];if(!_0x4496ff[_0x803e('0x3b')]['hasOwnProperty'](_0x803e('0x41'))){_0x352cf2[_0x803e('0x2e')]=qs[_0x803e('0x2e')](_0x4496ff[_0x803e('0x3b')][_0x803e('0x2e')]);_0x352cf2[_0x803e('0x2d')]=qs[_0x803e('0x2d')](_0x4496ff[_0x803e('0x3b')][_0x803e('0x2d')]);}return _0x4c74bf[_0x803e('0x5d')](_0x352cf2);}})[_0x803e('0x1e')](function(_0x12401e){if(_0x12401e){return _0x12401e?{'count':_0x58c7dc,'rows':_0x12401e}:null;}})[_0x803e('0x1e')](respondWithResult(_0xbfa67b,null))[_0x803e('0x52')](handleError(_0xbfa67b,null));};exports[_0x803e('0x5e')]=function(_0x2bda8b,_0xb0925b,_0x2a37f5){var _0x1c1d06={};var _0x98b523={};var _0x5e2986;var _0xbec12b;return db['DeskConfiguration'][_0x803e('0x5b')]({'where':{'id':_0x2bda8b[_0x803e('0x54')]['id']}})[_0x803e('0x1e')](handleEntityNotFound(_0xb0925b,null))[_0x803e('0x1e')](function(_0x3be454){if(_0x3be454){_0x5e2986=_0x3be454;_0x98b523[_0x803e('0x39')]=_[_0x803e('0x3a')](db[_0x803e('0x5f')][_0x803e('0x38')]);_0x98b523[_0x803e('0x3b')]=_[_0x803e('0x3a')](_0x2bda8b['query']);_0x98b523[_0x803e('0x44')]=_[_0x803e('0x3c')](_0x98b523[_0x803e('0x39')],_0x98b523['query']);_0x1c1d06['attributes']=_[_0x803e('0x3c')](_0x98b523[_0x803e('0x39')],qs['fields'](_0x2bda8b['query'][_0x803e('0x3e')]));_0x1c1d06[_0x803e('0x3d')]=_0x1c1d06['attributes']['length']?_0x1c1d06[_0x803e('0x3d')]:_0x98b523['model'];_0x1c1d06[_0x803e('0x42')]=qs[_0x803e('0x5a')](_0x2bda8b['query'][_0x803e('0x5a')]);_0x1c1d06[_0x803e('0x43')]=qs['filters'](_[_0x803e('0x45')](_0x2bda8b[_0x803e('0x3b')],_0x98b523[_0x803e('0x44')]));if(_0x2bda8b[_0x803e('0x3b')][_0x803e('0x46')]){_0x1c1d06['where']=_['merge'](_0x1c1d06[_0x803e('0x43')],{'$or':_[_0x803e('0x48')](_0x1c1d06['attributes'],function(_0x3a3dfd){var _0x11b9af={};_0x11b9af[_0x3a3dfd]={'$like':'%'+_0x2bda8b[_0x803e('0x3b')][_0x803e('0x46')]+'%'};return _0x11b9af;})});}_0x1c1d06=_[_0x803e('0x47')]({},_0x1c1d06,_0x2bda8b[_0x803e('0x4d')]);return _0x5e2986[_0x803e('0x5e')](_0x1c1d06);}})[_0x803e('0x1e')](function(_0x23029b){if(_0x23029b){_0xbec12b=_0x23029b[_0x803e('0x3f')];if(!_0x2bda8b['query'][_0x803e('0x40')](_0x803e('0x41'))){_0x1c1d06['limit']=qs['limit'](_0x2bda8b['query']['limit']);_0x1c1d06[_0x803e('0x2d')]=qs[_0x803e('0x2d')](_0x2bda8b[_0x803e('0x3b')][_0x803e('0x2d')]);}return _0x5e2986[_0x803e('0x5e')](_0x1c1d06);}})[_0x803e('0x1e')](function(_0x42a951){if(_0x42a951){return _0x42a951?{'count':_0xbec12b,'rows':_0x42a951}:null;}})[_0x803e('0x1e')](respondWithResult(_0xb0925b,null))[_0x803e('0x52')](handleError(_0xb0925b,null));};exports['setTags']=function(_0x33045b,_0x358efc,_0x200e46){if(_0x33045b[_0x803e('0x57')]['id']){delete _0x33045b[_0x803e('0x57')]['id'];}return db[_0x803e('0x37')]['findOne']({'where':{'id':_0x33045b[_0x803e('0x54')]['id']}})['then'](handleEntityNotFound(_0x358efc,null))[_0x803e('0x1e')](function(_0x409ef9){if(_0x409ef9){return _0x409ef9[_0x803e('0x60')](_0x33045b['body'][_0x803e('0x61')]||[]);}return null;})['then'](respondWithResult(_0x358efc,null))[_0x803e('0x52')](handleError(_0x358efc,null));}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.model.js b/server/api/intDeskConfiguration/intDeskConfiguration.model.js index a957c84..48ba0d5 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 _0x3e8c=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./intDeskConfiguration.attributes','exports','define','DeskConfiguration','int_desk_configurations','lodash','util'];(function(_0x1f047e,_0x23b312){var _0x206db5=function(_0xe06955){while(--_0xe06955){_0x1f047e['push'](_0x1f047e['shift']());}};_0x206db5(++_0x23b312);}(_0x3e8c,0xa6));var _0xc3e8=function(_0x215105,_0xfaa09f){_0x215105=_0x215105-0x0;var _0x582de6=_0x3e8c[_0x215105];return _0x582de6;};'use strict';var _=require(_0xc3e8('0x0'));var util=require(_0xc3e8('0x1'));var logger=require(_0xc3e8('0x2'))(_0xc3e8('0x3'));var moment=require(_0xc3e8('0x4'));var BPromise=require(_0xc3e8('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc3e8('0x6'));var rimraf=require(_0xc3e8('0x7'));var config=require(_0xc3e8('0x8'));var attributes=require(_0xc3e8('0x9'));module[_0xc3e8('0xa')]=function(_0x35f85c,_0xf8c8d8){return _0x35f85c[_0xc3e8('0xb')](_0xc3e8('0xc'),attributes,{'tableName':_0xc3e8('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x53b1=['exports','define','DeskConfiguration','int_desk_configurations','lodash','util','../../config/logger','api','moment','request-promise','path','../../config/environment','./intDeskConfiguration.attributes'];(function(_0x496766,_0x12b75b){var _0x440b75=function(_0x579dc0){while(--_0x579dc0){_0x496766['push'](_0x496766['shift']());}};_0x440b75(++_0x12b75b);}(_0x53b1,0xd4));var _0x153b=function(_0x5b100c,_0xb87d7e){_0x5b100c=_0x5b100c-0x0;var _0x945d45=_0x53b1[_0x5b100c];return _0x945d45;};'use strict';var _=require(_0x153b('0x0'));var util=require(_0x153b('0x1'));var logger=require(_0x153b('0x2'))(_0x153b('0x3'));var moment=require(_0x153b('0x4'));var BPromise=require('bluebird');var rp=require(_0x153b('0x5'));var fs=require('fs');var path=require(_0x153b('0x6'));var rimraf=require('rimraf');var config=require(_0x153b('0x7'));var attributes=require(_0x153b('0x8'));module[_0x153b('0x9')]=function(_0x61ce1f,_0x828b9b){return _0x61ce1f[_0x153b('0xa')](_0x153b('0xb'),attributes,{'tableName':_0x153b('0xc'),'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 7a0d125..57be9d9 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 _0xb07f=['catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result'];(function(_0x264dc1,_0x2565db){var _0x5dab5e=function(_0x3aa3c9){while(--_0x3aa3c9){_0x264dc1['push'](_0x264dc1['shift']());}};_0x5dab5e(++_0x2565db);}(_0xb07f,0x109));var _0xfb07=function(_0x46e7ae,_0x1ecf22){_0x46e7ae=_0x46e7ae-0x0;var _0x24949a=_0xb07f[_0x46e7ae];return _0x24949a;};'use strict';var _=require(_0xfb07('0x0'));var util=require(_0xfb07('0x1'));var moment=require(_0xfb07('0x2'));var BPromise=require(_0xfb07('0x3'));var rs=require(_0xfb07('0x4'));var fs=require('fs');var Redis=require(_0xfb07('0x5'));var db=require(_0xfb07('0x6'))['db'];var utils=require(_0xfb07('0x7'));var logger=require(_0xfb07('0x8'))(_0xfb07('0x9'));var config=require(_0xfb07('0xa'));var jayson=require('jayson/promise');var client=jayson[_0xfb07('0xb')][_0xfb07('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x14fc69,_0x1efe64,_0x41d73a){return new BPromise(function(_0x3bb9cf,_0x2b5000){return client[_0xfb07('0xd')](_0x14fc69,_0x41d73a)[_0xfb07('0xe')](function(_0x3d7220){logger[_0xfb07('0xf')](_0xfb07('0x10'),_0x1efe64,'request\x20sent');logger['debug']('DeskConfiguration,\x20%s,\x20%s,\x20%s',_0x1efe64,_0xfb07('0x11'),JSON[_0xfb07('0x12')](_0x3d7220));if(_0x3d7220['error']){if(_0x3d7220[_0xfb07('0x13')][_0xfb07('0x14')]===0x1f4){logger[_0xfb07('0x13')](_0xfb07('0x10'),_0x1efe64,_0x3d7220[_0xfb07('0x13')][_0xfb07('0x15')]);return _0x2b5000(_0x3d7220[_0xfb07('0x13')]['message']);}logger[_0xfb07('0x13')](_0xfb07('0x10'),_0x1efe64,_0x3d7220[_0xfb07('0x13')][_0xfb07('0x15')]);return _0x3bb9cf(_0x3d7220[_0xfb07('0x13')][_0xfb07('0x15')]);}else{logger[_0xfb07('0xf')](_0xfb07('0x10'),_0x1efe64,_0xfb07('0x11'));_0x3bb9cf(_0x3d7220[_0xfb07('0x16')][_0xfb07('0x15')]);}})[_0xfb07('0x17')](function(_0x1e42c4){logger[_0xfb07('0x13')]('DeskConfiguration,\x20%s,\x20%s',_0x1efe64,_0x1e42c4);_0x2b5000(_0x1e42c4);});});} \ No newline at end of file +var _0x8fcf=['client','http','request','then','info','DeskConfiguration,\x20%s,\x20%s','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x44039a,_0x2ac8a8){var _0x525de5=function(_0x1dc635){while(--_0x1dc635){_0x44039a['push'](_0x44039a['shift']());}};_0x525de5(++_0x2ac8a8);}(_0x8fcf,0x1db));var _0xf8fc=function(_0x2e12ba,_0xe13185){_0x2e12ba=_0x2e12ba-0x0;var _0x31bd1f=_0x8fcf[_0x2e12ba];return _0x31bd1f;};'use strict';var _=require(_0xf8fc('0x0'));var util=require(_0xf8fc('0x1'));var moment=require(_0xf8fc('0x2'));var BPromise=require('bluebird');var rs=require(_0xf8fc('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xf8fc('0x4'))(_0xf8fc('0x5'));var config=require(_0xf8fc('0x6'));var jayson=require(_0xf8fc('0x7'));var client=jayson[_0xf8fc('0x8')][_0xf8fc('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1448de,_0x43719b,_0x59c401){return new BPromise(function(_0x13c2a7,_0x5b91e9){return client[_0xf8fc('0xa')](_0x1448de,_0x59c401)[_0xf8fc('0xb')](function(_0xf2e390){logger[_0xf8fc('0xc')](_0xf8fc('0xd'),_0x43719b,'request\x20sent');logger[_0xf8fc('0xe')](_0xf8fc('0xf'),_0x43719b,'request\x20sent',JSON[_0xf8fc('0x10')](_0xf2e390));if(_0xf2e390[_0xf8fc('0x11')]){if(_0xf2e390[_0xf8fc('0x11')][_0xf8fc('0x12')]===0x1f4){logger[_0xf8fc('0x11')](_0xf8fc('0xd'),_0x43719b,_0xf2e390['error'][_0xf8fc('0x13')]);return _0x5b91e9(_0xf2e390[_0xf8fc('0x11')][_0xf8fc('0x13')]);}logger[_0xf8fc('0x11')]('DeskConfiguration,\x20%s,\x20%s',_0x43719b,_0xf2e390['error']['message']);return _0x13c2a7(_0xf2e390['error'][_0xf8fc('0x13')]);}else{logger[_0xf8fc('0xc')](_0xf8fc('0xd'),_0x43719b,_0xf8fc('0x14'));_0x13c2a7(_0xf2e390[_0xf8fc('0x15')]['message']);}})[_0xf8fc('0x16')](function(_0x3230cc){logger[_0xf8fc('0x11')](_0xf8fc('0xd'),_0x43719b,_0x3230cc);_0x5b91e9(_0x3230cc);});});} \ No newline at end of file diff --git a/server/api/intDeskField/index.js b/server/api/intDeskField/index.js index 39ddf0f..7dfc542 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 _0x37a6=['destroy','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','/:id','show','post','create','put','update','delete'];(function(_0x2f0ae8,_0x2bd1c4){var _0x1e7b13=function(_0x457957){while(--_0x457957){_0x2f0ae8['push'](_0x2f0ae8['shift']());}};_0x1e7b13(++_0x2bd1c4);}(_0x37a6,0x89));var _0x637a=function(_0x5e76dc,_0x3308a5){_0x5e76dc=_0x5e76dc-0x0;var _0x4b4d62=_0x37a6[_0x5e76dc];return _0x4b4d62;};'use strict';var multer=require(_0x637a('0x0'));var util=require(_0x637a('0x1'));var path=require(_0x637a('0x2'));var timeout=require('connect-timeout');var express=require(_0x637a('0x3'));var router=express[_0x637a('0x4')]();var auth=require(_0x637a('0x5'));var interaction=require(_0x637a('0x6'));var config=require(_0x637a('0x7'));var controller=require('./intDeskField.controller');router['get']('/',auth[_0x637a('0x8')](),controller['index']);router['get'](_0x637a('0x9'),auth[_0x637a('0x8')](),controller[_0x637a('0xa')]);router[_0x637a('0xb')]('/',auth[_0x637a('0x8')](),controller[_0x637a('0xc')]);router[_0x637a('0xd')](_0x637a('0x9'),auth['isAuthenticated'](),controller[_0x637a('0xe')]);router[_0x637a('0xf')](_0x637a('0x9'),auth['isAuthenticated'](),controller[_0x637a('0x10')]);module['exports']=router; \ No newline at end of file +var _0x8279=['get','/:id','isAuthenticated','show','post','create','delete','destroy','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskField.controller','index'];(function(_0x3aaf84,_0xe8513c){var _0x47d79b=function(_0x256a36){while(--_0x256a36){_0x3aaf84['push'](_0x3aaf84['shift']());}};_0x47d79b(++_0xe8513c);}(_0x8279,0x128));var _0x9827=function(_0x157a8c,_0xe50d9b){_0x157a8c=_0x157a8c-0x0;var _0x4ce5fb=_0x8279[_0x157a8c];return _0x4ce5fb;};'use strict';var multer=require('multer');var util=require(_0x9827('0x0'));var path=require(_0x9827('0x1'));var timeout=require(_0x9827('0x2'));var express=require(_0x9827('0x3'));var router=express[_0x9827('0x4')]();var auth=require(_0x9827('0x5'));var interaction=require(_0x9827('0x6'));var config=require(_0x9827('0x7'));var controller=require(_0x9827('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x9827('0x9')]);router[_0x9827('0xa')](_0x9827('0xb'),auth[_0x9827('0xc')](),controller[_0x9827('0xd')]);router[_0x9827('0xe')]('/',auth[_0x9827('0xc')](),controller[_0x9827('0xf')]);router['put']('/:id',auth[_0x9827('0xc')](),controller['update']);router[_0x9827('0x10')](_0x9827('0xb'),auth[_0x9827('0xc')](),controller[_0x9827('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.attributes.js b/server/api/intDeskField/intDeskField.attributes.js index e7c227a..1f8b746 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 _0xec55=['variable','customVariable','STRING','sequelize','exports','ENUM'];(function(_0x40570e,_0x53df30){var _0x16336a=function(_0x227e0b){while(--_0x227e0b){_0x40570e['push'](_0x40570e['shift']());}};_0x16336a(++_0x53df30);}(_0xec55,0x9f));var _0x5ec5=function(_0x6325ee,_0x12258d){_0x6325ee=_0x6325ee-0x0;var _0x4c76e5=_0xec55[_0x6325ee];return _0x4c76e5;};'use strict';var Sequelize=require(_0x5ec5('0x0'));module[_0x5ec5('0x1')]={'type':{'type':Sequelize[_0x5ec5('0x2')]('string',_0x5ec5('0x3'),_0x5ec5('0x4'),'keyValue'),'defaultValue':'string'},'content':{'type':Sequelize[_0x5ec5('0x5')]},'key':{'type':Sequelize[_0x5ec5('0x5')]},'keyType':{'type':Sequelize['ENUM']('string',_0x5ec5('0x3'),'customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x5ec5('0x5')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x5ec5('0x5')]}}; \ No newline at end of file +var _0xce34=['sequelize','exports','string','variable','keyValue','STRING','ENUM','customVariable','BOOLEAN'];(function(_0xba863,_0x155cec){var _0x4cdd40=function(_0x139861){while(--_0x139861){_0xba863['push'](_0xba863['shift']());}};_0x4cdd40(++_0x155cec);}(_0xce34,0x129));var _0x4ce3=function(_0x3e30bf,_0x35c85d){_0x3e30bf=_0x3e30bf-0x0;var _0xf102ef=_0xce34[_0x3e30bf];return _0xf102ef;};'use strict';var Sequelize=require(_0x4ce3('0x0'));module[_0x4ce3('0x1')]={'type':{'type':Sequelize['ENUM'](_0x4ce3('0x2'),_0x4ce3('0x3'),'customVariable',_0x4ce3('0x4')),'defaultValue':_0x4ce3('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x4ce3('0x5')]},'keyType':{'type':Sequelize[_0x4ce3('0x6')](_0x4ce3('0x2'),_0x4ce3('0x3'),_0x4ce3('0x7'))},'keyContent':{'type':Sequelize[_0x4ce3('0x5')]},'idField':{'type':Sequelize[_0x4ce3('0x5')]},'nameField':{'type':Sequelize[_0x4ce3('0x5')]},'customField':{'type':Sequelize[_0x4ce3('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x4ce3('0x5')]}}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.controller.js b/server/api/intDeskField/intDeskField.controller.js index 9bd2cdb..c09dcaf 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 _0x8b2e=['params','html-pdf','rimraf','zip-dir','request-promise','moment','bluebird','path','sox','lodash','squel','crypto','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','status','end','json','count','offset','limit','Content-Range','apply','reject','save','then','sendStatus','error','stack','name','send','index','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','sort','filter','merge','map','type','key','field','where','DeskField','includeAll','include','findAll','rows','catch','show','rawAttributes','options','find','create','body'];(function(_0x310dd2,_0x29e72a){var _0x2d8598=function(_0x39a0d0){while(--_0x39a0d0){_0x310dd2['push'](_0x310dd2['shift']());}};_0x2d8598(++_0x29e72a);}(_0x8b2e,0x10d));var _0xe8b2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8b2e[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require(_0xe8b2('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xe8b2('0x1'));var zipdir=require(_0xe8b2('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe8b2('0x3'));var moment=require(_0xe8b2('0x4'));var BPromise=require(_0xe8b2('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xe8b2('0x6'));var sox=require(_0xe8b2('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0xe8b2('0x8'));var squel=require(_0xe8b2('0x9'));var crypto=require(_0xe8b2('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xe8b2('0xb'));var querystring=require(_0xe8b2('0xc'));var Papa=require('papaparse');var Redis=require(_0xe8b2('0xd'));var authService=require(_0xe8b2('0xe'));var qs=require(_0xe8b2('0xf'));var as=require(_0xe8b2('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe8b2('0x11'))(_0xe8b2('0x12'));var utils=require(_0xe8b2('0x13'));var config=require('../../config/environment');var db=require(_0xe8b2('0x14'))['db'];function respondWithStatusCode(_0x1e38ed,_0x4c7527){_0x4c7527=_0x4c7527||0xcc;return function(_0x2c1515){if(_0x2c1515){return _0x1e38ed['sendStatus'](_0x4c7527);}return _0x1e38ed[_0xe8b2('0x15')](_0x4c7527)[_0xe8b2('0x16')]();};}function respondWithResult(_0x1169bb,_0x1c84ea){_0x1c84ea=_0x1c84ea||0xc8;return function(_0x37c403){if(_0x37c403){return _0x1169bb[_0xe8b2('0x15')](_0x1c84ea)[_0xe8b2('0x17')](_0x37c403);}};}function respondWithFilteredResult(_0x3d289b,_0x227f3b){return function(_0x56e801){if(_0x56e801){var _0xfe9dd3=_0x56e801[_0xe8b2('0x18')],_0x59009a=_0x227f3b[_0xe8b2('0x19')],_0x4c7ac3=_0x227f3b['offset']+_0x227f3b[_0xe8b2('0x1a')],_0x425fed;if(_0x4c7ac3>=_0xfe9dd3){_0x4c7ac3=_0xfe9dd3;_0x425fed=0xc8;}else{_0x425fed=0xce;}_0x3d289b[_0xe8b2('0x15')](_0x425fed);return _0x3d289b['set'](_0xe8b2('0x1b'),_0x59009a+'-'+_0x4c7ac3+'/'+_0xfe9dd3)[_0xe8b2('0x17')](_0x56e801);}return null;};}function patchUpdates(_0x98767a){return function(_0x38c66d){try{jsonpatch[_0xe8b2('0x1c')](_0x38c66d,_0x98767a,!![]);}catch(_0x579bfe){return BPromise[_0xe8b2('0x1d')](_0x579bfe);}return _0x38c66d[_0xe8b2('0x1e')]();};}function saveUpdates(_0x4ccc76,_0x2c961e){return function(_0x4b0912){if(_0x4b0912){return _0x4b0912['update'](_0x4ccc76)[_0xe8b2('0x1f')](function(_0x44e7a7){return _0x44e7a7;});}return null;};}function removeEntity(_0x40b7a0,_0x2d7bc3){return function(_0x2a3c42){if(_0x2a3c42){return _0x2a3c42['destroy']()[_0xe8b2('0x1f')](function(){_0x40b7a0[_0xe8b2('0x15')](0xcc)[_0xe8b2('0x16')]();});}};}function handleEntityNotFound(_0x12c91e,_0x462847){return function(_0x5889fb){if(!_0x5889fb){_0x12c91e[_0xe8b2('0x20')](0x194);}return _0x5889fb;};}function handleError(_0x3e23c3,_0x45559e){_0x45559e=_0x45559e||0x1f4;return function(_0x1b864a){logger[_0xe8b2('0x21')](_0x1b864a[_0xe8b2('0x22')]);if(_0x1b864a[_0xe8b2('0x23')]){delete _0x1b864a['name'];}_0x3e23c3['status'](_0x45559e)[_0xe8b2('0x24')](_0x1b864a);};}exports[_0xe8b2('0x25')]=function(_0x69d7d5,_0x192a75){var _0x5216da={},_0x299390={},_0x319012={'count':0x0,'rows':[]};var _0x3192e5=db['DeskField']['rawAttributes'];_0x299390[_0xe8b2('0x26')]=_['keys'](_0x3192e5);_0x299390[_0xe8b2('0x27')]=_[_0xe8b2('0x28')](_0x69d7d5[_0xe8b2('0x27')]);_0x299390[_0xe8b2('0x29')]=_['intersection'](_0x299390[_0xe8b2('0x26')],_0x299390[_0xe8b2('0x27')]);_0x5216da['attributes']=_[_0xe8b2('0x2a')](_0x299390[_0xe8b2('0x26')],qs[_0xe8b2('0x2b')](_0x69d7d5[_0xe8b2('0x27')][_0xe8b2('0x2b')]));_0x5216da[_0xe8b2('0x2c')]=_0x5216da[_0xe8b2('0x2c')]['length']?_0x5216da[_0xe8b2('0x2c')]:_0x299390['model'];if(!_0x69d7d5['query'][_0xe8b2('0x2d')]('nolimit')){_0x5216da[_0xe8b2('0x1a')]=qs[_0xe8b2('0x1a')](_0x69d7d5[_0xe8b2('0x27')]['limit']);_0x5216da['offset']=qs['offset'](_0x69d7d5[_0xe8b2('0x27')][_0xe8b2('0x19')]);}_0x5216da['order']=qs[_0xe8b2('0x2e')](_0x69d7d5[_0xe8b2('0x27')][_0xe8b2('0x2e')]);_0x5216da['where']=qs['filters'](_['pick'](_0x69d7d5['query'],_0x299390[_0xe8b2('0x29')]));if(_0x69d7d5[_0xe8b2('0x27')][_0xe8b2('0x2f')]){_0x5216da['where']=_[_0xe8b2('0x30')](_0x5216da['where'],{'$or':_[_0xe8b2('0x31')](_0x3192e5,function(_0x240c3d){if(_0x240c3d[_0xe8b2('0x32')][_0xe8b2('0x33')]!=='VIRTUAL'){var _0x356f5e={};_0x356f5e[_0x240c3d[_0xe8b2('0x34')]]={'$like':'%'+_0x69d7d5[_0xe8b2('0x27')]['filter']+'%'};return _0x356f5e;}})});}_0x5216da=_['merge']({},_0x5216da,_0x69d7d5['options']);var _0xb9f147={'where':_0x5216da[_0xe8b2('0x35')]};return db[_0xe8b2('0x36')]['count'](_0xb9f147)[_0xe8b2('0x1f')](function(_0x222621){_0x319012[_0xe8b2('0x18')]=_0x222621;if(_0x69d7d5[_0xe8b2('0x27')][_0xe8b2('0x37')]){_0x5216da[_0xe8b2('0x38')]=[{'all':!![]}];}return db['DeskField'][_0xe8b2('0x39')](_0x5216da);})[_0xe8b2('0x1f')](function(_0x442b74){_0x319012[_0xe8b2('0x3a')]=_0x442b74;return _0x319012;})[_0xe8b2('0x1f')](respondWithFilteredResult(_0x192a75,_0x5216da))[_0xe8b2('0x3b')](handleError(_0x192a75,null));};exports[_0xe8b2('0x3c')]=function(_0x4ac843,_0x4c7857){var _0x1ea6ab={'raw':!![],'where':{'id':_0x4ac843['params']['id']}},_0x62ab85={};_0x62ab85[_0xe8b2('0x26')]=_['keys'](db[_0xe8b2('0x36')][_0xe8b2('0x3d')]);_0x62ab85[_0xe8b2('0x27')]=_['keys'](_0x4ac843[_0xe8b2('0x27')]);_0x62ab85['filters']=_['intersection'](_0x62ab85[_0xe8b2('0x26')],_0x62ab85['query']);_0x1ea6ab[_0xe8b2('0x2c')]=_[_0xe8b2('0x2a')](_0x62ab85[_0xe8b2('0x26')],qs['fields'](_0x4ac843[_0xe8b2('0x27')][_0xe8b2('0x2b')]));_0x1ea6ab[_0xe8b2('0x2c')]=_0x1ea6ab[_0xe8b2('0x2c')]['length']?_0x1ea6ab['attributes']:_0x62ab85[_0xe8b2('0x26')];if(_0x4ac843[_0xe8b2('0x27')]['includeAll']){_0x1ea6ab[_0xe8b2('0x38')]=[{'all':!![]}];}_0x1ea6ab=_['merge']({},_0x1ea6ab,_0x4ac843[_0xe8b2('0x3e')]);return db[_0xe8b2('0x36')][_0xe8b2('0x3f')](_0x1ea6ab)[_0xe8b2('0x1f')](handleEntityNotFound(_0x4c7857,null))['then'](respondWithResult(_0x4c7857,null))[_0xe8b2('0x3b')](handleError(_0x4c7857,null));};exports[_0xe8b2('0x40')]=function(_0xc6feeb,_0x23db05){return db[_0xe8b2('0x36')][_0xe8b2('0x40')](_0xc6feeb[_0xe8b2('0x41')],{})[_0xe8b2('0x1f')](respondWithResult(_0x23db05,0xc9))['catch'](handleError(_0x23db05,null));};exports['update']=function(_0x19ee90,_0x3d36ec){if(_0x19ee90['body']['id']){delete _0x19ee90[_0xe8b2('0x41')]['id'];}return db[_0xe8b2('0x36')][_0xe8b2('0x3f')]({'where':{'id':_0x19ee90[_0xe8b2('0x42')]['id']}})[_0xe8b2('0x1f')](handleEntityNotFound(_0x3d36ec,null))[_0xe8b2('0x1f')](saveUpdates(_0x19ee90[_0xe8b2('0x41')],null))[_0xe8b2('0x1f')](respondWithResult(_0x3d36ec,null))[_0xe8b2('0x3b')](handleError(_0x3d36ec,null));};exports['destroy']=function(_0x4cd419,_0xbdf3f8){return db[_0xe8b2('0x36')][_0xe8b2('0x3f')]({'where':{'id':_0x4cd419['params']['id']}})[_0xe8b2('0x1f')](handleEntityNotFound(_0xbdf3f8,null))['then'](removeEntity(_0xbdf3f8,null))[_0xe8b2('0x3b')](handleError(_0xbdf3f8,null));}; \ No newline at end of file +var _0xef22=['find','create','body','html-pdf','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','lodash','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','sendStatus','status','end','json','count','offset','set','Content-Range','apply','save','update','destroy','then','stack','name','send','index','DeskField','model','query','keys','filters','intersection','fields','length','attributes','nolimit','limit','sort','where','pick','merge','map','key','VIRTUAL','filter','includeAll','include','findAll','catch','show','params','rawAttributes','options'];(function(_0x5c7cc0,_0x89e186){var _0x390161=function(_0x110c82){while(--_0x110c82){_0x5c7cc0['push'](_0x5c7cc0['shift']());}};_0x390161(++_0x89e186);}(_0xef22,0x189));var _0x2ef2=function(_0xbb091,_0x3fe7ee){_0xbb091=_0xbb091-0x0;var _0x467a04=_0xef22[_0xbb091];return _0x467a04;};'use strict';var pdf=require(_0x2ef2('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x2ef2('0x1'));var zipdir=require(_0x2ef2('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x2ef2('0x3'));var BPromise=require(_0x2ef2('0x4'));var Mustache=require(_0x2ef2('0x5'));var util=require(_0x2ef2('0x6'));var path=require(_0x2ef2('0x7'));var sox=require(_0x2ef2('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x2ef2('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x2ef2('0xa'));var querystring=require(_0x2ef2('0xb'));var Papa=require(_0x2ef2('0xc'));var Redis=require(_0x2ef2('0xd'));var authService=require(_0x2ef2('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x2ef2('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x2ef2('0x10'));var utils=require(_0x2ef2('0x11'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x12942a,_0x4eacd3){_0x4eacd3=_0x4eacd3||0xcc;return function(_0x12b342){if(_0x12b342){return _0x12942a[_0x2ef2('0x12')](_0x4eacd3);}return _0x12942a[_0x2ef2('0x13')](_0x4eacd3)[_0x2ef2('0x14')]();};}function respondWithResult(_0x382bce,_0x4e58e7){_0x4e58e7=_0x4e58e7||0xc8;return function(_0x3eaaa0){if(_0x3eaaa0){return _0x382bce[_0x2ef2('0x13')](_0x4e58e7)[_0x2ef2('0x15')](_0x3eaaa0);}};}function respondWithFilteredResult(_0x2a0fa6,_0x509117){return function(_0x1748fe){if(_0x1748fe){var _0x5a74ea=_0x1748fe[_0x2ef2('0x16')],_0x2d04e3=_0x509117[_0x2ef2('0x17')],_0x51b92a=_0x509117[_0x2ef2('0x17')]+_0x509117['limit'],_0x15ffa4;if(_0x51b92a>=_0x5a74ea){_0x51b92a=_0x5a74ea;_0x15ffa4=0xc8;}else{_0x15ffa4=0xce;}_0x2a0fa6['status'](_0x15ffa4);return _0x2a0fa6[_0x2ef2('0x18')](_0x2ef2('0x19'),_0x2d04e3+'-'+_0x51b92a+'/'+_0x5a74ea)[_0x2ef2('0x15')](_0x1748fe);}return null;};}function patchUpdates(_0x332970){return function(_0x49ad2a){try{jsonpatch[_0x2ef2('0x1a')](_0x49ad2a,_0x332970,!![]);}catch(_0x3e5dd8){return BPromise['reject'](_0x3e5dd8);}return _0x49ad2a[_0x2ef2('0x1b')]();};}function saveUpdates(_0x172827,_0x50005f){return function(_0x1f52da){if(_0x1f52da){return _0x1f52da[_0x2ef2('0x1c')](_0x172827)['then'](function(_0x2a24b5){return _0x2a24b5;});}return null;};}function removeEntity(_0x48ea0a,_0x1e3a1b){return function(_0x415afd){if(_0x415afd){return _0x415afd[_0x2ef2('0x1d')]()[_0x2ef2('0x1e')](function(){_0x48ea0a['status'](0xcc)[_0x2ef2('0x14')]();});}};}function handleEntityNotFound(_0x5c7f58,_0x4aea53){return function(_0x164644){if(!_0x164644){_0x5c7f58[_0x2ef2('0x12')](0x194);}return _0x164644;};}function handleError(_0x7a0125,_0x7c3f66){_0x7c3f66=_0x7c3f66||0x1f4;return function(_0x4d2eb9){logger['error'](_0x4d2eb9[_0x2ef2('0x1f')]);if(_0x4d2eb9[_0x2ef2('0x20')]){delete _0x4d2eb9[_0x2ef2('0x20')];}_0x7a0125[_0x2ef2('0x13')](_0x7c3f66)[_0x2ef2('0x21')](_0x4d2eb9);};}exports[_0x2ef2('0x22')]=function(_0x262b4f,_0x222b5b){var _0x27d418={},_0x25bdde={},_0x2144d7={'count':0x0,'rows':[]};var _0x4b1d0c=db[_0x2ef2('0x23')]['rawAttributes'];_0x25bdde[_0x2ef2('0x24')]=_['keys'](_0x4b1d0c);_0x25bdde[_0x2ef2('0x25')]=_[_0x2ef2('0x26')](_0x262b4f['query']);_0x25bdde[_0x2ef2('0x27')]=_[_0x2ef2('0x28')](_0x25bdde['model'],_0x25bdde['query']);_0x27d418['attributes']=_[_0x2ef2('0x28')](_0x25bdde[_0x2ef2('0x24')],qs['fields'](_0x262b4f[_0x2ef2('0x25')][_0x2ef2('0x29')]));_0x27d418['attributes']=_0x27d418['attributes'][_0x2ef2('0x2a')]?_0x27d418[_0x2ef2('0x2b')]:_0x25bdde[_0x2ef2('0x24')];if(!_0x262b4f[_0x2ef2('0x25')]['hasOwnProperty'](_0x2ef2('0x2c'))){_0x27d418[_0x2ef2('0x2d')]=qs['limit'](_0x262b4f[_0x2ef2('0x25')][_0x2ef2('0x2d')]);_0x27d418[_0x2ef2('0x17')]=qs[_0x2ef2('0x17')](_0x262b4f[_0x2ef2('0x25')][_0x2ef2('0x17')]);}_0x27d418['order']=qs[_0x2ef2('0x2e')](_0x262b4f[_0x2ef2('0x25')][_0x2ef2('0x2e')]);_0x27d418[_0x2ef2('0x2f')]=qs[_0x2ef2('0x27')](_[_0x2ef2('0x30')](_0x262b4f[_0x2ef2('0x25')],_0x25bdde['filters']));if(_0x262b4f['query']['filter']){_0x27d418[_0x2ef2('0x2f')]=_[_0x2ef2('0x31')](_0x27d418[_0x2ef2('0x2f')],{'$or':_[_0x2ef2('0x32')](_0x4b1d0c,function(_0x2fe34f){if(_0x2fe34f['type'][_0x2ef2('0x33')]!==_0x2ef2('0x34')){var _0x41a8de={};_0x41a8de[_0x2fe34f['field']]={'$like':'%'+_0x262b4f['query'][_0x2ef2('0x35')]+'%'};return _0x41a8de;}})});}_0x27d418=_[_0x2ef2('0x31')]({},_0x27d418,_0x262b4f['options']);var _0x24954c={'where':_0x27d418[_0x2ef2('0x2f')]};return db['DeskField'][_0x2ef2('0x16')](_0x24954c)[_0x2ef2('0x1e')](function(_0x4bb817){_0x2144d7[_0x2ef2('0x16')]=_0x4bb817;if(_0x262b4f[_0x2ef2('0x25')][_0x2ef2('0x36')]){_0x27d418[_0x2ef2('0x37')]=[{'all':!![]}];}return db[_0x2ef2('0x23')][_0x2ef2('0x38')](_0x27d418);})[_0x2ef2('0x1e')](function(_0x4ce1a3){_0x2144d7['rows']=_0x4ce1a3;return _0x2144d7;})[_0x2ef2('0x1e')](respondWithFilteredResult(_0x222b5b,_0x27d418))[_0x2ef2('0x39')](handleError(_0x222b5b,null));};exports[_0x2ef2('0x3a')]=function(_0xaa1bca,_0x255d33){var _0x931f58={'raw':!![],'where':{'id':_0xaa1bca[_0x2ef2('0x3b')]['id']}},_0x335197={};_0x335197['model']=_['keys'](db[_0x2ef2('0x23')][_0x2ef2('0x3c')]);_0x335197[_0x2ef2('0x25')]=_[_0x2ef2('0x26')](_0xaa1bca[_0x2ef2('0x25')]);_0x335197[_0x2ef2('0x27')]=_[_0x2ef2('0x28')](_0x335197[_0x2ef2('0x24')],_0x335197[_0x2ef2('0x25')]);_0x931f58['attributes']=_[_0x2ef2('0x28')](_0x335197[_0x2ef2('0x24')],qs['fields'](_0xaa1bca['query'][_0x2ef2('0x29')]));_0x931f58[_0x2ef2('0x2b')]=_0x931f58[_0x2ef2('0x2b')][_0x2ef2('0x2a')]?_0x931f58[_0x2ef2('0x2b')]:_0x335197[_0x2ef2('0x24')];if(_0xaa1bca[_0x2ef2('0x25')][_0x2ef2('0x36')]){_0x931f58[_0x2ef2('0x37')]=[{'all':!![]}];}_0x931f58=_[_0x2ef2('0x31')]({},_0x931f58,_0xaa1bca[_0x2ef2('0x3d')]);return db['DeskField'][_0x2ef2('0x3e')](_0x931f58)[_0x2ef2('0x1e')](handleEntityNotFound(_0x255d33,null))[_0x2ef2('0x1e')](respondWithResult(_0x255d33,null))[_0x2ef2('0x39')](handleError(_0x255d33,null));};exports['create']=function(_0x4ad3e0,_0x3ea334){return db[_0x2ef2('0x23')][_0x2ef2('0x3f')](_0x4ad3e0[_0x2ef2('0x40')],{})[_0x2ef2('0x1e')](respondWithResult(_0x3ea334,0xc9))[_0x2ef2('0x39')](handleError(_0x3ea334,null));};exports[_0x2ef2('0x1c')]=function(_0x3b718f,_0x2c7211){if(_0x3b718f['body']['id']){delete _0x3b718f[_0x2ef2('0x40')]['id'];}return db['DeskField'][_0x2ef2('0x3e')]({'where':{'id':_0x3b718f['params']['id']}})['then'](handleEntityNotFound(_0x2c7211,null))[_0x2ef2('0x1e')](saveUpdates(_0x3b718f[_0x2ef2('0x40')],null))['then'](respondWithResult(_0x2c7211,null))[_0x2ef2('0x39')](handleError(_0x2c7211,null));};exports[_0x2ef2('0x1d')]=function(_0x39cc7b,_0x50af77){return db[_0x2ef2('0x23')][_0x2ef2('0x3e')]({'where':{'id':_0x39cc7b['params']['id']}})[_0x2ef2('0x1e')](handleEntityNotFound(_0x50af77,null))[_0x2ef2('0x1e')](removeEntity(_0x50af77,null))[_0x2ef2('0x39')](handleError(_0x50af77,null));}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.model.js b/server/api/intDeskField/intDeskField.model.js index f7f000a..3f20a89 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 _0xbac0=['moment','bluebird','request-promise','path','rimraf','./intDeskField.attributes','exports','DeskField','int_desk_fields','desk_unique_index','lodash','util','api'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbac0,0xb3));var _0x0bac=function(_0x9d1e6b,_0x3bdc22){_0x9d1e6b=_0x9d1e6b-0x0;var _0x2b3070=_0xbac0[_0x9d1e6b];return _0x2b3070;};'use strict';var _=require(_0x0bac('0x0'));var util=require(_0x0bac('0x1'));var logger=require('../../config/logger')(_0x0bac('0x2'));var moment=require(_0x0bac('0x3'));var BPromise=require(_0x0bac('0x4'));var rp=require(_0x0bac('0x5'));var fs=require('fs');var path=require(_0x0bac('0x6'));var rimraf=require(_0x0bac('0x7'));var config=require('../../config/environment');var attributes=require(_0x0bac('0x8'));module[_0x0bac('0x9')]=function(_0x29033c,_0x530dbf){return _0x29033c['define'](_0x0bac('0xa'),attributes,{'tableName':_0x0bac('0xb'),'paranoid':![],'indexes':[{'name':_0x0bac('0xc'),'fields':['idField','FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5584=['rimraf','../../config/environment','./intDeskField.attributes','define','DeskField','desk_unique_index','idField','FieldId','lodash','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x1dd40d,_0x5eaa16){var _0x1e1f6d=function(_0x1f3992){while(--_0x1f3992){_0x1dd40d['push'](_0x1dd40d['shift']());}};_0x1e1f6d(++_0x5eaa16);}(_0x5584,0x80));var _0x4558=function(_0x30b601,_0x4ac750){_0x30b601=_0x30b601-0x0;var _0x38e55e=_0x5584[_0x30b601];return _0x38e55e;};'use strict';var _=require(_0x4558('0x0'));var util=require(_0x4558('0x1'));var logger=require(_0x4558('0x2'))('api');var moment=require(_0x4558('0x3'));var BPromise=require(_0x4558('0x4'));var rp=require(_0x4558('0x5'));var fs=require('fs');var path=require(_0x4558('0x6'));var rimraf=require(_0x4558('0x7'));var config=require(_0x4558('0x8'));var attributes=require(_0x4558('0x9'));module['exports']=function(_0x1c5f57,_0x66d37a){return _0x1c5f57[_0x4558('0xa')](_0x4558('0xb'),attributes,{'tableName':'int_desk_fields','paranoid':![],'indexes':[{'name':_0x4558('0xc'),'fields':[_0x4558('0xd'),_0x4558('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.rpc.js b/server/api/intDeskField/intDeskField.rpc.js index fed2633..aa4004a 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 _0xb54f=['../../config/utils','rpc','jayson/promise','client','request','then','info','DeskField,\x20%s,\x20%s','request\x20sent','DeskField,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb54f,0x86));var _0xfb54=function(_0x340d60,_0x38de8c){_0x340d60=_0x340d60-0x0;var _0x4f26d2=_0xb54f[_0x340d60];return _0x4f26d2;};'use strict';var _=require(_0xfb54('0x0'));var util=require(_0xfb54('0x1'));var moment=require(_0xfb54('0x2'));var BPromise=require(_0xfb54('0x3'));var rs=require(_0xfb54('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfb54('0x5'))['db'];var utils=require(_0xfb54('0x6'));var logger=require('../../config/logger')(_0xfb54('0x7'));var config=require('../../config/environment');var jayson=require(_0xfb54('0x8'));var client=jayson[_0xfb54('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x11c96e,_0x27b03c,_0x4892ec){return new BPromise(function(_0x210d5c,_0x27edf4){return client[_0xfb54('0xa')](_0x11c96e,_0x4892ec)[_0xfb54('0xb')](function(_0x52b224){logger[_0xfb54('0xc')](_0xfb54('0xd'),_0x27b03c,_0xfb54('0xe'));logger['debug'](_0xfb54('0xf'),_0x27b03c,'request\x20sent',JSON[_0xfb54('0x10')](_0x52b224));if(_0x52b224[_0xfb54('0x11')]){if(_0x52b224['error']['code']===0x1f4){logger[_0xfb54('0x11')](_0xfb54('0xd'),_0x27b03c,_0x52b224['error'][_0xfb54('0x12')]);return _0x27edf4(_0x52b224[_0xfb54('0x11')]['message']);}logger[_0xfb54('0x11')](_0xfb54('0xd'),_0x27b03c,_0x52b224['error'][_0xfb54('0x12')]);return _0x210d5c(_0x52b224[_0xfb54('0x11')][_0xfb54('0x12')]);}else{logger[_0xfb54('0xc')](_0xfb54('0xd'),_0x27b03c,_0xfb54('0xe'));_0x210d5c(_0x52b224['result']['message']);}})[_0xfb54('0x13')](function(_0x385dad){logger[_0xfb54('0x11')](_0xfb54('0xd'),_0x27b03c,_0x385dad);_0x27edf4(_0x385dad);});});} \ No newline at end of file +var _0x2328=['then','DeskField,\x20%s,\x20%s','request\x20sent','error','message','info','result','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x123fba,_0x588404){var _0x5d6515=function(_0x42ca2f){while(--_0x42ca2f){_0x123fba['push'](_0x123fba['shift']());}};_0x5d6515(++_0x588404);}(_0x2328,0x104));var _0x8232=function(_0x74ef8c,_0x3b8c65){_0x74ef8c=_0x74ef8c-0x0;var _0x253bde=_0x2328[_0x74ef8c];return _0x253bde;};'use strict';var _=require(_0x8232('0x0'));var util=require(_0x8232('0x1'));var moment=require(_0x8232('0x2'));var BPromise=require(_0x8232('0x3'));var rs=require(_0x8232('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x8232('0x5'));var logger=require(_0x8232('0x6'))(_0x8232('0x7'));var config=require(_0x8232('0x8'));var jayson=require(_0x8232('0x9'));var client=jayson[_0x8232('0xa')][_0x8232('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x21260d,_0x164538,_0x46a915){return new BPromise(function(_0x59c77a,_0xca048c){return client[_0x8232('0xc')](_0x21260d,_0x46a915)[_0x8232('0xd')](function(_0x46c890){logger['info'](_0x8232('0xe'),_0x164538,_0x8232('0xf'));logger['debug']('DeskField,\x20%s,\x20%s,\x20%s',_0x164538,_0x8232('0xf'),JSON['stringify'](_0x46c890));if(_0x46c890[_0x8232('0x10')]){if(_0x46c890[_0x8232('0x10')]['code']===0x1f4){logger[_0x8232('0x10')](_0x8232('0xe'),_0x164538,_0x46c890[_0x8232('0x10')][_0x8232('0x11')]);return _0xca048c(_0x46c890[_0x8232('0x10')][_0x8232('0x11')]);}logger[_0x8232('0x10')]('DeskField,\x20%s,\x20%s',_0x164538,_0x46c890['error'][_0x8232('0x11')]);return _0x59c77a(_0x46c890[_0x8232('0x10')]['message']);}else{logger[_0x8232('0x12')](_0x8232('0xe'),_0x164538,_0x8232('0xf'));_0x59c77a(_0x46c890[_0x8232('0x13')]['message']);}})[_0x8232('0x14')](function(_0x17c8d3){logger[_0x8232('0x10')]('DeskField,\x20%s,\x20%s',_0x164538,_0x17c8d3);_0xca048c(_0x17c8d3);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/index.js b/server/api/intDynamics365Account/index.js index b5a0eaf..43c0e0d 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 _0x292f=['path','connect-timeout','Router','../../components/auth/service','../../config/environment','./intDynamics365Account.controller','get','index','/:id','show','/:id/configurations','isAuthenticated','getConfigurations','/:id/fields','post','create','addConfiguration','put','update','destroy','exports','multer','util'];(function(_0x46371d,_0x982fd2){var _0x51eb34=function(_0x2e1018){while(--_0x2e1018){_0x46371d['push'](_0x46371d['shift']());}};_0x51eb34(++_0x982fd2);}(_0x292f,0x129));var _0xf292=function(_0x381589,_0x27a707){_0x381589=_0x381589-0x0;var _0x2a075d=_0x292f[_0x381589];return _0x2a075d;};'use strict';var multer=require(_0xf292('0x0'));var util=require(_0xf292('0x1'));var path=require(_0xf292('0x2'));var timeout=require(_0xf292('0x3'));var express=require('express');var router=express[_0xf292('0x4')]();var auth=require(_0xf292('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xf292('0x6'));var controller=require(_0xf292('0x7'));router[_0xf292('0x8')]('/',auth['isAuthenticated'](),controller[_0xf292('0x9')]);router[_0xf292('0x8')](_0xf292('0xa'),auth['isAuthenticated'](),controller[_0xf292('0xb')]);router['get'](_0xf292('0xc'),auth[_0xf292('0xd')](),controller[_0xf292('0xe')]);router[_0xf292('0x8')](_0xf292('0xf'),auth[_0xf292('0xd')](),controller['getFields']);router[_0xf292('0x10')]('/',auth[_0xf292('0xd')](),controller[_0xf292('0x11')]);router[_0xf292('0x10')]('/:id/configurations',auth['isAuthenticated'](),controller[_0xf292('0x12')]);router[_0xf292('0x13')](_0xf292('0xa'),auth[_0xf292('0xd')](),controller[_0xf292('0x14')]);router['delete'](_0xf292('0xa'),auth['isAuthenticated'](),controller[_0xf292('0x15')]);module[_0xf292('0x16')]=router; \ No newline at end of file +var _0x4515=['exports','multer','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','addConfiguration','put','update','delete','destroy'];(function(_0x238671,_0x34aea0){var _0x474844=function(_0x26cab4){while(--_0x26cab4){_0x238671['push'](_0x238671['shift']());}};_0x474844(++_0x34aea0);}(_0x4515,0x161));var _0x5451=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x4515[_0x17d9e3];return _0x14192d;};'use strict';var multer=require(_0x5451('0x0'));var util=require('util');var path=require(_0x5451('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x5451('0x2')]();var auth=require(_0x5451('0x3'));var interaction=require(_0x5451('0x4'));var config=require(_0x5451('0x5'));var controller=require('./intDynamics365Account.controller');router['get']('/',auth[_0x5451('0x6')](),controller[_0x5451('0x7')]);router[_0x5451('0x8')](_0x5451('0x9'),auth['isAuthenticated'](),controller[_0x5451('0xa')]);router[_0x5451('0x8')](_0x5451('0xb'),auth[_0x5451('0x6')](),controller[_0x5451('0xc')]);router[_0x5451('0x8')](_0x5451('0xd'),auth[_0x5451('0x6')](),controller[_0x5451('0xe')]);router[_0x5451('0xf')]('/',auth[_0x5451('0x6')](),controller['create']);router['post']('/:id/configurations',auth[_0x5451('0x6')](),controller[_0x5451('0x10')]);router[_0x5451('0x11')]('/:id',auth[_0x5451('0x6')](),controller[_0x5451('0x12')]);router[_0x5451('0x13')](_0x5451('0x9'),auth[_0x5451('0x6')](),controller[_0x5451('0x14')]);module[_0x5451('0x15')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.attributes.js b/server/api/intDynamics365Account/intDynamics365Account.attributes.js index d60827e..daa54ef 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 _0x9bcb=['sequelize','exports','STRING'];(function(_0x194c75,_0x1780d1){var _0x14dd2f=function(_0x16c3d2){while(--_0x16c3d2){_0x194c75['push'](_0x194c75['shift']());}};_0x14dd2f(++_0x1780d1);}(_0x9bcb,0x1c5));var _0xb9bc=function(_0x2f9f43,_0x56eda0){_0x2f9f43=_0x2f9f43-0x0;var _0x41b9ac=_0x9bcb[_0x2f9f43];return _0x41b9ac;};'use strict';var Sequelize=require(_0xb9bc('0x0'));module[_0xb9bc('0x1')]={'name':{'type':Sequelize[_0xb9bc('0x2')]},'username':{'type':Sequelize[_0xb9bc('0x2')]},'password':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0xb9bc('0x2')]},'tenantId':{'type':Sequelize[_0xb9bc('0x2')]},'clientId':{'type':Sequelize[_0xb9bc('0x2')]},'clientSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0xb9bc('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x2a8d=['STRING','sequelize','exports'];(function(_0x2ffce4,_0x5d5504){var _0xc1d2b7=function(_0x2b9c82){while(--_0x2b9c82){_0x2ffce4['push'](_0x2ffce4['shift']());}};_0xc1d2b7(++_0x5d5504);}(_0x2a8d,0xbe));var _0xd2a8=function(_0x76e09b,_0x5d18a3){_0x76e09b=_0x76e09b-0x0;var _0xd18014=_0x2a8d[_0x76e09b];return _0xd18014;};'use strict';var Sequelize=require(_0xd2a8('0x0'));module[_0xd2a8('0x1')]={'name':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0xd2a8('0x2')]},'tenantId':{'type':Sequelize[_0xd2a8('0x2')]},'clientId':{'type':Sequelize[_0xd2a8('0x2')]},'clientSecret':{'type':Sequelize[_0xd2a8('0x2')]},'serverUrl':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xd2a8('0x2')]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.controller.js b/server/api/intDynamics365Account/intDynamics365Account.controller.js index 29877de..97d6f96 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 _0x4ef5=['all','forEach','substring','StringAttributeMetadata','DoubleAttributeMetadata','BigIntAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','Dynamics365\x20error:\x20','Wrong\x20credentials','statusCode','EntityDefinitions(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','OptionSet','Options','Label','UserLocalizedLabel','DisplayName',')/Attributes(',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','false',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','html-pdf','rimraf','fast-json-patch','moment','mustache','util','path','sox','to-csv','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','jayson/promise','client','test','request','then','info','request\x20sent','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error','Dynamics365Account,\x20%s,\x20%s','message','catch','end','status','offset','limit','Content-Range','json','apply','reject','save','update','destroy','sendStatus','name','send','Dynamics365Account','rawAttributes','model','keys','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','merge','map','type','key','VIRTUAL','field','count','includeAll','rows','show','params','length','create','body','find','findOne','Dynamics365Configuration','filter','options','getConfigurations','addConfiguration','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','channel','Dynamics365Field','ticketType','incident','Incident','PhoneCall','title','description','ownerid','caseorigincode','subject','phonenumber','regardingobjectid','directioncode','phonecall_activity_parties','accountidyominame','billedserviceunits','contactidyominame','contractdetailidname','contractidname','createdbyexternalpartyyominame','createdbyname','createdbyyominame','createdon','createdonbehalfbyname','createdonbehalfbyyominame','customeridname','emailaddress','entitlementidname','entityimage_url','escalatedon','exchangerate','firstresponsebykpiidname','importsequencenumber','influencescore','lastonholdtime','masteridname','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedbyyominame','modifiedonbehalfbyname','modifiedonbehalfbyyominame','msdyn_incidenttypename','msdyn_iotalertname','numberofchildincidents','onholdtime','overriddencreatedon','owneridname','owneridyominame','parentcaseidname','primarycontactidname','primarycontactidyominame','prioritycodename','productidname','productserialnumber','resolveby','responsiblecontactidyominame','slaname','socialprofileidname','statecode','statuscode','subjectidname','transactioncurrencyidname','traversedpath','utcconversiontimezonecode','versionnumber','concat','username','password','clientId','clientSecret','remoteUri','slice','lastIndexOf','format','%s/api/data/v9.0/','https://login.microsoftonline.com/','tenantId','access_token','GET','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','4.0','value','MetadataId',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','Attributes','remove','LogicalName','@odata.type','PicklistAttributeMetadata','push'];(function(_0xfd3bab,_0x5ca62a){var _0x5f3c7c=function(_0x5bb93c){while(--_0x5bb93c){_0xfd3bab['push'](_0xfd3bab['shift']());}};_0x5f3c7c(++_0x5ca62a);}(_0x4ef5,0xec));var _0x54ef=function(_0x408c84,_0x37b4b1){_0x408c84=_0x408c84-0x0;var _0xab534a=_0x4ef5[_0x408c84];return _0xab534a;};'use strict';var pdf=require(_0x54ef('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x54ef('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x54ef('0x2'));var rp=require('request-promise');var moment=require(_0x54ef('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x54ef('0x4'));var util=require(_0x54ef('0x5'));var path=require(_0x54ef('0x6'));var sox=require(_0x54ef('0x7'));var csv=require(_0x54ef('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x54ef('0x9'));var crypto=require(_0x54ef('0xa'));var jsforce=require(_0x54ef('0xb'));var deskjs=require(_0x54ef('0xc'));var toCsv=require(_0x54ef('0x8'));var querystring=require(_0x54ef('0xd'));var Papa=require(_0x54ef('0xe'));var Redis=require(_0x54ef('0xf'));var authService=require(_0x54ef('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x54ef('0x11'));var logger=require('../../config/logger')(_0x54ef('0x12'));var utils=require(_0x54ef('0x13'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');var jayson=require(_0x54ef('0x14'));var client=jayson[_0x54ef('0x15')]['http']({'port':0x232a});function checkPasswordPattern(_0x363273,_0x52608b,_0x5b908a){if(_0x5b908a){var _0x28eea5=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x28eea5[_0x54ef('0x16')](_0x52608b)){return _0x363273;}else{throw new Error('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x363273;}}function respondWithRpcPromise(_0x4be0af,_0x3903aa,_0x938519,_0x38bd8c){return new BPromise(function(_0x37efee,_0x4907f2){var _0x25d617=_0x38bd8c||client;return _0x25d617[_0x54ef('0x17')](_0x4be0af,_0x938519)[_0x54ef('0x18')](function(_0x562104){logger[_0x54ef('0x19')]('Dynamics365Account,\x20%s,\x20%s',_0x3903aa,_0x54ef('0x1a'));logger['debug'](_0x54ef('0x1b'),_0x3903aa,_0x54ef('0x1a'),JSON[_0x54ef('0x1c')](_0x562104));if(_0x562104[_0x54ef('0x1d')]){if(_0x562104[_0x54ef('0x1d')]['code']===0x1f4){logger[_0x54ef('0x1d')](_0x54ef('0x1e'),_0x3903aa,_0x562104['error'][_0x54ef('0x1f')]);return _0x4907f2(_0x562104['error']['message']);}logger[_0x54ef('0x1d')](_0x54ef('0x1e'),_0x3903aa,_0x562104[_0x54ef('0x1d')][_0x54ef('0x1f')]);return _0x37efee(_0x562104['error']['message']);}else{logger[_0x54ef('0x19')](_0x54ef('0x1e'),_0x3903aa,_0x54ef('0x1a'));_0x37efee(_0x562104['result']['message']);}})[_0x54ef('0x20')](function(_0x2fe761){logger['error'](_0x54ef('0x1e'),_0x3903aa,_0x2fe761);_0x4907f2(_0x2fe761);});});}function respondWithStatusCode(_0x554594,_0x1aa36b){_0x1aa36b=_0x1aa36b||0xcc;return function(_0x7f69c1){if(_0x7f69c1){return _0x554594['sendStatus'](_0x1aa36b);}return _0x554594['status'](_0x1aa36b)[_0x54ef('0x21')]();};}function respondWithResult(_0x51a855,_0xd6bb7){_0xd6bb7=_0xd6bb7||0xc8;return function(_0x1d8fc1){if(_0x1d8fc1){return _0x51a855[_0x54ef('0x22')](_0xd6bb7)['json'](_0x1d8fc1);}};}function respondWithFilteredResult(_0xbe33dd,_0x2b3bf1){return function(_0xc11734){if(_0xc11734){var _0x1c4c55=_0xc11734['count'],_0x3a0d96=_0x2b3bf1[_0x54ef('0x23')],_0x138cdf=_0x2b3bf1[_0x54ef('0x23')]+_0x2b3bf1[_0x54ef('0x24')],_0x1fa39a;if(_0x138cdf>=_0x1c4c55){_0x138cdf=_0x1c4c55;_0x1fa39a=0xc8;}else{_0x1fa39a=0xce;}_0xbe33dd['status'](_0x1fa39a);return _0xbe33dd['set'](_0x54ef('0x25'),_0x3a0d96+'-'+_0x138cdf+'/'+_0x1c4c55)[_0x54ef('0x26')](_0xc11734);}return null;};}function patchUpdates(_0x1ce667){return function(_0xe4ba42){try{jsonpatch[_0x54ef('0x27')](_0xe4ba42,_0x1ce667,!![]);}catch(_0x45a580){return BPromise[_0x54ef('0x28')](_0x45a580);}return _0xe4ba42[_0x54ef('0x29')]();};}function saveUpdates(_0x23d95e,_0x31a8aa){return function(_0x450e67){if(_0x450e67){return _0x450e67[_0x54ef('0x2a')](_0x23d95e)[_0x54ef('0x18')](function(_0x14112c){return _0x14112c;});}return null;};}function removeEntity(_0x41011a,_0x1794df){return function(_0x3523da){if(_0x3523da){return _0x3523da[_0x54ef('0x2b')]()['then'](function(){_0x41011a[_0x54ef('0x22')](0xcc)[_0x54ef('0x21')]();});}};}function handleEntityNotFound(_0x5b99cb,_0x4bae45){return function(_0x377981){if(!_0x377981){_0x5b99cb[_0x54ef('0x2c')](0x194);}return _0x377981;};}function handleError(_0x34068f,_0x4fab07){_0x4fab07=_0x4fab07||0x1f4;return function(_0x4cd15b){logger[_0x54ef('0x1d')](_0x4cd15b['stack']);if(_0x4cd15b[_0x54ef('0x2d')]){delete _0x4cd15b[_0x54ef('0x2d')];}_0x34068f['status'](_0x4fab07)[_0x54ef('0x2e')](_0x4cd15b);};}exports['index']=function(_0x247ed7,_0x1c8d51){var _0xaf6b69={},_0xa66296={},_0x36d985={'count':0x0,'rows':[]};var _0x4c584b=db[_0x54ef('0x2f')][_0x54ef('0x30')];_0xa66296[_0x54ef('0x31')]=_[_0x54ef('0x32')](_0x4c584b);_0xa66296[_0x54ef('0x33')]=_[_0x54ef('0x32')](_0x247ed7[_0x54ef('0x33')]);_0xa66296[_0x54ef('0x34')]=_[_0x54ef('0x35')](_0xa66296[_0x54ef('0x31')],_0xa66296[_0x54ef('0x33')]);_0xaf6b69['attributes']=_[_0x54ef('0x35')](_0xa66296['model'],qs[_0x54ef('0x36')](_0x247ed7[_0x54ef('0x33')][_0x54ef('0x36')]));_0xaf6b69[_0x54ef('0x37')]=_0xaf6b69[_0x54ef('0x37')]['length']?_0xaf6b69[_0x54ef('0x37')]:_0xa66296[_0x54ef('0x31')];if(!_0x247ed7[_0x54ef('0x33')][_0x54ef('0x38')](_0x54ef('0x39'))){_0xaf6b69[_0x54ef('0x24')]=qs[_0x54ef('0x24')](_0x247ed7[_0x54ef('0x33')][_0x54ef('0x24')]);_0xaf6b69[_0x54ef('0x23')]=qs['offset'](_0x247ed7[_0x54ef('0x33')]['offset']);}_0xaf6b69[_0x54ef('0x3a')]=qs[_0x54ef('0x3b')](_0x247ed7['query']['sort']);_0xaf6b69[_0x54ef('0x3c')]=qs['filters'](_[_0x54ef('0x3d')](_0x247ed7[_0x54ef('0x33')],_0xa66296['filters']));if(_0x247ed7[_0x54ef('0x33')]['filter']){_0xaf6b69[_0x54ef('0x3c')]=_[_0x54ef('0x3e')](_0xaf6b69[_0x54ef('0x3c')],{'$or':_[_0x54ef('0x3f')](_0x4c584b,function(_0x47f576){if(_0x47f576[_0x54ef('0x40')][_0x54ef('0x41')]!==_0x54ef('0x42')){var _0x193309={};_0x193309[_0x47f576[_0x54ef('0x43')]]={'$like':'%'+_0x247ed7[_0x54ef('0x33')]['filter']+'%'};return _0x193309;}})});}_0xaf6b69=_['merge']({},_0xaf6b69,_0x247ed7['options']);var _0x4bac2c={'where':_0xaf6b69[_0x54ef('0x3c')]};return db[_0x54ef('0x2f')][_0x54ef('0x44')](_0x4bac2c)['then'](function(_0x126867){_0x36d985['count']=_0x126867;if(_0x247ed7[_0x54ef('0x33')][_0x54ef('0x45')]){_0xaf6b69['include']=[{'all':!![]}];}return db[_0x54ef('0x2f')]['findAll'](_0xaf6b69);})['then'](function(_0x28c5d6){_0x36d985[_0x54ef('0x46')]=_0x28c5d6;return _0x36d985;})[_0x54ef('0x18')](respondWithFilteredResult(_0x1c8d51,_0xaf6b69))[_0x54ef('0x20')](handleError(_0x1c8d51,null));};exports[_0x54ef('0x47')]=function(_0x33bb47,_0x1f6e64){var _0x1f279d={'raw':![],'where':{'id':_0x33bb47[_0x54ef('0x48')]['id']}},_0x21cc62={};_0x21cc62[_0x54ef('0x31')]=_[_0x54ef('0x32')](db[_0x54ef('0x2f')][_0x54ef('0x30')]);_0x21cc62[_0x54ef('0x33')]=_[_0x54ef('0x32')](_0x33bb47[_0x54ef('0x33')]);_0x21cc62['filters']=_[_0x54ef('0x35')](_0x21cc62[_0x54ef('0x31')],_0x21cc62[_0x54ef('0x33')]);_0x1f279d[_0x54ef('0x37')]=_[_0x54ef('0x35')](_0x21cc62[_0x54ef('0x31')],qs[_0x54ef('0x36')](_0x33bb47[_0x54ef('0x33')][_0x54ef('0x36')]));_0x1f279d['attributes']=_0x1f279d[_0x54ef('0x37')][_0x54ef('0x49')]?_0x1f279d[_0x54ef('0x37')]:_0x21cc62[_0x54ef('0x31')];if(_0x33bb47['query'][_0x54ef('0x45')]){_0x1f279d['include']=[{'all':!![]}];}_0x1f279d=_['merge']({},_0x1f279d,_0x33bb47['options']);return db[_0x54ef('0x2f')]['find'](_0x1f279d)['then'](handleEntityNotFound(_0x1f6e64,null))[_0x54ef('0x18')](respondWithResult(_0x1f6e64,null))[_0x54ef('0x20')](handleError(_0x1f6e64,null));};exports[_0x54ef('0x4a')]=function(_0xa04342,_0x4acecb){return db['Dynamics365Account'][_0x54ef('0x4a')](_0xa04342['body'],{})['then'](respondWithResult(_0x4acecb,0xc9))['catch'](handleError(_0x4acecb,null));};exports[_0x54ef('0x2a')]=function(_0x3ad01c,_0x229648){if(_0x3ad01c['body']['id']){delete _0x3ad01c[_0x54ef('0x4b')]['id'];}return db[_0x54ef('0x2f')][_0x54ef('0x4c')]({'where':{'id':_0x3ad01c[_0x54ef('0x48')]['id']}})['then'](handleEntityNotFound(_0x229648,null))['then'](saveUpdates(_0x3ad01c[_0x54ef('0x4b')],null))[_0x54ef('0x18')](respondWithResult(_0x229648,null))['catch'](handleError(_0x229648,null));};exports[_0x54ef('0x2b')]=function(_0x108ec7,_0x5f18fe){return db[_0x54ef('0x2f')]['find']({'where':{'id':_0x108ec7[_0x54ef('0x48')]['id']}})[_0x54ef('0x18')](handleEntityNotFound(_0x5f18fe,null))[_0x54ef('0x18')](removeEntity(_0x5f18fe,null))[_0x54ef('0x20')](handleError(_0x5f18fe,null));};exports['getConfigurations']=function(_0x430976,_0x44b59f,_0x3a1ce5){var _0x1c0502={};var _0x3705ae={};var _0x52e5e5;var _0x160638;return db[_0x54ef('0x2f')][_0x54ef('0x4d')]({'where':{'id':_0x430976[_0x54ef('0x48')]['id']}})[_0x54ef('0x18')](handleEntityNotFound(_0x44b59f,null))['then'](function(_0x17705e){if(_0x17705e){_0x52e5e5=_0x17705e;_0x3705ae[_0x54ef('0x31')]=_['keys'](db[_0x54ef('0x4e')][_0x54ef('0x30')]);_0x3705ae[_0x54ef('0x33')]=_[_0x54ef('0x32')](_0x430976[_0x54ef('0x33')]);_0x3705ae[_0x54ef('0x34')]=_['intersection'](_0x3705ae[_0x54ef('0x31')],_0x3705ae[_0x54ef('0x33')]);_0x1c0502[_0x54ef('0x37')]=_[_0x54ef('0x35')](_0x3705ae[_0x54ef('0x31')],qs[_0x54ef('0x36')](_0x430976[_0x54ef('0x33')][_0x54ef('0x36')]));_0x1c0502[_0x54ef('0x37')]=_0x1c0502['attributes'][_0x54ef('0x49')]?_0x1c0502['attributes']:_0x3705ae[_0x54ef('0x31')];_0x1c0502[_0x54ef('0x3a')]=qs[_0x54ef('0x3b')](_0x430976[_0x54ef('0x33')][_0x54ef('0x3b')]);_0x1c0502[_0x54ef('0x3c')]=qs[_0x54ef('0x34')](_[_0x54ef('0x3d')](_0x430976['query'],_0x3705ae[_0x54ef('0x34')]));if(_0x430976[_0x54ef('0x33')][_0x54ef('0x4f')]){_0x1c0502[_0x54ef('0x3c')]=_[_0x54ef('0x3e')](_0x1c0502[_0x54ef('0x3c')],{'$or':_[_0x54ef('0x3f')](_0x1c0502[_0x54ef('0x37')],function(_0x129c16){var _0x68e81b={};_0x68e81b[_0x129c16]={'$like':'%'+_0x430976[_0x54ef('0x33')][_0x54ef('0x4f')]+'%'};return _0x68e81b;})});}_0x1c0502=_['merge']({},_0x1c0502,_0x430976[_0x54ef('0x50')]);return _0x52e5e5[_0x54ef('0x51')](_0x1c0502);}})[_0x54ef('0x18')](function(_0x213666){if(_0x213666){_0x160638=_0x213666[_0x54ef('0x49')];if(!_0x430976[_0x54ef('0x33')][_0x54ef('0x38')](_0x54ef('0x39'))){_0x1c0502['limit']=qs[_0x54ef('0x24')](_0x430976['query'][_0x54ef('0x24')]);_0x1c0502[_0x54ef('0x23')]=qs[_0x54ef('0x23')](_0x430976[_0x54ef('0x33')][_0x54ef('0x23')]);}return _0x52e5e5[_0x54ef('0x51')](_0x1c0502);}})[_0x54ef('0x18')](function(_0x21fce9){if(_0x21fce9){return _0x21fce9?{'count':_0x160638,'rows':_0x21fce9}:null;}})[_0x54ef('0x18')](respondWithResult(_0x44b59f,null))['catch'](handleError(_0x44b59f,null));};exports[_0x54ef('0x52')]=function(_0x3127a3,_0xe42873,_0x3d7536){if(_0x3127a3[_0x54ef('0x4b')]['id']){delete _0x3127a3[_0x54ef('0x4b')]['id'];}return db[_0x54ef('0x2f')][_0x54ef('0x4d')]({'where':{'id':_0x3127a3[_0x54ef('0x48')]['id']}})[_0x54ef('0x18')](handleEntityNotFound(_0xe42873,null))[_0x54ef('0x18')](function(_0x37ea0b){if(_0x37ea0b){_0x3127a3[_0x54ef('0x4b')][_0x54ef('0x53')]=_0x37ea0b['id'];_0x3127a3['body'][_0x54ef('0x54')]=integrations[_0x54ef('0x55')](_0x3127a3[_0x54ef('0x4b')]['channel'],_0x3127a3['body'][_0x54ef('0x40')]);_0x3127a3[_0x54ef('0x4b')][_0x54ef('0x56')]=integrations[_0x54ef('0x57')](_0x3127a3[_0x54ef('0x4b')][_0x54ef('0x58')],_0x3127a3['body']['type']);return db[_0x54ef('0x4e')][_0x54ef('0x4a')](_0x3127a3['body'],{'include':[{'model':db[_0x54ef('0x59')],'as':_0x54ef('0x54')},{'model':db[_0x54ef('0x59')],'as':_0x54ef('0x56')}]});}return null;})[_0x54ef('0x18')](respondWithResult(_0xe42873,null))['catch'](handleError(_0xe42873,null));};exports['getFields']=function(_0x3037d3,_0x4e711a,_0x297906){var _0x6ff3a9=_0x3037d3['query'][_0x54ef('0x5a')];var _0x2b50d4=_0x6ff3a9===_0x54ef('0x5b')?_0x54ef('0x5c'):_0x54ef('0x5d');var _0x4d7ba7='';var _0x47ce4e='';var _0x4d9071='';var _0x590c15='';var _0x1cf9ac='';var _0x5a6394='';var _0x56e643='';var _0x5b8498='';var _0x691ed2=[_0x54ef('0x5e'),_0x54ef('0x5f'),'customerid',_0x54ef('0x60'),_0x54ef('0x61'),_0x54ef('0x62'),_0x54ef('0x63'),_0x54ef('0x64'),_0x54ef('0x65'),_0x54ef('0x66')];var _0xb6074e=['accountidname',_0x54ef('0x67'),'actualserviceunits',_0x54ef('0x68'),'contactidname',_0x54ef('0x69'),_0x54ef('0x6a'),_0x54ef('0x6b'),'createdbyexternalpartyname',_0x54ef('0x6c'),_0x54ef('0x6d'),_0x54ef('0x6e'),_0x54ef('0x6f'),_0x54ef('0x70'),_0x54ef('0x71'),_0x54ef('0x72'),'customeridtype','customeridyominame',_0x54ef('0x73'),_0x54ef('0x74'),'entityimage_timestamp',_0x54ef('0x75'),_0x54ef('0x76'),_0x54ef('0x77'),_0x54ef('0x78'),'followupby',_0x54ef('0x79'),_0x54ef('0x7a'),'kbarticleidname',_0x54ef('0x7b'),_0x54ef('0x7c'),_0x54ef('0x7d'),_0x54ef('0x7e'),'modifiedbyname',_0x54ef('0x7f'),'modifiedon',_0x54ef('0x80'),_0x54ef('0x81'),_0x54ef('0x82'),_0x54ef('0x83'),_0x54ef('0x84'),_0x54ef('0x85'),_0x54ef('0x86'),_0x54ef('0x87'),'owneridtype',_0x54ef('0x88'),_0x54ef('0x89'),_0x54ef('0x8a'),_0x54ef('0x8b'),_0x54ef('0x8c'),_0x54ef('0x8d'),_0x54ef('0x8e'),_0x54ef('0x8f'),'resolvebykpiidname','responseby','responsiblecontactidname',_0x54ef('0x90'),'sentimentvalue','slainvokedidname',_0x54ef('0x91'),_0x54ef('0x92'),_0x54ef('0x93'),_0x54ef('0x94'),_0x54ef('0x95'),'ticketnumber','timezoneruleversionnumber',_0x54ef('0x96'),_0x54ef('0x97'),_0x54ef('0x98'),_0x54ef('0x99')];var _0x5ad6b5=_0x691ed2[_0x54ef('0x9a')](_0xb6074e);return db[_0x54ef('0x2f')][_0x54ef('0x4d')]({'where':{'id':_0x3037d3[_0x54ef('0x48')]['id']},'attributes':['id',_0x54ef('0x9b'),_0x54ef('0x9c'),'remoteUri','tenantId',_0x54ef('0x9d'),_0x54ef('0x9e')]})['then'](handleEntityNotFound(_0x4e711a,null))[_0x54ef('0x18')](function(_0x194470){if(_0x194470){_0x5b8498=_0x194470[_0x54ef('0x9f')];var _0x5cda6c=_0x5b8498[_0x54ef('0xa0')](-0x1);if(_0x5cda6c==='/'){_0x5b8498=_0x5b8498['substring'](0x0,_0x5b8498[_0x54ef('0xa1')](_0x5cda6c));}_0x56e643=util[_0x54ef('0xa2')](_0x54ef('0xa3'),_0x5b8498);var _0x49c9c8={'method':'POST','uri':_0x54ef('0xa4')+_0x194470[_0x54ef('0xa5')]+'/oauth2/token','form':{'client_id':_0x194470[_0x54ef('0x9d')],'resource':_0x5b8498,'username':_0x194470['username'],'password':_0x194470[_0x54ef('0x9c')],'grant_type':'password','client_secret':_0x194470[_0x54ef('0x9e')]},'json':!![]};return rp(_0x49c9c8);}})[_0x54ef('0x18')](function(_0x5cf4ce){_0x5a6394=_0x5cf4ce[_0x54ef('0xa6')];var _0x5c3626={'method':_0x54ef('0xa7'),'uri':encodeURI(_0x56e643+_0x54ef('0xa8')+_0x2b50d4+'\x27'),'headers':{'Authorization':_0x54ef('0xa9')+_0x5a6394,'If-None-Match':null,'OData-Version':_0x54ef('0xaa')},'json':!![]};return rp(_0x5c3626);})[_0x54ef('0x18')](function(_0xe14ce8){var _0x28f53b=_0xe14ce8[_0x54ef('0xab')][0x0];var _0x5e2014=_0x28f53b[_0x54ef('0xac')];var _0x3a49c3={'method':_0x54ef('0xa7'),'uri':_0x56e643+'EntityDefinitions('+_0x5e2014+_0x54ef('0xad'),'headers':{'Authorization':_0x54ef('0xa9')+_0x5a6394,'If-None-Match':null,'OData-Version':_0x54ef('0xaa')},'json':!![]};return rp(_0x3a49c3);})[_0x54ef('0x18')](function(_0x4283f9){_0x4d7ba7=_0x4283f9;_0x47ce4e=_0x4d7ba7[_0x54ef('0xae')];_0x47ce4e=_[_0x54ef('0xaf')](_0x47ce4e,function(_0x5798e3){return!_0x5ad6b5['includes'](_0x5798e3[_0x54ef('0xb0')]);});var _0x1185ba=[];var _0x3dda46=[];_0x47ce4e['forEach'](function(_0x4a9f78){if(_0x4a9f78['@odata.type']){var _0x222591=_0x4a9f78[_0x54ef('0xb1')]['substring'](_0x4a9f78[_0x54ef('0xb1')]['lastIndexOf']('.')+0x1);if(_0x222591===_0x54ef('0xb2')){_0x1185ba[_0x54ef('0xb3')](getSelectList(_0x56e643,_0x6ff3a9,_0x3dda46,_0x4d7ba7[_0x54ef('0xac')],_0x4a9f78[_0x54ef('0xac')],_0x5a6394));}}});return Promise[_0x54ef('0xb4')](_0x1185ba);})[_0x54ef('0x18')](function(_0x58efe2){_0x4d9071=_0x58efe2[0x0];var _0x1471b4=[];var _0x2b255c=[];_0x47ce4e[_0x54ef('0xb5')](function(_0x274cbd){if(!_['isNil'](_0x274cbd[_0x54ef('0xb1')])){var _0x4633be=_0x274cbd[_0x54ef('0xb1')][_0x54ef('0xb6')](_0x274cbd['@odata.type']['lastIndexOf']('.')+0x1);if(_0x4633be==='BooleanAttributeMetadata'){_0x1471b4[_0x54ef('0xb3')](getBooleanList(_0x56e643,_0x6ff3a9,_0x2b255c,_0x4d7ba7[_0x54ef('0xac')],_0x274cbd[_0x54ef('0xac')],_0x5a6394));}}});return Promise['all'](_0x1471b4);})[_0x54ef('0x18')](function(_0x44e1ef){_0x590c15=_0x44e1ef[0x0];var _0x53b480=[];var _0xa15ae3=[];_0x47ce4e[_0x54ef('0xb5')](function(_0x741684){if(_0x741684[_0x54ef('0xb1')]){var _0x57e883=_0x741684[_0x54ef('0xb1')][_0x54ef('0xb6')](_0x741684[_0x54ef('0xb1')][_0x54ef('0xa1')]('.')+0x1);if(_0x57e883===_0x54ef('0xb7')||_0x57e883===_0x54ef('0xb8')||_0x57e883===_0x54ef('0xb9')||_0x57e883===_0x54ef('0xba')||_0x57e883===_0x54ef('0xbb')||_0x57e883==='DateTimeAttributeMetadata'||_0x57e883===_0x54ef('0xbc')||_0x57e883===_0x54ef('0xbd')||_0x57e883===_0x54ef('0xbe')||_0x57e883===_0x54ef('0xbf')){_0x53b480[_0x54ef('0xb3')](getInputList(_0x56e643,_0x6ff3a9,_0x57e883,_0xa15ae3,_0x4d7ba7[_0x54ef('0xac')],_0x741684[_0x54ef('0xac')],_0x5a6394));}}});return Promise[_0x54ef('0xb4')](_0x53b480);})['then'](function(_0x51b0e0){_0x1cf9ac=_0x51b0e0[0x0];var _0x41319f=_0x4d9071[_0x54ef('0x9a')](_0x590c15)[_0x54ef('0x9a')](_0x1cf9ac);var _0x553a00={'count':_0x41319f[_0x54ef('0x49')],'rows':_0x41319f};return _0x553a00;})[_0x54ef('0x18')](respondWithResult(_0x4e711a,null))[_0x54ef('0x20')](function(_0xdac496){console['log'](_0x54ef('0xc0')+_0xdac496);var _0x1fcfb2=_0x3037d3['query']['test']?0x1f4:_0xdac496['statusCode']||0x1f4;logger[_0x54ef('0x1d')](_0xdac496['stack']);delete _0xdac496[_0x54ef('0x2d')];if(_0x1fcfb2===0x191){_0x1fcfb2=0x190;}_0x4e711a['status'](_0x1fcfb2)['send'](_0x3037d3[_0x54ef('0x33')][_0x54ef('0x16')]?{'message':_0x54ef('0xc1'),'statusCode':_0xdac496[_0x54ef('0xc2')]}:_0xdac496);});};function getSelectList(_0x59a45b,_0x198856,_0xe7634f,_0x26b530,_0x34049d,_0x4c2c4f){var _0x4ab83d={'method':_0x54ef('0xa7'),'uri':_0x59a45b+_0x54ef('0xc3')+_0x26b530+')/Attributes('+_0x34049d+_0x54ef('0xc4')+_0x54ef('0xc5'),'headers':{'Authorization':_0x54ef('0xa9')+_0x4c2c4f,'If-None-Match':null,'OData-Version':_0x54ef('0xaa')},'json':!![]};return rp(_0x4ab83d)[_0x54ef('0x18')](function(_0x29545e){var _0x534160=[];var _0x1ae0f3=_0x29545e[_0x54ef('0xc6')][_0x54ef('0xc7')];_0x1ae0f3[_0x54ef('0xb5')](function(_0x16e851){_0x534160['push']({'name':_0x16e851[_0x54ef('0xc8')][_0x54ef('0xc9')][_0x54ef('0xc8')],'value':String(_0x16e851['Value'])});});var _0x56a33d={'id':_0x198856+'_'+_0x29545e['LogicalName'],'name':_0x29545e[_0x54ef('0xca')][_0x54ef('0xc9')][_0x54ef('0xc8')],'custom':![],'options':_0x534160};_0xe7634f[_0x54ef('0xb3')](_0x56a33d);return _0xe7634f;});}function getBooleanList(_0x276c79,_0x25278a,_0x40609d,_0x4e028c,_0xfc8ac0,_0x56ba15){var _0x2a2a2e={'method':_0x54ef('0xa7'),'uri':_0x276c79+'EntityDefinitions('+_0x4e028c+_0x54ef('0xcb')+_0xfc8ac0+_0x54ef('0xcc'),'headers':{'Authorization':_0x54ef('0xa9')+_0x56ba15,'If-None-Match':null,'OData-Version':_0x54ef('0xaa')},'json':!![]};return rp(_0x2a2a2e)[_0x54ef('0x18')](function(_0x1f1c74){var _0x213b09=[];_0x213b09[_0x54ef('0xb3')]({'name':_0x1f1c74[_0x54ef('0xc6')]['TrueOption']['Label'][_0x54ef('0xc9')][_0x54ef('0xc8')],'value':'true'},{'name':_0x1f1c74['OptionSet']['FalseOption']['Label'][_0x54ef('0xc9')][_0x54ef('0xc8')],'value':_0x54ef('0xcd')});var _0x5020b9={'id':_0x25278a+'_'+_0x1f1c74[_0x54ef('0xb0')],'name':_0x1f1c74[_0x54ef('0xca')][_0x54ef('0xc9')]['Label'],'custom':![],'options':_0x213b09};_0x40609d[_0x54ef('0xb3')](_0x5020b9);return _0x40609d;});}function getInputList(_0x5bf06c,_0x2702fe,_0x5582ff,_0x2a2789,_0x1647ba,_0x4a3f0e,_0x5a77d8){var _0x54e821={'method':'GET','uri':_0x5bf06c+_0x54ef('0xc3')+_0x1647ba+')/Attributes('+_0x4a3f0e+_0x54ef('0xce')+_0x5582ff+_0x54ef('0xcf'),'headers':{'Authorization':_0x54ef('0xa9')+_0x5a77d8,'If-None-Match':null,'OData-Version':_0x54ef('0xaa')},'json':!![]};return rp(_0x54e821)[_0x54ef('0x18')](function(_0x1ae01f){var _0x4e9e71={'id':_0x2702fe+'_'+_0x1ae01f['LogicalName'],'name':_0x1ae01f[_0x54ef('0xca')][_0x54ef('0xc9')]?_0x1ae01f['DisplayName'][_0x54ef('0xc9')][_0x54ef('0xc8')]:_0x1ae01f[_0x54ef('0xb0')],'custom':![],'options':[]};_0x2a2789[_0x54ef('0xb3')](_0x4e9e71);return _0x2a2789;});} \ No newline at end of file +var _0x3d28=['PhoneCall','customerid','ownerid','caseorigincode','subject','regardingobjectid','directioncode','phonecall_activity_parties','accountidname','accountidyominame','billedserviceunits','contactidyominame','contractdetailidname','contractidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyname','createdbyyominame','createdon','createdonbehalfbyname','createdonbehalfbyyominame','customeridname','customeridtype','customeridyominame','emailaddress','entitlementidname','entityimage_timestamp','entityimage_url','escalatedon','followupby','importsequencenumber','influencescore','kbarticleidname','lastonholdtime','masteridname','modifiedbyexternalpartyname','modifiedbyname','modifiedbyyominame','modifiedon','modifiedonbehalfbyname','modifiedonbehalfbyyominame','msdyn_iotalertname','numberofchildincidents','overriddencreatedon','owneridtype','owneridyominame','primarycontactidname','primarycontactidyominame','productidname','productserialnumber','resolveby','responseby','responsiblecontactidyominame','sentimentvalue','slainvokedidname','slaname','socialprofileidname','subjectidname','ticketnumber','traversedpath','utcconversiontimezonecode','versionnumber','concat','password','remoteUri','tenantId','clientSecret','slice','substring','lastIndexOf','format','%s/api/data/v9.0/','POST','/oauth2/token','clientId','username','access_token','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','4.0','value','MetadataId','GET','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','remove','includes','LogicalName','forEach','@odata.type','PicklistAttributeMetadata','all','isNil','BooleanAttributeMetadata','StringAttributeMetadata','DoubleAttributeMetadata','BigIntAttributeMetadata','IntegerAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','statusCode','Wrong\x20credentials',')/Attributes(','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','OptionSet','Options','push','Label','UserLocalizedLabel','Value','DisplayName',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','TrueOption','FalseOption','false',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','info','Dynamics365Account,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','end','status','offset','limit','set','Content-Range','json','reject','save','update','then','stack','name','send','Dynamics365Account','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','key','VIRTUAL','count','includeAll','include','findAll','rows','rawAttributes','options','find','create','body','destroy','params','Dynamics365Configuration','getConfigurations','addConfiguration','findOne','AccountId','Subjects','channel','getDescriptions','type','Dynamics365Field','getFields','ticketType','incident','Incident'];(function(_0x49180c,_0x153112){var _0x5242f8=function(_0x18731e){while(--_0x18731e){_0x49180c['push'](_0x49180c['shift']());}};_0x5242f8(++_0x153112);}(_0x3d28,0x156));var _0x83d2=function(_0x2b950b,_0x2df7f6){_0x2b950b=_0x2b950b-0x0;var _0x342243=_0x3d28[_0x2b950b];return _0x342243;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x83d2('0x0'));var rimraf=require(_0x83d2('0x1'));var zipdir=require(_0x83d2('0x2'));var jsonpatch=require(_0x83d2('0x3'));var rp=require(_0x83d2('0x4'));var moment=require(_0x83d2('0x5'));var BPromise=require(_0x83d2('0x6'));var Mustache=require(_0x83d2('0x7'));var util=require(_0x83d2('0x8'));var path=require(_0x83d2('0x9'));var sox=require(_0x83d2('0xa'));var csv=require(_0x83d2('0xb'));var ejs=require(_0x83d2('0xc'));var fs=require('fs');var _=require(_0x83d2('0xd'));var squel=require(_0x83d2('0xe'));var crypto=require(_0x83d2('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x83d2('0x10'));var toCsv=require(_0x83d2('0xb'));var querystring=require(_0x83d2('0x11'));var Papa=require(_0x83d2('0x12'));var Redis=require(_0x83d2('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x83d2('0x14'));var as=require(_0x83d2('0x15'));var hardwareService=require(_0x83d2('0x16'));var logger=require(_0x83d2('0x17'))(_0x83d2('0x18'));var utils=require(_0x83d2('0x19'));var config=require(_0x83d2('0x1a'));var db=require(_0x83d2('0x1b'))['db'];var integrations=require(_0x83d2('0x1c'));var jayson=require(_0x83d2('0x1d'));var client=jayson[_0x83d2('0x1e')][_0x83d2('0x1f')]({'port':0x232a});function checkPasswordPattern(_0x374284,_0x4f2a9e,_0x24db6f){if(_0x24db6f){var _0x3579ef=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3579ef[_0x83d2('0x20')](_0x4f2a9e)){return _0x374284;}else{throw new Error(_0x83d2('0x21'));}}else{return _0x374284;}}function respondWithRpcPromise(_0x492d64,_0x5cee7e,_0x2e0f33,_0x1ec545){return new BPromise(function(_0x3a2f1a,_0x220111){var _0x1446d2=_0x1ec545||client;return _0x1446d2[_0x83d2('0x22')](_0x492d64,_0x2e0f33)['then'](function(_0x4befab){logger[_0x83d2('0x23')](_0x83d2('0x24'),_0x5cee7e,_0x83d2('0x25'));logger[_0x83d2('0x26')](_0x83d2('0x27'),_0x5cee7e,_0x83d2('0x25'),JSON[_0x83d2('0x28')](_0x4befab));if(_0x4befab['error']){if(_0x4befab[_0x83d2('0x29')][_0x83d2('0x2a')]===0x1f4){logger['error'](_0x83d2('0x24'),_0x5cee7e,_0x4befab[_0x83d2('0x29')][_0x83d2('0x2b')]);return _0x220111(_0x4befab[_0x83d2('0x29')][_0x83d2('0x2b')]);}logger[_0x83d2('0x29')]('Dynamics365Account,\x20%s,\x20%s',_0x5cee7e,_0x4befab['error'][_0x83d2('0x2b')]);return _0x3a2f1a(_0x4befab['error'][_0x83d2('0x2b')]);}else{logger['info'](_0x83d2('0x24'),_0x5cee7e,_0x83d2('0x25'));_0x3a2f1a(_0x4befab['result'][_0x83d2('0x2b')]);}})[_0x83d2('0x2c')](function(_0x486ba4){logger['error'](_0x83d2('0x24'),_0x5cee7e,_0x486ba4);_0x220111(_0x486ba4);});});}function respondWithStatusCode(_0x4000cd,_0xf3ae4c){_0xf3ae4c=_0xf3ae4c||0xcc;return function(_0x305121){if(_0x305121){return _0x4000cd[_0x83d2('0x2d')](_0xf3ae4c);}return _0x4000cd['status'](_0xf3ae4c)[_0x83d2('0x2e')]();};}function respondWithResult(_0x20e778,_0x2a51d9){_0x2a51d9=_0x2a51d9||0xc8;return function(_0x390e07){if(_0x390e07){return _0x20e778[_0x83d2('0x2f')](_0x2a51d9)['json'](_0x390e07);}};}function respondWithFilteredResult(_0x513d7a,_0x33803a){return function(_0x1f0414){if(_0x1f0414){var _0x323002=_0x1f0414['count'],_0x4c287a=_0x33803a['offset'],_0xec5531=_0x33803a[_0x83d2('0x30')]+_0x33803a[_0x83d2('0x31')],_0x4764c1;if(_0xec5531>=_0x323002){_0xec5531=_0x323002;_0x4764c1=0xc8;}else{_0x4764c1=0xce;}_0x513d7a[_0x83d2('0x2f')](_0x4764c1);return _0x513d7a[_0x83d2('0x32')](_0x83d2('0x33'),_0x4c287a+'-'+_0xec5531+'/'+_0x323002)[_0x83d2('0x34')](_0x1f0414);}return null;};}function patchUpdates(_0x139f8f){return function(_0x7775de){try{jsonpatch['apply'](_0x7775de,_0x139f8f,!![]);}catch(_0xea4cec){return BPromise[_0x83d2('0x35')](_0xea4cec);}return _0x7775de[_0x83d2('0x36')]();};}function saveUpdates(_0x1ef1cf,_0x22f9ec){return function(_0x4d7027){if(_0x4d7027){return _0x4d7027[_0x83d2('0x37')](_0x1ef1cf)['then'](function(_0x83c515){return _0x83c515;});}return null;};}function removeEntity(_0x457ceb,_0x59741c){return function(_0xc07f7d){if(_0xc07f7d){return _0xc07f7d['destroy']()[_0x83d2('0x38')](function(){_0x457ceb[_0x83d2('0x2f')](0xcc)[_0x83d2('0x2e')]();});}};}function handleEntityNotFound(_0x5db912,_0x588026){return function(_0x55eeec){if(!_0x55eeec){_0x5db912[_0x83d2('0x2d')](0x194);}return _0x55eeec;};}function handleError(_0x4ff486,_0x2fe9b2){_0x2fe9b2=_0x2fe9b2||0x1f4;return function(_0x48cf07){logger[_0x83d2('0x29')](_0x48cf07[_0x83d2('0x39')]);if(_0x48cf07[_0x83d2('0x3a')]){delete _0x48cf07[_0x83d2('0x3a')];}_0x4ff486[_0x83d2('0x2f')](_0x2fe9b2)[_0x83d2('0x3b')](_0x48cf07);};}exports['index']=function(_0x555605,_0x100b11){var _0xb3c6fb={},_0x519a32={},_0x48762d={'count':0x0,'rows':[]};var _0x356d9f=db[_0x83d2('0x3c')]['rawAttributes'];_0x519a32[_0x83d2('0x3d')]=_[_0x83d2('0x3e')](_0x356d9f);_0x519a32['query']=_[_0x83d2('0x3e')](_0x555605[_0x83d2('0x3f')]);_0x519a32[_0x83d2('0x40')]=_[_0x83d2('0x41')](_0x519a32[_0x83d2('0x3d')],_0x519a32['query']);_0xb3c6fb[_0x83d2('0x42')]=_[_0x83d2('0x41')](_0x519a32[_0x83d2('0x3d')],qs[_0x83d2('0x43')](_0x555605[_0x83d2('0x3f')][_0x83d2('0x43')]));_0xb3c6fb[_0x83d2('0x42')]=_0xb3c6fb[_0x83d2('0x42')][_0x83d2('0x44')]?_0xb3c6fb[_0x83d2('0x42')]:_0x519a32['model'];if(!_0x555605[_0x83d2('0x3f')][_0x83d2('0x45')](_0x83d2('0x46'))){_0xb3c6fb['limit']=qs[_0x83d2('0x31')](_0x555605[_0x83d2('0x3f')][_0x83d2('0x31')]);_0xb3c6fb['offset']=qs[_0x83d2('0x30')](_0x555605[_0x83d2('0x3f')]['offset']);}_0xb3c6fb[_0x83d2('0x47')]=qs[_0x83d2('0x48')](_0x555605['query'][_0x83d2('0x48')]);_0xb3c6fb[_0x83d2('0x49')]=qs[_0x83d2('0x40')](_[_0x83d2('0x4a')](_0x555605[_0x83d2('0x3f')],_0x519a32[_0x83d2('0x40')]));if(_0x555605[_0x83d2('0x3f')][_0x83d2('0x4b')]){_0xb3c6fb['where']=_[_0x83d2('0x4c')](_0xb3c6fb[_0x83d2('0x49')],{'$or':_[_0x83d2('0x4d')](_0x356d9f,function(_0x27ce7c){if(_0x27ce7c['type'][_0x83d2('0x4e')]!==_0x83d2('0x4f')){var _0x4c0f67={};_0x4c0f67[_0x27ce7c['field']]={'$like':'%'+_0x555605[_0x83d2('0x3f')][_0x83d2('0x4b')]+'%'};return _0x4c0f67;}})});}_0xb3c6fb=_[_0x83d2('0x4c')]({},_0xb3c6fb,_0x555605['options']);var _0x503e8c={'where':_0xb3c6fb[_0x83d2('0x49')]};return db[_0x83d2('0x3c')][_0x83d2('0x50')](_0x503e8c)['then'](function(_0x21d6e6){_0x48762d[_0x83d2('0x50')]=_0x21d6e6;if(_0x555605[_0x83d2('0x3f')][_0x83d2('0x51')]){_0xb3c6fb[_0x83d2('0x52')]=[{'all':!![]}];}return db[_0x83d2('0x3c')][_0x83d2('0x53')](_0xb3c6fb);})[_0x83d2('0x38')](function(_0x1101c7){_0x48762d[_0x83d2('0x54')]=_0x1101c7;return _0x48762d;})[_0x83d2('0x38')](respondWithFilteredResult(_0x100b11,_0xb3c6fb))[_0x83d2('0x2c')](handleError(_0x100b11,null));};exports['show']=function(_0x5eb23a,_0x483f1c){var _0x50c79c={'raw':![],'where':{'id':_0x5eb23a['params']['id']}},_0x43e301={};_0x43e301[_0x83d2('0x3d')]=_[_0x83d2('0x3e')](db[_0x83d2('0x3c')][_0x83d2('0x55')]);_0x43e301[_0x83d2('0x3f')]=_[_0x83d2('0x3e')](_0x5eb23a[_0x83d2('0x3f')]);_0x43e301['filters']=_[_0x83d2('0x41')](_0x43e301[_0x83d2('0x3d')],_0x43e301[_0x83d2('0x3f')]);_0x50c79c['attributes']=_[_0x83d2('0x41')](_0x43e301[_0x83d2('0x3d')],qs[_0x83d2('0x43')](_0x5eb23a['query'][_0x83d2('0x43')]));_0x50c79c[_0x83d2('0x42')]=_0x50c79c['attributes'][_0x83d2('0x44')]?_0x50c79c[_0x83d2('0x42')]:_0x43e301[_0x83d2('0x3d')];if(_0x5eb23a['query'][_0x83d2('0x51')]){_0x50c79c[_0x83d2('0x52')]=[{'all':!![]}];}_0x50c79c=_['merge']({},_0x50c79c,_0x5eb23a[_0x83d2('0x56')]);return db[_0x83d2('0x3c')][_0x83d2('0x57')](_0x50c79c)[_0x83d2('0x38')](handleEntityNotFound(_0x483f1c,null))['then'](respondWithResult(_0x483f1c,null))[_0x83d2('0x2c')](handleError(_0x483f1c,null));};exports[_0x83d2('0x58')]=function(_0x5a5b7a,_0x20ff7e){return db[_0x83d2('0x3c')]['create'](_0x5a5b7a['body'],{})[_0x83d2('0x38')](respondWithResult(_0x20ff7e,0xc9))[_0x83d2('0x2c')](handleError(_0x20ff7e,null));};exports[_0x83d2('0x37')]=function(_0x390ecd,_0x214cd3){if(_0x390ecd[_0x83d2('0x59')]['id']){delete _0x390ecd['body']['id'];}return db[_0x83d2('0x3c')]['find']({'where':{'id':_0x390ecd['params']['id']}})[_0x83d2('0x38')](handleEntityNotFound(_0x214cd3,null))[_0x83d2('0x38')](saveUpdates(_0x390ecd[_0x83d2('0x59')],null))['then'](respondWithResult(_0x214cd3,null))[_0x83d2('0x2c')](handleError(_0x214cd3,null));};exports[_0x83d2('0x5a')]=function(_0x502fdf,_0x1979d){return db[_0x83d2('0x3c')][_0x83d2('0x57')]({'where':{'id':_0x502fdf[_0x83d2('0x5b')]['id']}})[_0x83d2('0x38')](handleEntityNotFound(_0x1979d,null))['then'](removeEntity(_0x1979d,null))[_0x83d2('0x2c')](handleError(_0x1979d,null));};exports['getConfigurations']=function(_0x427271,_0x4182bb,_0x1e06a3){var _0x50cc4c={};var _0x38218c={};var _0x3dea74;var _0x3f8ddb;return db[_0x83d2('0x3c')]['findOne']({'where':{'id':_0x427271[_0x83d2('0x5b')]['id']}})['then'](handleEntityNotFound(_0x4182bb,null))['then'](function(_0x361800){if(_0x361800){_0x3dea74=_0x361800;_0x38218c[_0x83d2('0x3d')]=_['keys'](db[_0x83d2('0x5c')][_0x83d2('0x55')]);_0x38218c[_0x83d2('0x3f')]=_[_0x83d2('0x3e')](_0x427271[_0x83d2('0x3f')]);_0x38218c[_0x83d2('0x40')]=_[_0x83d2('0x41')](_0x38218c[_0x83d2('0x3d')],_0x38218c[_0x83d2('0x3f')]);_0x50cc4c[_0x83d2('0x42')]=_['intersection'](_0x38218c[_0x83d2('0x3d')],qs['fields'](_0x427271[_0x83d2('0x3f')]['fields']));_0x50cc4c[_0x83d2('0x42')]=_0x50cc4c['attributes'][_0x83d2('0x44')]?_0x50cc4c[_0x83d2('0x42')]:_0x38218c[_0x83d2('0x3d')];_0x50cc4c['order']=qs[_0x83d2('0x48')](_0x427271[_0x83d2('0x3f')]['sort']);_0x50cc4c[_0x83d2('0x49')]=qs[_0x83d2('0x40')](_[_0x83d2('0x4a')](_0x427271[_0x83d2('0x3f')],_0x38218c[_0x83d2('0x40')]));if(_0x427271[_0x83d2('0x3f')][_0x83d2('0x4b')]){_0x50cc4c[_0x83d2('0x49')]=_[_0x83d2('0x4c')](_0x50cc4c['where'],{'$or':_['map'](_0x50cc4c[_0x83d2('0x42')],function(_0x571550){var _0x46f6bf={};_0x46f6bf[_0x571550]={'$like':'%'+_0x427271[_0x83d2('0x3f')][_0x83d2('0x4b')]+'%'};return _0x46f6bf;})});}_0x50cc4c=_[_0x83d2('0x4c')]({},_0x50cc4c,_0x427271[_0x83d2('0x56')]);return _0x3dea74[_0x83d2('0x5d')](_0x50cc4c);}})[_0x83d2('0x38')](function(_0x5afd80){if(_0x5afd80){_0x3f8ddb=_0x5afd80[_0x83d2('0x44')];if(!_0x427271[_0x83d2('0x3f')]['hasOwnProperty'](_0x83d2('0x46'))){_0x50cc4c[_0x83d2('0x31')]=qs[_0x83d2('0x31')](_0x427271[_0x83d2('0x3f')]['limit']);_0x50cc4c[_0x83d2('0x30')]=qs[_0x83d2('0x30')](_0x427271['query'][_0x83d2('0x30')]);}return _0x3dea74['getConfigurations'](_0x50cc4c);}})['then'](function(_0x3af142){if(_0x3af142){return _0x3af142?{'count':_0x3f8ddb,'rows':_0x3af142}:null;}})[_0x83d2('0x38')](respondWithResult(_0x4182bb,null))[_0x83d2('0x2c')](handleError(_0x4182bb,null));};exports[_0x83d2('0x5e')]=function(_0x238434,_0x25c1e3,_0x47dd7){if(_0x238434[_0x83d2('0x59')]['id']){delete _0x238434[_0x83d2('0x59')]['id'];}return db[_0x83d2('0x3c')][_0x83d2('0x5f')]({'where':{'id':_0x238434[_0x83d2('0x5b')]['id']}})[_0x83d2('0x38')](handleEntityNotFound(_0x25c1e3,null))[_0x83d2('0x38')](function(_0x4f0da5){if(_0x4f0da5){_0x238434[_0x83d2('0x59')][_0x83d2('0x60')]=_0x4f0da5['id'];_0x238434[_0x83d2('0x59')][_0x83d2('0x61')]=integrations['getSubjects'](_0x238434[_0x83d2('0x59')][_0x83d2('0x62')],_0x238434[_0x83d2('0x59')]['type']);_0x238434[_0x83d2('0x59')]['Descriptions']=integrations[_0x83d2('0x63')](_0x238434[_0x83d2('0x59')][_0x83d2('0x62')],_0x238434[_0x83d2('0x59')][_0x83d2('0x64')]);return db[_0x83d2('0x5c')]['create'](_0x238434[_0x83d2('0x59')],{'include':[{'model':db[_0x83d2('0x65')],'as':'Subjects'},{'model':db['Dynamics365Field'],'as':'Descriptions'}]});}return null;})[_0x83d2('0x38')](respondWithResult(_0x25c1e3,null))[_0x83d2('0x2c')](handleError(_0x25c1e3,null));};exports[_0x83d2('0x66')]=function(_0x24ef88,_0x40e53c,_0x452916){var _0x1e18fa=_0x24ef88[_0x83d2('0x3f')][_0x83d2('0x67')];var _0x4232af=_0x1e18fa===_0x83d2('0x68')?_0x83d2('0x69'):_0x83d2('0x6a');var _0x285379='';var _0x19ffa7='';var _0xca7323='';var _0x4114f7='';var _0x32ab21='';var _0x563ee3='';var _0x10d975='';var _0x482895='';var _0x4c8264=['title','description',_0x83d2('0x6b'),_0x83d2('0x6c'),_0x83d2('0x6d'),_0x83d2('0x6e'),'phonenumber',_0x83d2('0x6f'),_0x83d2('0x70'),_0x83d2('0x71')];var _0x5eac62=[_0x83d2('0x72'),_0x83d2('0x73'),'actualserviceunits',_0x83d2('0x74'),'contactidname',_0x83d2('0x75'),_0x83d2('0x76'),_0x83d2('0x77'),_0x83d2('0x78'),_0x83d2('0x79'),_0x83d2('0x7a'),_0x83d2('0x7b'),_0x83d2('0x7c'),_0x83d2('0x7d'),_0x83d2('0x7e'),_0x83d2('0x7f'),_0x83d2('0x80'),_0x83d2('0x81'),_0x83d2('0x82'),_0x83d2('0x83'),_0x83d2('0x84'),_0x83d2('0x85'),_0x83d2('0x86'),'exchangerate','firstresponsebykpiidname',_0x83d2('0x87'),_0x83d2('0x88'),_0x83d2('0x89'),_0x83d2('0x8a'),_0x83d2('0x8b'),_0x83d2('0x8c'),_0x83d2('0x8d'),'modifiedbyexternalpartyyominame',_0x83d2('0x8e'),_0x83d2('0x8f'),_0x83d2('0x90'),_0x83d2('0x91'),_0x83d2('0x92'),'msdyn_incidenttypename',_0x83d2('0x93'),_0x83d2('0x94'),'onholdtime',_0x83d2('0x95'),'owneridname',_0x83d2('0x96'),_0x83d2('0x97'),'parentcaseidname',_0x83d2('0x98'),_0x83d2('0x99'),'prioritycodename',_0x83d2('0x9a'),_0x83d2('0x9b'),_0x83d2('0x9c'),'resolvebykpiidname',_0x83d2('0x9d'),'responsiblecontactidname',_0x83d2('0x9e'),_0x83d2('0x9f'),_0x83d2('0xa0'),_0x83d2('0xa1'),_0x83d2('0xa2'),'statecode','statuscode',_0x83d2('0xa3'),_0x83d2('0xa4'),'timezoneruleversionnumber','transactioncurrencyidname',_0x83d2('0xa5'),_0x83d2('0xa6'),_0x83d2('0xa7')];var _0x1789e4=_0x4c8264[_0x83d2('0xa8')](_0x5eac62);return db[_0x83d2('0x3c')]['findOne']({'where':{'id':_0x24ef88['params']['id']},'attributes':['id','username',_0x83d2('0xa9'),_0x83d2('0xaa'),_0x83d2('0xab'),'clientId',_0x83d2('0xac')]})[_0x83d2('0x38')](handleEntityNotFound(_0x40e53c,null))[_0x83d2('0x38')](function(_0x3453ec){if(_0x3453ec){_0x482895=_0x3453ec[_0x83d2('0xaa')];var _0x40246b=_0x482895[_0x83d2('0xad')](-0x1);if(_0x40246b==='/'){_0x482895=_0x482895[_0x83d2('0xae')](0x0,_0x482895[_0x83d2('0xaf')](_0x40246b));}_0x10d975=util[_0x83d2('0xb0')](_0x83d2('0xb1'),_0x482895);var _0x4e53ee={'method':_0x83d2('0xb2'),'uri':'https://login.microsoftonline.com/'+_0x3453ec[_0x83d2('0xab')]+_0x83d2('0xb3'),'form':{'client_id':_0x3453ec[_0x83d2('0xb4')],'resource':_0x482895,'username':_0x3453ec[_0x83d2('0xb5')],'password':_0x3453ec[_0x83d2('0xa9')],'grant_type':_0x83d2('0xa9'),'client_secret':_0x3453ec[_0x83d2('0xac')]},'json':!![]};return rp(_0x4e53ee);}})['then'](function(_0x3edd86){_0x563ee3=_0x3edd86[_0x83d2('0xb6')];var _0x7fe7ef={'method':'GET','uri':encodeURI(_0x10d975+_0x83d2('0xb7')+_0x4232af+'\x27'),'headers':{'Authorization':_0x83d2('0xb8')+_0x563ee3,'If-None-Match':null,'OData-Version':_0x83d2('0xb9')},'json':!![]};return rp(_0x7fe7ef);})[_0x83d2('0x38')](function(_0x38fa6a){var _0x4864b0=_0x38fa6a[_0x83d2('0xba')][0x0];var _0x596ee8=_0x4864b0[_0x83d2('0xbb')];var _0x506dcf={'method':_0x83d2('0xbc'),'uri':_0x10d975+_0x83d2('0xbd')+_0x596ee8+_0x83d2('0xbe'),'headers':{'Authorization':_0x83d2('0xb8')+_0x563ee3,'If-None-Match':null,'OData-Version':_0x83d2('0xb9')},'json':!![]};return rp(_0x506dcf);})[_0x83d2('0x38')](function(_0x6f1766){_0x285379=_0x6f1766;_0x19ffa7=_0x285379['Attributes'];_0x19ffa7=_[_0x83d2('0xbf')](_0x19ffa7,function(_0x3823d8){return!_0x1789e4[_0x83d2('0xc0')](_0x3823d8[_0x83d2('0xc1')]);});var _0x4291dc=[];var _0x193210=[];_0x19ffa7[_0x83d2('0xc2')](function(_0x3e46d3){if(_0x3e46d3[_0x83d2('0xc3')]){var _0x470aad=_0x3e46d3[_0x83d2('0xc3')][_0x83d2('0xae')](_0x3e46d3['@odata.type']['lastIndexOf']('.')+0x1);if(_0x470aad===_0x83d2('0xc4')){_0x4291dc['push'](getSelectList(_0x10d975,_0x1e18fa,_0x193210,_0x285379[_0x83d2('0xbb')],_0x3e46d3[_0x83d2('0xbb')],_0x563ee3));}}});return Promise[_0x83d2('0xc5')](_0x4291dc);})[_0x83d2('0x38')](function(_0x4dde77){_0xca7323=_0x4dde77[0x0];var _0x4d013c=[];var _0x3bf41b=[];_0x19ffa7['forEach'](function(_0x1e2c66){if(!_[_0x83d2('0xc6')](_0x1e2c66[_0x83d2('0xc3')])){var _0x21639b=_0x1e2c66[_0x83d2('0xc3')]['substring'](_0x1e2c66[_0x83d2('0xc3')]['lastIndexOf']('.')+0x1);if(_0x21639b===_0x83d2('0xc7')){_0x4d013c['push'](getBooleanList(_0x10d975,_0x1e18fa,_0x3bf41b,_0x285379['MetadataId'],_0x1e2c66[_0x83d2('0xbb')],_0x563ee3));}}});return Promise[_0x83d2('0xc5')](_0x4d013c);})[_0x83d2('0x38')](function(_0x573131){_0x4114f7=_0x573131[0x0];var _0x377475=[];var _0x3c04cb=[];_0x19ffa7[_0x83d2('0xc2')](function(_0x1c0e67){if(_0x1c0e67['@odata.type']){var _0x19d1c2=_0x1c0e67[_0x83d2('0xc3')]['substring'](_0x1c0e67[_0x83d2('0xc3')][_0x83d2('0xaf')]('.')+0x1);if(_0x19d1c2===_0x83d2('0xc8')||_0x19d1c2===_0x83d2('0xc9')||_0x19d1c2===_0x83d2('0xca')||_0x19d1c2===_0x83d2('0xcb')||_0x19d1c2==='MemoAttributeMetadata'||_0x19d1c2==='DateTimeAttributeMetadata'||_0x19d1c2===_0x83d2('0xcc')||_0x19d1c2===_0x83d2('0xcd')||_0x19d1c2===_0x83d2('0xce')||_0x19d1c2==='DecimalAttributeMetadata'){_0x377475['push'](getInputList(_0x10d975,_0x1e18fa,_0x19d1c2,_0x3c04cb,_0x285379[_0x83d2('0xbb')],_0x1c0e67[_0x83d2('0xbb')],_0x563ee3));}}});return Promise[_0x83d2('0xc5')](_0x377475);})[_0x83d2('0x38')](function(_0x535b97){_0x32ab21=_0x535b97[0x0];var _0x1d2f9c=_0xca7323[_0x83d2('0xa8')](_0x4114f7)[_0x83d2('0xa8')](_0x32ab21);var _0x114a0d={'count':_0x1d2f9c[_0x83d2('0x44')],'rows':_0x1d2f9c};return _0x114a0d;})[_0x83d2('0x38')](respondWithResult(_0x40e53c,null))[_0x83d2('0x2c')](function(_0x354144){console['log']('Dynamics365\x20error:\x20'+_0x354144);var _0x32a040=_0x24ef88['query'][_0x83d2('0x20')]?0x1f4:_0x354144[_0x83d2('0xcf')]||0x1f4;logger[_0x83d2('0x29')](_0x354144[_0x83d2('0x39')]);delete _0x354144['name'];if(_0x32a040===0x191){_0x32a040=0x190;}_0x40e53c[_0x83d2('0x2f')](_0x32a040)[_0x83d2('0x3b')](_0x24ef88[_0x83d2('0x3f')][_0x83d2('0x20')]?{'message':_0x83d2('0xd0'),'statusCode':_0x354144['statusCode']}:_0x354144);});};function getSelectList(_0xa5e256,_0x507f2f,_0x799507,_0x47f324,_0x2096f9,_0x37a97f){var _0xbae0cf={'method':_0x83d2('0xbc'),'uri':_0xa5e256+'EntityDefinitions('+_0x47f324+_0x83d2('0xd1')+_0x2096f9+')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?'+_0x83d2('0xd2'),'headers':{'Authorization':_0x83d2('0xb8')+_0x37a97f,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0xbae0cf)[_0x83d2('0x38')](function(_0x4aa4e7){var _0x1ea659=[];var _0x29ed8d=_0x4aa4e7[_0x83d2('0xd3')][_0x83d2('0xd4')];_0x29ed8d[_0x83d2('0xc2')](function(_0x394ccc){_0x1ea659[_0x83d2('0xd5')]({'name':_0x394ccc[_0x83d2('0xd6')][_0x83d2('0xd7')][_0x83d2('0xd6')],'value':String(_0x394ccc[_0x83d2('0xd8')])});});var _0x1cb19e={'id':_0x507f2f+'_'+_0x4aa4e7[_0x83d2('0xc1')],'name':_0x4aa4e7[_0x83d2('0xd9')][_0x83d2('0xd7')][_0x83d2('0xd6')],'custom':![],'options':_0x1ea659};_0x799507[_0x83d2('0xd5')](_0x1cb19e);return _0x799507;});}function getBooleanList(_0x41bbfd,_0x364fc5,_0x52a5d7,_0x3e28ac,_0x32ceca,_0x53fc61){var _0x430d63={'method':'GET','uri':_0x41bbfd+_0x83d2('0xbd')+_0x3e28ac+_0x83d2('0xd1')+_0x32ceca+_0x83d2('0xda'),'headers':{'Authorization':'Bearer\x20'+_0x53fc61,'If-None-Match':null,'OData-Version':_0x83d2('0xb9')},'json':!![]};return rp(_0x430d63)[_0x83d2('0x38')](function(_0x52b86c){var _0x4e90df=[];_0x4e90df[_0x83d2('0xd5')]({'name':_0x52b86c['OptionSet'][_0x83d2('0xdb')]['Label'][_0x83d2('0xd7')]['Label'],'value':'true'},{'name':_0x52b86c[_0x83d2('0xd3')][_0x83d2('0xdc')]['Label']['UserLocalizedLabel'][_0x83d2('0xd6')],'value':_0x83d2('0xdd')});var _0x3a4769={'id':_0x364fc5+'_'+_0x52b86c['LogicalName'],'name':_0x52b86c[_0x83d2('0xd9')][_0x83d2('0xd7')]['Label'],'custom':![],'options':_0x4e90df};_0x52a5d7[_0x83d2('0xd5')](_0x3a4769);return _0x52a5d7;});}function getInputList(_0x185a24,_0x4ba392,_0x2d0dd0,_0x1eb319,_0x5bd6af,_0x1c8b58,_0x4296ec){var _0x58bb45={'method':'GET','uri':_0x185a24+_0x83d2('0xbd')+_0x5bd6af+_0x83d2('0xd1')+_0x1c8b58+_0x83d2('0xde')+_0x2d0dd0+_0x83d2('0xdf'),'headers':{'Authorization':_0x83d2('0xb8')+_0x4296ec,'If-None-Match':null,'OData-Version':_0x83d2('0xb9')},'json':!![]};return rp(_0x58bb45)[_0x83d2('0x38')](function(_0xe19435){var _0x2fa4c3={'id':_0x4ba392+'_'+_0xe19435[_0x83d2('0xc1')],'name':_0xe19435[_0x83d2('0xd9')]['UserLocalizedLabel']?_0xe19435['DisplayName'][_0x83d2('0xd7')][_0x83d2('0xd6')]:_0xe19435[_0x83d2('0xc1')],'custom':![],'options':[]};_0x1eb319[_0x83d2('0xd5')](_0x2fa4c3);return _0x1eb319;});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.model.js b/server/api/intDynamics365Account/intDynamics365Account.model.js index 11d78db..2a36f95 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 _0x8955=['int_dynamics365_accounts','lodash','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration','exports','define','Dynamics365Account'];(function(_0x475e44,_0x5f2d05){var _0x558533=function(_0x5c8129){while(--_0x5c8129){_0x475e44['push'](_0x475e44['shift']());}};_0x558533(++_0x5f2d05);}(_0x8955,0x8d));var _0x5895=function(_0x22202e,_0x131c67){_0x22202e=_0x22202e-0x0;var _0x1da4a1=_0x8955[_0x22202e];return _0x1da4a1;};'use strict';var _=require(_0x5895('0x0'));var util=require(_0x5895('0x1'));var logger=require(_0x5895('0x2'))(_0x5895('0x3'));var moment=require(_0x5895('0x4'));var BPromise=require(_0x5895('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x5895('0x6'));var config=require(_0x5895('0x7'));var attributes=require(_0x5895('0x8'));var integrations=require(_0x5895('0x9'));module[_0x5895('0xa')]=function(_0x5de270,_0xbf083a){return _0x5de270[_0x5895('0xb')](_0x5895('0xc'),attributes,{'tableName':_0x5895('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xff3f=['bluebird','request-promise','path','rimraf','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration','exports','define','Dynamics365Account','lodash','util','../../config/logger','api','moment'];(function(_0x1b828b,_0x344400){var _0x98da1a=function(_0x1a0f5b){while(--_0x1a0f5b){_0x1b828b['push'](_0x1b828b['shift']());}};_0x98da1a(++_0x344400);}(_0xff3f,0x109));var _0xfff3=function(_0x644ecd,_0x397f36){_0x644ecd=_0x644ecd-0x0;var _0x1c66ce=_0xff3f[_0x644ecd];return _0x1c66ce;};'use strict';var _=require(_0xfff3('0x0'));var util=require(_0xfff3('0x1'));var logger=require(_0xfff3('0x2'))(_0xfff3('0x3'));var moment=require(_0xfff3('0x4'));var BPromise=require(_0xfff3('0x5'));var rp=require(_0xfff3('0x6'));var fs=require('fs');var path=require(_0xfff3('0x7'));var rimraf=require(_0xfff3('0x8'));var config=require(_0xfff3('0x9'));var attributes=require(_0xfff3('0xa'));var integrations=require(_0xfff3('0xb'));module[_0xfff3('0xc')]=function(_0x1561d3,_0x1f29ae){return _0x1561d3[_0xfff3('0xd')](_0xfff3('0xe'),attributes,{'tableName':'int_dynamics365_accounts','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 177fea4..3d04d83 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 _0xfba8=['../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','then','info','Dynamics365Account,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','GetDynamics365Account','Dynamics365Account','options','raw','include','map','model','attributes','ShowDynamics365Account','find','where','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x1602ef,_0x447aba){var _0x5870ee=function(_0x4d94e7){while(--_0x4d94e7){_0x1602ef['push'](_0x1602ef['shift']());}};_0x5870ee(++_0x447aba);}(_0xfba8,0x1d6));var _0x8fba=function(_0x537e28,_0x1b33a3){_0x537e28=_0x537e28-0x0;var _0x550a38=_0xfba8[_0x537e28];return _0x550a38;};'use strict';var _=require(_0x8fba('0x0'));var util=require(_0x8fba('0x1'));var moment=require(_0x8fba('0x2'));var BPromise=require(_0x8fba('0x3'));var rs=require(_0x8fba('0x4'));var fs=require('fs');var Redis=require(_0x8fba('0x5'));var db=require(_0x8fba('0x6'))['db'];var utils=require(_0x8fba('0x7'));var logger=require(_0x8fba('0x8'))('rpc');var config=require(_0x8fba('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x8fba('0xa')][_0x8fba('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x38aacc,_0x45a73b,_0x43eeaa){return new BPromise(function(_0x16312d,_0x1794bc){return client['request'](_0x38aacc,_0x43eeaa)[_0x8fba('0xc')](function(_0x589ec6){logger[_0x8fba('0xd')](_0x8fba('0xe'),_0x45a73b,_0x8fba('0xf'));logger[_0x8fba('0x10')]('Dynamics365Account,\x20%s,\x20%s,\x20%s',_0x45a73b,_0x8fba('0xf'),JSON[_0x8fba('0x11')](_0x589ec6));if(_0x589ec6['error']){if(_0x589ec6[_0x8fba('0x12')][_0x8fba('0x13')]===0x1f4){logger['error']('Dynamics365Account,\x20%s,\x20%s',_0x45a73b,_0x589ec6[_0x8fba('0x12')]['message']);return _0x1794bc(_0x589ec6[_0x8fba('0x12')][_0x8fba('0x14')]);}logger[_0x8fba('0x12')](_0x8fba('0xe'),_0x45a73b,_0x589ec6[_0x8fba('0x12')][_0x8fba('0x14')]);return _0x16312d(_0x589ec6['error']['message']);}else{logger[_0x8fba('0xd')](_0x8fba('0xe'),_0x45a73b,_0x8fba('0xf'));_0x16312d(_0x589ec6[_0x8fba('0x15')][_0x8fba('0x14')]);}})[_0x8fba('0x16')](function(_0x5223b7){logger[_0x8fba('0x12')](_0x8fba('0xe'),_0x45a73b,_0x5223b7);_0x1794bc(_0x5223b7);});});}exports[_0x8fba('0x17')]=function(_0x3194e7){var _0x37a826=this;return new Promise(function(_0x3aba78,_0x3e42ad){return db[_0x8fba('0x18')]['findAll']({'raw':_0x3194e7[_0x8fba('0x19')]?_0x3194e7[_0x8fba('0x19')][_0x8fba('0x1a')]===undefined?!![]:![]:!![],'where':_0x3194e7[_0x8fba('0x19')]?_0x3194e7[_0x8fba('0x19')]['where']||null:null,'attributes':_0x3194e7[_0x8fba('0x19')]?_0x3194e7[_0x8fba('0x19')]['attributes']||null:null,'limit':_0x3194e7[_0x8fba('0x19')]?_0x3194e7['options']['limit']||null:null,'include':_0x3194e7[_0x8fba('0x19')]?_0x3194e7['options'][_0x8fba('0x1b')]?_[_0x8fba('0x1c')](_0x3194e7[_0x8fba('0x19')][_0x8fba('0x1b')],function(_0x52eebd){return{'model':db[_0x52eebd[_0x8fba('0x1d')]],'as':_0x52eebd['as'],'attributes':_0x52eebd[_0x8fba('0x1e')],'include':_0x52eebd[_0x8fba('0x1b')]?_['map'](_0x52eebd[_0x8fba('0x1b')],function(_0x5030c4){return{'model':db[_0x5030c4[_0x8fba('0x1d')]],'as':_0x5030c4['as'],'attributes':_0x5030c4[_0x8fba('0x1e')],'include':_0x5030c4[_0x8fba('0x1b')]?_['map'](_0x5030c4['include'],function(_0x38ad81){return{'model':db[_0x38ad81[_0x8fba('0x1d')]],'as':_0x38ad81['as'],'attributes':_0x38ad81[_0x8fba('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x8fba('0xc')](function(_0x964d27){logger[_0x8fba('0xd')]('GetDynamics365Account',_0x3194e7);logger['debug'](_0x8fba('0x17'),_0x3194e7,JSON[_0x8fba('0x11')](_0x964d27));_0x3aba78(_0x964d27);})[_0x8fba('0x16')](function(_0x20fd52){logger[_0x8fba('0x12')](_0x8fba('0x17'),_0x20fd52[_0x8fba('0x14')],_0x3194e7);_0x3e42ad(_0x37a826[_0x8fba('0x12')](0x1f4,_0x20fd52['message']));});});};exports[_0x8fba('0x1f')]=function(_0x4cf857){var _0x3774a0=this;return new Promise(function(_0x457d4e,_0x297ff9){return db[_0x8fba('0x18')][_0x8fba('0x20')]({'raw':_0x4cf857[_0x8fba('0x19')]?_0x4cf857[_0x8fba('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x4cf857['options']?_0x4cf857[_0x8fba('0x19')][_0x8fba('0x21')]||null:null,'attributes':_0x4cf857[_0x8fba('0x19')]?_0x4cf857[_0x8fba('0x19')]['attributes']||null:null,'include':_0x4cf857[_0x8fba('0x19')]?_0x4cf857[_0x8fba('0x19')][_0x8fba('0x1b')]?_[_0x8fba('0x1c')](_0x4cf857[_0x8fba('0x19')][_0x8fba('0x1b')],function(_0x4591d0){return{'model':db[_0x4591d0[_0x8fba('0x1d')]],'as':_0x4591d0['as'],'attributes':_0x4591d0[_0x8fba('0x1e')],'include':_0x4591d0[_0x8fba('0x1b')]?_[_0x8fba('0x1c')](_0x4591d0[_0x8fba('0x1b')],function(_0x1c374e){return{'model':db[_0x1c374e[_0x8fba('0x1d')]],'as':_0x1c374e['as'],'attributes':_0x1c374e[_0x8fba('0x1e')],'include':_0x1c374e[_0x8fba('0x1b')]?_['map'](_0x1c374e[_0x8fba('0x1b')],function(_0x386546){return{'model':db[_0x386546[_0x8fba('0x1d')]],'as':_0x386546['as'],'attributes':_0x386546[_0x8fba('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x8fba('0xc')](function(_0x4b73a0){logger[_0x8fba('0xd')](_0x8fba('0x1f'),_0x4cf857);logger[_0x8fba('0x10')](_0x8fba('0x1f'),_0x4cf857,JSON['stringify'](_0x4b73a0));_0x457d4e(_0x4b73a0);})[_0x8fba('0x16')](function(_0x498ade){logger[_0x8fba('0x12')](_0x8fba('0x1f'),_0x498ade[_0x8fba('0x14')],_0x4cf857);_0x297ff9(_0x3774a0[_0x8fba('0x12')](0x1f4,_0x498ade[_0x8fba('0x14')]));});});}; \ No newline at end of file +var _0x0755=['Dynamics365Account','findAll','options','where','include','map','attributes','model','debug','ShowDynamics365Account','find','raw','then','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','request\x20sent','stringify','error','code','Dynamics365Account,\x20%s,\x20%s','message','info','result','catch','GetDynamics365Account'];(function(_0x2e74a5,_0x19c708){var _0x841098=function(_0x527d34){while(--_0x527d34){_0x2e74a5['push'](_0x2e74a5['shift']());}};_0x841098(++_0x19c708);}(_0x0755,0x7c));var _0x5075=function(_0x593f06,_0x233bc7){_0x593f06=_0x593f06-0x0;var _0x310a7b=_0x0755[_0x593f06];return _0x310a7b;};'use strict';var _=require(_0x5075('0x0'));var util=require(_0x5075('0x1'));var moment=require(_0x5075('0x2'));var BPromise=require(_0x5075('0x3'));var rs=require(_0x5075('0x4'));var fs=require('fs');var Redis=require(_0x5075('0x5'));var db=require(_0x5075('0x6'))['db'];var utils=require(_0x5075('0x7'));var logger=require(_0x5075('0x8'))(_0x5075('0x9'));var config=require('../../config/environment');var jayson=require(_0x5075('0xa'));var client=jayson[_0x5075('0xb')][_0x5075('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2e39f4,_0x57f9e8,_0x52bb37){return new BPromise(function(_0x4f882e,_0x41d88f){return client[_0x5075('0xd')](_0x2e39f4,_0x52bb37)['then'](function(_0x1782e9){logger['info']('Dynamics365Account,\x20%s,\x20%s',_0x57f9e8,_0x5075('0xe'));logger['debug']('Dynamics365Account,\x20%s,\x20%s,\x20%s',_0x57f9e8,_0x5075('0xe'),JSON[_0x5075('0xf')](_0x1782e9));if(_0x1782e9[_0x5075('0x10')]){if(_0x1782e9['error'][_0x5075('0x11')]===0x1f4){logger['error'](_0x5075('0x12'),_0x57f9e8,_0x1782e9[_0x5075('0x10')][_0x5075('0x13')]);return _0x41d88f(_0x1782e9[_0x5075('0x10')][_0x5075('0x13')]);}logger[_0x5075('0x10')](_0x5075('0x12'),_0x57f9e8,_0x1782e9[_0x5075('0x10')][_0x5075('0x13')]);return _0x4f882e(_0x1782e9[_0x5075('0x10')][_0x5075('0x13')]);}else{logger[_0x5075('0x14')](_0x5075('0x12'),_0x57f9e8,'request\x20sent');_0x4f882e(_0x1782e9[_0x5075('0x15')][_0x5075('0x13')]);}})[_0x5075('0x16')](function(_0x381b3b){logger[_0x5075('0x10')]('Dynamics365Account,\x20%s,\x20%s',_0x57f9e8,_0x381b3b);_0x41d88f(_0x381b3b);});});}exports[_0x5075('0x17')]=function(_0xc8b69a){var _0x4dbe45=this;return new Promise(function(_0x2159a8,_0x2beeaf){return db[_0x5075('0x18')][_0x5075('0x19')]({'raw':_0xc8b69a['options']?_0xc8b69a[_0x5075('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0xc8b69a[_0x5075('0x1a')]?_0xc8b69a['options'][_0x5075('0x1b')]||null:null,'attributes':_0xc8b69a['options']?_0xc8b69a[_0x5075('0x1a')]['attributes']||null:null,'limit':_0xc8b69a[_0x5075('0x1a')]?_0xc8b69a[_0x5075('0x1a')]['limit']||null:null,'include':_0xc8b69a['options']?_0xc8b69a['options'][_0x5075('0x1c')]?_[_0x5075('0x1d')](_0xc8b69a[_0x5075('0x1a')][_0x5075('0x1c')],function(_0x1d7758){return{'model':db[_0x1d7758['model']],'as':_0x1d7758['as'],'attributes':_0x1d7758[_0x5075('0x1e')],'include':_0x1d7758[_0x5075('0x1c')]?_[_0x5075('0x1d')](_0x1d7758['include'],function(_0x1f16cc){return{'model':db[_0x1f16cc[_0x5075('0x1f')]],'as':_0x1f16cc['as'],'attributes':_0x1f16cc['attributes'],'include':_0x1f16cc[_0x5075('0x1c')]?_[_0x5075('0x1d')](_0x1f16cc[_0x5075('0x1c')],function(_0x38a4ea){return{'model':db[_0x38a4ea['model']],'as':_0x38a4ea['as'],'attributes':_0x38a4ea['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x3b3d0b){logger[_0x5075('0x14')]('GetDynamics365Account',_0xc8b69a);logger[_0x5075('0x20')](_0x5075('0x17'),_0xc8b69a,JSON[_0x5075('0xf')](_0x3b3d0b));_0x2159a8(_0x3b3d0b);})['catch'](function(_0x264777){logger['error']('GetDynamics365Account',_0x264777[_0x5075('0x13')],_0xc8b69a);_0x2beeaf(_0x4dbe45[_0x5075('0x10')](0x1f4,_0x264777[_0x5075('0x13')]));});});};exports[_0x5075('0x21')]=function(_0x5e87b0){var _0x362711=this;return new Promise(function(_0x1edab4,_0x8290e7){return db['Dynamics365Account'][_0x5075('0x22')]({'raw':_0x5e87b0[_0x5075('0x1a')]?_0x5e87b0[_0x5075('0x1a')][_0x5075('0x23')]===undefined?!![]:![]:!![],'where':_0x5e87b0['options']?_0x5e87b0[_0x5075('0x1a')][_0x5075('0x1b')]||null:null,'attributes':_0x5e87b0[_0x5075('0x1a')]?_0x5e87b0['options'][_0x5075('0x1e')]||null:null,'include':_0x5e87b0[_0x5075('0x1a')]?_0x5e87b0[_0x5075('0x1a')][_0x5075('0x1c')]?_[_0x5075('0x1d')](_0x5e87b0['options'][_0x5075('0x1c')],function(_0x305b99){return{'model':db[_0x305b99['model']],'as':_0x305b99['as'],'attributes':_0x305b99[_0x5075('0x1e')],'include':_0x305b99['include']?_['map'](_0x305b99['include'],function(_0x1a5e7c){return{'model':db[_0x1a5e7c[_0x5075('0x1f')]],'as':_0x1a5e7c['as'],'attributes':_0x1a5e7c[_0x5075('0x1e')],'include':_0x1a5e7c['include']?_[_0x5075('0x1d')](_0x1a5e7c['include'],function(_0x50c23d){return{'model':db[_0x50c23d[_0x5075('0x1f')]],'as':_0x50c23d['as'],'attributes':_0x50c23d['attributes']};}):[]};}):[]};}):[]:[]})[_0x5075('0x24')](function(_0x1e0435){logger['info'](_0x5075('0x21'),_0x5e87b0);logger[_0x5075('0x20')](_0x5075('0x21'),_0x5e87b0,JSON['stringify'](_0x1e0435));_0x1edab4(_0x1e0435);})[_0x5075('0x16')](function(_0x32af7f){logger[_0x5075('0x10')](_0x5075('0x21'),_0x32af7f[_0x5075('0x13')],_0x5e87b0);_0x8290e7(_0x362711[_0x5075('0x10')](0x1f4,_0x32af7f[_0x5075('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/index.js b/server/api/intDynamics365Configuration/index.js index 9c01403..05a20a6 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 _0x5edb=['getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','create','put','/:id','update','destroy','exports','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Configuration.controller','get','index','isAuthenticated','show'];(function(_0x412686,_0x3fde24){var _0x18619e=function(_0x862bd1){while(--_0x862bd1){_0x412686['push'](_0x412686['shift']());}};_0x18619e(++_0x3fde24);}(_0x5edb,0xda));var _0xb5ed=function(_0x5ede2b,_0x4613fb){_0x5ede2b=_0x5ede2b-0x0;var _0xc01dda=_0x5edb[_0x5ede2b];return _0xc01dda;};'use strict';var multer=require('multer');var util=require(_0xb5ed('0x0'));var path=require('path');var timeout=require(_0xb5ed('0x1'));var express=require(_0xb5ed('0x2'));var router=express[_0xb5ed('0x3')]();var auth=require(_0xb5ed('0x4'));var interaction=require(_0xb5ed('0x5'));var config=require(_0xb5ed('0x6'));var controller=require(_0xb5ed('0x7'));router[_0xb5ed('0x8')]('/',auth['isAuthenticated'](),controller[_0xb5ed('0x9')]);router[_0xb5ed('0x8')]('/:id',auth[_0xb5ed('0xa')](),controller[_0xb5ed('0xb')]);router[_0xb5ed('0x8')]('/:id/fields',auth[_0xb5ed('0xa')](),controller[_0xb5ed('0xc')]);router[_0xb5ed('0x8')](_0xb5ed('0xd'),auth[_0xb5ed('0xa')](),controller[_0xb5ed('0xe')]);router[_0xb5ed('0x8')](_0xb5ed('0xf'),auth[_0xb5ed('0xa')](),controller[_0xb5ed('0x10')]);router['post']('/',auth[_0xb5ed('0xa')](),controller[_0xb5ed('0x11')]);router[_0xb5ed('0x12')](_0xb5ed('0x13'),auth[_0xb5ed('0xa')](),controller[_0xb5ed('0x14')]);router['delete']('/:id',auth[_0xb5ed('0xa')](),controller[_0xb5ed('0x15')]);module[_0xb5ed('0x16')]=router; \ No newline at end of file +var _0x0b13=['put','/:id','update','delete','destroy','exports','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Configuration.controller','get','isAuthenticated','index','show','/:id/subjects','getSubjects','getDescriptions','post','create'];(function(_0x319227,_0x3e6546){var _0x2927b2=function(_0x5845b3){while(--_0x5845b3){_0x319227['push'](_0x319227['shift']());}};_0x2927b2(++_0x3e6546);}(_0x0b13,0x18d));var _0x30b1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0b13[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x30b1('0x0'));var timeout=require(_0x30b1('0x1'));var express=require(_0x30b1('0x2'));var router=express[_0x30b1('0x3')]();var auth=require(_0x30b1('0x4'));var interaction=require(_0x30b1('0x5'));var config=require(_0x30b1('0x6'));var controller=require(_0x30b1('0x7'));router[_0x30b1('0x8')]('/',auth[_0x30b1('0x9')](),controller[_0x30b1('0xa')]);router[_0x30b1('0x8')]('/:id',auth[_0x30b1('0x9')](),controller[_0x30b1('0xb')]);router[_0x30b1('0x8')]('/:id/fields',auth[_0x30b1('0x9')](),controller['getFields']);router[_0x30b1('0x8')](_0x30b1('0xc'),auth['isAuthenticated'](),controller[_0x30b1('0xd')]);router[_0x30b1('0x8')]('/:id/descriptions',auth['isAuthenticated'](),controller[_0x30b1('0xe')]);router[_0x30b1('0xf')]('/',auth['isAuthenticated'](),controller[_0x30b1('0x10')]);router[_0x30b1('0x11')](_0x30b1('0x12'),auth['isAuthenticated'](),controller[_0x30b1('0x13')]);router[_0x30b1('0x14')]('/:id',auth[_0x30b1('0x9')](),controller[_0x30b1('0x15')]);module[_0x30b1('0x16')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js index 3e87ef9..c0ecc93 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 _0x4849=['ENUM','incident','phonecall','sequelize','exports','STRING'];(function(_0x3d27f9,_0x2f1720){var _0x4ff11e=function(_0x178251){while(--_0x178251){_0x3d27f9['push'](_0x3d27f9['shift']());}};_0x4ff11e(++_0x2f1720);}(_0x4849,0x1ad));var _0x9484=function(_0x264052,_0x4f446d){_0x264052=_0x264052-0x0;var _0x5e0596=_0x4849[_0x264052];return _0x5e0596;};'use strict';var Sequelize=require(_0x9484('0x0'));module[_0x9484('0x1')]={'name':{'type':Sequelize[_0x9484('0x2')]},'description':{'type':Sequelize['STRING']},'ticketType':{'type':Sequelize[_0x9484('0x3')](_0x9484('0x4'),_0x9484('0x5')),'defaultValue':_0x9484('0x4')}}; \ No newline at end of file +var _0x9898=['phonecall','incident','exports','STRING','ENUM'];(function(_0x3cf021,_0x4e403a){var _0x47b9b8=function(_0x213f40){while(--_0x213f40){_0x3cf021['push'](_0x3cf021['shift']());}};_0x47b9b8(++_0x4e403a);}(_0x9898,0xcf));var _0x8989=function(_0xd0cd0b,_0x490956){_0xd0cd0b=_0xd0cd0b-0x0;var _0x59cced=_0x9898[_0xd0cd0b];return _0x59cced;};'use strict';var Sequelize=require('sequelize');module[_0x8989('0x0')]={'name':{'type':Sequelize[_0x8989('0x1')]},'description':{'type':Sequelize['STRING']},'ticketType':{'type':Sequelize[_0x8989('0x2')]('incident',_0x8989('0x3')),'defaultValue':_0x8989('0x4')}}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js index 21740f6..901fca4 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 _0x253d=['options','include','findAll','rows','params','rawAttributes','includeAll','find','body','findOne','Dynamics365Field','order','getFields','getSubjects','getDescriptions','html-pdf','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','error','message','info','result','catch','sendStatus','status','end','json','count','offset','limit','set','Content-Range','reject','save','update','then','destroy','stack','name','send','Dynamics365Configuration','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','map','VIRTUAL','field'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x253d,0x1b3));var _0xd253=function(_0x42a2c6,_0x36ea30){_0x42a2c6=_0x42a2c6-0x0;var _0x708bf4=_0x253d[_0x42a2c6];return _0x708bf4;};'use strict';var pdf=require(_0xd253('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xd253('0x1'));var moment=require(_0xd253('0x2'));var BPromise=require(_0xd253('0x3'));var Mustache=require(_0xd253('0x4'));var util=require(_0xd253('0x5'));var path=require('path');var sox=require(_0xd253('0x6'));var csv=require(_0xd253('0x7'));var ejs=require(_0xd253('0x8'));var fs=require('fs');var _=require(_0xd253('0x9'));var squel=require(_0xd253('0xa'));var crypto=require('crypto');var jsforce=require(_0xd253('0xb'));var deskjs=require(_0xd253('0xc'));var toCsv=require(_0xd253('0x7'));var querystring=require(_0xd253('0xd'));var Papa=require(_0xd253('0xe'));var Redis=require(_0xd253('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xd253('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd253('0x11'))(_0xd253('0x12'));var utils=require(_0xd253('0x13'));var config=require(_0xd253('0x14'));var db=require(_0xd253('0x15'))['db'];var jayson=require(_0xd253('0x16'));var client=jayson['client']['http']({'port':0x232a});function checkPasswordPattern(_0x195cdd,_0x1f6480,_0x3e2bc7){if(_0x3e2bc7){var _0x59c367=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x59c367['test'](_0x1f6480)){return _0x195cdd;}else{throw new Error(_0xd253('0x17'));}}else{return _0x195cdd;}}function respondWithRpcPromise(_0x10d903,_0x1998ec,_0x4a2ba8,_0xc83ba1){return new BPromise(function(_0x52f306,_0x8b15a6){var _0x435711=_0xc83ba1||client;return _0x435711[_0xd253('0x18')](_0x10d903,_0x4a2ba8)['then'](function(_0x1b7ed1){logger['info'](_0xd253('0x19'),_0x1998ec,_0xd253('0x1a'));logger['debug'](_0xd253('0x1b'),_0x1998ec,_0xd253('0x1a'),JSON['stringify'](_0x1b7ed1));if(_0x1b7ed1['error']){if(_0x1b7ed1[_0xd253('0x1c')]['code']===0x1f4){logger['error'](_0xd253('0x19'),_0x1998ec,_0x1b7ed1['error'][_0xd253('0x1d')]);return _0x8b15a6(_0x1b7ed1[_0xd253('0x1c')][_0xd253('0x1d')]);}logger[_0xd253('0x1c')]('Dynamics365Configuration,\x20%s,\x20%s',_0x1998ec,_0x1b7ed1[_0xd253('0x1c')]['message']);return _0x52f306(_0x1b7ed1[_0xd253('0x1c')]['message']);}else{logger[_0xd253('0x1e')](_0xd253('0x19'),_0x1998ec,_0xd253('0x1a'));_0x52f306(_0x1b7ed1[_0xd253('0x1f')]['message']);}})[_0xd253('0x20')](function(_0x34d98d){logger['error'](_0xd253('0x19'),_0x1998ec,_0x34d98d);_0x8b15a6(_0x34d98d);});});}function respondWithStatusCode(_0x434be5,_0x136c52){_0x136c52=_0x136c52||0xcc;return function(_0x336736){if(_0x336736){return _0x434be5[_0xd253('0x21')](_0x136c52);}return _0x434be5[_0xd253('0x22')](_0x136c52)[_0xd253('0x23')]();};}function respondWithResult(_0x55851f,_0x10b635){_0x10b635=_0x10b635||0xc8;return function(_0x4e89ed){if(_0x4e89ed){return _0x55851f['status'](_0x10b635)[_0xd253('0x24')](_0x4e89ed);}};}function respondWithFilteredResult(_0x3e36cc,_0x4a4ba1){return function(_0x542494){if(_0x542494){var _0xa7ca4c=_0x542494[_0xd253('0x25')],_0x44486d=_0x4a4ba1[_0xd253('0x26')],_0x566e37=_0x4a4ba1[_0xd253('0x26')]+_0x4a4ba1[_0xd253('0x27')],_0x3955a0;if(_0x566e37>=_0xa7ca4c){_0x566e37=_0xa7ca4c;_0x3955a0=0xc8;}else{_0x3955a0=0xce;}_0x3e36cc['status'](_0x3955a0);return _0x3e36cc[_0xd253('0x28')](_0xd253('0x29'),_0x44486d+'-'+_0x566e37+'/'+_0xa7ca4c)[_0xd253('0x24')](_0x542494);}return null;};}function patchUpdates(_0x5dc9c9){return function(_0x6db8ef){try{jsonpatch['apply'](_0x6db8ef,_0x5dc9c9,!![]);}catch(_0x204a78){return BPromise[_0xd253('0x2a')](_0x204a78);}return _0x6db8ef[_0xd253('0x2b')]();};}function saveUpdates(_0x2934a5,_0xeb049){return function(_0x16d6d2){if(_0x16d6d2){return _0x16d6d2[_0xd253('0x2c')](_0x2934a5)[_0xd253('0x2d')](function(_0x42eefe){return _0x42eefe;});}return null;};}function removeEntity(_0x2a730d,_0x532092){return function(_0x341ae1){if(_0x341ae1){return _0x341ae1[_0xd253('0x2e')]()['then'](function(){_0x2a730d['status'](0xcc)[_0xd253('0x23')]();});}};}function handleEntityNotFound(_0x4f48f7,_0x447321){return function(_0x3417ca){if(!_0x3417ca){_0x4f48f7[_0xd253('0x21')](0x194);}return _0x3417ca;};}function handleError(_0x13880e,_0x59d326){_0x59d326=_0x59d326||0x1f4;return function(_0x2677db){logger[_0xd253('0x1c')](_0x2677db[_0xd253('0x2f')]);if(_0x2677db[_0xd253('0x30')]){delete _0x2677db[_0xd253('0x30')];}_0x13880e[_0xd253('0x22')](_0x59d326)[_0xd253('0x31')](_0x2677db);};}exports['index']=function(_0x191e20,_0x22f60a){var _0x93325c={},_0x14cb05={},_0x10efa9={'count':0x0,'rows':[]};var _0x5bed92=db[_0xd253('0x32')]['rawAttributes'];_0x14cb05[_0xd253('0x33')]=_[_0xd253('0x34')](_0x5bed92);_0x14cb05[_0xd253('0x35')]=_[_0xd253('0x34')](_0x191e20['query']);_0x14cb05[_0xd253('0x36')]=_[_0xd253('0x37')](_0x14cb05[_0xd253('0x33')],_0x14cb05[_0xd253('0x35')]);_0x93325c[_0xd253('0x38')]=_[_0xd253('0x37')](_0x14cb05[_0xd253('0x33')],qs[_0xd253('0x39')](_0x191e20[_0xd253('0x35')][_0xd253('0x39')]));_0x93325c[_0xd253('0x38')]=_0x93325c[_0xd253('0x38')][_0xd253('0x3a')]?_0x93325c[_0xd253('0x38')]:_0x14cb05['model'];if(!_0x191e20[_0xd253('0x35')][_0xd253('0x3b')](_0xd253('0x3c'))){_0x93325c['limit']=qs[_0xd253('0x27')](_0x191e20[_0xd253('0x35')][_0xd253('0x27')]);_0x93325c[_0xd253('0x26')]=qs['offset'](_0x191e20[_0xd253('0x35')][_0xd253('0x26')]);}_0x93325c['order']=qs[_0xd253('0x3d')](_0x191e20[_0xd253('0x35')][_0xd253('0x3d')]);_0x93325c[_0xd253('0x3e')]=qs[_0xd253('0x36')](_[_0xd253('0x3f')](_0x191e20[_0xd253('0x35')],_0x14cb05[_0xd253('0x36')]));if(_0x191e20[_0xd253('0x35')][_0xd253('0x40')]){_0x93325c['where']=_[_0xd253('0x41')](_0x93325c[_0xd253('0x3e')],{'$or':_[_0xd253('0x42')](_0x5bed92,function(_0x1a70bd){if(_0x1a70bd['type']['key']!==_0xd253('0x43')){var _0x19b9b7={};_0x19b9b7[_0x1a70bd[_0xd253('0x44')]]={'$like':'%'+_0x191e20[_0xd253('0x35')][_0xd253('0x40')]+'%'};return _0x19b9b7;}})});}_0x93325c=_[_0xd253('0x41')]({},_0x93325c,_0x191e20[_0xd253('0x45')]);var _0x5b47ae={'where':_0x93325c[_0xd253('0x3e')]};return db[_0xd253('0x32')]['count'](_0x5b47ae)[_0xd253('0x2d')](function(_0xfd4161){_0x10efa9[_0xd253('0x25')]=_0xfd4161;if(_0x191e20[_0xd253('0x35')]['includeAll']){_0x93325c[_0xd253('0x46')]=[{'all':!![]}];}return db['Dynamics365Configuration'][_0xd253('0x47')](_0x93325c);})['then'](function(_0x464668){_0x10efa9[_0xd253('0x48')]=_0x464668;return _0x10efa9;})['then'](respondWithFilteredResult(_0x22f60a,_0x93325c))['catch'](handleError(_0x22f60a,null));};exports['show']=function(_0x74d7db,_0x4fb552){var _0x4ca209={'raw':![],'where':{'id':_0x74d7db[_0xd253('0x49')]['id']}},_0x41a68d={};_0x41a68d[_0xd253('0x33')]=_[_0xd253('0x34')](db['Dynamics365Configuration'][_0xd253('0x4a')]);_0x41a68d['query']=_['keys'](_0x74d7db[_0xd253('0x35')]);_0x41a68d[_0xd253('0x36')]=_[_0xd253('0x37')](_0x41a68d[_0xd253('0x33')],_0x41a68d[_0xd253('0x35')]);_0x4ca209[_0xd253('0x38')]=_[_0xd253('0x37')](_0x41a68d[_0xd253('0x33')],qs[_0xd253('0x39')](_0x74d7db[_0xd253('0x35')][_0xd253('0x39')]));_0x4ca209[_0xd253('0x38')]=_0x4ca209[_0xd253('0x38')][_0xd253('0x3a')]?_0x4ca209[_0xd253('0x38')]:_0x41a68d[_0xd253('0x33')];if(_0x74d7db[_0xd253('0x35')][_0xd253('0x4b')]){_0x4ca209[_0xd253('0x46')]=[{'all':!![]}];}_0x4ca209=_[_0xd253('0x41')]({},_0x4ca209,_0x74d7db[_0xd253('0x45')]);return db[_0xd253('0x32')][_0xd253('0x4c')](_0x4ca209)[_0xd253('0x2d')](handleEntityNotFound(_0x4fb552,null))[_0xd253('0x2d')](respondWithResult(_0x4fb552,null))[_0xd253('0x20')](handleError(_0x4fb552,null));};exports['create']=function(_0xe4f0b2,_0xe88a08){return db[_0xd253('0x32')]['create'](_0xe4f0b2[_0xd253('0x4d')],{})['then'](respondWithResult(_0xe88a08,0xc9))[_0xd253('0x20')](handleError(_0xe88a08,null));};exports[_0xd253('0x2c')]=function(_0x1bffb0,_0xb5e945){if(_0x1bffb0[_0xd253('0x4d')]['id']){delete _0x1bffb0[_0xd253('0x4d')]['id'];}return db[_0xd253('0x32')][_0xd253('0x4c')]({'where':{'id':_0x1bffb0[_0xd253('0x49')]['id']}})[_0xd253('0x2d')](handleEntityNotFound(_0xb5e945,null))[_0xd253('0x2d')](saveUpdates(_0x1bffb0[_0xd253('0x4d')],null))[_0xd253('0x2d')](respondWithResult(_0xb5e945,null))[_0xd253('0x20')](handleError(_0xb5e945,null));};exports[_0xd253('0x2e')]=function(_0x2179f5,_0x5f500e){return db[_0xd253('0x32')][_0xd253('0x4c')]({'where':{'id':_0x2179f5[_0xd253('0x49')]['id']}})[_0xd253('0x2d')](handleEntityNotFound(_0x5f500e,null))['then'](removeEntity(_0x5f500e,null))[_0xd253('0x20')](handleError(_0x5f500e,null));};exports['getFields']=function(_0x677cd8,_0x10792b,_0x2cfb7f){var _0x177e70={};var _0xfa9c56={};var _0x2e1548;var _0xc5353a;return db[_0xd253('0x32')][_0xd253('0x4e')]({'where':{'id':_0x677cd8['params']['id']}})[_0xd253('0x2d')](handleEntityNotFound(_0x10792b,null))['then'](function(_0x5a0cee){if(_0x5a0cee){_0x2e1548=_0x5a0cee;_0xfa9c56[_0xd253('0x33')]=_[_0xd253('0x34')](db[_0xd253('0x4f')][_0xd253('0x4a')]);_0xfa9c56[_0xd253('0x35')]=_[_0xd253('0x34')](_0x677cd8[_0xd253('0x35')]);_0xfa9c56['filters']=_['intersection'](_0xfa9c56['model'],_0xfa9c56['query']);_0x177e70[_0xd253('0x38')]=_[_0xd253('0x37')](_0xfa9c56[_0xd253('0x33')],qs['fields'](_0x677cd8[_0xd253('0x35')][_0xd253('0x39')]));_0x177e70[_0xd253('0x38')]=_0x177e70[_0xd253('0x38')][_0xd253('0x3a')]?_0x177e70[_0xd253('0x38')]:_0xfa9c56['model'];_0x177e70[_0xd253('0x50')]=qs[_0xd253('0x3d')](_0x677cd8[_0xd253('0x35')][_0xd253('0x3d')]);_0x177e70[_0xd253('0x3e')]=qs['filters'](_[_0xd253('0x3f')](_0x677cd8[_0xd253('0x35')],_0xfa9c56[_0xd253('0x36')]));if(_0x677cd8[_0xd253('0x35')][_0xd253('0x40')]){_0x177e70[_0xd253('0x3e')]=_[_0xd253('0x41')](_0x177e70['where'],{'$or':_[_0xd253('0x42')](_0x177e70[_0xd253('0x38')],function(_0x3ada25){var _0x36d49f={};_0x36d49f[_0x3ada25]={'$like':'%'+_0x677cd8[_0xd253('0x35')][_0xd253('0x40')]+'%'};return _0x36d49f;})});}_0x177e70=_['merge']({},_0x177e70,_0x677cd8[_0xd253('0x45')]);return _0x2e1548[_0xd253('0x51')](_0x177e70);}})['then'](function(_0xf08864){if(_0xf08864){_0xc5353a=_0xf08864[_0xd253('0x3a')];if(!_0x677cd8[_0xd253('0x35')][_0xd253('0x3b')](_0xd253('0x3c'))){_0x177e70['limit']=qs[_0xd253('0x27')](_0x677cd8[_0xd253('0x35')]['limit']);_0x177e70[_0xd253('0x26')]=qs['offset'](_0x677cd8[_0xd253('0x35')][_0xd253('0x26')]);}return _0x2e1548[_0xd253('0x51')](_0x177e70);}})[_0xd253('0x2d')](function(_0x4bc370){if(_0x4bc370){return _0x4bc370?{'count':_0xc5353a,'rows':_0x4bc370}:null;}})[_0xd253('0x2d')](respondWithResult(_0x10792b,null))[_0xd253('0x20')](handleError(_0x10792b,null));};exports[_0xd253('0x52')]=function(_0x23d48a,_0x224ce4,_0xa5f613){var _0xabd5e={};var _0x109826={};var _0x529232;var _0x2339cf;return db[_0xd253('0x32')][_0xd253('0x4e')]({'where':{'id':_0x23d48a[_0xd253('0x49')]['id']}})[_0xd253('0x2d')](handleEntityNotFound(_0x224ce4,null))['then'](function(_0x1af33f){if(_0x1af33f){_0x529232=_0x1af33f;_0x109826[_0xd253('0x33')]=_[_0xd253('0x34')](db[_0xd253('0x4f')][_0xd253('0x4a')]);_0x109826['query']=_[_0xd253('0x34')](_0x23d48a['query']);_0x109826[_0xd253('0x36')]=_[_0xd253('0x37')](_0x109826[_0xd253('0x33')],_0x109826[_0xd253('0x35')]);_0xabd5e[_0xd253('0x38')]=_['intersection'](_0x109826[_0xd253('0x33')],qs[_0xd253('0x39')](_0x23d48a[_0xd253('0x35')][_0xd253('0x39')]));_0xabd5e[_0xd253('0x38')]=_0xabd5e[_0xd253('0x38')][_0xd253('0x3a')]?_0xabd5e[_0xd253('0x38')]:_0x109826[_0xd253('0x33')];_0xabd5e[_0xd253('0x50')]=qs['sort'](_0x23d48a[_0xd253('0x35')][_0xd253('0x3d')]);_0xabd5e['where']=qs[_0xd253('0x36')](_[_0xd253('0x3f')](_0x23d48a[_0xd253('0x35')],_0x109826[_0xd253('0x36')]));if(_0x23d48a['query'][_0xd253('0x40')]){_0xabd5e['where']=_[_0xd253('0x41')](_0xabd5e[_0xd253('0x3e')],{'$or':_[_0xd253('0x42')](_0xabd5e[_0xd253('0x38')],function(_0x13fd2d){var _0x5abafa={};_0x5abafa[_0x13fd2d]={'$like':'%'+_0x23d48a[_0xd253('0x35')][_0xd253('0x40')]+'%'};return _0x5abafa;})});}_0xabd5e=_[_0xd253('0x41')]({},_0xabd5e,_0x23d48a['options']);return _0x529232['getSubjects'](_0xabd5e);}})['then'](function(_0x50a322){if(_0x50a322){_0x2339cf=_0x50a322[_0xd253('0x3a')];if(!_0x23d48a[_0xd253('0x35')][_0xd253('0x3b')](_0xd253('0x3c'))){_0xabd5e['limit']=qs[_0xd253('0x27')](_0x23d48a[_0xd253('0x35')][_0xd253('0x27')]);_0xabd5e['offset']=qs[_0xd253('0x26')](_0x23d48a['query'][_0xd253('0x26')]);}return _0x529232[_0xd253('0x52')](_0xabd5e);}})[_0xd253('0x2d')](function(_0x243515){if(_0x243515){return _0x243515?{'count':_0x2339cf,'rows':_0x243515}:null;}})[_0xd253('0x2d')](respondWithResult(_0x224ce4,null))['catch'](handleError(_0x224ce4,null));};exports['getDescriptions']=function(_0x46e7e8,_0x2c3a48,_0x27bb3b){var _0x4b6fba={};var _0x2e406a={};var _0x2a264c;var _0x149057;return db[_0xd253('0x32')][_0xd253('0x4e')]({'where':{'id':_0x46e7e8[_0xd253('0x49')]['id']}})['then'](handleEntityNotFound(_0x2c3a48,null))[_0xd253('0x2d')](function(_0x1f9f34){if(_0x1f9f34){_0x2a264c=_0x1f9f34;_0x2e406a['model']=_[_0xd253('0x34')](db[_0xd253('0x4f')][_0xd253('0x4a')]);_0x2e406a['query']=_[_0xd253('0x34')](_0x46e7e8[_0xd253('0x35')]);_0x2e406a[_0xd253('0x36')]=_[_0xd253('0x37')](_0x2e406a[_0xd253('0x33')],_0x2e406a[_0xd253('0x35')]);_0x4b6fba[_0xd253('0x38')]=_['intersection'](_0x2e406a['model'],qs[_0xd253('0x39')](_0x46e7e8[_0xd253('0x35')][_0xd253('0x39')]));_0x4b6fba['attributes']=_0x4b6fba[_0xd253('0x38')]['length']?_0x4b6fba[_0xd253('0x38')]:_0x2e406a[_0xd253('0x33')];_0x4b6fba[_0xd253('0x50')]=qs[_0xd253('0x3d')](_0x46e7e8['query'][_0xd253('0x3d')]);_0x4b6fba['where']=qs['filters'](_[_0xd253('0x3f')](_0x46e7e8['query'],_0x2e406a[_0xd253('0x36')]));if(_0x46e7e8[_0xd253('0x35')][_0xd253('0x40')]){_0x4b6fba['where']=_[_0xd253('0x41')](_0x4b6fba['where'],{'$or':_['map'](_0x4b6fba[_0xd253('0x38')],function(_0x12e16f){var _0x4c4796={};_0x4c4796[_0x12e16f]={'$like':'%'+_0x46e7e8[_0xd253('0x35')][_0xd253('0x40')]+'%'};return _0x4c4796;})});}_0x4b6fba=_[_0xd253('0x41')]({},_0x4b6fba,_0x46e7e8[_0xd253('0x45')]);return _0x2a264c[_0xd253('0x53')](_0x4b6fba);}})[_0xd253('0x2d')](function(_0x41bf8d){if(_0x41bf8d){_0x149057=_0x41bf8d['length'];if(!_0x46e7e8['query'][_0xd253('0x3b')](_0xd253('0x3c'))){_0x4b6fba['limit']=qs[_0xd253('0x27')](_0x46e7e8[_0xd253('0x35')][_0xd253('0x27')]);_0x4b6fba[_0xd253('0x26')]=qs[_0xd253('0x26')](_0x46e7e8[_0xd253('0x35')][_0xd253('0x26')]);}return _0x2a264c[_0xd253('0x53')](_0x4b6fba);}})[_0xd253('0x2d')](function(_0xbb4f42){if(_0xbb4f42){return _0xbb4f42?{'count':_0x149057,'rows':_0xbb4f42}:null;}})[_0xd253('0x2d')](respondWithResult(_0x2c3a48,null))[_0xd253('0x20')](handleError(_0x2c3a48,null));}; \ No newline at end of file +var _0x8f4c=['mustache','util','sox','squel','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','sendStatus','end','json','count','offset','limit','status','Content-Range','reject','save','update','stack','name','send','index','Dynamics365Configuration','rawAttributes','model','keys','filters','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','type','key','VIRTUAL','field','options','includeAll','include','findAll','rows','show','find','create','body','params','destroy','Dynamics365Field','filter','map','getFields','getSubjects','findOne','pick','getDescriptions','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird'];(function(_0x1694f5,_0x49b7c3){var _0x5b4321=function(_0x58c183){while(--_0x58c183){_0x1694f5['push'](_0x1694f5['shift']());}};_0x5b4321(++_0x49b7c3);}(_0x8f4c,0x113));var _0xc8f4=function(_0x1cc815,_0x37d62b){_0x1cc815=_0x1cc815-0x0;var _0xfd8211=_0x8f4c[_0x1cc815];return _0xfd8211;};'use strict';var pdf=require(_0xc8f4('0x0'));var emlformat=require(_0xc8f4('0x1'));var rimraf=require(_0xc8f4('0x2'));var zipdir=require(_0xc8f4('0x3'));var jsonpatch=require(_0xc8f4('0x4'));var rp=require(_0xc8f4('0x5'));var moment=require('moment');var BPromise=require(_0xc8f4('0x6'));var Mustache=require(_0xc8f4('0x7'));var util=require(_0xc8f4('0x8'));var path=require('path');var sox=require(_0xc8f4('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0xc8f4('0xa'));var crypto=require('crypto');var jsforce=require(_0xc8f4('0xb'));var deskjs=require(_0xc8f4('0xc'));var toCsv=require(_0xc8f4('0xd'));var querystring=require(_0xc8f4('0xe'));var Papa=require(_0xc8f4('0xf'));var Redis=require('ioredis');var authService=require(_0xc8f4('0x10'));var qs=require(_0xc8f4('0x11'));var as=require(_0xc8f4('0x12'));var hardwareService=require(_0xc8f4('0x13'));var logger=require('../../config/logger')(_0xc8f4('0x14'));var utils=require('../../config/utils');var config=require(_0xc8f4('0x15'));var db=require(_0xc8f4('0x16'))['db'];var jayson=require(_0xc8f4('0x17'));var client=jayson[_0xc8f4('0x18')][_0xc8f4('0x19')]({'port':0x232a});function checkPasswordPattern(_0x4e31cf,_0x39a1d5,_0x377c2b){if(_0x377c2b){var _0x39a302=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x39a302[_0xc8f4('0x1a')](_0x39a1d5)){return _0x4e31cf;}else{throw new Error(_0xc8f4('0x1b'));}}else{return _0x4e31cf;}}function respondWithRpcPromise(_0x411c5c,_0x4e3c36,_0x2bce00,_0x2c7bc1){return new BPromise(function(_0x1518a6,_0x46ac15){var _0x22c08a=_0x2c7bc1||client;return _0x22c08a['request'](_0x411c5c,_0x2bce00)[_0xc8f4('0x1c')](function(_0x4d2b77){logger['info'](_0xc8f4('0x1d'),_0x4e3c36,_0xc8f4('0x1e'));logger[_0xc8f4('0x1f')](_0xc8f4('0x20'),_0x4e3c36,_0xc8f4('0x1e'),JSON[_0xc8f4('0x21')](_0x4d2b77));if(_0x4d2b77[_0xc8f4('0x22')]){if(_0x4d2b77[_0xc8f4('0x22')][_0xc8f4('0x23')]===0x1f4){logger[_0xc8f4('0x22')](_0xc8f4('0x1d'),_0x4e3c36,_0x4d2b77[_0xc8f4('0x22')][_0xc8f4('0x24')]);return _0x46ac15(_0x4d2b77['error'][_0xc8f4('0x24')]);}logger[_0xc8f4('0x22')](_0xc8f4('0x1d'),_0x4e3c36,_0x4d2b77[_0xc8f4('0x22')][_0xc8f4('0x24')]);return _0x1518a6(_0x4d2b77[_0xc8f4('0x22')][_0xc8f4('0x24')]);}else{logger[_0xc8f4('0x25')]('Dynamics365Configuration,\x20%s,\x20%s',_0x4e3c36,_0xc8f4('0x1e'));_0x1518a6(_0x4d2b77[_0xc8f4('0x26')][_0xc8f4('0x24')]);}})[_0xc8f4('0x27')](function(_0x5d54a9){logger[_0xc8f4('0x22')]('Dynamics365Configuration,\x20%s,\x20%s',_0x4e3c36,_0x5d54a9);_0x46ac15(_0x5d54a9);});});}function respondWithStatusCode(_0x3782fd,_0x540b25){_0x540b25=_0x540b25||0xcc;return function(_0x177a44){if(_0x177a44){return _0x3782fd[_0xc8f4('0x28')](_0x540b25);}return _0x3782fd['status'](_0x540b25)[_0xc8f4('0x29')]();};}function respondWithResult(_0x21062f,_0x11f766){_0x11f766=_0x11f766||0xc8;return function(_0x2fa052){if(_0x2fa052){return _0x21062f['status'](_0x11f766)[_0xc8f4('0x2a')](_0x2fa052);}};}function respondWithFilteredResult(_0x3484b6,_0x5db666){return function(_0x190f61){if(_0x190f61){var _0x37957c=_0x190f61[_0xc8f4('0x2b')],_0x157ad5=_0x5db666['offset'],_0x1b70bc=_0x5db666[_0xc8f4('0x2c')]+_0x5db666[_0xc8f4('0x2d')],_0x24bef0;if(_0x1b70bc>=_0x37957c){_0x1b70bc=_0x37957c;_0x24bef0=0xc8;}else{_0x24bef0=0xce;}_0x3484b6[_0xc8f4('0x2e')](_0x24bef0);return _0x3484b6['set'](_0xc8f4('0x2f'),_0x157ad5+'-'+_0x1b70bc+'/'+_0x37957c)[_0xc8f4('0x2a')](_0x190f61);}return null;};}function patchUpdates(_0x5ab6cb){return function(_0x56ec4b){try{jsonpatch['apply'](_0x56ec4b,_0x5ab6cb,!![]);}catch(_0x2717ff){return BPromise[_0xc8f4('0x30')](_0x2717ff);}return _0x56ec4b[_0xc8f4('0x31')]();};}function saveUpdates(_0x28baa0,_0x273e73){return function(_0x2f9a80){if(_0x2f9a80){return _0x2f9a80[_0xc8f4('0x32')](_0x28baa0)[_0xc8f4('0x1c')](function(_0x4b4203){return _0x4b4203;});}return null;};}function removeEntity(_0x1dc140,_0x413373){return function(_0x3910f3){if(_0x3910f3){return _0x3910f3['destroy']()[_0xc8f4('0x1c')](function(){_0x1dc140[_0xc8f4('0x2e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1295b0,_0x1a8553){return function(_0x36f24f){if(!_0x36f24f){_0x1295b0['sendStatus'](0x194);}return _0x36f24f;};}function handleError(_0x114a79,_0xa06877){_0xa06877=_0xa06877||0x1f4;return function(_0x126731){logger['error'](_0x126731[_0xc8f4('0x33')]);if(_0x126731[_0xc8f4('0x34')]){delete _0x126731[_0xc8f4('0x34')];}_0x114a79[_0xc8f4('0x2e')](_0xa06877)[_0xc8f4('0x35')](_0x126731);};}exports[_0xc8f4('0x36')]=function(_0xeacb80,_0x287ece){var _0x2da6ab={},_0x2b0ee1={},_0x35b516={'count':0x0,'rows':[]};var _0x12402b=db[_0xc8f4('0x37')][_0xc8f4('0x38')];_0x2b0ee1[_0xc8f4('0x39')]=_[_0xc8f4('0x3a')](_0x12402b);_0x2b0ee1['query']=_[_0xc8f4('0x3a')](_0xeacb80['query']);_0x2b0ee1[_0xc8f4('0x3b')]=_['intersection'](_0x2b0ee1[_0xc8f4('0x39')],_0x2b0ee1[_0xc8f4('0x3c')]);_0x2da6ab[_0xc8f4('0x3d')]=_[_0xc8f4('0x3e')](_0x2b0ee1[_0xc8f4('0x39')],qs[_0xc8f4('0x3f')](_0xeacb80[_0xc8f4('0x3c')]['fields']));_0x2da6ab[_0xc8f4('0x3d')]=_0x2da6ab[_0xc8f4('0x3d')][_0xc8f4('0x40')]?_0x2da6ab[_0xc8f4('0x3d')]:_0x2b0ee1['model'];if(!_0xeacb80[_0xc8f4('0x3c')][_0xc8f4('0x41')](_0xc8f4('0x42'))){_0x2da6ab[_0xc8f4('0x2d')]=qs[_0xc8f4('0x2d')](_0xeacb80[_0xc8f4('0x3c')][_0xc8f4('0x2d')]);_0x2da6ab[_0xc8f4('0x2c')]=qs[_0xc8f4('0x2c')](_0xeacb80[_0xc8f4('0x3c')][_0xc8f4('0x2c')]);}_0x2da6ab[_0xc8f4('0x43')]=qs['sort'](_0xeacb80[_0xc8f4('0x3c')][_0xc8f4('0x44')]);_0x2da6ab[_0xc8f4('0x45')]=qs[_0xc8f4('0x3b')](_['pick'](_0xeacb80['query'],_0x2b0ee1[_0xc8f4('0x3b')]));if(_0xeacb80[_0xc8f4('0x3c')]['filter']){_0x2da6ab[_0xc8f4('0x45')]=_[_0xc8f4('0x46')](_0x2da6ab['where'],{'$or':_['map'](_0x12402b,function(_0x3c8569){if(_0x3c8569[_0xc8f4('0x47')][_0xc8f4('0x48')]!==_0xc8f4('0x49')){var _0x34a412={};_0x34a412[_0x3c8569[_0xc8f4('0x4a')]]={'$like':'%'+_0xeacb80['query']['filter']+'%'};return _0x34a412;}})});}_0x2da6ab=_[_0xc8f4('0x46')]({},_0x2da6ab,_0xeacb80[_0xc8f4('0x4b')]);var _0x28b4d6={'where':_0x2da6ab['where']};return db['Dynamics365Configuration']['count'](_0x28b4d6)['then'](function(_0x5c3857){_0x35b516[_0xc8f4('0x2b')]=_0x5c3857;if(_0xeacb80[_0xc8f4('0x3c')][_0xc8f4('0x4c')]){_0x2da6ab[_0xc8f4('0x4d')]=[{'all':!![]}];}return db[_0xc8f4('0x37')][_0xc8f4('0x4e')](_0x2da6ab);})['then'](function(_0xdd7c1a){_0x35b516[_0xc8f4('0x4f')]=_0xdd7c1a;return _0x35b516;})['then'](respondWithFilteredResult(_0x287ece,_0x2da6ab))['catch'](handleError(_0x287ece,null));};exports[_0xc8f4('0x50')]=function(_0x82a5e,_0x3ca0d6){var _0xef0521={'raw':![],'where':{'id':_0x82a5e['params']['id']}},_0x5ae9dc={};_0x5ae9dc[_0xc8f4('0x39')]=_[_0xc8f4('0x3a')](db[_0xc8f4('0x37')][_0xc8f4('0x38')]);_0x5ae9dc[_0xc8f4('0x3c')]=_[_0xc8f4('0x3a')](_0x82a5e['query']);_0x5ae9dc['filters']=_[_0xc8f4('0x3e')](_0x5ae9dc[_0xc8f4('0x39')],_0x5ae9dc[_0xc8f4('0x3c')]);_0xef0521[_0xc8f4('0x3d')]=_[_0xc8f4('0x3e')](_0x5ae9dc[_0xc8f4('0x39')],qs[_0xc8f4('0x3f')](_0x82a5e[_0xc8f4('0x3c')][_0xc8f4('0x3f')]));_0xef0521['attributes']=_0xef0521['attributes'][_0xc8f4('0x40')]?_0xef0521[_0xc8f4('0x3d')]:_0x5ae9dc[_0xc8f4('0x39')];if(_0x82a5e[_0xc8f4('0x3c')][_0xc8f4('0x4c')]){_0xef0521[_0xc8f4('0x4d')]=[{'all':!![]}];}_0xef0521=_[_0xc8f4('0x46')]({},_0xef0521,_0x82a5e[_0xc8f4('0x4b')]);return db[_0xc8f4('0x37')][_0xc8f4('0x51')](_0xef0521)[_0xc8f4('0x1c')](handleEntityNotFound(_0x3ca0d6,null))[_0xc8f4('0x1c')](respondWithResult(_0x3ca0d6,null))[_0xc8f4('0x27')](handleError(_0x3ca0d6,null));};exports['create']=function(_0x3d291b,_0x345576){return db[_0xc8f4('0x37')][_0xc8f4('0x52')](_0x3d291b['body'],{})[_0xc8f4('0x1c')](respondWithResult(_0x345576,0xc9))[_0xc8f4('0x27')](handleError(_0x345576,null));};exports['update']=function(_0x47995c,_0x405391){if(_0x47995c['body']['id']){delete _0x47995c[_0xc8f4('0x53')]['id'];}return db[_0xc8f4('0x37')][_0xc8f4('0x51')]({'where':{'id':_0x47995c[_0xc8f4('0x54')]['id']}})[_0xc8f4('0x1c')](handleEntityNotFound(_0x405391,null))[_0xc8f4('0x1c')](saveUpdates(_0x47995c[_0xc8f4('0x53')],null))[_0xc8f4('0x1c')](respondWithResult(_0x405391,null))[_0xc8f4('0x27')](handleError(_0x405391,null));};exports[_0xc8f4('0x55')]=function(_0x408d56,_0x57aaee){return db[_0xc8f4('0x37')][_0xc8f4('0x51')]({'where':{'id':_0x408d56[_0xc8f4('0x54')]['id']}})[_0xc8f4('0x1c')](handleEntityNotFound(_0x57aaee,null))['then'](removeEntity(_0x57aaee,null))[_0xc8f4('0x27')](handleError(_0x57aaee,null));};exports['getFields']=function(_0x5b52f7,_0x130c42,_0x451a3e){var _0x192bbc={};var _0x39cb77={};var _0x2bfb92;var _0x23023d;return db['Dynamics365Configuration']['findOne']({'where':{'id':_0x5b52f7[_0xc8f4('0x54')]['id']}})[_0xc8f4('0x1c')](handleEntityNotFound(_0x130c42,null))[_0xc8f4('0x1c')](function(_0x137227){if(_0x137227){_0x2bfb92=_0x137227;_0x39cb77[_0xc8f4('0x39')]=_[_0xc8f4('0x3a')](db[_0xc8f4('0x56')]['rawAttributes']);_0x39cb77[_0xc8f4('0x3c')]=_[_0xc8f4('0x3a')](_0x5b52f7['query']);_0x39cb77[_0xc8f4('0x3b')]=_[_0xc8f4('0x3e')](_0x39cb77[_0xc8f4('0x39')],_0x39cb77[_0xc8f4('0x3c')]);_0x192bbc[_0xc8f4('0x3d')]=_[_0xc8f4('0x3e')](_0x39cb77[_0xc8f4('0x39')],qs['fields'](_0x5b52f7[_0xc8f4('0x3c')][_0xc8f4('0x3f')]));_0x192bbc['attributes']=_0x192bbc['attributes'][_0xc8f4('0x40')]?_0x192bbc['attributes']:_0x39cb77[_0xc8f4('0x39')];_0x192bbc[_0xc8f4('0x43')]=qs['sort'](_0x5b52f7['query']['sort']);_0x192bbc['where']=qs['filters'](_['pick'](_0x5b52f7[_0xc8f4('0x3c')],_0x39cb77['filters']));if(_0x5b52f7[_0xc8f4('0x3c')][_0xc8f4('0x57')]){_0x192bbc[_0xc8f4('0x45')]=_[_0xc8f4('0x46')](_0x192bbc['where'],{'$or':_[_0xc8f4('0x58')](_0x192bbc[_0xc8f4('0x3d')],function(_0x3ca2ca){var _0xb50e61={};_0xb50e61[_0x3ca2ca]={'$like':'%'+_0x5b52f7['query'][_0xc8f4('0x57')]+'%'};return _0xb50e61;})});}_0x192bbc=_[_0xc8f4('0x46')]({},_0x192bbc,_0x5b52f7[_0xc8f4('0x4b')]);return _0x2bfb92[_0xc8f4('0x59')](_0x192bbc);}})['then'](function(_0x3d5270){if(_0x3d5270){_0x23023d=_0x3d5270[_0xc8f4('0x40')];if(!_0x5b52f7['query'][_0xc8f4('0x41')](_0xc8f4('0x42'))){_0x192bbc[_0xc8f4('0x2d')]=qs[_0xc8f4('0x2d')](_0x5b52f7[_0xc8f4('0x3c')][_0xc8f4('0x2d')]);_0x192bbc['offset']=qs[_0xc8f4('0x2c')](_0x5b52f7[_0xc8f4('0x3c')][_0xc8f4('0x2c')]);}return _0x2bfb92['getFields'](_0x192bbc);}})[_0xc8f4('0x1c')](function(_0x2b6510){if(_0x2b6510){return _0x2b6510?{'count':_0x23023d,'rows':_0x2b6510}:null;}})[_0xc8f4('0x1c')](respondWithResult(_0x130c42,null))['catch'](handleError(_0x130c42,null));};exports[_0xc8f4('0x5a')]=function(_0x38a486,_0x482cfd,_0x1278f1){var _0x5bf089={};var _0x8c8e43={};var _0x9996da;var _0x5500a9;return db[_0xc8f4('0x37')][_0xc8f4('0x5b')]({'where':{'id':_0x38a486['params']['id']}})[_0xc8f4('0x1c')](handleEntityNotFound(_0x482cfd,null))[_0xc8f4('0x1c')](function(_0x437718){if(_0x437718){_0x9996da=_0x437718;_0x8c8e43[_0xc8f4('0x39')]=_[_0xc8f4('0x3a')](db[_0xc8f4('0x56')][_0xc8f4('0x38')]);_0x8c8e43[_0xc8f4('0x3c')]=_['keys'](_0x38a486[_0xc8f4('0x3c')]);_0x8c8e43[_0xc8f4('0x3b')]=_[_0xc8f4('0x3e')](_0x8c8e43[_0xc8f4('0x39')],_0x8c8e43[_0xc8f4('0x3c')]);_0x5bf089['attributes']=_[_0xc8f4('0x3e')](_0x8c8e43['model'],qs[_0xc8f4('0x3f')](_0x38a486[_0xc8f4('0x3c')][_0xc8f4('0x3f')]));_0x5bf089[_0xc8f4('0x3d')]=_0x5bf089[_0xc8f4('0x3d')][_0xc8f4('0x40')]?_0x5bf089[_0xc8f4('0x3d')]:_0x8c8e43[_0xc8f4('0x39')];_0x5bf089[_0xc8f4('0x43')]=qs[_0xc8f4('0x44')](_0x38a486[_0xc8f4('0x3c')]['sort']);_0x5bf089[_0xc8f4('0x45')]=qs[_0xc8f4('0x3b')](_[_0xc8f4('0x5c')](_0x38a486[_0xc8f4('0x3c')],_0x8c8e43['filters']));if(_0x38a486['query'][_0xc8f4('0x57')]){_0x5bf089['where']=_[_0xc8f4('0x46')](_0x5bf089['where'],{'$or':_[_0xc8f4('0x58')](_0x5bf089['attributes'],function(_0x54a995){var _0x4a1cac={};_0x4a1cac[_0x54a995]={'$like':'%'+_0x38a486['query']['filter']+'%'};return _0x4a1cac;})});}_0x5bf089=_['merge']({},_0x5bf089,_0x38a486[_0xc8f4('0x4b')]);return _0x9996da['getSubjects'](_0x5bf089);}})[_0xc8f4('0x1c')](function(_0x3ad7dd){if(_0x3ad7dd){_0x5500a9=_0x3ad7dd[_0xc8f4('0x40')];if(!_0x38a486[_0xc8f4('0x3c')][_0xc8f4('0x41')]('nolimit')){_0x5bf089[_0xc8f4('0x2d')]=qs[_0xc8f4('0x2d')](_0x38a486[_0xc8f4('0x3c')]['limit']);_0x5bf089[_0xc8f4('0x2c')]=qs[_0xc8f4('0x2c')](_0x38a486[_0xc8f4('0x3c')][_0xc8f4('0x2c')]);}return _0x9996da[_0xc8f4('0x5a')](_0x5bf089);}})[_0xc8f4('0x1c')](function(_0x38e314){if(_0x38e314){return _0x38e314?{'count':_0x5500a9,'rows':_0x38e314}:null;}})[_0xc8f4('0x1c')](respondWithResult(_0x482cfd,null))['catch'](handleError(_0x482cfd,null));};exports[_0xc8f4('0x5d')]=function(_0x37d100,_0x1f419d,_0x3ce754){var _0xf2a4d7={};var _0x17c918={};var _0x16daa0;var _0xd17d2b;return db[_0xc8f4('0x37')][_0xc8f4('0x5b')]({'where':{'id':_0x37d100[_0xc8f4('0x54')]['id']}})['then'](handleEntityNotFound(_0x1f419d,null))[_0xc8f4('0x1c')](function(_0x386139){if(_0x386139){_0x16daa0=_0x386139;_0x17c918['model']=_[_0xc8f4('0x3a')](db[_0xc8f4('0x56')]['rawAttributes']);_0x17c918[_0xc8f4('0x3c')]=_[_0xc8f4('0x3a')](_0x37d100['query']);_0x17c918['filters']=_[_0xc8f4('0x3e')](_0x17c918[_0xc8f4('0x39')],_0x17c918[_0xc8f4('0x3c')]);_0xf2a4d7['attributes']=_[_0xc8f4('0x3e')](_0x17c918[_0xc8f4('0x39')],qs['fields'](_0x37d100['query'][_0xc8f4('0x3f')]));_0xf2a4d7[_0xc8f4('0x3d')]=_0xf2a4d7[_0xc8f4('0x3d')]['length']?_0xf2a4d7[_0xc8f4('0x3d')]:_0x17c918[_0xc8f4('0x39')];_0xf2a4d7[_0xc8f4('0x43')]=qs['sort'](_0x37d100[_0xc8f4('0x3c')][_0xc8f4('0x44')]);_0xf2a4d7[_0xc8f4('0x45')]=qs[_0xc8f4('0x3b')](_[_0xc8f4('0x5c')](_0x37d100[_0xc8f4('0x3c')],_0x17c918[_0xc8f4('0x3b')]));if(_0x37d100[_0xc8f4('0x3c')][_0xc8f4('0x57')]){_0xf2a4d7[_0xc8f4('0x45')]=_[_0xc8f4('0x46')](_0xf2a4d7['where'],{'$or':_[_0xc8f4('0x58')](_0xf2a4d7['attributes'],function(_0x398b7b){var _0x39896d={};_0x39896d[_0x398b7b]={'$like':'%'+_0x37d100[_0xc8f4('0x3c')][_0xc8f4('0x57')]+'%'};return _0x39896d;})});}_0xf2a4d7=_[_0xc8f4('0x46')]({},_0xf2a4d7,_0x37d100[_0xc8f4('0x4b')]);return _0x16daa0[_0xc8f4('0x5d')](_0xf2a4d7);}})[_0xc8f4('0x1c')](function(_0x55ede6){if(_0x55ede6){_0xd17d2b=_0x55ede6[_0xc8f4('0x40')];if(!_0x37d100['query']['hasOwnProperty'](_0xc8f4('0x42'))){_0xf2a4d7[_0xc8f4('0x2d')]=qs[_0xc8f4('0x2d')](_0x37d100['query']['limit']);_0xf2a4d7[_0xc8f4('0x2c')]=qs[_0xc8f4('0x2c')](_0x37d100[_0xc8f4('0x3c')]['offset']);}return _0x16daa0[_0xc8f4('0x5d')](_0xf2a4d7);}})['then'](function(_0x1f65b3){if(_0x1f65b3){return _0x1f65b3?{'count':_0xd17d2b,'rows':_0x1f65b3}:null;}})[_0xc8f4('0x1c')](respondWithResult(_0x1f419d,null))[_0xc8f4('0x27')](handleError(_0x1f419d,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js index 0f125e2..dafe524 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 _0x72c9=['request-promise','path','rimraf','../../config/environment','./intDynamics365Configuration.attributes','exports','Dynamics365Configuration','int_dynamics365_configurations','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x72c9,0xbe));var _0x972c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x72c9[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x972c('0x0'));var util=require(_0x972c('0x1'));var logger=require(_0x972c('0x2'))(_0x972c('0x3'));var moment=require(_0x972c('0x4'));var BPromise=require(_0x972c('0x5'));var rp=require(_0x972c('0x6'));var fs=require('fs');var path=require(_0x972c('0x7'));var rimraf=require(_0x972c('0x8'));var config=require(_0x972c('0x9'));var attributes=require(_0x972c('0xa'));module[_0x972c('0xb')]=function(_0x5221ab,_0x32604c){return _0x5221ab['define'](_0x972c('0xc'),attributes,{'tableName':_0x972c('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb642=['api','moment','bluebird','request-promise','rimraf','../../config/environment','./intDynamics365Configuration.attributes','exports','define','lodash','util','../../config/logger'];(function(_0x1d2fd9,_0xe4736a){var _0x5d98b6=function(_0x436d0d){while(--_0x436d0d){_0x1d2fd9['push'](_0x1d2fd9['shift']());}};_0x5d98b6(++_0xe4736a);}(_0xb642,0xe1));var _0x2b64=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0xb642[_0x4fc9e6];return _0x551d28;};'use strict';var _=require(_0x2b64('0x0'));var util=require(_0x2b64('0x1'));var logger=require(_0x2b64('0x2'))(_0x2b64('0x3'));var moment=require(_0x2b64('0x4'));var BPromise=require(_0x2b64('0x5'));var rp=require(_0x2b64('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2b64('0x7'));var config=require(_0x2b64('0x8'));var attributes=require(_0x2b64('0x9'));module[_0x2b64('0xa')]=function(_0x285732,_0x4e1414){return _0x285732[_0x2b64('0xb')]('Dynamics365Configuration',attributes,{'tableName':'int_dynamics365_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js index f72d664..85cf64b 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 _0x76b4=['request\x20sent','stringify','error','code','Dynamics365Configuration,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','request','then','info'];(function(_0x56916d,_0x37b935){var _0x2b7f1f=function(_0x206eb1){while(--_0x206eb1){_0x56916d['push'](_0x56916d['shift']());}};_0x2b7f1f(++_0x37b935);}(_0x76b4,0xbc));var _0x476b=function(_0x3eaa7e,_0x27f7af){_0x3eaa7e=_0x3eaa7e-0x0;var _0x38825d=_0x76b4[_0x3eaa7e];return _0x38825d;};'use strict';var _=require(_0x476b('0x0'));var util=require(_0x476b('0x1'));var moment=require(_0x476b('0x2'));var BPromise=require(_0x476b('0x3'));var rs=require(_0x476b('0x4'));var fs=require('fs');var Redis=require(_0x476b('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x476b('0x6'));var logger=require(_0x476b('0x7'))('rpc');var config=require(_0x476b('0x8'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5f1d39,_0x40ebe7,_0x411369){return new BPromise(function(_0x99ecb6,_0x153b59){return client[_0x476b('0x9')](_0x5f1d39,_0x411369)[_0x476b('0xa')](function(_0xdf587b){logger[_0x476b('0xb')]('Dynamics365Configuration,\x20%s,\x20%s',_0x40ebe7,'request\x20sent');logger['debug']('Dynamics365Configuration,\x20%s,\x20%s,\x20%s',_0x40ebe7,_0x476b('0xc'),JSON[_0x476b('0xd')](_0xdf587b));if(_0xdf587b[_0x476b('0xe')]){if(_0xdf587b[_0x476b('0xe')][_0x476b('0xf')]===0x1f4){logger['error'](_0x476b('0x10'),_0x40ebe7,_0xdf587b[_0x476b('0xe')]['message']);return _0x153b59(_0xdf587b[_0x476b('0xe')]['message']);}logger[_0x476b('0xe')]('Dynamics365Configuration,\x20%s,\x20%s',_0x40ebe7,_0xdf587b[_0x476b('0xe')][_0x476b('0x11')]);return _0x99ecb6(_0xdf587b[_0x476b('0xe')]['message']);}else{logger[_0x476b('0xb')](_0x476b('0x10'),_0x40ebe7,_0x476b('0xc'));_0x99ecb6(_0xdf587b[_0x476b('0x12')][_0x476b('0x11')]);}})[_0x476b('0x13')](function(_0x1486b0){logger[_0x476b('0xe')](_0x476b('0x10'),_0x40ebe7,_0x1486b0);_0x153b59(_0x1486b0);});});} \ No newline at end of file +var _0x5ee7=['request\x20sent','stringify','error','Dynamics365Configuration,\x20%s,\x20%s','message','result','lodash','moment','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','debug'];(function(_0x36966f,_0x31da39){var _0x1d59be=function(_0x44df73){while(--_0x44df73){_0x36966f['push'](_0x36966f['shift']());}};_0x1d59be(++_0x31da39);}(_0x5ee7,0x16f));var _0x75ee=function(_0x37a409,_0x1665c9){_0x37a409=_0x37a409-0x0;var _0x541a90=_0x5ee7[_0x37a409];return _0x541a90;};'use strict';var _=require(_0x75ee('0x0'));var util=require('util');var moment=require(_0x75ee('0x1'));var BPromise=require(_0x75ee('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x75ee('0x3'));var logger=require(_0x75ee('0x4'))(_0x75ee('0x5'));var config=require(_0x75ee('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x75ee('0x7')][_0x75ee('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x47c480,_0x2db136,_0xa1e2ad){return new BPromise(function(_0x519d4e,_0x5309e7){return client[_0x75ee('0x9')](_0x47c480,_0xa1e2ad)[_0x75ee('0xa')](function(_0x58059a){logger[_0x75ee('0xb')]('Dynamics365Configuration,\x20%s,\x20%s',_0x2db136,'request\x20sent');logger[_0x75ee('0xc')]('Dynamics365Configuration,\x20%s,\x20%s,\x20%s',_0x2db136,_0x75ee('0xd'),JSON[_0x75ee('0xe')](_0x58059a));if(_0x58059a['error']){if(_0x58059a['error']['code']===0x1f4){logger[_0x75ee('0xf')](_0x75ee('0x10'),_0x2db136,_0x58059a[_0x75ee('0xf')]['message']);return _0x5309e7(_0x58059a[_0x75ee('0xf')][_0x75ee('0x11')]);}logger[_0x75ee('0xf')]('Dynamics365Configuration,\x20%s,\x20%s',_0x2db136,_0x58059a[_0x75ee('0xf')][_0x75ee('0x11')]);return _0x519d4e(_0x58059a[_0x75ee('0xf')][_0x75ee('0x11')]);}else{logger['info']('Dynamics365Configuration,\x20%s,\x20%s',_0x2db136,_0x75ee('0xd'));_0x519d4e(_0x58059a[_0x75ee('0x12')][_0x75ee('0x11')]);}})['catch'](function(_0x3a924d){logger[_0x75ee('0xf')](_0x75ee('0x10'),_0x2db136,_0x3a924d);_0x5309e7(_0x3a924d);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Field/index.js b/server/api/intDynamics365Field/index.js index 03e85c8..93572f0 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 _0x5712=['multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Field.controller','index','/:id','isAuthenticated','show','post','create','update','delete','destroy','exports'];(function(_0x421446,_0x19af26){var _0x40e2a6=function(_0x254616){while(--_0x254616){_0x421446['push'](_0x421446['shift']());}};_0x40e2a6(++_0x19af26);}(_0x5712,0x140));var _0x2571=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x5712[_0x3b380d];return _0x54502b;};'use strict';var multer=require(_0x2571('0x0'));var util=require(_0x2571('0x1'));var path=require(_0x2571('0x2'));var timeout=require(_0x2571('0x3'));var express=require(_0x2571('0x4'));var router=express[_0x2571('0x5')]();var auth=require(_0x2571('0x6'));var interaction=require(_0x2571('0x7'));var config=require(_0x2571('0x8'));var controller=require(_0x2571('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x2571('0xa')]);router['get'](_0x2571('0xb'),auth[_0x2571('0xc')](),controller[_0x2571('0xd')]);router[_0x2571('0xe')]('/',auth[_0x2571('0xc')](),controller[_0x2571('0xf')]);router['put'](_0x2571('0xb'),auth['isAuthenticated'](),controller[_0x2571('0x10')]);router[_0x2571('0x11')](_0x2571('0xb'),auth[_0x2571('0xc')](),controller[_0x2571('0x12')]);module[_0x2571('0x13')]=router; \ No newline at end of file +var _0x7d98=['get','/:id','isAuthenticated','show','create','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment'];(function(_0x5b0413,_0x3f4093){var _0x2b9b26=function(_0x58669e){while(--_0x58669e){_0x5b0413['push'](_0x5b0413['shift']());}};_0x2b9b26(++_0x3f4093);}(_0x7d98,0xe7));var _0x87d9=function(_0xfedc72,_0x292f02){_0xfedc72=_0xfedc72-0x0;var _0x2c7c78=_0x7d98[_0xfedc72];return _0x2c7c78;};'use strict';var multer=require(_0x87d9('0x0'));var util=require('util');var path=require(_0x87d9('0x1'));var timeout=require(_0x87d9('0x2'));var express=require(_0x87d9('0x3'));var router=express[_0x87d9('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x87d9('0x5'));var config=require(_0x87d9('0x6'));var controller=require('./intDynamics365Field.controller');router[_0x87d9('0x7')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x87d9('0x8'),auth[_0x87d9('0x9')](),controller[_0x87d9('0xa')]);router['post']('/',auth[_0x87d9('0x9')](),controller[_0x87d9('0xb')]);router[_0x87d9('0xc')]('/:id',auth[_0x87d9('0x9')](),controller[_0x87d9('0xd')]);router[_0x87d9('0xe')](_0x87d9('0x8'),auth[_0x87d9('0x9')](),controller[_0x87d9('0xf')]);module[_0x87d9('0x10')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.attributes.js b/server/api/intDynamics365Field/intDynamics365Field.attributes.js index 153351e..74023b6 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 _0xcb97=['customVariable','BOOLEAN','sequelize','exports','ENUM','keyValue','string','STRING','variable'];(function(_0x19776e,_0x3690de){var _0xce4b5f=function(_0x6e04fd){while(--_0x6e04fd){_0x19776e['push'](_0x19776e['shift']());}};_0xce4b5f(++_0x3690de);}(_0xcb97,0x14f));var _0x7cb9=function(_0x2c5bdd,_0xba6a89){_0x2c5bdd=_0x2c5bdd-0x0;var _0x1d35b5=_0xcb97[_0x2c5bdd];return _0x1d35b5;};'use strict';var Sequelize=require(_0x7cb9('0x0'));module[_0x7cb9('0x1')]={'type':{'type':Sequelize[_0x7cb9('0x2')]('string','variable','customVariable',_0x7cb9('0x3')),'defaultValue':_0x7cb9('0x4')},'content':{'type':Sequelize[_0x7cb9('0x5')]},'key':{'type':Sequelize[_0x7cb9('0x5')]},'keyType':{'type':Sequelize[_0x7cb9('0x2')](_0x7cb9('0x4'),_0x7cb9('0x6'),_0x7cb9('0x7'))},'keyContent':{'type':Sequelize[_0x7cb9('0x5')]},'idField':{'type':Sequelize[_0x7cb9('0x5')]},'nameField':{'type':Sequelize[_0x7cb9('0x5')]},'customField':{'type':Sequelize[_0x7cb9('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x5147=['STRING','sequelize','exports','ENUM','string','variable','customVariable','keyValue'];(function(_0x28d225,_0x43be18){var _0x1f79e1=function(_0x362c23){while(--_0x362c23){_0x28d225['push'](_0x28d225['shift']());}};_0x1f79e1(++_0x43be18);}(_0x5147,0x191));var _0x7514=function(_0x58cd50,_0x186544){_0x58cd50=_0x58cd50-0x0;var _0x1e77bf=_0x5147[_0x58cd50];return _0x1e77bf;};'use strict';var Sequelize=require(_0x7514('0x0'));module[_0x7514('0x1')]={'type':{'type':Sequelize[_0x7514('0x2')](_0x7514('0x3'),_0x7514('0x4'),_0x7514('0x5'),_0x7514('0x6')),'defaultValue':_0x7514('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x7514('0x2')]('string',_0x7514('0x4'),_0x7514('0x5'))},'keyContent':{'type':Sequelize[_0x7514('0x7')]},'idField':{'type':Sequelize[_0x7514('0x7')]},'nameField':{'type':Sequelize[_0x7514('0x7')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x7514('0x7')]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.controller.js b/server/api/intDynamics365Field/intDynamics365Field.controller.js index af507b2..e516d2e 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 _0x07de=['map','key','field','filter','options','findAll','rows','show','params','includeAll','include','Dynamics365Field','catch','create','body','html-pdf','eml-format','request-promise','bluebird','mustache','util','path','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','json','count','offset','limit','set','Content-Range','apply','reject','save','then','destroy','sendStatus','stack','name','send','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','merge'];(function(_0x43e173,_0xa9e6fe){var _0x29b899=function(_0x1d18a1){while(--_0x1d18a1){_0x43e173['push'](_0x43e173['shift']());}};_0x29b899(++_0xa9e6fe);}(_0x07de,0x168));var _0xe07d=function(_0x4f3ca6,_0x30bd1b){_0x4f3ca6=_0x4f3ca6-0x0;var _0x42f920=_0x07de[_0x4f3ca6];return _0x42f920;};'use strict';var pdf=require(_0xe07d('0x0'));var emlformat=require(_0xe07d('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xe07d('0x2'));var moment=require('moment');var BPromise=require(_0xe07d('0x3'));var Mustache=require(_0xe07d('0x4'));var util=require(_0xe07d('0x5'));var path=require(_0xe07d('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xe07d('0x7'));var fs=require('fs');var _=require(_0xe07d('0x8'));var squel=require(_0xe07d('0x9'));var crypto=require(_0xe07d('0xa'));var jsforce=require(_0xe07d('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xe07d('0xc'));var Papa=require(_0xe07d('0xd'));var Redis=require('ioredis');var authService=require(_0xe07d('0xe'));var qs=require(_0xe07d('0xf'));var as=require(_0xe07d('0x10'));var hardwareService=require(_0xe07d('0x11'));var logger=require(_0xe07d('0x12'))(_0xe07d('0x13'));var utils=require(_0xe07d('0x14'));var config=require(_0xe07d('0x15'));var db=require(_0xe07d('0x16'))['db'];function respondWithStatusCode(_0x4a5904,_0x34cb7f){_0x34cb7f=_0x34cb7f||0xcc;return function(_0x55d4d6){if(_0x55d4d6){return _0x4a5904['sendStatus'](_0x34cb7f);}return _0x4a5904[_0xe07d('0x17')](_0x34cb7f)['end']();};}function respondWithResult(_0x9438bd,_0x225f74){_0x225f74=_0x225f74||0xc8;return function(_0x22e941){if(_0x22e941){return _0x9438bd[_0xe07d('0x17')](_0x225f74)[_0xe07d('0x18')](_0x22e941);}};}function respondWithFilteredResult(_0x44c49e,_0x23f910){return function(_0x2b3557){if(_0x2b3557){var _0x272c9f=_0x2b3557[_0xe07d('0x19')],_0x6c051a=_0x23f910[_0xe07d('0x1a')],_0x560e71=_0x23f910['offset']+_0x23f910[_0xe07d('0x1b')],_0x5dde6f;if(_0x560e71>=_0x272c9f){_0x560e71=_0x272c9f;_0x5dde6f=0xc8;}else{_0x5dde6f=0xce;}_0x44c49e[_0xe07d('0x17')](_0x5dde6f);return _0x44c49e[_0xe07d('0x1c')](_0xe07d('0x1d'),_0x6c051a+'-'+_0x560e71+'/'+_0x272c9f)['json'](_0x2b3557);}return null;};}function patchUpdates(_0x443128){return function(_0x3f19f5){try{jsonpatch[_0xe07d('0x1e')](_0x3f19f5,_0x443128,!![]);}catch(_0x3daf48){return BPromise[_0xe07d('0x1f')](_0x3daf48);}return _0x3f19f5[_0xe07d('0x20')]();};}function saveUpdates(_0xe3c91c,_0x3e73b9){return function(_0x2d0075){if(_0x2d0075){return _0x2d0075['update'](_0xe3c91c)[_0xe07d('0x21')](function(_0x1b0556){return _0x1b0556;});}return null;};}function removeEntity(_0x54d4d2,_0x92fe35){return function(_0xc690b8){if(_0xc690b8){return _0xc690b8[_0xe07d('0x22')]()[_0xe07d('0x21')](function(){_0x54d4d2['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3c23e1,_0x157322){return function(_0x2c1504){if(!_0x2c1504){_0x3c23e1[_0xe07d('0x23')](0x194);}return _0x2c1504;};}function handleError(_0x36c8dd,_0x21cf3f){_0x21cf3f=_0x21cf3f||0x1f4;return function(_0x14d4a4){logger['error'](_0x14d4a4[_0xe07d('0x24')]);if(_0x14d4a4[_0xe07d('0x25')]){delete _0x14d4a4['name'];}_0x36c8dd[_0xe07d('0x17')](_0x21cf3f)[_0xe07d('0x26')](_0x14d4a4);};}exports['index']=function(_0x6faf2f,_0x54e610){var _0x17d851={},_0x5876cc={},_0x1c32db={'count':0x0,'rows':[]};var _0x543b28=db['Dynamics365Field'][_0xe07d('0x27')];_0x5876cc[_0xe07d('0x28')]=_['keys'](_0x543b28);_0x5876cc['query']=_[_0xe07d('0x29')](_0x6faf2f[_0xe07d('0x2a')]);_0x5876cc[_0xe07d('0x2b')]=_[_0xe07d('0x2c')](_0x5876cc[_0xe07d('0x28')],_0x5876cc[_0xe07d('0x2a')]);_0x17d851[_0xe07d('0x2d')]=_[_0xe07d('0x2c')](_0x5876cc['model'],qs['fields'](_0x6faf2f[_0xe07d('0x2a')][_0xe07d('0x2e')]));_0x17d851[_0xe07d('0x2d')]=_0x17d851[_0xe07d('0x2d')][_0xe07d('0x2f')]?_0x17d851[_0xe07d('0x2d')]:_0x5876cc[_0xe07d('0x28')];if(!_0x6faf2f[_0xe07d('0x2a')][_0xe07d('0x30')]('nolimit')){_0x17d851[_0xe07d('0x1b')]=qs[_0xe07d('0x1b')](_0x6faf2f[_0xe07d('0x2a')][_0xe07d('0x1b')]);_0x17d851['offset']=qs['offset'](_0x6faf2f[_0xe07d('0x2a')][_0xe07d('0x1a')]);}_0x17d851[_0xe07d('0x31')]=qs[_0xe07d('0x32')](_0x6faf2f['query'][_0xe07d('0x32')]);_0x17d851[_0xe07d('0x33')]=qs[_0xe07d('0x2b')](_[_0xe07d('0x34')](_0x6faf2f['query'],_0x5876cc[_0xe07d('0x2b')]));if(_0x6faf2f[_0xe07d('0x2a')]['filter']){_0x17d851[_0xe07d('0x33')]=_[_0xe07d('0x35')](_0x17d851[_0xe07d('0x33')],{'$or':_[_0xe07d('0x36')](_0x543b28,function(_0x58acad){if(_0x58acad['type'][_0xe07d('0x37')]!=='VIRTUAL'){var _0x5187af={};_0x5187af[_0x58acad[_0xe07d('0x38')]]={'$like':'%'+_0x6faf2f['query'][_0xe07d('0x39')]+'%'};return _0x5187af;}})});}_0x17d851=_[_0xe07d('0x35')]({},_0x17d851,_0x6faf2f[_0xe07d('0x3a')]);var _0x1ad10e={'where':_0x17d851['where']};return db['Dynamics365Field'][_0xe07d('0x19')](_0x1ad10e)['then'](function(_0x25fde3){_0x1c32db[_0xe07d('0x19')]=_0x25fde3;if(_0x6faf2f[_0xe07d('0x2a')]['includeAll']){_0x17d851['include']=[{'all':!![]}];}return db['Dynamics365Field'][_0xe07d('0x3b')](_0x17d851);})['then'](function(_0x14f2f3){_0x1c32db[_0xe07d('0x3c')]=_0x14f2f3;return _0x1c32db;})[_0xe07d('0x21')](respondWithFilteredResult(_0x54e610,_0x17d851))['catch'](handleError(_0x54e610,null));};exports[_0xe07d('0x3d')]=function(_0x4fe2f0,_0x484abf){var _0x2020ad={'raw':!![],'where':{'id':_0x4fe2f0[_0xe07d('0x3e')]['id']}},_0x4bdd18={};_0x4bdd18['model']=_['keys'](db['Dynamics365Field']['rawAttributes']);_0x4bdd18[_0xe07d('0x2a')]=_[_0xe07d('0x29')](_0x4fe2f0[_0xe07d('0x2a')]);_0x4bdd18['filters']=_[_0xe07d('0x2c')](_0x4bdd18[_0xe07d('0x28')],_0x4bdd18['query']);_0x2020ad[_0xe07d('0x2d')]=_[_0xe07d('0x2c')](_0x4bdd18[_0xe07d('0x28')],qs[_0xe07d('0x2e')](_0x4fe2f0[_0xe07d('0x2a')][_0xe07d('0x2e')]));_0x2020ad[_0xe07d('0x2d')]=_0x2020ad[_0xe07d('0x2d')][_0xe07d('0x2f')]?_0x2020ad[_0xe07d('0x2d')]:_0x4bdd18[_0xe07d('0x28')];if(_0x4fe2f0['query'][_0xe07d('0x3f')]){_0x2020ad[_0xe07d('0x40')]=[{'all':!![]}];}_0x2020ad=_[_0xe07d('0x35')]({},_0x2020ad,_0x4fe2f0[_0xe07d('0x3a')]);return db[_0xe07d('0x41')]['find'](_0x2020ad)[_0xe07d('0x21')](handleEntityNotFound(_0x484abf,null))[_0xe07d('0x21')](respondWithResult(_0x484abf,null))[_0xe07d('0x42')](handleError(_0x484abf,null));};exports['create']=function(_0x1e4f30,_0x8748e7){return db[_0xe07d('0x41')][_0xe07d('0x43')](_0x1e4f30[_0xe07d('0x44')],{})[_0xe07d('0x21')](respondWithResult(_0x8748e7,0xc9))[_0xe07d('0x42')](handleError(_0x8748e7,null));};exports['update']=function(_0x2bd21b,_0x5e640d){if(_0x2bd21b[_0xe07d('0x44')]['id']){delete _0x2bd21b[_0xe07d('0x44')]['id'];}return db[_0xe07d('0x41')]['find']({'where':{'id':_0x2bd21b[_0xe07d('0x3e')]['id']}})[_0xe07d('0x21')](handleEntityNotFound(_0x5e640d,null))['then'](saveUpdates(_0x2bd21b['body'],null))['then'](respondWithResult(_0x5e640d,null))[_0xe07d('0x42')](handleError(_0x5e640d,null));};exports[_0xe07d('0x22')]=function(_0x5c7442,_0xa9ad3a){return db[_0xe07d('0x41')]['find']({'where':{'id':_0x5c7442[_0xe07d('0x3e')]['id']}})['then'](handleEntityNotFound(_0xa9ad3a,null))['then'](removeEntity(_0xa9ad3a,null))[_0xe07d('0x42')](handleError(_0xa9ad3a,null));}; \ No newline at end of file +var _0xadac=['mustache','util','path','sox','to-csv','ejs','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','json','count','offset','limit','status','set','Content-Range','apply','save','update','then','error','stack','name','send','index','Dynamics365Field','rawAttributes','keys','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','map','type','key','VIRTUAL','field','filter','merge','includeAll','rows','params','include','options','find','create','catch','body','destroy','html-pdf','eml-format','rimraf','zip-dir','request-promise','bluebird'];(function(_0x25d386,_0x108d0d){var _0x857f4a=function(_0x3eb98d){while(--_0x3eb98d){_0x25d386['push'](_0x25d386['shift']());}};_0x857f4a(++_0x108d0d);}(_0xadac,0xd2));var _0xcada=function(_0x2dce9f,_0x1d1880){_0x2dce9f=_0x2dce9f-0x0;var _0x1cd454=_0xadac[_0x2dce9f];return _0x1cd454;};'use strict';var pdf=require(_0xcada('0x0'));var emlformat=require(_0xcada('0x1'));var rimraf=require(_0xcada('0x2'));var zipdir=require(_0xcada('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xcada('0x4'));var moment=require('moment');var BPromise=require(_0xcada('0x5'));var Mustache=require(_0xcada('0x6'));var util=require(_0xcada('0x7'));var path=require(_0xcada('0x8'));var sox=require(_0xcada('0x9'));var csv=require(_0xcada('0xa'));var ejs=require(_0xcada('0xb'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xcada('0xc'));var Papa=require(_0xcada('0xd'));var Redis=require('ioredis');var authService=require(_0xcada('0xe'));var qs=require(_0xcada('0xf'));var as=require(_0xcada('0x10'));var hardwareService=require(_0xcada('0x11'));var logger=require(_0xcada('0x12'))(_0xcada('0x13'));var utils=require('../../config/utils');var config=require(_0xcada('0x14'));var db=require(_0xcada('0x15'))['db'];function respondWithStatusCode(_0x81f007,_0x53e012){_0x53e012=_0x53e012||0xcc;return function(_0x2470e6){if(_0x2470e6){return _0x81f007[_0xcada('0x16')](_0x53e012);}return _0x81f007['status'](_0x53e012)['end']();};}function respondWithResult(_0x299373,_0x5a3db6){_0x5a3db6=_0x5a3db6||0xc8;return function(_0x1ee182){if(_0x1ee182){return _0x299373['status'](_0x5a3db6)[_0xcada('0x17')](_0x1ee182);}};}function respondWithFilteredResult(_0x157229,_0x4f3d22){return function(_0x10dae3){if(_0x10dae3){var _0x547b59=_0x10dae3[_0xcada('0x18')],_0x252c22=_0x4f3d22['offset'],_0x4d9c09=_0x4f3d22[_0xcada('0x19')]+_0x4f3d22[_0xcada('0x1a')],_0x2c1ab1;if(_0x4d9c09>=_0x547b59){_0x4d9c09=_0x547b59;_0x2c1ab1=0xc8;}else{_0x2c1ab1=0xce;}_0x157229[_0xcada('0x1b')](_0x2c1ab1);return _0x157229[_0xcada('0x1c')](_0xcada('0x1d'),_0x252c22+'-'+_0x4d9c09+'/'+_0x547b59)['json'](_0x10dae3);}return null;};}function patchUpdates(_0x2f74b2){return function(_0x3c1c0a){try{jsonpatch[_0xcada('0x1e')](_0x3c1c0a,_0x2f74b2,!![]);}catch(_0x37844c){return BPromise['reject'](_0x37844c);}return _0x3c1c0a[_0xcada('0x1f')]();};}function saveUpdates(_0x5d5fd0,_0x3aa018){return function(_0x50bd03){if(_0x50bd03){return _0x50bd03[_0xcada('0x20')](_0x5d5fd0)['then'](function(_0x3bb69e){return _0x3bb69e;});}return null;};}function removeEntity(_0x36d9a7,_0x447ce6){return function(_0x564477){if(_0x564477){return _0x564477['destroy']()[_0xcada('0x21')](function(){_0x36d9a7['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x538652,_0x3cba4a){return function(_0x520351){if(!_0x520351){_0x538652[_0xcada('0x16')](0x194);}return _0x520351;};}function handleError(_0x4ccacc,_0x543f5e){_0x543f5e=_0x543f5e||0x1f4;return function(_0x4a2801){logger[_0xcada('0x22')](_0x4a2801[_0xcada('0x23')]);if(_0x4a2801[_0xcada('0x24')]){delete _0x4a2801[_0xcada('0x24')];}_0x4ccacc[_0xcada('0x1b')](_0x543f5e)[_0xcada('0x25')](_0x4a2801);};}exports[_0xcada('0x26')]=function(_0x395390,_0x1f1c84){var _0x4e91f5={},_0xd8ef54={},_0x3b4a66={'count':0x0,'rows':[]};var _0x4e19f9=db[_0xcada('0x27')][_0xcada('0x28')];_0xd8ef54['model']=_[_0xcada('0x29')](_0x4e19f9);_0xd8ef54[_0xcada('0x2a')]=_[_0xcada('0x29')](_0x395390[_0xcada('0x2a')]);_0xd8ef54[_0xcada('0x2b')]=_[_0xcada('0x2c')](_0xd8ef54[_0xcada('0x2d')],_0xd8ef54[_0xcada('0x2a')]);_0x4e91f5['attributes']=_[_0xcada('0x2c')](_0xd8ef54['model'],qs[_0xcada('0x2e')](_0x395390[_0xcada('0x2a')][_0xcada('0x2e')]));_0x4e91f5[_0xcada('0x2f')]=_0x4e91f5[_0xcada('0x2f')][_0xcada('0x30')]?_0x4e91f5[_0xcada('0x2f')]:_0xd8ef54[_0xcada('0x2d')];if(!_0x395390[_0xcada('0x2a')][_0xcada('0x31')](_0xcada('0x32'))){_0x4e91f5['limit']=qs[_0xcada('0x1a')](_0x395390['query'][_0xcada('0x1a')]);_0x4e91f5[_0xcada('0x19')]=qs[_0xcada('0x19')](_0x395390[_0xcada('0x2a')][_0xcada('0x19')]);}_0x4e91f5[_0xcada('0x33')]=qs[_0xcada('0x34')](_0x395390[_0xcada('0x2a')]['sort']);_0x4e91f5[_0xcada('0x35')]=qs[_0xcada('0x2b')](_[_0xcada('0x36')](_0x395390[_0xcada('0x2a')],_0xd8ef54[_0xcada('0x2b')]));if(_0x395390[_0xcada('0x2a')]['filter']){_0x4e91f5[_0xcada('0x35')]=_['merge'](_0x4e91f5['where'],{'$or':_[_0xcada('0x37')](_0x4e19f9,function(_0x2e3eac){if(_0x2e3eac[_0xcada('0x38')][_0xcada('0x39')]!==_0xcada('0x3a')){var _0x3efad0={};_0x3efad0[_0x2e3eac[_0xcada('0x3b')]]={'$like':'%'+_0x395390[_0xcada('0x2a')][_0xcada('0x3c')]+'%'};return _0x3efad0;}})});}_0x4e91f5=_[_0xcada('0x3d')]({},_0x4e91f5,_0x395390['options']);var _0x2f002e={'where':_0x4e91f5[_0xcada('0x35')]};return db[_0xcada('0x27')][_0xcada('0x18')](_0x2f002e)[_0xcada('0x21')](function(_0x404731){_0x3b4a66[_0xcada('0x18')]=_0x404731;if(_0x395390['query'][_0xcada('0x3e')]){_0x4e91f5['include']=[{'all':!![]}];}return db[_0xcada('0x27')]['findAll'](_0x4e91f5);})[_0xcada('0x21')](function(_0x528b37){_0x3b4a66[_0xcada('0x3f')]=_0x528b37;return _0x3b4a66;})[_0xcada('0x21')](respondWithFilteredResult(_0x1f1c84,_0x4e91f5))['catch'](handleError(_0x1f1c84,null));};exports['show']=function(_0x28e4b1,_0x49789a){var _0x1387d2={'raw':!![],'where':{'id':_0x28e4b1[_0xcada('0x40')]['id']}},_0x20e589={};_0x20e589['model']=_[_0xcada('0x29')](db[_0xcada('0x27')][_0xcada('0x28')]);_0x20e589[_0xcada('0x2a')]=_[_0xcada('0x29')](_0x28e4b1[_0xcada('0x2a')]);_0x20e589[_0xcada('0x2b')]=_[_0xcada('0x2c')](_0x20e589['model'],_0x20e589['query']);_0x1387d2['attributes']=_[_0xcada('0x2c')](_0x20e589[_0xcada('0x2d')],qs[_0xcada('0x2e')](_0x28e4b1[_0xcada('0x2a')]['fields']));_0x1387d2[_0xcada('0x2f')]=_0x1387d2[_0xcada('0x2f')][_0xcada('0x30')]?_0x1387d2['attributes']:_0x20e589[_0xcada('0x2d')];if(_0x28e4b1[_0xcada('0x2a')][_0xcada('0x3e')]){_0x1387d2[_0xcada('0x41')]=[{'all':!![]}];}_0x1387d2=_['merge']({},_0x1387d2,_0x28e4b1[_0xcada('0x42')]);return db[_0xcada('0x27')][_0xcada('0x43')](_0x1387d2)[_0xcada('0x21')](handleEntityNotFound(_0x49789a,null))[_0xcada('0x21')](respondWithResult(_0x49789a,null))['catch'](handleError(_0x49789a,null));};exports[_0xcada('0x44')]=function(_0x471527,_0x5cb376){return db['Dynamics365Field'][_0xcada('0x44')](_0x471527['body'],{})[_0xcada('0x21')](respondWithResult(_0x5cb376,0xc9))[_0xcada('0x45')](handleError(_0x5cb376,null));};exports[_0xcada('0x20')]=function(_0x826f62,_0x37734c){if(_0x826f62[_0xcada('0x46')]['id']){delete _0x826f62['body']['id'];}return db['Dynamics365Field'][_0xcada('0x43')]({'where':{'id':_0x826f62[_0xcada('0x40')]['id']}})[_0xcada('0x21')](handleEntityNotFound(_0x37734c,null))[_0xcada('0x21')](saveUpdates(_0x826f62[_0xcada('0x46')],null))[_0xcada('0x21')](respondWithResult(_0x37734c,null))[_0xcada('0x45')](handleError(_0x37734c,null));};exports[_0xcada('0x47')]=function(_0x17baef,_0x39a326){return db[_0xcada('0x27')][_0xcada('0x43')]({'where':{'id':_0x17baef[_0xcada('0x40')]['id']}})[_0xcada('0x21')](handleEntityNotFound(_0x39a326,null))[_0xcada('0x21')](removeEntity(_0x39a326,null))['catch'](handleError(_0x39a326,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.model.js b/server/api/intDynamics365Field/intDynamics365Field.model.js index f73c37f..84b2272 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 _0x412d=['lodash','util','../../config/logger','api','moment','request-promise','exports','Dynamics365Field','int_dynamics365_fields','dynamics365_unique_index','idField','FieldId'];(function(_0x3cffb3,_0x284b2d){var _0x57a846=function(_0x32a354){while(--_0x32a354){_0x3cffb3['push'](_0x3cffb3['shift']());}};_0x57a846(++_0x284b2d);}(_0x412d,0xfc));var _0xd412=function(_0x3ddc33,_0x2a3427){_0x3ddc33=_0x3ddc33-0x0;var _0x29b7c5=_0x412d[_0x3ddc33];return _0x29b7c5;};'use strict';var _=require(_0xd412('0x0'));var util=require(_0xd412('0x1'));var logger=require(_0xd412('0x2'))(_0xd412('0x3'));var moment=require(_0xd412('0x4'));var BPromise=require('bluebird');var rp=require(_0xd412('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./intDynamics365Field.attributes');module[_0xd412('0x6')]=function(_0x2e1d2e,_0xf58a8b){return _0x2e1d2e['define'](_0xd412('0x7'),attributes,{'tableName':_0xd412('0x8'),'paranoid':![],'indexes':[{'name':_0xd412('0x9'),'fields':[_0xd412('0xa'),_0xd412('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x70e0=['./intDynamics365Field.attributes','exports','define','Dynamics365Field','int_dynamics365_fields','dynamics365_unique_index','idField','lodash','util','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x530732,_0x417445){var _0x26aa8c=function(_0x58acbe){while(--_0x58acbe){_0x530732['push'](_0x530732['shift']());}};_0x26aa8c(++_0x417445);}(_0x70e0,0x173));var _0x070e=function(_0x1bc6ed,_0x285562){_0x1bc6ed=_0x1bc6ed-0x0;var _0x12703a=_0x70e0[_0x1bc6ed];return _0x12703a;};'use strict';var _=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x070e('0x2'));var BPromise=require(_0x070e('0x3'));var rp=require(_0x070e('0x4'));var fs=require('fs');var path=require(_0x070e('0x5'));var rimraf=require('rimraf');var config=require(_0x070e('0x6'));var attributes=require(_0x070e('0x7'));module[_0x070e('0x8')]=function(_0x258e51,_0x268745){return _0x258e51[_0x070e('0x9')](_0x070e('0xa'),attributes,{'tableName':_0x070e('0xb'),'paranoid':![],'indexes':[{'name':_0x070e('0xc'),'fields':[_0x070e('0xd'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.rpc.js b/server/api/intDynamics365Field/intDynamics365Field.rpc.js index 428ce74..9a375c5 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 _0xee2c=['jayson/promise','client','http','request','then','info','Dynamics365Field,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/logger','rpc'];(function(_0x1688be,_0x466690){var _0x25a1ef=function(_0x4d5deb){while(--_0x4d5deb){_0x1688be['push'](_0x1688be['shift']());}};_0x25a1ef(++_0x466690);}(_0xee2c,0x1c7));var _0xcee2=function(_0x36ed48,_0x1ee0d4){_0x36ed48=_0x36ed48-0x0;var _0x51c63a=_0xee2c[_0x36ed48];return _0x51c63a;};'use strict';var _=require(_0xcee2('0x0'));var util=require('util');var moment=require(_0xcee2('0x1'));var BPromise=require(_0xcee2('0x2'));var rs=require(_0xcee2('0x3'));var fs=require('fs');var Redis=require(_0xcee2('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xcee2('0x5'))(_0xcee2('0x6'));var config=require('../../config/environment');var jayson=require(_0xcee2('0x7'));var client=jayson[_0xcee2('0x8')][_0xcee2('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3d7611,_0x24ce33,_0x5a8219){return new BPromise(function(_0x52a4ac,_0xea6c3c){return client[_0xcee2('0xa')](_0x3d7611,_0x5a8219)[_0xcee2('0xb')](function(_0x23dd44){logger[_0xcee2('0xc')](_0xcee2('0xd'),_0x24ce33,_0xcee2('0xe'));logger[_0xcee2('0xf')]('Dynamics365Field,\x20%s,\x20%s,\x20%s',_0x24ce33,_0xcee2('0xe'),JSON[_0xcee2('0x10')](_0x23dd44));if(_0x23dd44[_0xcee2('0x11')]){if(_0x23dd44[_0xcee2('0x11')][_0xcee2('0x12')]===0x1f4){logger['error'](_0xcee2('0xd'),_0x24ce33,_0x23dd44['error']['message']);return _0xea6c3c(_0x23dd44['error'][_0xcee2('0x13')]);}logger[_0xcee2('0x11')](_0xcee2('0xd'),_0x24ce33,_0x23dd44[_0xcee2('0x11')]['message']);return _0x52a4ac(_0x23dd44[_0xcee2('0x11')][_0xcee2('0x13')]);}else{logger[_0xcee2('0xc')](_0xcee2('0xd'),_0x24ce33,_0xcee2('0xe'));_0x52a4ac(_0x23dd44[_0xcee2('0x14')][_0xcee2('0x13')]);}})[_0xcee2('0x15')](function(_0x45c680){logger['error'](_0xcee2('0xd'),_0x24ce33,_0x45c680);_0xea6c3c(_0x45c680);});});} \ No newline at end of file +var _0x0eeb=['client','http','request','then','info','Dynamics365Field,\x20%s,\x20%s','Dynamics365Field,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x6a94f8,_0x1e57f1){var _0x31a3ec=function(_0x2aa55d){while(--_0x2aa55d){_0x6a94f8['push'](_0x6a94f8['shift']());}};_0x31a3ec(++_0x1e57f1);}(_0x0eeb,0xc5));var _0xb0ee=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x0eeb[_0x2c91e9];return _0x13f0ff;};'use strict';var _=require(_0xb0ee('0x0'));var util=require(_0xb0ee('0x1'));var moment=require(_0xb0ee('0x2'));var BPromise=require(_0xb0ee('0x3'));var rs=require(_0xb0ee('0x4'));var fs=require('fs');var Redis=require(_0xb0ee('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xb0ee('0x6'))(_0xb0ee('0x7'));var config=require(_0xb0ee('0x8'));var jayson=require(_0xb0ee('0x9'));var client=jayson[_0xb0ee('0xa')][_0xb0ee('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x17f445,_0x5377b4,_0x207a85){return new BPromise(function(_0x586bc9,_0x13c198){return client[_0xb0ee('0xc')](_0x17f445,_0x207a85)[_0xb0ee('0xd')](function(_0x308603){logger[_0xb0ee('0xe')](_0xb0ee('0xf'),_0x5377b4,'request\x20sent');logger['debug'](_0xb0ee('0x10'),_0x5377b4,_0xb0ee('0x11'),JSON['stringify'](_0x308603));if(_0x308603['error']){if(_0x308603[_0xb0ee('0x12')][_0xb0ee('0x13')]===0x1f4){logger[_0xb0ee('0x12')](_0xb0ee('0xf'),_0x5377b4,_0x308603['error'][_0xb0ee('0x14')]);return _0x13c198(_0x308603['error']['message']);}logger['error'](_0xb0ee('0xf'),_0x5377b4,_0x308603[_0xb0ee('0x12')]['message']);return _0x586bc9(_0x308603[_0xb0ee('0x12')][_0xb0ee('0x14')]);}else{logger[_0xb0ee('0xe')](_0xb0ee('0xf'),_0x5377b4,_0xb0ee('0x11'));_0x586bc9(_0x308603[_0xb0ee('0x15')][_0xb0ee('0x14')]);}})[_0xb0ee('0x16')](function(_0x549e64){logger['error'](_0xb0ee('0xf'),_0x5377b4,_0x549e64);_0x13c198(_0x549e64);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/index.js b/server/api/intFreshdeskAccount/index.js index cbc84d9..2b41035 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 _0x2f14=['/:id/fields','getFields','post','create','put','update','delete','destroy','multer','util','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','./intFreshdeskAccount.controller','isAuthenticated','index','get','/:id','show','/:id/configurations','getConfigurations'];(function(_0x4c7e3f,_0x13a8cb){var _0x3ea783=function(_0x3b4cef){while(--_0x3b4cef){_0x4c7e3f['push'](_0x4c7e3f['shift']());}};_0x3ea783(++_0x13a8cb);}(_0x2f14,0x7b));var _0x42f1=function(_0x1a6f2c,_0x4795ad){_0x1a6f2c=_0x1a6f2c-0x0;var _0x169f57=_0x2f14[_0x1a6f2c];return _0x169f57;};'use strict';var multer=require(_0x42f1('0x0'));var util=require(_0x42f1('0x1'));var path=require(_0x42f1('0x2'));var timeout=require(_0x42f1('0x3'));var express=require('express');var router=express[_0x42f1('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x42f1('0x5'));var config=require(_0x42f1('0x6'));var controller=require(_0x42f1('0x7'));router['get']('/',auth[_0x42f1('0x8')](),controller[_0x42f1('0x9')]);router[_0x42f1('0xa')](_0x42f1('0xb'),auth[_0x42f1('0x8')](),controller[_0x42f1('0xc')]);router[_0x42f1('0xa')](_0x42f1('0xd'),auth[_0x42f1('0x8')](),controller[_0x42f1('0xe')]);router[_0x42f1('0xa')](_0x42f1('0xf'),auth[_0x42f1('0x8')](),controller[_0x42f1('0x10')]);router[_0x42f1('0x11')]('/',auth[_0x42f1('0x8')](),controller[_0x42f1('0x12')]);router[_0x42f1('0x11')](_0x42f1('0xd'),auth[_0x42f1('0x8')](),controller['addConfiguration']);router[_0x42f1('0x13')]('/:id',auth[_0x42f1('0x8')](),controller[_0x42f1('0x14')]);router[_0x42f1('0x15')](_0x42f1('0xb'),auth['isAuthenticated'](),controller[_0x42f1('0x16')]);module['exports']=router; \ No newline at end of file +var _0xf00d=['create','addConfiguration','update','delete','destroy','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./intFreshdeskAccount.controller','get','isAuthenticated','index','/:id','/:id/configurations','getConfigurations','/:id/fields','post'];(function(_0x3fb030,_0x12aebe){var _0xd6899b=function(_0x327646){while(--_0x327646){_0x3fb030['push'](_0x3fb030['shift']());}};_0xd6899b(++_0x12aebe);}(_0xf00d,0x98));var _0xdf00=function(_0x3884b7,_0x37682d){_0x3884b7=_0x3884b7-0x0;var _0x598253=_0xf00d[_0x3884b7];return _0x598253;};'use strict';var multer=require('multer');var util=require(_0xdf00('0x0'));var path=require(_0xdf00('0x1'));var timeout=require(_0xdf00('0x2'));var express=require(_0xdf00('0x3'));var router=express[_0xdf00('0x4')]();var auth=require(_0xdf00('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xdf00('0x6'));var controller=require(_0xdf00('0x7'));router[_0xdf00('0x8')]('/',auth[_0xdf00('0x9')](),controller[_0xdf00('0xa')]);router[_0xdf00('0x8')](_0xdf00('0xb'),auth[_0xdf00('0x9')](),controller['show']);router[_0xdf00('0x8')](_0xdf00('0xc'),auth[_0xdf00('0x9')](),controller[_0xdf00('0xd')]);router['get'](_0xdf00('0xe'),auth[_0xdf00('0x9')](),controller['getFields']);router[_0xdf00('0xf')]('/',auth['isAuthenticated'](),controller[_0xdf00('0x10')]);router['post']('/:id/configurations',auth[_0xdf00('0x9')](),controller[_0xdf00('0x11')]);router['put'](_0xdf00('0xb'),auth['isAuthenticated'](),controller[_0xdf00('0x12')]);router[_0xdf00('0x13')](_0xdf00('0xb'),auth[_0xdf00('0x9')](),controller[_0xdf00('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js index 0819ec2..5fa4046 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 _0x0eeb=['username','remoteUri','sequelize','exports','STRING'];(function(_0x4284e8,_0x20adb8){var _0x4b120c=function(_0x188afc){while(--_0x188afc){_0x4284e8['push'](_0x4284e8['shift']());}};_0x4b120c(++_0x20adb8);}(_0x0eeb,0xc5));var _0xb0ee=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x0eeb[_0x2c91e9];return _0x13f0ff;};'use strict';var Sequelize=require(_0xb0ee('0x0'));module[_0xb0ee('0x1')]={'name':{'type':Sequelize[_0xb0ee('0x2')]},'description':{'type':Sequelize[_0xb0ee('0x2')]},'username':{'type':Sequelize[_0xb0ee('0x2')],'unique':_0xb0ee('0x3')},'apiKey':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize['STRING'],'unique':_0xb0ee('0x4')},'serverUrl':{'type':Sequelize[_0xb0ee('0x2')]}}; \ No newline at end of file +var _0x6f83=['username','remoteUri','exports','STRING'];(function(_0x36f99f,_0x10dfa2){var _0x85cb3b=function(_0x26d6b7){while(--_0x26d6b7){_0x36f99f['push'](_0x36f99f['shift']());}};_0x85cb3b(++_0x10dfa2);}(_0x6f83,0x72));var _0x36f8=function(_0x1ab080,_0x3939f1){_0x1ab080=_0x1ab080-0x0;var _0x21a06f=_0x6f83[_0x1ab080];return _0x21a06f;};'use strict';var Sequelize=require('sequelize');module[_0x36f8('0x0')]={'name':{'type':Sequelize[_0x36f8('0x1')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x36f8('0x1')],'unique':_0x36f8('0x2')},'apiKey':{'type':Sequelize[_0x36f8('0x1')]},'remoteUri':{'type':Sequelize[_0x36f8('0x1')],'unique':_0x36f8('0x3')},'serverUrl':{'type':Sequelize[_0x36f8('0x1')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js index 878ab32..06092c8 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 _0x6878=['includes','default','custom_text','custom_dropdown','label','choices','capitalize','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','path','sox','ejs','crypto','jsforce','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','error','message','info','catch','sendStatus','status','json','count','offset','set','apply','reject','save','update','destroy','end','stack','name','send','index','FreshdeskAccount','rawAttributes','keys','query','attributes','intersection','model','fields','length','hasOwnProperty','nolimit','limit','order','sort','filters','pick','filter','where','map','type','key','field','options','findAll','rows','show','params','include','find','create','body','FreshdeskConfiguration','merge','getConfigurations','addConfiguration','findOne','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','FreshdeskField','getFields','apiKey','slice','substring','lastIndexOf','GET','format','%s/%s','base64','requester','subject','agent','description','priority','group','ticket_type','company','remove'];(function(_0x185610,_0x5f51f9){var _0x5356e4=function(_0x13c26c){while(--_0x13c26c){_0x185610['push'](_0x185610['shift']());}};_0x5356e4(++_0x5f51f9);}(_0x6878,0x185));var _0x8687=function(_0x3cf26a,_0x3baf4b){_0x3cf26a=_0x3cf26a-0x0;var _0x540595=_0x6878[_0x3cf26a];return _0x540595;};'use strict';var pdf=require(_0x8687('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x8687('0x1'));var zipdir=require(_0x8687('0x2'));var jsonpatch=require(_0x8687('0x3'));var rp=require(_0x8687('0x4'));var moment=require(_0x8687('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x8687('0x6'));var sox=require(_0x8687('0x7'));var csv=require('to-csv');var ejs=require(_0x8687('0x8'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x8687('0x9'));var jsforce=require(_0x8687('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x8687('0xb'));var querystring=require('querystring');var Papa=require(_0x8687('0xc'));var Redis=require(_0x8687('0xd'));var authService=require(_0x8687('0xe'));var qs=require(_0x8687('0xf'));var as=require(_0x8687('0x10'));var hardwareService=require(_0x8687('0x11'));var logger=require(_0x8687('0x12'))(_0x8687('0x13'));var utils=require(_0x8687('0x14'));var config=require(_0x8687('0x15'));var db=require(_0x8687('0x16'))['db'];var integrations=require('../../components/integrations/configuration');var jayson=require(_0x8687('0x17'));var client=jayson[_0x8687('0x18')][_0x8687('0x19')]({'port':0x232a});function checkPasswordPattern(_0x4cf578,_0x57b6e5,_0x5f0dc3){if(_0x5f0dc3){var _0x2562c2=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2562c2[_0x8687('0x1a')](_0x57b6e5)){return _0x4cf578;}else{throw new Error(_0x8687('0x1b'));}}else{return _0x4cf578;}}function respondWithRpcPromise(_0x5e2859,_0x37b8ce,_0x17e5d1,_0x5eca4e){return new BPromise(function(_0x5ab942,_0x1ba6d4){var _0x4d5ab3=_0x5eca4e||client;return _0x4d5ab3[_0x8687('0x1c')](_0x5e2859,_0x17e5d1)[_0x8687('0x1d')](function(_0x5ece13){logger['info'](_0x8687('0x1e'),_0x37b8ce,_0x8687('0x1f'));logger[_0x8687('0x20')](_0x8687('0x21'),_0x37b8ce,'request\x20sent',JSON['stringify'](_0x5ece13));if(_0x5ece13[_0x8687('0x22')]){if(_0x5ece13[_0x8687('0x22')]['code']===0x1f4){logger['error'](_0x8687('0x1e'),_0x37b8ce,_0x5ece13[_0x8687('0x22')]['message']);return _0x1ba6d4(_0x5ece13[_0x8687('0x22')][_0x8687('0x23')]);}logger[_0x8687('0x22')](_0x8687('0x1e'),_0x37b8ce,_0x5ece13[_0x8687('0x22')][_0x8687('0x23')]);return _0x5ab942(_0x5ece13[_0x8687('0x22')][_0x8687('0x23')]);}else{logger[_0x8687('0x24')]('FreshdeskAccount,\x20%s,\x20%s',_0x37b8ce,_0x8687('0x1f'));_0x5ab942(_0x5ece13['result'][_0x8687('0x23')]);}})[_0x8687('0x25')](function(_0x1b333e){logger[_0x8687('0x22')]('FreshdeskAccount,\x20%s,\x20%s',_0x37b8ce,_0x1b333e);_0x1ba6d4(_0x1b333e);});});}function respondWithStatusCode(_0x5cd09d,_0x793133){_0x793133=_0x793133||0xcc;return function(_0x4d1e42){if(_0x4d1e42){return _0x5cd09d[_0x8687('0x26')](_0x793133);}return _0x5cd09d[_0x8687('0x27')](_0x793133)['end']();};}function respondWithResult(_0x1d7188,_0x514353){_0x514353=_0x514353||0xc8;return function(_0x45a8e7){if(_0x45a8e7){return _0x1d7188[_0x8687('0x27')](_0x514353)[_0x8687('0x28')](_0x45a8e7);}};}function respondWithFilteredResult(_0x13c667,_0x286b2d){return function(_0x35f1d1){if(_0x35f1d1){var _0x2ff793=_0x35f1d1[_0x8687('0x29')],_0x521626=_0x286b2d[_0x8687('0x2a')],_0x3623ba=_0x286b2d[_0x8687('0x2a')]+_0x286b2d['limit'],_0x2c80bc;if(_0x3623ba>=_0x2ff793){_0x3623ba=_0x2ff793;_0x2c80bc=0xc8;}else{_0x2c80bc=0xce;}_0x13c667['status'](_0x2c80bc);return _0x13c667[_0x8687('0x2b')]('Content-Range',_0x521626+'-'+_0x3623ba+'/'+_0x2ff793)['json'](_0x35f1d1);}return null;};}function patchUpdates(_0x15b08f){return function(_0x787cc3){try{jsonpatch[_0x8687('0x2c')](_0x787cc3,_0x15b08f,!![]);}catch(_0x3545f6){return BPromise[_0x8687('0x2d')](_0x3545f6);}return _0x787cc3[_0x8687('0x2e')]();};}function saveUpdates(_0x52bdfd,_0x2c9be9){return function(_0x46fa41){if(_0x46fa41){return _0x46fa41[_0x8687('0x2f')](_0x52bdfd)['then'](function(_0x54fd3f){return _0x54fd3f;});}return null;};}function removeEntity(_0xc75e8f,_0x3e9573){return function(_0x1f42e1){if(_0x1f42e1){return _0x1f42e1[_0x8687('0x30')]()[_0x8687('0x1d')](function(){_0xc75e8f['status'](0xcc)[_0x8687('0x31')]();});}};}function handleEntityNotFound(_0xcc561a,_0x2f7f2d){return function(_0x9a8123){if(!_0x9a8123){_0xcc561a[_0x8687('0x26')](0x194);}return _0x9a8123;};}function handleError(_0x2d4e16,_0x588c93){_0x588c93=_0x588c93||0x1f4;return function(_0x3bdf2a){logger[_0x8687('0x22')](_0x3bdf2a[_0x8687('0x32')]);if(_0x3bdf2a['name']){delete _0x3bdf2a[_0x8687('0x33')];}_0x2d4e16[_0x8687('0x27')](_0x588c93)[_0x8687('0x34')](_0x3bdf2a);};}exports[_0x8687('0x35')]=function(_0x41f866,_0x22d3da){var _0x2c60c2={},_0x587ddf={},_0x2e1d69={'count':0x0,'rows':[]};var _0x5bff55=db[_0x8687('0x36')][_0x8687('0x37')];_0x587ddf['model']=_[_0x8687('0x38')](_0x5bff55);_0x587ddf[_0x8687('0x39')]=_[_0x8687('0x38')](_0x41f866[_0x8687('0x39')]);_0x587ddf['filters']=_['intersection'](_0x587ddf['model'],_0x587ddf[_0x8687('0x39')]);_0x2c60c2[_0x8687('0x3a')]=_[_0x8687('0x3b')](_0x587ddf[_0x8687('0x3c')],qs[_0x8687('0x3d')](_0x41f866[_0x8687('0x39')][_0x8687('0x3d')]));_0x2c60c2[_0x8687('0x3a')]=_0x2c60c2[_0x8687('0x3a')][_0x8687('0x3e')]?_0x2c60c2[_0x8687('0x3a')]:_0x587ddf['model'];if(!_0x41f866[_0x8687('0x39')][_0x8687('0x3f')](_0x8687('0x40'))){_0x2c60c2[_0x8687('0x41')]=qs['limit'](_0x41f866[_0x8687('0x39')]['limit']);_0x2c60c2['offset']=qs[_0x8687('0x2a')](_0x41f866[_0x8687('0x39')][_0x8687('0x2a')]);}_0x2c60c2[_0x8687('0x42')]=qs['sort'](_0x41f866[_0x8687('0x39')][_0x8687('0x43')]);_0x2c60c2['where']=qs[_0x8687('0x44')](_[_0x8687('0x45')](_0x41f866[_0x8687('0x39')],_0x587ddf['filters']));if(_0x41f866['query'][_0x8687('0x46')]){_0x2c60c2[_0x8687('0x47')]=_['merge'](_0x2c60c2[_0x8687('0x47')],{'$or':_[_0x8687('0x48')](_0x5bff55,function(_0x2b6759){if(_0x2b6759[_0x8687('0x49')][_0x8687('0x4a')]!=='VIRTUAL'){var _0x347148={};_0x347148[_0x2b6759[_0x8687('0x4b')]]={'$like':'%'+_0x41f866['query'][_0x8687('0x46')]+'%'};return _0x347148;}})});}_0x2c60c2=_['merge']({},_0x2c60c2,_0x41f866[_0x8687('0x4c')]);var _0xbdd413={'where':_0x2c60c2[_0x8687('0x47')]};return db['FreshdeskAccount']['count'](_0xbdd413)[_0x8687('0x1d')](function(_0x2681be){_0x2e1d69[_0x8687('0x29')]=_0x2681be;if(_0x41f866[_0x8687('0x39')]['includeAll']){_0x2c60c2['include']=[{'all':!![]}];}return db[_0x8687('0x36')][_0x8687('0x4d')](_0x2c60c2);})[_0x8687('0x1d')](function(_0x22c4fa){_0x2e1d69[_0x8687('0x4e')]=_0x22c4fa;return _0x2e1d69;})[_0x8687('0x1d')](respondWithFilteredResult(_0x22d3da,_0x2c60c2))[_0x8687('0x25')](handleError(_0x22d3da,null));};exports[_0x8687('0x4f')]=function(_0x465462,_0x5904c7){var _0x2cee23={'raw':![],'where':{'id':_0x465462[_0x8687('0x50')]['id']}},_0x32ce22={};_0x32ce22[_0x8687('0x3c')]=_['keys'](db[_0x8687('0x36')][_0x8687('0x37')]);_0x32ce22[_0x8687('0x39')]=_['keys'](_0x465462[_0x8687('0x39')]);_0x32ce22[_0x8687('0x44')]=_[_0x8687('0x3b')](_0x32ce22[_0x8687('0x3c')],_0x32ce22[_0x8687('0x39')]);_0x2cee23['attributes']=_['intersection'](_0x32ce22[_0x8687('0x3c')],qs[_0x8687('0x3d')](_0x465462[_0x8687('0x39')][_0x8687('0x3d')]));_0x2cee23[_0x8687('0x3a')]=_0x2cee23[_0x8687('0x3a')][_0x8687('0x3e')]?_0x2cee23[_0x8687('0x3a')]:_0x32ce22[_0x8687('0x3c')];if(_0x465462[_0x8687('0x39')]['includeAll']){_0x2cee23[_0x8687('0x51')]=[{'all':!![]}];}_0x2cee23=_['merge']({},_0x2cee23,_0x465462['options']);return db['FreshdeskAccount'][_0x8687('0x52')](_0x2cee23)[_0x8687('0x1d')](handleEntityNotFound(_0x5904c7,null))[_0x8687('0x1d')](respondWithResult(_0x5904c7,null))[_0x8687('0x25')](handleError(_0x5904c7,null));};exports['create']=function(_0x2b6341,_0x40a522){return db[_0x8687('0x36')][_0x8687('0x53')](_0x2b6341['body'],{})[_0x8687('0x1d')](respondWithResult(_0x40a522,0xc9))[_0x8687('0x25')](handleError(_0x40a522,null));};exports[_0x8687('0x2f')]=function(_0x142391,_0x7bb4dc){if(_0x142391[_0x8687('0x54')]['id']){delete _0x142391[_0x8687('0x54')]['id'];}return db['FreshdeskAccount'][_0x8687('0x52')]({'where':{'id':_0x142391['params']['id']}})[_0x8687('0x1d')](handleEntityNotFound(_0x7bb4dc,null))['then'](saveUpdates(_0x142391['body'],null))['then'](respondWithResult(_0x7bb4dc,null))[_0x8687('0x25')](handleError(_0x7bb4dc,null));};exports[_0x8687('0x30')]=function(_0x152a0b,_0x4773df){return db[_0x8687('0x36')]['find']({'where':{'id':_0x152a0b['params']['id']}})[_0x8687('0x1d')](handleEntityNotFound(_0x4773df,null))[_0x8687('0x1d')](removeEntity(_0x4773df,null))['catch'](handleError(_0x4773df,null));};exports['getConfigurations']=function(_0x52ce92,_0x16ff0b,_0x2be1ff){var _0x598fa3={};var _0x5d5b15={};var _0x1d0886;var _0x4106f5;return db[_0x8687('0x36')]['findOne']({'where':{'id':_0x52ce92[_0x8687('0x50')]['id']}})[_0x8687('0x1d')](handleEntityNotFound(_0x16ff0b,null))[_0x8687('0x1d')](function(_0x5f1e0a){if(_0x5f1e0a){_0x1d0886=_0x5f1e0a;_0x5d5b15[_0x8687('0x3c')]=_[_0x8687('0x38')](db[_0x8687('0x55')][_0x8687('0x37')]);_0x5d5b15[_0x8687('0x39')]=_[_0x8687('0x38')](_0x52ce92[_0x8687('0x39')]);_0x5d5b15[_0x8687('0x44')]=_[_0x8687('0x3b')](_0x5d5b15[_0x8687('0x3c')],_0x5d5b15['query']);_0x598fa3[_0x8687('0x3a')]=_[_0x8687('0x3b')](_0x5d5b15[_0x8687('0x3c')],qs[_0x8687('0x3d')](_0x52ce92[_0x8687('0x39')][_0x8687('0x3d')]));_0x598fa3[_0x8687('0x3a')]=_0x598fa3[_0x8687('0x3a')][_0x8687('0x3e')]?_0x598fa3[_0x8687('0x3a')]:_0x5d5b15[_0x8687('0x3c')];_0x598fa3[_0x8687('0x42')]=qs[_0x8687('0x43')](_0x52ce92[_0x8687('0x39')]['sort']);_0x598fa3[_0x8687('0x47')]=qs[_0x8687('0x44')](_[_0x8687('0x45')](_0x52ce92[_0x8687('0x39')],_0x5d5b15[_0x8687('0x44')]));if(_0x52ce92[_0x8687('0x39')]['filter']){_0x598fa3['where']=_[_0x8687('0x56')](_0x598fa3[_0x8687('0x47')],{'$or':_[_0x8687('0x48')](_0x598fa3[_0x8687('0x3a')],function(_0x3650bd){var _0x4488d0={};_0x4488d0[_0x3650bd]={'$like':'%'+_0x52ce92['query'][_0x8687('0x46')]+'%'};return _0x4488d0;})});}_0x598fa3=_['merge']({},_0x598fa3,_0x52ce92[_0x8687('0x4c')]);return _0x1d0886['getConfigurations'](_0x598fa3);}})['then'](function(_0x3d7be7){if(_0x3d7be7){_0x4106f5=_0x3d7be7['length'];if(!_0x52ce92[_0x8687('0x39')][_0x8687('0x3f')](_0x8687('0x40'))){_0x598fa3['limit']=qs['limit'](_0x52ce92[_0x8687('0x39')][_0x8687('0x41')]);_0x598fa3['offset']=qs['offset'](_0x52ce92[_0x8687('0x39')]['offset']);}return _0x1d0886[_0x8687('0x57')](_0x598fa3);}})[_0x8687('0x1d')](function(_0x498108){if(_0x498108){return _0x498108?{'count':_0x4106f5,'rows':_0x498108}:null;}})[_0x8687('0x1d')](respondWithResult(_0x16ff0b,null))[_0x8687('0x25')](handleError(_0x16ff0b,null));};exports[_0x8687('0x58')]=function(_0x5b170e,_0x1f8302,_0x1d9921){if(_0x5b170e[_0x8687('0x54')]['id']){delete _0x5b170e[_0x8687('0x54')]['id'];}return db[_0x8687('0x36')][_0x8687('0x59')]({'where':{'id':_0x5b170e['params']['id']}})['then'](handleEntityNotFound(_0x1f8302,null))['then'](function(_0x26cc7e){if(_0x26cc7e){_0x5b170e[_0x8687('0x54')][_0x8687('0x5a')]=_0x26cc7e['id'];_0x5b170e['body'][_0x8687('0x5b')]=integrations[_0x8687('0x5c')](_0x5b170e[_0x8687('0x54')][_0x8687('0x5d')],_0x5b170e['body'][_0x8687('0x49')]);_0x5b170e[_0x8687('0x54')][_0x8687('0x5e')]=integrations[_0x8687('0x5f')](_0x5b170e['body'][_0x8687('0x5d')],_0x5b170e[_0x8687('0x54')]['type']);return db[_0x8687('0x55')][_0x8687('0x53')](_0x5b170e[_0x8687('0x54')],{'include':[{'model':db['FreshdeskField'],'as':'Subjects'},{'model':db[_0x8687('0x60')],'as':_0x8687('0x5e')}]});}return null;})[_0x8687('0x1d')](respondWithResult(_0x1f8302,null))[_0x8687('0x25')](handleError(_0x1f8302,null));};exports[_0x8687('0x61')]=function(_0x1671db,_0x2a9e40,_0x43a154){var _0xb37b63='';return db['FreshdeskAccount']['findOne']({'where':{'id':_0x1671db[_0x8687('0x50')]['id']},'attributes':['id','remoteUri',_0x8687('0x62')]})['then'](handleEntityNotFound(_0x2a9e40,null))[_0x8687('0x1d')](function(_0x54d58f){if(_0x54d58f){_0xb37b63=_0x54d58f['remoteUri'];var _0x487d6b=_0xb37b63[_0x8687('0x63')](-0x1);if(_0x487d6b==='/'){_0xb37b63=_0xb37b63[_0x8687('0x64')](0x0,_0xb37b63[_0x8687('0x65')](_0x487d6b));}return rp({'method':_0x8687('0x66'),'uri':util[_0x8687('0x67')](_0x8687('0x68'),_0xb37b63,'api/v2/ticket_fields'),'headers':{'Authorization':util[_0x8687('0x67')]('Basic\x20%s',new Buffer(util[_0x8687('0x67')]('%s:X',_0x54d58f[_0x8687('0x62')]))['toString'](_0x8687('0x69')))},'json':!![]});}})[_0x8687('0x1d')](function(_0x176b4b){if(_0x176b4b){var _0x114b25=[_0x8687('0x6a'),_0x8687('0x6b'),_0x8687('0x6c'),_0x8687('0x6d'),'status',_0x8687('0x6e'),_0x8687('0x6f'),'source',_0x8687('0x70'),_0x8687('0x6f'),_0x8687('0x71')];_[_0x8687('0x72')](_0x176b4b,function(_0x478158){return _0x114b25[_0x8687('0x73')](_0x478158[_0x8687('0x33')])||!_0x478158[_0x8687('0x74')]&&_0x478158[_0x8687('0x49')]!==_0x8687('0x75')&&_0x478158[_0x8687('0x49')]!==_0x8687('0x76');});return{'count':_0x176b4b['length'],'rows':_[_0x8687('0x48')](_0x176b4b,function(_0x8c419){return{'id':_0x8c419['name'],'name':_0x8c419[_0x8687('0x77')],'custom':!_0x8c419[_0x8687('0x74')],'options':_0x8c419[_0x8687('0x78')]?_[_0x8687('0x48')](_0x8c419['choices'],function(_0x466f22){return{'name':_[_0x8687('0x79')](_0x466f22),'value':_0x466f22};}):[]};})};}})[_0x8687('0x1d')](respondWithResult(_0x2a9e40,null))[_0x8687('0x25')](function(_0x35042f){var _0x46f430=_0x1671db[_0x8687('0x39')][_0x8687('0x1a')]?0x1f4:_0x35042f[_0x8687('0x7a')]||0x1f4;logger['error'](_0x8687('0x7b'),'getFields',_0x46f430,JSON[_0x8687('0x7c')](_0x35042f));delete _0x35042f[_0x8687('0x33')];if(_0x46f430===0x191){_0x46f430=0x190;}_0x2a9e40[_0x8687('0x27')](_0x46f430)[_0x8687('0x34')](_0x1671db['query'][_0x8687('0x1a')]?{'message':_0x8687('0x7d'),'statusCode':_0x35042f['statusCode']}:_0x35042f);});}; \ No newline at end of file +var _0x398a=['../../config/license/hardware','../../config/environment','../../mysqldb','../../components/integrations/configuration','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','status','end','json','offset','set','apply','reject','update','destroy','stack','index','FreshdeskAccount','rawAttributes','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','limit','order','sort','where','filter','merge','map','key','VIRTUAL','field','options','count','findAll','rows','params','include','find','create','body','getConfigurations','findOne','FreshdeskConfiguration','pick','addConfiguration','AccountId','getSubjects','channel','type','FreshdeskField','Subjects','Descriptions','remoteUri','apiKey','slice','substring','lastIndexOf','format','%s/%s','api/v2/ticket_fields','Basic\x20%s','%s:X','toString','base64','requester','agent','description','priority','group','source','remove','includes','name','default','custom_text','custom_dropdown','label','choices','statusCode','getFields','send','html-pdf','eml-format','zip-dir','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x5b561d,_0x422b7c){var _0x431060=function(_0x401409){while(--_0x401409){_0x5b561d['push'](_0x5b561d['shift']());}};_0x431060(++_0x422b7c);}(_0x398a,0xe0));var _0xa398=function(_0xaf28c0,_0x43be43){_0xaf28c0=_0xaf28c0-0x0;var _0x4e0ea8=_0x398a[_0xaf28c0];return _0x4e0ea8;};'use strict';var pdf=require(_0xa398('0x0'));var emlformat=require(_0xa398('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xa398('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xa398('0x3'));var BPromise=require(_0xa398('0x4'));var Mustache=require(_0xa398('0x5'));var util=require(_0xa398('0x6'));var path=require(_0xa398('0x7'));var sox=require('sox');var csv=require(_0xa398('0x8'));var ejs=require(_0xa398('0x9'));var fs=require('fs');var _=require(_0xa398('0xa'));var squel=require(_0xa398('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xa398('0xc'));var toCsv=require(_0xa398('0x8'));var querystring=require(_0xa398('0xd'));var Papa=require(_0xa398('0xe'));var Redis=require(_0xa398('0xf'));var authService=require(_0xa398('0x10'));var qs=require(_0xa398('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa398('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xa398('0x13'));var db=require(_0xa398('0x14'))['db'];var integrations=require(_0xa398('0x15'));var jayson=require('jayson/promise');var client=jayson[_0xa398('0x16')][_0xa398('0x17')]({'port':0x232a});function checkPasswordPattern(_0x564594,_0xc0408f,_0x35337b){if(_0x35337b){var _0x50a055=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x50a055[_0xa398('0x18')](_0xc0408f)){return _0x564594;}else{throw new Error(_0xa398('0x19'));}}else{return _0x564594;}}function respondWithRpcPromise(_0x3f6cfa,_0x15cb6e,_0x26e400,_0x2d4f48){return new BPromise(function(_0x45ad8f,_0x3823a4){var _0x10c560=_0x2d4f48||client;return _0x10c560[_0xa398('0x1a')](_0x3f6cfa,_0x26e400)[_0xa398('0x1b')](function(_0x55ca45){logger[_0xa398('0x1c')](_0xa398('0x1d'),_0x15cb6e,_0xa398('0x1e'));logger[_0xa398('0x1f')](_0xa398('0x20'),_0x15cb6e,'request\x20sent',JSON[_0xa398('0x21')](_0x55ca45));if(_0x55ca45[_0xa398('0x22')]){if(_0x55ca45[_0xa398('0x22')]['code']===0x1f4){logger[_0xa398('0x22')](_0xa398('0x1d'),_0x15cb6e,_0x55ca45[_0xa398('0x22')][_0xa398('0x23')]);return _0x3823a4(_0x55ca45[_0xa398('0x22')]['message']);}logger[_0xa398('0x22')](_0xa398('0x1d'),_0x15cb6e,_0x55ca45['error']['message']);return _0x45ad8f(_0x55ca45[_0xa398('0x22')][_0xa398('0x23')]);}else{logger[_0xa398('0x1c')](_0xa398('0x1d'),_0x15cb6e,_0xa398('0x1e'));_0x45ad8f(_0x55ca45[_0xa398('0x24')][_0xa398('0x23')]);}})[_0xa398('0x25')](function(_0x59474a){logger[_0xa398('0x22')](_0xa398('0x1d'),_0x15cb6e,_0x59474a);_0x3823a4(_0x59474a);});});}function respondWithStatusCode(_0x1da6eb,_0x1ac09d){_0x1ac09d=_0x1ac09d||0xcc;return function(_0x2ade1b){if(_0x2ade1b){return _0x1da6eb[_0xa398('0x26')](_0x1ac09d);}return _0x1da6eb[_0xa398('0x27')](_0x1ac09d)[_0xa398('0x28')]();};}function respondWithResult(_0x49d2e7,_0x124d17){_0x124d17=_0x124d17||0xc8;return function(_0xe9b29a){if(_0xe9b29a){return _0x49d2e7[_0xa398('0x27')](_0x124d17)[_0xa398('0x29')](_0xe9b29a);}};}function respondWithFilteredResult(_0x3c9c31,_0xd1ee95){return function(_0x2b6587){if(_0x2b6587){var _0x2217ae=_0x2b6587['count'],_0x513e9e=_0xd1ee95[_0xa398('0x2a')],_0x32e247=_0xd1ee95[_0xa398('0x2a')]+_0xd1ee95['limit'],_0x3b73a3;if(_0x32e247>=_0x2217ae){_0x32e247=_0x2217ae;_0x3b73a3=0xc8;}else{_0x3b73a3=0xce;}_0x3c9c31[_0xa398('0x27')](_0x3b73a3);return _0x3c9c31[_0xa398('0x2b')]('Content-Range',_0x513e9e+'-'+_0x32e247+'/'+_0x2217ae)[_0xa398('0x29')](_0x2b6587);}return null;};}function patchUpdates(_0x3b7d94){return function(_0x22acdd){try{jsonpatch[_0xa398('0x2c')](_0x22acdd,_0x3b7d94,!![]);}catch(_0x36d996){return BPromise[_0xa398('0x2d')](_0x36d996);}return _0x22acdd['save']();};}function saveUpdates(_0x4431c8,_0x6420d){return function(_0x5de411){if(_0x5de411){return _0x5de411[_0xa398('0x2e')](_0x4431c8)[_0xa398('0x1b')](function(_0x3b56b1){return _0x3b56b1;});}return null;};}function removeEntity(_0x2641d6,_0xde93e7){return function(_0x31c46a){if(_0x31c46a){return _0x31c46a[_0xa398('0x2f')]()[_0xa398('0x1b')](function(){_0x2641d6['status'](0xcc)[_0xa398('0x28')]();});}};}function handleEntityNotFound(_0x328e3d,_0xd053c){return function(_0x160414){if(!_0x160414){_0x328e3d['sendStatus'](0x194);}return _0x160414;};}function handleError(_0xe2556c,_0x35e951){_0x35e951=_0x35e951||0x1f4;return function(_0x2f43f7){logger[_0xa398('0x22')](_0x2f43f7[_0xa398('0x30')]);if(_0x2f43f7['name']){delete _0x2f43f7['name'];}_0xe2556c[_0xa398('0x27')](_0x35e951)['send'](_0x2f43f7);};}exports[_0xa398('0x31')]=function(_0x16df4d,_0x57d9c1){var _0xc64f4b={},_0x385959={},_0x3134ba={'count':0x0,'rows':[]};var _0x1401f2=db[_0xa398('0x32')][_0xa398('0x33')];_0x385959[_0xa398('0x34')]=_['keys'](_0x1401f2);_0x385959[_0xa398('0x35')]=_[_0xa398('0x36')](_0x16df4d[_0xa398('0x35')]);_0x385959[_0xa398('0x37')]=_[_0xa398('0x38')](_0x385959[_0xa398('0x34')],_0x385959[_0xa398('0x35')]);_0xc64f4b[_0xa398('0x39')]=_['intersection'](_0x385959[_0xa398('0x34')],qs[_0xa398('0x3a')](_0x16df4d[_0xa398('0x35')][_0xa398('0x3a')]));_0xc64f4b[_0xa398('0x39')]=_0xc64f4b[_0xa398('0x39')][_0xa398('0x3b')]?_0xc64f4b[_0xa398('0x39')]:_0x385959[_0xa398('0x34')];if(!_0x16df4d[_0xa398('0x35')][_0xa398('0x3c')]('nolimit')){_0xc64f4b[_0xa398('0x3d')]=qs[_0xa398('0x3d')](_0x16df4d[_0xa398('0x35')]['limit']);_0xc64f4b[_0xa398('0x2a')]=qs[_0xa398('0x2a')](_0x16df4d[_0xa398('0x35')][_0xa398('0x2a')]);}_0xc64f4b[_0xa398('0x3e')]=qs[_0xa398('0x3f')](_0x16df4d[_0xa398('0x35')]['sort']);_0xc64f4b[_0xa398('0x40')]=qs[_0xa398('0x37')](_['pick'](_0x16df4d['query'],_0x385959['filters']));if(_0x16df4d[_0xa398('0x35')][_0xa398('0x41')]){_0xc64f4b[_0xa398('0x40')]=_[_0xa398('0x42')](_0xc64f4b[_0xa398('0x40')],{'$or':_[_0xa398('0x43')](_0x1401f2,function(_0x3cc3f1){if(_0x3cc3f1['type'][_0xa398('0x44')]!==_0xa398('0x45')){var _0x48b2cf={};_0x48b2cf[_0x3cc3f1[_0xa398('0x46')]]={'$like':'%'+_0x16df4d[_0xa398('0x35')][_0xa398('0x41')]+'%'};return _0x48b2cf;}})});}_0xc64f4b=_['merge']({},_0xc64f4b,_0x16df4d[_0xa398('0x47')]);var _0xf63d92={'where':_0xc64f4b['where']};return db[_0xa398('0x32')][_0xa398('0x48')](_0xf63d92)[_0xa398('0x1b')](function(_0x18dcad){_0x3134ba['count']=_0x18dcad;if(_0x16df4d[_0xa398('0x35')]['includeAll']){_0xc64f4b['include']=[{'all':!![]}];}return db[_0xa398('0x32')][_0xa398('0x49')](_0xc64f4b);})[_0xa398('0x1b')](function(_0x52c556){_0x3134ba[_0xa398('0x4a')]=_0x52c556;return _0x3134ba;})[_0xa398('0x1b')](respondWithFilteredResult(_0x57d9c1,_0xc64f4b))[_0xa398('0x25')](handleError(_0x57d9c1,null));};exports['show']=function(_0x3ad5d4,_0x76005b){var _0x417087={'raw':![],'where':{'id':_0x3ad5d4[_0xa398('0x4b')]['id']}},_0x5c2592={};_0x5c2592[_0xa398('0x34')]=_['keys'](db[_0xa398('0x32')]['rawAttributes']);_0x5c2592['query']=_[_0xa398('0x36')](_0x3ad5d4[_0xa398('0x35')]);_0x5c2592[_0xa398('0x37')]=_['intersection'](_0x5c2592[_0xa398('0x34')],_0x5c2592[_0xa398('0x35')]);_0x417087['attributes']=_[_0xa398('0x38')](_0x5c2592[_0xa398('0x34')],qs[_0xa398('0x3a')](_0x3ad5d4[_0xa398('0x35')][_0xa398('0x3a')]));_0x417087[_0xa398('0x39')]=_0x417087['attributes'][_0xa398('0x3b')]?_0x417087[_0xa398('0x39')]:_0x5c2592[_0xa398('0x34')];if(_0x3ad5d4[_0xa398('0x35')]['includeAll']){_0x417087[_0xa398('0x4c')]=[{'all':!![]}];}_0x417087=_[_0xa398('0x42')]({},_0x417087,_0x3ad5d4[_0xa398('0x47')]);return db['FreshdeskAccount'][_0xa398('0x4d')](_0x417087)[_0xa398('0x1b')](handleEntityNotFound(_0x76005b,null))[_0xa398('0x1b')](respondWithResult(_0x76005b,null))[_0xa398('0x25')](handleError(_0x76005b,null));};exports[_0xa398('0x4e')]=function(_0x264242,_0x26b8a8){return db[_0xa398('0x32')][_0xa398('0x4e')](_0x264242[_0xa398('0x4f')],{})['then'](respondWithResult(_0x26b8a8,0xc9))[_0xa398('0x25')](handleError(_0x26b8a8,null));};exports[_0xa398('0x2e')]=function(_0x31584f,_0x2f21cc){if(_0x31584f['body']['id']){delete _0x31584f[_0xa398('0x4f')]['id'];}return db[_0xa398('0x32')][_0xa398('0x4d')]({'where':{'id':_0x31584f[_0xa398('0x4b')]['id']}})[_0xa398('0x1b')](handleEntityNotFound(_0x2f21cc,null))[_0xa398('0x1b')](saveUpdates(_0x31584f['body'],null))['then'](respondWithResult(_0x2f21cc,null))[_0xa398('0x25')](handleError(_0x2f21cc,null));};exports[_0xa398('0x2f')]=function(_0x644273,_0x4f1968){return db[_0xa398('0x32')][_0xa398('0x4d')]({'where':{'id':_0x644273['params']['id']}})[_0xa398('0x1b')](handleEntityNotFound(_0x4f1968,null))[_0xa398('0x1b')](removeEntity(_0x4f1968,null))[_0xa398('0x25')](handleError(_0x4f1968,null));};exports[_0xa398('0x50')]=function(_0x5a579d,_0x13c3b1,_0x18c9c8){var _0x2c957e={};var _0x4a55dd={};var _0x3ea821;var _0x41d0f5;return db[_0xa398('0x32')][_0xa398('0x51')]({'where':{'id':_0x5a579d[_0xa398('0x4b')]['id']}})[_0xa398('0x1b')](handleEntityNotFound(_0x13c3b1,null))[_0xa398('0x1b')](function(_0x5654a6){if(_0x5654a6){_0x3ea821=_0x5654a6;_0x4a55dd[_0xa398('0x34')]=_['keys'](db[_0xa398('0x52')][_0xa398('0x33')]);_0x4a55dd['query']=_['keys'](_0x5a579d[_0xa398('0x35')]);_0x4a55dd[_0xa398('0x37')]=_[_0xa398('0x38')](_0x4a55dd[_0xa398('0x34')],_0x4a55dd[_0xa398('0x35')]);_0x2c957e[_0xa398('0x39')]=_['intersection'](_0x4a55dd['model'],qs[_0xa398('0x3a')](_0x5a579d[_0xa398('0x35')][_0xa398('0x3a')]));_0x2c957e['attributes']=_0x2c957e['attributes'][_0xa398('0x3b')]?_0x2c957e[_0xa398('0x39')]:_0x4a55dd[_0xa398('0x34')];_0x2c957e[_0xa398('0x3e')]=qs[_0xa398('0x3f')](_0x5a579d['query'][_0xa398('0x3f')]);_0x2c957e[_0xa398('0x40')]=qs[_0xa398('0x37')](_[_0xa398('0x53')](_0x5a579d[_0xa398('0x35')],_0x4a55dd['filters']));if(_0x5a579d['query'][_0xa398('0x41')]){_0x2c957e['where']=_[_0xa398('0x42')](_0x2c957e[_0xa398('0x40')],{'$or':_['map'](_0x2c957e[_0xa398('0x39')],function(_0x490546){var _0x32d138={};_0x32d138[_0x490546]={'$like':'%'+_0x5a579d['query']['filter']+'%'};return _0x32d138;})});}_0x2c957e=_[_0xa398('0x42')]({},_0x2c957e,_0x5a579d[_0xa398('0x47')]);return _0x3ea821[_0xa398('0x50')](_0x2c957e);}})['then'](function(_0x30e95b){if(_0x30e95b){_0x41d0f5=_0x30e95b['length'];if(!_0x5a579d[_0xa398('0x35')][_0xa398('0x3c')]('nolimit')){_0x2c957e[_0xa398('0x3d')]=qs[_0xa398('0x3d')](_0x5a579d[_0xa398('0x35')][_0xa398('0x3d')]);_0x2c957e[_0xa398('0x2a')]=qs[_0xa398('0x2a')](_0x5a579d['query'][_0xa398('0x2a')]);}return _0x3ea821['getConfigurations'](_0x2c957e);}})['then'](function(_0x270e67){if(_0x270e67){return _0x270e67?{'count':_0x41d0f5,'rows':_0x270e67}:null;}})[_0xa398('0x1b')](respondWithResult(_0x13c3b1,null))['catch'](handleError(_0x13c3b1,null));};exports[_0xa398('0x54')]=function(_0x296371,_0x1eff0d,_0x5c4ad1){if(_0x296371[_0xa398('0x4f')]['id']){delete _0x296371[_0xa398('0x4f')]['id'];}return db[_0xa398('0x32')][_0xa398('0x51')]({'where':{'id':_0x296371[_0xa398('0x4b')]['id']}})[_0xa398('0x1b')](handleEntityNotFound(_0x1eff0d,null))[_0xa398('0x1b')](function(_0x3c8bfa){if(_0x3c8bfa){_0x296371[_0xa398('0x4f')][_0xa398('0x55')]=_0x3c8bfa['id'];_0x296371[_0xa398('0x4f')]['Subjects']=integrations[_0xa398('0x56')](_0x296371[_0xa398('0x4f')][_0xa398('0x57')],_0x296371['body']['type']);_0x296371[_0xa398('0x4f')]['Descriptions']=integrations['getDescriptions'](_0x296371['body'][_0xa398('0x57')],_0x296371['body'][_0xa398('0x58')]);return db['FreshdeskConfiguration'][_0xa398('0x4e')](_0x296371[_0xa398('0x4f')],{'include':[{'model':db[_0xa398('0x59')],'as':_0xa398('0x5a')},{'model':db[_0xa398('0x59')],'as':_0xa398('0x5b')}]});}return null;})[_0xa398('0x1b')](respondWithResult(_0x1eff0d,null))[_0xa398('0x25')](handleError(_0x1eff0d,null));};exports['getFields']=function(_0x5a8f97,_0x533900,_0x204d50){var _0x524025='';return db[_0xa398('0x32')][_0xa398('0x51')]({'where':{'id':_0x5a8f97[_0xa398('0x4b')]['id']},'attributes':['id',_0xa398('0x5c'),_0xa398('0x5d')]})[_0xa398('0x1b')](handleEntityNotFound(_0x533900,null))[_0xa398('0x1b')](function(_0x1bb86c){if(_0x1bb86c){_0x524025=_0x1bb86c[_0xa398('0x5c')];var _0x317e00=_0x524025[_0xa398('0x5e')](-0x1);if(_0x317e00==='/'){_0x524025=_0x524025[_0xa398('0x5f')](0x0,_0x524025[_0xa398('0x60')](_0x317e00));}return rp({'method':'GET','uri':util[_0xa398('0x61')](_0xa398('0x62'),_0x524025,_0xa398('0x63')),'headers':{'Authorization':util[_0xa398('0x61')](_0xa398('0x64'),new Buffer(util[_0xa398('0x61')](_0xa398('0x65'),_0x1bb86c[_0xa398('0x5d')]))[_0xa398('0x66')](_0xa398('0x67')))},'json':!![]});}})[_0xa398('0x1b')](function(_0x31b33f){if(_0x31b33f){var _0x130d6c=[_0xa398('0x68'),'subject',_0xa398('0x69'),_0xa398('0x6a'),_0xa398('0x27'),_0xa398('0x6b'),_0xa398('0x6c'),_0xa398('0x6d'),'ticket_type','group','company'];_[_0xa398('0x6e')](_0x31b33f,function(_0x1638d7){return _0x130d6c[_0xa398('0x6f')](_0x1638d7[_0xa398('0x70')])||!_0x1638d7[_0xa398('0x71')]&&_0x1638d7[_0xa398('0x58')]!==_0xa398('0x72')&&_0x1638d7[_0xa398('0x58')]!==_0xa398('0x73');});return{'count':_0x31b33f[_0xa398('0x3b')],'rows':_[_0xa398('0x43')](_0x31b33f,function(_0xd80f74){return{'id':_0xd80f74[_0xa398('0x70')],'name':_0xd80f74[_0xa398('0x74')],'custom':!_0xd80f74['default'],'options':_0xd80f74[_0xa398('0x75')]?_[_0xa398('0x43')](_0xd80f74['choices'],function(_0x526700){return{'name':_['capitalize'](_0x526700),'value':_0x526700};}):[]};})};}})['then'](respondWithResult(_0x533900,null))[_0xa398('0x25')](function(_0x12adc4){var _0x12ab0d=_0x5a8f97['query'][_0xa398('0x18')]?0x1f4:_0x12adc4[_0xa398('0x76')]||0x1f4;logger[_0xa398('0x22')]('getFields,\x20%s,\x20%s,\x20%s',_0xa398('0x77'),_0x12ab0d,JSON['stringify'](_0x12adc4));delete _0x12adc4[_0xa398('0x70')];if(_0x12ab0d===0x191){_0x12ab0d=0x190;}_0x533900[_0xa398('0x27')](_0x12ab0d)[_0xa398('0x78')](_0x5a8f97[_0xa398('0x35')]['test']?{'message':'Wrong\x20credentials','statusCode':_0x12adc4['statusCode']}:_0x12adc4);});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js index 6652310..71f9876 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 _0xc101=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshdeskAccount.attributes','../../components/integrations/configuration','exports','define','FreshdeskAccount','lodash','util','../../config/logger','api'];(function(_0x1ab160,_0x50b631){var _0x44debe=function(_0x50b1b4){while(--_0x50b1b4){_0x1ab160['push'](_0x1ab160['shift']());}};_0x44debe(++_0x50b631);}(_0xc101,0x83));var _0x1c10=function(_0x46c1d5,_0x5ca335){_0x46c1d5=_0x46c1d5-0x0;var _0x40fe7b=_0xc101[_0x46c1d5];return _0x40fe7b;};'use strict';var _=require(_0x1c10('0x0'));var util=require(_0x1c10('0x1'));var logger=require(_0x1c10('0x2'))(_0x1c10('0x3'));var moment=require(_0x1c10('0x4'));var BPromise=require(_0x1c10('0x5'));var rp=require(_0x1c10('0x6'));var fs=require('fs');var path=require(_0x1c10('0x7'));var rimraf=require(_0x1c10('0x8'));var config=require(_0x1c10('0x9'));var attributes=require(_0x1c10('0xa'));var integrations=require(_0x1c10('0xb'));module[_0x1c10('0xc')]=function(_0x4f7873,_0x4801a0){return _0x4f7873[_0x1c10('0xd')](_0x1c10('0xe'),attributes,{'tableName':'int_freshdesk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6991=['../../components/integrations/configuration','define','FreshdeskAccount','int_freshdesk_accounts','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshdeskAccount.attributes'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0x6991,0x19a));var _0x1699=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x6991[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require(_0x1699('0x0'));var util=require(_0x1699('0x1'));var logger=require('../../config/logger')(_0x1699('0x2'));var moment=require(_0x1699('0x3'));var BPromise=require(_0x1699('0x4'));var rp=require(_0x1699('0x5'));var fs=require('fs');var path=require(_0x1699('0x6'));var rimraf=require(_0x1699('0x7'));var config=require(_0x1699('0x8'));var attributes=require(_0x1699('0x9'));var integrations=require(_0x1699('0xa'));module['exports']=function(_0xcb21a0,_0x4e7c37){return _0xcb21a0[_0x1699('0xb')](_0x1699('0xc'),attributes,{'tableName':_0x1699('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.rpc.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.rpc.js index 6b43828..44e1f9b 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 _0xe5e3=['attributes','model','catch','ShowFreshdeskAccount','find','debug','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','GetFreshdeskAccount','FreshdeskAccount','findAll','options','raw','where','limit','include','map'];(function(_0x4dd8cd,_0x486a8c){var _0x2cd2e4=function(_0x3dfe8a){while(--_0x3dfe8a){_0x4dd8cd['push'](_0x4dd8cd['shift']());}};_0x2cd2e4(++_0x486a8c);}(_0xe5e3,0x96));var _0x3e5e=function(_0x305830,_0x4b31ac){_0x305830=_0x305830-0x0;var _0xcfaccb=_0xe5e3[_0x305830];return _0xcfaccb;};'use strict';var _=require(_0x3e5e('0x0'));var util=require(_0x3e5e('0x1'));var moment=require(_0x3e5e('0x2'));var BPromise=require(_0x3e5e('0x3'));var rs=require(_0x3e5e('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3e5e('0x5'))['db'];var utils=require(_0x3e5e('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x3e5e('0x7'));var jayson=require(_0x3e5e('0x8'));var client=jayson[_0x3e5e('0x9')][_0x3e5e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x47b995,_0x1a8546,_0x75bb00){return new BPromise(function(_0x4d046c,_0x513754){return client[_0x3e5e('0xb')](_0x47b995,_0x75bb00)[_0x3e5e('0xc')](function(_0x51a51a){logger['info'](_0x3e5e('0xd'),_0x1a8546,_0x3e5e('0xe'));logger['debug']('FreshdeskAccount,\x20%s,\x20%s,\x20%s',_0x1a8546,'request\x20sent',JSON[_0x3e5e('0xf')](_0x51a51a));if(_0x51a51a['error']){if(_0x51a51a[_0x3e5e('0x10')][_0x3e5e('0x11')]===0x1f4){logger['error'](_0x3e5e('0xd'),_0x1a8546,_0x51a51a[_0x3e5e('0x10')][_0x3e5e('0x12')]);return _0x513754(_0x51a51a[_0x3e5e('0x10')][_0x3e5e('0x12')]);}logger[_0x3e5e('0x10')](_0x3e5e('0xd'),_0x1a8546,_0x51a51a[_0x3e5e('0x10')]['message']);return _0x4d046c(_0x51a51a[_0x3e5e('0x10')][_0x3e5e('0x12')]);}else{logger[_0x3e5e('0x13')](_0x3e5e('0xd'),_0x1a8546,_0x3e5e('0xe'));_0x4d046c(_0x51a51a[_0x3e5e('0x14')][_0x3e5e('0x12')]);}})['catch'](function(_0x19b43e){logger[_0x3e5e('0x10')](_0x3e5e('0xd'),_0x1a8546,_0x19b43e);_0x513754(_0x19b43e);});});}exports[_0x3e5e('0x15')]=function(_0x17b22b){var _0x123978=this;return new Promise(function(_0x581606,_0x433556){return db[_0x3e5e('0x16')][_0x3e5e('0x17')]({'raw':_0x17b22b[_0x3e5e('0x18')]?_0x17b22b[_0x3e5e('0x18')][_0x3e5e('0x19')]===undefined?!![]:![]:!![],'where':_0x17b22b['options']?_0x17b22b[_0x3e5e('0x18')][_0x3e5e('0x1a')]||null:null,'attributes':_0x17b22b['options']?_0x17b22b['options']['attributes']||null:null,'limit':_0x17b22b[_0x3e5e('0x18')]?_0x17b22b[_0x3e5e('0x18')][_0x3e5e('0x1b')]||null:null,'include':_0x17b22b[_0x3e5e('0x18')]?_0x17b22b['options'][_0x3e5e('0x1c')]?_[_0x3e5e('0x1d')](_0x17b22b[_0x3e5e('0x18')][_0x3e5e('0x1c')],function(_0x2093dd){return{'model':db[_0x2093dd['model']],'as':_0x2093dd['as'],'attributes':_0x2093dd[_0x3e5e('0x1e')],'include':_0x2093dd[_0x3e5e('0x1c')]?_[_0x3e5e('0x1d')](_0x2093dd[_0x3e5e('0x1c')],function(_0x5ae962){return{'model':db[_0x5ae962[_0x3e5e('0x1f')]],'as':_0x5ae962['as'],'attributes':_0x5ae962[_0x3e5e('0x1e')],'include':_0x5ae962[_0x3e5e('0x1c')]?_[_0x3e5e('0x1d')](_0x5ae962['include'],function(_0x36a2ed){return{'model':db[_0x36a2ed[_0x3e5e('0x1f')]],'as':_0x36a2ed['as'],'attributes':_0x36a2ed[_0x3e5e('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x3e5e('0xc')](function(_0x205227){logger['info'](_0x3e5e('0x15'),_0x17b22b);logger['debug'](_0x3e5e('0x15'),_0x17b22b,JSON[_0x3e5e('0xf')](_0x205227));_0x581606(_0x205227);})[_0x3e5e('0x20')](function(_0x5d444f){logger[_0x3e5e('0x10')](_0x3e5e('0x15'),_0x5d444f['message'],_0x17b22b);_0x433556(_0x123978['error'](0x1f4,_0x5d444f[_0x3e5e('0x12')]));});});};exports[_0x3e5e('0x21')]=function(_0x57f0de){var _0x11df6e=this;return new Promise(function(_0x561c6f,_0x3b93dd){return db['FreshdeskAccount'][_0x3e5e('0x22')]({'raw':_0x57f0de[_0x3e5e('0x18')]?_0x57f0de[_0x3e5e('0x18')][_0x3e5e('0x19')]===undefined?!![]:![]:!![],'where':_0x57f0de[_0x3e5e('0x18')]?_0x57f0de[_0x3e5e('0x18')]['where']||null:null,'attributes':_0x57f0de[_0x3e5e('0x18')]?_0x57f0de['options'][_0x3e5e('0x1e')]||null:null,'include':_0x57f0de['options']?_0x57f0de[_0x3e5e('0x18')][_0x3e5e('0x1c')]?_['map'](_0x57f0de[_0x3e5e('0x18')][_0x3e5e('0x1c')],function(_0x14c63c){return{'model':db[_0x14c63c[_0x3e5e('0x1f')]],'as':_0x14c63c['as'],'attributes':_0x14c63c['attributes'],'include':_0x14c63c[_0x3e5e('0x1c')]?_[_0x3e5e('0x1d')](_0x14c63c[_0x3e5e('0x1c')],function(_0x13fddd){return{'model':db[_0x13fddd[_0x3e5e('0x1f')]],'as':_0x13fddd['as'],'attributes':_0x13fddd[_0x3e5e('0x1e')],'include':_0x13fddd['include']?_[_0x3e5e('0x1d')](_0x13fddd[_0x3e5e('0x1c')],function(_0x41b27c){return{'model':db[_0x41b27c['model']],'as':_0x41b27c['as'],'attributes':_0x41b27c[_0x3e5e('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x3e5e('0xc')](function(_0x4942e8){logger[_0x3e5e('0x13')](_0x3e5e('0x21'),_0x57f0de);logger[_0x3e5e('0x23')]('ShowFreshdeskAccount',_0x57f0de,JSON[_0x3e5e('0xf')](_0x4942e8));_0x561c6f(_0x4942e8);})[_0x3e5e('0x20')](function(_0x56ec43){logger[_0x3e5e('0x10')](_0x3e5e('0x21'),_0x56ec43['message'],_0x57f0de);_0x3b93dd(_0x11df6e[_0x3e5e('0x10')](0x1f4,_0x56ec43[_0x3e5e('0x12')]));});});}; \ No newline at end of file +var _0x0d59=['stringify','error','code','message','result','catch','GetFreshdeskAccount','FreshdeskAccount','findAll','options','attributes','limit','include','model','map','where','ShowFreshdeskAccount','util','ioredis','../../mysqldb','rpc','../../config/environment','client','http','then','info','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0x0d59,0xa2));var _0x90d5=function(_0x246f0c,_0x39f734){_0x246f0c=_0x246f0c-0x0;var _0x30fe50=_0x0d59[_0x246f0c];return _0x30fe50;};'use strict';var _=require('lodash');var util=require(_0x90d5('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x90d5('0x1'));var db=require(_0x90d5('0x2'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x90d5('0x3'));var config=require(_0x90d5('0x4'));var jayson=require('jayson/promise');var client=jayson[_0x90d5('0x5')][_0x90d5('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x3a9425,_0x4557ad,_0x54e4fe){return new BPromise(function(_0x4f0b7d,_0x16c4b0){return client['request'](_0x3a9425,_0x54e4fe)[_0x90d5('0x7')](function(_0x2ac4a8){logger[_0x90d5('0x8')](_0x90d5('0x9'),_0x4557ad,_0x90d5('0xa'));logger[_0x90d5('0xb')]('FreshdeskAccount,\x20%s,\x20%s,\x20%s',_0x4557ad,_0x90d5('0xa'),JSON[_0x90d5('0xc')](_0x2ac4a8));if(_0x2ac4a8['error']){if(_0x2ac4a8[_0x90d5('0xd')][_0x90d5('0xe')]===0x1f4){logger[_0x90d5('0xd')](_0x90d5('0x9'),_0x4557ad,_0x2ac4a8['error'][_0x90d5('0xf')]);return _0x16c4b0(_0x2ac4a8[_0x90d5('0xd')][_0x90d5('0xf')]);}logger['error'](_0x90d5('0x9'),_0x4557ad,_0x2ac4a8[_0x90d5('0xd')][_0x90d5('0xf')]);return _0x4f0b7d(_0x2ac4a8[_0x90d5('0xd')][_0x90d5('0xf')]);}else{logger[_0x90d5('0x8')]('FreshdeskAccount,\x20%s,\x20%s',_0x4557ad,_0x90d5('0xa'));_0x4f0b7d(_0x2ac4a8[_0x90d5('0x10')][_0x90d5('0xf')]);}})[_0x90d5('0x11')](function(_0x48b3b4){logger[_0x90d5('0xd')](_0x90d5('0x9'),_0x4557ad,_0x48b3b4);_0x16c4b0(_0x48b3b4);});});}exports[_0x90d5('0x12')]=function(_0x2e8b25){var _0x1e7b45=this;return new Promise(function(_0x4dae1f,_0xcc5b13){return db[_0x90d5('0x13')][_0x90d5('0x14')]({'raw':_0x2e8b25[_0x90d5('0x15')]?_0x2e8b25['options']['raw']===undefined?!![]:![]:!![],'where':_0x2e8b25[_0x90d5('0x15')]?_0x2e8b25[_0x90d5('0x15')]['where']||null:null,'attributes':_0x2e8b25['options']?_0x2e8b25[_0x90d5('0x15')][_0x90d5('0x16')]||null:null,'limit':_0x2e8b25[_0x90d5('0x15')]?_0x2e8b25[_0x90d5('0x15')][_0x90d5('0x17')]||null:null,'include':_0x2e8b25['options']?_0x2e8b25[_0x90d5('0x15')][_0x90d5('0x18')]?_['map'](_0x2e8b25[_0x90d5('0x15')]['include'],function(_0x157df3){return{'model':db[_0x157df3[_0x90d5('0x19')]],'as':_0x157df3['as'],'attributes':_0x157df3[_0x90d5('0x16')],'include':_0x157df3['include']?_['map'](_0x157df3[_0x90d5('0x18')],function(_0x464acb){return{'model':db[_0x464acb[_0x90d5('0x19')]],'as':_0x464acb['as'],'attributes':_0x464acb['attributes'],'include':_0x464acb['include']?_[_0x90d5('0x1a')](_0x464acb[_0x90d5('0x18')],function(_0x5baf82){return{'model':db[_0x5baf82[_0x90d5('0x19')]],'as':_0x5baf82['as'],'attributes':_0x5baf82[_0x90d5('0x16')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x220be3){logger['info'](_0x90d5('0x12'),_0x2e8b25);logger[_0x90d5('0xb')](_0x90d5('0x12'),_0x2e8b25,JSON[_0x90d5('0xc')](_0x220be3));_0x4dae1f(_0x220be3);})[_0x90d5('0x11')](function(_0x5112d9){logger[_0x90d5('0xd')](_0x90d5('0x12'),_0x5112d9[_0x90d5('0xf')],_0x2e8b25);_0xcc5b13(_0x1e7b45['error'](0x1f4,_0x5112d9[_0x90d5('0xf')]));});});};exports['ShowFreshdeskAccount']=function(_0x5af9b3){var _0x461915=this;return new Promise(function(_0x49c851,_0x39fdc3){return db[_0x90d5('0x13')]['find']({'raw':_0x5af9b3[_0x90d5('0x15')]?_0x5af9b3[_0x90d5('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x5af9b3[_0x90d5('0x15')]?_0x5af9b3['options'][_0x90d5('0x1b')]||null:null,'attributes':_0x5af9b3[_0x90d5('0x15')]?_0x5af9b3[_0x90d5('0x15')][_0x90d5('0x16')]||null:null,'include':_0x5af9b3['options']?_0x5af9b3[_0x90d5('0x15')][_0x90d5('0x18')]?_['map'](_0x5af9b3[_0x90d5('0x15')][_0x90d5('0x18')],function(_0xe5942e){return{'model':db[_0xe5942e[_0x90d5('0x19')]],'as':_0xe5942e['as'],'attributes':_0xe5942e[_0x90d5('0x16')],'include':_0xe5942e[_0x90d5('0x18')]?_['map'](_0xe5942e[_0x90d5('0x18')],function(_0x3bb591){return{'model':db[_0x3bb591[_0x90d5('0x19')]],'as':_0x3bb591['as'],'attributes':_0x3bb591[_0x90d5('0x16')],'include':_0x3bb591[_0x90d5('0x18')]?_[_0x90d5('0x1a')](_0x3bb591[_0x90d5('0x18')],function(_0x29946e){return{'model':db[_0x29946e['model']],'as':_0x29946e['as'],'attributes':_0x29946e['attributes']};}):[]};}):[]};}):[]:[]})[_0x90d5('0x7')](function(_0x12d3aa){logger['info'](_0x90d5('0x1c'),_0x5af9b3);logger[_0x90d5('0xb')]('ShowFreshdeskAccount',_0x5af9b3,JSON[_0x90d5('0xc')](_0x12d3aa));_0x49c851(_0x12d3aa);})[_0x90d5('0x11')](function(_0x56515b){logger['error']('ShowFreshdeskAccount',_0x56515b[_0x90d5('0xf')],_0x5af9b3);_0x39fdc3(_0x461915[_0x90d5('0xd')](0x1f4,_0x56515b[_0x90d5('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/index.js b/server/api/intFreshdeskConfiguration/index.js index 78fb825..02cb599 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 _0xe7f0=['/:id/subjects','getSubjects','/:id/descriptions','/:id/tags','post','create','setTags','put','update','delete','exports','multer','connect-timeout','express','../../config/environment','./intFreshdeskConfiguration.controller','get','isAuthenticated','/:id','show','/:id/fields','getFields'];(function(_0x2ddc4a,_0xdcf87){var _0x44bd44=function(_0x3e8b79){while(--_0x3e8b79){_0x2ddc4a['push'](_0x2ddc4a['shift']());}};_0x44bd44(++_0xdcf87);}(_0xe7f0,0x16b));var _0x0e7f=function(_0x11ba46,_0x1d6752){_0x11ba46=_0x11ba46-0x0;var _0x1c8c6f=_0xe7f0[_0x11ba46];return _0x1c8c6f;};'use strict';var multer=require(_0x0e7f('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x0e7f('0x1'));var express=require(_0x0e7f('0x2'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x0e7f('0x3'));var controller=require(_0x0e7f('0x4'));router[_0x0e7f('0x5')]('/',auth[_0x0e7f('0x6')](),controller['index']);router['get'](_0x0e7f('0x7'),auth[_0x0e7f('0x6')](),controller[_0x0e7f('0x8')]);router[_0x0e7f('0x5')](_0x0e7f('0x9'),auth[_0x0e7f('0x6')](),controller[_0x0e7f('0xa')]);router[_0x0e7f('0x5')](_0x0e7f('0xb'),auth[_0x0e7f('0x6')](),controller[_0x0e7f('0xc')]);router[_0x0e7f('0x5')](_0x0e7f('0xd'),auth[_0x0e7f('0x6')](),controller['getDescriptions']);router[_0x0e7f('0x5')](_0x0e7f('0xe'),auth[_0x0e7f('0x6')](),controller['getTags']);router[_0x0e7f('0xf')]('/',auth['isAuthenticated'](),controller[_0x0e7f('0x10')]);router[_0x0e7f('0xf')](_0x0e7f('0xe'),auth[_0x0e7f('0x6')](),controller[_0x0e7f('0x11')]);router[_0x0e7f('0x12')]('/:id',auth[_0x0e7f('0x6')](),controller[_0x0e7f('0x13')]);router[_0x0e7f('0x14')]('/:id',auth[_0x0e7f('0x6')](),controller['destroy']);module[_0x0e7f('0x15')]=router; \ No newline at end of file +var _0xe2a0=['setTags','put','update','delete','destroy','exports','multer','util','connect-timeout','Router','../../components/auth/service','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','getDescriptions','/:id/tags','getTags','post'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe2a0,0x1e6));var _0x0e2a=function(_0x324e83,_0xfb146e){_0x324e83=_0x324e83-0x0;var _0x50ec61=_0xe2a0[_0x324e83];return _0x50ec61;};'use strict';var multer=require(_0x0e2a('0x0'));var util=require(_0x0e2a('0x1'));var path=require('path');var timeout=require(_0x0e2a('0x2'));var express=require('express');var router=express[_0x0e2a('0x3')]();var auth=require(_0x0e2a('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./intFreshdeskConfiguration.controller');router[_0x0e2a('0x5')]('/',auth[_0x0e2a('0x6')](),controller[_0x0e2a('0x7')]);router['get'](_0x0e2a('0x8'),auth[_0x0e2a('0x6')](),controller[_0x0e2a('0x9')]);router[_0x0e2a('0x5')](_0x0e2a('0xa'),auth[_0x0e2a('0x6')](),controller[_0x0e2a('0xb')]);router[_0x0e2a('0x5')](_0x0e2a('0xc'),auth['isAuthenticated'](),controller[_0x0e2a('0xd')]);router[_0x0e2a('0x5')]('/:id/descriptions',auth[_0x0e2a('0x6')](),controller[_0x0e2a('0xe')]);router[_0x0e2a('0x5')](_0x0e2a('0xf'),auth[_0x0e2a('0x6')](),controller[_0x0e2a('0x10')]);router['post']('/',auth[_0x0e2a('0x6')](),controller['create']);router[_0x0e2a('0x11')]('/:id/tags',auth[_0x0e2a('0x6')](),controller[_0x0e2a('0x12')]);router[_0x0e2a('0x13')]('/:id',auth['isAuthenticated'](),controller[_0x0e2a('0x14')]);router[_0x0e2a('0x15')](_0x0e2a('0x8'),auth[_0x0e2a('0x6')](),controller[_0x0e2a('0x16')]);module[_0x0e2a('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 5fbf0b6..48fba58 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 _0xb57f=['STRING'];(function(_0x38ffe5,_0x47ed67){var _0x311e6b=function(_0x51d394){while(--_0x51d394){_0x38ffe5['push'](_0x38ffe5['shift']());}};_0x311e6b(++_0x47ed67);}(_0xb57f,0x1d6));var _0xfb57=function(_0x595013,_0x3945c7){_0x595013=_0x595013-0x0;var _0x5dddcc=_0xb57f[_0x595013];return _0x5dddcc;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xfb57('0x0')]},'description':{'type':Sequelize[_0xfb57('0x0')]}}; \ No newline at end of file +var _0xe3fb=['exports','STRING'];(function(_0x444ce8,_0x3f321a){var _0x3f1a98=function(_0x4e63f1){while(--_0x4e63f1){_0x444ce8['push'](_0x444ce8['shift']());}};_0x3f1a98(++_0x3f321a);}(_0xe3fb,0x86));var _0xbe3f=function(_0x3e5e03,_0x2fac27){_0x3e5e03=_0x3e5e03-0x0;var _0x45279e=_0xe3fb[_0x3e5e03];return _0x45279e;};'use strict';var Sequelize=require('sequelize');module[_0xbe3f('0x0')]={'name':{'type':Sequelize[_0xbe3f('0x1')]},'description':{'type':Sequelize[_0xbe3f('0x1')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js index d724b16..4fcee65 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 _0x80b9=['error','message','result','catch','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','stack','name','send','FreshdeskConfiguration','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','type','key','field','options','includeAll','include','findAll','rows','show','params','find','create','body','getFields','findOne','FreshdeskField','getSubjects','getDescriptions','getTags','Tag','setTags','html-pdf','rimraf','zip-dir','fast-json-patch','moment','mustache','path','to-csv','ejs','lodash','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../mysqldb','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','info','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x80b9,0x14f));var _0x980b=function(_0xb73d7b,_0x6de15c){_0xb73d7b=_0xb73d7b-0x0;var _0x1305bf=_0x80b9[_0xb73d7b];return _0x1305bf;};'use strict';var pdf=require(_0x980b('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x980b('0x1'));var zipdir=require(_0x980b('0x2'));var jsonpatch=require(_0x980b('0x3'));var rp=require('request-promise');var moment=require(_0x980b('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x980b('0x5'));var util=require('util');var path=require(_0x980b('0x6'));var sox=require('sox');var csv=require(_0x980b('0x7'));var ejs=require(_0x980b('0x8'));var fs=require('fs');var _=require(_0x980b('0x9'));var squel=require(_0x980b('0xa'));var crypto=require(_0x980b('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x980b('0x7'));var querystring=require(_0x980b('0xc'));var Papa=require(_0x980b('0xd'));var Redis=require('ioredis');var authService=require(_0x980b('0xe'));var qs=require(_0x980b('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x980b('0x10'));var logger=require('../../config/logger')('api');var utils=require(_0x980b('0x11'));var config=require('../../config/environment');var db=require(_0x980b('0x12'))['db'];var jayson=require(_0x980b('0x13'));var client=jayson[_0x980b('0x14')][_0x980b('0x15')]({'port':0x232a});function checkPasswordPattern(_0x1679c0,_0x535d76,_0x42d66c){if(_0x42d66c){var _0x107512=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x107512[_0x980b('0x16')](_0x535d76)){return _0x1679c0;}else{throw new Error(_0x980b('0x17'));}}else{return _0x1679c0;}}function respondWithRpcPromise(_0x1797ae,_0x468155,_0x4501e9,_0x189140){return new BPromise(function(_0x124a2e,_0x5b03f2){var _0x333ffb=_0x189140||client;return _0x333ffb['request'](_0x1797ae,_0x4501e9)['then'](function(_0x17eb55){logger[_0x980b('0x18')](_0x980b('0x19'),_0x468155,_0x980b('0x1a'));logger[_0x980b('0x1b')]('FreshdeskConfiguration,\x20%s,\x20%s,\x20%s',_0x468155,_0x980b('0x1a'),JSON[_0x980b('0x1c')](_0x17eb55));if(_0x17eb55[_0x980b('0x1d')]){if(_0x17eb55[_0x980b('0x1d')]['code']===0x1f4){logger[_0x980b('0x1d')](_0x980b('0x19'),_0x468155,_0x17eb55[_0x980b('0x1d')][_0x980b('0x1e')]);return _0x5b03f2(_0x17eb55[_0x980b('0x1d')][_0x980b('0x1e')]);}logger[_0x980b('0x1d')](_0x980b('0x19'),_0x468155,_0x17eb55['error'][_0x980b('0x1e')]);return _0x124a2e(_0x17eb55[_0x980b('0x1d')][_0x980b('0x1e')]);}else{logger[_0x980b('0x18')](_0x980b('0x19'),_0x468155,'request\x20sent');_0x124a2e(_0x17eb55[_0x980b('0x1f')]['message']);}})[_0x980b('0x20')](function(_0x24b790){logger['error'](_0x980b('0x19'),_0x468155,_0x24b790);_0x5b03f2(_0x24b790);});});}function respondWithStatusCode(_0x33dd69,_0x5a2817){_0x5a2817=_0x5a2817||0xcc;return function(_0x3458cf){if(_0x3458cf){return _0x33dd69['sendStatus'](_0x5a2817);}return _0x33dd69[_0x980b('0x21')](_0x5a2817)[_0x980b('0x22')]();};}function respondWithResult(_0xb1caa0,_0xc0ef10){_0xc0ef10=_0xc0ef10||0xc8;return function(_0x48bdc6){if(_0x48bdc6){return _0xb1caa0[_0x980b('0x21')](_0xc0ef10)[_0x980b('0x23')](_0x48bdc6);}};}function respondWithFilteredResult(_0x3498fc,_0x537078){return function(_0x739bf){if(_0x739bf){var _0x4f2673=_0x739bf[_0x980b('0x24')],_0x4f94b6=_0x537078[_0x980b('0x25')],_0x55789f=_0x537078[_0x980b('0x25')]+_0x537078[_0x980b('0x26')],_0x1aab41;if(_0x55789f>=_0x4f2673){_0x55789f=_0x4f2673;_0x1aab41=0xc8;}else{_0x1aab41=0xce;}_0x3498fc[_0x980b('0x21')](_0x1aab41);return _0x3498fc[_0x980b('0x27')](_0x980b('0x28'),_0x4f94b6+'-'+_0x55789f+'/'+_0x4f2673)[_0x980b('0x23')](_0x739bf);}return null;};}function patchUpdates(_0x35274d){return function(_0x24ecc2){try{jsonpatch[_0x980b('0x29')](_0x24ecc2,_0x35274d,!![]);}catch(_0x13dfff){return BPromise[_0x980b('0x2a')](_0x13dfff);}return _0x24ecc2[_0x980b('0x2b')]();};}function saveUpdates(_0x266fbb,_0x1c2bd1){return function(_0x4db924){if(_0x4db924){return _0x4db924[_0x980b('0x2c')](_0x266fbb)[_0x980b('0x2d')](function(_0x4861d2){return _0x4861d2;});}return null;};}function removeEntity(_0x4eb2bb,_0x2d5255){return function(_0xe00bad){if(_0xe00bad){return _0xe00bad[_0x980b('0x2e')]()[_0x980b('0x2d')](function(){_0x4eb2bb['status'](0xcc)[_0x980b('0x22')]();});}};}function handleEntityNotFound(_0x1de2e6,_0x30a188){return function(_0x1409dd){if(!_0x1409dd){_0x1de2e6[_0x980b('0x2f')](0x194);}return _0x1409dd;};}function handleError(_0x561211,_0x9e811b){_0x9e811b=_0x9e811b||0x1f4;return function(_0x5b5893){logger[_0x980b('0x1d')](_0x5b5893[_0x980b('0x30')]);if(_0x5b5893[_0x980b('0x31')]){delete _0x5b5893[_0x980b('0x31')];}_0x561211[_0x980b('0x21')](_0x9e811b)[_0x980b('0x32')](_0x5b5893);};}exports['index']=function(_0x299529,_0x4cad4d){var _0x45dc5c={},_0x277ba1={},_0x138641={'count':0x0,'rows':[]};var _0x421124=db[_0x980b('0x33')][_0x980b('0x34')];_0x277ba1[_0x980b('0x35')]=_[_0x980b('0x36')](_0x421124);_0x277ba1[_0x980b('0x37')]=_['keys'](_0x299529[_0x980b('0x37')]);_0x277ba1[_0x980b('0x38')]=_[_0x980b('0x39')](_0x277ba1[_0x980b('0x35')],_0x277ba1['query']);_0x45dc5c[_0x980b('0x3a')]=_[_0x980b('0x39')](_0x277ba1[_0x980b('0x35')],qs['fields'](_0x299529[_0x980b('0x37')][_0x980b('0x3b')]));_0x45dc5c['attributes']=_0x45dc5c[_0x980b('0x3a')][_0x980b('0x3c')]?_0x45dc5c[_0x980b('0x3a')]:_0x277ba1['model'];if(!_0x299529['query'][_0x980b('0x3d')](_0x980b('0x3e'))){_0x45dc5c[_0x980b('0x26')]=qs[_0x980b('0x26')](_0x299529[_0x980b('0x37')][_0x980b('0x26')]);_0x45dc5c[_0x980b('0x25')]=qs[_0x980b('0x25')](_0x299529[_0x980b('0x37')]['offset']);}_0x45dc5c[_0x980b('0x3f')]=qs[_0x980b('0x40')](_0x299529[_0x980b('0x37')][_0x980b('0x40')]);_0x45dc5c[_0x980b('0x41')]=qs[_0x980b('0x38')](_[_0x980b('0x42')](_0x299529[_0x980b('0x37')],_0x277ba1[_0x980b('0x38')]));if(_0x299529[_0x980b('0x37')][_0x980b('0x43')]){_0x45dc5c[_0x980b('0x41')]=_[_0x980b('0x44')](_0x45dc5c[_0x980b('0x41')],{'$or':_[_0x980b('0x45')](_0x421124,function(_0x4cd915){if(_0x4cd915[_0x980b('0x46')][_0x980b('0x47')]!=='VIRTUAL'){var _0x3d0ade={};_0x3d0ade[_0x4cd915[_0x980b('0x48')]]={'$like':'%'+_0x299529[_0x980b('0x37')]['filter']+'%'};return _0x3d0ade;}})});}_0x45dc5c=_[_0x980b('0x44')]({},_0x45dc5c,_0x299529[_0x980b('0x49')]);var _0x2eda5a={'where':_0x45dc5c[_0x980b('0x41')]};return db[_0x980b('0x33')][_0x980b('0x24')](_0x2eda5a)[_0x980b('0x2d')](function(_0x909a3){_0x138641[_0x980b('0x24')]=_0x909a3;if(_0x299529['query'][_0x980b('0x4a')]){_0x45dc5c[_0x980b('0x4b')]=[{'all':!![]}];}return db[_0x980b('0x33')][_0x980b('0x4c')](_0x45dc5c);})[_0x980b('0x2d')](function(_0x2bd78c){_0x138641[_0x980b('0x4d')]=_0x2bd78c;return _0x138641;})[_0x980b('0x2d')](respondWithFilteredResult(_0x4cad4d,_0x45dc5c))[_0x980b('0x20')](handleError(_0x4cad4d,null));};exports[_0x980b('0x4e')]=function(_0xf6e620,_0x5e2ff2){var _0x4d3e19={'raw':![],'where':{'id':_0xf6e620[_0x980b('0x4f')]['id']}},_0x2bf2e6={};_0x2bf2e6[_0x980b('0x35')]=_[_0x980b('0x36')](db['FreshdeskConfiguration'][_0x980b('0x34')]);_0x2bf2e6[_0x980b('0x37')]=_[_0x980b('0x36')](_0xf6e620['query']);_0x2bf2e6[_0x980b('0x38')]=_[_0x980b('0x39')](_0x2bf2e6[_0x980b('0x35')],_0x2bf2e6[_0x980b('0x37')]);_0x4d3e19[_0x980b('0x3a')]=_[_0x980b('0x39')](_0x2bf2e6['model'],qs[_0x980b('0x3b')](_0xf6e620['query'][_0x980b('0x3b')]));_0x4d3e19[_0x980b('0x3a')]=_0x4d3e19[_0x980b('0x3a')][_0x980b('0x3c')]?_0x4d3e19[_0x980b('0x3a')]:_0x2bf2e6[_0x980b('0x35')];if(_0xf6e620['query'][_0x980b('0x4a')]){_0x4d3e19[_0x980b('0x4b')]=[{'all':!![]}];}_0x4d3e19=_[_0x980b('0x44')]({},_0x4d3e19,_0xf6e620[_0x980b('0x49')]);return db[_0x980b('0x33')][_0x980b('0x50')](_0x4d3e19)[_0x980b('0x2d')](handleEntityNotFound(_0x5e2ff2,null))[_0x980b('0x2d')](respondWithResult(_0x5e2ff2,null))[_0x980b('0x20')](handleError(_0x5e2ff2,null));};exports[_0x980b('0x51')]=function(_0x109f9c,_0x4df9a6){return db[_0x980b('0x33')][_0x980b('0x51')](_0x109f9c[_0x980b('0x52')],{})['then'](respondWithResult(_0x4df9a6,0xc9))['catch'](handleError(_0x4df9a6,null));};exports[_0x980b('0x2c')]=function(_0xf774ff,_0x525238){if(_0xf774ff[_0x980b('0x52')]['id']){delete _0xf774ff[_0x980b('0x52')]['id'];}return db[_0x980b('0x33')][_0x980b('0x50')]({'where':{'id':_0xf774ff['params']['id']}})[_0x980b('0x2d')](handleEntityNotFound(_0x525238,null))[_0x980b('0x2d')](saveUpdates(_0xf774ff[_0x980b('0x52')],null))['then'](respondWithResult(_0x525238,null))['catch'](handleError(_0x525238,null));};exports['destroy']=function(_0x3573c2,_0x3b7575){return db['FreshdeskConfiguration'][_0x980b('0x50')]({'where':{'id':_0x3573c2[_0x980b('0x4f')]['id']}})['then'](handleEntityNotFound(_0x3b7575,null))['then'](removeEntity(_0x3b7575,null))[_0x980b('0x20')](handleError(_0x3b7575,null));};exports[_0x980b('0x53')]=function(_0x31385f,_0x24bb27,_0x12a381){var _0x1bd82d={};var _0x334b0e={};var _0x3c4822;var _0x2ba58a;return db['FreshdeskConfiguration'][_0x980b('0x54')]({'where':{'id':_0x31385f['params']['id']}})[_0x980b('0x2d')](handleEntityNotFound(_0x24bb27,null))[_0x980b('0x2d')](function(_0x4c02b4){if(_0x4c02b4){_0x3c4822=_0x4c02b4;_0x334b0e['model']=_[_0x980b('0x36')](db[_0x980b('0x55')][_0x980b('0x34')]);_0x334b0e[_0x980b('0x37')]=_['keys'](_0x31385f[_0x980b('0x37')]);_0x334b0e['filters']=_[_0x980b('0x39')](_0x334b0e[_0x980b('0x35')],_0x334b0e[_0x980b('0x37')]);_0x1bd82d[_0x980b('0x3a')]=_[_0x980b('0x39')](_0x334b0e[_0x980b('0x35')],qs[_0x980b('0x3b')](_0x31385f[_0x980b('0x37')][_0x980b('0x3b')]));_0x1bd82d[_0x980b('0x3a')]=_0x1bd82d[_0x980b('0x3a')][_0x980b('0x3c')]?_0x1bd82d['attributes']:_0x334b0e[_0x980b('0x35')];_0x1bd82d[_0x980b('0x3f')]=qs[_0x980b('0x40')](_0x31385f['query'][_0x980b('0x40')]);_0x1bd82d[_0x980b('0x41')]=qs[_0x980b('0x38')](_[_0x980b('0x42')](_0x31385f['query'],_0x334b0e[_0x980b('0x38')]));if(_0x31385f[_0x980b('0x37')][_0x980b('0x43')]){_0x1bd82d[_0x980b('0x41')]=_[_0x980b('0x44')](_0x1bd82d[_0x980b('0x41')],{'$or':_[_0x980b('0x45')](_0x1bd82d['attributes'],function(_0x3d54a4){var _0x3446ff={};_0x3446ff[_0x3d54a4]={'$like':'%'+_0x31385f[_0x980b('0x37')]['filter']+'%'};return _0x3446ff;})});}_0x1bd82d=_[_0x980b('0x44')]({},_0x1bd82d,_0x31385f['options']);return _0x3c4822[_0x980b('0x53')](_0x1bd82d);}})[_0x980b('0x2d')](function(_0x5c7894){if(_0x5c7894){_0x2ba58a=_0x5c7894[_0x980b('0x3c')];if(!_0x31385f['query']['hasOwnProperty'](_0x980b('0x3e'))){_0x1bd82d['limit']=qs[_0x980b('0x26')](_0x31385f['query']['limit']);_0x1bd82d['offset']=qs['offset'](_0x31385f[_0x980b('0x37')]['offset']);}return _0x3c4822[_0x980b('0x53')](_0x1bd82d);}})[_0x980b('0x2d')](function(_0x36cda1){if(_0x36cda1){return _0x36cda1?{'count':_0x2ba58a,'rows':_0x36cda1}:null;}})[_0x980b('0x2d')](respondWithResult(_0x24bb27,null))[_0x980b('0x20')](handleError(_0x24bb27,null));};exports[_0x980b('0x56')]=function(_0x30a1f9,_0x2f7a8c,_0x582130){var _0xb3594b={};var _0x5379fa={};var _0x3ed3b0;var _0x48364e;return db[_0x980b('0x33')][_0x980b('0x54')]({'where':{'id':_0x30a1f9[_0x980b('0x4f')]['id']}})['then'](handleEntityNotFound(_0x2f7a8c,null))[_0x980b('0x2d')](function(_0x3349f5){if(_0x3349f5){_0x3ed3b0=_0x3349f5;_0x5379fa[_0x980b('0x35')]=_['keys'](db[_0x980b('0x55')]['rawAttributes']);_0x5379fa[_0x980b('0x37')]=_['keys'](_0x30a1f9[_0x980b('0x37')]);_0x5379fa[_0x980b('0x38')]=_[_0x980b('0x39')](_0x5379fa[_0x980b('0x35')],_0x5379fa[_0x980b('0x37')]);_0xb3594b[_0x980b('0x3a')]=_['intersection'](_0x5379fa[_0x980b('0x35')],qs['fields'](_0x30a1f9[_0x980b('0x37')][_0x980b('0x3b')]));_0xb3594b[_0x980b('0x3a')]=_0xb3594b['attributes'][_0x980b('0x3c')]?_0xb3594b[_0x980b('0x3a')]:_0x5379fa[_0x980b('0x35')];_0xb3594b['order']=qs[_0x980b('0x40')](_0x30a1f9[_0x980b('0x37')][_0x980b('0x40')]);_0xb3594b[_0x980b('0x41')]=qs[_0x980b('0x38')](_[_0x980b('0x42')](_0x30a1f9[_0x980b('0x37')],_0x5379fa['filters']));if(_0x30a1f9[_0x980b('0x37')][_0x980b('0x43')]){_0xb3594b[_0x980b('0x41')]=_[_0x980b('0x44')](_0xb3594b[_0x980b('0x41')],{'$or':_[_0x980b('0x45')](_0xb3594b[_0x980b('0x3a')],function(_0xb2f1b7){var _0x5158a7={};_0x5158a7[_0xb2f1b7]={'$like':'%'+_0x30a1f9[_0x980b('0x37')][_0x980b('0x43')]+'%'};return _0x5158a7;})});}_0xb3594b=_['merge']({},_0xb3594b,_0x30a1f9[_0x980b('0x49')]);return _0x3ed3b0[_0x980b('0x56')](_0xb3594b);}})['then'](function(_0x35a5ff){if(_0x35a5ff){_0x48364e=_0x35a5ff['length'];if(!_0x30a1f9[_0x980b('0x37')][_0x980b('0x3d')]('nolimit')){_0xb3594b[_0x980b('0x26')]=qs[_0x980b('0x26')](_0x30a1f9['query'][_0x980b('0x26')]);_0xb3594b[_0x980b('0x25')]=qs['offset'](_0x30a1f9[_0x980b('0x37')][_0x980b('0x25')]);}return _0x3ed3b0[_0x980b('0x56')](_0xb3594b);}})[_0x980b('0x2d')](function(_0x472193){if(_0x472193){return _0x472193?{'count':_0x48364e,'rows':_0x472193}:null;}})[_0x980b('0x2d')](respondWithResult(_0x2f7a8c,null))[_0x980b('0x20')](handleError(_0x2f7a8c,null));};exports[_0x980b('0x57')]=function(_0xb9ad85,_0x3bc49b,_0x5c275d){var _0x57d4bf={};var _0x47c2de={};var _0x4dbab6;var _0x326566;return db[_0x980b('0x33')][_0x980b('0x54')]({'where':{'id':_0xb9ad85[_0x980b('0x4f')]['id']}})[_0x980b('0x2d')](handleEntityNotFound(_0x3bc49b,null))[_0x980b('0x2d')](function(_0x210f12){if(_0x210f12){_0x4dbab6=_0x210f12;_0x47c2de[_0x980b('0x35')]=_[_0x980b('0x36')](db['FreshdeskField'][_0x980b('0x34')]);_0x47c2de[_0x980b('0x37')]=_[_0x980b('0x36')](_0xb9ad85['query']);_0x47c2de['filters']=_[_0x980b('0x39')](_0x47c2de[_0x980b('0x35')],_0x47c2de[_0x980b('0x37')]);_0x57d4bf[_0x980b('0x3a')]=_[_0x980b('0x39')](_0x47c2de[_0x980b('0x35')],qs[_0x980b('0x3b')](_0xb9ad85['query'][_0x980b('0x3b')]));_0x57d4bf[_0x980b('0x3a')]=_0x57d4bf[_0x980b('0x3a')][_0x980b('0x3c')]?_0x57d4bf[_0x980b('0x3a')]:_0x47c2de[_0x980b('0x35')];_0x57d4bf['order']=qs['sort'](_0xb9ad85['query'][_0x980b('0x40')]);_0x57d4bf[_0x980b('0x41')]=qs[_0x980b('0x38')](_[_0x980b('0x42')](_0xb9ad85[_0x980b('0x37')],_0x47c2de[_0x980b('0x38')]));if(_0xb9ad85[_0x980b('0x37')]['filter']){_0x57d4bf[_0x980b('0x41')]=_[_0x980b('0x44')](_0x57d4bf[_0x980b('0x41')],{'$or':_[_0x980b('0x45')](_0x57d4bf[_0x980b('0x3a')],function(_0x2396f3){var _0x280a56={};_0x280a56[_0x2396f3]={'$like':'%'+_0xb9ad85[_0x980b('0x37')][_0x980b('0x43')]+'%'};return _0x280a56;})});}_0x57d4bf=_[_0x980b('0x44')]({},_0x57d4bf,_0xb9ad85[_0x980b('0x49')]);return _0x4dbab6['getDescriptions'](_0x57d4bf);}})[_0x980b('0x2d')](function(_0x4214ea){if(_0x4214ea){_0x326566=_0x4214ea[_0x980b('0x3c')];if(!_0xb9ad85['query']['hasOwnProperty'](_0x980b('0x3e'))){_0x57d4bf[_0x980b('0x26')]=qs['limit'](_0xb9ad85[_0x980b('0x37')][_0x980b('0x26')]);_0x57d4bf['offset']=qs[_0x980b('0x25')](_0xb9ad85[_0x980b('0x37')]['offset']);}return _0x4dbab6['getDescriptions'](_0x57d4bf);}})[_0x980b('0x2d')](function(_0x314184){if(_0x314184){return _0x314184?{'count':_0x326566,'rows':_0x314184}:null;}})[_0x980b('0x2d')](respondWithResult(_0x3bc49b,null))[_0x980b('0x20')](handleError(_0x3bc49b,null));};exports[_0x980b('0x58')]=function(_0x362ead,_0x2b496c,_0x3bf175){var _0x10a4c7={};var _0x2e4357={};var _0x3361c1;var _0x2cbde3;return db['FreshdeskConfiguration']['findOne']({'where':{'id':_0x362ead['params']['id']}})[_0x980b('0x2d')](handleEntityNotFound(_0x2b496c,null))['then'](function(_0x25efcb){if(_0x25efcb){_0x3361c1=_0x25efcb;_0x2e4357['model']=_[_0x980b('0x36')](db[_0x980b('0x59')][_0x980b('0x34')]);_0x2e4357['query']=_[_0x980b('0x36')](_0x362ead[_0x980b('0x37')]);_0x2e4357['filters']=_[_0x980b('0x39')](_0x2e4357['model'],_0x2e4357[_0x980b('0x37')]);_0x10a4c7[_0x980b('0x3a')]=_['intersection'](_0x2e4357[_0x980b('0x35')],qs[_0x980b('0x3b')](_0x362ead[_0x980b('0x37')][_0x980b('0x3b')]));_0x10a4c7[_0x980b('0x3a')]=_0x10a4c7[_0x980b('0x3a')]['length']?_0x10a4c7[_0x980b('0x3a')]:_0x2e4357[_0x980b('0x35')];_0x10a4c7[_0x980b('0x3f')]=qs[_0x980b('0x40')](_0x362ead[_0x980b('0x37')]['sort']);_0x10a4c7[_0x980b('0x41')]=qs['filters'](_[_0x980b('0x42')](_0x362ead[_0x980b('0x37')],_0x2e4357[_0x980b('0x38')]));if(_0x362ead[_0x980b('0x37')][_0x980b('0x43')]){_0x10a4c7[_0x980b('0x41')]=_[_0x980b('0x44')](_0x10a4c7[_0x980b('0x41')],{'$or':_[_0x980b('0x45')](_0x10a4c7[_0x980b('0x3a')],function(_0x2f22b8){var _0x1a72e0={};_0x1a72e0[_0x2f22b8]={'$like':'%'+_0x362ead[_0x980b('0x37')][_0x980b('0x43')]+'%'};return _0x1a72e0;})});}_0x10a4c7=_[_0x980b('0x44')]({},_0x10a4c7,_0x362ead[_0x980b('0x49')]);return _0x3361c1[_0x980b('0x58')](_0x10a4c7);}})['then'](function(_0x147b67){if(_0x147b67){_0x2cbde3=_0x147b67[_0x980b('0x3c')];if(!_0x362ead['query'][_0x980b('0x3d')](_0x980b('0x3e'))){_0x10a4c7['limit']=qs['limit'](_0x362ead[_0x980b('0x37')][_0x980b('0x26')]);_0x10a4c7[_0x980b('0x25')]=qs['offset'](_0x362ead[_0x980b('0x37')][_0x980b('0x25')]);}return _0x3361c1['getTags'](_0x10a4c7);}})[_0x980b('0x2d')](function(_0x184a3a){if(_0x184a3a){return _0x184a3a?{'count':_0x2cbde3,'rows':_0x184a3a}:null;}})[_0x980b('0x2d')](respondWithResult(_0x2b496c,null))[_0x980b('0x20')](handleError(_0x2b496c,null));};exports[_0x980b('0x5a')]=function(_0x43130e,_0x62392b,_0x4f7640){if(_0x43130e[_0x980b('0x52')]['id']){delete _0x43130e['body']['id'];}return db[_0x980b('0x33')][_0x980b('0x54')]({'where':{'id':_0x43130e[_0x980b('0x4f')]['id']}})[_0x980b('0x2d')](handleEntityNotFound(_0x62392b,null))[_0x980b('0x2d')](function(_0x2c45c6){if(_0x2c45c6){return _0x2c45c6['setTags'](_0x43130e[_0x980b('0x52')]['ids']||[]);}return null;})[_0x980b('0x2d')](respondWithResult(_0x62392b,null))['catch'](handleError(_0x62392b,null));}; \ No newline at end of file +var _0xab7f=['FreshdeskConfiguration,\x20%s,\x20%s','message','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','save','update','destroy','stack','name','index','FreshdeskConfiguration','rawAttributes','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','map','type','key','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','create','body','getFields','getSubjects','findOne','FreshdeskField','getDescriptions','Tag','getTags','setTags','ids','html-pdf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','request\x20sent','debug','error','code'];(function(_0x69cc85,_0x39039d){var _0x50e3a1=function(_0x430a68){while(--_0x430a68){_0x69cc85['push'](_0x69cc85['shift']());}};_0x50e3a1(++_0x39039d);}(_0xab7f,0x93));var _0xfab7=function(_0x2c1563,_0x206767){_0x2c1563=_0x2c1563-0x0;var _0x3352a9=_0xab7f[_0x2c1563];return _0x3352a9;};'use strict';var pdf=require(_0xfab7('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xfab7('0x1'));var jsonpatch=require(_0xfab7('0x2'));var rp=require(_0xfab7('0x3'));var moment=require(_0xfab7('0x4'));var BPromise=require(_0xfab7('0x5'));var Mustache=require(_0xfab7('0x6'));var util=require(_0xfab7('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xfab7('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xfab7('0x9'));var squel=require(_0xfab7('0xa'));var crypto=require(_0xfab7('0xb'));var jsforce=require(_0xfab7('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xfab7('0x8'));var querystring=require(_0xfab7('0xd'));var Papa=require('papaparse');var Redis=require(_0xfab7('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xfab7('0xf'));var as=require(_0xfab7('0x10'));var hardwareService=require(_0xfab7('0x11'));var logger=require('../../config/logger')(_0xfab7('0x12'));var utils=require('../../config/utils');var config=require(_0xfab7('0x13'));var db=require(_0xfab7('0x14'))['db'];var jayson=require(_0xfab7('0x15'));var client=jayson[_0xfab7('0x16')][_0xfab7('0x17')]({'port':0x232a});function checkPasswordPattern(_0x191190,_0x454901,_0x44e54d){if(_0x44e54d){var _0x3bf7e4=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3bf7e4[_0xfab7('0x18')](_0x454901)){return _0x191190;}else{throw new Error(_0xfab7('0x19'));}}else{return _0x191190;}}function respondWithRpcPromise(_0x3e7b74,_0x4d8b01,_0x57cfaa,_0x4cd9eb){return new BPromise(function(_0x1b25fb,_0x3edb05){var _0x305416=_0x4cd9eb||client;return _0x305416[_0xfab7('0x1a')](_0x3e7b74,_0x57cfaa)[_0xfab7('0x1b')](function(_0x14bd7d){logger[_0xfab7('0x1c')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x4d8b01,_0xfab7('0x1d'));logger[_0xfab7('0x1e')]('FreshdeskConfiguration,\x20%s,\x20%s,\x20%s',_0x4d8b01,'request\x20sent',JSON['stringify'](_0x14bd7d));if(_0x14bd7d['error']){if(_0x14bd7d[_0xfab7('0x1f')][_0xfab7('0x20')]===0x1f4){logger[_0xfab7('0x1f')](_0xfab7('0x21'),_0x4d8b01,_0x14bd7d[_0xfab7('0x1f')][_0xfab7('0x22')]);return _0x3edb05(_0x14bd7d[_0xfab7('0x1f')][_0xfab7('0x22')]);}logger[_0xfab7('0x1f')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x4d8b01,_0x14bd7d[_0xfab7('0x1f')][_0xfab7('0x22')]);return _0x1b25fb(_0x14bd7d[_0xfab7('0x1f')]['message']);}else{logger[_0xfab7('0x1c')](_0xfab7('0x21'),_0x4d8b01,_0xfab7('0x1d'));_0x1b25fb(_0x14bd7d['result'][_0xfab7('0x22')]);}})['catch'](function(_0x5870e9){logger[_0xfab7('0x1f')](_0xfab7('0x21'),_0x4d8b01,_0x5870e9);_0x3edb05(_0x5870e9);});});}function respondWithStatusCode(_0x4d6e01,_0x51d803){_0x51d803=_0x51d803||0xcc;return function(_0x169915){if(_0x169915){return _0x4d6e01[_0xfab7('0x23')](_0x51d803);}return _0x4d6e01[_0xfab7('0x24')](_0x51d803)['end']();};}function respondWithResult(_0x48b6f1,_0x7a7361){_0x7a7361=_0x7a7361||0xc8;return function(_0x1bdbb4){if(_0x1bdbb4){return _0x48b6f1[_0xfab7('0x24')](_0x7a7361)[_0xfab7('0x25')](_0x1bdbb4);}};}function respondWithFilteredResult(_0x59aafb,_0x44084b){return function(_0x14b610){if(_0x14b610){var _0x351511=_0x14b610[_0xfab7('0x26')],_0x4708fa=_0x44084b[_0xfab7('0x27')],_0x57dfdc=_0x44084b[_0xfab7('0x27')]+_0x44084b[_0xfab7('0x28')],_0x18d14c;if(_0x57dfdc>=_0x351511){_0x57dfdc=_0x351511;_0x18d14c=0xc8;}else{_0x18d14c=0xce;}_0x59aafb[_0xfab7('0x24')](_0x18d14c);return _0x59aafb[_0xfab7('0x29')](_0xfab7('0x2a'),_0x4708fa+'-'+_0x57dfdc+'/'+_0x351511)[_0xfab7('0x25')](_0x14b610);}return null;};}function patchUpdates(_0x128d94){return function(_0x1dd5d8){try{jsonpatch[_0xfab7('0x2b')](_0x1dd5d8,_0x128d94,!![]);}catch(_0x3f6dd0){return BPromise['reject'](_0x3f6dd0);}return _0x1dd5d8[_0xfab7('0x2c')]();};}function saveUpdates(_0x7f16a8,_0x2ec6a3){return function(_0x55a661){if(_0x55a661){return _0x55a661[_0xfab7('0x2d')](_0x7f16a8)[_0xfab7('0x1b')](function(_0x442eb2){return _0x442eb2;});}return null;};}function removeEntity(_0x4f4711,_0xd2aa8c){return function(_0x168efb){if(_0x168efb){return _0x168efb[_0xfab7('0x2e')]()[_0xfab7('0x1b')](function(){_0x4f4711[_0xfab7('0x24')](0xcc)['end']();});}};}function handleEntityNotFound(_0x208828,_0x220a32){return function(_0x2ae5f4){if(!_0x2ae5f4){_0x208828[_0xfab7('0x23')](0x194);}return _0x2ae5f4;};}function handleError(_0x441c20,_0x4bf522){_0x4bf522=_0x4bf522||0x1f4;return function(_0x1b600e){logger[_0xfab7('0x1f')](_0x1b600e[_0xfab7('0x2f')]);if(_0x1b600e[_0xfab7('0x30')]){delete _0x1b600e['name'];}_0x441c20[_0xfab7('0x24')](_0x4bf522)['send'](_0x1b600e);};}exports[_0xfab7('0x31')]=function(_0x50987b,_0x505433){var _0x1372ff={},_0x473a92={},_0x2c9e94={'count':0x0,'rows':[]};var _0x2d2887=db[_0xfab7('0x32')][_0xfab7('0x33')];_0x473a92[_0xfab7('0x34')]=_['keys'](_0x2d2887);_0x473a92[_0xfab7('0x35')]=_[_0xfab7('0x36')](_0x50987b[_0xfab7('0x35')]);_0x473a92[_0xfab7('0x37')]=_[_0xfab7('0x38')](_0x473a92[_0xfab7('0x34')],_0x473a92['query']);_0x1372ff[_0xfab7('0x39')]=_['intersection'](_0x473a92[_0xfab7('0x34')],qs[_0xfab7('0x3a')](_0x50987b[_0xfab7('0x35')][_0xfab7('0x3a')]));_0x1372ff[_0xfab7('0x39')]=_0x1372ff[_0xfab7('0x39')][_0xfab7('0x3b')]?_0x1372ff[_0xfab7('0x39')]:_0x473a92[_0xfab7('0x34')];if(!_0x50987b[_0xfab7('0x35')][_0xfab7('0x3c')](_0xfab7('0x3d'))){_0x1372ff[_0xfab7('0x28')]=qs[_0xfab7('0x28')](_0x50987b[_0xfab7('0x35')]['limit']);_0x1372ff['offset']=qs[_0xfab7('0x27')](_0x50987b[_0xfab7('0x35')][_0xfab7('0x27')]);}_0x1372ff[_0xfab7('0x3e')]=qs[_0xfab7('0x3f')](_0x50987b['query'][_0xfab7('0x3f')]);_0x1372ff['where']=qs[_0xfab7('0x37')](_[_0xfab7('0x40')](_0x50987b[_0xfab7('0x35')],_0x473a92[_0xfab7('0x37')]));if(_0x50987b[_0xfab7('0x35')][_0xfab7('0x41')]){_0x1372ff['where']=_[_0xfab7('0x42')](_0x1372ff[_0xfab7('0x43')],{'$or':_[_0xfab7('0x44')](_0x2d2887,function(_0x16c259){if(_0x16c259[_0xfab7('0x45')][_0xfab7('0x46')]!==_0xfab7('0x47')){var _0x1ca6ed={};_0x1ca6ed[_0x16c259['field']]={'$like':'%'+_0x50987b[_0xfab7('0x35')][_0xfab7('0x41')]+'%'};return _0x1ca6ed;}})});}_0x1372ff=_[_0xfab7('0x42')]({},_0x1372ff,_0x50987b[_0xfab7('0x48')]);var _0x3b9c47={'where':_0x1372ff[_0xfab7('0x43')]};return db[_0xfab7('0x32')][_0xfab7('0x26')](_0x3b9c47)[_0xfab7('0x1b')](function(_0x166a6e){_0x2c9e94[_0xfab7('0x26')]=_0x166a6e;if(_0x50987b[_0xfab7('0x35')][_0xfab7('0x49')]){_0x1372ff[_0xfab7('0x4a')]=[{'all':!![]}];}return db[_0xfab7('0x32')][_0xfab7('0x4b')](_0x1372ff);})[_0xfab7('0x1b')](function(_0x31754e){_0x2c9e94[_0xfab7('0x4c')]=_0x31754e;return _0x2c9e94;})[_0xfab7('0x1b')](respondWithFilteredResult(_0x505433,_0x1372ff))[_0xfab7('0x4d')](handleError(_0x505433,null));};exports['show']=function(_0x20a0ae,_0x2d9d19){var _0xf2a0f7={'raw':![],'where':{'id':_0x20a0ae[_0xfab7('0x4e')]['id']}},_0x2eab54={};_0x2eab54['model']=_[_0xfab7('0x36')](db[_0xfab7('0x32')][_0xfab7('0x33')]);_0x2eab54[_0xfab7('0x35')]=_[_0xfab7('0x36')](_0x20a0ae['query']);_0x2eab54['filters']=_[_0xfab7('0x38')](_0x2eab54[_0xfab7('0x34')],_0x2eab54['query']);_0xf2a0f7[_0xfab7('0x39')]=_[_0xfab7('0x38')](_0x2eab54['model'],qs[_0xfab7('0x3a')](_0x20a0ae[_0xfab7('0x35')][_0xfab7('0x3a')]));_0xf2a0f7[_0xfab7('0x39')]=_0xf2a0f7[_0xfab7('0x39')][_0xfab7('0x3b')]?_0xf2a0f7[_0xfab7('0x39')]:_0x2eab54[_0xfab7('0x34')];if(_0x20a0ae['query'][_0xfab7('0x49')]){_0xf2a0f7[_0xfab7('0x4a')]=[{'all':!![]}];}_0xf2a0f7=_[_0xfab7('0x42')]({},_0xf2a0f7,_0x20a0ae[_0xfab7('0x48')]);return db[_0xfab7('0x32')]['find'](_0xf2a0f7)[_0xfab7('0x1b')](handleEntityNotFound(_0x2d9d19,null))[_0xfab7('0x1b')](respondWithResult(_0x2d9d19,null))[_0xfab7('0x4d')](handleError(_0x2d9d19,null));};exports['create']=function(_0xf158eb,_0x35f844){return db['FreshdeskConfiguration'][_0xfab7('0x4f')](_0xf158eb[_0xfab7('0x50')],{})['then'](respondWithResult(_0x35f844,0xc9))[_0xfab7('0x4d')](handleError(_0x35f844,null));};exports['update']=function(_0x308020,_0x44fa1c){if(_0x308020[_0xfab7('0x50')]['id']){delete _0x308020[_0xfab7('0x50')]['id'];}return db[_0xfab7('0x32')]['find']({'where':{'id':_0x308020['params']['id']}})['then'](handleEntityNotFound(_0x44fa1c,null))[_0xfab7('0x1b')](saveUpdates(_0x308020[_0xfab7('0x50')],null))[_0xfab7('0x1b')](respondWithResult(_0x44fa1c,null))[_0xfab7('0x4d')](handleError(_0x44fa1c,null));};exports[_0xfab7('0x2e')]=function(_0x4e0e30,_0x4f91ae){return db[_0xfab7('0x32')]['find']({'where':{'id':_0x4e0e30[_0xfab7('0x4e')]['id']}})['then'](handleEntityNotFound(_0x4f91ae,null))[_0xfab7('0x1b')](removeEntity(_0x4f91ae,null))['catch'](handleError(_0x4f91ae,null));};exports[_0xfab7('0x51')]=function(_0x58d582,_0x1a6ba7,_0x2e8289){var _0x1f6d1f={};var _0x3653f8={};var _0x1600a4;var _0x1c5131;return db['FreshdeskConfiguration']['findOne']({'where':{'id':_0x58d582[_0xfab7('0x4e')]['id']}})[_0xfab7('0x1b')](handleEntityNotFound(_0x1a6ba7,null))[_0xfab7('0x1b')](function(_0x110a2a){if(_0x110a2a){_0x1600a4=_0x110a2a;_0x3653f8[_0xfab7('0x34')]=_['keys'](db['FreshdeskField'][_0xfab7('0x33')]);_0x3653f8['query']=_['keys'](_0x58d582['query']);_0x3653f8[_0xfab7('0x37')]=_[_0xfab7('0x38')](_0x3653f8[_0xfab7('0x34')],_0x3653f8[_0xfab7('0x35')]);_0x1f6d1f['attributes']=_['intersection'](_0x3653f8[_0xfab7('0x34')],qs[_0xfab7('0x3a')](_0x58d582[_0xfab7('0x35')]['fields']));_0x1f6d1f[_0xfab7('0x39')]=_0x1f6d1f[_0xfab7('0x39')]['length']?_0x1f6d1f[_0xfab7('0x39')]:_0x3653f8[_0xfab7('0x34')];_0x1f6d1f[_0xfab7('0x3e')]=qs['sort'](_0x58d582[_0xfab7('0x35')]['sort']);_0x1f6d1f[_0xfab7('0x43')]=qs[_0xfab7('0x37')](_['pick'](_0x58d582[_0xfab7('0x35')],_0x3653f8[_0xfab7('0x37')]));if(_0x58d582[_0xfab7('0x35')][_0xfab7('0x41')]){_0x1f6d1f['where']=_['merge'](_0x1f6d1f[_0xfab7('0x43')],{'$or':_[_0xfab7('0x44')](_0x1f6d1f[_0xfab7('0x39')],function(_0x20308b){var _0x83241d={};_0x83241d[_0x20308b]={'$like':'%'+_0x58d582[_0xfab7('0x35')][_0xfab7('0x41')]+'%'};return _0x83241d;})});}_0x1f6d1f=_['merge']({},_0x1f6d1f,_0x58d582[_0xfab7('0x48')]);return _0x1600a4['getFields'](_0x1f6d1f);}})['then'](function(_0xd89ce0){if(_0xd89ce0){_0x1c5131=_0xd89ce0[_0xfab7('0x3b')];if(!_0x58d582[_0xfab7('0x35')][_0xfab7('0x3c')](_0xfab7('0x3d'))){_0x1f6d1f[_0xfab7('0x28')]=qs['limit'](_0x58d582['query'][_0xfab7('0x28')]);_0x1f6d1f[_0xfab7('0x27')]=qs[_0xfab7('0x27')](_0x58d582[_0xfab7('0x35')][_0xfab7('0x27')]);}return _0x1600a4[_0xfab7('0x51')](_0x1f6d1f);}})[_0xfab7('0x1b')](function(_0x236f15){if(_0x236f15){return _0x236f15?{'count':_0x1c5131,'rows':_0x236f15}:null;}})['then'](respondWithResult(_0x1a6ba7,null))['catch'](handleError(_0x1a6ba7,null));};exports[_0xfab7('0x52')]=function(_0x58007b,_0x2c845b,_0x24bbb7){var _0x5d47e5={};var _0x3abceb={};var _0x1661bb;var _0x3025b7;return db[_0xfab7('0x32')][_0xfab7('0x53')]({'where':{'id':_0x58007b[_0xfab7('0x4e')]['id']}})[_0xfab7('0x1b')](handleEntityNotFound(_0x2c845b,null))[_0xfab7('0x1b')](function(_0x278e51){if(_0x278e51){_0x1661bb=_0x278e51;_0x3abceb[_0xfab7('0x34')]=_['keys'](db[_0xfab7('0x54')][_0xfab7('0x33')]);_0x3abceb[_0xfab7('0x35')]=_['keys'](_0x58007b[_0xfab7('0x35')]);_0x3abceb[_0xfab7('0x37')]=_[_0xfab7('0x38')](_0x3abceb[_0xfab7('0x34')],_0x3abceb[_0xfab7('0x35')]);_0x5d47e5[_0xfab7('0x39')]=_[_0xfab7('0x38')](_0x3abceb[_0xfab7('0x34')],qs['fields'](_0x58007b[_0xfab7('0x35')][_0xfab7('0x3a')]));_0x5d47e5[_0xfab7('0x39')]=_0x5d47e5[_0xfab7('0x39')][_0xfab7('0x3b')]?_0x5d47e5[_0xfab7('0x39')]:_0x3abceb[_0xfab7('0x34')];_0x5d47e5['order']=qs[_0xfab7('0x3f')](_0x58007b[_0xfab7('0x35')]['sort']);_0x5d47e5[_0xfab7('0x43')]=qs[_0xfab7('0x37')](_[_0xfab7('0x40')](_0x58007b['query'],_0x3abceb[_0xfab7('0x37')]));if(_0x58007b[_0xfab7('0x35')][_0xfab7('0x41')]){_0x5d47e5[_0xfab7('0x43')]=_[_0xfab7('0x42')](_0x5d47e5[_0xfab7('0x43')],{'$or':_[_0xfab7('0x44')](_0x5d47e5[_0xfab7('0x39')],function(_0x450112){var _0xde9d0={};_0xde9d0[_0x450112]={'$like':'%'+_0x58007b['query'][_0xfab7('0x41')]+'%'};return _0xde9d0;})});}_0x5d47e5=_[_0xfab7('0x42')]({},_0x5d47e5,_0x58007b[_0xfab7('0x48')]);return _0x1661bb['getSubjects'](_0x5d47e5);}})[_0xfab7('0x1b')](function(_0x5988ae){if(_0x5988ae){_0x3025b7=_0x5988ae[_0xfab7('0x3b')];if(!_0x58007b[_0xfab7('0x35')][_0xfab7('0x3c')](_0xfab7('0x3d'))){_0x5d47e5[_0xfab7('0x28')]=qs[_0xfab7('0x28')](_0x58007b[_0xfab7('0x35')][_0xfab7('0x28')]);_0x5d47e5[_0xfab7('0x27')]=qs[_0xfab7('0x27')](_0x58007b[_0xfab7('0x35')][_0xfab7('0x27')]);}return _0x1661bb[_0xfab7('0x52')](_0x5d47e5);}})[_0xfab7('0x1b')](function(_0x2bfbd7){if(_0x2bfbd7){return _0x2bfbd7?{'count':_0x3025b7,'rows':_0x2bfbd7}:null;}})[_0xfab7('0x1b')](respondWithResult(_0x2c845b,null))[_0xfab7('0x4d')](handleError(_0x2c845b,null));};exports['getDescriptions']=function(_0x341e99,_0x24fafe,_0x73878e){var _0x5eab19={};var _0x5b555a={};var _0x52d9ad;var _0x1640a7;return db[_0xfab7('0x32')][_0xfab7('0x53')]({'where':{'id':_0x341e99[_0xfab7('0x4e')]['id']}})[_0xfab7('0x1b')](handleEntityNotFound(_0x24fafe,null))['then'](function(_0x745307){if(_0x745307){_0x52d9ad=_0x745307;_0x5b555a['model']=_[_0xfab7('0x36')](db['FreshdeskField'][_0xfab7('0x33')]);_0x5b555a[_0xfab7('0x35')]=_[_0xfab7('0x36')](_0x341e99[_0xfab7('0x35')]);_0x5b555a['filters']=_[_0xfab7('0x38')](_0x5b555a['model'],_0x5b555a[_0xfab7('0x35')]);_0x5eab19[_0xfab7('0x39')]=_[_0xfab7('0x38')](_0x5b555a[_0xfab7('0x34')],qs['fields'](_0x341e99[_0xfab7('0x35')]['fields']));_0x5eab19['attributes']=_0x5eab19['attributes'][_0xfab7('0x3b')]?_0x5eab19[_0xfab7('0x39')]:_0x5b555a[_0xfab7('0x34')];_0x5eab19[_0xfab7('0x3e')]=qs[_0xfab7('0x3f')](_0x341e99[_0xfab7('0x35')][_0xfab7('0x3f')]);_0x5eab19[_0xfab7('0x43')]=qs[_0xfab7('0x37')](_[_0xfab7('0x40')](_0x341e99[_0xfab7('0x35')],_0x5b555a['filters']));if(_0x341e99[_0xfab7('0x35')][_0xfab7('0x41')]){_0x5eab19[_0xfab7('0x43')]=_['merge'](_0x5eab19[_0xfab7('0x43')],{'$or':_[_0xfab7('0x44')](_0x5eab19[_0xfab7('0x39')],function(_0x1b9ace){var _0x1729d7={};_0x1729d7[_0x1b9ace]={'$like':'%'+_0x341e99[_0xfab7('0x35')][_0xfab7('0x41')]+'%'};return _0x1729d7;})});}_0x5eab19=_[_0xfab7('0x42')]({},_0x5eab19,_0x341e99[_0xfab7('0x48')]);return _0x52d9ad[_0xfab7('0x55')](_0x5eab19);}})[_0xfab7('0x1b')](function(_0x5e624a){if(_0x5e624a){_0x1640a7=_0x5e624a[_0xfab7('0x3b')];if(!_0x341e99[_0xfab7('0x35')][_0xfab7('0x3c')](_0xfab7('0x3d'))){_0x5eab19[_0xfab7('0x28')]=qs[_0xfab7('0x28')](_0x341e99[_0xfab7('0x35')]['limit']);_0x5eab19[_0xfab7('0x27')]=qs[_0xfab7('0x27')](_0x341e99[_0xfab7('0x35')][_0xfab7('0x27')]);}return _0x52d9ad[_0xfab7('0x55')](_0x5eab19);}})[_0xfab7('0x1b')](function(_0x233164){if(_0x233164){return _0x233164?{'count':_0x1640a7,'rows':_0x233164}:null;}})['then'](respondWithResult(_0x24fafe,null))[_0xfab7('0x4d')](handleError(_0x24fafe,null));};exports['getTags']=function(_0x1067ac,_0x5e08ef,_0x3f660c){var _0xe2cbf1={};var _0x4738ba={};var _0x74b453;var _0x53c832;return db[_0xfab7('0x32')][_0xfab7('0x53')]({'where':{'id':_0x1067ac[_0xfab7('0x4e')]['id']}})['then'](handleEntityNotFound(_0x5e08ef,null))[_0xfab7('0x1b')](function(_0x506b4d){if(_0x506b4d){_0x74b453=_0x506b4d;_0x4738ba['model']=_[_0xfab7('0x36')](db[_0xfab7('0x56')][_0xfab7('0x33')]);_0x4738ba[_0xfab7('0x35')]=_[_0xfab7('0x36')](_0x1067ac['query']);_0x4738ba[_0xfab7('0x37')]=_[_0xfab7('0x38')](_0x4738ba[_0xfab7('0x34')],_0x4738ba[_0xfab7('0x35')]);_0xe2cbf1[_0xfab7('0x39')]=_[_0xfab7('0x38')](_0x4738ba['model'],qs[_0xfab7('0x3a')](_0x1067ac[_0xfab7('0x35')][_0xfab7('0x3a')]));_0xe2cbf1['attributes']=_0xe2cbf1['attributes'][_0xfab7('0x3b')]?_0xe2cbf1['attributes']:_0x4738ba[_0xfab7('0x34')];_0xe2cbf1[_0xfab7('0x3e')]=qs[_0xfab7('0x3f')](_0x1067ac[_0xfab7('0x35')][_0xfab7('0x3f')]);_0xe2cbf1[_0xfab7('0x43')]=qs[_0xfab7('0x37')](_['pick'](_0x1067ac[_0xfab7('0x35')],_0x4738ba[_0xfab7('0x37')]));if(_0x1067ac[_0xfab7('0x35')][_0xfab7('0x41')]){_0xe2cbf1[_0xfab7('0x43')]=_[_0xfab7('0x42')](_0xe2cbf1['where'],{'$or':_['map'](_0xe2cbf1[_0xfab7('0x39')],function(_0x10c052){var _0x53ab8e={};_0x53ab8e[_0x10c052]={'$like':'%'+_0x1067ac['query'][_0xfab7('0x41')]+'%'};return _0x53ab8e;})});}_0xe2cbf1=_[_0xfab7('0x42')]({},_0xe2cbf1,_0x1067ac[_0xfab7('0x48')]);return _0x74b453[_0xfab7('0x57')](_0xe2cbf1);}})[_0xfab7('0x1b')](function(_0x1a2138){if(_0x1a2138){_0x53c832=_0x1a2138[_0xfab7('0x3b')];if(!_0x1067ac[_0xfab7('0x35')][_0xfab7('0x3c')]('nolimit')){_0xe2cbf1['limit']=qs[_0xfab7('0x28')](_0x1067ac['query'][_0xfab7('0x28')]);_0xe2cbf1[_0xfab7('0x27')]=qs[_0xfab7('0x27')](_0x1067ac['query'][_0xfab7('0x27')]);}return _0x74b453['getTags'](_0xe2cbf1);}})[_0xfab7('0x1b')](function(_0x1487dd){if(_0x1487dd){return _0x1487dd?{'count':_0x53c832,'rows':_0x1487dd}:null;}})[_0xfab7('0x1b')](respondWithResult(_0x5e08ef,null))[_0xfab7('0x4d')](handleError(_0x5e08ef,null));};exports[_0xfab7('0x58')]=function(_0x1d14f0,_0x4779cc,_0x22af8f){if(_0x1d14f0[_0xfab7('0x50')]['id']){delete _0x1d14f0[_0xfab7('0x50')]['id'];}return db[_0xfab7('0x32')][_0xfab7('0x53')]({'where':{'id':_0x1d14f0['params']['id']}})[_0xfab7('0x1b')](handleEntityNotFound(_0x4779cc,null))['then'](function(_0x43754f){if(_0x43754f){return _0x43754f[_0xfab7('0x58')](_0x1d14f0[_0xfab7('0x50')][_0xfab7('0x59')]||[]);}return null;})['then'](respondWithResult(_0x4779cc,null))[_0xfab7('0x4d')](handleError(_0x4779cc,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js index fadc18d..6835606 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 _0x7221=['int_freshdesk_configurations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshdeskConfiguration.attributes','exports','define','FreshdeskConfiguration'];(function(_0x5c6994,_0x19ad9a){var _0x1d5c84=function(_0x4a385a){while(--_0x4a385a){_0x5c6994['push'](_0x5c6994['shift']());}};_0x1d5c84(++_0x19ad9a);}(_0x7221,0xe2));var _0x1722=function(_0x3d0198,_0x94b95c){_0x3d0198=_0x3d0198-0x0;var _0x3488b2=_0x7221[_0x3d0198];return _0x3488b2;};'use strict';var _=require(_0x1722('0x0'));var util=require(_0x1722('0x1'));var logger=require(_0x1722('0x2'))(_0x1722('0x3'));var moment=require(_0x1722('0x4'));var BPromise=require(_0x1722('0x5'));var rp=require(_0x1722('0x6'));var fs=require('fs');var path=require(_0x1722('0x7'));var rimraf=require(_0x1722('0x8'));var config=require(_0x1722('0x9'));var attributes=require(_0x1722('0xa'));module[_0x1722('0xb')]=function(_0x595321,_0x16d814){return _0x595321[_0x1722('0xc')](_0x1722('0xd'),attributes,{'tableName':_0x1722('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6716=['path','../../config/environment','./intFreshdeskConfiguration.attributes','define','FreshdeskConfiguration','int_freshdesk_configurations','lodash','../../config/logger','moment','bluebird'];(function(_0x449a54,_0x4b9225){var _0x352151=function(_0x28e08c){while(--_0x28e08c){_0x449a54['push'](_0x449a54['shift']());}};_0x352151(++_0x4b9225);}(_0x6716,0x182));var _0x6671=function(_0x533ec3,_0xd62d7d){_0x533ec3=_0x533ec3-0x0;var _0x28d6d8=_0x6716[_0x533ec3];return _0x28d6d8;};'use strict';var _=require(_0x6671('0x0'));var util=require('util');var logger=require(_0x6671('0x1'))('api');var moment=require(_0x6671('0x2'));var BPromise=require(_0x6671('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6671('0x4'));var rimraf=require('rimraf');var config=require(_0x6671('0x5'));var attributes=require(_0x6671('0x6'));module['exports']=function(_0x359b02,_0x4aa631){return _0x359b02[_0x6671('0x7')](_0x6671('0x8'),attributes,{'tableName':_0x6671('0x9'),'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 3a0af15..83a2577 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 _0x1c2c=['FreshdeskConfiguration,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','client','request','then','info'];(function(_0x19b682,_0x254bbd){var _0x5a913e=function(_0x1d5189){while(--_0x1d5189){_0x19b682['push'](_0x19b682['shift']());}};_0x5a913e(++_0x254bbd);}(_0x1c2c,0x171));var _0xc1c2=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x1c2c[_0x3b380d];return _0x54502b;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xc1c2('0x0'));var rs=require(_0xc1c2('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc1c2('0x2'))['db'];var utils=require(_0xc1c2('0x3'));var logger=require(_0xc1c2('0x4'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xc1c2('0x5')]['http']({'port':0x232a});function respondWithRpcPromise(_0x243582,_0x4c5fae,_0x3acaf9){return new BPromise(function(_0x16c92e,_0x384417){return client[_0xc1c2('0x6')](_0x243582,_0x3acaf9)[_0xc1c2('0x7')](function(_0x121f6d){logger[_0xc1c2('0x8')](_0xc1c2('0x9'),_0x4c5fae,'request\x20sent');logger[_0xc1c2('0xa')]('FreshdeskConfiguration,\x20%s,\x20%s,\x20%s',_0x4c5fae,_0xc1c2('0xb'),JSON[_0xc1c2('0xc')](_0x121f6d));if(_0x121f6d[_0xc1c2('0xd')]){if(_0x121f6d['error'][_0xc1c2('0xe')]===0x1f4){logger[_0xc1c2('0xd')](_0xc1c2('0x9'),_0x4c5fae,_0x121f6d[_0xc1c2('0xd')][_0xc1c2('0xf')]);return _0x384417(_0x121f6d['error'][_0xc1c2('0xf')]);}logger[_0xc1c2('0xd')](_0xc1c2('0x9'),_0x4c5fae,_0x121f6d['error'][_0xc1c2('0xf')]);return _0x16c92e(_0x121f6d['error']['message']);}else{logger[_0xc1c2('0x8')](_0xc1c2('0x9'),_0x4c5fae,_0xc1c2('0xb'));_0x16c92e(_0x121f6d[_0xc1c2('0x10')][_0xc1c2('0xf')]);}})[_0xc1c2('0x11')](function(_0x15a848){logger[_0xc1c2('0xd')](_0xc1c2('0x9'),_0x4c5fae,_0x15a848);_0x384417(_0x15a848);});});} \ No newline at end of file +var _0x76e1=['lodash','util','moment','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','info','request\x20sent','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','FreshdeskConfiguration,\x20%s,\x20%s','message','catch'];(function(_0x3dde2e,_0x3998d2){var _0x2b2d52=function(_0x42b3c4){while(--_0x42b3c4){_0x3dde2e['push'](_0x3dde2e['shift']());}};_0x2b2d52(++_0x3998d2);}(_0x76e1,0x1cc));var _0x176e=function(_0xf1fdad,_0x17afa9){_0xf1fdad=_0xf1fdad-0x0;var _0x16670b=_0x76e1[_0xf1fdad];return _0x16670b;};'use strict';var _=require(_0x176e('0x0'));var util=require(_0x176e('0x1'));var moment=require(_0x176e('0x2'));var BPromise=require('bluebird');var rs=require(_0x176e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x176e('0x4'));var logger=require(_0x176e('0x5'))(_0x176e('0x6'));var config=require(_0x176e('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x176e('0x8')][_0x176e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x45a4bd,_0x4626e1,_0x85b430){return new BPromise(function(_0x1b3e95,_0x21c18b){return client[_0x176e('0xa')](_0x45a4bd,_0x85b430)['then'](function(_0x253556){logger[_0x176e('0xb')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x4626e1,_0x176e('0xc'));logger['debug'](_0x176e('0xd'),_0x4626e1,_0x176e('0xc'),JSON[_0x176e('0xe')](_0x253556));if(_0x253556[_0x176e('0xf')]){if(_0x253556[_0x176e('0xf')][_0x176e('0x10')]===0x1f4){logger[_0x176e('0xf')](_0x176e('0x11'),_0x4626e1,_0x253556[_0x176e('0xf')][_0x176e('0x12')]);return _0x21c18b(_0x253556['error'][_0x176e('0x12')]);}logger[_0x176e('0xf')](_0x176e('0x11'),_0x4626e1,_0x253556[_0x176e('0xf')][_0x176e('0x12')]);return _0x1b3e95(_0x253556[_0x176e('0xf')][_0x176e('0x12')]);}else{logger[_0x176e('0xb')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x4626e1,_0x176e('0xc'));_0x1b3e95(_0x253556['result'][_0x176e('0x12')]);}})[_0x176e('0x13')](function(_0x4a9b11){logger[_0x176e('0xf')](_0x176e('0x11'),_0x4626e1,_0x4a9b11);_0x21c18b(_0x4a9b11);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskField/index.js b/server/api/intFreshdeskField/index.js index 2716a82..50dbec9 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 _0x008c=['show','destroy','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskField.controller','get','isAuthenticated','index','/:id'];(function(_0x5c78cd,_0x4693b4){var _0x34c619=function(_0x1bf75d){while(--_0x1bf75d){_0x5c78cd['push'](_0x5c78cd['shift']());}};_0x34c619(++_0x4693b4);}(_0x008c,0x188));var _0xc008=function(_0x4e1bc0,_0x2fd996){_0x4e1bc0=_0x4e1bc0-0x0;var _0x151f70=_0x008c[_0x4e1bc0];return _0x151f70;};'use strict';var multer=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var path=require(_0xc008('0x2'));var timeout=require(_0xc008('0x3'));var express=require(_0xc008('0x4'));var router=express['Router']();var auth=require(_0xc008('0x5'));var interaction=require(_0xc008('0x6'));var config=require(_0xc008('0x7'));var controller=require(_0xc008('0x8'));router[_0xc008('0x9')]('/',auth[_0xc008('0xa')](),controller[_0xc008('0xb')]);router[_0xc008('0x9')](_0xc008('0xc'),auth['isAuthenticated'](),controller[_0xc008('0xd')]);router['post']('/',auth[_0xc008('0xa')](),controller['create']);router['put'](_0xc008('0xc'),auth[_0xc008('0xa')](),controller['update']);router['delete']('/:id',auth[_0xc008('0xa')](),controller[_0xc008('0xe')]);module['exports']=router; \ No newline at end of file +var _0xa9e0=['/:id','update','delete','multer','util','path','Router','../../components/interaction/service','../../config/environment','./intFreshdeskField.controller','get','isAuthenticated'];(function(_0x2d0e14,_0x49647b){var _0xf6f349=function(_0x3b8aa6){while(--_0x3b8aa6){_0x2d0e14['push'](_0x2d0e14['shift']());}};_0xf6f349(++_0x49647b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0xa9e0[_0x484e36];return _0xafc85d;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x0a9e('0x4'));var config=require(_0x0a9e('0x5'));var controller=require(_0x0a9e('0x6'));router[_0x0a9e('0x7')]('/',auth[_0x0a9e('0x8')](),controller['index']);router[_0x0a9e('0x7')](_0x0a9e('0x9'),auth[_0x0a9e('0x8')](),controller['show']);router['post']('/',auth[_0x0a9e('0x8')](),controller['create']);router['put'](_0x0a9e('0x9'),auth[_0x0a9e('0x8')](),controller[_0x0a9e('0xa')]);router[_0x0a9e('0xb')](_0x0a9e('0x9'),auth[_0x0a9e('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.attributes.js b/server/api/intFreshdeskField/intFreshdeskField.attributes.js index 66fa62c..f0e8fad 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 _0x8664=['keyValue','STRING','BOOLEAN','sequelize','exports','ENUM','string','variable','customVariable'];(function(_0x33c123,_0x551ca1){var _0x54959b=function(_0xcf54dd){while(--_0xcf54dd){_0x33c123['push'](_0x33c123['shift']());}};_0x54959b(++_0x551ca1);}(_0x8664,0x11a));var _0x4866=function(_0x23eabd,_0x394b84){_0x23eabd=_0x23eabd-0x0;var _0x13f638=_0x8664[_0x23eabd];return _0x13f638;};'use strict';var Sequelize=require(_0x4866('0x0'));module[_0x4866('0x1')]={'type':{'type':Sequelize[_0x4866('0x2')](_0x4866('0x3'),_0x4866('0x4'),_0x4866('0x5'),_0x4866('0x6')),'defaultValue':_0x4866('0x3')},'content':{'type':Sequelize[_0x4866('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x4866('0x2')]('string',_0x4866('0x4'),_0x4866('0x5'))},'keyContent':{'type':Sequelize[_0x4866('0x7')]},'idField':{'type':Sequelize[_0x4866('0x7')]},'nameField':{'type':Sequelize[_0x4866('0x7')]},'customField':{'type':Sequelize[_0x4866('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x6108=['STRING','customVariable','sequelize','ENUM','string','variable'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x6108,0xbc));var _0x8610=function(_0x2570cb,_0x4031dc){_0x2570cb=_0x2570cb-0x0;var _0x1584e1=_0x6108[_0x2570cb];return _0x1584e1;};'use strict';var Sequelize=require(_0x8610('0x0'));module['exports']={'type':{'type':Sequelize[_0x8610('0x1')](_0x8610('0x2'),_0x8610('0x3'),'customVariable','keyValue'),'defaultValue':_0x8610('0x2')},'content':{'type':Sequelize[_0x8610('0x4')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM'](_0x8610('0x2'),_0x8610('0x3'),_0x8610('0x5'))},'keyContent':{'type':Sequelize[_0x8610('0x4')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x8610('0x4')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x8610('0x4')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.controller.js b/server/api/intFreshdeskField/intFreshdeskField.controller.js index 75c0cb4..8d5b673 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 _0x7bae=['index','FreshdeskField','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','limit','sort','pick','filter','merge','where','type','key','field','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset','Content-Range','apply','reject','save','update','then','destroy','error','send'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x7bae,0x13b));var _0xe7ba=function(_0x4ae625,_0xf396d0){_0x4ae625=_0x4ae625-0x0;var _0x31accf=_0x7bae[_0x4ae625];return _0x31accf;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0xe7ba('0x0'));var zipdir=require(_0xe7ba('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe7ba('0x2'));var moment=require('moment');var BPromise=require(_0xe7ba('0x3'));var Mustache=require(_0xe7ba('0x4'));var util=require(_0xe7ba('0x5'));var path=require(_0xe7ba('0x6'));var sox=require(_0xe7ba('0x7'));var csv=require(_0xe7ba('0x8'));var ejs=require(_0xe7ba('0x9'));var fs=require('fs');var _=require(_0xe7ba('0xa'));var squel=require(_0xe7ba('0xb'));var crypto=require(_0xe7ba('0xc'));var jsforce=require(_0xe7ba('0xd'));var deskjs=require(_0xe7ba('0xe'));var toCsv=require(_0xe7ba('0x8'));var querystring=require(_0xe7ba('0xf'));var Papa=require('papaparse');var Redis=require(_0xe7ba('0x10'));var authService=require(_0xe7ba('0x11'));var qs=require(_0xe7ba('0x12'));var as=require(_0xe7ba('0x13'));var hardwareService=require(_0xe7ba('0x14'));var logger=require(_0xe7ba('0x15'))(_0xe7ba('0x16'));var utils=require(_0xe7ba('0x17'));var config=require(_0xe7ba('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xf4fcb0,_0x588c8b){_0x588c8b=_0x588c8b||0xcc;return function(_0x602b1){if(_0x602b1){return _0xf4fcb0[_0xe7ba('0x19')](_0x588c8b);}return _0xf4fcb0[_0xe7ba('0x1a')](_0x588c8b)[_0xe7ba('0x1b')]();};}function respondWithResult(_0x15d018,_0x41369f){_0x41369f=_0x41369f||0xc8;return function(_0x561dbb){if(_0x561dbb){return _0x15d018['status'](_0x41369f)[_0xe7ba('0x1c')](_0x561dbb);}};}function respondWithFilteredResult(_0x7ba72a,_0x359f6f){return function(_0x5d1d03){if(_0x5d1d03){var _0x4390e3=_0x5d1d03[_0xe7ba('0x1d')],_0x4b20fd=_0x359f6f['offset'],_0x590bab=_0x359f6f[_0xe7ba('0x1e')]+_0x359f6f['limit'],_0x5e9176;if(_0x590bab>=_0x4390e3){_0x590bab=_0x4390e3;_0x5e9176=0xc8;}else{_0x5e9176=0xce;}_0x7ba72a['status'](_0x5e9176);return _0x7ba72a['set'](_0xe7ba('0x1f'),_0x4b20fd+'-'+_0x590bab+'/'+_0x4390e3)[_0xe7ba('0x1c')](_0x5d1d03);}return null;};}function patchUpdates(_0x39ca38){return function(_0x3c06c3){try{jsonpatch[_0xe7ba('0x20')](_0x3c06c3,_0x39ca38,!![]);}catch(_0x58550c){return BPromise[_0xe7ba('0x21')](_0x58550c);}return _0x3c06c3[_0xe7ba('0x22')]();};}function saveUpdates(_0x3b40fb,_0x136ec6){return function(_0x4aaf35){if(_0x4aaf35){return _0x4aaf35[_0xe7ba('0x23')](_0x3b40fb)[_0xe7ba('0x24')](function(_0x5a158f){return _0x5a158f;});}return null;};}function removeEntity(_0x191863,_0x4514e8){return function(_0x27c882){if(_0x27c882){return _0x27c882[_0xe7ba('0x25')]()[_0xe7ba('0x24')](function(){_0x191863[_0xe7ba('0x1a')](0xcc)[_0xe7ba('0x1b')]();});}};}function handleEntityNotFound(_0x2b29f0,_0x41cbd9){return function(_0xa72f1c){if(!_0xa72f1c){_0x2b29f0['sendStatus'](0x194);}return _0xa72f1c;};}function handleError(_0x48b481,_0x4dcc7b){_0x4dcc7b=_0x4dcc7b||0x1f4;return function(_0x4cd124){logger[_0xe7ba('0x26')](_0x4cd124['stack']);if(_0x4cd124['name']){delete _0x4cd124['name'];}_0x48b481[_0xe7ba('0x1a')](_0x4dcc7b)[_0xe7ba('0x27')](_0x4cd124);};}exports[_0xe7ba('0x28')]=function(_0x2ea78a,_0x3435c6){var _0xc88099={},_0x4ed792={},_0x3a59d6={'count':0x0,'rows':[]};var _0x47be66=db[_0xe7ba('0x29')]['rawAttributes'];_0x4ed792[_0xe7ba('0x2a')]=_[_0xe7ba('0x2b')](_0x47be66);_0x4ed792[_0xe7ba('0x2c')]=_['keys'](_0x2ea78a['query']);_0x4ed792[_0xe7ba('0x2d')]=_[_0xe7ba('0x2e')](_0x4ed792[_0xe7ba('0x2a')],_0x4ed792[_0xe7ba('0x2c')]);_0xc88099[_0xe7ba('0x2f')]=_['intersection'](_0x4ed792[_0xe7ba('0x2a')],qs[_0xe7ba('0x30')](_0x2ea78a['query'][_0xe7ba('0x30')]));_0xc88099['attributes']=_0xc88099['attributes'][_0xe7ba('0x31')]?_0xc88099[_0xe7ba('0x2f')]:_0x4ed792[_0xe7ba('0x2a')];if(!_0x2ea78a['query'][_0xe7ba('0x32')]('nolimit')){_0xc88099[_0xe7ba('0x33')]=qs[_0xe7ba('0x33')](_0x2ea78a[_0xe7ba('0x2c')][_0xe7ba('0x33')]);_0xc88099[_0xe7ba('0x1e')]=qs['offset'](_0x2ea78a[_0xe7ba('0x2c')][_0xe7ba('0x1e')]);}_0xc88099['order']=qs[_0xe7ba('0x34')](_0x2ea78a[_0xe7ba('0x2c')][_0xe7ba('0x34')]);_0xc88099['where']=qs[_0xe7ba('0x2d')](_[_0xe7ba('0x35')](_0x2ea78a['query'],_0x4ed792[_0xe7ba('0x2d')]));if(_0x2ea78a[_0xe7ba('0x2c')][_0xe7ba('0x36')]){_0xc88099['where']=_[_0xe7ba('0x37')](_0xc88099[_0xe7ba('0x38')],{'$or':_['map'](_0x47be66,function(_0x330e98){if(_0x330e98[_0xe7ba('0x39')][_0xe7ba('0x3a')]!=='VIRTUAL'){var _0x4d7741={};_0x4d7741[_0x330e98[_0xe7ba('0x3b')]]={'$like':'%'+_0x2ea78a[_0xe7ba('0x2c')][_0xe7ba('0x36')]+'%'};return _0x4d7741;}})});}_0xc88099=_[_0xe7ba('0x37')]({},_0xc88099,_0x2ea78a[_0xe7ba('0x3c')]);var _0x5f3edd={'where':_0xc88099[_0xe7ba('0x38')]};return db[_0xe7ba('0x29')][_0xe7ba('0x1d')](_0x5f3edd)[_0xe7ba('0x24')](function(_0x5e9619){_0x3a59d6[_0xe7ba('0x1d')]=_0x5e9619;if(_0x2ea78a[_0xe7ba('0x2c')][_0xe7ba('0x3d')]){_0xc88099[_0xe7ba('0x3e')]=[{'all':!![]}];}return db[_0xe7ba('0x29')][_0xe7ba('0x3f')](_0xc88099);})[_0xe7ba('0x24')](function(_0x4e22f3){_0x3a59d6[_0xe7ba('0x40')]=_0x4e22f3;return _0x3a59d6;})[_0xe7ba('0x24')](respondWithFilteredResult(_0x3435c6,_0xc88099))[_0xe7ba('0x41')](handleError(_0x3435c6,null));};exports[_0xe7ba('0x42')]=function(_0xf61205,_0x3b3abe){var _0x220c3b={'raw':!![],'where':{'id':_0xf61205[_0xe7ba('0x43')]['id']}},_0x8d2cd9={};_0x8d2cd9['model']=_[_0xe7ba('0x2b')](db[_0xe7ba('0x29')]['rawAttributes']);_0x8d2cd9['query']=_[_0xe7ba('0x2b')](_0xf61205[_0xe7ba('0x2c')]);_0x8d2cd9[_0xe7ba('0x2d')]=_['intersection'](_0x8d2cd9[_0xe7ba('0x2a')],_0x8d2cd9[_0xe7ba('0x2c')]);_0x220c3b[_0xe7ba('0x2f')]=_[_0xe7ba('0x2e')](_0x8d2cd9[_0xe7ba('0x2a')],qs['fields'](_0xf61205[_0xe7ba('0x2c')]['fields']));_0x220c3b[_0xe7ba('0x2f')]=_0x220c3b[_0xe7ba('0x2f')][_0xe7ba('0x31')]?_0x220c3b[_0xe7ba('0x2f')]:_0x8d2cd9[_0xe7ba('0x2a')];if(_0xf61205[_0xe7ba('0x2c')][_0xe7ba('0x3d')]){_0x220c3b[_0xe7ba('0x3e')]=[{'all':!![]}];}_0x220c3b=_['merge']({},_0x220c3b,_0xf61205[_0xe7ba('0x3c')]);return db[_0xe7ba('0x29')][_0xe7ba('0x44')](_0x220c3b)[_0xe7ba('0x24')](handleEntityNotFound(_0x3b3abe,null))[_0xe7ba('0x24')](respondWithResult(_0x3b3abe,null))[_0xe7ba('0x41')](handleError(_0x3b3abe,null));};exports[_0xe7ba('0x45')]=function(_0x2c54ac,_0x45f49a){return db[_0xe7ba('0x29')]['create'](_0x2c54ac[_0xe7ba('0x46')],{})['then'](respondWithResult(_0x45f49a,0xc9))[_0xe7ba('0x41')](handleError(_0x45f49a,null));};exports[_0xe7ba('0x23')]=function(_0x405caa,_0x15177c){if(_0x405caa[_0xe7ba('0x46')]['id']){delete _0x405caa[_0xe7ba('0x46')]['id'];}return db['FreshdeskField'][_0xe7ba('0x44')]({'where':{'id':_0x405caa[_0xe7ba('0x43')]['id']}})[_0xe7ba('0x24')](handleEntityNotFound(_0x15177c,null))[_0xe7ba('0x24')](saveUpdates(_0x405caa[_0xe7ba('0x46')],null))[_0xe7ba('0x24')](respondWithResult(_0x15177c,null))[_0xe7ba('0x41')](handleError(_0x15177c,null));};exports[_0xe7ba('0x25')]=function(_0x272cb9,_0x1189bd){return db[_0xe7ba('0x29')]['find']({'where':{'id':_0x272cb9[_0xe7ba('0x43')]['id']}})[_0xe7ba('0x24')](handleEntityNotFound(_0x1189bd,null))[_0xe7ba('0x24')](removeEntity(_0x1189bd,null))[_0xe7ba('0x41')](handleError(_0x1189bd,null));}; \ No newline at end of file +var _0xe14d=['ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','apply','reject','update','then','destroy','error','stack','name','send','FreshdeskField','rawAttributes','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','map','type','field','options','includeAll','include','findAll','rows','catch','params','find','create','body','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','crypto','jsforce','desk.js','querystring','papaparse'];(function(_0x4c82d2,_0x3456f8){var _0x57b37f=function(_0x322778){while(--_0x322778){_0x4c82d2['push'](_0x4c82d2['shift']());}};_0x57b37f(++_0x3456f8);}(_0xe14d,0x1ee));var _0xde14=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0xe14d[_0xbca1b1];return _0x4e1686;};'use strict';var pdf=require(_0xde14('0x0'));var emlformat=require(_0xde14('0x1'));var rimraf=require(_0xde14('0x2'));var zipdir=require(_0xde14('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xde14('0x4'));var moment=require(_0xde14('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xde14('0x6'));var util=require(_0xde14('0x7'));var path=require(_0xde14('0x8'));var sox=require(_0xde14('0x9'));var csv=require(_0xde14('0xa'));var ejs=require(_0xde14('0xb'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0xde14('0xc'));var jsforce=require(_0xde14('0xd'));var deskjs=require(_0xde14('0xe'));var toCsv=require(_0xde14('0xa'));var querystring=require(_0xde14('0xf'));var Papa=require(_0xde14('0x10'));var Redis=require(_0xde14('0x11'));var authService=require(_0xde14('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xde14('0x13'));var hardwareService=require(_0xde14('0x14'));var logger=require(_0xde14('0x15'))(_0xde14('0x16'));var utils=require(_0xde14('0x17'));var config=require(_0xde14('0x18'));var db=require(_0xde14('0x19'))['db'];function respondWithStatusCode(_0x3d5a29,_0x34e28f){_0x34e28f=_0x34e28f||0xcc;return function(_0x29e3ca){if(_0x29e3ca){return _0x3d5a29[_0xde14('0x1a')](_0x34e28f);}return _0x3d5a29[_0xde14('0x1b')](_0x34e28f)[_0xde14('0x1c')]();};}function respondWithResult(_0x281c54,_0x1489e9){_0x1489e9=_0x1489e9||0xc8;return function(_0x54c58b){if(_0x54c58b){return _0x281c54['status'](_0x1489e9)[_0xde14('0x1d')](_0x54c58b);}};}function respondWithFilteredResult(_0x1db2f6,_0x26c1ec){return function(_0x4c86ff){if(_0x4c86ff){var _0x16aa55=_0x4c86ff[_0xde14('0x1e')],_0x31adb3=_0x26c1ec[_0xde14('0x1f')],_0x257390=_0x26c1ec[_0xde14('0x1f')]+_0x26c1ec[_0xde14('0x20')],_0x31902a;if(_0x257390>=_0x16aa55){_0x257390=_0x16aa55;_0x31902a=0xc8;}else{_0x31902a=0xce;}_0x1db2f6[_0xde14('0x1b')](_0x31902a);return _0x1db2f6[_0xde14('0x21')]('Content-Range',_0x31adb3+'-'+_0x257390+'/'+_0x16aa55)[_0xde14('0x1d')](_0x4c86ff);}return null;};}function patchUpdates(_0x3bfc59){return function(_0x2eb8a8){try{jsonpatch[_0xde14('0x22')](_0x2eb8a8,_0x3bfc59,!![]);}catch(_0x4ce69f){return BPromise[_0xde14('0x23')](_0x4ce69f);}return _0x2eb8a8['save']();};}function saveUpdates(_0x45d101,_0x4c24a8){return function(_0xa50687){if(_0xa50687){return _0xa50687[_0xde14('0x24')](_0x45d101)[_0xde14('0x25')](function(_0x1949ab){return _0x1949ab;});}return null;};}function removeEntity(_0x39bdc5,_0x11a4d9){return function(_0x40b648){if(_0x40b648){return _0x40b648[_0xde14('0x26')]()[_0xde14('0x25')](function(){_0x39bdc5[_0xde14('0x1b')](0xcc)[_0xde14('0x1c')]();});}};}function handleEntityNotFound(_0xbaa078,_0x8f8033){return function(_0x5ae4c1){if(!_0x5ae4c1){_0xbaa078[_0xde14('0x1a')](0x194);}return _0x5ae4c1;};}function handleError(_0x3ce77c,_0x24a390){_0x24a390=_0x24a390||0x1f4;return function(_0xbd05d6){logger[_0xde14('0x27')](_0xbd05d6[_0xde14('0x28')]);if(_0xbd05d6[_0xde14('0x29')]){delete _0xbd05d6[_0xde14('0x29')];}_0x3ce77c[_0xde14('0x1b')](_0x24a390)[_0xde14('0x2a')](_0xbd05d6);};}exports['index']=function(_0x309922,_0x1696ee){var _0x3eaee5={},_0xf8279a={},_0x5d8b4b={'count':0x0,'rows':[]};var _0x3fc2a4=db[_0xde14('0x2b')][_0xde14('0x2c')];_0xf8279a['model']=_[_0xde14('0x2d')](_0x3fc2a4);_0xf8279a['query']=_[_0xde14('0x2d')](_0x309922[_0xde14('0x2e')]);_0xf8279a[_0xde14('0x2f')]=_[_0xde14('0x30')](_0xf8279a[_0xde14('0x31')],_0xf8279a[_0xde14('0x2e')]);_0x3eaee5[_0xde14('0x32')]=_[_0xde14('0x30')](_0xf8279a['model'],qs[_0xde14('0x33')](_0x309922[_0xde14('0x2e')]['fields']));_0x3eaee5[_0xde14('0x32')]=_0x3eaee5['attributes'][_0xde14('0x34')]?_0x3eaee5[_0xde14('0x32')]:_0xf8279a[_0xde14('0x31')];if(!_0x309922[_0xde14('0x2e')][_0xde14('0x35')]('nolimit')){_0x3eaee5[_0xde14('0x20')]=qs[_0xde14('0x20')](_0x309922['query'][_0xde14('0x20')]);_0x3eaee5[_0xde14('0x1f')]=qs[_0xde14('0x1f')](_0x309922[_0xde14('0x2e')][_0xde14('0x1f')]);}_0x3eaee5[_0xde14('0x36')]=qs[_0xde14('0x37')](_0x309922[_0xde14('0x2e')][_0xde14('0x37')]);_0x3eaee5['where']=qs['filters'](_[_0xde14('0x38')](_0x309922[_0xde14('0x2e')],_0xf8279a[_0xde14('0x2f')]));if(_0x309922[_0xde14('0x2e')][_0xde14('0x39')]){_0x3eaee5[_0xde14('0x3a')]=_[_0xde14('0x3b')](_0x3eaee5[_0xde14('0x3a')],{'$or':_[_0xde14('0x3c')](_0x3fc2a4,function(_0x4e33e0){if(_0x4e33e0[_0xde14('0x3d')]['key']!=='VIRTUAL'){var _0x4c1e37={};_0x4c1e37[_0x4e33e0[_0xde14('0x3e')]]={'$like':'%'+_0x309922[_0xde14('0x2e')][_0xde14('0x39')]+'%'};return _0x4c1e37;}})});}_0x3eaee5=_[_0xde14('0x3b')]({},_0x3eaee5,_0x309922[_0xde14('0x3f')]);var _0x8b5bb4={'where':_0x3eaee5[_0xde14('0x3a')]};return db[_0xde14('0x2b')]['count'](_0x8b5bb4)[_0xde14('0x25')](function(_0x3883b9){_0x5d8b4b[_0xde14('0x1e')]=_0x3883b9;if(_0x309922[_0xde14('0x2e')][_0xde14('0x40')]){_0x3eaee5[_0xde14('0x41')]=[{'all':!![]}];}return db[_0xde14('0x2b')][_0xde14('0x42')](_0x3eaee5);})['then'](function(_0x225164){_0x5d8b4b[_0xde14('0x43')]=_0x225164;return _0x5d8b4b;})[_0xde14('0x25')](respondWithFilteredResult(_0x1696ee,_0x3eaee5))[_0xde14('0x44')](handleError(_0x1696ee,null));};exports['show']=function(_0x5ebb03,_0x75d4f1){var _0x16e7d1={'raw':!![],'where':{'id':_0x5ebb03[_0xde14('0x45')]['id']}},_0xff1bbd={};_0xff1bbd[_0xde14('0x31')]=_['keys'](db[_0xde14('0x2b')][_0xde14('0x2c')]);_0xff1bbd[_0xde14('0x2e')]=_['keys'](_0x5ebb03[_0xde14('0x2e')]);_0xff1bbd['filters']=_[_0xde14('0x30')](_0xff1bbd['model'],_0xff1bbd[_0xde14('0x2e')]);_0x16e7d1[_0xde14('0x32')]=_[_0xde14('0x30')](_0xff1bbd[_0xde14('0x31')],qs[_0xde14('0x33')](_0x5ebb03[_0xde14('0x2e')][_0xde14('0x33')]));_0x16e7d1[_0xde14('0x32')]=_0x16e7d1['attributes'][_0xde14('0x34')]?_0x16e7d1['attributes']:_0xff1bbd[_0xde14('0x31')];if(_0x5ebb03['query'][_0xde14('0x40')]){_0x16e7d1[_0xde14('0x41')]=[{'all':!![]}];}_0x16e7d1=_[_0xde14('0x3b')]({},_0x16e7d1,_0x5ebb03[_0xde14('0x3f')]);return db[_0xde14('0x2b')][_0xde14('0x46')](_0x16e7d1)[_0xde14('0x25')](handleEntityNotFound(_0x75d4f1,null))[_0xde14('0x25')](respondWithResult(_0x75d4f1,null))['catch'](handleError(_0x75d4f1,null));};exports[_0xde14('0x47')]=function(_0xe3669c,_0x220ca7){return db[_0xde14('0x2b')]['create'](_0xe3669c[_0xde14('0x48')],{})[_0xde14('0x25')](respondWithResult(_0x220ca7,0xc9))[_0xde14('0x44')](handleError(_0x220ca7,null));};exports[_0xde14('0x24')]=function(_0x39572b,_0x19e12c){if(_0x39572b['body']['id']){delete _0x39572b[_0xde14('0x48')]['id'];}return db['FreshdeskField'][_0xde14('0x46')]({'where':{'id':_0x39572b[_0xde14('0x45')]['id']}})['then'](handleEntityNotFound(_0x19e12c,null))[_0xde14('0x25')](saveUpdates(_0x39572b[_0xde14('0x48')],null))[_0xde14('0x25')](respondWithResult(_0x19e12c,null))[_0xde14('0x44')](handleError(_0x19e12c,null));};exports[_0xde14('0x26')]=function(_0x1c87e1,_0x45fa7e){return db['FreshdeskField'][_0xde14('0x46')]({'where':{'id':_0x1c87e1['params']['id']}})[_0xde14('0x25')](handleEntityNotFound(_0x45fa7e,null))[_0xde14('0x25')](removeEntity(_0x45fa7e,null))[_0xde14('0x44')](handleError(_0x45fa7e,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.model.js b/server/api/intFreshdeskField/intFreshdeskField.model.js index 1a37aa1..e10f81a 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 _0xa9bc=['lodash','../../config/logger','moment','bluebird','path','../../config/environment','./intFreshdeskField.attributes','FreshdeskField','int_freshdesk_fields','freshdesk_unique_index','idField','FieldId'];(function(_0x51b360,_0x19092c){var _0x544947=function(_0x48ce13){while(--_0x48ce13){_0x51b360['push'](_0x51b360['shift']());}};_0x544947(++_0x19092c);}(_0xa9bc,0x108));var _0xca9b=function(_0x5b4c20,_0x5cdfb3){_0x5b4c20=_0x5b4c20-0x0;var _0x115e31=_0xa9bc[_0x5b4c20];return _0x115e31;};'use strict';var _=require(_0xca9b('0x0'));var util=require('util');var logger=require(_0xca9b('0x1'))('api');var moment=require(_0xca9b('0x2'));var BPromise=require(_0xca9b('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xca9b('0x4'));var rimraf=require('rimraf');var config=require(_0xca9b('0x5'));var attributes=require(_0xca9b('0x6'));module['exports']=function(_0x20f907,_0x26bb61){return _0x20f907['define'](_0xca9b('0x7'),attributes,{'tableName':_0xca9b('0x8'),'paranoid':![],'indexes':[{'name':_0xca9b('0x9'),'fields':[_0xca9b('0xa'),_0xca9b('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x41a7=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./intFreshdeskField.attributes','exports','int_freshdesk_fields','freshdesk_unique_index','idField','FieldId','lodash'];(function(_0x29df1a,_0x132b32){var _0x3f59a2=function(_0x50a1ba){while(--_0x50a1ba){_0x29df1a['push'](_0x29df1a['shift']());}};_0x3f59a2(++_0x132b32);}(_0x41a7,0x15d));var _0x741a=function(_0x2126dd,_0xb9dae0){_0x2126dd=_0x2126dd-0x0;var _0x1536b4=_0x41a7[_0x2126dd];return _0x1536b4;};'use strict';var _=require(_0x741a('0x0'));var util=require('util');var logger=require(_0x741a('0x1'))(_0x741a('0x2'));var moment=require(_0x741a('0x3'));var BPromise=require('bluebird');var rp=require(_0x741a('0x4'));var fs=require('fs');var path=require(_0x741a('0x5'));var rimraf=require(_0x741a('0x6'));var config=require(_0x741a('0x7'));var attributes=require(_0x741a('0x8'));module[_0x741a('0x9')]=function(_0x1bb52b,_0x5e4a54){return _0x1bb52b['define']('FreshdeskField',attributes,{'tableName':_0x741a('0xa'),'paranoid':![],'indexes':[{'name':_0x741a('0xb'),'fields':[_0x741a('0xc'),_0x741a('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.rpc.js b/server/api/intFreshdeskField/intFreshdeskField.rpc.js index bb82fe9..deccff7 100644 --- a/server/api/intFreshdeskField/intFreshdeskField.rpc.js +++ b/server/api/intFreshdeskField/intFreshdeskField.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['stringify','error','message','result','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','FreshdeskField,\x20%s,\x20%s','FreshdeskField,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0xc40a15,_0x54bcd1){var _0x121746=function(_0x54b9de){while(--_0x54b9de){_0xc40a15['push'](_0xc40a15['shift']());}};_0x121746(++_0x54bcd1);}(_0xb10b,0x12a));var _0xbb10=function(_0x5c0232,_0x1c449f){_0x5c0232=_0x5c0232-0x0;var _0x589366=_0xb10b[_0x5c0232];return _0x589366;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});} \ No newline at end of file +var _0x7a54=['info','FreshdeskField,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x7a54,0x106));var _0x47a5=function(_0x30ddcd,_0xa0dfcc){_0x30ddcd=_0x30ddcd-0x0;var _0x5e2bea=_0x7a54[_0x30ddcd];return _0x5e2bea;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('FreshdeskField,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});} \ No newline at end of file diff --git a/server/api/intSalesforceAccount/index.js b/server/api/intSalesforceAccount/index.js index 98d664b..59fbe61 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 _0xfc01=['util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceAccount.controller','index','get','show','/:id/configurations','isAuthenticated','getFields','post','create','addConfiguration','put','/:id','update','delete','destroy','exports','multer'];(function(_0x526f6d,_0x755026){var _0x10224d=function(_0x5cff1b){while(--_0x5cff1b){_0x526f6d['push'](_0x526f6d['shift']());}};_0x10224d(++_0x755026);}(_0xfc01,0xe0));var _0x1fc0=function(_0x41ecab,_0x91f7d5){_0x41ecab=_0x41ecab-0x0;var _0x11e74e=_0xfc01[_0x41ecab];return _0x11e74e;};'use strict';var multer=require(_0x1fc0('0x0'));var util=require(_0x1fc0('0x1'));var path=require(_0x1fc0('0x2'));var timeout=require(_0x1fc0('0x3'));var express=require(_0x1fc0('0x4'));var router=express[_0x1fc0('0x5')]();var auth=require(_0x1fc0('0x6'));var interaction=require(_0x1fc0('0x7'));var config=require(_0x1fc0('0x8'));var controller=require(_0x1fc0('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x1fc0('0xa')]);router[_0x1fc0('0xb')]('/:id',auth['isAuthenticated'](),controller[_0x1fc0('0xc')]);router[_0x1fc0('0xb')](_0x1fc0('0xd'),auth[_0x1fc0('0xe')](),controller['getConfigurations']);router[_0x1fc0('0xb')]('/:id/fields',auth[_0x1fc0('0xe')](),controller[_0x1fc0('0xf')]);router[_0x1fc0('0x10')]('/',auth[_0x1fc0('0xe')](),controller[_0x1fc0('0x11')]);router[_0x1fc0('0x10')](_0x1fc0('0xd'),auth[_0x1fc0('0xe')](),controller[_0x1fc0('0x12')]);router[_0x1fc0('0x13')](_0x1fc0('0x14'),auth[_0x1fc0('0xe')](),controller[_0x1fc0('0x15')]);router[_0x1fc0('0x16')](_0x1fc0('0x14'),auth[_0x1fc0('0xe')](),controller[_0x1fc0('0x17')]);module[_0x1fc0('0x18')]=router; \ No newline at end of file +var _0x66cd=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceAccount.controller','isAuthenticated','index','get','getConfigurations','/:id/fields','post','/:id/configurations','addConfiguration','/:id','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x49ad79,_0x48ee93){var _0xa4e38a=function(_0x4925c7){while(--_0x4925c7){_0x49ad79['push'](_0x49ad79['shift']());}};_0xa4e38a(++_0x48ee93);}(_0x66cd,0xa4));var _0xd66c=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x66cd[_0x19e35c];return _0x3e1fe8;};'use strict';var multer=require(_0xd66c('0x0'));var util=require(_0xd66c('0x1'));var path=require(_0xd66c('0x2'));var timeout=require(_0xd66c('0x3'));var express=require('express');var router=express[_0xd66c('0x4')]();var auth=require(_0xd66c('0x5'));var interaction=require(_0xd66c('0x6'));var config=require(_0xd66c('0x7'));var controller=require(_0xd66c('0x8'));router['get']('/',auth[_0xd66c('0x9')](),controller[_0xd66c('0xa')]);router[_0xd66c('0xb')]('/:id',auth[_0xd66c('0x9')](),controller['show']);router[_0xd66c('0xb')]('/:id/configurations',auth[_0xd66c('0x9')](),controller[_0xd66c('0xc')]);router[_0xd66c('0xb')](_0xd66c('0xd'),auth[_0xd66c('0x9')](),controller['getFields']);router[_0xd66c('0xe')]('/',auth[_0xd66c('0x9')](),controller['create']);router['post'](_0xd66c('0xf'),auth[_0xd66c('0x9')](),controller[_0xd66c('0x10')]);router['put'](_0xd66c('0x11'),auth['isAuthenticated'](),controller['update']);router[_0xd66c('0x12')](_0xd66c('0x11'),auth['isAuthenticated'](),controller[_0xd66c('0x13')]);module[_0xd66c('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 ea03ed3..712d984 100644 --- a/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js +++ b/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7fbe=['integrationTab','newTab','STRING','username','ENUM'];(function(_0x31334e,_0x302789){var _0x2398ea=function(_0x2f2b23){while(--_0x2f2b23){_0x31334e['push'](_0x31334e['shift']());}};_0x2398ea(++_0x302789);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x550ef9,_0x3a9b13){_0x550ef9=_0x550ef9-0x0;var _0x252d95=_0x7fbe[_0x550ef9];return _0x252d95;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xe7fb('0x0')]},'description':{'type':Sequelize[_0xe7fb('0x0')]},'username':{'type':Sequelize[_0xe7fb('0x0')],'unique':_0xe7fb('0x1')},'remoteUri':{'type':Sequelize[_0xe7fb('0x0')]},'password':{'type':Sequelize[_0xe7fb('0x0')]},'clientId':{'type':Sequelize[_0xe7fb('0x0')]},'clientSecret':{'type':Sequelize[_0xe7fb('0x0')]},'securityToken':{'type':Sequelize[_0xe7fb('0x0')]},'serverUrl':{'type':Sequelize[_0xe7fb('0x0')]},'type':{'type':Sequelize[_0xe7fb('0x2')](_0xe7fb('0x3'),_0xe7fb('0x4')),'defaultValue':_0xe7fb('0x3')}}; \ No newline at end of file +var _0x53ec=['ENUM','newTab','integrationTab','sequelize','exports','STRING','username'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x53ec,0x192));var _0xc53e=function(_0x40822a,_0x582b60){_0x40822a=_0x40822a-0x0;var _0x357420=_0x53ec[_0x40822a];return _0x357420;};'use strict';var Sequelize=require(_0xc53e('0x0'));module[_0xc53e('0x1')]={'name':{'type':Sequelize[_0xc53e('0x2')]},'description':{'type':Sequelize[_0xc53e('0x2')]},'username':{'type':Sequelize[_0xc53e('0x2')],'unique':_0xc53e('0x3')},'remoteUri':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0xc53e('0x2')]},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize[_0xc53e('0x2')]},'securityToken':{'type':Sequelize[_0xc53e('0x2')]},'serverUrl':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xc53e('0x4')]('integrationTab',_0xc53e('0x5')),'defaultValue':_0xc53e('0x6')}}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.controller.js b/server/api/intSalesforceAccount/intSalesforceAccount.controller.js index e50739f..7c16842 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 _0x3421=['filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','map','type','VIRTUAL','field','options','include','findAll','rows','show','params','rawAttributes','find','create','body','update','destroy','getConfigurations','findOne','SalesforceConfiguration','addConfiguration','Subjects','getDescriptions','channel','SalesforceField','Descriptions','getFields','Task','clientId','clientSecret','username','password','securityToken','remoteUri','slice','substring','lastIndexOf','Connection','login','concat','isNil','ticketType','CallDisposition','CallObject','CallType','IsArchived','Priority','Type','Origin','Status','IsEscalated','SuppliedName','SuppliedCompany','label','custom','picklistValues','value','True','true','False','false','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','eml-format','rimraf','request-promise','bluebird','mustache','util','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','SalesforceAccount,\x20%s,\x20%s','request\x20sent','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','sendStatus','status','end','json','count','offset','set','Content-Range','apply','reject','save','stack','name','send','index','SalesforceAccount','model','keys','query'];(function(_0x13b330,_0x297092){var _0x1f666c=function(_0x5ebc84){while(--_0x5ebc84){_0x13b330['push'](_0x13b330['shift']());}};_0x1f666c(++_0x297092);}(_0x3421,0x15f));var _0x1342=function(_0x452b55,_0x1bac08){_0x452b55=_0x452b55-0x0;var _0x490cf2=_0x3421[_0x452b55];return _0x490cf2;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x1342('0x0'));var rimraf=require(_0x1342('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x1342('0x2'));var moment=require('moment');var BPromise=require(_0x1342('0x3'));var Mustache=require(_0x1342('0x4'));var util=require(_0x1342('0x5'));var path=require('path');var sox=require(_0x1342('0x6'));var csv=require(_0x1342('0x7'));var ejs=require(_0x1342('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0x1342('0x9'));var crypto=require(_0x1342('0xa'));var jsforce=require(_0x1342('0xb'));var deskjs=require(_0x1342('0xc'));var toCsv=require('to-csv');var querystring=require(_0x1342('0xd'));var Papa=require(_0x1342('0xe'));var Redis=require(_0x1342('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x1342('0x10'));var as=require(_0x1342('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1342('0x12'))(_0x1342('0x13'));var utils=require(_0x1342('0x14'));var config=require(_0x1342('0x15'));var db=require(_0x1342('0x16'))['db'];var integrations=require(_0x1342('0x17'));var jayson=require(_0x1342('0x18'));var client=jayson[_0x1342('0x19')][_0x1342('0x1a')]({'port':0x232a});function checkPasswordPattern(_0x183e8f,_0x6dc9c6,_0x2ce13b){if(_0x2ce13b){var _0x1f2f82=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1f2f82[_0x1342('0x1b')](_0x6dc9c6)){return _0x183e8f;}else{throw new Error(_0x1342('0x1c'));}}else{return _0x183e8f;}}function respondWithRpcPromise(_0x5acde7,_0x73aff,_0x7d3960,_0x17db47){return new BPromise(function(_0x3e1c91,_0x3e64d0){var _0x43609f=_0x17db47||client;return _0x43609f[_0x1342('0x1d')](_0x5acde7,_0x7d3960)[_0x1342('0x1e')](function(_0xc91374){logger['info'](_0x1342('0x1f'),_0x73aff,_0x1342('0x20'));logger[_0x1342('0x21')](_0x1342('0x22'),_0x73aff,_0x1342('0x20'),JSON[_0x1342('0x23')](_0xc91374));if(_0xc91374[_0x1342('0x24')]){if(_0xc91374[_0x1342('0x24')][_0x1342('0x25')]===0x1f4){logger[_0x1342('0x24')](_0x1342('0x1f'),_0x73aff,_0xc91374[_0x1342('0x24')][_0x1342('0x26')]);return _0x3e64d0(_0xc91374[_0x1342('0x24')][_0x1342('0x26')]);}logger[_0x1342('0x24')](_0x1342('0x1f'),_0x73aff,_0xc91374[_0x1342('0x24')][_0x1342('0x26')]);return _0x3e1c91(_0xc91374['error'][_0x1342('0x26')]);}else{logger[_0x1342('0x27')](_0x1342('0x1f'),_0x73aff,_0x1342('0x20'));_0x3e1c91(_0xc91374['result'][_0x1342('0x26')]);}})[_0x1342('0x28')](function(_0x5f11d9){logger[_0x1342('0x24')](_0x1342('0x1f'),_0x73aff,_0x5f11d9);_0x3e64d0(_0x5f11d9);});});}function respondWithStatusCode(_0x3fbc23,_0x2cb6f5){_0x2cb6f5=_0x2cb6f5||0xcc;return function(_0x34a4e9){if(_0x34a4e9){return _0x3fbc23[_0x1342('0x29')](_0x2cb6f5);}return _0x3fbc23[_0x1342('0x2a')](_0x2cb6f5)[_0x1342('0x2b')]();};}function respondWithResult(_0x12890b,_0x3e3dfa){_0x3e3dfa=_0x3e3dfa||0xc8;return function(_0x247efe){if(_0x247efe){return _0x12890b[_0x1342('0x2a')](_0x3e3dfa)[_0x1342('0x2c')](_0x247efe);}};}function respondWithFilteredResult(_0x2105de,_0x295736){return function(_0x5e6ae2){if(_0x5e6ae2){var _0x87a1ed=_0x5e6ae2[_0x1342('0x2d')],_0x2abc5d=_0x295736['offset'],_0x26d38a=_0x295736[_0x1342('0x2e')]+_0x295736['limit'],_0x305717;if(_0x26d38a>=_0x87a1ed){_0x26d38a=_0x87a1ed;_0x305717=0xc8;}else{_0x305717=0xce;}_0x2105de[_0x1342('0x2a')](_0x305717);return _0x2105de[_0x1342('0x2f')](_0x1342('0x30'),_0x2abc5d+'-'+_0x26d38a+'/'+_0x87a1ed)[_0x1342('0x2c')](_0x5e6ae2);}return null;};}function patchUpdates(_0x53e9cd){return function(_0x1f7bba){try{jsonpatch[_0x1342('0x31')](_0x1f7bba,_0x53e9cd,!![]);}catch(_0x3cdfd2){return BPromise[_0x1342('0x32')](_0x3cdfd2);}return _0x1f7bba[_0x1342('0x33')]();};}function saveUpdates(_0x3b3a8e,_0x3adbe7){return function(_0x12ffdf){if(_0x12ffdf){return _0x12ffdf['update'](_0x3b3a8e)[_0x1342('0x1e')](function(_0x54ff6b){return _0x54ff6b;});}return null;};}function removeEntity(_0x353cad,_0x39b557){return function(_0x27d6b3){if(_0x27d6b3){return _0x27d6b3['destroy']()[_0x1342('0x1e')](function(){_0x353cad['status'](0xcc)[_0x1342('0x2b')]();});}};}function handleEntityNotFound(_0x15708d,_0x194c37){return function(_0x2af252){if(!_0x2af252){_0x15708d[_0x1342('0x29')](0x194);}return _0x2af252;};}function handleError(_0x5cd17d,_0x5f31ef){_0x5f31ef=_0x5f31ef||0x1f4;return function(_0xa70395){logger[_0x1342('0x24')](_0xa70395[_0x1342('0x34')]);if(_0xa70395['name']){delete _0xa70395[_0x1342('0x35')];}_0x5cd17d[_0x1342('0x2a')](_0x5f31ef)[_0x1342('0x36')](_0xa70395);};}exports[_0x1342('0x37')]=function(_0x1aecde,_0xf741d4){var _0x42e715={},_0x32cf6b={},_0x1e988b={'count':0x0,'rows':[]};var _0x581bf5=db[_0x1342('0x38')]['rawAttributes'];_0x32cf6b[_0x1342('0x39')]=_[_0x1342('0x3a')](_0x581bf5);_0x32cf6b[_0x1342('0x3b')]=_[_0x1342('0x3a')](_0x1aecde['query']);_0x32cf6b[_0x1342('0x3c')]=_[_0x1342('0x3d')](_0x32cf6b['model'],_0x32cf6b[_0x1342('0x3b')]);_0x42e715['attributes']=_[_0x1342('0x3d')](_0x32cf6b[_0x1342('0x39')],qs['fields'](_0x1aecde[_0x1342('0x3b')][_0x1342('0x3e')]));_0x42e715[_0x1342('0x3f')]=_0x42e715[_0x1342('0x3f')][_0x1342('0x40')]?_0x42e715[_0x1342('0x3f')]:_0x32cf6b['model'];if(!_0x1aecde[_0x1342('0x3b')][_0x1342('0x41')](_0x1342('0x42'))){_0x42e715['limit']=qs[_0x1342('0x43')](_0x1aecde[_0x1342('0x3b')][_0x1342('0x43')]);_0x42e715[_0x1342('0x2e')]=qs[_0x1342('0x2e')](_0x1aecde[_0x1342('0x3b')]['offset']);}_0x42e715[_0x1342('0x44')]=qs[_0x1342('0x45')](_0x1aecde[_0x1342('0x3b')][_0x1342('0x45')]);_0x42e715[_0x1342('0x46')]=qs[_0x1342('0x3c')](_[_0x1342('0x47')](_0x1aecde[_0x1342('0x3b')],_0x32cf6b[_0x1342('0x3c')]));if(_0x1aecde[_0x1342('0x3b')][_0x1342('0x48')]){_0x42e715['where']=_[_0x1342('0x49')](_0x42e715['where'],{'$or':_[_0x1342('0x4a')](_0x581bf5,function(_0x559cc5){if(_0x559cc5[_0x1342('0x4b')]['key']!==_0x1342('0x4c')){var _0x4384c6={};_0x4384c6[_0x559cc5[_0x1342('0x4d')]]={'$like':'%'+_0x1aecde['query'][_0x1342('0x48')]+'%'};return _0x4384c6;}})});}_0x42e715=_[_0x1342('0x49')]({},_0x42e715,_0x1aecde[_0x1342('0x4e')]);var _0xf756a4={'where':_0x42e715[_0x1342('0x46')]};return db['SalesforceAccount'][_0x1342('0x2d')](_0xf756a4)[_0x1342('0x1e')](function(_0x1b1588){_0x1e988b[_0x1342('0x2d')]=_0x1b1588;if(_0x1aecde[_0x1342('0x3b')]['includeAll']){_0x42e715[_0x1342('0x4f')]=[{'all':!![]}];}return db[_0x1342('0x38')][_0x1342('0x50')](_0x42e715);})['then'](function(_0x3c3c13){_0x1e988b[_0x1342('0x51')]=_0x3c3c13;return _0x1e988b;})[_0x1342('0x1e')](respondWithFilteredResult(_0xf741d4,_0x42e715))[_0x1342('0x28')](handleError(_0xf741d4,null));};exports[_0x1342('0x52')]=function(_0x27948e,_0x15bcdb){var _0x27062d={'raw':![],'where':{'id':_0x27948e[_0x1342('0x53')]['id']}},_0x3ecf05={};_0x3ecf05[_0x1342('0x39')]=_['keys'](db['SalesforceAccount'][_0x1342('0x54')]);_0x3ecf05[_0x1342('0x3b')]=_['keys'](_0x27948e[_0x1342('0x3b')]);_0x3ecf05['filters']=_['intersection'](_0x3ecf05['model'],_0x3ecf05[_0x1342('0x3b')]);_0x27062d['attributes']=_[_0x1342('0x3d')](_0x3ecf05['model'],qs[_0x1342('0x3e')](_0x27948e[_0x1342('0x3b')][_0x1342('0x3e')]));_0x27062d[_0x1342('0x3f')]=_0x27062d[_0x1342('0x3f')][_0x1342('0x40')]?_0x27062d['attributes']:_0x3ecf05[_0x1342('0x39')];if(_0x27948e[_0x1342('0x3b')]['includeAll']){_0x27062d[_0x1342('0x4f')]=[{'all':!![]}];}_0x27062d=_[_0x1342('0x49')]({},_0x27062d,_0x27948e['options']);return db[_0x1342('0x38')][_0x1342('0x55')](_0x27062d)[_0x1342('0x1e')](handleEntityNotFound(_0x15bcdb,null))[_0x1342('0x1e')](respondWithResult(_0x15bcdb,null))[_0x1342('0x28')](handleError(_0x15bcdb,null));};exports[_0x1342('0x56')]=function(_0x3d9a19,_0x52e93f){return db['SalesforceAccount'][_0x1342('0x56')](_0x3d9a19[_0x1342('0x57')],{})[_0x1342('0x1e')](respondWithResult(_0x52e93f,0xc9))[_0x1342('0x28')](handleError(_0x52e93f,null));};exports[_0x1342('0x58')]=function(_0x3e6b40,_0x13c73f){if(_0x3e6b40['body']['id']){delete _0x3e6b40['body']['id'];}return db['SalesforceAccount'][_0x1342('0x55')]({'where':{'id':_0x3e6b40[_0x1342('0x53')]['id']}})[_0x1342('0x1e')](handleEntityNotFound(_0x13c73f,null))[_0x1342('0x1e')](saveUpdates(_0x3e6b40[_0x1342('0x57')],null))['then'](respondWithResult(_0x13c73f,null))[_0x1342('0x28')](handleError(_0x13c73f,null));};exports[_0x1342('0x59')]=function(_0xfc5454,_0x1845ed){return db['SalesforceAccount'][_0x1342('0x55')]({'where':{'id':_0xfc5454[_0x1342('0x53')]['id']}})[_0x1342('0x1e')](handleEntityNotFound(_0x1845ed,null))[_0x1342('0x1e')](removeEntity(_0x1845ed,null))['catch'](handleError(_0x1845ed,null));};exports[_0x1342('0x5a')]=function(_0x104268,_0x36266b,_0x58f21d){var _0x229677={};var _0x13c54c={};var _0x39a516;var _0x1efe2b;return db['SalesforceAccount'][_0x1342('0x5b')]({'where':{'id':_0x104268[_0x1342('0x53')]['id']}})[_0x1342('0x1e')](handleEntityNotFound(_0x36266b,null))[_0x1342('0x1e')](function(_0x2abc98){if(_0x2abc98){_0x39a516=_0x2abc98;_0x13c54c[_0x1342('0x39')]=_[_0x1342('0x3a')](db[_0x1342('0x5c')][_0x1342('0x54')]);_0x13c54c[_0x1342('0x3b')]=_['keys'](_0x104268[_0x1342('0x3b')]);_0x13c54c[_0x1342('0x3c')]=_[_0x1342('0x3d')](_0x13c54c[_0x1342('0x39')],_0x13c54c[_0x1342('0x3b')]);_0x229677['attributes']=_['intersection'](_0x13c54c[_0x1342('0x39')],qs[_0x1342('0x3e')](_0x104268['query'][_0x1342('0x3e')]));_0x229677[_0x1342('0x3f')]=_0x229677[_0x1342('0x3f')][_0x1342('0x40')]?_0x229677['attributes']:_0x13c54c[_0x1342('0x39')];_0x229677[_0x1342('0x44')]=qs['sort'](_0x104268[_0x1342('0x3b')][_0x1342('0x45')]);_0x229677[_0x1342('0x46')]=qs['filters'](_[_0x1342('0x47')](_0x104268[_0x1342('0x3b')],_0x13c54c[_0x1342('0x3c')]));if(_0x104268[_0x1342('0x3b')]['filter']){_0x229677[_0x1342('0x46')]=_['merge'](_0x229677[_0x1342('0x46')],{'$or':_[_0x1342('0x4a')](_0x229677[_0x1342('0x3f')],function(_0x453d00){var _0x294d34={};_0x294d34[_0x453d00]={'$like':'%'+_0x104268[_0x1342('0x3b')][_0x1342('0x48')]+'%'};return _0x294d34;})});}_0x229677=_[_0x1342('0x49')]({},_0x229677,_0x104268[_0x1342('0x4e')]);return _0x39a516[_0x1342('0x5a')](_0x229677);}})[_0x1342('0x1e')](function(_0x48467f){if(_0x48467f){_0x1efe2b=_0x48467f[_0x1342('0x40')];if(!_0x104268[_0x1342('0x3b')][_0x1342('0x41')](_0x1342('0x42'))){_0x229677['limit']=qs[_0x1342('0x43')](_0x104268['query']['limit']);_0x229677[_0x1342('0x2e')]=qs[_0x1342('0x2e')](_0x104268[_0x1342('0x3b')][_0x1342('0x2e')]);}return _0x39a516[_0x1342('0x5a')](_0x229677);}})[_0x1342('0x1e')](function(_0x48b4c5){if(_0x48b4c5){return _0x48b4c5?{'count':_0x1efe2b,'rows':_0x48b4c5}:null;}})[_0x1342('0x1e')](respondWithResult(_0x36266b,null))[_0x1342('0x28')](handleError(_0x36266b,null));};exports[_0x1342('0x5d')]=function(_0x5f5197,_0x36046f,_0x3159af){if(_0x5f5197[_0x1342('0x57')]['id']){delete _0x5f5197[_0x1342('0x57')]['id'];}return db[_0x1342('0x38')][_0x1342('0x5b')]({'where':{'id':_0x5f5197['params']['id']}})[_0x1342('0x1e')](handleEntityNotFound(_0x36046f,null))['then'](function(_0x51c460){if(_0x51c460){_0x5f5197[_0x1342('0x57')]['AccountId']=_0x51c460['id'];_0x5f5197['body'][_0x1342('0x5e')]=integrations['getSubjects'](_0x5f5197[_0x1342('0x57')]['channel'],_0x5f5197[_0x1342('0x57')]['type']);_0x5f5197['body']['Descriptions']=integrations[_0x1342('0x5f')](_0x5f5197[_0x1342('0x57')][_0x1342('0x60')],_0x5f5197[_0x1342('0x57')]['type']);return db['SalesforceConfiguration']['create'](_0x5f5197[_0x1342('0x57')],{'include':[{'model':db[_0x1342('0x61')],'as':_0x1342('0x5e')},{'model':db[_0x1342('0x61')],'as':_0x1342('0x62')}]});}return null;})[_0x1342('0x1e')](respondWithResult(_0x36046f,null))[_0x1342('0x28')](handleError(_0x36046f,null));};exports[_0x1342('0x63')]=function(_0x285cad,_0x24e26e,_0x3be1c2){var _0x1f5988;var _0x27d35d='';var _0x219fb6=_0x1342('0x64');return db[_0x1342('0x38')][_0x1342('0x5b')]({'where':{'id':_0x285cad[_0x1342('0x53')]['id']},'attributes':['id','remoteUri',_0x1342('0x65'),_0x1342('0x66'),_0x1342('0x67'),_0x1342('0x68'),_0x1342('0x69')]})['then'](handleEntityNotFound(_0x24e26e,null))[_0x1342('0x1e')](function(_0xddffc){if(_0xddffc){_0x27d35d=_0xddffc[_0x1342('0x6a')];var _0x1e03f7=_0x27d35d[_0x1342('0x6b')](-0x1);if(_0x1e03f7==='/'){_0x27d35d=_0x27d35d[_0x1342('0x6c')](0x0,_0x27d35d[_0x1342('0x6d')](_0x1e03f7));}_0x1f5988=new jsforce[(_0x1342('0x6e'))]({'oauth2':{'loginUrl':_0x27d35d,'clientId':_0xddffc[_0x1342('0x65')],'clientSecret':_0xddffc['clientSecret']}});return _0x1f5988[_0x1342('0x6f')](_0xddffc[_0x1342('0x67')],_0xddffc[_0x1342('0x68')][_0x1342('0x70')](_0xddffc[_0x1342('0x69')]));}})[_0x1342('0x1e')](function(_0x7abfa){if(_0x7abfa){if(!_[_0x1342('0x71')](_0x285cad[_0x1342('0x3b')][_0x1342('0x72')])){_0x219fb6=_0x285cad[_0x1342('0x3b')][_0x1342('0x72')];}return _0x1f5988['sobject'](_0x219fb6)['describe']();}})['then'](function(_0x4232e2){var _0x220f51=[_0x1342('0x73'),'CallDurationInSeconds',_0x1342('0x74'),_0x1342('0x75'),_0x1342('0x76'),_0x1342('0x77'),'Status',_0x1342('0x78')];if(!_[_0x1342('0x71')](_0x285cad['query']['ticketType'])&&_0x285cad[_0x1342('0x3b')][_0x1342('0x72')]==='Case'){_0x220f51=[_0x1342('0x78'),_0x1342('0x79'),'Reason',_0x1342('0x7a'),'Priority',_0x1342('0x7b'),_0x1342('0x7c'),_0x1342('0x7d')];}if(_0x4232e2){_['remove'](_0x4232e2[_0x1342('0x3e')],function(_0x3ac575){return _0x3ac575['custom']===![]&&!_0x220f51['includes'](_0x3ac575['name']);});return{'count':_0x4232e2[_0x1342('0x3e')][_0x1342('0x40')],'rows':_[_0x1342('0x4a')](_0x4232e2[_0x1342('0x3e')],function(_0x1e22d8){return{'id':_0x1e22d8['name'],'name':_0x1e22d8[_0x1342('0x7e')],'custom':_0x1e22d8[_0x1342('0x7f')],'options':_0x1e22d8['picklistValues'][_0x1342('0x40')]>0x0?_[_0x1342('0x4a')](_0x1e22d8[_0x1342('0x80')],function(_0x2cf49a){return{'name':_0x2cf49a[_0x1342('0x7e')],'value':_0x2cf49a[_0x1342('0x81')]};}):_0x1e22d8['type']=='boolean'?[{'name':_0x1342('0x82'),'value':_0x1342('0x83')},{'name':_0x1342('0x84'),'value':_0x1342('0x85')}]:[]};})};}})[_0x1342('0x1e')](respondWithResult(_0x24e26e,null))[_0x1342('0x28')](function(_0xfb23b6){var _0x1dd14f=_0x285cad['query']['test']?0x1f4:_0xfb23b6[_0x1342('0x86')]||0x1f4;logger[_0x1342('0x24')](_0x1342('0x87'),_0x1342('0x63'),_0x1dd14f,JSON['stringify'](_0xfb23b6));delete _0xfb23b6[_0x1342('0x35')];if(_0x1dd14f===0x191){_0x1dd14f=0x190;}_0x24e26e[_0x1342('0x2a')](_0x1dd14f)['send'](_0x285cad[_0x1342('0x3b')][_0x1342('0x1b')]?{'message':_0x1342('0x88'),'statusCode':_0xfb23b6['statusCode']}:_0xfb23b6);});}; \ No newline at end of file +var _0x0232=['crypto','jsforce','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','SalesforceAccount,\x20%s,\x20%s','request\x20sent','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','count','offset','limit','set','json','apply','save','update','end','send','index','SalesforceAccount','rawAttributes','model','query','keys','filters','intersection','fields','attributes','nolimit','order','sort','where','pick','filter','map','type','VIRTUAL','merge','includeAll','include','findAll','show','params','length','options','find','create','body','destroy','getConfigurations','findOne','SalesforceConfiguration','hasOwnProperty','addConfiguration','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','SalesforceField','getFields','Task','remoteUri','clientId','username','password','securityToken','substring','lastIndexOf','Connection','login','isNil','ticketType','sobject','CallDisposition','CallType','Priority','Status','Type','Case','Origin','Reason','IsEscalated','SuppliedCompany','custom','picklistValues','value','boolean','true','false','getFields,\x20%s,\x20%s,\x20%s','name','Wrong\x20credentials','statusCode','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','lodash','squel'];(function(_0x1229d1,_0x178640){var _0x3803f6=function(_0x56be46){while(--_0x56be46){_0x1229d1['push'](_0x1229d1['shift']());}};_0x3803f6(++_0x178640);}(_0x0232,0x78));var _0x2023=function(_0x19f8f9,_0x6caa7a){_0x19f8f9=_0x19f8f9-0x0;var _0x2f917b=_0x0232[_0x19f8f9];return _0x2f917b;};'use strict';var pdf=require(_0x2023('0x0'));var emlformat=require(_0x2023('0x1'));var rimraf=require(_0x2023('0x2'));var zipdir=require(_0x2023('0x3'));var jsonpatch=require(_0x2023('0x4'));var rp=require(_0x2023('0x5'));var moment=require(_0x2023('0x6'));var BPromise=require('bluebird');var Mustache=require(_0x2023('0x7'));var util=require(_0x2023('0x8'));var path=require(_0x2023('0x9'));var sox=require(_0x2023('0xa'));var csv=require('to-csv');var ejs=require(_0x2023('0xb'));var fs=require('fs');var _=require(_0x2023('0xc'));var squel=require(_0x2023('0xd'));var crypto=require(_0x2023('0xe'));var jsforce=require(_0x2023('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x2023('0x10'));var querystring=require('querystring');var Papa=require(_0x2023('0x11'));var Redis=require(_0x2023('0x12'));var authService=require(_0x2023('0x13'));var qs=require(_0x2023('0x14'));var as=require(_0x2023('0x15'));var hardwareService=require(_0x2023('0x16'));var logger=require('../../config/logger')(_0x2023('0x17'));var utils=require(_0x2023('0x18'));var config=require(_0x2023('0x19'));var db=require(_0x2023('0x1a'))['db'];var integrations=require(_0x2023('0x1b'));var jayson=require(_0x2023('0x1c'));var client=jayson[_0x2023('0x1d')][_0x2023('0x1e')]({'port':0x232a});function checkPasswordPattern(_0x2ad6c6,_0x1f5555,_0x43d7ce){if(_0x43d7ce){var _0x1baf5e=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1baf5e[_0x2023('0x1f')](_0x1f5555)){return _0x2ad6c6;}else{throw new Error(_0x2023('0x20'));}}else{return _0x2ad6c6;}}function respondWithRpcPromise(_0x178f4b,_0xe3930e,_0x5702c,_0x517ff6){return new BPromise(function(_0x164c35,_0x218191){var _0x265993=_0x517ff6||client;return _0x265993[_0x2023('0x21')](_0x178f4b,_0x5702c)[_0x2023('0x22')](function(_0x2dcab1){logger[_0x2023('0x23')](_0x2023('0x24'),_0xe3930e,_0x2023('0x25'));logger[_0x2023('0x26')](_0x2023('0x27'),_0xe3930e,_0x2023('0x25'),JSON[_0x2023('0x28')](_0x2dcab1));if(_0x2dcab1[_0x2023('0x29')]){if(_0x2dcab1[_0x2023('0x29')][_0x2023('0x2a')]===0x1f4){logger[_0x2023('0x29')](_0x2023('0x24'),_0xe3930e,_0x2dcab1[_0x2023('0x29')]['message']);return _0x218191(_0x2dcab1[_0x2023('0x29')][_0x2023('0x2b')]);}logger[_0x2023('0x29')](_0x2023('0x24'),_0xe3930e,_0x2dcab1[_0x2023('0x29')][_0x2023('0x2b')]);return _0x164c35(_0x2dcab1[_0x2023('0x29')][_0x2023('0x2b')]);}else{logger['info'](_0x2023('0x24'),_0xe3930e,_0x2023('0x25'));_0x164c35(_0x2dcab1[_0x2023('0x2c')][_0x2023('0x2b')]);}})[_0x2023('0x2d')](function(_0x4dab92){logger[_0x2023('0x29')](_0x2023('0x24'),_0xe3930e,_0x4dab92);_0x218191(_0x4dab92);});});}function respondWithStatusCode(_0x322ec3,_0x45fe69){_0x45fe69=_0x45fe69||0xcc;return function(_0x463fc1){if(_0x463fc1){return _0x322ec3[_0x2023('0x2e')](_0x45fe69);}return _0x322ec3['status'](_0x45fe69)['end']();};}function respondWithResult(_0x55403a,_0x279ca8){_0x279ca8=_0x279ca8||0xc8;return function(_0x4929cc){if(_0x4929cc){return _0x55403a[_0x2023('0x2f')](_0x279ca8)['json'](_0x4929cc);}};}function respondWithFilteredResult(_0x33c02a,_0x393f5b){return function(_0x522fc4){if(_0x522fc4){var _0x3e0328=_0x522fc4[_0x2023('0x30')],_0x3f684a=_0x393f5b[_0x2023('0x31')],_0x48e05b=_0x393f5b['offset']+_0x393f5b[_0x2023('0x32')],_0x836aca;if(_0x48e05b>=_0x3e0328){_0x48e05b=_0x3e0328;_0x836aca=0xc8;}else{_0x836aca=0xce;}_0x33c02a[_0x2023('0x2f')](_0x836aca);return _0x33c02a[_0x2023('0x33')]('Content-Range',_0x3f684a+'-'+_0x48e05b+'/'+_0x3e0328)[_0x2023('0x34')](_0x522fc4);}return null;};}function patchUpdates(_0x4408ab){return function(_0x203938){try{jsonpatch[_0x2023('0x35')](_0x203938,_0x4408ab,!![]);}catch(_0x2052e0){return BPromise['reject'](_0x2052e0);}return _0x203938[_0x2023('0x36')]();};}function saveUpdates(_0x2ec6d9,_0x315ffd){return function(_0x5cbb8e){if(_0x5cbb8e){return _0x5cbb8e[_0x2023('0x37')](_0x2ec6d9)[_0x2023('0x22')](function(_0x7f82cd){return _0x7f82cd;});}return null;};}function removeEntity(_0xe4d1bc,_0xda4ad9){return function(_0x1b493e){if(_0x1b493e){return _0x1b493e['destroy']()['then'](function(){_0xe4d1bc[_0x2023('0x2f')](0xcc)[_0x2023('0x38')]();});}};}function handleEntityNotFound(_0x9437fe,_0x2ac0ea){return function(_0x18b446){if(!_0x18b446){_0x9437fe[_0x2023('0x2e')](0x194);}return _0x18b446;};}function handleError(_0x320110,_0x168bc5){_0x168bc5=_0x168bc5||0x1f4;return function(_0x37d284){logger['error'](_0x37d284['stack']);if(_0x37d284['name']){delete _0x37d284['name'];}_0x320110[_0x2023('0x2f')](_0x168bc5)[_0x2023('0x39')](_0x37d284);};}exports[_0x2023('0x3a')]=function(_0x5ea657,_0xa8378b){var _0x38dacd={},_0x2c22aa={},_0x1f988f={'count':0x0,'rows':[]};var _0x3f2277=db[_0x2023('0x3b')][_0x2023('0x3c')];_0x2c22aa[_0x2023('0x3d')]=_['keys'](_0x3f2277);_0x2c22aa[_0x2023('0x3e')]=_[_0x2023('0x3f')](_0x5ea657['query']);_0x2c22aa[_0x2023('0x40')]=_['intersection'](_0x2c22aa[_0x2023('0x3d')],_0x2c22aa[_0x2023('0x3e')]);_0x38dacd['attributes']=_[_0x2023('0x41')](_0x2c22aa[_0x2023('0x3d')],qs[_0x2023('0x42')](_0x5ea657['query']['fields']));_0x38dacd[_0x2023('0x43')]=_0x38dacd[_0x2023('0x43')]['length']?_0x38dacd[_0x2023('0x43')]:_0x2c22aa[_0x2023('0x3d')];if(!_0x5ea657[_0x2023('0x3e')]['hasOwnProperty'](_0x2023('0x44'))){_0x38dacd[_0x2023('0x32')]=qs[_0x2023('0x32')](_0x5ea657[_0x2023('0x3e')][_0x2023('0x32')]);_0x38dacd[_0x2023('0x31')]=qs[_0x2023('0x31')](_0x5ea657[_0x2023('0x3e')][_0x2023('0x31')]);}_0x38dacd[_0x2023('0x45')]=qs['sort'](_0x5ea657[_0x2023('0x3e')][_0x2023('0x46')]);_0x38dacd[_0x2023('0x47')]=qs[_0x2023('0x40')](_[_0x2023('0x48')](_0x5ea657[_0x2023('0x3e')],_0x2c22aa[_0x2023('0x40')]));if(_0x5ea657[_0x2023('0x3e')][_0x2023('0x49')]){_0x38dacd[_0x2023('0x47')]=_['merge'](_0x38dacd[_0x2023('0x47')],{'$or':_[_0x2023('0x4a')](_0x3f2277,function(_0x1c09f5){if(_0x1c09f5[_0x2023('0x4b')]['key']!==_0x2023('0x4c')){var _0x4009d2={};_0x4009d2[_0x1c09f5['field']]={'$like':'%'+_0x5ea657['query'][_0x2023('0x49')]+'%'};return _0x4009d2;}})});}_0x38dacd=_[_0x2023('0x4d')]({},_0x38dacd,_0x5ea657['options']);var _0xd25b95={'where':_0x38dacd[_0x2023('0x47')]};return db[_0x2023('0x3b')][_0x2023('0x30')](_0xd25b95)[_0x2023('0x22')](function(_0x2d7e9b){_0x1f988f[_0x2023('0x30')]=_0x2d7e9b;if(_0x5ea657[_0x2023('0x3e')][_0x2023('0x4e')]){_0x38dacd[_0x2023('0x4f')]=[{'all':!![]}];}return db[_0x2023('0x3b')][_0x2023('0x50')](_0x38dacd);})[_0x2023('0x22')](function(_0x416662){_0x1f988f['rows']=_0x416662;return _0x1f988f;})['then'](respondWithFilteredResult(_0xa8378b,_0x38dacd))['catch'](handleError(_0xa8378b,null));};exports[_0x2023('0x51')]=function(_0x4856d5,_0x15ddac){var _0x67d526={'raw':![],'where':{'id':_0x4856d5[_0x2023('0x52')]['id']}},_0x59c931={};_0x59c931['model']=_[_0x2023('0x3f')](db[_0x2023('0x3b')][_0x2023('0x3c')]);_0x59c931[_0x2023('0x3e')]=_[_0x2023('0x3f')](_0x4856d5[_0x2023('0x3e')]);_0x59c931[_0x2023('0x40')]=_['intersection'](_0x59c931[_0x2023('0x3d')],_0x59c931[_0x2023('0x3e')]);_0x67d526[_0x2023('0x43')]=_[_0x2023('0x41')](_0x59c931[_0x2023('0x3d')],qs[_0x2023('0x42')](_0x4856d5[_0x2023('0x3e')][_0x2023('0x42')]));_0x67d526['attributes']=_0x67d526[_0x2023('0x43')][_0x2023('0x53')]?_0x67d526[_0x2023('0x43')]:_0x59c931[_0x2023('0x3d')];if(_0x4856d5[_0x2023('0x3e')][_0x2023('0x4e')]){_0x67d526[_0x2023('0x4f')]=[{'all':!![]}];}_0x67d526=_['merge']({},_0x67d526,_0x4856d5[_0x2023('0x54')]);return db['SalesforceAccount'][_0x2023('0x55')](_0x67d526)['then'](handleEntityNotFound(_0x15ddac,null))[_0x2023('0x22')](respondWithResult(_0x15ddac,null))[_0x2023('0x2d')](handleError(_0x15ddac,null));};exports[_0x2023('0x56')]=function(_0x5a7158,_0x1ff662){return db['SalesforceAccount'][_0x2023('0x56')](_0x5a7158['body'],{})[_0x2023('0x22')](respondWithResult(_0x1ff662,0xc9))[_0x2023('0x2d')](handleError(_0x1ff662,null));};exports['update']=function(_0x251a58,_0x1b944a){if(_0x251a58[_0x2023('0x57')]['id']){delete _0x251a58[_0x2023('0x57')]['id'];}return db['SalesforceAccount'][_0x2023('0x55')]({'where':{'id':_0x251a58[_0x2023('0x52')]['id']}})[_0x2023('0x22')](handleEntityNotFound(_0x1b944a,null))[_0x2023('0x22')](saveUpdates(_0x251a58[_0x2023('0x57')],null))['then'](respondWithResult(_0x1b944a,null))[_0x2023('0x2d')](handleError(_0x1b944a,null));};exports[_0x2023('0x58')]=function(_0x30413a,_0x3469c9){return db[_0x2023('0x3b')][_0x2023('0x55')]({'where':{'id':_0x30413a[_0x2023('0x52')]['id']}})[_0x2023('0x22')](handleEntityNotFound(_0x3469c9,null))['then'](removeEntity(_0x3469c9,null))['catch'](handleError(_0x3469c9,null));};exports[_0x2023('0x59')]=function(_0x24f333,_0x2949af,_0x59ffa9){var _0x3f0f10={};var _0x4539b6={};var _0x153629;var _0x4a9d45;return db[_0x2023('0x3b')][_0x2023('0x5a')]({'where':{'id':_0x24f333['params']['id']}})[_0x2023('0x22')](handleEntityNotFound(_0x2949af,null))[_0x2023('0x22')](function(_0x1de418){if(_0x1de418){_0x153629=_0x1de418;_0x4539b6[_0x2023('0x3d')]=_[_0x2023('0x3f')](db[_0x2023('0x5b')][_0x2023('0x3c')]);_0x4539b6[_0x2023('0x3e')]=_[_0x2023('0x3f')](_0x24f333[_0x2023('0x3e')]);_0x4539b6[_0x2023('0x40')]=_[_0x2023('0x41')](_0x4539b6[_0x2023('0x3d')],_0x4539b6[_0x2023('0x3e')]);_0x3f0f10[_0x2023('0x43')]=_[_0x2023('0x41')](_0x4539b6[_0x2023('0x3d')],qs[_0x2023('0x42')](_0x24f333[_0x2023('0x3e')][_0x2023('0x42')]));_0x3f0f10[_0x2023('0x43')]=_0x3f0f10[_0x2023('0x43')]['length']?_0x3f0f10[_0x2023('0x43')]:_0x4539b6[_0x2023('0x3d')];_0x3f0f10[_0x2023('0x45')]=qs['sort'](_0x24f333['query'][_0x2023('0x46')]);_0x3f0f10['where']=qs[_0x2023('0x40')](_[_0x2023('0x48')](_0x24f333[_0x2023('0x3e')],_0x4539b6[_0x2023('0x40')]));if(_0x24f333[_0x2023('0x3e')][_0x2023('0x49')]){_0x3f0f10[_0x2023('0x47')]=_[_0x2023('0x4d')](_0x3f0f10[_0x2023('0x47')],{'$or':_[_0x2023('0x4a')](_0x3f0f10[_0x2023('0x43')],function(_0x160296){var _0x4c46ee={};_0x4c46ee[_0x160296]={'$like':'%'+_0x24f333[_0x2023('0x3e')][_0x2023('0x49')]+'%'};return _0x4c46ee;})});}_0x3f0f10=_[_0x2023('0x4d')]({},_0x3f0f10,_0x24f333[_0x2023('0x54')]);return _0x153629['getConfigurations'](_0x3f0f10);}})[_0x2023('0x22')](function(_0x242ee6){if(_0x242ee6){_0x4a9d45=_0x242ee6[_0x2023('0x53')];if(!_0x24f333[_0x2023('0x3e')][_0x2023('0x5c')](_0x2023('0x44'))){_0x3f0f10[_0x2023('0x32')]=qs[_0x2023('0x32')](_0x24f333[_0x2023('0x3e')][_0x2023('0x32')]);_0x3f0f10[_0x2023('0x31')]=qs[_0x2023('0x31')](_0x24f333[_0x2023('0x3e')][_0x2023('0x31')]);}return _0x153629['getConfigurations'](_0x3f0f10);}})['then'](function(_0x57b034){if(_0x57b034){return _0x57b034?{'count':_0x4a9d45,'rows':_0x57b034}:null;}})[_0x2023('0x22')](respondWithResult(_0x2949af,null))[_0x2023('0x2d')](handleError(_0x2949af,null));};exports[_0x2023('0x5d')]=function(_0x54c640,_0x372574,_0x10dfd6){if(_0x54c640[_0x2023('0x57')]['id']){delete _0x54c640[_0x2023('0x57')]['id'];}return db[_0x2023('0x3b')]['findOne']({'where':{'id':_0x54c640['params']['id']}})['then'](handleEntityNotFound(_0x372574,null))[_0x2023('0x22')](function(_0xd79928){if(_0xd79928){_0x54c640['body'][_0x2023('0x5e')]=_0xd79928['id'];_0x54c640[_0x2023('0x57')][_0x2023('0x5f')]=integrations[_0x2023('0x60')](_0x54c640[_0x2023('0x57')]['channel'],_0x54c640[_0x2023('0x57')][_0x2023('0x4b')]);_0x54c640[_0x2023('0x57')][_0x2023('0x61')]=integrations[_0x2023('0x62')](_0x54c640[_0x2023('0x57')]['channel'],_0x54c640['body'][_0x2023('0x4b')]);return db[_0x2023('0x5b')][_0x2023('0x56')](_0x54c640[_0x2023('0x57')],{'include':[{'model':db['SalesforceField'],'as':_0x2023('0x5f')},{'model':db[_0x2023('0x63')],'as':_0x2023('0x61')}]});}return null;})['then'](respondWithResult(_0x372574,null))['catch'](handleError(_0x372574,null));};exports[_0x2023('0x64')]=function(_0x273a04,_0x5dceea,_0x47486f){var _0x23c66e;var _0x56cc1f='';var _0x186d21=_0x2023('0x65');return db[_0x2023('0x3b')]['findOne']({'where':{'id':_0x273a04[_0x2023('0x52')]['id']},'attributes':['id',_0x2023('0x66'),_0x2023('0x67'),'clientSecret',_0x2023('0x68'),_0x2023('0x69'),_0x2023('0x6a')]})[_0x2023('0x22')](handleEntityNotFound(_0x5dceea,null))[_0x2023('0x22')](function(_0x545890){if(_0x545890){_0x56cc1f=_0x545890['remoteUri'];var _0x44096f=_0x56cc1f['slice'](-0x1);if(_0x44096f==='/'){_0x56cc1f=_0x56cc1f[_0x2023('0x6b')](0x0,_0x56cc1f[_0x2023('0x6c')](_0x44096f));}_0x23c66e=new jsforce[(_0x2023('0x6d'))]({'oauth2':{'loginUrl':_0x56cc1f,'clientId':_0x545890[_0x2023('0x67')],'clientSecret':_0x545890['clientSecret']}});return _0x23c66e[_0x2023('0x6e')](_0x545890[_0x2023('0x68')],_0x545890[_0x2023('0x69')]['concat'](_0x545890[_0x2023('0x6a')]));}})[_0x2023('0x22')](function(_0x4e81eb){if(_0x4e81eb){if(!_[_0x2023('0x6f')](_0x273a04[_0x2023('0x3e')][_0x2023('0x70')])){_0x186d21=_0x273a04[_0x2023('0x3e')][_0x2023('0x70')];}return _0x23c66e[_0x2023('0x71')](_0x186d21)['describe']();}})[_0x2023('0x22')](function(_0x3e3d7d){var _0x1794ae=[_0x2023('0x72'),'CallDurationInSeconds','CallObject',_0x2023('0x73'),'IsArchived',_0x2023('0x74'),_0x2023('0x75'),_0x2023('0x76')];if(!_['isNil'](_0x273a04[_0x2023('0x3e')][_0x2023('0x70')])&&_0x273a04[_0x2023('0x3e')][_0x2023('0x70')]===_0x2023('0x77')){_0x1794ae=[_0x2023('0x76'),_0x2023('0x78'),_0x2023('0x79'),_0x2023('0x75'),'Priority',_0x2023('0x7a'),'SuppliedName',_0x2023('0x7b')];}if(_0x3e3d7d){_['remove'](_0x3e3d7d[_0x2023('0x42')],function(_0x420f3e){return _0x420f3e[_0x2023('0x7c')]===![]&&!_0x1794ae['includes'](_0x420f3e['name']);});return{'count':_0x3e3d7d[_0x2023('0x42')][_0x2023('0x53')],'rows':_['map'](_0x3e3d7d[_0x2023('0x42')],function(_0x220ffa){return{'id':_0x220ffa['name'],'name':_0x220ffa['label'],'custom':_0x220ffa[_0x2023('0x7c')],'options':_0x220ffa['picklistValues'][_0x2023('0x53')]>0x0?_['map'](_0x220ffa[_0x2023('0x7d')],function(_0x55b3ea){return{'name':_0x55b3ea['label'],'value':_0x55b3ea[_0x2023('0x7e')]};}):_0x220ffa['type']==_0x2023('0x7f')?[{'name':'True','value':_0x2023('0x80')},{'name':'False','value':_0x2023('0x81')}]:[]};})};}})[_0x2023('0x22')](respondWithResult(_0x5dceea,null))['catch'](function(_0x53884c){var _0x29e244=_0x273a04[_0x2023('0x3e')][_0x2023('0x1f')]?0x1f4:_0x53884c['statusCode']||0x1f4;logger[_0x2023('0x29')](_0x2023('0x82'),_0x2023('0x64'),_0x29e244,JSON[_0x2023('0x28')](_0x53884c));delete _0x53884c[_0x2023('0x83')];if(_0x29e244===0x191){_0x29e244=0x190;}_0x5dceea[_0x2023('0x2f')](_0x29e244)['send'](_0x273a04[_0x2023('0x3e')][_0x2023('0x1f')]?{'message':_0x2023('0x84'),'statusCode':_0x53884c[_0x2023('0x85')]}:_0x53884c);});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.model.js b/server/api/intSalesforceAccount/intSalesforceAccount.model.js index 0d97f66..57763e0 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 _0xc16f=['../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./intSalesforceAccount.attributes','../../components/integrations/configuration','exports','SalesforceAccount','int_salesforce_accounts','lodash','util'];(function(_0x3fd8fb,_0xca16b2){var _0x513dca=function(_0x506c0d){while(--_0x506c0d){_0x3fd8fb['push'](_0x3fd8fb['shift']());}};_0x513dca(++_0xca16b2);}(_0xc16f,0x116));var _0xfc16=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc16f[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xfc16('0x0'));var util=require(_0xfc16('0x1'));var logger=require(_0xfc16('0x2'))(_0xfc16('0x3'));var moment=require(_0xfc16('0x4'));var BPromise=require(_0xfc16('0x5'));var rp=require(_0xfc16('0x6'));var fs=require('fs');var path=require(_0xfc16('0x7'));var rimraf=require('rimraf');var config=require(_0xfc16('0x8'));var attributes=require(_0xfc16('0x9'));var integrations=require(_0xfc16('0xa'));module[_0xfc16('0xb')]=function(_0x51b6ad,_0x3a2205){return _0x51b6ad['define'](_0xfc16('0xc'),attributes,{'tableName':_0xfc16('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe321=['../../components/integrations/configuration','exports','define','SalesforceAccount','util','../../config/logger','api','request-promise','../../config/environment','./intSalesforceAccount.attributes'];(function(_0x3ebdbb,_0x2a7e95){var _0x464614=function(_0x5b3de6){while(--_0x5b3de6){_0x3ebdbb['push'](_0x3ebdbb['shift']());}};_0x464614(++_0x2a7e95);}(_0xe321,0x194));var _0x1e32=function(_0x31ce09,_0x4d5390){_0x31ce09=_0x31ce09-0x0;var _0x386653=_0xe321[_0x31ce09];return _0x386653;};'use strict';var _=require('lodash');var util=require(_0x1e32('0x0'));var logger=require(_0x1e32('0x1'))(_0x1e32('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x1e32('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x1e32('0x4'));var attributes=require(_0x1e32('0x5'));var integrations=require(_0x1e32('0x6'));module[_0x1e32('0x7')]=function(_0x28c16a,_0x1cff71){return _0x28c16a[_0x1e32('0x8')](_0x1e32('0x9'),attributes,{'tableName':'int_salesforce_accounts','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 6248fca..03d4333 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 _0xc6d8=['randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','info','SalesforceAccount,\x20%s,\x20%s','request\x20sent','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','findAll','options','raw','model','attributes','map','include','then','GetSalesforceAccount','ShowSalesforceAccount','SalesforceAccount','find','lodash','moment'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xc6d8,0xd7));var _0x8c6d=function(_0xfd495c,_0x4a3c1a){_0xfd495c=_0xfd495c-0x0;var _0x561dd8=_0xc6d8[_0xfd495c];return _0x561dd8;};'use strict';var _=require(_0x8c6d('0x0'));var util=require('util');var moment=require(_0x8c6d('0x1'));var BPromise=require('bluebird');var rs=require(_0x8c6d('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8c6d('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x8c6d('0x4'));var config=require(_0x8c6d('0x5'));var jayson=require(_0x8c6d('0x6'));var client=jayson[_0x8c6d('0x7')][_0x8c6d('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2dbb52,_0x98cae4,_0x5529f1){return new BPromise(function(_0x1496ba,_0x75c49f){return client[_0x8c6d('0x9')](_0x2dbb52,_0x5529f1)['then'](function(_0x3cecc1){logger[_0x8c6d('0xa')](_0x8c6d('0xb'),_0x98cae4,_0x8c6d('0xc'));logger[_0x8c6d('0xd')](_0x8c6d('0xe'),_0x98cae4,_0x8c6d('0xc'),JSON[_0x8c6d('0xf')](_0x3cecc1));if(_0x3cecc1['error']){if(_0x3cecc1[_0x8c6d('0x10')]['code']===0x1f4){logger['error'](_0x8c6d('0xb'),_0x98cae4,_0x3cecc1[_0x8c6d('0x10')][_0x8c6d('0x11')]);return _0x75c49f(_0x3cecc1[_0x8c6d('0x10')][_0x8c6d('0x11')]);}logger[_0x8c6d('0x10')](_0x8c6d('0xb'),_0x98cae4,_0x3cecc1[_0x8c6d('0x10')][_0x8c6d('0x11')]);return _0x1496ba(_0x3cecc1[_0x8c6d('0x10')]['message']);}else{logger[_0x8c6d('0xa')]('SalesforceAccount,\x20%s,\x20%s',_0x98cae4,_0x8c6d('0xc'));_0x1496ba(_0x3cecc1['result'][_0x8c6d('0x11')]);}})[_0x8c6d('0x12')](function(_0x52ed7b){logger[_0x8c6d('0x10')](_0x8c6d('0xb'),_0x98cae4,_0x52ed7b);_0x75c49f(_0x52ed7b);});});}exports['GetSalesforceAccount']=function(_0x3e5495){var _0x5a22de=this;return new Promise(function(_0x4c2f8d,_0x21b8ee){return db['SalesforceAccount'][_0x8c6d('0x13')]({'raw':_0x3e5495[_0x8c6d('0x14')]?_0x3e5495[_0x8c6d('0x14')][_0x8c6d('0x15')]===undefined?!![]:![]:!![],'where':_0x3e5495[_0x8c6d('0x14')]?_0x3e5495['options']['where']||null:null,'attributes':_0x3e5495['options']?_0x3e5495[_0x8c6d('0x14')]['attributes']||null:null,'limit':_0x3e5495[_0x8c6d('0x14')]?_0x3e5495['options']['limit']||null:null,'include':_0x3e5495[_0x8c6d('0x14')]?_0x3e5495[_0x8c6d('0x14')]['include']?_['map'](_0x3e5495['options']['include'],function(_0x2a85b5){return{'model':db[_0x2a85b5[_0x8c6d('0x16')]],'as':_0x2a85b5['as'],'attributes':_0x2a85b5[_0x8c6d('0x17')],'include':_0x2a85b5['include']?_[_0x8c6d('0x18')](_0x2a85b5['include'],function(_0x15a9c4){return{'model':db[_0x15a9c4['model']],'as':_0x15a9c4['as'],'attributes':_0x15a9c4[_0x8c6d('0x17')],'include':_0x15a9c4[_0x8c6d('0x19')]?_[_0x8c6d('0x18')](_0x15a9c4[_0x8c6d('0x19')],function(_0x1e6755){return{'model':db[_0x1e6755[_0x8c6d('0x16')]],'as':_0x1e6755['as'],'attributes':_0x1e6755[_0x8c6d('0x17')]};}):[]};}):[]};}):[]:[]})[_0x8c6d('0x1a')](function(_0x3eab38){logger['info']('GetSalesforceAccount',_0x3e5495);logger[_0x8c6d('0xd')](_0x8c6d('0x1b'),_0x3e5495,JSON[_0x8c6d('0xf')](_0x3eab38));_0x4c2f8d(_0x3eab38);})[_0x8c6d('0x12')](function(_0x370626){logger[_0x8c6d('0x10')](_0x8c6d('0x1b'),_0x370626[_0x8c6d('0x11')],_0x3e5495);_0x21b8ee(_0x5a22de[_0x8c6d('0x10')](0x1f4,_0x370626[_0x8c6d('0x11')]));});});};exports[_0x8c6d('0x1c')]=function(_0x15a508){var _0x4e5203=this;return new Promise(function(_0x3af625,_0x332f6a){return db[_0x8c6d('0x1d')][_0x8c6d('0x1e')]({'raw':_0x15a508[_0x8c6d('0x14')]?_0x15a508[_0x8c6d('0x14')][_0x8c6d('0x15')]===undefined?!![]:![]:!![],'where':_0x15a508[_0x8c6d('0x14')]?_0x15a508[_0x8c6d('0x14')]['where']||null:null,'attributes':_0x15a508[_0x8c6d('0x14')]?_0x15a508['options'][_0x8c6d('0x17')]||null:null,'include':_0x15a508[_0x8c6d('0x14')]?_0x15a508[_0x8c6d('0x14')][_0x8c6d('0x19')]?_[_0x8c6d('0x18')](_0x15a508[_0x8c6d('0x14')]['include'],function(_0x5ae56b){return{'model':db[_0x5ae56b[_0x8c6d('0x16')]],'as':_0x5ae56b['as'],'attributes':_0x5ae56b[_0x8c6d('0x17')],'include':_0x5ae56b[_0x8c6d('0x19')]?_[_0x8c6d('0x18')](_0x5ae56b['include'],function(_0x2818fa){return{'model':db[_0x2818fa[_0x8c6d('0x16')]],'as':_0x2818fa['as'],'attributes':_0x2818fa[_0x8c6d('0x17')],'include':_0x2818fa[_0x8c6d('0x19')]?_[_0x8c6d('0x18')](_0x2818fa[_0x8c6d('0x19')],function(_0x4a0fb3){return{'model':db[_0x4a0fb3[_0x8c6d('0x16')]],'as':_0x4a0fb3['as'],'attributes':_0x4a0fb3[_0x8c6d('0x17')]};}):[]};}):[]};}):[]:[]})[_0x8c6d('0x1a')](function(_0x2ef932){logger[_0x8c6d('0xa')](_0x8c6d('0x1c'),_0x15a508);logger[_0x8c6d('0xd')](_0x8c6d('0x1c'),_0x15a508,JSON[_0x8c6d('0xf')](_0x2ef932));_0x3af625(_0x2ef932);})[_0x8c6d('0x12')](function(_0x16b2cd){logger[_0x8c6d('0x10')]('ShowSalesforceAccount',_0x16b2cd[_0x8c6d('0x11')],_0x15a508);_0x332f6a(_0x4e5203[_0x8c6d('0x10')](0x1f4,_0x16b2cd[_0x8c6d('0x11')]));});});}; \ No newline at end of file +var _0xde2c=['findAll','options','raw','where','limit','include','model','attributes','GetSalesforceAccount','stringify','find','map','ShowSalesforceAccount','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','SalesforceAccount,\x20%s,\x20%s','request\x20sent','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','SalesforceAccount'];(function(_0x46ba12,_0x47cf95){var _0x3c2297=function(_0x1f8428){while(--_0x1f8428){_0x46ba12['push'](_0x46ba12['shift']());}};_0x3c2297(++_0x47cf95);}(_0xde2c,0x7f));var _0xcde2=function(_0x2c6810,_0x23c079){_0x2c6810=_0x2c6810-0x0;var _0x213881=_0xde2c[_0x2c6810];return _0x213881;};'use strict';var _=require(_0xcde2('0x0'));var util=require(_0xcde2('0x1'));var moment=require(_0xcde2('0x2'));var BPromise=require(_0xcde2('0x3'));var rs=require(_0xcde2('0x4'));var fs=require('fs');var Redis=require(_0xcde2('0x5'));var db=require(_0xcde2('0x6'))['db'];var utils=require(_0xcde2('0x7'));var logger=require('../../config/logger')(_0xcde2('0x8'));var config=require(_0xcde2('0x9'));var jayson=require(_0xcde2('0xa'));var client=jayson[_0xcde2('0xb')][_0xcde2('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x53c558,_0x2b27ef,_0x385e83){return new BPromise(function(_0x9c7036,_0x544235){return client['request'](_0x53c558,_0x385e83)[_0xcde2('0xd')](function(_0x1c8b3c){logger['info'](_0xcde2('0xe'),_0x2b27ef,_0xcde2('0xf'));logger[_0xcde2('0x10')](_0xcde2('0x11'),_0x2b27ef,'request\x20sent',JSON['stringify'](_0x1c8b3c));if(_0x1c8b3c[_0xcde2('0x12')]){if(_0x1c8b3c[_0xcde2('0x12')][_0xcde2('0x13')]===0x1f4){logger[_0xcde2('0x12')](_0xcde2('0xe'),_0x2b27ef,_0x1c8b3c[_0xcde2('0x12')]['message']);return _0x544235(_0x1c8b3c[_0xcde2('0x12')]['message']);}logger[_0xcde2('0x12')]('SalesforceAccount,\x20%s,\x20%s',_0x2b27ef,_0x1c8b3c['error'][_0xcde2('0x14')]);return _0x9c7036(_0x1c8b3c[_0xcde2('0x12')][_0xcde2('0x14')]);}else{logger[_0xcde2('0x15')](_0xcde2('0xe'),_0x2b27ef,'request\x20sent');_0x9c7036(_0x1c8b3c[_0xcde2('0x16')]['message']);}})[_0xcde2('0x17')](function(_0x198840){logger[_0xcde2('0x12')](_0xcde2('0xe'),_0x2b27ef,_0x198840);_0x544235(_0x198840);});});}exports['GetSalesforceAccount']=function(_0x4fd5aa){var _0x4fe586=this;return new Promise(function(_0x2b4468,_0x582e84){return db[_0xcde2('0x18')][_0xcde2('0x19')]({'raw':_0x4fd5aa[_0xcde2('0x1a')]?_0x4fd5aa['options'][_0xcde2('0x1b')]===undefined?!![]:![]:!![],'where':_0x4fd5aa[_0xcde2('0x1a')]?_0x4fd5aa[_0xcde2('0x1a')][_0xcde2('0x1c')]||null:null,'attributes':_0x4fd5aa[_0xcde2('0x1a')]?_0x4fd5aa['options']['attributes']||null:null,'limit':_0x4fd5aa['options']?_0x4fd5aa[_0xcde2('0x1a')][_0xcde2('0x1d')]||null:null,'include':_0x4fd5aa[_0xcde2('0x1a')]?_0x4fd5aa[_0xcde2('0x1a')][_0xcde2('0x1e')]?_['map'](_0x4fd5aa[_0xcde2('0x1a')]['include'],function(_0x280d8c){return{'model':db[_0x280d8c[_0xcde2('0x1f')]],'as':_0x280d8c['as'],'attributes':_0x280d8c[_0xcde2('0x20')],'include':_0x280d8c['include']?_['map'](_0x280d8c[_0xcde2('0x1e')],function(_0x207a12){return{'model':db[_0x207a12[_0xcde2('0x1f')]],'as':_0x207a12['as'],'attributes':_0x207a12[_0xcde2('0x20')],'include':_0x207a12[_0xcde2('0x1e')]?_['map'](_0x207a12[_0xcde2('0x1e')],function(_0x45275a){return{'model':db[_0x45275a[_0xcde2('0x1f')]],'as':_0x45275a['as'],'attributes':_0x45275a['attributes']};}):[]};}):[]};}):[]:[]})[_0xcde2('0xd')](function(_0x348ca1){logger[_0xcde2('0x15')](_0xcde2('0x21'),_0x4fd5aa);logger[_0xcde2('0x10')](_0xcde2('0x21'),_0x4fd5aa,JSON[_0xcde2('0x22')](_0x348ca1));_0x2b4468(_0x348ca1);})[_0xcde2('0x17')](function(_0x5bf1e6){logger[_0xcde2('0x12')]('GetSalesforceAccount',_0x5bf1e6[_0xcde2('0x14')],_0x4fd5aa);_0x582e84(_0x4fe586[_0xcde2('0x12')](0x1f4,_0x5bf1e6[_0xcde2('0x14')]));});});};exports['ShowSalesforceAccount']=function(_0xae46dc){var _0x28fedd=this;return new Promise(function(_0x58afb1,_0x26ec42){return db[_0xcde2('0x18')][_0xcde2('0x23')]({'raw':_0xae46dc[_0xcde2('0x1a')]?_0xae46dc[_0xcde2('0x1a')][_0xcde2('0x1b')]===undefined?!![]:![]:!![],'where':_0xae46dc[_0xcde2('0x1a')]?_0xae46dc[_0xcde2('0x1a')]['where']||null:null,'attributes':_0xae46dc[_0xcde2('0x1a')]?_0xae46dc[_0xcde2('0x1a')][_0xcde2('0x20')]||null:null,'include':_0xae46dc[_0xcde2('0x1a')]?_0xae46dc['options'][_0xcde2('0x1e')]?_[_0xcde2('0x24')](_0xae46dc[_0xcde2('0x1a')][_0xcde2('0x1e')],function(_0x498339){return{'model':db[_0x498339[_0xcde2('0x1f')]],'as':_0x498339['as'],'attributes':_0x498339[_0xcde2('0x20')],'include':_0x498339[_0xcde2('0x1e')]?_[_0xcde2('0x24')](_0x498339['include'],function(_0xb9c8d2){return{'model':db[_0xb9c8d2[_0xcde2('0x1f')]],'as':_0xb9c8d2['as'],'attributes':_0xb9c8d2[_0xcde2('0x20')],'include':_0xb9c8d2[_0xcde2('0x1e')]?_[_0xcde2('0x24')](_0xb9c8d2['include'],function(_0x2cd313){return{'model':db[_0x2cd313[_0xcde2('0x1f')]],'as':_0x2cd313['as'],'attributes':_0x2cd313[_0xcde2('0x20')]};}):[]};}):[]};}):[]:[]})[_0xcde2('0xd')](function(_0x4a64c1){logger['info'](_0xcde2('0x25'),_0xae46dc);logger[_0xcde2('0x10')](_0xcde2('0x25'),_0xae46dc,JSON[_0xcde2('0x22')](_0x4a64c1));_0x58afb1(_0x4a64c1);})[_0xcde2('0x17')](function(_0x45af6e){logger[_0xcde2('0x12')](_0xcde2('0x25'),_0x45af6e[_0xcde2('0x14')],_0xae46dc);_0x26ec42(_0x28fedd['error'](0x1f4,_0x45af6e[_0xcde2('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/index.js b/server/api/intSalesforceConfiguration/index.js index 077a56b..693a730 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 _0xd58d=['index','/:id','show','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','post','create','put','delete','destroy','exports','multer','util','path','../../components/auth/service','../../config/environment','get','isAuthenticated'];(function(_0xb3ac16,_0x429c90){var _0x5251a8=function(_0x4c9d5b){while(--_0x4c9d5b){_0xb3ac16['push'](_0xb3ac16['shift']());}};_0x5251a8(++_0x429c90);}(_0xd58d,0x161));var _0xdd58=function(_0x4364eb,_0x157d08){_0x4364eb=_0x4364eb-0x0;var _0x59691a=_0xd58d[_0x4364eb];return _0x59691a;};'use strict';var multer=require(_0xdd58('0x0'));var util=require(_0xdd58('0x1'));var path=require(_0xdd58('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var auth=require(_0xdd58('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xdd58('0x4'));var controller=require('./intSalesforceConfiguration.controller');router[_0xdd58('0x5')]('/',auth[_0xdd58('0x6')](),controller[_0xdd58('0x7')]);router['get'](_0xdd58('0x8'),auth[_0xdd58('0x6')](),controller[_0xdd58('0x9')]);router[_0xdd58('0x5')](_0xdd58('0xa'),auth[_0xdd58('0x6')](),controller['getFields']);router[_0xdd58('0x5')](_0xdd58('0xb'),auth[_0xdd58('0x6')](),controller[_0xdd58('0xc')]);router[_0xdd58('0x5')](_0xdd58('0xd'),auth['isAuthenticated'](),controller['getDescriptions']);router[_0xdd58('0xe')]('/',auth['isAuthenticated'](),controller[_0xdd58('0xf')]);router[_0xdd58('0x10')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0xdd58('0x11')]('/:id',auth[_0xdd58('0x6')](),controller[_0xdd58('0x12')]);module[_0xdd58('0x13')]=router; \ No newline at end of file +var _0xf884=['destroy','exports','multer','util','path','express','Router','../../components/auth/service','./intSalesforceConfiguration.controller','isAuthenticated','get','/:id','show','/:id/fields','getFields','getSubjects','getDescriptions','post','create','put','update'];(function(_0x576170,_0x1712ae){var _0x397c70=function(_0x2eb9de){while(--_0x2eb9de){_0x576170['push'](_0x576170['shift']());}};_0x397c70(++_0x1712ae);}(_0xf884,0x1a6));var _0x4f88=function(_0x3bf771,_0x12d857){_0x3bf771=_0x3bf771-0x0;var _0x3f4875=_0xf884[_0x3bf771];return _0x3f4875;};'use strict';var multer=require(_0x4f88('0x0'));var util=require(_0x4f88('0x1'));var path=require(_0x4f88('0x2'));var timeout=require('connect-timeout');var express=require(_0x4f88('0x3'));var router=express[_0x4f88('0x4')]();var auth=require(_0x4f88('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x4f88('0x6'));router['get']('/',auth[_0x4f88('0x7')](),controller['index']);router[_0x4f88('0x8')](_0x4f88('0x9'),auth[_0x4f88('0x7')](),controller[_0x4f88('0xa')]);router[_0x4f88('0x8')](_0x4f88('0xb'),auth[_0x4f88('0x7')](),controller[_0x4f88('0xc')]);router[_0x4f88('0x8')]('/:id/subjects',auth['isAuthenticated'](),controller[_0x4f88('0xd')]);router[_0x4f88('0x8')]('/:id/descriptions',auth[_0x4f88('0x7')](),controller[_0x4f88('0xe')]);router[_0x4f88('0xf')]('/',auth[_0x4f88('0x7')](),controller[_0x4f88('0x10')]);router[_0x4f88('0x11')](_0x4f88('0x9'),auth[_0x4f88('0x7')](),controller[_0x4f88('0x12')]);router['delete']('/:id',auth[_0x4f88('0x7')](),controller[_0x4f88('0x13')]);module[_0x4f88('0x14')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js index 957fd91..f058eea 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 _0x43a3=['ENUM','Case','Task','lead','contact_lead','nothing','contact','sequelize','STRING'];(function(_0xf70f77,_0x16539c){var _0x1fc355=function(_0x346a0f){while(--_0x346a0f){_0xf70f77['push'](_0xf70f77['shift']());}};_0x1fc355(++_0x16539c);}(_0x43a3,0x139));var _0x343a=function(_0x32a330,_0xe1a618){_0x32a330=_0x32a330-0x0;var _0x62c762=_0x43a3[_0x32a330];return _0x62c762;};'use strict';var Sequelize=require(_0x343a('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x343a('0x1')]},'ticketType':{'type':Sequelize[_0x343a('0x2')]('Task',_0x343a('0x3')),'defaultValue':_0x343a('0x4')},'moduleSearch':{'type':Sequelize[_0x343a('0x2')]('contact_lead','contact',_0x343a('0x5')),'defaultValue':_0x343a('0x6')},'moduleCreate':{'type':Sequelize['ENUM'](_0x343a('0x7'),_0x343a('0x8'),_0x343a('0x5')),'defaultValue':_0x343a('0x5')}}; \ No newline at end of file +var _0xcdc6=['Case','contact_lead','contact','lead','nothing','sequelize','exports','STRING','ENUM','Task'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xcdc6,0x1a9));var _0x6cdc=function(_0x420f82,_0x168133){_0x420f82=_0x420f82-0x0;var _0x371983=_0xcdc6[_0x420f82];return _0x371983;};'use strict';var Sequelize=require(_0x6cdc('0x0'));module[_0x6cdc('0x1')]={'name':{'type':Sequelize[_0x6cdc('0x2')]},'description':{'type':Sequelize[_0x6cdc('0x2')]},'ticketType':{'type':Sequelize[_0x6cdc('0x3')](_0x6cdc('0x4'),_0x6cdc('0x5')),'defaultValue':_0x6cdc('0x4')},'moduleSearch':{'type':Sequelize[_0x6cdc('0x3')](_0x6cdc('0x6'),_0x6cdc('0x7'),_0x6cdc('0x8')),'defaultValue':_0x6cdc('0x6')},'moduleCreate':{'type':Sequelize[_0x6cdc('0x3')](_0x6cdc('0x9'),_0x6cdc('0x7'),_0x6cdc('0x8')),'defaultValue':_0x6cdc('0x8')}}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js index 15dabf9..579874f 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 _0x1bc9=['options','include','findAll','rows','catch','show','create','body','find','params','findOne','getFields','nolimit','getSubjects','SalesforceField','getDescriptions','html-pdf','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','jayson/promise','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','info','SalesforceConfiguration,\x20%s,\x20%s','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','sendStatus','status','end','json','count','offset','limit','reject','update','then','destroy','stack','name','send','SalesforceConfiguration','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','map','type','key','VIRTUAL','field'];(function(_0x2e4e19,_0x493b50){var _0x9ba20b=function(_0x2f6456){while(--_0x2f6456){_0x2e4e19['push'](_0x2e4e19['shift']());}};_0x9ba20b(++_0x493b50);}(_0x1bc9,0x1c8));var _0x91bc=function(_0x1266bc,_0x4aa145){_0x1266bc=_0x1266bc-0x0;var _0x5e8426=_0x1bc9[_0x1266bc];return _0x5e8426;};'use strict';var pdf=require(_0x91bc('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x91bc('0x1'));var zipdir=require(_0x91bc('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x91bc('0x3'));var moment=require('moment');var BPromise=require(_0x91bc('0x4'));var Mustache=require(_0x91bc('0x5'));var util=require(_0x91bc('0x6'));var path=require(_0x91bc('0x7'));var sox=require(_0x91bc('0x8'));var csv=require(_0x91bc('0x9'));var ejs=require(_0x91bc('0xa'));var fs=require('fs');var _=require(_0x91bc('0xb'));var squel=require(_0x91bc('0xc'));var crypto=require(_0x91bc('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x91bc('0xe'));var toCsv=require(_0x91bc('0x9'));var querystring=require(_0x91bc('0xf'));var Papa=require('papaparse');var Redis=require(_0x91bc('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x91bc('0x11'));var as=require(_0x91bc('0x12'));var hardwareService=require(_0x91bc('0x13'));var logger=require(_0x91bc('0x14'))(_0x91bc('0x15'));var utils=require(_0x91bc('0x16'));var config=require('../../config/environment');var db=require(_0x91bc('0x17'))['db'];var jayson=require(_0x91bc('0x18'));var client=jayson['client'][_0x91bc('0x19')]({'port':0x232a});function checkPasswordPattern(_0x3244d8,_0x537652,_0x127521){if(_0x127521){var _0x5076a2=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x5076a2[_0x91bc('0x1a')](_0x537652)){return _0x3244d8;}else{throw new Error(_0x91bc('0x1b'));}}else{return _0x3244d8;}}function respondWithRpcPromise(_0x46cbc2,_0x6f3262,_0x1fff5e,_0x1607ef){return new BPromise(function(_0x1e582d,_0x21524c){var _0x2c5e49=_0x1607ef||client;return _0x2c5e49['request'](_0x46cbc2,_0x1fff5e)['then'](function(_0x3e8693){logger[_0x91bc('0x1c')](_0x91bc('0x1d'),_0x6f3262,'request\x20sent');logger[_0x91bc('0x1e')](_0x91bc('0x1f'),_0x6f3262,_0x91bc('0x20'),JSON['stringify'](_0x3e8693));if(_0x3e8693[_0x91bc('0x21')]){if(_0x3e8693[_0x91bc('0x21')]['code']===0x1f4){logger[_0x91bc('0x21')](_0x91bc('0x1d'),_0x6f3262,_0x3e8693[_0x91bc('0x21')]['message']);return _0x21524c(_0x3e8693[_0x91bc('0x21')][_0x91bc('0x22')]);}logger['error']('SalesforceConfiguration,\x20%s,\x20%s',_0x6f3262,_0x3e8693[_0x91bc('0x21')]['message']);return _0x1e582d(_0x3e8693[_0x91bc('0x21')][_0x91bc('0x22')]);}else{logger[_0x91bc('0x1c')](_0x91bc('0x1d'),_0x6f3262,'request\x20sent');_0x1e582d(_0x3e8693[_0x91bc('0x23')]['message']);}})['catch'](function(_0x488402){logger['error'](_0x91bc('0x1d'),_0x6f3262,_0x488402);_0x21524c(_0x488402);});});}function respondWithStatusCode(_0x2bc276,_0x283816){_0x283816=_0x283816||0xcc;return function(_0x39971f){if(_0x39971f){return _0x2bc276[_0x91bc('0x24')](_0x283816);}return _0x2bc276[_0x91bc('0x25')](_0x283816)[_0x91bc('0x26')]();};}function respondWithResult(_0x8b4861,_0xad2258){_0xad2258=_0xad2258||0xc8;return function(_0x4e538d){if(_0x4e538d){return _0x8b4861[_0x91bc('0x25')](_0xad2258)[_0x91bc('0x27')](_0x4e538d);}};}function respondWithFilteredResult(_0x28ae20,_0x3ab083){return function(_0x20c374){if(_0x20c374){var _0x1456e7=_0x20c374[_0x91bc('0x28')],_0x4d415b=_0x3ab083['offset'],_0x5d783b=_0x3ab083[_0x91bc('0x29')]+_0x3ab083[_0x91bc('0x2a')],_0x531681;if(_0x5d783b>=_0x1456e7){_0x5d783b=_0x1456e7;_0x531681=0xc8;}else{_0x531681=0xce;}_0x28ae20[_0x91bc('0x25')](_0x531681);return _0x28ae20['set']('Content-Range',_0x4d415b+'-'+_0x5d783b+'/'+_0x1456e7)['json'](_0x20c374);}return null;};}function patchUpdates(_0x50adfb){return function(_0x58305f){try{jsonpatch['apply'](_0x58305f,_0x50adfb,!![]);}catch(_0xdc2813){return BPromise[_0x91bc('0x2b')](_0xdc2813);}return _0x58305f['save']();};}function saveUpdates(_0x4f5df6,_0x177f5f){return function(_0x5c92c1){if(_0x5c92c1){return _0x5c92c1[_0x91bc('0x2c')](_0x4f5df6)[_0x91bc('0x2d')](function(_0x19234e){return _0x19234e;});}return null;};}function removeEntity(_0x43b819,_0xb81073){return function(_0x22ccfa){if(_0x22ccfa){return _0x22ccfa[_0x91bc('0x2e')]()[_0x91bc('0x2d')](function(){_0x43b819[_0x91bc('0x25')](0xcc)[_0x91bc('0x26')]();});}};}function handleEntityNotFound(_0x1a223f,_0x3ad1c6){return function(_0x48b747){if(!_0x48b747){_0x1a223f[_0x91bc('0x24')](0x194);}return _0x48b747;};}function handleError(_0x563801,_0x4c65e5){_0x4c65e5=_0x4c65e5||0x1f4;return function(_0x21d804){logger['error'](_0x21d804[_0x91bc('0x2f')]);if(_0x21d804['name']){delete _0x21d804[_0x91bc('0x30')];}_0x563801[_0x91bc('0x25')](_0x4c65e5)[_0x91bc('0x31')](_0x21d804);};}exports['index']=function(_0x2176de,_0x5ad07d){var _0x14bbaa={},_0x201830={},_0x5b1656={'count':0x0,'rows':[]};var _0x2ebab4=db[_0x91bc('0x32')][_0x91bc('0x33')];_0x201830[_0x91bc('0x34')]=_[_0x91bc('0x35')](_0x2ebab4);_0x201830['query']=_[_0x91bc('0x35')](_0x2176de[_0x91bc('0x36')]);_0x201830[_0x91bc('0x37')]=_[_0x91bc('0x38')](_0x201830[_0x91bc('0x34')],_0x201830['query']);_0x14bbaa[_0x91bc('0x39')]=_[_0x91bc('0x38')](_0x201830[_0x91bc('0x34')],qs[_0x91bc('0x3a')](_0x2176de['query'][_0x91bc('0x3a')]));_0x14bbaa[_0x91bc('0x39')]=_0x14bbaa['attributes'][_0x91bc('0x3b')]?_0x14bbaa[_0x91bc('0x39')]:_0x201830['model'];if(!_0x2176de[_0x91bc('0x36')][_0x91bc('0x3c')]('nolimit')){_0x14bbaa[_0x91bc('0x2a')]=qs[_0x91bc('0x2a')](_0x2176de[_0x91bc('0x36')]['limit']);_0x14bbaa[_0x91bc('0x29')]=qs[_0x91bc('0x29')](_0x2176de[_0x91bc('0x36')][_0x91bc('0x29')]);}_0x14bbaa[_0x91bc('0x3d')]=qs[_0x91bc('0x3e')](_0x2176de['query']['sort']);_0x14bbaa[_0x91bc('0x3f')]=qs[_0x91bc('0x37')](_[_0x91bc('0x40')](_0x2176de['query'],_0x201830[_0x91bc('0x37')]));if(_0x2176de[_0x91bc('0x36')][_0x91bc('0x41')]){_0x14bbaa[_0x91bc('0x3f')]=_[_0x91bc('0x42')](_0x14bbaa['where'],{'$or':_[_0x91bc('0x43')](_0x2ebab4,function(_0x2cd663){if(_0x2cd663[_0x91bc('0x44')][_0x91bc('0x45')]!==_0x91bc('0x46')){var _0x50f7b1={};_0x50f7b1[_0x2cd663[_0x91bc('0x47')]]={'$like':'%'+_0x2176de['query']['filter']+'%'};return _0x50f7b1;}})});}_0x14bbaa=_[_0x91bc('0x42')]({},_0x14bbaa,_0x2176de[_0x91bc('0x48')]);var _0x477101={'where':_0x14bbaa[_0x91bc('0x3f')]};return db[_0x91bc('0x32')][_0x91bc('0x28')](_0x477101)[_0x91bc('0x2d')](function(_0x5146a7){_0x5b1656[_0x91bc('0x28')]=_0x5146a7;if(_0x2176de[_0x91bc('0x36')]['includeAll']){_0x14bbaa[_0x91bc('0x49')]=[{'all':!![]}];}return db[_0x91bc('0x32')][_0x91bc('0x4a')](_0x14bbaa);})[_0x91bc('0x2d')](function(_0x507101){_0x5b1656[_0x91bc('0x4b')]=_0x507101;return _0x5b1656;})[_0x91bc('0x2d')](respondWithFilteredResult(_0x5ad07d,_0x14bbaa))[_0x91bc('0x4c')](handleError(_0x5ad07d,null));};exports[_0x91bc('0x4d')]=function(_0x283e2f,_0x56f039){var _0x35d7f7={'raw':![],'where':{'id':_0x283e2f['params']['id']}},_0x56c25f={};_0x56c25f[_0x91bc('0x34')]=_[_0x91bc('0x35')](db[_0x91bc('0x32')][_0x91bc('0x33')]);_0x56c25f[_0x91bc('0x36')]=_[_0x91bc('0x35')](_0x283e2f[_0x91bc('0x36')]);_0x56c25f[_0x91bc('0x37')]=_[_0x91bc('0x38')](_0x56c25f[_0x91bc('0x34')],_0x56c25f[_0x91bc('0x36')]);_0x35d7f7[_0x91bc('0x39')]=_[_0x91bc('0x38')](_0x56c25f[_0x91bc('0x34')],qs['fields'](_0x283e2f['query'][_0x91bc('0x3a')]));_0x35d7f7[_0x91bc('0x39')]=_0x35d7f7[_0x91bc('0x39')]['length']?_0x35d7f7[_0x91bc('0x39')]:_0x56c25f[_0x91bc('0x34')];if(_0x283e2f[_0x91bc('0x36')]['includeAll']){_0x35d7f7[_0x91bc('0x49')]=[{'all':!![]}];}_0x35d7f7=_[_0x91bc('0x42')]({},_0x35d7f7,_0x283e2f[_0x91bc('0x48')]);return db[_0x91bc('0x32')]['find'](_0x35d7f7)[_0x91bc('0x2d')](handleEntityNotFound(_0x56f039,null))[_0x91bc('0x2d')](respondWithResult(_0x56f039,null))[_0x91bc('0x4c')](handleError(_0x56f039,null));};exports['create']=function(_0x46889f,_0x2d33f5){return db[_0x91bc('0x32')][_0x91bc('0x4e')](_0x46889f['body'],{})[_0x91bc('0x2d')](respondWithResult(_0x2d33f5,0xc9))['catch'](handleError(_0x2d33f5,null));};exports[_0x91bc('0x2c')]=function(_0x5f331d,_0x2ceeac){if(_0x5f331d[_0x91bc('0x4f')]['id']){delete _0x5f331d['body']['id'];}return db[_0x91bc('0x32')][_0x91bc('0x50')]({'where':{'id':_0x5f331d[_0x91bc('0x51')]['id']}})['then'](handleEntityNotFound(_0x2ceeac,null))[_0x91bc('0x2d')](saveUpdates(_0x5f331d[_0x91bc('0x4f')],null))[_0x91bc('0x2d')](respondWithResult(_0x2ceeac,null))[_0x91bc('0x4c')](handleError(_0x2ceeac,null));};exports['destroy']=function(_0x37ef46,_0x33ef15){return db['SalesforceConfiguration'][_0x91bc('0x50')]({'where':{'id':_0x37ef46[_0x91bc('0x51')]['id']}})[_0x91bc('0x2d')](handleEntityNotFound(_0x33ef15,null))[_0x91bc('0x2d')](removeEntity(_0x33ef15,null))['catch'](handleError(_0x33ef15,null));};exports['getFields']=function(_0x3720ee,_0x7b6601,_0x1107f4){var _0x45a547={};var _0x5a9359={};var _0x1b91a9;var _0x16389f;return db[_0x91bc('0x32')][_0x91bc('0x52')]({'where':{'id':_0x3720ee[_0x91bc('0x51')]['id']}})[_0x91bc('0x2d')](handleEntityNotFound(_0x7b6601,null))[_0x91bc('0x2d')](function(_0x55fc7d){if(_0x55fc7d){_0x1b91a9=_0x55fc7d;_0x5a9359[_0x91bc('0x34')]=_['keys'](db['SalesforceField']['rawAttributes']);_0x5a9359[_0x91bc('0x36')]=_[_0x91bc('0x35')](_0x3720ee[_0x91bc('0x36')]);_0x5a9359['filters']=_[_0x91bc('0x38')](_0x5a9359[_0x91bc('0x34')],_0x5a9359[_0x91bc('0x36')]);_0x45a547[_0x91bc('0x39')]=_[_0x91bc('0x38')](_0x5a9359['model'],qs[_0x91bc('0x3a')](_0x3720ee[_0x91bc('0x36')]['fields']));_0x45a547['attributes']=_0x45a547[_0x91bc('0x39')][_0x91bc('0x3b')]?_0x45a547[_0x91bc('0x39')]:_0x5a9359['model'];_0x45a547[_0x91bc('0x3d')]=qs[_0x91bc('0x3e')](_0x3720ee[_0x91bc('0x36')]['sort']);_0x45a547[_0x91bc('0x3f')]=qs[_0x91bc('0x37')](_[_0x91bc('0x40')](_0x3720ee[_0x91bc('0x36')],_0x5a9359[_0x91bc('0x37')]));if(_0x3720ee[_0x91bc('0x36')][_0x91bc('0x41')]){_0x45a547[_0x91bc('0x3f')]=_[_0x91bc('0x42')](_0x45a547[_0x91bc('0x3f')],{'$or':_[_0x91bc('0x43')](_0x45a547['attributes'],function(_0x4540b5){var _0x2a8038={};_0x2a8038[_0x4540b5]={'$like':'%'+_0x3720ee[_0x91bc('0x36')][_0x91bc('0x41')]+'%'};return _0x2a8038;})});}_0x45a547=_['merge']({},_0x45a547,_0x3720ee[_0x91bc('0x48')]);return _0x1b91a9[_0x91bc('0x53')](_0x45a547);}})[_0x91bc('0x2d')](function(_0x5d2e65){if(_0x5d2e65){_0x16389f=_0x5d2e65[_0x91bc('0x3b')];if(!_0x3720ee[_0x91bc('0x36')]['hasOwnProperty'](_0x91bc('0x54'))){_0x45a547['limit']=qs[_0x91bc('0x2a')](_0x3720ee[_0x91bc('0x36')][_0x91bc('0x2a')]);_0x45a547[_0x91bc('0x29')]=qs[_0x91bc('0x29')](_0x3720ee[_0x91bc('0x36')]['offset']);}return _0x1b91a9[_0x91bc('0x53')](_0x45a547);}})[_0x91bc('0x2d')](function(_0x5dca25){if(_0x5dca25){return _0x5dca25?{'count':_0x16389f,'rows':_0x5dca25}:null;}})[_0x91bc('0x2d')](respondWithResult(_0x7b6601,null))[_0x91bc('0x4c')](handleError(_0x7b6601,null));};exports[_0x91bc('0x55')]=function(_0x37d9fc,_0x442bba,_0x2f9325){var _0x2f93be={};var _0x57158d={};var _0x179657;var _0x5ad5db;return db[_0x91bc('0x32')][_0x91bc('0x52')]({'where':{'id':_0x37d9fc[_0x91bc('0x51')]['id']}})[_0x91bc('0x2d')](handleEntityNotFound(_0x442bba,null))[_0x91bc('0x2d')](function(_0x500b7b){if(_0x500b7b){_0x179657=_0x500b7b;_0x57158d[_0x91bc('0x34')]=_[_0x91bc('0x35')](db[_0x91bc('0x56')][_0x91bc('0x33')]);_0x57158d[_0x91bc('0x36')]=_[_0x91bc('0x35')](_0x37d9fc[_0x91bc('0x36')]);_0x57158d['filters']=_[_0x91bc('0x38')](_0x57158d['model'],_0x57158d[_0x91bc('0x36')]);_0x2f93be[_0x91bc('0x39')]=_[_0x91bc('0x38')](_0x57158d['model'],qs['fields'](_0x37d9fc[_0x91bc('0x36')]['fields']));_0x2f93be[_0x91bc('0x39')]=_0x2f93be[_0x91bc('0x39')]['length']?_0x2f93be[_0x91bc('0x39')]:_0x57158d['model'];_0x2f93be[_0x91bc('0x3d')]=qs['sort'](_0x37d9fc['query'][_0x91bc('0x3e')]);_0x2f93be[_0x91bc('0x3f')]=qs[_0x91bc('0x37')](_[_0x91bc('0x40')](_0x37d9fc[_0x91bc('0x36')],_0x57158d[_0x91bc('0x37')]));if(_0x37d9fc[_0x91bc('0x36')][_0x91bc('0x41')]){_0x2f93be['where']=_[_0x91bc('0x42')](_0x2f93be[_0x91bc('0x3f')],{'$or':_[_0x91bc('0x43')](_0x2f93be['attributes'],function(_0x527a01){var _0x23ff93={};_0x23ff93[_0x527a01]={'$like':'%'+_0x37d9fc[_0x91bc('0x36')][_0x91bc('0x41')]+'%'};return _0x23ff93;})});}_0x2f93be=_[_0x91bc('0x42')]({},_0x2f93be,_0x37d9fc[_0x91bc('0x48')]);return _0x179657['getSubjects'](_0x2f93be);}})[_0x91bc('0x2d')](function(_0x18c313){if(_0x18c313){_0x5ad5db=_0x18c313[_0x91bc('0x3b')];if(!_0x37d9fc[_0x91bc('0x36')]['hasOwnProperty'](_0x91bc('0x54'))){_0x2f93be[_0x91bc('0x2a')]=qs[_0x91bc('0x2a')](_0x37d9fc[_0x91bc('0x36')][_0x91bc('0x2a')]);_0x2f93be[_0x91bc('0x29')]=qs[_0x91bc('0x29')](_0x37d9fc[_0x91bc('0x36')][_0x91bc('0x29')]);}return _0x179657['getSubjects'](_0x2f93be);}})[_0x91bc('0x2d')](function(_0xcf19da){if(_0xcf19da){return _0xcf19da?{'count':_0x5ad5db,'rows':_0xcf19da}:null;}})['then'](respondWithResult(_0x442bba,null))['catch'](handleError(_0x442bba,null));};exports['getDescriptions']=function(_0x298e90,_0x31130a,_0x15de9d){var _0x3195f5={};var _0x3c6d7c={};var _0x2fcf1d;var _0x543880;return db[_0x91bc('0x32')]['findOne']({'where':{'id':_0x298e90[_0x91bc('0x51')]['id']}})[_0x91bc('0x2d')](handleEntityNotFound(_0x31130a,null))[_0x91bc('0x2d')](function(_0xf21ac4){if(_0xf21ac4){_0x2fcf1d=_0xf21ac4;_0x3c6d7c[_0x91bc('0x34')]=_[_0x91bc('0x35')](db[_0x91bc('0x56')][_0x91bc('0x33')]);_0x3c6d7c[_0x91bc('0x36')]=_[_0x91bc('0x35')](_0x298e90[_0x91bc('0x36')]);_0x3c6d7c['filters']=_[_0x91bc('0x38')](_0x3c6d7c[_0x91bc('0x34')],_0x3c6d7c[_0x91bc('0x36')]);_0x3195f5[_0x91bc('0x39')]=_[_0x91bc('0x38')](_0x3c6d7c[_0x91bc('0x34')],qs[_0x91bc('0x3a')](_0x298e90['query']['fields']));_0x3195f5[_0x91bc('0x39')]=_0x3195f5[_0x91bc('0x39')][_0x91bc('0x3b')]?_0x3195f5[_0x91bc('0x39')]:_0x3c6d7c['model'];_0x3195f5['order']=qs[_0x91bc('0x3e')](_0x298e90[_0x91bc('0x36')]['sort']);_0x3195f5[_0x91bc('0x3f')]=qs[_0x91bc('0x37')](_[_0x91bc('0x40')](_0x298e90[_0x91bc('0x36')],_0x3c6d7c[_0x91bc('0x37')]));if(_0x298e90[_0x91bc('0x36')]['filter']){_0x3195f5[_0x91bc('0x3f')]=_[_0x91bc('0x42')](_0x3195f5[_0x91bc('0x3f')],{'$or':_[_0x91bc('0x43')](_0x3195f5[_0x91bc('0x39')],function(_0xb00ada){var _0x277fdd={};_0x277fdd[_0xb00ada]={'$like':'%'+_0x298e90[_0x91bc('0x36')][_0x91bc('0x41')]+'%'};return _0x277fdd;})});}_0x3195f5=_[_0x91bc('0x42')]({},_0x3195f5,_0x298e90[_0x91bc('0x48')]);return _0x2fcf1d[_0x91bc('0x57')](_0x3195f5);}})[_0x91bc('0x2d')](function(_0x233430){if(_0x233430){_0x543880=_0x233430[_0x91bc('0x3b')];if(!_0x298e90[_0x91bc('0x36')]['hasOwnProperty'](_0x91bc('0x54'))){_0x3195f5[_0x91bc('0x2a')]=qs[_0x91bc('0x2a')](_0x298e90['query'][_0x91bc('0x2a')]);_0x3195f5[_0x91bc('0x29')]=qs['offset'](_0x298e90[_0x91bc('0x36')][_0x91bc('0x29')]);}return _0x2fcf1d[_0x91bc('0x57')](_0x3195f5);}})[_0x91bc('0x2d')](function(_0x784849){if(_0x784849){return _0x784849?{'count':_0x543880,'rows':_0x784849}:null;}})['then'](respondWithResult(_0x31130a,null))[_0x91bc('0x4c')](handleError(_0x31130a,null));}; \ No newline at end of file +var _0xf0e4=['options','nolimit','getSubjects','hasOwnProperty','getDescriptions','html-pdf','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','client','http','request','info','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','sendStatus','status','json','offset','set','Content-Range','apply','save','then','destroy','end','stack','name','send','SalesforceConfiguration','model','keys','query','filters','attributes','intersection','fields','length','limit','sort','where','pick','filter','merge','map','key','field','count','includeAll','include','rows','show','params','rawAttributes','find','create','body','findOne','SalesforceField','order'];(function(_0x5817e6,_0x44a2d0){var _0x51916a=function(_0x1a56e3){while(--_0x1a56e3){_0x5817e6['push'](_0x5817e6['shift']());}};_0x51916a(++_0x44a2d0);}(_0xf0e4,0xad));var _0x4f0e=function(_0x436543,_0x1c7356){_0x436543=_0x436543-0x0;var _0x37ab59=_0xf0e4[_0x436543];return _0x37ab59;};'use strict';var pdf=require(_0x4f0e('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x4f0e('0x1'));var rp=require(_0x4f0e('0x2'));var moment=require(_0x4f0e('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x4f0e('0x4'));var util=require('util');var path=require(_0x4f0e('0x5'));var sox=require(_0x4f0e('0x6'));var csv=require(_0x4f0e('0x7'));var ejs=require(_0x4f0e('0x8'));var fs=require('fs');var _=require(_0x4f0e('0x9'));var squel=require(_0x4f0e('0xa'));var crypto=require(_0x4f0e('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x4f0e('0x7'));var querystring=require(_0x4f0e('0xc'));var Papa=require(_0x4f0e('0xd'));var Redis=require('ioredis');var authService=require(_0x4f0e('0xe'));var qs=require(_0x4f0e('0xf'));var as=require(_0x4f0e('0x10'));var hardwareService=require(_0x4f0e('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0x4f0e('0x12'));var config=require(_0x4f0e('0x13'));var db=require(_0x4f0e('0x14'))['db'];var jayson=require('jayson/promise');var client=jayson[_0x4f0e('0x15')][_0x4f0e('0x16')]({'port':0x232a});function checkPasswordPattern(_0x3524d4,_0x30dc25,_0x1e0a71){if(_0x1e0a71){var _0x564acf=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x564acf['test'](_0x30dc25)){return _0x3524d4;}else{throw new Error('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x3524d4;}}function respondWithRpcPromise(_0x943919,_0x2c426d,_0x362991,_0x24b72d){return new BPromise(function(_0x4ee99c,_0x43eeb6){var _0x208eb4=_0x24b72d||client;return _0x208eb4[_0x4f0e('0x17')](_0x943919,_0x362991)['then'](function(_0x111c18){logger[_0x4f0e('0x18')](_0x4f0e('0x19'),_0x2c426d,_0x4f0e('0x1a'));logger['debug'](_0x4f0e('0x1b'),_0x2c426d,_0x4f0e('0x1a'),JSON[_0x4f0e('0x1c')](_0x111c18));if(_0x111c18['error']){if(_0x111c18['error'][_0x4f0e('0x1d')]===0x1f4){logger[_0x4f0e('0x1e')](_0x4f0e('0x19'),_0x2c426d,_0x111c18[_0x4f0e('0x1e')][_0x4f0e('0x1f')]);return _0x43eeb6(_0x111c18['error'][_0x4f0e('0x1f')]);}logger['error'](_0x4f0e('0x19'),_0x2c426d,_0x111c18[_0x4f0e('0x1e')]['message']);return _0x4ee99c(_0x111c18[_0x4f0e('0x1e')]['message']);}else{logger[_0x4f0e('0x18')]('SalesforceConfiguration,\x20%s,\x20%s',_0x2c426d,_0x4f0e('0x1a'));_0x4ee99c(_0x111c18[_0x4f0e('0x20')][_0x4f0e('0x1f')]);}})[_0x4f0e('0x21')](function(_0x14433a){logger[_0x4f0e('0x1e')]('SalesforceConfiguration,\x20%s,\x20%s',_0x2c426d,_0x14433a);_0x43eeb6(_0x14433a);});});}function respondWithStatusCode(_0x514ebd,_0x384923){_0x384923=_0x384923||0xcc;return function(_0x1cad29){if(_0x1cad29){return _0x514ebd[_0x4f0e('0x22')](_0x384923);}return _0x514ebd[_0x4f0e('0x23')](_0x384923)['end']();};}function respondWithResult(_0x571000,_0x20450b){_0x20450b=_0x20450b||0xc8;return function(_0x1ea87f){if(_0x1ea87f){return _0x571000['status'](_0x20450b)[_0x4f0e('0x24')](_0x1ea87f);}};}function respondWithFilteredResult(_0x1b85c4,_0x3c9787){return function(_0x20b021){if(_0x20b021){var _0x45aac9=_0x20b021['count'],_0x24d494=_0x3c9787[_0x4f0e('0x25')],_0x148784=_0x3c9787['offset']+_0x3c9787['limit'],_0x11063a;if(_0x148784>=_0x45aac9){_0x148784=_0x45aac9;_0x11063a=0xc8;}else{_0x11063a=0xce;}_0x1b85c4['status'](_0x11063a);return _0x1b85c4[_0x4f0e('0x26')](_0x4f0e('0x27'),_0x24d494+'-'+_0x148784+'/'+_0x45aac9)['json'](_0x20b021);}return null;};}function patchUpdates(_0x219f34){return function(_0x4c5cec){try{jsonpatch[_0x4f0e('0x28')](_0x4c5cec,_0x219f34,!![]);}catch(_0x4ab28c){return BPromise['reject'](_0x4ab28c);}return _0x4c5cec[_0x4f0e('0x29')]();};}function saveUpdates(_0x538f1a,_0x1261a1){return function(_0x1a612b){if(_0x1a612b){return _0x1a612b['update'](_0x538f1a)[_0x4f0e('0x2a')](function(_0x4e20f7){return _0x4e20f7;});}return null;};}function removeEntity(_0x3194f9,_0x203f8c){return function(_0x2fa3f4){if(_0x2fa3f4){return _0x2fa3f4[_0x4f0e('0x2b')]()[_0x4f0e('0x2a')](function(){_0x3194f9['status'](0xcc)[_0x4f0e('0x2c')]();});}};}function handleEntityNotFound(_0x2e2766,_0xcb1d){return function(_0x2df446){if(!_0x2df446){_0x2e2766['sendStatus'](0x194);}return _0x2df446;};}function handleError(_0x423619,_0x5954ad){_0x5954ad=_0x5954ad||0x1f4;return function(_0xa8e4d1){logger[_0x4f0e('0x1e')](_0xa8e4d1[_0x4f0e('0x2d')]);if(_0xa8e4d1[_0x4f0e('0x2e')]){delete _0xa8e4d1[_0x4f0e('0x2e')];}_0x423619[_0x4f0e('0x23')](_0x5954ad)[_0x4f0e('0x2f')](_0xa8e4d1);};}exports['index']=function(_0x164b9b,_0x5131b0){var _0x3ed048={},_0x517395={},_0xa5509d={'count':0x0,'rows':[]};var _0x564e2b=db[_0x4f0e('0x30')]['rawAttributes'];_0x517395[_0x4f0e('0x31')]=_[_0x4f0e('0x32')](_0x564e2b);_0x517395[_0x4f0e('0x33')]=_[_0x4f0e('0x32')](_0x164b9b[_0x4f0e('0x33')]);_0x517395[_0x4f0e('0x34')]=_['intersection'](_0x517395['model'],_0x517395[_0x4f0e('0x33')]);_0x3ed048[_0x4f0e('0x35')]=_[_0x4f0e('0x36')](_0x517395[_0x4f0e('0x31')],qs[_0x4f0e('0x37')](_0x164b9b[_0x4f0e('0x33')][_0x4f0e('0x37')]));_0x3ed048['attributes']=_0x3ed048[_0x4f0e('0x35')][_0x4f0e('0x38')]?_0x3ed048[_0x4f0e('0x35')]:_0x517395[_0x4f0e('0x31')];if(!_0x164b9b[_0x4f0e('0x33')]['hasOwnProperty']('nolimit')){_0x3ed048[_0x4f0e('0x39')]=qs['limit'](_0x164b9b[_0x4f0e('0x33')][_0x4f0e('0x39')]);_0x3ed048[_0x4f0e('0x25')]=qs[_0x4f0e('0x25')](_0x164b9b[_0x4f0e('0x33')][_0x4f0e('0x25')]);}_0x3ed048['order']=qs[_0x4f0e('0x3a')](_0x164b9b[_0x4f0e('0x33')]['sort']);_0x3ed048[_0x4f0e('0x3b')]=qs[_0x4f0e('0x34')](_[_0x4f0e('0x3c')](_0x164b9b[_0x4f0e('0x33')],_0x517395[_0x4f0e('0x34')]));if(_0x164b9b[_0x4f0e('0x33')][_0x4f0e('0x3d')]){_0x3ed048['where']=_[_0x4f0e('0x3e')](_0x3ed048[_0x4f0e('0x3b')],{'$or':_[_0x4f0e('0x3f')](_0x564e2b,function(_0x4085a8){if(_0x4085a8['type'][_0x4f0e('0x40')]!=='VIRTUAL'){var _0x321c25={};_0x321c25[_0x4085a8[_0x4f0e('0x41')]]={'$like':'%'+_0x164b9b[_0x4f0e('0x33')][_0x4f0e('0x3d')]+'%'};return _0x321c25;}})});}_0x3ed048=_['merge']({},_0x3ed048,_0x164b9b['options']);var _0x3181d1={'where':_0x3ed048[_0x4f0e('0x3b')]};return db[_0x4f0e('0x30')]['count'](_0x3181d1)['then'](function(_0x587472){_0xa5509d[_0x4f0e('0x42')]=_0x587472;if(_0x164b9b[_0x4f0e('0x33')][_0x4f0e('0x43')]){_0x3ed048[_0x4f0e('0x44')]=[{'all':!![]}];}return db[_0x4f0e('0x30')]['findAll'](_0x3ed048);})['then'](function(_0x5a8723){_0xa5509d[_0x4f0e('0x45')]=_0x5a8723;return _0xa5509d;})[_0x4f0e('0x2a')](respondWithFilteredResult(_0x5131b0,_0x3ed048))[_0x4f0e('0x21')](handleError(_0x5131b0,null));};exports[_0x4f0e('0x46')]=function(_0x13e6f2,_0x425475){var _0x535f63={'raw':![],'where':{'id':_0x13e6f2[_0x4f0e('0x47')]['id']}},_0x4c5e4f={};_0x4c5e4f['model']=_[_0x4f0e('0x32')](db['SalesforceConfiguration'][_0x4f0e('0x48')]);_0x4c5e4f[_0x4f0e('0x33')]=_[_0x4f0e('0x32')](_0x13e6f2['query']);_0x4c5e4f['filters']=_['intersection'](_0x4c5e4f[_0x4f0e('0x31')],_0x4c5e4f[_0x4f0e('0x33')]);_0x535f63[_0x4f0e('0x35')]=_[_0x4f0e('0x36')](_0x4c5e4f['model'],qs[_0x4f0e('0x37')](_0x13e6f2[_0x4f0e('0x33')][_0x4f0e('0x37')]));_0x535f63[_0x4f0e('0x35')]=_0x535f63[_0x4f0e('0x35')][_0x4f0e('0x38')]?_0x535f63[_0x4f0e('0x35')]:_0x4c5e4f[_0x4f0e('0x31')];if(_0x13e6f2['query'][_0x4f0e('0x43')]){_0x535f63[_0x4f0e('0x44')]=[{'all':!![]}];}_0x535f63=_['merge']({},_0x535f63,_0x13e6f2['options']);return db[_0x4f0e('0x30')][_0x4f0e('0x49')](_0x535f63)[_0x4f0e('0x2a')](handleEntityNotFound(_0x425475,null))[_0x4f0e('0x2a')](respondWithResult(_0x425475,null))['catch'](handleError(_0x425475,null));};exports[_0x4f0e('0x4a')]=function(_0x1a862a,_0x483870){return db['SalesforceConfiguration'][_0x4f0e('0x4a')](_0x1a862a['body'],{})[_0x4f0e('0x2a')](respondWithResult(_0x483870,0xc9))[_0x4f0e('0x21')](handleError(_0x483870,null));};exports['update']=function(_0x5996d1,_0x46a117){if(_0x5996d1[_0x4f0e('0x4b')]['id']){delete _0x5996d1['body']['id'];}return db['SalesforceConfiguration'][_0x4f0e('0x49')]({'where':{'id':_0x5996d1[_0x4f0e('0x47')]['id']}})[_0x4f0e('0x2a')](handleEntityNotFound(_0x46a117,null))[_0x4f0e('0x2a')](saveUpdates(_0x5996d1[_0x4f0e('0x4b')],null))[_0x4f0e('0x2a')](respondWithResult(_0x46a117,null))[_0x4f0e('0x21')](handleError(_0x46a117,null));};exports[_0x4f0e('0x2b')]=function(_0xced9de,_0x53c3ac){return db[_0x4f0e('0x30')][_0x4f0e('0x49')]({'where':{'id':_0xced9de[_0x4f0e('0x47')]['id']}})[_0x4f0e('0x2a')](handleEntityNotFound(_0x53c3ac,null))['then'](removeEntity(_0x53c3ac,null))['catch'](handleError(_0x53c3ac,null));};exports['getFields']=function(_0x402a4d,_0x2dcd6d,_0x49e911){var _0x1dbcb9={};var _0x62ed03={};var _0x2f4646;var _0x5f4f04;return db[_0x4f0e('0x30')][_0x4f0e('0x4c')]({'where':{'id':_0x402a4d[_0x4f0e('0x47')]['id']}})[_0x4f0e('0x2a')](handleEntityNotFound(_0x2dcd6d,null))[_0x4f0e('0x2a')](function(_0x48f95f){if(_0x48f95f){_0x2f4646=_0x48f95f;_0x62ed03['model']=_[_0x4f0e('0x32')](db[_0x4f0e('0x4d')][_0x4f0e('0x48')]);_0x62ed03[_0x4f0e('0x33')]=_[_0x4f0e('0x32')](_0x402a4d[_0x4f0e('0x33')]);_0x62ed03[_0x4f0e('0x34')]=_[_0x4f0e('0x36')](_0x62ed03[_0x4f0e('0x31')],_0x62ed03['query']);_0x1dbcb9[_0x4f0e('0x35')]=_[_0x4f0e('0x36')](_0x62ed03['model'],qs[_0x4f0e('0x37')](_0x402a4d['query'][_0x4f0e('0x37')]));_0x1dbcb9['attributes']=_0x1dbcb9[_0x4f0e('0x35')][_0x4f0e('0x38')]?_0x1dbcb9[_0x4f0e('0x35')]:_0x62ed03[_0x4f0e('0x31')];_0x1dbcb9[_0x4f0e('0x4e')]=qs[_0x4f0e('0x3a')](_0x402a4d[_0x4f0e('0x33')][_0x4f0e('0x3a')]);_0x1dbcb9[_0x4f0e('0x3b')]=qs[_0x4f0e('0x34')](_[_0x4f0e('0x3c')](_0x402a4d['query'],_0x62ed03['filters']));if(_0x402a4d[_0x4f0e('0x33')]['filter']){_0x1dbcb9[_0x4f0e('0x3b')]=_['merge'](_0x1dbcb9[_0x4f0e('0x3b')],{'$or':_[_0x4f0e('0x3f')](_0x1dbcb9[_0x4f0e('0x35')],function(_0x546799){var _0x73170d={};_0x73170d[_0x546799]={'$like':'%'+_0x402a4d[_0x4f0e('0x33')][_0x4f0e('0x3d')]+'%'};return _0x73170d;})});}_0x1dbcb9=_[_0x4f0e('0x3e')]({},_0x1dbcb9,_0x402a4d[_0x4f0e('0x4f')]);return _0x2f4646['getFields'](_0x1dbcb9);}})['then'](function(_0x50c469){if(_0x50c469){_0x5f4f04=_0x50c469[_0x4f0e('0x38')];if(!_0x402a4d['query']['hasOwnProperty'](_0x4f0e('0x50'))){_0x1dbcb9[_0x4f0e('0x39')]=qs['limit'](_0x402a4d['query'][_0x4f0e('0x39')]);_0x1dbcb9[_0x4f0e('0x25')]=qs[_0x4f0e('0x25')](_0x402a4d[_0x4f0e('0x33')][_0x4f0e('0x25')]);}return _0x2f4646['getFields'](_0x1dbcb9);}})['then'](function(_0x4e366e){if(_0x4e366e){return _0x4e366e?{'count':_0x5f4f04,'rows':_0x4e366e}:null;}})[_0x4f0e('0x2a')](respondWithResult(_0x2dcd6d,null))['catch'](handleError(_0x2dcd6d,null));};exports[_0x4f0e('0x51')]=function(_0x148cbe,_0x109d66,_0x577799){var _0x5b7b97={};var _0x20dbac={};var _0xba40b3;var _0x499102;return db[_0x4f0e('0x30')][_0x4f0e('0x4c')]({'where':{'id':_0x148cbe[_0x4f0e('0x47')]['id']}})[_0x4f0e('0x2a')](handleEntityNotFound(_0x109d66,null))['then'](function(_0x15e9e4){if(_0x15e9e4){_0xba40b3=_0x15e9e4;_0x20dbac['model']=_[_0x4f0e('0x32')](db['SalesforceField'][_0x4f0e('0x48')]);_0x20dbac[_0x4f0e('0x33')]=_[_0x4f0e('0x32')](_0x148cbe[_0x4f0e('0x33')]);_0x20dbac[_0x4f0e('0x34')]=_['intersection'](_0x20dbac[_0x4f0e('0x31')],_0x20dbac[_0x4f0e('0x33')]);_0x5b7b97[_0x4f0e('0x35')]=_[_0x4f0e('0x36')](_0x20dbac[_0x4f0e('0x31')],qs[_0x4f0e('0x37')](_0x148cbe[_0x4f0e('0x33')][_0x4f0e('0x37')]));_0x5b7b97[_0x4f0e('0x35')]=_0x5b7b97[_0x4f0e('0x35')][_0x4f0e('0x38')]?_0x5b7b97[_0x4f0e('0x35')]:_0x20dbac[_0x4f0e('0x31')];_0x5b7b97[_0x4f0e('0x4e')]=qs[_0x4f0e('0x3a')](_0x148cbe[_0x4f0e('0x33')]['sort']);_0x5b7b97[_0x4f0e('0x3b')]=qs[_0x4f0e('0x34')](_[_0x4f0e('0x3c')](_0x148cbe[_0x4f0e('0x33')],_0x20dbac[_0x4f0e('0x34')]));if(_0x148cbe[_0x4f0e('0x33')][_0x4f0e('0x3d')]){_0x5b7b97[_0x4f0e('0x3b')]=_[_0x4f0e('0x3e')](_0x5b7b97[_0x4f0e('0x3b')],{'$or':_[_0x4f0e('0x3f')](_0x5b7b97[_0x4f0e('0x35')],function(_0x57b73e){var _0x134313={};_0x134313[_0x57b73e]={'$like':'%'+_0x148cbe[_0x4f0e('0x33')][_0x4f0e('0x3d')]+'%'};return _0x134313;})});}_0x5b7b97=_[_0x4f0e('0x3e')]({},_0x5b7b97,_0x148cbe[_0x4f0e('0x4f')]);return _0xba40b3[_0x4f0e('0x51')](_0x5b7b97);}})[_0x4f0e('0x2a')](function(_0x10c6d0){if(_0x10c6d0){_0x499102=_0x10c6d0[_0x4f0e('0x38')];if(!_0x148cbe[_0x4f0e('0x33')][_0x4f0e('0x52')](_0x4f0e('0x50'))){_0x5b7b97[_0x4f0e('0x39')]=qs[_0x4f0e('0x39')](_0x148cbe['query'][_0x4f0e('0x39')]);_0x5b7b97[_0x4f0e('0x25')]=qs[_0x4f0e('0x25')](_0x148cbe['query'][_0x4f0e('0x25')]);}return _0xba40b3[_0x4f0e('0x51')](_0x5b7b97);}})['then'](function(_0x32276a){if(_0x32276a){return _0x32276a?{'count':_0x499102,'rows':_0x32276a}:null;}})[_0x4f0e('0x2a')](respondWithResult(_0x109d66,null))[_0x4f0e('0x21')](handleError(_0x109d66,null));};exports[_0x4f0e('0x53')]=function(_0x2fca6b,_0x5812a1,_0x40cc4e){var _0x32d88f={};var _0x485656={};var _0x2bcd62;var _0x2e6073;return db[_0x4f0e('0x30')][_0x4f0e('0x4c')]({'where':{'id':_0x2fca6b[_0x4f0e('0x47')]['id']}})['then'](handleEntityNotFound(_0x5812a1,null))['then'](function(_0x4d829c){if(_0x4d829c){_0x2bcd62=_0x4d829c;_0x485656['model']=_[_0x4f0e('0x32')](db[_0x4f0e('0x4d')]['rawAttributes']);_0x485656[_0x4f0e('0x33')]=_[_0x4f0e('0x32')](_0x2fca6b['query']);_0x485656[_0x4f0e('0x34')]=_[_0x4f0e('0x36')](_0x485656[_0x4f0e('0x31')],_0x485656[_0x4f0e('0x33')]);_0x32d88f['attributes']=_[_0x4f0e('0x36')](_0x485656[_0x4f0e('0x31')],qs['fields'](_0x2fca6b[_0x4f0e('0x33')]['fields']));_0x32d88f[_0x4f0e('0x35')]=_0x32d88f['attributes'][_0x4f0e('0x38')]?_0x32d88f[_0x4f0e('0x35')]:_0x485656['model'];_0x32d88f[_0x4f0e('0x4e')]=qs[_0x4f0e('0x3a')](_0x2fca6b['query'][_0x4f0e('0x3a')]);_0x32d88f['where']=qs['filters'](_[_0x4f0e('0x3c')](_0x2fca6b[_0x4f0e('0x33')],_0x485656[_0x4f0e('0x34')]));if(_0x2fca6b['query'][_0x4f0e('0x3d')]){_0x32d88f[_0x4f0e('0x3b')]=_[_0x4f0e('0x3e')](_0x32d88f[_0x4f0e('0x3b')],{'$or':_['map'](_0x32d88f['attributes'],function(_0x5742a8){var _0x418a51={};_0x418a51[_0x5742a8]={'$like':'%'+_0x2fca6b[_0x4f0e('0x33')][_0x4f0e('0x3d')]+'%'};return _0x418a51;})});}_0x32d88f=_[_0x4f0e('0x3e')]({},_0x32d88f,_0x2fca6b[_0x4f0e('0x4f')]);return _0x2bcd62['getDescriptions'](_0x32d88f);}})['then'](function(_0x53ae41){if(_0x53ae41){_0x2e6073=_0x53ae41['length'];if(!_0x2fca6b[_0x4f0e('0x33')][_0x4f0e('0x52')]('nolimit')){_0x32d88f['limit']=qs['limit'](_0x2fca6b[_0x4f0e('0x33')][_0x4f0e('0x39')]);_0x32d88f[_0x4f0e('0x25')]=qs['offset'](_0x2fca6b['query'][_0x4f0e('0x25')]);}return _0x2bcd62[_0x4f0e('0x53')](_0x32d88f);}})['then'](function(_0x35e081){if(_0x35e081){return _0x35e081?{'count':_0x2e6073,'rows':_0x35e081}:null;}})['then'](respondWithResult(_0x5812a1,null))[_0x4f0e('0x21')](handleError(_0x5812a1,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js index 97bb519..fb5e844 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 _0x6e06=['../../config/environment','define','SalesforceConfiguration','int_salesforce_configurations','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x40065a,_0x2deb85){var _0x39aa42=function(_0x4874e5){while(--_0x4874e5){_0x40065a['push'](_0x40065a['shift']());}};_0x39aa42(++_0x2deb85);}(_0x6e06,0x1d2));var _0x66e0=function(_0x33b670,_0xebd5c8){_0x33b670=_0x33b670-0x0;var _0x23e41f=_0x6e06[_0x33b670];return _0x23e41f;};'use strict';var _=require('lodash');var util=require(_0x66e0('0x0'));var logger=require(_0x66e0('0x1'))(_0x66e0('0x2'));var moment=require(_0x66e0('0x3'));var BPromise=require(_0x66e0('0x4'));var rp=require(_0x66e0('0x5'));var fs=require('fs');var path=require(_0x66e0('0x6'));var rimraf=require('rimraf');var config=require(_0x66e0('0x7'));var attributes=require('./intSalesforceConfiguration.attributes');module['exports']=function(_0x3c383d,_0x2e425f){return _0x3c383d[_0x66e0('0x8')](_0x66e0('0x9'),attributes,{'tableName':_0x66e0('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x047f=['../../config/environment','define','SalesforceConfiguration','int_salesforce_configurations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x376acc,_0xcf68f5){var _0x42122d=function(_0x5223bc){while(--_0x5223bc){_0x376acc['push'](_0x376acc['shift']());}};_0x42122d(++_0xcf68f5);}(_0x047f,0x10c));var _0xf047=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x047f[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xf047('0x0'));var util=require(_0xf047('0x1'));var logger=require(_0xf047('0x2'))(_0xf047('0x3'));var moment=require(_0xf047('0x4'));var BPromise=require(_0xf047('0x5'));var rp=require(_0xf047('0x6'));var fs=require('fs');var path=require(_0xf047('0x7'));var rimraf=require('rimraf');var config=require(_0xf047('0x8'));var attributes=require('./intSalesforceConfiguration.attributes');module['exports']=function(_0x155305,_0x5d316f){return _0x155305[_0xf047('0x9')](_0xf047('0xa'),attributes,{'tableName':_0xf047('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.rpc.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.rpc.js index 7136812..5f7dd2a 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 _0xdd7c=['http','then','info','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','error','SalesforceConfiguration,\x20%s,\x20%s','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client'];(function(_0x4f94d3,_0xc76592){var _0x13d4eb=function(_0x1df47c){while(--_0x1df47c){_0x4f94d3['push'](_0x4f94d3['shift']());}};_0x13d4eb(++_0xc76592);}(_0xdd7c,0xfa));var _0xcdd7=function(_0x8de54f,_0x271987){_0x8de54f=_0x8de54f-0x0;var _0x14cba4=_0xdd7c[_0x8de54f];return _0x14cba4;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xcdd7('0x0'));var BPromise=require(_0xcdd7('0x1'));var rs=require(_0xcdd7('0x2'));var fs=require('fs');var Redis=require(_0xcdd7('0x3'));var db=require(_0xcdd7('0x4'))['db'];var utils=require(_0xcdd7('0x5'));var logger=require(_0xcdd7('0x6'))(_0xcdd7('0x7'));var config=require('../../config/environment');var jayson=require(_0xcdd7('0x8'));var client=jayson[_0xcdd7('0x9')][_0xcdd7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2b7cae,_0x558e89,_0x34971b){return new BPromise(function(_0x24ed46,_0x11bd65){return client['request'](_0x2b7cae,_0x34971b)[_0xcdd7('0xb')](function(_0x2a7002){logger[_0xcdd7('0xc')]('SalesforceConfiguration,\x20%s,\x20%s',_0x558e89,'request\x20sent');logger['debug'](_0xcdd7('0xd'),_0x558e89,_0xcdd7('0xe'),JSON['stringify'](_0x2a7002));if(_0x2a7002[_0xcdd7('0xf')]){if(_0x2a7002[_0xcdd7('0xf')]['code']===0x1f4){logger[_0xcdd7('0xf')](_0xcdd7('0x10'),_0x558e89,_0x2a7002[_0xcdd7('0xf')][_0xcdd7('0x11')]);return _0x11bd65(_0x2a7002[_0xcdd7('0xf')][_0xcdd7('0x11')]);}logger[_0xcdd7('0xf')](_0xcdd7('0x10'),_0x558e89,_0x2a7002[_0xcdd7('0xf')][_0xcdd7('0x11')]);return _0x24ed46(_0x2a7002[_0xcdd7('0xf')][_0xcdd7('0x11')]);}else{logger[_0xcdd7('0xc')](_0xcdd7('0x10'),_0x558e89,'request\x20sent');_0x24ed46(_0x2a7002[_0xcdd7('0x12')][_0xcdd7('0x11')]);}})[_0xcdd7('0x13')](function(_0x3b19b0){logger[_0xcdd7('0xf')](_0xcdd7('0x10'),_0x558e89,_0x3b19b0);_0x11bd65(_0x3b19b0);});});} \ No newline at end of file +var _0x4f4b=['lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','info','SalesforceConfiguration,\x20%s,\x20%s','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4f4b,0xb8));var _0xb4f4=function(_0x21aec3,_0x5c97e9){_0x21aec3=_0x21aec3-0x0;var _0x288bbc=_0x4f4b[_0x21aec3];return _0x288bbc;};'use strict';var _=require(_0xb4f4('0x0'));var util=require(_0xb4f4('0x1'));var moment=require(_0xb4f4('0x2'));var BPromise=require(_0xb4f4('0x3'));var rs=require(_0xb4f4('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb4f4('0x5'))['db'];var utils=require(_0xb4f4('0x6'));var logger=require(_0xb4f4('0x7'))(_0xb4f4('0x8'));var config=require('../../config/environment');var jayson=require(_0xb4f4('0x9'));var client=jayson[_0xb4f4('0xa')][_0xb4f4('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x21d920,_0x153308,_0x191a35){return new BPromise(function(_0x3b58d9,_0x4897e3){return client['request'](_0x21d920,_0x191a35)[_0xb4f4('0xc')](function(_0x552f4e){logger[_0xb4f4('0xd')](_0xb4f4('0xe'),_0x153308,'request\x20sent');logger['debug'](_0xb4f4('0xf'),_0x153308,_0xb4f4('0x10'),JSON[_0xb4f4('0x11')](_0x552f4e));if(_0x552f4e[_0xb4f4('0x12')]){if(_0x552f4e[_0xb4f4('0x12')][_0xb4f4('0x13')]===0x1f4){logger[_0xb4f4('0x12')](_0xb4f4('0xe'),_0x153308,_0x552f4e[_0xb4f4('0x12')][_0xb4f4('0x14')]);return _0x4897e3(_0x552f4e[_0xb4f4('0x12')][_0xb4f4('0x14')]);}logger[_0xb4f4('0x12')](_0xb4f4('0xe'),_0x153308,_0x552f4e[_0xb4f4('0x12')][_0xb4f4('0x14')]);return _0x3b58d9(_0x552f4e[_0xb4f4('0x12')][_0xb4f4('0x14')]);}else{logger['info'](_0xb4f4('0xe'),_0x153308,_0xb4f4('0x10'));_0x3b58d9(_0x552f4e[_0xb4f4('0x15')][_0xb4f4('0x14')]);}})[_0xb4f4('0x16')](function(_0x3a7b19){logger['error'](_0xb4f4('0xe'),_0x153308,_0x3a7b19);_0x4897e3(_0x3a7b19);});});} \ No newline at end of file diff --git a/server/api/intSalesforceField/index.js b/server/api/intSalesforceField/index.js index 761aba0..80821cd 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 _0xda19=['post','update','delete','destroy','exports','util','path','express','../../components/auth/service','../../config/environment','./intSalesforceField.controller','get','isAuthenticated','index','/:id','show'];(function(_0x144c33,_0x4f7860){var _0x5e6f01=function(_0x482e8e){while(--_0x482e8e){_0x144c33['push'](_0x144c33['shift']());}};_0x5e6f01(++_0x4f7860);}(_0xda19,0xd5));var _0x9da1=function(_0x165326,_0x44618b){_0x165326=_0x165326-0x0;var _0x3d96e9=_0xda19[_0x165326];return _0x3d96e9;};'use strict';var multer=require('multer');var util=require(_0x9da1('0x0'));var path=require(_0x9da1('0x1'));var timeout=require('connect-timeout');var express=require(_0x9da1('0x2'));var router=express['Router']();var auth=require(_0x9da1('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x9da1('0x4'));var controller=require(_0x9da1('0x5'));router[_0x9da1('0x6')]('/',auth[_0x9da1('0x7')](),controller[_0x9da1('0x8')]);router[_0x9da1('0x6')](_0x9da1('0x9'),auth[_0x9da1('0x7')](),controller[_0x9da1('0xa')]);router[_0x9da1('0xb')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x9da1('0x9'),auth['isAuthenticated'](),controller[_0x9da1('0xc')]);router[_0x9da1('0xd')](_0x9da1('0x9'),auth[_0x9da1('0x7')](),controller[_0x9da1('0xe')]);module[_0x9da1('0xf')]=router; \ No newline at end of file +var _0xe3da=['../../components/interaction/service','../../config/environment','./intSalesforceField.controller','get','isAuthenticated','index','/:id','post','update','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x2b18ab,_0x44c0ec){var _0x143273=function(_0x126b12){while(--_0x126b12){_0x2b18ab['push'](_0x2b18ab['shift']());}};_0x143273(++_0x44c0ec);}(_0xe3da,0x1cd));var _0xae3d=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xe3da[_0x2641f9];return _0x585741;};'use strict';var multer=require(_0xae3d('0x0'));var util=require(_0xae3d('0x1'));var path=require(_0xae3d('0x2'));var timeout=require(_0xae3d('0x3'));var express=require(_0xae3d('0x4'));var router=express[_0xae3d('0x5')]();var auth=require(_0xae3d('0x6'));var interaction=require(_0xae3d('0x7'));var config=require(_0xae3d('0x8'));var controller=require(_0xae3d('0x9'));router[_0xae3d('0xa')]('/',auth[_0xae3d('0xb')](),controller[_0xae3d('0xc')]);router[_0xae3d('0xa')](_0xae3d('0xd'),auth[_0xae3d('0xb')](),controller['show']);router[_0xae3d('0xe')]('/',auth[_0xae3d('0xb')](),controller['create']);router['put'](_0xae3d('0xd'),auth[_0xae3d('0xb')](),controller[_0xae3d('0xf')]);router[_0xae3d('0x10')](_0xae3d('0xd'),auth[_0xae3d('0xb')](),controller['destroy']);module[_0xae3d('0x11')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.attributes.js b/server/api/intSalesforceField/intSalesforceField.attributes.js index 7b00cc4..f4e3717 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 _0x6c63=['string','variable','customVariable','keyValue','STRING','ENUM','sequelize','exports'];(function(_0x12e073,_0x4d43db){var _0x267748=function(_0x381284){while(--_0x381284){_0x12e073['push'](_0x12e073['shift']());}};_0x267748(++_0x4d43db);}(_0x6c63,0x15e));var _0x36c6=function(_0x270efb,_0x1dc533){_0x270efb=_0x270efb-0x0;var _0x594817=_0x6c63[_0x270efb];return _0x594817;};'use strict';var Sequelize=require(_0x36c6('0x0'));module[_0x36c6('0x1')]={'type':{'type':Sequelize['ENUM'](_0x36c6('0x2'),_0x36c6('0x3'),_0x36c6('0x4'),_0x36c6('0x5')),'defaultValue':_0x36c6('0x2')},'content':{'type':Sequelize[_0x36c6('0x6')]},'key':{'type':Sequelize[_0x36c6('0x6')]},'keyType':{'type':Sequelize[_0x36c6('0x7')]('string',_0x36c6('0x3'),_0x36c6('0x4'))},'keyContent':{'type':Sequelize[_0x36c6('0x6')]},'idField':{'type':Sequelize[_0x36c6('0x6')]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xc6e8=['string','variable','customVariable','STRING','sequelize','exports','ENUM'];(function(_0x4c67e4,_0x4916a5){var _0x2b27c8=function(_0x5840d7){while(--_0x5840d7){_0x4c67e4['push'](_0x4c67e4['shift']());}};_0x2b27c8(++_0x4916a5);}(_0xc6e8,0x9e));var _0x8c6e=function(_0x3bcbe7,_0x518246){_0x3bcbe7=_0x3bcbe7-0x0;var _0x96c57c=_0xc6e8[_0x3bcbe7];return _0x96c57c;};'use strict';var Sequelize=require(_0x8c6e('0x0'));module[_0x8c6e('0x1')]={'type':{'type':Sequelize[_0x8c6e('0x2')](_0x8c6e('0x3'),_0x8c6e('0x4'),_0x8c6e('0x5'),'keyValue'),'defaultValue':'string'},'content':{'type':Sequelize[_0x8c6e('0x6')]},'key':{'type':Sequelize[_0x8c6e('0x6')]},'keyType':{'type':Sequelize[_0x8c6e('0x2')](_0x8c6e('0x3'),_0x8c6e('0x4'),_0x8c6e('0x5'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x8c6e('0x6')]},'variableName':{'type':Sequelize[_0x8c6e('0x6')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.controller.js b/server/api/intSalesforceField/intSalesforceField.controller.js index 2d2515e..2e2eda5 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 _0x5ebf=['../../config/environment','../../mysqldb','sendStatus','end','status','count','offset','limit','set','Content-Range','json','apply','reject','save','update','destroy','then','stack','name','send','rawAttributes','model','keys','query','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','filters','pick','filter','merge','type','key','VIRTUAL','field','options','where','SalesforceField','includeAll','rows','show','params','length','include','catch','create','body','find','html-pdf','eml-format','request-promise','mustache','util','path','sox','to-csv','ejs','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils'];(function(_0x3ef4f1,_0x5f0f9b){var _0x69953c=function(_0xb4e621){while(--_0xb4e621){_0x3ef4f1['push'](_0x3ef4f1['shift']());}};_0x69953c(++_0x5f0f9b);}(_0x5ebf,0x10c));var _0xf5eb=function(_0x4a8959,_0x35c0e6){_0x4a8959=_0x4a8959-0x0;var _0x48cf53=_0x5ebf[_0x4a8959];return _0x48cf53;};'use strict';var pdf=require(_0xf5eb('0x0'));var emlformat=require(_0xf5eb('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xf5eb('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xf5eb('0x3'));var util=require(_0xf5eb('0x4'));var path=require(_0xf5eb('0x5'));var sox=require(_0xf5eb('0x6'));var csv=require(_0xf5eb('0x7'));var ejs=require(_0xf5eb('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0xf5eb('0x9'));var crypto=require('crypto');var jsforce=require(_0xf5eb('0xa'));var deskjs=require(_0xf5eb('0xb'));var toCsv=require(_0xf5eb('0x7'));var querystring=require(_0xf5eb('0xc'));var Papa=require(_0xf5eb('0xd'));var Redis=require(_0xf5eb('0xe'));var authService=require(_0xf5eb('0xf'));var qs=require(_0xf5eb('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf5eb('0x11'));var logger=require(_0xf5eb('0x12'))('api');var utils=require(_0xf5eb('0x13'));var config=require(_0xf5eb('0x14'));var db=require(_0xf5eb('0x15'))['db'];function respondWithStatusCode(_0x27f573,_0x45dd25){_0x45dd25=_0x45dd25||0xcc;return function(_0x21546f){if(_0x21546f){return _0x27f573[_0xf5eb('0x16')](_0x45dd25);}return _0x27f573['status'](_0x45dd25)[_0xf5eb('0x17')]();};}function respondWithResult(_0xbe8035,_0x4cc910){_0x4cc910=_0x4cc910||0xc8;return function(_0x560a77){if(_0x560a77){return _0xbe8035[_0xf5eb('0x18')](_0x4cc910)['json'](_0x560a77);}};}function respondWithFilteredResult(_0x4087bc,_0x4dca04){return function(_0x24caeb){if(_0x24caeb){var _0x70d0f9=_0x24caeb[_0xf5eb('0x19')],_0x52fda6=_0x4dca04[_0xf5eb('0x1a')],_0x1875a4=_0x4dca04[_0xf5eb('0x1a')]+_0x4dca04[_0xf5eb('0x1b')],_0x15aaae;if(_0x1875a4>=_0x70d0f9){_0x1875a4=_0x70d0f9;_0x15aaae=0xc8;}else{_0x15aaae=0xce;}_0x4087bc[_0xf5eb('0x18')](_0x15aaae);return _0x4087bc[_0xf5eb('0x1c')](_0xf5eb('0x1d'),_0x52fda6+'-'+_0x1875a4+'/'+_0x70d0f9)[_0xf5eb('0x1e')](_0x24caeb);}return null;};}function patchUpdates(_0x11efe3){return function(_0x4e012e){try{jsonpatch[_0xf5eb('0x1f')](_0x4e012e,_0x11efe3,!![]);}catch(_0x39ec02){return BPromise[_0xf5eb('0x20')](_0x39ec02);}return _0x4e012e[_0xf5eb('0x21')]();};}function saveUpdates(_0x45d982,_0x59a7ad){return function(_0x1f9e5c){if(_0x1f9e5c){return _0x1f9e5c[_0xf5eb('0x22')](_0x45d982)['then'](function(_0x34d5dc){return _0x34d5dc;});}return null;};}function removeEntity(_0x153c38,_0x15059d){return function(_0x58b708){if(_0x58b708){return _0x58b708[_0xf5eb('0x23')]()[_0xf5eb('0x24')](function(){_0x153c38[_0xf5eb('0x18')](0xcc)[_0xf5eb('0x17')]();});}};}function handleEntityNotFound(_0x1d1361,_0x281db2){return function(_0x14bd44){if(!_0x14bd44){_0x1d1361[_0xf5eb('0x16')](0x194);}return _0x14bd44;};}function handleError(_0x39920b,_0x3a119c){_0x3a119c=_0x3a119c||0x1f4;return function(_0x2161bf){logger['error'](_0x2161bf[_0xf5eb('0x25')]);if(_0x2161bf[_0xf5eb('0x26')]){delete _0x2161bf[_0xf5eb('0x26')];}_0x39920b['status'](_0x3a119c)[_0xf5eb('0x27')](_0x2161bf);};}exports['index']=function(_0x2fbec5,_0x4ce256){var _0x34cf6a={},_0x100ec0={},_0x54680a={'count':0x0,'rows':[]};var _0x2e68e3=db['SalesforceField'][_0xf5eb('0x28')];_0x100ec0[_0xf5eb('0x29')]=_[_0xf5eb('0x2a')](_0x2e68e3);_0x100ec0[_0xf5eb('0x2b')]=_[_0xf5eb('0x2a')](_0x2fbec5[_0xf5eb('0x2b')]);_0x100ec0['filters']=_[_0xf5eb('0x2c')](_0x100ec0[_0xf5eb('0x29')],_0x100ec0[_0xf5eb('0x2b')]);_0x34cf6a['attributes']=_[_0xf5eb('0x2c')](_0x100ec0['model'],qs['fields'](_0x2fbec5[_0xf5eb('0x2b')][_0xf5eb('0x2d')]));_0x34cf6a[_0xf5eb('0x2e')]=_0x34cf6a[_0xf5eb('0x2e')]['length']?_0x34cf6a[_0xf5eb('0x2e')]:_0x100ec0[_0xf5eb('0x29')];if(!_0x2fbec5['query'][_0xf5eb('0x2f')](_0xf5eb('0x30'))){_0x34cf6a[_0xf5eb('0x1b')]=qs[_0xf5eb('0x1b')](_0x2fbec5['query'][_0xf5eb('0x1b')]);_0x34cf6a['offset']=qs[_0xf5eb('0x1a')](_0x2fbec5[_0xf5eb('0x2b')][_0xf5eb('0x1a')]);}_0x34cf6a[_0xf5eb('0x31')]=qs[_0xf5eb('0x32')](_0x2fbec5[_0xf5eb('0x2b')][_0xf5eb('0x32')]);_0x34cf6a['where']=qs[_0xf5eb('0x33')](_[_0xf5eb('0x34')](_0x2fbec5[_0xf5eb('0x2b')],_0x100ec0[_0xf5eb('0x33')]));if(_0x2fbec5[_0xf5eb('0x2b')][_0xf5eb('0x35')]){_0x34cf6a['where']=_[_0xf5eb('0x36')](_0x34cf6a['where'],{'$or':_['map'](_0x2e68e3,function(_0x430fe1){if(_0x430fe1[_0xf5eb('0x37')][_0xf5eb('0x38')]!==_0xf5eb('0x39')){var _0x500c9d={};_0x500c9d[_0x430fe1[_0xf5eb('0x3a')]]={'$like':'%'+_0x2fbec5[_0xf5eb('0x2b')][_0xf5eb('0x35')]+'%'};return _0x500c9d;}})});}_0x34cf6a=_[_0xf5eb('0x36')]({},_0x34cf6a,_0x2fbec5[_0xf5eb('0x3b')]);var _0x2a092e={'where':_0x34cf6a[_0xf5eb('0x3c')]};return db[_0xf5eb('0x3d')][_0xf5eb('0x19')](_0x2a092e)[_0xf5eb('0x24')](function(_0x5117a3){_0x54680a[_0xf5eb('0x19')]=_0x5117a3;if(_0x2fbec5[_0xf5eb('0x2b')][_0xf5eb('0x3e')]){_0x34cf6a['include']=[{'all':!![]}];}return db[_0xf5eb('0x3d')]['findAll'](_0x34cf6a);})[_0xf5eb('0x24')](function(_0x4e5af1){_0x54680a[_0xf5eb('0x3f')]=_0x4e5af1;return _0x54680a;})[_0xf5eb('0x24')](respondWithFilteredResult(_0x4ce256,_0x34cf6a))['catch'](handleError(_0x4ce256,null));};exports[_0xf5eb('0x40')]=function(_0x2068f7,_0x39362a){var _0x4470fc={'raw':!![],'where':{'id':_0x2068f7[_0xf5eb('0x41')]['id']}},_0x18bfc1={};_0x18bfc1[_0xf5eb('0x29')]=_[_0xf5eb('0x2a')](db[_0xf5eb('0x3d')][_0xf5eb('0x28')]);_0x18bfc1[_0xf5eb('0x2b')]=_[_0xf5eb('0x2a')](_0x2068f7[_0xf5eb('0x2b')]);_0x18bfc1[_0xf5eb('0x33')]=_[_0xf5eb('0x2c')](_0x18bfc1[_0xf5eb('0x29')],_0x18bfc1['query']);_0x4470fc[_0xf5eb('0x2e')]=_[_0xf5eb('0x2c')](_0x18bfc1[_0xf5eb('0x29')],qs[_0xf5eb('0x2d')](_0x2068f7[_0xf5eb('0x2b')][_0xf5eb('0x2d')]));_0x4470fc[_0xf5eb('0x2e')]=_0x4470fc[_0xf5eb('0x2e')][_0xf5eb('0x42')]?_0x4470fc[_0xf5eb('0x2e')]:_0x18bfc1['model'];if(_0x2068f7[_0xf5eb('0x2b')][_0xf5eb('0x3e')]){_0x4470fc[_0xf5eb('0x43')]=[{'all':!![]}];}_0x4470fc=_['merge']({},_0x4470fc,_0x2068f7[_0xf5eb('0x3b')]);return db[_0xf5eb('0x3d')]['find'](_0x4470fc)[_0xf5eb('0x24')](handleEntityNotFound(_0x39362a,null))['then'](respondWithResult(_0x39362a,null))[_0xf5eb('0x44')](handleError(_0x39362a,null));};exports[_0xf5eb('0x45')]=function(_0x1f9d73,_0x559ffa){return db[_0xf5eb('0x3d')][_0xf5eb('0x45')](_0x1f9d73[_0xf5eb('0x46')],{})[_0xf5eb('0x24')](respondWithResult(_0x559ffa,0xc9))['catch'](handleError(_0x559ffa,null));};exports[_0xf5eb('0x22')]=function(_0x5e2e25,_0x47c90a){if(_0x5e2e25[_0xf5eb('0x46')]['id']){delete _0x5e2e25['body']['id'];}return db[_0xf5eb('0x3d')][_0xf5eb('0x47')]({'where':{'id':_0x5e2e25[_0xf5eb('0x41')]['id']}})['then'](handleEntityNotFound(_0x47c90a,null))[_0xf5eb('0x24')](saveUpdates(_0x5e2e25[_0xf5eb('0x46')],null))[_0xf5eb('0x24')](respondWithResult(_0x47c90a,null))[_0xf5eb('0x44')](handleError(_0x47c90a,null));};exports[_0xf5eb('0x23')]=function(_0x4e92b4,_0x1569df){return db[_0xf5eb('0x3d')][_0xf5eb('0x47')]({'where':{'id':_0x4e92b4[_0xf5eb('0x41')]['id']}})[_0xf5eb('0x24')](handleEntityNotFound(_0x1569df,null))[_0xf5eb('0x24')](removeEntity(_0x1569df,null))['catch'](handleError(_0x1569df,null));}; \ No newline at end of file +var _0xe25c=['model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','filter','where','merge','map','type','key','VIRTUAL','options','includeAll','include','findAll','rows','catch','find','create','body','params','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','lodash','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','json','count','offset','limit','set','apply','reject','update','then','destroy','sendStatus','error','stack','name','send','index','SalesforceField'];(function(_0x2abca8,_0x4c63d3){var _0x45d797=function(_0x101a14){while(--_0x101a14){_0x2abca8['push'](_0x2abca8['shift']());}};_0x45d797(++_0x4c63d3);}(_0xe25c,0xa8));var _0xce25=function(_0x189334,_0x2ba97b){_0x189334=_0x189334-0x0;var _0xd15d71=_0xe25c[_0x189334];return _0xd15d71;};'use strict';var pdf=require(_0xce25('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xce25('0x1'));var zipdir=require(_0xce25('0x2'));var jsonpatch=require(_0xce25('0x3'));var rp=require(_0xce25('0x4'));var moment=require(_0xce25('0x5'));var BPromise=require(_0xce25('0x6'));var Mustache=require(_0xce25('0x7'));var util=require('util');var path=require(_0xce25('0x8'));var sox=require(_0xce25('0x9'));var csv=require(_0xce25('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xce25('0xb'));var squel=require('squel');var crypto=require(_0xce25('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xce25('0xd'));var toCsv=require(_0xce25('0xa'));var querystring=require('querystring');var Papa=require(_0xce25('0xe'));var Redis=require(_0xce25('0xf'));var authService=require(_0xce25('0x10'));var qs=require(_0xce25('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xce25('0x12'));var logger=require(_0xce25('0x13'))(_0xce25('0x14'));var utils=require(_0xce25('0x15'));var config=require(_0xce25('0x16'));var db=require(_0xce25('0x17'))['db'];function respondWithStatusCode(_0x395175,_0x3db3fa){_0x3db3fa=_0x3db3fa||0xcc;return function(_0x78646e){if(_0x78646e){return _0x395175['sendStatus'](_0x3db3fa);}return _0x395175[_0xce25('0x18')](_0x3db3fa)['end']();};}function respondWithResult(_0x1bcf8a,_0x8125c2){_0x8125c2=_0x8125c2||0xc8;return function(_0xc997a2){if(_0xc997a2){return _0x1bcf8a['status'](_0x8125c2)[_0xce25('0x19')](_0xc997a2);}};}function respondWithFilteredResult(_0x577d56,_0x348a6d){return function(_0x50441f){if(_0x50441f){var _0x15a086=_0x50441f[_0xce25('0x1a')],_0x40ed0b=_0x348a6d[_0xce25('0x1b')],_0x142035=_0x348a6d['offset']+_0x348a6d[_0xce25('0x1c')],_0x505a9e;if(_0x142035>=_0x15a086){_0x142035=_0x15a086;_0x505a9e=0xc8;}else{_0x505a9e=0xce;}_0x577d56['status'](_0x505a9e);return _0x577d56[_0xce25('0x1d')]('Content-Range',_0x40ed0b+'-'+_0x142035+'/'+_0x15a086)[_0xce25('0x19')](_0x50441f);}return null;};}function patchUpdates(_0x6e790){return function(_0x4ebd99){try{jsonpatch[_0xce25('0x1e')](_0x4ebd99,_0x6e790,!![]);}catch(_0x1b8839){return BPromise[_0xce25('0x1f')](_0x1b8839);}return _0x4ebd99['save']();};}function saveUpdates(_0x5b2e65,_0x36977e){return function(_0x158a8e){if(_0x158a8e){return _0x158a8e[_0xce25('0x20')](_0x5b2e65)[_0xce25('0x21')](function(_0x46cbbf){return _0x46cbbf;});}return null;};}function removeEntity(_0x39134c,_0x118457){return function(_0x7d4694){if(_0x7d4694){return _0x7d4694[_0xce25('0x22')]()['then'](function(){_0x39134c[_0xce25('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5d4fdb,_0x4d7cef){return function(_0x1fc292){if(!_0x1fc292){_0x5d4fdb[_0xce25('0x23')](0x194);}return _0x1fc292;};}function handleError(_0x580cbb,_0x252cfc){_0x252cfc=_0x252cfc||0x1f4;return function(_0x544b76){logger[_0xce25('0x24')](_0x544b76[_0xce25('0x25')]);if(_0x544b76[_0xce25('0x26')]){delete _0x544b76[_0xce25('0x26')];}_0x580cbb['status'](_0x252cfc)[_0xce25('0x27')](_0x544b76);};}exports[_0xce25('0x28')]=function(_0xabb7,_0x45b8cb){var _0x9aa86d={},_0x28b041={},_0xe1a72d={'count':0x0,'rows':[]};var _0x40bb7a=db[_0xce25('0x29')]['rawAttributes'];_0x28b041[_0xce25('0x2a')]=_[_0xce25('0x2b')](_0x40bb7a);_0x28b041[_0xce25('0x2c')]=_[_0xce25('0x2b')](_0xabb7[_0xce25('0x2c')]);_0x28b041[_0xce25('0x2d')]=_[_0xce25('0x2e')](_0x28b041[_0xce25('0x2a')],_0x28b041[_0xce25('0x2c')]);_0x9aa86d[_0xce25('0x2f')]=_['intersection'](_0x28b041['model'],qs[_0xce25('0x30')](_0xabb7['query'][_0xce25('0x30')]));_0x9aa86d['attributes']=_0x9aa86d['attributes'][_0xce25('0x31')]?_0x9aa86d[_0xce25('0x2f')]:_0x28b041[_0xce25('0x2a')];if(!_0xabb7[_0xce25('0x2c')][_0xce25('0x32')](_0xce25('0x33'))){_0x9aa86d['limit']=qs[_0xce25('0x1c')](_0xabb7[_0xce25('0x2c')][_0xce25('0x1c')]);_0x9aa86d[_0xce25('0x1b')]=qs[_0xce25('0x1b')](_0xabb7['query']['offset']);}_0x9aa86d[_0xce25('0x34')]=qs['sort'](_0xabb7[_0xce25('0x2c')]['sort']);_0x9aa86d['where']=qs[_0xce25('0x2d')](_['pick'](_0xabb7[_0xce25('0x2c')],_0x28b041[_0xce25('0x2d')]));if(_0xabb7[_0xce25('0x2c')][_0xce25('0x35')]){_0x9aa86d[_0xce25('0x36')]=_[_0xce25('0x37')](_0x9aa86d[_0xce25('0x36')],{'$or':_[_0xce25('0x38')](_0x40bb7a,function(_0x23d8bc){if(_0x23d8bc[_0xce25('0x39')][_0xce25('0x3a')]!==_0xce25('0x3b')){var _0x2b53d9={};_0x2b53d9[_0x23d8bc['field']]={'$like':'%'+_0xabb7[_0xce25('0x2c')]['filter']+'%'};return _0x2b53d9;}})});}_0x9aa86d=_['merge']({},_0x9aa86d,_0xabb7[_0xce25('0x3c')]);var _0x44ce7e={'where':_0x9aa86d['where']};return db['SalesforceField'][_0xce25('0x1a')](_0x44ce7e)[_0xce25('0x21')](function(_0x434e19){_0xe1a72d['count']=_0x434e19;if(_0xabb7[_0xce25('0x2c')][_0xce25('0x3d')]){_0x9aa86d[_0xce25('0x3e')]=[{'all':!![]}];}return db[_0xce25('0x29')][_0xce25('0x3f')](_0x9aa86d);})[_0xce25('0x21')](function(_0x2614c8){_0xe1a72d[_0xce25('0x40')]=_0x2614c8;return _0xe1a72d;})[_0xce25('0x21')](respondWithFilteredResult(_0x45b8cb,_0x9aa86d))[_0xce25('0x41')](handleError(_0x45b8cb,null));};exports['show']=function(_0x8f1a0d,_0x14bf20){var _0x41567d={'raw':!![],'where':{'id':_0x8f1a0d['params']['id']}},_0x5125ab={};_0x5125ab[_0xce25('0x2a')]=_['keys'](db['SalesforceField']['rawAttributes']);_0x5125ab[_0xce25('0x2c')]=_['keys'](_0x8f1a0d[_0xce25('0x2c')]);_0x5125ab[_0xce25('0x2d')]=_['intersection'](_0x5125ab[_0xce25('0x2a')],_0x5125ab[_0xce25('0x2c')]);_0x41567d[_0xce25('0x2f')]=_[_0xce25('0x2e')](_0x5125ab['model'],qs['fields'](_0x8f1a0d[_0xce25('0x2c')][_0xce25('0x30')]));_0x41567d[_0xce25('0x2f')]=_0x41567d[_0xce25('0x2f')][_0xce25('0x31')]?_0x41567d[_0xce25('0x2f')]:_0x5125ab[_0xce25('0x2a')];if(_0x8f1a0d[_0xce25('0x2c')][_0xce25('0x3d')]){_0x41567d['include']=[{'all':!![]}];}_0x41567d=_[_0xce25('0x37')]({},_0x41567d,_0x8f1a0d['options']);return db[_0xce25('0x29')][_0xce25('0x42')](_0x41567d)[_0xce25('0x21')](handleEntityNotFound(_0x14bf20,null))[_0xce25('0x21')](respondWithResult(_0x14bf20,null))[_0xce25('0x41')](handleError(_0x14bf20,null));};exports[_0xce25('0x43')]=function(_0x421001,_0x58f97b){return db[_0xce25('0x29')][_0xce25('0x43')](_0x421001[_0xce25('0x44')],{})[_0xce25('0x21')](respondWithResult(_0x58f97b,0xc9))[_0xce25('0x41')](handleError(_0x58f97b,null));};exports['update']=function(_0x21fdea,_0x4296f3){if(_0x21fdea['body']['id']){delete _0x21fdea[_0xce25('0x44')]['id'];}return db[_0xce25('0x29')][_0xce25('0x42')]({'where':{'id':_0x21fdea['params']['id']}})[_0xce25('0x21')](handleEntityNotFound(_0x4296f3,null))[_0xce25('0x21')](saveUpdates(_0x21fdea[_0xce25('0x44')],null))[_0xce25('0x21')](respondWithResult(_0x4296f3,null))[_0xce25('0x41')](handleError(_0x4296f3,null));};exports[_0xce25('0x22')]=function(_0x4e94d6,_0x5cb7f2){return db['SalesforceField'][_0xce25('0x42')]({'where':{'id':_0x4e94d6[_0xce25('0x45')]['id']}})['then'](handleEntityNotFound(_0x5cb7f2,null))[_0xce25('0x21')](removeEntity(_0x5cb7f2,null))[_0xce25('0x41')](handleError(_0x5cb7f2,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.model.js b/server/api/intSalesforceField/intSalesforceField.model.js index 717e029..c7b77a4 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 _0x3c61=['int_salesforce_fields','idField','FieldId','../../config/logger','api','bluebird','rimraf','../../config/environment','exports'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x3c61,0x11a));var _0x13c6=function(_0x1a3a88,_0x16e04b){_0x1a3a88=_0x1a3a88-0x0;var _0x23e0fe=_0x3c61[_0x1a3a88];return _0x23e0fe;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x13c6('0x0'))(_0x13c6('0x1'));var moment=require('moment');var BPromise=require(_0x13c6('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x13c6('0x3'));var config=require(_0x13c6('0x4'));var attributes=require('./intSalesforceField.attributes');module[_0x13c6('0x5')]=function(_0x54ab91,_0x448708){return _0x54ab91['define']('SalesforceField',attributes,{'tableName':_0x13c6('0x6'),'paranoid':![],'indexes':[{'name':'salesforce_unique_index','fields':[_0x13c6('0x7'),_0x13c6('0x8')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x1799=['./intSalesforceField.attributes','exports','define','SalesforceField','salesforce_unique_index','idField','FieldId','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0x401e77,_0x4b8943){var _0x1fe46a=function(_0x88c10f){while(--_0x88c10f){_0x401e77['push'](_0x401e77['shift']());}};_0x1fe46a(++_0x4b8943);}(_0x1799,0x19d));var _0x9179=function(_0x1cb7e5,_0x330833){_0x1cb7e5=_0x1cb7e5-0x0;var _0xbd9567=_0x1799[_0x1cb7e5];return _0xbd9567;};'use strict';var _=require(_0x9179('0x0'));var util=require('util');var logger=require(_0x9179('0x1'))(_0x9179('0x2'));var moment=require(_0x9179('0x3'));var BPromise=require(_0x9179('0x4'));var rp=require(_0x9179('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9179('0x6'));var config=require('../../config/environment');var attributes=require(_0x9179('0x7'));module[_0x9179('0x8')]=function(_0x551e91,_0x141ccb){return _0x551e91[_0x9179('0x9')](_0x9179('0xa'),attributes,{'tableName':'int_salesforce_fields','paranoid':![],'indexes':[{'name':_0x9179('0xb'),'fields':[_0x9179('0xc'),_0x9179('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.rpc.js b/server/api/intSalesforceField/intSalesforceField.rpc.js index 7b89fa8..2c89f8e 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 _0xe706=['http','request','then','info','SalesforceField,\x20%s,\x20%s','request\x20sent','debug','SalesforceField,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x4c8399,_0x1b8384){var _0x35d23a=function(_0x200436){while(--_0x200436){_0x4c8399['push'](_0x4c8399['shift']());}};_0x35d23a(++_0x1b8384);}(_0xe706,0xa3));var _0x6e70=function(_0x46e5fc,_0x5db9aa){_0x46e5fc=_0x46e5fc-0x0;var _0x52f4e6=_0xe706[_0x46e5fc];return _0x52f4e6;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var moment=require(_0x6e70('0x2'));var BPromise=require('bluebird');var rs=require(_0x6e70('0x3'));var fs=require('fs');var Redis=require(_0x6e70('0x4'));var db=require(_0x6e70('0x5'))['db'];var utils=require(_0x6e70('0x6'));var logger=require(_0x6e70('0x7'))(_0x6e70('0x8'));var config=require(_0x6e70('0x9'));var jayson=require(_0x6e70('0xa'));var client=jayson[_0x6e70('0xb')][_0x6e70('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x36357b,_0x293ce7,_0x45a2d4){return new BPromise(function(_0x188ed3,_0x3c4843){return client[_0x6e70('0xd')](_0x36357b,_0x45a2d4)[_0x6e70('0xe')](function(_0x25e61c){logger[_0x6e70('0xf')](_0x6e70('0x10'),_0x293ce7,_0x6e70('0x11'));logger[_0x6e70('0x12')](_0x6e70('0x13'),_0x293ce7,_0x6e70('0x11'),JSON['stringify'](_0x25e61c));if(_0x25e61c['error']){if(_0x25e61c[_0x6e70('0x14')][_0x6e70('0x15')]===0x1f4){logger[_0x6e70('0x14')](_0x6e70('0x10'),_0x293ce7,_0x25e61c[_0x6e70('0x14')][_0x6e70('0x16')]);return _0x3c4843(_0x25e61c[_0x6e70('0x14')][_0x6e70('0x16')]);}logger['error']('SalesforceField,\x20%s,\x20%s',_0x293ce7,_0x25e61c['error'][_0x6e70('0x16')]);return _0x188ed3(_0x25e61c['error']['message']);}else{logger[_0x6e70('0xf')](_0x6e70('0x10'),_0x293ce7,'request\x20sent');_0x188ed3(_0x25e61c[_0x6e70('0x17')]['message']);}})[_0x6e70('0x18')](function(_0x161f23){logger['error']('SalesforceField,\x20%s,\x20%s',_0x293ce7,_0x161f23);_0x3c4843(_0x161f23);});});} \ No newline at end of file +var _0x0713=['SalesforceField,\x20%s,\x20%s','request\x20sent','debug','SalesforceField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x543edb,_0x3e3e2f){var _0x47942c=function(_0x21f314){while(--_0x21f314){_0x543edb['push'](_0x543edb['shift']());}};_0x47942c(++_0x3e3e2f);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3071('0x0'));var BPromise=require(_0x3071('0x1'));var rs=require(_0x3071('0x2'));var fs=require('fs');var Redis=require(_0x3071('0x3'));var db=require(_0x3071('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x3071('0x5'))(_0x3071('0x6'));var config=require(_0x3071('0x7'));var jayson=require(_0x3071('0x8'));var client=jayson[_0x3071('0x9')][_0x3071('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1d3dd6,_0x2f1e87,_0xbd737f){return new BPromise(function(_0x22274c,_0x3e9a5e){return client[_0x3071('0xb')](_0x1d3dd6,_0xbd737f)[_0x3071('0xc')](function(_0x4a36ec){logger[_0x3071('0xd')](_0x3071('0xe'),_0x2f1e87,_0x3071('0xf'));logger[_0x3071('0x10')](_0x3071('0x11'),_0x2f1e87,'request\x20sent',JSON[_0x3071('0x12')](_0x4a36ec));if(_0x4a36ec[_0x3071('0x13')]){if(_0x4a36ec[_0x3071('0x13')][_0x3071('0x14')]===0x1f4){logger[_0x3071('0x13')]('SalesforceField,\x20%s,\x20%s',_0x2f1e87,_0x4a36ec['error'][_0x3071('0x15')]);return _0x3e9a5e(_0x4a36ec['error'][_0x3071('0x15')]);}logger[_0x3071('0x13')]('SalesforceField,\x20%s,\x20%s',_0x2f1e87,_0x4a36ec[_0x3071('0x13')]['message']);return _0x22274c(_0x4a36ec[_0x3071('0x13')][_0x3071('0x15')]);}else{logger[_0x3071('0xd')](_0x3071('0xe'),_0x2f1e87,_0x3071('0xf'));_0x22274c(_0x4a36ec[_0x3071('0x16')][_0x3071('0x15')]);}})[_0x3071('0x17')](function(_0x21aad3){logger[_0x3071('0x13')]('SalesforceField,\x20%s,\x20%s',_0x2f1e87,_0x21aad3);_0x3e9a5e(_0x21aad3);});});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/index.js b/server/api/intServicenowAccount/index.js index 199e591..a81f405 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 _0x10eb=['update','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./intServicenowAccount.controller','index','get','/:id','isAuthenticated','/:id/fields','getFields','post','create','/:id/configurations','addConfiguration','put'];(function(_0x40a825,_0x3bac79){var _0x273a54=function(_0x5628d8){while(--_0x5628d8){_0x40a825['push'](_0x40a825['shift']());}};_0x273a54(++_0x3bac79);}(_0x10eb,0x71));var _0xb10e=function(_0x395367,_0xa61660){_0x395367=_0x395367-0x0;var _0x238727=_0x10eb[_0x395367];return _0x238727;};'use strict';var multer=require(_0xb10e('0x0'));var util=require('util');var path=require(_0xb10e('0x1'));var timeout=require(_0xb10e('0x2'));var express=require(_0xb10e('0x3'));var router=express[_0xb10e('0x4')]();var auth=require(_0xb10e('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xb10e('0x6'));var controller=require(_0xb10e('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0xb10e('0x8')]);router[_0xb10e('0x9')](_0xb10e('0xa'),auth[_0xb10e('0xb')](),controller['show']);router['get']('/:id/configurations',auth['isAuthenticated'](),controller['getConfigurations']);router[_0xb10e('0x9')](_0xb10e('0xc'),auth[_0xb10e('0xb')](),controller[_0xb10e('0xd')]);router[_0xb10e('0xe')]('/',auth[_0xb10e('0xb')](),controller[_0xb10e('0xf')]);router[_0xb10e('0xe')](_0xb10e('0x10'),auth['isAuthenticated'](),controller[_0xb10e('0x11')]);router[_0xb10e('0x12')](_0xb10e('0xa'),auth['isAuthenticated'](),controller[_0xb10e('0x13')]);router['delete'](_0xb10e('0xa'),auth[_0xb10e('0xb')](),controller[_0xb10e('0x14')]);module[_0xb10e('0x15')]=router; \ No newline at end of file +var _0xff98=['destroy','exports','util','path','connect-timeout','express','../../components/auth/service','../../config/environment','get','index','/:id','isAuthenticated','show','/:id/configurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xff98,0x9c));var _0x8ff9=function(_0x1e7e14,_0x2c0c38){_0x1e7e14=_0x1e7e14-0x0;var _0x230838=_0xff98[_0x1e7e14];return _0x230838;};'use strict';var multer=require('multer');var util=require(_0x8ff9('0x0'));var path=require(_0x8ff9('0x1'));var timeout=require(_0x8ff9('0x2'));var express=require(_0x8ff9('0x3'));var router=express['Router']();var auth=require(_0x8ff9('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x8ff9('0x5'));var controller=require('./intServicenowAccount.controller');router[_0x8ff9('0x6')]('/',auth['isAuthenticated'](),controller[_0x8ff9('0x7')]);router[_0x8ff9('0x6')](_0x8ff9('0x8'),auth[_0x8ff9('0x9')](),controller[_0x8ff9('0xa')]);router[_0x8ff9('0x6')](_0x8ff9('0xb'),auth[_0x8ff9('0x9')](),controller['getConfigurations']);router[_0x8ff9('0x6')](_0x8ff9('0xc'),auth[_0x8ff9('0x9')](),controller[_0x8ff9('0xd')]);router[_0x8ff9('0xe')]('/',auth[_0x8ff9('0x9')](),controller[_0x8ff9('0xf')]);router['post']('/:id/configurations',auth['isAuthenticated'](),controller[_0x8ff9('0x10')]);router[_0x8ff9('0x11')](_0x8ff9('0x8'),auth['isAuthenticated'](),controller[_0x8ff9('0x12')]);router[_0x8ff9('0x13')](_0x8ff9('0x8'),auth[_0x8ff9('0x9')](),controller[_0x8ff9('0x14')]);module[_0x8ff9('0x15')]=router; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.attributes.js b/server/api/intServicenowAccount/intServicenowAccount.attributes.js index 7ad7710..b186514 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 _0xbe7c=['username','remoteUri','sequelize','exports','STRING'];(function(_0x3ec916,_0x22a66d){var _0x336102=function(_0x3d8a48){while(--_0x3d8a48){_0x3ec916['push'](_0x3ec916['shift']());}};_0x336102(++_0x22a66d);}(_0xbe7c,0x129));var _0xcbe7=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xbe7c[_0x397e5f];return _0x5302b8;};'use strict';var Sequelize=require(_0xcbe7('0x0'));module[_0xcbe7('0x1')]={'name':{'type':Sequelize[_0xcbe7('0x2')]},'description':{'type':Sequelize[_0xcbe7('0x2')]},'username':{'type':Sequelize[_0xcbe7('0x2')],'unique':_0xcbe7('0x3')},'password':{'type':Sequelize[_0xcbe7('0x2')]},'email':{'type':Sequelize[_0xcbe7('0x2')]},'remoteUri':{'type':Sequelize[_0xcbe7('0x2')],'unique':_0xcbe7('0x4')},'serverUrl':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xa051=['STRING','username','remoteUri','sequelize','exports'];(function(_0x5691df,_0x266c5d){var _0x192f86=function(_0x1f1f6a){while(--_0x1f1f6a){_0x5691df['push'](_0x5691df['shift']());}};_0x192f86(++_0x266c5d);}(_0xa051,0x16b));var _0x1a05=function(_0x254ef5,_0x203af6){_0x254ef5=_0x254ef5-0x0;var _0x3e7d7e=_0xa051[_0x254ef5];return _0x3e7d7e;};'use strict';var Sequelize=require(_0x1a05('0x0'));module[_0x1a05('0x1')]={'name':{'type':Sequelize[_0x1a05('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x1a05('0x2')],'unique':_0x1a05('0x3')},'password':{'type':Sequelize[_0x1a05('0x2')]},'email':{'type':Sequelize[_0x1a05('0x2')]},'remoteUri':{'type':Sequelize[_0x1a05('0x2')],'unique':_0x1a05('0x4')},'serverUrl':{'type':Sequelize[_0x1a05('0x2')]}}; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.controller.js b/server/api/intServicenowAccount/intServicenowAccount.controller.js index 5e0aa5f..c70a934 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 _0x16a6=['ServicenowAccount,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','result','catch','sendStatus','status','json','count','offset','limit','Content-Range','apply','save','update','then','destroy','end','name','send','index','rawAttributes','keys','query','filters','intersection','model','attributes','fields','hasOwnProperty','order','where','pick','filter','merge','map','type','VIRTUAL','field','options','ServicenowAccount','includeAll','include','rows','find','create','body','params','getConfigurations','findOne','length','sort','nolimit','addConfiguration','AccountId','Subjects','getSubjects','channel','getDescriptions','ServicenowConfiguration','ServicenowField','made_sla','hold_reason','knowledge','subcategory','close_code','notify','severity','category','caused_by','watch_list','sys_updated_on','child_incidents','approval_history','number','sys_updated_by','opened_by','user_input','sys_domain','calendar_stc','closed_at','delivery_plan','impact','active','business_service','priority','sys_domain_path','rfc','time_worked','expected_start','opened_at','work_end','reopened_time','caller_id','approval_set','work_notes','short_description','correlation_display','delivery_task','work_start','assignment_group','additional_assignee_list','description','calendar_duration','sys_class_name','close_notes','closed_by','parent_incident','reopened_by','urgency','problem_id','activity_due','assigned_to','comments','sla_due','approval','due_date','reopen_count','sys_tags','escalation','upon_approval','correlation_id','location','username','password','email','slice','substring','format','%s/api/now/table/','log','incident\x20table\x20objects','assign','includes','forEach','internalType','label','push','all','TCL:\x20_object','remove','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','concat','ServiceNow\x20error:\x20','test','statusCode','stack','Wrong\x20credentials','boolean','True','true','False','GET','sys_choice?sysparm_query=name=incident^element=','inactive','false','value','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','lodash','squel','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','http','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','info','ServicenowAccount,\x20%s,\x20%s','debug'];(function(_0x25a6e1,_0xd3d112){var _0x2668e2=function(_0x1f75e4){while(--_0x1f75e4){_0x25a6e1['push'](_0x25a6e1['shift']());}};_0x2668e2(++_0xd3d112);}(_0x16a6,0x15c));var _0x616a=function(_0x77773a,_0x5a7026){_0x77773a=_0x77773a-0x0;var _0x1091a2=_0x16a6[_0x77773a];return _0x1091a2;};'use strict';var pdf=require(_0x616a('0x0'));var emlformat=require(_0x616a('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x616a('0x2'));var jsonpatch=require(_0x616a('0x3'));var rp=require(_0x616a('0x4'));var moment=require(_0x616a('0x5'));var BPromise=require(_0x616a('0x6'));var Mustache=require(_0x616a('0x7'));var util=require('util');var path=require(_0x616a('0x8'));var sox=require(_0x616a('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x616a('0xa'));var squel=require(_0x616a('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x616a('0xc'));var toCsv=require('to-csv');var querystring=require(_0x616a('0xd'));var Papa=require('papaparse');var Redis=require(_0x616a('0xe'));var authService=require(_0x616a('0xf'));var qs=require(_0x616a('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x616a('0x11'));var logger=require(_0x616a('0x12'))(_0x616a('0x13'));var utils=require(_0x616a('0x14'));var config=require(_0x616a('0x15'));var db=require(_0x616a('0x16'))['db'];var integrations=require(_0x616a('0x17'));var jayson=require(_0x616a('0x18'));var client=jayson['client'][_0x616a('0x19')]({'port':0x232a});function checkPasswordPattern(_0x411501,_0x3db4ae,_0x32becb){if(_0x32becb){var _0x295fc2=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x295fc2['test'](_0x3db4ae)){return _0x411501;}else{throw new Error(_0x616a('0x1a'));}}else{return _0x411501;}}function respondWithRpcPromise(_0x16dbfe,_0x24eb7c,_0x18b6dc,_0x3bcf20){return new BPromise(function(_0x53f228,_0x204e68){var _0x1803bc=_0x3bcf20||client;return _0x1803bc['request'](_0x16dbfe,_0x18b6dc)['then'](function(_0xe943fa){logger[_0x616a('0x1b')](_0x616a('0x1c'),_0x24eb7c,'request\x20sent');logger[_0x616a('0x1d')](_0x616a('0x1e'),_0x24eb7c,'request\x20sent',JSON['stringify'](_0xe943fa));if(_0xe943fa[_0x616a('0x1f')]){if(_0xe943fa[_0x616a('0x1f')][_0x616a('0x20')]===0x1f4){logger[_0x616a('0x1f')]('ServicenowAccount,\x20%s,\x20%s',_0x24eb7c,_0xe943fa['error']['message']);return _0x204e68(_0xe943fa['error']['message']);}logger['error'](_0x616a('0x1c'),_0x24eb7c,_0xe943fa['error'][_0x616a('0x21')]);return _0x53f228(_0xe943fa[_0x616a('0x1f')]['message']);}else{logger[_0x616a('0x1b')](_0x616a('0x1c'),_0x24eb7c,_0x616a('0x22'));_0x53f228(_0xe943fa[_0x616a('0x23')]['message']);}})[_0x616a('0x24')](function(_0x71e642){logger[_0x616a('0x1f')](_0x616a('0x1c'),_0x24eb7c,_0x71e642);_0x204e68(_0x71e642);});});}function respondWithStatusCode(_0x500f4e,_0x3e11f2){_0x3e11f2=_0x3e11f2||0xcc;return function(_0x4be8a8){if(_0x4be8a8){return _0x500f4e[_0x616a('0x25')](_0x3e11f2);}return _0x500f4e[_0x616a('0x26')](_0x3e11f2)['end']();};}function respondWithResult(_0x55abc8,_0x50c6b8){_0x50c6b8=_0x50c6b8||0xc8;return function(_0x474420){if(_0x474420){return _0x55abc8[_0x616a('0x26')](_0x50c6b8)[_0x616a('0x27')](_0x474420);}};}function respondWithFilteredResult(_0x1ba9db,_0x4c0f9f){return function(_0xadada0){if(_0xadada0){var _0x3fb030=_0xadada0[_0x616a('0x28')],_0x195b73=_0x4c0f9f[_0x616a('0x29')],_0x163fd0=_0x4c0f9f['offset']+_0x4c0f9f[_0x616a('0x2a')],_0x28ca50;if(_0x163fd0>=_0x3fb030){_0x163fd0=_0x3fb030;_0x28ca50=0xc8;}else{_0x28ca50=0xce;}_0x1ba9db[_0x616a('0x26')](_0x28ca50);return _0x1ba9db['set'](_0x616a('0x2b'),_0x195b73+'-'+_0x163fd0+'/'+_0x3fb030)['json'](_0xadada0);}return null;};}function patchUpdates(_0x5f00d0){return function(_0x4726a1){try{jsonpatch[_0x616a('0x2c')](_0x4726a1,_0x5f00d0,!![]);}catch(_0x30e42c){return BPromise['reject'](_0x30e42c);}return _0x4726a1[_0x616a('0x2d')]();};}function saveUpdates(_0x32825a,_0x213f6a){return function(_0x2d85ce){if(_0x2d85ce){return _0x2d85ce[_0x616a('0x2e')](_0x32825a)[_0x616a('0x2f')](function(_0x5191d2){return _0x5191d2;});}return null;};}function removeEntity(_0x147b50,_0x4a938c){return function(_0x1cc6c5){if(_0x1cc6c5){return _0x1cc6c5[_0x616a('0x30')]()[_0x616a('0x2f')](function(){_0x147b50['status'](0xcc)[_0x616a('0x31')]();});}};}function handleEntityNotFound(_0x27e69f,_0x579402){return function(_0x5ad055){if(!_0x5ad055){_0x27e69f[_0x616a('0x25')](0x194);}return _0x5ad055;};}function handleError(_0x34697a,_0x3e7301){_0x3e7301=_0x3e7301||0x1f4;return function(_0x12fd21){logger['error'](_0x12fd21['stack']);if(_0x12fd21['name']){delete _0x12fd21[_0x616a('0x32')];}_0x34697a[_0x616a('0x26')](_0x3e7301)[_0x616a('0x33')](_0x12fd21);};}exports[_0x616a('0x34')]=function(_0x1bc0ea,_0x2c4980){var _0x1c06ee={},_0x106364={},_0x1f1384={'count':0x0,'rows':[]};var _0x151fff=db['ServicenowAccount'][_0x616a('0x35')];_0x106364['model']=_[_0x616a('0x36')](_0x151fff);_0x106364[_0x616a('0x37')]=_[_0x616a('0x36')](_0x1bc0ea[_0x616a('0x37')]);_0x106364[_0x616a('0x38')]=_[_0x616a('0x39')](_0x106364[_0x616a('0x3a')],_0x106364[_0x616a('0x37')]);_0x1c06ee[_0x616a('0x3b')]=_['intersection'](_0x106364[_0x616a('0x3a')],qs[_0x616a('0x3c')](_0x1bc0ea[_0x616a('0x37')][_0x616a('0x3c')]));_0x1c06ee['attributes']=_0x1c06ee[_0x616a('0x3b')]['length']?_0x1c06ee[_0x616a('0x3b')]:_0x106364['model'];if(!_0x1bc0ea[_0x616a('0x37')][_0x616a('0x3d')]('nolimit')){_0x1c06ee[_0x616a('0x2a')]=qs['limit'](_0x1bc0ea[_0x616a('0x37')][_0x616a('0x2a')]);_0x1c06ee[_0x616a('0x29')]=qs[_0x616a('0x29')](_0x1bc0ea[_0x616a('0x37')][_0x616a('0x29')]);}_0x1c06ee[_0x616a('0x3e')]=qs['sort'](_0x1bc0ea[_0x616a('0x37')]['sort']);_0x1c06ee[_0x616a('0x3f')]=qs[_0x616a('0x38')](_[_0x616a('0x40')](_0x1bc0ea['query'],_0x106364[_0x616a('0x38')]));if(_0x1bc0ea[_0x616a('0x37')][_0x616a('0x41')]){_0x1c06ee[_0x616a('0x3f')]=_[_0x616a('0x42')](_0x1c06ee['where'],{'$or':_[_0x616a('0x43')](_0x151fff,function(_0x24b120){if(_0x24b120[_0x616a('0x44')]['key']!==_0x616a('0x45')){var _0x364632={};_0x364632[_0x24b120[_0x616a('0x46')]]={'$like':'%'+_0x1bc0ea[_0x616a('0x37')][_0x616a('0x41')]+'%'};return _0x364632;}})});}_0x1c06ee=_[_0x616a('0x42')]({},_0x1c06ee,_0x1bc0ea[_0x616a('0x47')]);var _0x4f6344={'where':_0x1c06ee[_0x616a('0x3f')]};return db[_0x616a('0x48')]['count'](_0x4f6344)['then'](function(_0x25b647){_0x1f1384[_0x616a('0x28')]=_0x25b647;if(_0x1bc0ea[_0x616a('0x37')][_0x616a('0x49')]){_0x1c06ee[_0x616a('0x4a')]=[{'all':!![]}];}return db[_0x616a('0x48')]['findAll'](_0x1c06ee);})[_0x616a('0x2f')](function(_0x21c8dd){_0x1f1384[_0x616a('0x4b')]=_0x21c8dd;return _0x1f1384;})['then'](respondWithFilteredResult(_0x2c4980,_0x1c06ee))[_0x616a('0x24')](handleError(_0x2c4980,null));};exports['show']=function(_0x52d38,_0x76336d){var _0x3357b2={'raw':![],'where':{'id':_0x52d38['params']['id']}},_0x32bd79={};_0x32bd79[_0x616a('0x3a')]=_[_0x616a('0x36')](db[_0x616a('0x48')][_0x616a('0x35')]);_0x32bd79[_0x616a('0x37')]=_['keys'](_0x52d38[_0x616a('0x37')]);_0x32bd79[_0x616a('0x38')]=_[_0x616a('0x39')](_0x32bd79[_0x616a('0x3a')],_0x32bd79[_0x616a('0x37')]);_0x3357b2[_0x616a('0x3b')]=_['intersection'](_0x32bd79[_0x616a('0x3a')],qs[_0x616a('0x3c')](_0x52d38[_0x616a('0x37')][_0x616a('0x3c')]));_0x3357b2['attributes']=_0x3357b2[_0x616a('0x3b')]['length']?_0x3357b2[_0x616a('0x3b')]:_0x32bd79[_0x616a('0x3a')];if(_0x52d38['query'][_0x616a('0x49')]){_0x3357b2[_0x616a('0x4a')]=[{'all':!![]}];}_0x3357b2=_[_0x616a('0x42')]({},_0x3357b2,_0x52d38['options']);return db[_0x616a('0x48')][_0x616a('0x4c')](_0x3357b2)[_0x616a('0x2f')](handleEntityNotFound(_0x76336d,null))[_0x616a('0x2f')](respondWithResult(_0x76336d,null))['catch'](handleError(_0x76336d,null));};exports['create']=function(_0x944a82,_0x441dc5){return db[_0x616a('0x48')][_0x616a('0x4d')](_0x944a82['body'],{})[_0x616a('0x2f')](respondWithResult(_0x441dc5,0xc9))[_0x616a('0x24')](handleError(_0x441dc5,null));};exports[_0x616a('0x2e')]=function(_0x5f0483,_0x550a48){if(_0x5f0483[_0x616a('0x4e')]['id']){delete _0x5f0483[_0x616a('0x4e')]['id'];}return db[_0x616a('0x48')][_0x616a('0x4c')]({'where':{'id':_0x5f0483[_0x616a('0x4f')]['id']}})[_0x616a('0x2f')](handleEntityNotFound(_0x550a48,null))[_0x616a('0x2f')](saveUpdates(_0x5f0483[_0x616a('0x4e')],null))[_0x616a('0x2f')](respondWithResult(_0x550a48,null))[_0x616a('0x24')](handleError(_0x550a48,null));};exports[_0x616a('0x30')]=function(_0x51187c,_0x53b398){return db[_0x616a('0x48')][_0x616a('0x4c')]({'where':{'id':_0x51187c[_0x616a('0x4f')]['id']}})[_0x616a('0x2f')](handleEntityNotFound(_0x53b398,null))['then'](removeEntity(_0x53b398,null))['catch'](handleError(_0x53b398,null));};exports[_0x616a('0x50')]=function(_0x5401e8,_0x7728ee,_0x2e0cba){var _0x1bc864={};var _0x2a34eb={};var _0x50327b;var _0x44be05;return db[_0x616a('0x48')][_0x616a('0x51')]({'where':{'id':_0x5401e8[_0x616a('0x4f')]['id']}})[_0x616a('0x2f')](handleEntityNotFound(_0x7728ee,null))['then'](function(_0x49e2d2){if(_0x49e2d2){_0x50327b=_0x49e2d2;_0x2a34eb['model']=_[_0x616a('0x36')](db['ServicenowConfiguration'][_0x616a('0x35')]);_0x2a34eb[_0x616a('0x37')]=_['keys'](_0x5401e8[_0x616a('0x37')]);_0x2a34eb['filters']=_['intersection'](_0x2a34eb[_0x616a('0x3a')],_0x2a34eb['query']);_0x1bc864['attributes']=_[_0x616a('0x39')](_0x2a34eb['model'],qs[_0x616a('0x3c')](_0x5401e8[_0x616a('0x37')][_0x616a('0x3c')]));_0x1bc864[_0x616a('0x3b')]=_0x1bc864[_0x616a('0x3b')][_0x616a('0x52')]?_0x1bc864[_0x616a('0x3b')]:_0x2a34eb[_0x616a('0x3a')];_0x1bc864['order']=qs['sort'](_0x5401e8[_0x616a('0x37')][_0x616a('0x53')]);_0x1bc864['where']=qs[_0x616a('0x38')](_[_0x616a('0x40')](_0x5401e8['query'],_0x2a34eb[_0x616a('0x38')]));if(_0x5401e8[_0x616a('0x37')][_0x616a('0x41')]){_0x1bc864['where']=_[_0x616a('0x42')](_0x1bc864[_0x616a('0x3f')],{'$or':_['map'](_0x1bc864[_0x616a('0x3b')],function(_0x47c985){var _0x3287b7={};_0x3287b7[_0x47c985]={'$like':'%'+_0x5401e8[_0x616a('0x37')][_0x616a('0x41')]+'%'};return _0x3287b7;})});}_0x1bc864=_[_0x616a('0x42')]({},_0x1bc864,_0x5401e8[_0x616a('0x47')]);return _0x50327b['getConfigurations'](_0x1bc864);}})[_0x616a('0x2f')](function(_0x5868a1){if(_0x5868a1){_0x44be05=_0x5868a1[_0x616a('0x52')];if(!_0x5401e8[_0x616a('0x37')][_0x616a('0x3d')](_0x616a('0x54'))){_0x1bc864['limit']=qs[_0x616a('0x2a')](_0x5401e8[_0x616a('0x37')][_0x616a('0x2a')]);_0x1bc864[_0x616a('0x29')]=qs[_0x616a('0x29')](_0x5401e8[_0x616a('0x37')]['offset']);}return _0x50327b[_0x616a('0x50')](_0x1bc864);}})[_0x616a('0x2f')](function(_0x39bf24){if(_0x39bf24){return _0x39bf24?{'count':_0x44be05,'rows':_0x39bf24}:null;}})[_0x616a('0x2f')](respondWithResult(_0x7728ee,null))[_0x616a('0x24')](handleError(_0x7728ee,null));};exports[_0x616a('0x55')]=function(_0x3d6624,_0x3d8fcf,_0x32474c){if(_0x3d6624['body']['id']){delete _0x3d6624[_0x616a('0x4e')]['id'];}return db[_0x616a('0x48')]['findOne']({'where':{'id':_0x3d6624[_0x616a('0x4f')]['id']}})['then'](handleEntityNotFound(_0x3d8fcf,null))[_0x616a('0x2f')](function(_0x2b52e1){if(_0x2b52e1){_0x3d6624[_0x616a('0x4e')][_0x616a('0x56')]=_0x2b52e1['id'];_0x3d6624[_0x616a('0x4e')][_0x616a('0x57')]=integrations[_0x616a('0x58')](_0x3d6624[_0x616a('0x4e')][_0x616a('0x59')],_0x3d6624[_0x616a('0x4e')][_0x616a('0x44')]);_0x3d6624['body']['Descriptions']=integrations[_0x616a('0x5a')](_0x3d6624['body'][_0x616a('0x59')],_0x3d6624[_0x616a('0x4e')]['type']);return db[_0x616a('0x5b')]['create'](_0x3d6624[_0x616a('0x4e')],{'include':[{'model':db['ServicenowField'],'as':_0x616a('0x57')},{'model':db[_0x616a('0x5c')],'as':'Descriptions'}]});}return null;})[_0x616a('0x2f')](respondWithResult(_0x3d8fcf,null))['catch'](handleError(_0x3d8fcf,null));};exports['getFields']=function(_0x4220f6,_0x9fb16b,_0x50a874){var _0x114f39=[_0x616a('0x5d'),_0x616a('0x5e'),_0x616a('0x5f'),_0x616a('0x60'),_0x616a('0x61'),_0x616a('0x62'),'incident_state',_0x616a('0x63'),_0x616a('0x64')];var _0x24dada=['parent',_0x616a('0x5d'),_0x616a('0x65'),_0x616a('0x66'),'upon_reject',_0x616a('0x67'),_0x616a('0x68'),_0x616a('0x5e'),_0x616a('0x69'),_0x616a('0x6a'),'resolved_by',_0x616a('0x6b'),_0x616a('0x6c'),_0x616a('0x6d'),'sys_created_on',_0x616a('0x6e'),'state','sys_created_by',_0x616a('0x5f'),_0x616a('0x3e'),_0x616a('0x6f'),_0x616a('0x70'),'cmdb_ci',_0x616a('0x71'),_0x616a('0x72'),_0x616a('0x73'),'work_notes_list',_0x616a('0x74'),_0x616a('0x75'),_0x616a('0x76'),_0x616a('0x77'),_0x616a('0x78'),_0x616a('0x79'),_0x616a('0x7a'),'business_duration','group_list',_0x616a('0x7b'),_0x616a('0x7c'),'resolved_at',_0x616a('0x7d'),_0x616a('0x7e'),_0x616a('0x60'),_0x616a('0x7f'),_0x616a('0x80'),'close_code',_0x616a('0x81'),_0x616a('0x82'),_0x616a('0x83'),_0x616a('0x84'),'business_stc',_0x616a('0x85'),_0x616a('0x86'),_0x616a('0x87'),'notify',_0x616a('0x88'),_0x616a('0x89'),_0x616a('0x8a'),'follow_up',_0x616a('0x8b'),'sys_id','contact_type',_0x616a('0x8c'),'incident_state',_0x616a('0x8d'),_0x616a('0x8e'),'company','reassignment_count',_0x616a('0x8f'),_0x616a('0x90'),_0x616a('0x63'),_0x616a('0x91'),_0x616a('0x92'),_0x616a('0x93'),'comments_and_work_notes',_0x616a('0x94'),'sys_mod_count',_0x616a('0x95'),_0x616a('0x96'),_0x616a('0x97'),_0x616a('0x98'),_0x616a('0x99'),_0x616a('0x9a'),_0x616a('0x64')];var _0x19050c='';var _0x40d504='';var _0x5c21f2=[];var _0x6445b7='';var _0x4ddb64='';var _0x46b79c=[];var _0x18b571='';var _0x3fd5c2='';var _0x61b4dd={};var _0x48eed4='';return db[_0x616a('0x48')]['findOne']({'where':{'id':_0x4220f6[_0x616a('0x4f')]['id']},'attributes':['id',_0x616a('0x9b'),_0x616a('0x9c'),_0x616a('0x9d'),'remoteUri','serverUrl']})['then'](handleEntityNotFound(_0x9fb16b,null))[_0x616a('0x2f')](function(_0x488cb1){if(_0x488cb1){_0x48eed4=_0x488cb1['remoteUri'];var _0x37f514=_0x48eed4[_0x616a('0x9e')](-0x1);if(_0x37f514==='/'){_0x48eed4=_0x48eed4[_0x616a('0x9f')](0x0,_0x48eed4['lastIndexOf'](_0x37f514));}_0x3fd5c2=util[_0x616a('0xa0')]('%s/api/now/doc/table/schema/',_0x48eed4);_0x18b571=util[_0x616a('0xa0')](_0x616a('0xa1'),_0x48eed4);_0x61b4dd={'user':_0x488cb1[_0x616a('0x9b')],'pass':_0x488cb1[_0x616a('0x9c')]};var _0x59c0bc={'method':'GET','uri':_0x3fd5c2+'incident?sysparm_display_value=all','auth':_0x61b4dd,'json':!![]};return rp(_0x59c0bc);}})[_0x616a('0x2f')](function(_0x2a7fae){if(_0x2a7fae[_0x616a('0x23')][_0x616a('0x52')]>0x0){_0x19050c=_0x2a7fae[_0x616a('0x23')];}console[_0x616a('0xa2')](_0x616a('0xa3'),_0x19050c);_0x46b79c=[];_0x40d504=Object[_0x616a('0xa4')]([],_0x19050c);_['remove'](_0x40d504,function(_0x26f3a7){return!_0x114f39[_0x616a('0xa5')](_0x26f3a7[_0x616a('0x32')]);});_0x40d504[_0x616a('0xa6')](function(_0x4b21c3){var _0x325c9a=createFieldObject(_0x18b571,_0x61b4dd,_0x4b21c3[_0x616a('0xa7')],_0x4b21c3[_0x616a('0x32')],_0x4b21c3[_0x616a('0xa8')],![]);_0x46b79c[_0x616a('0xa9')](_0x325c9a);});return Promise[_0x616a('0xaa')](_0x46b79c);})[_0x616a('0x2f')](function(_0x3ad709){_0x5c21f2=_0x3ad709;_0x6445b7=Object[_0x616a('0xa4')]([],_0x19050c);console[_0x616a('0xa2')](_0x616a('0xab'),_0x19050c);_[_0x616a('0xac')](_0x6445b7,function(_0x3d580c){return _0x24dada[_0x616a('0xa5')](_0x3d580c[_0x616a('0x32')]);});console[_0x616a('0xa2')](_0x616a('0xad'),_0x6445b7);_0x46b79c=[];_0x6445b7[_0x616a('0xa6')](function(_0x50ea06){var _0x3fc604=createFieldObject(_0x18b571,_0x61b4dd,_0x50ea06[_0x616a('0xa7')],_0x50ea06[_0x616a('0x32')],_0x50ea06['label'],!![]);_0x46b79c['push'](_0x3fc604);});return Promise['all'](_0x46b79c);})[_0x616a('0x2f')](function(_0xf86f6f){_0x4ddb64=_0xf86f6f;var _0x283f42=_0x5c21f2[_0x616a('0xae')](_0x4ddb64);return{'count':_0x283f42['length'],'rows':_0x283f42};})['then'](respondWithResult(_0x9fb16b,null))[_0x616a('0x24')](function(_0x26f3f9){console[_0x616a('0xa2')](_0x616a('0xaf')+_0x26f3f9);var _0x218ec1=_0x4220f6['query'][_0x616a('0xb0')]?0x1f4:_0x26f3f9[_0x616a('0xb1')]||0x1f4;logger['error'](_0x26f3f9[_0x616a('0xb2')]);delete _0x26f3f9[_0x616a('0x32')];if(_0x218ec1===0x191){_0x218ec1=0x190;}_0x9fb16b['status'](_0x218ec1)[_0x616a('0x33')](_0x4220f6['query'][_0x616a('0xb0')]?{'message':_0x616a('0xb3'),'statusCode':_0x26f3f9[_0x616a('0xb1')]}:_0x26f3f9);});};function createFieldObject(_0x1b4a75,_0x318bbc,_0x4ad311,_0x43258d,_0x19785b,_0x5485eb){return new Promise(function(_0x33be09,_0x3f4fdc){var _0x3f771f={'id':_0x43258d,'name':_0x19785b,'custom':_0x5485eb};if(_0x4ad311===_0x616a('0xb4')){_0x3f771f['options']=[{'name':_0x616a('0xb5'),'value':_0x616a('0xb6')},{'name':_0x616a('0xb7'),'value':'false'}];_0x33be09(_0x3f771f);}else{var _0x4b01b5={'method':_0x616a('0xb8'),'uri':_0x1b4a75+_0x616a('0xb9')+_0x43258d,'auth':_0x318bbc,'json':!![]};return rp(_0x4b01b5)[_0x616a('0x2f')](function(_0x30596c){var _0x29b0ac=[];if(_0x30596c['result']['length']>0x0){_0x30596c[_0x616a('0x23')]['forEach'](function(_0x2cc0b3){if(_0x2cc0b3[_0x616a('0xba')]===_0x616a('0xbb')){var _0x4e3b6c={'name':_0x2cc0b3[_0x616a('0xa8')],'value':_0x2cc0b3[_0x616a('0xbc')]};_0x29b0ac[_0x616a('0xa9')](_0x4e3b6c);}});}_0x3f771f[_0x616a('0x47')]=_0x29b0ac;if(_0x3f771f['options']['length']>0x0){_0x33be09(_0x3f771f);}else{if(_0x5485eb==![]){_0x33be09();}else{_0x33be09(_0x3f771f);}}});}});} \ No newline at end of file +var _0x53f8=['include','findAll','rows','show','params','ServicenowAccount','length','options','find','create','body','catch','findOne','ServicenowConfiguration','order','getConfigurations','hasOwnProperty','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','ServicenowField','getFields','made_sla','hold_reason','subcategory','close_code','notify','incident_state','severity','category','caused_by','watch_list','sys_updated_on','number','sys_updated_by','opened_by','user_input','sys_domain','state','sys_created_by','knowledge','calendar_stc','closed_at','cmdb_ci','delivery_plan','impact','active','work_notes_list','business_service','priority','sys_domain_path','rfc','time_worked','expected_start','business_duration','group_list','work_end','reopened_time','approval_set','work_notes','short_description','correlation_display','work_start','assignment_group','business_stc','additional_assignee_list','description','calendar_duration','follow_up','parent_incident','contact_type','reopened_by','urgency','problem_id','company','reassignment_count','assigned_to','comments','sla_due','approval','comments_and_work_notes','due_date','sys_mod_count','reopen_count','escalation','upon_approval','correlation_id','username','remoteUri','serverUrl','slice','lastIndexOf','format','%s/api/now/doc/table/schema/','%s/api/now/table/','password','log','assign','forEach','internalType','label','push','TCL:\x20_object','remove','includes','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','all','concat','ServiceNow\x20error:\x20','statusCode','boolean','True','true','False','false','GET','sys_choice?sysparm_query=name=incident^element=','value','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','http','test','then','ServicenowAccount,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','sendStatus','status','end','json','count','offset','limit','apply','reject','save','update','destroy','stack','name','send','rawAttributes','model','keys','query','attributes','intersection','fields','nolimit','sort','where','filters','pick','merge','map','type','key','field','filter','includeAll'];(function(_0x2f4176,_0x16cc04){var _0x4e528c=function(_0x2326fa){while(--_0x2326fa){_0x2f4176['push'](_0x2f4176['shift']());}};_0x4e528c(++_0x16cc04);}(_0x53f8,0x7a));var _0x853f=function(_0x55e08b,_0x421620){_0x55e08b=_0x55e08b-0x0;var _0xd1a7ff=_0x53f8[_0x55e08b];return _0xd1a7ff;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x853f('0x0'));var rimraf=require(_0x853f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x853f('0x2'));var rp=require(_0x853f('0x3'));var moment=require('moment');var BPromise=require(_0x853f('0x4'));var Mustache=require(_0x853f('0x5'));var util=require(_0x853f('0x6'));var path=require(_0x853f('0x7'));var sox=require('sox');var csv=require(_0x853f('0x8'));var ejs=require(_0x853f('0x9'));var fs=require('fs');var _=require(_0x853f('0xa'));var squel=require(_0x853f('0xb'));var crypto=require('crypto');var jsforce=require(_0x853f('0xc'));var deskjs=require(_0x853f('0xd'));var toCsv=require('to-csv');var querystring=require(_0x853f('0xe'));var Papa=require(_0x853f('0xf'));var Redis=require('ioredis');var authService=require(_0x853f('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x853f('0x11'));var hardwareService=require(_0x853f('0x12'));var logger=require(_0x853f('0x13'))(_0x853f('0x14'));var utils=require(_0x853f('0x15'));var config=require(_0x853f('0x16'));var db=require(_0x853f('0x17'))['db'];var integrations=require('../../components/integrations/configuration');var jayson=require(_0x853f('0x18'));var client=jayson['client'][_0x853f('0x19')]({'port':0x232a});function checkPasswordPattern(_0x22705a,_0x202741,_0x42a03d){if(_0x42a03d){var _0x362d59=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x362d59[_0x853f('0x1a')](_0x202741)){return _0x22705a;}else{throw new Error('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x22705a;}}function respondWithRpcPromise(_0x3cbdb3,_0x8e8d9e,_0x38af84,_0x2f8848){return new BPromise(function(_0x21d061,_0x2de959){var _0x4c74a1=_0x2f8848||client;return _0x4c74a1['request'](_0x3cbdb3,_0x38af84)[_0x853f('0x1b')](function(_0x347805){logger['info'](_0x853f('0x1c'),_0x8e8d9e,_0x853f('0x1d'));logger['debug']('ServicenowAccount,\x20%s,\x20%s,\x20%s',_0x8e8d9e,_0x853f('0x1d'),JSON[_0x853f('0x1e')](_0x347805));if(_0x347805[_0x853f('0x1f')]){if(_0x347805[_0x853f('0x1f')][_0x853f('0x20')]===0x1f4){logger[_0x853f('0x1f')](_0x853f('0x1c'),_0x8e8d9e,_0x347805['error'][_0x853f('0x21')]);return _0x2de959(_0x347805[_0x853f('0x1f')][_0x853f('0x21')]);}logger[_0x853f('0x1f')](_0x853f('0x1c'),_0x8e8d9e,_0x347805['error'][_0x853f('0x21')]);return _0x21d061(_0x347805[_0x853f('0x1f')][_0x853f('0x21')]);}else{logger['info'](_0x853f('0x1c'),_0x8e8d9e,_0x853f('0x1d'));_0x21d061(_0x347805[_0x853f('0x22')][_0x853f('0x21')]);}})['catch'](function(_0x1b8d91){logger[_0x853f('0x1f')]('ServicenowAccount,\x20%s,\x20%s',_0x8e8d9e,_0x1b8d91);_0x2de959(_0x1b8d91);});});}function respondWithStatusCode(_0x2df4d8,_0x483733){_0x483733=_0x483733||0xcc;return function(_0x1b16ad){if(_0x1b16ad){return _0x2df4d8[_0x853f('0x23')](_0x483733);}return _0x2df4d8[_0x853f('0x24')](_0x483733)[_0x853f('0x25')]();};}function respondWithResult(_0x3b75ae,_0x5cdd3b){_0x5cdd3b=_0x5cdd3b||0xc8;return function(_0x37d047){if(_0x37d047){return _0x3b75ae[_0x853f('0x24')](_0x5cdd3b)[_0x853f('0x26')](_0x37d047);}};}function respondWithFilteredResult(_0x329e20,_0x10ceb6){return function(_0x1f7c31){if(_0x1f7c31){var _0x5abe53=_0x1f7c31[_0x853f('0x27')],_0x114266=_0x10ceb6[_0x853f('0x28')],_0x2d21d9=_0x10ceb6['offset']+_0x10ceb6[_0x853f('0x29')],_0x235c13;if(_0x2d21d9>=_0x5abe53){_0x2d21d9=_0x5abe53;_0x235c13=0xc8;}else{_0x235c13=0xce;}_0x329e20[_0x853f('0x24')](_0x235c13);return _0x329e20['set']('Content-Range',_0x114266+'-'+_0x2d21d9+'/'+_0x5abe53)['json'](_0x1f7c31);}return null;};}function patchUpdates(_0x20b27a){return function(_0x482ef2){try{jsonpatch[_0x853f('0x2a')](_0x482ef2,_0x20b27a,!![]);}catch(_0x4d8c2d){return BPromise[_0x853f('0x2b')](_0x4d8c2d);}return _0x482ef2[_0x853f('0x2c')]();};}function saveUpdates(_0x17b283,_0x456af3){return function(_0x213950){if(_0x213950){return _0x213950[_0x853f('0x2d')](_0x17b283)[_0x853f('0x1b')](function(_0x45a034){return _0x45a034;});}return null;};}function removeEntity(_0x230890,_0x206d2e){return function(_0x96d43f){if(_0x96d43f){return _0x96d43f[_0x853f('0x2e')]()['then'](function(){_0x230890[_0x853f('0x24')](0xcc)[_0x853f('0x25')]();});}};}function handleEntityNotFound(_0x27562c,_0x247d8c){return function(_0xd9cb44){if(!_0xd9cb44){_0x27562c['sendStatus'](0x194);}return _0xd9cb44;};}function handleError(_0x29a6cc,_0x3a204a){_0x3a204a=_0x3a204a||0x1f4;return function(_0x1aede8){logger[_0x853f('0x1f')](_0x1aede8[_0x853f('0x2f')]);if(_0x1aede8[_0x853f('0x30')]){delete _0x1aede8['name'];}_0x29a6cc[_0x853f('0x24')](_0x3a204a)[_0x853f('0x31')](_0x1aede8);};}exports['index']=function(_0xe756b9,_0x1b0591){var _0x856040={},_0x4dd507={},_0x46924a={'count':0x0,'rows':[]};var _0x340392=db['ServicenowAccount'][_0x853f('0x32')];_0x4dd507[_0x853f('0x33')]=_['keys'](_0x340392);_0x4dd507['query']=_[_0x853f('0x34')](_0xe756b9['query']);_0x4dd507['filters']=_['intersection'](_0x4dd507['model'],_0x4dd507[_0x853f('0x35')]);_0x856040[_0x853f('0x36')]=_[_0x853f('0x37')](_0x4dd507['model'],qs[_0x853f('0x38')](_0xe756b9['query'][_0x853f('0x38')]));_0x856040['attributes']=_0x856040['attributes']['length']?_0x856040[_0x853f('0x36')]:_0x4dd507[_0x853f('0x33')];if(!_0xe756b9[_0x853f('0x35')]['hasOwnProperty'](_0x853f('0x39'))){_0x856040['limit']=qs[_0x853f('0x29')](_0xe756b9[_0x853f('0x35')][_0x853f('0x29')]);_0x856040[_0x853f('0x28')]=qs[_0x853f('0x28')](_0xe756b9[_0x853f('0x35')][_0x853f('0x28')]);}_0x856040['order']=qs['sort'](_0xe756b9[_0x853f('0x35')][_0x853f('0x3a')]);_0x856040[_0x853f('0x3b')]=qs[_0x853f('0x3c')](_[_0x853f('0x3d')](_0xe756b9[_0x853f('0x35')],_0x4dd507[_0x853f('0x3c')]));if(_0xe756b9['query']['filter']){_0x856040[_0x853f('0x3b')]=_[_0x853f('0x3e')](_0x856040['where'],{'$or':_[_0x853f('0x3f')](_0x340392,function(_0x2e0090){if(_0x2e0090[_0x853f('0x40')][_0x853f('0x41')]!=='VIRTUAL'){var _0x5c955e={};_0x5c955e[_0x2e0090[_0x853f('0x42')]]={'$like':'%'+_0xe756b9[_0x853f('0x35')][_0x853f('0x43')]+'%'};return _0x5c955e;}})});}_0x856040=_['merge']({},_0x856040,_0xe756b9['options']);var _0x39b65e={'where':_0x856040[_0x853f('0x3b')]};return db['ServicenowAccount'][_0x853f('0x27')](_0x39b65e)['then'](function(_0x1bc906){_0x46924a[_0x853f('0x27')]=_0x1bc906;if(_0xe756b9['query'][_0x853f('0x44')]){_0x856040[_0x853f('0x45')]=[{'all':!![]}];}return db['ServicenowAccount'][_0x853f('0x46')](_0x856040);})[_0x853f('0x1b')](function(_0x448e75){_0x46924a[_0x853f('0x47')]=_0x448e75;return _0x46924a;})[_0x853f('0x1b')](respondWithFilteredResult(_0x1b0591,_0x856040))['catch'](handleError(_0x1b0591,null));};exports[_0x853f('0x48')]=function(_0x42f7dc,_0xf895a5){var _0x4bae0e={'raw':![],'where':{'id':_0x42f7dc[_0x853f('0x49')]['id']}},_0x46fe1f={};_0x46fe1f[_0x853f('0x33')]=_[_0x853f('0x34')](db[_0x853f('0x4a')][_0x853f('0x32')]);_0x46fe1f[_0x853f('0x35')]=_[_0x853f('0x34')](_0x42f7dc[_0x853f('0x35')]);_0x46fe1f[_0x853f('0x3c')]=_[_0x853f('0x37')](_0x46fe1f['model'],_0x46fe1f['query']);_0x4bae0e[_0x853f('0x36')]=_[_0x853f('0x37')](_0x46fe1f[_0x853f('0x33')],qs['fields'](_0x42f7dc['query']['fields']));_0x4bae0e[_0x853f('0x36')]=_0x4bae0e[_0x853f('0x36')][_0x853f('0x4b')]?_0x4bae0e[_0x853f('0x36')]:_0x46fe1f[_0x853f('0x33')];if(_0x42f7dc['query']['includeAll']){_0x4bae0e['include']=[{'all':!![]}];}_0x4bae0e=_['merge']({},_0x4bae0e,_0x42f7dc[_0x853f('0x4c')]);return db[_0x853f('0x4a')][_0x853f('0x4d')](_0x4bae0e)[_0x853f('0x1b')](handleEntityNotFound(_0xf895a5,null))[_0x853f('0x1b')](respondWithResult(_0xf895a5,null))['catch'](handleError(_0xf895a5,null));};exports[_0x853f('0x4e')]=function(_0x5924d8,_0x18de4a){return db[_0x853f('0x4a')]['create'](_0x5924d8[_0x853f('0x4f')],{})[_0x853f('0x1b')](respondWithResult(_0x18de4a,0xc9))[_0x853f('0x50')](handleError(_0x18de4a,null));};exports[_0x853f('0x2d')]=function(_0x5b8449,_0x807171){if(_0x5b8449[_0x853f('0x4f')]['id']){delete _0x5b8449['body']['id'];}return db[_0x853f('0x4a')][_0x853f('0x4d')]({'where':{'id':_0x5b8449[_0x853f('0x49')]['id']}})[_0x853f('0x1b')](handleEntityNotFound(_0x807171,null))[_0x853f('0x1b')](saveUpdates(_0x5b8449['body'],null))[_0x853f('0x1b')](respondWithResult(_0x807171,null))['catch'](handleError(_0x807171,null));};exports['destroy']=function(_0x201dc6,_0x4a6b7c){return db['ServicenowAccount'][_0x853f('0x4d')]({'where':{'id':_0x201dc6[_0x853f('0x49')]['id']}})[_0x853f('0x1b')](handleEntityNotFound(_0x4a6b7c,null))[_0x853f('0x1b')](removeEntity(_0x4a6b7c,null))[_0x853f('0x50')](handleError(_0x4a6b7c,null));};exports['getConfigurations']=function(_0x5cb737,_0x3be85e,_0x47f345){var _0x5ef8d5={};var _0x2435c6={};var _0xb71bc8;var _0x394336;return db[_0x853f('0x4a')][_0x853f('0x51')]({'where':{'id':_0x5cb737[_0x853f('0x49')]['id']}})[_0x853f('0x1b')](handleEntityNotFound(_0x3be85e,null))[_0x853f('0x1b')](function(_0x5c8a82){if(_0x5c8a82){_0xb71bc8=_0x5c8a82;_0x2435c6[_0x853f('0x33')]=_[_0x853f('0x34')](db[_0x853f('0x52')][_0x853f('0x32')]);_0x2435c6[_0x853f('0x35')]=_[_0x853f('0x34')](_0x5cb737[_0x853f('0x35')]);_0x2435c6[_0x853f('0x3c')]=_[_0x853f('0x37')](_0x2435c6['model'],_0x2435c6[_0x853f('0x35')]);_0x5ef8d5[_0x853f('0x36')]=_[_0x853f('0x37')](_0x2435c6['model'],qs[_0x853f('0x38')](_0x5cb737[_0x853f('0x35')]['fields']));_0x5ef8d5[_0x853f('0x36')]=_0x5ef8d5[_0x853f('0x36')]['length']?_0x5ef8d5[_0x853f('0x36')]:_0x2435c6[_0x853f('0x33')];_0x5ef8d5[_0x853f('0x53')]=qs['sort'](_0x5cb737[_0x853f('0x35')][_0x853f('0x3a')]);_0x5ef8d5[_0x853f('0x3b')]=qs[_0x853f('0x3c')](_['pick'](_0x5cb737[_0x853f('0x35')],_0x2435c6[_0x853f('0x3c')]));if(_0x5cb737['query'][_0x853f('0x43')]){_0x5ef8d5['where']=_[_0x853f('0x3e')](_0x5ef8d5[_0x853f('0x3b')],{'$or':_[_0x853f('0x3f')](_0x5ef8d5[_0x853f('0x36')],function(_0x5a2af2){var _0x1c3517={};_0x1c3517[_0x5a2af2]={'$like':'%'+_0x5cb737[_0x853f('0x35')][_0x853f('0x43')]+'%'};return _0x1c3517;})});}_0x5ef8d5=_['merge']({},_0x5ef8d5,_0x5cb737[_0x853f('0x4c')]);return _0xb71bc8[_0x853f('0x54')](_0x5ef8d5);}})[_0x853f('0x1b')](function(_0x114791){if(_0x114791){_0x394336=_0x114791[_0x853f('0x4b')];if(!_0x5cb737[_0x853f('0x35')][_0x853f('0x55')](_0x853f('0x39'))){_0x5ef8d5[_0x853f('0x29')]=qs[_0x853f('0x29')](_0x5cb737[_0x853f('0x35')][_0x853f('0x29')]);_0x5ef8d5['offset']=qs[_0x853f('0x28')](_0x5cb737[_0x853f('0x35')][_0x853f('0x28')]);}return _0xb71bc8[_0x853f('0x54')](_0x5ef8d5);}})['then'](function(_0x35ed7a){if(_0x35ed7a){return _0x35ed7a?{'count':_0x394336,'rows':_0x35ed7a}:null;}})['then'](respondWithResult(_0x3be85e,null))[_0x853f('0x50')](handleError(_0x3be85e,null));};exports[_0x853f('0x56')]=function(_0x547a72,_0xdef35f,_0x5929b9){if(_0x547a72[_0x853f('0x4f')]['id']){delete _0x547a72[_0x853f('0x4f')]['id'];}return db[_0x853f('0x4a')][_0x853f('0x51')]({'where':{'id':_0x547a72[_0x853f('0x49')]['id']}})[_0x853f('0x1b')](handleEntityNotFound(_0xdef35f,null))[_0x853f('0x1b')](function(_0x3aa009){if(_0x3aa009){_0x547a72[_0x853f('0x4f')][_0x853f('0x57')]=_0x3aa009['id'];_0x547a72[_0x853f('0x4f')][_0x853f('0x58')]=integrations[_0x853f('0x59')](_0x547a72['body'][_0x853f('0x5a')],_0x547a72['body']['type']);_0x547a72[_0x853f('0x4f')][_0x853f('0x5b')]=integrations[_0x853f('0x5c')](_0x547a72[_0x853f('0x4f')][_0x853f('0x5a')],_0x547a72[_0x853f('0x4f')][_0x853f('0x40')]);return db[_0x853f('0x52')]['create'](_0x547a72[_0x853f('0x4f')],{'include':[{'model':db[_0x853f('0x5d')],'as':'Subjects'},{'model':db[_0x853f('0x5d')],'as':_0x853f('0x5b')}]});}return null;})[_0x853f('0x1b')](respondWithResult(_0xdef35f,null))[_0x853f('0x50')](handleError(_0xdef35f,null));};exports[_0x853f('0x5e')]=function(_0x4c2077,_0x227e7a,_0x51b7cb){var _0x11dd88=[_0x853f('0x5f'),_0x853f('0x60'),'knowledge',_0x853f('0x61'),_0x853f('0x62'),_0x853f('0x63'),_0x853f('0x64'),_0x853f('0x65'),_0x853f('0x66')];var _0x24af9f=['parent','made_sla',_0x853f('0x67'),_0x853f('0x68'),'upon_reject',_0x853f('0x69'),'child_incidents',_0x853f('0x60'),'approval_history',_0x853f('0x6a'),'resolved_by',_0x853f('0x6b'),_0x853f('0x6c'),_0x853f('0x6d'),'sys_created_on',_0x853f('0x6e'),_0x853f('0x6f'),_0x853f('0x70'),_0x853f('0x71'),_0x853f('0x53'),_0x853f('0x72'),_0x853f('0x73'),_0x853f('0x74'),_0x853f('0x75'),_0x853f('0x76'),_0x853f('0x77'),_0x853f('0x78'),_0x853f('0x79'),_0x853f('0x7a'),_0x853f('0x7b'),_0x853f('0x7c'),_0x853f('0x7d'),_0x853f('0x7e'),'opened_at',_0x853f('0x7f'),_0x853f('0x80'),_0x853f('0x81'),_0x853f('0x82'),'resolved_at','caller_id',_0x853f('0x83'),_0x853f('0x61'),_0x853f('0x84'),_0x853f('0x85'),_0x853f('0x62'),_0x853f('0x86'),'delivery_task',_0x853f('0x87'),_0x853f('0x88'),_0x853f('0x89'),_0x853f('0x8a'),_0x853f('0x8b'),_0x853f('0x8c'),_0x853f('0x63'),'sys_class_name','close_notes','closed_by',_0x853f('0x8d'),_0x853f('0x8e'),'sys_id',_0x853f('0x8f'),_0x853f('0x90'),_0x853f('0x64'),_0x853f('0x91'),_0x853f('0x92'),_0x853f('0x93'),_0x853f('0x94'),'activity_due',_0x853f('0x95'),_0x853f('0x65'),_0x853f('0x96'),_0x853f('0x97'),_0x853f('0x98'),_0x853f('0x99'),_0x853f('0x9a'),_0x853f('0x9b'),_0x853f('0x9c'),'sys_tags',_0x853f('0x9d'),_0x853f('0x9e'),_0x853f('0x9f'),'location','category'];var _0x55010a='';var _0x3321d7='';var _0x135696=[];var _0x28e421='';var _0x2acb47='';var _0x254a67=[];var _0xe02b2e='';var _0x9015f5='';var _0x4c7ad6={};var _0xb8975e='';return db['ServicenowAccount']['findOne']({'where':{'id':_0x4c2077[_0x853f('0x49')]['id']},'attributes':['id',_0x853f('0xa0'),'password','email',_0x853f('0xa1'),_0x853f('0xa2')]})[_0x853f('0x1b')](handleEntityNotFound(_0x227e7a,null))[_0x853f('0x1b')](function(_0x4e79fc){if(_0x4e79fc){_0xb8975e=_0x4e79fc[_0x853f('0xa1')];var _0x33266f=_0xb8975e[_0x853f('0xa3')](-0x1);if(_0x33266f==='/'){_0xb8975e=_0xb8975e['substring'](0x0,_0xb8975e[_0x853f('0xa4')](_0x33266f));}_0x9015f5=util[_0x853f('0xa5')](_0x853f('0xa6'),_0xb8975e);_0xe02b2e=util[_0x853f('0xa5')](_0x853f('0xa7'),_0xb8975e);_0x4c7ad6={'user':_0x4e79fc[_0x853f('0xa0')],'pass':_0x4e79fc[_0x853f('0xa8')]};var _0x2d2373={'method':'GET','uri':_0x9015f5+'incident?sysparm_display_value=all','auth':_0x4c7ad6,'json':!![]};return rp(_0x2d2373);}})[_0x853f('0x1b')](function(_0x25ec16){if(_0x25ec16[_0x853f('0x22')]['length']>0x0){_0x55010a=_0x25ec16[_0x853f('0x22')];}console[_0x853f('0xa9')]('incident\x20table\x20objects',_0x55010a);_0x254a67=[];_0x3321d7=Object[_0x853f('0xaa')]([],_0x55010a);_['remove'](_0x3321d7,function(_0x506390){return!_0x11dd88['includes'](_0x506390['name']);});_0x3321d7[_0x853f('0xab')](function(_0x34690b){var _0x4bd9cc=createFieldObject(_0xe02b2e,_0x4c7ad6,_0x34690b[_0x853f('0xac')],_0x34690b[_0x853f('0x30')],_0x34690b[_0x853f('0xad')],![]);_0x254a67[_0x853f('0xae')](_0x4bd9cc);});return Promise['all'](_0x254a67);})[_0x853f('0x1b')](function(_0x1e27b3){_0x135696=_0x1e27b3;_0x28e421=Object[_0x853f('0xaa')]([],_0x55010a);console[_0x853f('0xa9')](_0x853f('0xaf'),_0x55010a);_[_0x853f('0xb0')](_0x28e421,function(_0x4f9620){return _0x24af9f[_0x853f('0xb1')](_0x4f9620[_0x853f('0x30')]);});console[_0x853f('0xa9')](_0x853f('0xb2'),_0x28e421);_0x254a67=[];_0x28e421[_0x853f('0xab')](function(_0x14e3c7){var _0x150ea1=createFieldObject(_0xe02b2e,_0x4c7ad6,_0x14e3c7['internalType'],_0x14e3c7[_0x853f('0x30')],_0x14e3c7[_0x853f('0xad')],!![]);_0x254a67['push'](_0x150ea1);});return Promise[_0x853f('0xb3')](_0x254a67);})[_0x853f('0x1b')](function(_0x5441d6){_0x2acb47=_0x5441d6;var _0x116af3=_0x135696[_0x853f('0xb4')](_0x2acb47);return{'count':_0x116af3['length'],'rows':_0x116af3};})[_0x853f('0x1b')](respondWithResult(_0x227e7a,null))[_0x853f('0x50')](function(_0x585c1e){console[_0x853f('0xa9')](_0x853f('0xb5')+_0x585c1e);var _0x2400f9=_0x4c2077[_0x853f('0x35')][_0x853f('0x1a')]?0x1f4:_0x585c1e[_0x853f('0xb6')]||0x1f4;logger[_0x853f('0x1f')](_0x585c1e[_0x853f('0x2f')]);delete _0x585c1e['name'];if(_0x2400f9===0x191){_0x2400f9=0x190;}_0x227e7a['status'](_0x2400f9)[_0x853f('0x31')](_0x4c2077['query'][_0x853f('0x1a')]?{'message':'Wrong\x20credentials','statusCode':_0x585c1e[_0x853f('0xb6')]}:_0x585c1e);});};function createFieldObject(_0x2e9ef9,_0x17802d,_0x2f8747,_0x235a0d,_0x11bf58,_0x5968f0){return new Promise(function(_0xf25736,_0x312d80){var _0x42ca2d={'id':_0x235a0d,'name':_0x11bf58,'custom':_0x5968f0};if(_0x2f8747===_0x853f('0xb7')){_0x42ca2d[_0x853f('0x4c')]=[{'name':_0x853f('0xb8'),'value':_0x853f('0xb9')},{'name':_0x853f('0xba'),'value':_0x853f('0xbb')}];_0xf25736(_0x42ca2d);}else{var _0x15e4b9={'method':_0x853f('0xbc'),'uri':_0x2e9ef9+_0x853f('0xbd')+_0x235a0d,'auth':_0x17802d,'json':!![]};return rp(_0x15e4b9)['then'](function(_0xc11da9){var _0x4f9cc3=[];if(_0xc11da9[_0x853f('0x22')][_0x853f('0x4b')]>0x0){_0xc11da9[_0x853f('0x22')][_0x853f('0xab')](function(_0x558796){if(_0x558796['inactive']===_0x853f('0xbb')){var _0x1f21e9={'name':_0x558796[_0x853f('0xad')],'value':_0x558796[_0x853f('0xbe')]};_0x4f9cc3[_0x853f('0xae')](_0x1f21e9);}});}_0x42ca2d[_0x853f('0x4c')]=_0x4f9cc3;if(_0x42ca2d[_0x853f('0x4c')][_0x853f('0x4b')]>0x0){_0xf25736(_0x42ca2d);}else{if(_0x5968f0==![]){_0xf25736();}else{_0xf25736(_0x42ca2d);}}});}});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.model.js b/server/api/intServicenowAccount/intServicenowAccount.model.js index c84f1ff..5059637 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 _0x5fd1=['lodash','../../config/logger','api','moment','path','rimraf','../../config/environment','../../components/integrations/configuration','exports','define','int_servicenow_accounts'];(function(_0x1b6186,_0x1ec7f2){var _0x186121=function(_0x1748a8){while(--_0x1748a8){_0x1b6186['push'](_0x1b6186['shift']());}};_0x186121(++_0x1ec7f2);}(_0x5fd1,0x155));var _0x15fd=function(_0x33a432,_0x1acced){_0x33a432=_0x33a432-0x0;var _0x45bd47=_0x5fd1[_0x33a432];return _0x45bd47;};'use strict';var _=require(_0x15fd('0x0'));var util=require('util');var logger=require(_0x15fd('0x1'))(_0x15fd('0x2'));var moment=require(_0x15fd('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x15fd('0x4'));var rimraf=require(_0x15fd('0x5'));var config=require(_0x15fd('0x6'));var attributes=require('./intServicenowAccount.attributes');var integrations=require(_0x15fd('0x7'));module[_0x15fd('0x8')]=function(_0x18450c,_0x2e88bf){return _0x18450c[_0x15fd('0x9')]('ServicenowAccount',attributes,{'tableName':_0x15fd('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6b8f=['../../components/integrations/configuration','define','ServicenowAccount','util','api','request-promise','path','../../config/environment','./intServicenowAccount.attributes'];(function(_0x56bf30,_0x284c8b){var _0xaea08b=function(_0xf9d135){while(--_0xf9d135){_0x56bf30['push'](_0x56bf30['shift']());}};_0xaea08b(++_0x284c8b);}(_0x6b8f,0x1bc));var _0xf6b8=function(_0x5d3fb3,_0x326479){_0x5d3fb3=_0x5d3fb3-0x0;var _0x35cb2d=_0x6b8f[_0x5d3fb3];return _0x35cb2d;};'use strict';var _=require('lodash');var util=require(_0xf6b8('0x0'));var logger=require('../../config/logger')(_0xf6b8('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xf6b8('0x2'));var fs=require('fs');var path=require(_0xf6b8('0x3'));var rimraf=require('rimraf');var config=require(_0xf6b8('0x4'));var attributes=require(_0xf6b8('0x5'));var integrations=require(_0xf6b8('0x6'));module['exports']=function(_0x2d035e,_0x79c66d){return _0x2d035e[_0xf6b8('0x7')](_0xf6b8('0x8'),attributes,{'tableName':'int_servicenow_accounts','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 193fd91..48429a5 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 _0xddac=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','info','ServicenowAccount,\x20%s,\x20%s','request\x20sent','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetServicenowAccount','ServicenowAccount','findAll','options','raw','limit','model','map','include','attributes','then','find','where','ShowServicenowAccount','moment','bluebird'];(function(_0x49ca18,_0x5e6d05){var _0x145d54=function(_0x30b9be){while(--_0x30b9be){_0x49ca18['push'](_0x49ca18['shift']());}};_0x145d54(++_0x5e6d05);}(_0xddac,0x116));var _0xcdda=function(_0x1486fd,_0x340e93){_0x1486fd=_0x1486fd-0x0;var _0x952481=_0xddac[_0x1486fd];return _0x952481;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xcdda('0x0'));var BPromise=require(_0xcdda('0x1'));var rs=require(_0xcdda('0x2'));var fs=require('fs');var Redis=require(_0xcdda('0x3'));var db=require(_0xcdda('0x4'))['db'];var utils=require(_0xcdda('0x5'));var logger=require(_0xcdda('0x6'))(_0xcdda('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xcdda('0x8')][_0xcdda('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x306f99,_0x332e46,_0xd2b624){return new BPromise(function(_0x28a8eb,_0xcdca8c){return client[_0xcdda('0xa')](_0x306f99,_0xd2b624)['then'](function(_0x2ca683){logger[_0xcdda('0xb')](_0xcdda('0xc'),_0x332e46,_0xcdda('0xd'));logger[_0xcdda('0xe')](_0xcdda('0xf'),_0x332e46,_0xcdda('0xd'),JSON[_0xcdda('0x10')](_0x2ca683));if(_0x2ca683[_0xcdda('0x11')]){if(_0x2ca683[_0xcdda('0x11')][_0xcdda('0x12')]===0x1f4){logger[_0xcdda('0x11')](_0xcdda('0xc'),_0x332e46,_0x2ca683[_0xcdda('0x11')][_0xcdda('0x13')]);return _0xcdca8c(_0x2ca683[_0xcdda('0x11')]['message']);}logger[_0xcdda('0x11')](_0xcdda('0xc'),_0x332e46,_0x2ca683[_0xcdda('0x11')][_0xcdda('0x13')]);return _0x28a8eb(_0x2ca683['error']['message']);}else{logger[_0xcdda('0xb')]('ServicenowAccount,\x20%s,\x20%s',_0x332e46,_0xcdda('0xd'));_0x28a8eb(_0x2ca683['result']['message']);}})[_0xcdda('0x14')](function(_0xe7ac44){logger[_0xcdda('0x11')](_0xcdda('0xc'),_0x332e46,_0xe7ac44);_0xcdca8c(_0xe7ac44);});});}exports[_0xcdda('0x15')]=function(_0x1669d6){var _0xb75896=this;return new Promise(function(_0x21c21f,_0x4bb439){return db[_0xcdda('0x16')][_0xcdda('0x17')]({'raw':_0x1669d6[_0xcdda('0x18')]?_0x1669d6['options'][_0xcdda('0x19')]===undefined?!![]:![]:!![],'where':_0x1669d6['options']?_0x1669d6['options']['where']||null:null,'attributes':_0x1669d6[_0xcdda('0x18')]?_0x1669d6[_0xcdda('0x18')]['attributes']||null:null,'limit':_0x1669d6['options']?_0x1669d6[_0xcdda('0x18')][_0xcdda('0x1a')]||null:null,'include':_0x1669d6[_0xcdda('0x18')]?_0x1669d6[_0xcdda('0x18')]['include']?_['map'](_0x1669d6[_0xcdda('0x18')]['include'],function(_0x1b9bdf){return{'model':db[_0x1b9bdf[_0xcdda('0x1b')]],'as':_0x1b9bdf['as'],'attributes':_0x1b9bdf['attributes'],'include':_0x1b9bdf['include']?_[_0xcdda('0x1c')](_0x1b9bdf[_0xcdda('0x1d')],function(_0x2c1a59){return{'model':db[_0x2c1a59[_0xcdda('0x1b')]],'as':_0x2c1a59['as'],'attributes':_0x2c1a59['attributes'],'include':_0x2c1a59[_0xcdda('0x1d')]?_[_0xcdda('0x1c')](_0x2c1a59[_0xcdda('0x1d')],function(_0x18686c){return{'model':db[_0x18686c[_0xcdda('0x1b')]],'as':_0x18686c['as'],'attributes':_0x18686c[_0xcdda('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xcdda('0x1f')](function(_0x372f4b){logger['info'](_0xcdda('0x15'),_0x1669d6);logger[_0xcdda('0xe')](_0xcdda('0x15'),_0x1669d6,JSON['stringify'](_0x372f4b));_0x21c21f(_0x372f4b);})[_0xcdda('0x14')](function(_0x5f190a){logger[_0xcdda('0x11')](_0xcdda('0x15'),_0x5f190a[_0xcdda('0x13')],_0x1669d6);_0x4bb439(_0xb75896['error'](0x1f4,_0x5f190a['message']));});});};exports['ShowServicenowAccount']=function(_0x412798){var _0x333a33=this;return new Promise(function(_0x479a71,_0xdd37e){return db['ServicenowAccount'][_0xcdda('0x20')]({'raw':_0x412798[_0xcdda('0x18')]?_0x412798[_0xcdda('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x412798[_0xcdda('0x18')]?_0x412798[_0xcdda('0x18')][_0xcdda('0x21')]||null:null,'attributes':_0x412798['options']?_0x412798[_0xcdda('0x18')]['attributes']||null:null,'include':_0x412798[_0xcdda('0x18')]?_0x412798[_0xcdda('0x18')][_0xcdda('0x1d')]?_[_0xcdda('0x1c')](_0x412798['options']['include'],function(_0x33b631){return{'model':db[_0x33b631[_0xcdda('0x1b')]],'as':_0x33b631['as'],'attributes':_0x33b631[_0xcdda('0x1e')],'include':_0x33b631[_0xcdda('0x1d')]?_['map'](_0x33b631[_0xcdda('0x1d')],function(_0x1a6816){return{'model':db[_0x1a6816[_0xcdda('0x1b')]],'as':_0x1a6816['as'],'attributes':_0x1a6816['attributes'],'include':_0x1a6816[_0xcdda('0x1d')]?_[_0xcdda('0x1c')](_0x1a6816['include'],function(_0x156e52){return{'model':db[_0x156e52['model']],'as':_0x156e52['as'],'attributes':_0x156e52[_0xcdda('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xcdda('0x1f')](function(_0x19840d){logger[_0xcdda('0xb')]('ShowServicenowAccount',_0x412798);logger[_0xcdda('0xe')](_0xcdda('0x22'),_0x412798,JSON[_0xcdda('0x10')](_0x19840d));_0x479a71(_0x19840d);})['catch'](function(_0x2e7be4){logger[_0xcdda('0x11')](_0xcdda('0x22'),_0x2e7be4['message'],_0x412798);_0xdd37e(_0x333a33[_0xcdda('0x11')](0x1f4,_0x2e7be4[_0xcdda('0x13')]));});});}; \ No newline at end of file +var _0x839d=['info','ServicenowAccount,\x20%s,\x20%s','request\x20sent','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetServicenowAccount','ServicenowAccount','findAll','options','where','attributes','limit','include','map','model','catch','ShowServicenowAccount','find','raw','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x4b2f69,_0x1757a1){var _0x6d8011=function(_0x2c1bc9){while(--_0x2c1bc9){_0x4b2f69['push'](_0x4b2f69['shift']());}};_0x6d8011(++_0x1757a1);}(_0x839d,0x19e));var _0xd839=function(_0x5de0bf,_0x2d05f1){_0x5de0bf=_0x5de0bf-0x0;var _0x3d21e6=_0x839d[_0x5de0bf];return _0x3d21e6;};'use strict';var _=require(_0xd839('0x0'));var util=require(_0xd839('0x1'));var moment=require(_0xd839('0x2'));var BPromise=require(_0xd839('0x3'));var rs=require(_0xd839('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd839('0x5'))['db'];var utils=require(_0xd839('0x6'));var logger=require(_0xd839('0x7'))(_0xd839('0x8'));var config=require(_0xd839('0x9'));var jayson=require(_0xd839('0xa'));var client=jayson[_0xd839('0xb')][_0xd839('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x18c689,_0x3f5fdd,_0x26116b){return new BPromise(function(_0x476219,_0x8587d){return client[_0xd839('0xd')](_0x18c689,_0x26116b)[_0xd839('0xe')](function(_0x3a333f){logger[_0xd839('0xf')](_0xd839('0x10'),_0x3f5fdd,_0xd839('0x11'));logger[_0xd839('0x12')](_0xd839('0x13'),_0x3f5fdd,'request\x20sent',JSON[_0xd839('0x14')](_0x3a333f));if(_0x3a333f['error']){if(_0x3a333f[_0xd839('0x15')][_0xd839('0x16')]===0x1f4){logger[_0xd839('0x15')]('ServicenowAccount,\x20%s,\x20%s',_0x3f5fdd,_0x3a333f[_0xd839('0x15')][_0xd839('0x17')]);return _0x8587d(_0x3a333f[_0xd839('0x15')]['message']);}logger['error']('ServicenowAccount,\x20%s,\x20%s',_0x3f5fdd,_0x3a333f[_0xd839('0x15')][_0xd839('0x17')]);return _0x476219(_0x3a333f[_0xd839('0x15')]['message']);}else{logger[_0xd839('0xf')](_0xd839('0x10'),_0x3f5fdd,_0xd839('0x11'));_0x476219(_0x3a333f[_0xd839('0x18')][_0xd839('0x17')]);}})['catch'](function(_0x1a0a65){logger['error'](_0xd839('0x10'),_0x3f5fdd,_0x1a0a65);_0x8587d(_0x1a0a65);});});}exports[_0xd839('0x19')]=function(_0x5bf6b3){var _0x44e23b=this;return new Promise(function(_0x1f3b68,_0x388cb1){return db[_0xd839('0x1a')][_0xd839('0x1b')]({'raw':_0x5bf6b3[_0xd839('0x1c')]?_0x5bf6b3[_0xd839('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x5bf6b3[_0xd839('0x1c')]?_0x5bf6b3['options'][_0xd839('0x1d')]||null:null,'attributes':_0x5bf6b3[_0xd839('0x1c')]?_0x5bf6b3[_0xd839('0x1c')][_0xd839('0x1e')]||null:null,'limit':_0x5bf6b3[_0xd839('0x1c')]?_0x5bf6b3['options'][_0xd839('0x1f')]||null:null,'include':_0x5bf6b3[_0xd839('0x1c')]?_0x5bf6b3[_0xd839('0x1c')][_0xd839('0x20')]?_[_0xd839('0x21')](_0x5bf6b3[_0xd839('0x1c')][_0xd839('0x20')],function(_0x537597){return{'model':db[_0x537597[_0xd839('0x22')]],'as':_0x537597['as'],'attributes':_0x537597[_0xd839('0x1e')],'include':_0x537597[_0xd839('0x20')]?_['map'](_0x537597[_0xd839('0x20')],function(_0x40d20d){return{'model':db[_0x40d20d[_0xd839('0x22')]],'as':_0x40d20d['as'],'attributes':_0x40d20d[_0xd839('0x1e')],'include':_0x40d20d['include']?_[_0xd839('0x21')](_0x40d20d[_0xd839('0x20')],function(_0x4e80fe){return{'model':db[_0x4e80fe[_0xd839('0x22')]],'as':_0x4e80fe['as'],'attributes':_0x4e80fe[_0xd839('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x22e420){logger[_0xd839('0xf')](_0xd839('0x19'),_0x5bf6b3);logger[_0xd839('0x12')]('GetServicenowAccount',_0x5bf6b3,JSON[_0xd839('0x14')](_0x22e420));_0x1f3b68(_0x22e420);})[_0xd839('0x23')](function(_0x5230a0){logger[_0xd839('0x15')](_0xd839('0x19'),_0x5230a0[_0xd839('0x17')],_0x5bf6b3);_0x388cb1(_0x44e23b[_0xd839('0x15')](0x1f4,_0x5230a0['message']));});});};exports[_0xd839('0x24')]=function(_0x186743){var _0x9a1b99=this;return new Promise(function(_0x27f369,_0x2b1246){return db[_0xd839('0x1a')][_0xd839('0x25')]({'raw':_0x186743[_0xd839('0x1c')]?_0x186743[_0xd839('0x1c')][_0xd839('0x26')]===undefined?!![]:![]:!![],'where':_0x186743['options']?_0x186743[_0xd839('0x1c')][_0xd839('0x1d')]||null:null,'attributes':_0x186743[_0xd839('0x1c')]?_0x186743['options'][_0xd839('0x1e')]||null:null,'include':_0x186743[_0xd839('0x1c')]?_0x186743['options'][_0xd839('0x20')]?_['map'](_0x186743[_0xd839('0x1c')][_0xd839('0x20')],function(_0x5c0af8){return{'model':db[_0x5c0af8['model']],'as':_0x5c0af8['as'],'attributes':_0x5c0af8['attributes'],'include':_0x5c0af8[_0xd839('0x20')]?_[_0xd839('0x21')](_0x5c0af8[_0xd839('0x20')],function(_0x570e6c){return{'model':db[_0x570e6c[_0xd839('0x22')]],'as':_0x570e6c['as'],'attributes':_0x570e6c[_0xd839('0x1e')],'include':_0x570e6c[_0xd839('0x20')]?_[_0xd839('0x21')](_0x570e6c[_0xd839('0x20')],function(_0xf3430a){return{'model':db[_0xf3430a[_0xd839('0x22')]],'as':_0xf3430a['as'],'attributes':_0xf3430a[_0xd839('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xd839('0xe')](function(_0x364f81){logger[_0xd839('0xf')]('ShowServicenowAccount',_0x186743);logger[_0xd839('0x12')](_0xd839('0x24'),_0x186743,JSON[_0xd839('0x14')](_0x364f81));_0x27f369(_0x364f81);})[_0xd839('0x23')](function(_0x509114){logger[_0xd839('0x15')]('ShowServicenowAccount',_0x509114[_0xd839('0x17')],_0x186743);_0x2b1246(_0x9a1b99[_0xd839('0x15')](0x1f4,_0x509114[_0xd839('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/index.js b/server/api/intServicenowConfiguration/index.js index c26bbf3..e16dcfd 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 _0xf435=['../../config/environment','./intServicenowConfiguration.controller','get','isAuthenticated','index','show','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put','/:id','update','util','connect-timeout','Router','../../components/auth/service'];(function(_0x3a13d4,_0x3ea9bb){var _0x2cf123=function(_0x352bcc){while(--_0x352bcc){_0x3a13d4['push'](_0x3a13d4['shift']());}};_0x2cf123(++_0x3ea9bb);}(_0xf435,0x88));var _0x5f43=function(_0x295d32,_0x166a6f){_0x295d32=_0x295d32-0x0;var _0x5eaf7c=_0xf435[_0x295d32];return _0x5eaf7c;};'use strict';var multer=require('multer');var util=require(_0x5f43('0x0'));var path=require('path');var timeout=require(_0x5f43('0x1'));var express=require('express');var router=express[_0x5f43('0x2')]();var auth=require(_0x5f43('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x5f43('0x4'));var controller=require(_0x5f43('0x5'));router[_0x5f43('0x6')]('/',auth[_0x5f43('0x7')](),controller[_0x5f43('0x8')]);router[_0x5f43('0x6')]('/:id',auth[_0x5f43('0x7')](),controller[_0x5f43('0x9')]);router[_0x5f43('0x6')](_0x5f43('0xa'),auth[_0x5f43('0x7')](),controller['getFields']);router[_0x5f43('0x6')](_0x5f43('0xb'),auth[_0x5f43('0x7')](),controller[_0x5f43('0xc')]);router['get'](_0x5f43('0xd'),auth[_0x5f43('0x7')](),controller[_0x5f43('0xe')]);router[_0x5f43('0xf')]('/',auth['isAuthenticated'](),controller[_0x5f43('0x10')]);router[_0x5f43('0x11')](_0x5f43('0x12'),auth['isAuthenticated'](),controller[_0x5f43('0x13')]);router['delete'](_0x5f43('0x12'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xa440=['multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','create','put','update','delete','destroy'];(function(_0x41acfd,_0xcfa795){var _0x3f1e79=function(_0x3e6db9){while(--_0x3e6db9){_0x41acfd['push'](_0x41acfd['shift']());}};_0x3f1e79(++_0xcfa795);}(_0xa440,0xaf));var _0x0a44=function(_0x2112d4,_0x3c863c){_0x2112d4=_0x2112d4-0x0;var _0x434972=_0xa440[_0x2112d4];return _0x434972;};'use strict';var multer=require(_0x0a44('0x0'));var util=require(_0x0a44('0x1'));var path=require(_0x0a44('0x2'));var timeout=require(_0x0a44('0x3'));var express=require(_0x0a44('0x4'));var router=express[_0x0a44('0x5')]();var auth=require(_0x0a44('0x6'));var interaction=require(_0x0a44('0x7'));var config=require(_0x0a44('0x8'));var controller=require(_0x0a44('0x9'));router[_0x0a44('0xa')]('/',auth[_0x0a44('0xb')](),controller[_0x0a44('0xc')]);router[_0x0a44('0xa')](_0x0a44('0xd'),auth[_0x0a44('0xb')](),controller[_0x0a44('0xe')]);router[_0x0a44('0xa')](_0x0a44('0xf'),auth[_0x0a44('0xb')](),controller[_0x0a44('0x10')]);router[_0x0a44('0xa')](_0x0a44('0x11'),auth[_0x0a44('0xb')](),controller[_0x0a44('0x12')]);router[_0x0a44('0xa')](_0x0a44('0x13'),auth[_0x0a44('0xb')](),controller['getDescriptions']);router['post']('/',auth[_0x0a44('0xb')](),controller[_0x0a44('0x14')]);router[_0x0a44('0x15')]('/:id',auth[_0x0a44('0xb')](),controller[_0x0a44('0x16')]);router[_0x0a44('0x17')](_0x0a44('0xd'),auth[_0x0a44('0xb')](),controller[_0x0a44('0x18')]);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 165352d..4dbd41c 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 _0xff95=['STRING','sequelize'];(function(_0x37ce5d,_0x36ce06){var _0x4bd08a=function(_0x1732c0){while(--_0x1732c0){_0x37ce5d['push'](_0x37ce5d['shift']());}};_0x4bd08a(++_0x36ce06);}(_0xff95,0x91));var _0x5ff9=function(_0x14da8d,_0x2ac855){_0x14da8d=_0x14da8d-0x0;var _0x3da2de=_0xff95[_0x14da8d];return _0x3da2de;};'use strict';var Sequelize=require(_0x5ff9('0x0'));module['exports']={'name':{'type':Sequelize[_0x5ff9('0x1')]},'description':{'type':Sequelize[_0x5ff9('0x1')]}}; \ No newline at end of file +var _0xd23a=['exports','STRING'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xd23a,0xf8));var _0xad23=function(_0xef30d,_0x87cad8){_0xef30d=_0xef30d-0x0;var _0x191779=_0xd23a[_0xef30d];return _0x191779;};'use strict';var Sequelize=require('sequelize');module[_0xad23('0x0')]={'name':{'type':Sequelize[_0xad23('0x1')]},'description':{'type':Sequelize[_0xad23('0x1')]}}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js index f82fdeb..0fa7148 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 _0x55d4=['rows','params','rawAttributes','includeAll','create','body','find','destroy','getFields','findOne','nolimit','getSubjects','ServicenowField','hasOwnProperty','getDescriptions','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','end','count','offset','limit','set','Content-Range','json','save','update','stack','name','index','ServicenowConfiguration','model','keys','filters','intersection','query','attributes','fields','length','order','sort','where','pick','filter','merge','map','type','VIRTUAL','options','include','findAll'];(function(_0x53169c,_0x127c27){var _0x3efecf=function(_0x33c97e){while(--_0x33c97e){_0x53169c['push'](_0x53169c['shift']());}};_0x3efecf(++_0x127c27);}(_0x55d4,0x117));var _0x455d=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x55d4[_0x2c91e9];return _0x13f0ff;};'use strict';var pdf=require(_0x455d('0x0'));var emlformat=require(_0x455d('0x1'));var rimraf=require(_0x455d('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x455d('0x3'));var rp=require(_0x455d('0x4'));var moment=require('moment');var BPromise=require(_0x455d('0x5'));var Mustache=require(_0x455d('0x6'));var util=require(_0x455d('0x7'));var path=require(_0x455d('0x8'));var sox=require('sox');var csv=require(_0x455d('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x455d('0xa'));var squel=require(_0x455d('0xb'));var crypto=require(_0x455d('0xc'));var jsforce=require(_0x455d('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x455d('0x9'));var querystring=require(_0x455d('0xe'));var Papa=require(_0x455d('0xf'));var Redis=require(_0x455d('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x455d('0x11'));var as=require(_0x455d('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x455d('0x13'));var utils=require(_0x455d('0x14'));var config=require(_0x455d('0x15'));var db=require(_0x455d('0x16'))['db'];var jayson=require('jayson/promise');var client=jayson['client'][_0x455d('0x17')]({'port':0x232a});function checkPasswordPattern(_0x263608,_0x6df889,_0x2881f5){if(_0x2881f5){var _0x2ae533=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2ae533[_0x455d('0x18')](_0x6df889)){return _0x263608;}else{throw new Error(_0x455d('0x19'));}}else{return _0x263608;}}function respondWithRpcPromise(_0x88e0c,_0x45fbca,_0x2d3ba3,_0x5b6e20){return new BPromise(function(_0x1c8ed6,_0x3e9047){var _0x3ad02e=_0x5b6e20||client;return _0x3ad02e[_0x455d('0x1a')](_0x88e0c,_0x2d3ba3)[_0x455d('0x1b')](function(_0x119837){logger[_0x455d('0x1c')](_0x455d('0x1d'),_0x45fbca,_0x455d('0x1e'));logger[_0x455d('0x1f')](_0x455d('0x20'),_0x45fbca,'request\x20sent',JSON['stringify'](_0x119837));if(_0x119837[_0x455d('0x21')]){if(_0x119837[_0x455d('0x21')][_0x455d('0x22')]===0x1f4){logger[_0x455d('0x21')](_0x455d('0x1d'),_0x45fbca,_0x119837[_0x455d('0x21')][_0x455d('0x23')]);return _0x3e9047(_0x119837[_0x455d('0x21')]['message']);}logger[_0x455d('0x21')](_0x455d('0x1d'),_0x45fbca,_0x119837['error'][_0x455d('0x23')]);return _0x1c8ed6(_0x119837[_0x455d('0x21')]['message']);}else{logger[_0x455d('0x1c')](_0x455d('0x1d'),_0x45fbca,'request\x20sent');_0x1c8ed6(_0x119837[_0x455d('0x24')][_0x455d('0x23')]);}})[_0x455d('0x25')](function(_0x7da315){logger[_0x455d('0x21')](_0x455d('0x1d'),_0x45fbca,_0x7da315);_0x3e9047(_0x7da315);});});}function respondWithStatusCode(_0x583933,_0x36866d){_0x36866d=_0x36866d||0xcc;return function(_0x899114){if(_0x899114){return _0x583933[_0x455d('0x26')](_0x36866d);}return _0x583933[_0x455d('0x27')](_0x36866d)[_0x455d('0x28')]();};}function respondWithResult(_0xa48a43,_0x32a304){_0x32a304=_0x32a304||0xc8;return function(_0x2cbbc1){if(_0x2cbbc1){return _0xa48a43[_0x455d('0x27')](_0x32a304)['json'](_0x2cbbc1);}};}function respondWithFilteredResult(_0x3fa6dc,_0x182e82){return function(_0x13d704){if(_0x13d704){var _0x3e62bb=_0x13d704[_0x455d('0x29')],_0x42cb97=_0x182e82[_0x455d('0x2a')],_0x27181c=_0x182e82['offset']+_0x182e82[_0x455d('0x2b')],_0x54483c;if(_0x27181c>=_0x3e62bb){_0x27181c=_0x3e62bb;_0x54483c=0xc8;}else{_0x54483c=0xce;}_0x3fa6dc[_0x455d('0x27')](_0x54483c);return _0x3fa6dc[_0x455d('0x2c')](_0x455d('0x2d'),_0x42cb97+'-'+_0x27181c+'/'+_0x3e62bb)[_0x455d('0x2e')](_0x13d704);}return null;};}function patchUpdates(_0x5e4f18){return function(_0x49bcc3){try{jsonpatch['apply'](_0x49bcc3,_0x5e4f18,!![]);}catch(_0x1dbfdf){return BPromise['reject'](_0x1dbfdf);}return _0x49bcc3[_0x455d('0x2f')]();};}function saveUpdates(_0x1e2e2b,_0x4e0833){return function(_0x48f13c){if(_0x48f13c){return _0x48f13c[_0x455d('0x30')](_0x1e2e2b)['then'](function(_0x3f6b72){return _0x3f6b72;});}return null;};}function removeEntity(_0x477a27,_0x1ce94f){return function(_0x2b7122){if(_0x2b7122){return _0x2b7122['destroy']()[_0x455d('0x1b')](function(){_0x477a27[_0x455d('0x27')](0xcc)[_0x455d('0x28')]();});}};}function handleEntityNotFound(_0x3e5bf1,_0x12a8b9){return function(_0x1a7d37){if(!_0x1a7d37){_0x3e5bf1[_0x455d('0x26')](0x194);}return _0x1a7d37;};}function handleError(_0x362db4,_0x5cbbc6){_0x5cbbc6=_0x5cbbc6||0x1f4;return function(_0x355685){logger[_0x455d('0x21')](_0x355685[_0x455d('0x31')]);if(_0x355685[_0x455d('0x32')]){delete _0x355685[_0x455d('0x32')];}_0x362db4[_0x455d('0x27')](_0x5cbbc6)['send'](_0x355685);};}exports[_0x455d('0x33')]=function(_0x45a305,_0x18e295){var _0x1f0904={},_0x8f3551={},_0x5bd589={'count':0x0,'rows':[]};var _0x575dae=db[_0x455d('0x34')]['rawAttributes'];_0x8f3551[_0x455d('0x35')]=_[_0x455d('0x36')](_0x575dae);_0x8f3551['query']=_[_0x455d('0x36')](_0x45a305['query']);_0x8f3551[_0x455d('0x37')]=_[_0x455d('0x38')](_0x8f3551[_0x455d('0x35')],_0x8f3551[_0x455d('0x39')]);_0x1f0904[_0x455d('0x3a')]=_[_0x455d('0x38')](_0x8f3551[_0x455d('0x35')],qs[_0x455d('0x3b')](_0x45a305[_0x455d('0x39')][_0x455d('0x3b')]));_0x1f0904[_0x455d('0x3a')]=_0x1f0904['attributes'][_0x455d('0x3c')]?_0x1f0904[_0x455d('0x3a')]:_0x8f3551[_0x455d('0x35')];if(!_0x45a305[_0x455d('0x39')]['hasOwnProperty']('nolimit')){_0x1f0904[_0x455d('0x2b')]=qs[_0x455d('0x2b')](_0x45a305[_0x455d('0x39')]['limit']);_0x1f0904[_0x455d('0x2a')]=qs[_0x455d('0x2a')](_0x45a305[_0x455d('0x39')][_0x455d('0x2a')]);}_0x1f0904[_0x455d('0x3d')]=qs['sort'](_0x45a305[_0x455d('0x39')][_0x455d('0x3e')]);_0x1f0904[_0x455d('0x3f')]=qs['filters'](_[_0x455d('0x40')](_0x45a305[_0x455d('0x39')],_0x8f3551['filters']));if(_0x45a305[_0x455d('0x39')][_0x455d('0x41')]){_0x1f0904['where']=_[_0x455d('0x42')](_0x1f0904[_0x455d('0x3f')],{'$or':_[_0x455d('0x43')](_0x575dae,function(_0xb0d9f7){if(_0xb0d9f7[_0x455d('0x44')]['key']!==_0x455d('0x45')){var _0x5e0f01={};_0x5e0f01[_0xb0d9f7['field']]={'$like':'%'+_0x45a305['query'][_0x455d('0x41')]+'%'};return _0x5e0f01;}})});}_0x1f0904=_[_0x455d('0x42')]({},_0x1f0904,_0x45a305[_0x455d('0x46')]);var _0x579ea4={'where':_0x1f0904[_0x455d('0x3f')]};return db[_0x455d('0x34')][_0x455d('0x29')](_0x579ea4)['then'](function(_0xd6b46e){_0x5bd589[_0x455d('0x29')]=_0xd6b46e;if(_0x45a305['query']['includeAll']){_0x1f0904[_0x455d('0x47')]=[{'all':!![]}];}return db[_0x455d('0x34')][_0x455d('0x48')](_0x1f0904);})[_0x455d('0x1b')](function(_0x41b166){_0x5bd589[_0x455d('0x49')]=_0x41b166;return _0x5bd589;})[_0x455d('0x1b')](respondWithFilteredResult(_0x18e295,_0x1f0904))[_0x455d('0x25')](handleError(_0x18e295,null));};exports['show']=function(_0x3dcdd7,_0x5740bb){var _0x4c9f09={'raw':![],'where':{'id':_0x3dcdd7[_0x455d('0x4a')]['id']}},_0x3cda6b={};_0x3cda6b[_0x455d('0x35')]=_[_0x455d('0x36')](db[_0x455d('0x34')][_0x455d('0x4b')]);_0x3cda6b[_0x455d('0x39')]=_[_0x455d('0x36')](_0x3dcdd7['query']);_0x3cda6b[_0x455d('0x37')]=_[_0x455d('0x38')](_0x3cda6b['model'],_0x3cda6b[_0x455d('0x39')]);_0x4c9f09['attributes']=_['intersection'](_0x3cda6b[_0x455d('0x35')],qs['fields'](_0x3dcdd7[_0x455d('0x39')]['fields']));_0x4c9f09['attributes']=_0x4c9f09['attributes'][_0x455d('0x3c')]?_0x4c9f09[_0x455d('0x3a')]:_0x3cda6b[_0x455d('0x35')];if(_0x3dcdd7[_0x455d('0x39')][_0x455d('0x4c')]){_0x4c9f09['include']=[{'all':!![]}];}_0x4c9f09=_[_0x455d('0x42')]({},_0x4c9f09,_0x3dcdd7['options']);return db['ServicenowConfiguration']['find'](_0x4c9f09)[_0x455d('0x1b')](handleEntityNotFound(_0x5740bb,null))[_0x455d('0x1b')](respondWithResult(_0x5740bb,null))[_0x455d('0x25')](handleError(_0x5740bb,null));};exports[_0x455d('0x4d')]=function(_0x2448cd,_0x430756){return db[_0x455d('0x34')]['create'](_0x2448cd[_0x455d('0x4e')],{})[_0x455d('0x1b')](respondWithResult(_0x430756,0xc9))[_0x455d('0x25')](handleError(_0x430756,null));};exports['update']=function(_0x46b442,_0x2857db){if(_0x46b442['body']['id']){delete _0x46b442[_0x455d('0x4e')]['id'];}return db[_0x455d('0x34')][_0x455d('0x4f')]({'where':{'id':_0x46b442['params']['id']}})[_0x455d('0x1b')](handleEntityNotFound(_0x2857db,null))[_0x455d('0x1b')](saveUpdates(_0x46b442[_0x455d('0x4e')],null))[_0x455d('0x1b')](respondWithResult(_0x2857db,null))[_0x455d('0x25')](handleError(_0x2857db,null));};exports[_0x455d('0x50')]=function(_0x512993,_0x2de553){return db[_0x455d('0x34')][_0x455d('0x4f')]({'where':{'id':_0x512993[_0x455d('0x4a')]['id']}})['then'](handleEntityNotFound(_0x2de553,null))[_0x455d('0x1b')](removeEntity(_0x2de553,null))[_0x455d('0x25')](handleError(_0x2de553,null));};exports[_0x455d('0x51')]=function(_0x2dd4a6,_0x50a319,_0x188e83){var _0x2aa7ef={};var _0x4c0d00={};var _0x3d929f;var _0x126260;return db[_0x455d('0x34')][_0x455d('0x52')]({'where':{'id':_0x2dd4a6[_0x455d('0x4a')]['id']}})['then'](handleEntityNotFound(_0x50a319,null))[_0x455d('0x1b')](function(_0x2dbd89){if(_0x2dbd89){_0x3d929f=_0x2dbd89;_0x4c0d00[_0x455d('0x35')]=_[_0x455d('0x36')](db['ServicenowField']['rawAttributes']);_0x4c0d00['query']=_[_0x455d('0x36')](_0x2dd4a6['query']);_0x4c0d00['filters']=_[_0x455d('0x38')](_0x4c0d00[_0x455d('0x35')],_0x4c0d00[_0x455d('0x39')]);_0x2aa7ef[_0x455d('0x3a')]=_[_0x455d('0x38')](_0x4c0d00[_0x455d('0x35')],qs[_0x455d('0x3b')](_0x2dd4a6[_0x455d('0x39')][_0x455d('0x3b')]));_0x2aa7ef['attributes']=_0x2aa7ef[_0x455d('0x3a')]['length']?_0x2aa7ef['attributes']:_0x4c0d00[_0x455d('0x35')];_0x2aa7ef[_0x455d('0x3d')]=qs[_0x455d('0x3e')](_0x2dd4a6[_0x455d('0x39')][_0x455d('0x3e')]);_0x2aa7ef[_0x455d('0x3f')]=qs[_0x455d('0x37')](_[_0x455d('0x40')](_0x2dd4a6[_0x455d('0x39')],_0x4c0d00['filters']));if(_0x2dd4a6[_0x455d('0x39')][_0x455d('0x41')]){_0x2aa7ef['where']=_['merge'](_0x2aa7ef[_0x455d('0x3f')],{'$or':_['map'](_0x2aa7ef[_0x455d('0x3a')],function(_0x13a6f2){var _0x2dbf3e={};_0x2dbf3e[_0x13a6f2]={'$like':'%'+_0x2dd4a6[_0x455d('0x39')][_0x455d('0x41')]+'%'};return _0x2dbf3e;})});}_0x2aa7ef=_[_0x455d('0x42')]({},_0x2aa7ef,_0x2dd4a6[_0x455d('0x46')]);return _0x3d929f['getFields'](_0x2aa7ef);}})[_0x455d('0x1b')](function(_0x348c98){if(_0x348c98){_0x126260=_0x348c98['length'];if(!_0x2dd4a6[_0x455d('0x39')]['hasOwnProperty'](_0x455d('0x53'))){_0x2aa7ef[_0x455d('0x2b')]=qs[_0x455d('0x2b')](_0x2dd4a6[_0x455d('0x39')][_0x455d('0x2b')]);_0x2aa7ef['offset']=qs[_0x455d('0x2a')](_0x2dd4a6[_0x455d('0x39')][_0x455d('0x2a')]);}return _0x3d929f['getFields'](_0x2aa7ef);}})[_0x455d('0x1b')](function(_0x3468fd){if(_0x3468fd){return _0x3468fd?{'count':_0x126260,'rows':_0x3468fd}:null;}})['then'](respondWithResult(_0x50a319,null))[_0x455d('0x25')](handleError(_0x50a319,null));};exports[_0x455d('0x54')]=function(_0xe01454,_0x44ed55,_0x35ea8a){var _0x28c44d={};var _0x3fab52={};var _0xb1bbed;var _0x406513;return db[_0x455d('0x34')]['findOne']({'where':{'id':_0xe01454[_0x455d('0x4a')]['id']}})[_0x455d('0x1b')](handleEntityNotFound(_0x44ed55,null))[_0x455d('0x1b')](function(_0x3fcd84){if(_0x3fcd84){_0xb1bbed=_0x3fcd84;_0x3fab52[_0x455d('0x35')]=_[_0x455d('0x36')](db[_0x455d('0x55')]['rawAttributes']);_0x3fab52[_0x455d('0x39')]=_[_0x455d('0x36')](_0xe01454[_0x455d('0x39')]);_0x3fab52['filters']=_[_0x455d('0x38')](_0x3fab52[_0x455d('0x35')],_0x3fab52[_0x455d('0x39')]);_0x28c44d[_0x455d('0x3a')]=_[_0x455d('0x38')](_0x3fab52[_0x455d('0x35')],qs['fields'](_0xe01454[_0x455d('0x39')][_0x455d('0x3b')]));_0x28c44d[_0x455d('0x3a')]=_0x28c44d[_0x455d('0x3a')]['length']?_0x28c44d[_0x455d('0x3a')]:_0x3fab52[_0x455d('0x35')];_0x28c44d[_0x455d('0x3d')]=qs[_0x455d('0x3e')](_0xe01454[_0x455d('0x39')][_0x455d('0x3e')]);_0x28c44d['where']=qs[_0x455d('0x37')](_[_0x455d('0x40')](_0xe01454[_0x455d('0x39')],_0x3fab52[_0x455d('0x37')]));if(_0xe01454[_0x455d('0x39')][_0x455d('0x41')]){_0x28c44d['where']=_[_0x455d('0x42')](_0x28c44d[_0x455d('0x3f')],{'$or':_[_0x455d('0x43')](_0x28c44d[_0x455d('0x3a')],function(_0x1edcfc){var _0x35fb7f={};_0x35fb7f[_0x1edcfc]={'$like':'%'+_0xe01454[_0x455d('0x39')][_0x455d('0x41')]+'%'};return _0x35fb7f;})});}_0x28c44d=_[_0x455d('0x42')]({},_0x28c44d,_0xe01454[_0x455d('0x46')]);return _0xb1bbed['getSubjects'](_0x28c44d);}})['then'](function(_0x3b22c7){if(_0x3b22c7){_0x406513=_0x3b22c7['length'];if(!_0xe01454['query'][_0x455d('0x56')](_0x455d('0x53'))){_0x28c44d[_0x455d('0x2b')]=qs['limit'](_0xe01454[_0x455d('0x39')][_0x455d('0x2b')]);_0x28c44d['offset']=qs['offset'](_0xe01454[_0x455d('0x39')]['offset']);}return _0xb1bbed['getSubjects'](_0x28c44d);}})['then'](function(_0x431666){if(_0x431666){return _0x431666?{'count':_0x406513,'rows':_0x431666}:null;}})[_0x455d('0x1b')](respondWithResult(_0x44ed55,null))[_0x455d('0x25')](handleError(_0x44ed55,null));};exports[_0x455d('0x57')]=function(_0xc4adb7,_0x2d2e45,_0x2d7073){var _0x10835e={};var _0x265345={};var _0x2901a6;var _0x80261d;return db[_0x455d('0x34')][_0x455d('0x52')]({'where':{'id':_0xc4adb7[_0x455d('0x4a')]['id']}})[_0x455d('0x1b')](handleEntityNotFound(_0x2d2e45,null))[_0x455d('0x1b')](function(_0x52bdd1){if(_0x52bdd1){_0x2901a6=_0x52bdd1;_0x265345[_0x455d('0x35')]=_[_0x455d('0x36')](db['ServicenowField'][_0x455d('0x4b')]);_0x265345[_0x455d('0x39')]=_['keys'](_0xc4adb7[_0x455d('0x39')]);_0x265345['filters']=_[_0x455d('0x38')](_0x265345[_0x455d('0x35')],_0x265345['query']);_0x10835e[_0x455d('0x3a')]=_['intersection'](_0x265345[_0x455d('0x35')],qs[_0x455d('0x3b')](_0xc4adb7[_0x455d('0x39')][_0x455d('0x3b')]));_0x10835e[_0x455d('0x3a')]=_0x10835e[_0x455d('0x3a')][_0x455d('0x3c')]?_0x10835e[_0x455d('0x3a')]:_0x265345[_0x455d('0x35')];_0x10835e[_0x455d('0x3d')]=qs[_0x455d('0x3e')](_0xc4adb7[_0x455d('0x39')][_0x455d('0x3e')]);_0x10835e[_0x455d('0x3f')]=qs[_0x455d('0x37')](_[_0x455d('0x40')](_0xc4adb7[_0x455d('0x39')],_0x265345[_0x455d('0x37')]));if(_0xc4adb7[_0x455d('0x39')][_0x455d('0x41')]){_0x10835e[_0x455d('0x3f')]=_['merge'](_0x10835e[_0x455d('0x3f')],{'$or':_[_0x455d('0x43')](_0x10835e['attributes'],function(_0x382915){var _0x5b366c={};_0x5b366c[_0x382915]={'$like':'%'+_0xc4adb7['query'][_0x455d('0x41')]+'%'};return _0x5b366c;})});}_0x10835e=_[_0x455d('0x42')]({},_0x10835e,_0xc4adb7[_0x455d('0x46')]);return _0x2901a6[_0x455d('0x57')](_0x10835e);}})[_0x455d('0x1b')](function(_0x2e94bf){if(_0x2e94bf){_0x80261d=_0x2e94bf[_0x455d('0x3c')];if(!_0xc4adb7[_0x455d('0x39')][_0x455d('0x56')](_0x455d('0x53'))){_0x10835e[_0x455d('0x2b')]=qs[_0x455d('0x2b')](_0xc4adb7['query']['limit']);_0x10835e[_0x455d('0x2a')]=qs[_0x455d('0x2a')](_0xc4adb7[_0x455d('0x39')][_0x455d('0x2a')]);}return _0x2901a6[_0x455d('0x57')](_0x10835e);}})[_0x455d('0x1b')](function(_0x298a72){if(_0x298a72){return _0x298a72?{'count':_0x80261d,'rows':_0x298a72}:null;}})[_0x455d('0x1b')](respondWithResult(_0x2d2e45,null))[_0x455d('0x25')](handleError(_0x2d2e45,null));}; \ No newline at end of file +var _0xe3fe=['where','pick','merge','map','key','VIRTUAL','filter','options','includeAll','include','findAll','rows','params','find','catch','create','body','getFields','findOne','ServicenowField','getSubjects','getDescriptions','html-pdf','eml-format','fast-json-patch','mustache','util','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','client','http','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','end','status','json','count','offset','limit','set','Content-Range','apply','reject','update','sendStatus','stack','name','ServicenowConfiguration','rawAttributes','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort'];(function(_0x5929e6,_0x56271a){var _0x40fba7=function(_0x4b1603){while(--_0x4b1603){_0x5929e6['push'](_0x5929e6['shift']());}};_0x40fba7(++_0x56271a);}(_0xe3fe,0xbe));var _0xee3f=function(_0x491110,_0x214f62){_0x491110=_0x491110-0x0;var _0x3955a0=_0xe3fe[_0x491110];return _0x3955a0;};'use strict';var pdf=require(_0xee3f('0x0'));var emlformat=require(_0xee3f('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xee3f('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xee3f('0x3'));var util=require(_0xee3f('0x4'));var path=require('path');var sox=require('sox');var csv=require(_0xee3f('0x5'));var ejs=require(_0xee3f('0x6'));var fs=require('fs');var _=require(_0xee3f('0x7'));var squel=require(_0xee3f('0x8'));var crypto=require(_0xee3f('0x9'));var jsforce=require(_0xee3f('0xa'));var deskjs=require(_0xee3f('0xb'));var toCsv=require(_0xee3f('0x5'));var querystring=require(_0xee3f('0xc'));var Papa=require(_0xee3f('0xd'));var Redis=require(_0xee3f('0xe'));var authService=require(_0xee3f('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xee3f('0x10'));var hardwareService=require(_0xee3f('0x11'));var logger=require(_0xee3f('0x12'))(_0xee3f('0x13'));var utils=require(_0xee3f('0x14'));var config=require(_0xee3f('0x15'));var db=require('../../mysqldb')['db'];var jayson=require('jayson/promise');var client=jayson[_0xee3f('0x16')][_0xee3f('0x17')]({'port':0x232a});function checkPasswordPattern(_0x47bcb0,_0x1e3cfa,_0x479387){if(_0x479387){var _0x700836=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x700836['test'](_0x1e3cfa)){return _0x47bcb0;}else{throw new Error(_0xee3f('0x18'));}}else{return _0x47bcb0;}}function respondWithRpcPromise(_0x57262e,_0x2ec836,_0x16bd44,_0x22a286){return new BPromise(function(_0xb8925c,_0x5576a2){var _0x4931ac=_0x22a286||client;return _0x4931ac[_0xee3f('0x19')](_0x57262e,_0x16bd44)[_0xee3f('0x1a')](function(_0x2455ab){logger[_0xee3f('0x1b')](_0xee3f('0x1c'),_0x2ec836,_0xee3f('0x1d'));logger['debug']('ServicenowConfiguration,\x20%s,\x20%s,\x20%s',_0x2ec836,'request\x20sent',JSON[_0xee3f('0x1e')](_0x2455ab));if(_0x2455ab[_0xee3f('0x1f')]){if(_0x2455ab[_0xee3f('0x1f')]['code']===0x1f4){logger[_0xee3f('0x1f')](_0xee3f('0x1c'),_0x2ec836,_0x2455ab[_0xee3f('0x1f')][_0xee3f('0x20')]);return _0x5576a2(_0x2455ab[_0xee3f('0x1f')][_0xee3f('0x20')]);}logger[_0xee3f('0x1f')](_0xee3f('0x1c'),_0x2ec836,_0x2455ab[_0xee3f('0x1f')][_0xee3f('0x20')]);return _0xb8925c(_0x2455ab[_0xee3f('0x1f')]['message']);}else{logger['info']('ServicenowConfiguration,\x20%s,\x20%s',_0x2ec836,_0xee3f('0x1d'));_0xb8925c(_0x2455ab[_0xee3f('0x21')][_0xee3f('0x20')]);}})['catch'](function(_0x4b3366){logger[_0xee3f('0x1f')](_0xee3f('0x1c'),_0x2ec836,_0x4b3366);_0x5576a2(_0x4b3366);});});}function respondWithStatusCode(_0x5aa2ec,_0x14783b){_0x14783b=_0x14783b||0xcc;return function(_0x94e5ec){if(_0x94e5ec){return _0x5aa2ec['sendStatus'](_0x14783b);}return _0x5aa2ec['status'](_0x14783b)[_0xee3f('0x22')]();};}function respondWithResult(_0x9af7e6,_0x5cb62b){_0x5cb62b=_0x5cb62b||0xc8;return function(_0x1c80c3){if(_0x1c80c3){return _0x9af7e6[_0xee3f('0x23')](_0x5cb62b)[_0xee3f('0x24')](_0x1c80c3);}};}function respondWithFilteredResult(_0x1630aa,_0x1a8cf8){return function(_0x1129a8){if(_0x1129a8){var _0x3df9e8=_0x1129a8[_0xee3f('0x25')],_0x1e53af=_0x1a8cf8[_0xee3f('0x26')],_0x25a61c=_0x1a8cf8[_0xee3f('0x26')]+_0x1a8cf8[_0xee3f('0x27')],_0x182485;if(_0x25a61c>=_0x3df9e8){_0x25a61c=_0x3df9e8;_0x182485=0xc8;}else{_0x182485=0xce;}_0x1630aa[_0xee3f('0x23')](_0x182485);return _0x1630aa[_0xee3f('0x28')](_0xee3f('0x29'),_0x1e53af+'-'+_0x25a61c+'/'+_0x3df9e8)[_0xee3f('0x24')](_0x1129a8);}return null;};}function patchUpdates(_0x490efe){return function(_0x3b7275){try{jsonpatch[_0xee3f('0x2a')](_0x3b7275,_0x490efe,!![]);}catch(_0x20e2ec){return BPromise[_0xee3f('0x2b')](_0x20e2ec);}return _0x3b7275['save']();};}function saveUpdates(_0xc55869,_0x429c5f){return function(_0x176a39){if(_0x176a39){return _0x176a39[_0xee3f('0x2c')](_0xc55869)[_0xee3f('0x1a')](function(_0x446ccd){return _0x446ccd;});}return null;};}function removeEntity(_0x58d582,_0x2ed70c){return function(_0x1fd975){if(_0x1fd975){return _0x1fd975['destroy']()[_0xee3f('0x1a')](function(){_0x58d582['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x42c11c,_0x3b3511){return function(_0x1e5a65){if(!_0x1e5a65){_0x42c11c[_0xee3f('0x2d')](0x194);}return _0x1e5a65;};}function handleError(_0x398a9b,_0x3cc800){_0x3cc800=_0x3cc800||0x1f4;return function(_0x40113d){logger[_0xee3f('0x1f')](_0x40113d[_0xee3f('0x2e')]);if(_0x40113d[_0xee3f('0x2f')]){delete _0x40113d[_0xee3f('0x2f')];}_0x398a9b['status'](_0x3cc800)['send'](_0x40113d);};}exports['index']=function(_0x4737d4,_0x20fe0c){var _0x2ccffa={},_0xc1902d={},_0x267b24={'count':0x0,'rows':[]};var _0x45223c=db[_0xee3f('0x30')][_0xee3f('0x31')];_0xc1902d['model']=_[_0xee3f('0x32')](_0x45223c);_0xc1902d['query']=_['keys'](_0x4737d4[_0xee3f('0x33')]);_0xc1902d[_0xee3f('0x34')]=_[_0xee3f('0x35')](_0xc1902d[_0xee3f('0x36')],_0xc1902d[_0xee3f('0x33')]);_0x2ccffa[_0xee3f('0x37')]=_[_0xee3f('0x35')](_0xc1902d[_0xee3f('0x36')],qs[_0xee3f('0x38')](_0x4737d4[_0xee3f('0x33')][_0xee3f('0x38')]));_0x2ccffa[_0xee3f('0x37')]=_0x2ccffa[_0xee3f('0x37')][_0xee3f('0x39')]?_0x2ccffa[_0xee3f('0x37')]:_0xc1902d['model'];if(!_0x4737d4[_0xee3f('0x33')][_0xee3f('0x3a')](_0xee3f('0x3b'))){_0x2ccffa[_0xee3f('0x27')]=qs[_0xee3f('0x27')](_0x4737d4[_0xee3f('0x33')]['limit']);_0x2ccffa['offset']=qs['offset'](_0x4737d4[_0xee3f('0x33')]['offset']);}_0x2ccffa[_0xee3f('0x3c')]=qs[_0xee3f('0x3d')](_0x4737d4[_0xee3f('0x33')][_0xee3f('0x3d')]);_0x2ccffa[_0xee3f('0x3e')]=qs[_0xee3f('0x34')](_[_0xee3f('0x3f')](_0x4737d4['query'],_0xc1902d['filters']));if(_0x4737d4[_0xee3f('0x33')]['filter']){_0x2ccffa[_0xee3f('0x3e')]=_[_0xee3f('0x40')](_0x2ccffa['where'],{'$or':_[_0xee3f('0x41')](_0x45223c,function(_0x4496b2){if(_0x4496b2['type'][_0xee3f('0x42')]!==_0xee3f('0x43')){var _0x50d463={};_0x50d463[_0x4496b2['field']]={'$like':'%'+_0x4737d4[_0xee3f('0x33')][_0xee3f('0x44')]+'%'};return _0x50d463;}})});}_0x2ccffa=_[_0xee3f('0x40')]({},_0x2ccffa,_0x4737d4[_0xee3f('0x45')]);var _0x4bced9={'where':_0x2ccffa[_0xee3f('0x3e')]};return db[_0xee3f('0x30')][_0xee3f('0x25')](_0x4bced9)[_0xee3f('0x1a')](function(_0x59f65e){_0x267b24[_0xee3f('0x25')]=_0x59f65e;if(_0x4737d4[_0xee3f('0x33')][_0xee3f('0x46')]){_0x2ccffa[_0xee3f('0x47')]=[{'all':!![]}];}return db[_0xee3f('0x30')][_0xee3f('0x48')](_0x2ccffa);})[_0xee3f('0x1a')](function(_0xf61c67){_0x267b24[_0xee3f('0x49')]=_0xf61c67;return _0x267b24;})[_0xee3f('0x1a')](respondWithFilteredResult(_0x20fe0c,_0x2ccffa))['catch'](handleError(_0x20fe0c,null));};exports['show']=function(_0xcfbbb2,_0x5d3604){var _0x549001={'raw':![],'where':{'id':_0xcfbbb2[_0xee3f('0x4a')]['id']}},_0x1498bf={};_0x1498bf['model']=_[_0xee3f('0x32')](db[_0xee3f('0x30')][_0xee3f('0x31')]);_0x1498bf[_0xee3f('0x33')]=_[_0xee3f('0x32')](_0xcfbbb2[_0xee3f('0x33')]);_0x1498bf[_0xee3f('0x34')]=_['intersection'](_0x1498bf[_0xee3f('0x36')],_0x1498bf[_0xee3f('0x33')]);_0x549001[_0xee3f('0x37')]=_['intersection'](_0x1498bf[_0xee3f('0x36')],qs[_0xee3f('0x38')](_0xcfbbb2[_0xee3f('0x33')][_0xee3f('0x38')]));_0x549001[_0xee3f('0x37')]=_0x549001[_0xee3f('0x37')][_0xee3f('0x39')]?_0x549001[_0xee3f('0x37')]:_0x1498bf['model'];if(_0xcfbbb2[_0xee3f('0x33')][_0xee3f('0x46')]){_0x549001['include']=[{'all':!![]}];}_0x549001=_[_0xee3f('0x40')]({},_0x549001,_0xcfbbb2[_0xee3f('0x45')]);return db[_0xee3f('0x30')][_0xee3f('0x4b')](_0x549001)[_0xee3f('0x1a')](handleEntityNotFound(_0x5d3604,null))[_0xee3f('0x1a')](respondWithResult(_0x5d3604,null))[_0xee3f('0x4c')](handleError(_0x5d3604,null));};exports['create']=function(_0x70d026,_0x5682f7){return db[_0xee3f('0x30')][_0xee3f('0x4d')](_0x70d026[_0xee3f('0x4e')],{})[_0xee3f('0x1a')](respondWithResult(_0x5682f7,0xc9))[_0xee3f('0x4c')](handleError(_0x5682f7,null));};exports[_0xee3f('0x2c')]=function(_0x235910,_0x2ba617){if(_0x235910[_0xee3f('0x4e')]['id']){delete _0x235910[_0xee3f('0x4e')]['id'];}return db[_0xee3f('0x30')][_0xee3f('0x4b')]({'where':{'id':_0x235910[_0xee3f('0x4a')]['id']}})[_0xee3f('0x1a')](handleEntityNotFound(_0x2ba617,null))[_0xee3f('0x1a')](saveUpdates(_0x235910[_0xee3f('0x4e')],null))[_0xee3f('0x1a')](respondWithResult(_0x2ba617,null))[_0xee3f('0x4c')](handleError(_0x2ba617,null));};exports['destroy']=function(_0x40a1ec,_0x55399c){return db[_0xee3f('0x30')]['find']({'where':{'id':_0x40a1ec[_0xee3f('0x4a')]['id']}})[_0xee3f('0x1a')](handleEntityNotFound(_0x55399c,null))[_0xee3f('0x1a')](removeEntity(_0x55399c,null))[_0xee3f('0x4c')](handleError(_0x55399c,null));};exports[_0xee3f('0x4f')]=function(_0x555ec8,_0x1179ee,_0x339320){var _0x40a0fb={};var _0x2c5668={};var _0x5597d2;var _0xab46;return db[_0xee3f('0x30')][_0xee3f('0x50')]({'where':{'id':_0x555ec8[_0xee3f('0x4a')]['id']}})[_0xee3f('0x1a')](handleEntityNotFound(_0x1179ee,null))['then'](function(_0x4c7efd){if(_0x4c7efd){_0x5597d2=_0x4c7efd;_0x2c5668['model']=_[_0xee3f('0x32')](db[_0xee3f('0x51')][_0xee3f('0x31')]);_0x2c5668[_0xee3f('0x33')]=_[_0xee3f('0x32')](_0x555ec8[_0xee3f('0x33')]);_0x2c5668['filters']=_[_0xee3f('0x35')](_0x2c5668['model'],_0x2c5668[_0xee3f('0x33')]);_0x40a0fb[_0xee3f('0x37')]=_['intersection'](_0x2c5668['model'],qs['fields'](_0x555ec8[_0xee3f('0x33')][_0xee3f('0x38')]));_0x40a0fb[_0xee3f('0x37')]=_0x40a0fb[_0xee3f('0x37')]['length']?_0x40a0fb[_0xee3f('0x37')]:_0x2c5668[_0xee3f('0x36')];_0x40a0fb[_0xee3f('0x3c')]=qs[_0xee3f('0x3d')](_0x555ec8['query'][_0xee3f('0x3d')]);_0x40a0fb[_0xee3f('0x3e')]=qs[_0xee3f('0x34')](_[_0xee3f('0x3f')](_0x555ec8['query'],_0x2c5668[_0xee3f('0x34')]));if(_0x555ec8[_0xee3f('0x33')][_0xee3f('0x44')]){_0x40a0fb[_0xee3f('0x3e')]=_[_0xee3f('0x40')](_0x40a0fb[_0xee3f('0x3e')],{'$or':_[_0xee3f('0x41')](_0x40a0fb[_0xee3f('0x37')],function(_0x7cd893){var _0x589a44={};_0x589a44[_0x7cd893]={'$like':'%'+_0x555ec8['query'][_0xee3f('0x44')]+'%'};return _0x589a44;})});}_0x40a0fb=_['merge']({},_0x40a0fb,_0x555ec8[_0xee3f('0x45')]);return _0x5597d2[_0xee3f('0x4f')](_0x40a0fb);}})[_0xee3f('0x1a')](function(_0x567c73){if(_0x567c73){_0xab46=_0x567c73[_0xee3f('0x39')];if(!_0x555ec8[_0xee3f('0x33')]['hasOwnProperty']('nolimit')){_0x40a0fb[_0xee3f('0x27')]=qs['limit'](_0x555ec8[_0xee3f('0x33')][_0xee3f('0x27')]);_0x40a0fb[_0xee3f('0x26')]=qs[_0xee3f('0x26')](_0x555ec8['query'][_0xee3f('0x26')]);}return _0x5597d2[_0xee3f('0x4f')](_0x40a0fb);}})[_0xee3f('0x1a')](function(_0x129fb2){if(_0x129fb2){return _0x129fb2?{'count':_0xab46,'rows':_0x129fb2}:null;}})[_0xee3f('0x1a')](respondWithResult(_0x1179ee,null))[_0xee3f('0x4c')](handleError(_0x1179ee,null));};exports['getSubjects']=function(_0x3d9954,_0x124fa2,_0x1b3f32){var _0x441c23={};var _0x2c53e6={};var _0x3e3cee;var _0x2032fe;return db[_0xee3f('0x30')][_0xee3f('0x50')]({'where':{'id':_0x3d9954[_0xee3f('0x4a')]['id']}})['then'](handleEntityNotFound(_0x124fa2,null))[_0xee3f('0x1a')](function(_0x1d8a96){if(_0x1d8a96){_0x3e3cee=_0x1d8a96;_0x2c53e6[_0xee3f('0x36')]=_[_0xee3f('0x32')](db[_0xee3f('0x51')][_0xee3f('0x31')]);_0x2c53e6[_0xee3f('0x33')]=_[_0xee3f('0x32')](_0x3d9954[_0xee3f('0x33')]);_0x2c53e6[_0xee3f('0x34')]=_[_0xee3f('0x35')](_0x2c53e6['model'],_0x2c53e6[_0xee3f('0x33')]);_0x441c23[_0xee3f('0x37')]=_['intersection'](_0x2c53e6[_0xee3f('0x36')],qs['fields'](_0x3d9954[_0xee3f('0x33')][_0xee3f('0x38')]));_0x441c23[_0xee3f('0x37')]=_0x441c23[_0xee3f('0x37')][_0xee3f('0x39')]?_0x441c23[_0xee3f('0x37')]:_0x2c53e6['model'];_0x441c23['order']=qs[_0xee3f('0x3d')](_0x3d9954['query'][_0xee3f('0x3d')]);_0x441c23[_0xee3f('0x3e')]=qs['filters'](_[_0xee3f('0x3f')](_0x3d9954['query'],_0x2c53e6[_0xee3f('0x34')]));if(_0x3d9954[_0xee3f('0x33')][_0xee3f('0x44')]){_0x441c23[_0xee3f('0x3e')]=_['merge'](_0x441c23[_0xee3f('0x3e')],{'$or':_[_0xee3f('0x41')](_0x441c23[_0xee3f('0x37')],function(_0x52aef4){var _0x995c2b={};_0x995c2b[_0x52aef4]={'$like':'%'+_0x3d9954[_0xee3f('0x33')][_0xee3f('0x44')]+'%'};return _0x995c2b;})});}_0x441c23=_[_0xee3f('0x40')]({},_0x441c23,_0x3d9954[_0xee3f('0x45')]);return _0x3e3cee[_0xee3f('0x52')](_0x441c23);}})[_0xee3f('0x1a')](function(_0x24173b){if(_0x24173b){_0x2032fe=_0x24173b[_0xee3f('0x39')];if(!_0x3d9954[_0xee3f('0x33')][_0xee3f('0x3a')](_0xee3f('0x3b'))){_0x441c23[_0xee3f('0x27')]=qs['limit'](_0x3d9954[_0xee3f('0x33')][_0xee3f('0x27')]);_0x441c23['offset']=qs[_0xee3f('0x26')](_0x3d9954[_0xee3f('0x33')]['offset']);}return _0x3e3cee[_0xee3f('0x52')](_0x441c23);}})['then'](function(_0x56ccc0){if(_0x56ccc0){return _0x56ccc0?{'count':_0x2032fe,'rows':_0x56ccc0}:null;}})[_0xee3f('0x1a')](respondWithResult(_0x124fa2,null))[_0xee3f('0x4c')](handleError(_0x124fa2,null));};exports[_0xee3f('0x53')]=function(_0x2dba66,_0x114bbd,_0x4a5504){var _0x86982b={};var _0x227cc7={};var _0x18aab5;var _0x447394;return db[_0xee3f('0x30')]['findOne']({'where':{'id':_0x2dba66[_0xee3f('0x4a')]['id']}})[_0xee3f('0x1a')](handleEntityNotFound(_0x114bbd,null))['then'](function(_0x3598fe){if(_0x3598fe){_0x18aab5=_0x3598fe;_0x227cc7[_0xee3f('0x36')]=_[_0xee3f('0x32')](db[_0xee3f('0x51')][_0xee3f('0x31')]);_0x227cc7[_0xee3f('0x33')]=_[_0xee3f('0x32')](_0x2dba66[_0xee3f('0x33')]);_0x227cc7['filters']=_[_0xee3f('0x35')](_0x227cc7['model'],_0x227cc7[_0xee3f('0x33')]);_0x86982b['attributes']=_['intersection'](_0x227cc7[_0xee3f('0x36')],qs[_0xee3f('0x38')](_0x2dba66[_0xee3f('0x33')][_0xee3f('0x38')]));_0x86982b['attributes']=_0x86982b['attributes']['length']?_0x86982b[_0xee3f('0x37')]:_0x227cc7[_0xee3f('0x36')];_0x86982b['order']=qs['sort'](_0x2dba66[_0xee3f('0x33')]['sort']);_0x86982b[_0xee3f('0x3e')]=qs[_0xee3f('0x34')](_['pick'](_0x2dba66[_0xee3f('0x33')],_0x227cc7[_0xee3f('0x34')]));if(_0x2dba66[_0xee3f('0x33')][_0xee3f('0x44')]){_0x86982b['where']=_['merge'](_0x86982b[_0xee3f('0x3e')],{'$or':_['map'](_0x86982b[_0xee3f('0x37')],function(_0x4316cb){var _0x410780={};_0x410780[_0x4316cb]={'$like':'%'+_0x2dba66[_0xee3f('0x33')][_0xee3f('0x44')]+'%'};return _0x410780;})});}_0x86982b=_['merge']({},_0x86982b,_0x2dba66[_0xee3f('0x45')]);return _0x18aab5[_0xee3f('0x53')](_0x86982b);}})['then'](function(_0x657329){if(_0x657329){_0x447394=_0x657329[_0xee3f('0x39')];if(!_0x2dba66[_0xee3f('0x33')][_0xee3f('0x3a')](_0xee3f('0x3b'))){_0x86982b['limit']=qs[_0xee3f('0x27')](_0x2dba66[_0xee3f('0x33')][_0xee3f('0x27')]);_0x86982b[_0xee3f('0x26')]=qs[_0xee3f('0x26')](_0x2dba66[_0xee3f('0x33')][_0xee3f('0x26')]);}return _0x18aab5[_0xee3f('0x53')](_0x86982b);}})['then'](function(_0x1659ed){if(_0x1659ed){return _0x1659ed?{'count':_0x447394,'rows':_0x1659ed}:null;}})['then'](respondWithResult(_0x114bbd,null))[_0xee3f('0x4c')](handleError(_0x114bbd,null));}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js index 8886285..e0f56fd 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 _0x6895=['./intServicenowConfiguration.attributes','exports','define','int_servicenow_configurations','lodash','util','../../config/logger','bluebird','request-promise','path','../../config/environment'];(function(_0x55e08b,_0x421620){var _0xd1a7ff=function(_0x58c7ff){while(--_0x58c7ff){_0x55e08b['push'](_0x55e08b['shift']());}};_0xd1a7ff(++_0x421620);}(_0x6895,0x138));var _0x5689=function(_0x20e928,_0x559d87){_0x20e928=_0x20e928-0x0;var _0x531617=_0x6895[_0x20e928];return _0x531617;};'use strict';var _=require(_0x5689('0x0'));var util=require(_0x5689('0x1'));var logger=require(_0x5689('0x2'))('api');var moment=require('moment');var BPromise=require(_0x5689('0x3'));var rp=require(_0x5689('0x4'));var fs=require('fs');var path=require(_0x5689('0x5'));var rimraf=require('rimraf');var config=require(_0x5689('0x6'));var attributes=require(_0x5689('0x7'));module[_0x5689('0x8')]=function(_0x536b6e,_0x36272e){return _0x536b6e[_0x5689('0x9')]('ServicenowConfiguration',attributes,{'tableName':_0x5689('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6ce2=['define','ServicenowConfiguration','int_servicenow_configurations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','./intServicenowConfiguration.attributes','exports'];(function(_0x4fbfd9,_0x3ab91a){var _0x31dc94=function(_0x11e53b){while(--_0x11e53b){_0x4fbfd9['push'](_0x4fbfd9['shift']());}};_0x31dc94(++_0x3ab91a);}(_0x6ce2,0x117));var _0x26ce=function(_0x33032e,_0x31411a){_0x33032e=_0x33032e-0x0;var _0x13316b=_0x6ce2[_0x33032e];return _0x13316b;};'use strict';var _=require(_0x26ce('0x0'));var util=require(_0x26ce('0x1'));var logger=require(_0x26ce('0x2'))(_0x26ce('0x3'));var moment=require(_0x26ce('0x4'));var BPromise=require(_0x26ce('0x5'));var rp=require(_0x26ce('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x26ce('0x7'));module[_0x26ce('0x8')]=function(_0x3b3654,_0xf882f7){return _0x3b3654[_0x26ce('0x9')](_0x26ce('0xa'),attributes,{'tableName':_0x26ce('0xb'),'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 63828b1..7d2bb10 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 _0x1c2c=['debug','stringify','error','code','ServicenowConfiguration,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','info','request\x20sent'];(function(_0x1a57a2,_0x3375a0){var _0x51e93e=function(_0x3c57ab){while(--_0x3c57ab){_0x1a57a2['push'](_0x1a57a2['shift']());}};_0x51e93e(++_0x3375a0);}(_0x1c2c,0x1aa));var _0xc1c2=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x1c2c[_0x3bf83f];return _0x22c4a9;};'use strict';var _=require(_0xc1c2('0x0'));var util=require(_0xc1c2('0x1'));var moment=require(_0xc1c2('0x2'));var BPromise=require(_0xc1c2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc1c2('0x4'));var db=require(_0xc1c2('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xc1c2('0x6'))(_0xc1c2('0x7'));var config=require(_0xc1c2('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xc1c2('0x9')][_0xc1c2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x395626,_0x2f30b1,_0x501af6){return new BPromise(function(_0x22f579,_0x5e00b3){return client[_0xc1c2('0xb')](_0x395626,_0x501af6)['then'](function(_0x25204d){logger[_0xc1c2('0xc')]('ServicenowConfiguration,\x20%s,\x20%s',_0x2f30b1,_0xc1c2('0xd'));logger[_0xc1c2('0xe')]('ServicenowConfiguration,\x20%s,\x20%s,\x20%s',_0x2f30b1,_0xc1c2('0xd'),JSON[_0xc1c2('0xf')](_0x25204d));if(_0x25204d[_0xc1c2('0x10')]){if(_0x25204d['error'][_0xc1c2('0x11')]===0x1f4){logger[_0xc1c2('0x10')](_0xc1c2('0x12'),_0x2f30b1,_0x25204d[_0xc1c2('0x10')][_0xc1c2('0x13')]);return _0x5e00b3(_0x25204d[_0xc1c2('0x10')][_0xc1c2('0x13')]);}logger[_0xc1c2('0x10')]('ServicenowConfiguration,\x20%s,\x20%s',_0x2f30b1,_0x25204d[_0xc1c2('0x10')]['message']);return _0x22f579(_0x25204d[_0xc1c2('0x10')][_0xc1c2('0x13')]);}else{logger[_0xc1c2('0xc')](_0xc1c2('0x12'),_0x2f30b1,'request\x20sent');_0x22f579(_0x25204d[_0xc1c2('0x14')][_0xc1c2('0x13')]);}})[_0xc1c2('0x15')](function(_0x148417){logger[_0xc1c2('0x10')](_0xc1c2('0x12'),_0x2f30b1,_0x148417);_0x5e00b3(_0x148417);});});} \ No newline at end of file +var _0xedb4=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','request','info','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird'];(function(_0x1a247f,_0x183f95){var _0x4c22ee=function(_0x2fbedf){while(--_0x2fbedf){_0x1a247f['push'](_0x1a247f['shift']());}};_0x4c22ee(++_0x183f95);}(_0xedb4,0x189));var _0x4edb=function(_0x3f59b1,_0x25cdbe){_0x3f59b1=_0x3f59b1-0x0;var _0x11d2e8=_0xedb4[_0x3f59b1];return _0x11d2e8;};'use strict';var _=require('lodash');var util=require(_0x4edb('0x0'));var moment=require(_0x4edb('0x1'));var BPromise=require(_0x4edb('0x2'));var rs=require(_0x4edb('0x3'));var fs=require('fs');var Redis=require(_0x4edb('0x4'));var db=require(_0x4edb('0x5'))['db'];var utils=require(_0x4edb('0x6'));var logger=require(_0x4edb('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x4edb('0x8'));var client=jayson['client'][_0x4edb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1a2074,_0x3b18df,_0x5419b6){return new BPromise(function(_0x2473b3,_0x3c7cc2){return client[_0x4edb('0xa')](_0x1a2074,_0x5419b6)['then'](function(_0x53c5ec){logger[_0x4edb('0xb')](_0x4edb('0xc'),_0x3b18df,_0x4edb('0xd'));logger[_0x4edb('0xe')](_0x4edb('0xf'),_0x3b18df,_0x4edb('0xd'),JSON[_0x4edb('0x10')](_0x53c5ec));if(_0x53c5ec[_0x4edb('0x11')]){if(_0x53c5ec[_0x4edb('0x11')][_0x4edb('0x12')]===0x1f4){logger[_0x4edb('0x11')]('ServicenowConfiguration,\x20%s,\x20%s',_0x3b18df,_0x53c5ec[_0x4edb('0x11')][_0x4edb('0x13')]);return _0x3c7cc2(_0x53c5ec[_0x4edb('0x11')]['message']);}logger[_0x4edb('0x11')](_0x4edb('0xc'),_0x3b18df,_0x53c5ec['error'][_0x4edb('0x13')]);return _0x2473b3(_0x53c5ec['error'][_0x4edb('0x13')]);}else{logger[_0x4edb('0xb')](_0x4edb('0xc'),_0x3b18df,_0x4edb('0xd'));_0x2473b3(_0x53c5ec[_0x4edb('0x14')][_0x4edb('0x13')]);}})[_0x4edb('0x15')](function(_0x4b571a){logger[_0x4edb('0x11')](_0x4edb('0xc'),_0x3b18df,_0x4b571a);_0x3c7cc2(_0x4b571a);});});} \ No newline at end of file diff --git a/server/api/intServicenowField/index.js b/server/api/intServicenowField/index.js index 92ae389..544288b 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 _0xfec0=['isAuthenticated','index','show','post','create','put','/:id','delete','exports','multer','path','express','../../config/environment','./intServicenowField.controller','get'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xfec0,0xf9));var _0x0fec=function(_0x5e36d1,_0x471178){_0x5e36d1=_0x5e36d1-0x0;var _0x950b9e=_0xfec0[_0x5e36d1];return _0x950b9e;};'use strict';var multer=require(_0x0fec('0x0'));var util=require('util');var path=require(_0x0fec('0x1'));var timeout=require('connect-timeout');var express=require(_0x0fec('0x2'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x0fec('0x3'));var controller=require(_0x0fec('0x4'));router[_0x0fec('0x5')]('/',auth[_0x0fec('0x6')](),controller[_0x0fec('0x7')]);router[_0x0fec('0x5')]('/:id',auth[_0x0fec('0x6')](),controller[_0x0fec('0x8')]);router[_0x0fec('0x9')]('/',auth['isAuthenticated'](),controller[_0x0fec('0xa')]);router[_0x0fec('0xb')](_0x0fec('0xc'),auth[_0x0fec('0x6')](),controller['update']);router[_0x0fec('0xd')](_0x0fec('0xc'),auth[_0x0fec('0x6')](),controller['destroy']);module[_0x0fec('0xe')]=router; \ No newline at end of file +var _0xe832=['destroy','multer','util','path','express','Router','../../components/auth/service','../../config/environment','./intServicenowField.controller','isAuthenticated','index','/:id','show','post','create','update','delete'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe832,0xbc));var _0x2e83=function(_0x1a420d,_0x427493){_0x1a420d=_0x1a420d-0x0;var _0x1ed24d=_0xe832[_0x1a420d];return _0x1ed24d;};'use strict';var multer=require(_0x2e83('0x0'));var util=require(_0x2e83('0x1'));var path=require(_0x2e83('0x2'));var timeout=require('connect-timeout');var express=require(_0x2e83('0x3'));var router=express[_0x2e83('0x4')]();var auth=require(_0x2e83('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x2e83('0x6'));var controller=require(_0x2e83('0x7'));router['get']('/',auth[_0x2e83('0x8')](),controller[_0x2e83('0x9')]);router['get'](_0x2e83('0xa'),auth[_0x2e83('0x8')](),controller[_0x2e83('0xb')]);router[_0x2e83('0xc')]('/',auth[_0x2e83('0x8')](),controller[_0x2e83('0xd')]);router['put']('/:id',auth[_0x2e83('0x8')](),controller[_0x2e83('0xe')]);router[_0x2e83('0xf')](_0x2e83('0xa'),auth[_0x2e83('0x8')](),controller[_0x2e83('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.attributes.js b/server/api/intServicenowField/intServicenowField.attributes.js index 3f55e92..731b7a4 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 _0xabed=['STRING','BOOLEAN','sequelize','exports','variable','customVariable','keyValue','string','ENUM'];(function(_0x3a6efd,_0x2a5102){var _0x487b9a=function(_0x104f89){while(--_0x104f89){_0x3a6efd['push'](_0x3a6efd['shift']());}};_0x487b9a(++_0x2a5102);}(_0xabed,0xa4));var _0xdabe=function(_0x580647,_0x43d2c3){_0x580647=_0x580647-0x0;var _0x5f0792=_0xabed[_0x580647];return _0x5f0792;};'use strict';var Sequelize=require(_0xdabe('0x0'));module[_0xdabe('0x1')]={'type':{'type':Sequelize['ENUM']('string',_0xdabe('0x2'),_0xdabe('0x3'),_0xdabe('0x4')),'defaultValue':_0xdabe('0x5')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xdabe('0x6')](_0xdabe('0x5'),'variable','customVariable')},'keyContent':{'type':Sequelize[_0xdabe('0x7')]},'idField':{'type':Sequelize[_0xdabe('0x7')]},'nameField':{'type':Sequelize[_0xdabe('0x7')]},'customField':{'type':Sequelize[_0xdabe('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xdabe('0x7')]}}; \ No newline at end of file +var _0xd433=['variable','customVariable','keyValue','STRING','ENUM','BOOLEAN','sequelize','exports','string'];(function(_0x1c23d8,_0xad1198){var _0xbea0c5=function(_0x14c79f){while(--_0x14c79f){_0x1c23d8['push'](_0x1c23d8['shift']());}};_0xbea0c5(++_0xad1198);}(_0xd433,0x1c8));var _0x3d43=function(_0x3817db,_0x3eabd3){_0x3817db=_0x3817db-0x0;var _0x46768d=_0xd433[_0x3817db];return _0x46768d;};'use strict';var Sequelize=require(_0x3d43('0x0'));module[_0x3d43('0x1')]={'type':{'type':Sequelize['ENUM'](_0x3d43('0x2'),_0x3d43('0x3'),_0x3d43('0x4'),_0x3d43('0x5')),'defaultValue':_0x3d43('0x2')},'content':{'type':Sequelize[_0x3d43('0x6')]},'key':{'type':Sequelize[_0x3d43('0x6')]},'keyType':{'type':Sequelize[_0x3d43('0x7')](_0x3d43('0x2'),_0x3d43('0x3'),'customVariable')},'keyContent':{'type':Sequelize[_0x3d43('0x6')]},'idField':{'type':Sequelize[_0x3d43('0x6')]},'nameField':{'type':Sequelize[_0x3d43('0x6')]},'customField':{'type':Sequelize[_0x3d43('0x8')],'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 747303d..4e5bd2b 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 _0x0276=['set','Content-Range','json','apply','reject','save','destroy','then','sendStatus','error','name','send','index','ServicenowField','rawAttributes','model','keys','query','filters','attributes','intersection','fields','length','nolimit','offset','order','where','pick','filter','merge','map','type','key','field','options','includeAll','include','catch','show','params','find','create','body','update','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','sox','to-csv','lodash','squel','jsforce','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','status','end','count','limit'];(function(_0x31fde7,_0x483f21){var _0x5250ec=function(_0x5d7fd2){while(--_0x5d7fd2){_0x31fde7['push'](_0x31fde7['shift']());}};_0x5250ec(++_0x483f21);}(_0x0276,0x140));var _0x6027=function(_0x423dd4,_0x287532){_0x423dd4=_0x423dd4-0x0;var _0xb29406=_0x0276[_0x423dd4];return _0xb29406;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x6027('0x0'));var rimraf=require(_0x6027('0x1'));var zipdir=require(_0x6027('0x2'));var jsonpatch=require(_0x6027('0x3'));var rp=require(_0x6027('0x4'));var moment=require(_0x6027('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x6027('0x6'));var util=require('util');var path=require('path');var sox=require(_0x6027('0x7'));var csv=require(_0x6027('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x6027('0x9'));var squel=require(_0x6027('0xa'));var crypto=require('crypto');var jsforce=require(_0x6027('0xb'));var deskjs=require(_0x6027('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x6027('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x6027('0xe'));var as=require(_0x6027('0xf'));var hardwareService=require(_0x6027('0x10'));var logger=require(_0x6027('0x11'))(_0x6027('0x12'));var utils=require(_0x6027('0x13'));var config=require(_0x6027('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x45e4a5,_0x4a8a52){_0x4a8a52=_0x4a8a52||0xcc;return function(_0x37909b){if(_0x37909b){return _0x45e4a5['sendStatus'](_0x4a8a52);}return _0x45e4a5[_0x6027('0x15')](_0x4a8a52)[_0x6027('0x16')]();};}function respondWithResult(_0x3642c3,_0x20d268){_0x20d268=_0x20d268||0xc8;return function(_0x1116fc){if(_0x1116fc){return _0x3642c3[_0x6027('0x15')](_0x20d268)['json'](_0x1116fc);}};}function respondWithFilteredResult(_0x36404a,_0x5f3c07){return function(_0x1ef6d7){if(_0x1ef6d7){var _0x1e543e=_0x1ef6d7[_0x6027('0x17')],_0xbdf6a8=_0x5f3c07['offset'],_0x3d23b7=_0x5f3c07['offset']+_0x5f3c07[_0x6027('0x18')],_0x5e3a00;if(_0x3d23b7>=_0x1e543e){_0x3d23b7=_0x1e543e;_0x5e3a00=0xc8;}else{_0x5e3a00=0xce;}_0x36404a['status'](_0x5e3a00);return _0x36404a[_0x6027('0x19')](_0x6027('0x1a'),_0xbdf6a8+'-'+_0x3d23b7+'/'+_0x1e543e)[_0x6027('0x1b')](_0x1ef6d7);}return null;};}function patchUpdates(_0x1bd513){return function(_0x360b79){try{jsonpatch[_0x6027('0x1c')](_0x360b79,_0x1bd513,!![]);}catch(_0x15fa4c){return BPromise[_0x6027('0x1d')](_0x15fa4c);}return _0x360b79[_0x6027('0x1e')]();};}function saveUpdates(_0x47c1ef,_0x43167b){return function(_0x367ce2){if(_0x367ce2){return _0x367ce2['update'](_0x47c1ef)['then'](function(_0x3d5821){return _0x3d5821;});}return null;};}function removeEntity(_0x33c97f,_0x54f005){return function(_0x5bfb6d){if(_0x5bfb6d){return _0x5bfb6d[_0x6027('0x1f')]()[_0x6027('0x20')](function(){_0x33c97f[_0x6027('0x15')](0xcc)[_0x6027('0x16')]();});}};}function handleEntityNotFound(_0x10b883,_0x4c6c49){return function(_0x310fa4){if(!_0x310fa4){_0x10b883[_0x6027('0x21')](0x194);}return _0x310fa4;};}function handleError(_0x1ff759,_0xb92110){_0xb92110=_0xb92110||0x1f4;return function(_0x16b8da){logger[_0x6027('0x22')](_0x16b8da['stack']);if(_0x16b8da['name']){delete _0x16b8da[_0x6027('0x23')];}_0x1ff759[_0x6027('0x15')](_0xb92110)[_0x6027('0x24')](_0x16b8da);};}exports[_0x6027('0x25')]=function(_0x1f5a3,_0x56f58e){var _0x39eb10={},_0x1a3b00={},_0x4ce3ba={'count':0x0,'rows':[]};var _0x53cb99=db[_0x6027('0x26')][_0x6027('0x27')];_0x1a3b00[_0x6027('0x28')]=_[_0x6027('0x29')](_0x53cb99);_0x1a3b00[_0x6027('0x2a')]=_['keys'](_0x1f5a3['query']);_0x1a3b00[_0x6027('0x2b')]=_['intersection'](_0x1a3b00[_0x6027('0x28')],_0x1a3b00[_0x6027('0x2a')]);_0x39eb10[_0x6027('0x2c')]=_[_0x6027('0x2d')](_0x1a3b00['model'],qs[_0x6027('0x2e')](_0x1f5a3[_0x6027('0x2a')][_0x6027('0x2e')]));_0x39eb10[_0x6027('0x2c')]=_0x39eb10[_0x6027('0x2c')][_0x6027('0x2f')]?_0x39eb10['attributes']:_0x1a3b00['model'];if(!_0x1f5a3['query']['hasOwnProperty'](_0x6027('0x30'))){_0x39eb10[_0x6027('0x18')]=qs[_0x6027('0x18')](_0x1f5a3['query'][_0x6027('0x18')]);_0x39eb10[_0x6027('0x31')]=qs[_0x6027('0x31')](_0x1f5a3[_0x6027('0x2a')][_0x6027('0x31')]);}_0x39eb10[_0x6027('0x32')]=qs['sort'](_0x1f5a3['query']['sort']);_0x39eb10[_0x6027('0x33')]=qs['filters'](_[_0x6027('0x34')](_0x1f5a3[_0x6027('0x2a')],_0x1a3b00[_0x6027('0x2b')]));if(_0x1f5a3[_0x6027('0x2a')][_0x6027('0x35')]){_0x39eb10[_0x6027('0x33')]=_[_0x6027('0x36')](_0x39eb10[_0x6027('0x33')],{'$or':_[_0x6027('0x37')](_0x53cb99,function(_0x2bd00f){if(_0x2bd00f[_0x6027('0x38')][_0x6027('0x39')]!=='VIRTUAL'){var _0x3c88b8={};_0x3c88b8[_0x2bd00f[_0x6027('0x3a')]]={'$like':'%'+_0x1f5a3[_0x6027('0x2a')]['filter']+'%'};return _0x3c88b8;}})});}_0x39eb10=_[_0x6027('0x36')]({},_0x39eb10,_0x1f5a3[_0x6027('0x3b')]);var _0x43adee={'where':_0x39eb10[_0x6027('0x33')]};return db[_0x6027('0x26')][_0x6027('0x17')](_0x43adee)[_0x6027('0x20')](function(_0x414472){_0x4ce3ba[_0x6027('0x17')]=_0x414472;if(_0x1f5a3['query'][_0x6027('0x3c')]){_0x39eb10[_0x6027('0x3d')]=[{'all':!![]}];}return db[_0x6027('0x26')]['findAll'](_0x39eb10);})[_0x6027('0x20')](function(_0x18b0c5){_0x4ce3ba['rows']=_0x18b0c5;return _0x4ce3ba;})[_0x6027('0x20')](respondWithFilteredResult(_0x56f58e,_0x39eb10))[_0x6027('0x3e')](handleError(_0x56f58e,null));};exports[_0x6027('0x3f')]=function(_0x1b251a,_0x3ec468){var _0x57cbf2={'raw':!![],'where':{'id':_0x1b251a[_0x6027('0x40')]['id']}},_0x15d1db={};_0x15d1db['model']=_[_0x6027('0x29')](db[_0x6027('0x26')][_0x6027('0x27')]);_0x15d1db[_0x6027('0x2a')]=_[_0x6027('0x29')](_0x1b251a[_0x6027('0x2a')]);_0x15d1db[_0x6027('0x2b')]=_[_0x6027('0x2d')](_0x15d1db['model'],_0x15d1db[_0x6027('0x2a')]);_0x57cbf2['attributes']=_[_0x6027('0x2d')](_0x15d1db[_0x6027('0x28')],qs[_0x6027('0x2e')](_0x1b251a['query'][_0x6027('0x2e')]));_0x57cbf2[_0x6027('0x2c')]=_0x57cbf2[_0x6027('0x2c')][_0x6027('0x2f')]?_0x57cbf2['attributes']:_0x15d1db[_0x6027('0x28')];if(_0x1b251a[_0x6027('0x2a')][_0x6027('0x3c')]){_0x57cbf2[_0x6027('0x3d')]=[{'all':!![]}];}_0x57cbf2=_[_0x6027('0x36')]({},_0x57cbf2,_0x1b251a[_0x6027('0x3b')]);return db[_0x6027('0x26')][_0x6027('0x41')](_0x57cbf2)[_0x6027('0x20')](handleEntityNotFound(_0x3ec468,null))[_0x6027('0x20')](respondWithResult(_0x3ec468,null))['catch'](handleError(_0x3ec468,null));};exports[_0x6027('0x42')]=function(_0x434fbf,_0x41bdae){return db[_0x6027('0x26')][_0x6027('0x42')](_0x434fbf[_0x6027('0x43')],{})['then'](respondWithResult(_0x41bdae,0xc9))[_0x6027('0x3e')](handleError(_0x41bdae,null));};exports[_0x6027('0x44')]=function(_0x1fb671,_0x44fa61){if(_0x1fb671[_0x6027('0x43')]['id']){delete _0x1fb671[_0x6027('0x43')]['id'];}return db[_0x6027('0x26')][_0x6027('0x41')]({'where':{'id':_0x1fb671[_0x6027('0x40')]['id']}})[_0x6027('0x20')](handleEntityNotFound(_0x44fa61,null))[_0x6027('0x20')](saveUpdates(_0x1fb671[_0x6027('0x43')],null))[_0x6027('0x20')](respondWithResult(_0x44fa61,null))[_0x6027('0x3e')](handleError(_0x44fa61,null));};exports[_0x6027('0x1f')]=function(_0x346c93,_0x1eeb73){return db[_0x6027('0x26')][_0x6027('0x41')]({'where':{'id':_0x346c93['params']['id']}})[_0x6027('0x20')](handleEntityNotFound(_0x1eeb73,null))[_0x6027('0x20')](removeEntity(_0x1eeb73,null))[_0x6027('0x3e')](handleError(_0x1eeb73,null));}; \ No newline at end of file +var _0x2a3f=['show','params','length','create','body','find','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','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','sendStatus','status','end','json','count','offset','limit','set','apply','save','update','then','destroy','stack','name','send','index','ServicenowField','rawAttributes','model','query','keys','filters','intersection','attributes','fields','nolimit','sort','where','pick','filter','merge','map','type','VIRTUAL','field','options','includeAll','include','findAll','rows','catch'];(function(_0x3e37b1,_0x2baf5d){var _0x2fe97e=function(_0x47d061){while(--_0x47d061){_0x3e37b1['push'](_0x3e37b1['shift']());}};_0x2fe97e(++_0x2baf5d);}(_0x2a3f,0x1e9));var _0xf2a3=function(_0x35a140,_0x3aeac6){_0x35a140=_0x35a140-0x0;var _0x30ab82=_0x2a3f[_0x35a140];return _0x30ab82;};'use strict';var pdf=require(_0xf2a3('0x0'));var emlformat=require(_0xf2a3('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xf2a3('0x2'));var jsonpatch=require(_0xf2a3('0x3'));var rp=require(_0xf2a3('0x4'));var moment=require('moment');var BPromise=require(_0xf2a3('0x5'));var Mustache=require(_0xf2a3('0x6'));var util=require(_0xf2a3('0x7'));var path=require('path');var sox=require(_0xf2a3('0x8'));var csv=require('to-csv');var ejs=require(_0xf2a3('0x9'));var fs=require('fs');var _=require(_0xf2a3('0xa'));var squel=require('squel');var crypto=require(_0xf2a3('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xf2a3('0xc'));var toCsv=require(_0xf2a3('0xd'));var querystring=require(_0xf2a3('0xe'));var Papa=require('papaparse');var Redis=require(_0xf2a3('0xf'));var authService=require(_0xf2a3('0x10'));var qs=require(_0xf2a3('0x11'));var as=require(_0xf2a3('0x12'));var hardwareService=require(_0xf2a3('0x13'));var logger=require(_0xf2a3('0x14'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x379838,_0x2d44d1){_0x2d44d1=_0x2d44d1||0xcc;return function(_0x230e68){if(_0x230e68){return _0x379838[_0xf2a3('0x15')](_0x2d44d1);}return _0x379838[_0xf2a3('0x16')](_0x2d44d1)[_0xf2a3('0x17')]();};}function respondWithResult(_0x1fc9e2,_0x245072){_0x245072=_0x245072||0xc8;return function(_0x239247){if(_0x239247){return _0x1fc9e2[_0xf2a3('0x16')](_0x245072)[_0xf2a3('0x18')](_0x239247);}};}function respondWithFilteredResult(_0x59c6f7,_0x10d17a){return function(_0x2f4466){if(_0x2f4466){var _0x18a053=_0x2f4466[_0xf2a3('0x19')],_0x38d184=_0x10d17a['offset'],_0x5accf3=_0x10d17a[_0xf2a3('0x1a')]+_0x10d17a[_0xf2a3('0x1b')],_0x13d8f6;if(_0x5accf3>=_0x18a053){_0x5accf3=_0x18a053;_0x13d8f6=0xc8;}else{_0x13d8f6=0xce;}_0x59c6f7[_0xf2a3('0x16')](_0x13d8f6);return _0x59c6f7[_0xf2a3('0x1c')]('Content-Range',_0x38d184+'-'+_0x5accf3+'/'+_0x18a053)[_0xf2a3('0x18')](_0x2f4466);}return null;};}function patchUpdates(_0x67c0ed){return function(_0x1bd4a7){try{jsonpatch[_0xf2a3('0x1d')](_0x1bd4a7,_0x67c0ed,!![]);}catch(_0x5ab4e8){return BPromise['reject'](_0x5ab4e8);}return _0x1bd4a7[_0xf2a3('0x1e')]();};}function saveUpdates(_0x4a40f6,_0x3faca8){return function(_0xaffe2e){if(_0xaffe2e){return _0xaffe2e[_0xf2a3('0x1f')](_0x4a40f6)[_0xf2a3('0x20')](function(_0x8f9dd5){return _0x8f9dd5;});}return null;};}function removeEntity(_0x53185d,_0x627e17){return function(_0xa0aa4f){if(_0xa0aa4f){return _0xa0aa4f[_0xf2a3('0x21')]()[_0xf2a3('0x20')](function(){_0x53185d[_0xf2a3('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5928b2,_0x241dfc){return function(_0x10b924){if(!_0x10b924){_0x5928b2[_0xf2a3('0x15')](0x194);}return _0x10b924;};}function handleError(_0x112a08,_0x101ab7){_0x101ab7=_0x101ab7||0x1f4;return function(_0x3e1016){logger['error'](_0x3e1016[_0xf2a3('0x22')]);if(_0x3e1016[_0xf2a3('0x23')]){delete _0x3e1016[_0xf2a3('0x23')];}_0x112a08[_0xf2a3('0x16')](_0x101ab7)[_0xf2a3('0x24')](_0x3e1016);};}exports[_0xf2a3('0x25')]=function(_0x2b4a0f,_0x43a2e1){var _0x3a52ab={},_0x37c41c={},_0x499e1b={'count':0x0,'rows':[]};var _0x558cdf=db[_0xf2a3('0x26')][_0xf2a3('0x27')];_0x37c41c[_0xf2a3('0x28')]=_['keys'](_0x558cdf);_0x37c41c[_0xf2a3('0x29')]=_[_0xf2a3('0x2a')](_0x2b4a0f[_0xf2a3('0x29')]);_0x37c41c[_0xf2a3('0x2b')]=_[_0xf2a3('0x2c')](_0x37c41c[_0xf2a3('0x28')],_0x37c41c[_0xf2a3('0x29')]);_0x3a52ab[_0xf2a3('0x2d')]=_[_0xf2a3('0x2c')](_0x37c41c[_0xf2a3('0x28')],qs[_0xf2a3('0x2e')](_0x2b4a0f[_0xf2a3('0x29')]['fields']));_0x3a52ab[_0xf2a3('0x2d')]=_0x3a52ab[_0xf2a3('0x2d')]['length']?_0x3a52ab[_0xf2a3('0x2d')]:_0x37c41c[_0xf2a3('0x28')];if(!_0x2b4a0f[_0xf2a3('0x29')]['hasOwnProperty'](_0xf2a3('0x2f'))){_0x3a52ab[_0xf2a3('0x1b')]=qs[_0xf2a3('0x1b')](_0x2b4a0f[_0xf2a3('0x29')]['limit']);_0x3a52ab[_0xf2a3('0x1a')]=qs[_0xf2a3('0x1a')](_0x2b4a0f['query'][_0xf2a3('0x1a')]);}_0x3a52ab['order']=qs['sort'](_0x2b4a0f[_0xf2a3('0x29')][_0xf2a3('0x30')]);_0x3a52ab[_0xf2a3('0x31')]=qs[_0xf2a3('0x2b')](_[_0xf2a3('0x32')](_0x2b4a0f[_0xf2a3('0x29')],_0x37c41c['filters']));if(_0x2b4a0f['query'][_0xf2a3('0x33')]){_0x3a52ab['where']=_[_0xf2a3('0x34')](_0x3a52ab[_0xf2a3('0x31')],{'$or':_[_0xf2a3('0x35')](_0x558cdf,function(_0x254b91){if(_0x254b91[_0xf2a3('0x36')]['key']!==_0xf2a3('0x37')){var _0xc826ee={};_0xc826ee[_0x254b91[_0xf2a3('0x38')]]={'$like':'%'+_0x2b4a0f[_0xf2a3('0x29')][_0xf2a3('0x33')]+'%'};return _0xc826ee;}})});}_0x3a52ab=_[_0xf2a3('0x34')]({},_0x3a52ab,_0x2b4a0f[_0xf2a3('0x39')]);var _0x499446={'where':_0x3a52ab[_0xf2a3('0x31')]};return db[_0xf2a3('0x26')][_0xf2a3('0x19')](_0x499446)[_0xf2a3('0x20')](function(_0x45a10d){_0x499e1b[_0xf2a3('0x19')]=_0x45a10d;if(_0x2b4a0f[_0xf2a3('0x29')][_0xf2a3('0x3a')]){_0x3a52ab[_0xf2a3('0x3b')]=[{'all':!![]}];}return db[_0xf2a3('0x26')][_0xf2a3('0x3c')](_0x3a52ab);})[_0xf2a3('0x20')](function(_0x191cc1){_0x499e1b[_0xf2a3('0x3d')]=_0x191cc1;return _0x499e1b;})[_0xf2a3('0x20')](respondWithFilteredResult(_0x43a2e1,_0x3a52ab))[_0xf2a3('0x3e')](handleError(_0x43a2e1,null));};exports[_0xf2a3('0x3f')]=function(_0x247d00,_0x27dc3c){var _0x1954f7={'raw':!![],'where':{'id':_0x247d00[_0xf2a3('0x40')]['id']}},_0x2369ab={};_0x2369ab[_0xf2a3('0x28')]=_[_0xf2a3('0x2a')](db[_0xf2a3('0x26')][_0xf2a3('0x27')]);_0x2369ab[_0xf2a3('0x29')]=_[_0xf2a3('0x2a')](_0x247d00[_0xf2a3('0x29')]);_0x2369ab[_0xf2a3('0x2b')]=_['intersection'](_0x2369ab['model'],_0x2369ab['query']);_0x1954f7['attributes']=_[_0xf2a3('0x2c')](_0x2369ab['model'],qs[_0xf2a3('0x2e')](_0x247d00['query'][_0xf2a3('0x2e')]));_0x1954f7['attributes']=_0x1954f7[_0xf2a3('0x2d')][_0xf2a3('0x41')]?_0x1954f7[_0xf2a3('0x2d')]:_0x2369ab[_0xf2a3('0x28')];if(_0x247d00[_0xf2a3('0x29')]['includeAll']){_0x1954f7['include']=[{'all':!![]}];}_0x1954f7=_['merge']({},_0x1954f7,_0x247d00[_0xf2a3('0x39')]);return db[_0xf2a3('0x26')]['find'](_0x1954f7)['then'](handleEntityNotFound(_0x27dc3c,null))[_0xf2a3('0x20')](respondWithResult(_0x27dc3c,null))[_0xf2a3('0x3e')](handleError(_0x27dc3c,null));};exports[_0xf2a3('0x42')]=function(_0x38fc67,_0x48ef1d){return db[_0xf2a3('0x26')][_0xf2a3('0x42')](_0x38fc67[_0xf2a3('0x43')],{})[_0xf2a3('0x20')](respondWithResult(_0x48ef1d,0xc9))[_0xf2a3('0x3e')](handleError(_0x48ef1d,null));};exports[_0xf2a3('0x1f')]=function(_0x2b2ee0,_0x499f25){if(_0x2b2ee0[_0xf2a3('0x43')]['id']){delete _0x2b2ee0[_0xf2a3('0x43')]['id'];}return db['ServicenowField'][_0xf2a3('0x44')]({'where':{'id':_0x2b2ee0['params']['id']}})[_0xf2a3('0x20')](handleEntityNotFound(_0x499f25,null))[_0xf2a3('0x20')](saveUpdates(_0x2b2ee0[_0xf2a3('0x43')],null))['then'](respondWithResult(_0x499f25,null))[_0xf2a3('0x3e')](handleError(_0x499f25,null));};exports['destroy']=function(_0x53c3d9,_0x46d854){return db['ServicenowField'][_0xf2a3('0x44')]({'where':{'id':_0x53c3d9[_0xf2a3('0x40')]['id']}})[_0xf2a3('0x20')](handleEntityNotFound(_0x46d854,null))['then'](removeEntity(_0x46d854,null))[_0xf2a3('0x3e')](handleError(_0x46d854,null));}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.model.js b/server/api/intServicenowField/intServicenowField.model.js index 966b534..18873d8 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 _0xc056=['util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','ServicenowField','int_servicenow_fields','idField','lodash'];(function(_0x26f2a6,_0x244d5f){var _0x11ee7a=function(_0x2acbaf){while(--_0x2acbaf){_0x26f2a6['push'](_0x26f2a6['shift']());}};_0x11ee7a(++_0x244d5f);}(_0xc056,0x6f));var _0x6c05=function(_0x55bf45,_0x5a398f){_0x55bf45=_0x55bf45-0x0;var _0x4149c4=_0xc056[_0x55bf45];return _0x4149c4;};'use strict';var _=require(_0x6c05('0x0'));var util=require(_0x6c05('0x1'));var logger=require(_0x6c05('0x2'))(_0x6c05('0x3'));var moment=require('moment');var BPromise=require(_0x6c05('0x4'));var rp=require(_0x6c05('0x5'));var fs=require('fs');var path=require(_0x6c05('0x6'));var rimraf=require(_0x6c05('0x7'));var config=require(_0x6c05('0x8'));var attributes=require('./intServicenowField.attributes');module[_0x6c05('0x9')]=function(_0x5dbefe,_0x367315){return _0x5dbefe[_0x6c05('0xa')](_0x6c05('0xb'),attributes,{'tableName':_0x6c05('0xc'),'paranoid':![],'indexes':[{'name':'servicenow_unique_index','fields':[_0x6c05('0xd'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5417=['path','rimraf','./intServicenowField.attributes','exports','define','int_servicenow_fields','servicenow_unique_index','idField','FieldId','lodash','util','api','moment','bluebird','request-promise'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5417,0xcc));var _0x7541=function(_0x43b88c,_0x46fb04){_0x43b88c=_0x43b88c-0x0;var _0x407299=_0x5417[_0x43b88c];return _0x407299;};'use strict';var _=require(_0x7541('0x0'));var util=require(_0x7541('0x1'));var logger=require('../../config/logger')(_0x7541('0x2'));var moment=require(_0x7541('0x3'));var BPromise=require(_0x7541('0x4'));var rp=require(_0x7541('0x5'));var fs=require('fs');var path=require(_0x7541('0x6'));var rimraf=require(_0x7541('0x7'));var config=require('../../config/environment');var attributes=require(_0x7541('0x8'));module[_0x7541('0x9')]=function(_0x54bbf7,_0x585c26){return _0x54bbf7[_0x7541('0xa')]('ServicenowField',attributes,{'tableName':_0x7541('0xb'),'paranoid':![],'indexes':[{'name':_0x7541('0xc'),'fields':[_0x7541('0xd'),_0x7541('0xe')],'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 b083b31..623bb84 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 _0xfe76=['request\x20sent','debug','error','code','message','info','result','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','client','http','request','then','ServicenowField,\x20%s,\x20%s'];(function(_0x3b3c19,_0x18e7fd){var _0x51f225=function(_0x25a10e){while(--_0x25a10e){_0x3b3c19['push'](_0x3b3c19['shift']());}};_0x51f225(++_0x18e7fd);}(_0xfe76,0xa7));var _0x6fe7=function(_0x4f0e62,_0x28e44f){_0x4f0e62=_0x4f0e62-0x0;var _0x117ab8=_0xfe76[_0x4f0e62];return _0x117ab8;};'use strict';var _=require(_0x6fe7('0x0'));var util=require(_0x6fe7('0x1'));var moment=require(_0x6fe7('0x2'));var BPromise=require(_0x6fe7('0x3'));var rs=require(_0x6fe7('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x6fe7('0x5'));var logger=require(_0x6fe7('0x6'))(_0x6fe7('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x6fe7('0x8')][_0x6fe7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x16c9e8,_0x267546,_0x3813aa){return new BPromise(function(_0x187f28,_0x2baba9){return client[_0x6fe7('0xa')](_0x16c9e8,_0x3813aa)[_0x6fe7('0xb')](function(_0x4f4186){logger['info'](_0x6fe7('0xc'),_0x267546,_0x6fe7('0xd'));logger[_0x6fe7('0xe')]('ServicenowField,\x20%s,\x20%s,\x20%s',_0x267546,'request\x20sent',JSON['stringify'](_0x4f4186));if(_0x4f4186['error']){if(_0x4f4186[_0x6fe7('0xf')][_0x6fe7('0x10')]===0x1f4){logger[_0x6fe7('0xf')](_0x6fe7('0xc'),_0x267546,_0x4f4186['error'][_0x6fe7('0x11')]);return _0x2baba9(_0x4f4186['error']['message']);}logger[_0x6fe7('0xf')](_0x6fe7('0xc'),_0x267546,_0x4f4186[_0x6fe7('0xf')][_0x6fe7('0x11')]);return _0x187f28(_0x4f4186[_0x6fe7('0xf')][_0x6fe7('0x11')]);}else{logger[_0x6fe7('0x12')](_0x6fe7('0xc'),_0x267546,_0x6fe7('0xd'));_0x187f28(_0x4f4186[_0x6fe7('0x13')][_0x6fe7('0x11')]);}})['catch'](function(_0x641d6a){logger[_0x6fe7('0xf')]('ServicenowField,\x20%s,\x20%s',_0x267546,_0x641d6a);_0x2baba9(_0x641d6a);});});} \ No newline at end of file +var _0x6ed4=['ServicenowField,\x20%s,\x20%s','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','info','request\x20sent','debug','ServicenowField,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0xf114e6,_0x55edb9){var _0x34e7e7=function(_0x1c9c65){while(--_0x1c9c65){_0xf114e6['push'](_0xf114e6['shift']());}};_0x34e7e7(++_0x55edb9);}(_0x6ed4,0x8e));var _0x46ed=function(_0x2f6129,_0x3c5b95){_0x2f6129=_0x2f6129-0x0;var _0xbf57ae=_0x6ed4[_0x2f6129];return _0xbf57ae;};'use strict';var _=require(_0x46ed('0x0'));var util=require(_0x46ed('0x1'));var moment=require(_0x46ed('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x46ed('0x3'));var db=require(_0x46ed('0x4'))['db'];var utils=require(_0x46ed('0x5'));var logger=require(_0x46ed('0x6'))(_0x46ed('0x7'));var config=require('../../config/environment');var jayson=require(_0x46ed('0x8'));var client=jayson[_0x46ed('0x9')][_0x46ed('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2393f4,_0x2bf1bd,_0x12663c){return new BPromise(function(_0x475c4f,_0x866349){return client['request'](_0x2393f4,_0x12663c)[_0x46ed('0xb')](function(_0x2b778a){logger[_0x46ed('0xc')]('ServicenowField,\x20%s,\x20%s',_0x2bf1bd,_0x46ed('0xd'));logger[_0x46ed('0xe')](_0x46ed('0xf'),_0x2bf1bd,_0x46ed('0xd'),JSON[_0x46ed('0x10')](_0x2b778a));if(_0x2b778a[_0x46ed('0x11')]){if(_0x2b778a['error'][_0x46ed('0x12')]===0x1f4){logger[_0x46ed('0x11')](_0x46ed('0x13'),_0x2bf1bd,_0x2b778a[_0x46ed('0x11')][_0x46ed('0x14')]);return _0x866349(_0x2b778a[_0x46ed('0x11')]['message']);}logger['error'](_0x46ed('0x13'),_0x2bf1bd,_0x2b778a[_0x46ed('0x11')][_0x46ed('0x14')]);return _0x475c4f(_0x2b778a[_0x46ed('0x11')][_0x46ed('0x14')]);}else{logger[_0x46ed('0xc')]('ServicenowField,\x20%s,\x20%s',_0x2bf1bd,'request\x20sent');_0x475c4f(_0x2b778a[_0x46ed('0x15')][_0x46ed('0x14')]);}})[_0x46ed('0x16')](function(_0x2a94ec){logger[_0x46ed('0x11')](_0x46ed('0x13'),_0x2bf1bd,_0x2a94ec);_0x866349(_0x2a94ec);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/index.js b/server/api/intSugarcrmAccount/index.js index 9813b01..0a0ec01 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 _0xd19d=['post','create','/:id/configurations','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./intSugarcrmAccount.controller','get','/:id','isAuthenticated','getFields'];(function(_0x25ff02,_0x41089f){var _0x21e45e=function(_0x327d83){while(--_0x327d83){_0x25ff02['push'](_0x25ff02['shift']());}};_0x21e45e(++_0x41089f);}(_0xd19d,0x1ab));var _0xdd19=function(_0x2378ce,_0x1ae0fb){_0x2378ce=_0x2378ce-0x0;var _0x18cfa8=_0xd19d[_0x2378ce];return _0x18cfa8;};'use strict';var multer=require(_0xdd19('0x0'));var util=require(_0xdd19('0x1'));var path=require(_0xdd19('0x2'));var timeout=require(_0xdd19('0x3'));var express=require(_0xdd19('0x4'));var router=express[_0xdd19('0x5')]();var auth=require(_0xdd19('0x6'));var interaction=require(_0xdd19('0x7'));var config=require('../../config/environment');var controller=require(_0xdd19('0x8'));router[_0xdd19('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0xdd19('0x9')](_0xdd19('0xa'),auth[_0xdd19('0xb')](),controller['show']);router[_0xdd19('0x9')]('/:id/configurations',auth[_0xdd19('0xb')](),controller['getConfigurations']);router['get']('/:id/fields',auth['isAuthenticated'](),controller[_0xdd19('0xc')]);router[_0xdd19('0xd')]('/',auth[_0xdd19('0xb')](),controller[_0xdd19('0xe')]);router[_0xdd19('0xd')](_0xdd19('0xf'),auth['isAuthenticated'](),controller['addConfiguration']);router[_0xdd19('0x10')]('/:id',auth[_0xdd19('0xb')](),controller[_0xdd19('0x11')]);router[_0xdd19('0x12')](_0xdd19('0xa'),auth[_0xdd19('0xb')](),controller['destroy']);module[_0xdd19('0x13')]=router; \ No newline at end of file +var _0x26e5=['get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./intSugarcrmAccount.controller'];(function(_0x10fe39,_0x563265){var _0x13b0e3=function(_0x30d195){while(--_0x30d195){_0x10fe39['push'](_0x10fe39['shift']());}};_0x13b0e3(++_0x563265);}(_0x26e5,0x10a));var _0x526e=function(_0x143cfd,_0x1a336e){_0x143cfd=_0x143cfd-0x0;var _0x2cb5f5=_0x26e5[_0x143cfd];return _0x2cb5f5;};'use strict';var multer=require(_0x526e('0x0'));var util=require(_0x526e('0x1'));var path=require(_0x526e('0x2'));var timeout=require(_0x526e('0x3'));var express=require(_0x526e('0x4'));var router=express[_0x526e('0x5')]();var auth=require(_0x526e('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x526e('0x7'));var controller=require(_0x526e('0x8'));router[_0x526e('0x9')]('/',auth[_0x526e('0xa')](),controller[_0x526e('0xb')]);router[_0x526e('0x9')](_0x526e('0xc'),auth[_0x526e('0xa')](),controller[_0x526e('0xd')]);router[_0x526e('0x9')](_0x526e('0xe'),auth[_0x526e('0xa')](),controller[_0x526e('0xf')]);router[_0x526e('0x9')](_0x526e('0x10'),auth['isAuthenticated'](),controller['getFields']);router[_0x526e('0x11')]('/',auth['isAuthenticated'](),controller[_0x526e('0x12')]);router['post'](_0x526e('0xe'),auth['isAuthenticated'](),controller[_0x526e('0x13')]);router[_0x526e('0x14')](_0x526e('0xc'),auth[_0x526e('0xa')](),controller[_0x526e('0x15')]);router[_0x526e('0x16')](_0x526e('0xc'),auth[_0x526e('0xa')](),controller[_0x526e('0x17')]);module[_0x526e('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 8fa121f..7499a80 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 _0x98a8=['sequelize','exports','STRING','username','remoteUri'];(function(_0x54ab12,_0x28a7d2){var _0x57f1aa=function(_0x41b67f){while(--_0x41b67f){_0x54ab12['push'](_0x54ab12['shift']());}};_0x57f1aa(++_0x28a7d2);}(_0x98a8,0x12c));var _0x898a=function(_0x5abbc0,_0x21c858){_0x5abbc0=_0x5abbc0-0x0;var _0x3c2057=_0x98a8[_0x5abbc0];return _0x3c2057;};'use strict';var Sequelize=require(_0x898a('0x0'));module[_0x898a('0x1')]={'name':{'type':Sequelize[_0x898a('0x2')]},'description':{'type':Sequelize[_0x898a('0x2')]},'username':{'type':Sequelize[_0x898a('0x2')],'unique':_0x898a('0x3')},'password':{'type':Sequelize[_0x898a('0x2')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0x898a('0x4')},'serverUrl':{'type':Sequelize[_0x898a('0x2')]}}; \ No newline at end of file +var _0xcddd=['username','remoteUri','sequelize','exports','STRING'];(function(_0x46428c,_0x20ab75){var _0x16a677=function(_0x2b0817){while(--_0x2b0817){_0x46428c['push'](_0x46428c['shift']());}};_0x16a677(++_0x20ab75);}(_0xcddd,0x1a1));var _0xdcdd=function(_0x1a73d5,_0x22b6b7){_0x1a73d5=_0x1a73d5-0x0;var _0x305788=_0xcddd[_0x1a73d5];return _0x305788;};'use strict';var Sequelize=require(_0xdcdd('0x0'));module[_0xdcdd('0x1')]={'name':{'type':Sequelize[_0xdcdd('0x2')]},'description':{'type':Sequelize[_0xdcdd('0x2')]},'username':{'type':Sequelize[_0xdcdd('0x2')],'unique':_0xdcdd('0x3')},'password':{'type':Sequelize[_0xdcdd('0x2')]},'remoteUri':{'type':Sequelize[_0xdcdd('0x2')],'unique':_0xdcdd('0x4')},'serverUrl':{'type':Sequelize[_0xdcdd('0x2')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.controller.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.controller.js index d9f4f60..121f988 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 _0xac4f=['getConfigurations','findOne','SugarcrmConfiguration','pick','getSubjects','channel','type','Descriptions','SugarcrmField','assigned_user_id','created_by','date_start','duration_hours','duration_minutes','parent_id','direction','username','password','remoteUri','slice','substring','lastIndexOf','POST','%s%s','/service/v4_1/rest.php','login','JSON','PLAIN','xCALLY\x20Motion\x20Integration','Invalid\x20Login','Password\x20Expired','format','get_module_fields','values','includes','label','endsWith','map','value','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','statusCode','html-pdf','rimraf','fast-json-patch','bluebird','mustache','path','sox','to-csv','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','../../components/integrations/configuration','client','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','status','end','json','offset','set','apply','reject','save','destroy','sendStatus','stack','name','send','index','SugarcrmAccount','rawAttributes','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','filter','merge','key','field','options','count','includeAll','include','findAll','catch','show','params','create','body','find'];(function(_0x13992d,_0x3029ea){var _0x3d15bf=function(_0x3444f7){while(--_0x3444f7){_0x13992d['push'](_0x13992d['shift']());}};_0x3d15bf(++_0x3029ea);}(_0xac4f,0x122));var _0xfac4=function(_0x2390bd,_0x212fbd){_0x2390bd=_0x2390bd-0x0;var _0x3a969d=_0xac4f[_0x2390bd];return _0x3a969d;};'use strict';var pdf=require(_0xfac4('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xfac4('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xfac4('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xfac4('0x3'));var Mustache=require(_0xfac4('0x4'));var util=require('util');var path=require(_0xfac4('0x5'));var sox=require(_0xfac4('0x6'));var csv=require(_0xfac4('0x7'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xfac4('0x8'));var squel=require(_0xfac4('0x9'));var crypto=require(_0xfac4('0xa'));var jsforce=require(_0xfac4('0xb'));var deskjs=require(_0xfac4('0xc'));var toCsv=require(_0xfac4('0x7'));var querystring=require('querystring');var Papa=require(_0xfac4('0xd'));var Redis=require(_0xfac4('0xe'));var authService=require(_0xfac4('0xf'));var qs=require(_0xfac4('0x10'));var as=require(_0xfac4('0x11'));var hardwareService=require(_0xfac4('0x12'));var logger=require(_0xfac4('0x13'))(_0xfac4('0x14'));var utils=require(_0xfac4('0x15'));var config=require(_0xfac4('0x16'));var db=require(_0xfac4('0x17'))['db'];var integrations=require(_0xfac4('0x18'));var jayson=require('jayson/promise');var client=jayson[_0xfac4('0x19')]['http']({'port':0x232a});function checkPasswordPattern(_0x3fc3f8,_0x351dc8,_0x2ba0d1){if(_0x2ba0d1){var _0x4599cc=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4599cc[_0xfac4('0x1a')](_0x351dc8)){return _0x3fc3f8;}else{throw new Error(_0xfac4('0x1b'));}}else{return _0x3fc3f8;}}function respondWithRpcPromise(_0x3346f7,_0x158fba,_0x48a42b,_0x3d529f){return new BPromise(function(_0x40fe62,_0x3be3c1){var _0xcf7e40=_0x3d529f||client;return _0xcf7e40[_0xfac4('0x1c')](_0x3346f7,_0x48a42b)[_0xfac4('0x1d')](function(_0x1f77f9){logger[_0xfac4('0x1e')](_0xfac4('0x1f'),_0x158fba,'request\x20sent');logger['debug']('SugarcrmAccount,\x20%s,\x20%s,\x20%s',_0x158fba,_0xfac4('0x20'),JSON[_0xfac4('0x21')](_0x1f77f9));if(_0x1f77f9['error']){if(_0x1f77f9['error']['code']===0x1f4){logger[_0xfac4('0x22')](_0xfac4('0x1f'),_0x158fba,_0x1f77f9['error'][_0xfac4('0x23')]);return _0x3be3c1(_0x1f77f9[_0xfac4('0x22')][_0xfac4('0x23')]);}logger[_0xfac4('0x22')](_0xfac4('0x1f'),_0x158fba,_0x1f77f9[_0xfac4('0x22')][_0xfac4('0x23')]);return _0x40fe62(_0x1f77f9[_0xfac4('0x22')][_0xfac4('0x23')]);}else{logger[_0xfac4('0x1e')](_0xfac4('0x1f'),_0x158fba,'request\x20sent');_0x40fe62(_0x1f77f9[_0xfac4('0x24')][_0xfac4('0x23')]);}})['catch'](function(_0x410602){logger[_0xfac4('0x22')](_0xfac4('0x1f'),_0x158fba,_0x410602);_0x3be3c1(_0x410602);});});}function respondWithStatusCode(_0x4e32d4,_0x44d637){_0x44d637=_0x44d637||0xcc;return function(_0x8e5686){if(_0x8e5686){return _0x4e32d4['sendStatus'](_0x44d637);}return _0x4e32d4[_0xfac4('0x25')](_0x44d637)[_0xfac4('0x26')]();};}function respondWithResult(_0x395754,_0x3b54e4){_0x3b54e4=_0x3b54e4||0xc8;return function(_0x62c6bd){if(_0x62c6bd){return _0x395754['status'](_0x3b54e4)[_0xfac4('0x27')](_0x62c6bd);}};}function respondWithFilteredResult(_0x544f82,_0x299cca){return function(_0x254dfa){if(_0x254dfa){var _0x549306=_0x254dfa['count'],_0x10eb97=_0x299cca['offset'],_0x4bf01e=_0x299cca[_0xfac4('0x28')]+_0x299cca['limit'],_0xe6e21c;if(_0x4bf01e>=_0x549306){_0x4bf01e=_0x549306;_0xe6e21c=0xc8;}else{_0xe6e21c=0xce;}_0x544f82[_0xfac4('0x25')](_0xe6e21c);return _0x544f82[_0xfac4('0x29')]('Content-Range',_0x10eb97+'-'+_0x4bf01e+'/'+_0x549306)['json'](_0x254dfa);}return null;};}function patchUpdates(_0xec16da){return function(_0x5e2216){try{jsonpatch[_0xfac4('0x2a')](_0x5e2216,_0xec16da,!![]);}catch(_0x347bfa){return BPromise[_0xfac4('0x2b')](_0x347bfa);}return _0x5e2216[_0xfac4('0x2c')]();};}function saveUpdates(_0x3ec43a,_0x30c385){return function(_0x5bc86d){if(_0x5bc86d){return _0x5bc86d['update'](_0x3ec43a)[_0xfac4('0x1d')](function(_0x4776db){return _0x4776db;});}return null;};}function removeEntity(_0x287031,_0x3de475){return function(_0xc7e93b){if(_0xc7e93b){return _0xc7e93b[_0xfac4('0x2d')]()[_0xfac4('0x1d')](function(){_0x287031[_0xfac4('0x25')](0xcc)[_0xfac4('0x26')]();});}};}function handleEntityNotFound(_0xaaecf1,_0x4ea83c){return function(_0x4a92d4){if(!_0x4a92d4){_0xaaecf1[_0xfac4('0x2e')](0x194);}return _0x4a92d4;};}function handleError(_0x80d4c4,_0x36b74e){_0x36b74e=_0x36b74e||0x1f4;return function(_0x41b0a9){logger[_0xfac4('0x22')](_0x41b0a9[_0xfac4('0x2f')]);if(_0x41b0a9[_0xfac4('0x30')]){delete _0x41b0a9[_0xfac4('0x30')];}_0x80d4c4[_0xfac4('0x25')](_0x36b74e)[_0xfac4('0x31')](_0x41b0a9);};}exports[_0xfac4('0x32')]=function(_0x4730df,_0x4fbcac){var _0x3e944d={},_0x150733={},_0x77e32d={'count':0x0,'rows':[]};var _0x9d758f=db[_0xfac4('0x33')][_0xfac4('0x34')];_0x150733['model']=_['keys'](_0x9d758f);_0x150733[_0xfac4('0x35')]=_[_0xfac4('0x36')](_0x4730df[_0xfac4('0x35')]);_0x150733['filters']=_[_0xfac4('0x37')](_0x150733[_0xfac4('0x38')],_0x150733[_0xfac4('0x35')]);_0x3e944d[_0xfac4('0x39')]=_[_0xfac4('0x37')](_0x150733['model'],qs[_0xfac4('0x3a')](_0x4730df[_0xfac4('0x35')][_0xfac4('0x3a')]));_0x3e944d[_0xfac4('0x39')]=_0x3e944d[_0xfac4('0x39')][_0xfac4('0x3b')]?_0x3e944d[_0xfac4('0x39')]:_0x150733[_0xfac4('0x38')];if(!_0x4730df['query'][_0xfac4('0x3c')](_0xfac4('0x3d'))){_0x3e944d[_0xfac4('0x3e')]=qs[_0xfac4('0x3e')](_0x4730df[_0xfac4('0x35')][_0xfac4('0x3e')]);_0x3e944d[_0xfac4('0x28')]=qs[_0xfac4('0x28')](_0x4730df[_0xfac4('0x35')][_0xfac4('0x28')]);}_0x3e944d[_0xfac4('0x3f')]=qs[_0xfac4('0x40')](_0x4730df[_0xfac4('0x35')][_0xfac4('0x40')]);_0x3e944d[_0xfac4('0x41')]=qs['filters'](_['pick'](_0x4730df['query'],_0x150733[_0xfac4('0x42')]));if(_0x4730df[_0xfac4('0x35')][_0xfac4('0x43')]){_0x3e944d[_0xfac4('0x41')]=_[_0xfac4('0x44')](_0x3e944d[_0xfac4('0x41')],{'$or':_['map'](_0x9d758f,function(_0x5524a3){if(_0x5524a3['type'][_0xfac4('0x45')]!=='VIRTUAL'){var _0x68eb5a={};_0x68eb5a[_0x5524a3[_0xfac4('0x46')]]={'$like':'%'+_0x4730df[_0xfac4('0x35')][_0xfac4('0x43')]+'%'};return _0x68eb5a;}})});}_0x3e944d=_[_0xfac4('0x44')]({},_0x3e944d,_0x4730df[_0xfac4('0x47')]);var _0x8969bd={'where':_0x3e944d[_0xfac4('0x41')]};return db['SugarcrmAccount'][_0xfac4('0x48')](_0x8969bd)[_0xfac4('0x1d')](function(_0x4cb5bc){_0x77e32d[_0xfac4('0x48')]=_0x4cb5bc;if(_0x4730df['query'][_0xfac4('0x49')]){_0x3e944d[_0xfac4('0x4a')]=[{'all':!![]}];}return db[_0xfac4('0x33')][_0xfac4('0x4b')](_0x3e944d);})[_0xfac4('0x1d')](function(_0x5a8ff4){_0x77e32d['rows']=_0x5a8ff4;return _0x77e32d;})[_0xfac4('0x1d')](respondWithFilteredResult(_0x4fbcac,_0x3e944d))[_0xfac4('0x4c')](handleError(_0x4fbcac,null));};exports[_0xfac4('0x4d')]=function(_0x15064b,_0x559cea){var _0x274db6={'raw':![],'where':{'id':_0x15064b[_0xfac4('0x4e')]['id']}},_0xc3af21={};_0xc3af21['model']=_[_0xfac4('0x36')](db[_0xfac4('0x33')][_0xfac4('0x34')]);_0xc3af21[_0xfac4('0x35')]=_['keys'](_0x15064b[_0xfac4('0x35')]);_0xc3af21['filters']=_[_0xfac4('0x37')](_0xc3af21['model'],_0xc3af21[_0xfac4('0x35')]);_0x274db6[_0xfac4('0x39')]=_[_0xfac4('0x37')](_0xc3af21[_0xfac4('0x38')],qs['fields'](_0x15064b[_0xfac4('0x35')]['fields']));_0x274db6['attributes']=_0x274db6['attributes'][_0xfac4('0x3b')]?_0x274db6[_0xfac4('0x39')]:_0xc3af21[_0xfac4('0x38')];if(_0x15064b[_0xfac4('0x35')][_0xfac4('0x49')]){_0x274db6[_0xfac4('0x4a')]=[{'all':!![]}];}_0x274db6=_[_0xfac4('0x44')]({},_0x274db6,_0x15064b[_0xfac4('0x47')]);return db[_0xfac4('0x33')]['find'](_0x274db6)[_0xfac4('0x1d')](handleEntityNotFound(_0x559cea,null))[_0xfac4('0x1d')](respondWithResult(_0x559cea,null))[_0xfac4('0x4c')](handleError(_0x559cea,null));};exports[_0xfac4('0x4f')]=function(_0x57700a,_0x26e36f){return db[_0xfac4('0x33')][_0xfac4('0x4f')](_0x57700a[_0xfac4('0x50')],{})['then'](respondWithResult(_0x26e36f,0xc9))[_0xfac4('0x4c')](handleError(_0x26e36f,null));};exports['update']=function(_0x254488,_0x23c920){if(_0x254488[_0xfac4('0x50')]['id']){delete _0x254488['body']['id'];}return db[_0xfac4('0x33')][_0xfac4('0x51')]({'where':{'id':_0x254488[_0xfac4('0x4e')]['id']}})[_0xfac4('0x1d')](handleEntityNotFound(_0x23c920,null))[_0xfac4('0x1d')](saveUpdates(_0x254488[_0xfac4('0x50')],null))['then'](respondWithResult(_0x23c920,null))[_0xfac4('0x4c')](handleError(_0x23c920,null));};exports[_0xfac4('0x2d')]=function(_0x417ce4,_0x261943){return db[_0xfac4('0x33')][_0xfac4('0x51')]({'where':{'id':_0x417ce4[_0xfac4('0x4e')]['id']}})['then'](handleEntityNotFound(_0x261943,null))['then'](removeEntity(_0x261943,null))[_0xfac4('0x4c')](handleError(_0x261943,null));};exports[_0xfac4('0x52')]=function(_0xbecb90,_0x4e34e1,_0x4b2e55){var _0x3b0c74={};var _0x293080={};var _0x5a5384;var _0x5b8536;return db[_0xfac4('0x33')][_0xfac4('0x53')]({'where':{'id':_0xbecb90[_0xfac4('0x4e')]['id']}})[_0xfac4('0x1d')](handleEntityNotFound(_0x4e34e1,null))['then'](function(_0x2ac6cc){if(_0x2ac6cc){_0x5a5384=_0x2ac6cc;_0x293080[_0xfac4('0x38')]=_[_0xfac4('0x36')](db[_0xfac4('0x54')]['rawAttributes']);_0x293080[_0xfac4('0x35')]=_[_0xfac4('0x36')](_0xbecb90[_0xfac4('0x35')]);_0x293080[_0xfac4('0x42')]=_[_0xfac4('0x37')](_0x293080['model'],_0x293080['query']);_0x3b0c74['attributes']=_[_0xfac4('0x37')](_0x293080[_0xfac4('0x38')],qs[_0xfac4('0x3a')](_0xbecb90[_0xfac4('0x35')][_0xfac4('0x3a')]));_0x3b0c74['attributes']=_0x3b0c74['attributes'][_0xfac4('0x3b')]?_0x3b0c74[_0xfac4('0x39')]:_0x293080['model'];_0x3b0c74[_0xfac4('0x3f')]=qs[_0xfac4('0x40')](_0xbecb90[_0xfac4('0x35')][_0xfac4('0x40')]);_0x3b0c74[_0xfac4('0x41')]=qs[_0xfac4('0x42')](_[_0xfac4('0x55')](_0xbecb90[_0xfac4('0x35')],_0x293080[_0xfac4('0x42')]));if(_0xbecb90[_0xfac4('0x35')]['filter']){_0x3b0c74[_0xfac4('0x41')]=_['merge'](_0x3b0c74['where'],{'$or':_['map'](_0x3b0c74[_0xfac4('0x39')],function(_0x136bca){var _0x1dacb2={};_0x1dacb2[_0x136bca]={'$like':'%'+_0xbecb90[_0xfac4('0x35')][_0xfac4('0x43')]+'%'};return _0x1dacb2;})});}_0x3b0c74=_[_0xfac4('0x44')]({},_0x3b0c74,_0xbecb90[_0xfac4('0x47')]);return _0x5a5384[_0xfac4('0x52')](_0x3b0c74);}})[_0xfac4('0x1d')](function(_0x5aeae9){if(_0x5aeae9){_0x5b8536=_0x5aeae9[_0xfac4('0x3b')];if(!_0xbecb90[_0xfac4('0x35')]['hasOwnProperty'](_0xfac4('0x3d'))){_0x3b0c74[_0xfac4('0x3e')]=qs['limit'](_0xbecb90['query'][_0xfac4('0x3e')]);_0x3b0c74[_0xfac4('0x28')]=qs[_0xfac4('0x28')](_0xbecb90['query']['offset']);}return _0x5a5384[_0xfac4('0x52')](_0x3b0c74);}})[_0xfac4('0x1d')](function(_0x4d8706){if(_0x4d8706){return _0x4d8706?{'count':_0x5b8536,'rows':_0x4d8706}:null;}})[_0xfac4('0x1d')](respondWithResult(_0x4e34e1,null))[_0xfac4('0x4c')](handleError(_0x4e34e1,null));};exports['addConfiguration']=function(_0x42ad0e,_0x870399,_0x58d32c){if(_0x42ad0e[_0xfac4('0x50')]['id']){delete _0x42ad0e[_0xfac4('0x50')]['id'];}return db['SugarcrmAccount'][_0xfac4('0x53')]({'where':{'id':_0x42ad0e[_0xfac4('0x4e')]['id']}})[_0xfac4('0x1d')](handleEntityNotFound(_0x870399,null))[_0xfac4('0x1d')](function(_0x2eb826){if(_0x2eb826){_0x42ad0e[_0xfac4('0x50')]['AccountId']=_0x2eb826['id'];_0x42ad0e[_0xfac4('0x50')]['Subjects']=integrations[_0xfac4('0x56')](_0x42ad0e['body'][_0xfac4('0x57')],_0x42ad0e[_0xfac4('0x50')][_0xfac4('0x58')]);_0x42ad0e[_0xfac4('0x50')][_0xfac4('0x59')]=integrations['getDescriptions'](_0x42ad0e[_0xfac4('0x50')][_0xfac4('0x57')],_0x42ad0e[_0xfac4('0x50')][_0xfac4('0x58')]);return db[_0xfac4('0x54')][_0xfac4('0x4f')](_0x42ad0e[_0xfac4('0x50')],{'include':[{'model':db[_0xfac4('0x5a')],'as':'Subjects'},{'model':db[_0xfac4('0x5a')],'as':_0xfac4('0x59')}]});}return null;})[_0xfac4('0x1d')](respondWithResult(_0x870399,null))[_0xfac4('0x4c')](handleError(_0x870399,null));};exports['getFields']=function(_0x10d96d,_0xaa109c,_0x3fe709){var _0x4b4040='';var _0xa78b47=['id','name',_0xfac4('0x5b'),_0xfac4('0x5c'),'description',_0xfac4('0x5d'),_0xfac4('0x5e'),_0xfac4('0x5f'),_0xfac4('0x60'),'parent_type','parent_name',_0xfac4('0x61')];return db[_0xfac4('0x33')][_0xfac4('0x53')]({'where':{'id':_0x10d96d[_0xfac4('0x4e')]['id']},'attributes':['id',_0xfac4('0x62'),_0xfac4('0x63'),_0xfac4('0x64')]})[_0xfac4('0x1d')](handleEntityNotFound(_0xaa109c,null))[_0xfac4('0x1d')](function(_0x228c27){if(_0x228c27){_0x4b4040=_0x228c27[_0xfac4('0x64')];var _0x388a12=_0x4b4040[_0xfac4('0x65')](-0x1);if(_0x388a12==='/'){_0x4b4040=_0x4b4040[_0xfac4('0x66')](0x0,_0x4b4040[_0xfac4('0x67')](_0x388a12));}return rp({'method':_0xfac4('0x68'),'uri':util['format'](_0xfac4('0x69'),_0x4b4040,_0xfac4('0x6a')),'json':!![],'form':{'method':_0xfac4('0x6b'),'input_type':_0xfac4('0x6c'),'response_type':_0xfac4('0x6c'),'rest_data':JSON['stringify']({'user_auth':{'user_name':_0x228c27[_0xfac4('0x62')],'password':_0x228c27[_0xfac4('0x63')],'encryption':_0xfac4('0x6d')},'application':_0xfac4('0x6e')})}});}})[_0xfac4('0x1d')](function(_0x21d390){if(_0x21d390&&_0x21d390[_0xfac4('0x30')]!==_0xfac4('0x6f')&&_0x21d390[_0xfac4('0x30')]!==_0xfac4('0x70')){return rp({'method':_0xfac4('0x68'),'uri':util[_0xfac4('0x71')](_0xfac4('0x69'),_0x4b4040,_0xfac4('0x6a')),'json':!![],'form':{'method':_0xfac4('0x72'),'input_type':_0xfac4('0x6c'),'response_type':'JSON','rest_data':JSON['stringify']({'session':_0x21d390['id'],'module_name':'Calls'})}})[_0xfac4('0x1d')](function(_0x2806ed){if(_0x2806ed){var _0x3ef4cd=_[_0xfac4('0x73')](_0x2806ed['module_fields']);_['remove'](_0x3ef4cd,function(_0x16452e){return _0xa78b47[_0xfac4('0x74')](_0x16452e['name']);});return{'count':_0x3ef4cd[_0xfac4('0x3b')],'rows':_['map'](_0x3ef4cd,function(_0x4a5181){return{'id':_0x4a5181[_0xfac4('0x30')],'name':_0x4a5181[_0xfac4('0x75')],'custom':_[_0xfac4('0x76')](_0x4a5181[_0xfac4('0x30')],'_c')?!![]:![],'options':_0x4a5181[_0xfac4('0x47')]?_[_0xfac4('0x77')](_[_0xfac4('0x73')](_0x4a5181['options']),function(_0x54c56a){return{'name':_0x54c56a[_0xfac4('0x78')],'value':_0x54c56a[_0xfac4('0x30')]};}):[]};})};}})['then'](respondWithResult(_0xaa109c,null))[_0xfac4('0x4c')](function(_0x5d710a){var _0x1bf9b4=_0x10d96d[_0xfac4('0x35')][_0xfac4('0x1a')]?0x1f4:_0x5d710a['statusCode']||0x1f4;logger['error'](_0xfac4('0x79'),'getFields',_0x1bf9b4,JSON[_0xfac4('0x21')](_0x5d710a));delete _0x5d710a[_0xfac4('0x30')];if(_0x1bf9b4===0x191){_0x1bf9b4=0x190;}_0xaa109c[_0xfac4('0x25')](_0x1bf9b4)[_0xfac4('0x31')](_0x10d96d[_0xfac4('0x35')][_0xfac4('0x1a')]?{'message':_0xfac4('0x7a'),'statusCode':_0x5d710a[_0xfac4('0x7b')]}:_0x5d710a);});}else{var _0x442720=0x1f4;_0xaa109c[_0xfac4('0x25')](_0x442720)[_0xfac4('0x31')]({'message':_0xfac4('0x7a'),'statusCode':0x190});}});}; \ No newline at end of file +var _0x9485=['Password\x20Expired','get_module_fields','values','remove','endsWith','value','statusCode','send','Wrong\x20credentials','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','crypto','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','request\x20sent','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','SugarcrmAccount,\x20%s,\x20%s','message','info','result','catch','sendStatus','status','count','offset','limit','Content-Range','json','reject','save','update','destroy','end','stack','name','index','SugarcrmAccount','rawAttributes','model','keys','query','attributes','intersection','fields','hasOwnProperty','order','sort','where','pick','filters','filter','merge','map','type','VIRTUAL','field','options','include','findAll','rows','show','params','length','includeAll','find','create','body','getConfigurations','findOne','SugarcrmConfiguration','nolimit','addConfiguration','channel','Descriptions','getDescriptions','SugarcrmField','getFields','created_by','description','date_start','duration_hours','duration_minutes','parent_id','parent_type','parent_name','direction','username','password','remoteUri','slice','substring','POST','format','%s%s','/service/v4_1/rest.php','login','JSON','PLAIN','Invalid\x20Login'];(function(_0xfe9c33,_0x4f0ef5){var _0x2faa99=function(_0x48d8a5){while(--_0x48d8a5){_0xfe9c33['push'](_0xfe9c33['shift']());}};_0x2faa99(++_0x4f0ef5);}(_0x9485,0x8b));var _0x5948=function(_0xcbfc87,_0x5e594c){_0xcbfc87=_0xcbfc87-0x0;var _0x5bd4fe=_0x9485[_0xcbfc87];return _0x5bd4fe;};'use strict';var pdf=require(_0x5948('0x0'));var emlformat=require(_0x5948('0x1'));var rimraf=require(_0x5948('0x2'));var zipdir=require(_0x5948('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5948('0x4'));var moment=require(_0x5948('0x5'));var BPromise=require(_0x5948('0x6'));var Mustache=require('mustache');var util=require(_0x5948('0x7'));var path=require(_0x5948('0x8'));var sox=require(_0x5948('0x9'));var csv=require(_0x5948('0xa'));var ejs=require(_0x5948('0xb'));var fs=require('fs');var _=require(_0x5948('0xc'));var squel=require('squel');var crypto=require(_0x5948('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x5948('0xe'));var toCsv=require(_0x5948('0xa'));var querystring=require('querystring');var Papa=require(_0x5948('0xf'));var Redis=require(_0x5948('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x5948('0x11'));var as=require(_0x5948('0x12'));var hardwareService=require(_0x5948('0x13'));var logger=require(_0x5948('0x14'))(_0x5948('0x15'));var utils=require(_0x5948('0x16'));var config=require(_0x5948('0x17'));var db=require(_0x5948('0x18'))['db'];var integrations=require(_0x5948('0x19'));var jayson=require(_0x5948('0x1a'));var client=jayson[_0x5948('0x1b')]['http']({'port':0x232a});function checkPasswordPattern(_0x2592df,_0x13654a,_0x1028a6){if(_0x1028a6){var _0x23a656=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x23a656[_0x5948('0x1c')](_0x13654a)){return _0x2592df;}else{throw new Error(_0x5948('0x1d'));}}else{return _0x2592df;}}function respondWithRpcPromise(_0x28b4f3,_0x36fd89,_0x4691fc,_0x3565df){return new BPromise(function(_0x281324,_0x203968){var _0x1cc566=_0x3565df||client;return _0x1cc566[_0x5948('0x1e')](_0x28b4f3,_0x4691fc)[_0x5948('0x1f')](function(_0x4a1f4b){logger['info']('SugarcrmAccount,\x20%s,\x20%s',_0x36fd89,_0x5948('0x20'));logger[_0x5948('0x21')](_0x5948('0x22'),_0x36fd89,_0x5948('0x20'),JSON[_0x5948('0x23')](_0x4a1f4b));if(_0x4a1f4b[_0x5948('0x24')]){if(_0x4a1f4b['error'][_0x5948('0x25')]===0x1f4){logger[_0x5948('0x24')](_0x5948('0x26'),_0x36fd89,_0x4a1f4b[_0x5948('0x24')]['message']);return _0x203968(_0x4a1f4b[_0x5948('0x24')][_0x5948('0x27')]);}logger[_0x5948('0x24')](_0x5948('0x26'),_0x36fd89,_0x4a1f4b[_0x5948('0x24')][_0x5948('0x27')]);return _0x281324(_0x4a1f4b[_0x5948('0x24')][_0x5948('0x27')]);}else{logger[_0x5948('0x28')](_0x5948('0x26'),_0x36fd89,'request\x20sent');_0x281324(_0x4a1f4b[_0x5948('0x29')]['message']);}})[_0x5948('0x2a')](function(_0x15b8da){logger[_0x5948('0x24')](_0x5948('0x26'),_0x36fd89,_0x15b8da);_0x203968(_0x15b8da);});});}function respondWithStatusCode(_0x385821,_0x4164bf){_0x4164bf=_0x4164bf||0xcc;return function(_0x1db063){if(_0x1db063){return _0x385821[_0x5948('0x2b')](_0x4164bf);}return _0x385821['status'](_0x4164bf)['end']();};}function respondWithResult(_0x4a3c1b,_0x2a20c7){_0x2a20c7=_0x2a20c7||0xc8;return function(_0x37b4aa){if(_0x37b4aa){return _0x4a3c1b[_0x5948('0x2c')](_0x2a20c7)['json'](_0x37b4aa);}};}function respondWithFilteredResult(_0x4a9630,_0x45d99b){return function(_0x47b55e){if(_0x47b55e){var _0xc03d2c=_0x47b55e[_0x5948('0x2d')],_0x5e5ef3=_0x45d99b[_0x5948('0x2e')],_0x2d0a48=_0x45d99b[_0x5948('0x2e')]+_0x45d99b[_0x5948('0x2f')],_0x2d1f6c;if(_0x2d0a48>=_0xc03d2c){_0x2d0a48=_0xc03d2c;_0x2d1f6c=0xc8;}else{_0x2d1f6c=0xce;}_0x4a9630['status'](_0x2d1f6c);return _0x4a9630['set'](_0x5948('0x30'),_0x5e5ef3+'-'+_0x2d0a48+'/'+_0xc03d2c)[_0x5948('0x31')](_0x47b55e);}return null;};}function patchUpdates(_0x4a6740){return function(_0x4ff572){try{jsonpatch['apply'](_0x4ff572,_0x4a6740,!![]);}catch(_0x7a8012){return BPromise[_0x5948('0x32')](_0x7a8012);}return _0x4ff572[_0x5948('0x33')]();};}function saveUpdates(_0x1be3ea,_0x5e9200){return function(_0x5d111e){if(_0x5d111e){return _0x5d111e[_0x5948('0x34')](_0x1be3ea)['then'](function(_0x2b3d32){return _0x2b3d32;});}return null;};}function removeEntity(_0x4bfc45,_0x2010c1){return function(_0x326f50){if(_0x326f50){return _0x326f50[_0x5948('0x35')]()[_0x5948('0x1f')](function(){_0x4bfc45[_0x5948('0x2c')](0xcc)[_0x5948('0x36')]();});}};}function handleEntityNotFound(_0x22a437,_0x35b346){return function(_0x326018){if(!_0x326018){_0x22a437[_0x5948('0x2b')](0x194);}return _0x326018;};}function handleError(_0x528bed,_0x467f9e){_0x467f9e=_0x467f9e||0x1f4;return function(_0x15fd32){logger['error'](_0x15fd32[_0x5948('0x37')]);if(_0x15fd32['name']){delete _0x15fd32[_0x5948('0x38')];}_0x528bed[_0x5948('0x2c')](_0x467f9e)['send'](_0x15fd32);};}exports[_0x5948('0x39')]=function(_0x5e5537,_0x2402fe){var _0x4293dc={},_0x112a03={},_0x3a7b77={'count':0x0,'rows':[]};var _0x2bfb28=db[_0x5948('0x3a')][_0x5948('0x3b')];_0x112a03[_0x5948('0x3c')]=_[_0x5948('0x3d')](_0x2bfb28);_0x112a03[_0x5948('0x3e')]=_[_0x5948('0x3d')](_0x5e5537['query']);_0x112a03['filters']=_['intersection'](_0x112a03['model'],_0x112a03['query']);_0x4293dc[_0x5948('0x3f')]=_[_0x5948('0x40')](_0x112a03[_0x5948('0x3c')],qs['fields'](_0x5e5537[_0x5948('0x3e')][_0x5948('0x41')]));_0x4293dc['attributes']=_0x4293dc[_0x5948('0x3f')]['length']?_0x4293dc[_0x5948('0x3f')]:_0x112a03[_0x5948('0x3c')];if(!_0x5e5537[_0x5948('0x3e')][_0x5948('0x42')]('nolimit')){_0x4293dc[_0x5948('0x2f')]=qs['limit'](_0x5e5537[_0x5948('0x3e')][_0x5948('0x2f')]);_0x4293dc[_0x5948('0x2e')]=qs[_0x5948('0x2e')](_0x5e5537[_0x5948('0x3e')][_0x5948('0x2e')]);}_0x4293dc[_0x5948('0x43')]=qs[_0x5948('0x44')](_0x5e5537[_0x5948('0x3e')][_0x5948('0x44')]);_0x4293dc[_0x5948('0x45')]=qs['filters'](_[_0x5948('0x46')](_0x5e5537[_0x5948('0x3e')],_0x112a03[_0x5948('0x47')]));if(_0x5e5537[_0x5948('0x3e')][_0x5948('0x48')]){_0x4293dc[_0x5948('0x45')]=_[_0x5948('0x49')](_0x4293dc[_0x5948('0x45')],{'$or':_[_0x5948('0x4a')](_0x2bfb28,function(_0x389f24){if(_0x389f24[_0x5948('0x4b')]['key']!==_0x5948('0x4c')){var _0x27d43d={};_0x27d43d[_0x389f24[_0x5948('0x4d')]]={'$like':'%'+_0x5e5537[_0x5948('0x3e')]['filter']+'%'};return _0x27d43d;}})});}_0x4293dc=_['merge']({},_0x4293dc,_0x5e5537[_0x5948('0x4e')]);var _0x44cee1={'where':_0x4293dc['where']};return db[_0x5948('0x3a')]['count'](_0x44cee1)[_0x5948('0x1f')](function(_0x33a3d3){_0x3a7b77[_0x5948('0x2d')]=_0x33a3d3;if(_0x5e5537[_0x5948('0x3e')]['includeAll']){_0x4293dc[_0x5948('0x4f')]=[{'all':!![]}];}return db[_0x5948('0x3a')][_0x5948('0x50')](_0x4293dc);})['then'](function(_0x2407ea){_0x3a7b77[_0x5948('0x51')]=_0x2407ea;return _0x3a7b77;})['then'](respondWithFilteredResult(_0x2402fe,_0x4293dc))[_0x5948('0x2a')](handleError(_0x2402fe,null));};exports[_0x5948('0x52')]=function(_0x38c6ca,_0x128d84){var _0xef6d6d={'raw':![],'where':{'id':_0x38c6ca[_0x5948('0x53')]['id']}},_0x527e2a={};_0x527e2a['model']=_[_0x5948('0x3d')](db['SugarcrmAccount'][_0x5948('0x3b')]);_0x527e2a[_0x5948('0x3e')]=_[_0x5948('0x3d')](_0x38c6ca[_0x5948('0x3e')]);_0x527e2a[_0x5948('0x47')]=_[_0x5948('0x40')](_0x527e2a[_0x5948('0x3c')],_0x527e2a[_0x5948('0x3e')]);_0xef6d6d[_0x5948('0x3f')]=_[_0x5948('0x40')](_0x527e2a[_0x5948('0x3c')],qs[_0x5948('0x41')](_0x38c6ca[_0x5948('0x3e')][_0x5948('0x41')]));_0xef6d6d[_0x5948('0x3f')]=_0xef6d6d[_0x5948('0x3f')][_0x5948('0x54')]?_0xef6d6d[_0x5948('0x3f')]:_0x527e2a[_0x5948('0x3c')];if(_0x38c6ca[_0x5948('0x3e')][_0x5948('0x55')]){_0xef6d6d[_0x5948('0x4f')]=[{'all':!![]}];}_0xef6d6d=_[_0x5948('0x49')]({},_0xef6d6d,_0x38c6ca[_0x5948('0x4e')]);return db['SugarcrmAccount'][_0x5948('0x56')](_0xef6d6d)[_0x5948('0x1f')](handleEntityNotFound(_0x128d84,null))['then'](respondWithResult(_0x128d84,null))[_0x5948('0x2a')](handleError(_0x128d84,null));};exports['create']=function(_0x2856f9,_0x108534){return db['SugarcrmAccount'][_0x5948('0x57')](_0x2856f9[_0x5948('0x58')],{})['then'](respondWithResult(_0x108534,0xc9))[_0x5948('0x2a')](handleError(_0x108534,null));};exports[_0x5948('0x34')]=function(_0x215421,_0x281a74){if(_0x215421[_0x5948('0x58')]['id']){delete _0x215421[_0x5948('0x58')]['id'];}return db['SugarcrmAccount']['find']({'where':{'id':_0x215421[_0x5948('0x53')]['id']}})[_0x5948('0x1f')](handleEntityNotFound(_0x281a74,null))['then'](saveUpdates(_0x215421[_0x5948('0x58')],null))[_0x5948('0x1f')](respondWithResult(_0x281a74,null))['catch'](handleError(_0x281a74,null));};exports[_0x5948('0x35')]=function(_0x288239,_0xd8c023){return db[_0x5948('0x3a')]['find']({'where':{'id':_0x288239[_0x5948('0x53')]['id']}})[_0x5948('0x1f')](handleEntityNotFound(_0xd8c023,null))[_0x5948('0x1f')](removeEntity(_0xd8c023,null))[_0x5948('0x2a')](handleError(_0xd8c023,null));};exports[_0x5948('0x59')]=function(_0x5e3e04,_0x3ec2fa,_0x10c826){var _0x375976={};var _0x16184a={};var _0x243c2f;var _0x313670;return db[_0x5948('0x3a')][_0x5948('0x5a')]({'where':{'id':_0x5e3e04['params']['id']}})['then'](handleEntityNotFound(_0x3ec2fa,null))[_0x5948('0x1f')](function(_0x4c63ef){if(_0x4c63ef){_0x243c2f=_0x4c63ef;_0x16184a[_0x5948('0x3c')]=_['keys'](db[_0x5948('0x5b')][_0x5948('0x3b')]);_0x16184a[_0x5948('0x3e')]=_['keys'](_0x5e3e04[_0x5948('0x3e')]);_0x16184a[_0x5948('0x47')]=_[_0x5948('0x40')](_0x16184a['model'],_0x16184a[_0x5948('0x3e')]);_0x375976[_0x5948('0x3f')]=_['intersection'](_0x16184a[_0x5948('0x3c')],qs[_0x5948('0x41')](_0x5e3e04['query'][_0x5948('0x41')]));_0x375976[_0x5948('0x3f')]=_0x375976[_0x5948('0x3f')][_0x5948('0x54')]?_0x375976[_0x5948('0x3f')]:_0x16184a[_0x5948('0x3c')];_0x375976['order']=qs[_0x5948('0x44')](_0x5e3e04['query'][_0x5948('0x44')]);_0x375976[_0x5948('0x45')]=qs['filters'](_['pick'](_0x5e3e04['query'],_0x16184a['filters']));if(_0x5e3e04[_0x5948('0x3e')][_0x5948('0x48')]){_0x375976['where']=_[_0x5948('0x49')](_0x375976['where'],{'$or':_['map'](_0x375976[_0x5948('0x3f')],function(_0x728a83){var _0x38c3c1={};_0x38c3c1[_0x728a83]={'$like':'%'+_0x5e3e04[_0x5948('0x3e')][_0x5948('0x48')]+'%'};return _0x38c3c1;})});}_0x375976=_[_0x5948('0x49')]({},_0x375976,_0x5e3e04[_0x5948('0x4e')]);return _0x243c2f[_0x5948('0x59')](_0x375976);}})['then'](function(_0x36dfa8){if(_0x36dfa8){_0x313670=_0x36dfa8[_0x5948('0x54')];if(!_0x5e3e04['query']['hasOwnProperty'](_0x5948('0x5c'))){_0x375976['limit']=qs[_0x5948('0x2f')](_0x5e3e04[_0x5948('0x3e')][_0x5948('0x2f')]);_0x375976[_0x5948('0x2e')]=qs['offset'](_0x5e3e04['query']['offset']);}return _0x243c2f[_0x5948('0x59')](_0x375976);}})[_0x5948('0x1f')](function(_0x1a438a){if(_0x1a438a){return _0x1a438a?{'count':_0x313670,'rows':_0x1a438a}:null;}})[_0x5948('0x1f')](respondWithResult(_0x3ec2fa,null))[_0x5948('0x2a')](handleError(_0x3ec2fa,null));};exports[_0x5948('0x5d')]=function(_0x1f9350,_0x364c26,_0x1ceaab){if(_0x1f9350['body']['id']){delete _0x1f9350[_0x5948('0x58')]['id'];}return db[_0x5948('0x3a')][_0x5948('0x5a')]({'where':{'id':_0x1f9350['params']['id']}})[_0x5948('0x1f')](handleEntityNotFound(_0x364c26,null))['then'](function(_0xd8ae8c){if(_0xd8ae8c){_0x1f9350['body']['AccountId']=_0xd8ae8c['id'];_0x1f9350['body']['Subjects']=integrations['getSubjects'](_0x1f9350[_0x5948('0x58')][_0x5948('0x5e')],_0x1f9350[_0x5948('0x58')][_0x5948('0x4b')]);_0x1f9350[_0x5948('0x58')][_0x5948('0x5f')]=integrations[_0x5948('0x60')](_0x1f9350['body'][_0x5948('0x5e')],_0x1f9350[_0x5948('0x58')]['type']);return db[_0x5948('0x5b')][_0x5948('0x57')](_0x1f9350[_0x5948('0x58')],{'include':[{'model':db[_0x5948('0x61')],'as':'Subjects'},{'model':db[_0x5948('0x61')],'as':'Descriptions'}]});}return null;})[_0x5948('0x1f')](respondWithResult(_0x364c26,null))[_0x5948('0x2a')](handleError(_0x364c26,null));};exports[_0x5948('0x62')]=function(_0x4741cc,_0x24cf24,_0x5c8168){var _0x508181='';var _0xeb04b7=['id','name','assigned_user_id',_0x5948('0x63'),_0x5948('0x64'),_0x5948('0x65'),_0x5948('0x66'),_0x5948('0x67'),_0x5948('0x68'),_0x5948('0x69'),_0x5948('0x6a'),_0x5948('0x6b')];return db['SugarcrmAccount'][_0x5948('0x5a')]({'where':{'id':_0x4741cc[_0x5948('0x53')]['id']},'attributes':['id',_0x5948('0x6c'),_0x5948('0x6d'),_0x5948('0x6e')]})[_0x5948('0x1f')](handleEntityNotFound(_0x24cf24,null))[_0x5948('0x1f')](function(_0x406d56){if(_0x406d56){_0x508181=_0x406d56[_0x5948('0x6e')];var _0x5a37a0=_0x508181[_0x5948('0x6f')](-0x1);if(_0x5a37a0==='/'){_0x508181=_0x508181[_0x5948('0x70')](0x0,_0x508181['lastIndexOf'](_0x5a37a0));}return rp({'method':_0x5948('0x71'),'uri':util[_0x5948('0x72')](_0x5948('0x73'),_0x508181,_0x5948('0x74')),'json':!![],'form':{'method':_0x5948('0x75'),'input_type':'JSON','response_type':_0x5948('0x76'),'rest_data':JSON[_0x5948('0x23')]({'user_auth':{'user_name':_0x406d56[_0x5948('0x6c')],'password':_0x406d56[_0x5948('0x6d')],'encryption':_0x5948('0x77')},'application':'xCALLY\x20Motion\x20Integration'})}});}})[_0x5948('0x1f')](function(_0x39f3f9){if(_0x39f3f9&&_0x39f3f9[_0x5948('0x38')]!==_0x5948('0x78')&&_0x39f3f9[_0x5948('0x38')]!==_0x5948('0x79')){return rp({'method':'POST','uri':util[_0x5948('0x72')](_0x5948('0x73'),_0x508181,_0x5948('0x74')),'json':!![],'form':{'method':_0x5948('0x7a'),'input_type':_0x5948('0x76'),'response_type':_0x5948('0x76'),'rest_data':JSON[_0x5948('0x23')]({'session':_0x39f3f9['id'],'module_name':'Calls'})}})['then'](function(_0x84aadf){if(_0x84aadf){var _0xa9367f=_[_0x5948('0x7b')](_0x84aadf['module_fields']);_[_0x5948('0x7c')](_0xa9367f,function(_0xb504af){return _0xeb04b7['includes'](_0xb504af[_0x5948('0x38')]);});return{'count':_0xa9367f[_0x5948('0x54')],'rows':_['map'](_0xa9367f,function(_0x3da60c){return{'id':_0x3da60c['name'],'name':_0x3da60c['label'],'custom':_[_0x5948('0x7d')](_0x3da60c['name'],'_c')?!![]:![],'options':_0x3da60c[_0x5948('0x4e')]?_[_0x5948('0x4a')](_[_0x5948('0x7b')](_0x3da60c['options']),function(_0x483efa){return{'name':_0x483efa[_0x5948('0x7e')],'value':_0x483efa[_0x5948('0x38')]};}):[]};})};}})['then'](respondWithResult(_0x24cf24,null))[_0x5948('0x2a')](function(_0x564ed9){var _0x4634ac=_0x4741cc['query'][_0x5948('0x1c')]?0x1f4:_0x564ed9[_0x5948('0x7f')]||0x1f4;logger[_0x5948('0x24')]('getFields,\x20%s,\x20%s,\x20%s','getFields',_0x4634ac,JSON[_0x5948('0x23')](_0x564ed9));delete _0x564ed9[_0x5948('0x38')];if(_0x4634ac===0x191){_0x4634ac=0x190;}_0x24cf24['status'](_0x4634ac)[_0x5948('0x80')](_0x4741cc[_0x5948('0x3e')][_0x5948('0x1c')]?{'message':_0x5948('0x81'),'statusCode':_0x564ed9[_0x5948('0x7f')]}:_0x564ed9);});}else{var _0x475bfe=0x1f4;_0x24cf24[_0x5948('0x2c')](_0x475bfe)[_0x5948('0x80')]({'message':'Wrong\x20credentials','statusCode':0x190});}});}; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.model.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.model.js index 4c3fab1..5afe8de 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 _0xfc6b=['moment','bluebird','path','../../components/integrations/configuration','exports','define','SugarcrmAccount','int_sugarcrm_accounts','lodash','util','../../config/logger','api'];(function(_0x57141c,_0x325ae8){var _0x1fcef3=function(_0x28d5a1){while(--_0x28d5a1){_0x57141c['push'](_0x57141c['shift']());}};_0x1fcef3(++_0x325ae8);}(_0xfc6b,0x188));var _0xbfc6=function(_0x1812d5,_0xc5794e){_0x1812d5=_0x1812d5-0x0;var _0x53704f=_0xfc6b[_0x1812d5];return _0x53704f;};'use strict';var _=require(_0xbfc6('0x0'));var util=require(_0xbfc6('0x1'));var logger=require(_0xbfc6('0x2'))(_0xbfc6('0x3'));var moment=require(_0xbfc6('0x4'));var BPromise=require(_0xbfc6('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbfc6('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./intSugarcrmAccount.attributes');var integrations=require(_0xbfc6('0x7'));module[_0xbfc6('0x8')]=function(_0x46591d,_0x51db98){return _0x46591d[_0xbfc6('0x9')](_0xbfc6('0xa'),attributes,{'tableName':_0xbfc6('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc4c5=['lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intSugarcrmAccount.attributes','../../components/integrations/configuration','int_sugarcrm_accounts'];(function(_0x1294e4,_0x12daf3){var _0x4c30fe=function(_0x95a3a6){while(--_0x95a3a6){_0x1294e4['push'](_0x1294e4['shift']());}};_0x4c30fe(++_0x12daf3);}(_0xc4c5,0x1a4));var _0x5c4c=function(_0x4735b3,_0x28f9b1){_0x4735b3=_0x4735b3-0x0;var _0x2f89d9=_0xc4c5[_0x4735b3];return _0x2f89d9;};'use strict';var _=require(_0x5c4c('0x0'));var util=require(_0x5c4c('0x1'));var logger=require('../../config/logger')(_0x5c4c('0x2'));var moment=require(_0x5c4c('0x3'));var BPromise=require(_0x5c4c('0x4'));var rp=require(_0x5c4c('0x5'));var fs=require('fs');var path=require(_0x5c4c('0x6'));var rimraf=require(_0x5c4c('0x7'));var config=require(_0x5c4c('0x8'));var attributes=require(_0x5c4c('0x9'));var integrations=require(_0x5c4c('0xa'));module['exports']=function(_0x1f2734,_0x321763){return _0x1f2734['define']('SugarcrmAccount',attributes,{'tableName':_0x5c4c('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 c2e47b0..c8ad27a 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 _0x73e9=['GetSugarcrmAccount','ShowSugarcrmAccount','find','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','SugarcrmAccount','findAll','options','raw','where','attributes','limit','map','include','model','then','info'];(function(_0x13b52d,_0x83b67b){var _0x3fb2b1=function(_0x1724a9){while(--_0x1724a9){_0x13b52d['push'](_0x13b52d['shift']());}};_0x3fb2b1(++_0x83b67b);}(_0x73e9,0x16b));var _0x973e=function(_0x3d4a6b,_0x20dbcb){_0x3d4a6b=_0x3d4a6b-0x0;var _0x55d64a=_0x73e9[_0x3d4a6b];return _0x55d64a;};'use strict';var _=require(_0x973e('0x0'));var util=require(_0x973e('0x1'));var moment=require(_0x973e('0x2'));var BPromise=require(_0x973e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x973e('0x4'))['db'];var utils=require(_0x973e('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x973e('0x6'));var jayson=require(_0x973e('0x7'));var client=jayson[_0x973e('0x8')][_0x973e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3a35c4,_0x1cd460,_0x1eba22){return new BPromise(function(_0x475379,_0x554bc9){return client[_0x973e('0xa')](_0x3a35c4,_0x1eba22)['then'](function(_0x1e4d82){logger['info'](_0x973e('0xb'),_0x1cd460,_0x973e('0xc'));logger[_0x973e('0xd')](_0x973e('0xe'),_0x1cd460,_0x973e('0xc'),JSON[_0x973e('0xf')](_0x1e4d82));if(_0x1e4d82[_0x973e('0x10')]){if(_0x1e4d82['error'][_0x973e('0x11')]===0x1f4){logger[_0x973e('0x10')](_0x973e('0xb'),_0x1cd460,_0x1e4d82['error']['message']);return _0x554bc9(_0x1e4d82[_0x973e('0x10')][_0x973e('0x12')]);}logger['error'](_0x973e('0xb'),_0x1cd460,_0x1e4d82[_0x973e('0x10')]['message']);return _0x475379(_0x1e4d82[_0x973e('0x10')][_0x973e('0x12')]);}else{logger['info'](_0x973e('0xb'),_0x1cd460,_0x973e('0xc'));_0x475379(_0x1e4d82[_0x973e('0x13')][_0x973e('0x12')]);}})[_0x973e('0x14')](function(_0x51219e){logger['error']('SugarcrmAccount,\x20%s,\x20%s',_0x1cd460,_0x51219e);_0x554bc9(_0x51219e);});});}exports['GetSugarcrmAccount']=function(_0x50e9ba){var _0x122ea5=this;return new Promise(function(_0x38b930,_0x1ffc33){return db[_0x973e('0x15')][_0x973e('0x16')]({'raw':_0x50e9ba[_0x973e('0x17')]?_0x50e9ba[_0x973e('0x17')][_0x973e('0x18')]===undefined?!![]:![]:!![],'where':_0x50e9ba[_0x973e('0x17')]?_0x50e9ba[_0x973e('0x17')][_0x973e('0x19')]||null:null,'attributes':_0x50e9ba[_0x973e('0x17')]?_0x50e9ba[_0x973e('0x17')][_0x973e('0x1a')]||null:null,'limit':_0x50e9ba[_0x973e('0x17')]?_0x50e9ba[_0x973e('0x17')][_0x973e('0x1b')]||null:null,'include':_0x50e9ba[_0x973e('0x17')]?_0x50e9ba[_0x973e('0x17')]['include']?_[_0x973e('0x1c')](_0x50e9ba[_0x973e('0x17')][_0x973e('0x1d')],function(_0x1e220f){return{'model':db[_0x1e220f[_0x973e('0x1e')]],'as':_0x1e220f['as'],'attributes':_0x1e220f[_0x973e('0x1a')],'include':_0x1e220f['include']?_['map'](_0x1e220f['include'],function(_0x57d115){return{'model':db[_0x57d115['model']],'as':_0x57d115['as'],'attributes':_0x57d115[_0x973e('0x1a')],'include':_0x57d115[_0x973e('0x1d')]?_[_0x973e('0x1c')](_0x57d115[_0x973e('0x1d')],function(_0x1fd85f){return{'model':db[_0x1fd85f[_0x973e('0x1e')]],'as':_0x1fd85f['as'],'attributes':_0x1fd85f['attributes']};}):[]};}):[]};}):[]:[]})[_0x973e('0x1f')](function(_0x5f0fab){logger[_0x973e('0x20')](_0x973e('0x21'),_0x50e9ba);logger['debug'](_0x973e('0x21'),_0x50e9ba,JSON[_0x973e('0xf')](_0x5f0fab));_0x38b930(_0x5f0fab);})['catch'](function(_0x536bdc){logger[_0x973e('0x10')](_0x973e('0x21'),_0x536bdc[_0x973e('0x12')],_0x50e9ba);_0x1ffc33(_0x122ea5[_0x973e('0x10')](0x1f4,_0x536bdc[_0x973e('0x12')]));});});};exports[_0x973e('0x22')]=function(_0x53b930){var _0x378e81=this;return new Promise(function(_0x12c82c,_0x3b66f7){return db['SugarcrmAccount'][_0x973e('0x23')]({'raw':_0x53b930[_0x973e('0x17')]?_0x53b930[_0x973e('0x17')][_0x973e('0x18')]===undefined?!![]:![]:!![],'where':_0x53b930['options']?_0x53b930['options'][_0x973e('0x19')]||null:null,'attributes':_0x53b930['options']?_0x53b930['options'][_0x973e('0x1a')]||null:null,'include':_0x53b930[_0x973e('0x17')]?_0x53b930['options'][_0x973e('0x1d')]?_[_0x973e('0x1c')](_0x53b930[_0x973e('0x17')]['include'],function(_0x2854b7){return{'model':db[_0x2854b7[_0x973e('0x1e')]],'as':_0x2854b7['as'],'attributes':_0x2854b7[_0x973e('0x1a')],'include':_0x2854b7[_0x973e('0x1d')]?_['map'](_0x2854b7[_0x973e('0x1d')],function(_0x5a05f5){return{'model':db[_0x5a05f5[_0x973e('0x1e')]],'as':_0x5a05f5['as'],'attributes':_0x5a05f5['attributes'],'include':_0x5a05f5[_0x973e('0x1d')]?_[_0x973e('0x1c')](_0x5a05f5['include'],function(_0xc23428){return{'model':db[_0xc23428[_0x973e('0x1e')]],'as':_0xc23428['as'],'attributes':_0xc23428[_0x973e('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x973e('0x1f')](function(_0x1201b9){logger['info'](_0x973e('0x22'),_0x53b930);logger[_0x973e('0xd')](_0x973e('0x22'),_0x53b930,JSON[_0x973e('0xf')](_0x1201b9));_0x12c82c(_0x1201b9);})['catch'](function(_0xd701f2){logger[_0x973e('0x10')](_0x973e('0x22'),_0xd701f2[_0x973e('0x12')],_0x53b930);_0x3b66f7(_0x378e81[_0x973e('0x10')](0x1f4,_0xd701f2[_0x973e('0x12')]));});});}; \ No newline at end of file +var _0xc1ac=['message','catch','GetSugarcrmAccount','findAll','options','where','attributes','limit','include','model','map','debug','ShowSugarcrmAccount','find','raw','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','info','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','SugarcrmAccount,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x25dbc0,_0x308356){var _0x5d67f6=function(_0x108e83){while(--_0x108e83){_0x25dbc0['push'](_0x25dbc0['shift']());}};_0x5d67f6(++_0x308356);}(_0xc1ac,0x163));var _0xcc1a=function(_0x5638ad,_0xb83c75){_0x5638ad=_0x5638ad-0x0;var _0x2f51b9=_0xc1ac[_0x5638ad];return _0x2f51b9;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xcc1a('0x0'));var BPromise=require(_0xcc1a('0x1'));var rs=require(_0xcc1a('0x2'));var fs=require('fs');var Redis=require(_0xcc1a('0x3'));var db=require(_0xcc1a('0x4'))['db'];var utils=require(_0xcc1a('0x5'));var logger=require('../../config/logger')(_0xcc1a('0x6'));var config=require(_0xcc1a('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xcc1a('0x8')][_0xcc1a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3a96ec,_0x56b0eb,_0x559f9b){return new BPromise(function(_0x2887a4,_0x184a44){return client[_0xcc1a('0xa')](_0x3a96ec,_0x559f9b)[_0xcc1a('0xb')](function(_0x269a86){logger[_0xcc1a('0xc')](_0xcc1a('0xd'),_0x56b0eb,_0xcc1a('0xe'));logger['debug'](_0xcc1a('0xf'),_0x56b0eb,_0xcc1a('0xe'),JSON[_0xcc1a('0x10')](_0x269a86));if(_0x269a86[_0xcc1a('0x11')]){if(_0x269a86[_0xcc1a('0x11')][_0xcc1a('0x12')]===0x1f4){logger[_0xcc1a('0x11')](_0xcc1a('0xd'),_0x56b0eb,_0x269a86[_0xcc1a('0x11')][_0xcc1a('0x13')]);return _0x184a44(_0x269a86[_0xcc1a('0x11')][_0xcc1a('0x13')]);}logger[_0xcc1a('0x11')](_0xcc1a('0xd'),_0x56b0eb,_0x269a86[_0xcc1a('0x11')][_0xcc1a('0x13')]);return _0x2887a4(_0x269a86[_0xcc1a('0x11')][_0xcc1a('0x13')]);}else{logger['info'](_0xcc1a('0xd'),_0x56b0eb,_0xcc1a('0xe'));_0x2887a4(_0x269a86['result']['message']);}})[_0xcc1a('0x14')](function(_0x182c4d){logger['error'](_0xcc1a('0xd'),_0x56b0eb,_0x182c4d);_0x184a44(_0x182c4d);});});}exports[_0xcc1a('0x15')]=function(_0x41a9a8){var _0x596b61=this;return new Promise(function(_0x4788b2,_0x5c55bf){return db['SugarcrmAccount'][_0xcc1a('0x16')]({'raw':_0x41a9a8[_0xcc1a('0x17')]?_0x41a9a8['options']['raw']===undefined?!![]:![]:!![],'where':_0x41a9a8['options']?_0x41a9a8['options'][_0xcc1a('0x18')]||null:null,'attributes':_0x41a9a8[_0xcc1a('0x17')]?_0x41a9a8[_0xcc1a('0x17')][_0xcc1a('0x19')]||null:null,'limit':_0x41a9a8['options']?_0x41a9a8[_0xcc1a('0x17')][_0xcc1a('0x1a')]||null:null,'include':_0x41a9a8['options']?_0x41a9a8[_0xcc1a('0x17')][_0xcc1a('0x1b')]?_['map'](_0x41a9a8['options']['include'],function(_0x131376){return{'model':db[_0x131376[_0xcc1a('0x1c')]],'as':_0x131376['as'],'attributes':_0x131376['attributes'],'include':_0x131376[_0xcc1a('0x1b')]?_['map'](_0x131376[_0xcc1a('0x1b')],function(_0x439178){return{'model':db[_0x439178['model']],'as':_0x439178['as'],'attributes':_0x439178[_0xcc1a('0x19')],'include':_0x439178['include']?_[_0xcc1a('0x1d')](_0x439178[_0xcc1a('0x1b')],function(_0x31dc2f){return{'model':db[_0x31dc2f[_0xcc1a('0x1c')]],'as':_0x31dc2f['as'],'attributes':_0x31dc2f[_0xcc1a('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x232ce7){logger['info']('GetSugarcrmAccount',_0x41a9a8);logger[_0xcc1a('0x1e')]('GetSugarcrmAccount',_0x41a9a8,JSON[_0xcc1a('0x10')](_0x232ce7));_0x4788b2(_0x232ce7);})[_0xcc1a('0x14')](function(_0x2b119b){logger[_0xcc1a('0x11')](_0xcc1a('0x15'),_0x2b119b[_0xcc1a('0x13')],_0x41a9a8);_0x5c55bf(_0x596b61['error'](0x1f4,_0x2b119b[_0xcc1a('0x13')]));});});};exports[_0xcc1a('0x1f')]=function(_0xe05794){var _0x333bc1=this;return new Promise(function(_0x20d456,_0x1e86b6){return db['SugarcrmAccount'][_0xcc1a('0x20')]({'raw':_0xe05794[_0xcc1a('0x17')]?_0xe05794[_0xcc1a('0x17')][_0xcc1a('0x21')]===undefined?!![]:![]:!![],'where':_0xe05794['options']?_0xe05794[_0xcc1a('0x17')][_0xcc1a('0x18')]||null:null,'attributes':_0xe05794[_0xcc1a('0x17')]?_0xe05794['options']['attributes']||null:null,'include':_0xe05794[_0xcc1a('0x17')]?_0xe05794[_0xcc1a('0x17')][_0xcc1a('0x1b')]?_['map'](_0xe05794[_0xcc1a('0x17')][_0xcc1a('0x1b')],function(_0xe2e803){return{'model':db[_0xe2e803[_0xcc1a('0x1c')]],'as':_0xe2e803['as'],'attributes':_0xe2e803['attributes'],'include':_0xe2e803[_0xcc1a('0x1b')]?_[_0xcc1a('0x1d')](_0xe2e803[_0xcc1a('0x1b')],function(_0x1d3faa){return{'model':db[_0x1d3faa[_0xcc1a('0x1c')]],'as':_0x1d3faa['as'],'attributes':_0x1d3faa['attributes'],'include':_0x1d3faa[_0xcc1a('0x1b')]?_[_0xcc1a('0x1d')](_0x1d3faa[_0xcc1a('0x1b')],function(_0xf3d4e8){return{'model':db[_0xf3d4e8[_0xcc1a('0x1c')]],'as':_0xf3d4e8['as'],'attributes':_0xf3d4e8[_0xcc1a('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x36df3b){logger[_0xcc1a('0xc')]('ShowSugarcrmAccount',_0xe05794);logger['debug'](_0xcc1a('0x1f'),_0xe05794,JSON[_0xcc1a('0x10')](_0x36df3b));_0x20d456(_0x36df3b);})[_0xcc1a('0x14')](function(_0x524e30){logger['error'](_0xcc1a('0x1f'),_0x524e30[_0xcc1a('0x13')],_0xe05794);_0x1e86b6(_0x333bc1['error'](0x1f4,_0x524e30['message']));});});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/index.js b/server/api/intSugarcrmConfiguration/index.js index 232c179..36322cf 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 _0x1283=['../../components/interaction/service','./intSugarcrmConfiguration.controller','get','index','/:id','isAuthenticated','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','post','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x1cc74d,_0x1286b1){var _0x36b344=function(_0x1969a1){while(--_0x1969a1){_0x1cc74d['push'](_0x1cc74d['shift']());}};_0x36b344(++_0x1286b1);}(_0x1283,0x16a));var _0x3128=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0x1283[_0x56482c];return _0x5aae7a;};'use strict';var multer=require(_0x3128('0x0'));var util=require('util');var path=require(_0x3128('0x1'));var timeout=require(_0x3128('0x2'));var express=require(_0x3128('0x3'));var router=express[_0x3128('0x4')]();var auth=require(_0x3128('0x5'));var interaction=require(_0x3128('0x6'));var config=require('../../config/environment');var controller=require(_0x3128('0x7'));router[_0x3128('0x8')]('/',auth['isAuthenticated'](),controller[_0x3128('0x9')]);router['get'](_0x3128('0xa'),auth[_0x3128('0xb')](),controller[_0x3128('0xc')]);router[_0x3128('0x8')](_0x3128('0xd'),auth[_0x3128('0xb')](),controller[_0x3128('0xe')]);router[_0x3128('0x8')](_0x3128('0xf'),auth[_0x3128('0xb')](),controller[_0x3128('0x10')]);router[_0x3128('0x8')](_0x3128('0x11'),auth['isAuthenticated'](),controller['getDescriptions']);router[_0x3128('0x12')]('/',auth[_0x3128('0xb')](),controller['create']);router['put']('/:id',auth['isAuthenticated'](),controller[_0x3128('0x13')]);router[_0x3128('0x14')](_0x3128('0xa'),auth[_0x3128('0xb')](),controller[_0x3128('0x15')]);module[_0x3128('0x16')]=router; \ No newline at end of file +var _0xb415=['/:id','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmConfiguration.controller','get','isAuthenticated','index','show','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create'];(function(_0x4343ec,_0x39a3c8){var _0x224a33=function(_0x2850f9){while(--_0x2850f9){_0x4343ec['push'](_0x4343ec['shift']());}};_0x224a33(++_0x39a3c8);}(_0xb415,0xc4));var _0x5b41=function(_0x684052,_0x31aa8d){_0x684052=_0x684052-0x0;var _0x124468=_0xb415[_0x684052];return _0x124468;};'use strict';var multer=require(_0x5b41('0x0'));var util=require(_0x5b41('0x1'));var path=require(_0x5b41('0x2'));var timeout=require(_0x5b41('0x3'));var express=require(_0x5b41('0x4'));var router=express['Router']();var auth=require(_0x5b41('0x5'));var interaction=require(_0x5b41('0x6'));var config=require(_0x5b41('0x7'));var controller=require(_0x5b41('0x8'));router[_0x5b41('0x9')]('/',auth[_0x5b41('0xa')](),controller[_0x5b41('0xb')]);router['get']('/:id',auth[_0x5b41('0xa')](),controller[_0x5b41('0xc')]);router[_0x5b41('0x9')]('/:id/fields',auth[_0x5b41('0xa')](),controller[_0x5b41('0xd')]);router['get'](_0x5b41('0xe'),auth[_0x5b41('0xa')](),controller[_0x5b41('0xf')]);router[_0x5b41('0x9')](_0x5b41('0x10'),auth[_0x5b41('0xa')](),controller[_0x5b41('0x11')]);router[_0x5b41('0x12')]('/',auth[_0x5b41('0xa')](),controller[_0x5b41('0x13')]);router['put'](_0x5b41('0x14'),auth[_0x5b41('0xa')](),controller['update']);router[_0x5b41('0x15')]('/:id',auth[_0x5b41('0xa')](),controller[_0x5b41('0x16')]);module[_0x5b41('0x17')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js index 4fc88e6..16cb819 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 _0x7d04=['STRING'];(function(_0x233700,_0x21fd48){var _0x5a1403=function(_0x2f5860){while(--_0x2f5860){_0x233700['push'](_0x233700['shift']());}};_0x5a1403(++_0x21fd48);}(_0x7d04,0x190));var _0x47d0=function(_0xd99ad2,_0x1c0f9d){_0xd99ad2=_0xd99ad2-0x0;var _0x32d3a3=_0x7d04[_0xd99ad2];return _0x32d3a3;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x47d0('0x0')]},'description':{'type':Sequelize[_0x47d0('0x0')]}}; \ No newline at end of file +var _0x9c2e=['exports','STRING','sequelize'];(function(_0x565ed7,_0x398228){var _0x183ad7=function(_0x5a43d7){while(--_0x5a43d7){_0x565ed7['push'](_0x565ed7['shift']());}};_0x183ad7(++_0x398228);}(_0x9c2e,0x14f));var _0xe9c2=function(_0x536906,_0x50735c){_0x536906=_0x536906-0x0;var _0x42eeb2=_0x9c2e[_0x536906];return _0x42eeb2;};'use strict';var Sequelize=require(_0xe9c2('0x0'));module[_0xe9c2('0x1')]={'name':{'type':Sequelize[_0xe9c2('0x2')]},'description':{'type':Sequelize[_0xe9c2('0x2')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js index 3843594..b43bc92 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 _0x9ee6=['Content-Range','apply','reject','save','update','destroy','stack','name','index','SugarcrmConfiguration','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','map','VIRTUAL','field','filter','include','findAll','show','rawAttributes','includeAll','options','find','create','body','params','getFields','findOne','SugarcrmField','getSubjects','getDescriptions','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','http','request','then','info','SugarcrmConfiguration,\x20%s,\x20%s','debug','request\x20sent','error','code','message','result','catch','end','status','json','count','offset','limit'];(function(_0x1d1a90,_0x40f97){var _0x36fc75=function(_0x984dfe){while(--_0x984dfe){_0x1d1a90['push'](_0x1d1a90['shift']());}};_0x36fc75(++_0x40f97);}(_0x9ee6,0x84));var _0x69ee=function(_0x5f49c0,_0x27a1b4){_0x5f49c0=_0x5f49c0-0x0;var _0x5ab653=_0x9ee6[_0x5f49c0];return _0x5ab653;};'use strict';var pdf=require(_0x69ee('0x0'));var emlformat=require(_0x69ee('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x69ee('0x2'));var jsonpatch=require(_0x69ee('0x3'));var rp=require(_0x69ee('0x4'));var moment=require(_0x69ee('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x69ee('0x6'));var util=require(_0x69ee('0x7'));var path=require(_0x69ee('0x8'));var sox=require(_0x69ee('0x9'));var csv=require(_0x69ee('0xa'));var ejs=require(_0x69ee('0xb'));var fs=require('fs');var _=require(_0x69ee('0xc'));var squel=require(_0x69ee('0xd'));var crypto=require(_0x69ee('0xe'));var jsforce=require(_0x69ee('0xf'));var deskjs=require(_0x69ee('0x10'));var toCsv=require(_0x69ee('0xa'));var querystring=require(_0x69ee('0x11'));var Papa=require(_0x69ee('0x12'));var Redis=require(_0x69ee('0x13'));var authService=require(_0x69ee('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x69ee('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x69ee('0x16'));var config=require(_0x69ee('0x17'));var db=require(_0x69ee('0x18'))['db'];var jayson=require(_0x69ee('0x19'));var client=jayson['client'][_0x69ee('0x1a')]({'port':0x232a});function checkPasswordPattern(_0x39e673,_0x5aea7a,_0x287fb8){if(_0x287fb8){var _0x41ee5f=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x41ee5f['test'](_0x5aea7a)){return _0x39e673;}else{throw new Error('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x39e673;}}function respondWithRpcPromise(_0x2debb0,_0x3a0346,_0x4085ff,_0x371c59){return new BPromise(function(_0x3dcc1f,_0x2572ae){var _0x3a3423=_0x371c59||client;return _0x3a3423[_0x69ee('0x1b')](_0x2debb0,_0x4085ff)[_0x69ee('0x1c')](function(_0x1d5c55){logger[_0x69ee('0x1d')](_0x69ee('0x1e'),_0x3a0346,'request\x20sent');logger[_0x69ee('0x1f')]('SugarcrmConfiguration,\x20%s,\x20%s,\x20%s',_0x3a0346,_0x69ee('0x20'),JSON['stringify'](_0x1d5c55));if(_0x1d5c55[_0x69ee('0x21')]){if(_0x1d5c55[_0x69ee('0x21')][_0x69ee('0x22')]===0x1f4){logger['error'](_0x69ee('0x1e'),_0x3a0346,_0x1d5c55[_0x69ee('0x21')][_0x69ee('0x23')]);return _0x2572ae(_0x1d5c55[_0x69ee('0x21')][_0x69ee('0x23')]);}logger[_0x69ee('0x21')](_0x69ee('0x1e'),_0x3a0346,_0x1d5c55[_0x69ee('0x21')][_0x69ee('0x23')]);return _0x3dcc1f(_0x1d5c55['error']['message']);}else{logger[_0x69ee('0x1d')](_0x69ee('0x1e'),_0x3a0346,_0x69ee('0x20'));_0x3dcc1f(_0x1d5c55[_0x69ee('0x24')]['message']);}})[_0x69ee('0x25')](function(_0x29b063){logger[_0x69ee('0x21')](_0x69ee('0x1e'),_0x3a0346,_0x29b063);_0x2572ae(_0x29b063);});});}function respondWithStatusCode(_0x584b8c,_0x8b9cfb){_0x8b9cfb=_0x8b9cfb||0xcc;return function(_0x50a1f2){if(_0x50a1f2){return _0x584b8c['sendStatus'](_0x8b9cfb);}return _0x584b8c['status'](_0x8b9cfb)[_0x69ee('0x26')]();};}function respondWithResult(_0x39bd4f,_0x51ed50){_0x51ed50=_0x51ed50||0xc8;return function(_0x2fa996){if(_0x2fa996){return _0x39bd4f[_0x69ee('0x27')](_0x51ed50)[_0x69ee('0x28')](_0x2fa996);}};}function respondWithFilteredResult(_0x10ac80,_0x46a60a){return function(_0x4a2762){if(_0x4a2762){var _0x51e964=_0x4a2762[_0x69ee('0x29')],_0x46303c=_0x46a60a[_0x69ee('0x2a')],_0x378c83=_0x46a60a['offset']+_0x46a60a[_0x69ee('0x2b')],_0x3e9573;if(_0x378c83>=_0x51e964){_0x378c83=_0x51e964;_0x3e9573=0xc8;}else{_0x3e9573=0xce;}_0x10ac80['status'](_0x3e9573);return _0x10ac80['set'](_0x69ee('0x2c'),_0x46303c+'-'+_0x378c83+'/'+_0x51e964)[_0x69ee('0x28')](_0x4a2762);}return null;};}function patchUpdates(_0x27c307){return function(_0x4732c3){try{jsonpatch[_0x69ee('0x2d')](_0x4732c3,_0x27c307,!![]);}catch(_0x4a558a){return BPromise[_0x69ee('0x2e')](_0x4a558a);}return _0x4732c3[_0x69ee('0x2f')]();};}function saveUpdates(_0x44b39b,_0x51dfe6){return function(_0x219f8e){if(_0x219f8e){return _0x219f8e[_0x69ee('0x30')](_0x44b39b)[_0x69ee('0x1c')](function(_0x3d19d9){return _0x3d19d9;});}return null;};}function removeEntity(_0x52e4b0,_0x2495e2){return function(_0x486429){if(_0x486429){return _0x486429[_0x69ee('0x31')]()[_0x69ee('0x1c')](function(){_0x52e4b0[_0x69ee('0x27')](0xcc)[_0x69ee('0x26')]();});}};}function handleEntityNotFound(_0x8e3c0a,_0x2d71a5){return function(_0x1998bb){if(!_0x1998bb){_0x8e3c0a['sendStatus'](0x194);}return _0x1998bb;};}function handleError(_0x522f8d,_0x5e196c){_0x5e196c=_0x5e196c||0x1f4;return function(_0x40c70c){logger[_0x69ee('0x21')](_0x40c70c[_0x69ee('0x32')]);if(_0x40c70c[_0x69ee('0x33')]){delete _0x40c70c[_0x69ee('0x33')];}_0x522f8d[_0x69ee('0x27')](_0x5e196c)['send'](_0x40c70c);};}exports[_0x69ee('0x34')]=function(_0x492bca,_0x4819ce){var _0x35e946={},_0x26a37c={},_0x25495c={'count':0x0,'rows':[]};var _0x26ece0=db[_0x69ee('0x35')]['rawAttributes'];_0x26a37c[_0x69ee('0x36')]=_[_0x69ee('0x37')](_0x26ece0);_0x26a37c[_0x69ee('0x38')]=_[_0x69ee('0x37')](_0x492bca['query']);_0x26a37c[_0x69ee('0x39')]=_[_0x69ee('0x3a')](_0x26a37c['model'],_0x26a37c['query']);_0x35e946['attributes']=_[_0x69ee('0x3a')](_0x26a37c[_0x69ee('0x36')],qs['fields'](_0x492bca[_0x69ee('0x38')][_0x69ee('0x3b')]));_0x35e946[_0x69ee('0x3c')]=_0x35e946[_0x69ee('0x3c')][_0x69ee('0x3d')]?_0x35e946[_0x69ee('0x3c')]:_0x26a37c[_0x69ee('0x36')];if(!_0x492bca[_0x69ee('0x38')][_0x69ee('0x3e')](_0x69ee('0x3f'))){_0x35e946[_0x69ee('0x2b')]=qs['limit'](_0x492bca['query']['limit']);_0x35e946['offset']=qs[_0x69ee('0x2a')](_0x492bca['query'][_0x69ee('0x2a')]);}_0x35e946[_0x69ee('0x40')]=qs[_0x69ee('0x41')](_0x492bca[_0x69ee('0x38')]['sort']);_0x35e946[_0x69ee('0x42')]=qs[_0x69ee('0x39')](_[_0x69ee('0x43')](_0x492bca[_0x69ee('0x38')],_0x26a37c['filters']));if(_0x492bca[_0x69ee('0x38')]['filter']){_0x35e946[_0x69ee('0x42')]=_[_0x69ee('0x44')](_0x35e946[_0x69ee('0x42')],{'$or':_[_0x69ee('0x45')](_0x26ece0,function(_0x42a337){if(_0x42a337['type']['key']!==_0x69ee('0x46')){var _0x24871b={};_0x24871b[_0x42a337[_0x69ee('0x47')]]={'$like':'%'+_0x492bca[_0x69ee('0x38')][_0x69ee('0x48')]+'%'};return _0x24871b;}})});}_0x35e946=_[_0x69ee('0x44')]({},_0x35e946,_0x492bca['options']);var _0x435047={'where':_0x35e946[_0x69ee('0x42')]};return db['SugarcrmConfiguration'][_0x69ee('0x29')](_0x435047)[_0x69ee('0x1c')](function(_0x588ea1){_0x25495c[_0x69ee('0x29')]=_0x588ea1;if(_0x492bca[_0x69ee('0x38')]['includeAll']){_0x35e946[_0x69ee('0x49')]=[{'all':!![]}];}return db[_0x69ee('0x35')][_0x69ee('0x4a')](_0x35e946);})[_0x69ee('0x1c')](function(_0x4471d4){_0x25495c['rows']=_0x4471d4;return _0x25495c;})[_0x69ee('0x1c')](respondWithFilteredResult(_0x4819ce,_0x35e946))[_0x69ee('0x25')](handleError(_0x4819ce,null));};exports[_0x69ee('0x4b')]=function(_0x1be537,_0x391cd4){var _0x4eaf46={'raw':![],'where':{'id':_0x1be537['params']['id']}},_0x207587={};_0x207587['model']=_[_0x69ee('0x37')](db[_0x69ee('0x35')][_0x69ee('0x4c')]);_0x207587[_0x69ee('0x38')]=_['keys'](_0x1be537['query']);_0x207587[_0x69ee('0x39')]=_[_0x69ee('0x3a')](_0x207587[_0x69ee('0x36')],_0x207587['query']);_0x4eaf46['attributes']=_[_0x69ee('0x3a')](_0x207587[_0x69ee('0x36')],qs[_0x69ee('0x3b')](_0x1be537[_0x69ee('0x38')]['fields']));_0x4eaf46[_0x69ee('0x3c')]=_0x4eaf46[_0x69ee('0x3c')][_0x69ee('0x3d')]?_0x4eaf46['attributes']:_0x207587['model'];if(_0x1be537[_0x69ee('0x38')][_0x69ee('0x4d')]){_0x4eaf46[_0x69ee('0x49')]=[{'all':!![]}];}_0x4eaf46=_[_0x69ee('0x44')]({},_0x4eaf46,_0x1be537[_0x69ee('0x4e')]);return db[_0x69ee('0x35')][_0x69ee('0x4f')](_0x4eaf46)[_0x69ee('0x1c')](handleEntityNotFound(_0x391cd4,null))[_0x69ee('0x1c')](respondWithResult(_0x391cd4,null))[_0x69ee('0x25')](handleError(_0x391cd4,null));};exports[_0x69ee('0x50')]=function(_0x8f0a66,_0x1fd17c){return db[_0x69ee('0x35')][_0x69ee('0x50')](_0x8f0a66[_0x69ee('0x51')],{})[_0x69ee('0x1c')](respondWithResult(_0x1fd17c,0xc9))[_0x69ee('0x25')](handleError(_0x1fd17c,null));};exports[_0x69ee('0x30')]=function(_0x164661,_0x2e7f21){if(_0x164661['body']['id']){delete _0x164661[_0x69ee('0x51')]['id'];}return db['SugarcrmConfiguration'][_0x69ee('0x4f')]({'where':{'id':_0x164661[_0x69ee('0x52')]['id']}})['then'](handleEntityNotFound(_0x2e7f21,null))[_0x69ee('0x1c')](saveUpdates(_0x164661['body'],null))[_0x69ee('0x1c')](respondWithResult(_0x2e7f21,null))['catch'](handleError(_0x2e7f21,null));};exports[_0x69ee('0x31')]=function(_0x564599,_0x3a6056){return db[_0x69ee('0x35')][_0x69ee('0x4f')]({'where':{'id':_0x564599[_0x69ee('0x52')]['id']}})[_0x69ee('0x1c')](handleEntityNotFound(_0x3a6056,null))[_0x69ee('0x1c')](removeEntity(_0x3a6056,null))[_0x69ee('0x25')](handleError(_0x3a6056,null));};exports[_0x69ee('0x53')]=function(_0x2b6768,_0x10834e,_0x19a338){var _0x3b01d7={};var _0x18f9db={};var _0x2aa297;var _0x4957e4;return db[_0x69ee('0x35')][_0x69ee('0x54')]({'where':{'id':_0x2b6768[_0x69ee('0x52')]['id']}})[_0x69ee('0x1c')](handleEntityNotFound(_0x10834e,null))[_0x69ee('0x1c')](function(_0x2d3b55){if(_0x2d3b55){_0x2aa297=_0x2d3b55;_0x18f9db[_0x69ee('0x36')]=_[_0x69ee('0x37')](db['SugarcrmField'][_0x69ee('0x4c')]);_0x18f9db['query']=_[_0x69ee('0x37')](_0x2b6768['query']);_0x18f9db[_0x69ee('0x39')]=_[_0x69ee('0x3a')](_0x18f9db[_0x69ee('0x36')],_0x18f9db[_0x69ee('0x38')]);_0x3b01d7[_0x69ee('0x3c')]=_[_0x69ee('0x3a')](_0x18f9db[_0x69ee('0x36')],qs['fields'](_0x2b6768['query']['fields']));_0x3b01d7[_0x69ee('0x3c')]=_0x3b01d7[_0x69ee('0x3c')][_0x69ee('0x3d')]?_0x3b01d7[_0x69ee('0x3c')]:_0x18f9db[_0x69ee('0x36')];_0x3b01d7[_0x69ee('0x40')]=qs[_0x69ee('0x41')](_0x2b6768[_0x69ee('0x38')][_0x69ee('0x41')]);_0x3b01d7[_0x69ee('0x42')]=qs[_0x69ee('0x39')](_[_0x69ee('0x43')](_0x2b6768['query'],_0x18f9db['filters']));if(_0x2b6768['query'][_0x69ee('0x48')]){_0x3b01d7['where']=_[_0x69ee('0x44')](_0x3b01d7['where'],{'$or':_[_0x69ee('0x45')](_0x3b01d7[_0x69ee('0x3c')],function(_0x45bb14){var _0x3b6977={};_0x3b6977[_0x45bb14]={'$like':'%'+_0x2b6768[_0x69ee('0x38')][_0x69ee('0x48')]+'%'};return _0x3b6977;})});}_0x3b01d7=_['merge']({},_0x3b01d7,_0x2b6768[_0x69ee('0x4e')]);return _0x2aa297[_0x69ee('0x53')](_0x3b01d7);}})[_0x69ee('0x1c')](function(_0x585477){if(_0x585477){_0x4957e4=_0x585477[_0x69ee('0x3d')];if(!_0x2b6768[_0x69ee('0x38')][_0x69ee('0x3e')](_0x69ee('0x3f'))){_0x3b01d7[_0x69ee('0x2b')]=qs['limit'](_0x2b6768[_0x69ee('0x38')]['limit']);_0x3b01d7[_0x69ee('0x2a')]=qs['offset'](_0x2b6768[_0x69ee('0x38')]['offset']);}return _0x2aa297[_0x69ee('0x53')](_0x3b01d7);}})['then'](function(_0x2e4662){if(_0x2e4662){return _0x2e4662?{'count':_0x4957e4,'rows':_0x2e4662}:null;}})['then'](respondWithResult(_0x10834e,null))['catch'](handleError(_0x10834e,null));};exports['getSubjects']=function(_0xc5e35d,_0x4b822c,_0x5d4a20){var _0x3cc852={};var _0x2c30ea={};var _0x40aa8c;var _0x14fc5a;return db['SugarcrmConfiguration'][_0x69ee('0x54')]({'where':{'id':_0xc5e35d[_0x69ee('0x52')]['id']}})[_0x69ee('0x1c')](handleEntityNotFound(_0x4b822c,null))[_0x69ee('0x1c')](function(_0x2afc5d){if(_0x2afc5d){_0x40aa8c=_0x2afc5d;_0x2c30ea[_0x69ee('0x36')]=_[_0x69ee('0x37')](db[_0x69ee('0x55')][_0x69ee('0x4c')]);_0x2c30ea['query']=_[_0x69ee('0x37')](_0xc5e35d[_0x69ee('0x38')]);_0x2c30ea[_0x69ee('0x39')]=_[_0x69ee('0x3a')](_0x2c30ea[_0x69ee('0x36')],_0x2c30ea[_0x69ee('0x38')]);_0x3cc852[_0x69ee('0x3c')]=_[_0x69ee('0x3a')](_0x2c30ea['model'],qs['fields'](_0xc5e35d['query']['fields']));_0x3cc852[_0x69ee('0x3c')]=_0x3cc852['attributes'][_0x69ee('0x3d')]?_0x3cc852[_0x69ee('0x3c')]:_0x2c30ea[_0x69ee('0x36')];_0x3cc852['order']=qs[_0x69ee('0x41')](_0xc5e35d[_0x69ee('0x38')]['sort']);_0x3cc852[_0x69ee('0x42')]=qs[_0x69ee('0x39')](_[_0x69ee('0x43')](_0xc5e35d['query'],_0x2c30ea['filters']));if(_0xc5e35d[_0x69ee('0x38')][_0x69ee('0x48')]){_0x3cc852['where']=_['merge'](_0x3cc852['where'],{'$or':_['map'](_0x3cc852[_0x69ee('0x3c')],function(_0x243c7b){var _0x183264={};_0x183264[_0x243c7b]={'$like':'%'+_0xc5e35d[_0x69ee('0x38')]['filter']+'%'};return _0x183264;})});}_0x3cc852=_[_0x69ee('0x44')]({},_0x3cc852,_0xc5e35d['options']);return _0x40aa8c[_0x69ee('0x56')](_0x3cc852);}})[_0x69ee('0x1c')](function(_0x1298a7){if(_0x1298a7){_0x14fc5a=_0x1298a7[_0x69ee('0x3d')];if(!_0xc5e35d[_0x69ee('0x38')][_0x69ee('0x3e')](_0x69ee('0x3f'))){_0x3cc852[_0x69ee('0x2b')]=qs['limit'](_0xc5e35d[_0x69ee('0x38')][_0x69ee('0x2b')]);_0x3cc852[_0x69ee('0x2a')]=qs[_0x69ee('0x2a')](_0xc5e35d[_0x69ee('0x38')][_0x69ee('0x2a')]);}return _0x40aa8c[_0x69ee('0x56')](_0x3cc852);}})[_0x69ee('0x1c')](function(_0xcafdfd){if(_0xcafdfd){return _0xcafdfd?{'count':_0x14fc5a,'rows':_0xcafdfd}:null;}})[_0x69ee('0x1c')](respondWithResult(_0x4b822c,null))[_0x69ee('0x25')](handleError(_0x4b822c,null));};exports[_0x69ee('0x57')]=function(_0x5eb715,_0x217d52,_0x2f12ae){var _0x3866cd={};var _0x50d89e={};var _0x130f45;var _0xcddcf2;return db[_0x69ee('0x35')][_0x69ee('0x54')]({'where':{'id':_0x5eb715[_0x69ee('0x52')]['id']}})[_0x69ee('0x1c')](handleEntityNotFound(_0x217d52,null))[_0x69ee('0x1c')](function(_0x84440d){if(_0x84440d){_0x130f45=_0x84440d;_0x50d89e[_0x69ee('0x36')]=_[_0x69ee('0x37')](db[_0x69ee('0x55')][_0x69ee('0x4c')]);_0x50d89e['query']=_[_0x69ee('0x37')](_0x5eb715['query']);_0x50d89e[_0x69ee('0x39')]=_[_0x69ee('0x3a')](_0x50d89e[_0x69ee('0x36')],_0x50d89e[_0x69ee('0x38')]);_0x3866cd[_0x69ee('0x3c')]=_['intersection'](_0x50d89e[_0x69ee('0x36')],qs[_0x69ee('0x3b')](_0x5eb715['query'][_0x69ee('0x3b')]));_0x3866cd[_0x69ee('0x3c')]=_0x3866cd[_0x69ee('0x3c')][_0x69ee('0x3d')]?_0x3866cd[_0x69ee('0x3c')]:_0x50d89e[_0x69ee('0x36')];_0x3866cd[_0x69ee('0x40')]=qs[_0x69ee('0x41')](_0x5eb715[_0x69ee('0x38')][_0x69ee('0x41')]);_0x3866cd[_0x69ee('0x42')]=qs['filters'](_[_0x69ee('0x43')](_0x5eb715[_0x69ee('0x38')],_0x50d89e[_0x69ee('0x39')]));if(_0x5eb715[_0x69ee('0x38')]['filter']){_0x3866cd[_0x69ee('0x42')]=_['merge'](_0x3866cd[_0x69ee('0x42')],{'$or':_[_0x69ee('0x45')](_0x3866cd[_0x69ee('0x3c')],function(_0x3cc6d9){var _0xaf7d11={};_0xaf7d11[_0x3cc6d9]={'$like':'%'+_0x5eb715[_0x69ee('0x38')]['filter']+'%'};return _0xaf7d11;})});}_0x3866cd=_['merge']({},_0x3866cd,_0x5eb715['options']);return _0x130f45[_0x69ee('0x57')](_0x3866cd);}})[_0x69ee('0x1c')](function(_0xc5bf0){if(_0xc5bf0){_0xcddcf2=_0xc5bf0[_0x69ee('0x3d')];if(!_0x5eb715[_0x69ee('0x38')]['hasOwnProperty'](_0x69ee('0x3f'))){_0x3866cd[_0x69ee('0x2b')]=qs[_0x69ee('0x2b')](_0x5eb715[_0x69ee('0x38')][_0x69ee('0x2b')]);_0x3866cd['offset']=qs['offset'](_0x5eb715[_0x69ee('0x38')][_0x69ee('0x2a')]);}return _0x130f45[_0x69ee('0x57')](_0x3866cd);}})[_0x69ee('0x1c')](function(_0x240b50){if(_0x240b50){return _0x240b50?{'count':_0xcddcf2,'rows':_0x240b50}:null;}})[_0x69ee('0x1c')](respondWithResult(_0x217d52,null))[_0x69ee('0x25')](handleError(_0x217d52,null));}; \ No newline at end of file +var _0xe1d7=['request','info','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','status','end','count','offset','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','stack','send','index','SugarcrmConfiguration','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','map','type','key','VIRTUAL','options','includeAll','include','findAll','rows','show','params','rawAttributes','create','body','find','findOne','order','getFields','getSubjects','SugarcrmField','getDescriptions','eml-format','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','jayson/promise','client','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.'];(function(_0x2891d1,_0x2ddd3e){var _0x486948=function(_0x13fa0f){while(--_0x13fa0f){_0x2891d1['push'](_0x2891d1['shift']());}};_0x486948(++_0x2ddd3e);}(_0xe1d7,0x1a9));var _0x7e1d=function(_0x488ca1,_0xf6858e){_0x488ca1=_0x488ca1-0x0;var _0x4dd0a4=_0xe1d7[_0x488ca1];return _0x4dd0a4;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x7e1d('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x7e1d('0x1'));var moment=require(_0x7e1d('0x2'));var BPromise=require(_0x7e1d('0x3'));var Mustache=require('mustache');var util=require(_0x7e1d('0x4'));var path=require(_0x7e1d('0x5'));var sox=require(_0x7e1d('0x6'));var csv=require(_0x7e1d('0x7'));var ejs=require(_0x7e1d('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0x7e1d('0x9'));var crypto=require(_0x7e1d('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x7e1d('0xb'));var toCsv=require(_0x7e1d('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x7e1d('0xc'));var authService=require(_0x7e1d('0xd'));var qs=require(_0x7e1d('0xe'));var as=require(_0x7e1d('0xf'));var hardwareService=require(_0x7e1d('0x10'));var logger=require(_0x7e1d('0x11'))(_0x7e1d('0x12'));var utils=require('../../config/utils');var config=require(_0x7e1d('0x13'));var db=require(_0x7e1d('0x14'))['db'];var jayson=require(_0x7e1d('0x15'));var client=jayson[_0x7e1d('0x16')]['http']({'port':0x232a});function checkPasswordPattern(_0x4543ee,_0x34781b,_0x722f8b){if(_0x722f8b){var _0x58dfb4=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x58dfb4[_0x7e1d('0x17')](_0x34781b)){return _0x4543ee;}else{throw new Error(_0x7e1d('0x18'));}}else{return _0x4543ee;}}function respondWithRpcPromise(_0x5cafde,_0x514641,_0x401fe1,_0x3f4760){return new BPromise(function(_0x1c8d51,_0x55539a){var _0x25f214=_0x3f4760||client;return _0x25f214[_0x7e1d('0x19')](_0x5cafde,_0x401fe1)['then'](function(_0xa97c68){logger[_0x7e1d('0x1a')](_0x7e1d('0x1b'),_0x514641,_0x7e1d('0x1c'));logger['debug'](_0x7e1d('0x1d'),_0x514641,_0x7e1d('0x1c'),JSON[_0x7e1d('0x1e')](_0xa97c68));if(_0xa97c68[_0x7e1d('0x1f')]){if(_0xa97c68[_0x7e1d('0x1f')][_0x7e1d('0x20')]===0x1f4){logger[_0x7e1d('0x1f')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x514641,_0xa97c68[_0x7e1d('0x1f')][_0x7e1d('0x21')]);return _0x55539a(_0xa97c68[_0x7e1d('0x1f')][_0x7e1d('0x21')]);}logger[_0x7e1d('0x1f')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x514641,_0xa97c68['error']['message']);return _0x1c8d51(_0xa97c68[_0x7e1d('0x1f')][_0x7e1d('0x21')]);}else{logger[_0x7e1d('0x1a')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x514641,_0x7e1d('0x1c'));_0x1c8d51(_0xa97c68['result'][_0x7e1d('0x21')]);}})[_0x7e1d('0x22')](function(_0xcc5980){logger[_0x7e1d('0x1f')](_0x7e1d('0x1b'),_0x514641,_0xcc5980);_0x55539a(_0xcc5980);});});}function respondWithStatusCode(_0x3f55d8,_0x4b0b51){_0x4b0b51=_0x4b0b51||0xcc;return function(_0x1fd926){if(_0x1fd926){return _0x3f55d8[_0x7e1d('0x23')](_0x4b0b51);}return _0x3f55d8[_0x7e1d('0x24')](_0x4b0b51)[_0x7e1d('0x25')]();};}function respondWithResult(_0x21fb23,_0x3ba80b){_0x3ba80b=_0x3ba80b||0xc8;return function(_0x22569b){if(_0x22569b){return _0x21fb23[_0x7e1d('0x24')](_0x3ba80b)['json'](_0x22569b);}};}function respondWithFilteredResult(_0x38bb7d,_0x248b1a){return function(_0x47d6f4){if(_0x47d6f4){var _0x23adc5=_0x47d6f4[_0x7e1d('0x26')],_0x20fe65=_0x248b1a[_0x7e1d('0x27')],_0x4ebce1=_0x248b1a[_0x7e1d('0x27')]+_0x248b1a[_0x7e1d('0x28')],_0x1b5236;if(_0x4ebce1>=_0x23adc5){_0x4ebce1=_0x23adc5;_0x1b5236=0xc8;}else{_0x1b5236=0xce;}_0x38bb7d[_0x7e1d('0x24')](_0x1b5236);return _0x38bb7d[_0x7e1d('0x29')](_0x7e1d('0x2a'),_0x20fe65+'-'+_0x4ebce1+'/'+_0x23adc5)[_0x7e1d('0x2b')](_0x47d6f4);}return null;};}function patchUpdates(_0x19f6ae){return function(_0x568746){try{jsonpatch[_0x7e1d('0x2c')](_0x568746,_0x19f6ae,!![]);}catch(_0x3293bf){return BPromise[_0x7e1d('0x2d')](_0x3293bf);}return _0x568746[_0x7e1d('0x2e')]();};}function saveUpdates(_0x2fd9cf,_0x416bf3){return function(_0x1192a7){if(_0x1192a7){return _0x1192a7[_0x7e1d('0x2f')](_0x2fd9cf)[_0x7e1d('0x30')](function(_0x5c8b76){return _0x5c8b76;});}return null;};}function removeEntity(_0x53cfef,_0xab6067){return function(_0x329fc3){if(_0x329fc3){return _0x329fc3[_0x7e1d('0x31')]()[_0x7e1d('0x30')](function(){_0x53cfef['status'](0xcc)[_0x7e1d('0x25')]();});}};}function handleEntityNotFound(_0x4a4bd0,_0x380b0a){return function(_0x5dab81){if(!_0x5dab81){_0x4a4bd0[_0x7e1d('0x23')](0x194);}return _0x5dab81;};}function handleError(_0x18588b,_0x37cca2){_0x37cca2=_0x37cca2||0x1f4;return function(_0x4ce951){logger[_0x7e1d('0x1f')](_0x4ce951[_0x7e1d('0x32')]);if(_0x4ce951['name']){delete _0x4ce951['name'];}_0x18588b['status'](_0x37cca2)[_0x7e1d('0x33')](_0x4ce951);};}exports[_0x7e1d('0x34')]=function(_0xadef86,_0x1658e8){var _0x29f47d={},_0x4a7133={},_0x52c5e3={'count':0x0,'rows':[]};var _0x1c264e=db[_0x7e1d('0x35')]['rawAttributes'];_0x4a7133[_0x7e1d('0x36')]=_[_0x7e1d('0x37')](_0x1c264e);_0x4a7133[_0x7e1d('0x38')]=_[_0x7e1d('0x37')](_0xadef86[_0x7e1d('0x38')]);_0x4a7133['filters']=_[_0x7e1d('0x39')](_0x4a7133['model'],_0x4a7133[_0x7e1d('0x38')]);_0x29f47d[_0x7e1d('0x3a')]=_['intersection'](_0x4a7133[_0x7e1d('0x36')],qs['fields'](_0xadef86[_0x7e1d('0x38')][_0x7e1d('0x3b')]));_0x29f47d[_0x7e1d('0x3a')]=_0x29f47d[_0x7e1d('0x3a')][_0x7e1d('0x3c')]?_0x29f47d[_0x7e1d('0x3a')]:_0x4a7133[_0x7e1d('0x36')];if(!_0xadef86['query'][_0x7e1d('0x3d')](_0x7e1d('0x3e'))){_0x29f47d[_0x7e1d('0x28')]=qs[_0x7e1d('0x28')](_0xadef86[_0x7e1d('0x38')][_0x7e1d('0x28')]);_0x29f47d[_0x7e1d('0x27')]=qs[_0x7e1d('0x27')](_0xadef86[_0x7e1d('0x38')][_0x7e1d('0x27')]);}_0x29f47d['order']=qs[_0x7e1d('0x3f')](_0xadef86[_0x7e1d('0x38')][_0x7e1d('0x3f')]);_0x29f47d[_0x7e1d('0x40')]=qs[_0x7e1d('0x41')](_[_0x7e1d('0x42')](_0xadef86[_0x7e1d('0x38')],_0x4a7133[_0x7e1d('0x41')]));if(_0xadef86['query'][_0x7e1d('0x43')]){_0x29f47d[_0x7e1d('0x40')]=_[_0x7e1d('0x44')](_0x29f47d[_0x7e1d('0x40')],{'$or':_[_0x7e1d('0x45')](_0x1c264e,function(_0x485f34){if(_0x485f34[_0x7e1d('0x46')][_0x7e1d('0x47')]!==_0x7e1d('0x48')){var _0x4d6031={};_0x4d6031[_0x485f34['field']]={'$like':'%'+_0xadef86[_0x7e1d('0x38')]['filter']+'%'};return _0x4d6031;}})});}_0x29f47d=_[_0x7e1d('0x44')]({},_0x29f47d,_0xadef86[_0x7e1d('0x49')]);var _0x5b99d7={'where':_0x29f47d[_0x7e1d('0x40')]};return db[_0x7e1d('0x35')][_0x7e1d('0x26')](_0x5b99d7)['then'](function(_0x31b074){_0x52c5e3['count']=_0x31b074;if(_0xadef86[_0x7e1d('0x38')][_0x7e1d('0x4a')]){_0x29f47d[_0x7e1d('0x4b')]=[{'all':!![]}];}return db[_0x7e1d('0x35')][_0x7e1d('0x4c')](_0x29f47d);})['then'](function(_0x2051ef){_0x52c5e3[_0x7e1d('0x4d')]=_0x2051ef;return _0x52c5e3;})['then'](respondWithFilteredResult(_0x1658e8,_0x29f47d))[_0x7e1d('0x22')](handleError(_0x1658e8,null));};exports[_0x7e1d('0x4e')]=function(_0x1a68ac,_0x47d273){var _0x55dafb={'raw':![],'where':{'id':_0x1a68ac[_0x7e1d('0x4f')]['id']}},_0x1cd537={};_0x1cd537[_0x7e1d('0x36')]=_[_0x7e1d('0x37')](db['SugarcrmConfiguration'][_0x7e1d('0x50')]);_0x1cd537[_0x7e1d('0x38')]=_[_0x7e1d('0x37')](_0x1a68ac['query']);_0x1cd537[_0x7e1d('0x41')]=_[_0x7e1d('0x39')](_0x1cd537['model'],_0x1cd537[_0x7e1d('0x38')]);_0x55dafb[_0x7e1d('0x3a')]=_[_0x7e1d('0x39')](_0x1cd537[_0x7e1d('0x36')],qs['fields'](_0x1a68ac['query'][_0x7e1d('0x3b')]));_0x55dafb[_0x7e1d('0x3a')]=_0x55dafb[_0x7e1d('0x3a')]['length']?_0x55dafb[_0x7e1d('0x3a')]:_0x1cd537['model'];if(_0x1a68ac['query'][_0x7e1d('0x4a')]){_0x55dafb[_0x7e1d('0x4b')]=[{'all':!![]}];}_0x55dafb=_[_0x7e1d('0x44')]({},_0x55dafb,_0x1a68ac[_0x7e1d('0x49')]);return db[_0x7e1d('0x35')]['find'](_0x55dafb)['then'](handleEntityNotFound(_0x47d273,null))[_0x7e1d('0x30')](respondWithResult(_0x47d273,null))['catch'](handleError(_0x47d273,null));};exports['create']=function(_0x5ed4ce,_0x537819){return db[_0x7e1d('0x35')][_0x7e1d('0x51')](_0x5ed4ce[_0x7e1d('0x52')],{})[_0x7e1d('0x30')](respondWithResult(_0x537819,0xc9))['catch'](handleError(_0x537819,null));};exports[_0x7e1d('0x2f')]=function(_0xa24982,_0x1f6122){if(_0xa24982['body']['id']){delete _0xa24982[_0x7e1d('0x52')]['id'];}return db[_0x7e1d('0x35')][_0x7e1d('0x53')]({'where':{'id':_0xa24982[_0x7e1d('0x4f')]['id']}})[_0x7e1d('0x30')](handleEntityNotFound(_0x1f6122,null))[_0x7e1d('0x30')](saveUpdates(_0xa24982[_0x7e1d('0x52')],null))['then'](respondWithResult(_0x1f6122,null))[_0x7e1d('0x22')](handleError(_0x1f6122,null));};exports[_0x7e1d('0x31')]=function(_0x5d5c0a,_0x2ad64b){return db[_0x7e1d('0x35')][_0x7e1d('0x53')]({'where':{'id':_0x5d5c0a[_0x7e1d('0x4f')]['id']}})[_0x7e1d('0x30')](handleEntityNotFound(_0x2ad64b,null))[_0x7e1d('0x30')](removeEntity(_0x2ad64b,null))[_0x7e1d('0x22')](handleError(_0x2ad64b,null));};exports['getFields']=function(_0x173511,_0x1e08e0,_0x1187b9){var _0x293a22={};var _0x31c2a3={};var _0x28e72f;var _0xf10186;return db[_0x7e1d('0x35')][_0x7e1d('0x54')]({'where':{'id':_0x173511[_0x7e1d('0x4f')]['id']}})[_0x7e1d('0x30')](handleEntityNotFound(_0x1e08e0,null))['then'](function(_0x13ecf1){if(_0x13ecf1){_0x28e72f=_0x13ecf1;_0x31c2a3[_0x7e1d('0x36')]=_[_0x7e1d('0x37')](db['SugarcrmField']['rawAttributes']);_0x31c2a3['query']=_[_0x7e1d('0x37')](_0x173511[_0x7e1d('0x38')]);_0x31c2a3[_0x7e1d('0x41')]=_[_0x7e1d('0x39')](_0x31c2a3[_0x7e1d('0x36')],_0x31c2a3[_0x7e1d('0x38')]);_0x293a22[_0x7e1d('0x3a')]=_[_0x7e1d('0x39')](_0x31c2a3['model'],qs[_0x7e1d('0x3b')](_0x173511['query'][_0x7e1d('0x3b')]));_0x293a22[_0x7e1d('0x3a')]=_0x293a22[_0x7e1d('0x3a')]['length']?_0x293a22['attributes']:_0x31c2a3['model'];_0x293a22[_0x7e1d('0x55')]=qs[_0x7e1d('0x3f')](_0x173511[_0x7e1d('0x38')][_0x7e1d('0x3f')]);_0x293a22[_0x7e1d('0x40')]=qs[_0x7e1d('0x41')](_[_0x7e1d('0x42')](_0x173511[_0x7e1d('0x38')],_0x31c2a3[_0x7e1d('0x41')]));if(_0x173511[_0x7e1d('0x38')][_0x7e1d('0x43')]){_0x293a22['where']=_[_0x7e1d('0x44')](_0x293a22[_0x7e1d('0x40')],{'$or':_[_0x7e1d('0x45')](_0x293a22[_0x7e1d('0x3a')],function(_0xb6ee18){var _0x3b1cf9={};_0x3b1cf9[_0xb6ee18]={'$like':'%'+_0x173511[_0x7e1d('0x38')][_0x7e1d('0x43')]+'%'};return _0x3b1cf9;})});}_0x293a22=_[_0x7e1d('0x44')]({},_0x293a22,_0x173511['options']);return _0x28e72f[_0x7e1d('0x56')](_0x293a22);}})[_0x7e1d('0x30')](function(_0x3dfba4){if(_0x3dfba4){_0xf10186=_0x3dfba4['length'];if(!_0x173511[_0x7e1d('0x38')][_0x7e1d('0x3d')](_0x7e1d('0x3e'))){_0x293a22[_0x7e1d('0x28')]=qs[_0x7e1d('0x28')](_0x173511[_0x7e1d('0x38')][_0x7e1d('0x28')]);_0x293a22['offset']=qs[_0x7e1d('0x27')](_0x173511[_0x7e1d('0x38')][_0x7e1d('0x27')]);}return _0x28e72f[_0x7e1d('0x56')](_0x293a22);}})[_0x7e1d('0x30')](function(_0x2ac2e1){if(_0x2ac2e1){return _0x2ac2e1?{'count':_0xf10186,'rows':_0x2ac2e1}:null;}})[_0x7e1d('0x30')](respondWithResult(_0x1e08e0,null))['catch'](handleError(_0x1e08e0,null));};exports[_0x7e1d('0x57')]=function(_0x2a5303,_0x261936,_0x2deeef){var _0x2d44c3={};var _0x1960f1={};var _0x4f51ac;var _0x816231;return db['SugarcrmConfiguration'][_0x7e1d('0x54')]({'where':{'id':_0x2a5303[_0x7e1d('0x4f')]['id']}})['then'](handleEntityNotFound(_0x261936,null))[_0x7e1d('0x30')](function(_0x23892c){if(_0x23892c){_0x4f51ac=_0x23892c;_0x1960f1[_0x7e1d('0x36')]=_[_0x7e1d('0x37')](db[_0x7e1d('0x58')][_0x7e1d('0x50')]);_0x1960f1[_0x7e1d('0x38')]=_[_0x7e1d('0x37')](_0x2a5303['query']);_0x1960f1[_0x7e1d('0x41')]=_['intersection'](_0x1960f1[_0x7e1d('0x36')],_0x1960f1[_0x7e1d('0x38')]);_0x2d44c3[_0x7e1d('0x3a')]=_[_0x7e1d('0x39')](_0x1960f1[_0x7e1d('0x36')],qs[_0x7e1d('0x3b')](_0x2a5303[_0x7e1d('0x38')]['fields']));_0x2d44c3['attributes']=_0x2d44c3[_0x7e1d('0x3a')][_0x7e1d('0x3c')]?_0x2d44c3[_0x7e1d('0x3a')]:_0x1960f1[_0x7e1d('0x36')];_0x2d44c3[_0x7e1d('0x55')]=qs[_0x7e1d('0x3f')](_0x2a5303[_0x7e1d('0x38')][_0x7e1d('0x3f')]);_0x2d44c3[_0x7e1d('0x40')]=qs[_0x7e1d('0x41')](_['pick'](_0x2a5303['query'],_0x1960f1[_0x7e1d('0x41')]));if(_0x2a5303[_0x7e1d('0x38')]['filter']){_0x2d44c3['where']=_[_0x7e1d('0x44')](_0x2d44c3[_0x7e1d('0x40')],{'$or':_['map'](_0x2d44c3['attributes'],function(_0x56235c){var _0xd028={};_0xd028[_0x56235c]={'$like':'%'+_0x2a5303[_0x7e1d('0x38')]['filter']+'%'};return _0xd028;})});}_0x2d44c3=_[_0x7e1d('0x44')]({},_0x2d44c3,_0x2a5303[_0x7e1d('0x49')]);return _0x4f51ac[_0x7e1d('0x57')](_0x2d44c3);}})['then'](function(_0x18cad1){if(_0x18cad1){_0x816231=_0x18cad1['length'];if(!_0x2a5303['query'][_0x7e1d('0x3d')](_0x7e1d('0x3e'))){_0x2d44c3[_0x7e1d('0x28')]=qs['limit'](_0x2a5303[_0x7e1d('0x38')][_0x7e1d('0x28')]);_0x2d44c3[_0x7e1d('0x27')]=qs[_0x7e1d('0x27')](_0x2a5303[_0x7e1d('0x38')][_0x7e1d('0x27')]);}return _0x4f51ac[_0x7e1d('0x57')](_0x2d44c3);}})[_0x7e1d('0x30')](function(_0xe1c8e5){if(_0xe1c8e5){return _0xe1c8e5?{'count':_0x816231,'rows':_0xe1c8e5}:null;}})['then'](respondWithResult(_0x261936,null))[_0x7e1d('0x22')](handleError(_0x261936,null));};exports[_0x7e1d('0x59')]=function(_0x2cb133,_0x51ee29,_0x1bcd88){var _0x55ccd4={};var _0x3de20f={};var _0x435e5c;var _0x453457;return db[_0x7e1d('0x35')]['findOne']({'where':{'id':_0x2cb133[_0x7e1d('0x4f')]['id']}})[_0x7e1d('0x30')](handleEntityNotFound(_0x51ee29,null))['then'](function(_0x2d1664){if(_0x2d1664){_0x435e5c=_0x2d1664;_0x3de20f[_0x7e1d('0x36')]=_[_0x7e1d('0x37')](db[_0x7e1d('0x58')][_0x7e1d('0x50')]);_0x3de20f[_0x7e1d('0x38')]=_[_0x7e1d('0x37')](_0x2cb133[_0x7e1d('0x38')]);_0x3de20f[_0x7e1d('0x41')]=_[_0x7e1d('0x39')](_0x3de20f[_0x7e1d('0x36')],_0x3de20f['query']);_0x55ccd4[_0x7e1d('0x3a')]=_[_0x7e1d('0x39')](_0x3de20f['model'],qs['fields'](_0x2cb133[_0x7e1d('0x38')][_0x7e1d('0x3b')]));_0x55ccd4[_0x7e1d('0x3a')]=_0x55ccd4['attributes'][_0x7e1d('0x3c')]?_0x55ccd4['attributes']:_0x3de20f['model'];_0x55ccd4[_0x7e1d('0x55')]=qs['sort'](_0x2cb133['query'][_0x7e1d('0x3f')]);_0x55ccd4[_0x7e1d('0x40')]=qs[_0x7e1d('0x41')](_[_0x7e1d('0x42')](_0x2cb133['query'],_0x3de20f[_0x7e1d('0x41')]));if(_0x2cb133[_0x7e1d('0x38')][_0x7e1d('0x43')]){_0x55ccd4[_0x7e1d('0x40')]=_[_0x7e1d('0x44')](_0x55ccd4[_0x7e1d('0x40')],{'$or':_[_0x7e1d('0x45')](_0x55ccd4[_0x7e1d('0x3a')],function(_0x6cfd6b){var _0x33c0c1={};_0x33c0c1[_0x6cfd6b]={'$like':'%'+_0x2cb133['query'][_0x7e1d('0x43')]+'%'};return _0x33c0c1;})});}_0x55ccd4=_[_0x7e1d('0x44')]({},_0x55ccd4,_0x2cb133['options']);return _0x435e5c[_0x7e1d('0x59')](_0x55ccd4);}})[_0x7e1d('0x30')](function(_0x84247b){if(_0x84247b){_0x453457=_0x84247b['length'];if(!_0x2cb133[_0x7e1d('0x38')][_0x7e1d('0x3d')](_0x7e1d('0x3e'))){_0x55ccd4[_0x7e1d('0x28')]=qs['limit'](_0x2cb133[_0x7e1d('0x38')][_0x7e1d('0x28')]);_0x55ccd4['offset']=qs['offset'](_0x2cb133['query'][_0x7e1d('0x27')]);}return _0x435e5c[_0x7e1d('0x59')](_0x55ccd4);}})[_0x7e1d('0x30')](function(_0x15afa9){if(_0x15afa9){return _0x15afa9?{'count':_0x453457,'rows':_0x15afa9}:null;}})[_0x7e1d('0x30')](respondWithResult(_0x51ee29,null))[_0x7e1d('0x22')](handleError(_0x51ee29,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js index 7207651..21a3da0 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 _0x0125=['bluebird','request-promise','path','../../config/environment','./intSugarcrmConfiguration.attributes','define','SugarcrmConfiguration','int_sugarcrm_configurations','lodash','util','api'];(function(_0x1cf93c,_0x555867){var _0x62c25c=function(_0x1e4517){while(--_0x1e4517){_0x1cf93c['push'](_0x1cf93c['shift']());}};_0x62c25c(++_0x555867);}(_0x0125,0xce));var _0x5012=function(_0x44dba1,_0x270ad5){_0x44dba1=_0x44dba1-0x0;var _0x2fbd3f=_0x0125[_0x44dba1];return _0x2fbd3f;};'use strict';var _=require(_0x5012('0x0'));var util=require(_0x5012('0x1'));var logger=require('../../config/logger')(_0x5012('0x2'));var moment=require('moment');var BPromise=require(_0x5012('0x3'));var rp=require(_0x5012('0x4'));var fs=require('fs');var path=require(_0x5012('0x5'));var rimraf=require('rimraf');var config=require(_0x5012('0x6'));var attributes=require(_0x5012('0x7'));module['exports']=function(_0x3114ed,_0x23354a){return _0x3114ed[_0x5012('0x8')](_0x5012('0x9'),attributes,{'tableName':_0x5012('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x489c=['exports','define','SugarcrmConfiguration','int_sugarcrm_configurations','lodash','util','api','moment','path','rimraf','../../config/environment','./intSugarcrmConfiguration.attributes'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x489c,0x190));var _0xc489=function(_0x5b3788,_0x189ea5){_0x5b3788=_0x5b3788-0x0;var _0x206cbc=_0x489c[_0x5b3788];return _0x206cbc;};'use strict';var _=require(_0xc489('0x0'));var util=require(_0xc489('0x1'));var logger=require('../../config/logger')(_0xc489('0x2'));var moment=require(_0xc489('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xc489('0x4'));var rimraf=require(_0xc489('0x5'));var config=require(_0xc489('0x6'));var attributes=require(_0xc489('0x7'));module[_0xc489('0x8')]=function(_0x35fb13,_0x390d94){return _0x35fb13[_0xc489('0x9')](_0xc489('0xa'),attributes,{'tableName':_0xc489('0xb'),'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 e61edc0..eb4e72f 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 _0xe5ee=['randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','request\x20sent','stringify','error','SugarcrmConfiguration,\x20%s,\x20%s','message','catch','util','moment'];(function(_0x13ea00,_0x12f610){var _0x1f7347=function(_0x34ae63){while(--_0x34ae63){_0x13ea00['push'](_0x13ea00['shift']());}};_0x1f7347(++_0x12f610);}(_0xe5ee,0xd6));var _0xee5e=function(_0x39afb4,_0x570c33){_0x39afb4=_0x39afb4-0x0;var _0x478093=_0xe5ee[_0x39afb4];return _0x478093;};'use strict';var _=require('lodash');var util=require(_0xee5e('0x0'));var moment=require(_0xee5e('0x1'));var BPromise=require('bluebird');var rs=require(_0xee5e('0x2'));var fs=require('fs');var Redis=require(_0xee5e('0x3'));var db=require(_0xee5e('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xee5e('0x5'))(_0xee5e('0x6'));var config=require(_0xee5e('0x7'));var jayson=require(_0xee5e('0x8'));var client=jayson[_0xee5e('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x51939f,_0xe1269,_0x63dc04){return new BPromise(function(_0x1bfec8,_0x4e34ca){return client['request'](_0x51939f,_0x63dc04)[_0xee5e('0xa')](function(_0x198481){logger[_0xee5e('0xb')]('SugarcrmConfiguration,\x20%s,\x20%s',_0xe1269,'request\x20sent');logger['debug']('SugarcrmConfiguration,\x20%s,\x20%s,\x20%s',_0xe1269,_0xee5e('0xc'),JSON[_0xee5e('0xd')](_0x198481));if(_0x198481[_0xee5e('0xe')]){if(_0x198481[_0xee5e('0xe')]['code']===0x1f4){logger[_0xee5e('0xe')](_0xee5e('0xf'),_0xe1269,_0x198481[_0xee5e('0xe')][_0xee5e('0x10')]);return _0x4e34ca(_0x198481[_0xee5e('0xe')][_0xee5e('0x10')]);}logger[_0xee5e('0xe')](_0xee5e('0xf'),_0xe1269,_0x198481[_0xee5e('0xe')][_0xee5e('0x10')]);return _0x1bfec8(_0x198481['error'][_0xee5e('0x10')]);}else{logger['info'](_0xee5e('0xf'),_0xe1269,'request\x20sent');_0x1bfec8(_0x198481['result']['message']);}})[_0xee5e('0x11')](function(_0x1b932d){logger[_0xee5e('0xe')](_0xee5e('0xf'),_0xe1269,_0x1b932d);_0x4e34ca(_0x1b932d);});});} \ No newline at end of file +var _0x1851=['util','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','SugarcrmConfiguration,\x20%s,\x20%s','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','catch','lodash'];(function(_0x2b5eae,_0x55010d){var _0x5f3ac9=function(_0x397bfc){while(--_0x397bfc){_0x2b5eae['push'](_0x2b5eae['shift']());}};_0x5f3ac9(++_0x55010d);}(_0x1851,0x18e));var _0x1185=function(_0x1f3e0e,_0x10de28){_0x1f3e0e=_0x1f3e0e-0x0;var _0x41cce3=_0x1851[_0x1f3e0e];return _0x41cce3;};'use strict';var _=require(_0x1185('0x0'));var util=require(_0x1185('0x1'));var moment=require('moment');var BPromise=require(_0x1185('0x2'));var rs=require(_0x1185('0x3'));var fs=require('fs');var Redis=require(_0x1185('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x1185('0x5'))(_0x1185('0x6'));var config=require(_0x1185('0x7'));var jayson=require(_0x1185('0x8'));var client=jayson['client'][_0x1185('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x15f539,_0x3928b7,_0x5801de){return new BPromise(function(_0x42b75c,_0x139382){return client[_0x1185('0xa')](_0x15f539,_0x5801de)[_0x1185('0xb')](function(_0x9a256f){logger[_0x1185('0xc')](_0x1185('0xd'),_0x3928b7,'request\x20sent');logger['debug'](_0x1185('0xe'),_0x3928b7,'request\x20sent',JSON[_0x1185('0xf')](_0x9a256f));if(_0x9a256f[_0x1185('0x10')]){if(_0x9a256f[_0x1185('0x10')]['code']===0x1f4){logger['error'](_0x1185('0xd'),_0x3928b7,_0x9a256f[_0x1185('0x10')][_0x1185('0x11')]);return _0x139382(_0x9a256f[_0x1185('0x10')]['message']);}logger[_0x1185('0x10')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x3928b7,_0x9a256f[_0x1185('0x10')]['message']);return _0x42b75c(_0x9a256f[_0x1185('0x10')]['message']);}else{logger['info'](_0x1185('0xd'),_0x3928b7,_0x1185('0x12'));_0x42b75c(_0x9a256f[_0x1185('0x13')][_0x1185('0x11')]);}})[_0x1185('0x14')](function(_0x28a068){logger[_0x1185('0x10')](_0x1185('0xd'),_0x3928b7,_0x28a068);_0x139382(_0x28a068);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmField/index.js b/server/api/intSugarcrmField/index.js index 6cf919f..d5caea5 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 _0xa4a0=['../../components/interaction/service','../../config/environment','./intSugarcrmField.controller','get','isAuthenticated','index','/:id','show','create','put','update','destroy','exports','multer','util','path','express','Router'];(function(_0x47feab,_0x13c304){var _0x4ca67e=function(_0x474130){while(--_0x474130){_0x47feab['push'](_0x47feab['shift']());}};_0x4ca67e(++_0x13c304);}(_0xa4a0,0x9d));var _0x0a4a=function(_0x48ab27,_0x38120b){_0x48ab27=_0x48ab27-0x0;var _0x4392f3=_0xa4a0[_0x48ab27];return _0x4392f3;};'use strict';var multer=require(_0x0a4a('0x0'));var util=require(_0x0a4a('0x1'));var path=require(_0x0a4a('0x2'));var timeout=require('connect-timeout');var express=require(_0x0a4a('0x3'));var router=express[_0x0a4a('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x0a4a('0x5'));var config=require(_0x0a4a('0x6'));var controller=require(_0x0a4a('0x7'));router[_0x0a4a('0x8')]('/',auth[_0x0a4a('0x9')](),controller[_0x0a4a('0xa')]);router['get'](_0x0a4a('0xb'),auth['isAuthenticated'](),controller[_0x0a4a('0xc')]);router['post']('/',auth[_0x0a4a('0x9')](),controller[_0x0a4a('0xd')]);router[_0x0a4a('0xe')](_0x0a4a('0xb'),auth['isAuthenticated'](),controller[_0x0a4a('0xf')]);router['delete'](_0x0a4a('0xb'),auth[_0x0a4a('0x9')](),controller[_0x0a4a('0x10')]);module[_0x0a4a('0x11')]=router; \ No newline at end of file +var _0x2ea6=['../../components/interaction/service','../../config/environment','./intSugarcrmField.controller','get','isAuthenticated','/:id','show','destroy','exports','util','connect-timeout','express','../../components/auth/service'];(function(_0x3ccdf8,_0x584ceb){var _0x243dab=function(_0x1a90d1){while(--_0x1a90d1){_0x3ccdf8['push'](_0x3ccdf8['shift']());}};_0x243dab(++_0x584ceb);}(_0x2ea6,0x1a9));var _0x62ea=function(_0x419e17,_0x7fe78c){_0x419e17=_0x419e17-0x0;var _0x1f2044=_0x2ea6[_0x419e17];return _0x1f2044;};'use strict';var multer=require('multer');var util=require(_0x62ea('0x0'));var path=require('path');var timeout=require(_0x62ea('0x1'));var express=require(_0x62ea('0x2'));var router=express['Router']();var auth=require(_0x62ea('0x3'));var interaction=require(_0x62ea('0x4'));var config=require(_0x62ea('0x5'));var controller=require(_0x62ea('0x6'));router[_0x62ea('0x7')]('/',auth[_0x62ea('0x8')](),controller['index']);router['get'](_0x62ea('0x9'),auth['isAuthenticated'](),controller[_0x62ea('0xa')]);router['post']('/',auth[_0x62ea('0x8')](),controller['create']);router['put'](_0x62ea('0x9'),auth[_0x62ea('0x8')](),controller['update']);router['delete'](_0x62ea('0x9'),auth[_0x62ea('0x8')](),controller[_0x62ea('0xb')]);module[_0x62ea('0xc')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.attributes.js b/server/api/intSugarcrmField/intSugarcrmField.attributes.js index 289ce08..da7e454 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 _0x1580=['customVariable','keyValue','STRING','BOOLEAN','sequelize','exports','ENUM','string','variable'];(function(_0x45db6b,_0x397de5){var _0x152b0d=function(_0x376174){while(--_0x376174){_0x45db6b['push'](_0x45db6b['shift']());}};_0x152b0d(++_0x397de5);}(_0x1580,0x15a));var _0x0158=function(_0x169f32,_0x376627){_0x169f32=_0x169f32-0x0;var _0x5fbace=_0x1580[_0x169f32];return _0x5fbace;};'use strict';var Sequelize=require(_0x0158('0x0'));module[_0x0158('0x1')]={'type':{'type':Sequelize[_0x0158('0x2')](_0x0158('0x3'),_0x0158('0x4'),_0x0158('0x5'),_0x0158('0x6')),'defaultValue':'string'},'content':{'type':Sequelize[_0x0158('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x0158('0x2')](_0x0158('0x3'),'variable',_0x0158('0x5'))},'keyContent':{'type':Sequelize[_0x0158('0x7')]},'idField':{'type':Sequelize[_0x0158('0x7')]},'nameField':{'type':Sequelize[_0x0158('0x7')]},'customField':{'type':Sequelize[_0x0158('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x0f9f=['keyValue','STRING','variable','BOOLEAN','exports','ENUM','string','customVariable'];(function(_0x367c54,_0x22823a){var _0x4f2a9c=function(_0x25fb8d){while(--_0x25fb8d){_0x367c54['push'](_0x367c54['shift']());}};_0x4f2a9c(++_0x22823a);}(_0x0f9f,0x1cc));var _0xf0f9=function(_0x134c79,_0x2136d3){_0x134c79=_0x134c79-0x0;var _0x2c2142=_0x0f9f[_0x134c79];return _0x2c2142;};'use strict';var Sequelize=require('sequelize');module[_0xf0f9('0x0')]={'type':{'type':Sequelize[_0xf0f9('0x1')](_0xf0f9('0x2'),'variable',_0xf0f9('0x3'),_0xf0f9('0x4')),'defaultValue':_0xf0f9('0x2')},'content':{'type':Sequelize[_0xf0f9('0x5')]},'key':{'type':Sequelize[_0xf0f9('0x5')]},'keyType':{'type':Sequelize[_0xf0f9('0x1')](_0xf0f9('0x2'),_0xf0f9('0x6'),_0xf0f9('0x3'))},'keyContent':{'type':Sequelize[_0xf0f9('0x5')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xf0f9('0x5')]},'customField':{'type':Sequelize[_0xf0f9('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.controller.js b/server/api/intSugarcrmField/intSugarcrmField.controller.js index 92faf25..503b013 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 _0xc00a=['type','VIRTUAL','field','filter','merge','options','SugarcrmField','includeAll','include','findAll','rows','catch','find','create','body','update','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','sendStatus','json','count','offset','limit','status','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','index','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x3bb76b,_0x6f9a27){var _0x14fb9c=function(_0x2472ff){while(--_0x2472ff){_0x3bb76b['push'](_0x3bb76b['shift']());}};_0x14fb9c(++_0x6f9a27);}(_0xc00a,0xf2));var _0xac00=function(_0x97db75,_0x3abdb8){_0x97db75=_0x97db75-0x0;var _0x259a53=_0xc00a[_0x97db75];return _0x259a53;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xac00('0x0'));var rimraf=require(_0xac00('0x1'));var zipdir=require(_0xac00('0x2'));var jsonpatch=require(_0xac00('0x3'));var rp=require(_0xac00('0x4'));var moment=require(_0xac00('0x5'));var BPromise=require(_0xac00('0x6'));var Mustache=require('mustache');var util=require(_0xac00('0x7'));var path=require('path');var sox=require(_0xac00('0x8'));var csv=require(_0xac00('0x9'));var ejs=require(_0xac00('0xa'));var fs=require('fs');var _=require(_0xac00('0xb'));var squel=require(_0xac00('0xc'));var crypto=require(_0xac00('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xac00('0xe'));var toCsv=require(_0xac00('0x9'));var querystring=require(_0xac00('0xf'));var Papa=require(_0xac00('0x10'));var Redis=require(_0xac00('0x11'));var authService=require(_0xac00('0x12'));var qs=require(_0xac00('0x13'));var as=require(_0xac00('0x14'));var hardwareService=require(_0xac00('0x15'));var logger=require('../../config/logger')(_0xac00('0x16'));var utils=require(_0xac00('0x17'));var config=require(_0xac00('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xaee229,_0x412143){_0x412143=_0x412143||0xcc;return function(_0x53f082){if(_0x53f082){return _0xaee229[_0xac00('0x19')](_0x412143);}return _0xaee229['status'](_0x412143)['end']();};}function respondWithResult(_0x42133e,_0x1ab43b){_0x1ab43b=_0x1ab43b||0xc8;return function(_0x930167){if(_0x930167){return _0x42133e['status'](_0x1ab43b)[_0xac00('0x1a')](_0x930167);}};}function respondWithFilteredResult(_0x31a7b2,_0x5dd0ef){return function(_0x1c141c){if(_0x1c141c){var _0x2a8fb5=_0x1c141c[_0xac00('0x1b')],_0x4623a8=_0x5dd0ef[_0xac00('0x1c')],_0x1dd5e6=_0x5dd0ef['offset']+_0x5dd0ef[_0xac00('0x1d')],_0x1ae3d2;if(_0x1dd5e6>=_0x2a8fb5){_0x1dd5e6=_0x2a8fb5;_0x1ae3d2=0xc8;}else{_0x1ae3d2=0xce;}_0x31a7b2[_0xac00('0x1e')](_0x1ae3d2);return _0x31a7b2[_0xac00('0x1f')](_0xac00('0x20'),_0x4623a8+'-'+_0x1dd5e6+'/'+_0x2a8fb5)['json'](_0x1c141c);}return null;};}function patchUpdates(_0x58dd4e){return function(_0x41a300){try{jsonpatch[_0xac00('0x21')](_0x41a300,_0x58dd4e,!![]);}catch(_0x48bd8d){return BPromise[_0xac00('0x22')](_0x48bd8d);}return _0x41a300[_0xac00('0x23')]();};}function saveUpdates(_0x503db8,_0xb4c0a6){return function(_0x5c61a0){if(_0x5c61a0){return _0x5c61a0['update'](_0x503db8)[_0xac00('0x24')](function(_0x5a2bab){return _0x5a2bab;});}return null;};}function removeEntity(_0x104caf,_0x2c9955){return function(_0x5abbf8){if(_0x5abbf8){return _0x5abbf8[_0xac00('0x25')]()[_0xac00('0x24')](function(){_0x104caf[_0xac00('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2b9a29,_0x56b298){return function(_0x5741a1){if(!_0x5741a1){_0x2b9a29['sendStatus'](0x194);}return _0x5741a1;};}function handleError(_0x4395c8,_0x1507f3){_0x1507f3=_0x1507f3||0x1f4;return function(_0x566e52){logger[_0xac00('0x26')](_0x566e52[_0xac00('0x27')]);if(_0x566e52['name']){delete _0x566e52[_0xac00('0x28')];}_0x4395c8[_0xac00('0x1e')](_0x1507f3)[_0xac00('0x29')](_0x566e52);};}exports[_0xac00('0x2a')]=function(_0x2c2162,_0x30213f){var _0x174345={},_0x5dcf0a={},_0x1e8f5c={'count':0x0,'rows':[]};var _0x306ff4=db['SugarcrmField'][_0xac00('0x2b')];_0x5dcf0a[_0xac00('0x2c')]=_[_0xac00('0x2d')](_0x306ff4);_0x5dcf0a[_0xac00('0x2e')]=_[_0xac00('0x2d')](_0x2c2162[_0xac00('0x2e')]);_0x5dcf0a[_0xac00('0x2f')]=_[_0xac00('0x30')](_0x5dcf0a['model'],_0x5dcf0a[_0xac00('0x2e')]);_0x174345[_0xac00('0x31')]=_[_0xac00('0x30')](_0x5dcf0a[_0xac00('0x2c')],qs[_0xac00('0x32')](_0x2c2162[_0xac00('0x2e')][_0xac00('0x32')]));_0x174345[_0xac00('0x31')]=_0x174345[_0xac00('0x31')][_0xac00('0x33')]?_0x174345['attributes']:_0x5dcf0a[_0xac00('0x2c')];if(!_0x2c2162[_0xac00('0x2e')][_0xac00('0x34')](_0xac00('0x35'))){_0x174345['limit']=qs[_0xac00('0x1d')](_0x2c2162['query'][_0xac00('0x1d')]);_0x174345[_0xac00('0x1c')]=qs['offset'](_0x2c2162[_0xac00('0x2e')][_0xac00('0x1c')]);}_0x174345[_0xac00('0x36')]=qs[_0xac00('0x37')](_0x2c2162['query'][_0xac00('0x37')]);_0x174345[_0xac00('0x38')]=qs[_0xac00('0x2f')](_[_0xac00('0x39')](_0x2c2162[_0xac00('0x2e')],_0x5dcf0a['filters']));if(_0x2c2162[_0xac00('0x2e')]['filter']){_0x174345[_0xac00('0x38')]=_['merge'](_0x174345[_0xac00('0x38')],{'$or':_['map'](_0x306ff4,function(_0x1477bc){if(_0x1477bc[_0xac00('0x3a')]['key']!==_0xac00('0x3b')){var _0x17e95d={};_0x17e95d[_0x1477bc[_0xac00('0x3c')]]={'$like':'%'+_0x2c2162[_0xac00('0x2e')][_0xac00('0x3d')]+'%'};return _0x17e95d;}})});}_0x174345=_[_0xac00('0x3e')]({},_0x174345,_0x2c2162[_0xac00('0x3f')]);var _0x110cdc={'where':_0x174345[_0xac00('0x38')]};return db[_0xac00('0x40')][_0xac00('0x1b')](_0x110cdc)[_0xac00('0x24')](function(_0x35bfe9){_0x1e8f5c['count']=_0x35bfe9;if(_0x2c2162[_0xac00('0x2e')][_0xac00('0x41')]){_0x174345[_0xac00('0x42')]=[{'all':!![]}];}return db[_0xac00('0x40')][_0xac00('0x43')](_0x174345);})[_0xac00('0x24')](function(_0x2dd826){_0x1e8f5c[_0xac00('0x44')]=_0x2dd826;return _0x1e8f5c;})[_0xac00('0x24')](respondWithFilteredResult(_0x30213f,_0x174345))[_0xac00('0x45')](handleError(_0x30213f,null));};exports['show']=function(_0x1de170,_0x5f3a59){var _0x33292f={'raw':!![],'where':{'id':_0x1de170['params']['id']}},_0x15099c={};_0x15099c[_0xac00('0x2c')]=_[_0xac00('0x2d')](db[_0xac00('0x40')]['rawAttributes']);_0x15099c['query']=_[_0xac00('0x2d')](_0x1de170[_0xac00('0x2e')]);_0x15099c[_0xac00('0x2f')]=_[_0xac00('0x30')](_0x15099c[_0xac00('0x2c')],_0x15099c['query']);_0x33292f[_0xac00('0x31')]=_[_0xac00('0x30')](_0x15099c['model'],qs[_0xac00('0x32')](_0x1de170[_0xac00('0x2e')][_0xac00('0x32')]));_0x33292f[_0xac00('0x31')]=_0x33292f[_0xac00('0x31')][_0xac00('0x33')]?_0x33292f[_0xac00('0x31')]:_0x15099c[_0xac00('0x2c')];if(_0x1de170['query'][_0xac00('0x41')]){_0x33292f[_0xac00('0x42')]=[{'all':!![]}];}_0x33292f=_['merge']({},_0x33292f,_0x1de170[_0xac00('0x3f')]);return db[_0xac00('0x40')][_0xac00('0x46')](_0x33292f)[_0xac00('0x24')](handleEntityNotFound(_0x5f3a59,null))['then'](respondWithResult(_0x5f3a59,null))[_0xac00('0x45')](handleError(_0x5f3a59,null));};exports[_0xac00('0x47')]=function(_0x46c656,_0x18ea41){return db[_0xac00('0x40')]['create'](_0x46c656[_0xac00('0x48')],{})[_0xac00('0x24')](respondWithResult(_0x18ea41,0xc9))[_0xac00('0x45')](handleError(_0x18ea41,null));};exports[_0xac00('0x49')]=function(_0x2e76f3,_0x399109){if(_0x2e76f3[_0xac00('0x48')]['id']){delete _0x2e76f3[_0xac00('0x48')]['id'];}return db[_0xac00('0x40')][_0xac00('0x46')]({'where':{'id':_0x2e76f3[_0xac00('0x4a')]['id']}})['then'](handleEntityNotFound(_0x399109,null))[_0xac00('0x24')](saveUpdates(_0x2e76f3['body'],null))['then'](respondWithResult(_0x399109,null))[_0xac00('0x45')](handleError(_0x399109,null));};exports[_0xac00('0x25')]=function(_0x5a2df7,_0x372478){return db[_0xac00('0x40')][_0xac00('0x46')]({'where':{'id':_0x5a2df7[_0xac00('0x4a')]['id']}})[_0xac00('0x24')](handleEntityNotFound(_0x372478,null))['then'](removeEntity(_0x372478,null))[_0xac00('0x45')](handleError(_0x372478,null));}; \ No newline at end of file +var _0x3c04=['model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','type','key','VIRTUAL','field','filter','options','SugarcrmField','includeAll','include','findAll','rows','catch','show','params','find','create','body','destroy','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','end','status','json','count','offset','limit','Content-Range','apply','reject','save','update','then','stack','name','send','index','rawAttributes'];(function(_0x5ad0e1,_0x2466be){var _0x355c7b=function(_0x303667){while(--_0x303667){_0x5ad0e1['push'](_0x5ad0e1['shift']());}};_0x355c7b(++_0x2466be);}(_0x3c04,0xb0));var _0x43c0=function(_0x26318f,_0xda0b2f){_0x26318f=_0x26318f-0x0;var _0x5cdcd7=_0x3c04[_0x26318f];return _0x5cdcd7;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x43c0('0x0'));var zipdir=require(_0x43c0('0x1'));var jsonpatch=require(_0x43c0('0x2'));var rp=require(_0x43c0('0x3'));var moment=require('moment');var BPromise=require(_0x43c0('0x4'));var Mustache=require(_0x43c0('0x5'));var util=require(_0x43c0('0x6'));var path=require('path');var sox=require(_0x43c0('0x7'));var csv=require(_0x43c0('0x8'));var ejs=require(_0x43c0('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0x43c0('0xa'));var crypto=require('crypto');var jsforce=require(_0x43c0('0xb'));var deskjs=require(_0x43c0('0xc'));var toCsv=require(_0x43c0('0x8'));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('../../config/logger')(_0x43c0('0x13'));var utils=require(_0x43c0('0x14'));var config=require('../../config/environment');var db=require(_0x43c0('0x15'))['db'];function respondWithStatusCode(_0x153f50,_0x43c5e3){_0x43c5e3=_0x43c5e3||0xcc;return function(_0x5c4f14){if(_0x5c4f14){return _0x153f50[_0x43c0('0x16')](_0x43c5e3);}return _0x153f50['status'](_0x43c5e3)[_0x43c0('0x17')]();};}function respondWithResult(_0x493944,_0x4ce67c){_0x4ce67c=_0x4ce67c||0xc8;return function(_0x24e338){if(_0x24e338){return _0x493944[_0x43c0('0x18')](_0x4ce67c)[_0x43c0('0x19')](_0x24e338);}};}function respondWithFilteredResult(_0x4aa902,_0x257cfe){return function(_0x3e6b9a){if(_0x3e6b9a){var _0x28ccd1=_0x3e6b9a[_0x43c0('0x1a')],_0x158680=_0x257cfe[_0x43c0('0x1b')],_0x1fb078=_0x257cfe['offset']+_0x257cfe[_0x43c0('0x1c')],_0x3c4c07;if(_0x1fb078>=_0x28ccd1){_0x1fb078=_0x28ccd1;_0x3c4c07=0xc8;}else{_0x3c4c07=0xce;}_0x4aa902['status'](_0x3c4c07);return _0x4aa902['set'](_0x43c0('0x1d'),_0x158680+'-'+_0x1fb078+'/'+_0x28ccd1)[_0x43c0('0x19')](_0x3e6b9a);}return null;};}function patchUpdates(_0x58ec13){return function(_0x1918d0){try{jsonpatch[_0x43c0('0x1e')](_0x1918d0,_0x58ec13,!![]);}catch(_0x41044f){return BPromise[_0x43c0('0x1f')](_0x41044f);}return _0x1918d0[_0x43c0('0x20')]();};}function saveUpdates(_0x3f9527,_0x4828c0){return function(_0x4ebf53){if(_0x4ebf53){return _0x4ebf53[_0x43c0('0x21')](_0x3f9527)[_0x43c0('0x22')](function(_0xbdf74d){return _0xbdf74d;});}return null;};}function removeEntity(_0x58c5c6,_0x2473c0){return function(_0xbf166d){if(_0xbf166d){return _0xbf166d['destroy']()[_0x43c0('0x22')](function(){_0x58c5c6['status'](0xcc)[_0x43c0('0x17')]();});}};}function handleEntityNotFound(_0x4a7be5,_0x51661f){return function(_0x38de69){if(!_0x38de69){_0x4a7be5[_0x43c0('0x16')](0x194);}return _0x38de69;};}function handleError(_0x4989fa,_0x57512a){_0x57512a=_0x57512a||0x1f4;return function(_0x158d4e){logger['error'](_0x158d4e[_0x43c0('0x23')]);if(_0x158d4e[_0x43c0('0x24')]){delete _0x158d4e[_0x43c0('0x24')];}_0x4989fa[_0x43c0('0x18')](_0x57512a)[_0x43c0('0x25')](_0x158d4e);};}exports[_0x43c0('0x26')]=function(_0x1cde2e,_0x6a2e71){var _0x4a77a2={},_0x23a40c={},_0x16fc26={'count':0x0,'rows':[]};var _0x2ca200=db['SugarcrmField'][_0x43c0('0x27')];_0x23a40c[_0x43c0('0x28')]=_[_0x43c0('0x29')](_0x2ca200);_0x23a40c['query']=_[_0x43c0('0x29')](_0x1cde2e[_0x43c0('0x2a')]);_0x23a40c[_0x43c0('0x2b')]=_[_0x43c0('0x2c')](_0x23a40c[_0x43c0('0x28')],_0x23a40c[_0x43c0('0x2a')]);_0x4a77a2[_0x43c0('0x2d')]=_[_0x43c0('0x2c')](_0x23a40c[_0x43c0('0x28')],qs[_0x43c0('0x2e')](_0x1cde2e[_0x43c0('0x2a')][_0x43c0('0x2e')]));_0x4a77a2[_0x43c0('0x2d')]=_0x4a77a2[_0x43c0('0x2d')][_0x43c0('0x2f')]?_0x4a77a2[_0x43c0('0x2d')]:_0x23a40c[_0x43c0('0x28')];if(!_0x1cde2e[_0x43c0('0x2a')][_0x43c0('0x30')](_0x43c0('0x31'))){_0x4a77a2[_0x43c0('0x1c')]=qs[_0x43c0('0x1c')](_0x1cde2e[_0x43c0('0x2a')][_0x43c0('0x1c')]);_0x4a77a2[_0x43c0('0x1b')]=qs[_0x43c0('0x1b')](_0x1cde2e['query']['offset']);}_0x4a77a2[_0x43c0('0x32')]=qs[_0x43c0('0x33')](_0x1cde2e[_0x43c0('0x2a')][_0x43c0('0x33')]);_0x4a77a2[_0x43c0('0x34')]=qs[_0x43c0('0x2b')](_['pick'](_0x1cde2e[_0x43c0('0x2a')],_0x23a40c['filters']));if(_0x1cde2e[_0x43c0('0x2a')]['filter']){_0x4a77a2['where']=_[_0x43c0('0x35')](_0x4a77a2['where'],{'$or':_['map'](_0x2ca200,function(_0xf4fb46){if(_0xf4fb46[_0x43c0('0x36')][_0x43c0('0x37')]!==_0x43c0('0x38')){var _0x33008f={};_0x33008f[_0xf4fb46[_0x43c0('0x39')]]={'$like':'%'+_0x1cde2e[_0x43c0('0x2a')][_0x43c0('0x3a')]+'%'};return _0x33008f;}})});}_0x4a77a2=_[_0x43c0('0x35')]({},_0x4a77a2,_0x1cde2e[_0x43c0('0x3b')]);var _0x19f6f3={'where':_0x4a77a2['where']};return db[_0x43c0('0x3c')][_0x43c0('0x1a')](_0x19f6f3)[_0x43c0('0x22')](function(_0x37f346){_0x16fc26['count']=_0x37f346;if(_0x1cde2e[_0x43c0('0x2a')][_0x43c0('0x3d')]){_0x4a77a2[_0x43c0('0x3e')]=[{'all':!![]}];}return db['SugarcrmField'][_0x43c0('0x3f')](_0x4a77a2);})[_0x43c0('0x22')](function(_0x3a1881){_0x16fc26[_0x43c0('0x40')]=_0x3a1881;return _0x16fc26;})[_0x43c0('0x22')](respondWithFilteredResult(_0x6a2e71,_0x4a77a2))[_0x43c0('0x41')](handleError(_0x6a2e71,null));};exports[_0x43c0('0x42')]=function(_0x1bc749,_0x36dd98){var _0x79ab8={'raw':!![],'where':{'id':_0x1bc749[_0x43c0('0x43')]['id']}},_0x594b50={};_0x594b50['model']=_[_0x43c0('0x29')](db[_0x43c0('0x3c')][_0x43c0('0x27')]);_0x594b50[_0x43c0('0x2a')]=_['keys'](_0x1bc749[_0x43c0('0x2a')]);_0x594b50[_0x43c0('0x2b')]=_[_0x43c0('0x2c')](_0x594b50[_0x43c0('0x28')],_0x594b50['query']);_0x79ab8[_0x43c0('0x2d')]=_[_0x43c0('0x2c')](_0x594b50[_0x43c0('0x28')],qs['fields'](_0x1bc749[_0x43c0('0x2a')][_0x43c0('0x2e')]));_0x79ab8[_0x43c0('0x2d')]=_0x79ab8[_0x43c0('0x2d')][_0x43c0('0x2f')]?_0x79ab8['attributes']:_0x594b50[_0x43c0('0x28')];if(_0x1bc749[_0x43c0('0x2a')][_0x43c0('0x3d')]){_0x79ab8['include']=[{'all':!![]}];}_0x79ab8=_['merge']({},_0x79ab8,_0x1bc749[_0x43c0('0x3b')]);return db[_0x43c0('0x3c')][_0x43c0('0x44')](_0x79ab8)['then'](handleEntityNotFound(_0x36dd98,null))[_0x43c0('0x22')](respondWithResult(_0x36dd98,null))[_0x43c0('0x41')](handleError(_0x36dd98,null));};exports[_0x43c0('0x45')]=function(_0x4d64bc,_0x39c26b){return db[_0x43c0('0x3c')]['create'](_0x4d64bc['body'],{})[_0x43c0('0x22')](respondWithResult(_0x39c26b,0xc9))[_0x43c0('0x41')](handleError(_0x39c26b,null));};exports[_0x43c0('0x21')]=function(_0x2d82de,_0x3d9d23){if(_0x2d82de[_0x43c0('0x46')]['id']){delete _0x2d82de['body']['id'];}return db[_0x43c0('0x3c')][_0x43c0('0x44')]({'where':{'id':_0x2d82de[_0x43c0('0x43')]['id']}})[_0x43c0('0x22')](handleEntityNotFound(_0x3d9d23,null))['then'](saveUpdates(_0x2d82de[_0x43c0('0x46')],null))[_0x43c0('0x22')](respondWithResult(_0x3d9d23,null))['catch'](handleError(_0x3d9d23,null));};exports[_0x43c0('0x47')]=function(_0x29435e,_0x455edf){return db['SugarcrmField'][_0x43c0('0x44')]({'where':{'id':_0x29435e[_0x43c0('0x43')]['id']}})[_0x43c0('0x22')](handleEntityNotFound(_0x455edf,null))[_0x43c0('0x22')](removeEntity(_0x455edf,null))[_0x43c0('0x41')](handleError(_0x455edf,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.model.js b/server/api/intSugarcrmField/intSugarcrmField.model.js index 763f47e..fc99344 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 _0x5c63=['sugarcrm_unique_index','FieldId','lodash','util','../../config/logger','api','rimraf','./intSugarcrmField.attributes','exports','define','SugarcrmField'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0x5c63,0x178));var _0x35c6=function(_0x4b2afd,_0x3921f7){_0x4b2afd=_0x4b2afd-0x0;var _0x1ea181=_0x5c63[_0x4b2afd];return _0x1ea181;};'use strict';var _=require(_0x35c6('0x0'));var util=require(_0x35c6('0x1'));var logger=require(_0x35c6('0x2'))(_0x35c6('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x35c6('0x4'));var config=require('../../config/environment');var attributes=require(_0x35c6('0x5'));module[_0x35c6('0x6')]=function(_0xc2910e,_0x4a413b){return _0xc2910e[_0x35c6('0x7')](_0x35c6('0x8'),attributes,{'tableName':'int_sugarcrm_fields','paranoid':![],'indexes':[{'name':_0x35c6('0x9'),'fields':['idField',_0x35c6('0xa')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xf026=['bluebird','rimraf','../../config/environment','./intSugarcrmField.attributes','exports','define','SugarcrmField','int_sugarcrm_fields','sugarcrm_unique_index','lodash','util','../../config/logger','api'];(function(_0x360368,_0x311112){var _0x4a9a3a=function(_0x1e0e26){while(--_0x1e0e26){_0x360368['push'](_0x360368['shift']());}};_0x4a9a3a(++_0x311112);}(_0xf026,0xe6));var _0x6f02=function(_0x4aa4e6,_0x278c45){_0x4aa4e6=_0x4aa4e6-0x0;var _0x322588=_0xf026[_0x4aa4e6];return _0x322588;};'use strict';var _=require(_0x6f02('0x0'));var util=require(_0x6f02('0x1'));var logger=require(_0x6f02('0x2'))(_0x6f02('0x3'));var moment=require('moment');var BPromise=require(_0x6f02('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x6f02('0x5'));var config=require(_0x6f02('0x6'));var attributes=require(_0x6f02('0x7'));module[_0x6f02('0x8')]=function(_0x4f3358,_0x548a6e){return _0x4f3358[_0x6f02('0x9')](_0x6f02('0xa'),attributes,{'tableName':_0x6f02('0xb'),'paranoid':![],'indexes':[{'name':_0x6f02('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 d88e5be..55abf21 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 _0x2032=['ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','SugarcrmField,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','result','catch','util','moment','bluebird'];(function(_0x2d493c,_0x69515d){var _0x5f3214=function(_0x170bef){while(--_0x170bef){_0x2d493c['push'](_0x2d493c['shift']());}};_0x5f3214(++_0x69515d);}(_0x2032,0xd9));var _0x2203=function(_0x1cb909,_0x2800e1){_0x1cb909=_0x1cb909-0x0;var _0x511110=_0x2032[_0x1cb909];return _0x511110;};'use strict';var _=require('lodash');var util=require(_0x2203('0x0'));var moment=require(_0x2203('0x1'));var BPromise=require(_0x2203('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2203('0x3'));var db=require(_0x2203('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x2203('0x5'))(_0x2203('0x6'));var config=require(_0x2203('0x7'));var jayson=require(_0x2203('0x8'));var client=jayson[_0x2203('0x9')][_0x2203('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2e0f63,_0x2676aa,_0x18c4d6){return new BPromise(function(_0x2049ff,_0x2999ed){return client['request'](_0x2e0f63,_0x18c4d6)['then'](function(_0x10f055){logger['info'](_0x2203('0xb'),_0x2676aa,_0x2203('0xc'));logger[_0x2203('0xd')]('SugarcrmField,\x20%s,\x20%s,\x20%s',_0x2676aa,_0x2203('0xc'),JSON['stringify'](_0x10f055));if(_0x10f055[_0x2203('0xe')]){if(_0x10f055['error'][_0x2203('0xf')]===0x1f4){logger[_0x2203('0xe')]('SugarcrmField,\x20%s,\x20%s',_0x2676aa,_0x10f055['error']['message']);return _0x2999ed(_0x10f055['error']['message']);}logger[_0x2203('0xe')]('SugarcrmField,\x20%s,\x20%s',_0x2676aa,_0x10f055['error'][_0x2203('0x10')]);return _0x2049ff(_0x10f055[_0x2203('0xe')][_0x2203('0x10')]);}else{logger[_0x2203('0x11')](_0x2203('0xb'),_0x2676aa,_0x2203('0xc'));_0x2049ff(_0x10f055[_0x2203('0x12')][_0x2203('0x10')]);}})[_0x2203('0x13')](function(_0x3053f3){logger['error'](_0x2203('0xb'),_0x2676aa,_0x3053f3);_0x2999ed(_0x3053f3);});});} \ No newline at end of file +var _0x2032=['ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','SugarcrmField,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','result','catch','util','moment','bluebird'];(function(_0x480ead,_0x2f79c7){var _0x45a000=function(_0x238917){while(--_0x238917){_0x480ead['push'](_0x480ead['shift']());}};_0x45a000(++_0x2f79c7);}(_0x2032,0xd9));var _0x2203=function(_0x45414a,_0x49106f){_0x45414a=_0x45414a-0x0;var _0x24fed8=_0x2032[_0x45414a];return _0x24fed8;};'use strict';var _=require('lodash');var util=require(_0x2203('0x0'));var moment=require(_0x2203('0x1'));var BPromise=require(_0x2203('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2203('0x3'));var db=require(_0x2203('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x2203('0x5'))(_0x2203('0x6'));var config=require(_0x2203('0x7'));var jayson=require(_0x2203('0x8'));var client=jayson[_0x2203('0x9')][_0x2203('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2e0f63,_0x2676aa,_0x18c4d6){return new BPromise(function(_0x2049ff,_0x2999ed){return client['request'](_0x2e0f63,_0x18c4d6)['then'](function(_0x10f055){logger['info'](_0x2203('0xb'),_0x2676aa,_0x2203('0xc'));logger[_0x2203('0xd')]('SugarcrmField,\x20%s,\x20%s,\x20%s',_0x2676aa,_0x2203('0xc'),JSON['stringify'](_0x10f055));if(_0x10f055[_0x2203('0xe')]){if(_0x10f055['error'][_0x2203('0xf')]===0x1f4){logger[_0x2203('0xe')]('SugarcrmField,\x20%s,\x20%s',_0x2676aa,_0x10f055['error']['message']);return _0x2999ed(_0x10f055['error']['message']);}logger[_0x2203('0xe')]('SugarcrmField,\x20%s,\x20%s',_0x2676aa,_0x10f055['error'][_0x2203('0x10')]);return _0x2049ff(_0x10f055[_0x2203('0xe')][_0x2203('0x10')]);}else{logger[_0x2203('0x11')](_0x2203('0xb'),_0x2676aa,_0x2203('0xc'));_0x2049ff(_0x10f055[_0x2203('0x12')][_0x2203('0x10')]);}})[_0x2203('0x13')](function(_0x3053f3){logger['error'](_0x2203('0xb'),_0x2676aa,_0x3053f3);_0x2999ed(_0x3053f3);});});} \ No newline at end of file diff --git a/server/api/intVtigerAccount/index.js b/server/api/intVtigerAccount/index.js index 76781af..4c99e39 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 _0x49f5=['/:id','show','getFields','create','/:id/configurations','addConfiguration','put','update','delete','destroy','exports','multer','util','path','express','Router','../../config/environment','./intVtigerAccount.controller','get','isAuthenticated','index'];(function(_0x341a29,_0x10f2b7){var _0x200d28=function(_0x242bff){while(--_0x242bff){_0x341a29['push'](_0x341a29['shift']());}};_0x200d28(++_0x10f2b7);}(_0x49f5,0xb3));var _0x549f=function(_0x13ce62,_0x189733){_0x13ce62=_0x13ce62-0x0;var _0x659d2=_0x49f5[_0x13ce62];return _0x659d2;};'use strict';var multer=require(_0x549f('0x0'));var util=require(_0x549f('0x1'));var path=require(_0x549f('0x2'));var timeout=require('connect-timeout');var express=require(_0x549f('0x3'));var router=express[_0x549f('0x4')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x549f('0x5'));var controller=require(_0x549f('0x6'));router[_0x549f('0x7')]('/',auth[_0x549f('0x8')](),controller[_0x549f('0x9')]);router[_0x549f('0x7')](_0x549f('0xa'),auth[_0x549f('0x8')](),controller[_0x549f('0xb')]);router[_0x549f('0x7')]('/:id/configurations',auth[_0x549f('0x8')](),controller['getConfigurations']);router['get']('/:id/fields',auth[_0x549f('0x8')](),controller[_0x549f('0xc')]);router['post']('/',auth[_0x549f('0x8')](),controller[_0x549f('0xd')]);router['post'](_0x549f('0xe'),auth[_0x549f('0x8')](),controller[_0x549f('0xf')]);router[_0x549f('0x10')](_0x549f('0xa'),auth[_0x549f('0x8')](),controller[_0x549f('0x11')]);router[_0x549f('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x549f('0x13')]);module[_0x549f('0x14')]=router; \ No newline at end of file +var _0xe687=['isAuthenticated','/:id/fields','getFields','post','addConfiguration','update','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get','index','/:id','show','/:id/configurations'];(function(_0x4d1d84,_0x2d48b3){var _0x64337b=function(_0x5c4b9e){while(--_0x5c4b9e){_0x4d1d84['push'](_0x4d1d84['shift']());}};_0x64337b(++_0x2d48b3);}(_0xe687,0xef));var _0x7e68=function(_0x4f30f3,_0x31b2b8){_0x4f30f3=_0x4f30f3-0x0;var _0x194acf=_0xe687[_0x4f30f3];return _0x194acf;};'use strict';var multer=require(_0x7e68('0x0'));var util=require(_0x7e68('0x1'));var path=require(_0x7e68('0x2'));var timeout=require(_0x7e68('0x3'));var express=require(_0x7e68('0x4'));var router=express[_0x7e68('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x7e68('0x6'));var config=require(_0x7e68('0x7'));var controller=require('./intVtigerAccount.controller');router[_0x7e68('0x8')]('/',auth['isAuthenticated'](),controller[_0x7e68('0x9')]);router['get'](_0x7e68('0xa'),auth['isAuthenticated'](),controller[_0x7e68('0xb')]);router[_0x7e68('0x8')](_0x7e68('0xc'),auth[_0x7e68('0xd')](),controller['getConfigurations']);router[_0x7e68('0x8')](_0x7e68('0xe'),auth[_0x7e68('0xd')](),controller[_0x7e68('0xf')]);router['post']('/',auth[_0x7e68('0xd')](),controller['create']);router[_0x7e68('0x10')](_0x7e68('0xc'),auth['isAuthenticated'](),controller[_0x7e68('0x11')]);router['put'](_0x7e68('0xa'),auth[_0x7e68('0xd')](),controller[_0x7e68('0x12')]);router[_0x7e68('0x13')](_0x7e68('0xa'),auth[_0x7e68('0xd')](),controller['destroy']);module[_0x7e68('0x14')]=router; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.attributes.js b/server/api/intVtigerAccount/intVtigerAccount.attributes.js index 8e15b50..fb58815 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 _0x4084=['HelpDesk','sequelize','STRING'];(function(_0x1e2cd9,_0x30dd29){var _0x399960=function(_0x10e6df){while(--_0x10e6df){_0x1e2cd9['push'](_0x1e2cd9['shift']());}};_0x399960(++_0x30dd29);}(_0x4084,0xd6));var _0x4408=function(_0x161e05,_0x521fa3){_0x161e05=_0x161e05-0x0;var _0x253f8e=_0x4084[_0x161e05];return _0x253f8e;};'use strict';var Sequelize=require(_0x4408('0x0'));module['exports']={'name':{'type':Sequelize[_0x4408('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x4408('0x1')]},'username':{'type':Sequelize['STRING'],'allowNull':![]},'moduleName':{'type':Sequelize[_0x4408('0x1')],'allowNull':![],'defaultValue':_0x4408('0x2')},'remoteUri':{'type':Sequelize['STRING'],'allowNull':![]},'serverUrl':{'type':Sequelize[_0x4408('0x1')]},'accessKey':{'type':Sequelize[_0x4408('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0x6682=['exports','STRING','HelpDesk','sequelize'];(function(_0x13e741,_0x5d3c24){var _0x3f8bb3=function(_0x4440a0){while(--_0x4440a0){_0x13e741['push'](_0x13e741['shift']());}};_0x3f8bb3(++_0x5d3c24);}(_0x6682,0x137));var _0x2668=function(_0x4eaafd,_0x1d584d){_0x4eaafd=_0x4eaafd-0x0;var _0x30a344=_0x6682[_0x4eaafd];return _0x30a344;};'use strict';var Sequelize=require(_0x2668('0x0'));module[_0x2668('0x1')]={'name':{'type':Sequelize[_0x2668('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x2668('0x2')]},'username':{'type':Sequelize[_0x2668('0x2')],'allowNull':![]},'moduleName':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x2668('0x3')},'remoteUri':{'type':Sequelize[_0x2668('0x2')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0x2668('0x2')]},'accessKey':{'type':Sequelize[_0x2668('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.controller.js b/server/api/intVtigerAccount/intVtigerAccount.controller.js index 0e7f62f..342d016 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 _0x152f=['count','offset','set','Content-Range','apply','reject','stack','name','send','index','VtigerAccount','rawAttributes','keys','query','intersection','model','attributes','fields','hasOwnProperty','nolimit','limit','sort','where','pick','filters','merge','map','key','VIRTUAL','filter','includeAll','include','findAll','rows','show','params','length','options','find','create','body','update','destroy','findOne','order','getConfigurations','addConfiguration','AccountId','Subjects','channel','Descriptions','getDescriptions','VtigerConfiguration','VtigerField','md5','getFields','username','moduleName','remoteUri','serverUrl','substring','lastIndexOf','format','%s/webservice.php','GET','getchallenge','POST','login','token','success','describe','sessionName','reference','owner','includes','type','remove','editable','label','startsWith','cf_','picklist','value','log','vTiger\x20error:\x20','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','eml-format','rimraf','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','request','then','VtigerAccount,\x20%s,\x20%s','request\x20sent','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json'];(function(_0x10afad,_0x30da9d){var _0x588d7e=function(_0x25e897){while(--_0x25e897){_0x10afad['push'](_0x10afad['shift']());}};_0x588d7e(++_0x30da9d);}(_0x152f,0x1eb));var _0xf152=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x152f[_0x14add3];return _0x4a174f;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xf152('0x0'));var rimraf=require(_0xf152('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf152('0x2'));var rp=require('request-promise');var moment=require(_0xf152('0x3'));var BPromise=require(_0xf152('0x4'));var Mustache=require('mustache');var util=require(_0xf152('0x5'));var path=require(_0xf152('0x6'));var sox=require(_0xf152('0x7'));var csv=require(_0xf152('0x8'));var ejs=require(_0xf152('0x9'));var fs=require('fs');var _=require(_0xf152('0xa'));var squel=require(_0xf152('0xb'));var crypto=require(_0xf152('0xc'));var jsforce=require(_0xf152('0xd'));var deskjs=require(_0xf152('0xe'));var toCsv=require('to-csv');var querystring=require(_0xf152('0xf'));var Papa=require(_0xf152('0x10'));var Redis=require(_0xf152('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xf152('0x12'));var as=require(_0xf152('0x13'));var hardwareService=require(_0xf152('0x14'));var logger=require(_0xf152('0x15'))(_0xf152('0x16'));var utils=require(_0xf152('0x17'));var config=require(_0xf152('0x18'));var db=require(_0xf152('0x19'))['db'];var integrations=require(_0xf152('0x1a'));var jayson=require(_0xf152('0x1b'));var client=jayson[_0xf152('0x1c')]['http']({'port':0x232a});function checkPasswordPattern(_0x5d8a73,_0x1d6ed9,_0x3d6743){if(_0x3d6743){var _0x61bd93=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x61bd93['test'](_0x1d6ed9)){return _0x5d8a73;}else{throw new Error('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x5d8a73;}}function respondWithRpcPromise(_0x6ccd3d,_0x4ce122,_0x2b943f,_0x11ccba){return new BPromise(function(_0x18c6a5,_0x3f8fbf){var _0x5bf958=_0x11ccba||client;return _0x5bf958[_0xf152('0x1d')](_0x6ccd3d,_0x2b943f)[_0xf152('0x1e')](function(_0x29ff6e){logger['info'](_0xf152('0x1f'),_0x4ce122,_0xf152('0x20'));logger[_0xf152('0x21')](_0xf152('0x22'),_0x4ce122,'request\x20sent',JSON[_0xf152('0x23')](_0x29ff6e));if(_0x29ff6e[_0xf152('0x24')]){if(_0x29ff6e[_0xf152('0x24')][_0xf152('0x25')]===0x1f4){logger[_0xf152('0x24')](_0xf152('0x1f'),_0x4ce122,_0x29ff6e[_0xf152('0x24')][_0xf152('0x26')]);return _0x3f8fbf(_0x29ff6e[_0xf152('0x24')][_0xf152('0x26')]);}logger['error'](_0xf152('0x1f'),_0x4ce122,_0x29ff6e[_0xf152('0x24')][_0xf152('0x26')]);return _0x18c6a5(_0x29ff6e['error']['message']);}else{logger['info'](_0xf152('0x1f'),_0x4ce122,_0xf152('0x20'));_0x18c6a5(_0x29ff6e[_0xf152('0x27')]['message']);}})[_0xf152('0x28')](function(_0x34d0ab){logger[_0xf152('0x24')](_0xf152('0x1f'),_0x4ce122,_0x34d0ab);_0x3f8fbf(_0x34d0ab);});});}function respondWithStatusCode(_0x354675,_0x3d82e5){_0x3d82e5=_0x3d82e5||0xcc;return function(_0x556375){if(_0x556375){return _0x354675[_0xf152('0x29')](_0x3d82e5);}return _0x354675[_0xf152('0x2a')](_0x3d82e5)[_0xf152('0x2b')]();};}function respondWithResult(_0x98af69,_0x2b6ed5){_0x2b6ed5=_0x2b6ed5||0xc8;return function(_0x2c19f9){if(_0x2c19f9){return _0x98af69[_0xf152('0x2a')](_0x2b6ed5)[_0xf152('0x2c')](_0x2c19f9);}};}function respondWithFilteredResult(_0x447843,_0x1f17ae){return function(_0x4f3275){if(_0x4f3275){var _0x51dbbb=_0x4f3275[_0xf152('0x2d')],_0x159b34=_0x1f17ae[_0xf152('0x2e')],_0x4812f3=_0x1f17ae[_0xf152('0x2e')]+_0x1f17ae['limit'],_0x49623f;if(_0x4812f3>=_0x51dbbb){_0x4812f3=_0x51dbbb;_0x49623f=0xc8;}else{_0x49623f=0xce;}_0x447843[_0xf152('0x2a')](_0x49623f);return _0x447843[_0xf152('0x2f')](_0xf152('0x30'),_0x159b34+'-'+_0x4812f3+'/'+_0x51dbbb)[_0xf152('0x2c')](_0x4f3275);}return null;};}function patchUpdates(_0x1d0a13){return function(_0x5c6454){try{jsonpatch[_0xf152('0x31')](_0x5c6454,_0x1d0a13,!![]);}catch(_0xed2cdc){return BPromise[_0xf152('0x32')](_0xed2cdc);}return _0x5c6454['save']();};}function saveUpdates(_0x239002,_0x2608b0){return function(_0x15e6ef){if(_0x15e6ef){return _0x15e6ef['update'](_0x239002)['then'](function(_0x192fad){return _0x192fad;});}return null;};}function removeEntity(_0x569ad5,_0x5dcd10){return function(_0x58e5f5){if(_0x58e5f5){return _0x58e5f5['destroy']()['then'](function(){_0x569ad5[_0xf152('0x2a')](0xcc)[_0xf152('0x2b')]();});}};}function handleEntityNotFound(_0x2c87ae,_0x8d9a96){return function(_0x594696){if(!_0x594696){_0x2c87ae[_0xf152('0x29')](0x194);}return _0x594696;};}function handleError(_0x3d0700,_0xdc3e92){_0xdc3e92=_0xdc3e92||0x1f4;return function(_0x287fe8){logger[_0xf152('0x24')](_0x287fe8[_0xf152('0x33')]);if(_0x287fe8[_0xf152('0x34')]){delete _0x287fe8['name'];}_0x3d0700['status'](_0xdc3e92)[_0xf152('0x35')](_0x287fe8);};}exports[_0xf152('0x36')]=function(_0xa10bc7,_0xbd4c5d){var _0x31c1fd={},_0x4421b8={},_0xc145a2={'count':0x0,'rows':[]};var _0xd73db3=db[_0xf152('0x37')][_0xf152('0x38')];_0x4421b8['model']=_[_0xf152('0x39')](_0xd73db3);_0x4421b8[_0xf152('0x3a')]=_['keys'](_0xa10bc7[_0xf152('0x3a')]);_0x4421b8['filters']=_[_0xf152('0x3b')](_0x4421b8[_0xf152('0x3c')],_0x4421b8[_0xf152('0x3a')]);_0x31c1fd[_0xf152('0x3d')]=_[_0xf152('0x3b')](_0x4421b8[_0xf152('0x3c')],qs['fields'](_0xa10bc7[_0xf152('0x3a')][_0xf152('0x3e')]));_0x31c1fd['attributes']=_0x31c1fd['attributes']['length']?_0x31c1fd['attributes']:_0x4421b8[_0xf152('0x3c')];if(!_0xa10bc7[_0xf152('0x3a')][_0xf152('0x3f')](_0xf152('0x40'))){_0x31c1fd[_0xf152('0x41')]=qs[_0xf152('0x41')](_0xa10bc7['query']['limit']);_0x31c1fd[_0xf152('0x2e')]=qs[_0xf152('0x2e')](_0xa10bc7['query'][_0xf152('0x2e')]);}_0x31c1fd['order']=qs[_0xf152('0x42')](_0xa10bc7[_0xf152('0x3a')][_0xf152('0x42')]);_0x31c1fd[_0xf152('0x43')]=qs['filters'](_[_0xf152('0x44')](_0xa10bc7['query'],_0x4421b8[_0xf152('0x45')]));if(_0xa10bc7['query']['filter']){_0x31c1fd[_0xf152('0x43')]=_[_0xf152('0x46')](_0x31c1fd[_0xf152('0x43')],{'$or':_[_0xf152('0x47')](_0xd73db3,function(_0x57794e){if(_0x57794e['type'][_0xf152('0x48')]!==_0xf152('0x49')){var _0x92c79d={};_0x92c79d[_0x57794e['field']]={'$like':'%'+_0xa10bc7[_0xf152('0x3a')][_0xf152('0x4a')]+'%'};return _0x92c79d;}})});}_0x31c1fd=_[_0xf152('0x46')]({},_0x31c1fd,_0xa10bc7['options']);var _0x58fbb5={'where':_0x31c1fd[_0xf152('0x43')]};return db[_0xf152('0x37')]['count'](_0x58fbb5)[_0xf152('0x1e')](function(_0xf2c843){_0xc145a2['count']=_0xf2c843;if(_0xa10bc7[_0xf152('0x3a')][_0xf152('0x4b')]){_0x31c1fd[_0xf152('0x4c')]=[{'all':!![]}];}return db['VtigerAccount'][_0xf152('0x4d')](_0x31c1fd);})[_0xf152('0x1e')](function(_0x4f437a){_0xc145a2[_0xf152('0x4e')]=_0x4f437a;return _0xc145a2;})[_0xf152('0x1e')](respondWithFilteredResult(_0xbd4c5d,_0x31c1fd))[_0xf152('0x28')](handleError(_0xbd4c5d,null));};exports[_0xf152('0x4f')]=function(_0x11228a,_0x45108a){var _0x4ca690={'raw':![],'where':{'id':_0x11228a[_0xf152('0x50')]['id']}},_0x43c386={};_0x43c386[_0xf152('0x3c')]=_[_0xf152('0x39')](db['VtigerAccount'][_0xf152('0x38')]);_0x43c386[_0xf152('0x3a')]=_['keys'](_0x11228a[_0xf152('0x3a')]);_0x43c386[_0xf152('0x45')]=_['intersection'](_0x43c386[_0xf152('0x3c')],_0x43c386[_0xf152('0x3a')]);_0x4ca690['attributes']=_[_0xf152('0x3b')](_0x43c386[_0xf152('0x3c')],qs[_0xf152('0x3e')](_0x11228a[_0xf152('0x3a')][_0xf152('0x3e')]));_0x4ca690[_0xf152('0x3d')]=_0x4ca690[_0xf152('0x3d')][_0xf152('0x51')]?_0x4ca690['attributes']:_0x43c386[_0xf152('0x3c')];if(_0x11228a['query'][_0xf152('0x4b')]){_0x4ca690[_0xf152('0x4c')]=[{'all':!![]}];}_0x4ca690=_[_0xf152('0x46')]({},_0x4ca690,_0x11228a[_0xf152('0x52')]);return db['VtigerAccount'][_0xf152('0x53')](_0x4ca690)[_0xf152('0x1e')](handleEntityNotFound(_0x45108a,null))[_0xf152('0x1e')](respondWithResult(_0x45108a,null))[_0xf152('0x28')](handleError(_0x45108a,null));};exports[_0xf152('0x54')]=function(_0x1e71d3,_0x595a45){return db[_0xf152('0x37')][_0xf152('0x54')](_0x1e71d3[_0xf152('0x55')],{})[_0xf152('0x1e')](respondWithResult(_0x595a45,0xc9))['catch'](handleError(_0x595a45,null));};exports[_0xf152('0x56')]=function(_0x263215,_0x4f56a0){if(_0x263215[_0xf152('0x55')]['id']){delete _0x263215[_0xf152('0x55')]['id'];}return db[_0xf152('0x37')][_0xf152('0x53')]({'where':{'id':_0x263215[_0xf152('0x50')]['id']}})[_0xf152('0x1e')](handleEntityNotFound(_0x4f56a0,null))[_0xf152('0x1e')](saveUpdates(_0x263215['body'],null))['then'](respondWithResult(_0x4f56a0,null))[_0xf152('0x28')](handleError(_0x4f56a0,null));};exports[_0xf152('0x57')]=function(_0x1bcd53,_0x21f31e){return db[_0xf152('0x37')]['find']({'where':{'id':_0x1bcd53[_0xf152('0x50')]['id']}})[_0xf152('0x1e')](handleEntityNotFound(_0x21f31e,null))['then'](removeEntity(_0x21f31e,null))[_0xf152('0x28')](handleError(_0x21f31e,null));};exports['getConfigurations']=function(_0x10ca55,_0x3b3022,_0x17efe6){var _0x3fa2e4={};var _0x38f731={};var _0x1e32f2;var _0x5a5fea;return db[_0xf152('0x37')][_0xf152('0x58')]({'where':{'id':_0x10ca55[_0xf152('0x50')]['id']}})['then'](handleEntityNotFound(_0x3b3022,null))[_0xf152('0x1e')](function(_0x3c55c9){if(_0x3c55c9){_0x1e32f2=_0x3c55c9;_0x38f731[_0xf152('0x3c')]=_[_0xf152('0x39')](db['VtigerConfiguration'][_0xf152('0x38')]);_0x38f731[_0xf152('0x3a')]=_[_0xf152('0x39')](_0x10ca55[_0xf152('0x3a')]);_0x38f731[_0xf152('0x45')]=_[_0xf152('0x3b')](_0x38f731[_0xf152('0x3c')],_0x38f731[_0xf152('0x3a')]);_0x3fa2e4[_0xf152('0x3d')]=_[_0xf152('0x3b')](_0x38f731[_0xf152('0x3c')],qs[_0xf152('0x3e')](_0x10ca55[_0xf152('0x3a')][_0xf152('0x3e')]));_0x3fa2e4[_0xf152('0x3d')]=_0x3fa2e4[_0xf152('0x3d')][_0xf152('0x51')]?_0x3fa2e4['attributes']:_0x38f731[_0xf152('0x3c')];_0x3fa2e4[_0xf152('0x59')]=qs[_0xf152('0x42')](_0x10ca55['query'][_0xf152('0x42')]);_0x3fa2e4[_0xf152('0x43')]=qs[_0xf152('0x45')](_['pick'](_0x10ca55[_0xf152('0x3a')],_0x38f731[_0xf152('0x45')]));if(_0x10ca55[_0xf152('0x3a')]['filter']){_0x3fa2e4[_0xf152('0x43')]=_[_0xf152('0x46')](_0x3fa2e4[_0xf152('0x43')],{'$or':_[_0xf152('0x47')](_0x3fa2e4[_0xf152('0x3d')],function(_0x529e1f){var _0x4a81c3={};_0x4a81c3[_0x529e1f]={'$like':'%'+_0x10ca55[_0xf152('0x3a')]['filter']+'%'};return _0x4a81c3;})});}_0x3fa2e4=_[_0xf152('0x46')]({},_0x3fa2e4,_0x10ca55[_0xf152('0x52')]);return _0x1e32f2[_0xf152('0x5a')](_0x3fa2e4);}})[_0xf152('0x1e')](function(_0x4c58f5){if(_0x4c58f5){_0x5a5fea=_0x4c58f5[_0xf152('0x51')];if(!_0x10ca55[_0xf152('0x3a')][_0xf152('0x3f')](_0xf152('0x40'))){_0x3fa2e4[_0xf152('0x41')]=qs[_0xf152('0x41')](_0x10ca55[_0xf152('0x3a')][_0xf152('0x41')]);_0x3fa2e4['offset']=qs[_0xf152('0x2e')](_0x10ca55[_0xf152('0x3a')][_0xf152('0x2e')]);}return _0x1e32f2[_0xf152('0x5a')](_0x3fa2e4);}})[_0xf152('0x1e')](function(_0x20dcf8){if(_0x20dcf8){return _0x20dcf8?{'count':_0x5a5fea,'rows':_0x20dcf8}:null;}})['then'](respondWithResult(_0x3b3022,null))[_0xf152('0x28')](handleError(_0x3b3022,null));};exports[_0xf152('0x5b')]=function(_0x1c74df,_0x1b5ffa,_0x58d830){if(_0x1c74df[_0xf152('0x55')]['id']){delete _0x1c74df[_0xf152('0x55')]['id'];}return db[_0xf152('0x37')][_0xf152('0x58')]({'where':{'id':_0x1c74df[_0xf152('0x50')]['id']}})[_0xf152('0x1e')](handleEntityNotFound(_0x1b5ffa,null))[_0xf152('0x1e')](function(_0x354a9a){if(_0x354a9a){_0x1c74df[_0xf152('0x55')][_0xf152('0x5c')]=_0x354a9a['id'];_0x1c74df[_0xf152('0x55')][_0xf152('0x5d')]=integrations['getSubjects'](_0x1c74df['body'][_0xf152('0x5e')],_0x1c74df[_0xf152('0x55')]['type']);_0x1c74df[_0xf152('0x55')][_0xf152('0x5f')]=integrations[_0xf152('0x60')](_0x1c74df['body']['channel'],_0x1c74df[_0xf152('0x55')]['type']);return db[_0xf152('0x61')][_0xf152('0x54')](_0x1c74df[_0xf152('0x55')],{'include':[{'model':db['VtigerField'],'as':_0xf152('0x5d')},{'model':db[_0xf152('0x62')],'as':_0xf152('0x5f')}]});}return null;})[_0xf152('0x1e')](respondWithResult(_0x1b5ffa,null))[_0xf152('0x28')](handleError(_0x1b5ffa,null));};var md5=require(_0xf152('0x63'));exports[_0xf152('0x64')]=function(_0x5d9795,_0x1907fc,_0x576248){var _0x49f230=null;var _0x2ae0ec=null;var _0x4456a0=null;var _0x43d661=null;var _0x4f1234='';return db[_0xf152('0x37')][_0xf152('0x58')]({'where':{'id':_0x5d9795['params']['id']},'attributes':['id',_0xf152('0x34'),_0xf152('0x65'),'description',_0xf152('0x66'),_0xf152('0x67'),_0xf152('0x68'),'accessKey']})['then'](handleEntityNotFound(_0x1907fc,null))['then'](function(_0x137a50){if(_0x137a50){_0x49f230=_0x137a50['username'];_0x2ae0ec=_0x137a50['accessKey'];_0x4456a0=_0x137a50[_0xf152('0x66')];_0x4f1234=_0x137a50[_0xf152('0x67')];var _0x2b41e6=_0x4f1234['slice'](-0x1);if(_0x2b41e6==='/'){_0x4f1234=_0x4f1234[_0xf152('0x69')](0x0,_0x4f1234[_0xf152('0x6a')](_0x2b41e6));}_0x43d661=util[_0xf152('0x6b')](_0xf152('0x6c'),_0x4f1234);var _0x3b0c2c={'method':_0xf152('0x6d'),'uri':_0x43d661,'qs':{'operation':_0xf152('0x6e'),'username':_0x137a50[_0xf152('0x65')]},'json':!![]};return rp(_0x3b0c2c);}})[_0xf152('0x1e')](function(_0x1cea29){if(_0x1cea29['success']){var _0x33abfb={'method':_0xf152('0x6f'),'uri':_0x43d661,'form':{'operation':_0xf152('0x70'),'username':_0x49f230,'accessKey':md5(_0x1cea29[_0xf152('0x27')][_0xf152('0x71')]+_0x2ae0ec)},'json':!![]};return rp(_0x33abfb);}})[_0xf152('0x1e')](function(_0x77318f){if(_0x77318f[_0xf152('0x72')]){var _0x1d3eae={'method':'GET','uri':_0x43d661,'qs':{'operation':_0xf152('0x73'),'username':_0x49f230,'sessionName':_0x77318f[_0xf152('0x27')][_0xf152('0x74')],'elementType':_0x4456a0},'json':!![]};return rp(_0x1d3eae);}})[_0xf152('0x1e')](function(_0x582526){if(_0x582526[_0xf152('0x72')]){var _0x4b281e=['autogenerated',_0xf152('0x75'),_0xf152('0x76')];_['remove'](_0x582526[_0xf152('0x27')][_0xf152('0x3e')],function(_0xf0590){return _0x4b281e[_0xf152('0x77')](_0xf0590[_0xf152('0x78')]['name']);});_[_0xf152('0x79')](_0x582526[_0xf152('0x27')][_0xf152('0x3e')],function(_0x56b1dc){return _0x56b1dc[_0xf152('0x7a')]==='false';});return{'count':_0x582526[_0xf152('0x27')][_0xf152('0x3e')][_0xf152('0x51')],'rows':_[_0xf152('0x47')](_0x582526['result']['fields'],function(_0x122dc5){return{'id':_0x122dc5[_0xf152('0x34')],'name':_0x122dc5[_0xf152('0x7b')],'custom':_[_0xf152('0x7c')](_0x122dc5['name'],_0xf152('0x7d'))?!![]:![],'options':_0x122dc5[_0xf152('0x78')][_0xf152('0x34')]===_0xf152('0x7e')&&_0x122dc5[_0xf152('0x78')]['picklistValues'][_0xf152('0x51')]>0x0?_[_0xf152('0x47')](_0x122dc5[_0xf152('0x78')]['picklistValues'],function(_0x3cbfae){return{'name':_0x3cbfae[_0xf152('0x7b')],'value':_0x3cbfae[_0xf152('0x7f')]};}):[]};})};}})[_0xf152('0x1e')](respondWithResult(_0x1907fc,null))[_0xf152('0x28')](function(_0x2fdd6b){console[_0xf152('0x80')](_0xf152('0x81')+_0x2fdd6b);var _0x8d9284=_0x5d9795[_0xf152('0x3a')][_0xf152('0x82')]?0x1f4:_0x2fdd6b[_0xf152('0x83')]||0x1f4;logger['error'](_0xf152('0x84'),'getFields',_0x8d9284,JSON[_0xf152('0x23')](_0x2fdd6b));delete _0x2fdd6b[_0xf152('0x34')];if(_0x8d9284===0x191){_0x8d9284=0x190;}_0x1907fc['status'](_0x8d9284)[_0xf152('0x35')](_0x5d9795['query']['test']?{'message':_0xf152('0x85'),'statusCode':_0x2fdd6b['statusCode']}:_0x2fdd6b);});}; \ No newline at end of file +var _0x6da4=['offset','limit','set','Content-Range','reject','update','then','stack','name','send','VtigerAccount','rawAttributes','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','map','VIRTUAL','field','includeAll','include','rows','show','params','keys','options','find','create','body','destroy','getConfigurations','findOne','addConfiguration','AccountId','Subjects','getSubjects','channel','type','Descriptions','getDescriptions','VtigerConfiguration','VtigerField','md5','username','description','remoteUri','serverUrl','accessKey','substring','lastIndexOf','format','GET','getchallenge','success','POST','token','describe','reference','owner','remove','includes','editable','false','label','startsWith','cf_','picklist','picklistValues','vTiger\x20error:\x20','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','lodash','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','client','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','status','end','json','count'];(function(_0x380016,_0x178dd6){var _0x5c7ac0=function(_0xa8ddca){while(--_0xa8ddca){_0x380016['push'](_0x380016['shift']());}};_0x5c7ac0(++_0x178dd6);}(_0x6da4,0xce));var _0x46da=function(_0x3847f0,_0xafcad6){_0x3847f0=_0x3847f0-0x0;var _0x414e25=_0x6da4[_0x3847f0];return _0x414e25;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x46da('0x0'));var zipdir=require(_0x46da('0x1'));var jsonpatch=require(_0x46da('0x2'));var rp=require(_0x46da('0x3'));var moment=require(_0x46da('0x4'));var BPromise=require(_0x46da('0x5'));var Mustache=require(_0x46da('0x6'));var util=require(_0x46da('0x7'));var path=require('path');var sox=require(_0x46da('0x8'));var csv=require('to-csv');var ejs=require(_0x46da('0x9'));var fs=require('fs');var _=require(_0x46da('0xa'));var squel=require('squel');var crypto=require(_0x46da('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x46da('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x46da('0xd'));var Redis=require(_0x46da('0xe'));var authService=require(_0x46da('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x46da('0x10'));var hardwareService=require(_0x46da('0x11'));var logger=require('../../config/logger')(_0x46da('0x12'));var utils=require(_0x46da('0x13'));var config=require(_0x46da('0x14'));var db=require(_0x46da('0x15'))['db'];var integrations=require(_0x46da('0x16'));var jayson=require('jayson/promise');var client=jayson[_0x46da('0x17')]['http']({'port':0x232a});function checkPasswordPattern(_0x4bd0d0,_0x1f0c1e,_0x463bfc){if(_0x463bfc){var _0x4051c6=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4051c6[_0x46da('0x18')](_0x1f0c1e)){return _0x4bd0d0;}else{throw new Error(_0x46da('0x19'));}}else{return _0x4bd0d0;}}function respondWithRpcPromise(_0x35eda9,_0x3511f2,_0x2a6c4e,_0x35797e){return new BPromise(function(_0x441830,_0x54045f){var _0x589875=_0x35797e||client;return _0x589875[_0x46da('0x1a')](_0x35eda9,_0x2a6c4e)['then'](function(_0x1c7bb8){logger[_0x46da('0x1b')](_0x46da('0x1c'),_0x3511f2,_0x46da('0x1d'));logger[_0x46da('0x1e')](_0x46da('0x1f'),_0x3511f2,_0x46da('0x1d'),JSON[_0x46da('0x20')](_0x1c7bb8));if(_0x1c7bb8[_0x46da('0x21')]){if(_0x1c7bb8['error']['code']===0x1f4){logger[_0x46da('0x21')]('VtigerAccount,\x20%s,\x20%s',_0x3511f2,_0x1c7bb8[_0x46da('0x21')]['message']);return _0x54045f(_0x1c7bb8['error'][_0x46da('0x22')]);}logger[_0x46da('0x21')]('VtigerAccount,\x20%s,\x20%s',_0x3511f2,_0x1c7bb8['error'][_0x46da('0x22')]);return _0x441830(_0x1c7bb8[_0x46da('0x21')][_0x46da('0x22')]);}else{logger[_0x46da('0x1b')](_0x46da('0x1c'),_0x3511f2,_0x46da('0x1d'));_0x441830(_0x1c7bb8[_0x46da('0x23')][_0x46da('0x22')]);}})[_0x46da('0x24')](function(_0x3c8e55){logger[_0x46da('0x21')]('VtigerAccount,\x20%s,\x20%s',_0x3511f2,_0x3c8e55);_0x54045f(_0x3c8e55);});});}function respondWithStatusCode(_0x31e6b9,_0x23de79){_0x23de79=_0x23de79||0xcc;return function(_0x470c93){if(_0x470c93){return _0x31e6b9[_0x46da('0x25')](_0x23de79);}return _0x31e6b9[_0x46da('0x26')](_0x23de79)[_0x46da('0x27')]();};}function respondWithResult(_0x55b9c4,_0x4c106f){_0x4c106f=_0x4c106f||0xc8;return function(_0x19f8da){if(_0x19f8da){return _0x55b9c4[_0x46da('0x26')](_0x4c106f)[_0x46da('0x28')](_0x19f8da);}};}function respondWithFilteredResult(_0xb9bb50,_0x53167d){return function(_0x480998){if(_0x480998){var _0x47ba3d=_0x480998[_0x46da('0x29')],_0x3fd716=_0x53167d[_0x46da('0x2a')],_0x178116=_0x53167d[_0x46da('0x2a')]+_0x53167d[_0x46da('0x2b')],_0x492980;if(_0x178116>=_0x47ba3d){_0x178116=_0x47ba3d;_0x492980=0xc8;}else{_0x492980=0xce;}_0xb9bb50['status'](_0x492980);return _0xb9bb50[_0x46da('0x2c')](_0x46da('0x2d'),_0x3fd716+'-'+_0x178116+'/'+_0x47ba3d)[_0x46da('0x28')](_0x480998);}return null;};}function patchUpdates(_0x37f555){return function(_0x4b5edb){try{jsonpatch['apply'](_0x4b5edb,_0x37f555,!![]);}catch(_0x9859e3){return BPromise[_0x46da('0x2e')](_0x9859e3);}return _0x4b5edb['save']();};}function saveUpdates(_0x518af9,_0x2becc3){return function(_0x5595a9){if(_0x5595a9){return _0x5595a9[_0x46da('0x2f')](_0x518af9)['then'](function(_0x3d784c){return _0x3d784c;});}return null;};}function removeEntity(_0x24de5a,_0xd12b47){return function(_0xc12933){if(_0xc12933){return _0xc12933['destroy']()[_0x46da('0x30')](function(){_0x24de5a['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1d705d,_0x5f3aed){return function(_0x25f81a){if(!_0x25f81a){_0x1d705d[_0x46da('0x25')](0x194);}return _0x25f81a;};}function handleError(_0x527ded,_0xace49f){_0xace49f=_0xace49f||0x1f4;return function(_0x13db07){logger[_0x46da('0x21')](_0x13db07[_0x46da('0x31')]);if(_0x13db07[_0x46da('0x32')]){delete _0x13db07[_0x46da('0x32')];}_0x527ded[_0x46da('0x26')](_0xace49f)[_0x46da('0x33')](_0x13db07);};}exports['index']=function(_0x10246d,_0x24133e){var _0x45baac={},_0x52864c={},_0x284e62={'count':0x0,'rows':[]};var _0x196d47=db[_0x46da('0x34')][_0x46da('0x35')];_0x52864c[_0x46da('0x36')]=_['keys'](_0x196d47);_0x52864c['query']=_['keys'](_0x10246d[_0x46da('0x37')]);_0x52864c[_0x46da('0x38')]=_[_0x46da('0x39')](_0x52864c[_0x46da('0x36')],_0x52864c['query']);_0x45baac[_0x46da('0x3a')]=_[_0x46da('0x39')](_0x52864c[_0x46da('0x36')],qs[_0x46da('0x3b')](_0x10246d[_0x46da('0x37')]['fields']));_0x45baac[_0x46da('0x3a')]=_0x45baac[_0x46da('0x3a')][_0x46da('0x3c')]?_0x45baac[_0x46da('0x3a')]:_0x52864c[_0x46da('0x36')];if(!_0x10246d[_0x46da('0x37')][_0x46da('0x3d')]('nolimit')){_0x45baac[_0x46da('0x2b')]=qs['limit'](_0x10246d['query']['limit']);_0x45baac[_0x46da('0x2a')]=qs[_0x46da('0x2a')](_0x10246d['query'][_0x46da('0x2a')]);}_0x45baac[_0x46da('0x3e')]=qs[_0x46da('0x3f')](_0x10246d['query']['sort']);_0x45baac[_0x46da('0x40')]=qs[_0x46da('0x38')](_[_0x46da('0x41')](_0x10246d[_0x46da('0x37')],_0x52864c[_0x46da('0x38')]));if(_0x10246d[_0x46da('0x37')][_0x46da('0x42')]){_0x45baac[_0x46da('0x40')]=_[_0x46da('0x43')](_0x45baac[_0x46da('0x40')],{'$or':_[_0x46da('0x44')](_0x196d47,function(_0x2e2e04){if(_0x2e2e04['type']['key']!==_0x46da('0x45')){var _0x2942b8={};_0x2942b8[_0x2e2e04[_0x46da('0x46')]]={'$like':'%'+_0x10246d['query'][_0x46da('0x42')]+'%'};return _0x2942b8;}})});}_0x45baac=_[_0x46da('0x43')]({},_0x45baac,_0x10246d['options']);var _0x4ad309={'where':_0x45baac['where']};return db[_0x46da('0x34')]['count'](_0x4ad309)[_0x46da('0x30')](function(_0x194c78){_0x284e62['count']=_0x194c78;if(_0x10246d[_0x46da('0x37')][_0x46da('0x47')]){_0x45baac[_0x46da('0x48')]=[{'all':!![]}];}return db[_0x46da('0x34')]['findAll'](_0x45baac);})[_0x46da('0x30')](function(_0xdfa831){_0x284e62[_0x46da('0x49')]=_0xdfa831;return _0x284e62;})[_0x46da('0x30')](respondWithFilteredResult(_0x24133e,_0x45baac))['catch'](handleError(_0x24133e,null));};exports[_0x46da('0x4a')]=function(_0x52c093,_0x2290fa){var _0x185a5d={'raw':![],'where':{'id':_0x52c093[_0x46da('0x4b')]['id']}},_0x3d641e={};_0x3d641e[_0x46da('0x36')]=_['keys'](db[_0x46da('0x34')]['rawAttributes']);_0x3d641e['query']=_[_0x46da('0x4c')](_0x52c093['query']);_0x3d641e['filters']=_['intersection'](_0x3d641e[_0x46da('0x36')],_0x3d641e['query']);_0x185a5d['attributes']=_[_0x46da('0x39')](_0x3d641e[_0x46da('0x36')],qs['fields'](_0x52c093['query'][_0x46da('0x3b')]));_0x185a5d[_0x46da('0x3a')]=_0x185a5d[_0x46da('0x3a')][_0x46da('0x3c')]?_0x185a5d['attributes']:_0x3d641e[_0x46da('0x36')];if(_0x52c093[_0x46da('0x37')][_0x46da('0x47')]){_0x185a5d[_0x46da('0x48')]=[{'all':!![]}];}_0x185a5d=_[_0x46da('0x43')]({},_0x185a5d,_0x52c093[_0x46da('0x4d')]);return db[_0x46da('0x34')][_0x46da('0x4e')](_0x185a5d)[_0x46da('0x30')](handleEntityNotFound(_0x2290fa,null))[_0x46da('0x30')](respondWithResult(_0x2290fa,null))[_0x46da('0x24')](handleError(_0x2290fa,null));};exports[_0x46da('0x4f')]=function(_0x582163,_0x1278c0){return db['VtigerAccount']['create'](_0x582163[_0x46da('0x50')],{})[_0x46da('0x30')](respondWithResult(_0x1278c0,0xc9))['catch'](handleError(_0x1278c0,null));};exports['update']=function(_0x2db977,_0x848af1){if(_0x2db977['body']['id']){delete _0x2db977['body']['id'];}return db['VtigerAccount']['find']({'where':{'id':_0x2db977[_0x46da('0x4b')]['id']}})[_0x46da('0x30')](handleEntityNotFound(_0x848af1,null))[_0x46da('0x30')](saveUpdates(_0x2db977[_0x46da('0x50')],null))[_0x46da('0x30')](respondWithResult(_0x848af1,null))[_0x46da('0x24')](handleError(_0x848af1,null));};exports[_0x46da('0x51')]=function(_0x55e7d8,_0x48096f){return db[_0x46da('0x34')]['find']({'where':{'id':_0x55e7d8[_0x46da('0x4b')]['id']}})[_0x46da('0x30')](handleEntityNotFound(_0x48096f,null))['then'](removeEntity(_0x48096f,null))[_0x46da('0x24')](handleError(_0x48096f,null));};exports[_0x46da('0x52')]=function(_0x1973c7,_0x41e2e2,_0x4e1df1){var _0x5a0581={};var _0x6d7804={};var _0x256a2f;var _0x129989;return db[_0x46da('0x34')][_0x46da('0x53')]({'where':{'id':_0x1973c7['params']['id']}})['then'](handleEntityNotFound(_0x41e2e2,null))['then'](function(_0x9ee391){if(_0x9ee391){_0x256a2f=_0x9ee391;_0x6d7804[_0x46da('0x36')]=_[_0x46da('0x4c')](db['VtigerConfiguration'][_0x46da('0x35')]);_0x6d7804[_0x46da('0x37')]=_[_0x46da('0x4c')](_0x1973c7[_0x46da('0x37')]);_0x6d7804[_0x46da('0x38')]=_[_0x46da('0x39')](_0x6d7804[_0x46da('0x36')],_0x6d7804[_0x46da('0x37')]);_0x5a0581[_0x46da('0x3a')]=_[_0x46da('0x39')](_0x6d7804[_0x46da('0x36')],qs[_0x46da('0x3b')](_0x1973c7[_0x46da('0x37')][_0x46da('0x3b')]));_0x5a0581[_0x46da('0x3a')]=_0x5a0581[_0x46da('0x3a')][_0x46da('0x3c')]?_0x5a0581[_0x46da('0x3a')]:_0x6d7804[_0x46da('0x36')];_0x5a0581[_0x46da('0x3e')]=qs[_0x46da('0x3f')](_0x1973c7['query'][_0x46da('0x3f')]);_0x5a0581[_0x46da('0x40')]=qs['filters'](_[_0x46da('0x41')](_0x1973c7[_0x46da('0x37')],_0x6d7804['filters']));if(_0x1973c7[_0x46da('0x37')]['filter']){_0x5a0581[_0x46da('0x40')]=_[_0x46da('0x43')](_0x5a0581[_0x46da('0x40')],{'$or':_[_0x46da('0x44')](_0x5a0581[_0x46da('0x3a')],function(_0x3b9aeb){var _0x565698={};_0x565698[_0x3b9aeb]={'$like':'%'+_0x1973c7[_0x46da('0x37')][_0x46da('0x42')]+'%'};return _0x565698;})});}_0x5a0581=_['merge']({},_0x5a0581,_0x1973c7[_0x46da('0x4d')]);return _0x256a2f['getConfigurations'](_0x5a0581);}})['then'](function(_0x415636){if(_0x415636){_0x129989=_0x415636[_0x46da('0x3c')];if(!_0x1973c7[_0x46da('0x37')]['hasOwnProperty']('nolimit')){_0x5a0581['limit']=qs['limit'](_0x1973c7['query'][_0x46da('0x2b')]);_0x5a0581[_0x46da('0x2a')]=qs[_0x46da('0x2a')](_0x1973c7[_0x46da('0x37')][_0x46da('0x2a')]);}return _0x256a2f[_0x46da('0x52')](_0x5a0581);}})['then'](function(_0x19b635){if(_0x19b635){return _0x19b635?{'count':_0x129989,'rows':_0x19b635}:null;}})[_0x46da('0x30')](respondWithResult(_0x41e2e2,null))[_0x46da('0x24')](handleError(_0x41e2e2,null));};exports[_0x46da('0x54')]=function(_0x3292cd,_0x56fad1,_0x21d9f6){if(_0x3292cd['body']['id']){delete _0x3292cd[_0x46da('0x50')]['id'];}return db['VtigerAccount'][_0x46da('0x53')]({'where':{'id':_0x3292cd[_0x46da('0x4b')]['id']}})[_0x46da('0x30')](handleEntityNotFound(_0x56fad1,null))[_0x46da('0x30')](function(_0x10d997){if(_0x10d997){_0x3292cd[_0x46da('0x50')][_0x46da('0x55')]=_0x10d997['id'];_0x3292cd[_0x46da('0x50')][_0x46da('0x56')]=integrations[_0x46da('0x57')](_0x3292cd[_0x46da('0x50')][_0x46da('0x58')],_0x3292cd[_0x46da('0x50')][_0x46da('0x59')]);_0x3292cd[_0x46da('0x50')][_0x46da('0x5a')]=integrations[_0x46da('0x5b')](_0x3292cd['body'][_0x46da('0x58')],_0x3292cd[_0x46da('0x50')][_0x46da('0x59')]);return db[_0x46da('0x5c')]['create'](_0x3292cd[_0x46da('0x50')],{'include':[{'model':db[_0x46da('0x5d')],'as':'Subjects'},{'model':db[_0x46da('0x5d')],'as':_0x46da('0x5a')}]});}return null;})[_0x46da('0x30')](respondWithResult(_0x56fad1,null))['catch'](handleError(_0x56fad1,null));};var md5=require(_0x46da('0x5e'));exports['getFields']=function(_0x274817,_0x125a60,_0x3a8663){var _0x51ddb8=null;var _0x46ee57=null;var _0x434fc3=null;var _0x1a7d12=null;var _0x3a16e4='';return db[_0x46da('0x34')][_0x46da('0x53')]({'where':{'id':_0x274817[_0x46da('0x4b')]['id']},'attributes':['id',_0x46da('0x32'),_0x46da('0x5f'),_0x46da('0x60'),'moduleName',_0x46da('0x61'),_0x46da('0x62'),_0x46da('0x63')]})[_0x46da('0x30')](handleEntityNotFound(_0x125a60,null))['then'](function(_0x273381){if(_0x273381){_0x51ddb8=_0x273381['username'];_0x46ee57=_0x273381[_0x46da('0x63')];_0x434fc3=_0x273381['moduleName'];_0x3a16e4=_0x273381[_0x46da('0x61')];var _0x51b7c2=_0x3a16e4['slice'](-0x1);if(_0x51b7c2==='/'){_0x3a16e4=_0x3a16e4[_0x46da('0x64')](0x0,_0x3a16e4[_0x46da('0x65')](_0x51b7c2));}_0x1a7d12=util[_0x46da('0x66')]('%s/webservice.php',_0x3a16e4);var _0x28a070={'method':_0x46da('0x67'),'uri':_0x1a7d12,'qs':{'operation':_0x46da('0x68'),'username':_0x273381[_0x46da('0x5f')]},'json':!![]};return rp(_0x28a070);}})[_0x46da('0x30')](function(_0x3c5812){if(_0x3c5812[_0x46da('0x69')]){var _0x43f81f={'method':_0x46da('0x6a'),'uri':_0x1a7d12,'form':{'operation':'login','username':_0x51ddb8,'accessKey':md5(_0x3c5812[_0x46da('0x23')][_0x46da('0x6b')]+_0x46ee57)},'json':!![]};return rp(_0x43f81f);}})['then'](function(_0x4fa94b){if(_0x4fa94b[_0x46da('0x69')]){var _0xf400bd={'method':_0x46da('0x67'),'uri':_0x1a7d12,'qs':{'operation':_0x46da('0x6c'),'username':_0x51ddb8,'sessionName':_0x4fa94b[_0x46da('0x23')]['sessionName'],'elementType':_0x434fc3},'json':!![]};return rp(_0xf400bd);}})[_0x46da('0x30')](function(_0x2323ba){if(_0x2323ba[_0x46da('0x69')]){var _0x4ce3d9=['autogenerated',_0x46da('0x6d'),_0x46da('0x6e')];_[_0x46da('0x6f')](_0x2323ba[_0x46da('0x23')]['fields'],function(_0x1b8734){return _0x4ce3d9[_0x46da('0x70')](_0x1b8734[_0x46da('0x59')][_0x46da('0x32')]);});_['remove'](_0x2323ba['result'][_0x46da('0x3b')],function(_0x364ad0){return _0x364ad0[_0x46da('0x71')]===_0x46da('0x72');});return{'count':_0x2323ba['result'][_0x46da('0x3b')][_0x46da('0x3c')],'rows':_[_0x46da('0x44')](_0x2323ba[_0x46da('0x23')][_0x46da('0x3b')],function(_0x21b983){return{'id':_0x21b983[_0x46da('0x32')],'name':_0x21b983[_0x46da('0x73')],'custom':_[_0x46da('0x74')](_0x21b983[_0x46da('0x32')],_0x46da('0x75'))?!![]:![],'options':_0x21b983[_0x46da('0x59')]['name']===_0x46da('0x76')&&_0x21b983[_0x46da('0x59')][_0x46da('0x77')]['length']>0x0?_['map'](_0x21b983[_0x46da('0x59')][_0x46da('0x77')],function(_0x472e77){return{'name':_0x472e77[_0x46da('0x73')],'value':_0x472e77['value']};}):[]};})};}})[_0x46da('0x30')](respondWithResult(_0x125a60,null))['catch'](function(_0x305492){console['log'](_0x46da('0x78')+_0x305492);var _0x2f1774=_0x274817['query'][_0x46da('0x18')]?0x1f4:_0x305492[_0x46da('0x79')]||0x1f4;logger[_0x46da('0x21')](_0x46da('0x7a'),'getFields',_0x2f1774,JSON['stringify'](_0x305492));delete _0x305492[_0x46da('0x32')];if(_0x2f1774===0x191){_0x2f1774=0x190;}_0x125a60[_0x46da('0x26')](_0x2f1774)[_0x46da('0x33')](_0x274817[_0x46da('0x37')]['test']?{'message':_0x46da('0x7b'),'statusCode':_0x305492[_0x46da('0x79')]}:_0x305492);});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.model.js b/server/api/intVtigerAccount/intVtigerAccount.model.js index 29eb404..d0360d2 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 _0xdd2d=['int_vtiger_accounts','lodash','util','../../config/logger','api','path','../../config/environment','./intVtigerAccount.attributes','../../components/integrations/configuration','define','VtigerAccount'];(function(_0x22930d,_0x391af2){var _0xdb2f3c=function(_0x22ac3e){while(--_0x22ac3e){_0x22930d['push'](_0x22930d['shift']());}};_0xdb2f3c(++_0x391af2);}(_0xdd2d,0x16c));var _0xddd2=function(_0x29ebb9,_0x15fb71){_0x29ebb9=_0x29ebb9-0x0;var _0x337469=_0xdd2d[_0x29ebb9];return _0x337469;};'use strict';var _=require(_0xddd2('0x0'));var util=require(_0xddd2('0x1'));var logger=require(_0xddd2('0x2'))(_0xddd2('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xddd2('0x4'));var rimraf=require('rimraf');var config=require(_0xddd2('0x5'));var attributes=require(_0xddd2('0x6'));var integrations=require(_0xddd2('0x7'));module['exports']=function(_0x171f82,_0x1ad94e){return _0x171f82[_0xddd2('0x8')](_0xddd2('0x9'),attributes,{'tableName':_0xddd2('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8ca8=['../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./intVtigerAccount.attributes','../../components/integrations/configuration','exports','VtigerAccount','int_vtiger_accounts','lodash','util'];(function(_0x24d71f,_0xed648b){var _0x360d98=function(_0xa3d64f){while(--_0xa3d64f){_0x24d71f['push'](_0x24d71f['shift']());}};_0x360d98(++_0xed648b);}(_0x8ca8,0x8a));var _0x88ca=function(_0x24c357,_0x297a20){_0x24c357=_0x24c357-0x0;var _0x2b5192=_0x8ca8[_0x24c357];return _0x2b5192;};'use strict';var _=require(_0x88ca('0x0'));var util=require(_0x88ca('0x1'));var logger=require(_0x88ca('0x2'))(_0x88ca('0x3'));var moment=require(_0x88ca('0x4'));var BPromise=require(_0x88ca('0x5'));var rp=require(_0x88ca('0x6'));var fs=require('fs');var path=require(_0x88ca('0x7'));var rimraf=require('rimraf');var config=require(_0x88ca('0x8'));var attributes=require(_0x88ca('0x9'));var integrations=require(_0x88ca('0xa'));module[_0x88ca('0xb')]=function(_0x48f836,_0x19b7a7){return _0x48f836['define'](_0x88ca('0xc'),attributes,{'tableName':_0x88ca('0xd'),'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 6d068ee..cdddee3 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 _0x7de7=['request\x20sent','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetVtigerAccount','VtigerAccount','options','raw','where','limit','include','map','attributes','model','catch','find','ShowVtigerAccount','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','VtigerAccount,\x20%s,\x20%s'];(function(_0x532112,_0x37d94b){var _0x23e5fb=function(_0x690ac8){while(--_0x690ac8){_0x532112['push'](_0x532112['shift']());}};_0x23e5fb(++_0x37d94b);}(_0x7de7,0x135));var _0x77de=function(_0x481bf7,_0x437f69){_0x481bf7=_0x481bf7-0x0;var _0x461787=_0x7de7[_0x481bf7];return _0x461787;};'use strict';var _=require('lodash');var util=require(_0x77de('0x0'));var moment=require(_0x77de('0x1'));var BPromise=require(_0x77de('0x2'));var rs=require(_0x77de('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x77de('0x4'))['db'];var utils=require(_0x77de('0x5'));var logger=require(_0x77de('0x6'))(_0x77de('0x7'));var config=require(_0x77de('0x8'));var jayson=require(_0x77de('0x9'));var client=jayson[_0x77de('0xa')][_0x77de('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x48dd7c,_0x2c605b,_0x331d64){return new BPromise(function(_0x170cd0,_0x52417d){return client[_0x77de('0xc')](_0x48dd7c,_0x331d64)['then'](function(_0x577bff){logger[_0x77de('0xd')](_0x77de('0xe'),_0x2c605b,_0x77de('0xf'));logger[_0x77de('0x10')](_0x77de('0x11'),_0x2c605b,_0x77de('0xf'),JSON[_0x77de('0x12')](_0x577bff));if(_0x577bff[_0x77de('0x13')]){if(_0x577bff[_0x77de('0x13')][_0x77de('0x14')]===0x1f4){logger[_0x77de('0x13')](_0x77de('0xe'),_0x2c605b,_0x577bff[_0x77de('0x13')][_0x77de('0x15')]);return _0x52417d(_0x577bff[_0x77de('0x13')][_0x77de('0x15')]);}logger[_0x77de('0x13')](_0x77de('0xe'),_0x2c605b,_0x577bff['error'][_0x77de('0x15')]);return _0x170cd0(_0x577bff['error'][_0x77de('0x15')]);}else{logger['info'](_0x77de('0xe'),_0x2c605b,_0x77de('0xf'));_0x170cd0(_0x577bff[_0x77de('0x16')][_0x77de('0x15')]);}})['catch'](function(_0x2395aa){logger[_0x77de('0x13')](_0x77de('0xe'),_0x2c605b,_0x2395aa);_0x52417d(_0x2395aa);});});}exports[_0x77de('0x17')]=function(_0x1ff2aa){var _0x18b8d0=this;return new Promise(function(_0x6abf2e,_0x1ff0c3){return db[_0x77de('0x18')]['findAll']({'raw':_0x1ff2aa[_0x77de('0x19')]?_0x1ff2aa[_0x77de('0x19')][_0x77de('0x1a')]===undefined?!![]:![]:!![],'where':_0x1ff2aa[_0x77de('0x19')]?_0x1ff2aa[_0x77de('0x19')][_0x77de('0x1b')]||null:null,'attributes':_0x1ff2aa[_0x77de('0x19')]?_0x1ff2aa[_0x77de('0x19')]['attributes']||null:null,'limit':_0x1ff2aa['options']?_0x1ff2aa[_0x77de('0x19')][_0x77de('0x1c')]||null:null,'include':_0x1ff2aa[_0x77de('0x19')]?_0x1ff2aa[_0x77de('0x19')][_0x77de('0x1d')]?_[_0x77de('0x1e')](_0x1ff2aa[_0x77de('0x19')][_0x77de('0x1d')],function(_0x4256fa){return{'model':db[_0x4256fa['model']],'as':_0x4256fa['as'],'attributes':_0x4256fa[_0x77de('0x1f')],'include':_0x4256fa[_0x77de('0x1d')]?_[_0x77de('0x1e')](_0x4256fa[_0x77de('0x1d')],function(_0xf19cf9){return{'model':db[_0xf19cf9[_0x77de('0x20')]],'as':_0xf19cf9['as'],'attributes':_0xf19cf9['attributes'],'include':_0xf19cf9[_0x77de('0x1d')]?_[_0x77de('0x1e')](_0xf19cf9['include'],function(_0x1c8709){return{'model':db[_0x1c8709[_0x77de('0x20')]],'as':_0x1c8709['as'],'attributes':_0x1c8709[_0x77de('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x36ccbe){logger[_0x77de('0xd')](_0x77de('0x17'),_0x1ff2aa);logger[_0x77de('0x10')](_0x77de('0x17'),_0x1ff2aa,JSON['stringify'](_0x36ccbe));_0x6abf2e(_0x36ccbe);})[_0x77de('0x21')](function(_0x443a84){logger['error'](_0x77de('0x17'),_0x443a84[_0x77de('0x15')],_0x1ff2aa);_0x1ff0c3(_0x18b8d0[_0x77de('0x13')](0x1f4,_0x443a84[_0x77de('0x15')]));});});};exports['ShowVtigerAccount']=function(_0x479e6c){var _0x220f91=this;return new Promise(function(_0x26eaf0,_0x5ea3d5){return db['VtigerAccount'][_0x77de('0x22')]({'raw':_0x479e6c[_0x77de('0x19')]?_0x479e6c[_0x77de('0x19')][_0x77de('0x1a')]===undefined?!![]:![]:!![],'where':_0x479e6c[_0x77de('0x19')]?_0x479e6c[_0x77de('0x19')]['where']||null:null,'attributes':_0x479e6c[_0x77de('0x19')]?_0x479e6c[_0x77de('0x19')]['attributes']||null:null,'include':_0x479e6c[_0x77de('0x19')]?_0x479e6c[_0x77de('0x19')][_0x77de('0x1d')]?_['map'](_0x479e6c['options'][_0x77de('0x1d')],function(_0x5dce44){return{'model':db[_0x5dce44[_0x77de('0x20')]],'as':_0x5dce44['as'],'attributes':_0x5dce44[_0x77de('0x1f')],'include':_0x5dce44[_0x77de('0x1d')]?_[_0x77de('0x1e')](_0x5dce44[_0x77de('0x1d')],function(_0x2a55a3){return{'model':db[_0x2a55a3['model']],'as':_0x2a55a3['as'],'attributes':_0x2a55a3[_0x77de('0x1f')],'include':_0x2a55a3['include']?_[_0x77de('0x1e')](_0x2a55a3[_0x77de('0x1d')],function(_0xf1c461){return{'model':db[_0xf1c461[_0x77de('0x20')]],'as':_0xf1c461['as'],'attributes':_0xf1c461['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x1d4b0e){logger[_0x77de('0xd')](_0x77de('0x23'),_0x479e6c);logger[_0x77de('0x10')](_0x77de('0x23'),_0x479e6c,JSON[_0x77de('0x12')](_0x1d4b0e));_0x26eaf0(_0x1d4b0e);})[_0x77de('0x21')](function(_0x89f1ee){logger[_0x77de('0x13')](_0x77de('0x23'),_0x89f1ee[_0x77de('0x15')],_0x479e6c);_0x5ea3d5(_0x220f91[_0x77de('0x13')](0x1f4,_0x89f1ee[_0x77de('0x15')]));});});}; \ No newline at end of file +var _0x34e9=['http','request','then','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','debug','error','code','message','catch','GetVtigerAccount','findAll','options','where','attributes','include','map','model','ShowVtigerAccount','VtigerAccount','find','raw','stringify','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x31a14b,_0x52a1b2){var _0x22ac53=function(_0x22ba2d){while(--_0x22ba2d){_0x31a14b['push'](_0x31a14b['shift']());}};_0x22ac53(++_0x52a1b2);}(_0x34e9,0xbd));var _0x934e=function(_0x586174,_0x315ca6){_0x586174=_0x586174-0x0;var _0x15b373=_0x34e9[_0x586174];return _0x15b373;};'use strict';var _=require(_0x934e('0x0'));var util=require('util');var moment=require(_0x934e('0x1'));var BPromise=require('bluebird');var rs=require(_0x934e('0x2'));var fs=require('fs');var Redis=require(_0x934e('0x3'));var db=require(_0x934e('0x4'))['db'];var utils=require(_0x934e('0x5'));var logger=require(_0x934e('0x6'))(_0x934e('0x7'));var config=require(_0x934e('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x934e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x20e673,_0x5222e9,_0x56f5b6){return new BPromise(function(_0x18114e,_0xd9c3ac){return client[_0x934e('0xa')](_0x20e673,_0x56f5b6)[_0x934e('0xb')](function(_0x32d968){logger[_0x934e('0xc')](_0x934e('0xd'),_0x5222e9,_0x934e('0xe'));logger[_0x934e('0xf')]('VtigerAccount,\x20%s,\x20%s,\x20%s',_0x5222e9,_0x934e('0xe'),JSON['stringify'](_0x32d968));if(_0x32d968['error']){if(_0x32d968[_0x934e('0x10')][_0x934e('0x11')]===0x1f4){logger[_0x934e('0x10')](_0x934e('0xd'),_0x5222e9,_0x32d968[_0x934e('0x10')]['message']);return _0xd9c3ac(_0x32d968[_0x934e('0x10')]['message']);}logger['error']('VtigerAccount,\x20%s,\x20%s',_0x5222e9,_0x32d968[_0x934e('0x10')]['message']);return _0x18114e(_0x32d968['error']['message']);}else{logger[_0x934e('0xc')](_0x934e('0xd'),_0x5222e9,_0x934e('0xe'));_0x18114e(_0x32d968['result'][_0x934e('0x12')]);}})[_0x934e('0x13')](function(_0x4b4064){logger[_0x934e('0x10')](_0x934e('0xd'),_0x5222e9,_0x4b4064);_0xd9c3ac(_0x4b4064);});});}exports[_0x934e('0x14')]=function(_0xe67aa3){var _0x5711aa=this;return new Promise(function(_0x145bcf,_0x5c29ab){return db['VtigerAccount'][_0x934e('0x15')]({'raw':_0xe67aa3[_0x934e('0x16')]?_0xe67aa3[_0x934e('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0xe67aa3['options']?_0xe67aa3['options'][_0x934e('0x17')]||null:null,'attributes':_0xe67aa3[_0x934e('0x16')]?_0xe67aa3[_0x934e('0x16')][_0x934e('0x18')]||null:null,'limit':_0xe67aa3[_0x934e('0x16')]?_0xe67aa3[_0x934e('0x16')]['limit']||null:null,'include':_0xe67aa3[_0x934e('0x16')]?_0xe67aa3[_0x934e('0x16')][_0x934e('0x19')]?_[_0x934e('0x1a')](_0xe67aa3[_0x934e('0x16')][_0x934e('0x19')],function(_0x29d335){return{'model':db[_0x29d335[_0x934e('0x1b')]],'as':_0x29d335['as'],'attributes':_0x29d335[_0x934e('0x18')],'include':_0x29d335[_0x934e('0x19')]?_[_0x934e('0x1a')](_0x29d335[_0x934e('0x19')],function(_0x2f532e){return{'model':db[_0x2f532e[_0x934e('0x1b')]],'as':_0x2f532e['as'],'attributes':_0x2f532e[_0x934e('0x18')],'include':_0x2f532e[_0x934e('0x19')]?_[_0x934e('0x1a')](_0x2f532e[_0x934e('0x19')],function(_0x2ff6fa){return{'model':db[_0x2ff6fa[_0x934e('0x1b')]],'as':_0x2ff6fa['as'],'attributes':_0x2ff6fa[_0x934e('0x18')]};}):[]};}):[]};}):[]:[]})[_0x934e('0xb')](function(_0x574480){logger[_0x934e('0xc')](_0x934e('0x14'),_0xe67aa3);logger[_0x934e('0xf')](_0x934e('0x14'),_0xe67aa3,JSON['stringify'](_0x574480));_0x145bcf(_0x574480);})['catch'](function(_0x1c7dcf){logger[_0x934e('0x10')](_0x934e('0x14'),_0x1c7dcf[_0x934e('0x12')],_0xe67aa3);_0x5c29ab(_0x5711aa[_0x934e('0x10')](0x1f4,_0x1c7dcf[_0x934e('0x12')]));});});};exports[_0x934e('0x1c')]=function(_0xc2c045){var _0x57a660=this;return new Promise(function(_0x325205,_0x10f349){return db[_0x934e('0x1d')][_0x934e('0x1e')]({'raw':_0xc2c045[_0x934e('0x16')]?_0xc2c045[_0x934e('0x16')][_0x934e('0x1f')]===undefined?!![]:![]:!![],'where':_0xc2c045[_0x934e('0x16')]?_0xc2c045[_0x934e('0x16')]['where']||null:null,'attributes':_0xc2c045[_0x934e('0x16')]?_0xc2c045['options']['attributes']||null:null,'include':_0xc2c045[_0x934e('0x16')]?_0xc2c045['options'][_0x934e('0x19')]?_[_0x934e('0x1a')](_0xc2c045[_0x934e('0x16')][_0x934e('0x19')],function(_0x43bd47){return{'model':db[_0x43bd47[_0x934e('0x1b')]],'as':_0x43bd47['as'],'attributes':_0x43bd47[_0x934e('0x18')],'include':_0x43bd47[_0x934e('0x19')]?_[_0x934e('0x1a')](_0x43bd47['include'],function(_0x1facdd){return{'model':db[_0x1facdd[_0x934e('0x1b')]],'as':_0x1facdd['as'],'attributes':_0x1facdd[_0x934e('0x18')],'include':_0x1facdd[_0x934e('0x19')]?_[_0x934e('0x1a')](_0x1facdd[_0x934e('0x19')],function(_0x315609){return{'model':db[_0x315609[_0x934e('0x1b')]],'as':_0x315609['as'],'attributes':_0x315609[_0x934e('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3935ee){logger[_0x934e('0xc')]('ShowVtigerAccount',_0xc2c045);logger[_0x934e('0xf')](_0x934e('0x1c'),_0xc2c045,JSON[_0x934e('0x20')](_0x3935ee));_0x325205(_0x3935ee);})[_0x934e('0x13')](function(_0x5023e2){logger['error'](_0x934e('0x1c'),_0x5023e2[_0x934e('0x12')],_0xc2c045);_0x10f349(_0x57a660[_0x934e('0x10')](0x1f4,_0x5023e2[_0x934e('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/index.js b/server/api/intVtigerConfiguration/index.js index 1c9ce21..9788a13 100644 --- a/server/api/intVtigerConfiguration/index.js +++ b/server/api/intVtigerConfiguration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['/:id','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','put','update','delete','destroy','exports','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerConfiguration.controller','get','isAuthenticated'];(function(_0xc0d23a,_0x454602){var _0x17cc98=function(_0x46198d){while(--_0x46198d){_0xc0d23a['push'](_0xc0d23a['shift']());}};_0x17cc98(++_0x454602);}(_0xb10b,0x12a));var _0xbb10=function(_0x583c95,_0x2caa4d){_0x583c95=_0x583c95-0x0;var _0x1cb317=_0xb10b[_0x583c95];return _0x1cb317;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var auth=require(_0xbb10('0x4'));var interaction=require(_0xbb10('0x5'));var config=require(_0xbb10('0x6'));var controller=require(_0xbb10('0x7'));router[_0xbb10('0x8')]('/',auth[_0xbb10('0x9')](),controller['index']);router[_0xbb10('0x8')](_0xbb10('0xa'),auth['isAuthenticated'](),controller[_0xbb10('0xb')]);router[_0xbb10('0x8')](_0xbb10('0xc'),auth[_0xbb10('0x9')](),controller[_0xbb10('0xd')]);router[_0xbb10('0x8')](_0xbb10('0xe'),auth[_0xbb10('0x9')](),controller['getSubjects']);router['get'](_0xbb10('0xf'),auth[_0xbb10('0x9')](),controller[_0xbb10('0x10')]);router['post']('/',auth[_0xbb10('0x9')](),controller['create']);router[_0xbb10('0x11')](_0xbb10('0xa'),auth[_0xbb10('0x9')](),controller[_0xbb10('0x12')]);router[_0xbb10('0x13')](_0xbb10('0xa'),auth['isAuthenticated'](),controller[_0xbb10('0x14')]);module[_0xbb10('0x15')]=router; \ No newline at end of file +var _0xb10b=['/:id','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','put','update','delete','destroy','exports','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerConfiguration.controller','get','isAuthenticated'];(function(_0xe9771c,_0x303e1b){var _0x563ae2=function(_0x51ecdd){while(--_0x51ecdd){_0xe9771c['push'](_0xe9771c['shift']());}};_0x563ae2(++_0x303e1b);}(_0xb10b,0x12a));var _0xbb10=function(_0x1be143,_0x2f58ed){_0x1be143=_0x1be143-0x0;var _0xaa3f65=_0xb10b[_0x1be143];return _0xaa3f65;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var auth=require(_0xbb10('0x4'));var interaction=require(_0xbb10('0x5'));var config=require(_0xbb10('0x6'));var controller=require(_0xbb10('0x7'));router[_0xbb10('0x8')]('/',auth[_0xbb10('0x9')](),controller['index']);router[_0xbb10('0x8')](_0xbb10('0xa'),auth['isAuthenticated'](),controller[_0xbb10('0xb')]);router[_0xbb10('0x8')](_0xbb10('0xc'),auth[_0xbb10('0x9')](),controller[_0xbb10('0xd')]);router[_0xbb10('0x8')](_0xbb10('0xe'),auth[_0xbb10('0x9')](),controller['getSubjects']);router['get'](_0xbb10('0xf'),auth[_0xbb10('0x9')](),controller[_0xbb10('0x10')]);router['post']('/',auth[_0xbb10('0x9')](),controller['create']);router[_0xbb10('0x11')](_0xbb10('0xa'),auth[_0xbb10('0x9')](),controller[_0xbb10('0x12')]);router[_0xbb10('0x13')](_0xbb10('0xa'),auth['isAuthenticated'](),controller[_0xbb10('0x14')]);module[_0xbb10('0x15')]=router; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js index a0aaca3..5eb1ce7 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 _0x1666=['STRING','sequelize'];(function(_0x1affa4,_0x4eb5df){var _0x5d9213=function(_0x3e537d){while(--_0x3e537d){_0x1affa4['push'](_0x1affa4['shift']());}};_0x5d9213(++_0x4eb5df);}(_0x1666,0xa3));var _0x6166=function(_0x408b2e,_0x20fac3){_0x408b2e=_0x408b2e-0x0;var _0x32151d=_0x1666[_0x408b2e];return _0x32151d;};'use strict';var Sequelize=require(_0x6166('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x6166('0x1')]}}; \ No newline at end of file +var _0xc66e=['STRING','sequelize','exports'];(function(_0x32bc16,_0x5884ad){var _0x1cf754=function(_0x26efdb){while(--_0x26efdb){_0x32bc16['push'](_0x32bc16['shift']());}};_0x1cf754(++_0x5884ad);}(_0xc66e,0xa9));var _0xec66=function(_0x7b4397,_0x50ab04){_0x7b4397=_0x7b4397-0x0;var _0x16de0b=_0xc66e[_0x7b4397];return _0x16de0b;};'use strict';var Sequelize=require(_0xec66('0x0'));module[_0xec66('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xec66('0x2')]}}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js index 9c1922c..9d4afcc 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 _0xf16b=['length','hasOwnProperty','nolimit','limit','order','sort','merge','where','map','type','key','field','filter','options','includeAll','include','findAll','rows','show','params','rawAttributes','find','create','body','getFields','findOne','VtigerField','pick','getSubjects','getDescriptions','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','to-csv','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','VtigerConfiguration,\x20%s,\x20%s,\x20%s','error','message','catch','sendStatus','status','json','count','offset','set','apply','reject','save','update','then','destroy','end','stack','name','send','VtigerConfiguration','model','keys','query','filters','intersection','attributes','fields'];(function(_0x914b44,_0x56d193){var _0x6d3993=function(_0x274a60){while(--_0x274a60){_0x914b44['push'](_0x914b44['shift']());}};_0x6d3993(++_0x56d193);}(_0xf16b,0x1e0));var _0xbf16=function(_0x21729d,_0x29c5f1){_0x21729d=_0x21729d-0x0;var _0x2ed324=_0xf16b[_0x21729d];return _0x2ed324;};'use strict';var pdf=require(_0xbf16('0x0'));var emlformat=require(_0xbf16('0x1'));var rimraf=require(_0xbf16('0x2'));var zipdir=require(_0xbf16('0x3'));var jsonpatch=require(_0xbf16('0x4'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xbf16('0x5'));var Mustache=require(_0xbf16('0x6'));var util=require(_0xbf16('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xbf16('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xbf16('0x9'));var squel=require(_0xbf16('0xa'));var crypto=require(_0xbf16('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xbf16('0xc'));var toCsv=require(_0xbf16('0x8'));var querystring=require(_0xbf16('0xd'));var Papa=require('papaparse');var Redis=require(_0xbf16('0xe'));var authService=require(_0xbf16('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xbf16('0x10'));var hardwareService=require(_0xbf16('0x11'));var logger=require(_0xbf16('0x12'))(_0xbf16('0x13'));var utils=require(_0xbf16('0x14'));var config=require(_0xbf16('0x15'));var db=require(_0xbf16('0x16'))['db'];var jayson=require(_0xbf16('0x17'));var client=jayson[_0xbf16('0x18')][_0xbf16('0x19')]({'port':0x232a});function checkPasswordPattern(_0x2f3f6f,_0x28423b,_0x548101){if(_0x548101){var _0x568d0d=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x568d0d[_0xbf16('0x1a')](_0x28423b)){return _0x2f3f6f;}else{throw new Error(_0xbf16('0x1b'));}}else{return _0x2f3f6f;}}function respondWithRpcPromise(_0x2246bb,_0x12672a,_0x4c3ca9,_0x575570){return new BPromise(function(_0x4c2bb3,_0x3adfb1){var _0x3530f5=_0x575570||client;return _0x3530f5[_0xbf16('0x1c')](_0x2246bb,_0x4c3ca9)['then'](function(_0x4cb810){logger[_0xbf16('0x1d')](_0xbf16('0x1e'),_0x12672a,_0xbf16('0x1f'));logger['debug'](_0xbf16('0x20'),_0x12672a,_0xbf16('0x1f'),JSON['stringify'](_0x4cb810));if(_0x4cb810[_0xbf16('0x21')]){if(_0x4cb810['error']['code']===0x1f4){logger[_0xbf16('0x21')](_0xbf16('0x1e'),_0x12672a,_0x4cb810[_0xbf16('0x21')]['message']);return _0x3adfb1(_0x4cb810['error'][_0xbf16('0x22')]);}logger[_0xbf16('0x21')](_0xbf16('0x1e'),_0x12672a,_0x4cb810[_0xbf16('0x21')][_0xbf16('0x22')]);return _0x4c2bb3(_0x4cb810['error'][_0xbf16('0x22')]);}else{logger[_0xbf16('0x1d')](_0xbf16('0x1e'),_0x12672a,_0xbf16('0x1f'));_0x4c2bb3(_0x4cb810['result']['message']);}})[_0xbf16('0x23')](function(_0x31b841){logger[_0xbf16('0x21')](_0xbf16('0x1e'),_0x12672a,_0x31b841);_0x3adfb1(_0x31b841);});});}function respondWithStatusCode(_0x5be86f,_0x398a47){_0x398a47=_0x398a47||0xcc;return function(_0x33217d){if(_0x33217d){return _0x5be86f[_0xbf16('0x24')](_0x398a47);}return _0x5be86f[_0xbf16('0x25')](_0x398a47)['end']();};}function respondWithResult(_0x8def7,_0xd1b087){_0xd1b087=_0xd1b087||0xc8;return function(_0x370c42){if(_0x370c42){return _0x8def7['status'](_0xd1b087)[_0xbf16('0x26')](_0x370c42);}};}function respondWithFilteredResult(_0xba2068,_0x2bdb3b){return function(_0x2ccf4b){if(_0x2ccf4b){var _0x35f6f7=_0x2ccf4b[_0xbf16('0x27')],_0xf92590=_0x2bdb3b[_0xbf16('0x28')],_0x56a2a5=_0x2bdb3b[_0xbf16('0x28')]+_0x2bdb3b['limit'],_0x6bdd8b;if(_0x56a2a5>=_0x35f6f7){_0x56a2a5=_0x35f6f7;_0x6bdd8b=0xc8;}else{_0x6bdd8b=0xce;}_0xba2068[_0xbf16('0x25')](_0x6bdd8b);return _0xba2068[_0xbf16('0x29')]('Content-Range',_0xf92590+'-'+_0x56a2a5+'/'+_0x35f6f7)['json'](_0x2ccf4b);}return null;};}function patchUpdates(_0x25b138){return function(_0x4a2206){try{jsonpatch[_0xbf16('0x2a')](_0x4a2206,_0x25b138,!![]);}catch(_0x19bcdd){return BPromise[_0xbf16('0x2b')](_0x19bcdd);}return _0x4a2206[_0xbf16('0x2c')]();};}function saveUpdates(_0x33d447,_0xade33c){return function(_0x31cfb6){if(_0x31cfb6){return _0x31cfb6[_0xbf16('0x2d')](_0x33d447)[_0xbf16('0x2e')](function(_0x3b1e53){return _0x3b1e53;});}return null;};}function removeEntity(_0x5e14c3,_0x165ea1){return function(_0x3656da){if(_0x3656da){return _0x3656da[_0xbf16('0x2f')]()['then'](function(){_0x5e14c3['status'](0xcc)[_0xbf16('0x30')]();});}};}function handleEntityNotFound(_0x229d2a,_0x302e82){return function(_0x578068){if(!_0x578068){_0x229d2a['sendStatus'](0x194);}return _0x578068;};}function handleError(_0x608b01,_0x392488){_0x392488=_0x392488||0x1f4;return function(_0xe0ba44){logger[_0xbf16('0x21')](_0xe0ba44[_0xbf16('0x31')]);if(_0xe0ba44['name']){delete _0xe0ba44[_0xbf16('0x32')];}_0x608b01[_0xbf16('0x25')](_0x392488)[_0xbf16('0x33')](_0xe0ba44);};}exports['index']=function(_0x225428,_0x4b7b83){var _0x28479f={},_0xdb9148={},_0x44fdd5={'count':0x0,'rows':[]};var _0x3d1f56=db[_0xbf16('0x34')]['rawAttributes'];_0xdb9148[_0xbf16('0x35')]=_[_0xbf16('0x36')](_0x3d1f56);_0xdb9148[_0xbf16('0x37')]=_[_0xbf16('0x36')](_0x225428[_0xbf16('0x37')]);_0xdb9148[_0xbf16('0x38')]=_[_0xbf16('0x39')](_0xdb9148[_0xbf16('0x35')],_0xdb9148[_0xbf16('0x37')]);_0x28479f[_0xbf16('0x3a')]=_[_0xbf16('0x39')](_0xdb9148[_0xbf16('0x35')],qs['fields'](_0x225428[_0xbf16('0x37')][_0xbf16('0x3b')]));_0x28479f[_0xbf16('0x3a')]=_0x28479f[_0xbf16('0x3a')][_0xbf16('0x3c')]?_0x28479f[_0xbf16('0x3a')]:_0xdb9148['model'];if(!_0x225428[_0xbf16('0x37')][_0xbf16('0x3d')](_0xbf16('0x3e'))){_0x28479f['limit']=qs[_0xbf16('0x3f')](_0x225428['query'][_0xbf16('0x3f')]);_0x28479f[_0xbf16('0x28')]=qs[_0xbf16('0x28')](_0x225428[_0xbf16('0x37')][_0xbf16('0x28')]);}_0x28479f[_0xbf16('0x40')]=qs[_0xbf16('0x41')](_0x225428['query'][_0xbf16('0x41')]);_0x28479f['where']=qs[_0xbf16('0x38')](_['pick'](_0x225428[_0xbf16('0x37')],_0xdb9148['filters']));if(_0x225428[_0xbf16('0x37')]['filter']){_0x28479f['where']=_[_0xbf16('0x42')](_0x28479f[_0xbf16('0x43')],{'$or':_[_0xbf16('0x44')](_0x3d1f56,function(_0x11a20d){if(_0x11a20d[_0xbf16('0x45')][_0xbf16('0x46')]!=='VIRTUAL'){var _0x5e3723={};_0x5e3723[_0x11a20d[_0xbf16('0x47')]]={'$like':'%'+_0x225428[_0xbf16('0x37')][_0xbf16('0x48')]+'%'};return _0x5e3723;}})});}_0x28479f=_['merge']({},_0x28479f,_0x225428[_0xbf16('0x49')]);var _0x1bc140={'where':_0x28479f['where']};return db['VtigerConfiguration']['count'](_0x1bc140)[_0xbf16('0x2e')](function(_0x2ec2ad){_0x44fdd5[_0xbf16('0x27')]=_0x2ec2ad;if(_0x225428[_0xbf16('0x37')][_0xbf16('0x4a')]){_0x28479f[_0xbf16('0x4b')]=[{'all':!![]}];}return db[_0xbf16('0x34')][_0xbf16('0x4c')](_0x28479f);})[_0xbf16('0x2e')](function(_0x3e62b9){_0x44fdd5[_0xbf16('0x4d')]=_0x3e62b9;return _0x44fdd5;})[_0xbf16('0x2e')](respondWithFilteredResult(_0x4b7b83,_0x28479f))[_0xbf16('0x23')](handleError(_0x4b7b83,null));};exports[_0xbf16('0x4e')]=function(_0x2c778a,_0x52e616){var _0x54bbd4={'raw':![],'where':{'id':_0x2c778a[_0xbf16('0x4f')]['id']}},_0x49a9b6={};_0x49a9b6[_0xbf16('0x35')]=_[_0xbf16('0x36')](db['VtigerConfiguration'][_0xbf16('0x50')]);_0x49a9b6['query']=_[_0xbf16('0x36')](_0x2c778a[_0xbf16('0x37')]);_0x49a9b6[_0xbf16('0x38')]=_[_0xbf16('0x39')](_0x49a9b6[_0xbf16('0x35')],_0x49a9b6[_0xbf16('0x37')]);_0x54bbd4[_0xbf16('0x3a')]=_[_0xbf16('0x39')](_0x49a9b6[_0xbf16('0x35')],qs[_0xbf16('0x3b')](_0x2c778a[_0xbf16('0x37')][_0xbf16('0x3b')]));_0x54bbd4[_0xbf16('0x3a')]=_0x54bbd4[_0xbf16('0x3a')][_0xbf16('0x3c')]?_0x54bbd4[_0xbf16('0x3a')]:_0x49a9b6[_0xbf16('0x35')];if(_0x2c778a[_0xbf16('0x37')][_0xbf16('0x4a')]){_0x54bbd4['include']=[{'all':!![]}];}_0x54bbd4=_[_0xbf16('0x42')]({},_0x54bbd4,_0x2c778a[_0xbf16('0x49')]);return db[_0xbf16('0x34')][_0xbf16('0x51')](_0x54bbd4)['then'](handleEntityNotFound(_0x52e616,null))[_0xbf16('0x2e')](respondWithResult(_0x52e616,null))[_0xbf16('0x23')](handleError(_0x52e616,null));};exports[_0xbf16('0x52')]=function(_0x3f5d1d,_0x410db5){return db[_0xbf16('0x34')][_0xbf16('0x52')](_0x3f5d1d[_0xbf16('0x53')],{})[_0xbf16('0x2e')](respondWithResult(_0x410db5,0xc9))['catch'](handleError(_0x410db5,null));};exports[_0xbf16('0x2d')]=function(_0x238f7d,_0x3c4a62){if(_0x238f7d[_0xbf16('0x53')]['id']){delete _0x238f7d[_0xbf16('0x53')]['id'];}return db['VtigerConfiguration'][_0xbf16('0x51')]({'where':{'id':_0x238f7d[_0xbf16('0x4f')]['id']}})['then'](handleEntityNotFound(_0x3c4a62,null))[_0xbf16('0x2e')](saveUpdates(_0x238f7d[_0xbf16('0x53')],null))[_0xbf16('0x2e')](respondWithResult(_0x3c4a62,null))[_0xbf16('0x23')](handleError(_0x3c4a62,null));};exports[_0xbf16('0x2f')]=function(_0x4a50ff,_0x3462b3){return db[_0xbf16('0x34')][_0xbf16('0x51')]({'where':{'id':_0x4a50ff[_0xbf16('0x4f')]['id']}})[_0xbf16('0x2e')](handleEntityNotFound(_0x3462b3,null))[_0xbf16('0x2e')](removeEntity(_0x3462b3,null))[_0xbf16('0x23')](handleError(_0x3462b3,null));};exports[_0xbf16('0x54')]=function(_0x55bb9e,_0x553511,_0x33f71e){var _0xde1335={};var _0x2979c0={};var _0x3fbbf9;var _0x1bcf9a;return db[_0xbf16('0x34')][_0xbf16('0x55')]({'where':{'id':_0x55bb9e[_0xbf16('0x4f')]['id']}})[_0xbf16('0x2e')](handleEntityNotFound(_0x553511,null))[_0xbf16('0x2e')](function(_0x457b4e){if(_0x457b4e){_0x3fbbf9=_0x457b4e;_0x2979c0['model']=_[_0xbf16('0x36')](db[_0xbf16('0x56')][_0xbf16('0x50')]);_0x2979c0['query']=_['keys'](_0x55bb9e[_0xbf16('0x37')]);_0x2979c0[_0xbf16('0x38')]=_['intersection'](_0x2979c0[_0xbf16('0x35')],_0x2979c0['query']);_0xde1335[_0xbf16('0x3a')]=_[_0xbf16('0x39')](_0x2979c0['model'],qs['fields'](_0x55bb9e[_0xbf16('0x37')][_0xbf16('0x3b')]));_0xde1335[_0xbf16('0x3a')]=_0xde1335['attributes'][_0xbf16('0x3c')]?_0xde1335[_0xbf16('0x3a')]:_0x2979c0['model'];_0xde1335['order']=qs['sort'](_0x55bb9e[_0xbf16('0x37')][_0xbf16('0x41')]);_0xde1335['where']=qs[_0xbf16('0x38')](_[_0xbf16('0x57')](_0x55bb9e[_0xbf16('0x37')],_0x2979c0[_0xbf16('0x38')]));if(_0x55bb9e['query'][_0xbf16('0x48')]){_0xde1335[_0xbf16('0x43')]=_['merge'](_0xde1335['where'],{'$or':_[_0xbf16('0x44')](_0xde1335[_0xbf16('0x3a')],function(_0xea3f27){var _0x250b34={};_0x250b34[_0xea3f27]={'$like':'%'+_0x55bb9e[_0xbf16('0x37')]['filter']+'%'};return _0x250b34;})});}_0xde1335=_[_0xbf16('0x42')]({},_0xde1335,_0x55bb9e[_0xbf16('0x49')]);return _0x3fbbf9[_0xbf16('0x54')](_0xde1335);}})['then'](function(_0x36c906){if(_0x36c906){_0x1bcf9a=_0x36c906['length'];if(!_0x55bb9e[_0xbf16('0x37')]['hasOwnProperty'](_0xbf16('0x3e'))){_0xde1335[_0xbf16('0x3f')]=qs[_0xbf16('0x3f')](_0x55bb9e['query'][_0xbf16('0x3f')]);_0xde1335['offset']=qs[_0xbf16('0x28')](_0x55bb9e[_0xbf16('0x37')][_0xbf16('0x28')]);}return _0x3fbbf9[_0xbf16('0x54')](_0xde1335);}})[_0xbf16('0x2e')](function(_0x407e46){if(_0x407e46){return _0x407e46?{'count':_0x1bcf9a,'rows':_0x407e46}:null;}})[_0xbf16('0x2e')](respondWithResult(_0x553511,null))[_0xbf16('0x23')](handleError(_0x553511,null));};exports[_0xbf16('0x58')]=function(_0x5e0813,_0x3b22ec,_0xdb96af){var _0x442431={};var _0xdfc31c={};var _0x1da536;var _0x35dec9;return db[_0xbf16('0x34')][_0xbf16('0x55')]({'where':{'id':_0x5e0813['params']['id']}})[_0xbf16('0x2e')](handleEntityNotFound(_0x3b22ec,null))[_0xbf16('0x2e')](function(_0x135106){if(_0x135106){_0x1da536=_0x135106;_0xdfc31c[_0xbf16('0x35')]=_['keys'](db[_0xbf16('0x56')][_0xbf16('0x50')]);_0xdfc31c['query']=_[_0xbf16('0x36')](_0x5e0813['query']);_0xdfc31c[_0xbf16('0x38')]=_[_0xbf16('0x39')](_0xdfc31c['model'],_0xdfc31c[_0xbf16('0x37')]);_0x442431[_0xbf16('0x3a')]=_[_0xbf16('0x39')](_0xdfc31c[_0xbf16('0x35')],qs[_0xbf16('0x3b')](_0x5e0813[_0xbf16('0x37')][_0xbf16('0x3b')]));_0x442431[_0xbf16('0x3a')]=_0x442431[_0xbf16('0x3a')][_0xbf16('0x3c')]?_0x442431[_0xbf16('0x3a')]:_0xdfc31c[_0xbf16('0x35')];_0x442431[_0xbf16('0x40')]=qs[_0xbf16('0x41')](_0x5e0813['query'][_0xbf16('0x41')]);_0x442431['where']=qs['filters'](_[_0xbf16('0x57')](_0x5e0813['query'],_0xdfc31c[_0xbf16('0x38')]));if(_0x5e0813['query'][_0xbf16('0x48')]){_0x442431[_0xbf16('0x43')]=_['merge'](_0x442431['where'],{'$or':_[_0xbf16('0x44')](_0x442431[_0xbf16('0x3a')],function(_0x5aa266){var _0x32c20c={};_0x32c20c[_0x5aa266]={'$like':'%'+_0x5e0813[_0xbf16('0x37')][_0xbf16('0x48')]+'%'};return _0x32c20c;})});}_0x442431=_[_0xbf16('0x42')]({},_0x442431,_0x5e0813['options']);return _0x1da536[_0xbf16('0x58')](_0x442431);}})[_0xbf16('0x2e')](function(_0x4040b9){if(_0x4040b9){_0x35dec9=_0x4040b9['length'];if(!_0x5e0813['query'][_0xbf16('0x3d')](_0xbf16('0x3e'))){_0x442431[_0xbf16('0x3f')]=qs['limit'](_0x5e0813[_0xbf16('0x37')][_0xbf16('0x3f')]);_0x442431[_0xbf16('0x28')]=qs['offset'](_0x5e0813['query'][_0xbf16('0x28')]);}return _0x1da536[_0xbf16('0x58')](_0x442431);}})['then'](function(_0xc9777){if(_0xc9777){return _0xc9777?{'count':_0x35dec9,'rows':_0xc9777}:null;}})[_0xbf16('0x2e')](respondWithResult(_0x3b22ec,null))['catch'](handleError(_0x3b22ec,null));};exports[_0xbf16('0x59')]=function(_0x32e992,_0xd207a6,_0x3893f4){var _0x4f56ca={};var _0x51f647={};var _0x1248e0;var _0x32c207;return db[_0xbf16('0x34')][_0xbf16('0x55')]({'where':{'id':_0x32e992[_0xbf16('0x4f')]['id']}})['then'](handleEntityNotFound(_0xd207a6,null))[_0xbf16('0x2e')](function(_0x3ca4d9){if(_0x3ca4d9){_0x1248e0=_0x3ca4d9;_0x51f647['model']=_['keys'](db[_0xbf16('0x56')][_0xbf16('0x50')]);_0x51f647[_0xbf16('0x37')]=_[_0xbf16('0x36')](_0x32e992['query']);_0x51f647['filters']=_[_0xbf16('0x39')](_0x51f647[_0xbf16('0x35')],_0x51f647[_0xbf16('0x37')]);_0x4f56ca[_0xbf16('0x3a')]=_[_0xbf16('0x39')](_0x51f647['model'],qs[_0xbf16('0x3b')](_0x32e992['query'][_0xbf16('0x3b')]));_0x4f56ca['attributes']=_0x4f56ca[_0xbf16('0x3a')][_0xbf16('0x3c')]?_0x4f56ca[_0xbf16('0x3a')]:_0x51f647[_0xbf16('0x35')];_0x4f56ca['order']=qs[_0xbf16('0x41')](_0x32e992[_0xbf16('0x37')][_0xbf16('0x41')]);_0x4f56ca[_0xbf16('0x43')]=qs[_0xbf16('0x38')](_[_0xbf16('0x57')](_0x32e992[_0xbf16('0x37')],_0x51f647[_0xbf16('0x38')]));if(_0x32e992[_0xbf16('0x37')][_0xbf16('0x48')]){_0x4f56ca[_0xbf16('0x43')]=_['merge'](_0x4f56ca[_0xbf16('0x43')],{'$or':_['map'](_0x4f56ca[_0xbf16('0x3a')],function(_0x3734a3){var _0x5a65a9={};_0x5a65a9[_0x3734a3]={'$like':'%'+_0x32e992[_0xbf16('0x37')][_0xbf16('0x48')]+'%'};return _0x5a65a9;})});}_0x4f56ca=_[_0xbf16('0x42')]({},_0x4f56ca,_0x32e992[_0xbf16('0x49')]);return _0x1248e0['getDescriptions'](_0x4f56ca);}})[_0xbf16('0x2e')](function(_0x4a5780){if(_0x4a5780){_0x32c207=_0x4a5780[_0xbf16('0x3c')];if(!_0x32e992[_0xbf16('0x37')][_0xbf16('0x3d')](_0xbf16('0x3e'))){_0x4f56ca[_0xbf16('0x3f')]=qs[_0xbf16('0x3f')](_0x32e992['query'][_0xbf16('0x3f')]);_0x4f56ca['offset']=qs[_0xbf16('0x28')](_0x32e992[_0xbf16('0x37')][_0xbf16('0x28')]);}return _0x1248e0['getDescriptions'](_0x4f56ca);}})[_0xbf16('0x2e')](function(_0x3e1798){if(_0x3e1798){return _0x3e1798?{'count':_0x32c207,'rows':_0x3e1798}:null;}})[_0xbf16('0x2e')](respondWithResult(_0xd207a6,null))[_0xbf16('0x23')](handleError(_0xd207a6,null));}; \ No newline at end of file +var _0xb5fd=['type','key','VIRTUAL','field','options','includeAll','include','findAll','rows','params','length','find','create','body','getFields','findOne','VtigerField','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','count','offset','limit','set','apply','reject','save','destroy','name','send','index','VtigerConfiguration','rawAttributes','model','keys','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map'];(function(_0x22cb28,_0x35a3fb){var _0x35c9d7=function(_0x34f430){while(--_0x34f430){_0x22cb28['push'](_0x22cb28['shift']());}};_0x35c9d7(++_0x35a3fb);}(_0xb5fd,0x71));var _0xdb5f=function(_0x78f66a,_0x40d3d5){_0x78f66a=_0x78f66a-0x0;var _0x4c485e=_0xb5fd[_0x78f66a];return _0x4c485e;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xdb5f('0x0'));var rimraf=require(_0xdb5f('0x1'));var zipdir=require(_0xdb5f('0x2'));var jsonpatch=require(_0xdb5f('0x3'));var rp=require(_0xdb5f('0x4'));var moment=require(_0xdb5f('0x5'));var BPromise=require(_0xdb5f('0x6'));var Mustache=require(_0xdb5f('0x7'));var util=require(_0xdb5f('0x8'));var path=require(_0xdb5f('0x9'));var sox=require(_0xdb5f('0xa'));var csv=require(_0xdb5f('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0xdb5f('0xc'));var crypto=require(_0xdb5f('0xd'));var jsforce=require(_0xdb5f('0xe'));var deskjs=require(_0xdb5f('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xdb5f('0x10'));var Redis=require(_0xdb5f('0x11'));var authService=require(_0xdb5f('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xdb5f('0x13'));var logger=require(_0xdb5f('0x14'))(_0xdb5f('0x15'));var utils=require(_0xdb5f('0x16'));var config=require(_0xdb5f('0x17'));var db=require(_0xdb5f('0x18'))['db'];var jayson=require(_0xdb5f('0x19'));var client=jayson[_0xdb5f('0x1a')][_0xdb5f('0x1b')]({'port':0x232a});function checkPasswordPattern(_0x3dbf5d,_0x202c3b,_0x2c31e6){if(_0x2c31e6){var _0x4e97dc=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4e97dc['test'](_0x202c3b)){return _0x3dbf5d;}else{throw new Error(_0xdb5f('0x1c'));}}else{return _0x3dbf5d;}}function respondWithRpcPromise(_0x591ab1,_0x15fc8a,_0x323aaf,_0x130943){return new BPromise(function(_0x136f4c,_0x30dedb){var _0x5be4fa=_0x130943||client;return _0x5be4fa[_0xdb5f('0x1d')](_0x591ab1,_0x323aaf)[_0xdb5f('0x1e')](function(_0x5dba45){logger[_0xdb5f('0x1f')](_0xdb5f('0x20'),_0x15fc8a,_0xdb5f('0x21'));logger[_0xdb5f('0x22')](_0xdb5f('0x23'),_0x15fc8a,'request\x20sent',JSON[_0xdb5f('0x24')](_0x5dba45));if(_0x5dba45['error']){if(_0x5dba45[_0xdb5f('0x25')][_0xdb5f('0x26')]===0x1f4){logger['error'](_0xdb5f('0x20'),_0x15fc8a,_0x5dba45[_0xdb5f('0x25')][_0xdb5f('0x27')]);return _0x30dedb(_0x5dba45['error'][_0xdb5f('0x27')]);}logger[_0xdb5f('0x25')](_0xdb5f('0x20'),_0x15fc8a,_0x5dba45[_0xdb5f('0x25')][_0xdb5f('0x27')]);return _0x136f4c(_0x5dba45['error'][_0xdb5f('0x27')]);}else{logger[_0xdb5f('0x1f')]('VtigerConfiguration,\x20%s,\x20%s',_0x15fc8a,_0xdb5f('0x21'));_0x136f4c(_0x5dba45[_0xdb5f('0x28')][_0xdb5f('0x27')]);}})[_0xdb5f('0x29')](function(_0x2681ad){logger['error'](_0xdb5f('0x20'),_0x15fc8a,_0x2681ad);_0x30dedb(_0x2681ad);});});}function respondWithStatusCode(_0x42455a,_0x43d53e){_0x43d53e=_0x43d53e||0xcc;return function(_0x4d7859){if(_0x4d7859){return _0x42455a[_0xdb5f('0x2a')](_0x43d53e);}return _0x42455a[_0xdb5f('0x2b')](_0x43d53e)[_0xdb5f('0x2c')]();};}function respondWithResult(_0x2ee157,_0xd90c89){_0xd90c89=_0xd90c89||0xc8;return function(_0xb2817b){if(_0xb2817b){return _0x2ee157[_0xdb5f('0x2b')](_0xd90c89)[_0xdb5f('0x2d')](_0xb2817b);}};}function respondWithFilteredResult(_0x5a33a9,_0x4f5ebf){return function(_0x2b0ed5){if(_0x2b0ed5){var _0x3dd154=_0x2b0ed5[_0xdb5f('0x2e')],_0x5973f6=_0x4f5ebf[_0xdb5f('0x2f')],_0x423ee2=_0x4f5ebf[_0xdb5f('0x2f')]+_0x4f5ebf[_0xdb5f('0x30')],_0x548a09;if(_0x423ee2>=_0x3dd154){_0x423ee2=_0x3dd154;_0x548a09=0xc8;}else{_0x548a09=0xce;}_0x5a33a9[_0xdb5f('0x2b')](_0x548a09);return _0x5a33a9[_0xdb5f('0x31')]('Content-Range',_0x5973f6+'-'+_0x423ee2+'/'+_0x3dd154)['json'](_0x2b0ed5);}return null;};}function patchUpdates(_0x332b76){return function(_0x533d17){try{jsonpatch[_0xdb5f('0x32')](_0x533d17,_0x332b76,!![]);}catch(_0xe53123){return BPromise[_0xdb5f('0x33')](_0xe53123);}return _0x533d17[_0xdb5f('0x34')]();};}function saveUpdates(_0x119cd5,_0x42559c){return function(_0x29cece){if(_0x29cece){return _0x29cece['update'](_0x119cd5)[_0xdb5f('0x1e')](function(_0x9d9f17){return _0x9d9f17;});}return null;};}function removeEntity(_0x59bc9c,_0x50bc1e){return function(_0x4fe4cc){if(_0x4fe4cc){return _0x4fe4cc[_0xdb5f('0x35')]()['then'](function(){_0x59bc9c['status'](0xcc)[_0xdb5f('0x2c')]();});}};}function handleEntityNotFound(_0xfb86a0,_0x3e782c){return function(_0xafd39a){if(!_0xafd39a){_0xfb86a0['sendStatus'](0x194);}return _0xafd39a;};}function handleError(_0x3f7fa4,_0x3f29a4){_0x3f29a4=_0x3f29a4||0x1f4;return function(_0x280447){logger[_0xdb5f('0x25')](_0x280447['stack']);if(_0x280447[_0xdb5f('0x36')]){delete _0x280447[_0xdb5f('0x36')];}_0x3f7fa4['status'](_0x3f29a4)[_0xdb5f('0x37')](_0x280447);};}exports[_0xdb5f('0x38')]=function(_0x5ae61a,_0x1aa1fb){var _0x375f27={},_0x1d4570={},_0x488b71={'count':0x0,'rows':[]};var _0x3063f3=db[_0xdb5f('0x39')][_0xdb5f('0x3a')];_0x1d4570[_0xdb5f('0x3b')]=_[_0xdb5f('0x3c')](_0x3063f3);_0x1d4570['query']=_[_0xdb5f('0x3c')](_0x5ae61a[_0xdb5f('0x3d')]);_0x1d4570[_0xdb5f('0x3e')]=_['intersection'](_0x1d4570['model'],_0x1d4570[_0xdb5f('0x3d')]);_0x375f27[_0xdb5f('0x3f')]=_[_0xdb5f('0x40')](_0x1d4570[_0xdb5f('0x3b')],qs[_0xdb5f('0x41')](_0x5ae61a[_0xdb5f('0x3d')][_0xdb5f('0x41')]));_0x375f27[_0xdb5f('0x3f')]=_0x375f27[_0xdb5f('0x3f')]['length']?_0x375f27[_0xdb5f('0x3f')]:_0x1d4570['model'];if(!_0x5ae61a[_0xdb5f('0x3d')][_0xdb5f('0x42')](_0xdb5f('0x43'))){_0x375f27['limit']=qs['limit'](_0x5ae61a[_0xdb5f('0x3d')][_0xdb5f('0x30')]);_0x375f27[_0xdb5f('0x2f')]=qs[_0xdb5f('0x2f')](_0x5ae61a['query']['offset']);}_0x375f27[_0xdb5f('0x44')]=qs[_0xdb5f('0x45')](_0x5ae61a[_0xdb5f('0x3d')][_0xdb5f('0x45')]);_0x375f27[_0xdb5f('0x46')]=qs['filters'](_[_0xdb5f('0x47')](_0x5ae61a[_0xdb5f('0x3d')],_0x1d4570[_0xdb5f('0x3e')]));if(_0x5ae61a[_0xdb5f('0x3d')][_0xdb5f('0x48')]){_0x375f27[_0xdb5f('0x46')]=_[_0xdb5f('0x49')](_0x375f27[_0xdb5f('0x46')],{'$or':_[_0xdb5f('0x4a')](_0x3063f3,function(_0x39b436){if(_0x39b436[_0xdb5f('0x4b')][_0xdb5f('0x4c')]!==_0xdb5f('0x4d')){var _0x385b5e={};_0x385b5e[_0x39b436[_0xdb5f('0x4e')]]={'$like':'%'+_0x5ae61a[_0xdb5f('0x3d')][_0xdb5f('0x48')]+'%'};return _0x385b5e;}})});}_0x375f27=_[_0xdb5f('0x49')]({},_0x375f27,_0x5ae61a[_0xdb5f('0x4f')]);var _0x45a07f={'where':_0x375f27[_0xdb5f('0x46')]};return db['VtigerConfiguration']['count'](_0x45a07f)[_0xdb5f('0x1e')](function(_0x82e3f3){_0x488b71['count']=_0x82e3f3;if(_0x5ae61a['query'][_0xdb5f('0x50')]){_0x375f27[_0xdb5f('0x51')]=[{'all':!![]}];}return db['VtigerConfiguration'][_0xdb5f('0x52')](_0x375f27);})[_0xdb5f('0x1e')](function(_0x3e5282){_0x488b71[_0xdb5f('0x53')]=_0x3e5282;return _0x488b71;})[_0xdb5f('0x1e')](respondWithFilteredResult(_0x1aa1fb,_0x375f27))[_0xdb5f('0x29')](handleError(_0x1aa1fb,null));};exports['show']=function(_0x1ecf4a,_0x29c296){var _0x4ee2c4={'raw':![],'where':{'id':_0x1ecf4a[_0xdb5f('0x54')]['id']}},_0x7c42a9={};_0x7c42a9[_0xdb5f('0x3b')]=_[_0xdb5f('0x3c')](db[_0xdb5f('0x39')]['rawAttributes']);_0x7c42a9['query']=_[_0xdb5f('0x3c')](_0x1ecf4a[_0xdb5f('0x3d')]);_0x7c42a9[_0xdb5f('0x3e')]=_[_0xdb5f('0x40')](_0x7c42a9[_0xdb5f('0x3b')],_0x7c42a9[_0xdb5f('0x3d')]);_0x4ee2c4['attributes']=_[_0xdb5f('0x40')](_0x7c42a9[_0xdb5f('0x3b')],qs[_0xdb5f('0x41')](_0x1ecf4a[_0xdb5f('0x3d')]['fields']));_0x4ee2c4['attributes']=_0x4ee2c4[_0xdb5f('0x3f')][_0xdb5f('0x55')]?_0x4ee2c4['attributes']:_0x7c42a9[_0xdb5f('0x3b')];if(_0x1ecf4a['query'][_0xdb5f('0x50')]){_0x4ee2c4[_0xdb5f('0x51')]=[{'all':!![]}];}_0x4ee2c4=_['merge']({},_0x4ee2c4,_0x1ecf4a[_0xdb5f('0x4f')]);return db[_0xdb5f('0x39')][_0xdb5f('0x56')](_0x4ee2c4)['then'](handleEntityNotFound(_0x29c296,null))['then'](respondWithResult(_0x29c296,null))[_0xdb5f('0x29')](handleError(_0x29c296,null));};exports[_0xdb5f('0x57')]=function(_0xc108e6,_0x35aa78){return db[_0xdb5f('0x39')][_0xdb5f('0x57')](_0xc108e6[_0xdb5f('0x58')],{})[_0xdb5f('0x1e')](respondWithResult(_0x35aa78,0xc9))[_0xdb5f('0x29')](handleError(_0x35aa78,null));};exports['update']=function(_0x68a838,_0x2a0161){if(_0x68a838[_0xdb5f('0x58')]['id']){delete _0x68a838[_0xdb5f('0x58')]['id'];}return db[_0xdb5f('0x39')]['find']({'where':{'id':_0x68a838[_0xdb5f('0x54')]['id']}})['then'](handleEntityNotFound(_0x2a0161,null))[_0xdb5f('0x1e')](saveUpdates(_0x68a838[_0xdb5f('0x58')],null))[_0xdb5f('0x1e')](respondWithResult(_0x2a0161,null))[_0xdb5f('0x29')](handleError(_0x2a0161,null));};exports['destroy']=function(_0xe02d08,_0x225254){return db['VtigerConfiguration'][_0xdb5f('0x56')]({'where':{'id':_0xe02d08[_0xdb5f('0x54')]['id']}})[_0xdb5f('0x1e')](handleEntityNotFound(_0x225254,null))[_0xdb5f('0x1e')](removeEntity(_0x225254,null))[_0xdb5f('0x29')](handleError(_0x225254,null));};exports[_0xdb5f('0x59')]=function(_0x1604bf,_0x3599b3,_0x5913d4){var _0x2cfb97={};var _0x2fbd41={};var _0x3d4198;var _0x1994ef;return db[_0xdb5f('0x39')][_0xdb5f('0x5a')]({'where':{'id':_0x1604bf[_0xdb5f('0x54')]['id']}})[_0xdb5f('0x1e')](handleEntityNotFound(_0x3599b3,null))[_0xdb5f('0x1e')](function(_0x38206f){if(_0x38206f){_0x3d4198=_0x38206f;_0x2fbd41['model']=_[_0xdb5f('0x3c')](db[_0xdb5f('0x5b')][_0xdb5f('0x3a')]);_0x2fbd41[_0xdb5f('0x3d')]=_[_0xdb5f('0x3c')](_0x1604bf[_0xdb5f('0x3d')]);_0x2fbd41['filters']=_['intersection'](_0x2fbd41[_0xdb5f('0x3b')],_0x2fbd41['query']);_0x2cfb97[_0xdb5f('0x3f')]=_['intersection'](_0x2fbd41[_0xdb5f('0x3b')],qs[_0xdb5f('0x41')](_0x1604bf[_0xdb5f('0x3d')][_0xdb5f('0x41')]));_0x2cfb97[_0xdb5f('0x3f')]=_0x2cfb97[_0xdb5f('0x3f')]['length']?_0x2cfb97[_0xdb5f('0x3f')]:_0x2fbd41[_0xdb5f('0x3b')];_0x2cfb97[_0xdb5f('0x44')]=qs[_0xdb5f('0x45')](_0x1604bf[_0xdb5f('0x3d')][_0xdb5f('0x45')]);_0x2cfb97[_0xdb5f('0x46')]=qs[_0xdb5f('0x3e')](_[_0xdb5f('0x47')](_0x1604bf[_0xdb5f('0x3d')],_0x2fbd41[_0xdb5f('0x3e')]));if(_0x1604bf[_0xdb5f('0x3d')][_0xdb5f('0x48')]){_0x2cfb97[_0xdb5f('0x46')]=_[_0xdb5f('0x49')](_0x2cfb97[_0xdb5f('0x46')],{'$or':_[_0xdb5f('0x4a')](_0x2cfb97[_0xdb5f('0x3f')],function(_0x1abe5c){var _0x49421b={};_0x49421b[_0x1abe5c]={'$like':'%'+_0x1604bf[_0xdb5f('0x3d')][_0xdb5f('0x48')]+'%'};return _0x49421b;})});}_0x2cfb97=_[_0xdb5f('0x49')]({},_0x2cfb97,_0x1604bf[_0xdb5f('0x4f')]);return _0x3d4198[_0xdb5f('0x59')](_0x2cfb97);}})[_0xdb5f('0x1e')](function(_0x126feb){if(_0x126feb){_0x1994ef=_0x126feb[_0xdb5f('0x55')];if(!_0x1604bf[_0xdb5f('0x3d')][_0xdb5f('0x42')](_0xdb5f('0x43'))){_0x2cfb97[_0xdb5f('0x30')]=qs['limit'](_0x1604bf[_0xdb5f('0x3d')][_0xdb5f('0x30')]);_0x2cfb97['offset']=qs['offset'](_0x1604bf[_0xdb5f('0x3d')][_0xdb5f('0x2f')]);}return _0x3d4198[_0xdb5f('0x59')](_0x2cfb97);}})[_0xdb5f('0x1e')](function(_0x47a7e1){if(_0x47a7e1){return _0x47a7e1?{'count':_0x1994ef,'rows':_0x47a7e1}:null;}})[_0xdb5f('0x1e')](respondWithResult(_0x3599b3,null))['catch'](handleError(_0x3599b3,null));};exports['getSubjects']=function(_0x293f7f,_0x1a1616,_0x87bd54){var _0x4ba413={};var _0x33c2d2={};var _0x2d841b;var _0x3c5224;return db[_0xdb5f('0x39')]['findOne']({'where':{'id':_0x293f7f[_0xdb5f('0x54')]['id']}})[_0xdb5f('0x1e')](handleEntityNotFound(_0x1a1616,null))[_0xdb5f('0x1e')](function(_0x2a02c5){if(_0x2a02c5){_0x2d841b=_0x2a02c5;_0x33c2d2['model']=_[_0xdb5f('0x3c')](db[_0xdb5f('0x5b')][_0xdb5f('0x3a')]);_0x33c2d2[_0xdb5f('0x3d')]=_[_0xdb5f('0x3c')](_0x293f7f['query']);_0x33c2d2[_0xdb5f('0x3e')]=_[_0xdb5f('0x40')](_0x33c2d2[_0xdb5f('0x3b')],_0x33c2d2[_0xdb5f('0x3d')]);_0x4ba413[_0xdb5f('0x3f')]=_[_0xdb5f('0x40')](_0x33c2d2[_0xdb5f('0x3b')],qs['fields'](_0x293f7f['query'][_0xdb5f('0x41')]));_0x4ba413[_0xdb5f('0x3f')]=_0x4ba413[_0xdb5f('0x3f')]['length']?_0x4ba413['attributes']:_0x33c2d2[_0xdb5f('0x3b')];_0x4ba413[_0xdb5f('0x44')]=qs[_0xdb5f('0x45')](_0x293f7f[_0xdb5f('0x3d')][_0xdb5f('0x45')]);_0x4ba413[_0xdb5f('0x46')]=qs['filters'](_['pick'](_0x293f7f[_0xdb5f('0x3d')],_0x33c2d2[_0xdb5f('0x3e')]));if(_0x293f7f[_0xdb5f('0x3d')]['filter']){_0x4ba413[_0xdb5f('0x46')]=_[_0xdb5f('0x49')](_0x4ba413[_0xdb5f('0x46')],{'$or':_[_0xdb5f('0x4a')](_0x4ba413[_0xdb5f('0x3f')],function(_0x17a119){var _0x3f0e55={};_0x3f0e55[_0x17a119]={'$like':'%'+_0x293f7f[_0xdb5f('0x3d')][_0xdb5f('0x48')]+'%'};return _0x3f0e55;})});}_0x4ba413=_[_0xdb5f('0x49')]({},_0x4ba413,_0x293f7f['options']);return _0x2d841b[_0xdb5f('0x5c')](_0x4ba413);}})['then'](function(_0x2d5b6f){if(_0x2d5b6f){_0x3c5224=_0x2d5b6f['length'];if(!_0x293f7f[_0xdb5f('0x3d')][_0xdb5f('0x42')](_0xdb5f('0x43'))){_0x4ba413['limit']=qs[_0xdb5f('0x30')](_0x293f7f[_0xdb5f('0x3d')][_0xdb5f('0x30')]);_0x4ba413['offset']=qs['offset'](_0x293f7f[_0xdb5f('0x3d')][_0xdb5f('0x2f')]);}return _0x2d841b[_0xdb5f('0x5c')](_0x4ba413);}})[_0xdb5f('0x1e')](function(_0x1f2f29){if(_0x1f2f29){return _0x1f2f29?{'count':_0x3c5224,'rows':_0x1f2f29}:null;}})[_0xdb5f('0x1e')](respondWithResult(_0x1a1616,null))[_0xdb5f('0x29')](handleError(_0x1a1616,null));};exports[_0xdb5f('0x5d')]=function(_0x21b9ae,_0x28d66b,_0xd6acd6){var _0x792634={};var _0x191e28={};var _0x4fb135;var _0xf16a3f;return db[_0xdb5f('0x39')][_0xdb5f('0x5a')]({'where':{'id':_0x21b9ae[_0xdb5f('0x54')]['id']}})[_0xdb5f('0x1e')](handleEntityNotFound(_0x28d66b,null))['then'](function(_0x55e80c){if(_0x55e80c){_0x4fb135=_0x55e80c;_0x191e28[_0xdb5f('0x3b')]=_['keys'](db['VtigerField'][_0xdb5f('0x3a')]);_0x191e28[_0xdb5f('0x3d')]=_[_0xdb5f('0x3c')](_0x21b9ae[_0xdb5f('0x3d')]);_0x191e28[_0xdb5f('0x3e')]=_[_0xdb5f('0x40')](_0x191e28[_0xdb5f('0x3b')],_0x191e28[_0xdb5f('0x3d')]);_0x792634[_0xdb5f('0x3f')]=_[_0xdb5f('0x40')](_0x191e28[_0xdb5f('0x3b')],qs[_0xdb5f('0x41')](_0x21b9ae[_0xdb5f('0x3d')]['fields']));_0x792634[_0xdb5f('0x3f')]=_0x792634[_0xdb5f('0x3f')][_0xdb5f('0x55')]?_0x792634[_0xdb5f('0x3f')]:_0x191e28[_0xdb5f('0x3b')];_0x792634['order']=qs[_0xdb5f('0x45')](_0x21b9ae[_0xdb5f('0x3d')][_0xdb5f('0x45')]);_0x792634[_0xdb5f('0x46')]=qs[_0xdb5f('0x3e')](_[_0xdb5f('0x47')](_0x21b9ae[_0xdb5f('0x3d')],_0x191e28[_0xdb5f('0x3e')]));if(_0x21b9ae[_0xdb5f('0x3d')][_0xdb5f('0x48')]){_0x792634['where']=_[_0xdb5f('0x49')](_0x792634['where'],{'$or':_[_0xdb5f('0x4a')](_0x792634[_0xdb5f('0x3f')],function(_0xc2d40e){var _0x2452e8={};_0x2452e8[_0xc2d40e]={'$like':'%'+_0x21b9ae[_0xdb5f('0x3d')][_0xdb5f('0x48')]+'%'};return _0x2452e8;})});}_0x792634=_[_0xdb5f('0x49')]({},_0x792634,_0x21b9ae[_0xdb5f('0x4f')]);return _0x4fb135[_0xdb5f('0x5d')](_0x792634);}})[_0xdb5f('0x1e')](function(_0x147ed4){if(_0x147ed4){_0xf16a3f=_0x147ed4['length'];if(!_0x21b9ae['query']['hasOwnProperty'](_0xdb5f('0x43'))){_0x792634[_0xdb5f('0x30')]=qs['limit'](_0x21b9ae[_0xdb5f('0x3d')][_0xdb5f('0x30')]);_0x792634['offset']=qs['offset'](_0x21b9ae[_0xdb5f('0x3d')]['offset']);}return _0x4fb135[_0xdb5f('0x5d')](_0x792634);}})[_0xdb5f('0x1e')](function(_0x51ad72){if(_0x51ad72){return _0x51ad72?{'count':_0xf16a3f,'rows':_0x51ad72}:null;}})[_0xdb5f('0x1e')](respondWithResult(_0x28d66b,null))['catch'](handleError(_0x28d66b,null));}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js index ac153b8..1cdfc43 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 _0xb3c0=['moment','bluebird','path','../../config/environment','./intVtigerConfiguration.attributes','define','VtigerConfiguration','int_vtiger_configurations','lodash','util','api'];(function(_0x36d25e,_0x1a047d){var _0x4b95b8=function(_0x74da3){while(--_0x74da3){_0x36d25e['push'](_0x36d25e['shift']());}};_0x4b95b8(++_0x1a047d);}(_0xb3c0,0xa2));var _0x0b3c=function(_0x39a977,_0x2d1e43){_0x39a977=_0x39a977-0x0;var _0x2ee9a0=_0xb3c0[_0x39a977];return _0x2ee9a0;};'use strict';var _=require(_0x0b3c('0x0'));var util=require(_0x0b3c('0x1'));var logger=require('../../config/logger')(_0x0b3c('0x2'));var moment=require(_0x0b3c('0x3'));var BPromise=require(_0x0b3c('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0b3c('0x5'));var rimraf=require('rimraf');var config=require(_0x0b3c('0x6'));var attributes=require(_0x0b3c('0x7'));module['exports']=function(_0x56c454,_0x22143c){return _0x56c454[_0x0b3c('0x8')](_0x0b3c('0x9'),attributes,{'tableName':_0x0b3c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7954=['exports','define','VtigerConfiguration','int_vtiger_configurations','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intVtigerConfiguration.attributes'];(function(_0x5dd8f4,_0x23cdcb){var _0x2e8b74=function(_0x16632a){while(--_0x16632a){_0x5dd8f4['push'](_0x5dd8f4['shift']());}};_0x2e8b74(++_0x23cdcb);}(_0x7954,0x154));var _0x4795=function(_0x5413f5,_0x3154c7){_0x5413f5=_0x5413f5-0x0;var _0x639288=_0x7954[_0x5413f5];return _0x639288;};'use strict';var _=require(_0x4795('0x0'));var util=require(_0x4795('0x1'));var logger=require(_0x4795('0x2'))('api');var moment=require(_0x4795('0x3'));var BPromise=require(_0x4795('0x4'));var rp=require(_0x4795('0x5'));var fs=require('fs');var path=require(_0x4795('0x6'));var rimraf=require(_0x4795('0x7'));var config=require(_0x4795('0x8'));var attributes=require(_0x4795('0x9'));module[_0x4795('0xa')]=function(_0x402c42,_0x1f96a2){return _0x402c42[_0x4795('0xb')](_0x4795('0xc'),attributes,{'tableName':_0x4795('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.rpc.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.rpc.js index 2f78f17..782c0d0 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 _0xbb2c=['error','message','result','catch','moment','bluebird','ioredis','../../config/logger','../../config/environment','client','http','info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify'];(function(_0x166d93,_0x301f09){var _0xba708=function(_0x349bf7){while(--_0x349bf7){_0x166d93['push'](_0x166d93['shift']());}};_0xba708(++_0x301f09);}(_0xbb2c,0x1a4));var _0xcbb2=function(_0x2206c3,_0x193ef3){_0x2206c3=_0x2206c3-0x0;var _0x1be8fa=_0xbb2c[_0x2206c3];return _0x1be8fa;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xcbb2('0x0'));var BPromise=require(_0xcbb2('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xcbb2('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xcbb2('0x3'))('rpc');var config=require(_0xcbb2('0x4'));var jayson=require('jayson/promise');var client=jayson[_0xcbb2('0x5')][_0xcbb2('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x45317e,_0x397219,_0x2c4311){return new BPromise(function(_0x194a28,_0x2c1a9c){return client['request'](_0x45317e,_0x2c4311)['then'](function(_0x12c6d7){logger[_0xcbb2('0x7')](_0xcbb2('0x8'),_0x397219,_0xcbb2('0x9'));logger[_0xcbb2('0xa')]('VtigerConfiguration,\x20%s,\x20%s,\x20%s',_0x397219,_0xcbb2('0x9'),JSON[_0xcbb2('0xb')](_0x12c6d7));if(_0x12c6d7[_0xcbb2('0xc')]){if(_0x12c6d7['error']['code']===0x1f4){logger[_0xcbb2('0xc')](_0xcbb2('0x8'),_0x397219,_0x12c6d7[_0xcbb2('0xc')]['message']);return _0x2c1a9c(_0x12c6d7[_0xcbb2('0xc')][_0xcbb2('0xd')]);}logger[_0xcbb2('0xc')](_0xcbb2('0x8'),_0x397219,_0x12c6d7[_0xcbb2('0xc')][_0xcbb2('0xd')]);return _0x194a28(_0x12c6d7['error'][_0xcbb2('0xd')]);}else{logger[_0xcbb2('0x7')](_0xcbb2('0x8'),_0x397219,_0xcbb2('0x9'));_0x194a28(_0x12c6d7[_0xcbb2('0xe')]['message']);}})[_0xcbb2('0xf')](function(_0x5b98b9){logger[_0xcbb2('0xc')]('VtigerConfiguration,\x20%s,\x20%s',_0x397219,_0x5b98b9);_0x2c1a9c(_0x5b98b9);});});} \ No newline at end of file +var _0xd31a=['ioredis','../../mysqldb','../../config/logger','../../config/environment','client','http','request','then','info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring'];(function(_0x40236d,_0x158c95){var _0x103650=function(_0x428b24){while(--_0x428b24){_0x40236d['push'](_0x40236d['shift']());}};_0x103650(++_0x158c95);}(_0xd31a,0x183));var _0xad31=function(_0x19277c,_0x15a7a2){_0x19277c=_0x19277c-0x0;var _0x50e22d=_0xd31a[_0x19277c];return _0x50e22d;};'use strict';var _=require(_0xad31('0x0'));var util=require('util');var moment=require(_0xad31('0x1'));var BPromise=require(_0xad31('0x2'));var rs=require(_0xad31('0x3'));var fs=require('fs');var Redis=require(_0xad31('0x4'));var db=require(_0xad31('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xad31('0x6'))('rpc');var config=require(_0xad31('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xad31('0x8')][_0xad31('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2d0449,_0x1deeb4,_0x5b09f2){return new BPromise(function(_0x568f25,_0x1b4707){return client[_0xad31('0xa')](_0x2d0449,_0x5b09f2)[_0xad31('0xb')](function(_0x47faf2){logger[_0xad31('0xc')](_0xad31('0xd'),_0x1deeb4,_0xad31('0xe'));logger[_0xad31('0xf')](_0xad31('0x10'),_0x1deeb4,_0xad31('0xe'),JSON[_0xad31('0x11')](_0x47faf2));if(_0x47faf2['error']){if(_0x47faf2[_0xad31('0x12')][_0xad31('0x13')]===0x1f4){logger[_0xad31('0x12')](_0xad31('0xd'),_0x1deeb4,_0x47faf2['error']['message']);return _0x1b4707(_0x47faf2[_0xad31('0x12')][_0xad31('0x14')]);}logger['error'](_0xad31('0xd'),_0x1deeb4,_0x47faf2[_0xad31('0x12')][_0xad31('0x14')]);return _0x568f25(_0x47faf2[_0xad31('0x12')][_0xad31('0x14')]);}else{logger[_0xad31('0xc')]('VtigerConfiguration,\x20%s,\x20%s',_0x1deeb4,_0xad31('0xe'));_0x568f25(_0x47faf2[_0xad31('0x15')][_0xad31('0x14')]);}})[_0xad31('0x16')](function(_0xb70ade){logger[_0xad31('0x12')](_0xad31('0xd'),_0x1deeb4,_0xb70ade);_0x1b4707(_0xb70ade);});});} \ No newline at end of file diff --git a/server/api/intVtigerField/index.js b/server/api/intVtigerField/index.js index 0d490b6..76de80b 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 _0x6fd9=['../../components/auth/service','../../config/environment','get','isAuthenticated','show','create','put','update','delete','/:id','destroy','exports','util','connect-timeout','Router'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x6fd9,0xa2));var _0x96fd=function(_0x591945,_0x4ea9d4){_0x591945=_0x591945-0x0;var _0x949ef0=_0x6fd9[_0x591945];return _0x949ef0;};'use strict';var multer=require('multer');var util=require(_0x96fd('0x0'));var path=require('path');var timeout=require(_0x96fd('0x1'));var express=require('express');var router=express[_0x96fd('0x2')]();var auth=require(_0x96fd('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x96fd('0x4'));var controller=require('./intVtigerField.controller');router[_0x96fd('0x5')]('/',auth['isAuthenticated'](),controller['index']);router[_0x96fd('0x5')]('/:id',auth[_0x96fd('0x6')](),controller[_0x96fd('0x7')]);router['post']('/',auth['isAuthenticated'](),controller[_0x96fd('0x8')]);router[_0x96fd('0x9')]('/:id',auth[_0x96fd('0x6')](),controller[_0x96fd('0xa')]);router[_0x96fd('0xb')](_0x96fd('0xc'),auth['isAuthenticated'](),controller[_0x96fd('0xd')]);module[_0x96fd('0xe')]=router; \ No newline at end of file +var _0x1fc0=['connect-timeout','../../components/interaction/service','../../config/environment','get','index','isAuthenticated','show','create','put','/:id','update','delete','destroy','exports','multer'];(function(_0x440234,_0x43e80f){var _0x4e0cc0=function(_0x27594a){while(--_0x27594a){_0x440234['push'](_0x440234['shift']());}};_0x4e0cc0(++_0x43e80f);}(_0x1fc0,0x1df));var _0x01fc=function(_0x5243ad,_0x42f7b1){_0x5243ad=_0x5243ad-0x0;var _0x1e7635=_0x1fc0[_0x5243ad];return _0x1e7635;};'use strict';var multer=require(_0x01fc('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x01fc('0x1'));var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x01fc('0x2'));var config=require(_0x01fc('0x3'));var controller=require('./intVtigerField.controller');router[_0x01fc('0x4')]('/',auth['isAuthenticated'](),controller[_0x01fc('0x5')]);router[_0x01fc('0x4')]('/:id',auth[_0x01fc('0x6')](),controller[_0x01fc('0x7')]);router['post']('/',auth['isAuthenticated'](),controller[_0x01fc('0x8')]);router[_0x01fc('0x9')](_0x01fc('0xa'),auth[_0x01fc('0x6')](),controller[_0x01fc('0xb')]);router[_0x01fc('0xc')](_0x01fc('0xa'),auth[_0x01fc('0x6')](),controller[_0x01fc('0xd')]);module[_0x01fc('0xe')]=router; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.attributes.js b/server/api/intVtigerField/intVtigerField.attributes.js index 366386a..b14c6da 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 _0xf698=['STRING','BOOLEAN','sequelize','exports','string','variable','keyValue'];(function(_0x35fabd,_0x825452){var _0x61a8ee=function(_0x218f4c){while(--_0x218f4c){_0x35fabd['push'](_0x35fabd['shift']());}};_0x61a8ee(++_0x825452);}(_0xf698,0x1de));var _0x8f69=function(_0x1a0600,_0x41feef){_0x1a0600=_0x1a0600-0x0;var _0x734670=_0xf698[_0x1a0600];return _0x734670;};'use strict';var Sequelize=require(_0x8f69('0x0'));module[_0x8f69('0x1')]={'type':{'type':Sequelize['ENUM'](_0x8f69('0x2'),_0x8f69('0x3'),'customVariable',_0x8f69('0x4')),'defaultValue':_0x8f69('0x2')},'content':{'type':Sequelize[_0x8f69('0x5')]},'key':{'type':Sequelize[_0x8f69('0x5')]},'keyType':{'type':Sequelize['ENUM'](_0x8f69('0x2'),'variable','customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x8f69('0x5')]},'nameField':{'type':Sequelize[_0x8f69('0x5')]},'customField':{'type':Sequelize[_0x8f69('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x8f69('0x5')]}}; \ No newline at end of file +var _0xb88f=['customVariable','keyValue','STRING','variable','BOOLEAN','exports','string'];(function(_0x20752f,_0x16f8d6){var _0x19219e=function(_0x3abeac){while(--_0x3abeac){_0x20752f['push'](_0x20752f['shift']());}};_0x19219e(++_0x16f8d6);}(_0xb88f,0x124));var _0xfb88=function(_0x40ddc0,_0x41c082){_0x40ddc0=_0x40ddc0-0x0;var _0x1aebf1=_0xb88f[_0x40ddc0];return _0x1aebf1;};'use strict';var Sequelize=require('sequelize');module[_0xfb88('0x0')]={'type':{'type':Sequelize['ENUM'](_0xfb88('0x1'),'variable',_0xfb88('0x2'),_0xfb88('0x3')),'defaultValue':_0xfb88('0x1')},'content':{'type':Sequelize[_0xfb88('0x4')]},'key':{'type':Sequelize[_0xfb88('0x4')]},'keyType':{'type':Sequelize['ENUM'](_0xfb88('0x1'),_0xfb88('0x5'),_0xfb88('0x2'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xfb88('0x4')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xfb88('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.controller.js b/server/api/intVtigerField/intVtigerField.controller.js index c2c7ab9..796de26 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 _0xd0bb=['limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','map','type','key','VIRTUAL','field','options','count','includeAll','include','VtigerField','findAll','rows','catch','show','params','rawAttributes','find','create','body','html-pdf','eml-format','rimraf','fast-json-patch','moment','bluebird','util','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset'];(function(_0x9e315e,_0x4a101f){var _0x20a599=function(_0x42d9d8){while(--_0x42d9d8){_0x9e315e['push'](_0x9e315e['shift']());}};_0x20a599(++_0x4a101f);}(_0xd0bb,0x1eb));var _0xbd0b=function(_0x46b057,_0x25aa56){_0x46b057=_0x46b057-0x0;var _0x25cf84=_0xd0bb[_0x46b057];return _0x25cf84;};'use strict';var pdf=require(_0xbd0b('0x0'));var emlformat=require(_0xbd0b('0x1'));var rimraf=require(_0xbd0b('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xbd0b('0x3'));var rp=require('request-promise');var moment=require(_0xbd0b('0x4'));var BPromise=require(_0xbd0b('0x5'));var Mustache=require('mustache');var util=require(_0xbd0b('0x6'));var path=require('path');var sox=require(_0xbd0b('0x7'));var csv=require(_0xbd0b('0x8'));var ejs=require(_0xbd0b('0x9'));var fs=require('fs');var _=require(_0xbd0b('0xa'));var squel=require(_0xbd0b('0xb'));var crypto=require('crypto');var jsforce=require(_0xbd0b('0xc'));var deskjs=require(_0xbd0b('0xd'));var toCsv=require(_0xbd0b('0x8'));var querystring=require(_0xbd0b('0xe'));var Papa=require(_0xbd0b('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xbd0b('0x10'));var as=require(_0xbd0b('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xbd0b('0x12'))(_0xbd0b('0x13'));var utils=require('../../config/utils');var config=require(_0xbd0b('0x14'));var db=require(_0xbd0b('0x15'))['db'];function respondWithStatusCode(_0x3a4b28,_0x315ed9){_0x315ed9=_0x315ed9||0xcc;return function(_0x2621bf){if(_0x2621bf){return _0x3a4b28[_0xbd0b('0x16')](_0x315ed9);}return _0x3a4b28[_0xbd0b('0x17')](_0x315ed9)[_0xbd0b('0x18')]();};}function respondWithResult(_0x1a55ab,_0x1c10c1){_0x1c10c1=_0x1c10c1||0xc8;return function(_0x2d4664){if(_0x2d4664){return _0x1a55ab['status'](_0x1c10c1)[_0xbd0b('0x19')](_0x2d4664);}};}function respondWithFilteredResult(_0x4b113b,_0x4a8014){return function(_0x36d1ca){if(_0x36d1ca){var _0x4c0e52=_0x36d1ca['count'],_0x3183cf=_0x4a8014['offset'],_0x40b075=_0x4a8014[_0xbd0b('0x1a')]+_0x4a8014[_0xbd0b('0x1b')],_0x39b0fe;if(_0x40b075>=_0x4c0e52){_0x40b075=_0x4c0e52;_0x39b0fe=0xc8;}else{_0x39b0fe=0xce;}_0x4b113b[_0xbd0b('0x17')](_0x39b0fe);return _0x4b113b[_0xbd0b('0x1c')](_0xbd0b('0x1d'),_0x3183cf+'-'+_0x40b075+'/'+_0x4c0e52)[_0xbd0b('0x19')](_0x36d1ca);}return null;};}function patchUpdates(_0x5aeb79){return function(_0x1d1292){try{jsonpatch['apply'](_0x1d1292,_0x5aeb79,!![]);}catch(_0x9c2404){return BPromise[_0xbd0b('0x1e')](_0x9c2404);}return _0x1d1292[_0xbd0b('0x1f')]();};}function saveUpdates(_0x3053bb,_0x4b312d){return function(_0x403c91){if(_0x403c91){return _0x403c91[_0xbd0b('0x20')](_0x3053bb)[_0xbd0b('0x21')](function(_0x495d62){return _0x495d62;});}return null;};}function removeEntity(_0x1c5b52,_0x560db4){return function(_0xc66b8){if(_0xc66b8){return _0xc66b8[_0xbd0b('0x22')]()[_0xbd0b('0x21')](function(){_0x1c5b52[_0xbd0b('0x17')](0xcc)[_0xbd0b('0x18')]();});}};}function handleEntityNotFound(_0x539359,_0x75909f){return function(_0x58a721){if(!_0x58a721){_0x539359[_0xbd0b('0x16')](0x194);}return _0x58a721;};}function handleError(_0x18b9dc,_0x4b0924){_0x4b0924=_0x4b0924||0x1f4;return function(_0x3f03b9){logger[_0xbd0b('0x23')](_0x3f03b9[_0xbd0b('0x24')]);if(_0x3f03b9['name']){delete _0x3f03b9[_0xbd0b('0x25')];}_0x18b9dc[_0xbd0b('0x17')](_0x4b0924)[_0xbd0b('0x26')](_0x3f03b9);};}exports[_0xbd0b('0x27')]=function(_0x1129ae,_0x122893){var _0x47f6f5={},_0x149403={},_0x28f1a7={'count':0x0,'rows':[]};var _0x82d326=db['VtigerField']['rawAttributes'];_0x149403[_0xbd0b('0x28')]=_[_0xbd0b('0x29')](_0x82d326);_0x149403[_0xbd0b('0x2a')]=_[_0xbd0b('0x29')](_0x1129ae[_0xbd0b('0x2a')]);_0x149403[_0xbd0b('0x2b')]=_[_0xbd0b('0x2c')](_0x149403['model'],_0x149403[_0xbd0b('0x2a')]);_0x47f6f5[_0xbd0b('0x2d')]=_['intersection'](_0x149403['model'],qs[_0xbd0b('0x2e')](_0x1129ae[_0xbd0b('0x2a')]['fields']));_0x47f6f5[_0xbd0b('0x2d')]=_0x47f6f5[_0xbd0b('0x2d')][_0xbd0b('0x2f')]?_0x47f6f5[_0xbd0b('0x2d')]:_0x149403[_0xbd0b('0x28')];if(!_0x1129ae[_0xbd0b('0x2a')]['hasOwnProperty'](_0xbd0b('0x30'))){_0x47f6f5[_0xbd0b('0x1b')]=qs[_0xbd0b('0x1b')](_0x1129ae[_0xbd0b('0x2a')][_0xbd0b('0x1b')]);_0x47f6f5[_0xbd0b('0x1a')]=qs[_0xbd0b('0x1a')](_0x1129ae[_0xbd0b('0x2a')][_0xbd0b('0x1a')]);}_0x47f6f5[_0xbd0b('0x31')]=qs[_0xbd0b('0x32')](_0x1129ae[_0xbd0b('0x2a')][_0xbd0b('0x32')]);_0x47f6f5[_0xbd0b('0x33')]=qs['filters'](_[_0xbd0b('0x34')](_0x1129ae[_0xbd0b('0x2a')],_0x149403['filters']));if(_0x1129ae[_0xbd0b('0x2a')][_0xbd0b('0x35')]){_0x47f6f5[_0xbd0b('0x33')]=_[_0xbd0b('0x36')](_0x47f6f5[_0xbd0b('0x33')],{'$or':_[_0xbd0b('0x37')](_0x82d326,function(_0x4c8ff5){if(_0x4c8ff5[_0xbd0b('0x38')][_0xbd0b('0x39')]!==_0xbd0b('0x3a')){var _0x2597ab={};_0x2597ab[_0x4c8ff5[_0xbd0b('0x3b')]]={'$like':'%'+_0x1129ae['query']['filter']+'%'};return _0x2597ab;}})});}_0x47f6f5=_[_0xbd0b('0x36')]({},_0x47f6f5,_0x1129ae[_0xbd0b('0x3c')]);var _0x439b9f={'where':_0x47f6f5[_0xbd0b('0x33')]};return db['VtigerField']['count'](_0x439b9f)[_0xbd0b('0x21')](function(_0x4d8237){_0x28f1a7[_0xbd0b('0x3d')]=_0x4d8237;if(_0x1129ae[_0xbd0b('0x2a')][_0xbd0b('0x3e')]){_0x47f6f5[_0xbd0b('0x3f')]=[{'all':!![]}];}return db[_0xbd0b('0x40')][_0xbd0b('0x41')](_0x47f6f5);})[_0xbd0b('0x21')](function(_0x3615c3){_0x28f1a7[_0xbd0b('0x42')]=_0x3615c3;return _0x28f1a7;})[_0xbd0b('0x21')](respondWithFilteredResult(_0x122893,_0x47f6f5))[_0xbd0b('0x43')](handleError(_0x122893,null));};exports[_0xbd0b('0x44')]=function(_0x2a6e4a,_0x425c8a){var _0x11b1a0={'raw':!![],'where':{'id':_0x2a6e4a[_0xbd0b('0x45')]['id']}},_0x18e51a={};_0x18e51a[_0xbd0b('0x28')]=_['keys'](db[_0xbd0b('0x40')][_0xbd0b('0x46')]);_0x18e51a[_0xbd0b('0x2a')]=_[_0xbd0b('0x29')](_0x2a6e4a[_0xbd0b('0x2a')]);_0x18e51a[_0xbd0b('0x2b')]=_[_0xbd0b('0x2c')](_0x18e51a[_0xbd0b('0x28')],_0x18e51a[_0xbd0b('0x2a')]);_0x11b1a0[_0xbd0b('0x2d')]=_[_0xbd0b('0x2c')](_0x18e51a[_0xbd0b('0x28')],qs['fields'](_0x2a6e4a[_0xbd0b('0x2a')]['fields']));_0x11b1a0['attributes']=_0x11b1a0[_0xbd0b('0x2d')][_0xbd0b('0x2f')]?_0x11b1a0[_0xbd0b('0x2d')]:_0x18e51a['model'];if(_0x2a6e4a[_0xbd0b('0x2a')][_0xbd0b('0x3e')]){_0x11b1a0[_0xbd0b('0x3f')]=[{'all':!![]}];}_0x11b1a0=_[_0xbd0b('0x36')]({},_0x11b1a0,_0x2a6e4a[_0xbd0b('0x3c')]);return db['VtigerField'][_0xbd0b('0x47')](_0x11b1a0)[_0xbd0b('0x21')](handleEntityNotFound(_0x425c8a,null))[_0xbd0b('0x21')](respondWithResult(_0x425c8a,null))[_0xbd0b('0x43')](handleError(_0x425c8a,null));};exports[_0xbd0b('0x48')]=function(_0xaaefaa,_0x480c00){return db[_0xbd0b('0x40')][_0xbd0b('0x48')](_0xaaefaa[_0xbd0b('0x49')],{})[_0xbd0b('0x21')](respondWithResult(_0x480c00,0xc9))[_0xbd0b('0x43')](handleError(_0x480c00,null));};exports[_0xbd0b('0x20')]=function(_0x2f468e,_0x563c64){if(_0x2f468e[_0xbd0b('0x49')]['id']){delete _0x2f468e[_0xbd0b('0x49')]['id'];}return db[_0xbd0b('0x40')][_0xbd0b('0x47')]({'where':{'id':_0x2f468e[_0xbd0b('0x45')]['id']}})[_0xbd0b('0x21')](handleEntityNotFound(_0x563c64,null))[_0xbd0b('0x21')](saveUpdates(_0x2f468e[_0xbd0b('0x49')],null))[_0xbd0b('0x21')](respondWithResult(_0x563c64,null))[_0xbd0b('0x43')](handleError(_0x563c64,null));};exports[_0xbd0b('0x22')]=function(_0x2ed890,_0x3cfb52){return db[_0xbd0b('0x40')][_0xbd0b('0x47')]({'where':{'id':_0x2ed890['params']['id']}})[_0xbd0b('0x21')](handleEntityNotFound(_0x3cfb52,null))[_0xbd0b('0x21')](removeEntity(_0x3cfb52,null))['catch'](handleError(_0x3cfb52,null));}; \ No newline at end of file +var _0xb43b=['body','catch','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','ejs','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','offset','limit','Content-Range','reject','save','update','destroy','then','end','error','stack','name','send','index','VtigerField','rawAttributes','model','keys','filters','intersection','query','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','field','options','count','include','findAll','show','params','includeAll','find','create'];(function(_0x249e96,_0x3ea39d){var _0x17444c=function(_0x1221d0){while(--_0x1221d0){_0x249e96['push'](_0x249e96['shift']());}};_0x17444c(++_0x3ea39d);}(_0xb43b,0x1b2));var _0xbb43=function(_0x4081ba,_0x1c0186){_0x4081ba=_0x4081ba-0x0;var _0x14a716=_0xb43b[_0x4081ba];return _0x14a716;};'use strict';var pdf=require(_0xbb43('0x0'));var emlformat=require(_0xbb43('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xbb43('0x2'));var jsonpatch=require(_0xbb43('0x3'));var rp=require(_0xbb43('0x4'));var moment=require('moment');var BPromise=require(_0xbb43('0x5'));var Mustache=require(_0xbb43('0x6'));var util=require(_0xbb43('0x7'));var path=require(_0xbb43('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xbb43('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0xbb43('0xa'));var crypto=require(_0xbb43('0xb'));var jsforce=require(_0xbb43('0xc'));var deskjs=require(_0xbb43('0xd'));var toCsv=require(_0xbb43('0xe'));var querystring=require('querystring');var Papa=require(_0xbb43('0xf'));var Redis=require(_0xbb43('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xbb43('0x11'));var as=require(_0xbb43('0x12'));var hardwareService=require(_0xbb43('0x13'));var logger=require(_0xbb43('0x14'))(_0xbb43('0x15'));var utils=require(_0xbb43('0x16'));var config=require('../../config/environment');var db=require(_0xbb43('0x17'))['db'];function respondWithStatusCode(_0x2a5a4d,_0x50e2c0){_0x50e2c0=_0x50e2c0||0xcc;return function(_0x578392){if(_0x578392){return _0x2a5a4d[_0xbb43('0x18')](_0x50e2c0);}return _0x2a5a4d['status'](_0x50e2c0)['end']();};}function respondWithResult(_0x438591,_0x5a509f){_0x5a509f=_0x5a509f||0xc8;return function(_0x68d45d){if(_0x68d45d){return _0x438591[_0xbb43('0x19')](_0x5a509f)['json'](_0x68d45d);}};}function respondWithFilteredResult(_0x4a6e18,_0x4d5bcf){return function(_0x338120){if(_0x338120){var _0x2abce0=_0x338120['count'],_0x57bd1d=_0x4d5bcf['offset'],_0x526330=_0x4d5bcf[_0xbb43('0x1a')]+_0x4d5bcf[_0xbb43('0x1b')],_0x202980;if(_0x526330>=_0x2abce0){_0x526330=_0x2abce0;_0x202980=0xc8;}else{_0x202980=0xce;}_0x4a6e18[_0xbb43('0x19')](_0x202980);return _0x4a6e18['set'](_0xbb43('0x1c'),_0x57bd1d+'-'+_0x526330+'/'+_0x2abce0)['json'](_0x338120);}return null;};}function patchUpdates(_0x3bb57d){return function(_0x8e6429){try{jsonpatch['apply'](_0x8e6429,_0x3bb57d,!![]);}catch(_0x5d765b){return BPromise[_0xbb43('0x1d')](_0x5d765b);}return _0x8e6429[_0xbb43('0x1e')]();};}function saveUpdates(_0xdb7f2e,_0x2bf2d4){return function(_0x5bcce7){if(_0x5bcce7){return _0x5bcce7[_0xbb43('0x1f')](_0xdb7f2e)['then'](function(_0x3a257d){return _0x3a257d;});}return null;};}function removeEntity(_0x4bfaca,_0x2f5e31){return function(_0x565256){if(_0x565256){return _0x565256[_0xbb43('0x20')]()[_0xbb43('0x21')](function(){_0x4bfaca['status'](0xcc)[_0xbb43('0x22')]();});}};}function handleEntityNotFound(_0x4dfb7f,_0xf24e60){return function(_0x298ce2){if(!_0x298ce2){_0x4dfb7f[_0xbb43('0x18')](0x194);}return _0x298ce2;};}function handleError(_0x4d6d77,_0x53f0d5){_0x53f0d5=_0x53f0d5||0x1f4;return function(_0x59a24d){logger[_0xbb43('0x23')](_0x59a24d[_0xbb43('0x24')]);if(_0x59a24d['name']){delete _0x59a24d[_0xbb43('0x25')];}_0x4d6d77[_0xbb43('0x19')](_0x53f0d5)[_0xbb43('0x26')](_0x59a24d);};}exports[_0xbb43('0x27')]=function(_0x4ed43f,_0x4b5342){var _0x27fd7a={},_0x42800f={},_0xa88db0={'count':0x0,'rows':[]};var _0x8b3205=db[_0xbb43('0x28')][_0xbb43('0x29')];_0x42800f[_0xbb43('0x2a')]=_[_0xbb43('0x2b')](_0x8b3205);_0x42800f['query']=_[_0xbb43('0x2b')](_0x4ed43f['query']);_0x42800f[_0xbb43('0x2c')]=_[_0xbb43('0x2d')](_0x42800f[_0xbb43('0x2a')],_0x42800f[_0xbb43('0x2e')]);_0x27fd7a['attributes']=_[_0xbb43('0x2d')](_0x42800f['model'],qs['fields'](_0x4ed43f['query'][_0xbb43('0x2f')]));_0x27fd7a['attributes']=_0x27fd7a[_0xbb43('0x30')][_0xbb43('0x31')]?_0x27fd7a[_0xbb43('0x30')]:_0x42800f['model'];if(!_0x4ed43f[_0xbb43('0x2e')][_0xbb43('0x32')](_0xbb43('0x33'))){_0x27fd7a[_0xbb43('0x1b')]=qs[_0xbb43('0x1b')](_0x4ed43f[_0xbb43('0x2e')][_0xbb43('0x1b')]);_0x27fd7a[_0xbb43('0x1a')]=qs['offset'](_0x4ed43f[_0xbb43('0x2e')][_0xbb43('0x1a')]);}_0x27fd7a[_0xbb43('0x34')]=qs[_0xbb43('0x35')](_0x4ed43f[_0xbb43('0x2e')][_0xbb43('0x35')]);_0x27fd7a[_0xbb43('0x36')]=qs[_0xbb43('0x2c')](_[_0xbb43('0x37')](_0x4ed43f[_0xbb43('0x2e')],_0x42800f[_0xbb43('0x2c')]));if(_0x4ed43f[_0xbb43('0x2e')][_0xbb43('0x38')]){_0x27fd7a[_0xbb43('0x36')]=_[_0xbb43('0x39')](_0x27fd7a[_0xbb43('0x36')],{'$or':_['map'](_0x8b3205,function(_0x39cbd7){if(_0x39cbd7[_0xbb43('0x3a')]['key']!==_0xbb43('0x3b')){var _0x2c9a7c={};_0x2c9a7c[_0x39cbd7[_0xbb43('0x3c')]]={'$like':'%'+_0x4ed43f['query']['filter']+'%'};return _0x2c9a7c;}})});}_0x27fd7a=_['merge']({},_0x27fd7a,_0x4ed43f[_0xbb43('0x3d')]);var _0x26915a={'where':_0x27fd7a['where']};return db['VtigerField'][_0xbb43('0x3e')](_0x26915a)[_0xbb43('0x21')](function(_0x29f6e5){_0xa88db0[_0xbb43('0x3e')]=_0x29f6e5;if(_0x4ed43f[_0xbb43('0x2e')]['includeAll']){_0x27fd7a[_0xbb43('0x3f')]=[{'all':!![]}];}return db[_0xbb43('0x28')][_0xbb43('0x40')](_0x27fd7a);})[_0xbb43('0x21')](function(_0x22fccc){_0xa88db0['rows']=_0x22fccc;return _0xa88db0;})[_0xbb43('0x21')](respondWithFilteredResult(_0x4b5342,_0x27fd7a))['catch'](handleError(_0x4b5342,null));};exports[_0xbb43('0x41')]=function(_0x93aa1c,_0x56c808){var _0x4783fe={'raw':!![],'where':{'id':_0x93aa1c[_0xbb43('0x42')]['id']}},_0x5e854b={};_0x5e854b[_0xbb43('0x2a')]=_[_0xbb43('0x2b')](db[_0xbb43('0x28')]['rawAttributes']);_0x5e854b[_0xbb43('0x2e')]=_[_0xbb43('0x2b')](_0x93aa1c['query']);_0x5e854b[_0xbb43('0x2c')]=_['intersection'](_0x5e854b[_0xbb43('0x2a')],_0x5e854b[_0xbb43('0x2e')]);_0x4783fe[_0xbb43('0x30')]=_[_0xbb43('0x2d')](_0x5e854b[_0xbb43('0x2a')],qs[_0xbb43('0x2f')](_0x93aa1c['query'][_0xbb43('0x2f')]));_0x4783fe['attributes']=_0x4783fe[_0xbb43('0x30')][_0xbb43('0x31')]?_0x4783fe[_0xbb43('0x30')]:_0x5e854b[_0xbb43('0x2a')];if(_0x93aa1c['query'][_0xbb43('0x43')]){_0x4783fe[_0xbb43('0x3f')]=[{'all':!![]}];}_0x4783fe=_[_0xbb43('0x39')]({},_0x4783fe,_0x93aa1c[_0xbb43('0x3d')]);return db[_0xbb43('0x28')][_0xbb43('0x44')](_0x4783fe)[_0xbb43('0x21')](handleEntityNotFound(_0x56c808,null))[_0xbb43('0x21')](respondWithResult(_0x56c808,null))['catch'](handleError(_0x56c808,null));};exports[_0xbb43('0x45')]=function(_0x8c57af,_0x4898b2){return db[_0xbb43('0x28')]['create'](_0x8c57af['body'],{})['then'](respondWithResult(_0x4898b2,0xc9))['catch'](handleError(_0x4898b2,null));};exports[_0xbb43('0x1f')]=function(_0x5a649b,_0x19c451){if(_0x5a649b['body']['id']){delete _0x5a649b[_0xbb43('0x46')]['id'];}return db[_0xbb43('0x28')][_0xbb43('0x44')]({'where':{'id':_0x5a649b['params']['id']}})[_0xbb43('0x21')](handleEntityNotFound(_0x19c451,null))['then'](saveUpdates(_0x5a649b[_0xbb43('0x46')],null))[_0xbb43('0x21')](respondWithResult(_0x19c451,null))[_0xbb43('0x47')](handleError(_0x19c451,null));};exports[_0xbb43('0x20')]=function(_0x417ad9,_0x13d0a5){return db[_0xbb43('0x28')]['find']({'where':{'id':_0x417ad9[_0xbb43('0x42')]['id']}})[_0xbb43('0x21')](handleEntityNotFound(_0x13d0a5,null))[_0xbb43('0x21')](removeEntity(_0x13d0a5,null))[_0xbb43('0x47')](handleError(_0x13d0a5,null));}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.model.js b/server/api/intVtigerField/intVtigerField.model.js index 49e8d3a..5c523d1 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 _0x9957=['rimraf','./intVtigerField.attributes','exports','define','VtigerField','vtiger_unique_index','idField','lodash','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0x1da04e,_0x31024b){var _0xdd8c41=function(_0x2036f9){while(--_0x2036f9){_0x1da04e['push'](_0x1da04e['shift']());}};_0xdd8c41(++_0x31024b);}(_0x9957,0x93));var _0x7995=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9957[_0x3947c9];return _0x2e7871;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'int_vtiger_fields','paranoid':![],'indexes':[{'name':_0x7995('0xc'),'fields':[_0x7995('0xd'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x9957=['rimraf','./intVtigerField.attributes','exports','define','VtigerField','vtiger_unique_index','idField','lodash','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0xaa0309,_0x1c8008){var _0x5de7ce=function(_0x3aa6ae){while(--_0x3aa6ae){_0xaa0309['push'](_0xaa0309['shift']());}};_0x5de7ce(++_0x1c8008);}(_0x9957,0x93));var _0x7995=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9957[_0x1ac595];return _0x455fff;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'int_vtiger_fields','paranoid':![],'indexes':[{'name':_0x7995('0xc'),'fields':[_0x7995('0xd'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.rpc.js b/server/api/intVtigerField/intVtigerField.rpc.js index 9386908..8683de5 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 _0xc7ea=['result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VtigerField,\x20%s,\x20%s','request\x20sent','debug','VtigerField,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0x2c7377,_0x32ade5){var _0x35e181=function(_0x1be1e6){while(--_0x1be1e6){_0x2c7377['push'](_0x2c7377['shift']());}};_0x35e181(++_0x32ade5);}(_0xc7ea,0x171));var _0xac7e=function(_0x243394,_0x1437c1){_0x243394=_0x243394-0x0;var _0x3c2306=_0xc7ea[_0x243394];return _0x3c2306;};'use strict';var _=require(_0xac7e('0x0'));var util=require(_0xac7e('0x1'));var moment=require('moment');var BPromise=require(_0xac7e('0x2'));var rs=require(_0xac7e('0x3'));var fs=require('fs');var Redis=require(_0xac7e('0x4'));var db=require(_0xac7e('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xac7e('0x6'))(_0xac7e('0x7'));var config=require(_0xac7e('0x8'));var jayson=require(_0xac7e('0x9'));var client=jayson[_0xac7e('0xa')][_0xac7e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x447bfe,_0x1aca29,_0x1612f3){return new BPromise(function(_0x1cb874,_0x4d83fb){return client[_0xac7e('0xc')](_0x447bfe,_0x1612f3)[_0xac7e('0xd')](function(_0x2efbf4){logger[_0xac7e('0xe')](_0xac7e('0xf'),_0x1aca29,_0xac7e('0x10'));logger[_0xac7e('0x11')](_0xac7e('0x12'),_0x1aca29,_0xac7e('0x10'),JSON[_0xac7e('0x13')](_0x2efbf4));if(_0x2efbf4[_0xac7e('0x14')]){if(_0x2efbf4[_0xac7e('0x14')]['code']===0x1f4){logger[_0xac7e('0x14')](_0xac7e('0xf'),_0x1aca29,_0x2efbf4['error'][_0xac7e('0x15')]);return _0x4d83fb(_0x2efbf4[_0xac7e('0x14')][_0xac7e('0x15')]);}logger[_0xac7e('0x14')](_0xac7e('0xf'),_0x1aca29,_0x2efbf4['error'][_0xac7e('0x15')]);return _0x1cb874(_0x2efbf4[_0xac7e('0x14')][_0xac7e('0x15')]);}else{logger[_0xac7e('0xe')](_0xac7e('0xf'),_0x1aca29,_0xac7e('0x10'));_0x1cb874(_0x2efbf4[_0xac7e('0x16')][_0xac7e('0x15')]);}})['catch'](function(_0x3f4869){logger[_0xac7e('0x14')](_0xac7e('0xf'),_0x1aca29,_0x3f4869);_0x4d83fb(_0x3f4869);});});} \ No newline at end of file +var _0xa699=['request','then','info','VtigerField,\x20%s,\x20%s','VtigerField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x5c530a,_0x551672){var _0x68b556=function(_0xf2db49){while(--_0xf2db49){_0x5c530a['push'](_0x5c530a['shift']());}};_0x68b556(++_0x551672);}(_0xa699,0x6b));var _0x9a69=function(_0x44d869,_0x49425f){_0x44d869=_0x44d869-0x0;var _0x1ed521=_0xa699[_0x44d869];return _0x1ed521;};'use strict';var _=require(_0x9a69('0x0'));var util=require(_0x9a69('0x1'));var moment=require(_0x9a69('0x2'));var BPromise=require(_0x9a69('0x3'));var rs=require(_0x9a69('0x4'));var fs=require('fs');var Redis=require(_0x9a69('0x5'));var db=require(_0x9a69('0x6'))['db'];var utils=require(_0x9a69('0x7'));var logger=require(_0x9a69('0x8'))(_0x9a69('0x9'));var config=require(_0x9a69('0xa'));var jayson=require(_0x9a69('0xb'));var client=jayson[_0x9a69('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x26b842,_0x3f9bce,_0x3bb021){return new BPromise(function(_0x4665a9,_0x5031b0){return client[_0x9a69('0xd')](_0x26b842,_0x3bb021)[_0x9a69('0xe')](function(_0x3fb953){logger[_0x9a69('0xf')](_0x9a69('0x10'),_0x3f9bce,'request\x20sent');logger['debug'](_0x9a69('0x11'),_0x3f9bce,'request\x20sent',JSON[_0x9a69('0x12')](_0x3fb953));if(_0x3fb953[_0x9a69('0x13')]){if(_0x3fb953['error'][_0x9a69('0x14')]===0x1f4){logger[_0x9a69('0x13')]('VtigerField,\x20%s,\x20%s',_0x3f9bce,_0x3fb953[_0x9a69('0x13')][_0x9a69('0x15')]);return _0x5031b0(_0x3fb953[_0x9a69('0x13')][_0x9a69('0x15')]);}logger[_0x9a69('0x13')](_0x9a69('0x10'),_0x3f9bce,_0x3fb953[_0x9a69('0x13')][_0x9a69('0x15')]);return _0x4665a9(_0x3fb953[_0x9a69('0x13')]['message']);}else{logger[_0x9a69('0xf')](_0x9a69('0x10'),_0x3f9bce,_0x9a69('0x16'));_0x4665a9(_0x3fb953['result'][_0x9a69('0x15')]);}})[_0x9a69('0x17')](function(_0x380e46){logger[_0x9a69('0x13')](_0x9a69('0x10'),_0x3f9bce,_0x380e46);_0x5031b0(_0x380e46);});});} \ No newline at end of file diff --git a/server/api/intZendeskAccount/index.js b/server/api/intZendeskAccount/index.js index 076f2ba..6e58c45 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 _0x98e6=['create','/:id/configurations','addConfiguration','put','update','delete','destroy','multer','path','express','Router','../../components/interaction/service','../../config/environment','./intZendeskAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post'];(function(_0x513aa5,_0x1fba79){var _0x1a1a7c=function(_0x240e3f){while(--_0x240e3f){_0x513aa5['push'](_0x513aa5['shift']());}};_0x1a1a7c(++_0x1fba79);}(_0x98e6,0x91));var _0x698e=function(_0x590985,_0x3a1e02){_0x590985=_0x590985-0x0;var _0x2d8d61=_0x98e6[_0x590985];return _0x2d8d61;};'use strict';var multer=require(_0x698e('0x0'));var util=require('util');var path=require(_0x698e('0x1'));var timeout=require('connect-timeout');var express=require(_0x698e('0x2'));var router=express[_0x698e('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x698e('0x4'));var config=require(_0x698e('0x5'));var controller=require(_0x698e('0x6'));router[_0x698e('0x7')]('/',auth[_0x698e('0x8')](),controller[_0x698e('0x9')]);router[_0x698e('0x7')](_0x698e('0xa'),auth[_0x698e('0x8')](),controller[_0x698e('0xb')]);router[_0x698e('0x7')]('/:id/configurations',auth[_0x698e('0x8')](),controller[_0x698e('0xc')]);router[_0x698e('0x7')](_0x698e('0xd'),auth['isAuthenticated'](),controller[_0x698e('0xe')]);router[_0x698e('0xf')]('/',auth[_0x698e('0x8')](),controller[_0x698e('0x10')]);router[_0x698e('0xf')](_0x698e('0x11'),auth[_0x698e('0x8')](),controller[_0x698e('0x12')]);router[_0x698e('0x13')]('/:id',auth[_0x698e('0x8')](),controller[_0x698e('0x14')]);router[_0x698e('0x15')](_0x698e('0xa'),auth[_0x698e('0x8')](),controller[_0x698e('0x16')]);module['exports']=router; \ No newline at end of file +var _0xa9d2=['connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskAccount.controller','get','/:id','/:id/configurations','isAuthenticated','getConfigurations','/:id/fields','post','create','addConfiguration','put','delete','destroy','exports','multer','util','path'];(function(_0x3054be,_0x1bdc8b){var _0x3df150=function(_0x56cfbf){while(--_0x56cfbf){_0x3054be['push'](_0x3054be['shift']());}};_0x3df150(++_0x1bdc8b);}(_0xa9d2,0xc3));var _0x2a9d=function(_0x3402ad,_0x261843){_0x3402ad=_0x3402ad-0x0;var _0x3aacb4=_0xa9d2[_0x3402ad];return _0x3aacb4;};'use strict';var multer=require(_0x2a9d('0x0'));var util=require(_0x2a9d('0x1'));var path=require(_0x2a9d('0x2'));var timeout=require(_0x2a9d('0x3'));var express=require(_0x2a9d('0x4'));var router=express['Router']();var auth=require(_0x2a9d('0x5'));var interaction=require(_0x2a9d('0x6'));var config=require(_0x2a9d('0x7'));var controller=require(_0x2a9d('0x8'));router[_0x2a9d('0x9')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x2a9d('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x2a9d('0x9')](_0x2a9d('0xb'),auth[_0x2a9d('0xc')](),controller[_0x2a9d('0xd')]);router[_0x2a9d('0x9')](_0x2a9d('0xe'),auth['isAuthenticated'](),controller['getFields']);router[_0x2a9d('0xf')]('/',auth[_0x2a9d('0xc')](),controller[_0x2a9d('0x10')]);router['post'](_0x2a9d('0xb'),auth[_0x2a9d('0xc')](),controller[_0x2a9d('0x11')]);router[_0x2a9d('0x12')]('/:id',auth[_0x2a9d('0xc')](),controller['update']);router[_0x2a9d('0x13')](_0x2a9d('0xa'),auth['isAuthenticated'](),controller[_0x2a9d('0x14')]);module[_0x2a9d('0x15')]=router; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.attributes.js b/server/api/intZendeskAccount/intZendeskAccount.attributes.js index b59c366..ad140e6 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 _0x5d4e=['username','remoteUri','ENUM','password','token','integrationTab','newTab','sequelize','exports','STRING'];(function(_0x5d6026,_0xe31b13){var _0x88540a=function(_0x3fe8ed){while(--_0x3fe8ed){_0x5d6026['push'](_0x5d6026['shift']());}};_0x88540a(++_0xe31b13);}(_0x5d4e,0x1dd));var _0xe5d4=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x5d4e[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0xe5d4('0x0'));module[_0xe5d4('0x1')]={'name':{'type':Sequelize[_0xe5d4('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xe5d4('0x2')],'unique':_0xe5d4('0x3')},'password':{'type':Sequelize[_0xe5d4('0x2')]},'token':{'type':Sequelize[_0xe5d4('0x2')]},'remoteUri':{'type':Sequelize[_0xe5d4('0x2')],'unique':_0xe5d4('0x4')},'authType':{'type':Sequelize[_0xe5d4('0x5')](_0xe5d4('0x6'),_0xe5d4('0x7')),'defaultValue':_0xe5d4('0x6')},'serverUrl':{'type':Sequelize[_0xe5d4('0x2')]},'type':{'type':Sequelize[_0xe5d4('0x5')](_0xe5d4('0x8'),_0xe5d4('0x9')),'defaultValue':_0xe5d4('0x8')}}; \ No newline at end of file +var _0xb481=['ENUM','password','token','integrationTab','newTab','sequelize','STRING','username','remoteUri'];(function(_0x7ed1f,_0xe724d3){var _0x58d101=function(_0x5ea6eb){while(--_0x5ea6eb){_0x7ed1f['push'](_0x7ed1f['shift']());}};_0x58d101(++_0xe724d3);}(_0xb481,0x1d0));var _0x1b48=function(_0x2b8077,_0x453634){_0x2b8077=_0x2b8077-0x0;var _0x308091=_0xb481[_0x2b8077];return _0x308091;};'use strict';var Sequelize=require(_0x1b48('0x0'));module['exports']={'name':{'type':Sequelize[_0x1b48('0x1')]},'description':{'type':Sequelize[_0x1b48('0x1')]},'username':{'type':Sequelize[_0x1b48('0x1')],'unique':_0x1b48('0x2')},'password':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0x1b48('0x1')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0x1b48('0x3')},'authType':{'type':Sequelize[_0x1b48('0x4')](_0x1b48('0x5'),_0x1b48('0x6')),'defaultValue':_0x1b48('0x5')},'serverUrl':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x1b48('0x4')](_0x1b48('0x7'),_0x1b48('0x8')),'defaultValue':'integrationTab'}}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.controller.js b/server/api/intZendeskAccount/intZendeskAccount.controller.js index a069396..98a3931 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 _0xeca7=['path','to-csv','ejs','lodash','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','../../components/integrations/configuration','http','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','info','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','ZendeskAccount,\x20%s,\x20%s','message','result','sendStatus','status','end','json','count','offset','limit','set','Content-Range','reject','save','update','destroy','stack','name','index','ZendeskAccount','rawAttributes','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','map','type','key','VIRTUAL','field','options','includeAll','include','rows','params','find','catch','create','body','getConfigurations','addConfiguration','Subjects','getSubjects','channel','Descriptions','getDescriptions','ZendeskConfiguration','ZendeskField','getFields','findOne','username','token','authType','remoteUri','slice','lastIndexOf','format','%s/%s','ticket_fields','%s:%s','password','toString','base64','headers','Basic\x20%s','Sequelize','ValidationError','Unknown\x20authentication\x20type','subject','description','group','assignee','remove','includes','position','title','system_field_options','custom_field_options','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','send','html-pdf','rimraf','zip-dir','fast-json-patch','moment','util'];(function(_0xb05c9e,_0x47ca14){var _0x228935=function(_0x3ad892){while(--_0x3ad892){_0xb05c9e['push'](_0xb05c9e['shift']());}};_0x228935(++_0x47ca14);}(_0xeca7,0xf4));var _0x7eca=function(_0x1a4748,_0x40c46e){_0x1a4748=_0x1a4748-0x0;var _0x28ca99=_0xeca7[_0x1a4748];return _0x28ca99;};'use strict';var pdf=require(_0x7eca('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x7eca('0x1'));var zipdir=require(_0x7eca('0x2'));var jsonpatch=require(_0x7eca('0x3'));var rp=require('request-promise');var moment=require(_0x7eca('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x7eca('0x5'));var path=require(_0x7eca('0x6'));var sox=require('sox');var csv=require(_0x7eca('0x7'));var ejs=require(_0x7eca('0x8'));var fs=require('fs');var _=require(_0x7eca('0x9'));var squel=require(_0x7eca('0xa'));var crypto=require(_0x7eca('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x7eca('0x7'));var querystring=require(_0x7eca('0xc'));var Papa=require(_0x7eca('0xd'));var Redis=require('ioredis');var authService=require(_0x7eca('0xe'));var qs=require(_0x7eca('0xf'));var as=require(_0x7eca('0x10'));var hardwareService=require(_0x7eca('0x11'));var logger=require(_0x7eca('0x12'))('api');var utils=require(_0x7eca('0x13'));var config=require('../../config/environment');var db=require(_0x7eca('0x14'))['db'];var integrations=require(_0x7eca('0x15'));var jayson=require('jayson/promise');var client=jayson['client'][_0x7eca('0x16')]({'port':0x232a});function checkPasswordPattern(_0x56bf16,_0x351350,_0x359c6e){if(_0x359c6e){var _0x5a10ef=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x5a10ef['test'](_0x351350)){return _0x56bf16;}else{throw new Error(_0x7eca('0x17'));}}else{return _0x56bf16;}}function respondWithRpcPromise(_0x33069c,_0x5d58aa,_0x25b177,_0x29f9fe){return new BPromise(function(_0x51a391,_0x5d6758){var _0x411959=_0x29f9fe||client;return _0x411959['request'](_0x33069c,_0x25b177)[_0x7eca('0x18')](function(_0x533afd){logger[_0x7eca('0x19')]('ZendeskAccount,\x20%s,\x20%s',_0x5d58aa,_0x7eca('0x1a'));logger[_0x7eca('0x1b')](_0x7eca('0x1c'),_0x5d58aa,_0x7eca('0x1a'),JSON[_0x7eca('0x1d')](_0x533afd));if(_0x533afd[_0x7eca('0x1e')]){if(_0x533afd[_0x7eca('0x1e')][_0x7eca('0x1f')]===0x1f4){logger[_0x7eca('0x1e')](_0x7eca('0x20'),_0x5d58aa,_0x533afd[_0x7eca('0x1e')][_0x7eca('0x21')]);return _0x5d6758(_0x533afd['error'][_0x7eca('0x21')]);}logger[_0x7eca('0x1e')](_0x7eca('0x20'),_0x5d58aa,_0x533afd[_0x7eca('0x1e')]['message']);return _0x51a391(_0x533afd[_0x7eca('0x1e')][_0x7eca('0x21')]);}else{logger['info']('ZendeskAccount,\x20%s,\x20%s',_0x5d58aa,_0x7eca('0x1a'));_0x51a391(_0x533afd[_0x7eca('0x22')][_0x7eca('0x21')]);}})['catch'](function(_0x5ddea1){logger[_0x7eca('0x1e')](_0x7eca('0x20'),_0x5d58aa,_0x5ddea1);_0x5d6758(_0x5ddea1);});});}function respondWithStatusCode(_0x39925f,_0x4838db){_0x4838db=_0x4838db||0xcc;return function(_0x1cb1e5){if(_0x1cb1e5){return _0x39925f[_0x7eca('0x23')](_0x4838db);}return _0x39925f[_0x7eca('0x24')](_0x4838db)[_0x7eca('0x25')]();};}function respondWithResult(_0x26ba96,_0x175206){_0x175206=_0x175206||0xc8;return function(_0x3cfda2){if(_0x3cfda2){return _0x26ba96[_0x7eca('0x24')](_0x175206)[_0x7eca('0x26')](_0x3cfda2);}};}function respondWithFilteredResult(_0x5312f8,_0x30424c){return function(_0x4553c8){if(_0x4553c8){var _0x298036=_0x4553c8[_0x7eca('0x27')],_0x2ecd67=_0x30424c[_0x7eca('0x28')],_0x5798ee=_0x30424c[_0x7eca('0x28')]+_0x30424c[_0x7eca('0x29')],_0x5eb29f;if(_0x5798ee>=_0x298036){_0x5798ee=_0x298036;_0x5eb29f=0xc8;}else{_0x5eb29f=0xce;}_0x5312f8[_0x7eca('0x24')](_0x5eb29f);return _0x5312f8[_0x7eca('0x2a')](_0x7eca('0x2b'),_0x2ecd67+'-'+_0x5798ee+'/'+_0x298036)[_0x7eca('0x26')](_0x4553c8);}return null;};}function patchUpdates(_0x367c1c){return function(_0x54d411){try{jsonpatch['apply'](_0x54d411,_0x367c1c,!![]);}catch(_0x116956){return BPromise[_0x7eca('0x2c')](_0x116956);}return _0x54d411[_0x7eca('0x2d')]();};}function saveUpdates(_0x10c353,_0x3e7cc0){return function(_0xbe0968){if(_0xbe0968){return _0xbe0968[_0x7eca('0x2e')](_0x10c353)[_0x7eca('0x18')](function(_0x584e60){return _0x584e60;});}return null;};}function removeEntity(_0x3a3fcf,_0x4530fa){return function(_0x29dac6){if(_0x29dac6){return _0x29dac6[_0x7eca('0x2f')]()['then'](function(){_0x3a3fcf[_0x7eca('0x24')](0xcc)[_0x7eca('0x25')]();});}};}function handleEntityNotFound(_0x59e2d0,_0x2975f4){return function(_0x45e4ac){if(!_0x45e4ac){_0x59e2d0[_0x7eca('0x23')](0x194);}return _0x45e4ac;};}function handleError(_0x36aa33,_0x2ab0aa){_0x2ab0aa=_0x2ab0aa||0x1f4;return function(_0x4dc28c){logger[_0x7eca('0x1e')](_0x4dc28c[_0x7eca('0x30')]);if(_0x4dc28c['name']){delete _0x4dc28c[_0x7eca('0x31')];}_0x36aa33['status'](_0x2ab0aa)['send'](_0x4dc28c);};}exports[_0x7eca('0x32')]=function(_0x24948c,_0x299c26){var _0x3d1dbb={},_0x324bde={},_0x35a055={'count':0x0,'rows':[]};var _0x5730cd=db[_0x7eca('0x33')][_0x7eca('0x34')];_0x324bde[_0x7eca('0x35')]=_[_0x7eca('0x36')](_0x5730cd);_0x324bde[_0x7eca('0x37')]=_['keys'](_0x24948c[_0x7eca('0x37')]);_0x324bde['filters']=_[_0x7eca('0x38')](_0x324bde[_0x7eca('0x35')],_0x324bde[_0x7eca('0x37')]);_0x3d1dbb[_0x7eca('0x39')]=_[_0x7eca('0x38')](_0x324bde['model'],qs[_0x7eca('0x3a')](_0x24948c[_0x7eca('0x37')]['fields']));_0x3d1dbb[_0x7eca('0x39')]=_0x3d1dbb['attributes'][_0x7eca('0x3b')]?_0x3d1dbb[_0x7eca('0x39')]:_0x324bde[_0x7eca('0x35')];if(!_0x24948c[_0x7eca('0x37')][_0x7eca('0x3c')](_0x7eca('0x3d'))){_0x3d1dbb[_0x7eca('0x29')]=qs[_0x7eca('0x29')](_0x24948c[_0x7eca('0x37')][_0x7eca('0x29')]);_0x3d1dbb[_0x7eca('0x28')]=qs[_0x7eca('0x28')](_0x24948c[_0x7eca('0x37')]['offset']);}_0x3d1dbb['order']=qs[_0x7eca('0x3e')](_0x24948c[_0x7eca('0x37')][_0x7eca('0x3e')]);_0x3d1dbb[_0x7eca('0x3f')]=qs[_0x7eca('0x40')](_[_0x7eca('0x41')](_0x24948c[_0x7eca('0x37')],_0x324bde[_0x7eca('0x40')]));if(_0x24948c[_0x7eca('0x37')][_0x7eca('0x42')]){_0x3d1dbb[_0x7eca('0x3f')]=_[_0x7eca('0x43')](_0x3d1dbb[_0x7eca('0x3f')],{'$or':_[_0x7eca('0x44')](_0x5730cd,function(_0x53d61d){if(_0x53d61d[_0x7eca('0x45')][_0x7eca('0x46')]!==_0x7eca('0x47')){var _0x2c4812={};_0x2c4812[_0x53d61d[_0x7eca('0x48')]]={'$like':'%'+_0x24948c[_0x7eca('0x37')]['filter']+'%'};return _0x2c4812;}})});}_0x3d1dbb=_[_0x7eca('0x43')]({},_0x3d1dbb,_0x24948c[_0x7eca('0x49')]);var _0x2dbabd={'where':_0x3d1dbb[_0x7eca('0x3f')]};return db[_0x7eca('0x33')][_0x7eca('0x27')](_0x2dbabd)[_0x7eca('0x18')](function(_0x577133){_0x35a055[_0x7eca('0x27')]=_0x577133;if(_0x24948c['query'][_0x7eca('0x4a')]){_0x3d1dbb[_0x7eca('0x4b')]=[{'all':!![]}];}return db[_0x7eca('0x33')]['findAll'](_0x3d1dbb);})['then'](function(_0x236982){_0x35a055[_0x7eca('0x4c')]=_0x236982;return _0x35a055;})[_0x7eca('0x18')](respondWithFilteredResult(_0x299c26,_0x3d1dbb))['catch'](handleError(_0x299c26,null));};exports['show']=function(_0x465fbf,_0x1d17f2){var _0x515a63={'raw':![],'where':{'id':_0x465fbf[_0x7eca('0x4d')]['id']}},_0x32867a={};_0x32867a[_0x7eca('0x35')]=_[_0x7eca('0x36')](db['ZendeskAccount'][_0x7eca('0x34')]);_0x32867a[_0x7eca('0x37')]=_[_0x7eca('0x36')](_0x465fbf['query']);_0x32867a[_0x7eca('0x40')]=_[_0x7eca('0x38')](_0x32867a['model'],_0x32867a[_0x7eca('0x37')]);_0x515a63[_0x7eca('0x39')]=_[_0x7eca('0x38')](_0x32867a[_0x7eca('0x35')],qs[_0x7eca('0x3a')](_0x465fbf[_0x7eca('0x37')][_0x7eca('0x3a')]));_0x515a63[_0x7eca('0x39')]=_0x515a63[_0x7eca('0x39')][_0x7eca('0x3b')]?_0x515a63[_0x7eca('0x39')]:_0x32867a[_0x7eca('0x35')];if(_0x465fbf['query'][_0x7eca('0x4a')]){_0x515a63['include']=[{'all':!![]}];}_0x515a63=_[_0x7eca('0x43')]({},_0x515a63,_0x465fbf[_0x7eca('0x49')]);return db[_0x7eca('0x33')][_0x7eca('0x4e')](_0x515a63)[_0x7eca('0x18')](handleEntityNotFound(_0x1d17f2,null))[_0x7eca('0x18')](respondWithResult(_0x1d17f2,null))[_0x7eca('0x4f')](handleError(_0x1d17f2,null));};exports[_0x7eca('0x50')]=function(_0x3e831e,_0xeece09){return db['ZendeskAccount'][_0x7eca('0x50')](_0x3e831e[_0x7eca('0x51')],{})[_0x7eca('0x18')](respondWithResult(_0xeece09,0xc9))[_0x7eca('0x4f')](handleError(_0xeece09,null));};exports[_0x7eca('0x2e')]=function(_0x282226,_0x5b3476){if(_0x282226['body']['id']){delete _0x282226[_0x7eca('0x51')]['id'];}return db[_0x7eca('0x33')][_0x7eca('0x4e')]({'where':{'id':_0x282226[_0x7eca('0x4d')]['id']}})[_0x7eca('0x18')](handleEntityNotFound(_0x5b3476,null))[_0x7eca('0x18')](saveUpdates(_0x282226[_0x7eca('0x51')],null))[_0x7eca('0x18')](respondWithResult(_0x5b3476,null))[_0x7eca('0x4f')](handleError(_0x5b3476,null));};exports[_0x7eca('0x2f')]=function(_0x6fed0a,_0x482ceb){return db['ZendeskAccount'][_0x7eca('0x4e')]({'where':{'id':_0x6fed0a[_0x7eca('0x4d')]['id']}})['then'](handleEntityNotFound(_0x482ceb,null))[_0x7eca('0x18')](removeEntity(_0x482ceb,null))[_0x7eca('0x4f')](handleError(_0x482ceb,null));};exports['getConfigurations']=function(_0x4c53c5,_0x967f0c,_0xfed13f){var _0x51fbdc={};var _0x30f8e6={};var _0x47031f;var _0x171030;return db[_0x7eca('0x33')]['findOne']({'where':{'id':_0x4c53c5[_0x7eca('0x4d')]['id']}})[_0x7eca('0x18')](handleEntityNotFound(_0x967f0c,null))[_0x7eca('0x18')](function(_0x440bca){if(_0x440bca){_0x47031f=_0x440bca;_0x30f8e6[_0x7eca('0x35')]=_['keys'](db['ZendeskConfiguration']['rawAttributes']);_0x30f8e6[_0x7eca('0x37')]=_['keys'](_0x4c53c5['query']);_0x30f8e6['filters']=_['intersection'](_0x30f8e6[_0x7eca('0x35')],_0x30f8e6[_0x7eca('0x37')]);_0x51fbdc['attributes']=_['intersection'](_0x30f8e6[_0x7eca('0x35')],qs[_0x7eca('0x3a')](_0x4c53c5[_0x7eca('0x37')][_0x7eca('0x3a')]));_0x51fbdc[_0x7eca('0x39')]=_0x51fbdc['attributes'][_0x7eca('0x3b')]?_0x51fbdc['attributes']:_0x30f8e6[_0x7eca('0x35')];_0x51fbdc['order']=qs['sort'](_0x4c53c5[_0x7eca('0x37')][_0x7eca('0x3e')]);_0x51fbdc['where']=qs[_0x7eca('0x40')](_[_0x7eca('0x41')](_0x4c53c5[_0x7eca('0x37')],_0x30f8e6[_0x7eca('0x40')]));if(_0x4c53c5['query']['filter']){_0x51fbdc[_0x7eca('0x3f')]=_['merge'](_0x51fbdc[_0x7eca('0x3f')],{'$or':_[_0x7eca('0x44')](_0x51fbdc[_0x7eca('0x39')],function(_0x14d229){var _0x2ca96e={};_0x2ca96e[_0x14d229]={'$like':'%'+_0x4c53c5[_0x7eca('0x37')]['filter']+'%'};return _0x2ca96e;})});}_0x51fbdc=_['merge']({},_0x51fbdc,_0x4c53c5['options']);return _0x47031f[_0x7eca('0x52')](_0x51fbdc);}})[_0x7eca('0x18')](function(_0x38a1ee){if(_0x38a1ee){_0x171030=_0x38a1ee['length'];if(!_0x4c53c5[_0x7eca('0x37')]['hasOwnProperty'](_0x7eca('0x3d'))){_0x51fbdc['limit']=qs[_0x7eca('0x29')](_0x4c53c5[_0x7eca('0x37')][_0x7eca('0x29')]);_0x51fbdc[_0x7eca('0x28')]=qs['offset'](_0x4c53c5[_0x7eca('0x37')]['offset']);}return _0x47031f[_0x7eca('0x52')](_0x51fbdc);}})['then'](function(_0x4a0e34){if(_0x4a0e34){return _0x4a0e34?{'count':_0x171030,'rows':_0x4a0e34}:null;}})['then'](respondWithResult(_0x967f0c,null))[_0x7eca('0x4f')](handleError(_0x967f0c,null));};exports[_0x7eca('0x53')]=function(_0x2ca0a9,_0x30d2db,_0x19e1b7){if(_0x2ca0a9[_0x7eca('0x51')]['id']){delete _0x2ca0a9['body']['id'];}return db[_0x7eca('0x33')]['findOne']({'where':{'id':_0x2ca0a9[_0x7eca('0x4d')]['id']}})[_0x7eca('0x18')](handleEntityNotFound(_0x30d2db,null))[_0x7eca('0x18')](function(_0x581ad7){if(_0x581ad7){_0x2ca0a9[_0x7eca('0x51')]['AccountId']=_0x581ad7['id'];_0x2ca0a9[_0x7eca('0x51')][_0x7eca('0x54')]=integrations[_0x7eca('0x55')](_0x2ca0a9[_0x7eca('0x51')][_0x7eca('0x56')],_0x2ca0a9['body'][_0x7eca('0x45')]);_0x2ca0a9[_0x7eca('0x51')][_0x7eca('0x57')]=integrations[_0x7eca('0x58')](_0x2ca0a9[_0x7eca('0x51')][_0x7eca('0x56')],_0x2ca0a9['body']['type']);return db[_0x7eca('0x59')]['create'](_0x2ca0a9['body'],{'include':[{'model':db[_0x7eca('0x5a')],'as':_0x7eca('0x54')},{'model':db[_0x7eca('0x5a')],'as':_0x7eca('0x57')}]});}return null;})[_0x7eca('0x18')](respondWithResult(_0x30d2db,null))[_0x7eca('0x4f')](handleError(_0x30d2db,null));};exports[_0x7eca('0x5b')]=function(_0x166d38,_0x14490f,_0x19b9e4){var _0x4eb7fb='';return db['ZendeskAccount'][_0x7eca('0x5c')]({'where':{'id':_0x166d38[_0x7eca('0x4d')]['id']},'attributes':['id',_0x7eca('0x5d'),'password',_0x7eca('0x5e'),_0x7eca('0x5f'),_0x7eca('0x60')]})[_0x7eca('0x18')](handleEntityNotFound(_0x14490f,null))[_0x7eca('0x18')](function(_0x146b98){if(_0x146b98){_0x4eb7fb=_0x146b98[_0x7eca('0x60')];var _0x38a1e4=_0x4eb7fb[_0x7eca('0x61')](-0x1);if(_0x38a1e4==='/'){_0x4eb7fb=_0x4eb7fb['substring'](0x0,_0x4eb7fb[_0x7eca('0x62')](_0x38a1e4));}var _0x24ba95={'method':'GET','uri':util[_0x7eca('0x63')](_0x7eca('0x64'),_0x4eb7fb,_0x7eca('0x65')),'json':!![]};switch(_0x146b98[_0x7eca('0x5f')]){case'password':_0x24ba95['headers']={'Authorization':util[_0x7eca('0x63')]('Basic\x20%s',new Buffer(util[_0x7eca('0x63')](_0x7eca('0x66'),_0x146b98[_0x7eca('0x5d')],_0x146b98[_0x7eca('0x67')]))[_0x7eca('0x68')](_0x7eca('0x69')))};break;case _0x7eca('0x5e'):_0x24ba95[_0x7eca('0x6a')]={'Authorization':util[_0x7eca('0x63')](_0x7eca('0x6b'),new Buffer(util[_0x7eca('0x63')]('%s/token:%s',_0x146b98[_0x7eca('0x5d')],_0x146b98[_0x7eca('0x5e')]))[_0x7eca('0x68')](_0x7eca('0x69')))};break;default:throw new db[(_0x7eca('0x6c'))][(_0x7eca('0x6d'))](_0x7eca('0x6e'));}return rp(_0x24ba95);}})['then'](function(_0x2f0283){if(_0x2f0283){var _0x90d200=[_0x7eca('0x6f'),_0x7eca('0x70'),_0x7eca('0x71'),_0x7eca('0x72')];_[_0x7eca('0x73')](_0x2f0283['ticket_fields'],function(_0x97c1e0){return _0x90d200[_0x7eca('0x74')](_0x97c1e0['type']);});return{'count':_0x2f0283[_0x7eca('0x65')]['length'],'rows':_[_0x7eca('0x44')](_0x2f0283[_0x7eca('0x65')],function(_0x3c9548){return{'id':_0x3c9548['id'],'name':_0x3c9548[_0x7eca('0x75')]>0x7?_0x3c9548[_0x7eca('0x76')]:_0x3c9548[_0x7eca('0x45')],'custom':_0x3c9548[_0x7eca('0x75')]>0x7?!![]:![],'options':_0x3c9548[_0x7eca('0x77')]?_0x3c9548[_0x7eca('0x77')]:_0x3c9548['custom_field_options']?_0x3c9548[_0x7eca('0x78')]:[]};})};}})[_0x7eca('0x18')](respondWithResult(_0x14490f,null))[_0x7eca('0x4f')](function(_0x5605e0){var _0x46cf1e=_0x166d38[_0x7eca('0x37')][_0x7eca('0x79')]?0x1f4:_0x5605e0[_0x7eca('0x7a')]||0x1f4;logger['error'](_0x7eca('0x7b'),_0x7eca('0x5b'),_0x46cf1e,JSON['stringify'](_0x5605e0));delete _0x5605e0['name'];if(_0x46cf1e===0x191){_0x46cf1e=0x190;}_0x14490f['status'](_0x46cf1e)[_0x7eca('0x7c')](_0x166d38[_0x7eca('0x37')][_0x7eca('0x79')]?{'message':'Wrong\x20credentials','statusCode':_0x5605e0['statusCode']}:_0x5605e0);});}; \ No newline at end of file +var _0xb323=['pick','filter','merge','map','key','options','ZendeskAccount','includeAll','include','rows','show','params','fields','create','body','find','getConfigurations','findOne','ZendeskConfiguration','hasOwnProperty','addConfiguration','AccountId','Subjects','getSubjects','channel','getDescriptions','type','ZendeskField','Descriptions','getFields','username','password','token','authType','slice','substring','lastIndexOf','GET','%s/%s','headers','Basic\x20%s','format','toString','base64','%s/token:%s','ValidationError','Unknown\x20authentication\x20type','description','group','assignee','remove','ticket_fields','includes','position','title','system_field_options','custom_field_options','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','http','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','status','end','json','count','offset','limit','set','apply','reject','save','update','destroy','sendStatus','stack','name','send','index','rawAttributes','model','keys','query','intersection','attributes','length','nolimit','order','sort','where','filters'];(function(_0x23f935,_0x6c00ab){var _0x145b5a=function(_0x2d2842){while(--_0x2d2842){_0x23f935['push'](_0x23f935['shift']());}};_0x145b5a(++_0x6c00ab);}(_0xb323,0x141));var _0x3b32=function(_0x14917f,_0x4d85d1){_0x14917f=_0x14917f-0x0;var _0x452570=_0xb323[_0x14917f];return _0x452570;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x3b32('0x0'));var zipdir=require(_0x3b32('0x1'));var jsonpatch=require(_0x3b32('0x2'));var rp=require(_0x3b32('0x3'));var moment=require('moment');var BPromise=require(_0x3b32('0x4'));var Mustache=require(_0x3b32('0x5'));var util=require(_0x3b32('0x6'));var path=require(_0x3b32('0x7'));var sox=require(_0x3b32('0x8'));var csv=require(_0x3b32('0x9'));var ejs=require(_0x3b32('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x3b32('0xb'));var crypto=require(_0x3b32('0xc'));var jsforce=require(_0x3b32('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x3b32('0x9'));var querystring=require(_0x3b32('0xe'));var Papa=require(_0x3b32('0xf'));var Redis=require(_0x3b32('0x10'));var authService=require(_0x3b32('0x11'));var qs=require(_0x3b32('0x12'));var as=require(_0x3b32('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3b32('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x3b32('0x15'));var db=require(_0x3b32('0x16'))['db'];var integrations=require(_0x3b32('0x17'));var jayson=require(_0x3b32('0x18'));var client=jayson[_0x3b32('0x19')][_0x3b32('0x1a')]({'port':0x232a});function checkPasswordPattern(_0x53199b,_0x1ca603,_0x3d416a){if(_0x3d416a){var _0x479c0c=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x479c0c['test'](_0x1ca603)){return _0x53199b;}else{throw new Error(_0x3b32('0x1b'));}}else{return _0x53199b;}}function respondWithRpcPromise(_0x263a5a,_0x8b4abc,_0x1ec4c8,_0x3edfb4){return new BPromise(function(_0x5042a7,_0x475838){var _0x151abf=_0x3edfb4||client;return _0x151abf[_0x3b32('0x1c')](_0x263a5a,_0x1ec4c8)[_0x3b32('0x1d')](function(_0x1b69ec){logger['info'](_0x3b32('0x1e'),_0x8b4abc,_0x3b32('0x1f'));logger[_0x3b32('0x20')](_0x3b32('0x21'),_0x8b4abc,'request\x20sent',JSON['stringify'](_0x1b69ec));if(_0x1b69ec[_0x3b32('0x22')]){if(_0x1b69ec['error'][_0x3b32('0x23')]===0x1f4){logger[_0x3b32('0x22')](_0x3b32('0x1e'),_0x8b4abc,_0x1b69ec['error'][_0x3b32('0x24')]);return _0x475838(_0x1b69ec[_0x3b32('0x22')][_0x3b32('0x24')]);}logger[_0x3b32('0x22')](_0x3b32('0x1e'),_0x8b4abc,_0x1b69ec[_0x3b32('0x22')]['message']);return _0x5042a7(_0x1b69ec[_0x3b32('0x22')][_0x3b32('0x24')]);}else{logger[_0x3b32('0x25')]('ZendeskAccount,\x20%s,\x20%s',_0x8b4abc,_0x3b32('0x1f'));_0x5042a7(_0x1b69ec[_0x3b32('0x26')][_0x3b32('0x24')]);}})[_0x3b32('0x27')](function(_0x54f70f){logger[_0x3b32('0x22')]('ZendeskAccount,\x20%s,\x20%s',_0x8b4abc,_0x54f70f);_0x475838(_0x54f70f);});});}function respondWithStatusCode(_0x518c4d,_0x429120){_0x429120=_0x429120||0xcc;return function(_0x5bec33){if(_0x5bec33){return _0x518c4d['sendStatus'](_0x429120);}return _0x518c4d[_0x3b32('0x28')](_0x429120)[_0x3b32('0x29')]();};}function respondWithResult(_0x276e1c,_0x4d2cc3){_0x4d2cc3=_0x4d2cc3||0xc8;return function(_0x2bdba5){if(_0x2bdba5){return _0x276e1c['status'](_0x4d2cc3)[_0x3b32('0x2a')](_0x2bdba5);}};}function respondWithFilteredResult(_0x5b7edb,_0x293f84){return function(_0x33643c){if(_0x33643c){var _0x1a758a=_0x33643c[_0x3b32('0x2b')],_0x24977a=_0x293f84[_0x3b32('0x2c')],_0x422b20=_0x293f84[_0x3b32('0x2c')]+_0x293f84[_0x3b32('0x2d')],_0x4aed67;if(_0x422b20>=_0x1a758a){_0x422b20=_0x1a758a;_0x4aed67=0xc8;}else{_0x4aed67=0xce;}_0x5b7edb[_0x3b32('0x28')](_0x4aed67);return _0x5b7edb[_0x3b32('0x2e')]('Content-Range',_0x24977a+'-'+_0x422b20+'/'+_0x1a758a)[_0x3b32('0x2a')](_0x33643c);}return null;};}function patchUpdates(_0x3bd83a){return function(_0x1ba1be){try{jsonpatch[_0x3b32('0x2f')](_0x1ba1be,_0x3bd83a,!![]);}catch(_0x58b561){return BPromise[_0x3b32('0x30')](_0x58b561);}return _0x1ba1be[_0x3b32('0x31')]();};}function saveUpdates(_0x57d110,_0x5bd802){return function(_0x510eee){if(_0x510eee){return _0x510eee[_0x3b32('0x32')](_0x57d110)['then'](function(_0x5881a7){return _0x5881a7;});}return null;};}function removeEntity(_0x3647a8,_0x68058f){return function(_0x285368){if(_0x285368){return _0x285368[_0x3b32('0x33')]()['then'](function(){_0x3647a8[_0x3b32('0x28')](0xcc)[_0x3b32('0x29')]();});}};}function handleEntityNotFound(_0x3a5e61,_0x450f04){return function(_0x10dd5d){if(!_0x10dd5d){_0x3a5e61[_0x3b32('0x34')](0x194);}return _0x10dd5d;};}function handleError(_0x215f3c,_0x338318){_0x338318=_0x338318||0x1f4;return function(_0x173494){logger[_0x3b32('0x22')](_0x173494[_0x3b32('0x35')]);if(_0x173494[_0x3b32('0x36')]){delete _0x173494[_0x3b32('0x36')];}_0x215f3c[_0x3b32('0x28')](_0x338318)[_0x3b32('0x37')](_0x173494);};}exports[_0x3b32('0x38')]=function(_0x2732a7,_0x5c089f){var _0x42e0bb={},_0x1cb7b2={},_0x20dba3={'count':0x0,'rows':[]};var _0x25b077=db['ZendeskAccount'][_0x3b32('0x39')];_0x1cb7b2[_0x3b32('0x3a')]=_[_0x3b32('0x3b')](_0x25b077);_0x1cb7b2[_0x3b32('0x3c')]=_[_0x3b32('0x3b')](_0x2732a7[_0x3b32('0x3c')]);_0x1cb7b2['filters']=_[_0x3b32('0x3d')](_0x1cb7b2[_0x3b32('0x3a')],_0x1cb7b2[_0x3b32('0x3c')]);_0x42e0bb[_0x3b32('0x3e')]=_['intersection'](_0x1cb7b2['model'],qs['fields'](_0x2732a7[_0x3b32('0x3c')]['fields']));_0x42e0bb[_0x3b32('0x3e')]=_0x42e0bb[_0x3b32('0x3e')][_0x3b32('0x3f')]?_0x42e0bb[_0x3b32('0x3e')]:_0x1cb7b2[_0x3b32('0x3a')];if(!_0x2732a7[_0x3b32('0x3c')]['hasOwnProperty'](_0x3b32('0x40'))){_0x42e0bb[_0x3b32('0x2d')]=qs[_0x3b32('0x2d')](_0x2732a7[_0x3b32('0x3c')]['limit']);_0x42e0bb['offset']=qs['offset'](_0x2732a7['query'][_0x3b32('0x2c')]);}_0x42e0bb[_0x3b32('0x41')]=qs[_0x3b32('0x42')](_0x2732a7[_0x3b32('0x3c')][_0x3b32('0x42')]);_0x42e0bb[_0x3b32('0x43')]=qs[_0x3b32('0x44')](_[_0x3b32('0x45')](_0x2732a7[_0x3b32('0x3c')],_0x1cb7b2['filters']));if(_0x2732a7[_0x3b32('0x3c')][_0x3b32('0x46')]){_0x42e0bb[_0x3b32('0x43')]=_[_0x3b32('0x47')](_0x42e0bb[_0x3b32('0x43')],{'$or':_[_0x3b32('0x48')](_0x25b077,function(_0xc28dab){if(_0xc28dab['type'][_0x3b32('0x49')]!=='VIRTUAL'){var _0x4e1015={};_0x4e1015[_0xc28dab['field']]={'$like':'%'+_0x2732a7['query'][_0x3b32('0x46')]+'%'};return _0x4e1015;}})});}_0x42e0bb=_[_0x3b32('0x47')]({},_0x42e0bb,_0x2732a7[_0x3b32('0x4a')]);var _0x157a32={'where':_0x42e0bb[_0x3b32('0x43')]};return db[_0x3b32('0x4b')]['count'](_0x157a32)[_0x3b32('0x1d')](function(_0x44f933){_0x20dba3[_0x3b32('0x2b')]=_0x44f933;if(_0x2732a7[_0x3b32('0x3c')][_0x3b32('0x4c')]){_0x42e0bb[_0x3b32('0x4d')]=[{'all':!![]}];}return db[_0x3b32('0x4b')]['findAll'](_0x42e0bb);})[_0x3b32('0x1d')](function(_0x3c2ee3){_0x20dba3[_0x3b32('0x4e')]=_0x3c2ee3;return _0x20dba3;})[_0x3b32('0x1d')](respondWithFilteredResult(_0x5c089f,_0x42e0bb))[_0x3b32('0x27')](handleError(_0x5c089f,null));};exports[_0x3b32('0x4f')]=function(_0x5202b1,_0x3fc2b4){var _0x560bc3={'raw':![],'where':{'id':_0x5202b1[_0x3b32('0x50')]['id']}},_0x5cbb95={};_0x5cbb95[_0x3b32('0x3a')]=_[_0x3b32('0x3b')](db['ZendeskAccount'][_0x3b32('0x39')]);_0x5cbb95['query']=_[_0x3b32('0x3b')](_0x5202b1[_0x3b32('0x3c')]);_0x5cbb95[_0x3b32('0x44')]=_[_0x3b32('0x3d')](_0x5cbb95[_0x3b32('0x3a')],_0x5cbb95['query']);_0x560bc3[_0x3b32('0x3e')]=_[_0x3b32('0x3d')](_0x5cbb95[_0x3b32('0x3a')],qs[_0x3b32('0x51')](_0x5202b1[_0x3b32('0x3c')][_0x3b32('0x51')]));_0x560bc3[_0x3b32('0x3e')]=_0x560bc3[_0x3b32('0x3e')][_0x3b32('0x3f')]?_0x560bc3['attributes']:_0x5cbb95[_0x3b32('0x3a')];if(_0x5202b1[_0x3b32('0x3c')]['includeAll']){_0x560bc3[_0x3b32('0x4d')]=[{'all':!![]}];}_0x560bc3=_['merge']({},_0x560bc3,_0x5202b1[_0x3b32('0x4a')]);return db[_0x3b32('0x4b')]['find'](_0x560bc3)[_0x3b32('0x1d')](handleEntityNotFound(_0x3fc2b4,null))[_0x3b32('0x1d')](respondWithResult(_0x3fc2b4,null))['catch'](handleError(_0x3fc2b4,null));};exports[_0x3b32('0x52')]=function(_0x328376,_0x4b45c9){return db['ZendeskAccount'][_0x3b32('0x52')](_0x328376[_0x3b32('0x53')],{})['then'](respondWithResult(_0x4b45c9,0xc9))[_0x3b32('0x27')](handleError(_0x4b45c9,null));};exports[_0x3b32('0x32')]=function(_0x2b921b,_0x507c87){if(_0x2b921b['body']['id']){delete _0x2b921b[_0x3b32('0x53')]['id'];}return db['ZendeskAccount'][_0x3b32('0x54')]({'where':{'id':_0x2b921b[_0x3b32('0x50')]['id']}})[_0x3b32('0x1d')](handleEntityNotFound(_0x507c87,null))[_0x3b32('0x1d')](saveUpdates(_0x2b921b['body'],null))[_0x3b32('0x1d')](respondWithResult(_0x507c87,null))[_0x3b32('0x27')](handleError(_0x507c87,null));};exports[_0x3b32('0x33')]=function(_0x45c1aa,_0x5c941e){return db[_0x3b32('0x4b')][_0x3b32('0x54')]({'where':{'id':_0x45c1aa[_0x3b32('0x50')]['id']}})[_0x3b32('0x1d')](handleEntityNotFound(_0x5c941e,null))[_0x3b32('0x1d')](removeEntity(_0x5c941e,null))[_0x3b32('0x27')](handleError(_0x5c941e,null));};exports[_0x3b32('0x55')]=function(_0x48863e,_0x38adc6,_0x4f71a7){var _0x4edec3={};var _0x4e30cb={};var _0x2f16c6;var _0x4a701c;return db[_0x3b32('0x4b')][_0x3b32('0x56')]({'where':{'id':_0x48863e[_0x3b32('0x50')]['id']}})[_0x3b32('0x1d')](handleEntityNotFound(_0x38adc6,null))[_0x3b32('0x1d')](function(_0x183f56){if(_0x183f56){_0x2f16c6=_0x183f56;_0x4e30cb[_0x3b32('0x3a')]=_['keys'](db[_0x3b32('0x57')][_0x3b32('0x39')]);_0x4e30cb[_0x3b32('0x3c')]=_[_0x3b32('0x3b')](_0x48863e['query']);_0x4e30cb[_0x3b32('0x44')]=_[_0x3b32('0x3d')](_0x4e30cb[_0x3b32('0x3a')],_0x4e30cb[_0x3b32('0x3c')]);_0x4edec3[_0x3b32('0x3e')]=_[_0x3b32('0x3d')](_0x4e30cb[_0x3b32('0x3a')],qs[_0x3b32('0x51')](_0x48863e['query'][_0x3b32('0x51')]));_0x4edec3[_0x3b32('0x3e')]=_0x4edec3[_0x3b32('0x3e')]['length']?_0x4edec3['attributes']:_0x4e30cb[_0x3b32('0x3a')];_0x4edec3[_0x3b32('0x41')]=qs[_0x3b32('0x42')](_0x48863e[_0x3b32('0x3c')]['sort']);_0x4edec3['where']=qs[_0x3b32('0x44')](_[_0x3b32('0x45')](_0x48863e[_0x3b32('0x3c')],_0x4e30cb[_0x3b32('0x44')]));if(_0x48863e[_0x3b32('0x3c')][_0x3b32('0x46')]){_0x4edec3[_0x3b32('0x43')]=_[_0x3b32('0x47')](_0x4edec3[_0x3b32('0x43')],{'$or':_[_0x3b32('0x48')](_0x4edec3[_0x3b32('0x3e')],function(_0xa8a8ea){var _0x5ea771={};_0x5ea771[_0xa8a8ea]={'$like':'%'+_0x48863e[_0x3b32('0x3c')][_0x3b32('0x46')]+'%'};return _0x5ea771;})});}_0x4edec3=_['merge']({},_0x4edec3,_0x48863e[_0x3b32('0x4a')]);return _0x2f16c6[_0x3b32('0x55')](_0x4edec3);}})[_0x3b32('0x1d')](function(_0x2d5e1d){if(_0x2d5e1d){_0x4a701c=_0x2d5e1d['length'];if(!_0x48863e[_0x3b32('0x3c')][_0x3b32('0x58')](_0x3b32('0x40'))){_0x4edec3[_0x3b32('0x2d')]=qs[_0x3b32('0x2d')](_0x48863e['query'][_0x3b32('0x2d')]);_0x4edec3[_0x3b32('0x2c')]=qs[_0x3b32('0x2c')](_0x48863e[_0x3b32('0x3c')][_0x3b32('0x2c')]);}return _0x2f16c6[_0x3b32('0x55')](_0x4edec3);}})[_0x3b32('0x1d')](function(_0x4312b9){if(_0x4312b9){return _0x4312b9?{'count':_0x4a701c,'rows':_0x4312b9}:null;}})[_0x3b32('0x1d')](respondWithResult(_0x38adc6,null))[_0x3b32('0x27')](handleError(_0x38adc6,null));};exports[_0x3b32('0x59')]=function(_0x368fa2,_0x2c69ba,_0x102324){if(_0x368fa2['body']['id']){delete _0x368fa2[_0x3b32('0x53')]['id'];}return db[_0x3b32('0x4b')][_0x3b32('0x56')]({'where':{'id':_0x368fa2[_0x3b32('0x50')]['id']}})[_0x3b32('0x1d')](handleEntityNotFound(_0x2c69ba,null))[_0x3b32('0x1d')](function(_0x119013){if(_0x119013){_0x368fa2[_0x3b32('0x53')][_0x3b32('0x5a')]=_0x119013['id'];_0x368fa2['body'][_0x3b32('0x5b')]=integrations[_0x3b32('0x5c')](_0x368fa2[_0x3b32('0x53')][_0x3b32('0x5d')],_0x368fa2['body']['type']);_0x368fa2['body']['Descriptions']=integrations[_0x3b32('0x5e')](_0x368fa2[_0x3b32('0x53')]['channel'],_0x368fa2[_0x3b32('0x53')][_0x3b32('0x5f')]);return db[_0x3b32('0x57')]['create'](_0x368fa2['body'],{'include':[{'model':db[_0x3b32('0x60')],'as':_0x3b32('0x5b')},{'model':db[_0x3b32('0x60')],'as':_0x3b32('0x61')}]});}return null;})['then'](respondWithResult(_0x2c69ba,null))[_0x3b32('0x27')](handleError(_0x2c69ba,null));};exports[_0x3b32('0x62')]=function(_0x1eefd2,_0x4ab575,_0x3a4730){var _0x15df9d='';return db['ZendeskAccount'][_0x3b32('0x56')]({'where':{'id':_0x1eefd2[_0x3b32('0x50')]['id']},'attributes':['id',_0x3b32('0x63'),_0x3b32('0x64'),_0x3b32('0x65'),_0x3b32('0x66'),'remoteUri']})[_0x3b32('0x1d')](handleEntityNotFound(_0x4ab575,null))['then'](function(_0x1c3cfa){if(_0x1c3cfa){_0x15df9d=_0x1c3cfa['remoteUri'];var _0x332b3c=_0x15df9d[_0x3b32('0x67')](-0x1);if(_0x332b3c==='/'){_0x15df9d=_0x15df9d[_0x3b32('0x68')](0x0,_0x15df9d[_0x3b32('0x69')](_0x332b3c));}var _0x1283b3={'method':_0x3b32('0x6a'),'uri':util['format'](_0x3b32('0x6b'),_0x15df9d,'ticket_fields'),'json':!![]};switch(_0x1c3cfa[_0x3b32('0x66')]){case _0x3b32('0x64'):_0x1283b3[_0x3b32('0x6c')]={'Authorization':util['format'](_0x3b32('0x6d'),new Buffer(util[_0x3b32('0x6e')]('%s:%s',_0x1c3cfa['username'],_0x1c3cfa['password']))[_0x3b32('0x6f')](_0x3b32('0x70')))};break;case _0x3b32('0x65'):_0x1283b3[_0x3b32('0x6c')]={'Authorization':util[_0x3b32('0x6e')](_0x3b32('0x6d'),new Buffer(util[_0x3b32('0x6e')](_0x3b32('0x71'),_0x1c3cfa[_0x3b32('0x63')],_0x1c3cfa[_0x3b32('0x65')]))['toString']('base64'))};break;default:throw new db['Sequelize'][(_0x3b32('0x72'))](_0x3b32('0x73'));}return rp(_0x1283b3);}})[_0x3b32('0x1d')](function(_0x182ade){if(_0x182ade){var _0xbb88ef=['subject',_0x3b32('0x74'),_0x3b32('0x75'),_0x3b32('0x76')];_[_0x3b32('0x77')](_0x182ade[_0x3b32('0x78')],function(_0x1cccfb){return _0xbb88ef[_0x3b32('0x79')](_0x1cccfb[_0x3b32('0x5f')]);});return{'count':_0x182ade[_0x3b32('0x78')][_0x3b32('0x3f')],'rows':_[_0x3b32('0x48')](_0x182ade[_0x3b32('0x78')],function(_0x48b524){return{'id':_0x48b524['id'],'name':_0x48b524[_0x3b32('0x7a')]>0x7?_0x48b524[_0x3b32('0x7b')]:_0x48b524['type'],'custom':_0x48b524[_0x3b32('0x7a')]>0x7?!![]:![],'options':_0x48b524[_0x3b32('0x7c')]?_0x48b524['system_field_options']:_0x48b524['custom_field_options']?_0x48b524[_0x3b32('0x7d')]:[]};})};}})[_0x3b32('0x1d')](respondWithResult(_0x4ab575,null))[_0x3b32('0x27')](function(_0x8467dd){var _0x41c3bc=_0x1eefd2[_0x3b32('0x3c')][_0x3b32('0x7e')]?0x1f4:_0x8467dd[_0x3b32('0x7f')]||0x1f4;logger[_0x3b32('0x22')](_0x3b32('0x80'),_0x3b32('0x62'),_0x41c3bc,JSON['stringify'](_0x8467dd));delete _0x8467dd[_0x3b32('0x36')];if(_0x41c3bc===0x191){_0x41c3bc=0x190;}_0x4ab575[_0x3b32('0x28')](_0x41c3bc)[_0x3b32('0x37')](_0x1eefd2[_0x3b32('0x3c')]['test']?{'message':_0x3b32('0x81'),'statusCode':_0x8467dd['statusCode']}:_0x8467dd);});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.model.js b/server/api/intZendeskAccount/intZendeskAccount.model.js index abea5b5..9ae4b64 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 _0x8eb2=['int_zendesk_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intZendeskAccount.attributes','../../components/integrations/configuration','define'];(function(_0x301c86,_0x3234c2){var _0x2cd33b=function(_0x4b90f8){while(--_0x4b90f8){_0x301c86['push'](_0x301c86['shift']());}};_0x2cd33b(++_0x3234c2);}(_0x8eb2,0xfd));var _0x28eb=function(_0x4fb1d1,_0x86d8d6){_0x4fb1d1=_0x4fb1d1-0x0;var _0x1ab3b2=_0x8eb2[_0x4fb1d1];return _0x1ab3b2;};'use strict';var _=require(_0x28eb('0x0'));var util=require(_0x28eb('0x1'));var logger=require(_0x28eb('0x2'))(_0x28eb('0x3'));var moment=require(_0x28eb('0x4'));var BPromise=require(_0x28eb('0x5'));var rp=require(_0x28eb('0x6'));var fs=require('fs');var path=require(_0x28eb('0x7'));var rimraf=require(_0x28eb('0x8'));var config=require(_0x28eb('0x9'));var attributes=require(_0x28eb('0xa'));var integrations=require(_0x28eb('0xb'));module['exports']=function(_0x524bb8,_0x2600f9){return _0x524bb8[_0x28eb('0xc')]('ZendeskAccount',attributes,{'tableName':_0x28eb('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf2a5=['./intZendeskAccount.attributes','exports','define','ZendeskAccount','int_zendesk_accounts','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x45f32b,_0x1f2670){var _0x4c2259=function(_0x2b8816){while(--_0x2b8816){_0x45f32b['push'](_0x45f32b['shift']());}};_0x4c2259(++_0x1f2670);}(_0xf2a5,0x1e1));var _0x5f2a=function(_0x2fa27b,_0x1eda20){_0x2fa27b=_0x2fa27b-0x0;var _0x2c1254=_0xf2a5[_0x2fa27b];return _0x2c1254;};'use strict';var _=require(_0x5f2a('0x0'));var util=require(_0x5f2a('0x1'));var logger=require('../../config/logger')(_0x5f2a('0x2'));var moment=require(_0x5f2a('0x3'));var BPromise=require(_0x5f2a('0x4'));var rp=require(_0x5f2a('0x5'));var fs=require('fs');var path=require(_0x5f2a('0x6'));var rimraf=require(_0x5f2a('0x7'));var config=require(_0x5f2a('0x8'));var attributes=require(_0x5f2a('0x9'));var integrations=require('../../components/integrations/configuration');module[_0x5f2a('0xa')]=function(_0x49cdd6,_0x126516){return _0x49cdd6[_0x5f2a('0xb')](_0x5f2a('0xc'),attributes,{'tableName':_0x5f2a('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.rpc.js b/server/api/intZendeskAccount/intZendeskAccount.rpc.js index 8838446..a5d6e99 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 _0xe706=['options','raw','where','attributes','limit','include','map','model','stringify','ShowZendeskAccount','ZendeskAccount','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetZendeskAccount','findAll'];(function(_0xf92457,_0x4855a2){var _0x56f2d0=function(_0x4e6b49){while(--_0x4e6b49){_0xf92457['push'](_0xf92457['shift']());}};_0x56f2d0(++_0x4855a2);}(_0xe706,0xa3));var _0x6e70=function(_0x44474f,_0x431580){_0x44474f=_0x44474f-0x0;var _0x427d97=_0xe706[_0x44474f];return _0x427d97;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var moment=require(_0x6e70('0x2'));var BPromise=require('bluebird');var rs=require(_0x6e70('0x3'));var fs=require('fs');var Redis=require(_0x6e70('0x4'));var db=require(_0x6e70('0x5'))['db'];var utils=require(_0x6e70('0x6'));var logger=require(_0x6e70('0x7'))(_0x6e70('0x8'));var config=require(_0x6e70('0x9'));var jayson=require(_0x6e70('0xa'));var client=jayson[_0x6e70('0xb')][_0x6e70('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x36357b,_0x293ce7,_0x45a2d4){return new BPromise(function(_0x188ed3,_0x3c4843){return client[_0x6e70('0xd')](_0x36357b,_0x45a2d4)[_0x6e70('0xe')](function(_0x25e61c){logger[_0x6e70('0xf')](_0x6e70('0x10'),_0x293ce7,_0x6e70('0x11'));logger[_0x6e70('0x12')](_0x6e70('0x13'),_0x293ce7,_0x6e70('0x11'),JSON['stringify'](_0x25e61c));if(_0x25e61c['error']){if(_0x25e61c[_0x6e70('0x14')][_0x6e70('0x15')]===0x1f4){logger[_0x6e70('0x14')](_0x6e70('0x10'),_0x293ce7,_0x25e61c[_0x6e70('0x14')][_0x6e70('0x16')]);return _0x3c4843(_0x25e61c[_0x6e70('0x14')][_0x6e70('0x16')]);}logger['error']('ZendeskAccount,\x20%s,\x20%s',_0x293ce7,_0x25e61c['error'][_0x6e70('0x16')]);return _0x188ed3(_0x25e61c['error']['message']);}else{logger[_0x6e70('0xf')](_0x6e70('0x10'),_0x293ce7,'request\x20sent');_0x188ed3(_0x25e61c[_0x6e70('0x17')]['message']);}})[_0x6e70('0x18')](function(_0x161f23){logger['error']('ZendeskAccount,\x20%s,\x20%s',_0x293ce7,_0x161f23);_0x3c4843(_0x161f23);});});}exports[_0x6e70('0x19')]=function(_0x5ea7a5){var _0x28a21f=this;return new Promise(function(_0x173afe,_0x53acdc){return db['ZendeskAccount'][_0x6e70('0x1a')]({'raw':_0x5ea7a5[_0x6e70('0x1b')]?_0x5ea7a5[_0x6e70('0x1b')][_0x6e70('0x1c')]===undefined?!![]:![]:!![],'where':_0x5ea7a5[_0x6e70('0x1b')]?_0x5ea7a5[_0x6e70('0x1b')][_0x6e70('0x1d')]||null:null,'attributes':_0x5ea7a5[_0x6e70('0x1b')]?_0x5ea7a5[_0x6e70('0x1b')][_0x6e70('0x1e')]||null:null,'limit':_0x5ea7a5['options']?_0x5ea7a5[_0x6e70('0x1b')][_0x6e70('0x1f')]||null:null,'include':_0x5ea7a5[_0x6e70('0x1b')]?_0x5ea7a5['options'][_0x6e70('0x20')]?_[_0x6e70('0x21')](_0x5ea7a5[_0x6e70('0x1b')]['include'],function(_0x10fc91){return{'model':db[_0x10fc91['model']],'as':_0x10fc91['as'],'attributes':_0x10fc91['attributes'],'include':_0x10fc91['include']?_[_0x6e70('0x21')](_0x10fc91[_0x6e70('0x20')],function(_0x51d292){return{'model':db[_0x51d292[_0x6e70('0x22')]],'as':_0x51d292['as'],'attributes':_0x51d292[_0x6e70('0x1e')],'include':_0x51d292['include']?_[_0x6e70('0x21')](_0x51d292[_0x6e70('0x20')],function(_0x2bb231){return{'model':db[_0x2bb231['model']],'as':_0x2bb231['as'],'attributes':_0x2bb231['attributes']};}):[]};}):[]};}):[]:[]})[_0x6e70('0xe')](function(_0x3af17f){logger[_0x6e70('0xf')](_0x6e70('0x19'),_0x5ea7a5);logger[_0x6e70('0x12')]('GetZendeskAccount',_0x5ea7a5,JSON[_0x6e70('0x23')](_0x3af17f));_0x173afe(_0x3af17f);})[_0x6e70('0x18')](function(_0xecf336){logger[_0x6e70('0x14')](_0x6e70('0x19'),_0xecf336[_0x6e70('0x16')],_0x5ea7a5);_0x53acdc(_0x28a21f[_0x6e70('0x14')](0x1f4,_0xecf336[_0x6e70('0x16')]));});});};exports[_0x6e70('0x24')]=function(_0x3a5d30){var _0x4b1229=this;return new Promise(function(_0x1b27d8,_0x50d60b){return db[_0x6e70('0x25')]['find']({'raw':_0x3a5d30[_0x6e70('0x1b')]?_0x3a5d30[_0x6e70('0x1b')][_0x6e70('0x1c')]===undefined?!![]:![]:!![],'where':_0x3a5d30['options']?_0x3a5d30[_0x6e70('0x1b')][_0x6e70('0x1d')]||null:null,'attributes':_0x3a5d30['options']?_0x3a5d30[_0x6e70('0x1b')][_0x6e70('0x1e')]||null:null,'include':_0x3a5d30['options']?_0x3a5d30[_0x6e70('0x1b')][_0x6e70('0x20')]?_[_0x6e70('0x21')](_0x3a5d30[_0x6e70('0x1b')][_0x6e70('0x20')],function(_0x1e3e76){return{'model':db[_0x1e3e76[_0x6e70('0x22')]],'as':_0x1e3e76['as'],'attributes':_0x1e3e76[_0x6e70('0x1e')],'include':_0x1e3e76[_0x6e70('0x20')]?_[_0x6e70('0x21')](_0x1e3e76['include'],function(_0x3b9c06){return{'model':db[_0x3b9c06['model']],'as':_0x3b9c06['as'],'attributes':_0x3b9c06[_0x6e70('0x1e')],'include':_0x3b9c06[_0x6e70('0x20')]?_[_0x6e70('0x21')](_0x3b9c06[_0x6e70('0x20')],function(_0x233a83){return{'model':db[_0x233a83[_0x6e70('0x22')]],'as':_0x233a83['as'],'attributes':_0x233a83[_0x6e70('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x6e70('0xe')](function(_0x80bebb){logger[_0x6e70('0xf')](_0x6e70('0x24'),_0x3a5d30);logger[_0x6e70('0x12')](_0x6e70('0x24'),_0x3a5d30,JSON['stringify'](_0x80bebb));_0x1b27d8(_0x80bebb);})['catch'](function(_0x5424eb){logger[_0x6e70('0x14')](_0x6e70('0x24'),_0x5424eb[_0x6e70('0x16')],_0x3a5d30);_0x50d60b(_0x4b1229[_0x6e70('0x14')](0x1f4,_0x5424eb[_0x6e70('0x16')]));});});}; \ No newline at end of file +var _0xcb91=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetZendeskAccount','ZendeskAccount','findAll','options','raw','attributes','include','map','model','then','ShowZendeskAccount','find','where','moment','bluebird','randomstring','ioredis'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x305c31,_0x466b17){_0x305c31=_0x305c31-0x0;var _0x17f39f=_0xcb91[_0x305c31];return _0x17f39f;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1cb9('0x0'));var BPromise=require(_0x1cb9('0x1'));var rs=require(_0x1cb9('0x2'));var fs=require('fs');var Redis=require(_0x1cb9('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x1cb9('0x4'));var logger=require(_0x1cb9('0x5'))('rpc');var config=require(_0x1cb9('0x6'));var jayson=require(_0x1cb9('0x7'));var client=jayson['client'][_0x1cb9('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3f7deb,_0x4ffe20,_0x38737d){return new BPromise(function(_0x12567c,_0x59d1be){return client[_0x1cb9('0x9')](_0x3f7deb,_0x38737d)['then'](function(_0x567139){logger[_0x1cb9('0xa')](_0x1cb9('0xb'),_0x4ffe20,_0x1cb9('0xc'));logger[_0x1cb9('0xd')](_0x1cb9('0xe'),_0x4ffe20,'request\x20sent',JSON[_0x1cb9('0xf')](_0x567139));if(_0x567139[_0x1cb9('0x10')]){if(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x11')]===0x1f4){logger[_0x1cb9('0x10')]('ZendeskAccount,\x20%s,\x20%s',_0x4ffe20,_0x567139['error']['message']);return _0x59d1be(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x12')]);}logger[_0x1cb9('0x10')](_0x1cb9('0xb'),_0x4ffe20,_0x567139['error'][_0x1cb9('0x12')]);return _0x12567c(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x12')]);}else{logger[_0x1cb9('0xa')](_0x1cb9('0xb'),_0x4ffe20,'request\x20sent');_0x12567c(_0x567139['result'][_0x1cb9('0x12')]);}})[_0x1cb9('0x13')](function(_0x3904b7){logger[_0x1cb9('0x10')](_0x1cb9('0xb'),_0x4ffe20,_0x3904b7);_0x59d1be(_0x3904b7);});});}exports[_0x1cb9('0x14')]=function(_0x23d3a9){var _0x4e1340=this;return new Promise(function(_0x479d43,_0x1b2fa6){return db[_0x1cb9('0x15')][_0x1cb9('0x16')]({'raw':_0x23d3a9[_0x1cb9('0x17')]?_0x23d3a9[_0x1cb9('0x17')][_0x1cb9('0x18')]===undefined?!![]:![]:!![],'where':_0x23d3a9[_0x1cb9('0x17')]?_0x23d3a9['options']['where']||null:null,'attributes':_0x23d3a9[_0x1cb9('0x17')]?_0x23d3a9['options'][_0x1cb9('0x19')]||null:null,'limit':_0x23d3a9[_0x1cb9('0x17')]?_0x23d3a9['options']['limit']||null:null,'include':_0x23d3a9[_0x1cb9('0x17')]?_0x23d3a9[_0x1cb9('0x17')][_0x1cb9('0x1a')]?_[_0x1cb9('0x1b')](_0x23d3a9[_0x1cb9('0x17')][_0x1cb9('0x1a')],function(_0x59ebea){return{'model':db[_0x59ebea['model']],'as':_0x59ebea['as'],'attributes':_0x59ebea[_0x1cb9('0x19')],'include':_0x59ebea['include']?_[_0x1cb9('0x1b')](_0x59ebea[_0x1cb9('0x1a')],function(_0x69b4c8){return{'model':db[_0x69b4c8[_0x1cb9('0x1c')]],'as':_0x69b4c8['as'],'attributes':_0x69b4c8[_0x1cb9('0x19')],'include':_0x69b4c8['include']?_[_0x1cb9('0x1b')](_0x69b4c8[_0x1cb9('0x1a')],function(_0x4c8d76){return{'model':db[_0x4c8d76[_0x1cb9('0x1c')]],'as':_0x4c8d76['as'],'attributes':_0x4c8d76[_0x1cb9('0x19')]};}):[]};}):[]};}):[]:[]})[_0x1cb9('0x1d')](function(_0x1804fd){logger[_0x1cb9('0xa')](_0x1cb9('0x14'),_0x23d3a9);logger[_0x1cb9('0xd')](_0x1cb9('0x14'),_0x23d3a9,JSON[_0x1cb9('0xf')](_0x1804fd));_0x479d43(_0x1804fd);})[_0x1cb9('0x13')](function(_0x48888d){logger[_0x1cb9('0x10')]('GetZendeskAccount',_0x48888d[_0x1cb9('0x12')],_0x23d3a9);_0x1b2fa6(_0x4e1340['error'](0x1f4,_0x48888d[_0x1cb9('0x12')]));});});};exports[_0x1cb9('0x1e')]=function(_0x3cd7f5){var _0x2038aa=this;return new Promise(function(_0x561d89,_0x1c701f){return db['ZendeskAccount'][_0x1cb9('0x1f')]({'raw':_0x3cd7f5[_0x1cb9('0x17')]?_0x3cd7f5[_0x1cb9('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x3cd7f5[_0x1cb9('0x17')]?_0x3cd7f5['options'][_0x1cb9('0x20')]||null:null,'attributes':_0x3cd7f5['options']?_0x3cd7f5[_0x1cb9('0x17')][_0x1cb9('0x19')]||null:null,'include':_0x3cd7f5[_0x1cb9('0x17')]?_0x3cd7f5[_0x1cb9('0x17')]['include']?_[_0x1cb9('0x1b')](_0x3cd7f5[_0x1cb9('0x17')][_0x1cb9('0x1a')],function(_0x91a1db){return{'model':db[_0x91a1db[_0x1cb9('0x1c')]],'as':_0x91a1db['as'],'attributes':_0x91a1db[_0x1cb9('0x19')],'include':_0x91a1db[_0x1cb9('0x1a')]?_[_0x1cb9('0x1b')](_0x91a1db[_0x1cb9('0x1a')],function(_0x1de287){return{'model':db[_0x1de287[_0x1cb9('0x1c')]],'as':_0x1de287['as'],'attributes':_0x1de287[_0x1cb9('0x19')],'include':_0x1de287[_0x1cb9('0x1a')]?_['map'](_0x1de287['include'],function(_0x299ff8){return{'model':db[_0x299ff8[_0x1cb9('0x1c')]],'as':_0x299ff8['as'],'attributes':_0x299ff8[_0x1cb9('0x19')]};}):[]};}):[]};}):[]:[]})[_0x1cb9('0x1d')](function(_0x385daa){logger[_0x1cb9('0xa')](_0x1cb9('0x1e'),_0x3cd7f5);logger[_0x1cb9('0xd')]('ShowZendeskAccount',_0x3cd7f5,JSON[_0x1cb9('0xf')](_0x385daa));_0x561d89(_0x385daa);})[_0x1cb9('0x13')](function(_0xefe136){logger['error'](_0x1cb9('0x1e'),_0xefe136['message'],_0x3cd7f5);_0x1c701f(_0x2038aa[_0x1cb9('0x10')](0x1f4,_0xefe136['message']));});});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/index.js b/server/api/intZendeskConfiguration/index.js index 60f975e..154d9ff 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 _0x2d25=['../../config/environment','./intZendeskConfiguration.controller','isAuthenticated','index','get','/:id','show','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','getTags','post','create','/:id/tags','put','update','delete','destroy','exports','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service'];(function(_0x5a3cf0,_0x160a68){var _0x5a64ee=function(_0x34cd1d){while(--_0x34cd1d){_0x5a3cf0['push'](_0x5a3cf0['shift']());}};_0x5a64ee(++_0x160a68);}(_0x2d25,0x9c));var _0x52d2=function(_0xfbf349,_0x204feb){_0xfbf349=_0xfbf349-0x0;var _0x597c05=_0x2d25[_0xfbf349];return _0x597c05;};'use strict';var multer=require('multer');var util=require(_0x52d2('0x0'));var path=require(_0x52d2('0x1'));var timeout=require(_0x52d2('0x2'));var express=require(_0x52d2('0x3'));var router=express['Router']();var auth=require(_0x52d2('0x4'));var interaction=require(_0x52d2('0x5'));var config=require(_0x52d2('0x6'));var controller=require(_0x52d2('0x7'));router['get']('/',auth[_0x52d2('0x8')](),controller[_0x52d2('0x9')]);router[_0x52d2('0xa')](_0x52d2('0xb'),auth[_0x52d2('0x8')](),controller[_0x52d2('0xc')]);router['get'](_0x52d2('0xd'),auth['isAuthenticated'](),controller['getFields']);router[_0x52d2('0xa')](_0x52d2('0xe'),auth[_0x52d2('0x8')](),controller[_0x52d2('0xf')]);router['get'](_0x52d2('0x10'),auth[_0x52d2('0x8')](),controller[_0x52d2('0x11')]);router[_0x52d2('0xa')]('/:id/tags',auth[_0x52d2('0x8')](),controller[_0x52d2('0x12')]);router[_0x52d2('0x13')]('/',auth['isAuthenticated'](),controller[_0x52d2('0x14')]);router[_0x52d2('0x13')](_0x52d2('0x15'),auth['isAuthenticated'](),controller['setTags']);router[_0x52d2('0x16')](_0x52d2('0xb'),auth[_0x52d2('0x8')](),controller[_0x52d2('0x17')]);router[_0x52d2('0x18')]('/:id',auth['isAuthenticated'](),controller[_0x52d2('0x19')]);module[_0x52d2('0x1a')]=router; \ No newline at end of file +var _0x049b=['../../config/environment','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getDescriptions','/:id/tags','post','create','setTags','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x152311,_0x1666e9){var _0x3f789b=function(_0x4dfe68){while(--_0x4dfe68){_0x152311['push'](_0x152311['shift']());}};_0x3f789b(++_0x1666e9);}(_0x049b,0x18a));var _0xb049=function(_0x315c01,_0xe529dd){_0x315c01=_0x315c01-0x0;var _0x19c167=_0x049b[_0x315c01];return _0x19c167;};'use strict';var multer=require('multer');var util=require(_0xb049('0x0'));var path=require(_0xb049('0x1'));var timeout=require(_0xb049('0x2'));var express=require(_0xb049('0x3'));var router=express[_0xb049('0x4')]();var auth=require(_0xb049('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xb049('0x6'));var controller=require('./intZendeskConfiguration.controller');router[_0xb049('0x7')]('/',auth[_0xb049('0x8')](),controller[_0xb049('0x9')]);router[_0xb049('0x7')](_0xb049('0xa'),auth[_0xb049('0x8')](),controller[_0xb049('0xb')]);router[_0xb049('0x7')](_0xb049('0xc'),auth[_0xb049('0x8')](),controller[_0xb049('0xd')]);router[_0xb049('0x7')](_0xb049('0xe'),auth['isAuthenticated'](),controller['getSubjects']);router[_0xb049('0x7')]('/:id/descriptions',auth[_0xb049('0x8')](),controller[_0xb049('0xf')]);router['get'](_0xb049('0x10'),auth[_0xb049('0x8')](),controller['getTags']);router[_0xb049('0x11')]('/',auth[_0xb049('0x8')](),controller[_0xb049('0x12')]);router[_0xb049('0x11')](_0xb049('0x10'),auth[_0xb049('0x8')](),controller[_0xb049('0x13')]);router[_0xb049('0x14')](_0xb049('0xa'),auth[_0xb049('0x8')](),controller[_0xb049('0x15')]);router[_0xb049('0x16')](_0xb049('0xa'),auth['isAuthenticated'](),controller[_0xb049('0x17')]);module[_0xb049('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 133585d..c15a72c 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 _0x648c=['sequelize','exports','STRING'];(function(_0x20945a,_0x4b01fd){var _0x3c673a=function(_0x845271){while(--_0x845271){_0x20945a['push'](_0x20945a['shift']());}};_0x3c673a(++_0x4b01fd);}(_0x648c,0x1d1));var _0xc648=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x648c[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xc648('0x0'));module[_0xc648('0x1')]={'name':{'type':Sequelize[_0xc648('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xff84=['exports','STRING','sequelize'];(function(_0x41ed37,_0xbcd1d4){var _0x13f7ea=function(_0x270235){while(--_0x270235){_0x41ed37['push'](_0x41ed37['shift']());}};_0x13f7ea(++_0xbcd1d4);}(_0xff84,0x1a9));var _0x4ff8=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0xff84[_0x502c7d];return _0x30b7ed;};'use strict';var Sequelize=require(_0x4ff8('0x0'));module[_0x4ff8('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x4ff8('0x2')]}}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js index 21235e3..fd99630 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 _0xbaf0=['zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','client','http','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','status','json','offset','set','Content-Range','apply','reject','save','update','destroy','stack','name','send','index','ZendeskConfiguration','model','keys','query','attributes','intersection','fields','length','nolimit','limit','sort','where','filters','pick','filter','merge','map','type','key','VIRTUAL','field','options','count','includeAll','include','findAll','catch','show','params','find','create','body','getFields','ZendeskField','hasOwnProperty','getSubjects','findOne','getDescriptions','rawAttributes','order','getTags','Tag','setTags','ids','eml-format','rimraf'];(function(_0x3feab5,_0x1711ba){var _0x5a7137=function(_0x472e35){while(--_0x472e35){_0x3feab5['push'](_0x3feab5['shift']());}};_0x5a7137(++_0x1711ba);}(_0xbaf0,0x12a));var _0x0baf=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xbaf0[_0x501510];return _0x1e6ee5;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x0baf('0x0'));var rimraf=require(_0x0baf('0x1'));var zipdir=require(_0x0baf('0x2'));var jsonpatch=require(_0x0baf('0x3'));var rp=require(_0x0baf('0x4'));var moment=require(_0x0baf('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x0baf('0x6'));var util=require(_0x0baf('0x7'));var path=require(_0x0baf('0x8'));var sox=require(_0x0baf('0x9'));var csv=require(_0x0baf('0xa'));var ejs=require(_0x0baf('0xb'));var fs=require('fs');var _=require(_0x0baf('0xc'));var squel=require(_0x0baf('0xd'));var crypto=require(_0x0baf('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x0baf('0xf'));var toCsv=require('to-csv');var querystring=require(_0x0baf('0x10'));var Papa=require(_0x0baf('0x11'));var Redis=require(_0x0baf('0x12'));var authService=require(_0x0baf('0x13'));var qs=require(_0x0baf('0x14'));var as=require(_0x0baf('0x15'));var hardwareService=require(_0x0baf('0x16'));var logger=require(_0x0baf('0x17'))(_0x0baf('0x18'));var utils=require(_0x0baf('0x19'));var config=require(_0x0baf('0x1a'));var db=require('../../mysqldb')['db'];var jayson=require('jayson/promise');var client=jayson[_0x0baf('0x1b')][_0x0baf('0x1c')]({'port':0x232a});function checkPasswordPattern(_0x5db689,_0x13df17,_0x5a0583){if(_0x5a0583){var _0x2ab33e=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2ab33e['test'](_0x13df17)){return _0x5db689;}else{throw new Error(_0x0baf('0x1d'));}}else{return _0x5db689;}}function respondWithRpcPromise(_0x1f50c3,_0x7fbf67,_0x2bc381,_0xb8339e){return new BPromise(function(_0x469599,_0x4f80a8){var _0x4cd79d=_0xb8339e||client;return _0x4cd79d[_0x0baf('0x1e')](_0x1f50c3,_0x2bc381)[_0x0baf('0x1f')](function(_0x283408){logger[_0x0baf('0x20')](_0x0baf('0x21'),_0x7fbf67,_0x0baf('0x22'));logger['debug'](_0x0baf('0x23'),_0x7fbf67,_0x0baf('0x22'),JSON[_0x0baf('0x24')](_0x283408));if(_0x283408[_0x0baf('0x25')]){if(_0x283408[_0x0baf('0x25')][_0x0baf('0x26')]===0x1f4){logger['error']('ZendeskConfiguration,\x20%s,\x20%s',_0x7fbf67,_0x283408[_0x0baf('0x25')][_0x0baf('0x27')]);return _0x4f80a8(_0x283408[_0x0baf('0x25')][_0x0baf('0x27')]);}logger[_0x0baf('0x25')](_0x0baf('0x21'),_0x7fbf67,_0x283408[_0x0baf('0x25')][_0x0baf('0x27')]);return _0x469599(_0x283408[_0x0baf('0x25')][_0x0baf('0x27')]);}else{logger['info'](_0x0baf('0x21'),_0x7fbf67,'request\x20sent');_0x469599(_0x283408[_0x0baf('0x28')]['message']);}})['catch'](function(_0x2ef0aa){logger['error']('ZendeskConfiguration,\x20%s,\x20%s',_0x7fbf67,_0x2ef0aa);_0x4f80a8(_0x2ef0aa);});});}function respondWithStatusCode(_0x47c4b,_0x27b59c){_0x27b59c=_0x27b59c||0xcc;return function(_0x34e264){if(_0x34e264){return _0x47c4b[_0x0baf('0x29')](_0x27b59c);}return _0x47c4b[_0x0baf('0x2a')](_0x27b59c)['end']();};}function respondWithResult(_0x448617,_0x4681c5){_0x4681c5=_0x4681c5||0xc8;return function(_0x1ca35a){if(_0x1ca35a){return _0x448617[_0x0baf('0x2a')](_0x4681c5)[_0x0baf('0x2b')](_0x1ca35a);}};}function respondWithFilteredResult(_0x3b9b31,_0x453525){return function(_0x549fd0){if(_0x549fd0){var _0x1590b4=_0x549fd0['count'],_0x393a5a=_0x453525[_0x0baf('0x2c')],_0xcaf13d=_0x453525[_0x0baf('0x2c')]+_0x453525['limit'],_0x265915;if(_0xcaf13d>=_0x1590b4){_0xcaf13d=_0x1590b4;_0x265915=0xc8;}else{_0x265915=0xce;}_0x3b9b31[_0x0baf('0x2a')](_0x265915);return _0x3b9b31[_0x0baf('0x2d')](_0x0baf('0x2e'),_0x393a5a+'-'+_0xcaf13d+'/'+_0x1590b4)[_0x0baf('0x2b')](_0x549fd0);}return null;};}function patchUpdates(_0xd14f0f){return function(_0x366924){try{jsonpatch[_0x0baf('0x2f')](_0x366924,_0xd14f0f,!![]);}catch(_0x57476f){return BPromise[_0x0baf('0x30')](_0x57476f);}return _0x366924[_0x0baf('0x31')]();};}function saveUpdates(_0x37be4e,_0x3ed995){return function(_0x24ecee){if(_0x24ecee){return _0x24ecee[_0x0baf('0x32')](_0x37be4e)[_0x0baf('0x1f')](function(_0x2f0a45){return _0x2f0a45;});}return null;};}function removeEntity(_0x59431b,_0x3ded64){return function(_0x2adfd7){if(_0x2adfd7){return _0x2adfd7[_0x0baf('0x33')]()[_0x0baf('0x1f')](function(){_0x59431b[_0x0baf('0x2a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2fd426,_0x53ae1d){return function(_0x1aa474){if(!_0x1aa474){_0x2fd426[_0x0baf('0x29')](0x194);}return _0x1aa474;};}function handleError(_0x35e534,_0x3d65f2){_0x3d65f2=_0x3d65f2||0x1f4;return function(_0x5300a5){logger[_0x0baf('0x25')](_0x5300a5[_0x0baf('0x34')]);if(_0x5300a5['name']){delete _0x5300a5[_0x0baf('0x35')];}_0x35e534[_0x0baf('0x2a')](_0x3d65f2)[_0x0baf('0x36')](_0x5300a5);};}exports[_0x0baf('0x37')]=function(_0x1f60bd,_0x1b0991){var _0xe03d82={},_0x675461={},_0x4aa6ed={'count':0x0,'rows':[]};var _0x7e765b=db[_0x0baf('0x38')]['rawAttributes'];_0x675461[_0x0baf('0x39')]=_['keys'](_0x7e765b);_0x675461['query']=_[_0x0baf('0x3a')](_0x1f60bd[_0x0baf('0x3b')]);_0x675461['filters']=_['intersection'](_0x675461[_0x0baf('0x39')],_0x675461[_0x0baf('0x3b')]);_0xe03d82[_0x0baf('0x3c')]=_[_0x0baf('0x3d')](_0x675461[_0x0baf('0x39')],qs[_0x0baf('0x3e')](_0x1f60bd[_0x0baf('0x3b')][_0x0baf('0x3e')]));_0xe03d82[_0x0baf('0x3c')]=_0xe03d82[_0x0baf('0x3c')][_0x0baf('0x3f')]?_0xe03d82[_0x0baf('0x3c')]:_0x675461[_0x0baf('0x39')];if(!_0x1f60bd[_0x0baf('0x3b')]['hasOwnProperty'](_0x0baf('0x40'))){_0xe03d82[_0x0baf('0x41')]=qs['limit'](_0x1f60bd[_0x0baf('0x3b')][_0x0baf('0x41')]);_0xe03d82[_0x0baf('0x2c')]=qs[_0x0baf('0x2c')](_0x1f60bd[_0x0baf('0x3b')][_0x0baf('0x2c')]);}_0xe03d82['order']=qs[_0x0baf('0x42')](_0x1f60bd[_0x0baf('0x3b')]['sort']);_0xe03d82[_0x0baf('0x43')]=qs[_0x0baf('0x44')](_[_0x0baf('0x45')](_0x1f60bd[_0x0baf('0x3b')],_0x675461['filters']));if(_0x1f60bd[_0x0baf('0x3b')][_0x0baf('0x46')]){_0xe03d82[_0x0baf('0x43')]=_[_0x0baf('0x47')](_0xe03d82[_0x0baf('0x43')],{'$or':_[_0x0baf('0x48')](_0x7e765b,function(_0x33da34){if(_0x33da34[_0x0baf('0x49')][_0x0baf('0x4a')]!==_0x0baf('0x4b')){var _0x56270e={};_0x56270e[_0x33da34[_0x0baf('0x4c')]]={'$like':'%'+_0x1f60bd[_0x0baf('0x3b')][_0x0baf('0x46')]+'%'};return _0x56270e;}})});}_0xe03d82=_[_0x0baf('0x47')]({},_0xe03d82,_0x1f60bd[_0x0baf('0x4d')]);var _0x55f4f8={'where':_0xe03d82[_0x0baf('0x43')]};return db[_0x0baf('0x38')][_0x0baf('0x4e')](_0x55f4f8)[_0x0baf('0x1f')](function(_0x35b5db){_0x4aa6ed['count']=_0x35b5db;if(_0x1f60bd[_0x0baf('0x3b')][_0x0baf('0x4f')]){_0xe03d82[_0x0baf('0x50')]=[{'all':!![]}];}return db[_0x0baf('0x38')][_0x0baf('0x51')](_0xe03d82);})[_0x0baf('0x1f')](function(_0x178995){_0x4aa6ed['rows']=_0x178995;return _0x4aa6ed;})[_0x0baf('0x1f')](respondWithFilteredResult(_0x1b0991,_0xe03d82))[_0x0baf('0x52')](handleError(_0x1b0991,null));};exports[_0x0baf('0x53')]=function(_0x57008f,_0x3c9de3){var _0x2222b6={'raw':![],'where':{'id':_0x57008f[_0x0baf('0x54')]['id']}},_0x10fa62={};_0x10fa62[_0x0baf('0x39')]=_[_0x0baf('0x3a')](db[_0x0baf('0x38')]['rawAttributes']);_0x10fa62[_0x0baf('0x3b')]=_[_0x0baf('0x3a')](_0x57008f[_0x0baf('0x3b')]);_0x10fa62[_0x0baf('0x44')]=_[_0x0baf('0x3d')](_0x10fa62[_0x0baf('0x39')],_0x10fa62[_0x0baf('0x3b')]);_0x2222b6[_0x0baf('0x3c')]=_[_0x0baf('0x3d')](_0x10fa62[_0x0baf('0x39')],qs[_0x0baf('0x3e')](_0x57008f['query']['fields']));_0x2222b6[_0x0baf('0x3c')]=_0x2222b6[_0x0baf('0x3c')][_0x0baf('0x3f')]?_0x2222b6[_0x0baf('0x3c')]:_0x10fa62[_0x0baf('0x39')];if(_0x57008f[_0x0baf('0x3b')][_0x0baf('0x4f')]){_0x2222b6['include']=[{'all':!![]}];}_0x2222b6=_[_0x0baf('0x47')]({},_0x2222b6,_0x57008f[_0x0baf('0x4d')]);return db[_0x0baf('0x38')][_0x0baf('0x55')](_0x2222b6)[_0x0baf('0x1f')](handleEntityNotFound(_0x3c9de3,null))[_0x0baf('0x1f')](respondWithResult(_0x3c9de3,null))['catch'](handleError(_0x3c9de3,null));};exports[_0x0baf('0x56')]=function(_0x5f123c,_0x151741){return db['ZendeskConfiguration'][_0x0baf('0x56')](_0x5f123c['body'],{})[_0x0baf('0x1f')](respondWithResult(_0x151741,0xc9))['catch'](handleError(_0x151741,null));};exports[_0x0baf('0x32')]=function(_0xcf7b8d,_0x411c1f){if(_0xcf7b8d[_0x0baf('0x57')]['id']){delete _0xcf7b8d[_0x0baf('0x57')]['id'];}return db['ZendeskConfiguration'][_0x0baf('0x55')]({'where':{'id':_0xcf7b8d[_0x0baf('0x54')]['id']}})[_0x0baf('0x1f')](handleEntityNotFound(_0x411c1f,null))[_0x0baf('0x1f')](saveUpdates(_0xcf7b8d[_0x0baf('0x57')],null))[_0x0baf('0x1f')](respondWithResult(_0x411c1f,null))['catch'](handleError(_0x411c1f,null));};exports[_0x0baf('0x33')]=function(_0x2771a2,_0x315cbf){return db[_0x0baf('0x38')][_0x0baf('0x55')]({'where':{'id':_0x2771a2[_0x0baf('0x54')]['id']}})[_0x0baf('0x1f')](handleEntityNotFound(_0x315cbf,null))['then'](removeEntity(_0x315cbf,null))['catch'](handleError(_0x315cbf,null));};exports[_0x0baf('0x58')]=function(_0x11e18a,_0x371a3d,_0x337d94){var _0x3128aa={};var _0x35221e={};var _0xaa4293;var _0x14a667;return db[_0x0baf('0x38')]['findOne']({'where':{'id':_0x11e18a[_0x0baf('0x54')]['id']}})[_0x0baf('0x1f')](handleEntityNotFound(_0x371a3d,null))[_0x0baf('0x1f')](function(_0x1245de){if(_0x1245de){_0xaa4293=_0x1245de;_0x35221e[_0x0baf('0x39')]=_[_0x0baf('0x3a')](db[_0x0baf('0x59')]['rawAttributes']);_0x35221e[_0x0baf('0x3b')]=_[_0x0baf('0x3a')](_0x11e18a[_0x0baf('0x3b')]);_0x35221e[_0x0baf('0x44')]=_[_0x0baf('0x3d')](_0x35221e[_0x0baf('0x39')],_0x35221e[_0x0baf('0x3b')]);_0x3128aa[_0x0baf('0x3c')]=_['intersection'](_0x35221e[_0x0baf('0x39')],qs['fields'](_0x11e18a[_0x0baf('0x3b')]['fields']));_0x3128aa['attributes']=_0x3128aa[_0x0baf('0x3c')]['length']?_0x3128aa[_0x0baf('0x3c')]:_0x35221e[_0x0baf('0x39')];_0x3128aa['order']=qs[_0x0baf('0x42')](_0x11e18a[_0x0baf('0x3b')][_0x0baf('0x42')]);_0x3128aa['where']=qs['filters'](_[_0x0baf('0x45')](_0x11e18a[_0x0baf('0x3b')],_0x35221e[_0x0baf('0x44')]));if(_0x11e18a[_0x0baf('0x3b')][_0x0baf('0x46')]){_0x3128aa['where']=_[_0x0baf('0x47')](_0x3128aa['where'],{'$or':_['map'](_0x3128aa['attributes'],function(_0x427ed1){var _0x58a366={};_0x58a366[_0x427ed1]={'$like':'%'+_0x11e18a['query'][_0x0baf('0x46')]+'%'};return _0x58a366;})});}_0x3128aa=_[_0x0baf('0x47')]({},_0x3128aa,_0x11e18a[_0x0baf('0x4d')]);return _0xaa4293[_0x0baf('0x58')](_0x3128aa);}})[_0x0baf('0x1f')](function(_0x27ddc7){if(_0x27ddc7){_0x14a667=_0x27ddc7['length'];if(!_0x11e18a[_0x0baf('0x3b')][_0x0baf('0x5a')](_0x0baf('0x40'))){_0x3128aa[_0x0baf('0x41')]=qs[_0x0baf('0x41')](_0x11e18a[_0x0baf('0x3b')]['limit']);_0x3128aa[_0x0baf('0x2c')]=qs[_0x0baf('0x2c')](_0x11e18a[_0x0baf('0x3b')]['offset']);}return _0xaa4293[_0x0baf('0x58')](_0x3128aa);}})[_0x0baf('0x1f')](function(_0x3d333d){if(_0x3d333d){return _0x3d333d?{'count':_0x14a667,'rows':_0x3d333d}:null;}})[_0x0baf('0x1f')](respondWithResult(_0x371a3d,null))[_0x0baf('0x52')](handleError(_0x371a3d,null));};exports[_0x0baf('0x5b')]=function(_0x4cc046,_0x5874cc,_0x54353a){var _0x4b7caa={};var _0x6ce83c={};var _0x89bec7;var _0x26eb39;return db[_0x0baf('0x38')][_0x0baf('0x5c')]({'where':{'id':_0x4cc046[_0x0baf('0x54')]['id']}})['then'](handleEntityNotFound(_0x5874cc,null))['then'](function(_0x34c1f4){if(_0x34c1f4){_0x89bec7=_0x34c1f4;_0x6ce83c['model']=_[_0x0baf('0x3a')](db[_0x0baf('0x59')]['rawAttributes']);_0x6ce83c[_0x0baf('0x3b')]=_[_0x0baf('0x3a')](_0x4cc046[_0x0baf('0x3b')]);_0x6ce83c[_0x0baf('0x44')]=_[_0x0baf('0x3d')](_0x6ce83c[_0x0baf('0x39')],_0x6ce83c[_0x0baf('0x3b')]);_0x4b7caa[_0x0baf('0x3c')]=_[_0x0baf('0x3d')](_0x6ce83c['model'],qs['fields'](_0x4cc046['query']['fields']));_0x4b7caa['attributes']=_0x4b7caa[_0x0baf('0x3c')][_0x0baf('0x3f')]?_0x4b7caa[_0x0baf('0x3c')]:_0x6ce83c[_0x0baf('0x39')];_0x4b7caa['order']=qs[_0x0baf('0x42')](_0x4cc046[_0x0baf('0x3b')]['sort']);_0x4b7caa['where']=qs[_0x0baf('0x44')](_[_0x0baf('0x45')](_0x4cc046[_0x0baf('0x3b')],_0x6ce83c[_0x0baf('0x44')]));if(_0x4cc046[_0x0baf('0x3b')][_0x0baf('0x46')]){_0x4b7caa[_0x0baf('0x43')]=_[_0x0baf('0x47')](_0x4b7caa['where'],{'$or':_[_0x0baf('0x48')](_0x4b7caa[_0x0baf('0x3c')],function(_0x560c0f){var _0xa82961={};_0xa82961[_0x560c0f]={'$like':'%'+_0x4cc046[_0x0baf('0x3b')]['filter']+'%'};return _0xa82961;})});}_0x4b7caa=_[_0x0baf('0x47')]({},_0x4b7caa,_0x4cc046[_0x0baf('0x4d')]);return _0x89bec7[_0x0baf('0x5b')](_0x4b7caa);}})[_0x0baf('0x1f')](function(_0x167977){if(_0x167977){_0x26eb39=_0x167977['length'];if(!_0x4cc046['query'][_0x0baf('0x5a')](_0x0baf('0x40'))){_0x4b7caa['limit']=qs[_0x0baf('0x41')](_0x4cc046[_0x0baf('0x3b')][_0x0baf('0x41')]);_0x4b7caa['offset']=qs[_0x0baf('0x2c')](_0x4cc046[_0x0baf('0x3b')][_0x0baf('0x2c')]);}return _0x89bec7['getSubjects'](_0x4b7caa);}})[_0x0baf('0x1f')](function(_0x5008c5){if(_0x5008c5){return _0x5008c5?{'count':_0x26eb39,'rows':_0x5008c5}:null;}})[_0x0baf('0x1f')](respondWithResult(_0x5874cc,null))[_0x0baf('0x52')](handleError(_0x5874cc,null));};exports[_0x0baf('0x5d')]=function(_0x2f009f,_0xc09ac3,_0x52e845){var _0x866e6e={};var _0x57f33c={};var _0x5c8805;var _0xc895a6;return db[_0x0baf('0x38')][_0x0baf('0x5c')]({'where':{'id':_0x2f009f[_0x0baf('0x54')]['id']}})[_0x0baf('0x1f')](handleEntityNotFound(_0xc09ac3,null))[_0x0baf('0x1f')](function(_0xa4fd1b){if(_0xa4fd1b){_0x5c8805=_0xa4fd1b;_0x57f33c[_0x0baf('0x39')]=_[_0x0baf('0x3a')](db[_0x0baf('0x59')][_0x0baf('0x5e')]);_0x57f33c[_0x0baf('0x3b')]=_['keys'](_0x2f009f['query']);_0x57f33c[_0x0baf('0x44')]=_[_0x0baf('0x3d')](_0x57f33c[_0x0baf('0x39')],_0x57f33c['query']);_0x866e6e['attributes']=_[_0x0baf('0x3d')](_0x57f33c[_0x0baf('0x39')],qs[_0x0baf('0x3e')](_0x2f009f[_0x0baf('0x3b')][_0x0baf('0x3e')]));_0x866e6e[_0x0baf('0x3c')]=_0x866e6e[_0x0baf('0x3c')][_0x0baf('0x3f')]?_0x866e6e[_0x0baf('0x3c')]:_0x57f33c['model'];_0x866e6e[_0x0baf('0x5f')]=qs[_0x0baf('0x42')](_0x2f009f[_0x0baf('0x3b')][_0x0baf('0x42')]);_0x866e6e['where']=qs['filters'](_['pick'](_0x2f009f[_0x0baf('0x3b')],_0x57f33c[_0x0baf('0x44')]));if(_0x2f009f['query']['filter']){_0x866e6e[_0x0baf('0x43')]=_[_0x0baf('0x47')](_0x866e6e['where'],{'$or':_[_0x0baf('0x48')](_0x866e6e[_0x0baf('0x3c')],function(_0x20c617){var _0x4082ce={};_0x4082ce[_0x20c617]={'$like':'%'+_0x2f009f[_0x0baf('0x3b')][_0x0baf('0x46')]+'%'};return _0x4082ce;})});}_0x866e6e=_[_0x0baf('0x47')]({},_0x866e6e,_0x2f009f[_0x0baf('0x4d')]);return _0x5c8805[_0x0baf('0x5d')](_0x866e6e);}})[_0x0baf('0x1f')](function(_0x3548cd){if(_0x3548cd){_0xc895a6=_0x3548cd[_0x0baf('0x3f')];if(!_0x2f009f['query'][_0x0baf('0x5a')](_0x0baf('0x40'))){_0x866e6e[_0x0baf('0x41')]=qs[_0x0baf('0x41')](_0x2f009f[_0x0baf('0x3b')][_0x0baf('0x41')]);_0x866e6e['offset']=qs[_0x0baf('0x2c')](_0x2f009f[_0x0baf('0x3b')][_0x0baf('0x2c')]);}return _0x5c8805[_0x0baf('0x5d')](_0x866e6e);}})[_0x0baf('0x1f')](function(_0x4a106c){if(_0x4a106c){return _0x4a106c?{'count':_0xc895a6,'rows':_0x4a106c}:null;}})[_0x0baf('0x1f')](respondWithResult(_0xc09ac3,null))[_0x0baf('0x52')](handleError(_0xc09ac3,null));};exports[_0x0baf('0x60')]=function(_0xeecf8,_0x102c02,_0x5af0fc){var _0x580954={};var _0xb5f4e5={};var _0x5a2454;var _0x477cd5;return db['ZendeskConfiguration'][_0x0baf('0x5c')]({'where':{'id':_0xeecf8[_0x0baf('0x54')]['id']}})[_0x0baf('0x1f')](handleEntityNotFound(_0x102c02,null))[_0x0baf('0x1f')](function(_0x4f4385){if(_0x4f4385){_0x5a2454=_0x4f4385;_0xb5f4e5[_0x0baf('0x39')]=_[_0x0baf('0x3a')](db[_0x0baf('0x61')]['rawAttributes']);_0xb5f4e5['query']=_['keys'](_0xeecf8['query']);_0xb5f4e5[_0x0baf('0x44')]=_[_0x0baf('0x3d')](_0xb5f4e5[_0x0baf('0x39')],_0xb5f4e5[_0x0baf('0x3b')]);_0x580954['attributes']=_[_0x0baf('0x3d')](_0xb5f4e5[_0x0baf('0x39')],qs[_0x0baf('0x3e')](_0xeecf8['query'][_0x0baf('0x3e')]));_0x580954[_0x0baf('0x3c')]=_0x580954['attributes'][_0x0baf('0x3f')]?_0x580954['attributes']:_0xb5f4e5[_0x0baf('0x39')];_0x580954[_0x0baf('0x5f')]=qs[_0x0baf('0x42')](_0xeecf8[_0x0baf('0x3b')]['sort']);_0x580954['where']=qs[_0x0baf('0x44')](_['pick'](_0xeecf8[_0x0baf('0x3b')],_0xb5f4e5[_0x0baf('0x44')]));if(_0xeecf8[_0x0baf('0x3b')][_0x0baf('0x46')]){_0x580954[_0x0baf('0x43')]=_['merge'](_0x580954[_0x0baf('0x43')],{'$or':_['map'](_0x580954[_0x0baf('0x3c')],function(_0x5e94c5){var _0x25032f={};_0x25032f[_0x5e94c5]={'$like':'%'+_0xeecf8['query'][_0x0baf('0x46')]+'%'};return _0x25032f;})});}_0x580954=_[_0x0baf('0x47')]({},_0x580954,_0xeecf8[_0x0baf('0x4d')]);return _0x5a2454['getTags'](_0x580954);}})['then'](function(_0xf12b36){if(_0xf12b36){_0x477cd5=_0xf12b36[_0x0baf('0x3f')];if(!_0xeecf8[_0x0baf('0x3b')][_0x0baf('0x5a')](_0x0baf('0x40'))){_0x580954[_0x0baf('0x41')]=qs['limit'](_0xeecf8[_0x0baf('0x3b')]['limit']);_0x580954[_0x0baf('0x2c')]=qs['offset'](_0xeecf8[_0x0baf('0x3b')][_0x0baf('0x2c')]);}return _0x5a2454[_0x0baf('0x60')](_0x580954);}})['then'](function(_0xac266e){if(_0xac266e){return _0xac266e?{'count':_0x477cd5,'rows':_0xac266e}:null;}})[_0x0baf('0x1f')](respondWithResult(_0x102c02,null))['catch'](handleError(_0x102c02,null));};exports['setTags']=function(_0x3394ee,_0xbb5a43,_0x20dd04){if(_0x3394ee[_0x0baf('0x57')]['id']){delete _0x3394ee['body']['id'];}return db['ZendeskConfiguration'][_0x0baf('0x5c')]({'where':{'id':_0x3394ee[_0x0baf('0x54')]['id']}})[_0x0baf('0x1f')](handleEntityNotFound(_0xbb5a43,null))[_0x0baf('0x1f')](function(_0xfc91ce){if(_0xfc91ce){return _0xfc91ce[_0x0baf('0x62')](_0x3394ee[_0x0baf('0x57')][_0x0baf('0x63')]||[]);}return null;})[_0x0baf('0x1f')](respondWithResult(_0xbb5a43,null))[_0x0baf('0x52')](handleError(_0xbb5a43,null));}; \ No newline at end of file +var _0x1eba=['sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','jayson/promise','client','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','status','end','count','offset','limit','set','Content-Range','json','reject','save','update','then','stack','name','send','index','ZendeskConfiguration','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','map','type','key','VIRTUAL','field','options','includeAll','include','findAll','rows','show','params','find','create','body','destroy','getFields','ZendeskField','nolimit','getSubjects','findOne','getDescriptions','getTags','Tag','setTags','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path'];(function(_0x58e267,_0x3d34e3){var _0x20eede=function(_0x33f144){while(--_0x33f144){_0x58e267['push'](_0x58e267['shift']());}};_0x20eede(++_0x3d34e3);}(_0x1eba,0x1d7));var _0xa1eb=function(_0x50cd41,_0x4874a7){_0x50cd41=_0x50cd41-0x0;var _0x399475=_0x1eba[_0x50cd41];return _0x399475;};'use strict';var pdf=require(_0xa1eb('0x0'));var emlformat=require(_0xa1eb('0x1'));var rimraf=require(_0xa1eb('0x2'));var zipdir=require(_0xa1eb('0x3'));var jsonpatch=require(_0xa1eb('0x4'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xa1eb('0x5'));var Mustache=require(_0xa1eb('0x6'));var util=require(_0xa1eb('0x7'));var path=require(_0xa1eb('0x8'));var sox=require(_0xa1eb('0x9'));var csv=require(_0xa1eb('0xa'));var ejs=require(_0xa1eb('0xb'));var fs=require('fs');var _=require(_0xa1eb('0xc'));var squel=require(_0xa1eb('0xd'));var crypto=require(_0xa1eb('0xe'));var jsforce=require(_0xa1eb('0xf'));var deskjs=require(_0xa1eb('0x10'));var toCsv=require('to-csv');var querystring=require(_0xa1eb('0x11'));var Papa=require('papaparse');var Redis=require(_0xa1eb('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xa1eb('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa1eb('0x14'));var logger=require('../../config/logger')(_0xa1eb('0x15'));var utils=require(_0xa1eb('0x16'));var config=require(_0xa1eb('0x17'));var db=require('../../mysqldb')['db'];var jayson=require(_0xa1eb('0x18'));var client=jayson[_0xa1eb('0x19')]['http']({'port':0x232a});function checkPasswordPattern(_0x16a623,_0x4a3774,_0x4e65dc){if(_0x4e65dc){var _0x35a353=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x35a353['test'](_0x4a3774)){return _0x16a623;}else{throw new Error(_0xa1eb('0x1a'));}}else{return _0x16a623;}}function respondWithRpcPromise(_0x2178e2,_0x14e048,_0x2877cb,_0x3cd675){return new BPromise(function(_0x44f37d,_0x1c858c){var _0x45d6dd=_0x3cd675||client;return _0x45d6dd[_0xa1eb('0x1b')](_0x2178e2,_0x2877cb)['then'](function(_0xbd6a6b){logger['info'](_0xa1eb('0x1c'),_0x14e048,_0xa1eb('0x1d'));logger[_0xa1eb('0x1e')](_0xa1eb('0x1f'),_0x14e048,'request\x20sent',JSON[_0xa1eb('0x20')](_0xbd6a6b));if(_0xbd6a6b[_0xa1eb('0x21')]){if(_0xbd6a6b[_0xa1eb('0x21')][_0xa1eb('0x22')]===0x1f4){logger[_0xa1eb('0x21')](_0xa1eb('0x1c'),_0x14e048,_0xbd6a6b[_0xa1eb('0x21')][_0xa1eb('0x23')]);return _0x1c858c(_0xbd6a6b['error'][_0xa1eb('0x23')]);}logger['error'](_0xa1eb('0x1c'),_0x14e048,_0xbd6a6b[_0xa1eb('0x21')][_0xa1eb('0x23')]);return _0x44f37d(_0xbd6a6b[_0xa1eb('0x21')]['message']);}else{logger['info'](_0xa1eb('0x1c'),_0x14e048,_0xa1eb('0x1d'));_0x44f37d(_0xbd6a6b['result'][_0xa1eb('0x23')]);}})[_0xa1eb('0x24')](function(_0x258d3a){logger[_0xa1eb('0x21')](_0xa1eb('0x1c'),_0x14e048,_0x258d3a);_0x1c858c(_0x258d3a);});});}function respondWithStatusCode(_0x1c59e1,_0x33271e){_0x33271e=_0x33271e||0xcc;return function(_0x364b1c){if(_0x364b1c){return _0x1c59e1[_0xa1eb('0x25')](_0x33271e);}return _0x1c59e1[_0xa1eb('0x26')](_0x33271e)[_0xa1eb('0x27')]();};}function respondWithResult(_0x208844,_0x57d089){_0x57d089=_0x57d089||0xc8;return function(_0x7c617e){if(_0x7c617e){return _0x208844[_0xa1eb('0x26')](_0x57d089)['json'](_0x7c617e);}};}function respondWithFilteredResult(_0x2680c0,_0x4e2aa7){return function(_0x3aae71){if(_0x3aae71){var _0x2d31d1=_0x3aae71[_0xa1eb('0x28')],_0x53a890=_0x4e2aa7['offset'],_0x45ff0d=_0x4e2aa7[_0xa1eb('0x29')]+_0x4e2aa7[_0xa1eb('0x2a')],_0x1581ee;if(_0x45ff0d>=_0x2d31d1){_0x45ff0d=_0x2d31d1;_0x1581ee=0xc8;}else{_0x1581ee=0xce;}_0x2680c0['status'](_0x1581ee);return _0x2680c0[_0xa1eb('0x2b')](_0xa1eb('0x2c'),_0x53a890+'-'+_0x45ff0d+'/'+_0x2d31d1)[_0xa1eb('0x2d')](_0x3aae71);}return null;};}function patchUpdates(_0x2e281a){return function(_0x5a6544){try{jsonpatch['apply'](_0x5a6544,_0x2e281a,!![]);}catch(_0x9d49d8){return BPromise[_0xa1eb('0x2e')](_0x9d49d8);}return _0x5a6544[_0xa1eb('0x2f')]();};}function saveUpdates(_0x2ae21d,_0x383e26){return function(_0xcd9efd){if(_0xcd9efd){return _0xcd9efd[_0xa1eb('0x30')](_0x2ae21d)[_0xa1eb('0x31')](function(_0x254727){return _0x254727;});}return null;};}function removeEntity(_0x2e2cdb,_0x4345a3){return function(_0x4fdba4){if(_0x4fdba4){return _0x4fdba4['destroy']()[_0xa1eb('0x31')](function(){_0x2e2cdb[_0xa1eb('0x26')](0xcc)[_0xa1eb('0x27')]();});}};}function handleEntityNotFound(_0x36cc2a,_0x2b345a){return function(_0x58d336){if(!_0x58d336){_0x36cc2a['sendStatus'](0x194);}return _0x58d336;};}function handleError(_0x151446,_0x2d2890){_0x2d2890=_0x2d2890||0x1f4;return function(_0x516c14){logger['error'](_0x516c14[_0xa1eb('0x32')]);if(_0x516c14['name']){delete _0x516c14[_0xa1eb('0x33')];}_0x151446['status'](_0x2d2890)[_0xa1eb('0x34')](_0x516c14);};}exports[_0xa1eb('0x35')]=function(_0x229931,_0x57355f){var _0x355839={},_0x3d59b9={},_0x35ed30={'count':0x0,'rows':[]};var _0x481405=db[_0xa1eb('0x36')][_0xa1eb('0x37')];_0x3d59b9[_0xa1eb('0x38')]=_[_0xa1eb('0x39')](_0x481405);_0x3d59b9[_0xa1eb('0x3a')]=_['keys'](_0x229931[_0xa1eb('0x3a')]);_0x3d59b9[_0xa1eb('0x3b')]=_[_0xa1eb('0x3c')](_0x3d59b9[_0xa1eb('0x38')],_0x3d59b9[_0xa1eb('0x3a')]);_0x355839[_0xa1eb('0x3d')]=_[_0xa1eb('0x3c')](_0x3d59b9[_0xa1eb('0x38')],qs['fields'](_0x229931[_0xa1eb('0x3a')][_0xa1eb('0x3e')]));_0x355839[_0xa1eb('0x3d')]=_0x355839[_0xa1eb('0x3d')][_0xa1eb('0x3f')]?_0x355839['attributes']:_0x3d59b9[_0xa1eb('0x38')];if(!_0x229931[_0xa1eb('0x3a')][_0xa1eb('0x40')]('nolimit')){_0x355839[_0xa1eb('0x2a')]=qs[_0xa1eb('0x2a')](_0x229931[_0xa1eb('0x3a')][_0xa1eb('0x2a')]);_0x355839[_0xa1eb('0x29')]=qs[_0xa1eb('0x29')](_0x229931[_0xa1eb('0x3a')]['offset']);}_0x355839[_0xa1eb('0x41')]=qs[_0xa1eb('0x42')](_0x229931['query'][_0xa1eb('0x42')]);_0x355839['where']=qs[_0xa1eb('0x3b')](_[_0xa1eb('0x43')](_0x229931[_0xa1eb('0x3a')],_0x3d59b9[_0xa1eb('0x3b')]));if(_0x229931[_0xa1eb('0x3a')][_0xa1eb('0x44')]){_0x355839[_0xa1eb('0x45')]=_[_0xa1eb('0x46')](_0x355839[_0xa1eb('0x45')],{'$or':_[_0xa1eb('0x47')](_0x481405,function(_0xd5b217){if(_0xd5b217[_0xa1eb('0x48')][_0xa1eb('0x49')]!==_0xa1eb('0x4a')){var _0x14c4cd={};_0x14c4cd[_0xd5b217[_0xa1eb('0x4b')]]={'$like':'%'+_0x229931['query'][_0xa1eb('0x44')]+'%'};return _0x14c4cd;}})});}_0x355839=_['merge']({},_0x355839,_0x229931[_0xa1eb('0x4c')]);var _0x112799={'where':_0x355839['where']};return db['ZendeskConfiguration'][_0xa1eb('0x28')](_0x112799)[_0xa1eb('0x31')](function(_0x27e96f){_0x35ed30['count']=_0x27e96f;if(_0x229931[_0xa1eb('0x3a')][_0xa1eb('0x4d')]){_0x355839[_0xa1eb('0x4e')]=[{'all':!![]}];}return db[_0xa1eb('0x36')][_0xa1eb('0x4f')](_0x355839);})[_0xa1eb('0x31')](function(_0x21ce06){_0x35ed30[_0xa1eb('0x50')]=_0x21ce06;return _0x35ed30;})[_0xa1eb('0x31')](respondWithFilteredResult(_0x57355f,_0x355839))[_0xa1eb('0x24')](handleError(_0x57355f,null));};exports[_0xa1eb('0x51')]=function(_0x393f95,_0x39d3c6){var _0x10e15a={'raw':![],'where':{'id':_0x393f95[_0xa1eb('0x52')]['id']}},_0x50df09={};_0x50df09[_0xa1eb('0x38')]=_[_0xa1eb('0x39')](db[_0xa1eb('0x36')][_0xa1eb('0x37')]);_0x50df09[_0xa1eb('0x3a')]=_[_0xa1eb('0x39')](_0x393f95['query']);_0x50df09[_0xa1eb('0x3b')]=_[_0xa1eb('0x3c')](_0x50df09[_0xa1eb('0x38')],_0x50df09[_0xa1eb('0x3a')]);_0x10e15a[_0xa1eb('0x3d')]=_[_0xa1eb('0x3c')](_0x50df09[_0xa1eb('0x38')],qs[_0xa1eb('0x3e')](_0x393f95[_0xa1eb('0x3a')]['fields']));_0x10e15a[_0xa1eb('0x3d')]=_0x10e15a['attributes'][_0xa1eb('0x3f')]?_0x10e15a['attributes']:_0x50df09[_0xa1eb('0x38')];if(_0x393f95[_0xa1eb('0x3a')][_0xa1eb('0x4d')]){_0x10e15a['include']=[{'all':!![]}];}_0x10e15a=_[_0xa1eb('0x46')]({},_0x10e15a,_0x393f95[_0xa1eb('0x4c')]);return db['ZendeskConfiguration'][_0xa1eb('0x53')](_0x10e15a)[_0xa1eb('0x31')](handleEntityNotFound(_0x39d3c6,null))[_0xa1eb('0x31')](respondWithResult(_0x39d3c6,null))[_0xa1eb('0x24')](handleError(_0x39d3c6,null));};exports[_0xa1eb('0x54')]=function(_0x2b27c7,_0x305202){return db[_0xa1eb('0x36')][_0xa1eb('0x54')](_0x2b27c7[_0xa1eb('0x55')],{})[_0xa1eb('0x31')](respondWithResult(_0x305202,0xc9))[_0xa1eb('0x24')](handleError(_0x305202,null));};exports[_0xa1eb('0x30')]=function(_0x260c4a,_0x40f119){if(_0x260c4a[_0xa1eb('0x55')]['id']){delete _0x260c4a[_0xa1eb('0x55')]['id'];}return db['ZendeskConfiguration'][_0xa1eb('0x53')]({'where':{'id':_0x260c4a[_0xa1eb('0x52')]['id']}})[_0xa1eb('0x31')](handleEntityNotFound(_0x40f119,null))[_0xa1eb('0x31')](saveUpdates(_0x260c4a[_0xa1eb('0x55')],null))[_0xa1eb('0x31')](respondWithResult(_0x40f119,null))['catch'](handleError(_0x40f119,null));};exports[_0xa1eb('0x56')]=function(_0x3c7712,_0x217ecb){return db[_0xa1eb('0x36')][_0xa1eb('0x53')]({'where':{'id':_0x3c7712[_0xa1eb('0x52')]['id']}})[_0xa1eb('0x31')](handleEntityNotFound(_0x217ecb,null))['then'](removeEntity(_0x217ecb,null))[_0xa1eb('0x24')](handleError(_0x217ecb,null));};exports[_0xa1eb('0x57')]=function(_0x378726,_0x1c8fd0,_0x4c30ad){var _0x5af1e6={};var _0x58ca4e={};var _0x5673fa;var _0x1b3c33;return db[_0xa1eb('0x36')]['findOne']({'where':{'id':_0x378726[_0xa1eb('0x52')]['id']}})[_0xa1eb('0x31')](handleEntityNotFound(_0x1c8fd0,null))[_0xa1eb('0x31')](function(_0x167be2){if(_0x167be2){_0x5673fa=_0x167be2;_0x58ca4e['model']=_['keys'](db[_0xa1eb('0x58')][_0xa1eb('0x37')]);_0x58ca4e[_0xa1eb('0x3a')]=_[_0xa1eb('0x39')](_0x378726[_0xa1eb('0x3a')]);_0x58ca4e[_0xa1eb('0x3b')]=_['intersection'](_0x58ca4e['model'],_0x58ca4e[_0xa1eb('0x3a')]);_0x5af1e6['attributes']=_[_0xa1eb('0x3c')](_0x58ca4e['model'],qs[_0xa1eb('0x3e')](_0x378726[_0xa1eb('0x3a')]['fields']));_0x5af1e6[_0xa1eb('0x3d')]=_0x5af1e6[_0xa1eb('0x3d')]['length']?_0x5af1e6[_0xa1eb('0x3d')]:_0x58ca4e[_0xa1eb('0x38')];_0x5af1e6[_0xa1eb('0x41')]=qs['sort'](_0x378726[_0xa1eb('0x3a')][_0xa1eb('0x42')]);_0x5af1e6['where']=qs[_0xa1eb('0x3b')](_[_0xa1eb('0x43')](_0x378726[_0xa1eb('0x3a')],_0x58ca4e['filters']));if(_0x378726[_0xa1eb('0x3a')]['filter']){_0x5af1e6[_0xa1eb('0x45')]=_[_0xa1eb('0x46')](_0x5af1e6[_0xa1eb('0x45')],{'$or':_[_0xa1eb('0x47')](_0x5af1e6[_0xa1eb('0x3d')],function(_0x48f49d){var _0x2aba03={};_0x2aba03[_0x48f49d]={'$like':'%'+_0x378726[_0xa1eb('0x3a')][_0xa1eb('0x44')]+'%'};return _0x2aba03;})});}_0x5af1e6=_['merge']({},_0x5af1e6,_0x378726[_0xa1eb('0x4c')]);return _0x5673fa['getFields'](_0x5af1e6);}})['then'](function(_0x4e5e70){if(_0x4e5e70){_0x1b3c33=_0x4e5e70['length'];if(!_0x378726[_0xa1eb('0x3a')][_0xa1eb('0x40')](_0xa1eb('0x59'))){_0x5af1e6[_0xa1eb('0x2a')]=qs[_0xa1eb('0x2a')](_0x378726[_0xa1eb('0x3a')][_0xa1eb('0x2a')]);_0x5af1e6[_0xa1eb('0x29')]=qs[_0xa1eb('0x29')](_0x378726[_0xa1eb('0x3a')]['offset']);}return _0x5673fa[_0xa1eb('0x57')](_0x5af1e6);}})[_0xa1eb('0x31')](function(_0x46207c){if(_0x46207c){return _0x46207c?{'count':_0x1b3c33,'rows':_0x46207c}:null;}})[_0xa1eb('0x31')](respondWithResult(_0x1c8fd0,null))[_0xa1eb('0x24')](handleError(_0x1c8fd0,null));};exports[_0xa1eb('0x5a')]=function(_0x4bf3c9,_0x113a3a,_0x2b6996){var _0x16c5a3={};var _0x58147f={};var _0x1434a1;var _0x11a74e;return db[_0xa1eb('0x36')][_0xa1eb('0x5b')]({'where':{'id':_0x4bf3c9[_0xa1eb('0x52')]['id']}})['then'](handleEntityNotFound(_0x113a3a,null))[_0xa1eb('0x31')](function(_0x50eff6){if(_0x50eff6){_0x1434a1=_0x50eff6;_0x58147f[_0xa1eb('0x38')]=_['keys'](db[_0xa1eb('0x58')][_0xa1eb('0x37')]);_0x58147f[_0xa1eb('0x3a')]=_[_0xa1eb('0x39')](_0x4bf3c9['query']);_0x58147f[_0xa1eb('0x3b')]=_[_0xa1eb('0x3c')](_0x58147f[_0xa1eb('0x38')],_0x58147f[_0xa1eb('0x3a')]);_0x16c5a3['attributes']=_[_0xa1eb('0x3c')](_0x58147f[_0xa1eb('0x38')],qs[_0xa1eb('0x3e')](_0x4bf3c9[_0xa1eb('0x3a')][_0xa1eb('0x3e')]));_0x16c5a3[_0xa1eb('0x3d')]=_0x16c5a3[_0xa1eb('0x3d')][_0xa1eb('0x3f')]?_0x16c5a3[_0xa1eb('0x3d')]:_0x58147f['model'];_0x16c5a3['order']=qs['sort'](_0x4bf3c9[_0xa1eb('0x3a')]['sort']);_0x16c5a3[_0xa1eb('0x45')]=qs[_0xa1eb('0x3b')](_['pick'](_0x4bf3c9['query'],_0x58147f[_0xa1eb('0x3b')]));if(_0x4bf3c9[_0xa1eb('0x3a')][_0xa1eb('0x44')]){_0x16c5a3[_0xa1eb('0x45')]=_[_0xa1eb('0x46')](_0x16c5a3['where'],{'$or':_['map'](_0x16c5a3[_0xa1eb('0x3d')],function(_0x212e57){var _0x1befa3={};_0x1befa3[_0x212e57]={'$like':'%'+_0x4bf3c9[_0xa1eb('0x3a')]['filter']+'%'};return _0x1befa3;})});}_0x16c5a3=_[_0xa1eb('0x46')]({},_0x16c5a3,_0x4bf3c9[_0xa1eb('0x4c')]);return _0x1434a1[_0xa1eb('0x5a')](_0x16c5a3);}})[_0xa1eb('0x31')](function(_0x3863ce){if(_0x3863ce){_0x11a74e=_0x3863ce[_0xa1eb('0x3f')];if(!_0x4bf3c9[_0xa1eb('0x3a')][_0xa1eb('0x40')](_0xa1eb('0x59'))){_0x16c5a3[_0xa1eb('0x2a')]=qs[_0xa1eb('0x2a')](_0x4bf3c9['query'][_0xa1eb('0x2a')]);_0x16c5a3[_0xa1eb('0x29')]=qs[_0xa1eb('0x29')](_0x4bf3c9[_0xa1eb('0x3a')][_0xa1eb('0x29')]);}return _0x1434a1[_0xa1eb('0x5a')](_0x16c5a3);}})['then'](function(_0x3da7ba){if(_0x3da7ba){return _0x3da7ba?{'count':_0x11a74e,'rows':_0x3da7ba}:null;}})[_0xa1eb('0x31')](respondWithResult(_0x113a3a,null))[_0xa1eb('0x24')](handleError(_0x113a3a,null));};exports[_0xa1eb('0x5c')]=function(_0x553cd3,_0x4e24dc,_0xff1843){var _0x5e0cd5={};var _0x2bd903={};var _0x2ca83a;var _0x518261;return db[_0xa1eb('0x36')][_0xa1eb('0x5b')]({'where':{'id':_0x553cd3['params']['id']}})[_0xa1eb('0x31')](handleEntityNotFound(_0x4e24dc,null))[_0xa1eb('0x31')](function(_0x3dc3bf){if(_0x3dc3bf){_0x2ca83a=_0x3dc3bf;_0x2bd903[_0xa1eb('0x38')]=_[_0xa1eb('0x39')](db[_0xa1eb('0x58')][_0xa1eb('0x37')]);_0x2bd903[_0xa1eb('0x3a')]=_[_0xa1eb('0x39')](_0x553cd3[_0xa1eb('0x3a')]);_0x2bd903[_0xa1eb('0x3b')]=_['intersection'](_0x2bd903[_0xa1eb('0x38')],_0x2bd903[_0xa1eb('0x3a')]);_0x5e0cd5[_0xa1eb('0x3d')]=_[_0xa1eb('0x3c')](_0x2bd903['model'],qs[_0xa1eb('0x3e')](_0x553cd3[_0xa1eb('0x3a')][_0xa1eb('0x3e')]));_0x5e0cd5['attributes']=_0x5e0cd5[_0xa1eb('0x3d')][_0xa1eb('0x3f')]?_0x5e0cd5[_0xa1eb('0x3d')]:_0x2bd903['model'];_0x5e0cd5[_0xa1eb('0x41')]=qs['sort'](_0x553cd3[_0xa1eb('0x3a')][_0xa1eb('0x42')]);_0x5e0cd5[_0xa1eb('0x45')]=qs[_0xa1eb('0x3b')](_[_0xa1eb('0x43')](_0x553cd3[_0xa1eb('0x3a')],_0x2bd903[_0xa1eb('0x3b')]));if(_0x553cd3[_0xa1eb('0x3a')]['filter']){_0x5e0cd5[_0xa1eb('0x45')]=_[_0xa1eb('0x46')](_0x5e0cd5[_0xa1eb('0x45')],{'$or':_[_0xa1eb('0x47')](_0x5e0cd5[_0xa1eb('0x3d')],function(_0x4d4df8){var _0x140475={};_0x140475[_0x4d4df8]={'$like':'%'+_0x553cd3[_0xa1eb('0x3a')]['filter']+'%'};return _0x140475;})});}_0x5e0cd5=_[_0xa1eb('0x46')]({},_0x5e0cd5,_0x553cd3['options']);return _0x2ca83a['getDescriptions'](_0x5e0cd5);}})[_0xa1eb('0x31')](function(_0x22f25d){if(_0x22f25d){_0x518261=_0x22f25d['length'];if(!_0x553cd3[_0xa1eb('0x3a')][_0xa1eb('0x40')]('nolimit')){_0x5e0cd5[_0xa1eb('0x2a')]=qs[_0xa1eb('0x2a')](_0x553cd3['query']['limit']);_0x5e0cd5[_0xa1eb('0x29')]=qs['offset'](_0x553cd3[_0xa1eb('0x3a')][_0xa1eb('0x29')]);}return _0x2ca83a[_0xa1eb('0x5c')](_0x5e0cd5);}})[_0xa1eb('0x31')](function(_0xbd4753){if(_0xbd4753){return _0xbd4753?{'count':_0x518261,'rows':_0xbd4753}:null;}})[_0xa1eb('0x31')](respondWithResult(_0x4e24dc,null))['catch'](handleError(_0x4e24dc,null));};exports[_0xa1eb('0x5d')]=function(_0x55470e,_0x30107f,_0x1ecc9c){var _0x3ca0ee={};var _0x3f1b4e={};var _0x9e3ad9;var _0x2e85dd;return db[_0xa1eb('0x36')]['findOne']({'where':{'id':_0x55470e[_0xa1eb('0x52')]['id']}})['then'](handleEntityNotFound(_0x30107f,null))['then'](function(_0x44d29c){if(_0x44d29c){_0x9e3ad9=_0x44d29c;_0x3f1b4e[_0xa1eb('0x38')]=_[_0xa1eb('0x39')](db[_0xa1eb('0x5e')][_0xa1eb('0x37')]);_0x3f1b4e[_0xa1eb('0x3a')]=_['keys'](_0x55470e[_0xa1eb('0x3a')]);_0x3f1b4e['filters']=_[_0xa1eb('0x3c')](_0x3f1b4e['model'],_0x3f1b4e[_0xa1eb('0x3a')]);_0x3ca0ee[_0xa1eb('0x3d')]=_['intersection'](_0x3f1b4e['model'],qs[_0xa1eb('0x3e')](_0x55470e[_0xa1eb('0x3a')][_0xa1eb('0x3e')]));_0x3ca0ee[_0xa1eb('0x3d')]=_0x3ca0ee[_0xa1eb('0x3d')][_0xa1eb('0x3f')]?_0x3ca0ee[_0xa1eb('0x3d')]:_0x3f1b4e[_0xa1eb('0x38')];_0x3ca0ee[_0xa1eb('0x41')]=qs[_0xa1eb('0x42')](_0x55470e[_0xa1eb('0x3a')][_0xa1eb('0x42')]);_0x3ca0ee[_0xa1eb('0x45')]=qs[_0xa1eb('0x3b')](_[_0xa1eb('0x43')](_0x55470e['query'],_0x3f1b4e[_0xa1eb('0x3b')]));if(_0x55470e[_0xa1eb('0x3a')]['filter']){_0x3ca0ee[_0xa1eb('0x45')]=_['merge'](_0x3ca0ee[_0xa1eb('0x45')],{'$or':_[_0xa1eb('0x47')](_0x3ca0ee[_0xa1eb('0x3d')],function(_0x5b0200){var _0x43aed4={};_0x43aed4[_0x5b0200]={'$like':'%'+_0x55470e[_0xa1eb('0x3a')][_0xa1eb('0x44')]+'%'};return _0x43aed4;})});}_0x3ca0ee=_[_0xa1eb('0x46')]({},_0x3ca0ee,_0x55470e['options']);return _0x9e3ad9[_0xa1eb('0x5d')](_0x3ca0ee);}})['then'](function(_0x42e9de){if(_0x42e9de){_0x2e85dd=_0x42e9de[_0xa1eb('0x3f')];if(!_0x55470e[_0xa1eb('0x3a')][_0xa1eb('0x40')](_0xa1eb('0x59'))){_0x3ca0ee[_0xa1eb('0x2a')]=qs[_0xa1eb('0x2a')](_0x55470e[_0xa1eb('0x3a')]['limit']);_0x3ca0ee[_0xa1eb('0x29')]=qs[_0xa1eb('0x29')](_0x55470e[_0xa1eb('0x3a')][_0xa1eb('0x29')]);}return _0x9e3ad9[_0xa1eb('0x5d')](_0x3ca0ee);}})[_0xa1eb('0x31')](function(_0x215d28){if(_0x215d28){return _0x215d28?{'count':_0x2e85dd,'rows':_0x215d28}:null;}})[_0xa1eb('0x31')](respondWithResult(_0x30107f,null))[_0xa1eb('0x24')](handleError(_0x30107f,null));};exports[_0xa1eb('0x5f')]=function(_0x2c4b81,_0x365c97,_0x27ffef){if(_0x2c4b81[_0xa1eb('0x55')]['id']){delete _0x2c4b81['body']['id'];}return db[_0xa1eb('0x36')][_0xa1eb('0x5b')]({'where':{'id':_0x2c4b81['params']['id']}})['then'](handleEntityNotFound(_0x365c97,null))[_0xa1eb('0x31')](function(_0x106dd9){if(_0x106dd9){return _0x106dd9[_0xa1eb('0x5f')](_0x2c4b81[_0xa1eb('0x55')]['ids']||[]);}return null;})[_0xa1eb('0x31')](respondWithResult(_0x365c97,null))['catch'](handleError(_0x365c97,null));}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js index bce495c..60d568f 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 _0x0535=['exports','define','ZendeskConfiguration','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./intZendeskConfiguration.attributes'];(function(_0x3d0e28,_0x365e96){var _0x4b64f8=function(_0x20cfb0){while(--_0x20cfb0){_0x3d0e28['push'](_0x3d0e28['shift']());}};_0x4b64f8(++_0x365e96);}(_0x0535,0x1e4));var _0x5053=function(_0x5c8a5b,_0x517317){_0x5c8a5b=_0x5c8a5b-0x0;var _0x5df24d=_0x0535[_0x5c8a5b];return _0x5df24d;};'use strict';var _=require(_0x5053('0x0'));var util=require(_0x5053('0x1'));var logger=require(_0x5053('0x2'))(_0x5053('0x3'));var moment=require('moment');var BPromise=require(_0x5053('0x4'));var rp=require(_0x5053('0x5'));var fs=require('fs');var path=require(_0x5053('0x6'));var rimraf=require(_0x5053('0x7'));var config=require(_0x5053('0x8'));var attributes=require(_0x5053('0x9'));module[_0x5053('0xa')]=function(_0xf04d9,_0xccc2ea){return _0xf04d9[_0x5053('0xb')](_0x5053('0xc'),attributes,{'tableName':'int_zendesk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x176c=['exports','define','ZendeskConfiguration','lodash','util','../../config/logger','bluebird','request-promise'];(function(_0x365ee9,_0x11ad54){var _0x3e4037=function(_0x1901a5){while(--_0x1901a5){_0x365ee9['push'](_0x365ee9['shift']());}};_0x3e4037(++_0x11ad54);}(_0x176c,0x73));var _0xc176=function(_0xe4d7d0,_0x3ebcc5){_0xe4d7d0=_0xe4d7d0-0x0;var _0x33b238=_0x176c[_0xe4d7d0];return _0x33b238;};'use strict';var _=require(_0xc176('0x0'));var util=require(_0xc176('0x1'));var logger=require(_0xc176('0x2'))('api');var moment=require('moment');var BPromise=require(_0xc176('0x3'));var rp=require(_0xc176('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./intZendeskConfiguration.attributes');module[_0xc176('0x5')]=function(_0x6f428,_0x13777d){return _0x6f428[_0xc176('0x6')](_0xc176('0x7'),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 c91e8d6..9b7c0cb 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 _0x6cd7=['../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x5f1391,_0x19c132){var _0x50ebe3=function(_0x3d00a3){while(--_0x3d00a3){_0x5f1391['push'](_0x5f1391['shift']());}};_0x50ebe3(++_0x19c132);}(_0x6cd7,0x10b));var _0x76cd=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0x6cd7[_0x413feb];return _0x40ee88;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x76cd('0x0'));var BPromise=require(_0x76cd('0x1'));var rs=require(_0x76cd('0x2'));var fs=require('fs');var Redis=require(_0x76cd('0x3'));var db=require(_0x76cd('0x4'))['db'];var utils=require(_0x76cd('0x5'));var logger=require(_0x76cd('0x6'))(_0x76cd('0x7'));var config=require(_0x76cd('0x8'));var jayson=require(_0x76cd('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x62e016,_0xddb167,_0x4be0dc){return new BPromise(function(_0x1a104e,_0x4f15ea){return client[_0x76cd('0xa')](_0x62e016,_0x4be0dc)[_0x76cd('0xb')](function(_0x5be873){logger[_0x76cd('0xc')](_0x76cd('0xd'),_0xddb167,_0x76cd('0xe'));logger[_0x76cd('0xf')]('ZendeskConfiguration,\x20%s,\x20%s,\x20%s',_0xddb167,'request\x20sent',JSON[_0x76cd('0x10')](_0x5be873));if(_0x5be873[_0x76cd('0x11')]){if(_0x5be873['error'][_0x76cd('0x12')]===0x1f4){logger[_0x76cd('0x11')](_0x76cd('0xd'),_0xddb167,_0x5be873[_0x76cd('0x11')][_0x76cd('0x13')]);return _0x4f15ea(_0x5be873[_0x76cd('0x11')][_0x76cd('0x13')]);}logger[_0x76cd('0x11')]('ZendeskConfiguration,\x20%s,\x20%s',_0xddb167,_0x5be873[_0x76cd('0x11')][_0x76cd('0x13')]);return _0x1a104e(_0x5be873[_0x76cd('0x11')]['message']);}else{logger['info'](_0x76cd('0xd'),_0xddb167,_0x76cd('0xe'));_0x1a104e(_0x5be873['result'][_0x76cd('0x13')]);}})[_0x76cd('0x14')](function(_0x171c81){logger[_0x76cd('0x11')](_0x76cd('0xd'),_0xddb167,_0x171c81);_0x4f15ea(_0x171c81);});});} \ No newline at end of file +var _0x141d=['then','info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','error','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request'];(function(_0x4557ef,_0x407652){var _0x4a2c82=function(_0x2aeddf){while(--_0x2aeddf){_0x4557ef['push'](_0x4557ef['shift']());}};_0x4a2c82(++_0x407652);}(_0x141d,0x198));var _0xd141=function(_0x3b5250,_0x7a0b2c){_0x3b5250=_0x3b5250-0x0;var _0xc844a1=_0x141d[_0x3b5250];return _0xc844a1;};'use strict';var _=require(_0xd141('0x0'));var util=require(_0xd141('0x1'));var moment=require(_0xd141('0x2'));var BPromise=require('bluebird');var rs=require(_0xd141('0x3'));var fs=require('fs');var Redis=require(_0xd141('0x4'));var db=require(_0xd141('0x5'))['db'];var utils=require(_0xd141('0x6'));var logger=require(_0xd141('0x7'))(_0xd141('0x8'));var config=require('../../config/environment');var jayson=require(_0xd141('0x9'));var client=jayson[_0xd141('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x13253a,_0x257336,_0x2e6793){return new BPromise(function(_0x1a410a,_0x45c3c5){return client[_0xd141('0xb')](_0x13253a,_0x2e6793)[_0xd141('0xc')](function(_0x5bb2a4){logger[_0xd141('0xd')](_0xd141('0xe'),_0x257336,_0xd141('0xf'));logger['debug']('ZendeskConfiguration,\x20%s,\x20%s,\x20%s',_0x257336,'request\x20sent',JSON['stringify'](_0x5bb2a4));if(_0x5bb2a4[_0xd141('0x10')]){if(_0x5bb2a4[_0xd141('0x10')]['code']===0x1f4){logger[_0xd141('0x10')](_0xd141('0xe'),_0x257336,_0x5bb2a4[_0xd141('0x10')]['message']);return _0x45c3c5(_0x5bb2a4[_0xd141('0x10')][_0xd141('0x11')]);}logger[_0xd141('0x10')]('ZendeskConfiguration,\x20%s,\x20%s',_0x257336,_0x5bb2a4[_0xd141('0x10')]['message']);return _0x1a410a(_0x5bb2a4[_0xd141('0x10')][_0xd141('0x11')]);}else{logger[_0xd141('0xd')](_0xd141('0xe'),_0x257336,_0xd141('0xf'));_0x1a410a(_0x5bb2a4[_0xd141('0x12')][_0xd141('0x11')]);}})[_0xd141('0x13')](function(_0x51ac7d){logger[_0xd141('0x10')](_0xd141('0xe'),_0x257336,_0x51ac7d);_0x45c3c5(_0x51ac7d);});});} \ No newline at end of file diff --git a/server/api/intZendeskField/index.js b/server/api/intZendeskField/index.js index 9e2baae..a93be88 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 _0xab04=['express','Router','../../components/auth/service','../../components/interaction/service','./intZendeskField.controller','isAuthenticated','get','/:id','show','create','update','destroy','exports','multer','util','path','connect-timeout'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0xab04,0x194));var _0x4ab0=function(_0x393438,_0x4883a6){_0x393438=_0x393438-0x0;var _0x2a0986=_0xab04[_0x393438];return _0x2a0986;};'use strict';var multer=require(_0x4ab0('0x0'));var util=require(_0x4ab0('0x1'));var path=require(_0x4ab0('0x2'));var timeout=require(_0x4ab0('0x3'));var express=require(_0x4ab0('0x4'));var router=express[_0x4ab0('0x5')]();var auth=require(_0x4ab0('0x6'));var interaction=require(_0x4ab0('0x7'));var config=require('../../config/environment');var controller=require(_0x4ab0('0x8'));router['get']('/',auth[_0x4ab0('0x9')](),controller['index']);router[_0x4ab0('0xa')](_0x4ab0('0xb'),auth[_0x4ab0('0x9')](),controller[_0x4ab0('0xc')]);router['post']('/',auth[_0x4ab0('0x9')](),controller[_0x4ab0('0xd')]);router['put']('/:id',auth[_0x4ab0('0x9')](),controller[_0x4ab0('0xe')]);router['delete'](_0x4ab0('0xb'),auth[_0x4ab0('0x9')](),controller[_0x4ab0('0xf')]);module[_0x4ab0('0x10')]=router; \ No newline at end of file +var _0x6981=['isAuthenticated','index','/:id','show','post','create','put','update','delete','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','./intZendeskField.controller','get'];(function(_0x381a9f,_0xece23e){var _0x3207a2=function(_0x4ef892){while(--_0x4ef892){_0x381a9f['push'](_0x381a9f['shift']());}};_0x3207a2(++_0xece23e);}(_0x6981,0x14d));var _0x1698=function(_0x10a9b6,_0x292b64){_0x10a9b6=_0x10a9b6-0x0;var _0xdf8535=_0x6981[_0x10a9b6];return _0xdf8535;};'use strict';var multer=require(_0x1698('0x0'));var util=require(_0x1698('0x1'));var path=require(_0x1698('0x2'));var timeout=require(_0x1698('0x3'));var express=require('express');var router=express[_0x1698('0x4')]();var auth=require(_0x1698('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x1698('0x6'));var controller=require(_0x1698('0x7'));router[_0x1698('0x8')]('/',auth[_0x1698('0x9')](),controller[_0x1698('0xa')]);router[_0x1698('0x8')](_0x1698('0xb'),auth['isAuthenticated'](),controller[_0x1698('0xc')]);router[_0x1698('0xd')]('/',auth[_0x1698('0x9')](),controller[_0x1698('0xe')]);router[_0x1698('0xf')](_0x1698('0xb'),auth[_0x1698('0x9')](),controller[_0x1698('0x10')]);router[_0x1698('0x11')](_0x1698('0xb'),auth[_0x1698('0x9')](),controller['destroy']);module[_0x1698('0x12')]=router; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.attributes.js b/server/api/intZendeskField/intZendeskField.attributes.js index 5aeda09..0980be1 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 _0x21d1=['BOOLEAN','sequelize','exports','ENUM','string','variable','customVariable','STRING'];(function(_0x17bb31,_0x2fc6f8){var _0x505c71=function(_0x5013cf){while(--_0x5013cf){_0x17bb31['push'](_0x17bb31['shift']());}};_0x505c71(++_0x2fc6f8);}(_0x21d1,0x1c9));var _0x121d=function(_0x4c0297,_0x4a4892){_0x4c0297=_0x4c0297-0x0;var _0x3fc8b3=_0x21d1[_0x4c0297];return _0x3fc8b3;};'use strict';var Sequelize=require(_0x121d('0x0'));module[_0x121d('0x1')]={'type':{'type':Sequelize[_0x121d('0x2')](_0x121d('0x3'),_0x121d('0x4'),_0x121d('0x5'),'keyValue'),'defaultValue':'string'},'content':{'type':Sequelize[_0x121d('0x6')]},'key':{'type':Sequelize[_0x121d('0x6')]},'keyType':{'type':Sequelize[_0x121d('0x2')](_0x121d('0x3'),_0x121d('0x4'),'customVariable')},'keyContent':{'type':Sequelize[_0x121d('0x6')]},'idField':{'type':Sequelize[_0x121d('0x6')]},'nameField':{'type':Sequelize[_0x121d('0x6')]},'customField':{'type':Sequelize[_0x121d('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x121d('0x6')]}}; \ No newline at end of file +var _0x8eba=['sequelize','exports','string','variable','keyValue','STRING','ENUM','customVariable','BOOLEAN'];(function(_0x243481,_0x33ba56){var _0x3c7a5c=function(_0x4b07c1){while(--_0x4b07c1){_0x243481['push'](_0x243481['shift']());}};_0x3c7a5c(++_0x33ba56);}(_0x8eba,0xf3));var _0xa8eb=function(_0x498334,_0x27b6fe){_0x498334=_0x498334-0x0;var _0x13bb70=_0x8eba[_0x498334];return _0x13bb70;};'use strict';var Sequelize=require(_0xa8eb('0x0'));module[_0xa8eb('0x1')]={'type':{'type':Sequelize['ENUM'](_0xa8eb('0x2'),_0xa8eb('0x3'),'customVariable',_0xa8eb('0x4')),'defaultValue':_0xa8eb('0x2')},'content':{'type':Sequelize[_0xa8eb('0x5')]},'key':{'type':Sequelize[_0xa8eb('0x5')]},'keyType':{'type':Sequelize[_0xa8eb('0x6')]('string',_0xa8eb('0x3'),_0xa8eb('0x7'))},'keyContent':{'type':Sequelize[_0xa8eb('0x5')]},'idField':{'type':Sequelize[_0xa8eb('0x5')]},'nameField':{'type':Sequelize[_0xa8eb('0x5')]},'customField':{'type':Sequelize[_0xa8eb('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.controller.js b/server/api/intZendeskField/intZendeskField.controller.js index b113221..06ed1b3 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 _0x9d4b=['zip-dir','request-promise','moment','mustache','util','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','count','offset','limit','set','apply','save','update','then','destroy','stack','name','send','index','ZendeskField','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','key','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','include','create','body','find','eml-format','rimraf'];(function(_0x3a3b9e,_0xc59037){var _0x148103=function(_0x406731){while(--_0x406731){_0x3a3b9e['push'](_0x3a3b9e['shift']());}};_0x148103(++_0xc59037);}(_0x9d4b,0x90));var _0xb9d4=function(_0xdfe412,_0x49936b){_0xdfe412=_0xdfe412-0x0;var _0x5020fe=_0x9d4b[_0xdfe412];return _0x5020fe;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xb9d4('0x0'));var rimraf=require(_0xb9d4('0x1'));var zipdir=require(_0xb9d4('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb9d4('0x3'));var moment=require(_0xb9d4('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xb9d4('0x5'));var util=require(_0xb9d4('0x6'));var path=require('path');var sox=require(_0xb9d4('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0xb9d4('0x8'));var squel=require(_0xb9d4('0x9'));var crypto=require(_0xb9d4('0xa'));var jsforce=require(_0xb9d4('0xb'));var deskjs=require(_0xb9d4('0xc'));var toCsv=require(_0xb9d4('0xd'));var querystring=require(_0xb9d4('0xe'));var Papa=require(_0xb9d4('0xf'));var Redis=require(_0xb9d4('0x10'));var authService=require(_0xb9d4('0x11'));var qs=require(_0xb9d4('0x12'));var as=require(_0xb9d4('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb9d4('0x14'))(_0xb9d4('0x15'));var utils=require(_0xb9d4('0x16'));var config=require(_0xb9d4('0x17'));var db=require(_0xb9d4('0x18'))['db'];function respondWithStatusCode(_0x43a6f9,_0x3e48f7){_0x3e48f7=_0x3e48f7||0xcc;return function(_0x74e0ea){if(_0x74e0ea){return _0x43a6f9[_0xb9d4('0x19')](_0x3e48f7);}return _0x43a6f9['status'](_0x3e48f7)[_0xb9d4('0x1a')]();};}function respondWithResult(_0x371de4,_0x58c5e0){_0x58c5e0=_0x58c5e0||0xc8;return function(_0x29a082){if(_0x29a082){return _0x371de4[_0xb9d4('0x1b')](_0x58c5e0)[_0xb9d4('0x1c')](_0x29a082);}};}function respondWithFilteredResult(_0x299401,_0x1e5960){return function(_0x3a81b4){if(_0x3a81b4){var _0x4a61e3=_0x3a81b4[_0xb9d4('0x1d')],_0x154844=_0x1e5960[_0xb9d4('0x1e')],_0x106988=_0x1e5960['offset']+_0x1e5960[_0xb9d4('0x1f')],_0x488a7f;if(_0x106988>=_0x4a61e3){_0x106988=_0x4a61e3;_0x488a7f=0xc8;}else{_0x488a7f=0xce;}_0x299401[_0xb9d4('0x1b')](_0x488a7f);return _0x299401[_0xb9d4('0x20')]('Content-Range',_0x154844+'-'+_0x106988+'/'+_0x4a61e3)[_0xb9d4('0x1c')](_0x3a81b4);}return null;};}function patchUpdates(_0x54fabf){return function(_0x37294b){try{jsonpatch[_0xb9d4('0x21')](_0x37294b,_0x54fabf,!![]);}catch(_0x48bb68){return BPromise['reject'](_0x48bb68);}return _0x37294b[_0xb9d4('0x22')]();};}function saveUpdates(_0x1d8e2e,_0x7e4000){return function(_0x10a023){if(_0x10a023){return _0x10a023[_0xb9d4('0x23')](_0x1d8e2e)[_0xb9d4('0x24')](function(_0x563292){return _0x563292;});}return null;};}function removeEntity(_0x1811f9,_0x2d8561){return function(_0x367696){if(_0x367696){return _0x367696[_0xb9d4('0x25')]()[_0xb9d4('0x24')](function(){_0x1811f9[_0xb9d4('0x1b')](0xcc)[_0xb9d4('0x1a')]();});}};}function handleEntityNotFound(_0xb00ff,_0x3ec80c){return function(_0xc0f1c0){if(!_0xc0f1c0){_0xb00ff[_0xb9d4('0x19')](0x194);}return _0xc0f1c0;};}function handleError(_0x6cc940,_0xcf6be){_0xcf6be=_0xcf6be||0x1f4;return function(_0x8a5de2){logger['error'](_0x8a5de2[_0xb9d4('0x26')]);if(_0x8a5de2[_0xb9d4('0x27')]){delete _0x8a5de2[_0xb9d4('0x27')];}_0x6cc940[_0xb9d4('0x1b')](_0xcf6be)[_0xb9d4('0x28')](_0x8a5de2);};}exports[_0xb9d4('0x29')]=function(_0x2cdb6f,_0x3cfe31){var _0x385d51={},_0x5326f4={},_0x3c197a={'count':0x0,'rows':[]};var _0x26dc1d=db[_0xb9d4('0x2a')][_0xb9d4('0x2b')];_0x5326f4[_0xb9d4('0x2c')]=_['keys'](_0x26dc1d);_0x5326f4['query']=_[_0xb9d4('0x2d')](_0x2cdb6f[_0xb9d4('0x2e')]);_0x5326f4[_0xb9d4('0x2f')]=_[_0xb9d4('0x30')](_0x5326f4[_0xb9d4('0x2c')],_0x5326f4['query']);_0x385d51[_0xb9d4('0x31')]=_['intersection'](_0x5326f4[_0xb9d4('0x2c')],qs[_0xb9d4('0x32')](_0x2cdb6f[_0xb9d4('0x2e')][_0xb9d4('0x32')]));_0x385d51['attributes']=_0x385d51[_0xb9d4('0x31')][_0xb9d4('0x33')]?_0x385d51['attributes']:_0x5326f4['model'];if(!_0x2cdb6f[_0xb9d4('0x2e')][_0xb9d4('0x34')](_0xb9d4('0x35'))){_0x385d51[_0xb9d4('0x1f')]=qs['limit'](_0x2cdb6f[_0xb9d4('0x2e')][_0xb9d4('0x1f')]);_0x385d51[_0xb9d4('0x1e')]=qs[_0xb9d4('0x1e')](_0x2cdb6f[_0xb9d4('0x2e')][_0xb9d4('0x1e')]);}_0x385d51[_0xb9d4('0x36')]=qs[_0xb9d4('0x37')](_0x2cdb6f[_0xb9d4('0x2e')][_0xb9d4('0x37')]);_0x385d51[_0xb9d4('0x38')]=qs['filters'](_['pick'](_0x2cdb6f['query'],_0x5326f4[_0xb9d4('0x2f')]));if(_0x2cdb6f[_0xb9d4('0x2e')][_0xb9d4('0x39')]){_0x385d51['where']=_[_0xb9d4('0x3a')](_0x385d51[_0xb9d4('0x38')],{'$or':_['map'](_0x26dc1d,function(_0x54fac3){if(_0x54fac3[_0xb9d4('0x3b')][_0xb9d4('0x3c')]!==_0xb9d4('0x3d')){var _0x2d8919={};_0x2d8919[_0x54fac3['field']]={'$like':'%'+_0x2cdb6f['query']['filter']+'%'};return _0x2d8919;}})});}_0x385d51=_['merge']({},_0x385d51,_0x2cdb6f[_0xb9d4('0x3e')]);var _0x3f721b={'where':_0x385d51['where']};return db[_0xb9d4('0x2a')][_0xb9d4('0x1d')](_0x3f721b)[_0xb9d4('0x24')](function(_0x323633){_0x3c197a['count']=_0x323633;if(_0x2cdb6f[_0xb9d4('0x2e')][_0xb9d4('0x3f')]){_0x385d51['include']=[{'all':!![]}];}return db[_0xb9d4('0x2a')][_0xb9d4('0x40')](_0x385d51);})[_0xb9d4('0x24')](function(_0x466d9f){_0x3c197a[_0xb9d4('0x41')]=_0x466d9f;return _0x3c197a;})['then'](respondWithFilteredResult(_0x3cfe31,_0x385d51))[_0xb9d4('0x42')](handleError(_0x3cfe31,null));};exports[_0xb9d4('0x43')]=function(_0x3d5f38,_0x3b25fe){var _0x13ad73={'raw':!![],'where':{'id':_0x3d5f38[_0xb9d4('0x44')]['id']}},_0x2c5e8c={};_0x2c5e8c[_0xb9d4('0x2c')]=_[_0xb9d4('0x2d')](db[_0xb9d4('0x2a')][_0xb9d4('0x2b')]);_0x2c5e8c[_0xb9d4('0x2e')]=_[_0xb9d4('0x2d')](_0x3d5f38['query']);_0x2c5e8c['filters']=_[_0xb9d4('0x30')](_0x2c5e8c[_0xb9d4('0x2c')],_0x2c5e8c['query']);_0x13ad73['attributes']=_[_0xb9d4('0x30')](_0x2c5e8c[_0xb9d4('0x2c')],qs[_0xb9d4('0x32')](_0x3d5f38['query'][_0xb9d4('0x32')]));_0x13ad73['attributes']=_0x13ad73['attributes'][_0xb9d4('0x33')]?_0x13ad73[_0xb9d4('0x31')]:_0x2c5e8c[_0xb9d4('0x2c')];if(_0x3d5f38[_0xb9d4('0x2e')]['includeAll']){_0x13ad73[_0xb9d4('0x45')]=[{'all':!![]}];}_0x13ad73=_['merge']({},_0x13ad73,_0x3d5f38[_0xb9d4('0x3e')]);return db[_0xb9d4('0x2a')]['find'](_0x13ad73)['then'](handleEntityNotFound(_0x3b25fe,null))[_0xb9d4('0x24')](respondWithResult(_0x3b25fe,null))[_0xb9d4('0x42')](handleError(_0x3b25fe,null));};exports[_0xb9d4('0x46')]=function(_0x513280,_0x371070){return db[_0xb9d4('0x2a')][_0xb9d4('0x46')](_0x513280[_0xb9d4('0x47')],{})[_0xb9d4('0x24')](respondWithResult(_0x371070,0xc9))['catch'](handleError(_0x371070,null));};exports[_0xb9d4('0x23')]=function(_0x17f577,_0x140c46){if(_0x17f577['body']['id']){delete _0x17f577[_0xb9d4('0x47')]['id'];}return db['ZendeskField'][_0xb9d4('0x48')]({'where':{'id':_0x17f577[_0xb9d4('0x44')]['id']}})[_0xb9d4('0x24')](handleEntityNotFound(_0x140c46,null))[_0xb9d4('0x24')](saveUpdates(_0x17f577[_0xb9d4('0x47')],null))['then'](respondWithResult(_0x140c46,null))[_0xb9d4('0x42')](handleError(_0x140c46,null));};exports[_0xb9d4('0x25')]=function(_0x3b6e44,_0xf2c148){return db[_0xb9d4('0x2a')]['find']({'where':{'id':_0x3b6e44['params']['id']}})[_0xb9d4('0x24')](handleEntityNotFound(_0xf2c148,null))['then'](removeEntity(_0xf2c148,null))[_0xb9d4('0x42')](handleError(_0xf2c148,null));}; \ No newline at end of file +var _0x4213=['fields','length','nolimit','order','sort','where','filters','pick','filter','merge','map','type','key','VIRTUAL','options','ZendeskField','includeAll','findAll','show','include','find','catch','create','update','body','params','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','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','../../mysqldb','sendStatus','status','count','offset','limit','set','json','reject','save','destroy','then','end','error','send','index','rawAttributes','model','keys','query','intersection','attributes'];(function(_0x37462c,_0x37ea70){var _0x1d3eaf=function(_0x1b34cf){while(--_0x1b34cf){_0x37462c['push'](_0x37462c['shift']());}};_0x1d3eaf(++_0x37ea70);}(_0x4213,0x18c));var _0x3421=function(_0x5c6403,_0xb08818){_0x5c6403=_0x5c6403-0x0;var _0x523367=_0x4213[_0x5c6403];return _0x523367;};'use strict';var pdf=require(_0x3421('0x0'));var emlformat=require(_0x3421('0x1'));var rimraf=require(_0x3421('0x2'));var zipdir=require(_0x3421('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3421('0x4'));var moment=require(_0x3421('0x5'));var BPromise=require(_0x3421('0x6'));var Mustache=require(_0x3421('0x7'));var util=require(_0x3421('0x8'));var path=require(_0x3421('0x9'));var sox=require(_0x3421('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x3421('0xb'));var squel=require(_0x3421('0xc'));var crypto=require(_0x3421('0xd'));var jsforce=require(_0x3421('0xe'));var deskjs=require(_0x3421('0xf'));var toCsv=require('to-csv');var querystring=require(_0x3421('0x10'));var Papa=require('papaparse');var Redis=require(_0x3421('0x11'));var authService=require(_0x3421('0x12'));var qs=require(_0x3421('0x13'));var as=require(_0x3421('0x14'));var hardwareService=require(_0x3421('0x15'));var logger=require(_0x3421('0x16'))(_0x3421('0x17'));var utils=require(_0x3421('0x18'));var config=require(_0x3421('0x19'));var db=require(_0x3421('0x1a'))['db'];function respondWithStatusCode(_0x2e44bb,_0x7e6e68){_0x7e6e68=_0x7e6e68||0xcc;return function(_0xea52f3){if(_0xea52f3){return _0x2e44bb[_0x3421('0x1b')](_0x7e6e68);}return _0x2e44bb[_0x3421('0x1c')](_0x7e6e68)['end']();};}function respondWithResult(_0x22a73a,_0x2db4ed){_0x2db4ed=_0x2db4ed||0xc8;return function(_0x373db5){if(_0x373db5){return _0x22a73a[_0x3421('0x1c')](_0x2db4ed)['json'](_0x373db5);}};}function respondWithFilteredResult(_0x2ac3bd,_0x1d4cca){return function(_0x386bec){if(_0x386bec){var _0x4e0fb0=_0x386bec[_0x3421('0x1d')],_0x2bf410=_0x1d4cca['offset'],_0x548f75=_0x1d4cca[_0x3421('0x1e')]+_0x1d4cca[_0x3421('0x1f')],_0x9592a7;if(_0x548f75>=_0x4e0fb0){_0x548f75=_0x4e0fb0;_0x9592a7=0xc8;}else{_0x9592a7=0xce;}_0x2ac3bd[_0x3421('0x1c')](_0x9592a7);return _0x2ac3bd[_0x3421('0x20')]('Content-Range',_0x2bf410+'-'+_0x548f75+'/'+_0x4e0fb0)[_0x3421('0x21')](_0x386bec);}return null;};}function patchUpdates(_0x2c8994){return function(_0x3e6b8e){try{jsonpatch['apply'](_0x3e6b8e,_0x2c8994,!![]);}catch(_0x2b7cee){return BPromise[_0x3421('0x22')](_0x2b7cee);}return _0x3e6b8e[_0x3421('0x23')]();};}function saveUpdates(_0x5366d2,_0x48ef27){return function(_0x5cede4){if(_0x5cede4){return _0x5cede4['update'](_0x5366d2)['then'](function(_0x37c3e2){return _0x37c3e2;});}return null;};}function removeEntity(_0x355024,_0x7ec926){return function(_0x26f8fc){if(_0x26f8fc){return _0x26f8fc[_0x3421('0x24')]()[_0x3421('0x25')](function(){_0x355024['status'](0xcc)[_0x3421('0x26')]();});}};}function handleEntityNotFound(_0x3d71cd,_0x441207){return function(_0x58aca1){if(!_0x58aca1){_0x3d71cd[_0x3421('0x1b')](0x194);}return _0x58aca1;};}function handleError(_0x1a58e2,_0x1aba3d){_0x1aba3d=_0x1aba3d||0x1f4;return function(_0x5622d6){logger[_0x3421('0x27')](_0x5622d6['stack']);if(_0x5622d6['name']){delete _0x5622d6['name'];}_0x1a58e2[_0x3421('0x1c')](_0x1aba3d)[_0x3421('0x28')](_0x5622d6);};}exports[_0x3421('0x29')]=function(_0x1d48c9,_0x705d2e){var _0x581238={},_0x521c91={},_0x1f030b={'count':0x0,'rows':[]};var _0x5aafd2=db['ZendeskField'][_0x3421('0x2a')];_0x521c91[_0x3421('0x2b')]=_[_0x3421('0x2c')](_0x5aafd2);_0x521c91['query']=_[_0x3421('0x2c')](_0x1d48c9[_0x3421('0x2d')]);_0x521c91['filters']=_[_0x3421('0x2e')](_0x521c91[_0x3421('0x2b')],_0x521c91['query']);_0x581238[_0x3421('0x2f')]=_['intersection'](_0x521c91[_0x3421('0x2b')],qs[_0x3421('0x30')](_0x1d48c9['query'][_0x3421('0x30')]));_0x581238['attributes']=_0x581238[_0x3421('0x2f')][_0x3421('0x31')]?_0x581238[_0x3421('0x2f')]:_0x521c91[_0x3421('0x2b')];if(!_0x1d48c9[_0x3421('0x2d')]['hasOwnProperty'](_0x3421('0x32'))){_0x581238[_0x3421('0x1f')]=qs[_0x3421('0x1f')](_0x1d48c9[_0x3421('0x2d')]['limit']);_0x581238[_0x3421('0x1e')]=qs[_0x3421('0x1e')](_0x1d48c9[_0x3421('0x2d')]['offset']);}_0x581238[_0x3421('0x33')]=qs[_0x3421('0x34')](_0x1d48c9[_0x3421('0x2d')][_0x3421('0x34')]);_0x581238[_0x3421('0x35')]=qs[_0x3421('0x36')](_[_0x3421('0x37')](_0x1d48c9[_0x3421('0x2d')],_0x521c91[_0x3421('0x36')]));if(_0x1d48c9['query'][_0x3421('0x38')]){_0x581238[_0x3421('0x35')]=_[_0x3421('0x39')](_0x581238[_0x3421('0x35')],{'$or':_[_0x3421('0x3a')](_0x5aafd2,function(_0x18d92a){if(_0x18d92a[_0x3421('0x3b')][_0x3421('0x3c')]!==_0x3421('0x3d')){var _0x4f4e03={};_0x4f4e03[_0x18d92a['field']]={'$like':'%'+_0x1d48c9[_0x3421('0x2d')]['filter']+'%'};return _0x4f4e03;}})});}_0x581238=_[_0x3421('0x39')]({},_0x581238,_0x1d48c9[_0x3421('0x3e')]);var _0x3f366e={'where':_0x581238[_0x3421('0x35')]};return db[_0x3421('0x3f')][_0x3421('0x1d')](_0x3f366e)['then'](function(_0x51b3c8){_0x1f030b[_0x3421('0x1d')]=_0x51b3c8;if(_0x1d48c9[_0x3421('0x2d')][_0x3421('0x40')]){_0x581238['include']=[{'all':!![]}];}return db['ZendeskField'][_0x3421('0x41')](_0x581238);})[_0x3421('0x25')](function(_0x5785af){_0x1f030b['rows']=_0x5785af;return _0x1f030b;})[_0x3421('0x25')](respondWithFilteredResult(_0x705d2e,_0x581238))['catch'](handleError(_0x705d2e,null));};exports[_0x3421('0x42')]=function(_0x555e1d,_0xc4ef46){var _0x394577={'raw':!![],'where':{'id':_0x555e1d['params']['id']}},_0x19c0e8={};_0x19c0e8['model']=_[_0x3421('0x2c')](db[_0x3421('0x3f')]['rawAttributes']);_0x19c0e8[_0x3421('0x2d')]=_[_0x3421('0x2c')](_0x555e1d[_0x3421('0x2d')]);_0x19c0e8[_0x3421('0x36')]=_['intersection'](_0x19c0e8['model'],_0x19c0e8[_0x3421('0x2d')]);_0x394577[_0x3421('0x2f')]=_[_0x3421('0x2e')](_0x19c0e8[_0x3421('0x2b')],qs[_0x3421('0x30')](_0x555e1d[_0x3421('0x2d')]['fields']));_0x394577[_0x3421('0x2f')]=_0x394577[_0x3421('0x2f')][_0x3421('0x31')]?_0x394577[_0x3421('0x2f')]:_0x19c0e8[_0x3421('0x2b')];if(_0x555e1d[_0x3421('0x2d')][_0x3421('0x40')]){_0x394577[_0x3421('0x43')]=[{'all':!![]}];}_0x394577=_[_0x3421('0x39')]({},_0x394577,_0x555e1d[_0x3421('0x3e')]);return db['ZendeskField'][_0x3421('0x44')](_0x394577)[_0x3421('0x25')](handleEntityNotFound(_0xc4ef46,null))[_0x3421('0x25')](respondWithResult(_0xc4ef46,null))[_0x3421('0x45')](handleError(_0xc4ef46,null));};exports[_0x3421('0x46')]=function(_0x35c519,_0x4749e4){return db[_0x3421('0x3f')][_0x3421('0x46')](_0x35c519['body'],{})['then'](respondWithResult(_0x4749e4,0xc9))[_0x3421('0x45')](handleError(_0x4749e4,null));};exports[_0x3421('0x47')]=function(_0x1c1f11,_0x4c5998){if(_0x1c1f11[_0x3421('0x48')]['id']){delete _0x1c1f11[_0x3421('0x48')]['id'];}return db[_0x3421('0x3f')][_0x3421('0x44')]({'where':{'id':_0x1c1f11[_0x3421('0x49')]['id']}})[_0x3421('0x25')](handleEntityNotFound(_0x4c5998,null))[_0x3421('0x25')](saveUpdates(_0x1c1f11[_0x3421('0x48')],null))[_0x3421('0x25')](respondWithResult(_0x4c5998,null))[_0x3421('0x45')](handleError(_0x4c5998,null));};exports[_0x3421('0x24')]=function(_0x4a86a2,_0x191c1e){return db['ZendeskField'][_0x3421('0x44')]({'where':{'id':_0x4a86a2[_0x3421('0x49')]['id']}})[_0x3421('0x25')](handleEntityNotFound(_0x191c1e,null))['then'](removeEntity(_0x191c1e,null))['catch'](handleError(_0x191c1e,null));}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.model.js b/server/api/intZendeskField/intZendeskField.model.js index ad95efc..e9e8ea4 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 _0x86fd=['../../config/logger','api','bluebird','path','rimraf','./intZendeskField.attributes','exports','define','int_zendesk_fields','idField','FieldId','lodash','util'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x86fd,0xa7));var _0xd86f=function(_0x3a3758,_0x4dd8cf){_0x3a3758=_0x3a3758-0x0;var _0x1a9234=_0x86fd[_0x3a3758];return _0x1a9234;};'use strict';var _=require(_0xd86f('0x0'));var util=require(_0xd86f('0x1'));var logger=require(_0xd86f('0x2'))(_0xd86f('0x3'));var moment=require('moment');var BPromise=require(_0xd86f('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd86f('0x5'));var rimraf=require(_0xd86f('0x6'));var config=require('../../config/environment');var attributes=require(_0xd86f('0x7'));module[_0xd86f('0x8')]=function(_0x4986aa,_0x5784c7){return _0x4986aa[_0xd86f('0x9')]('ZendeskField',attributes,{'tableName':_0xd86f('0xa'),'paranoid':![],'indexes':[{'name':'zendesk_unique_index','fields':[_0xd86f('0xb'),_0xd86f('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xbee3=['ZendeskField','int_zendesk_fields','zendesk_unique_index','idField','FieldId','util','moment','bluebird','path','rimraf','../../config/environment','exports','define'];(function(_0xc40b0b,_0x3a2766){var _0x443191=function(_0x5d78cd){while(--_0x5d78cd){_0xc40b0b['push'](_0xc40b0b['shift']());}};_0x443191(++_0x3a2766);}(_0xbee3,0xd5));var _0x3bee=function(_0x27931d,_0x59f9f9){_0x27931d=_0x27931d-0x0;var _0x253e03=_0xbee3[_0x27931d];return _0x253e03;};'use strict';var _=require('lodash');var util=require(_0x3bee('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x3bee('0x1'));var BPromise=require(_0x3bee('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3bee('0x3'));var rimraf=require(_0x3bee('0x4'));var config=require(_0x3bee('0x5'));var attributes=require('./intZendeskField.attributes');module[_0x3bee('0x6')]=function(_0x3baf77,_0x4c5ef5){return _0x3baf77[_0x3bee('0x7')](_0x3bee('0x8'),attributes,{'tableName':_0x3bee('0x9'),'paranoid':![],'indexes':[{'name':_0x3bee('0xa'),'fields':[_0x3bee('0xb'),_0x3bee('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.rpc.js b/server/api/intZendeskField/intZendeskField.rpc.js index c4007a6..b229ff9 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 _0x188f=['result','catch','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','info','ZendeskField,\x20%s,\x20%s','request\x20sent','debug','ZendeskField,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x4b7895,_0x3c4f5d){var _0x264180=function(_0xe0e861){while(--_0xe0e861){_0x4b7895['push'](_0x4b7895['shift']());}};_0x264180(++_0x3c4f5d);}(_0x188f,0x1a6));var _0xf188=function(_0x43c156,_0x2728a9){_0x43c156=_0x43c156-0x0;var _0x1473bf=_0x188f[_0x43c156];return _0x1473bf;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xf188('0x0'));var fs=require('fs');var Redis=require(_0xf188('0x1'));var db=require(_0xf188('0x2'))['db'];var utils=require(_0xf188('0x3'));var logger=require(_0xf188('0x4'))(_0xf188('0x5'));var config=require(_0xf188('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xf188('0x7')][_0xf188('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x308976,_0x11fd88,_0x22363c){return new BPromise(function(_0x3ba3dc,_0x221d0d){return client[_0xf188('0x9')](_0x308976,_0x22363c)['then'](function(_0x288878){logger[_0xf188('0xa')](_0xf188('0xb'),_0x11fd88,_0xf188('0xc'));logger[_0xf188('0xd')](_0xf188('0xe'),_0x11fd88,'request\x20sent',JSON['stringify'](_0x288878));if(_0x288878[_0xf188('0xf')]){if(_0x288878[_0xf188('0xf')][_0xf188('0x10')]===0x1f4){logger[_0xf188('0xf')]('ZendeskField,\x20%s,\x20%s',_0x11fd88,_0x288878['error'][_0xf188('0x11')]);return _0x221d0d(_0x288878[_0xf188('0xf')]['message']);}logger['error']('ZendeskField,\x20%s,\x20%s',_0x11fd88,_0x288878[_0xf188('0xf')]['message']);return _0x3ba3dc(_0x288878[_0xf188('0xf')][_0xf188('0x11')]);}else{logger[_0xf188('0xa')](_0xf188('0xb'),_0x11fd88,_0xf188('0xc'));_0x3ba3dc(_0x288878[_0xf188('0x12')][_0xf188('0x11')]);}})[_0xf188('0x13')](function(_0x3ad763){logger[_0xf188('0xf')](_0xf188('0xb'),_0x11fd88,_0x3ad763);_0x221d0d(_0x3ad763);});});} \ No newline at end of file +var _0xc604=['info','ZendeskField,\x20%s,\x20%s','debug','ZendeskField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x401fd9,_0x4bd048){var _0x794c4c=function(_0x531b00){while(--_0x531b00){_0x401fd9['push'](_0x401fd9['shift']());}};_0x794c4c(++_0x4bd048);}(_0xc604,0x191));var _0x4c60=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc604[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x4c60('0x0'));var moment=require(_0x4c60('0x1'));var BPromise=require(_0x4c60('0x2'));var rs=require(_0x4c60('0x3'));var fs=require('fs');var Redis=require(_0x4c60('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x4c60('0x5'));var logger=require(_0x4c60('0x6'))(_0x4c60('0x7'));var config=require(_0x4c60('0x8'));var jayson=require(_0x4c60('0x9'));var client=jayson[_0x4c60('0xa')][_0x4c60('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x42c2fe,_0x3da610,_0x1e9ef4){return new BPromise(function(_0x23e410,_0x3216d2){return client[_0x4c60('0xc')](_0x42c2fe,_0x1e9ef4)['then'](function(_0x1ae989){logger[_0x4c60('0xd')](_0x4c60('0xe'),_0x3da610,'request\x20sent');logger[_0x4c60('0xf')](_0x4c60('0x10'),_0x3da610,_0x4c60('0x11'),JSON[_0x4c60('0x12')](_0x1ae989));if(_0x1ae989[_0x4c60('0x13')]){if(_0x1ae989[_0x4c60('0x13')]['code']===0x1f4){logger[_0x4c60('0x13')](_0x4c60('0xe'),_0x3da610,_0x1ae989[_0x4c60('0x13')][_0x4c60('0x14')]);return _0x3216d2(_0x1ae989[_0x4c60('0x13')][_0x4c60('0x14')]);}logger[_0x4c60('0x13')](_0x4c60('0xe'),_0x3da610,_0x1ae989[_0x4c60('0x13')][_0x4c60('0x14')]);return _0x23e410(_0x1ae989[_0x4c60('0x13')][_0x4c60('0x14')]);}else{logger[_0x4c60('0xd')](_0x4c60('0xe'),_0x3da610,'request\x20sent');_0x23e410(_0x1ae989[_0x4c60('0x15')][_0x4c60('0x14')]);}})[_0x4c60('0x16')](function(_0x1e5012){logger['error'](_0x4c60('0xe'),_0x3da610,_0x1e5012);_0x3216d2(_0x1e5012);});});} \ No newline at end of file diff --git a/server/api/intZohoAccount/index.js b/server/api/intZohoAccount/index.js index 1a5416b..de07237 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 _0x9ee5=['./intZohoAccount.controller','isAuthenticated','get','/:id','show','/:id/configurations','getConfigurations','/:id/fields','post','addConfiguration','put','update','delete','destroy','exports','multer','util','connect-timeout','Router','../../components/auth/service','../../config/environment'];(function(_0x3f5f32,_0x9abafd){var _0xc03799=function(_0x445770){while(--_0x445770){_0x3f5f32['push'](_0x3f5f32['shift']());}};_0xc03799(++_0x9abafd);}(_0x9ee5,0x10b));var _0x59ee=function(_0x4bac94,_0x11f0f3){_0x4bac94=_0x4bac94-0x0;var _0x403352=_0x9ee5[_0x4bac94];return _0x403352;};'use strict';var multer=require(_0x59ee('0x0'));var util=require(_0x59ee('0x1'));var path=require('path');var timeout=require(_0x59ee('0x2'));var express=require('express');var router=express[_0x59ee('0x3')]();var auth=require(_0x59ee('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x59ee('0x5'));var controller=require(_0x59ee('0x6'));router['get']('/',auth[_0x59ee('0x7')](),controller['index']);router[_0x59ee('0x8')](_0x59ee('0x9'),auth[_0x59ee('0x7')](),controller[_0x59ee('0xa')]);router['get'](_0x59ee('0xb'),auth[_0x59ee('0x7')](),controller[_0x59ee('0xc')]);router[_0x59ee('0x8')](_0x59ee('0xd'),auth[_0x59ee('0x7')](),controller['getFields']);router[_0x59ee('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0x59ee('0xe')](_0x59ee('0xb'),auth[_0x59ee('0x7')](),controller[_0x59ee('0xf')]);router[_0x59ee('0x10')]('/:id',auth[_0x59ee('0x7')](),controller[_0x59ee('0x11')]);router[_0x59ee('0x12')](_0x59ee('0x9'),auth[_0x59ee('0x7')](),controller[_0x59ee('0x13')]);module[_0x59ee('0x14')]=router; \ No newline at end of file +var _0xb852=['./intZohoAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x27b596,_0x4ecc43){var _0x59d7d6=function(_0x18cca8){while(--_0x18cca8){_0x27b596['push'](_0x27b596['shift']());}};_0x59d7d6(++_0x4ecc43);}(_0xb852,0x1a2));var _0x2b85=function(_0x2708aa,_0x3711f7){_0x2708aa=_0x2708aa-0x0;var _0x153468=_0xb852[_0x2708aa];return _0x153468;};'use strict';var multer=require('multer');var util=require(_0x2b85('0x0'));var path=require(_0x2b85('0x1'));var timeout=require('connect-timeout');var express=require(_0x2b85('0x2'));var router=express[_0x2b85('0x3')]();var auth=require(_0x2b85('0x4'));var interaction=require(_0x2b85('0x5'));var config=require(_0x2b85('0x6'));var controller=require(_0x2b85('0x7'));router[_0x2b85('0x8')]('/',auth[_0x2b85('0x9')](),controller[_0x2b85('0xa')]);router[_0x2b85('0x8')](_0x2b85('0xb'),auth[_0x2b85('0x9')](),controller[_0x2b85('0xc')]);router[_0x2b85('0x8')](_0x2b85('0xd'),auth[_0x2b85('0x9')](),controller[_0x2b85('0xe')]);router[_0x2b85('0x8')](_0x2b85('0xf'),auth['isAuthenticated'](),controller[_0x2b85('0x10')]);router[_0x2b85('0x11')]('/',auth['isAuthenticated'](),controller[_0x2b85('0x12')]);router[_0x2b85('0x11')]('/:id/configurations',auth[_0x2b85('0x9')](),controller[_0x2b85('0x13')]);router[_0x2b85('0x14')](_0x2b85('0xb'),auth[_0x2b85('0x9')](),controller[_0x2b85('0x15')]);router[_0x2b85('0x16')](_0x2b85('0xb'),auth[_0x2b85('0x9')](),controller[_0x2b85('0x17')]);module[_0x2b85('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 eebc5eb..33bf6ce 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 _0xccbc=['STRING','sequelize','exports'];(function(_0x555b2f,_0x43b622){var _0x81c0a6=function(_0x4629e6){while(--_0x4629e6){_0x555b2f['push'](_0x555b2f['shift']());}};_0x81c0a6(++_0x43b622);}(_0xccbc,0x7f));var _0xcccb=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xccbc[_0x122ef9];return _0x42fba0;};'use strict';var Sequelize=require(_0xcccb('0x0'));module[_0xcccb('0x1')]={'name':{'type':Sequelize[_0xcccb('0x2')]},'description':{'type':Sequelize[_0xcccb('0x2')]},'host':{'type':Sequelize['STRING']},'zone':{'type':Sequelize[_0xcccb('0x2')]},'clientId':{'type':Sequelize[_0xcccb('0x2')]},'clientSecret':{'type':Sequelize[_0xcccb('0x2')]},'serverUrl':{'type':Sequelize[_0xcccb('0x2')]},'code':{'type':Sequelize[_0xcccb('0x2')]},'refreshToken':{'type':Sequelize[_0xcccb('0x2')]}}; \ No newline at end of file +var _0x93a0=['STRING','sequelize','exports'];(function(_0x5a3ee0,_0x55912d){var _0x30c69f=function(_0x47cc91){while(--_0x47cc91){_0x5a3ee0['push'](_0x5a3ee0['shift']());}};_0x30c69f(++_0x55912d);}(_0x93a0,0xdf));var _0x093a=function(_0x4377e7,_0x10621a){_0x4377e7=_0x4377e7-0x0;var _0x30cb08=_0x93a0[_0x4377e7];return _0x30cb08;};'use strict';var Sequelize=require(_0x093a('0x0'));module[_0x093a('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x093a('0x2')]},'host':{'type':Sequelize[_0x093a('0x2')]},'zone':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0x093a('0x2')]},'clientSecret':{'type':Sequelize[_0x093a('0x2')]},'serverUrl':{'type':Sequelize[_0x093a('0x2')]},'code':{'type':Sequelize[_0x093a('0x2')]},'refreshToken':{'type':Sequelize[_0x093a('0x2')]}}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.controller.js b/server/api/intZohoAccount/intZohoAccount.controller.js index c40f975..bc26620 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 _0xde65=['pick_list_values','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','send','Wrong\x20credentials','html-pdf','eml-format','rimraf','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','http','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','ZohoAccount,\x20%s,\x20%s','request\x20sent','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','status','end','json','count','offset','limit','set','Content-Range','destroy','name','index','ZohoAccount','query','keys','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','map','type','key','VIRTUAL','field','options','includeAll','include','rows','catch','show','params','rawAttributes','find','create','body','update','getConfigurations','ZohoConfiguration','hasOwnProperty','addConfiguration','findOne','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','ZohoField','zone','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','/oauth/v2/token','refreshToken','clientSecret','refresh_token','access_token','getFields','clientId','serverUrl','host','zoho.eu','slice','substring','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','GET','https://www.zohoapis.%s/crm/v2/settings/fields','Calls','response','Owner','Subject','Call_Duration','Call_Start_Time','Call_Type','remove','includes','api_name','system_mandatory','push','custom_field','picklist'];(function(_0x242df7,_0xe827fb){var _0x10f58c=function(_0x4d8384){while(--_0x4d8384){_0x242df7['push'](_0x242df7['shift']());}};_0x10f58c(++_0xe827fb);}(_0xde65,0x120));var _0x5de6=function(_0x14a75e,_0x3fd3c6){_0x14a75e=_0x14a75e-0x0;var _0x47e204=_0xde65[_0x14a75e];return _0x47e204;};'use strict';var pdf=require(_0x5de6('0x0'));var emlformat=require(_0x5de6('0x1'));var rimraf=require(_0x5de6('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x5de6('0x3'));var moment=require(_0x5de6('0x4'));var BPromise=require(_0x5de6('0x5'));var Mustache=require('mustache');var util=require(_0x5de6('0x6'));var path=require(_0x5de6('0x7'));var sox=require(_0x5de6('0x8'));var csv=require(_0x5de6('0x9'));var ejs=require(_0x5de6('0xa'));var fs=require('fs');var _=require(_0x5de6('0xb'));var squel=require(_0x5de6('0xc'));var crypto=require(_0x5de6('0xd'));var jsforce=require(_0x5de6('0xe'));var deskjs=require(_0x5de6('0xf'));var toCsv=require(_0x5de6('0x9'));var querystring=require(_0x5de6('0x10'));var Papa=require(_0x5de6('0x11'));var Redis=require(_0x5de6('0x12'));var authService=require(_0x5de6('0x13'));var qs=require(_0x5de6('0x14'));var as=require(_0x5de6('0x15'));var hardwareService=require(_0x5de6('0x16'));var logger=require(_0x5de6('0x17'))(_0x5de6('0x18'));var utils=require(_0x5de6('0x19'));var config=require(_0x5de6('0x1a'));var db=require(_0x5de6('0x1b'))['db'];var integrations=require(_0x5de6('0x1c'));var jayson=require(_0x5de6('0x1d'));var client=jayson[_0x5de6('0x1e')][_0x5de6('0x1f')]({'port':0x232a});function checkPasswordPattern(_0x397074,_0x14cc2f,_0x552c76){if(_0x552c76){var _0xc0563=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0xc0563['test'](_0x14cc2f)){return _0x397074;}else{throw new Error(_0x5de6('0x20'));}}else{return _0x397074;}}function respondWithRpcPromise(_0x4ff3da,_0x4d25e4,_0x17db30,_0x592278){return new BPromise(function(_0x3f22be,_0x7b5c1d){var _0x37a0e0=_0x592278||client;return _0x37a0e0[_0x5de6('0x21')](_0x4ff3da,_0x17db30)[_0x5de6('0x22')](function(_0x5b18c3){logger[_0x5de6('0x23')](_0x5de6('0x24'),_0x4d25e4,_0x5de6('0x25'));logger[_0x5de6('0x26')](_0x5de6('0x27'),_0x4d25e4,_0x5de6('0x25'),JSON[_0x5de6('0x28')](_0x5b18c3));if(_0x5b18c3[_0x5de6('0x29')]){if(_0x5b18c3[_0x5de6('0x29')][_0x5de6('0x2a')]===0x1f4){logger['error'](_0x5de6('0x24'),_0x4d25e4,_0x5b18c3[_0x5de6('0x29')][_0x5de6('0x2b')]);return _0x7b5c1d(_0x5b18c3[_0x5de6('0x29')][_0x5de6('0x2b')]);}logger[_0x5de6('0x29')](_0x5de6('0x24'),_0x4d25e4,_0x5b18c3['error'][_0x5de6('0x2b')]);return _0x3f22be(_0x5b18c3['error'][_0x5de6('0x2b')]);}else{logger['info'](_0x5de6('0x24'),_0x4d25e4,_0x5de6('0x25'));_0x3f22be(_0x5b18c3[_0x5de6('0x2c')][_0x5de6('0x2b')]);}})['catch'](function(_0x43041a){logger['error']('ZohoAccount,\x20%s,\x20%s',_0x4d25e4,_0x43041a);_0x7b5c1d(_0x43041a);});});}function respondWithStatusCode(_0x4d7d7e,_0x4df0a9){_0x4df0a9=_0x4df0a9||0xcc;return function(_0x3c5ceb){if(_0x3c5ceb){return _0x4d7d7e[_0x5de6('0x2d')](_0x4df0a9);}return _0x4d7d7e[_0x5de6('0x2e')](_0x4df0a9)[_0x5de6('0x2f')]();};}function respondWithResult(_0x146850,_0x199878){_0x199878=_0x199878||0xc8;return function(_0x764f39){if(_0x764f39){return _0x146850[_0x5de6('0x2e')](_0x199878)[_0x5de6('0x30')](_0x764f39);}};}function respondWithFilteredResult(_0x3b3cb8,_0x3b7a45){return function(_0x1cbad1){if(_0x1cbad1){var _0x3829a1=_0x1cbad1[_0x5de6('0x31')],_0x409bf0=_0x3b7a45[_0x5de6('0x32')],_0x2b317b=_0x3b7a45['offset']+_0x3b7a45[_0x5de6('0x33')],_0x260508;if(_0x2b317b>=_0x3829a1){_0x2b317b=_0x3829a1;_0x260508=0xc8;}else{_0x260508=0xce;}_0x3b3cb8['status'](_0x260508);return _0x3b3cb8[_0x5de6('0x34')](_0x5de6('0x35'),_0x409bf0+'-'+_0x2b317b+'/'+_0x3829a1)[_0x5de6('0x30')](_0x1cbad1);}return null;};}function patchUpdates(_0x32ab69){return function(_0x473d2e){try{jsonpatch['apply'](_0x473d2e,_0x32ab69,!![]);}catch(_0xd9b5c7){return BPromise['reject'](_0xd9b5c7);}return _0x473d2e['save']();};}function saveUpdates(_0x41387b,_0x5bc213){return function(_0xe9b411){if(_0xe9b411){return _0xe9b411['update'](_0x41387b)[_0x5de6('0x22')](function(_0x3e3b83){return _0x3e3b83;});}return null;};}function removeEntity(_0x97c776,_0x688014){return function(_0x22f1ae){if(_0x22f1ae){return _0x22f1ae[_0x5de6('0x36')]()[_0x5de6('0x22')](function(){_0x97c776['status'](0xcc)[_0x5de6('0x2f')]();});}};}function handleEntityNotFound(_0xfe0b3d,_0x3f83d8){return function(_0x4c779f){if(!_0x4c779f){_0xfe0b3d[_0x5de6('0x2d')](0x194);}return _0x4c779f;};}function handleError(_0x16b56f,_0x5efba){_0x5efba=_0x5efba||0x1f4;return function(_0x467b8b){logger[_0x5de6('0x29')](_0x467b8b['stack']);if(_0x467b8b[_0x5de6('0x37')]){delete _0x467b8b['name'];}_0x16b56f[_0x5de6('0x2e')](_0x5efba)['send'](_0x467b8b);};}exports[_0x5de6('0x38')]=function(_0x331f3c,_0x41757b){var _0x46b6c6={},_0x46e8f7={},_0x51b7d9={'count':0x0,'rows':[]};var _0x58f630=db[_0x5de6('0x39')]['rawAttributes'];_0x46e8f7['model']=_['keys'](_0x58f630);_0x46e8f7[_0x5de6('0x3a')]=_[_0x5de6('0x3b')](_0x331f3c[_0x5de6('0x3a')]);_0x46e8f7[_0x5de6('0x3c')]=_[_0x5de6('0x3d')](_0x46e8f7[_0x5de6('0x3e')],_0x46e8f7[_0x5de6('0x3a')]);_0x46b6c6[_0x5de6('0x3f')]=_['intersection'](_0x46e8f7[_0x5de6('0x3e')],qs[_0x5de6('0x40')](_0x331f3c['query'][_0x5de6('0x40')]));_0x46b6c6[_0x5de6('0x3f')]=_0x46b6c6[_0x5de6('0x3f')][_0x5de6('0x41')]?_0x46b6c6[_0x5de6('0x3f')]:_0x46e8f7['model'];if(!_0x331f3c[_0x5de6('0x3a')]['hasOwnProperty'](_0x5de6('0x42'))){_0x46b6c6[_0x5de6('0x33')]=qs[_0x5de6('0x33')](_0x331f3c[_0x5de6('0x3a')][_0x5de6('0x33')]);_0x46b6c6[_0x5de6('0x32')]=qs['offset'](_0x331f3c[_0x5de6('0x3a')][_0x5de6('0x32')]);}_0x46b6c6[_0x5de6('0x43')]=qs[_0x5de6('0x44')](_0x331f3c[_0x5de6('0x3a')][_0x5de6('0x44')]);_0x46b6c6[_0x5de6('0x45')]=qs[_0x5de6('0x3c')](_[_0x5de6('0x46')](_0x331f3c[_0x5de6('0x3a')],_0x46e8f7[_0x5de6('0x3c')]));if(_0x331f3c[_0x5de6('0x3a')][_0x5de6('0x47')]){_0x46b6c6[_0x5de6('0x45')]=_[_0x5de6('0x48')](_0x46b6c6[_0x5de6('0x45')],{'$or':_[_0x5de6('0x49')](_0x58f630,function(_0x2aefd2){if(_0x2aefd2[_0x5de6('0x4a')][_0x5de6('0x4b')]!==_0x5de6('0x4c')){var _0x269f8d={};_0x269f8d[_0x2aefd2[_0x5de6('0x4d')]]={'$like':'%'+_0x331f3c[_0x5de6('0x3a')]['filter']+'%'};return _0x269f8d;}})});}_0x46b6c6=_['merge']({},_0x46b6c6,_0x331f3c[_0x5de6('0x4e')]);var _0x4dc485={'where':_0x46b6c6[_0x5de6('0x45')]};return db[_0x5de6('0x39')][_0x5de6('0x31')](_0x4dc485)['then'](function(_0x4cc331){_0x51b7d9[_0x5de6('0x31')]=_0x4cc331;if(_0x331f3c['query'][_0x5de6('0x4f')]){_0x46b6c6[_0x5de6('0x50')]=[{'all':!![]}];}return db['ZohoAccount']['findAll'](_0x46b6c6);})[_0x5de6('0x22')](function(_0x25790c){_0x51b7d9[_0x5de6('0x51')]=_0x25790c;return _0x51b7d9;})[_0x5de6('0x22')](respondWithFilteredResult(_0x41757b,_0x46b6c6))[_0x5de6('0x52')](handleError(_0x41757b,null));};exports[_0x5de6('0x53')]=function(_0x1d861f,_0x52b8e2){var _0x787fe0={'raw':![],'where':{'id':_0x1d861f[_0x5de6('0x54')]['id']}},_0xa83154={};_0xa83154['model']=_[_0x5de6('0x3b')](db[_0x5de6('0x39')][_0x5de6('0x55')]);_0xa83154[_0x5de6('0x3a')]=_[_0x5de6('0x3b')](_0x1d861f['query']);_0xa83154[_0x5de6('0x3c')]=_['intersection'](_0xa83154['model'],_0xa83154[_0x5de6('0x3a')]);_0x787fe0[_0x5de6('0x3f')]=_[_0x5de6('0x3d')](_0xa83154[_0x5de6('0x3e')],qs[_0x5de6('0x40')](_0x1d861f[_0x5de6('0x3a')][_0x5de6('0x40')]));_0x787fe0['attributes']=_0x787fe0[_0x5de6('0x3f')][_0x5de6('0x41')]?_0x787fe0[_0x5de6('0x3f')]:_0xa83154['model'];if(_0x1d861f['query'][_0x5de6('0x4f')]){_0x787fe0[_0x5de6('0x50')]=[{'all':!![]}];}_0x787fe0=_['merge']({},_0x787fe0,_0x1d861f[_0x5de6('0x4e')]);return db[_0x5de6('0x39')][_0x5de6('0x56')](_0x787fe0)[_0x5de6('0x22')](handleEntityNotFound(_0x52b8e2,null))[_0x5de6('0x22')](respondWithResult(_0x52b8e2,null))['catch'](handleError(_0x52b8e2,null));};exports[_0x5de6('0x57')]=function(_0x13c5ce,_0x2da068){return db[_0x5de6('0x39')][_0x5de6('0x57')](_0x13c5ce[_0x5de6('0x58')],{})[_0x5de6('0x22')](respondWithResult(_0x2da068,0xc9))['catch'](handleError(_0x2da068,null));};exports[_0x5de6('0x59')]=function(_0x1695a7,_0x9ecaa3){if(_0x1695a7[_0x5de6('0x58')]['id']){delete _0x1695a7['body']['id'];}return db[_0x5de6('0x39')]['find']({'where':{'id':_0x1695a7['params']['id']}})[_0x5de6('0x22')](handleEntityNotFound(_0x9ecaa3,null))[_0x5de6('0x22')](saveUpdates(_0x1695a7[_0x5de6('0x58')],null))[_0x5de6('0x22')](respondWithResult(_0x9ecaa3,null))[_0x5de6('0x52')](handleError(_0x9ecaa3,null));};exports[_0x5de6('0x36')]=function(_0x5a0aa3,_0x569bc2){return db[_0x5de6('0x39')][_0x5de6('0x56')]({'where':{'id':_0x5a0aa3[_0x5de6('0x54')]['id']}})['then'](handleEntityNotFound(_0x569bc2,null))[_0x5de6('0x22')](removeEntity(_0x569bc2,null))[_0x5de6('0x52')](handleError(_0x569bc2,null));};exports[_0x5de6('0x5a')]=function(_0x3019c7,_0x257923,_0x14b3d7){var _0x7b75b4={};var _0x6c6c0f={};var _0x2ed9e6;var _0x3e0a91;return db[_0x5de6('0x39')]['findOne']({'where':{'id':_0x3019c7[_0x5de6('0x54')]['id']}})[_0x5de6('0x22')](handleEntityNotFound(_0x257923,null))[_0x5de6('0x22')](function(_0x139bc7){if(_0x139bc7){_0x2ed9e6=_0x139bc7;_0x6c6c0f[_0x5de6('0x3e')]=_[_0x5de6('0x3b')](db[_0x5de6('0x5b')][_0x5de6('0x55')]);_0x6c6c0f['query']=_[_0x5de6('0x3b')](_0x3019c7[_0x5de6('0x3a')]);_0x6c6c0f[_0x5de6('0x3c')]=_[_0x5de6('0x3d')](_0x6c6c0f[_0x5de6('0x3e')],_0x6c6c0f[_0x5de6('0x3a')]);_0x7b75b4[_0x5de6('0x3f')]=_['intersection'](_0x6c6c0f['model'],qs[_0x5de6('0x40')](_0x3019c7[_0x5de6('0x3a')]['fields']));_0x7b75b4[_0x5de6('0x3f')]=_0x7b75b4[_0x5de6('0x3f')][_0x5de6('0x41')]?_0x7b75b4['attributes']:_0x6c6c0f['model'];_0x7b75b4[_0x5de6('0x43')]=qs[_0x5de6('0x44')](_0x3019c7['query'][_0x5de6('0x44')]);_0x7b75b4[_0x5de6('0x45')]=qs[_0x5de6('0x3c')](_[_0x5de6('0x46')](_0x3019c7['query'],_0x6c6c0f[_0x5de6('0x3c')]));if(_0x3019c7[_0x5de6('0x3a')]['filter']){_0x7b75b4[_0x5de6('0x45')]=_[_0x5de6('0x48')](_0x7b75b4[_0x5de6('0x45')],{'$or':_[_0x5de6('0x49')](_0x7b75b4['attributes'],function(_0x581d80){var _0x2206fa={};_0x2206fa[_0x581d80]={'$like':'%'+_0x3019c7[_0x5de6('0x3a')][_0x5de6('0x47')]+'%'};return _0x2206fa;})});}_0x7b75b4=_[_0x5de6('0x48')]({},_0x7b75b4,_0x3019c7[_0x5de6('0x4e')]);return _0x2ed9e6[_0x5de6('0x5a')](_0x7b75b4);}})['then'](function(_0xa456a8){if(_0xa456a8){_0x3e0a91=_0xa456a8[_0x5de6('0x41')];if(!_0x3019c7['query'][_0x5de6('0x5c')](_0x5de6('0x42'))){_0x7b75b4[_0x5de6('0x33')]=qs[_0x5de6('0x33')](_0x3019c7[_0x5de6('0x3a')][_0x5de6('0x33')]);_0x7b75b4[_0x5de6('0x32')]=qs['offset'](_0x3019c7['query'][_0x5de6('0x32')]);}return _0x2ed9e6[_0x5de6('0x5a')](_0x7b75b4);}})[_0x5de6('0x22')](function(_0x2cb7a2){if(_0x2cb7a2){return _0x2cb7a2?{'count':_0x3e0a91,'rows':_0x2cb7a2}:null;}})['then'](respondWithResult(_0x257923,null))[_0x5de6('0x52')](handleError(_0x257923,null));};exports[_0x5de6('0x5d')]=function(_0x2b1f9e,_0xad3ef,_0x298c4a){if(_0x2b1f9e[_0x5de6('0x58')]['id']){delete _0x2b1f9e[_0x5de6('0x58')]['id'];}return db[_0x5de6('0x39')][_0x5de6('0x5e')]({'where':{'id':_0x2b1f9e[_0x5de6('0x54')]['id']}})[_0x5de6('0x22')](handleEntityNotFound(_0xad3ef,null))[_0x5de6('0x22')](function(_0x1116f4){if(_0x1116f4){_0x2b1f9e[_0x5de6('0x58')][_0x5de6('0x5f')]=_0x1116f4['id'];_0x2b1f9e['body'][_0x5de6('0x60')]=integrations[_0x5de6('0x61')](_0x2b1f9e['body'][_0x5de6('0x62')],_0x2b1f9e[_0x5de6('0x58')][_0x5de6('0x4a')]);_0x2b1f9e[_0x5de6('0x58')][_0x5de6('0x63')]=integrations[_0x5de6('0x64')](_0x2b1f9e['body'][_0x5de6('0x62')],_0x2b1f9e[_0x5de6('0x58')][_0x5de6('0x4a')]);return db[_0x5de6('0x5b')][_0x5de6('0x57')](_0x2b1f9e['body'],{'include':[{'model':db['ZohoField'],'as':'Subjects'},{'model':db[_0x5de6('0x65')],'as':_0x5de6('0x63')}]});}return null;})['then'](respondWithResult(_0xad3ef,null))[_0x5de6('0x52')](handleError(_0xad3ef,null));};function getAccessToken(_0x4780e2){return new Promise(function(_0x212a64,_0x2a0df1){var _0x3cb1f6;switch(_0x4780e2[_0x5de6('0x66')]){case'US':_0x3cb1f6='https://accounts.zoho.com';break;case'AU':_0x3cb1f6='https://accounts.zoho.com.au';break;case'EU':_0x3cb1f6=_0x5de6('0x67');break;case'IN':_0x3cb1f6=_0x5de6('0x68');break;case'CN':_0x3cb1f6=_0x5de6('0x69');break;default:_0x3cb1f6=_0x5de6('0x67');break;}var _0x66f3b0={'method':'POST','uri':_0x3cb1f6+_0x5de6('0x6a'),'qs':{'refresh_token':_0x4780e2[_0x5de6('0x6b')],'client_id':_0x4780e2['clientId'],'client_secret':_0x4780e2[_0x5de6('0x6c')],'grant_type':_0x5de6('0x6d')},'json':!![]};return rp(_0x66f3b0)['then'](function(_0x6e2663){if(_0x6e2663[_0x5de6('0x6e')]){_0x212a64(_0x6e2663[_0x5de6('0x6e')]);}else{_0x2a0df1('Unable\x20to\x20retrieve\x20the\x20access\x20token');}})[_0x5de6('0x52')](function(_0x4ec219){_0x2a0df1(_0x4ec219);});});}exports[_0x5de6('0x6f')]=function(_0x455bdf,_0x14c1af,_0x3a6c1c){var _0x4869b3,_0xf5e5f6,_0x4195c0,_0x119331,_0x49b749;return db[_0x5de6('0x39')]['findOne']({'where':{'id':_0x455bdf[_0x5de6('0x54')]['id']},'attributes':['id','host',_0x5de6('0x66'),_0x5de6('0x70'),_0x5de6('0x6c'),_0x5de6('0x71'),_0x5de6('0x2a'),_0x5de6('0x6b')]})[_0x5de6('0x22')](handleEntityNotFound(_0x14c1af,null))[_0x5de6('0x22')](function(_0x24aee5){_0x49b749=_0x24aee5;_0x4869b3=_0x49b749[_0x5de6('0x72')];_0xf5e5f6=_0x4869b3===_0x5de6('0x73')?'eu':'com';_0x4195c0=_0x49b749[_0x5de6('0x71')];var _0x139c84=_0x4195c0[_0x5de6('0x74')](-0x1);if(_0x139c84==='/'||_0x139c84==='\x5c'||_0x139c84===':'){_0x4195c0=_0x4195c0[_0x5de6('0x75')](0x0,_0x4195c0['lastIndexOf'](_0x139c84));}if(!_0x49b749['refreshToken']){throw new Error(_0x5de6('0x76'));}return getAccessToken(_0x49b749);})[_0x5de6('0x22')](function(_0x2ae18c){if(_0x2ae18c){return rp({'method':_0x5de6('0x77'),'uri':util['format'](_0x5de6('0x78'),_0xf5e5f6),'qs':{'module':_0x5de6('0x79')},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x2ae18c},'json':!![]});}})[_0x5de6('0x22')](function(_0x36c4a7){if(_0x36c4a7){if(_0x36c4a7[_0x5de6('0x7a')]&&_0x36c4a7['response'][_0x5de6('0x29')]){throw new Error(_0x36c4a7[_0x5de6('0x7a')][_0x5de6('0x29')][_0x5de6('0x2b')]);}var _0xcca6b7=[];var _0x49ebee=[];var _0x1a2a87=[_0x5de6('0x7b'),_0x5de6('0x7c'),'Description','WhoId',_0x5de6('0x7d'),'Call_Result',_0x5de6('0x7e'),_0x5de6('0x7f')];_0x49ebee=_[_0x5de6('0x80')](_0x36c4a7[_0x5de6('0x40')],function(_0x831d51){return _0x1a2a87[_0x5de6('0x81')](_0x831d51[_0x5de6('0x82')]);});for(var _0x3c89a6=0x0;_0x3c89a6<_0x49ebee[_0x5de6('0x41')];_0x3c89a6++){if(_0x49ebee[_0x3c89a6][_0x5de6('0x83')]===![]){_0xcca6b7[_0x5de6('0x84')]({'id':_0x49ebee[_0x3c89a6]['id'],'name':_0x49ebee[_0x3c89a6]['display_label'],'custom':_0x49ebee[_0x3c89a6][_0x5de6('0x85')],'options':_0x49ebee[_0x3c89a6]['data_type']===_0x5de6('0x86')&&_0x49ebee[_0x3c89a6][_0x5de6('0x87')][_0x5de6('0x41')]>-0x1?_[_0x5de6('0x49')](_0x49ebee[_0x3c89a6][_0x5de6('0x87')],function(_0x3a7dad){return{'name':_0x3a7dad,'value':_0x3a7dad};}):[]});}}return{'count':_0xcca6b7['length'],'rows':_0xcca6b7};}else{return{'count':0x0,'rows':[]};}})[_0x5de6('0x22')](respondWithResult(_0x14c1af,null))['catch'](function(_0x405afb){var _0x32b929=_0x455bdf[_0x5de6('0x3a')][_0x5de6('0x88')]?0x1f4:_0x405afb[_0x5de6('0x89')]||0x1f4;logger[_0x5de6('0x29')](_0x5de6('0x8a'),_0x5de6('0x6f'),_0x32b929,JSON[_0x5de6('0x28')](_0x405afb));delete _0x405afb[_0x5de6('0x37')];if(_0x32b929===0x191){_0x32b929=0x190;}_0x14c1af[_0x5de6('0x2e')](_0x32b929)[_0x5de6('0x8b')](_0x455bdf['query'][_0x5de6('0x88')]?{'message':_0x5de6('0x8c'),'statusCode':_0x405afb[_0x5de6('0x89')]}:_0x405afb);});}; \ No newline at end of file +var _0xe37b=['model','keys','query','filters','intersection','attributes','fields','length','nolimit','limit','order','sort','where','pick','filter','merge','type','key','VIRTUAL','options','includeAll','include','rows','params','find','create','body','update','getConfigurations','findOne','ZohoConfiguration','map','hasOwnProperty','AccountId','Subjects','channel','Descriptions','ZohoField','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.com.cn','POST','refreshToken','clientId','refresh_token','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','getFields','zone','clientSecret','serverUrl','host','zoho.eu','substring','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','GET','https://www.zohoapis.%s/crm/v2/settings/fields','Calls','response','Owner','Subject','Description','WhoId','Call_Duration','Call_Result','Call_Start_Time','remove','includes','api_name','system_mandatory','push','data_type','picklist','pick_list_values','statusCode','Wrong\x20credentials','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/logger','../../config/utils','../../components/integrations/configuration','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','ZohoAccount,\x20%s,\x20%s','ZohoAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','count','offset','set','json','apply','reject','save','destroy','stack','name','send','ZohoAccount','rawAttributes'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe37b,0xcc));var _0xbe37=function(_0xde9791,_0x1be3d2){_0xde9791=_0xde9791-0x0;var _0x4a2dfd=_0xe37b[_0xde9791];return _0x4a2dfd;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0xbe37('0x0'));var zipdir=require(_0xbe37('0x1'));var jsonpatch=require(_0xbe37('0x2'));var rp=require(_0xbe37('0x3'));var moment=require(_0xbe37('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xbe37('0x5'));var path=require('path');var sox=require(_0xbe37('0x6'));var csv=require(_0xbe37('0x7'));var ejs=require(_0xbe37('0x8'));var fs=require('fs');var _=require(_0xbe37('0x9'));var squel=require(_0xbe37('0xa'));var crypto=require('crypto');var jsforce=require(_0xbe37('0xb'));var deskjs=require(_0xbe37('0xc'));var toCsv=require(_0xbe37('0x7'));var querystring=require(_0xbe37('0xd'));var Papa=require(_0xbe37('0xe'));var Redis=require('ioredis');var authService=require(_0xbe37('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xbe37('0x10'))('api');var utils=require(_0xbe37('0x11'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var integrations=require(_0xbe37('0x12'));var jayson=require(_0xbe37('0x13'));var client=jayson[_0xbe37('0x14')][_0xbe37('0x15')]({'port':0x232a});function checkPasswordPattern(_0x3663bd,_0x61d0f3,_0x22786f){if(_0x22786f){var _0x444c39=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x444c39[_0xbe37('0x16')](_0x61d0f3)){return _0x3663bd;}else{throw new Error(_0xbe37('0x17'));}}else{return _0x3663bd;}}function respondWithRpcPromise(_0x14f4cd,_0x53e8a7,_0x2fa9cf,_0x36bab4){return new BPromise(function(_0xc0abe1,_0x314b9f){var _0x114ad7=_0x36bab4||client;return _0x114ad7[_0xbe37('0x18')](_0x14f4cd,_0x2fa9cf)[_0xbe37('0x19')](function(_0x10ff91){logger['info'](_0xbe37('0x1a'),_0x53e8a7,'request\x20sent');logger['debug'](_0xbe37('0x1b'),_0x53e8a7,'request\x20sent',JSON[_0xbe37('0x1c')](_0x10ff91));if(_0x10ff91[_0xbe37('0x1d')]){if(_0x10ff91['error'][_0xbe37('0x1e')]===0x1f4){logger[_0xbe37('0x1d')](_0xbe37('0x1a'),_0x53e8a7,_0x10ff91[_0xbe37('0x1d')]['message']);return _0x314b9f(_0x10ff91[_0xbe37('0x1d')]['message']);}logger[_0xbe37('0x1d')]('ZohoAccount,\x20%s,\x20%s',_0x53e8a7,_0x10ff91[_0xbe37('0x1d')][_0xbe37('0x1f')]);return _0xc0abe1(_0x10ff91[_0xbe37('0x1d')][_0xbe37('0x1f')]);}else{logger['info'](_0xbe37('0x1a'),_0x53e8a7,'request\x20sent');_0xc0abe1(_0x10ff91[_0xbe37('0x20')][_0xbe37('0x1f')]);}})[_0xbe37('0x21')](function(_0x52839f){logger['error']('ZohoAccount,\x20%s,\x20%s',_0x53e8a7,_0x52839f);_0x314b9f(_0x52839f);});});}function respondWithStatusCode(_0x46f2ed,_0x3be116){_0x3be116=_0x3be116||0xcc;return function(_0x1bdbb2){if(_0x1bdbb2){return _0x46f2ed[_0xbe37('0x22')](_0x3be116);}return _0x46f2ed[_0xbe37('0x23')](_0x3be116)[_0xbe37('0x24')]();};}function respondWithResult(_0x5381ee,_0x5ada04){_0x5ada04=_0x5ada04||0xc8;return function(_0x2dcf41){if(_0x2dcf41){return _0x5381ee[_0xbe37('0x23')](_0x5ada04)['json'](_0x2dcf41);}};}function respondWithFilteredResult(_0x559a6d,_0x2bddc3){return function(_0x4d7da9){if(_0x4d7da9){var _0x1ff5cf=_0x4d7da9[_0xbe37('0x25')],_0x1d6049=_0x2bddc3[_0xbe37('0x26')],_0xb25704=_0x2bddc3['offset']+_0x2bddc3['limit'],_0x24e0e4;if(_0xb25704>=_0x1ff5cf){_0xb25704=_0x1ff5cf;_0x24e0e4=0xc8;}else{_0x24e0e4=0xce;}_0x559a6d[_0xbe37('0x23')](_0x24e0e4);return _0x559a6d[_0xbe37('0x27')]('Content-Range',_0x1d6049+'-'+_0xb25704+'/'+_0x1ff5cf)[_0xbe37('0x28')](_0x4d7da9);}return null;};}function patchUpdates(_0x4b1c66){return function(_0x38b2d0){try{jsonpatch[_0xbe37('0x29')](_0x38b2d0,_0x4b1c66,!![]);}catch(_0x449f3c){return BPromise[_0xbe37('0x2a')](_0x449f3c);}return _0x38b2d0[_0xbe37('0x2b')]();};}function saveUpdates(_0x5ac146,_0x1b75ee){return function(_0x1eb338){if(_0x1eb338){return _0x1eb338['update'](_0x5ac146)[_0xbe37('0x19')](function(_0x5e3633){return _0x5e3633;});}return null;};}function removeEntity(_0x18368c,_0x268604){return function(_0x3f06af){if(_0x3f06af){return _0x3f06af[_0xbe37('0x2c')]()[_0xbe37('0x19')](function(){_0x18368c[_0xbe37('0x23')](0xcc)[_0xbe37('0x24')]();});}};}function handleEntityNotFound(_0x464a21,_0x36b294){return function(_0x5b09be){if(!_0x5b09be){_0x464a21[_0xbe37('0x22')](0x194);}return _0x5b09be;};}function handleError(_0xf20916,_0x52b1fa){_0x52b1fa=_0x52b1fa||0x1f4;return function(_0x2993f0){logger['error'](_0x2993f0[_0xbe37('0x2d')]);if(_0x2993f0[_0xbe37('0x2e')]){delete _0x2993f0[_0xbe37('0x2e')];}_0xf20916[_0xbe37('0x23')](_0x52b1fa)[_0xbe37('0x2f')](_0x2993f0);};}exports['index']=function(_0x288470,_0x337c06){var _0x5f3d03={},_0x1f6d70={},_0xa6c920={'count':0x0,'rows':[]};var _0x325566=db[_0xbe37('0x30')][_0xbe37('0x31')];_0x1f6d70[_0xbe37('0x32')]=_[_0xbe37('0x33')](_0x325566);_0x1f6d70[_0xbe37('0x34')]=_[_0xbe37('0x33')](_0x288470[_0xbe37('0x34')]);_0x1f6d70[_0xbe37('0x35')]=_[_0xbe37('0x36')](_0x1f6d70['model'],_0x1f6d70[_0xbe37('0x34')]);_0x5f3d03[_0xbe37('0x37')]=_[_0xbe37('0x36')](_0x1f6d70[_0xbe37('0x32')],qs[_0xbe37('0x38')](_0x288470[_0xbe37('0x34')][_0xbe37('0x38')]));_0x5f3d03[_0xbe37('0x37')]=_0x5f3d03[_0xbe37('0x37')][_0xbe37('0x39')]?_0x5f3d03[_0xbe37('0x37')]:_0x1f6d70[_0xbe37('0x32')];if(!_0x288470['query']['hasOwnProperty'](_0xbe37('0x3a'))){_0x5f3d03[_0xbe37('0x3b')]=qs[_0xbe37('0x3b')](_0x288470[_0xbe37('0x34')]['limit']);_0x5f3d03['offset']=qs['offset'](_0x288470['query'][_0xbe37('0x26')]);}_0x5f3d03[_0xbe37('0x3c')]=qs[_0xbe37('0x3d')](_0x288470['query'][_0xbe37('0x3d')]);_0x5f3d03[_0xbe37('0x3e')]=qs[_0xbe37('0x35')](_[_0xbe37('0x3f')](_0x288470[_0xbe37('0x34')],_0x1f6d70[_0xbe37('0x35')]));if(_0x288470[_0xbe37('0x34')][_0xbe37('0x40')]){_0x5f3d03[_0xbe37('0x3e')]=_[_0xbe37('0x41')](_0x5f3d03[_0xbe37('0x3e')],{'$or':_['map'](_0x325566,function(_0x118e96){if(_0x118e96[_0xbe37('0x42')][_0xbe37('0x43')]!==_0xbe37('0x44')){var _0x54733b={};_0x54733b[_0x118e96['field']]={'$like':'%'+_0x288470['query'][_0xbe37('0x40')]+'%'};return _0x54733b;}})});}_0x5f3d03=_['merge']({},_0x5f3d03,_0x288470[_0xbe37('0x45')]);var _0x156373={'where':_0x5f3d03[_0xbe37('0x3e')]};return db['ZohoAccount'][_0xbe37('0x25')](_0x156373)[_0xbe37('0x19')](function(_0x57be16){_0xa6c920['count']=_0x57be16;if(_0x288470[_0xbe37('0x34')][_0xbe37('0x46')]){_0x5f3d03[_0xbe37('0x47')]=[{'all':!![]}];}return db[_0xbe37('0x30')]['findAll'](_0x5f3d03);})[_0xbe37('0x19')](function(_0x580cf6){_0xa6c920[_0xbe37('0x48')]=_0x580cf6;return _0xa6c920;})[_0xbe37('0x19')](respondWithFilteredResult(_0x337c06,_0x5f3d03))[_0xbe37('0x21')](handleError(_0x337c06,null));};exports['show']=function(_0x4949d0,_0x3035d6){var _0x5cc1a6={'raw':![],'where':{'id':_0x4949d0[_0xbe37('0x49')]['id']}},_0x258241={};_0x258241[_0xbe37('0x32')]=_[_0xbe37('0x33')](db[_0xbe37('0x30')][_0xbe37('0x31')]);_0x258241[_0xbe37('0x34')]=_[_0xbe37('0x33')](_0x4949d0[_0xbe37('0x34')]);_0x258241[_0xbe37('0x35')]=_[_0xbe37('0x36')](_0x258241[_0xbe37('0x32')],_0x258241['query']);_0x5cc1a6['attributes']=_[_0xbe37('0x36')](_0x258241['model'],qs[_0xbe37('0x38')](_0x4949d0[_0xbe37('0x34')][_0xbe37('0x38')]));_0x5cc1a6[_0xbe37('0x37')]=_0x5cc1a6[_0xbe37('0x37')][_0xbe37('0x39')]?_0x5cc1a6['attributes']:_0x258241[_0xbe37('0x32')];if(_0x4949d0[_0xbe37('0x34')][_0xbe37('0x46')]){_0x5cc1a6[_0xbe37('0x47')]=[{'all':!![]}];}_0x5cc1a6=_[_0xbe37('0x41')]({},_0x5cc1a6,_0x4949d0['options']);return db[_0xbe37('0x30')][_0xbe37('0x4a')](_0x5cc1a6)['then'](handleEntityNotFound(_0x3035d6,null))[_0xbe37('0x19')](respondWithResult(_0x3035d6,null))['catch'](handleError(_0x3035d6,null));};exports[_0xbe37('0x4b')]=function(_0x6c4b3f,_0x56633b){return db[_0xbe37('0x30')][_0xbe37('0x4b')](_0x6c4b3f[_0xbe37('0x4c')],{})[_0xbe37('0x19')](respondWithResult(_0x56633b,0xc9))[_0xbe37('0x21')](handleError(_0x56633b,null));};exports[_0xbe37('0x4d')]=function(_0x2218e3,_0x41c317){if(_0x2218e3[_0xbe37('0x4c')]['id']){delete _0x2218e3[_0xbe37('0x4c')]['id'];}return db[_0xbe37('0x30')][_0xbe37('0x4a')]({'where':{'id':_0x2218e3[_0xbe37('0x49')]['id']}})[_0xbe37('0x19')](handleEntityNotFound(_0x41c317,null))[_0xbe37('0x19')](saveUpdates(_0x2218e3[_0xbe37('0x4c')],null))[_0xbe37('0x19')](respondWithResult(_0x41c317,null))[_0xbe37('0x21')](handleError(_0x41c317,null));};exports['destroy']=function(_0x2d1e31,_0x30e7f3){return db['ZohoAccount'][_0xbe37('0x4a')]({'where':{'id':_0x2d1e31[_0xbe37('0x49')]['id']}})['then'](handleEntityNotFound(_0x30e7f3,null))['then'](removeEntity(_0x30e7f3,null))[_0xbe37('0x21')](handleError(_0x30e7f3,null));};exports[_0xbe37('0x4e')]=function(_0x1a276b,_0xe8034d,_0x1e245e){var _0x540e0a={};var _0x57fdbd={};var _0x45e739;var _0x4a73b7;return db[_0xbe37('0x30')][_0xbe37('0x4f')]({'where':{'id':_0x1a276b[_0xbe37('0x49')]['id']}})[_0xbe37('0x19')](handleEntityNotFound(_0xe8034d,null))[_0xbe37('0x19')](function(_0x3a523e){if(_0x3a523e){_0x45e739=_0x3a523e;_0x57fdbd[_0xbe37('0x32')]=_[_0xbe37('0x33')](db[_0xbe37('0x50')][_0xbe37('0x31')]);_0x57fdbd['query']=_['keys'](_0x1a276b['query']);_0x57fdbd[_0xbe37('0x35')]=_[_0xbe37('0x36')](_0x57fdbd[_0xbe37('0x32')],_0x57fdbd[_0xbe37('0x34')]);_0x540e0a['attributes']=_[_0xbe37('0x36')](_0x57fdbd[_0xbe37('0x32')],qs['fields'](_0x1a276b['query'][_0xbe37('0x38')]));_0x540e0a[_0xbe37('0x37')]=_0x540e0a[_0xbe37('0x37')][_0xbe37('0x39')]?_0x540e0a[_0xbe37('0x37')]:_0x57fdbd[_0xbe37('0x32')];_0x540e0a[_0xbe37('0x3c')]=qs[_0xbe37('0x3d')](_0x1a276b[_0xbe37('0x34')][_0xbe37('0x3d')]);_0x540e0a[_0xbe37('0x3e')]=qs[_0xbe37('0x35')](_[_0xbe37('0x3f')](_0x1a276b[_0xbe37('0x34')],_0x57fdbd[_0xbe37('0x35')]));if(_0x1a276b[_0xbe37('0x34')][_0xbe37('0x40')]){_0x540e0a['where']=_[_0xbe37('0x41')](_0x540e0a[_0xbe37('0x3e')],{'$or':_[_0xbe37('0x51')](_0x540e0a[_0xbe37('0x37')],function(_0x1f45f7){var _0x5d5ea7={};_0x5d5ea7[_0x1f45f7]={'$like':'%'+_0x1a276b[_0xbe37('0x34')][_0xbe37('0x40')]+'%'};return _0x5d5ea7;})});}_0x540e0a=_['merge']({},_0x540e0a,_0x1a276b[_0xbe37('0x45')]);return _0x45e739['getConfigurations'](_0x540e0a);}})[_0xbe37('0x19')](function(_0x3f8e47){if(_0x3f8e47){_0x4a73b7=_0x3f8e47[_0xbe37('0x39')];if(!_0x1a276b[_0xbe37('0x34')][_0xbe37('0x52')]('nolimit')){_0x540e0a[_0xbe37('0x3b')]=qs['limit'](_0x1a276b['query'][_0xbe37('0x3b')]);_0x540e0a[_0xbe37('0x26')]=qs[_0xbe37('0x26')](_0x1a276b['query']['offset']);}return _0x45e739['getConfigurations'](_0x540e0a);}})['then'](function(_0x1fc315){if(_0x1fc315){return _0x1fc315?{'count':_0x4a73b7,'rows':_0x1fc315}:null;}})['then'](respondWithResult(_0xe8034d,null))[_0xbe37('0x21')](handleError(_0xe8034d,null));};exports['addConfiguration']=function(_0x57eb75,_0x3bea00,_0xb03e16){if(_0x57eb75[_0xbe37('0x4c')]['id']){delete _0x57eb75[_0xbe37('0x4c')]['id'];}return db[_0xbe37('0x30')][_0xbe37('0x4f')]({'where':{'id':_0x57eb75[_0xbe37('0x49')]['id']}})[_0xbe37('0x19')](handleEntityNotFound(_0x3bea00,null))[_0xbe37('0x19')](function(_0x183e1c){if(_0x183e1c){_0x57eb75[_0xbe37('0x4c')][_0xbe37('0x53')]=_0x183e1c['id'];_0x57eb75['body'][_0xbe37('0x54')]=integrations['getSubjects'](_0x57eb75['body'][_0xbe37('0x55')],_0x57eb75[_0xbe37('0x4c')][_0xbe37('0x42')]);_0x57eb75[_0xbe37('0x4c')][_0xbe37('0x56')]=integrations['getDescriptions'](_0x57eb75[_0xbe37('0x4c')][_0xbe37('0x55')],_0x57eb75[_0xbe37('0x4c')][_0xbe37('0x42')]);return db[_0xbe37('0x50')][_0xbe37('0x4b')](_0x57eb75[_0xbe37('0x4c')],{'include':[{'model':db[_0xbe37('0x57')],'as':_0xbe37('0x54')},{'model':db['ZohoField'],'as':_0xbe37('0x56')}]});}return null;})[_0xbe37('0x19')](respondWithResult(_0x3bea00,null))[_0xbe37('0x21')](handleError(_0x3bea00,null));};function getAccessToken(_0x3688ae){return new Promise(function(_0x4bf186,_0x53f6f4){var _0xf799c7;switch(_0x3688ae['zone']){case'US':_0xf799c7=_0xbe37('0x58');break;case'AU':_0xf799c7=_0xbe37('0x59');break;case'EU':_0xf799c7=_0xbe37('0x5a');break;case'IN':_0xf799c7='https://accounts.zoho.in';break;case'CN':_0xf799c7=_0xbe37('0x5b');break;default:_0xf799c7=_0xbe37('0x5a');break;}var _0xa66224={'method':_0xbe37('0x5c'),'uri':_0xf799c7+'/oauth/v2/token','qs':{'refresh_token':_0x3688ae[_0xbe37('0x5d')],'client_id':_0x3688ae[_0xbe37('0x5e')],'client_secret':_0x3688ae['clientSecret'],'grant_type':_0xbe37('0x5f')},'json':!![]};return rp(_0xa66224)[_0xbe37('0x19')](function(_0x5693ed){if(_0x5693ed[_0xbe37('0x60')]){_0x4bf186(_0x5693ed[_0xbe37('0x60')]);}else{_0x53f6f4(_0xbe37('0x61'));}})['catch'](function(_0x34d6f9){_0x53f6f4(_0x34d6f9);});});}exports[_0xbe37('0x62')]=function(_0x282c1e,_0x52ecca,_0x4f9b37){var _0x4f2d9b,_0x4236cd,_0x30df62,_0x3cdca5,_0x4b860b;return db[_0xbe37('0x30')][_0xbe37('0x4f')]({'where':{'id':_0x282c1e[_0xbe37('0x49')]['id']},'attributes':['id','host',_0xbe37('0x63'),_0xbe37('0x5e'),_0xbe37('0x64'),_0xbe37('0x65'),_0xbe37('0x1e'),_0xbe37('0x5d')]})[_0xbe37('0x19')](handleEntityNotFound(_0x52ecca,null))['then'](function(_0x598e0e){_0x4b860b=_0x598e0e;_0x4f2d9b=_0x4b860b[_0xbe37('0x66')];_0x4236cd=_0x4f2d9b===_0xbe37('0x67')?'eu':'com';_0x30df62=_0x4b860b['serverUrl'];var _0x18b5ce=_0x30df62['slice'](-0x1);if(_0x18b5ce==='/'||_0x18b5ce==='\x5c'||_0x18b5ce===':'){_0x30df62=_0x30df62[_0xbe37('0x68')](0x0,_0x30df62['lastIndexOf'](_0x18b5ce));}if(!_0x4b860b[_0xbe37('0x5d')]){throw new Error(_0xbe37('0x69'));}return getAccessToken(_0x4b860b);})[_0xbe37('0x19')](function(_0x5d6154){if(_0x5d6154){return rp({'method':_0xbe37('0x6a'),'uri':util['format'](_0xbe37('0x6b'),_0x4236cd),'qs':{'module':_0xbe37('0x6c')},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x5d6154},'json':!![]});}})[_0xbe37('0x19')](function(_0x527b16){if(_0x527b16){if(_0x527b16[_0xbe37('0x6d')]&&_0x527b16[_0xbe37('0x6d')][_0xbe37('0x1d')]){throw new Error(_0x527b16[_0xbe37('0x6d')]['error'][_0xbe37('0x1f')]);}var _0x23af09=[];var _0x97a090=[];var _0x22a853=[_0xbe37('0x6e'),_0xbe37('0x6f'),_0xbe37('0x70'),_0xbe37('0x71'),_0xbe37('0x72'),_0xbe37('0x73'),_0xbe37('0x74'),'Call_Type'];_0x97a090=_[_0xbe37('0x75')](_0x527b16['fields'],function(_0x39c7eb){return _0x22a853[_0xbe37('0x76')](_0x39c7eb[_0xbe37('0x77')]);});for(var _0x37f31c=0x0;_0x37f31c<_0x97a090[_0xbe37('0x39')];_0x37f31c++){if(_0x97a090[_0x37f31c][_0xbe37('0x78')]===![]){_0x23af09[_0xbe37('0x79')]({'id':_0x97a090[_0x37f31c]['id'],'name':_0x97a090[_0x37f31c]['display_label'],'custom':_0x97a090[_0x37f31c]['custom_field'],'options':_0x97a090[_0x37f31c][_0xbe37('0x7a')]===_0xbe37('0x7b')&&_0x97a090[_0x37f31c][_0xbe37('0x7c')][_0xbe37('0x39')]>-0x1?_[_0xbe37('0x51')](_0x97a090[_0x37f31c][_0xbe37('0x7c')],function(_0x59c809){return{'name':_0x59c809,'value':_0x59c809};}):[]});}}return{'count':_0x23af09[_0xbe37('0x39')],'rows':_0x23af09};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithResult(_0x52ecca,null))[_0xbe37('0x21')](function(_0x4f70b0){var _0x1d2ba6=_0x282c1e[_0xbe37('0x34')][_0xbe37('0x16')]?0x1f4:_0x4f70b0[_0xbe37('0x7d')]||0x1f4;logger[_0xbe37('0x1d')]('getFields,\x20%s,\x20%s,\x20%s',_0xbe37('0x62'),_0x1d2ba6,JSON[_0xbe37('0x1c')](_0x4f70b0));delete _0x4f70b0[_0xbe37('0x2e')];if(_0x1d2ba6===0x191){_0x1d2ba6=0x190;}_0x52ecca['status'](_0x1d2ba6)[_0xbe37('0x2f')](_0x282c1e[_0xbe37('0x34')]['test']?{'message':_0xbe37('0x7e'),'statusCode':_0x4f70b0['statusCode']}:_0x4f70b0);});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.model.js b/server/api/intZohoAccount/intZohoAccount.model.js index 72f0d20..dceab77 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 _0x4130=['bluebird','request-promise','../../config/environment','./intZohoAccount.attributes','../../components/integrations/configuration','define','ZohoAccount','int_zoho_accounts','changed','zone','serverUrl','clientId','clientSecret','host','slice','https://accounts.zoho.in','https://accounts.zoho.eu','/oauth/v2/token','authorization_code','code','then','parse','refreshToken','info','format','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','name','inspect','catch','error','substring','lastIndexOf','https://accounts.zoho.com','https://accounts.zoho.com.au','application/x-www-form-urlencoded','refresh_token','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','util','../../config/logger','moment'];(function(_0x2107a6,_0xe8360d){var _0x2f09ef=function(_0x46a86a){while(--_0x46a86a){_0x2107a6['push'](_0x2107a6['shift']());}};_0x2f09ef(++_0xe8360d);}(_0x4130,0xed));var _0x0413=function(_0x9b4d6b,_0x1868ce){_0x9b4d6b=_0x9b4d6b-0x0;var _0x353225=_0x4130[_0x9b4d6b];return _0x353225;};'use strict';var _=require('lodash');var util=require(_0x0413('0x0'));var logger=require(_0x0413('0x1'))('api');var moment=require(_0x0413('0x2'));var BPromise=require(_0x0413('0x3'));var rp=require(_0x0413('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x0413('0x5'));var attributes=require(_0x0413('0x6'));var integrations=require(_0x0413('0x7'));module['exports']=function(_0x10b06a,_0x2f1d6b){return _0x10b06a[_0x0413('0x8')](_0x0413('0x9'),attributes,{'tableName':_0x0413('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0xf875e3,_0x17204b,_0x2b1f88){if(_0xf875e3[_0x0413('0xb')](_0x0413('0xc'))||_0xf875e3['changed'](_0x0413('0xd'))||_0xf875e3[_0x0413('0xb')](_0x0413('0xe'))||_0xf875e3[_0x0413('0xb')](_0x0413('0xf'))||_0xf875e3[_0x0413('0xb')]('code')||_0xf875e3['changed'](_0x0413('0x10'))){var _0x345005,_0x1a4e1d;_0x345005=_0xf875e3[_0x0413('0xd')];var _0x35220c=_0x345005[_0x0413('0x11')](-0x1);if(_0x35220c==='/'||_0x35220c==='\x5c'||_0x35220c===':'){_0x345005=_0x345005['substring'](0x0,_0x345005['lastIndexOf'](_0x35220c));}switch(_0xf875e3[_0x0413('0xc')]){case'US':_0x1a4e1d='https://accounts.zoho.com';break;case'AU':_0x1a4e1d='https://accounts.zoho.com.au';break;case'IN':_0x1a4e1d=_0x0413('0x12');break;case'CN':_0x1a4e1d='https://accounts.zoho.com.cn';break;default:_0x1a4e1d=_0x0413('0x13');break;}var _0x1406ff={'method':'POST','uri':_0x1a4e1d+_0x0413('0x14'),'form':{'grant_type':_0x0413('0x15'),'client_id':_0xf875e3[_0x0413('0xe')],'client_secret':_0xf875e3[_0x0413('0xf')],'redirect_uri':_0xf875e3['serverUrl'],'code':_0xf875e3[_0x0413('0x16')]},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0x1406ff)[_0x0413('0x17')](function(_0xe8fbcb){var _0x13f60d=JSON[_0x0413('0x18')](_0xe8fbcb);if(_0x13f60d['refresh_token']){_0xf875e3[_0x0413('0x19')]=_0x13f60d['refresh_token'];logger[_0x0413('0x1a')](util[_0x0413('0x1b')](_0x0413('0x1c'),_0xf875e3[_0x0413('0x1d')],_0xf875e3['id']));}else{logger['error'](util['format']('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0xf875e3[_0x0413('0x1d')],_0xf875e3['id']),util[_0x0413('0x1e')](_0x13f60d,{'showHidden':![],'depth':null}));}return _0x2b1f88(null,_0x17204b);})[_0x0413('0x1f')](function(_0x47c71d){logger[_0x0413('0x20')](util[_0x0413('0x1b')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0xf875e3[_0x0413('0x1d')],_0xf875e3['id']),util[_0x0413('0x1e')](parsedResult,{'showHidden':![],'depth':null}));return _0x2b1f88(_0x47c71d);});}else{return _0x2b1f88(null,_0x17204b);}},'beforeUpdate':function(_0x40e937,_0x1b31f7,_0x5cf686){if(_0x40e937['changed'](_0x0413('0xc'))||_0x40e937[_0x0413('0xb')](_0x0413('0xd'))||_0x40e937['changed'](_0x0413('0xe'))||_0x40e937['changed'](_0x0413('0xf'))||_0x40e937[_0x0413('0xb')](_0x0413('0x16'))||_0x40e937[_0x0413('0xb')](_0x0413('0x10'))){var _0x214954,_0x5a7055;_0x214954=_0x40e937[_0x0413('0xd')];var _0xb6f682=_0x214954[_0x0413('0x11')](-0x1);if(_0xb6f682==='/'||_0xb6f682==='\x5c'||_0xb6f682===':'){_0x214954=_0x214954[_0x0413('0x21')](0x0,_0x214954[_0x0413('0x22')](_0xb6f682));}switch(_0x40e937['zone']){case'US':_0x5a7055=_0x0413('0x23');break;case'AU':_0x5a7055=_0x0413('0x24');break;case'IN':_0x5a7055=_0x0413('0x12');break;case'CN':_0x5a7055='https://accounts.zoho.com.cn';break;default:_0x5a7055='https://accounts.zoho.eu';break;}var _0x5a9ad9={'method':'POST','uri':_0x5a7055+_0x0413('0x14'),'form':{'grant_type':_0x0413('0x15'),'client_id':_0x40e937[_0x0413('0xe')],'client_secret':_0x40e937['clientSecret'],'redirect_uri':_0x40e937['serverUrl'],'code':_0x40e937[_0x0413('0x16')]},'headers':{'Content-Type':_0x0413('0x25')}};return rp(_0x5a9ad9)[_0x0413('0x17')](function(_0xc19ea2){var _0x58e223=JSON[_0x0413('0x18')](_0xc19ea2);if(_0x58e223['refresh_token']){_0x40e937[_0x0413('0x19')]=_0x58e223[_0x0413('0x26')];logger[_0x0413('0x1a')](util[_0x0413('0x1b')](_0x0413('0x1c'),_0x40e937[_0x0413('0x1d')],_0x40e937['id']));}else{logger[_0x0413('0x20')](util[_0x0413('0x1b')](_0x0413('0x27'),_0x40e937[_0x0413('0x1d')],_0x40e937['id']),util[_0x0413('0x1e')](_0x58e223,{'showHidden':![],'depth':null}));}return _0x5cf686(null,_0x1b31f7);})[_0x0413('0x1f')](function(_0x22e024){logger[_0x0413('0x20')](util[_0x0413('0x1b')](_0x0413('0x27'),_0x40e937['name'],_0x40e937['id']),util['inspect'](parsedResult,{'showHidden':![],'depth':null}));return _0x5cf686(_0x22e024);});}else{return _0x5cf686(null,_0x1b31f7);}}}});}; \ No newline at end of file +var _0xee6a=['path','../../config/environment','./intZohoAccount.attributes','../../components/integrations/configuration','define','ZohoAccount','int_zoho_accounts','changed','serverUrl','clientSecret','code','host','slice','substring','lastIndexOf','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.com.cn','https://accounts.zoho.eu','POST','/oauth/v2/token','clientId','application/x-www-form-urlencoded','then','refresh_token','format','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','name','error','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','inspect','zone','authorization_code','parse','refreshToken','info','catch','lodash','util','api','moment','bluebird','request-promise'];(function(_0x342ab1,_0x4caf00){var _0x5ceb32=function(_0x146af7){while(--_0x146af7){_0x342ab1['push'](_0x342ab1['shift']());}};_0x5ceb32(++_0x4caf00);}(_0xee6a,0xfc));var _0xaee6=function(_0x1263d9,_0x1ff0b2){_0x1263d9=_0x1263d9-0x0;var _0x711253=_0xee6a[_0x1263d9];return _0x711253;};'use strict';var _=require(_0xaee6('0x0'));var util=require(_0xaee6('0x1'));var logger=require('../../config/logger')(_0xaee6('0x2'));var moment=require(_0xaee6('0x3'));var BPromise=require(_0xaee6('0x4'));var rp=require(_0xaee6('0x5'));var fs=require('fs');var path=require(_0xaee6('0x6'));var rimraf=require('rimraf');var config=require(_0xaee6('0x7'));var attributes=require(_0xaee6('0x8'));var integrations=require(_0xaee6('0x9'));module['exports']=function(_0x2707b9,_0x35fef7){return _0x2707b9[_0xaee6('0xa')](_0xaee6('0xb'),attributes,{'tableName':_0xaee6('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x301b41,_0x2c9112,_0x17c08a){if(_0x301b41[_0xaee6('0xd')]('zone')||_0x301b41[_0xaee6('0xd')](_0xaee6('0xe'))||_0x301b41['changed']('clientId')||_0x301b41[_0xaee6('0xd')](_0xaee6('0xf'))||_0x301b41[_0xaee6('0xd')](_0xaee6('0x10'))||_0x301b41[_0xaee6('0xd')](_0xaee6('0x11'))){var _0x58f76f,_0x50cffc;_0x58f76f=_0x301b41['serverUrl'];var _0x290480=_0x58f76f[_0xaee6('0x12')](-0x1);if(_0x290480==='/'||_0x290480==='\x5c'||_0x290480===':'){_0x58f76f=_0x58f76f[_0xaee6('0x13')](0x0,_0x58f76f[_0xaee6('0x14')](_0x290480));}switch(_0x301b41['zone']){case'US':_0x50cffc=_0xaee6('0x15');break;case'AU':_0x50cffc=_0xaee6('0x16');break;case'IN':_0x50cffc='https://accounts.zoho.in';break;case'CN':_0x50cffc=_0xaee6('0x17');break;default:_0x50cffc=_0xaee6('0x18');break;}var _0x435b63={'method':_0xaee6('0x19'),'uri':_0x50cffc+_0xaee6('0x1a'),'form':{'grant_type':'authorization_code','client_id':_0x301b41[_0xaee6('0x1b')],'client_secret':_0x301b41[_0xaee6('0xf')],'redirect_uri':_0x301b41[_0xaee6('0xe')],'code':_0x301b41[_0xaee6('0x10')]},'headers':{'Content-Type':_0xaee6('0x1c')}};return rp(_0x435b63)[_0xaee6('0x1d')](function(_0x2e8e79){var _0x560302=JSON['parse'](_0x2e8e79);if(_0x560302['refresh_token']){_0x301b41['refreshToken']=_0x560302[_0xaee6('0x1e')];logger['info'](util[_0xaee6('0x1f')](_0xaee6('0x20'),_0x301b41[_0xaee6('0x21')],_0x301b41['id']));}else{logger[_0xaee6('0x22')](util['format'](_0xaee6('0x23'),_0x301b41[_0xaee6('0x21')],_0x301b41['id']),util[_0xaee6('0x24')](_0x560302,{'showHidden':![],'depth':null}));}return _0x17c08a(null,_0x2c9112);})['catch'](function(_0x2968ce){logger[_0xaee6('0x22')](util[_0xaee6('0x1f')](_0xaee6('0x23'),_0x301b41[_0xaee6('0x21')],_0x301b41['id']),util[_0xaee6('0x24')](parsedResult,{'showHidden':![],'depth':null}));return _0x17c08a(_0x2968ce);});}else{return _0x17c08a(null,_0x2c9112);}},'beforeUpdate':function(_0x4482ce,_0x39c96b,_0xbd92a){if(_0x4482ce[_0xaee6('0xd')](_0xaee6('0x25'))||_0x4482ce['changed'](_0xaee6('0xe'))||_0x4482ce[_0xaee6('0xd')](_0xaee6('0x1b'))||_0x4482ce[_0xaee6('0xd')](_0xaee6('0xf'))||_0x4482ce[_0xaee6('0xd')]('code')||_0x4482ce[_0xaee6('0xd')](_0xaee6('0x11'))){var _0x4be807,_0x196b24;_0x4be807=_0x4482ce[_0xaee6('0xe')];var _0x78e05=_0x4be807[_0xaee6('0x12')](-0x1);if(_0x78e05==='/'||_0x78e05==='\x5c'||_0x78e05===':'){_0x4be807=_0x4be807[_0xaee6('0x13')](0x0,_0x4be807[_0xaee6('0x14')](_0x78e05));}switch(_0x4482ce[_0xaee6('0x25')]){case'US':_0x196b24=_0xaee6('0x15');break;case'AU':_0x196b24=_0xaee6('0x16');break;case'IN':_0x196b24='https://accounts.zoho.in';break;case'CN':_0x196b24=_0xaee6('0x17');break;default:_0x196b24=_0xaee6('0x18');break;}var _0x4d9889={'method':_0xaee6('0x19'),'uri':_0x196b24+_0xaee6('0x1a'),'form':{'grant_type':_0xaee6('0x26'),'client_id':_0x4482ce[_0xaee6('0x1b')],'client_secret':_0x4482ce[_0xaee6('0xf')],'redirect_uri':_0x4482ce['serverUrl'],'code':_0x4482ce[_0xaee6('0x10')]},'headers':{'Content-Type':_0xaee6('0x1c')}};return rp(_0x4d9889)[_0xaee6('0x1d')](function(_0x1a717c){var _0x37cde2=JSON[_0xaee6('0x27')](_0x1a717c);if(_0x37cde2['refresh_token']){_0x4482ce[_0xaee6('0x28')]=_0x37cde2['refresh_token'];logger[_0xaee6('0x29')](util[_0xaee6('0x1f')]('ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d',_0x4482ce['name'],_0x4482ce['id']));}else{logger['error'](util[_0xaee6('0x1f')](_0xaee6('0x23'),_0x4482ce[_0xaee6('0x21')],_0x4482ce['id']),util[_0xaee6('0x24')](_0x37cde2,{'showHidden':![],'depth':null}));}return _0xbd92a(null,_0x39c96b);})[_0xaee6('0x2a')](function(_0x4dafee){logger[_0xaee6('0x22')](util[_0xaee6('0x1f')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x4482ce[_0xaee6('0x21')],_0x4482ce['id']),util[_0xaee6('0x24')](parsedResult,{'showHidden':![],'depth':null}));return _0xbd92a(_0x4dafee);});}else{return _0xbd92a(null,_0x39c96b);}}}});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.rpc.js b/server/api/intZohoAccount/intZohoAccount.rpc.js index 7a3db10..3ba2506 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 _0x052c=['util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','jayson/promise','client','http','request','then','info','ZohoAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','GetZohoAccount','ZohoAccount','options','raw','where','attributes','limit','include','model','map','ShowZohoAccount','lodash'];(function(_0x104f46,_0x57f51b){var _0x53ab0c=function(_0x39bc78){while(--_0x39bc78){_0x104f46['push'](_0x104f46['shift']());}};_0x53ab0c(++_0x57f51b);}(_0x052c,0xe6));var _0xc052=function(_0x1ae163,_0x2e50a5){_0x1ae163=_0x1ae163-0x0;var _0x277afe=_0x052c[_0x1ae163];return _0x277afe;};'use strict';var _=require(_0xc052('0x0'));var util=require(_0xc052('0x1'));var moment=require(_0xc052('0x2'));var BPromise=require(_0xc052('0x3'));var rs=require(_0xc052('0x4'));var fs=require('fs');var Redis=require(_0xc052('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xc052('0x6'))(_0xc052('0x7'));var config=require('../../config/environment');var jayson=require(_0xc052('0x8'));var client=jayson[_0xc052('0x9')][_0xc052('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x58e8a4,_0xb0d25b,_0x8fd3c3){return new BPromise(function(_0x7211ff,_0x350ec9){return client[_0xc052('0xb')](_0x58e8a4,_0x8fd3c3)[_0xc052('0xc')](function(_0x11c76f){logger[_0xc052('0xd')](_0xc052('0xe'),_0xb0d25b,_0xc052('0xf'));logger[_0xc052('0x10')]('ZohoAccount,\x20%s,\x20%s,\x20%s',_0xb0d25b,_0xc052('0xf'),JSON[_0xc052('0x11')](_0x11c76f));if(_0x11c76f[_0xc052('0x12')]){if(_0x11c76f[_0xc052('0x12')]['code']===0x1f4){logger['error'](_0xc052('0xe'),_0xb0d25b,_0x11c76f[_0xc052('0x12')][_0xc052('0x13')]);return _0x350ec9(_0x11c76f['error'][_0xc052('0x13')]);}logger['error'](_0xc052('0xe'),_0xb0d25b,_0x11c76f[_0xc052('0x12')]['message']);return _0x7211ff(_0x11c76f['error'][_0xc052('0x13')]);}else{logger[_0xc052('0xd')](_0xc052('0xe'),_0xb0d25b,'request\x20sent');_0x7211ff(_0x11c76f[_0xc052('0x14')]['message']);}})[_0xc052('0x15')](function(_0x13c401){logger[_0xc052('0x12')]('ZohoAccount,\x20%s,\x20%s',_0xb0d25b,_0x13c401);_0x350ec9(_0x13c401);});});}exports[_0xc052('0x16')]=function(_0x2dc290){var _0x2e9e87=this;return new Promise(function(_0x32b0ed,_0x5e843e){return db[_0xc052('0x17')]['findAll']({'raw':_0x2dc290[_0xc052('0x18')]?_0x2dc290[_0xc052('0x18')][_0xc052('0x19')]===undefined?!![]:![]:!![],'where':_0x2dc290['options']?_0x2dc290[_0xc052('0x18')][_0xc052('0x1a')]||null:null,'attributes':_0x2dc290[_0xc052('0x18')]?_0x2dc290[_0xc052('0x18')][_0xc052('0x1b')]||null:null,'limit':_0x2dc290['options']?_0x2dc290[_0xc052('0x18')][_0xc052('0x1c')]||null:null,'include':_0x2dc290['options']?_0x2dc290[_0xc052('0x18')][_0xc052('0x1d')]?_['map'](_0x2dc290[_0xc052('0x18')][_0xc052('0x1d')],function(_0x2f17b6){return{'model':db[_0x2f17b6[_0xc052('0x1e')]],'as':_0x2f17b6['as'],'attributes':_0x2f17b6['attributes'],'include':_0x2f17b6[_0xc052('0x1d')]?_['map'](_0x2f17b6['include'],function(_0x34d52f){return{'model':db[_0x34d52f[_0xc052('0x1e')]],'as':_0x34d52f['as'],'attributes':_0x34d52f['attributes'],'include':_0x34d52f[_0xc052('0x1d')]?_[_0xc052('0x1f')](_0x34d52f['include'],function(_0x1af454){return{'model':db[_0x1af454[_0xc052('0x1e')]],'as':_0x1af454['as'],'attributes':_0x1af454[_0xc052('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xc052('0xc')](function(_0x5d3764){logger[_0xc052('0xd')](_0xc052('0x16'),_0x2dc290);logger[_0xc052('0x10')](_0xc052('0x16'),_0x2dc290,JSON[_0xc052('0x11')](_0x5d3764));_0x32b0ed(_0x5d3764);})[_0xc052('0x15')](function(_0x2a1752){logger[_0xc052('0x12')](_0xc052('0x16'),_0x2a1752[_0xc052('0x13')],_0x2dc290);_0x5e843e(_0x2e9e87[_0xc052('0x12')](0x1f4,_0x2a1752[_0xc052('0x13')]));});});};exports[_0xc052('0x20')]=function(_0x3f4729){var _0x33d560=this;return new Promise(function(_0x283f23,_0x371cdb){return db['ZohoAccount']['find']({'raw':_0x3f4729[_0xc052('0x18')]?_0x3f4729[_0xc052('0x18')][_0xc052('0x19')]===undefined?!![]:![]:!![],'where':_0x3f4729[_0xc052('0x18')]?_0x3f4729['options'][_0xc052('0x1a')]||null:null,'attributes':_0x3f4729[_0xc052('0x18')]?_0x3f4729[_0xc052('0x18')][_0xc052('0x1b')]||null:null,'include':_0x3f4729['options']?_0x3f4729['options']['include']?_['map'](_0x3f4729[_0xc052('0x18')]['include'],function(_0x5d8176){return{'model':db[_0x5d8176['model']],'as':_0x5d8176['as'],'attributes':_0x5d8176['attributes'],'include':_0x5d8176[_0xc052('0x1d')]?_[_0xc052('0x1f')](_0x5d8176[_0xc052('0x1d')],function(_0x57755c){return{'model':db[_0x57755c[_0xc052('0x1e')]],'as':_0x57755c['as'],'attributes':_0x57755c[_0xc052('0x1b')],'include':_0x57755c[_0xc052('0x1d')]?_[_0xc052('0x1f')](_0x57755c[_0xc052('0x1d')],function(_0x38cd6e){return{'model':db[_0x38cd6e['model']],'as':_0x38cd6e['as'],'attributes':_0x38cd6e[_0xc052('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xc052('0xc')](function(_0x5f594d){logger[_0xc052('0xd')]('ShowZohoAccount',_0x3f4729);logger[_0xc052('0x10')](_0xc052('0x20'),_0x3f4729,JSON['stringify'](_0x5f594d));_0x283f23(_0x5f594d);})[_0xc052('0x15')](function(_0x10cef0){logger[_0xc052('0x12')](_0xc052('0x20'),_0x10cef0[_0xc052('0x13')],_0x3f4729);_0x371cdb(_0x33d560[_0xc052('0x12')](0x1f4,_0x10cef0['message']));});});}; \ No newline at end of file +var _0x78d1=['code','message','result','catch','GetZohoAccount','options','where','limit','map','include','model','attributes','then','ShowZohoAccount','raw','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','info','ZohoAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x78d1,0x159));var _0x178d=function(_0x471f51,_0x1d21b6){_0x471f51=_0x471f51-0x0;var _0xadb72f=_0x78d1[_0x471f51];return _0xadb72f;};'use strict';var _=require(_0x178d('0x0'));var util=require(_0x178d('0x1'));var moment=require(_0x178d('0x2'));var BPromise=require('bluebird');var rs=require(_0x178d('0x3'));var fs=require('fs');var Redis=require(_0x178d('0x4'));var db=require(_0x178d('0x5'))['db'];var utils=require(_0x178d('0x6'));var logger=require(_0x178d('0x7'))(_0x178d('0x8'));var config=require(_0x178d('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x178d('0xa')][_0x178d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x412106,_0x142cca,_0x2d7364){return new BPromise(function(_0x343c1f,_0x3c4391){return client['request'](_0x412106,_0x2d7364)['then'](function(_0x533638){logger[_0x178d('0xc')](_0x178d('0xd'),_0x142cca,_0x178d('0xe'));logger[_0x178d('0xf')]('ZohoAccount,\x20%s,\x20%s,\x20%s',_0x142cca,_0x178d('0xe'),JSON[_0x178d('0x10')](_0x533638));if(_0x533638[_0x178d('0x11')]){if(_0x533638['error'][_0x178d('0x12')]===0x1f4){logger[_0x178d('0x11')]('ZohoAccount,\x20%s,\x20%s',_0x142cca,_0x533638[_0x178d('0x11')][_0x178d('0x13')]);return _0x3c4391(_0x533638[_0x178d('0x11')][_0x178d('0x13')]);}logger[_0x178d('0x11')](_0x178d('0xd'),_0x142cca,_0x533638['error'][_0x178d('0x13')]);return _0x343c1f(_0x533638[_0x178d('0x11')][_0x178d('0x13')]);}else{logger[_0x178d('0xc')](_0x178d('0xd'),_0x142cca,_0x178d('0xe'));_0x343c1f(_0x533638[_0x178d('0x14')]['message']);}})[_0x178d('0x15')](function(_0x2d9c44){logger[_0x178d('0x11')](_0x178d('0xd'),_0x142cca,_0x2d9c44);_0x3c4391(_0x2d9c44);});});}exports[_0x178d('0x16')]=function(_0x194d9a){var _0x3b3822=this;return new Promise(function(_0x204c0f,_0x5c2b2a){return db['ZohoAccount']['findAll']({'raw':_0x194d9a[_0x178d('0x17')]?_0x194d9a[_0x178d('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x194d9a[_0x178d('0x17')]?_0x194d9a['options'][_0x178d('0x18')]||null:null,'attributes':_0x194d9a['options']?_0x194d9a['options']['attributes']||null:null,'limit':_0x194d9a[_0x178d('0x17')]?_0x194d9a[_0x178d('0x17')][_0x178d('0x19')]||null:null,'include':_0x194d9a[_0x178d('0x17')]?_0x194d9a[_0x178d('0x17')]['include']?_[_0x178d('0x1a')](_0x194d9a[_0x178d('0x17')][_0x178d('0x1b')],function(_0x4c5238){return{'model':db[_0x4c5238[_0x178d('0x1c')]],'as':_0x4c5238['as'],'attributes':_0x4c5238[_0x178d('0x1d')],'include':_0x4c5238[_0x178d('0x1b')]?_[_0x178d('0x1a')](_0x4c5238['include'],function(_0x3e0a20){return{'model':db[_0x3e0a20[_0x178d('0x1c')]],'as':_0x3e0a20['as'],'attributes':_0x3e0a20[_0x178d('0x1d')],'include':_0x3e0a20[_0x178d('0x1b')]?_['map'](_0x3e0a20['include'],function(_0x124d57){return{'model':db[_0x124d57[_0x178d('0x1c')]],'as':_0x124d57['as'],'attributes':_0x124d57[_0x178d('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x178d('0x1e')](function(_0x1b0c97){logger['info'](_0x178d('0x16'),_0x194d9a);logger['debug'](_0x178d('0x16'),_0x194d9a,JSON[_0x178d('0x10')](_0x1b0c97));_0x204c0f(_0x1b0c97);})['catch'](function(_0x2b5343){logger[_0x178d('0x11')](_0x178d('0x16'),_0x2b5343[_0x178d('0x13')],_0x194d9a);_0x5c2b2a(_0x3b3822[_0x178d('0x11')](0x1f4,_0x2b5343[_0x178d('0x13')]));});});};exports[_0x178d('0x1f')]=function(_0x1193a0){var _0x1ebb6e=this;return new Promise(function(_0x171751,_0x586c98){return db['ZohoAccount']['find']({'raw':_0x1193a0[_0x178d('0x17')]?_0x1193a0[_0x178d('0x17')][_0x178d('0x20')]===undefined?!![]:![]:!![],'where':_0x1193a0[_0x178d('0x17')]?_0x1193a0[_0x178d('0x17')][_0x178d('0x18')]||null:null,'attributes':_0x1193a0[_0x178d('0x17')]?_0x1193a0['options'][_0x178d('0x1d')]||null:null,'include':_0x1193a0[_0x178d('0x17')]?_0x1193a0[_0x178d('0x17')]['include']?_['map'](_0x1193a0[_0x178d('0x17')][_0x178d('0x1b')],function(_0x47eca8){return{'model':db[_0x47eca8[_0x178d('0x1c')]],'as':_0x47eca8['as'],'attributes':_0x47eca8[_0x178d('0x1d')],'include':_0x47eca8[_0x178d('0x1b')]?_[_0x178d('0x1a')](_0x47eca8[_0x178d('0x1b')],function(_0x4c9984){return{'model':db[_0x4c9984['model']],'as':_0x4c9984['as'],'attributes':_0x4c9984[_0x178d('0x1d')],'include':_0x4c9984['include']?_[_0x178d('0x1a')](_0x4c9984[_0x178d('0x1b')],function(_0x3be398){return{'model':db[_0x3be398[_0x178d('0x1c')]],'as':_0x3be398['as'],'attributes':_0x3be398['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0xccba1c){logger['info']('ShowZohoAccount',_0x1193a0);logger[_0x178d('0xf')]('ShowZohoAccount',_0x1193a0,JSON[_0x178d('0x10')](_0xccba1c));_0x171751(_0xccba1c);})[_0x178d('0x15')](function(_0x25021f){logger[_0x178d('0x11')](_0x178d('0x1f'),_0x25021f[_0x178d('0x13')],_0x1193a0);_0x586c98(_0x1ebb6e[_0x178d('0x11')](0x1f4,_0x25021f[_0x178d('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/index.js b/server/api/intZohoConfiguration/index.js index 7197b8e..a64fb44 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 _0xd548=['getDescriptions','post','create','put','update','delete','exports','multer','util','connect-timeout','express','../../components/auth/service','../../config/environment','./intZohoConfiguration.controller','index','get','/:id','isAuthenticated','getFields','/:id/subjects','getSubjects','/:id/descriptions'];(function(_0x521271,_0x1cc07d){var _0x4584b2=function(_0x2d31df){while(--_0x2d31df){_0x521271['push'](_0x521271['shift']());}};_0x4584b2(++_0x1cc07d);}(_0xd548,0x17d));var _0x8d54=function(_0x55e77c,_0x13a86c){_0x55e77c=_0x55e77c-0x0;var _0x1f9979=_0xd548[_0x55e77c];return _0x1f9979;};'use strict';var multer=require(_0x8d54('0x0'));var util=require(_0x8d54('0x1'));var path=require('path');var timeout=require(_0x8d54('0x2'));var express=require(_0x8d54('0x3'));var router=express['Router']();var auth=require(_0x8d54('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x8d54('0x5'));var controller=require(_0x8d54('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x8d54('0x7')]);router[_0x8d54('0x8')](_0x8d54('0x9'),auth['isAuthenticated'](),controller['show']);router[_0x8d54('0x8')]('/:id/fields',auth[_0x8d54('0xa')](),controller[_0x8d54('0xb')]);router[_0x8d54('0x8')](_0x8d54('0xc'),auth[_0x8d54('0xa')](),controller[_0x8d54('0xd')]);router[_0x8d54('0x8')](_0x8d54('0xe'),auth[_0x8d54('0xa')](),controller[_0x8d54('0xf')]);router[_0x8d54('0x10')]('/',auth[_0x8d54('0xa')](),controller[_0x8d54('0x11')]);router[_0x8d54('0x12')](_0x8d54('0x9'),auth[_0x8d54('0xa')](),controller[_0x8d54('0x13')]);router[_0x8d54('0x14')](_0x8d54('0x9'),auth[_0x8d54('0xa')](),controller['destroy']);module[_0x8d54('0x15')]=router; \ No newline at end of file +var _0xb067=['index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','post','create','delete','destroy','exports','multer','util','path','Router','../../components/interaction/service','../../config/environment','./intZohoConfiguration.controller','get','isAuthenticated'];(function(_0x2bcb85,_0x25ad2f){var _0x1b8e2e=function(_0x1b8846){while(--_0x1b8846){_0x2bcb85['push'](_0x2bcb85['shift']());}};_0x1b8e2e(++_0x25ad2f);}(_0xb067,0x11d));var _0x7b06=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb067[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x7b06('0x0'));var util=require(_0x7b06('0x1'));var path=require(_0x7b06('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x7b06('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x7b06('0x4'));var config=require(_0x7b06('0x5'));var controller=require(_0x7b06('0x6'));router[_0x7b06('0x7')]('/',auth[_0x7b06('0x8')](),controller[_0x7b06('0x9')]);router['get'](_0x7b06('0xa'),auth[_0x7b06('0x8')](),controller[_0x7b06('0xb')]);router[_0x7b06('0x7')](_0x7b06('0xc'),auth[_0x7b06('0x8')](),controller[_0x7b06('0xd')]);router[_0x7b06('0x7')](_0x7b06('0xe'),auth[_0x7b06('0x8')](),controller[_0x7b06('0xf')]);router[_0x7b06('0x7')]('/:id/descriptions',auth[_0x7b06('0x8')](),controller['getDescriptions']);router[_0x7b06('0x10')]('/',auth['isAuthenticated'](),controller[_0x7b06('0x11')]);router['put'](_0x7b06('0xa'),auth['isAuthenticated'](),controller['update']);router[_0x7b06('0x12')]('/:id',auth[_0x7b06('0x8')](),controller[_0x7b06('0x13')]);module[_0x7b06('0x14')]=router; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js b/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js index 758c396..7ee5025 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 _0x25d2=['sequelize','STRING','ENUM','Leads'];(function(_0x2bba44,_0x4262c6){var _0x557916=function(_0x493fda){while(--_0x493fda){_0x2bba44['push'](_0x2bba44['shift']());}};_0x557916(++_0x4262c6);}(_0x25d2,0x16c));var _0x225d=function(_0x331f92,_0x59733d){_0x331f92=_0x331f92-0x0;var _0x1e6600=_0x25d2[_0x331f92];return _0x1e6600;};'use strict';var Sequelize=require(_0x225d('0x0'));module['exports']={'name':{'type':Sequelize[_0x225d('0x1')]},'moduleCreate':{'type':Sequelize[_0x225d('0x2')]('Leads','Contacts'),'defaultValue':_0x225d('0x3')},'description':{'type':Sequelize[_0x225d('0x1')]}}; \ No newline at end of file +var _0x46cf=['exports','STRING','ENUM','Leads','sequelize'];(function(_0x2ce4d9,_0x47173f){var _0x3a802c=function(_0x13c969){while(--_0x13c969){_0x2ce4d9['push'](_0x2ce4d9['shift']());}};_0x3a802c(++_0x47173f);}(_0x46cf,0xe0));var _0xf46c=function(_0xda464c,_0x26e47d){_0xda464c=_0xda464c-0x0;var _0x19e222=_0x46cf[_0xda464c];return _0x19e222;};'use strict';var Sequelize=require(_0xf46c('0x0'));module[_0xf46c('0x1')]={'name':{'type':Sequelize[_0xf46c('0x2')]},'moduleCreate':{'type':Sequelize[_0xf46c('0x3')](_0xf46c('0x4'),'Contacts'),'defaultValue':_0xf46c('0x4')},'description':{'type':Sequelize[_0xf46c('0x2')]}}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.controller.js b/server/api/intZohoConfiguration/intZohoConfiguration.controller.js index 9ecdff9..07bec03 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 _0xaf60=['status','json','count','offset','set','Content-Range','apply','then','destroy','stack','name','send','index','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filter','key','VIRTUAL','field','merge','options','ZohoConfiguration','includeAll','include','show','params','find','create','body','findOne','pick','getFields','getSubjects','ZohoField','map','getDescriptions','html-pdf','eml-format','rimraf','request-promise','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','querystring','papaparse','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../mysqldb','jayson/promise','http','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch'];(function(_0x2f9467,_0x40576f){var _0x39894c=function(_0x13e344){while(--_0x13e344){_0x2f9467['push'](_0x2f9467['shift']());}};_0x39894c(++_0x40576f);}(_0xaf60,0x82));var _0x0af6=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xaf60[_0x4cf98e];return _0x1623ac;};'use strict';var pdf=require(_0x0af6('0x0'));var emlformat=require(_0x0af6('0x1'));var rimraf=require(_0x0af6('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0af6('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x0af6('0x4'));var util=require(_0x0af6('0x5'));var path=require(_0x0af6('0x6'));var sox=require(_0x0af6('0x7'));var csv=require(_0x0af6('0x8'));var ejs=require(_0x0af6('0x9'));var fs=require('fs');var _=require(_0x0af6('0xa'));var squel=require('squel');var crypto=require(_0x0af6('0xb'));var jsforce=require(_0x0af6('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x0af6('0x8'));var querystring=require(_0x0af6('0xd'));var Papa=require(_0x0af6('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x0af6('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0af6('0x10'))('api');var utils=require('../../config/utils');var config=require(_0x0af6('0x11'));var db=require(_0x0af6('0x12'))['db'];var jayson=require(_0x0af6('0x13'));var client=jayson['client'][_0x0af6('0x14')]({'port':0x232a});function checkPasswordPattern(_0x30a734,_0x43a6c0,_0x563943){if(_0x563943){var _0x164d0c=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x164d0c['test'](_0x43a6c0)){return _0x30a734;}else{throw new Error(_0x0af6('0x15'));}}else{return _0x30a734;}}function respondWithRpcPromise(_0x4ed1aa,_0x3097be,_0x3d459a,_0x1f9733){return new BPromise(function(_0x3ccdd9,_0x53fb83){var _0x57a725=_0x1f9733||client;return _0x57a725['request'](_0x4ed1aa,_0x3d459a)['then'](function(_0x4d5936){logger[_0x0af6('0x16')](_0x0af6('0x17'),_0x3097be,_0x0af6('0x18'));logger[_0x0af6('0x19')]('ZohoConfiguration,\x20%s,\x20%s,\x20%s',_0x3097be,'request\x20sent',JSON[_0x0af6('0x1a')](_0x4d5936));if(_0x4d5936[_0x0af6('0x1b')]){if(_0x4d5936['error'][_0x0af6('0x1c')]===0x1f4){logger[_0x0af6('0x1b')]('ZohoConfiguration,\x20%s,\x20%s',_0x3097be,_0x4d5936[_0x0af6('0x1b')][_0x0af6('0x1d')]);return _0x53fb83(_0x4d5936[_0x0af6('0x1b')]['message']);}logger[_0x0af6('0x1b')](_0x0af6('0x17'),_0x3097be,_0x4d5936[_0x0af6('0x1b')]['message']);return _0x3ccdd9(_0x4d5936['error']['message']);}else{logger[_0x0af6('0x16')](_0x0af6('0x17'),_0x3097be,_0x0af6('0x18'));_0x3ccdd9(_0x4d5936[_0x0af6('0x1e')]['message']);}})[_0x0af6('0x1f')](function(_0x2083df){logger[_0x0af6('0x1b')](_0x0af6('0x17'),_0x3097be,_0x2083df);_0x53fb83(_0x2083df);});});}function respondWithStatusCode(_0x56df0b,_0x37d0aa){_0x37d0aa=_0x37d0aa||0xcc;return function(_0x34508e){if(_0x34508e){return _0x56df0b['sendStatus'](_0x37d0aa);}return _0x56df0b[_0x0af6('0x20')](_0x37d0aa)['end']();};}function respondWithResult(_0x5fbff4,_0x43e44d){_0x43e44d=_0x43e44d||0xc8;return function(_0x39281d){if(_0x39281d){return _0x5fbff4[_0x0af6('0x20')](_0x43e44d)[_0x0af6('0x21')](_0x39281d);}};}function respondWithFilteredResult(_0x5cf28f,_0x4f16d5){return function(_0x49a7be){if(_0x49a7be){var _0x25e378=_0x49a7be[_0x0af6('0x22')],_0x357b1e=_0x4f16d5[_0x0af6('0x23')],_0x197427=_0x4f16d5['offset']+_0x4f16d5['limit'],_0x4da5d0;if(_0x197427>=_0x25e378){_0x197427=_0x25e378;_0x4da5d0=0xc8;}else{_0x4da5d0=0xce;}_0x5cf28f['status'](_0x4da5d0);return _0x5cf28f[_0x0af6('0x24')](_0x0af6('0x25'),_0x357b1e+'-'+_0x197427+'/'+_0x25e378)['json'](_0x49a7be);}return null;};}function patchUpdates(_0x412388){return function(_0xd75dea){try{jsonpatch[_0x0af6('0x26')](_0xd75dea,_0x412388,!![]);}catch(_0x1dc221){return BPromise['reject'](_0x1dc221);}return _0xd75dea['save']();};}function saveUpdates(_0x3f0ef7,_0x2278cf){return function(_0x4dd0d7){if(_0x4dd0d7){return _0x4dd0d7['update'](_0x3f0ef7)[_0x0af6('0x27')](function(_0x156bbb){return _0x156bbb;});}return null;};}function removeEntity(_0x1afcf2,_0x58b148){return function(_0x50939e){if(_0x50939e){return _0x50939e[_0x0af6('0x28')]()[_0x0af6('0x27')](function(){_0x1afcf2[_0x0af6('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x188911,_0xf2e832){return function(_0x4ee239){if(!_0x4ee239){_0x188911['sendStatus'](0x194);}return _0x4ee239;};}function handleError(_0x5b6d1c,_0x22264d){_0x22264d=_0x22264d||0x1f4;return function(_0x115e60){logger[_0x0af6('0x1b')](_0x115e60[_0x0af6('0x29')]);if(_0x115e60[_0x0af6('0x2a')]){delete _0x115e60['name'];}_0x5b6d1c[_0x0af6('0x20')](_0x22264d)[_0x0af6('0x2b')](_0x115e60);};}exports[_0x0af6('0x2c')]=function(_0x3c9927,_0x5b194f){var _0x396877={},_0x552282={},_0x3b5728={'count':0x0,'rows':[]};var _0x47be51=db['ZohoConfiguration'][_0x0af6('0x2d')];_0x552282[_0x0af6('0x2e')]=_[_0x0af6('0x2f')](_0x47be51);_0x552282[_0x0af6('0x30')]=_[_0x0af6('0x2f')](_0x3c9927[_0x0af6('0x30')]);_0x552282[_0x0af6('0x31')]=_[_0x0af6('0x32')](_0x552282[_0x0af6('0x2e')],_0x552282[_0x0af6('0x30')]);_0x396877[_0x0af6('0x33')]=_[_0x0af6('0x32')](_0x552282[_0x0af6('0x2e')],qs[_0x0af6('0x34')](_0x3c9927[_0x0af6('0x30')][_0x0af6('0x34')]));_0x396877[_0x0af6('0x33')]=_0x396877[_0x0af6('0x33')][_0x0af6('0x35')]?_0x396877[_0x0af6('0x33')]:_0x552282[_0x0af6('0x2e')];if(!_0x3c9927[_0x0af6('0x30')][_0x0af6('0x36')](_0x0af6('0x37'))){_0x396877[_0x0af6('0x38')]=qs[_0x0af6('0x38')](_0x3c9927['query']['limit']);_0x396877[_0x0af6('0x23')]=qs[_0x0af6('0x23')](_0x3c9927[_0x0af6('0x30')][_0x0af6('0x23')]);}_0x396877[_0x0af6('0x39')]=qs[_0x0af6('0x3a')](_0x3c9927['query'][_0x0af6('0x3a')]);_0x396877[_0x0af6('0x3b')]=qs[_0x0af6('0x31')](_['pick'](_0x3c9927[_0x0af6('0x30')],_0x552282[_0x0af6('0x31')]));if(_0x3c9927[_0x0af6('0x30')][_0x0af6('0x3c')]){_0x396877[_0x0af6('0x3b')]=_['merge'](_0x396877['where'],{'$or':_['map'](_0x47be51,function(_0x531c6d){if(_0x531c6d['type'][_0x0af6('0x3d')]!==_0x0af6('0x3e')){var _0x10f6a6={};_0x10f6a6[_0x531c6d[_0x0af6('0x3f')]]={'$like':'%'+_0x3c9927[_0x0af6('0x30')][_0x0af6('0x3c')]+'%'};return _0x10f6a6;}})});}_0x396877=_[_0x0af6('0x40')]({},_0x396877,_0x3c9927[_0x0af6('0x41')]);var _0x525128={'where':_0x396877[_0x0af6('0x3b')]};return db[_0x0af6('0x42')][_0x0af6('0x22')](_0x525128)[_0x0af6('0x27')](function(_0x19567b){_0x3b5728[_0x0af6('0x22')]=_0x19567b;if(_0x3c9927['query'][_0x0af6('0x43')]){_0x396877[_0x0af6('0x44')]=[{'all':!![]}];}return db[_0x0af6('0x42')]['findAll'](_0x396877);})[_0x0af6('0x27')](function(_0x42c947){_0x3b5728['rows']=_0x42c947;return _0x3b5728;})[_0x0af6('0x27')](respondWithFilteredResult(_0x5b194f,_0x396877))['catch'](handleError(_0x5b194f,null));};exports[_0x0af6('0x45')]=function(_0x5d228f,_0x278e81){var _0x467764={'raw':![],'where':{'id':_0x5d228f[_0x0af6('0x46')]['id']}},_0x3ff525={};_0x3ff525[_0x0af6('0x2e')]=_['keys'](db[_0x0af6('0x42')][_0x0af6('0x2d')]);_0x3ff525[_0x0af6('0x30')]=_['keys'](_0x5d228f[_0x0af6('0x30')]);_0x3ff525['filters']=_[_0x0af6('0x32')](_0x3ff525[_0x0af6('0x2e')],_0x3ff525[_0x0af6('0x30')]);_0x467764['attributes']=_['intersection'](_0x3ff525[_0x0af6('0x2e')],qs['fields'](_0x5d228f['query'][_0x0af6('0x34')]));_0x467764[_0x0af6('0x33')]=_0x467764[_0x0af6('0x33')][_0x0af6('0x35')]?_0x467764['attributes']:_0x3ff525[_0x0af6('0x2e')];if(_0x5d228f[_0x0af6('0x30')][_0x0af6('0x43')]){_0x467764[_0x0af6('0x44')]=[{'all':!![]}];}_0x467764=_[_0x0af6('0x40')]({},_0x467764,_0x5d228f['options']);return db[_0x0af6('0x42')][_0x0af6('0x47')](_0x467764)['then'](handleEntityNotFound(_0x278e81,null))[_0x0af6('0x27')](respondWithResult(_0x278e81,null))[_0x0af6('0x1f')](handleError(_0x278e81,null));};exports[_0x0af6('0x48')]=function(_0x350e3a,_0x24fceb){return db[_0x0af6('0x42')][_0x0af6('0x48')](_0x350e3a['body'],{})[_0x0af6('0x27')](respondWithResult(_0x24fceb,0xc9))[_0x0af6('0x1f')](handleError(_0x24fceb,null));};exports['update']=function(_0x287269,_0x5d3f1a){if(_0x287269['body']['id']){delete _0x287269[_0x0af6('0x49')]['id'];}return db[_0x0af6('0x42')][_0x0af6('0x47')]({'where':{'id':_0x287269['params']['id']}})['then'](handleEntityNotFound(_0x5d3f1a,null))['then'](saveUpdates(_0x287269['body'],null))['then'](respondWithResult(_0x5d3f1a,null))['catch'](handleError(_0x5d3f1a,null));};exports[_0x0af6('0x28')]=function(_0xcc14b5,_0x132152){return db[_0x0af6('0x42')][_0x0af6('0x47')]({'where':{'id':_0xcc14b5['params']['id']}})['then'](handleEntityNotFound(_0x132152,null))['then'](removeEntity(_0x132152,null))['catch'](handleError(_0x132152,null));};exports['getFields']=function(_0x55ef06,_0x1fa479,_0x597620){var _0x57e7e8={};var _0x9e1f2e={};var _0x474fe3;var _0x491f04;return db[_0x0af6('0x42')][_0x0af6('0x4a')]({'where':{'id':_0x55ef06[_0x0af6('0x46')]['id']}})[_0x0af6('0x27')](handleEntityNotFound(_0x1fa479,null))['then'](function(_0x5b5ab6){if(_0x5b5ab6){_0x474fe3=_0x5b5ab6;_0x9e1f2e['model']=_[_0x0af6('0x2f')](db['ZohoField'][_0x0af6('0x2d')]);_0x9e1f2e[_0x0af6('0x30')]=_[_0x0af6('0x2f')](_0x55ef06[_0x0af6('0x30')]);_0x9e1f2e['filters']=_[_0x0af6('0x32')](_0x9e1f2e[_0x0af6('0x2e')],_0x9e1f2e['query']);_0x57e7e8['attributes']=_[_0x0af6('0x32')](_0x9e1f2e[_0x0af6('0x2e')],qs[_0x0af6('0x34')](_0x55ef06[_0x0af6('0x30')]['fields']));_0x57e7e8[_0x0af6('0x33')]=_0x57e7e8['attributes'][_0x0af6('0x35')]?_0x57e7e8['attributes']:_0x9e1f2e[_0x0af6('0x2e')];_0x57e7e8[_0x0af6('0x39')]=qs[_0x0af6('0x3a')](_0x55ef06[_0x0af6('0x30')][_0x0af6('0x3a')]);_0x57e7e8['where']=qs[_0x0af6('0x31')](_[_0x0af6('0x4b')](_0x55ef06[_0x0af6('0x30')],_0x9e1f2e[_0x0af6('0x31')]));if(_0x55ef06['query'][_0x0af6('0x3c')]){_0x57e7e8[_0x0af6('0x3b')]=_[_0x0af6('0x40')](_0x57e7e8['where'],{'$or':_['map'](_0x57e7e8[_0x0af6('0x33')],function(_0x9dfa62){var _0x3f5d23={};_0x3f5d23[_0x9dfa62]={'$like':'%'+_0x55ef06[_0x0af6('0x30')][_0x0af6('0x3c')]+'%'};return _0x3f5d23;})});}_0x57e7e8=_[_0x0af6('0x40')]({},_0x57e7e8,_0x55ef06[_0x0af6('0x41')]);return _0x474fe3[_0x0af6('0x4c')](_0x57e7e8);}})[_0x0af6('0x27')](function(_0x2e07ca){if(_0x2e07ca){_0x491f04=_0x2e07ca[_0x0af6('0x35')];if(!_0x55ef06[_0x0af6('0x30')][_0x0af6('0x36')](_0x0af6('0x37'))){_0x57e7e8[_0x0af6('0x38')]=qs[_0x0af6('0x38')](_0x55ef06[_0x0af6('0x30')][_0x0af6('0x38')]);_0x57e7e8[_0x0af6('0x23')]=qs[_0x0af6('0x23')](_0x55ef06[_0x0af6('0x30')][_0x0af6('0x23')]);}return _0x474fe3['getFields'](_0x57e7e8);}})[_0x0af6('0x27')](function(_0x3aed04){if(_0x3aed04){return _0x3aed04?{'count':_0x491f04,'rows':_0x3aed04}:null;}})[_0x0af6('0x27')](respondWithResult(_0x1fa479,null))[_0x0af6('0x1f')](handleError(_0x1fa479,null));};exports[_0x0af6('0x4d')]=function(_0x6b668c,_0x411e45,_0x345fdf){var _0x2be8a3={};var _0x1ba2a3={};var _0x5dcae5;var _0x370103;return db[_0x0af6('0x42')][_0x0af6('0x4a')]({'where':{'id':_0x6b668c[_0x0af6('0x46')]['id']}})['then'](handleEntityNotFound(_0x411e45,null))['then'](function(_0x42d5ca){if(_0x42d5ca){_0x5dcae5=_0x42d5ca;_0x1ba2a3[_0x0af6('0x2e')]=_['keys'](db[_0x0af6('0x4e')][_0x0af6('0x2d')]);_0x1ba2a3[_0x0af6('0x30')]=_[_0x0af6('0x2f')](_0x6b668c[_0x0af6('0x30')]);_0x1ba2a3[_0x0af6('0x31')]=_[_0x0af6('0x32')](_0x1ba2a3['model'],_0x1ba2a3[_0x0af6('0x30')]);_0x2be8a3[_0x0af6('0x33')]=_[_0x0af6('0x32')](_0x1ba2a3[_0x0af6('0x2e')],qs[_0x0af6('0x34')](_0x6b668c[_0x0af6('0x30')][_0x0af6('0x34')]));_0x2be8a3[_0x0af6('0x33')]=_0x2be8a3[_0x0af6('0x33')][_0x0af6('0x35')]?_0x2be8a3[_0x0af6('0x33')]:_0x1ba2a3[_0x0af6('0x2e')];_0x2be8a3[_0x0af6('0x39')]=qs[_0x0af6('0x3a')](_0x6b668c['query']['sort']);_0x2be8a3[_0x0af6('0x3b')]=qs[_0x0af6('0x31')](_[_0x0af6('0x4b')](_0x6b668c['query'],_0x1ba2a3[_0x0af6('0x31')]));if(_0x6b668c['query'][_0x0af6('0x3c')]){_0x2be8a3['where']=_[_0x0af6('0x40')](_0x2be8a3[_0x0af6('0x3b')],{'$or':_[_0x0af6('0x4f')](_0x2be8a3[_0x0af6('0x33')],function(_0x25a1b1){var _0x392886={};_0x392886[_0x25a1b1]={'$like':'%'+_0x6b668c[_0x0af6('0x30')]['filter']+'%'};return _0x392886;})});}_0x2be8a3=_[_0x0af6('0x40')]({},_0x2be8a3,_0x6b668c['options']);return _0x5dcae5['getSubjects'](_0x2be8a3);}})[_0x0af6('0x27')](function(_0x1f7756){if(_0x1f7756){_0x370103=_0x1f7756[_0x0af6('0x35')];if(!_0x6b668c[_0x0af6('0x30')][_0x0af6('0x36')](_0x0af6('0x37'))){_0x2be8a3[_0x0af6('0x38')]=qs[_0x0af6('0x38')](_0x6b668c['query'][_0x0af6('0x38')]);_0x2be8a3[_0x0af6('0x23')]=qs[_0x0af6('0x23')](_0x6b668c['query'][_0x0af6('0x23')]);}return _0x5dcae5[_0x0af6('0x4d')](_0x2be8a3);}})['then'](function(_0x2caa50){if(_0x2caa50){return _0x2caa50?{'count':_0x370103,'rows':_0x2caa50}:null;}})['then'](respondWithResult(_0x411e45,null))[_0x0af6('0x1f')](handleError(_0x411e45,null));};exports['getDescriptions']=function(_0xc10cd7,_0x62b3ac,_0x44cca2){var _0x2b28da={};var _0x3a9312={};var _0x24f29a;var _0x57459f;return db['ZohoConfiguration'][_0x0af6('0x4a')]({'where':{'id':_0xc10cd7[_0x0af6('0x46')]['id']}})['then'](handleEntityNotFound(_0x62b3ac,null))['then'](function(_0x13643d){if(_0x13643d){_0x24f29a=_0x13643d;_0x3a9312['model']=_[_0x0af6('0x2f')](db['ZohoField'][_0x0af6('0x2d')]);_0x3a9312['query']=_[_0x0af6('0x2f')](_0xc10cd7['query']);_0x3a9312['filters']=_[_0x0af6('0x32')](_0x3a9312[_0x0af6('0x2e')],_0x3a9312[_0x0af6('0x30')]);_0x2b28da[_0x0af6('0x33')]=_[_0x0af6('0x32')](_0x3a9312[_0x0af6('0x2e')],qs[_0x0af6('0x34')](_0xc10cd7['query'][_0x0af6('0x34')]));_0x2b28da['attributes']=_0x2b28da[_0x0af6('0x33')][_0x0af6('0x35')]?_0x2b28da[_0x0af6('0x33')]:_0x3a9312[_0x0af6('0x2e')];_0x2b28da[_0x0af6('0x39')]=qs['sort'](_0xc10cd7['query']['sort']);_0x2b28da[_0x0af6('0x3b')]=qs[_0x0af6('0x31')](_[_0x0af6('0x4b')](_0xc10cd7[_0x0af6('0x30')],_0x3a9312[_0x0af6('0x31')]));if(_0xc10cd7['query'][_0x0af6('0x3c')]){_0x2b28da[_0x0af6('0x3b')]=_[_0x0af6('0x40')](_0x2b28da[_0x0af6('0x3b')],{'$or':_[_0x0af6('0x4f')](_0x2b28da[_0x0af6('0x33')],function(_0x2e756e){var _0x3d53d2={};_0x3d53d2[_0x2e756e]={'$like':'%'+_0xc10cd7['query'][_0x0af6('0x3c')]+'%'};return _0x3d53d2;})});}_0x2b28da=_[_0x0af6('0x40')]({},_0x2b28da,_0xc10cd7[_0x0af6('0x41')]);return _0x24f29a[_0x0af6('0x50')](_0x2b28da);}})[_0x0af6('0x27')](function(_0x412d5b){if(_0x412d5b){_0x57459f=_0x412d5b[_0x0af6('0x35')];if(!_0xc10cd7[_0x0af6('0x30')][_0x0af6('0x36')]('nolimit')){_0x2b28da[_0x0af6('0x38')]=qs[_0x0af6('0x38')](_0xc10cd7[_0x0af6('0x30')]['limit']);_0x2b28da[_0x0af6('0x23')]=qs[_0x0af6('0x23')](_0xc10cd7[_0x0af6('0x30')]['offset']);}return _0x24f29a[_0x0af6('0x50')](_0x2b28da);}})[_0x0af6('0x27')](function(_0x5f04b5){if(_0x5f04b5){return _0x5f04b5?{'count':_0x57459f,'rows':_0x5f04b5}:null;}})['then'](respondWithResult(_0x62b3ac,null))[_0x0af6('0x1f')](handleError(_0x62b3ac,null));}; \ No newline at end of file +var _0xa702=['api','../../config/utils','../../config/environment','../../mysqldb','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','ZohoConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','count','offset','Content-Range','json','apply','save','destroy','stack','name','send','ZohoConfiguration','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','map','type','key','VIRTUAL','field','options','includeAll','findAll','rows','show','params','include','find','create','body','update','getFields','findOne','ZohoField','getSubjects','getDescriptions','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','util','sox','to-csv','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger'];(function(_0x36ac30,_0x369e3b){var _0x26bdaa=function(_0x2dae77){while(--_0x2dae77){_0x36ac30['push'](_0x36ac30['shift']());}};_0x26bdaa(++_0x369e3b);}(_0xa702,0x1ae));var _0x2a70=function(_0x4eb687,_0x40801e){_0x4eb687=_0x4eb687-0x0;var _0x1d8257=_0xa702[_0x4eb687];return _0x1d8257;};'use strict';var pdf=require(_0x2a70('0x0'));var emlformat=require(_0x2a70('0x1'));var rimraf=require(_0x2a70('0x2'));var zipdir=require(_0x2a70('0x3'));var jsonpatch=require(_0x2a70('0x4'));var rp=require('request-promise');var moment=require(_0x2a70('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x2a70('0x6'));var path=require('path');var sox=require(_0x2a70('0x7'));var csv=require(_0x2a70('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x2a70('0x9'));var crypto=require(_0x2a70('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x2a70('0xb'));var toCsv=require('to-csv');var querystring=require(_0x2a70('0xc'));var Papa=require(_0x2a70('0xd'));var Redis=require(_0x2a70('0xe'));var authService=require(_0x2a70('0xf'));var qs=require(_0x2a70('0x10'));var as=require(_0x2a70('0x11'));var hardwareService=require(_0x2a70('0x12'));var logger=require(_0x2a70('0x13'))(_0x2a70('0x14'));var utils=require(_0x2a70('0x15'));var config=require(_0x2a70('0x16'));var db=require(_0x2a70('0x17'))['db'];var jayson=require('jayson/promise');var client=jayson[_0x2a70('0x18')][_0x2a70('0x19')]({'port':0x232a});function checkPasswordPattern(_0x49dc04,_0x18498d,_0x252a14){if(_0x252a14){var _0x5c7e28=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x5c7e28[_0x2a70('0x1a')](_0x18498d)){return _0x49dc04;}else{throw new Error(_0x2a70('0x1b'));}}else{return _0x49dc04;}}function respondWithRpcPromise(_0x5562cb,_0x8a36e4,_0x1deb9a,_0x58c9a4){return new BPromise(function(_0x46f840,_0x2c5619){var _0x5d992a=_0x58c9a4||client;return _0x5d992a['request'](_0x5562cb,_0x1deb9a)[_0x2a70('0x1c')](function(_0x450273){logger[_0x2a70('0x1d')](_0x2a70('0x1e'),_0x8a36e4,_0x2a70('0x1f'));logger['debug'](_0x2a70('0x20'),_0x8a36e4,_0x2a70('0x1f'),JSON['stringify'](_0x450273));if(_0x450273['error']){if(_0x450273[_0x2a70('0x21')][_0x2a70('0x22')]===0x1f4){logger[_0x2a70('0x21')]('ZohoConfiguration,\x20%s,\x20%s',_0x8a36e4,_0x450273[_0x2a70('0x21')][_0x2a70('0x23')]);return _0x2c5619(_0x450273[_0x2a70('0x21')][_0x2a70('0x23')]);}logger[_0x2a70('0x21')](_0x2a70('0x1e'),_0x8a36e4,_0x450273[_0x2a70('0x21')]['message']);return _0x46f840(_0x450273['error'][_0x2a70('0x23')]);}else{logger['info'](_0x2a70('0x1e'),_0x8a36e4,_0x2a70('0x1f'));_0x46f840(_0x450273[_0x2a70('0x24')][_0x2a70('0x23')]);}})[_0x2a70('0x25')](function(_0x1ef985){logger[_0x2a70('0x21')](_0x2a70('0x1e'),_0x8a36e4,_0x1ef985);_0x2c5619(_0x1ef985);});});}function respondWithStatusCode(_0x477dcd,_0x364fe0){_0x364fe0=_0x364fe0||0xcc;return function(_0xf3d89e){if(_0xf3d89e){return _0x477dcd[_0x2a70('0x26')](_0x364fe0);}return _0x477dcd['status'](_0x364fe0)['end']();};}function respondWithResult(_0x38208f,_0x163061){_0x163061=_0x163061||0xc8;return function(_0x220be7){if(_0x220be7){return _0x38208f[_0x2a70('0x27')](_0x163061)['json'](_0x220be7);}};}function respondWithFilteredResult(_0x12ea08,_0x168fef){return function(_0x45dac3){if(_0x45dac3){var _0xc2cfe4=_0x45dac3[_0x2a70('0x28')],_0x4cfa86=_0x168fef['offset'],_0x588efc=_0x168fef[_0x2a70('0x29')]+_0x168fef['limit'],_0x47dafe;if(_0x588efc>=_0xc2cfe4){_0x588efc=_0xc2cfe4;_0x47dafe=0xc8;}else{_0x47dafe=0xce;}_0x12ea08[_0x2a70('0x27')](_0x47dafe);return _0x12ea08['set'](_0x2a70('0x2a'),_0x4cfa86+'-'+_0x588efc+'/'+_0xc2cfe4)[_0x2a70('0x2b')](_0x45dac3);}return null;};}function patchUpdates(_0x4f4da8){return function(_0x4b0d70){try{jsonpatch[_0x2a70('0x2c')](_0x4b0d70,_0x4f4da8,!![]);}catch(_0x7463a){return BPromise['reject'](_0x7463a);}return _0x4b0d70[_0x2a70('0x2d')]();};}function saveUpdates(_0x14f803,_0x3f14d4){return function(_0x2174a6){if(_0x2174a6){return _0x2174a6['update'](_0x14f803)[_0x2a70('0x1c')](function(_0x10fe85){return _0x10fe85;});}return null;};}function removeEntity(_0x40e2ea,_0x20b983){return function(_0x434769){if(_0x434769){return _0x434769[_0x2a70('0x2e')]()[_0x2a70('0x1c')](function(){_0x40e2ea[_0x2a70('0x27')](0xcc)['end']();});}};}function handleEntityNotFound(_0x59b647,_0x800eaa){return function(_0x2f8140){if(!_0x2f8140){_0x59b647['sendStatus'](0x194);}return _0x2f8140;};}function handleError(_0x419102,_0x2695f1){_0x2695f1=_0x2695f1||0x1f4;return function(_0x2f1c57){logger[_0x2a70('0x21')](_0x2f1c57[_0x2a70('0x2f')]);if(_0x2f1c57[_0x2a70('0x30')]){delete _0x2f1c57[_0x2a70('0x30')];}_0x419102[_0x2a70('0x27')](_0x2695f1)[_0x2a70('0x31')](_0x2f1c57);};}exports['index']=function(_0x3201c5,_0x13c0fa){var _0x46b3f7={},_0x5d9206={},_0x190ea9={'count':0x0,'rows':[]};var _0x15187d=db[_0x2a70('0x32')][_0x2a70('0x33')];_0x5d9206[_0x2a70('0x34')]=_[_0x2a70('0x35')](_0x15187d);_0x5d9206[_0x2a70('0x36')]=_[_0x2a70('0x35')](_0x3201c5['query']);_0x5d9206[_0x2a70('0x37')]=_[_0x2a70('0x38')](_0x5d9206[_0x2a70('0x34')],_0x5d9206[_0x2a70('0x36')]);_0x46b3f7[_0x2a70('0x39')]=_[_0x2a70('0x38')](_0x5d9206['model'],qs[_0x2a70('0x3a')](_0x3201c5[_0x2a70('0x36')][_0x2a70('0x3a')]));_0x46b3f7['attributes']=_0x46b3f7[_0x2a70('0x39')][_0x2a70('0x3b')]?_0x46b3f7['attributes']:_0x5d9206['model'];if(!_0x3201c5['query'][_0x2a70('0x3c')](_0x2a70('0x3d'))){_0x46b3f7[_0x2a70('0x3e')]=qs['limit'](_0x3201c5[_0x2a70('0x36')][_0x2a70('0x3e')]);_0x46b3f7[_0x2a70('0x29')]=qs[_0x2a70('0x29')](_0x3201c5[_0x2a70('0x36')]['offset']);}_0x46b3f7[_0x2a70('0x3f')]=qs[_0x2a70('0x40')](_0x3201c5[_0x2a70('0x36')][_0x2a70('0x40')]);_0x46b3f7[_0x2a70('0x41')]=qs[_0x2a70('0x37')](_[_0x2a70('0x42')](_0x3201c5[_0x2a70('0x36')],_0x5d9206[_0x2a70('0x37')]));if(_0x3201c5[_0x2a70('0x36')][_0x2a70('0x43')]){_0x46b3f7[_0x2a70('0x41')]=_[_0x2a70('0x44')](_0x46b3f7[_0x2a70('0x41')],{'$or':_[_0x2a70('0x45')](_0x15187d,function(_0x580139){if(_0x580139[_0x2a70('0x46')][_0x2a70('0x47')]!==_0x2a70('0x48')){var _0x2fc81d={};_0x2fc81d[_0x580139[_0x2a70('0x49')]]={'$like':'%'+_0x3201c5[_0x2a70('0x36')][_0x2a70('0x43')]+'%'};return _0x2fc81d;}})});}_0x46b3f7=_[_0x2a70('0x44')]({},_0x46b3f7,_0x3201c5[_0x2a70('0x4a')]);var _0x4d691e={'where':_0x46b3f7['where']};return db[_0x2a70('0x32')][_0x2a70('0x28')](_0x4d691e)[_0x2a70('0x1c')](function(_0x6fac11){_0x190ea9[_0x2a70('0x28')]=_0x6fac11;if(_0x3201c5[_0x2a70('0x36')][_0x2a70('0x4b')]){_0x46b3f7['include']=[{'all':!![]}];}return db[_0x2a70('0x32')][_0x2a70('0x4c')](_0x46b3f7);})[_0x2a70('0x1c')](function(_0x49d331){_0x190ea9[_0x2a70('0x4d')]=_0x49d331;return _0x190ea9;})[_0x2a70('0x1c')](respondWithFilteredResult(_0x13c0fa,_0x46b3f7))['catch'](handleError(_0x13c0fa,null));};exports[_0x2a70('0x4e')]=function(_0x5ea976,_0x36e110){var _0x17de09={'raw':![],'where':{'id':_0x5ea976[_0x2a70('0x4f')]['id']}},_0x204df6={};_0x204df6[_0x2a70('0x34')]=_['keys'](db[_0x2a70('0x32')][_0x2a70('0x33')]);_0x204df6['query']=_[_0x2a70('0x35')](_0x5ea976['query']);_0x204df6[_0x2a70('0x37')]=_[_0x2a70('0x38')](_0x204df6[_0x2a70('0x34')],_0x204df6[_0x2a70('0x36')]);_0x17de09['attributes']=_[_0x2a70('0x38')](_0x204df6['model'],qs[_0x2a70('0x3a')](_0x5ea976['query']['fields']));_0x17de09[_0x2a70('0x39')]=_0x17de09[_0x2a70('0x39')][_0x2a70('0x3b')]?_0x17de09[_0x2a70('0x39')]:_0x204df6[_0x2a70('0x34')];if(_0x5ea976[_0x2a70('0x36')][_0x2a70('0x4b')]){_0x17de09[_0x2a70('0x50')]=[{'all':!![]}];}_0x17de09=_[_0x2a70('0x44')]({},_0x17de09,_0x5ea976[_0x2a70('0x4a')]);return db[_0x2a70('0x32')][_0x2a70('0x51')](_0x17de09)[_0x2a70('0x1c')](handleEntityNotFound(_0x36e110,null))['then'](respondWithResult(_0x36e110,null))['catch'](handleError(_0x36e110,null));};exports[_0x2a70('0x52')]=function(_0x41d76e,_0x297d67){return db[_0x2a70('0x32')][_0x2a70('0x52')](_0x41d76e[_0x2a70('0x53')],{})[_0x2a70('0x1c')](respondWithResult(_0x297d67,0xc9))['catch'](handleError(_0x297d67,null));};exports[_0x2a70('0x54')]=function(_0x919522,_0x475ed9){if(_0x919522[_0x2a70('0x53')]['id']){delete _0x919522[_0x2a70('0x53')]['id'];}return db[_0x2a70('0x32')][_0x2a70('0x51')]({'where':{'id':_0x919522['params']['id']}})[_0x2a70('0x1c')](handleEntityNotFound(_0x475ed9,null))[_0x2a70('0x1c')](saveUpdates(_0x919522[_0x2a70('0x53')],null))[_0x2a70('0x1c')](respondWithResult(_0x475ed9,null))[_0x2a70('0x25')](handleError(_0x475ed9,null));};exports[_0x2a70('0x2e')]=function(_0x417ce1,_0x4dcf82){return db[_0x2a70('0x32')][_0x2a70('0x51')]({'where':{'id':_0x417ce1['params']['id']}})['then'](handleEntityNotFound(_0x4dcf82,null))[_0x2a70('0x1c')](removeEntity(_0x4dcf82,null))[_0x2a70('0x25')](handleError(_0x4dcf82,null));};exports[_0x2a70('0x55')]=function(_0x5ab29a,_0x2db679,_0x3cfb91){var _0x361a44={};var _0x3471e2={};var _0x2881ce;var _0x66e266;return db[_0x2a70('0x32')][_0x2a70('0x56')]({'where':{'id':_0x5ab29a[_0x2a70('0x4f')]['id']}})[_0x2a70('0x1c')](handleEntityNotFound(_0x2db679,null))[_0x2a70('0x1c')](function(_0x59b031){if(_0x59b031){_0x2881ce=_0x59b031;_0x3471e2[_0x2a70('0x34')]=_[_0x2a70('0x35')](db[_0x2a70('0x57')]['rawAttributes']);_0x3471e2[_0x2a70('0x36')]=_['keys'](_0x5ab29a['query']);_0x3471e2[_0x2a70('0x37')]=_[_0x2a70('0x38')](_0x3471e2[_0x2a70('0x34')],_0x3471e2[_0x2a70('0x36')]);_0x361a44[_0x2a70('0x39')]=_['intersection'](_0x3471e2[_0x2a70('0x34')],qs[_0x2a70('0x3a')](_0x5ab29a['query']['fields']));_0x361a44['attributes']=_0x361a44[_0x2a70('0x39')][_0x2a70('0x3b')]?_0x361a44[_0x2a70('0x39')]:_0x3471e2[_0x2a70('0x34')];_0x361a44[_0x2a70('0x3f')]=qs['sort'](_0x5ab29a[_0x2a70('0x36')][_0x2a70('0x40')]);_0x361a44[_0x2a70('0x41')]=qs['filters'](_[_0x2a70('0x42')](_0x5ab29a[_0x2a70('0x36')],_0x3471e2[_0x2a70('0x37')]));if(_0x5ab29a[_0x2a70('0x36')][_0x2a70('0x43')]){_0x361a44[_0x2a70('0x41')]=_['merge'](_0x361a44[_0x2a70('0x41')],{'$or':_['map'](_0x361a44['attributes'],function(_0x273f8a){var _0x3c14ac={};_0x3c14ac[_0x273f8a]={'$like':'%'+_0x5ab29a[_0x2a70('0x36')][_0x2a70('0x43')]+'%'};return _0x3c14ac;})});}_0x361a44=_[_0x2a70('0x44')]({},_0x361a44,_0x5ab29a[_0x2a70('0x4a')]);return _0x2881ce[_0x2a70('0x55')](_0x361a44);}})[_0x2a70('0x1c')](function(_0x3fcc19){if(_0x3fcc19){_0x66e266=_0x3fcc19[_0x2a70('0x3b')];if(!_0x5ab29a['query'][_0x2a70('0x3c')](_0x2a70('0x3d'))){_0x361a44['limit']=qs[_0x2a70('0x3e')](_0x5ab29a[_0x2a70('0x36')][_0x2a70('0x3e')]);_0x361a44[_0x2a70('0x29')]=qs['offset'](_0x5ab29a[_0x2a70('0x36')][_0x2a70('0x29')]);}return _0x2881ce['getFields'](_0x361a44);}})[_0x2a70('0x1c')](function(_0x31c3e3){if(_0x31c3e3){return _0x31c3e3?{'count':_0x66e266,'rows':_0x31c3e3}:null;}})[_0x2a70('0x1c')](respondWithResult(_0x2db679,null))[_0x2a70('0x25')](handleError(_0x2db679,null));};exports[_0x2a70('0x58')]=function(_0x501363,_0x41af3f,_0x3ef81c){var _0x5b62d3={};var _0x52e31e={};var _0x41f5e9;var _0x1baca4;return db[_0x2a70('0x32')][_0x2a70('0x56')]({'where':{'id':_0x501363[_0x2a70('0x4f')]['id']}})['then'](handleEntityNotFound(_0x41af3f,null))[_0x2a70('0x1c')](function(_0x56b0b1){if(_0x56b0b1){_0x41f5e9=_0x56b0b1;_0x52e31e[_0x2a70('0x34')]=_[_0x2a70('0x35')](db[_0x2a70('0x57')][_0x2a70('0x33')]);_0x52e31e[_0x2a70('0x36')]=_[_0x2a70('0x35')](_0x501363[_0x2a70('0x36')]);_0x52e31e['filters']=_['intersection'](_0x52e31e[_0x2a70('0x34')],_0x52e31e[_0x2a70('0x36')]);_0x5b62d3[_0x2a70('0x39')]=_[_0x2a70('0x38')](_0x52e31e[_0x2a70('0x34')],qs[_0x2a70('0x3a')](_0x501363[_0x2a70('0x36')][_0x2a70('0x3a')]));_0x5b62d3[_0x2a70('0x39')]=_0x5b62d3['attributes'][_0x2a70('0x3b')]?_0x5b62d3['attributes']:_0x52e31e[_0x2a70('0x34')];_0x5b62d3[_0x2a70('0x3f')]=qs[_0x2a70('0x40')](_0x501363[_0x2a70('0x36')][_0x2a70('0x40')]);_0x5b62d3[_0x2a70('0x41')]=qs['filters'](_['pick'](_0x501363[_0x2a70('0x36')],_0x52e31e[_0x2a70('0x37')]));if(_0x501363[_0x2a70('0x36')][_0x2a70('0x43')]){_0x5b62d3['where']=_['merge'](_0x5b62d3[_0x2a70('0x41')],{'$or':_[_0x2a70('0x45')](_0x5b62d3['attributes'],function(_0x2bd051){var _0xe76818={};_0xe76818[_0x2bd051]={'$like':'%'+_0x501363['query']['filter']+'%'};return _0xe76818;})});}_0x5b62d3=_[_0x2a70('0x44')]({},_0x5b62d3,_0x501363['options']);return _0x41f5e9[_0x2a70('0x58')](_0x5b62d3);}})[_0x2a70('0x1c')](function(_0x31e5c2){if(_0x31e5c2){_0x1baca4=_0x31e5c2['length'];if(!_0x501363[_0x2a70('0x36')]['hasOwnProperty'](_0x2a70('0x3d'))){_0x5b62d3[_0x2a70('0x3e')]=qs[_0x2a70('0x3e')](_0x501363[_0x2a70('0x36')][_0x2a70('0x3e')]);_0x5b62d3[_0x2a70('0x29')]=qs['offset'](_0x501363[_0x2a70('0x36')][_0x2a70('0x29')]);}return _0x41f5e9[_0x2a70('0x58')](_0x5b62d3);}})['then'](function(_0x3e3dea){if(_0x3e3dea){return _0x3e3dea?{'count':_0x1baca4,'rows':_0x3e3dea}:null;}})[_0x2a70('0x1c')](respondWithResult(_0x41af3f,null))[_0x2a70('0x25')](handleError(_0x41af3f,null));};exports['getDescriptions']=function(_0x3ff56f,_0x48066f,_0x477314){var _0x3ad538={};var _0x3a42b7={};var _0x2db1f3;var _0x55b122;return db[_0x2a70('0x32')][_0x2a70('0x56')]({'where':{'id':_0x3ff56f[_0x2a70('0x4f')]['id']}})[_0x2a70('0x1c')](handleEntityNotFound(_0x48066f,null))[_0x2a70('0x1c')](function(_0x559935){if(_0x559935){_0x2db1f3=_0x559935;_0x3a42b7[_0x2a70('0x34')]=_[_0x2a70('0x35')](db[_0x2a70('0x57')][_0x2a70('0x33')]);_0x3a42b7['query']=_[_0x2a70('0x35')](_0x3ff56f['query']);_0x3a42b7[_0x2a70('0x37')]=_[_0x2a70('0x38')](_0x3a42b7[_0x2a70('0x34')],_0x3a42b7['query']);_0x3ad538[_0x2a70('0x39')]=_[_0x2a70('0x38')](_0x3a42b7['model'],qs[_0x2a70('0x3a')](_0x3ff56f['query'][_0x2a70('0x3a')]));_0x3ad538[_0x2a70('0x39')]=_0x3ad538[_0x2a70('0x39')]['length']?_0x3ad538['attributes']:_0x3a42b7['model'];_0x3ad538[_0x2a70('0x3f')]=qs[_0x2a70('0x40')](_0x3ff56f['query'][_0x2a70('0x40')]);_0x3ad538['where']=qs[_0x2a70('0x37')](_[_0x2a70('0x42')](_0x3ff56f[_0x2a70('0x36')],_0x3a42b7['filters']));if(_0x3ff56f[_0x2a70('0x36')][_0x2a70('0x43')]){_0x3ad538[_0x2a70('0x41')]=_[_0x2a70('0x44')](_0x3ad538[_0x2a70('0x41')],{'$or':_[_0x2a70('0x45')](_0x3ad538[_0x2a70('0x39')],function(_0x2ee90f){var _0x550d4b={};_0x550d4b[_0x2ee90f]={'$like':'%'+_0x3ff56f[_0x2a70('0x36')]['filter']+'%'};return _0x550d4b;})});}_0x3ad538=_['merge']({},_0x3ad538,_0x3ff56f[_0x2a70('0x4a')]);return _0x2db1f3['getDescriptions'](_0x3ad538);}})[_0x2a70('0x1c')](function(_0x5888ed){if(_0x5888ed){_0x55b122=_0x5888ed[_0x2a70('0x3b')];if(!_0x3ff56f['query'][_0x2a70('0x3c')](_0x2a70('0x3d'))){_0x3ad538[_0x2a70('0x3e')]=qs[_0x2a70('0x3e')](_0x3ff56f['query'][_0x2a70('0x3e')]);_0x3ad538['offset']=qs[_0x2a70('0x29')](_0x3ff56f['query'][_0x2a70('0x29')]);}return _0x2db1f3[_0x2a70('0x59')](_0x3ad538);}})[_0x2a70('0x1c')](function(_0xc4ce4b){if(_0xc4ce4b){return _0xc4ce4b?{'count':_0x55b122,'rows':_0xc4ce4b}:null;}})[_0x2a70('0x1c')](respondWithResult(_0x48066f,null))['catch'](handleError(_0x48066f,null));}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.model.js b/server/api/intZohoConfiguration/intZohoConfiguration.model.js index 79b6757..eebb2d4 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 _0x3b1d=['bluebird','path','rimraf','../../config/environment','exports','int_zoho_configurations','lodash','../../config/logger','api','moment'];(function(_0x1dab5f,_0x10cd21){var _0x40c2f3=function(_0x325a0d){while(--_0x325a0d){_0x1dab5f['push'](_0x1dab5f['shift']());}};_0x40c2f3(++_0x10cd21);}(_0x3b1d,0x1be));var _0xd3b1=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0x3b1d[_0x8c43de];return _0xa6591b;};'use strict';var _=require(_0xd3b1('0x0'));var util=require('util');var logger=require(_0xd3b1('0x1'))(_0xd3b1('0x2'));var moment=require(_0xd3b1('0x3'));var BPromise=require(_0xd3b1('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd3b1('0x5'));var rimraf=require(_0xd3b1('0x6'));var config=require(_0xd3b1('0x7'));var attributes=require('./intZohoConfiguration.attributes');module[_0xd3b1('0x8')]=function(_0x420f82,_0x543bcf){return _0x420f82['define']('ZohoConfiguration',attributes,{'tableName':_0xd3b1('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe986=['lodash','../../config/logger','api','moment','path','rimraf','../../config/environment','./intZohoConfiguration.attributes','exports','define','int_zoho_configurations'];(function(_0x1b5598,_0x1ded5d){var _0x1ecc9c=function(_0x11d9db){while(--_0x11d9db){_0x1b5598['push'](_0x1b5598['shift']());}};_0x1ecc9c(++_0x1ded5d);}(_0xe986,0x113));var _0x6e98=function(_0x220536,_0x17c892){_0x220536=_0x220536-0x0;var _0x28f8d1=_0xe986[_0x220536];return _0x28f8d1;};'use strict';var _=require(_0x6e98('0x0'));var util=require('util');var logger=require(_0x6e98('0x1'))(_0x6e98('0x2'));var moment=require(_0x6e98('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x6e98('0x4'));var rimraf=require(_0x6e98('0x5'));var config=require(_0x6e98('0x6'));var attributes=require(_0x6e98('0x7'));module[_0x6e98('0x8')]=function(_0x456181,_0x3db32e){return _0x456181[_0x6e98('0x9')]('ZohoConfiguration',attributes,{'tableName':_0x6e98('0xa'),'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 28735ad..0d9fa14 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 _0x5c49=['debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','ZohoConfiguration,\x20%s,\x20%s','message','info','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request'];(function(_0x2359d4,_0x56f426){var _0x2a902b=function(_0x53dc2d){while(--_0x53dc2d){_0x2359d4['push'](_0x2359d4['shift']());}};_0x2a902b(++_0x56f426);}(_0x5c49,0x17b));var _0x95c4=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x5c49[_0xbca1b1];return _0x4e1686;};'use strict';var _=require(_0x95c4('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x95c4('0x1'));var rs=require(_0x95c4('0x2'));var fs=require('fs');var Redis=require(_0x95c4('0x3'));var db=require(_0x95c4('0x4'))['db'];var utils=require(_0x95c4('0x5'));var logger=require(_0x95c4('0x6'))('rpc');var config=require(_0x95c4('0x7'));var jayson=require(_0x95c4('0x8'));var client=jayson[_0x95c4('0x9')][_0x95c4('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5c906,_0x4ed122,_0x236286){return new BPromise(function(_0x1ae44f,_0x5cee8d){return client[_0x95c4('0xb')](_0x5c906,_0x236286)['then'](function(_0x11fd50){logger['info']('ZohoConfiguration,\x20%s,\x20%s',_0x4ed122,'request\x20sent');logger[_0x95c4('0xc')](_0x95c4('0xd'),_0x4ed122,_0x95c4('0xe'),JSON[_0x95c4('0xf')](_0x11fd50));if(_0x11fd50[_0x95c4('0x10')]){if(_0x11fd50[_0x95c4('0x10')][_0x95c4('0x11')]===0x1f4){logger['error'](_0x95c4('0x12'),_0x4ed122,_0x11fd50['error'][_0x95c4('0x13')]);return _0x5cee8d(_0x11fd50['error'][_0x95c4('0x13')]);}logger[_0x95c4('0x10')](_0x95c4('0x12'),_0x4ed122,_0x11fd50[_0x95c4('0x10')][_0x95c4('0x13')]);return _0x1ae44f(_0x11fd50['error'][_0x95c4('0x13')]);}else{logger[_0x95c4('0x14')](_0x95c4('0x12'),_0x4ed122,_0x95c4('0xe'));_0x1ae44f(_0x11fd50[_0x95c4('0x15')][_0x95c4('0x13')]);}})[_0x95c4('0x16')](function(_0x2d35b5){logger[_0x95c4('0x10')](_0x95c4('0x12'),_0x4ed122,_0x2d35b5);_0x5cee8d(_0x2d35b5);});});} \ No newline at end of file +var _0xaf3a=['lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','error','message','info','result'];(function(_0x5ecadc,_0x1cf9f1){var _0x565037=function(_0x22908b){while(--_0x22908b){_0x5ecadc['push'](_0x5ecadc['shift']());}};_0x565037(++_0x1cf9f1);}(_0xaf3a,0xf0));var _0xaaf3=function(_0x5817e6,_0x44a2d0){_0x5817e6=_0x5817e6-0x0;var _0x51916a=_0xaf3a[_0x5817e6];return _0x51916a;};'use strict';var _=require(_0xaaf3('0x0'));var util=require(_0xaaf3('0x1'));var moment=require(_0xaaf3('0x2'));var BPromise=require('bluebird');var rs=require(_0xaaf3('0x3'));var fs=require('fs');var Redis=require(_0xaaf3('0x4'));var db=require(_0xaaf3('0x5'))['db'];var utils=require(_0xaaf3('0x6'));var logger=require(_0xaaf3('0x7'))(_0xaaf3('0x8'));var config=require(_0xaaf3('0x9'));var jayson=require(_0xaaf3('0xa'));var client=jayson[_0xaaf3('0xb')][_0xaaf3('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3ec487,_0x223983,_0x1e204f){return new BPromise(function(_0xc10c94,_0x701428){return client[_0xaaf3('0xd')](_0x3ec487,_0x1e204f)['then'](function(_0x41b3f2){logger['info'](_0xaaf3('0xe'),_0x223983,_0xaaf3('0xf'));logger['debug']('ZohoConfiguration,\x20%s,\x20%s,\x20%s',_0x223983,_0xaaf3('0xf'),JSON['stringify'](_0x41b3f2));if(_0x41b3f2[_0xaaf3('0x10')]){if(_0x41b3f2['error']['code']===0x1f4){logger[_0xaaf3('0x10')](_0xaaf3('0xe'),_0x223983,_0x41b3f2[_0xaaf3('0x10')]['message']);return _0x701428(_0x41b3f2['error'][_0xaaf3('0x11')]);}logger[_0xaaf3('0x10')](_0xaaf3('0xe'),_0x223983,_0x41b3f2[_0xaaf3('0x10')][_0xaaf3('0x11')]);return _0xc10c94(_0x41b3f2['error'][_0xaaf3('0x11')]);}else{logger[_0xaaf3('0x12')](_0xaaf3('0xe'),_0x223983,'request\x20sent');_0xc10c94(_0x41b3f2[_0xaaf3('0x13')][_0xaaf3('0x11')]);}})['catch'](function(_0x1d73b5){logger[_0xaaf3('0x10')](_0xaaf3('0xe'),_0x223983,_0x1d73b5);_0x701428(_0x1d73b5);});});} \ No newline at end of file diff --git a/server/api/intZohoField/index.js b/server/api/intZohoField/index.js index 0d44b5c..294be51 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 _0x3266=['../../config/environment','get','index','/:id','show','isAuthenticated','create','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x1fc84d,_0x3f469d){var _0x2658fa=function(_0x189ad0){while(--_0x189ad0){_0x1fc84d['push'](_0x1fc84d['shift']());}};_0x2658fa(++_0x3f469d);}(_0x3266,0x6a));var _0x6326=function(_0xc0a3d3,_0x2c8d00){_0xc0a3d3=_0xc0a3d3-0x0;var _0x3386e8=_0x3266[_0xc0a3d3];return _0x3386e8;};'use strict';var multer=require(_0x6326('0x0'));var util=require(_0x6326('0x1'));var path=require(_0x6326('0x2'));var timeout=require(_0x6326('0x3'));var express=require(_0x6326('0x4'));var router=express[_0x6326('0x5')]();var auth=require(_0x6326('0x6'));var interaction=require(_0x6326('0x7'));var config=require(_0x6326('0x8'));var controller=require('./intZohoField.controller');router[_0x6326('0x9')]('/',auth['isAuthenticated'](),controller[_0x6326('0xa')]);router[_0x6326('0x9')](_0x6326('0xb'),auth['isAuthenticated'](),controller[_0x6326('0xc')]);router['post']('/',auth[_0x6326('0xd')](),controller[_0x6326('0xe')]);router[_0x6326('0xf')](_0x6326('0xb'),auth[_0x6326('0xd')](),controller['update']);router[_0x6326('0x10')](_0x6326('0xb'),auth[_0x6326('0xd')](),controller[_0x6326('0x11')]);module[_0x6326('0x12')]=router; \ No newline at end of file +var _0x2da6=['isAuthenticated','index','/:id','show','post','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get'];(function(_0x3d5f2b,_0x1708eb){var _0x1dccf6=function(_0x1ec856){while(--_0x1ec856){_0x3d5f2b['push'](_0x3d5f2b['shift']());}};_0x1dccf6(++_0x1708eb);}(_0x2da6,0x1dd));var _0x62da=function(_0x1e98b1,_0x1b0a60){_0x1e98b1=_0x1e98b1-0x0;var _0x1f013c=_0x2da6[_0x1e98b1];return _0x1f013c;};'use strict';var multer=require(_0x62da('0x0'));var util=require(_0x62da('0x1'));var path=require(_0x62da('0x2'));var timeout=require(_0x62da('0x3'));var express=require(_0x62da('0x4'));var router=express[_0x62da('0x5')]();var auth=require(_0x62da('0x6'));var interaction=require(_0x62da('0x7'));var config=require('../../config/environment');var controller=require('./intZohoField.controller');router[_0x62da('0x8')]('/',auth[_0x62da('0x9')](),controller[_0x62da('0xa')]);router[_0x62da('0x8')](_0x62da('0xb'),auth[_0x62da('0x9')](),controller[_0x62da('0xc')]);router[_0x62da('0xd')]('/',auth[_0x62da('0x9')](),controller['create']);router[_0x62da('0xe')](_0x62da('0xb'),auth[_0x62da('0x9')](),controller[_0x62da('0xf')]);router['delete'](_0x62da('0xb'),auth[_0x62da('0x9')](),controller[_0x62da('0x10')]);module[_0x62da('0x11')]=router; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.attributes.js b/server/api/intZohoField/intZohoField.attributes.js index 9b206fb..4ff63e5 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 _0xae99=['BOOLEAN','sequelize','exports','customVariable','keyValue','string','STRING','ENUM','variable'];(function(_0x2f3794,_0x3c3bec){var _0x1c9fbe=function(_0x2d2eac){while(--_0x2d2eac){_0x2f3794['push'](_0x2f3794['shift']());}};_0x1c9fbe(++_0x3c3bec);}(_0xae99,0x172));var _0x9ae9=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0xae99[_0x311c35];return _0x5cc50c;};'use strict';var Sequelize=require(_0x9ae9('0x0'));module[_0x9ae9('0x1')]={'type':{'type':Sequelize['ENUM']('string','variable',_0x9ae9('0x2'),_0x9ae9('0x3')),'defaultValue':_0x9ae9('0x4')},'content':{'type':Sequelize[_0x9ae9('0x5')]},'key':{'type':Sequelize[_0x9ae9('0x5')]},'keyType':{'type':Sequelize[_0x9ae9('0x6')](_0x9ae9('0x4'),_0x9ae9('0x7'),'customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x9ae9('0x5')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x9ae9('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x9ae9('0x5')]}}; \ No newline at end of file +var _0x5127=['BOOLEAN','sequelize','exports','ENUM','string','customVariable','keyValue','STRING','variable'];(function(_0x1f853d,_0x21f32b){var _0x58d351=function(_0x17ac35){while(--_0x17ac35){_0x1f853d['push'](_0x1f853d['shift']());}};_0x58d351(++_0x21f32b);}(_0x5127,0x64));var _0x7512=function(_0x22cc16,_0x1f4fa2){_0x22cc16=_0x22cc16-0x0;var _0x399b70=_0x5127[_0x22cc16];return _0x399b70;};'use strict';var Sequelize=require(_0x7512('0x0'));module[_0x7512('0x1')]={'type':{'type':Sequelize[_0x7512('0x2')](_0x7512('0x3'),'variable',_0x7512('0x4'),_0x7512('0x5')),'defaultValue':_0x7512('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x7512('0x6')]},'keyType':{'type':Sequelize[_0x7512('0x2')](_0x7512('0x3'),_0x7512('0x7'),_0x7512('0x4'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x7512('0x6')]},'nameField':{'type':Sequelize[_0x7512('0x6')]},'customField':{'type':Sequelize[_0x7512('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 0da10ab..37b36fa 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 _0xe706=['include','findAll','rows','catch','show','rawAttributes','fields','find','create','body','params','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','end','count','limit','set','Content-Range','apply','reject','save','update','then','stack','name','send','index','ZohoField','model','keys','query','filters','intersection','attributes','length','nolimit','offset','order','sort','filter','where','merge','map','type','key','VIRTUAL','options','includeAll'];(function(_0x3ff27e,_0x1d5b26){var _0x5df246=function(_0x12ccc3){while(--_0x12ccc3){_0x3ff27e['push'](_0x3ff27e['shift']());}};_0x5df246(++_0x1d5b26);}(_0xe706,0xa3));var _0x6e70=function(_0x5b21a2,_0x2c6461){_0x5b21a2=_0x5b21a2-0x0;var _0x57166b=_0xe706[_0x5b21a2];return _0x57166b;};'use strict';var pdf=require(_0x6e70('0x0'));var emlformat=require(_0x6e70('0x1'));var rimraf=require(_0x6e70('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6e70('0x3'));var rp=require(_0x6e70('0x4'));var moment=require(_0x6e70('0x5'));var BPromise=require(_0x6e70('0x6'));var Mustache=require(_0x6e70('0x7'));var util=require(_0x6e70('0x8'));var path=require(_0x6e70('0x9'));var sox=require(_0x6e70('0xa'));var csv=require(_0x6e70('0xb'));var ejs=require(_0x6e70('0xc'));var fs=require('fs');var _=require(_0x6e70('0xd'));var squel=require(_0x6e70('0xe'));var crypto=require(_0x6e70('0xf'));var jsforce=require(_0x6e70('0x10'));var deskjs=require(_0x6e70('0x11'));var toCsv=require(_0x6e70('0xb'));var querystring=require(_0x6e70('0x12'));var Papa=require(_0x6e70('0x13'));var Redis=require(_0x6e70('0x14'));var authService=require(_0x6e70('0x15'));var qs=require(_0x6e70('0x16'));var as=require(_0x6e70('0x17'));var hardwareService=require(_0x6e70('0x18'));var logger=require(_0x6e70('0x19'))('api');var utils=require('../../config/utils');var config=require(_0x6e70('0x1a'));var db=require(_0x6e70('0x1b'))['db'];function respondWithStatusCode(_0x18cf27,_0x27dd9b){_0x27dd9b=_0x27dd9b||0xcc;return function(_0x3b38f3){if(_0x3b38f3){return _0x18cf27[_0x6e70('0x1c')](_0x27dd9b);}return _0x18cf27[_0x6e70('0x1d')](_0x27dd9b)[_0x6e70('0x1e')]();};}function respondWithResult(_0x5dfbaa,_0x52737e){_0x52737e=_0x52737e||0xc8;return function(_0x48bc72){if(_0x48bc72){return _0x5dfbaa[_0x6e70('0x1d')](_0x52737e)['json'](_0x48bc72);}};}function respondWithFilteredResult(_0x53aed0,_0x304716){return function(_0x22c50c){if(_0x22c50c){var _0x5d9263=_0x22c50c[_0x6e70('0x1f')],_0x24f3ac=_0x304716['offset'],_0x5c3fe7=_0x304716['offset']+_0x304716[_0x6e70('0x20')],_0x2efc0f;if(_0x5c3fe7>=_0x5d9263){_0x5c3fe7=_0x5d9263;_0x2efc0f=0xc8;}else{_0x2efc0f=0xce;}_0x53aed0['status'](_0x2efc0f);return _0x53aed0[_0x6e70('0x21')](_0x6e70('0x22'),_0x24f3ac+'-'+_0x5c3fe7+'/'+_0x5d9263)['json'](_0x22c50c);}return null;};}function patchUpdates(_0x497d61){return function(_0xc238ba){try{jsonpatch[_0x6e70('0x23')](_0xc238ba,_0x497d61,!![]);}catch(_0x2368eb){return BPromise[_0x6e70('0x24')](_0x2368eb);}return _0xc238ba[_0x6e70('0x25')]();};}function saveUpdates(_0xcdf9f2,_0x1b2453){return function(_0x44a49f){if(_0x44a49f){return _0x44a49f[_0x6e70('0x26')](_0xcdf9f2)[_0x6e70('0x27')](function(_0x4a0cfe){return _0x4a0cfe;});}return null;};}function removeEntity(_0x228350,_0x344b65){return function(_0x27b294){if(_0x27b294){return _0x27b294['destroy']()[_0x6e70('0x27')](function(){_0x228350[_0x6e70('0x1d')](0xcc)[_0x6e70('0x1e')]();});}};}function handleEntityNotFound(_0x50da2c,_0x10fc91){return function(_0x538b9c){if(!_0x538b9c){_0x50da2c['sendStatus'](0x194);}return _0x538b9c;};}function handleError(_0x4e97c7,_0x41e352){_0x41e352=_0x41e352||0x1f4;return function(_0x19c5ae){logger['error'](_0x19c5ae[_0x6e70('0x28')]);if(_0x19c5ae[_0x6e70('0x29')]){delete _0x19c5ae['name'];}_0x4e97c7[_0x6e70('0x1d')](_0x41e352)[_0x6e70('0x2a')](_0x19c5ae);};}exports[_0x6e70('0x2b')]=function(_0x4a67ac,_0x54a5fe){var _0x2c4d37={},_0x3af17f={},_0x83c836={'count':0x0,'rows':[]};var _0x114344=db[_0x6e70('0x2c')]['rawAttributes'];_0x3af17f[_0x6e70('0x2d')]=_[_0x6e70('0x2e')](_0x114344);_0x3af17f[_0x6e70('0x2f')]=_[_0x6e70('0x2e')](_0x4a67ac[_0x6e70('0x2f')]);_0x3af17f[_0x6e70('0x30')]=_[_0x6e70('0x31')](_0x3af17f[_0x6e70('0x2d')],_0x3af17f[_0x6e70('0x2f')]);_0x2c4d37[_0x6e70('0x32')]=_['intersection'](_0x3af17f[_0x6e70('0x2d')],qs['fields'](_0x4a67ac[_0x6e70('0x2f')]['fields']));_0x2c4d37[_0x6e70('0x32')]=_0x2c4d37[_0x6e70('0x32')][_0x6e70('0x33')]?_0x2c4d37['attributes']:_0x3af17f[_0x6e70('0x2d')];if(!_0x4a67ac[_0x6e70('0x2f')]['hasOwnProperty'](_0x6e70('0x34'))){_0x2c4d37[_0x6e70('0x20')]=qs['limit'](_0x4a67ac[_0x6e70('0x2f')][_0x6e70('0x20')]);_0x2c4d37[_0x6e70('0x35')]=qs[_0x6e70('0x35')](_0x4a67ac[_0x6e70('0x2f')][_0x6e70('0x35')]);}_0x2c4d37[_0x6e70('0x36')]=qs[_0x6e70('0x37')](_0x4a67ac[_0x6e70('0x2f')][_0x6e70('0x37')]);_0x2c4d37['where']=qs[_0x6e70('0x30')](_['pick'](_0x4a67ac[_0x6e70('0x2f')],_0x3af17f[_0x6e70('0x30')]));if(_0x4a67ac[_0x6e70('0x2f')][_0x6e70('0x38')]){_0x2c4d37[_0x6e70('0x39')]=_[_0x6e70('0x3a')](_0x2c4d37[_0x6e70('0x39')],{'$or':_[_0x6e70('0x3b')](_0x114344,function(_0x80bebb){if(_0x80bebb[_0x6e70('0x3c')][_0x6e70('0x3d')]!==_0x6e70('0x3e')){var _0x5594d3={};_0x5594d3[_0x80bebb['field']]={'$like':'%'+_0x4a67ac['query']['filter']+'%'};return _0x5594d3;}})});}_0x2c4d37=_[_0x6e70('0x3a')]({},_0x2c4d37,_0x4a67ac[_0x6e70('0x3f')]);var _0x2cb5b0={'where':_0x2c4d37[_0x6e70('0x39')]};return db[_0x6e70('0x2c')][_0x6e70('0x1f')](_0x2cb5b0)['then'](function(_0x3b508c){_0x83c836[_0x6e70('0x1f')]=_0x3b508c;if(_0x4a67ac[_0x6e70('0x2f')][_0x6e70('0x40')]){_0x2c4d37[_0x6e70('0x41')]=[{'all':!![]}];}return db[_0x6e70('0x2c')][_0x6e70('0x42')](_0x2c4d37);})[_0x6e70('0x27')](function(_0x5be100){_0x83c836[_0x6e70('0x43')]=_0x5be100;return _0x83c836;})[_0x6e70('0x27')](respondWithFilteredResult(_0x54a5fe,_0x2c4d37))[_0x6e70('0x44')](handleError(_0x54a5fe,null));};exports[_0x6e70('0x45')]=function(_0x201da9,_0x1de947){var _0x21b0e7={'raw':!![],'where':{'id':_0x201da9['params']['id']}},_0x4a8adc={};_0x4a8adc['model']=_[_0x6e70('0x2e')](db[_0x6e70('0x2c')][_0x6e70('0x46')]);_0x4a8adc[_0x6e70('0x2f')]=_[_0x6e70('0x2e')](_0x201da9['query']);_0x4a8adc[_0x6e70('0x30')]=_[_0x6e70('0x31')](_0x4a8adc[_0x6e70('0x2d')],_0x4a8adc['query']);_0x21b0e7['attributes']=_['intersection'](_0x4a8adc[_0x6e70('0x2d')],qs['fields'](_0x201da9[_0x6e70('0x2f')][_0x6e70('0x47')]));_0x21b0e7[_0x6e70('0x32')]=_0x21b0e7[_0x6e70('0x32')]['length']?_0x21b0e7[_0x6e70('0x32')]:_0x4a8adc['model'];if(_0x201da9[_0x6e70('0x2f')][_0x6e70('0x40')]){_0x21b0e7[_0x6e70('0x41')]=[{'all':!![]}];}_0x21b0e7=_[_0x6e70('0x3a')]({},_0x21b0e7,_0x201da9['options']);return db[_0x6e70('0x2c')][_0x6e70('0x48')](_0x21b0e7)[_0x6e70('0x27')](handleEntityNotFound(_0x1de947,null))[_0x6e70('0x27')](respondWithResult(_0x1de947,null))[_0x6e70('0x44')](handleError(_0x1de947,null));};exports[_0x6e70('0x49')]=function(_0x3d9c5,_0x552e7e){return db[_0x6e70('0x2c')][_0x6e70('0x49')](_0x3d9c5[_0x6e70('0x4a')],{})[_0x6e70('0x27')](respondWithResult(_0x552e7e,0xc9))[_0x6e70('0x44')](handleError(_0x552e7e,null));};exports[_0x6e70('0x26')]=function(_0x1e2095,_0x4ab26e){if(_0x1e2095[_0x6e70('0x4a')]['id']){delete _0x1e2095['body']['id'];}return db[_0x6e70('0x2c')][_0x6e70('0x48')]({'where':{'id':_0x1e2095['params']['id']}})['then'](handleEntityNotFound(_0x4ab26e,null))[_0x6e70('0x27')](saveUpdates(_0x1e2095[_0x6e70('0x4a')],null))[_0x6e70('0x27')](respondWithResult(_0x4ab26e,null))['catch'](handleError(_0x4ab26e,null));};exports['destroy']=function(_0x238ebb,_0x11ac3d){return db[_0x6e70('0x2c')][_0x6e70('0x48')]({'where':{'id':_0x238ebb[_0x6e70('0x4b')]['id']}})[_0x6e70('0x27')](handleEntityNotFound(_0x11ac3d,null))['then'](removeEntity(_0x11ac3d,null))[_0x6e70('0x44')](handleError(_0x11ac3d,null));}; \ No newline at end of file +var _0x3c81=['../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','limit','set','Content-Range','json','apply','reject','save','update','then','error','name','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','where','pick','filter','merge','type','key','options','ZohoField','includeAll','include','rows','catch','show','params','rawAttributes','length','create','body','find','destroy','html-pdf','eml-format','zip-dir','fast-json-patch','util','path','sox','to-csv','ejs','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils'];(function(_0x1a6304,_0x37b41e){var _0x825ac7=function(_0x342321){while(--_0x342321){_0x1a6304['push'](_0x1a6304['shift']());}};_0x825ac7(++_0x37b41e);}(_0x3c81,0x102));var _0x13c8=function(_0x399c43,_0x229d7c){_0x399c43=_0x399c43-0x0;var _0x28f941=_0x3c81[_0x399c43];return _0x28f941;};'use strict';var pdf=require(_0x13c8('0x0'));var emlformat=require(_0x13c8('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x13c8('0x2'));var jsonpatch=require(_0x13c8('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x13c8('0x4'));var path=require(_0x13c8('0x5'));var sox=require(_0x13c8('0x6'));var csv=require(_0x13c8('0x7'));var ejs=require(_0x13c8('0x8'));var fs=require('fs');var _=require(_0x13c8('0x9'));var squel=require(_0x13c8('0xa'));var crypto=require('crypto');var jsforce=require(_0x13c8('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x13c8('0x7'));var querystring=require(_0x13c8('0xc'));var Papa=require(_0x13c8('0xd'));var Redis=require(_0x13c8('0xe'));var authService=require(_0x13c8('0xf'));var qs=require(_0x13c8('0x10'));var as=require(_0x13c8('0x11'));var hardwareService=require(_0x13c8('0x12'));var logger=require(_0x13c8('0x13'))(_0x13c8('0x14'));var utils=require(_0x13c8('0x15'));var config=require(_0x13c8('0x16'));var db=require(_0x13c8('0x17'))['db'];function respondWithStatusCode(_0x48c171,_0x5ab91d){_0x5ab91d=_0x5ab91d||0xcc;return function(_0x21442d){if(_0x21442d){return _0x48c171[_0x13c8('0x18')](_0x5ab91d);}return _0x48c171[_0x13c8('0x19')](_0x5ab91d)[_0x13c8('0x1a')]();};}function respondWithResult(_0x4a077c,_0x42955d){_0x42955d=_0x42955d||0xc8;return function(_0x515681){if(_0x515681){return _0x4a077c['status'](_0x42955d)['json'](_0x515681);}};}function respondWithFilteredResult(_0x126359,_0x5e0e06){return function(_0x337397){if(_0x337397){var _0x17a3c1=_0x337397[_0x13c8('0x1b')],_0x23f64e=_0x5e0e06[_0x13c8('0x1c')],_0x7cbfb=_0x5e0e06[_0x13c8('0x1c')]+_0x5e0e06[_0x13c8('0x1d')],_0x5d7906;if(_0x7cbfb>=_0x17a3c1){_0x7cbfb=_0x17a3c1;_0x5d7906=0xc8;}else{_0x5d7906=0xce;}_0x126359[_0x13c8('0x19')](_0x5d7906);return _0x126359[_0x13c8('0x1e')](_0x13c8('0x1f'),_0x23f64e+'-'+_0x7cbfb+'/'+_0x17a3c1)[_0x13c8('0x20')](_0x337397);}return null;};}function patchUpdates(_0x34fbc0){return function(_0x31d122){try{jsonpatch[_0x13c8('0x21')](_0x31d122,_0x34fbc0,!![]);}catch(_0x5ac776){return BPromise[_0x13c8('0x22')](_0x5ac776);}return _0x31d122[_0x13c8('0x23')]();};}function saveUpdates(_0x1d1686,_0x313ea3){return function(_0x513085){if(_0x513085){return _0x513085[_0x13c8('0x24')](_0x1d1686)[_0x13c8('0x25')](function(_0x3e3951){return _0x3e3951;});}return null;};}function removeEntity(_0x1f60ed,_0x436d5d){return function(_0x2fc123){if(_0x2fc123){return _0x2fc123['destroy']()[_0x13c8('0x25')](function(){_0x1f60ed[_0x13c8('0x19')](0xcc)[_0x13c8('0x1a')]();});}};}function handleEntityNotFound(_0xcf41d2,_0x577df6){return function(_0x1770e5){if(!_0x1770e5){_0xcf41d2[_0x13c8('0x18')](0x194);}return _0x1770e5;};}function handleError(_0x4e392f,_0x49b552){_0x49b552=_0x49b552||0x1f4;return function(_0x3b4fd8){logger[_0x13c8('0x26')](_0x3b4fd8['stack']);if(_0x3b4fd8['name']){delete _0x3b4fd8[_0x13c8('0x27')];}_0x4e392f[_0x13c8('0x19')](_0x49b552)['send'](_0x3b4fd8);};}exports['index']=function(_0x196983,_0x596166){var _0x545b47={},_0x1c7dc4={},_0x6c2dc8={'count':0x0,'rows':[]};var _0x34fdbe=db['ZohoField']['rawAttributes'];_0x1c7dc4[_0x13c8('0x28')]=_[_0x13c8('0x29')](_0x34fdbe);_0x1c7dc4[_0x13c8('0x2a')]=_[_0x13c8('0x29')](_0x196983[_0x13c8('0x2a')]);_0x1c7dc4[_0x13c8('0x2b')]=_[_0x13c8('0x2c')](_0x1c7dc4['model'],_0x1c7dc4[_0x13c8('0x2a')]);_0x545b47[_0x13c8('0x2d')]=_['intersection'](_0x1c7dc4['model'],qs[_0x13c8('0x2e')](_0x196983[_0x13c8('0x2a')]['fields']));_0x545b47[_0x13c8('0x2d')]=_0x545b47[_0x13c8('0x2d')]['length']?_0x545b47[_0x13c8('0x2d')]:_0x1c7dc4[_0x13c8('0x28')];if(!_0x196983[_0x13c8('0x2a')][_0x13c8('0x2f')](_0x13c8('0x30'))){_0x545b47[_0x13c8('0x1d')]=qs[_0x13c8('0x1d')](_0x196983[_0x13c8('0x2a')]['limit']);_0x545b47['offset']=qs[_0x13c8('0x1c')](_0x196983[_0x13c8('0x2a')]['offset']);}_0x545b47[_0x13c8('0x31')]=qs['sort'](_0x196983[_0x13c8('0x2a')]['sort']);_0x545b47[_0x13c8('0x32')]=qs[_0x13c8('0x2b')](_[_0x13c8('0x33')](_0x196983[_0x13c8('0x2a')],_0x1c7dc4[_0x13c8('0x2b')]));if(_0x196983[_0x13c8('0x2a')][_0x13c8('0x34')]){_0x545b47['where']=_[_0x13c8('0x35')](_0x545b47[_0x13c8('0x32')],{'$or':_['map'](_0x34fdbe,function(_0x362b9c){if(_0x362b9c[_0x13c8('0x36')][_0x13c8('0x37')]!=='VIRTUAL'){var _0x4a6225={};_0x4a6225[_0x362b9c['field']]={'$like':'%'+_0x196983[_0x13c8('0x2a')][_0x13c8('0x34')]+'%'};return _0x4a6225;}})});}_0x545b47=_[_0x13c8('0x35')]({},_0x545b47,_0x196983[_0x13c8('0x38')]);var _0x33e6f8={'where':_0x545b47[_0x13c8('0x32')]};return db[_0x13c8('0x39')][_0x13c8('0x1b')](_0x33e6f8)[_0x13c8('0x25')](function(_0x50d19a){_0x6c2dc8['count']=_0x50d19a;if(_0x196983[_0x13c8('0x2a')][_0x13c8('0x3a')]){_0x545b47[_0x13c8('0x3b')]=[{'all':!![]}];}return db[_0x13c8('0x39')]['findAll'](_0x545b47);})[_0x13c8('0x25')](function(_0x4bd627){_0x6c2dc8[_0x13c8('0x3c')]=_0x4bd627;return _0x6c2dc8;})[_0x13c8('0x25')](respondWithFilteredResult(_0x596166,_0x545b47))[_0x13c8('0x3d')](handleError(_0x596166,null));};exports[_0x13c8('0x3e')]=function(_0xbb1d49,_0x3c4555){var _0xb272c0={'raw':!![],'where':{'id':_0xbb1d49[_0x13c8('0x3f')]['id']}},_0x271001={};_0x271001[_0x13c8('0x28')]=_[_0x13c8('0x29')](db[_0x13c8('0x39')][_0x13c8('0x40')]);_0x271001[_0x13c8('0x2a')]=_[_0x13c8('0x29')](_0xbb1d49[_0x13c8('0x2a')]);_0x271001[_0x13c8('0x2b')]=_[_0x13c8('0x2c')](_0x271001[_0x13c8('0x28')],_0x271001[_0x13c8('0x2a')]);_0xb272c0[_0x13c8('0x2d')]=_[_0x13c8('0x2c')](_0x271001[_0x13c8('0x28')],qs[_0x13c8('0x2e')](_0xbb1d49[_0x13c8('0x2a')]['fields']));_0xb272c0[_0x13c8('0x2d')]=_0xb272c0[_0x13c8('0x2d')][_0x13c8('0x41')]?_0xb272c0[_0x13c8('0x2d')]:_0x271001[_0x13c8('0x28')];if(_0xbb1d49['query']['includeAll']){_0xb272c0[_0x13c8('0x3b')]=[{'all':!![]}];}_0xb272c0=_[_0x13c8('0x35')]({},_0xb272c0,_0xbb1d49[_0x13c8('0x38')]);return db['ZohoField']['find'](_0xb272c0)['then'](handleEntityNotFound(_0x3c4555,null))[_0x13c8('0x25')](respondWithResult(_0x3c4555,null))['catch'](handleError(_0x3c4555,null));};exports[_0x13c8('0x42')]=function(_0x4e3bb7,_0x6ad06d){return db[_0x13c8('0x39')][_0x13c8('0x42')](_0x4e3bb7[_0x13c8('0x43')],{})[_0x13c8('0x25')](respondWithResult(_0x6ad06d,0xc9))[_0x13c8('0x3d')](handleError(_0x6ad06d,null));};exports['update']=function(_0x94f91e,_0x2fec95){if(_0x94f91e['body']['id']){delete _0x94f91e[_0x13c8('0x43')]['id'];}return db[_0x13c8('0x39')][_0x13c8('0x44')]({'where':{'id':_0x94f91e[_0x13c8('0x3f')]['id']}})[_0x13c8('0x25')](handleEntityNotFound(_0x2fec95,null))['then'](saveUpdates(_0x94f91e[_0x13c8('0x43')],null))[_0x13c8('0x25')](respondWithResult(_0x2fec95,null))[_0x13c8('0x3d')](handleError(_0x2fec95,null));};exports[_0x13c8('0x45')]=function(_0x185d18,_0x59ec9f){return db[_0x13c8('0x39')][_0x13c8('0x44')]({'where':{'id':_0x185d18[_0x13c8('0x3f')]['id']}})[_0x13c8('0x25')](handleEntityNotFound(_0x59ec9f,null))[_0x13c8('0x25')](removeEntity(_0x59ec9f,null))[_0x13c8('0x3d')](handleError(_0x59ec9f,null));}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.model.js b/server/api/intZohoField/intZohoField.model.js index 9600249..7554925 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 _0xb73c=['lodash','util','../../config/logger','api','request-promise','rimraf','../../config/environment','./intZohoField.attributes','exports','define','ZohoField','int_zoho_fields'];(function(_0x534572,_0x493b59){var _0x43c514=function(_0x2934a1){while(--_0x2934a1){_0x534572['push'](_0x534572['shift']());}};_0x43c514(++_0x493b59);}(_0xb73c,0xd8));var _0xcb73=function(_0x375f00,_0x46d8f9){_0x375f00=_0x375f00-0x0;var _0x207d6b=_0xb73c[_0x375f00];return _0x207d6b;};'use strict';var _=require(_0xcb73('0x0'));var util=require(_0xcb73('0x1'));var logger=require(_0xcb73('0x2'))(_0xcb73('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xcb73('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xcb73('0x5'));var config=require(_0xcb73('0x6'));var attributes=require(_0xcb73('0x7'));module[_0xcb73('0x8')]=function(_0x55f907,_0x153bf6){return _0x55f907[_0xcb73('0x9')](_0xcb73('0xa'),attributes,{'tableName':_0xcb73('0xb'),'paranoid':![],'indexes':[{'name':'zoho_unique_index','fields':['idField','FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x843c=['int_zoho_fields','idField','lodash','util','bluebird','path','rimraf','../../config/environment','./intZohoField.attributes','exports','define','ZohoField'];(function(_0x509061,_0x1e86d9){var _0x2ba6b6=function(_0x2a9909){while(--_0x2a9909){_0x509061['push'](_0x509061['shift']());}};_0x2ba6b6(++_0x1e86d9);}(_0x843c,0x176));var _0xc843=function(_0x52fd14,_0x451adc){_0x52fd14=_0x52fd14-0x0;var _0x1517ba=_0x843c[_0x52fd14];return _0x1517ba;};'use strict';var _=require(_0xc843('0x0'));var util=require(_0xc843('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xc843('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc843('0x3'));var rimraf=require(_0xc843('0x4'));var config=require(_0xc843('0x5'));var attributes=require(_0xc843('0x6'));module[_0xc843('0x7')]=function(_0x87beac,_0x2abb97){return _0x87beac[_0xc843('0x8')](_0xc843('0x9'),attributes,{'tableName':_0xc843('0xa'),'paranoid':![],'indexes':[{'name':'zoho_unique_index','fields':[_0xc843('0xb'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.rpc.js b/server/api/intZohoField/intZohoField.rpc.js index 7c9b4ec..a5b9b96 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 _0xe14d=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ZohoField,\x20%s,\x20%s','debug','ZohoField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb'];(function(_0x5f259a,_0x17d242){var _0x272c43=function(_0x2b1eb0){while(--_0x2b1eb0){_0x5f259a['push'](_0x5f259a['shift']());}};_0x272c43(++_0x17d242);}(_0xe14d,0x1ee));var _0xde14=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0xe14d[_0x2d7f0e];return _0x110b07;};'use strict';var _=require(_0xde14('0x0'));var util=require(_0xde14('0x1'));var moment=require(_0xde14('0x2'));var BPromise=require(_0xde14('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xde14('0x4'));var db=require(_0xde14('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xde14('0x6'))(_0xde14('0x7'));var config=require(_0xde14('0x8'));var jayson=require(_0xde14('0x9'));var client=jayson[_0xde14('0xa')][_0xde14('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4b1f6b,_0x5a1344,_0x1bd49d){return new BPromise(function(_0x115b7d,_0x2b0e7c){return client[_0xde14('0xc')](_0x4b1f6b,_0x1bd49d)[_0xde14('0xd')](function(_0x176909){logger[_0xde14('0xe')](_0xde14('0xf'),_0x5a1344,'request\x20sent');logger[_0xde14('0x10')](_0xde14('0x11'),_0x5a1344,_0xde14('0x12'),JSON[_0xde14('0x13')](_0x176909));if(_0x176909[_0xde14('0x14')]){if(_0x176909[_0xde14('0x14')][_0xde14('0x15')]===0x1f4){logger[_0xde14('0x14')](_0xde14('0xf'),_0x5a1344,_0x176909[_0xde14('0x14')][_0xde14('0x16')]);return _0x2b0e7c(_0x176909[_0xde14('0x14')][_0xde14('0x16')]);}logger[_0xde14('0x14')](_0xde14('0xf'),_0x5a1344,_0x176909['error']['message']);return _0x115b7d(_0x176909[_0xde14('0x14')][_0xde14('0x16')]);}else{logger[_0xde14('0xe')]('ZohoField,\x20%s,\x20%s',_0x5a1344,_0xde14('0x12'));_0x115b7d(_0x176909[_0xde14('0x17')][_0xde14('0x16')]);}})[_0xde14('0x18')](function(_0x3de959){logger[_0xde14('0x14')](_0xde14('0xf'),_0x5a1344,_0x3de959);_0x2b0e7c(_0x3de959);});});} \ No newline at end of file +var _0x98a8=['request','then','info','ZohoField,\x20%s,\x20%s','request\x20sent','debug','ZohoField,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x2b1873,_0x4c4d65){var _0x27bfdc=function(_0x3bb1b1){while(--_0x3bb1b1){_0x2b1873['push'](_0x2b1873['shift']());}};_0x27bfdc(++_0x4c4d65);}(_0x98a8,0x12c));var _0x898a=function(_0x329df2,_0x32a52e){_0x329df2=_0x329df2-0x0;var _0x3e176d=_0x98a8[_0x329df2];return _0x3e176d;};'use strict';var _=require(_0x898a('0x0'));var util=require(_0x898a('0x1'));var moment=require(_0x898a('0x2'));var BPromise=require(_0x898a('0x3'));var rs=require(_0x898a('0x4'));var fs=require('fs');var Redis=require(_0x898a('0x5'));var db=require(_0x898a('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x898a('0x7'))(_0x898a('0x8'));var config=require(_0x898a('0x9'));var jayson=require(_0x898a('0xa'));var client=jayson[_0x898a('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3aadc2,_0x564583,_0xfa8c50){return new BPromise(function(_0x4fbce5,_0x42021d){return client[_0x898a('0xc')](_0x3aadc2,_0xfa8c50)[_0x898a('0xd')](function(_0x96b636){logger[_0x898a('0xe')](_0x898a('0xf'),_0x564583,_0x898a('0x10'));logger[_0x898a('0x11')](_0x898a('0x12'),_0x564583,'request\x20sent',JSON[_0x898a('0x13')](_0x96b636));if(_0x96b636['error']){if(_0x96b636[_0x898a('0x14')]['code']===0x1f4){logger[_0x898a('0x14')](_0x898a('0xf'),_0x564583,_0x96b636[_0x898a('0x14')]['message']);return _0x42021d(_0x96b636['error']['message']);}logger[_0x898a('0x14')](_0x898a('0xf'),_0x564583,_0x96b636[_0x898a('0x14')][_0x898a('0x15')]);return _0x4fbce5(_0x96b636[_0x898a('0x14')][_0x898a('0x15')]);}else{logger['info'](_0x898a('0xf'),_0x564583,'request\x20sent');_0x4fbce5(_0x96b636[_0x898a('0x16')]['message']);}})[_0x898a('0x17')](function(_0x4fb05b){logger[_0x898a('0x14')]('ZohoField,\x20%s,\x20%s',_0x564583,_0x4fb05b);_0x42021d(_0x4fb05b);});});} \ No newline at end of file diff --git a/server/api/integration/index.js b/server/api/integration/index.js index c1d2e4a..e6dc09d 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 _0x26d3=['Router','../../components/auth/service','../../config/environment','exports','multer','util','path','connect-timeout','express'];(function(_0x598aa9,_0x36ce33){var _0x4ccbc3=function(_0x3be91a){while(--_0x3be91a){_0x598aa9['push'](_0x598aa9['shift']());}};_0x4ccbc3(++_0x36ce33);}(_0x26d3,0x67));var _0x326d=function(_0x29662f,_0x2be2a4){_0x29662f=_0x29662f-0x0;var _0x2a0c63=_0x26d3[_0x29662f];return _0x2a0c63;};'use strict';var multer=require(_0x326d('0x0'));var util=require(_0x326d('0x1'));var path=require(_0x326d('0x2'));var timeout=require(_0x326d('0x3'));var express=require(_0x326d('0x4'));var router=express[_0x326d('0x5')]();var auth=require(_0x326d('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x326d('0x7'));module[_0x326d('0x8')]=router; \ No newline at end of file +var _0x64e1=['util','path','express','Router','../../components/interaction/service','exports','multer'];(function(_0x4d98b9,_0x48bb1f){var _0x542ac9=function(_0x18bba0){while(--_0x18bba0){_0x4d98b9['push'](_0x4d98b9['shift']());}};_0x542ac9(++_0x48bb1f);}(_0x64e1,0x1a3));var _0x164e=function(_0x135602,_0x144a86){_0x135602=_0x135602-0x0;var _0x38329a=_0x64e1[_0x135602];return _0x38329a;};'use strict';var multer=require(_0x164e('0x0'));var util=require(_0x164e('0x1'));var path=require(_0x164e('0x2'));var timeout=require('connect-timeout');var express=require(_0x164e('0x3'));var router=express[_0x164e('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x164e('0x5'));var config=require('../../config/environment');module[_0x164e('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 02a0150..e2779b6 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 _0x88b3=['state','exports','STRING','unique_name_and_version','app.js','BOOLEAN'];(function(_0x2bc8e0,_0x38204a){var _0xca8f97=function(_0x1de1c1){while(--_0x1de1c1){_0x2bc8e0['push'](_0x2bc8e0['shift']());}};_0xca8f97(++_0x38204a);}(_0x88b3,0x127));var _0x388b=function(_0x1f06f9,_0x23b3d0){_0x1f06f9=_0x1f06f9-0x0;var _0xb6fb13=_0x88b3[_0x1f06f9];return _0xb6fb13;};'use strict';var Sequelize=require('sequelize');module[_0x388b('0x0')]={'name':{'type':Sequelize[_0x388b('0x1')],'allowNull':![],'unique':'unique_name_and_version'},'version':{'type':Sequelize[_0x388b('0x1')],'allowNull':![],'unique':_0x388b('0x2')},'main':{'type':Sequelize['STRING'],'defaultValue':_0x388b('0x3')},'filename':{'type':Sequelize[_0x388b('0x1')]},'path':{'type':Sequelize[_0x388b('0x1')]},'type':{'type':Sequelize[_0x388b('0x1')]},'size':{'type':Sequelize['INTEGER']},'active':{'type':Sequelize[_0x388b('0x4')],'defaultValue':![]},'author':{'type':Sequelize[_0x388b('0x1')]},'logo':{'type':Sequelize[_0x388b('0x1')]},'state':{'type':Sequelize[_0x388b('0x1')],'unique':_0x388b('0x5')},'description':{'type':Sequelize[_0x388b('0x1')]},'title':{'type':Sequelize[_0x388b('0x1')]},'remoteUri':{'type':Sequelize[_0x388b('0x1')]},'link':{'type':Sequelize[_0x388b('0x1')],'defaultValue':'#'}}; \ No newline at end of file +var _0x0fc0=['STRING','unique_name_and_version','app.js','INTEGER','state','sequelize','exports'];(function(_0x1f9503,_0x8e450b){var _0xaab94f=function(_0x5b0c4d){while(--_0x5b0c4d){_0x1f9503['push'](_0x1f9503['shift']());}};_0xaab94f(++_0x8e450b);}(_0x0fc0,0x108));var _0x00fc=function(_0x36ed48,_0x1ee0d4){_0x36ed48=_0x36ed48-0x0;var _0x51c63a=_0x0fc0[_0x36ed48];return _0x51c63a;};'use strict';var Sequelize=require(_0x00fc('0x0'));module[_0x00fc('0x1')]={'name':{'type':Sequelize[_0x00fc('0x2')],'allowNull':![],'unique':'unique_name_and_version'},'version':{'type':Sequelize[_0x00fc('0x2')],'allowNull':![],'unique':_0x00fc('0x3')},'main':{'type':Sequelize['STRING'],'defaultValue':_0x00fc('0x4')},'filename':{'type':Sequelize[_0x00fc('0x2')]},'path':{'type':Sequelize[_0x00fc('0x2')]},'type':{'type':Sequelize['STRING']},'size':{'type':Sequelize[_0x00fc('0x5')]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'author':{'type':Sequelize['STRING']},'logo':{'type':Sequelize[_0x00fc('0x2')]},'state':{'type':Sequelize[_0x00fc('0x2')],'unique':_0x00fc('0x6')},'description':{'type':Sequelize[_0x00fc('0x2')]},'title':{'type':Sequelize[_0x00fc('0x2')]},'remoteUri':{'type':Sequelize['STRING']},'link':{'type':Sequelize[_0x00fc('0x2')],'defaultValue':'#'}}; \ No newline at end of file diff --git a/server/api/integration/integration.controller.js b/server/api/integration/integration.controller.js index 294b890..7e21de4 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 _0x2799=['rows','catch','show','find','create','body','params','html-pdf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','Content-Range','apply','save','update','then','destroy','stack','name','send','index','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','limit','order','sort','filter','where','merge','VIRTUAL','field','options','Integration','count','includeAll','include','findAll'];(function(_0x377a6e,_0x59b99d){var _0x37f751=function(_0x2ed25c){while(--_0x2ed25c){_0x377a6e['push'](_0x377a6e['shift']());}};_0x37f751(++_0x59b99d);}(_0x2799,0x160));var _0x9279=function(_0x4747ba,_0x1f88b4){_0x4747ba=_0x4747ba-0x0;var _0x408992=_0x2799[_0x4747ba];return _0x408992;};'use strict';var pdf=require(_0x9279('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x9279('0x1'));var jsonpatch=require(_0x9279('0x2'));var rp=require('request-promise');var moment=require(_0x9279('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x9279('0x4'));var util=require(_0x9279('0x5'));var path=require(_0x9279('0x6'));var sox=require(_0x9279('0x7'));var csv=require(_0x9279('0x8'));var ejs=require(_0x9279('0x9'));var fs=require('fs');var _=require(_0x9279('0xa'));var squel=require(_0x9279('0xb'));var crypto=require(_0x9279('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x9279('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x9279('0xe'));var Redis=require(_0x9279('0xf'));var authService=require(_0x9279('0x10'));var qs=require(_0x9279('0x11'));var as=require(_0x9279('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x9279('0x13'));var utils=require(_0x9279('0x14'));var config=require(_0x9279('0x15'));var db=require(_0x9279('0x16'))['db'];function respondWithStatusCode(_0x31a448,_0x3407ff){_0x3407ff=_0x3407ff||0xcc;return function(_0x32cea){if(_0x32cea){return _0x31a448[_0x9279('0x17')](_0x3407ff);}return _0x31a448[_0x9279('0x18')](_0x3407ff)[_0x9279('0x19')]();};}function respondWithResult(_0x2fc92a,_0x1afc2b){_0x1afc2b=_0x1afc2b||0xc8;return function(_0x3dee53){if(_0x3dee53){return _0x2fc92a['status'](_0x1afc2b)[_0x9279('0x1a')](_0x3dee53);}};}function respondWithFilteredResult(_0x1514ab,_0x582614){return function(_0x5014f2){if(_0x5014f2){var _0x2349da=_0x5014f2['count'],_0x1569f3=_0x582614[_0x9279('0x1b')],_0x532abc=_0x582614['offset']+_0x582614['limit'],_0x53c6b4;if(_0x532abc>=_0x2349da){_0x532abc=_0x2349da;_0x53c6b4=0xc8;}else{_0x53c6b4=0xce;}_0x1514ab['status'](_0x53c6b4);return _0x1514ab['set'](_0x9279('0x1c'),_0x1569f3+'-'+_0x532abc+'/'+_0x2349da)[_0x9279('0x1a')](_0x5014f2);}return null;};}function patchUpdates(_0x321fed){return function(_0x40df45){try{jsonpatch[_0x9279('0x1d')](_0x40df45,_0x321fed,!![]);}catch(_0x284a19){return BPromise['reject'](_0x284a19);}return _0x40df45[_0x9279('0x1e')]();};}function saveUpdates(_0x2cdc74,_0x51e6ae){return function(_0x32811c){if(_0x32811c){return _0x32811c[_0x9279('0x1f')](_0x2cdc74)[_0x9279('0x20')](function(_0x3a40a5){return _0x3a40a5;});}return null;};}function removeEntity(_0x42beb2,_0x649eb0){return function(_0x5c4068){if(_0x5c4068){return _0x5c4068[_0x9279('0x21')]()['then'](function(){_0x42beb2[_0x9279('0x18')](0xcc)[_0x9279('0x19')]();});}};}function handleEntityNotFound(_0x14da56,_0x1c5828){return function(_0x58e84a){if(!_0x58e84a){_0x14da56[_0x9279('0x17')](0x194);}return _0x58e84a;};}function handleError(_0x29df73,_0x146e5a){_0x146e5a=_0x146e5a||0x1f4;return function(_0x1d6e8c){logger['error'](_0x1d6e8c[_0x9279('0x22')]);if(_0x1d6e8c[_0x9279('0x23')]){delete _0x1d6e8c[_0x9279('0x23')];}_0x29df73[_0x9279('0x18')](_0x146e5a)[_0x9279('0x24')](_0x1d6e8c);};}exports[_0x9279('0x25')]=function(_0x4993a9,_0x45db6c){var _0x12421f={},_0x36a81a={},_0x41a6cd={'count':0x0,'rows':[]};var _0x16b863=db['Integration'][_0x9279('0x26')];_0x36a81a[_0x9279('0x27')]=_[_0x9279('0x28')](_0x16b863);_0x36a81a['query']=_[_0x9279('0x28')](_0x4993a9[_0x9279('0x29')]);_0x36a81a[_0x9279('0x2a')]=_[_0x9279('0x2b')](_0x36a81a['model'],_0x36a81a['query']);_0x12421f[_0x9279('0x2c')]=_[_0x9279('0x2b')](_0x36a81a[_0x9279('0x27')],qs[_0x9279('0x2d')](_0x4993a9['query'][_0x9279('0x2d')]));_0x12421f[_0x9279('0x2c')]=_0x12421f['attributes'][_0x9279('0x2e')]?_0x12421f[_0x9279('0x2c')]:_0x36a81a[_0x9279('0x27')];if(!_0x4993a9[_0x9279('0x29')][_0x9279('0x2f')]('nolimit')){_0x12421f[_0x9279('0x30')]=qs[_0x9279('0x30')](_0x4993a9[_0x9279('0x29')][_0x9279('0x30')]);_0x12421f[_0x9279('0x1b')]=qs['offset'](_0x4993a9[_0x9279('0x29')]['offset']);}_0x12421f[_0x9279('0x31')]=qs[_0x9279('0x32')](_0x4993a9['query'][_0x9279('0x32')]);_0x12421f['where']=qs[_0x9279('0x2a')](_['pick'](_0x4993a9['query'],_0x36a81a[_0x9279('0x2a')]));if(_0x4993a9[_0x9279('0x29')][_0x9279('0x33')]){_0x12421f[_0x9279('0x34')]=_[_0x9279('0x35')](_0x12421f[_0x9279('0x34')],{'$or':_['map'](_0x16b863,function(_0x46e8da){if(_0x46e8da['type']['key']!==_0x9279('0x36')){var _0xfb8955={};_0xfb8955[_0x46e8da[_0x9279('0x37')]]={'$like':'%'+_0x4993a9[_0x9279('0x29')][_0x9279('0x33')]+'%'};return _0xfb8955;}})});}_0x12421f=_[_0x9279('0x35')]({},_0x12421f,_0x4993a9[_0x9279('0x38')]);var _0x571d7d={'where':_0x12421f['where']};return db[_0x9279('0x39')][_0x9279('0x3a')](_0x571d7d)[_0x9279('0x20')](function(_0x542e43){_0x41a6cd[_0x9279('0x3a')]=_0x542e43;if(_0x4993a9[_0x9279('0x29')][_0x9279('0x3b')]){_0x12421f[_0x9279('0x3c')]=[{'all':!![]}];}return db[_0x9279('0x39')][_0x9279('0x3d')](_0x12421f);})[_0x9279('0x20')](function(_0x3e0798){_0x41a6cd[_0x9279('0x3e')]=_0x3e0798;return _0x41a6cd;})[_0x9279('0x20')](respondWithFilteredResult(_0x45db6c,_0x12421f))[_0x9279('0x3f')](handleError(_0x45db6c,null));};exports[_0x9279('0x40')]=function(_0x35f083,_0x156fbe){var _0xf77e6f={'raw':![],'where':{'id':_0x35f083['params']['id']}},_0x4b08c9={};_0x4b08c9[_0x9279('0x27')]=_[_0x9279('0x28')](db[_0x9279('0x39')][_0x9279('0x26')]);_0x4b08c9[_0x9279('0x29')]=_[_0x9279('0x28')](_0x35f083[_0x9279('0x29')]);_0x4b08c9['filters']=_[_0x9279('0x2b')](_0x4b08c9[_0x9279('0x27')],_0x4b08c9['query']);_0xf77e6f[_0x9279('0x2c')]=_[_0x9279('0x2b')](_0x4b08c9[_0x9279('0x27')],qs[_0x9279('0x2d')](_0x35f083[_0x9279('0x29')][_0x9279('0x2d')]));_0xf77e6f[_0x9279('0x2c')]=_0xf77e6f['attributes'][_0x9279('0x2e')]?_0xf77e6f[_0x9279('0x2c')]:_0x4b08c9[_0x9279('0x27')];if(_0x35f083[_0x9279('0x29')][_0x9279('0x3b')]){_0xf77e6f[_0x9279('0x3c')]=[{'all':!![]}];}_0xf77e6f=_[_0x9279('0x35')]({},_0xf77e6f,_0x35f083[_0x9279('0x38')]);return db[_0x9279('0x39')][_0x9279('0x41')](_0xf77e6f)['then'](handleEntityNotFound(_0x156fbe,null))[_0x9279('0x20')](respondWithResult(_0x156fbe,null))[_0x9279('0x3f')](handleError(_0x156fbe,null));};exports[_0x9279('0x42')]=function(_0x1ea49a,_0x58690b){return db['Integration'][_0x9279('0x42')](_0x1ea49a['body'],{})[_0x9279('0x20')](respondWithResult(_0x58690b,0xc9))[_0x9279('0x3f')](handleError(_0x58690b,null));};exports[_0x9279('0x1f')]=function(_0x4adc1c,_0x25c838){if(_0x4adc1c[_0x9279('0x43')]['id']){delete _0x4adc1c[_0x9279('0x43')]['id'];}return db[_0x9279('0x39')][_0x9279('0x41')]({'where':{'id':_0x4adc1c[_0x9279('0x44')]['id']}})[_0x9279('0x20')](handleEntityNotFound(_0x25c838,null))['then'](saveUpdates(_0x4adc1c['body'],null))[_0x9279('0x20')](respondWithResult(_0x25c838,null))[_0x9279('0x3f')](handleError(_0x25c838,null));};exports[_0x9279('0x21')]=function(_0x1aa6bd,_0x20186e){return db[_0x9279('0x39')][_0x9279('0x41')]({'where':{'id':_0x1aa6bd[_0x9279('0x44')]['id']}})[_0x9279('0x20')](handleEntityNotFound(_0x20186e,null))[_0x9279('0x20')](removeEntity(_0x20186e,null))[_0x9279('0x3f')](handleError(_0x20186e,null));}; \ No newline at end of file +var _0x50f9=['pick','filter','merge','map','type','VIRTUAL','field','options','includeAll','include','rows','catch','show','params','keys','rawAttributes','length','find','create','body','html-pdf','fast-json-patch','request-promise','moment','bluebird','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../mysqldb','sendStatus','end','status','json','count','offset','limit','Content-Range','apply','save','update','then','destroy','stack','name','send','Integration','model','query','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','filters'];(function(_0x1ca9e9,_0x1c4391){var _0x309f3c=function(_0x5ab318){while(--_0x5ab318){_0x1ca9e9['push'](_0x1ca9e9['shift']());}};_0x309f3c(++_0x1c4391);}(_0x50f9,0x163));var _0x950f=function(_0x4510f0,_0x546049){_0x4510f0=_0x4510f0-0x0;var _0x278584=_0x50f9[_0x4510f0];return _0x278584;};'use strict';var pdf=require(_0x950f('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x950f('0x1'));var rp=require(_0x950f('0x2'));var moment=require(_0x950f('0x3'));var BPromise=require(_0x950f('0x4'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x950f('0x5'));var csv=require(_0x950f('0x6'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x950f('0x7'));var squel=require(_0x950f('0x8'));var crypto=require(_0x950f('0x9'));var jsforce=require(_0x950f('0xa'));var deskjs=require(_0x950f('0xb'));var toCsv=require(_0x950f('0x6'));var querystring=require(_0x950f('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x950f('0xd'));var qs=require(_0x950f('0xe'));var as=require(_0x950f('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x950f('0x10'))('api');var utils=require(_0x950f('0x11'));var config=require('../../config/environment');var db=require(_0x950f('0x12'))['db'];function respondWithStatusCode(_0x3a0d00,_0x36d2c1){_0x36d2c1=_0x36d2c1||0xcc;return function(_0x509f61){if(_0x509f61){return _0x3a0d00[_0x950f('0x13')](_0x36d2c1);}return _0x3a0d00['status'](_0x36d2c1)[_0x950f('0x14')]();};}function respondWithResult(_0x148b6d,_0x3b5b33){_0x3b5b33=_0x3b5b33||0xc8;return function(_0x4a6ac8){if(_0x4a6ac8){return _0x148b6d[_0x950f('0x15')](_0x3b5b33)[_0x950f('0x16')](_0x4a6ac8);}};}function respondWithFilteredResult(_0x283633,_0x2f9800){return function(_0x532a55){if(_0x532a55){var _0x4371db=_0x532a55[_0x950f('0x17')],_0x5cfb5c=_0x2f9800[_0x950f('0x18')],_0x54ccab=_0x2f9800[_0x950f('0x18')]+_0x2f9800[_0x950f('0x19')],_0x4c0fba;if(_0x54ccab>=_0x4371db){_0x54ccab=_0x4371db;_0x4c0fba=0xc8;}else{_0x4c0fba=0xce;}_0x283633['status'](_0x4c0fba);return _0x283633['set'](_0x950f('0x1a'),_0x5cfb5c+'-'+_0x54ccab+'/'+_0x4371db)[_0x950f('0x16')](_0x532a55);}return null;};}function patchUpdates(_0x3fe15f){return function(_0x1d0fee){try{jsonpatch[_0x950f('0x1b')](_0x1d0fee,_0x3fe15f,!![]);}catch(_0x40d40a){return BPromise['reject'](_0x40d40a);}return _0x1d0fee[_0x950f('0x1c')]();};}function saveUpdates(_0x3c4434,_0x2855a6){return function(_0x7e9457){if(_0x7e9457){return _0x7e9457[_0x950f('0x1d')](_0x3c4434)[_0x950f('0x1e')](function(_0x362831){return _0x362831;});}return null;};}function removeEntity(_0x16b7af,_0x14a5df){return function(_0x161dee){if(_0x161dee){return _0x161dee[_0x950f('0x1f')]()[_0x950f('0x1e')](function(){_0x16b7af[_0x950f('0x15')](0xcc)[_0x950f('0x14')]();});}};}function handleEntityNotFound(_0x457a46,_0x294423){return function(_0x13915c){if(!_0x13915c){_0x457a46['sendStatus'](0x194);}return _0x13915c;};}function handleError(_0x53ea5c,_0x1b9deb){_0x1b9deb=_0x1b9deb||0x1f4;return function(_0x16430d){logger['error'](_0x16430d[_0x950f('0x20')]);if(_0x16430d[_0x950f('0x21')]){delete _0x16430d[_0x950f('0x21')];}_0x53ea5c['status'](_0x1b9deb)[_0x950f('0x22')](_0x16430d);};}exports['index']=function(_0x50b177,_0x3d4ca7){var _0x3aaf73={},_0x44cfa1={},_0x5f3ced={'count':0x0,'rows':[]};var _0x47a959=db[_0x950f('0x23')]['rawAttributes'];_0x44cfa1[_0x950f('0x24')]=_['keys'](_0x47a959);_0x44cfa1[_0x950f('0x25')]=_['keys'](_0x50b177[_0x950f('0x25')]);_0x44cfa1['filters']=_['intersection'](_0x44cfa1[_0x950f('0x24')],_0x44cfa1[_0x950f('0x25')]);_0x3aaf73[_0x950f('0x26')]=_[_0x950f('0x27')](_0x44cfa1['model'],qs[_0x950f('0x28')](_0x50b177[_0x950f('0x25')][_0x950f('0x28')]));_0x3aaf73[_0x950f('0x26')]=_0x3aaf73[_0x950f('0x26')]['length']?_0x3aaf73['attributes']:_0x44cfa1['model'];if(!_0x50b177[_0x950f('0x25')][_0x950f('0x29')](_0x950f('0x2a'))){_0x3aaf73[_0x950f('0x19')]=qs['limit'](_0x50b177[_0x950f('0x25')][_0x950f('0x19')]);_0x3aaf73[_0x950f('0x18')]=qs[_0x950f('0x18')](_0x50b177[_0x950f('0x25')]['offset']);}_0x3aaf73[_0x950f('0x2b')]=qs[_0x950f('0x2c')](_0x50b177[_0x950f('0x25')][_0x950f('0x2c')]);_0x3aaf73[_0x950f('0x2d')]=qs[_0x950f('0x2e')](_[_0x950f('0x2f')](_0x50b177[_0x950f('0x25')],_0x44cfa1[_0x950f('0x2e')]));if(_0x50b177[_0x950f('0x25')][_0x950f('0x30')]){_0x3aaf73['where']=_[_0x950f('0x31')](_0x3aaf73[_0x950f('0x2d')],{'$or':_[_0x950f('0x32')](_0x47a959,function(_0x116eaf){if(_0x116eaf[_0x950f('0x33')]['key']!==_0x950f('0x34')){var _0x407bb7={};_0x407bb7[_0x116eaf[_0x950f('0x35')]]={'$like':'%'+_0x50b177[_0x950f('0x25')][_0x950f('0x30')]+'%'};return _0x407bb7;}})});}_0x3aaf73=_[_0x950f('0x31')]({},_0x3aaf73,_0x50b177[_0x950f('0x36')]);var _0x9c4d4c={'where':_0x3aaf73['where']};return db[_0x950f('0x23')][_0x950f('0x17')](_0x9c4d4c)[_0x950f('0x1e')](function(_0x343cc8){_0x5f3ced[_0x950f('0x17')]=_0x343cc8;if(_0x50b177[_0x950f('0x25')][_0x950f('0x37')]){_0x3aaf73[_0x950f('0x38')]=[{'all':!![]}];}return db[_0x950f('0x23')]['findAll'](_0x3aaf73);})[_0x950f('0x1e')](function(_0x629b68){_0x5f3ced[_0x950f('0x39')]=_0x629b68;return _0x5f3ced;})[_0x950f('0x1e')](respondWithFilteredResult(_0x3d4ca7,_0x3aaf73))[_0x950f('0x3a')](handleError(_0x3d4ca7,null));};exports[_0x950f('0x3b')]=function(_0x433054,_0x4c2e86){var _0x253ff2={'raw':![],'where':{'id':_0x433054[_0x950f('0x3c')]['id']}},_0x3aa672={};_0x3aa672[_0x950f('0x24')]=_[_0x950f('0x3d')](db['Integration'][_0x950f('0x3e')]);_0x3aa672[_0x950f('0x25')]=_[_0x950f('0x3d')](_0x433054[_0x950f('0x25')]);_0x3aa672[_0x950f('0x2e')]=_[_0x950f('0x27')](_0x3aa672[_0x950f('0x24')],_0x3aa672['query']);_0x253ff2['attributes']=_['intersection'](_0x3aa672['model'],qs[_0x950f('0x28')](_0x433054['query'][_0x950f('0x28')]));_0x253ff2['attributes']=_0x253ff2[_0x950f('0x26')][_0x950f('0x3f')]?_0x253ff2[_0x950f('0x26')]:_0x3aa672[_0x950f('0x24')];if(_0x433054['query'][_0x950f('0x37')]){_0x253ff2['include']=[{'all':!![]}];}_0x253ff2=_[_0x950f('0x31')]({},_0x253ff2,_0x433054[_0x950f('0x36')]);return db[_0x950f('0x23')][_0x950f('0x40')](_0x253ff2)['then'](handleEntityNotFound(_0x4c2e86,null))[_0x950f('0x1e')](respondWithResult(_0x4c2e86,null))['catch'](handleError(_0x4c2e86,null));};exports['create']=function(_0x2f0def,_0x20b27d){return db[_0x950f('0x23')][_0x950f('0x41')](_0x2f0def[_0x950f('0x42')],{})[_0x950f('0x1e')](respondWithResult(_0x20b27d,0xc9))[_0x950f('0x3a')](handleError(_0x20b27d,null));};exports[_0x950f('0x1d')]=function(_0x568978,_0x310d9f){if(_0x568978[_0x950f('0x42')]['id']){delete _0x568978[_0x950f('0x42')]['id'];}return db[_0x950f('0x23')]['find']({'where':{'id':_0x568978[_0x950f('0x3c')]['id']}})[_0x950f('0x1e')](handleEntityNotFound(_0x310d9f,null))[_0x950f('0x1e')](saveUpdates(_0x568978['body'],null))[_0x950f('0x1e')](respondWithResult(_0x310d9f,null))[_0x950f('0x3a')](handleError(_0x310d9f,null));};exports[_0x950f('0x1f')]=function(_0x1f27fb,_0x552f06){return db[_0x950f('0x23')][_0x950f('0x40')]({'where':{'id':_0x1f27fb[_0x950f('0x3c')]['id']}})['then'](handleEntityNotFound(_0x552f06,null))['then'](removeEntity(_0x552f06,null))[_0x950f('0x3a')](handleError(_0x552f06,null));}; \ No newline at end of file diff --git a/server/api/integration/integration.model.js b/server/api/integration/integration.model.js index b351939..98723ed 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 _0x6382=['rimraf','../../config/environment','./integration.attributes','exports','define','Integration','integrations','util','bluebird','path'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x6382,0x1f1));var _0x2638=function(_0x1c54b1,_0x36600a){_0x1c54b1=_0x1c54b1-0x0;var _0x3599c4=_0x6382[_0x1c54b1];return _0x3599c4;};'use strict';var _=require('lodash');var util=require(_0x2638('0x0'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x2638('0x1'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2638('0x2'));var rimraf=require(_0x2638('0x3'));var config=require(_0x2638('0x4'));var attributes=require(_0x2638('0x5'));module[_0x2638('0x6')]=function(_0x1aab8d,_0x2d8feb){return _0x1aab8d[_0x2638('0x7')](_0x2638('0x8'),attributes,{'tableName':_0x2638('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5c0b=['api','moment','bluebird','request-promise','../../config/environment','./integration.attributes','exports','define','Integration','integrations','lodash'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x5c0b,0xfc));var _0xb5c0=function(_0x20e7c8,_0x3fdb34){_0x20e7c8=_0x20e7c8-0x0;var _0x11a8b5=_0x5c0b[_0x20e7c8];return _0x11a8b5;};'use strict';var _=require(_0xb5c0('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xb5c0('0x1'));var moment=require(_0xb5c0('0x2'));var BPromise=require(_0xb5c0('0x3'));var rp=require(_0xb5c0('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xb5c0('0x5'));var attributes=require(_0xb5c0('0x6'));module[_0xb5c0('0x7')]=function(_0x195ec7,_0x4f78f1){return _0x195ec7[_0xb5c0('0x8')](_0xb5c0('0x9'),attributes,{'tableName':_0xb5c0('0xa'),'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 f53dde4..7483a43 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 _0xae17=['Integration,\x20%s,\x20%s','request\x20sent','debug','Integration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info'];(function(_0xe4a447,_0x3b2e99){var _0x59741a=function(_0x10e369){while(--_0x10e369){_0xe4a447['push'](_0xe4a447['shift']());}};_0x59741a(++_0x3b2e99);}(_0xae17,0x171));var _0x7ae1=function(_0x1605c0,_0xc566e0){_0x1605c0=_0x1605c0-0x0;var _0x3054ed=_0xae17[_0x1605c0];return _0x3054ed;};'use strict';var _=require(_0x7ae1('0x0'));var util=require(_0x7ae1('0x1'));var moment=require(_0x7ae1('0x2'));var BPromise=require(_0x7ae1('0x3'));var rs=require(_0x7ae1('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7ae1('0x5'))['db'];var utils=require(_0x7ae1('0x6'));var logger=require(_0x7ae1('0x7'))(_0x7ae1('0x8'));var config=require(_0x7ae1('0x9'));var jayson=require(_0x7ae1('0xa'));var client=jayson[_0x7ae1('0xb')][_0x7ae1('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x123862,_0x5ac1bb,_0x34362f){return new BPromise(function(_0x13c886,_0x441ae4){return client[_0x7ae1('0xd')](_0x123862,_0x34362f)['then'](function(_0x2b4304){logger[_0x7ae1('0xe')](_0x7ae1('0xf'),_0x5ac1bb,_0x7ae1('0x10'));logger[_0x7ae1('0x11')](_0x7ae1('0x12'),_0x5ac1bb,_0x7ae1('0x10'),JSON[_0x7ae1('0x13')](_0x2b4304));if(_0x2b4304[_0x7ae1('0x14')]){if(_0x2b4304[_0x7ae1('0x14')]['code']===0x1f4){logger[_0x7ae1('0x14')](_0x7ae1('0xf'),_0x5ac1bb,_0x2b4304[_0x7ae1('0x14')][_0x7ae1('0x15')]);return _0x441ae4(_0x2b4304[_0x7ae1('0x14')]['message']);}logger['error'](_0x7ae1('0xf'),_0x5ac1bb,_0x2b4304[_0x7ae1('0x14')][_0x7ae1('0x15')]);return _0x13c886(_0x2b4304[_0x7ae1('0x14')][_0x7ae1('0x15')]);}else{logger[_0x7ae1('0xe')]('Integration,\x20%s,\x20%s',_0x5ac1bb,'request\x20sent');_0x13c886(_0x2b4304[_0x7ae1('0x16')]['message']);}})[_0x7ae1('0x17')](function(_0x21e130){logger[_0x7ae1('0x14')]('Integration,\x20%s,\x20%s',_0x5ac1bb,_0x21e130);_0x441ae4(_0x21e130);});});} \ No newline at end of file +var _0x3dc1=['info','Integration,\x20%s,\x20%s','debug','Integration,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','catch','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','then'];(function(_0x1e3e59,_0x596d22){var _0x4cdd16=function(_0xec196f){while(--_0xec196f){_0x1e3e59['push'](_0x1e3e59['shift']());}};_0x4cdd16(++_0x596d22);}(_0x3dc1,0x127));var _0x13dc=function(_0x1469f6,_0x146df0){_0x1469f6=_0x1469f6-0x0;var _0x2612a9=_0x3dc1[_0x1469f6];return _0x2612a9;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x13dc('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x13dc('0x1'));var db=require(_0x13dc('0x2'))['db'];var utils=require(_0x13dc('0x3'));var logger=require(_0x13dc('0x4'))(_0x13dc('0x5'));var config=require('../../config/environment');var jayson=require(_0x13dc('0x6'));var client=jayson[_0x13dc('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5e34c3,_0x1e28ab,_0x4becff){return new BPromise(function(_0x5d358e,_0x3e732d){return client['request'](_0x5e34c3,_0x4becff)[_0x13dc('0x8')](function(_0x12ac72){logger[_0x13dc('0x9')](_0x13dc('0xa'),_0x1e28ab,'request\x20sent');logger[_0x13dc('0xb')](_0x13dc('0xc'),_0x1e28ab,'request\x20sent',JSON[_0x13dc('0xd')](_0x12ac72));if(_0x12ac72[_0x13dc('0xe')]){if(_0x12ac72[_0x13dc('0xe')]['code']===0x1f4){logger[_0x13dc('0xe')](_0x13dc('0xa'),_0x1e28ab,_0x12ac72['error'][_0x13dc('0xf')]);return _0x3e732d(_0x12ac72['error'][_0x13dc('0xf')]);}logger[_0x13dc('0xe')](_0x13dc('0xa'),_0x1e28ab,_0x12ac72[_0x13dc('0xe')][_0x13dc('0xf')]);return _0x5d358e(_0x12ac72['error'][_0x13dc('0xf')]);}else{logger[_0x13dc('0x9')](_0x13dc('0xa'),_0x1e28ab,_0x13dc('0x10'));_0x5d358e(_0x12ac72[_0x13dc('0x11')][_0x13dc('0xf')]);}})[_0x13dc('0x12')](function(_0x1d1e1e){logger[_0x13dc('0xe')](_0x13dc('0xa'),_0x1e28ab,_0x1d1e1e);_0x3e732d(_0x1d1e1e);});});} \ No newline at end of file diff --git a/server/api/integrationReport/index.js b/server/api/integrationReport/index.js index 8f8cddd..db12770 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 _0x1123=['/describe','describe','show','post','create','put','update','delete','/:id','destroy','path','express','Router','../../components/auth/service','./integrationReport.controller','get','isAuthenticated','index'];(function(_0x405385,_0x56f573){var _0x43837b=function(_0x30e20e){while(--_0x30e20e){_0x405385['push'](_0x405385['shift']());}};_0x43837b(++_0x56f573);}(_0x1123,0x118));var _0x3112=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x1123[_0x21a9d9];return _0x46adce;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3112('0x0'));var timeout=require('connect-timeout');var express=require(_0x3112('0x1'));var router=express[_0x3112('0x2')]();var auth=require(_0x3112('0x3'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x3112('0x4'));router[_0x3112('0x5')]('/',auth[_0x3112('0x6')](),controller[_0x3112('0x7')]);router[_0x3112('0x5')](_0x3112('0x8'),auth[_0x3112('0x6')](),controller[_0x3112('0x9')]);router[_0x3112('0x5')]('/:id',auth[_0x3112('0x6')](),controller[_0x3112('0xa')]);router[_0x3112('0xb')]('/',auth[_0x3112('0x6')](),controller[_0x3112('0xc')]);router[_0x3112('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x3112('0xe')]);router[_0x3112('0xf')](_0x3112('0x10'),auth[_0x3112('0x6')](),controller[_0x3112('0x11')]);module['exports']=router; \ No newline at end of file +var _0x28f0=['../../components/interaction/service','get','isAuthenticated','index','/describe','describe','/:id','show','post','put','update','delete','destroy','multer','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x71768d,_0x15c50f){var _0x3540b5=function(_0x314e35){while(--_0x314e35){_0x71768d['push'](_0x71768d['shift']());}};_0x3540b5(++_0x15c50f);}(_0x28f0,0x19c));var _0x028f=function(_0xd0b415,_0x149675){_0xd0b415=_0xd0b415-0x0;var _0x2bdf2c=_0x28f0[_0xd0b415];return _0x2bdf2c;};'use strict';var multer=require(_0x028f('0x0'));var util=require('util');var path=require(_0x028f('0x1'));var timeout=require(_0x028f('0x2'));var express=require(_0x028f('0x3'));var router=express[_0x028f('0x4')]();var auth=require(_0x028f('0x5'));var interaction=require(_0x028f('0x6'));var config=require('../../config/environment');var controller=require('./integrationReport.controller');router[_0x028f('0x7')]('/',auth[_0x028f('0x8')](),controller[_0x028f('0x9')]);router['get'](_0x028f('0xa'),auth['isAuthenticated'](),controller[_0x028f('0xb')]);router[_0x028f('0x7')](_0x028f('0xc'),auth[_0x028f('0x8')](),controller[_0x028f('0xd')]);router[_0x028f('0xe')]('/',auth[_0x028f('0x8')](),controller['create']);router[_0x028f('0xf')](_0x028f('0xc'),auth[_0x028f('0x8')](),controller[_0x028f('0x10')]);router[_0x028f('0x11')](_0x028f('0xc'),auth[_0x028f('0x8')](),controller[_0x028f('0x12')]);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 3654e0d..a93069e 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 _0x6ac2=['STRING','DATE','INTEGER','BOOLEAN','TEXT','ENUM','SENT','SENDING','RECEIVED','FAILED','sequelize','exports'];(function(_0xbba984,_0x4da9af){var _0x44b8f4=function(_0x35cbbc){while(--_0x35cbbc){_0xbba984['push'](_0xbba984['shift']());}};_0x44b8f4(++_0x4da9af);}(_0x6ac2,0xca));var _0x26ac=function(_0x26b324,_0x30f2eb){_0x26b324=_0x26b324-0x0;var _0x275b05=_0x6ac2[_0x26b324];return _0x275b05;};'use strict';var Sequelize=require(_0x26ac('0x0'));module[_0x26ac('0x1')]={'integration':{'type':Sequelize[_0x26ac('0x2')]},'eventChannel':{'type':Sequelize['STRING']},'exitStatus':{'type':Sequelize['STRING']},'ticketId':{'type':Sequelize[_0x26ac('0x2')]},'integrationId':{'type':Sequelize['INTEGER']},'contacts':{'type':Sequelize[_0x26ac('0x2')]},'uniqueid':{'type':Sequelize[_0x26ac('0x2')]},'calleridnum':{'type':Sequelize[_0x26ac('0x2')]},'calleridname':{'type':Sequelize[_0x26ac('0x2')]},'queue':{'type':Sequelize[_0x26ac('0x2')]},'interface':{'type':Sequelize[_0x26ac('0x2')]},'membername':{'type':Sequelize[_0x26ac('0x2')]},'agentcalledAt':{'type':Sequelize['DATE']},'agentconnectAt':{'type':Sequelize[_0x26ac('0x3')]},'holdtime':{'type':Sequelize[_0x26ac('0x4')]},'agentcomplete':{'type':Sequelize[_0x26ac('0x5')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0x26ac('0x3')]},'talktime':{'type':Sequelize['INTEGER']},'agentacw':{'type':Sequelize[_0x26ac('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize['INTEGER']},'reason':{'type':Sequelize[_0x26ac('0x2')]},'agentringnoanswer':{'type':Sequelize[_0x26ac('0x5')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize['DATE']},'agentdump':{'type':Sequelize[_0x26ac('0x5')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize['DATE']},'lastevent':{'type':Sequelize[_0x26ac('0x2')]},'channel':{'type':Sequelize[_0x26ac('0x2')]},'channelstate':{'type':Sequelize[_0x26ac('0x4')]},'channelstatedesc':{'type':Sequelize[_0x26ac('0x2')]},'connectedlinenum':{'type':Sequelize[_0x26ac('0x2')]},'connectedlinename':{'type':Sequelize[_0x26ac('0x2')]},'language':{'type':Sequelize[_0x26ac('0x2')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x26ac('0x2')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x26ac('0x2')]},'destchannel':{'type':Sequelize[_0x26ac('0x2')]},'destchannelstate':{'type':Sequelize[_0x26ac('0x4')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize[_0x26ac('0x2')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0x26ac('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x26ac('0x2')]},'destlanguage':{'type':Sequelize[_0x26ac('0x2')]},'destaccountcode':{'type':Sequelize[_0x26ac('0x2')]},'destcontext':{'type':Sequelize[_0x26ac('0x2')]},'destexten':{'type':Sequelize[_0x26ac('0x2')]},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize[_0x26ac('0x2')]},'messageId':{'type':Sequelize['STRING']},'inReplyTo':{'type':Sequelize[_0x26ac('0x2')]},'subject':{'type':Sequelize[_0x26ac('0x2')]},'from':{'type':Sequelize[_0x26ac('0x2')]},'to':{'type':Sequelize[_0x26ac('0x2')]},'cc':{'type':Sequelize[_0x26ac('0x2')]},'attachment':{'type':Sequelize[_0x26ac('0x6')]},'html':{'type':Sequelize['TEXT']},'text':{'type':Sequelize[_0x26ac('0x6')]},'status':{'type':Sequelize[_0x26ac('0x7')](_0x26ac('0x8'),_0x26ac('0x9'),_0x26ac('0xa'),_0x26ac('0xb'))},'url':{'type':Sequelize['STRING']},'app':{'type':Sequelize[_0x26ac('0x2')]},'appdata':{'type':Sequelize[_0x26ac('0x2')]},'projectId':{'type':Sequelize[_0x26ac('0x4')]}}; \ No newline at end of file +var _0x64c8=['SENDING','exports','STRING','INTEGER','DATE','BOOLEAN','TEXT'];(function(_0x53a05e,_0x255c56){var _0x28155a=function(_0x296f85){while(--_0x296f85){_0x53a05e['push'](_0x53a05e['shift']());}};_0x28155a(++_0x255c56);}(_0x64c8,0x197));var _0x864c=function(_0x3e6b5e,_0x19226d){_0x3e6b5e=_0x3e6b5e-0x0;var _0x596268=_0x64c8[_0x3e6b5e];return _0x596268;};'use strict';var Sequelize=require('sequelize');module[_0x864c('0x0')]={'integration':{'type':Sequelize[_0x864c('0x1')]},'eventChannel':{'type':Sequelize[_0x864c('0x1')]},'exitStatus':{'type':Sequelize[_0x864c('0x1')]},'ticketId':{'type':Sequelize[_0x864c('0x1')]},'integrationId':{'type':Sequelize[_0x864c('0x2')]},'contacts':{'type':Sequelize[_0x864c('0x1')]},'uniqueid':{'type':Sequelize[_0x864c('0x1')]},'calleridnum':{'type':Sequelize[_0x864c('0x1')]},'calleridname':{'type':Sequelize[_0x864c('0x1')]},'queue':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0x864c('0x1')]},'membername':{'type':Sequelize[_0x864c('0x1')]},'agentcalledAt':{'type':Sequelize[_0x864c('0x3')]},'agentconnectAt':{'type':Sequelize[_0x864c('0x3')]},'holdtime':{'type':Sequelize[_0x864c('0x2')]},'agentcomplete':{'type':Sequelize[_0x864c('0x4')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0x864c('0x3')]},'talktime':{'type':Sequelize[_0x864c('0x2')]},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x864c('0x2')]},'reason':{'type':Sequelize['STRING']},'agentringnoanswer':{'type':Sequelize[_0x864c('0x4')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize['DATE']},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0x864c('0x3')]},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x864c('0x1')]},'channelstate':{'type':Sequelize[_0x864c('0x2')]},'channelstatedesc':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x864c('0x1')]},'connectedlinename':{'type':Sequelize[_0x864c('0x1')]},'language':{'type':Sequelize[_0x864c('0x1')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize[_0x864c('0x1')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0x864c('0x1')]},'destcalleridnum':{'type':Sequelize[_0x864c('0x1')]},'destcalleridname':{'type':Sequelize[_0x864c('0x1')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize[_0x864c('0x1')]},'destlanguage':{'type':Sequelize[_0x864c('0x1')]},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0x864c('0x1')]},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize[_0x864c('0x1')]},'messageId':{'type':Sequelize[_0x864c('0x1')]},'inReplyTo':{'type':Sequelize['STRING']},'subject':{'type':Sequelize[_0x864c('0x1')]},'from':{'type':Sequelize[_0x864c('0x1')]},'to':{'type':Sequelize[_0x864c('0x1')]},'cc':{'type':Sequelize['STRING']},'attachment':{'type':Sequelize[_0x864c('0x5')]},'html':{'type':Sequelize[_0x864c('0x5')]},'text':{'type':Sequelize[_0x864c('0x5')]},'status':{'type':Sequelize['ENUM']('SENT',_0x864c('0x6'),'RECEIVED','FAILED')},'url':{'type':Sequelize[_0x864c('0x1')]},'app':{'type':Sequelize[_0x864c('0x1')]},'appdata':{'type':Sequelize[_0x864c('0x1')]},'projectId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.controller.js b/server/api/integrationReport/integrationReport.controller.js index b35e3d6..4556795 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 _0xfa47=['stack','name','send','index','IntegrationReport','rawAttributes','model','keys','query','attributes','fields','length','hasOwnProperty','order','sort','where','filters','merge','map','type','key','VIRTUAL','field','filter','options','count','includeAll','include','findAll','rows','params','intersection','find','catch','create','body','destroy','html-pdf','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','status','end','json','offset','limit','set','Content-Range','apply','reject','update','then','sendStatus','error'];(function(_0x2b10c6,_0x185590){var _0x3789d2=function(_0x272987){while(--_0x272987){_0x2b10c6['push'](_0x2b10c6['shift']());}};_0x3789d2(++_0x185590);}(_0xfa47,0x13d));var _0x7fa4=function(_0x3430aa,_0x57cd92){_0x3430aa=_0x3430aa-0x0;var _0x2ac5c=_0xfa47[_0x3430aa];return _0x2ac5c;};'use strict';var pdf=require(_0x7fa4('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x7fa4('0x1'));var zipdir=require(_0x7fa4('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7fa4('0x3'));var moment=require(_0x7fa4('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x7fa4('0x5'));var util=require(_0x7fa4('0x6'));var path=require(_0x7fa4('0x7'));var sox=require(_0x7fa4('0x8'));var csv=require(_0x7fa4('0x9'));var ejs=require(_0x7fa4('0xa'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x7fa4('0xb'));var jsforce=require(_0x7fa4('0xc'));var deskjs=require(_0x7fa4('0xd'));var toCsv=require(_0x7fa4('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x7fa4('0xe'));var authService=require(_0x7fa4('0xf'));var qs=require(_0x7fa4('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7fa4('0x11'));var logger=require('../../config/logger')(_0x7fa4('0x12'));var utils=require('../../config/utils');var config=require(_0x7fa4('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1e8ba2,_0x40664f){_0x40664f=_0x40664f||0xcc;return function(_0x2b3efc){if(_0x2b3efc){return _0x1e8ba2['sendStatus'](_0x40664f);}return _0x1e8ba2[_0x7fa4('0x14')](_0x40664f)[_0x7fa4('0x15')]();};}function respondWithResult(_0x1a3e77,_0x3203e7){_0x3203e7=_0x3203e7||0xc8;return function(_0x43a921){if(_0x43a921){return _0x1a3e77['status'](_0x3203e7)[_0x7fa4('0x16')](_0x43a921);}};}function respondWithFilteredResult(_0x4adf62,_0x27be6e){return function(_0x30aa30){if(_0x30aa30){var _0x3e25c0=_0x30aa30['count'],_0x266cd2=_0x27be6e[_0x7fa4('0x17')],_0x5a1ff6=_0x27be6e[_0x7fa4('0x17')]+_0x27be6e[_0x7fa4('0x18')],_0x671385;if(_0x5a1ff6>=_0x3e25c0){_0x5a1ff6=_0x3e25c0;_0x671385=0xc8;}else{_0x671385=0xce;}_0x4adf62[_0x7fa4('0x14')](_0x671385);return _0x4adf62[_0x7fa4('0x19')](_0x7fa4('0x1a'),_0x266cd2+'-'+_0x5a1ff6+'/'+_0x3e25c0)[_0x7fa4('0x16')](_0x30aa30);}return null;};}function patchUpdates(_0x3d6eae){return function(_0x5317f6){try{jsonpatch[_0x7fa4('0x1b')](_0x5317f6,_0x3d6eae,!![]);}catch(_0x18044b){return BPromise[_0x7fa4('0x1c')](_0x18044b);}return _0x5317f6['save']();};}function saveUpdates(_0x523d84,_0x456f97){return function(_0x4df8ca){if(_0x4df8ca){return _0x4df8ca[_0x7fa4('0x1d')](_0x523d84)[_0x7fa4('0x1e')](function(_0x37ac5d){return _0x37ac5d;});}return null;};}function removeEntity(_0x39542d,_0x3f4c9a){return function(_0x49617e){if(_0x49617e){return _0x49617e['destroy']()[_0x7fa4('0x1e')](function(){_0x39542d[_0x7fa4('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x360ba9,_0x14bff2){return function(_0x1d931b){if(!_0x1d931b){_0x360ba9[_0x7fa4('0x1f')](0x194);}return _0x1d931b;};}function handleError(_0x37653f,_0x57625f){_0x57625f=_0x57625f||0x1f4;return function(_0x4e2fd9){logger[_0x7fa4('0x20')](_0x4e2fd9[_0x7fa4('0x21')]);if(_0x4e2fd9[_0x7fa4('0x22')]){delete _0x4e2fd9[_0x7fa4('0x22')];}_0x37653f['status'](_0x57625f)[_0x7fa4('0x23')](_0x4e2fd9);};}exports[_0x7fa4('0x24')]=function(_0x4d9a03,_0x402508){var _0x50ae38={},_0x29bb53={},_0x113e2c={'count':0x0,'rows':[]};var _0x7a10f9=db[_0x7fa4('0x25')][_0x7fa4('0x26')];_0x29bb53[_0x7fa4('0x27')]=_[_0x7fa4('0x28')](_0x7a10f9);_0x29bb53[_0x7fa4('0x29')]=_['keys'](_0x4d9a03['query']);_0x29bb53['filters']=_['intersection'](_0x29bb53['model'],_0x29bb53['query']);_0x50ae38[_0x7fa4('0x2a')]=_['intersection'](_0x29bb53[_0x7fa4('0x27')],qs[_0x7fa4('0x2b')](_0x4d9a03[_0x7fa4('0x29')][_0x7fa4('0x2b')]));_0x50ae38[_0x7fa4('0x2a')]=_0x50ae38[_0x7fa4('0x2a')][_0x7fa4('0x2c')]?_0x50ae38[_0x7fa4('0x2a')]:_0x29bb53['model'];if(!_0x4d9a03[_0x7fa4('0x29')][_0x7fa4('0x2d')]('nolimit')){_0x50ae38[_0x7fa4('0x18')]=qs[_0x7fa4('0x18')](_0x4d9a03[_0x7fa4('0x29')][_0x7fa4('0x18')]);_0x50ae38['offset']=qs['offset'](_0x4d9a03[_0x7fa4('0x29')][_0x7fa4('0x17')]);}_0x50ae38[_0x7fa4('0x2e')]=qs[_0x7fa4('0x2f')](_0x4d9a03['query'][_0x7fa4('0x2f')]);_0x50ae38[_0x7fa4('0x30')]=qs[_0x7fa4('0x31')](_['pick'](_0x4d9a03[_0x7fa4('0x29')],_0x29bb53[_0x7fa4('0x31')]));if(_0x4d9a03[_0x7fa4('0x29')]['filter']){_0x50ae38[_0x7fa4('0x30')]=_[_0x7fa4('0x32')](_0x50ae38['where'],{'$or':_[_0x7fa4('0x33')](_0x7a10f9,function(_0x47b2f0){if(_0x47b2f0[_0x7fa4('0x34')][_0x7fa4('0x35')]!==_0x7fa4('0x36')){var _0x4c600b={};_0x4c600b[_0x47b2f0[_0x7fa4('0x37')]]={'$like':'%'+_0x4d9a03['query'][_0x7fa4('0x38')]+'%'};return _0x4c600b;}})});}_0x50ae38=_[_0x7fa4('0x32')]({},_0x50ae38,_0x4d9a03[_0x7fa4('0x39')]);var _0x138c78={'where':_0x50ae38['where']};return db[_0x7fa4('0x25')][_0x7fa4('0x3a')](_0x138c78)['then'](function(_0x56e78e){_0x113e2c[_0x7fa4('0x3a')]=_0x56e78e;if(_0x4d9a03[_0x7fa4('0x29')][_0x7fa4('0x3b')]){_0x50ae38[_0x7fa4('0x3c')]=[{'all':!![]}];}return db[_0x7fa4('0x25')][_0x7fa4('0x3d')](_0x50ae38);})[_0x7fa4('0x1e')](function(_0x270faa){_0x113e2c[_0x7fa4('0x3e')]=_0x270faa;return _0x113e2c;})[_0x7fa4('0x1e')](respondWithFilteredResult(_0x402508,_0x50ae38))['catch'](handleError(_0x402508,null));};exports['show']=function(_0x22ab68,_0x13a10a){var _0x341254={'raw':![],'where':{'id':_0x22ab68[_0x7fa4('0x3f')]['id']}},_0x417f48={};_0x417f48[_0x7fa4('0x27')]=_[_0x7fa4('0x28')](db[_0x7fa4('0x25')][_0x7fa4('0x26')]);_0x417f48['query']=_[_0x7fa4('0x28')](_0x22ab68[_0x7fa4('0x29')]);_0x417f48[_0x7fa4('0x31')]=_[_0x7fa4('0x40')](_0x417f48[_0x7fa4('0x27')],_0x417f48['query']);_0x341254[_0x7fa4('0x2a')]=_['intersection'](_0x417f48[_0x7fa4('0x27')],qs[_0x7fa4('0x2b')](_0x22ab68['query'][_0x7fa4('0x2b')]));_0x341254[_0x7fa4('0x2a')]=_0x341254[_0x7fa4('0x2a')][_0x7fa4('0x2c')]?_0x341254['attributes']:_0x417f48[_0x7fa4('0x27')];if(_0x22ab68[_0x7fa4('0x29')][_0x7fa4('0x3b')]){_0x341254[_0x7fa4('0x3c')]=[{'all':!![]}];}_0x341254=_[_0x7fa4('0x32')]({},_0x341254,_0x22ab68[_0x7fa4('0x39')]);return db[_0x7fa4('0x25')][_0x7fa4('0x41')](_0x341254)[_0x7fa4('0x1e')](handleEntityNotFound(_0x13a10a,null))[_0x7fa4('0x1e')](respondWithResult(_0x13a10a,null))[_0x7fa4('0x42')](handleError(_0x13a10a,null));};exports['create']=function(_0x3318d0,_0xf63614){return db[_0x7fa4('0x25')][_0x7fa4('0x43')](_0x3318d0[_0x7fa4('0x44')],{})['then'](respondWithResult(_0xf63614,0xc9))['catch'](handleError(_0xf63614,null));};exports[_0x7fa4('0x1d')]=function(_0xe35001,_0x1acb2d){if(_0xe35001[_0x7fa4('0x44')]['id']){delete _0xe35001['body']['id'];}return db['IntegrationReport'][_0x7fa4('0x41')]({'where':{'id':_0xe35001['params']['id']}})['then'](handleEntityNotFound(_0x1acb2d,null))['then'](saveUpdates(_0xe35001['body'],null))['then'](respondWithResult(_0x1acb2d,null))[_0x7fa4('0x42')](handleError(_0x1acb2d,null));};exports[_0x7fa4('0x45')]=function(_0x428587,_0x5aad6f){return db[_0x7fa4('0x25')][_0x7fa4('0x41')]({'where':{'id':_0x428587[_0x7fa4('0x3f')]['id']}})[_0x7fa4('0x1e')](handleEntityNotFound(_0x5aad6f,null))[_0x7fa4('0x1e')](removeEntity(_0x5aad6f,null))['catch'](handleError(_0x5aad6f,null));};exports['describe']=function(_0x5c8112,_0xb55e0e){return db['IntegrationReport']['describe']()['then'](respondWithResult(_0xb55e0e,null))[_0x7fa4('0x42')](handleError(_0xb55e0e,null));}; \ No newline at end of file +var _0x308d=['field','options','include','findAll','rows','catch','show','params','body','find','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','apply','update','then','destroy','end','stack','name','send','IntegrationReport','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','map','type','VIRTUAL'];(function(_0x72dcbe,_0x4e27d5){var _0x159e7b=function(_0x408236){while(--_0x408236){_0x72dcbe['push'](_0x72dcbe['shift']());}};_0x159e7b(++_0x4e27d5);}(_0x308d,0x1a9));var _0xd308=function(_0x34048b,_0x3ec02b){_0x34048b=_0x34048b-0x0;var _0x2f85a6=_0x308d[_0x34048b];return _0x2f85a6;};'use strict';var pdf=require(_0xd308('0x0'));var emlformat=require(_0xd308('0x1'));var rimraf=require(_0xd308('0x2'));var zipdir=require(_0xd308('0x3'));var jsonpatch=require(_0xd308('0x4'));var rp=require(_0xd308('0x5'));var moment=require(_0xd308('0x6'));var BPromise=require(_0xd308('0x7'));var Mustache=require(_0xd308('0x8'));var util=require(_0xd308('0x9'));var path=require('path');var sox=require(_0xd308('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0xd308('0xb'));var squel=require(_0xd308('0xc'));var crypto=require(_0xd308('0xd'));var jsforce=require(_0xd308('0xe'));var deskjs=require(_0xd308('0xf'));var toCsv=require(_0xd308('0x10'));var querystring=require('querystring');var Papa=require(_0xd308('0x11'));var Redis=require('ioredis');var authService=require(_0xd308('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xd308('0x13'));var hardwareService=require(_0xd308('0x14'));var logger=require(_0xd308('0x15'))(_0xd308('0x16'));var utils=require('../../config/utils');var config=require(_0xd308('0x17'));var db=require(_0xd308('0x18'))['db'];function respondWithStatusCode(_0x154abf,_0x23367c){_0x23367c=_0x23367c||0xcc;return function(_0x47a020){if(_0x47a020){return _0x154abf[_0xd308('0x19')](_0x23367c);}return _0x154abf['status'](_0x23367c)['end']();};}function respondWithResult(_0x5a520c,_0x2230b0){_0x2230b0=_0x2230b0||0xc8;return function(_0x442c9c){if(_0x442c9c){return _0x5a520c[_0xd308('0x1a')](_0x2230b0)[_0xd308('0x1b')](_0x442c9c);}};}function respondWithFilteredResult(_0x499b28,_0x434cfd){return function(_0x201bf4){if(_0x201bf4){var _0x3a5953=_0x201bf4[_0xd308('0x1c')],_0x27e047=_0x434cfd[_0xd308('0x1d')],_0x2bb76c=_0x434cfd[_0xd308('0x1d')]+_0x434cfd[_0xd308('0x1e')],_0x454d9b;if(_0x2bb76c>=_0x3a5953){_0x2bb76c=_0x3a5953;_0x454d9b=0xc8;}else{_0x454d9b=0xce;}_0x499b28['status'](_0x454d9b);return _0x499b28['set']('Content-Range',_0x27e047+'-'+_0x2bb76c+'/'+_0x3a5953)[_0xd308('0x1b')](_0x201bf4);}return null;};}function patchUpdates(_0x3d50a9){return function(_0x2584c8){try{jsonpatch[_0xd308('0x1f')](_0x2584c8,_0x3d50a9,!![]);}catch(_0x4d7cee){return BPromise['reject'](_0x4d7cee);}return _0x2584c8['save']();};}function saveUpdates(_0x22d249,_0x39bca3){return function(_0x4c2e8c){if(_0x4c2e8c){return _0x4c2e8c[_0xd308('0x20')](_0x22d249)[_0xd308('0x21')](function(_0x3f34a7){return _0x3f34a7;});}return null;};}function removeEntity(_0x151fbd,_0x3a38cb){return function(_0x544f7f){if(_0x544f7f){return _0x544f7f[_0xd308('0x22')]()[_0xd308('0x21')](function(){_0x151fbd[_0xd308('0x1a')](0xcc)[_0xd308('0x23')]();});}};}function handleEntityNotFound(_0x14ccdf,_0x533800){return function(_0x527a72){if(!_0x527a72){_0x14ccdf[_0xd308('0x19')](0x194);}return _0x527a72;};}function handleError(_0x241c97,_0x3c61a1){_0x3c61a1=_0x3c61a1||0x1f4;return function(_0x350efe){logger['error'](_0x350efe[_0xd308('0x24')]);if(_0x350efe[_0xd308('0x25')]){delete _0x350efe[_0xd308('0x25')];}_0x241c97[_0xd308('0x1a')](_0x3c61a1)[_0xd308('0x26')](_0x350efe);};}exports['index']=function(_0xa78481,_0x36e19b){var _0x37315b={},_0x49b908={},_0xddf94c={'count':0x0,'rows':[]};var _0x78b472=db[_0xd308('0x27')]['rawAttributes'];_0x49b908[_0xd308('0x28')]=_[_0xd308('0x29')](_0x78b472);_0x49b908[_0xd308('0x2a')]=_['keys'](_0xa78481[_0xd308('0x2a')]);_0x49b908[_0xd308('0x2b')]=_['intersection'](_0x49b908['model'],_0x49b908[_0xd308('0x2a')]);_0x37315b['attributes']=_[_0xd308('0x2c')](_0x49b908[_0xd308('0x28')],qs[_0xd308('0x2d')](_0xa78481['query'][_0xd308('0x2d')]));_0x37315b['attributes']=_0x37315b[_0xd308('0x2e')][_0xd308('0x2f')]?_0x37315b['attributes']:_0x49b908['model'];if(!_0xa78481[_0xd308('0x2a')][_0xd308('0x30')]('nolimit')){_0x37315b[_0xd308('0x1e')]=qs[_0xd308('0x1e')](_0xa78481[_0xd308('0x2a')][_0xd308('0x1e')]);_0x37315b['offset']=qs[_0xd308('0x1d')](_0xa78481['query'][_0xd308('0x1d')]);}_0x37315b[_0xd308('0x31')]=qs[_0xd308('0x32')](_0xa78481[_0xd308('0x2a')][_0xd308('0x32')]);_0x37315b[_0xd308('0x33')]=qs[_0xd308('0x2b')](_[_0xd308('0x34')](_0xa78481[_0xd308('0x2a')],_0x49b908[_0xd308('0x2b')]));if(_0xa78481[_0xd308('0x2a')][_0xd308('0x35')]){_0x37315b['where']=_[_0xd308('0x36')](_0x37315b[_0xd308('0x33')],{'$or':_[_0xd308('0x37')](_0x78b472,function(_0x101c38){if(_0x101c38[_0xd308('0x38')]['key']!==_0xd308('0x39')){var _0xf48a6={};_0xf48a6[_0x101c38[_0xd308('0x3a')]]={'$like':'%'+_0xa78481[_0xd308('0x2a')][_0xd308('0x35')]+'%'};return _0xf48a6;}})});}_0x37315b=_[_0xd308('0x36')]({},_0x37315b,_0xa78481[_0xd308('0x3b')]);var _0x2d7104={'where':_0x37315b[_0xd308('0x33')]};return db[_0xd308('0x27')][_0xd308('0x1c')](_0x2d7104)['then'](function(_0x14f4c6){_0xddf94c[_0xd308('0x1c')]=_0x14f4c6;if(_0xa78481['query']['includeAll']){_0x37315b[_0xd308('0x3c')]=[{'all':!![]}];}return db[_0xd308('0x27')][_0xd308('0x3d')](_0x37315b);})[_0xd308('0x21')](function(_0x527ecd){_0xddf94c[_0xd308('0x3e')]=_0x527ecd;return _0xddf94c;})[_0xd308('0x21')](respondWithFilteredResult(_0x36e19b,_0x37315b))[_0xd308('0x3f')](handleError(_0x36e19b,null));};exports[_0xd308('0x40')]=function(_0xed59ba,_0x2841b4){var _0x329d1a={'raw':![],'where':{'id':_0xed59ba[_0xd308('0x41')]['id']}},_0x2851bf={};_0x2851bf[_0xd308('0x28')]=_[_0xd308('0x29')](db[_0xd308('0x27')]['rawAttributes']);_0x2851bf[_0xd308('0x2a')]=_[_0xd308('0x29')](_0xed59ba[_0xd308('0x2a')]);_0x2851bf[_0xd308('0x2b')]=_[_0xd308('0x2c')](_0x2851bf[_0xd308('0x28')],_0x2851bf[_0xd308('0x2a')]);_0x329d1a['attributes']=_[_0xd308('0x2c')](_0x2851bf[_0xd308('0x28')],qs['fields'](_0xed59ba[_0xd308('0x2a')][_0xd308('0x2d')]));_0x329d1a[_0xd308('0x2e')]=_0x329d1a[_0xd308('0x2e')][_0xd308('0x2f')]?_0x329d1a['attributes']:_0x2851bf[_0xd308('0x28')];if(_0xed59ba[_0xd308('0x2a')]['includeAll']){_0x329d1a['include']=[{'all':!![]}];}_0x329d1a=_['merge']({},_0x329d1a,_0xed59ba[_0xd308('0x3b')]);return db['IntegrationReport']['find'](_0x329d1a)[_0xd308('0x21')](handleEntityNotFound(_0x2841b4,null))[_0xd308('0x21')](respondWithResult(_0x2841b4,null))[_0xd308('0x3f')](handleError(_0x2841b4,null));};exports['create']=function(_0x37f9fc,_0x1e4001){return db[_0xd308('0x27')]['create'](_0x37f9fc[_0xd308('0x42')],{})[_0xd308('0x21')](respondWithResult(_0x1e4001,0xc9))[_0xd308('0x3f')](handleError(_0x1e4001,null));};exports[_0xd308('0x20')]=function(_0x45ef33,_0x317801){if(_0x45ef33[_0xd308('0x42')]['id']){delete _0x45ef33[_0xd308('0x42')]['id'];}return db[_0xd308('0x27')][_0xd308('0x43')]({'where':{'id':_0x45ef33[_0xd308('0x41')]['id']}})[_0xd308('0x21')](handleEntityNotFound(_0x317801,null))[_0xd308('0x21')](saveUpdates(_0x45ef33[_0xd308('0x42')],null))['then'](respondWithResult(_0x317801,null))[_0xd308('0x3f')](handleError(_0x317801,null));};exports[_0xd308('0x22')]=function(_0x5859a0,_0x2fc0ac){return db['IntegrationReport'][_0xd308('0x43')]({'where':{'id':_0x5859a0[_0xd308('0x41')]['id']}})[_0xd308('0x21')](handleEntityNotFound(_0x2fc0ac,null))[_0xd308('0x21')](removeEntity(_0x2fc0ac,null))[_0xd308('0x3f')](handleError(_0x2fc0ac,null));};exports[_0xd308('0x44')]=function(_0x4e8059,_0x662f9a){return db['IntegrationReport']['describe']()[_0xd308('0x21')](respondWithResult(_0x662f9a,null))[_0xd308('0x3f')](handleError(_0x662f9a,null));}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.model.js b/server/api/integrationReport/integrationReport.model.js index 4ed880c..8dfe54c 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 _0x2258=['rimraf','../../config/environment','define','IntegrationReport','report_integration','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x5885e4,_0x23d7b7){var _0x154bab=function(_0x41ffcf){while(--_0x41ffcf){_0x5885e4['push'](_0x5885e4['shift']());}};_0x154bab(++_0x23d7b7);}(_0x2258,0x101));var _0x8225=function(_0x2d813d,_0xe03c71){_0x2d813d=_0x2d813d-0x0;var _0x4c5e47=_0x2258[_0x2d813d];return _0x4c5e47;};'use strict';var _=require('lodash');var util=require(_0x8225('0x0'));var logger=require(_0x8225('0x1'))(_0x8225('0x2'));var moment=require(_0x8225('0x3'));var BPromise=require(_0x8225('0x4'));var rp=require(_0x8225('0x5'));var fs=require('fs');var path=require(_0x8225('0x6'));var rimraf=require(_0x8225('0x7'));var config=require(_0x8225('0x8'));var attributes=require('./integrationReport.attributes');module['exports']=function(_0x58b242,_0x3c2a69){return _0x58b242[_0x8225('0x9')](_0x8225('0xa'),attributes,{'tableName':_0x8225('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9661=['../../config/logger','api','bluebird','request-promise','path','../../config/environment','./integrationReport.attributes','define','IntegrationReport','report_integration','lodash'];(function(_0x565ed7,_0x398228){var _0x183ad7=function(_0x5a43d7){while(--_0x5a43d7){_0x565ed7['push'](_0x565ed7['shift']());}};_0x183ad7(++_0x398228);}(_0x9661,0x149));var _0x1966=function(_0x28485f,_0x43551f){_0x28485f=_0x28485f-0x0;var _0x4dca3c=_0x9661[_0x28485f];return _0x4dca3c;};'use strict';var _=require(_0x1966('0x0'));var util=require('util');var logger=require(_0x1966('0x1'))(_0x1966('0x2'));var moment=require('moment');var BPromise=require(_0x1966('0x3'));var rp=require(_0x1966('0x4'));var fs=require('fs');var path=require(_0x1966('0x5'));var rimraf=require('rimraf');var config=require(_0x1966('0x6'));var attributes=require(_0x1966('0x7'));module['exports']=function(_0x1bf6a9,_0x4aece8){return _0x1bf6a9[_0x1966('0x8')](_0x1966('0x9'),attributes,{'tableName':_0x1966('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 023e43b..517f349 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 _0x14a0=['../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','then','debug','request\x20sent','stringify','error','code','IntegrationReport,\x20%s,\x20%s','message','info','result','catch','util','moment','bluebird','randomstring','ioredis'];(function(_0x1570e4,_0x244686){var _0x428d09=function(_0x97634a){while(--_0x97634a){_0x1570e4['push'](_0x1570e4['shift']());}};_0x428d09(++_0x244686);}(_0x14a0,0x8e));var _0x014a=function(_0x5f3099,_0x1ccd35){_0x5f3099=_0x5f3099-0x0;var _0x1a626f=_0x14a0[_0x5f3099];return _0x1a626f;};'use strict';var _=require('lodash');var util=require(_0x014a('0x0'));var moment=require(_0x014a('0x1'));var BPromise=require(_0x014a('0x2'));var rs=require(_0x014a('0x3'));var fs=require('fs');var Redis=require(_0x014a('0x4'));var db=require(_0x014a('0x5'))['db'];var utils=require(_0x014a('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x014a('0x7'));var jayson=require(_0x014a('0x8'));var client=jayson[_0x014a('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5a61ac,_0x11b8ce,_0x6d05f2){return new BPromise(function(_0x22f17c,_0x4d943b){return client['request'](_0x5a61ac,_0x6d05f2)[_0x014a('0xa')](function(_0x4f5506){logger['info']('IntegrationReport,\x20%s,\x20%s',_0x11b8ce,'request\x20sent');logger[_0x014a('0xb')]('IntegrationReport,\x20%s,\x20%s,\x20%s',_0x11b8ce,_0x014a('0xc'),JSON[_0x014a('0xd')](_0x4f5506));if(_0x4f5506['error']){if(_0x4f5506[_0x014a('0xe')][_0x014a('0xf')]===0x1f4){logger[_0x014a('0xe')](_0x014a('0x10'),_0x11b8ce,_0x4f5506[_0x014a('0xe')][_0x014a('0x11')]);return _0x4d943b(_0x4f5506[_0x014a('0xe')][_0x014a('0x11')]);}logger[_0x014a('0xe')](_0x014a('0x10'),_0x11b8ce,_0x4f5506[_0x014a('0xe')][_0x014a('0x11')]);return _0x22f17c(_0x4f5506['error'][_0x014a('0x11')]);}else{logger[_0x014a('0x12')]('IntegrationReport,\x20%s,\x20%s',_0x11b8ce,_0x014a('0xc'));_0x22f17c(_0x4f5506[_0x014a('0x13')]['message']);}})[_0x014a('0x14')](function(_0x17e4be){logger[_0x014a('0xe')](_0x014a('0x10'),_0x11b8ce,_0x17e4be);_0x4d943b(_0x17e4be);});});} \ No newline at end of file +var _0x14a0=['../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','then','debug','request\x20sent','stringify','error','code','IntegrationReport,\x20%s,\x20%s','message','info','result','catch','util','moment','bluebird','randomstring','ioredis'];(function(_0x4d089e,_0x33fb0e){var _0x14115d=function(_0x1c7638){while(--_0x1c7638){_0x4d089e['push'](_0x4d089e['shift']());}};_0x14115d(++_0x33fb0e);}(_0x14a0,0x8e));var _0x014a=function(_0x8fdfa0,_0x3d34ca){_0x8fdfa0=_0x8fdfa0-0x0;var _0x5b841c=_0x14a0[_0x8fdfa0];return _0x5b841c;};'use strict';var _=require('lodash');var util=require(_0x014a('0x0'));var moment=require(_0x014a('0x1'));var BPromise=require(_0x014a('0x2'));var rs=require(_0x014a('0x3'));var fs=require('fs');var Redis=require(_0x014a('0x4'));var db=require(_0x014a('0x5'))['db'];var utils=require(_0x014a('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x014a('0x7'));var jayson=require(_0x014a('0x8'));var client=jayson[_0x014a('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5a61ac,_0x11b8ce,_0x6d05f2){return new BPromise(function(_0x22f17c,_0x4d943b){return client['request'](_0x5a61ac,_0x6d05f2)[_0x014a('0xa')](function(_0x4f5506){logger['info']('IntegrationReport,\x20%s,\x20%s',_0x11b8ce,'request\x20sent');logger[_0x014a('0xb')]('IntegrationReport,\x20%s,\x20%s,\x20%s',_0x11b8ce,_0x014a('0xc'),JSON[_0x014a('0xd')](_0x4f5506));if(_0x4f5506['error']){if(_0x4f5506[_0x014a('0xe')][_0x014a('0xf')]===0x1f4){logger[_0x014a('0xe')](_0x014a('0x10'),_0x11b8ce,_0x4f5506[_0x014a('0xe')][_0x014a('0x11')]);return _0x4d943b(_0x4f5506[_0x014a('0xe')][_0x014a('0x11')]);}logger[_0x014a('0xe')](_0x014a('0x10'),_0x11b8ce,_0x4f5506[_0x014a('0xe')][_0x014a('0x11')]);return _0x22f17c(_0x4f5506['error'][_0x014a('0x11')]);}else{logger[_0x014a('0x12')]('IntegrationReport,\x20%s,\x20%s',_0x11b8ce,_0x014a('0xc'));_0x22f17c(_0x4f5506[_0x014a('0x13')]['message']);}})[_0x014a('0x14')](function(_0x17e4be){logger[_0x014a('0xe')](_0x014a('0x10'),_0x11b8ce,_0x17e4be);_0x4d943b(_0x17e4be);});});} \ No newline at end of file diff --git a/server/api/interval/index.js b/server/api/interval/index.js index 6dc9c1e..cf931d0 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 _0x9957=['../../config/environment','get','isAuthenticated','index','/:id','/:id/sub_intervals','getIntervals','post','create','/:id/sub_intervals/create_many','addIntervals','put','update','delete','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x46d0c9,_0x526bfa){var _0x174506=function(_0x654bc6){while(--_0x654bc6){_0x46d0c9['push'](_0x46d0c9['shift']());}};_0x174506(++_0x526bfa);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var auth=require(_0x7995('0x5'));var interaction=require(_0x7995('0x6'));var config=require(_0x7995('0x7'));var controller=require('./interval.controller');router[_0x7995('0x8')]('/',auth[_0x7995('0x9')](),controller[_0x7995('0xa')]);router[_0x7995('0x8')](_0x7995('0xb'),auth[_0x7995('0x9')](),controller['show']);router[_0x7995('0x8')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0xe')]('/',auth[_0x7995('0x9')](),controller[_0x7995('0xf')]);router[_0x7995('0xe')](_0x7995('0xc'),auth[_0x7995('0x9')](),controller['addInterval']);router[_0x7995('0xe')](_0x7995('0x10'),auth['isAuthenticated'](),controller[_0x7995('0x11')]);router[_0x7995('0x12')](_0x7995('0xb'),auth[_0x7995('0x9')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0x7995('0x15')]=router; \ No newline at end of file +var _0x3e74=['isAuthenticated','index','show','/:id/sub_intervals','post','addInterval','/:id/sub_intervals/create_many','put','/:id','update','destroy','exports','multer','path','connect-timeout','express','../../components/interaction/service','./interval.controller','get'];(function(_0x420c62,_0x341a9d){var _0x1b5819=function(_0x1a1ea7){while(--_0x1a1ea7){_0x420c62['push'](_0x420c62['shift']());}};_0x1b5819(++_0x341a9d);}(_0x3e74,0x175));var _0x43e7=function(_0xdd6156,_0x2990c0){_0xdd6156=_0xdd6156-0x0;var _0x541dc2=_0x3e74[_0xdd6156];return _0x541dc2;};'use strict';var multer=require(_0x43e7('0x0'));var util=require('util');var path=require(_0x43e7('0x1'));var timeout=require(_0x43e7('0x2'));var express=require(_0x43e7('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x43e7('0x4'));var config=require('../../config/environment');var controller=require(_0x43e7('0x5'));router[_0x43e7('0x6')]('/',auth[_0x43e7('0x7')](),controller[_0x43e7('0x8')]);router[_0x43e7('0x6')]('/:id',auth[_0x43e7('0x7')](),controller[_0x43e7('0x9')]);router[_0x43e7('0x6')](_0x43e7('0xa'),auth[_0x43e7('0x7')](),controller['getIntervals']);router[_0x43e7('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0x43e7('0xb')](_0x43e7('0xa'),auth['isAuthenticated'](),controller[_0x43e7('0xc')]);router['post'](_0x43e7('0xd'),auth[_0x43e7('0x7')](),controller['addIntervals']);router[_0x43e7('0xe')](_0x43e7('0xf'),auth[_0x43e7('0x7')](),controller[_0x43e7('0x10')]);router['delete']('/:id',auth[_0x43e7('0x7')](),controller[_0x43e7('0x11')]);module[_0x43e7('0x12')]=router; \ No newline at end of file diff --git a/server/api/interval/interval.attributes.js b/server/api/interval/interval.attributes.js index 255f1d7..02110e9 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 _0x2e9a=['sequelize','exports','STRING'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x2e9a,0x1b3));var _0xa2e9=function(_0x41a1a8,_0x20a819){_0x41a1a8=_0x41a1a8-0x0;var _0x473717=_0x2e9a[_0x41a1a8];return _0x473717;};'use strict';var Sequelize=require(_0xa2e9('0x0'));module[_0xa2e9('0x1')]={'name':{'type':Sequelize[_0xa2e9('0x2')]},'description':{'type':Sequelize[_0xa2e9('0x2')]},'interval':{'type':Sequelize['STRING'],'allowNull':!![]}}; \ No newline at end of file +var _0x559a=['exports','STRING','sequelize'];(function(_0x26b8b5,_0xf5c2c1){var _0x2150a9=function(_0x1ca1be){while(--_0x1ca1be){_0x26b8b5['push'](_0x26b8b5['shift']());}};_0x2150a9(++_0xf5c2c1);}(_0x559a,0xe3));var _0xa559=function(_0x38c9e1,_0x56e010){_0x38c9e1=_0x38c9e1-0x0;var _0x308b89=_0x559a[_0x38c9e1];return _0x308b89;};'use strict';var Sequelize=require(_0xa559('0x0'));module[_0xa559('0x1')]={'name':{'type':Sequelize[_0xa559('0x2')]},'description':{'type':Sequelize[_0xa559('0x2')]},'interval':{'type':Sequelize['STRING'],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/interval/interval.controller.js b/server/api/interval/interval.controller.js index 2f1f469..f262fc3 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 _0x39cb=['where','filter','key','field','merge','options','includeAll','include','findAll','rows','show','params','fields','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addInterval','IntervalId','getIntervals','findOne','pick','map','addIntervals','sequelize','transaction','bulkCreate','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/extensions/rewrite','sendStatus','status','count','offset','limit','set','json','apply','save','update','then','destroy','get','Intervals','UserProfileResource','end','error','stack','name','send','index','Interval','rawAttributes','model','keys','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort'];(function(_0x11c5c2,_0xda9597){var _0x205df0=function(_0x254a0b){while(--_0x254a0b){_0x11c5c2['push'](_0x11c5c2['shift']());}};_0x205df0(++_0xda9597);}(_0x39cb,0x7f));var _0xb39c=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x39cb[_0xfae23b];return _0x200640;};'use strict';var pdf=require(_0xb39c('0x0'));var emlformat=require(_0xb39c('0x1'));var rimraf=require(_0xb39c('0x2'));var zipdir=require(_0xb39c('0x3'));var jsonpatch=require(_0xb39c('0x4'));var rp=require(_0xb39c('0x5'));var moment=require(_0xb39c('0x6'));var BPromise=require(_0xb39c('0x7'));var Mustache=require(_0xb39c('0x8'));var util=require(_0xb39c('0x9'));var path=require(_0xb39c('0xa'));var sox=require(_0xb39c('0xb'));var csv=require(_0xb39c('0xc'));var ejs=require(_0xb39c('0xd'));var fs=require('fs');var _=require('lodash');var squel=require(_0xb39c('0xe'));var crypto=require(_0xb39c('0xf'));var jsforce=require(_0xb39c('0x10'));var deskjs=require(_0xb39c('0x11'));var toCsv=require('to-csv');var querystring=require(_0xb39c('0x12'));var Papa=require('papaparse');var Redis=require(_0xb39c('0x13'));var authService=require('../../components/auth/service');var qs=require(_0xb39c('0x14'));var as=require(_0xb39c('0x15'));var hardwareService=require(_0xb39c('0x16'));var logger=require(_0xb39c('0x17'))(_0xb39c('0x18'));var utils=require(_0xb39c('0x19'));var config=require(_0xb39c('0x1a'));var db=require(_0xb39c('0x1b'))['db'];var extensions=require(_0xb39c('0x1c'));function respondWithStatusCode(_0x335bd8,_0x183fca){_0x183fca=_0x183fca||0xcc;return function(_0x50257e){if(_0x50257e){return _0x335bd8[_0xb39c('0x1d')](_0x183fca);}return _0x335bd8[_0xb39c('0x1e')](_0x183fca)['end']();};}function respondWithResult(_0x4d27cf,_0x533d0e){_0x533d0e=_0x533d0e||0xc8;return function(_0x4fba98){if(_0x4fba98){return _0x4d27cf[_0xb39c('0x1e')](_0x533d0e)['json'](_0x4fba98);}};}function respondWithFilteredResult(_0x4b0d3b,_0x354fe3){return function(_0x16a6a8){if(_0x16a6a8){var _0x3cca5f=_0x16a6a8[_0xb39c('0x1f')],_0x2c66df=_0x354fe3[_0xb39c('0x20')],_0x29cb18=_0x354fe3[_0xb39c('0x20')]+_0x354fe3[_0xb39c('0x21')],_0x56d156;if(_0x29cb18>=_0x3cca5f){_0x29cb18=_0x3cca5f;_0x56d156=0xc8;}else{_0x56d156=0xce;}_0x4b0d3b[_0xb39c('0x1e')](_0x56d156);return _0x4b0d3b[_0xb39c('0x22')]('Content-Range',_0x2c66df+'-'+_0x29cb18+'/'+_0x3cca5f)[_0xb39c('0x23')](_0x16a6a8);}return null;};}function patchUpdates(_0x5d9b68){return function(_0x312e66){try{jsonpatch[_0xb39c('0x24')](_0x312e66,_0x5d9b68,!![]);}catch(_0x4e85e3){return BPromise['reject'](_0x4e85e3);}return _0x312e66[_0xb39c('0x25')]();};}function saveUpdates(_0x3eca6a,_0x284c62){return function(_0x48bedb){if(_0x48bedb){return _0x48bedb[_0xb39c('0x26')](_0x3eca6a)[_0xb39c('0x27')](function(_0x1e0e44){return _0x1e0e44;});}return null;};}function removeEntity(_0xe79367,_0x464f08){return function(_0x5ec0fb){if(_0x5ec0fb){return _0x5ec0fb[_0xb39c('0x28')]()['then'](function(){var _0x49be06=_0x5ec0fb[_0xb39c('0x29')]({'plain':!![]});var _0x17e88a=_0xb39c('0x2a');return db[_0xb39c('0x2b')][_0xb39c('0x28')]({'where':{'type':_0x17e88a,'resourceId':_0x49be06['id']}})[_0xb39c('0x27')](function(){return _0x5ec0fb;});})[_0xb39c('0x27')](function(){_0xe79367[_0xb39c('0x1e')](0xcc)[_0xb39c('0x2c')]();});}};}function handleEntityNotFound(_0x34342c,_0x4f048d){return function(_0xbd1f62){if(!_0xbd1f62){_0x34342c[_0xb39c('0x1d')](0x194);}return _0xbd1f62;};}function handleError(_0xbb21e2,_0xe1eeb2){_0xe1eeb2=_0xe1eeb2||0x1f4;return function(_0x11b63d){logger[_0xb39c('0x2d')](_0x11b63d[_0xb39c('0x2e')]);if(_0x11b63d[_0xb39c('0x2f')]){delete _0x11b63d[_0xb39c('0x2f')];}_0xbb21e2[_0xb39c('0x1e')](_0xe1eeb2)[_0xb39c('0x30')](_0x11b63d);};}exports[_0xb39c('0x31')]=function(_0x483038,_0x313f19){var _0x4e55d5={},_0xf11a57={},_0x37fc6a={'count':0x0,'rows':[]};var _0x26c7a6=db[_0xb39c('0x32')][_0xb39c('0x33')];_0xf11a57[_0xb39c('0x34')]=_[_0xb39c('0x35')](_0x26c7a6);_0xf11a57[_0xb39c('0x36')]=_[_0xb39c('0x35')](_0x483038[_0xb39c('0x36')]);_0xf11a57[_0xb39c('0x37')]=_[_0xb39c('0x38')](_0xf11a57[_0xb39c('0x34')],_0xf11a57[_0xb39c('0x36')]);_0x4e55d5['attributes']=_[_0xb39c('0x38')](_0xf11a57[_0xb39c('0x34')],qs['fields'](_0x483038[_0xb39c('0x36')]['fields']));_0x4e55d5[_0xb39c('0x39')]=_0x4e55d5['attributes'][_0xb39c('0x3a')]?_0x4e55d5['attributes']:_0xf11a57['model'];if(!_0x483038[_0xb39c('0x36')][_0xb39c('0x3b')](_0xb39c('0x3c'))){_0x4e55d5['limit']=qs[_0xb39c('0x21')](_0x483038['query'][_0xb39c('0x21')]);_0x4e55d5[_0xb39c('0x20')]=qs[_0xb39c('0x20')](_0x483038[_0xb39c('0x36')][_0xb39c('0x20')]);}_0x4e55d5[_0xb39c('0x3d')]=qs[_0xb39c('0x3e')](_0x483038[_0xb39c('0x36')][_0xb39c('0x3e')]);_0x4e55d5[_0xb39c('0x3f')]=qs[_0xb39c('0x37')](_['pick'](_0x483038[_0xb39c('0x36')],_0xf11a57[_0xb39c('0x37')]));if(_0x483038[_0xb39c('0x36')][_0xb39c('0x40')]){_0x4e55d5['where']=_['merge'](_0x4e55d5[_0xb39c('0x3f')],{'$or':_['map'](_0x26c7a6,function(_0x3401f8){if(_0x3401f8['type'][_0xb39c('0x41')]!=='VIRTUAL'){var _0x3c5b1e={};_0x3c5b1e[_0x3401f8[_0xb39c('0x42')]]={'$like':'%'+_0x483038[_0xb39c('0x36')][_0xb39c('0x40')]+'%'};return _0x3c5b1e;}})});}_0x4e55d5=_[_0xb39c('0x43')]({},_0x4e55d5,_0x483038[_0xb39c('0x44')]);var _0x3cd8f7={'where':_0x4e55d5[_0xb39c('0x3f')]};return db[_0xb39c('0x32')][_0xb39c('0x1f')](_0x3cd8f7)[_0xb39c('0x27')](function(_0x478780){_0x37fc6a[_0xb39c('0x1f')]=_0x478780;if(_0x483038[_0xb39c('0x36')][_0xb39c('0x45')]){_0x4e55d5[_0xb39c('0x46')]=[{'all':!![]}];}return db[_0xb39c('0x32')][_0xb39c('0x47')](_0x4e55d5);})[_0xb39c('0x27')](function(_0x59a7d1){_0x37fc6a[_0xb39c('0x48')]=_0x59a7d1;return _0x37fc6a;})['then'](respondWithFilteredResult(_0x313f19,_0x4e55d5))['catch'](handleError(_0x313f19,null));};exports[_0xb39c('0x49')]=function(_0x9337bb,_0x1b5a66){var _0x44f1d3={'raw':!![],'where':{'id':_0x9337bb[_0xb39c('0x4a')]['id']}},_0x26e177={};_0x26e177['model']=_['keys'](db[_0xb39c('0x32')][_0xb39c('0x33')]);_0x26e177['query']=_[_0xb39c('0x35')](_0x9337bb[_0xb39c('0x36')]);_0x26e177[_0xb39c('0x37')]=_[_0xb39c('0x38')](_0x26e177[_0xb39c('0x34')],_0x26e177[_0xb39c('0x36')]);_0x44f1d3[_0xb39c('0x39')]=_['intersection'](_0x26e177[_0xb39c('0x34')],qs[_0xb39c('0x4b')](_0x9337bb['query'][_0xb39c('0x4b')]));_0x44f1d3[_0xb39c('0x39')]=_0x44f1d3[_0xb39c('0x39')][_0xb39c('0x3a')]?_0x44f1d3[_0xb39c('0x39')]:_0x26e177[_0xb39c('0x34')];if(_0x9337bb['query'][_0xb39c('0x45')]){_0x44f1d3[_0xb39c('0x46')]=[{'all':!![]}];}_0x44f1d3=_[_0xb39c('0x43')]({},_0x44f1d3,_0x9337bb[_0xb39c('0x44')]);return db['Interval'][_0xb39c('0x4c')](_0x44f1d3)[_0xb39c('0x27')](handleEntityNotFound(_0x1b5a66,null))[_0xb39c('0x27')](respondWithResult(_0x1b5a66,null))[_0xb39c('0x4d')](handleError(_0x1b5a66,null));};exports[_0xb39c('0x4e')]=function(_0x410490,_0xed0bc4){return db['Interval']['create'](_0x410490[_0xb39c('0x4f')],{})[_0xb39c('0x27')](function(_0x3f76a4){var _0x42eda4=_0x410490[_0xb39c('0x50')][_0xb39c('0x29')]({'plain':!![]});if(!_0x42eda4)throw new Error(_0xb39c('0x51'));if(_0x42eda4['role']==='user'){var _0xef4f4f=_0x3f76a4[_0xb39c('0x29')]({'plain':!![]});var _0x516376='Intervals';return db[_0xb39c('0x52')][_0xb39c('0x4c')]({'where':{'name':_0x516376,'userProfileId':_0x42eda4['userProfileId']},'raw':!![]})['then'](function(_0x1c058c){if(_0x1c058c&&_0x1c058c[_0xb39c('0x53')]===0x0){return db['UserProfileResource']['create']({'name':_0xef4f4f[_0xb39c('0x2f')],'resourceId':_0xef4f4f['id'],'type':_0x1c058c[_0xb39c('0x2f')],'sectionId':_0x1c058c['id']},{})[_0xb39c('0x27')](function(){return _0x3f76a4;});}else{return _0x3f76a4;}})[_0xb39c('0x4d')](function(_0x13b03f){logger['error'](_0xb39c('0x54'),_0x13b03f);throw _0x13b03f;});}return _0x3f76a4;})[_0xb39c('0x27')](respondWithResult(_0xed0bc4,0xc9))[_0xb39c('0x4d')](handleError(_0xed0bc4,null));};exports[_0xb39c('0x26')]=function(_0x12f7c7,_0x1f311f){if(_0x12f7c7[_0xb39c('0x4f')]['id']){delete _0x12f7c7[_0xb39c('0x4f')]['id'];}return db[_0xb39c('0x32')][_0xb39c('0x4c')]({'where':{'id':_0x12f7c7[_0xb39c('0x4a')]['id']}})[_0xb39c('0x27')](handleEntityNotFound(_0x1f311f,null))[_0xb39c('0x27')](saveUpdates(_0x12f7c7[_0xb39c('0x4f')],null))[_0xb39c('0x27')](respondWithResult(_0x1f311f,null))[_0xb39c('0x4d')](handleError(_0x1f311f,null));};exports[_0xb39c('0x28')]=function(_0x458733,_0x3e2de5){return db[_0xb39c('0x32')][_0xb39c('0x4c')]({'where':{'id':_0x458733[_0xb39c('0x4a')]['id']}})[_0xb39c('0x27')](handleEntityNotFound(_0x3e2de5,null))[_0xb39c('0x27')](removeEntity(_0x3e2de5,null))[_0xb39c('0x4d')](handleError(_0x3e2de5,null));};exports[_0xb39c('0x55')]=function(_0x4a7537,_0x186634,_0x3cb994){if(_0x4a7537['body']['id']){delete _0x4a7537[_0xb39c('0x4f')]['id'];}return db[_0xb39c('0x32')][_0xb39c('0x4c')]({'where':{'id':_0x4a7537[_0xb39c('0x4a')]['id']}})[_0xb39c('0x27')](handleEntityNotFound(_0x186634,null))[_0xb39c('0x27')](function(_0x2aa45d){if(_0x2aa45d){_0x4a7537['body'][_0xb39c('0x56')]=_0x2aa45d['id'];return db[_0xb39c('0x32')][_0xb39c('0x4e')](_0x4a7537[_0xb39c('0x4f')]);}})[_0xb39c('0x27')](respondWithResult(_0x186634,null))['catch'](handleError(_0x186634,null));};exports[_0xb39c('0x57')]=function(_0x339ea1,_0x5d4b23,_0x122427){var _0x63351={};var _0x66bcb9={};var _0x6323e2;var _0xd30abc;return db[_0xb39c('0x32')][_0xb39c('0x58')]({'where':{'id':_0x339ea1[_0xb39c('0x4a')]['id']}})[_0xb39c('0x27')](handleEntityNotFound(_0x5d4b23,null))[_0xb39c('0x27')](function(_0x2d3cb9){if(_0x2d3cb9){_0x6323e2=_0x2d3cb9;_0x66bcb9['model']=_[_0xb39c('0x35')](db[_0xb39c('0x32')][_0xb39c('0x33')]);_0x66bcb9[_0xb39c('0x36')]=_['keys'](_0x339ea1[_0xb39c('0x36')]);_0x66bcb9[_0xb39c('0x37')]=_[_0xb39c('0x38')](_0x66bcb9[_0xb39c('0x34')],_0x66bcb9[_0xb39c('0x36')]);_0x63351[_0xb39c('0x39')]=_['intersection'](_0x66bcb9[_0xb39c('0x34')],qs[_0xb39c('0x4b')](_0x339ea1[_0xb39c('0x36')][_0xb39c('0x4b')]));_0x63351['attributes']=_0x63351[_0xb39c('0x39')][_0xb39c('0x3a')]?_0x63351[_0xb39c('0x39')]:_0x66bcb9[_0xb39c('0x34')];_0x63351[_0xb39c('0x3d')]=qs['sort'](_0x339ea1['query']['sort']);_0x63351[_0xb39c('0x3f')]=qs[_0xb39c('0x37')](_[_0xb39c('0x59')](_0x339ea1['query'],_0x66bcb9['filters']));if(_0x339ea1[_0xb39c('0x36')]['filter']){_0x63351[_0xb39c('0x3f')]=_['merge'](_0x63351[_0xb39c('0x3f')],{'$or':_[_0xb39c('0x5a')](_0x63351['attributes'],function(_0x25fdae){var _0x519caf={};_0x519caf[_0x25fdae]={'$like':'%'+_0x339ea1['query'][_0xb39c('0x40')]+'%'};return _0x519caf;})});}_0x63351=_['merge']({},_0x63351,_0x339ea1['options']);return _0x6323e2[_0xb39c('0x57')](_0x63351);}})[_0xb39c('0x27')](function(_0x6b262f){if(_0x6b262f){_0xd30abc=_0x6b262f[_0xb39c('0x3a')];if(!_0x339ea1[_0xb39c('0x36')][_0xb39c('0x3b')](_0xb39c('0x3c'))){_0x63351['limit']=qs[_0xb39c('0x21')](_0x339ea1[_0xb39c('0x36')][_0xb39c('0x21')]);_0x63351[_0xb39c('0x20')]=qs[_0xb39c('0x20')](_0x339ea1[_0xb39c('0x36')][_0xb39c('0x20')]);}return _0x6323e2[_0xb39c('0x57')](_0x63351);}})['then'](function(_0x4dfe9d){if(_0x4dfe9d){return _0x4dfe9d?{'count':_0xd30abc,'rows':_0x4dfe9d}:null;}})['then'](respondWithResult(_0x5d4b23,null))['catch'](handleError(_0x5d4b23,null));};exports[_0xb39c('0x5b')]=function(_0xbc285a,_0x4fc31b,_0x28a9fe){return db[_0xb39c('0x32')][_0xb39c('0x58')]({'where':{'id':_0xbc285a[_0xb39c('0x4a')]['id']}})[_0xb39c('0x27')](handleEntityNotFound(_0x4fc31b,null))[_0xb39c('0x27')](function(_0x283f4c){if(_0x283f4c){return db[_0xb39c('0x5c')][_0xb39c('0x5d')](function(_0x40d707){return db[_0xb39c('0x32')][_0xb39c('0x28')]({'where':{'IntervalId':_0xbc285a[_0xb39c('0x4a')]['id']},'transaction':_0x40d707})[_0xb39c('0x27')](function(_0x3aa081){var _0x4869dd=_['map'](_0xbc285a[_0xb39c('0x4f')],function(_0x2d6ada){delete _0x2d6ada['id'];_0x2d6ada[_0xb39c('0x56')]=_0xbc285a['params']['id'];return _0x2d6ada;});return db[_0xb39c('0x32')][_0xb39c('0x5e')](_0x4869dd,{'transaction':_0x40d707});});})['then'](function(){return db['Interval'][_0xb39c('0x47')]({'where':{'IntervalId':_0xbc285a[_0xb39c('0x4a')]['id']}});});}})['then'](respondWithResult(_0x4fc31b,null))[_0xb39c('0x4d')](handleError(_0x4fc31b,null));}; \ No newline at end of file +var _0x1b3a=['findOne','transaction','bulkCreate','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../mysqldb','../../components/extensions/rewrite','sendStatus','end','json','count','limit','status','Content-Range','apply','reject','update','then','destroy','get','Intervals','UserProfileResource','error','stack','name','index','rawAttributes','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','map','type','VIRTUAL','field','merge','Interval','includeAll','include','findAll','catch','show','params','keys','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','addInterval','IntervalId','options','getIntervals','nolimit','offset'];(function(_0x3c4e4c,_0x36ff70){var _0x144a87=function(_0x5efb4b){while(--_0x5efb4b){_0x3c4e4c['push'](_0x3c4e4c['shift']());}};_0x144a87(++_0x36ff70);}(_0x1b3a,0xaf));var _0xa1b3=function(_0xb1e9ea,_0x23724b){_0xb1e9ea=_0xb1e9ea-0x0;var _0x59b2e9=_0x1b3a[_0xb1e9ea];return _0x59b2e9;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xa1b3('0x0'));var rimraf=require(_0xa1b3('0x1'));var zipdir=require(_0xa1b3('0x2'));var jsonpatch=require(_0xa1b3('0x3'));var rp=require(_0xa1b3('0x4'));var moment=require(_0xa1b3('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xa1b3('0x6'));var util=require(_0xa1b3('0x7'));var path=require(_0xa1b3('0x8'));var sox=require(_0xa1b3('0x9'));var csv=require(_0xa1b3('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xa1b3('0xb'));var squel=require('squel');var crypto=require(_0xa1b3('0xc'));var jsforce=require(_0xa1b3('0xd'));var deskjs=require(_0xa1b3('0xe'));var toCsv=require(_0xa1b3('0xa'));var querystring=require('querystring');var Papa=require(_0xa1b3('0xf'));var Redis=require(_0xa1b3('0x10'));var authService=require(_0xa1b3('0x11'));var qs=require(_0xa1b3('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa1b3('0x13'));var logger=require(_0xa1b3('0x14'))(_0xa1b3('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0xa1b3('0x16'))['db'];var extensions=require(_0xa1b3('0x17'));function respondWithStatusCode(_0x45f299,_0x476640){_0x476640=_0x476640||0xcc;return function(_0x5cdc7d){if(_0x5cdc7d){return _0x45f299[_0xa1b3('0x18')](_0x476640);}return _0x45f299['status'](_0x476640)[_0xa1b3('0x19')]();};}function respondWithResult(_0x299380,_0x450298){_0x450298=_0x450298||0xc8;return function(_0x2a39e2){if(_0x2a39e2){return _0x299380['status'](_0x450298)[_0xa1b3('0x1a')](_0x2a39e2);}};}function respondWithFilteredResult(_0x3848ee,_0x58ba97){return function(_0x2a3844){if(_0x2a3844){var _0x8ba124=_0x2a3844[_0xa1b3('0x1b')],_0x9c5449=_0x58ba97['offset'],_0x37af43=_0x58ba97['offset']+_0x58ba97[_0xa1b3('0x1c')],_0x10cb82;if(_0x37af43>=_0x8ba124){_0x37af43=_0x8ba124;_0x10cb82=0xc8;}else{_0x10cb82=0xce;}_0x3848ee[_0xa1b3('0x1d')](_0x10cb82);return _0x3848ee['set'](_0xa1b3('0x1e'),_0x9c5449+'-'+_0x37af43+'/'+_0x8ba124)[_0xa1b3('0x1a')](_0x2a3844);}return null;};}function patchUpdates(_0x3b8332){return function(_0xdc6b47){try{jsonpatch[_0xa1b3('0x1f')](_0xdc6b47,_0x3b8332,!![]);}catch(_0x19ef14){return BPromise[_0xa1b3('0x20')](_0x19ef14);}return _0xdc6b47['save']();};}function saveUpdates(_0x111d82,_0xc69d69){return function(_0x580d0c){if(_0x580d0c){return _0x580d0c[_0xa1b3('0x21')](_0x111d82)[_0xa1b3('0x22')](function(_0x5189c6){return _0x5189c6;});}return null;};}function removeEntity(_0x18465b,_0xd13c38){return function(_0x2a1c94){if(_0x2a1c94){return _0x2a1c94[_0xa1b3('0x23')]()['then'](function(){var _0x2043a6=_0x2a1c94[_0xa1b3('0x24')]({'plain':!![]});var _0x4660d2=_0xa1b3('0x25');return db[_0xa1b3('0x26')][_0xa1b3('0x23')]({'where':{'type':_0x4660d2,'resourceId':_0x2043a6['id']}})[_0xa1b3('0x22')](function(){return _0x2a1c94;});})[_0xa1b3('0x22')](function(){_0x18465b['status'](0xcc)[_0xa1b3('0x19')]();});}};}function handleEntityNotFound(_0x3e1304,_0x40118a){return function(_0x3aad1a){if(!_0x3aad1a){_0x3e1304['sendStatus'](0x194);}return _0x3aad1a;};}function handleError(_0x3a68ca,_0x1f8cc2){_0x1f8cc2=_0x1f8cc2||0x1f4;return function(_0x4376f3){logger[_0xa1b3('0x27')](_0x4376f3[_0xa1b3('0x28')]);if(_0x4376f3[_0xa1b3('0x29')]){delete _0x4376f3['name'];}_0x3a68ca[_0xa1b3('0x1d')](_0x1f8cc2)['send'](_0x4376f3);};}exports[_0xa1b3('0x2a')]=function(_0x145fb6,_0x3a49d3){var _0xc6d1e2={},_0x2dc935={},_0x5d025b={'count':0x0,'rows':[]};var _0x2b4807=db['Interval'][_0xa1b3('0x2b')];_0x2dc935[_0xa1b3('0x2c')]=_['keys'](_0x2b4807);_0x2dc935[_0xa1b3('0x2d')]=_['keys'](_0x145fb6[_0xa1b3('0x2d')]);_0x2dc935[_0xa1b3('0x2e')]=_[_0xa1b3('0x2f')](_0x2dc935['model'],_0x2dc935[_0xa1b3('0x2d')]);_0xc6d1e2[_0xa1b3('0x30')]=_[_0xa1b3('0x2f')](_0x2dc935['model'],qs[_0xa1b3('0x31')](_0x145fb6[_0xa1b3('0x2d')][_0xa1b3('0x31')]));_0xc6d1e2['attributes']=_0xc6d1e2[_0xa1b3('0x30')][_0xa1b3('0x32')]?_0xc6d1e2['attributes']:_0x2dc935['model'];if(!_0x145fb6['query'][_0xa1b3('0x33')]('nolimit')){_0xc6d1e2[_0xa1b3('0x1c')]=qs[_0xa1b3('0x1c')](_0x145fb6[_0xa1b3('0x2d')][_0xa1b3('0x1c')]);_0xc6d1e2['offset']=qs['offset'](_0x145fb6[_0xa1b3('0x2d')]['offset']);}_0xc6d1e2[_0xa1b3('0x34')]=qs[_0xa1b3('0x35')](_0x145fb6[_0xa1b3('0x2d')][_0xa1b3('0x35')]);_0xc6d1e2[_0xa1b3('0x36')]=qs[_0xa1b3('0x2e')](_[_0xa1b3('0x37')](_0x145fb6[_0xa1b3('0x2d')],_0x2dc935[_0xa1b3('0x2e')]));if(_0x145fb6[_0xa1b3('0x2d')][_0xa1b3('0x38')]){_0xc6d1e2[_0xa1b3('0x36')]=_['merge'](_0xc6d1e2[_0xa1b3('0x36')],{'$or':_[_0xa1b3('0x39')](_0x2b4807,function(_0x3d7f6c){if(_0x3d7f6c[_0xa1b3('0x3a')]['key']!==_0xa1b3('0x3b')){var _0x3bf28e={};_0x3bf28e[_0x3d7f6c[_0xa1b3('0x3c')]]={'$like':'%'+_0x145fb6[_0xa1b3('0x2d')][_0xa1b3('0x38')]+'%'};return _0x3bf28e;}})});}_0xc6d1e2=_[_0xa1b3('0x3d')]({},_0xc6d1e2,_0x145fb6['options']);var _0x1ebd36={'where':_0xc6d1e2[_0xa1b3('0x36')]};return db[_0xa1b3('0x3e')][_0xa1b3('0x1b')](_0x1ebd36)[_0xa1b3('0x22')](function(_0x4aabdd){_0x5d025b[_0xa1b3('0x1b')]=_0x4aabdd;if(_0x145fb6[_0xa1b3('0x2d')][_0xa1b3('0x3f')]){_0xc6d1e2[_0xa1b3('0x40')]=[{'all':!![]}];}return db['Interval'][_0xa1b3('0x41')](_0xc6d1e2);})['then'](function(_0x5c0cac){_0x5d025b['rows']=_0x5c0cac;return _0x5d025b;})[_0xa1b3('0x22')](respondWithFilteredResult(_0x3a49d3,_0xc6d1e2))[_0xa1b3('0x42')](handleError(_0x3a49d3,null));};exports[_0xa1b3('0x43')]=function(_0x1d83d8,_0x3d4103){var _0x47d565={'raw':!![],'where':{'id':_0x1d83d8[_0xa1b3('0x44')]['id']}},_0x3c25ab={};_0x3c25ab[_0xa1b3('0x2c')]=_[_0xa1b3('0x45')](db['Interval']['rawAttributes']);_0x3c25ab['query']=_[_0xa1b3('0x45')](_0x1d83d8['query']);_0x3c25ab[_0xa1b3('0x2e')]=_[_0xa1b3('0x2f')](_0x3c25ab[_0xa1b3('0x2c')],_0x3c25ab['query']);_0x47d565[_0xa1b3('0x30')]=_[_0xa1b3('0x2f')](_0x3c25ab['model'],qs[_0xa1b3('0x31')](_0x1d83d8[_0xa1b3('0x2d')][_0xa1b3('0x31')]));_0x47d565[_0xa1b3('0x30')]=_0x47d565['attributes']['length']?_0x47d565[_0xa1b3('0x30')]:_0x3c25ab[_0xa1b3('0x2c')];if(_0x1d83d8[_0xa1b3('0x2d')][_0xa1b3('0x3f')]){_0x47d565[_0xa1b3('0x40')]=[{'all':!![]}];}_0x47d565=_[_0xa1b3('0x3d')]({},_0x47d565,_0x1d83d8['options']);return db[_0xa1b3('0x3e')][_0xa1b3('0x46')](_0x47d565)['then'](handleEntityNotFound(_0x3d4103,null))[_0xa1b3('0x22')](respondWithResult(_0x3d4103,null))[_0xa1b3('0x42')](handleError(_0x3d4103,null));};exports[_0xa1b3('0x47')]=function(_0x5be3b3,_0x10c4f8){return db[_0xa1b3('0x3e')][_0xa1b3('0x47')](_0x5be3b3['body'],{})['then'](function(_0x1a9b32){var _0x20e4bc=_0x5be3b3[_0xa1b3('0x48')][_0xa1b3('0x24')]({'plain':!![]});if(!_0x20e4bc)throw new Error(_0xa1b3('0x49'));if(_0x20e4bc['role']===_0xa1b3('0x48')){var _0xe95b7c=_0x1a9b32[_0xa1b3('0x24')]({'plain':!![]});var _0xb55e89=_0xa1b3('0x25');return db['UserProfileSection']['find']({'where':{'name':_0xb55e89,'userProfileId':_0x20e4bc['userProfileId']},'raw':!![]})[_0xa1b3('0x22')](function(_0x46b497){if(_0x46b497&&_0x46b497[_0xa1b3('0x4a')]===0x0){return db[_0xa1b3('0x26')][_0xa1b3('0x47')]({'name':_0xe95b7c[_0xa1b3('0x29')],'resourceId':_0xe95b7c['id'],'type':_0x46b497[_0xa1b3('0x29')],'sectionId':_0x46b497['id']},{})[_0xa1b3('0x22')](function(){return _0x1a9b32;});}else{return _0x1a9b32;}})['catch'](function(_0x7991e4){logger[_0xa1b3('0x27')](_0xa1b3('0x4b'),_0x7991e4);throw _0x7991e4;});}return _0x1a9b32;})[_0xa1b3('0x22')](respondWithResult(_0x10c4f8,0xc9))[_0xa1b3('0x42')](handleError(_0x10c4f8,null));};exports['update']=function(_0x5077b8,_0x56aba7){if(_0x5077b8[_0xa1b3('0x4c')]['id']){delete _0x5077b8['body']['id'];}return db[_0xa1b3('0x3e')][_0xa1b3('0x46')]({'where':{'id':_0x5077b8['params']['id']}})[_0xa1b3('0x22')](handleEntityNotFound(_0x56aba7,null))[_0xa1b3('0x22')](saveUpdates(_0x5077b8[_0xa1b3('0x4c')],null))['then'](respondWithResult(_0x56aba7,null))['catch'](handleError(_0x56aba7,null));};exports[_0xa1b3('0x23')]=function(_0x5a7bd5,_0x12f6f9){return db['Interval'][_0xa1b3('0x46')]({'where':{'id':_0x5a7bd5['params']['id']}})['then'](handleEntityNotFound(_0x12f6f9,null))[_0xa1b3('0x22')](removeEntity(_0x12f6f9,null))[_0xa1b3('0x42')](handleError(_0x12f6f9,null));};exports[_0xa1b3('0x4d')]=function(_0x32fd3a,_0x2f9b5d,_0x3eb6f8){if(_0x32fd3a[_0xa1b3('0x4c')]['id']){delete _0x32fd3a['body']['id'];}return db[_0xa1b3('0x3e')][_0xa1b3('0x46')]({'where':{'id':_0x32fd3a[_0xa1b3('0x44')]['id']}})[_0xa1b3('0x22')](handleEntityNotFound(_0x2f9b5d,null))['then'](function(_0x59bc3d){if(_0x59bc3d){_0x32fd3a[_0xa1b3('0x4c')][_0xa1b3('0x4e')]=_0x59bc3d['id'];return db[_0xa1b3('0x3e')][_0xa1b3('0x47')](_0x32fd3a[_0xa1b3('0x4c')]);}})[_0xa1b3('0x22')](respondWithResult(_0x2f9b5d,null))[_0xa1b3('0x42')](handleError(_0x2f9b5d,null));};exports['getIntervals']=function(_0x2f236b,_0x524fe9,_0x3b14e4){var _0x48fd1f={};var _0x263f52={};var _0xf43a51;var _0x325bf6;return db[_0xa1b3('0x3e')]['findOne']({'where':{'id':_0x2f236b[_0xa1b3('0x44')]['id']}})[_0xa1b3('0x22')](handleEntityNotFound(_0x524fe9,null))[_0xa1b3('0x22')](function(_0x5a8a16){if(_0x5a8a16){_0xf43a51=_0x5a8a16;_0x263f52[_0xa1b3('0x2c')]=_[_0xa1b3('0x45')](db[_0xa1b3('0x3e')][_0xa1b3('0x2b')]);_0x263f52['query']=_['keys'](_0x2f236b[_0xa1b3('0x2d')]);_0x263f52['filters']=_[_0xa1b3('0x2f')](_0x263f52[_0xa1b3('0x2c')],_0x263f52[_0xa1b3('0x2d')]);_0x48fd1f[_0xa1b3('0x30')]=_[_0xa1b3('0x2f')](_0x263f52['model'],qs[_0xa1b3('0x31')](_0x2f236b[_0xa1b3('0x2d')][_0xa1b3('0x31')]));_0x48fd1f[_0xa1b3('0x30')]=_0x48fd1f[_0xa1b3('0x30')][_0xa1b3('0x32')]?_0x48fd1f['attributes']:_0x263f52[_0xa1b3('0x2c')];_0x48fd1f[_0xa1b3('0x34')]=qs[_0xa1b3('0x35')](_0x2f236b[_0xa1b3('0x2d')]['sort']);_0x48fd1f[_0xa1b3('0x36')]=qs[_0xa1b3('0x2e')](_[_0xa1b3('0x37')](_0x2f236b[_0xa1b3('0x2d')],_0x263f52[_0xa1b3('0x2e')]));if(_0x2f236b[_0xa1b3('0x2d')][_0xa1b3('0x38')]){_0x48fd1f[_0xa1b3('0x36')]=_['merge'](_0x48fd1f['where'],{'$or':_[_0xa1b3('0x39')](_0x48fd1f[_0xa1b3('0x30')],function(_0x5c0751){var _0x3d81f8={};_0x3d81f8[_0x5c0751]={'$like':'%'+_0x2f236b['query'][_0xa1b3('0x38')]+'%'};return _0x3d81f8;})});}_0x48fd1f=_[_0xa1b3('0x3d')]({},_0x48fd1f,_0x2f236b[_0xa1b3('0x4f')]);return _0xf43a51[_0xa1b3('0x50')](_0x48fd1f);}})['then'](function(_0x2262f7){if(_0x2262f7){_0x325bf6=_0x2262f7[_0xa1b3('0x32')];if(!_0x2f236b[_0xa1b3('0x2d')]['hasOwnProperty'](_0xa1b3('0x51'))){_0x48fd1f[_0xa1b3('0x1c')]=qs[_0xa1b3('0x1c')](_0x2f236b[_0xa1b3('0x2d')][_0xa1b3('0x1c')]);_0x48fd1f[_0xa1b3('0x52')]=qs['offset'](_0x2f236b[_0xa1b3('0x2d')]['offset']);}return _0xf43a51[_0xa1b3('0x50')](_0x48fd1f);}})[_0xa1b3('0x22')](function(_0x1b49f5){if(_0x1b49f5){return _0x1b49f5?{'count':_0x325bf6,'rows':_0x1b49f5}:null;}})[_0xa1b3('0x22')](respondWithResult(_0x524fe9,null))[_0xa1b3('0x42')](handleError(_0x524fe9,null));};exports['addIntervals']=function(_0x431576,_0x5df5fc,_0x1a5378){return db[_0xa1b3('0x3e')][_0xa1b3('0x53')]({'where':{'id':_0x431576[_0xa1b3('0x44')]['id']}})[_0xa1b3('0x22')](handleEntityNotFound(_0x5df5fc,null))[_0xa1b3('0x22')](function(_0x3da27c){if(_0x3da27c){return db['sequelize'][_0xa1b3('0x54')](function(_0x44a75b){return db['Interval'][_0xa1b3('0x23')]({'where':{'IntervalId':_0x431576[_0xa1b3('0x44')]['id']},'transaction':_0x44a75b})[_0xa1b3('0x22')](function(_0x95ff91){var _0x2543bb=_['map'](_0x431576[_0xa1b3('0x4c')],function(_0x5e54b8){delete _0x5e54b8['id'];_0x5e54b8[_0xa1b3('0x4e')]=_0x431576[_0xa1b3('0x44')]['id'];return _0x5e54b8;});return db[_0xa1b3('0x3e')][_0xa1b3('0x55')](_0x2543bb,{'transaction':_0x44a75b});});})['then'](function(){return db[_0xa1b3('0x3e')][_0xa1b3('0x41')]({'where':{'IntervalId':_0x431576[_0xa1b3('0x44')]['id']}});});}})[_0xa1b3('0x22')](respondWithResult(_0x5df5fc,null))[_0xa1b3('0x42')](handleError(_0x5df5fc,null));}; \ No newline at end of file diff --git a/server/api/interval/interval.model.js b/server/api/interval/interval.model.js index ad201c4..b8d510b 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 _0x6c50=['util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./interval.attributes','../../components/extensions/rewrite','exports','define','Interval','tools_intervals','rewrite','lodash'];(function(_0x3a384a,_0x3c958a){var _0x4539fe=function(_0x510fa7){while(--_0x510fa7){_0x3a384a['push'](_0x3a384a['shift']());}};_0x4539fe(++_0x3c958a);}(_0x6c50,0xa4));var _0x06c5=function(_0x3317a0,_0x37bae8){_0x3317a0=_0x3317a0-0x0;var _0x3daa82=_0x6c50[_0x3317a0];return _0x3daa82;};'use strict';var _=require(_0x06c5('0x0'));var util=require(_0x06c5('0x1'));var logger=require(_0x06c5('0x2'))(_0x06c5('0x3'));var moment=require('moment');var BPromise=require(_0x06c5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x06c5('0x5'));var rimraf=require(_0x06c5('0x6'));var config=require(_0x06c5('0x7'));var attributes=require(_0x06c5('0x8'));var extensions=require(_0x06c5('0x9'));module[_0x06c5('0xa')]=function(_0x3f5b56,_0x427dd6){return _0x3f5b56[_0x06c5('0xb')](_0x06c5('0xc'),attributes,{'tableName':_0x06c5('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x546ae5,_0xe263a){extensions[_0x06c5('0xe')](_0x3f5b56,_0x546ae5);},'afterBulkCreate':function(_0x3010af,_0x18f1e9,_0x4e863c){_0x4e863c();extensions['rewrite'](_0x3f5b56,_0x3010af[0x0]);},'afterUpdate':function(_0x5ea57c,_0x1dc67b){extensions['rewrite'](_0x3f5b56,_0x5ea57c);},'afterDestroy':function(_0x566133,_0x4c0261){extensions[_0x06c5('0xe')](_0x3f5b56,_0x566133);}}});}; \ No newline at end of file +var _0x9099=['rimraf','../../config/environment','./interval.attributes','../../components/extensions/rewrite','exports','define','tools_intervals','rewrite','lodash','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x2def2a,_0x1bddea){var _0x138067=function(_0x508265){while(--_0x508265){_0x2def2a['push'](_0x2def2a['shift']());}};_0x138067(++_0x1bddea);}(_0x9099,0x1ac));var _0x9909=function(_0x1a0600,_0x41feef){_0x1a0600=_0x1a0600-0x0;var _0x734670=_0x9099[_0x1a0600];return _0x734670;};'use strict';var _=require(_0x9909('0x0'));var util=require('util');var logger=require(_0x9909('0x1'))(_0x9909('0x2'));var moment=require(_0x9909('0x3'));var BPromise=require(_0x9909('0x4'));var rp=require(_0x9909('0x5'));var fs=require('fs');var path=require(_0x9909('0x6'));var rimraf=require(_0x9909('0x7'));var config=require(_0x9909('0x8'));var attributes=require(_0x9909('0x9'));var extensions=require(_0x9909('0xa'));module[_0x9909('0xb')]=function(_0x41c07e,_0x3b7391){return _0x41c07e[_0x9909('0xc')]('Interval',attributes,{'tableName':_0x9909('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x5dcd39,_0x5a9063){extensions['rewrite'](_0x41c07e,_0x5dcd39);},'afterBulkCreate':function(_0x5023b7,_0x2eebe7,_0x592725){_0x592725();extensions[_0x9909('0xe')](_0x41c07e,_0x5023b7[0x0]);},'afterUpdate':function(_0x9ff937,_0x3d7df3){extensions['rewrite'](_0x41c07e,_0x9ff937);},'afterDestroy':function(_0x413019,_0x489397){extensions[_0x9909('0xe')](_0x41c07e,_0x413019);}}});}; \ No newline at end of file diff --git a/server/api/interval/interval.rpc.js b/server/api/interval/interval.rpc.js index 7443c31..2fe7453 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 _0x5bf2=['limit','include','map','model','attributes','find','ShowInterval','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','Interval,\x20%s,\x20%s','request\x20sent','debug','Interval,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetInterval','Interval','findAll','options','raw'];(function(_0x12aa66,_0x2d35c1){var _0x53dfe9=function(_0x2ab011){while(--_0x2ab011){_0x12aa66['push'](_0x12aa66['shift']());}};_0x53dfe9(++_0x2d35c1);}(_0x5bf2,0x70));var _0x25bf=function(_0x4aa37e,_0x4a338c){_0x4aa37e=_0x4aa37e-0x0;var _0x3ba5d5=_0x5bf2[_0x4aa37e];return _0x3ba5d5;};'use strict';var _=require('lodash');var util=require(_0x25bf('0x0'));var moment=require(_0x25bf('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x25bf('0x2'));var db=require(_0x25bf('0x3'))['db'];var utils=require(_0x25bf('0x4'));var logger=require(_0x25bf('0x5'))('rpc');var config=require(_0x25bf('0x6'));var jayson=require(_0x25bf('0x7'));var client=jayson[_0x25bf('0x8')][_0x25bf('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x53ccd0,_0x30cb90,_0x997912){return new BPromise(function(_0x133122,_0xf4ebed){return client[_0x25bf('0xa')](_0x53ccd0,_0x997912)[_0x25bf('0xb')](function(_0x55ddfb){logger[_0x25bf('0xc')](_0x25bf('0xd'),_0x30cb90,_0x25bf('0xe'));logger[_0x25bf('0xf')](_0x25bf('0x10'),_0x30cb90,'request\x20sent',JSON[_0x25bf('0x11')](_0x55ddfb));if(_0x55ddfb[_0x25bf('0x12')]){if(_0x55ddfb[_0x25bf('0x12')][_0x25bf('0x13')]===0x1f4){logger[_0x25bf('0x12')]('Interval,\x20%s,\x20%s',_0x30cb90,_0x55ddfb[_0x25bf('0x12')][_0x25bf('0x14')]);return _0xf4ebed(_0x55ddfb[_0x25bf('0x12')][_0x25bf('0x14')]);}logger['error']('Interval,\x20%s,\x20%s',_0x30cb90,_0x55ddfb[_0x25bf('0x12')][_0x25bf('0x14')]);return _0x133122(_0x55ddfb[_0x25bf('0x12')][_0x25bf('0x14')]);}else{logger[_0x25bf('0xc')](_0x25bf('0xd'),_0x30cb90,'request\x20sent');_0x133122(_0x55ddfb[_0x25bf('0x15')]['message']);}})[_0x25bf('0x16')](function(_0x33130d){logger['error'](_0x25bf('0xd'),_0x30cb90,_0x33130d);_0xf4ebed(_0x33130d);});});}exports[_0x25bf('0x17')]=function(_0x3d8b16){var _0x57b5c4=this;return new Promise(function(_0x1ff6be,_0x9f71a8){return db[_0x25bf('0x18')][_0x25bf('0x19')]({'raw':_0x3d8b16[_0x25bf('0x1a')]?_0x3d8b16[_0x25bf('0x1a')][_0x25bf('0x1b')]===undefined?!![]:![]:!![],'where':_0x3d8b16['options']?_0x3d8b16[_0x25bf('0x1a')]['where']||null:null,'attributes':_0x3d8b16[_0x25bf('0x1a')]?_0x3d8b16[_0x25bf('0x1a')]['attributes']||null:null,'limit':_0x3d8b16['options']?_0x3d8b16['options'][_0x25bf('0x1c')]||null:null,'include':_0x3d8b16[_0x25bf('0x1a')]?_0x3d8b16[_0x25bf('0x1a')][_0x25bf('0x1d')]?_[_0x25bf('0x1e')](_0x3d8b16['options'][_0x25bf('0x1d')],function(_0x12d6ef){return{'model':db[_0x12d6ef[_0x25bf('0x1f')]],'as':_0x12d6ef['as'],'attributes':_0x12d6ef[_0x25bf('0x20')],'include':_0x12d6ef[_0x25bf('0x1d')]?_[_0x25bf('0x1e')](_0x12d6ef[_0x25bf('0x1d')],function(_0x5230f7){return{'model':db[_0x5230f7[_0x25bf('0x1f')]],'as':_0x5230f7['as'],'attributes':_0x5230f7[_0x25bf('0x20')],'include':_0x5230f7[_0x25bf('0x1d')]?_[_0x25bf('0x1e')](_0x5230f7[_0x25bf('0x1d')],function(_0x40be9e){return{'model':db[_0x40be9e[_0x25bf('0x1f')]],'as':_0x40be9e['as'],'attributes':_0x40be9e[_0x25bf('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x51901d){logger[_0x25bf('0xc')]('GetInterval',_0x3d8b16);logger[_0x25bf('0xf')](_0x25bf('0x17'),_0x3d8b16,JSON[_0x25bf('0x11')](_0x51901d));_0x1ff6be(_0x51901d);})[_0x25bf('0x16')](function(_0x526545){logger[_0x25bf('0x12')](_0x25bf('0x17'),_0x526545[_0x25bf('0x14')],_0x3d8b16);_0x9f71a8(_0x57b5c4[_0x25bf('0x12')](0x1f4,_0x526545[_0x25bf('0x14')]));});});};exports['ShowInterval']=function(_0x534130){var _0xc6384=this;return new Promise(function(_0x1675ca,_0xd9b95c){return db[_0x25bf('0x18')][_0x25bf('0x21')]({'raw':_0x534130[_0x25bf('0x1a')]?_0x534130[_0x25bf('0x1a')][_0x25bf('0x1b')]===undefined?!![]:![]:!![],'where':_0x534130[_0x25bf('0x1a')]?_0x534130['options']['where']||null:null,'attributes':_0x534130[_0x25bf('0x1a')]?_0x534130[_0x25bf('0x1a')]['attributes']||null:null,'include':_0x534130[_0x25bf('0x1a')]?_0x534130[_0x25bf('0x1a')][_0x25bf('0x1d')]?_['map'](_0x534130[_0x25bf('0x1a')][_0x25bf('0x1d')],function(_0x525c67){return{'model':db[_0x525c67['model']],'as':_0x525c67['as'],'attributes':_0x525c67[_0x25bf('0x20')],'include':_0x525c67[_0x25bf('0x1d')]?_['map'](_0x525c67[_0x25bf('0x1d')],function(_0x5c4b11){return{'model':db[_0x5c4b11[_0x25bf('0x1f')]],'as':_0x5c4b11['as'],'attributes':_0x5c4b11[_0x25bf('0x20')],'include':_0x5c4b11[_0x25bf('0x1d')]?_[_0x25bf('0x1e')](_0x5c4b11[_0x25bf('0x1d')],function(_0x50feaa){return{'model':db[_0x50feaa[_0x25bf('0x1f')]],'as':_0x50feaa['as'],'attributes':_0x50feaa['attributes']};}):[]};}):[]};}):[]:[]})[_0x25bf('0xb')](function(_0x53ab91){logger[_0x25bf('0xc')](_0x25bf('0x22'),_0x534130);logger[_0x25bf('0xf')](_0x25bf('0x22'),_0x534130,JSON['stringify'](_0x53ab91));_0x1675ca(_0x53ab91);})['catch'](function(_0x17f317){logger['error'](_0x25bf('0x22'),_0x17f317[_0x25bf('0x14')],_0x534130);_0xd9b95c(_0xc6384['error'](0x1f4,_0x17f317[_0x25bf('0x14')]));});});}; \ No newline at end of file +var _0xcb27=['map','GetInterval','Interval','find','ShowInterval','lodash','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Interval,\x20%s,\x20%s','request\x20sent','debug','Interval,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','options','raw','where','attributes','limit','include','model'];(function(_0x5591e9,_0x4aba4d){var _0x4d369c=function(_0x4f1bbd){while(--_0x4f1bbd){_0x5591e9['push'](_0x5591e9['shift']());}};_0x4d369c(++_0x4aba4d);}(_0xcb27,0x19d));var _0x7cb2=function(_0x270079,_0x16c150){_0x270079=_0x270079-0x0;var _0x4d395c=_0xcb27[_0x270079];return _0x4d395c;};'use strict';var _=require(_0x7cb2('0x0'));var util=require('util');var moment=require(_0x7cb2('0x1'));var BPromise=require(_0x7cb2('0x2'));var rs=require(_0x7cb2('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x7cb2('0x4'));var logger=require(_0x7cb2('0x5'))(_0x7cb2('0x6'));var config=require(_0x7cb2('0x7'));var jayson=require(_0x7cb2('0x8'));var client=jayson['client'][_0x7cb2('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x374bef,_0x1a1f8e,_0x47595f){return new BPromise(function(_0x20b7e2,_0x9bcead){return client[_0x7cb2('0xa')](_0x374bef,_0x47595f)[_0x7cb2('0xb')](function(_0x149b56){logger[_0x7cb2('0xc')](_0x7cb2('0xd'),_0x1a1f8e,_0x7cb2('0xe'));logger[_0x7cb2('0xf')](_0x7cb2('0x10'),_0x1a1f8e,'request\x20sent',JSON[_0x7cb2('0x11')](_0x149b56));if(_0x149b56['error']){if(_0x149b56[_0x7cb2('0x12')]['code']===0x1f4){logger[_0x7cb2('0x12')](_0x7cb2('0xd'),_0x1a1f8e,_0x149b56[_0x7cb2('0x12')][_0x7cb2('0x13')]);return _0x9bcead(_0x149b56[_0x7cb2('0x12')][_0x7cb2('0x13')]);}logger[_0x7cb2('0x12')](_0x7cb2('0xd'),_0x1a1f8e,_0x149b56['error'][_0x7cb2('0x13')]);return _0x20b7e2(_0x149b56[_0x7cb2('0x12')][_0x7cb2('0x13')]);}else{logger['info']('Interval,\x20%s,\x20%s',_0x1a1f8e,_0x7cb2('0xe'));_0x20b7e2(_0x149b56[_0x7cb2('0x14')][_0x7cb2('0x13')]);}})[_0x7cb2('0x15')](function(_0x4b1067){logger[_0x7cb2('0x12')]('Interval,\x20%s,\x20%s',_0x1a1f8e,_0x4b1067);_0x9bcead(_0x4b1067);});});}exports['GetInterval']=function(_0xf17d79){var _0x5468ed=this;return new Promise(function(_0x3afc0c,_0x595622){return db['Interval']['findAll']({'raw':_0xf17d79[_0x7cb2('0x16')]?_0xf17d79[_0x7cb2('0x16')][_0x7cb2('0x17')]===undefined?!![]:![]:!![],'where':_0xf17d79[_0x7cb2('0x16')]?_0xf17d79[_0x7cb2('0x16')][_0x7cb2('0x18')]||null:null,'attributes':_0xf17d79[_0x7cb2('0x16')]?_0xf17d79[_0x7cb2('0x16')][_0x7cb2('0x19')]||null:null,'limit':_0xf17d79[_0x7cb2('0x16')]?_0xf17d79[_0x7cb2('0x16')][_0x7cb2('0x1a')]||null:null,'include':_0xf17d79['options']?_0xf17d79['options'][_0x7cb2('0x1b')]?_['map'](_0xf17d79[_0x7cb2('0x16')]['include'],function(_0xd3710e){return{'model':db[_0xd3710e[_0x7cb2('0x1c')]],'as':_0xd3710e['as'],'attributes':_0xd3710e[_0x7cb2('0x19')],'include':_0xd3710e[_0x7cb2('0x1b')]?_[_0x7cb2('0x1d')](_0xd3710e[_0x7cb2('0x1b')],function(_0x21fa84){return{'model':db[_0x21fa84[_0x7cb2('0x1c')]],'as':_0x21fa84['as'],'attributes':_0x21fa84[_0x7cb2('0x19')],'include':_0x21fa84[_0x7cb2('0x1b')]?_[_0x7cb2('0x1d')](_0x21fa84['include'],function(_0x39ca25){return{'model':db[_0x39ca25[_0x7cb2('0x1c')]],'as':_0x39ca25['as'],'attributes':_0x39ca25[_0x7cb2('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4e7b87){logger[_0x7cb2('0xc')](_0x7cb2('0x1e'),_0xf17d79);logger[_0x7cb2('0xf')](_0x7cb2('0x1e'),_0xf17d79,JSON['stringify'](_0x4e7b87));_0x3afc0c(_0x4e7b87);})['catch'](function(_0x3179e4){logger[_0x7cb2('0x12')](_0x7cb2('0x1e'),_0x3179e4[_0x7cb2('0x13')],_0xf17d79);_0x595622(_0x5468ed[_0x7cb2('0x12')](0x1f4,_0x3179e4[_0x7cb2('0x13')]));});});};exports['ShowInterval']=function(_0x4aa9f7){var _0x1cf430=this;return new Promise(function(_0x46f54e,_0x577dc0){return db[_0x7cb2('0x1f')][_0x7cb2('0x20')]({'raw':_0x4aa9f7['options']?_0x4aa9f7[_0x7cb2('0x16')][_0x7cb2('0x17')]===undefined?!![]:![]:!![],'where':_0x4aa9f7[_0x7cb2('0x16')]?_0x4aa9f7['options'][_0x7cb2('0x18')]||null:null,'attributes':_0x4aa9f7[_0x7cb2('0x16')]?_0x4aa9f7[_0x7cb2('0x16')][_0x7cb2('0x19')]||null:null,'include':_0x4aa9f7[_0x7cb2('0x16')]?_0x4aa9f7[_0x7cb2('0x16')][_0x7cb2('0x1b')]?_[_0x7cb2('0x1d')](_0x4aa9f7[_0x7cb2('0x16')][_0x7cb2('0x1b')],function(_0xef16f8){return{'model':db[_0xef16f8[_0x7cb2('0x1c')]],'as':_0xef16f8['as'],'attributes':_0xef16f8[_0x7cb2('0x19')],'include':_0xef16f8['include']?_[_0x7cb2('0x1d')](_0xef16f8[_0x7cb2('0x1b')],function(_0x27bc4f){return{'model':db[_0x27bc4f[_0x7cb2('0x1c')]],'as':_0x27bc4f['as'],'attributes':_0x27bc4f['attributes'],'include':_0x27bc4f[_0x7cb2('0x1b')]?_[_0x7cb2('0x1d')](_0x27bc4f[_0x7cb2('0x1b')],function(_0x1bb7ba){return{'model':db[_0x1bb7ba['model']],'as':_0x1bb7ba['as'],'attributes':_0x1bb7ba[_0x7cb2('0x19')]};}):[]};}):[]};}):[]:[]})[_0x7cb2('0xb')](function(_0x2001b4){logger[_0x7cb2('0xc')](_0x7cb2('0x21'),_0x4aa9f7);logger[_0x7cb2('0xf')](_0x7cb2('0x21'),_0x4aa9f7,JSON[_0x7cb2('0x11')](_0x2001b4));_0x46f54e(_0x2001b4);})[_0x7cb2('0x15')](function(_0x2c96e5){logger[_0x7cb2('0x12')](_0x7cb2('0x21'),_0x2c96e5[_0x7cb2('0x13')],_0x4aa9f7);_0x577dc0(_0x1cf430[_0x7cb2('0x12')](0x1f4,_0x2c96e5[_0x7cb2('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/jira/index.js b/server/api/jira/index.js index 58390f0..dce6deb 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 _0x0d3f=['express','../../components/auth/service','./jira.controller','post','isAuthenticated','send','exports'];(function(_0x38ee58,_0x36a253){var _0x18b930=function(_0x1bbd53){while(--_0x1bbd53){_0x38ee58['push'](_0x38ee58['shift']());}};_0x18b930(++_0x36a253);}(_0x0d3f,0x1d5));var _0xf0d3=function(_0x1c06f4,_0x2feba6){_0x1c06f4=_0x1c06f4-0x0;var _0x1a727e=_0x0d3f[_0x1c06f4];return _0x1a727e;};'use strict';var express=require(_0xf0d3('0x0'));var router=express['Router']();var auth=require(_0xf0d3('0x1'));var controller=require(_0xf0d3('0x2'));router[_0xf0d3('0x3')]('/',auth[_0xf0d3('0x4')](),controller[_0xf0d3('0x5')]);module[_0xf0d3('0x6')]=router; \ No newline at end of file +var _0x0bb3=['Router','../../components/auth/service','./jira.controller','post','isAuthenticated','send','exports'];(function(_0x35201e,_0x34341b){var _0x4bc5b7=function(_0x504ba7){while(--_0x504ba7){_0x35201e['push'](_0x35201e['shift']());}};_0x4bc5b7(++_0x34341b);}(_0x0bb3,0x126));var _0x30bb=function(_0x3aaf0a,_0x450970){_0x3aaf0a=_0x3aaf0a-0x0;var _0x33e6bc=_0x0bb3[_0x3aaf0a];return _0x33e6bc;};'use strict';var express=require('express');var router=express[_0x30bb('0x0')]();var auth=require(_0x30bb('0x1'));var controller=require(_0x30bb('0x2'));router[_0x30bb('0x3')]('/',auth[_0x30bb('0x4')](),controller[_0x30bb('0x5')]);module[_0x30bb('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 7171b6e..45b79c9 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 _0xff12=['end','statusCode','error','status','json','write','openIssue','body','headers','connection','remoteAddress','socket','bluebird','../../config/logger','api','support','3eAmWpBVP0','key','MOTGUI','Report','\x20from\x20','description','stringify','issuetype','Bug','fields','customfield_11500','email','customfield_11501','oldToken','customfield_11502','name','customfield_11504','customfield_10102','/rest/api/2/issue','application/json','Basic\x20','request','setEncoding','utf8','data'];(function(_0x26544f,_0x79f614){var _0x2fff64=function(_0x4d1a11){while(--_0x4d1a11){_0x26544f['push'](_0x26544f['shift']());}};_0x2fff64(++_0x79f614);}(_0xff12,0xd9));var _0x2ff1=function(_0x2593bb,_0x58a8d4){_0x2593bb=_0x2593bb-0x0;var _0xf7ca95=_0xff12[_0x2593bb];return _0xf7ca95;};'use strict';var BPromise=require(_0x2ff1('0x0'));var https=require('https');var logger=require(_0x2ff1('0x1'))(_0x2ff1('0x2'));var USERNAME=_0x2ff1('0x3');var PASSWORD=_0x2ff1('0x4');function openIssue(_0xa05fc3,_0x2aa1b1){var _0x3c8024={'fields':{'project':{'key':_0xa05fc3[_0x2ff1('0x5')]||_0x2ff1('0x6')},'summary':(_0xa05fc3['summary']||_0x2ff1('0x7'))+_0x2ff1('0x8')+_0xa05fc3['ip'],'description':_0xa05fc3[_0x2ff1('0x9')]||JSON[_0x2ff1('0xa')](_0xa05fc3),'issuetype':{'name':_0xa05fc3[_0x2ff1('0xb')]||_0x2ff1('0xc')}}};_0x3c8024[_0x2ff1('0xd')][_0x2ff1('0xe')]=_0xa05fc3[_0x2ff1('0xf')];_0x3c8024[_0x2ff1('0xd')][_0x2ff1('0x10')]=_0xa05fc3[_0x2ff1('0x11')];_0x3c8024['fields'][_0x2ff1('0x12')]=_0xa05fc3['newToken'];_0x3c8024[_0x2ff1('0xd')]['customfield_11503']=_0xa05fc3[_0x2ff1('0x13')];_0x3c8024[_0x2ff1('0xd')][_0x2ff1('0x14')]=_0xa05fc3['reason'];_0x3c8024[_0x2ff1('0xd')][_0x2ff1('0x15')]=_0xa05fc3['ip'];var _0x1fc427={'host':'track.xcallymotion.com','port':0x1bb,'path':_0x2ff1('0x16'),'method':'POST','timeout':0x4e20,'headers':{'Content-Type':_0x2ff1('0x17'),'Authorization':_0x2ff1('0x18')+new Buffer(USERNAME+':'+PASSWORD)['toString']('base64')}};var _0x583d51=JSON[_0x2ff1('0xa')](_0x3c8024);var _0x62a23=https[_0x2ff1('0x19')](_0x1fc427,function(_0x541bac){_0x541bac[_0x2ff1('0x1a')](_0x2ff1('0x1b'));var _0x34ac62='';_0x541bac['on'](_0x2ff1('0x1c'),function(_0x4cc19b){_0x34ac62+=_0x4cc19b;});_0x541bac['on'](_0x2ff1('0x1d'),function(){if(_0x2aa1b1){return _0x2aa1b1['status'](_0x541bac[_0x2ff1('0x1e')])['json'](JSON['parse'](_0x34ac62));}});});_0x62a23['on'](_0x2ff1('0x1f'),function(_0x52cef4){if(_0x2aa1b1){return _0x2aa1b1[_0x2ff1('0x20')](0x1f4)[_0x2ff1('0x21')]({'errors':[{'message':'Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','type':'api.jira'}]});}});_0x62a23[_0x2ff1('0x22')](_0x583d51);_0x62a23[_0x2ff1('0x1d')]();}exports[_0x2ff1('0x23')]=openIssue;exports['send']=function(_0x5a6eb9,_0x4ae736){_0x5a6eb9[_0x2ff1('0x24')]['ip']=_0x5a6eb9[_0x2ff1('0x25')]['x-forwarded-for']||_0x5a6eb9[_0x2ff1('0x26')][_0x2ff1('0x27')]||_0x5a6eb9[_0x2ff1('0x28')][_0x2ff1('0x27')]||_0x5a6eb9[_0x2ff1('0x26')]['socket'][_0x2ff1('0x27')];return openIssue(_0x5a6eb9[_0x2ff1('0x24')],_0x4ae736);}; \ No newline at end of file +var _0x96ec=['error','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','end','openIssue','headers','x-forwarded-for','connection','socket','remoteAddress','bluebird','https','../../config/logger','api','support','MOTGUI','summary','Report','description','stringify','issuetype','Bug','customfield_11500','customfield_11501','oldToken','customfield_11502','fields','customfield_11503','name','customfield_11504','reason','track.xcallymotion.com','POST','application/json','Basic\x20','toString','base64','setEncoding','utf8','status','statusCode','json','parse'];(function(_0x47478d,_0x611d77){var _0x26761c=function(_0x4616e8){while(--_0x4616e8){_0x47478d['push'](_0x47478d['shift']());}};_0x26761c(++_0x611d77);}(_0x96ec,0x8b));var _0xc96e=function(_0x1a7550,_0x1edace){_0x1a7550=_0x1a7550-0x0;var _0x426e22=_0x96ec[_0x1a7550];return _0x426e22;};'use strict';var BPromise=require(_0xc96e('0x0'));var https=require(_0xc96e('0x1'));var logger=require(_0xc96e('0x2'))(_0xc96e('0x3'));var USERNAME=_0xc96e('0x4');var PASSWORD='3eAmWpBVP0';function openIssue(_0x125054,_0x47a50a){var _0x21a966={'fields':{'project':{'key':_0x125054['key']||_0xc96e('0x5')},'summary':(_0x125054[_0xc96e('0x6')]||_0xc96e('0x7'))+'\x20from\x20'+_0x125054['ip'],'description':_0x125054[_0xc96e('0x8')]||JSON[_0xc96e('0x9')](_0x125054),'issuetype':{'name':_0x125054[_0xc96e('0xa')]||_0xc96e('0xb')}}};_0x21a966['fields'][_0xc96e('0xc')]=_0x125054['email'];_0x21a966['fields'][_0xc96e('0xd')]=_0x125054[_0xc96e('0xe')];_0x21a966['fields'][_0xc96e('0xf')]=_0x125054['newToken'];_0x21a966[_0xc96e('0x10')][_0xc96e('0x11')]=_0x125054[_0xc96e('0x12')];_0x21a966[_0xc96e('0x10')][_0xc96e('0x13')]=_0x125054[_0xc96e('0x14')];_0x21a966['fields']['customfield_10102']=_0x125054['ip'];var _0x13cb14={'host':_0xc96e('0x15'),'port':0x1bb,'path':'/rest/api/2/issue','method':_0xc96e('0x16'),'timeout':0x4e20,'headers':{'Content-Type':_0xc96e('0x17'),'Authorization':_0xc96e('0x18')+new Buffer(USERNAME+':'+PASSWORD)[_0xc96e('0x19')](_0xc96e('0x1a'))}};var _0x958e55=JSON[_0xc96e('0x9')](_0x21a966);var _0x492c8b=https['request'](_0x13cb14,function(_0x34e28e){_0x34e28e[_0xc96e('0x1b')](_0xc96e('0x1c'));var _0x22f0f8='';_0x34e28e['on']('data',function(_0x188b13){_0x22f0f8+=_0x188b13;});_0x34e28e['on']('end',function(){if(_0x47a50a){return _0x47a50a[_0xc96e('0x1d')](_0x34e28e[_0xc96e('0x1e')])[_0xc96e('0x1f')](JSON[_0xc96e('0x20')](_0x22f0f8));}});});_0x492c8b['on'](_0xc96e('0x21'),function(_0x17983f){if(_0x47a50a){return _0x47a50a['status'](0x1f4)['json']({'errors':[{'message':_0xc96e('0x22'),'type':_0xc96e('0x23')}]});}});_0x492c8b['write'](_0x958e55);_0x492c8b[_0xc96e('0x24')]();}exports[_0xc96e('0x25')]=openIssue;exports['send']=function(_0x35ed21,_0x50025b){_0x35ed21['body']['ip']=_0x35ed21[_0xc96e('0x26')][_0xc96e('0x27')]||_0x35ed21[_0xc96e('0x28')]['remoteAddress']||_0x35ed21[_0xc96e('0x29')][_0xc96e('0x2a')]||_0x35ed21[_0xc96e('0x28')]['socket'][_0xc96e('0x2a')];return openIssue(_0x35ed21['body'],_0x50025b);}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/index.js b/server/api/jscriptyAnswerReport/index.js index bc3dcee..69d0f54 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 _0x0629=['../../components/auth/service','../../config/environment','./jscriptyAnswerReport.controller','get','isAuthenticated','index','/describe','/:id','show','post','create','update','destroy','exports','multer','util','path','express','Router'];(function(_0x4f138a,_0x11fe27){var _0x481fea=function(_0x236db0){while(--_0x236db0){_0x4f138a['push'](_0x4f138a['shift']());}};_0x481fea(++_0x11fe27);}(_0x0629,0x151));var _0x9062=function(_0x2ad158,_0x463792){_0x2ad158=_0x2ad158-0x0;var _0x1920a0=_0x0629[_0x2ad158];return _0x1920a0;};'use strict';var multer=require(_0x9062('0x0'));var util=require(_0x9062('0x1'));var path=require(_0x9062('0x2'));var timeout=require('connect-timeout');var express=require(_0x9062('0x3'));var router=express[_0x9062('0x4')]();var auth=require(_0x9062('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x9062('0x6'));var controller=require(_0x9062('0x7'));router[_0x9062('0x8')]('/',auth[_0x9062('0x9')](),controller[_0x9062('0xa')]);router['get'](_0x9062('0xb'),auth['isAuthenticated'](),controller['describe']);router['get'](_0x9062('0xc'),auth[_0x9062('0x9')](),controller[_0x9062('0xd')]);router[_0x9062('0xe')]('/',auth[_0x9062('0x9')](),controller[_0x9062('0xf')]);router['put'](_0x9062('0xc'),auth[_0x9062('0x9')](),controller[_0x9062('0x10')]);router['delete']('/:id',auth[_0x9062('0x9')](),controller[_0x9062('0x11')]);module[_0x9062('0x12')]=router; \ No newline at end of file +var _0xf441=['isAuthenticated','index','/describe','describe','/:id','show','post','create','update','destroy','exports','multer','util','path','Router','../../components/auth/service','../../config/environment','get'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xf441,0x173));var _0x1f44=function(_0x3d3817,_0x5d0b91){_0x3d3817=_0x3d3817-0x0;var _0x4f23ce=_0xf441[_0x3d3817];return _0x4f23ce;};'use strict';var multer=require(_0x1f44('0x0'));var util=require(_0x1f44('0x1'));var path=require(_0x1f44('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x1f44('0x3')]();var auth=require(_0x1f44('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x1f44('0x5'));var controller=require('./jscriptyAnswerReport.controller');router[_0x1f44('0x6')]('/',auth[_0x1f44('0x7')](),controller[_0x1f44('0x8')]);router[_0x1f44('0x6')](_0x1f44('0x9'),auth[_0x1f44('0x7')](),controller[_0x1f44('0xa')]);router[_0x1f44('0x6')](_0x1f44('0xb'),auth['isAuthenticated'](),controller[_0x1f44('0xc')]);router[_0x1f44('0xd')]('/',auth['isAuthenticated'](),controller[_0x1f44('0xe')]);router['put'](_0x1f44('0xb'),auth[_0x1f44('0x7')](),controller[_0x1f44('0xf')]);router['delete']('/:id',auth[_0x1f44('0x7')](),controller[_0x1f44('0x10')]);module[_0x1f44('0x11')]=router; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js index 388694c..d81bb4e 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 _0xda55=['STRING','TEXT'];(function(_0x34a994,_0x2da609){var _0x1d2b3b=function(_0x374bb){while(--_0x374bb){_0x34a994['push'](_0x34a994['shift']());}};_0x1d2b3b(++_0x2da609);}(_0xda55,0x14d));var _0x5da5=function(_0x3833f4,_0xb7f4ec){_0x3833f4=_0x3833f4-0x0;var _0x393f0b=_0xda55[_0x3833f4];return _0x393f0b;};'use strict';var Sequelize=require('sequelize');module['exports']={'question':{'type':Sequelize['STRING']},'answer':{'type':Sequelize[_0x5da5('0x0')]('long')},'membername':{'type':Sequelize[_0x5da5('0x1')]},'projectname':{'type':Sequelize[_0x5da5('0x1')]},'queue':{'type':Sequelize[_0x5da5('0x1')]},'uniqueid':{'type':Sequelize[_0x5da5('0x1')]},'calleridname':{'type':Sequelize[_0x5da5('0x1')]},'calleridnum':{'type':Sequelize['STRING']},'questionId':{'type':Sequelize[_0x5da5('0x1')]}}; \ No newline at end of file +var _0x0065=['TEXT','sequelize','STRING'];(function(_0x291fcb,_0xa238b6){var _0x3ab137=function(_0x4bf8fd){while(--_0x4bf8fd){_0x291fcb['push'](_0x291fcb['shift']());}};_0x3ab137(++_0xa238b6);}(_0x0065,0x169));var _0x5006=function(_0x3bee27,_0x211a75){_0x3bee27=_0x3bee27-0x0;var _0x500445=_0x0065[_0x3bee27];return _0x500445;};'use strict';var Sequelize=require(_0x5006('0x0'));module['exports']={'question':{'type':Sequelize[_0x5006('0x1')]},'answer':{'type':Sequelize[_0x5006('0x2')]('long')},'membername':{'type':Sequelize[_0x5006('0x1')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x5006('0x1')]},'uniqueid':{'type':Sequelize[_0x5006('0x1')]},'calleridname':{'type':Sequelize[_0x5006('0x1')]},'calleridnum':{'type':Sequelize[_0x5006('0x1')]},'questionId':{'type':Sequelize[_0x5006('0x1')]}}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.controller.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.controller.js index 36a46ca..8db7f53 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 _0x7aa1=['update','then','stack','name','send','rawAttributes','model','keys','query','intersection','fields','attributes','length','hasOwnProperty','offset','order','sort','where','filters','pick','filter','merge','type','key','VIRTUAL','field','options','includeAll','include','JscriptyAnswerReport','findAll','rows','catch','show','params','find','create','body','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','to-csv','ejs','lodash','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','limit','apply','reject','save'];(function(_0x59e7e0,_0x3ec148){var _0x26b058=function(_0x212ee2){while(--_0x212ee2){_0x59e7e0['push'](_0x59e7e0['shift']());}};_0x26b058(++_0x3ec148);}(_0x7aa1,0x6e));var _0x17aa=function(_0x4e6017,_0x55aadf){_0x4e6017=_0x4e6017-0x0;var _0x4594f6=_0x7aa1[_0x4e6017];return _0x4594f6;};'use strict';var pdf=require(_0x17aa('0x0'));var emlformat=require(_0x17aa('0x1'));var rimraf=require(_0x17aa('0x2'));var zipdir=require(_0x17aa('0x3'));var jsonpatch=require(_0x17aa('0x4'));var rp=require(_0x17aa('0x5'));var moment=require('moment');var BPromise=require(_0x17aa('0x6'));var Mustache=require(_0x17aa('0x7'));var util=require(_0x17aa('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0x17aa('0x9'));var ejs=require(_0x17aa('0xa'));var fs=require('fs');var _=require(_0x17aa('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x17aa('0xc'));var deskjs=require(_0x17aa('0xd'));var toCsv=require('to-csv');var querystring=require(_0x17aa('0xe'));var Papa=require('papaparse');var Redis=require(_0x17aa('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x17aa('0x10'));var as=require(_0x17aa('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x17aa('0x12'))(_0x17aa('0x13'));var utils=require(_0x17aa('0x14'));var config=require(_0x17aa('0x15'));var db=require(_0x17aa('0x16'))['db'];function respondWithStatusCode(_0x262036,_0x3f13cf){_0x3f13cf=_0x3f13cf||0xcc;return function(_0x17793a){if(_0x17793a){return _0x262036[_0x17aa('0x17')](_0x3f13cf);}return _0x262036[_0x17aa('0x18')](_0x3f13cf)[_0x17aa('0x19')]();};}function respondWithResult(_0x14c5ed,_0x59428c){_0x59428c=_0x59428c||0xc8;return function(_0x23fc8e){if(_0x23fc8e){return _0x14c5ed[_0x17aa('0x18')](_0x59428c)[_0x17aa('0x1a')](_0x23fc8e);}};}function respondWithFilteredResult(_0x224595,_0x522df8){return function(_0x4ff81e){if(_0x4ff81e){var _0x444287=_0x4ff81e[_0x17aa('0x1b')],_0x163444=_0x522df8['offset'],_0x4eebfd=_0x522df8['offset']+_0x522df8[_0x17aa('0x1c')],_0x47c380;if(_0x4eebfd>=_0x444287){_0x4eebfd=_0x444287;_0x47c380=0xc8;}else{_0x47c380=0xce;}_0x224595['status'](_0x47c380);return _0x224595['set']('Content-Range',_0x163444+'-'+_0x4eebfd+'/'+_0x444287)[_0x17aa('0x1a')](_0x4ff81e);}return null;};}function patchUpdates(_0x3a533d){return function(_0x5361e8){try{jsonpatch[_0x17aa('0x1d')](_0x5361e8,_0x3a533d,!![]);}catch(_0x485cd7){return BPromise[_0x17aa('0x1e')](_0x485cd7);}return _0x5361e8[_0x17aa('0x1f')]();};}function saveUpdates(_0x4241c4,_0x2cf0a0){return function(_0x2a2451){if(_0x2a2451){return _0x2a2451[_0x17aa('0x20')](_0x4241c4)[_0x17aa('0x21')](function(_0x389531){return _0x389531;});}return null;};}function removeEntity(_0xd12d86,_0x3bdd6b){return function(_0x2bce11){if(_0x2bce11){return _0x2bce11['destroy']()[_0x17aa('0x21')](function(){_0xd12d86[_0x17aa('0x18')](0xcc)[_0x17aa('0x19')]();});}};}function handleEntityNotFound(_0x49d235,_0x5883e3){return function(_0x35cb33){if(!_0x35cb33){_0x49d235[_0x17aa('0x17')](0x194);}return _0x35cb33;};}function handleError(_0xf44f7d,_0x51e5e9){_0x51e5e9=_0x51e5e9||0x1f4;return function(_0xb94430){logger['error'](_0xb94430[_0x17aa('0x22')]);if(_0xb94430['name']){delete _0xb94430[_0x17aa('0x23')];}_0xf44f7d['status'](_0x51e5e9)[_0x17aa('0x24')](_0xb94430);};}exports['index']=function(_0x3b7627,_0x4666d7){var _0x542e0b={},_0x332e4c={},_0xf8dfaf={'count':0x0,'rows':[]};var _0x496287=db['JscriptyAnswerReport'][_0x17aa('0x25')];_0x332e4c[_0x17aa('0x26')]=_[_0x17aa('0x27')](_0x496287);_0x332e4c[_0x17aa('0x28')]=_[_0x17aa('0x27')](_0x3b7627[_0x17aa('0x28')]);_0x332e4c['filters']=_[_0x17aa('0x29')](_0x332e4c[_0x17aa('0x26')],_0x332e4c[_0x17aa('0x28')]);_0x542e0b['attributes']=_['intersection'](_0x332e4c[_0x17aa('0x26')],qs[_0x17aa('0x2a')](_0x3b7627[_0x17aa('0x28')][_0x17aa('0x2a')]));_0x542e0b[_0x17aa('0x2b')]=_0x542e0b[_0x17aa('0x2b')][_0x17aa('0x2c')]?_0x542e0b[_0x17aa('0x2b')]:_0x332e4c[_0x17aa('0x26')];if(!_0x3b7627[_0x17aa('0x28')][_0x17aa('0x2d')]('nolimit')){_0x542e0b[_0x17aa('0x1c')]=qs['limit'](_0x3b7627[_0x17aa('0x28')]['limit']);_0x542e0b[_0x17aa('0x2e')]=qs[_0x17aa('0x2e')](_0x3b7627[_0x17aa('0x28')][_0x17aa('0x2e')]);}_0x542e0b[_0x17aa('0x2f')]=qs['sort'](_0x3b7627[_0x17aa('0x28')][_0x17aa('0x30')]);_0x542e0b[_0x17aa('0x31')]=qs[_0x17aa('0x32')](_[_0x17aa('0x33')](_0x3b7627['query'],_0x332e4c[_0x17aa('0x32')]));if(_0x3b7627['query'][_0x17aa('0x34')]){_0x542e0b[_0x17aa('0x31')]=_[_0x17aa('0x35')](_0x542e0b[_0x17aa('0x31')],{'$or':_['map'](_0x496287,function(_0x3ae3b0){if(_0x3ae3b0[_0x17aa('0x36')][_0x17aa('0x37')]!==_0x17aa('0x38')){var _0x4ff0dd={};_0x4ff0dd[_0x3ae3b0[_0x17aa('0x39')]]={'$like':'%'+_0x3b7627[_0x17aa('0x28')][_0x17aa('0x34')]+'%'};return _0x4ff0dd;}})});}_0x542e0b=_[_0x17aa('0x35')]({},_0x542e0b,_0x3b7627[_0x17aa('0x3a')]);var _0x343d6a={'where':_0x542e0b[_0x17aa('0x31')]};return db['JscriptyAnswerReport']['count'](_0x343d6a)[_0x17aa('0x21')](function(_0x9db929){_0xf8dfaf[_0x17aa('0x1b')]=_0x9db929;if(_0x3b7627[_0x17aa('0x28')][_0x17aa('0x3b')]){_0x542e0b[_0x17aa('0x3c')]=[{'all':!![]}];}return db[_0x17aa('0x3d')][_0x17aa('0x3e')](_0x542e0b);})[_0x17aa('0x21')](function(_0x234125){_0xf8dfaf[_0x17aa('0x3f')]=_0x234125;return _0xf8dfaf;})[_0x17aa('0x21')](respondWithFilteredResult(_0x4666d7,_0x542e0b))[_0x17aa('0x40')](handleError(_0x4666d7,null));};exports[_0x17aa('0x41')]=function(_0xa86c11,_0x350c66){var _0xd5b8e={'raw':!![],'where':{'id':_0xa86c11[_0x17aa('0x42')]['id']}},_0x5c1f07={};_0x5c1f07['model']=_[_0x17aa('0x27')](db[_0x17aa('0x3d')][_0x17aa('0x25')]);_0x5c1f07[_0x17aa('0x28')]=_[_0x17aa('0x27')](_0xa86c11[_0x17aa('0x28')]);_0x5c1f07[_0x17aa('0x32')]=_[_0x17aa('0x29')](_0x5c1f07[_0x17aa('0x26')],_0x5c1f07['query']);_0xd5b8e['attributes']=_[_0x17aa('0x29')](_0x5c1f07['model'],qs[_0x17aa('0x2a')](_0xa86c11[_0x17aa('0x28')][_0x17aa('0x2a')]));_0xd5b8e[_0x17aa('0x2b')]=_0xd5b8e[_0x17aa('0x2b')][_0x17aa('0x2c')]?_0xd5b8e[_0x17aa('0x2b')]:_0x5c1f07[_0x17aa('0x26')];if(_0xa86c11[_0x17aa('0x28')][_0x17aa('0x3b')]){_0xd5b8e['include']=[{'all':!![]}];}_0xd5b8e=_[_0x17aa('0x35')]({},_0xd5b8e,_0xa86c11[_0x17aa('0x3a')]);return db[_0x17aa('0x3d')][_0x17aa('0x43')](_0xd5b8e)[_0x17aa('0x21')](handleEntityNotFound(_0x350c66,null))[_0x17aa('0x21')](respondWithResult(_0x350c66,null))['catch'](handleError(_0x350c66,null));};exports[_0x17aa('0x44')]=function(_0x18a86c,_0x158bc1){return db[_0x17aa('0x3d')][_0x17aa('0x44')](_0x18a86c[_0x17aa('0x45')],{})[_0x17aa('0x21')](respondWithResult(_0x158bc1,0xc9))[_0x17aa('0x40')](handleError(_0x158bc1,null));};exports[_0x17aa('0x20')]=function(_0x5367fd,_0x433b47){if(_0x5367fd['body']['id']){delete _0x5367fd[_0x17aa('0x45')]['id'];}return db[_0x17aa('0x3d')][_0x17aa('0x43')]({'where':{'id':_0x5367fd[_0x17aa('0x42')]['id']}})[_0x17aa('0x21')](handleEntityNotFound(_0x433b47,null))[_0x17aa('0x21')](saveUpdates(_0x5367fd['body'],null))[_0x17aa('0x21')](respondWithResult(_0x433b47,null))['catch'](handleError(_0x433b47,null));};exports['destroy']=function(_0x4511a4,_0x1fb43b){return db[_0x17aa('0x3d')]['find']({'where':{'id':_0x4511a4[_0x17aa('0x42')]['id']}})[_0x17aa('0x21')](handleEntityNotFound(_0x1fb43b,null))['then'](removeEntity(_0x1fb43b,null))[_0x17aa('0x40')](handleError(_0x1fb43b,null));};exports[_0x17aa('0x46')]=function(_0x5f4b9f,_0x25dad8){return db['JscriptyAnswerReport'][_0x17aa('0x46')]()[_0x17aa('0x21')](respondWithResult(_0x25dad8,null))[_0x17aa('0x40')](handleError(_0x25dad8,null));}; \ No newline at end of file +var _0xb4c3=['mustache','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','json','offset','limit','set','Content-Range','reject','save','update','then','destroy','end','error','stack','name','send','JscriptyAnswerReport','rawAttributes','model','keys','query','attributes','intersection','fields','hasOwnProperty','nolimit','sort','where','filters','filter','merge','type','VIRTUAL','field','options','count','includeAll','findAll','rows','catch','show','find','create','body','params','describe','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird'];(function(_0x2739da,_0x37f796){var _0x5a97a2=function(_0x34c4d9){while(--_0x34c4d9){_0x2739da['push'](_0x2739da['shift']());}};_0x5a97a2(++_0x37f796);}(_0xb4c3,0x115));var _0x3b4c=function(_0x322f5f,_0x4b06dc){_0x322f5f=_0x322f5f-0x0;var _0x4a4784=_0xb4c3[_0x322f5f];return _0x4a4784;};'use strict';var pdf=require(_0x3b4c('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x3b4c('0x1'));var zipdir=require(_0x3b4c('0x2'));var jsonpatch=require(_0x3b4c('0x3'));var rp=require(_0x3b4c('0x4'));var moment=require(_0x3b4c('0x5'));var BPromise=require(_0x3b4c('0x6'));var Mustache=require(_0x3b4c('0x7'));var util=require('util');var path=require(_0x3b4c('0x8'));var sox=require('sox');var csv=require(_0x3b4c('0x9'));var ejs=require(_0x3b4c('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x3b4c('0xb'));var crypto=require(_0x3b4c('0xc'));var jsforce=require(_0x3b4c('0xd'));var deskjs=require(_0x3b4c('0xe'));var toCsv=require(_0x3b4c('0x9'));var querystring=require(_0x3b4c('0xf'));var Papa=require(_0x3b4c('0x10'));var Redis=require(_0x3b4c('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x3b4c('0x12'));var hardwareService=require(_0x3b4c('0x13'));var logger=require(_0x3b4c('0x14'))(_0x3b4c('0x15'));var utils=require(_0x3b4c('0x16'));var config=require('../../config/environment');var db=require(_0x3b4c('0x17'))['db'];function respondWithStatusCode(_0x153500,_0x2e1f99){_0x2e1f99=_0x2e1f99||0xcc;return function(_0x2769f6){if(_0x2769f6){return _0x153500[_0x3b4c('0x18')](_0x2e1f99);}return _0x153500[_0x3b4c('0x19')](_0x2e1f99)['end']();};}function respondWithResult(_0x5d2c85,_0x477200){_0x477200=_0x477200||0xc8;return function(_0x52ba53){if(_0x52ba53){return _0x5d2c85[_0x3b4c('0x19')](_0x477200)[_0x3b4c('0x1a')](_0x52ba53);}};}function respondWithFilteredResult(_0xcf9e4f,_0x1e1e28){return function(_0x34b4a7){if(_0x34b4a7){var _0x68fed1=_0x34b4a7['count'],_0x159ac8=_0x1e1e28[_0x3b4c('0x1b')],_0x1c0810=_0x1e1e28['offset']+_0x1e1e28[_0x3b4c('0x1c')],_0x7bad30;if(_0x1c0810>=_0x68fed1){_0x1c0810=_0x68fed1;_0x7bad30=0xc8;}else{_0x7bad30=0xce;}_0xcf9e4f['status'](_0x7bad30);return _0xcf9e4f[_0x3b4c('0x1d')](_0x3b4c('0x1e'),_0x159ac8+'-'+_0x1c0810+'/'+_0x68fed1)['json'](_0x34b4a7);}return null;};}function patchUpdates(_0x93dcb5){return function(_0x5bb56e){try{jsonpatch['apply'](_0x5bb56e,_0x93dcb5,!![]);}catch(_0x58c446){return BPromise[_0x3b4c('0x1f')](_0x58c446);}return _0x5bb56e[_0x3b4c('0x20')]();};}function saveUpdates(_0x326ef4,_0x18c687){return function(_0x598f66){if(_0x598f66){return _0x598f66[_0x3b4c('0x21')](_0x326ef4)[_0x3b4c('0x22')](function(_0x36f45c){return _0x36f45c;});}return null;};}function removeEntity(_0x2cf67c,_0x202845){return function(_0x5afeba){if(_0x5afeba){return _0x5afeba[_0x3b4c('0x23')]()[_0x3b4c('0x22')](function(){_0x2cf67c[_0x3b4c('0x19')](0xcc)[_0x3b4c('0x24')]();});}};}function handleEntityNotFound(_0x549c81,_0x53139c){return function(_0x14998c){if(!_0x14998c){_0x549c81[_0x3b4c('0x18')](0x194);}return _0x14998c;};}function handleError(_0x4f26f4,_0x1a4ba9){_0x1a4ba9=_0x1a4ba9||0x1f4;return function(_0x59b02e){logger[_0x3b4c('0x25')](_0x59b02e[_0x3b4c('0x26')]);if(_0x59b02e[_0x3b4c('0x27')]){delete _0x59b02e[_0x3b4c('0x27')];}_0x4f26f4[_0x3b4c('0x19')](_0x1a4ba9)[_0x3b4c('0x28')](_0x59b02e);};}exports['index']=function(_0x2288b3,_0xf6b3a4){var _0x3d0c55={},_0x1fd850={},_0x2f3467={'count':0x0,'rows':[]};var _0x56e17f=db[_0x3b4c('0x29')][_0x3b4c('0x2a')];_0x1fd850[_0x3b4c('0x2b')]=_[_0x3b4c('0x2c')](_0x56e17f);_0x1fd850[_0x3b4c('0x2d')]=_[_0x3b4c('0x2c')](_0x2288b3[_0x3b4c('0x2d')]);_0x1fd850['filters']=_['intersection'](_0x1fd850[_0x3b4c('0x2b')],_0x1fd850['query']);_0x3d0c55[_0x3b4c('0x2e')]=_[_0x3b4c('0x2f')](_0x1fd850['model'],qs[_0x3b4c('0x30')](_0x2288b3[_0x3b4c('0x2d')][_0x3b4c('0x30')]));_0x3d0c55['attributes']=_0x3d0c55['attributes']['length']?_0x3d0c55[_0x3b4c('0x2e')]:_0x1fd850['model'];if(!_0x2288b3[_0x3b4c('0x2d')][_0x3b4c('0x31')](_0x3b4c('0x32'))){_0x3d0c55[_0x3b4c('0x1c')]=qs[_0x3b4c('0x1c')](_0x2288b3['query']['limit']);_0x3d0c55[_0x3b4c('0x1b')]=qs['offset'](_0x2288b3['query'][_0x3b4c('0x1b')]);}_0x3d0c55['order']=qs[_0x3b4c('0x33')](_0x2288b3['query'][_0x3b4c('0x33')]);_0x3d0c55[_0x3b4c('0x34')]=qs[_0x3b4c('0x35')](_['pick'](_0x2288b3[_0x3b4c('0x2d')],_0x1fd850[_0x3b4c('0x35')]));if(_0x2288b3[_0x3b4c('0x2d')][_0x3b4c('0x36')]){_0x3d0c55['where']=_[_0x3b4c('0x37')](_0x3d0c55['where'],{'$or':_['map'](_0x56e17f,function(_0x56cb42){if(_0x56cb42[_0x3b4c('0x38')]['key']!==_0x3b4c('0x39')){var _0x1e6b8a={};_0x1e6b8a[_0x56cb42[_0x3b4c('0x3a')]]={'$like':'%'+_0x2288b3[_0x3b4c('0x2d')][_0x3b4c('0x36')]+'%'};return _0x1e6b8a;}})});}_0x3d0c55=_[_0x3b4c('0x37')]({},_0x3d0c55,_0x2288b3[_0x3b4c('0x3b')]);var _0x446af4={'where':_0x3d0c55[_0x3b4c('0x34')]};return db['JscriptyAnswerReport'][_0x3b4c('0x3c')](_0x446af4)[_0x3b4c('0x22')](function(_0x5d5901){_0x2f3467['count']=_0x5d5901;if(_0x2288b3[_0x3b4c('0x2d')][_0x3b4c('0x3d')]){_0x3d0c55['include']=[{'all':!![]}];}return db[_0x3b4c('0x29')][_0x3b4c('0x3e')](_0x3d0c55);})[_0x3b4c('0x22')](function(_0x15796e){_0x2f3467[_0x3b4c('0x3f')]=_0x15796e;return _0x2f3467;})[_0x3b4c('0x22')](respondWithFilteredResult(_0xf6b3a4,_0x3d0c55))[_0x3b4c('0x40')](handleError(_0xf6b3a4,null));};exports[_0x3b4c('0x41')]=function(_0x3c9115,_0x22d8e5){var _0x25b9cd={'raw':!![],'where':{'id':_0x3c9115['params']['id']}},_0x42699b={};_0x42699b[_0x3b4c('0x2b')]=_[_0x3b4c('0x2c')](db[_0x3b4c('0x29')][_0x3b4c('0x2a')]);_0x42699b['query']=_[_0x3b4c('0x2c')](_0x3c9115[_0x3b4c('0x2d')]);_0x42699b[_0x3b4c('0x35')]=_['intersection'](_0x42699b[_0x3b4c('0x2b')],_0x42699b[_0x3b4c('0x2d')]);_0x25b9cd[_0x3b4c('0x2e')]=_[_0x3b4c('0x2f')](_0x42699b[_0x3b4c('0x2b')],qs['fields'](_0x3c9115[_0x3b4c('0x2d')][_0x3b4c('0x30')]));_0x25b9cd['attributes']=_0x25b9cd['attributes']['length']?_0x25b9cd[_0x3b4c('0x2e')]:_0x42699b[_0x3b4c('0x2b')];if(_0x3c9115[_0x3b4c('0x2d')]['includeAll']){_0x25b9cd['include']=[{'all':!![]}];}_0x25b9cd=_[_0x3b4c('0x37')]({},_0x25b9cd,_0x3c9115[_0x3b4c('0x3b')]);return db['JscriptyAnswerReport'][_0x3b4c('0x42')](_0x25b9cd)['then'](handleEntityNotFound(_0x22d8e5,null))[_0x3b4c('0x22')](respondWithResult(_0x22d8e5,null))[_0x3b4c('0x40')](handleError(_0x22d8e5,null));};exports[_0x3b4c('0x43')]=function(_0x37d3aa,_0x16a557){return db[_0x3b4c('0x29')]['create'](_0x37d3aa[_0x3b4c('0x44')],{})[_0x3b4c('0x22')](respondWithResult(_0x16a557,0xc9))['catch'](handleError(_0x16a557,null));};exports[_0x3b4c('0x21')]=function(_0x1e6cc9,_0x395137){if(_0x1e6cc9[_0x3b4c('0x44')]['id']){delete _0x1e6cc9[_0x3b4c('0x44')]['id'];}return db[_0x3b4c('0x29')][_0x3b4c('0x42')]({'where':{'id':_0x1e6cc9[_0x3b4c('0x45')]['id']}})[_0x3b4c('0x22')](handleEntityNotFound(_0x395137,null))[_0x3b4c('0x22')](saveUpdates(_0x1e6cc9['body'],null))[_0x3b4c('0x22')](respondWithResult(_0x395137,null))[_0x3b4c('0x40')](handleError(_0x395137,null));};exports[_0x3b4c('0x23')]=function(_0x4b1eeb,_0x3cd858){return db['JscriptyAnswerReport'][_0x3b4c('0x42')]({'where':{'id':_0x4b1eeb[_0x3b4c('0x45')]['id']}})[_0x3b4c('0x22')](handleEntityNotFound(_0x3cd858,null))[_0x3b4c('0x22')](removeEntity(_0x3cd858,null))['catch'](handleError(_0x3cd858,null));};exports['describe']=function(_0x46d570,_0x270937){return db[_0x3b4c('0x29')][_0x3b4c('0x46')]()[_0x3b4c('0x22')](respondWithResult(_0x270937,null))['catch'](handleError(_0x270937,null));}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js index 602fd9a..c617e47 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 _0xc4ad=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./jscriptyAnswerReport.attributes','exports','JscriptyAnswerReport','report_jscripty_answers'];(function(_0x421e36,_0x18776e){var _0x20b3e3=function(_0x767de4){while(--_0x767de4){_0x421e36['push'](_0x421e36['shift']());}};_0x20b3e3(++_0x18776e);}(_0xc4ad,0xf7));var _0xdc4a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc4ad[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xdc4a('0x0'));var util=require(_0xdc4a('0x1'));var logger=require(_0xdc4a('0x2'))(_0xdc4a('0x3'));var moment=require(_0xdc4a('0x4'));var BPromise=require(_0xdc4a('0x5'));var rp=require(_0xdc4a('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xdc4a('0x7'));var config=require(_0xdc4a('0x8'));var attributes=require(_0xdc4a('0x9'));module[_0xdc4a('0xa')]=function(_0x4961dc,_0x48434d){return _0x4961dc['define'](_0xdc4a('0xb'),attributes,{'tableName':_0xdc4a('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5eec=['define','JscriptyAnswerReport','report_jscripty_answers','util','moment','bluebird','request-promise','path','../../config/environment','./jscriptyAnswerReport.attributes','exports'];(function(_0x299d68,_0x4d3629){var _0xa745b1=function(_0x144b56){while(--_0x144b56){_0x299d68['push'](_0x299d68['shift']());}};_0xa745b1(++_0x4d3629);}(_0x5eec,0x100));var _0xc5ee=function(_0x1456ba,_0x3a52e4){_0x1456ba=_0x1456ba-0x0;var _0x5bf023=_0x5eec[_0x1456ba];return _0x5bf023;};'use strict';var _=require('lodash');var util=require(_0xc5ee('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0xc5ee('0x1'));var BPromise=require(_0xc5ee('0x2'));var rp=require(_0xc5ee('0x3'));var fs=require('fs');var path=require(_0xc5ee('0x4'));var rimraf=require('rimraf');var config=require(_0xc5ee('0x5'));var attributes=require(_0xc5ee('0x6'));module[_0xc5ee('0x7')]=function(_0x5ec980,_0x3f405c){return _0x5ec980[_0xc5ee('0x8')](_0xc5ee('0x9'),attributes,{'tableName':_0xc5ee('0xa'),'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 bcd24a4..8becd6f 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 _0xe386=['error','code','JscriptyAnswerReport,\x20%s,\x20%s','message','info','result','catch','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','request\x20sent','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x1b7368,_0x3286ed){var _0x25d54c=function(_0x2366da){while(--_0x2366da){_0x1b7368['push'](_0x1b7368['shift']());}};_0x25d54c(++_0x3286ed);}(_0xe386,0xbf));var _0x6e38=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0xe386[_0x2c91e9];return _0x13f0ff;};'use strict';var _=require('lodash');var util=require(_0x6e38('0x0'));var moment=require(_0x6e38('0x1'));var BPromise=require(_0x6e38('0x2'));var rs=require(_0x6e38('0x3'));var fs=require('fs');var Redis=require(_0x6e38('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x6e38('0x5'));var logger=require(_0x6e38('0x6'))(_0x6e38('0x7'));var config=require(_0x6e38('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x6e38('0x9')][_0x6e38('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x43cc2f,_0x27db01,_0x1a086f){return new BPromise(function(_0x5b698b,_0x241bdf){return client[_0x6e38('0xb')](_0x43cc2f,_0x1a086f)['then'](function(_0x501ae5){logger['info']('JscriptyAnswerReport,\x20%s,\x20%s',_0x27db01,_0x6e38('0xc'));logger[_0x6e38('0xd')](_0x6e38('0xe'),_0x27db01,_0x6e38('0xc'),JSON[_0x6e38('0xf')](_0x501ae5));if(_0x501ae5[_0x6e38('0x10')]){if(_0x501ae5[_0x6e38('0x10')][_0x6e38('0x11')]===0x1f4){logger[_0x6e38('0x10')](_0x6e38('0x12'),_0x27db01,_0x501ae5['error'][_0x6e38('0x13')]);return _0x241bdf(_0x501ae5[_0x6e38('0x10')][_0x6e38('0x13')]);}logger[_0x6e38('0x10')](_0x6e38('0x12'),_0x27db01,_0x501ae5[_0x6e38('0x10')][_0x6e38('0x13')]);return _0x5b698b(_0x501ae5['error'][_0x6e38('0x13')]);}else{logger[_0x6e38('0x14')](_0x6e38('0x12'),_0x27db01,_0x6e38('0xc'));_0x5b698b(_0x501ae5[_0x6e38('0x15')]['message']);}})[_0x6e38('0x16')](function(_0x5f1fe5){logger['error'](_0x6e38('0x12'),_0x27db01,_0x5f1fe5);_0x241bdf(_0x5f1fe5);});});} \ No newline at end of file +var _0xee0e=['randomstring','../../config/utils','../../config/logger','jayson/promise','request','then','info','request\x20sent','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','stringify','error','code','JscriptyAnswerReport,\x20%s,\x20%s','message','catch','lodash','moment'];(function(_0xc67404,_0xdaafb0){var _0x166ea9=function(_0x159bb9){while(--_0x159bb9){_0xc67404['push'](_0xc67404['shift']());}};_0x166ea9(++_0xdaafb0);}(_0xee0e,0x178));var _0xeee0=function(_0x52e68e,_0x309912){_0x52e68e=_0x52e68e-0x0;var _0x3211a4=_0xee0e[_0x52e68e];return _0x3211a4;};'use strict';var _=require(_0xeee0('0x0'));var util=require('util');var moment=require(_0xeee0('0x1'));var BPromise=require('bluebird');var rs=require(_0xeee0('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xeee0('0x3'));var logger=require(_0xeee0('0x4'))('rpc');var config=require('../../config/environment');var jayson=require(_0xeee0('0x5'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5dc505,_0x1058b2,_0xa4b2f2){return new BPromise(function(_0x2f428f,_0x1a73e7){return client[_0xeee0('0x6')](_0x5dc505,_0xa4b2f2)[_0xeee0('0x7')](function(_0xbb3459){logger[_0xeee0('0x8')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x1058b2,_0xeee0('0x9'));logger[_0xeee0('0xa')](_0xeee0('0xb'),_0x1058b2,'request\x20sent',JSON[_0xeee0('0xc')](_0xbb3459));if(_0xbb3459[_0xeee0('0xd')]){if(_0xbb3459[_0xeee0('0xd')][_0xeee0('0xe')]===0x1f4){logger[_0xeee0('0xd')](_0xeee0('0xf'),_0x1058b2,_0xbb3459[_0xeee0('0xd')]['message']);return _0x1a73e7(_0xbb3459['error']['message']);}logger[_0xeee0('0xd')](_0xeee0('0xf'),_0x1058b2,_0xbb3459['error'][_0xeee0('0x10')]);return _0x2f428f(_0xbb3459['error'][_0xeee0('0x10')]);}else{logger['info'](_0xeee0('0xf'),_0x1058b2,_0xeee0('0x9'));_0x2f428f(_0xbb3459['result']['message']);}})[_0xeee0('0x11')](function(_0xe27e55){logger[_0xeee0('0xd')](_0xeee0('0xf'),_0x1058b2,_0xe27e55);_0x1a73e7(_0xe27e55);});});} \ No newline at end of file diff --git a/server/api/jscriptyProject/index.js b/server/api/jscriptyProject/index.js index 922bf30..c8e2e53 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 _0x792f=['/:id','isAuthenticated','show','/:id/sessions','getSessions','get','getAnswers','/:id/summary','getSummary','create','/:id/clone','update','delete','util','path','connect-timeout','express','Router','../../components/interaction/service','./jscriptyProject.controller','index'];(function(_0xf95fa9,_0x40bd42){var _0x52f579=function(_0x229c00){while(--_0x229c00){_0xf95fa9['push'](_0xf95fa9['shift']());}};_0x52f579(++_0x40bd42);}(_0x792f,0xca));var _0xf792=function(_0x4e6eb2,_0x16a451){_0x4e6eb2=_0x4e6eb2-0x0;var _0x4e0c1c=_0x792f[_0x4e6eb2];return _0x4e0c1c;};'use strict';var multer=require('multer');var util=require(_0xf792('0x0'));var path=require(_0xf792('0x1'));var timeout=require(_0xf792('0x2'));var express=require(_0xf792('0x3'));var router=express[_0xf792('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xf792('0x5'));var config=require('../../config/environment');var controller=require(_0xf792('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0xf792('0x7')]);router['get'](_0xf792('0x8'),auth[_0xf792('0x9')](),controller[_0xf792('0xa')]);router['get'](_0xf792('0xb'),auth[_0xf792('0x9')](),controller[_0xf792('0xc')]);router[_0xf792('0xd')]('/:id/answers',auth[_0xf792('0x9')](),controller[_0xf792('0xe')]);router[_0xf792('0xd')](_0xf792('0xf'),auth[_0xf792('0x9')](),timeout('30s'),controller[_0xf792('0x10')]);router['post']('/',auth[_0xf792('0x9')](),controller[_0xf792('0x11')]);router['post'](_0xf792('0x12'),auth[_0xf792('0x9')](),controller['clone']);router['put']('/:id',auth[_0xf792('0x9')](),controller[_0xf792('0x13')]);router[_0xf792('0x14')](_0xf792('0x8'),auth[_0xf792('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xed15=['get','/:id','show','/:id/sessions','getSessions','/:id/answers','getAnswers','getSummary','create','post','/:id/clone','clone','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','isAuthenticated'];(function(_0x415346,_0x440efe){var _0x28661c=function(_0x22f09e){while(--_0x22f09e){_0x415346['push'](_0x415346['shift']());}};_0x28661c(++_0x440efe);}(_0xed15,0x139));var _0x5ed1=function(_0x273c39,_0x1052e6){_0x273c39=_0x273c39-0x0;var _0x46d6b5=_0xed15[_0x273c39];return _0x46d6b5;};'use strict';var multer=require(_0x5ed1('0x0'));var util=require(_0x5ed1('0x1'));var path=require(_0x5ed1('0x2'));var timeout=require(_0x5ed1('0x3'));var express=require(_0x5ed1('0x4'));var router=express[_0x5ed1('0x5')]();var auth=require(_0x5ed1('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x5ed1('0x7'));var controller=require('./jscriptyProject.controller');router['get']('/',auth[_0x5ed1('0x8')](),controller['index']);router[_0x5ed1('0x9')](_0x5ed1('0xa'),auth[_0x5ed1('0x8')](),controller[_0x5ed1('0xb')]);router[_0x5ed1('0x9')](_0x5ed1('0xc'),auth[_0x5ed1('0x8')](),controller[_0x5ed1('0xd')]);router[_0x5ed1('0x9')](_0x5ed1('0xe'),auth[_0x5ed1('0x8')](),controller[_0x5ed1('0xf')]);router['get']('/:id/summary',auth['isAuthenticated'](),timeout('30s'),controller[_0x5ed1('0x10')]);router['post']('/',auth[_0x5ed1('0x8')](),controller[_0x5ed1('0x11')]);router[_0x5ed1('0x12')](_0x5ed1('0x13'),auth[_0x5ed1('0x8')](),controller[_0x5ed1('0x14')]);router['put'](_0x5ed1('0xa'),auth[_0x5ed1('0x8')](),controller['update']);router[_0x5ed1('0x15')]('/:id',auth[_0x5ed1('0x8')](),controller[_0x5ed1('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 e99d7c1..03601a4 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 _0x70ac=['description','sequelize','lodash','util','exports','STRING','name','TEXT','isObjectLike','setDataValue','formData','stringify','isString','format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue'];(function(_0x3054be,_0x1bdc8b){var _0x3df150=function(_0x56cfbf){while(--_0x56cfbf){_0x3054be['push'](_0x3054be['shift']());}};_0x3df150(++_0x1bdc8b);}(_0x70ac,0x91));var _0xc70a=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0x70ac[_0x56482c];return _0x5aae7a;};'use strict';var Sequelize=require(_0xc70a('0x0'));var _=require(_0xc70a('0x1'));var util=require(_0xc70a('0x2'));module[_0xc70a('0x3')]={'name':{'type':Sequelize[_0xc70a('0x4')],'unique':_0xc70a('0x5')},'description':{'type':Sequelize[_0xc70a('0x4')]},'formData':{'type':Sequelize[_0xc70a('0x6')]('long'),'set':function(_0x24410e){if(_[_0xc70a('0x7')](_0x24410e)){this[_0xc70a('0x8')](_0xc70a('0x9'),JSON[_0xc70a('0xa')](_0x24410e));}else if(_[_0xc70a('0xb')](_0x24410e)){this[_0xc70a('0x8')]('formData',_0x24410e);}else{this['setDataValue'](_0xc70a('0x9'),util[_0xc70a('0xc')](_0xc70a('0xd'),this[_0xc70a('0xe')](_0xc70a('0x5'))||'',this[_0xc70a('0xe')](_0xc70a('0xf'))||''));}}},'enableUncompleteSave':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file +var _0x2ea3=['util','exports','STRING','long','setDataValue','formData','stringify','isString','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','description','sequelize'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x2ea3,0x14f));var _0x32ea=function(_0x283522,_0x3d2514){_0x283522=_0x283522-0x0;var _0xdb2b03=_0x2ea3[_0x283522];return _0xdb2b03;};'use strict';var Sequelize=require(_0x32ea('0x0'));var _=require('lodash');var util=require(_0x32ea('0x1'));module[_0x32ea('0x2')]={'name':{'type':Sequelize[_0x32ea('0x3')],'unique':'name'},'description':{'type':Sequelize[_0x32ea('0x3')]},'formData':{'type':Sequelize['TEXT'](_0x32ea('0x4')),'set':function(_0x4a45c9){if(_['isObjectLike'](_0x4a45c9)){this[_0x32ea('0x5')](_0x32ea('0x6'),JSON[_0x32ea('0x7')](_0x4a45c9));}else if(_[_0x32ea('0x8')](_0x4a45c9)){this['setDataValue']('formData',_0x4a45c9);}else{this[_0x32ea('0x5')](_0x32ea('0x6'),util['format'](_0x32ea('0x9'),this[_0x32ea('0xa')]('name')||'',this[_0x32ea('0xa')](_0x32ea('0xb'))||''));}}},'enableUncompleteSave':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.controller.js b/server/api/jscriptyProject/jscriptyProject.controller.js index bb50e77..66a3d70 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 _0x57ea=['YYYY-MM-DD\x20HH:mm:ss','answer','isEmpty','now','/tmp/Jscripty_Project_%d_Summary_%s.csv','Content-disposition','attachment;\x20filename=','Jscripty_Project_%d_Summary_%s.csv','setHeader','text/csv','download','html-pdf','eml-format','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','Projects','UserProfileResource','error','name','send','index','rawAttributes','query','filters','intersection','model','attributes','fields','length','offset','order','sort','where','pick','filter','merge','type','key','VIRTUAL','options','count','includeAll','include','JscriptyProject','findAll','rows','catch','show','params','keys','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','createdAt','updatedAt','omit','body','getSessions','hasOwnProperty','nolimit','ProjectId','map','JscriptySessionReport','getAnswers','JscriptyAnswerReport','number','fromCharCode','indexOf','toString','replace','getSummary','starttime','parse','JscriptyQuestionReport','questionId','question','format'];(function(_0x2d1d41,_0x9d77a1){var _0x324f72=function(_0x576803){while(--_0x576803){_0x2d1d41['push'](_0x2d1d41['shift']());}};_0x324f72(++_0x9d77a1);}(_0x57ea,0x1e3));var _0xa57e=function(_0x448f50,_0x5587ba){_0x448f50=_0x448f50-0x0;var _0x2af4c3=_0x57ea[_0x448f50];return _0x2af4c3;};'use strict';var pdf=require(_0xa57e('0x0'));var emlformat=require(_0xa57e('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xa57e('0x2'));var jsonpatch=require(_0xa57e('0x3'));var rp=require('request-promise');var moment=require(_0xa57e('0x4'));var BPromise=require(_0xa57e('0x5'));var Mustache=require('mustache');var util=require(_0xa57e('0x6'));var path=require(_0xa57e('0x7'));var sox=require(_0xa57e('0x8'));var csv=require(_0xa57e('0x9'));var ejs=require(_0xa57e('0xa'));var fs=require('fs');var _=require(_0xa57e('0xb'));var squel=require(_0xa57e('0xc'));var crypto=require(_0xa57e('0xd'));var jsforce=require(_0xa57e('0xe'));var deskjs=require(_0xa57e('0xf'));var toCsv=require(_0xa57e('0x9'));var querystring=require(_0xa57e('0x10'));var Papa=require('papaparse');var Redis=require(_0xa57e('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xa57e('0x12'));var hardwareService=require(_0xa57e('0x13'));var logger=require('../../config/logger')(_0xa57e('0x14'));var utils=require(_0xa57e('0x15'));var config=require(_0xa57e('0x16'));var db=require(_0xa57e('0x17'))['db'];function respondWithStatusCode(_0x19c0fd,_0x49383f){_0x49383f=_0x49383f||0xcc;return function(_0x2bd103){if(_0x2bd103){return _0x19c0fd[_0xa57e('0x18')](_0x49383f);}return _0x19c0fd[_0xa57e('0x19')](_0x49383f)[_0xa57e('0x1a')]();};}function respondWithResult(_0x403695,_0x196198){_0x196198=_0x196198||0xc8;return function(_0xdd3776){if(_0xdd3776){return _0x403695[_0xa57e('0x19')](_0x196198)[_0xa57e('0x1b')](_0xdd3776);}};}function respondWithFilteredResult(_0x316363,_0x478c2d){return function(_0x490fdf){if(_0x490fdf){var _0x49b70d=_0x490fdf['count'],_0x221add=_0x478c2d['offset'],_0x3ecf58=_0x478c2d['offset']+_0x478c2d[_0xa57e('0x1c')],_0xd8aa19;if(_0x3ecf58>=_0x49b70d){_0x3ecf58=_0x49b70d;_0xd8aa19=0xc8;}else{_0xd8aa19=0xce;}_0x316363[_0xa57e('0x19')](_0xd8aa19);return _0x316363[_0xa57e('0x1d')](_0xa57e('0x1e'),_0x221add+'-'+_0x3ecf58+'/'+_0x49b70d)[_0xa57e('0x1b')](_0x490fdf);}return null;};}function patchUpdates(_0x3e8fd6){return function(_0x32a981){try{jsonpatch[_0xa57e('0x1f')](_0x32a981,_0x3e8fd6,!![]);}catch(_0x50762c){return BPromise[_0xa57e('0x20')](_0x50762c);}return _0x32a981[_0xa57e('0x21')]();};}function saveUpdates(_0x440962,_0x3adb0c){return function(_0x27c45d){if(_0x27c45d){return _0x27c45d[_0xa57e('0x22')](_0x440962)[_0xa57e('0x23')](function(_0x36d0a7){return _0x36d0a7;});}return null;};}function removeEntity(_0x19d63e,_0x5c1902){return function(_0x1f7514){if(_0x1f7514){return _0x1f7514[_0xa57e('0x24')]()['then'](function(){var _0x3861c7=_0x1f7514[_0xa57e('0x25')]({'plain':!![]});var _0x4f01f6=_0xa57e('0x26');return db[_0xa57e('0x27')][_0xa57e('0x24')]({'where':{'type':_0x4f01f6,'resourceId':_0x3861c7['id']}})[_0xa57e('0x23')](function(){return _0x1f7514;});})[_0xa57e('0x23')](function(){_0x19d63e[_0xa57e('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1d4ca1,_0x320bc8){return function(_0x346290){if(!_0x346290){_0x1d4ca1[_0xa57e('0x18')](0x194);}return _0x346290;};}function handleError(_0x373454,_0x5bdf92){_0x5bdf92=_0x5bdf92||0x1f4;return function(_0x25a15d){logger[_0xa57e('0x28')](_0x25a15d['stack']);if(_0x25a15d['name']){delete _0x25a15d[_0xa57e('0x29')];}_0x373454[_0xa57e('0x19')](_0x5bdf92)[_0xa57e('0x2a')](_0x25a15d);};}exports[_0xa57e('0x2b')]=function(_0x9acb29,_0x1037fa){var _0x1b6b9c={},_0x30443f={},_0x281beb={'count':0x0,'rows':[]};var _0x43ce64=db['JscriptyProject'][_0xa57e('0x2c')];_0x30443f['model']=_['keys'](_0x43ce64);_0x30443f[_0xa57e('0x2d')]=_['keys'](_0x9acb29[_0xa57e('0x2d')]);_0x30443f[_0xa57e('0x2e')]=_[_0xa57e('0x2f')](_0x30443f[_0xa57e('0x30')],_0x30443f[_0xa57e('0x2d')]);_0x1b6b9c[_0xa57e('0x31')]=_[_0xa57e('0x2f')](_0x30443f[_0xa57e('0x30')],qs[_0xa57e('0x32')](_0x9acb29[_0xa57e('0x2d')]['fields']));_0x1b6b9c[_0xa57e('0x31')]=_0x1b6b9c['attributes'][_0xa57e('0x33')]?_0x1b6b9c['attributes']:_0x30443f[_0xa57e('0x30')];if(!_0x9acb29[_0xa57e('0x2d')]['hasOwnProperty']('nolimit')){_0x1b6b9c[_0xa57e('0x1c')]=qs[_0xa57e('0x1c')](_0x9acb29[_0xa57e('0x2d')]['limit']);_0x1b6b9c[_0xa57e('0x34')]=qs[_0xa57e('0x34')](_0x9acb29[_0xa57e('0x2d')]['offset']);}_0x1b6b9c[_0xa57e('0x35')]=qs[_0xa57e('0x36')](_0x9acb29[_0xa57e('0x2d')][_0xa57e('0x36')]);_0x1b6b9c[_0xa57e('0x37')]=qs[_0xa57e('0x2e')](_[_0xa57e('0x38')](_0x9acb29[_0xa57e('0x2d')],_0x30443f[_0xa57e('0x2e')]));if(_0x9acb29[_0xa57e('0x2d')][_0xa57e('0x39')]){_0x1b6b9c[_0xa57e('0x37')]=_[_0xa57e('0x3a')](_0x1b6b9c[_0xa57e('0x37')],{'$or':_['map'](_0x43ce64,function(_0x3beaf4){if(_0x3beaf4[_0xa57e('0x3b')][_0xa57e('0x3c')]!==_0xa57e('0x3d')){var _0x6a9c2d={};_0x6a9c2d[_0x3beaf4['field']]={'$like':'%'+_0x9acb29[_0xa57e('0x2d')]['filter']+'%'};return _0x6a9c2d;}})});}_0x1b6b9c=_[_0xa57e('0x3a')]({},_0x1b6b9c,_0x9acb29[_0xa57e('0x3e')]);var _0x103109={'where':_0x1b6b9c[_0xa57e('0x37')]};return db['JscriptyProject'][_0xa57e('0x3f')](_0x103109)[_0xa57e('0x23')](function(_0x3a2aef){_0x281beb[_0xa57e('0x3f')]=_0x3a2aef;if(_0x9acb29['query'][_0xa57e('0x40')]){_0x1b6b9c[_0xa57e('0x41')]=[{'all':!![]}];}return db[_0xa57e('0x42')][_0xa57e('0x43')](_0x1b6b9c);})[_0xa57e('0x23')](function(_0x5b1022){_0x281beb[_0xa57e('0x44')]=_0x5b1022;return _0x281beb;})[_0xa57e('0x23')](respondWithFilteredResult(_0x1037fa,_0x1b6b9c))[_0xa57e('0x45')](handleError(_0x1037fa,null));};exports[_0xa57e('0x46')]=function(_0x4a4474,_0x398b4f){var _0x34335b={'raw':![],'where':{'id':_0x4a4474[_0xa57e('0x47')]['id']}},_0x2cf61d={};_0x2cf61d['model']=_[_0xa57e('0x48')](db[_0xa57e('0x42')][_0xa57e('0x2c')]);_0x2cf61d[_0xa57e('0x2d')]=_['keys'](_0x4a4474[_0xa57e('0x2d')]);_0x2cf61d[_0xa57e('0x2e')]=_[_0xa57e('0x2f')](_0x2cf61d[_0xa57e('0x30')],_0x2cf61d[_0xa57e('0x2d')]);_0x34335b[_0xa57e('0x31')]=_[_0xa57e('0x2f')](_0x2cf61d[_0xa57e('0x30')],qs[_0xa57e('0x32')](_0x4a4474['query']['fields']));_0x34335b[_0xa57e('0x31')]=_0x34335b[_0xa57e('0x31')][_0xa57e('0x33')]?_0x34335b[_0xa57e('0x31')]:_0x2cf61d[_0xa57e('0x30')];if(_0x4a4474[_0xa57e('0x2d')][_0xa57e('0x40')]){_0x34335b['include']=[{'all':!![]}];}_0x34335b=_[_0xa57e('0x3a')]({},_0x34335b,_0x4a4474[_0xa57e('0x3e')]);return db['JscriptyProject']['find'](_0x34335b)['then'](handleEntityNotFound(_0x398b4f,null))[_0xa57e('0x23')](respondWithResult(_0x398b4f,null))['catch'](handleError(_0x398b4f,null));};exports[_0xa57e('0x49')]=function(_0x3206ba,_0x3c9b68){return db['JscriptyProject'][_0xa57e('0x49')](_0x3206ba['body'],{})[_0xa57e('0x23')](function(_0x13ec77){var _0x3e6682=_0x3206ba[_0xa57e('0x4a')][_0xa57e('0x25')]({'plain':!![]});if(!_0x3e6682)throw new Error(_0xa57e('0x4b'));if(_0x3e6682[_0xa57e('0x4c')]===_0xa57e('0x4a')){var _0x1b2699=_0x13ec77['get']({'plain':!![]});var _0x162551=_0xa57e('0x26');return db[_0xa57e('0x4d')][_0xa57e('0x4e')]({'where':{'name':_0x162551,'userProfileId':_0x3e6682[_0xa57e('0x4f')]},'raw':!![]})[_0xa57e('0x23')](function(_0x3e972e){if(_0x3e972e&&_0x3e972e[_0xa57e('0x50')]===0x0){return db['UserProfileResource'][_0xa57e('0x49')]({'name':_0x1b2699[_0xa57e('0x29')],'resourceId':_0x1b2699['id'],'type':_0x3e972e[_0xa57e('0x29')],'sectionId':_0x3e972e['id']},{})['then'](function(){return _0x13ec77;});}else{return _0x13ec77;}})['catch'](function(_0x2c9ae3){logger[_0xa57e('0x28')](_0xa57e('0x51'),_0x2c9ae3);throw _0x2c9ae3;});}return _0x13ec77;})['then'](respondWithResult(_0x3c9b68,0xc9))[_0xa57e('0x45')](handleError(_0x3c9b68,null));};exports[_0xa57e('0x52')]=function(_0x247acb,_0x1df233){var _0x2fb8f5={'raw':![],'where':{'id':_0x247acb[_0xa57e('0x47')]['id']}},_0x2eb728={};_0x2eb728[_0xa57e('0x30')]=_['keys'](db[_0xa57e('0x42')][_0xa57e('0x2c')]);_0x2fb8f5[_0xa57e('0x31')]=_[_0xa57e('0x2f')](_0x2eb728[_0xa57e('0x30')],qs[_0xa57e('0x32')](_0x247acb['query'][_0xa57e('0x32')]));_0x2fb8f5['attributes']=_0x2fb8f5[_0xa57e('0x31')][_0xa57e('0x33')]?_0x2fb8f5[_0xa57e('0x31')]:_0x2eb728[_0xa57e('0x30')];if(_0x247acb['query'][_0xa57e('0x40')]){_0x2fb8f5[_0xa57e('0x41')]=[{'all':!![]}];}_0x2fb8f5=_[_0xa57e('0x3a')]({},_0x2fb8f5,_0x247acb[_0xa57e('0x3e')]);return db['JscriptyProject'][_0xa57e('0x4e')](_0x2fb8f5)['then'](handleEntityNotFound(_0x1df233,null))[_0xa57e('0x23')](function(_0x555419){if(_0x555419){var _0x4a9c82=_0x555419[_0xa57e('0x25')]({'plain':!![]});_0x4a9c82=qs['omit'](_0x4a9c82,['id',_0xa57e('0x53'),_0xa57e('0x54')]);_0x247acb['body']=_[_0xa57e('0x55')](_0x247acb[_0xa57e('0x56')],['id',_0xa57e('0x53'),_0xa57e('0x54')]);return db['JscriptyProject'][_0xa57e('0x49')](_[_0xa57e('0x3a')](_0x4a9c82,_0x247acb[_0xa57e('0x56')]),{'include':_0x247acb[_0xa57e('0x2d')][_0xa57e('0x40')]?[{'all':!![]}]:undefined})[_0xa57e('0x23')](function(_0x50fa1c){var _0x2e3b8c=_0x247acb[_0xa57e('0x4a')][_0xa57e('0x25')]({'plain':!![]});if(!_0x2e3b8c)throw new Error(_0xa57e('0x4b'));if(_0x2e3b8c[_0xa57e('0x4c')]===_0xa57e('0x4a')){var _0x4da997=_0x50fa1c[_0xa57e('0x25')]({'plain':!![]});var _0x2df640='Projects';return db[_0xa57e('0x4d')][_0xa57e('0x4e')]({'where':{'name':_0x2df640,'userProfileId':_0x2e3b8c[_0xa57e('0x4f')]},'raw':!![]})[_0xa57e('0x23')](function(_0x5a2c0){if(_0x5a2c0&&_0x5a2c0[_0xa57e('0x50')]===0x0){return db[_0xa57e('0x27')][_0xa57e('0x49')]({'name':_0x4da997[_0xa57e('0x29')],'resourceId':_0x4da997['id'],'type':_0x5a2c0[_0xa57e('0x29')],'sectionId':_0x5a2c0['id']},{})[_0xa57e('0x23')](function(){return _0x50fa1c;});}else{return _0x50fa1c;}})['catch'](function(_0x5e3aae){logger[_0xa57e('0x28')](_0xa57e('0x51'),_0x5e3aae);throw _0x5e3aae;});}return _0x50fa1c;});}})['then'](respondWithResult(_0x1df233,0xc9))[_0xa57e('0x45')](handleError(_0x1df233,null));};exports[_0xa57e('0x22')]=function(_0x4ee63e,_0x295cb8){if(_0x4ee63e[_0xa57e('0x56')]['id']){delete _0x4ee63e[_0xa57e('0x56')]['id'];}return db['JscriptyProject']['find']({'where':{'id':_0x4ee63e['params']['id']}})['then'](handleEntityNotFound(_0x295cb8,null))[_0xa57e('0x23')](saveUpdates(_0x4ee63e[_0xa57e('0x56')],null))[_0xa57e('0x23')](respondWithResult(_0x295cb8,null))[_0xa57e('0x45')](handleError(_0x295cb8,null));};exports[_0xa57e('0x24')]=function(_0x10436f,_0x1f26a8){return db[_0xa57e('0x42')][_0xa57e('0x4e')]({'where':{'id':_0x10436f[_0xa57e('0x47')]['id']}})[_0xa57e('0x23')](handleEntityNotFound(_0x1f26a8,null))[_0xa57e('0x23')](removeEntity(_0x1f26a8,null))[_0xa57e('0x45')](handleError(_0x1f26a8,null));};exports[_0xa57e('0x57')]=function(_0x5c2651,_0x4398ea,_0x3af9ae){var _0x58823e={'raw':!![],'where':{}};var _0x4c78f9={};var _0x20026f={'count':0x0,'rows':[]};return db[_0xa57e('0x42')]['findOne']({'where':{'id':_0x5c2651[_0xa57e('0x47')]['id']}})['then'](handleEntityNotFound(_0x4398ea,null))[_0xa57e('0x23')](function(_0x3f5594){if(_0x3f5594){_0x4c78f9[_0xa57e('0x30')]=_[_0xa57e('0x48')](db['JscriptySessionReport'][_0xa57e('0x2c')]);_0x4c78f9[_0xa57e('0x2d')]=_[_0xa57e('0x48')](_0x5c2651[_0xa57e('0x2d')]);_0x4c78f9['filters']=_[_0xa57e('0x2f')](_0x4c78f9[_0xa57e('0x30')],_0x4c78f9[_0xa57e('0x2d')]);_0x58823e[_0xa57e('0x31')]=_[_0xa57e('0x2f')](_0x4c78f9[_0xa57e('0x30')],qs[_0xa57e('0x32')](_0x5c2651[_0xa57e('0x2d')][_0xa57e('0x32')]));_0x58823e[_0xa57e('0x31')]=_0x58823e[_0xa57e('0x31')][_0xa57e('0x33')]?_0x58823e[_0xa57e('0x31')]:_0x4c78f9[_0xa57e('0x30')];if(!_0x5c2651[_0xa57e('0x2d')][_0xa57e('0x58')](_0xa57e('0x59'))){_0x58823e[_0xa57e('0x1c')]=qs['limit'](_0x5c2651[_0xa57e('0x2d')]['limit']);_0x58823e[_0xa57e('0x34')]=qs[_0xa57e('0x34')](_0x5c2651[_0xa57e('0x2d')][_0xa57e('0x34')]);}_0x58823e['order']=qs['sort'](_0x5c2651['query'][_0xa57e('0x36')]);_0x58823e['where']=qs['filters'](_[_0xa57e('0x38')](_0x5c2651[_0xa57e('0x2d')],_0x4c78f9[_0xa57e('0x2e')]));_0x58823e[_0xa57e('0x37')][_0xa57e('0x5a')]=_0x3f5594['id'];if(_0x5c2651[_0xa57e('0x2d')][_0xa57e('0x39')]){_0x58823e[_0xa57e('0x37')]=_[_0xa57e('0x3a')](_0x58823e['where'],{'$or':_[_0xa57e('0x5b')](_0x58823e[_0xa57e('0x31')],function(_0x1a5dfb){var _0x2da533={};_0x2da533[_0x1a5dfb]={'$like':'%'+_0x5c2651['query'][_0xa57e('0x39')]+'%'};return _0x2da533;})});}_0x58823e=_[_0xa57e('0x3a')]({},_0x58823e,_0x5c2651[_0xa57e('0x3e')]);return db[_0xa57e('0x5c')][_0xa57e('0x3f')]({'where':_0x58823e[_0xa57e('0x37')]})[_0xa57e('0x23')](function(_0x5d711e){_0x20026f[_0xa57e('0x3f')]=_0x5d711e;if(_0x5c2651['query'][_0xa57e('0x40')]){_0x58823e[_0xa57e('0x41')]=[{'all':!![]}];}return db[_0xa57e('0x5c')][_0xa57e('0x43')](_0x58823e);})[_0xa57e('0x23')](function(_0x33fe6e){_0x20026f['rows']=_0x33fe6e;return _0x20026f;});}})[_0xa57e('0x23')](respondWithFilteredResult(_0x4398ea,_0x58823e))[_0xa57e('0x45')](handleError(_0x4398ea,null));};exports[_0xa57e('0x5d')]=function(_0x3a2ca8,_0x18eed7,_0x30f73b){var _0x237032={'raw':!![],'where':{}};var _0x20841f={};var _0x129883={'count':0x0,'rows':[]};return db[_0xa57e('0x42')]['findOne']({'where':{'id':_0x3a2ca8[_0xa57e('0x47')]['id']}})['then'](handleEntityNotFound(_0x18eed7,null))['then'](function(_0x55a884){if(_0x55a884){_0x20841f[_0xa57e('0x30')]=_[_0xa57e('0x48')](db[_0xa57e('0x5e')][_0xa57e('0x2c')]);_0x20841f[_0xa57e('0x2d')]=_[_0xa57e('0x48')](_0x3a2ca8[_0xa57e('0x2d')]);_0x20841f[_0xa57e('0x2e')]=_['intersection'](_0x20841f[_0xa57e('0x30')],_0x20841f['query']);_0x237032[_0xa57e('0x31')]=_['intersection'](_0x20841f[_0xa57e('0x30')],qs[_0xa57e('0x32')](_0x3a2ca8[_0xa57e('0x2d')][_0xa57e('0x32')]));_0x237032[_0xa57e('0x31')]=_0x237032[_0xa57e('0x31')][_0xa57e('0x33')]?_0x237032[_0xa57e('0x31')]:_0x20841f[_0xa57e('0x30')];if(!_0x3a2ca8[_0xa57e('0x2d')][_0xa57e('0x58')](_0xa57e('0x59'))){_0x237032[_0xa57e('0x1c')]=qs['limit'](_0x3a2ca8[_0xa57e('0x2d')][_0xa57e('0x1c')]);_0x237032[_0xa57e('0x34')]=qs[_0xa57e('0x34')](_0x3a2ca8[_0xa57e('0x2d')][_0xa57e('0x34')]);}_0x237032[_0xa57e('0x35')]=qs['sort'](_0x3a2ca8['query'][_0xa57e('0x36')]);_0x237032[_0xa57e('0x37')]=qs[_0xa57e('0x2e')](_['pick'](_0x3a2ca8[_0xa57e('0x2d')],_0x20841f[_0xa57e('0x2e')]));_0x237032[_0xa57e('0x37')]['ProjectId']=_0x55a884['id'];if(_0x3a2ca8['query'][_0xa57e('0x39')]){_0x237032[_0xa57e('0x37')]=_[_0xa57e('0x3a')](_0x237032[_0xa57e('0x37')],{'$or':_['map'](_0x237032[_0xa57e('0x31')],function(_0x197269){var _0x5c94f9={};_0x5c94f9[_0x197269]={'$like':'%'+_0x3a2ca8[_0xa57e('0x2d')][_0xa57e('0x39')]+'%'};return _0x5c94f9;})});}_0x237032=_[_0xa57e('0x3a')]({},_0x237032,_0x3a2ca8['options']);return db[_0xa57e('0x5e')][_0xa57e('0x3f')]({'where':_0x237032[_0xa57e('0x37')]})['then'](function(_0x560190){_0x129883['count']=_0x560190;if(_0x3a2ca8['query'][_0xa57e('0x40')]){_0x237032['include']=[{'all':!![]}];}return db['JscriptyAnswerReport'][_0xa57e('0x43')](_0x237032);})[_0xa57e('0x23')](function(_0x1b7bfe){_0x129883[_0xa57e('0x44')]=_0x1b7bfe;return _0x129883;});}})[_0xa57e('0x23')](respondWithFilteredResult(_0x18eed7,_0x237032))['catch'](handleError(_0x18eed7,null));};function char(_0x52836c){return _0xa57e('0x5f')===typeof _0x52836c?String[_0xa57e('0x60')][_0xa57e('0x1f')](null,arguments):_0x52836c;}function needsEncapsulation(_0x514285){return!!_0x514285&&(_0x514285['toString']()[_0xa57e('0x61')](char(0xd))>=0x0||_0x514285['toString']()['indexOf'](char(0xa))>=0x0||_0x514285[_0xa57e('0x62')]()[_0xa57e('0x61')](char(0x2c))>=0x0||_0x514285[_0xa57e('0x62')]()[_0xa57e('0x61')](char(0x22))>=0x0);}function encapsulate(_0x1ed5f9){var _0x1b1973=char(0x22),_0x467600='\x5c'+char(0x22),_0x13d53b=_0x1ed5f9[_0xa57e('0x62')]()[_0xa57e('0x63')](new RegExp(_0x1b1973,'g'),_0x467600);return _0x1b1973+_0x13d53b+_0x1b1973;}exports[_0xa57e('0x64')]=function(_0x475d80,_0x1f111d,_0x48a0ab){var _0x64938b,_0x4d731b;var _0x12d183={'where':{'ProjectId':_0x475d80[_0xa57e('0x47')]['id']}};if(_0x475d80['query']['startTime']){_0x12d183[_0xa57e('0x37')][_0xa57e('0x65')]=JSON[_0xa57e('0x66')](_0x475d80['query']['startTime']);}return db[_0xa57e('0x5c')]['findAll'](_0x12d183)['then'](handleEntityNotFound(_0x1f111d,null))['then'](function(_0x5e0cd0){if(_0x5e0cd0){_0x64938b=_0x5e0cd0;return db[_0xa57e('0x67')][_0xa57e('0x43')]({'where':{'SessionId':{'$in':_['map'](_0x64938b,'id')},'ProjectId':_0x475d80['params']['id']},'order':'-createdAt'});}})[_0xa57e('0x23')](handleEntityNotFound(_0x1f111d,null))[_0xa57e('0x23')](function(_0x594e41){if(_0x594e41){_0x4d731b=_0x594e41;var _0x4c0749={};for(var _0x4cc572=0x0,_0x510cea=_0x4d731b[_0xa57e('0x33')];_0x4cc572<_0x510cea;_0x4cc572++){if(!_0x4c0749[_0xa57e('0x58')](_0x4d731b[_0x4cc572][_0xa57e('0x68')])){_0x4c0749[_0x4d731b[_0x4cc572][_0xa57e('0x68')]]=needsEncapsulation(_0x4d731b[_0x4cc572][_0xa57e('0x69')])?encapsulate(_0x4d731b[_0x4cc572]['question']):_0x4d731b[_0x4cc572][_0xa57e('0x69')];}}var _0x3dd455=[],_0x3a8cf9={};for(var _0x3eb8f8=0x0,_0x5cbf07=_0x64938b[_0xa57e('0x33')];_0x3eb8f8<_0x5cbf07;_0x3eb8f8++){_0x3a8cf9={'ProjectId':_0x475d80[_0xa57e('0x47')]['id'],'SessionId':_0x64938b[_0x3eb8f8]['id'],'StartTime':moment(_0x64938b[_0x3eb8f8]['starttime'])[_0xa57e('0x6a')](_0xa57e('0x6b'))};for(var _0x1a6d7f=0x0,_0x2298f5=_0x4d731b[_0xa57e('0x33')];_0x1a6d7f<_0x2298f5;_0x1a6d7f++){if(_0x4d731b[_0x1a6d7f]['SessionId']==_0x64938b[_0x3eb8f8]['id']&&_0x4c0749[_0xa57e('0x58')](_0x4d731b[_0x1a6d7f]['questionId'])){_0x3a8cf9[_0x4c0749[_0x4d731b[_0x1a6d7f][_0xa57e('0x68')]]]=_0x4d731b[_0x1a6d7f][_0xa57e('0x6c')];}}for(var _0x594971 in _0x4c0749){if(!_0x3a8cf9[_0xa57e('0x58')](_0x4c0749[_0x594971])){_0x3a8cf9[_0x4c0749[_0x594971]]=null;}}_0x3dd455['push'](_0x3a8cf9);}return _0x3dd455;}})[_0xa57e('0x23')](function(_0x551e44){if(!_[_0xa57e('0x6d')](_0x551e44)){var _0x4450ff=toCsv(_0x551e44);var _0x38227c=Date[_0xa57e('0x6e')]();fs['writeFileSync'](util[_0xa57e('0x6a')](_0xa57e('0x6f'),_0x475d80[_0xa57e('0x47')]['id'],_0x38227c),_0x4450ff);_0x1f111d['setHeader'](_0xa57e('0x70'),_0xa57e('0x71')+util[_0xa57e('0x6a')](_0xa57e('0x72'),_0x475d80[_0xa57e('0x47')]['id'],_0x38227c));_0x1f111d[_0xa57e('0x73')]('Content-type',_0xa57e('0x74'));return _0x1f111d[_0xa57e('0x75')](util['format'](_0xa57e('0x6f'),_0x475d80[_0xa57e('0x47')]['id'],_0x38227c));}else{return _0x1f111d[_0xa57e('0x18')](0xcc);}})[_0xa57e('0x45')](handleError(_0x1f111d,null));}; \ No newline at end of file +var _0xb915=['/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','Jscripty_Project_%d_Summary_%s.csv','Content-type','download','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','then','Projects','UserProfileResource','stack','name','index','JscriptyProject','rawAttributes','keys','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','type','key','VIRTUAL','field','merge','include','findAll','rows','catch','show','params','includeAll','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','options','omit','createdAt','updatedAt','error','getSessions','findOne','ProjectId','JscriptySessionReport','getAnswers','JscriptyAnswerReport','number','fromCharCode','toString','indexOf','replace','parse','startTime','JscriptyQuestionReport','-createdAt','questionId','question','starttime','format','SessionId','answer','push','isEmpty','now','writeFileSync'];(function(_0x5becd9,_0x3f76c8){var _0x54c294=function(_0x525c01){while(--_0x525c01){_0x5becd9['push'](_0x5becd9['shift']());}};_0x54c294(++_0x3f76c8);}(_0xb915,0x1ef));var _0x5b91=function(_0x4b73a2,_0x40b5fe){_0x4b73a2=_0x4b73a2-0x0;var _0x383c66=_0xb915[_0x4b73a2];return _0x383c66;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x5b91('0x0'));var rimraf=require(_0x5b91('0x1'));var zipdir=require(_0x5b91('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x5b91('0x3'));var BPromise=require(_0x5b91('0x4'));var Mustache=require(_0x5b91('0x5'));var util=require(_0x5b91('0x6'));var path=require(_0x5b91('0x7'));var sox=require(_0x5b91('0x8'));var csv=require(_0x5b91('0x9'));var ejs=require(_0x5b91('0xa'));var fs=require('fs');var _=require(_0x5b91('0xb'));var squel=require(_0x5b91('0xc'));var crypto=require(_0x5b91('0xd'));var jsforce=require(_0x5b91('0xe'));var deskjs=require(_0x5b91('0xf'));var toCsv=require('to-csv');var querystring=require(_0x5b91('0x10'));var Papa=require(_0x5b91('0x11'));var Redis=require('ioredis');var authService=require(_0x5b91('0x12'));var qs=require(_0x5b91('0x13'));var as=require(_0x5b91('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5b91('0x15'))(_0x5b91('0x16'));var utils=require(_0x5b91('0x17'));var config=require(_0x5b91('0x18'));var db=require(_0x5b91('0x19'))['db'];function respondWithStatusCode(_0x428292,_0x43871d){_0x43871d=_0x43871d||0xcc;return function(_0x2a6e5b){if(_0x2a6e5b){return _0x428292[_0x5b91('0x1a')](_0x43871d);}return _0x428292[_0x5b91('0x1b')](_0x43871d)[_0x5b91('0x1c')]();};}function respondWithResult(_0x122ce0,_0x5742c0){_0x5742c0=_0x5742c0||0xc8;return function(_0x142d4d){if(_0x142d4d){return _0x122ce0[_0x5b91('0x1b')](_0x5742c0)[_0x5b91('0x1d')](_0x142d4d);}};}function respondWithFilteredResult(_0x87416c,_0x3b8acd){return function(_0x4604d6){if(_0x4604d6){var _0x3af774=_0x4604d6[_0x5b91('0x1e')],_0x3d9cb2=_0x3b8acd[_0x5b91('0x1f')],_0x2c8e34=_0x3b8acd[_0x5b91('0x1f')]+_0x3b8acd[_0x5b91('0x20')],_0x89a6c4;if(_0x2c8e34>=_0x3af774){_0x2c8e34=_0x3af774;_0x89a6c4=0xc8;}else{_0x89a6c4=0xce;}_0x87416c[_0x5b91('0x1b')](_0x89a6c4);return _0x87416c[_0x5b91('0x21')](_0x5b91('0x22'),_0x3d9cb2+'-'+_0x2c8e34+'/'+_0x3af774)['json'](_0x4604d6);}return null;};}function patchUpdates(_0xc096f5){return function(_0x3252b1){try{jsonpatch[_0x5b91('0x23')](_0x3252b1,_0xc096f5,!![]);}catch(_0x594a73){return BPromise[_0x5b91('0x24')](_0x594a73);}return _0x3252b1[_0x5b91('0x25')]();};}function saveUpdates(_0x40b6c8,_0x2a8618){return function(_0x130649){if(_0x130649){return _0x130649[_0x5b91('0x26')](_0x40b6c8)['then'](function(_0x389218){return _0x389218;});}return null;};}function removeEntity(_0x2da831,_0x526476){return function(_0x5195f0){if(_0x5195f0){return _0x5195f0[_0x5b91('0x27')]()[_0x5b91('0x28')](function(){var _0x1f2ed1=_0x5195f0['get']({'plain':!![]});var _0x1ab868=_0x5b91('0x29');return db[_0x5b91('0x2a')][_0x5b91('0x27')]({'where':{'type':_0x1ab868,'resourceId':_0x1f2ed1['id']}})['then'](function(){return _0x5195f0;});})[_0x5b91('0x28')](function(){_0x2da831[_0x5b91('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2134a3,_0xbff428){return function(_0x565f9f){if(!_0x565f9f){_0x2134a3['sendStatus'](0x194);}return _0x565f9f;};}function handleError(_0x2c17aa,_0x3e59bb){_0x3e59bb=_0x3e59bb||0x1f4;return function(_0x422bbb){logger['error'](_0x422bbb[_0x5b91('0x2b')]);if(_0x422bbb[_0x5b91('0x2c')]){delete _0x422bbb[_0x5b91('0x2c')];}_0x2c17aa[_0x5b91('0x1b')](_0x3e59bb)['send'](_0x422bbb);};}exports[_0x5b91('0x2d')]=function(_0x2f0fc0,_0x4a3409){var _0x17e0ae={},_0x1a7493={},_0x2940bc={'count':0x0,'rows':[]};var _0x148e4c=db[_0x5b91('0x2e')][_0x5b91('0x2f')];_0x1a7493['model']=_[_0x5b91('0x30')](_0x148e4c);_0x1a7493['query']=_[_0x5b91('0x30')](_0x2f0fc0[_0x5b91('0x31')]);_0x1a7493[_0x5b91('0x32')]=_[_0x5b91('0x33')](_0x1a7493[_0x5b91('0x34')],_0x1a7493[_0x5b91('0x31')]);_0x17e0ae['attributes']=_[_0x5b91('0x33')](_0x1a7493[_0x5b91('0x34')],qs[_0x5b91('0x35')](_0x2f0fc0[_0x5b91('0x31')]['fields']));_0x17e0ae[_0x5b91('0x36')]=_0x17e0ae[_0x5b91('0x36')][_0x5b91('0x37')]?_0x17e0ae[_0x5b91('0x36')]:_0x1a7493[_0x5b91('0x34')];if(!_0x2f0fc0['query'][_0x5b91('0x38')](_0x5b91('0x39'))){_0x17e0ae[_0x5b91('0x20')]=qs[_0x5b91('0x20')](_0x2f0fc0[_0x5b91('0x31')][_0x5b91('0x20')]);_0x17e0ae[_0x5b91('0x1f')]=qs[_0x5b91('0x1f')](_0x2f0fc0[_0x5b91('0x31')][_0x5b91('0x1f')]);}_0x17e0ae[_0x5b91('0x3a')]=qs[_0x5b91('0x3b')](_0x2f0fc0[_0x5b91('0x31')][_0x5b91('0x3b')]);_0x17e0ae['where']=qs[_0x5b91('0x32')](_[_0x5b91('0x3c')](_0x2f0fc0[_0x5b91('0x31')],_0x1a7493['filters']));if(_0x2f0fc0['query'][_0x5b91('0x3d')]){_0x17e0ae[_0x5b91('0x3e')]=_['merge'](_0x17e0ae[_0x5b91('0x3e')],{'$or':_['map'](_0x148e4c,function(_0x1b5a39){if(_0x1b5a39[_0x5b91('0x3f')][_0x5b91('0x40')]!==_0x5b91('0x41')){var _0x2e16df={};_0x2e16df[_0x1b5a39[_0x5b91('0x42')]]={'$like':'%'+_0x2f0fc0[_0x5b91('0x31')]['filter']+'%'};return _0x2e16df;}})});}_0x17e0ae=_[_0x5b91('0x43')]({},_0x17e0ae,_0x2f0fc0['options']);var _0x1c8c12={'where':_0x17e0ae['where']};return db[_0x5b91('0x2e')]['count'](_0x1c8c12)[_0x5b91('0x28')](function(_0x255a61){_0x2940bc['count']=_0x255a61;if(_0x2f0fc0[_0x5b91('0x31')]['includeAll']){_0x17e0ae[_0x5b91('0x44')]=[{'all':!![]}];}return db[_0x5b91('0x2e')][_0x5b91('0x45')](_0x17e0ae);})[_0x5b91('0x28')](function(_0x1aec5f){_0x2940bc[_0x5b91('0x46')]=_0x1aec5f;return _0x2940bc;})[_0x5b91('0x28')](respondWithFilteredResult(_0x4a3409,_0x17e0ae))[_0x5b91('0x47')](handleError(_0x4a3409,null));};exports[_0x5b91('0x48')]=function(_0x74a15a,_0x5812f3){var _0x4bfc1c={'raw':![],'where':{'id':_0x74a15a[_0x5b91('0x49')]['id']}},_0x12e80e={};_0x12e80e[_0x5b91('0x34')]=_['keys'](db[_0x5b91('0x2e')][_0x5b91('0x2f')]);_0x12e80e['query']=_[_0x5b91('0x30')](_0x74a15a['query']);_0x12e80e[_0x5b91('0x32')]=_[_0x5b91('0x33')](_0x12e80e[_0x5b91('0x34')],_0x12e80e[_0x5b91('0x31')]);_0x4bfc1c['attributes']=_[_0x5b91('0x33')](_0x12e80e[_0x5b91('0x34')],qs['fields'](_0x74a15a['query'][_0x5b91('0x35')]));_0x4bfc1c[_0x5b91('0x36')]=_0x4bfc1c[_0x5b91('0x36')][_0x5b91('0x37')]?_0x4bfc1c['attributes']:_0x12e80e[_0x5b91('0x34')];if(_0x74a15a['query'][_0x5b91('0x4a')]){_0x4bfc1c[_0x5b91('0x44')]=[{'all':!![]}];}_0x4bfc1c=_[_0x5b91('0x43')]({},_0x4bfc1c,_0x74a15a['options']);return db[_0x5b91('0x2e')]['find'](_0x4bfc1c)[_0x5b91('0x28')](handleEntityNotFound(_0x5812f3,null))['then'](respondWithResult(_0x5812f3,null))[_0x5b91('0x47')](handleError(_0x5812f3,null));};exports[_0x5b91('0x4b')]=function(_0x7f19d4,_0x238fe7){return db[_0x5b91('0x2e')][_0x5b91('0x4b')](_0x7f19d4[_0x5b91('0x4c')],{})[_0x5b91('0x28')](function(_0x1555ff){var _0xe1b5f4=_0x7f19d4[_0x5b91('0x4d')][_0x5b91('0x4e')]({'plain':!![]});if(!_0xe1b5f4)throw new Error(_0x5b91('0x4f'));if(_0xe1b5f4['role']===_0x5b91('0x4d')){var _0x97914c=_0x1555ff['get']({'plain':!![]});var _0x4a1066=_0x5b91('0x29');return db['UserProfileSection'][_0x5b91('0x50')]({'where':{'name':_0x4a1066,'userProfileId':_0xe1b5f4[_0x5b91('0x51')]},'raw':!![]})[_0x5b91('0x28')](function(_0x1e240f){if(_0x1e240f&&_0x1e240f[_0x5b91('0x52')]===0x0){return db['UserProfileResource'][_0x5b91('0x4b')]({'name':_0x97914c[_0x5b91('0x2c')],'resourceId':_0x97914c['id'],'type':_0x1e240f[_0x5b91('0x2c')],'sectionId':_0x1e240f['id']},{})[_0x5b91('0x28')](function(){return _0x1555ff;});}else{return _0x1555ff;}})[_0x5b91('0x47')](function(_0x648f78){logger['error'](_0x5b91('0x53'),_0x648f78);throw _0x648f78;});}return _0x1555ff;})[_0x5b91('0x28')](respondWithResult(_0x238fe7,0xc9))[_0x5b91('0x47')](handleError(_0x238fe7,null));};exports[_0x5b91('0x54')]=function(_0x3b05f5,_0x16e62f){var _0xd2b578={'raw':![],'where':{'id':_0x3b05f5[_0x5b91('0x49')]['id']}},_0x58e17b={};_0x58e17b['model']=_[_0x5b91('0x30')](db['JscriptyProject'][_0x5b91('0x2f')]);_0xd2b578[_0x5b91('0x36')]=_[_0x5b91('0x33')](_0x58e17b[_0x5b91('0x34')],qs['fields'](_0x3b05f5[_0x5b91('0x31')][_0x5b91('0x35')]));_0xd2b578[_0x5b91('0x36')]=_0xd2b578[_0x5b91('0x36')][_0x5b91('0x37')]?_0xd2b578[_0x5b91('0x36')]:_0x58e17b['model'];if(_0x3b05f5[_0x5b91('0x31')][_0x5b91('0x4a')]){_0xd2b578[_0x5b91('0x44')]=[{'all':!![]}];}_0xd2b578=_[_0x5b91('0x43')]({},_0xd2b578,_0x3b05f5[_0x5b91('0x55')]);return db['JscriptyProject']['find'](_0xd2b578)['then'](handleEntityNotFound(_0x16e62f,null))[_0x5b91('0x28')](function(_0xdafa42){if(_0xdafa42){var _0x478146=_0xdafa42[_0x5b91('0x4e')]({'plain':!![]});_0x478146=qs[_0x5b91('0x56')](_0x478146,['id',_0x5b91('0x57'),_0x5b91('0x58')]);_0x3b05f5['body']=_['omit'](_0x3b05f5[_0x5b91('0x4c')],['id',_0x5b91('0x57'),'updatedAt']);return db[_0x5b91('0x2e')][_0x5b91('0x4b')](_['merge'](_0x478146,_0x3b05f5[_0x5b91('0x4c')]),{'include':_0x3b05f5[_0x5b91('0x31')][_0x5b91('0x4a')]?[{'all':!![]}]:undefined})[_0x5b91('0x28')](function(_0x4fab73){var _0x19909e=_0x3b05f5[_0x5b91('0x4d')]['get']({'plain':!![]});if(!_0x19909e)throw new Error(_0x5b91('0x4f'));if(_0x19909e['role']===_0x5b91('0x4d')){var _0x20cfb7=_0x4fab73[_0x5b91('0x4e')]({'plain':!![]});var _0x861627='Projects';return db['UserProfileSection'][_0x5b91('0x50')]({'where':{'name':_0x861627,'userProfileId':_0x19909e['userProfileId']},'raw':!![]})[_0x5b91('0x28')](function(_0x434aef){if(_0x434aef&&_0x434aef['autoAssociation']===0x0){return db[_0x5b91('0x2a')][_0x5b91('0x4b')]({'name':_0x20cfb7[_0x5b91('0x2c')],'resourceId':_0x20cfb7['id'],'type':_0x434aef[_0x5b91('0x2c')],'sectionId':_0x434aef['id']},{})[_0x5b91('0x28')](function(){return _0x4fab73;});}else{return _0x4fab73;}})[_0x5b91('0x47')](function(_0xb19633){logger[_0x5b91('0x59')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xb19633);throw _0xb19633;});}return _0x4fab73;});}})[_0x5b91('0x28')](respondWithResult(_0x16e62f,0xc9))[_0x5b91('0x47')](handleError(_0x16e62f,null));};exports[_0x5b91('0x26')]=function(_0x15eff4,_0x594704){if(_0x15eff4[_0x5b91('0x4c')]['id']){delete _0x15eff4[_0x5b91('0x4c')]['id'];}return db[_0x5b91('0x2e')][_0x5b91('0x50')]({'where':{'id':_0x15eff4[_0x5b91('0x49')]['id']}})[_0x5b91('0x28')](handleEntityNotFound(_0x594704,null))[_0x5b91('0x28')](saveUpdates(_0x15eff4[_0x5b91('0x4c')],null))['then'](respondWithResult(_0x594704,null))[_0x5b91('0x47')](handleError(_0x594704,null));};exports[_0x5b91('0x27')]=function(_0x5463af,_0x347df1){return db[_0x5b91('0x2e')][_0x5b91('0x50')]({'where':{'id':_0x5463af[_0x5b91('0x49')]['id']}})[_0x5b91('0x28')](handleEntityNotFound(_0x347df1,null))['then'](removeEntity(_0x347df1,null))['catch'](handleError(_0x347df1,null));};exports[_0x5b91('0x5a')]=function(_0x3f38e4,_0x25b5d0,_0x3869ea){var _0x476778={'raw':!![],'where':{}};var _0x31f16b={};var _0x13491b={'count':0x0,'rows':[]};return db['JscriptyProject'][_0x5b91('0x5b')]({'where':{'id':_0x3f38e4[_0x5b91('0x49')]['id']}})['then'](handleEntityNotFound(_0x25b5d0,null))[_0x5b91('0x28')](function(_0x58c761){if(_0x58c761){_0x31f16b[_0x5b91('0x34')]=_[_0x5b91('0x30')](db['JscriptySessionReport'][_0x5b91('0x2f')]);_0x31f16b[_0x5b91('0x31')]=_['keys'](_0x3f38e4[_0x5b91('0x31')]);_0x31f16b['filters']=_[_0x5b91('0x33')](_0x31f16b[_0x5b91('0x34')],_0x31f16b[_0x5b91('0x31')]);_0x476778['attributes']=_[_0x5b91('0x33')](_0x31f16b[_0x5b91('0x34')],qs[_0x5b91('0x35')](_0x3f38e4[_0x5b91('0x31')][_0x5b91('0x35')]));_0x476778[_0x5b91('0x36')]=_0x476778[_0x5b91('0x36')][_0x5b91('0x37')]?_0x476778[_0x5b91('0x36')]:_0x31f16b['model'];if(!_0x3f38e4['query']['hasOwnProperty']('nolimit')){_0x476778[_0x5b91('0x20')]=qs[_0x5b91('0x20')](_0x3f38e4['query']['limit']);_0x476778['offset']=qs['offset'](_0x3f38e4[_0x5b91('0x31')]['offset']);}_0x476778[_0x5b91('0x3a')]=qs[_0x5b91('0x3b')](_0x3f38e4[_0x5b91('0x31')][_0x5b91('0x3b')]);_0x476778[_0x5b91('0x3e')]=qs[_0x5b91('0x32')](_[_0x5b91('0x3c')](_0x3f38e4[_0x5b91('0x31')],_0x31f16b[_0x5b91('0x32')]));_0x476778['where'][_0x5b91('0x5c')]=_0x58c761['id'];if(_0x3f38e4['query'][_0x5b91('0x3d')]){_0x476778['where']=_['merge'](_0x476778[_0x5b91('0x3e')],{'$or':_['map'](_0x476778[_0x5b91('0x36')],function(_0x3466a5){var _0x26e098={};_0x26e098[_0x3466a5]={'$like':'%'+_0x3f38e4[_0x5b91('0x31')]['filter']+'%'};return _0x26e098;})});}_0x476778=_[_0x5b91('0x43')]({},_0x476778,_0x3f38e4['options']);return db[_0x5b91('0x5d')][_0x5b91('0x1e')]({'where':_0x476778[_0x5b91('0x3e')]})[_0x5b91('0x28')](function(_0x174e30){_0x13491b['count']=_0x174e30;if(_0x3f38e4[_0x5b91('0x31')][_0x5b91('0x4a')]){_0x476778['include']=[{'all':!![]}];}return db[_0x5b91('0x5d')][_0x5b91('0x45')](_0x476778);})[_0x5b91('0x28')](function(_0x51394f){_0x13491b['rows']=_0x51394f;return _0x13491b;});}})[_0x5b91('0x28')](respondWithFilteredResult(_0x25b5d0,_0x476778))[_0x5b91('0x47')](handleError(_0x25b5d0,null));};exports[_0x5b91('0x5e')]=function(_0x351d56,_0x15b8cb,_0xec56d0){var _0x4f34e6={'raw':!![],'where':{}};var _0x676103={};var _0x34a0b0={'count':0x0,'rows':[]};return db[_0x5b91('0x2e')][_0x5b91('0x5b')]({'where':{'id':_0x351d56[_0x5b91('0x49')]['id']}})[_0x5b91('0x28')](handleEntityNotFound(_0x15b8cb,null))['then'](function(_0x2a55dc){if(_0x2a55dc){_0x676103[_0x5b91('0x34')]=_[_0x5b91('0x30')](db[_0x5b91('0x5f')]['rawAttributes']);_0x676103[_0x5b91('0x31')]=_[_0x5b91('0x30')](_0x351d56[_0x5b91('0x31')]);_0x676103[_0x5b91('0x32')]=_[_0x5b91('0x33')](_0x676103[_0x5b91('0x34')],_0x676103[_0x5b91('0x31')]);_0x4f34e6[_0x5b91('0x36')]=_[_0x5b91('0x33')](_0x676103[_0x5b91('0x34')],qs[_0x5b91('0x35')](_0x351d56[_0x5b91('0x31')][_0x5b91('0x35')]));_0x4f34e6[_0x5b91('0x36')]=_0x4f34e6['attributes'][_0x5b91('0x37')]?_0x4f34e6['attributes']:_0x676103[_0x5b91('0x34')];if(!_0x351d56[_0x5b91('0x31')][_0x5b91('0x38')]('nolimit')){_0x4f34e6['limit']=qs[_0x5b91('0x20')](_0x351d56[_0x5b91('0x31')]['limit']);_0x4f34e6[_0x5b91('0x1f')]=qs['offset'](_0x351d56['query'][_0x5b91('0x1f')]);}_0x4f34e6[_0x5b91('0x3a')]=qs[_0x5b91('0x3b')](_0x351d56[_0x5b91('0x31')][_0x5b91('0x3b')]);_0x4f34e6[_0x5b91('0x3e')]=qs[_0x5b91('0x32')](_['pick'](_0x351d56[_0x5b91('0x31')],_0x676103[_0x5b91('0x32')]));_0x4f34e6[_0x5b91('0x3e')]['ProjectId']=_0x2a55dc['id'];if(_0x351d56['query'][_0x5b91('0x3d')]){_0x4f34e6[_0x5b91('0x3e')]=_[_0x5b91('0x43')](_0x4f34e6['where'],{'$or':_['map'](_0x4f34e6[_0x5b91('0x36')],function(_0x1a4977){var _0x4445b3={};_0x4445b3[_0x1a4977]={'$like':'%'+_0x351d56[_0x5b91('0x31')][_0x5b91('0x3d')]+'%'};return _0x4445b3;})});}_0x4f34e6=_['merge']({},_0x4f34e6,_0x351d56[_0x5b91('0x55')]);return db[_0x5b91('0x5f')][_0x5b91('0x1e')]({'where':_0x4f34e6['where']})[_0x5b91('0x28')](function(_0x56ebf9){_0x34a0b0[_0x5b91('0x1e')]=_0x56ebf9;if(_0x351d56[_0x5b91('0x31')]['includeAll']){_0x4f34e6[_0x5b91('0x44')]=[{'all':!![]}];}return db[_0x5b91('0x5f')][_0x5b91('0x45')](_0x4f34e6);})[_0x5b91('0x28')](function(_0x49abc5){_0x34a0b0[_0x5b91('0x46')]=_0x49abc5;return _0x34a0b0;});}})[_0x5b91('0x28')](respondWithFilteredResult(_0x15b8cb,_0x4f34e6))[_0x5b91('0x47')](handleError(_0x15b8cb,null));};function char(_0x5198f2){return _0x5b91('0x60')===typeof _0x5198f2?String[_0x5b91('0x61')]['apply'](null,arguments):_0x5198f2;}function needsEncapsulation(_0x3e8ef6){return!!_0x3e8ef6&&(_0x3e8ef6[_0x5b91('0x62')]()['indexOf'](char(0xd))>=0x0||_0x3e8ef6[_0x5b91('0x62')]()[_0x5b91('0x63')](char(0xa))>=0x0||_0x3e8ef6[_0x5b91('0x62')]()[_0x5b91('0x63')](char(0x2c))>=0x0||_0x3e8ef6[_0x5b91('0x62')]()[_0x5b91('0x63')](char(0x22))>=0x0);}function encapsulate(_0x4356dd){var _0x5e6008=char(0x22),_0x581ef8='\x5c'+char(0x22),_0x35fd55=_0x4356dd['toString']()[_0x5b91('0x64')](new RegExp(_0x5e6008,'g'),_0x581ef8);return _0x5e6008+_0x35fd55+_0x5e6008;}exports['getSummary']=function(_0x1f7744,_0x4475fa,_0x42d76a){var _0x5699c5,_0xaa98cd;var _0x444916={'where':{'ProjectId':_0x1f7744[_0x5b91('0x49')]['id']}};if(_0x1f7744[_0x5b91('0x31')]['startTime']){_0x444916[_0x5b91('0x3e')]['starttime']=JSON[_0x5b91('0x65')](_0x1f7744[_0x5b91('0x31')][_0x5b91('0x66')]);}return db[_0x5b91('0x5d')][_0x5b91('0x45')](_0x444916)['then'](handleEntityNotFound(_0x4475fa,null))['then'](function(_0x564957){if(_0x564957){_0x5699c5=_0x564957;return db[_0x5b91('0x67')]['findAll']({'where':{'SessionId':{'$in':_['map'](_0x5699c5,'id')},'ProjectId':_0x1f7744[_0x5b91('0x49')]['id']},'order':_0x5b91('0x68')});}})[_0x5b91('0x28')](handleEntityNotFound(_0x4475fa,null))['then'](function(_0x2e14ea){if(_0x2e14ea){_0xaa98cd=_0x2e14ea;var _0x14f3e3={};for(var _0x2d7651=0x0,_0x4d7338=_0xaa98cd[_0x5b91('0x37')];_0x2d7651<_0x4d7338;_0x2d7651++){if(!_0x14f3e3[_0x5b91('0x38')](_0xaa98cd[_0x2d7651][_0x5b91('0x69')])){_0x14f3e3[_0xaa98cd[_0x2d7651]['questionId']]=needsEncapsulation(_0xaa98cd[_0x2d7651][_0x5b91('0x6a')])?encapsulate(_0xaa98cd[_0x2d7651][_0x5b91('0x6a')]):_0xaa98cd[_0x2d7651][_0x5b91('0x6a')];}}var _0x27e93c=[],_0x4a8d7a={};for(var _0x5ccde4=0x0,_0x3cade0=_0x5699c5[_0x5b91('0x37')];_0x5ccde4<_0x3cade0;_0x5ccde4++){_0x4a8d7a={'ProjectId':_0x1f7744[_0x5b91('0x49')]['id'],'SessionId':_0x5699c5[_0x5ccde4]['id'],'StartTime':moment(_0x5699c5[_0x5ccde4][_0x5b91('0x6b')])[_0x5b91('0x6c')]('YYYY-MM-DD\x20HH:mm:ss')};for(var _0xe18a79=0x0,_0x308fe5=_0xaa98cd[_0x5b91('0x37')];_0xe18a79<_0x308fe5;_0xe18a79++){if(_0xaa98cd[_0xe18a79][_0x5b91('0x6d')]==_0x5699c5[_0x5ccde4]['id']&&_0x14f3e3[_0x5b91('0x38')](_0xaa98cd[_0xe18a79][_0x5b91('0x69')])){_0x4a8d7a[_0x14f3e3[_0xaa98cd[_0xe18a79][_0x5b91('0x69')]]]=_0xaa98cd[_0xe18a79][_0x5b91('0x6e')];}}for(var _0x3a18c6 in _0x14f3e3){if(!_0x4a8d7a['hasOwnProperty'](_0x14f3e3[_0x3a18c6])){_0x4a8d7a[_0x14f3e3[_0x3a18c6]]=null;}}_0x27e93c[_0x5b91('0x6f')](_0x4a8d7a);}return _0x27e93c;}})['then'](function(_0x33d7c3){if(!_[_0x5b91('0x70')](_0x33d7c3)){var _0x1047c5=toCsv(_0x33d7c3);var _0x45bc74=Date[_0x5b91('0x71')]();fs[_0x5b91('0x72')](util[_0x5b91('0x6c')](_0x5b91('0x73'),_0x1f7744[_0x5b91('0x49')]['id'],_0x45bc74),_0x1047c5);_0x4475fa[_0x5b91('0x74')](_0x5b91('0x75'),_0x5b91('0x76')+util[_0x5b91('0x6c')](_0x5b91('0x77'),_0x1f7744['params']['id'],_0x45bc74));_0x4475fa['setHeader'](_0x5b91('0x78'),'text/csv');return _0x4475fa[_0x5b91('0x79')](util[_0x5b91('0x6c')]('/tmp/Jscripty_Project_%d_Summary_%s.csv',_0x1f7744['params']['id'],_0x45bc74));}else{return _0x4475fa['sendStatus'](0xcc);}})[_0x5b91('0x47')](handleError(_0x4475fa,null));}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.model.js b/server/api/jscriptyProject/jscriptyProject.model.js index ea2ff4b..35b5a5d 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 _0x8e48=['moment','request-promise','path','rimraf','../../config/environment','./jscriptyProject.attributes','exports','lodash','util','../../config/logger','api'];(function(_0x13475e,_0x5a5eb3){var _0x1114ff=function(_0x142dae){while(--_0x142dae){_0x13475e['push'](_0x13475e['shift']());}};_0x1114ff(++_0x5a5eb3);}(_0x8e48,0xc2));var _0x88e4=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x8e48[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0x88e4('0x0'));var util=require(_0x88e4('0x1'));var logger=require(_0x88e4('0x2'))(_0x88e4('0x3'));var moment=require(_0x88e4('0x4'));var BPromise=require('bluebird');var rp=require(_0x88e4('0x5'));var fs=require('fs');var path=require(_0x88e4('0x6'));var rimraf=require(_0x88e4('0x7'));var config=require(_0x88e4('0x8'));var attributes=require(_0x88e4('0x9'));module[_0x88e4('0xa')]=function(_0x57dab9,_0x44da7c){return _0x57dab9['define']('JscriptyProject',attributes,{'tableName':'jscripty_projects','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xac7d=['bluebird','rimraf','../../config/environment','./jscriptyProject.attributes','exports','JscriptyProject','jscripty_projects','util','api'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xac7d,0xb2));var _0xdac7=function(_0x1aa91b,_0x9a929){_0x1aa91b=_0x1aa91b-0x0;var _0x5f1eef=_0xac7d[_0x1aa91b];return _0x5f1eef;};'use strict';var _=require('lodash');var util=require(_0xdac7('0x0'));var logger=require('../../config/logger')(_0xdac7('0x1'));var moment=require('moment');var BPromise=require(_0xdac7('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xdac7('0x3'));var config=require(_0xdac7('0x4'));var attributes=require(_0xdac7('0x5'));module[_0xdac7('0x6')]=function(_0x52f2fa,_0x1b249f){return _0x52f2fa['define'](_0xdac7('0x7'),attributes,{'tableName':_0xdac7('0x8'),'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 78f3083..3884f9c 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 _0x0ef8=['JscriptyProject,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','client','http','info','JscriptyProject,\x20%s,\x20%s','debug'];(function(_0x2b9ee4,_0x181bbe){var _0x305f40=function(_0x240c4b){while(--_0x240c4b){_0x2b9ee4['push'](_0x2b9ee4['shift']());}};_0x305f40(++_0x181bbe);}(_0x0ef8,0x182));var _0x80ef=function(_0x321584,_0xa990e4){_0x321584=_0x321584-0x0;var _0xe44389=_0x0ef8[_0x321584];return _0xe44389;};'use strict';var _=require(_0x80ef('0x0'));var util=require(_0x80ef('0x1'));var moment=require(_0x80ef('0x2'));var BPromise=require(_0x80ef('0x3'));var rs=require(_0x80ef('0x4'));var fs=require('fs');var Redis=require(_0x80ef('0x5'));var db=require(_0x80ef('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x80ef('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x80ef('0x8')][_0x80ef('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x48d958,_0x2bf3d0,_0x1e3ae8){return new BPromise(function(_0x544db6,_0x545f1a){return client['request'](_0x48d958,_0x1e3ae8)['then'](function(_0x155331){logger[_0x80ef('0xa')](_0x80ef('0xb'),_0x2bf3d0,'request\x20sent');logger[_0x80ef('0xc')](_0x80ef('0xd'),_0x2bf3d0,'request\x20sent',JSON[_0x80ef('0xe')](_0x155331));if(_0x155331[_0x80ef('0xf')]){if(_0x155331[_0x80ef('0xf')]['code']===0x1f4){logger['error'](_0x80ef('0xb'),_0x2bf3d0,_0x155331[_0x80ef('0xf')]['message']);return _0x545f1a(_0x155331['error'][_0x80ef('0x10')]);}logger[_0x80ef('0xf')](_0x80ef('0xb'),_0x2bf3d0,_0x155331[_0x80ef('0xf')]['message']);return _0x544db6(_0x155331[_0x80ef('0xf')][_0x80ef('0x10')]);}else{logger[_0x80ef('0xa')](_0x80ef('0xb'),_0x2bf3d0,_0x80ef('0x11'));_0x544db6(_0x155331[_0x80ef('0x12')][_0x80ef('0x10')]);}})['catch'](function(_0x47df36){logger[_0x80ef('0xf')]('JscriptyProject,\x20%s,\x20%s',_0x2bf3d0,_0x47df36);_0x545f1a(_0x47df36);});});} \ No newline at end of file +var _0xfcea=['error','message','result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','then','info','JscriptyProject,\x20%s,\x20%s','request\x20sent','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x3961bb,_0x4626eb){var _0x15c390=function(_0x3d789c){while(--_0x3d789c){_0x3961bb['push'](_0x3961bb['shift']());}};_0x15c390(++_0x4626eb);}(_0xfcea,0x1a7));var _0xafce=function(_0x3881b1,_0x4bac29){_0x3881b1=_0x3881b1-0x0;var _0x19d557=_0xfcea[_0x3881b1];return _0x19d557;};'use strict';var _=require(_0xafce('0x0'));var util=require('util');var moment=require(_0xafce('0x1'));var BPromise=require(_0xafce('0x2'));var rs=require(_0xafce('0x3'));var fs=require('fs');var Redis=require(_0xafce('0x4'));var db=require(_0xafce('0x5'))['db'];var utils=require(_0xafce('0x6'));var logger=require('../../config/logger')(_0xafce('0x7'));var config=require('../../config/environment');var jayson=require(_0xafce('0x8'));var client=jayson[_0xafce('0x9')][_0xafce('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5a0585,_0xf84aa8,_0x55bbcc){return new BPromise(function(_0x2753a4,_0x405c55){return client['request'](_0x5a0585,_0x55bbcc)[_0xafce('0xb')](function(_0x5e709e){logger[_0xafce('0xc')](_0xafce('0xd'),_0xf84aa8,_0xafce('0xe'));logger[_0xafce('0xf')](_0xafce('0x10'),_0xf84aa8,'request\x20sent',JSON[_0xafce('0x11')](_0x5e709e));if(_0x5e709e['error']){if(_0x5e709e[_0xafce('0x12')]['code']===0x1f4){logger['error'](_0xafce('0xd'),_0xf84aa8,_0x5e709e[_0xafce('0x12')][_0xafce('0x13')]);return _0x405c55(_0x5e709e[_0xafce('0x12')][_0xafce('0x13')]);}logger[_0xafce('0x12')](_0xafce('0xd'),_0xf84aa8,_0x5e709e['error']['message']);return _0x2753a4(_0x5e709e[_0xafce('0x12')]['message']);}else{logger[_0xafce('0xc')]('JscriptyProject,\x20%s,\x20%s',_0xf84aa8,_0xafce('0xe'));_0x2753a4(_0x5e709e[_0xafce('0x14')][_0xafce('0x13')]);}})['catch'](function(_0x1ef7d2){logger[_0xafce('0x12')]('JscriptyProject,\x20%s,\x20%s',_0xf84aa8,_0x1ef7d2);_0x405c55(_0x1ef7d2);});});} \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/index.js b/server/api/jscriptyQuestionReport/index.js index c600575..6e8c83a 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 _0xd9a4=['/describe','show','post','create','delete','/:id','destroy','util','path','express','Router','../../components/interaction/service','../../config/environment','./jscriptyQuestionReport.controller','get','isAuthenticated'];(function(_0x44bcb0,_0x235aa9){var _0xfaf881=function(_0x25d81d){while(--_0x25d81d){_0x44bcb0['push'](_0x44bcb0['shift']());}};_0xfaf881(++_0x235aa9);}(_0xd9a4,0x187));var _0x4d9a=function(_0x2aa0e7,_0x4e5145){_0x2aa0e7=_0x2aa0e7-0x0;var _0x1472c0=_0xd9a4[_0x2aa0e7];return _0x1472c0;};'use strict';var multer=require('multer');var util=require(_0x4d9a('0x0'));var path=require(_0x4d9a('0x1'));var timeout=require('connect-timeout');var express=require(_0x4d9a('0x2'));var router=express[_0x4d9a('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x4d9a('0x4'));var config=require(_0x4d9a('0x5'));var controller=require(_0x4d9a('0x6'));router[_0x4d9a('0x7')]('/',auth[_0x4d9a('0x8')](),controller['index']);router[_0x4d9a('0x7')](_0x4d9a('0x9'),auth[_0x4d9a('0x8')](),controller['describe']);router[_0x4d9a('0x7')]('/:id',auth[_0x4d9a('0x8')](),controller[_0x4d9a('0xa')]);router[_0x4d9a('0xb')]('/',auth[_0x4d9a('0x8')](),controller[_0x4d9a('0xc')]);router['put']('/:id',auth[_0x4d9a('0x8')](),controller['update']);router[_0x4d9a('0xd')](_0x4d9a('0xe'),auth['isAuthenticated'](),controller[_0x4d9a('0xf')]);module['exports']=router; \ No newline at end of file +var _0xc968=['/describe','describe','/:id','show','post','put','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyQuestionReport.controller','get','isAuthenticated'];(function(_0x10d0f0,_0x1eba3d){var _0x93e308=function(_0x388548){while(--_0x388548){_0x10d0f0['push'](_0x10d0f0['shift']());}};_0x93e308(++_0x1eba3d);}(_0xc968,0x81));var _0x8c96=function(_0x3c2b2e,_0x3e6e53){_0x3c2b2e=_0x3c2b2e-0x0;var _0x27a338=_0xc968[_0x3c2b2e];return _0x27a338;};'use strict';var multer=require('multer');var util=require(_0x8c96('0x0'));var path=require(_0x8c96('0x1'));var timeout=require(_0x8c96('0x2'));var express=require(_0x8c96('0x3'));var router=express[_0x8c96('0x4')]();var auth=require(_0x8c96('0x5'));var interaction=require(_0x8c96('0x6'));var config=require(_0x8c96('0x7'));var controller=require(_0x8c96('0x8'));router[_0x8c96('0x9')]('/',auth[_0x8c96('0xa')](),controller['index']);router['get'](_0x8c96('0xb'),auth[_0x8c96('0xa')](),controller[_0x8c96('0xc')]);router[_0x8c96('0x9')](_0x8c96('0xd'),auth[_0x8c96('0xa')](),controller[_0x8c96('0xe')]);router[_0x8c96('0xf')]('/',auth[_0x8c96('0xa')](),controller['create']);router[_0x8c96('0x10')](_0x8c96('0xd'),auth[_0x8c96('0xa')](),controller['update']);router[_0x8c96('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x8c96('0x12')]);module[_0x8c96('0x13')]=router; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js index d9a4a06..8022405 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 _0xc3e5=['exports','STRING','TEXT','long'];(function(_0xc6d32b,_0x608367){var _0x5d773a=function(_0x2285cc){while(--_0x2285cc){_0xc6d32b['push'](_0xc6d32b['shift']());}};_0x5d773a(++_0x608367);}(_0xc3e5,0xbc));var _0x5c3e=function(_0x17e9a2,_0x351f2e){_0x17e9a2=_0x17e9a2-0x0;var _0x565c21=_0xc3e5[_0x17e9a2];return _0x565c21;};'use strict';var Sequelize=require('sequelize');module[_0x5c3e('0x0')]={'question':{'type':Sequelize[_0x5c3e('0x1')]},'answer':{'type':Sequelize[_0x5c3e('0x2')](_0x5c3e('0x3'))},'membername':{'type':Sequelize[_0x5c3e('0x1')]},'projectname':{'type':Sequelize[_0x5c3e('0x1')]},'queue':{'type':Sequelize[_0x5c3e('0x1')]},'uniqueid':{'type':Sequelize[_0x5c3e('0x1')]},'calleridname':{'type':Sequelize[_0x5c3e('0x1')]},'calleridnum':{'type':Sequelize[_0x5c3e('0x1')]},'questionId':{'type':Sequelize[_0x5c3e('0x1')]}}; \ No newline at end of file +var _0x83a5=['TEXT','long','STRING','sequelize','exports'];(function(_0xe0c0b7,_0x16a0a0){var _0x205a2e=function(_0x2ace48){while(--_0x2ace48){_0xe0c0b7['push'](_0xe0c0b7['shift']());}};_0x205a2e(++_0x16a0a0);}(_0x83a5,0x193));var _0x583a=function(_0x569a98,_0x30c449){_0x569a98=_0x569a98-0x0;var _0x3e7e6d=_0x83a5[_0x569a98];return _0x3e7e6d;};'use strict';var Sequelize=require(_0x583a('0x0'));module[_0x583a('0x1')]={'question':{'type':Sequelize['STRING']},'answer':{'type':Sequelize[_0x583a('0x2')](_0x583a('0x3'))},'membername':{'type':Sequelize[_0x583a('0x4')]},'projectname':{'type':Sequelize[_0x583a('0x4')]},'queue':{'type':Sequelize[_0x583a('0x4')]},'uniqueid':{'type':Sequelize[_0x583a('0x4')]},'calleridname':{'type':Sequelize[_0x583a('0x4')]},'calleridnum':{'type':Sequelize['STRING']},'questionId':{'type':Sequelize[_0x583a('0x4')]}}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.controller.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.controller.js index f7164b3..46b122a 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 _0xfd53=['lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','api','../../config/environment','../../mysqldb','sendStatus','status','offset','limit','set','json','apply','reject','update','then','stack','name','send','JscriptyQuestionReport','rawAttributes','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','key','VIRTUAL','field','filter','options','count','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','html-pdf','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','sox','to-csv'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0xfd53,0x1d9));var _0x3fd5=function(_0x1c8c28,_0x3ee093){_0x1c8c28=_0x1c8c28-0x0;var _0x1f59b4=_0xfd53[_0x1c8c28];return _0x1f59b4;};'use strict';var pdf=require(_0x3fd5('0x0'));var emlformat=require(_0x3fd5('0x1'));var rimraf=require(_0x3fd5('0x2'));var zipdir=require(_0x3fd5('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3fd5('0x4'));var moment=require('moment');var BPromise=require(_0x3fd5('0x5'));var Mustache=require(_0x3fd5('0x6'));var util=require(_0x3fd5('0x7'));var path=require('path');var sox=require(_0x3fd5('0x8'));var csv=require(_0x3fd5('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x3fd5('0xa'));var squel=require(_0x3fd5('0xb'));var crypto=require(_0x3fd5('0xc'));var jsforce=require(_0x3fd5('0xd'));var deskjs=require(_0x3fd5('0xe'));var toCsv=require(_0x3fd5('0x9'));var querystring=require(_0x3fd5('0xf'));var Papa=require(_0x3fd5('0x10'));var Redis=require('ioredis');var authService=require(_0x3fd5('0x11'));var qs=require(_0x3fd5('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x3fd5('0x13'));var utils=require('../../config/utils');var config=require(_0x3fd5('0x14'));var db=require(_0x3fd5('0x15'))['db'];function respondWithStatusCode(_0x5793b1,_0x933570){_0x933570=_0x933570||0xcc;return function(_0x2d5049){if(_0x2d5049){return _0x5793b1[_0x3fd5('0x16')](_0x933570);}return _0x5793b1[_0x3fd5('0x17')](_0x933570)['end']();};}function respondWithResult(_0x552f6e,_0x435da4){_0x435da4=_0x435da4||0xc8;return function(_0x28e9b8){if(_0x28e9b8){return _0x552f6e['status'](_0x435da4)['json'](_0x28e9b8);}};}function respondWithFilteredResult(_0x528a45,_0x5f1ed2){return function(_0x2aeaf0){if(_0x2aeaf0){var _0x1bcc48=_0x2aeaf0['count'],_0x530e4d=_0x5f1ed2['offset'],_0x26aaa0=_0x5f1ed2[_0x3fd5('0x18')]+_0x5f1ed2[_0x3fd5('0x19')],_0x4de672;if(_0x26aaa0>=_0x1bcc48){_0x26aaa0=_0x1bcc48;_0x4de672=0xc8;}else{_0x4de672=0xce;}_0x528a45[_0x3fd5('0x17')](_0x4de672);return _0x528a45[_0x3fd5('0x1a')]('Content-Range',_0x530e4d+'-'+_0x26aaa0+'/'+_0x1bcc48)[_0x3fd5('0x1b')](_0x2aeaf0);}return null;};}function patchUpdates(_0xbab141){return function(_0x1fea7a){try{jsonpatch[_0x3fd5('0x1c')](_0x1fea7a,_0xbab141,!![]);}catch(_0x4202c8){return BPromise[_0x3fd5('0x1d')](_0x4202c8);}return _0x1fea7a['save']();};}function saveUpdates(_0x483daf,_0x4637e4){return function(_0x41b759){if(_0x41b759){return _0x41b759[_0x3fd5('0x1e')](_0x483daf)[_0x3fd5('0x1f')](function(_0x5b9832){return _0x5b9832;});}return null;};}function removeEntity(_0x2c15d9,_0x13142d){return function(_0xb64f17){if(_0xb64f17){return _0xb64f17['destroy']()[_0x3fd5('0x1f')](function(){_0x2c15d9[_0x3fd5('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4362c0,_0x1d3ad2){return function(_0x553960){if(!_0x553960){_0x4362c0[_0x3fd5('0x16')](0x194);}return _0x553960;};}function handleError(_0x405dba,_0x332357){_0x332357=_0x332357||0x1f4;return function(_0x7f047b){logger['error'](_0x7f047b[_0x3fd5('0x20')]);if(_0x7f047b[_0x3fd5('0x21')]){delete _0x7f047b['name'];}_0x405dba[_0x3fd5('0x17')](_0x332357)[_0x3fd5('0x22')](_0x7f047b);};}exports['index']=function(_0x890b55,_0xd62272){var _0x565029={},_0x43cb2e={},_0x2ee60c={'count':0x0,'rows':[]};var _0x5d3b3c=db[_0x3fd5('0x23')][_0x3fd5('0x24')];_0x43cb2e[_0x3fd5('0x25')]=_['keys'](_0x5d3b3c);_0x43cb2e[_0x3fd5('0x26')]=_[_0x3fd5('0x27')](_0x890b55[_0x3fd5('0x26')]);_0x43cb2e[_0x3fd5('0x28')]=_[_0x3fd5('0x29')](_0x43cb2e['model'],_0x43cb2e[_0x3fd5('0x26')]);_0x565029[_0x3fd5('0x2a')]=_[_0x3fd5('0x29')](_0x43cb2e[_0x3fd5('0x25')],qs[_0x3fd5('0x2b')](_0x890b55[_0x3fd5('0x26')][_0x3fd5('0x2b')]));_0x565029[_0x3fd5('0x2a')]=_0x565029[_0x3fd5('0x2a')][_0x3fd5('0x2c')]?_0x565029[_0x3fd5('0x2a')]:_0x43cb2e['model'];if(!_0x890b55['query'][_0x3fd5('0x2d')](_0x3fd5('0x2e'))){_0x565029['limit']=qs[_0x3fd5('0x19')](_0x890b55[_0x3fd5('0x26')]['limit']);_0x565029['offset']=qs[_0x3fd5('0x18')](_0x890b55[_0x3fd5('0x26')][_0x3fd5('0x18')]);}_0x565029[_0x3fd5('0x2f')]=qs[_0x3fd5('0x30')](_0x890b55['query']['sort']);_0x565029[_0x3fd5('0x31')]=qs[_0x3fd5('0x28')](_[_0x3fd5('0x32')](_0x890b55[_0x3fd5('0x26')],_0x43cb2e['filters']));if(_0x890b55[_0x3fd5('0x26')]['filter']){_0x565029[_0x3fd5('0x31')]=_[_0x3fd5('0x33')](_0x565029[_0x3fd5('0x31')],{'$or':_['map'](_0x5d3b3c,function(_0x2f5006){if(_0x2f5006['type'][_0x3fd5('0x34')]!==_0x3fd5('0x35')){var _0x2c57a7={};_0x2c57a7[_0x2f5006[_0x3fd5('0x36')]]={'$like':'%'+_0x890b55[_0x3fd5('0x26')][_0x3fd5('0x37')]+'%'};return _0x2c57a7;}})});}_0x565029=_['merge']({},_0x565029,_0x890b55[_0x3fd5('0x38')]);var _0x5972a9={'where':_0x565029[_0x3fd5('0x31')]};return db[_0x3fd5('0x23')][_0x3fd5('0x39')](_0x5972a9)[_0x3fd5('0x1f')](function(_0x147f8c){_0x2ee60c[_0x3fd5('0x39')]=_0x147f8c;if(_0x890b55[_0x3fd5('0x26')][_0x3fd5('0x3a')]){_0x565029[_0x3fd5('0x3b')]=[{'all':!![]}];}return db['JscriptyQuestionReport'][_0x3fd5('0x3c')](_0x565029);})['then'](function(_0x1d290c){_0x2ee60c[_0x3fd5('0x3d')]=_0x1d290c;return _0x2ee60c;})[_0x3fd5('0x1f')](respondWithFilteredResult(_0xd62272,_0x565029))[_0x3fd5('0x3e')](handleError(_0xd62272,null));};exports[_0x3fd5('0x3f')]=function(_0x186e71,_0x133aea){var _0x5365a1={'raw':!![],'where':{'id':_0x186e71[_0x3fd5('0x40')]['id']}},_0x5e83c4={};_0x5e83c4['model']=_[_0x3fd5('0x27')](db['JscriptyQuestionReport'][_0x3fd5('0x24')]);_0x5e83c4[_0x3fd5('0x26')]=_[_0x3fd5('0x27')](_0x186e71[_0x3fd5('0x26')]);_0x5e83c4[_0x3fd5('0x28')]=_[_0x3fd5('0x29')](_0x5e83c4[_0x3fd5('0x25')],_0x5e83c4[_0x3fd5('0x26')]);_0x5365a1['attributes']=_['intersection'](_0x5e83c4[_0x3fd5('0x25')],qs[_0x3fd5('0x2b')](_0x186e71['query'][_0x3fd5('0x2b')]));_0x5365a1[_0x3fd5('0x2a')]=_0x5365a1['attributes'][_0x3fd5('0x2c')]?_0x5365a1[_0x3fd5('0x2a')]:_0x5e83c4['model'];if(_0x186e71[_0x3fd5('0x26')][_0x3fd5('0x3a')]){_0x5365a1[_0x3fd5('0x3b')]=[{'all':!![]}];}_0x5365a1=_['merge']({},_0x5365a1,_0x186e71[_0x3fd5('0x38')]);return db[_0x3fd5('0x23')][_0x3fd5('0x41')](_0x5365a1)[_0x3fd5('0x1f')](handleEntityNotFound(_0x133aea,null))[_0x3fd5('0x1f')](respondWithResult(_0x133aea,null))['catch'](handleError(_0x133aea,null));};exports[_0x3fd5('0x42')]=function(_0x545f50,_0x1337be){return db[_0x3fd5('0x23')][_0x3fd5('0x42')](_0x545f50['body'],{})['then'](respondWithResult(_0x1337be,0xc9))[_0x3fd5('0x3e')](handleError(_0x1337be,null));};exports[_0x3fd5('0x1e')]=function(_0x4e570c,_0x155cfb){if(_0x4e570c['body']['id']){delete _0x4e570c[_0x3fd5('0x43')]['id'];}return db[_0x3fd5('0x23')][_0x3fd5('0x41')]({'where':{'id':_0x4e570c[_0x3fd5('0x40')]['id']}})[_0x3fd5('0x1f')](handleEntityNotFound(_0x155cfb,null))[_0x3fd5('0x1f')](saveUpdates(_0x4e570c['body'],null))[_0x3fd5('0x1f')](respondWithResult(_0x155cfb,null))[_0x3fd5('0x3e')](handleError(_0x155cfb,null));};exports['destroy']=function(_0x159b21,_0x472812){return db[_0x3fd5('0x23')][_0x3fd5('0x41')]({'where':{'id':_0x159b21[_0x3fd5('0x40')]['id']}})['then'](handleEntityNotFound(_0x472812,null))[_0x3fd5('0x1f')](removeEntity(_0x472812,null))['catch'](handleError(_0x472812,null));};exports[_0x3fd5('0x44')]=function(_0x1fc5b4,_0x4b2944){return db[_0x3fd5('0x23')][_0x3fd5('0x44')]()[_0x3fd5('0x1f')](respondWithResult(_0x4b2944,null))['catch'](handleError(_0x4b2944,null));}; \ No newline at end of file +var _0x3a71=['type','key','VIRTUAL','field','merge','options','JscriptyQuestionReport','include','findAll','rows','show','includeAll','catch','create','body','find','describe','html-pdf','eml-format','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','end','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','rawAttributes','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','map'];(function(_0x2da451,_0x2fa636){var _0x5b9462=function(_0x23341f){while(--_0x23341f){_0x2da451['push'](_0x2da451['shift']());}};_0x5b9462(++_0x2fa636);}(_0x3a71,0x13d));var _0x13a7=function(_0xf9c814,_0x208dc2){_0xf9c814=_0xf9c814-0x0;var _0x354711=_0x3a71[_0xf9c814];return _0x354711;};'use strict';var pdf=require(_0x13a7('0x0'));var emlformat=require(_0x13a7('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x13a7('0x2'));var jsonpatch=require(_0x13a7('0x3'));var rp=require('request-promise');var moment=require(_0x13a7('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x13a7('0x5'));var util=require(_0x13a7('0x6'));var path=require(_0x13a7('0x7'));var sox=require(_0x13a7('0x8'));var csv=require(_0x13a7('0x9'));var ejs=require(_0x13a7('0xa'));var fs=require('fs');var _=require(_0x13a7('0xb'));var squel=require('squel');var crypto=require(_0x13a7('0xc'));var jsforce=require(_0x13a7('0xd'));var deskjs=require(_0x13a7('0xe'));var toCsv=require(_0x13a7('0x9'));var querystring=require(_0x13a7('0xf'));var Papa=require(_0x13a7('0x10'));var Redis=require(_0x13a7('0x11'));var authService=require(_0x13a7('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x13a7('0x13'));var logger=require('../../config/logger')(_0x13a7('0x14'));var utils=require(_0x13a7('0x15'));var config=require('../../config/environment');var db=require(_0x13a7('0x16'))['db'];function respondWithStatusCode(_0x45e25f,_0x5024af){_0x5024af=_0x5024af||0xcc;return function(_0x516a4d){if(_0x516a4d){return _0x45e25f[_0x13a7('0x17')](_0x5024af);}return _0x45e25f['status'](_0x5024af)[_0x13a7('0x18')]();};}function respondWithResult(_0x512c4f,_0x245065){_0x245065=_0x245065||0xc8;return function(_0x3193bf){if(_0x3193bf){return _0x512c4f[_0x13a7('0x19')](_0x245065)[_0x13a7('0x1a')](_0x3193bf);}};}function respondWithFilteredResult(_0x2a0445,_0x39e834){return function(_0x5e8dec){if(_0x5e8dec){var _0x79313f=_0x5e8dec[_0x13a7('0x1b')],_0x1122a5=_0x39e834['offset'],_0x465548=_0x39e834[_0x13a7('0x1c')]+_0x39e834[_0x13a7('0x1d')],_0x3fb4e3;if(_0x465548>=_0x79313f){_0x465548=_0x79313f;_0x3fb4e3=0xc8;}else{_0x3fb4e3=0xce;}_0x2a0445[_0x13a7('0x19')](_0x3fb4e3);return _0x2a0445[_0x13a7('0x1e')](_0x13a7('0x1f'),_0x1122a5+'-'+_0x465548+'/'+_0x79313f)['json'](_0x5e8dec);}return null;};}function patchUpdates(_0x1e844f){return function(_0xee9733){try{jsonpatch[_0x13a7('0x20')](_0xee9733,_0x1e844f,!![]);}catch(_0x438001){return BPromise[_0x13a7('0x21')](_0x438001);}return _0xee9733[_0x13a7('0x22')]();};}function saveUpdates(_0x41d97c,_0xab0faf){return function(_0xd193bc){if(_0xd193bc){return _0xd193bc[_0x13a7('0x23')](_0x41d97c)[_0x13a7('0x24')](function(_0x33c446){return _0x33c446;});}return null;};}function removeEntity(_0xa42ac0,_0x185fe0){return function(_0x1354c3){if(_0x1354c3){return _0x1354c3[_0x13a7('0x25')]()['then'](function(){_0xa42ac0['status'](0xcc)[_0x13a7('0x18')]();});}};}function handleEntityNotFound(_0x5c60bf,_0x53587c){return function(_0x8b4f39){if(!_0x8b4f39){_0x5c60bf[_0x13a7('0x17')](0x194);}return _0x8b4f39;};}function handleError(_0x4ef09d,_0x4ce565){_0x4ce565=_0x4ce565||0x1f4;return function(_0x2b88d1){logger[_0x13a7('0x26')](_0x2b88d1[_0x13a7('0x27')]);if(_0x2b88d1[_0x13a7('0x28')]){delete _0x2b88d1[_0x13a7('0x28')];}_0x4ef09d[_0x13a7('0x19')](_0x4ce565)[_0x13a7('0x29')](_0x2b88d1);};}exports['index']=function(_0x180bf9,_0x5b718c){var _0x1645c0={},_0x41efc8={},_0x549458={'count':0x0,'rows':[]};var _0x5c342c=db['JscriptyQuestionReport'][_0x13a7('0x2a')];_0x41efc8[_0x13a7('0x2b')]=_[_0x13a7('0x2c')](_0x5c342c);_0x41efc8[_0x13a7('0x2d')]=_[_0x13a7('0x2c')](_0x180bf9[_0x13a7('0x2d')]);_0x41efc8[_0x13a7('0x2e')]=_[_0x13a7('0x2f')](_0x41efc8[_0x13a7('0x2b')],_0x41efc8['query']);_0x1645c0['attributes']=_[_0x13a7('0x2f')](_0x41efc8['model'],qs['fields'](_0x180bf9['query'][_0x13a7('0x30')]));_0x1645c0['attributes']=_0x1645c0[_0x13a7('0x31')][_0x13a7('0x32')]?_0x1645c0[_0x13a7('0x31')]:_0x41efc8[_0x13a7('0x2b')];if(!_0x180bf9['query'][_0x13a7('0x33')](_0x13a7('0x34'))){_0x1645c0[_0x13a7('0x1d')]=qs[_0x13a7('0x1d')](_0x180bf9[_0x13a7('0x2d')][_0x13a7('0x1d')]);_0x1645c0['offset']=qs[_0x13a7('0x1c')](_0x180bf9['query'][_0x13a7('0x1c')]);}_0x1645c0['order']=qs[_0x13a7('0x35')](_0x180bf9['query'][_0x13a7('0x35')]);_0x1645c0[_0x13a7('0x36')]=qs['filters'](_[_0x13a7('0x37')](_0x180bf9[_0x13a7('0x2d')],_0x41efc8[_0x13a7('0x2e')]));if(_0x180bf9[_0x13a7('0x2d')][_0x13a7('0x38')]){_0x1645c0[_0x13a7('0x36')]=_['merge'](_0x1645c0[_0x13a7('0x36')],{'$or':_[_0x13a7('0x39')](_0x5c342c,function(_0x34ed9f){if(_0x34ed9f[_0x13a7('0x3a')][_0x13a7('0x3b')]!==_0x13a7('0x3c')){var _0x3c9555={};_0x3c9555[_0x34ed9f[_0x13a7('0x3d')]]={'$like':'%'+_0x180bf9['query']['filter']+'%'};return _0x3c9555;}})});}_0x1645c0=_[_0x13a7('0x3e')]({},_0x1645c0,_0x180bf9[_0x13a7('0x3f')]);var _0x179eac={'where':_0x1645c0[_0x13a7('0x36')]};return db[_0x13a7('0x40')][_0x13a7('0x1b')](_0x179eac)[_0x13a7('0x24')](function(_0x5ca5fd){_0x549458[_0x13a7('0x1b')]=_0x5ca5fd;if(_0x180bf9[_0x13a7('0x2d')]['includeAll']){_0x1645c0[_0x13a7('0x41')]=[{'all':!![]}];}return db[_0x13a7('0x40')][_0x13a7('0x42')](_0x1645c0);})[_0x13a7('0x24')](function(_0x40ade0){_0x549458[_0x13a7('0x43')]=_0x40ade0;return _0x549458;})[_0x13a7('0x24')](respondWithFilteredResult(_0x5b718c,_0x1645c0))['catch'](handleError(_0x5b718c,null));};exports[_0x13a7('0x44')]=function(_0xf59a48,_0x3ad052){var _0x44c991={'raw':!![],'where':{'id':_0xf59a48['params']['id']}},_0x4bce24={};_0x4bce24[_0x13a7('0x2b')]=_[_0x13a7('0x2c')](db[_0x13a7('0x40')][_0x13a7('0x2a')]);_0x4bce24[_0x13a7('0x2d')]=_[_0x13a7('0x2c')](_0xf59a48[_0x13a7('0x2d')]);_0x4bce24[_0x13a7('0x2e')]=_[_0x13a7('0x2f')](_0x4bce24[_0x13a7('0x2b')],_0x4bce24[_0x13a7('0x2d')]);_0x44c991[_0x13a7('0x31')]=_['intersection'](_0x4bce24['model'],qs[_0x13a7('0x30')](_0xf59a48['query'][_0x13a7('0x30')]));_0x44c991[_0x13a7('0x31')]=_0x44c991[_0x13a7('0x31')]['length']?_0x44c991[_0x13a7('0x31')]:_0x4bce24[_0x13a7('0x2b')];if(_0xf59a48['query'][_0x13a7('0x45')]){_0x44c991[_0x13a7('0x41')]=[{'all':!![]}];}_0x44c991=_[_0x13a7('0x3e')]({},_0x44c991,_0xf59a48[_0x13a7('0x3f')]);return db[_0x13a7('0x40')]['find'](_0x44c991)['then'](handleEntityNotFound(_0x3ad052,null))[_0x13a7('0x24')](respondWithResult(_0x3ad052,null))[_0x13a7('0x46')](handleError(_0x3ad052,null));};exports[_0x13a7('0x47')]=function(_0x4efc44,_0x50f048){return db['JscriptyQuestionReport'][_0x13a7('0x47')](_0x4efc44[_0x13a7('0x48')],{})[_0x13a7('0x24')](respondWithResult(_0x50f048,0xc9))['catch'](handleError(_0x50f048,null));};exports[_0x13a7('0x23')]=function(_0x5805bf,_0xecde44){if(_0x5805bf[_0x13a7('0x48')]['id']){delete _0x5805bf[_0x13a7('0x48')]['id'];}return db['JscriptyQuestionReport'][_0x13a7('0x49')]({'where':{'id':_0x5805bf['params']['id']}})[_0x13a7('0x24')](handleEntityNotFound(_0xecde44,null))[_0x13a7('0x24')](saveUpdates(_0x5805bf[_0x13a7('0x48')],null))[_0x13a7('0x24')](respondWithResult(_0xecde44,null))[_0x13a7('0x46')](handleError(_0xecde44,null));};exports[_0x13a7('0x25')]=function(_0x3d89df,_0x1d13cc){return db[_0x13a7('0x40')][_0x13a7('0x49')]({'where':{'id':_0x3d89df['params']['id']}})[_0x13a7('0x24')](handleEntityNotFound(_0x1d13cc,null))[_0x13a7('0x24')](removeEntity(_0x1d13cc,null))[_0x13a7('0x46')](handleError(_0x1d13cc,null));};exports[_0x13a7('0x4a')]=function(_0x2af9da,_0x5cddb3){return db['JscriptyQuestionReport'][_0x13a7('0x4a')]()[_0x13a7('0x24')](respondWithResult(_0x5cddb3,null))['catch'](handleError(_0x5cddb3,null));}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js index 09b79cf..70976c7 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 _0xf6e6=['../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./jscriptyQuestionReport.attributes','exports','define','JscriptyQuestionReport','report_jscripty_questions','util'];(function(_0x47bfd1,_0x1f0bc5){var _0x161c26=function(_0x4ee13c){while(--_0x4ee13c){_0x47bfd1['push'](_0x47bfd1['shift']());}};_0x161c26(++_0x1f0bc5);}(_0xf6e6,0xef));var _0x6f6e=function(_0x43e61c,_0x17a3c2){_0x43e61c=_0x43e61c-0x0;var _0x51d6fb=_0xf6e6[_0x43e61c];return _0x51d6fb;};'use strict';var _=require('lodash');var util=require(_0x6f6e('0x0'));var logger=require(_0x6f6e('0x1'))('api');var moment=require(_0x6f6e('0x2'));var BPromise=require(_0x6f6e('0x3'));var rp=require(_0x6f6e('0x4'));var fs=require('fs');var path=require(_0x6f6e('0x5'));var rimraf=require('rimraf');var config=require(_0x6f6e('0x6'));var attributes=require(_0x6f6e('0x7'));module[_0x6f6e('0x8')]=function(_0x1bf618,_0xd58003){return _0x1bf618[_0x6f6e('0x9')](_0x6f6e('0xa'),attributes,{'tableName':_0x6f6e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe025=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','report_jscripty_questions'];(function(_0x388e35,_0x563674){var _0x16a2de=function(_0x22209a){while(--_0x22209a){_0x388e35['push'](_0x388e35['shift']());}};_0x16a2de(++_0x563674);}(_0xe025,0x1c2));var _0x5e02=function(_0x5405d9,_0x5a2542){_0x5405d9=_0x5405d9-0x0;var _0x1e86e6=_0xe025[_0x5405d9];return _0x1e86e6;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x5e02('0x0'))(_0x5e02('0x1'));var moment=require(_0x5e02('0x2'));var BPromise=require(_0x5e02('0x3'));var rp=require(_0x5e02('0x4'));var fs=require('fs');var path=require(_0x5e02('0x5'));var rimraf=require(_0x5e02('0x6'));var config=require(_0x5e02('0x7'));var attributes=require('./jscriptyQuestionReport.attributes');module['exports']=function(_0x485e3b,_0x3ab190){return _0x485e3b['define']('JscriptyQuestionReport',attributes,{'tableName':_0x5e02('0x8'),'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 6d2cbff..f7a2558 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 _0x6eee=['../../config/environment','jayson/promise','http','then','info','request\x20sent','stringify','error','JscriptyQuestionReport,\x20%s,\x20%s','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc'];(function(_0x1765dc,_0x17d194){var _0x5e7800=function(_0x6d8197){while(--_0x6d8197){_0x1765dc['push'](_0x1765dc['shift']());}};_0x5e7800(++_0x17d194);}(_0x6eee,0x70));var _0xe6ee=function(_0x3bf5b1,_0x1d3271){_0x3bf5b1=_0x3bf5b1-0x0;var _0x5be984=_0x6eee[_0x3bf5b1];return _0x5be984;};'use strict';var _=require(_0xe6ee('0x0'));var util=require(_0xe6ee('0x1'));var moment=require(_0xe6ee('0x2'));var BPromise=require('bluebird');var rs=require(_0xe6ee('0x3'));var fs=require('fs');var Redis=require(_0xe6ee('0x4'));var db=require(_0xe6ee('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xe6ee('0x6'))(_0xe6ee('0x7'));var config=require(_0xe6ee('0x8'));var jayson=require(_0xe6ee('0x9'));var client=jayson['client'][_0xe6ee('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x27332e,_0x58d148,_0x447a73){return new BPromise(function(_0x4dea6c,_0x9d27bd){return client['request'](_0x27332e,_0x447a73)[_0xe6ee('0xb')](function(_0x215bdb){logger[_0xe6ee('0xc')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x58d148,_0xe6ee('0xd'));logger['debug']('JscriptyQuestionReport,\x20%s,\x20%s,\x20%s',_0x58d148,_0xe6ee('0xd'),JSON[_0xe6ee('0xe')](_0x215bdb));if(_0x215bdb[_0xe6ee('0xf')]){if(_0x215bdb[_0xe6ee('0xf')]['code']===0x1f4){logger[_0xe6ee('0xf')](_0xe6ee('0x10'),_0x58d148,_0x215bdb[_0xe6ee('0xf')][_0xe6ee('0x11')]);return _0x9d27bd(_0x215bdb[_0xe6ee('0xf')][_0xe6ee('0x11')]);}logger[_0xe6ee('0xf')](_0xe6ee('0x10'),_0x58d148,_0x215bdb['error'][_0xe6ee('0x11')]);return _0x4dea6c(_0x215bdb[_0xe6ee('0xf')][_0xe6ee('0x11')]);}else{logger[_0xe6ee('0xc')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x58d148,'request\x20sent');_0x4dea6c(_0x215bdb[_0xe6ee('0x12')][_0xe6ee('0x11')]);}})[_0xe6ee('0x13')](function(_0xef1b66){logger[_0xe6ee('0xf')](_0xe6ee('0x10'),_0x58d148,_0xef1b66);_0x9d27bd(_0xef1b66);});});} \ No newline at end of file +var _0x0ccd=['lodash','util','moment','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','code','error','message','result','catch'];(function(_0x527a53,_0x3265d6){var _0x2332f5=function(_0x3b2d90){while(--_0x3b2d90){_0x527a53['push'](_0x527a53['shift']());}};_0x2332f5(++_0x3265d6);}(_0x0ccd,0x98));var _0xd0cc=function(_0x3480e9,_0x1ce980){_0x3480e9=_0x3480e9-0x0;var _0x389aad=_0x0ccd[_0x3480e9];return _0x389aad;};'use strict';var _=require(_0xd0cc('0x0'));var util=require(_0xd0cc('0x1'));var moment=require(_0xd0cc('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd0cc('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xd0cc('0x4'))(_0xd0cc('0x5'));var config=require(_0xd0cc('0x6'));var jayson=require(_0xd0cc('0x7'));var client=jayson['client'][_0xd0cc('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5b4ebe,_0x30f9c9,_0x1ace2e){return new BPromise(function(_0x31e351,_0x1ea967){return client[_0xd0cc('0x9')](_0x5b4ebe,_0x1ace2e)[_0xd0cc('0xa')](function(_0x39cd65){logger[_0xd0cc('0xb')](_0xd0cc('0xc'),_0x30f9c9,_0xd0cc('0xd'));logger['debug']('JscriptyQuestionReport,\x20%s,\x20%s,\x20%s',_0x30f9c9,'request\x20sent',JSON['stringify'](_0x39cd65));if(_0x39cd65['error']){if(_0x39cd65['error'][_0xd0cc('0xe')]===0x1f4){logger[_0xd0cc('0xf')](_0xd0cc('0xc'),_0x30f9c9,_0x39cd65[_0xd0cc('0xf')][_0xd0cc('0x10')]);return _0x1ea967(_0x39cd65[_0xd0cc('0xf')][_0xd0cc('0x10')]);}logger[_0xd0cc('0xf')](_0xd0cc('0xc'),_0x30f9c9,_0x39cd65[_0xd0cc('0xf')][_0xd0cc('0x10')]);return _0x31e351(_0x39cd65[_0xd0cc('0xf')][_0xd0cc('0x10')]);}else{logger[_0xd0cc('0xb')](_0xd0cc('0xc'),_0x30f9c9,_0xd0cc('0xd'));_0x31e351(_0x39cd65[_0xd0cc('0x11')][_0xd0cc('0x10')]);}})[_0xd0cc('0x12')](function(_0x54b13f){logger[_0xd0cc('0xf')](_0xd0cc('0xc'),_0x30f9c9,_0x54b13f);_0x1ea967(_0x54b13f);});});} \ No newline at end of file diff --git a/server/api/jscriptySessionReport/index.js b/server/api/jscriptySessionReport/index.js index 4734aba..a7d0cb6 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 _0xd246=['../../components/interaction/service','./jscriptySessionReport.controller','isAuthenticated','get','/describe','describe','/:id','/:id/questions','getQuestions','put','update','multer','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xd246,0xf5));var _0x6d24=function(_0x2f454b,_0x4f0132){_0x2f454b=_0x2f454b-0x0;var _0x3077ab=_0xd246[_0x2f454b];return _0x3077ab;};'use strict';var multer=require(_0x6d24('0x0'));var util=require(_0x6d24('0x1'));var path=require(_0x6d24('0x2'));var timeout=require(_0x6d24('0x3'));var express=require(_0x6d24('0x4'));var router=express[_0x6d24('0x5')]();var auth=require(_0x6d24('0x6'));var interaction=require(_0x6d24('0x7'));var config=require('../../config/environment');var controller=require(_0x6d24('0x8'));router['get']('/',auth[_0x6d24('0x9')](),controller['index']);router[_0x6d24('0xa')](_0x6d24('0xb'),auth[_0x6d24('0x9')](),controller[_0x6d24('0xc')]);router[_0x6d24('0xa')](_0x6d24('0xd'),auth[_0x6d24('0x9')](),controller['show']);router['get'](_0x6d24('0xe'),auth['isAuthenticated'](),controller[_0x6d24('0xf')]);router['post']('/',auth[_0x6d24('0x9')](),controller['create']);router[_0x6d24('0x10')](_0x6d24('0xd'),auth['isAuthenticated'](),controller[_0x6d24('0x11')]);router['delete'](_0x6d24('0xd'),auth[_0x6d24('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xb7c8=['create','put','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./jscriptySessionReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/questions','getQuestions','post'];(function(_0x2df583,_0x467e22){var _0x55068c=function(_0x5745cf){while(--_0x5745cf){_0x2df583['push'](_0x2df583['shift']());}};_0x55068c(++_0x467e22);}(_0xb7c8,0x119));var _0x8b7c=function(_0x3e2211,_0x2fede8){_0x3e2211=_0x3e2211-0x0;var _0x9550ae=_0xb7c8[_0x3e2211];return _0x9550ae;};'use strict';var multer=require('multer');var util=require(_0x8b7c('0x0'));var path=require(_0x8b7c('0x1'));var timeout=require(_0x8b7c('0x2'));var express=require(_0x8b7c('0x3'));var router=express[_0x8b7c('0x4')]();var auth=require(_0x8b7c('0x5'));var interaction=require(_0x8b7c('0x6'));var config=require('../../config/environment');var controller=require(_0x8b7c('0x7'));router[_0x8b7c('0x8')]('/',auth[_0x8b7c('0x9')](),controller[_0x8b7c('0xa')]);router[_0x8b7c('0x8')](_0x8b7c('0xb'),auth[_0x8b7c('0x9')](),controller[_0x8b7c('0xc')]);router[_0x8b7c('0x8')](_0x8b7c('0xd'),auth[_0x8b7c('0x9')](),controller[_0x8b7c('0xe')]);router['get'](_0x8b7c('0xf'),auth['isAuthenticated'](),controller[_0x8b7c('0x10')]);router[_0x8b7c('0x11')]('/',auth['isAuthenticated'](),controller[_0x8b7c('0x12')]);router[_0x8b7c('0x13')](_0x8b7c('0xd'),auth['isAuthenticated'](),controller['update']);router[_0x8b7c('0x14')](_0x8b7c('0xd'),auth[_0x8b7c('0x9')](),controller[_0x8b7c('0x15')]);module[_0x8b7c('0x16')]=router; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js b/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js index caf020b..85c882e 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 _0x9f41=['setDataValue','starttime','YYYY-MM-DD\x20HH:mm:ss','DATE','STRING','moment','exports'];(function(_0x832ad,_0x553e9d){var _0x53ff3f=function(_0x4cfb8e){while(--_0x4cfb8e){_0x832ad['push'](_0x832ad['shift']());}};_0x53ff3f(++_0x553e9d);}(_0x9f41,0xa6));var _0x19f4=function(_0x3b57d2,_0x440aa9){_0x3b57d2=_0x3b57d2-0x0;var _0x5a133f=_0x9f41[_0x3b57d2];return _0x5a133f;};'use strict';var moment=require(_0x19f4('0x0'));var Sequelize=require('sequelize');module[_0x19f4('0x1')]={'starttime':{'type':Sequelize['DATE'],'set':function(_0x2cbd6a){this[_0x19f4('0x2')](_0x19f4('0x3'),_0x2cbd6a);this[_0x19f4('0x2')]('endtime',moment()['format'](_0x19f4('0x4')));}},'endtime':{'type':Sequelize[_0x19f4('0x5')]},'membername':{'type':Sequelize[_0x19f4('0x6')]},'projectname':{'type':Sequelize[_0x19f4('0x6')]},'queue':{'type':Sequelize[_0x19f4('0x6')]},'uniqueid':{'type':Sequelize[_0x19f4('0x6')]},'calleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x19f4('0x6')]},'completed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0xb6be=['exports','DATE','starttime','setDataValue','format','YYYY-MM-DD\x20HH:mm:ss','STRING','moment'];(function(_0xa16fad,_0x521eeb){var _0x1f84dc=function(_0x12f034){while(--_0x12f034){_0xa16fad['push'](_0xa16fad['shift']());}};_0x1f84dc(++_0x521eeb);}(_0xb6be,0xe7));var _0xeb6b=function(_0x13ea00,_0x12f610){_0x13ea00=_0x13ea00-0x0;var _0x1f7347=_0xb6be[_0x13ea00];return _0x1f7347;};'use strict';var moment=require(_0xeb6b('0x0'));var Sequelize=require('sequelize');module[_0xeb6b('0x1')]={'starttime':{'type':Sequelize[_0xeb6b('0x2')],'set':function(_0xe2a22){this['setDataValue'](_0xeb6b('0x3'),_0xe2a22);this[_0xeb6b('0x4')]('endtime',moment()[_0xeb6b('0x5')](_0xeb6b('0x6')));}},'endtime':{'type':Sequelize[_0xeb6b('0x2')]},'membername':{'type':Sequelize[_0xeb6b('0x7')]},'projectname':{'type':Sequelize[_0xeb6b('0x7')]},'queue':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xeb6b('0x7')]},'completed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.controller.js b/server/api/jscriptySessionReport/jscriptySessionReport.controller.js index 276e038..cecee37 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 _0x7a54=['order','sort','where','pick','map','type','key','VIRTUAL','field','merge','options','count','includeAll','include','catch','show','params','filters','length','find','create','body','update','describe','getQuestions','hasOwnProperty','SessionId','filter','JscriptyQuestionReport','findAll','rows','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','set','Content-Range','apply','reject','save','then','destroy','sendStatus','error','name','send','JscriptySessionReport','rawAttributes','model','keys','query','intersection','attributes','fields','nolimit','limit'];(function(_0x391c55,_0x168617){var _0xa434e0=function(_0x51fa5c){while(--_0x51fa5c){_0x391c55['push'](_0x391c55['shift']());}};_0xa434e0(++_0x168617);}(_0x7a54,0x106));var _0x47a5=function(_0x56bfc6,_0x28695d){_0x56bfc6=_0x56bfc6-0x0;var _0x125942=_0x7a54[_0x56bfc6];return _0x125942;};'use strict';var pdf=require(_0x47a5('0x0'));var emlformat=require(_0x47a5('0x1'));var rimraf=require(_0x47a5('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x47a5('0x3'));var rp=require(_0x47a5('0x4'));var moment=require('moment');var BPromise=require(_0x47a5('0x5'));var Mustache=require(_0x47a5('0x6'));var util=require(_0x47a5('0x7'));var path=require(_0x47a5('0x8'));var sox=require(_0x47a5('0x9'));var csv=require('to-csv');var ejs=require(_0x47a5('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var db=require(_0x47a5('0x14'))['db'];function respondWithStatusCode(_0xd612dd,_0xd308b8){_0xd308b8=_0xd308b8||0xcc;return function(_0x1eae59){if(_0x1eae59){return _0xd612dd['sendStatus'](_0xd308b8);}return _0xd612dd[_0x47a5('0x15')](_0xd308b8)[_0x47a5('0x16')]();};}function respondWithResult(_0x1cf309,_0x711793){_0x711793=_0x711793||0xc8;return function(_0x139f25){if(_0x139f25){return _0x1cf309[_0x47a5('0x15')](_0x711793)[_0x47a5('0x17')](_0x139f25);}};}function respondWithFilteredResult(_0x190faa,_0x4e99a8){return function(_0x362359){if(_0x362359){var _0x11faf5=_0x362359['count'],_0x3b001e=_0x4e99a8['offset'],_0x2a2cbb=_0x4e99a8[_0x47a5('0x18')]+_0x4e99a8['limit'],_0x1ef44c;if(_0x2a2cbb>=_0x11faf5){_0x2a2cbb=_0x11faf5;_0x1ef44c=0xc8;}else{_0x1ef44c=0xce;}_0x190faa['status'](_0x1ef44c);return _0x190faa[_0x47a5('0x19')](_0x47a5('0x1a'),_0x3b001e+'-'+_0x2a2cbb+'/'+_0x11faf5)[_0x47a5('0x17')](_0x362359);}return null;};}function patchUpdates(_0x1ef371){return function(_0x477b1d){try{jsonpatch[_0x47a5('0x1b')](_0x477b1d,_0x1ef371,!![]);}catch(_0x2763d6){return BPromise[_0x47a5('0x1c')](_0x2763d6);}return _0x477b1d[_0x47a5('0x1d')]();};}function saveUpdates(_0x4a9fcb,_0x1570bc){return function(_0xf160ba){if(_0xf160ba){return _0xf160ba['update'](_0x4a9fcb)[_0x47a5('0x1e')](function(_0x1f03f7){return _0x1f03f7;});}return null;};}function removeEntity(_0x36874d,_0x4c5910){return function(_0xb8ae6c){if(_0xb8ae6c){return _0xb8ae6c[_0x47a5('0x1f')]()[_0x47a5('0x1e')](function(){_0x36874d[_0x47a5('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0xe2dea9,_0x385687){return function(_0x513981){if(!_0x513981){_0xe2dea9[_0x47a5('0x20')](0x194);}return _0x513981;};}function handleError(_0xc4cd63,_0x4437f1){_0x4437f1=_0x4437f1||0x1f4;return function(_0x129ce5){logger[_0x47a5('0x21')](_0x129ce5['stack']);if(_0x129ce5['name']){delete _0x129ce5[_0x47a5('0x22')];}_0xc4cd63['status'](_0x4437f1)[_0x47a5('0x23')](_0x129ce5);};}exports['index']=function(_0x23cb77,_0x378208){var _0x36ad34={},_0x1dac65={},_0x21f296={'count':0x0,'rows':[]};var _0x3ba0b7=db[_0x47a5('0x24')][_0x47a5('0x25')];_0x1dac65[_0x47a5('0x26')]=_[_0x47a5('0x27')](_0x3ba0b7);_0x1dac65[_0x47a5('0x28')]=_[_0x47a5('0x27')](_0x23cb77[_0x47a5('0x28')]);_0x1dac65['filters']=_[_0x47a5('0x29')](_0x1dac65['model'],_0x1dac65[_0x47a5('0x28')]);_0x36ad34[_0x47a5('0x2a')]=_[_0x47a5('0x29')](_0x1dac65['model'],qs[_0x47a5('0x2b')](_0x23cb77[_0x47a5('0x28')][_0x47a5('0x2b')]));_0x36ad34[_0x47a5('0x2a')]=_0x36ad34['attributes']['length']?_0x36ad34[_0x47a5('0x2a')]:_0x1dac65[_0x47a5('0x26')];if(!_0x23cb77['query']['hasOwnProperty'](_0x47a5('0x2c'))){_0x36ad34[_0x47a5('0x2d')]=qs['limit'](_0x23cb77[_0x47a5('0x28')]['limit']);_0x36ad34[_0x47a5('0x18')]=qs[_0x47a5('0x18')](_0x23cb77['query']['offset']);}_0x36ad34[_0x47a5('0x2e')]=qs['sort'](_0x23cb77[_0x47a5('0x28')][_0x47a5('0x2f')]);_0x36ad34[_0x47a5('0x30')]=qs['filters'](_[_0x47a5('0x31')](_0x23cb77['query'],_0x1dac65['filters']));if(_0x23cb77[_0x47a5('0x28')]['filter']){_0x36ad34[_0x47a5('0x30')]=_['merge'](_0x36ad34[_0x47a5('0x30')],{'$or':_[_0x47a5('0x32')](_0x3ba0b7,function(_0x38c8d4){if(_0x38c8d4[_0x47a5('0x33')][_0x47a5('0x34')]!==_0x47a5('0x35')){var _0xee582c={};_0xee582c[_0x38c8d4[_0x47a5('0x36')]]={'$like':'%'+_0x23cb77[_0x47a5('0x28')]['filter']+'%'};return _0xee582c;}})});}_0x36ad34=_[_0x47a5('0x37')]({},_0x36ad34,_0x23cb77[_0x47a5('0x38')]);var _0x511c06={'where':_0x36ad34[_0x47a5('0x30')]};return db[_0x47a5('0x24')][_0x47a5('0x39')](_0x511c06)['then'](function(_0x101f70){_0x21f296[_0x47a5('0x39')]=_0x101f70;if(_0x23cb77['query'][_0x47a5('0x3a')]){_0x36ad34[_0x47a5('0x3b')]=[{'all':!![]}];}return db['JscriptySessionReport']['findAll'](_0x36ad34);})['then'](function(_0x12d9f2){_0x21f296['rows']=_0x12d9f2;return _0x21f296;})[_0x47a5('0x1e')](respondWithFilteredResult(_0x378208,_0x36ad34))[_0x47a5('0x3c')](handleError(_0x378208,null));};exports[_0x47a5('0x3d')]=function(_0x111f0d,_0x1b2c80){var _0xcb5243={'raw':!![],'where':{'id':_0x111f0d[_0x47a5('0x3e')]['id']}},_0x2003b0={};_0x2003b0[_0x47a5('0x26')]=_[_0x47a5('0x27')](db[_0x47a5('0x24')][_0x47a5('0x25')]);_0x2003b0[_0x47a5('0x28')]=_['keys'](_0x111f0d[_0x47a5('0x28')]);_0x2003b0[_0x47a5('0x3f')]=_[_0x47a5('0x29')](_0x2003b0[_0x47a5('0x26')],_0x2003b0['query']);_0xcb5243[_0x47a5('0x2a')]=_['intersection'](_0x2003b0['model'],qs['fields'](_0x111f0d['query'][_0x47a5('0x2b')]));_0xcb5243['attributes']=_0xcb5243[_0x47a5('0x2a')][_0x47a5('0x40')]?_0xcb5243[_0x47a5('0x2a')]:_0x2003b0['model'];if(_0x111f0d[_0x47a5('0x28')][_0x47a5('0x3a')]){_0xcb5243['include']=[{'all':!![]}];}_0xcb5243=_['merge']({},_0xcb5243,_0x111f0d[_0x47a5('0x38')]);return db['JscriptySessionReport'][_0x47a5('0x41')](_0xcb5243)[_0x47a5('0x1e')](handleEntityNotFound(_0x1b2c80,null))[_0x47a5('0x1e')](respondWithResult(_0x1b2c80,null))[_0x47a5('0x3c')](handleError(_0x1b2c80,null));};exports[_0x47a5('0x42')]=function(_0xf0edbb,_0x434227){return db[_0x47a5('0x24')][_0x47a5('0x42')](_0xf0edbb[_0x47a5('0x43')],{})[_0x47a5('0x1e')](respondWithResult(_0x434227,0xc9))[_0x47a5('0x3c')](handleError(_0x434227,null));};exports[_0x47a5('0x44')]=function(_0x3574d4,_0x4e5e7){if(_0x3574d4[_0x47a5('0x43')]['id']){delete _0x3574d4['body']['id'];}return db[_0x47a5('0x24')][_0x47a5('0x41')]({'where':{'id':_0x3574d4['params']['id']}})['then'](handleEntityNotFound(_0x4e5e7,null))[_0x47a5('0x1e')](saveUpdates(_0x3574d4['body'],null))[_0x47a5('0x1e')](respondWithResult(_0x4e5e7,null))[_0x47a5('0x3c')](handleError(_0x4e5e7,null));};exports['destroy']=function(_0x4f62d3,_0x3d85cc){return db['JscriptySessionReport'][_0x47a5('0x41')]({'where':{'id':_0x4f62d3[_0x47a5('0x3e')]['id']}})[_0x47a5('0x1e')](handleEntityNotFound(_0x3d85cc,null))[_0x47a5('0x1e')](removeEntity(_0x3d85cc,null))[_0x47a5('0x3c')](handleError(_0x3d85cc,null));};exports[_0x47a5('0x45')]=function(_0x238ebb,_0x53e994){return db['JscriptySessionReport'][_0x47a5('0x45')]()[_0x47a5('0x1e')](respondWithResult(_0x53e994,null))[_0x47a5('0x3c')](handleError(_0x53e994,null));};exports[_0x47a5('0x46')]=function(_0x2c7020,_0x2c0c86,_0x249de5){var _0x492cf7={'raw':!![],'where':{}};var _0x45cca5={};var _0x1c9a62={'count':0x0,'rows':[]};return db[_0x47a5('0x24')]['findOne']({'where':{'id':_0x2c7020[_0x47a5('0x3e')]['id']}})['then'](handleEntityNotFound(_0x2c0c86,null))[_0x47a5('0x1e')](function(_0xe31817){if(_0xe31817){_0x45cca5[_0x47a5('0x26')]=_[_0x47a5('0x27')](db['JscriptyQuestionReport'][_0x47a5('0x25')]);_0x45cca5[_0x47a5('0x28')]=_[_0x47a5('0x27')](_0x2c7020[_0x47a5('0x28')]);_0x45cca5[_0x47a5('0x3f')]=_[_0x47a5('0x29')](_0x45cca5[_0x47a5('0x26')],_0x45cca5['query']);_0x492cf7[_0x47a5('0x2a')]=_[_0x47a5('0x29')](_0x45cca5[_0x47a5('0x26')],qs[_0x47a5('0x2b')](_0x2c7020[_0x47a5('0x28')][_0x47a5('0x2b')]));_0x492cf7['attributes']=_0x492cf7[_0x47a5('0x2a')][_0x47a5('0x40')]?_0x492cf7[_0x47a5('0x2a')]:_0x45cca5['model'];if(!_0x2c7020[_0x47a5('0x28')][_0x47a5('0x47')](_0x47a5('0x2c'))){_0x492cf7['limit']=qs['limit'](_0x2c7020[_0x47a5('0x28')][_0x47a5('0x2d')]);_0x492cf7['offset']=qs['offset'](_0x2c7020[_0x47a5('0x28')]['offset']);}_0x492cf7[_0x47a5('0x2e')]=qs['sort'](_0x2c7020['query'][_0x47a5('0x2f')]);_0x492cf7[_0x47a5('0x30')]=qs['filters'](_[_0x47a5('0x31')](_0x2c7020[_0x47a5('0x28')],_0x45cca5['filters']));_0x492cf7['where'][_0x47a5('0x48')]=_0xe31817['id'];if(_0x2c7020[_0x47a5('0x28')][_0x47a5('0x49')]){_0x492cf7[_0x47a5('0x30')]=_['merge'](_0x492cf7[_0x47a5('0x30')],{'$or':_[_0x47a5('0x32')](_0x492cf7[_0x47a5('0x2a')],function(_0x5a33b8){var _0x30ea7a={};_0x30ea7a[_0x5a33b8]={'$like':'%'+_0x2c7020['query'][_0x47a5('0x49')]+'%'};return _0x30ea7a;})});}_0x492cf7=_[_0x47a5('0x37')]({},_0x492cf7,_0x2c7020[_0x47a5('0x38')]);return db[_0x47a5('0x4a')][_0x47a5('0x39')]({'where':_0x492cf7['where']})[_0x47a5('0x1e')](function(_0x5d1550){_0x1c9a62['count']=_0x5d1550;if(_0x2c7020['query']['includeAll']){_0x492cf7[_0x47a5('0x3b')]=[{'all':!![]}];}return db[_0x47a5('0x4a')][_0x47a5('0x4b')](_0x492cf7);})['then'](function(_0x4d3db1){_0x1c9a62[_0x47a5('0x4c')]=_0x4d3db1;return _0x1c9a62;});}})[_0x47a5('0x1e')](respondWithFilteredResult(_0x2c0c86,_0x492cf7))[_0x47a5('0x3c')](handleError(_0x2c0c86,null));}; \ No newline at end of file +var _0x7a54=['order','sort','where','pick','map','type','key','VIRTUAL','field','merge','options','count','includeAll','include','catch','show','params','filters','length','find','create','body','update','describe','getQuestions','hasOwnProperty','SessionId','filter','JscriptyQuestionReport','findAll','rows','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','set','Content-Range','apply','reject','save','then','destroy','sendStatus','error','name','send','JscriptySessionReport','rawAttributes','model','keys','query','intersection','attributes','fields','nolimit','limit'];(function(_0x38d4ac,_0x19cf87){var _0x3497fb=function(_0x5dc7a0){while(--_0x5dc7a0){_0x38d4ac['push'](_0x38d4ac['shift']());}};_0x3497fb(++_0x19cf87);}(_0x7a54,0x106));var _0x47a5=function(_0x495b52,_0x579184){_0x495b52=_0x495b52-0x0;var _0x184371=_0x7a54[_0x495b52];return _0x184371;};'use strict';var pdf=require(_0x47a5('0x0'));var emlformat=require(_0x47a5('0x1'));var rimraf=require(_0x47a5('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x47a5('0x3'));var rp=require(_0x47a5('0x4'));var moment=require('moment');var BPromise=require(_0x47a5('0x5'));var Mustache=require(_0x47a5('0x6'));var util=require(_0x47a5('0x7'));var path=require(_0x47a5('0x8'));var sox=require(_0x47a5('0x9'));var csv=require('to-csv');var ejs=require(_0x47a5('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var db=require(_0x47a5('0x14'))['db'];function respondWithStatusCode(_0xd612dd,_0xd308b8){_0xd308b8=_0xd308b8||0xcc;return function(_0x1eae59){if(_0x1eae59){return _0xd612dd['sendStatus'](_0xd308b8);}return _0xd612dd[_0x47a5('0x15')](_0xd308b8)[_0x47a5('0x16')]();};}function respondWithResult(_0x1cf309,_0x711793){_0x711793=_0x711793||0xc8;return function(_0x139f25){if(_0x139f25){return _0x1cf309[_0x47a5('0x15')](_0x711793)[_0x47a5('0x17')](_0x139f25);}};}function respondWithFilteredResult(_0x190faa,_0x4e99a8){return function(_0x362359){if(_0x362359){var _0x11faf5=_0x362359['count'],_0x3b001e=_0x4e99a8['offset'],_0x2a2cbb=_0x4e99a8[_0x47a5('0x18')]+_0x4e99a8['limit'],_0x1ef44c;if(_0x2a2cbb>=_0x11faf5){_0x2a2cbb=_0x11faf5;_0x1ef44c=0xc8;}else{_0x1ef44c=0xce;}_0x190faa['status'](_0x1ef44c);return _0x190faa[_0x47a5('0x19')](_0x47a5('0x1a'),_0x3b001e+'-'+_0x2a2cbb+'/'+_0x11faf5)[_0x47a5('0x17')](_0x362359);}return null;};}function patchUpdates(_0x1ef371){return function(_0x477b1d){try{jsonpatch[_0x47a5('0x1b')](_0x477b1d,_0x1ef371,!![]);}catch(_0x2763d6){return BPromise[_0x47a5('0x1c')](_0x2763d6);}return _0x477b1d[_0x47a5('0x1d')]();};}function saveUpdates(_0x4a9fcb,_0x1570bc){return function(_0xf160ba){if(_0xf160ba){return _0xf160ba['update'](_0x4a9fcb)[_0x47a5('0x1e')](function(_0x1f03f7){return _0x1f03f7;});}return null;};}function removeEntity(_0x36874d,_0x4c5910){return function(_0xb8ae6c){if(_0xb8ae6c){return _0xb8ae6c[_0x47a5('0x1f')]()[_0x47a5('0x1e')](function(){_0x36874d[_0x47a5('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0xe2dea9,_0x385687){return function(_0x513981){if(!_0x513981){_0xe2dea9[_0x47a5('0x20')](0x194);}return _0x513981;};}function handleError(_0xc4cd63,_0x4437f1){_0x4437f1=_0x4437f1||0x1f4;return function(_0x129ce5){logger[_0x47a5('0x21')](_0x129ce5['stack']);if(_0x129ce5['name']){delete _0x129ce5[_0x47a5('0x22')];}_0xc4cd63['status'](_0x4437f1)[_0x47a5('0x23')](_0x129ce5);};}exports['index']=function(_0x23cb77,_0x378208){var _0x36ad34={},_0x1dac65={},_0x21f296={'count':0x0,'rows':[]};var _0x3ba0b7=db[_0x47a5('0x24')][_0x47a5('0x25')];_0x1dac65[_0x47a5('0x26')]=_[_0x47a5('0x27')](_0x3ba0b7);_0x1dac65[_0x47a5('0x28')]=_[_0x47a5('0x27')](_0x23cb77[_0x47a5('0x28')]);_0x1dac65['filters']=_[_0x47a5('0x29')](_0x1dac65['model'],_0x1dac65[_0x47a5('0x28')]);_0x36ad34[_0x47a5('0x2a')]=_[_0x47a5('0x29')](_0x1dac65['model'],qs[_0x47a5('0x2b')](_0x23cb77[_0x47a5('0x28')][_0x47a5('0x2b')]));_0x36ad34[_0x47a5('0x2a')]=_0x36ad34['attributes']['length']?_0x36ad34[_0x47a5('0x2a')]:_0x1dac65[_0x47a5('0x26')];if(!_0x23cb77['query']['hasOwnProperty'](_0x47a5('0x2c'))){_0x36ad34[_0x47a5('0x2d')]=qs['limit'](_0x23cb77[_0x47a5('0x28')]['limit']);_0x36ad34[_0x47a5('0x18')]=qs[_0x47a5('0x18')](_0x23cb77['query']['offset']);}_0x36ad34[_0x47a5('0x2e')]=qs['sort'](_0x23cb77[_0x47a5('0x28')][_0x47a5('0x2f')]);_0x36ad34[_0x47a5('0x30')]=qs['filters'](_[_0x47a5('0x31')](_0x23cb77['query'],_0x1dac65['filters']));if(_0x23cb77[_0x47a5('0x28')]['filter']){_0x36ad34[_0x47a5('0x30')]=_['merge'](_0x36ad34[_0x47a5('0x30')],{'$or':_[_0x47a5('0x32')](_0x3ba0b7,function(_0x38c8d4){if(_0x38c8d4[_0x47a5('0x33')][_0x47a5('0x34')]!==_0x47a5('0x35')){var _0xee582c={};_0xee582c[_0x38c8d4[_0x47a5('0x36')]]={'$like':'%'+_0x23cb77[_0x47a5('0x28')]['filter']+'%'};return _0xee582c;}})});}_0x36ad34=_[_0x47a5('0x37')]({},_0x36ad34,_0x23cb77[_0x47a5('0x38')]);var _0x511c06={'where':_0x36ad34[_0x47a5('0x30')]};return db[_0x47a5('0x24')][_0x47a5('0x39')](_0x511c06)['then'](function(_0x101f70){_0x21f296[_0x47a5('0x39')]=_0x101f70;if(_0x23cb77['query'][_0x47a5('0x3a')]){_0x36ad34[_0x47a5('0x3b')]=[{'all':!![]}];}return db['JscriptySessionReport']['findAll'](_0x36ad34);})['then'](function(_0x12d9f2){_0x21f296['rows']=_0x12d9f2;return _0x21f296;})[_0x47a5('0x1e')](respondWithFilteredResult(_0x378208,_0x36ad34))[_0x47a5('0x3c')](handleError(_0x378208,null));};exports[_0x47a5('0x3d')]=function(_0x111f0d,_0x1b2c80){var _0xcb5243={'raw':!![],'where':{'id':_0x111f0d[_0x47a5('0x3e')]['id']}},_0x2003b0={};_0x2003b0[_0x47a5('0x26')]=_[_0x47a5('0x27')](db[_0x47a5('0x24')][_0x47a5('0x25')]);_0x2003b0[_0x47a5('0x28')]=_['keys'](_0x111f0d[_0x47a5('0x28')]);_0x2003b0[_0x47a5('0x3f')]=_[_0x47a5('0x29')](_0x2003b0[_0x47a5('0x26')],_0x2003b0['query']);_0xcb5243[_0x47a5('0x2a')]=_['intersection'](_0x2003b0['model'],qs['fields'](_0x111f0d['query'][_0x47a5('0x2b')]));_0xcb5243['attributes']=_0xcb5243[_0x47a5('0x2a')][_0x47a5('0x40')]?_0xcb5243[_0x47a5('0x2a')]:_0x2003b0['model'];if(_0x111f0d[_0x47a5('0x28')][_0x47a5('0x3a')]){_0xcb5243['include']=[{'all':!![]}];}_0xcb5243=_['merge']({},_0xcb5243,_0x111f0d[_0x47a5('0x38')]);return db['JscriptySessionReport'][_0x47a5('0x41')](_0xcb5243)[_0x47a5('0x1e')](handleEntityNotFound(_0x1b2c80,null))[_0x47a5('0x1e')](respondWithResult(_0x1b2c80,null))[_0x47a5('0x3c')](handleError(_0x1b2c80,null));};exports[_0x47a5('0x42')]=function(_0xf0edbb,_0x434227){return db[_0x47a5('0x24')][_0x47a5('0x42')](_0xf0edbb[_0x47a5('0x43')],{})[_0x47a5('0x1e')](respondWithResult(_0x434227,0xc9))[_0x47a5('0x3c')](handleError(_0x434227,null));};exports[_0x47a5('0x44')]=function(_0x3574d4,_0x4e5e7){if(_0x3574d4[_0x47a5('0x43')]['id']){delete _0x3574d4['body']['id'];}return db[_0x47a5('0x24')][_0x47a5('0x41')]({'where':{'id':_0x3574d4['params']['id']}})['then'](handleEntityNotFound(_0x4e5e7,null))[_0x47a5('0x1e')](saveUpdates(_0x3574d4['body'],null))[_0x47a5('0x1e')](respondWithResult(_0x4e5e7,null))[_0x47a5('0x3c')](handleError(_0x4e5e7,null));};exports['destroy']=function(_0x4f62d3,_0x3d85cc){return db['JscriptySessionReport'][_0x47a5('0x41')]({'where':{'id':_0x4f62d3[_0x47a5('0x3e')]['id']}})[_0x47a5('0x1e')](handleEntityNotFound(_0x3d85cc,null))[_0x47a5('0x1e')](removeEntity(_0x3d85cc,null))[_0x47a5('0x3c')](handleError(_0x3d85cc,null));};exports[_0x47a5('0x45')]=function(_0x238ebb,_0x53e994){return db['JscriptySessionReport'][_0x47a5('0x45')]()[_0x47a5('0x1e')](respondWithResult(_0x53e994,null))[_0x47a5('0x3c')](handleError(_0x53e994,null));};exports[_0x47a5('0x46')]=function(_0x2c7020,_0x2c0c86,_0x249de5){var _0x492cf7={'raw':!![],'where':{}};var _0x45cca5={};var _0x1c9a62={'count':0x0,'rows':[]};return db[_0x47a5('0x24')]['findOne']({'where':{'id':_0x2c7020[_0x47a5('0x3e')]['id']}})['then'](handleEntityNotFound(_0x2c0c86,null))[_0x47a5('0x1e')](function(_0xe31817){if(_0xe31817){_0x45cca5[_0x47a5('0x26')]=_[_0x47a5('0x27')](db['JscriptyQuestionReport'][_0x47a5('0x25')]);_0x45cca5[_0x47a5('0x28')]=_[_0x47a5('0x27')](_0x2c7020[_0x47a5('0x28')]);_0x45cca5[_0x47a5('0x3f')]=_[_0x47a5('0x29')](_0x45cca5[_0x47a5('0x26')],_0x45cca5['query']);_0x492cf7[_0x47a5('0x2a')]=_[_0x47a5('0x29')](_0x45cca5[_0x47a5('0x26')],qs[_0x47a5('0x2b')](_0x2c7020[_0x47a5('0x28')][_0x47a5('0x2b')]));_0x492cf7['attributes']=_0x492cf7[_0x47a5('0x2a')][_0x47a5('0x40')]?_0x492cf7[_0x47a5('0x2a')]:_0x45cca5['model'];if(!_0x2c7020[_0x47a5('0x28')][_0x47a5('0x47')](_0x47a5('0x2c'))){_0x492cf7['limit']=qs['limit'](_0x2c7020[_0x47a5('0x28')][_0x47a5('0x2d')]);_0x492cf7['offset']=qs['offset'](_0x2c7020[_0x47a5('0x28')]['offset']);}_0x492cf7[_0x47a5('0x2e')]=qs['sort'](_0x2c7020['query'][_0x47a5('0x2f')]);_0x492cf7[_0x47a5('0x30')]=qs['filters'](_[_0x47a5('0x31')](_0x2c7020[_0x47a5('0x28')],_0x45cca5['filters']));_0x492cf7['where'][_0x47a5('0x48')]=_0xe31817['id'];if(_0x2c7020[_0x47a5('0x28')][_0x47a5('0x49')]){_0x492cf7[_0x47a5('0x30')]=_['merge'](_0x492cf7[_0x47a5('0x30')],{'$or':_[_0x47a5('0x32')](_0x492cf7[_0x47a5('0x2a')],function(_0x5a33b8){var _0x30ea7a={};_0x30ea7a[_0x5a33b8]={'$like':'%'+_0x2c7020['query'][_0x47a5('0x49')]+'%'};return _0x30ea7a;})});}_0x492cf7=_[_0x47a5('0x37')]({},_0x492cf7,_0x2c7020[_0x47a5('0x38')]);return db[_0x47a5('0x4a')][_0x47a5('0x39')]({'where':_0x492cf7['where']})[_0x47a5('0x1e')](function(_0x5d1550){_0x1c9a62['count']=_0x5d1550;if(_0x2c7020['query']['includeAll']){_0x492cf7[_0x47a5('0x3b')]=[{'all':!![]}];}return db[_0x47a5('0x4a')][_0x47a5('0x4b')](_0x492cf7);})['then'](function(_0x4d3db1){_0x1c9a62[_0x47a5('0x4c')]=_0x4d3db1;return _0x1c9a62;});}})[_0x47a5('0x1e')](respondWithFilteredResult(_0x2c0c86,_0x492cf7))[_0x47a5('0x3c')](handleError(_0x2c0c86,null));}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.model.js b/server/api/jscriptySessionReport/jscriptySessionReport.model.js index bd32aed..8afea0e 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 _0x1372=['define','JscriptySessionReport','report_jscripty_sessions','lodash','util','api','moment','request-promise','path','rimraf','../../config/environment','./jscriptySessionReport.attributes','exports'];(function(_0x1c890f,_0x1cadd5){var _0x4b88d0=function(_0x8092fb){while(--_0x8092fb){_0x1c890f['push'](_0x1c890f['shift']());}};_0x4b88d0(++_0x1cadd5);}(_0x1372,0x13b));var _0x2137=function(_0x470097,_0x53ef65){_0x470097=_0x470097-0x0;var _0x2ff490=_0x1372[_0x470097];return _0x2ff490;};'use strict';var _=require(_0x2137('0x0'));var util=require(_0x2137('0x1'));var logger=require('../../config/logger')(_0x2137('0x2'));var moment=require(_0x2137('0x3'));var BPromise=require('bluebird');var rp=require(_0x2137('0x4'));var fs=require('fs');var path=require(_0x2137('0x5'));var rimraf=require(_0x2137('0x6'));var config=require(_0x2137('0x7'));var attributes=require(_0x2137('0x8'));module[_0x2137('0x9')]=function(_0x24d5ae,_0x158617){return _0x24d5ae[_0x2137('0xa')](_0x2137('0xb'),attributes,{'tableName':_0x2137('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5a79=['JscriptySessionReport','report_jscripty_sessions','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','exports','define'];(function(_0x3533ef,_0x4af4c8){var _0x2e1f96=function(_0x5e0d12){while(--_0x5e0d12){_0x3533ef['push'](_0x3533ef['shift']());}};_0x2e1f96(++_0x4af4c8);}(_0x5a79,0x7a));var _0x95a7=function(_0x2d2a33,_0x2d1d1f){_0x2d2a33=_0x2d2a33-0x0;var _0x32d8ba=_0x5a79[_0x2d2a33];return _0x32d8ba;};'use strict';var _=require('lodash');var util=require(_0x95a7('0x0'));var logger=require(_0x95a7('0x1'))(_0x95a7('0x2'));var moment=require(_0x95a7('0x3'));var BPromise=require(_0x95a7('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x95a7('0x5'));var rimraf=require(_0x95a7('0x6'));var config=require(_0x95a7('0x7'));var attributes=require('./jscriptySessionReport.attributes');module[_0x95a7('0x8')]=function(_0x15529a,_0x11992a){return _0x15529a[_0x95a7('0x9')](_0x95a7('0xa'),attributes,{'tableName':_0x95a7('0xb'),'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 2b0f2e9..b6dea61 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 _0xe717=['error','code','JscriptySessionReport,\x20%s,\x20%s','message','lodash','util','moment','bluebird','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','then','request\x20sent','debug','stringify'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe717,0x7b));var _0x7e71=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe717[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x7e71('0x0'));var util=require(_0x7e71('0x1'));var moment=require(_0x7e71('0x2'));var BPromise=require(_0x7e71('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x7e71('0x4'));var logger=require(_0x7e71('0x5'))('rpc');var config=require(_0x7e71('0x6'));var jayson=require(_0x7e71('0x7'));var client=jayson[_0x7e71('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x97b15c,_0x5bb899,_0x495b16){return new BPromise(function(_0x176801,_0x5ee458){return client['request'](_0x97b15c,_0x495b16)[_0x7e71('0x9')](function(_0x4f2b19){logger['info']('JscriptySessionReport,\x20%s,\x20%s',_0x5bb899,_0x7e71('0xa'));logger[_0x7e71('0xb')]('JscriptySessionReport,\x20%s,\x20%s,\x20%s',_0x5bb899,'request\x20sent',JSON[_0x7e71('0xc')](_0x4f2b19));if(_0x4f2b19[_0x7e71('0xd')]){if(_0x4f2b19[_0x7e71('0xd')][_0x7e71('0xe')]===0x1f4){logger['error'](_0x7e71('0xf'),_0x5bb899,_0x4f2b19[_0x7e71('0xd')][_0x7e71('0x10')]);return _0x5ee458(_0x4f2b19[_0x7e71('0xd')]['message']);}logger[_0x7e71('0xd')]('JscriptySessionReport,\x20%s,\x20%s',_0x5bb899,_0x4f2b19['error'][_0x7e71('0x10')]);return _0x176801(_0x4f2b19[_0x7e71('0xd')][_0x7e71('0x10')]);}else{logger['info'](_0x7e71('0xf'),_0x5bb899,_0x7e71('0xa'));_0x176801(_0x4f2b19['result'][_0x7e71('0x10')]);}})['catch'](function(_0x3c6d4a){logger[_0x7e71('0xd')]('JscriptySessionReport,\x20%s,\x20%s',_0x5bb899,_0x3c6d4a);_0x5ee458(_0x3c6d4a);});});} \ No newline at end of file +var _0xa3cf=['request','then','info','JscriptySessionReport,\x20%s,\x20%s','request\x20sent','error','code','message','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','client'];(function(_0x632592,_0x2d28bb){var _0x125cb5=function(_0x495b23){while(--_0x495b23){_0x632592['push'](_0x632592['shift']());}};_0x125cb5(++_0x2d28bb);}(_0xa3cf,0x195));var _0xfa3c=function(_0x8e46e9,_0x2fa5bf){_0x8e46e9=_0x8e46e9-0x0;var _0x58ff4a=_0xa3cf[_0x8e46e9];return _0x58ff4a;};'use strict';var _=require(_0xfa3c('0x0'));var util=require('util');var moment=require(_0xfa3c('0x1'));var BPromise=require(_0xfa3c('0x2'));var rs=require(_0xfa3c('0x3'));var fs=require('fs');var Redis=require(_0xfa3c('0x4'));var db=require(_0xfa3c('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xfa3c('0x6'))('rpc');var config=require(_0xfa3c('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xfa3c('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4e2136,_0x102d41,_0xc55312){return new BPromise(function(_0x3e3071,_0x5c1402){return client[_0xfa3c('0x9')](_0x4e2136,_0xc55312)[_0xfa3c('0xa')](function(_0x2de68f){logger[_0xfa3c('0xb')](_0xfa3c('0xc'),_0x102d41,_0xfa3c('0xd'));logger['debug']('JscriptySessionReport,\x20%s,\x20%s,\x20%s',_0x102d41,'request\x20sent',JSON['stringify'](_0x2de68f));if(_0x2de68f[_0xfa3c('0xe')]){if(_0x2de68f[_0xfa3c('0xe')][_0xfa3c('0xf')]===0x1f4){logger[_0xfa3c('0xe')]('JscriptySessionReport,\x20%s,\x20%s',_0x102d41,_0x2de68f[_0xfa3c('0xe')][_0xfa3c('0x10')]);return _0x5c1402(_0x2de68f['error']['message']);}logger[_0xfa3c('0xe')](_0xfa3c('0xc'),_0x102d41,_0x2de68f[_0xfa3c('0xe')][_0xfa3c('0x10')]);return _0x3e3071(_0x2de68f['error'][_0xfa3c('0x10')]);}else{logger[_0xfa3c('0xb')](_0xfa3c('0xc'),_0x102d41,_0xfa3c('0xd'));_0x3e3071(_0x2de68f['result'][_0xfa3c('0x10')]);}})[_0xfa3c('0x11')](function(_0x15987e){logger['error'](_0xfa3c('0xc'),_0x102d41,_0x15987e);_0x5c1402(_0x15987e);});});} \ No newline at end of file diff --git a/server/api/license/index.js b/server/api/license/index.js index 4871711..bef5305 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 _0x9d66=['get','put','isAuthenticated','update','exports','path','../../components/auth/service','../../components/interaction/service','../../config/environment','./license.controller'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x9d66,0x113));var _0x69d6=function(_0x599f44,_0x4d01bb){_0x599f44=_0x599f44-0x0;var _0x3928f2=_0x9d66[_0x599f44];return _0x3928f2;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x69d6('0x0'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var auth=require(_0x69d6('0x1'));var interaction=require(_0x69d6('0x2'));var config=require(_0x69d6('0x3'));var controller=require(_0x69d6('0x4'));router[_0x69d6('0x5')]('/',controller['index']);router[_0x69d6('0x6')]('/:id',auth[_0x69d6('0x7')](),controller[_0x69d6('0x8')]);module[_0x69d6('0x9')]=router; \ No newline at end of file +var _0x5712=['isAuthenticated','update','util','path','connect-timeout','Router','../../config/environment','./license.controller','get','/:id'];(function(_0x56abe6,_0x1dfa2b){var _0x39a04d=function(_0x549f37){while(--_0x549f37){_0x56abe6['push'](_0x56abe6['shift']());}};_0x39a04d(++_0x1dfa2b);}(_0x5712,0xb6));var _0x2571=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x5712[_0x5b644e];return _0x49c6bf;};'use strict';var multer=require('multer');var util=require(_0x2571('0x0'));var path=require(_0x2571('0x1'));var timeout=require(_0x2571('0x2'));var express=require('express');var router=express[_0x2571('0x3')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x2571('0x4'));var controller=require(_0x2571('0x5'));router[_0x2571('0x6')]('/',controller['index']);router['put'](_0x2571('0x7'),auth[_0x2571('0x8')](),controller[_0x2571('0x9')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/license/license.attributes.js b/server/api/license/license.attributes.js index c5db144..c1ccc6e 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 _0x524e=['STRING','INTEGER','TEXT'];(function(_0x1486e5,_0x39684f){var _0x29d89b=function(_0x4a0a80){while(--_0x4a0a80){_0x1486e5['push'](_0x1486e5['shift']());}};_0x29d89b(++_0x39684f);}(_0x524e,0x15e));var _0xe524=function(_0x366a65,_0x588f71){_0x366a65=_0x366a65-0x0;var _0x3941db=_0x524e[_0x366a65];return _0x3941db;};'use strict';var Sequelize=require('sequelize');module['exports']={'license':{'type':Sequelize[_0xe524('0x0')]},'data1':{'type':Sequelize[_0xe524('0x1')]},'data2':{'type':Sequelize[_0xe524('0x1')]},'chatLicenseExceeded':{'type':Sequelize[_0xe524('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x46ed=['sequelize','exports','STRING','INTEGER'];(function(_0x4df6f9,_0x44bd65){var _0x4b1a73=function(_0xf5adb7){while(--_0xf5adb7){_0x4df6f9['push'](_0x4df6f9['shift']());}};_0x4b1a73(++_0x44bd65);}(_0x46ed,0x168));var _0xd46e=function(_0x49b207,_0x408ade){_0x49b207=_0x49b207-0x0;var _0x2dc8fa=_0x46ed[_0x49b207];return _0x2dc8fa;};'use strict';var Sequelize=require(_0xd46e('0x0'));module[_0xd46e('0x1')]={'license':{'type':Sequelize['TEXT']},'data1':{'type':Sequelize[_0xd46e('0x2')]},'data2':{'type':Sequelize[_0xd46e('0x2')]},'chatLicenseExceeded':{'type':Sequelize[_0xd46e('0x3')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/license/license.controller.js b/server/api/license/license.controller.js index 7404cf5..c82f427 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 _0x2fca=['fast-json-patch','mustache','util','path','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','count','offset','limit','set','Content-Range','apply','reject','update','then','destroy','end','error','name','send','../../config/license/util','index','model','keys','License','rawAttributes','query','filters','intersection','fields','attributes','merge','getLicense','catch','body','find','get','checkLicense','key','demo','html-pdf','eml-format','rimraf','zip-dir'];(function(_0x2e78f9,_0x33b9ed){var _0x441b46=function(_0xc121f4){while(--_0xc121f4){_0x2e78f9['push'](_0x2e78f9['shift']());}};_0x441b46(++_0x33b9ed);}(_0x2fca,0x6a));var _0xa2fc=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x2fca[_0x2641f9];return _0x585741;};'use strict';var pdf=require(_0xa2fc('0x0'));var emlformat=require(_0xa2fc('0x1'));var rimraf=require(_0xa2fc('0x2'));var zipdir=require(_0xa2fc('0x3'));var jsonpatch=require(_0xa2fc('0x4'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xa2fc('0x5'));var util=require(_0xa2fc('0x6'));var path=require(_0xa2fc('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xa2fc('0x8'));var fs=require('fs');var _=require(_0xa2fc('0x9'));var squel=require(_0xa2fc('0xa'));var crypto=require(_0xa2fc('0xb'));var jsforce=require(_0xa2fc('0xc'));var deskjs=require(_0xa2fc('0xd'));var toCsv=require('to-csv');var querystring=require(_0xa2fc('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xa2fc('0xf'))('api');var utils=require(_0xa2fc('0x10'));var config=require(_0xa2fc('0x11'));var db=require(_0xa2fc('0x12'))['db'];function respondWithStatusCode(_0x58fbba,_0x4ce2f8){_0x4ce2f8=_0x4ce2f8||0xcc;return function(_0x23e859){if(_0x23e859){return _0x58fbba[_0xa2fc('0x13')](_0x4ce2f8);}return _0x58fbba[_0xa2fc('0x14')](_0x4ce2f8)['end']();};}function respondWithResult(_0x3e618e,_0x3fc21a){_0x3fc21a=_0x3fc21a||0xc8;return function(_0x1ab346){if(_0x1ab346){return _0x3e618e[_0xa2fc('0x14')](_0x3fc21a)['json'](_0x1ab346);}};}function respondWithFilteredResult(_0xa186cc,_0x3cd956){return function(_0xd93d89){if(_0xd93d89){var _0x34e152=_0xd93d89[_0xa2fc('0x15')],_0x1a76f3=_0x3cd956[_0xa2fc('0x16')],_0x36c370=_0x3cd956[_0xa2fc('0x16')]+_0x3cd956[_0xa2fc('0x17')],_0x14e37f;if(_0x36c370>=_0x34e152){_0x36c370=_0x34e152;_0x14e37f=0xc8;}else{_0x14e37f=0xce;}_0xa186cc[_0xa2fc('0x14')](_0x14e37f);return _0xa186cc[_0xa2fc('0x18')](_0xa2fc('0x19'),_0x1a76f3+'-'+_0x36c370+'/'+_0x34e152)['json'](_0xd93d89);}return null;};}function patchUpdates(_0x9fb36d){return function(_0x4c65d3){try{jsonpatch[_0xa2fc('0x1a')](_0x4c65d3,_0x9fb36d,!![]);}catch(_0x3201e6){return BPromise[_0xa2fc('0x1b')](_0x3201e6);}return _0x4c65d3['save']();};}function saveUpdates(_0x1ad013,_0x31be59){return function(_0x233ef7){if(_0x233ef7){return _0x233ef7[_0xa2fc('0x1c')](_0x1ad013)[_0xa2fc('0x1d')](function(_0x4dd004){return _0x4dd004;});}return null;};}function removeEntity(_0x4422e6,_0x4b3c06){return function(_0x56eefe){if(_0x56eefe){return _0x56eefe[_0xa2fc('0x1e')]()[_0xa2fc('0x1d')](function(){_0x4422e6[_0xa2fc('0x14')](0xcc)[_0xa2fc('0x1f')]();});}};}function handleEntityNotFound(_0x15956c,_0x638b00){return function(_0x44d1c5){if(!_0x44d1c5){_0x15956c[_0xa2fc('0x13')](0x194);}return _0x44d1c5;};}function handleError(_0x57fa3d,_0x373613){_0x373613=_0x373613||0x1f4;return function(_0x4627b4){logger[_0xa2fc('0x20')](_0x4627b4['stack']);if(_0x4627b4[_0xa2fc('0x21')]){delete _0x4627b4['name'];}_0x57fa3d['status'](_0x373613)[_0xa2fc('0x22')](_0x4627b4);};}var utilLicense=require(_0xa2fc('0x23'));exports[_0xa2fc('0x24')]=function(_0x3405f7,_0x39a0ea){var _0x2c39fd={'raw':!![],'where':{'id':0x1}},_0x3e410f={};_0x3e410f[_0xa2fc('0x25')]=_[_0xa2fc('0x26')](db[_0xa2fc('0x27')][_0xa2fc('0x28')]);_0x3e410f[_0xa2fc('0x29')]=_['keys'](_0x3405f7[_0xa2fc('0x29')]);_0x3e410f[_0xa2fc('0x2a')]=_[_0xa2fc('0x2b')](_0x3e410f[_0xa2fc('0x25')],_0x3e410f[_0xa2fc('0x29')]);_0x2c39fd['attributes']=_[_0xa2fc('0x2b')](_0x3e410f[_0xa2fc('0x25')],qs[_0xa2fc('0x2c')](_0x3405f7['query'][_0xa2fc('0x2c')]));_0x2c39fd['attributes']=_0x2c39fd[_0xa2fc('0x2d')]['length']?_0x2c39fd[_0xa2fc('0x2d')]:_0x3e410f['model'];_0x2c39fd=_[_0xa2fc('0x2e')]({},_0x2c39fd,_0x3405f7['options']);return utilLicense[_0xa2fc('0x2f')](_0x2c39fd)[_0xa2fc('0x1d')](respondWithResult(_0x39a0ea,null))[_0xa2fc('0x30')](handleError(_0x39a0ea,null));};exports[_0xa2fc('0x1c')]=function(_0x22a962,_0x469a94){if(_0x22a962[_0xa2fc('0x31')]['id']){delete _0x22a962[_0xa2fc('0x31')]['id'];}return db[_0xa2fc('0x27')][_0xa2fc('0x32')]({'where':{'id':_0x22a962['params']['id']}})['then'](handleEntityNotFound(_0x469a94,null))[_0xa2fc('0x1d')](function(_0x4e00d1){var _0x37f40f=_0x4e00d1[_0xa2fc('0x33')]({'plain':!![]});return utilLicense[_0xa2fc('0x34')](_0x37f40f,_0x22a962['body'][_0xa2fc('0x35')]);})['then'](function(_0x5b1f54){if(!_0x5b1f54[_0xa2fc('0x36')]){return saveUpdates(_0x22a962[_0xa2fc('0x31')],null);}return _0x5b1f54;})[_0xa2fc('0x1d')](respondWithResult(_0x469a94,null))['catch'](handleError(_0x469a94,null));}; \ No newline at end of file +var _0xf5c8=['html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','count','offset','limit','set','Content-Range','save','update','then','stack','name','send','index','model','rawAttributes','query','keys','filters','intersection','attributes','fields','getLicense','body','License','find','params','get','key','catch'];(function(_0x2f482c,_0x243739){var _0x1ee791=function(_0x202d55){while(--_0x202d55){_0x2f482c['push'](_0x2f482c['shift']());}};_0x1ee791(++_0x243739);}(_0xf5c8,0x1d0));var _0x8f5c=function(_0x254076,_0x5e7b8d){_0x254076=_0x254076-0x0;var _0x21a93e=_0xf5c8[_0x254076];return _0x21a93e;};'use strict';var pdf=require(_0x8f5c('0x0'));var emlformat=require(_0x8f5c('0x1'));var rimraf=require(_0x8f5c('0x2'));var zipdir=require(_0x8f5c('0x3'));var jsonpatch=require(_0x8f5c('0x4'));var rp=require(_0x8f5c('0x5'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x8f5c('0x6'));var util=require(_0x8f5c('0x7'));var path=require(_0x8f5c('0x8'));var sox=require(_0x8f5c('0x9'));var csv=require(_0x8f5c('0xa'));var ejs=require(_0x8f5c('0xb'));var fs=require('fs');var _=require(_0x8f5c('0xc'));var squel=require(_0x8f5c('0xd'));var crypto=require(_0x8f5c('0xe'));var jsforce=require(_0x8f5c('0xf'));var deskjs=require(_0x8f5c('0x10'));var toCsv=require(_0x8f5c('0xa'));var querystring=require(_0x8f5c('0x11'));var Papa=require(_0x8f5c('0x12'));var Redis=require(_0x8f5c('0x13'));var authService=require(_0x8f5c('0x14'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x8f5c('0x15'))(_0x8f5c('0x16'));var utils=require(_0x8f5c('0x17'));var config=require(_0x8f5c('0x18'));var db=require(_0x8f5c('0x19'))['db'];function respondWithStatusCode(_0x3c588c,_0x3e963f){_0x3e963f=_0x3e963f||0xcc;return function(_0x86c849){if(_0x86c849){return _0x3c588c[_0x8f5c('0x1a')](_0x3e963f);}return _0x3c588c['status'](_0x3e963f)[_0x8f5c('0x1b')]();};}function respondWithResult(_0x208dff,_0x3967d2){_0x3967d2=_0x3967d2||0xc8;return function(_0x20ba5e){if(_0x20ba5e){return _0x208dff[_0x8f5c('0x1c')](_0x3967d2)[_0x8f5c('0x1d')](_0x20ba5e);}};}function respondWithFilteredResult(_0x3adebe,_0x564712){return function(_0x4b0429){if(_0x4b0429){var _0x3bb984=_0x4b0429[_0x8f5c('0x1e')],_0x3d2681=_0x564712['offset'],_0x194f75=_0x564712[_0x8f5c('0x1f')]+_0x564712[_0x8f5c('0x20')],_0x313ba7;if(_0x194f75>=_0x3bb984){_0x194f75=_0x3bb984;_0x313ba7=0xc8;}else{_0x313ba7=0xce;}_0x3adebe['status'](_0x313ba7);return _0x3adebe[_0x8f5c('0x21')](_0x8f5c('0x22'),_0x3d2681+'-'+_0x194f75+'/'+_0x3bb984)[_0x8f5c('0x1d')](_0x4b0429);}return null;};}function patchUpdates(_0x5eff23){return function(_0x132cc2){try{jsonpatch['apply'](_0x132cc2,_0x5eff23,!![]);}catch(_0x56da2d){return BPromise['reject'](_0x56da2d);}return _0x132cc2[_0x8f5c('0x23')]();};}function saveUpdates(_0x710dad,_0x1f74cf){return function(_0x5699a2){if(_0x5699a2){return _0x5699a2[_0x8f5c('0x24')](_0x710dad)['then'](function(_0x78532d){return _0x78532d;});}return null;};}function removeEntity(_0x190fc9,_0x7c9250){return function(_0x5b1a19){if(_0x5b1a19){return _0x5b1a19['destroy']()[_0x8f5c('0x25')](function(){_0x190fc9['status'](0xcc)[_0x8f5c('0x1b')]();});}};}function handleEntityNotFound(_0x1533bc,_0x2e3dea){return function(_0x22e4d7){if(!_0x22e4d7){_0x1533bc[_0x8f5c('0x1a')](0x194);}return _0x22e4d7;};}function handleError(_0x57ee2d,_0x1e1559){_0x1e1559=_0x1e1559||0x1f4;return function(_0x342bcf){logger['error'](_0x342bcf[_0x8f5c('0x26')]);if(_0x342bcf[_0x8f5c('0x27')]){delete _0x342bcf[_0x8f5c('0x27')];}_0x57ee2d[_0x8f5c('0x1c')](_0x1e1559)[_0x8f5c('0x28')](_0x342bcf);};}var utilLicense=require('../../config/license/util');exports[_0x8f5c('0x29')]=function(_0x10b9ab,_0x2db8e4){var _0x387d9a={'raw':!![],'where':{'id':0x1}},_0x178d4e={};_0x178d4e[_0x8f5c('0x2a')]=_['keys'](db['License'][_0x8f5c('0x2b')]);_0x178d4e[_0x8f5c('0x2c')]=_[_0x8f5c('0x2d')](_0x10b9ab[_0x8f5c('0x2c')]);_0x178d4e[_0x8f5c('0x2e')]=_[_0x8f5c('0x2f')](_0x178d4e['model'],_0x178d4e[_0x8f5c('0x2c')]);_0x387d9a[_0x8f5c('0x30')]=_[_0x8f5c('0x2f')](_0x178d4e['model'],qs['fields'](_0x10b9ab[_0x8f5c('0x2c')][_0x8f5c('0x31')]));_0x387d9a[_0x8f5c('0x30')]=_0x387d9a[_0x8f5c('0x30')]['length']?_0x387d9a[_0x8f5c('0x30')]:_0x178d4e[_0x8f5c('0x2a')];_0x387d9a=_['merge']({},_0x387d9a,_0x10b9ab['options']);return utilLicense[_0x8f5c('0x32')](_0x387d9a)[_0x8f5c('0x25')](respondWithResult(_0x2db8e4,null))['catch'](handleError(_0x2db8e4,null));};exports['update']=function(_0x3d5f69,_0x2a9898){if(_0x3d5f69[_0x8f5c('0x33')]['id']){delete _0x3d5f69[_0x8f5c('0x33')]['id'];}return db[_0x8f5c('0x34')][_0x8f5c('0x35')]({'where':{'id':_0x3d5f69[_0x8f5c('0x36')]['id']}})[_0x8f5c('0x25')](handleEntityNotFound(_0x2a9898,null))[_0x8f5c('0x25')](function(_0x12533d){var _0x4c268e=_0x12533d[_0x8f5c('0x37')]({'plain':!![]});return utilLicense['checkLicense'](_0x4c268e,_0x3d5f69[_0x8f5c('0x33')][_0x8f5c('0x38')]);})['then'](function(_0x576c77){if(!_0x576c77['demo']){return saveUpdates(_0x3d5f69[_0x8f5c('0x33')],null);}return _0x576c77;})[_0x8f5c('0x25')](respondWithResult(_0x2a9898,null))[_0x8f5c('0x39')](handleError(_0x2a9898,null));}; \ No newline at end of file diff --git a/server/api/license/license.model.js b/server/api/license/license.model.js index 3394179..d0cc226 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 _0xdbd0=['rimraf','./license.attributes','exports','license','lodash','util','../../config/logger','api','moment','request-promise','path'];(function(_0x16aaef,_0x410651){var _0x1c82ef=function(_0x3d802b){while(--_0x3d802b){_0x16aaef['push'](_0x16aaef['shift']());}};_0x1c82ef(++_0x410651);}(_0xdbd0,0x88));var _0x0dbd=function(_0x4bf15d,_0x385c40){_0x4bf15d=_0x4bf15d-0x0;var _0x412d31=_0xdbd0[_0x4bf15d];return _0x412d31;};'use strict';var _=require(_0x0dbd('0x0'));var util=require(_0x0dbd('0x1'));var logger=require(_0x0dbd('0x2'))(_0x0dbd('0x3'));var moment=require(_0x0dbd('0x4'));var BPromise=require('bluebird');var rp=require(_0x0dbd('0x5'));var fs=require('fs');var path=require(_0x0dbd('0x6'));var rimraf=require(_0x0dbd('0x7'));var config=require('../../config/environment');var attributes=require(_0x0dbd('0x8'));module[_0x0dbd('0x9')]=function(_0xcd515f,_0x3bd770){return _0xcd515f['define']('License',attributes,{'tableName':_0x0dbd('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x96c0=['License','lodash','util','../../config/logger','api','moment','request-promise','../../config/environment','./license.attributes','exports'];(function(_0x581c62,_0x5bdb37){var _0x49334a=function(_0x4ce97f){while(--_0x4ce97f){_0x581c62['push'](_0x581c62['shift']());}};_0x49334a(++_0x5bdb37);}(_0x96c0,0xdd));var _0x096c=function(_0x12d571,_0x490756){_0x12d571=_0x12d571-0x0;var _0x58e02f=_0x96c0[_0x12d571];return _0x58e02f;};'use strict';var _=require(_0x096c('0x0'));var util=require(_0x096c('0x1'));var logger=require(_0x096c('0x2'))(_0x096c('0x3'));var moment=require(_0x096c('0x4'));var BPromise=require('bluebird');var rp=require(_0x096c('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x096c('0x6'));var attributes=require(_0x096c('0x7'));module[_0x096c('0x8')]=function(_0x247358,_0x9770){return _0x247358['define'](_0x096c('0x9'),attributes,{'tableName':'license','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 1c06f8f..5898ecc 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 _0x43b1=['info','License,\x20%s,\x20%s','debug','License,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then'];(function(_0x3e10c5,_0x48664d){var _0x2cf6ae=function(_0x584974){while(--_0x584974){_0x3e10c5['push'](_0x3e10c5['shift']());}};_0x2cf6ae(++_0x48664d);}(_0x43b1,0x7d));var _0x143b=function(_0x5b6011,_0x3c7ef6){_0x5b6011=_0x5b6011-0x0;var _0xedc20c=_0x43b1[_0x5b6011];return _0xedc20c;};'use strict';var _=require(_0x143b('0x0'));var util=require(_0x143b('0x1'));var moment=require(_0x143b('0x2'));var BPromise=require('bluebird');var rs=require(_0x143b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x143b('0x4'))['db'];var utils=require(_0x143b('0x5'));var logger=require(_0x143b('0x6'))(_0x143b('0x7'));var config=require(_0x143b('0x8'));var jayson=require(_0x143b('0x9'));var client=jayson['client'][_0x143b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2236ae,_0x470edc,_0x519333){return new BPromise(function(_0x453a09,_0x14d91f){return client[_0x143b('0xb')](_0x2236ae,_0x519333)[_0x143b('0xc')](function(_0x34bd85){logger[_0x143b('0xd')](_0x143b('0xe'),_0x470edc,'request\x20sent');logger[_0x143b('0xf')](_0x143b('0x10'),_0x470edc,'request\x20sent',JSON['stringify'](_0x34bd85));if(_0x34bd85[_0x143b('0x11')]){if(_0x34bd85['error'][_0x143b('0x12')]===0x1f4){logger[_0x143b('0x11')]('License,\x20%s,\x20%s',_0x470edc,_0x34bd85[_0x143b('0x11')][_0x143b('0x13')]);return _0x14d91f(_0x34bd85[_0x143b('0x11')][_0x143b('0x13')]);}logger[_0x143b('0x11')](_0x143b('0xe'),_0x470edc,_0x34bd85[_0x143b('0x11')][_0x143b('0x13')]);return _0x453a09(_0x34bd85[_0x143b('0x11')][_0x143b('0x13')]);}else{logger[_0x143b('0xd')](_0x143b('0xe'),_0x470edc,_0x143b('0x14'));_0x453a09(_0x34bd85[_0x143b('0x15')][_0x143b('0x13')]);}})[_0x143b('0x16')](function(_0x43ab39){logger['error']('License,\x20%s,\x20%s',_0x470edc,_0x43ab39);_0x14d91f(_0x43ab39);});});} \ No newline at end of file +var _0x9993=['error','code','message','info','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','License,\x20%s,\x20%s','request\x20sent','License,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x53da71,_0x2d666e){var _0xa5e88a=function(_0x570235){while(--_0x570235){_0x53da71['push'](_0x53da71['shift']());}};_0xa5e88a(++_0x2d666e);}(_0x9993,0x109));var _0x3999=function(_0x5c2e3e,_0x26ecd3){_0x5c2e3e=_0x5c2e3e-0x0;var _0x53f64a=_0x9993[_0x5c2e3e];return _0x53f64a;};'use strict';var _=require(_0x3999('0x0'));var util=require('util');var moment=require(_0x3999('0x1'));var BPromise=require(_0x3999('0x2'));var rs=require(_0x3999('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3999('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x3999('0x5'))(_0x3999('0x6'));var config=require(_0x3999('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x3999('0x8')][_0x3999('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x536de7,_0xc27316,_0x85b5af){return new BPromise(function(_0x4c1a49,_0x77282){return client[_0x3999('0xa')](_0x536de7,_0x85b5af)['then'](function(_0x3dd61){logger['info'](_0x3999('0xb'),_0xc27316,_0x3999('0xc'));logger['debug'](_0x3999('0xd'),_0xc27316,_0x3999('0xc'),JSON[_0x3999('0xe')](_0x3dd61));if(_0x3dd61[_0x3999('0xf')]){if(_0x3dd61[_0x3999('0xf')][_0x3999('0x10')]===0x1f4){logger[_0x3999('0xf')]('License,\x20%s,\x20%s',_0xc27316,_0x3dd61[_0x3999('0xf')][_0x3999('0x11')]);return _0x77282(_0x3dd61['error'][_0x3999('0x11')]);}logger[_0x3999('0xf')](_0x3999('0xb'),_0xc27316,_0x3dd61[_0x3999('0xf')]['message']);return _0x4c1a49(_0x3dd61[_0x3999('0xf')]['message']);}else{logger[_0x3999('0x12')]('License,\x20%s,\x20%s',_0xc27316,_0x3999('0xc'));_0x4c1a49(_0x3dd61['result'][_0x3999('0x11')]);}})[_0x3999('0x13')](function(_0x27a62b){logger[_0x3999('0xf')]('License,\x20%s,\x20%s',_0xc27316,_0x27a62b);_0x77282(_0x27a62b);});});} \ No newline at end of file diff --git a/server/api/mailAccount/index.js b/server/api/mailAccount/index.js index 29d2a6b..c55ede9 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 _0xac2b=['index','/describe','describe','/:id','show','/:id/dispositions','getDispositions','getAnswers','/:id/in_servers','getImap','/:id/out_servers','getSmtp','/:id/interactions','getInteractions','/:id/applications','getApplications','getMessages','/:id/verify','/:id/users','getAgents','post','addDisposition','/:id/canned_answers','addAnswer','create','addImap','addSmtp','addInteraction','/:id/send','send','addAgents','update','delete','removeDispositions','removeAnswers','removeImap','removeSmtp','destroy','removeAgents','exports','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./mailAccount.controller','get','isAuthenticated'];(function(_0x1b6964,_0x23297e){var _0x49d2af=function(_0x3cd2b4){while(--_0x3cd2b4){_0x1b6964['push'](_0x1b6964['shift']());}};_0x49d2af(++_0x23297e);}(_0xac2b,0x148));var _0xbac2=function(_0x10dcbe,_0x30d60d){_0x10dcbe=_0x10dcbe-0x0;var _0x294e6b=_0xac2b[_0x10dcbe];return _0x294e6b;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xbac2('0x0'));var timeout=require(_0xbac2('0x1'));var express=require('express');var router=express[_0xbac2('0x2')]();var auth=require(_0xbac2('0x3'));var interaction=require(_0xbac2('0x4'));var config=require('../../config/environment');var controller=require(_0xbac2('0x5'));router[_0xbac2('0x6')]('/',auth[_0xbac2('0x7')](),controller[_0xbac2('0x8')]);router['get'](_0xbac2('0x9'),auth[_0xbac2('0x7')](),controller[_0xbac2('0xa')]);router[_0xbac2('0x6')](_0xbac2('0xb'),auth['isAuthenticated'](),controller[_0xbac2('0xc')]);router['get'](_0xbac2('0xd'),auth[_0xbac2('0x7')](),controller[_0xbac2('0xe')]);router[_0xbac2('0x6')]('/:id/canned_answers',auth[_0xbac2('0x7')](),controller[_0xbac2('0xf')]);router['get'](_0xbac2('0x10'),auth[_0xbac2('0x7')](),controller[_0xbac2('0x11')]);router[_0xbac2('0x6')](_0xbac2('0x12'),auth[_0xbac2('0x7')](),controller[_0xbac2('0x13')]);router['get'](_0xbac2('0x14'),auth[_0xbac2('0x7')](),controller[_0xbac2('0x15')]);router[_0xbac2('0x6')](_0xbac2('0x16'),auth[_0xbac2('0x7')](),controller[_0xbac2('0x17')]);router[_0xbac2('0x6')]('/:id/messages',auth[_0xbac2('0x7')](),controller[_0xbac2('0x18')]);router[_0xbac2('0x6')](_0xbac2('0x19'),auth['isAuthenticated'](),controller['verifySmtp']);router['get'](_0xbac2('0x1a'),auth[_0xbac2('0x7')](),controller[_0xbac2('0x1b')]);router[_0xbac2('0x1c')](_0xbac2('0xd'),auth['isAuthenticated'](),controller[_0xbac2('0x1d')]);router['post'](_0xbac2('0x1e'),auth['isAuthenticated'](),controller[_0xbac2('0x1f')]);router[_0xbac2('0x1c')]('/',auth['isAuthenticated'](),controller[_0xbac2('0x20')]);router['post'](_0xbac2('0x10'),auth[_0xbac2('0x7')](),controller[_0xbac2('0x21')]);router['post']('/:id/out_servers',auth[_0xbac2('0x7')](),controller[_0xbac2('0x22')]);router[_0xbac2('0x1c')]('/:id/interactions',auth[_0xbac2('0x7')](),controller[_0xbac2('0x23')]);router[_0xbac2('0x1c')](_0xbac2('0x16'),auth['isAuthenticated'](),controller['addApplications']);router[_0xbac2('0x1c')](_0xbac2('0x24'),auth[_0xbac2('0x7')](),controller[_0xbac2('0x25')]);router[_0xbac2('0x1c')]('/:id/users',auth[_0xbac2('0x7')](),controller[_0xbac2('0x26')]);router['put'](_0xbac2('0xb'),auth[_0xbac2('0x7')](),controller[_0xbac2('0x27')]);router[_0xbac2('0x28')](_0xbac2('0xd'),auth[_0xbac2('0x7')](),controller[_0xbac2('0x29')]);router['delete'](_0xbac2('0x1e'),auth['isAuthenticated'](),controller[_0xbac2('0x2a')]);router[_0xbac2('0x28')]('/:id/in_servers',auth[_0xbac2('0x7')](),controller[_0xbac2('0x2b')]);router[_0xbac2('0x28')](_0xbac2('0x12'),auth[_0xbac2('0x7')](),controller[_0xbac2('0x2c')]);router['delete']('/:id',auth[_0xbac2('0x7')](),controller[_0xbac2('0x2d')]);router[_0xbac2('0x28')]('/:id/users',auth[_0xbac2('0x7')](),controller[_0xbac2('0x2e')]);module[_0xbac2('0x2f')]=router; \ No newline at end of file +var _0x0a82=['/:id/out_servers','getSmtp','/:id/applications','getApplications','/:id/messages','getMessages','verifySmtp','/:id/users','getAgents','post','addDisposition','addAnswer','create','addImap','addSmtp','/:id/interactions','/:id/send','addAgents','removeDispositions','delete','removeAnswers','removeImap','destroy','removeAgents','multer','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailAccount.controller','get','isAuthenticated','/describe','describe','/:id','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/in_servers'];(function(_0x75f869,_0x3690d6){var _0x10af8b=function(_0x22d3ff){while(--_0x22d3ff){_0x75f869['push'](_0x75f869['shift']());}};_0x10af8b(++_0x3690d6);}(_0x0a82,0x114));var _0x20a8=function(_0x2177a5,_0x53e3df){_0x2177a5=_0x2177a5-0x0;var _0x166755=_0x0a82[_0x2177a5];return _0x166755;};'use strict';var multer=require(_0x20a8('0x0'));var util=require(_0x20a8('0x1'));var path=require(_0x20a8('0x2'));var timeout=require('connect-timeout');var express=require(_0x20a8('0x3'));var router=express['Router']();var auth=require(_0x20a8('0x4'));var interaction=require(_0x20a8('0x5'));var config=require(_0x20a8('0x6'));var controller=require(_0x20a8('0x7'));router[_0x20a8('0x8')]('/',auth[_0x20a8('0x9')](),controller['index']);router[_0x20a8('0x8')](_0x20a8('0xa'),auth[_0x20a8('0x9')](),controller[_0x20a8('0xb')]);router[_0x20a8('0x8')](_0x20a8('0xc'),auth[_0x20a8('0x9')](),controller['show']);router['get'](_0x20a8('0xd'),auth[_0x20a8('0x9')](),controller[_0x20a8('0xe')]);router[_0x20a8('0x8')](_0x20a8('0xf'),auth[_0x20a8('0x9')](),controller[_0x20a8('0x10')]);router['get'](_0x20a8('0x11'),auth['isAuthenticated'](),controller['getImap']);router[_0x20a8('0x8')](_0x20a8('0x12'),auth[_0x20a8('0x9')](),controller[_0x20a8('0x13')]);router[_0x20a8('0x8')]('/:id/interactions',auth['isAuthenticated'](),controller['getInteractions']);router[_0x20a8('0x8')](_0x20a8('0x14'),auth[_0x20a8('0x9')](),controller[_0x20a8('0x15')]);router[_0x20a8('0x8')](_0x20a8('0x16'),auth['isAuthenticated'](),controller[_0x20a8('0x17')]);router[_0x20a8('0x8')]('/:id/verify',auth[_0x20a8('0x9')](),controller[_0x20a8('0x18')]);router[_0x20a8('0x8')](_0x20a8('0x19'),auth[_0x20a8('0x9')](),controller[_0x20a8('0x1a')]);router[_0x20a8('0x1b')](_0x20a8('0xd'),auth[_0x20a8('0x9')](),controller[_0x20a8('0x1c')]);router['post'](_0x20a8('0xf'),auth[_0x20a8('0x9')](),controller[_0x20a8('0x1d')]);router[_0x20a8('0x1b')]('/',auth[_0x20a8('0x9')](),controller[_0x20a8('0x1e')]);router[_0x20a8('0x1b')]('/:id/in_servers',auth[_0x20a8('0x9')](),controller[_0x20a8('0x1f')]);router[_0x20a8('0x1b')](_0x20a8('0x12'),auth[_0x20a8('0x9')](),controller[_0x20a8('0x20')]);router['post'](_0x20a8('0x21'),auth['isAuthenticated'](),controller['addInteraction']);router[_0x20a8('0x1b')](_0x20a8('0x14'),auth[_0x20a8('0x9')](),controller['addApplications']);router[_0x20a8('0x1b')](_0x20a8('0x22'),auth[_0x20a8('0x9')](),controller['send']);router[_0x20a8('0x1b')](_0x20a8('0x19'),auth['isAuthenticated'](),controller[_0x20a8('0x23')]);router['put']('/:id',auth[_0x20a8('0x9')](),controller['update']);router['delete'](_0x20a8('0xd'),auth[_0x20a8('0x9')](),controller[_0x20a8('0x24')]);router[_0x20a8('0x25')](_0x20a8('0xf'),auth[_0x20a8('0x9')](),controller[_0x20a8('0x26')]);router[_0x20a8('0x25')]('/:id/in_servers',auth[_0x20a8('0x9')](),controller[_0x20a8('0x27')]);router[_0x20a8('0x25')]('/:id/out_servers',auth[_0x20a8('0x9')](),controller['removeSmtp']);router['delete'](_0x20a8('0xc'),auth['isAuthenticated'](),controller[_0x20a8('0x28')]);router['delete'](_0x20a8('0x19'),auth['isAuthenticated'](),controller[_0x20a8('0x29')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.attributes.js b/server/api/mailAccount/mailAccount.attributes.js index 3623c20..b150dde 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 _0x27dd=['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','exports','STRING','BOOLEAN'];(function(_0x4d8ed9,_0x2ae284){var _0x1e2140=function(_0x9cca89){while(--_0x9cca89){_0x4d8ed9['push'](_0x4d8ed9['shift']());}};_0x1e2140(++_0x2ae284);}(_0x27dd,0x189));var _0xd27d=function(_0x13b8f3,_0x442821){_0x13b8f3=_0x13b8f3-0x0;var _0x1a6d06=_0x27dd[_0x13b8f3];return _0x1a6d06;};'use strict';var Sequelize=require('sequelize');module[_0xd27d('0x0')]={'description':{'type':Sequelize[_0xd27d('0x1')]},'name':{'type':Sequelize[_0xd27d('0x1')],'allowNull':![]},'service':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0xd27d('0x2')],'defaultValue':!![]},'key':{'type':Sequelize[_0xd27d('0x1')],'allowNull':![]},'template':{'type':Sequelize[_0xd27d('0x3')]},'markAsUnread':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0xd27d('0x1')],'allowNull':![],'defaultValue':_0xd27d('0x4')},'fontSize':{'type':Sequelize[_0xd27d('0x5')](0x2)['UNSIGNED'],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0xd27d('0x3')],'defaultValue':function(){return _0xd27d('0x6');}},'notificationSound':{'type':Sequelize[_0xd27d('0x2')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xd27d('0x2')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xd27d('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xd27d('0x2')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xd27d('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xd27d('0x2')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xd27d('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xd27d('0x5')],'allowNull':!![],'defaultValue':null,'comment':_0xd27d('0x7')},'mandatoryDisposition':{'type':Sequelize[_0xd27d('0x2')],'defaultValue':![],'comment':_0xd27d('0x8'),'set':function(_0x1a6021){if(!_0x1a6021)this[_0xd27d('0x9')](_0xd27d('0xa'),null);this[_0xd27d('0x9')](_0xd27d('0xb'),_0x1a6021);}}}; \ No newline at end of file +var _0x6dbb=['UNSIGNED','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDisposition','exports','STRING','BOOLEAN','TEXT','INTEGER'];(function(_0x1757f2,_0x1b09fa){var _0x5e7212=function(_0x4f1794){while(--_0x4f1794){_0x1757f2['push'](_0x1757f2['shift']());}};_0x5e7212(++_0x1b09fa);}(_0x6dbb,0x131));var _0xb6db=function(_0x1fb395,_0x3b199e){_0x1fb395=_0x1fb395-0x0;var _0x3594a1=_0x6dbb[_0x1fb395];return _0x3594a1;};'use strict';var Sequelize=require('sequelize');module[_0xb6db('0x0')]={'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0xb6db('0x1')],'allowNull':![]},'service':{'type':Sequelize[_0xb6db('0x2')],'defaultValue':![]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0xb6db('0x2')],'defaultValue':!![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'template':{'type':Sequelize[_0xb6db('0x3')]},'markAsUnread':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0xb6db('0x1')],'allowNull':![],'defaultValue':'Arial,Helvetica,sans-serif'},'fontSize':{'type':Sequelize[_0xb6db('0x4')](0x2)[_0xb6db('0x5')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xb6db('0x6');}},'notificationSound':{'type':Sequelize[_0xb6db('0x2')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xb6db('0x2')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xb6db('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xb6db('0x2')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xb6db('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xb6db('0x2')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xb6db('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xb6db('0x4')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xb6db('0x2')],'defaultValue':![],'comment':_0xb6db('0x7'),'set':function(_0x59d548){if(!_0x59d548)this[_0xb6db('0x8')]('mandatoryDispositionPauseId',null);this['setDataValue'](_0xb6db('0x9'),_0x59d548);}}}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.controller.js b/server/api/mailAccount/mailAccount.controller.js index 6db0538..898080a 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 _0xa6cd=['to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','jayson/promise','client','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','request\x20sent','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','MailAccount,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','reject','save','update','get','MailAccounts','UserProfileResource','destroy','stack','name','send','index','MailServerIn','Imap','MailServerOut','Pause','mandatoryDispositionPause','MailAccount','rawAttributes','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','map','type','key','field','options','includeAll','findAll','rows','params','Smtp','keys','include','find','body','describe','MailAccountId','Disposition','create','getDispositions','pick','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','findOne','removeAnswers','email','ListId','active','description','isNil','user','cuser','pass','cpassword','authentication','host','port','service','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','addImap','removeImap','setImap','getSmtp','addSmtp','removeSmtp','setSmtp','addInteraction','MailInteraction','omit','getInteractions','CmContact','User','fullname','internal','Tag','Tags','color','tag','addApplications','MailApplication','bulkCreate','findAndCountAll','priority','getApplications','getMessages','MailMessage','$gte','format','split','CmList','List','DESC','from','attachments','root','server/files/attachments','secure','auth','List\x20not\x20found','Contacts','messageId','subject','attach','out','YYYY-MM-DD\x20HH:mm:ss','Interaction','Messages','verifySmtp','ValidationError','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','spread','userMailAccount:save','removeAgents','emit','userMailAccount:remove','getAgents','html-pdf','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox'];(function(_0x5d24c1,_0xf7cd20){var _0x89701b=function(_0x56f212){while(--_0x56f212){_0x5d24c1['push'](_0x5d24c1['shift']());}};_0x89701b(++_0xf7cd20);}(_0xa6cd,0x176));var _0xda6c=function(_0x5bb0dc,_0x21f96d){_0x5bb0dc=_0x5bb0dc-0x0;var _0x17cbdb=_0xa6cd[_0x5bb0dc];return _0x17cbdb;};'use strict';var pdf=require(_0xda6c('0x0'));var emlformat=require(_0xda6c('0x1'));var rimraf=require(_0xda6c('0x2'));var zipdir=require(_0xda6c('0x3'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xda6c('0x4'));var BPromise=require(_0xda6c('0x5'));var Mustache=require(_0xda6c('0x6'));var util=require(_0xda6c('0x7'));var path=require(_0xda6c('0x8'));var sox=require(_0xda6c('0x9'));var csv=require(_0xda6c('0xa'));var ejs=require(_0xda6c('0xb'));var fs=require('fs');var _=require(_0xda6c('0xc'));var squel=require(_0xda6c('0xd'));var crypto=require(_0xda6c('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xda6c('0xf'));var toCsv=require(_0xda6c('0xa'));var querystring=require(_0xda6c('0x10'));var Papa=require(_0xda6c('0x11'));var Redis=require(_0xda6c('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xda6c('0x13'));var as=require(_0xda6c('0x14'));var hardwareService=require(_0xda6c('0x15'));var logger=require(_0xda6c('0x16'))('api');var utils=require(_0xda6c('0x17'));var config=require(_0xda6c('0x18'));var db=require(_0xda6c('0x19'))['db'];config[_0xda6c('0x1a')]=_[_0xda6c('0x1b')](config[_0xda6c('0x1a')],{'host':_0xda6c('0x1c'),'port':0x18eb});var socket=require(_0xda6c('0x1d'))(new Redis(config[_0xda6c('0x1a')]));require('./mailAccount.socket')['register'](socket);var jayson=require(_0xda6c('0x1e'));var client=jayson[_0xda6c('0x1f')]['http']({'port':0x232b});function checkPasswordPattern(_0x4bd07f,_0x2a3907,_0x1bfc8a){if(_0x1bfc8a){var _0x4e2e29=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4e2e29[_0xda6c('0x20')](_0x2a3907)){return _0x4bd07f;}else{throw new Error(_0xda6c('0x21'));}}else{return _0x4bd07f;}}function respondWithRpcPromise(_0x3002ad,_0x4bbc78,_0x4de824,_0x4b3065){return new BPromise(function(_0x5b7233,_0x2e3334){var _0xa9502b=_0x4b3065||client;return _0xa9502b[_0xda6c('0x22')](_0x3002ad,_0x4de824)[_0xda6c('0x23')](function(_0x12a79e){logger[_0xda6c('0x24')]('MailAccount,\x20%s,\x20%s',_0x4bbc78,_0xda6c('0x25'));logger['debug'](_0xda6c('0x26'),_0x4bbc78,'request\x20sent',JSON[_0xda6c('0x27')](_0x12a79e));if(_0x12a79e[_0xda6c('0x28')]){if(_0x12a79e['error'][_0xda6c('0x29')]===0x1f4){logger[_0xda6c('0x28')](_0xda6c('0x2a'),_0x4bbc78,_0x12a79e[_0xda6c('0x28')][_0xda6c('0x2b')]);return _0x2e3334(_0x12a79e[_0xda6c('0x28')][_0xda6c('0x2b')]);}logger[_0xda6c('0x28')](_0xda6c('0x2a'),_0x4bbc78,_0x12a79e[_0xda6c('0x28')][_0xda6c('0x2b')]);return _0x5b7233(_0x12a79e[_0xda6c('0x28')]['message']);}else{logger['info'](_0xda6c('0x2a'),_0x4bbc78,'request\x20sent');_0x5b7233(_0x12a79e[_0xda6c('0x2c')]['message']);}})[_0xda6c('0x2d')](function(_0x182267){logger[_0xda6c('0x28')](_0xda6c('0x2a'),_0x4bbc78,_0x182267);_0x2e3334(_0x182267);});});}function respondWithStatusCode(_0x2f6443,_0x283f7a){_0x283f7a=_0x283f7a||0xcc;return function(_0x1a1a20){if(_0x1a1a20){return _0x2f6443[_0xda6c('0x2e')](_0x283f7a);}return _0x2f6443[_0xda6c('0x2f')](_0x283f7a)[_0xda6c('0x30')]();};}function respondWithResult(_0x39343c,_0x4feeef){_0x4feeef=_0x4feeef||0xc8;return function(_0x28ca15){if(_0x28ca15){return _0x39343c[_0xda6c('0x2f')](_0x4feeef)[_0xda6c('0x31')](_0x28ca15);}};}function respondWithFilteredResult(_0x197859,_0x53bece){return function(_0xf42b7a){if(_0xf42b7a){var _0x5b0c42=_0xf42b7a[_0xda6c('0x32')],_0x421c57=_0x53bece[_0xda6c('0x33')],_0x1e0db7=_0x53bece['offset']+_0x53bece[_0xda6c('0x34')],_0x34f28b;if(_0x1e0db7>=_0x5b0c42){_0x1e0db7=_0x5b0c42;_0x34f28b=0xc8;}else{_0x34f28b=0xce;}_0x197859['status'](_0x34f28b);return _0x197859['set'](_0xda6c('0x35'),_0x421c57+'-'+_0x1e0db7+'/'+_0x5b0c42)[_0xda6c('0x31')](_0xf42b7a);}return null;};}function patchUpdates(_0x44ea40){return function(_0x139219){try{jsonpatch[_0xda6c('0x36')](_0x139219,_0x44ea40,!![]);}catch(_0x1f81ee){return BPromise[_0xda6c('0x37')](_0x1f81ee);}return _0x139219[_0xda6c('0x38')]();};}function saveUpdates(_0x4ab241,_0x1c3244){return function(_0x1a1d9d){if(_0x1a1d9d){return _0x1a1d9d[_0xda6c('0x39')](_0x4ab241)['then'](function(_0x49030d){return _0x49030d;});}return null;};}function removeEntity(_0x30599e,_0x3b180b){return function(_0x59dd92){if(_0x59dd92){return _0x59dd92['destroy']()[_0xda6c('0x23')](function(){var _0x527f53=_0x59dd92[_0xda6c('0x3a')]({'plain':!![]});var _0x277f5a=_0xda6c('0x3b');return db[_0xda6c('0x3c')][_0xda6c('0x3d')]({'where':{'type':_0x277f5a,'resourceId':_0x527f53['id']}})[_0xda6c('0x23')](function(){return _0x59dd92;});})['then'](function(){_0x30599e[_0xda6c('0x2f')](0xcc)[_0xda6c('0x30')]();});}};}function handleEntityNotFound(_0x1ed924,_0x39b74f){return function(_0x33d6f1){if(!_0x33d6f1){_0x1ed924[_0xda6c('0x2e')](0x194);}return _0x33d6f1;};}function handleError(_0x2cdb83,_0x5c9538){_0x5c9538=_0x5c9538||0x1f4;return function(_0x2398df){logger['error'](_0x2398df[_0xda6c('0x3e')]);if(_0x2398df[_0xda6c('0x3f')]){delete _0x2398df[_0xda6c('0x3f')];}_0x2cdb83[_0xda6c('0x2f')](_0x5c9538)[_0xda6c('0x40')](_0x2398df);};}exports[_0xda6c('0x41')]=function(_0x66df92,_0x241b8d){var _0x48736f={'include':[{'model':db[_0xda6c('0x42')],'as':_0xda6c('0x43')},{'model':db[_0xda6c('0x44')],'as':'Smtp'},{'model':db[_0xda6c('0x45')],'as':_0xda6c('0x46')}]},_0xf4a147={},_0x2c6e1a={'count':0x0,'rows':[]};var _0x3229c8=db[_0xda6c('0x47')][_0xda6c('0x48')];_0xf4a147[_0xda6c('0x49')]=_['keys'](_0x3229c8);_0xf4a147['query']=_['keys'](_0x66df92[_0xda6c('0x4a')]);_0xf4a147[_0xda6c('0x4b')]=_[_0xda6c('0x4c')](_0xf4a147[_0xda6c('0x49')],_0xf4a147[_0xda6c('0x4a')]);_0x48736f[_0xda6c('0x4d')]=_[_0xda6c('0x4c')](_0xf4a147[_0xda6c('0x49')],qs[_0xda6c('0x4e')](_0x66df92[_0xda6c('0x4a')][_0xda6c('0x4e')]));_0x48736f[_0xda6c('0x4d')]=_0x48736f[_0xda6c('0x4d')][_0xda6c('0x4f')]?_0x48736f['attributes']:_0xf4a147[_0xda6c('0x49')];if(!_0x66df92[_0xda6c('0x4a')][_0xda6c('0x50')](_0xda6c('0x51'))){_0x48736f[_0xda6c('0x34')]=qs[_0xda6c('0x34')](_0x66df92[_0xda6c('0x4a')][_0xda6c('0x34')]);_0x48736f['offset']=qs[_0xda6c('0x33')](_0x66df92[_0xda6c('0x4a')][_0xda6c('0x33')]);}_0x48736f[_0xda6c('0x52')]=qs[_0xda6c('0x53')](_0x66df92[_0xda6c('0x4a')][_0xda6c('0x53')]);_0x48736f[_0xda6c('0x54')]=qs[_0xda6c('0x4b')](_['pick'](_0x66df92[_0xda6c('0x4a')],_0xf4a147[_0xda6c('0x4b')]));if(_0x66df92[_0xda6c('0x4a')][_0xda6c('0x55')]){_0x48736f['where']=_[_0xda6c('0x56')](_0x48736f[_0xda6c('0x54')],{'$or':_[_0xda6c('0x57')](_0x3229c8,function(_0x34595f){if(_0x34595f[_0xda6c('0x58')][_0xda6c('0x59')]!=='VIRTUAL'){var _0x393c64={};_0x393c64[_0x34595f[_0xda6c('0x5a')]]={'$like':'%'+_0x66df92[_0xda6c('0x4a')][_0xda6c('0x55')]+'%'};return _0x393c64;}})});}_0x48736f=_[_0xda6c('0x56')]({},_0x48736f,_0x66df92[_0xda6c('0x5b')]);var _0x1e35d8={'where':_0x48736f[_0xda6c('0x54')]};return db[_0xda6c('0x47')][_0xda6c('0x32')](_0x1e35d8)['then'](function(_0x14f90c){_0x2c6e1a[_0xda6c('0x32')]=_0x14f90c;if(_0x66df92[_0xda6c('0x4a')][_0xda6c('0x5c')]){_0x48736f['include']=[{'all':!![]}];}return db['MailAccount'][_0xda6c('0x5d')](_0x48736f);})[_0xda6c('0x23')](function(_0x40e08d){_0x2c6e1a[_0xda6c('0x5e')]=_0x40e08d;return _0x2c6e1a;})[_0xda6c('0x23')](respondWithFilteredResult(_0x241b8d,_0x48736f))[_0xda6c('0x2d')](handleError(_0x241b8d,null));};exports['show']=function(_0x1122dc,_0x26e077){var _0x330198={'raw':![],'where':{'id':_0x1122dc[_0xda6c('0x5f')]['id']},'include':[{'model':db[_0xda6c('0x42')],'as':_0xda6c('0x43')},{'model':db[_0xda6c('0x44')],'as':_0xda6c('0x60')},{'model':db[_0xda6c('0x45')],'as':_0xda6c('0x46')}]},_0x3a493c={};_0x3a493c[_0xda6c('0x49')]=_['keys'](db[_0xda6c('0x47')]['rawAttributes']);_0x3a493c[_0xda6c('0x4a')]=_[_0xda6c('0x61')](_0x1122dc[_0xda6c('0x4a')]);_0x3a493c[_0xda6c('0x4b')]=_[_0xda6c('0x4c')](_0x3a493c['model'],_0x3a493c[_0xda6c('0x4a')]);_0x330198[_0xda6c('0x4d')]=_[_0xda6c('0x4c')](_0x3a493c[_0xda6c('0x49')],qs[_0xda6c('0x4e')](_0x1122dc['query']['fields']));_0x330198['attributes']=_0x330198[_0xda6c('0x4d')][_0xda6c('0x4f')]?_0x330198[_0xda6c('0x4d')]:_0x3a493c['model'];if(_0x1122dc[_0xda6c('0x4a')][_0xda6c('0x5c')]){_0x330198[_0xda6c('0x62')]=[{'all':!![]}];}_0x330198=_[_0xda6c('0x56')]({},_0x330198,_0x1122dc[_0xda6c('0x5b')]);return db[_0xda6c('0x47')][_0xda6c('0x63')](_0x330198)['then'](handleEntityNotFound(_0x26e077,null))[_0xda6c('0x23')](respondWithResult(_0x26e077,null))[_0xda6c('0x2d')](handleError(_0x26e077,null));};exports[_0xda6c('0x39')]=function(_0x3581f6,_0x1c445b){if(_0x3581f6['body']['id']){delete _0x3581f6['body']['id'];}return db[_0xda6c('0x47')][_0xda6c('0x63')]({'where':{'id':_0x3581f6[_0xda6c('0x5f')]['id']},'include':[{'model':db[_0xda6c('0x42')],'as':_0xda6c('0x43')},{'model':db[_0xda6c('0x44')],'as':_0xda6c('0x60')},{'model':db[_0xda6c('0x45')],'as':_0xda6c('0x46')}]})['then'](handleEntityNotFound(_0x1c445b,null))[_0xda6c('0x23')](saveUpdates(_0x3581f6[_0xda6c('0x64')],null))[_0xda6c('0x23')](function(_0x20f0bb){if(_0x20f0bb&&_0x3581f6['body'][_0xda6c('0x43')]){return db['MailServerIn']['update'](_0x3581f6['body'][_0xda6c('0x43')],{'where':{'MailAccountId':_0x20f0bb['id']}})[_0xda6c('0x23')](function(){return _0x20f0bb;});}return _0x20f0bb;})[_0xda6c('0x23')](function(_0x25f1ce){if(_0x25f1ce&&_0x3581f6[_0xda6c('0x64')]['Smtp']){return db[_0xda6c('0x44')][_0xda6c('0x39')](_0x3581f6[_0xda6c('0x64')][_0xda6c('0x60')],{'where':{'MailAccountId':_0x25f1ce['id']}})['then'](function(){return _0x25f1ce;});}return _0x25f1ce;})[_0xda6c('0x23')](respondWithResult(_0x1c445b,null))[_0xda6c('0x2d')](handleError(_0x1c445b,null));};exports[_0xda6c('0x65')]=function(_0x19a97b,_0x4270da){return db[_0xda6c('0x47')][_0xda6c('0x65')]()['then'](respondWithResult(_0x4270da,null))['catch'](handleError(_0x4270da,null));};exports['addDisposition']=function(_0x2cc615,_0x1f7209,_0x56397f){if(_0x2cc615[_0xda6c('0x64')]['id']){delete _0x2cc615['body']['id'];}return db['MailAccount'][_0xda6c('0x63')]({'where':{'id':_0x2cc615[_0xda6c('0x5f')]['id']}})[_0xda6c('0x23')](handleEntityNotFound(_0x1f7209,null))[_0xda6c('0x23')](function(_0x23fb62){if(_0x23fb62){_0x2cc615[_0xda6c('0x64')][_0xda6c('0x66')]=_0x23fb62['id'];return db[_0xda6c('0x67')][_0xda6c('0x68')](_0x2cc615['body']);}})[_0xda6c('0x23')](respondWithResult(_0x1f7209,null))[_0xda6c('0x2d')](handleError(_0x1f7209,null));};exports[_0xda6c('0x69')]=function(_0x59190c,_0x2e3632,_0x3385dc){var _0x251c93={'raw':![],'where':{}};var _0x24b0fb={};var _0x3a6f01={'count':0x0,'rows':[]};return db[_0xda6c('0x47')]['findOne']({'where':{'id':_0x59190c[_0xda6c('0x5f')]['id']}})[_0xda6c('0x23')](handleEntityNotFound(_0x2e3632,null))['then'](function(_0x581807){if(_0x581807){_0x24b0fb['model']=_[_0xda6c('0x61')](db['Disposition'][_0xda6c('0x48')]);_0x24b0fb[_0xda6c('0x4a')]=_[_0xda6c('0x61')](_0x59190c[_0xda6c('0x4a')]);_0x24b0fb[_0xda6c('0x4b')]=_['intersection'](_0x24b0fb[_0xda6c('0x49')],_0x24b0fb[_0xda6c('0x4a')]);_0x251c93[_0xda6c('0x4d')]=_['intersection'](_0x24b0fb[_0xda6c('0x49')],qs[_0xda6c('0x4e')](_0x59190c['query']['fields']));_0x251c93[_0xda6c('0x4d')]=_0x251c93[_0xda6c('0x4d')][_0xda6c('0x4f')]?_0x251c93[_0xda6c('0x4d')]:_0x24b0fb['model'];if(!_0x59190c[_0xda6c('0x4a')][_0xda6c('0x50')](_0xda6c('0x51'))){_0x251c93[_0xda6c('0x34')]=qs[_0xda6c('0x34')](_0x59190c[_0xda6c('0x4a')][_0xda6c('0x34')]);_0x251c93[_0xda6c('0x33')]=qs[_0xda6c('0x33')](_0x59190c[_0xda6c('0x4a')][_0xda6c('0x33')]);}_0x251c93[_0xda6c('0x52')]=qs[_0xda6c('0x53')](_0x59190c[_0xda6c('0x4a')][_0xda6c('0x53')]);_0x251c93[_0xda6c('0x54')]=qs[_0xda6c('0x4b')](_[_0xda6c('0x6a')](_0x59190c[_0xda6c('0x4a')],_0x24b0fb['filters']));_0x251c93[_0xda6c('0x54')][_0xda6c('0x66')]=_0x581807['id'];if(_0x59190c[_0xda6c('0x4a')][_0xda6c('0x55')]){_0x251c93['where']=_[_0xda6c('0x56')](_0x251c93[_0xda6c('0x54')],{'$or':_[_0xda6c('0x57')](_0x251c93[_0xda6c('0x4d')],function(_0x86f01){var _0x5f29df={};_0x5f29df[_0x86f01]={'$like':'%'+_0x59190c['query'][_0xda6c('0x55')]+'%'};return _0x5f29df;})});}_0x251c93=_[_0xda6c('0x56')]({},_0x251c93,_0x59190c['options']);return db[_0xda6c('0x67')][_0xda6c('0x32')]({'where':_0x251c93['where']})[_0xda6c('0x23')](function(_0x549902){_0x3a6f01[_0xda6c('0x32')]=_0x549902;if(_0x59190c['query'][_0xda6c('0x5c')]){_0x251c93[_0xda6c('0x62')]=[{'all':!![]}];}return db['Disposition'][_0xda6c('0x5d')](_0x251c93);})[_0xda6c('0x23')](function(_0x2df145){_0x3a6f01[_0xda6c('0x5e')]=_0x2df145;return _0x3a6f01;});}})['then'](respondWithFilteredResult(_0x2e3632,_0x251c93))[_0xda6c('0x2d')](handleError(_0x2e3632,null));};exports[_0xda6c('0x6b')]=function(_0x31d4a4,_0x10fe04,_0xab1089){return db[_0xda6c('0x47')][_0xda6c('0x63')]({'where':{'id':_0x31d4a4[_0xda6c('0x5f')]['id']}})['then'](handleEntityNotFound(_0x10fe04,null))[_0xda6c('0x23')](function(_0x51bb0e){if(_0x51bb0e){return _0x51bb0e[_0xda6c('0x6b')](_0x31d4a4[_0xda6c('0x4a')][_0xda6c('0x6c')]);}})[_0xda6c('0x23')](respondWithStatusCode(_0x10fe04,null))[_0xda6c('0x2d')](handleError(_0x10fe04,null));};exports[_0xda6c('0x6d')]=function(_0x554ea8,_0x11e9e9,_0x52f06b){if(_0x554ea8['body']['id']){delete _0x554ea8[_0xda6c('0x64')]['id'];}return db[_0xda6c('0x47')][_0xda6c('0x63')]({'where':{'id':_0x554ea8['params']['id']}})[_0xda6c('0x23')](handleEntityNotFound(_0x11e9e9,null))['then'](function(_0x2166c6){if(_0x2166c6){_0x554ea8[_0xda6c('0x64')][_0xda6c('0x66')]=_0x2166c6['id'];return db[_0xda6c('0x6e')][_0xda6c('0x68')](_0x554ea8[_0xda6c('0x64')]);}})[_0xda6c('0x23')](respondWithResult(_0x11e9e9,null))[_0xda6c('0x2d')](handleError(_0x11e9e9,null));};exports[_0xda6c('0x6f')]=function(_0xaafb6f,_0x155f7c,_0x5953f7){var _0x3aed35={'raw':![],'where':{}};var _0x174afb={};var _0x395357={'count':0x0,'rows':[]};return db[_0xda6c('0x47')][_0xda6c('0x70')]({'where':{'id':_0xaafb6f[_0xda6c('0x5f')]['id']}})[_0xda6c('0x23')](handleEntityNotFound(_0x155f7c,null))[_0xda6c('0x23')](function(_0x2b3c57){if(_0x2b3c57){_0x174afb[_0xda6c('0x49')]=_['keys'](db[_0xda6c('0x6e')]['rawAttributes']);_0x174afb[_0xda6c('0x4a')]=_[_0xda6c('0x61')](_0xaafb6f[_0xda6c('0x4a')]);_0x174afb[_0xda6c('0x4b')]=_[_0xda6c('0x4c')](_0x174afb['model'],_0x174afb['query']);_0x3aed35[_0xda6c('0x4d')]=_['intersection'](_0x174afb[_0xda6c('0x49')],qs['fields'](_0xaafb6f[_0xda6c('0x4a')][_0xda6c('0x4e')]));_0x3aed35[_0xda6c('0x4d')]=_0x3aed35[_0xda6c('0x4d')][_0xda6c('0x4f')]?_0x3aed35[_0xda6c('0x4d')]:_0x174afb[_0xda6c('0x49')];if(!_0xaafb6f['query']['hasOwnProperty'](_0xda6c('0x51'))){_0x3aed35[_0xda6c('0x34')]=qs['limit'](_0xaafb6f[_0xda6c('0x4a')][_0xda6c('0x34')]);_0x3aed35['offset']=qs['offset'](_0xaafb6f[_0xda6c('0x4a')][_0xda6c('0x33')]);}_0x3aed35[_0xda6c('0x52')]=qs[_0xda6c('0x53')](_0xaafb6f[_0xda6c('0x4a')]['sort']);_0x3aed35['where']=qs['filters'](_['pick'](_0xaafb6f[_0xda6c('0x4a')],_0x174afb[_0xda6c('0x4b')]));_0x3aed35['where']['MailAccountId']=_0x2b3c57['id'];if(_0xaafb6f[_0xda6c('0x4a')][_0xda6c('0x55')]){_0x3aed35[_0xda6c('0x54')]=_['merge'](_0x3aed35[_0xda6c('0x54')],{'$or':_[_0xda6c('0x57')](_0x3aed35[_0xda6c('0x4d')],function(_0xdc3950){var _0x1a41b0={};_0x1a41b0[_0xdc3950]={'$like':'%'+_0xaafb6f[_0xda6c('0x4a')][_0xda6c('0x55')]+'%'};return _0x1a41b0;})});}_0x3aed35=_[_0xda6c('0x56')]({},_0x3aed35,_0xaafb6f[_0xda6c('0x5b')]);return db[_0xda6c('0x6e')][_0xda6c('0x32')]({'where':_0x3aed35[_0xda6c('0x54')]})[_0xda6c('0x23')](function(_0x2606fe){_0x395357[_0xda6c('0x32')]=_0x2606fe;if(_0xaafb6f['query'][_0xda6c('0x5c')]){_0x3aed35[_0xda6c('0x62')]=[{'all':!![]}];}return db[_0xda6c('0x6e')][_0xda6c('0x5d')](_0x3aed35);})[_0xda6c('0x23')](function(_0x321dc9){_0x395357['rows']=_0x321dc9;return _0x395357;});}})['then'](respondWithFilteredResult(_0x155f7c,_0x3aed35))[_0xda6c('0x2d')](handleError(_0x155f7c,null));};exports[_0xda6c('0x71')]=function(_0x2caf7f,_0x585ff9,_0x35529a){return db[_0xda6c('0x47')]['find']({'where':{'id':_0x2caf7f[_0xda6c('0x5f')]['id']}})[_0xda6c('0x23')](handleEntityNotFound(_0x585ff9,null))[_0xda6c('0x23')](function(_0x198d86){if(_0x198d86){return _0x198d86['removeAnswers'](_0x2caf7f[_0xda6c('0x4a')][_0xda6c('0x6c')]);}})[_0xda6c('0x23')](respondWithStatusCode(_0x585ff9,null))[_0xda6c('0x2d')](handleError(_0x585ff9,null));};exports['create']=function(_0x2781ef,_0x342251){var _0x22fdec={'name':_0x2781ef[_0xda6c('0x64')][_0xda6c('0x3f')],'key':_0x2781ef[_0xda6c('0x64')][_0xda6c('0x59')],'email':_0x2781ef['body'][_0xda6c('0x72')],'ListId':_0x2781ef[_0xda6c('0x64')][_0xda6c('0x73')],'active':!_['isNil'](_0x2781ef['body'][_0xda6c('0x74')])?_0x2781ef['body'][_0xda6c('0x74')]:!![],'description':_0x2781ef[_0xda6c('0x64')][_0xda6c('0x75')]||null,'Imap':{},'Smtp':{}};if(_[_0xda6c('0x76')](_0x2781ef[_0xda6c('0x64')]['cservice'])){if(_0x2781ef[_0xda6c('0x64')]['cauthentication']){_0x22fdec['Imap']['user']=_0x22fdec['Smtp'][_0xda6c('0x77')]=_0x2781ef[_0xda6c('0x64')][_0xda6c('0x78')];_0x22fdec[_0xda6c('0x43')]['password']=_0x22fdec[_0xda6c('0x60')][_0xda6c('0x79')]=_0x2781ef[_0xda6c('0x64')][_0xda6c('0x7a')];}else{_0x22fdec[_0xda6c('0x43')][_0xda6c('0x7b')]=_0x22fdec[_0xda6c('0x60')][_0xda6c('0x7b')]=![];}_0x22fdec[_0xda6c('0x43')][_0xda6c('0x7c')]=_0x2781ef[_0xda6c('0x64')][_0xda6c('0x43')][_0xda6c('0x7c')];_0x22fdec[_0xda6c('0x43')][_0xda6c('0x7d')]=_0x2781ef[_0xda6c('0x64')][_0xda6c('0x43')][_0xda6c('0x7d')];_0x22fdec[_0xda6c('0x60')]['host']=_0x2781ef[_0xda6c('0x64')][_0xda6c('0x60')][_0xda6c('0x7c')];_0x22fdec[_0xda6c('0x60')][_0xda6c('0x7d')]=_0x2781ef[_0xda6c('0x64')][_0xda6c('0x60')]['port'];}else{_0x22fdec[_0xda6c('0x43')][_0xda6c('0x7e')]=_0x22fdec['Smtp'][_0xda6c('0x7e')]=_0x2781ef[_0xda6c('0x64')]['cservice'];_0x22fdec[_0xda6c('0x43')]['user']=_0x22fdec[_0xda6c('0x60')][_0xda6c('0x77')]=_0x2781ef[_0xda6c('0x64')][_0xda6c('0x78')];_0x22fdec[_0xda6c('0x43')]['password']=_0x22fdec[_0xda6c('0x60')][_0xda6c('0x79')]=_0x2781ef[_0xda6c('0x64')][_0xda6c('0x7a')];}return db[_0xda6c('0x47')][_0xda6c('0x68')](_0x22fdec,{'include':[{'model':db[_0xda6c('0x44')],'as':_0xda6c('0x60')},{'model':db[_0xda6c('0x42')],'as':_0xda6c('0x43')}]})['then'](function(_0x355c6f){var _0x28d4bc=_0x2781ef[_0xda6c('0x77')][_0xda6c('0x3a')]({'plain':!![]});if(!_0x28d4bc)throw new Error(_0xda6c('0x7f'));if(_0x28d4bc[_0xda6c('0x80')]===_0xda6c('0x77')){var _0x5d581b=_0x355c6f[_0xda6c('0x3a')]({'plain':!![]});return db[_0xda6c('0x81')][_0xda6c('0x63')]({'where':{'name':_0xda6c('0x3b'),'userProfileId':_0x28d4bc[_0xda6c('0x82')]},'raw':!![]})[_0xda6c('0x23')](function(_0x30139e){if(_0x30139e&&_0x30139e[_0xda6c('0x83')]===0x0){return db['UserProfileResource'][_0xda6c('0x68')]({'name':_0x5d581b[_0xda6c('0x3f')],'resourceId':_0x5d581b['id'],'type':_0x30139e[_0xda6c('0x3f')],'sectionId':_0x30139e['id']},{})['then'](function(){return _0x355c6f;});}else{return _0x355c6f;}})['catch'](function(_0x2e7839){logger[_0xda6c('0x28')](_0xda6c('0x84'),_0x2e7839);throw _0x2e7839;});}return _0x355c6f;})[_0xda6c('0x23')](respondWithResult(_0x342251,0xc9))['catch'](handleError(_0x342251,null));};exports[_0xda6c('0x85')]=function(_0x126c6d,_0x16c710,_0x4ae584){return db['MailAccount']['findOne']({'where':{'id':_0x126c6d['params']['id']}})[_0xda6c('0x23')](handleEntityNotFound(_0x16c710,null))['then'](function(_0x11f806){if(_0x11f806){return _0x11f806[_0xda6c('0x85')]();}return null;})[_0xda6c('0x23')](respondWithResult(_0x16c710,null))[_0xda6c('0x2d')](handleError(_0x16c710,null));};exports[_0xda6c('0x86')]=function(_0x17048e,_0x59cd9f,_0x3ff2ba){if(_0x17048e[_0xda6c('0x64')]['id']){delete _0x17048e['body']['id'];}return db[_0xda6c('0x47')][_0xda6c('0x63')]({'where':{'id':_0x17048e[_0xda6c('0x5f')]['id']}})[_0xda6c('0x23')](handleEntityNotFound(_0x59cd9f,null))['then'](function(_0x94d3f6){if(_0x94d3f6){_0x17048e[_0xda6c('0x64')]['MailAccountId']=_0x94d3f6['id'];return db[_0xda6c('0x42')][_0xda6c('0x68')](_0x17048e[_0xda6c('0x64')]);}})[_0xda6c('0x23')](respondWithResult(_0x59cd9f,null))[_0xda6c('0x2d')](handleError(_0x59cd9f,null));};exports[_0xda6c('0x87')]=function(_0x582176,_0x554202,_0x4cfef2){return db['MailAccount'][_0xda6c('0x70')]({'where':{'id':_0x582176[_0xda6c('0x5f')]['id']}})['then'](handleEntityNotFound(_0x554202,null))[_0xda6c('0x23')](function(_0x3df6ba){if(_0x3df6ba){return _0x3df6ba[_0xda6c('0x88')](null);}return null;})['then'](respondWithStatusCode(_0x554202,null))[_0xda6c('0x2d')](handleError(_0x554202,null));};exports[_0xda6c('0x89')]=function(_0x1f481b,_0x167508,_0x523abe){return db[_0xda6c('0x47')][_0xda6c('0x70')]({'where':{'id':_0x1f481b['params']['id']}})[_0xda6c('0x23')](handleEntityNotFound(_0x167508,null))[_0xda6c('0x23')](function(_0x144267){if(_0x144267){return _0x144267[_0xda6c('0x89')]();}return null;})[_0xda6c('0x23')](respondWithResult(_0x167508,null))[_0xda6c('0x2d')](handleError(_0x167508,null));};exports[_0xda6c('0x8a')]=function(_0x1d89a4,_0x34b2db,_0x3d9c32){if(_0x1d89a4[_0xda6c('0x64')]['id']){delete _0x1d89a4['body']['id'];}return db['MailAccount'][_0xda6c('0x63')]({'where':{'id':_0x1d89a4[_0xda6c('0x5f')]['id']}})['then'](handleEntityNotFound(_0x34b2db,null))[_0xda6c('0x23')](function(_0x24e9da){if(_0x24e9da){_0x1d89a4['body']['MailAccountId']=_0x24e9da['id'];return db[_0xda6c('0x44')][_0xda6c('0x68')](_0x1d89a4[_0xda6c('0x64')]);}})[_0xda6c('0x23')](respondWithResult(_0x34b2db,null))[_0xda6c('0x2d')](handleError(_0x34b2db,null));};exports[_0xda6c('0x8b')]=function(_0x11c201,_0x4485ae,_0x378f15){return db[_0xda6c('0x47')][_0xda6c('0x70')]({'where':{'id':_0x11c201['params']['id']}})[_0xda6c('0x23')](handleEntityNotFound(_0x4485ae,null))[_0xda6c('0x23')](function(_0x2bd576){if(_0x2bd576){return _0x2bd576[_0xda6c('0x8c')](null);}return null;})['then'](respondWithStatusCode(_0x4485ae,null))[_0xda6c('0x2d')](handleError(_0x4485ae,null));};exports[_0xda6c('0x8d')]=function(_0x24cfb4,_0x107d36,_0x20bcdb){return db[_0xda6c('0x8e')][_0xda6c('0x63')]({'where':{'id':_0x24cfb4[_0xda6c('0x5f')]['id']}})[_0xda6c('0x23')](handleEntityNotFound(_0x107d36,null))[_0xda6c('0x23')](function(_0x30396c){if(_0x30396c){return _0x30396c[_0xda6c('0x8d')](_0x24cfb4[_0xda6c('0x64')][_0xda6c('0x6c')],_[_0xda6c('0x8f')](_0x24cfb4[_0xda6c('0x64')],[_0xda6c('0x6c'),'id'])||{});}})[_0xda6c('0x23')](respondWithResult(_0x107d36,null))[_0xda6c('0x2d')](handleError(_0x107d36,null));};exports[_0xda6c('0x90')]=function(_0x2ca01e,_0x43a64b,_0x328bcd){var _0x19df5={'raw':![],'where':{}};var _0x451c39={};var _0x11a59f={'count':0x0,'rows':[]};return db[_0xda6c('0x47')]['findOne']({'where':{'id':_0x2ca01e['params']['id']}})[_0xda6c('0x23')](handleEntityNotFound(_0x43a64b,null))[_0xda6c('0x23')](function(_0x1040fa){if(_0x1040fa){_0x451c39[_0xda6c('0x49')]=_[_0xda6c('0x61')](db[_0xda6c('0x8e')]['rawAttributes']);_0x451c39[_0xda6c('0x4a')]=_[_0xda6c('0x61')](_0x2ca01e[_0xda6c('0x4a')]);_0x451c39[_0xda6c('0x4b')]=_['intersection'](_0x451c39[_0xda6c('0x49')],_0x451c39[_0xda6c('0x4a')]);_0x19df5[_0xda6c('0x4d')]=_[_0xda6c('0x4c')](_0x451c39[_0xda6c('0x49')],qs[_0xda6c('0x4e')](_0x2ca01e[_0xda6c('0x4a')][_0xda6c('0x4e')]));_0x19df5[_0xda6c('0x4d')]=_0x19df5[_0xda6c('0x4d')][_0xda6c('0x4f')]?_0x19df5[_0xda6c('0x4d')]:_0x451c39[_0xda6c('0x49')];if(!_0x2ca01e[_0xda6c('0x4a')][_0xda6c('0x50')](_0xda6c('0x51'))){_0x19df5[_0xda6c('0x34')]=qs[_0xda6c('0x34')](_0x2ca01e[_0xda6c('0x4a')][_0xda6c('0x34')]);_0x19df5[_0xda6c('0x33')]=qs[_0xda6c('0x33')](_0x2ca01e['query']['offset']);}_0x19df5[_0xda6c('0x52')]=qs[_0xda6c('0x53')](_0x2ca01e[_0xda6c('0x4a')]['sort']);_0x19df5[_0xda6c('0x54')]=qs['filters'](_['pick'](_0x2ca01e[_0xda6c('0x4a')],_0x451c39[_0xda6c('0x4b')]));_0x19df5[_0xda6c('0x54')][_0xda6c('0x66')]=_0x1040fa['id'];if(_0x2ca01e[_0xda6c('0x4a')][_0xda6c('0x55')]){_0x19df5[_0xda6c('0x54')]=_[_0xda6c('0x56')](_0x19df5[_0xda6c('0x54')],{'$or':_['map'](_0x19df5[_0xda6c('0x4d')],function(_0x2059ce){var _0x273b2c={};_0x273b2c[_0x2059ce]={'$like':'%'+_0x2ca01e['query']['filter']+'%'};return _0x273b2c;})});}_0x19df5=_[_0xda6c('0x56')]({},_0x19df5,_0x2ca01e[_0xda6c('0x5b')]);return db[_0xda6c('0x8e')][_0xda6c('0x32')]({'where':_0x19df5[_0xda6c('0x54')]})[_0xda6c('0x23')](function(_0x1038a0){_0x11a59f[_0xda6c('0x32')]=_0x1038a0;if(_0x2ca01e[_0xda6c('0x4a')]['includeAll']){_0x19df5['include']=[{'model':db[_0xda6c('0x91')],'as':'Contact','required':![]},{'model':db[_0xda6c('0x92')],'as':'Owner','attributes':['name',_0xda6c('0x93'),_0xda6c('0x94')],'required':![]},{'model':db[_0xda6c('0x95')],'as':_0xda6c('0x96'),'attributes':['id','name',_0xda6c('0x97')],'where':_0x2ca01e[_0xda6c('0x4a')][_0xda6c('0x98')]?{'id':_0x2ca01e[_0xda6c('0x4a')][_0xda6c('0x98')]}:undefined,'required':_0x2ca01e[_0xda6c('0x4a')]['tag']?!![]:![]}];}return db['MailInteraction'][_0xda6c('0x5d')](_0x19df5);})[_0xda6c('0x23')](function(_0x4e2ffe){_0x11a59f[_0xda6c('0x5e')]=_0x4e2ffe;return _0x11a59f;});}})[_0xda6c('0x23')](respondWithFilteredResult(_0x43a64b,_0x19df5))['catch'](handleError(_0x43a64b,null));};exports[_0xda6c('0x99')]=function(_0x2497bb,_0x3ee329,_0x2414a2){return db['MailAccount'][_0xda6c('0x70')]({'where':{'id':_0x2497bb['params']['id']}})[_0xda6c('0x23')](handleEntityNotFound(_0x3ee329,null))[_0xda6c('0x23')](function(_0x37821a){if(_0x37821a){return db['sequelize']['transaction'](function(_0x2d4b93){return db[_0xda6c('0x9a')]['destroy']({'where':{'MailAccountId':_0x2497bb[_0xda6c('0x5f')]['id']},'transaction':_0x2d4b93})[_0xda6c('0x23')](function(_0x4a9773){var _0x81ba10=_['map'](_0x2497bb[_0xda6c('0x64')],function(_0x19c8b4){_0x19c8b4[_0xda6c('0x66')]=_0x2497bb[_0xda6c('0x5f')]['id'];return _0x19c8b4;});return db[_0xda6c('0x9a')][_0xda6c('0x9b')](_0x81ba10,{'transaction':_0x2d4b93});});})[_0xda6c('0x23')](function(){return db[_0xda6c('0x9a')][_0xda6c('0x9c')]({'where':{'MailAccountId':_0x2497bb[_0xda6c('0x5f')]['id']},'order':_0xda6c('0x9d')});});}})['then'](respondWithResult(_0x3ee329,null))['catch'](handleError(_0x3ee329,null));};exports['getApplications']=function(_0x3e96c9,_0x103ac9,_0x5a8f86){var _0x214623={};var _0x4d07d0={};var _0x2f0b0f;var _0x587533;return db[_0xda6c('0x47')][_0xda6c('0x70')]({'where':{'id':_0x3e96c9[_0xda6c('0x5f')]['id']}})[_0xda6c('0x23')](handleEntityNotFound(_0x103ac9,null))[_0xda6c('0x23')](function(_0x1b7b8e){if(_0x1b7b8e){_0x2f0b0f=_0x1b7b8e;_0x4d07d0['model']=_['keys'](db[_0xda6c('0x9a')][_0xda6c('0x48')]);_0x4d07d0[_0xda6c('0x4a')]=_[_0xda6c('0x61')](_0x3e96c9[_0xda6c('0x4a')]);_0x4d07d0[_0xda6c('0x4b')]=_['intersection'](_0x4d07d0['model'],_0x4d07d0[_0xda6c('0x4a')]);_0x214623[_0xda6c('0x4d')]=_[_0xda6c('0x4c')](_0x4d07d0['model'],qs[_0xda6c('0x4e')](_0x3e96c9[_0xda6c('0x4a')]['fields']));_0x214623[_0xda6c('0x4d')]=_0x214623[_0xda6c('0x4d')]['length']?_0x214623[_0xda6c('0x4d')]:_0x4d07d0[_0xda6c('0x49')];_0x214623['order']=qs[_0xda6c('0x53')](_0x3e96c9[_0xda6c('0x4a')][_0xda6c('0x53')]);_0x214623['where']=qs[_0xda6c('0x4b')](_[_0xda6c('0x6a')](_0x3e96c9[_0xda6c('0x4a')],_0x4d07d0[_0xda6c('0x4b')]));if(_0x3e96c9[_0xda6c('0x4a')][_0xda6c('0x55')]){_0x214623['where']=_[_0xda6c('0x56')](_0x214623['where'],{'$or':_[_0xda6c('0x57')](_0x214623['attributes'],function(_0x4390cd){var _0x119fc2={};_0x119fc2[_0x4390cd]={'$like':'%'+_0x3e96c9[_0xda6c('0x4a')]['filter']+'%'};return _0x119fc2;})});}_0x214623=_['merge']({},_0x214623,_0x3e96c9[_0xda6c('0x5b')]);return _0x2f0b0f[_0xda6c('0x9e')](_0x214623);}})[_0xda6c('0x23')](function(_0x56e464){if(_0x56e464){_0x587533=_0x56e464[_0xda6c('0x4f')];if(!_0x3e96c9[_0xda6c('0x4a')][_0xda6c('0x50')](_0xda6c('0x51'))){_0x214623['limit']=qs[_0xda6c('0x34')](_0x3e96c9[_0xda6c('0x4a')][_0xda6c('0x34')]);_0x214623[_0xda6c('0x33')]=qs['offset'](_0x3e96c9[_0xda6c('0x4a')][_0xda6c('0x33')]);}return _0x2f0b0f[_0xda6c('0x9e')](_0x214623);}})[_0xda6c('0x23')](function(_0x9e6faf){if(_0x9e6faf){return _0x9e6faf?{'count':_0x587533,'rows':_0x9e6faf}:null;}})[_0xda6c('0x23')](respondWithResult(_0x103ac9,null))[_0xda6c('0x2d')](handleError(_0x103ac9,null));};exports[_0xda6c('0x9f')]=function(_0x1f4aaa,_0x4425b6,_0x89ce49){var _0x5544e8={'raw':!![],'where':{}};var _0x461614={};var _0x58d731={'count':0x0,'rows':[]};return db[_0xda6c('0x47')]['findOne']({'where':{'id':_0x1f4aaa['params']['id']}})[_0xda6c('0x23')](handleEntityNotFound(_0x4425b6,null))[_0xda6c('0x23')](function(_0x4e2cc3){if(_0x4e2cc3){_0x461614['model']=_[_0xda6c('0x61')](db[_0xda6c('0xa0')][_0xda6c('0x48')]);_0x461614[_0xda6c('0x4a')]=_[_0xda6c('0x61')](_0x1f4aaa[_0xda6c('0x4a')]);_0x461614['filters']=_[_0xda6c('0x4c')](_0x461614[_0xda6c('0x49')],_0x461614[_0xda6c('0x4a')]);_0x5544e8[_0xda6c('0x4d')]=_[_0xda6c('0x4c')](_0x461614[_0xda6c('0x49')],qs['fields'](_0x1f4aaa[_0xda6c('0x4a')][_0xda6c('0x4e')]));_0x5544e8[_0xda6c('0x4d')]=_0x5544e8['attributes'][_0xda6c('0x4f')]?_0x5544e8[_0xda6c('0x4d')]:_0x461614[_0xda6c('0x49')];if(!_0x1f4aaa[_0xda6c('0x4a')]['hasOwnProperty'](_0xda6c('0x51'))){_0x5544e8[_0xda6c('0x34')]=qs[_0xda6c('0x34')](_0x1f4aaa[_0xda6c('0x4a')][_0xda6c('0x34')]);_0x5544e8[_0xda6c('0x33')]=qs[_0xda6c('0x33')](_0x1f4aaa['query']['offset']);}_0x5544e8[_0xda6c('0x52')]=qs['sort'](_0x1f4aaa[_0xda6c('0x4a')][_0xda6c('0x53')]);_0x5544e8[_0xda6c('0x54')]=qs[_0xda6c('0x4b')](_[_0xda6c('0x6a')](_0x1f4aaa['query'],_0x461614[_0xda6c('0x4b')]));_0x5544e8['where'][_0xda6c('0x66')]=_0x4e2cc3['id'];if(_0x1f4aaa[_0xda6c('0x4a')][_0xda6c('0x55')]){_0x5544e8['where']=_[_0xda6c('0x56')](_0x5544e8[_0xda6c('0x54')],{'$or':_[_0xda6c('0x57')](_0x5544e8[_0xda6c('0x4d')],function(_0x38275c){var _0x7c2877={};_0x7c2877[_0x38275c]={'$like':'%'+_0x1f4aaa['query']['filter']+'%'};return _0x7c2877;})});}if(_0x1f4aaa[_0xda6c('0x4a')][_0xda6c('0xa1')]){var _0x781c4e=_0x1f4aaa[_0xda6c('0x4a')][_0xda6c('0xa1')]['split'](',');var _0xfc555f={};_0xfc555f[_0x781c4e[0x0]]={'$gte':moment(_0x781c4e[0x1])[_0xda6c('0xa2')]('YYYY-MM-DD\x20HH:mm:ss')};_0x5544e8[_0xda6c('0x54')]=_['merge'](_0x5544e8[_0xda6c('0x54')],_0xfc555f);}_0x5544e8=_[_0xda6c('0x56')]({},_0x5544e8,_0x1f4aaa['options']);return db[_0xda6c('0xa0')][_0xda6c('0x32')]({'where':_0x5544e8['where']})[_0xda6c('0x23')](function(_0x152d9e){_0x58d731[_0xda6c('0x32')]=_0x152d9e;if(_0x1f4aaa[_0xda6c('0x4a')]['includeAll']){_0x5544e8[_0xda6c('0x62')]=[{'all':!![]}];}return db[_0xda6c('0xa0')]['findAll'](_0x5544e8);})[_0xda6c('0x23')](function(_0x3f2808){_0x58d731[_0xda6c('0x5e')]=_0x3f2808;return _0x58d731;});}})[_0xda6c('0x23')](respondWithFilteredResult(_0x4425b6,_0x5544e8))[_0xda6c('0x2d')](handleError(_0x4425b6,null));};exports['send']=function(_0x556bdd,_0x1f94e6,_0x192fb3){var _0x898521,_0x240cc8={},_0xecb94a;if(_0x556bdd[_0xda6c('0x64')]['to']){_0xecb94a=_0x556bdd[_0xda6c('0x64')]['to'][_0xda6c('0xa3')](',')[0x0];}return db[_0xda6c('0x47')][_0xda6c('0x63')]({'where':{'id':_0x556bdd[_0xda6c('0x5f')]['id']},'include':[{'model':db[_0xda6c('0xa4')],'as':_0xda6c('0xa5'),'include':[{'model':db[_0xda6c('0x91')],'as':'Contacts','where':{'email':_0xecb94a},'limit':0x1,'order':[['updatedAt',_0xda6c('0xa6')]]}]},{'model':db[_0xda6c('0x44')],'as':'Smtp','raw':!![]}]})[_0xda6c('0x23')](handleEntityNotFound(_0x1f94e6,null))[_0xda6c('0x23')](function(_0x1bcaaf){if(_0x1bcaaf){_0x898521=_0x1bcaaf;if(_0x1bcaaf['Smtp']){if(_[_0xda6c('0x76')](_0x556bdd[_0xda6c('0x64')][_0xda6c('0xa7')])){_0x556bdd[_0xda6c('0x64')][_0xda6c('0xa7')]=util['format']('%s\x20<%s>',_0x1bcaaf['name'],_0x1bcaaf[_0xda6c('0x72')]||_0x1bcaaf['Smtp'][_0xda6c('0x77')]);}if(_0x556bdd[_0xda6c('0x64')][_0xda6c('0xa8')]&&_0x556bdd[_0xda6c('0x64')][_0xda6c('0xa8')][_0xda6c('0x4f')]){for(var _0x3cb31e=0x0;_0x3cb31e<_0x556bdd['body'][_0xda6c('0xa8')][_0xda6c('0x4f')];_0x3cb31e+=0x1){_0x556bdd[_0xda6c('0x64')][_0xda6c('0xa8')][_0x3cb31e]={'filename':_0x556bdd[_0xda6c('0x64')][_0xda6c('0xa8')][_0x3cb31e]['name'],'path':path['join'](config[_0xda6c('0xa9')],_0xda6c('0xaa'),_0x556bdd[_0xda6c('0x64')]['attachments'][_0x3cb31e]['basename'])};}}var _0x208c0f={'tls':{'rejectUnauthorized':![]}};if(_['isNil'](_0x1bcaaf[_0xda6c('0x60')][_0xda6c('0x7e')])){if(_0x1bcaaf[_0xda6c('0x60')][_0xda6c('0x7b')]){_0x208c0f['auth']={'user':_0x1bcaaf[_0xda6c('0x60')][_0xda6c('0x77')],'pass':_0x1bcaaf[_0xda6c('0x60')][_0xda6c('0x79')]};}_0x208c0f['host']=_0x1bcaaf[_0xda6c('0x60')]['host'];_0x208c0f[_0xda6c('0x7d')]=_0x1bcaaf[_0xda6c('0x60')][_0xda6c('0x7d')];_0x208c0f[_0xda6c('0xab')]=_0x1bcaaf[_0xda6c('0x60')]['secure'];}else{_0x208c0f[_0xda6c('0x7e')]=_0x1bcaaf[_0xda6c('0x60')]['service'];_0x208c0f[_0xda6c('0xac')]={'user':_0x1bcaaf[_0xda6c('0x60')][_0xda6c('0x77')],'pass':_0x1bcaaf[_0xda6c('0x60')][_0xda6c('0x79')]};}return respondWithRpcPromise('SendMail','sendMail',{'account':_0x208c0f,'message':_0x556bdd['body']});}else{throw new Error(_0xda6c('0xad'));}}})[_0xda6c('0x23')](function(_0x5e944a){if(_0x5e944a){_0x240cc8=_0x5e944a;if(_0x898521[_0xda6c('0xa5')]){if(_0x898521[_0xda6c('0xa5')][_0xda6c('0xae')][_0xda6c('0x4f')]){return _0x898521[_0xda6c('0xa5')][_0xda6c('0xae')][0x0];}else{return db[_0xda6c('0x91')][_0xda6c('0x68')](_[_0xda6c('0x1b')](_0x556bdd[_0xda6c('0x64')],{'firstName':_0x556bdd['body']['to'],'email':_0x556bdd[_0xda6c('0x64')]['to'],'phone':_0x556bdd[_0xda6c('0x64')]['to'],'ListId':_0x898521['ListId']}));}}else{throw new Error(_0xda6c('0xad'));}}})[_0xda6c('0x23')](function(_0x20017a){if(_0x20017a){var _0x3efc2c={'UserId':_0x556bdd[_0xda6c('0x77')]['id'],'ContactId':_0x20017a['id'],'MailAccountId':_0x898521['id'],'inReplyTo':_0x240cc8[_0xda6c('0xaf')],'to':_0x556bdd[_0xda6c('0x64')][_0xda6c('0xa7')],'cc':_0x556bdd[_0xda6c('0x64')]['cc'],'subject':_0x556bdd[_0xda6c('0x64')][_0xda6c('0xb0')],'attach':_0x556bdd['body'][_0xda6c('0xb1')],'firstMsgDirection':_0xda6c('0xb2'),'lastMsgAt':moment()[_0xda6c('0xa2')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':_0xda6c('0xb2'),'lastMsgBody':_0x556bdd['body']['body'],'Messages':[_[_0xda6c('0x56')](_0x556bdd[_0xda6c('0x64')],{'messageId':_0x240cc8['messageId'],'sentAt':moment()[_0xda6c('0xa2')](_0xda6c('0xb3')),'read':!![],'MailAccountId':_0x898521['id'],'UserId':_0x556bdd[_0xda6c('0x77')]['id'],'ContactId':_0x20017a['id']})]};if(_0x556bdd[_0xda6c('0x64')]['Interaction']){_0x3efc2c=_[_0xda6c('0x56')](_0x3efc2c,_0x556bdd['body'][_0xda6c('0xb4')]);}return db[_0xda6c('0x8e')][_0xda6c('0x68')](_0x3efc2c,{'include':[{'model':db[_0xda6c('0xa0')],'as':_0xda6c('0xb5')}]});}})[_0xda6c('0x23')](respondWithResult(_0x1f94e6,null))['catch'](handleError(_0x1f94e6,null));};exports[_0xda6c('0xb6')]=function(_0x35ddca,_0x51d25b,_0x50f7e5){return db[_0xda6c('0x47')][_0xda6c('0x63')]({'where':{'id':_0x35ddca['params']['id']},'include':[{'model':db[_0xda6c('0x44')],'as':_0xda6c('0x60'),'raw':!![]}]})[_0xda6c('0x23')](handleEntityNotFound(_0x51d25b,null))[_0xda6c('0x23')](function(_0x29f3ab){if(_0x29f3ab&&_0x29f3ab[_0xda6c('0x60')]){var _0x58f58b={'id':_0x29f3ab['id'],'tls':{'rejectUnauthorized':![]}};if(_0x29f3ab[_0xda6c('0x60')][_0xda6c('0x7e')]){_0x58f58b[_0xda6c('0x7e')]=_0x29f3ab[_0xda6c('0x60')][_0xda6c('0x7e')];}else{_0x58f58b[_0xda6c('0x7c')]=_0x29f3ab[_0xda6c('0x60')][_0xda6c('0x7c')];_0x58f58b[_0xda6c('0x7d')]=_0x29f3ab[_0xda6c('0x60')][_0xda6c('0x7d')];_0x58f58b[_0xda6c('0xab')]=_0x29f3ab[_0xda6c('0x60')][_0xda6c('0xab')];}if(_0x29f3ab[_0xda6c('0x60')]['authentication']){_0x58f58b[_0xda6c('0xac')]={'user':_0x29f3ab[_0xda6c('0x60')][_0xda6c('0x77')],'pass':_0x29f3ab[_0xda6c('0x60')][_0xda6c('0x79')]};}return respondWithRpcPromise('VerifySmtp',_0xda6c('0xb6'),{'account':_0x58f58b});}})[_0xda6c('0x23')](respondWithResult(_0x51d25b,null))[_0xda6c('0x2d')](handleError(_0x51d25b,null));};exports[_0xda6c('0x3d')]=function(_0x195783,_0x3c7ad7){return db[_0xda6c('0x47')][_0xda6c('0x63')]({'where':{'id':_0x195783[_0xda6c('0x5f')]['id']}})[_0xda6c('0x23')](handleEntityNotFound(_0x3c7ad7,null))[_0xda6c('0x23')](function(_0x1c3ded){if(_0x1c3ded&&_0x1c3ded[_0xda6c('0x7e')]){throw new db['Sequelize'][(_0xda6c('0xb7'))](_0xda6c('0xb8'));}return _0x1c3ded;})[_0xda6c('0x23')](removeEntity(_0x3c7ad7,null))[_0xda6c('0x2d')](handleError(_0x3c7ad7,null));};exports[_0xda6c('0xb9')]=function(_0x337ed5,_0x36c173,_0x22662a){return db['MailAccount'][_0xda6c('0x63')]({'where':{'id':_0x337ed5[_0xda6c('0x5f')]['id']}})[_0xda6c('0x23')](handleEntityNotFound(_0x36c173,null))[_0xda6c('0x23')](function(_0x44ef97){if(_0x44ef97){return _0x44ef97[_0xda6c('0xb9')](_0x337ed5[_0xda6c('0x64')][_0xda6c('0x6c')],_[_0xda6c('0x8f')](_0x337ed5[_0xda6c('0x64')],[_0xda6c('0x6c'),'id'])||{})[_0xda6c('0xba')](function(_0x14e40f){for(var _0x3f2977=0x0;_0x3f2977<_0x337ed5[_0xda6c('0x64')]['ids'][_0xda6c('0x4f')];_0x3f2977+=0x1){socket['emit'](_0xda6c('0xbb'),{'UserId':_0x337ed5[_0xda6c('0x64')][_0xda6c('0x6c')][_0x3f2977],'MailAccountId':_0x337ed5['params']['id']});}return _0x14e40f;});}})['then'](respondWithResult(_0x36c173,null))['catch'](handleError(_0x36c173,null));};exports[_0xda6c('0xbc')]=function(_0x17fa6f,_0x6d1e39,_0xdcd55c){return db[_0xda6c('0x47')][_0xda6c('0x63')]({'where':{'id':_0x17fa6f[_0xda6c('0x5f')]['id']}})[_0xda6c('0x23')](handleEntityNotFound(_0x6d1e39,null))['then'](function(_0x4a3767){if(_0x4a3767){return _0x4a3767[_0xda6c('0xbc')](_0x17fa6f['query']['ids'])[_0xda6c('0x23')](function(){if(_['isArray'](_0x17fa6f[_0xda6c('0x4a')]['ids'])){for(var _0x4e5ba0=0x0;_0x4e5ba0<_0x17fa6f[_0xda6c('0x4a')][_0xda6c('0x6c')][_0xda6c('0x4f')];_0x4e5ba0+=0x1){socket[_0xda6c('0xbd')](_0xda6c('0xbe'),{'UserId':Number(_0x17fa6f[_0xda6c('0x4a')]['ids'][_0x4e5ba0]),'MailAccountId':Number(_0x17fa6f[_0xda6c('0x5f')]['id'])});}}else{socket['emit'](_0xda6c('0xbe'),{'UserId':Number(_0x17fa6f[_0xda6c('0x4a')]['ids']),'MailAccountId':Number(_0x17fa6f['params']['id'])});}});}})['then'](respondWithStatusCode(_0x6d1e39,null))['catch'](handleError(_0x6d1e39,null));};exports[_0xda6c('0xbf')]=function(_0x39c487,_0x3dcecb,_0x269669){var _0x54c68a={};var _0x270f2f={};var _0x21720f;var _0x44a9c2;return db['MailAccount'][_0xda6c('0x70')]({'where':{'id':_0x39c487[_0xda6c('0x5f')]['id']}})[_0xda6c('0x23')](handleEntityNotFound(_0x3dcecb,null))[_0xda6c('0x23')](function(_0x58f70a){if(_0x58f70a){_0x21720f=_0x58f70a;_0x270f2f['model']=_[_0xda6c('0x61')](db['User'][_0xda6c('0x48')]);_0x270f2f[_0xda6c('0x4a')]=_[_0xda6c('0x61')](_0x39c487[_0xda6c('0x4a')]);_0x270f2f['filters']=_[_0xda6c('0x4c')](_0x270f2f[_0xda6c('0x49')],_0x270f2f[_0xda6c('0x4a')]);_0x54c68a['attributes']=_[_0xda6c('0x4c')](_0x270f2f['model'],qs['fields'](_0x39c487[_0xda6c('0x4a')]['fields']));_0x54c68a[_0xda6c('0x4d')]=_0x54c68a[_0xda6c('0x4d')]['length']?_0x54c68a[_0xda6c('0x4d')]:_0x270f2f['model'];_0x54c68a[_0xda6c('0x52')]=qs[_0xda6c('0x53')](_0x39c487[_0xda6c('0x4a')][_0xda6c('0x53')]);_0x54c68a['where']=qs[_0xda6c('0x4b')](_['pick'](_0x39c487['query'],_0x270f2f[_0xda6c('0x4b')]));if(_0x39c487[_0xda6c('0x4a')]['filter']){_0x54c68a[_0xda6c('0x54')]=_[_0xda6c('0x56')](_0x54c68a['where'],{'$or':_[_0xda6c('0x57')](_0x54c68a[_0xda6c('0x4d')],function(_0x25c5a3){var _0x1e32ad={};_0x1e32ad[_0x25c5a3]={'$like':'%'+_0x39c487[_0xda6c('0x4a')][_0xda6c('0x55')]+'%'};return _0x1e32ad;})});}_0x54c68a=_[_0xda6c('0x56')]({},_0x54c68a,_0x39c487[_0xda6c('0x5b')]);return _0x21720f[_0xda6c('0xbf')](_0x54c68a);}})[_0xda6c('0x23')](function(_0x12a422){if(_0x12a422){_0x44a9c2=_0x12a422[_0xda6c('0x4f')];if(!_0x39c487[_0xda6c('0x4a')]['hasOwnProperty'](_0xda6c('0x51'))){_0x54c68a[_0xda6c('0x34')]=qs['limit'](_0x39c487[_0xda6c('0x4a')][_0xda6c('0x34')]);_0x54c68a[_0xda6c('0x33')]=qs[_0xda6c('0x33')](_0x39c487[_0xda6c('0x4a')][_0xda6c('0x33')]);}return _0x21720f[_0xda6c('0xbf')](_0x54c68a);}})[_0xda6c('0x23')](function(_0x5c689b){if(_0x5c689b){return _0x5c689b?{'count':_0x44a9c2,'rows':_0x5c689b}:null;}})[_0xda6c('0x23')](respondWithResult(_0x3dcecb,null))['catch'](handleError(_0x3dcecb,null));}; \ No newline at end of file +var _0x3894=['setImap','getSmtp','addSmtp','addInteraction','omit','MailInteraction','CmContact','User','Owner','fullname','internal','color','tag','addApplications','sequelize','MailApplication','bulkCreate','findAndCountAll','getApplications','getMessages','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','MailMessage','send','List','DESC','from','attachments','join','root','server/files/attachments','basename','auth','secure','SendMail','Contacts','List\x20not\x20found','messageId','attach','out','Interaction','Messages','verifySmtp','VerifySmtp','Sequelize','ValidationError','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','spread','emit','userMailAccount:save','removeAgents','isArray','userMailAccount:remove','getAgents','html-pdf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../mysqldb','redis','defaults','./mailAccount.socket','register','test','request','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','sendStatus','status','end','json','offset','apply','save','update','destroy','get','UserProfileResource','name','index','Imap','MailServerOut','Smtp','Pause','rawAttributes','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','pick','merge','map','key','filter','options','count','include','MailAccount','findAll','rows','catch','params','mandatoryDispositionPause','length','includeAll','find','body','MailServerIn','describe','addDisposition','Disposition','create','getDispositions','MailAccountId','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','findOne','removeAnswers','email','ListId','isNil','active','description','cservice','cauthentication','cuser','pass','cpassword','authentication','host','port','service','user','password','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','MailAccounts','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','removeImap'];(function(_0x5d9ca7,_0x1ea975){var _0x4b6389=function(_0x2bafae){while(--_0x2bafae){_0x5d9ca7['push'](_0x5d9ca7['shift']());}};_0x4b6389(++_0x1ea975);}(_0x3894,0xee));var _0x4389=function(_0x1d0499,_0x23e22f){_0x1d0499=_0x1d0499-0x0;var _0x153fb3=_0x3894[_0x1d0499];return _0x153fb3;};'use strict';var pdf=require(_0x4389('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x4389('0x1'));var jsonpatch=require(_0x4389('0x2'));var rp=require(_0x4389('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x4389('0x4'));var util=require(_0x4389('0x5'));var path=require(_0x4389('0x6'));var sox=require(_0x4389('0x7'));var csv=require(_0x4389('0x8'));var ejs=require(_0x4389('0x9'));var fs=require('fs');var _=require(_0x4389('0xa'));var squel=require(_0x4389('0xb'));var crypto=require('crypto');var jsforce=require(_0x4389('0xc'));var deskjs=require(_0x4389('0xd'));var toCsv=require(_0x4389('0x8'));var querystring=require(_0x4389('0xe'));var Papa=require('papaparse');var Redis=require(_0x4389('0xf'));var authService=require(_0x4389('0x10'));var qs=require(_0x4389('0x11'));var as=require(_0x4389('0x12'));var hardwareService=require(_0x4389('0x13'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x4389('0x14'))['db'];config[_0x4389('0x15')]=_[_0x4389('0x16')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4389('0x15')]));require(_0x4389('0x17'))[_0x4389('0x18')](socket);var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232b});function checkPasswordPattern(_0x5b99f5,_0x182ea4,_0x4be282){if(_0x4be282){var _0x5a984d=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x5a984d[_0x4389('0x19')](_0x182ea4)){return _0x5b99f5;}else{throw new Error('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x5b99f5;}}function respondWithRpcPromise(_0x398541,_0x2fddf6,_0x5d3e6a,_0x42b154){return new BPromise(function(_0x135c80,_0x3a0bff){var _0x5ac9bd=_0x42b154||client;return _0x5ac9bd[_0x4389('0x1a')](_0x398541,_0x5d3e6a)[_0x4389('0x1b')](function(_0x3d97a8){logger[_0x4389('0x1c')](_0x4389('0x1d'),_0x2fddf6,_0x4389('0x1e'));logger[_0x4389('0x1f')]('MailAccount,\x20%s,\x20%s,\x20%s',_0x2fddf6,_0x4389('0x1e'),JSON[_0x4389('0x20')](_0x3d97a8));if(_0x3d97a8[_0x4389('0x21')]){if(_0x3d97a8['error'][_0x4389('0x22')]===0x1f4){logger[_0x4389('0x21')](_0x4389('0x1d'),_0x2fddf6,_0x3d97a8['error'][_0x4389('0x23')]);return _0x3a0bff(_0x3d97a8[_0x4389('0x21')][_0x4389('0x23')]);}logger[_0x4389('0x21')](_0x4389('0x1d'),_0x2fddf6,_0x3d97a8['error'][_0x4389('0x23')]);return _0x135c80(_0x3d97a8[_0x4389('0x21')][_0x4389('0x23')]);}else{logger[_0x4389('0x1c')](_0x4389('0x1d'),_0x2fddf6,_0x4389('0x1e'));_0x135c80(_0x3d97a8[_0x4389('0x24')]['message']);}})['catch'](function(_0x5bd9f5){logger[_0x4389('0x21')](_0x4389('0x1d'),_0x2fddf6,_0x5bd9f5);_0x3a0bff(_0x5bd9f5);});});}function respondWithStatusCode(_0x5c3124,_0x2124a7){_0x2124a7=_0x2124a7||0xcc;return function(_0x3c704e){if(_0x3c704e){return _0x5c3124[_0x4389('0x25')](_0x2124a7);}return _0x5c3124[_0x4389('0x26')](_0x2124a7)[_0x4389('0x27')]();};}function respondWithResult(_0x2c0aee,_0x369255){_0x369255=_0x369255||0xc8;return function(_0x3a6274){if(_0x3a6274){return _0x2c0aee[_0x4389('0x26')](_0x369255)[_0x4389('0x28')](_0x3a6274);}};}function respondWithFilteredResult(_0x2fe576,_0x4098d2){return function(_0x335aba){if(_0x335aba){var _0x3df25b=_0x335aba['count'],_0x4da12c=_0x4098d2[_0x4389('0x29')],_0x28810d=_0x4098d2[_0x4389('0x29')]+_0x4098d2['limit'],_0x38c782;if(_0x28810d>=_0x3df25b){_0x28810d=_0x3df25b;_0x38c782=0xc8;}else{_0x38c782=0xce;}_0x2fe576[_0x4389('0x26')](_0x38c782);return _0x2fe576['set']('Content-Range',_0x4da12c+'-'+_0x28810d+'/'+_0x3df25b)['json'](_0x335aba);}return null;};}function patchUpdates(_0x464302){return function(_0x138634){try{jsonpatch[_0x4389('0x2a')](_0x138634,_0x464302,!![]);}catch(_0x1c11eb){return BPromise['reject'](_0x1c11eb);}return _0x138634[_0x4389('0x2b')]();};}function saveUpdates(_0x3a568a,_0x981446){return function(_0x5b0eeb){if(_0x5b0eeb){return _0x5b0eeb[_0x4389('0x2c')](_0x3a568a)[_0x4389('0x1b')](function(_0x814861){return _0x814861;});}return null;};}function removeEntity(_0x15e878,_0x55ddff){return function(_0x1039e1){if(_0x1039e1){return _0x1039e1[_0x4389('0x2d')]()[_0x4389('0x1b')](function(){var _0x1f5d7e=_0x1039e1[_0x4389('0x2e')]({'plain':!![]});var _0x1e8f5b='MailAccounts';return db[_0x4389('0x2f')][_0x4389('0x2d')]({'where':{'type':_0x1e8f5b,'resourceId':_0x1f5d7e['id']}})[_0x4389('0x1b')](function(){return _0x1039e1;});})[_0x4389('0x1b')](function(){_0x15e878['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xca2e39,_0x4946a5){return function(_0x2ae22a){if(!_0x2ae22a){_0xca2e39[_0x4389('0x25')](0x194);}return _0x2ae22a;};}function handleError(_0x599597,_0x39cc08){_0x39cc08=_0x39cc08||0x1f4;return function(_0x4285f1){logger['error'](_0x4285f1['stack']);if(_0x4285f1[_0x4389('0x30')]){delete _0x4285f1[_0x4389('0x30')];}_0x599597[_0x4389('0x26')](_0x39cc08)['send'](_0x4285f1);};}exports[_0x4389('0x31')]=function(_0x3ae24a,_0x1bf633){var _0x4b93a3={'include':[{'model':db['MailServerIn'],'as':_0x4389('0x32')},{'model':db[_0x4389('0x33')],'as':_0x4389('0x34')},{'model':db[_0x4389('0x35')],'as':'mandatoryDispositionPause'}]},_0x21c6a7={},_0x49fc19={'count':0x0,'rows':[]};var _0x356662=db['MailAccount'][_0x4389('0x36')];_0x21c6a7[_0x4389('0x37')]=_[_0x4389('0x38')](_0x356662);_0x21c6a7[_0x4389('0x39')]=_[_0x4389('0x38')](_0x3ae24a[_0x4389('0x39')]);_0x21c6a7[_0x4389('0x3a')]=_[_0x4389('0x3b')](_0x21c6a7[_0x4389('0x37')],_0x21c6a7[_0x4389('0x39')]);_0x4b93a3[_0x4389('0x3c')]=_['intersection'](_0x21c6a7[_0x4389('0x37')],qs[_0x4389('0x3d')](_0x3ae24a[_0x4389('0x39')][_0x4389('0x3d')]));_0x4b93a3['attributes']=_0x4b93a3[_0x4389('0x3c')]['length']?_0x4b93a3[_0x4389('0x3c')]:_0x21c6a7[_0x4389('0x37')];if(!_0x3ae24a[_0x4389('0x39')][_0x4389('0x3e')](_0x4389('0x3f'))){_0x4b93a3[_0x4389('0x40')]=qs[_0x4389('0x40')](_0x3ae24a['query'][_0x4389('0x40')]);_0x4b93a3[_0x4389('0x29')]=qs[_0x4389('0x29')](_0x3ae24a[_0x4389('0x39')][_0x4389('0x29')]);}_0x4b93a3[_0x4389('0x41')]=qs[_0x4389('0x42')](_0x3ae24a[_0x4389('0x39')][_0x4389('0x42')]);_0x4b93a3[_0x4389('0x43')]=qs[_0x4389('0x3a')](_[_0x4389('0x44')](_0x3ae24a[_0x4389('0x39')],_0x21c6a7[_0x4389('0x3a')]));if(_0x3ae24a[_0x4389('0x39')]['filter']){_0x4b93a3[_0x4389('0x43')]=_[_0x4389('0x45')](_0x4b93a3[_0x4389('0x43')],{'$or':_[_0x4389('0x46')](_0x356662,function(_0x50f420){if(_0x50f420['type'][_0x4389('0x47')]!=='VIRTUAL'){var _0x11b627={};_0x11b627[_0x50f420['field']]={'$like':'%'+_0x3ae24a[_0x4389('0x39')][_0x4389('0x48')]+'%'};return _0x11b627;}})});}_0x4b93a3=_[_0x4389('0x45')]({},_0x4b93a3,_0x3ae24a[_0x4389('0x49')]);var _0x33a77a={'where':_0x4b93a3[_0x4389('0x43')]};return db['MailAccount'][_0x4389('0x4a')](_0x33a77a)[_0x4389('0x1b')](function(_0x814528){_0x49fc19[_0x4389('0x4a')]=_0x814528;if(_0x3ae24a[_0x4389('0x39')]['includeAll']){_0x4b93a3[_0x4389('0x4b')]=[{'all':!![]}];}return db[_0x4389('0x4c')][_0x4389('0x4d')](_0x4b93a3);})['then'](function(_0x2fa6b0){_0x49fc19[_0x4389('0x4e')]=_0x2fa6b0;return _0x49fc19;})[_0x4389('0x1b')](respondWithFilteredResult(_0x1bf633,_0x4b93a3))[_0x4389('0x4f')](handleError(_0x1bf633,null));};exports['show']=function(_0x3a1972,_0x5c178c){var _0x5d25f9={'raw':![],'where':{'id':_0x3a1972[_0x4389('0x50')]['id']},'include':[{'model':db['MailServerIn'],'as':'Imap'},{'model':db[_0x4389('0x33')],'as':_0x4389('0x34')},{'model':db['Pause'],'as':_0x4389('0x51')}]},_0x45e831={};_0x45e831[_0x4389('0x37')]=_[_0x4389('0x38')](db[_0x4389('0x4c')]['rawAttributes']);_0x45e831[_0x4389('0x39')]=_[_0x4389('0x38')](_0x3a1972[_0x4389('0x39')]);_0x45e831[_0x4389('0x3a')]=_[_0x4389('0x3b')](_0x45e831['model'],_0x45e831[_0x4389('0x39')]);_0x5d25f9[_0x4389('0x3c')]=_[_0x4389('0x3b')](_0x45e831['model'],qs[_0x4389('0x3d')](_0x3a1972['query'][_0x4389('0x3d')]));_0x5d25f9['attributes']=_0x5d25f9[_0x4389('0x3c')][_0x4389('0x52')]?_0x5d25f9[_0x4389('0x3c')]:_0x45e831[_0x4389('0x37')];if(_0x3a1972[_0x4389('0x39')][_0x4389('0x53')]){_0x5d25f9[_0x4389('0x4b')]=[{'all':!![]}];}_0x5d25f9=_[_0x4389('0x45')]({},_0x5d25f9,_0x3a1972[_0x4389('0x49')]);return db['MailAccount'][_0x4389('0x54')](_0x5d25f9)[_0x4389('0x1b')](handleEntityNotFound(_0x5c178c,null))[_0x4389('0x1b')](respondWithResult(_0x5c178c,null))['catch'](handleError(_0x5c178c,null));};exports[_0x4389('0x2c')]=function(_0x4912bf,_0x5b2159){if(_0x4912bf['body']['id']){delete _0x4912bf[_0x4389('0x55')]['id'];}return db[_0x4389('0x4c')][_0x4389('0x54')]({'where':{'id':_0x4912bf[_0x4389('0x50')]['id']},'include':[{'model':db['MailServerIn'],'as':'Imap'},{'model':db['MailServerOut'],'as':_0x4389('0x34')},{'model':db[_0x4389('0x35')],'as':'mandatoryDispositionPause'}]})[_0x4389('0x1b')](handleEntityNotFound(_0x5b2159,null))['then'](saveUpdates(_0x4912bf['body'],null))['then'](function(_0x1af980){if(_0x1af980&&_0x4912bf[_0x4389('0x55')][_0x4389('0x32')]){return db[_0x4389('0x56')][_0x4389('0x2c')](_0x4912bf[_0x4389('0x55')][_0x4389('0x32')],{'where':{'MailAccountId':_0x1af980['id']}})[_0x4389('0x1b')](function(){return _0x1af980;});}return _0x1af980;})[_0x4389('0x1b')](function(_0x1977ab){if(_0x1977ab&&_0x4912bf[_0x4389('0x55')][_0x4389('0x34')]){return db[_0x4389('0x33')][_0x4389('0x2c')](_0x4912bf[_0x4389('0x55')][_0x4389('0x34')],{'where':{'MailAccountId':_0x1977ab['id']}})[_0x4389('0x1b')](function(){return _0x1977ab;});}return _0x1977ab;})['then'](respondWithResult(_0x5b2159,null))['catch'](handleError(_0x5b2159,null));};exports[_0x4389('0x57')]=function(_0x130b44,_0x3bf3d2){return db['MailAccount']['describe']()[_0x4389('0x1b')](respondWithResult(_0x3bf3d2,null))['catch'](handleError(_0x3bf3d2,null));};exports[_0x4389('0x58')]=function(_0x2b677c,_0x379c40,_0x563d8a){if(_0x2b677c[_0x4389('0x55')]['id']){delete _0x2b677c[_0x4389('0x55')]['id'];}return db[_0x4389('0x4c')][_0x4389('0x54')]({'where':{'id':_0x2b677c['params']['id']}})[_0x4389('0x1b')](handleEntityNotFound(_0x379c40,null))['then'](function(_0x506baa){if(_0x506baa){_0x2b677c[_0x4389('0x55')]['MailAccountId']=_0x506baa['id'];return db[_0x4389('0x59')][_0x4389('0x5a')](_0x2b677c['body']);}})['then'](respondWithResult(_0x379c40,null))[_0x4389('0x4f')](handleError(_0x379c40,null));};exports[_0x4389('0x5b')]=function(_0x19b7fd,_0x5ac5c1,_0x55c024){var _0x3ef44e={'raw':![],'where':{}};var _0x29127b={};var _0x3a4d75={'count':0x0,'rows':[]};return db[_0x4389('0x4c')]['findOne']({'where':{'id':_0x19b7fd['params']['id']}})[_0x4389('0x1b')](handleEntityNotFound(_0x5ac5c1,null))[_0x4389('0x1b')](function(_0x5d9969){if(_0x5d9969){_0x29127b[_0x4389('0x37')]=_[_0x4389('0x38')](db[_0x4389('0x59')][_0x4389('0x36')]);_0x29127b[_0x4389('0x39')]=_[_0x4389('0x38')](_0x19b7fd[_0x4389('0x39')]);_0x29127b[_0x4389('0x3a')]=_[_0x4389('0x3b')](_0x29127b['model'],_0x29127b[_0x4389('0x39')]);_0x3ef44e[_0x4389('0x3c')]=_[_0x4389('0x3b')](_0x29127b[_0x4389('0x37')],qs[_0x4389('0x3d')](_0x19b7fd[_0x4389('0x39')][_0x4389('0x3d')]));_0x3ef44e[_0x4389('0x3c')]=_0x3ef44e[_0x4389('0x3c')][_0x4389('0x52')]?_0x3ef44e['attributes']:_0x29127b[_0x4389('0x37')];if(!_0x19b7fd[_0x4389('0x39')][_0x4389('0x3e')](_0x4389('0x3f'))){_0x3ef44e[_0x4389('0x40')]=qs[_0x4389('0x40')](_0x19b7fd[_0x4389('0x39')][_0x4389('0x40')]);_0x3ef44e['offset']=qs[_0x4389('0x29')](_0x19b7fd['query'][_0x4389('0x29')]);}_0x3ef44e[_0x4389('0x41')]=qs['sort'](_0x19b7fd[_0x4389('0x39')]['sort']);_0x3ef44e[_0x4389('0x43')]=qs['filters'](_[_0x4389('0x44')](_0x19b7fd[_0x4389('0x39')],_0x29127b['filters']));_0x3ef44e[_0x4389('0x43')][_0x4389('0x5c')]=_0x5d9969['id'];if(_0x19b7fd[_0x4389('0x39')][_0x4389('0x48')]){_0x3ef44e['where']=_[_0x4389('0x45')](_0x3ef44e[_0x4389('0x43')],{'$or':_[_0x4389('0x46')](_0x3ef44e['attributes'],function(_0x3db3f7){var _0x329d0c={};_0x329d0c[_0x3db3f7]={'$like':'%'+_0x19b7fd[_0x4389('0x39')][_0x4389('0x48')]+'%'};return _0x329d0c;})});}_0x3ef44e=_[_0x4389('0x45')]({},_0x3ef44e,_0x19b7fd[_0x4389('0x49')]);return db[_0x4389('0x59')]['count']({'where':_0x3ef44e['where']})[_0x4389('0x1b')](function(_0x320f96){_0x3a4d75[_0x4389('0x4a')]=_0x320f96;if(_0x19b7fd[_0x4389('0x39')][_0x4389('0x53')]){_0x3ef44e['include']=[{'all':!![]}];}return db['Disposition'][_0x4389('0x4d')](_0x3ef44e);})[_0x4389('0x1b')](function(_0x2dddde){_0x3a4d75[_0x4389('0x4e')]=_0x2dddde;return _0x3a4d75;});}})[_0x4389('0x1b')](respondWithFilteredResult(_0x5ac5c1,_0x3ef44e))[_0x4389('0x4f')](handleError(_0x5ac5c1,null));};exports['removeDispositions']=function(_0x57337d,_0x4c5450,_0x5d84a6){return db[_0x4389('0x4c')][_0x4389('0x54')]({'where':{'id':_0x57337d['params']['id']}})['then'](handleEntityNotFound(_0x4c5450,null))[_0x4389('0x1b')](function(_0x42f7cf){if(_0x42f7cf){return _0x42f7cf[_0x4389('0x5d')](_0x57337d[_0x4389('0x39')][_0x4389('0x5e')]);}})['then'](respondWithStatusCode(_0x4c5450,null))[_0x4389('0x4f')](handleError(_0x4c5450,null));};exports[_0x4389('0x5f')]=function(_0x1b936a,_0x21e4a9,_0x39a6fa){if(_0x1b936a['body']['id']){delete _0x1b936a[_0x4389('0x55')]['id'];}return db['MailAccount']['find']({'where':{'id':_0x1b936a[_0x4389('0x50')]['id']}})['then'](handleEntityNotFound(_0x21e4a9,null))[_0x4389('0x1b')](function(_0xb9e220){if(_0xb9e220){_0x1b936a[_0x4389('0x55')][_0x4389('0x5c')]=_0xb9e220['id'];return db[_0x4389('0x60')][_0x4389('0x5a')](_0x1b936a[_0x4389('0x55')]);}})[_0x4389('0x1b')](respondWithResult(_0x21e4a9,null))['catch'](handleError(_0x21e4a9,null));};exports[_0x4389('0x61')]=function(_0x4d1469,_0xd3fde3,_0x125c52){var _0xc657c9={'raw':![],'where':{}};var _0x16962b={};var _0x45d355={'count':0x0,'rows':[]};return db['MailAccount'][_0x4389('0x62')]({'where':{'id':_0x4d1469[_0x4389('0x50')]['id']}})[_0x4389('0x1b')](handleEntityNotFound(_0xd3fde3,null))[_0x4389('0x1b')](function(_0x261830){if(_0x261830){_0x16962b['model']=_[_0x4389('0x38')](db['CannedAnswer'][_0x4389('0x36')]);_0x16962b['query']=_['keys'](_0x4d1469[_0x4389('0x39')]);_0x16962b[_0x4389('0x3a')]=_[_0x4389('0x3b')](_0x16962b[_0x4389('0x37')],_0x16962b['query']);_0xc657c9[_0x4389('0x3c')]=_[_0x4389('0x3b')](_0x16962b[_0x4389('0x37')],qs[_0x4389('0x3d')](_0x4d1469[_0x4389('0x39')][_0x4389('0x3d')]));_0xc657c9[_0x4389('0x3c')]=_0xc657c9[_0x4389('0x3c')][_0x4389('0x52')]?_0xc657c9[_0x4389('0x3c')]:_0x16962b[_0x4389('0x37')];if(!_0x4d1469['query'][_0x4389('0x3e')]('nolimit')){_0xc657c9[_0x4389('0x40')]=qs['limit'](_0x4d1469[_0x4389('0x39')][_0x4389('0x40')]);_0xc657c9[_0x4389('0x29')]=qs['offset'](_0x4d1469['query'][_0x4389('0x29')]);}_0xc657c9[_0x4389('0x41')]=qs['sort'](_0x4d1469['query'][_0x4389('0x42')]);_0xc657c9['where']=qs[_0x4389('0x3a')](_[_0x4389('0x44')](_0x4d1469[_0x4389('0x39')],_0x16962b[_0x4389('0x3a')]));_0xc657c9[_0x4389('0x43')]['MailAccountId']=_0x261830['id'];if(_0x4d1469['query'][_0x4389('0x48')]){_0xc657c9[_0x4389('0x43')]=_[_0x4389('0x45')](_0xc657c9['where'],{'$or':_['map'](_0xc657c9[_0x4389('0x3c')],function(_0x42bd36){var _0x546320={};_0x546320[_0x42bd36]={'$like':'%'+_0x4d1469[_0x4389('0x39')][_0x4389('0x48')]+'%'};return _0x546320;})});}_0xc657c9=_[_0x4389('0x45')]({},_0xc657c9,_0x4d1469[_0x4389('0x49')]);return db[_0x4389('0x60')][_0x4389('0x4a')]({'where':_0xc657c9['where']})[_0x4389('0x1b')](function(_0x504708){_0x45d355[_0x4389('0x4a')]=_0x504708;if(_0x4d1469[_0x4389('0x39')]['includeAll']){_0xc657c9[_0x4389('0x4b')]=[{'all':!![]}];}return db[_0x4389('0x60')][_0x4389('0x4d')](_0xc657c9);})[_0x4389('0x1b')](function(_0x5dd348){_0x45d355[_0x4389('0x4e')]=_0x5dd348;return _0x45d355;});}})[_0x4389('0x1b')](respondWithFilteredResult(_0xd3fde3,_0xc657c9))[_0x4389('0x4f')](handleError(_0xd3fde3,null));};exports[_0x4389('0x63')]=function(_0xb36963,_0x4bd93d,_0x2ebc7d){return db[_0x4389('0x4c')][_0x4389('0x54')]({'where':{'id':_0xb36963['params']['id']}})[_0x4389('0x1b')](handleEntityNotFound(_0x4bd93d,null))[_0x4389('0x1b')](function(_0x16a0ac){if(_0x16a0ac){return _0x16a0ac['removeAnswers'](_0xb36963[_0x4389('0x39')]['ids']);}})['then'](respondWithStatusCode(_0x4bd93d,null))[_0x4389('0x4f')](handleError(_0x4bd93d,null));};exports['create']=function(_0x4a4ab8,_0x1b709c){var _0x5f0b34={'name':_0x4a4ab8[_0x4389('0x55')][_0x4389('0x30')],'key':_0x4a4ab8[_0x4389('0x55')][_0x4389('0x47')],'email':_0x4a4ab8[_0x4389('0x55')][_0x4389('0x64')],'ListId':_0x4a4ab8[_0x4389('0x55')][_0x4389('0x65')],'active':!_[_0x4389('0x66')](_0x4a4ab8['body'][_0x4389('0x67')])?_0x4a4ab8['body']['active']:!![],'description':_0x4a4ab8[_0x4389('0x55')][_0x4389('0x68')]||null,'Imap':{},'Smtp':{}};if(_['isNil'](_0x4a4ab8[_0x4389('0x55')][_0x4389('0x69')])){if(_0x4a4ab8[_0x4389('0x55')][_0x4389('0x6a')]){_0x5f0b34[_0x4389('0x32')]['user']=_0x5f0b34[_0x4389('0x34')]['user']=_0x4a4ab8[_0x4389('0x55')][_0x4389('0x6b')];_0x5f0b34[_0x4389('0x32')]['password']=_0x5f0b34[_0x4389('0x34')][_0x4389('0x6c')]=_0x4a4ab8[_0x4389('0x55')][_0x4389('0x6d')];}else{_0x5f0b34['Imap']['authentication']=_0x5f0b34[_0x4389('0x34')][_0x4389('0x6e')]=![];}_0x5f0b34[_0x4389('0x32')][_0x4389('0x6f')]=_0x4a4ab8['body'][_0x4389('0x32')]['host'];_0x5f0b34['Imap']['port']=_0x4a4ab8[_0x4389('0x55')][_0x4389('0x32')][_0x4389('0x70')];_0x5f0b34[_0x4389('0x34')][_0x4389('0x6f')]=_0x4a4ab8['body'][_0x4389('0x34')][_0x4389('0x6f')];_0x5f0b34[_0x4389('0x34')]['port']=_0x4a4ab8[_0x4389('0x55')][_0x4389('0x34')]['port'];}else{_0x5f0b34[_0x4389('0x32')][_0x4389('0x71')]=_0x5f0b34['Smtp']['service']=_0x4a4ab8['body'][_0x4389('0x69')];_0x5f0b34[_0x4389('0x32')]['user']=_0x5f0b34[_0x4389('0x34')][_0x4389('0x72')]=_0x4a4ab8['body'][_0x4389('0x6b')];_0x5f0b34['Imap'][_0x4389('0x73')]=_0x5f0b34['Smtp'][_0x4389('0x6c')]=_0x4a4ab8[_0x4389('0x55')][_0x4389('0x6d')];}return db['MailAccount'][_0x4389('0x5a')](_0x5f0b34,{'include':[{'model':db['MailServerOut'],'as':'Smtp'},{'model':db[_0x4389('0x56')],'as':_0x4389('0x32')}]})[_0x4389('0x1b')](function(_0x28eda1){var _0x14ae72=_0x4a4ab8[_0x4389('0x72')][_0x4389('0x2e')]({'plain':!![]});if(!_0x14ae72)throw new Error(_0x4389('0x74'));if(_0x14ae72[_0x4389('0x75')]===_0x4389('0x72')){var _0x21cefa=_0x28eda1['get']({'plain':!![]});return db['UserProfileSection'][_0x4389('0x54')]({'where':{'name':_0x4389('0x76'),'userProfileId':_0x14ae72[_0x4389('0x77')]},'raw':!![]})['then'](function(_0x36c413){if(_0x36c413&&_0x36c413[_0x4389('0x78')]===0x0){return db['UserProfileResource'][_0x4389('0x5a')]({'name':_0x21cefa[_0x4389('0x30')],'resourceId':_0x21cefa['id'],'type':_0x36c413[_0x4389('0x30')],'sectionId':_0x36c413['id']},{})[_0x4389('0x1b')](function(){return _0x28eda1;});}else{return _0x28eda1;}})[_0x4389('0x4f')](function(_0x348ef1){logger['error'](_0x4389('0x79'),_0x348ef1);throw _0x348ef1;});}return _0x28eda1;})[_0x4389('0x1b')](respondWithResult(_0x1b709c,0xc9))[_0x4389('0x4f')](handleError(_0x1b709c,null));};exports[_0x4389('0x7a')]=function(_0x17d139,_0x590fbd,_0x5d3858){return db['MailAccount'][_0x4389('0x62')]({'where':{'id':_0x17d139[_0x4389('0x50')]['id']}})[_0x4389('0x1b')](handleEntityNotFound(_0x590fbd,null))[_0x4389('0x1b')](function(_0x4c4873){if(_0x4c4873){return _0x4c4873[_0x4389('0x7a')]();}return null;})[_0x4389('0x1b')](respondWithResult(_0x590fbd,null))[_0x4389('0x4f')](handleError(_0x590fbd,null));};exports['addImap']=function(_0x5c1015,_0xed78fd,_0x47e5bd){if(_0x5c1015['body']['id']){delete _0x5c1015[_0x4389('0x55')]['id'];}return db[_0x4389('0x4c')]['find']({'where':{'id':_0x5c1015['params']['id']}})['then'](handleEntityNotFound(_0xed78fd,null))[_0x4389('0x1b')](function(_0x318f13){if(_0x318f13){_0x5c1015[_0x4389('0x55')][_0x4389('0x5c')]=_0x318f13['id'];return db['MailServerIn']['create'](_0x5c1015[_0x4389('0x55')]);}})['then'](respondWithResult(_0xed78fd,null))[_0x4389('0x4f')](handleError(_0xed78fd,null));};exports[_0x4389('0x7b')]=function(_0x522c13,_0xaff626,_0x31c8fb){return db[_0x4389('0x4c')][_0x4389('0x62')]({'where':{'id':_0x522c13['params']['id']}})[_0x4389('0x1b')](handleEntityNotFound(_0xaff626,null))[_0x4389('0x1b')](function(_0x13c53d){if(_0x13c53d){return _0x13c53d[_0x4389('0x7c')](null);}return null;})[_0x4389('0x1b')](respondWithStatusCode(_0xaff626,null))[_0x4389('0x4f')](handleError(_0xaff626,null));};exports[_0x4389('0x7d')]=function(_0x522945,_0x3d2546,_0x42c288){return db['MailAccount'][_0x4389('0x62')]({'where':{'id':_0x522945[_0x4389('0x50')]['id']}})[_0x4389('0x1b')](handleEntityNotFound(_0x3d2546,null))[_0x4389('0x1b')](function(_0x22853b){if(_0x22853b){return _0x22853b[_0x4389('0x7d')]();}return null;})[_0x4389('0x1b')](respondWithResult(_0x3d2546,null))[_0x4389('0x4f')](handleError(_0x3d2546,null));};exports[_0x4389('0x7e')]=function(_0x3b8288,_0x37657a,_0x444044){if(_0x3b8288[_0x4389('0x55')]['id']){delete _0x3b8288[_0x4389('0x55')]['id'];}return db[_0x4389('0x4c')][_0x4389('0x54')]({'where':{'id':_0x3b8288[_0x4389('0x50')]['id']}})['then'](handleEntityNotFound(_0x37657a,null))[_0x4389('0x1b')](function(_0x2ce51c){if(_0x2ce51c){_0x3b8288[_0x4389('0x55')][_0x4389('0x5c')]=_0x2ce51c['id'];return db['MailServerOut'][_0x4389('0x5a')](_0x3b8288[_0x4389('0x55')]);}})['then'](respondWithResult(_0x37657a,null))[_0x4389('0x4f')](handleError(_0x37657a,null));};exports['removeSmtp']=function(_0x4285ff,_0x1a5563,_0x504ce9){return db[_0x4389('0x4c')][_0x4389('0x62')]({'where':{'id':_0x4285ff[_0x4389('0x50')]['id']}})[_0x4389('0x1b')](handleEntityNotFound(_0x1a5563,null))[_0x4389('0x1b')](function(_0x4685a0){if(_0x4685a0){return _0x4685a0['setSmtp'](null);}return null;})[_0x4389('0x1b')](respondWithStatusCode(_0x1a5563,null))[_0x4389('0x4f')](handleError(_0x1a5563,null));};exports[_0x4389('0x7f')]=function(_0x492d3c,_0x3de517,_0x55383e){return db['MailInteraction'][_0x4389('0x54')]({'where':{'id':_0x492d3c['params']['id']}})[_0x4389('0x1b')](handleEntityNotFound(_0x3de517,null))[_0x4389('0x1b')](function(_0x5320ca){if(_0x5320ca){return _0x5320ca['addInteraction'](_0x492d3c[_0x4389('0x55')][_0x4389('0x5e')],_[_0x4389('0x80')](_0x492d3c[_0x4389('0x55')],[_0x4389('0x5e'),'id'])||{});}})[_0x4389('0x1b')](respondWithResult(_0x3de517,null))[_0x4389('0x4f')](handleError(_0x3de517,null));};exports['getInteractions']=function(_0x251b8d,_0x1d304b,_0x2f5445){var _0x4005d2={'raw':![],'where':{}};var _0x5810b7={};var _0x5ba367={'count':0x0,'rows':[]};return db[_0x4389('0x4c')]['findOne']({'where':{'id':_0x251b8d['params']['id']}})[_0x4389('0x1b')](handleEntityNotFound(_0x1d304b,null))['then'](function(_0x150b43){if(_0x150b43){_0x5810b7[_0x4389('0x37')]=_['keys'](db[_0x4389('0x81')][_0x4389('0x36')]);_0x5810b7['query']=_[_0x4389('0x38')](_0x251b8d[_0x4389('0x39')]);_0x5810b7['filters']=_[_0x4389('0x3b')](_0x5810b7[_0x4389('0x37')],_0x5810b7[_0x4389('0x39')]);_0x4005d2[_0x4389('0x3c')]=_[_0x4389('0x3b')](_0x5810b7[_0x4389('0x37')],qs[_0x4389('0x3d')](_0x251b8d[_0x4389('0x39')][_0x4389('0x3d')]));_0x4005d2[_0x4389('0x3c')]=_0x4005d2[_0x4389('0x3c')][_0x4389('0x52')]?_0x4005d2['attributes']:_0x5810b7[_0x4389('0x37')];if(!_0x251b8d[_0x4389('0x39')][_0x4389('0x3e')](_0x4389('0x3f'))){_0x4005d2['limit']=qs[_0x4389('0x40')](_0x251b8d[_0x4389('0x39')][_0x4389('0x40')]);_0x4005d2[_0x4389('0x29')]=qs['offset'](_0x251b8d[_0x4389('0x39')][_0x4389('0x29')]);}_0x4005d2[_0x4389('0x41')]=qs[_0x4389('0x42')](_0x251b8d[_0x4389('0x39')][_0x4389('0x42')]);_0x4005d2[_0x4389('0x43')]=qs[_0x4389('0x3a')](_[_0x4389('0x44')](_0x251b8d[_0x4389('0x39')],_0x5810b7[_0x4389('0x3a')]));_0x4005d2[_0x4389('0x43')]['MailAccountId']=_0x150b43['id'];if(_0x251b8d['query'][_0x4389('0x48')]){_0x4005d2[_0x4389('0x43')]=_[_0x4389('0x45')](_0x4005d2[_0x4389('0x43')],{'$or':_[_0x4389('0x46')](_0x4005d2['attributes'],function(_0x3c9dbd){var _0x5748e3={};_0x5748e3[_0x3c9dbd]={'$like':'%'+_0x251b8d[_0x4389('0x39')][_0x4389('0x48')]+'%'};return _0x5748e3;})});}_0x4005d2=_[_0x4389('0x45')]({},_0x4005d2,_0x251b8d['options']);return db[_0x4389('0x81')][_0x4389('0x4a')]({'where':_0x4005d2[_0x4389('0x43')]})[_0x4389('0x1b')](function(_0x14c885){_0x5ba367['count']=_0x14c885;if(_0x251b8d['query'][_0x4389('0x53')]){_0x4005d2['include']=[{'model':db[_0x4389('0x82')],'as':'Contact','required':![]},{'model':db[_0x4389('0x83')],'as':_0x4389('0x84'),'attributes':[_0x4389('0x30'),_0x4389('0x85'),_0x4389('0x86')],'required':![]},{'model':db['Tag'],'as':'Tags','attributes':['id',_0x4389('0x30'),_0x4389('0x87')],'where':_0x251b8d['query'][_0x4389('0x88')]?{'id':_0x251b8d[_0x4389('0x39')][_0x4389('0x88')]}:undefined,'required':_0x251b8d[_0x4389('0x39')][_0x4389('0x88')]?!![]:![]}];}return db['MailInteraction']['findAll'](_0x4005d2);})[_0x4389('0x1b')](function(_0x1ec055){_0x5ba367['rows']=_0x1ec055;return _0x5ba367;});}})[_0x4389('0x1b')](respondWithFilteredResult(_0x1d304b,_0x4005d2))[_0x4389('0x4f')](handleError(_0x1d304b,null));};exports[_0x4389('0x89')]=function(_0x47285a,_0x2f0b0b,_0x5603e0){return db[_0x4389('0x4c')]['findOne']({'where':{'id':_0x47285a['params']['id']}})[_0x4389('0x1b')](handleEntityNotFound(_0x2f0b0b,null))[_0x4389('0x1b')](function(_0x967992){if(_0x967992){return db[_0x4389('0x8a')]['transaction'](function(_0x311d79){return db[_0x4389('0x8b')][_0x4389('0x2d')]({'where':{'MailAccountId':_0x47285a[_0x4389('0x50')]['id']},'transaction':_0x311d79})[_0x4389('0x1b')](function(_0x1e08a8){var _0x363229=_[_0x4389('0x46')](_0x47285a[_0x4389('0x55')],function(_0x38d6e5){_0x38d6e5['MailAccountId']=_0x47285a[_0x4389('0x50')]['id'];return _0x38d6e5;});return db['MailApplication'][_0x4389('0x8c')](_0x363229,{'transaction':_0x311d79});});})['then'](function(){return db[_0x4389('0x8b')][_0x4389('0x8d')]({'where':{'MailAccountId':_0x47285a[_0x4389('0x50')]['id']},'order':'priority'});});}})['then'](respondWithResult(_0x2f0b0b,null))[_0x4389('0x4f')](handleError(_0x2f0b0b,null));};exports[_0x4389('0x8e')]=function(_0x20919f,_0x29b23d,_0x57b80a){var _0x4f0ea6={};var _0x5e1726={};var _0x17f2bd;var _0x423848;return db[_0x4389('0x4c')][_0x4389('0x62')]({'where':{'id':_0x20919f[_0x4389('0x50')]['id']}})['then'](handleEntityNotFound(_0x29b23d,null))[_0x4389('0x1b')](function(_0x43b9c1){if(_0x43b9c1){_0x17f2bd=_0x43b9c1;_0x5e1726[_0x4389('0x37')]=_['keys'](db[_0x4389('0x8b')][_0x4389('0x36')]);_0x5e1726[_0x4389('0x39')]=_[_0x4389('0x38')](_0x20919f[_0x4389('0x39')]);_0x5e1726[_0x4389('0x3a')]=_[_0x4389('0x3b')](_0x5e1726[_0x4389('0x37')],_0x5e1726[_0x4389('0x39')]);_0x4f0ea6[_0x4389('0x3c')]=_[_0x4389('0x3b')](_0x5e1726[_0x4389('0x37')],qs[_0x4389('0x3d')](_0x20919f[_0x4389('0x39')][_0x4389('0x3d')]));_0x4f0ea6[_0x4389('0x3c')]=_0x4f0ea6[_0x4389('0x3c')][_0x4389('0x52')]?_0x4f0ea6[_0x4389('0x3c')]:_0x5e1726[_0x4389('0x37')];_0x4f0ea6[_0x4389('0x41')]=qs[_0x4389('0x42')](_0x20919f[_0x4389('0x39')][_0x4389('0x42')]);_0x4f0ea6['where']=qs['filters'](_[_0x4389('0x44')](_0x20919f[_0x4389('0x39')],_0x5e1726[_0x4389('0x3a')]));if(_0x20919f[_0x4389('0x39')][_0x4389('0x48')]){_0x4f0ea6['where']=_[_0x4389('0x45')](_0x4f0ea6[_0x4389('0x43')],{'$or':_[_0x4389('0x46')](_0x4f0ea6[_0x4389('0x3c')],function(_0x5668f2){var _0xac8fe8={};_0xac8fe8[_0x5668f2]={'$like':'%'+_0x20919f[_0x4389('0x39')]['filter']+'%'};return _0xac8fe8;})});}_0x4f0ea6=_[_0x4389('0x45')]({},_0x4f0ea6,_0x20919f[_0x4389('0x49')]);return _0x17f2bd[_0x4389('0x8e')](_0x4f0ea6);}})[_0x4389('0x1b')](function(_0x618c46){if(_0x618c46){_0x423848=_0x618c46[_0x4389('0x52')];if(!_0x20919f['query'][_0x4389('0x3e')]('nolimit')){_0x4f0ea6['limit']=qs[_0x4389('0x40')](_0x20919f['query'][_0x4389('0x40')]);_0x4f0ea6[_0x4389('0x29')]=qs[_0x4389('0x29')](_0x20919f[_0x4389('0x39')][_0x4389('0x29')]);}return _0x17f2bd[_0x4389('0x8e')](_0x4f0ea6);}})[_0x4389('0x1b')](function(_0x333c94){if(_0x333c94){return _0x333c94?{'count':_0x423848,'rows':_0x333c94}:null;}})[_0x4389('0x1b')](respondWithResult(_0x29b23d,null))[_0x4389('0x4f')](handleError(_0x29b23d,null));};exports[_0x4389('0x8f')]=function(_0x3f6fe2,_0x278c87,_0x3fb0f6){var _0x3b781b={'raw':!![],'where':{}};var _0x2c2efc={};var _0x1363e4={'count':0x0,'rows':[]};return db[_0x4389('0x4c')]['findOne']({'where':{'id':_0x3f6fe2[_0x4389('0x50')]['id']}})[_0x4389('0x1b')](handleEntityNotFound(_0x278c87,null))[_0x4389('0x1b')](function(_0x7a6d6f){if(_0x7a6d6f){_0x2c2efc[_0x4389('0x37')]=_[_0x4389('0x38')](db['MailMessage'][_0x4389('0x36')]);_0x2c2efc[_0x4389('0x39')]=_['keys'](_0x3f6fe2[_0x4389('0x39')]);_0x2c2efc['filters']=_[_0x4389('0x3b')](_0x2c2efc[_0x4389('0x37')],_0x2c2efc[_0x4389('0x39')]);_0x3b781b['attributes']=_[_0x4389('0x3b')](_0x2c2efc['model'],qs['fields'](_0x3f6fe2[_0x4389('0x39')]['fields']));_0x3b781b[_0x4389('0x3c')]=_0x3b781b['attributes'][_0x4389('0x52')]?_0x3b781b[_0x4389('0x3c')]:_0x2c2efc[_0x4389('0x37')];if(!_0x3f6fe2[_0x4389('0x39')][_0x4389('0x3e')](_0x4389('0x3f'))){_0x3b781b[_0x4389('0x40')]=qs['limit'](_0x3f6fe2[_0x4389('0x39')]['limit']);_0x3b781b['offset']=qs[_0x4389('0x29')](_0x3f6fe2[_0x4389('0x39')][_0x4389('0x29')]);}_0x3b781b[_0x4389('0x41')]=qs[_0x4389('0x42')](_0x3f6fe2[_0x4389('0x39')][_0x4389('0x42')]);_0x3b781b['where']=qs[_0x4389('0x3a')](_[_0x4389('0x44')](_0x3f6fe2[_0x4389('0x39')],_0x2c2efc[_0x4389('0x3a')]));_0x3b781b[_0x4389('0x43')][_0x4389('0x5c')]=_0x7a6d6f['id'];if(_0x3f6fe2['query'][_0x4389('0x48')]){_0x3b781b[_0x4389('0x43')]=_['merge'](_0x3b781b[_0x4389('0x43')],{'$or':_[_0x4389('0x46')](_0x3b781b[_0x4389('0x3c')],function(_0x2711f7){var _0x167a08={};_0x167a08[_0x2711f7]={'$like':'%'+_0x3f6fe2[_0x4389('0x39')][_0x4389('0x48')]+'%'};return _0x167a08;})});}if(_0x3f6fe2[_0x4389('0x39')][_0x4389('0x90')]){var _0x33fa62=_0x3f6fe2['query'][_0x4389('0x90')][_0x4389('0x91')](',');var _0x534cc9={};_0x534cc9[_0x33fa62[0x0]]={'$gte':moment(_0x33fa62[0x1])[_0x4389('0x92')](_0x4389('0x93'))};_0x3b781b[_0x4389('0x43')]=_[_0x4389('0x45')](_0x3b781b['where'],_0x534cc9);}_0x3b781b=_[_0x4389('0x45')]({},_0x3b781b,_0x3f6fe2[_0x4389('0x49')]);return db[_0x4389('0x94')]['count']({'where':_0x3b781b[_0x4389('0x43')]})[_0x4389('0x1b')](function(_0x3c30e4){_0x1363e4[_0x4389('0x4a')]=_0x3c30e4;if(_0x3f6fe2[_0x4389('0x39')][_0x4389('0x53')]){_0x3b781b['include']=[{'all':!![]}];}return db['MailMessage'][_0x4389('0x4d')](_0x3b781b);})[_0x4389('0x1b')](function(_0x56a8d9){_0x1363e4[_0x4389('0x4e')]=_0x56a8d9;return _0x1363e4;});}})[_0x4389('0x1b')](respondWithFilteredResult(_0x278c87,_0x3b781b))[_0x4389('0x4f')](handleError(_0x278c87,null));};exports[_0x4389('0x95')]=function(_0x160fed,_0x4f81e6,_0x8fb98f){var _0x4c32bc,_0x46b946={},_0x123af9;if(_0x160fed[_0x4389('0x55')]['to']){_0x123af9=_0x160fed[_0x4389('0x55')]['to'][_0x4389('0x91')](',')[0x0];}return db[_0x4389('0x4c')][_0x4389('0x54')]({'where':{'id':_0x160fed[_0x4389('0x50')]['id']},'include':[{'model':db['CmList'],'as':_0x4389('0x96'),'include':[{'model':db[_0x4389('0x82')],'as':'Contacts','where':{'email':_0x123af9},'limit':0x1,'order':[['updatedAt',_0x4389('0x97')]]}]},{'model':db[_0x4389('0x33')],'as':_0x4389('0x34'),'raw':!![]}]})['then'](handleEntityNotFound(_0x4f81e6,null))[_0x4389('0x1b')](function(_0x3dc522){if(_0x3dc522){_0x4c32bc=_0x3dc522;if(_0x3dc522[_0x4389('0x34')]){if(_[_0x4389('0x66')](_0x160fed[_0x4389('0x55')][_0x4389('0x98')])){_0x160fed['body'][_0x4389('0x98')]=util[_0x4389('0x92')]('%s\x20<%s>',_0x3dc522[_0x4389('0x30')],_0x3dc522[_0x4389('0x64')]||_0x3dc522['Smtp'][_0x4389('0x72')]);}if(_0x160fed['body'][_0x4389('0x99')]&&_0x160fed['body'][_0x4389('0x99')][_0x4389('0x52')]){for(var _0xdef67c=0x0;_0xdef67c<_0x160fed['body'][_0x4389('0x99')][_0x4389('0x52')];_0xdef67c+=0x1){_0x160fed['body'][_0x4389('0x99')][_0xdef67c]={'filename':_0x160fed[_0x4389('0x55')][_0x4389('0x99')][_0xdef67c][_0x4389('0x30')],'path':path[_0x4389('0x9a')](config[_0x4389('0x9b')],_0x4389('0x9c'),_0x160fed[_0x4389('0x55')]['attachments'][_0xdef67c][_0x4389('0x9d')])};}}var _0xbad1bb={'tls':{'rejectUnauthorized':![]}};if(_['isNil'](_0x3dc522[_0x4389('0x34')][_0x4389('0x71')])){if(_0x3dc522[_0x4389('0x34')][_0x4389('0x6e')]){_0xbad1bb[_0x4389('0x9e')]={'user':_0x3dc522[_0x4389('0x34')][_0x4389('0x72')],'pass':_0x3dc522[_0x4389('0x34')][_0x4389('0x6c')]};}_0xbad1bb['host']=_0x3dc522[_0x4389('0x34')]['host'];_0xbad1bb['port']=_0x3dc522['Smtp'][_0x4389('0x70')];_0xbad1bb[_0x4389('0x9f')]=_0x3dc522[_0x4389('0x34')][_0x4389('0x9f')];}else{_0xbad1bb[_0x4389('0x71')]=_0x3dc522[_0x4389('0x34')][_0x4389('0x71')];_0xbad1bb[_0x4389('0x9e')]={'user':_0x3dc522[_0x4389('0x34')]['user'],'pass':_0x3dc522[_0x4389('0x34')][_0x4389('0x6c')]};}return respondWithRpcPromise(_0x4389('0xa0'),'sendMail',{'account':_0xbad1bb,'message':_0x160fed[_0x4389('0x55')]});}else{throw new Error('List\x20not\x20found');}}})['then'](function(_0x42e77e){if(_0x42e77e){_0x46b946=_0x42e77e;if(_0x4c32bc[_0x4389('0x96')]){if(_0x4c32bc[_0x4389('0x96')][_0x4389('0xa1')][_0x4389('0x52')]){return _0x4c32bc[_0x4389('0x96')][_0x4389('0xa1')][0x0];}else{return db[_0x4389('0x82')][_0x4389('0x5a')](_['defaults'](_0x160fed[_0x4389('0x55')],{'firstName':_0x160fed[_0x4389('0x55')]['to'],'email':_0x160fed['body']['to'],'phone':_0x160fed[_0x4389('0x55')]['to'],'ListId':_0x4c32bc[_0x4389('0x65')]}));}}else{throw new Error(_0x4389('0xa2'));}}})[_0x4389('0x1b')](function(_0x205c9f){if(_0x205c9f){var _0x245a97={'UserId':_0x160fed[_0x4389('0x72')]['id'],'ContactId':_0x205c9f['id'],'MailAccountId':_0x4c32bc['id'],'inReplyTo':_0x46b946[_0x4389('0xa3')],'to':_0x160fed['body'][_0x4389('0x98')],'cc':_0x160fed['body']['cc'],'subject':_0x160fed['body']['subject'],'attach':_0x160fed[_0x4389('0x55')][_0x4389('0xa4')],'firstMsgDirection':_0x4389('0xa5'),'lastMsgAt':moment()[_0x4389('0x92')](_0x4389('0x93')),'lastMsgDirection':'out','lastMsgBody':_0x160fed[_0x4389('0x55')]['body'],'Messages':[_[_0x4389('0x45')](_0x160fed[_0x4389('0x55')],{'messageId':_0x46b946[_0x4389('0xa3')],'sentAt':moment()[_0x4389('0x92')]('YYYY-MM-DD\x20HH:mm:ss'),'read':!![],'MailAccountId':_0x4c32bc['id'],'UserId':_0x160fed[_0x4389('0x72')]['id'],'ContactId':_0x205c9f['id']})]};if(_0x160fed[_0x4389('0x55')][_0x4389('0xa6')]){_0x245a97=_[_0x4389('0x45')](_0x245a97,_0x160fed[_0x4389('0x55')][_0x4389('0xa6')]);}return db['MailInteraction'][_0x4389('0x5a')](_0x245a97,{'include':[{'model':db[_0x4389('0x94')],'as':_0x4389('0xa7')}]});}})[_0x4389('0x1b')](respondWithResult(_0x4f81e6,null))['catch'](handleError(_0x4f81e6,null));};exports[_0x4389('0xa8')]=function(_0x3ca99c,_0x4ba6ea,_0x40414b){return db[_0x4389('0x4c')]['find']({'where':{'id':_0x3ca99c[_0x4389('0x50')]['id']},'include':[{'model':db[_0x4389('0x33')],'as':'Smtp','raw':!![]}]})['then'](handleEntityNotFound(_0x4ba6ea,null))['then'](function(_0x58758d){if(_0x58758d&&_0x58758d['Smtp']){var _0x4e3720={'id':_0x58758d['id'],'tls':{'rejectUnauthorized':![]}};if(_0x58758d[_0x4389('0x34')][_0x4389('0x71')]){_0x4e3720[_0x4389('0x71')]=_0x58758d['Smtp'][_0x4389('0x71')];}else{_0x4e3720['host']=_0x58758d['Smtp'][_0x4389('0x6f')];_0x4e3720[_0x4389('0x70')]=_0x58758d[_0x4389('0x34')][_0x4389('0x70')];_0x4e3720['secure']=_0x58758d['Smtp'][_0x4389('0x9f')];}if(_0x58758d[_0x4389('0x34')][_0x4389('0x6e')]){_0x4e3720['auth']={'user':_0x58758d[_0x4389('0x34')][_0x4389('0x72')],'pass':_0x58758d['Smtp'][_0x4389('0x6c')]};}return respondWithRpcPromise(_0x4389('0xa9'),_0x4389('0xa8'),{'account':_0x4e3720});}})[_0x4389('0x1b')](respondWithResult(_0x4ba6ea,null))[_0x4389('0x4f')](handleError(_0x4ba6ea,null));};exports[_0x4389('0x2d')]=function(_0x1024f8,_0x5d35d2){return db['MailAccount'][_0x4389('0x54')]({'where':{'id':_0x1024f8[_0x4389('0x50')]['id']}})[_0x4389('0x1b')](handleEntityNotFound(_0x5d35d2,null))[_0x4389('0x1b')](function(_0x52e8f4){if(_0x52e8f4&&_0x52e8f4[_0x4389('0x71')]){throw new db[(_0x4389('0xaa'))][(_0x4389('0xab'))](_0x4389('0xac'));}return _0x52e8f4;})[_0x4389('0x1b')](removeEntity(_0x5d35d2,null))['catch'](handleError(_0x5d35d2,null));};exports[_0x4389('0xad')]=function(_0x29680f,_0x3993fd,_0x47b971){return db[_0x4389('0x4c')][_0x4389('0x54')]({'where':{'id':_0x29680f['params']['id']}})['then'](handleEntityNotFound(_0x3993fd,null))[_0x4389('0x1b')](function(_0x2fa97f){if(_0x2fa97f){return _0x2fa97f['addAgents'](_0x29680f['body'][_0x4389('0x5e')],_['omit'](_0x29680f[_0x4389('0x55')],['ids','id'])||{})[_0x4389('0xae')](function(_0x28fa36){for(var _0x5f1e39=0x0;_0x5f1e39<_0x29680f['body'][_0x4389('0x5e')][_0x4389('0x52')];_0x5f1e39+=0x1){socket[_0x4389('0xaf')](_0x4389('0xb0'),{'UserId':_0x29680f['body'][_0x4389('0x5e')][_0x5f1e39],'MailAccountId':_0x29680f[_0x4389('0x50')]['id']});}return _0x28fa36;});}})['then'](respondWithResult(_0x3993fd,null))[_0x4389('0x4f')](handleError(_0x3993fd,null));};exports[_0x4389('0xb1')]=function(_0x25b82d,_0x1ee2a2,_0x537e40){return db[_0x4389('0x4c')]['find']({'where':{'id':_0x25b82d[_0x4389('0x50')]['id']}})['then'](handleEntityNotFound(_0x1ee2a2,null))['then'](function(_0x1fe240){if(_0x1fe240){return _0x1fe240[_0x4389('0xb1')](_0x25b82d['query'][_0x4389('0x5e')])[_0x4389('0x1b')](function(){if(_[_0x4389('0xb2')](_0x25b82d[_0x4389('0x39')]['ids'])){for(var _0x35b44e=0x0;_0x35b44e<_0x25b82d[_0x4389('0x39')]['ids'][_0x4389('0x52')];_0x35b44e+=0x1){socket[_0x4389('0xaf')](_0x4389('0xb3'),{'UserId':Number(_0x25b82d['query'][_0x4389('0x5e')][_0x35b44e]),'MailAccountId':Number(_0x25b82d[_0x4389('0x50')]['id'])});}}else{socket[_0x4389('0xaf')](_0x4389('0xb3'),{'UserId':Number(_0x25b82d[_0x4389('0x39')][_0x4389('0x5e')]),'MailAccountId':Number(_0x25b82d[_0x4389('0x50')]['id'])});}});}})[_0x4389('0x1b')](respondWithStatusCode(_0x1ee2a2,null))[_0x4389('0x4f')](handleError(_0x1ee2a2,null));};exports[_0x4389('0xb4')]=function(_0x223232,_0x159603,_0x2ad088){var _0x4ddec0={};var _0xfe2a04={};var _0xd884fe;var _0x4e6e36;return db[_0x4389('0x4c')][_0x4389('0x62')]({'where':{'id':_0x223232[_0x4389('0x50')]['id']}})[_0x4389('0x1b')](handleEntityNotFound(_0x159603,null))[_0x4389('0x1b')](function(_0x46009d){if(_0x46009d){_0xd884fe=_0x46009d;_0xfe2a04['model']=_[_0x4389('0x38')](db[_0x4389('0x83')]['rawAttributes']);_0xfe2a04[_0x4389('0x39')]=_[_0x4389('0x38')](_0x223232[_0x4389('0x39')]);_0xfe2a04[_0x4389('0x3a')]=_[_0x4389('0x3b')](_0xfe2a04[_0x4389('0x37')],_0xfe2a04[_0x4389('0x39')]);_0x4ddec0[_0x4389('0x3c')]=_[_0x4389('0x3b')](_0xfe2a04[_0x4389('0x37')],qs[_0x4389('0x3d')](_0x223232[_0x4389('0x39')][_0x4389('0x3d')]));_0x4ddec0[_0x4389('0x3c')]=_0x4ddec0['attributes']['length']?_0x4ddec0[_0x4389('0x3c')]:_0xfe2a04[_0x4389('0x37')];_0x4ddec0[_0x4389('0x41')]=qs[_0x4389('0x42')](_0x223232[_0x4389('0x39')][_0x4389('0x42')]);_0x4ddec0[_0x4389('0x43')]=qs[_0x4389('0x3a')](_['pick'](_0x223232[_0x4389('0x39')],_0xfe2a04[_0x4389('0x3a')]));if(_0x223232[_0x4389('0x39')][_0x4389('0x48')]){_0x4ddec0[_0x4389('0x43')]=_[_0x4389('0x45')](_0x4ddec0[_0x4389('0x43')],{'$or':_[_0x4389('0x46')](_0x4ddec0[_0x4389('0x3c')],function(_0x1e855a){var _0x608bb2={};_0x608bb2[_0x1e855a]={'$like':'%'+_0x223232[_0x4389('0x39')]['filter']+'%'};return _0x608bb2;})});}_0x4ddec0=_['merge']({},_0x4ddec0,_0x223232[_0x4389('0x49')]);return _0xd884fe[_0x4389('0xb4')](_0x4ddec0);}})['then'](function(_0x5300d3){if(_0x5300d3){_0x4e6e36=_0x5300d3[_0x4389('0x52')];if(!_0x223232[_0x4389('0x39')][_0x4389('0x3e')]('nolimit')){_0x4ddec0[_0x4389('0x40')]=qs[_0x4389('0x40')](_0x223232[_0x4389('0x39')]['limit']);_0x4ddec0['offset']=qs[_0x4389('0x29')](_0x223232[_0x4389('0x39')]['offset']);}return _0xd884fe[_0x4389('0xb4')](_0x4ddec0);}})['then'](function(_0x28c796){if(_0x28c796){return _0x28c796?{'count':_0x4e6e36,'rows':_0x28c796}:null;}})['then'](respondWithResult(_0x159603,null))[_0x4389('0x4f')](handleError(_0x159603,null));}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.events.js b/server/api/mailAccount/mailAccount.events.js index ba5cb31..dc346d5 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 _0x6aa7=['events','MailAccount','setMaxListeners','save','update','emit','hook','exports'];(function(_0x125071,_0x300a51){var _0x17f324=function(_0x1c912d){while(--_0x1c912d){_0x125071['push'](_0x125071['shift']());}};_0x17f324(++_0x300a51);}(_0x6aa7,0x178));var _0x76aa=function(_0x27755a,_0x52819b){_0x27755a=_0x27755a-0x0;var _0x36ca92=_0x6aa7[_0x27755a];return _0x36ca92;};'use strict';var EventEmitter=require(_0x76aa('0x0'));var MailAccount=require('../../mysqldb')['db'][_0x76aa('0x1')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0x76aa('0x2')](0x0);var events={'afterCreate':_0x76aa('0x3'),'afterUpdate':_0x76aa('0x4'),'afterDestroy':'remove'};function emitEvent(_0x13f62b){return function(_0xef15ef,_0x1d6e04,_0x511588){MailAccountEvents['emit'](_0x13f62b+':'+_0xef15ef['id'],_0xef15ef);MailAccountEvents[_0x76aa('0x5')](_0x13f62b,_0xef15ef);_0x511588(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailAccount[_0x76aa('0x6')](e,emitEvent(event));}}module[_0x76aa('0x7')]=MailAccountEvents; \ No newline at end of file +var _0x55ca=['events','../../mysqldb','update','remove','emit','hasOwnProperty','hook'];(function(_0x2b5513,_0x3fe5cd){var _0x578fd2=function(_0x7a9106){while(--_0x7a9106){_0x2b5513['push'](_0x2b5513['shift']());}};_0x578fd2(++_0x3fe5cd);}(_0x55ca,0x126));var _0xa55c=function(_0x26a672,_0x59f5be){_0x26a672=_0x26a672-0x0;var _0x348f43=_0x55ca[_0x26a672];return _0x348f43;};'use strict';var EventEmitter=require(_0xa55c('0x0'));var MailAccount=require(_0xa55c('0x1'))['db']['MailAccount'];var MailAccountEvents=new EventEmitter();MailAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xa55c('0x2'),'afterDestroy':_0xa55c('0x3')};function emitEvent(_0x5dc716){return function(_0x3b478a,_0x2db02a,_0xcb02e3){MailAccountEvents[_0xa55c('0x4')](_0x5dc716+':'+_0x3b478a['id'],_0x3b478a);MailAccountEvents[_0xa55c('0x4')](_0x5dc716,_0x3b478a);_0xcb02e3(null);};}for(var e in events){if(events[_0xa55c('0x5')](e)){var event=events[e];MailAccount[_0xa55c('0x6')](e,emitEvent(event));}}module['exports']=MailAccountEvents; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.model.js b/server/api/mailAccount/mailAccount.model.js index 604af35..8707e5b 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 _0xece9=['../../config/environment','./mailAccount.attributes','exports','MailAccount','mail_accounts','lodash','util','api','moment','bluebird','path','rimraf'];(function(_0x106495,_0x203a4a){var _0x8ee37a=function(_0x56d281){while(--_0x56d281){_0x106495['push'](_0x106495['shift']());}};_0x8ee37a(++_0x203a4a);}(_0xece9,0x155));var _0x9ece=function(_0x13d844,_0x4487a6){_0x13d844=_0x13d844-0x0;var _0x3eef20=_0xece9[_0x13d844];return _0x3eef20;};'use strict';var _=require(_0x9ece('0x0'));var util=require(_0x9ece('0x1'));var logger=require('../../config/logger')(_0x9ece('0x2'));var moment=require(_0x9ece('0x3'));var BPromise=require(_0x9ece('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9ece('0x5'));var rimraf=require(_0x9ece('0x6'));var config=require(_0x9ece('0x7'));var attributes=require(_0x9ece('0x8'));module[_0x9ece('0x9')]=function(_0x3ce0fe,_0x3d5298){return _0x3ce0fe['define'](_0x9ece('0xa'),attributes,{'tableName':_0x9ece('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd110=['bluebird','request-promise','path','rimraf','../../config/environment','./mailAccount.attributes','exports','MailAccount','lodash','util','../../config/logger','moment'];(function(_0x4fbea9,_0x5d2484){var _0x3bc362=function(_0x59d83f){while(--_0x59d83f){_0x4fbea9['push'](_0x4fbea9['shift']());}};_0x3bc362(++_0x5d2484);}(_0xd110,0x1e8));var _0x0d11=function(_0x2ed886,_0x744a47){_0x2ed886=_0x2ed886-0x0;var _0x424061=_0xd110[_0x2ed886];return _0x424061;};'use strict';var _=require(_0x0d11('0x0'));var util=require(_0x0d11('0x1'));var logger=require(_0x0d11('0x2'))('api');var moment=require(_0x0d11('0x3'));var BPromise=require(_0x0d11('0x4'));var rp=require(_0x0d11('0x5'));var fs=require('fs');var path=require(_0x0d11('0x6'));var rimraf=require(_0x0d11('0x7'));var config=require(_0x0d11('0x8'));var attributes=require(_0x0d11('0x9'));module[_0x0d11('0xa')]=function(_0x578537,_0xf61dad){return _0x578537['define'](_0x0d11('0xb'),attributes,{'tableName':'mail_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.rpc.js b/server/api/mailAccount/mailAccount.rpc.js index f668a55..9f55566 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 _0xc678=['MailApplication','MailServerOut','List','omit','Applications','applications','list','orderBy','priority','asc','autoclose','push','close','length','defaults','ListId','create','List\x20not\x20found','messageId','generate','subject','attach','format','MailMessage','inReplyTo','MailInteraction','Contact\x20not\x20found','spread','update','YYYY-MM-DD\x20HH:mm:ss','interaction','get','created','attachments','originTo','bcc','Attachment','Attachments','UserId','User','name','waitForTheAssignedAgent','startRouting','Start','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','redis','localhost','socket.io-emitter','./mailAccount.socket','then','info','MailAccount,\x20%s,\x20%s','debug','error','message','request\x20sent','result','catch','MailAccount','options','where','attributes','limit','include','map','model','GetMailAccount','stringify','ShowMailAccount','find','body','mail','difference','keys','CmContact','rawAttributes','createdAt','updatedAt','CompanyId','from\x20is\x20mandatory','isNil','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','account','CmList','Contacts'];(function(_0x508885,_0x4f534f){var _0x5fe87b=function(_0x281697){while(--_0x281697){_0x508885['push'](_0x508885['shift']());}};_0x5fe87b(++_0x4f534f);}(_0xc678,0x1b4));var _0x8c67=function(_0x3354a6,_0x22d316){_0x3354a6=_0x3354a6-0x0;var _0x1467ea=_0xc678[_0x3354a6];return _0x1467ea;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x8c67('0x0'));var BPromise=require(_0x8c67('0x1'));var rs=require(_0x8c67('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8c67('0x3'))['db'];var utils=require(_0x8c67('0x4'));var logger=require(_0x8c67('0x5'))(_0x8c67('0x6'));var config=require('../../config/environment');var jayson=require(_0x8c67('0x7'));var client=jayson['client'][_0x8c67('0x8')]({'port':0x232c});config[_0x8c67('0x9')]=_['defaults'](config[_0x8c67('0x9')],{'host':_0x8c67('0xa'),'port':0x18eb});var socket=require(_0x8c67('0xb'))(new Redis(config[_0x8c67('0x9')]));require(_0x8c67('0xc'))['register'](socket);function respondWithRpcPromise(_0x2c0eba,_0x5e1b4a,_0x3ac494){return new BPromise(function(_0x141a49,_0x2bda5d){return client['request'](_0x2c0eba,_0x3ac494)[_0x8c67('0xd')](function(_0x2f1a54){logger[_0x8c67('0xe')](_0x8c67('0xf'),_0x5e1b4a,'request\x20sent');logger[_0x8c67('0x10')]('MailAccount,\x20%s,\x20%s,\x20%s',_0x5e1b4a,'request\x20sent',JSON['stringify'](_0x2f1a54));if(_0x2f1a54['error']){if(_0x2f1a54[_0x8c67('0x11')]['code']===0x1f4){logger[_0x8c67('0x11')]('MailAccount,\x20%s,\x20%s',_0x5e1b4a,_0x2f1a54[_0x8c67('0x11')][_0x8c67('0x12')]);return _0x2bda5d(_0x2f1a54[_0x8c67('0x11')][_0x8c67('0x12')]);}logger['error'](_0x8c67('0xf'),_0x5e1b4a,_0x2f1a54[_0x8c67('0x11')][_0x8c67('0x12')]);return _0x141a49(_0x2f1a54[_0x8c67('0x11')]['message']);}else{logger['info'](_0x8c67('0xf'),_0x5e1b4a,_0x8c67('0x13'));_0x141a49(_0x2f1a54[_0x8c67('0x14')]['message']);}})[_0x8c67('0x15')](function(_0x34796c){logger['error'](_0x8c67('0xf'),_0x5e1b4a,_0x34796c);_0x2bda5d(_0x34796c);});});}exports['GetMailAccount']=function(_0x2f65f9){var _0x44ec84=this;return new Promise(function(_0x1bfece,_0x2bd6b3){return db[_0x8c67('0x16')]['findAll']({'raw':_0x2f65f9[_0x8c67('0x17')]?_0x2f65f9[_0x8c67('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x2f65f9[_0x8c67('0x17')]?_0x2f65f9['options'][_0x8c67('0x18')]||null:null,'attributes':_0x2f65f9[_0x8c67('0x17')]?_0x2f65f9[_0x8c67('0x17')][_0x8c67('0x19')]||null:null,'limit':_0x2f65f9[_0x8c67('0x17')]?_0x2f65f9['options'][_0x8c67('0x1a')]||null:null,'include':_0x2f65f9[_0x8c67('0x17')]?_0x2f65f9[_0x8c67('0x17')][_0x8c67('0x1b')]?_[_0x8c67('0x1c')](_0x2f65f9[_0x8c67('0x17')]['include'],function(_0x4f0198){return{'model':db[_0x4f0198[_0x8c67('0x1d')]],'as':_0x4f0198['as'],'attributes':_0x4f0198['attributes'],'include':_0x4f0198['include']?_[_0x8c67('0x1c')](_0x4f0198[_0x8c67('0x1b')],function(_0x2f72ed){return{'model':db[_0x2f72ed['model']],'as':_0x2f72ed['as'],'attributes':_0x2f72ed[_0x8c67('0x19')],'include':_0x2f72ed[_0x8c67('0x1b')]?_[_0x8c67('0x1c')](_0x2f72ed[_0x8c67('0x1b')],function(_0x4e87db){return{'model':db[_0x4e87db[_0x8c67('0x1d')]],'as':_0x4e87db['as'],'attributes':_0x4e87db[_0x8c67('0x19')]};}):[]};}):[]};}):[]:[]})[_0x8c67('0xd')](function(_0x4768c4){logger[_0x8c67('0xe')](_0x8c67('0x1e'),_0x2f65f9);logger[_0x8c67('0x10')]('GetMailAccount',_0x2f65f9,JSON[_0x8c67('0x1f')](_0x4768c4));_0x1bfece(_0x4768c4);})[_0x8c67('0x15')](function(_0x603d29){logger[_0x8c67('0x11')](_0x8c67('0x1e'),_0x603d29['message'],_0x2f65f9);_0x2bd6b3(_0x44ec84['error'](0x1f4,_0x603d29[_0x8c67('0x12')]));});});};exports[_0x8c67('0x20')]=function(_0x1e6e64){var _0x3a3b29=this;return new Promise(function(_0x96ab7d,_0x4df33a){return db['MailAccount'][_0x8c67('0x21')]({'raw':_0x1e6e64[_0x8c67('0x17')]?_0x1e6e64[_0x8c67('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x1e6e64[_0x8c67('0x17')]?_0x1e6e64[_0x8c67('0x17')]['where']||null:null,'attributes':_0x1e6e64['options']?_0x1e6e64[_0x8c67('0x17')]['attributes']||null:null,'include':_0x1e6e64['options']?_0x1e6e64[_0x8c67('0x17')][_0x8c67('0x1b')]?_[_0x8c67('0x1c')](_0x1e6e64[_0x8c67('0x17')][_0x8c67('0x1b')],function(_0x100d8a){return{'model':db[_0x100d8a[_0x8c67('0x1d')]],'as':_0x100d8a['as'],'attributes':_0x100d8a[_0x8c67('0x19')],'include':_0x100d8a['include']?_['map'](_0x100d8a[_0x8c67('0x1b')],function(_0x49f225){return{'model':db[_0x49f225[_0x8c67('0x1d')]],'as':_0x49f225['as'],'attributes':_0x49f225['attributes'],'include':_0x49f225[_0x8c67('0x1b')]?_[_0x8c67('0x1c')](_0x49f225[_0x8c67('0x1b')],function(_0x2145b4){return{'model':db[_0x2145b4['model']],'as':_0x2145b4['as'],'attributes':_0x2145b4[_0x8c67('0x19')]};}):[]};}):[]};}):[]:[]})[_0x8c67('0xd')](function(_0x4de84d){logger[_0x8c67('0xe')](_0x8c67('0x20'),_0x1e6e64);logger[_0x8c67('0x10')]('ShowMailAccount',_0x1e6e64,JSON['stringify'](_0x4de84d));_0x96ab7d(_0x4de84d);})[_0x8c67('0x15')](function(_0x45a995){logger['error'](_0x8c67('0x20'),_0x45a995[_0x8c67('0x12')],_0x1e6e64);_0x4df33a(_0x3a3b29[_0x8c67('0x11')](0x1f4,_0x45a995[_0x8c67('0x12')]));});});};exports['NotifyMailAccount']=function(_0x5ad624){var _0x44b7f9=this;return new Promise(function(_0x14afcc,_0x4b8c00){var _0x57598e={'body':_0x5ad624[_0x8c67('0x22')],'channel':_0x8c67('0x23')};var _0x238ad7=_[_0x8c67('0x24')](_[_0x8c67('0x25')](db[_0x8c67('0x26')][_0x8c67('0x27')]),[_0x8c67('0x28'),_0x8c67('0x29'),_0x8c67('0x2a'),'ListId']);var _0x264cfe=![];if(_0x5ad624['body']['id']){delete _0x5ad624['body']['id'];}if(_['isNil'](_0x5ad624[_0x8c67('0x22')]['from'])){return _0x4b8c00(_0x44b7f9[_0x8c67('0x11')](0x1f4,_0x8c67('0x2b')));}if(_[_0x8c67('0x2c')](_0x5ad624[_0x8c67('0x22')][_0x8c67('0x22')])||_0x5ad624['body'][_0x8c67('0x22')]===''){return _0x4b8c00(_0x44b7f9[_0x8c67('0x11')](0x1f4,_0x8c67('0x2d')));}if(_[_0x8c67('0x2c')](_0x5ad624['body'][_0x8c67('0x2e')])){return _0x4b8c00(_0x44b7f9[_0x8c67('0x11')](0x1f4,_0x8c67('0x2f')+_0x238ad7));}if(!_[_0x8c67('0x30')](_0x238ad7,_0x5ad624[_0x8c67('0x22')]['mapKey'])){return _0x4b8c00(_0x44b7f9[_0x8c67('0x11')](0x1f4,_0x8c67('0x31')+_0x238ad7));}var _0x3512df={};_0x3512df[_0x5ad624[_0x8c67('0x22')]['mapKey']]=_0x5ad624[_0x8c67('0x22')][_0x8c67('0x32')];return db[_0x8c67('0x16')][_0x8c67('0x21')]({'where':{'id':_0x5ad624[_0x8c67('0x33')]['id']},'include':[{'model':db[_0x8c67('0x34')],'as':'List','include':[{'model':db[_0x8c67('0x26')],'as':_0x8c67('0x35'),'where':_0x3512df,'limit':0x1,'order':[['updatedAt','DESC']]}]},{'model':db[_0x8c67('0x36')],'as':'Applications'},{'model':db[_0x8c67('0x37')],'as':'Smtp'}]})[_0x8c67('0xd')](function(_0x2d5266){if(_0x2d5266&&_0x2d5266[_0x8c67('0x38')]){var _0x245924=_0x2d5266['get']({'plain':!![]});_0x57598e[_0x8c67('0x33')]=_[_0x8c67('0x39')](_0x245924,[_0x8c67('0x3a'),_0x8c67('0x38')]);_0x57598e[_0x8c67('0x3b')]=_0x245924[_0x8c67('0x3a')];_0x57598e[_0x8c67('0x3c')]=_0x245924[_0x8c67('0x38')];_0x57598e[_0x8c67('0x3b')]=_[_0x8c67('0x3d')](_0x57598e[_0x8c67('0x3b')],[_0x8c67('0x3e')],[_0x8c67('0x3f')]);if(_0x57598e['account']&&_0x57598e[_0x8c67('0x33')][_0x8c67('0x40')]){_0x57598e[_0x8c67('0x3b')][_0x8c67('0x41')]({'id':0x0,'priority':_0x57598e[_0x8c67('0x3b')]['length']+0x1,'app':_0x8c67('0x42'),'appdata':'autoclose','interval':'*,*,*,*'});}if(_0x57598e[_0x8c67('0x33')][_0x8c67('0x3a')]){delete _0x57598e[_0x8c67('0x33')]['Applications'];}if(_0x57598e[_0x8c67('0x33')]['List']){delete _0x57598e['account'][_0x8c67('0x38')];}if(_0x245924[_0x8c67('0x38')][_0x8c67('0x35')][_0x8c67('0x43')]){return _0x245924[_0x8c67('0x38')]['Contacts'][0x0];}var _0xc9ff67=_[_0x8c67('0x44')](_0x5ad624['body'],{'firstName':_0x5ad624[_0x8c67('0x22')][_0x8c67('0x32')],'ListId':_0x245924[_0x8c67('0x45')]});_0xc9ff67[_0x5ad624[_0x8c67('0x22')][_0x8c67('0x2e')]]=_0x5ad624['body'][_0x8c67('0x32')];return db[_0x8c67('0x26')][_0x8c67('0x46')](_0xc9ff67);}else{throw new Error(_0x8c67('0x47'));}})['then'](function(_0x4bab95){_0x57598e['contact']=_0x4bab95;if(_0x4bab95){if(!_0x5ad624[_0x8c67('0x22')][_0x8c67('0x12')][_0x8c67('0x48')]){_0x5ad624[_0x8c67('0x22')]['message'][_0x8c67('0x48')]=rs[_0x8c67('0x49')]()+'\x20'+_0x5ad624['body']['message'][_0x8c67('0x32')];}var _0x2cae4f={'ContactId':_0x4bab95['id'],'MailAccountId':_0x5ad624['account']['id'],'inReplyTo':_0x5ad624[_0x8c67('0x22')]['message'][_0x8c67('0x48')],'to':_0x5ad624['body']['message'][_0x8c67('0x32')],'cc':_0x5ad624[_0x8c67('0x22')][_0x8c67('0x12')]['cc'],'subject':_0x5ad624['body']['message'][_0x8c67('0x4a')],'attach':_0x5ad624['body'][_0x8c67('0x12')][_0x8c67('0x4b')],'lastMsgAt':moment()[_0x8c67('0x4c')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'in','lastMsgBody':_0x5ad624[_0x8c67('0x22')]['body']};return db['MailInteraction']['find']({'where':{'closed':![],'MailAccountId':_0x5ad624[_0x8c67('0x33')]['id']},'include':[{'model':db[_0x8c67('0x4d')],'as':'Messages','attributes':[_0x8c67('0x48')],'where':{'messageId':_0x5ad624[_0x8c67('0x22')][_0x8c67('0x12')][_0x8c67('0x4e')]}}]})[_0x8c67('0xd')](function(_0x44406c){if(_0x44406c){return[_0x44406c,![]];}return db[_0x8c67('0x4f')][_0x8c67('0x46')](_0x2cae4f)[_0x8c67('0xd')](function(_0x2dd794){return[_0x2dd794,!![]];});});}else{throw new Error(_0x8c67('0x50'));}})[_0x8c67('0x51')](function(_0x4ed210,_0x1e1152){if(_0x4ed210){_0x264cfe=_0x1e1152;if(!_0x1e1152){return _0x4ed210[_0x8c67('0x52')]({'inReplyTo':_0x5ad624[_0x8c67('0x22')][_0x8c67('0x12')][_0x8c67('0x48')],'to':_0x5ad624['body'][_0x8c67('0x12')][_0x8c67('0x32')],'cc':_0x5ad624[_0x8c67('0x22')][_0x8c67('0x12')]['cc'],'subject':_0x5ad624[_0x8c67('0x22')]['message'][_0x8c67('0x4a')],'attach':_0x4ed210[_0x8c67('0x4b')]?_0x4ed210[_0x8c67('0x4b')]:_0x5ad624[_0x8c67('0x22')]['message'][_0x8c67('0x4b')],'substatus':null,'substatusAt':moment()['format'](_0x8c67('0x53')),'lastMsgAt':moment()[_0x8c67('0x4c')](_0x8c67('0x53')),'lastMsgDirection':'in','lastMsgBody':_0x5ad624['body']['body']});}else{return _0x4ed210;}}})[_0x8c67('0xd')](function(_0x414ab9){_0x57598e[_0x8c67('0x54')]=_0x414ab9[_0x8c67('0x55')]({'plain':!![]});_0x57598e[_0x8c67('0x54')][_0x8c67('0x56')]=_0x264cfe;return db[_0x8c67('0x4d')]['create']({'body':_0x5ad624[_0x8c67('0x22')]['body'],'MailAccountId':_0x5ad624[_0x8c67('0x33')]['id'],'MailInteractionId':_0x414ab9['id'],'direction':'in','ContactId':_0x57598e['contact']['id'],'messageId':_0x5ad624['body']['message'][_0x8c67('0x48')],'from':_0x5ad624['body'][_0x8c67('0x12')][_0x8c67('0x32')],'to':_0x5ad624['body']['message']['to'],'cc':_0x5ad624[_0x8c67('0x22')][_0x8c67('0x12')]['cc'],'subject':_0x5ad624[_0x8c67('0x22')][_0x8c67('0x12')][_0x8c67('0x4a')],'attach':_0x5ad624[_0x8c67('0x22')][_0x8c67('0x12')]['attach'],'Attachments':_0x5ad624['body'][_0x8c67('0x12')][_0x8c67('0x57')],'originTo':_0x5ad624[_0x8c67('0x22')][_0x8c67('0x12')][_0x8c67('0x58')],'originCc':_0x5ad624[_0x8c67('0x22')][_0x8c67('0x12')]['originCc'],'bcc':_0x5ad624[_0x8c67('0x22')]['message'][_0x8c67('0x59')]},{'include':[{'model':db[_0x8c67('0x5a')],'as':_0x8c67('0x5b')}]});})[_0x8c67('0xd')](function(_0x42f9b7){_0x57598e[_0x8c67('0x12')]=_0x42f9b7;if(_0x57598e[_0x8c67('0x54')][_0x8c67('0x5c')]){return db[_0x8c67('0x5d')][_0x8c67('0x21')]({'attributes':['id',_0x8c67('0x5e')],'where':{'id':_0x57598e['interaction']['UserId']}})[_0x8c67('0xd')](function(_0x4ec7e9){if(_0x4ec7e9){_0x57598e[_0x8c67('0x3b')]['unshift']({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x4ec7e9[_0x8c67('0x5e')]+','+(_0x57598e[_0x8c67('0x33')][_0x8c67('0x5f')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise('Start',_0x8c67('0x60'),_0x57598e);});}return respondWithRpcPromise(_0x8c67('0x61'),_0x8c67('0x60'),_0x57598e);})[_0x8c67('0xd')](function(_0x3ddd83){_0x14afcc(_0x3ddd83);})[_0x8c67('0x15')](function(_0x178095){_0x4b8c00(_0x44b7f9[_0x8c67('0x11')](0x1f4,_0x178095[_0x8c67('0x12')]));});});}; \ No newline at end of file +var _0x97f5=['update','interaction','created','attachments','originTo','originCc','bcc','Attachment','User','UserId','agent','name','waitForTheAssignedAgent','startRouting','Start','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./mailAccount.socket','request','info','MailAccount,\x20%s,\x20%s','debug','MailAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','GetMailAccount','findAll','options','raw','where','attributes','include','map','model','then','catch','ShowMailAccount','MailAccount','mail','keys','CmContact','rawAttributes','ListId','body','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','find','List','Contacts','updatedAt','DESC','Applications','MailServerOut','Smtp','get','account','omit','applications','orderBy','priority','asc','autoclose','close','*,*,*,*','create','List\x20not\x20found','contact','messageId','generate','subject','attach','format','YYYY-MM-DD\x20HH:mm:ss','Messages','Contact\x20not\x20found','spread'];(function(_0x273b17,_0x576bf7){var _0x26b46d=function(_0x42c5ed){while(--_0x42c5ed){_0x273b17['push'](_0x273b17['shift']());}};_0x26b46d(++_0x576bf7);}(_0x97f5,0x72));var _0x597f=function(_0x109deb,_0x102bd3){_0x109deb=_0x109deb-0x0;var _0x525343=_0x97f5[_0x109deb];return _0x525343;};'use strict';var _=require(_0x597f('0x0'));var util=require(_0x597f('0x1'));var moment=require(_0x597f('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x597f('0x3'));var db=require(_0x597f('0x4'))['db'];var utils=require(_0x597f('0x5'));var logger=require(_0x597f('0x6'))(_0x597f('0x7'));var config=require(_0x597f('0x8'));var jayson=require(_0x597f('0x9'));var client=jayson[_0x597f('0xa')][_0x597f('0xb')]({'port':0x232c});config['redis']=_[_0x597f('0xc')](config[_0x597f('0xd')],{'host':_0x597f('0xe'),'port':0x18eb});var socket=require(_0x597f('0xf'))(new Redis(config[_0x597f('0xd')]));require(_0x597f('0x10'))['register'](socket);function respondWithRpcPromise(_0x31c4bc,_0x5bbf3f,_0x87960e){return new BPromise(function(_0x505618,_0x4b75e0){return client[_0x597f('0x11')](_0x31c4bc,_0x87960e)['then'](function(_0x2d3a41){logger[_0x597f('0x12')](_0x597f('0x13'),_0x5bbf3f,'request\x20sent');logger[_0x597f('0x14')](_0x597f('0x15'),_0x5bbf3f,_0x597f('0x16'),JSON[_0x597f('0x17')](_0x2d3a41));if(_0x2d3a41[_0x597f('0x18')]){if(_0x2d3a41[_0x597f('0x18')][_0x597f('0x19')]===0x1f4){logger[_0x597f('0x18')](_0x597f('0x13'),_0x5bbf3f,_0x2d3a41[_0x597f('0x18')][_0x597f('0x1a')]);return _0x4b75e0(_0x2d3a41[_0x597f('0x18')][_0x597f('0x1a')]);}logger['error'](_0x597f('0x13'),_0x5bbf3f,_0x2d3a41[_0x597f('0x18')][_0x597f('0x1a')]);return _0x505618(_0x2d3a41['error'][_0x597f('0x1a')]);}else{logger['info']('MailAccount,\x20%s,\x20%s',_0x5bbf3f,'request\x20sent');_0x505618(_0x2d3a41['result']['message']);}})['catch'](function(_0xd3e2eb){logger[_0x597f('0x18')]('MailAccount,\x20%s,\x20%s',_0x5bbf3f,_0xd3e2eb);_0x4b75e0(_0xd3e2eb);});});}exports[_0x597f('0x1b')]=function(_0x1b1fe4){var _0x3244c4=this;return new Promise(function(_0x3d0862,_0x53b85e){return db['MailAccount'][_0x597f('0x1c')]({'raw':_0x1b1fe4[_0x597f('0x1d')]?_0x1b1fe4[_0x597f('0x1d')][_0x597f('0x1e')]===undefined?!![]:![]:!![],'where':_0x1b1fe4['options']?_0x1b1fe4['options'][_0x597f('0x1f')]||null:null,'attributes':_0x1b1fe4['options']?_0x1b1fe4['options'][_0x597f('0x20')]||null:null,'limit':_0x1b1fe4[_0x597f('0x1d')]?_0x1b1fe4[_0x597f('0x1d')]['limit']||null:null,'include':_0x1b1fe4['options']?_0x1b1fe4['options'][_0x597f('0x21')]?_[_0x597f('0x22')](_0x1b1fe4['options'][_0x597f('0x21')],function(_0x7bf4fe){return{'model':db[_0x7bf4fe[_0x597f('0x23')]],'as':_0x7bf4fe['as'],'attributes':_0x7bf4fe['attributes'],'include':_0x7bf4fe['include']?_[_0x597f('0x22')](_0x7bf4fe['include'],function(_0x16bc39){return{'model':db[_0x16bc39[_0x597f('0x23')]],'as':_0x16bc39['as'],'attributes':_0x16bc39[_0x597f('0x20')],'include':_0x16bc39[_0x597f('0x21')]?_[_0x597f('0x22')](_0x16bc39[_0x597f('0x21')],function(_0x1c5300){return{'model':db[_0x1c5300['model']],'as':_0x1c5300['as'],'attributes':_0x1c5300['attributes']};}):[]};}):[]};}):[]:[]})[_0x597f('0x24')](function(_0x508d4e){logger[_0x597f('0x12')](_0x597f('0x1b'),_0x1b1fe4);logger[_0x597f('0x14')](_0x597f('0x1b'),_0x1b1fe4,JSON[_0x597f('0x17')](_0x508d4e));_0x3d0862(_0x508d4e);})[_0x597f('0x25')](function(_0x2a88af){logger['error']('GetMailAccount',_0x2a88af[_0x597f('0x1a')],_0x1b1fe4);_0x53b85e(_0x3244c4['error'](0x1f4,_0x2a88af[_0x597f('0x1a')]));});});};exports[_0x597f('0x26')]=function(_0x355106){var _0x6a05f=this;return new Promise(function(_0x56d261,_0x179fee){return db[_0x597f('0x27')]['find']({'raw':_0x355106[_0x597f('0x1d')]?_0x355106[_0x597f('0x1d')][_0x597f('0x1e')]===undefined?!![]:![]:!![],'where':_0x355106['options']?_0x355106['options'][_0x597f('0x1f')]||null:null,'attributes':_0x355106[_0x597f('0x1d')]?_0x355106[_0x597f('0x1d')]['attributes']||null:null,'include':_0x355106['options']?_0x355106[_0x597f('0x1d')][_0x597f('0x21')]?_[_0x597f('0x22')](_0x355106[_0x597f('0x1d')][_0x597f('0x21')],function(_0x56e8fc){return{'model':db[_0x56e8fc[_0x597f('0x23')]],'as':_0x56e8fc['as'],'attributes':_0x56e8fc[_0x597f('0x20')],'include':_0x56e8fc[_0x597f('0x21')]?_[_0x597f('0x22')](_0x56e8fc[_0x597f('0x21')],function(_0x75eb9f){return{'model':db[_0x75eb9f[_0x597f('0x23')]],'as':_0x75eb9f['as'],'attributes':_0x75eb9f['attributes'],'include':_0x75eb9f[_0x597f('0x21')]?_['map'](_0x75eb9f[_0x597f('0x21')],function(_0x4239cf){return{'model':db[_0x4239cf[_0x597f('0x23')]],'as':_0x4239cf['as'],'attributes':_0x4239cf['attributes']};}):[]};}):[]};}):[]:[]})[_0x597f('0x24')](function(_0x5bc9ec){logger[_0x597f('0x12')](_0x597f('0x26'),_0x355106);logger[_0x597f('0x14')](_0x597f('0x26'),_0x355106,JSON[_0x597f('0x17')](_0x5bc9ec));_0x56d261(_0x5bc9ec);})[_0x597f('0x25')](function(_0x429a26){logger[_0x597f('0x18')]('ShowMailAccount',_0x429a26[_0x597f('0x1a')],_0x355106);_0x179fee(_0x6a05f[_0x597f('0x18')](0x1f4,_0x429a26[_0x597f('0x1a')]));});});};exports['NotifyMailAccount']=function(_0x4bead9){var _0x52c995=this;return new Promise(function(_0x1ea2f2,_0xd01859){var _0x27daef={'body':_0x4bead9['body'],'channel':_0x597f('0x28')};var _0x297496=_['difference'](_[_0x597f('0x29')](db[_0x597f('0x2a')][_0x597f('0x2b')]),['createdAt','updatedAt','CompanyId',_0x597f('0x2c')]);var _0xc62652=![];if(_0x4bead9[_0x597f('0x2d')]['id']){delete _0x4bead9[_0x597f('0x2d')]['id'];}if(_[_0x597f('0x2e')](_0x4bead9[_0x597f('0x2d')][_0x597f('0x2f')])){return _0xd01859(_0x52c995[_0x597f('0x18')](0x1f4,_0x597f('0x30')));}if(_[_0x597f('0x2e')](_0x4bead9['body']['body'])||_0x4bead9[_0x597f('0x2d')][_0x597f('0x2d')]===''){return _0xd01859(_0x52c995[_0x597f('0x18')](0x1f4,_0x597f('0x31')));}if(_[_0x597f('0x2e')](_0x4bead9[_0x597f('0x2d')][_0x597f('0x32')])){return _0xd01859(_0x52c995['error'](0x1f4,_0x597f('0x33')+_0x297496));}if(!_[_0x597f('0x34')](_0x297496,_0x4bead9[_0x597f('0x2d')][_0x597f('0x32')])){return _0xd01859(_0x52c995[_0x597f('0x18')](0x1f4,_0x597f('0x35')+_0x297496));}var _0x487429={};_0x487429[_0x4bead9[_0x597f('0x2d')][_0x597f('0x32')]]=_0x4bead9[_0x597f('0x2d')][_0x597f('0x2f')];return db['MailAccount'][_0x597f('0x36')]({'where':{'id':_0x4bead9['account']['id']},'include':[{'model':db['CmList'],'as':_0x597f('0x37'),'include':[{'model':db[_0x597f('0x2a')],'as':_0x597f('0x38'),'where':_0x487429,'limit':0x1,'order':[[_0x597f('0x39'),_0x597f('0x3a')]]}]},{'model':db['MailApplication'],'as':_0x597f('0x3b')},{'model':db[_0x597f('0x3c')],'as':_0x597f('0x3d')}]})[_0x597f('0x24')](function(_0x2417cb){if(_0x2417cb&&_0x2417cb[_0x597f('0x37')]){var _0x4bc1e7=_0x2417cb[_0x597f('0x3e')]({'plain':!![]});_0x27daef[_0x597f('0x3f')]=_[_0x597f('0x40')](_0x4bc1e7,['Applications','List']);_0x27daef[_0x597f('0x41')]=_0x4bc1e7[_0x597f('0x3b')];_0x27daef['list']=_0x4bc1e7[_0x597f('0x37')];_0x27daef['applications']=_[_0x597f('0x42')](_0x27daef[_0x597f('0x41')],[_0x597f('0x43')],[_0x597f('0x44')]);if(_0x27daef['account']&&_0x27daef[_0x597f('0x3f')][_0x597f('0x45')]){_0x27daef[_0x597f('0x41')]['push']({'id':0x0,'priority':_0x27daef[_0x597f('0x41')]['length']+0x1,'app':_0x597f('0x46'),'appdata':'autoclose','interval':_0x597f('0x47')});}if(_0x27daef['account'][_0x597f('0x3b')]){delete _0x27daef[_0x597f('0x3f')][_0x597f('0x3b')];}if(_0x27daef[_0x597f('0x3f')][_0x597f('0x37')]){delete _0x27daef[_0x597f('0x3f')][_0x597f('0x37')];}if(_0x4bc1e7[_0x597f('0x37')][_0x597f('0x38')]['length']){return _0x4bc1e7[_0x597f('0x37')]['Contacts'][0x0];}var _0x2d8488=_[_0x597f('0xc')](_0x4bead9['body'],{'firstName':_0x4bead9['body']['from'],'ListId':_0x4bc1e7[_0x597f('0x2c')]});_0x2d8488[_0x4bead9[_0x597f('0x2d')][_0x597f('0x32')]]=_0x4bead9[_0x597f('0x2d')]['from'];return db[_0x597f('0x2a')][_0x597f('0x48')](_0x2d8488);}else{throw new Error(_0x597f('0x49'));}})[_0x597f('0x24')](function(_0x165f46){_0x27daef[_0x597f('0x4a')]=_0x165f46;if(_0x165f46){if(!_0x4bead9['body'][_0x597f('0x1a')][_0x597f('0x4b')]){_0x4bead9[_0x597f('0x2d')][_0x597f('0x1a')][_0x597f('0x4b')]=rs[_0x597f('0x4c')]()+'\x20'+_0x4bead9[_0x597f('0x2d')]['message'][_0x597f('0x2f')];}var _0x59f700={'ContactId':_0x165f46['id'],'MailAccountId':_0x4bead9[_0x597f('0x3f')]['id'],'inReplyTo':_0x4bead9['body'][_0x597f('0x1a')][_0x597f('0x4b')],'to':_0x4bead9[_0x597f('0x2d')][_0x597f('0x1a')][_0x597f('0x2f')],'cc':_0x4bead9['body'][_0x597f('0x1a')]['cc'],'subject':_0x4bead9[_0x597f('0x2d')]['message'][_0x597f('0x4d')],'attach':_0x4bead9[_0x597f('0x2d')][_0x597f('0x1a')][_0x597f('0x4e')],'lastMsgAt':moment()[_0x597f('0x4f')](_0x597f('0x50')),'lastMsgDirection':'in','lastMsgBody':_0x4bead9[_0x597f('0x2d')][_0x597f('0x2d')]};return db['MailInteraction'][_0x597f('0x36')]({'where':{'closed':![],'MailAccountId':_0x4bead9['account']['id']},'include':[{'model':db['MailMessage'],'as':_0x597f('0x51'),'attributes':['messageId'],'where':{'messageId':_0x4bead9['body'][_0x597f('0x1a')]['inReplyTo']}}]})[_0x597f('0x24')](function(_0x1ac24c){if(_0x1ac24c){return[_0x1ac24c,![]];}return db['MailInteraction'][_0x597f('0x48')](_0x59f700)[_0x597f('0x24')](function(_0x35f3c2){return[_0x35f3c2,!![]];});});}else{throw new Error(_0x597f('0x52'));}})[_0x597f('0x53')](function(_0x4761e4,_0x455866){if(_0x4761e4){_0xc62652=_0x455866;if(!_0x455866){return _0x4761e4[_0x597f('0x54')]({'inReplyTo':_0x4bead9[_0x597f('0x2d')][_0x597f('0x1a')][_0x597f('0x4b')],'to':_0x4bead9[_0x597f('0x2d')][_0x597f('0x1a')][_0x597f('0x2f')],'cc':_0x4bead9['body'][_0x597f('0x1a')]['cc'],'subject':_0x4bead9[_0x597f('0x2d')]['message'][_0x597f('0x4d')],'attach':_0x4761e4['attach']?_0x4761e4[_0x597f('0x4e')]:_0x4bead9['body'][_0x597f('0x1a')][_0x597f('0x4e')],'substatus':null,'substatusAt':moment()['format'](_0x597f('0x50')),'lastMsgAt':moment()['format'](_0x597f('0x50')),'lastMsgDirection':'in','lastMsgBody':_0x4bead9[_0x597f('0x2d')][_0x597f('0x2d')]});}else{return _0x4761e4;}}})[_0x597f('0x24')](function(_0x2e5bf7){_0x27daef[_0x597f('0x55')]=_0x2e5bf7[_0x597f('0x3e')]({'plain':!![]});_0x27daef['interaction'][_0x597f('0x56')]=_0xc62652;return db['MailMessage']['create']({'body':_0x4bead9[_0x597f('0x2d')][_0x597f('0x2d')],'MailAccountId':_0x4bead9['account']['id'],'MailInteractionId':_0x2e5bf7['id'],'direction':'in','ContactId':_0x27daef['contact']['id'],'messageId':_0x4bead9[_0x597f('0x2d')][_0x597f('0x1a')][_0x597f('0x4b')],'from':_0x4bead9[_0x597f('0x2d')]['message'][_0x597f('0x2f')],'to':_0x4bead9[_0x597f('0x2d')][_0x597f('0x1a')]['to'],'cc':_0x4bead9[_0x597f('0x2d')][_0x597f('0x1a')]['cc'],'subject':_0x4bead9[_0x597f('0x2d')][_0x597f('0x1a')][_0x597f('0x4d')],'attach':_0x4bead9[_0x597f('0x2d')][_0x597f('0x1a')]['attach'],'Attachments':_0x4bead9[_0x597f('0x2d')][_0x597f('0x1a')][_0x597f('0x57')],'originTo':_0x4bead9[_0x597f('0x2d')]['message'][_0x597f('0x58')],'originCc':_0x4bead9[_0x597f('0x2d')][_0x597f('0x1a')][_0x597f('0x59')],'bcc':_0x4bead9[_0x597f('0x2d')][_0x597f('0x1a')][_0x597f('0x5a')]},{'include':[{'model':db[_0x597f('0x5b')],'as':'Attachments'}]});})[_0x597f('0x24')](function(_0x13dc6a){_0x27daef['message']=_0x13dc6a;if(_0x27daef['interaction']['UserId']){return db[_0x597f('0x5c')][_0x597f('0x36')]({'attributes':['id','name'],'where':{'id':_0x27daef[_0x597f('0x55')][_0x597f('0x5d')]}})[_0x597f('0x24')](function(_0x40a961){if(_0x40a961){_0x27daef['applications']['unshift']({'id':0x0,'priority':0x0,'app':_0x597f('0x5e'),'appdata':_0x40a961[_0x597f('0x5f')]+','+(_0x27daef['account'][_0x597f('0x60')]||0xa),'interval':_0x597f('0x47')});}return respondWithRpcPromise('Start',_0x597f('0x61'),_0x27daef);});}return respondWithRpcPromise(_0x597f('0x62'),_0x597f('0x61'),_0x27daef);})['then'](function(_0x1c1712){_0x1ea2f2(_0x1c1712);})['catch'](function(_0xeb9f62){_0xd01859(_0x52c995[_0x597f('0x18')](0x1f4,_0xeb9f62[_0x597f('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.socket.js b/server/api/mailAccount/mailAccount.socket.js index e85bc65..7c81d91 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 _0x556b=['save','remove','update','emit','removeListener','length','mailAccount:','./mailAccount.events'];(function(_0x168c17,_0x5a4807){var _0x112b42=function(_0x4c31a2){while(--_0x4c31a2){_0x168c17['push'](_0x168c17['shift']());}};_0x112b42(++_0x5a4807);}(_0x556b,0x1d7));var _0xb556=function(_0x22d3b1,_0x3788f1){_0x22d3b1=_0x22d3b1-0x0;var _0x20f6a6=_0x556b[_0x22d3b1];return _0x20f6a6;};'use strict';var MailAccountEvents=require(_0xb556('0x0'));var events=[_0xb556('0x1'),_0xb556('0x2'),_0xb556('0x3')];function createListener(_0x3589ec,_0x5676d8){return function(_0xdc5b69){_0x5676d8[_0xb556('0x4')](_0x3589ec,_0xdc5b69);};}function removeListener(_0x4202e0,_0x30214e){return function(){MailAccountEvents[_0xb556('0x5')](_0x4202e0,_0x30214e);};}exports['register']=function(_0x4ee766){for(var _0x52669f=0x0,_0x18728e=events[_0xb556('0x6')];_0x52669f<_0x18728e;_0x52669f++){var _0x1cc8a1=events[_0x52669f];var _0x33508d=createListener(_0xb556('0x7')+_0x1cc8a1,_0x4ee766);MailAccountEvents['on'](_0x1cc8a1,_0x33508d);}}; \ No newline at end of file +var _0x8b2d=['mailAccount:','remove','emit','removeListener','register','length'];(function(_0x246f0d,_0x1c0cd5){var _0x29bb00=function(_0x23041d){while(--_0x23041d){_0x246f0d['push'](_0x246f0d['shift']());}};_0x29bb00(++_0x1c0cd5);}(_0x8b2d,0xe5));var _0xd8b2=function(_0x1158e1,_0x31b137){_0x1158e1=_0x1158e1-0x0;var _0x22ff3d=_0x8b2d[_0x1158e1];return _0x22ff3d;};'use strict';var MailAccountEvents=require('./mailAccount.events');var events=['save',_0xd8b2('0x0'),'update'];function createListener(_0x3007a6,_0x429708){return function(_0x4d922e){_0x429708[_0xd8b2('0x1')](_0x3007a6,_0x4d922e);};}function removeListener(_0x3a7304,_0x55a03c){return function(){MailAccountEvents[_0xd8b2('0x2')](_0x3a7304,_0x55a03c);};}exports[_0xd8b2('0x3')]=function(_0x36eb23){for(var _0x282a58=0x0,_0x1c78f6=events[_0xd8b2('0x4')];_0x282a58<_0x1c78f6;_0x282a58++){var _0x42fe49=events[_0x282a58];var _0x210fe2=createListener(_0xd8b2('0x5')+_0x42fe49,_0x36eb23);MailAccountEvents['on'](_0x42fe49,_0x210fe2);}}; \ No newline at end of file diff --git a/server/api/mailApplication/index.js b/server/api/mailApplication/index.js index e5f032c..5aa7958 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 _0xbdb7=['path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','show','put','update','delete','destroy','exports','multer','util'];(function(_0x4b6658,_0x15a721){var _0x3e311a=function(_0x51307b){while(--_0x51307b){_0x4b6658['push'](_0x4b6658['shift']());}};_0x3e311a(++_0x15a721);}(_0xbdb7,0x12e));var _0x7bdb=function(_0x56fb7d,_0x539ea1){_0x56fb7d=_0x56fb7d-0x0;var _0x3be1c3=_0xbdb7[_0x56fb7d];return _0x3be1c3;};'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 auth=require(_0x7bdb('0x6'));var interaction=require(_0x7bdb('0x7'));var config=require(_0x7bdb('0x8'));var controller=require('./mailApplication.controller');router[_0x7bdb('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x7bdb('0xa')]);router[_0x7bdb('0xb')]('/:id',auth['isAuthenticated'](),controller[_0x7bdb('0xc')]);router[_0x7bdb('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x7bdb('0xe')]);module[_0x7bdb('0xf')]=router; \ No newline at end of file +var _0x0972=['delete','exports','util','connect-timeout','Router','../../components/auth/service','../../config/environment','./mailApplication.controller','get','/:id','isAuthenticated','show','put','update'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x0972,0x64));var _0x2097=function(_0x2969ec,_0x520364){_0x2969ec=_0x2969ec-0x0;var _0x5c1e5e=_0x0972[_0x2969ec];return _0x5c1e5e;};'use strict';var multer=require('multer');var util=require(_0x2097('0x0'));var path=require('path');var timeout=require(_0x2097('0x1'));var express=require('express');var router=express[_0x2097('0x2')]();var auth=require(_0x2097('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x2097('0x4'));var controller=require(_0x2097('0x5'));router[_0x2097('0x6')](_0x2097('0x7'),auth[_0x2097('0x8')](),controller[_0x2097('0x9')]);router[_0x2097('0xa')]('/:id',auth[_0x2097('0x8')](),controller[_0x2097('0xb')]);router[_0x2097('0xc')](_0x2097('0x7'),auth[_0x2097('0x8')](),controller['destroy']);module[_0x2097('0xd')]=router; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.attributes.js b/server/api/mailApplication/mailApplication.attributes.js index 4c81f0b..5b323f4 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 _0x8ad3=['TEXT','*,*,*,*','sequelize','exports','INTEGER','STRING','noop'];(function(_0x24f870,_0x2c8a88){var _0x5d065b=function(_0x168247){while(--_0x168247){_0x24f870['push'](_0x24f870['shift']());}};_0x5d065b(++_0x2c8a88);}(_0x8ad3,0x1de));var _0x38ad=function(_0x2d56ed,_0x1048b8){_0x2d56ed=_0x2d56ed-0x0;var _0x2e869b=_0x8ad3[_0x2d56ed];return _0x2e869b;};'use strict';var Sequelize=require(_0x38ad('0x0'));module[_0x38ad('0x1')]={'priority':{'type':Sequelize[_0x38ad('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x38ad('0x3')],'allowNull':![],'defaultValue':_0x38ad('0x4')},'appdata':{'type':Sequelize[_0x38ad('0x5')]()},'description':{'type':Sequelize[_0x38ad('0x3')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x38ad('0x6')}}; \ No newline at end of file +var _0x0f9d=['TEXT','STRING','*,*,*,*','sequelize','INTEGER','noop'];(function(_0x1f93b6,_0xf85aed){var _0x3cbad6=function(_0x4cd5b7){while(--_0x4cd5b7){_0x1f93b6['push'](_0x1f93b6['shift']());}};_0x3cbad6(++_0xf85aed);}(_0x0f9d,0x81));var _0xd0f9=function(_0x254081,_0x20731a){_0x254081=_0x254081-0x0;var _0x5d1e2a=_0x0f9d[_0x254081];return _0x5d1e2a;};'use strict';var Sequelize=require(_0xd0f9('0x0'));module['exports']={'priority':{'type':Sequelize[_0xd0f9('0x1')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xd0f9('0x2')},'appdata':{'type':Sequelize[_0xd0f9('0x3')]()},'description':{'type':Sequelize[_0xd0f9('0x4')]},'interval':{'type':Sequelize[_0xd0f9('0x4')],'defaultValue':_0xd0f9('0x5')}}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.controller.js b/server/api/mailApplication/mailApplication.controller.js index 52d7b06..a5237ef 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 _0xdf85=['query','filters','model','attributes','intersection','fields','length','includeAll','include','options','catch','body','find','params','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','Content-Range','apply','reject','save','destroy','then','stack','name','keys','MailApplication'];(function(_0x39da27,_0x111e0a){var _0x1e1082=function(_0x52b31d){while(--_0x52b31d){_0x39da27['push'](_0x39da27['shift']());}};_0x1e1082(++_0x111e0a);}(_0xdf85,0x1be));var _0x5df8=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0xdf85[_0x178e48];return _0x440d7e;};'use strict';var pdf=require(_0x5df8('0x0'));var emlformat=require(_0x5df8('0x1'));var rimraf=require(_0x5df8('0x2'));var zipdir=require(_0x5df8('0x3'));var jsonpatch=require(_0x5df8('0x4'));var rp=require(_0x5df8('0x5'));var moment=require(_0x5df8('0x6'));var BPromise=require(_0x5df8('0x7'));var Mustache=require('mustache');var util=require('util');var path=require(_0x5df8('0x8'));var sox=require(_0x5df8('0x9'));var csv=require(_0x5df8('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x5df8('0xb'));var crypto=require(_0x5df8('0xc'));var jsforce=require(_0x5df8('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x5df8('0xe'));var Papa=require(_0x5df8('0xf'));var Redis=require(_0x5df8('0x10'));var authService=require(_0x5df8('0x11'));var qs=require(_0x5df8('0x12'));var as=require(_0x5df8('0x13'));var hardwareService=require(_0x5df8('0x14'));var logger=require(_0x5df8('0x15'))(_0x5df8('0x16'));var utils=require(_0x5df8('0x17'));var config=require(_0x5df8('0x18'));var db=require(_0x5df8('0x19'))['db'];function respondWithStatusCode(_0x17bb3d,_0x20deef){_0x20deef=_0x20deef||0xcc;return function(_0x1fab5b){if(_0x1fab5b){return _0x17bb3d[_0x5df8('0x1a')](_0x20deef);}return _0x17bb3d[_0x5df8('0x1b')](_0x20deef)[_0x5df8('0x1c')]();};}function respondWithResult(_0x1b2fcd,_0x4afe81){_0x4afe81=_0x4afe81||0xc8;return function(_0x9c1a85){if(_0x9c1a85){return _0x1b2fcd['status'](_0x4afe81)[_0x5df8('0x1d')](_0x9c1a85);}};}function respondWithFilteredResult(_0x3e6652,_0x492bc5){return function(_0x540f02){if(_0x540f02){var _0x5f2e53=_0x540f02['count'],_0x20d6bb=_0x492bc5['offset'],_0x2612d2=_0x492bc5['offset']+_0x492bc5['limit'],_0x6d06b8;if(_0x2612d2>=_0x5f2e53){_0x2612d2=_0x5f2e53;_0x6d06b8=0xc8;}else{_0x6d06b8=0xce;}_0x3e6652[_0x5df8('0x1b')](_0x6d06b8);return _0x3e6652['set'](_0x5df8('0x1e'),_0x20d6bb+'-'+_0x2612d2+'/'+_0x5f2e53)[_0x5df8('0x1d')](_0x540f02);}return null;};}function patchUpdates(_0x349f6b){return function(_0x46c7ee){try{jsonpatch[_0x5df8('0x1f')](_0x46c7ee,_0x349f6b,!![]);}catch(_0x3733b2){return BPromise[_0x5df8('0x20')](_0x3733b2);}return _0x46c7ee[_0x5df8('0x21')]();};}function saveUpdates(_0x26bf1d,_0x53aac0){return function(_0xd28054){if(_0xd28054){return _0xd28054['update'](_0x26bf1d)['then'](function(_0x51ac78){return _0x51ac78;});}return null;};}function removeEntity(_0x3cca8d,_0xf8ead9){return function(_0x3879cc){if(_0x3879cc){return _0x3879cc[_0x5df8('0x22')]()[_0x5df8('0x23')](function(){_0x3cca8d[_0x5df8('0x1b')](0xcc)[_0x5df8('0x1c')]();});}};}function handleEntityNotFound(_0x38f64c,_0x3ea214){return function(_0x6eb637){if(!_0x6eb637){_0x38f64c['sendStatus'](0x194);}return _0x6eb637;};}function handleError(_0x4ad5b2,_0x17730f){_0x17730f=_0x17730f||0x1f4;return function(_0x62cdc1){logger['error'](_0x62cdc1[_0x5df8('0x24')]);if(_0x62cdc1[_0x5df8('0x25')]){delete _0x62cdc1[_0x5df8('0x25')];}_0x4ad5b2[_0x5df8('0x1b')](_0x17730f)['send'](_0x62cdc1);};}exports['show']=function(_0x35e8bb,_0xe69f95){var _0x5f268c={'raw':!![],'where':{'id':_0x35e8bb['params']['id']}},_0x590afb={};_0x590afb['model']=_[_0x5df8('0x26')](db[_0x5df8('0x27')]['rawAttributes']);_0x590afb[_0x5df8('0x28')]=_[_0x5df8('0x26')](_0x35e8bb[_0x5df8('0x28')]);_0x590afb[_0x5df8('0x29')]=_['intersection'](_0x590afb[_0x5df8('0x2a')],_0x590afb[_0x5df8('0x28')]);_0x5f268c[_0x5df8('0x2b')]=_[_0x5df8('0x2c')](_0x590afb[_0x5df8('0x2a')],qs[_0x5df8('0x2d')](_0x35e8bb['query'][_0x5df8('0x2d')]));_0x5f268c[_0x5df8('0x2b')]=_0x5f268c[_0x5df8('0x2b')][_0x5df8('0x2e')]?_0x5f268c[_0x5df8('0x2b')]:_0x590afb['model'];if(_0x35e8bb[_0x5df8('0x28')][_0x5df8('0x2f')]){_0x5f268c[_0x5df8('0x30')]=[{'all':!![]}];}_0x5f268c=_['merge']({},_0x5f268c,_0x35e8bb[_0x5df8('0x31')]);return db['MailApplication']['find'](_0x5f268c)[_0x5df8('0x23')](handleEntityNotFound(_0xe69f95,null))['then'](respondWithResult(_0xe69f95,null))[_0x5df8('0x32')](handleError(_0xe69f95,null));};exports['update']=function(_0x3c5e1c,_0x5b21d9){if(_0x3c5e1c[_0x5df8('0x33')]['id']){delete _0x3c5e1c['body']['id'];}return db[_0x5df8('0x27')][_0x5df8('0x34')]({'where':{'id':_0x3c5e1c['params']['id']}})[_0x5df8('0x23')](handleEntityNotFound(_0x5b21d9,null))[_0x5df8('0x23')](saveUpdates(_0x3c5e1c[_0x5df8('0x33')],null))[_0x5df8('0x23')](respondWithResult(_0x5b21d9,null))['catch'](handleError(_0x5b21d9,null));};exports[_0x5df8('0x22')]=function(_0x3e31be,_0x35519b){return db['MailApplication'][_0x5df8('0x34')]({'where':{'id':_0x3e31be[_0x5df8('0x35')]['id']}})[_0x5df8('0x23')](handleEntityNotFound(_0x35519b,null))[_0x5df8('0x23')](removeEntity(_0x35519b,null))['catch'](handleError(_0x35519b,null));}; \ No newline at end of file +var _0x11ee=['squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','set','Content-Range','save','update','then','destroy','error','stack','name','send','params','MailApplication','rawAttributes','query','keys','filters','intersection','model','attributes','fields','length','includeAll','merge','options','catch','body','find','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','lodash'];(function(_0x5451a2,_0x47da86){var _0xbb918b=function(_0x46e5cd){while(--_0x46e5cd){_0x5451a2['push'](_0x5451a2['shift']());}};_0xbb918b(++_0x47da86);}(_0x11ee,0x190));var _0xe11e=function(_0x1cc1fd,_0x33f9f1){_0x1cc1fd=_0x1cc1fd-0x0;var _0x5e3d41=_0x11ee[_0x1cc1fd];return _0x5e3d41;};'use strict';var pdf=require(_0xe11e('0x0'));var emlformat=require(_0xe11e('0x1'));var rimraf=require(_0xe11e('0x2'));var zipdir=require(_0xe11e('0x3'));var jsonpatch=require(_0xe11e('0x4'));var rp=require(_0xe11e('0x5'));var moment=require(_0xe11e('0x6'));var BPromise=require(_0xe11e('0x7'));var Mustache=require(_0xe11e('0x8'));var util=require('util');var path=require(_0xe11e('0x9'));var sox=require(_0xe11e('0xa'));var csv=require(_0xe11e('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xe11e('0xc'));var squel=require(_0xe11e('0xd'));var crypto=require(_0xe11e('0xe'));var jsforce=require(_0xe11e('0xf'));var deskjs=require(_0xe11e('0x10'));var toCsv=require(_0xe11e('0xb'));var querystring=require(_0xe11e('0x11'));var Papa=require('papaparse');var Redis=require(_0xe11e('0x12'));var authService=require(_0xe11e('0x13'));var qs=require(_0xe11e('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe11e('0x15'));var logger=require(_0xe11e('0x16'))(_0xe11e('0x17'));var utils=require(_0xe11e('0x18'));var config=require(_0xe11e('0x19'));var db=require(_0xe11e('0x1a'))['db'];function respondWithStatusCode(_0x57387b,_0x31201a){_0x31201a=_0x31201a||0xcc;return function(_0x2b7f3b){if(_0x2b7f3b){return _0x57387b[_0xe11e('0x1b')](_0x31201a);}return _0x57387b[_0xe11e('0x1c')](_0x31201a)['end']();};}function respondWithResult(_0x572f4b,_0x18bb15){_0x18bb15=_0x18bb15||0xc8;return function(_0x5eae7c){if(_0x5eae7c){return _0x572f4b['status'](_0x18bb15)[_0xe11e('0x1d')](_0x5eae7c);}};}function respondWithFilteredResult(_0x1780a8,_0x1252a1){return function(_0x13af57){if(_0x13af57){var _0x4cc709=_0x13af57[_0xe11e('0x1e')],_0x33aa8d=_0x1252a1[_0xe11e('0x1f')],_0x477889=_0x1252a1['offset']+_0x1252a1['limit'],_0x23d247;if(_0x477889>=_0x4cc709){_0x477889=_0x4cc709;_0x23d247=0xc8;}else{_0x23d247=0xce;}_0x1780a8[_0xe11e('0x1c')](_0x23d247);return _0x1780a8[_0xe11e('0x20')](_0xe11e('0x21'),_0x33aa8d+'-'+_0x477889+'/'+_0x4cc709)['json'](_0x13af57);}return null;};}function patchUpdates(_0x27fce5){return function(_0x574869){try{jsonpatch['apply'](_0x574869,_0x27fce5,!![]);}catch(_0x51adc3){return BPromise['reject'](_0x51adc3);}return _0x574869[_0xe11e('0x22')]();};}function saveUpdates(_0x118fb4,_0x4dd959){return function(_0x4dc9ea){if(_0x4dc9ea){return _0x4dc9ea[_0xe11e('0x23')](_0x118fb4)[_0xe11e('0x24')](function(_0x312048){return _0x312048;});}return null;};}function removeEntity(_0xbb0bfb,_0x370a9b){return function(_0x2b6420){if(_0x2b6420){return _0x2b6420[_0xe11e('0x25')]()['then'](function(){_0xbb0bfb['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x56b95e,_0x2e5559){return function(_0x1662b3){if(!_0x1662b3){_0x56b95e[_0xe11e('0x1b')](0x194);}return _0x1662b3;};}function handleError(_0x544d07,_0x2ba7bc){_0x2ba7bc=_0x2ba7bc||0x1f4;return function(_0x5262b2){logger[_0xe11e('0x26')](_0x5262b2[_0xe11e('0x27')]);if(_0x5262b2[_0xe11e('0x28')]){delete _0x5262b2[_0xe11e('0x28')];}_0x544d07['status'](_0x2ba7bc)[_0xe11e('0x29')](_0x5262b2);};}exports['show']=function(_0x3795be,_0xeefafb){var _0x5aaeaf={'raw':!![],'where':{'id':_0x3795be[_0xe11e('0x2a')]['id']}},_0x2d1f9a={};_0x2d1f9a['model']=_['keys'](db[_0xe11e('0x2b')][_0xe11e('0x2c')]);_0x2d1f9a[_0xe11e('0x2d')]=_[_0xe11e('0x2e')](_0x3795be[_0xe11e('0x2d')]);_0x2d1f9a[_0xe11e('0x2f')]=_[_0xe11e('0x30')](_0x2d1f9a[_0xe11e('0x31')],_0x2d1f9a[_0xe11e('0x2d')]);_0x5aaeaf[_0xe11e('0x32')]=_[_0xe11e('0x30')](_0x2d1f9a[_0xe11e('0x31')],qs[_0xe11e('0x33')](_0x3795be[_0xe11e('0x2d')][_0xe11e('0x33')]));_0x5aaeaf[_0xe11e('0x32')]=_0x5aaeaf[_0xe11e('0x32')][_0xe11e('0x34')]?_0x5aaeaf[_0xe11e('0x32')]:_0x2d1f9a[_0xe11e('0x31')];if(_0x3795be[_0xe11e('0x2d')][_0xe11e('0x35')]){_0x5aaeaf['include']=[{'all':!![]}];}_0x5aaeaf=_[_0xe11e('0x36')]({},_0x5aaeaf,_0x3795be[_0xe11e('0x37')]);return db['MailApplication']['find'](_0x5aaeaf)[_0xe11e('0x24')](handleEntityNotFound(_0xeefafb,null))[_0xe11e('0x24')](respondWithResult(_0xeefafb,null))[_0xe11e('0x38')](handleError(_0xeefafb,null));};exports[_0xe11e('0x23')]=function(_0x2a80e5,_0x381509){if(_0x2a80e5[_0xe11e('0x39')]['id']){delete _0x2a80e5['body']['id'];}return db[_0xe11e('0x2b')][_0xe11e('0x3a')]({'where':{'id':_0x2a80e5[_0xe11e('0x2a')]['id']}})[_0xe11e('0x24')](handleEntityNotFound(_0x381509,null))[_0xe11e('0x24')](saveUpdates(_0x2a80e5[_0xe11e('0x39')],null))[_0xe11e('0x24')](respondWithResult(_0x381509,null))[_0xe11e('0x38')](handleError(_0x381509,null));};exports['destroy']=function(_0x28326f,_0x2c1637){return db[_0xe11e('0x2b')][_0xe11e('0x3a')]({'where':{'id':_0x28326f[_0xe11e('0x2a')]['id']}})[_0xe11e('0x24')](handleEntityNotFound(_0x2c1637,null))[_0xe11e('0x24')](removeEntity(_0x2c1637,null))[_0xe11e('0x38')](handleError(_0x2c1637,null));}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.model.js b/server/api/mailApplication/mailApplication.model.js index a9d41c5..c6f92d6 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 _0xcaaf=['mail_applications','utf8mb4','lodash','../../config/logger','bluebird','request-promise','rimraf','exports','define','MailApplication'];(function(_0x403c20,_0x4a7b99){var _0x2b271a=function(_0x106ecb){while(--_0x106ecb){_0x403c20['push'](_0x403c20['shift']());}};_0x2b271a(++_0x4a7b99);}(_0xcaaf,0x66));var _0xfcaa=function(_0x325eba,_0x476c96){_0x325eba=_0x325eba-0x0;var _0x311c8d=_0xcaaf[_0x325eba];return _0x311c8d;};'use strict';var _=require(_0xfcaa('0x0'));var util=require('util');var logger=require(_0xfcaa('0x1'))('api');var moment=require('moment');var BPromise=require(_0xfcaa('0x2'));var rp=require(_0xfcaa('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xfcaa('0x4'));var config=require('../../config/environment');var attributes=require('./mailApplication.attributes');module[_0xfcaa('0x5')]=function(_0x83f91d,_0x146224){return _0x83f91d[_0xfcaa('0x6')](_0xfcaa('0x7'),attributes,{'tableName':_0xfcaa('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xfcaa('0x9'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x8a87=['request-promise','path','../../config/environment','define','MailApplication','mail_applications','utf8mb4_unicode_ci','lodash','api','bluebird'];(function(_0x42eaf3,_0x9fc83e){var _0x16cdde=function(_0x3738a2){while(--_0x3738a2){_0x42eaf3['push'](_0x42eaf3['shift']());}};_0x16cdde(++_0x9fc83e);}(_0x8a87,0x6b));var _0x78a8=function(_0x18a79d,_0x57bd2c){_0x18a79d=_0x18a79d-0x0;var _0x4f8848=_0x8a87[_0x18a79d];return _0x4f8848;};'use strict';var _=require(_0x78a8('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x78a8('0x1'));var moment=require('moment');var BPromise=require(_0x78a8('0x2'));var rp=require(_0x78a8('0x3'));var fs=require('fs');var path=require(_0x78a8('0x4'));var rimraf=require('rimraf');var config=require(_0x78a8('0x5'));var attributes=require('./mailApplication.attributes');module['exports']=function(_0xd9737c,_0x3c5bb6){return _0xd9737c[_0x78a8('0x6')](_0x78a8('0x7'),attributes,{'tableName':_0x78a8('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x78a8('0x9')});}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.rpc.js b/server/api/mailApplication/mailApplication.rpc.js index d66b047..e97032c 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 _0x084b=['stringify','error','code','message','result','catch','UpdateMailApplication','body','options','attributes','then','util','moment','bluebird','randomstring','../../config/logger','rpc','../../config/environment','jayson/promise','info','MailApplication,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x084b,0x108));var _0xb084=function(_0x50ab3e,_0xab7114){_0x50ab3e=_0x50ab3e-0x0;var _0x386bf3=_0x084b[_0x50ab3e];return _0x386bf3;};'use strict';var _=require('lodash');var util=require(_0xb084('0x0'));var moment=require(_0xb084('0x1'));var BPromise=require(_0xb084('0x2'));var rs=require(_0xb084('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xb084('0x4'))(_0xb084('0x5'));var config=require(_0xb084('0x6'));var jayson=require(_0xb084('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x10a4df,_0x19b071,_0x19b7ed){return new BPromise(function(_0x4ac99c,_0x3da943){return client['request'](_0x10a4df,_0x19b7ed)['then'](function(_0xaf75c9){logger[_0xb084('0x8')](_0xb084('0x9'),_0x19b071,_0xb084('0xa'));logger[_0xb084('0xb')]('MailApplication,\x20%s,\x20%s,\x20%s',_0x19b071,'request\x20sent',JSON[_0xb084('0xc')](_0xaf75c9));if(_0xaf75c9[_0xb084('0xd')]){if(_0xaf75c9[_0xb084('0xd')][_0xb084('0xe')]===0x1f4){logger[_0xb084('0xd')]('MailApplication,\x20%s,\x20%s',_0x19b071,_0xaf75c9[_0xb084('0xd')][_0xb084('0xf')]);return _0x3da943(_0xaf75c9['error'][_0xb084('0xf')]);}logger[_0xb084('0xd')]('MailApplication,\x20%s,\x20%s',_0x19b071,_0xaf75c9[_0xb084('0xd')][_0xb084('0xf')]);return _0x4ac99c(_0xaf75c9[_0xb084('0xd')]['message']);}else{logger[_0xb084('0x8')](_0xb084('0x9'),_0x19b071,_0xb084('0xa'));_0x4ac99c(_0xaf75c9[_0xb084('0x10')]['message']);}})[_0xb084('0x11')](function(_0x3e9e2b){logger[_0xb084('0xd')](_0xb084('0x9'),_0x19b071,_0x3e9e2b);_0x3da943(_0x3e9e2b);});});}exports[_0xb084('0x12')]=function(_0x9c8df2){var _0x15784a=this;return new Promise(function(_0x26db8f,_0x56c59f){return db['MailApplication']['update'](_0x9c8df2[_0xb084('0x13')],{'raw':_0x9c8df2[_0xb084('0x14')]?_0x9c8df2['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x9c8df2['options']?_0x9c8df2['options']['where']||null:null,'attributes':_0x9c8df2[_0xb084('0x14')]?_0x9c8df2['options'][_0xb084('0x15')]||null:null,'limit':_0x9c8df2[_0xb084('0x14')]?_0x9c8df2[_0xb084('0x14')]['limit']||null:null})[_0xb084('0x16')](function(_0x49b2e5){logger['info'](_0xb084('0x12'),_0x9c8df2);logger['debug']('UpdateMailApplication',_0x9c8df2,JSON[_0xb084('0xc')](_0x49b2e5));_0x26db8f(_0x49b2e5);})[_0xb084('0x11')](function(_0x97cb42){logger['error'](_0xb084('0x12'),_0x97cb42['message'],_0x9c8df2);_0x56c59f(_0x15784a[_0xb084('0xd')](0x1f4,_0x97cb42[_0xb084('0xf')]));});});}; \ No newline at end of file +var _0x5cb3=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','MailApplication,\x20%s,\x20%s','request\x20sent','debug','MailApplication,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','MailApplication','body','options','raw','attributes','limit','UpdateMailApplication','lodash'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x5cb3,0x173));var _0x35cb=function(_0x417100,_0x262217){_0x417100=_0x417100-0x0;var _0x290264=_0x5cb3[_0x417100];return _0x290264;};'use strict';var _=require(_0x35cb('0x0'));var util=require(_0x35cb('0x1'));var moment=require(_0x35cb('0x2'));var BPromise=require(_0x35cb('0x3'));var rs=require(_0x35cb('0x4'));var fs=require('fs');var Redis=require(_0x35cb('0x5'));var db=require(_0x35cb('0x6'))['db'];var utils=require(_0x35cb('0x7'));var logger=require(_0x35cb('0x8'))(_0x35cb('0x9'));var config=require(_0x35cb('0xa'));var jayson=require('jayson/promise');var client=jayson['client'][_0x35cb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x19bd26,_0x4c040a,_0x2b6275){return new BPromise(function(_0x5e017a,_0x4a9f43){return client[_0x35cb('0xc')](_0x19bd26,_0x2b6275)[_0x35cb('0xd')](function(_0x5d4bde){logger[_0x35cb('0xe')](_0x35cb('0xf'),_0x4c040a,_0x35cb('0x10'));logger[_0x35cb('0x11')](_0x35cb('0x12'),_0x4c040a,_0x35cb('0x10'),JSON[_0x35cb('0x13')](_0x5d4bde));if(_0x5d4bde[_0x35cb('0x14')]){if(_0x5d4bde['error']['code']===0x1f4){logger[_0x35cb('0x14')](_0x35cb('0xf'),_0x4c040a,_0x5d4bde[_0x35cb('0x14')][_0x35cb('0x15')]);return _0x4a9f43(_0x5d4bde[_0x35cb('0x14')][_0x35cb('0x15')]);}logger[_0x35cb('0x14')]('MailApplication,\x20%s,\x20%s',_0x4c040a,_0x5d4bde['error'][_0x35cb('0x15')]);return _0x5e017a(_0x5d4bde['error'][_0x35cb('0x15')]);}else{logger[_0x35cb('0xe')]('MailApplication,\x20%s,\x20%s',_0x4c040a,_0x35cb('0x10'));_0x5e017a(_0x5d4bde[_0x35cb('0x16')]['message']);}})[_0x35cb('0x17')](function(_0x19cedb){logger[_0x35cb('0x14')]('MailApplication,\x20%s,\x20%s',_0x4c040a,_0x19cedb);_0x4a9f43(_0x19cedb);});});}exports['UpdateMailApplication']=function(_0x5e3969){var _0x333a44=this;return new Promise(function(_0x1d9464,_0x164d3e){return db[_0x35cb('0x18')]['update'](_0x5e3969[_0x35cb('0x19')],{'raw':_0x5e3969[_0x35cb('0x1a')]?_0x5e3969['options'][_0x35cb('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5e3969['options']?_0x5e3969[_0x35cb('0x1a')]['where']||null:null,'attributes':_0x5e3969['options']?_0x5e3969[_0x35cb('0x1a')][_0x35cb('0x1c')]||null:null,'limit':_0x5e3969[_0x35cb('0x1a')]?_0x5e3969['options'][_0x35cb('0x1d')]||null:null})['then'](function(_0x116653){logger[_0x35cb('0xe')]('UpdateMailApplication',_0x5e3969);logger[_0x35cb('0x11')](_0x35cb('0x1e'),_0x5e3969,JSON['stringify'](_0x116653));_0x1d9464(_0x116653);})['catch'](function(_0x288eb0){logger['error'](_0x35cb('0x1e'),_0x288eb0[_0x35cb('0x15')],_0x5e3969);_0x164d3e(_0x333a44[_0x35cb('0x14')](0x1f4,_0x288eb0[_0x35cb('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/index.js b/server/api/mailInteraction/index.js index da1e929..daed355 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 _0xea4e=['/:id/download','post','create','/:id/messages','tracked','addTags','put','mail','mailinteraction:update','delete','mailinteraction:destroy','destroy','/:id/tags','removeTags','exports','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./mailInteraction.controller','isAuthenticated','index','get','/describe','/:id','getMessages'];(function(_0x204c3f,_0x67a4c2){var _0x4e4023=function(_0x242625){while(--_0x242625){_0x204c3f['push'](_0x204c3f['shift']());}};_0x4e4023(++_0x67a4c2);}(_0xea4e,0x7f));var _0xeea4=function(_0x522ae8,_0x3b637e){_0x522ae8=_0x522ae8-0x0;var _0x3189b9=_0xea4e[_0x522ae8];return _0x3189b9;};'use strict';var multer=require('multer');var util=require(_0xeea4('0x0'));var path=require(_0xeea4('0x1'));var timeout=require(_0xeea4('0x2'));var express=require(_0xeea4('0x3'));var router=express['Router']();var auth=require(_0xeea4('0x4'));var interaction=require(_0xeea4('0x5'));var config=require('../../config/environment');var controller=require(_0xeea4('0x6'));router['get']('/',auth[_0xeea4('0x7')](),controller[_0xeea4('0x8')]);router[_0xeea4('0x9')](_0xeea4('0xa'),auth[_0xeea4('0x7')](),controller['describe']);router[_0xeea4('0x9')](_0xeea4('0xb'),auth['isAuthenticated'](),controller['show']);router[_0xeea4('0x9')]('/:id/messages',auth[_0xeea4('0x7')](),controller[_0xeea4('0xc')]);router['get'](_0xeea4('0xd'),auth[_0xeea4('0x7')](),controller['download']);router[_0xeea4('0xe')]('/',auth['isAuthenticated'](),controller[_0xeea4('0xf')]);router['post'](_0xeea4('0x10'),auth[_0xeea4('0x7')](),controller['addMessage']);router[_0xeea4('0xe')]('/:id/tags',auth[_0xeea4('0x7')](),interaction[_0xeea4('0x11')]('mail','mailinteraction:addtags'),controller[_0xeea4('0x12')]);router[_0xeea4('0x13')](_0xeea4('0xb'),auth[_0xeea4('0x7')](),interaction['tracked'](_0xeea4('0x14'),_0xeea4('0x15')),controller['update']);router[_0xeea4('0x16')](_0xeea4('0xb'),auth[_0xeea4('0x7')](),interaction['tracked']('mail',_0xeea4('0x17')),controller[_0xeea4('0x18')]);router[_0xeea4('0x16')](_0xeea4('0x19'),auth[_0xeea4('0x7')](),controller[_0xeea4('0x1a')]);module[_0xeea4('0x1b')]=router; \ No newline at end of file +var _0x9f02=['/:id/messages','isAuthenticated','post','addMessage','/:id/tags','tracked','mail','addTags','mailinteraction:destroy','destroy','delete','exports','multer','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','/:id','show'];(function(_0x3666dc,_0x18701a){var _0x31c942=function(_0x315164){while(--_0x315164){_0x3666dc['push'](_0x3666dc['shift']());}};_0x31c942(++_0x18701a);}(_0x9f02,0x68));var _0x29f0=function(_0xd2b586,_0x386668){_0xd2b586=_0xd2b586-0x0;var _0x42ffc5=_0x9f02[_0xd2b586];return _0x42ffc5;};'use strict';var multer=require(_0x29f0('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x29f0('0x1'));var router=express[_0x29f0('0x2')]();var auth=require(_0x29f0('0x3'));var interaction=require(_0x29f0('0x4'));var config=require(_0x29f0('0x5'));var controller=require('./mailInteraction.controller');router[_0x29f0('0x6')]('/',auth['isAuthenticated'](),controller[_0x29f0('0x7')]);router[_0x29f0('0x6')](_0x29f0('0x8'),auth['isAuthenticated'](),controller['describe']);router['get'](_0x29f0('0x9'),auth['isAuthenticated'](),controller[_0x29f0('0xa')]);router[_0x29f0('0x6')](_0x29f0('0xb'),auth['isAuthenticated'](),controller['getMessages']);router[_0x29f0('0x6')]('/:id/download',auth['isAuthenticated'](),controller['download']);router['post']('/',auth[_0x29f0('0xc')](),controller['create']);router[_0x29f0('0xd')]('/:id/messages',auth[_0x29f0('0xc')](),controller[_0x29f0('0xe')]);router[_0x29f0('0xd')](_0x29f0('0xf'),auth['isAuthenticated'](),interaction[_0x29f0('0x10')](_0x29f0('0x11'),'mailinteraction:addtags'),controller[_0x29f0('0x12')]);router['put'](_0x29f0('0x9'),auth['isAuthenticated'](),interaction[_0x29f0('0x10')](_0x29f0('0x11'),'mailinteraction:update'),controller['update']);router['delete'](_0x29f0('0x9'),auth[_0x29f0('0xc')](),interaction[_0x29f0('0x10')]('mail',_0x29f0('0x13')),controller[_0x29f0('0x14')]);router[_0x29f0('0x15')](_0x29f0('0xf'),auth[_0x29f0('0xc')](),controller['removeTags']);module[_0x29f0('0x16')]=router; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.attributes.js b/server/api/mailInteraction/mailInteraction.attributes.js index 3a216b7..7add46c 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 _0xef79=['STRING','TEXT','long','ENUM','out','sequelize','iconv','exports','DATE'];(function(_0x36f08c,_0x2aca5a){var _0xe9250b=function(_0x59b64a){while(--_0x59b64a){_0x36f08c['push'](_0x36f08c['shift']());}};_0xe9250b(++_0x2aca5a);}(_0xef79,0x16d));var _0x9ef7=function(_0x5c35e8,_0x2e4c7d){_0x5c35e8=_0x5c35e8-0x0;var _0x3de678=_0xef79[_0x5c35e8];return _0x3de678;};'use strict';var Sequelize=require(_0x9ef7('0x0'));var iconv=require(_0x9ef7('0x1'));module[_0x9ef7('0x2')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x9ef7('0x3')]},'disposition':{'type':Sequelize[_0x9ef7('0x4')]},'note':{'type':Sequelize[_0x9ef7('0x4')]},'inReplyTo':{'type':Sequelize[_0x9ef7('0x4')](0x1fe)},'to':{'type':Sequelize[_0x9ef7('0x4')]},'cc':{'type':Sequelize[_0x9ef7('0x5')](_0x9ef7('0x6'))},'subject':{'type':Sequelize[_0x9ef7('0x5')]()},'attach':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0x9ef7('0x3')]},'substatus':{'type':Sequelize['STRING'](0x3c)},'substatusAt':{'type':Sequelize[_0x9ef7('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x9ef7('0x7')]('in',_0x9ef7('0x8')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x9ef7('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x9ef7('0x7')]('in',_0x9ef7('0x8')),'defaultValue':'in','allowNull':![]},'lastMsgBody':{'type':Sequelize['TEXT'](_0x9ef7('0x6'))},'lastMsgText':{'type':Sequelize[_0x9ef7('0x5')](_0x9ef7('0x6'))}}; \ No newline at end of file +var _0xbe38=['DATE','STRING','TEXT','long','ENUM','out','sequelize','iconv','exports'];(function(_0x1480b0,_0xf300d5){var _0x1b6d25=function(_0x369881){while(--_0x369881){_0x1480b0['push'](_0x1480b0['shift']());}};_0x1b6d25(++_0xf300d5);}(_0xbe38,0x11d));var _0x8be3=function(_0x4d9c3b,_0x3c4663){_0x4d9c3b=_0x4d9c3b-0x0;var _0x35c391=_0xbe38[_0x4d9c3b];return _0x35c391;};'use strict';var Sequelize=require(_0x8be3('0x0'));var iconv=require(_0x8be3('0x1'));module[_0x8be3('0x2')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x8be3('0x3')]},'disposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize['STRING']},'inReplyTo':{'type':Sequelize[_0x8be3('0x4')](0x1fe)},'to':{'type':Sequelize[_0x8be3('0x4')]},'cc':{'type':Sequelize[_0x8be3('0x5')](_0x8be3('0x6'))},'subject':{'type':Sequelize['TEXT']()},'attach':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0x8be3('0x3')]},'substatus':{'type':Sequelize[_0x8be3('0x4')](0x3c)},'substatusAt':{'type':Sequelize[_0x8be3('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x8be3('0x7')]('in',_0x8be3('0x8')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x8be3('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x8be3('0x7')]('in',_0x8be3('0x8')),'defaultValue':'in','allowNull':![]},'lastMsgBody':{'type':Sequelize[_0x8be3('0x5')](_0x8be3('0x6'))},'lastMsgText':{'type':Sequelize['TEXT'](_0x8be3('0x6'))}}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.controller.js b/server/api/mailInteraction/mailInteraction.controller.js index 9a6926a..5608532 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 _0xbb59=['basename','type','readFileSync','build','writeFileSync','message%d.eml','log','err','unlinkSync','html-pdf','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','html-to-text','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','sendStatus','end','status','json','offset','set','Content-Range','apply','reject','update','destroy','error','stack','name','Users','TagIds','split','forEach','push','MailInteraction','findOne','lastMsgBody','lastMsgText','then','trimStart','fromString','catch','index','rawAttributes','model','query','keys','filters','intersection','attributes','length','nolimit','limit','order','sort','where','pick','select','field','color','from','tools_tags','u.id','left_join','users','u.id\x20=\x20ui.UserId','mail_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','mail_accounts','a.id\x20=\x20i.MailAccountId','me.MailInteractionId\x20=\x20i.id','expr','advancedFilter','parse','matchType','omit','options','custom','columns','hasMultipleConditions','value','parseOperator','getConditionValue','isRangeCondition','table','values','having','$between','`\x20>\x200','map','filter','isNil','isEmpty','MailAccountId','createdAt','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','replace','\x27\x27\x27\x27','isNumeric','i.id\x20LIKE\x20?','c.email\x20LIKE\x20?','toString','join','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','Sequelize','SELECT','clone','i.id','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','DESC','tag','isArray','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','mail_interaction_has_tags','t.id\x20=\x20it.TagId','hasOwnProperty','TagId','it.MailInteractionId\x20=\x20i.id','t.id\x20IN\x20?','count','sequelize','merge','a.key','a.mandatoryDisposition','Account.mandatoryDisposition','i.createdAt','i.updatedAt','i.closedAt','i.attach','i.lastMsgAt','i.substatus','i.to','i.ContactId','i.MailAccountId','i.UserId','me.plainBody','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','GROUP_CONCAT(DISTINCT\x20t.id)','ui.MailInteractionId\x20IN\x20?','MailInteractionId','enableEmailPreview','rows','show','params','fields','includeAll','include','find','create','body','describe','addMessage','MailMessage','ids','getMessages','YYYY-MM-DD\x20HH:mm:ss','addTags','setTags','spread','Tag','findAll','emit','mailInteractionTags:save','removeTags','download','unix','root','server','attachments','tmp','format','interaction-%s.zip','bcc','subject','Attachments','mkdirSync','each','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc'];(function(_0x276cc5,_0xcf0153){var _0x546b89=function(_0x132abc){while(--_0x132abc){_0x276cc5['push'](_0x276cc5['shift']());}};_0x546b89(++_0xcf0153);}(_0xbb59,0xec));var _0x9bb5=function(_0x570c2c,_0x34dda7){_0x570c2c=_0x570c2c-0x0;var _0x4a2e98=_0xbb59[_0x570c2c];return _0x4a2e98;};'use strict';var pdf=require(_0x9bb5('0x0'));var emlformat=require(_0x9bb5('0x1'));var rimraf=require(_0x9bb5('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x9bb5('0x3'));var moment=require(_0x9bb5('0x4'));var BPromise=require(_0x9bb5('0x5'));var Mustache=require(_0x9bb5('0x6'));var util=require(_0x9bb5('0x7'));var path=require('path');var sox=require(_0x9bb5('0x8'));var csv=require(_0x9bb5('0x9'));var ejs=require(_0x9bb5('0xa'));var fs=require('fs');var _=require(_0x9bb5('0xb'));var squel=require(_0x9bb5('0xc'));var crypto=require(_0x9bb5('0xd'));var jsforce=require(_0x9bb5('0xe'));var deskjs=require(_0x9bb5('0xf'));var toCsv=require(_0x9bb5('0x9'));var querystring=require(_0x9bb5('0x10'));var Papa=require(_0x9bb5('0x11'));var htmlToText=require(_0x9bb5('0x12'));var Redis=require(_0x9bb5('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x9bb5('0x14'));var as=require(_0x9bb5('0x15'));var hardwareService=require(_0x9bb5('0x16'));var logger=require(_0x9bb5('0x17'))(_0x9bb5('0x18'));var utils=require(_0x9bb5('0x19'));var config=require(_0x9bb5('0x1a'));var db=require(_0x9bb5('0x1b'))['db'];config[_0x9bb5('0x1c')]=_[_0x9bb5('0x1d')](config[_0x9bb5('0x1c')],{'host':_0x9bb5('0x1e'),'port':0x18eb});var socket=require(_0x9bb5('0x1f'))(new Redis(config[_0x9bb5('0x1c')]));require('./mailInteraction.socket')['register'](socket);function respondWithStatusCode(_0x10c6eb,_0x506ef8){_0x506ef8=_0x506ef8||0xcc;return function(_0x535e73){if(_0x535e73){return _0x10c6eb[_0x9bb5('0x20')](_0x506ef8);}return _0x10c6eb['status'](_0x506ef8)[_0x9bb5('0x21')]();};}function respondWithResult(_0x1ed006,_0x38d1c1){_0x38d1c1=_0x38d1c1||0xc8;return function(_0x5958dc){if(_0x5958dc){return _0x1ed006[_0x9bb5('0x22')](_0x38d1c1)[_0x9bb5('0x23')](_0x5958dc);}};}function respondWithFilteredResult(_0x3f3903,_0x1d5d9c){return function(_0xba8392){if(_0xba8392){var _0x19d1e9=_0xba8392['count'],_0x162815=_0x1d5d9c[_0x9bb5('0x24')],_0xe44bdd=_0x1d5d9c[_0x9bb5('0x24')]+_0x1d5d9c['limit'],_0x54e37e;if(_0xe44bdd>=_0x19d1e9){_0xe44bdd=_0x19d1e9;_0x54e37e=0xc8;}else{_0x54e37e=0xce;}_0x3f3903['status'](_0x54e37e);return _0x3f3903[_0x9bb5('0x25')](_0x9bb5('0x26'),_0x162815+'-'+_0xe44bdd+'/'+_0x19d1e9)[_0x9bb5('0x23')](_0xba8392);}return null;};}function patchUpdates(_0x5504bf){return function(_0xf4a683){try{jsonpatch[_0x9bb5('0x27')](_0xf4a683,_0x5504bf,!![]);}catch(_0x2a15b8){return BPromise[_0x9bb5('0x28')](_0x2a15b8);}return _0xf4a683['save']();};}function saveUpdates(_0xe1addf,_0x69eb1a){return function(_0x4a44e2){if(_0x4a44e2){return _0x4a44e2[_0x9bb5('0x29')](_0xe1addf)['then'](function(_0x2a1c7a){return _0x2a1c7a;});}return null;};}function removeEntity(_0x5357e9,_0x4be52b){return function(_0x1d7195){if(_0x1d7195){return _0x1d7195[_0x9bb5('0x2a')]()['then'](function(){_0x5357e9[_0x9bb5('0x22')](0xcc)[_0x9bb5('0x21')]();});}};}function handleEntityNotFound(_0x9c2724,_0x5cf6ef){return function(_0x54e0bd){if(!_0x54e0bd){_0x9c2724[_0x9bb5('0x20')](0x194);}return _0x54e0bd;};}function handleError(_0x2777d4,_0x785b2a){_0x785b2a=_0x785b2a||0x1f4;return function(_0x574e0d){logger[_0x9bb5('0x2b')](_0x574e0d[_0x9bb5('0x2c')]);if(_0x574e0d[_0x9bb5('0x2d')]){delete _0x574e0d['name'];}_0x2777d4['status'](_0x785b2a)['send'](_0x574e0d);};}function getInteractionUsers(_0x1ad67b,_0xb84c15){return new BPromise(function(_0xf24341,_0x470b92){try{if(_0xb84c15[_0x1ad67b['id']]){_0x1ad67b[_0x9bb5('0x2e')]=_['map'](_0xb84c15[_0x1ad67b['id']],function(_0x53866e){return{'id':_0x53866e['id']};});}}catch(_0x59ef00){_0x470b92(_0x59ef00);}_0xf24341(_0x1ad67b);});}function getInteractionTags(_0x18d6e4,_0xc6ba7f){return new BPromise(function(_0x266824,_0x5ccde7){try{if(_0x18d6e4['TagIds']){_0x18d6e4['Tags']=[];_0x18d6e4[_0x9bb5('0x2f')][_0x9bb5('0x30')](',')[_0x9bb5('0x31')](function(_0x546ac3){_0x18d6e4['Tags'][_0x9bb5('0x32')](_0xc6ba7f[_0x546ac3]);});}delete _0x18d6e4[_0x9bb5('0x2f')];}catch(_0x35e6d8){_0x5ccde7(_0x35e6d8);}_0x266824(_0x18d6e4);});}function getLastMessageText(_0x17707b){return new BPromise(function(_0x5534a5,_0x19feea){return db[_0x9bb5('0x33')][_0x9bb5('0x34')]({'where':{'id':_0x17707b['id']},'attributes':[_0x9bb5('0x35'),_0x9bb5('0x36')],'raw':!![]})[_0x9bb5('0x37')](function(_0x7d29fb){if(!_0x7d29fb['lastMsgText']){_0x17707b['lastMsgText']=_[_0x9bb5('0x38')](htmlToText[_0x9bb5('0x39')](_0x7d29fb['lastMsgBody'],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]}));}else{_0x17707b[_0x9bb5('0x36')]=_0x7d29fb['lastMsgText'];}_0x5534a5(_0x17707b);})[_0x9bb5('0x3a')](function(_0x2ed4d2){_0x19feea(_0x2ed4d2);});});}function updateMailInteraction(_0x58814f,_0x3df529,_0x13c42b,_0x4c9985){return new BPromise(function(_0x1682c0,_0x3f937e){return getInteractionUsers(_0x58814f,_0x13c42b)[_0x9bb5('0x37')](function(_0x496ceb){return getInteractionTags(_0x496ceb,_0x3df529);})['then'](function(_0x36da7e){if(_0x4c9985){_0x1682c0(getLastMessageText(_0x36da7e));}else{_0x1682c0(_0x36da7e);}})[_0x9bb5('0x3a')](function(_0x4af663){_0x3f937e(_0x4af663);});});}exports[_0x9bb5('0x3b')]=function(_0x7bcfb5,_0x1a3ee8){var _0x2a3dc8={},_0x24095f={},_0x58b6b3={'count':0x0,'rows':[]};var _0x5a3364=db[_0x9bb5('0x33')][_0x9bb5('0x3c')];_0x24095f[_0x9bb5('0x3d')]=_['keys'](_0x5a3364);_0x24095f[_0x9bb5('0x3e')]=_[_0x9bb5('0x3f')](_0x7bcfb5[_0x9bb5('0x3e')]);_0x24095f[_0x9bb5('0x40')]=_[_0x9bb5('0x41')](_0x24095f[_0x9bb5('0x3d')],_0x24095f['query']);_0x2a3dc8[_0x9bb5('0x42')]=_[_0x9bb5('0x41')](_0x24095f[_0x9bb5('0x3d')],qs['fields'](_0x7bcfb5['query']['fields']));_0x2a3dc8[_0x9bb5('0x42')]=_0x2a3dc8['attributes'][_0x9bb5('0x43')]?_0x2a3dc8[_0x9bb5('0x42')]:_0x24095f[_0x9bb5('0x3d')];if(!_0x7bcfb5[_0x9bb5('0x3e')]['hasOwnProperty'](_0x9bb5('0x44'))){_0x2a3dc8[_0x9bb5('0x45')]=qs['limit'](_0x7bcfb5[_0x9bb5('0x3e')]['limit']);_0x2a3dc8[_0x9bb5('0x24')]=qs[_0x9bb5('0x24')](_0x7bcfb5['query']['offset']);}_0x2a3dc8[_0x9bb5('0x46')]=qs['sort'](_0x7bcfb5[_0x9bb5('0x3e')][_0x9bb5('0x47')]);_0x2a3dc8[_0x9bb5('0x48')]=qs[_0x9bb5('0x40')](_[_0x9bb5('0x49')](_0x7bcfb5['query'],_0x24095f[_0x9bb5('0x40')]));var _0x590fbe=[];var _0x4e7a3a=squel[_0x9bb5('0x4a')]()[_0x9bb5('0x4b')]('id')[_0x9bb5('0x4b')](_0x9bb5('0x2d'))['field'](_0x9bb5('0x4c'))[_0x9bb5('0x4d')](_0x9bb5('0x4e'));var _0x338b4a=squel[_0x9bb5('0x4a')]()[_0x9bb5('0x4b')](_0x9bb5('0x4f'))[_0x9bb5('0x4b')]('ui.MailInteractionId')['from']('user_has_mail_interactions','ui')[_0x9bb5('0x50')](_0x9bb5('0x51'),'u',_0x9bb5('0x52'));var _0x59c3c3=squel[_0x9bb5('0x4a')]()['from'](_0x9bb5('0x53'),'i')['left_join'](_0x9bb5('0x54'),'c',_0x9bb5('0x55'))['left_join'](_0x9bb5('0x51'),'o',_0x9bb5('0x56'))[_0x9bb5('0x50')](_0x9bb5('0x57'),'a',_0x9bb5('0x58'))['left_join']('mail_messages','me',_0x9bb5('0x59'));var _0xb850af=squel[_0x9bb5('0x5a')]();var _0x3cde88=_0x7bcfb5[_0x9bb5('0x3e')][_0x9bb5('0x5b')]?JSON[_0x9bb5('0x5c')](_0x7bcfb5[_0x9bb5('0x3e')][_0x9bb5('0x5b')]):undefined;if(_0x3cde88){var _0x51878d=_0x3cde88[_0x9bb5('0x5d')]['substr'](0x1);_(_0x3cde88)[_0x9bb5('0x5e')](_0x9bb5('0x5d'))['omitBy'](function(_0x148dc6,_0x509a24){return _0x148dc6[_0x9bb5('0x5f')][_0x9bb5('0x60')]===!![];})[_0x9bb5('0x3f')]()['forEach'](function(_0x1d7d21){var _0xfaaa5b=_0x3cde88[_0x1d7d21];if(_0xfaaa5b[_0x9bb5('0x5f')][_0x9bb5('0x61')]){var _0x4dc8e4=squel[_0x9bb5('0x5a')]();if(as[_0x9bb5('0x62')](_0xfaaa5b['value'])){var _0x36459a=_['values'](_0xfaaa5b[_0x9bb5('0x63')])[0x0];_0x36459a[_0x9bb5('0x31')](function(_0x1dc6d3){_0xfaaa5b[_0x9bb5('0x5f')][_0x9bb5('0x61')]['forEach'](function(_0x5ceb64){_0x4dc8e4['or'](_0xfaaa5b['options']['table']+'.'+_0x5ceb64+'\x20'+as[_0x9bb5('0x64')](_0x1dc6d3),as[_0x9bb5('0x65')](_0x1dc6d3));});});}else{var _0x328451=as[_0x9bb5('0x66')](_0xfaaa5b[_0x9bb5('0x63')])?_0xfaaa5b[_0x9bb5('0x63')][0x1]:undefined;_0xfaaa5b[_0x9bb5('0x5f')][_0x9bb5('0x61')][_0x9bb5('0x31')](function(_0xb91dc){_0x4dc8e4['or'](_0xfaaa5b[_0x9bb5('0x5f')][_0x9bb5('0x67')]+'.'+_0xb91dc+'\x20'+as[_0x9bb5('0x64')](_0xfaaa5b[_0x9bb5('0x63')]),as['getConditionValue'](_0xfaaa5b[_0x9bb5('0x63')]),_0x328451);});}_0xb850af[_0x51878d](_0x4dc8e4);}else if(as['hasMultipleConditions'](_0xfaaa5b[_0x9bb5('0x63')])){var _0x36459a=_[_0x9bb5('0x68')](_0xfaaa5b[_0x9bb5('0x63')])[0x0];_0x36459a['forEach'](function(_0x7f1668){if(!_0xfaaa5b[_0x9bb5('0x5f')][_0x9bb5('0x69')]){var _0x2ec73e=as[_0x9bb5('0x66')](_0x7f1668)?_0x7f1668[_0x9bb5('0x6a')][0x1]:undefined;_0xb850af[_0x51878d](_0xfaaa5b[_0x9bb5('0x5f')][_0x9bb5('0x67')]+'.'+_0x1d7d21+'\x20'+as[_0x9bb5('0x64')](_0x7f1668),as[_0x9bb5('0x65')](_0x7f1668),_0x2ec73e);}});}else{if(_0xfaaa5b[_0x9bb5('0x5f')][_0x9bb5('0x69')]){var _0x228a47=as['getConditionValue'](_0xfaaa5b['value']);if(_0x228a47[_0x9bb5('0x43')]===0x1){if(_0x228a47==0x1){_0x59c3c3['having']('`'+_0x1d7d21+'`\x20=\x200');}else{_0x59c3c3[_0x9bb5('0x69')]('`'+_0x1d7d21+_0x9bb5('0x6b'));}}}else{var _0x328451=as[_0x9bb5('0x66')](_0xfaaa5b[_0x9bb5('0x63')])?_0xfaaa5b[_0x9bb5('0x63')]['$between'][0x1]:undefined;_0xb850af[_0x51878d](_0xfaaa5b['options'][_0x9bb5('0x67')]+'.'+_0x1d7d21+'\x20'+as[_0x9bb5('0x64')](_0xfaaa5b[_0x9bb5('0x63')]),as['getConditionValue'](_0xfaaa5b[_0x9bb5('0x63')]),_0x328451);}}});}else{var _0x1d3b57=_(Object[_0x9bb5('0x3f')](_0x7bcfb5['query']))[_0x9bb5('0x6c')](function(_0x5574f9){return _0x5a3364['hasOwnProperty'](_0x5574f9)?_0x5574f9:undefined;})[_0x9bb5('0x6d')](function(_0x5361ce){return!_[_0x9bb5('0x6e')](_0x5361ce);})['value']();if(!_[_0x9bb5('0x6f')](_0x1d3b57)){_0x1d3b57[_0x9bb5('0x31')](function(_0x50d930){if(_0x50d930===_0x9bb5('0x70')){_0x59c3c3[_0x9bb5('0x48')]('i.MailAccountId\x20IN\x20?',[]['concat'](_0x7bcfb5[_0x9bb5('0x3e')][_0x50d930]));}else if(_0x50d930===_0x9bb5('0x71')){var _0x16f81e=JSON[_0x9bb5('0x5c')](_0x7bcfb5[_0x9bb5('0x3e')][_0x50d930])[_0x9bb5('0x72')];var _0x202292=JSON[_0x9bb5('0x5c')](_0x7bcfb5['query'][_0x50d930])[_0x9bb5('0x73')];_0x59c3c3[_0x9bb5('0x48')](_0x9bb5('0x74'),_0x16f81e,_0x202292);}else{if(_0x7bcfb5[_0x9bb5('0x3e')][_0x50d930]==='null'){_0x59c3c3['where']('i.'+_0x50d930+_0x9bb5('0x75'));}else{_0x59c3c3['where']('i.'+_0x50d930+_0x9bb5('0x76'),_0x7bcfb5[_0x9bb5('0x3e')][_0x50d930]);}}});}if(_0x7bcfb5[_0x9bb5('0x3e')][_0x9bb5('0x77')]){if(_0x7bcfb5['query'][_0x9bb5('0x77')]==0x1){_0x59c3c3[_0x9bb5('0x69')](_0x9bb5('0x78'));}else{_0x59c3c3[_0x9bb5('0x69')](_0x9bb5('0x79'));}}if(_0x7bcfb5[_0x9bb5('0x3e')][_0x9bb5('0x6d')]){var _0x25b501=_0x7bcfb5['query']['filter'][_0x9bb5('0x7a')]('\x5c','\x5c\x5c')['replace']('\x27\x27',_0x9bb5('0x7b'));if(qs[_0x9bb5('0x7c')](_0x25b501)){_0xb850af['or'](_0x9bb5('0x7d'),_0x25b501+'%');}else if(qs['isEmail'](_0x25b501)){_0xb850af['or'](_0x9bb5('0x7e'),_0x25b501+'%');}else{var _0x4cc734=[];_0x25b501[_0x9bb5('0x30')]('\x20')[_0x9bb5('0x31')](function(_0x1b0313){_0x4cc734[_0x9bb5('0x32')]('+'+_0x1b0313[_0x9bb5('0x7f')]());});var _0x29600f=_0x4cc734[_0x9bb5('0x80')]('\x20');_0xb850af['or'](_0x9bb5('0x81'),_0x29600f)['or'](_0x9bb5('0x82'),_0x29600f);}}}_0x59c3c3['where'](_0xb850af);_0x59c3c3[_0x9bb5('0x83')]('i.id');_0x59c3c3[_0x9bb5('0x83')]('me.plainBody');var _0x138246={'type':db[_0x9bb5('0x84')]['QueryTypes'][_0x9bb5('0x85')],'raw':!![]};var _0x2f7be0=_0x59c3c3[_0x9bb5('0x86')]();_0x2f7be0[_0x9bb5('0x4b')](_0x9bb5('0x87'));_0x2f7be0[_0x9bb5('0x4b')](_0x9bb5('0x88'),_0x9bb5('0x89'));if(_0x2a3dc8[_0x9bb5('0x46')]){_0x2a3dc8[_0x9bb5('0x46')][_0x9bb5('0x31')](function(_0xc6d2d5){_0x59c3c3['order']('i.'+_0xc6d2d5[0x0],_0xc6d2d5[0x1]===_0x9bb5('0x8a')?![]:!![]);});}var _0x1cb558=[];var _0x508885=squel['expr']();if(!_0x3cde88){if(_0x7bcfb5[_0x9bb5('0x3e')][_0x9bb5('0x8b')]){_0x1cb558=_[_0x9bb5('0x8c')](_0x7bcfb5[_0x9bb5('0x3e')][_0x9bb5('0x8b')])?_0x7bcfb5[_0x9bb5('0x3e')][_0x9bb5('0x8b')]:new Array(_0x7bcfb5['query'][_0x9bb5('0x8b')]);_0x1cb558[_0x9bb5('0x31')](function(_0x58a497){_0x508885['or'](_0x9bb5('0x8d'),'%,'+_0x58a497+',%');});_0x59c3c3['having'](_0x508885);_0x2f7be0['left_join'](_0x9bb5('0x8e'),'it','it.MailInteractionId\x20=\x20i.id');_0x2f7be0[_0x9bb5('0x50')](_0x9bb5('0x4e'),'t',_0x9bb5('0x8f'));_0x2f7be0[_0x9bb5('0x48')]('t.id\x20IN\x20?',_0x1cb558);}}else{if(_0x3cde88[_0x9bb5('0x90')]('TagId')){if(as[_0x9bb5('0x62')](_0x3cde88[_0x9bb5('0x91')][_0x9bb5('0x63')])){var _0xe31494=_['values'](_0x3cde88['TagId'][_0x9bb5('0x63')])[0x0];_0xe31494[_0x9bb5('0x31')](function(_0x1a724c){as[_0x9bb5('0x65')](_0x1a724c)['forEach'](function(_0xc1e3d0){_0x1cb558[_0x9bb5('0x32')](_0xc1e3d0);});});}else{_0x1cb558=as[_0x9bb5('0x65')](_0x3cde88['TagId'][_0x9bb5('0x63')]);}_0x1cb558[_0x9bb5('0x31')](function(_0x63e6de){_0x508885['or'](_0x9bb5('0x8d'),'%,'+_0x63e6de+',%');});_0x59c3c3[_0x9bb5('0x69')](_0x508885);_0x2f7be0[_0x9bb5('0x50')]('mail_interaction_has_tags','it',_0x9bb5('0x92'));_0x2f7be0['left_join'](_0x9bb5('0x4e'),'t',_0x9bb5('0x8f'));_0x2f7be0[_0x9bb5('0x48')](_0x9bb5('0x93'),_0x1cb558);}}db['sequelize']['query'](_0x2f7be0[_0x9bb5('0x7f')](),_0x138246)['then'](function(_0x431377){_0x58b6b3['count']=_0x431377[_0x9bb5('0x43')];if(_0x58b6b3[_0x9bb5('0x94')]===0x0)return[];return db[_0x9bb5('0x95')]['query'](_0x4e7a3a[_0x9bb5('0x7f')](),_0x138246)[_0x9bb5('0x37')](function(_0x35e968){_0x590fbe=_['keyBy'](_0x35e968,'id');_0x138246=_[_0x9bb5('0x96')](_0x138246,{'model':db['MailInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});_0x59c3c3[_0x9bb5('0x4b')](_0x9bb5('0x88'),_0x9bb5('0x89'));_0x59c3c3[_0x9bb5('0x4b')](_0x9bb5('0x97'),'Account.key');_0x59c3c3[_0x9bb5('0x4b')](_0x9bb5('0x98'),_0x9bb5('0x99'));_0x59c3c3['field'](_0x9bb5('0x87'));_0x59c3c3['field'](_0x9bb5('0x9a'));_0x59c3c3[_0x9bb5('0x4b')](_0x9bb5('0x9b'));_0x59c3c3[_0x9bb5('0x4b')]('i.closed');_0x59c3c3[_0x9bb5('0x4b')](_0x9bb5('0x9c'));_0x59c3c3[_0x9bb5('0x4b')](_0x9bb5('0x9d'));_0x59c3c3[_0x9bb5('0x4b')](_0x9bb5('0x9e'));_0x59c3c3['field']('i.lastMsgDirection');_0x59c3c3[_0x9bb5('0x4b')]('i.subject');_0x59c3c3[_0x9bb5('0x4b')]('i.disposition');_0x59c3c3[_0x9bb5('0x4b')](_0x9bb5('0x9f'));_0x59c3c3[_0x9bb5('0x4b')](_0x9bb5('0xa0'));_0x59c3c3[_0x9bb5('0x4b')](_0x9bb5('0xa1'));_0x59c3c3[_0x9bb5('0x4b')](_0x9bb5('0xa2'));_0x59c3c3[_0x9bb5('0x4b')](_0x9bb5('0xa3'));_0x59c3c3['field'](_0x9bb5('0xa4'));_0x59c3c3[_0x9bb5('0x4b')](_0x9bb5('0xa5'),_0x9bb5('0xa6'));_0x59c3c3[_0x9bb5('0x4b')](_0x9bb5('0xa7'),_0x9bb5('0xa8'));_0x59c3c3[_0x9bb5('0x4b')](_0x9bb5('0xa9'),'Contact.email');_0x59c3c3[_0x9bb5('0x4b')]('c.phone',_0x9bb5('0xaa'));_0x59c3c3[_0x9bb5('0x4b')](_0x9bb5('0xab'),_0x9bb5('0xac'));_0x59c3c3[_0x9bb5('0x4b')](_0x9bb5('0xad'),_0x9bb5('0xae'));_0x59c3c3[_0x9bb5('0x4b')](_0x9bb5('0xaf'),_0x9bb5('0x2f'));_0x59c3c3[_0x9bb5('0x50')](_0x9bb5('0x8e'),'it','it.MailInteractionId\x20=\x20i.id');_0x59c3c3[_0x9bb5('0x50')]('tools_tags','t',_0x9bb5('0x8f'));_0x59c3c3[_0x9bb5('0x45')](_0x2a3dc8[_0x9bb5('0x45')]);_0x59c3c3[_0x9bb5('0x24')](_0x2a3dc8[_0x9bb5('0x24')]);return db['sequelize']['query'](_0x59c3c3[_0x9bb5('0x7f')](),_0x138246);})[_0x9bb5('0x37')](function(_0x3d2fe7){_0x338b4a[_0x9bb5('0x48')](_0x9bb5('0xb0'),_[_0x9bb5('0x6c')](_0x3d2fe7,'id'));return db[_0x9bb5('0x95')][_0x9bb5('0x3e')](_0x338b4a[_0x9bb5('0x7f')](),_0x138246)[_0x9bb5('0x37')](function(_0x3d845e){var _0x5bf71f=_['groupBy'](_0x3d845e,_0x9bb5('0xb1'));var _0x2d4e43=[];return db['Setting'][_0x9bb5('0x34')]({'attributes':[_0x9bb5('0xb2')],'raw':!![]})[_0x9bb5('0x37')](function(_0x560669){var _0xdc719f=_0x560669[_0x9bb5('0xb2')];_0x3d2fe7[_0x9bb5('0x31')](function(_0x23db73){_0x2d4e43[_0x9bb5('0x32')](updateMailInteraction(_0x23db73,_0x590fbe,_0x5bf71f,_0xdc719f));});return BPromise['all'](_0x2d4e43);});});});})[_0x9bb5('0x37')](function(_0x2165ff){_0x58b6b3[_0x9bb5('0xb3')]=_0x2165ff;return _0x58b6b3;})[_0x9bb5('0x37')](respondWithFilteredResult(_0x1a3ee8,_0x2a3dc8))[_0x9bb5('0x3a')](handleError(_0x1a3ee8,null));};exports[_0x9bb5('0xb4')]=function(_0x1aca09,_0xf247fd){var _0x2da8a0={'raw':![],'where':{'id':_0x1aca09[_0x9bb5('0xb5')]['id']}},_0x1b6002={};_0x1b6002['model']=_['keys'](db[_0x9bb5('0x33')][_0x9bb5('0x3c')]);_0x1b6002[_0x9bb5('0x3e')]=_[_0x9bb5('0x3f')](_0x1aca09[_0x9bb5('0x3e')]);_0x1b6002[_0x9bb5('0x40')]=_[_0x9bb5('0x41')](_0x1b6002[_0x9bb5('0x3d')],_0x1b6002[_0x9bb5('0x3e')]);_0x2da8a0[_0x9bb5('0x42')]=_['intersection'](_0x1b6002[_0x9bb5('0x3d')],qs[_0x9bb5('0xb6')](_0x1aca09[_0x9bb5('0x3e')]['fields']));_0x2da8a0[_0x9bb5('0x42')]=_0x2da8a0[_0x9bb5('0x42')][_0x9bb5('0x43')]?_0x2da8a0[_0x9bb5('0x42')]:_0x1b6002[_0x9bb5('0x3d')];if(_0x1aca09[_0x9bb5('0x3e')][_0x9bb5('0xb7')]){_0x2da8a0[_0x9bb5('0xb8')]=[{'all':!![]}];}_0x2da8a0=_[_0x9bb5('0x96')]({},_0x2da8a0,_0x1aca09[_0x9bb5('0x5f')]);return db[_0x9bb5('0x33')][_0x9bb5('0xb9')](_0x2da8a0)['then'](handleEntityNotFound(_0xf247fd,null))['then'](respondWithResult(_0xf247fd,null))[_0x9bb5('0x3a')](handleError(_0xf247fd,null));};exports[_0x9bb5('0xba')]=function(_0x111dce,_0x4af5c5){return db[_0x9bb5('0x33')][_0x9bb5('0xba')](_0x111dce['body'],{})['then'](respondWithResult(_0x4af5c5,0xc9))[_0x9bb5('0x3a')](handleError(_0x4af5c5,null));};exports[_0x9bb5('0x29')]=function(_0x55d917,_0x4a0138){if(_0x55d917['body']['id']){delete _0x55d917[_0x9bb5('0xbb')]['id'];}return db['MailInteraction'][_0x9bb5('0xb9')]({'where':{'id':_0x55d917['params']['id']}})['then'](handleEntityNotFound(_0x4a0138,null))[_0x9bb5('0x37')](saveUpdates(_0x55d917[_0x9bb5('0xbb')],null))['then'](respondWithResult(_0x4a0138,null))[_0x9bb5('0x3a')](handleError(_0x4a0138,null));};exports[_0x9bb5('0x2a')]=function(_0x1ef72c,_0x5577c6){return db[_0x9bb5('0x33')][_0x9bb5('0xb9')]({'where':{'id':_0x1ef72c[_0x9bb5('0xb5')]['id']}})[_0x9bb5('0x37')](handleEntityNotFound(_0x5577c6,null))[_0x9bb5('0x37')](removeEntity(_0x5577c6,null))['catch'](handleError(_0x5577c6,null));};exports[_0x9bb5('0xbc')]=function(_0x5b739e,_0xaff36c){return db[_0x9bb5('0x33')]['describe']()[_0x9bb5('0x37')](respondWithResult(_0xaff36c,null))['catch'](handleError(_0xaff36c,null));};exports[_0x9bb5('0xbd')]=function(_0x51bc0d,_0x441433,_0x2aa694){return db[_0x9bb5('0xbe')]['find']({'where':{'id':_0x51bc0d[_0x9bb5('0xb5')]['id']}})[_0x9bb5('0x37')](handleEntityNotFound(_0x441433,null))[_0x9bb5('0x37')](function(_0x3a5678){if(_0x3a5678){return _0x3a5678[_0x9bb5('0xbd')](_0x51bc0d['body'][_0x9bb5('0xbf')],_[_0x9bb5('0x5e')](_0x51bc0d['body'],[_0x9bb5('0xbf'),'id'])||{});}})[_0x9bb5('0x37')](respondWithResult(_0x441433,null))[_0x9bb5('0x3a')](handleError(_0x441433,null));};exports[_0x9bb5('0xc0')]=function(_0x5a0066,_0x3d4c7e,_0x56206b){var _0x18c064={'raw':![],'where':{}};var _0x104a62={};var _0x1fccc8={'count':0x0,'rows':[]};return db[_0x9bb5('0x33')]['findOne']({'where':{'id':_0x5a0066[_0x9bb5('0xb5')]['id']}})[_0x9bb5('0x37')](handleEntityNotFound(_0x3d4c7e,null))[_0x9bb5('0x37')](function(_0x3c25b7){if(_0x3c25b7){_0x104a62['model']=_['keys'](db['MailMessage']['rawAttributes']);_0x104a62['query']=_[_0x9bb5('0x3f')](_0x5a0066['query']);_0x104a62['filters']=_[_0x9bb5('0x41')](_0x104a62[_0x9bb5('0x3d')],_0x104a62['query']);_0x18c064[_0x9bb5('0x42')]=_[_0x9bb5('0x41')](_0x104a62[_0x9bb5('0x3d')],qs[_0x9bb5('0xb6')](_0x5a0066[_0x9bb5('0x3e')][_0x9bb5('0xb6')]));_0x18c064[_0x9bb5('0x42')]=_0x18c064[_0x9bb5('0x42')][_0x9bb5('0x43')]?_0x18c064[_0x9bb5('0x42')]:_0x104a62['model'];if(!_0x5a0066['query'][_0x9bb5('0x90')](_0x9bb5('0x44'))){_0x18c064[_0x9bb5('0x45')]=qs[_0x9bb5('0x45')](_0x5a0066[_0x9bb5('0x3e')]['limit']);_0x18c064[_0x9bb5('0x24')]=qs[_0x9bb5('0x24')](_0x5a0066[_0x9bb5('0x3e')]['offset']);}_0x18c064['order']=qs[_0x9bb5('0x47')](_0x5a0066[_0x9bb5('0x3e')][_0x9bb5('0x47')]);_0x18c064[_0x9bb5('0x48')]=qs[_0x9bb5('0x40')](_[_0x9bb5('0x49')](_0x5a0066[_0x9bb5('0x3e')],_0x104a62[_0x9bb5('0x40')]));_0x18c064[_0x9bb5('0x48')]['MailInteractionId']=_0x3c25b7['id'];if(_0x5a0066[_0x9bb5('0x3e')][_0x9bb5('0x6d')]){_0x18c064[_0x9bb5('0x48')]=_['merge'](_0x18c064[_0x9bb5('0x48')],{'$or':_[_0x9bb5('0x6c')](_0x18c064[_0x9bb5('0x42')],function(_0x51a8ea){var _0xd8a717={};_0xd8a717[_0x51a8ea]={'$like':'%'+_0x5a0066[_0x9bb5('0x3e')][_0x9bb5('0x6d')]+'%'};return _0xd8a717;})});}if(_0x5a0066[_0x9bb5('0x3e')][_0x9bb5('0x72')]){var _0x3c3bd0=_0x5a0066[_0x9bb5('0x3e')][_0x9bb5('0x72')]['split'](',');var _0x1ab3c7={};_0x1ab3c7[_0x3c3bd0[0x0]]={'$gte':moment(_0x3c3bd0[0x1])['format'](_0x9bb5('0xc1'))};_0x18c064[_0x9bb5('0x48')]=_['merge'](_0x18c064[_0x9bb5('0x48')],_0x1ab3c7);}_0x18c064=_[_0x9bb5('0x96')]({},_0x18c064,_0x5a0066['options']);return db[_0x9bb5('0xbe')]['count']({'where':_0x18c064[_0x9bb5('0x48')]})[_0x9bb5('0x37')](function(_0x36cdbc){_0x1fccc8[_0x9bb5('0x94')]=_0x36cdbc;if(_0x5a0066[_0x9bb5('0x3e')][_0x9bb5('0xb7')]){_0x18c064[_0x9bb5('0xb8')]=[{'all':!![]}];}return db[_0x9bb5('0xbe')]['findAll'](_0x18c064);})['then'](function(_0x3867fd){_0x1fccc8[_0x9bb5('0xb3')]=_0x3867fd;return _0x1fccc8;});}})[_0x9bb5('0x37')](respondWithFilteredResult(_0x3d4c7e,_0x18c064))[_0x9bb5('0x3a')](handleError(_0x3d4c7e,null));};exports[_0x9bb5('0xc2')]=function(_0x464eb1,_0x398f1b,_0x159799){return db[_0x9bb5('0x33')]['find']({'where':{'id':_0x464eb1[_0x9bb5('0xb5')]['id']}})[_0x9bb5('0x37')](handleEntityNotFound(_0x398f1b,null))[_0x9bb5('0x37')](function(_0x213325){if(_0x213325){return _0x213325[_0x9bb5('0xc3')](_0x464eb1[_0x9bb5('0xbb')][_0x9bb5('0xbf')],_['omit'](_0x464eb1[_0x9bb5('0xbb')],[_0x9bb5('0xbf'),'id'])||{})[_0x9bb5('0xc4')](function(){return db[_0x9bb5('0xc5')][_0x9bb5('0xc6')]({'attributes':['id',_0x9bb5('0x2d'),'color'],'where':{'id':_0x464eb1[_0x9bb5('0xbb')][_0x9bb5('0xbf')]}});})[_0x9bb5('0x37')](function(_0x15b078){socket[_0x9bb5('0xc7')](_0x9bb5('0xc8'),{'id':Number(_0x464eb1['params']['id']),'tags':_0x15b078||[]});return{'id':Number(_0x464eb1[_0x9bb5('0xb5')]['id']),'tags':_0x15b078||[]};});}})[_0x9bb5('0x37')](respondWithResult(_0x398f1b,null))[_0x9bb5('0x3a')](handleError(_0x398f1b,null));};exports['removeTags']=function(_0x9fbfcc,_0x153c7b,_0x44f12d){return db[_0x9bb5('0x33')][_0x9bb5('0xb9')]({'where':{'id':_0x9fbfcc[_0x9bb5('0xb5')]['id']}})[_0x9bb5('0x37')](handleEntityNotFound(_0x153c7b,null))[_0x9bb5('0x37')](function(_0x1a12c8){if(_0x1a12c8){return _0x1a12c8[_0x9bb5('0xc9')](_0x9fbfcc[_0x9bb5('0x3e')]['ids']);}})[_0x9bb5('0x37')](respondWithStatusCode(_0x153c7b,null))[_0x9bb5('0x3a')](handleError(_0x153c7b,null));};exports[_0x9bb5('0xca')]=function(_0x199fb2,_0x37272a){var _0x2118cc=moment()[_0x9bb5('0xcb')]()[_0x9bb5('0x7f')]();var _0x97da7b=path[_0x9bb5('0x80')](config[_0x9bb5('0xcc')],_0x9bb5('0xcd'),'files',_0x9bb5('0xce'));var _0x4363f3=path['join'](config[_0x9bb5('0xcc')],_0x9bb5('0xcd'),'files',_0x9bb5('0xcf'));var _0xa2afdf=path['join'](_0x4363f3,_0x2118cc);var _0xf08279=util[_0x9bb5('0xd0')](_0x9bb5('0xd1'),_0x2118cc);var _0x26b480=path[_0x9bb5('0x80')](_0x4363f3,_0xf08279);var _0x3f5aee=![];return db[_0x9bb5('0x33')][_0x9bb5('0xb9')]({'where':{'id':_0x199fb2[_0x9bb5('0xb5')]['id']}})[_0x9bb5('0x37')](handleEntityNotFound(_0x37272a,null))[_0x9bb5('0x37')](function(_0x2c6caa){if(_0x2c6caa){return _0x2c6caa[_0x9bb5('0xc0')]({'attributes':['id',_0x9bb5('0xbb'),_0x9bb5('0x4d'),'to','cc',_0x9bb5('0xd2'),_0x9bb5('0xd3'),_0x9bb5('0x71')],'where':{'secret':![]},'include':_0x199fb2[_0x9bb5('0x3e')][_0x9bb5('0xce')]?[{'model':db['Attachment'],'as':_0x9bb5('0xd4')}]:undefined,'order':qs[_0x9bb5('0x47')]('id')});}return[];})[_0x9bb5('0x37')](function(_0x498076){_0x3f5aee=_0x498076[_0x9bb5('0x43')];if(_0x498076[_0x9bb5('0x43')]){fs[_0x9bb5('0xd5')](_0xa2afdf);return BPromise[_0x9bb5('0xd6')](_0x498076,function(_0x1996fc,_0x26a54c){var _0x1acf16=_0x1996fc;var _0x3b46af={'from':_0x1acf16['from'],'to':_0x1acf16['to'],'subject':_0x1acf16['subject'],'html':_0x1acf16[_0x9bb5('0xbb')],'headers':{'Date':moment(_0x1acf16[_0x9bb5('0x71')])[_0x9bb5('0xd0')](_0x9bb5('0xd7'))},'attachments':[]};if(_0x1996fc['cc']){_0x3b46af['headers']['Cc']=_0x1996fc['cc'];}if(_0x1996fc[_0x9bb5('0xd2')]){_0x3b46af[_0x9bb5('0xd8')][_0x9bb5('0xd9')]=_0x1996fc['bcc'];}return new BPromise(function(_0x4aab8f,_0x39d096){if(_0x1996fc[_0x9bb5('0xd4')]){for(var _0x40347b=0x0;_0x40347b<_0x1996fc[_0x9bb5('0xd4')][_0x9bb5('0x43')];_0x40347b++){var _0x59285c=_0x1996fc[_0x9bb5('0xd4')][_0x40347b];var _0x43493c=path[_0x9bb5('0x80')](_0x97da7b,_0x59285c[_0x9bb5('0xda')]);if(fs['existsSync'](_0x43493c)){_0x3b46af[_0x9bb5('0xce')][_0x9bb5('0x32')]({'name':_0x59285c[_0x9bb5('0x2d')],'contentType':_0x59285c[_0x9bb5('0xdb')],'data':fs[_0x9bb5('0xdc')](_0x43493c)});}}}emlformat[_0x9bb5('0xdd')](_0x3b46af,function(_0x508e5c,_0x25efe9){if(_0x508e5c)return _0x39d096(_0x508e5c);fs[_0x9bb5('0xde')](path[_0x9bb5('0x80')](_0xa2afdf,util[_0x9bb5('0xd0')](_0x9bb5('0xdf'),_0x26a54c)),_0x25efe9);return _0x4aab8f(_0x25efe9);});});});}})['then'](function(){if(_0x3f5aee){return new BPromise(function(_0x713d3a,_0x1198eb){zipdir(_0xa2afdf,{'saveTo':_0x26b480},function(_0x2d128c,_0x5df713){if(_0x2d128c)return _0x1198eb(_0x2d128c);return _0x713d3a(_0x5df713);});});}})[_0x9bb5('0x37')](function(){if(_0x3f5aee){return new BPromise(function(_0x2e54c2,_0x51fc1a){rimraf(_0xa2afdf,function(_0x51bf2b){if(_0x51bf2b)_0x51fc1a(_0x51bf2b);return _0x2e54c2();});});}})[_0x9bb5('0x37')](function(){if(_0x3f5aee){return _0x37272a[_0x9bb5('0xca')](_0x26b480,_0xf08279,function(_0x50b387){if(_0x50b387){console[_0x9bb5('0xe0')](_0x9bb5('0xe1'),_0x50b387);}else{fs[_0x9bb5('0xe2')](_0x26b480);}});}else{return _0x37272a[_0x9bb5('0x20')](0xc8);}})['catch'](handleError(_0x37272a,null));}; \ No newline at end of file +var _0x1daf=['length','hasOwnProperty','nolimit','order','sort','where','pick','field','color','u.id','ui.MailInteractionId','user_has_mail_interactions','left_join','users','u.id\x20=\x20ui.UserId','select','from','mail_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','mail_accounts','a.id\x20=\x20i.MailAccountId','mail_messages','me.MailInteractionId\x20=\x20i.id','expr','advancedFilter','parse','matchType','substr','omit','options','custom','keys','forEach','columns','value','table','parseOperator','getConditionValue','hasMultipleConditions','values','having','isRangeCondition','$between','`\x20=\x200','filter','isNil','isEmpty','MailAccountId','i.MailAccountId\x20IN\x20?','concat','createdAt','$lte','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','replace','\x27\x27\x27\x27','isNumeric','isEmail','c.email\x20LIKE\x20?','toString','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','QueryTypes','SELECT','i.id','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','DESC','tag','isArray','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','mail_interaction_has_tags','tools_tags','t.id\x20=\x20it.TagId','t.id\x20IN\x20?','TagId','it.MailInteractionId\x20=\x20i.id','sequelize','merge','a.key','Account.key','a.mandatoryDisposition','i.updatedAt','i.closed','i.lastMsgAt','i.subject','i.disposition','i.ContactId','i.MailAccountId','i.UserId','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','c.fax','GROUP_CONCAT(DISTINCT\x20t.id)','groupBy','MailInteractionId','Setting','enableEmailPreview','rows','includeAll','find','create','body','params','describe','addMessage','ids','getMessages','MailMessage','$gte','format','include','findAll','addTags','setTags','spread','Tag','emit','mailInteractionTags:save','removeTags','unix','join','root','server','attachments','files','interaction-%s.zip','subject','Attachment','Attachments','mkdirSync','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','bcc','basename','existsSync','type','build','writeFileSync','message%d.eml','err','unlinkSync','html-pdf','eml-format','rimraf','zip-dir','moment','mustache','util','path','to-csv','ejs','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','socket.io-emitter','./mailInteraction.socket','sendStatus','status','json','count','offset','limit','set','Content-Range','reject','save','update','destroy','then','error','stack','name','map','TagIds','Tags','split','push','MailInteraction','findOne','lastMsgText','trimStart','fromString','lastMsgBody','catch','index','rawAttributes','model','query','filters','intersection','fields','attributes'];(function(_0x4cde6b,_0xb52b39){var _0x294346=function(_0x2625bb){while(--_0x2625bb){_0x4cde6b['push'](_0x4cde6b['shift']());}};_0x294346(++_0xb52b39);}(_0x1daf,0x97));var _0xf1da=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x1daf[_0x2dafbe];return _0x58a45a;};'use strict';var pdf=require(_0xf1da('0x0'));var emlformat=require(_0xf1da('0x1'));var rimraf=require(_0xf1da('0x2'));var zipdir=require(_0xf1da('0x3'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xf1da('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xf1da('0x5'));var util=require(_0xf1da('0x6'));var path=require(_0xf1da('0x7'));var sox=require('sox');var csv=require(_0xf1da('0x8'));var ejs=require(_0xf1da('0x9'));var fs=require('fs');var _=require(_0xf1da('0xa'));var squel=require('squel');var crypto=require(_0xf1da('0xb'));var jsforce=require(_0xf1da('0xc'));var deskjs=require(_0xf1da('0xd'));var toCsv=require(_0xf1da('0x8'));var querystring=require('querystring');var Papa=require(_0xf1da('0xe'));var htmlToText=require('html-to-text');var Redis=require(_0xf1da('0xf'));var authService=require(_0xf1da('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xf1da('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf1da('0x12'))('api');var utils=require(_0xf1da('0x13'));var config=require(_0xf1da('0x14'));var db=require(_0xf1da('0x15'))['db'];config['redis']=_['defaults'](config[_0xf1da('0x16')],{'host':'localhost','port':0x18eb});var socket=require(_0xf1da('0x17'))(new Redis(config[_0xf1da('0x16')]));require(_0xf1da('0x18'))['register'](socket);function respondWithStatusCode(_0x49d26a,_0x345490){_0x345490=_0x345490||0xcc;return function(_0x1ff81e){if(_0x1ff81e){return _0x49d26a[_0xf1da('0x19')](_0x345490);}return _0x49d26a[_0xf1da('0x1a')](_0x345490)['end']();};}function respondWithResult(_0x21f6a2,_0x29ab7e){_0x29ab7e=_0x29ab7e||0xc8;return function(_0xea0d26){if(_0xea0d26){return _0x21f6a2[_0xf1da('0x1a')](_0x29ab7e)[_0xf1da('0x1b')](_0xea0d26);}};}function respondWithFilteredResult(_0x41e8ca,_0x3f5946){return function(_0x53d2d0){if(_0x53d2d0){var _0x143734=_0x53d2d0[_0xf1da('0x1c')],_0xe38800=_0x3f5946[_0xf1da('0x1d')],_0x143198=_0x3f5946[_0xf1da('0x1d')]+_0x3f5946[_0xf1da('0x1e')],_0x14e691;if(_0x143198>=_0x143734){_0x143198=_0x143734;_0x14e691=0xc8;}else{_0x14e691=0xce;}_0x41e8ca['status'](_0x14e691);return _0x41e8ca[_0xf1da('0x1f')](_0xf1da('0x20'),_0xe38800+'-'+_0x143198+'/'+_0x143734)[_0xf1da('0x1b')](_0x53d2d0);}return null;};}function patchUpdates(_0x1a537b){return function(_0x45f3c7){try{jsonpatch['apply'](_0x45f3c7,_0x1a537b,!![]);}catch(_0x5317b7){return BPromise[_0xf1da('0x21')](_0x5317b7);}return _0x45f3c7[_0xf1da('0x22')]();};}function saveUpdates(_0x4ea74,_0x4570e6){return function(_0x52cd32){if(_0x52cd32){return _0x52cd32[_0xf1da('0x23')](_0x4ea74)['then'](function(_0x20daad){return _0x20daad;});}return null;};}function removeEntity(_0x144fcc,_0x144dfd){return function(_0x4752ac){if(_0x4752ac){return _0x4752ac[_0xf1da('0x24')]()[_0xf1da('0x25')](function(){_0x144fcc['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xa79534,_0x14e4be){return function(_0x12d522){if(!_0x12d522){_0xa79534['sendStatus'](0x194);}return _0x12d522;};}function handleError(_0x8db702,_0x6ba87d){_0x6ba87d=_0x6ba87d||0x1f4;return function(_0x2a4892){logger[_0xf1da('0x26')](_0x2a4892[_0xf1da('0x27')]);if(_0x2a4892[_0xf1da('0x28')]){delete _0x2a4892['name'];}_0x8db702['status'](_0x6ba87d)['send'](_0x2a4892);};}function getInteractionUsers(_0x2acecd,_0x3ee056){return new BPromise(function(_0x38db77,_0xdc88bd){try{if(_0x3ee056[_0x2acecd['id']]){_0x2acecd['Users']=_[_0xf1da('0x29')](_0x3ee056[_0x2acecd['id']],function(_0x592c6b){return{'id':_0x592c6b['id']};});}}catch(_0x3f07f2){_0xdc88bd(_0x3f07f2);}_0x38db77(_0x2acecd);});}function getInteractionTags(_0x558029,_0x1c1375){return new BPromise(function(_0xb0452d,_0x716b6d){try{if(_0x558029[_0xf1da('0x2a')]){_0x558029[_0xf1da('0x2b')]=[];_0x558029['TagIds'][_0xf1da('0x2c')](',')['forEach'](function(_0x2fd8b7){_0x558029[_0xf1da('0x2b')][_0xf1da('0x2d')](_0x1c1375[_0x2fd8b7]);});}delete _0x558029[_0xf1da('0x2a')];}catch(_0x471c56){_0x716b6d(_0x471c56);}_0xb0452d(_0x558029);});}function getLastMessageText(_0x4af658){return new BPromise(function(_0x51cf02,_0x326a73){return db[_0xf1da('0x2e')][_0xf1da('0x2f')]({'where':{'id':_0x4af658['id']},'attributes':['lastMsgBody','lastMsgText'],'raw':!![]})[_0xf1da('0x25')](function(_0x55f73b){if(!_0x55f73b[_0xf1da('0x30')]){_0x4af658['lastMsgText']=_[_0xf1da('0x31')](htmlToText[_0xf1da('0x32')](_0x55f73b[_0xf1da('0x33')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]}));}else{_0x4af658['lastMsgText']=_0x55f73b[_0xf1da('0x30')];}_0x51cf02(_0x4af658);})[_0xf1da('0x34')](function(_0x3239d9){_0x326a73(_0x3239d9);});});}function updateMailInteraction(_0x3f38b1,_0x4bc2af,_0x320ef8,_0x4620ef){return new BPromise(function(_0x14082d,_0x1d3d21){return getInteractionUsers(_0x3f38b1,_0x320ef8)[_0xf1da('0x25')](function(_0x37d0f0){return getInteractionTags(_0x37d0f0,_0x4bc2af);})[_0xf1da('0x25')](function(_0x4fb9f1){if(_0x4620ef){_0x14082d(getLastMessageText(_0x4fb9f1));}else{_0x14082d(_0x4fb9f1);}})[_0xf1da('0x34')](function(_0x19faed){_0x1d3d21(_0x19faed);});});}exports[_0xf1da('0x35')]=function(_0xc6a654,_0x3f94f0){var _0x8e99c4={},_0x3c08dd={},_0x1554b0={'count':0x0,'rows':[]};var _0x4996fc=db[_0xf1da('0x2e')][_0xf1da('0x36')];_0x3c08dd[_0xf1da('0x37')]=_['keys'](_0x4996fc);_0x3c08dd[_0xf1da('0x38')]=_['keys'](_0xc6a654[_0xf1da('0x38')]);_0x3c08dd[_0xf1da('0x39')]=_['intersection'](_0x3c08dd[_0xf1da('0x37')],_0x3c08dd[_0xf1da('0x38')]);_0x8e99c4['attributes']=_[_0xf1da('0x3a')](_0x3c08dd['model'],qs[_0xf1da('0x3b')](_0xc6a654[_0xf1da('0x38')][_0xf1da('0x3b')]));_0x8e99c4[_0xf1da('0x3c')]=_0x8e99c4[_0xf1da('0x3c')][_0xf1da('0x3d')]?_0x8e99c4[_0xf1da('0x3c')]:_0x3c08dd[_0xf1da('0x37')];if(!_0xc6a654[_0xf1da('0x38')][_0xf1da('0x3e')](_0xf1da('0x3f'))){_0x8e99c4['limit']=qs[_0xf1da('0x1e')](_0xc6a654[_0xf1da('0x38')][_0xf1da('0x1e')]);_0x8e99c4[_0xf1da('0x1d')]=qs[_0xf1da('0x1d')](_0xc6a654['query'][_0xf1da('0x1d')]);}_0x8e99c4[_0xf1da('0x40')]=qs[_0xf1da('0x41')](_0xc6a654[_0xf1da('0x38')][_0xf1da('0x41')]);_0x8e99c4[_0xf1da('0x42')]=qs['filters'](_[_0xf1da('0x43')](_0xc6a654[_0xf1da('0x38')],_0x3c08dd['filters']));var _0x358eb5=[];var _0x59e3d6=squel['select']()[_0xf1da('0x44')]('id')['field'](_0xf1da('0x28'))[_0xf1da('0x44')](_0xf1da('0x45'))['from']('tools_tags');var _0x5af99c=squel['select']()[_0xf1da('0x44')](_0xf1da('0x46'))[_0xf1da('0x44')](_0xf1da('0x47'))['from'](_0xf1da('0x48'),'ui')[_0xf1da('0x49')](_0xf1da('0x4a'),'u',_0xf1da('0x4b'));var _0x1a7c1d=squel[_0xf1da('0x4c')]()[_0xf1da('0x4d')](_0xf1da('0x4e'),'i')[_0xf1da('0x49')](_0xf1da('0x4f'),'c',_0xf1da('0x50'))[_0xf1da('0x49')](_0xf1da('0x4a'),'o',_0xf1da('0x51'))[_0xf1da('0x49')](_0xf1da('0x52'),'a',_0xf1da('0x53'))[_0xf1da('0x49')](_0xf1da('0x54'),'me',_0xf1da('0x55'));var _0x1e4168=squel[_0xf1da('0x56')]();var _0x2e3c9b=_0xc6a654[_0xf1da('0x38')][_0xf1da('0x57')]?JSON[_0xf1da('0x58')](_0xc6a654[_0xf1da('0x38')][_0xf1da('0x57')]):undefined;if(_0x2e3c9b){var _0x5b4026=_0x2e3c9b[_0xf1da('0x59')][_0xf1da('0x5a')](0x1);_(_0x2e3c9b)[_0xf1da('0x5b')](_0xf1da('0x59'))['omitBy'](function(_0x51e922,_0x53ab87){return _0x51e922[_0xf1da('0x5c')][_0xf1da('0x5d')]===!![];})[_0xf1da('0x5e')]()[_0xf1da('0x5f')](function(_0x45c1b6){var _0x10de66=_0x2e3c9b[_0x45c1b6];if(_0x10de66[_0xf1da('0x5c')][_0xf1da('0x60')]){var _0x27db60=squel[_0xf1da('0x56')]();if(as['hasMultipleConditions'](_0x10de66[_0xf1da('0x61')])){var _0x3a3f99=_['values'](_0x10de66[_0xf1da('0x61')])[0x0];_0x3a3f99[_0xf1da('0x5f')](function(_0x29e31c){_0x10de66['options'][_0xf1da('0x60')]['forEach'](function(_0x6e50a3){_0x27db60['or'](_0x10de66[_0xf1da('0x5c')][_0xf1da('0x62')]+'.'+_0x6e50a3+'\x20'+as[_0xf1da('0x63')](_0x29e31c),as[_0xf1da('0x64')](_0x29e31c));});});}else{var _0x1db05e=as['isRangeCondition'](_0x10de66[_0xf1da('0x61')])?_0x10de66[_0xf1da('0x61')][0x1]:undefined;_0x10de66[_0xf1da('0x5c')][_0xf1da('0x60')][_0xf1da('0x5f')](function(_0x5032cc){_0x27db60['or'](_0x10de66[_0xf1da('0x5c')][_0xf1da('0x62')]+'.'+_0x5032cc+'\x20'+as[_0xf1da('0x63')](_0x10de66[_0xf1da('0x61')]),as[_0xf1da('0x64')](_0x10de66['value']),_0x1db05e);});}_0x1e4168[_0x5b4026](_0x27db60);}else if(as[_0xf1da('0x65')](_0x10de66[_0xf1da('0x61')])){var _0x3a3f99=_[_0xf1da('0x66')](_0x10de66[_0xf1da('0x61')])[0x0];_0x3a3f99['forEach'](function(_0x161bb8){if(!_0x10de66[_0xf1da('0x5c')][_0xf1da('0x67')]){var _0x26d851=as[_0xf1da('0x68')](_0x161bb8)?_0x161bb8[_0xf1da('0x69')][0x1]:undefined;_0x1e4168[_0x5b4026](_0x10de66[_0xf1da('0x5c')][_0xf1da('0x62')]+'.'+_0x45c1b6+'\x20'+as[_0xf1da('0x63')](_0x161bb8),as[_0xf1da('0x64')](_0x161bb8),_0x26d851);}});}else{if(_0x10de66['options'][_0xf1da('0x67')]){var _0x5062ef=as[_0xf1da('0x64')](_0x10de66[_0xf1da('0x61')]);if(_0x5062ef[_0xf1da('0x3d')]===0x1){if(_0x5062ef==0x1){_0x1a7c1d[_0xf1da('0x67')]('`'+_0x45c1b6+_0xf1da('0x6a'));}else{_0x1a7c1d['having']('`'+_0x45c1b6+'`\x20>\x200');}}}else{var _0x1db05e=as[_0xf1da('0x68')](_0x10de66[_0xf1da('0x61')])?_0x10de66[_0xf1da('0x61')][_0xf1da('0x69')][0x1]:undefined;_0x1e4168[_0x5b4026](_0x10de66[_0xf1da('0x5c')][_0xf1da('0x62')]+'.'+_0x45c1b6+'\x20'+as['parseOperator'](_0x10de66[_0xf1da('0x61')]),as['getConditionValue'](_0x10de66[_0xf1da('0x61')]),_0x1db05e);}}});}else{var _0x59f746=_(Object[_0xf1da('0x5e')](_0xc6a654[_0xf1da('0x38')]))['map'](function(_0x584ab8){return _0x4996fc['hasOwnProperty'](_0x584ab8)?_0x584ab8:undefined;})[_0xf1da('0x6b')](function(_0x123cf2){return!_[_0xf1da('0x6c')](_0x123cf2);})[_0xf1da('0x61')]();if(!_[_0xf1da('0x6d')](_0x59f746)){_0x59f746[_0xf1da('0x5f')](function(_0x478fd1){if(_0x478fd1===_0xf1da('0x6e')){_0x1a7c1d[_0xf1da('0x42')](_0xf1da('0x6f'),[][_0xf1da('0x70')](_0xc6a654[_0xf1da('0x38')][_0x478fd1]));}else if(_0x478fd1===_0xf1da('0x71')){var _0x39bee7=JSON[_0xf1da('0x58')](_0xc6a654['query'][_0x478fd1])['$gte'];var _0x426de7=JSON[_0xf1da('0x58')](_0xc6a654[_0xf1da('0x38')][_0x478fd1])[_0xf1da('0x72')];_0x1a7c1d[_0xf1da('0x42')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x39bee7,_0x426de7);}else{if(_0xc6a654['query'][_0x478fd1]==='null'){_0x1a7c1d['where']('i.'+_0x478fd1+_0xf1da('0x73'));}else{_0x1a7c1d[_0xf1da('0x42')]('i.'+_0x478fd1+_0xf1da('0x74'),_0xc6a654[_0xf1da('0x38')][_0x478fd1]);}}});}if(_0xc6a654[_0xf1da('0x38')][_0xf1da('0x75')]){if(_0xc6a654[_0xf1da('0x38')]['read']==0x1){_0x1a7c1d[_0xf1da('0x67')](_0xf1da('0x76'));}else{_0x1a7c1d['having']('`unreadMessages`\x20>\x200');}}if(_0xc6a654['query'][_0xf1da('0x6b')]){var _0x3aad40=_0xc6a654[_0xf1da('0x38')][_0xf1da('0x6b')]['replace']('\x5c','\x5c\x5c')[_0xf1da('0x77')]('\x27\x27',_0xf1da('0x78'));if(qs[_0xf1da('0x79')](_0x3aad40)){_0x1e4168['or']('i.id\x20LIKE\x20?',_0x3aad40+'%');}else if(qs[_0xf1da('0x7a')](_0x3aad40)){_0x1e4168['or'](_0xf1da('0x7b'),_0x3aad40+'%');}else{var _0x38c9fc=[];_0x3aad40[_0xf1da('0x2c')]('\x20')[_0xf1da('0x5f')](function(_0x57e23a){_0x38c9fc[_0xf1da('0x2d')]('+'+_0x57e23a[_0xf1da('0x7c')]());});var _0xf9a2af=_0x38c9fc['join']('\x20');_0x1e4168['or'](_0xf1da('0x7d'),_0xf9a2af)['or'](_0xf1da('0x7e'),_0xf9a2af);}}}_0x1a7c1d[_0xf1da('0x42')](_0x1e4168);_0x1a7c1d['group']('i.id');var _0x4ea516={'type':db['Sequelize'][_0xf1da('0x7f')][_0xf1da('0x80')],'raw':!![]};var _0x156e99=_0x1a7c1d['clone']();_0x156e99[_0xf1da('0x44')](_0xf1da('0x81'));_0x156e99[_0xf1da('0x44')](_0xf1da('0x82'),_0xf1da('0x83'));if(_0x8e99c4['order']){_0x8e99c4[_0xf1da('0x40')]['forEach'](function(_0x1da7bb){_0x1a7c1d[_0xf1da('0x40')]('i.'+_0x1da7bb[0x0],_0x1da7bb[0x1]===_0xf1da('0x84')?![]:!![]);});}var _0x2da621=[];var _0x2a18a2=squel[_0xf1da('0x56')]();if(!_0x2e3c9b){if(_0xc6a654[_0xf1da('0x38')][_0xf1da('0x85')]){_0x2da621=_[_0xf1da('0x86')](_0xc6a654['query'][_0xf1da('0x85')])?_0xc6a654[_0xf1da('0x38')][_0xf1da('0x85')]:new Array(_0xc6a654['query'][_0xf1da('0x85')]);_0x2da621[_0xf1da('0x5f')](function(_0x3a5f43){_0x2a18a2['or'](_0xf1da('0x87'),'%,'+_0x3a5f43+',%');});_0x1a7c1d[_0xf1da('0x67')](_0x2a18a2);_0x156e99['left_join'](_0xf1da('0x88'),'it','it.MailInteractionId\x20=\x20i.id');_0x156e99['left_join'](_0xf1da('0x89'),'t',_0xf1da('0x8a'));_0x156e99[_0xf1da('0x42')](_0xf1da('0x8b'),_0x2da621);}}else{if(_0x2e3c9b[_0xf1da('0x3e')](_0xf1da('0x8c'))){if(as[_0xf1da('0x65')](_0x2e3c9b['TagId']['value'])){var _0x2162a7=_[_0xf1da('0x66')](_0x2e3c9b[_0xf1da('0x8c')]['value'])[0x0];_0x2162a7[_0xf1da('0x5f')](function(_0xe74335){as[_0xf1da('0x64')](_0xe74335)[_0xf1da('0x5f')](function(_0x14b792){_0x2da621['push'](_0x14b792);});});}else{_0x2da621=as[_0xf1da('0x64')](_0x2e3c9b[_0xf1da('0x8c')][_0xf1da('0x61')]);}_0x2da621[_0xf1da('0x5f')](function(_0x4fa6a1){_0x2a18a2['or'](_0xf1da('0x87'),'%,'+_0x4fa6a1+',%');});_0x1a7c1d[_0xf1da('0x67')](_0x2a18a2);_0x156e99[_0xf1da('0x49')]('mail_interaction_has_tags','it',_0xf1da('0x8d'));_0x156e99['left_join'](_0xf1da('0x89'),'t','t.id\x20=\x20it.TagId');_0x156e99[_0xf1da('0x42')](_0xf1da('0x8b'),_0x2da621);}}db[_0xf1da('0x8e')][_0xf1da('0x38')](_0x156e99[_0xf1da('0x7c')](),_0x4ea516)[_0xf1da('0x25')](function(_0x2c9ed8){_0x1554b0['count']=_0x2c9ed8[_0xf1da('0x3d')];if(_0x1554b0[_0xf1da('0x1c')]===0x0)return[];return db[_0xf1da('0x8e')]['query'](_0x59e3d6[_0xf1da('0x7c')](),_0x4ea516)['then'](function(_0x46b4c6){_0x358eb5=_['keyBy'](_0x46b4c6,'id');_0x4ea516=_[_0xf1da('0x8f')](_0x4ea516,{'model':db[_0xf1da('0x2e')],'mapToModel':!![],'raw':!![],'nest':!![]});_0x1a7c1d['field'](_0xf1da('0x82'),_0xf1da('0x83'));_0x1a7c1d[_0xf1da('0x44')](_0xf1da('0x90'),_0xf1da('0x91'));_0x1a7c1d['field'](_0xf1da('0x92'),'Account.mandatoryDisposition');_0x1a7c1d['field'](_0xf1da('0x81'));_0x1a7c1d['field']('i.createdAt');_0x1a7c1d[_0xf1da('0x44')](_0xf1da('0x93'));_0x1a7c1d[_0xf1da('0x44')](_0xf1da('0x94'));_0x1a7c1d['field']('i.closedAt');_0x1a7c1d[_0xf1da('0x44')]('i.attach');_0x1a7c1d['field'](_0xf1da('0x95'));_0x1a7c1d[_0xf1da('0x44')]('i.lastMsgDirection');_0x1a7c1d[_0xf1da('0x44')](_0xf1da('0x96'));_0x1a7c1d[_0xf1da('0x44')](_0xf1da('0x97'));_0x1a7c1d[_0xf1da('0x44')]('i.substatus');_0x1a7c1d[_0xf1da('0x44')]('i.to');_0x1a7c1d['field'](_0xf1da('0x98'));_0x1a7c1d[_0xf1da('0x44')](_0xf1da('0x99'));_0x1a7c1d[_0xf1da('0x44')](_0xf1da('0x9a'));_0x1a7c1d[_0xf1da('0x44')]('c.firstName','Contact.firstName');_0x1a7c1d['field'](_0xf1da('0x9b'),_0xf1da('0x9c'));_0x1a7c1d['field'](_0xf1da('0x9d'),_0xf1da('0x9e'));_0x1a7c1d[_0xf1da('0x44')](_0xf1da('0x9f'),_0xf1da('0xa0'));_0x1a7c1d[_0xf1da('0x44')](_0xf1da('0xa1'),'Contact.mobile');_0x1a7c1d[_0xf1da('0x44')](_0xf1da('0xa2'),'Contact.fax');_0x1a7c1d[_0xf1da('0x44')](_0xf1da('0xa3'),'TagIds');_0x1a7c1d[_0xf1da('0x49')](_0xf1da('0x88'),'it',_0xf1da('0x8d'));_0x1a7c1d[_0xf1da('0x49')](_0xf1da('0x89'),'t',_0xf1da('0x8a'));_0x1a7c1d[_0xf1da('0x1e')](_0x8e99c4['limit']);_0x1a7c1d[_0xf1da('0x1d')](_0x8e99c4[_0xf1da('0x1d')]);return db[_0xf1da('0x8e')][_0xf1da('0x38')](_0x1a7c1d['toString'](),_0x4ea516);})['then'](function(_0x2ddf8c){_0x5af99c['where']('ui.MailInteractionId\x20IN\x20?',_['map'](_0x2ddf8c,'id'));return db[_0xf1da('0x8e')][_0xf1da('0x38')](_0x5af99c[_0xf1da('0x7c')](),_0x4ea516)[_0xf1da('0x25')](function(_0x4c1b53){var _0x6cf8c3=_[_0xf1da('0xa4')](_0x4c1b53,_0xf1da('0xa5'));var _0x4b4277=[];return db[_0xf1da('0xa6')][_0xf1da('0x2f')]({'attributes':[_0xf1da('0xa7')],'raw':!![]})[_0xf1da('0x25')](function(_0x584b29){var _0x346ec3=_0x584b29['enableEmailPreview'];_0x2ddf8c[_0xf1da('0x5f')](function(_0x4f46aa){_0x4b4277[_0xf1da('0x2d')](updateMailInteraction(_0x4f46aa,_0x358eb5,_0x6cf8c3,_0x346ec3));});return BPromise['all'](_0x4b4277);});});});})[_0xf1da('0x25')](function(_0xe4e238){_0x1554b0[_0xf1da('0xa8')]=_0xe4e238;return _0x1554b0;})[_0xf1da('0x25')](respondWithFilteredResult(_0x3f94f0,_0x8e99c4))[_0xf1da('0x34')](handleError(_0x3f94f0,null));};exports['show']=function(_0x4d69a7,_0x9bf0b4){var _0x372925={'raw':![],'where':{'id':_0x4d69a7['params']['id']}},_0x1a677a={};_0x1a677a[_0xf1da('0x37')]=_[_0xf1da('0x5e')](db[_0xf1da('0x2e')][_0xf1da('0x36')]);_0x1a677a[_0xf1da('0x38')]=_[_0xf1da('0x5e')](_0x4d69a7[_0xf1da('0x38')]);_0x1a677a[_0xf1da('0x39')]=_[_0xf1da('0x3a')](_0x1a677a[_0xf1da('0x37')],_0x1a677a[_0xf1da('0x38')]);_0x372925['attributes']=_[_0xf1da('0x3a')](_0x1a677a[_0xf1da('0x37')],qs[_0xf1da('0x3b')](_0x4d69a7['query'][_0xf1da('0x3b')]));_0x372925[_0xf1da('0x3c')]=_0x372925['attributes'][_0xf1da('0x3d')]?_0x372925[_0xf1da('0x3c')]:_0x1a677a['model'];if(_0x4d69a7[_0xf1da('0x38')][_0xf1da('0xa9')]){_0x372925['include']=[{'all':!![]}];}_0x372925=_['merge']({},_0x372925,_0x4d69a7[_0xf1da('0x5c')]);return db[_0xf1da('0x2e')][_0xf1da('0xaa')](_0x372925)[_0xf1da('0x25')](handleEntityNotFound(_0x9bf0b4,null))[_0xf1da('0x25')](respondWithResult(_0x9bf0b4,null))[_0xf1da('0x34')](handleError(_0x9bf0b4,null));};exports['create']=function(_0x3167d2,_0x564ec9){return db[_0xf1da('0x2e')][_0xf1da('0xab')](_0x3167d2['body'],{})[_0xf1da('0x25')](respondWithResult(_0x564ec9,0xc9))[_0xf1da('0x34')](handleError(_0x564ec9,null));};exports[_0xf1da('0x23')]=function(_0x2f3e31,_0x65f781){if(_0x2f3e31[_0xf1da('0xac')]['id']){delete _0x2f3e31[_0xf1da('0xac')]['id'];}return db[_0xf1da('0x2e')][_0xf1da('0xaa')]({'where':{'id':_0x2f3e31[_0xf1da('0xad')]['id']}})[_0xf1da('0x25')](handleEntityNotFound(_0x65f781,null))[_0xf1da('0x25')](saveUpdates(_0x2f3e31[_0xf1da('0xac')],null))[_0xf1da('0x25')](respondWithResult(_0x65f781,null))[_0xf1da('0x34')](handleError(_0x65f781,null));};exports[_0xf1da('0x24')]=function(_0x17bc12,_0x3ba972){return db[_0xf1da('0x2e')][_0xf1da('0xaa')]({'where':{'id':_0x17bc12[_0xf1da('0xad')]['id']}})[_0xf1da('0x25')](handleEntityNotFound(_0x3ba972,null))[_0xf1da('0x25')](removeEntity(_0x3ba972,null))[_0xf1da('0x34')](handleError(_0x3ba972,null));};exports[_0xf1da('0xae')]=function(_0x4d420b,_0x5332a1){return db['MailInteraction'][_0xf1da('0xae')]()['then'](respondWithResult(_0x5332a1,null))[_0xf1da('0x34')](handleError(_0x5332a1,null));};exports[_0xf1da('0xaf')]=function(_0x4a5cef,_0x3bb3a9,_0x2e6bf3){return db['MailMessage']['find']({'where':{'id':_0x4a5cef[_0xf1da('0xad')]['id']}})['then'](handleEntityNotFound(_0x3bb3a9,null))['then'](function(_0x4044ae){if(_0x4044ae){return _0x4044ae[_0xf1da('0xaf')](_0x4a5cef['body'][_0xf1da('0xb0')],_[_0xf1da('0x5b')](_0x4a5cef[_0xf1da('0xac')],[_0xf1da('0xb0'),'id'])||{});}})[_0xf1da('0x25')](respondWithResult(_0x3bb3a9,null))[_0xf1da('0x34')](handleError(_0x3bb3a9,null));};exports[_0xf1da('0xb1')]=function(_0x1476eb,_0x233489,_0x51195f){var _0xb3efea={'raw':![],'where':{}};var _0x462d39={};var _0x337136={'count':0x0,'rows':[]};return db[_0xf1da('0x2e')][_0xf1da('0x2f')]({'where':{'id':_0x1476eb[_0xf1da('0xad')]['id']}})[_0xf1da('0x25')](handleEntityNotFound(_0x233489,null))[_0xf1da('0x25')](function(_0x2b1250){if(_0x2b1250){_0x462d39['model']=_[_0xf1da('0x5e')](db[_0xf1da('0xb2')][_0xf1da('0x36')]);_0x462d39[_0xf1da('0x38')]=_[_0xf1da('0x5e')](_0x1476eb[_0xf1da('0x38')]);_0x462d39['filters']=_[_0xf1da('0x3a')](_0x462d39['model'],_0x462d39[_0xf1da('0x38')]);_0xb3efea['attributes']=_[_0xf1da('0x3a')](_0x462d39['model'],qs[_0xf1da('0x3b')](_0x1476eb['query'][_0xf1da('0x3b')]));_0xb3efea[_0xf1da('0x3c')]=_0xb3efea[_0xf1da('0x3c')][_0xf1da('0x3d')]?_0xb3efea[_0xf1da('0x3c')]:_0x462d39[_0xf1da('0x37')];if(!_0x1476eb[_0xf1da('0x38')][_0xf1da('0x3e')](_0xf1da('0x3f'))){_0xb3efea[_0xf1da('0x1e')]=qs[_0xf1da('0x1e')](_0x1476eb[_0xf1da('0x38')][_0xf1da('0x1e')]);_0xb3efea[_0xf1da('0x1d')]=qs['offset'](_0x1476eb[_0xf1da('0x38')][_0xf1da('0x1d')]);}_0xb3efea[_0xf1da('0x40')]=qs[_0xf1da('0x41')](_0x1476eb[_0xf1da('0x38')][_0xf1da('0x41')]);_0xb3efea[_0xf1da('0x42')]=qs['filters'](_['pick'](_0x1476eb['query'],_0x462d39[_0xf1da('0x39')]));_0xb3efea[_0xf1da('0x42')][_0xf1da('0xa5')]=_0x2b1250['id'];if(_0x1476eb['query'][_0xf1da('0x6b')]){_0xb3efea[_0xf1da('0x42')]=_[_0xf1da('0x8f')](_0xb3efea[_0xf1da('0x42')],{'$or':_[_0xf1da('0x29')](_0xb3efea[_0xf1da('0x3c')],function(_0x4a72ab){var _0x2c74c6={};_0x2c74c6[_0x4a72ab]={'$like':'%'+_0x1476eb[_0xf1da('0x38')]['filter']+'%'};return _0x2c74c6;})});}if(_0x1476eb[_0xf1da('0x38')][_0xf1da('0xb3')]){var _0x1ad53d=_0x1476eb[_0xf1da('0x38')][_0xf1da('0xb3')][_0xf1da('0x2c')](',');var _0x1ee8d3={};_0x1ee8d3[_0x1ad53d[0x0]]={'$gte':moment(_0x1ad53d[0x1])[_0xf1da('0xb4')]('YYYY-MM-DD\x20HH:mm:ss')};_0xb3efea[_0xf1da('0x42')]=_[_0xf1da('0x8f')](_0xb3efea[_0xf1da('0x42')],_0x1ee8d3);}_0xb3efea=_[_0xf1da('0x8f')]({},_0xb3efea,_0x1476eb[_0xf1da('0x5c')]);return db[_0xf1da('0xb2')]['count']({'where':_0xb3efea[_0xf1da('0x42')]})['then'](function(_0x2cff06){_0x337136[_0xf1da('0x1c')]=_0x2cff06;if(_0x1476eb[_0xf1da('0x38')][_0xf1da('0xa9')]){_0xb3efea[_0xf1da('0xb5')]=[{'all':!![]}];}return db['MailMessage'][_0xf1da('0xb6')](_0xb3efea);})[_0xf1da('0x25')](function(_0x23ec89){_0x337136['rows']=_0x23ec89;return _0x337136;});}})['then'](respondWithFilteredResult(_0x233489,_0xb3efea))[_0xf1da('0x34')](handleError(_0x233489,null));};exports[_0xf1da('0xb7')]=function(_0x45397c,_0x7bd9ce,_0x1c9b10){return db['MailInteraction'][_0xf1da('0xaa')]({'where':{'id':_0x45397c[_0xf1da('0xad')]['id']}})[_0xf1da('0x25')](handleEntityNotFound(_0x7bd9ce,null))[_0xf1da('0x25')](function(_0x20b83a){if(_0x20b83a){return _0x20b83a[_0xf1da('0xb8')](_0x45397c[_0xf1da('0xac')][_0xf1da('0xb0')],_[_0xf1da('0x5b')](_0x45397c[_0xf1da('0xac')],[_0xf1da('0xb0'),'id'])||{})[_0xf1da('0xb9')](function(){return db[_0xf1da('0xba')]['findAll']({'attributes':['id',_0xf1da('0x28'),'color'],'where':{'id':_0x45397c[_0xf1da('0xac')]['ids']}});})[_0xf1da('0x25')](function(_0x2779b1){socket[_0xf1da('0xbb')](_0xf1da('0xbc'),{'id':Number(_0x45397c[_0xf1da('0xad')]['id']),'tags':_0x2779b1||[]});return{'id':Number(_0x45397c['params']['id']),'tags':_0x2779b1||[]};});}})[_0xf1da('0x25')](respondWithResult(_0x7bd9ce,null))['catch'](handleError(_0x7bd9ce,null));};exports[_0xf1da('0xbd')]=function(_0xaa44ee,_0x3d8854,_0x1b4d9c){return db[_0xf1da('0x2e')]['find']({'where':{'id':_0xaa44ee[_0xf1da('0xad')]['id']}})[_0xf1da('0x25')](handleEntityNotFound(_0x3d8854,null))['then'](function(_0x324b01){if(_0x324b01){return _0x324b01['removeTags'](_0xaa44ee[_0xf1da('0x38')][_0xf1da('0xb0')]);}})['then'](respondWithStatusCode(_0x3d8854,null))[_0xf1da('0x34')](handleError(_0x3d8854,null));};exports['download']=function(_0x2991bc,_0x5ef574){var _0x1476c9=moment()[_0xf1da('0xbe')]()[_0xf1da('0x7c')]();var _0x39937f=path[_0xf1da('0xbf')](config[_0xf1da('0xc0')],_0xf1da('0xc1'),'files',_0xf1da('0xc2'));var _0x4f5c0d=path['join'](config[_0xf1da('0xc0')],_0xf1da('0xc1'),_0xf1da('0xc3'),'tmp');var _0xbda7cc=path[_0xf1da('0xbf')](_0x4f5c0d,_0x1476c9);var _0x54a3b2=util[_0xf1da('0xb4')](_0xf1da('0xc4'),_0x1476c9);var _0x45bc43=path[_0xf1da('0xbf')](_0x4f5c0d,_0x54a3b2);var _0x5d131=![];return db[_0xf1da('0x2e')][_0xf1da('0xaa')]({'where':{'id':_0x2991bc[_0xf1da('0xad')]['id']}})[_0xf1da('0x25')](handleEntityNotFound(_0x5ef574,null))[_0xf1da('0x25')](function(_0x3fd70e){if(_0x3fd70e){return _0x3fd70e[_0xf1da('0xb1')]({'attributes':['id','body',_0xf1da('0x4d'),'to','cc','bcc',_0xf1da('0xc5'),_0xf1da('0x71')],'where':{'secret':![]},'include':_0x2991bc[_0xf1da('0x38')]['attachments']?[{'model':db[_0xf1da('0xc6')],'as':_0xf1da('0xc7')}]:undefined,'order':qs['sort']('id')});}return[];})[_0xf1da('0x25')](function(_0x5e4dc3){_0x5d131=_0x5e4dc3[_0xf1da('0x3d')];if(_0x5e4dc3[_0xf1da('0x3d')]){fs[_0xf1da('0xc8')](_0xbda7cc);return BPromise['each'](_0x5e4dc3,function(_0x5d2060,_0x1179ef){var _0x3ec687=_0x5d2060;var _0x4addce={'from':_0x3ec687[_0xf1da('0x4d')],'to':_0x3ec687['to'],'subject':_0x3ec687[_0xf1da('0xc5')],'html':_0x3ec687[_0xf1da('0xac')],'headers':{'Date':moment(_0x3ec687['createdAt'])['format'](_0xf1da('0xc9'))},'attachments':[]};if(_0x5d2060['cc']){_0x4addce[_0xf1da('0xca')]['Cc']=_0x5d2060['cc'];}if(_0x5d2060['bcc']){_0x4addce[_0xf1da('0xca')]['Bcc']=_0x5d2060[_0xf1da('0xcb')];}return new BPromise(function(_0x14b047,_0x1a9313){if(_0x5d2060[_0xf1da('0xc7')]){for(var _0x3f7e0e=0x0;_0x3f7e0e<_0x5d2060[_0xf1da('0xc7')][_0xf1da('0x3d')];_0x3f7e0e++){var _0x1567e8=_0x5d2060['Attachments'][_0x3f7e0e];var _0x3b300d=path['join'](_0x39937f,_0x1567e8[_0xf1da('0xcc')]);if(fs[_0xf1da('0xcd')](_0x3b300d)){_0x4addce[_0xf1da('0xc2')]['push']({'name':_0x1567e8[_0xf1da('0x28')],'contentType':_0x1567e8[_0xf1da('0xce')],'data':fs['readFileSync'](_0x3b300d)});}}}emlformat[_0xf1da('0xcf')](_0x4addce,function(_0x462c8a,_0x419688){if(_0x462c8a)return _0x1a9313(_0x462c8a);fs[_0xf1da('0xd0')](path[_0xf1da('0xbf')](_0xbda7cc,util[_0xf1da('0xb4')](_0xf1da('0xd1'),_0x1179ef)),_0x419688);return _0x14b047(_0x419688);});});});}})[_0xf1da('0x25')](function(){if(_0x5d131){return new BPromise(function(_0x9f6c8e,_0x1d13c6){zipdir(_0xbda7cc,{'saveTo':_0x45bc43},function(_0x3feb94,_0x71638b){if(_0x3feb94)return _0x1d13c6(_0x3feb94);return _0x9f6c8e(_0x71638b);});});}})[_0xf1da('0x25')](function(){if(_0x5d131){return new BPromise(function(_0x1df09c,_0xb9e165){rimraf(_0xbda7cc,function(_0x559679){if(_0x559679)_0xb9e165(_0x559679);return _0x1df09c();});});}})[_0xf1da('0x25')](function(){if(_0x5d131){return _0x5ef574['download'](_0x45bc43,_0x54a3b2,function(_0x495d46){if(_0x495d46){console['log'](_0xf1da('0xd2'),_0x495d46);}else{fs[_0xf1da('0xd3')](_0x45bc43);}});}else{return _0x5ef574[_0xf1da('0x19')](0xc8);}})['catch'](handleError(_0x5ef574,null));}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.events.js b/server/api/mailInteraction/mailInteraction.events.js index 90f198a..0e6e4d4 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 _0xcaf0=['hasOwnProperty','hook','exports','../../mysqldb','MailInteraction','setMaxListeners','update','remove','then','setDataValue','map','unreadMessages','length','emit','catch'];(function(_0x1be42d,_0x1a0711){var _0x241588=function(_0x318e26){while(--_0x318e26){_0x1be42d['push'](_0x1be42d['shift']());}};_0x241588(++_0x1a0711);}(_0xcaf0,0x99));var _0x0caf=function(_0x2a4d07,_0x3664aa){_0x2a4d07=_0x2a4d07-0x0;var _0x3d0203=_0xcaf0[_0x2a4d07];return _0x3d0203;};'use strict';var EventEmitter=require('events');var MailInteraction=require(_0x0caf('0x0'))['db'][_0x0caf('0x1')];var MailMessage=require(_0x0caf('0x0'))['db']['MailMessage'];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0x0caf('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x0caf('0x3'),'afterDestroy':_0x0caf('0x4')};function emitEvent(_0x42c3fd){return function(_0x4d609c,_0xdceae9,_0x284b1a){_0x4d609c['getUsers']({'attributes':['id'],'raw':!![]})[_0x0caf('0x5')](function(_0x4b5ab7){_0x4d609c[_0x0caf('0x6')]('Users',_0x4b5ab7[_0x0caf('0x7')](function(_0x1fc3da){return{'id':_0x1fc3da['id']};}));return MailMessage['findAll']({'where':{'MailInteractionId':_0x4d609c['id'],'direction':'in','read':![]},'raw':!![]});})[_0x0caf('0x5')](function(_0x34ecff){_0x4d609c[_0x0caf('0x6')](_0x0caf('0x8'),_0x34ecff[_0x0caf('0x9')]);MailInteractionEvents[_0x0caf('0xa')](_0x42c3fd+':'+_0x4d609c['id'],_0x4d609c);MailInteractionEvents['emit'](_0x42c3fd,_0x4d609c);_0x284b1a(null);})[_0x0caf('0xb')](_0x284b1a(null));};}for(var e in events){if(events[_0x0caf('0xc')](e)){var event=events[e];MailInteraction[_0x0caf('0xd')](e,emitEvent(event));}}module[_0x0caf('0xe')]=MailInteractionEvents; \ No newline at end of file +var _0x7bc5=['hasOwnProperty','hook','exports','events','../../mysqldb','MailInteraction','save','update','getUsers','setDataValue','Users','map','then','unreadMessages','length','emit','catch'];(function(_0x1136ac,_0x1bd097){var _0xfca135=function(_0x4563d8){while(--_0x4563d8){_0x1136ac['push'](_0x1136ac['shift']());}};_0xfca135(++_0x1bd097);}(_0x7bc5,0x1bd));var _0x57bc=function(_0x8cb2f9,_0x2b8706){_0x8cb2f9=_0x8cb2f9-0x0;var _0x164887=_0x7bc5[_0x8cb2f9];return _0x164887;};'use strict';var EventEmitter=require(_0x57bc('0x0'));var MailInteraction=require(_0x57bc('0x1'))['db'][_0x57bc('0x2')];var MailMessage=require(_0x57bc('0x1'))['db']['MailMessage'];var MailInteractionEvents=new EventEmitter();MailInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x57bc('0x3'),'afterUpdate':_0x57bc('0x4'),'afterDestroy':'remove'};function emitEvent(_0x2aa741){return function(_0x1ad0df,_0x69ca70,_0x248f5c){_0x1ad0df[_0x57bc('0x5')]({'attributes':['id'],'raw':!![]})['then'](function(_0x1e94d1){_0x1ad0df[_0x57bc('0x6')](_0x57bc('0x7'),_0x1e94d1[_0x57bc('0x8')](function(_0x5012ee){return{'id':_0x5012ee['id']};}));return MailMessage['findAll']({'where':{'MailInteractionId':_0x1ad0df['id'],'direction':'in','read':![]},'raw':!![]});})[_0x57bc('0x9')](function(_0x591578){_0x1ad0df[_0x57bc('0x6')](_0x57bc('0xa'),_0x591578[_0x57bc('0xb')]);MailInteractionEvents[_0x57bc('0xc')](_0x2aa741+':'+_0x1ad0df['id'],_0x1ad0df);MailInteractionEvents[_0x57bc('0xc')](_0x2aa741,_0x1ad0df);_0x248f5c(null);})[_0x57bc('0xd')](_0x248f5c(null));};}for(var e in events){if(events[_0x57bc('0xe')](e)){var event=events[e];MailInteraction[_0x57bc('0xf')](e,emitEvent(event));}}module[_0x57bc('0x10')]=MailInteractionEvents; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.model.js b/server/api/mailInteraction/mailInteraction.model.js index 64f2285..64cc957 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 _0x6c09=['utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','../../config/environment','./mailInteraction.attributes','exports','define','MailInteraction','mail_interactions','fti_mail_interactions','FULLTEXT','substatus','substatusAt','format','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','changed','models','get','MailMessage','update','then'];(function(_0x55f5ba,_0x4aa189){var _0x37f06a=function(_0x3913f6){while(--_0x3913f6){_0x55f5ba['push'](_0x55f5ba['shift']());}};_0x37f06a(++_0x4aa189);}(_0x6c09,0x110));var _0x96c0=function(_0x2b7db5,_0x14a1d1){_0x2b7db5=_0x2b7db5-0x0;var _0x468f12=_0x6c09[_0x2b7db5];return _0x468f12;};'use strict';var _=require(_0x96c0('0x0'));var util=require(_0x96c0('0x1'));var logger=require(_0x96c0('0x2'))(_0x96c0('0x3'));var moment=require('moment');var BPromise=require(_0x96c0('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x96c0('0x5'));var attributes=require(_0x96c0('0x6'));module[_0x96c0('0x7')]=function(_0x31afb3,_0x1d1d2b){return _0x31afb3[_0x96c0('0x8')](_0x96c0('0x9'),attributes,{'tableName':_0x96c0('0xa'),'paranoid':![],'indexes':[{'name':_0x96c0('0xb'),'fields':['subject','to'],'type':_0x96c0('0xc')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x2bad10,_0x1f627d,_0x5b779b){if(_0x2bad10[_0x96c0('0xd')]){_0x2bad10[_0x96c0('0xe')]=moment()[_0x96c0('0xf')](_0x96c0('0x10'));}if(_0x2bad10[_0x96c0('0x11')]){_0x2bad10[_0x96c0('0x12')]=moment()[_0x96c0('0xf')](_0x96c0('0x10'));}_0x5b779b(null,_0x1f627d);},'beforeUpdate':function(_0x5d0894,_0x27cc6c,_0x56358d){if(_0x5d0894[_0x96c0('0x13')](_0x96c0('0xd'))){_0x5d0894['substatusAt']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}if(_0x5d0894['changed']('closed')){_0x5d0894[_0x96c0('0x12')]=moment()[_0x96c0('0xf')](_0x96c0('0x10'));}_0x56358d(null,_0x5d0894);},'afterUpdate':function(_0x563b05,_0xd0cfb4,_0x4f1745){var _0x5e784b=_0x31afb3[_0x96c0('0x14')];var _0x228294=_0x563b05[_0x96c0('0x15')]({'plain':!![]});if(_0x228294[_0x96c0('0x11')]){return _0x5e784b[_0x96c0('0x16')][_0x96c0('0x17')]({'read':!![]},{'where':{'MailInteractionId':_0x228294['id']}})[_0x96c0('0x18')](function(){_0x4f1745();})['catch'](function(_0x5dc397){_0x4f1745(_0x5dc397);});}else{_0x4f1745();}}},'charset':_0x96c0('0x19'),'collate':_0x96c0('0x1a')});}; \ No newline at end of file +var _0x02c8=['format','substatusAt','models','get','MailMessage','update','catch','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailInteraction.attributes','exports','define','MailInteraction','mail_interactions','fti_mail_interactions','subject','FULLTEXT','substatus','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt'];(function(_0x5db867,_0x5dd600){var _0x6de323=function(_0x226d79){while(--_0x226d79){_0x5db867['push'](_0x5db867['shift']());}};_0x6de323(++_0x5dd600);}(_0x02c8,0x80));var _0x802c=function(_0x367f25,_0x3e2756){_0x367f25=_0x367f25-0x0;var _0x4936ab=_0x02c8[_0x367f25];return _0x4936ab;};'use strict';var _=require(_0x802c('0x0'));var util=require(_0x802c('0x1'));var logger=require(_0x802c('0x2'))(_0x802c('0x3'));var moment=require(_0x802c('0x4'));var BPromise=require(_0x802c('0x5'));var rp=require(_0x802c('0x6'));var fs=require('fs');var path=require(_0x802c('0x7'));var rimraf=require(_0x802c('0x8'));var config=require(_0x802c('0x9'));var attributes=require(_0x802c('0xa'));module[_0x802c('0xb')]=function(_0x24267c,_0x1625bd){return _0x24267c[_0x802c('0xc')](_0x802c('0xd'),attributes,{'tableName':_0x802c('0xe'),'paranoid':![],'indexes':[{'name':_0x802c('0xf'),'fields':[_0x802c('0x10'),'to'],'type':_0x802c('0x11')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x7a6196,_0x2cbe49,_0x24a297){if(_0x7a6196[_0x802c('0x12')]){_0x7a6196['substatusAt']=moment()['format'](_0x802c('0x13'));}if(_0x7a6196[_0x802c('0x14')]){_0x7a6196[_0x802c('0x15')]=moment()[_0x802c('0x16')]('YYYY-MM-DD\x20HH:mm:ss');}_0x24a297(null,_0x2cbe49);},'beforeUpdate':function(_0x5012c7,_0x2e5d3c,_0x485a44){if(_0x5012c7['changed']('substatus')){_0x5012c7[_0x802c('0x17')]=moment()[_0x802c('0x16')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x5012c7['changed'](_0x802c('0x14'))){_0x5012c7[_0x802c('0x15')]=moment()[_0x802c('0x16')]('YYYY-MM-DD\x20HH:mm:ss');}_0x485a44(null,_0x5012c7);},'afterUpdate':function(_0x154227,_0x466d26,_0x21b109){var _0x5b293d=_0x24267c[_0x802c('0x18')];var _0x5a92c9=_0x154227[_0x802c('0x19')]({'plain':!![]});if(_0x5a92c9[_0x802c('0x14')]){return _0x5b293d[_0x802c('0x1a')][_0x802c('0x1b')]({'read':!![]},{'where':{'MailInteractionId':_0x5a92c9['id']}})['then'](function(){_0x21b109();})[_0x802c('0x1c')](function(_0x3f5f9e){_0x21b109(_0x3f5f9e);});}else{_0x21b109();}}},'charset':'utf8mb4','collate':_0x802c('0x1d')});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.rpc.js b/server/api/mailInteraction/mailInteraction.rpc.js index 8efd675..11afb42 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 _0x1bd1=['MailInteraction,\x20%s,\x20%s','message','result','catch','UpdateMailInteraction','MailInteraction','update','options','raw','attributes','limit','AddTagsToMailInteraction','find','body','ids','omit','spread','AddTags','lodash','util','moment','randomstring','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./mailInteraction.socket','request','then','info','request\x20sent','debug','MailInteraction,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x1a379a,_0x2868e0){var _0x528c58=function(_0x25a00a){while(--_0x25a00a){_0x1a379a['push'](_0x1a379a['shift']());}};_0x528c58(++_0x2868e0);}(_0x1bd1,0x123));var _0x11bd=function(_0x377ef2,_0xa85fe6){_0x377ef2=_0x377ef2-0x0;var _0x3ab87f=_0x1bd1[_0x377ef2];return _0x3ab87f;};'use strict';var _=require(_0x11bd('0x0'));var util=require(_0x11bd('0x1'));var moment=require(_0x11bd('0x2'));var BPromise=require('bluebird');var rs=require(_0x11bd('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x11bd('0x4'));var config=require(_0x11bd('0x5'));var jayson=require(_0x11bd('0x6'));var client=jayson[_0x11bd('0x7')]['http']({'port':0x232a});config[_0x11bd('0x8')]=_[_0x11bd('0x9')](config[_0x11bd('0x8')],{'host':_0x11bd('0xa'),'port':0x18eb});var socket=require(_0x11bd('0xb'))(new Redis(config['redis']));require(_0x11bd('0xc'))['register'](socket);function respondWithRpcPromise(_0x4b3471,_0x8f6603,_0x3790a0){return new BPromise(function(_0x1b1916,_0x25f6f7){return client[_0x11bd('0xd')](_0x4b3471,_0x3790a0)[_0x11bd('0xe')](function(_0x3ded96){logger[_0x11bd('0xf')]('MailInteraction,\x20%s,\x20%s',_0x8f6603,_0x11bd('0x10'));logger[_0x11bd('0x11')](_0x11bd('0x12'),_0x8f6603,_0x11bd('0x10'),JSON[_0x11bd('0x13')](_0x3ded96));if(_0x3ded96[_0x11bd('0x14')]){if(_0x3ded96[_0x11bd('0x14')]['code']===0x1f4){logger['error'](_0x11bd('0x15'),_0x8f6603,_0x3ded96[_0x11bd('0x14')][_0x11bd('0x16')]);return _0x25f6f7(_0x3ded96['error'][_0x11bd('0x16')]);}logger['error']('MailInteraction,\x20%s,\x20%s',_0x8f6603,_0x3ded96[_0x11bd('0x14')][_0x11bd('0x16')]);return _0x1b1916(_0x3ded96[_0x11bd('0x14')][_0x11bd('0x16')]);}else{logger[_0x11bd('0xf')]('MailInteraction,\x20%s,\x20%s',_0x8f6603,_0x11bd('0x10'));_0x1b1916(_0x3ded96[_0x11bd('0x17')][_0x11bd('0x16')]);}})[_0x11bd('0x18')](function(_0x7ee9b6){logger[_0x11bd('0x14')](_0x11bd('0x15'),_0x8f6603,_0x7ee9b6);_0x25f6f7(_0x7ee9b6);});});}exports[_0x11bd('0x19')]=function(_0x5af695){var _0x587663=this;return new Promise(function(_0xfb074b,_0x232811){return db[_0x11bd('0x1a')][_0x11bd('0x1b')](_0x5af695['body'],{'raw':_0x5af695[_0x11bd('0x1c')]?_0x5af695['options'][_0x11bd('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5af695[_0x11bd('0x1c')]?_0x5af695[_0x11bd('0x1c')]['where']||null:null,'attributes':_0x5af695[_0x11bd('0x1c')]?_0x5af695[_0x11bd('0x1c')][_0x11bd('0x1e')]||null:null,'limit':_0x5af695[_0x11bd('0x1c')]?_0x5af695[_0x11bd('0x1c')][_0x11bd('0x1f')]||null:null})[_0x11bd('0xe')](function(_0x2ac9f0){logger[_0x11bd('0xf')](_0x11bd('0x19'),_0x5af695);logger[_0x11bd('0x11')](_0x11bd('0x19'),_0x5af695,JSON['stringify'](_0x2ac9f0));_0xfb074b(_0x2ac9f0);})[_0x11bd('0x18')](function(_0xfbe811){logger[_0x11bd('0x14')]('UpdateMailInteraction',_0xfbe811['message'],_0x5af695);_0x232811(_0x587663['error'](0x1f4,_0xfbe811[_0x11bd('0x16')]));});});};exports[_0x11bd('0x20')]=function(_0x181fdc){return new Promise(function(_0x274435,_0x39c2e3){return db[_0x11bd('0x1a')][_0x11bd('0x21')]({'where':_0x181fdc['options']?_0x181fdc[_0x11bd('0x1c')]['where']||null:null})[_0x11bd('0xe')](function(_0x42312c){if(_0x42312c){return _0x42312c['addTags'](_0x181fdc[_0x11bd('0x22')][_0x11bd('0x23')],_[_0x11bd('0x24')](_0x181fdc[_0x11bd('0x22')],[_0x11bd('0x23'),'id'])||{});}})[_0x11bd('0x25')](function(_0x1aaed0){logger[_0x11bd('0xf')]('AddTags',_0x181fdc);logger[_0x11bd('0x11')](_0x11bd('0x26'),_0x181fdc,JSON[_0x11bd('0x13')](_0x1aaed0));_0x274435(_0x1aaed0);})[_0x11bd('0x18')](function(_0xe475dd){logger[_0x11bd('0x14')](_0x11bd('0x26'),_0xe475dd[_0x11bd('0x16')],_0x181fdc);_0x39c2e3(_this[_0x11bd('0x14')](0x1f4,_0xe475dd[_0x11bd('0x16')]));});});}; \ No newline at end of file +var _0x9bb4=['result','UpdateMailInteraction','MailInteraction','options','where','then','catch','AddTagsToMailInteraction','find','addTags','ids','body','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','register','MailInteraction,\x20%s,\x20%s','request\x20sent','debug','MailInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info'];(function(_0xd91dfe,_0x8dc4ce){var _0x170eeb=function(_0x316c2a){while(--_0x316c2a){_0xd91dfe['push'](_0xd91dfe['shift']());}};_0x170eeb(++_0x8dc4ce);}(_0x9bb4,0xd5));var _0x49bb=function(_0x5a9537,_0x1c38d2){_0x5a9537=_0x5a9537-0x0;var _0xff9787=_0x9bb4[_0x5a9537];return _0xff9787;};'use strict';var _=require(_0x49bb('0x0'));var util=require(_0x49bb('0x1'));var moment=require(_0x49bb('0x2'));var BPromise=require(_0x49bb('0x3'));var rs=require(_0x49bb('0x4'));var fs=require('fs');var Redis=require(_0x49bb('0x5'));var db=require(_0x49bb('0x6'))['db'];var utils=require(_0x49bb('0x7'));var logger=require(_0x49bb('0x8'))('rpc');var config=require(_0x49bb('0x9'));var jayson=require(_0x49bb('0xa'));var client=jayson[_0x49bb('0xb')][_0x49bb('0xc')]({'port':0x232a});config['redis']=_[_0x49bb('0xd')](config[_0x49bb('0xe')],{'host':_0x49bb('0xf'),'port':0x18eb});var socket=require(_0x49bb('0x10'))(new Redis(config[_0x49bb('0xe')]));require('./mailInteraction.socket')[_0x49bb('0x11')](socket);function respondWithRpcPromise(_0x4d6ec7,_0x245b5e,_0x1708d4){return new BPromise(function(_0x561e59,_0x2de0ba){return client['request'](_0x4d6ec7,_0x1708d4)['then'](function(_0x50ad46){logger['info'](_0x49bb('0x12'),_0x245b5e,_0x49bb('0x13'));logger[_0x49bb('0x14')](_0x49bb('0x15'),_0x245b5e,_0x49bb('0x13'),JSON[_0x49bb('0x16')](_0x50ad46));if(_0x50ad46[_0x49bb('0x17')]){if(_0x50ad46[_0x49bb('0x17')][_0x49bb('0x18')]===0x1f4){logger['error'](_0x49bb('0x12'),_0x245b5e,_0x50ad46['error'][_0x49bb('0x19')]);return _0x2de0ba(_0x50ad46[_0x49bb('0x17')][_0x49bb('0x19')]);}logger[_0x49bb('0x17')](_0x49bb('0x12'),_0x245b5e,_0x50ad46[_0x49bb('0x17')][_0x49bb('0x19')]);return _0x561e59(_0x50ad46[_0x49bb('0x17')]['message']);}else{logger[_0x49bb('0x1a')](_0x49bb('0x12'),_0x245b5e,'request\x20sent');_0x561e59(_0x50ad46[_0x49bb('0x1b')][_0x49bb('0x19')]);}})['catch'](function(_0x381eed){logger[_0x49bb('0x17')]('MailInteraction,\x20%s,\x20%s',_0x245b5e,_0x381eed);_0x2de0ba(_0x381eed);});});}exports[_0x49bb('0x1c')]=function(_0x8ea413){var _0x586085=this;return new Promise(function(_0xc1d3bb,_0x5387ed){return db[_0x49bb('0x1d')]['update'](_0x8ea413['body'],{'raw':_0x8ea413[_0x49bb('0x1e')]?_0x8ea413['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x8ea413[_0x49bb('0x1e')]?_0x8ea413[_0x49bb('0x1e')][_0x49bb('0x1f')]||null:null,'attributes':_0x8ea413[_0x49bb('0x1e')]?_0x8ea413['options']['attributes']||null:null,'limit':_0x8ea413['options']?_0x8ea413['options']['limit']||null:null})[_0x49bb('0x20')](function(_0x570847){logger['info'](_0x49bb('0x1c'),_0x8ea413);logger[_0x49bb('0x14')](_0x49bb('0x1c'),_0x8ea413,JSON[_0x49bb('0x16')](_0x570847));_0xc1d3bb(_0x570847);})[_0x49bb('0x21')](function(_0x59225e){logger[_0x49bb('0x17')](_0x49bb('0x1c'),_0x59225e[_0x49bb('0x19')],_0x8ea413);_0x5387ed(_0x586085[_0x49bb('0x17')](0x1f4,_0x59225e['message']));});});};exports[_0x49bb('0x22')]=function(_0x3d025d){return new Promise(function(_0x3985a6,_0x47540c){return db['MailInteraction'][_0x49bb('0x23')]({'where':_0x3d025d[_0x49bb('0x1e')]?_0x3d025d[_0x49bb('0x1e')][_0x49bb('0x1f')]||null:null})['then'](function(_0x39d6aa){if(_0x39d6aa){return _0x39d6aa[_0x49bb('0x24')](_0x3d025d['body'][_0x49bb('0x25')],_['omit'](_0x3d025d[_0x49bb('0x26')],[_0x49bb('0x25'),'id'])||{});}})['spread'](function(_0x2dc42f){logger[_0x49bb('0x1a')]('AddTags',_0x3d025d);logger[_0x49bb('0x14')](_0x49bb('0x27'),_0x3d025d,JSON[_0x49bb('0x16')](_0x2dc42f));_0x3985a6(_0x2dc42f);})[_0x49bb('0x21')](function(_0x286c5e){logger[_0x49bb('0x17')](_0x49bb('0x27'),_0x286c5e[_0x49bb('0x19')],_0x3d025d);_0x47540c(_this['error'](0x1f4,_0x286c5e[_0x49bb('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.socket.js b/server/api/mailInteraction/mailInteraction.socket.js index bf6b237..7c94993 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 _0x4fce=['mailInteraction:','./mailInteraction.events','save','remove','emit','removeListener','register','length'];(function(_0x2afe50,_0x26a84a){var _0x525bcf=function(_0x906c70){while(--_0x906c70){_0x2afe50['push'](_0x2afe50['shift']());}};_0x525bcf(++_0x26a84a);}(_0x4fce,0x171));var _0xe4fc=function(_0x5d4402,_0x3acfaa){_0x5d4402=_0x5d4402-0x0;var _0x128538=_0x4fce[_0x5d4402];return _0x128538;};'use strict';var MailInteractionEvents=require(_0xe4fc('0x0'));var events=[_0xe4fc('0x1'),_0xe4fc('0x2'),'update'];function createListener(_0x5ac809,_0x154964){return function(_0x5e45b1){_0x154964[_0xe4fc('0x3')](_0x5ac809,_0x5e45b1);};}function removeListener(_0x58011d,_0x32530a){return function(){MailInteractionEvents[_0xe4fc('0x4')](_0x58011d,_0x32530a);};}exports[_0xe4fc('0x5')]=function(_0x20073a){for(var _0x55d11d=0x0,_0x443148=events[_0xe4fc('0x6')];_0x55d11d<_0x443148;_0x55d11d++){var _0x3378fb=events[_0x55d11d];var _0x434aef=createListener(_0xe4fc('0x7')+_0x3378fb,_0x20073a);MailInteractionEvents['on'](_0x3378fb,_0x434aef);}}; \ No newline at end of file +var _0x6eb1=['./mailInteraction.events','update','removeListener','register'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6eb1,0x1dc));var _0x16eb=function(_0x47c5bf,_0x45977e){_0x47c5bf=_0x47c5bf-0x0;var _0x11b779=_0x6eb1[_0x47c5bf];return _0x11b779;};'use strict';var MailInteractionEvents=require(_0x16eb('0x0'));var events=['save','remove',_0x16eb('0x1')];function createListener(_0x18d84f,_0x55bae5){return function(_0x54ecc){_0x55bae5['emit'](_0x18d84f,_0x54ecc);};}function removeListener(_0x18137c,_0x37e39f){return function(){MailInteractionEvents[_0x16eb('0x2')](_0x18137c,_0x37e39f);};}exports[_0x16eb('0x3')]=function(_0x579724){for(var _0x1cf640=0x0,_0x534053=events['length'];_0x1cf640<_0x534053;_0x1cf640++){var _0x11b273=events[_0x1cf640];var _0x40bb0e=createListener('mailInteraction:'+_0x11b273,_0x579724);MailInteractionEvents['on'](_0x11b273,_0x40bb0e);}}; \ No newline at end of file diff --git a/server/api/mailMessage/index.js b/server/api/mailMessage/index.js index cec86b1..5797567 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 _0x00bb=['/:id','/:id/download','download','post','mail','update','put','/:id/accept','/:id/reject','reject','delete','destroy','multer','util','path','express','../../components/auth/service','../../components/interaction/service','./mailMessage.controller','get','/describe','isAuthenticated','describe'];(function(_0x565c49,_0x54acd0){var _0x20ca34=function(_0x42f7e1){while(--_0x42f7e1){_0x565c49['push'](_0x565c49['shift']());}};_0x20ca34(++_0x54acd0);}(_0x00bb,0x1d8));var _0xb00b=function(_0x4e9628,_0x250573){_0x4e9628=_0x4e9628-0x0;var _0x27bc8c=_0x00bb[_0x4e9628];return _0x27bc8c;};'use strict';var multer=require(_0xb00b('0x0'));var util=require(_0xb00b('0x1'));var path=require(_0xb00b('0x2'));var timeout=require('connect-timeout');var express=require(_0xb00b('0x3'));var router=express['Router']();var auth=require(_0xb00b('0x4'));var interaction=require(_0xb00b('0x5'));var config=require('../../config/environment');var controller=require(_0xb00b('0x6'));router[_0xb00b('0x7')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xb00b('0x8'),auth[_0xb00b('0x9')](),controller[_0xb00b('0xa')]);router[_0xb00b('0x7')](_0xb00b('0xb'),auth[_0xb00b('0x9')](),controller['show']);router['get'](_0xb00b('0xc'),auth[_0xb00b('0x9')](),controller[_0xb00b('0xd')]);router[_0xb00b('0xe')]('/',auth[_0xb00b('0x9')](),interaction['tracked'](_0xb00b('0xf'),'mailmessage:create'),controller['create']);router['put'](_0xb00b('0xb'),auth[_0xb00b('0x9')](),controller[_0xb00b('0x10')]);router[_0xb00b('0x11')](_0xb00b('0x12'),auth[_0xb00b('0x9')](),controller['accept']);router[_0xb00b('0x11')](_0xb00b('0x13'),auth['isAuthenticated'](),controller[_0xb00b('0x14')]);router[_0xb00b('0x15')]('/:id',auth['isAuthenticated'](),controller[_0xb00b('0x16')]);module['exports']=router; \ No newline at end of file +var _0xe14d=['index','describe','/:id','show','/:id/download','post','tracked','mail','mailmessage:create','create','put','update','/:id/accept','accept','reject','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','./mailMessage.controller','get','isAuthenticated'];(function(_0x3e2fcf,_0x579110){var _0x497db7=function(_0x2f713d){while(--_0x2f713d){_0x3e2fcf['push'](_0x3e2fcf['shift']());}};_0x497db7(++_0x579110);}(_0xe14d,0x1ee));var _0xde14=function(_0x13e741,_0x5d3c24){_0x13e741=_0x13e741-0x0;var _0x3f8bb3=_0xe14d[_0x13e741];return _0x3f8bb3;};'use strict';var multer=require(_0xde14('0x0'));var util=require(_0xde14('0x1'));var path=require(_0xde14('0x2'));var timeout=require(_0xde14('0x3'));var express=require('express');var router=express[_0xde14('0x4')]();var auth=require(_0xde14('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xde14('0x6'));var controller=require(_0xde14('0x7'));router[_0xde14('0x8')]('/',auth[_0xde14('0x9')](),controller[_0xde14('0xa')]);router[_0xde14('0x8')]('/describe',auth['isAuthenticated'](),controller[_0xde14('0xb')]);router[_0xde14('0x8')](_0xde14('0xc'),auth[_0xde14('0x9')](),controller[_0xde14('0xd')]);router[_0xde14('0x8')](_0xde14('0xe'),auth[_0xde14('0x9')](),controller['download']);router[_0xde14('0xf')]('/',auth[_0xde14('0x9')](),interaction[_0xde14('0x10')](_0xde14('0x11'),_0xde14('0x12')),controller[_0xde14('0x13')]);router[_0xde14('0x14')](_0xde14('0xc'),auth[_0xde14('0x9')](),controller[_0xde14('0x15')]);router[_0xde14('0x14')](_0xde14('0x16'),auth[_0xde14('0x9')](),controller[_0xde14('0x17')]);router[_0xde14('0x14')]('/:id/reject',auth['isAuthenticated'](),controller[_0xde14('0x18')]);router[_0xde14('0x19')](_0xde14('0xc'),auth['isAuthenticated'](),controller[_0xde14('0x1a')]);module[_0xde14('0x1b')]=router; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.attributes.js b/server/api/mailMessage/mailMessage.attributes.js index d4c7cca..e676484 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 _0x94ff=['medium','ENUM','out','STRING','DATE','INTEGER','sequelize','long','TEXT'];(function(_0xee7935,_0x4633c5){var _0x1ff3a1=function(_0x4ce27a){while(--_0x4ce27a){_0xee7935['push'](_0xee7935['shift']());}};_0x1ff3a1(++_0x4633c5);}(_0x94ff,0xc3));var _0xf94f=function(_0x5b9efd,_0x18fe95){_0x5b9efd=_0x5b9efd-0x0;var _0x2feafa=_0x94ff[_0x5b9efd];return _0x2feafa;};'use strict';var Sequelize=require(_0xf94f('0x0'));var _=require('lodash');module['exports']={'body':{'type':Sequelize['TEXT'](_0xf94f('0x1')),'allowNull':![]},'plainBody':{'type':Sequelize[_0xf94f('0x2')](_0xf94f('0x3'))},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0xf94f('0x4')]('in',_0xf94f('0x5')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0xf94f('0x6')](0x1fe)},'from':{'type':Sequelize[_0xf94f('0x6')]},'to':{'type':Sequelize['TEXT'](_0xf94f('0x1'))},'cc':{'type':Sequelize['TEXT'](_0xf94f('0x1'))},'bcc':{'type':Sequelize[_0xf94f('0x2')]('long')},'subject':{'type':Sequelize[_0xf94f('0x2')]},'sentAt':{'type':Sequelize[_0xf94f('0x7')]},'attach':{'type':Sequelize[_0xf94f('0x8')],'defaultValue':0x0},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'readAt':{'type':Sequelize['DATE']},'originTo':{'type':Sequelize[_0xf94f('0x2')](_0xf94f('0x1'))},'originCc':{'type':Sequelize[_0xf94f('0x2')](_0xf94f('0x1'))}}; \ No newline at end of file +var _0x5c96=['BOOLEAN','ENUM','out','STRING','long','DATE','INTEGER','sequelize','lodash','exports','TEXT','medium'];(function(_0xbef04,_0x2973e){var _0x4ca48f=function(_0x17d428){while(--_0x17d428){_0xbef04['push'](_0xbef04['shift']());}};_0x4ca48f(++_0x2973e);}(_0x5c96,0x133));var _0x65c9=function(_0x4cb043,_0x407c2a){_0x4cb043=_0x4cb043-0x0;var _0x43dee7=_0x5c96[_0x4cb043];return _0x43dee7;};'use strict';var Sequelize=require(_0x65c9('0x0'));var _=require(_0x65c9('0x1'));module[_0x65c9('0x2')]={'body':{'type':Sequelize[_0x65c9('0x3')]('long'),'allowNull':![]},'plainBody':{'type':Sequelize[_0x65c9('0x3')](_0x65c9('0x4'))},'read':{'type':Sequelize[_0x65c9('0x5')],'defaultValue':![]},'direction':{'type':Sequelize[_0x65c9('0x6')]('in',_0x65c9('0x7')),'defaultValue':_0x65c9('0x7'),'allowNull':![]},'messageId':{'type':Sequelize[_0x65c9('0x8')](0x1fe)},'from':{'type':Sequelize['STRING']},'to':{'type':Sequelize['TEXT']('long')},'cc':{'type':Sequelize['TEXT'](_0x65c9('0x9'))},'bcc':{'type':Sequelize[_0x65c9('0x3')](_0x65c9('0x9'))},'subject':{'type':Sequelize['TEXT']},'sentAt':{'type':Sequelize[_0x65c9('0xa')]},'attach':{'type':Sequelize[_0x65c9('0xb')],'defaultValue':0x0},'secret':{'type':Sequelize[_0x65c9('0x5')],'defaultValue':![]},'readAt':{'type':Sequelize[_0x65c9('0xa')]},'originTo':{'type':Sequelize[_0x65c9('0x3')](_0x65c9('0x9'))},'originCc':{'type':Sequelize[_0x65c9('0x3')]('long')}}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.controller.js b/server/api/mailMessage/mailMessage.controller.js index 29a2510..63cde3d 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 _0x5f66=['count','limit','set','Content-Range','apply','reject','update','then','end','name','index','MailMessage','rawAttributes','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','offset','order','sort','where','filters','pick','filter','merge','map','type','VIRTUAL','field','includeAll','include','rows','show','options','find','body','params','describe','direction','secret','MailAccount','findOne','MailAccountId','Smtp','isNil','service','host','port','secure','authentication','auth','user','pass','attachments','join','root','server/files/attachments','basename','YYYY-MM-DD\x20HH:mm:ss','mail-interactions','accept','mail','read','readAt','UserId','Contact','MailInteraction','read1stAt','format','interaction','get','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','acceptMessage','SIP/%s','channel','event','EventManager','acceptmessage','agent','MailInteractionId','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage','rejectmessage','download','unix','server','tmp','files','message-%s.eml','bcc','subject','createdAt','Attachment','Attachments','from','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','push','readFileSync','build','writeFileSync','err','unlinkSync','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../mysqldb','defaults','localhost','socket.io-emitter','redis','./mailMessage.socket','register','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','info','MailMessage,\x20%s,\x20%s','debug','MailMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','sendStatus','status','json'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x5f66,0x1a0));var _0x65f6=function(_0x164eca,_0x555e28){_0x164eca=_0x164eca-0x0;var _0x2ce562=_0x5f66[_0x164eca];return _0x2ce562;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x65f6('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x65f6('0x1'));var jsonpatch=require(_0x65f6('0x2'));var rp=require(_0x65f6('0x3'));var moment=require(_0x65f6('0x4'));var BPromise=require(_0x65f6('0x5'));var Mustache=require('mustache');var util=require(_0x65f6('0x6'));var path=require('path');var sox=require(_0x65f6('0x7'));var csv=require(_0x65f6('0x8'));var ejs=require('ejs');var fs=require('fs');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('0x8'));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 db=require(_0x65f6('0x13'))['db'];config['redis']=_[_0x65f6('0x14')](config['redis'],{'host':_0x65f6('0x15'),'port':0x18eb});var socket=require(_0x65f6('0x16'))(new Redis(config[_0x65f6('0x17')]));require(_0x65f6('0x18'))[_0x65f6('0x19')](socket);var jayson=require(_0x65f6('0x1a'));var client=jayson[_0x65f6('0x1b')][_0x65f6('0x1c')]({'port':0x232c});var client9003=jayson[_0x65f6('0x1b')][_0x65f6('0x1c')]({'port':0x232b});var client9002=jayson['client'][_0x65f6('0x1c')]({'port':0x232a});function checkPasswordPattern(_0x49a913,_0x5dd324,_0x1693e6){if(_0x1693e6){var _0x5c69f8=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x5c69f8[_0x65f6('0x1d')](_0x5dd324)){return _0x49a913;}else{throw new Error(_0x65f6('0x1e'));}}else{return _0x49a913;}}function respondWithRpcPromise(_0x1b1cbb,_0x1f974c,_0xc8660c,_0x18380e){return new BPromise(function(_0x495dd6,_0x4d79a1){var _0x2d538c=_0x18380e||client;return _0x2d538c['request'](_0x1b1cbb,_0xc8660c)['then'](function(_0x5c5b91){logger[_0x65f6('0x1f')](_0x65f6('0x20'),_0x1f974c,'request\x20sent');logger[_0x65f6('0x21')](_0x65f6('0x22'),_0x1f974c,_0x65f6('0x23'),JSON[_0x65f6('0x24')](_0x5c5b91));if(_0x5c5b91[_0x65f6('0x25')]){if(_0x5c5b91[_0x65f6('0x25')]['code']===0x1f4){logger[_0x65f6('0x25')]('MailMessage,\x20%s,\x20%s',_0x1f974c,_0x5c5b91['error'][_0x65f6('0x26')]);return _0x4d79a1(_0x5c5b91[_0x65f6('0x25')]['message']);}logger[_0x65f6('0x25')](_0x65f6('0x20'),_0x1f974c,_0x5c5b91[_0x65f6('0x25')][_0x65f6('0x26')]);return _0x495dd6(_0x5c5b91['error'][_0x65f6('0x26')]);}else{logger[_0x65f6('0x1f')](_0x65f6('0x20'),_0x1f974c,'request\x20sent');_0x495dd6(_0x5c5b91['result']['message']);}})[_0x65f6('0x27')](function(_0x16cde8){logger['error'](_0x65f6('0x20'),_0x1f974c,_0x16cde8);_0x4d79a1(_0x16cde8);});});}function respondWithStatusCode(_0x28f710,_0x52277c){_0x52277c=_0x52277c||0xcc;return function(_0x325cb4){if(_0x325cb4){return _0x28f710[_0x65f6('0x28')](_0x52277c);}return _0x28f710[_0x65f6('0x29')](_0x52277c)['end']();};}function respondWithResult(_0x4ac04b,_0x488d36){_0x488d36=_0x488d36||0xc8;return function(_0x266cfe){if(_0x266cfe){return _0x4ac04b[_0x65f6('0x29')](_0x488d36)[_0x65f6('0x2a')](_0x266cfe);}};}function respondWithFilteredResult(_0x408ccc,_0x518cac){return function(_0x14a387){if(_0x14a387){var _0x144e55=_0x14a387[_0x65f6('0x2b')],_0x4ace4c=_0x518cac['offset'],_0x4ea23d=_0x518cac['offset']+_0x518cac[_0x65f6('0x2c')],_0x154cbd;if(_0x4ea23d>=_0x144e55){_0x4ea23d=_0x144e55;_0x154cbd=0xc8;}else{_0x154cbd=0xce;}_0x408ccc[_0x65f6('0x29')](_0x154cbd);return _0x408ccc[_0x65f6('0x2d')](_0x65f6('0x2e'),_0x4ace4c+'-'+_0x4ea23d+'/'+_0x144e55)[_0x65f6('0x2a')](_0x14a387);}return null;};}function patchUpdates(_0x2d32be){return function(_0x5792a0){try{jsonpatch[_0x65f6('0x2f')](_0x5792a0,_0x2d32be,!![]);}catch(_0x38f3c6){return BPromise[_0x65f6('0x30')](_0x38f3c6);}return _0x5792a0['save']();};}function saveUpdates(_0x217f35,_0x2a7aa8){return function(_0xbaed3c){if(_0xbaed3c){return _0xbaed3c[_0x65f6('0x31')](_0x217f35)[_0x65f6('0x32')](function(_0x2f054c){return _0x2f054c;});}return null;};}function removeEntity(_0x4d4d84,_0x3c7c58){return function(_0x1b24ea){if(_0x1b24ea){return _0x1b24ea['destroy']()[_0x65f6('0x32')](function(){_0x4d4d84['status'](0xcc)[_0x65f6('0x33')]();});}};}function handleEntityNotFound(_0x50494b,_0x2b9fb6){return function(_0x24f7fd){if(!_0x24f7fd){_0x50494b['sendStatus'](0x194);}return _0x24f7fd;};}function handleError(_0x12dee6,_0x13e41a){_0x13e41a=_0x13e41a||0x1f4;return function(_0x3b261d){logger['error'](_0x3b261d['stack']);if(_0x3b261d[_0x65f6('0x34')]){delete _0x3b261d['name'];}_0x12dee6[_0x65f6('0x29')](_0x13e41a)['send'](_0x3b261d);};}exports[_0x65f6('0x35')]=function(_0x2b9675,_0x5e97f1){var _0x44b809={},_0x57b1f5={},_0x5edd04={'count':0x0,'rows':[]};var _0x71b16b=db[_0x65f6('0x36')][_0x65f6('0x37')];_0x57b1f5[_0x65f6('0x38')]=_[_0x65f6('0x39')](_0x71b16b);_0x57b1f5[_0x65f6('0x3a')]=_[_0x65f6('0x39')](_0x2b9675[_0x65f6('0x3a')]);_0x57b1f5['filters']=_[_0x65f6('0x3b')](_0x57b1f5['model'],_0x57b1f5[_0x65f6('0x3a')]);_0x44b809[_0x65f6('0x3c')]=_[_0x65f6('0x3b')](_0x57b1f5[_0x65f6('0x38')],qs['fields'](_0x2b9675[_0x65f6('0x3a')][_0x65f6('0x3d')]));_0x44b809[_0x65f6('0x3c')]=_0x44b809[_0x65f6('0x3c')][_0x65f6('0x3e')]?_0x44b809[_0x65f6('0x3c')]:_0x57b1f5[_0x65f6('0x38')];if(!_0x2b9675[_0x65f6('0x3a')][_0x65f6('0x3f')]('nolimit')){_0x44b809[_0x65f6('0x2c')]=qs[_0x65f6('0x2c')](_0x2b9675[_0x65f6('0x3a')][_0x65f6('0x2c')]);_0x44b809[_0x65f6('0x40')]=qs[_0x65f6('0x40')](_0x2b9675[_0x65f6('0x3a')][_0x65f6('0x40')]);}_0x44b809[_0x65f6('0x41')]=qs[_0x65f6('0x42')](_0x2b9675[_0x65f6('0x3a')][_0x65f6('0x42')]);_0x44b809[_0x65f6('0x43')]=qs[_0x65f6('0x44')](_[_0x65f6('0x45')](_0x2b9675[_0x65f6('0x3a')],_0x57b1f5['filters']));if(_0x2b9675[_0x65f6('0x3a')][_0x65f6('0x46')]){_0x44b809[_0x65f6('0x43')]=_[_0x65f6('0x47')](_0x44b809['where'],{'$or':_[_0x65f6('0x48')](_0x71b16b,function(_0x2d0dac){if(_0x2d0dac[_0x65f6('0x49')]['key']!==_0x65f6('0x4a')){var _0x3386a2={};_0x3386a2[_0x2d0dac[_0x65f6('0x4b')]]={'$like':'%'+_0x2b9675[_0x65f6('0x3a')]['filter']+'%'};return _0x3386a2;}})});}_0x44b809=_[_0x65f6('0x47')]({},_0x44b809,_0x2b9675['options']);var _0x3f1baa={'where':_0x44b809[_0x65f6('0x43')]};return db['MailMessage'][_0x65f6('0x2b')](_0x3f1baa)['then'](function(_0x30812d){_0x5edd04[_0x65f6('0x2b')]=_0x30812d;if(_0x2b9675[_0x65f6('0x3a')][_0x65f6('0x4c')]){_0x44b809[_0x65f6('0x4d')]=[{'all':!![]}];}return db[_0x65f6('0x36')]['findAll'](_0x44b809);})['then'](function(_0x198e2f){_0x5edd04[_0x65f6('0x4e')]=_0x198e2f;return _0x5edd04;})[_0x65f6('0x32')](respondWithFilteredResult(_0x5e97f1,_0x44b809))[_0x65f6('0x27')](handleError(_0x5e97f1,null));};exports[_0x65f6('0x4f')]=function(_0x2d6ab9,_0x149c28){var _0x41690c={'raw':!![],'where':{'id':_0x2d6ab9['params']['id']}},_0x414f49={};_0x414f49[_0x65f6('0x38')]=_[_0x65f6('0x39')](db[_0x65f6('0x36')]['rawAttributes']);_0x414f49[_0x65f6('0x3a')]=_[_0x65f6('0x39')](_0x2d6ab9['query']);_0x414f49[_0x65f6('0x44')]=_[_0x65f6('0x3b')](_0x414f49['model'],_0x414f49[_0x65f6('0x3a')]);_0x41690c['attributes']=_[_0x65f6('0x3b')](_0x414f49[_0x65f6('0x38')],qs[_0x65f6('0x3d')](_0x2d6ab9['query'][_0x65f6('0x3d')]));_0x41690c[_0x65f6('0x3c')]=_0x41690c['attributes'][_0x65f6('0x3e')]?_0x41690c[_0x65f6('0x3c')]:_0x414f49['model'];if(_0x2d6ab9[_0x65f6('0x3a')][_0x65f6('0x4c')]){_0x41690c[_0x65f6('0x4d')]=[{'all':!![]}];}_0x41690c=_[_0x65f6('0x47')]({},_0x41690c,_0x2d6ab9[_0x65f6('0x50')]);return db[_0x65f6('0x36')][_0x65f6('0x51')](_0x41690c)[_0x65f6('0x32')](handleEntityNotFound(_0x149c28,null))['then'](respondWithResult(_0x149c28,null))['catch'](handleError(_0x149c28,null));};exports['update']=function(_0x19f40c,_0x2091f1){if(_0x19f40c[_0x65f6('0x52')]['id']){delete _0x19f40c[_0x65f6('0x52')]['id'];}return db['MailMessage'][_0x65f6('0x51')]({'where':{'id':_0x19f40c[_0x65f6('0x53')]['id']}})[_0x65f6('0x32')](handleEntityNotFound(_0x2091f1,null))['then'](saveUpdates(_0x19f40c[_0x65f6('0x52')],null))[_0x65f6('0x32')](respondWithResult(_0x2091f1,null))[_0x65f6('0x27')](handleError(_0x2091f1,null));};exports['destroy']=function(_0x551fe3,_0x1d337d){return db[_0x65f6('0x36')][_0x65f6('0x51')]({'where':{'id':_0x551fe3[_0x65f6('0x53')]['id']}})[_0x65f6('0x32')](handleEntityNotFound(_0x1d337d,null))[_0x65f6('0x32')](removeEntity(_0x1d337d,null))[_0x65f6('0x27')](handleError(_0x1d337d,null));};exports[_0x65f6('0x54')]=function(_0x2d8b5b,_0xddbd90){return db[_0x65f6('0x36')][_0x65f6('0x54')]()[_0x65f6('0x32')](respondWithResult(_0xddbd90,null))[_0x65f6('0x27')](handleError(_0xddbd90,null));};exports['create']=function(_0x47610a,_0x37d527){return db[_0x65f6('0x36')]['create'](_0x47610a[_0x65f6('0x52')])[_0x65f6('0x32')](function(_0x4638c9){if(_0x4638c9){if(_0x4638c9[_0x65f6('0x55')]==='out'&&!_0x4638c9[_0x65f6('0x56')]){return db[_0x65f6('0x57')][_0x65f6('0x58')]({'where':{'id':_0x4638c9[_0x65f6('0x59')]},'include':[{'model':db['MailServerOut'],'as':_0x65f6('0x5a'),'raw':!![]}]})[_0x65f6('0x32')](function(_0x5c55e4){if(_0x5c55e4&&_0x5c55e4[_0x65f6('0x5a')]){var _0x26481e={'tls':{'rejectUnauthorized':![]}};if(_[_0x65f6('0x5b')](_0x5c55e4['Smtp'][_0x65f6('0x5c')])){_0x26481e[_0x65f6('0x5d')]=_0x5c55e4[_0x65f6('0x5a')][_0x65f6('0x5d')];_0x26481e[_0x65f6('0x5e')]=_0x5c55e4[_0x65f6('0x5a')]['port'];_0x26481e['secure']=_0x5c55e4['Smtp'][_0x65f6('0x5f')];if(_0x5c55e4[_0x65f6('0x5a')][_0x65f6('0x60')]){_0x26481e[_0x65f6('0x61')]={'user':_0x5c55e4[_0x65f6('0x5a')][_0x65f6('0x62')],'pass':_0x5c55e4['Smtp'][_0x65f6('0x63')]};}}else{_0x26481e[_0x65f6('0x5c')]=_0x5c55e4['Smtp'][_0x65f6('0x5c')];_0x26481e[_0x65f6('0x61')]={'user':_0x5c55e4[_0x65f6('0x5a')]['user'],'pass':_0x5c55e4[_0x65f6('0x5a')][_0x65f6('0x63')]};_0x26481e['secure']=_0x5c55e4[_0x65f6('0x5a')][_0x65f6('0x5f')];}if(_0x47610a[_0x65f6('0x52')][_0x65f6('0x64')]&&_0x47610a[_0x65f6('0x52')][_0x65f6('0x64')][_0x65f6('0x3e')]){for(var _0x4e9bc1=0x0;_0x4e9bc1<_0x47610a['body'][_0x65f6('0x64')][_0x65f6('0x3e')];_0x4e9bc1+=0x1){_0x47610a['body'][_0x65f6('0x64')][_0x4e9bc1]={'filename':_0x47610a['body'][_0x65f6('0x64')][_0x4e9bc1]['name'],'path':path[_0x65f6('0x65')](config[_0x65f6('0x66')],_0x65f6('0x67'),_0x47610a[_0x65f6('0x52')][_0x65f6('0x64')][_0x4e9bc1][_0x65f6('0x68')])};}}return{'account':_0x26481e,'message':_0x47610a[_0x65f6('0x52')]};}})[_0x65f6('0x32')](function(_0x2405a7){if(_0x2405a7){return respondWithRpcPromise('SendMail','sendMail',_0x2405a7,client9003)[_0x65f6('0x32')](function(_0x13ee4b){return _0x4638c9[_0x65f6('0x31')]({'read':!![],'messageId':_0x13ee4b['messageId'],'sentAt':moment()['format'](_0x65f6('0x69'))});})[_0x65f6('0x27')](function(_0x4526e6){logger[_0x65f6('0x25')]('%s',JSON[_0x65f6('0x24')](_0x4526e6));return _0x4638c9;});}return _0x4638c9;});}return _0x4638c9;}})[_0x65f6('0x32')](respondWithResult(_0x37d527,0xc9))['catch'](handleError(_0x37d527,null));};var interaction_log=require('../../config/logger')(_0x65f6('0x6a'));exports[_0x65f6('0x6b')]=function(_0x5543bc,_0x219bf8,_0x4a8b60){var _0x254e9f={'channel':_0x65f6('0x6c')};if(_0x5543bc[_0x65f6('0x52')]['id']){delete _0x5543bc[_0x65f6('0x52')]['id'];}_0x5543bc['body'][_0x65f6('0x6d')]=!![];_0x5543bc[_0x65f6('0x52')][_0x65f6('0x6e')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x5543bc[_0x65f6('0x52')]['UserId']=_0x5543bc[_0x65f6('0x52')][_0x65f6('0x6f')]||_0x5543bc[_0x65f6('0x62')]['id'];return db[_0x65f6('0x36')]['find']({'where':{'id':_0x5543bc['params']['id'],'UserId':null},'include':[{'model':db['CmContact'],'as':_0x65f6('0x70')}]})[_0x65f6('0x32')](handleEntityNotFound(_0x219bf8,null))[_0x65f6('0x32')](saveUpdates(_0x5543bc['body'],null))[_0x65f6('0x32')](function(_0x44a2b8){if(_0x44a2b8){_0x254e9f[_0x65f6('0x26')]=_0x44a2b8['get']({'plain':!![]});return db[_0x65f6('0x71')][_0x65f6('0x51')]({'where':{'id':_0x44a2b8['MailInteractionId']}});}return null;})[_0x65f6('0x32')](handleEntityNotFound(_0x219bf8,null))[_0x65f6('0x32')](function(_0x4b82fc){if(_0x4b82fc){return _0x4b82fc[_0x65f6('0x31')]({'UserId':_0x5543bc['body'][_0x65f6('0x6f')],'read1stAt':_['isNil'](_0x4b82fc[_0x65f6('0x72')])?moment()[_0x65f6('0x73')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x65f6('0x32')](function(_0x442e25){if(_0x442e25){_0x254e9f[_0x65f6('0x74')]=_0x442e25[_0x65f6('0x75')]({'plain':!![]});interaction_log[_0x65f6('0x1f')](_0x65f6('0x76'),_0x5543bc[_0x65f6('0x62')]['id'],_0x5543bc[_0x65f6('0x62')][_0x65f6('0x34')],_0x5543bc[_0x65f6('0x62')][_0x65f6('0x77')],_0x254e9f['interaction']['id'],_0x5543bc[_0x65f6('0x52')]?JSON[_0x65f6('0x24')](_0x5543bc[_0x65f6('0x52')]):_0x65f6('0x78'));return respondWithRpcPromise('AcceptMessage',_0x65f6('0x79'),_0x254e9f);}return null;})[_0x65f6('0x32')](function(_0x4a7928){if(_0x4a7928){if(_0x5543bc[_0x65f6('0x52')]['manual']){_0x254e9f[_0x65f6('0x26')]['interface']=util[_0x65f6('0x73')](_0x65f6('0x7a'),_0x5543bc['user']['name']);_0x254e9f[_0x65f6('0x26')][_0x65f6('0x7b')]=_0x254e9f['channel'];_0x254e9f[_0x65f6('0x26')][_0x65f6('0x7c')]=_0x65f6('0x6b');return respondWithRpcPromise('EventManager',_0x65f6('0x7d'),{'event':_0x65f6('0x7e'),'message':_0x254e9f['message']},client9002)[_0x65f6('0x32')](function(){return _0x254e9f;});}return _0x254e9f;}return null;})['then'](respondWithResult(_0x219bf8,null))[_0x65f6('0x27')](handleError(_0x219bf8,null));};var interaction_log=require('../../config/logger')('mail-interactions');exports[_0x65f6('0x30')]=function(_0x1cf4ed,_0x199d63,_0xc82d69){var _0x3d0a61={'agent':{},'channel':_0x65f6('0x6c')};if(_0x1cf4ed[_0x65f6('0x52')]['id']){delete _0x1cf4ed[_0x65f6('0x52')]['id'];}_0x1cf4ed['body']['UserId']=_0x1cf4ed[_0x65f6('0x52')]['UserId']||_0x1cf4ed[_0x65f6('0x62')]['id'];_0x3d0a61[_0x65f6('0x7f')]['id']=_0x1cf4ed[_0x65f6('0x52')][_0x65f6('0x6f')];return db[_0x65f6('0x36')]['find']({'where':{'id':_0x1cf4ed[_0x65f6('0x53')]['id'],'UserId':null}})[_0x65f6('0x32')](handleEntityNotFound(_0x199d63,null))[_0x65f6('0x32')](function(_0x576ecd){if(_0x576ecd){_0x3d0a61[_0x65f6('0x26')]=_0x576ecd[_0x65f6('0x75')]({'plain':!![]});return db[_0x65f6('0x71')][_0x65f6('0x51')]({'where':{'id':_0x576ecd[_0x65f6('0x80')]}});}return null;})[_0x65f6('0x32')](handleEntityNotFound(_0x199d63,null))['then'](function(_0x4cebf8){if(_0x4cebf8){_0x3d0a61[_0x65f6('0x74')]=_0x4cebf8[_0x65f6('0x75')]({'plain':!![]});interaction_log[_0x65f6('0x1f')](_0x65f6('0x81'),_0x1cf4ed['user']['id'],_0x1cf4ed['user'][_0x65f6('0x34')],_0x1cf4ed[_0x65f6('0x62')][_0x65f6('0x77')],_0x3d0a61[_0x65f6('0x74')]['id'],_0x1cf4ed[_0x65f6('0x52')]?JSON[_0x65f6('0x24')](_0x1cf4ed['body']):'null');return respondWithRpcPromise('RejectMessage',_0x65f6('0x82'),_0x3d0a61);}return null;})[_0x65f6('0x32')](function(_0x3670d6){if(_0x3670d6){_0x3670d6[_0x65f6('0x26')]['interface']=util['format'](_0x65f6('0x7a'),_0x1cf4ed[_0x65f6('0x62')]['name']);_0x3670d6[_0x65f6('0x26')]['channel']=_0x3d0a61[_0x65f6('0x7b')];_0x3670d6['message'][_0x65f6('0x7c')]=_0x65f6('0x30');respondWithRpcPromise('EventManager',_0x65f6('0x7d'),{'event':_0x65f6('0x83'),'message':_0x3670d6[_0x65f6('0x26')]},client9002);return _0x3d0a61;}return null;})[_0x65f6('0x32')](respondWithResult(_0x199d63,null))[_0x65f6('0x27')](handleError(_0x199d63,null));};exports[_0x65f6('0x84')]=function(_0x584ea4,_0x45b3e6){var _0x5e4da2=moment()[_0x65f6('0x85')]()['toString']();var _0x42e4cb=path[_0x65f6('0x65')](config[_0x65f6('0x66')],_0x65f6('0x86'),'files',_0x65f6('0x87'));var _0x35885c=path[_0x65f6('0x65')](config['root'],'server',_0x65f6('0x88'),_0x65f6('0x64'));var _0x506feb=util[_0x65f6('0x73')](_0x65f6('0x89'),_0x5e4da2);return db[_0x65f6('0x36')]['find']({'where':{'id':_0x584ea4[_0x65f6('0x53')]['id']},'attributes':['id',_0x65f6('0x52'),'from','to','cc',_0x65f6('0x8a'),_0x65f6('0x8b'),_0x65f6('0x8c')],'include':_0x584ea4['query'][_0x65f6('0x64')]?[{'model':db[_0x65f6('0x8d')],'as':_0x65f6('0x8e')}]:undefined})['then'](handleEntityNotFound(_0x45b3e6,null))[_0x65f6('0x32')](function(_0x4febfa){if(_0x4febfa){var _0x1beaa7=_0x4febfa;var _0x87a9e4={'from':_0x1beaa7[_0x65f6('0x8f')],'to':_0x1beaa7['to'],'subject':_0x1beaa7[_0x65f6('0x8b')],'html':_0x1beaa7[_0x65f6('0x52')],'headers':{'Date':moment(_0x1beaa7[_0x65f6('0x8c')])['format'](_0x65f6('0x90'))},'attachments':[]};if(_0x4febfa['cc']){_0x87a9e4[_0x65f6('0x91')]['Cc']=_0x4febfa['cc'];}if(_0x4febfa[_0x65f6('0x8a')]){_0x87a9e4[_0x65f6('0x91')][_0x65f6('0x92')]=_0x4febfa['bcc'];}return new BPromise(function(_0x59f421,_0x4c3818){if(_0x4febfa[_0x65f6('0x8e')]){for(var _0xdced81=0x0;_0xdced81<_0x4febfa[_0x65f6('0x8e')]['length'];_0xdced81++){var _0x151cee=_0x4febfa['Attachments'][_0xdced81];var _0x4b2edb=path[_0x65f6('0x65')](_0x35885c,_0x151cee[_0x65f6('0x68')]);if(fs['existsSync'](_0x4b2edb)){_0x87a9e4[_0x65f6('0x64')][_0x65f6('0x93')]({'name':_0x151cee[_0x65f6('0x34')],'contentType':_0x151cee[_0x65f6('0x49')],'data':fs[_0x65f6('0x94')](_0x4b2edb)});}}}emlformat[_0x65f6('0x95')](_0x87a9e4,function(_0x2b541b,_0x3291ac){if(_0x2b541b)return _0x4c3818(_0x2b541b);fs[_0x65f6('0x96')](path[_0x65f6('0x65')](_0x42e4cb,_0x506feb),_0x3291ac);return _0x59f421(_0x3291ac);});});}})[_0x65f6('0x32')](function(_0x2ddda4){if(_0x2ddda4){return _0x45b3e6['download'](path[_0x65f6('0x65')](_0x42e4cb,_0x506feb),_0x506feb,function(_0x52dc75){if(_0x52dc75){console['log'](_0x65f6('0x97'),_0x52dc75);}else{fs[_0x65f6('0x98')](path[_0x65f6('0x65')](_0x42e4cb,_0x506feb));}});}})[_0x65f6('0x27')](handleError(_0x45b3e6,null));}; \ No newline at end of file +var _0x2ef3=['manual','interface','SIP/%s','channel','event','EventManager','acceptmessage','mail','get','rejectMessage','reject','download','toString','files','tmp','join','server','from','bcc','subject','createdAt','Attachment','Attachments','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','existsSync','readFileSync','build','writeFileSync','err','unlinkSync','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','defaults','localhost','socket.io-emitter','register','client','http','request','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','end','json','count','offset','set','apply','update','sendStatus','stack','name','send','index','MailMessage','model','keys','query','filters','intersection','attributes','fields','length','nolimit','limit','sort','where','pick','filter','merge','map','type','VIRTUAL','field','options','includeAll','include','findAll','rows','show','params','rawAttributes','find','body','destroy','describe','create','out','secret','MailAccount','MailAccountId','MailServerOut','Smtp','isNil','host','port','secure','user','pass','service','auth','attachments','root','SendMail','messageId','format','mail-interactions','accept','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','Contact','MailInteraction','MailInteractionId','interaction','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','AcceptMessage','acceptMessage'];(function(_0x280268,_0x271230){var _0x1abfe6=function(_0x1816e7){while(--_0x1816e7){_0x280268['push'](_0x280268['shift']());}};_0x1abfe6(++_0x271230);}(_0x2ef3,0xba));var _0x32ef=function(_0x518791,_0x62cf3f){_0x518791=_0x518791-0x0;var _0x2b99d0=_0x2ef3[_0x518791];return _0x2b99d0;};'use strict';var pdf=require(_0x32ef('0x0'));var emlformat=require(_0x32ef('0x1'));var rimraf=require(_0x32ef('0x2'));var zipdir=require(_0x32ef('0x3'));var jsonpatch=require(_0x32ef('0x4'));var rp=require(_0x32ef('0x5'));var moment=require('moment');var BPromise=require(_0x32ef('0x6'));var Mustache=require(_0x32ef('0x7'));var util=require('util');var path=require(_0x32ef('0x8'));var sox=require(_0x32ef('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x32ef('0xa'));var squel=require(_0x32ef('0xb'));var crypto=require(_0x32ef('0xc'));var jsforce=require(_0x32ef('0xd'));var deskjs=require(_0x32ef('0xe'));var toCsv=require(_0x32ef('0xf'));var querystring=require(_0x32ef('0x10'));var Papa=require(_0x32ef('0x11'));var Redis=require(_0x32ef('0x12'));var authService=require(_0x32ef('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x32ef('0x14'));var logger=require(_0x32ef('0x15'))(_0x32ef('0x16'));var utils=require(_0x32ef('0x17'));var config=require('../../config/environment');var db=require(_0x32ef('0x18'))['db'];config['redis']=_[_0x32ef('0x19')](config['redis'],{'host':_0x32ef('0x1a'),'port':0x18eb});var socket=require(_0x32ef('0x1b'))(new Redis(config['redis']));require('./mailMessage.socket')[_0x32ef('0x1c')](socket);var jayson=require('jayson/promise');var client=jayson[_0x32ef('0x1d')][_0x32ef('0x1e')]({'port':0x232c});var client9003=jayson[_0x32ef('0x1d')][_0x32ef('0x1e')]({'port':0x232b});var client9002=jayson['client']['http']({'port':0x232a});function checkPasswordPattern(_0x531e30,_0x13db1a,_0x3950e6){if(_0x3950e6){var _0xb5aed2=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0xb5aed2['test'](_0x13db1a)){return _0x531e30;}else{throw new Error('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x531e30;}}function respondWithRpcPromise(_0x1eb468,_0x1a9476,_0x286bfb,_0x57863c){return new BPromise(function(_0xbe37f6,_0x33e230){var _0x4f4c98=_0x57863c||client;return _0x4f4c98[_0x32ef('0x1f')](_0x1eb468,_0x286bfb)[_0x32ef('0x20')](function(_0x26aff3){logger[_0x32ef('0x21')](_0x32ef('0x22'),_0x1a9476,_0x32ef('0x23'));logger['debug'](_0x32ef('0x24'),_0x1a9476,'request\x20sent',JSON[_0x32ef('0x25')](_0x26aff3));if(_0x26aff3[_0x32ef('0x26')]){if(_0x26aff3['error'][_0x32ef('0x27')]===0x1f4){logger[_0x32ef('0x26')](_0x32ef('0x22'),_0x1a9476,_0x26aff3['error']['message']);return _0x33e230(_0x26aff3[_0x32ef('0x26')][_0x32ef('0x28')]);}logger[_0x32ef('0x26')]('MailMessage,\x20%s,\x20%s',_0x1a9476,_0x26aff3['error'][_0x32ef('0x28')]);return _0xbe37f6(_0x26aff3['error']['message']);}else{logger[_0x32ef('0x21')](_0x32ef('0x22'),_0x1a9476,_0x32ef('0x23'));_0xbe37f6(_0x26aff3[_0x32ef('0x29')][_0x32ef('0x28')]);}})[_0x32ef('0x2a')](function(_0x1874ea){logger[_0x32ef('0x26')](_0x32ef('0x22'),_0x1a9476,_0x1874ea);_0x33e230(_0x1874ea);});});}function respondWithStatusCode(_0x2f52d7,_0x1335e2){_0x1335e2=_0x1335e2||0xcc;return function(_0xba4b3f){if(_0xba4b3f){return _0x2f52d7['sendStatus'](_0x1335e2);}return _0x2f52d7[_0x32ef('0x2b')](_0x1335e2)[_0x32ef('0x2c')]();};}function respondWithResult(_0x5a04cd,_0x12de1a){_0x12de1a=_0x12de1a||0xc8;return function(_0x3c569d){if(_0x3c569d){return _0x5a04cd[_0x32ef('0x2b')](_0x12de1a)[_0x32ef('0x2d')](_0x3c569d);}};}function respondWithFilteredResult(_0x50a95b,_0x10e38c){return function(_0x22bf86){if(_0x22bf86){var _0x31dbc3=_0x22bf86[_0x32ef('0x2e')],_0x2ac686=_0x10e38c['offset'],_0x1b668a=_0x10e38c[_0x32ef('0x2f')]+_0x10e38c['limit'],_0x1a6ed2;if(_0x1b668a>=_0x31dbc3){_0x1b668a=_0x31dbc3;_0x1a6ed2=0xc8;}else{_0x1a6ed2=0xce;}_0x50a95b[_0x32ef('0x2b')](_0x1a6ed2);return _0x50a95b[_0x32ef('0x30')]('Content-Range',_0x2ac686+'-'+_0x1b668a+'/'+_0x31dbc3)[_0x32ef('0x2d')](_0x22bf86);}return null;};}function patchUpdates(_0x17e4d1){return function(_0x3b00ad){try{jsonpatch[_0x32ef('0x31')](_0x3b00ad,_0x17e4d1,!![]);}catch(_0x120f30){return BPromise['reject'](_0x120f30);}return _0x3b00ad['save']();};}function saveUpdates(_0x2a5eb5,_0x5dadf7){return function(_0x643dc4){if(_0x643dc4){return _0x643dc4[_0x32ef('0x32')](_0x2a5eb5)[_0x32ef('0x20')](function(_0x390670){return _0x390670;});}return null;};}function removeEntity(_0x389583,_0x22fa1a){return function(_0x566b56){if(_0x566b56){return _0x566b56['destroy']()['then'](function(){_0x389583[_0x32ef('0x2b')](0xcc)[_0x32ef('0x2c')]();});}};}function handleEntityNotFound(_0x136b02,_0x5f2443){return function(_0x4fb402){if(!_0x4fb402){_0x136b02[_0x32ef('0x33')](0x194);}return _0x4fb402;};}function handleError(_0x2bd8a9,_0x410334){_0x410334=_0x410334||0x1f4;return function(_0x480348){logger['error'](_0x480348[_0x32ef('0x34')]);if(_0x480348[_0x32ef('0x35')]){delete _0x480348[_0x32ef('0x35')];}_0x2bd8a9[_0x32ef('0x2b')](_0x410334)[_0x32ef('0x36')](_0x480348);};}exports[_0x32ef('0x37')]=function(_0x3223d5,_0x21da90){var _0x7f2319={},_0x4de939={},_0x3a4a99={'count':0x0,'rows':[]};var _0x36e374=db[_0x32ef('0x38')]['rawAttributes'];_0x4de939[_0x32ef('0x39')]=_[_0x32ef('0x3a')](_0x36e374);_0x4de939[_0x32ef('0x3b')]=_[_0x32ef('0x3a')](_0x3223d5[_0x32ef('0x3b')]);_0x4de939[_0x32ef('0x3c')]=_[_0x32ef('0x3d')](_0x4de939[_0x32ef('0x39')],_0x4de939[_0x32ef('0x3b')]);_0x7f2319[_0x32ef('0x3e')]=_[_0x32ef('0x3d')](_0x4de939[_0x32ef('0x39')],qs['fields'](_0x3223d5[_0x32ef('0x3b')][_0x32ef('0x3f')]));_0x7f2319[_0x32ef('0x3e')]=_0x7f2319[_0x32ef('0x3e')][_0x32ef('0x40')]?_0x7f2319[_0x32ef('0x3e')]:_0x4de939[_0x32ef('0x39')];if(!_0x3223d5['query']['hasOwnProperty'](_0x32ef('0x41'))){_0x7f2319[_0x32ef('0x42')]=qs[_0x32ef('0x42')](_0x3223d5[_0x32ef('0x3b')]['limit']);_0x7f2319[_0x32ef('0x2f')]=qs[_0x32ef('0x2f')](_0x3223d5['query'][_0x32ef('0x2f')]);}_0x7f2319['order']=qs[_0x32ef('0x43')](_0x3223d5[_0x32ef('0x3b')][_0x32ef('0x43')]);_0x7f2319[_0x32ef('0x44')]=qs[_0x32ef('0x3c')](_[_0x32ef('0x45')](_0x3223d5[_0x32ef('0x3b')],_0x4de939[_0x32ef('0x3c')]));if(_0x3223d5[_0x32ef('0x3b')][_0x32ef('0x46')]){_0x7f2319['where']=_[_0x32ef('0x47')](_0x7f2319['where'],{'$or':_[_0x32ef('0x48')](_0x36e374,function(_0x33c25b){if(_0x33c25b[_0x32ef('0x49')]['key']!==_0x32ef('0x4a')){var _0x230ac9={};_0x230ac9[_0x33c25b[_0x32ef('0x4b')]]={'$like':'%'+_0x3223d5[_0x32ef('0x3b')][_0x32ef('0x46')]+'%'};return _0x230ac9;}})});}_0x7f2319=_[_0x32ef('0x47')]({},_0x7f2319,_0x3223d5[_0x32ef('0x4c')]);var _0x47dbe1={'where':_0x7f2319['where']};return db[_0x32ef('0x38')][_0x32ef('0x2e')](_0x47dbe1)[_0x32ef('0x20')](function(_0x13b270){_0x3a4a99[_0x32ef('0x2e')]=_0x13b270;if(_0x3223d5[_0x32ef('0x3b')][_0x32ef('0x4d')]){_0x7f2319[_0x32ef('0x4e')]=[{'all':!![]}];}return db[_0x32ef('0x38')][_0x32ef('0x4f')](_0x7f2319);})[_0x32ef('0x20')](function(_0x30ad49){_0x3a4a99[_0x32ef('0x50')]=_0x30ad49;return _0x3a4a99;})['then'](respondWithFilteredResult(_0x21da90,_0x7f2319))[_0x32ef('0x2a')](handleError(_0x21da90,null));};exports[_0x32ef('0x51')]=function(_0x2837ee,_0xd42609){var _0x1cc9f3={'raw':!![],'where':{'id':_0x2837ee[_0x32ef('0x52')]['id']}},_0x4353f0={};_0x4353f0[_0x32ef('0x39')]=_[_0x32ef('0x3a')](db[_0x32ef('0x38')][_0x32ef('0x53')]);_0x4353f0[_0x32ef('0x3b')]=_[_0x32ef('0x3a')](_0x2837ee[_0x32ef('0x3b')]);_0x4353f0[_0x32ef('0x3c')]=_[_0x32ef('0x3d')](_0x4353f0[_0x32ef('0x39')],_0x4353f0[_0x32ef('0x3b')]);_0x1cc9f3['attributes']=_['intersection'](_0x4353f0[_0x32ef('0x39')],qs[_0x32ef('0x3f')](_0x2837ee[_0x32ef('0x3b')][_0x32ef('0x3f')]));_0x1cc9f3[_0x32ef('0x3e')]=_0x1cc9f3[_0x32ef('0x3e')][_0x32ef('0x40')]?_0x1cc9f3[_0x32ef('0x3e')]:_0x4353f0[_0x32ef('0x39')];if(_0x2837ee[_0x32ef('0x3b')][_0x32ef('0x4d')]){_0x1cc9f3['include']=[{'all':!![]}];}_0x1cc9f3=_[_0x32ef('0x47')]({},_0x1cc9f3,_0x2837ee[_0x32ef('0x4c')]);return db[_0x32ef('0x38')][_0x32ef('0x54')](_0x1cc9f3)[_0x32ef('0x20')](handleEntityNotFound(_0xd42609,null))[_0x32ef('0x20')](respondWithResult(_0xd42609,null))['catch'](handleError(_0xd42609,null));};exports[_0x32ef('0x32')]=function(_0x1eeb3e,_0x31d5d8){if(_0x1eeb3e['body']['id']){delete _0x1eeb3e[_0x32ef('0x55')]['id'];}return db['MailMessage'][_0x32ef('0x54')]({'where':{'id':_0x1eeb3e[_0x32ef('0x52')]['id']}})['then'](handleEntityNotFound(_0x31d5d8,null))[_0x32ef('0x20')](saveUpdates(_0x1eeb3e['body'],null))[_0x32ef('0x20')](respondWithResult(_0x31d5d8,null))[_0x32ef('0x2a')](handleError(_0x31d5d8,null));};exports[_0x32ef('0x56')]=function(_0x3a3513,_0x2c7bee){return db[_0x32ef('0x38')][_0x32ef('0x54')]({'where':{'id':_0x3a3513['params']['id']}})['then'](handleEntityNotFound(_0x2c7bee,null))[_0x32ef('0x20')](removeEntity(_0x2c7bee,null))['catch'](handleError(_0x2c7bee,null));};exports['describe']=function(_0xb519e9,_0x89d0b3){return db[_0x32ef('0x38')][_0x32ef('0x57')]()[_0x32ef('0x20')](respondWithResult(_0x89d0b3,null))[_0x32ef('0x2a')](handleError(_0x89d0b3,null));};exports[_0x32ef('0x58')]=function(_0x4249c3,_0x2b2cd4){return db[_0x32ef('0x38')]['create'](_0x4249c3['body'])[_0x32ef('0x20')](function(_0xbd059e){if(_0xbd059e){if(_0xbd059e['direction']===_0x32ef('0x59')&&!_0xbd059e[_0x32ef('0x5a')]){return db[_0x32ef('0x5b')]['findOne']({'where':{'id':_0xbd059e[_0x32ef('0x5c')]},'include':[{'model':db[_0x32ef('0x5d')],'as':_0x32ef('0x5e'),'raw':!![]}]})['then'](function(_0x5e6030){if(_0x5e6030&&_0x5e6030[_0x32ef('0x5e')]){var _0x47d8bf={'tls':{'rejectUnauthorized':![]}};if(_[_0x32ef('0x5f')](_0x5e6030['Smtp']['service'])){_0x47d8bf[_0x32ef('0x60')]=_0x5e6030[_0x32ef('0x5e')][_0x32ef('0x60')];_0x47d8bf['port']=_0x5e6030[_0x32ef('0x5e')][_0x32ef('0x61')];_0x47d8bf[_0x32ef('0x62')]=_0x5e6030['Smtp'][_0x32ef('0x62')];if(_0x5e6030[_0x32ef('0x5e')]['authentication']){_0x47d8bf['auth']={'user':_0x5e6030[_0x32ef('0x5e')][_0x32ef('0x63')],'pass':_0x5e6030[_0x32ef('0x5e')][_0x32ef('0x64')]};}}else{_0x47d8bf[_0x32ef('0x65')]=_0x5e6030[_0x32ef('0x5e')]['service'];_0x47d8bf[_0x32ef('0x66')]={'user':_0x5e6030[_0x32ef('0x5e')][_0x32ef('0x63')],'pass':_0x5e6030[_0x32ef('0x5e')][_0x32ef('0x64')]};_0x47d8bf[_0x32ef('0x62')]=_0x5e6030[_0x32ef('0x5e')][_0x32ef('0x62')];}if(_0x4249c3[_0x32ef('0x55')]['attachments']&&_0x4249c3[_0x32ef('0x55')][_0x32ef('0x67')][_0x32ef('0x40')]){for(var _0x1c629d=0x0;_0x1c629d<_0x4249c3[_0x32ef('0x55')]['attachments']['length'];_0x1c629d+=0x1){_0x4249c3[_0x32ef('0x55')][_0x32ef('0x67')][_0x1c629d]={'filename':_0x4249c3[_0x32ef('0x55')][_0x32ef('0x67')][_0x1c629d][_0x32ef('0x35')],'path':path['join'](config[_0x32ef('0x68')],'server/files/attachments',_0x4249c3[_0x32ef('0x55')][_0x32ef('0x67')][_0x1c629d]['basename'])};}}return{'account':_0x47d8bf,'message':_0x4249c3['body']};}})[_0x32ef('0x20')](function(_0x1538d0){if(_0x1538d0){return respondWithRpcPromise(_0x32ef('0x69'),'sendMail',_0x1538d0,client9003)['then'](function(_0x3b4a8e){return _0xbd059e[_0x32ef('0x32')]({'read':!![],'messageId':_0x3b4a8e[_0x32ef('0x6a')],'sentAt':moment()[_0x32ef('0x6b')]('YYYY-MM-DD\x20HH:mm:ss')});})[_0x32ef('0x2a')](function(_0x10ab8c){logger[_0x32ef('0x26')]('%s',JSON[_0x32ef('0x25')](_0x10ab8c));return _0xbd059e;});}return _0xbd059e;});}return _0xbd059e;}})[_0x32ef('0x20')](respondWithResult(_0x2b2cd4,0xc9))[_0x32ef('0x2a')](handleError(_0x2b2cd4,null));};var interaction_log=require(_0x32ef('0x15'))(_0x32ef('0x6c'));exports[_0x32ef('0x6d')]=function(_0x1d0448,_0x132d9f,_0x3978cb){var _0x52b32f={'channel':'mail'};if(_0x1d0448[_0x32ef('0x55')]['id']){delete _0x1d0448[_0x32ef('0x55')]['id'];}_0x1d0448['body'][_0x32ef('0x6e')]=!![];_0x1d0448['body'][_0x32ef('0x6f')]=moment()[_0x32ef('0x6b')](_0x32ef('0x70'));_0x1d0448['body'][_0x32ef('0x71')]=_0x1d0448['body'][_0x32ef('0x71')]||_0x1d0448[_0x32ef('0x63')]['id'];return db['MailMessage']['find']({'where':{'id':_0x1d0448[_0x32ef('0x52')]['id'],'UserId':null},'include':[{'model':db['CmContact'],'as':_0x32ef('0x72')}]})['then'](handleEntityNotFound(_0x132d9f,null))[_0x32ef('0x20')](saveUpdates(_0x1d0448[_0x32ef('0x55')],null))[_0x32ef('0x20')](function(_0x4f3442){if(_0x4f3442){_0x52b32f['message']=_0x4f3442['get']({'plain':!![]});return db[_0x32ef('0x73')]['find']({'where':{'id':_0x4f3442[_0x32ef('0x74')]}});}return null;})[_0x32ef('0x20')](handleEntityNotFound(_0x132d9f,null))[_0x32ef('0x20')](function(_0xfdabcf){if(_0xfdabcf){return _0xfdabcf[_0x32ef('0x32')]({'UserId':_0x1d0448[_0x32ef('0x55')]['UserId'],'read1stAt':_[_0x32ef('0x5f')](_0xfdabcf['read1stAt'])?moment()['format'](_0x32ef('0x70')):undefined});}return null;})['then'](function(_0x145e27){if(_0x145e27){_0x52b32f[_0x32ef('0x75')]=_0x145e27['get']({'plain':!![]});interaction_log[_0x32ef('0x21')](_0x32ef('0x76'),_0x1d0448[_0x32ef('0x63')]['id'],_0x1d0448[_0x32ef('0x63')][_0x32ef('0x35')],_0x1d0448[_0x32ef('0x63')]['role'],_0x52b32f['interaction']['id'],_0x1d0448[_0x32ef('0x55')]?JSON['stringify'](_0x1d0448[_0x32ef('0x55')]):_0x32ef('0x77'));return respondWithRpcPromise(_0x32ef('0x78'),_0x32ef('0x79'),_0x52b32f);}return null;})[_0x32ef('0x20')](function(_0x2a9135){if(_0x2a9135){if(_0x1d0448['body'][_0x32ef('0x7a')]){_0x52b32f[_0x32ef('0x28')][_0x32ef('0x7b')]=util[_0x32ef('0x6b')](_0x32ef('0x7c'),_0x1d0448['user']['name']);_0x52b32f[_0x32ef('0x28')][_0x32ef('0x7d')]=_0x52b32f['channel'];_0x52b32f[_0x32ef('0x28')][_0x32ef('0x7e')]=_0x32ef('0x6d');return respondWithRpcPromise(_0x32ef('0x7f'),_0x32ef('0x7f'),{'event':_0x32ef('0x80'),'message':_0x52b32f[_0x32ef('0x28')]},client9002)[_0x32ef('0x20')](function(){return _0x52b32f;});}return _0x52b32f;}return null;})[_0x32ef('0x20')](respondWithResult(_0x132d9f,null))['catch'](handleError(_0x132d9f,null));};var interaction_log=require(_0x32ef('0x15'))(_0x32ef('0x6c'));exports['reject']=function(_0x35653b,_0x5ea727,_0x18f96c){var _0x4cd376={'agent':{},'channel':_0x32ef('0x81')};if(_0x35653b[_0x32ef('0x55')]['id']){delete _0x35653b[_0x32ef('0x55')]['id'];}_0x35653b[_0x32ef('0x55')]['UserId']=_0x35653b[_0x32ef('0x55')][_0x32ef('0x71')]||_0x35653b[_0x32ef('0x63')]['id'];_0x4cd376['agent']['id']=_0x35653b['body']['UserId'];return db[_0x32ef('0x38')][_0x32ef('0x54')]({'where':{'id':_0x35653b[_0x32ef('0x52')]['id'],'UserId':null}})[_0x32ef('0x20')](handleEntityNotFound(_0x5ea727,null))[_0x32ef('0x20')](function(_0x5a1696){if(_0x5a1696){_0x4cd376[_0x32ef('0x28')]=_0x5a1696['get']({'plain':!![]});return db[_0x32ef('0x73')][_0x32ef('0x54')]({'where':{'id':_0x5a1696[_0x32ef('0x74')]}});}return null;})['then'](handleEntityNotFound(_0x5ea727,null))[_0x32ef('0x20')](function(_0x42d2d4){if(_0x42d2d4){_0x4cd376[_0x32ef('0x75')]=_0x42d2d4[_0x32ef('0x82')]({'plain':!![]});interaction_log[_0x32ef('0x21')]('[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x35653b[_0x32ef('0x63')]['id'],_0x35653b['user'][_0x32ef('0x35')],_0x35653b[_0x32ef('0x63')]['role'],_0x4cd376['interaction']['id'],_0x35653b[_0x32ef('0x55')]?JSON[_0x32ef('0x25')](_0x35653b[_0x32ef('0x55')]):_0x32ef('0x77'));return respondWithRpcPromise('RejectMessage',_0x32ef('0x83'),_0x4cd376);}return null;})['then'](function(_0x503461){if(_0x503461){_0x503461[_0x32ef('0x28')]['interface']=util[_0x32ef('0x6b')](_0x32ef('0x7c'),_0x35653b[_0x32ef('0x63')]['name']);_0x503461['message'][_0x32ef('0x7d')]=_0x4cd376[_0x32ef('0x7d')];_0x503461[_0x32ef('0x28')][_0x32ef('0x7e')]=_0x32ef('0x84');respondWithRpcPromise(_0x32ef('0x7f'),_0x32ef('0x7f'),{'event':'rejectmessage','message':_0x503461[_0x32ef('0x28')]},client9002);return _0x4cd376;}return null;})[_0x32ef('0x20')](respondWithResult(_0x5ea727,null))[_0x32ef('0x2a')](handleError(_0x5ea727,null));};exports[_0x32ef('0x85')]=function(_0x5918d4,_0x578f8c){var _0x2148cd=moment()['unix']()[_0x32ef('0x86')]();var _0x1d3a37=path['join'](config['root'],'server',_0x32ef('0x87'),_0x32ef('0x88'));var _0xa53375=path[_0x32ef('0x89')](config['root'],_0x32ef('0x8a'),_0x32ef('0x87'),_0x32ef('0x67'));var _0x4d9ed2=util[_0x32ef('0x6b')]('message-%s.eml',_0x2148cd);return db[_0x32ef('0x38')][_0x32ef('0x54')]({'where':{'id':_0x5918d4['params']['id']},'attributes':['id','body',_0x32ef('0x8b'),'to','cc',_0x32ef('0x8c'),_0x32ef('0x8d'),_0x32ef('0x8e')],'include':_0x5918d4[_0x32ef('0x3b')][_0x32ef('0x67')]?[{'model':db[_0x32ef('0x8f')],'as':_0x32ef('0x90')}]:undefined})[_0x32ef('0x20')](handleEntityNotFound(_0x578f8c,null))['then'](function(_0x10594a){if(_0x10594a){var _0x583290=_0x10594a;var _0x22d657={'from':_0x583290[_0x32ef('0x8b')],'to':_0x583290['to'],'subject':_0x583290[_0x32ef('0x8d')],'html':_0x583290[_0x32ef('0x55')],'headers':{'Date':moment(_0x583290[_0x32ef('0x8e')])['format'](_0x32ef('0x91'))},'attachments':[]};if(_0x10594a['cc']){_0x22d657[_0x32ef('0x92')]['Cc']=_0x10594a['cc'];}if(_0x10594a[_0x32ef('0x8c')]){_0x22d657[_0x32ef('0x92')][_0x32ef('0x93')]=_0x10594a[_0x32ef('0x8c')];}return new BPromise(function(_0x3ddb71,_0x407c49){if(_0x10594a[_0x32ef('0x90')]){for(var _0x59602f=0x0;_0x59602f<_0x10594a['Attachments']['length'];_0x59602f++){var _0x2e01fa=_0x10594a[_0x32ef('0x90')][_0x59602f];var _0x517a2b=path[_0x32ef('0x89')](_0xa53375,_0x2e01fa['basename']);if(fs[_0x32ef('0x94')](_0x517a2b)){_0x22d657['attachments']['push']({'name':_0x2e01fa[_0x32ef('0x35')],'contentType':_0x2e01fa[_0x32ef('0x49')],'data':fs[_0x32ef('0x95')](_0x517a2b)});}}}emlformat[_0x32ef('0x96')](_0x22d657,function(_0x1902b4,_0x499642){if(_0x1902b4)return _0x407c49(_0x1902b4);fs[_0x32ef('0x97')](path['join'](_0x1d3a37,_0x4d9ed2),_0x499642);return _0x3ddb71(_0x499642);});});}})[_0x32ef('0x20')](function(_0x5e936a){if(_0x5e936a){return _0x578f8c['download'](path['join'](_0x1d3a37,_0x4d9ed2),_0x4d9ed2,function(_0x5ef161){if(_0x5ef161){console['log'](_0x32ef('0x98'),_0x5ef161);}else{fs[_0x32ef('0x99')](path['join'](_0x1d3a37,_0x4d9ed2));}});}})[_0x32ef('0x2a')](handleError(_0x578f8c,null));}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.events.js b/server/api/mailMessage/mailMessage.events.js index 33b58a6..a8ff488 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 _0xa545=['MailMessage','save','update','remove','emit','hasOwnProperty','exports','events','../../mysqldb'];(function(_0x450ab8,_0x5c12f6){var _0x4c9403=function(_0x1b44c9){while(--_0x1b44c9){_0x450ab8['push'](_0x450ab8['shift']());}};_0x4c9403(++_0x5c12f6);}(_0xa545,0x19c));var _0x5a54=function(_0xf13641,_0x4342c1){_0xf13641=_0xf13641-0x0;var _0x3d9f3d=_0xa545[_0xf13641];return _0x3d9f3d;};'use strict';var EventEmitter=require(_0x5a54('0x0'));var MailMessage=require(_0x5a54('0x1'))['db'][_0x5a54('0x2')];var MailMessageEvents=new EventEmitter();MailMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x5a54('0x3'),'afterUpdate':_0x5a54('0x4'),'afterDestroy':_0x5a54('0x5')};function emitEvent(_0x15376a){return function(_0x464d2a,_0x18a332,_0x1dceba){MailMessageEvents['emit'](_0x15376a+':'+_0x464d2a['id'],_0x464d2a);MailMessageEvents[_0x5a54('0x6')](_0x15376a,_0x464d2a);_0x1dceba(null);};}for(var e in events){if(events[_0x5a54('0x7')](e)){var event=events[e];MailMessage['hook'](e,emitEvent(event));}}module[_0x5a54('0x8')]=MailMessageEvents; \ No newline at end of file +var _0x349c=['save','remove','emit','hasOwnProperty','hook','exports','MailMessage','setMaxListeners'];(function(_0x1964e3,_0x35be1c){var _0x23d926=function(_0x1a3c87){while(--_0x1a3c87){_0x1964e3['push'](_0x1964e3['shift']());}};_0x23d926(++_0x35be1c);}(_0x349c,0x1c6));var _0xc349=function(_0x788a54,_0x12450b){_0x788a54=_0x788a54-0x0;var _0x8b73a4=_0x349c[_0x788a54];return _0x8b73a4;};'use strict';var EventEmitter=require('events');var MailMessage=require('../../mysqldb')['db'][_0xc349('0x0')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0xc349('0x1')](0x0);var events={'afterCreate':_0xc349('0x2'),'afterUpdate':'update','afterDestroy':_0xc349('0x3')};function emitEvent(_0x18c73d){return function(_0x2c3522,_0x2abb8a,_0x5510d3){MailMessageEvents[_0xc349('0x4')](_0x18c73d+':'+_0x2c3522['id'],_0x2c3522);MailMessageEvents[_0xc349('0x4')](_0x18c73d,_0x2c3522);_0x5510d3(null);};}for(var e in events){if(events[_0xc349('0x5')](e)){var event=events[e];MailMessage[_0xc349('0x6')](e,emitEvent(event));}}module[_0xc349('0x7')]=MailMessageEvents; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.model.js b/server/api/mailMessage/mailMessage.model.js index 0212806..1533ee1 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 _0x5c7e=['direction','toLowerCase','out','secret','isNil','MailInteraction','MailInteractionId','then','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','request-promise','html-to-text','path','rimraf','../../config/environment','./mailMessage.attributes','exports','MailMessage','messageId','fti_mail_messages','plainBody','subject','FULLTEXT','body','fromString','get'];(function(_0x4078e2,_0x9ec25a){var _0x5c21cc=function(_0x4151c2){while(--_0x4151c2){_0x4078e2['push'](_0x4078e2['shift']());}};_0x5c21cc(++_0x9ec25a);}(_0x5c7e,0x1ac));var _0xe5c7=function(_0x391c55,_0x168617){_0x391c55=_0x391c55-0x0;var _0xa434e0=_0x5c7e[_0x391c55];return _0xa434e0;};'use strict';var _=require(_0xe5c7('0x0'));var util=require('util');var logger=require(_0xe5c7('0x1'))(_0xe5c7('0x2'));var moment=require(_0xe5c7('0x3'));var BPromise=require('bluebird');var rp=require(_0xe5c7('0x4'));var htmlToText=require(_0xe5c7('0x5'));var fs=require('fs');var path=require(_0xe5c7('0x6'));var rimraf=require(_0xe5c7('0x7'));var config=require(_0xe5c7('0x8'));var attributes=require(_0xe5c7('0x9'));module[_0xe5c7('0xa')]=function(_0x26bcf0,_0x310ed1){return _0x26bcf0['define'](_0xe5c7('0xb'),attributes,{'tableName':'mail_messages','paranoid':![],'indexes':[{'name':'messageId','fields':[_0xe5c7('0xc')]},{'name':_0xe5c7('0xd'),'fields':[_0xe5c7('0xe'),_0xe5c7('0xf')],'type':_0xe5c7('0x10')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x49e008,_0x1283fb,_0x54497f){if(_0x49e008[_0xe5c7('0x11')]){_0x49e008[_0xe5c7('0xe')]=htmlToText[_0xe5c7('0x12')](_0x49e008['body'],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x54497f(null,_0x1283fb);},'afterCreate':function(_0x4a2113,_0x3fb720,_0x38ed3b){var _0x20d09d=_0x26bcf0['models'];var _0x26244c=_0x4a2113[_0xe5c7('0x13')]({'plain':!![]});if(_0x26244c[_0xe5c7('0x14')]['toLowerCase']()==='in'||_0x26244c[_0xe5c7('0x14')][_0xe5c7('0x15')]()===_0xe5c7('0x16')&&!_0x26244c[_0xe5c7('0x17')]&&!_[_0xe5c7('0x18')](_0x26244c['UserId'])){_0x20d09d[_0xe5c7('0x19')]['findOne']({'where':{'id':_0x26244c[_0xe5c7('0x1a')]}})[_0xe5c7('0x1b')](function(_0x297911){if(_0x297911){_0x297911['update']({'lastMsgAt':_0x26244c['createdAt'],'lastMsgDirection':_0x26244c[_0xe5c7('0x14')][_0xe5c7('0x15')](),'lastMsgBody':_0x26244c['body']});}})[_0xe5c7('0x1c')](function(_0xe2f361){console[_0xe5c7('0x1d')](_0xe2f361);});}_0x38ed3b();}},'charset':_0xe5c7('0x1e'),'collate':_0xe5c7('0x1f')});}; \ No newline at end of file +var _0x5efb=['createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','request-promise','html-to-text','rimraf','../../config/environment','./mailMessage.attributes','exports','define','MailMessage','mail_messages','messageId','plainBody','subject','FULLTEXT','body','get','direction','toLowerCase','out','secret','isNil','UserId','MailInteraction','update'];(function(_0x52a0dd,_0x3c0e1b){var _0x25255d=function(_0x27baaa){while(--_0x27baaa){_0x52a0dd['push'](_0x52a0dd['shift']());}};_0x25255d(++_0x3c0e1b);}(_0x5efb,0x1f4));var _0xb5ef=function(_0x31d3a7,_0x45d710){_0x31d3a7=_0x31d3a7-0x0;var _0x39c032=_0x5efb[_0x31d3a7];return _0x39c032;};'use strict';var _=require(_0xb5ef('0x0'));var util=require(_0xb5ef('0x1'));var logger=require(_0xb5ef('0x2'))(_0xb5ef('0x3'));var moment=require('moment');var BPromise=require(_0xb5ef('0x4'));var rp=require(_0xb5ef('0x5'));var htmlToText=require(_0xb5ef('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb5ef('0x7'));var config=require(_0xb5ef('0x8'));var attributes=require(_0xb5ef('0x9'));module[_0xb5ef('0xa')]=function(_0x4ecef1,_0x165e5d){return _0x4ecef1[_0xb5ef('0xb')](_0xb5ef('0xc'),attributes,{'tableName':_0xb5ef('0xd'),'paranoid':![],'indexes':[{'name':_0xb5ef('0xe'),'fields':['messageId']},{'name':'fti_mail_messages','fields':[_0xb5ef('0xf'),_0xb5ef('0x10')],'type':_0xb5ef('0x11')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x231d7f,_0x3ce371,_0x5ce66e){if(_0x231d7f['body']){_0x231d7f[_0xb5ef('0xf')]=htmlToText['fromString'](_0x231d7f[_0xb5ef('0x12')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x5ce66e(null,_0x3ce371);},'afterCreate':function(_0x4e1dbe,_0x574fc1,_0x567bbc){var _0x17675c=_0x4ecef1['models'];var _0x3d364e=_0x4e1dbe[_0xb5ef('0x13')]({'plain':!![]});if(_0x3d364e[_0xb5ef('0x14')][_0xb5ef('0x15')]()==='in'||_0x3d364e['direction']['toLowerCase']()===_0xb5ef('0x16')&&!_0x3d364e[_0xb5ef('0x17')]&&!_[_0xb5ef('0x18')](_0x3d364e[_0xb5ef('0x19')])){_0x17675c[_0xb5ef('0x1a')]['findOne']({'where':{'id':_0x3d364e['MailInteractionId']}})['then'](function(_0x3370e4){if(_0x3370e4){_0x3370e4[_0xb5ef('0x1b')]({'lastMsgAt':_0x3d364e[_0xb5ef('0x1c')],'lastMsgDirection':_0x3d364e[_0xb5ef('0x14')][_0xb5ef('0x15')](),'lastMsgBody':_0x3d364e['body']});}})[_0xb5ef('0x1d')](function(_0x25400d){console[_0xb5ef('0x1e')](_0x25400d);});}_0x567bbc();}},'charset':_0xb5ef('0x1f'),'collate':_0xb5ef('0x20')});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.rpc.js b/server/api/mailMessage/mailMessage.rpc.js index 9ea9107..3e5f7e4 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 _0xfc17=['then','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateMailMessage','MailMessage','create','body','options','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./mailMessage.socket','register','request'];(function(_0x5b26cb,_0x527ab0){var _0x563d12=function(_0x472b38){while(--_0x472b38){_0x5b26cb['push'](_0x5b26cb['shift']());}};_0x563d12(++_0x527ab0);}(_0xfc17,0x1b4));var _0x7fc1=function(_0x5dcc92,_0x47ac0c){_0x5dcc92=_0x5dcc92-0x0;var _0x5c4e7a=_0xfc17[_0x5dcc92];return _0x5c4e7a;};'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});config[_0x7fc1('0xc')]=_[_0x7fc1('0xd')](config[_0x7fc1('0xc')],{'host':_0x7fc1('0xe'),'port':0x18eb});var socket=require(_0x7fc1('0xf'))(new Redis(config['redis']));require(_0x7fc1('0x10'))[_0x7fc1('0x11')](socket);function respondWithRpcPromise(_0x360f3f,_0x5d562d,_0x2f37c2){return new BPromise(function(_0x48c36c,_0x5c59ad){return client[_0x7fc1('0x12')](_0x360f3f,_0x2f37c2)[_0x7fc1('0x13')](function(_0x5e001d){logger[_0x7fc1('0x14')](_0x7fc1('0x15'),_0x5d562d,_0x7fc1('0x16'));logger[_0x7fc1('0x17')](_0x7fc1('0x18'),_0x5d562d,_0x7fc1('0x16'),JSON[_0x7fc1('0x19')](_0x5e001d));if(_0x5e001d[_0x7fc1('0x1a')]){if(_0x5e001d[_0x7fc1('0x1a')]['code']===0x1f4){logger['error'](_0x7fc1('0x15'),_0x5d562d,_0x5e001d[_0x7fc1('0x1a')][_0x7fc1('0x1b')]);return _0x5c59ad(_0x5e001d[_0x7fc1('0x1a')][_0x7fc1('0x1b')]);}logger[_0x7fc1('0x1a')](_0x7fc1('0x15'),_0x5d562d,_0x5e001d[_0x7fc1('0x1a')][_0x7fc1('0x1b')]);return _0x48c36c(_0x5e001d[_0x7fc1('0x1a')]['message']);}else{logger[_0x7fc1('0x14')]('MailMessage,\x20%s,\x20%s',_0x5d562d,_0x7fc1('0x16'));_0x48c36c(_0x5e001d[_0x7fc1('0x1c')]['message']);}})[_0x7fc1('0x1d')](function(_0x1c12cf){logger['error'](_0x7fc1('0x15'),_0x5d562d,_0x1c12cf);_0x5c59ad(_0x1c12cf);});});}exports[_0x7fc1('0x1e')]=function(_0x1158f0){var _0x416748=this;return new Promise(function(_0x10b4b7,_0x1c249d){return db[_0x7fc1('0x1f')][_0x7fc1('0x20')](_0x1158f0[_0x7fc1('0x21')],{'raw':_0x1158f0[_0x7fc1('0x22')]?_0x1158f0['options']['raw']===undefined?!![]:![]:!![]})[_0x7fc1('0x13')](function(_0x5e10cd){logger[_0x7fc1('0x14')](_0x7fc1('0x1e'),_0x1158f0);logger[_0x7fc1('0x17')](_0x7fc1('0x1e'),_0x1158f0,JSON['stringify'](_0x5e10cd));_0x10b4b7(_0x5e10cd);})[_0x7fc1('0x1d')](function(_0x2671bd){logger[_0x7fc1('0x1a')]('CreateMailMessage',_0x2671bd[_0x7fc1('0x1b')],_0x1158f0);_0x1c249d(_0x416748[_0x7fc1('0x1a')](0x1f4,_0x2671bd['message']));});});}; \ No newline at end of file +var _0xb182=['raw','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./mailMessage.socket','register','request','then','info','request\x20sent','debug','stringify','error','code','MailMessage,\x20%s,\x20%s','message','result','catch','CreateMailMessage','MailMessage','body','options'];(function(_0xe5757a,_0x1e5ef7){var _0x54734e=function(_0x19c628){while(--_0x19c628){_0xe5757a['push'](_0xe5757a['shift']());}};_0x54734e(++_0x1e5ef7);}(_0xb182,0x121));var _0x2b18=function(_0x616290,_0x280b7f){_0x616290=_0x616290-0x0;var _0x453879=_0xb182[_0x616290];return _0x453879;};'use strict';var _=require('lodash');var util=require(_0x2b18('0x0'));var moment=require(_0x2b18('0x1'));var BPromise=require(_0x2b18('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2b18('0x3'))['db'];var utils=require(_0x2b18('0x4'));var logger=require(_0x2b18('0x5'))('rpc');var config=require(_0x2b18('0x6'));var jayson=require(_0x2b18('0x7'));var client=jayson[_0x2b18('0x8')][_0x2b18('0x9')]({'port':0x232a});config[_0x2b18('0xa')]=_[_0x2b18('0xb')](config[_0x2b18('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x2b18('0xc'))(new Redis(config[_0x2b18('0xa')]));require(_0x2b18('0xd'))[_0x2b18('0xe')](socket);function respondWithRpcPromise(_0x3faf03,_0x1ec42f,_0x1311ad){return new BPromise(function(_0x261b64,_0x440d50){return client[_0x2b18('0xf')](_0x3faf03,_0x1311ad)[_0x2b18('0x10')](function(_0x36bea7){logger[_0x2b18('0x11')]('MailMessage,\x20%s,\x20%s',_0x1ec42f,_0x2b18('0x12'));logger[_0x2b18('0x13')]('MailMessage,\x20%s,\x20%s,\x20%s',_0x1ec42f,'request\x20sent',JSON[_0x2b18('0x14')](_0x36bea7));if(_0x36bea7[_0x2b18('0x15')]){if(_0x36bea7[_0x2b18('0x15')][_0x2b18('0x16')]===0x1f4){logger[_0x2b18('0x15')](_0x2b18('0x17'),_0x1ec42f,_0x36bea7[_0x2b18('0x15')][_0x2b18('0x18')]);return _0x440d50(_0x36bea7['error'][_0x2b18('0x18')]);}logger[_0x2b18('0x15')](_0x2b18('0x17'),_0x1ec42f,_0x36bea7['error'][_0x2b18('0x18')]);return _0x261b64(_0x36bea7['error']['message']);}else{logger['info'](_0x2b18('0x17'),_0x1ec42f,_0x2b18('0x12'));_0x261b64(_0x36bea7[_0x2b18('0x19')][_0x2b18('0x18')]);}})[_0x2b18('0x1a')](function(_0x12ff10){logger[_0x2b18('0x15')]('MailMessage,\x20%s,\x20%s',_0x1ec42f,_0x12ff10);_0x440d50(_0x12ff10);});});}exports[_0x2b18('0x1b')]=function(_0x4068d6){var _0x48e361=this;return new Promise(function(_0x5be6f2,_0x2cef3a){return db[_0x2b18('0x1c')]['create'](_0x4068d6[_0x2b18('0x1d')],{'raw':_0x4068d6[_0x2b18('0x1e')]?_0x4068d6[_0x2b18('0x1e')][_0x2b18('0x1f')]===undefined?!![]:![]:!![]})['then'](function(_0x1b1635){logger['info'](_0x2b18('0x1b'),_0x4068d6);logger[_0x2b18('0x13')](_0x2b18('0x1b'),_0x4068d6,JSON['stringify'](_0x1b1635));_0x5be6f2(_0x1b1635);})['catch'](function(_0x4d5685){logger[_0x2b18('0x15')](_0x2b18('0x1b'),_0x4d5685[_0x2b18('0x18')],_0x4068d6);_0x2cef3a(_0x48e361[_0x2b18('0x15')](0x1f4,_0x4d5685[_0x2b18('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.socket.js b/server/api/mailMessage/mailMessage.socket.js index 33437c3..cecfa22 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 _0x4062=['emit','removeListener','register','length','save','update'];(function(_0x3577ad,_0x11e389){var _0x56c663=function(_0xf6273d){while(--_0xf6273d){_0x3577ad['push'](_0x3577ad['shift']());}};_0x56c663(++_0x11e389);}(_0x4062,0x1ae));var _0x2406=function(_0x266fbe,_0x2fd74c){_0x266fbe=_0x266fbe-0x0;var _0x4bd05c=_0x4062[_0x266fbe];return _0x4bd05c;};'use strict';var MailMessageEvents=require('./mailMessage.events');var events=[_0x2406('0x0'),'remove',_0x2406('0x1')];function createListener(_0x4de7a0,_0xb00df7){return function(_0x4960da){_0xb00df7[_0x2406('0x2')](_0x4de7a0,_0x4960da);};}function removeListener(_0x5239c5,_0x1089ae){return function(){MailMessageEvents[_0x2406('0x3')](_0x5239c5,_0x1089ae);};}exports[_0x2406('0x4')]=function(_0x320b05){for(var _0x1e5450=0x0,_0x33fc20=events[_0x2406('0x5')];_0x1e5450<_0x33fc20;_0x1e5450++){var _0xc18f1b=events[_0x1e5450];var _0x49fd0a=createListener('mailMessage:'+_0xc18f1b,_0x320b05);MailMessageEvents['on'](_0xc18f1b,_0x49fd0a);}}; \ No newline at end of file +var _0xe027=['update','length','mailMessage:','./mailMessage.events','save','remove'];(function(_0x58a107,_0x558700){var _0x47c3c7=function(_0x1f6b79){while(--_0x1f6b79){_0x58a107['push'](_0x58a107['shift']());}};_0x47c3c7(++_0x558700);}(_0xe027,0xf9));var _0x7e02=function(_0x23a4d3,_0x78ac16){_0x23a4d3=_0x23a4d3-0x0;var _0x23cd0d=_0xe027[_0x23a4d3];return _0x23cd0d;};'use strict';var MailMessageEvents=require(_0x7e02('0x0'));var events=[_0x7e02('0x1'),_0x7e02('0x2'),_0x7e02('0x3')];function createListener(_0x51eb7d,_0xf7276d){return function(_0x2d900a){_0xf7276d['emit'](_0x51eb7d,_0x2d900a);};}function removeListener(_0x4131d6,_0x4c7975){return function(){MailMessageEvents['removeListener'](_0x4131d6,_0x4c7975);};}exports['register']=function(_0x3d2275){for(var _0x4bb36f=0x0,_0x427c6c=events[_0x7e02('0x4')];_0x4bb36f<_0x427c6c;_0x4bb36f++){var _0x4cb1b9=events[_0x4bb36f];var _0x206434=createListener(_0x7e02('0x5')+_0x4cb1b9,_0x3d2275);MailMessageEvents['on'](_0x4cb1b9,_0x206434);}}; \ No newline at end of file diff --git a/server/api/mailQueue/index.js b/server/api/mailQueue/index.js index 0a40987..8b0da12 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 _0xc792=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailQueue.controller','get','isAuthenticated','index','/:id','/:id/members','getTeams','/:id/users','getAgents','post','/:id/teams','addTeams','addAgents','put','update','delete','destroy','removeTeams','removeAgents','exports','multer','util','path','connect-timeout'];(function(_0x1d4c51,_0x21751f){var _0x788830=function(_0x4af703){while(--_0x4af703){_0x1d4c51['push'](_0x1d4c51['shift']());}};_0x788830(++_0x21751f);}(_0xc792,0x1e9));var _0x2c79=function(_0x478d8c,_0x3341c1){_0x478d8c=_0x478d8c-0x0;var _0x3f343a=_0xc792[_0x478d8c];return _0x3f343a;};'use strict';var multer=require(_0x2c79('0x0'));var util=require(_0x2c79('0x1'));var path=require(_0x2c79('0x2'));var timeout=require(_0x2c79('0x3'));var express=require(_0x2c79('0x4'));var router=express[_0x2c79('0x5')]();var auth=require(_0x2c79('0x6'));var interaction=require(_0x2c79('0x7'));var config=require(_0x2c79('0x8'));var controller=require(_0x2c79('0x9'));router[_0x2c79('0xa')]('/',auth[_0x2c79('0xb')](),controller[_0x2c79('0xc')]);router[_0x2c79('0xa')]('/describe',auth[_0x2c79('0xb')](),controller['describe']);router[_0x2c79('0xa')](_0x2c79('0xd'),auth['isAuthenticated'](),controller['show']);router['get'](_0x2c79('0xe'),auth[_0x2c79('0xb')](),controller['getMembers']);router[_0x2c79('0xa')]('/:id/teams',auth[_0x2c79('0xb')](),controller[_0x2c79('0xf')]);router[_0x2c79('0xa')](_0x2c79('0x10'),auth['isAuthenticated'](),controller[_0x2c79('0x11')]);router[_0x2c79('0x12')]('/',auth['isAuthenticated'](),controller['create']);router[_0x2c79('0x12')](_0x2c79('0x13'),auth[_0x2c79('0xb')](),controller[_0x2c79('0x14')]);router[_0x2c79('0x12')](_0x2c79('0x10'),auth['isAuthenticated'](),controller[_0x2c79('0x15')]);router[_0x2c79('0x16')](_0x2c79('0xd'),auth['isAuthenticated'](),controller[_0x2c79('0x17')]);router[_0x2c79('0x18')](_0x2c79('0xd'),auth[_0x2c79('0xb')](),controller[_0x2c79('0x19')]);router['delete'](_0x2c79('0x13'),auth[_0x2c79('0xb')](),controller[_0x2c79('0x1a')]);router['delete']('/:id/users',auth[_0x2c79('0xb')](),controller[_0x2c79('0x1b')]);module[_0x2c79('0x1c')]=router; \ No newline at end of file +var _0xf92b=['removeAgents','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailQueue.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/members','getMembers','getTeams','/:id/users','create','post','/:id/teams','addTeams','addAgents','update','delete','destroy'];(function(_0xc2837a,_0x4518a9){var _0x3363ba=function(_0x4ff86c){while(--_0x4ff86c){_0xc2837a['push'](_0xc2837a['shift']());}};_0x3363ba(++_0x4518a9);}(_0xf92b,0x1ef));var _0xbf92=function(_0x47488b,_0x4b173b){_0x47488b=_0x47488b-0x0;var _0x21cbd8=_0xf92b[_0x47488b];return _0x21cbd8;};'use strict';var multer=require(_0xbf92('0x0'));var util=require(_0xbf92('0x1'));var path=require(_0xbf92('0x2'));var timeout=require(_0xbf92('0x3'));var express=require('express');var router=express[_0xbf92('0x4')]();var auth=require(_0xbf92('0x5'));var interaction=require(_0xbf92('0x6'));var config=require(_0xbf92('0x7'));var controller=require(_0xbf92('0x8'));router[_0xbf92('0x9')]('/',auth[_0xbf92('0xa')](),controller[_0xbf92('0xb')]);router[_0xbf92('0x9')](_0xbf92('0xc'),auth['isAuthenticated'](),controller['describe']);router['get'](_0xbf92('0xd'),auth[_0xbf92('0xa')](),controller[_0xbf92('0xe')]);router[_0xbf92('0x9')](_0xbf92('0xf'),auth[_0xbf92('0xa')](),controller[_0xbf92('0x10')]);router[_0xbf92('0x9')]('/:id/teams',auth[_0xbf92('0xa')](),controller[_0xbf92('0x11')]);router[_0xbf92('0x9')](_0xbf92('0x12'),auth[_0xbf92('0xa')](),controller['getAgents']);router['post']('/',auth[_0xbf92('0xa')](),controller[_0xbf92('0x13')]);router[_0xbf92('0x14')](_0xbf92('0x15'),auth['isAuthenticated'](),controller[_0xbf92('0x16')]);router['post']('/:id/users',auth[_0xbf92('0xa')](),controller[_0xbf92('0x17')]);router['put'](_0xbf92('0xd'),auth[_0xbf92('0xa')](),controller[_0xbf92('0x18')]);router[_0xbf92('0x19')](_0xbf92('0xd'),auth['isAuthenticated'](),controller[_0xbf92('0x1a')]);router[_0xbf92('0x19')](_0xbf92('0x15'),auth[_0xbf92('0xa')](),controller['removeTeams']);router[_0xbf92('0x19')](_0xbf92('0x12'),auth['isAuthenticated'](),controller[_0xbf92('0x1b')]);module[_0xbf92('0x1c')]=router; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.attributes.js b/server/api/mailQueue/mailQueue.attributes.js index 75cc874..78e386e 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 _0x1241=['name','INTEGER','ENUM','beepall','roundrobin','sequelize','STRING'];(function(_0x318934,_0x5a0a0b){var _0x3898bf=function(_0x4c9300){while(--_0x4c9300){_0x318934['push'](_0x318934['shift']());}};_0x3898bf(++_0x5a0a0b);}(_0x1241,0xb4));var _0x1124=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1241[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x1124('0x0'));module['exports']={'name':{'type':Sequelize[_0x1124('0x1')],'unique':_0x1124('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x1124('0x1')]},'timeout':{'type':Sequelize[_0x1124('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x1124('0x4')]('rrmemory',_0x1124('0x5'),_0x1124('0x6'))}}; \ No newline at end of file +var _0x85e6=['beepall','sequelize','exports','name','STRING','ENUM','rrmemory'];(function(_0x301d90,_0x334f54){var _0x557df1=function(_0x5c6045){while(--_0x5c6045){_0x301d90['push'](_0x301d90['shift']());}};_0x557df1(++_0x334f54);}(_0x85e6,0x1a5));var _0x685e=function(_0x59e97b,_0x41b0b0){_0x59e97b=_0x59e97b-0x0;var _0x41975f=_0x85e6[_0x59e97b];return _0x41975f;};'use strict';var Sequelize=require(_0x685e('0x0'));module[_0x685e('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x685e('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x685e('0x3')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x685e('0x4')](_0x685e('0x5'),_0x685e('0x6'),'roundrobin')}}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.controller.js b/server/api/mailQueue/mailQueue.controller.js index f51b00d..1d8d746 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 _0x5063=['./mailQueue.socket','register','sendStatus','status','end','json','count','offset','limit','set','apply','save','then','destroy','get','MailQueues','UserProfileResource','error','stack','name','send','rawAttributes','model','keys','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','pick','where','type','VIRTUAL','field','filter','merge','options','includeAll','include','findAll','rows','catch','show','MailQueue','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','update','params','describe','getMembers','UserMailQueue','length','MailQueueId','map','User','findAndCountAll','UserId','agent','mailPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','Team','addTeams','ids','online','voicePause','interface','flatMap','Agents','sequelize','transaction','each','emit','userMailQueue:save','removeTeams','select','team_has_mail_queues','user_has_teams','MailQueueId\x20=\x20?','clone','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','value','isEmpty','removeAgents','addAgents','omit','spread','isArray','userMailQueue:remove','getAgents','findOne','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','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','redis','defaults','localhost'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x5063,0x18a));var _0x3506=function(_0x59c346,_0x59be77){_0x59c346=_0x59c346-0x0;var _0x2e8b39=_0x5063[_0x59c346];return _0x2e8b39;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x3506('0x0'));var zipdir=require(_0x3506('0x1'));var jsonpatch=require(_0x3506('0x2'));var rp=require(_0x3506('0x3'));var moment=require('moment');var BPromise=require(_0x3506('0x4'));var Mustache=require(_0x3506('0x5'));var util=require(_0x3506('0x6'));var path=require(_0x3506('0x7'));var sox=require(_0x3506('0x8'));var csv=require(_0x3506('0x9'));var ejs=require(_0x3506('0xa'));var fs=require('fs');var _=require(_0x3506('0xb'));var squel=require('squel');var crypto=require(_0x3506('0xc'));var jsforce=require(_0x3506('0xd'));var deskjs=require(_0x3506('0xe'));var toCsv=require(_0x3506('0x9'));var querystring=require(_0x3506('0xf'));var Papa=require(_0x3506('0x10'));var Redis=require('ioredis');var authService=require(_0x3506('0x11'));var qs=require(_0x3506('0x12'));var as=require(_0x3506('0x13'));var hardwareService=require(_0x3506('0x14'));var logger=require(_0x3506('0x15'))(_0x3506('0x16'));var utils=require(_0x3506('0x17'));var config=require(_0x3506('0x18'));var db=require(_0x3506('0x19'))['db'];config[_0x3506('0x1a')]=_[_0x3506('0x1b')](config[_0x3506('0x1a')],{'host':_0x3506('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3506('0x1a')]));require(_0x3506('0x1d'))[_0x3506('0x1e')](socket);function respondWithStatusCode(_0x383271,_0x399193){_0x399193=_0x399193||0xcc;return function(_0x37f49d){if(_0x37f49d){return _0x383271[_0x3506('0x1f')](_0x399193);}return _0x383271[_0x3506('0x20')](_0x399193)[_0x3506('0x21')]();};}function respondWithResult(_0x509c49,_0x17dd98){_0x17dd98=_0x17dd98||0xc8;return function(_0x3f07fb){if(_0x3f07fb){return _0x509c49[_0x3506('0x20')](_0x17dd98)[_0x3506('0x22')](_0x3f07fb);}};}function respondWithFilteredResult(_0x30af4e,_0x17741f){return function(_0x5cf3e4){if(_0x5cf3e4){var _0x4da97b=_0x5cf3e4[_0x3506('0x23')],_0x3a37ae=_0x17741f['offset'],_0x2f9dfb=_0x17741f[_0x3506('0x24')]+_0x17741f[_0x3506('0x25')],_0x33fcd0;if(_0x2f9dfb>=_0x4da97b){_0x2f9dfb=_0x4da97b;_0x33fcd0=0xc8;}else{_0x33fcd0=0xce;}_0x30af4e[_0x3506('0x20')](_0x33fcd0);return _0x30af4e[_0x3506('0x26')]('Content-Range',_0x3a37ae+'-'+_0x2f9dfb+'/'+_0x4da97b)[_0x3506('0x22')](_0x5cf3e4);}return null;};}function patchUpdates(_0x1ed796){return function(_0x501d7c){try{jsonpatch[_0x3506('0x27')](_0x501d7c,_0x1ed796,!![]);}catch(_0x2dada9){return BPromise['reject'](_0x2dada9);}return _0x501d7c[_0x3506('0x28')]();};}function saveUpdates(_0x54c37a,_0x4d854b){return function(_0x3f4dc3){if(_0x3f4dc3){return _0x3f4dc3['update'](_0x54c37a)[_0x3506('0x29')](function(_0x1bf012){return _0x1bf012;});}return null;};}function removeEntity(_0x2b25aa,_0x22e090){return function(_0x5baf7c){if(_0x5baf7c){return _0x5baf7c[_0x3506('0x2a')]()[_0x3506('0x29')](function(){var _0x2d3cb1=_0x5baf7c[_0x3506('0x2b')]({'plain':!![]});var _0x488ea9=_0x3506('0x2c');return db[_0x3506('0x2d')][_0x3506('0x2a')]({'where':{'type':_0x488ea9,'resourceId':_0x2d3cb1['id']}})['then'](function(){return _0x5baf7c;});})['then'](function(){_0x2b25aa[_0x3506('0x20')](0xcc)[_0x3506('0x21')]();});}};}function handleEntityNotFound(_0x3f8de4,_0x34b37c){return function(_0x295f40){if(!_0x295f40){_0x3f8de4[_0x3506('0x1f')](0x194);}return _0x295f40;};}function handleError(_0x2cda2a,_0x283d56){_0x283d56=_0x283d56||0x1f4;return function(_0x196cf1){logger[_0x3506('0x2e')](_0x196cf1[_0x3506('0x2f')]);if(_0x196cf1[_0x3506('0x30')]){delete _0x196cf1[_0x3506('0x30')];}_0x2cda2a[_0x3506('0x20')](_0x283d56)[_0x3506('0x31')](_0x196cf1);};}exports['index']=function(_0xb0159f,_0x5974a6){var _0x1496d8={},_0x49ca21={},_0xc8f778={'count':0x0,'rows':[]};var _0x54dae3=db['MailQueue'][_0x3506('0x32')];_0x49ca21[_0x3506('0x33')]=_[_0x3506('0x34')](_0x54dae3);_0x49ca21[_0x3506('0x35')]=_['keys'](_0xb0159f[_0x3506('0x35')]);_0x49ca21[_0x3506('0x36')]=_[_0x3506('0x37')](_0x49ca21[_0x3506('0x33')],_0x49ca21[_0x3506('0x35')]);_0x1496d8['attributes']=_[_0x3506('0x37')](_0x49ca21['model'],qs['fields'](_0xb0159f[_0x3506('0x35')][_0x3506('0x38')]));_0x1496d8[_0x3506('0x39')]=_0x1496d8['attributes']['length']?_0x1496d8[_0x3506('0x39')]:_0x49ca21[_0x3506('0x33')];if(!_0xb0159f['query'][_0x3506('0x3a')](_0x3506('0x3b'))){_0x1496d8[_0x3506('0x25')]=qs[_0x3506('0x25')](_0xb0159f[_0x3506('0x35')]['limit']);_0x1496d8[_0x3506('0x24')]=qs[_0x3506('0x24')](_0xb0159f['query'][_0x3506('0x24')]);}_0x1496d8[_0x3506('0x3c')]=qs[_0x3506('0x3d')](_0xb0159f[_0x3506('0x35')][_0x3506('0x3d')]);_0x1496d8['where']=qs[_0x3506('0x36')](_[_0x3506('0x3e')](_0xb0159f[_0x3506('0x35')],_0x49ca21[_0x3506('0x36')]));if(_0xb0159f[_0x3506('0x35')]['filter']){_0x1496d8['where']=_['merge'](_0x1496d8[_0x3506('0x3f')],{'$or':_['map'](_0x54dae3,function(_0x28d831){if(_0x28d831[_0x3506('0x40')]['key']!==_0x3506('0x41')){var _0x9f90b8={};_0x9f90b8[_0x28d831[_0x3506('0x42')]]={'$like':'%'+_0xb0159f[_0x3506('0x35')][_0x3506('0x43')]+'%'};return _0x9f90b8;}})});}_0x1496d8=_[_0x3506('0x44')]({},_0x1496d8,_0xb0159f[_0x3506('0x45')]);var _0x55706b={'where':_0x1496d8['where']};return db['MailQueue'][_0x3506('0x23')](_0x55706b)[_0x3506('0x29')](function(_0x3cdaff){_0xc8f778[_0x3506('0x23')]=_0x3cdaff;if(_0xb0159f[_0x3506('0x35')][_0x3506('0x46')]){_0x1496d8[_0x3506('0x47')]=[{'all':!![]}];}return db['MailQueue'][_0x3506('0x48')](_0x1496d8);})[_0x3506('0x29')](function(_0x54369a){_0xc8f778[_0x3506('0x49')]=_0x54369a;return _0xc8f778;})[_0x3506('0x29')](respondWithFilteredResult(_0x5974a6,_0x1496d8))[_0x3506('0x4a')](handleError(_0x5974a6,null));};exports[_0x3506('0x4b')]=function(_0x5b1882,_0x264b76){var _0x783e8={'raw':!![],'where':{'id':_0x5b1882['params']['id']}},_0x53ac16={};_0x53ac16[_0x3506('0x33')]=_['keys'](db[_0x3506('0x4c')][_0x3506('0x32')]);_0x53ac16[_0x3506('0x35')]=_[_0x3506('0x34')](_0x5b1882[_0x3506('0x35')]);_0x53ac16[_0x3506('0x36')]=_[_0x3506('0x37')](_0x53ac16['model'],_0x53ac16[_0x3506('0x35')]);_0x783e8[_0x3506('0x39')]=_[_0x3506('0x37')](_0x53ac16['model'],qs['fields'](_0x5b1882[_0x3506('0x35')][_0x3506('0x38')]));_0x783e8['attributes']=_0x783e8[_0x3506('0x39')]['length']?_0x783e8[_0x3506('0x39')]:_0x53ac16['model'];if(_0x5b1882[_0x3506('0x35')]['includeAll']){_0x783e8['include']=[{'all':!![]}];}_0x783e8=_[_0x3506('0x44')]({},_0x783e8,_0x5b1882[_0x3506('0x45')]);return db[_0x3506('0x4c')][_0x3506('0x4d')](_0x783e8)['then'](handleEntityNotFound(_0x264b76,null))[_0x3506('0x29')](respondWithResult(_0x264b76,null))['catch'](handleError(_0x264b76,null));};exports['create']=function(_0x493e87,_0x128613){return db[_0x3506('0x4c')]['create'](_0x493e87[_0x3506('0x4e')],{})[_0x3506('0x29')](function(_0x2c37d0){var _0x57b0ae=_0x493e87[_0x3506('0x4f')][_0x3506('0x2b')]({'plain':!![]});if(!_0x57b0ae)throw new Error(_0x3506('0x50'));if(_0x57b0ae[_0x3506('0x51')]==='user'){var _0x302291=_0x2c37d0[_0x3506('0x2b')]({'plain':!![]});var _0x561eb7=_0x3506('0x2c');return db[_0x3506('0x52')][_0x3506('0x4d')]({'where':{'name':_0x561eb7,'userProfileId':_0x57b0ae[_0x3506('0x53')]},'raw':!![]})[_0x3506('0x29')](function(_0x311f65){if(_0x311f65&&_0x311f65[_0x3506('0x54')]===0x0){return db[_0x3506('0x2d')]['create']({'name':_0x302291[_0x3506('0x30')],'resourceId':_0x302291['id'],'type':_0x311f65[_0x3506('0x30')],'sectionId':_0x311f65['id']},{})[_0x3506('0x29')](function(){return _0x2c37d0;});}else{return _0x2c37d0;}})[_0x3506('0x4a')](function(_0x270dd5){logger[_0x3506('0x2e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x270dd5);throw _0x270dd5;});}return _0x2c37d0;})[_0x3506('0x29')](respondWithResult(_0x128613,0xc9))[_0x3506('0x4a')](handleError(_0x128613,null));};exports[_0x3506('0x55')]=function(_0x1ef12e,_0x1f242c){if(_0x1ef12e[_0x3506('0x4e')]['id']){delete _0x1ef12e['body']['id'];}return db[_0x3506('0x4c')][_0x3506('0x4d')]({'where':{'id':_0x1ef12e[_0x3506('0x56')]['id']}})['then'](handleEntityNotFound(_0x1f242c,null))[_0x3506('0x29')](saveUpdates(_0x1ef12e[_0x3506('0x4e')],null))[_0x3506('0x29')](respondWithResult(_0x1f242c,null))[_0x3506('0x4a')](handleError(_0x1f242c,null));};exports[_0x3506('0x2a')]=function(_0x5cb4b7,_0xe58771){return db[_0x3506('0x4c')][_0x3506('0x4d')]({'where':{'id':_0x5cb4b7[_0x3506('0x56')]['id']}})[_0x3506('0x29')](handleEntityNotFound(_0xe58771,null))[_0x3506('0x29')](removeEntity(_0xe58771,null))[_0x3506('0x4a')](handleError(_0xe58771,null));};exports[_0x3506('0x57')]=function(_0x2d8ed8,_0x52ba0e){return db[_0x3506('0x4c')][_0x3506('0x57')]()[_0x3506('0x29')](respondWithResult(_0x52ba0e,null))[_0x3506('0x4a')](handleError(_0x52ba0e,null));};exports[_0x3506('0x58')]=function(_0x57ce1f,_0x2fa2bf,_0x5b12be){var _0x1c3ae4={'raw':!![],'where':{}},_0x28092f={},_0x4c4226;return db[_0x3506('0x4c')]['findOne']({'where':{'id':_0x57ce1f[_0x3506('0x56')]['id']}})['then'](handleEntityNotFound(_0x2fa2bf,null))[_0x3506('0x29')](function(_0x221355){if(_0x221355){_0x4c4226=_0x221355[_0x3506('0x2b')]({'plain':!![]});_0x28092f[_0x3506('0x33')]=_[_0x3506('0x34')](db[_0x3506('0x59')][_0x3506('0x32')]);_0x28092f[_0x3506('0x35')]=_[_0x3506('0x34')](_0x57ce1f[_0x3506('0x35')]);_0x28092f[_0x3506('0x36')]=_[_0x3506('0x37')](_0x28092f[_0x3506('0x33')],_0x28092f[_0x3506('0x35')]);_0x1c3ae4[_0x3506('0x39')]=_[_0x3506('0x37')](_0x28092f['model'],qs[_0x3506('0x38')](_0x57ce1f[_0x3506('0x35')]['fields']));_0x1c3ae4[_0x3506('0x39')]=_0x1c3ae4['attributes'][_0x3506('0x5a')]?_0x1c3ae4[_0x3506('0x39')]:_0x28092f[_0x3506('0x33')];if(!_0x57ce1f[_0x3506('0x35')][_0x3506('0x3a')](_0x3506('0x3b'))){_0x1c3ae4[_0x3506('0x25')]=qs[_0x3506('0x25')](_0x57ce1f[_0x3506('0x35')][_0x3506('0x25')]);_0x1c3ae4['offset']=qs['offset'](_0x57ce1f['query'][_0x3506('0x24')]);}_0x1c3ae4[_0x3506('0x3c')]=qs['sort'](_0x57ce1f[_0x3506('0x35')]['sort']);_0x1c3ae4[_0x3506('0x3f')]=qs[_0x3506('0x36')](_['pick'](_0x57ce1f['query'],_0x28092f[_0x3506('0x36')]));_0x1c3ae4[_0x3506('0x3f')][_0x3506('0x5b')]=_0x221355['id'];if(_0x57ce1f['query'][_0x3506('0x43')]){_0x1c3ae4[_0x3506('0x3f')]=_[_0x3506('0x44')](_0x1c3ae4[_0x3506('0x3f')],{'$or':_[_0x3506('0x5c')](_0x1c3ae4[_0x3506('0x39')],function(_0x1b861a){var _0x29d17a={};_0x29d17a[_0x1b861a]={'$like':'%'+_0x57ce1f[_0x3506('0x35')]['filter']+'%'};return _0x29d17a;})});}_0x1c3ae4=_[_0x3506('0x44')]({},_0x1c3ae4,_0x57ce1f[_0x3506('0x45')]);return db[_0x3506('0x59')][_0x3506('0x48')](_0x1c3ae4);}})[_0x3506('0x29')](function(_0x1d113c){if(_0x1d113c){return db[_0x3506('0x5d')][_0x3506('0x5e')]({'where':{'id':_['map'](_0x1d113c,_0x3506('0x5f')),'role':_0x3506('0x60')},'attributes':['id','name',_0x3506('0x61'),_0x3506('0x62'),_0x3506('0x63')]});}})['then'](function(_0x182ac4){if(_0x182ac4){return{'count':_0x182ac4[_0x3506('0x23')],'rows':_[_0x3506('0x5c')](_0x182ac4['rows'],function(_0x2bab77){return{'membername':_0x2bab77[_0x3506('0x30')],'UserId':_0x2bab77['id'],'queue_name':_0x4c4226[_0x3506('0x30')],'MailQueueId':_0x4c4226['id'],'interface':util[_0x3506('0x64')](_0x3506('0x65'),_0x3506('0x66'),_0x2bab77[_0x3506('0x30')]),'penalty':0x0,'paused':_0x2bab77[_0x3506('0x61')],'createdAt':_0x2bab77['createdAt'],'updatedAt':_0x2bab77[_0x3506('0x62')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x3506('0x29')](respondWithFilteredResult(_0x2fa2bf,_0x1c3ae4))[_0x3506('0x4a')](handleError(_0x2fa2bf,null));};exports[_0x3506('0x67')]=function(_0x55ea8e,_0x369b96,_0x3e6675){var _0x3acae6={};var _0x12a1a5={};var _0x3f03e3;var _0x44e4aa;return db[_0x3506('0x4c')]['findOne']({'where':{'id':_0x55ea8e[_0x3506('0x56')]['id']}})[_0x3506('0x29')](handleEntityNotFound(_0x369b96,null))[_0x3506('0x29')](function(_0x473b9c){if(_0x473b9c){_0x3f03e3=_0x473b9c;_0x12a1a5[_0x3506('0x33')]=_[_0x3506('0x34')](db[_0x3506('0x68')][_0x3506('0x32')]);_0x12a1a5['query']=_[_0x3506('0x34')](_0x55ea8e[_0x3506('0x35')]);_0x12a1a5[_0x3506('0x36')]=_[_0x3506('0x37')](_0x12a1a5[_0x3506('0x33')],_0x12a1a5[_0x3506('0x35')]);_0x3acae6[_0x3506('0x39')]=_[_0x3506('0x37')](_0x12a1a5['model'],qs[_0x3506('0x38')](_0x55ea8e['query'][_0x3506('0x38')]));_0x3acae6[_0x3506('0x39')]=_0x3acae6[_0x3506('0x39')][_0x3506('0x5a')]?_0x3acae6[_0x3506('0x39')]:_0x12a1a5[_0x3506('0x33')];_0x3acae6[_0x3506('0x3c')]=qs[_0x3506('0x3d')](_0x55ea8e[_0x3506('0x35')]['sort']);_0x3acae6['where']=qs[_0x3506('0x36')](_[_0x3506('0x3e')](_0x55ea8e[_0x3506('0x35')],_0x12a1a5[_0x3506('0x36')]));if(_0x55ea8e['query']['filter']){_0x3acae6[_0x3506('0x3f')]=_[_0x3506('0x44')](_0x3acae6[_0x3506('0x3f')],{'$or':_[_0x3506('0x5c')](_0x3acae6[_0x3506('0x39')],function(_0xb8208){var _0x155653={};_0x155653[_0xb8208]={'$like':'%'+_0x55ea8e[_0x3506('0x35')][_0x3506('0x43')]+'%'};return _0x155653;})});}_0x3acae6=_['merge']({},_0x3acae6,_0x55ea8e[_0x3506('0x45')]);return _0x3f03e3[_0x3506('0x67')](_0x3acae6);}})['then'](function(_0x3a0146){if(_0x3a0146){_0x44e4aa=_0x3a0146[_0x3506('0x5a')];if(!_0x55ea8e['query'][_0x3506('0x3a')](_0x3506('0x3b'))){_0x3acae6[_0x3506('0x25')]=qs['limit'](_0x55ea8e['query']['limit']);_0x3acae6[_0x3506('0x24')]=qs[_0x3506('0x24')](_0x55ea8e[_0x3506('0x35')][_0x3506('0x24')]);}return _0x3f03e3['getTeams'](_0x3acae6);}})['then'](function(_0x5d39d2){if(_0x5d39d2){return _0x5d39d2?{'count':_0x44e4aa,'rows':_0x5d39d2}:null;}})[_0x3506('0x29')](respondWithResult(_0x369b96,null))[_0x3506('0x4a')](handleError(_0x369b96,null));};exports[_0x3506('0x69')]=function(_0x5ddafe,_0x120ce1,_0xf210b){var _0x5ce204=_0x5ddafe[_0x3506('0x4e')][_0x3506('0x6a')];return db[_0x3506('0x68')][_0x3506('0x48')]({'where':{'id':_0x5ce204},'attributes':['id'],'include':[{'model':db[_0x3506('0x5d')],'as':'Agents','attributes':['id',_0x3506('0x30'),_0x3506('0x6b'),_0x3506('0x6c'),_0x3506('0x6d')],'raw':!![]}]})[_0x3506('0x29')](function(_0x15dffd){if(_0x15dffd){var _0x535cb6=_[_0x3506('0x6e')](_0x15dffd,function(_0xde90a1){var _0x3a150=_0xde90a1[_0x3506('0x2b')]({'plain':!![]});return _0x3a150[_0x3506('0x6f')];});return db[_0x3506('0x4c')][_0x3506('0x4d')]({'where':{'id':_0x5ddafe[_0x3506('0x56')]['id']}})['then'](function(_0x1f7da1){return db[_0x3506('0x70')][_0x3506('0x71')](function(_0x5b7372){return _0x1f7da1[_0x3506('0x69')](_0x5ce204,{'transaction':_0x5b7372})[_0x3506('0x29')](function(){return BPromise[_0x3506('0x72')](_0x535cb6,function(_0xcf6745){return db[_0x3506('0x59')]['findOrCreate']({'where':{'UserId':_0xcf6745['id'],'MailQueueId':_0x5ddafe['params']['id']},'transaction':_0x5b7372});});})[_0x3506('0x29')](function(){_0x535cb6['forEach'](function(_0x266310){socket[_0x3506('0x73')](_0x3506('0x74'),{'UserId':_0x266310['id'],'MailQueueId':_0x1f7da1['id']});});});});});}})[_0x3506('0x29')](respondWithStatusCode(_0x120ce1,null))['catch'](handleError(_0x120ce1,null));};exports[_0x3506('0x75')]=function(_0x4ab4d4,_0x42270a,_0x35ba48){return db[_0x3506('0x68')][_0x3506('0x48')]({'where':{'id':_0x4ab4d4['query'][_0x3506('0x6a')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x3506('0x6f'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x42270a,null))[_0x3506('0x29')](function(_0x2f10a9){var _0x3fb5c6=_['map'](_0x2f10a9,'id');var _0x5c5c96=[];var _0x4a28fb=[];var _0xb3525d=squel[_0x3506('0x76')]();_0xb3525d[_0x3506('0x42')]('tq.TeamId')['from'](_0x3506('0x77'),'tq')['join'](_0x3506('0x78'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x3506('0x3f')](_0x3506('0x79'),_0x4ab4d4[_0x3506('0x56')]['id']);for(var _0x5ea1e0=0x0;_0x5ea1e0<_0x2f10a9[_0x3506('0x5a')];_0x5ea1e0+=0x1){let _0x432f40=_0x2f10a9[_0x5ea1e0];for(var _0x4031ba=0x0;_0x4031ba<_0x432f40[_0x3506('0x6f')][_0x3506('0x5a')];_0x4031ba+=0x1){let _0x2c9967=_0x432f40[_0x3506('0x6f')][_0x4031ba];var _0x2fb01a=_0xb3525d[_0x3506('0x7a')]();_0x2fb01a[_0x3506('0x3f')]('ut.UserId\x20=\x20?',_0x2c9967['id']);_0x4a28fb['push'](db[_0x3506('0x70')][_0x3506('0x35')](_0x2fb01a['toString'](),{'type':db[_0x3506('0x70')][_0x3506('0x7b')][_0x3506('0x7c')]})[_0x3506('0x29')](function(_0x1553f7){if(_0x1553f7[_0x3506('0x5a')]===0x1){return _0x2c9967['id'];}else{var _0x1cb597=_[_0x3506('0x7d')](_[_0x3506('0x5c')](_0x1553f7,_0x3506('0x7e')),function(_0x5e92b4){return _[_0x3506('0x7f')](_0x3fb5c6,_0x5e92b4);});if(_0x1cb597){return _0x2c9967['id'];}}}));}}return BPromise[_0x3506('0x80')](_0x4a28fb)['then'](function(_0x555a46){_0x5c5c96=_(_0x5c5c96)[_0x3506('0x81')](_0x555a46)[_0x3506('0x82')]()[_0x3506('0x83')]();return db[_0x3506('0x4c')]['find']({'where':{'id':_0x4ab4d4['params']['id']}})[_0x3506('0x29')](function(_0x57e206){return db['sequelize'][_0x3506('0x71')](function(_0x26ef17){return _0x57e206['removeTeams'](_0x4ab4d4[_0x3506('0x35')]['ids'],{'transaction':_0x26ef17})[_0x3506('0x29')](function(){if(!_[_0x3506('0x84')](_0x5c5c96)){return _0x57e206[_0x3506('0x85')](_0x5c5c96,{'transaction':_0x26ef17});}})['then'](function(){_0x5c5c96['forEach'](function(_0x10139a){socket[_0x3506('0x73')]('userMailQueue:remove',{'UserId':_0x10139a,'MailQueueId':_0x57e206['id']});});});});});});})['then'](respondWithStatusCode(_0x42270a,null))[_0x3506('0x4a')](handleError(_0x42270a,null));};exports[_0x3506('0x86')]=function(_0x159491,_0x2d22c2,_0x15e1c7){return db[_0x3506('0x4c')][_0x3506('0x4d')]({'where':{'id':_0x159491[_0x3506('0x56')]['id']}})['then'](handleEntityNotFound(_0x2d22c2,null))[_0x3506('0x29')](function(_0x3b9c3f){if(_0x3b9c3f){return _0x3b9c3f[_0x3506('0x86')](_0x159491[_0x3506('0x4e')][_0x3506('0x6a')],_[_0x3506('0x87')](_0x159491['body'],[_0x3506('0x6a'),'id'])||{})[_0x3506('0x88')](function(_0x4b8176){for(var _0x2b5376=0x0;_0x2b5376<_0x159491[_0x3506('0x4e')]['ids'][_0x3506('0x5a')];_0x2b5376+=0x1){socket['emit'](_0x3506('0x74'),{'UserId':_0x159491[_0x3506('0x4e')][_0x3506('0x6a')][_0x2b5376],'MailQueueId':_0x159491['params']['id']});}return _0x4b8176;});}})[_0x3506('0x29')](respondWithResult(_0x2d22c2,null))[_0x3506('0x4a')](handleError(_0x2d22c2,null));};exports[_0x3506('0x85')]=function(_0x53ea1d,_0x14a739,_0x16f4be){return db['MailQueue']['find']({'where':{'id':_0x53ea1d[_0x3506('0x56')]['id']}})[_0x3506('0x29')](handleEntityNotFound(_0x14a739,null))['then'](function(_0x411b33){if(_0x411b33){return _0x411b33[_0x3506('0x85')](_0x53ea1d[_0x3506('0x35')][_0x3506('0x6a')])[_0x3506('0x29')](function(){if(_[_0x3506('0x89')](_0x53ea1d[_0x3506('0x35')][_0x3506('0x6a')])){for(var _0x3c9900=0x0;_0x3c9900<_0x53ea1d[_0x3506('0x35')]['ids'][_0x3506('0x5a')];_0x3c9900+=0x1){socket[_0x3506('0x73')](_0x3506('0x8a'),{'UserId':Number(_0x53ea1d[_0x3506('0x35')]['ids'][_0x3c9900]),'MailQueueId':Number(_0x53ea1d['params']['id'])});}}else{socket['emit'](_0x3506('0x8a'),{'UserId':Number(_0x53ea1d[_0x3506('0x35')][_0x3506('0x6a')]),'MailQueueId':Number(_0x53ea1d[_0x3506('0x56')]['id'])});}});}})[_0x3506('0x29')](respondWithStatusCode(_0x14a739,null))[_0x3506('0x4a')](handleError(_0x14a739,null));};exports[_0x3506('0x8b')]=function(_0x2ce4ac,_0x794edb,_0x26b45d){var _0xf5dc8a={};var _0x9f42f0={};var _0x1781c5;var _0x2b2910;return db[_0x3506('0x4c')][_0x3506('0x8c')]({'where':{'id':_0x2ce4ac[_0x3506('0x56')]['id']}})[_0x3506('0x29')](handleEntityNotFound(_0x794edb,null))['then'](function(_0x16dfc0){if(_0x16dfc0){_0x1781c5=_0x16dfc0;_0x9f42f0[_0x3506('0x33')]=_['keys'](db[_0x3506('0x5d')][_0x3506('0x32')]);_0x9f42f0[_0x3506('0x35')]=_[_0x3506('0x34')](_0x2ce4ac[_0x3506('0x35')]);_0x9f42f0['filters']=_[_0x3506('0x37')](_0x9f42f0['model'],_0x9f42f0[_0x3506('0x35')]);_0xf5dc8a[_0x3506('0x39')]=_[_0x3506('0x37')](_0x9f42f0[_0x3506('0x33')],qs[_0x3506('0x38')](_0x2ce4ac[_0x3506('0x35')]['fields']));_0xf5dc8a[_0x3506('0x39')]=_0xf5dc8a[_0x3506('0x39')][_0x3506('0x5a')]?_0xf5dc8a[_0x3506('0x39')]:_0x9f42f0[_0x3506('0x33')];_0xf5dc8a[_0x3506('0x3c')]=qs[_0x3506('0x3d')](_0x2ce4ac[_0x3506('0x35')][_0x3506('0x3d')]);_0xf5dc8a[_0x3506('0x3f')]=qs['filters'](_[_0x3506('0x3e')](_0x2ce4ac[_0x3506('0x35')],_0x9f42f0[_0x3506('0x36')]));if(_0x2ce4ac[_0x3506('0x35')][_0x3506('0x43')]){_0xf5dc8a[_0x3506('0x3f')]=_[_0x3506('0x44')](_0xf5dc8a[_0x3506('0x3f')],{'$or':_[_0x3506('0x5c')](_0xf5dc8a['attributes'],function(_0x4b24bd){var _0x59249e={};_0x59249e[_0x4b24bd]={'$like':'%'+_0x2ce4ac['query'][_0x3506('0x43')]+'%'};return _0x59249e;})});}_0xf5dc8a=_[_0x3506('0x44')]({},_0xf5dc8a,_0x2ce4ac[_0x3506('0x45')]);return _0x1781c5[_0x3506('0x8b')](_0xf5dc8a);}})['then'](function(_0x2e7662){if(_0x2e7662){_0x2b2910=_0x2e7662[_0x3506('0x5a')];if(!_0x2ce4ac[_0x3506('0x35')][_0x3506('0x3a')](_0x3506('0x3b'))){_0xf5dc8a[_0x3506('0x25')]=qs[_0x3506('0x25')](_0x2ce4ac[_0x3506('0x35')][_0x3506('0x25')]);_0xf5dc8a[_0x3506('0x24')]=qs[_0x3506('0x24')](_0x2ce4ac[_0x3506('0x35')]['offset']);}return _0x1781c5[_0x3506('0x8b')](_0xf5dc8a);}})['then'](function(_0xf434e2){if(_0xf434e2){return _0xf434e2?{'count':_0x2b2910,'rows':_0xf434e2}:null;}})[_0x3506('0x29')](respondWithResult(_0x794edb,null))[_0x3506('0x4a')](handleError(_0x794edb,null));}; \ No newline at end of file +var _0xdad1=['join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','every','TeamId','all','compact','value','removeTeams','isEmpty','removeAgents','forEach','userMailQueue:remove','addAgents','omit','spread','isArray','getAgents','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','socket.io-emitter','./mailQueue.socket','register','status','end','json','count','offset','limit','apply','save','update','then','destroy','get','UserProfileResource','stack','name','index','MailQueue','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filters','where','map','type','key','VIRTUAL','field','filter','merge','options','includeAll','include','findAll','rows','catch','params','rawAttributes','keys','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','MailQueues','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','getMembers','findOne','UserMailQueue','findAndCountAll','UserId','agent','mailPause','updatedAt','%s/%s','SIP','createdAt','getTeams','Team','order','addTeams','User','Agents','online','voicePause','interface','flatMap','sequelize','transaction','findOrCreate','emit','userMailQueue:save','ids','select','tq.TeamId','from','team_has_mail_queues'];(function(_0x54b747,_0x4ee085){var _0x28413a=function(_0x1ddb56){while(--_0x1ddb56){_0x54b747['push'](_0x54b747['shift']());}};_0x28413a(++_0x4ee085);}(_0xdad1,0x1be));var _0x1dad=function(_0xe00b30,_0x15133d){_0xe00b30=_0xe00b30-0x0;var _0x53538a=_0xdad1[_0xe00b30];return _0x53538a;};'use strict';var pdf=require(_0x1dad('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x1dad('0x1'));var zipdir=require(_0x1dad('0x2'));var jsonpatch=require(_0x1dad('0x3'));var rp=require(_0x1dad('0x4'));var moment=require('moment');var BPromise=require(_0x1dad('0x5'));var Mustache=require('mustache');var util=require(_0x1dad('0x6'));var path=require(_0x1dad('0x7'));var sox=require(_0x1dad('0x8'));var csv=require(_0x1dad('0x9'));var ejs=require(_0x1dad('0xa'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x1dad('0xb'));var jsforce=require(_0x1dad('0xc'));var deskjs=require(_0x1dad('0xd'));var toCsv=require(_0x1dad('0x9'));var querystring=require(_0x1dad('0xe'));var Papa=require(_0x1dad('0xf'));var Redis=require(_0x1dad('0x10'));var authService=require(_0x1dad('0x11'));var qs=require(_0x1dad('0x12'));var as=require(_0x1dad('0x13'));var hardwareService=require(_0x1dad('0x14'));var logger=require(_0x1dad('0x15'))('api');var utils=require(_0x1dad('0x16'));var config=require(_0x1dad('0x17'));var db=require(_0x1dad('0x18'))['db'];config[_0x1dad('0x19')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x1dad('0x1a'))(new Redis(config[_0x1dad('0x19')]));require(_0x1dad('0x1b'))[_0x1dad('0x1c')](socket);function respondWithStatusCode(_0x1438b9,_0x4e05b6){_0x4e05b6=_0x4e05b6||0xcc;return function(_0x204977){if(_0x204977){return _0x1438b9['sendStatus'](_0x4e05b6);}return _0x1438b9[_0x1dad('0x1d')](_0x4e05b6)[_0x1dad('0x1e')]();};}function respondWithResult(_0x3585e5,_0x3bde61){_0x3bde61=_0x3bde61||0xc8;return function(_0x5749e5){if(_0x5749e5){return _0x3585e5[_0x1dad('0x1d')](_0x3bde61)[_0x1dad('0x1f')](_0x5749e5);}};}function respondWithFilteredResult(_0x18db6c,_0x15e722){return function(_0x2d381e){if(_0x2d381e){var _0x4ff9da=_0x2d381e[_0x1dad('0x20')],_0x132028=_0x15e722[_0x1dad('0x21')],_0xb2ecf3=_0x15e722[_0x1dad('0x21')]+_0x15e722[_0x1dad('0x22')],_0x16dd25;if(_0xb2ecf3>=_0x4ff9da){_0xb2ecf3=_0x4ff9da;_0x16dd25=0xc8;}else{_0x16dd25=0xce;}_0x18db6c[_0x1dad('0x1d')](_0x16dd25);return _0x18db6c['set']('Content-Range',_0x132028+'-'+_0xb2ecf3+'/'+_0x4ff9da)[_0x1dad('0x1f')](_0x2d381e);}return null;};}function patchUpdates(_0x5a66b1){return function(_0x2a4b7f){try{jsonpatch[_0x1dad('0x23')](_0x2a4b7f,_0x5a66b1,!![]);}catch(_0x44de34){return BPromise['reject'](_0x44de34);}return _0x2a4b7f[_0x1dad('0x24')]();};}function saveUpdates(_0x3aa775,_0x33a8ca){return function(_0x49eea3){if(_0x49eea3){return _0x49eea3[_0x1dad('0x25')](_0x3aa775)[_0x1dad('0x26')](function(_0x5ec37c){return _0x5ec37c;});}return null;};}function removeEntity(_0x5070f7,_0x253b8a){return function(_0x34fda5){if(_0x34fda5){return _0x34fda5[_0x1dad('0x27')]()[_0x1dad('0x26')](function(){var _0x5cabe4=_0x34fda5[_0x1dad('0x28')]({'plain':!![]});var _0x1a8b88='MailQueues';return db[_0x1dad('0x29')]['destroy']({'where':{'type':_0x1a8b88,'resourceId':_0x5cabe4['id']}})[_0x1dad('0x26')](function(){return _0x34fda5;});})[_0x1dad('0x26')](function(){_0x5070f7['status'](0xcc)[_0x1dad('0x1e')]();});}};}function handleEntityNotFound(_0x2e7406,_0x1676fd){return function(_0x3d79f5){if(!_0x3d79f5){_0x2e7406['sendStatus'](0x194);}return _0x3d79f5;};}function handleError(_0x445e35,_0x425783){_0x425783=_0x425783||0x1f4;return function(_0x59ad7b){logger['error'](_0x59ad7b[_0x1dad('0x2a')]);if(_0x59ad7b[_0x1dad('0x2b')]){delete _0x59ad7b[_0x1dad('0x2b')];}_0x445e35[_0x1dad('0x1d')](_0x425783)['send'](_0x59ad7b);};}exports[_0x1dad('0x2c')]=function(_0x548899,_0x58d3ce){var _0x443175={},_0x5d8cfd={},_0x483a3c={'count':0x0,'rows':[]};var _0x20803d=db[_0x1dad('0x2d')]['rawAttributes'];_0x5d8cfd[_0x1dad('0x2e')]=_['keys'](_0x20803d);_0x5d8cfd[_0x1dad('0x2f')]=_['keys'](_0x548899['query']);_0x5d8cfd['filters']=_[_0x1dad('0x30')](_0x5d8cfd[_0x1dad('0x2e')],_0x5d8cfd['query']);_0x443175[_0x1dad('0x31')]=_['intersection'](_0x5d8cfd[_0x1dad('0x2e')],qs[_0x1dad('0x32')](_0x548899[_0x1dad('0x2f')][_0x1dad('0x32')]));_0x443175[_0x1dad('0x31')]=_0x443175[_0x1dad('0x31')][_0x1dad('0x33')]?_0x443175[_0x1dad('0x31')]:_0x5d8cfd[_0x1dad('0x2e')];if(!_0x548899['query'][_0x1dad('0x34')](_0x1dad('0x35'))){_0x443175[_0x1dad('0x22')]=qs[_0x1dad('0x22')](_0x548899[_0x1dad('0x2f')][_0x1dad('0x22')]);_0x443175['offset']=qs[_0x1dad('0x21')](_0x548899[_0x1dad('0x2f')][_0x1dad('0x21')]);}_0x443175['order']=qs[_0x1dad('0x36')](_0x548899[_0x1dad('0x2f')][_0x1dad('0x36')]);_0x443175['where']=qs['filters'](_[_0x1dad('0x37')](_0x548899['query'],_0x5d8cfd[_0x1dad('0x38')]));if(_0x548899['query']['filter']){_0x443175[_0x1dad('0x39')]=_['merge'](_0x443175[_0x1dad('0x39')],{'$or':_[_0x1dad('0x3a')](_0x20803d,function(_0x231a21){if(_0x231a21[_0x1dad('0x3b')][_0x1dad('0x3c')]!==_0x1dad('0x3d')){var _0x245e78={};_0x245e78[_0x231a21[_0x1dad('0x3e')]]={'$like':'%'+_0x548899['query'][_0x1dad('0x3f')]+'%'};return _0x245e78;}})});}_0x443175=_[_0x1dad('0x40')]({},_0x443175,_0x548899[_0x1dad('0x41')]);var _0x5abd0e={'where':_0x443175[_0x1dad('0x39')]};return db[_0x1dad('0x2d')][_0x1dad('0x20')](_0x5abd0e)[_0x1dad('0x26')](function(_0x3ce9cd){_0x483a3c[_0x1dad('0x20')]=_0x3ce9cd;if(_0x548899[_0x1dad('0x2f')][_0x1dad('0x42')]){_0x443175[_0x1dad('0x43')]=[{'all':!![]}];}return db[_0x1dad('0x2d')][_0x1dad('0x44')](_0x443175);})[_0x1dad('0x26')](function(_0x14372f){_0x483a3c[_0x1dad('0x45')]=_0x14372f;return _0x483a3c;})[_0x1dad('0x26')](respondWithFilteredResult(_0x58d3ce,_0x443175))[_0x1dad('0x46')](handleError(_0x58d3ce,null));};exports['show']=function(_0x54d308,_0x4a51df){var _0x37b5ff={'raw':!![],'where':{'id':_0x54d308[_0x1dad('0x47')]['id']}},_0x37a9cb={};_0x37a9cb[_0x1dad('0x2e')]=_['keys'](db[_0x1dad('0x2d')][_0x1dad('0x48')]);_0x37a9cb[_0x1dad('0x2f')]=_[_0x1dad('0x49')](_0x54d308[_0x1dad('0x2f')]);_0x37a9cb[_0x1dad('0x38')]=_['intersection'](_0x37a9cb['model'],_0x37a9cb[_0x1dad('0x2f')]);_0x37b5ff[_0x1dad('0x31')]=_[_0x1dad('0x30')](_0x37a9cb[_0x1dad('0x2e')],qs[_0x1dad('0x32')](_0x54d308[_0x1dad('0x2f')][_0x1dad('0x32')]));_0x37b5ff[_0x1dad('0x31')]=_0x37b5ff[_0x1dad('0x31')][_0x1dad('0x33')]?_0x37b5ff['attributes']:_0x37a9cb[_0x1dad('0x2e')];if(_0x54d308[_0x1dad('0x2f')]['includeAll']){_0x37b5ff[_0x1dad('0x43')]=[{'all':!![]}];}_0x37b5ff=_[_0x1dad('0x40')]({},_0x37b5ff,_0x54d308[_0x1dad('0x41')]);return db[_0x1dad('0x2d')][_0x1dad('0x4a')](_0x37b5ff)[_0x1dad('0x26')](handleEntityNotFound(_0x4a51df,null))[_0x1dad('0x26')](respondWithResult(_0x4a51df,null))[_0x1dad('0x46')](handleError(_0x4a51df,null));};exports[_0x1dad('0x4b')]=function(_0x1ff5ff,_0x5b94b8){return db[_0x1dad('0x2d')][_0x1dad('0x4b')](_0x1ff5ff['body'],{})[_0x1dad('0x26')](function(_0x478893){var _0x182be8=_0x1ff5ff['user']['get']({'plain':!![]});if(!_0x182be8)throw new Error(_0x1dad('0x4c'));if(_0x182be8[_0x1dad('0x4d')]===_0x1dad('0x4e')){var _0x1e7d2f=_0x478893['get']({'plain':!![]});var _0x1ebbe1=_0x1dad('0x4f');return db[_0x1dad('0x50')][_0x1dad('0x4a')]({'where':{'name':_0x1ebbe1,'userProfileId':_0x182be8[_0x1dad('0x51')]},'raw':!![]})['then'](function(_0x59c39a){if(_0x59c39a&&_0x59c39a[_0x1dad('0x52')]===0x0){return db['UserProfileResource'][_0x1dad('0x4b')]({'name':_0x1e7d2f[_0x1dad('0x2b')],'resourceId':_0x1e7d2f['id'],'type':_0x59c39a[_0x1dad('0x2b')],'sectionId':_0x59c39a['id']},{})[_0x1dad('0x26')](function(){return _0x478893;});}else{return _0x478893;}})[_0x1dad('0x46')](function(_0x5318dc){logger[_0x1dad('0x53')](_0x1dad('0x54'),_0x5318dc);throw _0x5318dc;});}return _0x478893;})['then'](respondWithResult(_0x5b94b8,0xc9))['catch'](handleError(_0x5b94b8,null));};exports[_0x1dad('0x25')]=function(_0x26d8c5,_0x9c863){if(_0x26d8c5[_0x1dad('0x55')]['id']){delete _0x26d8c5[_0x1dad('0x55')]['id'];}return db['MailQueue'][_0x1dad('0x4a')]({'where':{'id':_0x26d8c5[_0x1dad('0x47')]['id']}})[_0x1dad('0x26')](handleEntityNotFound(_0x9c863,null))[_0x1dad('0x26')](saveUpdates(_0x26d8c5[_0x1dad('0x55')],null))[_0x1dad('0x26')](respondWithResult(_0x9c863,null))[_0x1dad('0x46')](handleError(_0x9c863,null));};exports[_0x1dad('0x27')]=function(_0x2c3e90,_0x1fb65c){return db[_0x1dad('0x2d')][_0x1dad('0x4a')]({'where':{'id':_0x2c3e90['params']['id']}})['then'](handleEntityNotFound(_0x1fb65c,null))[_0x1dad('0x26')](removeEntity(_0x1fb65c,null))[_0x1dad('0x46')](handleError(_0x1fb65c,null));};exports[_0x1dad('0x56')]=function(_0xd96064,_0x44bfc8){return db[_0x1dad('0x2d')]['describe']()[_0x1dad('0x26')](respondWithResult(_0x44bfc8,null))['catch'](handleError(_0x44bfc8,null));};exports[_0x1dad('0x57')]=function(_0x2e8cd4,_0x147d66,_0x7f60fe){var _0x8dd4e5={'raw':!![],'where':{}},_0x2099e2={},_0x1af1d2;return db['MailQueue'][_0x1dad('0x58')]({'where':{'id':_0x2e8cd4['params']['id']}})[_0x1dad('0x26')](handleEntityNotFound(_0x147d66,null))[_0x1dad('0x26')](function(_0x1bedf9){if(_0x1bedf9){_0x1af1d2=_0x1bedf9['get']({'plain':!![]});_0x2099e2[_0x1dad('0x2e')]=_[_0x1dad('0x49')](db['UserMailQueue'][_0x1dad('0x48')]);_0x2099e2['query']=_[_0x1dad('0x49')](_0x2e8cd4[_0x1dad('0x2f')]);_0x2099e2[_0x1dad('0x38')]=_[_0x1dad('0x30')](_0x2099e2[_0x1dad('0x2e')],_0x2099e2[_0x1dad('0x2f')]);_0x8dd4e5[_0x1dad('0x31')]=_[_0x1dad('0x30')](_0x2099e2['model'],qs['fields'](_0x2e8cd4[_0x1dad('0x2f')]['fields']));_0x8dd4e5[_0x1dad('0x31')]=_0x8dd4e5[_0x1dad('0x31')][_0x1dad('0x33')]?_0x8dd4e5['attributes']:_0x2099e2['model'];if(!_0x2e8cd4[_0x1dad('0x2f')][_0x1dad('0x34')](_0x1dad('0x35'))){_0x8dd4e5['limit']=qs[_0x1dad('0x22')](_0x2e8cd4['query'][_0x1dad('0x22')]);_0x8dd4e5['offset']=qs[_0x1dad('0x21')](_0x2e8cd4[_0x1dad('0x2f')][_0x1dad('0x21')]);}_0x8dd4e5['order']=qs['sort'](_0x2e8cd4[_0x1dad('0x2f')][_0x1dad('0x36')]);_0x8dd4e5[_0x1dad('0x39')]=qs[_0x1dad('0x38')](_[_0x1dad('0x37')](_0x2e8cd4[_0x1dad('0x2f')],_0x2099e2['filters']));_0x8dd4e5[_0x1dad('0x39')]['MailQueueId']=_0x1bedf9['id'];if(_0x2e8cd4[_0x1dad('0x2f')][_0x1dad('0x3f')]){_0x8dd4e5[_0x1dad('0x39')]=_[_0x1dad('0x40')](_0x8dd4e5[_0x1dad('0x39')],{'$or':_[_0x1dad('0x3a')](_0x8dd4e5[_0x1dad('0x31')],function(_0x20cb60){var _0x13d6c4={};_0x13d6c4[_0x20cb60]={'$like':'%'+_0x2e8cd4['query'][_0x1dad('0x3f')]+'%'};return _0x13d6c4;})});}_0x8dd4e5=_['merge']({},_0x8dd4e5,_0x2e8cd4['options']);return db[_0x1dad('0x59')][_0x1dad('0x44')](_0x8dd4e5);}})[_0x1dad('0x26')](function(_0x25fc8d){if(_0x25fc8d){return db['User'][_0x1dad('0x5a')]({'where':{'id':_[_0x1dad('0x3a')](_0x25fc8d,_0x1dad('0x5b')),'role':_0x1dad('0x5c')},'attributes':['id',_0x1dad('0x2b'),_0x1dad('0x5d'),_0x1dad('0x5e'),'createdAt']});}})[_0x1dad('0x26')](function(_0x29e7f6){if(_0x29e7f6){return{'count':_0x29e7f6[_0x1dad('0x20')],'rows':_[_0x1dad('0x3a')](_0x29e7f6[_0x1dad('0x45')],function(_0x2169df){return{'membername':_0x2169df['name'],'UserId':_0x2169df['id'],'queue_name':_0x1af1d2['name'],'MailQueueId':_0x1af1d2['id'],'interface':util['format'](_0x1dad('0x5f'),_0x1dad('0x60'),_0x2169df['name']),'penalty':0x0,'paused':_0x2169df['mailPause'],'createdAt':_0x2169df[_0x1dad('0x61')],'updatedAt':_0x2169df[_0x1dad('0x5e')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x1dad('0x26')](respondWithFilteredResult(_0x147d66,_0x8dd4e5))[_0x1dad('0x46')](handleError(_0x147d66,null));};exports[_0x1dad('0x62')]=function(_0x4fe634,_0x4de354,_0x1428c7){var _0x28bdc6={};var _0x3ba630={};var _0x1ec8a4;var _0x5068d9;return db[_0x1dad('0x2d')][_0x1dad('0x58')]({'where':{'id':_0x4fe634['params']['id']}})[_0x1dad('0x26')](handleEntityNotFound(_0x4de354,null))['then'](function(_0x2a7120){if(_0x2a7120){_0x1ec8a4=_0x2a7120;_0x3ba630[_0x1dad('0x2e')]=_[_0x1dad('0x49')](db[_0x1dad('0x63')][_0x1dad('0x48')]);_0x3ba630['query']=_[_0x1dad('0x49')](_0x4fe634[_0x1dad('0x2f')]);_0x3ba630[_0x1dad('0x38')]=_[_0x1dad('0x30')](_0x3ba630[_0x1dad('0x2e')],_0x3ba630['query']);_0x28bdc6[_0x1dad('0x31')]=_[_0x1dad('0x30')](_0x3ba630[_0x1dad('0x2e')],qs[_0x1dad('0x32')](_0x4fe634['query'][_0x1dad('0x32')]));_0x28bdc6[_0x1dad('0x31')]=_0x28bdc6[_0x1dad('0x31')][_0x1dad('0x33')]?_0x28bdc6[_0x1dad('0x31')]:_0x3ba630[_0x1dad('0x2e')];_0x28bdc6[_0x1dad('0x64')]=qs['sort'](_0x4fe634[_0x1dad('0x2f')][_0x1dad('0x36')]);_0x28bdc6[_0x1dad('0x39')]=qs['filters'](_[_0x1dad('0x37')](_0x4fe634[_0x1dad('0x2f')],_0x3ba630[_0x1dad('0x38')]));if(_0x4fe634[_0x1dad('0x2f')][_0x1dad('0x3f')]){_0x28bdc6['where']=_['merge'](_0x28bdc6[_0x1dad('0x39')],{'$or':_[_0x1dad('0x3a')](_0x28bdc6['attributes'],function(_0x364f46){var _0x54397e={};_0x54397e[_0x364f46]={'$like':'%'+_0x4fe634[_0x1dad('0x2f')][_0x1dad('0x3f')]+'%'};return _0x54397e;})});}_0x28bdc6=_['merge']({},_0x28bdc6,_0x4fe634[_0x1dad('0x41')]);return _0x1ec8a4[_0x1dad('0x62')](_0x28bdc6);}})[_0x1dad('0x26')](function(_0xe9c602){if(_0xe9c602){_0x5068d9=_0xe9c602['length'];if(!_0x4fe634[_0x1dad('0x2f')][_0x1dad('0x34')](_0x1dad('0x35'))){_0x28bdc6[_0x1dad('0x22')]=qs[_0x1dad('0x22')](_0x4fe634[_0x1dad('0x2f')][_0x1dad('0x22')]);_0x28bdc6['offset']=qs[_0x1dad('0x21')](_0x4fe634['query']['offset']);}return _0x1ec8a4[_0x1dad('0x62')](_0x28bdc6);}})['then'](function(_0x24d43e){if(_0x24d43e){return _0x24d43e?{'count':_0x5068d9,'rows':_0x24d43e}:null;}})[_0x1dad('0x26')](respondWithResult(_0x4de354,null))[_0x1dad('0x46')](handleError(_0x4de354,null));};exports[_0x1dad('0x65')]=function(_0x519fc4,_0xf0221c,_0x5a8ddb){var _0x29ba43=_0x519fc4[_0x1dad('0x55')]['ids'];return db[_0x1dad('0x63')][_0x1dad('0x44')]({'where':{'id':_0x29ba43},'attributes':['id'],'include':[{'model':db[_0x1dad('0x66')],'as':_0x1dad('0x67'),'attributes':['id',_0x1dad('0x2b'),_0x1dad('0x68'),_0x1dad('0x69'),_0x1dad('0x6a')],'raw':!![]}]})[_0x1dad('0x26')](function(_0x46ff85){if(_0x46ff85){var _0x55f3ef=_[_0x1dad('0x6b')](_0x46ff85,function(_0x43d1e9){var _0x1ad888=_0x43d1e9[_0x1dad('0x28')]({'plain':!![]});return _0x1ad888[_0x1dad('0x67')];});return db['MailQueue'][_0x1dad('0x4a')]({'where':{'id':_0x519fc4[_0x1dad('0x47')]['id']}})[_0x1dad('0x26')](function(_0x15bbd0){return db[_0x1dad('0x6c')][_0x1dad('0x6d')](function(_0x48913d){return _0x15bbd0['addTeams'](_0x29ba43,{'transaction':_0x48913d})[_0x1dad('0x26')](function(){return BPromise['each'](_0x55f3ef,function(_0x4ff793){return db[_0x1dad('0x59')][_0x1dad('0x6e')]({'where':{'UserId':_0x4ff793['id'],'MailQueueId':_0x519fc4[_0x1dad('0x47')]['id']},'transaction':_0x48913d});});})[_0x1dad('0x26')](function(){_0x55f3ef['forEach'](function(_0x752e80){socket[_0x1dad('0x6f')](_0x1dad('0x70'),{'UserId':_0x752e80['id'],'MailQueueId':_0x15bbd0['id']});});});});});}})[_0x1dad('0x26')](respondWithStatusCode(_0xf0221c,null))[_0x1dad('0x46')](handleError(_0xf0221c,null));};exports['removeTeams']=function(_0x2c7de7,_0x52c15b,_0x413be9){return db[_0x1dad('0x63')][_0x1dad('0x44')]({'where':{'id':_0x2c7de7[_0x1dad('0x2f')][_0x1dad('0x71')]},'attributes':['id'],'include':[{'model':db[_0x1dad('0x66')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x1dad('0x26')](handleEntityNotFound(_0x52c15b,null))[_0x1dad('0x26')](function(_0x285677){var _0xea5554=_[_0x1dad('0x3a')](_0x285677,'id');var _0x2842c1=[];var _0x3ae365=[];var _0x23a27a=squel[_0x1dad('0x72')]();_0x23a27a[_0x1dad('0x3e')](_0x1dad('0x73'))[_0x1dad('0x74')](_0x1dad('0x75'),'tq')[_0x1dad('0x76')](_0x1dad('0x77'),'ut',_0x1dad('0x78'))[_0x1dad('0x39')](_0x1dad('0x79'),_0x2c7de7[_0x1dad('0x47')]['id']);for(var _0x57be7a=0x0;_0x57be7a<_0x285677[_0x1dad('0x33')];_0x57be7a+=0x1){let _0x19de65=_0x285677[_0x57be7a];for(var _0x39d81a=0x0;_0x39d81a<_0x19de65[_0x1dad('0x67')][_0x1dad('0x33')];_0x39d81a+=0x1){let _0x1e2640=_0x19de65[_0x1dad('0x67')][_0x39d81a];var _0x5097ea=_0x23a27a['clone']();_0x5097ea[_0x1dad('0x39')](_0x1dad('0x7a'),_0x1e2640['id']);_0x3ae365['push'](db['sequelize']['query'](_0x5097ea[_0x1dad('0x7b')](),{'type':db[_0x1dad('0x6c')][_0x1dad('0x7c')][_0x1dad('0x7d')]})['then'](function(_0x4a4511){if(_0x4a4511[_0x1dad('0x33')]===0x1){return _0x1e2640['id'];}else{var _0x43175c=_[_0x1dad('0x7e')](_[_0x1dad('0x3a')](_0x4a4511,_0x1dad('0x7f')),function(_0x55da2a){return _['includes'](_0xea5554,_0x55da2a);});if(_0x43175c){return _0x1e2640['id'];}}}));}}return BPromise[_0x1dad('0x80')](_0x3ae365)[_0x1dad('0x26')](function(_0x37b151){_0x2842c1=_(_0x2842c1)['union'](_0x37b151)[_0x1dad('0x81')]()[_0x1dad('0x82')]();return db[_0x1dad('0x2d')][_0x1dad('0x4a')]({'where':{'id':_0x2c7de7[_0x1dad('0x47')]['id']}})[_0x1dad('0x26')](function(_0x11c370){return db[_0x1dad('0x6c')]['transaction'](function(_0x390afb){return _0x11c370[_0x1dad('0x83')](_0x2c7de7[_0x1dad('0x2f')][_0x1dad('0x71')],{'transaction':_0x390afb})[_0x1dad('0x26')](function(){if(!_[_0x1dad('0x84')](_0x2842c1)){return _0x11c370[_0x1dad('0x85')](_0x2842c1,{'transaction':_0x390afb});}})['then'](function(){_0x2842c1[_0x1dad('0x86')](function(_0x2cf1bf){socket[_0x1dad('0x6f')](_0x1dad('0x87'),{'UserId':_0x2cf1bf,'MailQueueId':_0x11c370['id']});});});});});});})[_0x1dad('0x26')](respondWithStatusCode(_0x52c15b,null))[_0x1dad('0x46')](handleError(_0x52c15b,null));};exports[_0x1dad('0x88')]=function(_0x438ca3,_0x1a09e8,_0x149ba6){return db[_0x1dad('0x2d')][_0x1dad('0x4a')]({'where':{'id':_0x438ca3[_0x1dad('0x47')]['id']}})['then'](handleEntityNotFound(_0x1a09e8,null))[_0x1dad('0x26')](function(_0x5ecfd5){if(_0x5ecfd5){return _0x5ecfd5[_0x1dad('0x88')](_0x438ca3[_0x1dad('0x55')][_0x1dad('0x71')],_[_0x1dad('0x89')](_0x438ca3[_0x1dad('0x55')],[_0x1dad('0x71'),'id'])||{})[_0x1dad('0x8a')](function(_0x947db9){for(var _0x8d340c=0x0;_0x8d340c<_0x438ca3[_0x1dad('0x55')][_0x1dad('0x71')][_0x1dad('0x33')];_0x8d340c+=0x1){socket[_0x1dad('0x6f')](_0x1dad('0x70'),{'UserId':_0x438ca3[_0x1dad('0x55')][_0x1dad('0x71')][_0x8d340c],'MailQueueId':_0x438ca3[_0x1dad('0x47')]['id']});}return _0x947db9;});}})[_0x1dad('0x26')](respondWithResult(_0x1a09e8,null))[_0x1dad('0x46')](handleError(_0x1a09e8,null));};exports[_0x1dad('0x85')]=function(_0x40954a,_0x52ab60,_0x301895){return db[_0x1dad('0x2d')]['find']({'where':{'id':_0x40954a[_0x1dad('0x47')]['id']}})['then'](handleEntityNotFound(_0x52ab60,null))['then'](function(_0x150072){if(_0x150072){return _0x150072['removeAgents'](_0x40954a[_0x1dad('0x2f')][_0x1dad('0x71')])[_0x1dad('0x26')](function(){if(_[_0x1dad('0x8b')](_0x40954a[_0x1dad('0x2f')][_0x1dad('0x71')])){for(var _0x4275ff=0x0;_0x4275ff<_0x40954a[_0x1dad('0x2f')]['ids'][_0x1dad('0x33')];_0x4275ff+=0x1){socket[_0x1dad('0x6f')](_0x1dad('0x87'),{'UserId':Number(_0x40954a['query'][_0x1dad('0x71')][_0x4275ff]),'MailQueueId':Number(_0x40954a['params']['id'])});}}else{socket[_0x1dad('0x6f')](_0x1dad('0x87'),{'UserId':Number(_0x40954a[_0x1dad('0x2f')]['ids']),'MailQueueId':Number(_0x40954a['params']['id'])});}});}})[_0x1dad('0x26')](respondWithStatusCode(_0x52ab60,null))['catch'](handleError(_0x52ab60,null));};exports['getAgents']=function(_0xa6c45f,_0x1a8b5,_0x23dc1b){var _0x5631d5={};var _0x9f2b9={};var _0x4b5b87;var _0xad47b9;return db[_0x1dad('0x2d')][_0x1dad('0x58')]({'where':{'id':_0xa6c45f[_0x1dad('0x47')]['id']}})[_0x1dad('0x26')](handleEntityNotFound(_0x1a8b5,null))[_0x1dad('0x26')](function(_0x7344ce){if(_0x7344ce){_0x4b5b87=_0x7344ce;_0x9f2b9[_0x1dad('0x2e')]=_['keys'](db['User']['rawAttributes']);_0x9f2b9['query']=_[_0x1dad('0x49')](_0xa6c45f[_0x1dad('0x2f')]);_0x9f2b9[_0x1dad('0x38')]=_[_0x1dad('0x30')](_0x9f2b9[_0x1dad('0x2e')],_0x9f2b9[_0x1dad('0x2f')]);_0x5631d5['attributes']=_[_0x1dad('0x30')](_0x9f2b9[_0x1dad('0x2e')],qs[_0x1dad('0x32')](_0xa6c45f[_0x1dad('0x2f')][_0x1dad('0x32')]));_0x5631d5['attributes']=_0x5631d5[_0x1dad('0x31')][_0x1dad('0x33')]?_0x5631d5['attributes']:_0x9f2b9['model'];_0x5631d5['order']=qs[_0x1dad('0x36')](_0xa6c45f[_0x1dad('0x2f')][_0x1dad('0x36')]);_0x5631d5[_0x1dad('0x39')]=qs['filters'](_[_0x1dad('0x37')](_0xa6c45f['query'],_0x9f2b9[_0x1dad('0x38')]));if(_0xa6c45f[_0x1dad('0x2f')][_0x1dad('0x3f')]){_0x5631d5[_0x1dad('0x39')]=_[_0x1dad('0x40')](_0x5631d5[_0x1dad('0x39')],{'$or':_[_0x1dad('0x3a')](_0x5631d5['attributes'],function(_0x446a8a){var _0x28061f={};_0x28061f[_0x446a8a]={'$like':'%'+_0xa6c45f['query'][_0x1dad('0x3f')]+'%'};return _0x28061f;})});}_0x5631d5=_['merge']({},_0x5631d5,_0xa6c45f['options']);return _0x4b5b87['getAgents'](_0x5631d5);}})[_0x1dad('0x26')](function(_0x115eeb){if(_0x115eeb){_0xad47b9=_0x115eeb[_0x1dad('0x33')];if(!_0xa6c45f[_0x1dad('0x2f')][_0x1dad('0x34')](_0x1dad('0x35'))){_0x5631d5[_0x1dad('0x22')]=qs[_0x1dad('0x22')](_0xa6c45f['query'][_0x1dad('0x22')]);_0x5631d5[_0x1dad('0x21')]=qs[_0x1dad('0x21')](_0xa6c45f[_0x1dad('0x2f')][_0x1dad('0x21')]);}return _0x4b5b87[_0x1dad('0x8c')](_0x5631d5);}})[_0x1dad('0x26')](function(_0x53722b){if(_0x53722b){return _0x53722b?{'count':_0xad47b9,'rows':_0x53722b}:null;}})[_0x1dad('0x26')](respondWithResult(_0x1a8b5,null))['catch'](handleError(_0x1a8b5,null));}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.events.js b/server/api/mailQueue/mailQueue.events.js index e3d5728..26bf1c8 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 _0x5ab4=['../../mysqldb','MailQueue','setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x623e7,_0x1bef7d){var _0x121131=function(_0x59b734){while(--_0x59b734){_0x623e7['push'](_0x623e7['shift']());}};_0x121131(++_0x1bef7d);}(_0x5ab4,0x9f));var _0x45ab=function(_0x437771,_0x4bd667){_0x437771=_0x437771-0x0;var _0x46b57f=_0x5ab4[_0x437771];return _0x46b57f;};'use strict';var EventEmitter=require(_0x45ab('0x0'));var MailQueue=require(_0x45ab('0x1'))['db'][_0x45ab('0x2')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0x45ab('0x3')](0x0);var events={'afterCreate':_0x45ab('0x4'),'afterUpdate':'update','afterDestroy':_0x45ab('0x5')};function emitEvent(_0x2d0e3b){return function(_0x3d5dbd,_0x44ad44,_0x2bf7b8){MailQueueEvents[_0x45ab('0x6')](_0x2d0e3b+':'+_0x3d5dbd['id'],_0x3d5dbd);MailQueueEvents['emit'](_0x2d0e3b,_0x3d5dbd);_0x2bf7b8(null);};}for(var e in events){if(events[_0x45ab('0x7')](e)){var event=events[e];MailQueue[_0x45ab('0x8')](e,emitEvent(event));}}module[_0x45ab('0x9')]=MailQueueEvents; \ No newline at end of file +var _0x3715=['update','remove','emit','hasOwnProperty','hook','events','../../mysqldb','MailQueue','setMaxListeners','save'];(function(_0x30f6bd,_0x1745f6){var _0x33ccc7=function(_0x687ab5){while(--_0x687ab5){_0x30f6bd['push'](_0x30f6bd['shift']());}};_0x33ccc7(++_0x1745f6);}(_0x3715,0xc3));var _0x5371=function(_0x3c989a,_0x3fd192){_0x3c989a=_0x3c989a-0x0;var _0x139a6f=_0x3715[_0x3c989a];return _0x139a6f;};'use strict';var EventEmitter=require(_0x5371('0x0'));var MailQueue=require(_0x5371('0x1'))['db'][_0x5371('0x2')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0x5371('0x3')](0x0);var events={'afterCreate':_0x5371('0x4'),'afterUpdate':_0x5371('0x5'),'afterDestroy':_0x5371('0x6')};function emitEvent(_0x396146){return function(_0x3ff067,_0x355d6a,_0x13c458){MailQueueEvents[_0x5371('0x7')](_0x396146+':'+_0x3ff067['id'],_0x3ff067);MailQueueEvents['emit'](_0x396146,_0x3ff067);_0x13c458(null);};}for(var e in events){if(events[_0x5371('0x8')](e)){var event=events[e];MailQueue[_0x5371('0x9')](e,emitEvent(event));}}module['exports']=MailQueueEvents; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.model.js b/server/api/mailQueue/mailQueue.model.js index a5fb48b..df9f3ba 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 _0xc761=['bluebird','request-promise','path','rimraf','../../config/environment','./mailQueue.attributes','exports','MailQueue','mail_queues','lodash','util','../../config/logger','api','moment'];(function(_0x4db38f,_0x44ce7c){var _0x49c92f=function(_0x153b58){while(--_0x153b58){_0x4db38f['push'](_0x4db38f['shift']());}};_0x49c92f(++_0x44ce7c);}(_0xc761,0x183));var _0x1c76=function(_0x313c96,_0x3cee6e){_0x313c96=_0x313c96-0x0;var _0x522f53=_0xc761[_0x313c96];return _0x522f53;};'use strict';var _=require(_0x1c76('0x0'));var util=require(_0x1c76('0x1'));var logger=require(_0x1c76('0x2'))(_0x1c76('0x3'));var moment=require(_0x1c76('0x4'));var BPromise=require(_0x1c76('0x5'));var rp=require(_0x1c76('0x6'));var fs=require('fs');var path=require(_0x1c76('0x7'));var rimraf=require(_0x1c76('0x8'));var config=require(_0x1c76('0x9'));var attributes=require(_0x1c76('0xa'));module[_0x1c76('0xb')]=function(_0x452160,_0x2f60cf){return _0x452160['define'](_0x1c76('0xc'),attributes,{'tableName':_0x1c76('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1bcb=['util','../../config/logger','api','request-promise','../../config/environment','./mailQueue.attributes','exports','define','MailQueue','mail_queues','lodash'];(function(_0x27364a,_0x40a0c2){var _0x1f2b00=function(_0x400109){while(--_0x400109){_0x27364a['push'](_0x27364a['shift']());}};_0x1f2b00(++_0x40a0c2);}(_0x1bcb,0xfc));var _0xb1bc=function(_0x3709c1,_0xcf2605){_0x3709c1=_0x3709c1-0x0;var _0x453e28=_0x1bcb[_0x3709c1];return _0x453e28;};'use strict';var _=require(_0xb1bc('0x0'));var util=require(_0xb1bc('0x1'));var logger=require(_0xb1bc('0x2'))(_0xb1bc('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xb1bc('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xb1bc('0x5'));var attributes=require(_0xb1bc('0x6'));module[_0xb1bc('0x7')]=function(_0x58f2f7,_0x386b75){return _0x58f2f7[_0xb1bc('0x8')](_0xb1bc('0x9'),attributes,{'tableName':_0xb1bc('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.rpc.js b/server/api/mailQueue/mailQueue.rpc.js index a60f640..01fdd29 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 _0x8d73=['MailQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','GetMailQueue','findAll','options','raw','where','attributes','limit','map','include','model','ShowMailQueue','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','client','http','redis','localhost','then','info'];(function(_0x1820a8,_0x30c437){var _0x287fe4=function(_0x27ec25){while(--_0x27ec25){_0x1820a8['push'](_0x1820a8['shift']());}};_0x287fe4(++_0x30c437);}(_0x8d73,0x1e4));var _0x38d7=function(_0xddb854,_0x24e109){_0xddb854=_0xddb854-0x0;var _0x598620=_0x8d73[_0xddb854];return _0x598620;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x38d7('0x0'));var BPromise=require(_0x38d7('0x1'));var rs=require(_0x38d7('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x38d7('0x3'))['db'];var utils=require(_0x38d7('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x38d7('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x38d7('0x6')][_0x38d7('0x7')]({'port':0x232a});config['redis']=_['defaults'](config[_0x38d7('0x8')],{'host':_0x38d7('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x38d7('0x8')]));require('./mailQueue.socket')['register'](socket);function respondWithRpcPromise(_0x1eb74d,_0x3632c1,_0x25ea38){return new BPromise(function(_0x2d0d48,_0x2837a2){return client['request'](_0x1eb74d,_0x25ea38)[_0x38d7('0xa')](function(_0x5a0bb9){logger[_0x38d7('0xb')](_0x38d7('0xc'),_0x3632c1,_0x38d7('0xd'));logger[_0x38d7('0xe')]('MailQueue,\x20%s,\x20%s,\x20%s',_0x3632c1,_0x38d7('0xd'),JSON[_0x38d7('0xf')](_0x5a0bb9));if(_0x5a0bb9[_0x38d7('0x10')]){if(_0x5a0bb9[_0x38d7('0x10')]['code']===0x1f4){logger[_0x38d7('0x10')](_0x38d7('0xc'),_0x3632c1,_0x5a0bb9[_0x38d7('0x10')]['message']);return _0x2837a2(_0x5a0bb9[_0x38d7('0x10')][_0x38d7('0x11')]);}logger[_0x38d7('0x10')](_0x38d7('0xc'),_0x3632c1,_0x5a0bb9[_0x38d7('0x10')][_0x38d7('0x11')]);return _0x2d0d48(_0x5a0bb9[_0x38d7('0x10')]['message']);}else{logger[_0x38d7('0xb')](_0x38d7('0xc'),_0x3632c1,'request\x20sent');_0x2d0d48(_0x5a0bb9[_0x38d7('0x12')][_0x38d7('0x11')]);}})[_0x38d7('0x13')](function(_0x3d5163){logger[_0x38d7('0x10')](_0x38d7('0xc'),_0x3632c1,_0x3d5163);_0x2837a2(_0x3d5163);});});}exports[_0x38d7('0x14')]=function(_0x2d48de){var _0x4e0f9b=this;return new Promise(function(_0x1cc232,_0x5bb951){return db['MailQueue'][_0x38d7('0x15')]({'raw':_0x2d48de[_0x38d7('0x16')]?_0x2d48de[_0x38d7('0x16')][_0x38d7('0x17')]===undefined?!![]:![]:!![],'where':_0x2d48de[_0x38d7('0x16')]?_0x2d48de[_0x38d7('0x16')][_0x38d7('0x18')]||null:null,'attributes':_0x2d48de[_0x38d7('0x16')]?_0x2d48de[_0x38d7('0x16')][_0x38d7('0x19')]||null:null,'limit':_0x2d48de[_0x38d7('0x16')]?_0x2d48de[_0x38d7('0x16')][_0x38d7('0x1a')]||null:null,'include':_0x2d48de[_0x38d7('0x16')]?_0x2d48de[_0x38d7('0x16')]['include']?_[_0x38d7('0x1b')](_0x2d48de[_0x38d7('0x16')][_0x38d7('0x1c')],function(_0x43e7ec){return{'model':db[_0x43e7ec[_0x38d7('0x1d')]],'as':_0x43e7ec['as'],'attributes':_0x43e7ec[_0x38d7('0x19')],'include':_0x43e7ec[_0x38d7('0x1c')]?_[_0x38d7('0x1b')](_0x43e7ec[_0x38d7('0x1c')],function(_0x261cd1){return{'model':db[_0x261cd1[_0x38d7('0x1d')]],'as':_0x261cd1['as'],'attributes':_0x261cd1[_0x38d7('0x19')],'include':_0x261cd1[_0x38d7('0x1c')]?_[_0x38d7('0x1b')](_0x261cd1[_0x38d7('0x1c')],function(_0x5ee883){return{'model':db[_0x5ee883[_0x38d7('0x1d')]],'as':_0x5ee883['as'],'attributes':_0x5ee883['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x5708af){logger['info'](_0x38d7('0x14'),_0x2d48de);logger[_0x38d7('0xe')](_0x38d7('0x14'),_0x2d48de,JSON['stringify'](_0x5708af));_0x1cc232(_0x5708af);})['catch'](function(_0x24d5e9){logger['error'](_0x38d7('0x14'),_0x24d5e9['message'],_0x2d48de);_0x5bb951(_0x4e0f9b[_0x38d7('0x10')](0x1f4,_0x24d5e9[_0x38d7('0x11')]));});});};exports[_0x38d7('0x1e')]=function(_0x26ae1a){var _0x4c5e99=this;return new Promise(function(_0x3af965,_0x2b5e9a){return db['MailQueue']['find']({'raw':_0x26ae1a[_0x38d7('0x16')]?_0x26ae1a['options'][_0x38d7('0x17')]===undefined?!![]:![]:!![],'where':_0x26ae1a[_0x38d7('0x16')]?_0x26ae1a[_0x38d7('0x16')][_0x38d7('0x18')]||null:null,'attributes':_0x26ae1a[_0x38d7('0x16')]?_0x26ae1a[_0x38d7('0x16')][_0x38d7('0x19')]||null:null,'include':_0x26ae1a[_0x38d7('0x16')]?_0x26ae1a[_0x38d7('0x16')][_0x38d7('0x1c')]?_[_0x38d7('0x1b')](_0x26ae1a['options'][_0x38d7('0x1c')],function(_0x4c107c){return{'model':db[_0x4c107c[_0x38d7('0x1d')]],'as':_0x4c107c['as'],'attributes':_0x4c107c['attributes'],'include':_0x4c107c[_0x38d7('0x1c')]?_[_0x38d7('0x1b')](_0x4c107c['include'],function(_0x50a3a0){return{'model':db[_0x50a3a0[_0x38d7('0x1d')]],'as':_0x50a3a0['as'],'attributes':_0x50a3a0['attributes'],'include':_0x50a3a0[_0x38d7('0x1c')]?_['map'](_0x50a3a0['include'],function(_0x5ea1ce){return{'model':db[_0x5ea1ce[_0x38d7('0x1d')]],'as':_0x5ea1ce['as'],'attributes':_0x5ea1ce[_0x38d7('0x19')]};}):[]};}):[]};}):[]:[]})[_0x38d7('0xa')](function(_0x4787a2){logger[_0x38d7('0xb')]('ShowMailQueue',_0x26ae1a);logger['debug']('ShowMailQueue',_0x26ae1a,JSON[_0x38d7('0xf')](_0x4787a2));_0x3af965(_0x4787a2);})[_0x38d7('0x13')](function(_0x4f8172){logger[_0x38d7('0x10')]('ShowMailQueue',_0x4f8172[_0x38d7('0x11')],_0x26ae1a);_0x2b5e9a(_0x4c5e99['error'](0x1f4,_0x4f8172['message']));});});}; \ No newline at end of file +var _0x4a5e=['../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','./mailQueue.socket','register','request','then','info','MailQueue,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','GetMailQueue','findAll','options','where','limit','include','model','attributes','map','MailQueue','raw','ShowMailQueue','stringify','util','moment','bluebird','randomstring','ioredis','../../config/utils'];(function(_0x351eaa,_0x3b2643){var _0x167776=function(_0x90752b){while(--_0x90752b){_0x351eaa['push'](_0x351eaa['shift']());}};_0x167776(++_0x3b2643);}(_0x4a5e,0x162));var _0xe4a5=function(_0x3041ce,_0x382f98){_0x3041ce=_0x3041ce-0x0;var _0x68a7f9=_0x4a5e[_0x3041ce];return _0x68a7f9;};'use strict';var _=require('lodash');var util=require(_0xe4a5('0x0'));var moment=require(_0xe4a5('0x1'));var BPromise=require(_0xe4a5('0x2'));var rs=require(_0xe4a5('0x3'));var fs=require('fs');var Redis=require(_0xe4a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xe4a5('0x5'));var logger=require(_0xe4a5('0x6'))(_0xe4a5('0x7'));var config=require(_0xe4a5('0x8'));var jayson=require(_0xe4a5('0x9'));var client=jayson['client'][_0xe4a5('0xa')]({'port':0x232a});config[_0xe4a5('0xb')]=_[_0xe4a5('0xc')](config[_0xe4a5('0xb')],{'host':_0xe4a5('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe4a5('0xb')]));require(_0xe4a5('0xe'))[_0xe4a5('0xf')](socket);function respondWithRpcPromise(_0xab4320,_0x228cce,_0x15fdd9){return new BPromise(function(_0x388d4a,_0x447db2){return client[_0xe4a5('0x10')](_0xab4320,_0x15fdd9)[_0xe4a5('0x11')](function(_0x3bd64a){logger[_0xe4a5('0x12')](_0xe4a5('0x13'),_0x228cce,_0xe4a5('0x14'));logger[_0xe4a5('0x15')]('MailQueue,\x20%s,\x20%s,\x20%s',_0x228cce,_0xe4a5('0x14'),JSON['stringify'](_0x3bd64a));if(_0x3bd64a['error']){if(_0x3bd64a[_0xe4a5('0x16')][_0xe4a5('0x17')]===0x1f4){logger['error'](_0xe4a5('0x13'),_0x228cce,_0x3bd64a[_0xe4a5('0x16')]['message']);return _0x447db2(_0x3bd64a[_0xe4a5('0x16')][_0xe4a5('0x18')]);}logger[_0xe4a5('0x16')](_0xe4a5('0x13'),_0x228cce,_0x3bd64a[_0xe4a5('0x16')]['message']);return _0x388d4a(_0x3bd64a[_0xe4a5('0x16')][_0xe4a5('0x18')]);}else{logger[_0xe4a5('0x12')](_0xe4a5('0x13'),_0x228cce,_0xe4a5('0x14'));_0x388d4a(_0x3bd64a[_0xe4a5('0x19')][_0xe4a5('0x18')]);}})[_0xe4a5('0x1a')](function(_0x44af96){logger[_0xe4a5('0x16')](_0xe4a5('0x13'),_0x228cce,_0x44af96);_0x447db2(_0x44af96);});});}exports[_0xe4a5('0x1b')]=function(_0x107870){var _0x29085b=this;return new Promise(function(_0x109f47,_0x16aad6){return db['MailQueue'][_0xe4a5('0x1c')]({'raw':_0x107870[_0xe4a5('0x1d')]?_0x107870['options']['raw']===undefined?!![]:![]:!![],'where':_0x107870['options']?_0x107870[_0xe4a5('0x1d')][_0xe4a5('0x1e')]||null:null,'attributes':_0x107870[_0xe4a5('0x1d')]?_0x107870[_0xe4a5('0x1d')]['attributes']||null:null,'limit':_0x107870[_0xe4a5('0x1d')]?_0x107870[_0xe4a5('0x1d')][_0xe4a5('0x1f')]||null:null,'include':_0x107870[_0xe4a5('0x1d')]?_0x107870[_0xe4a5('0x1d')][_0xe4a5('0x20')]?_['map'](_0x107870[_0xe4a5('0x1d')][_0xe4a5('0x20')],function(_0x2e41d6){return{'model':db[_0x2e41d6[_0xe4a5('0x21')]],'as':_0x2e41d6['as'],'attributes':_0x2e41d6[_0xe4a5('0x22')],'include':_0x2e41d6[_0xe4a5('0x20')]?_[_0xe4a5('0x23')](_0x2e41d6['include'],function(_0x43ca1e){return{'model':db[_0x43ca1e[_0xe4a5('0x21')]],'as':_0x43ca1e['as'],'attributes':_0x43ca1e[_0xe4a5('0x22')],'include':_0x43ca1e[_0xe4a5('0x20')]?_[_0xe4a5('0x23')](_0x43ca1e['include'],function(_0x4c84cf){return{'model':db[_0x4c84cf[_0xe4a5('0x21')]],'as':_0x4c84cf['as'],'attributes':_0x4c84cf[_0xe4a5('0x22')]};}):[]};}):[]};}):[]:[]})[_0xe4a5('0x11')](function(_0x3e032b){logger['info']('GetMailQueue',_0x107870);logger['debug'](_0xe4a5('0x1b'),_0x107870,JSON['stringify'](_0x3e032b));_0x109f47(_0x3e032b);})[_0xe4a5('0x1a')](function(_0x216ab8){logger[_0xe4a5('0x16')](_0xe4a5('0x1b'),_0x216ab8['message'],_0x107870);_0x16aad6(_0x29085b[_0xe4a5('0x16')](0x1f4,_0x216ab8[_0xe4a5('0x18')]));});});};exports['ShowMailQueue']=function(_0x5b5473){var _0x4ed654=this;return new Promise(function(_0xa635f7,_0xf2444d){return db[_0xe4a5('0x24')]['find']({'raw':_0x5b5473['options']?_0x5b5473[_0xe4a5('0x1d')][_0xe4a5('0x25')]===undefined?!![]:![]:!![],'where':_0x5b5473[_0xe4a5('0x1d')]?_0x5b5473[_0xe4a5('0x1d')][_0xe4a5('0x1e')]||null:null,'attributes':_0x5b5473[_0xe4a5('0x1d')]?_0x5b5473['options'][_0xe4a5('0x22')]||null:null,'include':_0x5b5473['options']?_0x5b5473[_0xe4a5('0x1d')][_0xe4a5('0x20')]?_[_0xe4a5('0x23')](_0x5b5473[_0xe4a5('0x1d')][_0xe4a5('0x20')],function(_0x359c5e){return{'model':db[_0x359c5e[_0xe4a5('0x21')]],'as':_0x359c5e['as'],'attributes':_0x359c5e[_0xe4a5('0x22')],'include':_0x359c5e[_0xe4a5('0x20')]?_['map'](_0x359c5e[_0xe4a5('0x20')],function(_0x18852c){return{'model':db[_0x18852c[_0xe4a5('0x21')]],'as':_0x18852c['as'],'attributes':_0x18852c[_0xe4a5('0x22')],'include':_0x18852c['include']?_['map'](_0x18852c['include'],function(_0x524a9b){return{'model':db[_0x524a9b[_0xe4a5('0x21')]],'as':_0x524a9b['as'],'attributes':_0x524a9b[_0xe4a5('0x22')]};}):[]};}):[]};}):[]:[]})[_0xe4a5('0x11')](function(_0x9af73){logger[_0xe4a5('0x12')]('ShowMailQueue',_0x5b5473);logger[_0xe4a5('0x15')](_0xe4a5('0x26'),_0x5b5473,JSON[_0xe4a5('0x27')](_0x9af73));_0xa635f7(_0x9af73);})[_0xe4a5('0x1a')](function(_0x469e4b){logger[_0xe4a5('0x16')]('ShowMailQueue',_0x469e4b[_0xe4a5('0x18')],_0x5b5473);_0xf2444d(_0x4ed654[_0xe4a5('0x16')](0x1f4,_0x469e4b['message']));});});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.socket.js b/server/api/mailQueue/mailQueue.socket.js index 59bd61e..f2bfb66 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 _0x3d13=['register','length','mailQueue:','./mailQueue.events','save','update','removeListener'];(function(_0x2aab8e,_0x440d3b){var _0x2a67=function(_0x1503d2){while(--_0x1503d2){_0x2aab8e['push'](_0x2aab8e['shift']());}};_0x2a67(++_0x440d3b);}(_0x3d13,0x73));var _0x33d1=function(_0x19f26b,_0x428ade){_0x19f26b=_0x19f26b-0x0;var _0x34c21b=_0x3d13[_0x19f26b];return _0x34c21b;};'use strict';var MailQueueEvents=require(_0x33d1('0x0'));var events=[_0x33d1('0x1'),'remove',_0x33d1('0x2')];function createListener(_0x1a713d,_0x344bff){return function(_0x2672de){_0x344bff['emit'](_0x1a713d,_0x2672de);};}function removeListener(_0x5c8b98,_0x22716a){return function(){MailQueueEvents[_0x33d1('0x3')](_0x5c8b98,_0x22716a);};}exports[_0x33d1('0x4')]=function(_0x26b7fe){for(var _0x162da5=0x0,_0x97151c=events[_0x33d1('0x5')];_0x162da5<_0x97151c;_0x162da5++){var _0x5202c3=events[_0x162da5];var _0x43c921=createListener(_0x33d1('0x6')+_0x5202c3,_0x26b7fe);MailQueueEvents['on'](_0x5202c3,_0x43c921);}}; \ No newline at end of file +var _0xfe29=['remove','update','register','length','mailQueue:','save'];(function(_0x12a56f,_0x4bd89f){var _0x4a02fd=function(_0x2b07ea){while(--_0x2b07ea){_0x12a56f['push'](_0x12a56f['shift']());}};_0x4a02fd(++_0x4bd89f);}(_0xfe29,0x167));var _0x9fe2=function(_0x3e5164,_0x368e8e){_0x3e5164=_0x3e5164-0x0;var _0x4865e5=_0xfe29[_0x3e5164];return _0x4865e5;};'use strict';var MailQueueEvents=require('./mailQueue.events');var events=[_0x9fe2('0x0'),_0x9fe2('0x1'),_0x9fe2('0x2')];function createListener(_0x1538dc,_0x5f5207){return function(_0xfd45d4){_0x5f5207['emit'](_0x1538dc,_0xfd45d4);};}function removeListener(_0x1f3ea6,_0x4e99f5){return function(){MailQueueEvents['removeListener'](_0x1f3ea6,_0x4e99f5);};}exports[_0x9fe2('0x3')]=function(_0x8a745d){for(var _0x40f125=0x0,_0x2f1f61=events[_0x9fe2('0x4')];_0x40f125<_0x2f1f61;_0x40f125++){var _0x1eda55=events[_0x40f125];var _0xa49dca=createListener(_0x9fe2('0x5')+_0x1eda55,_0x8a745d);MailQueueEvents['on'](_0x1eda55,_0xa49dca);}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/index.js b/server/api/mailQueueReport/index.js index 46a022e..e9ab4cc 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 _0xb959=['create','update','delete','destroy','exports','multer','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post'];(function(_0x2351df,_0x280830){var _0x24e340=function(_0x7dca7b){while(--_0x7dca7b){_0x2351df['push'](_0x2351df['shift']());}};_0x24e340(++_0x280830);}(_0xb959,0xd7));var _0x9b95=function(_0x5a594a,_0x3092b7){_0x5a594a=_0x5a594a-0x0;var _0x10f0f4=_0xb959[_0x5a594a];return _0x10f0f4;};'use strict';var multer=require(_0x9b95('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x9b95('0x1'));var express=require(_0x9b95('0x2'));var router=express[_0x9b95('0x3')]();var auth=require(_0x9b95('0x4'));var interaction=require(_0x9b95('0x5'));var config=require(_0x9b95('0x6'));var controller=require(_0x9b95('0x7'));router[_0x9b95('0x8')]('/',auth[_0x9b95('0x9')](),controller[_0x9b95('0xa')]);router[_0x9b95('0x8')](_0x9b95('0xb'),auth[_0x9b95('0x9')](),controller[_0x9b95('0xc')]);router[_0x9b95('0x8')](_0x9b95('0xd'),auth[_0x9b95('0x9')](),controller[_0x9b95('0xe')]);router[_0x9b95('0xf')]('/',auth['isAuthenticated'](),controller[_0x9b95('0x10')]);router['put'](_0x9b95('0xd'),auth[_0x9b95('0x9')](),controller[_0x9b95('0x11')]);router[_0x9b95('0x12')](_0x9b95('0xd'),auth[_0x9b95('0x9')](),controller[_0x9b95('0x13')]);module[_0x9b95('0x14')]=router; \ No newline at end of file +var _0xfa3c=['multer','path','connect-timeout','express','../../components/auth/service','../../config/environment','index','get','/describe','isAuthenticated','describe','/:id','post','update','delete','destroy','exports'];(function(_0x11e2f1,_0x3481b6){var _0x312f1e=function(_0x50aef5){while(--_0x50aef5){_0x11e2f1['push'](_0x11e2f1['shift']());}};_0x312f1e(++_0x3481b6);}(_0xfa3c,0x110));var _0xcfa3=function(_0x2a18b7,_0x5041c8){_0x2a18b7=_0x2a18b7-0x0;var _0x45e74e=_0xfa3c[_0x2a18b7];return _0x45e74e;};'use strict';var multer=require(_0xcfa3('0x0'));var util=require('util');var path=require(_0xcfa3('0x1'));var timeout=require(_0xcfa3('0x2'));var express=require(_0xcfa3('0x3'));var router=express['Router']();var auth=require(_0xcfa3('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xcfa3('0x5'));var controller=require('./mailQueueReport.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xcfa3('0x6')]);router[_0xcfa3('0x7')](_0xcfa3('0x8'),auth[_0xcfa3('0x9')](),controller[_0xcfa3('0xa')]);router[_0xcfa3('0x7')](_0xcfa3('0xb'),auth[_0xcfa3('0x9')](),controller['show']);router[_0xcfa3('0xc')]('/',auth[_0xcfa3('0x9')](),controller['create']);router['put']('/:id',auth[_0xcfa3('0x9')](),controller[_0xcfa3('0xd')]);router[_0xcfa3('0xe')](_0xcfa3('0xb'),auth[_0xcfa3('0x9')](),controller[_0xcfa3('0xf')]);module[_0xcfa3('0x10')]=router; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.attributes.js b/server/api/mailQueueReport/mailQueueReport.attributes.js index 1a9ef7c..2445693 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 _0xba8e=['DATE','moment','exports','STRING'];(function(_0x331d21,_0x45388d){var _0x351071=function(_0x3af2ce){while(--_0x3af2ce){_0x331d21['push'](_0x331d21['shift']());}};_0x351071(++_0x45388d);}(_0xba8e,0x149));var _0xeba8=function(_0x3071ab,_0x574a59){_0x3071ab=_0x3071ab-0x0;var _0x2f458c=_0xba8e[_0x3071ab];return _0x2f458c;};'use strict';var moment=require(_0xeba8('0x0'));var Sequelize=require('sequelize');module[_0xeba8('0x1')]={'uniqueid':{'type':Sequelize[_0xeba8('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0xeba8('0x3')]},'exitAt':{'type':Sequelize[_0xeba8('0x3')]},'reason':{'type':Sequelize[_0xeba8('0x2')]}}; \ No newline at end of file +var _0xcb47=['STRING','DATE','moment','sequelize','exports'];(function(_0x47c53e,_0x35f7f3){var _0x306afd=function(_0x599636){while(--_0x599636){_0x47c53e['push'](_0x47c53e['shift']());}};_0x306afd(++_0x35f7f3);}(_0xcb47,0xb6));var _0x7cb4=function(_0x3d61c6,_0x4571e6){_0x3d61c6=_0x3d61c6-0x0;var _0x47e0df=_0xcb47[_0x3d61c6];return _0x47e0df;};'use strict';var moment=require(_0x7cb4('0x0'));var Sequelize=require(_0x7cb4('0x1'));module[_0x7cb4('0x2')]={'uniqueid':{'type':Sequelize[_0x7cb4('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x7cb4('0x3')]},'joinAt':{'type':Sequelize[_0x7cb4('0x4')]},'leaveAt':{'type':Sequelize[_0x7cb4('0x4')]},'acceptAt':{'type':Sequelize[_0x7cb4('0x4')]},'exitAt':{'type':Sequelize[_0x7cb4('0x4')]},'reason':{'type':Sequelize[_0x7cb4('0x3')]}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.controller.js b/server/api/mailQueueReport/mailQueueReport.controller.js index 0130d7f..cadc816 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 _0x2234=['count','offset','limit','Content-Range','apply','reject','update','then','destroy','stack','name','MailQueueReport','rawAttributes','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','filter','where','key','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json'];(function(_0x1c3ebf,_0xa51978){var _0x1ff863=function(_0x1cba43){while(--_0x1cba43){_0x1c3ebf['push'](_0x1c3ebf['shift']());}};_0x1ff863(++_0xa51978);}(_0x2234,0x18c));var _0x4223=function(_0x16c314,_0x4bcd8e){_0x16c314=_0x16c314-0x0;var _0x1b0580=_0x2234[_0x16c314];return _0x1b0580;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x4223('0x0'));var rimraf=require(_0x4223('0x1'));var zipdir=require(_0x4223('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4223('0x3'));var moment=require('moment');var BPromise=require(_0x4223('0x4'));var Mustache=require(_0x4223('0x5'));var util=require(_0x4223('0x6'));var path=require(_0x4223('0x7'));var sox=require(_0x4223('0x8'));var csv=require(_0x4223('0x9'));var ejs=require(_0x4223('0xa'));var fs=require('fs');var _=require(_0x4223('0xb'));var squel=require(_0x4223('0xc'));var crypto=require(_0x4223('0xd'));var jsforce=require(_0x4223('0xe'));var deskjs=require(_0x4223('0xf'));var toCsv=require(_0x4223('0x9'));var querystring=require(_0x4223('0x10'));var Papa=require(_0x4223('0x11'));var Redis=require(_0x4223('0x12'));var authService=require(_0x4223('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x4223('0x14'));var hardwareService=require(_0x4223('0x15'));var logger=require(_0x4223('0x16'))('api');var utils=require(_0x4223('0x17'));var config=require(_0x4223('0x18'));var db=require(_0x4223('0x19'))['db'];function respondWithStatusCode(_0x196637,_0x1dfea3){_0x1dfea3=_0x1dfea3||0xcc;return function(_0x573db0){if(_0x573db0){return _0x196637[_0x4223('0x1a')](_0x1dfea3);}return _0x196637['status'](_0x1dfea3)[_0x4223('0x1b')]();};}function respondWithResult(_0x17974e,_0x34e9d7){_0x34e9d7=_0x34e9d7||0xc8;return function(_0x1383b0){if(_0x1383b0){return _0x17974e[_0x4223('0x1c')](_0x34e9d7)[_0x4223('0x1d')](_0x1383b0);}};}function respondWithFilteredResult(_0x14d2c6,_0x2c6b53){return function(_0x22955d){if(_0x22955d){var _0x3c601e=_0x22955d[_0x4223('0x1e')],_0x1c8405=_0x2c6b53[_0x4223('0x1f')],_0x1d93f7=_0x2c6b53[_0x4223('0x1f')]+_0x2c6b53[_0x4223('0x20')],_0x46762f;if(_0x1d93f7>=_0x3c601e){_0x1d93f7=_0x3c601e;_0x46762f=0xc8;}else{_0x46762f=0xce;}_0x14d2c6[_0x4223('0x1c')](_0x46762f);return _0x14d2c6['set'](_0x4223('0x21'),_0x1c8405+'-'+_0x1d93f7+'/'+_0x3c601e)[_0x4223('0x1d')](_0x22955d);}return null;};}function patchUpdates(_0x3732fb){return function(_0x218c23){try{jsonpatch[_0x4223('0x22')](_0x218c23,_0x3732fb,!![]);}catch(_0xe1863e){return BPromise[_0x4223('0x23')](_0xe1863e);}return _0x218c23['save']();};}function saveUpdates(_0x274e3e,_0x4d5705){return function(_0x330d2a){if(_0x330d2a){return _0x330d2a[_0x4223('0x24')](_0x274e3e)[_0x4223('0x25')](function(_0x6bc44f){return _0x6bc44f;});}return null;};}function removeEntity(_0x4f0793,_0x7ffce0){return function(_0x98b9cf){if(_0x98b9cf){return _0x98b9cf[_0x4223('0x26')]()[_0x4223('0x25')](function(){_0x4f0793[_0x4223('0x1c')](0xcc)[_0x4223('0x1b')]();});}};}function handleEntityNotFound(_0x3b7962,_0x3a794f){return function(_0xafdc2d){if(!_0xafdc2d){_0x3b7962[_0x4223('0x1a')](0x194);}return _0xafdc2d;};}function handleError(_0x46277f,_0x48bef7){_0x48bef7=_0x48bef7||0x1f4;return function(_0x5bdcc7){logger['error'](_0x5bdcc7[_0x4223('0x27')]);if(_0x5bdcc7['name']){delete _0x5bdcc7[_0x4223('0x28')];}_0x46277f['status'](_0x48bef7)['send'](_0x5bdcc7);};}exports['index']=function(_0x1190df,_0x9d6bde){var _0x41e030={},_0x531db6={},_0x1ea777={'count':0x0,'rows':[]};var _0x2b72e8=db[_0x4223('0x29')][_0x4223('0x2a')];_0x531db6[_0x4223('0x2b')]=_[_0x4223('0x2c')](_0x2b72e8);_0x531db6[_0x4223('0x2d')]=_[_0x4223('0x2c')](_0x1190df[_0x4223('0x2d')]);_0x531db6[_0x4223('0x2e')]=_['intersection'](_0x531db6['model'],_0x531db6[_0x4223('0x2d')]);_0x41e030[_0x4223('0x2f')]=_[_0x4223('0x30')](_0x531db6[_0x4223('0x2b')],qs[_0x4223('0x31')](_0x1190df[_0x4223('0x2d')][_0x4223('0x31')]));_0x41e030[_0x4223('0x2f')]=_0x41e030[_0x4223('0x2f')][_0x4223('0x32')]?_0x41e030[_0x4223('0x2f')]:_0x531db6[_0x4223('0x2b')];if(!_0x1190df[_0x4223('0x2d')][_0x4223('0x33')]('nolimit')){_0x41e030[_0x4223('0x20')]=qs[_0x4223('0x20')](_0x1190df[_0x4223('0x2d')]['limit']);_0x41e030[_0x4223('0x1f')]=qs[_0x4223('0x1f')](_0x1190df[_0x4223('0x2d')]['offset']);}_0x41e030[_0x4223('0x34')]=qs[_0x4223('0x35')](_0x1190df[_0x4223('0x2d')]['sort']);_0x41e030['where']=qs[_0x4223('0x2e')](_['pick'](_0x1190df['query'],_0x531db6[_0x4223('0x2e')]));if(_0x1190df[_0x4223('0x2d')][_0x4223('0x36')]){_0x41e030['where']=_['merge'](_0x41e030[_0x4223('0x37')],{'$or':_['map'](_0x2b72e8,function(_0x4fc337){if(_0x4fc337['type'][_0x4223('0x38')]!==_0x4223('0x39')){var _0x5a4377={};_0x5a4377[_0x4fc337['field']]={'$like':'%'+_0x1190df[_0x4223('0x2d')][_0x4223('0x36')]+'%'};return _0x5a4377;}})});}_0x41e030=_[_0x4223('0x3a')]({},_0x41e030,_0x1190df[_0x4223('0x3b')]);var _0x56f5ff={'where':_0x41e030[_0x4223('0x37')]};return db['MailQueueReport'][_0x4223('0x1e')](_0x56f5ff)[_0x4223('0x25')](function(_0x390bb0){_0x1ea777[_0x4223('0x1e')]=_0x390bb0;if(_0x1190df[_0x4223('0x2d')][_0x4223('0x3c')]){_0x41e030[_0x4223('0x3d')]=[{'all':!![]}];}return db[_0x4223('0x29')][_0x4223('0x3e')](_0x41e030);})[_0x4223('0x25')](function(_0x14afe1){_0x1ea777[_0x4223('0x3f')]=_0x14afe1;return _0x1ea777;})[_0x4223('0x25')](respondWithFilteredResult(_0x9d6bde,_0x41e030))[_0x4223('0x40')](handleError(_0x9d6bde,null));};exports[_0x4223('0x41')]=function(_0x24ae44,_0x24e73e){var _0x369d58={'raw':!![],'where':{'id':_0x24ae44[_0x4223('0x42')]['id']}},_0x16e9f1={};_0x16e9f1[_0x4223('0x2b')]=_[_0x4223('0x2c')](db[_0x4223('0x29')]['rawAttributes']);_0x16e9f1['query']=_[_0x4223('0x2c')](_0x24ae44[_0x4223('0x2d')]);_0x16e9f1[_0x4223('0x2e')]=_[_0x4223('0x30')](_0x16e9f1[_0x4223('0x2b')],_0x16e9f1[_0x4223('0x2d')]);_0x369d58[_0x4223('0x2f')]=_[_0x4223('0x30')](_0x16e9f1[_0x4223('0x2b')],qs['fields'](_0x24ae44[_0x4223('0x2d')][_0x4223('0x31')]));_0x369d58[_0x4223('0x2f')]=_0x369d58[_0x4223('0x2f')][_0x4223('0x32')]?_0x369d58[_0x4223('0x2f')]:_0x16e9f1[_0x4223('0x2b')];if(_0x24ae44[_0x4223('0x2d')][_0x4223('0x3c')]){_0x369d58[_0x4223('0x3d')]=[{'all':!![]}];}_0x369d58=_['merge']({},_0x369d58,_0x24ae44[_0x4223('0x3b')]);return db[_0x4223('0x29')][_0x4223('0x43')](_0x369d58)[_0x4223('0x25')](handleEntityNotFound(_0x24e73e,null))['then'](respondWithResult(_0x24e73e,null))[_0x4223('0x40')](handleError(_0x24e73e,null));};exports['create']=function(_0x549cdf,_0x1731f7){return db[_0x4223('0x29')][_0x4223('0x44')](_0x549cdf[_0x4223('0x45')],{})[_0x4223('0x25')](respondWithResult(_0x1731f7,0xc9))[_0x4223('0x40')](handleError(_0x1731f7,null));};exports[_0x4223('0x24')]=function(_0x83454,_0xef8b75){if(_0x83454[_0x4223('0x45')]['id']){delete _0x83454[_0x4223('0x45')]['id'];}return db[_0x4223('0x29')][_0x4223('0x43')]({'where':{'id':_0x83454[_0x4223('0x42')]['id']}})[_0x4223('0x25')](handleEntityNotFound(_0xef8b75,null))[_0x4223('0x25')](saveUpdates(_0x83454['body'],null))[_0x4223('0x25')](respondWithResult(_0xef8b75,null))[_0x4223('0x40')](handleError(_0xef8b75,null));};exports[_0x4223('0x26')]=function(_0x23e8b0,_0x39ff8e){return db['MailQueueReport'][_0x4223('0x43')]({'where':{'id':_0x23e8b0[_0x4223('0x42')]['id']}})['then'](handleEntityNotFound(_0x39ff8e,null))[_0x4223('0x25')](removeEntity(_0x39ff8e,null))[_0x4223('0x40')](handleError(_0x39ff8e,null));};exports[_0x4223('0x46')]=function(_0x665d7a,_0x1380d3){return db[_0x4223('0x29')][_0x4223('0x46')]()[_0x4223('0x25')](respondWithResult(_0x1380d3,null))['catch'](handleError(_0x1380d3,null));}; \ No newline at end of file +var _0x18f6=['fields','length','hasOwnProperty','nolimit','offset','order','sort','where','pick','filter','merge','map','type','key','VIRTUAL','field','options','includeAll','findAll','rows','show','params','include','find','create','body','catch','describe','html-pdf','rimraf','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','jsforce','querystring','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','json','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','send','MailQueueReport','rawAttributes','model','keys','query','filters','intersection','attributes'];(function(_0x1d72b8,_0x5247f5){var _0x3382bb=function(_0x70712a){while(--_0x70712a){_0x1d72b8['push'](_0x1d72b8['shift']());}};_0x3382bb(++_0x5247f5);}(_0x18f6,0x17f));var _0x618f=function(_0x3d48c3,_0xcacfc8){_0x3d48c3=_0x3d48c3-0x0;var _0x52e768=_0x18f6[_0x3d48c3];return _0x52e768;};'use strict';var pdf=require(_0x618f('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x618f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x618f('0x2'));var moment=require(_0x618f('0x3'));var BPromise=require(_0x618f('0x4'));var Mustache=require(_0x618f('0x5'));var util=require('util');var path=require(_0x618f('0x6'));var sox=require(_0x618f('0x7'));var csv=require(_0x618f('0x8'));var ejs=require(_0x618f('0x9'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x618f('0xa'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x618f('0xb'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x618f('0xc'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x618f('0xd'));var logger=require(_0x618f('0xe'))('api');var utils=require(_0x618f('0xf'));var config=require(_0x618f('0x10'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2f5230,_0x1d37a4){_0x1d37a4=_0x1d37a4||0xcc;return function(_0x2890d3){if(_0x2890d3){return _0x2f5230[_0x618f('0x11')](_0x1d37a4);}return _0x2f5230['status'](_0x1d37a4)['end']();};}function respondWithResult(_0x334688,_0x397d39){_0x397d39=_0x397d39||0xc8;return function(_0xafe58e){if(_0xafe58e){return _0x334688[_0x618f('0x12')](_0x397d39)[_0x618f('0x13')](_0xafe58e);}};}function respondWithFilteredResult(_0x179771,_0x2ca974){return function(_0x3990e5){if(_0x3990e5){var _0x4d365b=_0x3990e5[_0x618f('0x14')],_0x221bef=_0x2ca974['offset'],_0x3ed749=_0x2ca974['offset']+_0x2ca974[_0x618f('0x15')],_0x4366df;if(_0x3ed749>=_0x4d365b){_0x3ed749=_0x4d365b;_0x4366df=0xc8;}else{_0x4366df=0xce;}_0x179771['status'](_0x4366df);return _0x179771[_0x618f('0x16')](_0x618f('0x17'),_0x221bef+'-'+_0x3ed749+'/'+_0x4d365b)['json'](_0x3990e5);}return null;};}function patchUpdates(_0x545aaf){return function(_0x255ad8){try{jsonpatch[_0x618f('0x18')](_0x255ad8,_0x545aaf,!![]);}catch(_0xb48947){return BPromise[_0x618f('0x19')](_0xb48947);}return _0x255ad8[_0x618f('0x1a')]();};}function saveUpdates(_0x9c2045,_0x2e2004){return function(_0x52fac6){if(_0x52fac6){return _0x52fac6[_0x618f('0x1b')](_0x9c2045)[_0x618f('0x1c')](function(_0x2db9b0){return _0x2db9b0;});}return null;};}function removeEntity(_0x560e98,_0x51b5f4){return function(_0x24f68e){if(_0x24f68e){return _0x24f68e[_0x618f('0x1d')]()['then'](function(){_0x560e98['status'](0xcc)[_0x618f('0x1e')]();});}};}function handleEntityNotFound(_0x2ecaf2,_0x5435b3){return function(_0x804899){if(!_0x804899){_0x2ecaf2[_0x618f('0x11')](0x194);}return _0x804899;};}function handleError(_0x57f158,_0x583f9c){_0x583f9c=_0x583f9c||0x1f4;return function(_0xeeadf0){logger[_0x618f('0x1f')](_0xeeadf0[_0x618f('0x20')]);if(_0xeeadf0[_0x618f('0x21')]){delete _0xeeadf0[_0x618f('0x21')];}_0x57f158[_0x618f('0x12')](_0x583f9c)[_0x618f('0x22')](_0xeeadf0);};}exports['index']=function(_0x32d36c,_0x1dd201){var _0xbe929e={},_0x2c2b73={},_0x20826d={'count':0x0,'rows':[]};var _0x302faf=db[_0x618f('0x23')][_0x618f('0x24')];_0x2c2b73[_0x618f('0x25')]=_['keys'](_0x302faf);_0x2c2b73['query']=_[_0x618f('0x26')](_0x32d36c[_0x618f('0x27')]);_0x2c2b73[_0x618f('0x28')]=_[_0x618f('0x29')](_0x2c2b73[_0x618f('0x25')],_0x2c2b73[_0x618f('0x27')]);_0xbe929e[_0x618f('0x2a')]=_[_0x618f('0x29')](_0x2c2b73[_0x618f('0x25')],qs[_0x618f('0x2b')](_0x32d36c['query'][_0x618f('0x2b')]));_0xbe929e[_0x618f('0x2a')]=_0xbe929e[_0x618f('0x2a')][_0x618f('0x2c')]?_0xbe929e[_0x618f('0x2a')]:_0x2c2b73[_0x618f('0x25')];if(!_0x32d36c['query'][_0x618f('0x2d')](_0x618f('0x2e'))){_0xbe929e[_0x618f('0x15')]=qs[_0x618f('0x15')](_0x32d36c['query'][_0x618f('0x15')]);_0xbe929e[_0x618f('0x2f')]=qs['offset'](_0x32d36c[_0x618f('0x27')][_0x618f('0x2f')]);}_0xbe929e[_0x618f('0x30')]=qs[_0x618f('0x31')](_0x32d36c[_0x618f('0x27')][_0x618f('0x31')]);_0xbe929e[_0x618f('0x32')]=qs[_0x618f('0x28')](_[_0x618f('0x33')](_0x32d36c[_0x618f('0x27')],_0x2c2b73[_0x618f('0x28')]));if(_0x32d36c[_0x618f('0x27')][_0x618f('0x34')]){_0xbe929e[_0x618f('0x32')]=_[_0x618f('0x35')](_0xbe929e['where'],{'$or':_[_0x618f('0x36')](_0x302faf,function(_0x533e47){if(_0x533e47[_0x618f('0x37')][_0x618f('0x38')]!==_0x618f('0x39')){var _0x22134e={};_0x22134e[_0x533e47[_0x618f('0x3a')]]={'$like':'%'+_0x32d36c[_0x618f('0x27')]['filter']+'%'};return _0x22134e;}})});}_0xbe929e=_[_0x618f('0x35')]({},_0xbe929e,_0x32d36c[_0x618f('0x3b')]);var _0x39bfb6={'where':_0xbe929e[_0x618f('0x32')]};return db[_0x618f('0x23')][_0x618f('0x14')](_0x39bfb6)[_0x618f('0x1c')](function(_0x392ba4){_0x20826d['count']=_0x392ba4;if(_0x32d36c['query'][_0x618f('0x3c')]){_0xbe929e['include']=[{'all':!![]}];}return db[_0x618f('0x23')][_0x618f('0x3d')](_0xbe929e);})['then'](function(_0x3cf86e){_0x20826d[_0x618f('0x3e')]=_0x3cf86e;return _0x20826d;})[_0x618f('0x1c')](respondWithFilteredResult(_0x1dd201,_0xbe929e))['catch'](handleError(_0x1dd201,null));};exports[_0x618f('0x3f')]=function(_0x3f3ef8,_0x2a610b){var _0x4bfec9={'raw':!![],'where':{'id':_0x3f3ef8[_0x618f('0x40')]['id']}},_0x134039={};_0x134039[_0x618f('0x25')]=_['keys'](db[_0x618f('0x23')][_0x618f('0x24')]);_0x134039['query']=_[_0x618f('0x26')](_0x3f3ef8['query']);_0x134039[_0x618f('0x28')]=_['intersection'](_0x134039[_0x618f('0x25')],_0x134039[_0x618f('0x27')]);_0x4bfec9['attributes']=_[_0x618f('0x29')](_0x134039[_0x618f('0x25')],qs[_0x618f('0x2b')](_0x3f3ef8[_0x618f('0x27')][_0x618f('0x2b')]));_0x4bfec9['attributes']=_0x4bfec9['attributes'][_0x618f('0x2c')]?_0x4bfec9[_0x618f('0x2a')]:_0x134039[_0x618f('0x25')];if(_0x3f3ef8['query']['includeAll']){_0x4bfec9[_0x618f('0x41')]=[{'all':!![]}];}_0x4bfec9=_[_0x618f('0x35')]({},_0x4bfec9,_0x3f3ef8[_0x618f('0x3b')]);return db['MailQueueReport'][_0x618f('0x42')](_0x4bfec9)[_0x618f('0x1c')](handleEntityNotFound(_0x2a610b,null))[_0x618f('0x1c')](respondWithResult(_0x2a610b,null))['catch'](handleError(_0x2a610b,null));};exports['create']=function(_0x36cd67,_0x58680e){return db[_0x618f('0x23')][_0x618f('0x43')](_0x36cd67[_0x618f('0x44')],{})[_0x618f('0x1c')](respondWithResult(_0x58680e,0xc9))[_0x618f('0x45')](handleError(_0x58680e,null));};exports['update']=function(_0x192439,_0x41a505){if(_0x192439[_0x618f('0x44')]['id']){delete _0x192439[_0x618f('0x44')]['id'];}return db[_0x618f('0x23')][_0x618f('0x42')]({'where':{'id':_0x192439[_0x618f('0x40')]['id']}})[_0x618f('0x1c')](handleEntityNotFound(_0x41a505,null))[_0x618f('0x1c')](saveUpdates(_0x192439['body'],null))[_0x618f('0x1c')](respondWithResult(_0x41a505,null))[_0x618f('0x45')](handleError(_0x41a505,null));};exports[_0x618f('0x1d')]=function(_0x2e879b,_0x33e94e){return db['MailQueueReport'][_0x618f('0x42')]({'where':{'id':_0x2e879b[_0x618f('0x40')]['id']}})[_0x618f('0x1c')](handleEntityNotFound(_0x33e94e,null))['then'](removeEntity(_0x33e94e,null))[_0x618f('0x45')](handleError(_0x33e94e,null));};exports[_0x618f('0x46')]=function(_0x177f64,_0x56a918){return db['MailQueueReport'][_0x618f('0x46')]()[_0x618f('0x1c')](respondWithResult(_0x56a918,null))[_0x618f('0x45')](handleError(_0x56a918,null));}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.model.js b/server/api/mailQueueReport/mailQueueReport.model.js index 6c9568e..de60e5d 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 _0x6b94=['lodash','util','moment','bluebird','path','rimraf','./mailQueueReport.attributes','exports','define','MailQueueReport','report_mail_queue','uniqueid'];(function(_0x3c2a69,_0x4c8b41){var _0x596bc8=function(_0x1b4b7c){while(--_0x1b4b7c){_0x3c2a69['push'](_0x3c2a69['shift']());}};_0x596bc8(++_0x4c8b41);}(_0x6b94,0x78));var _0x46b9=function(_0x2d1cec,_0x3ec27a){_0x2d1cec=_0x2d1cec-0x0;var _0x14d89b=_0x6b94[_0x2d1cec];return _0x14d89b;};'use strict';var _=require(_0x46b9('0x0'));var util=require(_0x46b9('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x46b9('0x2'));var BPromise=require(_0x46b9('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x46b9('0x4'));var rimraf=require(_0x46b9('0x5'));var config=require('../../config/environment');var attributes=require(_0x46b9('0x6'));module[_0x46b9('0x7')]=function(_0x1cda19,_0x2e234a){return _0x1cda19[_0x46b9('0x8')](_0x46b9('0x9'),attributes,{'tableName':_0x46b9('0xa'),'paranoid':![],'indexes':[{'name':_0x46b9('0xb'),'fields':[_0x46b9('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xb2bb=['report_mail_queue','uniqueid','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./mailQueueReport.attributes','exports','define','MailQueueReport'];(function(_0x1a9204,_0x1c9e00){var _0x17ca68=function(_0x1f4399){while(--_0x1f4399){_0x1a9204['push'](_0x1a9204['shift']());}};_0x17ca68(++_0x1c9e00);}(_0xb2bb,0x198));var _0xbb2b=function(_0x5dbb84,_0x1bbce9){_0x5dbb84=_0x5dbb84-0x0;var _0x1d6eae=_0xb2bb[_0x5dbb84];return _0x1d6eae;};'use strict';var _=require(_0xbb2b('0x0'));var util=require('util');var logger=require(_0xbb2b('0x1'))(_0xbb2b('0x2'));var moment=require(_0xbb2b('0x3'));var BPromise=require(_0xbb2b('0x4'));var rp=require(_0xbb2b('0x5'));var fs=require('fs');var path=require(_0xbb2b('0x6'));var rimraf=require(_0xbb2b('0x7'));var config=require('../../config/environment');var attributes=require(_0xbb2b('0x8'));module[_0xbb2b('0x9')]=function(_0x1ddf14,_0x4dbb1a){return _0x1ddf14[_0xbb2b('0xa')](_0xbb2b('0xb'),attributes,{'tableName':_0xbb2b('0xc'),'paranoid':![],'indexes':[{'name':_0xbb2b('0xd'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.rpc.js b/server/api/mailQueueReport/mailQueueReport.rpc.js index 5ce708c..cc7c1d8 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 _0x5d58=['UpdateMailQueueReport','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','info','MailQueueReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateMailQueueReport','MailQueueReport','create','body','options','then','debug','update','raw','where','attributes','limit'];(function(_0x3efc72,_0x405ab7){var _0x5a4457=function(_0x2e2ef0){while(--_0x2e2ef0){_0x3efc72['push'](_0x3efc72['shift']());}};_0x5a4457(++_0x405ab7);}(_0x5d58,0x187));var _0x85d5=function(_0x6584a0,_0x133b17){_0x6584a0=_0x6584a0-0x0;var _0x26fa66=_0x5d58[_0x6584a0];return _0x26fa66;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x85d5('0x0'));var db=require(_0x85d5('0x1'))['db'];var utils=require('../../config/utils');var logger=require(_0x85d5('0x2'))(_0x85d5('0x3'));var config=require('../../config/environment');var jayson=require(_0x85d5('0x4'));var client=jayson[_0x85d5('0x5')][_0x85d5('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x46e7b4,_0x5f47ec,_0x98c963){return new BPromise(function(_0x3fecca,_0x4ca293){return client[_0x85d5('0x7')](_0x46e7b4,_0x98c963)['then'](function(_0x1098be){logger[_0x85d5('0x8')](_0x85d5('0x9'),_0x5f47ec,'request\x20sent');logger['debug']('MailQueueReport,\x20%s,\x20%s,\x20%s',_0x5f47ec,_0x85d5('0xa'),JSON[_0x85d5('0xb')](_0x1098be));if(_0x1098be[_0x85d5('0xc')]){if(_0x1098be[_0x85d5('0xc')][_0x85d5('0xd')]===0x1f4){logger[_0x85d5('0xc')](_0x85d5('0x9'),_0x5f47ec,_0x1098be['error']['message']);return _0x4ca293(_0x1098be['error'][_0x85d5('0xe')]);}logger[_0x85d5('0xc')](_0x85d5('0x9'),_0x5f47ec,_0x1098be[_0x85d5('0xc')][_0x85d5('0xe')]);return _0x3fecca(_0x1098be[_0x85d5('0xc')][_0x85d5('0xe')]);}else{logger['info'](_0x85d5('0x9'),_0x5f47ec,_0x85d5('0xa'));_0x3fecca(_0x1098be[_0x85d5('0xf')][_0x85d5('0xe')]);}})[_0x85d5('0x10')](function(_0x3dc83c){logger[_0x85d5('0xc')](_0x85d5('0x9'),_0x5f47ec,_0x3dc83c);_0x4ca293(_0x3dc83c);});});}exports[_0x85d5('0x11')]=function(_0x17acb0){var _0x3eab37=this;return new Promise(function(_0x432bd6,_0x34b981){return db[_0x85d5('0x12')][_0x85d5('0x13')](_0x17acb0[_0x85d5('0x14')],{'raw':_0x17acb0[_0x85d5('0x15')]?_0x17acb0[_0x85d5('0x15')]['raw']===undefined?!![]:![]:!![]})[_0x85d5('0x16')](function(_0x133fa9){logger['info'](_0x85d5('0x11'),_0x17acb0);logger[_0x85d5('0x17')]('CreateMailQueueReport',_0x17acb0,JSON['stringify'](_0x133fa9));_0x432bd6(_0x133fa9);})[_0x85d5('0x10')](function(_0x5a1b9a){logger[_0x85d5('0xc')]('CreateMailQueueReport',_0x5a1b9a[_0x85d5('0xe')],_0x17acb0);_0x34b981(_0x3eab37[_0x85d5('0xc')](0x1f4,_0x5a1b9a['message']));});});};exports['UpdateMailQueueReport']=function(_0x4da71b){var _0x5f0268=this;return new Promise(function(_0xf03669,_0x46c06e){return db[_0x85d5('0x12')][_0x85d5('0x18')](_0x4da71b[_0x85d5('0x14')],{'raw':_0x4da71b[_0x85d5('0x15')]?_0x4da71b['options'][_0x85d5('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4da71b['options']?_0x4da71b[_0x85d5('0x15')][_0x85d5('0x1a')]||null:null,'attributes':_0x4da71b[_0x85d5('0x15')]?_0x4da71b['options'][_0x85d5('0x1b')]||null:null,'limit':_0x4da71b[_0x85d5('0x15')]?_0x4da71b[_0x85d5('0x15')][_0x85d5('0x1c')]||null:null})[_0x85d5('0x16')](function(_0x56031f){logger[_0x85d5('0x8')](_0x85d5('0x1d'),_0x4da71b);logger[_0x85d5('0x17')](_0x85d5('0x1d'),_0x4da71b,JSON[_0x85d5('0xb')](_0x56031f));_0xf03669(_0x56031f);})['catch'](function(_0x539dc9){logger[_0x85d5('0xc')](_0x85d5('0x1d'),_0x539dc9[_0x85d5('0xe')],_0x4da71b);_0x46c06e(_0x5f0268[_0x85d5('0xc')](0x1f4,_0x539dc9[_0x85d5('0xe')]));});});}; \ No newline at end of file +var _0x781d=['request\x20sent','result','catch','MailQueueReport','create','body','options','raw','CreateMailQueueReport','UpdateMailQueueReport','update','where','attributes','limit','stringify','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','MailQueueReport,\x20%s,\x20%s','debug','MailQueueReport,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x2cfe02,_0x28da9c){var _0x40a079=function(_0x1fac72){while(--_0x1fac72){_0x2cfe02['push'](_0x2cfe02['shift']());}};_0x40a079(++_0x28da9c);}(_0x781d,0x14a));var _0xd781=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x781d[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xd781('0x0'));var util=require(_0xd781('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xd781('0x2'));var fs=require('fs');var Redis=require(_0xd781('0x3'));var db=require(_0xd781('0x4'))['db'];var utils=require(_0xd781('0x5'));var logger=require(_0xd781('0x6'))(_0xd781('0x7'));var config=require(_0xd781('0x8'));var jayson=require(_0xd781('0x9'));var client=jayson[_0xd781('0xa')][_0xd781('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5a07f0,_0x133509,_0x1a242d){return new BPromise(function(_0x50610d,_0x248172){return client['request'](_0x5a07f0,_0x1a242d)[_0xd781('0xc')](function(_0x5c18c8){logger[_0xd781('0xd')](_0xd781('0xe'),_0x133509,'request\x20sent');logger[_0xd781('0xf')](_0xd781('0x10'),_0x133509,'request\x20sent',JSON['stringify'](_0x5c18c8));if(_0x5c18c8[_0xd781('0x11')]){if(_0x5c18c8[_0xd781('0x11')][_0xd781('0x12')]===0x1f4){logger[_0xd781('0x11')](_0xd781('0xe'),_0x133509,_0x5c18c8[_0xd781('0x11')][_0xd781('0x13')]);return _0x248172(_0x5c18c8[_0xd781('0x11')][_0xd781('0x13')]);}logger[_0xd781('0x11')](_0xd781('0xe'),_0x133509,_0x5c18c8['error'][_0xd781('0x13')]);return _0x50610d(_0x5c18c8[_0xd781('0x11')]['message']);}else{logger[_0xd781('0xd')]('MailQueueReport,\x20%s,\x20%s',_0x133509,_0xd781('0x14'));_0x50610d(_0x5c18c8[_0xd781('0x15')][_0xd781('0x13')]);}})[_0xd781('0x16')](function(_0x42a9c1){logger[_0xd781('0x11')](_0xd781('0xe'),_0x133509,_0x42a9c1);_0x248172(_0x42a9c1);});});}exports['CreateMailQueueReport']=function(_0x1407fc){var _0x3f2922=this;return new Promise(function(_0x395d9c,_0x2f1273){return db[_0xd781('0x17')][_0xd781('0x18')](_0x1407fc[_0xd781('0x19')],{'raw':_0x1407fc[_0xd781('0x1a')]?_0x1407fc['options'][_0xd781('0x1b')]===undefined?!![]:![]:!![]})[_0xd781('0xc')](function(_0x1036d3){logger[_0xd781('0xd')](_0xd781('0x1c'),_0x1407fc);logger[_0xd781('0xf')](_0xd781('0x1c'),_0x1407fc,JSON['stringify'](_0x1036d3));_0x395d9c(_0x1036d3);})[_0xd781('0x16')](function(_0x4e2c56){logger['error'](_0xd781('0x1c'),_0x4e2c56['message'],_0x1407fc);_0x2f1273(_0x3f2922[_0xd781('0x11')](0x1f4,_0x4e2c56[_0xd781('0x13')]));});});};exports[_0xd781('0x1d')]=function(_0x31bf57){var _0x391461=this;return new Promise(function(_0x28f4fe,_0x221f14){return db[_0xd781('0x17')][_0xd781('0x1e')](_0x31bf57['body'],{'raw':_0x31bf57['options']?_0x31bf57[_0xd781('0x1a')][_0xd781('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x31bf57[_0xd781('0x1a')]?_0x31bf57['options'][_0xd781('0x1f')]||null:null,'attributes':_0x31bf57['options']?_0x31bf57['options'][_0xd781('0x20')]||null:null,'limit':_0x31bf57['options']?_0x31bf57[_0xd781('0x1a')][_0xd781('0x21')]||null:null})['then'](function(_0x5b6b9d){logger[_0xd781('0xd')]('UpdateMailQueueReport',_0x31bf57);logger[_0xd781('0xf')]('UpdateMailQueueReport',_0x31bf57,JSON[_0xd781('0x22')](_0x5b6b9d));_0x28f4fe(_0x5b6b9d);})[_0xd781('0x16')](function(_0x556127){logger['error'](_0xd781('0x1d'),_0x556127[_0xd781('0x13')],_0x31bf57);_0x221f14(_0x391461[_0xd781('0x11')](0x1f4,_0x556127['message']));});});}; \ No newline at end of file diff --git a/server/api/mailServerIn/index.js b/server/api/mailServerIn/index.js index 561d1dc..aa27212 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 _0x869c=['path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','exports','multer','util'];(function(_0x2e8860,_0x5de6db){var _0x449410=function(_0x85e5bd){while(--_0x85e5bd){_0x2e8860['push'](_0x2e8860['shift']());}};_0x449410(++_0x5de6db);}(_0x869c,0xae));var _0xc869=function(_0x42f4e0,_0x1a481f){_0x42f4e0=_0x42f4e0-0x0;var _0x5eb3e0=_0x869c[_0x42f4e0];return _0x5eb3e0;};'use strict';var multer=require(_0xc869('0x0'));var util=require(_0xc869('0x1'));var path=require(_0xc869('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xc869('0x3')]();var auth=require(_0xc869('0x4'));var interaction=require(_0xc869('0x5'));var config=require(_0xc869('0x6'));module[_0xc869('0x7')]=router; \ No newline at end of file +var _0x9e33=['connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','exports','util'];(function(_0x4102b4,_0x5d41a4){var _0x4f72a9=function(_0x4671bf){while(--_0x4671bf){_0x4102b4['push'](_0x4102b4['shift']());}};_0x4f72a9(++_0x5d41a4);}(_0x9e33,0x1db));var _0x39e3=function(_0x48b5e0,_0xb3826){_0x48b5e0=_0x48b5e0-0x0;var _0x4287ea=_0x9e33[_0x48b5e0];return _0x4287ea;};'use strict';var multer=require('multer');var util=require(_0x39e3('0x0'));var path=require('path');var timeout=require(_0x39e3('0x1'));var express=require(_0x39e3('0x2'));var router=express['Router']();var auth=require(_0x39e3('0x3'));var interaction=require(_0x39e3('0x4'));var config=require(_0x39e3('0x5'));module[_0x39e3('0x6')]=router; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.attributes.js b/server/api/mailServerIn/mailServerIn.attributes.js index 42e81c1..e28d078 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 _0xe5ac=['BOOLEAN','username','INTEGER','sequelize','exports','STRING'];(function(_0x4bfac3,_0x58324d){var _0x15f0f2=function(_0xf0c511){while(--_0xf0c511){_0x4bfac3['push'](_0x4bfac3['shift']());}};_0x15f0f2(++_0x58324d);}(_0xe5ac,0xf3));var _0xce5a=function(_0x497313,_0x23c148){_0x497313=_0x497313-0x0;var _0x2208f1=_0xe5ac[_0x497313];return _0x2208f1;};'use strict';var Sequelize=require(_0xce5a('0x0'));module[_0xce5a('0x1')]={'description':{'type':Sequelize[_0xce5a('0x2')]},'host':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize[_0xce5a('0x3')],'defaultValue':!![]},'user':{'type':Sequelize[_0xce5a('0x2')],'unique':_0xce5a('0x4')},'password':{'type':Sequelize[_0xce5a('0x2')]},'port':{'type':Sequelize['INTEGER']},'tls':{'type':Sequelize[_0xce5a('0x3')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0xce5a('0x2')],'defaultValue':'INBOX'},'connTimeout':{'type':Sequelize[_0xce5a('0x5')],'defaultValue':0xa},'authTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'service':{'type':Sequelize[_0xce5a('0x2')]}}; \ No newline at end of file +var _0x1421=['BOOLEAN','username','INTEGER','INBOX','exports','STRING'];(function(_0x490e13,_0x6bc999){var _0x40c206=function(_0x29e46a){while(--_0x29e46a){_0x490e13['push'](_0x490e13['shift']());}};_0x40c206(++_0x6bc999);}(_0x1421,0xe2));var _0x1142=function(_0x1b8d05,_0x31f049){_0x1b8d05=_0x1b8d05-0x0;var _0x33e2b7=_0x1421[_0x1b8d05];return _0x33e2b7;};'use strict';var Sequelize=require('sequelize');module[_0x1142('0x0')]={'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0x1142('0x1')]},'authentication':{'type':Sequelize[_0x1142('0x2')],'defaultValue':!![]},'user':{'type':Sequelize[_0x1142('0x1')],'unique':_0x1142('0x3')},'password':{'type':Sequelize[_0x1142('0x1')]},'port':{'type':Sequelize[_0x1142('0x4')]},'tls':{'type':Sequelize[_0x1142('0x2')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x1142('0x1')],'defaultValue':_0x1142('0x5')},'connTimeout':{'type':Sequelize[_0x1142('0x4')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0x1142('0x4')],'defaultValue':0x5},'service':{'type':Sequelize[_0x1142('0x1')]}}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.model.js b/server/api/mailServerIn/mailServerIn.model.js index 1bd50fd..86e6823 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 _0x80ed=['api','moment','request-promise','path','rimraf','../../config/environment','exports','MailServerIn','mail_servers_in','lodash','../../config/logger'];(function(_0x2ea80c,_0x2214e9){var _0x2f85c3=function(_0x583482){while(--_0x583482){_0x2ea80c['push'](_0x2ea80c['shift']());}};_0x2f85c3(++_0x2214e9);}(_0x80ed,0x11c));var _0xd80e=function(_0x25fd0c,_0x2d35e0){_0x25fd0c=_0x25fd0c-0x0;var _0x337e82=_0x80ed[_0x25fd0c];return _0x337e82;};'use strict';var _=require(_0xd80e('0x0'));var util=require('util');var logger=require(_0xd80e('0x1'))(_0xd80e('0x2'));var moment=require(_0xd80e('0x3'));var BPromise=require('bluebird');var rp=require(_0xd80e('0x4'));var fs=require('fs');var path=require(_0xd80e('0x5'));var rimraf=require(_0xd80e('0x6'));var config=require(_0xd80e('0x7'));var attributes=require('./mailServerIn.attributes');module[_0xd80e('0x8')]=function(_0x2b4742,_0x252fec){return _0x2b4742['define'](_0xd80e('0x9'),attributes,{'tableName':_0xd80e('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd5fc=['../../config/environment','exports','define','lodash','moment','bluebird','request-promise','path','rimraf'];(function(_0x5d0430,_0x15cc32){var _0x4d964c=function(_0x392cbf){while(--_0x392cbf){_0x5d0430['push'](_0x5d0430['shift']());}};_0x4d964c(++_0x15cc32);}(_0xd5fc,0xae));var _0xcd5f=function(_0x21a181,_0x233439){_0x21a181=_0x21a181-0x0;var _0x130335=_0xd5fc[_0x21a181];return _0x130335;};'use strict';var _=require(_0xcd5f('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xcd5f('0x1'));var BPromise=require(_0xcd5f('0x2'));var rp=require(_0xcd5f('0x3'));var fs=require('fs');var path=require(_0xcd5f('0x4'));var rimraf=require(_0xcd5f('0x5'));var config=require(_0xcd5f('0x6'));var attributes=require('./mailServerIn.attributes');module[_0xcd5f('0x7')]=function(_0x4b4ca8,_0x95b8bb){return _0x4b4ca8[_0xcd5f('0x8')]('MailServerIn',attributes,{'tableName':'mail_servers_in','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.rpc.js b/server/api/mailServerIn/mailServerIn.rpc.js index ff7e11f..fdf7bc9 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 _0xebf3=['randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','MailServerIn,\x20%s,\x20%s','debug','MailServerIn,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','MailServerIn','findAll','options','raw','where','limit','include','model','attributes','map','GetMailServerIn','lodash','util','moment'];(function(_0x48b6c6,_0xba4073){var _0x1bcc9a=function(_0x581c84){while(--_0x581c84){_0x48b6c6['push'](_0x48b6c6['shift']());}};_0x1bcc9a(++_0xba4073);}(_0xebf3,0x1e7));var _0x3ebf=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xebf3[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x3ebf('0x0'));var util=require(_0x3ebf('0x1'));var moment=require(_0x3ebf('0x2'));var BPromise=require('bluebird');var rs=require(_0x3ebf('0x3'));var fs=require('fs');var Redis=require(_0x3ebf('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x3ebf('0x5'));var logger=require(_0x3ebf('0x6'))(_0x3ebf('0x7'));var config=require(_0x3ebf('0x8'));var jayson=require(_0x3ebf('0x9'));var client=jayson[_0x3ebf('0xa')][_0x3ebf('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5acbc0,_0x505a5b,_0x490936){return new BPromise(function(_0x6ea543,_0x28e0d7){return client[_0x3ebf('0xc')](_0x5acbc0,_0x490936)[_0x3ebf('0xd')](function(_0x48b6fd){logger[_0x3ebf('0xe')](_0x3ebf('0xf'),_0x505a5b,'request\x20sent');logger[_0x3ebf('0x10')](_0x3ebf('0x11'),_0x505a5b,'request\x20sent',JSON[_0x3ebf('0x12')](_0x48b6fd));if(_0x48b6fd[_0x3ebf('0x13')]){if(_0x48b6fd[_0x3ebf('0x13')][_0x3ebf('0x14')]===0x1f4){logger[_0x3ebf('0x13')](_0x3ebf('0xf'),_0x505a5b,_0x48b6fd[_0x3ebf('0x13')][_0x3ebf('0x15')]);return _0x28e0d7(_0x48b6fd[_0x3ebf('0x13')][_0x3ebf('0x15')]);}logger[_0x3ebf('0x13')](_0x3ebf('0xf'),_0x505a5b,_0x48b6fd['error']['message']);return _0x6ea543(_0x48b6fd[_0x3ebf('0x13')][_0x3ebf('0x15')]);}else{logger['info'](_0x3ebf('0xf'),_0x505a5b,'request\x20sent');_0x6ea543(_0x48b6fd[_0x3ebf('0x16')]['message']);}})[_0x3ebf('0x17')](function(_0x59e52f){logger[_0x3ebf('0x13')](_0x3ebf('0xf'),_0x505a5b,_0x59e52f);_0x28e0d7(_0x59e52f);});});}exports['GetMailServerIn']=function(_0x5656f0){var _0x2dc7e4=this;return new Promise(function(_0x5a6ffc,_0x5c4462){return db[_0x3ebf('0x18')][_0x3ebf('0x19')]({'raw':_0x5656f0['options']?_0x5656f0[_0x3ebf('0x1a')][_0x3ebf('0x1b')]===undefined?!![]:![]:!![],'where':_0x5656f0[_0x3ebf('0x1a')]?_0x5656f0[_0x3ebf('0x1a')][_0x3ebf('0x1c')]||null:null,'attributes':_0x5656f0[_0x3ebf('0x1a')]?_0x5656f0['options']['attributes']||null:null,'limit':_0x5656f0[_0x3ebf('0x1a')]?_0x5656f0['options'][_0x3ebf('0x1d')]||null:null,'include':_0x5656f0[_0x3ebf('0x1a')]?_0x5656f0[_0x3ebf('0x1a')][_0x3ebf('0x1e')]?_['map'](_0x5656f0[_0x3ebf('0x1a')][_0x3ebf('0x1e')],function(_0xe06c0f){return{'model':db[_0xe06c0f[_0x3ebf('0x1f')]],'as':_0xe06c0f['as'],'attributes':_0xe06c0f[_0x3ebf('0x20')],'include':_0xe06c0f[_0x3ebf('0x1e')]?_[_0x3ebf('0x21')](_0xe06c0f[_0x3ebf('0x1e')],function(_0x3fad16){return{'model':db[_0x3fad16[_0x3ebf('0x1f')]],'as':_0x3fad16['as'],'attributes':_0x3fad16[_0x3ebf('0x20')],'include':_0x3fad16['include']?_[_0x3ebf('0x21')](_0x3fad16[_0x3ebf('0x1e')],function(_0x18e019){return{'model':db[_0x18e019[_0x3ebf('0x1f')]],'as':_0x18e019['as'],'attributes':_0x18e019[_0x3ebf('0x20')]};}):[]};}):[]};}):[]:[]})[_0x3ebf('0xd')](function(_0x407777){logger[_0x3ebf('0xe')](_0x3ebf('0x22'),_0x5656f0);logger[_0x3ebf('0x10')](_0x3ebf('0x22'),_0x5656f0,JSON[_0x3ebf('0x12')](_0x407777));_0x5a6ffc(_0x407777);})[_0x3ebf('0x17')](function(_0x4c80c3){logger['error']('GetMailServerIn',_0x4c80c3[_0x3ebf('0x15')],_0x5656f0);_0x5c4462(_0x2dc7e4[_0x3ebf('0x13')](0x1f4,_0x4c80c3[_0x3ebf('0x15')]));});});}; \ No newline at end of file +var _0xe355=['request','then','info','MailServerIn,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','GetMailServerIn','MailServerIn','findAll','options','raw','where','attributes','limit','include','map','model','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0xa7735,_0xb75fe6){var _0x49b8c7=function(_0x1db2db){while(--_0x1db2db){_0xa7735['push'](_0xa7735['shift']());}};_0x49b8c7(++_0xb75fe6);}(_0xe355,0xca));var _0x5e35=function(_0x52a290,_0x4e1cb5){_0x52a290=_0x52a290-0x0;var _0x347837=_0xe355[_0x52a290];return _0x347837;};'use strict';var _=require(_0x5e35('0x0'));var util=require(_0x5e35('0x1'));var moment=require(_0x5e35('0x2'));var BPromise=require(_0x5e35('0x3'));var rs=require(_0x5e35('0x4'));var fs=require('fs');var Redis=require(_0x5e35('0x5'));var db=require(_0x5e35('0x6'))['db'];var utils=require(_0x5e35('0x7'));var logger=require(_0x5e35('0x8'))(_0x5e35('0x9'));var config=require(_0x5e35('0xa'));var jayson=require(_0x5e35('0xb'));var client=jayson[_0x5e35('0xc')][_0x5e35('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x5f14ed,_0x4034d8,_0x28d252){return new BPromise(function(_0x49aeaa,_0x46b5e2){return client[_0x5e35('0xe')](_0x5f14ed,_0x28d252)[_0x5e35('0xf')](function(_0x1ba7e5){logger[_0x5e35('0x10')](_0x5e35('0x11'),_0x4034d8,_0x5e35('0x12'));logger[_0x5e35('0x13')]('MailServerIn,\x20%s,\x20%s,\x20%s',_0x4034d8,_0x5e35('0x12'),JSON[_0x5e35('0x14')](_0x1ba7e5));if(_0x1ba7e5[_0x5e35('0x15')]){if(_0x1ba7e5['error'][_0x5e35('0x16')]===0x1f4){logger['error'](_0x5e35('0x11'),_0x4034d8,_0x1ba7e5['error'][_0x5e35('0x17')]);return _0x46b5e2(_0x1ba7e5[_0x5e35('0x15')][_0x5e35('0x17')]);}logger['error']('MailServerIn,\x20%s,\x20%s',_0x4034d8,_0x1ba7e5['error'][_0x5e35('0x17')]);return _0x49aeaa(_0x1ba7e5['error'][_0x5e35('0x17')]);}else{logger[_0x5e35('0x10')](_0x5e35('0x11'),_0x4034d8,'request\x20sent');_0x49aeaa(_0x1ba7e5['result'][_0x5e35('0x17')]);}})[_0x5e35('0x18')](function(_0xcecfa5){logger[_0x5e35('0x15')]('MailServerIn,\x20%s,\x20%s',_0x4034d8,_0xcecfa5);_0x46b5e2(_0xcecfa5);});});}exports[_0x5e35('0x19')]=function(_0x32d706){var _0x254015=this;return new Promise(function(_0x87a57b,_0x217fa4){return db[_0x5e35('0x1a')][_0x5e35('0x1b')]({'raw':_0x32d706[_0x5e35('0x1c')]?_0x32d706[_0x5e35('0x1c')][_0x5e35('0x1d')]===undefined?!![]:![]:!![],'where':_0x32d706[_0x5e35('0x1c')]?_0x32d706['options'][_0x5e35('0x1e')]||null:null,'attributes':_0x32d706[_0x5e35('0x1c')]?_0x32d706[_0x5e35('0x1c')][_0x5e35('0x1f')]||null:null,'limit':_0x32d706[_0x5e35('0x1c')]?_0x32d706[_0x5e35('0x1c')][_0x5e35('0x20')]||null:null,'include':_0x32d706[_0x5e35('0x1c')]?_0x32d706['options'][_0x5e35('0x21')]?_[_0x5e35('0x22')](_0x32d706[_0x5e35('0x1c')][_0x5e35('0x21')],function(_0x27b16f){return{'model':db[_0x27b16f[_0x5e35('0x23')]],'as':_0x27b16f['as'],'attributes':_0x27b16f['attributes'],'include':_0x27b16f[_0x5e35('0x21')]?_[_0x5e35('0x22')](_0x27b16f[_0x5e35('0x21')],function(_0x37c2ac){return{'model':db[_0x37c2ac['model']],'as':_0x37c2ac['as'],'attributes':_0x37c2ac['attributes'],'include':_0x37c2ac[_0x5e35('0x21')]?_[_0x5e35('0x22')](_0x37c2ac[_0x5e35('0x21')],function(_0x5bc8cb){return{'model':db[_0x5bc8cb[_0x5e35('0x23')]],'as':_0x5bc8cb['as'],'attributes':_0x5bc8cb[_0x5e35('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x5e35('0xf')](function(_0xe6c140){logger[_0x5e35('0x10')](_0x5e35('0x19'),_0x32d706);logger[_0x5e35('0x13')](_0x5e35('0x19'),_0x32d706,JSON[_0x5e35('0x14')](_0xe6c140));_0x87a57b(_0xe6c140);})[_0x5e35('0x18')](function(_0x1220de){logger[_0x5e35('0x15')]('GetMailServerIn',_0x1220de['message'],_0x32d706);_0x217fa4(_0x254015[_0x5e35('0x15')](0x1f4,_0x1220de[_0x5e35('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerOut/index.js b/server/api/mailServerOut/index.js index 45326f8..b03dd0b 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 _0x8a89=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailServerOut.controller','get','isAuthenticated','index','post','create','put','/:id','update','delete','exports','multer','path'];(function(_0x704b25,_0x5c0741){var _0x2d904d=function(_0x1c7d8f){while(--_0x1c7d8f){_0x704b25['push'](_0x704b25['shift']());}};_0x2d904d(++_0x5c0741);}(_0x8a89,0x154));var _0x98a8=function(_0x290181,_0x46db3e){_0x290181=_0x290181-0x0;var _0x2dc9dc=_0x8a89[_0x290181];return _0x2dc9dc;};'use strict';var multer=require(_0x98a8('0x0'));var util=require('util');var path=require(_0x98a8('0x1'));var timeout=require('connect-timeout');var express=require(_0x98a8('0x2'));var router=express[_0x98a8('0x3')]();var auth=require(_0x98a8('0x4'));var interaction=require(_0x98a8('0x5'));var config=require(_0x98a8('0x6'));var controller=require(_0x98a8('0x7'));router[_0x98a8('0x8')]('/',auth[_0x98a8('0x9')](),controller[_0x98a8('0xa')]);router[_0x98a8('0x8')]('/:id',auth[_0x98a8('0x9')](),controller['show']);router[_0x98a8('0xb')]('/',auth['isAuthenticated'](),controller[_0x98a8('0xc')]);router[_0x98a8('0xd')](_0x98a8('0xe'),auth[_0x98a8('0x9')](),controller[_0x98a8('0xf')]);router[_0x98a8('0x10')](_0x98a8('0xe'),auth[_0x98a8('0x9')](),controller['destroy']);module[_0x98a8('0x11')]=router; \ No newline at end of file +var _0xaa9e=['put','update','delete','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','isAuthenticated','index','/:id','show','create'];(function(_0x1a7b8b,_0xe53a61){var _0x4e55f4=function(_0x22c00b){while(--_0x22c00b){_0x1a7b8b['push'](_0x1a7b8b['shift']());}};_0x4e55f4(++_0xe53a61);}(_0xaa9e,0xb7));var _0xeaa9=function(_0x1443eb,_0x203408){_0x1443eb=_0x1443eb-0x0;var _0x2b8810=_0xaa9e[_0x1443eb];return _0x2b8810;};'use strict';var multer=require('multer');var util=require(_0xeaa9('0x0'));var path=require(_0xeaa9('0x1'));var timeout=require(_0xeaa9('0x2'));var express=require(_0xeaa9('0x3'));var router=express[_0xeaa9('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xeaa9('0x5'));var config=require(_0xeaa9('0x6'));var controller=require('./mailServerOut.controller');router['get']('/',auth[_0xeaa9('0x7')](),controller[_0xeaa9('0x8')]);router['get'](_0xeaa9('0x9'),auth['isAuthenticated'](),controller[_0xeaa9('0xa')]);router['post']('/',auth['isAuthenticated'](),controller[_0xeaa9('0xb')]);router[_0xeaa9('0xc')](_0xeaa9('0x9'),auth['isAuthenticated'](),controller[_0xeaa9('0xd')]);router[_0xeaa9('0xe')](_0xeaa9('0x9'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.attributes.js b/server/api/mailServerOut/mailServerOut.attributes.js index c75d19b..a52d800 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 _0x9b97=['INTEGER','BOOLEAN','sequelize','STRING'];(function(_0x470f63,_0x48d80b){var _0x4f09e2=function(_0x3aa3a4){while(--_0x3aa3a4){_0x470f63['push'](_0x470f63['shift']());}};_0x4f09e2(++_0x48d80b);}(_0x9b97,0x11e));var _0x79b9=function(_0x3b1f98,_0x128803){_0x3b1f98=_0x3b1f98-0x0;var _0x54bd36=_0x9b97[_0x3b1f98];return _0x54bd36;};'use strict';var Sequelize=require(_0x79b9('0x0'));module['exports']={'description':{'type':Sequelize[_0x79b9('0x1')]},'host':{'type':Sequelize[_0x79b9('0x1')]},'user':{'type':Sequelize[_0x79b9('0x1')]},'pass':{'type':Sequelize[_0x79b9('0x1')]},'port':{'type':Sequelize[_0x79b9('0x2')]},'secure':{'type':Sequelize[_0x79b9('0x3')],'defaultValue':![]},'service':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file +var _0x9541=['exports','STRING','INTEGER','BOOLEAN','sequelize'];(function(_0xbc94a0,_0x3b1d8a){var _0x450b72=function(_0x25d215){while(--_0x25d215){_0xbc94a0['push'](_0xbc94a0['shift']());}};_0x450b72(++_0x3b1d8a);}(_0x9541,0xb3));var _0x1954=function(_0x4a5ac4,_0x234e9d){_0x4a5ac4=_0x4a5ac4-0x0;var _0x350360=_0x9541[_0x4a5ac4];return _0x350360;};'use strict';var Sequelize=require(_0x1954('0x0'));module[_0x1954('0x1')]={'description':{'type':Sequelize[_0x1954('0x2')]},'host':{'type':Sequelize[_0x1954('0x2')]},'user':{'type':Sequelize[_0x1954('0x2')]},'pass':{'type':Sequelize[_0x1954('0x2')]},'port':{'type':Sequelize[_0x1954('0x3')]},'secure':{'type':Sequelize[_0x1954('0x4')],'defaultValue':![]},'service':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.controller.js b/server/api/mailServerOut/mailServerOut.controller.js index 9f46297..f2fdf98 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 _0x9702=['rows','catch','show','length','create','body','find','params','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','mustache','sox','to-csv','ejs','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','end','count','offset','limit','status','set','Content-Range','json','reject','save','update','destroy','then','error','stack','name','index','MailServerOut','rawAttributes','model','keys','filters','intersection','query','fields','attributes','nolimit','order','sort','filter','where','merge','map','type','key','VIRTUAL','field','options','includeAll','include','findAll'];(function(_0x135aa4,_0x2e0106){var _0x40e147=function(_0x40e9c2){while(--_0x40e9c2){_0x135aa4['push'](_0x135aa4['shift']());}};_0x40e147(++_0x2e0106);}(_0x9702,0x1b2));var _0x2970=function(_0x3f1668,_0x3c0a8d){_0x3f1668=_0x3f1668-0x0;var _0x599f80=_0x9702[_0x3f1668];return _0x599f80;};'use strict';var pdf=require(_0x2970('0x0'));var emlformat=require(_0x2970('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x2970('0x2'));var jsonpatch=require(_0x2970('0x3'));var rp=require(_0x2970('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x2970('0x5'));var util=require('util');var path=require('path');var sox=require(_0x2970('0x6'));var csv=require(_0x2970('0x7'));var ejs=require(_0x2970('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0x2970('0x9'));var crypto=require(_0x2970('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x2970('0xb'));var toCsv=require('to-csv');var querystring=require(_0x2970('0xc'));var Papa=require('papaparse');var Redis=require(_0x2970('0xd'));var authService=require(_0x2970('0xe'));var qs=require(_0x2970('0xf'));var as=require(_0x2970('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2970('0x11'))(_0x2970('0x12'));var utils=require('../../config/utils');var config=require(_0x2970('0x13'));var db=require(_0x2970('0x14'))['db'];function respondWithStatusCode(_0x4652c7,_0x38e953){_0x38e953=_0x38e953||0xcc;return function(_0x14ddc2){if(_0x14ddc2){return _0x4652c7[_0x2970('0x15')](_0x38e953);}return _0x4652c7['status'](_0x38e953)[_0x2970('0x16')]();};}function respondWithResult(_0x522a19,_0x1ba971){_0x1ba971=_0x1ba971||0xc8;return function(_0x34ff02){if(_0x34ff02){return _0x522a19['status'](_0x1ba971)['json'](_0x34ff02);}};}function respondWithFilteredResult(_0x2ffe29,_0x18d3e9){return function(_0x54d7b2){if(_0x54d7b2){var _0x2af4fa=_0x54d7b2[_0x2970('0x17')],_0x171cc2=_0x18d3e9[_0x2970('0x18')],_0x20d2e6=_0x18d3e9['offset']+_0x18d3e9[_0x2970('0x19')],_0x4c5f0b;if(_0x20d2e6>=_0x2af4fa){_0x20d2e6=_0x2af4fa;_0x4c5f0b=0xc8;}else{_0x4c5f0b=0xce;}_0x2ffe29[_0x2970('0x1a')](_0x4c5f0b);return _0x2ffe29[_0x2970('0x1b')](_0x2970('0x1c'),_0x171cc2+'-'+_0x20d2e6+'/'+_0x2af4fa)[_0x2970('0x1d')](_0x54d7b2);}return null;};}function patchUpdates(_0x5d2a86){return function(_0x488087){try{jsonpatch['apply'](_0x488087,_0x5d2a86,!![]);}catch(_0x5356e7){return BPromise[_0x2970('0x1e')](_0x5356e7);}return _0x488087[_0x2970('0x1f')]();};}function saveUpdates(_0x424166,_0x19d27b){return function(_0x3d5603){if(_0x3d5603){return _0x3d5603[_0x2970('0x20')](_0x424166)['then'](function(_0x57d533){return _0x57d533;});}return null;};}function removeEntity(_0x5c31fc,_0x22629a){return function(_0x68373){if(_0x68373){return _0x68373[_0x2970('0x21')]()[_0x2970('0x22')](function(){_0x5c31fc[_0x2970('0x1a')](0xcc)[_0x2970('0x16')]();});}};}function handleEntityNotFound(_0x5649af,_0x3e6e4a){return function(_0x37f0a1){if(!_0x37f0a1){_0x5649af[_0x2970('0x15')](0x194);}return _0x37f0a1;};}function handleError(_0x4fa642,_0x57dd6c){_0x57dd6c=_0x57dd6c||0x1f4;return function(_0x2c1158){logger[_0x2970('0x23')](_0x2c1158[_0x2970('0x24')]);if(_0x2c1158[_0x2970('0x25')]){delete _0x2c1158[_0x2970('0x25')];}_0x4fa642[_0x2970('0x1a')](_0x57dd6c)['send'](_0x2c1158);};}exports[_0x2970('0x26')]=function(_0x4cabb0,_0x4b3380){var _0x59bfba={},_0x586e2c={},_0xcac579={'count':0x0,'rows':[]};var _0x7314ed=db[_0x2970('0x27')][_0x2970('0x28')];_0x586e2c[_0x2970('0x29')]=_[_0x2970('0x2a')](_0x7314ed);_0x586e2c['query']=_[_0x2970('0x2a')](_0x4cabb0['query']);_0x586e2c[_0x2970('0x2b')]=_[_0x2970('0x2c')](_0x586e2c[_0x2970('0x29')],_0x586e2c[_0x2970('0x2d')]);_0x59bfba['attributes']=_['intersection'](_0x586e2c[_0x2970('0x29')],qs['fields'](_0x4cabb0[_0x2970('0x2d')][_0x2970('0x2e')]));_0x59bfba[_0x2970('0x2f')]=_0x59bfba[_0x2970('0x2f')]['length']?_0x59bfba[_0x2970('0x2f')]:_0x586e2c[_0x2970('0x29')];if(!_0x4cabb0[_0x2970('0x2d')]['hasOwnProperty'](_0x2970('0x30'))){_0x59bfba[_0x2970('0x19')]=qs[_0x2970('0x19')](_0x4cabb0[_0x2970('0x2d')][_0x2970('0x19')]);_0x59bfba[_0x2970('0x18')]=qs[_0x2970('0x18')](_0x4cabb0[_0x2970('0x2d')][_0x2970('0x18')]);}_0x59bfba[_0x2970('0x31')]=qs[_0x2970('0x32')](_0x4cabb0[_0x2970('0x2d')][_0x2970('0x32')]);_0x59bfba['where']=qs[_0x2970('0x2b')](_['pick'](_0x4cabb0[_0x2970('0x2d')],_0x586e2c[_0x2970('0x2b')]));if(_0x4cabb0[_0x2970('0x2d')][_0x2970('0x33')]){_0x59bfba[_0x2970('0x34')]=_[_0x2970('0x35')](_0x59bfba[_0x2970('0x34')],{'$or':_[_0x2970('0x36')](_0x7314ed,function(_0x52315a){if(_0x52315a[_0x2970('0x37')][_0x2970('0x38')]!==_0x2970('0x39')){var _0x2ab6f2={};_0x2ab6f2[_0x52315a[_0x2970('0x3a')]]={'$like':'%'+_0x4cabb0[_0x2970('0x2d')][_0x2970('0x33')]+'%'};return _0x2ab6f2;}})});}_0x59bfba=_[_0x2970('0x35')]({},_0x59bfba,_0x4cabb0[_0x2970('0x3b')]);var _0x4d1feb={'where':_0x59bfba['where']};return db['MailServerOut'][_0x2970('0x17')](_0x4d1feb)[_0x2970('0x22')](function(_0x4c1673){_0xcac579['count']=_0x4c1673;if(_0x4cabb0[_0x2970('0x2d')][_0x2970('0x3c')]){_0x59bfba[_0x2970('0x3d')]=[{'all':!![]}];}return db[_0x2970('0x27')][_0x2970('0x3e')](_0x59bfba);})[_0x2970('0x22')](function(_0x27683e){_0xcac579[_0x2970('0x3f')]=_0x27683e;return _0xcac579;})['then'](respondWithFilteredResult(_0x4b3380,_0x59bfba))[_0x2970('0x40')](handleError(_0x4b3380,null));};exports[_0x2970('0x41')]=function(_0x33a805,_0x390669){var _0x3edf28={'raw':!![],'where':{'id':_0x33a805['params']['id']}},_0x4242e8={};_0x4242e8[_0x2970('0x29')]=_['keys'](db[_0x2970('0x27')][_0x2970('0x28')]);_0x4242e8[_0x2970('0x2d')]=_['keys'](_0x33a805['query']);_0x4242e8[_0x2970('0x2b')]=_[_0x2970('0x2c')](_0x4242e8[_0x2970('0x29')],_0x4242e8[_0x2970('0x2d')]);_0x3edf28[_0x2970('0x2f')]=_[_0x2970('0x2c')](_0x4242e8['model'],qs[_0x2970('0x2e')](_0x33a805['query'][_0x2970('0x2e')]));_0x3edf28[_0x2970('0x2f')]=_0x3edf28[_0x2970('0x2f')][_0x2970('0x42')]?_0x3edf28['attributes']:_0x4242e8[_0x2970('0x29')];if(_0x33a805[_0x2970('0x2d')][_0x2970('0x3c')]){_0x3edf28[_0x2970('0x3d')]=[{'all':!![]}];}_0x3edf28=_[_0x2970('0x35')]({},_0x3edf28,_0x33a805[_0x2970('0x3b')]);return db[_0x2970('0x27')]['find'](_0x3edf28)[_0x2970('0x22')](handleEntityNotFound(_0x390669,null))[_0x2970('0x22')](respondWithResult(_0x390669,null))[_0x2970('0x40')](handleError(_0x390669,null));};exports[_0x2970('0x43')]=function(_0x187c49,_0xb78209){return db[_0x2970('0x27')][_0x2970('0x43')](_0x187c49[_0x2970('0x44')],{})[_0x2970('0x22')](respondWithResult(_0xb78209,0xc9))[_0x2970('0x40')](handleError(_0xb78209,null));};exports['update']=function(_0xa1edad,_0x3334e3){if(_0xa1edad[_0x2970('0x44')]['id']){delete _0xa1edad[_0x2970('0x44')]['id'];}return db[_0x2970('0x27')][_0x2970('0x45')]({'where':{'id':_0xa1edad['params']['id']}})[_0x2970('0x22')](handleEntityNotFound(_0x3334e3,null))[_0x2970('0x22')](saveUpdates(_0xa1edad[_0x2970('0x44')],null))[_0x2970('0x22')](respondWithResult(_0x3334e3,null))['catch'](handleError(_0x3334e3,null));};exports[_0x2970('0x21')]=function(_0x3e1de7,_0x231454){return db[_0x2970('0x27')]['find']({'where':{'id':_0x3e1de7[_0x2970('0x46')]['id']}})[_0x2970('0x22')](handleEntityNotFound(_0x231454,null))[_0x2970('0x22')](removeEntity(_0x231454,null))[_0x2970('0x40')](handleError(_0x231454,null));}; \ No newline at end of file +var _0x759e=['map','type','key','VIRTUAL','filter','options','includeAll','include','rows','catch','show','params','length','find','create','body','update','html-pdf','rimraf','fast-json-patch','moment','bluebird','util','sox','to-csv','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','count','offset','limit','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','MailServerOut','rawAttributes','model','keys','query','filters','intersection','attributes','fields','nolimit','order','sort','where','pick','merge'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x759e,0x1c7));var _0xe759=function(_0x4504cb,_0xdc0f4){_0x4504cb=_0x4504cb-0x0;var _0x422a58=_0x759e[_0x4504cb];return _0x422a58;};'use strict';var pdf=require(_0xe759('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xe759('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe759('0x2'));var rp=require('request-promise');var moment=require(_0xe759('0x3'));var BPromise=require(_0xe759('0x4'));var Mustache=require('mustache');var util=require(_0xe759('0x5'));var path=require('path');var sox=require(_0xe759('0x6'));var csv=require(_0xe759('0x7'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0xe759('0x8'));var crypto=require(_0xe759('0x9'));var jsforce=require(_0xe759('0xa'));var deskjs=require(_0xe759('0xb'));var toCsv=require(_0xe759('0x7'));var querystring=require('querystring');var Papa=require(_0xe759('0xc'));var Redis=require(_0xe759('0xd'));var authService=require(_0xe759('0xe'));var qs=require(_0xe759('0xf'));var as=require(_0xe759('0x10'));var hardwareService=require(_0xe759('0x11'));var logger=require(_0xe759('0x12'))(_0xe759('0x13'));var utils=require(_0xe759('0x14'));var config=require(_0xe759('0x15'));var db=require(_0xe759('0x16'))['db'];function respondWithStatusCode(_0x3f4c68,_0x10a5fa){_0x10a5fa=_0x10a5fa||0xcc;return function(_0x24af77){if(_0x24af77){return _0x3f4c68[_0xe759('0x17')](_0x10a5fa);}return _0x3f4c68[_0xe759('0x18')](_0x10a5fa)[_0xe759('0x19')]();};}function respondWithResult(_0x1413ce,_0x2e29cc){_0x2e29cc=_0x2e29cc||0xc8;return function(_0x34dca8){if(_0x34dca8){return _0x1413ce[_0xe759('0x18')](_0x2e29cc)[_0xe759('0x1a')](_0x34dca8);}};}function respondWithFilteredResult(_0x2af67f,_0x2a46ff){return function(_0x13c1f9){if(_0x13c1f9){var _0x35da61=_0x13c1f9[_0xe759('0x1b')],_0x12db77=_0x2a46ff[_0xe759('0x1c')],_0x3cfd84=_0x2a46ff[_0xe759('0x1c')]+_0x2a46ff[_0xe759('0x1d')],_0x209bd2;if(_0x3cfd84>=_0x35da61){_0x3cfd84=_0x35da61;_0x209bd2=0xc8;}else{_0x209bd2=0xce;}_0x2af67f[_0xe759('0x18')](_0x209bd2);return _0x2af67f[_0xe759('0x1e')](_0xe759('0x1f'),_0x12db77+'-'+_0x3cfd84+'/'+_0x35da61)[_0xe759('0x1a')](_0x13c1f9);}return null;};}function patchUpdates(_0x2d3c62){return function(_0x49c0a3){try{jsonpatch[_0xe759('0x20')](_0x49c0a3,_0x2d3c62,!![]);}catch(_0x5e6de0){return BPromise[_0xe759('0x21')](_0x5e6de0);}return _0x49c0a3[_0xe759('0x22')]();};}function saveUpdates(_0x574f26,_0x12cef1){return function(_0x5d475f){if(_0x5d475f){return _0x5d475f['update'](_0x574f26)[_0xe759('0x23')](function(_0x4c55ea){return _0x4c55ea;});}return null;};}function removeEntity(_0x550afd,_0x5a15eb){return function(_0x2c1bbb){if(_0x2c1bbb){return _0x2c1bbb[_0xe759('0x24')]()[_0xe759('0x23')](function(){_0x550afd[_0xe759('0x18')](0xcc)[_0xe759('0x19')]();});}};}function handleEntityNotFound(_0x2e84bd,_0x1f211e){return function(_0x25f730){if(!_0x25f730){_0x2e84bd[_0xe759('0x17')](0x194);}return _0x25f730;};}function handleError(_0x270c8b,_0x437f83){_0x437f83=_0x437f83||0x1f4;return function(_0x42db73){logger[_0xe759('0x25')](_0x42db73[_0xe759('0x26')]);if(_0x42db73[_0xe759('0x27')]){delete _0x42db73[_0xe759('0x27')];}_0x270c8b[_0xe759('0x18')](_0x437f83)[_0xe759('0x28')](_0x42db73);};}exports['index']=function(_0x3d3e4c,_0x483f02){var _0x1e22e3={},_0x55162f={},_0x4e4ac0={'count':0x0,'rows':[]};var _0x2d8e01=db[_0xe759('0x29')][_0xe759('0x2a')];_0x55162f[_0xe759('0x2b')]=_[_0xe759('0x2c')](_0x2d8e01);_0x55162f[_0xe759('0x2d')]=_[_0xe759('0x2c')](_0x3d3e4c[_0xe759('0x2d')]);_0x55162f[_0xe759('0x2e')]=_[_0xe759('0x2f')](_0x55162f[_0xe759('0x2b')],_0x55162f['query']);_0x1e22e3[_0xe759('0x30')]=_['intersection'](_0x55162f[_0xe759('0x2b')],qs[_0xe759('0x31')](_0x3d3e4c[_0xe759('0x2d')][_0xe759('0x31')]));_0x1e22e3[_0xe759('0x30')]=_0x1e22e3['attributes']['length']?_0x1e22e3[_0xe759('0x30')]:_0x55162f[_0xe759('0x2b')];if(!_0x3d3e4c['query']['hasOwnProperty'](_0xe759('0x32'))){_0x1e22e3['limit']=qs[_0xe759('0x1d')](_0x3d3e4c[_0xe759('0x2d')][_0xe759('0x1d')]);_0x1e22e3[_0xe759('0x1c')]=qs[_0xe759('0x1c')](_0x3d3e4c[_0xe759('0x2d')][_0xe759('0x1c')]);}_0x1e22e3[_0xe759('0x33')]=qs[_0xe759('0x34')](_0x3d3e4c[_0xe759('0x2d')][_0xe759('0x34')]);_0x1e22e3[_0xe759('0x35')]=qs[_0xe759('0x2e')](_[_0xe759('0x36')](_0x3d3e4c[_0xe759('0x2d')],_0x55162f[_0xe759('0x2e')]));if(_0x3d3e4c[_0xe759('0x2d')]['filter']){_0x1e22e3[_0xe759('0x35')]=_[_0xe759('0x37')](_0x1e22e3[_0xe759('0x35')],{'$or':_[_0xe759('0x38')](_0x2d8e01,function(_0x315a6c){if(_0x315a6c[_0xe759('0x39')][_0xe759('0x3a')]!==_0xe759('0x3b')){var _0xdabd96={};_0xdabd96[_0x315a6c['field']]={'$like':'%'+_0x3d3e4c[_0xe759('0x2d')][_0xe759('0x3c')]+'%'};return _0xdabd96;}})});}_0x1e22e3=_[_0xe759('0x37')]({},_0x1e22e3,_0x3d3e4c[_0xe759('0x3d')]);var _0x29dce6={'where':_0x1e22e3[_0xe759('0x35')]};return db[_0xe759('0x29')][_0xe759('0x1b')](_0x29dce6)['then'](function(_0x34ba0f){_0x4e4ac0['count']=_0x34ba0f;if(_0x3d3e4c[_0xe759('0x2d')][_0xe759('0x3e')]){_0x1e22e3[_0xe759('0x3f')]=[{'all':!![]}];}return db[_0xe759('0x29')]['findAll'](_0x1e22e3);})['then'](function(_0xba3961){_0x4e4ac0[_0xe759('0x40')]=_0xba3961;return _0x4e4ac0;})[_0xe759('0x23')](respondWithFilteredResult(_0x483f02,_0x1e22e3))[_0xe759('0x41')](handleError(_0x483f02,null));};exports[_0xe759('0x42')]=function(_0x496fdf,_0x5d9128){var _0x10fcfe={'raw':!![],'where':{'id':_0x496fdf[_0xe759('0x43')]['id']}},_0x4b1f3b={};_0x4b1f3b['model']=_[_0xe759('0x2c')](db[_0xe759('0x29')]['rawAttributes']);_0x4b1f3b[_0xe759('0x2d')]=_[_0xe759('0x2c')](_0x496fdf[_0xe759('0x2d')]);_0x4b1f3b[_0xe759('0x2e')]=_['intersection'](_0x4b1f3b[_0xe759('0x2b')],_0x4b1f3b['query']);_0x10fcfe['attributes']=_[_0xe759('0x2f')](_0x4b1f3b[_0xe759('0x2b')],qs[_0xe759('0x31')](_0x496fdf[_0xe759('0x2d')]['fields']));_0x10fcfe[_0xe759('0x30')]=_0x10fcfe['attributes'][_0xe759('0x44')]?_0x10fcfe[_0xe759('0x30')]:_0x4b1f3b[_0xe759('0x2b')];if(_0x496fdf[_0xe759('0x2d')]['includeAll']){_0x10fcfe[_0xe759('0x3f')]=[{'all':!![]}];}_0x10fcfe=_[_0xe759('0x37')]({},_0x10fcfe,_0x496fdf[_0xe759('0x3d')]);return db[_0xe759('0x29')][_0xe759('0x45')](_0x10fcfe)[_0xe759('0x23')](handleEntityNotFound(_0x5d9128,null))['then'](respondWithResult(_0x5d9128,null))[_0xe759('0x41')](handleError(_0x5d9128,null));};exports['create']=function(_0x172dc0,_0xd87a19){return db['MailServerOut'][_0xe759('0x46')](_0x172dc0[_0xe759('0x47')],{})['then'](respondWithResult(_0xd87a19,0xc9))[_0xe759('0x41')](handleError(_0xd87a19,null));};exports[_0xe759('0x48')]=function(_0x2f4a98,_0x85ec39){if(_0x2f4a98[_0xe759('0x47')]['id']){delete _0x2f4a98['body']['id'];}return db['MailServerOut'][_0xe759('0x45')]({'where':{'id':_0x2f4a98[_0xe759('0x43')]['id']}})[_0xe759('0x23')](handleEntityNotFound(_0x85ec39,null))[_0xe759('0x23')](saveUpdates(_0x2f4a98[_0xe759('0x47')],null))[_0xe759('0x23')](respondWithResult(_0x85ec39,null))[_0xe759('0x41')](handleError(_0x85ec39,null));};exports[_0xe759('0x24')]=function(_0x3ed4ea,_0x4f3380){return db[_0xe759('0x29')][_0xe759('0x45')]({'where':{'id':_0x3ed4ea['params']['id']}})[_0xe759('0x23')](handleEntityNotFound(_0x4f3380,null))[_0xe759('0x23')](removeEntity(_0x4f3380,null))['catch'](handleError(_0x4f3380,null));}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.model.js b/server/api/mailServerOut/mailServerOut.model.js index 0a488be..c007306 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 _0x814b=['define','MailServerOut','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./mailServerOut.attributes','exports'];(function(_0x5edb0b,_0x1c5d50){var _0xe4eb92=function(_0x333a6c){while(--_0x333a6c){_0x5edb0b['push'](_0x5edb0b['shift']());}};_0xe4eb92(++_0x1c5d50);}(_0x814b,0x1a2));var _0xb814=function(_0x274f14,_0x27dd7f){_0x274f14=_0x274f14-0x0;var _0x13b97e=_0x814b[_0x274f14];return _0x13b97e;};'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':'mail_servers_out','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xda19=['exports','define','MailServerOut','mail_servers_out','util','../../config/logger','moment','request-promise','rimraf','../../config/environment','./mailServerOut.attributes'];(function(_0x283b81,_0x520df7){var _0x15e513=function(_0x3a95ce){while(--_0x3a95ce){_0x283b81['push'](_0x283b81['shift']());}};_0x15e513(++_0x520df7);}(_0xda19,0xd5));var _0x9da1=function(_0x409911,_0x308a0a){_0x409911=_0x409911-0x0;var _0x11e0c1=_0xda19[_0x409911];return _0x11e0c1;};'use strict';var _=require('lodash');var util=require(_0x9da1('0x0'));var logger=require(_0x9da1('0x1'))('api');var moment=require(_0x9da1('0x2'));var BPromise=require('bluebird');var rp=require(_0x9da1('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9da1('0x4'));var config=require(_0x9da1('0x5'));var attributes=require(_0x9da1('0x6'));module[_0x9da1('0x7')]=function(_0x156faf,_0x2dcbc6){return _0x156faf[_0x9da1('0x8')](_0x9da1('0x9'),attributes,{'tableName':_0x9da1('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.rpc.js b/server/api/mailServerOut/mailServerOut.rpc.js index 9e68c9d..61cf737 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 _0xbe73=['debug','MailServerOut,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','MailServerOut,\x20%s,\x20%s'];(function(_0x282be8,_0x326a4f){var _0x55991a=function(_0x565420){while(--_0x565420){_0x282be8['push'](_0x282be8['shift']());}};_0x55991a(++_0x326a4f);}(_0xbe73,0xa1));var _0x3be7=function(_0x1ad926,_0x3e1fed){_0x1ad926=_0x1ad926-0x0;var _0x1b81dc=_0xbe73[_0x1ad926];return _0x1b81dc;};'use strict';var _=require(_0x3be7('0x0'));var util=require('util');var moment=require(_0x3be7('0x1'));var BPromise=require(_0x3be7('0x2'));var rs=require(_0x3be7('0x3'));var fs=require('fs');var Redis=require(_0x3be7('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x3be7('0x5'));var logger=require('../../config/logger')(_0x3be7('0x6'));var config=require(_0x3be7('0x7'));var jayson=require(_0x3be7('0x8'));var client=jayson[_0x3be7('0x9')][_0x3be7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3f052e,_0x38e345,_0x43ee61){return new BPromise(function(_0x4655a0,_0x304aab){return client[_0x3be7('0xb')](_0x3f052e,_0x43ee61)[_0x3be7('0xc')](function(_0x3faf70){logger[_0x3be7('0xd')](_0x3be7('0xe'),_0x38e345,'request\x20sent');logger[_0x3be7('0xf')](_0x3be7('0x10'),_0x38e345,_0x3be7('0x11'),JSON['stringify'](_0x3faf70));if(_0x3faf70[_0x3be7('0x12')]){if(_0x3faf70[_0x3be7('0x12')][_0x3be7('0x13')]===0x1f4){logger[_0x3be7('0x12')](_0x3be7('0xe'),_0x38e345,_0x3faf70[_0x3be7('0x12')][_0x3be7('0x14')]);return _0x304aab(_0x3faf70[_0x3be7('0x12')][_0x3be7('0x14')]);}logger[_0x3be7('0x12')](_0x3be7('0xe'),_0x38e345,_0x3faf70[_0x3be7('0x12')][_0x3be7('0x14')]);return _0x4655a0(_0x3faf70[_0x3be7('0x12')]['message']);}else{logger['info']('MailServerOut,\x20%s,\x20%s',_0x38e345,_0x3be7('0x11'));_0x4655a0(_0x3faf70[_0x3be7('0x15')][_0x3be7('0x14')]);}})['catch'](function(_0x23d2c1){logger[_0x3be7('0x12')]('MailServerOut,\x20%s,\x20%s',_0x38e345,_0x23d2c1);_0x304aab(_0x23d2c1);});});} \ No newline at end of file +var _0xcbc4=['../../config/environment','client','http','request','info','MailServerOut,\x20%s,\x20%s','request\x20sent','debug','MailServerOut,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x2aea9e,_0x1f587f){var _0x430b92=function(_0x416c37){while(--_0x416c37){_0x2aea9e['push'](_0x2aea9e['shift']());}};_0x430b92(++_0x1f587f);}(_0xcbc4,0x157));var _0x4cbc=function(_0x5f2b03,_0x1a567a){_0x5f2b03=_0x5f2b03-0x0;var _0x570b33=_0xcbc4[_0x5f2b03];return _0x570b33;};'use strict';var _=require(_0x4cbc('0x0'));var util=require(_0x4cbc('0x1'));var moment=require(_0x4cbc('0x2'));var BPromise=require(_0x4cbc('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4cbc('0x4'));var db=require(_0x4cbc('0x5'))['db'];var utils=require(_0x4cbc('0x6'));var logger=require(_0x4cbc('0x7'))(_0x4cbc('0x8'));var config=require(_0x4cbc('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x4cbc('0xa')][_0x4cbc('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x58daed,_0x35f8fc,_0x396a40){return new BPromise(function(_0x205baf,_0xc3416c){return client[_0x4cbc('0xc')](_0x58daed,_0x396a40)['then'](function(_0x19d15d){logger[_0x4cbc('0xd')](_0x4cbc('0xe'),_0x35f8fc,_0x4cbc('0xf'));logger[_0x4cbc('0x10')](_0x4cbc('0x11'),_0x35f8fc,_0x4cbc('0xf'),JSON[_0x4cbc('0x12')](_0x19d15d));if(_0x19d15d[_0x4cbc('0x13')]){if(_0x19d15d['error']['code']===0x1f4){logger[_0x4cbc('0x13')](_0x4cbc('0xe'),_0x35f8fc,_0x19d15d[_0x4cbc('0x13')][_0x4cbc('0x14')]);return _0xc3416c(_0x19d15d[_0x4cbc('0x13')][_0x4cbc('0x14')]);}logger[_0x4cbc('0x13')](_0x4cbc('0xe'),_0x35f8fc,_0x19d15d[_0x4cbc('0x13')][_0x4cbc('0x14')]);return _0x205baf(_0x19d15d[_0x4cbc('0x13')][_0x4cbc('0x14')]);}else{logger[_0x4cbc('0xd')]('MailServerOut,\x20%s,\x20%s',_0x35f8fc,'request\x20sent');_0x205baf(_0x19d15d[_0x4cbc('0x15')][_0x4cbc('0x14')]);}})['catch'](function(_0x248db1){logger[_0x4cbc('0x13')](_0x4cbc('0xe'),_0x35f8fc,_0x248db1);_0xc3416c(_0x248db1);});});} \ No newline at end of file diff --git a/server/api/mailSubstatus/index.js b/server/api/mailSubstatus/index.js index 1ed6ce3..41e2a87 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 _0x560f=['util','path','connect-timeout','express','Router','../../config/environment','./mailSubstatus.controller','get','isAuthenticated','/describe','describe','show','post','create','put','/:id','update','delete','destroy','exports','multer'];(function(_0x234b4c,_0x35313a){var _0x3f2de2=function(_0x3d3226){while(--_0x3d3226){_0x234b4c['push'](_0x234b4c['shift']());}};_0x3f2de2(++_0x35313a);}(_0x560f,0x1cd));var _0xf560=function(_0x26f2c8,_0x1d555e){_0x26f2c8=_0x26f2c8-0x0;var _0x4ecc7b=_0x560f[_0x26f2c8];return _0x4ecc7b;};'use strict';var multer=require(_0xf560('0x0'));var util=require(_0xf560('0x1'));var path=require(_0xf560('0x2'));var timeout=require(_0xf560('0x3'));var express=require(_0xf560('0x4'));var router=express[_0xf560('0x5')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xf560('0x6'));var controller=require(_0xf560('0x7'));router[_0xf560('0x8')]('/',auth[_0xf560('0x9')](),controller['index']);router[_0xf560('0x8')](_0xf560('0xa'),auth[_0xf560('0x9')](),controller[_0xf560('0xb')]);router[_0xf560('0x8')]('/:id',auth[_0xf560('0x9')](),controller[_0xf560('0xc')]);router[_0xf560('0xd')]('/',auth[_0xf560('0x9')](),controller[_0xf560('0xe')]);router[_0xf560('0xf')](_0xf560('0x10'),auth[_0xf560('0x9')](),controller[_0xf560('0x11')]);router[_0xf560('0x12')]('/:id',auth[_0xf560('0x9')](),controller[_0xf560('0x13')]);module[_0xf560('0x14')]=router; \ No newline at end of file +var _0x177c=['multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','post','exports'];(function(_0x1070b2,_0x1b7f65){var _0x271966=function(_0x56357d){while(--_0x56357d){_0x1070b2['push'](_0x1070b2['shift']());}};_0x271966(++_0x1b7f65);}(_0x177c,0x1c0));var _0xc177=function(_0x10c9a2,_0x539e74){_0x10c9a2=_0x10c9a2-0x0;var _0x4cf909=_0x177c[_0x10c9a2];return _0x4cf909;};'use strict';var multer=require(_0xc177('0x0'));var util=require(_0xc177('0x1'));var path=require('path');var timeout=require(_0xc177('0x2'));var express=require(_0xc177('0x3'));var router=express[_0xc177('0x4')]();var auth=require(_0xc177('0x5'));var interaction=require(_0xc177('0x6'));var config=require(_0xc177('0x7'));var controller=require('./mailSubstatus.controller');router[_0xc177('0x8')]('/',auth[_0xc177('0x9')](),controller[_0xc177('0xa')]);router[_0xc177('0x8')](_0xc177('0xb'),auth[_0xc177('0x9')](),controller[_0xc177('0xc')]);router[_0xc177('0x8')](_0xc177('0xd'),auth['isAuthenticated'](),controller['show']);router[_0xc177('0xe')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0xc177('0xd'),auth[_0xc177('0x9')](),controller['update']);router['delete'](_0xc177('0xd'),auth[_0xc177('0x9')](),controller['destroy']);module[_0xc177('0xf')]=router; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.attributes.js b/server/api/mailSubstatus/mailSubstatus.attributes.js index 893b1c0..7c33b7f 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 _0xc891=['sequelize','name'];(function(_0x59710f,_0x44c7f0){var _0xaae66a=function(_0x1c2397){while(--_0x1c2397){_0x59710f['push'](_0x59710f['shift']());}};_0xaae66a(++_0x44c7f0);}(_0xc891,0x152));var _0x1c89=function(_0x55f8b4,_0x43f30d){_0x55f8b4=_0x55f8b4-0x0;var _0x2475f9=_0xc891[_0x55f8b4];return _0x2475f9;};'use strict';var Sequelize=require(_0x1c89('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x1c89('0x1'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xff01=['sequelize','exports','name'];(function(_0x2c28b3,_0x542380){var _0x38c6f2=function(_0x57e62a){while(--_0x57e62a){_0x2c28b3['push'](_0x2c28b3['shift']());}};_0x38c6f2(++_0x542380);}(_0xff01,0xb7));var _0x1ff0=function(_0x2cff5c,_0x12056f){_0x2cff5c=_0x2cff5c-0x0;var _0x465839=_0xff01[_0x2cff5c];return _0x465839;};'use strict';var Sequelize=require(_0x1ff0('0x0'));module[_0x1ff0('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x1ff0('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.controller.js b/server/api/mailSubstatus/mailSubstatus.controller.js index 1585ff1..89702ce 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 _0xc4aa=['describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','path','sox','to-csv','ejs','lodash','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','apply','reject','save','update','then','error','stack','name','send','index','MailSubstatus','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','field','options','findAll','rows','catch','show','include','find','create','body','params','destroy'];(function(_0x2e1fed,_0x260d0d){var _0x23cb4b=function(_0x2e11c5){while(--_0x2e11c5){_0x2e1fed['push'](_0x2e1fed['shift']());}};_0x23cb4b(++_0x260d0d);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xc4aa[_0x42cae2];return _0x5f256f;};'use strict';var pdf=require(_0xac4a('0x0'));var emlformat=require(_0xac4a('0x1'));var rimraf=require(_0xac4a('0x2'));var zipdir=require(_0xac4a('0x3'));var jsonpatch=require(_0xac4a('0x4'));var rp=require(_0xac4a('0x5'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xac4a('0x6'));var path=require(_0xac4a('0x7'));var sox=require(_0xac4a('0x8'));var csv=require(_0xac4a('0x9'));var ejs=require(_0xac4a('0xa'));var fs=require('fs');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('0x9'));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 db=require(_0xac4a('0x15'))['db'];function respondWithStatusCode(_0x2a0776,_0x24291d){_0x24291d=_0x24291d||0xcc;return function(_0x5e16aa){if(_0x5e16aa){return _0x2a0776[_0xac4a('0x16')](_0x24291d);}return _0x2a0776[_0xac4a('0x17')](_0x24291d)[_0xac4a('0x18')]();};}function respondWithResult(_0x6e00d4,_0x1b4313){_0x1b4313=_0x1b4313||0xc8;return function(_0x3b71c0){if(_0x3b71c0){return _0x6e00d4[_0xac4a('0x17')](_0x1b4313)[_0xac4a('0x19')](_0x3b71c0);}};}function respondWithFilteredResult(_0x190418,_0x42c7fc){return function(_0x11e101){if(_0x11e101){var _0x26dbb8=_0x11e101[_0xac4a('0x1a')],_0x4a2119=_0x42c7fc[_0xac4a('0x1b')],_0x402fff=_0x42c7fc[_0xac4a('0x1b')]+_0x42c7fc[_0xac4a('0x1c')],_0x34d797;if(_0x402fff>=_0x26dbb8){_0x402fff=_0x26dbb8;_0x34d797=0xc8;}else{_0x34d797=0xce;}_0x190418[_0xac4a('0x17')](_0x34d797);return _0x190418[_0xac4a('0x1d')]('Content-Range',_0x4a2119+'-'+_0x402fff+'/'+_0x26dbb8)['json'](_0x11e101);}return null;};}function patchUpdates(_0x21a729){return function(_0x13c8eb){try{jsonpatch[_0xac4a('0x1e')](_0x13c8eb,_0x21a729,!![]);}catch(_0x4d837c){return BPromise[_0xac4a('0x1f')](_0x4d837c);}return _0x13c8eb[_0xac4a('0x20')]();};}function saveUpdates(_0x3752e4,_0x3a3cdb){return function(_0x123694){if(_0x123694){return _0x123694[_0xac4a('0x21')](_0x3752e4)[_0xac4a('0x22')](function(_0x3ca790){return _0x3ca790;});}return null;};}function removeEntity(_0x534092,_0x3d8f0a){return function(_0x3204ad){if(_0x3204ad){return _0x3204ad['destroy']()[_0xac4a('0x22')](function(){_0x534092[_0xac4a('0x17')](0xcc)[_0xac4a('0x18')]();});}};}function handleEntityNotFound(_0x947d8e,_0x4d2d6c){return function(_0x1b7998){if(!_0x1b7998){_0x947d8e[_0xac4a('0x16')](0x194);}return _0x1b7998;};}function handleError(_0x15435c,_0x412494){_0x412494=_0x412494||0x1f4;return function(_0x594f36){logger[_0xac4a('0x23')](_0x594f36[_0xac4a('0x24')]);if(_0x594f36[_0xac4a('0x25')]){delete _0x594f36[_0xac4a('0x25')];}_0x15435c[_0xac4a('0x17')](_0x412494)[_0xac4a('0x26')](_0x594f36);};}exports[_0xac4a('0x27')]=function(_0x14832b,_0x472c57){var _0x1c13dc={},_0x20202c={},_0x4e17ce={'count':0x0,'rows':[]};var _0x23b061=db[_0xac4a('0x28')][_0xac4a('0x29')];_0x20202c[_0xac4a('0x2a')]=_[_0xac4a('0x2b')](_0x23b061);_0x20202c['query']=_['keys'](_0x14832b[_0xac4a('0x2c')]);_0x20202c[_0xac4a('0x2d')]=_[_0xac4a('0x2e')](_0x20202c['model'],_0x20202c['query']);_0x1c13dc[_0xac4a('0x2f')]=_[_0xac4a('0x2e')](_0x20202c[_0xac4a('0x2a')],qs[_0xac4a('0x30')](_0x14832b[_0xac4a('0x2c')]['fields']));_0x1c13dc[_0xac4a('0x2f')]=_0x1c13dc['attributes'][_0xac4a('0x31')]?_0x1c13dc['attributes']:_0x20202c[_0xac4a('0x2a')];if(!_0x14832b[_0xac4a('0x2c')][_0xac4a('0x32')](_0xac4a('0x33'))){_0x1c13dc[_0xac4a('0x1c')]=qs[_0xac4a('0x1c')](_0x14832b[_0xac4a('0x2c')][_0xac4a('0x1c')]);_0x1c13dc[_0xac4a('0x1b')]=qs[_0xac4a('0x1b')](_0x14832b[_0xac4a('0x2c')][_0xac4a('0x1b')]);}_0x1c13dc[_0xac4a('0x34')]=qs[_0xac4a('0x35')](_0x14832b['query'][_0xac4a('0x35')]);_0x1c13dc[_0xac4a('0x36')]=qs['filters'](_[_0xac4a('0x37')](_0x14832b[_0xac4a('0x2c')],_0x20202c['filters']));if(_0x14832b['query'][_0xac4a('0x38')]){_0x1c13dc[_0xac4a('0x36')]=_[_0xac4a('0x39')](_0x1c13dc[_0xac4a('0x36')],{'$or':_['map'](_0x23b061,function(_0x453d02){if(_0x453d02[_0xac4a('0x3a')]['key']!==_0xac4a('0x3b')){var _0x34f55c={};_0x34f55c[_0x453d02[_0xac4a('0x3c')]]={'$like':'%'+_0x14832b['query'][_0xac4a('0x38')]+'%'};return _0x34f55c;}})});}_0x1c13dc=_[_0xac4a('0x39')]({},_0x1c13dc,_0x14832b[_0xac4a('0x3d')]);var _0x4e0445={'where':_0x1c13dc[_0xac4a('0x36')]};return db[_0xac4a('0x28')]['count'](_0x4e0445)['then'](function(_0x4319a1){_0x4e17ce['count']=_0x4319a1;if(_0x14832b['query']['includeAll']){_0x1c13dc['include']=[{'all':!![]}];}return db[_0xac4a('0x28')][_0xac4a('0x3e')](_0x1c13dc);})[_0xac4a('0x22')](function(_0x472484){_0x4e17ce[_0xac4a('0x3f')]=_0x472484;return _0x4e17ce;})[_0xac4a('0x22')](respondWithFilteredResult(_0x472c57,_0x1c13dc))[_0xac4a('0x40')](handleError(_0x472c57,null));};exports[_0xac4a('0x41')]=function(_0x28292c,_0x1f7721){var _0x14f7d5={'raw':!![],'where':{'id':_0x28292c['params']['id']}},_0x1c2a87={};_0x1c2a87['model']=_['keys'](db[_0xac4a('0x28')][_0xac4a('0x29')]);_0x1c2a87[_0xac4a('0x2c')]=_[_0xac4a('0x2b')](_0x28292c[_0xac4a('0x2c')]);_0x1c2a87[_0xac4a('0x2d')]=_[_0xac4a('0x2e')](_0x1c2a87[_0xac4a('0x2a')],_0x1c2a87[_0xac4a('0x2c')]);_0x14f7d5[_0xac4a('0x2f')]=_['intersection'](_0x1c2a87[_0xac4a('0x2a')],qs[_0xac4a('0x30')](_0x28292c[_0xac4a('0x2c')][_0xac4a('0x30')]));_0x14f7d5[_0xac4a('0x2f')]=_0x14f7d5['attributes'][_0xac4a('0x31')]?_0x14f7d5[_0xac4a('0x2f')]:_0x1c2a87['model'];if(_0x28292c[_0xac4a('0x2c')]['includeAll']){_0x14f7d5[_0xac4a('0x42')]=[{'all':!![]}];}_0x14f7d5=_[_0xac4a('0x39')]({},_0x14f7d5,_0x28292c[_0xac4a('0x3d')]);return db[_0xac4a('0x28')][_0xac4a('0x43')](_0x14f7d5)[_0xac4a('0x22')](handleEntityNotFound(_0x1f7721,null))[_0xac4a('0x22')](respondWithResult(_0x1f7721,null))[_0xac4a('0x40')](handleError(_0x1f7721,null));};exports[_0xac4a('0x44')]=function(_0xcb002b,_0x4fa9eb){return db[_0xac4a('0x28')]['create'](_0xcb002b[_0xac4a('0x45')],{})[_0xac4a('0x22')](respondWithResult(_0x4fa9eb,0xc9))[_0xac4a('0x40')](handleError(_0x4fa9eb,null));};exports['update']=function(_0x1764bf,_0x19276e){if(_0x1764bf['body']['id']){delete _0x1764bf[_0xac4a('0x45')]['id'];}return db['MailSubstatus'][_0xac4a('0x43')]({'where':{'id':_0x1764bf[_0xac4a('0x46')]['id']}})[_0xac4a('0x22')](handleEntityNotFound(_0x19276e,null))['then'](saveUpdates(_0x1764bf['body'],null))[_0xac4a('0x22')](respondWithResult(_0x19276e,null))['catch'](handleError(_0x19276e,null));};exports[_0xac4a('0x47')]=function(_0x566258,_0x3d2aaf){return db['MailSubstatus'][_0xac4a('0x43')]({'where':{'id':_0x566258[_0xac4a('0x46')]['id']}})[_0xac4a('0x22')](handleEntityNotFound(_0x3d2aaf,null))[_0xac4a('0x22')](removeEntity(_0x3d2aaf,null))['catch'](handleError(_0x3d2aaf,null));};exports[_0xac4a('0x48')]=function(_0x2af87f,_0x25bf3c){return db[_0xac4a('0x28')][_0xac4a('0x48')]()[_0xac4a('0x22')](respondWithResult(_0x25bf3c,null))[_0xac4a('0x40')](handleError(_0x25bf3c,null));}; \ No newline at end of file +var _0x7a54=['../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','set','Content-Range','apply','reject','save','then','destroy','sendStatus','error','name','send','MailSubstatus','rawAttributes','model','keys','query','intersection','attributes','fields','nolimit','limit','order','sort','where','pick','map','type','key','VIRTUAL','field','merge','options','count','includeAll','include','catch','show','params','filters','length','find','create','body','update','describe','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api'];(function(_0x113de8,_0x12aa03){var _0xd3c67a=function(_0x9a5042){while(--_0x9a5042){_0x113de8['push'](_0x113de8['shift']());}};_0xd3c67a(++_0x12aa03);}(_0x7a54,0x106));var _0x47a5=function(_0x4f43e8,_0x475eff){_0x4f43e8=_0x4f43e8-0x0;var _0xb73357=_0x7a54[_0x4f43e8];return _0xb73357;};'use strict';var pdf=require(_0x47a5('0x0'));var emlformat=require(_0x47a5('0x1'));var rimraf=require(_0x47a5('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x47a5('0x3'));var rp=require(_0x47a5('0x4'));var moment=require('moment');var BPromise=require(_0x47a5('0x5'));var Mustache=require(_0x47a5('0x6'));var util=require(_0x47a5('0x7'));var path=require(_0x47a5('0x8'));var sox=require(_0x47a5('0x9'));var csv=require('to-csv');var ejs=require(_0x47a5('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var db=require(_0x47a5('0x14'))['db'];function respondWithStatusCode(_0xd612dd,_0xd308b8){_0xd308b8=_0xd308b8||0xcc;return function(_0x1eae59){if(_0x1eae59){return _0xd612dd['sendStatus'](_0xd308b8);}return _0xd612dd[_0x47a5('0x15')](_0xd308b8)[_0x47a5('0x16')]();};}function respondWithResult(_0x1cf309,_0x711793){_0x711793=_0x711793||0xc8;return function(_0x139f25){if(_0x139f25){return _0x1cf309[_0x47a5('0x15')](_0x711793)[_0x47a5('0x17')](_0x139f25);}};}function respondWithFilteredResult(_0x190faa,_0x4e99a8){return function(_0x362359){if(_0x362359){var _0x11faf5=_0x362359['count'],_0x3b001e=_0x4e99a8['offset'],_0x2a2cbb=_0x4e99a8[_0x47a5('0x18')]+_0x4e99a8['limit'],_0x1ef44c;if(_0x2a2cbb>=_0x11faf5){_0x2a2cbb=_0x11faf5;_0x1ef44c=0xc8;}else{_0x1ef44c=0xce;}_0x190faa['status'](_0x1ef44c);return _0x190faa[_0x47a5('0x19')](_0x47a5('0x1a'),_0x3b001e+'-'+_0x2a2cbb+'/'+_0x11faf5)[_0x47a5('0x17')](_0x362359);}return null;};}function patchUpdates(_0x1ef371){return function(_0x477b1d){try{jsonpatch[_0x47a5('0x1b')](_0x477b1d,_0x1ef371,!![]);}catch(_0x2763d6){return BPromise[_0x47a5('0x1c')](_0x2763d6);}return _0x477b1d[_0x47a5('0x1d')]();};}function saveUpdates(_0x4a9fcb,_0x1570bc){return function(_0xf160ba){if(_0xf160ba){return _0xf160ba['update'](_0x4a9fcb)[_0x47a5('0x1e')](function(_0x1f03f7){return _0x1f03f7;});}return null;};}function removeEntity(_0x36874d,_0x4c5910){return function(_0xb8ae6c){if(_0xb8ae6c){return _0xb8ae6c[_0x47a5('0x1f')]()[_0x47a5('0x1e')](function(){_0x36874d[_0x47a5('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0xe2dea9,_0x385687){return function(_0x513981){if(!_0x513981){_0xe2dea9[_0x47a5('0x20')](0x194);}return _0x513981;};}function handleError(_0xc4cd63,_0x4437f1){_0x4437f1=_0x4437f1||0x1f4;return function(_0x129ce5){logger[_0x47a5('0x21')](_0x129ce5['stack']);if(_0x129ce5['name']){delete _0x129ce5[_0x47a5('0x22')];}_0xc4cd63['status'](_0x4437f1)[_0x47a5('0x23')](_0x129ce5);};}exports['index']=function(_0x23cb77,_0x378208){var _0x36ad34={},_0x1dac65={},_0x21f296={'count':0x0,'rows':[]};var _0x3ba0b7=db[_0x47a5('0x24')][_0x47a5('0x25')];_0x1dac65[_0x47a5('0x26')]=_[_0x47a5('0x27')](_0x3ba0b7);_0x1dac65[_0x47a5('0x28')]=_[_0x47a5('0x27')](_0x23cb77[_0x47a5('0x28')]);_0x1dac65['filters']=_[_0x47a5('0x29')](_0x1dac65['model'],_0x1dac65[_0x47a5('0x28')]);_0x36ad34[_0x47a5('0x2a')]=_[_0x47a5('0x29')](_0x1dac65['model'],qs[_0x47a5('0x2b')](_0x23cb77[_0x47a5('0x28')][_0x47a5('0x2b')]));_0x36ad34[_0x47a5('0x2a')]=_0x36ad34['attributes']['length']?_0x36ad34[_0x47a5('0x2a')]:_0x1dac65[_0x47a5('0x26')];if(!_0x23cb77['query']['hasOwnProperty'](_0x47a5('0x2c'))){_0x36ad34[_0x47a5('0x2d')]=qs['limit'](_0x23cb77[_0x47a5('0x28')]['limit']);_0x36ad34[_0x47a5('0x18')]=qs[_0x47a5('0x18')](_0x23cb77['query']['offset']);}_0x36ad34[_0x47a5('0x2e')]=qs['sort'](_0x23cb77[_0x47a5('0x28')][_0x47a5('0x2f')]);_0x36ad34[_0x47a5('0x30')]=qs['filters'](_[_0x47a5('0x31')](_0x23cb77['query'],_0x1dac65['filters']));if(_0x23cb77[_0x47a5('0x28')]['filter']){_0x36ad34[_0x47a5('0x30')]=_['merge'](_0x36ad34[_0x47a5('0x30')],{'$or':_[_0x47a5('0x32')](_0x3ba0b7,function(_0x38c8d4){if(_0x38c8d4[_0x47a5('0x33')][_0x47a5('0x34')]!==_0x47a5('0x35')){var _0xee582c={};_0xee582c[_0x38c8d4[_0x47a5('0x36')]]={'$like':'%'+_0x23cb77[_0x47a5('0x28')]['filter']+'%'};return _0xee582c;}})});}_0x36ad34=_[_0x47a5('0x37')]({},_0x36ad34,_0x23cb77[_0x47a5('0x38')]);var _0x511c06={'where':_0x36ad34[_0x47a5('0x30')]};return db[_0x47a5('0x24')][_0x47a5('0x39')](_0x511c06)['then'](function(_0x101f70){_0x21f296[_0x47a5('0x39')]=_0x101f70;if(_0x23cb77['query'][_0x47a5('0x3a')]){_0x36ad34[_0x47a5('0x3b')]=[{'all':!![]}];}return db['MailSubstatus']['findAll'](_0x36ad34);})['then'](function(_0x12d9f2){_0x21f296['rows']=_0x12d9f2;return _0x21f296;})[_0x47a5('0x1e')](respondWithFilteredResult(_0x378208,_0x36ad34))[_0x47a5('0x3c')](handleError(_0x378208,null));};exports[_0x47a5('0x3d')]=function(_0x111f0d,_0x1b2c80){var _0xcb5243={'raw':!![],'where':{'id':_0x111f0d[_0x47a5('0x3e')]['id']}},_0x2003b0={};_0x2003b0[_0x47a5('0x26')]=_[_0x47a5('0x27')](db[_0x47a5('0x24')][_0x47a5('0x25')]);_0x2003b0[_0x47a5('0x28')]=_['keys'](_0x111f0d[_0x47a5('0x28')]);_0x2003b0[_0x47a5('0x3f')]=_[_0x47a5('0x29')](_0x2003b0[_0x47a5('0x26')],_0x2003b0['query']);_0xcb5243[_0x47a5('0x2a')]=_['intersection'](_0x2003b0['model'],qs['fields'](_0x111f0d['query'][_0x47a5('0x2b')]));_0xcb5243['attributes']=_0xcb5243[_0x47a5('0x2a')][_0x47a5('0x40')]?_0xcb5243[_0x47a5('0x2a')]:_0x2003b0['model'];if(_0x111f0d[_0x47a5('0x28')][_0x47a5('0x3a')]){_0xcb5243['include']=[{'all':!![]}];}_0xcb5243=_['merge']({},_0xcb5243,_0x111f0d[_0x47a5('0x38')]);return db['MailSubstatus'][_0x47a5('0x41')](_0xcb5243)[_0x47a5('0x1e')](handleEntityNotFound(_0x1b2c80,null))[_0x47a5('0x1e')](respondWithResult(_0x1b2c80,null))[_0x47a5('0x3c')](handleError(_0x1b2c80,null));};exports[_0x47a5('0x42')]=function(_0xf0edbb,_0x434227){return db[_0x47a5('0x24')][_0x47a5('0x42')](_0xf0edbb[_0x47a5('0x43')],{})[_0x47a5('0x1e')](respondWithResult(_0x434227,0xc9))[_0x47a5('0x3c')](handleError(_0x434227,null));};exports[_0x47a5('0x44')]=function(_0x3574d4,_0x4e5e7){if(_0x3574d4[_0x47a5('0x43')]['id']){delete _0x3574d4['body']['id'];}return db[_0x47a5('0x24')][_0x47a5('0x41')]({'where':{'id':_0x3574d4['params']['id']}})['then'](handleEntityNotFound(_0x4e5e7,null))[_0x47a5('0x1e')](saveUpdates(_0x3574d4['body'],null))[_0x47a5('0x1e')](respondWithResult(_0x4e5e7,null))[_0x47a5('0x3c')](handleError(_0x4e5e7,null));};exports['destroy']=function(_0x4f62d3,_0x3d85cc){return db['MailSubstatus'][_0x47a5('0x41')]({'where':{'id':_0x4f62d3[_0x47a5('0x3e')]['id']}})[_0x47a5('0x1e')](handleEntityNotFound(_0x3d85cc,null))[_0x47a5('0x1e')](removeEntity(_0x3d85cc,null))[_0x47a5('0x3c')](handleError(_0x3d85cc,null));};exports[_0x47a5('0x45')]=function(_0x238ebb,_0x53e994){return db['MailSubstatus'][_0x47a5('0x45')]()[_0x47a5('0x1e')](respondWithResult(_0x53e994,null))[_0x47a5('0x3c')](handleError(_0x53e994,null));}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.model.js b/server/api/mailSubstatus/mailSubstatus.model.js index c6efaa6..8bdc7de 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 _0x659c=['exports','define','MailSubstatus','lodash','api','moment','request-promise','path','./mailSubstatus.attributes'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x659c,0x1aa));var _0xc659=function(_0x2d061c,_0x48e86c){_0x2d061c=_0x2d061c-0x0;var _0x2f1dfd=_0x659c[_0x2d061c];return _0x2f1dfd;};'use strict';var _=require(_0xc659('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xc659('0x1'));var moment=require(_0xc659('0x2'));var BPromise=require('bluebird');var rp=require(_0xc659('0x3'));var fs=require('fs');var path=require(_0xc659('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xc659('0x5'));module[_0xc659('0x6')]=function(_0x369dc0,_0x312440){return _0x369dc0[_0xc659('0x7')](_0xc659('0x8'),attributes,{'tableName':'mail_substatuses','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6d0c=['api','moment','bluebird','path','./mailSubstatus.attributes','define','MailSubstatus','mail_substatuses','lodash','util','../../config/logger'];(function(_0x41c923,_0x1978c2){var _0x4aab06=function(_0x201b49){while(--_0x201b49){_0x41c923['push'](_0x41c923['shift']());}};_0x4aab06(++_0x1978c2);}(_0x6d0c,0x8c));var _0xc6d0=function(_0x575554,_0x2817bc){_0x575554=_0x575554-0x0;var _0x515bd2=_0x6d0c[_0x575554];return _0x515bd2;};'use strict';var _=require(_0xc6d0('0x0'));var util=require(_0xc6d0('0x1'));var logger=require(_0xc6d0('0x2'))(_0xc6d0('0x3'));var moment=require(_0xc6d0('0x4'));var BPromise=require(_0xc6d0('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc6d0('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xc6d0('0x7'));module['exports']=function(_0x589214,_0xdae4c3){return _0x589214[_0xc6d0('0x8')](_0xc6d0('0x9'),attributes,{'tableName':_0xc6d0('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 8b680c2..b3608ce 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 _0xb43b=['rpc','../../config/environment','http','request','info','request\x20sent','debug','MailSubstatus,\x20%s,\x20%s,\x20%s','stringify','error','code','message','MailSubstatus,\x20%s,\x20%s','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0xe2af12,_0x592032){var _0x17365d=function(_0xd77de2){while(--_0xd77de2){_0xe2af12['push'](_0xe2af12['shift']());}};_0x17365d(++_0x592032);}(_0xb43b,0x1b2));var _0xbb43=function(_0x211661,_0x4141f9){_0x211661=_0x211661-0x0;var _0x465616=_0xb43b[_0x211661];return _0x465616;};'use strict';var _=require(_0xbb43('0x0'));var util=require(_0xbb43('0x1'));var moment=require('moment');var BPromise=require(_0xbb43('0x2'));var rs=require(_0xbb43('0x3'));var fs=require('fs');var Redis=require(_0xbb43('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xbb43('0x5'));var logger=require(_0xbb43('0x6'))(_0xbb43('0x7'));var config=require(_0xbb43('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xbb43('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x553520,_0x80fe61,_0x1ccd49){return new BPromise(function(_0x2a2f11,_0x29ae1a){return client[_0xbb43('0xa')](_0x553520,_0x1ccd49)['then'](function(_0x208c2b){logger[_0xbb43('0xb')]('MailSubstatus,\x20%s,\x20%s',_0x80fe61,_0xbb43('0xc'));logger[_0xbb43('0xd')](_0xbb43('0xe'),_0x80fe61,_0xbb43('0xc'),JSON[_0xbb43('0xf')](_0x208c2b));if(_0x208c2b[_0xbb43('0x10')]){if(_0x208c2b['error'][_0xbb43('0x11')]===0x1f4){logger[_0xbb43('0x10')]('MailSubstatus,\x20%s,\x20%s',_0x80fe61,_0x208c2b['error'][_0xbb43('0x12')]);return _0x29ae1a(_0x208c2b['error']['message']);}logger[_0xbb43('0x10')]('MailSubstatus,\x20%s,\x20%s',_0x80fe61,_0x208c2b[_0xbb43('0x10')][_0xbb43('0x12')]);return _0x2a2f11(_0x208c2b['error']['message']);}else{logger['info'](_0xbb43('0x13'),_0x80fe61,_0xbb43('0xc'));_0x2a2f11(_0x208c2b['result']['message']);}})[_0xbb43('0x14')](function(_0x563ce1){logger['error'](_0xbb43('0x13'),_0x80fe61,_0x563ce1);_0x29ae1a(_0x563ce1);});});} \ No newline at end of file +var _0xb903=['http','request','MailSubstatus,\x20%s,\x20%s,\x20%s','request\x20sent','error','MailSubstatus,\x20%s,\x20%s','message','info','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x574cfa,_0x49a713){var _0x51744d=function(_0x4185b8){while(--_0x4185b8){_0x574cfa['push'](_0x574cfa['shift']());}};_0x51744d(++_0x49a713);}(_0xb903,0x185));var _0x3b90=function(_0x23c0e1,_0x28cb2a){_0x23c0e1=_0x23c0e1-0x0;var _0x24a836=_0xb903[_0x23c0e1];return _0x24a836;};'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']('MailSubstatus,\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']('MailSubstatus,\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/mailTransferReport/index.js b/server/api/mailTransferReport/index.js index ddcbe23..c03bf7b 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 _0x0b32=['/describe','describe','/:id','show','post','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','index'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0x0b32,0x122));var _0x20b3=function(_0x4bd962,_0x47dec7){_0x4bd962=_0x4bd962-0x0;var _0x913853=_0x0b32[_0x4bd962];return _0x913853;};'use strict';var multer=require('multer');var util=require(_0x20b3('0x0'));var path=require(_0x20b3('0x1'));var timeout=require(_0x20b3('0x2'));var express=require(_0x20b3('0x3'));var router=express[_0x20b3('0x4')]();var auth=require(_0x20b3('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x20b3('0x6'));var controller=require('./mailTransferReport.controller');router[_0x20b3('0x7')]('/',auth[_0x20b3('0x8')](),controller[_0x20b3('0x9')]);router[_0x20b3('0x7')](_0x20b3('0xa'),auth[_0x20b3('0x8')](),controller[_0x20b3('0xb')]);router['get'](_0x20b3('0xc'),auth[_0x20b3('0x8')](),controller[_0x20b3('0xd')]);router[_0x20b3('0xe')]('/',auth[_0x20b3('0x8')](),controller['create']);router[_0x20b3('0xf')](_0x20b3('0xc'),auth['isAuthenticated'](),controller[_0x20b3('0x10')]);router[_0x20b3('0x11')](_0x20b3('0xc'),auth[_0x20b3('0x8')](),controller[_0x20b3('0x12')]);module[_0x20b3('0x13')]=router; \ No newline at end of file +var _0xaa8f=['./mailTransferReport.controller','get','describe','/:id','isAuthenticated','post','create','update','delete','destroy','exports','multer','path','connect-timeout','express','../../components/interaction/service','../../config/environment'];(function(_0x45fe4b,_0x5b09a6){var _0xb0ede=function(_0x3c13c6){while(--_0x3c13c6){_0x45fe4b['push'](_0x45fe4b['shift']());}};_0xb0ede(++_0x5b09a6);}(_0xaa8f,0x181));var _0xfaa8=function(_0x3de873,_0x174b5f){_0x3de873=_0x3de873-0x0;var _0x380b8c=_0xaa8f[_0x3de873];return _0x380b8c;};'use strict';var multer=require(_0xfaa8('0x0'));var util=require('util');var path=require(_0xfaa8('0x1'));var timeout=require(_0xfaa8('0x2'));var express=require(_0xfaa8('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0xfaa8('0x4'));var config=require(_0xfaa8('0x5'));var controller=require(_0xfaa8('0x6'));router[_0xfaa8('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0xfaa8('0x7')]('/describe',auth['isAuthenticated'](),controller[_0xfaa8('0x8')]);router['get'](_0xfaa8('0x9'),auth[_0xfaa8('0xa')](),controller['show']);router[_0xfaa8('0xb')]('/',auth['isAuthenticated'](),controller[_0xfaa8('0xc')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xfaa8('0xd')]);router[_0xfaa8('0xe')](_0xfaa8('0x9'),auth[_0xfaa8('0xa')](),controller[_0xfaa8('0xf')]);module[_0xfaa8('0x10')]=router; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.attributes.js b/server/api/mailTransferReport/mailTransferReport.attributes.js index 18c18dd..356d9bc 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 _0x7ab3=['sequelize','exports','account','queue','DATE','NOW','moment'];(function(_0x56c419,_0x69c2ca){var _0x467dfb=function(_0x232d20){while(--_0x232d20){_0x56c419['push'](_0x56c419['shift']());}};_0x467dfb(++_0x69c2ca);}(_0x7ab3,0x11e));var _0x37ab=function(_0x5712f8,_0x17156b){_0x5712f8=_0x5712f8-0x0;var _0x14a364=_0x7ab3[_0x5712f8];return _0x14a364;};'use strict';var moment=require(_0x37ab('0x0'));var Sequelize=require(_0x37ab('0x1'));module[_0x37ab('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x37ab('0x3'),'agent',_0x37ab('0x4')),'allowNull':![],'defaultValue':_0x37ab('0x4')},'transferredAt':{'type':Sequelize[_0x37ab('0x5')],'allowNull':![],'defaultValue':Sequelize[_0x37ab('0x6')]}}; \ No newline at end of file +var _0xea3a=['NOW','sequelize','STRING','ENUM','account','agent','queue'];(function(_0x1350ae,_0x6ee22f){var _0x25d9e6=function(_0x5ab9aa){while(--_0x5ab9aa){_0x1350ae['push'](_0x1350ae['shift']());}};_0x25d9e6(++_0x6ee22f);}(_0xea3a,0x104));var _0xaea3=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xea3a[_0x4a9fb1];return _0x348672;};'use strict';var moment=require('moment');var Sequelize=require(_0xaea3('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xaea3('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xaea3('0x2')](_0xaea3('0x3'),_0xaea3('0x4'),_0xaea3('0x5')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0xaea3('0x6')]}}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.controller.js b/server/api/mailTransferReport/mailTransferReport.controller.js index 41991c7..922f0bf 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 _0x68c6=['field','merge','options','then','include','findAll','rows','catch','show','params','includeAll','find','create','body','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','crypto','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','sendStatus','status','end','count','limit','set','Content-Range','json','reject','save','update','destroy','stack','name','send','MailTransferReport','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','offset','where','filter','type','key','VIRTUAL'];(function(_0x3be0c4,_0x5b7eff){var _0x11af9f=function(_0x3f5113){while(--_0x3f5113){_0x3be0c4['push'](_0x3be0c4['shift']());}};_0x11af9f(++_0x5b7eff);}(_0x68c6,0x127));var _0x668c=function(_0x3c8499,_0x1e052e){_0x3c8499=_0x3c8499-0x0;var _0x51d346=_0x68c6[_0x3c8499];return _0x51d346;};'use strict';var pdf=require(_0x668c('0x0'));var emlformat=require(_0x668c('0x1'));var rimraf=require(_0x668c('0x2'));var zipdir=require(_0x668c('0x3'));var jsonpatch=require(_0x668c('0x4'));var rp=require(_0x668c('0x5'));var moment=require(_0x668c('0x6'));var BPromise=require(_0x668c('0x7'));var Mustache=require(_0x668c('0x8'));var util=require('util');var path=require(_0x668c('0x9'));var sox=require(_0x668c('0xa'));var csv=require(_0x668c('0xb'));var ejs=require(_0x668c('0xc'));var fs=require('fs');var _=require(_0x668c('0xd'));var squel=require('squel');var crypto=require(_0x668c('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x668c('0xb'));var querystring=require('querystring');var Papa=require(_0x668c('0xf'));var Redis=require(_0x668c('0x10'));var authService=require(_0x668c('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x668c('0x12'));var hardwareService=require(_0x668c('0x13'));var logger=require(_0x668c('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x668c('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3a8161,_0x231355){_0x231355=_0x231355||0xcc;return function(_0x367148){if(_0x367148){return _0x3a8161[_0x668c('0x16')](_0x231355);}return _0x3a8161[_0x668c('0x17')](_0x231355)[_0x668c('0x18')]();};}function respondWithResult(_0x89a3c9,_0x1ab771){_0x1ab771=_0x1ab771||0xc8;return function(_0x45fe64){if(_0x45fe64){return _0x89a3c9[_0x668c('0x17')](_0x1ab771)['json'](_0x45fe64);}};}function respondWithFilteredResult(_0x28e332,_0x113e98){return function(_0x1f0a41){if(_0x1f0a41){var _0x14b326=_0x1f0a41[_0x668c('0x19')],_0x3ca2bc=_0x113e98['offset'],_0x7ee0e4=_0x113e98['offset']+_0x113e98[_0x668c('0x1a')],_0x14c999;if(_0x7ee0e4>=_0x14b326){_0x7ee0e4=_0x14b326;_0x14c999=0xc8;}else{_0x14c999=0xce;}_0x28e332['status'](_0x14c999);return _0x28e332[_0x668c('0x1b')](_0x668c('0x1c'),_0x3ca2bc+'-'+_0x7ee0e4+'/'+_0x14b326)[_0x668c('0x1d')](_0x1f0a41);}return null;};}function patchUpdates(_0xe55091){return function(_0x17bf6b){try{jsonpatch['apply'](_0x17bf6b,_0xe55091,!![]);}catch(_0x5b689e){return BPromise[_0x668c('0x1e')](_0x5b689e);}return _0x17bf6b[_0x668c('0x1f')]();};}function saveUpdates(_0x17c5df,_0x46a72b){return function(_0x77359){if(_0x77359){return _0x77359[_0x668c('0x20')](_0x17c5df)['then'](function(_0x59edae){return _0x59edae;});}return null;};}function removeEntity(_0x16fe11,_0x3a1da2){return function(_0x303f61){if(_0x303f61){return _0x303f61[_0x668c('0x21')]()['then'](function(){_0x16fe11[_0x668c('0x17')](0xcc)[_0x668c('0x18')]();});}};}function handleEntityNotFound(_0x5154c9,_0xa8158a){return function(_0x69bb0d){if(!_0x69bb0d){_0x5154c9['sendStatus'](0x194);}return _0x69bb0d;};}function handleError(_0x4a7772,_0x5b5fa3){_0x5b5fa3=_0x5b5fa3||0x1f4;return function(_0x3ad915){logger['error'](_0x3ad915[_0x668c('0x22')]);if(_0x3ad915['name']){delete _0x3ad915[_0x668c('0x23')];}_0x4a7772['status'](_0x5b5fa3)[_0x668c('0x24')](_0x3ad915);};}exports['index']=function(_0x26fa1e,_0xc9582b){var _0x30166e={},_0x5cf121={},_0x2591f2={'count':0x0,'rows':[]};var _0x21cad6=db[_0x668c('0x25')][_0x668c('0x26')];_0x5cf121[_0x668c('0x27')]=_[_0x668c('0x28')](_0x21cad6);_0x5cf121[_0x668c('0x29')]=_[_0x668c('0x28')](_0x26fa1e['query']);_0x5cf121[_0x668c('0x2a')]=_[_0x668c('0x2b')](_0x5cf121[_0x668c('0x27')],_0x5cf121[_0x668c('0x29')]);_0x30166e[_0x668c('0x2c')]=_[_0x668c('0x2b')](_0x5cf121[_0x668c('0x27')],qs[_0x668c('0x2d')](_0x26fa1e[_0x668c('0x29')]['fields']));_0x30166e[_0x668c('0x2c')]=_0x30166e['attributes'][_0x668c('0x2e')]?_0x30166e[_0x668c('0x2c')]:_0x5cf121['model'];if(!_0x26fa1e[_0x668c('0x29')][_0x668c('0x2f')](_0x668c('0x30'))){_0x30166e[_0x668c('0x1a')]=qs['limit'](_0x26fa1e['query'][_0x668c('0x1a')]);_0x30166e['offset']=qs[_0x668c('0x31')](_0x26fa1e['query'][_0x668c('0x31')]);}_0x30166e['order']=qs['sort'](_0x26fa1e['query']['sort']);_0x30166e[_0x668c('0x32')]=qs[_0x668c('0x2a')](_['pick'](_0x26fa1e[_0x668c('0x29')],_0x5cf121[_0x668c('0x2a')]));if(_0x26fa1e[_0x668c('0x29')][_0x668c('0x33')]){_0x30166e['where']=_['merge'](_0x30166e['where'],{'$or':_['map'](_0x21cad6,function(_0x1241f2){if(_0x1241f2[_0x668c('0x34')][_0x668c('0x35')]!==_0x668c('0x36')){var _0x31d59f={};_0x31d59f[_0x1241f2[_0x668c('0x37')]]={'$like':'%'+_0x26fa1e['query']['filter']+'%'};return _0x31d59f;}})});}_0x30166e=_[_0x668c('0x38')]({},_0x30166e,_0x26fa1e[_0x668c('0x39')]);var _0xb455a4={'where':_0x30166e['where']};return db[_0x668c('0x25')][_0x668c('0x19')](_0xb455a4)[_0x668c('0x3a')](function(_0x388ab0){_0x2591f2['count']=_0x388ab0;if(_0x26fa1e['query']['includeAll']){_0x30166e[_0x668c('0x3b')]=[{'all':!![]}];}return db[_0x668c('0x25')][_0x668c('0x3c')](_0x30166e);})[_0x668c('0x3a')](function(_0xd0c2af){_0x2591f2[_0x668c('0x3d')]=_0xd0c2af;return _0x2591f2;})['then'](respondWithFilteredResult(_0xc9582b,_0x30166e))[_0x668c('0x3e')](handleError(_0xc9582b,null));};exports[_0x668c('0x3f')]=function(_0x1f50d6,_0x4d19f7){var _0x1cdfcc={'raw':!![],'where':{'id':_0x1f50d6[_0x668c('0x40')]['id']}},_0x4cc151={};_0x4cc151[_0x668c('0x27')]=_['keys'](db[_0x668c('0x25')][_0x668c('0x26')]);_0x4cc151[_0x668c('0x29')]=_['keys'](_0x1f50d6['query']);_0x4cc151['filters']=_[_0x668c('0x2b')](_0x4cc151[_0x668c('0x27')],_0x4cc151[_0x668c('0x29')]);_0x1cdfcc[_0x668c('0x2c')]=_[_0x668c('0x2b')](_0x4cc151[_0x668c('0x27')],qs[_0x668c('0x2d')](_0x1f50d6['query']['fields']));_0x1cdfcc['attributes']=_0x1cdfcc[_0x668c('0x2c')][_0x668c('0x2e')]?_0x1cdfcc['attributes']:_0x4cc151['model'];if(_0x1f50d6[_0x668c('0x29')][_0x668c('0x41')]){_0x1cdfcc[_0x668c('0x3b')]=[{'all':!![]}];}_0x1cdfcc=_[_0x668c('0x38')]({},_0x1cdfcc,_0x1f50d6[_0x668c('0x39')]);return db[_0x668c('0x25')][_0x668c('0x42')](_0x1cdfcc)['then'](handleEntityNotFound(_0x4d19f7,null))[_0x668c('0x3a')](respondWithResult(_0x4d19f7,null))['catch'](handleError(_0x4d19f7,null));};exports[_0x668c('0x43')]=function(_0x52e81e,_0x440c05){return db[_0x668c('0x25')]['create'](_0x52e81e[_0x668c('0x44')],{})[_0x668c('0x3a')](respondWithResult(_0x440c05,0xc9))[_0x668c('0x3e')](handleError(_0x440c05,null));};exports[_0x668c('0x20')]=function(_0x1d1b2e,_0x384bc8){if(_0x1d1b2e['body']['id']){delete _0x1d1b2e[_0x668c('0x44')]['id'];}return db[_0x668c('0x25')][_0x668c('0x42')]({'where':{'id':_0x1d1b2e[_0x668c('0x40')]['id']}})[_0x668c('0x3a')](handleEntityNotFound(_0x384bc8,null))[_0x668c('0x3a')](saveUpdates(_0x1d1b2e['body'],null))[_0x668c('0x3a')](respondWithResult(_0x384bc8,null))[_0x668c('0x3e')](handleError(_0x384bc8,null));};exports[_0x668c('0x21')]=function(_0x29e5e1,_0x1c2902){return db[_0x668c('0x25')][_0x668c('0x42')]({'where':{'id':_0x29e5e1['params']['id']}})[_0x668c('0x3a')](handleEntityNotFound(_0x1c2902,null))[_0x668c('0x3a')](removeEntity(_0x1c2902,null))['catch'](handleError(_0x1c2902,null));};exports[_0x668c('0x45')]=function(_0x24d9d9,_0x45c425){return db[_0x668c('0x25')]['describe']()[_0x668c('0x3a')](respondWithResult(_0x45c425,null))['catch'](handleError(_0x45c425,null));}; \ No newline at end of file +var _0x91f6=['params','describe','html-pdf','zip-dir','moment','util','path','sox','to-csv','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','limit','Content-Range','json','apply','save','update','then','destroy','error','stack','name','send','index','MailTransferReport','rawAttributes','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','order','sort','pick','filter','where','merge','key','VIRTUAL','field','options','includeAll','include','findAll','catch','show','length','find','create','body'];(function(_0x413aac,_0x5e2430){var _0x569b11=function(_0x52e060){while(--_0x52e060){_0x413aac['push'](_0x413aac['shift']());}};_0x569b11(++_0x5e2430);}(_0x91f6,0xd4));var _0x691f=function(_0x109373,_0x36ae6d){_0x109373=_0x109373-0x0;var _0x4a0c36=_0x91f6[_0x109373];return _0x4a0c36;};'use strict';var pdf=require(_0x691f('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x691f('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x691f('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x691f('0x3'));var path=require(_0x691f('0x4'));var sox=require(_0x691f('0x5'));var csv=require(_0x691f('0x6'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x691f('0x7'));var squel=require(_0x691f('0x8'));var crypto=require(_0x691f('0x9'));var jsforce=require(_0x691f('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x691f('0x6'));var querystring=require(_0x691f('0xb'));var Papa=require('papaparse');var Redis=require(_0x691f('0xc'));var authService=require(_0x691f('0xd'));var qs=require(_0x691f('0xe'));var as=require(_0x691f('0xf'));var hardwareService=require(_0x691f('0x10'));var logger=require(_0x691f('0x11'))('api');var utils=require(_0x691f('0x12'));var config=require(_0x691f('0x13'));var db=require(_0x691f('0x14'))['db'];function respondWithStatusCode(_0xaab211,_0xf71dc4){_0xf71dc4=_0xf71dc4||0xcc;return function(_0x2d92b8){if(_0x2d92b8){return _0xaab211[_0x691f('0x15')](_0xf71dc4);}return _0xaab211[_0x691f('0x16')](_0xf71dc4)[_0x691f('0x17')]();};}function respondWithResult(_0x204245,_0x2096fa){_0x2096fa=_0x2096fa||0xc8;return function(_0x55a918){if(_0x55a918){return _0x204245[_0x691f('0x16')](_0x2096fa)['json'](_0x55a918);}};}function respondWithFilteredResult(_0x24ebc2,_0x43a24e){return function(_0x3da977){if(_0x3da977){var _0x93c945=_0x3da977[_0x691f('0x18')],_0x3f47e1=_0x43a24e[_0x691f('0x19')],_0x37243c=_0x43a24e[_0x691f('0x19')]+_0x43a24e[_0x691f('0x1a')],_0xfefa5f;if(_0x37243c>=_0x93c945){_0x37243c=_0x93c945;_0xfefa5f=0xc8;}else{_0xfefa5f=0xce;}_0x24ebc2[_0x691f('0x16')](_0xfefa5f);return _0x24ebc2['set'](_0x691f('0x1b'),_0x3f47e1+'-'+_0x37243c+'/'+_0x93c945)[_0x691f('0x1c')](_0x3da977);}return null;};}function patchUpdates(_0x34aa00){return function(_0x53a9ea){try{jsonpatch[_0x691f('0x1d')](_0x53a9ea,_0x34aa00,!![]);}catch(_0x17ff9b){return BPromise['reject'](_0x17ff9b);}return _0x53a9ea[_0x691f('0x1e')]();};}function saveUpdates(_0x1e1cef,_0x4d2d56){return function(_0x282abd){if(_0x282abd){return _0x282abd[_0x691f('0x1f')](_0x1e1cef)[_0x691f('0x20')](function(_0x2cb7b0){return _0x2cb7b0;});}return null;};}function removeEntity(_0x4893b7,_0x1f8c15){return function(_0x18ad2d){if(_0x18ad2d){return _0x18ad2d[_0x691f('0x21')]()[_0x691f('0x20')](function(){_0x4893b7[_0x691f('0x16')](0xcc)[_0x691f('0x17')]();});}};}function handleEntityNotFound(_0x138baf,_0x355c77){return function(_0xd0e36e){if(!_0xd0e36e){_0x138baf[_0x691f('0x15')](0x194);}return _0xd0e36e;};}function handleError(_0x3f52d8,_0x92098){_0x92098=_0x92098||0x1f4;return function(_0x21f342){logger[_0x691f('0x22')](_0x21f342[_0x691f('0x23')]);if(_0x21f342['name']){delete _0x21f342[_0x691f('0x24')];}_0x3f52d8['status'](_0x92098)[_0x691f('0x25')](_0x21f342);};}exports[_0x691f('0x26')]=function(_0x4a11a7,_0xe51871){var _0x48e040={},_0x40b574={},_0x5d863a={'count':0x0,'rows':[]};var _0x34b40f=db[_0x691f('0x27')][_0x691f('0x28')];_0x40b574[_0x691f('0x29')]=_[_0x691f('0x2a')](_0x34b40f);_0x40b574[_0x691f('0x2b')]=_[_0x691f('0x2a')](_0x4a11a7['query']);_0x40b574[_0x691f('0x2c')]=_[_0x691f('0x2d')](_0x40b574[_0x691f('0x29')],_0x40b574['query']);_0x48e040[_0x691f('0x2e')]=_[_0x691f('0x2d')](_0x40b574[_0x691f('0x29')],qs[_0x691f('0x2f')](_0x4a11a7['query'][_0x691f('0x2f')]));_0x48e040[_0x691f('0x2e')]=_0x48e040[_0x691f('0x2e')]['length']?_0x48e040[_0x691f('0x2e')]:_0x40b574['model'];if(!_0x4a11a7[_0x691f('0x2b')][_0x691f('0x30')]('nolimit')){_0x48e040[_0x691f('0x1a')]=qs[_0x691f('0x1a')](_0x4a11a7['query'][_0x691f('0x1a')]);_0x48e040['offset']=qs['offset'](_0x4a11a7['query'][_0x691f('0x19')]);}_0x48e040[_0x691f('0x31')]=qs[_0x691f('0x32')](_0x4a11a7['query']['sort']);_0x48e040['where']=qs['filters'](_[_0x691f('0x33')](_0x4a11a7[_0x691f('0x2b')],_0x40b574[_0x691f('0x2c')]));if(_0x4a11a7[_0x691f('0x2b')][_0x691f('0x34')]){_0x48e040[_0x691f('0x35')]=_[_0x691f('0x36')](_0x48e040['where'],{'$or':_['map'](_0x34b40f,function(_0x16e887){if(_0x16e887['type'][_0x691f('0x37')]!==_0x691f('0x38')){var _0x3fc474={};_0x3fc474[_0x16e887[_0x691f('0x39')]]={'$like':'%'+_0x4a11a7[_0x691f('0x2b')][_0x691f('0x34')]+'%'};return _0x3fc474;}})});}_0x48e040=_['merge']({},_0x48e040,_0x4a11a7[_0x691f('0x3a')]);var _0x1b2afc={'where':_0x48e040[_0x691f('0x35')]};return db[_0x691f('0x27')][_0x691f('0x18')](_0x1b2afc)[_0x691f('0x20')](function(_0x458984){_0x5d863a[_0x691f('0x18')]=_0x458984;if(_0x4a11a7['query'][_0x691f('0x3b')]){_0x48e040[_0x691f('0x3c')]=[{'all':!![]}];}return db[_0x691f('0x27')][_0x691f('0x3d')](_0x48e040);})[_0x691f('0x20')](function(_0x4e3c58){_0x5d863a['rows']=_0x4e3c58;return _0x5d863a;})[_0x691f('0x20')](respondWithFilteredResult(_0xe51871,_0x48e040))[_0x691f('0x3e')](handleError(_0xe51871,null));};exports[_0x691f('0x3f')]=function(_0x426857,_0x307061){var _0x7b971c={'raw':!![],'where':{'id':_0x426857['params']['id']}},_0x145452={};_0x145452[_0x691f('0x29')]=_[_0x691f('0x2a')](db[_0x691f('0x27')][_0x691f('0x28')]);_0x145452[_0x691f('0x2b')]=_[_0x691f('0x2a')](_0x426857[_0x691f('0x2b')]);_0x145452[_0x691f('0x2c')]=_['intersection'](_0x145452[_0x691f('0x29')],_0x145452[_0x691f('0x2b')]);_0x7b971c['attributes']=_[_0x691f('0x2d')](_0x145452[_0x691f('0x29')],qs[_0x691f('0x2f')](_0x426857['query'][_0x691f('0x2f')]));_0x7b971c[_0x691f('0x2e')]=_0x7b971c[_0x691f('0x2e')][_0x691f('0x40')]?_0x7b971c['attributes']:_0x145452[_0x691f('0x29')];if(_0x426857[_0x691f('0x2b')][_0x691f('0x3b')]){_0x7b971c['include']=[{'all':!![]}];}_0x7b971c=_[_0x691f('0x36')]({},_0x7b971c,_0x426857['options']);return db[_0x691f('0x27')][_0x691f('0x41')](_0x7b971c)[_0x691f('0x20')](handleEntityNotFound(_0x307061,null))[_0x691f('0x20')](respondWithResult(_0x307061,null))[_0x691f('0x3e')](handleError(_0x307061,null));};exports[_0x691f('0x42')]=function(_0xedfd4b,_0x2c3f69){return db[_0x691f('0x27')][_0x691f('0x42')](_0xedfd4b['body'],{})['then'](respondWithResult(_0x2c3f69,0xc9))['catch'](handleError(_0x2c3f69,null));};exports[_0x691f('0x1f')]=function(_0x377fb9,_0x3a5820){if(_0x377fb9[_0x691f('0x43')]['id']){delete _0x377fb9['body']['id'];}return db['MailTransferReport'][_0x691f('0x41')]({'where':{'id':_0x377fb9[_0x691f('0x44')]['id']}})['then'](handleEntityNotFound(_0x3a5820,null))[_0x691f('0x20')](saveUpdates(_0x377fb9[_0x691f('0x43')],null))['then'](respondWithResult(_0x3a5820,null))[_0x691f('0x3e')](handleError(_0x3a5820,null));};exports['destroy']=function(_0x5b0880,_0x5dd762){return db['MailTransferReport']['find']({'where':{'id':_0x5b0880[_0x691f('0x44')]['id']}})['then'](handleEntityNotFound(_0x5dd762,null))[_0x691f('0x20')](removeEntity(_0x5dd762,null))[_0x691f('0x3e')](handleError(_0x5dd762,null));};exports[_0x691f('0x45')]=function(_0x43a075,_0x3d1984){return db[_0x691f('0x27')][_0x691f('0x45')]()[_0x691f('0x20')](respondWithResult(_0x3d1984,null))[_0x691f('0x3e')](handleError(_0x3d1984,null));}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.model.js b/server/api/mailTransferReport/mailTransferReport.model.js index 705221e..7606c04 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 _0xb739=['path','rimraf','../../config/environment','./mailTransferReport.attributes','exports','define','uniqueid','lodash','util','api','moment','bluebird','request-promise'];(function(_0x2e78c1,_0xe3cab6){var _0x33799e=function(_0x12a374){while(--_0x12a374){_0x2e78c1['push'](_0x2e78c1['shift']());}};_0x33799e(++_0xe3cab6);}(_0xb739,0x132));var _0x9b73=function(_0x416c1a,_0x19c685){_0x416c1a=_0x416c1a-0x0;var _0xcf7188=_0xb739[_0x416c1a];return _0xcf7188;};'use strict';var _=require(_0x9b73('0x0'));var util=require(_0x9b73('0x1'));var logger=require('../../config/logger')(_0x9b73('0x2'));var moment=require(_0x9b73('0x3'));var BPromise=require(_0x9b73('0x4'));var rp=require(_0x9b73('0x5'));var fs=require('fs');var path=require(_0x9b73('0x6'));var rimraf=require(_0x9b73('0x7'));var config=require(_0x9b73('0x8'));var attributes=require(_0x9b73('0x9'));module[_0x9b73('0xa')]=function(_0x1b8e8e,_0x1d203e){return _0x1b8e8e[_0x9b73('0xb')]('MailTransferReport',attributes,{'tableName':'report_mail_transfer','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x9b73('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x12c5=['MailTransferReport','report_mail_transfer','uniqueid','util','../../config/logger','api','bluebird','request-promise','path','exports','define'];(function(_0x3e698a,_0x59967d){var _0x2b4996=function(_0x8b93c8){while(--_0x8b93c8){_0x3e698a['push'](_0x3e698a['shift']());}};_0x2b4996(++_0x59967d);}(_0x12c5,0xbe));var _0x512c=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x12c5[_0x4b369d];return _0x571a98;};'use strict';var _=require('lodash');var util=require(_0x512c('0x0'));var logger=require(_0x512c('0x1'))(_0x512c('0x2'));var moment=require('moment');var BPromise=require(_0x512c('0x3'));var rp=require(_0x512c('0x4'));var fs=require('fs');var path=require(_0x512c('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./mailTransferReport.attributes');module[_0x512c('0x6')]=function(_0x2b18dc,_0x11e0b0){return _0x2b18dc[_0x512c('0x7')](_0x512c('0x8'),attributes,{'tableName':_0x512c('0x9'),'paranoid':![],'indexes':[{'name':_0x512c('0xa'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.rpc.js b/server/api/mailTransferReport/mailTransferReport.rpc.js index 5d2d9c8..3aa3d1e 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 _0xf725=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','request\x20sent','error','MailTransferReport,\x20%s,\x20%s','message','catch'];(function(_0x30bb7c,_0x27a364){var _0x3b32be=function(_0x4b031d){while(--_0x4b031d){_0x30bb7c['push'](_0x30bb7c['shift']());}};_0x3b32be(++_0x27a364);}(_0xf725,0x140));var _0x5f72=function(_0x362e59,_0x2331f8){_0x362e59=_0x362e59-0x0;var _0x439408=_0xf725[_0x362e59];return _0x439408;};'use strict';var _=require(_0x5f72('0x0'));var util=require(_0x5f72('0x1'));var moment=require(_0x5f72('0x2'));var BPromise=require(_0x5f72('0x3'));var rs=require(_0x5f72('0x4'));var fs=require('fs');var Redis=require(_0x5f72('0x5'));var db=require(_0x5f72('0x6'))['db'];var utils=require(_0x5f72('0x7'));var logger=require(_0x5f72('0x8'))(_0x5f72('0x9'));var config=require(_0x5f72('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x5f72('0xb')][_0x5f72('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1090f3,_0xdf5014,_0x3481ce){return new BPromise(function(_0x15179a,_0x170583){return client[_0x5f72('0xd')](_0x1090f3,_0x3481ce)[_0x5f72('0xe')](function(_0x4f1333){logger['info']('MailTransferReport,\x20%s,\x20%s',_0xdf5014,'request\x20sent');logger['debug']('MailTransferReport,\x20%s,\x20%s,\x20%s',_0xdf5014,_0x5f72('0xf'),JSON['stringify'](_0x4f1333));if(_0x4f1333[_0x5f72('0x10')]){if(_0x4f1333[_0x5f72('0x10')]['code']===0x1f4){logger[_0x5f72('0x10')](_0x5f72('0x11'),_0xdf5014,_0x4f1333['error'][_0x5f72('0x12')]);return _0x170583(_0x4f1333[_0x5f72('0x10')][_0x5f72('0x12')]);}logger['error'](_0x5f72('0x11'),_0xdf5014,_0x4f1333['error']['message']);return _0x15179a(_0x4f1333['error'][_0x5f72('0x12')]);}else{logger['info']('MailTransferReport,\x20%s,\x20%s',_0xdf5014,_0x5f72('0xf'));_0x15179a(_0x4f1333['result'][_0x5f72('0x12')]);}})[_0x5f72('0x13')](function(_0x23d9a9){logger[_0x5f72('0x10')](_0x5f72('0x11'),_0xdf5014,_0x23d9a9);_0x170583(_0x23d9a9);});});} \ No newline at end of file +var _0x869f=['message','info','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','request\x20sent','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','MailTransferReport,\x20%s,\x20%s'];(function(_0x22f164,_0xaa4f80){var _0x51ab95=function(_0x190b68){while(--_0x190b68){_0x22f164['push'](_0x22f164['shift']());}};_0x51ab95(++_0xaa4f80);}(_0x869f,0xdc));var _0xf869=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x869f[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var util=require(_0xf869('0x0'));var moment=require(_0xf869('0x1'));var BPromise=require(_0xf869('0x2'));var rs=require(_0xf869('0x3'));var fs=require('fs');var Redis=require(_0xf869('0x4'));var db=require(_0xf869('0x5'))['db'];var utils=require(_0xf869('0x6'));var logger=require(_0xf869('0x7'))(_0xf869('0x8'));var config=require(_0xf869('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xf869('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xb3b327,_0x41834,_0x349876){return new BPromise(function(_0x318125,_0x22ae50){return client[_0xf869('0xb')](_0xb3b327,_0x349876)[_0xf869('0xc')](function(_0x20aa93){logger['info']('MailTransferReport,\x20%s,\x20%s',_0x41834,_0xf869('0xd'));logger[_0xf869('0xe')](_0xf869('0xf'),_0x41834,_0xf869('0xd'),JSON[_0xf869('0x10')](_0x20aa93));if(_0x20aa93[_0xf869('0x11')]){if(_0x20aa93[_0xf869('0x11')][_0xf869('0x12')]===0x1f4){logger[_0xf869('0x11')](_0xf869('0x13'),_0x41834,_0x20aa93['error'][_0xf869('0x14')]);return _0x22ae50(_0x20aa93[_0xf869('0x11')][_0xf869('0x14')]);}logger[_0xf869('0x11')](_0xf869('0x13'),_0x41834,_0x20aa93[_0xf869('0x11')][_0xf869('0x14')]);return _0x318125(_0x20aa93[_0xf869('0x11')]['message']);}else{logger[_0xf869('0x15')](_0xf869('0x13'),_0x41834,_0xf869('0xd'));_0x318125(_0x20aa93[_0xf869('0x16')][_0xf869('0x14')]);}})[_0xf869('0x17')](function(_0x20337c){logger[_0xf869('0x11')](_0xf869('0x13'),_0x41834,_0x20337c);_0x22ae50(_0x20337c);});});} \ No newline at end of file diff --git a/server/api/memberReport/index.js b/server/api/memberReport/index.js index e313d12..1ed6eb2 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 _0x2e49=['post','create','put','update','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./memberReport.controller','get','/describe','isAuthenticated','describe','show'];(function(_0x4ad014,_0x35d9a3){var _0x2608f0=function(_0x2fedf7){while(--_0x2fedf7){_0x4ad014['push'](_0x4ad014['shift']());}};_0x2608f0(++_0x35d9a3);}(_0x2e49,0x1a8));var _0x92e4=function(_0x5708ed,_0x5a8606){_0x5708ed=_0x5708ed-0x0;var _0x53192b=_0x2e49[_0x5708ed];return _0x53192b;};'use strict';var multer=require(_0x92e4('0x0'));var util=require(_0x92e4('0x1'));var path=require(_0x92e4('0x2'));var timeout=require(_0x92e4('0x3'));var express=require('express');var router=express[_0x92e4('0x4')]();var auth=require(_0x92e4('0x5'));var interaction=require(_0x92e4('0x6'));var config=require('../../config/environment');var controller=require(_0x92e4('0x7'));router[_0x92e4('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x92e4('0x8')](_0x92e4('0x9'),auth[_0x92e4('0xa')](),controller[_0x92e4('0xb')]);router['get']('/:id',auth[_0x92e4('0xa')](),controller[_0x92e4('0xc')]);router[_0x92e4('0xd')]('/',auth['isAuthenticated'](),controller[_0x92e4('0xe')]);router[_0x92e4('0xf')]('/:id',auth[_0x92e4('0xa')](),controller[_0x92e4('0x10')]);router['delete']('/:id',auth[_0x92e4('0xa')](),controller[_0x92e4('0x11')]);module[_0x92e4('0x12')]=router; \ No newline at end of file +var _0x25a4=['post','create','put','update','delete','destroy','exports','multer','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./memberReport.controller','isAuthenticated','index','get','/describe','describe','/:id','show'];(function(_0x7fa3ff,_0x139d6a){var _0x27103d=function(_0x3f369c){while(--_0x3f369c){_0x7fa3ff['push'](_0x7fa3ff['shift']());}};_0x27103d(++_0x139d6a);}(_0x25a4,0x1eb));var _0x425a=function(_0x32d414,_0x4d23da){_0x32d414=_0x32d414-0x0;var _0x4e0bca=_0x25a4[_0x32d414];return _0x4e0bca;};'use strict';var multer=require(_0x425a('0x0'));var util=require('util');var path=require(_0x425a('0x1'));var timeout=require(_0x425a('0x2'));var express=require('express');var router=express[_0x425a('0x3')]();var auth=require(_0x425a('0x4'));var interaction=require(_0x425a('0x5'));var config=require(_0x425a('0x6'));var controller=require(_0x425a('0x7'));router['get']('/',auth[_0x425a('0x8')](),controller[_0x425a('0x9')]);router[_0x425a('0xa')](_0x425a('0xb'),auth[_0x425a('0x8')](),controller[_0x425a('0xc')]);router[_0x425a('0xa')](_0x425a('0xd'),auth[_0x425a('0x8')](),controller[_0x425a('0xe')]);router[_0x425a('0xf')]('/',auth[_0x425a('0x8')](),controller[_0x425a('0x10')]);router[_0x425a('0x11')]('/:id',auth[_0x425a('0x8')](),controller[_0x425a('0x12')]);router[_0x425a('0x13')](_0x425a('0xd'),auth[_0x425a('0x8')](),controller[_0x425a('0x14')]);module[_0x425a('0x15')]=router; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.attributes.js b/server/api/memberReport/memberReport.attributes.js index 321eb3e..64e4ef7 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 _0x2660=['exports','STRING','DEFAULT\x20PAUSE','LOGIN,\x20PAUSE,\x20TALKING','DATE','getDataValue','enterAt','diff','seconds','setDataValue','exitAt','duration','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]','talk:[dial\x20string]','talk:[queue]','INTEGER','moment'];(function(_0x7a5330,_0x44e314){var _0x21a765=function(_0x165805){while(--_0x165805){_0x7a5330['push'](_0x7a5330['shift']());}};_0x21a765(++_0x44e314);}(_0x2660,0x131));var _0x0266=function(_0x149ca0,_0x2ac7f5){_0x149ca0=_0x149ca0-0x0;var _0x56b6b9=_0x2660[_0x149ca0];return _0x56b6b9;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x0266('0x0'));module[_0x0266('0x1')]={'channel':{'type':Sequelize[_0x0266('0x2')]},'membername':{'type':Sequelize[_0x0266('0x2')]},'interface':{'type':Sequelize[_0x0266('0x2')]},'type':{'type':Sequelize['STRING'],'defaultValue':_0x0266('0x3'),'comment':_0x0266('0x4')},'duration':{'type':Sequelize['INTEGER']},'enterAt':{'type':Sequelize[_0x0266('0x5')]},'exitAt':{'type':Sequelize[_0x0266('0x5')],'set':function(_0x2f280c){var _0x523530=moment(_0x2f280c);var _0x13307b=moment(this[_0x0266('0x6')](_0x0266('0x7')));var _0x27c2d6=_0x523530[_0x0266('0x8')](_0x13307b,_0x0266('0x9'));this[_0x0266('0xa')](_0x0266('0xb'),_0x2f280c);this[_0x0266('0xa')](_0x0266('0xc'),_0x27c2d6||null);}},'data1':{'type':Sequelize[_0x0266('0x2')],'comment':_0x0266('0xd')},'data2':{'type':Sequelize[_0x0266('0x2')],'comment':_0x0266('0xe')},'data3':{'type':Sequelize[_0x0266('0x2')],'comment':'talk:[destination]'},'data4':{'type':Sequelize[_0x0266('0x2')],'comment':_0x0266('0xf')},'data5':{'type':Sequelize[_0x0266('0x2')],'comment':_0x0266('0x10')},'role':{'type':Sequelize[_0x0266('0x2')]},'internal':{'type':Sequelize[_0x0266('0x11')]},'uniqueid':{'type':Sequelize[_0x0266('0x2')]}}; \ No newline at end of file +var _0x2b7c=['exports','STRING','DEFAULT\x20PAUSE','LOGIN,\x20PAUSE,\x20TALKING','INTEGER','DATE','getDataValue','enterAt','seconds','setDataValue','exitAt','duration','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]','talk:[destination]','talk:[queue]','moment'];(function(_0x4478e5,_0x45531f){var _0x164392=function(_0xa3ba9b){while(--_0xa3ba9b){_0x4478e5['push'](_0x4478e5['shift']());}};_0x164392(++_0x45531f);}(_0x2b7c,0x10f));var _0xc2b7=function(_0x85ecb5,_0x1d55cd){_0x85ecb5=_0x85ecb5-0x0;var _0x53948e=_0x2b7c[_0x85ecb5];return _0x53948e;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xc2b7('0x0'));module[_0xc2b7('0x1')]={'channel':{'type':Sequelize[_0xc2b7('0x2')]},'membername':{'type':Sequelize[_0xc2b7('0x2')]},'interface':{'type':Sequelize[_0xc2b7('0x2')]},'type':{'type':Sequelize['STRING'],'defaultValue':_0xc2b7('0x3'),'comment':_0xc2b7('0x4')},'duration':{'type':Sequelize[_0xc2b7('0x5')]},'enterAt':{'type':Sequelize[_0xc2b7('0x6')]},'exitAt':{'type':Sequelize[_0xc2b7('0x6')],'set':function(_0x1bdc1d){var _0x1e9ae9=moment(_0x1bdc1d);var _0x3ff458=moment(this[_0xc2b7('0x7')](_0xc2b7('0x8')));var _0x346d8b=_0x1e9ae9['diff'](_0x3ff458,_0xc2b7('0x9'));this[_0xc2b7('0xa')](_0xc2b7('0xb'),_0x1bdc1d);this[_0xc2b7('0xa')](_0xc2b7('0xc'),_0x346d8b||null);}},'data1':{'type':Sequelize['STRING'],'comment':_0xc2b7('0xd')},'data2':{'type':Sequelize[_0xc2b7('0x2')],'comment':_0xc2b7('0xe')},'data3':{'type':Sequelize[_0xc2b7('0x2')],'comment':_0xc2b7('0xf')},'data4':{'type':Sequelize['STRING'],'comment':'talk:[dial\x20string]'},'data5':{'type':Sequelize[_0xc2b7('0x2')],'comment':_0xc2b7('0x10')},'role':{'type':Sequelize[_0xc2b7('0x2')]},'internal':{'type':Sequelize[_0xc2b7('0x5')]},'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 4d847e6..d5f10f9 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 _0xa9e0=['show','include','find','create','body','params','describe','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../mysqldb','sendStatus','status','json','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','end','error','name','send','index','MemberReport','rawAttributes','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','limit','order','sort','where','filters','filter','merge','map','type','key','field','options','includeAll','findAll','rows','catch'];(function(_0x66b701,_0x11bd6a){var _0x5c04a8=function(_0xfbb2d6){while(--_0xfbb2d6){_0x66b701['push'](_0x66b701['shift']());}};_0x5c04a8(++_0x11bd6a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0xa9e0[_0x1ac595];return _0x455fff;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var as=require(_0x0a9e('0x11'));var hardwareService=require(_0x0a9e('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x0a9e('0x13'))['db'];function respondWithStatusCode(_0x36471c,_0xd5b662){_0xd5b662=_0xd5b662||0xcc;return function(_0x26d672){if(_0x26d672){return _0x36471c[_0x0a9e('0x14')](_0xd5b662);}return _0x36471c[_0x0a9e('0x15')](_0xd5b662)['end']();};}function respondWithResult(_0x4283ce,_0x239b12){_0x239b12=_0x239b12||0xc8;return function(_0x2b4227){if(_0x2b4227){return _0x4283ce[_0x0a9e('0x15')](_0x239b12)[_0x0a9e('0x16')](_0x2b4227);}};}function respondWithFilteredResult(_0x4d5611,_0x52a03d){return function(_0x22dccb){if(_0x22dccb){var _0x5d0880=_0x22dccb[_0x0a9e('0x17')],_0x1985b6=_0x52a03d['offset'],_0x519dfd=_0x52a03d[_0x0a9e('0x18')]+_0x52a03d['limit'],_0x16033c;if(_0x519dfd>=_0x5d0880){_0x519dfd=_0x5d0880;_0x16033c=0xc8;}else{_0x16033c=0xce;}_0x4d5611[_0x0a9e('0x15')](_0x16033c);return _0x4d5611[_0x0a9e('0x19')](_0x0a9e('0x1a'),_0x1985b6+'-'+_0x519dfd+'/'+_0x5d0880)[_0x0a9e('0x16')](_0x22dccb);}return null;};}function patchUpdates(_0x31b1ca){return function(_0x2eb11f){try{jsonpatch[_0x0a9e('0x1b')](_0x2eb11f,_0x31b1ca,!![]);}catch(_0x20559e){return BPromise[_0x0a9e('0x1c')](_0x20559e);}return _0x2eb11f[_0x0a9e('0x1d')]();};}function saveUpdates(_0x1c696a,_0x105080){return function(_0x4bb1e3){if(_0x4bb1e3){return _0x4bb1e3[_0x0a9e('0x1e')](_0x1c696a)[_0x0a9e('0x1f')](function(_0x53682f){return _0x53682f;});}return null;};}function removeEntity(_0x20f109,_0x5a09ef){return function(_0x588269){if(_0x588269){return _0x588269[_0x0a9e('0x20')]()[_0x0a9e('0x1f')](function(){_0x20f109[_0x0a9e('0x15')](0xcc)[_0x0a9e('0x21')]();});}};}function handleEntityNotFound(_0x4abc77,_0xfb6e48){return function(_0x2fb0e4){if(!_0x2fb0e4){_0x4abc77[_0x0a9e('0x14')](0x194);}return _0x2fb0e4;};}function handleError(_0x4d00e6,_0x370d86){_0x370d86=_0x370d86||0x1f4;return function(_0x42ac8f){logger[_0x0a9e('0x22')](_0x42ac8f['stack']);if(_0x42ac8f['name']){delete _0x42ac8f[_0x0a9e('0x23')];}_0x4d00e6[_0x0a9e('0x15')](_0x370d86)[_0x0a9e('0x24')](_0x42ac8f);};}exports[_0x0a9e('0x25')]=function(_0x526cf3,_0x384319){var _0x479bc4={},_0x45a1e7={},_0x5bfb33={'count':0x0,'rows':[]};var _0x1dc186=db[_0x0a9e('0x26')][_0x0a9e('0x27')];_0x45a1e7[_0x0a9e('0x28')]=_[_0x0a9e('0x29')](_0x1dc186);_0x45a1e7[_0x0a9e('0x2a')]=_[_0x0a9e('0x29')](_0x526cf3[_0x0a9e('0x2a')]);_0x45a1e7['filters']=_[_0x0a9e('0x2b')](_0x45a1e7[_0x0a9e('0x28')],_0x45a1e7[_0x0a9e('0x2a')]);_0x479bc4[_0x0a9e('0x2c')]=_['intersection'](_0x45a1e7[_0x0a9e('0x28')],qs[_0x0a9e('0x2d')](_0x526cf3[_0x0a9e('0x2a')][_0x0a9e('0x2d')]));_0x479bc4[_0x0a9e('0x2c')]=_0x479bc4[_0x0a9e('0x2c')][_0x0a9e('0x2e')]?_0x479bc4[_0x0a9e('0x2c')]:_0x45a1e7[_0x0a9e('0x28')];if(!_0x526cf3['query'][_0x0a9e('0x2f')]('nolimit')){_0x479bc4[_0x0a9e('0x30')]=qs[_0x0a9e('0x30')](_0x526cf3[_0x0a9e('0x2a')][_0x0a9e('0x30')]);_0x479bc4[_0x0a9e('0x18')]=qs['offset'](_0x526cf3[_0x0a9e('0x2a')][_0x0a9e('0x18')]);}_0x479bc4[_0x0a9e('0x31')]=qs[_0x0a9e('0x32')](_0x526cf3[_0x0a9e('0x2a')][_0x0a9e('0x32')]);_0x479bc4[_0x0a9e('0x33')]=qs[_0x0a9e('0x34')](_['pick'](_0x526cf3[_0x0a9e('0x2a')],_0x45a1e7['filters']));if(_0x526cf3[_0x0a9e('0x2a')][_0x0a9e('0x35')]){_0x479bc4[_0x0a9e('0x33')]=_[_0x0a9e('0x36')](_0x479bc4['where'],{'$or':_[_0x0a9e('0x37')](_0x1dc186,function(_0xd1836d){if(_0xd1836d[_0x0a9e('0x38')][_0x0a9e('0x39')]!=='VIRTUAL'){var _0x54135e={};_0x54135e[_0xd1836d[_0x0a9e('0x3a')]]={'$like':'%'+_0x526cf3['query'][_0x0a9e('0x35')]+'%'};return _0x54135e;}})});}_0x479bc4=_[_0x0a9e('0x36')]({},_0x479bc4,_0x526cf3[_0x0a9e('0x3b')]);var _0x1ef87a={'where':_0x479bc4['where']};return db[_0x0a9e('0x26')][_0x0a9e('0x17')](_0x1ef87a)[_0x0a9e('0x1f')](function(_0x533942){_0x5bfb33[_0x0a9e('0x17')]=_0x533942;if(_0x526cf3[_0x0a9e('0x2a')][_0x0a9e('0x3c')]){_0x479bc4['include']=[{'all':!![]}];}return db['MemberReport'][_0x0a9e('0x3d')](_0x479bc4);})[_0x0a9e('0x1f')](function(_0x5adda1){_0x5bfb33[_0x0a9e('0x3e')]=_0x5adda1;return _0x5bfb33;})[_0x0a9e('0x1f')](respondWithFilteredResult(_0x384319,_0x479bc4))[_0x0a9e('0x3f')](handleError(_0x384319,null));};exports[_0x0a9e('0x40')]=function(_0x4b38d9,_0x5a594b){var _0x15e37d={'raw':!![],'where':{'id':_0x4b38d9['params']['id']}},_0x45b3d0={};_0x45b3d0[_0x0a9e('0x28')]=_[_0x0a9e('0x29')](db[_0x0a9e('0x26')]['rawAttributes']);_0x45b3d0[_0x0a9e('0x2a')]=_[_0x0a9e('0x29')](_0x4b38d9[_0x0a9e('0x2a')]);_0x45b3d0[_0x0a9e('0x34')]=_[_0x0a9e('0x2b')](_0x45b3d0[_0x0a9e('0x28')],_0x45b3d0[_0x0a9e('0x2a')]);_0x15e37d[_0x0a9e('0x2c')]=_[_0x0a9e('0x2b')](_0x45b3d0[_0x0a9e('0x28')],qs[_0x0a9e('0x2d')](_0x4b38d9[_0x0a9e('0x2a')][_0x0a9e('0x2d')]));_0x15e37d[_0x0a9e('0x2c')]=_0x15e37d[_0x0a9e('0x2c')]['length']?_0x15e37d['attributes']:_0x45b3d0[_0x0a9e('0x28')];if(_0x4b38d9[_0x0a9e('0x2a')][_0x0a9e('0x3c')]){_0x15e37d[_0x0a9e('0x41')]=[{'all':!![]}];}_0x15e37d=_[_0x0a9e('0x36')]({},_0x15e37d,_0x4b38d9[_0x0a9e('0x3b')]);return db[_0x0a9e('0x26')][_0x0a9e('0x42')](_0x15e37d)[_0x0a9e('0x1f')](handleEntityNotFound(_0x5a594b,null))[_0x0a9e('0x1f')](respondWithResult(_0x5a594b,null))[_0x0a9e('0x3f')](handleError(_0x5a594b,null));};exports[_0x0a9e('0x43')]=function(_0x5026aa,_0x117c99){return db[_0x0a9e('0x26')][_0x0a9e('0x43')](_0x5026aa[_0x0a9e('0x44')],{})[_0x0a9e('0x1f')](respondWithResult(_0x117c99,0xc9))[_0x0a9e('0x3f')](handleError(_0x117c99,null));};exports[_0x0a9e('0x1e')]=function(_0x44dd99,_0x59afe8){if(_0x44dd99[_0x0a9e('0x44')]['id']){delete _0x44dd99['body']['id'];}return db[_0x0a9e('0x26')][_0x0a9e('0x42')]({'where':{'id':_0x44dd99[_0x0a9e('0x45')]['id']}})['then'](handleEntityNotFound(_0x59afe8,null))[_0x0a9e('0x1f')](saveUpdates(_0x44dd99[_0x0a9e('0x44')],null))[_0x0a9e('0x1f')](respondWithResult(_0x59afe8,null))[_0x0a9e('0x3f')](handleError(_0x59afe8,null));};exports[_0x0a9e('0x20')]=function(_0x37be73,_0x45bf7f){return db['MemberReport'][_0x0a9e('0x42')]({'where':{'id':_0x37be73[_0x0a9e('0x45')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x45bf7f,null))[_0x0a9e('0x1f')](removeEntity(_0x45bf7f,null))[_0x0a9e('0x3f')](handleError(_0x45bf7f,null));};exports[_0x0a9e('0x46')]=function(_0x6054ee,_0x19383e){return db[_0x0a9e('0x26')]['describe']()[_0x0a9e('0x1f')](respondWithResult(_0x19383e,null))[_0x0a9e('0x3f')](handleError(_0x19383e,null));}; \ No newline at end of file +var _0xa9e0=['show','include','find','create','body','params','describe','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../mysqldb','sendStatus','status','json','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','end','error','name','send','index','MemberReport','rawAttributes','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','limit','order','sort','where','filters','filter','merge','map','type','key','field','options','includeAll','findAll','rows','catch'];(function(_0x54aed3,_0x285fbf){var _0x48cf55=function(_0x354407){while(--_0x354407){_0x54aed3['push'](_0x54aed3['shift']());}};_0x48cf55(++_0x285fbf);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xa9e0[_0x5ddb1c];return _0x354adc;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var as=require(_0x0a9e('0x11'));var hardwareService=require(_0x0a9e('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x0a9e('0x13'))['db'];function respondWithStatusCode(_0x36471c,_0xd5b662){_0xd5b662=_0xd5b662||0xcc;return function(_0x26d672){if(_0x26d672){return _0x36471c[_0x0a9e('0x14')](_0xd5b662);}return _0x36471c[_0x0a9e('0x15')](_0xd5b662)['end']();};}function respondWithResult(_0x4283ce,_0x239b12){_0x239b12=_0x239b12||0xc8;return function(_0x2b4227){if(_0x2b4227){return _0x4283ce[_0x0a9e('0x15')](_0x239b12)[_0x0a9e('0x16')](_0x2b4227);}};}function respondWithFilteredResult(_0x4d5611,_0x52a03d){return function(_0x22dccb){if(_0x22dccb){var _0x5d0880=_0x22dccb[_0x0a9e('0x17')],_0x1985b6=_0x52a03d['offset'],_0x519dfd=_0x52a03d[_0x0a9e('0x18')]+_0x52a03d['limit'],_0x16033c;if(_0x519dfd>=_0x5d0880){_0x519dfd=_0x5d0880;_0x16033c=0xc8;}else{_0x16033c=0xce;}_0x4d5611[_0x0a9e('0x15')](_0x16033c);return _0x4d5611[_0x0a9e('0x19')](_0x0a9e('0x1a'),_0x1985b6+'-'+_0x519dfd+'/'+_0x5d0880)[_0x0a9e('0x16')](_0x22dccb);}return null;};}function patchUpdates(_0x31b1ca){return function(_0x2eb11f){try{jsonpatch[_0x0a9e('0x1b')](_0x2eb11f,_0x31b1ca,!![]);}catch(_0x20559e){return BPromise[_0x0a9e('0x1c')](_0x20559e);}return _0x2eb11f[_0x0a9e('0x1d')]();};}function saveUpdates(_0x1c696a,_0x105080){return function(_0x4bb1e3){if(_0x4bb1e3){return _0x4bb1e3[_0x0a9e('0x1e')](_0x1c696a)[_0x0a9e('0x1f')](function(_0x53682f){return _0x53682f;});}return null;};}function removeEntity(_0x20f109,_0x5a09ef){return function(_0x588269){if(_0x588269){return _0x588269[_0x0a9e('0x20')]()[_0x0a9e('0x1f')](function(){_0x20f109[_0x0a9e('0x15')](0xcc)[_0x0a9e('0x21')]();});}};}function handleEntityNotFound(_0x4abc77,_0xfb6e48){return function(_0x2fb0e4){if(!_0x2fb0e4){_0x4abc77[_0x0a9e('0x14')](0x194);}return _0x2fb0e4;};}function handleError(_0x4d00e6,_0x370d86){_0x370d86=_0x370d86||0x1f4;return function(_0x42ac8f){logger[_0x0a9e('0x22')](_0x42ac8f['stack']);if(_0x42ac8f['name']){delete _0x42ac8f[_0x0a9e('0x23')];}_0x4d00e6[_0x0a9e('0x15')](_0x370d86)[_0x0a9e('0x24')](_0x42ac8f);};}exports[_0x0a9e('0x25')]=function(_0x526cf3,_0x384319){var _0x479bc4={},_0x45a1e7={},_0x5bfb33={'count':0x0,'rows':[]};var _0x1dc186=db[_0x0a9e('0x26')][_0x0a9e('0x27')];_0x45a1e7[_0x0a9e('0x28')]=_[_0x0a9e('0x29')](_0x1dc186);_0x45a1e7[_0x0a9e('0x2a')]=_[_0x0a9e('0x29')](_0x526cf3[_0x0a9e('0x2a')]);_0x45a1e7['filters']=_[_0x0a9e('0x2b')](_0x45a1e7[_0x0a9e('0x28')],_0x45a1e7[_0x0a9e('0x2a')]);_0x479bc4[_0x0a9e('0x2c')]=_['intersection'](_0x45a1e7[_0x0a9e('0x28')],qs[_0x0a9e('0x2d')](_0x526cf3[_0x0a9e('0x2a')][_0x0a9e('0x2d')]));_0x479bc4[_0x0a9e('0x2c')]=_0x479bc4[_0x0a9e('0x2c')][_0x0a9e('0x2e')]?_0x479bc4[_0x0a9e('0x2c')]:_0x45a1e7[_0x0a9e('0x28')];if(!_0x526cf3['query'][_0x0a9e('0x2f')]('nolimit')){_0x479bc4[_0x0a9e('0x30')]=qs[_0x0a9e('0x30')](_0x526cf3[_0x0a9e('0x2a')][_0x0a9e('0x30')]);_0x479bc4[_0x0a9e('0x18')]=qs['offset'](_0x526cf3[_0x0a9e('0x2a')][_0x0a9e('0x18')]);}_0x479bc4[_0x0a9e('0x31')]=qs[_0x0a9e('0x32')](_0x526cf3[_0x0a9e('0x2a')][_0x0a9e('0x32')]);_0x479bc4[_0x0a9e('0x33')]=qs[_0x0a9e('0x34')](_['pick'](_0x526cf3[_0x0a9e('0x2a')],_0x45a1e7['filters']));if(_0x526cf3[_0x0a9e('0x2a')][_0x0a9e('0x35')]){_0x479bc4[_0x0a9e('0x33')]=_[_0x0a9e('0x36')](_0x479bc4['where'],{'$or':_[_0x0a9e('0x37')](_0x1dc186,function(_0xd1836d){if(_0xd1836d[_0x0a9e('0x38')][_0x0a9e('0x39')]!=='VIRTUAL'){var _0x54135e={};_0x54135e[_0xd1836d[_0x0a9e('0x3a')]]={'$like':'%'+_0x526cf3['query'][_0x0a9e('0x35')]+'%'};return _0x54135e;}})});}_0x479bc4=_[_0x0a9e('0x36')]({},_0x479bc4,_0x526cf3[_0x0a9e('0x3b')]);var _0x1ef87a={'where':_0x479bc4['where']};return db[_0x0a9e('0x26')][_0x0a9e('0x17')](_0x1ef87a)[_0x0a9e('0x1f')](function(_0x533942){_0x5bfb33[_0x0a9e('0x17')]=_0x533942;if(_0x526cf3[_0x0a9e('0x2a')][_0x0a9e('0x3c')]){_0x479bc4['include']=[{'all':!![]}];}return db['MemberReport'][_0x0a9e('0x3d')](_0x479bc4);})[_0x0a9e('0x1f')](function(_0x5adda1){_0x5bfb33[_0x0a9e('0x3e')]=_0x5adda1;return _0x5bfb33;})[_0x0a9e('0x1f')](respondWithFilteredResult(_0x384319,_0x479bc4))[_0x0a9e('0x3f')](handleError(_0x384319,null));};exports[_0x0a9e('0x40')]=function(_0x4b38d9,_0x5a594b){var _0x15e37d={'raw':!![],'where':{'id':_0x4b38d9['params']['id']}},_0x45b3d0={};_0x45b3d0[_0x0a9e('0x28')]=_[_0x0a9e('0x29')](db[_0x0a9e('0x26')]['rawAttributes']);_0x45b3d0[_0x0a9e('0x2a')]=_[_0x0a9e('0x29')](_0x4b38d9[_0x0a9e('0x2a')]);_0x45b3d0[_0x0a9e('0x34')]=_[_0x0a9e('0x2b')](_0x45b3d0[_0x0a9e('0x28')],_0x45b3d0[_0x0a9e('0x2a')]);_0x15e37d[_0x0a9e('0x2c')]=_[_0x0a9e('0x2b')](_0x45b3d0[_0x0a9e('0x28')],qs[_0x0a9e('0x2d')](_0x4b38d9[_0x0a9e('0x2a')][_0x0a9e('0x2d')]));_0x15e37d[_0x0a9e('0x2c')]=_0x15e37d[_0x0a9e('0x2c')]['length']?_0x15e37d['attributes']:_0x45b3d0[_0x0a9e('0x28')];if(_0x4b38d9[_0x0a9e('0x2a')][_0x0a9e('0x3c')]){_0x15e37d[_0x0a9e('0x41')]=[{'all':!![]}];}_0x15e37d=_[_0x0a9e('0x36')]({},_0x15e37d,_0x4b38d9[_0x0a9e('0x3b')]);return db[_0x0a9e('0x26')][_0x0a9e('0x42')](_0x15e37d)[_0x0a9e('0x1f')](handleEntityNotFound(_0x5a594b,null))[_0x0a9e('0x1f')](respondWithResult(_0x5a594b,null))[_0x0a9e('0x3f')](handleError(_0x5a594b,null));};exports[_0x0a9e('0x43')]=function(_0x5026aa,_0x117c99){return db[_0x0a9e('0x26')][_0x0a9e('0x43')](_0x5026aa[_0x0a9e('0x44')],{})[_0x0a9e('0x1f')](respondWithResult(_0x117c99,0xc9))[_0x0a9e('0x3f')](handleError(_0x117c99,null));};exports[_0x0a9e('0x1e')]=function(_0x44dd99,_0x59afe8){if(_0x44dd99[_0x0a9e('0x44')]['id']){delete _0x44dd99['body']['id'];}return db[_0x0a9e('0x26')][_0x0a9e('0x42')]({'where':{'id':_0x44dd99[_0x0a9e('0x45')]['id']}})['then'](handleEntityNotFound(_0x59afe8,null))[_0x0a9e('0x1f')](saveUpdates(_0x44dd99[_0x0a9e('0x44')],null))[_0x0a9e('0x1f')](respondWithResult(_0x59afe8,null))[_0x0a9e('0x3f')](handleError(_0x59afe8,null));};exports[_0x0a9e('0x20')]=function(_0x37be73,_0x45bf7f){return db['MemberReport'][_0x0a9e('0x42')]({'where':{'id':_0x37be73[_0x0a9e('0x45')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x45bf7f,null))[_0x0a9e('0x1f')](removeEntity(_0x45bf7f,null))[_0x0a9e('0x3f')](handleError(_0x45bf7f,null));};exports[_0x0a9e('0x46')]=function(_0x6054ee,_0x19383e){return db[_0x0a9e('0x26')]['describe']()[_0x0a9e('0x1f')](respondWithResult(_0x19383e,null))[_0x0a9e('0x3f')](handleError(_0x19383e,null));}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.model.js b/server/api/memberReport/memberReport.model.js index c54dbe8..c837bc5 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 _0xc35e=['../../config/environment','./memberReport.attributes','MemberReport','report_member','membername','interface','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x784a6b,_0x213956){var _0x4494f1=function(_0x270777){while(--_0x270777){_0x784a6b['push'](_0x784a6b['shift']());}};_0x4494f1(++_0x213956);}(_0xc35e,0x1f0));var _0xec35=function(_0x36de4f,_0x350d30){_0x36de4f=_0x36de4f-0x0;var _0x1a91c2=_0xc35e[_0x36de4f];return _0x1a91c2;};'use strict';var _=require(_0xec35('0x0'));var util=require(_0xec35('0x1'));var logger=require(_0xec35('0x2'))(_0xec35('0x3'));var moment=require(_0xec35('0x4'));var BPromise=require(_0xec35('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xec35('0x6'));var rimraf=require(_0xec35('0x7'));var config=require(_0xec35('0x8'));var attributes=require(_0xec35('0x9'));module['exports']=function(_0x5471d7,_0x148585){return _0x5471d7['define'](_0xec35('0xa'),attributes,{'tableName':_0xec35('0xb'),'paranoid':![],'indexes':[{'name':'membername_interface','fields':[_0xec35('0xc'),_0xec35('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x39d8=['exports','define','MemberReport','report_member','membername_interface','interface','../../config/logger','api','moment','bluebird','path','rimraf','./memberReport.attributes'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0x39d8,0x6e));var _0x839d=function(_0x1ad7fc,_0x444145){_0x1ad7fc=_0x1ad7fc-0x0;var _0x3bb433=_0x39d8[_0x1ad7fc];return _0x3bb433;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x839d('0x0'))(_0x839d('0x1'));var moment=require(_0x839d('0x2'));var BPromise=require(_0x839d('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x839d('0x4'));var rimraf=require(_0x839d('0x5'));var config=require('../../config/environment');var attributes=require(_0x839d('0x6'));module[_0x839d('0x7')]=function(_0x165ae2,_0x4d0b1f){return _0x165ae2[_0x839d('0x8')](_0x839d('0x9'),attributes,{'tableName':_0x839d('0xa'),'paranoid':![],'indexes':[{'name':_0x839d('0xb'),'fields':['membername',_0x839d('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 7f1e6dc..4e14648 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 _0xb78f=['randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','http','request','then','info','request\x20sent','debug','stringify','error','code','MemberReport,\x20%s,\x20%s','message','catch','GetMemberReport','MemberReport','findAll','options','limit','include','model','attributes','map','create','raw','CreateMemberReport','UpdateMemberReport','update','body','lodash','util','moment','bluebird'];(function(_0x2f46a2,_0x174750){var _0x3eddec=function(_0x30c653){while(--_0x30c653){_0x2f46a2['push'](_0x2f46a2['shift']());}};_0x3eddec(++_0x174750);}(_0xb78f,0x149));var _0xfb78=function(_0x3f6151,_0x19b7f8){_0x3f6151=_0x3f6151-0x0;var _0xdaeb7e=_0xb78f[_0x3f6151];return _0xdaeb7e;};'use strict';var _=require(_0xfb78('0x0'));var util=require(_0xfb78('0x1'));var moment=require(_0xfb78('0x2'));var BPromise=require(_0xfb78('0x3'));var rs=require(_0xfb78('0x4'));var fs=require('fs');var Redis=require(_0xfb78('0x5'));var db=require(_0xfb78('0x6'))['db'];var utils=require(_0xfb78('0x7'));var logger=require('../../config/logger')(_0xfb78('0x8'));var config=require('../../config/environment');var jayson=require(_0xfb78('0x9'));var client=jayson['client'][_0xfb78('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x58be85,_0x371cec,_0x2cb5b0){return new BPromise(function(_0x329731,_0x4b8cca){return client[_0xfb78('0xb')](_0x58be85,_0x2cb5b0)[_0xfb78('0xc')](function(_0x4dd402){logger[_0xfb78('0xd')]('MemberReport,\x20%s,\x20%s',_0x371cec,_0xfb78('0xe'));logger[_0xfb78('0xf')]('MemberReport,\x20%s,\x20%s,\x20%s',_0x371cec,_0xfb78('0xe'),JSON[_0xfb78('0x10')](_0x4dd402));if(_0x4dd402['error']){if(_0x4dd402[_0xfb78('0x11')][_0xfb78('0x12')]===0x1f4){logger['error'](_0xfb78('0x13'),_0x371cec,_0x4dd402[_0xfb78('0x11')][_0xfb78('0x14')]);return _0x4b8cca(_0x4dd402[_0xfb78('0x11')][_0xfb78('0x14')]);}logger[_0xfb78('0x11')](_0xfb78('0x13'),_0x371cec,_0x4dd402[_0xfb78('0x11')]['message']);return _0x329731(_0x4dd402[_0xfb78('0x11')][_0xfb78('0x14')]);}else{logger[_0xfb78('0xd')](_0xfb78('0x13'),_0x371cec,_0xfb78('0xe'));_0x329731(_0x4dd402['result'][_0xfb78('0x14')]);}})[_0xfb78('0x15')](function(_0x586e6e){logger[_0xfb78('0x11')](_0xfb78('0x13'),_0x371cec,_0x586e6e);_0x4b8cca(_0x586e6e);});});}exports[_0xfb78('0x16')]=function(_0x3c580e){var _0x22fde4=this;return new Promise(function(_0x2fd8cc,_0x9a80e6){return db[_0xfb78('0x17')][_0xfb78('0x18')]({'raw':_0x3c580e[_0xfb78('0x19')]?_0x3c580e['options']['raw']===undefined?!![]:![]:!![],'where':_0x3c580e[_0xfb78('0x19')]?_0x3c580e[_0xfb78('0x19')]['where']||null:null,'attributes':_0x3c580e[_0xfb78('0x19')]?_0x3c580e['options']['attributes']||null:null,'limit':_0x3c580e['options']?_0x3c580e['options'][_0xfb78('0x1a')]||null:null,'include':_0x3c580e[_0xfb78('0x19')]?_0x3c580e[_0xfb78('0x19')]['include']?_['map'](_0x3c580e['options'][_0xfb78('0x1b')],function(_0x33b27){return{'model':db[_0x33b27[_0xfb78('0x1c')]],'as':_0x33b27['as'],'attributes':_0x33b27[_0xfb78('0x1d')],'include':_0x33b27[_0xfb78('0x1b')]?_[_0xfb78('0x1e')](_0x33b27[_0xfb78('0x1b')],function(_0x137614){return{'model':db[_0x137614[_0xfb78('0x1c')]],'as':_0x137614['as'],'attributes':_0x137614['attributes'],'include':_0x137614[_0xfb78('0x1b')]?_['map'](_0x137614['include'],function(_0x35cac6){return{'model':db[_0x35cac6[_0xfb78('0x1c')]],'as':_0x35cac6['as'],'attributes':_0x35cac6[_0xfb78('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xfb78('0xc')](function(_0x473e27){logger[_0xfb78('0xd')](_0xfb78('0x16'),_0x3c580e);logger['debug'](_0xfb78('0x16'),_0x3c580e,JSON['stringify'](_0x473e27));_0x2fd8cc(_0x473e27);})[_0xfb78('0x15')](function(_0x193adf){logger['error'](_0xfb78('0x16'),_0x193adf[_0xfb78('0x14')],_0x3c580e);_0x9a80e6(_0x22fde4[_0xfb78('0x11')](0x1f4,_0x193adf['message']));});});};exports['CreateMemberReport']=function(_0x3063f5){var _0x52bab1=this;return new Promise(function(_0xc6eb2c,_0x4f4cff){return db[_0xfb78('0x17')][_0xfb78('0x1f')](_0x3063f5['body'],{'raw':_0x3063f5[_0xfb78('0x19')]?_0x3063f5[_0xfb78('0x19')][_0xfb78('0x20')]===undefined?!![]:![]:!![]})[_0xfb78('0xc')](function(_0x5dea75){logger[_0xfb78('0xd')](_0xfb78('0x21'),_0x3063f5);logger[_0xfb78('0xf')](_0xfb78('0x21'),_0x3063f5,JSON[_0xfb78('0x10')](_0x5dea75));_0xc6eb2c(_0x5dea75);})['catch'](function(_0x59b325){logger['error'](_0xfb78('0x21'),_0x59b325[_0xfb78('0x14')],_0x3063f5);_0x4f4cff(_0x52bab1[_0xfb78('0x11')](0x1f4,_0x59b325[_0xfb78('0x14')]));});});};exports[_0xfb78('0x22')]=function(_0x4a6cdf){var _0x1e6985=this;return new Promise(function(_0x4002a4,_0x3b29a0){return db['MemberReport'][_0xfb78('0x23')](_0x4a6cdf[_0xfb78('0x24')],{'raw':_0x4a6cdf[_0xfb78('0x19')]?_0x4a6cdf['options'][_0xfb78('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4a6cdf[_0xfb78('0x19')]?_0x4a6cdf['options']['where']||null:null,'attributes':_0x4a6cdf[_0xfb78('0x19')]?_0x4a6cdf['options'][_0xfb78('0x1d')]||null:null,'limit':_0x4a6cdf[_0xfb78('0x19')]?_0x4a6cdf[_0xfb78('0x19')][_0xfb78('0x1a')]||null:null})[_0xfb78('0xc')](function(_0x58180c){logger['info']('UpdateMemberReport',_0x4a6cdf);logger['debug'](_0xfb78('0x22'),_0x4a6cdf,JSON[_0xfb78('0x10')](_0x58180c));_0x4002a4(_0x58180c);})[_0xfb78('0x15')](function(_0x2783d0){logger[_0xfb78('0x11')](_0xfb78('0x22'),_0x2783d0['message'],_0x4a6cdf);_0x3b29a0(_0x1e6985[_0xfb78('0x11')](0x1f4,_0x2783d0[_0xfb78('0x14')]));});});}; \ No newline at end of file +var _0x7882=['model','GetMemberReport','CreateMemberReport','create','UpdateMemberReport','update','lodash','util','moment','bluebird','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','debug','MemberReport,\x20%s,\x20%s,\x20%s','stringify','error','MemberReport,\x20%s,\x20%s','message','result','catch','MemberReport','findAll','options','raw','where','attributes','limit','include','map'];(function(_0x15ebd0,_0x5354df){var _0x239bf3=function(_0x250ac9){while(--_0x250ac9){_0x15ebd0['push'](_0x15ebd0['shift']());}};_0x239bf3(++_0x5354df);}(_0x7882,0xba));var _0x2788=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0x7882[_0x4b055c];return _0x4b62bb;};'use strict';var _=require(_0x2788('0x0'));var util=require(_0x2788('0x1'));var moment=require(_0x2788('0x2'));var BPromise=require(_0x2788('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2788('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x2788('0x5'))('rpc');var config=require(_0x2788('0x6'));var jayson=require(_0x2788('0x7'));var client=jayson[_0x2788('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x6ec154,_0x301082,_0x5528bd){return new BPromise(function(_0x1a309b,_0x18ade1){return client[_0x2788('0x9')](_0x6ec154,_0x5528bd)[_0x2788('0xa')](function(_0x3fe96c){logger[_0x2788('0xb')]('MemberReport,\x20%s,\x20%s',_0x301082,_0x2788('0xc'));logger[_0x2788('0xd')](_0x2788('0xe'),_0x301082,'request\x20sent',JSON[_0x2788('0xf')](_0x3fe96c));if(_0x3fe96c[_0x2788('0x10')]){if(_0x3fe96c[_0x2788('0x10')]['code']===0x1f4){logger[_0x2788('0x10')](_0x2788('0x11'),_0x301082,_0x3fe96c[_0x2788('0x10')]['message']);return _0x18ade1(_0x3fe96c['error']['message']);}logger['error'](_0x2788('0x11'),_0x301082,_0x3fe96c['error'][_0x2788('0x12')]);return _0x1a309b(_0x3fe96c[_0x2788('0x10')][_0x2788('0x12')]);}else{logger['info']('MemberReport,\x20%s,\x20%s',_0x301082,_0x2788('0xc'));_0x1a309b(_0x3fe96c[_0x2788('0x13')]['message']);}})[_0x2788('0x14')](function(_0x322ea2){logger['error'](_0x2788('0x11'),_0x301082,_0x322ea2);_0x18ade1(_0x322ea2);});});}exports['GetMemberReport']=function(_0x5e3a21){var _0x68a811=this;return new Promise(function(_0x15c8fe,_0x51bc04){return db[_0x2788('0x15')][_0x2788('0x16')]({'raw':_0x5e3a21['options']?_0x5e3a21[_0x2788('0x17')][_0x2788('0x18')]===undefined?!![]:![]:!![],'where':_0x5e3a21['options']?_0x5e3a21[_0x2788('0x17')][_0x2788('0x19')]||null:null,'attributes':_0x5e3a21[_0x2788('0x17')]?_0x5e3a21[_0x2788('0x17')][_0x2788('0x1a')]||null:null,'limit':_0x5e3a21[_0x2788('0x17')]?_0x5e3a21['options'][_0x2788('0x1b')]||null:null,'include':_0x5e3a21[_0x2788('0x17')]?_0x5e3a21[_0x2788('0x17')][_0x2788('0x1c')]?_[_0x2788('0x1d')](_0x5e3a21[_0x2788('0x17')][_0x2788('0x1c')],function(_0x4b5df3){return{'model':db[_0x4b5df3[_0x2788('0x1e')]],'as':_0x4b5df3['as'],'attributes':_0x4b5df3[_0x2788('0x1a')],'include':_0x4b5df3['include']?_[_0x2788('0x1d')](_0x4b5df3[_0x2788('0x1c')],function(_0x226f81){return{'model':db[_0x226f81[_0x2788('0x1e')]],'as':_0x226f81['as'],'attributes':_0x226f81[_0x2788('0x1a')],'include':_0x226f81[_0x2788('0x1c')]?_[_0x2788('0x1d')](_0x226f81[_0x2788('0x1c')],function(_0x5e4d3c){return{'model':db[_0x5e4d3c[_0x2788('0x1e')]],'as':_0x5e4d3c['as'],'attributes':_0x5e4d3c['attributes']};}):[]};}):[]};}):[]:[]})[_0x2788('0xa')](function(_0x3cb9b7){logger[_0x2788('0xb')](_0x2788('0x1f'),_0x5e3a21);logger['debug'](_0x2788('0x1f'),_0x5e3a21,JSON[_0x2788('0xf')](_0x3cb9b7));_0x15c8fe(_0x3cb9b7);})[_0x2788('0x14')](function(_0x1d04a1){logger[_0x2788('0x10')]('GetMemberReport',_0x1d04a1[_0x2788('0x12')],_0x5e3a21);_0x51bc04(_0x68a811['error'](0x1f4,_0x1d04a1['message']));});});};exports[_0x2788('0x20')]=function(_0xa11640){var _0xeb60df=this;return new Promise(function(_0x54eb4f,_0x45fcbb){return db[_0x2788('0x15')][_0x2788('0x21')](_0xa11640['body'],{'raw':_0xa11640[_0x2788('0x17')]?_0xa11640[_0x2788('0x17')][_0x2788('0x18')]===undefined?!![]:![]:!![]})[_0x2788('0xa')](function(_0x3e5904){logger['info']('CreateMemberReport',_0xa11640);logger['debug'](_0x2788('0x20'),_0xa11640,JSON[_0x2788('0xf')](_0x3e5904));_0x54eb4f(_0x3e5904);})['catch'](function(_0x3613bc){logger[_0x2788('0x10')](_0x2788('0x20'),_0x3613bc['message'],_0xa11640);_0x45fcbb(_0xeb60df[_0x2788('0x10')](0x1f4,_0x3613bc[_0x2788('0x12')]));});});};exports[_0x2788('0x22')]=function(_0x5b97a0){var _0x51efa4=this;return new Promise(function(_0x25ea24,_0xc48427){return db[_0x2788('0x15')][_0x2788('0x23')](_0x5b97a0['body'],{'raw':_0x5b97a0['options']?_0x5b97a0[_0x2788('0x17')][_0x2788('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5b97a0['options']?_0x5b97a0[_0x2788('0x17')][_0x2788('0x19')]||null:null,'attributes':_0x5b97a0[_0x2788('0x17')]?_0x5b97a0[_0x2788('0x17')][_0x2788('0x1a')]||null:null,'limit':_0x5b97a0[_0x2788('0x17')]?_0x5b97a0[_0x2788('0x17')][_0x2788('0x1b')]||null:null})['then'](function(_0x13ec89){logger[_0x2788('0xb')](_0x2788('0x22'),_0x5b97a0);logger['debug'](_0x2788('0x22'),_0x5b97a0,JSON[_0x2788('0xf')](_0x13ec89));_0x25ea24(_0x13ec89);})[_0x2788('0x14')](function(_0x1b351a){logger[_0x2788('0x10')](_0x2788('0x22'),_0x1b351a[_0x2788('0x12')],_0x5b97a0);_0xc48427(_0x51efa4[_0x2788('0x10')](0x1f4,_0x1b351a['message']));});});}; \ No newline at end of file diff --git a/server/api/migration/index.js b/server/api/migration/index.js index 8d153c8..88fe039 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 _0x34b7=['exports','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','index'];(function(_0x1246e9,_0x391692){var _0x58f4e0=function(_0xf3af79){while(--_0xf3af79){_0x1246e9['push'](_0x1246e9['shift']());}};_0x58f4e0(++_0x391692);}(_0x34b7,0x196));var _0x734b=function(_0x3ef984,_0x3f5981){_0x3ef984=_0x3ef984-0x0;var _0x578b03=_0x34b7[_0x3ef984];return _0x578b03;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x734b('0x0'));var timeout=require(_0x734b('0x1'));var express=require(_0x734b('0x2'));var router=express[_0x734b('0x3')]();var auth=require(_0x734b('0x4'));var interaction=require(_0x734b('0x5'));var config=require('../../config/environment');var controller=require('./migration.controller');router[_0x734b('0x6')]('/',controller[_0x734b('0x7')]);module[_0x734b('0x8')]=router; \ No newline at end of file +var _0x7916=['path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','exports','multer'];(function(_0x452813,_0x224960){var _0x3da724=function(_0x23bd17){while(--_0x23bd17){_0x452813['push'](_0x452813['shift']());}};_0x3da724(++_0x224960);}(_0x7916,0x128));var _0x6791=function(_0x381ac4,_0x521252){_0x381ac4=_0x381ac4-0x0;var _0x2b11a5=_0x7916[_0x381ac4];return _0x2b11a5;};'use strict';var multer=require(_0x6791('0x0'));var util=require('util');var path=require(_0x6791('0x1'));var timeout=require(_0x6791('0x2'));var express=require('express');var router=express[_0x6791('0x3')]();var auth=require(_0x6791('0x4'));var interaction=require(_0x6791('0x5'));var config=require(_0x6791('0x6'));var controller=require('./migration.controller');router[_0x6791('0x7')]('/',controller['index']);module[_0x6791('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 c4f6d76..e116a40 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 _0xd571=['STRING','version','sequelize'];(function(_0x4b6830,_0x2bf6fb){var _0x239e4a=function(_0x364735){while(--_0x364735){_0x4b6830['push'](_0x4b6830['shift']());}};_0x239e4a(++_0x2bf6fb);}(_0xd571,0x14f));var _0x1d57=function(_0x239ce5,_0x170605){_0x239ce5=_0x239ce5-0x0;var _0x1ad71c=_0xd571[_0x239ce5];return _0x1ad71c;};'use strict';var Sequelize=require(_0x1d57('0x0'));module['exports']={'version':{'type':Sequelize[_0x1d57('0x1')],'unique':_0x1d57('0x2')}}; \ No newline at end of file +var _0x2fca=['exports','STRING','version','sequelize'];(function(_0x5bc18d,_0x4a1372){var _0x32a08e=function(_0x22d348){while(--_0x22d348){_0x5bc18d['push'](_0x5bc18d['shift']());}};_0x32a08e(++_0x4a1372);}(_0x2fca,0x15b));var _0xa2fc=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x2fca[_0x42cae2];return _0x5f256f;};'use strict';var Sequelize=require(_0xa2fc('0x0'));module[_0xa2fc('0x1')]={'version':{'type':Sequelize[_0xa2fc('0x2')],'unique':_0xa2fc('0x3')}}; \ No newline at end of file diff --git a/server/api/migration/migration.controller.js b/server/api/migration/migration.controller.js index ba4d6d9..62a29c5 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 _0xbb87=['fields','length','hasOwnProperty','order','sort','where','filters','filter','merge','map','key','VIRTUAL','field','options','includeAll','include','findAll','catch','html-pdf','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','save','then','destroy','stack','name','Migration','rawAttributes','model','keys','query','intersection','attributes'];(function(_0x3d7414,_0x28c1dc){var _0x2440c3=function(_0x7352a){while(--_0x7352a){_0x3d7414['push'](_0x3d7414['shift']());}};_0x2440c3(++_0x28c1dc);}(_0xbb87,0x106));var _0x7bb8=function(_0x2a0fc8,_0x3eba4a){_0x2a0fc8=_0x2a0fc8-0x0;var _0x50f774=_0xbb87[_0x2a0fc8];return _0x50f774;};'use strict';var pdf=require(_0x7bb8('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x7bb8('0x1'));var zipdir=require(_0x7bb8('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7bb8('0x3'));var moment=require('moment');var BPromise=require(_0x7bb8('0x4'));var Mustache=require(_0x7bb8('0x5'));var util=require(_0x7bb8('0x6'));var path=require(_0x7bb8('0x7'));var sox=require(_0x7bb8('0x8'));var csv=require(_0x7bb8('0x9'));var ejs=require(_0x7bb8('0xa'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x7bb8('0xb'));var jsforce=require(_0x7bb8('0xc'));var deskjs=require(_0x7bb8('0xd'));var toCsv=require(_0x7bb8('0x9'));var querystring=require(_0x7bb8('0xe'));var Papa=require(_0x7bb8('0xf'));var Redis=require(_0x7bb8('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x7bb8('0x11'));var as=require(_0x7bb8('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7bb8('0x13'))('api');var utils=require(_0x7bb8('0x14'));var config=require(_0x7bb8('0x15'));var db=require(_0x7bb8('0x16'))['db'];function respondWithStatusCode(_0x3f10f1,_0x3e7dbe){_0x3e7dbe=_0x3e7dbe||0xcc;return function(_0x41ff12){if(_0x41ff12){return _0x3f10f1[_0x7bb8('0x17')](_0x3e7dbe);}return _0x3f10f1[_0x7bb8('0x18')](_0x3e7dbe)[_0x7bb8('0x19')]();};}function respondWithResult(_0x586c2f,_0x20b8c2){_0x20b8c2=_0x20b8c2||0xc8;return function(_0x35856f){if(_0x35856f){return _0x586c2f[_0x7bb8('0x18')](_0x20b8c2)[_0x7bb8('0x1a')](_0x35856f);}};}function respondWithFilteredResult(_0x2555a4,_0x399b6f){return function(_0x32b914){if(_0x32b914){var _0x49994f=_0x32b914[_0x7bb8('0x1b')],_0x277cbc=_0x399b6f[_0x7bb8('0x1c')],_0x6d01b9=_0x399b6f[_0x7bb8('0x1c')]+_0x399b6f[_0x7bb8('0x1d')],_0x5cd3df;if(_0x6d01b9>=_0x49994f){_0x6d01b9=_0x49994f;_0x5cd3df=0xc8;}else{_0x5cd3df=0xce;}_0x2555a4[_0x7bb8('0x18')](_0x5cd3df);return _0x2555a4[_0x7bb8('0x1e')]('Content-Range',_0x277cbc+'-'+_0x6d01b9+'/'+_0x49994f)[_0x7bb8('0x1a')](_0x32b914);}return null;};}function patchUpdates(_0x5e15c0){return function(_0x47f57e){try{jsonpatch['apply'](_0x47f57e,_0x5e15c0,!![]);}catch(_0x49eeda){return BPromise['reject'](_0x49eeda);}return _0x47f57e[_0x7bb8('0x1f')]();};}function saveUpdates(_0x5e0949,_0x3d9ad8){return function(_0x39c8a3){if(_0x39c8a3){return _0x39c8a3['update'](_0x5e0949)[_0x7bb8('0x20')](function(_0x4b9118){return _0x4b9118;});}return null;};}function removeEntity(_0x2beb73,_0x449474){return function(_0x3cb93c){if(_0x3cb93c){return _0x3cb93c[_0x7bb8('0x21')]()[_0x7bb8('0x20')](function(){_0x2beb73[_0x7bb8('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5b95e4,_0x7c2e6){return function(_0x2ac8e3){if(!_0x2ac8e3){_0x5b95e4[_0x7bb8('0x17')](0x194);}return _0x2ac8e3;};}function handleError(_0x354e31,_0x1ecd5b){_0x1ecd5b=_0x1ecd5b||0x1f4;return function(_0x40fe26){logger['error'](_0x40fe26[_0x7bb8('0x22')]);if(_0x40fe26[_0x7bb8('0x23')]){delete _0x40fe26[_0x7bb8('0x23')];}_0x354e31[_0x7bb8('0x18')](_0x1ecd5b)['send'](_0x40fe26);};}exports['index']=function(_0xd8ece0,_0x17ae9f){var _0x4a5f5c={},_0x1bd204={},_0x17a33c={'count':0x0,'rows':[]};var _0x2226a8=db[_0x7bb8('0x24')][_0x7bb8('0x25')];_0x1bd204[_0x7bb8('0x26')]=_[_0x7bb8('0x27')](_0x2226a8);_0x1bd204[_0x7bb8('0x28')]=_[_0x7bb8('0x27')](_0xd8ece0[_0x7bb8('0x28')]);_0x1bd204['filters']=_[_0x7bb8('0x29')](_0x1bd204[_0x7bb8('0x26')],_0x1bd204[_0x7bb8('0x28')]);_0x4a5f5c[_0x7bb8('0x2a')]=_[_0x7bb8('0x29')](_0x1bd204[_0x7bb8('0x26')],qs[_0x7bb8('0x2b')](_0xd8ece0[_0x7bb8('0x28')]['fields']));_0x4a5f5c[_0x7bb8('0x2a')]=_0x4a5f5c[_0x7bb8('0x2a')][_0x7bb8('0x2c')]?_0x4a5f5c[_0x7bb8('0x2a')]:_0x1bd204[_0x7bb8('0x26')];if(!_0xd8ece0['query'][_0x7bb8('0x2d')]('nolimit')){_0x4a5f5c['limit']=qs[_0x7bb8('0x1d')](_0xd8ece0[_0x7bb8('0x28')][_0x7bb8('0x1d')]);_0x4a5f5c[_0x7bb8('0x1c')]=qs[_0x7bb8('0x1c')](_0xd8ece0[_0x7bb8('0x28')][_0x7bb8('0x1c')]);}_0x4a5f5c[_0x7bb8('0x2e')]=qs[_0x7bb8('0x2f')](_0xd8ece0[_0x7bb8('0x28')][_0x7bb8('0x2f')]);_0x4a5f5c[_0x7bb8('0x30')]=qs['filters'](_['pick'](_0xd8ece0[_0x7bb8('0x28')],_0x1bd204[_0x7bb8('0x31')]));if(_0xd8ece0[_0x7bb8('0x28')][_0x7bb8('0x32')]){_0x4a5f5c['where']=_[_0x7bb8('0x33')](_0x4a5f5c[_0x7bb8('0x30')],{'$or':_[_0x7bb8('0x34')](_0x2226a8,function(_0x318208){if(_0x318208['type'][_0x7bb8('0x35')]!==_0x7bb8('0x36')){var _0xb38718={};_0xb38718[_0x318208[_0x7bb8('0x37')]]={'$like':'%'+_0xd8ece0[_0x7bb8('0x28')][_0x7bb8('0x32')]+'%'};return _0xb38718;}})});}_0x4a5f5c=_[_0x7bb8('0x33')]({},_0x4a5f5c,_0xd8ece0[_0x7bb8('0x38')]);var _0x2a0340={'where':_0x4a5f5c[_0x7bb8('0x30')]};return db[_0x7bb8('0x24')][_0x7bb8('0x1b')](_0x2a0340)[_0x7bb8('0x20')](function(_0x1df6f5){_0x17a33c[_0x7bb8('0x1b')]=_0x1df6f5;if(_0xd8ece0[_0x7bb8('0x28')][_0x7bb8('0x39')]){_0x4a5f5c[_0x7bb8('0x3a')]=[{'all':!![]}];}return db[_0x7bb8('0x24')][_0x7bb8('0x3b')](_0x4a5f5c);})[_0x7bb8('0x20')](function(_0x236eb7){_0x17a33c['rows']=_0x236eb7;return _0x17a33c;})[_0x7bb8('0x20')](respondWithFilteredResult(_0x17ae9f,_0x4a5f5c))[_0x7bb8('0x3c')](handleError(_0x17ae9f,null));}; \ No newline at end of file +var _0xcf67=['squel','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','end','status','json','count','offset','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','Migration','rawAttributes','model','keys','intersection','query','attributes','fields','length','nolimit','sort','where','filters','pick','merge','type','key','VIRTUAL','field','includeAll','include','findAll','rows','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs'];(function(_0x23c92e,_0x7cb238){var _0x2a1ebe=function(_0x4d194e){while(--_0x4d194e){_0x23c92e['push'](_0x23c92e['shift']());}};_0x2a1ebe(++_0x7cb238);}(_0xcf67,0x148));var _0x7cf6=function(_0x28578d,_0xcf5cf0){_0x28578d=_0x28578d-0x0;var _0x524826=_0xcf67[_0x28578d];return _0x524826;};'use strict';var pdf=require(_0x7cf6('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x7cf6('0x1'));var zipdir=require(_0x7cf6('0x2'));var jsonpatch=require(_0x7cf6('0x3'));var rp=require(_0x7cf6('0x4'));var moment=require(_0x7cf6('0x5'));var BPromise=require(_0x7cf6('0x6'));var Mustache=require(_0x7cf6('0x7'));var util=require(_0x7cf6('0x8'));var path=require(_0x7cf6('0x9'));var sox=require(_0x7cf6('0xa'));var csv=require('to-csv');var ejs=require(_0x7cf6('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x7cf6('0xc'));var crypto=require('crypto');var jsforce=require(_0x7cf6('0xd'));var deskjs=require(_0x7cf6('0xe'));var toCsv=require(_0x7cf6('0xf'));var querystring=require('querystring');var Papa=require(_0x7cf6('0x10'));var Redis=require(_0x7cf6('0x11'));var authService=require(_0x7cf6('0x12'));var qs=require(_0x7cf6('0x13'));var as=require(_0x7cf6('0x14'));var hardwareService=require(_0x7cf6('0x15'));var logger=require(_0x7cf6('0x16'))(_0x7cf6('0x17'));var utils=require(_0x7cf6('0x18'));var config=require('../../config/environment');var db=require(_0x7cf6('0x19'))['db'];function respondWithStatusCode(_0x26fc42,_0x3082eb){_0x3082eb=_0x3082eb||0xcc;return function(_0x3a2da7){if(_0x3a2da7){return _0x26fc42[_0x7cf6('0x1a')](_0x3082eb);}return _0x26fc42['status'](_0x3082eb)[_0x7cf6('0x1b')]();};}function respondWithResult(_0x5455b5,_0x216b0b){_0x216b0b=_0x216b0b||0xc8;return function(_0x16722b){if(_0x16722b){return _0x5455b5[_0x7cf6('0x1c')](_0x216b0b)[_0x7cf6('0x1d')](_0x16722b);}};}function respondWithFilteredResult(_0x200c9b,_0x4bafd7){return function(_0x44b347){if(_0x44b347){var _0x2fe4ed=_0x44b347[_0x7cf6('0x1e')],_0xfc7652=_0x4bafd7[_0x7cf6('0x1f')],_0x1c56e9=_0x4bafd7[_0x7cf6('0x1f')]+_0x4bafd7[_0x7cf6('0x20')],_0x2cc054;if(_0x1c56e9>=_0x2fe4ed){_0x1c56e9=_0x2fe4ed;_0x2cc054=0xc8;}else{_0x2cc054=0xce;}_0x200c9b['status'](_0x2cc054);return _0x200c9b[_0x7cf6('0x21')](_0x7cf6('0x22'),_0xfc7652+'-'+_0x1c56e9+'/'+_0x2fe4ed)[_0x7cf6('0x1d')](_0x44b347);}return null;};}function patchUpdates(_0x3a56a8){return function(_0x488a61){try{jsonpatch['apply'](_0x488a61,_0x3a56a8,!![]);}catch(_0x1ef4e3){return BPromise[_0x7cf6('0x23')](_0x1ef4e3);}return _0x488a61[_0x7cf6('0x24')]();};}function saveUpdates(_0x181c02,_0xb581cc){return function(_0x5a1d6a){if(_0x5a1d6a){return _0x5a1d6a[_0x7cf6('0x25')](_0x181c02)[_0x7cf6('0x26')](function(_0xafb862){return _0xafb862;});}return null;};}function removeEntity(_0x1cb641,_0x438ca4){return function(_0x35c1f0){if(_0x35c1f0){return _0x35c1f0[_0x7cf6('0x27')]()[_0x7cf6('0x26')](function(){_0x1cb641[_0x7cf6('0x1c')](0xcc)[_0x7cf6('0x1b')]();});}};}function handleEntityNotFound(_0x1e565d,_0x3c36f2){return function(_0x1ff35f){if(!_0x1ff35f){_0x1e565d['sendStatus'](0x194);}return _0x1ff35f;};}function handleError(_0x685e4d,_0x4e6cb5){_0x4e6cb5=_0x4e6cb5||0x1f4;return function(_0xc493d0){logger[_0x7cf6('0x28')](_0xc493d0[_0x7cf6('0x29')]);if(_0xc493d0['name']){delete _0xc493d0[_0x7cf6('0x2a')];}_0x685e4d['status'](_0x4e6cb5)[_0x7cf6('0x2b')](_0xc493d0);};}exports[_0x7cf6('0x2c')]=function(_0x7e1e,_0x3b9ff9){var _0x15aa5d={},_0x35a08f={},_0x72d63b={'count':0x0,'rows':[]};var _0x369d73=db[_0x7cf6('0x2d')][_0x7cf6('0x2e')];_0x35a08f[_0x7cf6('0x2f')]=_[_0x7cf6('0x30')](_0x369d73);_0x35a08f['query']=_[_0x7cf6('0x30')](_0x7e1e['query']);_0x35a08f['filters']=_[_0x7cf6('0x31')](_0x35a08f[_0x7cf6('0x2f')],_0x35a08f[_0x7cf6('0x32')]);_0x15aa5d[_0x7cf6('0x33')]=_[_0x7cf6('0x31')](_0x35a08f[_0x7cf6('0x2f')],qs[_0x7cf6('0x34')](_0x7e1e['query'][_0x7cf6('0x34')]));_0x15aa5d[_0x7cf6('0x33')]=_0x15aa5d[_0x7cf6('0x33')][_0x7cf6('0x35')]?_0x15aa5d[_0x7cf6('0x33')]:_0x35a08f[_0x7cf6('0x2f')];if(!_0x7e1e['query']['hasOwnProperty'](_0x7cf6('0x36'))){_0x15aa5d[_0x7cf6('0x20')]=qs['limit'](_0x7e1e[_0x7cf6('0x32')][_0x7cf6('0x20')]);_0x15aa5d[_0x7cf6('0x1f')]=qs[_0x7cf6('0x1f')](_0x7e1e['query'][_0x7cf6('0x1f')]);}_0x15aa5d['order']=qs[_0x7cf6('0x37')](_0x7e1e['query'][_0x7cf6('0x37')]);_0x15aa5d[_0x7cf6('0x38')]=qs[_0x7cf6('0x39')](_[_0x7cf6('0x3a')](_0x7e1e['query'],_0x35a08f[_0x7cf6('0x39')]));if(_0x7e1e['query']['filter']){_0x15aa5d['where']=_[_0x7cf6('0x3b')](_0x15aa5d[_0x7cf6('0x38')],{'$or':_['map'](_0x369d73,function(_0x324571){if(_0x324571[_0x7cf6('0x3c')][_0x7cf6('0x3d')]!==_0x7cf6('0x3e')){var _0x4a5d99={};_0x4a5d99[_0x324571[_0x7cf6('0x3f')]]={'$like':'%'+_0x7e1e[_0x7cf6('0x32')]['filter']+'%'};return _0x4a5d99;}})});}_0x15aa5d=_['merge']({},_0x15aa5d,_0x7e1e['options']);var _0x49ad74={'where':_0x15aa5d[_0x7cf6('0x38')]};return db[_0x7cf6('0x2d')][_0x7cf6('0x1e')](_0x49ad74)[_0x7cf6('0x26')](function(_0x66dfb2){_0x72d63b[_0x7cf6('0x1e')]=_0x66dfb2;if(_0x7e1e[_0x7cf6('0x32')][_0x7cf6('0x40')]){_0x15aa5d[_0x7cf6('0x41')]=[{'all':!![]}];}return db[_0x7cf6('0x2d')][_0x7cf6('0x42')](_0x15aa5d);})[_0x7cf6('0x26')](function(_0x501f90){_0x72d63b[_0x7cf6('0x43')]=_0x501f90;return _0x72d63b;})[_0x7cf6('0x26')](respondWithFilteredResult(_0x3b9ff9,_0x15aa5d))['catch'](handleError(_0x3b9ff9,null));}; \ No newline at end of file diff --git a/server/api/migration/migration.model.js b/server/api/migration/migration.model.js index 3661cd2..09a48bd 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 _0x4cfa=['../../config/environment','exports','define','Migration','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x4f4b74,_0x272f60){var _0x30c1d9=function(_0x211dde){while(--_0x211dde){_0x4f4b74['push'](_0x4f4b74['shift']());}};_0x30c1d9(++_0x272f60);}(_0x4cfa,0x7c));var _0xa4cf=function(_0x58863d,_0x2da4b4){_0x58863d=_0x58863d-0x0;var _0x177fa1=_0x4cfa[_0x58863d];return _0x177fa1;};'use strict';var _=require(_0xa4cf('0x0'));var util=require(_0xa4cf('0x1'));var logger=require(_0xa4cf('0x2'))(_0xa4cf('0x3'));var moment=require(_0xa4cf('0x4'));var BPromise=require(_0xa4cf('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa4cf('0x6'));var rimraf=require(_0xa4cf('0x7'));var config=require(_0xa4cf('0x8'));var attributes=require('./migration.attributes');module[_0xa4cf('0x9')]=function(_0x111808,_0x3564d1){return _0x111808[_0xa4cf('0xa')](_0xa4cf('0xb'),attributes,{'tableName':'migrations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf338=['define','migrations','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./migration.attributes','exports'];(function(_0x3c09a1,_0x2b208f){var _0x1e8613=function(_0x2eff83){while(--_0x2eff83){_0x3c09a1['push'](_0x3c09a1['shift']());}};_0x1e8613(++_0x2b208f);}(_0xf338,0xb6));var _0x8f33=function(_0x4a1347,_0x47a012){_0x4a1347=_0x4a1347-0x0;var _0x40c48c=_0xf338[_0x4a1347];return _0x40c48c;};'use strict';var _=require(_0x8f33('0x0'));var util=require(_0x8f33('0x1'));var logger=require(_0x8f33('0x2'))(_0x8f33('0x3'));var moment=require('moment');var BPromise=require(_0x8f33('0x4'));var rp=require(_0x8f33('0x5'));var fs=require('fs');var path=require(_0x8f33('0x6'));var rimraf=require(_0x8f33('0x7'));var config=require('../../config/environment');var attributes=require(_0x8f33('0x8'));module[_0x8f33('0x9')]=function(_0x4b39a3,_0x38cd19){return _0x4b39a3[_0x8f33('0xa')]('Migration',attributes,{'tableName':_0x8f33('0xb'),'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 45d4b69..aec8b7b 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 _0x3535=['moment','randomstring','ioredis','../../mysqldb','../../config/environment','jayson/promise','client','http','request','then','Migration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','util'];(function(_0x3cc8af,_0x2d8c43){var _0xe683d6=function(_0x4c5609){while(--_0x4c5609){_0x3cc8af['push'](_0x3cc8af['shift']());}};_0xe683d6(++_0x2d8c43);}(_0x3535,0xa7));var _0x5353=function(_0xb6c1d8,_0x5ac7ca){_0xb6c1d8=_0xb6c1d8-0x0;var _0x5caa83=_0x3535[_0xb6c1d8];return _0x5caa83;};'use strict';var _=require('lodash');var util=require(_0x5353('0x0'));var moment=require(_0x5353('0x1'));var BPromise=require('bluebird');var rs=require(_0x5353('0x2'));var fs=require('fs');var Redis=require(_0x5353('0x3'));var db=require(_0x5353('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x5353('0x5'));var jayson=require(_0x5353('0x6'));var client=jayson[_0x5353('0x7')][_0x5353('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xec1a18,_0x546a26,_0x16605e){return new BPromise(function(_0x4a4b2a,_0x4d4ced){return client[_0x5353('0x9')](_0xec1a18,_0x16605e)[_0x5353('0xa')](function(_0x2ce314){logger['info'](_0x5353('0xb'),_0x546a26,_0x5353('0xc'));logger[_0x5353('0xd')]('Migration,\x20%s,\x20%s,\x20%s',_0x546a26,_0x5353('0xc'),JSON[_0x5353('0xe')](_0x2ce314));if(_0x2ce314[_0x5353('0xf')]){if(_0x2ce314['error'][_0x5353('0x10')]===0x1f4){logger[_0x5353('0xf')](_0x5353('0xb'),_0x546a26,_0x2ce314['error'][_0x5353('0x11')]);return _0x4d4ced(_0x2ce314[_0x5353('0xf')][_0x5353('0x11')]);}logger[_0x5353('0xf')](_0x5353('0xb'),_0x546a26,_0x2ce314[_0x5353('0xf')][_0x5353('0x11')]);return _0x4a4b2a(_0x2ce314[_0x5353('0xf')][_0x5353('0x11')]);}else{logger[_0x5353('0x12')]('Migration,\x20%s,\x20%s',_0x546a26,'request\x20sent');_0x4a4b2a(_0x2ce314[_0x5353('0x13')][_0x5353('0x11')]);}})[_0x5353('0x14')](function(_0x2bcad7){logger[_0x5353('0xf')](_0x5353('0xb'),_0x546a26,_0x2bcad7);_0x4d4ced(_0x2bcad7);});});} \ No newline at end of file +var _0x8cde=['then','request\x20sent','stringify','code','message','error','Migration,\x20%s,\x20%s','info','result','catch','lodash','bluebird','../../config/utils','../../config/logger','jayson/promise','client','request'];(function(_0x14b74f,_0xf24abd){var _0x11f35e=function(_0x2575a0){while(--_0x2575a0){_0x14b74f['push'](_0x14b74f['shift']());}};_0x11f35e(++_0xf24abd);}(_0x8cde,0x1d5));var _0xe8cd=function(_0x4687df,_0x12099c){_0x4687df=_0x4687df-0x0;var _0x32eaef=_0x8cde[_0x4687df];return _0x32eaef;};'use strict';var _=require(_0xe8cd('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xe8cd('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xe8cd('0x2'));var logger=require(_0xe8cd('0x3'))('rpc');var config=require('../../config/environment');var jayson=require(_0xe8cd('0x4'));var client=jayson[_0xe8cd('0x5')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3a4cb8,_0x4cdd6c,_0x4d49bd){return new BPromise(function(_0x444d83,_0x365a90){return client[_0xe8cd('0x6')](_0x3a4cb8,_0x4d49bd)[_0xe8cd('0x7')](function(_0x4bec8f){logger['info']('Migration,\x20%s,\x20%s',_0x4cdd6c,'request\x20sent');logger['debug']('Migration,\x20%s,\x20%s,\x20%s',_0x4cdd6c,_0xe8cd('0x8'),JSON[_0xe8cd('0x9')](_0x4bec8f));if(_0x4bec8f['error']){if(_0x4bec8f['error'][_0xe8cd('0xa')]===0x1f4){logger['error']('Migration,\x20%s,\x20%s',_0x4cdd6c,_0x4bec8f['error'][_0xe8cd('0xb')]);return _0x365a90(_0x4bec8f['error'][_0xe8cd('0xb')]);}logger[_0xe8cd('0xc')](_0xe8cd('0xd'),_0x4cdd6c,_0x4bec8f[_0xe8cd('0xc')]['message']);return _0x444d83(_0x4bec8f[_0xe8cd('0xc')][_0xe8cd('0xb')]);}else{logger[_0xe8cd('0xe')](_0xe8cd('0xd'),_0x4cdd6c,_0xe8cd('0x8'));_0x444d83(_0x4bec8f[_0xe8cd('0xf')][_0xe8cd('0xb')]);}})[_0xe8cd('0x10')](function(_0x563437){logger[_0xe8cd('0xc')](_0xe8cd('0xd'),_0x4cdd6c,_0x563437);_0x365a90(_0x563437);});});} \ No newline at end of file diff --git a/server/api/network/index.js b/server/api/network/index.js index 14590b0..c7f9e84 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 _0x2678=['./network.controller','isAuthenticated','index','get','/:id','show','post','put','update','delete','destroy','util','path','connect-timeout','../../components/interaction/service','../../config/environment'];(function(_0x49a387,_0x26fdd2){var _0x19a13a=function(_0x5b7b65){while(--_0x5b7b65){_0x49a387['push'](_0x49a387['shift']());}};_0x19a13a(++_0x26fdd2);}(_0x2678,0x1bb));var _0x8267=function(_0x235ab8,_0x40bc57){_0x235ab8=_0x235ab8-0x0;var _0x5a80a6=_0x2678[_0x235ab8];return _0x5a80a6;};'use strict';var multer=require('multer');var util=require(_0x8267('0x0'));var path=require(_0x8267('0x1'));var timeout=require(_0x8267('0x2'));var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x8267('0x3'));var config=require(_0x8267('0x4'));var controller=require(_0x8267('0x5'));router['get']('/',auth[_0x8267('0x6')](),controller[_0x8267('0x7')]);router[_0x8267('0x8')](_0x8267('0x9'),auth[_0x8267('0x6')](),controller[_0x8267('0xa')]);router[_0x8267('0xb')]('/',auth[_0x8267('0x6')](),controller['create']);router[_0x8267('0xc')](_0x8267('0x9'),auth['isAuthenticated'](),controller[_0x8267('0xd')]);router[_0x8267('0xe')](_0x8267('0x9'),auth[_0x8267('0x6')](),controller[_0x8267('0xf')]);module['exports']=router; \ No newline at end of file +var _0x0943=['../../components/auth/service','../../components/interaction/service','../../config/environment','./network.controller','get','/:id','isAuthenticated','show','post','create','put','update','destroy','exports','multer','util','path','connect-timeout'];(function(_0x9c3c56,_0x169b56){var _0x2dd782=function(_0x386962){while(--_0x386962){_0x9c3c56['push'](_0x9c3c56['shift']());}};_0x2dd782(++_0x169b56);}(_0x0943,0x164));var _0x3094=function(_0x5eb465,_0x378c62){_0x5eb465=_0x5eb465-0x0;var _0x553702=_0x0943[_0x5eb465];return _0x553702;};'use strict';var multer=require(_0x3094('0x0'));var util=require(_0x3094('0x1'));var path=require(_0x3094('0x2'));var timeout=require(_0x3094('0x3'));var express=require('express');var router=express['Router']();var auth=require(_0x3094('0x4'));var interaction=require(_0x3094('0x5'));var config=require(_0x3094('0x6'));var controller=require(_0x3094('0x7'));router[_0x3094('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x3094('0x8')](_0x3094('0x9'),auth[_0x3094('0xa')](),controller[_0x3094('0xb')]);router[_0x3094('0xc')]('/',auth[_0x3094('0xa')](),controller[_0x3094('0xd')]);router[_0x3094('0xe')](_0x3094('0x9'),auth[_0x3094('0xa')](),controller[_0x3094('0xf')]);router['delete'](_0x3094('0x9'),auth[_0x3094('0xa')](),controller[_0x3094('0x10')]);module[_0x3094('0x11')]=router; \ No newline at end of file diff --git a/server/api/network/network.attributes.js b/server/api/network/network.attributes.js index e98c1d0..f5d2399 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 _0x4945=['sequelize','ENUM','localnet','externip','STRING'];(function(_0x3b2d98,_0xaa0b26){var _0x256bf1=function(_0x1fe933){while(--_0x1fe933){_0x3b2d98['push'](_0x3b2d98['shift']());}};_0x256bf1(++_0xaa0b26);}(_0x4945,0x195));var _0x5494=function(_0x36eaaa,_0x326732){_0x36eaaa=_0x36eaaa-0x0;var _0x461349=_0x4945[_0x36eaaa];return _0x461349;};'use strict';var Sequelize=require(_0x5494('0x0'));module['exports']={'type':{'type':Sequelize[_0x5494('0x1')](_0x5494('0x2'),_0x5494('0x3'))},'value':{'type':Sequelize[_0x5494('0x4')]}}; \ No newline at end of file +var _0x10ac=['localnet','externip','STRING','exports'];(function(_0x2f4475,_0x125bf0){var _0x4fb214=function(_0x581c83){while(--_0x581c83){_0x2f4475['push'](_0x2f4475['shift']());}};_0x4fb214(++_0x125bf0);}(_0x10ac,0x107));var _0xc10a=function(_0x5f0488,_0x6c662f){_0x5f0488=_0x5f0488-0x0;var _0x27740d=_0x10ac[_0x5f0488];return _0x27740d;};'use strict';var Sequelize=require('sequelize');module[_0xc10a('0x0')]={'type':{'type':Sequelize['ENUM'](_0xc10a('0x1'),_0xc10a('0x2'))},'value':{'type':Sequelize[_0xc10a('0x3')]}}; \ No newline at end of file diff --git a/server/api/network/network.controller.js b/server/api/network/network.controller.js index 93f9431..69b3b21 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 _0xb1c2=['index','Network','model','keys','filters','intersection','query','attributes','hasOwnProperty','sort','where','pick','merge','map','key','VIRTUAL','filter','options','includeAll','include','findAll','rows','show','params','rawAttributes','fields','find','create','transaction','body','type','server/files/templates/network.ejs','utf8','render','writeFileSync','toLowerCase','Reload','chan_sip.so','readFileSync','join','root','format','/etc/asterisk/sip_xcally_%s.conf','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','Network,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','status','json','count','offset','limit','set','Content-Range','reject','update','sendStatus','stack','name'];(function(_0x43e1e6,_0x399da){var _0x58753d=function(_0x260aba){while(--_0x260aba){_0x43e1e6['push'](_0x43e1e6['shift']());}};_0x58753d(++_0x399da);}(_0xb1c2,0xeb));var _0x2b1c=function(_0x5a4c93,_0x283aa8){_0x5a4c93=_0x5a4c93-0x0;var _0x421ff4=_0xb1c2[_0x5a4c93];return _0x421ff4;};'use strict';var pdf=require(_0x2b1c('0x0'));var emlformat=require(_0x2b1c('0x1'));var rimraf=require(_0x2b1c('0x2'));var zipdir=require(_0x2b1c('0x3'));var jsonpatch=require(_0x2b1c('0x4'));var rp=require('request-promise');var moment=require(_0x2b1c('0x5'));var BPromise=require(_0x2b1c('0x6'));var Mustache=require(_0x2b1c('0x7'));var util=require(_0x2b1c('0x8'));var path=require(_0x2b1c('0x9'));var sox=require(_0x2b1c('0xa'));var csv=require(_0x2b1c('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x2b1c('0xc'));var crypto=require(_0x2b1c('0xd'));var jsforce=require(_0x2b1c('0xe'));var deskjs=require(_0x2b1c('0xf'));var toCsv=require('to-csv');var querystring=require(_0x2b1c('0x10'));var Papa=require(_0x2b1c('0x11'));var Redis=require(_0x2b1c('0x12'));var authService=require(_0x2b1c('0x13'));var qs=require(_0x2b1c('0x14'));var as=require(_0x2b1c('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x2b1c('0x16'));var utils=require(_0x2b1c('0x17'));var config=require(_0x2b1c('0x18'));var db=require(_0x2b1c('0x19'))['db'];var jayson=require(_0x2b1c('0x1a'));var client=jayson[_0x2b1c('0x1b')]['http']({'port':0x232a});function checkPasswordPattern(_0x4719b7,_0x1c0744,_0x5335e4){if(_0x5335e4){var _0x4765f5=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4765f5[_0x2b1c('0x1c')](_0x1c0744)){return _0x4719b7;}else{throw new Error(_0x2b1c('0x1d'));}}else{return _0x4719b7;}}function respondWithRpcPromise(_0x5c9aa1,_0x24c665,_0x3572b1,_0x446a82){return new BPromise(function(_0x1678ea,_0x180cc5){var _0x431c3d=_0x446a82||client;return _0x431c3d[_0x2b1c('0x1e')](_0x5c9aa1,_0x3572b1)[_0x2b1c('0x1f')](function(_0xbacf21){logger[_0x2b1c('0x20')](_0x2b1c('0x21'),_0x24c665,_0x2b1c('0x22'));logger['debug']('Network,\x20%s,\x20%s,\x20%s',_0x24c665,_0x2b1c('0x22'),JSON[_0x2b1c('0x23')](_0xbacf21));if(_0xbacf21[_0x2b1c('0x24')]){if(_0xbacf21[_0x2b1c('0x24')][_0x2b1c('0x25')]===0x1f4){logger['error'](_0x2b1c('0x21'),_0x24c665,_0xbacf21[_0x2b1c('0x24')]['message']);return _0x180cc5(_0xbacf21['error'][_0x2b1c('0x26')]);}logger[_0x2b1c('0x24')](_0x2b1c('0x21'),_0x24c665,_0xbacf21['error'][_0x2b1c('0x26')]);return _0x1678ea(_0xbacf21[_0x2b1c('0x24')][_0x2b1c('0x26')]);}else{logger[_0x2b1c('0x20')](_0x2b1c('0x21'),_0x24c665,_0x2b1c('0x22'));_0x1678ea(_0xbacf21[_0x2b1c('0x27')][_0x2b1c('0x26')]);}})[_0x2b1c('0x28')](function(_0x31ee64){logger[_0x2b1c('0x24')]('Network,\x20%s,\x20%s',_0x24c665,_0x31ee64);_0x180cc5(_0x31ee64);});});}function respondWithStatusCode(_0x15b4ea,_0x42fba5){_0x42fba5=_0x42fba5||0xcc;return function(_0x385bd1){if(_0x385bd1){return _0x15b4ea['sendStatus'](_0x42fba5);}return _0x15b4ea[_0x2b1c('0x29')](_0x42fba5)['end']();};}function respondWithResult(_0x3bb835,_0x1ec3b2){_0x1ec3b2=_0x1ec3b2||0xc8;return function(_0x1b992e){if(_0x1b992e){return _0x3bb835['status'](_0x1ec3b2)[_0x2b1c('0x2a')](_0x1b992e);}};}function respondWithFilteredResult(_0xc4eb34,_0x4bd0c8){return function(_0x3805ca){if(_0x3805ca){var _0xfa5b8b=_0x3805ca[_0x2b1c('0x2b')],_0x3b4ea2=_0x4bd0c8[_0x2b1c('0x2c')],_0xbe981c=_0x4bd0c8['offset']+_0x4bd0c8[_0x2b1c('0x2d')],_0x34312b;if(_0xbe981c>=_0xfa5b8b){_0xbe981c=_0xfa5b8b;_0x34312b=0xc8;}else{_0x34312b=0xce;}_0xc4eb34[_0x2b1c('0x29')](_0x34312b);return _0xc4eb34[_0x2b1c('0x2e')](_0x2b1c('0x2f'),_0x3b4ea2+'-'+_0xbe981c+'/'+_0xfa5b8b)['json'](_0x3805ca);}return null;};}function patchUpdates(_0x3d5734){return function(_0xbf363){try{jsonpatch['apply'](_0xbf363,_0x3d5734,!![]);}catch(_0x32e3c9){return BPromise[_0x2b1c('0x30')](_0x32e3c9);}return _0xbf363['save']();};}function saveUpdates(_0x38c1a,_0x4fadd8){return function(_0x306747){if(_0x306747){return _0x306747[_0x2b1c('0x31')](_0x38c1a)['then'](function(_0x3335a1){return _0x3335a1;});}return null;};}function removeEntity(_0x2de6cc,_0x1f3760){return function(_0x33414b){if(_0x33414b){return _0x33414b['destroy']()[_0x2b1c('0x1f')](function(){_0x2de6cc[_0x2b1c('0x29')](0xcc)['end']();});}};}function handleEntityNotFound(_0xd2ac36,_0x1d83a0){return function(_0x3b115c){if(!_0x3b115c){_0xd2ac36[_0x2b1c('0x32')](0x194);}return _0x3b115c;};}function handleError(_0xf102fe,_0x334059){_0x334059=_0x334059||0x1f4;return function(_0x4a8f29){logger['error'](_0x4a8f29[_0x2b1c('0x33')]);if(_0x4a8f29[_0x2b1c('0x34')]){delete _0x4a8f29[_0x2b1c('0x34')];}_0xf102fe[_0x2b1c('0x29')](_0x334059)['send'](_0x4a8f29);};}exports[_0x2b1c('0x35')]=function(_0x4430ff,_0x36499f){var _0x3b1f77={},_0x3ddbc1={},_0x1c1299={'count':0x0,'rows':[]};var _0x5c2772=db[_0x2b1c('0x36')]['rawAttributes'];_0x3ddbc1[_0x2b1c('0x37')]=_['keys'](_0x5c2772);_0x3ddbc1['query']=_[_0x2b1c('0x38')](_0x4430ff['query']);_0x3ddbc1[_0x2b1c('0x39')]=_[_0x2b1c('0x3a')](_0x3ddbc1[_0x2b1c('0x37')],_0x3ddbc1[_0x2b1c('0x3b')]);_0x3b1f77[_0x2b1c('0x3c')]=_[_0x2b1c('0x3a')](_0x3ddbc1[_0x2b1c('0x37')],qs['fields'](_0x4430ff[_0x2b1c('0x3b')]['fields']));_0x3b1f77[_0x2b1c('0x3c')]=_0x3b1f77['attributes']['length']?_0x3b1f77[_0x2b1c('0x3c')]:_0x3ddbc1[_0x2b1c('0x37')];if(!_0x4430ff[_0x2b1c('0x3b')][_0x2b1c('0x3d')]('nolimit')){_0x3b1f77[_0x2b1c('0x2d')]=qs[_0x2b1c('0x2d')](_0x4430ff['query'][_0x2b1c('0x2d')]);_0x3b1f77[_0x2b1c('0x2c')]=qs['offset'](_0x4430ff[_0x2b1c('0x3b')]['offset']);}_0x3b1f77['order']=qs['sort'](_0x4430ff['query'][_0x2b1c('0x3e')]);_0x3b1f77[_0x2b1c('0x3f')]=qs[_0x2b1c('0x39')](_[_0x2b1c('0x40')](_0x4430ff['query'],_0x3ddbc1[_0x2b1c('0x39')]));if(_0x4430ff[_0x2b1c('0x3b')]['filter']){_0x3b1f77[_0x2b1c('0x3f')]=_[_0x2b1c('0x41')](_0x3b1f77[_0x2b1c('0x3f')],{'$or':_[_0x2b1c('0x42')](_0x5c2772,function(_0x1e8476){if(_0x1e8476['type'][_0x2b1c('0x43')]!==_0x2b1c('0x44')){var _0x48bd1d={};_0x48bd1d[_0x1e8476['field']]={'$like':'%'+_0x4430ff[_0x2b1c('0x3b')][_0x2b1c('0x45')]+'%'};return _0x48bd1d;}})});}_0x3b1f77=_[_0x2b1c('0x41')]({},_0x3b1f77,_0x4430ff[_0x2b1c('0x46')]);var _0x2b7906={'where':_0x3b1f77[_0x2b1c('0x3f')]};return db[_0x2b1c('0x36')][_0x2b1c('0x2b')](_0x2b7906)[_0x2b1c('0x1f')](function(_0x14c08b){_0x1c1299[_0x2b1c('0x2b')]=_0x14c08b;if(_0x4430ff['query'][_0x2b1c('0x47')]){_0x3b1f77[_0x2b1c('0x48')]=[{'all':!![]}];}return db['Network'][_0x2b1c('0x49')](_0x3b1f77);})[_0x2b1c('0x1f')](function(_0x16f60e){_0x1c1299[_0x2b1c('0x4a')]=_0x16f60e;return _0x1c1299;})[_0x2b1c('0x1f')](respondWithFilteredResult(_0x36499f,_0x3b1f77))[_0x2b1c('0x28')](handleError(_0x36499f,null));};exports[_0x2b1c('0x4b')]=function(_0x5be0dc,_0x25cb75){var _0x43b96c={'raw':!![],'where':{'id':_0x5be0dc[_0x2b1c('0x4c')]['id']}},_0x5de619={};_0x5de619[_0x2b1c('0x37')]=_[_0x2b1c('0x38')](db[_0x2b1c('0x36')][_0x2b1c('0x4d')]);_0x5de619['query']=_[_0x2b1c('0x38')](_0x5be0dc[_0x2b1c('0x3b')]);_0x5de619[_0x2b1c('0x39')]=_[_0x2b1c('0x3a')](_0x5de619[_0x2b1c('0x37')],_0x5de619['query']);_0x43b96c['attributes']=_['intersection'](_0x5de619['model'],qs[_0x2b1c('0x4e')](_0x5be0dc['query'][_0x2b1c('0x4e')]));_0x43b96c[_0x2b1c('0x3c')]=_0x43b96c[_0x2b1c('0x3c')]['length']?_0x43b96c[_0x2b1c('0x3c')]:_0x5de619[_0x2b1c('0x37')];if(_0x5be0dc[_0x2b1c('0x3b')][_0x2b1c('0x47')]){_0x43b96c['include']=[{'all':!![]}];}_0x43b96c=_[_0x2b1c('0x41')]({},_0x43b96c,_0x5be0dc[_0x2b1c('0x46')]);return db[_0x2b1c('0x36')][_0x2b1c('0x4f')](_0x43b96c)[_0x2b1c('0x1f')](handleEntityNotFound(_0x25cb75,null))[_0x2b1c('0x1f')](respondWithResult(_0x25cb75,null))[_0x2b1c('0x28')](handleError(_0x25cb75,null));};exports[_0x2b1c('0x50')]=function(_0x45927d,_0x464941,_0x24364e){var _0x55d21a;return db['sequelize'][_0x2b1c('0x51')](function(_0xb8c6f){return db['Network'][_0x2b1c('0x50')](_0x45927d[_0x2b1c('0x52')],{'raw':!![]})[_0x2b1c('0x1f')](function(_0x3f7fa8){_0x55d21a=_0x3f7fa8;return db['Network'][_0x2b1c('0x49')]({'where':{'type':_0x45927d[_0x2b1c('0x52')][_0x2b1c('0x53')]},'raw':!![]});})['then'](function(_0x32cbcc){var _0x313010=fs['readFileSync'](path['join'](config['root'],_0x2b1c('0x54')),_0x2b1c('0x55'));var _0x5c803b=ejs[_0x2b1c('0x56')](_0x313010,{'networks':_0x32cbcc||[]});fs[_0x2b1c('0x57')](util['format']('/etc/asterisk/sip_xcally_%s.conf',_0x45927d[_0x2b1c('0x52')][_0x2b1c('0x53')][_0x2b1c('0x58')]()),_0x5c803b);})[_0x2b1c('0x1f')](function(){return respondWithRpcPromise(_0x2b1c('0x59'),_0x2b1c('0x50'),{'module':_0x2b1c('0x5a')});})['then'](function(){return _0x55d21a;});})[_0x2b1c('0x1f')](respondWithResult(_0x464941,0xc9))[_0x2b1c('0x28')](handleError(_0x464941,null));};exports[_0x2b1c('0x31')]=function(_0x479ca8,_0x3e53e9,_0x4adebf){var _0xd88e10;return db['sequelize'][_0x2b1c('0x51')](function(_0x31902b){return db[_0x2b1c('0x36')][_0x2b1c('0x4f')]({'where':{'id':_0x479ca8['params']['id']}})[_0x2b1c('0x1f')](handleEntityNotFound(_0x3e53e9,null))[_0x2b1c('0x1f')](saveUpdates(_0x479ca8[_0x2b1c('0x52')],null))[_0x2b1c('0x1f')](function(_0x1a3225){if(_0x1a3225){_0xd88e10=_0x1a3225;return db['Network'][_0x2b1c('0x49')]({'where':{'type':_0xd88e10['type']},'raw':!![]});}return null;})[_0x2b1c('0x1f')](function(_0x165e72){if(_0x165e72){var _0x35092f=fs[_0x2b1c('0x5b')](path[_0x2b1c('0x5c')](config[_0x2b1c('0x5d')],'server/files/templates/network.ejs'),_0x2b1c('0x55'));var _0x3b9a18=ejs[_0x2b1c('0x56')](_0x35092f,{'networks':_0x165e72||[]});fs[_0x2b1c('0x57')](util['format']('/etc/asterisk/sip_xcally_%s.conf',_0xd88e10['type']['toLowerCase']()),_0x3b9a18);return respondWithRpcPromise(_0x2b1c('0x59'),_0x2b1c('0x31'),{'module':'chan_sip.so'});}return null;})['then'](function(_0x103c7c){if(_0x103c7c){return _0xd88e10;}return null;});})[_0x2b1c('0x1f')](respondWithResult(_0x3e53e9,null))['catch'](handleError(_0x3e53e9,null));};exports['destroy']=function(_0x1f368c,_0x2e14d3,_0x339cd7){var _0x398f3f;return db[_0x2b1c('0x36')]['find']({'where':{'id':_0x1f368c[_0x2b1c('0x4c')]['id']}})[_0x2b1c('0x1f')](function(_0x2d6829){_0x398f3f=_0x2d6829;return _0x2d6829;})[_0x2b1c('0x1f')](handleEntityNotFound(_0x2e14d3,null))[_0x2b1c('0x1f')](removeEntity(_0x2e14d3,null))['then'](function(){if(_0x398f3f){return db['Network']['findAll']({'where':{'type':_0x398f3f[_0x2b1c('0x53')]},'raw':!![]});}})[_0x2b1c('0x1f')](function(_0x2a3444){if(_0x2a3444){var _0x2971cb=fs[_0x2b1c('0x5b')](path[_0x2b1c('0x5c')](config[_0x2b1c('0x5d')],_0x2b1c('0x54')),_0x2b1c('0x55'));var _0x26c7e6=ejs['render'](_0x2971cb,{'networks':_0x2a3444||[]});fs[_0x2b1c('0x57')](util[_0x2b1c('0x5e')](_0x2b1c('0x5f'),_0x398f3f['type']['toLowerCase']()),_0x26c7e6);return respondWithRpcPromise(_0x2b1c('0x59'),'destroy',{'module':_0x2b1c('0x5a')});}})[_0x2b1c('0x28')](handleError(_0x2e14d3,null));}; \ No newline at end of file +var _0xe7b6=['update','chan_sip.so','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','ejs','squel','crypto','jsforce','desk.js','to-csv','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','jayson/promise','client','http','test','request','info','Network,\x20%s,\x20%s','debug','Network,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','end','json','count','offset','limit','apply','reject','save','destroy','stack','name','send','index','Network','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','key','VIRTUAL','field','merge','options','includeAll','include','findAll','then','show','params','keys','rawAttributes','create','sequelize','transaction','body','type','readFileSync','root','server/files/templates/network.ejs','render','writeFileSync','format','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','Reload','find','join','utf8'];(function(_0x1b4b23,_0x5dd6d6){var _0x2a325b=function(_0x175462){while(--_0x175462){_0x1b4b23['push'](_0x1b4b23['shift']());}};_0x2a325b(++_0x5dd6d6);}(_0xe7b6,0x196));var _0x6e7b=function(_0x55e0c4,_0x283f78){_0x55e0c4=_0x55e0c4-0x0;var _0x1313dd=_0xe7b6[_0x55e0c4];return _0x1313dd;};'use strict';var pdf=require(_0x6e7b('0x0'));var emlformat=require(_0x6e7b('0x1'));var rimraf=require(_0x6e7b('0x2'));var zipdir=require(_0x6e7b('0x3'));var jsonpatch=require(_0x6e7b('0x4'));var rp=require(_0x6e7b('0x5'));var moment=require('moment');var BPromise=require(_0x6e7b('0x6'));var Mustache=require(_0x6e7b('0x7'));var util=require(_0x6e7b('0x8'));var path=require('path');var sox=require(_0x6e7b('0x9'));var csv=require('to-csv');var ejs=require(_0x6e7b('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x6e7b('0xb'));var crypto=require(_0x6e7b('0xc'));var jsforce=require(_0x6e7b('0xd'));var deskjs=require(_0x6e7b('0xe'));var toCsv=require(_0x6e7b('0xf'));var querystring=require(_0x6e7b('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x6e7b('0x11'));var as=require(_0x6e7b('0x12'));var hardwareService=require(_0x6e7b('0x13'));var logger=require(_0x6e7b('0x14'))(_0x6e7b('0x15'));var utils=require(_0x6e7b('0x16'));var config=require('../../config/environment');var db=require(_0x6e7b('0x17'))['db'];var jayson=require(_0x6e7b('0x18'));var client=jayson[_0x6e7b('0x19')][_0x6e7b('0x1a')]({'port':0x232a});function checkPasswordPattern(_0xc0e209,_0x27eb3a,_0x6ffb20){if(_0x6ffb20){var _0x24bc42=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x24bc42[_0x6e7b('0x1b')](_0x27eb3a)){return _0xc0e209;}else{throw new Error('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0xc0e209;}}function respondWithRpcPromise(_0x1a7d15,_0x33580b,_0x1ec2fb,_0x4ce1d6){return new BPromise(function(_0x3dd54e,_0x32450e){var _0x1926d4=_0x4ce1d6||client;return _0x1926d4[_0x6e7b('0x1c')](_0x1a7d15,_0x1ec2fb)['then'](function(_0x282334){logger[_0x6e7b('0x1d')](_0x6e7b('0x1e'),_0x33580b,'request\x20sent');logger[_0x6e7b('0x1f')](_0x6e7b('0x20'),_0x33580b,_0x6e7b('0x21'),JSON[_0x6e7b('0x22')](_0x282334));if(_0x282334[_0x6e7b('0x23')]){if(_0x282334[_0x6e7b('0x23')][_0x6e7b('0x24')]===0x1f4){logger[_0x6e7b('0x23')]('Network,\x20%s,\x20%s',_0x33580b,_0x282334[_0x6e7b('0x23')][_0x6e7b('0x25')]);return _0x32450e(_0x282334[_0x6e7b('0x23')][_0x6e7b('0x25')]);}logger[_0x6e7b('0x23')](_0x6e7b('0x1e'),_0x33580b,_0x282334[_0x6e7b('0x23')]['message']);return _0x3dd54e(_0x282334[_0x6e7b('0x23')][_0x6e7b('0x25')]);}else{logger['info']('Network,\x20%s,\x20%s',_0x33580b,_0x6e7b('0x21'));_0x3dd54e(_0x282334[_0x6e7b('0x26')][_0x6e7b('0x25')]);}})[_0x6e7b('0x27')](function(_0x2d94a3){logger[_0x6e7b('0x23')](_0x6e7b('0x1e'),_0x33580b,_0x2d94a3);_0x32450e(_0x2d94a3);});});}function respondWithStatusCode(_0x2fa2a5,_0xda8410){_0xda8410=_0xda8410||0xcc;return function(_0x477813){if(_0x477813){return _0x2fa2a5[_0x6e7b('0x28')](_0xda8410);}return _0x2fa2a5[_0x6e7b('0x29')](_0xda8410)[_0x6e7b('0x2a')]();};}function respondWithResult(_0x2f8eef,_0xc5bdb9){_0xc5bdb9=_0xc5bdb9||0xc8;return function(_0x12fb61){if(_0x12fb61){return _0x2f8eef['status'](_0xc5bdb9)[_0x6e7b('0x2b')](_0x12fb61);}};}function respondWithFilteredResult(_0x407181,_0x241ec8){return function(_0x496c41){if(_0x496c41){var _0x35ef2e=_0x496c41[_0x6e7b('0x2c')],_0x6f6607=_0x241ec8[_0x6e7b('0x2d')],_0x482f67=_0x241ec8[_0x6e7b('0x2d')]+_0x241ec8[_0x6e7b('0x2e')],_0x2e2d27;if(_0x482f67>=_0x35ef2e){_0x482f67=_0x35ef2e;_0x2e2d27=0xc8;}else{_0x2e2d27=0xce;}_0x407181[_0x6e7b('0x29')](_0x2e2d27);return _0x407181['set']('Content-Range',_0x6f6607+'-'+_0x482f67+'/'+_0x35ef2e)[_0x6e7b('0x2b')](_0x496c41);}return null;};}function patchUpdates(_0x4fc659){return function(_0x391eba){try{jsonpatch[_0x6e7b('0x2f')](_0x391eba,_0x4fc659,!![]);}catch(_0x218b84){return BPromise[_0x6e7b('0x30')](_0x218b84);}return _0x391eba[_0x6e7b('0x31')]();};}function saveUpdates(_0x4655b2,_0x126651){return function(_0x432325){if(_0x432325){return _0x432325['update'](_0x4655b2)['then'](function(_0x5b8741){return _0x5b8741;});}return null;};}function removeEntity(_0x19cb77,_0x2ce9a0){return function(_0x14feab){if(_0x14feab){return _0x14feab[_0x6e7b('0x32')]()['then'](function(){_0x19cb77['status'](0xcc)[_0x6e7b('0x2a')]();});}};}function handleEntityNotFound(_0x55a0a3,_0x22fc44){return function(_0x40907b){if(!_0x40907b){_0x55a0a3['sendStatus'](0x194);}return _0x40907b;};}function handleError(_0x3c25a8,_0x94cfff){_0x94cfff=_0x94cfff||0x1f4;return function(_0x5693f1){logger[_0x6e7b('0x23')](_0x5693f1[_0x6e7b('0x33')]);if(_0x5693f1[_0x6e7b('0x34')]){delete _0x5693f1[_0x6e7b('0x34')];}_0x3c25a8[_0x6e7b('0x29')](_0x94cfff)[_0x6e7b('0x35')](_0x5693f1);};}exports[_0x6e7b('0x36')]=function(_0x2bf16e,_0x2c0ad5){var _0x1eb9d2={},_0xa1b7c3={},_0x416298={'count':0x0,'rows':[]};var _0x53b60b=db[_0x6e7b('0x37')]['rawAttributes'];_0xa1b7c3[_0x6e7b('0x38')]=_['keys'](_0x53b60b);_0xa1b7c3[_0x6e7b('0x39')]=_['keys'](_0x2bf16e[_0x6e7b('0x39')]);_0xa1b7c3[_0x6e7b('0x3a')]=_[_0x6e7b('0x3b')](_0xa1b7c3[_0x6e7b('0x38')],_0xa1b7c3[_0x6e7b('0x39')]);_0x1eb9d2[_0x6e7b('0x3c')]=_['intersection'](_0xa1b7c3[_0x6e7b('0x38')],qs[_0x6e7b('0x3d')](_0x2bf16e[_0x6e7b('0x39')][_0x6e7b('0x3d')]));_0x1eb9d2['attributes']=_0x1eb9d2[_0x6e7b('0x3c')][_0x6e7b('0x3e')]?_0x1eb9d2[_0x6e7b('0x3c')]:_0xa1b7c3[_0x6e7b('0x38')];if(!_0x2bf16e['query'][_0x6e7b('0x3f')](_0x6e7b('0x40'))){_0x1eb9d2['limit']=qs[_0x6e7b('0x2e')](_0x2bf16e[_0x6e7b('0x39')][_0x6e7b('0x2e')]);_0x1eb9d2[_0x6e7b('0x2d')]=qs['offset'](_0x2bf16e[_0x6e7b('0x39')][_0x6e7b('0x2d')]);}_0x1eb9d2['order']=qs['sort'](_0x2bf16e[_0x6e7b('0x39')][_0x6e7b('0x41')]);_0x1eb9d2[_0x6e7b('0x42')]=qs[_0x6e7b('0x3a')](_[_0x6e7b('0x43')](_0x2bf16e[_0x6e7b('0x39')],_0xa1b7c3['filters']));if(_0x2bf16e[_0x6e7b('0x39')][_0x6e7b('0x44')]){_0x1eb9d2[_0x6e7b('0x42')]=_['merge'](_0x1eb9d2[_0x6e7b('0x42')],{'$or':_['map'](_0x53b60b,function(_0x4f67d0){if(_0x4f67d0['type'][_0x6e7b('0x45')]!==_0x6e7b('0x46')){var _0x2d0b60={};_0x2d0b60[_0x4f67d0[_0x6e7b('0x47')]]={'$like':'%'+_0x2bf16e[_0x6e7b('0x39')][_0x6e7b('0x44')]+'%'};return _0x2d0b60;}})});}_0x1eb9d2=_[_0x6e7b('0x48')]({},_0x1eb9d2,_0x2bf16e[_0x6e7b('0x49')]);var _0x14b9ed={'where':_0x1eb9d2[_0x6e7b('0x42')]};return db['Network']['count'](_0x14b9ed)['then'](function(_0x24319c){_0x416298[_0x6e7b('0x2c')]=_0x24319c;if(_0x2bf16e['query'][_0x6e7b('0x4a')]){_0x1eb9d2[_0x6e7b('0x4b')]=[{'all':!![]}];}return db[_0x6e7b('0x37')][_0x6e7b('0x4c')](_0x1eb9d2);})[_0x6e7b('0x4d')](function(_0xcb9c){_0x416298['rows']=_0xcb9c;return _0x416298;})[_0x6e7b('0x4d')](respondWithFilteredResult(_0x2c0ad5,_0x1eb9d2))[_0x6e7b('0x27')](handleError(_0x2c0ad5,null));};exports[_0x6e7b('0x4e')]=function(_0x3140d2,_0x2053d){var _0x29e5c2={'raw':!![],'where':{'id':_0x3140d2[_0x6e7b('0x4f')]['id']}},_0x21c276={};_0x21c276[_0x6e7b('0x38')]=_[_0x6e7b('0x50')](db[_0x6e7b('0x37')][_0x6e7b('0x51')]);_0x21c276['query']=_[_0x6e7b('0x50')](_0x3140d2[_0x6e7b('0x39')]);_0x21c276['filters']=_[_0x6e7b('0x3b')](_0x21c276[_0x6e7b('0x38')],_0x21c276[_0x6e7b('0x39')]);_0x29e5c2[_0x6e7b('0x3c')]=_['intersection'](_0x21c276[_0x6e7b('0x38')],qs[_0x6e7b('0x3d')](_0x3140d2['query'][_0x6e7b('0x3d')]));_0x29e5c2[_0x6e7b('0x3c')]=_0x29e5c2[_0x6e7b('0x3c')][_0x6e7b('0x3e')]?_0x29e5c2[_0x6e7b('0x3c')]:_0x21c276[_0x6e7b('0x38')];if(_0x3140d2['query'][_0x6e7b('0x4a')]){_0x29e5c2[_0x6e7b('0x4b')]=[{'all':!![]}];}_0x29e5c2=_[_0x6e7b('0x48')]({},_0x29e5c2,_0x3140d2[_0x6e7b('0x49')]);return db['Network']['find'](_0x29e5c2)[_0x6e7b('0x4d')](handleEntityNotFound(_0x2053d,null))[_0x6e7b('0x4d')](respondWithResult(_0x2053d,null))['catch'](handleError(_0x2053d,null));};exports[_0x6e7b('0x52')]=function(_0x7cf71a,_0x2cfe8b,_0x21004c){var _0x30f53e;return db[_0x6e7b('0x53')][_0x6e7b('0x54')](function(_0x63d30d){return db[_0x6e7b('0x37')][_0x6e7b('0x52')](_0x7cf71a[_0x6e7b('0x55')],{'raw':!![]})[_0x6e7b('0x4d')](function(_0x49c91f){_0x30f53e=_0x49c91f;return db['Network'][_0x6e7b('0x4c')]({'where':{'type':_0x7cf71a[_0x6e7b('0x55')][_0x6e7b('0x56')]},'raw':!![]});})[_0x6e7b('0x4d')](function(_0x4f7f7a){var _0x5532d4=fs[_0x6e7b('0x57')](path['join'](config[_0x6e7b('0x58')],_0x6e7b('0x59')),'utf8');var _0x4adf8d=ejs[_0x6e7b('0x5a')](_0x5532d4,{'networks':_0x4f7f7a||[]});fs[_0x6e7b('0x5b')](util[_0x6e7b('0x5c')](_0x6e7b('0x5d'),_0x7cf71a['body'][_0x6e7b('0x56')][_0x6e7b('0x5e')]()),_0x4adf8d);})[_0x6e7b('0x4d')](function(){return respondWithRpcPromise(_0x6e7b('0x5f'),'create',{'module':'chan_sip.so'});})['then'](function(){return _0x30f53e;});})[_0x6e7b('0x4d')](respondWithResult(_0x2cfe8b,0xc9))['catch'](handleError(_0x2cfe8b,null));};exports['update']=function(_0x3d39f7,_0x3bf402,_0x50e1e6){var _0x658c1b;return db[_0x6e7b('0x53')][_0x6e7b('0x54')](function(_0x48ef8b){return db[_0x6e7b('0x37')][_0x6e7b('0x60')]({'where':{'id':_0x3d39f7[_0x6e7b('0x4f')]['id']}})[_0x6e7b('0x4d')](handleEntityNotFound(_0x3bf402,null))['then'](saveUpdates(_0x3d39f7['body'],null))['then'](function(_0x2ff0c2){if(_0x2ff0c2){_0x658c1b=_0x2ff0c2;return db[_0x6e7b('0x37')][_0x6e7b('0x4c')]({'where':{'type':_0x658c1b[_0x6e7b('0x56')]},'raw':!![]});}return null;})[_0x6e7b('0x4d')](function(_0x35924d){if(_0x35924d){var _0x1c3896=fs[_0x6e7b('0x57')](path[_0x6e7b('0x61')](config['root'],'server/files/templates/network.ejs'),_0x6e7b('0x62'));var _0x28e64b=ejs[_0x6e7b('0x5a')](_0x1c3896,{'networks':_0x35924d||[]});fs[_0x6e7b('0x5b')](util[_0x6e7b('0x5c')](_0x6e7b('0x5d'),_0x658c1b['type'][_0x6e7b('0x5e')]()),_0x28e64b);return respondWithRpcPromise('Reload',_0x6e7b('0x63'),{'module':_0x6e7b('0x64')});}return null;})[_0x6e7b('0x4d')](function(_0x264d5c){if(_0x264d5c){return _0x658c1b;}return null;});})['then'](respondWithResult(_0x3bf402,null))['catch'](handleError(_0x3bf402,null));};exports[_0x6e7b('0x32')]=function(_0x388a22,_0x97c817,_0x32043e){var _0x86de7f;return db[_0x6e7b('0x37')][_0x6e7b('0x60')]({'where':{'id':_0x388a22[_0x6e7b('0x4f')]['id']}})['then'](function(_0x57f825){_0x86de7f=_0x57f825;return _0x57f825;})[_0x6e7b('0x4d')](handleEntityNotFound(_0x97c817,null))[_0x6e7b('0x4d')](removeEntity(_0x97c817,null))['then'](function(){if(_0x86de7f){return db[_0x6e7b('0x37')][_0x6e7b('0x4c')]({'where':{'type':_0x86de7f[_0x6e7b('0x56')]},'raw':!![]});}})['then'](function(_0x39762d){if(_0x39762d){var _0x33d6e6=fs[_0x6e7b('0x57')](path[_0x6e7b('0x61')](config[_0x6e7b('0x58')],'server/files/templates/network.ejs'),_0x6e7b('0x62'));var _0x3adf3c=ejs['render'](_0x33d6e6,{'networks':_0x39762d||[]});fs[_0x6e7b('0x5b')](util[_0x6e7b('0x5c')](_0x6e7b('0x5d'),_0x86de7f[_0x6e7b('0x56')]['toLowerCase']()),_0x3adf3c);return respondWithRpcPromise('Reload','destroy',{'module':'chan_sip.so'});}})[_0x6e7b('0x27')](handleError(_0x97c817,null));}; \ No newline at end of file diff --git a/server/api/network/network.model.js b/server/api/network/network.model.js index a5be56f..462131c 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 _0xc14c=['../../config/environment','exports','define','Network','lodash','util','api','moment','bluebird','rimraf'];(function(_0x2da719,_0x9ff73d){var _0x22d8fc=function(_0x5266a9){while(--_0x5266a9){_0x2da719['push'](_0x2da719['shift']());}};_0x22d8fc(++_0x9ff73d);}(_0xc14c,0x1c6));var _0xcc14=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xc14c[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xcc14('0x0'));var util=require(_0xcc14('0x1'));var logger=require('../../config/logger')(_0xcc14('0x2'));var moment=require(_0xcc14('0x3'));var BPromise=require(_0xcc14('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xcc14('0x5'));var config=require(_0xcc14('0x6'));var attributes=require('./network.attributes');module[_0xcc14('0x7')]=function(_0x5f29bf,_0xef6e5){return _0x5f29bf[_0xcc14('0x8')](_0xcc14('0x9'),attributes,{'tableName':'network','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x83d4=['../../config/environment','./network.attributes','exports','define','Network','network','lodash','util','api','moment','bluebird','path','rimraf'];(function(_0x2524f,_0x5063c1){var _0x3c18a6=function(_0x5ef7c7){while(--_0x5ef7c7){_0x2524f['push'](_0x2524f['shift']());}};_0x3c18a6(++_0x5063c1);}(_0x83d4,0x95));var _0x483d=function(_0x407ec3,_0x5c0e31){_0x407ec3=_0x407ec3-0x0;var _0x3bbe5b=_0x83d4[_0x407ec3];return _0x3bbe5b;};'use strict';var _=require(_0x483d('0x0'));var util=require(_0x483d('0x1'));var logger=require('../../config/logger')(_0x483d('0x2'));var moment=require(_0x483d('0x3'));var BPromise=require(_0x483d('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x483d('0x5'));var rimraf=require(_0x483d('0x6'));var config=require(_0x483d('0x7'));var attributes=require(_0x483d('0x8'));module[_0x483d('0x9')]=function(_0x5389ea,_0x4c68cb){return _0x5389ea[_0x483d('0xa')](_0x483d('0xb'),attributes,{'tableName':_0x483d('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/network/network.rpc.js b/server/api/network/network.rpc.js index 65be6b9..d2a9a9e 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 _0x72e2=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','Network,\x20%s,\x20%s','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','util','moment'];(function(_0x18b2ec,_0x281fd6){var _0x12fa83=function(_0x256751){while(--_0x256751){_0x18b2ec['push'](_0x18b2ec['shift']());}};_0x12fa83(++_0x281fd6);}(_0x72e2,0x1ae));var _0x272e=function(_0x623997,_0x91d4f2){_0x623997=_0x623997-0x0;var _0xdfe797=_0x72e2[_0x623997];return _0xdfe797;};'use strict';var _=require('lodash');var util=require(_0x272e('0x0'));var moment=require(_0x272e('0x1'));var BPromise=require(_0x272e('0x2'));var rs=require(_0x272e('0x3'));var fs=require('fs');var Redis=require(_0x272e('0x4'));var db=require(_0x272e('0x5'))['db'];var utils=require(_0x272e('0x6'));var logger=require(_0x272e('0x7'))('rpc');var config=require(_0x272e('0x8'));var jayson=require(_0x272e('0x9'));var client=jayson[_0x272e('0xa')][_0x272e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1de139,_0x5592ca,_0xc98bc0){return new BPromise(function(_0x1e1ff1,_0x424c78){return client[_0x272e('0xc')](_0x1de139,_0xc98bc0)['then'](function(_0x2f6b0e){logger[_0x272e('0xd')](_0x272e('0xe'),_0x5592ca,'request\x20sent');logger[_0x272e('0xf')](_0x272e('0x10'),_0x5592ca,'request\x20sent',JSON[_0x272e('0x11')](_0x2f6b0e));if(_0x2f6b0e[_0x272e('0x12')]){if(_0x2f6b0e[_0x272e('0x12')][_0x272e('0x13')]===0x1f4){logger[_0x272e('0x12')](_0x272e('0xe'),_0x5592ca,_0x2f6b0e['error'][_0x272e('0x14')]);return _0x424c78(_0x2f6b0e[_0x272e('0x12')][_0x272e('0x14')]);}logger['error']('Network,\x20%s,\x20%s',_0x5592ca,_0x2f6b0e[_0x272e('0x12')][_0x272e('0x14')]);return _0x1e1ff1(_0x2f6b0e[_0x272e('0x12')][_0x272e('0x14')]);}else{logger['info'](_0x272e('0xe'),_0x5592ca,_0x272e('0x15'));_0x1e1ff1(_0x2f6b0e[_0x272e('0x16')]['message']);}})[_0x272e('0x17')](function(_0x1ec2b4){logger['error']('Network,\x20%s,\x20%s',_0x5592ca,_0x1ec2b4);_0x424c78(_0x1ec2b4);});});} \ No newline at end of file +var _0xc018=['request\x20sent','debug','stringify','error','message','info','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','Network,\x20%s,\x20%s'];(function(_0x5a2f70,_0x3825d9){var _0x4c932b=function(_0x317608){while(--_0x317608){_0x5a2f70['push'](_0x5a2f70['shift']());}};_0x4c932b(++_0x3825d9);}(_0xc018,0x194));var _0x8c01=function(_0x2ba29b,_0x2a25ca){_0x2ba29b=_0x2ba29b-0x0;var _0x37259d=_0xc018[_0x2ba29b];return _0x37259d;};'use strict';var _=require(_0x8c01('0x0'));var util=require(_0x8c01('0x1'));var moment=require(_0x8c01('0x2'));var BPromise=require('bluebird');var rs=require(_0x8c01('0x3'));var fs=require('fs');var Redis=require(_0x8c01('0x4'));var db=require(_0x8c01('0x5'))['db'];var utils=require(_0x8c01('0x6'));var logger=require(_0x8c01('0x7'))('rpc');var config=require(_0x8c01('0x8'));var jayson=require(_0x8c01('0x9'));var client=jayson[_0x8c01('0xa')][_0x8c01('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x23ad9f,_0x2d9a92,_0x3fc49b){return new BPromise(function(_0x2c6e1f,_0x324f25){return client['request'](_0x23ad9f,_0x3fc49b)[_0x8c01('0xc')](function(_0x5252fa){logger['info'](_0x8c01('0xd'),_0x2d9a92,_0x8c01('0xe'));logger[_0x8c01('0xf')]('Network,\x20%s,\x20%s,\x20%s',_0x2d9a92,_0x8c01('0xe'),JSON[_0x8c01('0x10')](_0x5252fa));if(_0x5252fa[_0x8c01('0x11')]){if(_0x5252fa['error']['code']===0x1f4){logger[_0x8c01('0x11')]('Network,\x20%s,\x20%s',_0x2d9a92,_0x5252fa[_0x8c01('0x11')]['message']);return _0x324f25(_0x5252fa[_0x8c01('0x11')][_0x8c01('0x12')]);}logger['error']('Network,\x20%s,\x20%s',_0x2d9a92,_0x5252fa['error']['message']);return _0x2c6e1f(_0x5252fa['error'][_0x8c01('0x12')]);}else{logger[_0x8c01('0x13')](_0x8c01('0xd'),_0x2d9a92,_0x8c01('0xe'));_0x2c6e1f(_0x5252fa[_0x8c01('0x14')][_0x8c01('0x12')]);}})[_0x8c01('0x15')](function(_0x54e46b){logger[_0x8c01('0x11')](_0x8c01('0xd'),_0x2d9a92,_0x54e46b);_0x324f25(_0x54e46b);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/index.js b/server/api/openchannelAccount/index.js index 7dfb3f7..069d2b4 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 _0x6e20=['isAuthenticated','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','/:id/applications','getApplications','/:id/interactions','/:id/users','post','create','addDisposition','/:id/notify','notify','addApplications','/:id/send','put','update','delete','destroy','removeAgents','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','index','get','/describe'];(function(_0x2c6cbf,_0x45161a){var _0x729d06=function(_0x407d62){while(--_0x407d62){_0x2c6cbf['push'](_0x2c6cbf['shift']());}};_0x729d06(++_0x45161a);}(_0x6e20,0xbb));var _0x06e2=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x6e20[_0x618414];return _0x21c19a;};'use strict';var multer=require(_0x06e2('0x0'));var util=require(_0x06e2('0x1'));var path=require(_0x06e2('0x2'));var timeout=require('connect-timeout');var express=require(_0x06e2('0x3'));var router=express[_0x06e2('0x4')]();var auth=require(_0x06e2('0x5'));var interaction=require(_0x06e2('0x6'));var config=require(_0x06e2('0x7'));var controller=require('./openchannelAccount.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x06e2('0x8')]);router[_0x06e2('0x9')](_0x06e2('0xa'),auth[_0x06e2('0xb')](),controller['describe']);router[_0x06e2('0x9')](_0x06e2('0xc'),auth[_0x06e2('0xb')](),controller[_0x06e2('0xd')]);router[_0x06e2('0x9')](_0x06e2('0xe'),auth[_0x06e2('0xb')](),controller[_0x06e2('0xf')]);router[_0x06e2('0x9')](_0x06e2('0x10'),auth[_0x06e2('0xb')](),controller['getAnswers']);router[_0x06e2('0x9')](_0x06e2('0x11'),auth['isAuthenticated'](),controller[_0x06e2('0x12')]);router[_0x06e2('0x9')](_0x06e2('0x13'),auth[_0x06e2('0xb')](),controller['getInteractions']);router[_0x06e2('0x9')](_0x06e2('0x14'),auth[_0x06e2('0xb')](),controller['getAgents']);router[_0x06e2('0x15')]('/',auth[_0x06e2('0xb')](),controller[_0x06e2('0x16')]);router['post']('/:id/dispositions',auth[_0x06e2('0xb')](),controller[_0x06e2('0x17')]);router[_0x06e2('0x15')](_0x06e2('0x10'),auth[_0x06e2('0xb')](),controller['addAnswer']);router['post'](_0x06e2('0x18'),controller[_0x06e2('0x19')]);router['post'](_0x06e2('0x11'),auth[_0x06e2('0xb')](),controller[_0x06e2('0x1a')]);router[_0x06e2('0x15')](_0x06e2('0x14'),auth[_0x06e2('0xb')](),controller['addAgents']);router[_0x06e2('0x15')](_0x06e2('0x1b'),auth['isAuthenticated'](),controller['send']);router[_0x06e2('0x1c')](_0x06e2('0xc'),auth['isAuthenticated'](),controller[_0x06e2('0x1d')]);router[_0x06e2('0x1e')](_0x06e2('0xc'),auth[_0x06e2('0xb')](),controller[_0x06e2('0x1f')]);router[_0x06e2('0x1e')](_0x06e2('0xe'),auth[_0x06e2('0xb')](),controller['removeDispositions']);router[_0x06e2('0x1e')](_0x06e2('0x10'),auth[_0x06e2('0xb')](),controller['removeAnswers']);router[_0x06e2('0x1e')](_0x06e2('0x14'),auth[_0x06e2('0xb')](),controller[_0x06e2('0x20')]);module['exports']=router; \ No newline at end of file +var _0xf32f=['addDisposition','/:id/canned_answers','addAnswer','/:id/notify','notify','/:id/applications','addApplications','addAgents','send','/:id','update','delete','destroy','removeDispositions','removeAgents','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelAccount.controller','get','isAuthenticated','/describe','describe','show','getDispositions','getAnswers','/:id/interactions','getInteractions','/:id/users','getAgents','post','create','/:id/dispositions'];(function(_0x518836,_0x391aa1){var _0x3726ab=function(_0x2006f7){while(--_0x2006f7){_0x518836['push'](_0x518836['shift']());}};_0x3726ab(++_0x391aa1);}(_0xf32f,0x7b));var _0xff32=function(_0x7e87a4,_0xde9974){_0x7e87a4=_0x7e87a4-0x0;var _0x1d27e3=_0xf32f[_0x7e87a4];return _0x1d27e3;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xff32('0x0'));var timeout=require(_0xff32('0x1'));var express=require(_0xff32('0x2'));var router=express['Router']();var auth=require(_0xff32('0x3'));var interaction=require(_0xff32('0x4'));var config=require(_0xff32('0x5'));var controller=require(_0xff32('0x6'));router[_0xff32('0x7')]('/',auth[_0xff32('0x8')](),controller['index']);router[_0xff32('0x7')](_0xff32('0x9'),auth[_0xff32('0x8')](),controller[_0xff32('0xa')]);router[_0xff32('0x7')]('/:id',auth['isAuthenticated'](),controller[_0xff32('0xb')]);router[_0xff32('0x7')]('/:id/dispositions',auth[_0xff32('0x8')](),controller[_0xff32('0xc')]);router['get']('/:id/canned_answers',auth[_0xff32('0x8')](),controller[_0xff32('0xd')]);router[_0xff32('0x7')]('/:id/applications',auth[_0xff32('0x8')](),controller['getApplications']);router[_0xff32('0x7')](_0xff32('0xe'),auth[_0xff32('0x8')](),controller[_0xff32('0xf')]);router[_0xff32('0x7')](_0xff32('0x10'),auth[_0xff32('0x8')](),controller[_0xff32('0x11')]);router[_0xff32('0x12')]('/',auth[_0xff32('0x8')](),controller[_0xff32('0x13')]);router[_0xff32('0x12')](_0xff32('0x14'),auth[_0xff32('0x8')](),controller[_0xff32('0x15')]);router[_0xff32('0x12')](_0xff32('0x16'),auth[_0xff32('0x8')](),controller[_0xff32('0x17')]);router[_0xff32('0x12')](_0xff32('0x18'),controller[_0xff32('0x19')]);router[_0xff32('0x12')](_0xff32('0x1a'),auth[_0xff32('0x8')](),controller[_0xff32('0x1b')]);router[_0xff32('0x12')]('/:id/users',auth[_0xff32('0x8')](),controller[_0xff32('0x1c')]);router[_0xff32('0x12')]('/:id/send',auth[_0xff32('0x8')](),controller[_0xff32('0x1d')]);router['put'](_0xff32('0x1e'),auth[_0xff32('0x8')](),controller[_0xff32('0x1f')]);router[_0xff32('0x20')](_0xff32('0x1e'),auth[_0xff32('0x8')](),controller[_0xff32('0x21')]);router[_0xff32('0x20')]('/:id/dispositions',auth[_0xff32('0x8')](),controller[_0xff32('0x22')]);router[_0xff32('0x20')](_0xff32('0x16'),auth[_0xff32('0x8')](),controller['removeAnswers']);router[_0xff32('0x20')](_0xff32('0x10'),auth['isAuthenticated'](),controller[_0xff32('0x23')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.attributes.js b/server/api/openchannelAccount/openchannelAccount.attributes.js index 530e312..71b924e 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 _0x9611=['setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','exports','STRING','name','generate','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue'];(function(_0x19c57a,_0x5c9c7c){var _0x576a08=function(_0x929c62){while(--_0x929c62){_0x19c57a['push'](_0x19c57a['shift']());}};_0x576a08(++_0x5c9c7c);}(_0x9611,0x1e4));var _0x1961=function(_0x18be83,_0x40d71c){_0x18be83=_0x18be83-0x0;var _0x92a599=_0x9611[_0x18be83];return _0x92a599;};'use strict';var Sequelize=require(_0x1961('0x0'));var rs=require(_0x1961('0x1'));module[_0x1961('0x2')]={'name':{'type':Sequelize[_0x1961('0x3')],'unique':_0x1961('0x4'),'allowNull':![]},'description':{'type':Sequelize[_0x1961('0x3')]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x1961('0x5')]();}},'replyUri':{'type':Sequelize[_0x1961('0x3')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0x1961('0x3')],'allowNull':![]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x1961('0x6')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x1961('0x6')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x1961('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0x1961('0x3')]},'queueTransfer':{'type':Sequelize[_0x1961('0x6')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x1961('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x1961('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x1961('0x7')],'allowNull':!![],'defaultValue':null,'comment':_0x1961('0x8')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x1961('0x9'),'set':function(_0x50117a){if(!_0x50117a)this[_0x1961('0xa')](_0x1961('0xb'),null);this[_0x1961('0xa')](_0x1961('0xc'),_0x50117a);}}}; \ No newline at end of file +var _0xa30c=['randomstring','exports','STRING','name','generate','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize'];(function(_0x536f35,_0x32d132){var _0x5525f2=function(_0x2a8c98){while(--_0x2a8c98){_0x536f35['push'](_0x536f35['shift']());}};_0x5525f2(++_0x32d132);}(_0xa30c,0x151));var _0xca30=function(_0x3f1a8b,_0x40b309){_0x3f1a8b=_0x3f1a8b-0x0;var _0x898ec3=_0xa30c[_0x3f1a8b];return _0x898ec3;};'use strict';var Sequelize=require(_0xca30('0x0'));var rs=require(_0xca30('0x1'));module[_0xca30('0x2')]={'name':{'type':Sequelize[_0xca30('0x3')],'unique':_0xca30('0x4'),'allowNull':![]},'description':{'type':Sequelize[_0xca30('0x3')]},'token':{'type':Sequelize[_0xca30('0x3')],'defaultValue':function(){return rs[_0xca30('0x5')]();}},'replyUri':{'type':Sequelize[_0xca30('0x3')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0xca30('0x3')],'allowNull':![]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xca30('0x6');}},'notificationSound':{'type':Sequelize[_0xca30('0x7')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xca30('0x7')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xca30('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize['STRING']},'queueTransfer':{'type':Sequelize[_0xca30('0x7')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xca30('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xca30('0x7')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xca30('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xca30('0x8')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xca30('0x7')],'defaultValue':![],'comment':_0xca30('0x9'),'set':function(_0x216510){if(!_0x216510)this[_0xca30('0xa')](_0xca30('0xb'),null);this[_0xca30('0xa')](_0xca30('0xc'),_0x216510);}}}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.controller.js b/server/api/openchannelAccount/openchannelAccount.controller.js index 192e420..fbf809c 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 _0x7a03=['firstName','threadId','OpenchannelInteraction','externalUrl','spread','contact','lastName','messageId','interaction','created','autoclose','close','*,*,*,*','OpenchannelMessage','AttachmentId','User','unshift','agent','waitForTheAssignedAgent','forcedOwnership','startRouting','EventManager','sequelize','transaction','bulkCreate','findAndCountAll','priority','getApplications','getInteractions','Contact','internal','Tag','Tags','color','tag','addAgents','ids','omit','emit','userOpenchannelAccount:save','removeAgents','isArray','userOpenchannelAccount:remove','getAgents','out','Messages','dataValues','push','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','./openchannelAccount.socket','register','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','sendStatus','end','status','json','count','offset','limit','set','Content-Range','apply','save','update','then','get','OpenchannelAccounts','UserProfileResource','destroy','stack','name','send','index','Pause','mandatoryDispositionPause','OpenchannelAccount','rawAttributes','keys','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','filter','map','VIRTUAL','field','includeAll','findAll','rows','show','params','include','merge','options','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','OpnechannelAccountId','Disposition','getDispositions','findOne','nolimit','pick','removeDispositions','addAnswer','OpenchannelAccountId','getAnswers','CannedAnswer','removeAnswers','notify','openchannel','CmContact','Sequelize','ValidationError','createdAt','updatedAt','difference','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','DESC','OpenchannelApplication','Applications','applications','orderBy','account','Contacts','ListId'];(function(_0x22dbc9,_0x3ed2f6){var _0x53e85a=function(_0x2a1b45){while(--_0x2a1b45){_0x22dbc9['push'](_0x22dbc9['shift']());}};_0x53e85a(++_0x3ed2f6);}(_0x7a03,0x1a6));var _0x37a0=function(_0x2b6b92,_0x57303d){_0x2b6b92=_0x2b6b92-0x0;var _0x2233dc=_0x7a03[_0x2b6b92];return _0x2233dc;};'use strict';var pdf=require(_0x37a0('0x0'));var emlformat=require(_0x37a0('0x1'));var rimraf=require(_0x37a0('0x2'));var zipdir=require(_0x37a0('0x3'));var jsonpatch=require(_0x37a0('0x4'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x37a0('0x5'));var Mustache=require(_0x37a0('0x6'));var util=require(_0x37a0('0x7'));var path=require('path');var sox=require(_0x37a0('0x8'));var csv=require(_0x37a0('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x37a0('0xa'));var squel=require(_0x37a0('0xb'));var crypto=require(_0x37a0('0xc'));var jsforce=require(_0x37a0('0xd'));var deskjs=require(_0x37a0('0xe'));var toCsv=require(_0x37a0('0x9'));var querystring=require('querystring');var Papa=require(_0x37a0('0xf'));var Redis=require(_0x37a0('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x37a0('0x11'));var as=require(_0x37a0('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x37a0('0x13'));var utils=require(_0x37a0('0x14'));var config=require(_0x37a0('0x15'));var db=require('../../mysqldb')['db'];config[_0x37a0('0x16')]=_[_0x37a0('0x17')](config['redis'],{'host':_0x37a0('0x18'),'port':0x18eb});var socket=require(_0x37a0('0x19'))(new Redis(config[_0x37a0('0x16')]));require(_0x37a0('0x1a'))[_0x37a0('0x1b')](socket);var jayson=require('jayson/promise');var client=jayson[_0x37a0('0x1c')][_0x37a0('0x1d')]({'port':0x232c});var client9002=jayson['client'][_0x37a0('0x1d')]({'port':0x232a});function checkPasswordPattern(_0x3ba69b,_0x1d80fa,_0x559532){if(_0x559532){var _0x4f393d=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4f393d[_0x37a0('0x1e')](_0x1d80fa)){return _0x3ba69b;}else{throw new Error(_0x37a0('0x1f'));}}else{return _0x3ba69b;}}function respondWithRpcPromise(_0x312a0e,_0x3c919a,_0x33e94e,_0x36501d){return new BPromise(function(_0x2b79d6,_0x46d7fb){var _0x4c54f5=_0x36501d||client;return _0x4c54f5[_0x37a0('0x20')](_0x312a0e,_0x33e94e)['then'](function(_0x550e49){logger[_0x37a0('0x21')](_0x37a0('0x22'),_0x3c919a,_0x37a0('0x23'));logger[_0x37a0('0x24')]('OpenchannelAccount,\x20%s,\x20%s,\x20%s',_0x3c919a,_0x37a0('0x23'),JSON[_0x37a0('0x25')](_0x550e49));if(_0x550e49[_0x37a0('0x26')]){if(_0x550e49[_0x37a0('0x26')][_0x37a0('0x27')]===0x1f4){logger['error'](_0x37a0('0x22'),_0x3c919a,_0x550e49['error'][_0x37a0('0x28')]);return _0x46d7fb(_0x550e49[_0x37a0('0x26')]['message']);}logger[_0x37a0('0x26')](_0x37a0('0x22'),_0x3c919a,_0x550e49[_0x37a0('0x26')][_0x37a0('0x28')]);return _0x2b79d6(_0x550e49[_0x37a0('0x26')][_0x37a0('0x28')]);}else{logger['info']('OpenchannelAccount,\x20%s,\x20%s',_0x3c919a,'request\x20sent');_0x2b79d6(_0x550e49[_0x37a0('0x29')][_0x37a0('0x28')]);}})[_0x37a0('0x2a')](function(_0x4f55f6){logger[_0x37a0('0x26')]('OpenchannelAccount,\x20%s,\x20%s',_0x3c919a,_0x4f55f6);_0x46d7fb(_0x4f55f6);});});}function respondWithStatusCode(_0x3fdcc2,_0xeca59c){_0xeca59c=_0xeca59c||0xcc;return function(_0xff2664){if(_0xff2664){return _0x3fdcc2[_0x37a0('0x2b')](_0xeca59c);}return _0x3fdcc2['status'](_0xeca59c)[_0x37a0('0x2c')]();};}function respondWithResult(_0x879af9,_0x2366e0){_0x2366e0=_0x2366e0||0xc8;return function(_0x5c31a0){if(_0x5c31a0){return _0x879af9[_0x37a0('0x2d')](_0x2366e0)[_0x37a0('0x2e')](_0x5c31a0);}};}function respondWithFilteredResult(_0x750f76,_0x1df369){return function(_0x3af438){if(_0x3af438){var _0x2bd07e=_0x3af438[_0x37a0('0x2f')],_0x4b6624=_0x1df369[_0x37a0('0x30')],_0x42d1f0=_0x1df369[_0x37a0('0x30')]+_0x1df369[_0x37a0('0x31')],_0x43a911;if(_0x42d1f0>=_0x2bd07e){_0x42d1f0=_0x2bd07e;_0x43a911=0xc8;}else{_0x43a911=0xce;}_0x750f76[_0x37a0('0x2d')](_0x43a911);return _0x750f76[_0x37a0('0x32')](_0x37a0('0x33'),_0x4b6624+'-'+_0x42d1f0+'/'+_0x2bd07e)['json'](_0x3af438);}return null;};}function patchUpdates(_0xfec4de){return function(_0x358316){try{jsonpatch[_0x37a0('0x34')](_0x358316,_0xfec4de,!![]);}catch(_0x2ecb5c){return BPromise['reject'](_0x2ecb5c);}return _0x358316[_0x37a0('0x35')]();};}function saveUpdates(_0x20f92d,_0x517cdf){return function(_0x47c3e5){if(_0x47c3e5){return _0x47c3e5[_0x37a0('0x36')](_0x20f92d)[_0x37a0('0x37')](function(_0x265039){return _0x265039;});}return null;};}function removeEntity(_0x4c8ab9,_0x39b3c2){return function(_0x2593bb){if(_0x2593bb){return _0x2593bb['destroy']()[_0x37a0('0x37')](function(){var _0x6d66c2=_0x2593bb[_0x37a0('0x38')]({'plain':!![]});var _0x596aa1=_0x37a0('0x39');return db[_0x37a0('0x3a')][_0x37a0('0x3b')]({'where':{'type':_0x596aa1,'resourceId':_0x6d66c2['id']}})[_0x37a0('0x37')](function(){return _0x2593bb;});})['then'](function(){_0x4c8ab9[_0x37a0('0x2d')](0xcc)[_0x37a0('0x2c')]();});}};}function handleEntityNotFound(_0x527bb5,_0x2c0699){return function(_0x470ebf){if(!_0x470ebf){_0x527bb5[_0x37a0('0x2b')](0x194);}return _0x470ebf;};}function handleError(_0x5edf35,_0x2a1109){_0x2a1109=_0x2a1109||0x1f4;return function(_0x11a129){logger[_0x37a0('0x26')](_0x11a129[_0x37a0('0x3c')]);if(_0x11a129[_0x37a0('0x3d')]){delete _0x11a129['name'];}_0x5edf35[_0x37a0('0x2d')](_0x2a1109)[_0x37a0('0x3e')](_0x11a129);};}exports[_0x37a0('0x3f')]=function(_0xdf3b4c,_0x3c99b1){var _0x365c48={'include':[{'model':db[_0x37a0('0x40')],'as':_0x37a0('0x41')}]},_0x5b5b7d={},_0x54c31f={'count':0x0,'rows':[]};var _0x3c6fab=db[_0x37a0('0x42')][_0x37a0('0x43')];_0x5b5b7d['model']=_['keys'](_0x3c6fab);_0x5b5b7d['query']=_[_0x37a0('0x44')](_0xdf3b4c[_0x37a0('0x45')]);_0x5b5b7d[_0x37a0('0x46')]=_['intersection'](_0x5b5b7d[_0x37a0('0x47')],_0x5b5b7d[_0x37a0('0x45')]);_0x365c48[_0x37a0('0x48')]=_[_0x37a0('0x49')](_0x5b5b7d[_0x37a0('0x47')],qs['fields'](_0xdf3b4c[_0x37a0('0x45')][_0x37a0('0x4a')]));_0x365c48['attributes']=_0x365c48[_0x37a0('0x48')][_0x37a0('0x4b')]?_0x365c48['attributes']:_0x5b5b7d[_0x37a0('0x47')];if(!_0xdf3b4c[_0x37a0('0x45')][_0x37a0('0x4c')]('nolimit')){_0x365c48[_0x37a0('0x31')]=qs[_0x37a0('0x31')](_0xdf3b4c[_0x37a0('0x45')][_0x37a0('0x31')]);_0x365c48[_0x37a0('0x30')]=qs[_0x37a0('0x30')](_0xdf3b4c[_0x37a0('0x45')]['offset']);}_0x365c48[_0x37a0('0x4d')]=qs[_0x37a0('0x4e')](_0xdf3b4c[_0x37a0('0x45')][_0x37a0('0x4e')]);_0x365c48[_0x37a0('0x4f')]=qs[_0x37a0('0x46')](_['pick'](_0xdf3b4c[_0x37a0('0x45')],_0x5b5b7d[_0x37a0('0x46')]));if(_0xdf3b4c[_0x37a0('0x45')][_0x37a0('0x50')]){_0x365c48[_0x37a0('0x4f')]=_['merge'](_0x365c48['where'],{'$or':_[_0x37a0('0x51')](_0x3c6fab,function(_0x5b996d){if(_0x5b996d['type']['key']!==_0x37a0('0x52')){var _0x1a4f40={};_0x1a4f40[_0x5b996d[_0x37a0('0x53')]]={'$like':'%'+_0xdf3b4c['query'][_0x37a0('0x50')]+'%'};return _0x1a4f40;}})});}_0x365c48=_['merge']({},_0x365c48,_0xdf3b4c['options']);var _0xf050e4={'where':_0x365c48[_0x37a0('0x4f')]};return db['OpenchannelAccount'][_0x37a0('0x2f')](_0xf050e4)['then'](function(_0x28aba4){_0x54c31f[_0x37a0('0x2f')]=_0x28aba4;if(_0xdf3b4c[_0x37a0('0x45')][_0x37a0('0x54')]){_0x365c48['include']=[{'all':!![]}];}return db['OpenchannelAccount'][_0x37a0('0x55')](_0x365c48);})['then'](function(_0x530acf){_0x54c31f[_0x37a0('0x56')]=_0x530acf;return _0x54c31f;})[_0x37a0('0x37')](respondWithFilteredResult(_0x3c99b1,_0x365c48))[_0x37a0('0x2a')](handleError(_0x3c99b1,null));};exports[_0x37a0('0x57')]=function(_0x495735,_0x109a41){var _0x512ad0={'raw':![],'where':{'id':_0x495735[_0x37a0('0x58')]['id']},'include':[{'model':db[_0x37a0('0x40')],'as':_0x37a0('0x41')}]},_0x48e2a8={};_0x48e2a8['model']=_[_0x37a0('0x44')](db[_0x37a0('0x42')][_0x37a0('0x43')]);_0x48e2a8['query']=_[_0x37a0('0x44')](_0x495735[_0x37a0('0x45')]);_0x48e2a8[_0x37a0('0x46')]=_['intersection'](_0x48e2a8[_0x37a0('0x47')],_0x48e2a8[_0x37a0('0x45')]);_0x512ad0[_0x37a0('0x48')]=_['intersection'](_0x48e2a8['model'],qs[_0x37a0('0x4a')](_0x495735[_0x37a0('0x45')]['fields']));_0x512ad0[_0x37a0('0x48')]=_0x512ad0[_0x37a0('0x48')][_0x37a0('0x4b')]?_0x512ad0['attributes']:_0x48e2a8[_0x37a0('0x47')];if(_0x495735['query'][_0x37a0('0x54')]){_0x512ad0[_0x37a0('0x59')]=[{'all':!![]}];}_0x512ad0=_[_0x37a0('0x5a')]({},_0x512ad0,_0x495735[_0x37a0('0x5b')]);return db[_0x37a0('0x42')]['find'](_0x512ad0)[_0x37a0('0x37')](handleEntityNotFound(_0x109a41,null))[_0x37a0('0x37')](respondWithResult(_0x109a41,null))[_0x37a0('0x2a')](handleError(_0x109a41,null));};exports[_0x37a0('0x5c')]=function(_0x18fa66,_0x16902a){return db[_0x37a0('0x42')][_0x37a0('0x5c')](_0x18fa66[_0x37a0('0x5d')],{})[_0x37a0('0x37')](function(_0x452e8a){var _0x14336f=_0x18fa66['user']['get']({'plain':!![]});if(!_0x14336f)throw new Error(_0x37a0('0x5e'));if(_0x14336f['role']===_0x37a0('0x5f')){var _0x4c006d=_0x452e8a['get']({'plain':!![]});var _0x5a9b88=_0x37a0('0x39');return db[_0x37a0('0x60')][_0x37a0('0x61')]({'where':{'name':_0x5a9b88,'userProfileId':_0x14336f[_0x37a0('0x62')]},'raw':!![]})[_0x37a0('0x37')](function(_0x56e897){if(_0x56e897&&_0x56e897[_0x37a0('0x63')]===0x0){return db[_0x37a0('0x3a')][_0x37a0('0x5c')]({'name':_0x4c006d[_0x37a0('0x3d')],'resourceId':_0x4c006d['id'],'type':_0x56e897['name'],'sectionId':_0x56e897['id']},{})[_0x37a0('0x37')](function(){return _0x452e8a;});}else{return _0x452e8a;}})[_0x37a0('0x2a')](function(_0x49b6a3){logger[_0x37a0('0x26')](_0x37a0('0x64'),_0x49b6a3);throw _0x49b6a3;});}return _0x452e8a;})[_0x37a0('0x37')](respondWithResult(_0x16902a,0xc9))[_0x37a0('0x2a')](handleError(_0x16902a,null));};exports[_0x37a0('0x36')]=function(_0x10c3fe,_0x1d49ed){if(_0x10c3fe[_0x37a0('0x5d')]['id']){delete _0x10c3fe[_0x37a0('0x5d')]['id'];}return db[_0x37a0('0x42')]['find']({'where':{'id':_0x10c3fe[_0x37a0('0x58')]['id']},'include':[{'model':db['Pause'],'as':_0x37a0('0x41')}]})[_0x37a0('0x37')](handleEntityNotFound(_0x1d49ed,null))[_0x37a0('0x37')](saveUpdates(_0x10c3fe[_0x37a0('0x5d')],null))[_0x37a0('0x37')](respondWithResult(_0x1d49ed,null))[_0x37a0('0x2a')](handleError(_0x1d49ed,null));};exports[_0x37a0('0x3b')]=function(_0x28395f,_0x12ee4b){return db[_0x37a0('0x42')][_0x37a0('0x61')]({'where':{'id':_0x28395f[_0x37a0('0x58')]['id']}})[_0x37a0('0x37')](handleEntityNotFound(_0x12ee4b,null))[_0x37a0('0x37')](removeEntity(_0x12ee4b,null))[_0x37a0('0x2a')](handleError(_0x12ee4b,null));};exports[_0x37a0('0x65')]=function(_0xa814aa,_0x3d679c){return db[_0x37a0('0x42')][_0x37a0('0x65')]()['then'](respondWithResult(_0x3d679c,null))['catch'](handleError(_0x3d679c,null));};exports['addDisposition']=function(_0x279544,_0xd3e7a7,_0x46da36){if(_0x279544['body']['id']){delete _0x279544[_0x37a0('0x5d')]['id'];}return db[_0x37a0('0x42')][_0x37a0('0x61')]({'where':{'id':_0x279544['params']['id']}})[_0x37a0('0x37')](handleEntityNotFound(_0xd3e7a7,null))[_0x37a0('0x37')](function(_0x50e5a6){if(_0x50e5a6){_0x279544[_0x37a0('0x5d')][_0x37a0('0x66')]=_0x50e5a6['id'];return db[_0x37a0('0x67')][_0x37a0('0x5c')](_0x279544[_0x37a0('0x5d')]);}})[_0x37a0('0x37')](respondWithResult(_0xd3e7a7,null))['catch'](handleError(_0xd3e7a7,null));};exports[_0x37a0('0x68')]=function(_0x2334bc,_0x350bfd,_0x2a95b2){var _0x586e4b={'raw':![],'where':{}};var _0x246345={};var _0x4b8ac7={'count':0x0,'rows':[]};return db[_0x37a0('0x42')][_0x37a0('0x69')]({'where':{'id':_0x2334bc[_0x37a0('0x58')]['id']}})[_0x37a0('0x37')](handleEntityNotFound(_0x350bfd,null))[_0x37a0('0x37')](function(_0x101e49){if(_0x101e49){_0x246345['model']=_['keys'](db[_0x37a0('0x67')]['rawAttributes']);_0x246345['query']=_[_0x37a0('0x44')](_0x2334bc[_0x37a0('0x45')]);_0x246345[_0x37a0('0x46')]=_[_0x37a0('0x49')](_0x246345[_0x37a0('0x47')],_0x246345['query']);_0x586e4b[_0x37a0('0x48')]=_[_0x37a0('0x49')](_0x246345[_0x37a0('0x47')],qs['fields'](_0x2334bc[_0x37a0('0x45')][_0x37a0('0x4a')]));_0x586e4b[_0x37a0('0x48')]=_0x586e4b[_0x37a0('0x48')][_0x37a0('0x4b')]?_0x586e4b[_0x37a0('0x48')]:_0x246345['model'];if(!_0x2334bc[_0x37a0('0x45')]['hasOwnProperty'](_0x37a0('0x6a'))){_0x586e4b[_0x37a0('0x31')]=qs[_0x37a0('0x31')](_0x2334bc['query'][_0x37a0('0x31')]);_0x586e4b[_0x37a0('0x30')]=qs['offset'](_0x2334bc[_0x37a0('0x45')][_0x37a0('0x30')]);}_0x586e4b[_0x37a0('0x4d')]=qs[_0x37a0('0x4e')](_0x2334bc[_0x37a0('0x45')]['sort']);_0x586e4b[_0x37a0('0x4f')]=qs['filters'](_[_0x37a0('0x6b')](_0x2334bc[_0x37a0('0x45')],_0x246345['filters']));_0x586e4b['where']['OpenchannelAccountId']=_0x101e49['id'];if(_0x2334bc[_0x37a0('0x45')][_0x37a0('0x50')]){_0x586e4b[_0x37a0('0x4f')]=_[_0x37a0('0x5a')](_0x586e4b[_0x37a0('0x4f')],{'$or':_[_0x37a0('0x51')](_0x586e4b['attributes'],function(_0x302375){var _0x4d5f0f={};_0x4d5f0f[_0x302375]={'$like':'%'+_0x2334bc[_0x37a0('0x45')][_0x37a0('0x50')]+'%'};return _0x4d5f0f;})});}_0x586e4b=_[_0x37a0('0x5a')]({},_0x586e4b,_0x2334bc[_0x37a0('0x5b')]);return db[_0x37a0('0x67')]['count']({'where':_0x586e4b[_0x37a0('0x4f')]})[_0x37a0('0x37')](function(_0xf72703){_0x4b8ac7[_0x37a0('0x2f')]=_0xf72703;if(_0x2334bc['query'][_0x37a0('0x54')]){_0x586e4b[_0x37a0('0x59')]=[{'all':!![]}];}return db[_0x37a0('0x67')][_0x37a0('0x55')](_0x586e4b);})[_0x37a0('0x37')](function(_0x5a3a2f){_0x4b8ac7['rows']=_0x5a3a2f;return _0x4b8ac7;});}})[_0x37a0('0x37')](respondWithFilteredResult(_0x350bfd,_0x586e4b))[_0x37a0('0x2a')](handleError(_0x350bfd,null));};exports[_0x37a0('0x6c')]=function(_0x4b2e5d,_0x21943a,_0x2051a7){return db['OpenchannelAccount'][_0x37a0('0x61')]({'where':{'id':_0x4b2e5d[_0x37a0('0x58')]['id']}})['then'](handleEntityNotFound(_0x21943a,null))[_0x37a0('0x37')](function(_0x5727f0){if(_0x5727f0){return _0x5727f0['removeDispositions'](_0x4b2e5d[_0x37a0('0x45')]['ids']);}})['then'](respondWithStatusCode(_0x21943a,null))[_0x37a0('0x2a')](handleError(_0x21943a,null));};exports[_0x37a0('0x6d')]=function(_0x225706,_0x3262b7,_0x3ba589){if(_0x225706['body']['id']){delete _0x225706[_0x37a0('0x5d')]['id'];}return db[_0x37a0('0x42')][_0x37a0('0x61')]({'where':{'id':_0x225706['params']['id']}})[_0x37a0('0x37')](handleEntityNotFound(_0x3262b7,null))[_0x37a0('0x37')](function(_0x5286fc){if(_0x5286fc){_0x225706['body'][_0x37a0('0x6e')]=_0x5286fc['id'];return db['CannedAnswer'][_0x37a0('0x5c')](_0x225706[_0x37a0('0x5d')]);}})[_0x37a0('0x37')](respondWithResult(_0x3262b7,null))[_0x37a0('0x2a')](handleError(_0x3262b7,null));};exports[_0x37a0('0x6f')]=function(_0x4c6908,_0x46a0c7,_0x5bd60c){var _0x306b6e={'raw':![],'where':{}};var _0x425d92={};var _0x20c2f9={'count':0x0,'rows':[]};return db[_0x37a0('0x42')][_0x37a0('0x69')]({'where':{'id':_0x4c6908[_0x37a0('0x58')]['id']}})['then'](handleEntityNotFound(_0x46a0c7,null))[_0x37a0('0x37')](function(_0x122258){if(_0x122258){_0x425d92[_0x37a0('0x47')]=_[_0x37a0('0x44')](db[_0x37a0('0x70')][_0x37a0('0x43')]);_0x425d92[_0x37a0('0x45')]=_[_0x37a0('0x44')](_0x4c6908[_0x37a0('0x45')]);_0x425d92[_0x37a0('0x46')]=_[_0x37a0('0x49')](_0x425d92[_0x37a0('0x47')],_0x425d92[_0x37a0('0x45')]);_0x306b6e[_0x37a0('0x48')]=_[_0x37a0('0x49')](_0x425d92[_0x37a0('0x47')],qs['fields'](_0x4c6908[_0x37a0('0x45')][_0x37a0('0x4a')]));_0x306b6e[_0x37a0('0x48')]=_0x306b6e[_0x37a0('0x48')]['length']?_0x306b6e[_0x37a0('0x48')]:_0x425d92[_0x37a0('0x47')];if(!_0x4c6908['query'][_0x37a0('0x4c')](_0x37a0('0x6a'))){_0x306b6e[_0x37a0('0x31')]=qs[_0x37a0('0x31')](_0x4c6908[_0x37a0('0x45')][_0x37a0('0x31')]);_0x306b6e[_0x37a0('0x30')]=qs[_0x37a0('0x30')](_0x4c6908[_0x37a0('0x45')][_0x37a0('0x30')]);}_0x306b6e[_0x37a0('0x4d')]=qs[_0x37a0('0x4e')](_0x4c6908['query'][_0x37a0('0x4e')]);_0x306b6e['where']=qs[_0x37a0('0x46')](_[_0x37a0('0x6b')](_0x4c6908[_0x37a0('0x45')],_0x425d92[_0x37a0('0x46')]));_0x306b6e['where']['OpenchannelAccountId']=_0x122258['id'];if(_0x4c6908[_0x37a0('0x45')][_0x37a0('0x50')]){_0x306b6e[_0x37a0('0x4f')]=_[_0x37a0('0x5a')](_0x306b6e[_0x37a0('0x4f')],{'$or':_[_0x37a0('0x51')](_0x306b6e[_0x37a0('0x48')],function(_0x5a7041){var _0x2b6507={};_0x2b6507[_0x5a7041]={'$like':'%'+_0x4c6908[_0x37a0('0x45')]['filter']+'%'};return _0x2b6507;})});}_0x306b6e=_[_0x37a0('0x5a')]({},_0x306b6e,_0x4c6908['options']);return db['CannedAnswer'][_0x37a0('0x2f')]({'where':_0x306b6e[_0x37a0('0x4f')]})[_0x37a0('0x37')](function(_0x36e137){_0x20c2f9[_0x37a0('0x2f')]=_0x36e137;if(_0x4c6908[_0x37a0('0x45')]['includeAll']){_0x306b6e[_0x37a0('0x59')]=[{'all':!![]}];}return db[_0x37a0('0x70')][_0x37a0('0x55')](_0x306b6e);})[_0x37a0('0x37')](function(_0xc444a4){_0x20c2f9[_0x37a0('0x56')]=_0xc444a4;return _0x20c2f9;});}})['then'](respondWithFilteredResult(_0x46a0c7,_0x306b6e))[_0x37a0('0x2a')](handleError(_0x46a0c7,null));};exports['removeAnswers']=function(_0x3df449,_0x7c2eb1,_0x1fbf98){return db[_0x37a0('0x42')][_0x37a0('0x61')]({'where':{'id':_0x3df449[_0x37a0('0x58')]['id']}})[_0x37a0('0x37')](handleEntityNotFound(_0x7c2eb1,null))[_0x37a0('0x37')](function(_0x3d3edd){if(_0x3d3edd){return _0x3d3edd[_0x37a0('0x71')](_0x3df449[_0x37a0('0x45')]['ids']);}})[_0x37a0('0x37')](respondWithStatusCode(_0x7c2eb1,null))[_0x37a0('0x2a')](handleError(_0x7c2eb1,null));};exports[_0x37a0('0x72')]=function(_0x72bfcd,_0x5a311b,_0x346faf){var _0x363c8c={'body':_0x72bfcd[_0x37a0('0x5d')],'channel':_0x37a0('0x73')};var _0x18e4a1=[];var _0x3aeefe=[];var _0x571088={};var _0x570f0c=![];return db[_0x37a0('0x74')]['describe']()[_0x37a0('0x37')](function(_0x2cbb65){if(!_0x2cbb65){throw new db[(_0x37a0('0x75'))][(_0x37a0('0x76'))]('no\x20available\x20attributes');}_0x18e4a1=_['difference'](_[_0x37a0('0x44')](_0x2cbb65),[_0x37a0('0x77'),_0x37a0('0x78')]);_0x3aeefe=_[_0x37a0('0x79')](_['keys'](_0x2cbb65),[_0x37a0('0x77'),_0x37a0('0x78'),'CompanyId','ListId']);if(_0x72bfcd[_0x37a0('0x5d')]['id']){delete _0x72bfcd[_0x37a0('0x5d')]['id'];}if(_[_0x37a0('0x7a')](_0x72bfcd[_0x37a0('0x5d')][_0x37a0('0x7b')])){throw new db[(_0x37a0('0x75'))][(_0x37a0('0x76'))](_0x37a0('0x7c'));}if(_[_0x37a0('0x7a')](_0x72bfcd['body'][_0x37a0('0x5d')])||_0x72bfcd[_0x37a0('0x5d')][_0x37a0('0x5d')]===''){throw new db['Sequelize'][(_0x37a0('0x76'))](_0x37a0('0x7d'));}if(_[_0x37a0('0x7a')](_0x72bfcd[_0x37a0('0x5d')][_0x37a0('0x7e')])){throw new db[(_0x37a0('0x75'))][(_0x37a0('0x76'))](_0x37a0('0x7f')+_0x3aeefe);}if(!_['includes'](_0x3aeefe,_0x72bfcd['body'][_0x37a0('0x7e')])){throw new db[(_0x37a0('0x75'))][(_0x37a0('0x76'))](_0x37a0('0x80')+_0x3aeefe);}_0x571088[_0x72bfcd[_0x37a0('0x5d')][_0x37a0('0x7e')]]=_0x72bfcd['body'][_0x37a0('0x7b')];})[_0x37a0('0x37')](function(){return db[_0x37a0('0x42')][_0x37a0('0x61')]({'where':{'id':_0x72bfcd[_0x37a0('0x58')]['id']},'include':[{'model':db[_0x37a0('0x81')],'as':_0x37a0('0x82'),'include':[{'model':db[_0x37a0('0x74')],'as':'Contacts','where':_0x571088,'limit':0x1,'order':[[_0x37a0('0x78'),_0x37a0('0x83')]]}]},{'model':db[_0x37a0('0x84')],'as':_0x37a0('0x85')}]});})[_0x37a0('0x37')](handleEntityNotFound(_0x5a311b,null))[_0x37a0('0x37')](function(_0x92e5c9){if(_0x92e5c9&&_0x92e5c9[_0x37a0('0x82')]){_0x363c8c['account']=_0x92e5c9;_0x363c8c[_0x37a0('0x86')]=_0x92e5c9[_0x37a0('0x85')];_0x363c8c['list']=_0x92e5c9['List'];_0x363c8c[_0x37a0('0x86')]=_[_0x37a0('0x87')](_0x363c8c[_0x37a0('0x86')],['priority'],['asc']);if(_0x363c8c[_0x37a0('0x88')][_0x37a0('0x85')]){delete _0x363c8c[_0x37a0('0x88')][_0x37a0('0x85')];}if(_0x363c8c[_0x37a0('0x88')]['List']&&_0x363c8c[_0x37a0('0x88')][_0x37a0('0x82')][_0x37a0('0x89')]['length']){return _0x363c8c[_0x37a0('0x88')][_0x37a0('0x82')]['Contacts'][0x0];}var _0x4f80c6=_[_0x37a0('0x17')](_0x72bfcd['body'],{'firstName':_0x72bfcd[_0x37a0('0x5d')][_0x37a0('0x7b')],'ListId':_0x92e5c9[_0x37a0('0x8a')]});_0x4f80c6[_0x72bfcd[_0x37a0('0x5d')]['mapKey']]=_0x72bfcd[_0x37a0('0x5d')][_0x37a0('0x7b')];return db[_0x37a0('0x74')]['create'](_0x4f80c6,{'fields':_0x18e4a1,'raw':!![]});}})['then'](handleEntityNotFound(_0x5a311b,null))[_0x37a0('0x37')](function(_0x4bb40c){_0x363c8c['contact']=_0x4bb40c;if(_0x4bb40c){var _0x1b6e84={'ContactId':_0x4bb40c['id'],'OpenchannelAccountId':_0x72bfcd['params']['id'],'from':(_0x4bb40c[_0x37a0('0x8b')]||'')+'\x20'+(_0x4bb40c['lastName']||'')};var _0x66f038={'OpenchannelAccountId':_0x72bfcd[_0x37a0('0x58')]['id'],'closed':![]};if(_0x72bfcd[_0x37a0('0x5d')]['threadId']){_0x66f038['threadId']=_0x72bfcd[_0x37a0('0x5d')][_0x37a0('0x8c')];return db[_0x37a0('0x8d')][_0x37a0('0x61')]({'where':_0x66f038})[_0x37a0('0x37')](function(_0x3a204c){if(_0x3a204c){return[_0x3a204c,![]];}_0x1b6e84[_0x37a0('0x8c')]=_0x72bfcd[_0x37a0('0x5d')][_0x37a0('0x8c')];_0x1b6e84[_0x37a0('0x8e')]=_0x72bfcd[_0x37a0('0x5d')]['externalUrl'];return db[_0x37a0('0x8d')]['create'](_0x1b6e84)[_0x37a0('0x37')](function(_0xa6b4f3){return[_0xa6b4f3,!![]];});});}else{_0x66f038[_0x37a0('0x8c')]=null;}_0x66f038['ContactId']=_0x4bb40c['id'];return db[_0x37a0('0x8d')]['find']({'where':_0x66f038})[_0x37a0('0x37')](function(_0x3801db){if(_0x3801db){return[_0x3801db,![]];}return db['OpenchannelInteraction']['create'](_0x1b6e84)[_0x37a0('0x37')](function(_0x3c1f06){return[_0x3c1f06,!![]];});});}})[_0x37a0('0x8f')](function(_0x9f91e8,_0x3c5a6e){if(_0x9f91e8){_0x570f0c=_0x3c5a6e;if(!_0x3c5a6e){var _0x4bcd00={'from':(_0x363c8c[_0x37a0('0x90')][_0x37a0('0x8b')]||'')+'\x20'+(_0x363c8c[_0x37a0('0x90')][_0x37a0('0x91')]||'')};if(_0x72bfcd['body']['threadId']&&_0x72bfcd['body'][_0x37a0('0x92')]&&_0x72bfcd[_0x37a0('0x5d')][_0x37a0('0x8c')]!=_0x72bfcd[_0x37a0('0x5d')][_0x37a0('0x92')]){_0x4bcd00['threadId']=_0x72bfcd[_0x37a0('0x5d')][_0x37a0('0x92')];}return _0x9f91e8['update'](_0x4bcd00);}else{return _0x9f91e8;}}})['then'](function(_0x44a0bf){_0x363c8c[_0x37a0('0x93')]=_0x44a0bf[_0x37a0('0x38')]({'plain':!![]});_0x363c8c[_0x37a0('0x93')]['created']=_0x570f0c;if(_0x363c8c[_0x37a0('0x93')][_0x37a0('0x94')]){if(_0x363c8c[_0x37a0('0x88')][_0x37a0('0x95')]){_0x363c8c['applications']['push']({'id':0x0,'priority':_0x363c8c['applications'][_0x37a0('0x4b')]+0x1,'app':_0x37a0('0x96'),'appdata':'unmanaged','interval':_0x37a0('0x97')});}}return db[_0x37a0('0x98')][_0x37a0('0x5c')]({'body':_0x72bfcd[_0x37a0('0x5d')][_0x37a0('0x5d')],'OpenchannelAccountId':_0x72bfcd[_0x37a0('0x58')]['id'],'OpenchannelInteractionId':_0x44a0bf['id'],'direction':'in','ContactId':_0x363c8c[_0x37a0('0x90')]['id'],'AttachmentId':_0x72bfcd[_0x37a0('0x5d')][_0x37a0('0x99')]});})[_0x37a0('0x37')](function(_0x4d3c28){_0x363c8c[_0x37a0('0x28')]=_0x4d3c28;if(_0x363c8c[_0x37a0('0x93')]['UserId']){return db[_0x37a0('0x9a')][_0x37a0('0x61')]({'attributes':['id',_0x37a0('0x3d')],'where':{'id':_0x363c8c['interaction']['UserId']}})[_0x37a0('0x37')](function(_0x348ce7){if(_0x348ce7){_0x363c8c[_0x37a0('0x86')][_0x37a0('0x9b')]({'id':0x0,'priority':0x0,'app':_0x37a0('0x9c'),'appdata':_0x348ce7[_0x37a0('0x3d')]+','+(_0x363c8c[_0x37a0('0x88')][_0x37a0('0x9d')]||0xa),'interval':_0x37a0('0x97')});_0x363c8c[_0x37a0('0x9e')]=![];}return respondWithRpcPromise('Start',_0x37a0('0x9f'),_0x363c8c);});}return respondWithRpcPromise('Start',_0x37a0('0x9f'),_0x363c8c);})[_0x37a0('0x37')](function(_0x18b9c9){respondWithRpcPromise(_0x37a0('0xa0'),_0x37a0('0xa0'),{'event':_0x37a0('0x72'),'message':_0x18b9c9},client9002);return _0x18b9c9;})['then'](respondWithResult(_0x5a311b,null))['catch'](handleError(_0x5a311b,null));};exports['addApplications']=function(_0x2012f1,_0x344eef,_0x56ade8){return db[_0x37a0('0x42')][_0x37a0('0x69')]({'where':{'id':_0x2012f1[_0x37a0('0x58')]['id']}})['then'](handleEntityNotFound(_0x344eef,null))[_0x37a0('0x37')](function(_0x10b61a){if(_0x10b61a){return db[_0x37a0('0xa1')][_0x37a0('0xa2')](function(_0x5ecb9f){return db[_0x37a0('0x84')][_0x37a0('0x3b')]({'where':{'OpenchannelAccountId':_0x2012f1[_0x37a0('0x58')]['id']},'transaction':_0x5ecb9f})[_0x37a0('0x37')](function(_0x522570){var _0x5f1f94=_[_0x37a0('0x51')](_0x2012f1[_0x37a0('0x5d')],function(_0x344c39){_0x344c39['OpenchannelAccountId']=_0x2012f1['params']['id'];return _0x344c39;});return db[_0x37a0('0x84')][_0x37a0('0xa3')](_0x5f1f94,{'transaction':_0x5ecb9f});});})[_0x37a0('0x37')](function(){return db[_0x37a0('0x84')][_0x37a0('0xa4')]({'where':{'OpenchannelAccountId':_0x2012f1[_0x37a0('0x58')]['id']},'order':_0x37a0('0xa5')});});}})['then'](respondWithResult(_0x344eef,null))[_0x37a0('0x2a')](handleError(_0x344eef,null));};exports['getApplications']=function(_0x1cbc25,_0x4fe6e8,_0x5bd2c3){var _0x51d123={};var _0xef6e33={};var _0x3bf156;var _0x28f072;return db[_0x37a0('0x42')][_0x37a0('0x69')]({'where':{'id':_0x1cbc25[_0x37a0('0x58')]['id']}})[_0x37a0('0x37')](handleEntityNotFound(_0x4fe6e8,null))[_0x37a0('0x37')](function(_0x5dd888){if(_0x5dd888){_0x3bf156=_0x5dd888;_0xef6e33[_0x37a0('0x47')]=_['keys'](db[_0x37a0('0x84')]['rawAttributes']);_0xef6e33['query']=_['keys'](_0x1cbc25[_0x37a0('0x45')]);_0xef6e33[_0x37a0('0x46')]=_[_0x37a0('0x49')](_0xef6e33[_0x37a0('0x47')],_0xef6e33[_0x37a0('0x45')]);_0x51d123[_0x37a0('0x48')]=_[_0x37a0('0x49')](_0xef6e33[_0x37a0('0x47')],qs[_0x37a0('0x4a')](_0x1cbc25[_0x37a0('0x45')][_0x37a0('0x4a')]));_0x51d123[_0x37a0('0x48')]=_0x51d123[_0x37a0('0x48')][_0x37a0('0x4b')]?_0x51d123[_0x37a0('0x48')]:_0xef6e33['model'];_0x51d123['order']=qs['sort'](_0x1cbc25[_0x37a0('0x45')][_0x37a0('0x4e')]);_0x51d123['where']=qs[_0x37a0('0x46')](_['pick'](_0x1cbc25[_0x37a0('0x45')],_0xef6e33[_0x37a0('0x46')]));if(_0x1cbc25[_0x37a0('0x45')][_0x37a0('0x50')]){_0x51d123['where']=_[_0x37a0('0x5a')](_0x51d123[_0x37a0('0x4f')],{'$or':_[_0x37a0('0x51')](_0x51d123['attributes'],function(_0x3885e7){var _0x4a316a={};_0x4a316a[_0x3885e7]={'$like':'%'+_0x1cbc25[_0x37a0('0x45')][_0x37a0('0x50')]+'%'};return _0x4a316a;})});}_0x51d123=_['merge']({},_0x51d123,_0x1cbc25[_0x37a0('0x5b')]);return _0x3bf156[_0x37a0('0xa6')](_0x51d123);}})[_0x37a0('0x37')](function(_0x1b119e){if(_0x1b119e){_0x28f072=_0x1b119e['length'];if(!_0x1cbc25[_0x37a0('0x45')]['hasOwnProperty'](_0x37a0('0x6a'))){_0x51d123[_0x37a0('0x31')]=qs[_0x37a0('0x31')](_0x1cbc25['query'][_0x37a0('0x31')]);_0x51d123['offset']=qs[_0x37a0('0x30')](_0x1cbc25[_0x37a0('0x45')][_0x37a0('0x30')]);}return _0x3bf156[_0x37a0('0xa6')](_0x51d123);}})[_0x37a0('0x37')](function(_0x3cb868){if(_0x3cb868){return _0x3cb868?{'count':_0x28f072,'rows':_0x3cb868}:null;}})['then'](respondWithResult(_0x4fe6e8,null))['catch'](handleError(_0x4fe6e8,null));};exports[_0x37a0('0xa7')]=function(_0x513c1c,_0x26160e,_0x3bd489){var _0x5ad2c6={'raw':![],'where':{}};var _0x3a774b={};var _0x4354ae={'count':0x0,'rows':[]};return db[_0x37a0('0x42')][_0x37a0('0x69')]({'where':{'id':_0x513c1c[_0x37a0('0x58')]['id']}})[_0x37a0('0x37')](handleEntityNotFound(_0x26160e,null))[_0x37a0('0x37')](function(_0x10fb9e){if(_0x10fb9e){_0x3a774b[_0x37a0('0x47')]=_[_0x37a0('0x44')](db[_0x37a0('0x8d')]['rawAttributes']);_0x3a774b[_0x37a0('0x45')]=_[_0x37a0('0x44')](_0x513c1c[_0x37a0('0x45')]);_0x3a774b['filters']=_[_0x37a0('0x49')](_0x3a774b[_0x37a0('0x47')],_0x3a774b['query']);_0x5ad2c6[_0x37a0('0x48')]=_[_0x37a0('0x49')](_0x3a774b['model'],qs[_0x37a0('0x4a')](_0x513c1c[_0x37a0('0x45')][_0x37a0('0x4a')]));_0x5ad2c6[_0x37a0('0x48')]=_0x5ad2c6['attributes'][_0x37a0('0x4b')]?_0x5ad2c6[_0x37a0('0x48')]:_0x3a774b[_0x37a0('0x47')];if(!_0x513c1c[_0x37a0('0x45')][_0x37a0('0x4c')](_0x37a0('0x6a'))){_0x5ad2c6[_0x37a0('0x31')]=qs[_0x37a0('0x31')](_0x513c1c['query'][_0x37a0('0x31')]);_0x5ad2c6[_0x37a0('0x30')]=qs['offset'](_0x513c1c[_0x37a0('0x45')][_0x37a0('0x30')]);}_0x5ad2c6['order']=qs[_0x37a0('0x4e')](_0x513c1c[_0x37a0('0x45')][_0x37a0('0x4e')]);_0x5ad2c6[_0x37a0('0x4f')]=qs['filters'](_[_0x37a0('0x6b')](_0x513c1c[_0x37a0('0x45')],_0x3a774b['filters']));_0x5ad2c6[_0x37a0('0x4f')][_0x37a0('0x6e')]=_0x10fb9e['id'];if(_0x513c1c[_0x37a0('0x45')][_0x37a0('0x50')]){_0x5ad2c6[_0x37a0('0x4f')]=_['merge'](_0x5ad2c6['where'],{'$or':_[_0x37a0('0x51')](_0x5ad2c6[_0x37a0('0x48')],function(_0x28d5a7){var _0x14ca55={};_0x14ca55[_0x28d5a7]={'$like':'%'+_0x513c1c[_0x37a0('0x45')][_0x37a0('0x50')]+'%'};return _0x14ca55;})});}_0x5ad2c6=_[_0x37a0('0x5a')]({},_0x5ad2c6,_0x513c1c['options']);return db['OpenchannelInteraction']['count']({'where':_0x5ad2c6['where']})[_0x37a0('0x37')](function(_0x1c9020){_0x4354ae[_0x37a0('0x2f')]=_0x1c9020;if(_0x513c1c['query']['includeAll']){_0x5ad2c6['include']=[{'model':db[_0x37a0('0x74')],'as':_0x37a0('0xa8'),'required':![]},{'model':db[_0x37a0('0x9a')],'as':'Owner','attributes':[_0x37a0('0x3d'),'fullname',_0x37a0('0xa9')],'required':![]},{'model':db[_0x37a0('0xaa')],'as':_0x37a0('0xab'),'attributes':['id',_0x37a0('0x3d'),_0x37a0('0xac')],'where':_0x513c1c[_0x37a0('0x45')][_0x37a0('0xad')]?{'id':_0x513c1c[_0x37a0('0x45')][_0x37a0('0xad')]}:undefined,'required':_0x513c1c[_0x37a0('0x45')]['tag']?!![]:![]}];}return db[_0x37a0('0x8d')]['findAll'](_0x5ad2c6);})[_0x37a0('0x37')](function(_0x79cdd4){_0x4354ae[_0x37a0('0x56')]=_0x79cdd4;return _0x4354ae;});}})['then'](respondWithFilteredResult(_0x26160e,_0x5ad2c6))[_0x37a0('0x2a')](handleError(_0x26160e,null));};exports[_0x37a0('0xae')]=function(_0x39bdbf,_0x3faefb,_0x3c9939){return db[_0x37a0('0x42')][_0x37a0('0x61')]({'where':{'id':_0x39bdbf['params']['id']}})[_0x37a0('0x37')](handleEntityNotFound(_0x3faefb,null))['then'](function(_0x4c76b2){if(_0x4c76b2){return _0x4c76b2[_0x37a0('0xae')](_0x39bdbf[_0x37a0('0x5d')][_0x37a0('0xaf')],_[_0x37a0('0xb0')](_0x39bdbf[_0x37a0('0x5d')],[_0x37a0('0xaf'),'id'])||{})['spread'](function(_0x4a352e){for(var _0xb17dbe=0x0;_0xb17dbe<_0x39bdbf[_0x37a0('0x5d')]['ids'][_0x37a0('0x4b')];_0xb17dbe+=0x1){socket[_0x37a0('0xb1')](_0x37a0('0xb2'),{'UserId':_0x39bdbf[_0x37a0('0x5d')][_0x37a0('0xaf')][_0xb17dbe],'OpenchannelAccountId':_0x39bdbf[_0x37a0('0x58')]['id']});}return _0x4a352e;});}})['then'](respondWithResult(_0x3faefb,null))[_0x37a0('0x2a')](handleError(_0x3faefb,null));};exports[_0x37a0('0xb3')]=function(_0x206441,_0x176f33,_0xddaeb4){return db[_0x37a0('0x42')][_0x37a0('0x61')]({'where':{'id':_0x206441[_0x37a0('0x58')]['id']}})[_0x37a0('0x37')](handleEntityNotFound(_0x176f33,null))['then'](function(_0x30ab03){if(_0x30ab03){return _0x30ab03['removeAgents'](_0x206441['query'][_0x37a0('0xaf')])[_0x37a0('0x37')](function(){if(_[_0x37a0('0xb4')](_0x206441[_0x37a0('0x45')]['ids'])){for(var _0x467ef5=0x0;_0x467ef5<_0x206441[_0x37a0('0x45')]['ids'][_0x37a0('0x4b')];_0x467ef5+=0x1){socket[_0x37a0('0xb1')](_0x37a0('0xb5'),{'UserId':Number(_0x206441[_0x37a0('0x45')][_0x37a0('0xaf')][_0x467ef5]),'OpenchannelAccountId':Number(_0x206441[_0x37a0('0x58')]['id'])});}}else{socket[_0x37a0('0xb1')]('userOpenchannelAccount:remove',{'UserId':Number(_0x206441[_0x37a0('0x45')][_0x37a0('0xaf')]),'OpenchannelAccountId':Number(_0x206441[_0x37a0('0x58')]['id'])});}});}})[_0x37a0('0x37')](respondWithStatusCode(_0x176f33,null))[_0x37a0('0x2a')](handleError(_0x176f33,null));};exports[_0x37a0('0xb6')]=function(_0x277ccb,_0x11184b,_0x5e9d99){var _0x1c7b7c={};var _0x206eaa={};var _0x12b831;var _0x4ffff0;return db['OpenchannelAccount']['findOne']({'where':{'id':_0x277ccb['params']['id']}})[_0x37a0('0x37')](handleEntityNotFound(_0x11184b,null))['then'](function(_0x5db6e4){if(_0x5db6e4){_0x12b831=_0x5db6e4;_0x206eaa['model']=_[_0x37a0('0x44')](db[_0x37a0('0x9a')][_0x37a0('0x43')]);_0x206eaa['query']=_[_0x37a0('0x44')](_0x277ccb[_0x37a0('0x45')]);_0x206eaa['filters']=_[_0x37a0('0x49')](_0x206eaa[_0x37a0('0x47')],_0x206eaa[_0x37a0('0x45')]);_0x1c7b7c[_0x37a0('0x48')]=_[_0x37a0('0x49')](_0x206eaa['model'],qs['fields'](_0x277ccb[_0x37a0('0x45')][_0x37a0('0x4a')]));_0x1c7b7c['attributes']=_0x1c7b7c[_0x37a0('0x48')][_0x37a0('0x4b')]?_0x1c7b7c[_0x37a0('0x48')]:_0x206eaa['model'];_0x1c7b7c[_0x37a0('0x4d')]=qs['sort'](_0x277ccb[_0x37a0('0x45')][_0x37a0('0x4e')]);_0x1c7b7c[_0x37a0('0x4f')]=qs[_0x37a0('0x46')](_['pick'](_0x277ccb[_0x37a0('0x45')],_0x206eaa[_0x37a0('0x46')]));if(_0x277ccb['query'][_0x37a0('0x50')]){_0x1c7b7c['where']=_['merge'](_0x1c7b7c[_0x37a0('0x4f')],{'$or':_[_0x37a0('0x51')](_0x1c7b7c['attributes'],function(_0x4bb158){var _0x5dcc23={};_0x5dcc23[_0x4bb158]={'$like':'%'+_0x277ccb[_0x37a0('0x45')]['filter']+'%'};return _0x5dcc23;})});}_0x1c7b7c=_[_0x37a0('0x5a')]({},_0x1c7b7c,_0x277ccb[_0x37a0('0x5b')]);return _0x12b831[_0x37a0('0xb6')](_0x1c7b7c);}})[_0x37a0('0x37')](function(_0x5f3ecf){if(_0x5f3ecf){_0x4ffff0=_0x5f3ecf[_0x37a0('0x4b')];if(!_0x277ccb[_0x37a0('0x45')][_0x37a0('0x4c')](_0x37a0('0x6a'))){_0x1c7b7c[_0x37a0('0x31')]=qs[_0x37a0('0x31')](_0x277ccb[_0x37a0('0x45')][_0x37a0('0x31')]);_0x1c7b7c[_0x37a0('0x30')]=qs['offset'](_0x277ccb[_0x37a0('0x45')][_0x37a0('0x30')]);}return _0x12b831[_0x37a0('0xb6')](_0x1c7b7c);}})[_0x37a0('0x37')](function(_0x4d2c40){if(_0x4d2c40){return _0x4d2c40?{'count':_0x4ffff0,'rows':_0x4d2c40}:null;}})[_0x37a0('0x37')](respondWithResult(_0x11184b,null))['catch'](handleError(_0x11184b,null));};exports[_0x37a0('0x3e')]=function(_0x4ff533,_0x3399bd,_0x5bc05a){var _0x7cb754,_0x538672,_0x81aa37;if(_['isNil'](_0x4ff533[_0x37a0('0x5d')]['body'])||_0x4ff533[_0x37a0('0x5d')][_0x37a0('0x5d')]===''){throw new db[(_0x37a0('0x75'))][(_0x37a0('0x76'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x37a0('0x7a')](_0x4ff533[_0x37a0('0x5d')]['to'])){}_0x7cb754=_0x4ff533['body']['to'];return db[_0x37a0('0x42')]['findOne']({'where':{'id':_0x4ff533[_0x37a0('0x58')]['id']}})[_0x37a0('0x37')](handleEntityNotFound(_0x3399bd,null))[_0x37a0('0x37')](function(_0x2ecd7a){if(_0x2ecd7a){return db[_0x37a0('0x42')][_0x37a0('0x61')]({'where':{'id':_0x2ecd7a['id']},'include':[{'model':db[_0x37a0('0x81')],'as':_0x37a0('0x82'),'include':[{'model':db[_0x37a0('0x74')],'as':_0x37a0('0x89'),'where':{[_0x2ecd7a[_0x37a0('0x7e')]]:_0x7cb754},'limit':0x1,'order':[['updatedAt','DESC']]}]}]})['then'](handleEntityNotFound(_0x3399bd,null))[_0x37a0('0x37')](function(_0x224952){if(_0x224952&&_0x224952['List']){_0x538672=_0x224952['get']({'plain':!![]});if(_0x538672['List']&&_0x538672[_0x37a0('0x82')]['Contacts'][_0x37a0('0x4b')]){return _0x538672['List'][_0x37a0('0x89')][0x0];}return db['CmContact'][_0x37a0('0x5c')](_['defaults'](_0x4ff533[_0x37a0('0x5d')],{'firstName':_0x7cb754,[_0x224952[_0x37a0('0x7e')]]:_0x7cb754,'phone':_0x7cb754,'ListId':_0x538672['ListId']}));}})[_0x37a0('0x37')](handleEntityNotFound(_0x3399bd,null))['then'](function(_0x340b82){if(_0x340b82){_0x81aa37=_0x340b82;return db[_0x37a0('0x8d')]['find']({'where':{'ContactId':_0x81aa37['id'],'closed':![],'OpenchannelAccountId':_0x538672['id']}})[_0x37a0('0x37')](function(_0x21b378){if(_0x21b378){return[_0x21b378,![]];}return db['OpenchannelInteraction'][_0x37a0('0x5c')]({'UserId':_0x4ff533[_0x37a0('0x5f')]['id'],'ContactId':_0x81aa37['id'],'OpenchannelAccountId':_0x538672['id'],'lastMsgDirection':_0x37a0('0xb7'),'Messages':[_['merge'](_0x4ff533['body'],{'read':![],'body':_0x4ff533[_0x37a0('0x5d')][_0x37a0('0x5d')],'OpenchannelAccountId':_0x538672['id'],'UserId':_0x4ff533[_0x37a0('0x5f')]['id'],'ContactId':_0x81aa37['id']})]},{'include':[{'model':db[_0x37a0('0x98')],'as':_0x37a0('0xb8')}]})['then'](function(_0x5d4b41){return[_0x5d4b41,!![]];});});}})[_0x37a0('0x8f')](function(_0x43522d,_0x240146){if(_0x240146){return _0x43522d;}return db[_0x37a0('0x98')]['create'](_['merge'](_0x4ff533['body'],{'read':![],'body':_0x4ff533[_0x37a0('0x5d')][_0x37a0('0x5d')],'OpenchannelAccountId':_0x538672['id'],'OpenchannelInteractionId':_0x43522d['id'],'UserId':_0x4ff533['user']['id'],'ContactId':_0x81aa37['id']}))[_0x37a0('0x37')](function(_0x4b3673){_0x43522d[_0x37a0('0xb9')]['Messages']=[];_0x43522d[_0x37a0('0xb9')][_0x37a0('0xb8')][_0x37a0('0xba')](_0x4b3673[_0x37a0('0xb9')]);return _0x43522d;});});}})[_0x37a0('0x37')](respondWithResult(_0x3399bd,null))[_0x37a0('0x2a')](handleError(_0x3399bd,null));}; \ No newline at end of file +var _0xe824=['Owner','fullname','internal','Tag','color','tag','addAgents','omit','emit','removeAgents','isArray','userOpenchannelAccount:remove','getAgents','body\x20is\x20mandatory\x20and\x20not\x20empty','ListId','out','OpenchannelMessage','Messages','dataValues','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','redis','localhost','./openchannelAccount.socket','register','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','OpenchannelAccount,\x20%s,\x20%s','message','result','catch','sendStatus','end','json','count','offset','status','reject','update','destroy','get','name','send','index','keys','query','filters','model','attributes','fields','length','hasOwnProperty','limit','order','sort','where','pick','filter','merge','type','key','field','options','OpenchannelAccount','includeAll','include','findAll','rows','params','Pause','mandatoryDispositionPause','rawAttributes','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','describe','addDisposition','OpnechannelAccountId','Disposition','getDispositions','findOne','intersection','OpenchannelAccountId','map','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','openchannel','CmContact','ValidationError','difference','createdAt','updatedAt','CompanyId','isNil','from','from\x20is\x20mandatory','Sequelize','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','List','Contacts','OpenchannelApplication','Applications','applications','orderBy','priority','asc','account','defaults','contact','firstName','lastName','threadId','OpenchannelInteraction','externalUrl','ContactId','spread','messageId','interaction','created','autoclose','push','close','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','*,*,*,*','forcedOwnership','startRouting','Start','EventManager','notify','addApplications','sequelize','bulkCreate','findAndCountAll','getApplications','nolimit','getInteractions'];(function(_0x402b10,_0x5608c7){var _0x2f765d=function(_0xbe73c3){while(--_0xbe73c3){_0x402b10['push'](_0x402b10['shift']());}};_0x2f765d(++_0x5608c7);}(_0xe824,0x189));var _0x4e82=function(_0xefb4e,_0xe56689){_0xefb4e=_0xefb4e-0x0;var _0x36c78c=_0xe824[_0xefb4e];return _0x36c78c;};'use strict';var pdf=require(_0x4e82('0x0'));var emlformat=require(_0x4e82('0x1'));var rimraf=require(_0x4e82('0x2'));var zipdir=require(_0x4e82('0x3'));var jsonpatch=require(_0x4e82('0x4'));var rp=require(_0x4e82('0x5'));var moment=require(_0x4e82('0x6'));var BPromise=require('bluebird');var Mustache=require(_0x4e82('0x7'));var util=require(_0x4e82('0x8'));var path=require('path');var sox=require(_0x4e82('0x9'));var csv=require(_0x4e82('0xa'));var ejs=require(_0x4e82('0xb'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x4e82('0xc'));var deskjs=require(_0x4e82('0xd'));var toCsv=require(_0x4e82('0xa'));var querystring=require('querystring');var Papa=require(_0x4e82('0xe'));var Redis=require(_0x4e82('0xf'));var authService=require(_0x4e82('0x10'));var qs=require(_0x4e82('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x4e82('0x12'))(_0x4e82('0x13'));var utils=require(_0x4e82('0x14'));var config=require(_0x4e82('0x15'));var db=require('../../mysqldb')['db'];config[_0x4e82('0x16')]=_['defaults'](config['redis'],{'host':_0x4e82('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x4e82('0x18'))[_0x4e82('0x19')](socket);var jayson=require(_0x4e82('0x1a'));var client=jayson[_0x4e82('0x1b')][_0x4e82('0x1c')]({'port':0x232c});var client9002=jayson['client'][_0x4e82('0x1c')]({'port':0x232a});function checkPasswordPattern(_0x3b0ea8,_0x4bd893,_0x5afdaa){if(_0x5afdaa){var _0x55b8ff=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x55b8ff[_0x4e82('0x1d')](_0x4bd893)){return _0x3b0ea8;}else{throw new Error(_0x4e82('0x1e'));}}else{return _0x3b0ea8;}}function respondWithRpcPromise(_0x5a74e7,_0x3584ac,_0x5c74c0,_0x47f5cb){return new BPromise(function(_0x10f6bd,_0x26678a){var _0x5ca208=_0x47f5cb||client;return _0x5ca208[_0x4e82('0x1f')](_0x5a74e7,_0x5c74c0)[_0x4e82('0x20')](function(_0x277cf0){logger[_0x4e82('0x21')]('OpenchannelAccount,\x20%s,\x20%s',_0x3584ac,_0x4e82('0x22'));logger[_0x4e82('0x23')](_0x4e82('0x24'),_0x3584ac,_0x4e82('0x22'),JSON[_0x4e82('0x25')](_0x277cf0));if(_0x277cf0['error']){if(_0x277cf0[_0x4e82('0x26')][_0x4e82('0x27')]===0x1f4){logger[_0x4e82('0x26')](_0x4e82('0x28'),_0x3584ac,_0x277cf0[_0x4e82('0x26')][_0x4e82('0x29')]);return _0x26678a(_0x277cf0['error'][_0x4e82('0x29')]);}logger['error']('OpenchannelAccount,\x20%s,\x20%s',_0x3584ac,_0x277cf0[_0x4e82('0x26')][_0x4e82('0x29')]);return _0x10f6bd(_0x277cf0[_0x4e82('0x26')][_0x4e82('0x29')]);}else{logger['info'](_0x4e82('0x28'),_0x3584ac,_0x4e82('0x22'));_0x10f6bd(_0x277cf0[_0x4e82('0x2a')][_0x4e82('0x29')]);}})[_0x4e82('0x2b')](function(_0x544edb){logger['error'](_0x4e82('0x28'),_0x3584ac,_0x544edb);_0x26678a(_0x544edb);});});}function respondWithStatusCode(_0x5000f1,_0x14c27a){_0x14c27a=_0x14c27a||0xcc;return function(_0x2c21f2){if(_0x2c21f2){return _0x5000f1[_0x4e82('0x2c')](_0x14c27a);}return _0x5000f1['status'](_0x14c27a)[_0x4e82('0x2d')]();};}function respondWithResult(_0x21afcd,_0x4acf47){_0x4acf47=_0x4acf47||0xc8;return function(_0x34810a){if(_0x34810a){return _0x21afcd['status'](_0x4acf47)[_0x4e82('0x2e')](_0x34810a);}};}function respondWithFilteredResult(_0x28bfea,_0x5c6cbb){return function(_0x372c26){if(_0x372c26){var _0xdd0e3f=_0x372c26[_0x4e82('0x2f')],_0x308d30=_0x5c6cbb[_0x4e82('0x30')],_0x2dd17c=_0x5c6cbb[_0x4e82('0x30')]+_0x5c6cbb['limit'],_0x73fd53;if(_0x2dd17c>=_0xdd0e3f){_0x2dd17c=_0xdd0e3f;_0x73fd53=0xc8;}else{_0x73fd53=0xce;}_0x28bfea[_0x4e82('0x31')](_0x73fd53);return _0x28bfea['set']('Content-Range',_0x308d30+'-'+_0x2dd17c+'/'+_0xdd0e3f)[_0x4e82('0x2e')](_0x372c26);}return null;};}function patchUpdates(_0x383035){return function(_0x2f0fea){try{jsonpatch['apply'](_0x2f0fea,_0x383035,!![]);}catch(_0xa6025a){return BPromise[_0x4e82('0x32')](_0xa6025a);}return _0x2f0fea['save']();};}function saveUpdates(_0x49a627,_0x5ef2f3){return function(_0x5e8165){if(_0x5e8165){return _0x5e8165[_0x4e82('0x33')](_0x49a627)[_0x4e82('0x20')](function(_0x5a9509){return _0x5a9509;});}return null;};}function removeEntity(_0x56127b,_0x30e227){return function(_0x4cdff1){if(_0x4cdff1){return _0x4cdff1[_0x4e82('0x34')]()[_0x4e82('0x20')](function(){var _0x448e38=_0x4cdff1[_0x4e82('0x35')]({'plain':!![]});var _0x11f6ed='OpenchannelAccounts';return db['UserProfileResource'][_0x4e82('0x34')]({'where':{'type':_0x11f6ed,'resourceId':_0x448e38['id']}})['then'](function(){return _0x4cdff1;});})[_0x4e82('0x20')](function(){_0x56127b[_0x4e82('0x31')](0xcc)[_0x4e82('0x2d')]();});}};}function handleEntityNotFound(_0x50a63e,_0x171cac){return function(_0x54c975){if(!_0x54c975){_0x50a63e[_0x4e82('0x2c')](0x194);}return _0x54c975;};}function handleError(_0xd39cf,_0x18f9f2){_0x18f9f2=_0x18f9f2||0x1f4;return function(_0xbd7bb7){logger['error'](_0xbd7bb7['stack']);if(_0xbd7bb7[_0x4e82('0x36')]){delete _0xbd7bb7[_0x4e82('0x36')];}_0xd39cf[_0x4e82('0x31')](_0x18f9f2)[_0x4e82('0x37')](_0xbd7bb7);};}exports[_0x4e82('0x38')]=function(_0x5db927,_0x1a903f){var _0x3138f7={'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x598afc={},_0x2e040c={'count':0x0,'rows':[]};var _0x52c60e=db['OpenchannelAccount']['rawAttributes'];_0x598afc['model']=_[_0x4e82('0x39')](_0x52c60e);_0x598afc[_0x4e82('0x3a')]=_[_0x4e82('0x39')](_0x5db927[_0x4e82('0x3a')]);_0x598afc[_0x4e82('0x3b')]=_['intersection'](_0x598afc[_0x4e82('0x3c')],_0x598afc[_0x4e82('0x3a')]);_0x3138f7[_0x4e82('0x3d')]=_['intersection'](_0x598afc[_0x4e82('0x3c')],qs[_0x4e82('0x3e')](_0x5db927['query'][_0x4e82('0x3e')]));_0x3138f7[_0x4e82('0x3d')]=_0x3138f7[_0x4e82('0x3d')][_0x4e82('0x3f')]?_0x3138f7[_0x4e82('0x3d')]:_0x598afc[_0x4e82('0x3c')];if(!_0x5db927[_0x4e82('0x3a')][_0x4e82('0x40')]('nolimit')){_0x3138f7[_0x4e82('0x41')]=qs['limit'](_0x5db927['query'][_0x4e82('0x41')]);_0x3138f7[_0x4e82('0x30')]=qs['offset'](_0x5db927['query'][_0x4e82('0x30')]);}_0x3138f7[_0x4e82('0x42')]=qs['sort'](_0x5db927['query'][_0x4e82('0x43')]);_0x3138f7[_0x4e82('0x44')]=qs[_0x4e82('0x3b')](_[_0x4e82('0x45')](_0x5db927[_0x4e82('0x3a')],_0x598afc[_0x4e82('0x3b')]));if(_0x5db927[_0x4e82('0x3a')][_0x4e82('0x46')]){_0x3138f7['where']=_[_0x4e82('0x47')](_0x3138f7[_0x4e82('0x44')],{'$or':_['map'](_0x52c60e,function(_0x547510){if(_0x547510[_0x4e82('0x48')][_0x4e82('0x49')]!=='VIRTUAL'){var _0x5a19b4={};_0x5a19b4[_0x547510[_0x4e82('0x4a')]]={'$like':'%'+_0x5db927[_0x4e82('0x3a')]['filter']+'%'};return _0x5a19b4;}})});}_0x3138f7=_[_0x4e82('0x47')]({},_0x3138f7,_0x5db927[_0x4e82('0x4b')]);var _0x104396={'where':_0x3138f7['where']};return db[_0x4e82('0x4c')][_0x4e82('0x2f')](_0x104396)[_0x4e82('0x20')](function(_0x5d3fda){_0x2e040c['count']=_0x5d3fda;if(_0x5db927[_0x4e82('0x3a')][_0x4e82('0x4d')]){_0x3138f7[_0x4e82('0x4e')]=[{'all':!![]}];}return db[_0x4e82('0x4c')][_0x4e82('0x4f')](_0x3138f7);})[_0x4e82('0x20')](function(_0x3ae827){_0x2e040c[_0x4e82('0x50')]=_0x3ae827;return _0x2e040c;})['then'](respondWithFilteredResult(_0x1a903f,_0x3138f7))[_0x4e82('0x2b')](handleError(_0x1a903f,null));};exports['show']=function(_0x185421,_0x50edb8){var _0x5d8605={'raw':![],'where':{'id':_0x185421[_0x4e82('0x51')]['id']},'include':[{'model':db[_0x4e82('0x52')],'as':_0x4e82('0x53')}]},_0x201e0b={};_0x201e0b['model']=_[_0x4e82('0x39')](db[_0x4e82('0x4c')][_0x4e82('0x54')]);_0x201e0b['query']=_[_0x4e82('0x39')](_0x185421['query']);_0x201e0b[_0x4e82('0x3b')]=_['intersection'](_0x201e0b[_0x4e82('0x3c')],_0x201e0b[_0x4e82('0x3a')]);_0x5d8605[_0x4e82('0x3d')]=_['intersection'](_0x201e0b[_0x4e82('0x3c')],qs['fields'](_0x185421[_0x4e82('0x3a')][_0x4e82('0x3e')]));_0x5d8605[_0x4e82('0x3d')]=_0x5d8605['attributes'][_0x4e82('0x3f')]?_0x5d8605[_0x4e82('0x3d')]:_0x201e0b[_0x4e82('0x3c')];if(_0x185421[_0x4e82('0x3a')][_0x4e82('0x4d')]){_0x5d8605[_0x4e82('0x4e')]=[{'all':!![]}];}_0x5d8605=_[_0x4e82('0x47')]({},_0x5d8605,_0x185421['options']);return db['OpenchannelAccount'][_0x4e82('0x55')](_0x5d8605)[_0x4e82('0x20')](handleEntityNotFound(_0x50edb8,null))[_0x4e82('0x20')](respondWithResult(_0x50edb8,null))['catch'](handleError(_0x50edb8,null));};exports[_0x4e82('0x56')]=function(_0x1eca55,_0x223dd7){return db[_0x4e82('0x4c')]['create'](_0x1eca55[_0x4e82('0x57')],{})[_0x4e82('0x20')](function(_0x44b2b6){var _0x2a30ee=_0x1eca55[_0x4e82('0x58')]['get']({'plain':!![]});if(!_0x2a30ee)throw new Error(_0x4e82('0x59'));if(_0x2a30ee[_0x4e82('0x5a')]==='user'){var _0x5d3025=_0x44b2b6[_0x4e82('0x35')]({'plain':!![]});var _0x21d018='OpenchannelAccounts';return db[_0x4e82('0x5b')][_0x4e82('0x55')]({'where':{'name':_0x21d018,'userProfileId':_0x2a30ee[_0x4e82('0x5c')]},'raw':!![]})['then'](function(_0xefab07){if(_0xefab07&&_0xefab07[_0x4e82('0x5d')]===0x0){return db[_0x4e82('0x5e')]['create']({'name':_0x5d3025[_0x4e82('0x36')],'resourceId':_0x5d3025['id'],'type':_0xefab07[_0x4e82('0x36')],'sectionId':_0xefab07['id']},{})['then'](function(){return _0x44b2b6;});}else{return _0x44b2b6;}})[_0x4e82('0x2b')](function(_0x1f883f){logger[_0x4e82('0x26')](_0x4e82('0x5f'),_0x1f883f);throw _0x1f883f;});}return _0x44b2b6;})[_0x4e82('0x20')](respondWithResult(_0x223dd7,0xc9))['catch'](handleError(_0x223dd7,null));};exports['update']=function(_0x3f6c1f,_0xe17ac3){if(_0x3f6c1f[_0x4e82('0x57')]['id']){delete _0x3f6c1f[_0x4e82('0x57')]['id'];}return db[_0x4e82('0x4c')][_0x4e82('0x55')]({'where':{'id':_0x3f6c1f[_0x4e82('0x51')]['id']},'include':[{'model':db[_0x4e82('0x52')],'as':_0x4e82('0x53')}]})['then'](handleEntityNotFound(_0xe17ac3,null))['then'](saveUpdates(_0x3f6c1f[_0x4e82('0x57')],null))[_0x4e82('0x20')](respondWithResult(_0xe17ac3,null))['catch'](handleError(_0xe17ac3,null));};exports[_0x4e82('0x34')]=function(_0x884627,_0x36f8ab){return db[_0x4e82('0x4c')][_0x4e82('0x55')]({'where':{'id':_0x884627[_0x4e82('0x51')]['id']}})[_0x4e82('0x20')](handleEntityNotFound(_0x36f8ab,null))[_0x4e82('0x20')](removeEntity(_0x36f8ab,null))['catch'](handleError(_0x36f8ab,null));};exports[_0x4e82('0x60')]=function(_0x55af77,_0x25c74d){return db[_0x4e82('0x4c')][_0x4e82('0x60')]()[_0x4e82('0x20')](respondWithResult(_0x25c74d,null))[_0x4e82('0x2b')](handleError(_0x25c74d,null));};exports[_0x4e82('0x61')]=function(_0x1a5c6c,_0x2af976,_0x19cdbd){if(_0x1a5c6c['body']['id']){delete _0x1a5c6c['body']['id'];}return db[_0x4e82('0x4c')][_0x4e82('0x55')]({'where':{'id':_0x1a5c6c[_0x4e82('0x51')]['id']}})[_0x4e82('0x20')](handleEntityNotFound(_0x2af976,null))[_0x4e82('0x20')](function(_0x3da788){if(_0x3da788){_0x1a5c6c['body'][_0x4e82('0x62')]=_0x3da788['id'];return db[_0x4e82('0x63')][_0x4e82('0x56')](_0x1a5c6c[_0x4e82('0x57')]);}})['then'](respondWithResult(_0x2af976,null))[_0x4e82('0x2b')](handleError(_0x2af976,null));};exports[_0x4e82('0x64')]=function(_0x118e5d,_0x3ef2fe,_0x52ce5b){var _0x380deb={'raw':![],'where':{}};var _0x169d74={};var _0x438892={'count':0x0,'rows':[]};return db[_0x4e82('0x4c')][_0x4e82('0x65')]({'where':{'id':_0x118e5d[_0x4e82('0x51')]['id']}})['then'](handleEntityNotFound(_0x3ef2fe,null))[_0x4e82('0x20')](function(_0x444455){if(_0x444455){_0x169d74[_0x4e82('0x3c')]=_['keys'](db[_0x4e82('0x63')]['rawAttributes']);_0x169d74['query']=_[_0x4e82('0x39')](_0x118e5d[_0x4e82('0x3a')]);_0x169d74['filters']=_[_0x4e82('0x66')](_0x169d74['model'],_0x169d74[_0x4e82('0x3a')]);_0x380deb[_0x4e82('0x3d')]=_[_0x4e82('0x66')](_0x169d74[_0x4e82('0x3c')],qs['fields'](_0x118e5d['query'][_0x4e82('0x3e')]));_0x380deb['attributes']=_0x380deb[_0x4e82('0x3d')]['length']?_0x380deb[_0x4e82('0x3d')]:_0x169d74['model'];if(!_0x118e5d[_0x4e82('0x3a')][_0x4e82('0x40')]('nolimit')){_0x380deb[_0x4e82('0x41')]=qs[_0x4e82('0x41')](_0x118e5d[_0x4e82('0x3a')][_0x4e82('0x41')]);_0x380deb[_0x4e82('0x30')]=qs['offset'](_0x118e5d[_0x4e82('0x3a')]['offset']);}_0x380deb[_0x4e82('0x42')]=qs[_0x4e82('0x43')](_0x118e5d['query'][_0x4e82('0x43')]);_0x380deb[_0x4e82('0x44')]=qs[_0x4e82('0x3b')](_[_0x4e82('0x45')](_0x118e5d[_0x4e82('0x3a')],_0x169d74[_0x4e82('0x3b')]));_0x380deb[_0x4e82('0x44')][_0x4e82('0x67')]=_0x444455['id'];if(_0x118e5d[_0x4e82('0x3a')][_0x4e82('0x46')]){_0x380deb[_0x4e82('0x44')]=_[_0x4e82('0x47')](_0x380deb[_0x4e82('0x44')],{'$or':_[_0x4e82('0x68')](_0x380deb[_0x4e82('0x3d')],function(_0x47abb8){var _0x26604a={};_0x26604a[_0x47abb8]={'$like':'%'+_0x118e5d['query']['filter']+'%'};return _0x26604a;})});}_0x380deb=_['merge']({},_0x380deb,_0x118e5d[_0x4e82('0x4b')]);return db[_0x4e82('0x63')]['count']({'where':_0x380deb[_0x4e82('0x44')]})['then'](function(_0x5afe82){_0x438892[_0x4e82('0x2f')]=_0x5afe82;if(_0x118e5d[_0x4e82('0x3a')][_0x4e82('0x4d')]){_0x380deb['include']=[{'all':!![]}];}return db['Disposition'][_0x4e82('0x4f')](_0x380deb);})[_0x4e82('0x20')](function(_0x467b0e){_0x438892[_0x4e82('0x50')]=_0x467b0e;return _0x438892;});}})['then'](respondWithFilteredResult(_0x3ef2fe,_0x380deb))[_0x4e82('0x2b')](handleError(_0x3ef2fe,null));};exports[_0x4e82('0x69')]=function(_0x4079c4,_0x4d2cb1,_0x310404){return db['OpenchannelAccount']['find']({'where':{'id':_0x4079c4[_0x4e82('0x51')]['id']}})[_0x4e82('0x20')](handleEntityNotFound(_0x4d2cb1,null))[_0x4e82('0x20')](function(_0x14255d){if(_0x14255d){return _0x14255d['removeDispositions'](_0x4079c4[_0x4e82('0x3a')][_0x4e82('0x6a')]);}})[_0x4e82('0x20')](respondWithStatusCode(_0x4d2cb1,null))[_0x4e82('0x2b')](handleError(_0x4d2cb1,null));};exports[_0x4e82('0x6b')]=function(_0x278371,_0xfea667,_0x17831f){if(_0x278371[_0x4e82('0x57')]['id']){delete _0x278371['body']['id'];}return db[_0x4e82('0x4c')]['find']({'where':{'id':_0x278371[_0x4e82('0x51')]['id']}})['then'](handleEntityNotFound(_0xfea667,null))[_0x4e82('0x20')](function(_0x3e61a4){if(_0x3e61a4){_0x278371[_0x4e82('0x57')][_0x4e82('0x67')]=_0x3e61a4['id'];return db[_0x4e82('0x6c')][_0x4e82('0x56')](_0x278371[_0x4e82('0x57')]);}})[_0x4e82('0x20')](respondWithResult(_0xfea667,null))[_0x4e82('0x2b')](handleError(_0xfea667,null));};exports[_0x4e82('0x6d')]=function(_0x49cf74,_0x3ef261,_0x9aad95){var _0x13471d={'raw':![],'where':{}};var _0x1fb049={};var _0x3b390c={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0x4e82('0x65')]({'where':{'id':_0x49cf74['params']['id']}})[_0x4e82('0x20')](handleEntityNotFound(_0x3ef261,null))['then'](function(_0x578394){if(_0x578394){_0x1fb049[_0x4e82('0x3c')]=_[_0x4e82('0x39')](db[_0x4e82('0x6c')][_0x4e82('0x54')]);_0x1fb049[_0x4e82('0x3a')]=_[_0x4e82('0x39')](_0x49cf74['query']);_0x1fb049[_0x4e82('0x3b')]=_[_0x4e82('0x66')](_0x1fb049[_0x4e82('0x3c')],_0x1fb049[_0x4e82('0x3a')]);_0x13471d[_0x4e82('0x3d')]=_[_0x4e82('0x66')](_0x1fb049[_0x4e82('0x3c')],qs[_0x4e82('0x3e')](_0x49cf74[_0x4e82('0x3a')][_0x4e82('0x3e')]));_0x13471d[_0x4e82('0x3d')]=_0x13471d['attributes'][_0x4e82('0x3f')]?_0x13471d[_0x4e82('0x3d')]:_0x1fb049[_0x4e82('0x3c')];if(!_0x49cf74[_0x4e82('0x3a')]['hasOwnProperty']('nolimit')){_0x13471d['limit']=qs[_0x4e82('0x41')](_0x49cf74['query']['limit']);_0x13471d[_0x4e82('0x30')]=qs['offset'](_0x49cf74[_0x4e82('0x3a')][_0x4e82('0x30')]);}_0x13471d['order']=qs[_0x4e82('0x43')](_0x49cf74[_0x4e82('0x3a')][_0x4e82('0x43')]);_0x13471d[_0x4e82('0x44')]=qs[_0x4e82('0x3b')](_[_0x4e82('0x45')](_0x49cf74[_0x4e82('0x3a')],_0x1fb049[_0x4e82('0x3b')]));_0x13471d['where'][_0x4e82('0x67')]=_0x578394['id'];if(_0x49cf74[_0x4e82('0x3a')][_0x4e82('0x46')]){_0x13471d[_0x4e82('0x44')]=_[_0x4e82('0x47')](_0x13471d[_0x4e82('0x44')],{'$or':_['map'](_0x13471d[_0x4e82('0x3d')],function(_0x4822c6){var _0x5c4b05={};_0x5c4b05[_0x4822c6]={'$like':'%'+_0x49cf74[_0x4e82('0x3a')][_0x4e82('0x46')]+'%'};return _0x5c4b05;})});}_0x13471d=_['merge']({},_0x13471d,_0x49cf74[_0x4e82('0x4b')]);return db[_0x4e82('0x6c')][_0x4e82('0x2f')]({'where':_0x13471d[_0x4e82('0x44')]})['then'](function(_0x4cfe47){_0x3b390c[_0x4e82('0x2f')]=_0x4cfe47;if(_0x49cf74[_0x4e82('0x3a')][_0x4e82('0x4d')]){_0x13471d[_0x4e82('0x4e')]=[{'all':!![]}];}return db['CannedAnswer'][_0x4e82('0x4f')](_0x13471d);})[_0x4e82('0x20')](function(_0x1ae32e){_0x3b390c[_0x4e82('0x50')]=_0x1ae32e;return _0x3b390c;});}})[_0x4e82('0x20')](respondWithFilteredResult(_0x3ef261,_0x13471d))[_0x4e82('0x2b')](handleError(_0x3ef261,null));};exports[_0x4e82('0x6e')]=function(_0x476776,_0x5a8e36,_0x9b3b39){return db['OpenchannelAccount'][_0x4e82('0x55')]({'where':{'id':_0x476776[_0x4e82('0x51')]['id']}})[_0x4e82('0x20')](handleEntityNotFound(_0x5a8e36,null))[_0x4e82('0x20')](function(_0x349285){if(_0x349285){return _0x349285[_0x4e82('0x6e')](_0x476776[_0x4e82('0x3a')]['ids']);}})[_0x4e82('0x20')](respondWithStatusCode(_0x5a8e36,null))[_0x4e82('0x2b')](handleError(_0x5a8e36,null));};exports['notify']=function(_0x30f38f,_0x28b81c,_0x10d854){var _0x2137a0={'body':_0x30f38f[_0x4e82('0x57')],'channel':_0x4e82('0x6f')};var _0x30adbf=[];var _0x190b38=[];var _0x13d829={};var _0x444674=![];return db[_0x4e82('0x70')][_0x4e82('0x60')]()[_0x4e82('0x20')](function(_0x5f575f){if(!_0x5f575f){throw new db['Sequelize'][(_0x4e82('0x71'))]('no\x20available\x20attributes');}_0x30adbf=_[_0x4e82('0x72')](_[_0x4e82('0x39')](_0x5f575f),[_0x4e82('0x73'),_0x4e82('0x74')]);_0x190b38=_[_0x4e82('0x72')](_[_0x4e82('0x39')](_0x5f575f),[_0x4e82('0x73'),_0x4e82('0x74'),_0x4e82('0x75'),'ListId']);if(_0x30f38f[_0x4e82('0x57')]['id']){delete _0x30f38f[_0x4e82('0x57')]['id'];}if(_[_0x4e82('0x76')](_0x30f38f[_0x4e82('0x57')][_0x4e82('0x77')])){throw new db['Sequelize']['ValidationError'](_0x4e82('0x78'));}if(_['isNil'](_0x30f38f[_0x4e82('0x57')][_0x4e82('0x57')])||_0x30f38f['body'][_0x4e82('0x57')]===''){throw new db[(_0x4e82('0x79'))]['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x4e82('0x76')](_0x30f38f['body'][_0x4e82('0x7a')])){throw new db[(_0x4e82('0x79'))][(_0x4e82('0x71'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x190b38);}if(!_[_0x4e82('0x7b')](_0x190b38,_0x30f38f[_0x4e82('0x57')][_0x4e82('0x7a')])){throw new db[(_0x4e82('0x79'))][(_0x4e82('0x71'))](_0x4e82('0x7c')+_0x190b38);}_0x13d829[_0x30f38f['body']['mapKey']]=_0x30f38f[_0x4e82('0x57')][_0x4e82('0x77')];})['then'](function(){return db[_0x4e82('0x4c')][_0x4e82('0x55')]({'where':{'id':_0x30f38f[_0x4e82('0x51')]['id']},'include':[{'model':db['CmList'],'as':_0x4e82('0x7d'),'include':[{'model':db[_0x4e82('0x70')],'as':_0x4e82('0x7e'),'where':_0x13d829,'limit':0x1,'order':[[_0x4e82('0x74'),'DESC']]}]},{'model':db[_0x4e82('0x7f')],'as':_0x4e82('0x80')}]});})[_0x4e82('0x20')](handleEntityNotFound(_0x28b81c,null))[_0x4e82('0x20')](function(_0x34eacf){if(_0x34eacf&&_0x34eacf[_0x4e82('0x7d')]){_0x2137a0['account']=_0x34eacf;_0x2137a0[_0x4e82('0x81')]=_0x34eacf['Applications'];_0x2137a0['list']=_0x34eacf['List'];_0x2137a0[_0x4e82('0x81')]=_[_0x4e82('0x82')](_0x2137a0[_0x4e82('0x81')],[_0x4e82('0x83')],[_0x4e82('0x84')]);if(_0x2137a0['account'][_0x4e82('0x80')]){delete _0x2137a0[_0x4e82('0x85')][_0x4e82('0x80')];}if(_0x2137a0['account'][_0x4e82('0x7d')]&&_0x2137a0[_0x4e82('0x85')][_0x4e82('0x7d')][_0x4e82('0x7e')][_0x4e82('0x3f')]){return _0x2137a0[_0x4e82('0x85')]['List'][_0x4e82('0x7e')][0x0];}var _0x32da61=_[_0x4e82('0x86')](_0x30f38f['body'],{'firstName':_0x30f38f[_0x4e82('0x57')][_0x4e82('0x77')],'ListId':_0x34eacf['ListId']});_0x32da61[_0x30f38f[_0x4e82('0x57')][_0x4e82('0x7a')]]=_0x30f38f['body'][_0x4e82('0x77')];return db[_0x4e82('0x70')][_0x4e82('0x56')](_0x32da61,{'fields':_0x30adbf,'raw':!![]});}})[_0x4e82('0x20')](handleEntityNotFound(_0x28b81c,null))[_0x4e82('0x20')](function(_0x7145db){_0x2137a0[_0x4e82('0x87')]=_0x7145db;if(_0x7145db){var _0x3f716c={'ContactId':_0x7145db['id'],'OpenchannelAccountId':_0x30f38f['params']['id'],'from':(_0x7145db[_0x4e82('0x88')]||'')+'\x20'+(_0x7145db[_0x4e82('0x89')]||'')};var _0x466860={'OpenchannelAccountId':_0x30f38f[_0x4e82('0x51')]['id'],'closed':![]};if(_0x30f38f['body'][_0x4e82('0x8a')]){_0x466860[_0x4e82('0x8a')]=_0x30f38f[_0x4e82('0x57')][_0x4e82('0x8a')];return db[_0x4e82('0x8b')][_0x4e82('0x55')]({'where':_0x466860})['then'](function(_0x484e62){if(_0x484e62){return[_0x484e62,![]];}_0x3f716c[_0x4e82('0x8a')]=_0x30f38f['body'][_0x4e82('0x8a')];_0x3f716c[_0x4e82('0x8c')]=_0x30f38f[_0x4e82('0x57')][_0x4e82('0x8c')];return db[_0x4e82('0x8b')][_0x4e82('0x56')](_0x3f716c)[_0x4e82('0x20')](function(_0x4f4a9a){return[_0x4f4a9a,!![]];});});}else{_0x466860[_0x4e82('0x8a')]=null;}_0x466860[_0x4e82('0x8d')]=_0x7145db['id'];return db[_0x4e82('0x8b')][_0x4e82('0x55')]({'where':_0x466860})[_0x4e82('0x20')](function(_0x4a5502){if(_0x4a5502){return[_0x4a5502,![]];}return db[_0x4e82('0x8b')][_0x4e82('0x56')](_0x3f716c)[_0x4e82('0x20')](function(_0x59bbf9){return[_0x59bbf9,!![]];});});}})[_0x4e82('0x8e')](function(_0x4b5629,_0x215542){if(_0x4b5629){_0x444674=_0x215542;if(!_0x215542){var _0x4180f0={'from':(_0x2137a0[_0x4e82('0x87')]['firstName']||'')+'\x20'+(_0x2137a0['contact'][_0x4e82('0x89')]||'')};if(_0x30f38f['body']['threadId']&&_0x30f38f['body'][_0x4e82('0x8f')]&&_0x30f38f['body'][_0x4e82('0x8a')]!=_0x30f38f['body'][_0x4e82('0x8f')]){_0x4180f0[_0x4e82('0x8a')]=_0x30f38f['body'][_0x4e82('0x8f')];}return _0x4b5629[_0x4e82('0x33')](_0x4180f0);}else{return _0x4b5629;}}})['then'](function(_0x26c5fd){_0x2137a0[_0x4e82('0x90')]=_0x26c5fd[_0x4e82('0x35')]({'plain':!![]});_0x2137a0[_0x4e82('0x90')][_0x4e82('0x91')]=_0x444674;if(_0x2137a0['interaction'][_0x4e82('0x91')]){if(_0x2137a0['account'][_0x4e82('0x92')]){_0x2137a0['applications'][_0x4e82('0x93')]({'id':0x0,'priority':_0x2137a0[_0x4e82('0x81')][_0x4e82('0x3f')]+0x1,'app':_0x4e82('0x94'),'appdata':'unmanaged','interval':'*,*,*,*'});}}return db['OpenchannelMessage'][_0x4e82('0x56')]({'body':_0x30f38f[_0x4e82('0x57')]['body'],'OpenchannelAccountId':_0x30f38f[_0x4e82('0x51')]['id'],'OpenchannelInteractionId':_0x26c5fd['id'],'direction':'in','ContactId':_0x2137a0[_0x4e82('0x87')]['id'],'AttachmentId':_0x30f38f[_0x4e82('0x57')][_0x4e82('0x95')]});})[_0x4e82('0x20')](function(_0x5c080f){_0x2137a0['message']=_0x5c080f;if(_0x2137a0['interaction'][_0x4e82('0x96')]){return db[_0x4e82('0x97')]['find']({'attributes':['id',_0x4e82('0x36')],'where':{'id':_0x2137a0[_0x4e82('0x90')][_0x4e82('0x96')]}})[_0x4e82('0x20')](function(_0x45c162){if(_0x45c162){_0x2137a0[_0x4e82('0x81')][_0x4e82('0x98')]({'id':0x0,'priority':0x0,'app':_0x4e82('0x99'),'appdata':_0x45c162[_0x4e82('0x36')]+','+(_0x2137a0[_0x4e82('0x85')][_0x4e82('0x9a')]||0xa),'interval':_0x4e82('0x9b')});_0x2137a0[_0x4e82('0x9c')]=![];}return respondWithRpcPromise('Start',_0x4e82('0x9d'),_0x2137a0);});}return respondWithRpcPromise(_0x4e82('0x9e'),_0x4e82('0x9d'),_0x2137a0);})[_0x4e82('0x20')](function(_0x1366e0){respondWithRpcPromise(_0x4e82('0x9f'),_0x4e82('0x9f'),{'event':_0x4e82('0xa0'),'message':_0x1366e0},client9002);return _0x1366e0;})[_0x4e82('0x20')](respondWithResult(_0x28b81c,null))[_0x4e82('0x2b')](handleError(_0x28b81c,null));};exports[_0x4e82('0xa1')]=function(_0x37c719,_0x5efdc7,_0x248bc8){return db[_0x4e82('0x4c')][_0x4e82('0x65')]({'where':{'id':_0x37c719[_0x4e82('0x51')]['id']}})[_0x4e82('0x20')](handleEntityNotFound(_0x5efdc7,null))['then'](function(_0x9c35ec){if(_0x9c35ec){return db[_0x4e82('0xa2')]['transaction'](function(_0x2f5409){return db[_0x4e82('0x7f')]['destroy']({'where':{'OpenchannelAccountId':_0x37c719[_0x4e82('0x51')]['id']},'transaction':_0x2f5409})[_0x4e82('0x20')](function(_0x3c4c80){var _0x490785=_[_0x4e82('0x68')](_0x37c719[_0x4e82('0x57')],function(_0x14955a){_0x14955a[_0x4e82('0x67')]=_0x37c719[_0x4e82('0x51')]['id'];return _0x14955a;});return db[_0x4e82('0x7f')][_0x4e82('0xa3')](_0x490785,{'transaction':_0x2f5409});});})['then'](function(){return db[_0x4e82('0x7f')][_0x4e82('0xa4')]({'where':{'OpenchannelAccountId':_0x37c719[_0x4e82('0x51')]['id']},'order':_0x4e82('0x83')});});}})[_0x4e82('0x20')](respondWithResult(_0x5efdc7,null))[_0x4e82('0x2b')](handleError(_0x5efdc7,null));};exports['getApplications']=function(_0x227284,_0x74cb01,_0xe1db0f){var _0x1c92d3={};var _0x274529={};var _0xc24de0;var _0x37248e;return db['OpenchannelAccount']['findOne']({'where':{'id':_0x227284[_0x4e82('0x51')]['id']}})[_0x4e82('0x20')](handleEntityNotFound(_0x74cb01,null))[_0x4e82('0x20')](function(_0xfbc269){if(_0xfbc269){_0xc24de0=_0xfbc269;_0x274529['model']=_[_0x4e82('0x39')](db[_0x4e82('0x7f')][_0x4e82('0x54')]);_0x274529[_0x4e82('0x3a')]=_[_0x4e82('0x39')](_0x227284[_0x4e82('0x3a')]);_0x274529[_0x4e82('0x3b')]=_[_0x4e82('0x66')](_0x274529['model'],_0x274529['query']);_0x1c92d3[_0x4e82('0x3d')]=_[_0x4e82('0x66')](_0x274529['model'],qs['fields'](_0x227284[_0x4e82('0x3a')][_0x4e82('0x3e')]));_0x1c92d3[_0x4e82('0x3d')]=_0x1c92d3[_0x4e82('0x3d')][_0x4e82('0x3f')]?_0x1c92d3[_0x4e82('0x3d')]:_0x274529[_0x4e82('0x3c')];_0x1c92d3['order']=qs[_0x4e82('0x43')](_0x227284['query'][_0x4e82('0x43')]);_0x1c92d3['where']=qs[_0x4e82('0x3b')](_[_0x4e82('0x45')](_0x227284[_0x4e82('0x3a')],_0x274529['filters']));if(_0x227284['query'][_0x4e82('0x46')]){_0x1c92d3[_0x4e82('0x44')]=_[_0x4e82('0x47')](_0x1c92d3[_0x4e82('0x44')],{'$or':_[_0x4e82('0x68')](_0x1c92d3[_0x4e82('0x3d')],function(_0x4e0029){var _0x4d541a={};_0x4d541a[_0x4e0029]={'$like':'%'+_0x227284[_0x4e82('0x3a')][_0x4e82('0x46')]+'%'};return _0x4d541a;})});}_0x1c92d3=_[_0x4e82('0x47')]({},_0x1c92d3,_0x227284[_0x4e82('0x4b')]);return _0xc24de0[_0x4e82('0xa5')](_0x1c92d3);}})[_0x4e82('0x20')](function(_0x1087ff){if(_0x1087ff){_0x37248e=_0x1087ff[_0x4e82('0x3f')];if(!_0x227284[_0x4e82('0x3a')]['hasOwnProperty'](_0x4e82('0xa6'))){_0x1c92d3['limit']=qs[_0x4e82('0x41')](_0x227284[_0x4e82('0x3a')]['limit']);_0x1c92d3['offset']=qs[_0x4e82('0x30')](_0x227284[_0x4e82('0x3a')][_0x4e82('0x30')]);}return _0xc24de0['getApplications'](_0x1c92d3);}})[_0x4e82('0x20')](function(_0x321267){if(_0x321267){return _0x321267?{'count':_0x37248e,'rows':_0x321267}:null;}})[_0x4e82('0x20')](respondWithResult(_0x74cb01,null))[_0x4e82('0x2b')](handleError(_0x74cb01,null));};exports[_0x4e82('0xa7')]=function(_0x49b64a,_0xee0b8b,_0x89de63){var _0x4365b7={'raw':![],'where':{}};var _0x5a72fc={};var _0x4fb65a={'count':0x0,'rows':[]};return db[_0x4e82('0x4c')][_0x4e82('0x65')]({'where':{'id':_0x49b64a['params']['id']}})[_0x4e82('0x20')](handleEntityNotFound(_0xee0b8b,null))[_0x4e82('0x20')](function(_0x1c599c){if(_0x1c599c){_0x5a72fc[_0x4e82('0x3c')]=_['keys'](db[_0x4e82('0x8b')]['rawAttributes']);_0x5a72fc[_0x4e82('0x3a')]=_[_0x4e82('0x39')](_0x49b64a['query']);_0x5a72fc[_0x4e82('0x3b')]=_[_0x4e82('0x66')](_0x5a72fc[_0x4e82('0x3c')],_0x5a72fc[_0x4e82('0x3a')]);_0x4365b7[_0x4e82('0x3d')]=_[_0x4e82('0x66')](_0x5a72fc[_0x4e82('0x3c')],qs[_0x4e82('0x3e')](_0x49b64a['query'][_0x4e82('0x3e')]));_0x4365b7[_0x4e82('0x3d')]=_0x4365b7[_0x4e82('0x3d')][_0x4e82('0x3f')]?_0x4365b7[_0x4e82('0x3d')]:_0x5a72fc['model'];if(!_0x49b64a[_0x4e82('0x3a')][_0x4e82('0x40')](_0x4e82('0xa6'))){_0x4365b7[_0x4e82('0x41')]=qs['limit'](_0x49b64a[_0x4e82('0x3a')][_0x4e82('0x41')]);_0x4365b7[_0x4e82('0x30')]=qs['offset'](_0x49b64a[_0x4e82('0x3a')][_0x4e82('0x30')]);}_0x4365b7[_0x4e82('0x42')]=qs['sort'](_0x49b64a[_0x4e82('0x3a')]['sort']);_0x4365b7[_0x4e82('0x44')]=qs[_0x4e82('0x3b')](_[_0x4e82('0x45')](_0x49b64a[_0x4e82('0x3a')],_0x5a72fc[_0x4e82('0x3b')]));_0x4365b7['where'][_0x4e82('0x67')]=_0x1c599c['id'];if(_0x49b64a[_0x4e82('0x3a')][_0x4e82('0x46')]){_0x4365b7[_0x4e82('0x44')]=_[_0x4e82('0x47')](_0x4365b7['where'],{'$or':_[_0x4e82('0x68')](_0x4365b7['attributes'],function(_0x4c5228){var _0x39156b={};_0x39156b[_0x4c5228]={'$like':'%'+_0x49b64a[_0x4e82('0x3a')][_0x4e82('0x46')]+'%'};return _0x39156b;})});}_0x4365b7=_[_0x4e82('0x47')]({},_0x4365b7,_0x49b64a[_0x4e82('0x4b')]);return db[_0x4e82('0x8b')]['count']({'where':_0x4365b7['where']})[_0x4e82('0x20')](function(_0x5107ad){_0x4fb65a['count']=_0x5107ad;if(_0x49b64a['query'][_0x4e82('0x4d')]){_0x4365b7[_0x4e82('0x4e')]=[{'model':db['CmContact'],'as':'Contact','required':![]},{'model':db[_0x4e82('0x97')],'as':_0x4e82('0xa8'),'attributes':[_0x4e82('0x36'),_0x4e82('0xa9'),_0x4e82('0xaa')],'required':![]},{'model':db[_0x4e82('0xab')],'as':'Tags','attributes':['id',_0x4e82('0x36'),_0x4e82('0xac')],'where':_0x49b64a[_0x4e82('0x3a')]['tag']?{'id':_0x49b64a[_0x4e82('0x3a')][_0x4e82('0xad')]}:undefined,'required':_0x49b64a[_0x4e82('0x3a')][_0x4e82('0xad')]?!![]:![]}];}return db[_0x4e82('0x8b')][_0x4e82('0x4f')](_0x4365b7);})[_0x4e82('0x20')](function(_0xdb5f15){_0x4fb65a['rows']=_0xdb5f15;return _0x4fb65a;});}})[_0x4e82('0x20')](respondWithFilteredResult(_0xee0b8b,_0x4365b7))[_0x4e82('0x2b')](handleError(_0xee0b8b,null));};exports[_0x4e82('0xae')]=function(_0x5666ef,_0x448424,_0x3f9fad){return db[_0x4e82('0x4c')]['find']({'where':{'id':_0x5666ef['params']['id']}})[_0x4e82('0x20')](handleEntityNotFound(_0x448424,null))['then'](function(_0x3fb183){if(_0x3fb183){return _0x3fb183[_0x4e82('0xae')](_0x5666ef[_0x4e82('0x57')][_0x4e82('0x6a')],_[_0x4e82('0xaf')](_0x5666ef['body'],['ids','id'])||{})[_0x4e82('0x8e')](function(_0x1aa0e2){for(var _0x4574a3=0x0;_0x4574a3<_0x5666ef['body'][_0x4e82('0x6a')][_0x4e82('0x3f')];_0x4574a3+=0x1){socket[_0x4e82('0xb0')]('userOpenchannelAccount:save',{'UserId':_0x5666ef[_0x4e82('0x57')][_0x4e82('0x6a')][_0x4574a3],'OpenchannelAccountId':_0x5666ef[_0x4e82('0x51')]['id']});}return _0x1aa0e2;});}})['then'](respondWithResult(_0x448424,null))[_0x4e82('0x2b')](handleError(_0x448424,null));};exports[_0x4e82('0xb1')]=function(_0x4319f6,_0x1d844e,_0x4984ab){return db[_0x4e82('0x4c')][_0x4e82('0x55')]({'where':{'id':_0x4319f6['params']['id']}})['then'](handleEntityNotFound(_0x1d844e,null))[_0x4e82('0x20')](function(_0x1e1f79){if(_0x1e1f79){return _0x1e1f79[_0x4e82('0xb1')](_0x4319f6[_0x4e82('0x3a')][_0x4e82('0x6a')])[_0x4e82('0x20')](function(){if(_[_0x4e82('0xb2')](_0x4319f6['query'][_0x4e82('0x6a')])){for(var _0x3151ca=0x0;_0x3151ca<_0x4319f6[_0x4e82('0x3a')][_0x4e82('0x6a')][_0x4e82('0x3f')];_0x3151ca+=0x1){socket[_0x4e82('0xb0')]('userOpenchannelAccount:remove',{'UserId':Number(_0x4319f6[_0x4e82('0x3a')][_0x4e82('0x6a')][_0x3151ca]),'OpenchannelAccountId':Number(_0x4319f6[_0x4e82('0x51')]['id'])});}}else{socket[_0x4e82('0xb0')](_0x4e82('0xb3'),{'UserId':Number(_0x4319f6['query'][_0x4e82('0x6a')]),'OpenchannelAccountId':Number(_0x4319f6['params']['id'])});}});}})[_0x4e82('0x20')](respondWithStatusCode(_0x1d844e,null))[_0x4e82('0x2b')](handleError(_0x1d844e,null));};exports['getAgents']=function(_0x2385e0,_0x130df7,_0x4b8b70){var _0x58080f={};var _0x19d0fa={};var _0x354eea;var _0x69b0a3;return db[_0x4e82('0x4c')][_0x4e82('0x65')]({'where':{'id':_0x2385e0[_0x4e82('0x51')]['id']}})[_0x4e82('0x20')](handleEntityNotFound(_0x130df7,null))[_0x4e82('0x20')](function(_0x470a71){if(_0x470a71){_0x354eea=_0x470a71;_0x19d0fa['model']=_[_0x4e82('0x39')](db[_0x4e82('0x97')][_0x4e82('0x54')]);_0x19d0fa[_0x4e82('0x3a')]=_[_0x4e82('0x39')](_0x2385e0[_0x4e82('0x3a')]);_0x19d0fa[_0x4e82('0x3b')]=_[_0x4e82('0x66')](_0x19d0fa[_0x4e82('0x3c')],_0x19d0fa['query']);_0x58080f[_0x4e82('0x3d')]=_['intersection'](_0x19d0fa[_0x4e82('0x3c')],qs[_0x4e82('0x3e')](_0x2385e0[_0x4e82('0x3a')][_0x4e82('0x3e')]));_0x58080f[_0x4e82('0x3d')]=_0x58080f[_0x4e82('0x3d')][_0x4e82('0x3f')]?_0x58080f[_0x4e82('0x3d')]:_0x19d0fa['model'];_0x58080f[_0x4e82('0x42')]=qs[_0x4e82('0x43')](_0x2385e0[_0x4e82('0x3a')][_0x4e82('0x43')]);_0x58080f[_0x4e82('0x44')]=qs['filters'](_[_0x4e82('0x45')](_0x2385e0[_0x4e82('0x3a')],_0x19d0fa[_0x4e82('0x3b')]));if(_0x2385e0[_0x4e82('0x3a')]['filter']){_0x58080f['where']=_['merge'](_0x58080f[_0x4e82('0x44')],{'$or':_[_0x4e82('0x68')](_0x58080f['attributes'],function(_0x4987e9){var _0x13a82b={};_0x13a82b[_0x4987e9]={'$like':'%'+_0x2385e0['query']['filter']+'%'};return _0x13a82b;})});}_0x58080f=_[_0x4e82('0x47')]({},_0x58080f,_0x2385e0[_0x4e82('0x4b')]);return _0x354eea[_0x4e82('0xb4')](_0x58080f);}})['then'](function(_0xc75d4e){if(_0xc75d4e){_0x69b0a3=_0xc75d4e[_0x4e82('0x3f')];if(!_0x2385e0[_0x4e82('0x3a')][_0x4e82('0x40')](_0x4e82('0xa6'))){_0x58080f[_0x4e82('0x41')]=qs['limit'](_0x2385e0['query'][_0x4e82('0x41')]);_0x58080f['offset']=qs[_0x4e82('0x30')](_0x2385e0[_0x4e82('0x3a')][_0x4e82('0x30')]);}return _0x354eea[_0x4e82('0xb4')](_0x58080f);}})[_0x4e82('0x20')](function(_0x9f8846){if(_0x9f8846){return _0x9f8846?{'count':_0x69b0a3,'rows':_0x9f8846}:null;}})[_0x4e82('0x20')](respondWithResult(_0x130df7,null))[_0x4e82('0x2b')](handleError(_0x130df7,null));};exports[_0x4e82('0x37')]=function(_0x49c4c1,_0x491d07,_0xb19c74){var _0x557db4,_0x577657,_0x3f4f49;if(_[_0x4e82('0x76')](_0x49c4c1['body']['body'])||_0x49c4c1[_0x4e82('0x57')][_0x4e82('0x57')]===''){throw new db[(_0x4e82('0x79'))]['ValidationError'](_0x4e82('0xb5'));}if(_[_0x4e82('0x76')](_0x49c4c1[_0x4e82('0x57')]['to'])){}_0x557db4=_0x49c4c1['body']['to'];return db[_0x4e82('0x4c')]['findOne']({'where':{'id':_0x49c4c1[_0x4e82('0x51')]['id']}})[_0x4e82('0x20')](handleEntityNotFound(_0x491d07,null))[_0x4e82('0x20')](function(_0x3718b4){if(_0x3718b4){return db[_0x4e82('0x4c')][_0x4e82('0x55')]({'where':{'id':_0x3718b4['id']},'include':[{'model':db['CmList'],'as':_0x4e82('0x7d'),'include':[{'model':db[_0x4e82('0x70')],'as':_0x4e82('0x7e'),'where':{[_0x3718b4[_0x4e82('0x7a')]]:_0x557db4},'limit':0x1,'order':[[_0x4e82('0x74'),'DESC']]}]}]})['then'](handleEntityNotFound(_0x491d07,null))[_0x4e82('0x20')](function(_0x3e05d7){if(_0x3e05d7&&_0x3e05d7[_0x4e82('0x7d')]){_0x577657=_0x3e05d7['get']({'plain':!![]});if(_0x577657[_0x4e82('0x7d')]&&_0x577657['List']['Contacts'][_0x4e82('0x3f')]){return _0x577657[_0x4e82('0x7d')][_0x4e82('0x7e')][0x0];}return db[_0x4e82('0x70')]['create'](_[_0x4e82('0x86')](_0x49c4c1[_0x4e82('0x57')],{'firstName':_0x557db4,[_0x3e05d7[_0x4e82('0x7a')]]:_0x557db4,'phone':_0x557db4,'ListId':_0x577657[_0x4e82('0xb6')]}));}})[_0x4e82('0x20')](handleEntityNotFound(_0x491d07,null))[_0x4e82('0x20')](function(_0x47dda1){if(_0x47dda1){_0x3f4f49=_0x47dda1;return db['OpenchannelInteraction'][_0x4e82('0x55')]({'where':{'ContactId':_0x3f4f49['id'],'closed':![],'OpenchannelAccountId':_0x577657['id']}})['then'](function(_0x53e5ec){if(_0x53e5ec){return[_0x53e5ec,![]];}return db[_0x4e82('0x8b')][_0x4e82('0x56')]({'UserId':_0x49c4c1[_0x4e82('0x58')]['id'],'ContactId':_0x3f4f49['id'],'OpenchannelAccountId':_0x577657['id'],'lastMsgDirection':_0x4e82('0xb7'),'Messages':[_[_0x4e82('0x47')](_0x49c4c1[_0x4e82('0x57')],{'read':![],'body':_0x49c4c1[_0x4e82('0x57')][_0x4e82('0x57')],'OpenchannelAccountId':_0x577657['id'],'UserId':_0x49c4c1[_0x4e82('0x58')]['id'],'ContactId':_0x3f4f49['id']})]},{'include':[{'model':db[_0x4e82('0xb8')],'as':_0x4e82('0xb9')}]})[_0x4e82('0x20')](function(_0x1a478b){return[_0x1a478b,!![]];});});}})['spread'](function(_0x29e689,_0x239d45){if(_0x239d45){return _0x29e689;}return db[_0x4e82('0xb8')][_0x4e82('0x56')](_[_0x4e82('0x47')](_0x49c4c1[_0x4e82('0x57')],{'read':![],'body':_0x49c4c1[_0x4e82('0x57')]['body'],'OpenchannelAccountId':_0x577657['id'],'OpenchannelInteractionId':_0x29e689['id'],'UserId':_0x49c4c1['user']['id'],'ContactId':_0x3f4f49['id']}))[_0x4e82('0x20')](function(_0x5c4c9c){_0x29e689[_0x4e82('0xba')][_0x4e82('0xb9')]=[];_0x29e689[_0x4e82('0xba')][_0x4e82('0xb9')][_0x4e82('0x93')](_0x5c4c9c[_0x4e82('0xba')]);return _0x29e689;});});}})[_0x4e82('0x20')](respondWithResult(_0x491d07,null))[_0x4e82('0x2b')](handleError(_0x491d07,null));}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.events.js b/server/api/openchannelAccount/openchannelAccount.events.js index 65c0574..37cb765 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 _0xf213=['events','../../mysqldb','OpenchannelAccount','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x60222c,_0x1e8b11){var _0x5f1fc0=function(_0x9c0c4c){while(--_0x9c0c4c){_0x60222c['push'](_0x60222c['shift']());}};_0x5f1fc0(++_0x1e8b11);}(_0xf213,0xf2));var _0x3f21=function(_0x2008d9,_0x3d3756){_0x2008d9=_0x2008d9-0x0;var _0x9eb1cc=_0xf213[_0x2008d9];return _0x9eb1cc;};'use strict';var EventEmitter=require(_0x3f21('0x0'));var OpenchannelAccount=require(_0x3f21('0x1'))['db'][_0x3f21('0x2')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0x3f21('0x3')](0x0);var events={'afterCreate':_0x3f21('0x4'),'afterUpdate':_0x3f21('0x5'),'afterDestroy':_0x3f21('0x6')};function emitEvent(_0x3d62df){return function(_0x4d0bde,_0x1e9904,_0x4d5f4e){OpenchannelAccountEvents[_0x3f21('0x7')](_0x3d62df+':'+_0x4d0bde['id'],_0x4d0bde);OpenchannelAccountEvents[_0x3f21('0x7')](_0x3d62df,_0x4d0bde);_0x4d5f4e(null);};}for(var e in events){if(events[_0x3f21('0x8')](e)){var event=events[e];OpenchannelAccount[_0x3f21('0x9')](e,emitEvent(event));}}module[_0x3f21('0xa')]=OpenchannelAccountEvents; \ No newline at end of file +var _0x979a=['../../mysqldb','setMaxListeners','save','update','emit','hasOwnProperty','hook','exports','events'];(function(_0x562c92,_0x3e518d){var _0x2cf254=function(_0x10e224){while(--_0x10e224){_0x562c92['push'](_0x562c92['shift']());}};_0x2cf254(++_0x3e518d);}(_0x979a,0x104));var _0xa979=function(_0x45138b,_0xec2bd6){_0x45138b=_0x45138b-0x0;var _0x398884=_0x979a[_0x45138b];return _0x398884;};'use strict';var EventEmitter=require(_0xa979('0x0'));var OpenchannelAccount=require(_0xa979('0x1'))['db']['OpenchannelAccount'];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0xa979('0x2')](0x0);var events={'afterCreate':_0xa979('0x3'),'afterUpdate':_0xa979('0x4'),'afterDestroy':'remove'};function emitEvent(_0x80951c){return function(_0x4acfc3,_0x2f8442,_0x29453d){OpenchannelAccountEvents[_0xa979('0x5')](_0x80951c+':'+_0x4acfc3['id'],_0x4acfc3);OpenchannelAccountEvents[_0xa979('0x5')](_0x80951c,_0x4acfc3);_0x29453d(null);};}for(var e in events){if(events[_0xa979('0x6')](e)){var event=events[e];OpenchannelAccount[_0xa979('0x7')](e,emitEvent(event));}}module[_0xa979('0x8')]=OpenchannelAccountEvents; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.model.js b/server/api/openchannelAccount/openchannelAccount.model.js index 51bdbc9..235d2d8 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 _0x958f=['path','./openchannelAccount.attributes','exports','OpenchannelAccount','openchannel_accounts','lodash','../../config/logger','moment','bluebird','request-promise'];(function(_0x22d260,_0x5f59af){var _0x122064=function(_0x2c9876){while(--_0x2c9876){_0x22d260['push'](_0x22d260['shift']());}};_0x122064(++_0x5f59af);}(_0x958f,0x19f));var _0xf958=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0x958f[_0x1cc8fe];return _0x230054;};'use strict';var _=require(_0xf958('0x0'));var util=require('util');var logger=require(_0xf958('0x1'))('api');var moment=require(_0xf958('0x2'));var BPromise=require(_0xf958('0x3'));var rp=require(_0xf958('0x4'));var fs=require('fs');var path=require(_0xf958('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xf958('0x6'));module[_0xf958('0x7')]=function(_0x1898d5,_0x399273){return _0x1898d5['define'](_0xf958('0x8'),attributes,{'tableName':_0xf958('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd02c=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelAccount.attributes','exports','define','openchannel_accounts','lodash','../../config/logger','api'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xd02c,0x135));var _0xcd02=function(_0x58245d,_0x2b7846){_0x58245d=_0x58245d-0x0;var _0x38eb5d=_0xd02c[_0x58245d];return _0x38eb5d;};'use strict';var _=require(_0xcd02('0x0'));var util=require('util');var logger=require(_0xcd02('0x1'))(_0xcd02('0x2'));var moment=require(_0xcd02('0x3'));var BPromise=require(_0xcd02('0x4'));var rp=require(_0xcd02('0x5'));var fs=require('fs');var path=require(_0xcd02('0x6'));var rimraf=require(_0xcd02('0x7'));var config=require(_0xcd02('0x8'));var attributes=require(_0xcd02('0x9'));module[_0xcd02('0xa')]=function(_0x5136a1,_0x1c522c){return _0x5136a1[_0xcd02('0xb')]('OpenchannelAccount',attributes,{'tableName':_0xcd02('0xc'),'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 b6bde4d..e55a7db 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 _0x20f6=['OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','lodash','util','bluebird','ioredis','../../config/utils','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','./openchannelAccount.socket','register','request','then','info'];(function(_0x38583b,_0x2f67e7){var _0x4925b2=function(_0x382730){while(--_0x382730){_0x38583b['push'](_0x38583b['shift']());}};_0x4925b2(++_0x2f67e7);}(_0x20f6,0xf8));var _0x620f=function(_0x1fb1a1,_0xbb3e83){_0x1fb1a1=_0x1fb1a1-0x0;var _0x3d47bf=_0x20f6[_0x1fb1a1];return _0x3d47bf;};'use strict';var _=require(_0x620f('0x0'));var util=require(_0x620f('0x1'));var moment=require('moment');var BPromise=require(_0x620f('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x620f('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x620f('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x620f('0x5'));var jayson=require(_0x620f('0x6'));var client=jayson['client']['http']({'port':0x232a});config[_0x620f('0x7')]=_[_0x620f('0x8')](config['redis'],{'host':_0x620f('0x9'),'port':0x18eb});var socket=require(_0x620f('0xa'))(new Redis(config['redis']));require(_0x620f('0xb'))[_0x620f('0xc')](socket);function respondWithRpcPromise(_0x219249,_0x47d183,_0x28629c){return new BPromise(function(_0x46feb4,_0x260554){return client[_0x620f('0xd')](_0x219249,_0x28629c)[_0x620f('0xe')](function(_0x4b2130){logger[_0x620f('0xf')](_0x620f('0x10'),_0x47d183,_0x620f('0x11'));logger[_0x620f('0x12')]('OpenchannelAccount,\x20%s,\x20%s,\x20%s',_0x47d183,_0x620f('0x11'),JSON['stringify'](_0x4b2130));if(_0x4b2130[_0x620f('0x13')]){if(_0x4b2130[_0x620f('0x13')][_0x620f('0x14')]===0x1f4){logger[_0x620f('0x13')](_0x620f('0x10'),_0x47d183,_0x4b2130[_0x620f('0x13')][_0x620f('0x15')]);return _0x260554(_0x4b2130[_0x620f('0x13')][_0x620f('0x15')]);}logger[_0x620f('0x13')](_0x620f('0x10'),_0x47d183,_0x4b2130[_0x620f('0x13')][_0x620f('0x15')]);return _0x46feb4(_0x4b2130[_0x620f('0x13')][_0x620f('0x15')]);}else{logger[_0x620f('0xf')]('OpenchannelAccount,\x20%s,\x20%s',_0x47d183,_0x620f('0x11'));_0x46feb4(_0x4b2130[_0x620f('0x16')][_0x620f('0x15')]);}})[_0x620f('0x17')](function(_0x13b1fe){logger['error']('OpenchannelAccount,\x20%s,\x20%s',_0x47d183,_0x13b1fe);_0x260554(_0x13b1fe);});});} \ No newline at end of file +var _0xefa4=['rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','./openchannelAccount.socket','request','then','info','OpenchannelAccount,\x20%s,\x20%s','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','randomstring','../../mysqldb','../../config/logger'];(function(_0x4a332a,_0x50e792){var _0x84c2d4=function(_0x5e32ac){while(--_0x5e32ac){_0x4a332a['push'](_0x4a332a['shift']());}};_0x84c2d4(++_0x50e792);}(_0xefa4,0x193));var _0x4efa=function(_0x5e86b5,_0x44cc57){_0x5e86b5=_0x5e86b5-0x0;var _0x4cfa75=_0xefa4[_0x5e86b5];return _0x4cfa75;};'use strict';var _=require(_0x4efa('0x0'));var util=require(_0x4efa('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x4efa('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4efa('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x4efa('0x4'))(_0x4efa('0x5'));var config=require(_0x4efa('0x6'));var jayson=require(_0x4efa('0x7'));var client=jayson['client'][_0x4efa('0x8')]({'port':0x232a});config[_0x4efa('0x9')]=_[_0x4efa('0xa')](config[_0x4efa('0x9')],{'host':_0x4efa('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4efa('0x9')]));require(_0x4efa('0xc'))['register'](socket);function respondWithRpcPromise(_0x3b55ce,_0xb1ae01,_0x3d7ad2){return new BPromise(function(_0x7401c0,_0x3362d7){return client[_0x4efa('0xd')](_0x3b55ce,_0x3d7ad2)[_0x4efa('0xe')](function(_0x26377f){logger[_0x4efa('0xf')](_0x4efa('0x10'),_0xb1ae01,'request\x20sent');logger[_0x4efa('0x11')](_0x4efa('0x12'),_0xb1ae01,'request\x20sent',JSON[_0x4efa('0x13')](_0x26377f));if(_0x26377f[_0x4efa('0x14')]){if(_0x26377f[_0x4efa('0x14')][_0x4efa('0x15')]===0x1f4){logger[_0x4efa('0x14')](_0x4efa('0x10'),_0xb1ae01,_0x26377f[_0x4efa('0x14')]['message']);return _0x3362d7(_0x26377f[_0x4efa('0x14')][_0x4efa('0x16')]);}logger[_0x4efa('0x14')](_0x4efa('0x10'),_0xb1ae01,_0x26377f[_0x4efa('0x14')][_0x4efa('0x16')]);return _0x7401c0(_0x26377f['error'][_0x4efa('0x16')]);}else{logger[_0x4efa('0xf')](_0x4efa('0x10'),_0xb1ae01,'request\x20sent');_0x7401c0(_0x26377f[_0x4efa('0x17')][_0x4efa('0x16')]);}})['catch'](function(_0x1715a6){logger['error'](_0x4efa('0x10'),_0xb1ae01,_0x1715a6);_0x3362d7(_0x1715a6);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.socket.js b/server/api/openchannelAccount/openchannelAccount.socket.js index 692a74f..18bce24 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 _0x4042=['emit','removeListener','length','openchannelAccount:','./openchannelAccount.events','save','update'];(function(_0xba8165,_0x3db9ff){var _0x286a22=function(_0x4f6e92){while(--_0x4f6e92){_0xba8165['push'](_0xba8165['shift']());}};_0x286a22(++_0x3db9ff);}(_0x4042,0x9e));var _0x2404=function(_0x3eecf2,_0x444f6a){_0x3eecf2=_0x3eecf2-0x0;var _0x8c26ba=_0x4042[_0x3eecf2];return _0x8c26ba;};'use strict';var OpenchannelAccountEvents=require(_0x2404('0x0'));var events=[_0x2404('0x1'),'remove',_0x2404('0x2')];function createListener(_0x5237d2,_0x488be4){return function(_0x1534cc){_0x488be4[_0x2404('0x3')](_0x5237d2,_0x1534cc);};}function removeListener(_0x540c9d,_0x216be1){return function(){OpenchannelAccountEvents[_0x2404('0x4')](_0x540c9d,_0x216be1);};}exports['register']=function(_0x465ff8){for(var _0x21cb38=0x0,_0x47260c=events[_0x2404('0x5')];_0x21cb38<_0x47260c;_0x21cb38++){var _0x616f42=events[_0x21cb38];var _0xbc6690=createListener(_0x2404('0x6')+_0x616f42,_0x465ff8);OpenchannelAccountEvents['on'](_0x616f42,_0xbc6690);}}; \ No newline at end of file +var _0x6616=['remove','update','emit','removeListener','register','length','./openchannelAccount.events'];(function(_0x16e95d,_0x523f56){var _0x2e97f4=function(_0x1cf79b){while(--_0x1cf79b){_0x16e95d['push'](_0x16e95d['shift']());}};_0x2e97f4(++_0x523f56);}(_0x6616,0x12c));var _0x6661=function(_0x5779d9,_0x280a4b){_0x5779d9=_0x5779d9-0x0;var _0x888243=_0x6616[_0x5779d9];return _0x888243;};'use strict';var OpenchannelAccountEvents=require(_0x6661('0x0'));var events=['save',_0x6661('0x1'),_0x6661('0x2')];function createListener(_0x5461db,_0x3f6705){return function(_0x14006e){_0x3f6705[_0x6661('0x3')](_0x5461db,_0x14006e);};}function removeListener(_0x39d39e,_0x1538c1){return function(){OpenchannelAccountEvents[_0x6661('0x4')](_0x39d39e,_0x1538c1);};}exports[_0x6661('0x5')]=function(_0x29a202){for(var _0x456131=0x0,_0x39544b=events[_0x6661('0x6')];_0x456131<_0x39544b;_0x456131++){var _0x354796=events[_0x456131];var _0x17f0ae=createListener('openchannelAccount:'+_0x354796,_0x29a202);OpenchannelAccountEvents['on'](_0x354796,_0x17f0ae);}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/index.js b/server/api/openchannelApplication/index.js index 4d88ddf..5153375 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 _0x2ff6=['destroy','multer','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelApplication.controller','get','isAuthenticated','index','/:id','show','post','create'];(function(_0x1fb82e,_0x4bcd5b){var _0x3c1ac5=function(_0x4ac066){while(--_0x4ac066){_0x1fb82e['push'](_0x1fb82e['shift']());}};_0x3c1ac5(++_0x4bcd5b);}(_0x2ff6,0x1e1));var _0x62ff=function(_0x1af358,_0x20269d){_0x1af358=_0x1af358-0x0;var _0x24b0fb=_0x2ff6[_0x1af358];return _0x24b0fb;};'use strict';var multer=require(_0x62ff('0x0'));var util=require(_0x62ff('0x1'));var path=require(_0x62ff('0x2'));var timeout=require(_0x62ff('0x3'));var express=require('express');var router=express['Router']();var auth=require(_0x62ff('0x4'));var interaction=require(_0x62ff('0x5'));var config=require(_0x62ff('0x6'));var controller=require(_0x62ff('0x7'));router[_0x62ff('0x8')]('/',auth[_0x62ff('0x9')](),controller[_0x62ff('0xa')]);router[_0x62ff('0x8')](_0x62ff('0xb'),auth[_0x62ff('0x9')](),controller[_0x62ff('0xc')]);router[_0x62ff('0xd')]('/',auth[_0x62ff('0x9')](),controller[_0x62ff('0xe')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router['delete'](_0x62ff('0xb'),auth[_0x62ff('0x9')](),controller[_0x62ff('0xf')]);module['exports']=router; \ No newline at end of file +var _0xb98d=['isAuthenticated','show','post','create','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','./openchannelApplication.controller','get'];(function(_0x8ea0da,_0x1ce4cf){var _0x1e1a43=function(_0x1626ff){while(--_0x1626ff){_0x8ea0da['push'](_0x8ea0da['shift']());}};_0x1e1a43(++_0x1ce4cf);}(_0xb98d,0x171));var _0xdb98=function(_0x4572fc,_0x3c5f49){_0x4572fc=_0x4572fc-0x0;var _0x25f2f5=_0xb98d[_0x4572fc];return _0x25f2f5;};'use strict';var multer=require(_0xdb98('0x0'));var util=require(_0xdb98('0x1'));var path=require(_0xdb98('0x2'));var timeout=require(_0xdb98('0x3'));var express=require(_0xdb98('0x4'));var router=express[_0xdb98('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0xdb98('0x6'));var config=require('../../config/environment');var controller=require(_0xdb98('0x7'));router[_0xdb98('0x8')]('/',auth[_0xdb98('0x9')](),controller['index']);router[_0xdb98('0x8')]('/:id',auth[_0xdb98('0x9')](),controller[_0xdb98('0xa')]);router[_0xdb98('0xb')]('/',auth[_0xdb98('0x9')](),controller[_0xdb98('0xc')]);router['put'](_0xdb98('0xd'),auth[_0xdb98('0x9')](),controller[_0xdb98('0xe')]);router[_0xdb98('0xf')]('/:id',auth['isAuthenticated'](),controller[_0xdb98('0x10')]);module[_0xdb98('0x11')]=router; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.attributes.js b/server/api/openchannelApplication/openchannelApplication.attributes.js index edc1e59..abe93d2 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 _0x77d5=['*,*,*,*','INTEGER','STRING','noop','TEXT'];(function(_0x381589,_0x27a707){var _0x2a075d=function(_0x4ea19d){while(--_0x4ea19d){_0x381589['push'](_0x381589['shift']());}};_0x2a075d(++_0x27a707);}(_0x77d5,0x17d));var _0x577d=function(_0x2b0437,_0x167267){_0x2b0437=_0x2b0437-0x0;var _0x256e04=_0x77d5[_0x2b0437];return _0x256e04;};'use strict';var Sequelize=require('sequelize');module['exports']={'priority':{'type':Sequelize[_0x577d('0x0')],'allowNull':![]},'app':{'type':Sequelize[_0x577d('0x1')],'allowNull':![],'defaultValue':_0x577d('0x2')},'appdata':{'type':Sequelize[_0x577d('0x3')]()},'description':{'type':Sequelize[_0x577d('0x1')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x577d('0x4')}}; \ No newline at end of file +var _0xcd8f=['exports','INTEGER','STRING','noop','sequelize'];(function(_0x4556bc,_0x11c9dd){var _0x51a4d3=function(_0x36bef9){while(--_0x36bef9){_0x4556bc['push'](_0x4556bc['shift']());}};_0x51a4d3(++_0x11c9dd);}(_0xcd8f,0x1bc));var _0xfcd8=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xcd8f[_0x3ab51d];return _0x29a04e;};'use strict';var Sequelize=require(_0xfcd8('0x0'));module[_0xfcd8('0x1')]={'priority':{'type':Sequelize[_0xfcd8('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xfcd8('0x3')],'allowNull':![],'defaultValue':_0xfcd8('0x4')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xfcd8('0x3')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.controller.js b/server/api/openchannelApplication/openchannelApplication.controller.js index 18aec89..37bdcde 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 _0x1fb1=['length','find','create','body','html-pdf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','json','count','offset','limit','set','apply','save','update','then','destroy','sendStatus','error','stack','name','send','index','OpenchannelApplication','rawAttributes','model','keys','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','key','VIRTUAL','field','options','includeAll','include','findAll','rows','catch','show','params'];(function(_0x537782,_0x3fb5c0){var _0x42f142=function(_0x13ad59){while(--_0x13ad59){_0x537782['push'](_0x537782['shift']());}};_0x42f142(++_0x3fb5c0);}(_0x1fb1,0x98));var _0x11fb=function(_0x5530d5,_0x4e1f72){_0x5530d5=_0x5530d5-0x0;var _0x1c560a=_0x1fb1[_0x5530d5];return _0x1c560a;};'use strict';var pdf=require(_0x11fb('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x11fb('0x1'));var rp=require(_0x11fb('0x2'));var moment=require(_0x11fb('0x3'));var BPromise=require(_0x11fb('0x4'));var Mustache=require(_0x11fb('0x5'));var util=require('util');var path=require(_0x11fb('0x6'));var sox=require(_0x11fb('0x7'));var csv=require(_0x11fb('0x8'));var ejs=require(_0x11fb('0x9'));var fs=require('fs');var _=require(_0x11fb('0xa'));var squel=require('squel');var crypto=require(_0x11fb('0xb'));var jsforce=require(_0x11fb('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x11fb('0x8'));var querystring=require(_0x11fb('0xd'));var Papa=require(_0x11fb('0xe'));var Redis=require(_0x11fb('0xf'));var authService=require(_0x11fb('0x10'));var qs=require(_0x11fb('0x11'));var as=require(_0x11fb('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x11fb('0x13'))(_0x11fb('0x14'));var utils=require(_0x11fb('0x15'));var config=require(_0x11fb('0x16'));var db=require(_0x11fb('0x17'))['db'];function respondWithStatusCode(_0x32f49f,_0x5aa97d){_0x5aa97d=_0x5aa97d||0xcc;return function(_0x2edae6){if(_0x2edae6){return _0x32f49f['sendStatus'](_0x5aa97d);}return _0x32f49f[_0x11fb('0x18')](_0x5aa97d)['end']();};}function respondWithResult(_0x467548,_0x375ac3){_0x375ac3=_0x375ac3||0xc8;return function(_0x33ef03){if(_0x33ef03){return _0x467548[_0x11fb('0x18')](_0x375ac3)[_0x11fb('0x19')](_0x33ef03);}};}function respondWithFilteredResult(_0x2c0b4f,_0x159056){return function(_0x3fb3f1){if(_0x3fb3f1){var _0x53da09=_0x3fb3f1[_0x11fb('0x1a')],_0x169a41=_0x159056[_0x11fb('0x1b')],_0x13057f=_0x159056[_0x11fb('0x1b')]+_0x159056[_0x11fb('0x1c')],_0x244d8a;if(_0x13057f>=_0x53da09){_0x13057f=_0x53da09;_0x244d8a=0xc8;}else{_0x244d8a=0xce;}_0x2c0b4f['status'](_0x244d8a);return _0x2c0b4f[_0x11fb('0x1d')]('Content-Range',_0x169a41+'-'+_0x13057f+'/'+_0x53da09)['json'](_0x3fb3f1);}return null;};}function patchUpdates(_0x4ac0f3){return function(_0x25264a){try{jsonpatch[_0x11fb('0x1e')](_0x25264a,_0x4ac0f3,!![]);}catch(_0x27eba1){return BPromise['reject'](_0x27eba1);}return _0x25264a[_0x11fb('0x1f')]();};}function saveUpdates(_0x348d18,_0x442ad0){return function(_0x2fd14d){if(_0x2fd14d){return _0x2fd14d[_0x11fb('0x20')](_0x348d18)[_0x11fb('0x21')](function(_0x4c4993){return _0x4c4993;});}return null;};}function removeEntity(_0x5f1d4d,_0x55379b){return function(_0x180a09){if(_0x180a09){return _0x180a09[_0x11fb('0x22')]()[_0x11fb('0x21')](function(){_0x5f1d4d[_0x11fb('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x511109,_0x2ef09c){return function(_0x4eafef){if(!_0x4eafef){_0x511109[_0x11fb('0x23')](0x194);}return _0x4eafef;};}function handleError(_0x5d5af0,_0x2fcfe1){_0x2fcfe1=_0x2fcfe1||0x1f4;return function(_0x41a5f8){logger[_0x11fb('0x24')](_0x41a5f8[_0x11fb('0x25')]);if(_0x41a5f8[_0x11fb('0x26')]){delete _0x41a5f8['name'];}_0x5d5af0['status'](_0x2fcfe1)[_0x11fb('0x27')](_0x41a5f8);};}exports[_0x11fb('0x28')]=function(_0x4b340d,_0x2eac01){var _0x17f32e={},_0x4f2cec={},_0x413ef3={'count':0x0,'rows':[]};var _0x1b8783=db[_0x11fb('0x29')][_0x11fb('0x2a')];_0x4f2cec[_0x11fb('0x2b')]=_['keys'](_0x1b8783);_0x4f2cec['query']=_[_0x11fb('0x2c')](_0x4b340d[_0x11fb('0x2d')]);_0x4f2cec[_0x11fb('0x2e')]=_[_0x11fb('0x2f')](_0x4f2cec[_0x11fb('0x2b')],_0x4f2cec[_0x11fb('0x2d')]);_0x17f32e['attributes']=_[_0x11fb('0x2f')](_0x4f2cec[_0x11fb('0x2b')],qs[_0x11fb('0x30')](_0x4b340d[_0x11fb('0x2d')][_0x11fb('0x30')]));_0x17f32e[_0x11fb('0x31')]=_0x17f32e[_0x11fb('0x31')]['length']?_0x17f32e[_0x11fb('0x31')]:_0x4f2cec['model'];if(!_0x4b340d[_0x11fb('0x2d')][_0x11fb('0x32')](_0x11fb('0x33'))){_0x17f32e['limit']=qs['limit'](_0x4b340d['query'][_0x11fb('0x1c')]);_0x17f32e[_0x11fb('0x1b')]=qs[_0x11fb('0x1b')](_0x4b340d[_0x11fb('0x2d')]['offset']);}_0x17f32e[_0x11fb('0x34')]=qs[_0x11fb('0x35')](_0x4b340d['query'][_0x11fb('0x35')]);_0x17f32e[_0x11fb('0x36')]=qs[_0x11fb('0x2e')](_[_0x11fb('0x37')](_0x4b340d[_0x11fb('0x2d')],_0x4f2cec[_0x11fb('0x2e')]));if(_0x4b340d[_0x11fb('0x2d')][_0x11fb('0x38')]){_0x17f32e[_0x11fb('0x36')]=_[_0x11fb('0x39')](_0x17f32e[_0x11fb('0x36')],{'$or':_['map'](_0x1b8783,function(_0x8c897b){if(_0x8c897b[_0x11fb('0x3a')][_0x11fb('0x3b')]!==_0x11fb('0x3c')){var _0x20e6cd={};_0x20e6cd[_0x8c897b[_0x11fb('0x3d')]]={'$like':'%'+_0x4b340d[_0x11fb('0x2d')][_0x11fb('0x38')]+'%'};return _0x20e6cd;}})});}_0x17f32e=_['merge']({},_0x17f32e,_0x4b340d[_0x11fb('0x3e')]);var _0x1c542d={'where':_0x17f32e[_0x11fb('0x36')]};return db[_0x11fb('0x29')][_0x11fb('0x1a')](_0x1c542d)['then'](function(_0x53c8dc){_0x413ef3[_0x11fb('0x1a')]=_0x53c8dc;if(_0x4b340d['query'][_0x11fb('0x3f')]){_0x17f32e[_0x11fb('0x40')]=[{'all':!![]}];}return db[_0x11fb('0x29')][_0x11fb('0x41')](_0x17f32e);})[_0x11fb('0x21')](function(_0x6a1676){_0x413ef3[_0x11fb('0x42')]=_0x6a1676;return _0x413ef3;})['then'](respondWithFilteredResult(_0x2eac01,_0x17f32e))[_0x11fb('0x43')](handleError(_0x2eac01,null));};exports[_0x11fb('0x44')]=function(_0x15f93c,_0x2ac888){var _0x3a5a07={'raw':!![],'where':{'id':_0x15f93c[_0x11fb('0x45')]['id']}},_0x2fabd7={};_0x2fabd7[_0x11fb('0x2b')]=_[_0x11fb('0x2c')](db[_0x11fb('0x29')]['rawAttributes']);_0x2fabd7[_0x11fb('0x2d')]=_[_0x11fb('0x2c')](_0x15f93c[_0x11fb('0x2d')]);_0x2fabd7['filters']=_[_0x11fb('0x2f')](_0x2fabd7['model'],_0x2fabd7['query']);_0x3a5a07[_0x11fb('0x31')]=_[_0x11fb('0x2f')](_0x2fabd7[_0x11fb('0x2b')],qs[_0x11fb('0x30')](_0x15f93c[_0x11fb('0x2d')][_0x11fb('0x30')]));_0x3a5a07[_0x11fb('0x31')]=_0x3a5a07[_0x11fb('0x31')][_0x11fb('0x46')]?_0x3a5a07[_0x11fb('0x31')]:_0x2fabd7[_0x11fb('0x2b')];if(_0x15f93c[_0x11fb('0x2d')][_0x11fb('0x3f')]){_0x3a5a07[_0x11fb('0x40')]=[{'all':!![]}];}_0x3a5a07=_[_0x11fb('0x39')]({},_0x3a5a07,_0x15f93c['options']);return db[_0x11fb('0x29')][_0x11fb('0x47')](_0x3a5a07)[_0x11fb('0x21')](handleEntityNotFound(_0x2ac888,null))[_0x11fb('0x21')](respondWithResult(_0x2ac888,null))[_0x11fb('0x43')](handleError(_0x2ac888,null));};exports[_0x11fb('0x48')]=function(_0x4f4f5c,_0x2dfe85){return db[_0x11fb('0x29')]['create'](_0x4f4f5c[_0x11fb('0x49')],{})['then'](respondWithResult(_0x2dfe85,0xc9))['catch'](handleError(_0x2dfe85,null));};exports['update']=function(_0x5b5f93,_0x36c542){if(_0x5b5f93[_0x11fb('0x49')]['id']){delete _0x5b5f93[_0x11fb('0x49')]['id'];}return db[_0x11fb('0x29')][_0x11fb('0x47')]({'where':{'id':_0x5b5f93[_0x11fb('0x45')]['id']}})[_0x11fb('0x21')](handleEntityNotFound(_0x36c542,null))[_0x11fb('0x21')](saveUpdates(_0x5b5f93[_0x11fb('0x49')],null))['then'](respondWithResult(_0x36c542,null))[_0x11fb('0x43')](handleError(_0x36c542,null));};exports['destroy']=function(_0xf29677,_0xb58ee3){return db['OpenchannelApplication'][_0x11fb('0x47')]({'where':{'id':_0xf29677[_0x11fb('0x45')]['id']}})[_0x11fb('0x21')](handleEntityNotFound(_0xb58ee3,null))['then'](removeEntity(_0xb58ee3,null))[_0x11fb('0x43')](handleError(_0xb58ee3,null));}; \ No newline at end of file +var _0x15a2=['filters','pick','filter','where','merge','map','type','key','options','includeAll','catch','params','create','body','destroy','find','html-pdf','zip-dir','fast-json-patch','moment','path','sox','to-csv','squel','crypto','jsforce','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','json','count','offset','limit','set','Content-Range','reject','save','update','then','end','stack','name','index','OpenchannelApplication','rawAttributes','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order'];(function(_0x249582,_0x4fef78){var _0x54fc2e=function(_0x36c36b){while(--_0x36c36b){_0x249582['push'](_0x249582['shift']());}};_0x54fc2e(++_0x4fef78);}(_0x15a2,0x8c));var _0x215a=function(_0x58d5ac,_0x11c4bc){_0x58d5ac=_0x58d5ac-0x0;var _0x37985c=_0x15a2[_0x58d5ac];return _0x37985c;};'use strict';var pdf=require(_0x215a('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x215a('0x1'));var jsonpatch=require(_0x215a('0x2'));var rp=require('request-promise');var moment=require(_0x215a('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x215a('0x4'));var sox=require(_0x215a('0x5'));var csv=require(_0x215a('0x6'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x215a('0x7'));var crypto=require(_0x215a('0x8'));var jsforce=require(_0x215a('0x9'));var deskjs=require('desk.js');var toCsv=require(_0x215a('0x6'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x215a('0xa'));var authService=require('../../components/auth/service');var qs=require(_0x215a('0xb'));var as=require(_0x215a('0xc'));var hardwareService=require(_0x215a('0xd'));var logger=require(_0x215a('0xe'))(_0x215a('0xf'));var utils=require(_0x215a('0x10'));var config=require(_0x215a('0x11'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x159806,_0x179f7a){_0x179f7a=_0x179f7a||0xcc;return function(_0x492984){if(_0x492984){return _0x159806[_0x215a('0x12')](_0x179f7a);}return _0x159806[_0x215a('0x13')](_0x179f7a)['end']();};}function respondWithResult(_0x367028,_0x553ae4){_0x553ae4=_0x553ae4||0xc8;return function(_0x19eae5){if(_0x19eae5){return _0x367028['status'](_0x553ae4)[_0x215a('0x14')](_0x19eae5);}};}function respondWithFilteredResult(_0x19733f,_0x4bcd6d){return function(_0x2c0f5e){if(_0x2c0f5e){var _0x4ec084=_0x2c0f5e[_0x215a('0x15')],_0x445e3d=_0x4bcd6d[_0x215a('0x16')],_0x544d51=_0x4bcd6d[_0x215a('0x16')]+_0x4bcd6d[_0x215a('0x17')],_0x29283c;if(_0x544d51>=_0x4ec084){_0x544d51=_0x4ec084;_0x29283c=0xc8;}else{_0x29283c=0xce;}_0x19733f[_0x215a('0x13')](_0x29283c);return _0x19733f[_0x215a('0x18')](_0x215a('0x19'),_0x445e3d+'-'+_0x544d51+'/'+_0x4ec084)[_0x215a('0x14')](_0x2c0f5e);}return null;};}function patchUpdates(_0x23d0c8){return function(_0x3a752e){try{jsonpatch['apply'](_0x3a752e,_0x23d0c8,!![]);}catch(_0x311e85){return BPromise[_0x215a('0x1a')](_0x311e85);}return _0x3a752e[_0x215a('0x1b')]();};}function saveUpdates(_0x2ea85f,_0x2a6e07){return function(_0x5d8d92){if(_0x5d8d92){return _0x5d8d92[_0x215a('0x1c')](_0x2ea85f)[_0x215a('0x1d')](function(_0x38c3e2){return _0x38c3e2;});}return null;};}function removeEntity(_0x509f53,_0x335fe4){return function(_0x46ee85){if(_0x46ee85){return _0x46ee85['destroy']()[_0x215a('0x1d')](function(){_0x509f53[_0x215a('0x13')](0xcc)[_0x215a('0x1e')]();});}};}function handleEntityNotFound(_0x363b0b,_0x2da254){return function(_0x368634){if(!_0x368634){_0x363b0b['sendStatus'](0x194);}return _0x368634;};}function handleError(_0x48aabc,_0x249a80){_0x249a80=_0x249a80||0x1f4;return function(_0x4501ad){logger['error'](_0x4501ad[_0x215a('0x1f')]);if(_0x4501ad['name']){delete _0x4501ad[_0x215a('0x20')];}_0x48aabc[_0x215a('0x13')](_0x249a80)['send'](_0x4501ad);};}exports[_0x215a('0x21')]=function(_0x5b0fc9,_0x31ced4){var _0x64868b={},_0x19aaba={},_0x3ed81b={'count':0x0,'rows':[]};var _0x544e55=db[_0x215a('0x22')][_0x215a('0x23')];_0x19aaba[_0x215a('0x24')]=_[_0x215a('0x25')](_0x544e55);_0x19aaba[_0x215a('0x26')]=_[_0x215a('0x25')](_0x5b0fc9['query']);_0x19aaba['filters']=_[_0x215a('0x27')](_0x19aaba[_0x215a('0x24')],_0x19aaba[_0x215a('0x26')]);_0x64868b[_0x215a('0x28')]=_['intersection'](_0x19aaba[_0x215a('0x24')],qs[_0x215a('0x29')](_0x5b0fc9[_0x215a('0x26')]['fields']));_0x64868b[_0x215a('0x28')]=_0x64868b[_0x215a('0x28')][_0x215a('0x2a')]?_0x64868b[_0x215a('0x28')]:_0x19aaba[_0x215a('0x24')];if(!_0x5b0fc9[_0x215a('0x26')][_0x215a('0x2b')](_0x215a('0x2c'))){_0x64868b[_0x215a('0x17')]=qs[_0x215a('0x17')](_0x5b0fc9['query'][_0x215a('0x17')]);_0x64868b[_0x215a('0x16')]=qs[_0x215a('0x16')](_0x5b0fc9['query']['offset']);}_0x64868b[_0x215a('0x2d')]=qs['sort'](_0x5b0fc9[_0x215a('0x26')]['sort']);_0x64868b['where']=qs[_0x215a('0x2e')](_[_0x215a('0x2f')](_0x5b0fc9['query'],_0x19aaba[_0x215a('0x2e')]));if(_0x5b0fc9[_0x215a('0x26')][_0x215a('0x30')]){_0x64868b[_0x215a('0x31')]=_[_0x215a('0x32')](_0x64868b[_0x215a('0x31')],{'$or':_[_0x215a('0x33')](_0x544e55,function(_0x358a05){if(_0x358a05[_0x215a('0x34')][_0x215a('0x35')]!=='VIRTUAL'){var _0x19350c={};_0x19350c[_0x358a05['field']]={'$like':'%'+_0x5b0fc9[_0x215a('0x26')][_0x215a('0x30')]+'%'};return _0x19350c;}})});}_0x64868b=_[_0x215a('0x32')]({},_0x64868b,_0x5b0fc9[_0x215a('0x36')]);var _0x21096d={'where':_0x64868b['where']};return db['OpenchannelApplication'][_0x215a('0x15')](_0x21096d)[_0x215a('0x1d')](function(_0x5e79d1){_0x3ed81b[_0x215a('0x15')]=_0x5e79d1;if(_0x5b0fc9[_0x215a('0x26')][_0x215a('0x37')]){_0x64868b['include']=[{'all':!![]}];}return db['OpenchannelApplication']['findAll'](_0x64868b);})[_0x215a('0x1d')](function(_0x2ac1bb){_0x3ed81b['rows']=_0x2ac1bb;return _0x3ed81b;})[_0x215a('0x1d')](respondWithFilteredResult(_0x31ced4,_0x64868b))[_0x215a('0x38')](handleError(_0x31ced4,null));};exports['show']=function(_0x37bff7,_0x1635b2){var _0x491f78={'raw':!![],'where':{'id':_0x37bff7[_0x215a('0x39')]['id']}},_0xfca647={};_0xfca647[_0x215a('0x24')]=_['keys'](db[_0x215a('0x22')][_0x215a('0x23')]);_0xfca647[_0x215a('0x26')]=_[_0x215a('0x25')](_0x37bff7[_0x215a('0x26')]);_0xfca647[_0x215a('0x2e')]=_[_0x215a('0x27')](_0xfca647[_0x215a('0x24')],_0xfca647[_0x215a('0x26')]);_0x491f78['attributes']=_[_0x215a('0x27')](_0xfca647[_0x215a('0x24')],qs[_0x215a('0x29')](_0x37bff7[_0x215a('0x26')][_0x215a('0x29')]));_0x491f78['attributes']=_0x491f78[_0x215a('0x28')][_0x215a('0x2a')]?_0x491f78[_0x215a('0x28')]:_0xfca647[_0x215a('0x24')];if(_0x37bff7['query'][_0x215a('0x37')]){_0x491f78['include']=[{'all':!![]}];}_0x491f78=_['merge']({},_0x491f78,_0x37bff7['options']);return db[_0x215a('0x22')]['find'](_0x491f78)[_0x215a('0x1d')](handleEntityNotFound(_0x1635b2,null))[_0x215a('0x1d')](respondWithResult(_0x1635b2,null))['catch'](handleError(_0x1635b2,null));};exports[_0x215a('0x3a')]=function(_0x2d7a6d,_0x3875f7){return db[_0x215a('0x22')][_0x215a('0x3a')](_0x2d7a6d[_0x215a('0x3b')],{})['then'](respondWithResult(_0x3875f7,0xc9))[_0x215a('0x38')](handleError(_0x3875f7,null));};exports[_0x215a('0x1c')]=function(_0x2f38cc,_0x3a2d9f){if(_0x2f38cc[_0x215a('0x3b')]['id']){delete _0x2f38cc['body']['id'];}return db[_0x215a('0x22')]['find']({'where':{'id':_0x2f38cc[_0x215a('0x39')]['id']}})['then'](handleEntityNotFound(_0x3a2d9f,null))[_0x215a('0x1d')](saveUpdates(_0x2f38cc[_0x215a('0x3b')],null))[_0x215a('0x1d')](respondWithResult(_0x3a2d9f,null))[_0x215a('0x38')](handleError(_0x3a2d9f,null));};exports[_0x215a('0x3c')]=function(_0x278bd9,_0x51acea){return db[_0x215a('0x22')][_0x215a('0x3d')]({'where':{'id':_0x278bd9[_0x215a('0x39')]['id']}})['then'](handleEntityNotFound(_0x51acea,null))[_0x215a('0x1d')](removeEntity(_0x51acea,null))[_0x215a('0x38')](handleError(_0x51acea,null));}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.model.js b/server/api/openchannelApplication/openchannelApplication.model.js index 222a4a7..3335141 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 _0xb6c5=['rimraf','./openchannelApplication.attributes','exports','define','OpenchannelApplication','openchannel_applications','utf8mb4','lodash','util','api','moment','bluebird','request-promise','path'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb6c5,0xaf));var _0x5b6c=function(_0x59fbf6,_0x59b950){_0x59fbf6=_0x59fbf6-0x0;var _0x280bef=_0xb6c5[_0x59fbf6];return _0x280bef;};'use strict';var _=require(_0x5b6c('0x0'));var util=require(_0x5b6c('0x1'));var logger=require('../../config/logger')(_0x5b6c('0x2'));var moment=require(_0x5b6c('0x3'));var BPromise=require(_0x5b6c('0x4'));var rp=require(_0x5b6c('0x5'));var fs=require('fs');var path=require(_0x5b6c('0x6'));var rimraf=require(_0x5b6c('0x7'));var config=require('../../config/environment');var attributes=require(_0x5b6c('0x8'));module[_0x5b6c('0x9')]=function(_0x2d842f,_0x4e71d0){return _0x2d842f[_0x5b6c('0xa')](_0x5b6c('0xb'),attributes,{'tableName':_0x5b6c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x5b6c('0xd'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x211e=['openchannel_applications','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x211e,0x1e1));var _0xe211=function(_0x4ae65e,_0x2fb698){_0x4ae65e=_0x4ae65e-0x0;var _0xaf8374=_0x211e[_0x4ae65e];return _0xaf8374;};'use strict';var _=require(_0xe211('0x0'));var util=require(_0xe211('0x1'));var logger=require(_0xe211('0x2'))(_0xe211('0x3'));var moment=require('moment');var BPromise=require(_0xe211('0x4'));var rp=require(_0xe211('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe211('0x6'));var config=require('../../config/environment');var attributes=require('./openchannelApplication.attributes');module['exports']=function(_0x19e056,_0x27ad0e){return _0x19e056['define']('OpenchannelApplication',attributes,{'tableName':_0xe211('0x7'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.rpc.js b/server/api/openchannelApplication/openchannelApplication.rpc.js index 87dcb42..1d47d6c 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 _0xd8b0=['OpenchannelApplication','body','options','raw','where','lodash','util','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','OpenchannelApplication,\x20%s,\x20%s','request\x20sent','debug','OpenchannelApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateOpenchannelApplication'];(function(_0x5a7e3c,_0xdc9219){var _0x59252b=function(_0x29655c){while(--_0x29655c){_0x5a7e3c['push'](_0x5a7e3c['shift']());}};_0x59252b(++_0xdc9219);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0d8b('0x2'));var db=require(_0x0d8b('0x3'))['db'];var utils=require(_0x0d8b('0x4'));var logger=require(_0x0d8b('0x5'))(_0x0d8b('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0d8b('0x7')][_0x0d8b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x39f43a,_0x4a4470,_0x413284){return new BPromise(function(_0x284169,_0x58e4e2){return client[_0x0d8b('0x9')](_0x39f43a,_0x413284)[_0x0d8b('0xa')](function(_0x3b027f){logger[_0x0d8b('0xb')](_0x0d8b('0xc'),_0x4a4470,_0x0d8b('0xd'));logger[_0x0d8b('0xe')](_0x0d8b('0xf'),_0x4a4470,'request\x20sent',JSON[_0x0d8b('0x10')](_0x3b027f));if(_0x3b027f['error']){if(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x12')]===0x1f4){logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);return _0x58e4e2(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);}logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);return _0x284169(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);}else{logger['info'](_0x0d8b('0xc'),_0x4a4470,_0x0d8b('0xd'));_0x284169(_0x3b027f[_0x0d8b('0x14')][_0x0d8b('0x13')]);}})[_0x0d8b('0x15')](function(_0x5cd485){logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x5cd485);_0x58e4e2(_0x5cd485);});});}exports[_0x0d8b('0x16')]=function(_0x5fecbd){var _0x333674=this;return new Promise(function(_0x18dd2d,_0x264b39){return db[_0x0d8b('0x17')]['update'](_0x5fecbd[_0x0d8b('0x18')],{'raw':_0x5fecbd[_0x0d8b('0x19')]?_0x5fecbd[_0x0d8b('0x19')][_0x0d8b('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5fecbd[_0x0d8b('0x19')]?_0x5fecbd[_0x0d8b('0x19')][_0x0d8b('0x1b')]||null:null,'attributes':_0x5fecbd[_0x0d8b('0x19')]?_0x5fecbd['options']['attributes']||null:null,'limit':_0x5fecbd[_0x0d8b('0x19')]?_0x5fecbd['options']['limit']||null:null})['then'](function(_0x238728){logger[_0x0d8b('0xb')](_0x0d8b('0x16'),_0x5fecbd);logger[_0x0d8b('0xe')](_0x0d8b('0x16'),_0x5fecbd,JSON[_0x0d8b('0x10')](_0x238728));_0x18dd2d(_0x238728);})[_0x0d8b('0x15')](function(_0x4562cb){logger[_0x0d8b('0x11')]('UpdateOpenchannelApplication',_0x4562cb[_0x0d8b('0x13')],_0x5fecbd);_0x264b39(_0x333674[_0x0d8b('0x11')](0x1f4,_0x4562cb['message']));});});}; \ No newline at end of file +var _0xd8b0=['OpenchannelApplication','body','options','raw','where','lodash','util','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','OpenchannelApplication,\x20%s,\x20%s','request\x20sent','debug','OpenchannelApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateOpenchannelApplication'];(function(_0x16629d,_0x492375){var _0x56ccee=function(_0xa982b7){while(--_0xa982b7){_0x16629d['push'](_0x16629d['shift']());}};_0x56ccee(++_0x492375);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0d8b('0x2'));var db=require(_0x0d8b('0x3'))['db'];var utils=require(_0x0d8b('0x4'));var logger=require(_0x0d8b('0x5'))(_0x0d8b('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0d8b('0x7')][_0x0d8b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x39f43a,_0x4a4470,_0x413284){return new BPromise(function(_0x284169,_0x58e4e2){return client[_0x0d8b('0x9')](_0x39f43a,_0x413284)[_0x0d8b('0xa')](function(_0x3b027f){logger[_0x0d8b('0xb')](_0x0d8b('0xc'),_0x4a4470,_0x0d8b('0xd'));logger[_0x0d8b('0xe')](_0x0d8b('0xf'),_0x4a4470,'request\x20sent',JSON[_0x0d8b('0x10')](_0x3b027f));if(_0x3b027f['error']){if(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x12')]===0x1f4){logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);return _0x58e4e2(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);}logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);return _0x284169(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);}else{logger['info'](_0x0d8b('0xc'),_0x4a4470,_0x0d8b('0xd'));_0x284169(_0x3b027f[_0x0d8b('0x14')][_0x0d8b('0x13')]);}})[_0x0d8b('0x15')](function(_0x5cd485){logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x5cd485);_0x58e4e2(_0x5cd485);});});}exports[_0x0d8b('0x16')]=function(_0x5fecbd){var _0x333674=this;return new Promise(function(_0x18dd2d,_0x264b39){return db[_0x0d8b('0x17')]['update'](_0x5fecbd[_0x0d8b('0x18')],{'raw':_0x5fecbd[_0x0d8b('0x19')]?_0x5fecbd[_0x0d8b('0x19')][_0x0d8b('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5fecbd[_0x0d8b('0x19')]?_0x5fecbd[_0x0d8b('0x19')][_0x0d8b('0x1b')]||null:null,'attributes':_0x5fecbd[_0x0d8b('0x19')]?_0x5fecbd['options']['attributes']||null:null,'limit':_0x5fecbd[_0x0d8b('0x19')]?_0x5fecbd['options']['limit']||null:null})['then'](function(_0x238728){logger[_0x0d8b('0xb')](_0x0d8b('0x16'),_0x5fecbd);logger[_0x0d8b('0xe')](_0x0d8b('0x16'),_0x5fecbd,JSON[_0x0d8b('0x10')](_0x238728));_0x18dd2d(_0x238728);})[_0x0d8b('0x15')](function(_0x4562cb){logger[_0x0d8b('0x11')]('UpdateOpenchannelApplication',_0x4562cb[_0x0d8b('0x13')],_0x5fecbd);_0x264b39(_0x333674[_0x0d8b('0x11')](0x1f4,_0x4562cb['message']));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/index.js b/server/api/openchannelInteraction/index.js index 29bbfcf..8fa7b53 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 _0xeeed=['create','/:id/messages','addMessage','/:id/tags','openchannel','openchannelinteraction:addtags','put','tracked','openchannelinteraction:update','update','delete','openchannelinteraction:destroy','removeTags','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','./openchannelInteraction.controller','isAuthenticated','index','get','/describe','describe','/:id','show','getMessages','download','post'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xeeed,0x125));var _0xdeee=function(_0x58ed2d,_0x252f96){_0x58ed2d=_0x58ed2d-0x0;var _0xc55413=_0xeeed[_0x58ed2d];return _0xc55413;};'use strict';var multer=require(_0xdeee('0x0'));var util=require(_0xdeee('0x1'));var path=require('path');var timeout=require(_0xdeee('0x2'));var express=require(_0xdeee('0x3'));var router=express[_0xdeee('0x4')]();var auth=require(_0xdeee('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xdeee('0x6'));router['get']('/',auth[_0xdeee('0x7')](),controller[_0xdeee('0x8')]);router[_0xdeee('0x9')](_0xdeee('0xa'),auth[_0xdeee('0x7')](),controller[_0xdeee('0xb')]);router[_0xdeee('0x9')](_0xdeee('0xc'),auth['isAuthenticated'](),controller[_0xdeee('0xd')]);router[_0xdeee('0x9')]('/:id/messages',auth[_0xdeee('0x7')](),controller[_0xdeee('0xe')]);router[_0xdeee('0x9')]('/:id/download',auth[_0xdeee('0x7')](),controller[_0xdeee('0xf')]);router[_0xdeee('0x10')]('/',auth[_0xdeee('0x7')](),controller[_0xdeee('0x11')]);router[_0xdeee('0x10')](_0xdeee('0x12'),auth[_0xdeee('0x7')](),controller[_0xdeee('0x13')]);router['post'](_0xdeee('0x14'),auth[_0xdeee('0x7')](),interaction['tracked'](_0xdeee('0x15'),_0xdeee('0x16')),controller['addTags']);router[_0xdeee('0x17')](_0xdeee('0xc'),auth[_0xdeee('0x7')](),interaction[_0xdeee('0x18')](_0xdeee('0x15'),_0xdeee('0x19')),controller[_0xdeee('0x1a')]);router[_0xdeee('0x1b')]('/:id',auth['isAuthenticated'](),interaction[_0xdeee('0x18')](_0xdeee('0x15'),_0xdeee('0x1c')),controller['destroy']);router[_0xdeee('0x1b')](_0xdeee('0x14'),auth[_0xdeee('0x7')](),controller[_0xdeee('0x1d')]);module[_0xdeee('0x1e')]=router; \ No newline at end of file +var _0x7901=['exports','multer','path','express','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','/:id','show','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','/:id/tags','tracked','openchannel','openchannelinteraction:addtags','put','openchannelinteraction:update','update','destroy','removeTags'];(function(_0x29ca3a,_0x118266){var _0x45371e=function(_0x3fe942){while(--_0x3fe942){_0x29ca3a['push'](_0x29ca3a['shift']());}};_0x45371e(++_0x118266);}(_0x7901,0xa9));var _0x1790=function(_0x28dc04,_0x18bbad){_0x28dc04=_0x28dc04-0x0;var _0x44dbeb=_0x7901[_0x28dc04];return _0x44dbeb;};'use strict';var multer=require(_0x1790('0x0'));var util=require('util');var path=require(_0x1790('0x1'));var timeout=require('connect-timeout');var express=require(_0x1790('0x2'));var router=express['Router']();var auth=require(_0x1790('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x1790('0x4'));var controller=require('./openchannelInteraction.controller');router[_0x1790('0x5')]('/',auth[_0x1790('0x6')](),controller[_0x1790('0x7')]);router[_0x1790('0x5')](_0x1790('0x8'),auth[_0x1790('0x6')](),controller['describe']);router[_0x1790('0x5')](_0x1790('0x9'),auth[_0x1790('0x6')](),controller[_0x1790('0xa')]);router[_0x1790('0x5')](_0x1790('0xb'),auth[_0x1790('0x6')](),controller[_0x1790('0xc')]);router[_0x1790('0x5')](_0x1790('0xd'),auth[_0x1790('0x6')](),controller[_0x1790('0xe')]);router[_0x1790('0xf')]('/',auth[_0x1790('0x6')](),controller[_0x1790('0x10')]);router[_0x1790('0xf')](_0x1790('0xb'),auth['isAuthenticated'](),controller[_0x1790('0x11')]);router[_0x1790('0xf')](_0x1790('0x12'),auth[_0x1790('0x6')](),interaction[_0x1790('0x13')](_0x1790('0x14'),_0x1790('0x15')),controller['addTags']);router[_0x1790('0x16')]('/:id',auth['isAuthenticated'](),interaction[_0x1790('0x13')](_0x1790('0x14'),_0x1790('0x17')),controller[_0x1790('0x18')]);router['delete'](_0x1790('0x9'),auth[_0x1790('0x6')](),interaction[_0x1790('0x13')](_0x1790('0x14'),'openchannelinteraction:destroy'),controller[_0x1790('0x19')]);router['delete'](_0x1790('0x12'),auth[_0x1790('0x6')](),controller[_0x1790('0x1a')]);module[_0x1790('0x1b')]=router; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.attributes.js b/server/api/openchannelInteraction/openchannelInteraction.attributes.js index 7f2f42e..7b4f946 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 _0x72bc=['exports','BOOLEAN','DATE','STRING','ENUM','out','sequelize'];(function(_0x34952d,_0xc603a5){var _0x5d52ba=function(_0x20ba95){while(--_0x20ba95){_0x34952d['push'](_0x34952d['shift']());}};_0x5d52ba(++_0xc603a5);}(_0x72bc,0x1f0));var _0xc72b=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0x72bc[_0x5c351c];return _0x26f3b3;};'use strict';var Sequelize=require(_0xc72b('0x0'));module[_0xc72b('0x1')]={'closed':{'type':Sequelize[_0xc72b('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xc72b('0x3')]},'disposition':{'type':Sequelize[_0xc72b('0x4')]},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0xc72b('0x3')]},'threadId':{'type':Sequelize[_0xc72b('0x4')]},'externalUrl':{'type':Sequelize['STRING']},'lastMsgAt':{'type':Sequelize[_0xc72b('0x3')]},'lastMsgDirection':{'type':Sequelize[_0xc72b('0x5')]('in',_0xc72b('0x6')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0xc72b('0x4')]}}; \ No newline at end of file +var _0x45c7=['exports','BOOLEAN','STRING','DATE','ENUM','out','sequelize'];(function(_0x5cb1af,_0x4bdc8c){var _0x8d7940=function(_0x3db70a){while(--_0x3db70a){_0x5cb1af['push'](_0x5cb1af['shift']());}};_0x8d7940(++_0x4bdc8c);}(_0x45c7,0xbc));var _0x745c=function(_0x37b565,_0x2a9e26){_0x37b565=_0x37b565-0x0;var _0x53f66e=_0x45c7[_0x37b565];return _0x53f66e;};'use strict';var Sequelize=require(_0x745c('0x0'));module[_0x745c('0x1')]={'closed':{'type':Sequelize[_0x745c('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x745c('0x3')]},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x745c('0x4')]},'threadId':{'type':Sequelize[_0x745c('0x3')]},'externalUrl':{'type':Sequelize[_0x745c('0x3')]},'lastMsgAt':{'type':Sequelize[_0x745c('0x4')]},'lastMsgDirection':{'type':Sequelize[_0x745c('0x5')]('in',_0x745c('0x6')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0x745c('0x3')]}}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.controller.js b/server/api/openchannelInteraction/openchannelInteraction.controller.js index 530181b..3ee74d5 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 _0x05f4=['request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','localhost','socket.io-emitter','redis','register','sendStatus','status','json','offset','set','apply','save','update','then','destroy','stack','name','send','Users','map','TagIds','split','forEach','Tags','catch','index','OpenchannelInteraction','rawAttributes','model','keys','query','filters','intersection','attributes','fields','nolimit','limit','sort','pick','field','color','from','select','u.id','user_has_openchannel_interactions','left_join','users','u.id\x20=\x20ui.UserId','openchannel_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','a.id\x20=\x20i.OpenchannelAccountId','openchannel_messages','me.OpenchannelInteractionId\x20=\x20i.id','expr','advancedFilter','parse','matchType','substr','omit','omitBy','options','custom','hasMultipleConditions','value','values','columns','table','parseOperator','getConditionValue','isRangeCondition','having','$between','length','`\x20=\x200','`\x20>\x200','filter','isNil','isEmpty','i.OpenchannelAccountId\x20IN\x20?','concat','createdAt','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','where','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','replace','\x27\x27\x27\x27','isNumeric','i.id\x20LIKE\x20?','push','join','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','Sequelize','QueryTypes','SELECT','clone','i.id','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','order','DESC','tag','isArray','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','openchannel_interaction_has_tags','tools_tags','t.id\x20=\x20it.TagId','t.id\x20IN\x20?','TagId','it.MailInteractionId\x20=\x20i.id','sequelize','toString','a.key','Account.key','a.mandatoryDisposition','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','c.phone','Contact.phone','c.mobile','c.fax','Contact.fax','GROUP_CONCAT(DISTINCT\x20t.id)','it.OpenchannelInteractionId\x20=\x20i.id','ui.OpenchannelInteractionId\x20IN\x20?','all','rows','params','find','create','body','describe','addMessage','OpenchannelMessage','ids','getMessages','OpenchannelInteractionId','merge','format','YYYY-MM-DD\x20HH:mm:ss','count','includeAll','include','findAll','setTags','spread','Tag','emit','openchannelInteractionTags:save','removeTags','unix','root','server','files','tmp','attachments','transcript-%d-%s.zip','Messages','direction','secret','User','fullname','CmContact','Contact','firstName','lastName','Attachment','OpenchannelAccount','get','10px','40px','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
Interaction\x20Transcript
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','30px','%s\x20#%d','Openchannel','mkdirSync','Owner','N.A.','closed','closedAt','disposition','threadId','Public','Private','basename','existsSync','createReadStream','pipe','out','System','renderFile','views','downloadInteraction.html','toFile','transcript-','.pdf','download','err','unlinkSync','rimraf','zip-dir','fast-json-patch'];(function(_0x42b3ff,_0x3bd83f){var _0x1c6295=function(_0x2e9e4e){while(--_0x2e9e4e){_0x42b3ff['push'](_0x42b3ff['shift']());}};_0x1c6295(++_0x3bd83f);}(_0x05f4,0xe9));var _0x405f=function(_0x35781e,_0x16a0c5){_0x35781e=_0x35781e-0x0;var _0x410e84=_0x05f4[_0x35781e];return _0x410e84;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x405f('0x0'));var zipdir=require(_0x405f('0x1'));var jsonpatch=require(_0x405f('0x2'));var rp=require(_0x405f('0x3'));var moment=require(_0x405f('0x4'));var BPromise=require(_0x405f('0x5'));var Mustache=require('mustache');var util=require(_0x405f('0x6'));var path=require(_0x405f('0x7'));var sox=require(_0x405f('0x8'));var csv=require(_0x405f('0x9'));var ejs=require(_0x405f('0xa'));var fs=require('fs');var _=require(_0x405f('0xb'));var squel=require(_0x405f('0xc'));var crypto=require(_0x405f('0xd'));var jsforce=require(_0x405f('0xe'));var deskjs=require(_0x405f('0xf'));var toCsv=require(_0x405f('0x9'));var querystring=require('querystring');var Papa=require(_0x405f('0x10'));var Redis=require('ioredis');var authService=require(_0x405f('0x11'));var qs=require(_0x405f('0x12'));var as=require(_0x405f('0x13'));var hardwareService=require(_0x405f('0x14'));var logger=require(_0x405f('0x15'))(_0x405f('0x16'));var utils=require(_0x405f('0x17'));var config=require(_0x405f('0x18'));var db=require(_0x405f('0x19'))['db'];config['redis']=_[_0x405f('0x1a')](config['redis'],{'host':_0x405f('0x1b'),'port':0x18eb});var socket=require(_0x405f('0x1c'))(new Redis(config[_0x405f('0x1d')]));require('./openchannelInteraction.socket')[_0x405f('0x1e')](socket);function respondWithStatusCode(_0x5c65d5,_0x87f05f){_0x87f05f=_0x87f05f||0xcc;return function(_0x39fe16){if(_0x39fe16){return _0x5c65d5[_0x405f('0x1f')](_0x87f05f);}return _0x5c65d5[_0x405f('0x20')](_0x87f05f)['end']();};}function respondWithResult(_0x238534,_0x3e5e46){_0x3e5e46=_0x3e5e46||0xc8;return function(_0x25fd5b){if(_0x25fd5b){return _0x238534[_0x405f('0x20')](_0x3e5e46)[_0x405f('0x21')](_0x25fd5b);}};}function respondWithFilteredResult(_0x23bfe6,_0x16d67d){return function(_0x3eaf9b){if(_0x3eaf9b){var _0x26f47f=_0x3eaf9b['count'],_0xe6de5a=_0x16d67d[_0x405f('0x22')],_0x2e4903=_0x16d67d[_0x405f('0x22')]+_0x16d67d['limit'],_0x422660;if(_0x2e4903>=_0x26f47f){_0x2e4903=_0x26f47f;_0x422660=0xc8;}else{_0x422660=0xce;}_0x23bfe6[_0x405f('0x20')](_0x422660);return _0x23bfe6[_0x405f('0x23')]('Content-Range',_0xe6de5a+'-'+_0x2e4903+'/'+_0x26f47f)['json'](_0x3eaf9b);}return null;};}function patchUpdates(_0x41e46a){return function(_0x4ddc3f){try{jsonpatch[_0x405f('0x24')](_0x4ddc3f,_0x41e46a,!![]);}catch(_0x37e4cb){return BPromise['reject'](_0x37e4cb);}return _0x4ddc3f[_0x405f('0x25')]();};}function saveUpdates(_0x2aff80,_0x1a9c87){return function(_0xe53b7b){if(_0xe53b7b){return _0xe53b7b[_0x405f('0x26')](_0x2aff80)[_0x405f('0x27')](function(_0x20e672){return _0x20e672;});}return null;};}function removeEntity(_0x13fbcc,_0x1d1497){return function(_0x257ad2){if(_0x257ad2){return _0x257ad2[_0x405f('0x28')]()[_0x405f('0x27')](function(){_0x13fbcc[_0x405f('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x34ba80,_0x442c95){return function(_0x3eb4e5){if(!_0x3eb4e5){_0x34ba80['sendStatus'](0x194);}return _0x3eb4e5;};}function handleError(_0x19af84,_0x3aadd8){_0x3aadd8=_0x3aadd8||0x1f4;return function(_0x3ac181){logger['error'](_0x3ac181[_0x405f('0x29')]);if(_0x3ac181[_0x405f('0x2a')]){delete _0x3ac181[_0x405f('0x2a')];}_0x19af84[_0x405f('0x20')](_0x3aadd8)[_0x405f('0x2b')](_0x3ac181);};}function getInteractionUsers(_0x10b040,_0x3fffef){return new BPromise(function(_0x55ce8b,_0x333d59){try{if(_0x3fffef[_0x10b040['id']]){_0x10b040[_0x405f('0x2c')]=_[_0x405f('0x2d')](_0x3fffef[_0x10b040['id']],function(_0x24973f){return{'id':_0x24973f['id']};});}}catch(_0x4b35ec){_0x333d59(_0x4b35ec);}_0x55ce8b(_0x10b040);});}function getInteractionTags(_0x3e79f6,_0x50c425){return new BPromise(function(_0x300004,_0x5f130f){try{if(_0x3e79f6['TagIds']){_0x3e79f6['Tags']=[];_0x3e79f6[_0x405f('0x2e')][_0x405f('0x2f')](',')[_0x405f('0x30')](function(_0x55cc01){_0x3e79f6[_0x405f('0x31')]['push'](_0x50c425[_0x55cc01]);});}delete _0x3e79f6[_0x405f('0x2e')];}catch(_0x5e3076){_0x5f130f(_0x5e3076);}_0x300004(_0x3e79f6);});}function updateOpenchannelInteraction(_0x185014,_0x1d6faa,_0x34a3c2){return new BPromise(function(_0x18ae8d,_0x4a7408){return getInteractionUsers(_0x185014,_0x34a3c2)[_0x405f('0x27')](function(_0x2bc4ee){return getInteractionTags(_0x2bc4ee,_0x1d6faa);})['then'](function(_0x182cfd){_0x18ae8d(_0x182cfd);})[_0x405f('0x32')](function(_0x4873ea){_0x4a7408(_0x4873ea);});});}exports[_0x405f('0x33')]=function(_0x2c9fcc,_0x28601f){var _0x44a97b={},_0x465539={},_0x1fba72={'count':0x0,'rows':[]};var _0xa464d0=db[_0x405f('0x34')][_0x405f('0x35')];_0x465539[_0x405f('0x36')]=_[_0x405f('0x37')](_0xa464d0);_0x465539[_0x405f('0x38')]=_['keys'](_0x2c9fcc[_0x405f('0x38')]);_0x465539[_0x405f('0x39')]=_[_0x405f('0x3a')](_0x465539[_0x405f('0x36')],_0x465539['query']);_0x44a97b[_0x405f('0x3b')]=_[_0x405f('0x3a')](_0x465539[_0x405f('0x36')],qs[_0x405f('0x3c')](_0x2c9fcc['query'][_0x405f('0x3c')]));_0x44a97b['attributes']=_0x44a97b[_0x405f('0x3b')]['length']?_0x44a97b[_0x405f('0x3b')]:_0x465539[_0x405f('0x36')];if(!_0x2c9fcc[_0x405f('0x38')]['hasOwnProperty'](_0x405f('0x3d'))){_0x44a97b['limit']=qs[_0x405f('0x3e')](_0x2c9fcc['query'][_0x405f('0x3e')]);_0x44a97b['offset']=qs[_0x405f('0x22')](_0x2c9fcc[_0x405f('0x38')]['offset']);}_0x44a97b['order']=qs[_0x405f('0x3f')](_0x2c9fcc[_0x405f('0x38')]['sort']);_0x44a97b['where']=qs[_0x405f('0x39')](_[_0x405f('0x40')](_0x2c9fcc[_0x405f('0x38')],_0x465539['filters']));var _0x8c4168=[];var _0x185611=squel['select']()[_0x405f('0x41')]('id')['field'](_0x405f('0x2a'))[_0x405f('0x41')](_0x405f('0x42'))[_0x405f('0x43')]('tools_tags');var _0x28663a=squel[_0x405f('0x44')]()[_0x405f('0x41')](_0x405f('0x45'))[_0x405f('0x41')]('ui.OpenchannelInteractionId')['from'](_0x405f('0x46'),'ui')[_0x405f('0x47')](_0x405f('0x48'),'u',_0x405f('0x49'));var _0x553be7=squel[_0x405f('0x44')]()[_0x405f('0x43')](_0x405f('0x4a'),'i')[_0x405f('0x47')](_0x405f('0x4b'),'c',_0x405f('0x4c'))[_0x405f('0x47')](_0x405f('0x48'),'o','o.id\x20=\x20i.UserId')['left_join']('openchannel_accounts','a',_0x405f('0x4d'))[_0x405f('0x47')](_0x405f('0x4e'),'me',_0x405f('0x4f'));var _0x46e87f=squel[_0x405f('0x50')]();var _0x124b75=_0x2c9fcc[_0x405f('0x38')][_0x405f('0x51')]?JSON[_0x405f('0x52')](_0x2c9fcc['query'][_0x405f('0x51')]):undefined;if(_0x124b75){var _0x5342fd=_0x124b75[_0x405f('0x53')][_0x405f('0x54')](0x1);_(_0x124b75)[_0x405f('0x55')](_0x405f('0x53'))[_0x405f('0x56')](function(_0x164e79,_0x3c84be){return _0x164e79[_0x405f('0x57')][_0x405f('0x58')]===!![];})[_0x405f('0x37')]()[_0x405f('0x30')](function(_0x2a39ce){var _0x1b54d0=_0x124b75[_0x2a39ce];if(_0x1b54d0[_0x405f('0x57')]['columns']){var _0x53e894=squel[_0x405f('0x50')]();if(as[_0x405f('0x59')](_0x1b54d0[_0x405f('0x5a')])){var _0x589609=_[_0x405f('0x5b')](_0x1b54d0[_0x405f('0x5a')])[0x0];_0x589609['forEach'](function(_0x121398){_0x1b54d0[_0x405f('0x57')][_0x405f('0x5c')]['forEach'](function(_0x5dd62a){_0x53e894['or'](_0x1b54d0[_0x405f('0x57')][_0x405f('0x5d')]+'.'+_0x5dd62a+'\x20'+as[_0x405f('0x5e')](_0x121398),as[_0x405f('0x5f')](_0x121398));});});}else{var _0x3e5af1=as[_0x405f('0x60')](_0x1b54d0[_0x405f('0x5a')])?_0x1b54d0[_0x405f('0x5a')][0x1]:undefined;_0x1b54d0[_0x405f('0x57')]['columns'][_0x405f('0x30')](function(_0x13c7ab){_0x53e894['or'](_0x1b54d0[_0x405f('0x57')][_0x405f('0x5d')]+'.'+_0x13c7ab+'\x20'+as[_0x405f('0x5e')](_0x1b54d0[_0x405f('0x5a')]),as[_0x405f('0x5f')](_0x1b54d0[_0x405f('0x5a')]),_0x3e5af1);});}_0x46e87f[_0x5342fd](_0x53e894);}else if(as[_0x405f('0x59')](_0x1b54d0[_0x405f('0x5a')])){var _0x589609=_[_0x405f('0x5b')](_0x1b54d0[_0x405f('0x5a')])[0x0];_0x589609[_0x405f('0x30')](function(_0x21cf5f){if(!_0x1b54d0[_0x405f('0x57')][_0x405f('0x61')]){var _0x176550=as[_0x405f('0x60')](_0x21cf5f)?_0x21cf5f[_0x405f('0x62')][0x1]:undefined;_0x46e87f[_0x5342fd](_0x1b54d0[_0x405f('0x57')][_0x405f('0x5d')]+'.'+_0x2a39ce+'\x20'+as[_0x405f('0x5e')](_0x21cf5f),as[_0x405f('0x5f')](_0x21cf5f),_0x176550);}});}else{if(_0x1b54d0[_0x405f('0x57')][_0x405f('0x61')]){var _0xcdde26=as[_0x405f('0x5f')](_0x1b54d0[_0x405f('0x5a')]);if(_0xcdde26[_0x405f('0x63')]===0x1){if(_0xcdde26==0x1){_0x553be7[_0x405f('0x61')]('`'+_0x2a39ce+_0x405f('0x64'));}else{_0x553be7[_0x405f('0x61')]('`'+_0x2a39ce+_0x405f('0x65'));}}}else{var _0x3e5af1=as[_0x405f('0x60')](_0x1b54d0[_0x405f('0x5a')])?_0x1b54d0[_0x405f('0x5a')][_0x405f('0x62')][0x1]:undefined;_0x46e87f[_0x5342fd](_0x1b54d0[_0x405f('0x57')][_0x405f('0x5d')]+'.'+_0x2a39ce+'\x20'+as[_0x405f('0x5e')](_0x1b54d0[_0x405f('0x5a')]),as[_0x405f('0x5f')](_0x1b54d0['value']),_0x3e5af1);}}});}else{var _0x53ec40=_(Object[_0x405f('0x37')](_0x2c9fcc['query']))[_0x405f('0x2d')](function(_0x1f5d92){return _0xa464d0['hasOwnProperty'](_0x1f5d92)?_0x1f5d92:undefined;})[_0x405f('0x66')](function(_0x6f2d7a){return!_[_0x405f('0x67')](_0x6f2d7a);})[_0x405f('0x5a')]();if(!_[_0x405f('0x68')](_0x53ec40)){_0x53ec40[_0x405f('0x30')](function(_0x13836e){if(_0x13836e==='OpenchannelAccountId'){_0x553be7['where'](_0x405f('0x69'),[][_0x405f('0x6a')](_0x2c9fcc[_0x405f('0x38')][_0x13836e]));}else if(_0x13836e===_0x405f('0x6b')){var _0x39e3bd=JSON['parse'](_0x2c9fcc['query'][_0x13836e])[_0x405f('0x6c')];var _0x4ef986=JSON['parse'](_0x2c9fcc[_0x405f('0x38')][_0x13836e])[_0x405f('0x6d')];_0x553be7['where'](_0x405f('0x6e'),_0x39e3bd,_0x4ef986);}else{if(_0x2c9fcc[_0x405f('0x38')][_0x13836e]==='null'){_0x553be7[_0x405f('0x6f')]('i.'+_0x13836e+_0x405f('0x70'));}else{_0x553be7[_0x405f('0x6f')]('i.'+_0x13836e+_0x405f('0x71'),_0x2c9fcc[_0x405f('0x38')][_0x13836e]);}}});}if(_0x2c9fcc[_0x405f('0x38')][_0x405f('0x72')]){if(_0x2c9fcc[_0x405f('0x38')][_0x405f('0x72')]==0x1){_0x553be7[_0x405f('0x61')](_0x405f('0x73'));}else{_0x553be7['having'](_0x405f('0x74'));}}if(_0x2c9fcc['query']['filter']){var _0x3c3a41=_0x2c9fcc['query'][_0x405f('0x66')][_0x405f('0x75')]('\x5c','\x5c\x5c')[_0x405f('0x75')]('\x27\x27',_0x405f('0x76'));if(qs[_0x405f('0x77')](_0x3c3a41)){_0x46e87f['or'](_0x405f('0x78'),_0x3c3a41+'%');}else{var _0x3d4e14=[];_0x3c3a41[_0x405f('0x2f')]('\x20')['forEach'](function(_0x1de390){_0x3d4e14[_0x405f('0x79')]('+'+_0x1de390['toString']());});var _0x2fa5cb=_0x3d4e14[_0x405f('0x7a')]('\x20');_0x46e87f['or'](_0x405f('0x7b'),_0x2fa5cb)['or']('i.from\x20LIKE\x20?',_0x3c3a41+'%')['or'](_0x405f('0x7c'),_0x3c3a41+'%');}}}_0x553be7[_0x405f('0x6f')](_0x46e87f);_0x553be7[_0x405f('0x7d')]('i.id');var _0x4baeb6={'type':db[_0x405f('0x7e')][_0x405f('0x7f')][_0x405f('0x80')],'raw':!![]};var _0x35bae4=_0x553be7[_0x405f('0x81')]();_0x35bae4[_0x405f('0x41')](_0x405f('0x82'));_0x35bae4[_0x405f('0x41')](_0x405f('0x83'),_0x405f('0x84'));if(_0x44a97b[_0x405f('0x85')]){_0x44a97b['order'][_0x405f('0x30')](function(_0x5b3059){_0x553be7[_0x405f('0x85')]('i.'+_0x5b3059[0x0],_0x5b3059[0x1]===_0x405f('0x86')?![]:!![]);});}var _0x3a320d=[];var _0x36b085=squel[_0x405f('0x50')]();if(!_0x124b75){if(_0x2c9fcc[_0x405f('0x38')][_0x405f('0x87')]){_0x3a320d=_[_0x405f('0x88')](_0x2c9fcc[_0x405f('0x38')][_0x405f('0x87')])?_0x2c9fcc[_0x405f('0x38')][_0x405f('0x87')]:new Array(_0x2c9fcc[_0x405f('0x38')][_0x405f('0x87')]);_0x3a320d[_0x405f('0x30')](function(_0xbeb3d){_0x36b085['or'](_0x405f('0x89'),'%,'+_0xbeb3d+',%');});_0x553be7['having'](_0x36b085);_0x35bae4[_0x405f('0x47')](_0x405f('0x8a'),'it','it.OpenchannelInteractionId\x20=\x20i.id');_0x35bae4[_0x405f('0x47')](_0x405f('0x8b'),'t',_0x405f('0x8c'));_0x35bae4[_0x405f('0x6f')](_0x405f('0x8d'),_0x3a320d);}}else{if(_0x124b75['hasOwnProperty'](_0x405f('0x8e'))){if(as[_0x405f('0x59')](_0x124b75[_0x405f('0x8e')][_0x405f('0x5a')])){var _0x35d08d=_[_0x405f('0x5b')](_0x124b75[_0x405f('0x8e')][_0x405f('0x5a')])[0x0];_0x35d08d[_0x405f('0x30')](function(_0x8445e5){as['getConditionValue'](_0x8445e5)['forEach'](function(_0x3885a9){_0x3a320d[_0x405f('0x79')](_0x3885a9);});});}else{_0x3a320d=as[_0x405f('0x5f')](_0x124b75[_0x405f('0x8e')][_0x405f('0x5a')]);}_0x3a320d[_0x405f('0x30')](function(_0x66bfaf){_0x36b085['or'](_0x405f('0x89'),'%,'+_0x66bfaf+',%');});_0x553be7['having'](_0x36b085);_0x35bae4['left_join']('mail_interaction_has_tags','it',_0x405f('0x8f'));_0x35bae4[_0x405f('0x47')](_0x405f('0x8b'),'t','t.id\x20=\x20it.TagId');_0x35bae4[_0x405f('0x6f')](_0x405f('0x8d'),_0x3a320d);}}db[_0x405f('0x90')]['query'](_0x35bae4['toString'](),_0x4baeb6)[_0x405f('0x27')](function(_0x40faae){_0x1fba72['count']=_0x40faae['length'];if(_0x1fba72['count']===0x0)return[];return db[_0x405f('0x90')][_0x405f('0x38')](_0x185611[_0x405f('0x91')](),_0x4baeb6)[_0x405f('0x27')](function(_0x1114b8){_0x8c4168=_['keyBy'](_0x1114b8,'id');_0x4baeb6=_['merge'](_0x4baeb6,{'model':db['OpenchannelInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});_0x553be7[_0x405f('0x41')](_0x405f('0x83'),_0x405f('0x84'));_0x553be7['field'](_0x405f('0x92'),_0x405f('0x93'));_0x553be7[_0x405f('0x41')](_0x405f('0x94'),'Account.mandatoryDisposition');_0x553be7[_0x405f('0x41')]('i.*');_0x553be7['field'](_0x405f('0x95'),_0x405f('0x96'));_0x553be7['field'](_0x405f('0x97'),_0x405f('0x98'));_0x553be7[_0x405f('0x41')](_0x405f('0x99'),'Contact.email');_0x553be7[_0x405f('0x41')](_0x405f('0x9a'),_0x405f('0x9b'));_0x553be7[_0x405f('0x41')](_0x405f('0x9c'),'Contact.mobile');_0x553be7[_0x405f('0x41')](_0x405f('0x9d'),_0x405f('0x9e'));_0x553be7[_0x405f('0x41')](_0x405f('0x9f'),_0x405f('0x2e'));_0x553be7[_0x405f('0x47')](_0x405f('0x8a'),'it',_0x405f('0xa0'));_0x553be7[_0x405f('0x47')](_0x405f('0x8b'),'t',_0x405f('0x8c'));_0x553be7['limit'](_0x44a97b[_0x405f('0x3e')]);_0x553be7['offset'](_0x44a97b[_0x405f('0x22')]);return db[_0x405f('0x90')][_0x405f('0x38')](_0x553be7['toString'](),_0x4baeb6);})[_0x405f('0x27')](function(_0x35b6d5){_0x28663a[_0x405f('0x6f')](_0x405f('0xa1'),_[_0x405f('0x2d')](_0x35b6d5,'id'));return db['sequelize'][_0x405f('0x38')](_0x28663a[_0x405f('0x91')](),_0x4baeb6)['then'](function(_0x2456ca){var _0x394738=_['groupBy'](_0x2456ca,'OpenchannelInteractionId');var _0x15e1a1=[];_0x35b6d5['forEach'](function(_0x66f7d4){_0x15e1a1['push'](updateOpenchannelInteraction(_0x66f7d4,_0x8c4168,_0x394738));});return BPromise[_0x405f('0xa2')](_0x15e1a1);});});})[_0x405f('0x27')](function(_0x1df3a6){_0x1fba72[_0x405f('0xa3')]=_0x1df3a6;return _0x1fba72;})[_0x405f('0x27')](respondWithFilteredResult(_0x28601f,_0x44a97b))[_0x405f('0x32')](handleError(_0x28601f,null));};exports['show']=function(_0x5d7acf,_0x297585){var _0x35596d={'raw':![],'where':{'id':_0x5d7acf[_0x405f('0xa4')]['id']}},_0x5c0ee9={};_0x5c0ee9[_0x405f('0x36')]=_[_0x405f('0x37')](db['OpenchannelInteraction'][_0x405f('0x35')]);_0x5c0ee9[_0x405f('0x38')]=_[_0x405f('0x37')](_0x5d7acf['query']);_0x5c0ee9[_0x405f('0x39')]=_[_0x405f('0x3a')](_0x5c0ee9['model'],_0x5c0ee9['query']);_0x35596d[_0x405f('0x3b')]=_[_0x405f('0x3a')](_0x5c0ee9[_0x405f('0x36')],qs[_0x405f('0x3c')](_0x5d7acf[_0x405f('0x38')][_0x405f('0x3c')]));_0x35596d[_0x405f('0x3b')]=_0x35596d[_0x405f('0x3b')][_0x405f('0x63')]?_0x35596d[_0x405f('0x3b')]:_0x5c0ee9[_0x405f('0x36')];if(_0x5d7acf['query']['includeAll']){_0x35596d['include']=[{'all':!![]}];}_0x35596d=_['merge']({},_0x35596d,_0x5d7acf['options']);return db['OpenchannelInteraction'][_0x405f('0xa5')](_0x35596d)[_0x405f('0x27')](handleEntityNotFound(_0x297585,null))['then'](respondWithResult(_0x297585,null))[_0x405f('0x32')](handleError(_0x297585,null));};exports[_0x405f('0xa6')]=function(_0x346135,_0x2a63e9){return db[_0x405f('0x34')]['create'](_0x346135[_0x405f('0xa7')],{})[_0x405f('0x27')](respondWithResult(_0x2a63e9,0xc9))[_0x405f('0x32')](handleError(_0x2a63e9,null));};exports[_0x405f('0x26')]=function(_0x359217,_0xe9ce0e){if(_0x359217[_0x405f('0xa7')]['id']){delete _0x359217[_0x405f('0xa7')]['id'];}return db[_0x405f('0x34')][_0x405f('0xa5')]({'where':{'id':_0x359217[_0x405f('0xa4')]['id']}})[_0x405f('0x27')](handleEntityNotFound(_0xe9ce0e,null))[_0x405f('0x27')](saveUpdates(_0x359217[_0x405f('0xa7')],null))['then'](respondWithResult(_0xe9ce0e,null))[_0x405f('0x32')](handleError(_0xe9ce0e,null));};exports[_0x405f('0x28')]=function(_0x2777c8,_0x11ddaa){return db[_0x405f('0x34')]['find']({'where':{'id':_0x2777c8[_0x405f('0xa4')]['id']}})[_0x405f('0x27')](handleEntityNotFound(_0x11ddaa,null))[_0x405f('0x27')](removeEntity(_0x11ddaa,null))[_0x405f('0x32')](handleError(_0x11ddaa,null));};exports[_0x405f('0xa8')]=function(_0x477c38,_0xad9cdb){return db['OpenchannelInteraction'][_0x405f('0xa8')]()[_0x405f('0x27')](respondWithResult(_0xad9cdb,null))[_0x405f('0x32')](handleError(_0xad9cdb,null));};exports[_0x405f('0xa9')]=function(_0x2025fd,_0x19bb76,_0xa22c28){return db[_0x405f('0xaa')][_0x405f('0xa5')]({'where':{'id':_0x2025fd[_0x405f('0xa4')]['id']}})[_0x405f('0x27')](handleEntityNotFound(_0x19bb76,null))[_0x405f('0x27')](function(_0x51d5ca){if(_0x51d5ca){return _0x51d5ca['addMessage'](_0x2025fd[_0x405f('0xa7')]['ids'],_[_0x405f('0x55')](_0x2025fd[_0x405f('0xa7')],[_0x405f('0xab'),'id'])||{});}})[_0x405f('0x27')](respondWithResult(_0x19bb76,null))[_0x405f('0x32')](handleError(_0x19bb76,null));};exports[_0x405f('0xac')]=function(_0x26a8d4,_0x39072a,_0x28ffd4){var _0x2039e2={'raw':![],'where':{}};var _0x457a84={};var _0x1d6801={'count':0x0,'rows':[]};return db[_0x405f('0x34')]['findOne']({'where':{'id':_0x26a8d4[_0x405f('0xa4')]['id']}})['then'](handleEntityNotFound(_0x39072a,null))[_0x405f('0x27')](function(_0x5a8ce8){if(_0x5a8ce8){_0x457a84[_0x405f('0x36')]=_[_0x405f('0x37')](db[_0x405f('0xaa')][_0x405f('0x35')]);_0x457a84['query']=_[_0x405f('0x37')](_0x26a8d4['query']);_0x457a84[_0x405f('0x39')]=_[_0x405f('0x3a')](_0x457a84[_0x405f('0x36')],_0x457a84['query']);_0x2039e2['attributes']=_['intersection'](_0x457a84['model'],qs['fields'](_0x26a8d4[_0x405f('0x38')][_0x405f('0x3c')]));_0x2039e2[_0x405f('0x3b')]=_0x2039e2[_0x405f('0x3b')]['length']?_0x2039e2[_0x405f('0x3b')]:_0x457a84[_0x405f('0x36')];if(!_0x26a8d4[_0x405f('0x38')]['hasOwnProperty'](_0x405f('0x3d'))){_0x2039e2[_0x405f('0x3e')]=qs['limit'](_0x26a8d4[_0x405f('0x38')]['limit']);_0x2039e2[_0x405f('0x22')]=qs[_0x405f('0x22')](_0x26a8d4[_0x405f('0x38')]['offset']);}_0x2039e2[_0x405f('0x85')]=qs['sort'](_0x26a8d4[_0x405f('0x38')][_0x405f('0x3f')]);_0x2039e2['where']=qs[_0x405f('0x39')](_[_0x405f('0x40')](_0x26a8d4[_0x405f('0x38')],_0x457a84[_0x405f('0x39')]));_0x2039e2['where'][_0x405f('0xad')]=_0x5a8ce8['id'];if(_0x26a8d4['query']['filter']){_0x2039e2[_0x405f('0x6f')]=_[_0x405f('0xae')](_0x2039e2[_0x405f('0x6f')],{'$or':_[_0x405f('0x2d')](_0x2039e2[_0x405f('0x3b')],function(_0x353377){var _0x218747={};_0x218747[_0x353377]={'$like':'%'+_0x26a8d4[_0x405f('0x38')]['filter']+'%'};return _0x218747;})});}if(_0x26a8d4[_0x405f('0x38')][_0x405f('0x6c')]){var _0x121c1f=_0x26a8d4[_0x405f('0x38')][_0x405f('0x6c')]['split'](',');var _0x17a1d1={};_0x17a1d1[_0x121c1f[0x0]]={'$gte':moment(_0x121c1f[0x1])[_0x405f('0xaf')](_0x405f('0xb0'))};_0x2039e2[_0x405f('0x6f')]=_[_0x405f('0xae')](_0x2039e2[_0x405f('0x6f')],_0x17a1d1);}_0x2039e2=_[_0x405f('0xae')]({},_0x2039e2,_0x26a8d4['options']);return db[_0x405f('0xaa')]['count']({'where':_0x2039e2['where']})[_0x405f('0x27')](function(_0x341cc3){_0x1d6801[_0x405f('0xb1')]=_0x341cc3;if(_0x26a8d4['query'][_0x405f('0xb2')]){_0x2039e2[_0x405f('0xb3')]=[{'all':!![]}];}return db[_0x405f('0xaa')][_0x405f('0xb4')](_0x2039e2);})[_0x405f('0x27')](function(_0x549a33){_0x1d6801[_0x405f('0xa3')]=_0x549a33;return _0x1d6801;});}})[_0x405f('0x27')](respondWithFilteredResult(_0x39072a,_0x2039e2))[_0x405f('0x32')](handleError(_0x39072a,null));};exports['addTags']=function(_0x3465bb,_0x4378e3,_0x821123){return db[_0x405f('0x34')][_0x405f('0xa5')]({'where':{'id':_0x3465bb[_0x405f('0xa4')]['id']}})[_0x405f('0x27')](handleEntityNotFound(_0x4378e3,null))[_0x405f('0x27')](function(_0x28ff47){if(_0x28ff47){return _0x28ff47[_0x405f('0xb5')](_0x3465bb['body']['ids'],_[_0x405f('0x55')](_0x3465bb['body'],[_0x405f('0xab'),'id'])||{})[_0x405f('0xb6')](function(){return db[_0x405f('0xb7')][_0x405f('0xb4')]({'attributes':['id',_0x405f('0x2a'),_0x405f('0x42')],'where':{'id':_0x3465bb[_0x405f('0xa7')][_0x405f('0xab')]}});})['then'](function(_0x60346b){socket[_0x405f('0xb8')](_0x405f('0xb9'),{'id':Number(_0x3465bb['params']['id']),'tags':_0x60346b||[]});return{'id':Number(_0x3465bb[_0x405f('0xa4')]['id']),'tags':_0x60346b||[]};});}})[_0x405f('0x27')](respondWithResult(_0x4378e3,null))[_0x405f('0x32')](handleError(_0x4378e3,null));};exports[_0x405f('0xba')]=function(_0x14e472,_0x16d975,_0x3b3a15){return db[_0x405f('0x34')][_0x405f('0xa5')]({'where':{'id':_0x14e472[_0x405f('0xa4')]['id']}})[_0x405f('0x27')](handleEntityNotFound(_0x16d975,null))['then'](function(_0x2f04f1){if(_0x2f04f1){return _0x2f04f1[_0x405f('0xba')](_0x14e472[_0x405f('0x38')]['ids']);}})['then'](respondWithStatusCode(_0x16d975,null))['catch'](handleError(_0x16d975,null));};exports['download']=function(_0x1b801b,_0x27e87a){var _0x5400f8=moment()[_0x405f('0xbb')]()['toString']();var _0x30518e=path['join'](config[_0x405f('0xbc')],_0x405f('0xbd'),_0x405f('0xbe'),_0x405f('0xbf'));var _0x2bc1c4=path['join'](config[_0x405f('0xbc')],_0x405f('0xbd'),_0x405f('0xbe'),_0x405f('0xc0'));var _0xaa22fa=path[_0x405f('0x7a')](_0x30518e,_0x5400f8);var _0x3103f9=util[_0x405f('0xaf')](_0x405f('0xc1'),_0x1b801b['params']['id'],_0x5400f8);var _0x47e9ae=path[_0x405f('0x7a')](_0x30518e,_0x3103f9);var _0x422ecc=![];return db[_0x405f('0x34')]['find']({'where':{'id':_0x1b801b[_0x405f('0xa4')]['id']},'include':[{'model':db['OpenchannelMessage'],'as':_0x405f('0xc2'),'attributes':['id',_0x405f('0xa7'),_0x405f('0x6b'),_0x405f('0xc3'),_0x405f('0xc4'),_0x405f('0x72')],'include':[{'model':db[_0x405f('0xc5')],'as':'User','attributes':['id',_0x405f('0xc6')],'raw':!![]},{'model':db[_0x405f('0xc7')],'as':_0x405f('0xc8'),'attributes':['id',_0x405f('0xc9'),_0x405f('0xca')],'raw':!![]},{'model':db[_0x405f('0xcb')],'as':'Attachment','raw':!![]}]},{'model':db[_0x405f('0xcc')],'as':'Account','attributes':['id',_0x405f('0x2a')]},{'model':db[_0x405f('0xc5')],'as':'Owner','attributes':['id','fullname']}]})['then'](handleEntityNotFound(_0x27e87a,null))['then'](function(_0x3edae8){if(_0x3edae8){var _0x5155f8=_0x3edae8[_0x405f('0xcd')]({'plain':!![]});_0x422ecc=!![];var _0x49f7a8={'format':'A4','border':_0x405f('0xce'),'header':{'height':_0x405f('0xcf'),'contents':{'first':_0x405f('0xd0')}},'footer':{'height':_0x405f('0xd1'),'contents':{'default':util[_0x405f('0xaf')]('\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{{page}}/{{pages}}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',util[_0x405f('0xaf')](_0x405f('0xd2'),_0x405f('0xd3'),_0x5155f8['id']),moment()[_0x405f('0xaf')]('YYYY-MM-DD')[_0x405f('0x91')]())}}};fs[_0x405f('0xd4')](_0xaa22fa);var _0x52087f={'channel':_0x405f('0xd3'),'account':_0x5155f8['Account']['name'],'agent':_0x5155f8[_0x405f('0xd5')]?_0x5155f8['Owner']['fullname']:_0x405f('0xd6'),'createdAt':moment(_0x5155f8[_0x405f('0x6b')])[_0x405f('0xaf')](_0x405f('0xb0'))[_0x405f('0x91')](),'closedAt':_0x5155f8[_0x405f('0xd7')]?moment(_0x5155f8[_0x405f('0xd8')])[_0x405f('0xaf')](_0x405f('0xb0'))[_0x405f('0x91')]():'','disposition':_0x5155f8[_0x405f('0xd9')],'visibility':_0x5155f8[_0x405f('0xda')]?_0x405f('0xdb'):_0x405f('0xdc'),'messages':_(_0x5155f8[_0x405f('0xc2')])[_0x405f('0x66')]({'secret':![]})['map'](function(_0x5eb3ce){if(_0x5eb3ce[_0x405f('0xcb')]){var _0x440f89=path['join'](_0x2bc1c4,_0x5eb3ce[_0x405f('0xcb')][_0x405f('0xdd')]);if(fs[_0x405f('0xde')](_0x440f89)){fs[_0x405f('0xdf')](_0x440f89)[_0x405f('0xe0')](fs['createWriteStream'](path[_0x405f('0x7a')](_0xaa22fa,_0x5eb3ce[_0x405f('0xcb')][_0x405f('0xdd')])));}}return{'date':moment(_0x5eb3ce[_0x405f('0x6b')])[_0x405f('0xaf')]('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'sender':_0x5eb3ce[_0x405f('0xc3')]===_0x405f('0xe1')?_0x5eb3ce['User']?_0x5eb3ce[_0x405f('0xc5')][_0x405f('0xc6')]:_0x405f('0xe2'):_0x5eb3ce[_0x405f('0xc8')][_0x405f('0xc9')]+(_0x5eb3ce[_0x405f('0xc8')][_0x405f('0xca')]?'\x20'+_0x5eb3ce[_0x405f('0xc8')][_0x405f('0xca')]:''),'body':_0x5eb3ce[_0x405f('0xcb')]?_0x5eb3ce['Attachment'][_0x405f('0xdd')]:_0x5eb3ce['body'],'direction':_0x5eb3ce['direction']==='out'?'A':'C','secret':_0x5eb3ce[_0x405f('0xc4')],'read':_0x5eb3ce[_0x405f('0x72')],'attachment':_0x5eb3ce[_0x405f('0xcb')]};})[_0x405f('0x5a')]()};return ejs[_0x405f('0xe3')](path[_0x405f('0x7a')](config[_0x405f('0xbc')],_0x405f('0xbd'),_0x405f('0xe4'),_0x405f('0xe5')),{'interaction':_0x52087f})[_0x405f('0x27')](function(_0x285a86){return new BPromise(function(_0x16b786,_0x56ba37){pdf['create'](_0x285a86,_0x49f7a8)[_0x405f('0xe6')](path[_0x405f('0x7a')](_0xaa22fa,_0x405f('0xe7')+_0x5155f8['id']+'-'+_0x5400f8+_0x405f('0xe8')),function(_0x11355d,_0x414390){if(_0x11355d)return _0x56ba37(_0x11355d);_0x16b786(_0x414390);});});});}})['then'](function(){if(_0x422ecc){return new BPromise(function(_0x58de7f,_0x1128b7){zipdir(_0xaa22fa,{'saveTo':_0x47e9ae},function(_0x4c7068,_0x5dcc7c){if(_0x4c7068)return _0x1128b7(_0x4c7068);return _0x58de7f(_0x5dcc7c);});})['then'](function(){return new BPromise(function(_0x54bcc7,_0x283267){rimraf(_0xaa22fa,function(_0x35260d){if(_0x35260d)_0x283267(_0x35260d);return _0x54bcc7();});});})[_0x405f('0x27')](function(){return _0x27e87a[_0x405f('0xe9')](_0x47e9ae,_0x3103f9,function(_0x248352){if(_0x248352){console['log'](_0x405f('0xea'),_0x248352);}else{fs[_0x405f('0xeb')](_0x47e9ae);}});});}else{return _0x27e87a[_0x405f('0x1f')](0xc8);}})[_0x405f('0x32')](handleError(_0x27e87a,null));}; \ No newline at end of file +var _0x5618=['err','unlinkSync','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','bluebird','sox','ejs','lodash','squel','jsforce','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./openchannelInteraction.socket','register','end','json','count','offset','status','set','Content-Range','apply','reject','update','then','sendStatus','name','Users','Tags','TagIds','push','catch','index','OpenchannelInteraction','rawAttributes','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','limit','order','sort','where','pick','filters','select','field','color','from','tools_tags','ui.OpenchannelInteractionId','left_join','users','openchannel_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','openchannel_accounts','parse','advancedFilter','matchType','substr','omit','omitBy','options','custom','forEach','columns','expr','value','values','table','getConditionValue','isRangeCondition','parseOperator','hasMultipleConditions','having','$between','`\x20>\x200','filter','isNil','isEmpty','OpenchannelAccountId','i.OpenchannelAccountId\x20IN\x20?','concat','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','replace','\x27\x27\x27\x27','toString','join','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','i.from\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','DESC','tag','isArray','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','openchannel_interaction_has_tags','t.id\x20=\x20it.TagId','t.id\x20IN\x20?','TagId','mail_interaction_has_tags','it.MailInteractionId\x20=\x20i.id','sequelize','keyBy','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','i.*','c.firstName','c.lastName','c.email','Contact.email','c.phone','c.fax','Contact.fax','GROUP_CONCAT(DISTINCT\x20t.id)','it.OpenchannelInteractionId\x20=\x20i.id','OpenchannelInteractionId','all','include','merge','find','create','body','params','describe','addMessage','ids','getMessages','OpenchannelMessage','nolimit','map','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','findAll','rows','addTags','setTags','spread','Tag','emit','removeTags','download','root','server','files','attachments','Messages','createdAt','direction','User','fullname','CmContact','Contact','firstName','lastName','Attachment','OpenchannelAccount','Owner','get','10px','30px','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{{page}}/{{pages}}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Openchannel','mkdirSync','Account','N.A.','closed','closedAt','disposition','Public','basename','existsSync','createReadStream','pipe','createWriteStream','System','out','secret','views','downloadInteraction.html','toFile','transcript-','.pdf','log'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x5618,0x1bc));var _0x8561=function(_0x2344b1,_0x57f7b0){_0x2344b1=_0x2344b1-0x0;var _0x443627=_0x5618[_0x2344b1];return _0x443627;};'use strict';var pdf=require(_0x8561('0x0'));var emlformat=require(_0x8561('0x1'));var rimraf=require(_0x8561('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8561('0x3'));var rp=require(_0x8561('0x4'));var moment=require('moment');var BPromise=require(_0x8561('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x8561('0x6'));var csv=require('to-csv');var ejs=require(_0x8561('0x7'));var fs=require('fs');var _=require(_0x8561('0x8'));var squel=require(_0x8561('0x9'));var crypto=require('crypto');var jsforce=require(_0x8561('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x8561('0xb'));var querystring=require(_0x8561('0xc'));var Papa=require('papaparse');var Redis=require(_0x8561('0xd'));var authService=require(_0x8561('0xe'));var qs=require(_0x8561('0xf'));var as=require(_0x8561('0x10'));var hardwareService=require(_0x8561('0x11'));var logger=require(_0x8561('0x12'))(_0x8561('0x13'));var utils=require(_0x8561('0x14'));var config=require(_0x8561('0x15'));var db=require(_0x8561('0x16'))['db'];config['redis']=_[_0x8561('0x17')](config[_0x8561('0x18')],{'host':_0x8561('0x19'),'port':0x18eb});var socket=require(_0x8561('0x1a'))(new Redis(config[_0x8561('0x18')]));require(_0x8561('0x1b'))[_0x8561('0x1c')](socket);function respondWithStatusCode(_0x18566b,_0x571474){_0x571474=_0x571474||0xcc;return function(_0x2b94b1){if(_0x2b94b1){return _0x18566b['sendStatus'](_0x571474);}return _0x18566b['status'](_0x571474)[_0x8561('0x1d')]();};}function respondWithResult(_0x39a97c,_0x32384b){_0x32384b=_0x32384b||0xc8;return function(_0x280cfe){if(_0x280cfe){return _0x39a97c['status'](_0x32384b)[_0x8561('0x1e')](_0x280cfe);}};}function respondWithFilteredResult(_0x2bb5f1,_0x33aa2c){return function(_0x2c9446){if(_0x2c9446){var _0x2d27c4=_0x2c9446[_0x8561('0x1f')],_0xccdb7a=_0x33aa2c[_0x8561('0x20')],_0x4774f6=_0x33aa2c['offset']+_0x33aa2c['limit'],_0x279dd4;if(_0x4774f6>=_0x2d27c4){_0x4774f6=_0x2d27c4;_0x279dd4=0xc8;}else{_0x279dd4=0xce;}_0x2bb5f1[_0x8561('0x21')](_0x279dd4);return _0x2bb5f1[_0x8561('0x22')](_0x8561('0x23'),_0xccdb7a+'-'+_0x4774f6+'/'+_0x2d27c4)[_0x8561('0x1e')](_0x2c9446);}return null;};}function patchUpdates(_0x37a97f){return function(_0x1f204e){try{jsonpatch[_0x8561('0x24')](_0x1f204e,_0x37a97f,!![]);}catch(_0x36868b){return BPromise[_0x8561('0x25')](_0x36868b);}return _0x1f204e['save']();};}function saveUpdates(_0x1568bb,_0x4880d2){return function(_0x514568){if(_0x514568){return _0x514568[_0x8561('0x26')](_0x1568bb)[_0x8561('0x27')](function(_0x22691e){return _0x22691e;});}return null;};}function removeEntity(_0x381525,_0x2a24c0){return function(_0x4795a6){if(_0x4795a6){return _0x4795a6['destroy']()[_0x8561('0x27')](function(){_0x381525[_0x8561('0x21')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2bade4,_0x297ea4){return function(_0x4febd9){if(!_0x4febd9){_0x2bade4[_0x8561('0x28')](0x194);}return _0x4febd9;};}function handleError(_0x207555,_0x18a7f5){_0x18a7f5=_0x18a7f5||0x1f4;return function(_0x1279ab){logger['error'](_0x1279ab['stack']);if(_0x1279ab['name']){delete _0x1279ab[_0x8561('0x29')];}_0x207555['status'](_0x18a7f5)['send'](_0x1279ab);};}function getInteractionUsers(_0x24a28f,_0x1e811b){return new BPromise(function(_0x1f7870,_0x20e431){try{if(_0x1e811b[_0x24a28f['id']]){_0x24a28f[_0x8561('0x2a')]=_['map'](_0x1e811b[_0x24a28f['id']],function(_0x4454bb){return{'id':_0x4454bb['id']};});}}catch(_0x241892){_0x20e431(_0x241892);}_0x1f7870(_0x24a28f);});}function getInteractionTags(_0x20a503,_0x211306){return new BPromise(function(_0x2a8bb6,_0x39473c){try{if(_0x20a503['TagIds']){_0x20a503[_0x8561('0x2b')]=[];_0x20a503[_0x8561('0x2c')]['split'](',')['forEach'](function(_0x2c7f01){_0x20a503['Tags'][_0x8561('0x2d')](_0x211306[_0x2c7f01]);});}delete _0x20a503[_0x8561('0x2c')];}catch(_0x9136fa){_0x39473c(_0x9136fa);}_0x2a8bb6(_0x20a503);});}function updateOpenchannelInteraction(_0x39562c,_0x41fe5d,_0x1b61b8){return new BPromise(function(_0x893866,_0xd30f8){return getInteractionUsers(_0x39562c,_0x1b61b8)[_0x8561('0x27')](function(_0x521397){return getInteractionTags(_0x521397,_0x41fe5d);})[_0x8561('0x27')](function(_0x2acfb4){_0x893866(_0x2acfb4);})[_0x8561('0x2e')](function(_0x4203a6){_0xd30f8(_0x4203a6);});});}exports[_0x8561('0x2f')]=function(_0x67555b,_0x3aa334){var _0x23cea7={},_0x380c37={},_0x3e66ee={'count':0x0,'rows':[]};var _0x21fc72=db[_0x8561('0x30')][_0x8561('0x31')];_0x380c37[_0x8561('0x32')]=_[_0x8561('0x33')](_0x21fc72);_0x380c37[_0x8561('0x34')]=_[_0x8561('0x33')](_0x67555b[_0x8561('0x34')]);_0x380c37['filters']=_[_0x8561('0x35')](_0x380c37[_0x8561('0x32')],_0x380c37['query']);_0x23cea7[_0x8561('0x36')]=_[_0x8561('0x35')](_0x380c37[_0x8561('0x32')],qs[_0x8561('0x37')](_0x67555b[_0x8561('0x34')][_0x8561('0x37')]));_0x23cea7[_0x8561('0x36')]=_0x23cea7[_0x8561('0x36')][_0x8561('0x38')]?_0x23cea7[_0x8561('0x36')]:_0x380c37[_0x8561('0x32')];if(!_0x67555b[_0x8561('0x34')][_0x8561('0x39')]('nolimit')){_0x23cea7[_0x8561('0x3a')]=qs['limit'](_0x67555b[_0x8561('0x34')][_0x8561('0x3a')]);_0x23cea7[_0x8561('0x20')]=qs[_0x8561('0x20')](_0x67555b['query'][_0x8561('0x20')]);}_0x23cea7[_0x8561('0x3b')]=qs[_0x8561('0x3c')](_0x67555b['query'][_0x8561('0x3c')]);_0x23cea7[_0x8561('0x3d')]=qs['filters'](_[_0x8561('0x3e')](_0x67555b[_0x8561('0x34')],_0x380c37[_0x8561('0x3f')]));var _0x129671=[];var _0x27f573=squel[_0x8561('0x40')]()[_0x8561('0x41')]('id')[_0x8561('0x41')](_0x8561('0x29'))[_0x8561('0x41')](_0x8561('0x42'))[_0x8561('0x43')](_0x8561('0x44'));var _0x3a8bc9=squel[_0x8561('0x40')]()[_0x8561('0x41')]('u.id')[_0x8561('0x41')](_0x8561('0x45'))[_0x8561('0x43')]('user_has_openchannel_interactions','ui')[_0x8561('0x46')](_0x8561('0x47'),'u','u.id\x20=\x20ui.UserId');var _0x282d7f=squel[_0x8561('0x40')]()[_0x8561('0x43')](_0x8561('0x48'),'i')[_0x8561('0x46')](_0x8561('0x49'),'c',_0x8561('0x4a'))[_0x8561('0x46')](_0x8561('0x47'),'o','o.id\x20=\x20i.UserId')[_0x8561('0x46')](_0x8561('0x4b'),'a','a.id\x20=\x20i.OpenchannelAccountId')['left_join']('openchannel_messages','me','me.OpenchannelInteractionId\x20=\x20i.id');var _0x3ffb31=squel['expr']();var _0x360329=_0x67555b['query']['advancedFilter']?JSON[_0x8561('0x4c')](_0x67555b[_0x8561('0x34')][_0x8561('0x4d')]):undefined;if(_0x360329){var _0x2b9f3c=_0x360329[_0x8561('0x4e')][_0x8561('0x4f')](0x1);_(_0x360329)[_0x8561('0x50')](_0x8561('0x4e'))[_0x8561('0x51')](function(_0x1eb28a,_0x1036bc){return _0x1eb28a[_0x8561('0x52')][_0x8561('0x53')]===!![];})[_0x8561('0x33')]()[_0x8561('0x54')](function(_0x2cab5f){var _0x194eed=_0x360329[_0x2cab5f];if(_0x194eed[_0x8561('0x52')][_0x8561('0x55')]){var _0x4b6165=squel[_0x8561('0x56')]();if(as['hasMultipleConditions'](_0x194eed[_0x8561('0x57')])){var _0x4fd8c4=_[_0x8561('0x58')](_0x194eed['value'])[0x0];_0x4fd8c4[_0x8561('0x54')](function(_0x14b6c1){_0x194eed[_0x8561('0x52')][_0x8561('0x55')]['forEach'](function(_0x380aac){_0x4b6165['or'](_0x194eed[_0x8561('0x52')][_0x8561('0x59')]+'.'+_0x380aac+'\x20'+as['parseOperator'](_0x14b6c1),as[_0x8561('0x5a')](_0x14b6c1));});});}else{var _0x4588f5=as[_0x8561('0x5b')](_0x194eed[_0x8561('0x57')])?_0x194eed[_0x8561('0x57')][0x1]:undefined;_0x194eed[_0x8561('0x52')]['columns'][_0x8561('0x54')](function(_0x28bcd2){_0x4b6165['or'](_0x194eed[_0x8561('0x52')][_0x8561('0x59')]+'.'+_0x28bcd2+'\x20'+as[_0x8561('0x5c')](_0x194eed[_0x8561('0x57')]),as[_0x8561('0x5a')](_0x194eed[_0x8561('0x57')]),_0x4588f5);});}_0x3ffb31[_0x2b9f3c](_0x4b6165);}else if(as[_0x8561('0x5d')](_0x194eed[_0x8561('0x57')])){var _0x4fd8c4=_[_0x8561('0x58')](_0x194eed[_0x8561('0x57')])[0x0];_0x4fd8c4['forEach'](function(_0x1aaa0b){if(!_0x194eed[_0x8561('0x52')][_0x8561('0x5e')]){var _0x2d128d=as['isRangeCondition'](_0x1aaa0b)?_0x1aaa0b[_0x8561('0x5f')][0x1]:undefined;_0x3ffb31[_0x2b9f3c](_0x194eed[_0x8561('0x52')][_0x8561('0x59')]+'.'+_0x2cab5f+'\x20'+as[_0x8561('0x5c')](_0x1aaa0b),as[_0x8561('0x5a')](_0x1aaa0b),_0x2d128d);}});}else{if(_0x194eed[_0x8561('0x52')]['having']){var _0x3ea5dd=as[_0x8561('0x5a')](_0x194eed[_0x8561('0x57')]);if(_0x3ea5dd[_0x8561('0x38')]===0x1){if(_0x3ea5dd==0x1){_0x282d7f[_0x8561('0x5e')]('`'+_0x2cab5f+'`\x20=\x200');}else{_0x282d7f[_0x8561('0x5e')]('`'+_0x2cab5f+_0x8561('0x60'));}}}else{var _0x4588f5=as[_0x8561('0x5b')](_0x194eed[_0x8561('0x57')])?_0x194eed['value']['$between'][0x1]:undefined;_0x3ffb31[_0x2b9f3c](_0x194eed[_0x8561('0x52')][_0x8561('0x59')]+'.'+_0x2cab5f+'\x20'+as[_0x8561('0x5c')](_0x194eed[_0x8561('0x57')]),as['getConditionValue'](_0x194eed[_0x8561('0x57')]),_0x4588f5);}}});}else{var _0x23daf7=_(Object['keys'](_0x67555b[_0x8561('0x34')]))['map'](function(_0x4d1ff6){return _0x21fc72['hasOwnProperty'](_0x4d1ff6)?_0x4d1ff6:undefined;})[_0x8561('0x61')](function(_0x32e757){return!_[_0x8561('0x62')](_0x32e757);})['value']();if(!_[_0x8561('0x63')](_0x23daf7)){_0x23daf7['forEach'](function(_0x43c135){if(_0x43c135===_0x8561('0x64')){_0x282d7f[_0x8561('0x3d')](_0x8561('0x65'),[][_0x8561('0x66')](_0x67555b[_0x8561('0x34')][_0x43c135]));}else if(_0x43c135==='createdAt'){var _0x5ecf9f=JSON['parse'](_0x67555b['query'][_0x43c135])['$gte'];var _0x48b648=JSON[_0x8561('0x4c')](_0x67555b[_0x8561('0x34')][_0x43c135])['$lte'];_0x282d7f['where'](_0x8561('0x67'),_0x5ecf9f,_0x48b648);}else{if(_0x67555b[_0x8561('0x34')][_0x43c135]===_0x8561('0x68')){_0x282d7f[_0x8561('0x3d')]('i.'+_0x43c135+_0x8561('0x69'));}else{_0x282d7f[_0x8561('0x3d')]('i.'+_0x43c135+'\x20=\x20?',_0x67555b[_0x8561('0x34')][_0x43c135]);}}});}if(_0x67555b[_0x8561('0x34')]['read']){if(_0x67555b['query'][_0x8561('0x6a')]==0x1){_0x282d7f[_0x8561('0x5e')](_0x8561('0x6b'));}else{_0x282d7f[_0x8561('0x5e')](_0x8561('0x6c'));}}if(_0x67555b[_0x8561('0x34')][_0x8561('0x61')]){var _0x2e3fa8=_0x67555b[_0x8561('0x34')][_0x8561('0x61')][_0x8561('0x6d')]('\x5c','\x5c\x5c')[_0x8561('0x6d')]('\x27\x27',_0x8561('0x6e'));if(qs['isNumeric'](_0x2e3fa8)){_0x3ffb31['or']('i.id\x20LIKE\x20?',_0x2e3fa8+'%');}else{var _0x140e44=[];_0x2e3fa8['split']('\x20')[_0x8561('0x54')](function(_0x5cd57f){_0x140e44[_0x8561('0x2d')]('+'+_0x5cd57f[_0x8561('0x6f')]());});var _0x54c9c3=_0x140e44[_0x8561('0x70')]('\x20');_0x3ffb31['or'](_0x8561('0x71'),_0x54c9c3)['or'](_0x8561('0x72'),_0x2e3fa8+'%')['or'](_0x8561('0x73'),_0x2e3fa8+'%');}}}_0x282d7f['where'](_0x3ffb31);_0x282d7f[_0x8561('0x74')](_0x8561('0x75'));var _0x4d4325={'type':db[_0x8561('0x76')]['QueryTypes'][_0x8561('0x77')],'raw':!![]};var _0x52da9c=_0x282d7f[_0x8561('0x78')]();_0x52da9c['field']('i.id');_0x52da9c['field'](_0x8561('0x79'),_0x8561('0x7a'));if(_0x23cea7['order']){_0x23cea7[_0x8561('0x3b')]['forEach'](function(_0xae89d5){_0x282d7f['order']('i.'+_0xae89d5[0x0],_0xae89d5[0x1]===_0x8561('0x7b')?![]:!![]);});}var _0x3ed39d=[];var _0x22cc03=squel[_0x8561('0x56')]();if(!_0x360329){if(_0x67555b['query'][_0x8561('0x7c')]){_0x3ed39d=_[_0x8561('0x7d')](_0x67555b[_0x8561('0x34')][_0x8561('0x7c')])?_0x67555b[_0x8561('0x34')][_0x8561('0x7c')]:new Array(_0x67555b[_0x8561('0x34')][_0x8561('0x7c')]);_0x3ed39d[_0x8561('0x54')](function(_0x2671d6){_0x22cc03['or'](_0x8561('0x7e'),'%,'+_0x2671d6+',%');});_0x282d7f[_0x8561('0x5e')](_0x22cc03);_0x52da9c[_0x8561('0x46')](_0x8561('0x7f'),'it','it.OpenchannelInteractionId\x20=\x20i.id');_0x52da9c[_0x8561('0x46')](_0x8561('0x44'),'t',_0x8561('0x80'));_0x52da9c[_0x8561('0x3d')](_0x8561('0x81'),_0x3ed39d);}}else{if(_0x360329[_0x8561('0x39')](_0x8561('0x82'))){if(as['hasMultipleConditions'](_0x360329[_0x8561('0x82')][_0x8561('0x57')])){var _0x572e76=_[_0x8561('0x58')](_0x360329[_0x8561('0x82')]['value'])[0x0];_0x572e76[_0x8561('0x54')](function(_0x36f2ba){as[_0x8561('0x5a')](_0x36f2ba)[_0x8561('0x54')](function(_0x43273a){_0x3ed39d[_0x8561('0x2d')](_0x43273a);});});}else{_0x3ed39d=as[_0x8561('0x5a')](_0x360329[_0x8561('0x82')][_0x8561('0x57')]);}_0x3ed39d[_0x8561('0x54')](function(_0x57f5be){_0x22cc03['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x57f5be+',%');});_0x282d7f[_0x8561('0x5e')](_0x22cc03);_0x52da9c['left_join'](_0x8561('0x83'),'it',_0x8561('0x84'));_0x52da9c[_0x8561('0x46')](_0x8561('0x44'),'t',_0x8561('0x80'));_0x52da9c[_0x8561('0x3d')]('t.id\x20IN\x20?',_0x3ed39d);}}db[_0x8561('0x85')]['query'](_0x52da9c[_0x8561('0x6f')](),_0x4d4325)[_0x8561('0x27')](function(_0x3e58cb){_0x3e66ee['count']=_0x3e58cb[_0x8561('0x38')];if(_0x3e66ee[_0x8561('0x1f')]===0x0)return[];return db['sequelize']['query'](_0x27f573[_0x8561('0x6f')](),_0x4d4325)[_0x8561('0x27')](function(_0x15716b){_0x129671=_[_0x8561('0x86')](_0x15716b,'id');_0x4d4325=_['merge'](_0x4d4325,{'model':db[_0x8561('0x30')],'mapToModel':!![],'raw':!![],'nest':!![]});_0x282d7f[_0x8561('0x41')](_0x8561('0x79'),_0x8561('0x7a'));_0x282d7f[_0x8561('0x41')](_0x8561('0x87'),_0x8561('0x88'));_0x282d7f[_0x8561('0x41')](_0x8561('0x89'),_0x8561('0x8a'));_0x282d7f['field'](_0x8561('0x8b'));_0x282d7f[_0x8561('0x41')](_0x8561('0x8c'),'Contact.firstName');_0x282d7f[_0x8561('0x41')](_0x8561('0x8d'),'Contact.lastName');_0x282d7f[_0x8561('0x41')](_0x8561('0x8e'),_0x8561('0x8f'));_0x282d7f[_0x8561('0x41')](_0x8561('0x90'),'Contact.phone');_0x282d7f[_0x8561('0x41')]('c.mobile','Contact.mobile');_0x282d7f[_0x8561('0x41')](_0x8561('0x91'),_0x8561('0x92'));_0x282d7f[_0x8561('0x41')](_0x8561('0x93'),_0x8561('0x2c'));_0x282d7f[_0x8561('0x46')](_0x8561('0x7f'),'it',_0x8561('0x94'));_0x282d7f['left_join'](_0x8561('0x44'),'t',_0x8561('0x80'));_0x282d7f[_0x8561('0x3a')](_0x23cea7[_0x8561('0x3a')]);_0x282d7f['offset'](_0x23cea7[_0x8561('0x20')]);return db[_0x8561('0x85')][_0x8561('0x34')](_0x282d7f[_0x8561('0x6f')](),_0x4d4325);})[_0x8561('0x27')](function(_0x2eafba){_0x3a8bc9['where']('ui.OpenchannelInteractionId\x20IN\x20?',_['map'](_0x2eafba,'id'));return db[_0x8561('0x85')][_0x8561('0x34')](_0x3a8bc9[_0x8561('0x6f')](),_0x4d4325)[_0x8561('0x27')](function(_0x2b2825){var _0x13c681=_['groupBy'](_0x2b2825,_0x8561('0x95'));var _0x4d3301=[];_0x2eafba['forEach'](function(_0x2e817b){_0x4d3301[_0x8561('0x2d')](updateOpenchannelInteraction(_0x2e817b,_0x129671,_0x13c681));});return BPromise[_0x8561('0x96')](_0x4d3301);});});})[_0x8561('0x27')](function(_0x512e3f){_0x3e66ee['rows']=_0x512e3f;return _0x3e66ee;})[_0x8561('0x27')](respondWithFilteredResult(_0x3aa334,_0x23cea7))[_0x8561('0x2e')](handleError(_0x3aa334,null));};exports['show']=function(_0x3ccd09,_0x3abc02){var _0x5d504e={'raw':![],'where':{'id':_0x3ccd09['params']['id']}},_0x4af8a7={};_0x4af8a7[_0x8561('0x32')]=_[_0x8561('0x33')](db['OpenchannelInteraction'][_0x8561('0x31')]);_0x4af8a7['query']=_[_0x8561('0x33')](_0x3ccd09[_0x8561('0x34')]);_0x4af8a7[_0x8561('0x3f')]=_[_0x8561('0x35')](_0x4af8a7[_0x8561('0x32')],_0x4af8a7['query']);_0x5d504e[_0x8561('0x36')]=_[_0x8561('0x35')](_0x4af8a7[_0x8561('0x32')],qs[_0x8561('0x37')](_0x3ccd09[_0x8561('0x34')]['fields']));_0x5d504e[_0x8561('0x36')]=_0x5d504e[_0x8561('0x36')][_0x8561('0x38')]?_0x5d504e[_0x8561('0x36')]:_0x4af8a7['model'];if(_0x3ccd09[_0x8561('0x34')]['includeAll']){_0x5d504e[_0x8561('0x97')]=[{'all':!![]}];}_0x5d504e=_[_0x8561('0x98')]({},_0x5d504e,_0x3ccd09[_0x8561('0x52')]);return db[_0x8561('0x30')][_0x8561('0x99')](_0x5d504e)[_0x8561('0x27')](handleEntityNotFound(_0x3abc02,null))[_0x8561('0x27')](respondWithResult(_0x3abc02,null))[_0x8561('0x2e')](handleError(_0x3abc02,null));};exports[_0x8561('0x9a')]=function(_0x466769,_0x13e736){return db[_0x8561('0x30')]['create'](_0x466769[_0x8561('0x9b')],{})['then'](respondWithResult(_0x13e736,0xc9))[_0x8561('0x2e')](handleError(_0x13e736,null));};exports[_0x8561('0x26')]=function(_0x818bb9,_0xee250){if(_0x818bb9[_0x8561('0x9b')]['id']){delete _0x818bb9[_0x8561('0x9b')]['id'];}return db['OpenchannelInteraction']['find']({'where':{'id':_0x818bb9[_0x8561('0x9c')]['id']}})[_0x8561('0x27')](handleEntityNotFound(_0xee250,null))[_0x8561('0x27')](saveUpdates(_0x818bb9[_0x8561('0x9b')],null))[_0x8561('0x27')](respondWithResult(_0xee250,null))[_0x8561('0x2e')](handleError(_0xee250,null));};exports['destroy']=function(_0x52dec6,_0x41a644){return db[_0x8561('0x30')][_0x8561('0x99')]({'where':{'id':_0x52dec6[_0x8561('0x9c')]['id']}})[_0x8561('0x27')](handleEntityNotFound(_0x41a644,null))['then'](removeEntity(_0x41a644,null))[_0x8561('0x2e')](handleError(_0x41a644,null));};exports['describe']=function(_0x5ad4ec,_0x2aabd4){return db[_0x8561('0x30')][_0x8561('0x9d')]()['then'](respondWithResult(_0x2aabd4,null))[_0x8561('0x2e')](handleError(_0x2aabd4,null));};exports[_0x8561('0x9e')]=function(_0x5f28a9,_0x3fe8a1,_0x4206db){return db['OpenchannelMessage'][_0x8561('0x99')]({'where':{'id':_0x5f28a9[_0x8561('0x9c')]['id']}})[_0x8561('0x27')](handleEntityNotFound(_0x3fe8a1,null))[_0x8561('0x27')](function(_0x491b9d){if(_0x491b9d){return _0x491b9d[_0x8561('0x9e')](_0x5f28a9[_0x8561('0x9b')]['ids'],_['omit'](_0x5f28a9[_0x8561('0x9b')],[_0x8561('0x9f'),'id'])||{});}})['then'](respondWithResult(_0x3fe8a1,null))['catch'](handleError(_0x3fe8a1,null));};exports[_0x8561('0xa0')]=function(_0x349bda,_0x57d73d,_0x8f339d){var _0x5e9815={'raw':![],'where':{}};var _0xf6a2f3={};var _0x3c6871={'count':0x0,'rows':[]};return db['OpenchannelInteraction']['findOne']({'where':{'id':_0x349bda[_0x8561('0x9c')]['id']}})['then'](handleEntityNotFound(_0x57d73d,null))['then'](function(_0x8434ae){if(_0x8434ae){_0xf6a2f3[_0x8561('0x32')]=_['keys'](db[_0x8561('0xa1')][_0x8561('0x31')]);_0xf6a2f3[_0x8561('0x34')]=_[_0x8561('0x33')](_0x349bda[_0x8561('0x34')]);_0xf6a2f3[_0x8561('0x3f')]=_[_0x8561('0x35')](_0xf6a2f3[_0x8561('0x32')],_0xf6a2f3['query']);_0x5e9815[_0x8561('0x36')]=_['intersection'](_0xf6a2f3[_0x8561('0x32')],qs['fields'](_0x349bda[_0x8561('0x34')]['fields']));_0x5e9815[_0x8561('0x36')]=_0x5e9815[_0x8561('0x36')][_0x8561('0x38')]?_0x5e9815[_0x8561('0x36')]:_0xf6a2f3[_0x8561('0x32')];if(!_0x349bda[_0x8561('0x34')][_0x8561('0x39')](_0x8561('0xa2'))){_0x5e9815[_0x8561('0x3a')]=qs['limit'](_0x349bda[_0x8561('0x34')][_0x8561('0x3a')]);_0x5e9815[_0x8561('0x20')]=qs[_0x8561('0x20')](_0x349bda[_0x8561('0x34')][_0x8561('0x20')]);}_0x5e9815[_0x8561('0x3b')]=qs[_0x8561('0x3c')](_0x349bda[_0x8561('0x34')]['sort']);_0x5e9815[_0x8561('0x3d')]=qs[_0x8561('0x3f')](_[_0x8561('0x3e')](_0x349bda[_0x8561('0x34')],_0xf6a2f3[_0x8561('0x3f')]));_0x5e9815['where']['OpenchannelInteractionId']=_0x8434ae['id'];if(_0x349bda['query'][_0x8561('0x61')]){_0x5e9815[_0x8561('0x3d')]=_[_0x8561('0x98')](_0x5e9815['where'],{'$or':_[_0x8561('0xa3')](_0x5e9815[_0x8561('0x36')],function(_0x3d429b){var _0x46afb2={};_0x46afb2[_0x3d429b]={'$like':'%'+_0x349bda[_0x8561('0x34')][_0x8561('0x61')]+'%'};return _0x46afb2;})});}if(_0x349bda[_0x8561('0x34')][_0x8561('0xa4')]){var _0x34c118=_0x349bda[_0x8561('0x34')][_0x8561('0xa4')][_0x8561('0xa5')](',');var _0x684b6e={};_0x684b6e[_0x34c118[0x0]]={'$gte':moment(_0x34c118[0x1])[_0x8561('0xa6')](_0x8561('0xa7'))};_0x5e9815[_0x8561('0x3d')]=_['merge'](_0x5e9815[_0x8561('0x3d')],_0x684b6e);}_0x5e9815=_[_0x8561('0x98')]({},_0x5e9815,_0x349bda[_0x8561('0x52')]);return db['OpenchannelMessage'][_0x8561('0x1f')]({'where':_0x5e9815[_0x8561('0x3d')]})[_0x8561('0x27')](function(_0x58a1ea){_0x3c6871['count']=_0x58a1ea;if(_0x349bda[_0x8561('0x34')]['includeAll']){_0x5e9815[_0x8561('0x97')]=[{'all':!![]}];}return db['OpenchannelMessage'][_0x8561('0xa8')](_0x5e9815);})[_0x8561('0x27')](function(_0x250832){_0x3c6871[_0x8561('0xa9')]=_0x250832;return _0x3c6871;});}})[_0x8561('0x27')](respondWithFilteredResult(_0x57d73d,_0x5e9815))[_0x8561('0x2e')](handleError(_0x57d73d,null));};exports[_0x8561('0xaa')]=function(_0x24bff0,_0x4dd7ea,_0x4855ea){return db[_0x8561('0x30')][_0x8561('0x99')]({'where':{'id':_0x24bff0[_0x8561('0x9c')]['id']}})['then'](handleEntityNotFound(_0x4dd7ea,null))[_0x8561('0x27')](function(_0x26ee59){if(_0x26ee59){return _0x26ee59[_0x8561('0xab')](_0x24bff0[_0x8561('0x9b')][_0x8561('0x9f')],_[_0x8561('0x50')](_0x24bff0[_0x8561('0x9b')],[_0x8561('0x9f'),'id'])||{})[_0x8561('0xac')](function(){return db[_0x8561('0xad')][_0x8561('0xa8')]({'attributes':['id',_0x8561('0x29'),'color'],'where':{'id':_0x24bff0[_0x8561('0x9b')][_0x8561('0x9f')]}});})[_0x8561('0x27')](function(_0x564dd0){socket[_0x8561('0xae')]('openchannelInteractionTags:save',{'id':Number(_0x24bff0[_0x8561('0x9c')]['id']),'tags':_0x564dd0||[]});return{'id':Number(_0x24bff0[_0x8561('0x9c')]['id']),'tags':_0x564dd0||[]};});}})[_0x8561('0x27')](respondWithResult(_0x4dd7ea,null))[_0x8561('0x2e')](handleError(_0x4dd7ea,null));};exports[_0x8561('0xaf')]=function(_0x379848,_0x2fdd99,_0x5621ac){return db[_0x8561('0x30')]['find']({'where':{'id':_0x379848['params']['id']}})['then'](handleEntityNotFound(_0x2fdd99,null))['then'](function(_0x6a7adf){if(_0x6a7adf){return _0x6a7adf[_0x8561('0xaf')](_0x379848[_0x8561('0x34')][_0x8561('0x9f')]);}})['then'](respondWithStatusCode(_0x2fdd99,null))[_0x8561('0x2e')](handleError(_0x2fdd99,null));};exports[_0x8561('0xb0')]=function(_0x187127,_0x209760){var _0xeacd4d=moment()['unix']()[_0x8561('0x6f')]();var _0x535a0e=path['join'](config[_0x8561('0xb1')],_0x8561('0xb2'),_0x8561('0xb3'),'tmp');var _0x212f55=path[_0x8561('0x70')](config[_0x8561('0xb1')],_0x8561('0xb2'),_0x8561('0xb3'),_0x8561('0xb4'));var _0x1d73df=path['join'](_0x535a0e,_0xeacd4d);var _0xe06766=util[_0x8561('0xa6')]('transcript-%d-%s.zip',_0x187127['params']['id'],_0xeacd4d);var _0x1ca668=path[_0x8561('0x70')](_0x535a0e,_0xe06766);var _0x1f9d2a=![];return db['OpenchannelInteraction'][_0x8561('0x99')]({'where':{'id':_0x187127[_0x8561('0x9c')]['id']},'include':[{'model':db['OpenchannelMessage'],'as':_0x8561('0xb5'),'attributes':['id',_0x8561('0x9b'),_0x8561('0xb6'),_0x8561('0xb7'),'secret',_0x8561('0x6a')],'include':[{'model':db[_0x8561('0xb8')],'as':'User','attributes':['id',_0x8561('0xb9')],'raw':!![]},{'model':db[_0x8561('0xba')],'as':_0x8561('0xbb'),'attributes':['id',_0x8561('0xbc'),_0x8561('0xbd')],'raw':!![]},{'model':db[_0x8561('0xbe')],'as':'Attachment','raw':!![]}]},{'model':db[_0x8561('0xbf')],'as':'Account','attributes':['id','name']},{'model':db['User'],'as':_0x8561('0xc0'),'attributes':['id','fullname']}]})['then'](handleEntityNotFound(_0x209760,null))[_0x8561('0x27')](function(_0x531ca1){if(_0x531ca1){var _0x5b9090=_0x531ca1[_0x8561('0xc1')]({'plain':!![]});_0x1f9d2a=!![];var _0x31b931={'format':'A4','border':_0x8561('0xc2'),'header':{'height':'40px','contents':{'first':'\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
Interaction\x20Transcript
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20'}},'footer':{'height':_0x8561('0xc3'),'contents':{'default':util[_0x8561('0xa6')](_0x8561('0xc4'),util['format']('%s\x20#%d',_0x8561('0xc5'),_0x5b9090['id']),moment()['format']('YYYY-MM-DD')[_0x8561('0x6f')]())}}};fs[_0x8561('0xc6')](_0x1d73df);var _0x176d26={'channel':_0x8561('0xc5'),'account':_0x5b9090[_0x8561('0xc7')][_0x8561('0x29')],'agent':_0x5b9090[_0x8561('0xc0')]?_0x5b9090[_0x8561('0xc0')]['fullname']:_0x8561('0xc8'),'createdAt':moment(_0x5b9090[_0x8561('0xb6')])['format'](_0x8561('0xa7'))[_0x8561('0x6f')](),'closedAt':_0x5b9090[_0x8561('0xc9')]?moment(_0x5b9090[_0x8561('0xca')])['format'](_0x8561('0xa7'))[_0x8561('0x6f')]():'','disposition':_0x5b9090[_0x8561('0xcb')],'visibility':_0x5b9090['threadId']?_0x8561('0xcc'):'Private','messages':_(_0x5b9090[_0x8561('0xb5')])[_0x8561('0x61')]({'secret':![]})['map'](function(_0x9dacf){if(_0x9dacf[_0x8561('0xbe')]){var _0x111de7=path['join'](_0x212f55,_0x9dacf[_0x8561('0xbe')][_0x8561('0xcd')]);if(fs[_0x8561('0xce')](_0x111de7)){fs[_0x8561('0xcf')](_0x111de7)[_0x8561('0xd0')](fs[_0x8561('0xd1')](path[_0x8561('0x70')](_0x1d73df,_0x9dacf[_0x8561('0xbe')][_0x8561('0xcd')])));}}return{'date':moment(_0x9dacf[_0x8561('0xb6')])[_0x8561('0xa6')]('YYYY-MM-DD\x20HH:mm:ss')[_0x8561('0x6f')](),'sender':_0x9dacf[_0x8561('0xb7')]==='out'?_0x9dacf[_0x8561('0xb8')]?_0x9dacf[_0x8561('0xb8')][_0x8561('0xb9')]:_0x8561('0xd2'):_0x9dacf[_0x8561('0xbb')][_0x8561('0xbc')]+(_0x9dacf[_0x8561('0xbb')][_0x8561('0xbd')]?'\x20'+_0x9dacf[_0x8561('0xbb')][_0x8561('0xbd')]:''),'body':_0x9dacf[_0x8561('0xbe')]?_0x9dacf['Attachment'][_0x8561('0xcd')]:_0x9dacf[_0x8561('0x9b')],'direction':_0x9dacf[_0x8561('0xb7')]===_0x8561('0xd3')?'A':'C','secret':_0x9dacf[_0x8561('0xd4')],'read':_0x9dacf[_0x8561('0x6a')],'attachment':_0x9dacf[_0x8561('0xbe')]};})[_0x8561('0x57')]()};return ejs['renderFile'](path[_0x8561('0x70')](config[_0x8561('0xb1')],'server',_0x8561('0xd5'),_0x8561('0xd6')),{'interaction':_0x176d26})[_0x8561('0x27')](function(_0x10b9f6){return new BPromise(function(_0x1be779,_0x263b16){pdf[_0x8561('0x9a')](_0x10b9f6,_0x31b931)[_0x8561('0xd7')](path[_0x8561('0x70')](_0x1d73df,_0x8561('0xd8')+_0x5b9090['id']+'-'+_0xeacd4d+_0x8561('0xd9')),function(_0x3b5484,_0x7dec21){if(_0x3b5484)return _0x263b16(_0x3b5484);_0x1be779(_0x7dec21);});});});}})[_0x8561('0x27')](function(){if(_0x1f9d2a){return new BPromise(function(_0x50b149,_0x3b0751){zipdir(_0x1d73df,{'saveTo':_0x1ca668},function(_0x40af5b,_0x4eff29){if(_0x40af5b)return _0x3b0751(_0x40af5b);return _0x50b149(_0x4eff29);});})['then'](function(){return new BPromise(function(_0x1ff237,_0x7bc378){rimraf(_0x1d73df,function(_0x525ed2){if(_0x525ed2)_0x7bc378(_0x525ed2);return _0x1ff237();});});})[_0x8561('0x27')](function(){return _0x209760[_0x8561('0xb0')](_0x1ca668,_0xe06766,function(_0x48c125){if(_0x48c125){console[_0x8561('0xda')](_0x8561('0xdb'),_0x48c125);}else{fs[_0x8561('0xdc')](_0x1ca668);}});});}else{return _0x209760[_0x8561('0x28')](0xc8);}})['catch'](handleError(_0x209760,null));}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.events.js b/server/api/openchannelInteraction/openchannelInteraction.events.js index e19cb7f..3e8a206 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 _0x7c6e=['hasOwnProperty','hook','exports','events','../../mysqldb','OpenchannelInteraction','OpenchannelMessage','setMaxListeners','save','update','remove','getUsers','then','Users','map','findAll','unreadMessages','length','emit','catch'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x7c6e,0x17f));var _0xe7c6=function(_0x1468b,_0xe4ebed){_0x1468b=_0x1468b-0x0;var _0x275f34=_0x7c6e[_0x1468b];return _0x275f34;};'use strict';var EventEmitter=require(_0xe7c6('0x0'));var OpenchannelInteraction=require(_0xe7c6('0x1'))['db'][_0xe7c6('0x2')];var OpenchannelMessage=require('../../mysqldb')['db'][_0xe7c6('0x3')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0xe7c6('0x4')](0x0);var events={'afterCreate':_0xe7c6('0x5'),'afterUpdate':_0xe7c6('0x6'),'afterDestroy':_0xe7c6('0x7')};function emitEvent(_0x18338c){return function(_0x487935,_0x2e4162,_0x582d78){_0x487935[_0xe7c6('0x8')]({'attributes':['id'],'raw':!![]})[_0xe7c6('0x9')](function(_0x4b83e5){_0x487935['setDataValue'](_0xe7c6('0xa'),_0x4b83e5[_0xe7c6('0xb')](function(_0x4ac0ce){return{'id':_0x4ac0ce['id']};}));return OpenchannelMessage[_0xe7c6('0xc')]({'where':{'OpenchannelInteractionId':_0x487935['id'],'direction':'in','read':![]},'raw':!![]});})[_0xe7c6('0x9')](function(_0x222753){_0x487935['setDataValue'](_0xe7c6('0xd'),_0x222753[_0xe7c6('0xe')]);OpenchannelInteractionEvents[_0xe7c6('0xf')](_0x18338c+':'+_0x487935['id'],_0x487935);OpenchannelInteractionEvents['emit'](_0x18338c,_0x487935);_0x582d78(null);})[_0xe7c6('0x10')](_0x582d78(null));};}for(var e in events){if(events[_0xe7c6('0x11')](e)){var event=events[e];OpenchannelInteraction[_0xe7c6('0x12')](e,emitEvent(event));}}module[_0xe7c6('0x13')]=OpenchannelInteractionEvents; \ No newline at end of file +var _0x5879=['length','emit','catch','hasOwnProperty','hook','events','../../mysqldb','OpenchannelMessage','setMaxListeners','save','update','remove','getUsers','then','Users','map','findAll','setDataValue','unreadMessages'];(function(_0xf96ca7,_0x448dc2){var _0x120685=function(_0x31ea28){while(--_0x31ea28){_0xf96ca7['push'](_0xf96ca7['shift']());}};_0x120685(++_0x448dc2);}(_0x5879,0x16e));var _0x9587=function(_0x1c7b0d,_0x1f537e){_0x1c7b0d=_0x1c7b0d-0x0;var _0x276987=_0x5879[_0x1c7b0d];return _0x276987;};'use strict';var EventEmitter=require(_0x9587('0x0'));var OpenchannelInteraction=require(_0x9587('0x1'))['db']['OpenchannelInteraction'];var OpenchannelMessage=require(_0x9587('0x1'))['db'][_0x9587('0x2')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x9587('0x3')](0x0);var events={'afterCreate':_0x9587('0x4'),'afterUpdate':_0x9587('0x5'),'afterDestroy':_0x9587('0x6')};function emitEvent(_0x156cb6){return function(_0x57c73a,_0x38f8e8,_0x2a7b48){_0x57c73a[_0x9587('0x7')]({'attributes':['id'],'raw':!![]})[_0x9587('0x8')](function(_0x26b888){_0x57c73a['setDataValue'](_0x9587('0x9'),_0x26b888[_0x9587('0xa')](function(_0x4cfadc){return{'id':_0x4cfadc['id']};}));return OpenchannelMessage[_0x9587('0xb')]({'where':{'OpenchannelInteractionId':_0x57c73a['id'],'direction':'in','read':![]},'raw':!![]});})[_0x9587('0x8')](function(_0x32b97e){_0x57c73a[_0x9587('0xc')](_0x9587('0xd'),_0x32b97e[_0x9587('0xe')]);OpenchannelInteractionEvents[_0x9587('0xf')](_0x156cb6+':'+_0x57c73a['id'],_0x57c73a);OpenchannelInteractionEvents[_0x9587('0xf')](_0x156cb6,_0x57c73a);_0x2a7b48(null);})[_0x9587('0x10')](_0x2a7b48(null));};}for(var e in events){if(events[_0x9587('0x11')](e)){var event=events[e];OpenchannelInteraction[_0x9587('0x12')](e,emitEvent(event));}}module['exports']=OpenchannelInteractionEvents; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.model.js b/server/api/openchannelInteraction/openchannelInteraction.model.js index 5ea3d26..495bf99 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 _0x9fd4=['moment','bluebird','request-promise','path','rimraf','exports','define','openchannel_interactions','changed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api'];(function(_0x1c8503,_0x457dd5){var _0x3ff59f=function(_0x5f3002){while(--_0x5f3002){_0x1c8503['push'](_0x1c8503['shift']());}};_0x3ff59f(++_0x457dd5);}(_0x9fd4,0x16c));var _0x49fd=function(_0x433d0a,_0x348f5b){_0x433d0a=_0x433d0a-0x0;var _0x883e8e=_0x9fd4[_0x433d0a];return _0x883e8e;};'use strict';var _=require(_0x49fd('0x0'));var util=require(_0x49fd('0x1'));var logger=require(_0x49fd('0x2'))(_0x49fd('0x3'));var moment=require(_0x49fd('0x4'));var BPromise=require(_0x49fd('0x5'));var rp=require(_0x49fd('0x6'));var fs=require('fs');var path=require(_0x49fd('0x7'));var rimraf=require(_0x49fd('0x8'));var config=require('../../config/environment');var attributes=require('./openchannelInteraction.attributes');module[_0x49fd('0x9')]=function(_0x42fdc7,_0x1bc16e){return _0x42fdc7[_0x49fd('0xa')]('OpenchannelInteraction',attributes,{'tableName':_0x49fd('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x461ac1,_0x36f605,_0x3bf3fd){if(_0x461ac1[_0x49fd('0xc')]('closed')){_0x461ac1[_0x49fd('0xd')]=moment()[_0x49fd('0xe')](_0x49fd('0xf'));}_0x3bf3fd(null,_0x461ac1);}}});}; \ No newline at end of file +var _0x236d=['request-promise','path','rimraf','exports','define','changed','closed','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','api','bluebird'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x236d,0x7e));var _0xd236=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x236d[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xd236('0x0'));var util=require(_0xd236('0x1'));var logger=require('../../config/logger')(_0xd236('0x2'));var moment=require('moment');var BPromise=require(_0xd236('0x3'));var rp=require(_0xd236('0x4'));var fs=require('fs');var path=require(_0xd236('0x5'));var rimraf=require(_0xd236('0x6'));var config=require('../../config/environment');var attributes=require('./openchannelInteraction.attributes');module[_0xd236('0x7')]=function(_0x29a67c,_0x75d84c){return _0x29a67c[_0xd236('0x8')]('OpenchannelInteraction',attributes,{'tableName':'openchannel_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2d9025,_0x18d969,_0x4e0460){if(_0x2d9025[_0xd236('0x9')](_0xd236('0xa'))){_0x2d9025['closedAt']=moment()[_0xd236('0xb')](_0xd236('0xc'));}_0x4e0460(null,_0x2d9025);}}});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.rpc.js b/server/api/openchannelInteraction/openchannelInteraction.rpc.js index da2246a..3963ce5 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 _0xbb1d=['options','raw','where','limit','catch','AddTagsToOpenchannelInteraction','OpenchannelInteraction','addTags','ids','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','localhost','socket.io-emitter','redis','./openchannelInteraction.socket','register','request','then','info','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','UpdateOpenchannelInteraction','update','body'];(function(_0x4e4cd6,_0x35929f){var _0x35f48a=function(_0x1b01ba){while(--_0x1b01ba){_0x4e4cd6['push'](_0x4e4cd6['shift']());}};_0x35f48a(++_0x35929f);}(_0xbb1d,0x163));var _0xdbb1=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xbb1d[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0xdbb1('0x0'));var util=require(_0xdbb1('0x1'));var moment=require(_0xdbb1('0x2'));var BPromise=require(_0xdbb1('0x3'));var rs=require(_0xdbb1('0x4'));var fs=require('fs');var Redis=require(_0xdbb1('0x5'));var db=require(_0xdbb1('0x6'))['db'];var utils=require(_0xdbb1('0x7'));var logger=require(_0xdbb1('0x8'))('rpc');var config=require(_0xdbb1('0x9'));var jayson=require(_0xdbb1('0xa'));var client=jayson[_0xdbb1('0xb')][_0xdbb1('0xc')]({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':_0xdbb1('0xd'),'port':0x18eb});var socket=require(_0xdbb1('0xe'))(new Redis(config[_0xdbb1('0xf')]));require(_0xdbb1('0x10'))[_0xdbb1('0x11')](socket);function respondWithRpcPromise(_0xa9992d,_0x4730a6,_0x56c258){return new BPromise(function(_0x2b5552,_0xdc243c){return client[_0xdbb1('0x12')](_0xa9992d,_0x56c258)[_0xdbb1('0x13')](function(_0x76f713){logger[_0xdbb1('0x14')](_0xdbb1('0x15'),_0x4730a6,_0xdbb1('0x16'));logger[_0xdbb1('0x17')](_0xdbb1('0x18'),_0x4730a6,_0xdbb1('0x16'),JSON[_0xdbb1('0x19')](_0x76f713));if(_0x76f713[_0xdbb1('0x1a')]){if(_0x76f713['error'][_0xdbb1('0x1b')]===0x1f4){logger[_0xdbb1('0x1a')]('OpenchannelInteraction,\x20%s,\x20%s',_0x4730a6,_0x76f713[_0xdbb1('0x1a')]['message']);return _0xdc243c(_0x76f713['error'][_0xdbb1('0x1c')]);}logger[_0xdbb1('0x1a')]('OpenchannelInteraction,\x20%s,\x20%s',_0x4730a6,_0x76f713[_0xdbb1('0x1a')]['message']);return _0x2b5552(_0x76f713[_0xdbb1('0x1a')][_0xdbb1('0x1c')]);}else{logger[_0xdbb1('0x14')](_0xdbb1('0x15'),_0x4730a6,_0xdbb1('0x16'));_0x2b5552(_0x76f713['result'][_0xdbb1('0x1c')]);}})['catch'](function(_0x2f6b0f){logger['error']('OpenchannelInteraction,\x20%s,\x20%s',_0x4730a6,_0x2f6b0f);_0xdc243c(_0x2f6b0f);});});}exports[_0xdbb1('0x1d')]=function(_0x16bfbc){var _0x56862a=this;return new Promise(function(_0x4eaddc,_0x17b54a){return db['OpenchannelInteraction'][_0xdbb1('0x1e')](_0x16bfbc[_0xdbb1('0x1f')],{'raw':_0x16bfbc[_0xdbb1('0x20')]?_0x16bfbc[_0xdbb1('0x20')][_0xdbb1('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x16bfbc[_0xdbb1('0x20')]?_0x16bfbc['options'][_0xdbb1('0x22')]||null:null,'attributes':_0x16bfbc[_0xdbb1('0x20')]?_0x16bfbc[_0xdbb1('0x20')]['attributes']||null:null,'limit':_0x16bfbc['options']?_0x16bfbc['options'][_0xdbb1('0x23')]||null:null})[_0xdbb1('0x13')](function(_0xee7e1f){logger[_0xdbb1('0x14')](_0xdbb1('0x1d'),_0x16bfbc);logger[_0xdbb1('0x17')](_0xdbb1('0x1d'),_0x16bfbc,JSON[_0xdbb1('0x19')](_0xee7e1f));_0x4eaddc(_0xee7e1f);})[_0xdbb1('0x24')](function(_0x2a7386){logger['error'](_0xdbb1('0x1d'),_0x2a7386[_0xdbb1('0x1c')],_0x16bfbc);_0x17b54a(_0x56862a[_0xdbb1('0x1a')](0x1f4,_0x2a7386[_0xdbb1('0x1c')]));});});};exports[_0xdbb1('0x25')]=function(_0x2bc024){return new Promise(function(_0x541486,_0x1ac49f){return db[_0xdbb1('0x26')]['find']({'where':_0x2bc024[_0xdbb1('0x20')]?_0x2bc024[_0xdbb1('0x20')][_0xdbb1('0x22')]||null:null})[_0xdbb1('0x13')](function(_0x4c3c29){if(_0x4c3c29){return _0x4c3c29[_0xdbb1('0x27')](_0x2bc024[_0xdbb1('0x1f')]['ids'],_['omit'](_0x2bc024[_0xdbb1('0x1f')],[_0xdbb1('0x28'),'id'])||{});}})[_0xdbb1('0x29')](function(_0x429ec1){logger['info'](_0xdbb1('0x2a'),_0x2bc024);logger['debug'](_0xdbb1('0x2a'),_0x2bc024,JSON[_0xdbb1('0x19')](_0x429ec1));_0x541486(_0x429ec1);})[_0xdbb1('0x24')](function(_0x19e95a){logger[_0xdbb1('0x1a')](_0xdbb1('0x2a'),_0x19e95a[_0xdbb1('0x1c')],_0x2bc024);_0x1ac49f(_this['error'](0x1f4,_0x19e95a[_0xdbb1('0x1c')]));});});}; \ No newline at end of file +var _0x60f2=['OpenchannelInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','UpdateOpenchannelInteraction','OpenchannelInteraction','update','body','options','raw','where','limit','AddTagsToOpenchannelInteraction','find','addTags','omit','ids','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','register','then','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x355ce8,_0x5f1d0a){var _0x1db8b8=function(_0x277eb2){while(--_0x277eb2){_0x355ce8['push'](_0x355ce8['shift']());}};_0x1db8b8(++_0x5f1d0a);}(_0x60f2,0x1b4));var _0x260f=function(_0x366a12,_0x4103c9){_0x366a12=_0x366a12-0x0;var _0x130ad2=_0x60f2[_0x366a12];return _0x130ad2;};'use strict';var _=require(_0x260f('0x0'));var util=require(_0x260f('0x1'));var moment=require(_0x260f('0x2'));var BPromise=require(_0x260f('0x3'));var rs=require(_0x260f('0x4'));var fs=require('fs');var Redis=require(_0x260f('0x5'));var db=require(_0x260f('0x6'))['db'];var utils=require(_0x260f('0x7'));var logger=require(_0x260f('0x8'))(_0x260f('0x9'));var config=require(_0x260f('0xa'));var jayson=require(_0x260f('0xb'));var client=jayson[_0x260f('0xc')][_0x260f('0xd')]({'port':0x232a});config[_0x260f('0xe')]=_[_0x260f('0xf')](config[_0x260f('0xe')],{'host':_0x260f('0x10'),'port':0x18eb});var socket=require(_0x260f('0x11'))(new Redis(config[_0x260f('0xe')]));require(_0x260f('0x12'))[_0x260f('0x13')](socket);function respondWithRpcPromise(_0x6f8e4b,_0x13514f,_0x1ff83b){return new BPromise(function(_0x49c024,_0x1ba4eb){return client['request'](_0x6f8e4b,_0x1ff83b)[_0x260f('0x14')](function(_0x5ce16c){logger['info'](_0x260f('0x15'),_0x13514f,_0x260f('0x16'));logger[_0x260f('0x17')](_0x260f('0x18'),_0x13514f,_0x260f('0x16'),JSON[_0x260f('0x19')](_0x5ce16c));if(_0x5ce16c[_0x260f('0x1a')]){if(_0x5ce16c['error'][_0x260f('0x1b')]===0x1f4){logger[_0x260f('0x1a')](_0x260f('0x15'),_0x13514f,_0x5ce16c[_0x260f('0x1a')][_0x260f('0x1c')]);return _0x1ba4eb(_0x5ce16c[_0x260f('0x1a')]['message']);}logger[_0x260f('0x1a')](_0x260f('0x15'),_0x13514f,_0x5ce16c[_0x260f('0x1a')][_0x260f('0x1c')]);return _0x49c024(_0x5ce16c[_0x260f('0x1a')][_0x260f('0x1c')]);}else{logger[_0x260f('0x1d')](_0x260f('0x15'),_0x13514f,_0x260f('0x16'));_0x49c024(_0x5ce16c['result']['message']);}})[_0x260f('0x1e')](function(_0x2f57cb){logger[_0x260f('0x1a')](_0x260f('0x15'),_0x13514f,_0x2f57cb);_0x1ba4eb(_0x2f57cb);});});}exports[_0x260f('0x1f')]=function(_0x21df35){var _0x13aa7e=this;return new Promise(function(_0x3eba01,_0x46a73d){return db[_0x260f('0x20')][_0x260f('0x21')](_0x21df35[_0x260f('0x22')],{'raw':_0x21df35[_0x260f('0x23')]?_0x21df35['options'][_0x260f('0x24')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x21df35[_0x260f('0x23')]?_0x21df35['options'][_0x260f('0x25')]||null:null,'attributes':_0x21df35[_0x260f('0x23')]?_0x21df35['options']['attributes']||null:null,'limit':_0x21df35['options']?_0x21df35[_0x260f('0x23')][_0x260f('0x26')]||null:null})[_0x260f('0x14')](function(_0x50f990){logger[_0x260f('0x1d')](_0x260f('0x1f'),_0x21df35);logger['debug']('UpdateOpenchannelInteraction',_0x21df35,JSON['stringify'](_0x50f990));_0x3eba01(_0x50f990);})[_0x260f('0x1e')](function(_0x38b086){logger[_0x260f('0x1a')](_0x260f('0x1f'),_0x38b086[_0x260f('0x1c')],_0x21df35);_0x46a73d(_0x13aa7e[_0x260f('0x1a')](0x1f4,_0x38b086[_0x260f('0x1c')]));});});};exports[_0x260f('0x27')]=function(_0x482cd0){return new Promise(function(_0x5cb501,_0x23de54){return db[_0x260f('0x20')][_0x260f('0x28')]({'where':_0x482cd0['options']?_0x482cd0[_0x260f('0x23')][_0x260f('0x25')]||null:null})[_0x260f('0x14')](function(_0x43f434){if(_0x43f434){return _0x43f434[_0x260f('0x29')](_0x482cd0['body']['ids'],_[_0x260f('0x2a')](_0x482cd0[_0x260f('0x22')],[_0x260f('0x2b'),'id'])||{});}})[_0x260f('0x2c')](function(_0x44470e){logger['info'](_0x260f('0x2d'),_0x482cd0);logger[_0x260f('0x17')]('AddTags',_0x482cd0,JSON[_0x260f('0x19')](_0x44470e));_0x5cb501(_0x44470e);})[_0x260f('0x1e')](function(_0x504256){logger[_0x260f('0x1a')](_0x260f('0x2d'),_0x504256[_0x260f('0x1c')],_0x482cd0);_0x23de54(_this[_0x260f('0x1a')](0x1f4,_0x504256[_0x260f('0x1c')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.socket.js b/server/api/openchannelInteraction/openchannelInteraction.socket.js index ca65357..bf2d7c6 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 _0x5c89=['remove','update','emit','register','openchannelInteraction:','save'];(function(_0x36eaaa,_0x326732){var _0x461349=function(_0x4e4180){while(--_0x4e4180){_0x36eaaa['push'](_0x36eaaa['shift']());}};_0x461349(++_0x326732);}(_0x5c89,0x149));var _0x95c8=function(_0x20a257,_0x274282){_0x20a257=_0x20a257-0x0;var _0x39ac96=_0x5c89[_0x20a257];return _0x39ac96;};'use strict';var OpenchannelInteractionEvents=require('./openchannelInteraction.events');var events=[_0x95c8('0x0'),_0x95c8('0x1'),_0x95c8('0x2')];function createListener(_0x33ea73,_0x145cc0){return function(_0x271080){_0x145cc0[_0x95c8('0x3')](_0x33ea73,_0x271080);};}function removeListener(_0x917b70,_0x36b319){return function(){OpenchannelInteractionEvents['removeListener'](_0x917b70,_0x36b319);};}exports[_0x95c8('0x4')]=function(_0xcbbcdd){for(var _0x17a0d1=0x0,_0x59a251=events['length'];_0x17a0d1<_0x59a251;_0x17a0d1++){var _0x17d9b0=events[_0x17a0d1];var _0x5c0ee1=createListener(_0x95c8('0x5')+_0x17d9b0,_0xcbbcdd);OpenchannelInteractionEvents['on'](_0x17d9b0,_0x5c0ee1);}}; \ No newline at end of file +var _0x2eb7=['register','length','openchannelInteraction:','./openchannelInteraction.events','remove','update','removeListener'];(function(_0x5d9867,_0x5e9030){var _0x7d2118=function(_0x2e5149){while(--_0x2e5149){_0x5d9867['push'](_0x5d9867['shift']());}};_0x7d2118(++_0x5e9030);}(_0x2eb7,0xea));var _0x72eb=function(_0x510108,_0x1c35df){_0x510108=_0x510108-0x0;var _0x5ee0c8=_0x2eb7[_0x510108];return _0x5ee0c8;};'use strict';var OpenchannelInteractionEvents=require(_0x72eb('0x0'));var events=['save',_0x72eb('0x1'),_0x72eb('0x2')];function createListener(_0x3c6854,_0x1c2f9c){return function(_0x5c0735){_0x1c2f9c['emit'](_0x3c6854,_0x5c0735);};}function removeListener(_0x10787c,_0x5724e6){return function(){OpenchannelInteractionEvents[_0x72eb('0x3')](_0x10787c,_0x5724e6);};}exports[_0x72eb('0x4')]=function(_0x5b23b0){for(var _0x2d27ba=0x0,_0x2dc928=events[_0x72eb('0x5')];_0x2d27ba<_0x2dc928;_0x2d27ba++){var _0x59bf55=events[_0x2d27ba];var _0x54abfd=createListener(_0x72eb('0x6')+_0x59bf55,_0x5b23b0);OpenchannelInteractionEvents['on'](_0x59bf55,_0x54abfd);}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/index.js b/server/api/openchannelMessage/index.js index ddf3b47..596f516 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 _0x49b6=['/describe','/:id','tracked','create','put','update','/:id/accept','accept','reject','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','./openchannelMessage.controller','get','isAuthenticated','index'];(function(_0x49f3f1,_0x3bb732){var _0x4c7f5a=function(_0x4d0cf3){while(--_0x4d0cf3){_0x49f3f1['push'](_0x49f3f1['shift']());}};_0x4c7f5a(++_0x3bb732);}(_0x49b6,0x64));var _0x649b=function(_0x52a059,_0x46e42e){_0x52a059=_0x52a059-0x0;var _0x250df2=_0x49b6[_0x52a059];return _0x250df2;};'use strict';var multer=require(_0x649b('0x0'));var util=require(_0x649b('0x1'));var path=require(_0x649b('0x2'));var timeout=require(_0x649b('0x3'));var express=require(_0x649b('0x4'));var router=express[_0x649b('0x5')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x649b('0x6'));router[_0x649b('0x7')]('/',auth[_0x649b('0x8')](),controller[_0x649b('0x9')]);router[_0x649b('0x7')](_0x649b('0xa'),auth[_0x649b('0x8')](),controller['describe']);router[_0x649b('0x7')](_0x649b('0xb'),auth[_0x649b('0x8')](),controller['show']);router['post']('/',auth[_0x649b('0x8')](),interaction[_0x649b('0xc')]('openchannel','openchannelmessage:create'),controller[_0x649b('0xd')]);router[_0x649b('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x649b('0xf')]);router[_0x649b('0xe')](_0x649b('0x10'),auth[_0x649b('0x8')](),controller[_0x649b('0x11')]);router[_0x649b('0xe')]('/:id/reject',auth[_0x649b('0x8')](),controller[_0x649b('0x12')]);router[_0x649b('0x13')]('/:id',auth[_0x649b('0x8')](),controller[_0x649b('0x14')]);module[_0x649b('0x15')]=router; \ No newline at end of file +var _0x214a=['create','update','put','/:id/accept','accept','/:id/reject','reject','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','./openchannelMessage.controller','isAuthenticated','index','get','/describe','describe','/:id','show','tracked','openchannel','openchannelmessage:create'];(function(_0x11c83a,_0xefd780){var _0x52a7ed=function(_0x3f51d4){while(--_0x3f51d4){_0x11c83a['push'](_0x11c83a['shift']());}};_0x52a7ed(++_0xefd780);}(_0x214a,0x106));var _0xa214=function(_0x19728b,_0xf85163){_0x19728b=_0x19728b-0x0;var _0x46b943=_0x214a[_0x19728b];return _0x46b943;};'use strict';var multer=require(_0xa214('0x0'));var util=require(_0xa214('0x1'));var path=require(_0xa214('0x2'));var timeout=require(_0xa214('0x3'));var express=require('express');var router=express[_0xa214('0x4')]();var auth=require(_0xa214('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xa214('0x6'));var controller=require(_0xa214('0x7'));router['get']('/',auth[_0xa214('0x8')](),controller[_0xa214('0x9')]);router[_0xa214('0xa')](_0xa214('0xb'),auth[_0xa214('0x8')](),controller[_0xa214('0xc')]);router['get'](_0xa214('0xd'),auth[_0xa214('0x8')](),controller[_0xa214('0xe')]);router['post']('/',auth[_0xa214('0x8')](),interaction[_0xa214('0xf')](_0xa214('0x10'),_0xa214('0x11')),controller[_0xa214('0x12')]);router['put'](_0xa214('0xd'),auth[_0xa214('0x8')](),controller[_0xa214('0x13')]);router[_0xa214('0x14')](_0xa214('0x15'),auth[_0xa214('0x8')](),controller[_0xa214('0x16')]);router['put'](_0xa214('0x17'),auth['isAuthenticated'](),controller[_0xa214('0x18')]);router[_0xa214('0x19')]('/:id',auth[_0xa214('0x8')](),controller[_0xa214('0x1a')]);module[_0xa214('0x1b')]=router; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.attributes.js b/server/api/openchannelMessage/openchannelMessage.attributes.js index dc2e475..ffd0783 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 _0xa934=['DATE','sequelize','exports','TEXT','medium','BOOLEAN','out'];(function(_0x5a4400,_0xfae3b6){var _0xf9b532=function(_0x39804e){while(--_0x39804e){_0x5a4400['push'](_0x5a4400['shift']());}};_0xf9b532(++_0xfae3b6);}(_0xa934,0xfd));var _0x4a93=function(_0x1371ec,_0x32a7da){_0x1371ec=_0x1371ec-0x0;var _0xbf0333=_0xa934[_0x1371ec];return _0xbf0333;};'use strict';var Sequelize=require(_0x4a93('0x0'));module[_0x4a93('0x1')]={'body':{'type':Sequelize[_0x4a93('0x2')](_0x4a93('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x4a93('0x4')],'defaultValue':![]},'secret':{'type':Sequelize[_0x4a93('0x4')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x4a93('0x5')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0x4a93('0x6')]}}; \ No newline at end of file +var _0x2a30=['out','DATE','sequelize','TEXT','medium','BOOLEAN','ENUM'];(function(_0x1576f1,_0x496cf5){var _0x4f63c6=function(_0x565cd1){while(--_0x565cd1){_0x1576f1['push'](_0x1576f1['shift']());}};_0x4f63c6(++_0x496cf5);}(_0x2a30,0x159));var _0x02a3=function(_0x52262f,_0x8af9f1){_0x52262f=_0x52262f-0x0;var _0x348270=_0x2a30[_0x52262f];return _0x348270;};'use strict';var Sequelize=require(_0x02a3('0x0'));module['exports']={'body':{'type':Sequelize[_0x02a3('0x1')](_0x02a3('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x02a3('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0x02a3('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x02a3('0x4')]('in','out'),'defaultValue':_0x02a3('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0x02a3('0x6')]}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.controller.js b/server/api/openchannelMessage/openchannelMessage.controller.js index 337f2d0..be9a27c 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 _0x7691=['acceptMessage','channel','EventManager','openchannel-interactions','agent','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','interface','SIP/%s','event','rejectmessage','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','redis','localhost','socket.io-emitter','./openchannelMessage.socket','jayson/promise','client','http','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','status','end','json','count','offset','set','Content-Range','apply','reject','update','destroy','sendStatus','name','index','OpenchannelMessage','rawAttributes','model','keys','query','attributes','length','hasOwnProperty','nolimit','limit','sort','where','filters','filter','merge','map','key','field','includeAll','include','findAll','show','params','intersection','fields','find','create','body','describe','accept','openchannel','read','format','UserId','user','CmContact','Contact','OpenchannelInteraction','OpenchannelInteractionId','isNil','YYYY-MM-DD\x20HH:mm:ss','interaction','get','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage'];(function(_0x2ac4bd,_0x5352d8){var _0x185a80=function(_0x5bd1af){while(--_0x5bd1af){_0x2ac4bd['push'](_0x2ac4bd['shift']());}};_0x185a80(++_0x5352d8);}(_0x7691,0x80));var _0x1769=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7691[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x1769('0x0'));var rimraf=require(_0x1769('0x1'));var zipdir=require(_0x1769('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1769('0x3'));var moment=require(_0x1769('0x4'));var BPromise=require(_0x1769('0x5'));var Mustache=require(_0x1769('0x6'));var util=require(_0x1769('0x7'));var path=require(_0x1769('0x8'));var sox=require('sox');var csv=require(_0x1769('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x1769('0xa'));var squel=require(_0x1769('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x1769('0xc'));var toCsv=require(_0x1769('0x9'));var querystring=require('querystring');var Papa=require(_0x1769('0xd'));var Redis=require(_0x1769('0xe'));var authService=require(_0x1769('0xf'));var qs=require(_0x1769('0x10'));var as=require(_0x1769('0x11'));var hardwareService=require(_0x1769('0x12'));var logger=require(_0x1769('0x13'))(_0x1769('0x14'));var utils=require(_0x1769('0x15'));var config=require(_0x1769('0x16'));var db=require('../../mysqldb')['db'];config[_0x1769('0x17')]=_['defaults'](config[_0x1769('0x17')],{'host':_0x1769('0x18'),'port':0x18eb});var socket=require(_0x1769('0x19'))(new Redis(config[_0x1769('0x17')]));require(_0x1769('0x1a'))['register'](socket);var jayson=require(_0x1769('0x1b'));var client=jayson[_0x1769('0x1c')][_0x1769('0x1d')]({'port':0x232c});var client9002=jayson[_0x1769('0x1c')][_0x1769('0x1d')]({'port':0x232a});function checkPasswordPattern(_0x47522c,_0x12ec9f,_0x394f1a){if(_0x394f1a){var _0x1a61c9=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1a61c9['test'](_0x12ec9f)){return _0x47522c;}else{throw new Error(_0x1769('0x1e'));}}else{return _0x47522c;}}function respondWithRpcPromise(_0x5df80d,_0x1e4f16,_0x5c008d,_0x5d1a51){return new BPromise(function(_0x420a2d,_0x21af90){var _0x2c9cd9=_0x5d1a51||client;return _0x2c9cd9[_0x1769('0x1f')](_0x5df80d,_0x5c008d)[_0x1769('0x20')](function(_0x378025){logger['info'](_0x1769('0x21'),_0x1e4f16,_0x1769('0x22'));logger[_0x1769('0x23')](_0x1769('0x24'),_0x1e4f16,'request\x20sent',JSON[_0x1769('0x25')](_0x378025));if(_0x378025[_0x1769('0x26')]){if(_0x378025['error']['code']===0x1f4){logger['error'](_0x1769('0x21'),_0x1e4f16,_0x378025[_0x1769('0x26')]['message']);return _0x21af90(_0x378025[_0x1769('0x26')][_0x1769('0x27')]);}logger[_0x1769('0x26')](_0x1769('0x21'),_0x1e4f16,_0x378025[_0x1769('0x26')][_0x1769('0x27')]);return _0x420a2d(_0x378025[_0x1769('0x26')][_0x1769('0x27')]);}else{logger[_0x1769('0x28')](_0x1769('0x21'),_0x1e4f16,'request\x20sent');_0x420a2d(_0x378025[_0x1769('0x29')]['message']);}})[_0x1769('0x2a')](function(_0x2a1999){logger[_0x1769('0x26')](_0x1769('0x21'),_0x1e4f16,_0x2a1999);_0x21af90(_0x2a1999);});});}function respondWithStatusCode(_0x4fa5fc,_0x312751){_0x312751=_0x312751||0xcc;return function(_0x153a05){if(_0x153a05){return _0x4fa5fc['sendStatus'](_0x312751);}return _0x4fa5fc[_0x1769('0x2b')](_0x312751)[_0x1769('0x2c')]();};}function respondWithResult(_0x395489,_0x689b0f){_0x689b0f=_0x689b0f||0xc8;return function(_0x1426d6){if(_0x1426d6){return _0x395489[_0x1769('0x2b')](_0x689b0f)[_0x1769('0x2d')](_0x1426d6);}};}function respondWithFilteredResult(_0x1d940b,_0x34bd29){return function(_0x2ea880){if(_0x2ea880){var _0x9fc886=_0x2ea880[_0x1769('0x2e')],_0x210847=_0x34bd29[_0x1769('0x2f')],_0x1be8ad=_0x34bd29[_0x1769('0x2f')]+_0x34bd29['limit'],_0x5749df;if(_0x1be8ad>=_0x9fc886){_0x1be8ad=_0x9fc886;_0x5749df=0xc8;}else{_0x5749df=0xce;}_0x1d940b[_0x1769('0x2b')](_0x5749df);return _0x1d940b[_0x1769('0x30')](_0x1769('0x31'),_0x210847+'-'+_0x1be8ad+'/'+_0x9fc886)[_0x1769('0x2d')](_0x2ea880);}return null;};}function patchUpdates(_0x111ef3){return function(_0x3be632){try{jsonpatch[_0x1769('0x32')](_0x3be632,_0x111ef3,!![]);}catch(_0x283227){return BPromise[_0x1769('0x33')](_0x283227);}return _0x3be632['save']();};}function saveUpdates(_0x95d1f8,_0x24c405){return function(_0x3b244a){if(_0x3b244a){return _0x3b244a[_0x1769('0x34')](_0x95d1f8)[_0x1769('0x20')](function(_0x1675db){return _0x1675db;});}return null;};}function removeEntity(_0xe7290,_0x26faee){return function(_0x3791a6){if(_0x3791a6){return _0x3791a6[_0x1769('0x35')]()['then'](function(){_0xe7290[_0x1769('0x2b')](0xcc)[_0x1769('0x2c')]();});}};}function handleEntityNotFound(_0x1c7606,_0x1781f3){return function(_0x2e1814){if(!_0x2e1814){_0x1c7606[_0x1769('0x36')](0x194);}return _0x2e1814;};}function handleError(_0x2c0f3e,_0x2ec03f){_0x2ec03f=_0x2ec03f||0x1f4;return function(_0x3a403b){logger[_0x1769('0x26')](_0x3a403b['stack']);if(_0x3a403b[_0x1769('0x37')]){delete _0x3a403b['name'];}_0x2c0f3e[_0x1769('0x2b')](_0x2ec03f)['send'](_0x3a403b);};}exports[_0x1769('0x38')]=function(_0xae8616,_0xe89f51){var _0x5a191d={},_0x219131={},_0x5a053e={'count':0x0,'rows':[]};var _0x33dd7d=db[_0x1769('0x39')][_0x1769('0x3a')];_0x219131[_0x1769('0x3b')]=_[_0x1769('0x3c')](_0x33dd7d);_0x219131[_0x1769('0x3d')]=_[_0x1769('0x3c')](_0xae8616[_0x1769('0x3d')]);_0x219131['filters']=_['intersection'](_0x219131[_0x1769('0x3b')],_0x219131[_0x1769('0x3d')]);_0x5a191d[_0x1769('0x3e')]=_['intersection'](_0x219131[_0x1769('0x3b')],qs['fields'](_0xae8616[_0x1769('0x3d')]['fields']));_0x5a191d[_0x1769('0x3e')]=_0x5a191d[_0x1769('0x3e')][_0x1769('0x3f')]?_0x5a191d[_0x1769('0x3e')]:_0x219131['model'];if(!_0xae8616[_0x1769('0x3d')][_0x1769('0x40')](_0x1769('0x41'))){_0x5a191d[_0x1769('0x42')]=qs[_0x1769('0x42')](_0xae8616[_0x1769('0x3d')][_0x1769('0x42')]);_0x5a191d[_0x1769('0x2f')]=qs[_0x1769('0x2f')](_0xae8616[_0x1769('0x3d')][_0x1769('0x2f')]);}_0x5a191d['order']=qs[_0x1769('0x43')](_0xae8616[_0x1769('0x3d')][_0x1769('0x43')]);_0x5a191d[_0x1769('0x44')]=qs[_0x1769('0x45')](_['pick'](_0xae8616[_0x1769('0x3d')],_0x219131[_0x1769('0x45')]));if(_0xae8616[_0x1769('0x3d')][_0x1769('0x46')]){_0x5a191d[_0x1769('0x44')]=_[_0x1769('0x47')](_0x5a191d[_0x1769('0x44')],{'$or':_[_0x1769('0x48')](_0x33dd7d,function(_0x3eb863){if(_0x3eb863['type'][_0x1769('0x49')]!=='VIRTUAL'){var _0x3a1dc1={};_0x3a1dc1[_0x3eb863[_0x1769('0x4a')]]={'$like':'%'+_0xae8616[_0x1769('0x3d')][_0x1769('0x46')]+'%'};return _0x3a1dc1;}})});}_0x5a191d=_[_0x1769('0x47')]({},_0x5a191d,_0xae8616['options']);var _0x2083ce={'where':_0x5a191d['where']};return db[_0x1769('0x39')]['count'](_0x2083ce)[_0x1769('0x20')](function(_0x2673a5){_0x5a053e['count']=_0x2673a5;if(_0xae8616[_0x1769('0x3d')][_0x1769('0x4b')]){_0x5a191d[_0x1769('0x4c')]=[{'all':!![]}];}return db[_0x1769('0x39')][_0x1769('0x4d')](_0x5a191d);})[_0x1769('0x20')](function(_0x1f703d){_0x5a053e['rows']=_0x1f703d;return _0x5a053e;})['then'](respondWithFilteredResult(_0xe89f51,_0x5a191d))[_0x1769('0x2a')](handleError(_0xe89f51,null));};exports[_0x1769('0x4e')]=function(_0x4e55d8,_0x1fa29a){var _0x1a4448={'raw':!![],'where':{'id':_0x4e55d8[_0x1769('0x4f')]['id']}},_0x569d6d={};_0x569d6d['model']=_[_0x1769('0x3c')](db['OpenchannelMessage'][_0x1769('0x3a')]);_0x569d6d['query']=_[_0x1769('0x3c')](_0x4e55d8[_0x1769('0x3d')]);_0x569d6d[_0x1769('0x45')]=_[_0x1769('0x50')](_0x569d6d[_0x1769('0x3b')],_0x569d6d[_0x1769('0x3d')]);_0x1a4448[_0x1769('0x3e')]=_['intersection'](_0x569d6d[_0x1769('0x3b')],qs[_0x1769('0x51')](_0x4e55d8[_0x1769('0x3d')]['fields']));_0x1a4448[_0x1769('0x3e')]=_0x1a4448[_0x1769('0x3e')][_0x1769('0x3f')]?_0x1a4448['attributes']:_0x569d6d['model'];if(_0x4e55d8[_0x1769('0x3d')][_0x1769('0x4b')]){_0x1a4448[_0x1769('0x4c')]=[{'all':!![]}];}_0x1a4448=_[_0x1769('0x47')]({},_0x1a4448,_0x4e55d8['options']);return db[_0x1769('0x39')][_0x1769('0x52')](_0x1a4448)[_0x1769('0x20')](handleEntityNotFound(_0x1fa29a,null))[_0x1769('0x20')](respondWithResult(_0x1fa29a,null))[_0x1769('0x2a')](handleError(_0x1fa29a,null));};exports['create']=function(_0x3fad7c,_0x194dcc){return db[_0x1769('0x39')][_0x1769('0x53')](_0x3fad7c[_0x1769('0x54')],{})[_0x1769('0x20')](respondWithResult(_0x194dcc,0xc9))[_0x1769('0x2a')](handleError(_0x194dcc,null));};exports['update']=function(_0xa0ce3a,_0x44d438){if(_0xa0ce3a['body']['id']){delete _0xa0ce3a[_0x1769('0x54')]['id'];}return db[_0x1769('0x39')]['find']({'where':{'id':_0xa0ce3a[_0x1769('0x4f')]['id']}})[_0x1769('0x20')](handleEntityNotFound(_0x44d438,null))['then'](saveUpdates(_0xa0ce3a[_0x1769('0x54')],null))[_0x1769('0x20')](respondWithResult(_0x44d438,null))['catch'](handleError(_0x44d438,null));};exports['destroy']=function(_0x357726,_0x3e3bfa){return db[_0x1769('0x39')][_0x1769('0x52')]({'where':{'id':_0x357726[_0x1769('0x4f')]['id']}})[_0x1769('0x20')](handleEntityNotFound(_0x3e3bfa,null))[_0x1769('0x20')](removeEntity(_0x3e3bfa,null))['catch'](handleError(_0x3e3bfa,null));};exports[_0x1769('0x55')]=function(_0x3a5697,_0x30d91c){return db[_0x1769('0x39')][_0x1769('0x55')]()[_0x1769('0x20')](respondWithResult(_0x30d91c,null))['catch'](handleError(_0x30d91c,null));};var interaction_log=require(_0x1769('0x13'))('openchannel-interactions');exports[_0x1769('0x56')]=function(_0x2cf14c,_0x407b25,_0x4db23d){var _0x14dd29={'channel':_0x1769('0x57')};if(_0x2cf14c[_0x1769('0x54')]['id']){delete _0x2cf14c['body']['id'];}_0x2cf14c['body'][_0x1769('0x58')]=!![];_0x2cf14c['body']['readAt']=moment()[_0x1769('0x59')]('YYYY-MM-DD\x20HH:mm:ss');_0x2cf14c[_0x1769('0x54')][_0x1769('0x5a')]=_0x2cf14c['body'][_0x1769('0x5a')]||_0x2cf14c[_0x1769('0x5b')]['id'];return db[_0x1769('0x39')][_0x1769('0x52')]({'where':{'id':_0x2cf14c[_0x1769('0x4f')]['id'],'UserId':null},'include':[{'model':db[_0x1769('0x5c')],'as':_0x1769('0x5d')}]})[_0x1769('0x20')](handleEntityNotFound(_0x407b25,null))[_0x1769('0x20')](saveUpdates(_0x2cf14c[_0x1769('0x54')],null))[_0x1769('0x20')](function(_0x2c51d0){if(_0x2c51d0){_0x14dd29[_0x1769('0x27')]=_0x2c51d0['get']({'plain':!![]});return db[_0x1769('0x5e')][_0x1769('0x52')]({'where':{'id':_0x2c51d0[_0x1769('0x5f')]}});}return null;})[_0x1769('0x20')](handleEntityNotFound(_0x407b25,null))[_0x1769('0x20')](function(_0x5dcb29){if(_0x5dcb29){return _0x5dcb29[_0x1769('0x34')]({'UserId':_0x2cf14c[_0x1769('0x54')][_0x1769('0x5a')],'read1stAt':_[_0x1769('0x60')](_0x5dcb29['read1stAt'])?moment()[_0x1769('0x59')](_0x1769('0x61')):undefined});}return null;})['then'](function(_0x2e76ba){if(_0x2e76ba){_0x14dd29[_0x1769('0x62')]=_0x2e76ba[_0x1769('0x63')]({'plain':!![]});interaction_log['info'](_0x1769('0x64'),_0x2cf14c[_0x1769('0x5b')]['id'],_0x2cf14c[_0x1769('0x5b')][_0x1769('0x37')],_0x2cf14c['user'][_0x1769('0x65')],_0x14dd29['interaction']['id'],_0x2cf14c[_0x1769('0x54')]?JSON[_0x1769('0x25')](_0x2cf14c[_0x1769('0x54')]):_0x1769('0x66'));return respondWithRpcPromise(_0x1769('0x67'),_0x1769('0x68'),_0x14dd29);}return null;})[_0x1769('0x20')](function(_0x5400c9){if(_0x5400c9){if(_0x2cf14c[_0x1769('0x54')]['manual']){_0x14dd29[_0x1769('0x27')]['interface']=util[_0x1769('0x59')]('SIP/%s',_0x2cf14c[_0x1769('0x5b')][_0x1769('0x37')]);_0x14dd29['message'][_0x1769('0x69')]=_0x14dd29[_0x1769('0x69')];_0x14dd29[_0x1769('0x27')]['event']='accept';return respondWithRpcPromise(_0x1769('0x6a'),_0x1769('0x6a'),{'event':'acceptmessage','message':_0x14dd29[_0x1769('0x27')]},client9002)[_0x1769('0x20')](function(){return _0x14dd29;});}return _0x14dd29;}return null;})['then'](respondWithResult(_0x407b25,null))[_0x1769('0x2a')](handleError(_0x407b25,null));};var interaction_log=require(_0x1769('0x13'))(_0x1769('0x6b'));exports['reject']=function(_0x13c1ce,_0x6a24ab,_0x13f201){var _0x18a860={'agent':{},'channel':'openchannel'};if(_0x13c1ce[_0x1769('0x54')]['id']){delete _0x13c1ce['body']['id'];}_0x13c1ce[_0x1769('0x54')][_0x1769('0x5a')]=_0x13c1ce['body'][_0x1769('0x5a')]||_0x13c1ce['user']['id'];_0x18a860[_0x1769('0x6c')]['id']=_0x13c1ce[_0x1769('0x54')][_0x1769('0x5a')];return db[_0x1769('0x39')][_0x1769('0x52')]({'where':{'id':_0x13c1ce[_0x1769('0x4f')]['id'],'UserId':null}})[_0x1769('0x20')](handleEntityNotFound(_0x6a24ab,null))[_0x1769('0x20')](function(_0x4cc47a){if(_0x4cc47a){_0x18a860[_0x1769('0x27')]=_0x4cc47a['get']({'plain':!![]});return db[_0x1769('0x5e')]['find']({'where':{'id':_0x4cc47a[_0x1769('0x5f')]}});}return null;})['then'](handleEntityNotFound(_0x6a24ab,null))[_0x1769('0x20')](function(_0x447160){if(_0x447160){_0x18a860['interaction']=_0x447160['get']({'plain':!![]});interaction_log[_0x1769('0x28')](_0x1769('0x6d'),_0x13c1ce['user']['id'],_0x13c1ce[_0x1769('0x5b')][_0x1769('0x37')],_0x13c1ce['user']['role'],_0x18a860[_0x1769('0x62')]['id'],_0x13c1ce[_0x1769('0x54')]?JSON[_0x1769('0x25')](_0x13c1ce['body']):_0x1769('0x66'));return respondWithRpcPromise(_0x1769('0x6e'),_0x1769('0x6f'),_0x18a860);}return null;})[_0x1769('0x20')](function(_0x3f9c1c){if(_0x3f9c1c){_0x3f9c1c[_0x1769('0x27')][_0x1769('0x70')]=util[_0x1769('0x59')](_0x1769('0x71'),_0x13c1ce[_0x1769('0x5b')][_0x1769('0x37')]);_0x3f9c1c['message'][_0x1769('0x69')]=_0x18a860[_0x1769('0x69')];_0x3f9c1c['message'][_0x1769('0x72')]=_0x1769('0x33');respondWithRpcPromise(_0x1769('0x6a'),'EventManager',{'event':_0x1769('0x73'),'message':_0x3f9c1c[_0x1769('0x27')]},client9002);return _0x18a860;}return null;})[_0x1769('0x20')](respondWithResult(_0x6a24ab,null))[_0x1769('0x2a')](handleError(_0x6a24ab,null));}; \ No newline at end of file +var _0x4712=['body','params','describe','openchannel-interactions','accept','openchannel','read','readAt','format','UserId','user','CmContact','Contact','OpenchannelInteraction','OpenchannelInteractionId','update','isNil','interaction','get','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','stringify','null','AcceptMessage','acceptMessage','manual','interface','SIP/%s','channel','event','EventManager','acceptmessage','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','request\x20sent','debug','error','code','OpenchannelMessage,\x20%s,\x20%s','message','result','sendStatus','end','status','json','offset','set','Content-Range','reject','save','destroy','stack','name','rawAttributes','keys','query','filters','intersection','model','attributes','fields','length','limit','order','sort','where','pick','filter','merge','type','key','VIRTUAL','options','OpenchannelMessage','count','includeAll','include','findAll','catch','show','find','create'];(function(_0x271060,_0x3f86b1){var _0x40540b=function(_0x1735a7){while(--_0x1735a7){_0x271060['push'](_0x271060['shift']());}};_0x40540b(++_0x3f86b1);}(_0x4712,0x117));var _0x2471=function(_0x24311f,_0x156b9f){_0x24311f=_0x24311f-0x0;var _0x38b38b=_0x4712[_0x24311f];return _0x38b38b;};'use strict';var pdf=require(_0x2471('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x2471('0x1'));var zipdir=require(_0x2471('0x2'));var jsonpatch=require(_0x2471('0x3'));var rp=require(_0x2471('0x4'));var moment=require(_0x2471('0x5'));var BPromise=require(_0x2471('0x6'));var Mustache=require(_0x2471('0x7'));var util=require(_0x2471('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0x2471('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x2471('0xa'));var squel=require(_0x2471('0xb'));var crypto=require(_0x2471('0xc'));var jsforce=require(_0x2471('0xd'));var deskjs=require(_0x2471('0xe'));var toCsv=require(_0x2471('0x9'));var querystring=require(_0x2471('0xf'));var Papa=require(_0x2471('0x10'));var Redis=require(_0x2471('0x11'));var authService=require(_0x2471('0x12'));var qs=require(_0x2471('0x13'));var as=require(_0x2471('0x14'));var hardwareService=require(_0x2471('0x15'));var logger=require(_0x2471('0x16'))(_0x2471('0x17'));var utils=require(_0x2471('0x18'));var config=require(_0x2471('0x19'));var db=require(_0x2471('0x1a'))['db'];config[_0x2471('0x1b')]=_[_0x2471('0x1c')](config[_0x2471('0x1b')],{'host':_0x2471('0x1d'),'port':0x18eb});var socket=require(_0x2471('0x1e'))(new Redis(config['redis']));require('./openchannelMessage.socket')[_0x2471('0x1f')](socket);var jayson=require('jayson/promise');var client=jayson[_0x2471('0x20')][_0x2471('0x21')]({'port':0x232c});var client9002=jayson[_0x2471('0x20')][_0x2471('0x21')]({'port':0x232a});function checkPasswordPattern(_0x428434,_0x29351c,_0xc07e5a){if(_0xc07e5a){var _0x35ed4d=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x35ed4d[_0x2471('0x22')](_0x29351c)){return _0x428434;}else{throw new Error(_0x2471('0x23'));}}else{return _0x428434;}}function respondWithRpcPromise(_0x4a6c81,_0xd17e75,_0x330d56,_0x363390){return new BPromise(function(_0x322f4a,_0x2f2df6){var _0x4a9527=_0x363390||client;return _0x4a9527[_0x2471('0x24')](_0x4a6c81,_0x330d56)[_0x2471('0x25')](function(_0x2d7c9e){logger[_0x2471('0x26')]('OpenchannelMessage,\x20%s,\x20%s',_0xd17e75,_0x2471('0x27'));logger[_0x2471('0x28')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0xd17e75,_0x2471('0x27'),JSON['stringify'](_0x2d7c9e));if(_0x2d7c9e[_0x2471('0x29')]){if(_0x2d7c9e['error'][_0x2471('0x2a')]===0x1f4){logger[_0x2471('0x29')](_0x2471('0x2b'),_0xd17e75,_0x2d7c9e['error'][_0x2471('0x2c')]);return _0x2f2df6(_0x2d7c9e['error'][_0x2471('0x2c')]);}logger[_0x2471('0x29')](_0x2471('0x2b'),_0xd17e75,_0x2d7c9e['error'][_0x2471('0x2c')]);return _0x322f4a(_0x2d7c9e[_0x2471('0x29')]['message']);}else{logger[_0x2471('0x26')](_0x2471('0x2b'),_0xd17e75,'request\x20sent');_0x322f4a(_0x2d7c9e[_0x2471('0x2d')][_0x2471('0x2c')]);}})['catch'](function(_0x23f995){logger['error'](_0x2471('0x2b'),_0xd17e75,_0x23f995);_0x2f2df6(_0x23f995);});});}function respondWithStatusCode(_0x4e1e50,_0x382cf6){_0x382cf6=_0x382cf6||0xcc;return function(_0x5e8fc4){if(_0x5e8fc4){return _0x4e1e50[_0x2471('0x2e')](_0x382cf6);}return _0x4e1e50['status'](_0x382cf6)[_0x2471('0x2f')]();};}function respondWithResult(_0x1c9564,_0x2743ae){_0x2743ae=_0x2743ae||0xc8;return function(_0x497319){if(_0x497319){return _0x1c9564[_0x2471('0x30')](_0x2743ae)[_0x2471('0x31')](_0x497319);}};}function respondWithFilteredResult(_0xc51844,_0x2fc27b){return function(_0x22c66c){if(_0x22c66c){var _0x161ab2=_0x22c66c['count'],_0x1bf6ce=_0x2fc27b[_0x2471('0x32')],_0x46b88a=_0x2fc27b[_0x2471('0x32')]+_0x2fc27b['limit'],_0x5c0d64;if(_0x46b88a>=_0x161ab2){_0x46b88a=_0x161ab2;_0x5c0d64=0xc8;}else{_0x5c0d64=0xce;}_0xc51844[_0x2471('0x30')](_0x5c0d64);return _0xc51844[_0x2471('0x33')](_0x2471('0x34'),_0x1bf6ce+'-'+_0x46b88a+'/'+_0x161ab2)[_0x2471('0x31')](_0x22c66c);}return null;};}function patchUpdates(_0x1bca81){return function(_0x4c9a53){try{jsonpatch['apply'](_0x4c9a53,_0x1bca81,!![]);}catch(_0x8bc1fd){return BPromise[_0x2471('0x35')](_0x8bc1fd);}return _0x4c9a53[_0x2471('0x36')]();};}function saveUpdates(_0x201de9,_0x43989c){return function(_0x245f3e){if(_0x245f3e){return _0x245f3e['update'](_0x201de9)[_0x2471('0x25')](function(_0x213fa4){return _0x213fa4;});}return null;};}function removeEntity(_0x2857ca,_0x5ec4d2){return function(_0x23bdfd){if(_0x23bdfd){return _0x23bdfd[_0x2471('0x37')]()[_0x2471('0x25')](function(){_0x2857ca[_0x2471('0x30')](0xcc)[_0x2471('0x2f')]();});}};}function handleEntityNotFound(_0x3a49f2,_0x4268d4){return function(_0x5523c0){if(!_0x5523c0){_0x3a49f2[_0x2471('0x2e')](0x194);}return _0x5523c0;};}function handleError(_0x3e3ee9,_0x715580){_0x715580=_0x715580||0x1f4;return function(_0x392cbe){logger['error'](_0x392cbe[_0x2471('0x38')]);if(_0x392cbe[_0x2471('0x39')]){delete _0x392cbe[_0x2471('0x39')];}_0x3e3ee9[_0x2471('0x30')](_0x715580)['send'](_0x392cbe);};}exports['index']=function(_0x12ff83,_0x5f166a){var _0x25d579={},_0x154897={},_0x304f44={'count':0x0,'rows':[]};var _0x2c3da2=db['OpenchannelMessage'][_0x2471('0x3a')];_0x154897['model']=_['keys'](_0x2c3da2);_0x154897['query']=_[_0x2471('0x3b')](_0x12ff83[_0x2471('0x3c')]);_0x154897[_0x2471('0x3d')]=_[_0x2471('0x3e')](_0x154897[_0x2471('0x3f')],_0x154897[_0x2471('0x3c')]);_0x25d579[_0x2471('0x40')]=_[_0x2471('0x3e')](_0x154897[_0x2471('0x3f')],qs[_0x2471('0x41')](_0x12ff83[_0x2471('0x3c')][_0x2471('0x41')]));_0x25d579[_0x2471('0x40')]=_0x25d579[_0x2471('0x40')][_0x2471('0x42')]?_0x25d579[_0x2471('0x40')]:_0x154897['model'];if(!_0x12ff83['query']['hasOwnProperty']('nolimit')){_0x25d579[_0x2471('0x43')]=qs[_0x2471('0x43')](_0x12ff83[_0x2471('0x3c')]['limit']);_0x25d579[_0x2471('0x32')]=qs[_0x2471('0x32')](_0x12ff83[_0x2471('0x3c')][_0x2471('0x32')]);}_0x25d579[_0x2471('0x44')]=qs[_0x2471('0x45')](_0x12ff83[_0x2471('0x3c')][_0x2471('0x45')]);_0x25d579[_0x2471('0x46')]=qs[_0x2471('0x3d')](_[_0x2471('0x47')](_0x12ff83[_0x2471('0x3c')],_0x154897[_0x2471('0x3d')]));if(_0x12ff83['query'][_0x2471('0x48')]){_0x25d579[_0x2471('0x46')]=_[_0x2471('0x49')](_0x25d579[_0x2471('0x46')],{'$or':_['map'](_0x2c3da2,function(_0x4bc2c2){if(_0x4bc2c2[_0x2471('0x4a')][_0x2471('0x4b')]!==_0x2471('0x4c')){var _0x18cbe6={};_0x18cbe6[_0x4bc2c2['field']]={'$like':'%'+_0x12ff83[_0x2471('0x3c')][_0x2471('0x48')]+'%'};return _0x18cbe6;}})});}_0x25d579=_[_0x2471('0x49')]({},_0x25d579,_0x12ff83[_0x2471('0x4d')]);var _0x2a2bd2={'where':_0x25d579[_0x2471('0x46')]};return db[_0x2471('0x4e')]['count'](_0x2a2bd2)[_0x2471('0x25')](function(_0x2f8914){_0x304f44[_0x2471('0x4f')]=_0x2f8914;if(_0x12ff83[_0x2471('0x3c')][_0x2471('0x50')]){_0x25d579[_0x2471('0x51')]=[{'all':!![]}];}return db[_0x2471('0x4e')][_0x2471('0x52')](_0x25d579);})['then'](function(_0x4b5d06){_0x304f44['rows']=_0x4b5d06;return _0x304f44;})[_0x2471('0x25')](respondWithFilteredResult(_0x5f166a,_0x25d579))[_0x2471('0x53')](handleError(_0x5f166a,null));};exports[_0x2471('0x54')]=function(_0x573652,_0x11c3d2){var _0x4ebb38={'raw':!![],'where':{'id':_0x573652['params']['id']}},_0x546f98={};_0x546f98['model']=_[_0x2471('0x3b')](db[_0x2471('0x4e')]['rawAttributes']);_0x546f98[_0x2471('0x3c')]=_[_0x2471('0x3b')](_0x573652[_0x2471('0x3c')]);_0x546f98[_0x2471('0x3d')]=_[_0x2471('0x3e')](_0x546f98[_0x2471('0x3f')],_0x546f98[_0x2471('0x3c')]);_0x4ebb38['attributes']=_[_0x2471('0x3e')](_0x546f98[_0x2471('0x3f')],qs[_0x2471('0x41')](_0x573652[_0x2471('0x3c')]['fields']));_0x4ebb38[_0x2471('0x40')]=_0x4ebb38['attributes']['length']?_0x4ebb38[_0x2471('0x40')]:_0x546f98[_0x2471('0x3f')];if(_0x573652[_0x2471('0x3c')][_0x2471('0x50')]){_0x4ebb38[_0x2471('0x51')]=[{'all':!![]}];}_0x4ebb38=_[_0x2471('0x49')]({},_0x4ebb38,_0x573652[_0x2471('0x4d')]);return db[_0x2471('0x4e')][_0x2471('0x55')](_0x4ebb38)[_0x2471('0x25')](handleEntityNotFound(_0x11c3d2,null))[_0x2471('0x25')](respondWithResult(_0x11c3d2,null))['catch'](handleError(_0x11c3d2,null));};exports[_0x2471('0x56')]=function(_0x2f0d1d,_0x57d15f){return db[_0x2471('0x4e')][_0x2471('0x56')](_0x2f0d1d[_0x2471('0x57')],{})[_0x2471('0x25')](respondWithResult(_0x57d15f,0xc9))[_0x2471('0x53')](handleError(_0x57d15f,null));};exports['update']=function(_0x525fd3,_0x394ed6){if(_0x525fd3[_0x2471('0x57')]['id']){delete _0x525fd3[_0x2471('0x57')]['id'];}return db[_0x2471('0x4e')][_0x2471('0x55')]({'where':{'id':_0x525fd3[_0x2471('0x58')]['id']}})[_0x2471('0x25')](handleEntityNotFound(_0x394ed6,null))['then'](saveUpdates(_0x525fd3[_0x2471('0x57')],null))[_0x2471('0x25')](respondWithResult(_0x394ed6,null))[_0x2471('0x53')](handleError(_0x394ed6,null));};exports[_0x2471('0x37')]=function(_0x58ca29,_0xd093f7){return db[_0x2471('0x4e')][_0x2471('0x55')]({'where':{'id':_0x58ca29['params']['id']}})[_0x2471('0x25')](handleEntityNotFound(_0xd093f7,null))[_0x2471('0x25')](removeEntity(_0xd093f7,null))[_0x2471('0x53')](handleError(_0xd093f7,null));};exports[_0x2471('0x59')]=function(_0x237153,_0x235a50){return db[_0x2471('0x4e')][_0x2471('0x59')]()[_0x2471('0x25')](respondWithResult(_0x235a50,null))[_0x2471('0x53')](handleError(_0x235a50,null));};var interaction_log=require(_0x2471('0x16'))(_0x2471('0x5a'));exports[_0x2471('0x5b')]=function(_0x2d3895,_0x1e1644,_0x3a7cd8){var _0x60776f={'channel':_0x2471('0x5c')};if(_0x2d3895[_0x2471('0x57')]['id']){delete _0x2d3895['body']['id'];}_0x2d3895['body'][_0x2471('0x5d')]=!![];_0x2d3895[_0x2471('0x57')][_0x2471('0x5e')]=moment()[_0x2471('0x5f')]('YYYY-MM-DD\x20HH:mm:ss');_0x2d3895[_0x2471('0x57')][_0x2471('0x60')]=_0x2d3895[_0x2471('0x57')][_0x2471('0x60')]||_0x2d3895[_0x2471('0x61')]['id'];return db['OpenchannelMessage'][_0x2471('0x55')]({'where':{'id':_0x2d3895[_0x2471('0x58')]['id'],'UserId':null},'include':[{'model':db[_0x2471('0x62')],'as':_0x2471('0x63')}]})[_0x2471('0x25')](handleEntityNotFound(_0x1e1644,null))[_0x2471('0x25')](saveUpdates(_0x2d3895[_0x2471('0x57')],null))[_0x2471('0x25')](function(_0x165b3f){if(_0x165b3f){_0x60776f[_0x2471('0x2c')]=_0x165b3f['get']({'plain':!![]});return db[_0x2471('0x64')][_0x2471('0x55')]({'where':{'id':_0x165b3f[_0x2471('0x65')]}});}return null;})['then'](handleEntityNotFound(_0x1e1644,null))[_0x2471('0x25')](function(_0x475e92){if(_0x475e92){return _0x475e92[_0x2471('0x66')]({'UserId':_0x2d3895['body']['UserId'],'read1stAt':_[_0x2471('0x67')](_0x475e92['read1stAt'])?moment()[_0x2471('0x5f')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x2471('0x25')](function(_0x4a40b5){if(_0x4a40b5){_0x60776f[_0x2471('0x68')]=_0x4a40b5[_0x2471('0x69')]({'plain':!![]});interaction_log[_0x2471('0x26')](_0x2471('0x6a'),_0x2d3895[_0x2471('0x61')]['id'],_0x2d3895[_0x2471('0x61')][_0x2471('0x39')],_0x2d3895['user'][_0x2471('0x6b')],_0x60776f['interaction']['id'],_0x2d3895['body']?JSON[_0x2471('0x6c')](_0x2d3895[_0x2471('0x57')]):_0x2471('0x6d'));return respondWithRpcPromise(_0x2471('0x6e'),_0x2471('0x6f'),_0x60776f);}return null;})[_0x2471('0x25')](function(_0x4fb0dd){if(_0x4fb0dd){if(_0x2d3895[_0x2471('0x57')][_0x2471('0x70')]){_0x60776f['message'][_0x2471('0x71')]=util[_0x2471('0x5f')](_0x2471('0x72'),_0x2d3895['user']['name']);_0x60776f['message']['channel']=_0x60776f[_0x2471('0x73')];_0x60776f['message'][_0x2471('0x74')]=_0x2471('0x5b');return respondWithRpcPromise(_0x2471('0x75'),'EventManager',{'event':_0x2471('0x76'),'message':_0x60776f['message']},client9002)[_0x2471('0x25')](function(){return _0x60776f;});}return _0x60776f;}return null;})[_0x2471('0x25')](respondWithResult(_0x1e1644,null))[_0x2471('0x53')](handleError(_0x1e1644,null));};var interaction_log=require(_0x2471('0x16'))(_0x2471('0x5a'));exports['reject']=function(_0x5bca10,_0x42094c,_0xf1691f){var _0x613e1b={'agent':{},'channel':'openchannel'};if(_0x5bca10[_0x2471('0x57')]['id']){delete _0x5bca10[_0x2471('0x57')]['id'];}_0x5bca10[_0x2471('0x57')]['UserId']=_0x5bca10[_0x2471('0x57')]['UserId']||_0x5bca10[_0x2471('0x61')]['id'];_0x613e1b['agent']['id']=_0x5bca10[_0x2471('0x57')][_0x2471('0x60')];return db[_0x2471('0x4e')][_0x2471('0x55')]({'where':{'id':_0x5bca10['params']['id'],'UserId':null}})[_0x2471('0x25')](handleEntityNotFound(_0x42094c,null))[_0x2471('0x25')](function(_0x187d2e){if(_0x187d2e){_0x613e1b[_0x2471('0x2c')]=_0x187d2e[_0x2471('0x69')]({'plain':!![]});return db[_0x2471('0x64')][_0x2471('0x55')]({'where':{'id':_0x187d2e[_0x2471('0x65')]}});}return null;})[_0x2471('0x25')](handleEntityNotFound(_0x42094c,null))[_0x2471('0x25')](function(_0x4b9f3b){if(_0x4b9f3b){_0x613e1b[_0x2471('0x68')]=_0x4b9f3b[_0x2471('0x69')]({'plain':!![]});interaction_log[_0x2471('0x26')](_0x2471('0x77'),_0x5bca10[_0x2471('0x61')]['id'],_0x5bca10[_0x2471('0x61')][_0x2471('0x39')],_0x5bca10[_0x2471('0x61')]['role'],_0x613e1b[_0x2471('0x68')]['id'],_0x5bca10[_0x2471('0x57')]?JSON[_0x2471('0x6c')](_0x5bca10[_0x2471('0x57')]):_0x2471('0x6d'));return respondWithRpcPromise(_0x2471('0x78'),_0x2471('0x79'),_0x613e1b);}return null;})['then'](function(_0x17f24d){if(_0x17f24d){_0x17f24d[_0x2471('0x2c')][_0x2471('0x71')]=util['format'](_0x2471('0x72'),_0x5bca10[_0x2471('0x61')][_0x2471('0x39')]);_0x17f24d[_0x2471('0x2c')][_0x2471('0x73')]=_0x613e1b['channel'];_0x17f24d[_0x2471('0x2c')][_0x2471('0x74')]=_0x2471('0x35');respondWithRpcPromise(_0x2471('0x75'),_0x2471('0x75'),{'event':'rejectmessage','message':_0x17f24d[_0x2471('0x2c')]},client9002);return _0x613e1b;}return null;})[_0x2471('0x25')](respondWithResult(_0x42094c,null))[_0x2471('0x53')](handleError(_0x42094c,null));}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.events.js b/server/api/openchannelMessage/openchannelMessage.events.js index 96638c7..e9158df 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 _0xeff8=['hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save','update','emit'];(function(_0x5b50ae,_0x7da7e1){var _0x84eb56=function(_0xad6b38){while(--_0xad6b38){_0x5b50ae['push'](_0x5b50ae['shift']());}};_0x84eb56(++_0x7da7e1);}(_0xeff8,0x186));var _0x8eff=function(_0x16d10f,_0x2ba2d5){_0x16d10f=_0x16d10f-0x0;var _0x50c823=_0xeff8[_0x16d10f];return _0x50c823;};'use strict';var EventEmitter=require(_0x8eff('0x0'));var OpenchannelMessage=require(_0x8eff('0x1'))['db']['OpenchannelMessage'];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0x8eff('0x2')](0x0);var events={'afterCreate':_0x8eff('0x3'),'afterUpdate':_0x8eff('0x4'),'afterDestroy':'remove'};function emitEvent(_0x2d7c9c){return function(_0x2a6581,_0x4ba2bf,_0x2911b1){OpenchannelMessageEvents['emit'](_0x2d7c9c+':'+_0x2a6581['id'],_0x2a6581);OpenchannelMessageEvents[_0x8eff('0x5')](_0x2d7c9c,_0x2a6581);_0x2911b1(null);};}for(var e in events){if(events[_0x8eff('0x6')](e)){var event=events[e];OpenchannelMessage[_0x8eff('0x7')](e,emitEvent(event));}}module[_0x8eff('0x8')]=OpenchannelMessageEvents; \ No newline at end of file +var _0x5646=['../../mysqldb','OpenchannelMessage','setMaxListeners','save','emit','hasOwnProperty','hook','exports','events'];(function(_0x2ee654,_0x3d6e2f){var _0x355857=function(_0x16af8e){while(--_0x16af8e){_0x2ee654['push'](_0x2ee654['shift']());}};_0x355857(++_0x3d6e2f);}(_0x5646,0x1b8));var _0x6564=function(_0x57486e,_0x32283b){_0x57486e=_0x57486e-0x0;var _0x5f110b=_0x5646[_0x57486e];return _0x5f110b;};'use strict';var EventEmitter=require(_0x6564('0x0'));var OpenchannelMessage=require(_0x6564('0x1'))['db'][_0x6564('0x2')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0x6564('0x3')](0x0);var events={'afterCreate':_0x6564('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x54f2a2){return function(_0x14281c,_0x352c14,_0x103719){OpenchannelMessageEvents['emit'](_0x54f2a2+':'+_0x14281c['id'],_0x14281c);OpenchannelMessageEvents[_0x6564('0x5')](_0x54f2a2,_0x14281c);_0x103719(null);};}for(var e in events){if(events[_0x6564('0x6')](e)){var event=events[e];OpenchannelMessage[_0x6564('0x7')](e,emitEvent(event));}}module[_0x6564('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 b43cfa3..cbaeeb3 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 _0x6ad7=['Forwarding\x20message\x20%d\x20to\x20%s','Interactions','Interaction','omit','POST','method','GET','Message\x20%d\x20forwarded\x20to\x20%s','threadId','error','inspect','finally','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise','../../config/environment','./openchannelMessage.attributes','OpenchannelMessage','openchannel_messages','fti_openchannel_messages','body','FULLTEXT','models','get','direction','toLowerCase','secret','OpenchannelInteraction','OpenchannelInteractionId','update','createdAt','catch','CmContact','describe','OpenchannelAccount','find','Contact','then','replyUri','info','OpenchannelMessage,\x20%s,\x20%s','afterCreate','format'];(function(_0x53520f,_0x14a0b6){var _0x22d0a0=function(_0x1b3b3e){while(--_0x1b3b3e){_0x53520f['push'](_0x53520f['shift']());}};_0x22d0a0(++_0x14a0b6);}(_0x6ad7,0x6b));var _0x76ad=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6ad7[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x76ad('0x0'));var util=require(_0x76ad('0x1'));var logger=require('../../config/logger')(_0x76ad('0x2'));var moment=require(_0x76ad('0x3'));var BPromise=require(_0x76ad('0x4'));var rp=require(_0x76ad('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x76ad('0x6'));var attributes=require(_0x76ad('0x7'));module['exports']=function(_0x22415c,_0x16d16f){return _0x22415c['define'](_0x76ad('0x8'),attributes,{'tableName':_0x76ad('0x9'),'paranoid':![],'indexes':[{'name':_0x76ad('0xa'),'fields':[_0x76ad('0xb')],'type':_0x76ad('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x501eb3,_0x5754b2,_0x1ade37){var _0x133099=_0x22415c[_0x76ad('0xd')];var _0x5f1bfe=_0x501eb3[_0x76ad('0xe')]({'plain':!![]});if(_0x5f1bfe[_0x76ad('0xf')][_0x76ad('0x10')]()==='in'||_0x5f1bfe[_0x76ad('0xf')][_0x76ad('0x10')]()==='out'&&!_0x5f1bfe[_0x76ad('0x11')]&&!_['isNil'](_0x5f1bfe['UserId'])){_0x133099[_0x76ad('0x12')]['findOne']({'where':{'id':_0x5f1bfe[_0x76ad('0x13')]}})['then'](function(_0x173873){if(_0x173873){_0x173873[_0x76ad('0x14')]({'lastMsgAt':_0x5f1bfe[_0x76ad('0x15')],'lastMsgDirection':_0x5f1bfe['direction'][_0x76ad('0x10')]()});}})[_0x76ad('0x16')](function(_0x524ec3){console['error'](_0x524ec3);});}if(_0x5f1bfe['direction']==='out'&&!_0x5f1bfe['secret']){var _0x45a3f8;_0x133099[_0x76ad('0x17')][_0x76ad('0x18')]()['then'](function(_0x591532){return _0x133099[_0x76ad('0x19')][_0x76ad('0x1a')]({'where':{'id':_0x5f1bfe['OpenchannelAccountId']},'include':[{'model':_0x133099[_0x76ad('0x12')],'as':'Interactions','where':{'id':_0x5f1bfe[_0x76ad('0x13')]},'limit':0x1,'include':[{'model':_0x133099[_0x76ad('0x17')],'as':_0x76ad('0x1b'),'attributes':_['keys'](_0x591532)}]}]});})[_0x76ad('0x1c')](function(_0x358f42){_0x45a3f8=_0x358f42[_0x76ad('0xe')]({'plain':!![]});if(_0x45a3f8&&_0x45a3f8[_0x76ad('0x1d')]){logger[_0x76ad('0x1e')](_0x76ad('0x1f'),_0x76ad('0x20'),util[_0x76ad('0x21')](_0x76ad('0x22'),_0x5f1bfe['id'],_0x45a3f8[_0x76ad('0x1d')]));if(_0x45a3f8[_0x76ad('0x23')]&&_0x45a3f8[_0x76ad('0x23')]['length']){_0x5f1bfe[_0x76ad('0x24')]=_[_0x76ad('0x25')](_0x45a3f8['Interactions'][0x0],'Contact');_0x5f1bfe[_0x76ad('0x1b')]=_0x45a3f8[_0x76ad('0x23')][0x0][_0x76ad('0x1b')];}var _0x5754b2={'method':_0x76ad('0x26'),'uri':encodeURI(_0x45a3f8['replyUri']),'json':!![],'resolveWithFullResponse':!![]};switch(_0x5754b2[_0x76ad('0x27')]){case _0x76ad('0x28'):_0x5754b2['qs']=_0x5f1bfe;break;case _0x76ad('0x26'):_0x5754b2[_0x76ad('0xb')]=_0x5f1bfe;break;}return rp(_0x5754b2)[_0x76ad('0x1c')](function(_0x4c078d){logger[_0x76ad('0x1e')](_0x76ad('0x1f'),'afterCreate',util[_0x76ad('0x21')](_0x76ad('0x29'),_0x5f1bfe['id'],_0x45a3f8[_0x76ad('0x1d')]));if(_0x4c078d[_0x76ad('0xb')][_0x76ad('0x2a')]&&_0x4c078d[_0x76ad('0xb')][_0x76ad('0x2a')]!=_0x5f1bfe['Interaction'][_0x76ad('0x2a')]){return _0x133099[_0x76ad('0x12')][_0x76ad('0x14')]({'threadId':_0x4c078d[_0x76ad('0xb')]['threadId']},{'logging':!![],'where':{'id':_0x5f1bfe[_0x76ad('0x24')]['id']}});}else{return;}})[_0x76ad('0x1c')](function(){return _0x501eb3['update']({'read':!![]});})[_0x76ad('0x16')](function(_0x3acf40){logger[_0x76ad('0x2b')](_0x76ad('0x1f'),_0x76ad('0x20'),util[_0x76ad('0x2c')](_0x3acf40,{'showHidden':![],'depth':null}));_0x1ade37();});}else{_0x1ade37();}})[_0x76ad('0x2d')](function(){_0x1ade37();});}else{_0x1ade37();}}},'charset':'utf8mb4','collate':_0x76ad('0x2e')});}; \ No newline at end of file +var _0x5b2f=['finally','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','./openchannelMessage.attributes','exports','define','OpenchannelMessage','openchannel_messages','fti_openchannel_messages','body','get','direction','toLowerCase','secret','isNil','OpenchannelInteractionId','then','update','createdAt','error','CmContact','describe','OpenchannelAccount','find','OpenchannelAccountId','OpenchannelInteraction','Interactions','Contact','keys','replyUri','info','OpenchannelMessage,\x20%s,\x20%s','format','Forwarding\x20message\x20%d\x20to\x20%s','length','Interaction','omit','POST','method','GET','threadId','catch','afterCreate','inspect'];(function(_0x537f77,_0x45ff08){var _0xb2616e=function(_0x2e5b6d){while(--_0x2e5b6d){_0x537f77['push'](_0x537f77['shift']());}};_0xb2616e(++_0x45ff08);}(_0x5b2f,0x19b));var _0xf5b2=function(_0x48ae97,_0x450240){_0x48ae97=_0x48ae97-0x0;var _0x13a62f=_0x5b2f[_0x48ae97];return _0x13a62f;};'use strict';var _=require(_0xf5b2('0x0'));var util=require('util');var logger=require(_0xf5b2('0x1'))(_0xf5b2('0x2'));var moment=require('moment');var BPromise=require(_0xf5b2('0x3'));var rp=require(_0xf5b2('0x4'));var fs=require('fs');var path=require(_0xf5b2('0x5'));var rimraf=require(_0xf5b2('0x6'));var config=require('../../config/environment');var attributes=require(_0xf5b2('0x7'));module[_0xf5b2('0x8')]=function(_0x589858,_0xddbd60){return _0x589858[_0xf5b2('0x9')](_0xf5b2('0xa'),attributes,{'tableName':_0xf5b2('0xb'),'paranoid':![],'indexes':[{'name':_0xf5b2('0xc'),'fields':[_0xf5b2('0xd')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x5955ad,_0x488ff4,_0x13b13d){var _0x2a342c=_0x589858['models'];var _0x564182=_0x5955ad[_0xf5b2('0xe')]({'plain':!![]});if(_0x564182[_0xf5b2('0xf')][_0xf5b2('0x10')]()==='in'||_0x564182[_0xf5b2('0xf')][_0xf5b2('0x10')]()==='out'&&!_0x564182[_0xf5b2('0x11')]&&!_[_0xf5b2('0x12')](_0x564182['UserId'])){_0x2a342c['OpenchannelInteraction']['findOne']({'where':{'id':_0x564182[_0xf5b2('0x13')]}})[_0xf5b2('0x14')](function(_0xcc8ab3){if(_0xcc8ab3){_0xcc8ab3[_0xf5b2('0x15')]({'lastMsgAt':_0x564182[_0xf5b2('0x16')],'lastMsgDirection':_0x564182[_0xf5b2('0xf')]['toLowerCase']()});}})['catch'](function(_0x24f6fe){console[_0xf5b2('0x17')](_0x24f6fe);});}if(_0x564182[_0xf5b2('0xf')]==='out'&&!_0x564182[_0xf5b2('0x11')]){var _0x4d461e;_0x2a342c[_0xf5b2('0x18')][_0xf5b2('0x19')]()[_0xf5b2('0x14')](function(_0x2bc71e){return _0x2a342c[_0xf5b2('0x1a')][_0xf5b2('0x1b')]({'where':{'id':_0x564182[_0xf5b2('0x1c')]},'include':[{'model':_0x2a342c[_0xf5b2('0x1d')],'as':_0xf5b2('0x1e'),'where':{'id':_0x564182[_0xf5b2('0x13')]},'limit':0x1,'include':[{'model':_0x2a342c['CmContact'],'as':_0xf5b2('0x1f'),'attributes':_[_0xf5b2('0x20')](_0x2bc71e)}]}]});})['then'](function(_0x47cf91){_0x4d461e=_0x47cf91[_0xf5b2('0xe')]({'plain':!![]});if(_0x4d461e&&_0x4d461e[_0xf5b2('0x21')]){logger[_0xf5b2('0x22')](_0xf5b2('0x23'),'afterCreate',util[_0xf5b2('0x24')](_0xf5b2('0x25'),_0x564182['id'],_0x4d461e[_0xf5b2('0x21')]));if(_0x4d461e[_0xf5b2('0x1e')]&&_0x4d461e[_0xf5b2('0x1e')][_0xf5b2('0x26')]){_0x564182[_0xf5b2('0x27')]=_[_0xf5b2('0x28')](_0x4d461e['Interactions'][0x0],_0xf5b2('0x1f'));_0x564182[_0xf5b2('0x1f')]=_0x4d461e[_0xf5b2('0x1e')][0x0][_0xf5b2('0x1f')];}var _0x488ff4={'method':_0xf5b2('0x29'),'uri':encodeURI(_0x4d461e[_0xf5b2('0x21')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x488ff4[_0xf5b2('0x2a')]){case _0xf5b2('0x2b'):_0x488ff4['qs']=_0x564182;break;case _0xf5b2('0x29'):_0x488ff4[_0xf5b2('0xd')]=_0x564182;break;}return rp(_0x488ff4)[_0xf5b2('0x14')](function(_0x1f675e){logger[_0xf5b2('0x22')](_0xf5b2('0x23'),'afterCreate',util[_0xf5b2('0x24')]('Message\x20%d\x20forwarded\x20to\x20%s',_0x564182['id'],_0x4d461e[_0xf5b2('0x21')]));if(_0x1f675e[_0xf5b2('0xd')][_0xf5b2('0x2c')]&&_0x1f675e[_0xf5b2('0xd')]['threadId']!=_0x564182[_0xf5b2('0x27')][_0xf5b2('0x2c')]){return _0x2a342c[_0xf5b2('0x1d')][_0xf5b2('0x15')]({'threadId':_0x1f675e[_0xf5b2('0xd')][_0xf5b2('0x2c')]},{'logging':!![],'where':{'id':_0x564182[_0xf5b2('0x27')]['id']}});}else{return;}})[_0xf5b2('0x14')](function(){return _0x5955ad[_0xf5b2('0x15')]({'read':!![]});})[_0xf5b2('0x2d')](function(_0x38ac1b){logger['error']('OpenchannelMessage,\x20%s,\x20%s',_0xf5b2('0x2e'),util[_0xf5b2('0x2f')](_0x38ac1b,{'showHidden':![],'depth':null}));_0x13b13d();});}else{_0x13b13d();}})[_0xf5b2('0x30')](function(){_0x13b13d();});}else{_0x13b13d();}}},'charset':_0xf5b2('0x31'),'collate':_0xf5b2('0x32')});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.rpc.js b/server/api/openchannelMessage/openchannelMessage.rpc.js index c467ac5..8820cdb 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 _0x2a07=['message','result','CreateOpenchannelMessage','OpenchannelMessage','create','options','raw','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./openchannelMessage.socket','register','request','then','info','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','OpenchannelMessage,\x20%s,\x20%s'];(function(_0x3a7848,_0x39cf87){var _0xc9f718=function(_0x46a9f2){while(--_0x46a9f2){_0x3a7848['push'](_0x3a7848['shift']());}};_0xc9f718(++_0x39cf87);}(_0x2a07,0x74));var _0x72a0=function(_0x8b953b,_0x132acf){_0x8b953b=_0x8b953b-0x0;var _0x1943d5=_0x2a07[_0x8b953b];return _0x1943d5;};'use strict';var _=require(_0x72a0('0x0'));var util=require(_0x72a0('0x1'));var moment=require(_0x72a0('0x2'));var BPromise=require(_0x72a0('0x3'));var rs=require(_0x72a0('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x72a0('0x5'))['db'];var utils=require(_0x72a0('0x6'));var logger=require(_0x72a0('0x7'))(_0x72a0('0x8'));var config=require(_0x72a0('0x9'));var jayson=require(_0x72a0('0xa'));var client=jayson[_0x72a0('0xb')][_0x72a0('0xc')]({'port':0x232a});config[_0x72a0('0xd')]=_[_0x72a0('0xe')](config[_0x72a0('0xd')],{'host':_0x72a0('0xf'),'port':0x18eb});var socket=require(_0x72a0('0x10'))(new Redis(config[_0x72a0('0xd')]));require(_0x72a0('0x11'))[_0x72a0('0x12')](socket);function respondWithRpcPromise(_0x5c1d1e,_0x169dc2,_0x1109f7){return new BPromise(function(_0x54abf6,_0x46fb8a){return client[_0x72a0('0x13')](_0x5c1d1e,_0x1109f7)[_0x72a0('0x14')](function(_0x44d7cf){logger[_0x72a0('0x15')]('OpenchannelMessage,\x20%s,\x20%s',_0x169dc2,_0x72a0('0x16'));logger[_0x72a0('0x17')](_0x72a0('0x18'),_0x169dc2,_0x72a0('0x16'),JSON[_0x72a0('0x19')](_0x44d7cf));if(_0x44d7cf[_0x72a0('0x1a')]){if(_0x44d7cf[_0x72a0('0x1a')]['code']===0x1f4){logger['error'](_0x72a0('0x1b'),_0x169dc2,_0x44d7cf[_0x72a0('0x1a')][_0x72a0('0x1c')]);return _0x46fb8a(_0x44d7cf[_0x72a0('0x1a')][_0x72a0('0x1c')]);}logger[_0x72a0('0x1a')]('OpenchannelMessage,\x20%s,\x20%s',_0x169dc2,_0x44d7cf[_0x72a0('0x1a')][_0x72a0('0x1c')]);return _0x54abf6(_0x44d7cf[_0x72a0('0x1a')][_0x72a0('0x1c')]);}else{logger[_0x72a0('0x15')]('OpenchannelMessage,\x20%s,\x20%s',_0x169dc2,_0x72a0('0x16'));_0x54abf6(_0x44d7cf[_0x72a0('0x1d')][_0x72a0('0x1c')]);}})['catch'](function(_0x144bfc){logger[_0x72a0('0x1a')](_0x72a0('0x1b'),_0x169dc2,_0x144bfc);_0x46fb8a(_0x144bfc);});});}exports[_0x72a0('0x1e')]=function(_0x5437df){var _0x3bc78b=this;return new Promise(function(_0x5b8f2c,_0x3d0607){return db[_0x72a0('0x1f')][_0x72a0('0x20')](_0x5437df['body'],{'raw':_0x5437df[_0x72a0('0x21')]?_0x5437df[_0x72a0('0x21')][_0x72a0('0x22')]===undefined?!![]:![]:!![]})[_0x72a0('0x14')](function(_0x5d6145){logger[_0x72a0('0x15')](_0x72a0('0x1e'),_0x5437df);logger[_0x72a0('0x17')](_0x72a0('0x1e'),_0x5437df,JSON[_0x72a0('0x19')](_0x5d6145));_0x5b8f2c(_0x5d6145);})[_0x72a0('0x23')](function(_0x5c4daf){logger['error'](_0x72a0('0x1e'),_0x5c4daf[_0x72a0('0x1c')],_0x5437df);_0x3d0607(_0x3bc78b[_0x72a0('0x1a')](0x1f4,_0x5c4daf[_0x72a0('0x1c')]));});});}; \ No newline at end of file +var _0xce62=['../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./openchannelMessage.socket','register','request','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','CreateOpenchannelMessage','create','options','raw','then','lodash','util','bluebird','randomstring','ioredis'];(function(_0x4c440b,_0x3ea627){var _0x2d48cf=function(_0x56bac7){while(--_0x56bac7){_0x4c440b['push'](_0x4c440b['shift']());}};_0x2d48cf(++_0x3ea627);}(_0xce62,0x83));var _0x2ce6=function(_0x5684ec,_0x297da6){_0x5684ec=_0x5684ec-0x0;var _0x3d0e3b=_0xce62[_0x5684ec];return _0x3d0e3b;};'use strict';var _=require(_0x2ce6('0x0'));var util=require(_0x2ce6('0x1'));var moment=require('moment');var BPromise=require(_0x2ce6('0x2'));var rs=require(_0x2ce6('0x3'));var fs=require('fs');var Redis=require(_0x2ce6('0x4'));var db=require(_0x2ce6('0x5'))['db'];var utils=require(_0x2ce6('0x6'));var logger=require(_0x2ce6('0x7'))('rpc');var config=require(_0x2ce6('0x8'));var jayson=require(_0x2ce6('0x9'));var client=jayson[_0x2ce6('0xa')][_0x2ce6('0xb')]({'port':0x232a});config[_0x2ce6('0xc')]=_[_0x2ce6('0xd')](config['redis'],{'host':_0x2ce6('0xe'),'port':0x18eb});var socket=require(_0x2ce6('0xf'))(new Redis(config['redis']));require(_0x2ce6('0x10'))[_0x2ce6('0x11')](socket);function respondWithRpcPromise(_0x8fa0d2,_0x492a85,_0x3f203a){return new BPromise(function(_0x5693d4,_0x526a35){return client[_0x2ce6('0x12')](_0x8fa0d2,_0x3f203a)['then'](function(_0x13f665){logger['info'](_0x2ce6('0x13'),_0x492a85,_0x2ce6('0x14'));logger[_0x2ce6('0x15')](_0x2ce6('0x16'),_0x492a85,_0x2ce6('0x14'),JSON[_0x2ce6('0x17')](_0x13f665));if(_0x13f665[_0x2ce6('0x18')]){if(_0x13f665[_0x2ce6('0x18')]['code']===0x1f4){logger[_0x2ce6('0x18')]('OpenchannelMessage,\x20%s,\x20%s',_0x492a85,_0x13f665[_0x2ce6('0x18')][_0x2ce6('0x19')]);return _0x526a35(_0x13f665[_0x2ce6('0x18')]['message']);}logger[_0x2ce6('0x18')](_0x2ce6('0x13'),_0x492a85,_0x13f665[_0x2ce6('0x18')][_0x2ce6('0x19')]);return _0x5693d4(_0x13f665[_0x2ce6('0x18')][_0x2ce6('0x19')]);}else{logger[_0x2ce6('0x1a')](_0x2ce6('0x13'),_0x492a85,_0x2ce6('0x14'));_0x5693d4(_0x13f665[_0x2ce6('0x1b')]['message']);}})[_0x2ce6('0x1c')](function(_0x126bc7){logger[_0x2ce6('0x18')]('OpenchannelMessage,\x20%s,\x20%s',_0x492a85,_0x126bc7);_0x526a35(_0x126bc7);});});}exports[_0x2ce6('0x1d')]=function(_0x2b5bf0){var _0xa551b9=this;return new Promise(function(_0x3d2ee8,_0x3b55c0){return db['OpenchannelMessage'][_0x2ce6('0x1e')](_0x2b5bf0['body'],{'raw':_0x2b5bf0['options']?_0x2b5bf0[_0x2ce6('0x1f')][_0x2ce6('0x20')]===undefined?!![]:![]:!![]})[_0x2ce6('0x21')](function(_0x4f84b2){logger[_0x2ce6('0x1a')](_0x2ce6('0x1d'),_0x2b5bf0);logger[_0x2ce6('0x15')](_0x2ce6('0x1d'),_0x2b5bf0,JSON['stringify'](_0x4f84b2));_0x3d2ee8(_0x4f84b2);})[_0x2ce6('0x1c')](function(_0xf3fbc0){logger[_0x2ce6('0x18')](_0x2ce6('0x1d'),_0xf3fbc0[_0x2ce6('0x19')],_0x2b5bf0);_0x3b55c0(_0xa551b9[_0x2ce6('0x18')](0x1f4,_0xf3fbc0[_0x2ce6('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.socket.js b/server/api/openchannelMessage/openchannelMessage.socket.js index c6d71f4..4c81c1b 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 _0xd8b0=['save','emit','./openchannelMessage.events'];(function(_0x48f4f8,_0x2720fc){var _0x568d31=function(_0x3381b1){while(--_0x3381b1){_0x48f4f8['push'](_0x48f4f8['shift']());}};_0x568d31(++_0x2720fc);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var OpenchannelMessageEvents=require(_0x0d8b('0x0'));var events=[_0x0d8b('0x1'),'remove','update'];function createListener(_0x4b72b0,_0x3ff8df){return function(_0x5b9b89){_0x3ff8df[_0x0d8b('0x2')](_0x4b72b0,_0x5b9b89);};}function removeListener(_0x364286,_0x8196ed){return function(){OpenchannelMessageEvents['removeListener'](_0x364286,_0x8196ed);};}exports['register']=function(_0x3f8b6f){for(var _0x227c63=0x0,_0x39f43a=events['length'];_0x227c63<_0x39f43a;_0x227c63++){var _0x413284=events[_0x227c63];var _0x284169=createListener('openchannelMessage:'+_0x413284,_0x3f8b6f);OpenchannelMessageEvents['on'](_0x413284,_0x284169);}}; \ No newline at end of file +var _0xac4a=['save','remove','update','removeListener','./openchannelMessage.events'];(function(_0x37e09b,_0x4c5ee9){var _0x26a1ed=function(_0x5c1d86){while(--_0x5c1d86){_0x37e09b['push'](_0x37e09b['shift']());}};_0x26a1ed(++_0x4c5ee9);}(_0xac4a,0x13f));var _0xaac4=function(_0x10d131,_0x286276){_0x10d131=_0x10d131-0x0;var _0x53678b=_0xac4a[_0x10d131];return _0x53678b;};'use strict';var OpenchannelMessageEvents=require(_0xaac4('0x0'));var events=[_0xaac4('0x1'),_0xaac4('0x2'),_0xaac4('0x3')];function createListener(_0x38f4f4,_0x1dc251){return function(_0x5aeb7d){_0x1dc251['emit'](_0x38f4f4,_0x5aeb7d);};}function removeListener(_0x2af0f6,_0x2a5762){return function(){OpenchannelMessageEvents[_0xaac4('0x4')](_0x2af0f6,_0x2a5762);};}exports['register']=function(_0x1283a5){for(var _0x53d03a=0x0,_0x1cdfc5=events['length'];_0x53d03a<_0x1cdfc5;_0x53d03a++){var _0x1e4283=events[_0x53d03a];var _0x27354c=createListener('openchannelMessage:'+_0x1e4283,_0x1283a5);OpenchannelMessageEvents['on'](_0x1e4283,_0x27354c);}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/index.js b/server/api/openchannelQueue/index.js index 8ffa0cb..5a60d4b 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 _0x22da=['express','Router','../../components/interaction/service','../../config/environment','./openchannelQueue.controller','get','index','isAuthenticated','describe','/:id','/:id/members','getMembers','/:id/teams','/:id/users','post','create','addTeams','addAgents','update','delete','destroy','removeTeams','removeAgents','exports','path','connect-timeout'];(function(_0x1f98d5,_0x49610e){var _0xc29803=function(_0x56abca){while(--_0x56abca){_0x1f98d5['push'](_0x1f98d5['shift']());}};_0xc29803(++_0x49610e);}(_0x22da,0x80));var _0xa22d=function(_0x4872b1,_0x5d670f){_0x4872b1=_0x4872b1-0x0;var _0xece4d3=_0x22da[_0x4872b1];return _0xece4d3;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xa22d('0x0'));var timeout=require(_0xa22d('0x1'));var express=require(_0xa22d('0x2'));var router=express[_0xa22d('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0xa22d('0x4'));var config=require(_0xa22d('0x5'));var controller=require(_0xa22d('0x6'));router[_0xa22d('0x7')]('/',auth['isAuthenticated'](),controller[_0xa22d('0x8')]);router[_0xa22d('0x7')]('/describe',auth[_0xa22d('0x9')](),controller[_0xa22d('0xa')]);router[_0xa22d('0x7')](_0xa22d('0xb'),auth['isAuthenticated'](),controller['show']);router[_0xa22d('0x7')](_0xa22d('0xc'),auth['isAuthenticated'](),controller[_0xa22d('0xd')]);router[_0xa22d('0x7')](_0xa22d('0xe'),auth[_0xa22d('0x9')](),controller['getTeams']);router['get'](_0xa22d('0xf'),auth[_0xa22d('0x9')](),controller['getAgents']);router[_0xa22d('0x10')]('/',auth['isAuthenticated'](),controller[_0xa22d('0x11')]);router[_0xa22d('0x10')](_0xa22d('0xe'),auth['isAuthenticated'](),controller[_0xa22d('0x12')]);router[_0xa22d('0x10')](_0xa22d('0xf'),auth[_0xa22d('0x9')](),controller[_0xa22d('0x13')]);router['put'](_0xa22d('0xb'),auth[_0xa22d('0x9')](),controller[_0xa22d('0x14')]);router[_0xa22d('0x15')](_0xa22d('0xb'),auth[_0xa22d('0x9')](),controller[_0xa22d('0x16')]);router[_0xa22d('0x15')](_0xa22d('0xe'),auth[_0xa22d('0x9')](),controller[_0xa22d('0x17')]);router[_0xa22d('0x15')](_0xa22d('0xf'),auth[_0xa22d('0x9')](),controller[_0xa22d('0x18')]);module[_0xa22d('0x19')]=router; \ No newline at end of file +var _0x326f=['/:id/teams','addTeams','/:id/users','put','/:id','update','delete','destroy','removeTeams','multer','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelQueue.controller','get','isAuthenticated','index','/describe','describe','/:id/members','getMembers','post'];(function(_0x25c72a,_0x4e9062){var _0x2d66cf=function(_0x3789eb){while(--_0x3789eb){_0x25c72a['push'](_0x25c72a['shift']());}};_0x2d66cf(++_0x4e9062);}(_0x326f,0xd1));var _0xf326=function(_0x9beddd,_0x33779e){_0x9beddd=_0x9beddd-0x0;var _0x50f78f=_0x326f[_0x9beddd];return _0x50f78f;};'use strict';var multer=require(_0xf326('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xf326('0x1'));var express=require(_0xf326('0x2'));var router=express[_0xf326('0x3')]();var auth=require(_0xf326('0x4'));var interaction=require(_0xf326('0x5'));var config=require(_0xf326('0x6'));var controller=require(_0xf326('0x7'));router[_0xf326('0x8')]('/',auth[_0xf326('0x9')](),controller[_0xf326('0xa')]);router['get'](_0xf326('0xb'),auth[_0xf326('0x9')](),controller[_0xf326('0xc')]);router[_0xf326('0x8')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0xf326('0x8')](_0xf326('0xd'),auth[_0xf326('0x9')](),controller[_0xf326('0xe')]);router[_0xf326('0x8')]('/:id/teams',auth[_0xf326('0x9')](),controller['getTeams']);router[_0xf326('0x8')]('/:id/users',auth[_0xf326('0x9')](),controller['getAgents']);router[_0xf326('0xf')]('/',auth[_0xf326('0x9')](),controller['create']);router[_0xf326('0xf')](_0xf326('0x10'),auth[_0xf326('0x9')](),controller[_0xf326('0x11')]);router['post'](_0xf326('0x12'),auth['isAuthenticated'](),controller['addAgents']);router[_0xf326('0x13')](_0xf326('0x14'),auth[_0xf326('0x9')](),controller[_0xf326('0x15')]);router[_0xf326('0x16')](_0xf326('0x14'),auth[_0xf326('0x9')](),controller[_0xf326('0x17')]);router['delete'](_0xf326('0x10'),auth[_0xf326('0x9')](),controller[_0xf326('0x18')]);router[_0xf326('0x16')](_0xf326('0x12'),auth[_0xf326('0x9')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.attributes.js b/server/api/openchannelQueue/openchannelQueue.attributes.js index 875e3d2..d7ea0c2 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 _0xf811=['rrmemory','beepall','roundrobin','sequelize','exports','STRING','name','INTEGER','ENUM'];(function(_0x339dfc,_0x5eaeb6){var _0x51e8f4=function(_0x3bad2c){while(--_0x3bad2c){_0x339dfc['push'](_0x339dfc['shift']());}};_0x51e8f4(++_0x5eaeb6);}(_0xf811,0x6f));var _0x1f81=function(_0x1e7b16,_0x4607a1){_0x1e7b16=_0x1e7b16-0x0;var _0x37fadc=_0xf811[_0x1e7b16];return _0x37fadc;};'use strict';var Sequelize=require(_0x1f81('0x0'));module[_0x1f81('0x1')]={'name':{'type':Sequelize[_0x1f81('0x2')],'unique':_0x1f81('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x1f81('0x2')]},'timeout':{'type':Sequelize[_0x1f81('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x1f81('0x5')](_0x1f81('0x6'),_0x1f81('0x7'),_0x1f81('0x8'))}}; \ No newline at end of file +var _0xca9e=['name','INTEGER','ENUM','rrmemory','beepall','STRING'];(function(_0x10cf42,_0x49e566){var _0x42b529=function(_0x142db2){while(--_0x142db2){_0x10cf42['push'](_0x10cf42['shift']());}};_0x42b529(++_0x49e566);}(_0xca9e,0x167));var _0xeca9=function(_0x366ba8,_0x14e75d){_0x366ba8=_0x366ba8-0x0;var _0xf3832e=_0xca9e[_0x366ba8];return _0xf3832e;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xeca9('0x0')],'unique':_0xeca9('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xeca9('0x0')]},'timeout':{'type':Sequelize[_0xeca9('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xeca9('0x3')](_0xeca9('0x4'),_0xeca9('0x5'),'roundrobin')}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.controller.js b/server/api/openchannelQueue/openchannelQueue.controller.js index 8697097..3f14334 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 _0xc47b=['userOpenchannelQueue:remove','addAgents','spread','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','./openchannelQueue.socket','register','status','count','offset','set','Content-Range','json','reject','update','then','destroy','OpenchannelQueues','UserProfileResource','end','sendStatus','stack','name','send','index','rawAttributes','model','keys','query','intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','filter','merge','map','type','key','options','OpenchannelQueue','includeAll','include','rows','catch','show','length','find','create','user','get','role','UserProfileSection','userProfileId','autoAssociation','error','body','params','describe','getMembers','findOne','UserOpenchannelQueue','OpenchannelQueueId','findAll','User','findAndCountAll','UserId','agent','format','%s/%s','SIP','createdAt','Team','getTeams','Agents','online','interface','flatMap','sequelize','transaction','addTeams','each','findOrCreate','forEach','emit','userOpenchannelQueue:save','ids','select','field','from','team_has_openchannel_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','OpenchannelQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','every','TeamId','includes','all','union','compact','value','removeTeams','removeAgents'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xc47b,0x1b8));var _0xbc47=function(_0x4cb061,_0x4a2956){_0x4cb061=_0x4cb061-0x0;var _0x222df2=_0xc47b[_0x4cb061];return _0x222df2;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xbc47('0x0'));var rimraf=require(_0xbc47('0x1'));var zipdir=require(_0xbc47('0x2'));var jsonpatch=require(_0xbc47('0x3'));var rp=require(_0xbc47('0x4'));var moment=require('moment');var BPromise=require(_0xbc47('0x5'));var Mustache=require(_0xbc47('0x6'));var util=require('util');var path=require(_0xbc47('0x7'));var sox=require(_0xbc47('0x8'));var csv=require('to-csv');var ejs=require(_0xbc47('0x9'));var fs=require('fs');var _=require(_0xbc47('0xa'));var squel=require(_0xbc47('0xb'));var crypto=require(_0xbc47('0xc'));var jsforce=require(_0xbc47('0xd'));var deskjs=require(_0xbc47('0xe'));var toCsv=require(_0xbc47('0xf'));var querystring=require(_0xbc47('0x10'));var Papa=require(_0xbc47('0x11'));var Redis=require(_0xbc47('0x12'));var authService=require(_0xbc47('0x13'));var qs=require(_0xbc47('0x14'));var as=require(_0xbc47('0x15'));var hardwareService=require(_0xbc47('0x16'));var logger=require(_0xbc47('0x17'))('api');var utils=require(_0xbc47('0x18'));var config=require(_0xbc47('0x19'));var db=require('../../mysqldb')['db'];config[_0xbc47('0x1a')]=_[_0xbc47('0x1b')](config['redis'],{'host':_0xbc47('0x1c'),'port':0x18eb});var socket=require(_0xbc47('0x1d'))(new Redis(config['redis']));require(_0xbc47('0x1e'))[_0xbc47('0x1f')](socket);function respondWithStatusCode(_0x48b370,_0x29653d){_0x29653d=_0x29653d||0xcc;return function(_0x279509){if(_0x279509){return _0x48b370['sendStatus'](_0x29653d);}return _0x48b370[_0xbc47('0x20')](_0x29653d)['end']();};}function respondWithResult(_0x2b73ad,_0x1a3005){_0x1a3005=_0x1a3005||0xc8;return function(_0x4ea769){if(_0x4ea769){return _0x2b73ad[_0xbc47('0x20')](_0x1a3005)['json'](_0x4ea769);}};}function respondWithFilteredResult(_0x1fa454,_0x1cc71b){return function(_0x2314e8){if(_0x2314e8){var _0x220206=_0x2314e8[_0xbc47('0x21')],_0x44fa98=_0x1cc71b['offset'],_0x4e3215=_0x1cc71b[_0xbc47('0x22')]+_0x1cc71b['limit'],_0x54b73e;if(_0x4e3215>=_0x220206){_0x4e3215=_0x220206;_0x54b73e=0xc8;}else{_0x54b73e=0xce;}_0x1fa454[_0xbc47('0x20')](_0x54b73e);return _0x1fa454[_0xbc47('0x23')](_0xbc47('0x24'),_0x44fa98+'-'+_0x4e3215+'/'+_0x220206)[_0xbc47('0x25')](_0x2314e8);}return null;};}function patchUpdates(_0x4707ab){return function(_0x11e3ad){try{jsonpatch['apply'](_0x11e3ad,_0x4707ab,!![]);}catch(_0x5ee47f){return BPromise[_0xbc47('0x26')](_0x5ee47f);}return _0x11e3ad['save']();};}function saveUpdates(_0x374dd7,_0x271f66){return function(_0x2795ff){if(_0x2795ff){return _0x2795ff[_0xbc47('0x27')](_0x374dd7)[_0xbc47('0x28')](function(_0x19a7ed){return _0x19a7ed;});}return null;};}function removeEntity(_0x37864d,_0x5a18ad){return function(_0x1424c2){if(_0x1424c2){return _0x1424c2[_0xbc47('0x29')]()['then'](function(){var _0x46cb7e=_0x1424c2['get']({'plain':!![]});var _0x2b2c34=_0xbc47('0x2a');return db[_0xbc47('0x2b')][_0xbc47('0x29')]({'where':{'type':_0x2b2c34,'resourceId':_0x46cb7e['id']}})['then'](function(){return _0x1424c2;});})['then'](function(){_0x37864d[_0xbc47('0x20')](0xcc)[_0xbc47('0x2c')]();});}};}function handleEntityNotFound(_0x8c6a1b,_0x1eb920){return function(_0x35382c){if(!_0x35382c){_0x8c6a1b[_0xbc47('0x2d')](0x194);}return _0x35382c;};}function handleError(_0x3119a2,_0x22f64a){_0x22f64a=_0x22f64a||0x1f4;return function(_0x3ea2f4){logger['error'](_0x3ea2f4[_0xbc47('0x2e')]);if(_0x3ea2f4[_0xbc47('0x2f')]){delete _0x3ea2f4['name'];}_0x3119a2[_0xbc47('0x20')](_0x22f64a)[_0xbc47('0x30')](_0x3ea2f4);};}exports[_0xbc47('0x31')]=function(_0x5d6e1f,_0x5d441d){var _0x464cd6={},_0x4623d7={},_0xe3ae34={'count':0x0,'rows':[]};var _0x434b40=db['OpenchannelQueue'][_0xbc47('0x32')];_0x4623d7[_0xbc47('0x33')]=_[_0xbc47('0x34')](_0x434b40);_0x4623d7[_0xbc47('0x35')]=_[_0xbc47('0x34')](_0x5d6e1f[_0xbc47('0x35')]);_0x4623d7['filters']=_[_0xbc47('0x36')](_0x4623d7['model'],_0x4623d7['query']);_0x464cd6[_0xbc47('0x37')]=_[_0xbc47('0x36')](_0x4623d7[_0xbc47('0x33')],qs['fields'](_0x5d6e1f[_0xbc47('0x35')][_0xbc47('0x38')]));_0x464cd6[_0xbc47('0x37')]=_0x464cd6[_0xbc47('0x37')]['length']?_0x464cd6[_0xbc47('0x37')]:_0x4623d7[_0xbc47('0x33')];if(!_0x5d6e1f['query'][_0xbc47('0x39')](_0xbc47('0x3a'))){_0x464cd6[_0xbc47('0x3b')]=qs[_0xbc47('0x3b')](_0x5d6e1f[_0xbc47('0x35')]['limit']);_0x464cd6['offset']=qs['offset'](_0x5d6e1f[_0xbc47('0x35')][_0xbc47('0x22')]);}_0x464cd6[_0xbc47('0x3c')]=qs[_0xbc47('0x3d')](_0x5d6e1f[_0xbc47('0x35')][_0xbc47('0x3d')]);_0x464cd6[_0xbc47('0x3e')]=qs[_0xbc47('0x3f')](_[_0xbc47('0x40')](_0x5d6e1f[_0xbc47('0x35')],_0x4623d7['filters']));if(_0x5d6e1f[_0xbc47('0x35')][_0xbc47('0x41')]){_0x464cd6[_0xbc47('0x3e')]=_[_0xbc47('0x42')](_0x464cd6[_0xbc47('0x3e')],{'$or':_[_0xbc47('0x43')](_0x434b40,function(_0x18db2c){if(_0x18db2c[_0xbc47('0x44')][_0xbc47('0x45')]!=='VIRTUAL'){var _0x33ab3d={};_0x33ab3d[_0x18db2c['field']]={'$like':'%'+_0x5d6e1f[_0xbc47('0x35')]['filter']+'%'};return _0x33ab3d;}})});}_0x464cd6=_[_0xbc47('0x42')]({},_0x464cd6,_0x5d6e1f[_0xbc47('0x46')]);var _0x3d54ad={'where':_0x464cd6[_0xbc47('0x3e')]};return db[_0xbc47('0x47')][_0xbc47('0x21')](_0x3d54ad)['then'](function(_0x4514c4){_0xe3ae34[_0xbc47('0x21')]=_0x4514c4;if(_0x5d6e1f[_0xbc47('0x35')][_0xbc47('0x48')]){_0x464cd6[_0xbc47('0x49')]=[{'all':!![]}];}return db[_0xbc47('0x47')]['findAll'](_0x464cd6);})[_0xbc47('0x28')](function(_0x355019){_0xe3ae34[_0xbc47('0x4a')]=_0x355019;return _0xe3ae34;})[_0xbc47('0x28')](respondWithFilteredResult(_0x5d441d,_0x464cd6))[_0xbc47('0x4b')](handleError(_0x5d441d,null));};exports[_0xbc47('0x4c')]=function(_0x1485b9,_0x55d290){var _0x3f81ac={'raw':!![],'where':{'id':_0x1485b9['params']['id']}},_0x4e1f7a={};_0x4e1f7a[_0xbc47('0x33')]=_[_0xbc47('0x34')](db[_0xbc47('0x47')][_0xbc47('0x32')]);_0x4e1f7a[_0xbc47('0x35')]=_[_0xbc47('0x34')](_0x1485b9['query']);_0x4e1f7a[_0xbc47('0x3f')]=_[_0xbc47('0x36')](_0x4e1f7a[_0xbc47('0x33')],_0x4e1f7a['query']);_0x3f81ac[_0xbc47('0x37')]=_[_0xbc47('0x36')](_0x4e1f7a[_0xbc47('0x33')],qs['fields'](_0x1485b9[_0xbc47('0x35')][_0xbc47('0x38')]));_0x3f81ac['attributes']=_0x3f81ac[_0xbc47('0x37')][_0xbc47('0x4d')]?_0x3f81ac[_0xbc47('0x37')]:_0x4e1f7a[_0xbc47('0x33')];if(_0x1485b9[_0xbc47('0x35')]['includeAll']){_0x3f81ac[_0xbc47('0x49')]=[{'all':!![]}];}_0x3f81ac=_['merge']({},_0x3f81ac,_0x1485b9[_0xbc47('0x46')]);return db[_0xbc47('0x47')][_0xbc47('0x4e')](_0x3f81ac)[_0xbc47('0x28')](handleEntityNotFound(_0x55d290,null))[_0xbc47('0x28')](respondWithResult(_0x55d290,null))[_0xbc47('0x4b')](handleError(_0x55d290,null));};exports['create']=function(_0x24cb9d,_0x3fe852){return db[_0xbc47('0x47')][_0xbc47('0x4f')](_0x24cb9d['body'],{})[_0xbc47('0x28')](function(_0x2cb82d){var _0x16e1c1=_0x24cb9d[_0xbc47('0x50')][_0xbc47('0x51')]({'plain':!![]});if(!_0x16e1c1)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x16e1c1[_0xbc47('0x52')]===_0xbc47('0x50')){var _0x352b8f=_0x2cb82d[_0xbc47('0x51')]({'plain':!![]});var _0x13b0cd='OpenchannelQueues';return db[_0xbc47('0x53')][_0xbc47('0x4e')]({'where':{'name':_0x13b0cd,'userProfileId':_0x16e1c1[_0xbc47('0x54')]},'raw':!![]})[_0xbc47('0x28')](function(_0x4abbc8){if(_0x4abbc8&&_0x4abbc8[_0xbc47('0x55')]===0x0){return db[_0xbc47('0x2b')][_0xbc47('0x4f')]({'name':_0x352b8f[_0xbc47('0x2f')],'resourceId':_0x352b8f['id'],'type':_0x4abbc8[_0xbc47('0x2f')],'sectionId':_0x4abbc8['id']},{})[_0xbc47('0x28')](function(){return _0x2cb82d;});}else{return _0x2cb82d;}})[_0xbc47('0x4b')](function(_0x433bee){logger[_0xbc47('0x56')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x433bee);throw _0x433bee;});}return _0x2cb82d;})[_0xbc47('0x28')](respondWithResult(_0x3fe852,0xc9))[_0xbc47('0x4b')](handleError(_0x3fe852,null));};exports[_0xbc47('0x27')]=function(_0x3dacc0,_0x258437){if(_0x3dacc0['body']['id']){delete _0x3dacc0[_0xbc47('0x57')]['id'];}return db[_0xbc47('0x47')]['find']({'where':{'id':_0x3dacc0[_0xbc47('0x58')]['id']}})[_0xbc47('0x28')](handleEntityNotFound(_0x258437,null))[_0xbc47('0x28')](saveUpdates(_0x3dacc0[_0xbc47('0x57')],null))[_0xbc47('0x28')](respondWithResult(_0x258437,null))[_0xbc47('0x4b')](handleError(_0x258437,null));};exports[_0xbc47('0x29')]=function(_0x116a11,_0x3f8f61){return db[_0xbc47('0x47')][_0xbc47('0x4e')]({'where':{'id':_0x116a11['params']['id']}})[_0xbc47('0x28')](handleEntityNotFound(_0x3f8f61,null))['then'](removeEntity(_0x3f8f61,null))['catch'](handleError(_0x3f8f61,null));};exports[_0xbc47('0x59')]=function(_0x2b84a9,_0x2dbb83){return db['OpenchannelQueue']['describe']()['then'](respondWithResult(_0x2dbb83,null))['catch'](handleError(_0x2dbb83,null));};exports[_0xbc47('0x5a')]=function(_0x392bf6,_0x435200,_0x4d1a3c){var _0x2edcdc={'raw':!![],'where':{}},_0x5f00b3={},_0x21227f;return db[_0xbc47('0x47')][_0xbc47('0x5b')]({'where':{'id':_0x392bf6[_0xbc47('0x58')]['id']}})[_0xbc47('0x28')](handleEntityNotFound(_0x435200,null))[_0xbc47('0x28')](function(_0x5e879d){if(_0x5e879d){_0x21227f=_0x5e879d[_0xbc47('0x51')]({'plain':!![]});_0x5f00b3[_0xbc47('0x33')]=_['keys'](db[_0xbc47('0x5c')][_0xbc47('0x32')]);_0x5f00b3['query']=_[_0xbc47('0x34')](_0x392bf6[_0xbc47('0x35')]);_0x5f00b3[_0xbc47('0x3f')]=_[_0xbc47('0x36')](_0x5f00b3[_0xbc47('0x33')],_0x5f00b3['query']);_0x2edcdc['attributes']=_['intersection'](_0x5f00b3[_0xbc47('0x33')],qs[_0xbc47('0x38')](_0x392bf6[_0xbc47('0x35')][_0xbc47('0x38')]));_0x2edcdc[_0xbc47('0x37')]=_0x2edcdc[_0xbc47('0x37')]['length']?_0x2edcdc[_0xbc47('0x37')]:_0x5f00b3[_0xbc47('0x33')];if(!_0x392bf6[_0xbc47('0x35')][_0xbc47('0x39')](_0xbc47('0x3a'))){_0x2edcdc[_0xbc47('0x3b')]=qs[_0xbc47('0x3b')](_0x392bf6[_0xbc47('0x35')][_0xbc47('0x3b')]);_0x2edcdc['offset']=qs['offset'](_0x392bf6['query'][_0xbc47('0x22')]);}_0x2edcdc[_0xbc47('0x3c')]=qs[_0xbc47('0x3d')](_0x392bf6[_0xbc47('0x35')][_0xbc47('0x3d')]);_0x2edcdc[_0xbc47('0x3e')]=qs['filters'](_[_0xbc47('0x40')](_0x392bf6[_0xbc47('0x35')],_0x5f00b3[_0xbc47('0x3f')]));_0x2edcdc[_0xbc47('0x3e')][_0xbc47('0x5d')]=_0x5e879d['id'];if(_0x392bf6[_0xbc47('0x35')][_0xbc47('0x41')]){_0x2edcdc['where']=_[_0xbc47('0x42')](_0x2edcdc[_0xbc47('0x3e')],{'$or':_[_0xbc47('0x43')](_0x2edcdc[_0xbc47('0x37')],function(_0x449b57){var _0x38d914={};_0x38d914[_0x449b57]={'$like':'%'+_0x392bf6[_0xbc47('0x35')]['filter']+'%'};return _0x38d914;})});}_0x2edcdc=_['merge']({},_0x2edcdc,_0x392bf6[_0xbc47('0x46')]);return db[_0xbc47('0x5c')][_0xbc47('0x5e')](_0x2edcdc);}})[_0xbc47('0x28')](function(_0x1fcdac){if(_0x1fcdac){return db[_0xbc47('0x5f')][_0xbc47('0x60')]({'where':{'id':_[_0xbc47('0x43')](_0x1fcdac,_0xbc47('0x61')),'role':_0xbc47('0x62')},'attributes':['id','name','openchannelPause','updatedAt','createdAt']});}})[_0xbc47('0x28')](function(_0x44eb1d){if(_0x44eb1d){return{'count':_0x44eb1d[_0xbc47('0x21')],'rows':_[_0xbc47('0x43')](_0x44eb1d[_0xbc47('0x4a')],function(_0x3cf068){return{'membername':_0x3cf068['name'],'UserId':_0x3cf068['id'],'queue_name':_0x21227f[_0xbc47('0x2f')],'OpenchannelQueueId':_0x21227f['id'],'interface':util[_0xbc47('0x63')](_0xbc47('0x64'),_0xbc47('0x65'),_0x3cf068['name']),'penalty':0x0,'paused':_0x3cf068['openchannelPause'],'createdAt':_0x3cf068[_0xbc47('0x66')],'updatedAt':_0x3cf068['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0xbc47('0x28')](respondWithFilteredResult(_0x435200,_0x2edcdc))[_0xbc47('0x4b')](handleError(_0x435200,null));};exports['getTeams']=function(_0x512651,_0x1439a7,_0x366f03){var _0x21a455={};var _0x2c1d3b={};var _0xaad3cd;var _0x164676;return db[_0xbc47('0x47')][_0xbc47('0x5b')]({'where':{'id':_0x512651[_0xbc47('0x58')]['id']}})[_0xbc47('0x28')](handleEntityNotFound(_0x1439a7,null))['then'](function(_0x2eb573){if(_0x2eb573){_0xaad3cd=_0x2eb573;_0x2c1d3b[_0xbc47('0x33')]=_[_0xbc47('0x34')](db[_0xbc47('0x67')][_0xbc47('0x32')]);_0x2c1d3b[_0xbc47('0x35')]=_[_0xbc47('0x34')](_0x512651['query']);_0x2c1d3b[_0xbc47('0x3f')]=_['intersection'](_0x2c1d3b[_0xbc47('0x33')],_0x2c1d3b[_0xbc47('0x35')]);_0x21a455['attributes']=_[_0xbc47('0x36')](_0x2c1d3b[_0xbc47('0x33')],qs[_0xbc47('0x38')](_0x512651['query']['fields']));_0x21a455['attributes']=_0x21a455[_0xbc47('0x37')]['length']?_0x21a455['attributes']:_0x2c1d3b[_0xbc47('0x33')];_0x21a455[_0xbc47('0x3c')]=qs[_0xbc47('0x3d')](_0x512651[_0xbc47('0x35')][_0xbc47('0x3d')]);_0x21a455['where']=qs[_0xbc47('0x3f')](_[_0xbc47('0x40')](_0x512651[_0xbc47('0x35')],_0x2c1d3b[_0xbc47('0x3f')]));if(_0x512651['query']['filter']){_0x21a455[_0xbc47('0x3e')]=_[_0xbc47('0x42')](_0x21a455['where'],{'$or':_[_0xbc47('0x43')](_0x21a455[_0xbc47('0x37')],function(_0x2d2c7f){var _0x599a26={};_0x599a26[_0x2d2c7f]={'$like':'%'+_0x512651[_0xbc47('0x35')][_0xbc47('0x41')]+'%'};return _0x599a26;})});}_0x21a455=_['merge']({},_0x21a455,_0x512651[_0xbc47('0x46')]);return _0xaad3cd[_0xbc47('0x68')](_0x21a455);}})['then'](function(_0x53f384){if(_0x53f384){_0x164676=_0x53f384[_0xbc47('0x4d')];if(!_0x512651[_0xbc47('0x35')][_0xbc47('0x39')](_0xbc47('0x3a'))){_0x21a455['limit']=qs[_0xbc47('0x3b')](_0x512651[_0xbc47('0x35')][_0xbc47('0x3b')]);_0x21a455[_0xbc47('0x22')]=qs[_0xbc47('0x22')](_0x512651[_0xbc47('0x35')][_0xbc47('0x22')]);}return _0xaad3cd['getTeams'](_0x21a455);}})[_0xbc47('0x28')](function(_0x2f3be1){if(_0x2f3be1){return _0x2f3be1?{'count':_0x164676,'rows':_0x2f3be1}:null;}})[_0xbc47('0x28')](respondWithResult(_0x1439a7,null))[_0xbc47('0x4b')](handleError(_0x1439a7,null));};exports['addTeams']=function(_0x13afdf,_0x1ab5ce,_0x4b2bea){var _0xe5c751=_0x13afdf[_0xbc47('0x57')]['ids'];return db[_0xbc47('0x67')][_0xbc47('0x5e')]({'where':{'id':_0xe5c751},'attributes':['id'],'include':[{'model':db['User'],'as':_0xbc47('0x69'),'attributes':['id',_0xbc47('0x2f'),_0xbc47('0x6a'),'voicePause',_0xbc47('0x6b')],'raw':!![]}]})[_0xbc47('0x28')](function(_0x18db68){if(_0x18db68){var _0x2fbc12=_[_0xbc47('0x6c')](_0x18db68,function(_0x363978){var _0x40a24a=_0x363978[_0xbc47('0x51')]({'plain':!![]});return _0x40a24a[_0xbc47('0x69')];});return db[_0xbc47('0x47')][_0xbc47('0x4e')]({'where':{'id':_0x13afdf[_0xbc47('0x58')]['id']}})[_0xbc47('0x28')](function(_0x51098e){return db[_0xbc47('0x6d')][_0xbc47('0x6e')](function(_0x37d0a0){return _0x51098e[_0xbc47('0x6f')](_0xe5c751,{'transaction':_0x37d0a0})[_0xbc47('0x28')](function(){return BPromise[_0xbc47('0x70')](_0x2fbc12,function(_0x1b1fcb){return db[_0xbc47('0x5c')][_0xbc47('0x71')]({'where':{'UserId':_0x1b1fcb['id'],'OpenchannelQueueId':_0x13afdf['params']['id']},'transaction':_0x37d0a0});});})['then'](function(){_0x2fbc12[_0xbc47('0x72')](function(_0x3d7f0a){socket[_0xbc47('0x73')](_0xbc47('0x74'),{'UserId':_0x3d7f0a['id'],'OpenchannelQueueId':_0x51098e['id']});});});});});}})[_0xbc47('0x28')](respondWithStatusCode(_0x1ab5ce,null))[_0xbc47('0x4b')](handleError(_0x1ab5ce,null));};exports['removeTeams']=function(_0x1e4d21,_0x2c4fd4,_0x12ba56){return db[_0xbc47('0x67')][_0xbc47('0x5e')]({'where':{'id':_0x1e4d21[_0xbc47('0x35')][_0xbc47('0x75')]},'attributes':['id'],'include':[{'model':db[_0xbc47('0x5f')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xbc47('0x28')](handleEntityNotFound(_0x2c4fd4,null))['then'](function(_0x42d199){var _0x5327f9=_[_0xbc47('0x43')](_0x42d199,'id');var _0x1ad3cd=[];var _0x41f9da=[];var _0x21f44b=squel[_0xbc47('0x76')]();_0x21f44b[_0xbc47('0x77')]('tq.TeamId')[_0xbc47('0x78')](_0xbc47('0x79'),'tq')[_0xbc47('0x7a')](_0xbc47('0x7b'),'ut',_0xbc47('0x7c'))[_0xbc47('0x3e')](_0xbc47('0x7d'),_0x1e4d21['params']['id']);for(var _0x4cb51b=0x0;_0x4cb51b<_0x42d199[_0xbc47('0x4d')];_0x4cb51b+=0x1){let _0x3d1335=_0x42d199[_0x4cb51b];for(var _0x594cfa=0x0;_0x594cfa<_0x3d1335[_0xbc47('0x69')][_0xbc47('0x4d')];_0x594cfa+=0x1){let _0x5cfc30=_0x3d1335[_0xbc47('0x69')][_0x594cfa];var _0x3f1124=_0x21f44b[_0xbc47('0x7e')]();_0x3f1124['where'](_0xbc47('0x7f'),_0x5cfc30['id']);_0x41f9da[_0xbc47('0x80')](db[_0xbc47('0x6d')][_0xbc47('0x35')](_0x3f1124[_0xbc47('0x81')](),{'type':db['sequelize'][_0xbc47('0x82')]['SELECT']})[_0xbc47('0x28')](function(_0xebd518){if(_0xebd518[_0xbc47('0x4d')]===0x1){return _0x5cfc30['id'];}else{var _0x30b0a5=_[_0xbc47('0x83')](_[_0xbc47('0x43')](_0xebd518,_0xbc47('0x84')),function(_0x3e0730){return _[_0xbc47('0x85')](_0x5327f9,_0x3e0730);});if(_0x30b0a5){return _0x5cfc30['id'];}}}));}}return BPromise[_0xbc47('0x86')](_0x41f9da)[_0xbc47('0x28')](function(_0x1c85d6){_0x1ad3cd=_(_0x1ad3cd)[_0xbc47('0x87')](_0x1c85d6)[_0xbc47('0x88')]()[_0xbc47('0x89')]();return db['OpenchannelQueue'][_0xbc47('0x4e')]({'where':{'id':_0x1e4d21[_0xbc47('0x58')]['id']}})[_0xbc47('0x28')](function(_0xb8e0d9){return db[_0xbc47('0x6d')][_0xbc47('0x6e')](function(_0x3f52a9){return _0xb8e0d9[_0xbc47('0x8a')](_0x1e4d21[_0xbc47('0x35')][_0xbc47('0x75')],{'transaction':_0x3f52a9})[_0xbc47('0x28')](function(){if(!_['isEmpty'](_0x1ad3cd)){return _0xb8e0d9[_0xbc47('0x8b')](_0x1ad3cd,{'transaction':_0x3f52a9});}})[_0xbc47('0x28')](function(){_0x1ad3cd['forEach'](function(_0x2711d1){socket['emit'](_0xbc47('0x8c'),{'UserId':_0x2711d1,'OpenchannelQueueId':_0xb8e0d9['id']});});});});});});})[_0xbc47('0x28')](respondWithStatusCode(_0x2c4fd4,null))[_0xbc47('0x4b')](handleError(_0x2c4fd4,null));};exports[_0xbc47('0x8d')]=function(_0xd5cc8c,_0x47e192,_0x6db539){return db[_0xbc47('0x47')][_0xbc47('0x4e')]({'where':{'id':_0xd5cc8c[_0xbc47('0x58')]['id']}})[_0xbc47('0x28')](handleEntityNotFound(_0x47e192,null))['then'](function(_0x212ff3){if(_0x212ff3){return _0x212ff3['addAgents'](_0xd5cc8c['body'][_0xbc47('0x75')],_['omit'](_0xd5cc8c[_0xbc47('0x57')],[_0xbc47('0x75'),'id'])||{})[_0xbc47('0x8e')](function(_0x2f4114){for(var _0x233654=0x0;_0x233654<_0xd5cc8c[_0xbc47('0x57')][_0xbc47('0x75')][_0xbc47('0x4d')];_0x233654+=0x1){socket[_0xbc47('0x73')](_0xbc47('0x74'),{'UserId':_0xd5cc8c['body'][_0xbc47('0x75')][_0x233654],'OpenchannelQueueId':_0xd5cc8c[_0xbc47('0x58')]['id']});}return _0x2f4114;});}})[_0xbc47('0x28')](respondWithResult(_0x47e192,null))[_0xbc47('0x4b')](handleError(_0x47e192,null));};exports[_0xbc47('0x8b')]=function(_0x534e87,_0x3f9c6f,_0x29d152){return db[_0xbc47('0x47')][_0xbc47('0x4e')]({'where':{'id':_0x534e87[_0xbc47('0x58')]['id']}})[_0xbc47('0x28')](handleEntityNotFound(_0x3f9c6f,null))['then'](function(_0x5d1516){if(_0x5d1516){return _0x5d1516[_0xbc47('0x8b')](_0x534e87[_0xbc47('0x35')][_0xbc47('0x75')])[_0xbc47('0x28')](function(){if(_[_0xbc47('0x8f')](_0x534e87['query'][_0xbc47('0x75')])){for(var _0x2d40fb=0x0;_0x2d40fb<_0x534e87[_0xbc47('0x35')][_0xbc47('0x75')]['length'];_0x2d40fb+=0x1){socket['emit'](_0xbc47('0x8c'),{'UserId':Number(_0x534e87['query']['ids'][_0x2d40fb]),'OpenchannelQueueId':Number(_0x534e87[_0xbc47('0x58')]['id'])});}}else{socket['emit'](_0xbc47('0x8c'),{'UserId':Number(_0x534e87[_0xbc47('0x35')][_0xbc47('0x75')]),'OpenchannelQueueId':Number(_0x534e87['params']['id'])});}});}})['then'](respondWithStatusCode(_0x3f9c6f,null))[_0xbc47('0x4b')](handleError(_0x3f9c6f,null));};exports[_0xbc47('0x90')]=function(_0x21e6f6,_0x3dacda,_0x5195cc){var _0xfda2eb={};var _0x1e5ec1={};var _0x142ec8;var _0x3c75c7;return db[_0xbc47('0x47')][_0xbc47('0x5b')]({'where':{'id':_0x21e6f6['params']['id']}})[_0xbc47('0x28')](handleEntityNotFound(_0x3dacda,null))[_0xbc47('0x28')](function(_0x22dfe6){if(_0x22dfe6){_0x142ec8=_0x22dfe6;_0x1e5ec1['model']=_[_0xbc47('0x34')](db[_0xbc47('0x5f')]['rawAttributes']);_0x1e5ec1['query']=_[_0xbc47('0x34')](_0x21e6f6[_0xbc47('0x35')]);_0x1e5ec1['filters']=_[_0xbc47('0x36')](_0x1e5ec1[_0xbc47('0x33')],_0x1e5ec1['query']);_0xfda2eb[_0xbc47('0x37')]=_[_0xbc47('0x36')](_0x1e5ec1['model'],qs[_0xbc47('0x38')](_0x21e6f6['query'][_0xbc47('0x38')]));_0xfda2eb[_0xbc47('0x37')]=_0xfda2eb['attributes'][_0xbc47('0x4d')]?_0xfda2eb[_0xbc47('0x37')]:_0x1e5ec1[_0xbc47('0x33')];_0xfda2eb[_0xbc47('0x3c')]=qs[_0xbc47('0x3d')](_0x21e6f6['query'][_0xbc47('0x3d')]);_0xfda2eb['where']=qs[_0xbc47('0x3f')](_[_0xbc47('0x40')](_0x21e6f6[_0xbc47('0x35')],_0x1e5ec1['filters']));if(_0x21e6f6['query'][_0xbc47('0x41')]){_0xfda2eb[_0xbc47('0x3e')]=_[_0xbc47('0x42')](_0xfda2eb[_0xbc47('0x3e')],{'$or':_[_0xbc47('0x43')](_0xfda2eb[_0xbc47('0x37')],function(_0xc1f45f){var _0x34f5f3={};_0x34f5f3[_0xc1f45f]={'$like':'%'+_0x21e6f6[_0xbc47('0x35')][_0xbc47('0x41')]+'%'};return _0x34f5f3;})});}_0xfda2eb=_['merge']({},_0xfda2eb,_0x21e6f6[_0xbc47('0x46')]);return _0x142ec8[_0xbc47('0x90')](_0xfda2eb);}})[_0xbc47('0x28')](function(_0x5b47fd){if(_0x5b47fd){_0x3c75c7=_0x5b47fd[_0xbc47('0x4d')];if(!_0x21e6f6['query'][_0xbc47('0x39')](_0xbc47('0x3a'))){_0xfda2eb[_0xbc47('0x3b')]=qs[_0xbc47('0x3b')](_0x21e6f6['query'][_0xbc47('0x3b')]);_0xfda2eb['offset']=qs[_0xbc47('0x22')](_0x21e6f6[_0xbc47('0x35')][_0xbc47('0x22')]);}return _0x142ec8[_0xbc47('0x90')](_0xfda2eb);}})[_0xbc47('0x28')](function(_0x1cf9ee){if(_0x1cf9ee){return _0x1cf9ee?{'count':_0x3c75c7,'rows':_0x1cf9ee}:null;}})[_0xbc47('0x28')](respondWithResult(_0x3dacda,null))['catch'](handleError(_0x3dacda,null));}; \ No newline at end of file +var _0x23e8=['to-csv','ejs','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','socket.io-emitter','redis','status','end','offset','set','Content-Range','json','apply','reject','save','then','get','OpenchannelQueues','UserProfileResource','sendStatus','name','send','index','OpenchannelQueue','keys','query','filters','intersection','model','attributes','fields','length','nolimit','limit','sort','where','pick','filter','map','merge','options','count','include','findAll','rows','catch','params','includeAll','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','destroy','describe','getMembers','findOne','UserOpenchannelQueue','rawAttributes','hasOwnProperty','order','User','findAndCountAll','UserId','agent','openchannelPause','updatedAt','createdAt','format','getTeams','Team','addTeams','ids','Agents','online','voicePause','interface','flatMap','sequelize','transaction','each','findOrCreate','forEach','emit','removeTeams','select','field','tq.TeamId','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','OpenchannelQueueId\x20=\x20?','push','toString','QueryTypes','SELECT','all','union','compact','value','removeAgents','addAgents','omit','spread','userOpenchannelQueue:save','isArray','userOpenchannelQueue:remove','getAgents','html-pdf','rimraf','bluebird','mustache','util','path'];(function(_0x448a30,_0x2d3095){var _0x1c3aa0=function(_0x4eed9b){while(--_0x4eed9b){_0x448a30['push'](_0x448a30['shift']());}};_0x1c3aa0(++_0x2d3095);}(_0x23e8,0x189));var _0x823e=function(_0x2ca08,_0x2f1078){_0x2ca08=_0x2ca08-0x0;var _0x471f76=_0x23e8[_0x2ca08];return _0x471f76;};'use strict';var pdf=require(_0x823e('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x823e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x823e('0x2'));var Mustache=require(_0x823e('0x3'));var util=require(_0x823e('0x4'));var path=require(_0x823e('0x5'));var sox=require('sox');var csv=require(_0x823e('0x6'));var ejs=require(_0x823e('0x7'));var fs=require('fs');var _=require(_0x823e('0x8'));var squel=require(_0x823e('0x9'));var crypto=require(_0x823e('0xa'));var jsforce=require(_0x823e('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x823e('0x6'));var querystring=require('querystring');var Papa=require(_0x823e('0xc'));var Redis=require(_0x823e('0xd'));var authService=require(_0x823e('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x823e('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x823e('0x10'))(_0x823e('0x11'));var utils=require(_0x823e('0x12'));var config=require(_0x823e('0x13'));var db=require(_0x823e('0x14'))['db'];config['redis']=_[_0x823e('0x15')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x823e('0x16'))(new Redis(config[_0x823e('0x17')]));require('./openchannelQueue.socket')['register'](socket);function respondWithStatusCode(_0x312834,_0x58643a){_0x58643a=_0x58643a||0xcc;return function(_0x13b6be){if(_0x13b6be){return _0x312834['sendStatus'](_0x58643a);}return _0x312834[_0x823e('0x18')](_0x58643a)[_0x823e('0x19')]();};}function respondWithResult(_0x20436a,_0x1e6362){_0x1e6362=_0x1e6362||0xc8;return function(_0x13165d){if(_0x13165d){return _0x20436a[_0x823e('0x18')](_0x1e6362)['json'](_0x13165d);}};}function respondWithFilteredResult(_0x18ff04,_0xef3dc9){return function(_0x272fd0){if(_0x272fd0){var _0xe14a11=_0x272fd0['count'],_0x3f5313=_0xef3dc9[_0x823e('0x1a')],_0x4b1075=_0xef3dc9['offset']+_0xef3dc9['limit'],_0x5419c3;if(_0x4b1075>=_0xe14a11){_0x4b1075=_0xe14a11;_0x5419c3=0xc8;}else{_0x5419c3=0xce;}_0x18ff04['status'](_0x5419c3);return _0x18ff04[_0x823e('0x1b')](_0x823e('0x1c'),_0x3f5313+'-'+_0x4b1075+'/'+_0xe14a11)[_0x823e('0x1d')](_0x272fd0);}return null;};}function patchUpdates(_0x391bf5){return function(_0x12993e){try{jsonpatch[_0x823e('0x1e')](_0x12993e,_0x391bf5,!![]);}catch(_0x4e2fd8){return BPromise[_0x823e('0x1f')](_0x4e2fd8);}return _0x12993e[_0x823e('0x20')]();};}function saveUpdates(_0x32a64c,_0x47ccc0){return function(_0xb02301){if(_0xb02301){return _0xb02301['update'](_0x32a64c)[_0x823e('0x21')](function(_0x2f5f64){return _0x2f5f64;});}return null;};}function removeEntity(_0x139caa,_0x1ac82e){return function(_0x44ffd5){if(_0x44ffd5){return _0x44ffd5['destroy']()[_0x823e('0x21')](function(){var _0x35c822=_0x44ffd5[_0x823e('0x22')]({'plain':!![]});var _0x4f3c15=_0x823e('0x23');return db[_0x823e('0x24')]['destroy']({'where':{'type':_0x4f3c15,'resourceId':_0x35c822['id']}})[_0x823e('0x21')](function(){return _0x44ffd5;});})[_0x823e('0x21')](function(){_0x139caa[_0x823e('0x18')](0xcc)[_0x823e('0x19')]();});}};}function handleEntityNotFound(_0x36d3f3,_0x1d5da6){return function(_0x30a9c7){if(!_0x30a9c7){_0x36d3f3[_0x823e('0x25')](0x194);}return _0x30a9c7;};}function handleError(_0x5798fc,_0x4eac84){_0x4eac84=_0x4eac84||0x1f4;return function(_0x37a7c9){logger['error'](_0x37a7c9['stack']);if(_0x37a7c9[_0x823e('0x26')]){delete _0x37a7c9[_0x823e('0x26')];}_0x5798fc['status'](_0x4eac84)[_0x823e('0x27')](_0x37a7c9);};}exports[_0x823e('0x28')]=function(_0x5de9e8,_0x281017){var _0x3645ab={},_0x10ee13={},_0x3a6f3b={'count':0x0,'rows':[]};var _0x2518f2=db[_0x823e('0x29')]['rawAttributes'];_0x10ee13['model']=_[_0x823e('0x2a')](_0x2518f2);_0x10ee13[_0x823e('0x2b')]=_[_0x823e('0x2a')](_0x5de9e8[_0x823e('0x2b')]);_0x10ee13[_0x823e('0x2c')]=_[_0x823e('0x2d')](_0x10ee13[_0x823e('0x2e')],_0x10ee13[_0x823e('0x2b')]);_0x3645ab[_0x823e('0x2f')]=_['intersection'](_0x10ee13[_0x823e('0x2e')],qs['fields'](_0x5de9e8['query'][_0x823e('0x30')]));_0x3645ab[_0x823e('0x2f')]=_0x3645ab['attributes'][_0x823e('0x31')]?_0x3645ab[_0x823e('0x2f')]:_0x10ee13[_0x823e('0x2e')];if(!_0x5de9e8[_0x823e('0x2b')]['hasOwnProperty'](_0x823e('0x32'))){_0x3645ab[_0x823e('0x33')]=qs[_0x823e('0x33')](_0x5de9e8[_0x823e('0x2b')][_0x823e('0x33')]);_0x3645ab[_0x823e('0x1a')]=qs[_0x823e('0x1a')](_0x5de9e8[_0x823e('0x2b')][_0x823e('0x1a')]);}_0x3645ab['order']=qs[_0x823e('0x34')](_0x5de9e8[_0x823e('0x2b')][_0x823e('0x34')]);_0x3645ab[_0x823e('0x35')]=qs[_0x823e('0x2c')](_[_0x823e('0x36')](_0x5de9e8[_0x823e('0x2b')],_0x10ee13[_0x823e('0x2c')]));if(_0x5de9e8[_0x823e('0x2b')][_0x823e('0x37')]){_0x3645ab[_0x823e('0x35')]=_['merge'](_0x3645ab[_0x823e('0x35')],{'$or':_[_0x823e('0x38')](_0x2518f2,function(_0x542d45){if(_0x542d45['type']['key']!=='VIRTUAL'){var _0xa75fed={};_0xa75fed[_0x542d45['field']]={'$like':'%'+_0x5de9e8[_0x823e('0x2b')]['filter']+'%'};return _0xa75fed;}})});}_0x3645ab=_[_0x823e('0x39')]({},_0x3645ab,_0x5de9e8[_0x823e('0x3a')]);var _0x133cab={'where':_0x3645ab[_0x823e('0x35')]};return db[_0x823e('0x29')]['count'](_0x133cab)[_0x823e('0x21')](function(_0x334c83){_0x3a6f3b[_0x823e('0x3b')]=_0x334c83;if(_0x5de9e8['query']['includeAll']){_0x3645ab[_0x823e('0x3c')]=[{'all':!![]}];}return db['OpenchannelQueue'][_0x823e('0x3d')](_0x3645ab);})['then'](function(_0x4c68a1){_0x3a6f3b[_0x823e('0x3e')]=_0x4c68a1;return _0x3a6f3b;})['then'](respondWithFilteredResult(_0x281017,_0x3645ab))[_0x823e('0x3f')](handleError(_0x281017,null));};exports['show']=function(_0x5c4869,_0x18eb1e){var _0x47474e={'raw':!![],'where':{'id':_0x5c4869[_0x823e('0x40')]['id']}},_0x1d2ca2={};_0x1d2ca2['model']=_['keys'](db[_0x823e('0x29')]['rawAttributes']);_0x1d2ca2[_0x823e('0x2b')]=_[_0x823e('0x2a')](_0x5c4869[_0x823e('0x2b')]);_0x1d2ca2[_0x823e('0x2c')]=_[_0x823e('0x2d')](_0x1d2ca2['model'],_0x1d2ca2[_0x823e('0x2b')]);_0x47474e[_0x823e('0x2f')]=_[_0x823e('0x2d')](_0x1d2ca2['model'],qs[_0x823e('0x30')](_0x5c4869[_0x823e('0x2b')][_0x823e('0x30')]));_0x47474e[_0x823e('0x2f')]=_0x47474e[_0x823e('0x2f')]['length']?_0x47474e[_0x823e('0x2f')]:_0x1d2ca2[_0x823e('0x2e')];if(_0x5c4869[_0x823e('0x2b')][_0x823e('0x41')]){_0x47474e[_0x823e('0x3c')]=[{'all':!![]}];}_0x47474e=_[_0x823e('0x39')]({},_0x47474e,_0x5c4869[_0x823e('0x3a')]);return db[_0x823e('0x29')][_0x823e('0x42')](_0x47474e)[_0x823e('0x21')](handleEntityNotFound(_0x18eb1e,null))[_0x823e('0x21')](respondWithResult(_0x18eb1e,null))[_0x823e('0x3f')](handleError(_0x18eb1e,null));};exports['create']=function(_0x485e5a,_0x571204){return db[_0x823e('0x29')][_0x823e('0x43')](_0x485e5a[_0x823e('0x44')],{})[_0x823e('0x21')](function(_0x695559){var _0x5bf7f6=_0x485e5a[_0x823e('0x45')][_0x823e('0x22')]({'plain':!![]});if(!_0x5bf7f6)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5bf7f6[_0x823e('0x46')]===_0x823e('0x45')){var _0x392343=_0x695559['get']({'plain':!![]});var _0x96d11b=_0x823e('0x23');return db[_0x823e('0x47')]['find']({'where':{'name':_0x96d11b,'userProfileId':_0x5bf7f6[_0x823e('0x48')]},'raw':!![]})[_0x823e('0x21')](function(_0xd4bd5e){if(_0xd4bd5e&&_0xd4bd5e[_0x823e('0x49')]===0x0){return db['UserProfileResource'][_0x823e('0x43')]({'name':_0x392343[_0x823e('0x26')],'resourceId':_0x392343['id'],'type':_0xd4bd5e[_0x823e('0x26')],'sectionId':_0xd4bd5e['id']},{})[_0x823e('0x21')](function(){return _0x695559;});}else{return _0x695559;}})[_0x823e('0x3f')](function(_0x32bbe2){logger[_0x823e('0x4a')](_0x823e('0x4b'),_0x32bbe2);throw _0x32bbe2;});}return _0x695559;})[_0x823e('0x21')](respondWithResult(_0x571204,0xc9))['catch'](handleError(_0x571204,null));};exports[_0x823e('0x4c')]=function(_0x260884,_0x8d0be4){if(_0x260884[_0x823e('0x44')]['id']){delete _0x260884[_0x823e('0x44')]['id'];}return db['OpenchannelQueue']['find']({'where':{'id':_0x260884['params']['id']}})[_0x823e('0x21')](handleEntityNotFound(_0x8d0be4,null))[_0x823e('0x21')](saveUpdates(_0x260884[_0x823e('0x44')],null))[_0x823e('0x21')](respondWithResult(_0x8d0be4,null))[_0x823e('0x3f')](handleError(_0x8d0be4,null));};exports[_0x823e('0x4d')]=function(_0x110f6d,_0x49c91e){return db[_0x823e('0x29')][_0x823e('0x42')]({'where':{'id':_0x110f6d[_0x823e('0x40')]['id']}})[_0x823e('0x21')](handleEntityNotFound(_0x49c91e,null))[_0x823e('0x21')](removeEntity(_0x49c91e,null))[_0x823e('0x3f')](handleError(_0x49c91e,null));};exports[_0x823e('0x4e')]=function(_0x1607fd,_0x4b887b){return db[_0x823e('0x29')][_0x823e('0x4e')]()[_0x823e('0x21')](respondWithResult(_0x4b887b,null))['catch'](handleError(_0x4b887b,null));};exports[_0x823e('0x4f')]=function(_0x4ec941,_0x8364c6,_0x48dfc2){var _0x316a98={'raw':!![],'where':{}},_0x4e8db3={},_0x562093;return db[_0x823e('0x29')][_0x823e('0x50')]({'where':{'id':_0x4ec941['params']['id']}})[_0x823e('0x21')](handleEntityNotFound(_0x8364c6,null))['then'](function(_0xcc3604){if(_0xcc3604){_0x562093=_0xcc3604[_0x823e('0x22')]({'plain':!![]});_0x4e8db3[_0x823e('0x2e')]=_[_0x823e('0x2a')](db[_0x823e('0x51')][_0x823e('0x52')]);_0x4e8db3[_0x823e('0x2b')]=_[_0x823e('0x2a')](_0x4ec941[_0x823e('0x2b')]);_0x4e8db3['filters']=_[_0x823e('0x2d')](_0x4e8db3[_0x823e('0x2e')],_0x4e8db3[_0x823e('0x2b')]);_0x316a98[_0x823e('0x2f')]=_['intersection'](_0x4e8db3['model'],qs[_0x823e('0x30')](_0x4ec941['query'][_0x823e('0x30')]));_0x316a98[_0x823e('0x2f')]=_0x316a98[_0x823e('0x2f')]['length']?_0x316a98['attributes']:_0x4e8db3[_0x823e('0x2e')];if(!_0x4ec941[_0x823e('0x2b')][_0x823e('0x53')](_0x823e('0x32'))){_0x316a98['limit']=qs[_0x823e('0x33')](_0x4ec941[_0x823e('0x2b')][_0x823e('0x33')]);_0x316a98[_0x823e('0x1a')]=qs[_0x823e('0x1a')](_0x4ec941['query'][_0x823e('0x1a')]);}_0x316a98[_0x823e('0x54')]=qs[_0x823e('0x34')](_0x4ec941[_0x823e('0x2b')][_0x823e('0x34')]);_0x316a98['where']=qs[_0x823e('0x2c')](_[_0x823e('0x36')](_0x4ec941[_0x823e('0x2b')],_0x4e8db3[_0x823e('0x2c')]));_0x316a98[_0x823e('0x35')]['OpenchannelQueueId']=_0xcc3604['id'];if(_0x4ec941[_0x823e('0x2b')][_0x823e('0x37')]){_0x316a98['where']=_[_0x823e('0x39')](_0x316a98[_0x823e('0x35')],{'$or':_[_0x823e('0x38')](_0x316a98[_0x823e('0x2f')],function(_0x2072c9){var _0x3d029d={};_0x3d029d[_0x2072c9]={'$like':'%'+_0x4ec941['query'][_0x823e('0x37')]+'%'};return _0x3d029d;})});}_0x316a98=_[_0x823e('0x39')]({},_0x316a98,_0x4ec941[_0x823e('0x3a')]);return db['UserOpenchannelQueue'][_0x823e('0x3d')](_0x316a98);}})[_0x823e('0x21')](function(_0x42536c){if(_0x42536c){return db[_0x823e('0x55')][_0x823e('0x56')]({'where':{'id':_[_0x823e('0x38')](_0x42536c,_0x823e('0x57')),'role':_0x823e('0x58')},'attributes':['id',_0x823e('0x26'),_0x823e('0x59'),_0x823e('0x5a'),_0x823e('0x5b')]});}})[_0x823e('0x21')](function(_0xa4abfc){if(_0xa4abfc){return{'count':_0xa4abfc[_0x823e('0x3b')],'rows':_[_0x823e('0x38')](_0xa4abfc[_0x823e('0x3e')],function(_0x5f0ef0){return{'membername':_0x5f0ef0[_0x823e('0x26')],'UserId':_0x5f0ef0['id'],'queue_name':_0x562093[_0x823e('0x26')],'OpenchannelQueueId':_0x562093['id'],'interface':util[_0x823e('0x5c')]('%s/%s','SIP',_0x5f0ef0[_0x823e('0x26')]),'penalty':0x0,'paused':_0x5f0ef0[_0x823e('0x59')],'createdAt':_0x5f0ef0[_0x823e('0x5b')],'updatedAt':_0x5f0ef0['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x823e('0x21')](respondWithFilteredResult(_0x8364c6,_0x316a98))[_0x823e('0x3f')](handleError(_0x8364c6,null));};exports[_0x823e('0x5d')]=function(_0x39a1f8,_0x1f2934,_0x530256){var _0x58a370={};var _0x3b4ebf={};var _0x4b1f1e;var _0xda64b3;return db[_0x823e('0x29')][_0x823e('0x50')]({'where':{'id':_0x39a1f8['params']['id']}})[_0x823e('0x21')](handleEntityNotFound(_0x1f2934,null))[_0x823e('0x21')](function(_0x3e8cc6){if(_0x3e8cc6){_0x4b1f1e=_0x3e8cc6;_0x3b4ebf[_0x823e('0x2e')]=_['keys'](db[_0x823e('0x5e')][_0x823e('0x52')]);_0x3b4ebf[_0x823e('0x2b')]=_[_0x823e('0x2a')](_0x39a1f8['query']);_0x3b4ebf[_0x823e('0x2c')]=_['intersection'](_0x3b4ebf['model'],_0x3b4ebf['query']);_0x58a370[_0x823e('0x2f')]=_[_0x823e('0x2d')](_0x3b4ebf[_0x823e('0x2e')],qs['fields'](_0x39a1f8[_0x823e('0x2b')][_0x823e('0x30')]));_0x58a370[_0x823e('0x2f')]=_0x58a370[_0x823e('0x2f')][_0x823e('0x31')]?_0x58a370[_0x823e('0x2f')]:_0x3b4ebf['model'];_0x58a370[_0x823e('0x54')]=qs[_0x823e('0x34')](_0x39a1f8[_0x823e('0x2b')][_0x823e('0x34')]);_0x58a370[_0x823e('0x35')]=qs[_0x823e('0x2c')](_[_0x823e('0x36')](_0x39a1f8[_0x823e('0x2b')],_0x3b4ebf[_0x823e('0x2c')]));if(_0x39a1f8[_0x823e('0x2b')]['filter']){_0x58a370[_0x823e('0x35')]=_[_0x823e('0x39')](_0x58a370['where'],{'$or':_[_0x823e('0x38')](_0x58a370[_0x823e('0x2f')],function(_0x1a34fd){var _0x2a8946={};_0x2a8946[_0x1a34fd]={'$like':'%'+_0x39a1f8['query'][_0x823e('0x37')]+'%'};return _0x2a8946;})});}_0x58a370=_[_0x823e('0x39')]({},_0x58a370,_0x39a1f8[_0x823e('0x3a')]);return _0x4b1f1e[_0x823e('0x5d')](_0x58a370);}})[_0x823e('0x21')](function(_0x3dd313){if(_0x3dd313){_0xda64b3=_0x3dd313[_0x823e('0x31')];if(!_0x39a1f8['query'][_0x823e('0x53')](_0x823e('0x32'))){_0x58a370[_0x823e('0x33')]=qs[_0x823e('0x33')](_0x39a1f8[_0x823e('0x2b')]['limit']);_0x58a370['offset']=qs['offset'](_0x39a1f8[_0x823e('0x2b')][_0x823e('0x1a')]);}return _0x4b1f1e[_0x823e('0x5d')](_0x58a370);}})[_0x823e('0x21')](function(_0x5b7eba){if(_0x5b7eba){return _0x5b7eba?{'count':_0xda64b3,'rows':_0x5b7eba}:null;}})[_0x823e('0x21')](respondWithResult(_0x1f2934,null))[_0x823e('0x3f')](handleError(_0x1f2934,null));};exports[_0x823e('0x5f')]=function(_0x33681f,_0x21813d,_0x55b65a){var _0xbd6b79=_0x33681f['body'][_0x823e('0x60')];return db[_0x823e('0x5e')][_0x823e('0x3d')]({'where':{'id':_0xbd6b79},'attributes':['id'],'include':[{'model':db[_0x823e('0x55')],'as':_0x823e('0x61'),'attributes':['id',_0x823e('0x26'),_0x823e('0x62'),_0x823e('0x63'),_0x823e('0x64')],'raw':!![]}]})[_0x823e('0x21')](function(_0x8f9f6a){if(_0x8f9f6a){var _0x1fd04f=_[_0x823e('0x65')](_0x8f9f6a,function(_0x2694cc){var _0x4b2f48=_0x2694cc[_0x823e('0x22')]({'plain':!![]});return _0x4b2f48[_0x823e('0x61')];});return db[_0x823e('0x29')][_0x823e('0x42')]({'where':{'id':_0x33681f[_0x823e('0x40')]['id']}})[_0x823e('0x21')](function(_0x3af6f5){return db[_0x823e('0x66')][_0x823e('0x67')](function(_0x5a9734){return _0x3af6f5['addTeams'](_0xbd6b79,{'transaction':_0x5a9734})['then'](function(){return BPromise[_0x823e('0x68')](_0x1fd04f,function(_0x4279e2){return db['UserOpenchannelQueue'][_0x823e('0x69')]({'where':{'UserId':_0x4279e2['id'],'OpenchannelQueueId':_0x33681f[_0x823e('0x40')]['id']},'transaction':_0x5a9734});});})[_0x823e('0x21')](function(){_0x1fd04f[_0x823e('0x6a')](function(_0xc6da64){socket[_0x823e('0x6b')]('userOpenchannelQueue:save',{'UserId':_0xc6da64['id'],'OpenchannelQueueId':_0x3af6f5['id']});});});});});}})[_0x823e('0x21')](respondWithStatusCode(_0x21813d,null))[_0x823e('0x3f')](handleError(_0x21813d,null));};exports[_0x823e('0x6c')]=function(_0xe52441,_0x2ac323,_0x34b931){return db['Team'][_0x823e('0x3d')]({'where':{'id':_0xe52441[_0x823e('0x2b')]['ids']},'attributes':['id'],'include':[{'model':db[_0x823e('0x55')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x823e('0x21')](handleEntityNotFound(_0x2ac323,null))[_0x823e('0x21')](function(_0x1030bc){var _0x2191ad=_[_0x823e('0x38')](_0x1030bc,'id');var _0x4bf697=[];var _0x4c9648=[];var _0x4b4347=squel[_0x823e('0x6d')]();_0x4b4347[_0x823e('0x6e')](_0x823e('0x6f'))[_0x823e('0x70')]('team_has_openchannel_queues','tq')[_0x823e('0x71')](_0x823e('0x72'),'ut',_0x823e('0x73'))['where'](_0x823e('0x74'),_0xe52441[_0x823e('0x40')]['id']);for(var _0x4d9616=0x0;_0x4d9616<_0x1030bc[_0x823e('0x31')];_0x4d9616+=0x1){let _0x5b0c28=_0x1030bc[_0x4d9616];for(var _0x3d770d=0x0;_0x3d770d<_0x5b0c28[_0x823e('0x61')][_0x823e('0x31')];_0x3d770d+=0x1){let _0x4a90bf=_0x5b0c28[_0x823e('0x61')][_0x3d770d];var _0x1ee065=_0x4b4347['clone']();_0x1ee065[_0x823e('0x35')]('ut.UserId\x20=\x20?',_0x4a90bf['id']);_0x4c9648[_0x823e('0x75')](db[_0x823e('0x66')][_0x823e('0x2b')](_0x1ee065[_0x823e('0x76')](),{'type':db[_0x823e('0x66')][_0x823e('0x77')][_0x823e('0x78')]})['then'](function(_0x4f11c9){if(_0x4f11c9[_0x823e('0x31')]===0x1){return _0x4a90bf['id'];}else{var _0x4c5555=_['every'](_[_0x823e('0x38')](_0x4f11c9,'TeamId'),function(_0x358fab){return _['includes'](_0x2191ad,_0x358fab);});if(_0x4c5555){return _0x4a90bf['id'];}}}));}}return BPromise[_0x823e('0x79')](_0x4c9648)[_0x823e('0x21')](function(_0x573ac1){_0x4bf697=_(_0x4bf697)[_0x823e('0x7a')](_0x573ac1)[_0x823e('0x7b')]()[_0x823e('0x7c')]();return db[_0x823e('0x29')][_0x823e('0x42')]({'where':{'id':_0xe52441[_0x823e('0x40')]['id']}})[_0x823e('0x21')](function(_0x39cc32){return db['sequelize'][_0x823e('0x67')](function(_0x83b425){return _0x39cc32[_0x823e('0x6c')](_0xe52441['query'][_0x823e('0x60')],{'transaction':_0x83b425})[_0x823e('0x21')](function(){if(!_['isEmpty'](_0x4bf697)){return _0x39cc32[_0x823e('0x7d')](_0x4bf697,{'transaction':_0x83b425});}})[_0x823e('0x21')](function(){_0x4bf697[_0x823e('0x6a')](function(_0x281d4a){socket['emit']('userOpenchannelQueue:remove',{'UserId':_0x281d4a,'OpenchannelQueueId':_0x39cc32['id']});});});});});});})['then'](respondWithStatusCode(_0x2ac323,null))['catch'](handleError(_0x2ac323,null));};exports[_0x823e('0x7e')]=function(_0x51e124,_0x26e062,_0x4975eb){return db[_0x823e('0x29')][_0x823e('0x42')]({'where':{'id':_0x51e124['params']['id']}})[_0x823e('0x21')](handleEntityNotFound(_0x26e062,null))[_0x823e('0x21')](function(_0x1251a7){if(_0x1251a7){return _0x1251a7[_0x823e('0x7e')](_0x51e124[_0x823e('0x44')][_0x823e('0x60')],_[_0x823e('0x7f')](_0x51e124[_0x823e('0x44')],[_0x823e('0x60'),'id'])||{})[_0x823e('0x80')](function(_0x2e684b){for(var _0x5e7358=0x0;_0x5e7358<_0x51e124[_0x823e('0x44')][_0x823e('0x60')][_0x823e('0x31')];_0x5e7358+=0x1){socket['emit'](_0x823e('0x81'),{'UserId':_0x51e124[_0x823e('0x44')][_0x823e('0x60')][_0x5e7358],'OpenchannelQueueId':_0x51e124['params']['id']});}return _0x2e684b;});}})[_0x823e('0x21')](respondWithResult(_0x26e062,null))['catch'](handleError(_0x26e062,null));};exports[_0x823e('0x7d')]=function(_0x5384cd,_0x86a116,_0x9ae683){return db['OpenchannelQueue'][_0x823e('0x42')]({'where':{'id':_0x5384cd['params']['id']}})[_0x823e('0x21')](handleEntityNotFound(_0x86a116,null))[_0x823e('0x21')](function(_0x22c7e8){if(_0x22c7e8){return _0x22c7e8[_0x823e('0x7d')](_0x5384cd[_0x823e('0x2b')][_0x823e('0x60')])[_0x823e('0x21')](function(){if(_[_0x823e('0x82')](_0x5384cd[_0x823e('0x2b')][_0x823e('0x60')])){for(var _0x1647a9=0x0;_0x1647a9<_0x5384cd[_0x823e('0x2b')][_0x823e('0x60')][_0x823e('0x31')];_0x1647a9+=0x1){socket[_0x823e('0x6b')](_0x823e('0x83'),{'UserId':Number(_0x5384cd[_0x823e('0x2b')][_0x823e('0x60')][_0x1647a9]),'OpenchannelQueueId':Number(_0x5384cd[_0x823e('0x40')]['id'])});}}else{socket['emit'](_0x823e('0x83'),{'UserId':Number(_0x5384cd['query'][_0x823e('0x60')]),'OpenchannelQueueId':Number(_0x5384cd[_0x823e('0x40')]['id'])});}});}})[_0x823e('0x21')](respondWithStatusCode(_0x86a116,null))[_0x823e('0x3f')](handleError(_0x86a116,null));};exports[_0x823e('0x84')]=function(_0x2fd65a,_0x3d501a,_0x59b417){var _0x50c9b9={};var _0x4869ae={};var _0x50d501;var _0x472bc8;return db[_0x823e('0x29')][_0x823e('0x50')]({'where':{'id':_0x2fd65a[_0x823e('0x40')]['id']}})[_0x823e('0x21')](handleEntityNotFound(_0x3d501a,null))[_0x823e('0x21')](function(_0x172310){if(_0x172310){_0x50d501=_0x172310;_0x4869ae['model']=_[_0x823e('0x2a')](db[_0x823e('0x55')][_0x823e('0x52')]);_0x4869ae[_0x823e('0x2b')]=_[_0x823e('0x2a')](_0x2fd65a[_0x823e('0x2b')]);_0x4869ae[_0x823e('0x2c')]=_[_0x823e('0x2d')](_0x4869ae[_0x823e('0x2e')],_0x4869ae[_0x823e('0x2b')]);_0x50c9b9[_0x823e('0x2f')]=_[_0x823e('0x2d')](_0x4869ae['model'],qs[_0x823e('0x30')](_0x2fd65a[_0x823e('0x2b')][_0x823e('0x30')]));_0x50c9b9['attributes']=_0x50c9b9[_0x823e('0x2f')][_0x823e('0x31')]?_0x50c9b9['attributes']:_0x4869ae[_0x823e('0x2e')];_0x50c9b9[_0x823e('0x54')]=qs[_0x823e('0x34')](_0x2fd65a[_0x823e('0x2b')][_0x823e('0x34')]);_0x50c9b9[_0x823e('0x35')]=qs[_0x823e('0x2c')](_['pick'](_0x2fd65a[_0x823e('0x2b')],_0x4869ae[_0x823e('0x2c')]));if(_0x2fd65a[_0x823e('0x2b')][_0x823e('0x37')]){_0x50c9b9[_0x823e('0x35')]=_['merge'](_0x50c9b9[_0x823e('0x35')],{'$or':_[_0x823e('0x38')](_0x50c9b9[_0x823e('0x2f')],function(_0x15e728){var _0xbef0c={};_0xbef0c[_0x15e728]={'$like':'%'+_0x2fd65a[_0x823e('0x2b')][_0x823e('0x37')]+'%'};return _0xbef0c;})});}_0x50c9b9=_[_0x823e('0x39')]({},_0x50c9b9,_0x2fd65a['options']);return _0x50d501['getAgents'](_0x50c9b9);}})[_0x823e('0x21')](function(_0x5d03e6){if(_0x5d03e6){_0x472bc8=_0x5d03e6[_0x823e('0x31')];if(!_0x2fd65a[_0x823e('0x2b')][_0x823e('0x53')]('nolimit')){_0x50c9b9[_0x823e('0x33')]=qs[_0x823e('0x33')](_0x2fd65a[_0x823e('0x2b')]['limit']);_0x50c9b9[_0x823e('0x1a')]=qs[_0x823e('0x1a')](_0x2fd65a[_0x823e('0x2b')]['offset']);}return _0x50d501['getAgents'](_0x50c9b9);}})[_0x823e('0x21')](function(_0x4e8210){if(_0x4e8210){return _0x4e8210?{'count':_0x472bc8,'rows':_0x4e8210}:null;}})[_0x823e('0x21')](respondWithResult(_0x3d501a,null))[_0x823e('0x3f')](handleError(_0x3d501a,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.events.js b/server/api/openchannelQueue/openchannelQueue.events.js index 8c043e8..b35bf6a 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 _0x1261=['update','remove','hasOwnProperty','hook','../../mysqldb','OpenchannelQueue','setMaxListeners','save'];(function(_0x47bf54,_0x327a53){var _0x2b75bc=function(_0x4dbcd){while(--_0x4dbcd){_0x47bf54['push'](_0x47bf54['shift']());}};_0x2b75bc(++_0x327a53);}(_0x1261,0x144));var _0x1126=function(_0x38a045,_0x402d6b){_0x38a045=_0x38a045-0x0;var _0x45c34c=_0x1261[_0x38a045];return _0x45c34c;};'use strict';var EventEmitter=require('events');var OpenchannelQueue=require(_0x1126('0x0'))['db'][_0x1126('0x1')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0x1126('0x2')](0x0);var events={'afterCreate':_0x1126('0x3'),'afterUpdate':_0x1126('0x4'),'afterDestroy':_0x1126('0x5')};function emitEvent(_0x3cc93f){return function(_0x4245ca,_0x21a480,_0x75a851){OpenchannelQueueEvents['emit'](_0x3cc93f+':'+_0x4245ca['id'],_0x4245ca);OpenchannelQueueEvents['emit'](_0x3cc93f,_0x4245ca);_0x75a851(null);};}for(var e in events){if(events[_0x1126('0x6')](e)){var event=events[e];OpenchannelQueue[_0x1126('0x7')](e,emitEvent(event));}}module['exports']=OpenchannelQueueEvents; \ No newline at end of file +var _0x84e7=['emit','hook','../../mysqldb','OpenchannelQueue','save','update'];(function(_0x267a0d,_0x4c9d1a){var _0x38b7c7=function(_0x4c0bc9){while(--_0x4c0bc9){_0x267a0d['push'](_0x267a0d['shift']());}};_0x38b7c7(++_0x4c9d1a);}(_0x84e7,0x122));var _0x784e=function(_0x184c68,_0x12c95b){_0x184c68=_0x184c68-0x0;var _0x3ff59b=_0x84e7[_0x184c68];return _0x3ff59b;};'use strict';var EventEmitter=require('events');var OpenchannelQueue=require(_0x784e('0x0'))['db'][_0x784e('0x1')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x784e('0x2'),'afterUpdate':_0x784e('0x3'),'afterDestroy':'remove'};function emitEvent(_0x45e3ad){return function(_0x14cee2,_0x205619,_0xdc7692){OpenchannelQueueEvents[_0x784e('0x4')](_0x45e3ad+':'+_0x14cee2['id'],_0x14cee2);OpenchannelQueueEvents[_0x784e('0x4')](_0x45e3ad,_0x14cee2);_0xdc7692(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelQueue[_0x784e('0x5')](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 64036df..6dd47ac 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 _0x28f3=['../../config/environment','./openchannelQueue.attributes','define','OpenchannelQueue','lodash','util','api','moment','bluebird'];(function(_0x1c7c26,_0x44f62c){var _0x117e6d=function(_0x484bfa){while(--_0x484bfa){_0x1c7c26['push'](_0x1c7c26['shift']());}};_0x117e6d(++_0x44f62c);}(_0x28f3,0x9d));var _0x328f=function(_0x723017,_0x3b3fce){_0x723017=_0x723017-0x0;var _0x43d505=_0x28f3[_0x723017];return _0x43d505;};'use strict';var _=require(_0x328f('0x0'));var util=require(_0x328f('0x1'));var logger=require('../../config/logger')(_0x328f('0x2'));var moment=require(_0x328f('0x3'));var BPromise=require(_0x328f('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x328f('0x5'));var attributes=require(_0x328f('0x6'));module['exports']=function(_0x2d2d2a,_0x41e70d){return _0x2d2d2a[_0x328f('0x7')](_0x328f('0x8'),attributes,{'tableName':'openchannel_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x31dc=['openchannel_queues','lodash','util','api','bluebird','request-promise','rimraf','exports','define'];(function(_0x16eb58,_0x42d4ed){var _0xf55c1a=function(_0x58d081){while(--_0x58d081){_0x16eb58['push'](_0x16eb58['shift']());}};_0xf55c1a(++_0x42d4ed);}(_0x31dc,0x10f));var _0xc31d=function(_0x2f479f,_0x5f1642){_0x2f479f=_0x2f479f-0x0;var _0x4fd46b=_0x31dc[_0x2f479f];return _0x4fd46b;};'use strict';var _=require(_0xc31d('0x0'));var util=require(_0xc31d('0x1'));var logger=require('../../config/logger')(_0xc31d('0x2'));var moment=require('moment');var BPromise=require(_0xc31d('0x3'));var rp=require(_0xc31d('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc31d('0x5'));var config=require('../../config/environment');var attributes=require('./openchannelQueue.attributes');module[_0xc31d('0x6')]=function(_0x137d55,_0x3bbc30){return _0x137d55[_0xc31d('0x7')]('OpenchannelQueue',attributes,{'tableName':_0xc31d('0x8'),'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 7931cee..d2a5cb0 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 _0x6970=['OpenchannelQueue','find','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./openchannelQueue.socket','register','request','info','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','OpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','options','raw','where','attributes','limit','include','map','model','then','GetOpenchannelQueue','debug','ShowOpenchannelQueue'];(function(_0x27d0d8,_0x2b657d){var _0x2b79d1=function(_0x249ec1){while(--_0x249ec1){_0x27d0d8['push'](_0x27d0d8['shift']());}};_0x2b79d1(++_0x2b657d);}(_0x6970,0x7d));var _0x0697=function(_0x458f09,_0x497d50){_0x458f09=_0x458f09-0x0;var _0x2d7a13=_0x6970[_0x458f09];return _0x2d7a13;};'use strict';var _=require(_0x0697('0x0'));var util=require(_0x0697('0x1'));var moment=require(_0x0697('0x2'));var BPromise=require(_0x0697('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0697('0x4'));var db=require(_0x0697('0x5'))['db'];var utils=require(_0x0697('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x0697('0x7'));var jayson=require(_0x0697('0x8'));var client=jayson[_0x0697('0x9')][_0x0697('0xa')]({'port':0x232a});config[_0x0697('0xb')]=_[_0x0697('0xc')](config[_0x0697('0xb')],{'host':_0x0697('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0697('0xb')]));require(_0x0697('0xe'))[_0x0697('0xf')](socket);function respondWithRpcPromise(_0x1cc186,_0x349f33,_0x1837e9){return new BPromise(function(_0x48640a,_0x4585d5){return client[_0x0697('0x10')](_0x1cc186,_0x1837e9)['then'](function(_0x5b42c8){logger[_0x0697('0x11')](_0x0697('0x12'),_0x349f33,_0x0697('0x13'));logger['debug'](_0x0697('0x14'),_0x349f33,_0x0697('0x13'),JSON[_0x0697('0x15')](_0x5b42c8));if(_0x5b42c8[_0x0697('0x16')]){if(_0x5b42c8['error'][_0x0697('0x17')]===0x1f4){logger[_0x0697('0x16')](_0x0697('0x12'),_0x349f33,_0x5b42c8[_0x0697('0x16')][_0x0697('0x18')]);return _0x4585d5(_0x5b42c8[_0x0697('0x16')][_0x0697('0x18')]);}logger['error'](_0x0697('0x12'),_0x349f33,_0x5b42c8[_0x0697('0x16')][_0x0697('0x18')]);return _0x48640a(_0x5b42c8['error'][_0x0697('0x18')]);}else{logger[_0x0697('0x11')](_0x0697('0x12'),_0x349f33,_0x0697('0x13'));_0x48640a(_0x5b42c8[_0x0697('0x19')][_0x0697('0x18')]);}})[_0x0697('0x1a')](function(_0x1600ff){logger[_0x0697('0x16')]('OpenchannelQueue,\x20%s,\x20%s',_0x349f33,_0x1600ff);_0x4585d5(_0x1600ff);});});}exports['GetOpenchannelQueue']=function(_0xadedd3){var _0x51f527=this;return new Promise(function(_0x41ee5d,_0x13e730){return db['OpenchannelQueue']['findAll']({'raw':_0xadedd3[_0x0697('0x1b')]?_0xadedd3[_0x0697('0x1b')][_0x0697('0x1c')]===undefined?!![]:![]:!![],'where':_0xadedd3[_0x0697('0x1b')]?_0xadedd3[_0x0697('0x1b')][_0x0697('0x1d')]||null:null,'attributes':_0xadedd3[_0x0697('0x1b')]?_0xadedd3[_0x0697('0x1b')][_0x0697('0x1e')]||null:null,'limit':_0xadedd3['options']?_0xadedd3[_0x0697('0x1b')][_0x0697('0x1f')]||null:null,'include':_0xadedd3[_0x0697('0x1b')]?_0xadedd3[_0x0697('0x1b')][_0x0697('0x20')]?_[_0x0697('0x21')](_0xadedd3[_0x0697('0x1b')][_0x0697('0x20')],function(_0x1f102a){return{'model':db[_0x1f102a['model']],'as':_0x1f102a['as'],'attributes':_0x1f102a['attributes'],'include':_0x1f102a[_0x0697('0x20')]?_[_0x0697('0x21')](_0x1f102a[_0x0697('0x20')],function(_0x1a8a65){return{'model':db[_0x1a8a65['model']],'as':_0x1a8a65['as'],'attributes':_0x1a8a65[_0x0697('0x1e')],'include':_0x1a8a65[_0x0697('0x20')]?_[_0x0697('0x21')](_0x1a8a65[_0x0697('0x20')],function(_0xe732c1){return{'model':db[_0xe732c1[_0x0697('0x22')]],'as':_0xe732c1['as'],'attributes':_0xe732c1['attributes']};}):[]};}):[]};}):[]:[]})[_0x0697('0x23')](function(_0x4ad364){logger['info'](_0x0697('0x24'),_0xadedd3);logger[_0x0697('0x25')](_0x0697('0x24'),_0xadedd3,JSON['stringify'](_0x4ad364));_0x41ee5d(_0x4ad364);})['catch'](function(_0x12c118){logger['error'](_0x0697('0x24'),_0x12c118[_0x0697('0x18')],_0xadedd3);_0x13e730(_0x51f527[_0x0697('0x16')](0x1f4,_0x12c118[_0x0697('0x18')]));});});};exports[_0x0697('0x26')]=function(_0xf18e03){var _0x1247c1=this;return new Promise(function(_0x3c4148,_0xe2fa50){return db[_0x0697('0x27')][_0x0697('0x28')]({'raw':_0xf18e03[_0x0697('0x1b')]?_0xf18e03[_0x0697('0x1b')][_0x0697('0x1c')]===undefined?!![]:![]:!![],'where':_0xf18e03[_0x0697('0x1b')]?_0xf18e03[_0x0697('0x1b')][_0x0697('0x1d')]||null:null,'attributes':_0xf18e03[_0x0697('0x1b')]?_0xf18e03[_0x0697('0x1b')][_0x0697('0x1e')]||null:null,'include':_0xf18e03['options']?_0xf18e03[_0x0697('0x1b')][_0x0697('0x20')]?_['map'](_0xf18e03[_0x0697('0x1b')][_0x0697('0x20')],function(_0x348e90){return{'model':db[_0x348e90[_0x0697('0x22')]],'as':_0x348e90['as'],'attributes':_0x348e90[_0x0697('0x1e')],'include':_0x348e90['include']?_[_0x0697('0x21')](_0x348e90['include'],function(_0xe35f98){return{'model':db[_0xe35f98['model']],'as':_0xe35f98['as'],'attributes':_0xe35f98[_0x0697('0x1e')],'include':_0xe35f98[_0x0697('0x20')]?_[_0x0697('0x21')](_0xe35f98['include'],function(_0x4dfc48){return{'model':db[_0x4dfc48['model']],'as':_0x4dfc48['as'],'attributes':_0x4dfc48[_0x0697('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x308c4a){logger[_0x0697('0x11')]('ShowOpenchannelQueue',_0xf18e03);logger[_0x0697('0x25')](_0x0697('0x26'),_0xf18e03,JSON[_0x0697('0x15')](_0x308c4a));_0x3c4148(_0x308c4a);})['catch'](function(_0x2d36fa){logger['error'](_0x0697('0x26'),_0x2d36fa[_0x0697('0x18')],_0xf18e03);_0xe2fa50(_0x1247c1[_0x0697('0x16')](0x1f4,_0x2d36fa[_0x0697('0x18')]));});});}; \ No newline at end of file +var _0xbb07=['include','model','map','catch','ShowOpenchannelQueue','find','lodash','bluebird','randomstring','ioredis','rpc','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./openchannelQueue.socket','register','request','then','request\x20sent','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','OpenchannelQueue,\x20%s,\x20%s','message','info','result','GetOpenchannelQueue','OpenchannelQueue','findAll','options','where','attributes','limit'];(function(_0x245208,_0x5ed2c6){var _0x5187dc=function(_0x3aa563){while(--_0x3aa563){_0x245208['push'](_0x245208['shift']());}};_0x5187dc(++_0x5ed2c6);}(_0xbb07,0x136));var _0x7bb0=function(_0x413f84,_0x41f611){_0x413f84=_0x413f84-0x0;var _0x9f10ac=_0xbb07[_0x413f84];return _0x9f10ac;};'use strict';var _=require(_0x7bb0('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x7bb0('0x1'));var rs=require(_0x7bb0('0x2'));var fs=require('fs');var Redis=require(_0x7bb0('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x7bb0('0x4'));var config=require('../../config/environment');var jayson=require(_0x7bb0('0x5'));var client=jayson['client'][_0x7bb0('0x6')]({'port':0x232a});config[_0x7bb0('0x7')]=_[_0x7bb0('0x8')](config[_0x7bb0('0x7')],{'host':_0x7bb0('0x9'),'port':0x18eb});var socket=require(_0x7bb0('0xa'))(new Redis(config['redis']));require(_0x7bb0('0xb'))[_0x7bb0('0xc')](socket);function respondWithRpcPromise(_0x35b2ed,_0x574a77,_0x160b87){return new BPromise(function(_0x139647,_0x3f54a1){return client[_0x7bb0('0xd')](_0x35b2ed,_0x160b87)[_0x7bb0('0xe')](function(_0x2cbc12){logger['info']('OpenchannelQueue,\x20%s,\x20%s',_0x574a77,_0x7bb0('0xf'));logger[_0x7bb0('0x10')](_0x7bb0('0x11'),_0x574a77,'request\x20sent',JSON[_0x7bb0('0x12')](_0x2cbc12));if(_0x2cbc12[_0x7bb0('0x13')]){if(_0x2cbc12['error'][_0x7bb0('0x14')]===0x1f4){logger[_0x7bb0('0x13')](_0x7bb0('0x15'),_0x574a77,_0x2cbc12[_0x7bb0('0x13')]['message']);return _0x3f54a1(_0x2cbc12[_0x7bb0('0x13')][_0x7bb0('0x16')]);}logger['error'](_0x7bb0('0x15'),_0x574a77,_0x2cbc12[_0x7bb0('0x13')][_0x7bb0('0x16')]);return _0x139647(_0x2cbc12[_0x7bb0('0x13')][_0x7bb0('0x16')]);}else{logger[_0x7bb0('0x17')](_0x7bb0('0x15'),_0x574a77,_0x7bb0('0xf'));_0x139647(_0x2cbc12[_0x7bb0('0x18')][_0x7bb0('0x16')]);}})['catch'](function(_0x680bae){logger[_0x7bb0('0x13')](_0x7bb0('0x15'),_0x574a77,_0x680bae);_0x3f54a1(_0x680bae);});});}exports[_0x7bb0('0x19')]=function(_0x18b944){var _0xe46097=this;return new Promise(function(_0x205a4f,_0x917fd3){return db[_0x7bb0('0x1a')][_0x7bb0('0x1b')]({'raw':_0x18b944[_0x7bb0('0x1c')]?_0x18b944[_0x7bb0('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x18b944[_0x7bb0('0x1c')]?_0x18b944[_0x7bb0('0x1c')][_0x7bb0('0x1d')]||null:null,'attributes':_0x18b944['options']?_0x18b944[_0x7bb0('0x1c')][_0x7bb0('0x1e')]||null:null,'limit':_0x18b944[_0x7bb0('0x1c')]?_0x18b944[_0x7bb0('0x1c')][_0x7bb0('0x1f')]||null:null,'include':_0x18b944[_0x7bb0('0x1c')]?_0x18b944['options'][_0x7bb0('0x20')]?_['map'](_0x18b944[_0x7bb0('0x1c')][_0x7bb0('0x20')],function(_0x2e3001){return{'model':db[_0x2e3001[_0x7bb0('0x21')]],'as':_0x2e3001['as'],'attributes':_0x2e3001[_0x7bb0('0x1e')],'include':_0x2e3001['include']?_[_0x7bb0('0x22')](_0x2e3001[_0x7bb0('0x20')],function(_0x4fc268){return{'model':db[_0x4fc268[_0x7bb0('0x21')]],'as':_0x4fc268['as'],'attributes':_0x4fc268[_0x7bb0('0x1e')],'include':_0x4fc268[_0x7bb0('0x20')]?_['map'](_0x4fc268['include'],function(_0x47c87b){return{'model':db[_0x47c87b[_0x7bb0('0x21')]],'as':_0x47c87b['as'],'attributes':_0x47c87b[_0x7bb0('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x7bb0('0xe')](function(_0x5da8f9){logger['info'](_0x7bb0('0x19'),_0x18b944);logger[_0x7bb0('0x10')](_0x7bb0('0x19'),_0x18b944,JSON[_0x7bb0('0x12')](_0x5da8f9));_0x205a4f(_0x5da8f9);})[_0x7bb0('0x23')](function(_0x3ae6db){logger['error'](_0x7bb0('0x19'),_0x3ae6db[_0x7bb0('0x16')],_0x18b944);_0x917fd3(_0xe46097[_0x7bb0('0x13')](0x1f4,_0x3ae6db[_0x7bb0('0x16')]));});});};exports[_0x7bb0('0x24')]=function(_0x233b43){var _0x5a64a3=this;return new Promise(function(_0x3784eb,_0x13a26e){return db[_0x7bb0('0x1a')][_0x7bb0('0x25')]({'raw':_0x233b43[_0x7bb0('0x1c')]?_0x233b43[_0x7bb0('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x233b43[_0x7bb0('0x1c')]?_0x233b43[_0x7bb0('0x1c')][_0x7bb0('0x1d')]||null:null,'attributes':_0x233b43[_0x7bb0('0x1c')]?_0x233b43[_0x7bb0('0x1c')]['attributes']||null:null,'include':_0x233b43[_0x7bb0('0x1c')]?_0x233b43[_0x7bb0('0x1c')][_0x7bb0('0x20')]?_[_0x7bb0('0x22')](_0x233b43['options'][_0x7bb0('0x20')],function(_0x49036d){return{'model':db[_0x49036d['model']],'as':_0x49036d['as'],'attributes':_0x49036d[_0x7bb0('0x1e')],'include':_0x49036d[_0x7bb0('0x20')]?_[_0x7bb0('0x22')](_0x49036d[_0x7bb0('0x20')],function(_0x64be81){return{'model':db[_0x64be81[_0x7bb0('0x21')]],'as':_0x64be81['as'],'attributes':_0x64be81['attributes'],'include':_0x64be81[_0x7bb0('0x20')]?_[_0x7bb0('0x22')](_0x64be81['include'],function(_0x4f7749){return{'model':db[_0x4f7749[_0x7bb0('0x21')]],'as':_0x4f7749['as'],'attributes':_0x4f7749[_0x7bb0('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x7bb0('0xe')](function(_0x187848){logger['info'](_0x7bb0('0x24'),_0x233b43);logger[_0x7bb0('0x10')](_0x7bb0('0x24'),_0x233b43,JSON[_0x7bb0('0x12')](_0x187848));_0x3784eb(_0x187848);})['catch'](function(_0xa06882){logger[_0x7bb0('0x13')]('ShowOpenchannelQueue',_0xa06882[_0x7bb0('0x16')],_0x233b43);_0x13a26e(_0x5a64a3['error'](0x1f4,_0xa06882[_0x7bb0('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.socket.js b/server/api/openchannelQueue/openchannelQueue.socket.js index 31036d2..3f74c82 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 _0x86d9=['emit','removeListener','length','openchannelQueue:','./openchannelQueue.events','save','remove','update'];(function(_0x1d9ca9,_0x15e8b1){var _0x4cc1e1=function(_0x498b56){while(--_0x498b56){_0x1d9ca9['push'](_0x1d9ca9['shift']());}};_0x4cc1e1(++_0x15e8b1);}(_0x86d9,0x18c));var _0x986d=function(_0x1c4a86,_0x2661a3){_0x1c4a86=_0x1c4a86-0x0;var _0xe4bd43=_0x86d9[_0x1c4a86];return _0xe4bd43;};'use strict';var OpenchannelQueueEvents=require(_0x986d('0x0'));var events=[_0x986d('0x1'),_0x986d('0x2'),_0x986d('0x3')];function createListener(_0x5043d8,_0x4806f8){return function(_0x713c86){_0x4806f8[_0x986d('0x4')](_0x5043d8,_0x713c86);};}function removeListener(_0x325cae,_0x52d4e7){return function(){OpenchannelQueueEvents[_0x986d('0x5')](_0x325cae,_0x52d4e7);};}exports['register']=function(_0x1742cb){for(var _0x4a1a69=0x0,_0x4d2043=events[_0x986d('0x6')];_0x4a1a69<_0x4d2043;_0x4a1a69++){var _0x2be658=events[_0x4a1a69];var _0x2bdaf8=createListener(_0x986d('0x7')+_0x2be658,_0x1742cb);OpenchannelQueueEvents['on'](_0x2be658,_0x2bdaf8);}}; \ No newline at end of file +var _0xb0ed=['./openchannelQueue.events','save','emit','removeListener','register'];(function(_0x4b9d84,_0x49692a){var _0xd92cc3=function(_0x5b37f7){while(--_0x5b37f7){_0x4b9d84['push'](_0x4b9d84['shift']());}};_0xd92cc3(++_0x49692a);}(_0xb0ed,0x145));var _0xdb0e=function(_0x1fc99d,_0x21d3ad){_0x1fc99d=_0x1fc99d-0x0;var _0x4968d1=_0xb0ed[_0x1fc99d];return _0x4968d1;};'use strict';var OpenchannelQueueEvents=require(_0xdb0e('0x0'));var events=[_0xdb0e('0x1'),'remove','update'];function createListener(_0x5f0d51,_0x49a2de){return function(_0x42b955){_0x49a2de[_0xdb0e('0x2')](_0x5f0d51,_0x42b955);};}function removeListener(_0x17416a,_0x76b64d){return function(){OpenchannelQueueEvents[_0xdb0e('0x3')](_0x17416a,_0x76b64d);};}exports[_0xdb0e('0x4')]=function(_0x50c72f){for(var _0xf9e24a=0x0,_0x5f2efd=events['length'];_0xf9e24a<_0x5f2efd;_0xf9e24a++){var _0x192a07=events[_0xf9e24a];var _0x299755=createListener('openchannelQueue:'+_0x192a07,_0x50c72f);OpenchannelQueueEvents['on'](_0x192a07,_0x299755);}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/index.js b/server/api/openchannelQueueReport/index.js index da1b0d0..90c6d5e 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 _0x7128=['get','isAuthenticated','/describe','describe','show','post','create','/:id','update','delete','destroy','exports','multer','util','connect-timeout','express','../../components/auth/service','../../config/environment','./openchannelQueueReport.controller'];(function(_0x48a928,_0x430727){var _0x11c1e9=function(_0x338805){while(--_0x338805){_0x48a928['push'](_0x48a928['shift']());}};_0x11c1e9(++_0x430727);}(_0x7128,0x175));var _0x8712=function(_0x22f8ab,_0x15d8ff){_0x22f8ab=_0x22f8ab-0x0;var _0x2a70e5=_0x7128[_0x22f8ab];return _0x2a70e5;};'use strict';var multer=require(_0x8712('0x0'));var util=require(_0x8712('0x1'));var path=require('path');var timeout=require(_0x8712('0x2'));var express=require(_0x8712('0x3'));var router=express['Router']();var auth=require(_0x8712('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x8712('0x5'));var controller=require(_0x8712('0x6'));router[_0x8712('0x7')]('/',auth[_0x8712('0x8')](),controller['index']);router[_0x8712('0x7')](_0x8712('0x9'),auth[_0x8712('0x8')](),controller[_0x8712('0xa')]);router[_0x8712('0x7')]('/:id',auth[_0x8712('0x8')](),controller[_0x8712('0xb')]);router[_0x8712('0xc')]('/',auth[_0x8712('0x8')](),controller[_0x8712('0xd')]);router['put'](_0x8712('0xe'),auth[_0x8712('0x8')](),controller[_0x8712('0xf')]);router[_0x8712('0x10')](_0x8712('0xe'),auth[_0x8712('0x8')](),controller[_0x8712('0x11')]);module[_0x8712('0x12')]=router; \ No newline at end of file +var _0x90d4=['describe','show','post','put','/:id','update','destroy','util','path','Router','../../components/auth/service','../../components/interaction/service','./openchannelQueueReport.controller','get','isAuthenticated','index','/describe'];(function(_0x5e33e2,_0x59a6f7){var _0x2c311d=function(_0x8c8e47){while(--_0x8c8e47){_0x5e33e2['push'](_0x5e33e2['shift']());}};_0x2c311d(++_0x59a6f7);}(_0x90d4,0x117));var _0x490d=function(_0x3f7ee5,_0x30bc15){_0x3f7ee5=_0x3f7ee5-0x0;var _0x5b6826=_0x90d4[_0x3f7ee5];return _0x5b6826;};'use strict';var multer=require('multer');var util=require(_0x490d('0x0'));var path=require(_0x490d('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x490d('0x2')]();var auth=require(_0x490d('0x3'));var interaction=require(_0x490d('0x4'));var config=require('../../config/environment');var controller=require(_0x490d('0x5'));router[_0x490d('0x6')]('/',auth[_0x490d('0x7')](),controller[_0x490d('0x8')]);router[_0x490d('0x6')](_0x490d('0x9'),auth[_0x490d('0x7')](),controller[_0x490d('0xa')]);router[_0x490d('0x6')]('/:id',auth['isAuthenticated'](),controller[_0x490d('0xb')]);router[_0x490d('0xc')]('/',auth[_0x490d('0x7')](),controller['create']);router[_0x490d('0xd')](_0x490d('0xe'),auth[_0x490d('0x7')](),controller[_0x490d('0xf')]);router['delete'](_0x490d('0xe'),auth[_0x490d('0x7')](),controller[_0x490d('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js b/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js index 7051839..f829d0d 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 _0x2979=['sequelize','exports','STRING','DATE'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2979,0xf8));var _0x9297=function(_0x466a1a,_0x37933b){_0x466a1a=_0x466a1a-0x0;var _0x577165=_0x2979[_0x466a1a];return _0x577165;};'use strict';var moment=require('moment');var Sequelize=require(_0x9297('0x0'));module[_0x9297('0x1')]={'uniqueid':{'type':Sequelize[_0x9297('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x9297('0x2')]},'joinAt':{'type':Sequelize[_0x9297('0x3')]},'leaveAt':{'type':Sequelize[_0x9297('0x3')]},'acceptAt':{'type':Sequelize[_0x9297('0x3')]},'exitAt':{'type':Sequelize[_0x9297('0x3')]},'reason':{'type':Sequelize[_0x9297('0x2')]}}; \ No newline at end of file +var _0x9135=['moment','exports','STRING','DATE'];(function(_0x16ea2f,_0x2c2789){var _0x4686dc=function(_0x37d0ed){while(--_0x37d0ed){_0x16ea2f['push'](_0x16ea2f['shift']());}};_0x4686dc(++_0x2c2789);}(_0x9135,0xd8));var _0x5913=function(_0xebbd94,_0x5d7e3f){_0xebbd94=_0xebbd94-0x0;var _0x58f484=_0x9135[_0xebbd94];return _0x58f484;};'use strict';var moment=require(_0x5913('0x0'));var Sequelize=require('sequelize');module[_0x5913('0x1')]={'uniqueid':{'type':Sequelize[_0x5913('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x5913('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x5913('0x3')]},'acceptAt':{'type':Sequelize[_0x5913('0x3')]},'exitAt':{'type':Sequelize[_0x5913('0x3')]},'reason':{'type':Sequelize[_0x5913('0x2')]}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.controller.js b/server/api/openchannelQueueReport/openchannelQueueReport.controller.js index f6ff86b..19403e8 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 _0xf1ec=['send','index','OpenchannelQueueReport','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','merge','map','type','key','VIRTUAL','field','options','includeAll','include','findAll','rows','catch','show','find','create','body','params','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','sox','ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','ioredis','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','status','json','count','offset','limit','set','reject','save','update','then','destroy','end','sendStatus','error','stack','name'];(function(_0x577ca2,_0x39b8dc){var _0x28d66e=function(_0x5e5289){while(--_0x5e5289){_0x577ca2['push'](_0x577ca2['shift']());}};_0x28d66e(++_0x39b8dc);}(_0xf1ec,0x186));var _0xcf1e=function(_0x1ae1c4,_0x27173e){_0x1ae1c4=_0x1ae1c4-0x0;var _0xe6c7d1=_0xf1ec[_0x1ae1c4];return _0xe6c7d1;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xcf1e('0x0'));var rimraf=require(_0xcf1e('0x1'));var zipdir=require(_0xcf1e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xcf1e('0x3'));var moment=require(_0xcf1e('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xcf1e('0x5'));var util=require(_0xcf1e('0x6'));var path=require('path');var sox=require(_0xcf1e('0x7'));var csv=require('to-csv');var ejs=require(_0xcf1e('0x8'));var fs=require('fs');var _=require(_0xcf1e('0x9'));var squel=require(_0xcf1e('0xa'));var crypto=require('crypto');var jsforce=require(_0xcf1e('0xb'));var deskjs=require(_0xcf1e('0xc'));var toCsv=require(_0xcf1e('0xd'));var querystring=require(_0xcf1e('0xe'));var Papa=require('papaparse');var Redis=require(_0xcf1e('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xcf1e('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xcf1e('0x11'))('api');var utils=require(_0xcf1e('0x12'));var config=require(_0xcf1e('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x18ce20,_0x4a8abe){_0x4a8abe=_0x4a8abe||0xcc;return function(_0x356f98){if(_0x356f98){return _0x18ce20['sendStatus'](_0x4a8abe);}return _0x18ce20[_0xcf1e('0x14')](_0x4a8abe)['end']();};}function respondWithResult(_0x3222b7,_0x298e7b){_0x298e7b=_0x298e7b||0xc8;return function(_0x39c2a4){if(_0x39c2a4){return _0x3222b7[_0xcf1e('0x14')](_0x298e7b)[_0xcf1e('0x15')](_0x39c2a4);}};}function respondWithFilteredResult(_0x39def5,_0x40a32f){return function(_0x38791a){if(_0x38791a){var _0x4905a5=_0x38791a[_0xcf1e('0x16')],_0x13df86=_0x40a32f['offset'],_0x193bdc=_0x40a32f[_0xcf1e('0x17')]+_0x40a32f[_0xcf1e('0x18')],_0x7b06de;if(_0x193bdc>=_0x4905a5){_0x193bdc=_0x4905a5;_0x7b06de=0xc8;}else{_0x7b06de=0xce;}_0x39def5[_0xcf1e('0x14')](_0x7b06de);return _0x39def5[_0xcf1e('0x19')]('Content-Range',_0x13df86+'-'+_0x193bdc+'/'+_0x4905a5)[_0xcf1e('0x15')](_0x38791a);}return null;};}function patchUpdates(_0x179fc2){return function(_0xabe2c4){try{jsonpatch['apply'](_0xabe2c4,_0x179fc2,!![]);}catch(_0x1dbf47){return BPromise[_0xcf1e('0x1a')](_0x1dbf47);}return _0xabe2c4[_0xcf1e('0x1b')]();};}function saveUpdates(_0x5e324f,_0x14908e){return function(_0x2377a7){if(_0x2377a7){return _0x2377a7[_0xcf1e('0x1c')](_0x5e324f)[_0xcf1e('0x1d')](function(_0x378138){return _0x378138;});}return null;};}function removeEntity(_0x2a50fa,_0x3ce1c0){return function(_0x48b7ff){if(_0x48b7ff){return _0x48b7ff[_0xcf1e('0x1e')]()[_0xcf1e('0x1d')](function(){_0x2a50fa[_0xcf1e('0x14')](0xcc)[_0xcf1e('0x1f')]();});}};}function handleEntityNotFound(_0x4acbd9,_0x3b0a97){return function(_0x375db3){if(!_0x375db3){_0x4acbd9[_0xcf1e('0x20')](0x194);}return _0x375db3;};}function handleError(_0x3f1e30,_0x2a30c4){_0x2a30c4=_0x2a30c4||0x1f4;return function(_0x37c976){logger[_0xcf1e('0x21')](_0x37c976[_0xcf1e('0x22')]);if(_0x37c976[_0xcf1e('0x23')]){delete _0x37c976[_0xcf1e('0x23')];}_0x3f1e30['status'](_0x2a30c4)[_0xcf1e('0x24')](_0x37c976);};}exports[_0xcf1e('0x25')]=function(_0x2ef727,_0x188d76){var _0x2477dc={},_0x137841={},_0x291133={'count':0x0,'rows':[]};var _0x5d089b=db[_0xcf1e('0x26')][_0xcf1e('0x27')];_0x137841[_0xcf1e('0x28')]=_[_0xcf1e('0x29')](_0x5d089b);_0x137841[_0xcf1e('0x2a')]=_[_0xcf1e('0x29')](_0x2ef727[_0xcf1e('0x2a')]);_0x137841[_0xcf1e('0x2b')]=_[_0xcf1e('0x2c')](_0x137841[_0xcf1e('0x28')],_0x137841[_0xcf1e('0x2a')]);_0x2477dc[_0xcf1e('0x2d')]=_[_0xcf1e('0x2c')](_0x137841[_0xcf1e('0x28')],qs[_0xcf1e('0x2e')](_0x2ef727[_0xcf1e('0x2a')][_0xcf1e('0x2e')]));_0x2477dc[_0xcf1e('0x2d')]=_0x2477dc[_0xcf1e('0x2d')][_0xcf1e('0x2f')]?_0x2477dc[_0xcf1e('0x2d')]:_0x137841[_0xcf1e('0x28')];if(!_0x2ef727['query'][_0xcf1e('0x30')]('nolimit')){_0x2477dc[_0xcf1e('0x18')]=qs['limit'](_0x2ef727[_0xcf1e('0x2a')][_0xcf1e('0x18')]);_0x2477dc['offset']=qs[_0xcf1e('0x17')](_0x2ef727[_0xcf1e('0x2a')][_0xcf1e('0x17')]);}_0x2477dc[_0xcf1e('0x31')]=qs[_0xcf1e('0x32')](_0x2ef727[_0xcf1e('0x2a')]['sort']);_0x2477dc[_0xcf1e('0x33')]=qs[_0xcf1e('0x2b')](_[_0xcf1e('0x34')](_0x2ef727['query'],_0x137841['filters']));if(_0x2ef727[_0xcf1e('0x2a')]['filter']){_0x2477dc[_0xcf1e('0x33')]=_[_0xcf1e('0x35')](_0x2477dc[_0xcf1e('0x33')],{'$or':_[_0xcf1e('0x36')](_0x5d089b,function(_0x3cfdcd){if(_0x3cfdcd[_0xcf1e('0x37')][_0xcf1e('0x38')]!==_0xcf1e('0x39')){var _0x1ad5a4={};_0x1ad5a4[_0x3cfdcd[_0xcf1e('0x3a')]]={'$like':'%'+_0x2ef727[_0xcf1e('0x2a')]['filter']+'%'};return _0x1ad5a4;}})});}_0x2477dc=_[_0xcf1e('0x35')]({},_0x2477dc,_0x2ef727[_0xcf1e('0x3b')]);var _0x4d6714={'where':_0x2477dc[_0xcf1e('0x33')]};return db[_0xcf1e('0x26')][_0xcf1e('0x16')](_0x4d6714)[_0xcf1e('0x1d')](function(_0x1b96cc){_0x291133[_0xcf1e('0x16')]=_0x1b96cc;if(_0x2ef727['query'][_0xcf1e('0x3c')]){_0x2477dc[_0xcf1e('0x3d')]=[{'all':!![]}];}return db[_0xcf1e('0x26')][_0xcf1e('0x3e')](_0x2477dc);})[_0xcf1e('0x1d')](function(_0x376a7c){_0x291133[_0xcf1e('0x3f')]=_0x376a7c;return _0x291133;})['then'](respondWithFilteredResult(_0x188d76,_0x2477dc))[_0xcf1e('0x40')](handleError(_0x188d76,null));};exports[_0xcf1e('0x41')]=function(_0xfffa30,_0x402521){var _0x4c0145={'raw':!![],'where':{'id':_0xfffa30['params']['id']}},_0x28d934={};_0x28d934['model']=_[_0xcf1e('0x29')](db[_0xcf1e('0x26')][_0xcf1e('0x27')]);_0x28d934[_0xcf1e('0x2a')]=_['keys'](_0xfffa30[_0xcf1e('0x2a')]);_0x28d934['filters']=_[_0xcf1e('0x2c')](_0x28d934['model'],_0x28d934[_0xcf1e('0x2a')]);_0x4c0145[_0xcf1e('0x2d')]=_['intersection'](_0x28d934[_0xcf1e('0x28')],qs[_0xcf1e('0x2e')](_0xfffa30[_0xcf1e('0x2a')][_0xcf1e('0x2e')]));_0x4c0145[_0xcf1e('0x2d')]=_0x4c0145[_0xcf1e('0x2d')]['length']?_0x4c0145[_0xcf1e('0x2d')]:_0x28d934[_0xcf1e('0x28')];if(_0xfffa30['query'][_0xcf1e('0x3c')]){_0x4c0145[_0xcf1e('0x3d')]=[{'all':!![]}];}_0x4c0145=_[_0xcf1e('0x35')]({},_0x4c0145,_0xfffa30[_0xcf1e('0x3b')]);return db[_0xcf1e('0x26')][_0xcf1e('0x42')](_0x4c0145)[_0xcf1e('0x1d')](handleEntityNotFound(_0x402521,null))[_0xcf1e('0x1d')](respondWithResult(_0x402521,null))[_0xcf1e('0x40')](handleError(_0x402521,null));};exports['create']=function(_0x424d43,_0x35fdde){return db['OpenchannelQueueReport'][_0xcf1e('0x43')](_0x424d43[_0xcf1e('0x44')],{})[_0xcf1e('0x1d')](respondWithResult(_0x35fdde,0xc9))[_0xcf1e('0x40')](handleError(_0x35fdde,null));};exports[_0xcf1e('0x1c')]=function(_0x1e0be4,_0x2762a1){if(_0x1e0be4[_0xcf1e('0x44')]['id']){delete _0x1e0be4[_0xcf1e('0x44')]['id'];}return db[_0xcf1e('0x26')][_0xcf1e('0x42')]({'where':{'id':_0x1e0be4[_0xcf1e('0x45')]['id']}})[_0xcf1e('0x1d')](handleEntityNotFound(_0x2762a1,null))[_0xcf1e('0x1d')](saveUpdates(_0x1e0be4[_0xcf1e('0x44')],null))[_0xcf1e('0x1d')](respondWithResult(_0x2762a1,null))['catch'](handleError(_0x2762a1,null));};exports[_0xcf1e('0x1e')]=function(_0x20218e,_0x164bbe){return db['OpenchannelQueueReport']['find']({'where':{'id':_0x20218e[_0xcf1e('0x45')]['id']}})[_0xcf1e('0x1d')](handleEntityNotFound(_0x164bbe,null))[_0xcf1e('0x1d')](removeEntity(_0x164bbe,null))[_0xcf1e('0x40')](handleError(_0x164bbe,null));};exports[_0xcf1e('0x46')]=function(_0xe0c836,_0x59b35d){return db[_0xcf1e('0x26')][_0xcf1e('0x46')]()['then'](respondWithResult(_0x59b35d,null))[_0xcf1e('0x40')](handleError(_0x59b35d,null));}; \ No newline at end of file +var _0xe5ee=['index','rawAttributes','query','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','map','type','key','VIRTUAL','field','merge','options','OpenchannelQueueReport','includeAll','findAll','rows','catch','show','params','keys','find','create','body','describe','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','squel','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','update','destroy','then','end','error','name','send'];(function(_0x50d73e,_0x52b688){var _0x366849=function(_0x5274ec){while(--_0x5274ec){_0x50d73e['push'](_0x50d73e['shift']());}};_0x366849(++_0x52b688);}(_0xe5ee,0x146));var _0xee5e=function(_0xae9a28,_0x53d875){_0xae9a28=_0xae9a28-0x0;var _0xf7c89b=_0xe5ee[_0xae9a28];return _0xf7c89b;};'use strict';var pdf=require(_0xee5e('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xee5e('0x1'));var zipdir=require(_0xee5e('0x2'));var jsonpatch=require(_0xee5e('0x3'));var rp=require(_0xee5e('0x4'));var moment=require(_0xee5e('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xee5e('0x6'));var util=require(_0xee5e('0x7'));var path=require(_0xee5e('0x8'));var sox=require('sox');var csv=require(_0xee5e('0x9'));var ejs=require(_0xee5e('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0xee5e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xee5e('0xc'));var toCsv=require(_0xee5e('0x9'));var querystring=require(_0xee5e('0xd'));var Papa=require('papaparse');var Redis=require(_0xee5e('0xe'));var authService=require(_0xee5e('0xf'));var qs=require(_0xee5e('0x10'));var as=require(_0xee5e('0x11'));var hardwareService=require(_0xee5e('0x12'));var logger=require(_0xee5e('0x13'))('api');var utils=require(_0xee5e('0x14'));var config=require('../../config/environment');var db=require(_0xee5e('0x15'))['db'];function respondWithStatusCode(_0x5a8282,_0xff3fc2){_0xff3fc2=_0xff3fc2||0xcc;return function(_0x4b283f){if(_0x4b283f){return _0x5a8282[_0xee5e('0x16')](_0xff3fc2);}return _0x5a8282[_0xee5e('0x17')](_0xff3fc2)['end']();};}function respondWithResult(_0x3c034e,_0x561d3c){_0x561d3c=_0x561d3c||0xc8;return function(_0x6ab072){if(_0x6ab072){return _0x3c034e[_0xee5e('0x17')](_0x561d3c)[_0xee5e('0x18')](_0x6ab072);}};}function respondWithFilteredResult(_0x822e0c,_0x4f29e8){return function(_0xcfce3e){if(_0xcfce3e){var _0x49a5a1=_0xcfce3e[_0xee5e('0x19')],_0x5a4f00=_0x4f29e8[_0xee5e('0x1a')],_0x5d6ccf=_0x4f29e8[_0xee5e('0x1a')]+_0x4f29e8[_0xee5e('0x1b')],_0x58c7c5;if(_0x5d6ccf>=_0x49a5a1){_0x5d6ccf=_0x49a5a1;_0x58c7c5=0xc8;}else{_0x58c7c5=0xce;}_0x822e0c[_0xee5e('0x17')](_0x58c7c5);return _0x822e0c[_0xee5e('0x1c')](_0xee5e('0x1d'),_0x5a4f00+'-'+_0x5d6ccf+'/'+_0x49a5a1)['json'](_0xcfce3e);}return null;};}function patchUpdates(_0x938355){return function(_0x24e98b){try{jsonpatch[_0xee5e('0x1e')](_0x24e98b,_0x938355,!![]);}catch(_0x14431e){return BPromise[_0xee5e('0x1f')](_0x14431e);}return _0x24e98b['save']();};}function saveUpdates(_0x5c51ed,_0x1f9a00){return function(_0x23bd46){if(_0x23bd46){return _0x23bd46[_0xee5e('0x20')](_0x5c51ed)['then'](function(_0xe379b0){return _0xe379b0;});}return null;};}function removeEntity(_0x179ecc,_0x2869eb){return function(_0x358364){if(_0x358364){return _0x358364[_0xee5e('0x21')]()[_0xee5e('0x22')](function(){_0x179ecc[_0xee5e('0x17')](0xcc)[_0xee5e('0x23')]();});}};}function handleEntityNotFound(_0x1faaf1,_0x33da60){return function(_0x4cfca5){if(!_0x4cfca5){_0x1faaf1[_0xee5e('0x16')](0x194);}return _0x4cfca5;};}function handleError(_0xcd1ba2,_0x23cdf5){_0x23cdf5=_0x23cdf5||0x1f4;return function(_0x1b2ead){logger[_0xee5e('0x24')](_0x1b2ead['stack']);if(_0x1b2ead[_0xee5e('0x25')]){delete _0x1b2ead[_0xee5e('0x25')];}_0xcd1ba2['status'](_0x23cdf5)[_0xee5e('0x26')](_0x1b2ead);};}exports[_0xee5e('0x27')]=function(_0x594495,_0x1051dc){var _0x224aaa={},_0x3f63cc={},_0x4ac252={'count':0x0,'rows':[]};var _0x4b2b53=db['OpenchannelQueueReport'][_0xee5e('0x28')];_0x3f63cc['model']=_['keys'](_0x4b2b53);_0x3f63cc[_0xee5e('0x29')]=_['keys'](_0x594495[_0xee5e('0x29')]);_0x3f63cc['filters']=_[_0xee5e('0x2a')](_0x3f63cc[_0xee5e('0x2b')],_0x3f63cc['query']);_0x224aaa[_0xee5e('0x2c')]=_[_0xee5e('0x2a')](_0x3f63cc[_0xee5e('0x2b')],qs['fields'](_0x594495[_0xee5e('0x29')][_0xee5e('0x2d')]));_0x224aaa['attributes']=_0x224aaa[_0xee5e('0x2c')][_0xee5e('0x2e')]?_0x224aaa[_0xee5e('0x2c')]:_0x3f63cc['model'];if(!_0x594495[_0xee5e('0x29')][_0xee5e('0x2f')]('nolimit')){_0x224aaa[_0xee5e('0x1b')]=qs[_0xee5e('0x1b')](_0x594495[_0xee5e('0x29')]['limit']);_0x224aaa[_0xee5e('0x1a')]=qs[_0xee5e('0x1a')](_0x594495[_0xee5e('0x29')][_0xee5e('0x1a')]);}_0x224aaa[_0xee5e('0x30')]=qs[_0xee5e('0x31')](_0x594495[_0xee5e('0x29')]['sort']);_0x224aaa[_0xee5e('0x32')]=qs[_0xee5e('0x33')](_[_0xee5e('0x34')](_0x594495[_0xee5e('0x29')],_0x3f63cc['filters']));if(_0x594495[_0xee5e('0x29')][_0xee5e('0x35')]){_0x224aaa[_0xee5e('0x32')]=_['merge'](_0x224aaa['where'],{'$or':_[_0xee5e('0x36')](_0x4b2b53,function(_0x18ef23){if(_0x18ef23[_0xee5e('0x37')][_0xee5e('0x38')]!==_0xee5e('0x39')){var _0x256d07={};_0x256d07[_0x18ef23[_0xee5e('0x3a')]]={'$like':'%'+_0x594495[_0xee5e('0x29')][_0xee5e('0x35')]+'%'};return _0x256d07;}})});}_0x224aaa=_[_0xee5e('0x3b')]({},_0x224aaa,_0x594495[_0xee5e('0x3c')]);var _0x4a48ed={'where':_0x224aaa[_0xee5e('0x32')]};return db[_0xee5e('0x3d')][_0xee5e('0x19')](_0x4a48ed)[_0xee5e('0x22')](function(_0xdcbbf8){_0x4ac252[_0xee5e('0x19')]=_0xdcbbf8;if(_0x594495['query'][_0xee5e('0x3e')]){_0x224aaa['include']=[{'all':!![]}];}return db[_0xee5e('0x3d')][_0xee5e('0x3f')](_0x224aaa);})[_0xee5e('0x22')](function(_0x547c01){_0x4ac252[_0xee5e('0x40')]=_0x547c01;return _0x4ac252;})[_0xee5e('0x22')](respondWithFilteredResult(_0x1051dc,_0x224aaa))[_0xee5e('0x41')](handleError(_0x1051dc,null));};exports[_0xee5e('0x42')]=function(_0x904dcf,_0x5db71a){var _0x177376={'raw':!![],'where':{'id':_0x904dcf[_0xee5e('0x43')]['id']}},_0x348b7={};_0x348b7['model']=_[_0xee5e('0x44')](db[_0xee5e('0x3d')][_0xee5e('0x28')]);_0x348b7[_0xee5e('0x29')]=_['keys'](_0x904dcf[_0xee5e('0x29')]);_0x348b7[_0xee5e('0x33')]=_[_0xee5e('0x2a')](_0x348b7[_0xee5e('0x2b')],_0x348b7[_0xee5e('0x29')]);_0x177376['attributes']=_[_0xee5e('0x2a')](_0x348b7[_0xee5e('0x2b')],qs[_0xee5e('0x2d')](_0x904dcf[_0xee5e('0x29')][_0xee5e('0x2d')]));_0x177376[_0xee5e('0x2c')]=_0x177376[_0xee5e('0x2c')]['length']?_0x177376[_0xee5e('0x2c')]:_0x348b7[_0xee5e('0x2b')];if(_0x904dcf['query'][_0xee5e('0x3e')]){_0x177376['include']=[{'all':!![]}];}_0x177376=_['merge']({},_0x177376,_0x904dcf['options']);return db[_0xee5e('0x3d')][_0xee5e('0x45')](_0x177376)[_0xee5e('0x22')](handleEntityNotFound(_0x5db71a,null))[_0xee5e('0x22')](respondWithResult(_0x5db71a,null))['catch'](handleError(_0x5db71a,null));};exports['create']=function(_0x621b3b,_0x3cf602){return db[_0xee5e('0x3d')][_0xee5e('0x46')](_0x621b3b[_0xee5e('0x47')],{})[_0xee5e('0x22')](respondWithResult(_0x3cf602,0xc9))[_0xee5e('0x41')](handleError(_0x3cf602,null));};exports['update']=function(_0xfae48e,_0x171307){if(_0xfae48e['body']['id']){delete _0xfae48e[_0xee5e('0x47')]['id'];}return db['OpenchannelQueueReport'][_0xee5e('0x45')]({'where':{'id':_0xfae48e[_0xee5e('0x43')]['id']}})[_0xee5e('0x22')](handleEntityNotFound(_0x171307,null))[_0xee5e('0x22')](saveUpdates(_0xfae48e['body'],null))[_0xee5e('0x22')](respondWithResult(_0x171307,null))[_0xee5e('0x41')](handleError(_0x171307,null));};exports[_0xee5e('0x21')]=function(_0x46a60e,_0x32391c){return db[_0xee5e('0x3d')][_0xee5e('0x45')]({'where':{'id':_0x46a60e['params']['id']}})['then'](handleEntityNotFound(_0x32391c,null))[_0xee5e('0x22')](removeEntity(_0x32391c,null))['catch'](handleError(_0x32391c,null));};exports[_0xee5e('0x48')]=function(_0x56f3bc,_0x2a9314){return db[_0xee5e('0x3d')]['describe']()[_0xee5e('0x22')](respondWithResult(_0x2a9314,null))[_0xee5e('0x41')](handleError(_0x2a9314,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.model.js b/server/api/openchannelQueueReport/openchannelQueueReport.model.js index 786103c..17f7f2a 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 _0x8e0f=['bluebird','request-promise','rimraf','./openchannelQueueReport.attributes','exports','define','OpenchannelQueueReport','report_openchannel_queue','uniqueid','lodash','util','../../config/logger','api','moment'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x8e0f,0x12f));var _0xf8e0=function(_0x850422,_0x1605b2){_0x850422=_0x850422-0x0;var _0x3574e1=_0x8e0f[_0x850422];return _0x3574e1;};'use strict';var _=require(_0xf8e0('0x0'));var util=require(_0xf8e0('0x1'));var logger=require(_0xf8e0('0x2'))(_0xf8e0('0x3'));var moment=require(_0xf8e0('0x4'));var BPromise=require(_0xf8e0('0x5'));var rp=require(_0xf8e0('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf8e0('0x7'));var config=require('../../config/environment');var attributes=require(_0xf8e0('0x8'));module[_0xf8e0('0x9')]=function(_0x4f3b30,_0x2921b3){return _0x4f3b30[_0xf8e0('0xa')](_0xf8e0('0xb'),attributes,{'tableName':_0xf8e0('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xf8e0('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7118=['../../config/environment','./openchannelQueueReport.attributes','exports','define','OpenchannelQueueReport','report_openchannel_queue','uniqueid','../../config/logger','api','bluebird','request-promise','path','rimraf'];(function(_0x1e1299,_0x4fbdf0){var _0x3cfaf9=function(_0x256a66){while(--_0x256a66){_0x1e1299['push'](_0x1e1299['shift']());}};_0x3cfaf9(++_0x4fbdf0);}(_0x7118,0x159));var _0x8711=function(_0x5ea51b,_0x4d84fd){_0x5ea51b=_0x5ea51b-0x0;var _0x297602=_0x7118[_0x5ea51b];return _0x297602;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x8711('0x0'))(_0x8711('0x1'));var moment=require('moment');var BPromise=require(_0x8711('0x2'));var rp=require(_0x8711('0x3'));var fs=require('fs');var path=require(_0x8711('0x4'));var rimraf=require(_0x8711('0x5'));var config=require(_0x8711('0x6'));var attributes=require(_0x8711('0x7'));module[_0x8711('0x8')]=function(_0x54885e,_0x385033){return _0x54885e[_0x8711('0x9')](_0x8711('0xa'),attributes,{'tableName':_0x8711('0xb'),'paranoid':![],'indexes':[{'name':_0x8711('0xc'),'fields':[_0x8711('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 d76ce00..5d35ca2 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 _0xbd0a=['raw','CreateOpenchannelQueueReport','stringify','UpdateOpenchannelQueueReport','where','attributes','limit','lodash','moment','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','OpenchannelQueueReport,\x20%s,\x20%s','request\x20sent','debug','error','code','result','message','catch','OpenchannelQueueReport','create','body','options'];(function(_0x33879e,_0x1ead3b){var _0x20890b=function(_0x2b3afb){while(--_0x2b3afb){_0x33879e['push'](_0x33879e['shift']());}};_0x20890b(++_0x1ead3b);}(_0xbd0a,0x1b9));var _0xabd0=function(_0x148955,_0x5bbe4a){_0x148955=_0x148955-0x0;var _0x4e08cc=_0xbd0a[_0x148955];return _0x4e08cc;};'use strict';var _=require(_0xabd0('0x0'));var util=require('util');var moment=require(_0xabd0('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xabd0('0x2'))['db'];var utils=require(_0xabd0('0x3'));var logger=require(_0xabd0('0x4'))(_0xabd0('0x5'));var config=require(_0xabd0('0x6'));var jayson=require(_0xabd0('0x7'));var client=jayson[_0xabd0('0x8')][_0xabd0('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xe18a18,_0x4ac4ad,_0xf44097){return new BPromise(function(_0xb60e77,_0x2b50c1){return client['request'](_0xe18a18,_0xf44097)[_0xabd0('0xa')](function(_0x4830c4){logger[_0xabd0('0xb')](_0xabd0('0xc'),_0x4ac4ad,_0xabd0('0xd'));logger[_0xabd0('0xe')]('OpenchannelQueueReport,\x20%s,\x20%s,\x20%s',_0x4ac4ad,_0xabd0('0xd'),JSON['stringify'](_0x4830c4));if(_0x4830c4[_0xabd0('0xf')]){if(_0x4830c4[_0xabd0('0xf')][_0xabd0('0x10')]===0x1f4){logger[_0xabd0('0xf')](_0xabd0('0xc'),_0x4ac4ad,_0x4830c4[_0xabd0('0xf')]['message']);return _0x2b50c1(_0x4830c4[_0xabd0('0xf')]['message']);}logger[_0xabd0('0xf')](_0xabd0('0xc'),_0x4ac4ad,_0x4830c4['error']['message']);return _0xb60e77(_0x4830c4['error']['message']);}else{logger[_0xabd0('0xb')](_0xabd0('0xc'),_0x4ac4ad,_0xabd0('0xd'));_0xb60e77(_0x4830c4[_0xabd0('0x11')][_0xabd0('0x12')]);}})[_0xabd0('0x13')](function(_0x389e1e){logger[_0xabd0('0xf')](_0xabd0('0xc'),_0x4ac4ad,_0x389e1e);_0x2b50c1(_0x389e1e);});});}exports['CreateOpenchannelQueueReport']=function(_0x3a0ace){var _0x5de1df=this;return new Promise(function(_0x579dcd,_0x2bbc18){return db[_0xabd0('0x14')][_0xabd0('0x15')](_0x3a0ace[_0xabd0('0x16')],{'raw':_0x3a0ace['options']?_0x3a0ace[_0xabd0('0x17')][_0xabd0('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0x56c2f5){logger[_0xabd0('0xb')](_0xabd0('0x19'),_0x3a0ace);logger['debug'](_0xabd0('0x19'),_0x3a0ace,JSON[_0xabd0('0x1a')](_0x56c2f5));_0x579dcd(_0x56c2f5);})[_0xabd0('0x13')](function(_0x1e077e){logger['error'](_0xabd0('0x19'),_0x1e077e[_0xabd0('0x12')],_0x3a0ace);_0x2bbc18(_0x5de1df[_0xabd0('0xf')](0x1f4,_0x1e077e[_0xabd0('0x12')]));});});};exports[_0xabd0('0x1b')]=function(_0xf6dbad){var _0x48c4a1=this;return new Promise(function(_0x16f7be,_0x187fc5){return db[_0xabd0('0x14')]['update'](_0xf6dbad[_0xabd0('0x16')],{'raw':_0xf6dbad[_0xabd0('0x17')]?_0xf6dbad[_0xabd0('0x17')][_0xabd0('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xf6dbad[_0xabd0('0x17')]?_0xf6dbad[_0xabd0('0x17')][_0xabd0('0x1c')]||null:null,'attributes':_0xf6dbad[_0xabd0('0x17')]?_0xf6dbad[_0xabd0('0x17')][_0xabd0('0x1d')]||null:null,'limit':_0xf6dbad[_0xabd0('0x17')]?_0xf6dbad[_0xabd0('0x17')][_0xabd0('0x1e')]||null:null})[_0xabd0('0xa')](function(_0x1fe955){logger[_0xabd0('0xb')]('UpdateOpenchannelQueueReport',_0xf6dbad);logger[_0xabd0('0xe')](_0xabd0('0x1b'),_0xf6dbad,JSON[_0xabd0('0x1a')](_0x1fe955));_0x16f7be(_0x1fe955);})[_0xabd0('0x13')](function(_0x58f687){logger[_0xabd0('0xf')](_0xabd0('0x1b'),_0x58f687[_0xabd0('0x12')],_0xf6dbad);_0x187fc5(_0x48c4a1['error'](0x1f4,_0x58f687[_0xabd0('0x12')]));});});}; \ No newline at end of file +var _0xd824=['message','catch','CreateOpenchannelQueueReport','OpenchannelQueueReport','create','body','options','raw','then','debug','UpdateOpenchannelQueueReport','update','where','limit','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','request','info','OpenchannelQueueReport,\x20%s,\x20%s','request\x20sent','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x16207c,_0x165d63){var _0x322dca=function(_0x35d7b8){while(--_0x35d7b8){_0x16207c['push'](_0x16207c['shift']());}};_0x322dca(++_0x165d63);}(_0xd824,0xc2));var _0x4d82=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0xd824[_0x40a045];return _0x1a687c;};'use strict';var _=require(_0x4d82('0x0'));var util=require(_0x4d82('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x4d82('0x2'));var fs=require('fs');var Redis=require(_0x4d82('0x3'));var db=require(_0x4d82('0x4'))['db'];var utils=require(_0x4d82('0x5'));var logger=require(_0x4d82('0x6'))(_0x4d82('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x4d82('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4b842f,_0x464caf,_0xb54db2){return new BPromise(function(_0x13d624,_0x5cccb6){return client[_0x4d82('0x9')](_0x4b842f,_0xb54db2)['then'](function(_0x5356cd){logger[_0x4d82('0xa')](_0x4d82('0xb'),_0x464caf,_0x4d82('0xc'));logger['debug'](_0x4d82('0xd'),_0x464caf,'request\x20sent',JSON[_0x4d82('0xe')](_0x5356cd));if(_0x5356cd[_0x4d82('0xf')]){if(_0x5356cd[_0x4d82('0xf')]['code']===0x1f4){logger['error'](_0x4d82('0xb'),_0x464caf,_0x5356cd[_0x4d82('0xf')][_0x4d82('0x10')]);return _0x5cccb6(_0x5356cd[_0x4d82('0xf')]['message']);}logger[_0x4d82('0xf')](_0x4d82('0xb'),_0x464caf,_0x5356cd[_0x4d82('0xf')]['message']);return _0x13d624(_0x5356cd[_0x4d82('0xf')]['message']);}else{logger[_0x4d82('0xa')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x464caf,_0x4d82('0xc'));_0x13d624(_0x5356cd['result'][_0x4d82('0x10')]);}})[_0x4d82('0x11')](function(_0x461476){logger[_0x4d82('0xf')](_0x4d82('0xb'),_0x464caf,_0x461476);_0x5cccb6(_0x461476);});});}exports[_0x4d82('0x12')]=function(_0x258c59){var _0x217b72=this;return new Promise(function(_0x2f2127,_0x5ef783){return db[_0x4d82('0x13')][_0x4d82('0x14')](_0x258c59[_0x4d82('0x15')],{'raw':_0x258c59[_0x4d82('0x16')]?_0x258c59[_0x4d82('0x16')][_0x4d82('0x17')]===undefined?!![]:![]:!![]})[_0x4d82('0x18')](function(_0x64669c){logger[_0x4d82('0xa')](_0x4d82('0x12'),_0x258c59);logger[_0x4d82('0x19')]('CreateOpenchannelQueueReport',_0x258c59,JSON[_0x4d82('0xe')](_0x64669c));_0x2f2127(_0x64669c);})[_0x4d82('0x11')](function(_0x5e5bdf){logger[_0x4d82('0xf')](_0x4d82('0x12'),_0x5e5bdf[_0x4d82('0x10')],_0x258c59);_0x5ef783(_0x217b72[_0x4d82('0xf')](0x1f4,_0x5e5bdf[_0x4d82('0x10')]));});});};exports[_0x4d82('0x1a')]=function(_0x11c043){var _0x462258=this;return new Promise(function(_0x12feab,_0x2df104){return db[_0x4d82('0x13')][_0x4d82('0x1b')](_0x11c043[_0x4d82('0x15')],{'raw':_0x11c043[_0x4d82('0x16')]?_0x11c043[_0x4d82('0x16')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x11c043['options']?_0x11c043[_0x4d82('0x16')][_0x4d82('0x1c')]||null:null,'attributes':_0x11c043[_0x4d82('0x16')]?_0x11c043[_0x4d82('0x16')]['attributes']||null:null,'limit':_0x11c043[_0x4d82('0x16')]?_0x11c043[_0x4d82('0x16')][_0x4d82('0x1d')]||null:null})[_0x4d82('0x18')](function(_0x5ce98b){logger[_0x4d82('0xa')]('UpdateOpenchannelQueueReport',_0x11c043);logger['debug']('UpdateOpenchannelQueueReport',_0x11c043,JSON['stringify'](_0x5ce98b));_0x12feab(_0x5ce98b);})[_0x4d82('0x11')](function(_0x8cfbf1){logger[_0x4d82('0xf')]('UpdateOpenchannelQueueReport',_0x8cfbf1[_0x4d82('0x10')],_0x11c043);_0x2df104(_0x462258[_0x4d82('0xf')](0x1f4,_0x8cfbf1['message']));});});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/index.js b/server/api/openchannelTransferReport/index.js index 022ea9b..7967190 100644 --- a/server/api/openchannelTransferReport/index.js +++ b/server/api/openchannelTransferReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['put','destroy','exports','multer','util','path','Router','../../components/interaction/service','../../config/environment','./openchannelTransferReport.controller','get','isAuthenticated','/describe','/:id','post','create'];(function(_0x2b5513,_0x3fe5cd){var _0x578fd2=function(_0x7a9106){while(--_0x7a9106){_0x2b5513['push'](_0x2b5513['shift']());}};_0x578fd2(++_0x3fe5cd);}(_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 auth=require('../../components/auth/service');var interaction=require(_0x0a9e('0x4'));var config=require(_0x0a9e('0x5'));var controller=require(_0x0a9e('0x6'));router[_0x0a9e('0x7')]('/',auth[_0x0a9e('0x8')](),controller['index']);router[_0x0a9e('0x7')](_0x0a9e('0x9'),auth[_0x0a9e('0x8')](),controller['describe']);router['get'](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0xb')]('/',auth[_0x0a9e('0x8')](),controller[_0x0a9e('0xc')]);router[_0x0a9e('0xd')](_0x0a9e('0xa'),auth[_0x0a9e('0x8')](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xe')]);module[_0x0a9e('0xf')]=router; \ No newline at end of file +var _0xa9e0=['put','destroy','exports','multer','util','path','Router','../../components/interaction/service','../../config/environment','./openchannelTransferReport.controller','get','isAuthenticated','/describe','/:id','post','create'];(function(_0x1d3577,_0x17a32e){var _0x277d9a=function(_0x4b4144){while(--_0x4b4144){_0x1d3577['push'](_0x1d3577['shift']());}};_0x277d9a(++_0x17a32e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x187ee1,_0x3fd1e6){_0x187ee1=_0x187ee1-0x0;var _0x388160=_0xa9e0[_0x187ee1];return _0x388160;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x0a9e('0x4'));var config=require(_0x0a9e('0x5'));var controller=require(_0x0a9e('0x6'));router[_0x0a9e('0x7')]('/',auth[_0x0a9e('0x8')](),controller['index']);router[_0x0a9e('0x7')](_0x0a9e('0x9'),auth[_0x0a9e('0x8')](),controller['describe']);router['get'](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0xb')]('/',auth[_0x0a9e('0x8')](),controller[_0x0a9e('0xc')]);router[_0x0a9e('0xd')](_0x0a9e('0xa'),auth[_0x0a9e('0x8')](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xe')]);module[_0x0a9e('0xf')]=router; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js b/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js index 8f88f6a..b6fdeda 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 _0xce8f=['NOW','moment','sequelize','STRING','ENUM','account','queue'];(function(_0x4c0622,_0x5dacaf){var _0x1799d8=function(_0x2ba801){while(--_0x2ba801){_0x4c0622['push'](_0x4c0622['shift']());}};_0x1799d8(++_0x5dacaf);}(_0xce8f,0x197));var _0xfce8=function(_0x11c69f,_0x116175){_0x11c69f=_0x11c69f-0x0;var _0xba70ab=_0xce8f[_0x11c69f];return _0xba70ab;};'use strict';var moment=require(_0xfce8('0x0'));var Sequelize=require(_0xfce8('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0xfce8('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xfce8('0x3')](_0xfce8('0x4'),'agent','queue'),'allowNull':![],'defaultValue':_0xfce8('0x5')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0xfce8('0x6')]}}; \ No newline at end of file +var _0x3482=['queue','DATE','NOW','moment','sequelize','exports','STRING','ENUM','account','agent'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x3482,0x12f));var _0x2348=function(_0x13d905,_0x4093f6){_0x13d905=_0x13d905-0x0;var _0x308b2f=_0x3482[_0x13d905];return _0x308b2f;};'use strict';var moment=require(_0x2348('0x0'));var Sequelize=require(_0x2348('0x1'));module[_0x2348('0x2')]={'uniqueid':{'type':Sequelize[_0x2348('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x2348('0x4')](_0x2348('0x5'),_0x2348('0x6'),'queue'),'allowNull':![],'defaultValue':_0x2348('0x7')},'transferredAt':{'type':Sequelize[_0x2348('0x8')],'allowNull':![],'defaultValue':Sequelize[_0x2348('0x9')]}}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.controller.js b/server/api/openchannelTransferReport/openchannelTransferReport.controller.js index d66c75a..92d97af 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 _0xbd51=['include','rows','catch','show','params','find','create','body','describe','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','lodash','crypto','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','send','OpenchannelTransferReport','rawAttributes','model','query','keys','filters','intersection','attributes','fields','length','order','sort','where','merge','map','type','VIRTUAL','field','filter','options','includeAll'];(function(_0x2f87cd,_0xcaf299){var _0x5d7eda=function(_0x37ffb0){while(--_0x37ffb0){_0x2f87cd['push'](_0x2f87cd['shift']());}};_0x5d7eda(++_0xcaf299);}(_0xbd51,0x8f));var _0x1bd5=function(_0x297d5d,_0x5b113d){_0x297d5d=_0x297d5d-0x0;var _0x34eda8=_0xbd51[_0x297d5d];return _0x34eda8;};'use strict';var pdf=require(_0x1bd5('0x0'));var emlformat=require(_0x1bd5('0x1'));var rimraf=require(_0x1bd5('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1bd5('0x3'));var rp=require(_0x1bd5('0x4'));var moment=require('moment');var BPromise=require(_0x1bd5('0x5'));var Mustache=require(_0x1bd5('0x6'));var util=require('util');var path=require(_0x1bd5('0x7'));var sox=require(_0x1bd5('0x8'));var csv=require(_0x1bd5('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x1bd5('0xa'));var squel=require('squel');var crypto=require(_0x1bd5('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x1bd5('0x9'));var querystring=require(_0x1bd5('0xc'));var Papa=require(_0x1bd5('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x1bd5('0xe'));var as=require(_0x1bd5('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1bd5('0x10'))(_0x1bd5('0x11'));var utils=require('../../config/utils');var config=require(_0x1bd5('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x35c072,_0x236722){_0x236722=_0x236722||0xcc;return function(_0x32e973){if(_0x32e973){return _0x35c072['sendStatus'](_0x236722);}return _0x35c072[_0x1bd5('0x13')](_0x236722)[_0x1bd5('0x14')]();};}function respondWithResult(_0x2b236d,_0x443d7e){_0x443d7e=_0x443d7e||0xc8;return function(_0x135dca){if(_0x135dca){return _0x2b236d[_0x1bd5('0x13')](_0x443d7e)[_0x1bd5('0x15')](_0x135dca);}};}function respondWithFilteredResult(_0x1f556d,_0x22860b){return function(_0x37bc0f){if(_0x37bc0f){var _0x1a1569=_0x37bc0f[_0x1bd5('0x16')],_0x4960e6=_0x22860b[_0x1bd5('0x17')],_0x550f0e=_0x22860b[_0x1bd5('0x17')]+_0x22860b[_0x1bd5('0x18')],_0x5d4a16;if(_0x550f0e>=_0x1a1569){_0x550f0e=_0x1a1569;_0x5d4a16=0xc8;}else{_0x5d4a16=0xce;}_0x1f556d[_0x1bd5('0x13')](_0x5d4a16);return _0x1f556d[_0x1bd5('0x19')](_0x1bd5('0x1a'),_0x4960e6+'-'+_0x550f0e+'/'+_0x1a1569)[_0x1bd5('0x15')](_0x37bc0f);}return null;};}function patchUpdates(_0x5f2134){return function(_0x49e142){try{jsonpatch[_0x1bd5('0x1b')](_0x49e142,_0x5f2134,!![]);}catch(_0x3184f2){return BPromise[_0x1bd5('0x1c')](_0x3184f2);}return _0x49e142[_0x1bd5('0x1d')]();};}function saveUpdates(_0x56839e,_0x1726bd){return function(_0x33981a){if(_0x33981a){return _0x33981a[_0x1bd5('0x1e')](_0x56839e)[_0x1bd5('0x1f')](function(_0x44d1fb){return _0x44d1fb;});}return null;};}function removeEntity(_0xb8c70f,_0x44ca7f){return function(_0x2e6a54){if(_0x2e6a54){return _0x2e6a54[_0x1bd5('0x20')]()[_0x1bd5('0x1f')](function(){_0xb8c70f['status'](0xcc)[_0x1bd5('0x14')]();});}};}function handleEntityNotFound(_0x364a1a,_0x56bee8){return function(_0x44dc28){if(!_0x44dc28){_0x364a1a[_0x1bd5('0x21')](0x194);}return _0x44dc28;};}function handleError(_0x48f461,_0x2280a9){_0x2280a9=_0x2280a9||0x1f4;return function(_0x4f3a94){logger[_0x1bd5('0x22')](_0x4f3a94[_0x1bd5('0x23')]);if(_0x4f3a94['name']){delete _0x4f3a94['name'];}_0x48f461[_0x1bd5('0x13')](_0x2280a9)[_0x1bd5('0x24')](_0x4f3a94);};}exports['index']=function(_0x45402b,_0x7def6c){var _0x155f39={},_0x27ac39={},_0x18e239={'count':0x0,'rows':[]};var _0x3a5485=db[_0x1bd5('0x25')][_0x1bd5('0x26')];_0x27ac39[_0x1bd5('0x27')]=_['keys'](_0x3a5485);_0x27ac39[_0x1bd5('0x28')]=_[_0x1bd5('0x29')](_0x45402b[_0x1bd5('0x28')]);_0x27ac39[_0x1bd5('0x2a')]=_[_0x1bd5('0x2b')](_0x27ac39['model'],_0x27ac39[_0x1bd5('0x28')]);_0x155f39[_0x1bd5('0x2c')]=_[_0x1bd5('0x2b')](_0x27ac39[_0x1bd5('0x27')],qs[_0x1bd5('0x2d')](_0x45402b[_0x1bd5('0x28')][_0x1bd5('0x2d')]));_0x155f39[_0x1bd5('0x2c')]=_0x155f39[_0x1bd5('0x2c')][_0x1bd5('0x2e')]?_0x155f39[_0x1bd5('0x2c')]:_0x27ac39[_0x1bd5('0x27')];if(!_0x45402b['query']['hasOwnProperty']('nolimit')){_0x155f39['limit']=qs[_0x1bd5('0x18')](_0x45402b[_0x1bd5('0x28')][_0x1bd5('0x18')]);_0x155f39['offset']=qs[_0x1bd5('0x17')](_0x45402b[_0x1bd5('0x28')][_0x1bd5('0x17')]);}_0x155f39[_0x1bd5('0x2f')]=qs[_0x1bd5('0x30')](_0x45402b[_0x1bd5('0x28')]['sort']);_0x155f39['where']=qs[_0x1bd5('0x2a')](_['pick'](_0x45402b[_0x1bd5('0x28')],_0x27ac39[_0x1bd5('0x2a')]));if(_0x45402b['query']['filter']){_0x155f39[_0x1bd5('0x31')]=_[_0x1bd5('0x32')](_0x155f39[_0x1bd5('0x31')],{'$or':_[_0x1bd5('0x33')](_0x3a5485,function(_0x200390){if(_0x200390[_0x1bd5('0x34')]['key']!==_0x1bd5('0x35')){var _0x127615={};_0x127615[_0x200390[_0x1bd5('0x36')]]={'$like':'%'+_0x45402b[_0x1bd5('0x28')][_0x1bd5('0x37')]+'%'};return _0x127615;}})});}_0x155f39=_[_0x1bd5('0x32')]({},_0x155f39,_0x45402b[_0x1bd5('0x38')]);var _0x5b56e5={'where':_0x155f39[_0x1bd5('0x31')]};return db[_0x1bd5('0x25')]['count'](_0x5b56e5)['then'](function(_0x3c7889){_0x18e239[_0x1bd5('0x16')]=_0x3c7889;if(_0x45402b[_0x1bd5('0x28')][_0x1bd5('0x39')]){_0x155f39[_0x1bd5('0x3a')]=[{'all':!![]}];}return db[_0x1bd5('0x25')]['findAll'](_0x155f39);})[_0x1bd5('0x1f')](function(_0x1fbc01){_0x18e239[_0x1bd5('0x3b')]=_0x1fbc01;return _0x18e239;})[_0x1bd5('0x1f')](respondWithFilteredResult(_0x7def6c,_0x155f39))[_0x1bd5('0x3c')](handleError(_0x7def6c,null));};exports[_0x1bd5('0x3d')]=function(_0x306d25,_0x53edbc){var _0x5cb762={'raw':!![],'where':{'id':_0x306d25[_0x1bd5('0x3e')]['id']}},_0x587ac2={};_0x587ac2['model']=_[_0x1bd5('0x29')](db[_0x1bd5('0x25')]['rawAttributes']);_0x587ac2[_0x1bd5('0x28')]=_['keys'](_0x306d25[_0x1bd5('0x28')]);_0x587ac2[_0x1bd5('0x2a')]=_[_0x1bd5('0x2b')](_0x587ac2['model'],_0x587ac2[_0x1bd5('0x28')]);_0x5cb762[_0x1bd5('0x2c')]=_['intersection'](_0x587ac2[_0x1bd5('0x27')],qs[_0x1bd5('0x2d')](_0x306d25[_0x1bd5('0x28')]['fields']));_0x5cb762['attributes']=_0x5cb762[_0x1bd5('0x2c')]['length']?_0x5cb762[_0x1bd5('0x2c')]:_0x587ac2[_0x1bd5('0x27')];if(_0x306d25[_0x1bd5('0x28')][_0x1bd5('0x39')]){_0x5cb762[_0x1bd5('0x3a')]=[{'all':!![]}];}_0x5cb762=_[_0x1bd5('0x32')]({},_0x5cb762,_0x306d25['options']);return db['OpenchannelTransferReport'][_0x1bd5('0x3f')](_0x5cb762)[_0x1bd5('0x1f')](handleEntityNotFound(_0x53edbc,null))[_0x1bd5('0x1f')](respondWithResult(_0x53edbc,null))['catch'](handleError(_0x53edbc,null));};exports[_0x1bd5('0x40')]=function(_0x12dcb3,_0x54f378){return db[_0x1bd5('0x25')][_0x1bd5('0x40')](_0x12dcb3['body'],{})[_0x1bd5('0x1f')](respondWithResult(_0x54f378,0xc9))[_0x1bd5('0x3c')](handleError(_0x54f378,null));};exports[_0x1bd5('0x1e')]=function(_0x3958be,_0x164a7e){if(_0x3958be[_0x1bd5('0x41')]['id']){delete _0x3958be['body']['id'];}return db[_0x1bd5('0x25')][_0x1bd5('0x3f')]({'where':{'id':_0x3958be[_0x1bd5('0x3e')]['id']}})[_0x1bd5('0x1f')](handleEntityNotFound(_0x164a7e,null))[_0x1bd5('0x1f')](saveUpdates(_0x3958be[_0x1bd5('0x41')],null))['then'](respondWithResult(_0x164a7e,null))[_0x1bd5('0x3c')](handleError(_0x164a7e,null));};exports[_0x1bd5('0x20')]=function(_0x280738,_0x16b49e){return db[_0x1bd5('0x25')][_0x1bd5('0x3f')]({'where':{'id':_0x280738[_0x1bd5('0x3e')]['id']}})[_0x1bd5('0x1f')](handleEntityNotFound(_0x16b49e,null))['then'](removeEntity(_0x16b49e,null))['catch'](handleError(_0x16b49e,null));};exports[_0x1bd5('0x42')]=function(_0x3e3ef7,_0x3a8a1a){return db[_0x1bd5('0x25')][_0x1bd5('0x42')]()['then'](respondWithResult(_0x3a8a1a,null))[_0x1bd5('0x3c')](handleError(_0x3a8a1a,null));}; \ No newline at end of file +var _0xb96b=['attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','map','type','key','VIRTUAL','field','options','count','includeAll','include','findAll','rows','catch','show','params','find','create','update','body','describe','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','status','end','json','offset','limit','Content-Range','apply','reject','save','destroy','then','sendStatus','error','name','send','index','OpenchannelTransferReport','rawAttributes','model','keys','query','filters','intersection'];(function(_0x323fd8,_0x46b712){var _0x5b20cc=function(_0x37780f){while(--_0x37780f){_0x323fd8['push'](_0x323fd8['shift']());}};_0x5b20cc(++_0x46b712);}(_0xb96b,0xfb));var _0xbb96=function(_0x95b44e,_0x4af5e1){_0x95b44e=_0x95b44e-0x0;var _0x4d33ea=_0xb96b[_0x95b44e];return _0x4d33ea;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0xbb96('0x0'));var zipdir=require(_0xbb96('0x1'));var jsonpatch=require(_0xbb96('0x2'));var rp=require('request-promise');var moment=require(_0xbb96('0x3'));var BPromise=require(_0xbb96('0x4'));var Mustache=require(_0xbb96('0x5'));var util=require(_0xbb96('0x6'));var path=require(_0xbb96('0x7'));var sox=require(_0xbb96('0x8'));var csv=require(_0xbb96('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xbb96('0xa'));var squel=require(_0xbb96('0xb'));var crypto=require(_0xbb96('0xc'));var jsforce=require(_0xbb96('0xd'));var deskjs=require(_0xbb96('0xe'));var toCsv=require(_0xbb96('0x9'));var querystring=require(_0xbb96('0xf'));var Papa=require(_0xbb96('0x10'));var Redis=require(_0xbb96('0x11'));var authService=require(_0xbb96('0x12'));var qs=require(_0xbb96('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xbb96('0x14'));var utils=require(_0xbb96('0x15'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x195065,_0x19d1fa){_0x19d1fa=_0x19d1fa||0xcc;return function(_0x2ea15d){if(_0x2ea15d){return _0x195065['sendStatus'](_0x19d1fa);}return _0x195065[_0xbb96('0x16')](_0x19d1fa)[_0xbb96('0x17')]();};}function respondWithResult(_0x2d634c,_0x1b8674){_0x1b8674=_0x1b8674||0xc8;return function(_0xadd608){if(_0xadd608){return _0x2d634c[_0xbb96('0x16')](_0x1b8674)[_0xbb96('0x18')](_0xadd608);}};}function respondWithFilteredResult(_0x45dab8,_0x4c2446){return function(_0x4a8268){if(_0x4a8268){var _0x128acf=_0x4a8268['count'],_0x2a38e3=_0x4c2446[_0xbb96('0x19')],_0x5e7d6b=_0x4c2446[_0xbb96('0x19')]+_0x4c2446[_0xbb96('0x1a')],_0x18fccc;if(_0x5e7d6b>=_0x128acf){_0x5e7d6b=_0x128acf;_0x18fccc=0xc8;}else{_0x18fccc=0xce;}_0x45dab8[_0xbb96('0x16')](_0x18fccc);return _0x45dab8['set'](_0xbb96('0x1b'),_0x2a38e3+'-'+_0x5e7d6b+'/'+_0x128acf)[_0xbb96('0x18')](_0x4a8268);}return null;};}function patchUpdates(_0x48efd1){return function(_0x280d37){try{jsonpatch[_0xbb96('0x1c')](_0x280d37,_0x48efd1,!![]);}catch(_0x506adf){return BPromise[_0xbb96('0x1d')](_0x506adf);}return _0x280d37[_0xbb96('0x1e')]();};}function saveUpdates(_0x59f6a0,_0x587817){return function(_0x286e24){if(_0x286e24){return _0x286e24['update'](_0x59f6a0)['then'](function(_0xe281b4){return _0xe281b4;});}return null;};}function removeEntity(_0x42013d,_0x38c658){return function(_0x2f9a2d){if(_0x2f9a2d){return _0x2f9a2d[_0xbb96('0x1f')]()[_0xbb96('0x20')](function(){_0x42013d[_0xbb96('0x16')](0xcc)[_0xbb96('0x17')]();});}};}function handleEntityNotFound(_0x4a2839,_0x5aed27){return function(_0x229303){if(!_0x229303){_0x4a2839[_0xbb96('0x21')](0x194);}return _0x229303;};}function handleError(_0x3e1e8e,_0x1d9f70){_0x1d9f70=_0x1d9f70||0x1f4;return function(_0x539a60){logger[_0xbb96('0x22')](_0x539a60['stack']);if(_0x539a60['name']){delete _0x539a60[_0xbb96('0x23')];}_0x3e1e8e['status'](_0x1d9f70)[_0xbb96('0x24')](_0x539a60);};}exports[_0xbb96('0x25')]=function(_0x11433e,_0x11c7f4){var _0x30f769={},_0x55cd52={},_0x1c0fbf={'count':0x0,'rows':[]};var _0x1826ca=db[_0xbb96('0x26')][_0xbb96('0x27')];_0x55cd52[_0xbb96('0x28')]=_[_0xbb96('0x29')](_0x1826ca);_0x55cd52[_0xbb96('0x2a')]=_[_0xbb96('0x29')](_0x11433e['query']);_0x55cd52[_0xbb96('0x2b')]=_[_0xbb96('0x2c')](_0x55cd52[_0xbb96('0x28')],_0x55cd52[_0xbb96('0x2a')]);_0x30f769[_0xbb96('0x2d')]=_[_0xbb96('0x2c')](_0x55cd52[_0xbb96('0x28')],qs[_0xbb96('0x2e')](_0x11433e['query'][_0xbb96('0x2e')]));_0x30f769[_0xbb96('0x2d')]=_0x30f769[_0xbb96('0x2d')][_0xbb96('0x2f')]?_0x30f769[_0xbb96('0x2d')]:_0x55cd52[_0xbb96('0x28')];if(!_0x11433e['query']['hasOwnProperty'](_0xbb96('0x30'))){_0x30f769[_0xbb96('0x1a')]=qs[_0xbb96('0x1a')](_0x11433e['query'][_0xbb96('0x1a')]);_0x30f769[_0xbb96('0x19')]=qs[_0xbb96('0x19')](_0x11433e[_0xbb96('0x2a')]['offset']);}_0x30f769[_0xbb96('0x31')]=qs[_0xbb96('0x32')](_0x11433e[_0xbb96('0x2a')][_0xbb96('0x32')]);_0x30f769[_0xbb96('0x33')]=qs[_0xbb96('0x2b')](_[_0xbb96('0x34')](_0x11433e[_0xbb96('0x2a')],_0x55cd52['filters']));if(_0x11433e[_0xbb96('0x2a')][_0xbb96('0x35')]){_0x30f769[_0xbb96('0x33')]=_[_0xbb96('0x36')](_0x30f769[_0xbb96('0x33')],{'$or':_[_0xbb96('0x37')](_0x1826ca,function(_0x2b18a8){if(_0x2b18a8[_0xbb96('0x38')][_0xbb96('0x39')]!==_0xbb96('0x3a')){var _0x1f6c60={};_0x1f6c60[_0x2b18a8[_0xbb96('0x3b')]]={'$like':'%'+_0x11433e[_0xbb96('0x2a')]['filter']+'%'};return _0x1f6c60;}})});}_0x30f769=_['merge']({},_0x30f769,_0x11433e[_0xbb96('0x3c')]);var _0x1bec1f={'where':_0x30f769[_0xbb96('0x33')]};return db[_0xbb96('0x26')][_0xbb96('0x3d')](_0x1bec1f)[_0xbb96('0x20')](function(_0x56adf7){_0x1c0fbf['count']=_0x56adf7;if(_0x11433e[_0xbb96('0x2a')][_0xbb96('0x3e')]){_0x30f769[_0xbb96('0x3f')]=[{'all':!![]}];}return db[_0xbb96('0x26')][_0xbb96('0x40')](_0x30f769);})['then'](function(_0x370da0){_0x1c0fbf[_0xbb96('0x41')]=_0x370da0;return _0x1c0fbf;})[_0xbb96('0x20')](respondWithFilteredResult(_0x11c7f4,_0x30f769))[_0xbb96('0x42')](handleError(_0x11c7f4,null));};exports[_0xbb96('0x43')]=function(_0x2e5272,_0x4d1eea){var _0x2e5e50={'raw':!![],'where':{'id':_0x2e5272[_0xbb96('0x44')]['id']}},_0xb738bb={};_0xb738bb[_0xbb96('0x28')]=_['keys'](db[_0xbb96('0x26')][_0xbb96('0x27')]);_0xb738bb[_0xbb96('0x2a')]=_[_0xbb96('0x29')](_0x2e5272[_0xbb96('0x2a')]);_0xb738bb['filters']=_[_0xbb96('0x2c')](_0xb738bb[_0xbb96('0x28')],_0xb738bb[_0xbb96('0x2a')]);_0x2e5e50[_0xbb96('0x2d')]=_[_0xbb96('0x2c')](_0xb738bb[_0xbb96('0x28')],qs['fields'](_0x2e5272[_0xbb96('0x2a')][_0xbb96('0x2e')]));_0x2e5e50[_0xbb96('0x2d')]=_0x2e5e50[_0xbb96('0x2d')]['length']?_0x2e5e50[_0xbb96('0x2d')]:_0xb738bb[_0xbb96('0x28')];if(_0x2e5272[_0xbb96('0x2a')][_0xbb96('0x3e')]){_0x2e5e50[_0xbb96('0x3f')]=[{'all':!![]}];}_0x2e5e50=_[_0xbb96('0x36')]({},_0x2e5e50,_0x2e5272['options']);return db[_0xbb96('0x26')][_0xbb96('0x45')](_0x2e5e50)['then'](handleEntityNotFound(_0x4d1eea,null))[_0xbb96('0x20')](respondWithResult(_0x4d1eea,null))[_0xbb96('0x42')](handleError(_0x4d1eea,null));};exports['create']=function(_0x22e483,_0x1277d6){return db[_0xbb96('0x26')][_0xbb96('0x46')](_0x22e483['body'],{})[_0xbb96('0x20')](respondWithResult(_0x1277d6,0xc9))[_0xbb96('0x42')](handleError(_0x1277d6,null));};exports[_0xbb96('0x47')]=function(_0x596050,_0x280666){if(_0x596050['body']['id']){delete _0x596050[_0xbb96('0x48')]['id'];}return db[_0xbb96('0x26')][_0xbb96('0x45')]({'where':{'id':_0x596050[_0xbb96('0x44')]['id']}})[_0xbb96('0x20')](handleEntityNotFound(_0x280666,null))['then'](saveUpdates(_0x596050['body'],null))[_0xbb96('0x20')](respondWithResult(_0x280666,null))[_0xbb96('0x42')](handleError(_0x280666,null));};exports[_0xbb96('0x1f')]=function(_0x560137,_0x2bab8e){return db[_0xbb96('0x26')][_0xbb96('0x45')]({'where':{'id':_0x560137[_0xbb96('0x44')]['id']}})[_0xbb96('0x20')](handleEntityNotFound(_0x2bab8e,null))[_0xbb96('0x20')](removeEntity(_0x2bab8e,null))[_0xbb96('0x42')](handleError(_0x2bab8e,null));};exports[_0xbb96('0x49')]=function(_0x579a28,_0x11a6a4){return db['OpenchannelTransferReport'][_0xbb96('0x49')]()['then'](respondWithResult(_0x11a6a4,null))[_0xbb96('0x42')](handleError(_0x11a6a4,null));}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.model.js b/server/api/openchannelTransferReport/openchannelTransferReport.model.js index 96d2604..3c26bdf 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 _0x62a3=['define','OpenchannelTransferReport','report_openchannel_transfer','uniqueid','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelTransferReport.attributes','exports'];(function(_0xc26468,_0x233ab3){var _0x23f37a=function(_0x49ee51){while(--_0x49ee51){_0xc26468['push'](_0xc26468['shift']());}};_0x23f37a(++_0x233ab3);}(_0x62a3,0x138));var _0x362a=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x62a3[_0x17d9e3];return _0x14192d;};'use strict';var _=require('lodash');var util=require(_0x362a('0x0'));var logger=require('../../config/logger')(_0x362a('0x1'));var moment=require(_0x362a('0x2'));var BPromise=require(_0x362a('0x3'));var rp=require(_0x362a('0x4'));var fs=require('fs');var path=require(_0x362a('0x5'));var rimraf=require(_0x362a('0x6'));var config=require(_0x362a('0x7'));var attributes=require(_0x362a('0x8'));module[_0x362a('0x9')]=function(_0x1d9b55,_0xb4105b){return _0x1d9b55[_0x362a('0xa')](_0x362a('0xb'),attributes,{'tableName':_0x362a('0xc'),'paranoid':![],'indexes':[{'name':_0x362a('0xd'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xe0b4=['util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./openchannelTransferReport.attributes','exports','OpenchannelTransferReport','report_openchannel_transfer','uniqueid','lodash'];(function(_0x36dfbd,_0x5bfe2d){var _0x4ecad9=function(_0x5230da){while(--_0x5230da){_0x36dfbd['push'](_0x36dfbd['shift']());}};_0x4ecad9(++_0x5bfe2d);}(_0xe0b4,0x1c6));var _0x4e0b=function(_0x195631,_0x368f36){_0x195631=_0x195631-0x0;var _0x46e1c0=_0xe0b4[_0x195631];return _0x46e1c0;};'use strict';var _=require(_0x4e0b('0x0'));var util=require(_0x4e0b('0x1'));var logger=require(_0x4e0b('0x2'))('api');var moment=require(_0x4e0b('0x3'));var BPromise=require(_0x4e0b('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4e0b('0x5'));var rimraf=require(_0x4e0b('0x6'));var config=require(_0x4e0b('0x7'));var attributes=require(_0x4e0b('0x8'));module[_0x4e0b('0x9')]=function(_0x46e606,_0x70b891){return _0x46e606['define'](_0x4e0b('0xa'),attributes,{'tableName':_0x4e0b('0xb'),'paranoid':![],'indexes':[{'name':_0x4e0b('0xc'),'fields':[_0x4e0b('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js b/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js index d22e431..7acd305 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 _0xf921=['error','code','OpenchannelTransferReport,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','info','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x4c94ef,_0x2d2b8c){var _0x8ee070=function(_0x105f1f){while(--_0x105f1f){_0x4c94ef['push'](_0x4c94ef['shift']());}};_0x8ee070(++_0x2d2b8c);}(_0xf921,0xde));var _0x1f92=function(_0x56213b,_0x20a174){_0x56213b=_0x56213b-0x0;var _0x1d74be=_0xf921[_0x56213b];return _0x1d74be;};'use strict';var _=require(_0x1f92('0x0'));var util=require('util');var moment=require(_0x1f92('0x1'));var BPromise=require(_0x1f92('0x2'));var rs=require(_0x1f92('0x3'));var fs=require('fs');var Redis=require(_0x1f92('0x4'));var db=require(_0x1f92('0x5'))['db'];var utils=require(_0x1f92('0x6'));var logger=require(_0x1f92('0x7'))(_0x1f92('0x8'));var config=require(_0x1f92('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x1f92('0xa')][_0x1f92('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x36cbb5,_0x76391a,_0x2b2ef4){return new BPromise(function(_0x428da9,_0x4a731b){return client[_0x1f92('0xc')](_0x36cbb5,_0x2b2ef4)['then'](function(_0x4f5f0a){logger[_0x1f92('0xd')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x76391a,'request\x20sent');logger[_0x1f92('0xe')](_0x1f92('0xf'),_0x76391a,_0x1f92('0x10'),JSON[_0x1f92('0x11')](_0x4f5f0a));if(_0x4f5f0a[_0x1f92('0x12')]){if(_0x4f5f0a[_0x1f92('0x12')][_0x1f92('0x13')]===0x1f4){logger[_0x1f92('0x12')](_0x1f92('0x14'),_0x76391a,_0x4f5f0a[_0x1f92('0x12')][_0x1f92('0x15')]);return _0x4a731b(_0x4f5f0a[_0x1f92('0x12')][_0x1f92('0x15')]);}logger[_0x1f92('0x12')](_0x1f92('0x14'),_0x76391a,_0x4f5f0a['error'][_0x1f92('0x15')]);return _0x428da9(_0x4f5f0a[_0x1f92('0x12')][_0x1f92('0x15')]);}else{logger[_0x1f92('0xd')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x76391a,_0x1f92('0x10'));_0x428da9(_0x4f5f0a[_0x1f92('0x16')][_0x1f92('0x15')]);}})[_0x1f92('0x17')](function(_0x34b2b4){logger[_0x1f92('0x12')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x76391a,_0x34b2b4);_0x4a731b(_0x34b2b4);});});} \ No newline at end of file +var _0xcfbf=['../../config/environment','jayson/promise','client','http','request','then','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0xdb59b9,_0x1e71f5){var _0xa8ab6a=function(_0x341cbf){while(--_0x341cbf){_0xdb59b9['push'](_0xdb59b9['shift']());}};_0xa8ab6a(++_0x1e71f5);}(_0xcfbf,0x152));var _0xfcfb=function(_0x16946a,_0xf8e9cd){_0x16946a=_0x16946a-0x0;var _0x42980a=_0xcfbf[_0x16946a];return _0x42980a;};'use strict';var _=require(_0xfcfb('0x0'));var util=require(_0xfcfb('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xfcfb('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfcfb('0x3'))['db'];var utils=require(_0xfcfb('0x4'));var logger=require(_0xfcfb('0x5'))(_0xfcfb('0x6'));var config=require(_0xfcfb('0x7'));var jayson=require(_0xfcfb('0x8'));var client=jayson[_0xfcfb('0x9')][_0xfcfb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5a3be6,_0x8fbce8,_0x183fde){return new BPromise(function(_0x5c08cd,_0x55a54d){return client[_0xfcfb('0xb')](_0x5a3be6,_0x183fde)[_0xfcfb('0xc')](function(_0x506b31){logger['info'](_0xfcfb('0xd'),_0x8fbce8,_0xfcfb('0xe'));logger['debug'](_0xfcfb('0xf'),_0x8fbce8,'request\x20sent',JSON[_0xfcfb('0x10')](_0x506b31));if(_0x506b31['error']){if(_0x506b31[_0xfcfb('0x11')][_0xfcfb('0x12')]===0x1f4){logger[_0xfcfb('0x11')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x8fbce8,_0x506b31['error'][_0xfcfb('0x13')]);return _0x55a54d(_0x506b31['error'][_0xfcfb('0x13')]);}logger[_0xfcfb('0x11')](_0xfcfb('0xd'),_0x8fbce8,_0x506b31[_0xfcfb('0x11')]['message']);return _0x5c08cd(_0x506b31[_0xfcfb('0x11')][_0xfcfb('0x13')]);}else{logger[_0xfcfb('0x14')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x8fbce8,_0xfcfb('0xe'));_0x5c08cd(_0x506b31[_0xfcfb('0x15')][_0xfcfb('0x13')]);}})[_0xfcfb('0x16')](function(_0x1dfc9b){logger[_0xfcfb('0x11')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x8fbce8,_0x1dfc9b);_0x55a54d(_0x1dfc9b);});});} \ No newline at end of file diff --git a/server/api/pause/index.js b/server/api/pause/index.js index 54ed05b..76f41cc 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 _0xd592=['util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./pause.controller','isAuthenticated','get','/:id','show','create','put','delete','destroy','exports','multer'];(function(_0x849d6,_0x56fb89){var _0x2d882d=function(_0x26374e){while(--_0x26374e){_0x849d6['push'](_0x849d6['shift']());}};_0x2d882d(++_0x56fb89);}(_0xd592,0x97));var _0x2d59=function(_0x507b2c,_0x4968ad){_0x507b2c=_0x507b2c-0x0;var _0x3ef56c=_0xd592[_0x507b2c];return _0x3ef56c;};'use strict';var multer=require(_0x2d59('0x0'));var util=require(_0x2d59('0x1'));var path=require(_0x2d59('0x2'));var timeout=require(_0x2d59('0x3'));var express=require(_0x2d59('0x4'));var router=express[_0x2d59('0x5')]();var auth=require(_0x2d59('0x6'));var interaction=require(_0x2d59('0x7'));var config=require(_0x2d59('0x8'));var controller=require(_0x2d59('0x9'));router['get']('/',auth[_0x2d59('0xa')](),controller['index']);router[_0x2d59('0xb')](_0x2d59('0xc'),auth[_0x2d59('0xa')](),controller[_0x2d59('0xd')]);router['post']('/',auth[_0x2d59('0xa')](),controller[_0x2d59('0xe')]);router[_0x2d59('0xf')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x2d59('0x10')](_0x2d59('0xc'),auth[_0x2d59('0xa')](),controller[_0x2d59('0x11')]);module[_0x2d59('0x12')]=router; \ No newline at end of file +var _0x9378=['create','put','isAuthenticated','update','destroy','exports','path','express','Router','../../components/auth/service','../../components/interaction/service','./pause.controller','get','index','/:id','show','post'];(function(_0x2ee75d,_0x29f123){var _0x1d751d=function(_0x451810){while(--_0x451810){_0x2ee75d['push'](_0x2ee75d['shift']());}};_0x1d751d(++_0x29f123);}(_0x9378,0x19e));var _0x8937=function(_0xc2c077,_0xadfd2b){_0xc2c077=_0xc2c077-0x0;var _0x10ab52=_0x9378[_0xc2c077];return _0x10ab52;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x8937('0x0'));var timeout=require('connect-timeout');var express=require(_0x8937('0x1'));var router=express[_0x8937('0x2')]();var auth=require(_0x8937('0x3'));var interaction=require(_0x8937('0x4'));var config=require('../../config/environment');var controller=require(_0x8937('0x5'));router[_0x8937('0x6')]('/',auth['isAuthenticated'](),controller[_0x8937('0x7')]);router['get'](_0x8937('0x8'),auth['isAuthenticated'](),controller[_0x8937('0x9')]);router[_0x8937('0xa')]('/',auth['isAuthenticated'](),controller[_0x8937('0xb')]);router[_0x8937('0xc')](_0x8937('0x8'),auth[_0x8937('0xd')](),controller[_0x8937('0xe')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x8937('0xf')]);module[_0x8937('0x10')]=router; \ No newline at end of file diff --git a/server/api/pause/pause.attributes.js b/server/api/pause/pause.attributes.js index 1999c81..0a61625 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 _0xa419=['exports','STRING','name'];(function(_0xf10840,_0xad3916){var _0x1fdf7e=function(_0x463be3){while(--_0x463be3){_0xf10840['push'](_0xf10840['shift']());}};_0x1fdf7e(++_0xad3916);}(_0xa419,0x171));var _0x9a41=function(_0x555b2f,_0x43b622){_0x555b2f=_0x555b2f-0x0;var _0x81c0a6=_0xa419[_0x555b2f];return _0x81c0a6;};'use strict';var Sequelize=require('sequelize');module[_0x9a41('0x0')]={'name':{'type':Sequelize[_0x9a41('0x1')],'unique':_0x9a41('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0x9a41('0x1')]}}; \ No newline at end of file +var _0xb7a4=['name','STRING','sequelize'];(function(_0x16c217,_0x58f4fd){var _0x492709=function(_0xfe65a0){while(--_0xfe65a0){_0x16c217['push'](_0x16c217['shift']());}};_0x492709(++_0x58f4fd);}(_0xb7a4,0x110));var _0x4b7a=function(_0xbab6a,_0x1e8c6d){_0xbab6a=_0xbab6a-0x0;var _0x406239=_0xb7a4[_0xbab6a];return _0x406239;};'use strict';var Sequelize=require(_0x4b7a('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x4b7a('0x1'),'allowNull':![]},'description':{'type':Sequelize[_0x4b7a('0x2')]}}; \ No newline at end of file diff --git a/server/api/pause/pause.controller.js b/server/api/pause/pause.controller.js index b77130d..c4bb7c5 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 _0x7329=['show','params','find','create','user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','lodash','squel','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','count','offset','set','Content-Range','apply','reject','save','destroy','then','get','Pauses','UserProfileResource','error','stack','name','send','Pause','rawAttributes','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','where','pick','filter','merge','map','type','key','VIRTUAL','field','options','include','rows','catch'];(function(_0x20589d,_0x55d5bf){var _0x422de9=function(_0x44cbbb){while(--_0x44cbbb){_0x20589d['push'](_0x20589d['shift']());}};_0x422de9(++_0x55d5bf);}(_0x7329,0xfd));var _0x9732=function(_0x3e6729,_0x16d4af){_0x3e6729=_0x3e6729-0x0;var _0x535bcd=_0x7329[_0x3e6729];return _0x535bcd;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x9732('0x0'));var rimraf=require(_0x9732('0x1'));var zipdir=require(_0x9732('0x2'));var jsonpatch=require(_0x9732('0x3'));var rp=require(_0x9732('0x4'));var moment=require(_0x9732('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x9732('0x6'));var path=require(_0x9732('0x7'));var sox=require(_0x9732('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x9732('0x9'));var squel=require(_0x9732('0xa'));var crypto=require('crypto');var jsforce=require(_0x9732('0xb'));var deskjs=require(_0x9732('0xc'));var toCsv=require(_0x9732('0xd'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x9732('0xe'));var authService=require(_0x9732('0xf'));var qs=require(_0x9732('0x10'));var as=require(_0x9732('0x11'));var hardwareService=require(_0x9732('0x12'));var logger=require(_0x9732('0x13'))(_0x9732('0x14'));var utils=require(_0x9732('0x15'));var config=require(_0x9732('0x16'));var db=require(_0x9732('0x17'))['db'];function respondWithStatusCode(_0x55ad67,_0x415e10){_0x415e10=_0x415e10||0xcc;return function(_0x370a8b){if(_0x370a8b){return _0x55ad67[_0x9732('0x18')](_0x415e10);}return _0x55ad67['status'](_0x415e10)[_0x9732('0x19')]();};}function respondWithResult(_0x459948,_0x52a750){_0x52a750=_0x52a750||0xc8;return function(_0x4b8061){if(_0x4b8061){return _0x459948[_0x9732('0x1a')](_0x52a750)[_0x9732('0x1b')](_0x4b8061);}};}function respondWithFilteredResult(_0x3de6c5,_0x21d5b4){return function(_0x3d4837){if(_0x3d4837){var _0x2de605=_0x3d4837[_0x9732('0x1c')],_0x35bbcc=_0x21d5b4[_0x9732('0x1d')],_0x3818a6=_0x21d5b4['offset']+_0x21d5b4['limit'],_0x32e5d0;if(_0x3818a6>=_0x2de605){_0x3818a6=_0x2de605;_0x32e5d0=0xc8;}else{_0x32e5d0=0xce;}_0x3de6c5[_0x9732('0x1a')](_0x32e5d0);return _0x3de6c5[_0x9732('0x1e')](_0x9732('0x1f'),_0x35bbcc+'-'+_0x3818a6+'/'+_0x2de605)['json'](_0x3d4837);}return null;};}function patchUpdates(_0x4305c5){return function(_0x267682){try{jsonpatch[_0x9732('0x20')](_0x267682,_0x4305c5,!![]);}catch(_0x28f101){return BPromise[_0x9732('0x21')](_0x28f101);}return _0x267682[_0x9732('0x22')]();};}function saveUpdates(_0x4e0db1,_0x2f4d11){return function(_0x25c8a9){if(_0x25c8a9){return _0x25c8a9['update'](_0x4e0db1)['then'](function(_0xf1588b){return _0xf1588b;});}return null;};}function removeEntity(_0x579e72,_0x31e480){return function(_0x4e10e3){if(_0x4e10e3){return _0x4e10e3[_0x9732('0x23')]()[_0x9732('0x24')](function(){var _0x308d6f=_0x4e10e3[_0x9732('0x25')]({'plain':!![]});var _0x134d34=_0x9732('0x26');return db[_0x9732('0x27')][_0x9732('0x23')]({'where':{'type':_0x134d34,'resourceId':_0x308d6f['id']}})[_0x9732('0x24')](function(){return _0x4e10e3;});})[_0x9732('0x24')](function(){_0x579e72[_0x9732('0x1a')](0xcc)[_0x9732('0x19')]();});}};}function handleEntityNotFound(_0x4d9f13,_0x2af1e7){return function(_0x1c70cf){if(!_0x1c70cf){_0x4d9f13[_0x9732('0x18')](0x194);}return _0x1c70cf;};}function handleError(_0x58683d,_0x75cffd){_0x75cffd=_0x75cffd||0x1f4;return function(_0x50f2a0){logger[_0x9732('0x28')](_0x50f2a0[_0x9732('0x29')]);if(_0x50f2a0[_0x9732('0x2a')]){delete _0x50f2a0[_0x9732('0x2a')];}_0x58683d[_0x9732('0x1a')](_0x75cffd)[_0x9732('0x2b')](_0x50f2a0);};}exports['index']=function(_0xb375b9,_0x159f2b){var _0x50d60a={},_0x103b82={},_0x45d82c={'count':0x0,'rows':[]};var _0x547223=db[_0x9732('0x2c')][_0x9732('0x2d')];_0x103b82[_0x9732('0x2e')]=_[_0x9732('0x2f')](_0x547223);_0x103b82[_0x9732('0x30')]=_[_0x9732('0x2f')](_0xb375b9[_0x9732('0x30')]);_0x103b82[_0x9732('0x31')]=_['intersection'](_0x103b82['model'],_0x103b82[_0x9732('0x30')]);_0x50d60a[_0x9732('0x32')]=_[_0x9732('0x33')](_0x103b82[_0x9732('0x2e')],qs[_0x9732('0x34')](_0xb375b9[_0x9732('0x30')]['fields']));_0x50d60a[_0x9732('0x32')]=_0x50d60a['attributes'][_0x9732('0x35')]?_0x50d60a[_0x9732('0x32')]:_0x103b82[_0x9732('0x2e')];if(!_0xb375b9['query'][_0x9732('0x36')](_0x9732('0x37'))){_0x50d60a['limit']=qs['limit'](_0xb375b9['query'][_0x9732('0x38')]);_0x50d60a[_0x9732('0x1d')]=qs[_0x9732('0x1d')](_0xb375b9[_0x9732('0x30')][_0x9732('0x1d')]);}_0x50d60a[_0x9732('0x39')]=qs['sort'](_0xb375b9[_0x9732('0x30')]['sort']);_0x50d60a[_0x9732('0x3a')]=qs['filters'](_[_0x9732('0x3b')](_0xb375b9['query'],_0x103b82[_0x9732('0x31')]));if(_0xb375b9[_0x9732('0x30')][_0x9732('0x3c')]){_0x50d60a[_0x9732('0x3a')]=_[_0x9732('0x3d')](_0x50d60a[_0x9732('0x3a')],{'$or':_[_0x9732('0x3e')](_0x547223,function(_0x5e3045){if(_0x5e3045[_0x9732('0x3f')][_0x9732('0x40')]!==_0x9732('0x41')){var _0x4e64e1={};_0x4e64e1[_0x5e3045[_0x9732('0x42')]]={'$like':'%'+_0xb375b9[_0x9732('0x30')][_0x9732('0x3c')]+'%'};return _0x4e64e1;}})});}_0x50d60a=_['merge']({},_0x50d60a,_0xb375b9[_0x9732('0x43')]);var _0x38e340={'where':_0x50d60a[_0x9732('0x3a')]};return db[_0x9732('0x2c')][_0x9732('0x1c')](_0x38e340)[_0x9732('0x24')](function(_0x532859){_0x45d82c['count']=_0x532859;if(_0xb375b9[_0x9732('0x30')]['includeAll']){_0x50d60a[_0x9732('0x44')]=[{'all':!![]}];}return db['Pause']['findAll'](_0x50d60a);})[_0x9732('0x24')](function(_0x2f7061){_0x45d82c[_0x9732('0x45')]=_0x2f7061;return _0x45d82c;})[_0x9732('0x24')](respondWithFilteredResult(_0x159f2b,_0x50d60a))[_0x9732('0x46')](handleError(_0x159f2b,null));};exports[_0x9732('0x47')]=function(_0x4927a2,_0x3d8666){var _0x18f875={'raw':!![],'where':{'id':_0x4927a2[_0x9732('0x48')]['id']}},_0x59afcb={};_0x59afcb[_0x9732('0x2e')]=_[_0x9732('0x2f')](db[_0x9732('0x2c')][_0x9732('0x2d')]);_0x59afcb[_0x9732('0x30')]=_['keys'](_0x4927a2[_0x9732('0x30')]);_0x59afcb['filters']=_['intersection'](_0x59afcb[_0x9732('0x2e')],_0x59afcb[_0x9732('0x30')]);_0x18f875['attributes']=_[_0x9732('0x33')](_0x59afcb[_0x9732('0x2e')],qs[_0x9732('0x34')](_0x4927a2[_0x9732('0x30')][_0x9732('0x34')]));_0x18f875[_0x9732('0x32')]=_0x18f875[_0x9732('0x32')][_0x9732('0x35')]?_0x18f875[_0x9732('0x32')]:_0x59afcb[_0x9732('0x2e')];if(_0x4927a2[_0x9732('0x30')]['includeAll']){_0x18f875[_0x9732('0x44')]=[{'all':!![]}];}_0x18f875=_[_0x9732('0x3d')]({},_0x18f875,_0x4927a2[_0x9732('0x43')]);return db[_0x9732('0x2c')][_0x9732('0x49')](_0x18f875)[_0x9732('0x24')](handleEntityNotFound(_0x3d8666,null))[_0x9732('0x24')](respondWithResult(_0x3d8666,null))[_0x9732('0x46')](handleError(_0x3d8666,null));};exports[_0x9732('0x4a')]=function(_0xc905e5,_0x249f6c){return db[_0x9732('0x2c')]['create'](_0xc905e5['body'],{})[_0x9732('0x24')](function(_0xb8fa21){var _0x20dd8c=_0xc905e5[_0x9732('0x4b')][_0x9732('0x25')]({'plain':!![]});if(!_0x20dd8c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x20dd8c['role']===_0x9732('0x4b')){var _0x1904f6=_0xb8fa21[_0x9732('0x25')]({'plain':!![]});var _0x401d6f=_0x9732('0x26');return db[_0x9732('0x4c')][_0x9732('0x49')]({'where':{'name':_0x401d6f,'userProfileId':_0x20dd8c[_0x9732('0x4d')]},'raw':!![]})[_0x9732('0x24')](function(_0x281f88){if(_0x281f88&&_0x281f88['autoAssociation']===0x0){return db[_0x9732('0x27')]['create']({'name':_0x1904f6['name'],'resourceId':_0x1904f6['id'],'type':_0x281f88[_0x9732('0x2a')],'sectionId':_0x281f88['id']},{})[_0x9732('0x24')](function(){return _0xb8fa21;});}else{return _0xb8fa21;}})[_0x9732('0x46')](function(_0xf55b8e){logger[_0x9732('0x28')](_0x9732('0x4e'),_0xf55b8e);throw _0xf55b8e;});}return _0xb8fa21;})[_0x9732('0x24')](respondWithResult(_0x249f6c,0xc9))[_0x9732('0x46')](handleError(_0x249f6c,null));};exports[_0x9732('0x4f')]=function(_0x1b1c0b,_0x203a1e){if(_0x1b1c0b[_0x9732('0x50')]['id']){delete _0x1b1c0b['body']['id'];}return db[_0x9732('0x2c')][_0x9732('0x49')]({'where':{'id':_0x1b1c0b['params']['id']}})[_0x9732('0x24')](handleEntityNotFound(_0x203a1e,null))['then'](saveUpdates(_0x1b1c0b[_0x9732('0x50')],null))[_0x9732('0x24')](respondWithResult(_0x203a1e,null))[_0x9732('0x46')](handleError(_0x203a1e,null));};exports[_0x9732('0x23')]=function(_0xa4173d,_0x4e2217){return db[_0x9732('0x2c')][_0x9732('0x49')]({'where':{'id':_0xa4173d['params']['id']}})['then'](handleEntityNotFound(_0x4e2217,null))[_0x9732('0x24')](removeEntity(_0x4e2217,null))['catch'](handleError(_0x4e2217,null));}; \ No newline at end of file +var _0xcde1=['where','pick','filter','merge','type','key','VIRTUAL','field','options','includeAll','include','findAll','show','keys','rawAttributes','find','catch','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Pauses','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','params','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','lodash','squel','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','then','destroy','error','name','send','index','Pause','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xcde1,0x16a));var _0x1cde=function(_0x1246de,_0x388a04){_0x1246de=_0x1246de-0x0;var _0x1d8126=_0xcde1[_0x1246de];return _0x1d8126;};'use strict';var pdf=require(_0x1cde('0x0'));var emlformat=require(_0x1cde('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x1cde('0x2'));var jsonpatch=require(_0x1cde('0x3'));var rp=require(_0x1cde('0x4'));var moment=require(_0x1cde('0x5'));var BPromise=require(_0x1cde('0x6'));var Mustache=require(_0x1cde('0x7'));var util=require(_0x1cde('0x8'));var path=require('path');var sox=require(_0x1cde('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x1cde('0xa'));var squel=require(_0x1cde('0xb'));var crypto=require('crypto');var jsforce=require(_0x1cde('0xc'));var deskjs=require(_0x1cde('0xd'));var toCsv=require(_0x1cde('0xe'));var querystring=require(_0x1cde('0xf'));var Papa=require('papaparse');var Redis=require(_0x1cde('0x10'));var authService=require(_0x1cde('0x11'));var qs=require(_0x1cde('0x12'));var as=require(_0x1cde('0x13'));var hardwareService=require(_0x1cde('0x14'));var logger=require('../../config/logger')(_0x1cde('0x15'));var utils=require(_0x1cde('0x16'));var config=require('../../config/environment');var db=require(_0x1cde('0x17'))['db'];function respondWithStatusCode(_0xb75c6,_0x507c21){_0x507c21=_0x507c21||0xcc;return function(_0x4a4986){if(_0x4a4986){return _0xb75c6[_0x1cde('0x18')](_0x507c21);}return _0xb75c6[_0x1cde('0x19')](_0x507c21)[_0x1cde('0x1a')]();};}function respondWithResult(_0x39d9d9,_0x6eb0a){_0x6eb0a=_0x6eb0a||0xc8;return function(_0x207575){if(_0x207575){return _0x39d9d9[_0x1cde('0x19')](_0x6eb0a)[_0x1cde('0x1b')](_0x207575);}};}function respondWithFilteredResult(_0x58993e,_0x4d8c66){return function(_0x2a08fb){if(_0x2a08fb){var _0x1fc16f=_0x2a08fb[_0x1cde('0x1c')],_0x1f5a14=_0x4d8c66['offset'],_0x196566=_0x4d8c66[_0x1cde('0x1d')]+_0x4d8c66[_0x1cde('0x1e')],_0x2b2706;if(_0x196566>=_0x1fc16f){_0x196566=_0x1fc16f;_0x2b2706=0xc8;}else{_0x2b2706=0xce;}_0x58993e[_0x1cde('0x19')](_0x2b2706);return _0x58993e[_0x1cde('0x1f')](_0x1cde('0x20'),_0x1f5a14+'-'+_0x196566+'/'+_0x1fc16f)[_0x1cde('0x1b')](_0x2a08fb);}return null;};}function patchUpdates(_0x5504b8){return function(_0x2b63aa){try{jsonpatch[_0x1cde('0x21')](_0x2b63aa,_0x5504b8,!![]);}catch(_0x404d59){return BPromise[_0x1cde('0x22')](_0x404d59);}return _0x2b63aa[_0x1cde('0x23')]();};}function saveUpdates(_0xd5955a,_0x3fca15){return function(_0x5773a0){if(_0x5773a0){return _0x5773a0['update'](_0xd5955a)[_0x1cde('0x24')](function(_0xb2f2b3){return _0xb2f2b3;});}return null;};}function removeEntity(_0x1d821d,_0x420945){return function(_0x54114a){if(_0x54114a){return _0x54114a[_0x1cde('0x25')]()[_0x1cde('0x24')](function(){var _0x8ef48=_0x54114a['get']({'plain':!![]});var _0x1cf039='Pauses';return db['UserProfileResource'][_0x1cde('0x25')]({'where':{'type':_0x1cf039,'resourceId':_0x8ef48['id']}})[_0x1cde('0x24')](function(){return _0x54114a;});})[_0x1cde('0x24')](function(){_0x1d821d[_0x1cde('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x65a430,_0x301f80){return function(_0xf9b851){if(!_0xf9b851){_0x65a430[_0x1cde('0x18')](0x194);}return _0xf9b851;};}function handleError(_0x57647e,_0x17ed9d){_0x17ed9d=_0x17ed9d||0x1f4;return function(_0x5fe0aa){logger[_0x1cde('0x26')](_0x5fe0aa['stack']);if(_0x5fe0aa[_0x1cde('0x27')]){delete _0x5fe0aa[_0x1cde('0x27')];}_0x57647e[_0x1cde('0x19')](_0x17ed9d)[_0x1cde('0x28')](_0x5fe0aa);};}exports[_0x1cde('0x29')]=function(_0x25756e,_0x13ed34){var _0x21cedb={},_0x1d4a1a={},_0xec1675={'count':0x0,'rows':[]};var _0x53cbdc=db[_0x1cde('0x2a')]['rawAttributes'];_0x1d4a1a[_0x1cde('0x2b')]=_['keys'](_0x53cbdc);_0x1d4a1a[_0x1cde('0x2c')]=_['keys'](_0x25756e[_0x1cde('0x2c')]);_0x1d4a1a[_0x1cde('0x2d')]=_[_0x1cde('0x2e')](_0x1d4a1a[_0x1cde('0x2b')],_0x1d4a1a['query']);_0x21cedb['attributes']=_['intersection'](_0x1d4a1a[_0x1cde('0x2b')],qs[_0x1cde('0x2f')](_0x25756e['query'][_0x1cde('0x2f')]));_0x21cedb[_0x1cde('0x30')]=_0x21cedb[_0x1cde('0x30')][_0x1cde('0x31')]?_0x21cedb[_0x1cde('0x30')]:_0x1d4a1a[_0x1cde('0x2b')];if(!_0x25756e[_0x1cde('0x2c')][_0x1cde('0x32')]('nolimit')){_0x21cedb['limit']=qs[_0x1cde('0x1e')](_0x25756e[_0x1cde('0x2c')]['limit']);_0x21cedb[_0x1cde('0x1d')]=qs[_0x1cde('0x1d')](_0x25756e[_0x1cde('0x2c')][_0x1cde('0x1d')]);}_0x21cedb[_0x1cde('0x33')]=qs['sort'](_0x25756e[_0x1cde('0x2c')][_0x1cde('0x34')]);_0x21cedb[_0x1cde('0x35')]=qs[_0x1cde('0x2d')](_[_0x1cde('0x36')](_0x25756e['query'],_0x1d4a1a['filters']));if(_0x25756e[_0x1cde('0x2c')][_0x1cde('0x37')]){_0x21cedb[_0x1cde('0x35')]=_[_0x1cde('0x38')](_0x21cedb[_0x1cde('0x35')],{'$or':_['map'](_0x53cbdc,function(_0x390694){if(_0x390694[_0x1cde('0x39')][_0x1cde('0x3a')]!==_0x1cde('0x3b')){var _0x2cf1ac={};_0x2cf1ac[_0x390694[_0x1cde('0x3c')]]={'$like':'%'+_0x25756e['query'][_0x1cde('0x37')]+'%'};return _0x2cf1ac;}})});}_0x21cedb=_[_0x1cde('0x38')]({},_0x21cedb,_0x25756e[_0x1cde('0x3d')]);var _0xc1a6d9={'where':_0x21cedb[_0x1cde('0x35')]};return db[_0x1cde('0x2a')][_0x1cde('0x1c')](_0xc1a6d9)[_0x1cde('0x24')](function(_0x2e2354){_0xec1675['count']=_0x2e2354;if(_0x25756e[_0x1cde('0x2c')][_0x1cde('0x3e')]){_0x21cedb[_0x1cde('0x3f')]=[{'all':!![]}];}return db[_0x1cde('0x2a')][_0x1cde('0x40')](_0x21cedb);})[_0x1cde('0x24')](function(_0x2c326d){_0xec1675['rows']=_0x2c326d;return _0xec1675;})[_0x1cde('0x24')](respondWithFilteredResult(_0x13ed34,_0x21cedb))['catch'](handleError(_0x13ed34,null));};exports[_0x1cde('0x41')]=function(_0x42e603,_0x117318){var _0x679e6b={'raw':!![],'where':{'id':_0x42e603['params']['id']}},_0x170ca9={};_0x170ca9[_0x1cde('0x2b')]=_[_0x1cde('0x42')](db['Pause'][_0x1cde('0x43')]);_0x170ca9['query']=_[_0x1cde('0x42')](_0x42e603['query']);_0x170ca9[_0x1cde('0x2d')]=_[_0x1cde('0x2e')](_0x170ca9[_0x1cde('0x2b')],_0x170ca9['query']);_0x679e6b[_0x1cde('0x30')]=_[_0x1cde('0x2e')](_0x170ca9[_0x1cde('0x2b')],qs[_0x1cde('0x2f')](_0x42e603['query']['fields']));_0x679e6b[_0x1cde('0x30')]=_0x679e6b[_0x1cde('0x30')][_0x1cde('0x31')]?_0x679e6b[_0x1cde('0x30')]:_0x170ca9[_0x1cde('0x2b')];if(_0x42e603[_0x1cde('0x2c')][_0x1cde('0x3e')]){_0x679e6b[_0x1cde('0x3f')]=[{'all':!![]}];}_0x679e6b=_[_0x1cde('0x38')]({},_0x679e6b,_0x42e603['options']);return db['Pause'][_0x1cde('0x44')](_0x679e6b)['then'](handleEntityNotFound(_0x117318,null))[_0x1cde('0x24')](respondWithResult(_0x117318,null))[_0x1cde('0x45')](handleError(_0x117318,null));};exports['create']=function(_0x5ba137,_0x580b61){return db['Pause'][_0x1cde('0x46')](_0x5ba137['body'],{})[_0x1cde('0x24')](function(_0x402c0d){var _0x170571=_0x5ba137[_0x1cde('0x47')][_0x1cde('0x48')]({'plain':!![]});if(!_0x170571)throw new Error(_0x1cde('0x49'));if(_0x170571[_0x1cde('0x4a')]===_0x1cde('0x47')){var _0x32f6ef=_0x402c0d[_0x1cde('0x48')]({'plain':!![]});var _0x171765=_0x1cde('0x4b');return db[_0x1cde('0x4c')][_0x1cde('0x44')]({'where':{'name':_0x171765,'userProfileId':_0x170571[_0x1cde('0x4d')]},'raw':!![]})[_0x1cde('0x24')](function(_0x42c1f3){if(_0x42c1f3&&_0x42c1f3['autoAssociation']===0x0){return db[_0x1cde('0x4e')]['create']({'name':_0x32f6ef[_0x1cde('0x27')],'resourceId':_0x32f6ef['id'],'type':_0x42c1f3[_0x1cde('0x27')],'sectionId':_0x42c1f3['id']},{})[_0x1cde('0x24')](function(){return _0x402c0d;});}else{return _0x402c0d;}})[_0x1cde('0x45')](function(_0xe77065){logger[_0x1cde('0x26')](_0x1cde('0x4f'),_0xe77065);throw _0xe77065;});}return _0x402c0d;})[_0x1cde('0x24')](respondWithResult(_0x580b61,0xc9))[_0x1cde('0x45')](handleError(_0x580b61,null));};exports[_0x1cde('0x50')]=function(_0x369563,_0x585e5f){if(_0x369563[_0x1cde('0x51')]['id']){delete _0x369563['body']['id'];}return db[_0x1cde('0x2a')][_0x1cde('0x44')]({'where':{'id':_0x369563['params']['id']}})['then'](handleEntityNotFound(_0x585e5f,null))[_0x1cde('0x24')](saveUpdates(_0x369563[_0x1cde('0x51')],null))[_0x1cde('0x24')](respondWithResult(_0x585e5f,null))['catch'](handleError(_0x585e5f,null));};exports['destroy']=function(_0x5d436c,_0x1055b9){return db[_0x1cde('0x2a')][_0x1cde('0x44')]({'where':{'id':_0x5d436c[_0x1cde('0x52')]['id']}})[_0x1cde('0x24')](handleEntityNotFound(_0x1055b9,null))[_0x1cde('0x24')](removeEntity(_0x1055b9,null))['catch'](handleError(_0x1055b9,null));}; \ No newline at end of file diff --git a/server/api/pause/pause.model.js b/server/api/pause/pause.model.js index 81c63ad..647b820 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 _0xbee0=['moment','bluebird','request-promise','path','rimraf','define','Pause','util','../../config/logger','api'];(function(_0x2bc7d5,_0x5825a4){var _0x3b8775=function(_0x45ef61){while(--_0x45ef61){_0x2bc7d5['push'](_0x2bc7d5['shift']());}};_0x3b8775(++_0x5825a4);}(_0xbee0,0x147));var _0x0bee=function(_0x4dbc61,_0x859279){_0x4dbc61=_0x4dbc61-0x0;var _0x5f1764=_0xbee0[_0x4dbc61];return _0x5f1764;};'use strict';var _=require('lodash');var util=require(_0x0bee('0x0'));var logger=require(_0x0bee('0x1'))(_0x0bee('0x2'));var moment=require(_0x0bee('0x3'));var BPromise=require(_0x0bee('0x4'));var rp=require(_0x0bee('0x5'));var fs=require('fs');var path=require(_0x0bee('0x6'));var rimraf=require(_0x0bee('0x7'));var config=require('../../config/environment');var attributes=require('./pause.attributes');module['exports']=function(_0xd0c8f,_0xa3a091){return _0xd0c8f[_0x0bee('0x8')](_0x0bee('0x9'),attributes,{'tableName':'tools_pauses','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xde9f=['lodash','api','moment','request-promise','path','../../config/environment','./pause.attributes','exports','Pause','tools_pauses'];(function(_0x13ff53,_0x5e1424){var _0x290228=function(_0x3e3133){while(--_0x3e3133){_0x13ff53['push'](_0x13ff53['shift']());}};_0x290228(++_0x5e1424);}(_0xde9f,0x118));var _0xfde9=function(_0x2b81be,_0x544bdf){_0x2b81be=_0x2b81be-0x0;var _0x8ed4a7=_0xde9f[_0x2b81be];return _0x8ed4a7;};'use strict';var _=require(_0xfde9('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xfde9('0x1'));var moment=require(_0xfde9('0x2'));var BPromise=require('bluebird');var rp=require(_0xfde9('0x3'));var fs=require('fs');var path=require(_0xfde9('0x4'));var rimraf=require('rimraf');var config=require(_0xfde9('0x5'));var attributes=require(_0xfde9('0x6'));module[_0xfde9('0x7')]=function(_0xe30eaf,_0x5e69c0){return _0xe30eaf['define'](_0xfde9('0x8'),attributes,{'tableName':_0xfde9('0x9'),'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 673b0d2..ef2e962 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 _0xff2e=['stringify','catch','moment','ioredis','../../mysqldb','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug','error','code','Pause,\x20%s,\x20%s','message','info','result','ShowPause','Pause','find','raw','options','where','attributes','include','map','model'];(function(_0x3b2a16,_0x34e7d8){var _0x1646be=function(_0x132804){while(--_0x132804){_0x3b2a16['push'](_0x3b2a16['shift']());}};_0x1646be(++_0x34e7d8);}(_0xff2e,0x198));var _0xeff2=function(_0x2f6aa7,_0x15b799){_0x2f6aa7=_0x2f6aa7-0x0;var _0x4e84aa=_0xff2e[_0x2f6aa7];return _0x4e84aa;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xeff2('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xeff2('0x1'));var db=require(_0xeff2('0x2'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xeff2('0x3'));var jayson=require(_0xeff2('0x4'));var client=jayson[_0xeff2('0x5')][_0xeff2('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x57700a,_0x27e51c,_0x3722d5){return new BPromise(function(_0x1cc523,_0x21a078){return client[_0xeff2('0x7')](_0x57700a,_0x3722d5)[_0xeff2('0x8')](function(_0x521a72){logger['info']('Pause,\x20%s,\x20%s',_0x27e51c,_0xeff2('0x9'));logger[_0xeff2('0xa')]('Pause,\x20%s,\x20%s,\x20%s',_0x27e51c,_0xeff2('0x9'),JSON['stringify'](_0x521a72));if(_0x521a72[_0xeff2('0xb')]){if(_0x521a72['error'][_0xeff2('0xc')]===0x1f4){logger['error'](_0xeff2('0xd'),_0x27e51c,_0x521a72[_0xeff2('0xb')][_0xeff2('0xe')]);return _0x21a078(_0x521a72['error'][_0xeff2('0xe')]);}logger[_0xeff2('0xb')](_0xeff2('0xd'),_0x27e51c,_0x521a72[_0xeff2('0xb')][_0xeff2('0xe')]);return _0x1cc523(_0x521a72['error'][_0xeff2('0xe')]);}else{logger[_0xeff2('0xf')](_0xeff2('0xd'),_0x27e51c,'request\x20sent');_0x1cc523(_0x521a72[_0xeff2('0x10')][_0xeff2('0xe')]);}})['catch'](function(_0xa43606){logger['error'](_0xeff2('0xd'),_0x27e51c,_0xa43606);_0x21a078(_0xa43606);});});}exports[_0xeff2('0x11')]=function(_0x278536){var _0x3144e6=this;return new Promise(function(_0xff8247,_0x168cd3){return db[_0xeff2('0x12')][_0xeff2('0x13')]({'raw':_0x278536['options']?_0x278536['options'][_0xeff2('0x14')]===undefined?!![]:![]:!![],'where':_0x278536[_0xeff2('0x15')]?_0x278536['options'][_0xeff2('0x16')]||null:null,'attributes':_0x278536[_0xeff2('0x15')]?_0x278536[_0xeff2('0x15')][_0xeff2('0x17')]||null:null,'include':_0x278536['options']?_0x278536[_0xeff2('0x15')][_0xeff2('0x18')]?_[_0xeff2('0x19')](_0x278536[_0xeff2('0x15')]['include'],function(_0x53a845){return{'model':db[_0x53a845['model']],'as':_0x53a845['as'],'attributes':_0x53a845[_0xeff2('0x17')],'include':_0x53a845[_0xeff2('0x18')]?_['map'](_0x53a845[_0xeff2('0x18')],function(_0xfc4ff8){return{'model':db[_0xfc4ff8[_0xeff2('0x1a')]],'as':_0xfc4ff8['as'],'attributes':_0xfc4ff8['attributes'],'include':_0xfc4ff8[_0xeff2('0x18')]?_[_0xeff2('0x19')](_0xfc4ff8['include'],function(_0x3e73b7){return{'model':db[_0x3e73b7[_0xeff2('0x1a')]],'as':_0x3e73b7['as'],'attributes':_0x3e73b7['attributes']};}):[]};}):[]};}):[]:[]})[_0xeff2('0x8')](function(_0xa004ff){logger[_0xeff2('0xf')](_0xeff2('0x11'),_0x278536);logger[_0xeff2('0xa')](_0xeff2('0x11'),_0x278536,JSON[_0xeff2('0x1b')](_0xa004ff));_0xff8247(_0xa004ff);})[_0xeff2('0x1c')](function(_0x8aa94a){logger[_0xeff2('0xb')](_0xeff2('0x11'),_0x8aa94a[_0xeff2('0xe')],_0x278536);_0x168cd3(_0x3144e6[_0xeff2('0xb')](0x1f4,_0x8aa94a['message']));});});}; \ No newline at end of file +var _0x1333=['client','http','request','then','debug','Pause,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','Pause,\x20%s,\x20%s','message','result','catch','ShowPause','Pause','find','options','where','attributes','include','map','model','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x3d1083,_0x4de90a){var _0xb7f0c5=function(_0x65e4d2){while(--_0x65e4d2){_0x3d1083['push'](_0x3d1083['shift']());}};_0xb7f0c5(++_0x4de90a);}(_0x1333,0x137));var _0x3133=function(_0x3e3d3a,_0x564979){_0x3e3d3a=_0x3e3d3a-0x0;var _0x1de2eb=_0x1333[_0x3e3d3a];return _0x1de2eb;};'use strict';var _=require('lodash');var util=require(_0x3133('0x0'));var moment=require(_0x3133('0x1'));var BPromise=require('bluebird');var rs=require(_0x3133('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3133('0x3'))['db'];var utils=require(_0x3133('0x4'));var logger=require(_0x3133('0x5'))(_0x3133('0x6'));var config=require(_0x3133('0x7'));var jayson=require(_0x3133('0x8'));var client=jayson[_0x3133('0x9')][_0x3133('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x23d25d,_0xce7964,_0xdae6de){return new BPromise(function(_0x380db3,_0x3182b4){return client[_0x3133('0xb')](_0x23d25d,_0xdae6de)[_0x3133('0xc')](function(_0x1f6cdb){logger['info']('Pause,\x20%s,\x20%s',_0xce7964,'request\x20sent');logger[_0x3133('0xd')](_0x3133('0xe'),_0xce7964,_0x3133('0xf'),JSON[_0x3133('0x10')](_0x1f6cdb));if(_0x1f6cdb[_0x3133('0x11')]){if(_0x1f6cdb[_0x3133('0x11')][_0x3133('0x12')]===0x1f4){logger[_0x3133('0x11')](_0x3133('0x13'),_0xce7964,_0x1f6cdb[_0x3133('0x11')][_0x3133('0x14')]);return _0x3182b4(_0x1f6cdb[_0x3133('0x11')]['message']);}logger['error'](_0x3133('0x13'),_0xce7964,_0x1f6cdb[_0x3133('0x11')][_0x3133('0x14')]);return _0x380db3(_0x1f6cdb['error']['message']);}else{logger['info']('Pause,\x20%s,\x20%s',_0xce7964,'request\x20sent');_0x380db3(_0x1f6cdb[_0x3133('0x15')][_0x3133('0x14')]);}})[_0x3133('0x16')](function(_0x640abb){logger[_0x3133('0x11')](_0x3133('0x13'),_0xce7964,_0x640abb);_0x3182b4(_0x640abb);});});}exports[_0x3133('0x17')]=function(_0x8d90a0){var _0xc97f90=this;return new Promise(function(_0x20bb8f,_0x2f1d0f){return db[_0x3133('0x18')][_0x3133('0x19')]({'raw':_0x8d90a0['options']?_0x8d90a0[_0x3133('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x8d90a0[_0x3133('0x1a')]?_0x8d90a0[_0x3133('0x1a')][_0x3133('0x1b')]||null:null,'attributes':_0x8d90a0[_0x3133('0x1a')]?_0x8d90a0['options'][_0x3133('0x1c')]||null:null,'include':_0x8d90a0[_0x3133('0x1a')]?_0x8d90a0[_0x3133('0x1a')][_0x3133('0x1d')]?_[_0x3133('0x1e')](_0x8d90a0[_0x3133('0x1a')][_0x3133('0x1d')],function(_0x3d23ff){return{'model':db[_0x3d23ff[_0x3133('0x1f')]],'as':_0x3d23ff['as'],'attributes':_0x3d23ff[_0x3133('0x1c')],'include':_0x3d23ff[_0x3133('0x1d')]?_['map'](_0x3d23ff['include'],function(_0x25dc34){return{'model':db[_0x25dc34['model']],'as':_0x25dc34['as'],'attributes':_0x25dc34[_0x3133('0x1c')],'include':_0x25dc34[_0x3133('0x1d')]?_[_0x3133('0x1e')](_0x25dc34[_0x3133('0x1d')],function(_0x274a4b){return{'model':db[_0x274a4b[_0x3133('0x1f')]],'as':_0x274a4b['as'],'attributes':_0x274a4b[_0x3133('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x3133('0xc')](function(_0x4319cc){logger['info'](_0x3133('0x17'),_0x8d90a0);logger['debug']('ShowPause',_0x8d90a0,JSON[_0x3133('0x10')](_0x4319cc));_0x20bb8f(_0x4319cc);})[_0x3133('0x16')](function(_0x3cb770){logger[_0x3133('0x11')](_0x3133('0x17'),_0x3cb770[_0x3133('0x14')],_0x8d90a0);_0x2f1d0f(_0xc97f90[_0x3133('0x11')](0x1f4,_0x3cb770[_0x3133('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/index.js b/server/api/plugin/index.js index 1821583..d752040 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 _0x9321=['delete','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/webhook','webhookGet','/:id','show','download','diskStorage','join','root','server/files/plugins','originalname','replace','format','%s-%s%s','basename','extname','post','file','upload','put','update'];(function(_0x1f0679,_0x53d43c){var _0x3dc3a4=function(_0x49ba8f){while(--_0x49ba8f){_0x1f0679['push'](_0x1f0679['shift']());}};_0x3dc3a4(++_0x53d43c);}(_0x9321,0xe9));var _0x1932=function(_0x155338,_0x41ffdd){_0x155338=_0x155338-0x0;var _0x31e1d4=_0x9321[_0x155338];return _0x31e1d4;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x1932('0x0'));var express=require(_0x1932('0x1'));var router=express[_0x1932('0x2')]();var auth=require(_0x1932('0x3'));var interaction=require(_0x1932('0x4'));var config=require(_0x1932('0x5'));var controller=require('./plugin.controller');router[_0x1932('0x6')]('/',auth[_0x1932('0x7')](),controller['index']);router[_0x1932('0x6')](_0x1932('0x8'),controller[_0x1932('0x9')]);router[_0x1932('0x6')](_0x1932('0xa'),auth[_0x1932('0x7')](),controller[_0x1932('0xb')]);router[_0x1932('0x6')]('/:id/download',auth[_0x1932('0x7')](),controller[_0x1932('0xc')]);var upload=multer({'storage':multer[_0x1932('0xd')]({'destination':function(_0x3db69b,_0x26f1c2,_0xe10e10){_0xe10e10(null,path[_0x1932('0xe')](config[_0x1932('0xf')],_0x1932('0x10')));},'filename':function(_0x3124a8,_0x1bf87b,_0x298b79){_0x1bf87b['originalname']=_0x1bf87b[_0x1932('0x11')][_0x1932('0x12')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x298b79(null,util[_0x1932('0x13')](_0x1932('0x14'),path[_0x1932('0x15')](_0x1bf87b['originalname'],path['extname'](_0x1bf87b['originalname'])),Date['now'](),path[_0x1932('0x16')](_0x1bf87b['originalname'])));}})});router[_0x1932('0x17')]('/',upload['single'](_0x1932('0x18')),controller[_0x1932('0x19')]);router[_0x1932('0x17')]('/webhook',controller['webhookPost']);router[_0x1932('0x1a')](_0x1932('0xa'),auth['isAuthenticated'](),controller[_0x1932('0x1b')]);router[_0x1932('0x1c')](_0x1932('0xa'),auth[_0x1932('0x7')](),controller['delete']);module['exports']=router; \ No newline at end of file +var _0xdd64=['/:id','show','/:id/download','download','diskStorage','join','root','server/files/plugins','originalname','format','%s-%s%s','extname','now','post','single','file','upload','webhookPost','put','update','delete','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./plugin.controller','isAuthenticated','index','get','/webhook','webhookGet'];(function(_0x17588d,_0x17c11f){var _0x3c4aec=function(_0x529f74){while(--_0x529f74){_0x17588d['push'](_0x17588d['shift']());}};_0x3c4aec(++_0x17c11f);}(_0xdd64,0x103));var _0x4dd6=function(_0x4f0551,_0x3e77dc){_0x4f0551=_0x4f0551-0x0;var _0x16c6c4=_0xdd64[_0x4f0551];return _0x16c6c4;};'use strict';var multer=require(_0x4dd6('0x0'));var util=require(_0x4dd6('0x1'));var path=require(_0x4dd6('0x2'));var timeout=require(_0x4dd6('0x3'));var express=require(_0x4dd6('0x4'));var router=express['Router']();var auth=require(_0x4dd6('0x5'));var interaction=require(_0x4dd6('0x6'));var config=require('../../config/environment');var controller=require(_0x4dd6('0x7'));router['get']('/',auth[_0x4dd6('0x8')](),controller[_0x4dd6('0x9')]);router[_0x4dd6('0xa')](_0x4dd6('0xb'),controller[_0x4dd6('0xc')]);router[_0x4dd6('0xa')](_0x4dd6('0xd'),auth[_0x4dd6('0x8')](),controller[_0x4dd6('0xe')]);router[_0x4dd6('0xa')](_0x4dd6('0xf'),auth[_0x4dd6('0x8')](),controller[_0x4dd6('0x10')]);var upload=multer({'storage':multer[_0x4dd6('0x11')]({'destination':function(_0x1229df,_0x40145d,_0x59cffd){_0x59cffd(null,path[_0x4dd6('0x12')](config[_0x4dd6('0x13')],_0x4dd6('0x14')));},'filename':function(_0x4e5357,_0x229b0f,_0x56e8ed){_0x229b0f[_0x4dd6('0x15')]=_0x229b0f[_0x4dd6('0x15')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x56e8ed(null,util[_0x4dd6('0x16')](_0x4dd6('0x17'),path['basename'](_0x229b0f[_0x4dd6('0x15')],path[_0x4dd6('0x18')](_0x229b0f['originalname'])),Date[_0x4dd6('0x19')](),path[_0x4dd6('0x18')](_0x229b0f[_0x4dd6('0x15')])));}})});router[_0x4dd6('0x1a')]('/',upload[_0x4dd6('0x1b')](_0x4dd6('0x1c')),controller[_0x4dd6('0x1d')]);router[_0x4dd6('0x1a')]('/webhook',controller[_0x4dd6('0x1e')]);router[_0x4dd6('0x1f')](_0x4dd6('0xd'),auth[_0x4dd6('0x8')](),controller[_0x4dd6('0x20')]);router[_0x4dd6('0x21')]('/:id',auth[_0x4dd6('0x8')](),controller[_0x4dd6('0x21')]);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 58a9019..f278e11 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 _0x0988=['agentOnly','always','never','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize','exports','STRING','ENUM','html','script','TEXT','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','BOOLEAN','adminOnly'];(function(_0x207a02,_0x278c56){var _0xd995c3=function(_0x24e415){while(--_0x24e415){_0x207a02['push'](_0x207a02['shift']());}};_0xd995c3(++_0x278c56);}(_0x0988,0x10e));var _0x8098=function(_0xb61433,_0x31d758){_0xb61433=_0xb61433-0x0;var _0x123400=_0x0988[_0xb61433];return _0x123400;};'use strict';var Sequelize=require(_0x8098('0x0'));module[_0x8098('0x1')]={'name':{'type':Sequelize[_0x8098('0x2')]},'type':{'type':Sequelize[_0x8098('0x3')](_0x8098('0x4'),_0x8098('0x5'))},'description':{'type':Sequelize[_0x8098('0x6')]},'version':{'type':Sequelize['TEXT']},'path':{'type':Sequelize[_0x8098('0x2')],'comment':_0x8098('0x7')},'active':{'type':Sequelize[_0x8098('0x8')],'defaultValue':0x0,'comment':'Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.'},'sidebar':{'type':Sequelize[_0x8098('0x3')](_0x8098('0x9'),_0x8098('0xa'),_0x8098('0xb'),_0x8098('0xc')),'defaultValue':_0x8098('0xb'),'comment':_0x8098('0xd')},'icon':{'type':Sequelize[_0x8098('0x2')]},'adminUrl':{'type':Sequelize[_0x8098('0x2')]},'agentUrl':{'type':Sequelize[_0x8098('0x2')]},'scriptName':{'type':Sequelize[_0x8098('0x2')]},'scriptPath':{'type':Sequelize[_0x8098('0x2')]}}; \ No newline at end of file +var _0xca98=['ENUM','html','script','TEXT','adminOnly','always','sequelize','exports','STRING'];(function(_0x4da2a6,_0x261779){var _0x2a9788=function(_0x136404){while(--_0x136404){_0x4da2a6['push'](_0x4da2a6['shift']());}};_0x2a9788(++_0x261779);}(_0xca98,0xf9));var _0x8ca9=function(_0x595013,_0x65a215){_0x595013=_0x595013-0x0;var _0x2a29e3=_0xca98[_0x595013];return _0x2a29e3;};'use strict';var Sequelize=require(_0x8ca9('0x0'));module[_0x8ca9('0x1')]={'name':{'type':Sequelize[_0x8ca9('0x2')]},'type':{'type':Sequelize[_0x8ca9('0x3')](_0x8ca9('0x4'),_0x8ca9('0x5'))},'description':{'type':Sequelize[_0x8ca9('0x6')]},'version':{'type':Sequelize[_0x8ca9('0x6')]},'path':{'type':Sequelize[_0x8ca9('0x2')],'comment':'The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.'},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':'Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.'},'sidebar':{'type':Sequelize[_0x8ca9('0x3')](_0x8ca9('0x7'),'agentOnly','always','never'),'defaultValue':_0x8ca9('0x8'),'comment':'Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.'},'icon':{'type':Sequelize[_0x8ca9('0x2')]},'adminUrl':{'type':Sequelize['STRING']},'agentUrl':{'type':Sequelize[_0x8ca9('0x2')]},'scriptName':{'type':Sequelize['STRING']},'scriptPath':{'type':Sequelize[_0x8ca9('0x2')]}}; \ No newline at end of file diff --git a/server/api/plugin/plugin.controller.js b/server/api/plugin/plugin.controller.js index 6bd44ca..11ba67b 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 _0xe438=['./plugin.socket','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','update','then','destroy','Plugins','end','stack','name','send','Plugin','rawAttributes','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','map','key','VIRTUAL','field','options','includeAll','include','findAll','catch','show','find','download','server/files/plugins','format','%s.zip','basename','createWriteStream','zip','warning','ENOENT','error','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','pipe','glob','**/*','root','dirname','join','attachments/**/*','finalize','existsSync','Plugin\x20not\x20found','Error\x20while\x20downloading\x20the\x20plugin','info','Download\x20completed','Temporary\x20file\x20removed','upload','file','filename','Plugin\x20upload\x20destination:\x20%s','0777','readdirSync','Invalid\x20plugin\x20structure','isFile','isDirectory','some','manifest.json','Plugin\x20manifest\x20missing','readFileSync','parse','undefined','Invalid\x20manifest:\x20name\x20missing','type','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:\x20invalid\x20type','description','sidebar','always','icon-apps','test','plugins','Warning:\x20agent\x20view\x20not\x20specified','scriptPath','create','body','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','unlinkSync','Extracted\x20folder\x20removed','params','delete','webhookGet','resolve','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','port','encoding','method','%s%s','headers','content-length','content-type','endsWith','statusCode','\x27PATH\x27\x20parameter\x20not\x20specified','http://localhost:','html-pdf','rimraf','zip-dir','request-promise','moment','bluebird','path','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','archiver','ioredis','../../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'];(function(_0x5278fc,_0x5d2972){var _0x432e22=function(_0x4da222){while(--_0x4da222){_0x5278fc['push'](_0x5278fc['shift']());}};_0x432e22(++_0x5d2972);}(_0xe438,0x1e3));var _0x8e43=function(_0x306a24,_0x29bcb4){_0x306a24=_0x306a24-0x0;var _0x3a4459=_0xe438[_0x306a24];return _0x3a4459;};'use strict';var pdf=require(_0x8e43('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x8e43('0x1'));var zipdir=require(_0x8e43('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8e43('0x3'));var moment=require(_0x8e43('0x4'));var BPromise=require(_0x8e43('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x8e43('0x6'));var sox=require(_0x8e43('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x8e43('0x8'));var squel=require(_0x8e43('0x9'));var crypto=require(_0x8e43('0xa'));var jsforce=require(_0x8e43('0xb'));var deskjs=require(_0x8e43('0xc'));var toCsv=require(_0x8e43('0xd'));var querystring=require(_0x8e43('0xe'));var Papa=require(_0x8e43('0xf'));var extract=require('extract-zip');var rimraf=require(_0x8e43('0x1'));var archiver=require(_0x8e43('0x10'));var Redis=require(_0x8e43('0x11'));var authService=require(_0x8e43('0x12'));var qs=require(_0x8e43('0x13'));var as=require(_0x8e43('0x14'));var hardwareService=require(_0x8e43('0x15'));var logger=require(_0x8e43('0x16'))(_0x8e43('0x17'));var utils=require(_0x8e43('0x18'));var config=require(_0x8e43('0x19'));var db=require(_0x8e43('0x1a'))['db'];config[_0x8e43('0x1b')]=_[_0x8e43('0x1c')](config[_0x8e43('0x1b')],{'host':'localhost','port':0x18eb});var socket=require(_0x8e43('0x1d'))(new Redis(config[_0x8e43('0x1b')]));require(_0x8e43('0x1e'))['register'](socket);function respondWithStatusCode(_0x5e2efc,_0x2fd7c0){_0x2fd7c0=_0x2fd7c0||0xcc;return function(_0x43ff69){if(_0x43ff69){return _0x5e2efc[_0x8e43('0x1f')](_0x2fd7c0);}return _0x5e2efc[_0x8e43('0x20')](_0x2fd7c0)['end']();};}function respondWithResult(_0x18bc1c,_0xd9c2bb){_0xd9c2bb=_0xd9c2bb||0xc8;return function(_0x1afdbc){if(_0x1afdbc){return _0x18bc1c[_0x8e43('0x20')](_0xd9c2bb)[_0x8e43('0x21')](_0x1afdbc);}};}function respondWithFilteredResult(_0x43d1bd,_0x175c1f){return function(_0x471ada){if(_0x471ada){var _0x3c5259=_0x471ada[_0x8e43('0x22')],_0x2b4b4c=_0x175c1f['offset'],_0x594455=_0x175c1f[_0x8e43('0x23')]+_0x175c1f[_0x8e43('0x24')],_0x5153b4;if(_0x594455>=_0x3c5259){_0x594455=_0x3c5259;_0x5153b4=0xc8;}else{_0x5153b4=0xce;}_0x43d1bd[_0x8e43('0x20')](_0x5153b4);return _0x43d1bd[_0x8e43('0x25')](_0x8e43('0x26'),_0x2b4b4c+'-'+_0x594455+'/'+_0x3c5259)[_0x8e43('0x21')](_0x471ada);}return null;};}function patchUpdates(_0x33735f){return function(_0x2b7ebb){try{jsonpatch[_0x8e43('0x27')](_0x2b7ebb,_0x33735f,!![]);}catch(_0x1372eb){return BPromise[_0x8e43('0x28')](_0x1372eb);}return _0x2b7ebb['save']();};}function saveUpdates(_0x27cb84,_0x361a22){return function(_0x21220a){if(_0x21220a){return _0x21220a[_0x8e43('0x29')](_0x27cb84)[_0x8e43('0x2a')](function(_0x48b169){return _0x48b169;});}return null;};}function removeEntity(_0x505251,_0x4b8784){return function(_0x5308c5){if(_0x5308c5){return _0x5308c5[_0x8e43('0x2b')]()[_0x8e43('0x2a')](function(){var _0x563e4f=_0x5308c5['get']({'plain':!![]});var _0x362812=_0x8e43('0x2c');return db['UserProfileResource'][_0x8e43('0x2b')]({'where':{'type':_0x362812,'resourceId':_0x563e4f['id']}})[_0x8e43('0x2a')](function(){return _0x5308c5;});})[_0x8e43('0x2a')](function(){_0x505251['status'](0xcc)[_0x8e43('0x2d')]();});}};}function handleEntityNotFound(_0x5464aa,_0x35b73a){return function(_0x2595c4){if(!_0x2595c4){_0x5464aa[_0x8e43('0x1f')](0x194);}return _0x2595c4;};}function handleError(_0xfc95f2,_0x5999dc){_0x5999dc=_0x5999dc||0x1f4;return function(_0x4594e9){logger['error'](_0x4594e9[_0x8e43('0x2e')]);if(_0x4594e9['name']){delete _0x4594e9[_0x8e43('0x2f')];}_0xfc95f2[_0x8e43('0x20')](_0x5999dc)[_0x8e43('0x30')](_0x4594e9);};}exports['index']=function(_0x53aeb3,_0x5793bd){var _0x4bb404={},_0x32fa4f={},_0x170f85={'count':0x0,'rows':[]};var _0x30e7b5=db[_0x8e43('0x31')][_0x8e43('0x32')];_0x32fa4f[_0x8e43('0x33')]=_[_0x8e43('0x34')](_0x30e7b5);_0x32fa4f[_0x8e43('0x35')]=_[_0x8e43('0x34')](_0x53aeb3['query']);_0x32fa4f[_0x8e43('0x36')]=_['intersection'](_0x32fa4f[_0x8e43('0x33')],_0x32fa4f[_0x8e43('0x35')]);_0x4bb404[_0x8e43('0x37')]=_[_0x8e43('0x38')](_0x32fa4f[_0x8e43('0x33')],qs['fields'](_0x53aeb3['query'][_0x8e43('0x39')]));_0x4bb404[_0x8e43('0x37')]=_0x4bb404['attributes'][_0x8e43('0x3a')]?_0x4bb404['attributes']:_0x32fa4f[_0x8e43('0x33')];if(!_0x53aeb3[_0x8e43('0x35')][_0x8e43('0x3b')](_0x8e43('0x3c'))){_0x4bb404[_0x8e43('0x24')]=qs[_0x8e43('0x24')](_0x53aeb3[_0x8e43('0x35')]['limit']);_0x4bb404['offset']=qs[_0x8e43('0x23')](_0x53aeb3['query'][_0x8e43('0x23')]);}_0x4bb404[_0x8e43('0x3d')]=qs[_0x8e43('0x3e')](_0x53aeb3[_0x8e43('0x35')][_0x8e43('0x3e')]);_0x4bb404['where']=qs[_0x8e43('0x36')](_[_0x8e43('0x3f')](_0x53aeb3[_0x8e43('0x35')],_0x32fa4f[_0x8e43('0x36')]));if(_0x53aeb3[_0x8e43('0x35')][_0x8e43('0x40')]){_0x4bb404[_0x8e43('0x41')]=_[_0x8e43('0x42')](_0x4bb404[_0x8e43('0x41')],{'$or':_[_0x8e43('0x43')](_0x30e7b5,function(_0x5a6946){if(_0x5a6946['type'][_0x8e43('0x44')]!==_0x8e43('0x45')){var _0x249fb8={};_0x249fb8[_0x5a6946[_0x8e43('0x46')]]={'$like':'%'+_0x53aeb3[_0x8e43('0x35')]['filter']+'%'};return _0x249fb8;}})});}_0x4bb404=_[_0x8e43('0x42')]({},_0x4bb404,_0x53aeb3[_0x8e43('0x47')]);var _0x17d383={'where':_0x4bb404[_0x8e43('0x41')]};return db[_0x8e43('0x31')][_0x8e43('0x22')](_0x17d383)[_0x8e43('0x2a')](function(_0x2f32a4){_0x170f85[_0x8e43('0x22')]=_0x2f32a4;if(_0x53aeb3[_0x8e43('0x35')][_0x8e43('0x48')]){_0x4bb404[_0x8e43('0x49')]=[{'all':!![]}];}return db[_0x8e43('0x31')][_0x8e43('0x4a')](_0x4bb404);})[_0x8e43('0x2a')](function(_0x437ea9){_0x170f85['rows']=_0x437ea9;return _0x170f85;})[_0x8e43('0x2a')](respondWithFilteredResult(_0x5793bd,_0x4bb404))[_0x8e43('0x4b')](handleError(_0x5793bd,null));};exports[_0x8e43('0x4c')]=function(_0x5beb82,_0x124596){var _0x11be4c={'raw':!![],'where':{'id':_0x5beb82['params']['id']}},_0x4c4ac6={};_0x4c4ac6[_0x8e43('0x33')]=_[_0x8e43('0x34')](db[_0x8e43('0x31')][_0x8e43('0x32')]);_0x4c4ac6[_0x8e43('0x35')]=_['keys'](_0x5beb82[_0x8e43('0x35')]);_0x4c4ac6[_0x8e43('0x36')]=_[_0x8e43('0x38')](_0x4c4ac6[_0x8e43('0x33')],_0x4c4ac6[_0x8e43('0x35')]);_0x11be4c[_0x8e43('0x37')]=_[_0x8e43('0x38')](_0x4c4ac6['model'],qs[_0x8e43('0x39')](_0x5beb82['query'][_0x8e43('0x39')]));_0x11be4c[_0x8e43('0x37')]=_0x11be4c[_0x8e43('0x37')][_0x8e43('0x3a')]?_0x11be4c[_0x8e43('0x37')]:_0x4c4ac6[_0x8e43('0x33')];if(_0x5beb82[_0x8e43('0x35')][_0x8e43('0x48')]){_0x11be4c[_0x8e43('0x49')]=[{'all':!![]}];}_0x11be4c=_['merge']({},_0x11be4c,_0x5beb82[_0x8e43('0x47')]);return db[_0x8e43('0x31')][_0x8e43('0x4d')](_0x11be4c)[_0x8e43('0x2a')](handleEntityNotFound(_0x124596,null))[_0x8e43('0x2a')](respondWithResult(_0x124596,null))['catch'](handleError(_0x124596,null));};exports[_0x8e43('0x4e')]=function(_0x3db39c,_0x1af68b,_0x28e3f0){return db[_0x8e43('0x31')][_0x8e43('0x4d')]({'where':{'id':_0x3db39c['params']['id']},'attributes':['name',_0x8e43('0x6')],'raw':!![]})[_0x8e43('0x2a')](handleEntityNotFound(_0x1af68b,null))['then'](function(_0x2904ea){if(_0x2904ea){var _0x7f99a9=path['join'](config['root'],_0x8e43('0x4f'),util[_0x8e43('0x50')](_0x8e43('0x51'),path[_0x8e43('0x52')](_0x2904ea[_0x8e43('0x6')])));var _0x55b73c=fs[_0x8e43('0x53')](_0x7f99a9);var _0x5900ae=archiver(_0x8e43('0x54'),{'zlib':{'level':0x9}});_0x5900ae['on'](_0x8e43('0x55'),function(_0xb6a4ed){if(_0xb6a4ed['code']===_0x8e43('0x56')){logger[_0x8e43('0x57')](_0xb6a4ed);}else{throw new db[(_0x8e43('0x58'))][(_0x8e43('0x59'))]('Error\x20while\x20generating\x20the\x20zip\x20archive');}});_0x5900ae['on'](_0x8e43('0x57'),function(_0x1cb03){throw new db[(_0x8e43('0x58'))][(_0x8e43('0x59'))](_0x8e43('0x5a'));});_0x5900ae[_0x8e43('0x5b')](_0x55b73c);_0x5900ae[_0x8e43('0x5c')](_0x8e43('0x5d'),{'cwd':path['join'](config[_0x8e43('0x5e')],_0x8e43('0x4f'),path[_0x8e43('0x5f')](_0x2904ea[_0x8e43('0x6')])),'ignore':[path['join'](path[_0x8e43('0x52')](_0x2904ea[_0x8e43('0x6')]),'node_modules/**/*'),path[_0x8e43('0x60')](path[_0x8e43('0x52')](_0x2904ea[_0x8e43('0x6')]),_0x8e43('0x61'))],'nodir':!![]})[_0x8e43('0x62')]();_0x55b73c['on']('close',function(){if(!fs[_0x8e43('0x63')](_0x7f99a9)){throw new db['Sequelize'][(_0x8e43('0x59'))](_0x8e43('0x64'));}return _0x1af68b[_0x8e43('0x4e')](_0x7f99a9,util['format']('%s.zip',path['basename'](_0x2904ea[_0x8e43('0x6')])),function(_0x364b23){if(_0x364b23){throw new db['Sequelize'][(_0x8e43('0x59'))](_0x8e43('0x65'));}fs['unlinkSync'](_0x7f99a9);logger[_0x8e43('0x66')](_0x8e43('0x67'));logger['info'](_0x8e43('0x68'));});});}return null;})['catch'](handleError(_0x1af68b,null));};exports[_0x8e43('0x69')]=function(_0x3713fe,_0x10f8db,_0x3c1331){var _0x51b025=path[_0x8e43('0x52')](_0x3713fe[_0x8e43('0x6a')][_0x8e43('0x6b')],path['extname'](_0x3713fe[_0x8e43('0x6a')]['filename']));var _0x4c5232=path['join'](config['root'],_0x8e43('0x4f'),_0x3713fe[_0x8e43('0x6a')][_0x8e43('0x6b')]);var _0x2a5152=path['join'](config[_0x8e43('0x5e')],_0x8e43('0x4f'),_0x51b025);logger[_0x8e43('0x66')]('Plugin\x20upload\x20filepath:\x20%s',_0x4c5232);logger[_0x8e43('0x66')](_0x8e43('0x6c'),_0x2a5152);try{fs['chmodSync'](_0x4c5232,parseInt(_0x8e43('0x6d'),0x8));extract(_0x4c5232,{'dir':_0x2a5152},function(_0x5e08ab){if(_0x5e08ab){logger[_0x8e43('0x57')](_0x5e08ab);handleError(_0x5e08ab,!![]);};var _0x51b491=fs[_0x8e43('0x6e')](_0x2a5152);if(_0x51b491[_0x8e43('0x3a')]>0x1){removeReferences(_0x4c5232,_0x2a5152);logger[_0x8e43('0x57')](_0x8e43('0x6f'));return _0x3c1331(new Error('Invalid\x20plugin\x20structure'));}var _0x3f4634=fs['lstatSync'](path[_0x8e43('0x60')](_0x2a5152,_0x51b491[0x0]));if(_0x3f4634[_0x8e43('0x70')]()){removeReferences(_0x4c5232,_0x2a5152);logger[_0x8e43('0x57')](_0x8e43('0x6f'));return _0x3c1331(new Error(_0x8e43('0x6f')));}if(_0x3f4634[_0x8e43('0x71')]()){var _0x2afe63=fs['readdirSync'](path['join'](_0x2a5152,_0x51b491[0x0]));if(_0x2afe63[_0x8e43('0x3a')]===0x0){removeReferences(_0x4c5232,_0x2a5152);logger[_0x8e43('0x57')](_0x8e43('0x6f'));return _0x3c1331(new Error('Invalid\x20plugin\x20structure'));}var _0x467e9e=_0x2afe63[_0x8e43('0x72')](function(_0x3a4a89){return _0x3a4a89===_0x8e43('0x73');});if(!_0x467e9e){return _0x3c1331(new Error(_0x8e43('0x74')));}var _0x266874=fs[_0x8e43('0x75')](path['join'](_0x2a5152,_0x51b491[0x0],_0x8e43('0x73')));var _0x241370=JSON[_0x8e43('0x76')](_0x266874);if(_0x8e43('0x77')==typeof _0x241370[_0x8e43('0x2f')]){return _0x3c1331(new Error(_0x8e43('0x78')));}if(_0x8e43('0x77')==typeof _0x241370[_0x8e43('0x79')]){return _0x3c1331(new Error('Invalid\x20manifest:\x20type\x20missing'));}if('undefined'==typeof _0x241370[_0x8e43('0x7a')]){return _0x3c1331(new Error(_0x8e43('0x7b')));}if(_0x8e43('0x77')==typeof _0x241370['parameters']){return _0x3c1331(new Error(_0x8e43('0x7c')));}if(_0x241370['type']===_0x8e43('0x7d')){if(_0x8e43('0x77')==typeof _0x241370[_0x8e43('0x7e')][_0x8e43('0x7f')]){return _0x3c1331(new Error(_0x8e43('0x80')));}if(_0x8e43('0x77')==typeof _0x241370[_0x8e43('0x7e')][_0x8e43('0x7f')][_0x8e43('0x81')]&&_0x8e43('0x77')==typeof _0x241370[_0x8e43('0x7e')][_0x8e43('0x7f')][_0x8e43('0x82')]){return _0x3c1331(new Error('Invalid\x20manifest:\x20no\x20view\x20specified'));}}else if(_0x241370[_0x8e43('0x79')]===_0x8e43('0x83')){if(_0x8e43('0x77')==typeof _0x241370[_0x8e43('0x7e')][_0x8e43('0x84')]){return _0x3c1331(new Error(_0x8e43('0x85')));}if('undefined'==typeof _0x241370['parameters']['scriptPath']){return _0x3c1331(new Error('Invalid\x20manifest:\x20script\x20path\x20missing'));}}else{return _0x3c1331(new Error(_0x8e43('0x86')));}var _0x2da747=_0x241370['name'];var _0x331327=_0x241370[_0x8e43('0x87')];var _0x1eb391=_0x241370[_0x8e43('0x79')];var _0xdd4e2b=_0x241370[_0x8e43('0x88')]?_0x241370[_0x8e43('0x88')]:_0x8e43('0x89');var _0x233c4f=_0x241370['icon']?_0x241370['icon']:_0x8e43('0x8a');var _0x4bbb6e='';var _0x5aa53f='';var _0xe15f41='';var _0x5d4716='';var _0x43a7c7=_0x241370['version'];if(_0x1eb391==='html'){if('undefined'!=typeof _0x241370[_0x8e43('0x7e')][_0x8e43('0x7f')][_0x8e43('0x81')]){var _0x4ff65c=_0x241370[_0x8e43('0x7e')][_0x8e43('0x7f')][_0x8e43('0x81')];if(!/^(f|ht)tps?:\/\//i[_0x8e43('0x8b')](_0x4ff65c)){_0x4bbb6e=path[_0x8e43('0x60')](_0x8e43('0x8c'),_0x51b025,_0x51b491[0x0],_0x4ff65c);}else{_0x4bbb6e=_0x4ff65c;}}else{logger[_0x8e43('0x66')]('Warning:\x20admin\x20view\x20not\x20specified');}if(_0x8e43('0x77')!=typeof _0x241370[_0x8e43('0x7e')][_0x8e43('0x7f')]['agent']){var _0x3ca1c9=_0x241370[_0x8e43('0x7e')][_0x8e43('0x7f')]['agent'];if(!/^(f|ht)tps?:\/\//i[_0x8e43('0x8b')](_0x3ca1c9)){_0x5aa53f=path[_0x8e43('0x60')](_0x8e43('0x8c'),_0x51b025,_0x51b491[0x0],_0x3ca1c9);}else{_0x5aa53f=_0x3ca1c9;}}else{logger[_0x8e43('0x66')](_0x8e43('0x8d'));}}else if(_0x1eb391===_0x8e43('0x83')){_0xe15f41=_0x241370[_0x8e43('0x7e')][_0x8e43('0x84')];_0x5d4716=_0x241370[_0x8e43('0x7e')][_0x8e43('0x8e')];if(_0x8e43('0x77')!=typeof _0x241370[_0x8e43('0x7e')][_0x8e43('0x7f')]){if(_0x8e43('0x77')!=typeof _0x241370['parameters'][_0x8e43('0x7f')][_0x8e43('0x81')]){var _0x4ff65c=_0x241370[_0x8e43('0x7e')][_0x8e43('0x7f')]['admin'];if(!/^(f|ht)tps?:\/\//i[_0x8e43('0x8b')](_0x4ff65c)){_0x4bbb6e=path[_0x8e43('0x60')](_0x8e43('0x8c'),_0x51b025,_0x51b491[0x0],_0x4ff65c);}else{_0x4bbb6e=_0x4ff65c;}}if(_0x8e43('0x77')!=typeof _0x241370['parameters'][_0x8e43('0x7f')][_0x8e43('0x82')]){var _0x3ca1c9=_0x241370[_0x8e43('0x7e')][_0x8e43('0x7f')][_0x8e43('0x82')];if(!/^(f|ht)tps?:\/\//i[_0x8e43('0x8b')](_0x3ca1c9)){_0x5aa53f=path[_0x8e43('0x60')](_0x8e43('0x8c'),_0x51b025,_0x51b491[0x0],_0x3ca1c9);}else{_0x5aa53f=_0x3ca1c9;}}}}var _0x25b5ec={'name':_0x2da747,'description':_0x331327,'path':path[_0x8e43('0x60')](_0x51b025,_0x51b491[0x0]),'type':_0x1eb391,'sidebar':_0xdd4e2b,'icon':_0x233c4f,'adminUrl':_0x4bbb6e,'agentUrl':_0x5aa53f,'scriptName':_0xe15f41,'scriptPath':_0x5d4716,'version':_0x43a7c7};removeReferences(_0x4c5232,null);return db[_0x8e43('0x31')][_0x8e43('0x8f')](_0x25b5ec)[_0x8e43('0x2a')](function(_0x2b7333){var _0x24ef32={'role':_0x3713fe[_0x8e43('0x90')]['role'],'userProfileId':_0x3713fe[_0x8e43('0x90')][_0x8e43('0x91')]};if(!_0x24ef32)throw new Error(_0x8e43('0x92'));if(_0x24ef32['role']===_0x8e43('0x93')){var _0x32cdbe=_0x2b7333['get']({'plain':!![]});return db[_0x8e43('0x94')][_0x8e43('0x4d')]({'where':{'name':_0x8e43('0x2c'),'userProfileId':_0x24ef32[_0x8e43('0x91')]},'raw':!![]})[_0x8e43('0x2a')](function(_0x1312de){if(_0x1312de&&_0x1312de[_0x8e43('0x95')]===0x0){return db[_0x8e43('0x96')]['create']({'name':_0x32cdbe['name'],'resourceId':_0x32cdbe['id'],'type':_0x1312de[_0x8e43('0x2f')],'sectionId':_0x1312de['id']},{})['then'](function(){return _0x2b7333;});}else{return _0x2b7333;}})[_0x8e43('0x4b')](function(_0x3eef2b){logger[_0x8e43('0x57')](_0x8e43('0x97'),_0x3eef2b);throw _0x3eef2b;});}return _0x2b7333;})[_0x8e43('0x2a')](respondWithResult(_0x10f8db,null))['catch'](handleError(_0x10f8db,null));}});}catch(_0x41ac69){_0x10f8db[_0x8e43('0x20')](0x1f4)[_0x8e43('0x30')](_0x41ac69);}};function removeReferences(_0x422d88,_0x952766){try{if(_0x422d88){fs[_0x8e43('0x98')](_0x422d88);logger[_0x8e43('0x66')]('Zip\x20archive\x20removed');}if(_0x952766){rimraf(_0x952766,function(){});logger[_0x8e43('0x66')](_0x8e43('0x99'));}}catch(_0x85a566){logger[_0x8e43('0x57')](_0x85a566);}}exports[_0x8e43('0x29')]=function(_0x3182f6,_0x30dedc,_0xe9d7ee){return db[_0x8e43('0x31')][_0x8e43('0x4d')]({'where':{'id':_0x3182f6[_0x8e43('0x9a')]['id']}})[_0x8e43('0x2a')](handleEntityNotFound(_0x30dedc,null))[_0x8e43('0x2a')](saveUpdates(_0x3182f6['body'],null))['then'](respondWithResult(_0x30dedc,null))[_0x8e43('0x4b')](handleError(_0x30dedc,null));};exports[_0x8e43('0x9b')]=function(_0x391b92,_0x2d07ec,_0x5562cb){return db[_0x8e43('0x31')]['find']({'where':{'id':_0x391b92['params']['id']}})[_0x8e43('0x2a')](function(_0x2754a7){if(_0x2754a7){return _0x2754a7[_0x8e43('0x2b')]();}})[_0x8e43('0x2a')](function(_0x2c3f5a){rimraf(path['join'](config['root'],'server/files/plugins',path[_0x8e43('0x5f')](_0x2c3f5a[_0x8e43('0x6')])),function(){});return _0x2c3f5a;})[_0x8e43('0x2a')](handleEntityNotFound(_0x2d07ec,null))[_0x8e43('0x2a')](respondWithStatusCode(_0x2d07ec,null))[_0x8e43('0x4b')](handleError(_0x2d07ec,null));};exports[_0x8e43('0x9c')]=function(_0x53755e,_0xb9ba93,_0x4a0b26){return BPromise[_0x8e43('0x9d')]()[_0x8e43('0x2a')](function(){if(!_0x53755e['query'][_0x8e43('0x6')]){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0x53755e['query']['port']){throw new Error(_0x8e43('0x9e'));}var _0x5a3137=_0x53755e[_0x8e43('0x35')]['hostname']?_0x53755e['query'][_0x8e43('0x9f')]+':'+_0x53755e['query'][_0x8e43('0xa0')]:'http://localhost:'+_0x53755e[_0x8e43('0x35')]['port'];var _0x2445d5=_0x53755e['query'][_0x8e43('0x21')]?_0x53755e['query']['json']:!![];var _0x302045=_0x53755e['query'][_0x8e43('0xa1')]?_0x53755e['query'][_0x8e43('0xa1')]:null;var _0x50c2e9={'method':_0x53755e[_0x8e43('0xa2')],'uri':util[_0x8e43('0x50')](_0x8e43('0xa3'),_0x5a3137,_0x53755e[_0x8e43('0x35')][_0x8e43('0x6')]),'json':_0x2445d5,'resolveWithFullResponse':!![],'encoding':_0x302045,'qs':_0x53755e[_0x8e43('0x35')]};if(_0x53755e[_0x8e43('0xa4')]){_0x50c2e9[_0x8e43('0xa4')]=_0x53755e[_0x8e43('0xa4')];if(_0x50c2e9[_0x8e43('0xa4')][_0x8e43('0xa5')]){delete _0x50c2e9[_0x8e43('0xa4')][_0x8e43('0xa5')];}}if(_0x50c2e9[_0x8e43('0xa4')][_0x8e43('0xa6')]){delete _0x50c2e9['headers'][_0x8e43('0xa6')];}return rp(_0x50c2e9);})[_0x8e43('0x2a')](function(_0x5b78e){if(_0x5b78e){_0xb9ba93[_0x8e43('0x25')](_0x5b78e[_0x8e43('0xa4')]);logger[_0x8e43('0x66')](_0x5b78e[_0x8e43('0x90')]);if(_[_0x8e43('0xa7')](_0x53755e[_0x8e43('0x35')][_0x8e43('0x6')],'download')&&_0x5b78e[_0x8e43('0xa8')]==0x1f4){return _0xb9ba93['sendStatus'](_0x5b78e[_0x8e43('0xa8')]);}else{return _0xb9ba93['status'](_0x5b78e['statusCode'])[_0x8e43('0x30')](_0x5b78e[_0x8e43('0x90')]);}}else{return _0xb9ba93[_0x8e43('0x1f')](0xc8);}})['catch'](handleError(_0xb9ba93,null));};exports['webhookPost']=function(_0x5c0401,_0x182e8d,_0x4b1702){return BPromise[_0x8e43('0x9d')]()[_0x8e43('0x2a')](function(){if(!_0x5c0401[_0x8e43('0x35')][_0x8e43('0x6')]){throw new Error(_0x8e43('0xa9'));}if(!_0x5c0401[_0x8e43('0x35')][_0x8e43('0xa0')]){throw new Error(_0x8e43('0x9e'));}var _0x25b122=_0x5c0401[_0x8e43('0x35')]['hostname']?_0x5c0401[_0x8e43('0x35')][_0x8e43('0x9f')]+':'+_0x5c0401[_0x8e43('0x35')][_0x8e43('0xa0')]:_0x8e43('0xaa')+_0x5c0401['query'][_0x8e43('0xa0')];var _0x31ce03=_0x5c0401[_0x8e43('0x35')][_0x8e43('0x21')]?_0x5c0401[_0x8e43('0x35')][_0x8e43('0x21')]:!![];var _0x456fd4=_0x5c0401[_0x8e43('0x35')]['encoding']?_0x5c0401[_0x8e43('0x35')][_0x8e43('0xa1')]:null;var _0x15677b={'method':_0x5c0401[_0x8e43('0xa2')],'uri':util['format'](_0x8e43('0xa3'),_0x25b122,_0x5c0401[_0x8e43('0x35')]['path']),'json':_0x31ce03,'resolveWithFullResponse':!![],'encoding':_0x456fd4,'body':_0x5c0401[_0x8e43('0x90')]};if(_0x5c0401[_0x8e43('0xa4')]){_0x15677b['headers']=_0x5c0401[_0x8e43('0xa4')];if(_0x15677b[_0x8e43('0xa4')][_0x8e43('0xa5')]){delete _0x15677b[_0x8e43('0xa4')][_0x8e43('0xa5')];}}if(_0x15677b[_0x8e43('0xa4')][_0x8e43('0xa6')]){delete _0x15677b[_0x8e43('0xa4')][_0x8e43('0xa6')];}return rp(_0x15677b);})[_0x8e43('0x2a')](function(_0x476ea4){if(_0x476ea4){_0x182e8d[_0x8e43('0x25')](_0x476ea4[_0x8e43('0xa4')]);logger[_0x8e43('0x66')](_0x476ea4[_0x8e43('0x90')]);return _0x182e8d[_0x8e43('0x20')](_0x476ea4['statusCode'])[_0x8e43('0x30')](_0x476ea4[_0x8e43('0x90')]);}else{return _0x182e8d[_0x8e43('0x1f')](0xc8);}})[_0x8e43('0x4b')](handleError(_0x182e8d,null));}; \ No newline at end of file +var _0x22ab=['Plugins','UserProfileResource','then','error','name','send','index','Plugin','keys','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','map','type','field','includeAll','include','catch','options','find','download','params','root','server/files/plugins','format','%s.zip','zip','warning','ENOENT','Sequelize','pipe','glob','**/*','join','dirname','node_modules/**/*','basename','attachments/**/*','finalize','close','existsSync','Error','Error\x20while\x20downloading\x20the\x20plugin','info','Download\x20completed','Temporary\x20file\x20removed','upload','file','extname','filename','Plugin\x20upload\x20filepath:\x20%s','Plugin\x20upload\x20destination:\x20%s','chmodSync','0777','readdirSync','length','Invalid\x20plugin\x20structure','lstatSync','some','Plugin\x20manifest\x20missing','readFileSync','manifest.json','Invalid\x20manifest:\x20name\x20missing','undefined','Invalid\x20manifest:\x20type\x20missing','version','parameters','Invalid\x20manifest:\x20parameters\x20missing','html','views','admin','agent','Invalid\x20manifest:\x20no\x20view\x20specified','script','scriptName','Invalid\x20manifest:\x20script\x20name\x20missing','Invalid\x20manifest:\x20invalid\x20type','sidebar','always','icon','icon-apps','plugins','Warning:\x20admin\x20view\x20not\x20specified','test','scriptPath','create','body','role','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','userProfileId','unlinkSync','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','update','delete','webhookGet','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','port','hostname','http://localhost:','encoding','%s%s','headers','content-length','content-type','endsWith','statusCode','webhookPost','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','extract-zip','archiver','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','register','sendStatus','end','status','json','count','offset','limit','set','Content-Range','reject','save','destroy','get'];(function(_0x21b9fb,_0x39dd49){var _0x22d6bd=function(_0x2c6754){while(--_0x2c6754){_0x21b9fb['push'](_0x21b9fb['shift']());}};_0x22d6bd(++_0x39dd49);}(_0x22ab,0x78));var _0xb22a=function(_0x3d7fb5,_0x16eb5c){_0x3d7fb5=_0x3d7fb5-0x0;var _0x3a9642=_0x22ab[_0x3d7fb5];return _0x3a9642;};'use strict';var pdf=require(_0xb22a('0x0'));var emlformat=require(_0xb22a('0x1'));var rimraf=require(_0xb22a('0x2'));var zipdir=require(_0xb22a('0x3'));var jsonpatch=require(_0xb22a('0x4'));var rp=require(_0xb22a('0x5'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xb22a('0x6'));var path=require(_0xb22a('0x7'));var sox=require(_0xb22a('0x8'));var csv=require(_0xb22a('0x9'));var ejs=require(_0xb22a('0xa'));var fs=require('fs');var _=require(_0xb22a('0xb'));var squel=require('squel');var crypto=require(_0xb22a('0xc'));var jsforce=require(_0xb22a('0xd'));var deskjs=require(_0xb22a('0xe'));var toCsv=require(_0xb22a('0x9'));var querystring=require(_0xb22a('0xf'));var Papa=require(_0xb22a('0x10'));var extract=require(_0xb22a('0x11'));var rimraf=require(_0xb22a('0x2'));var archiver=require(_0xb22a('0x12'));var Redis=require(_0xb22a('0x13'));var authService=require(_0xb22a('0x14'));var qs=require(_0xb22a('0x15'));var as=require(_0xb22a('0x16'));var hardwareService=require(_0xb22a('0x17'));var logger=require(_0xb22a('0x18'))(_0xb22a('0x19'));var utils=require('../../config/utils');var config=require(_0xb22a('0x1a'));var db=require(_0xb22a('0x1b'))['db'];config[_0xb22a('0x1c')]=_['defaults'](config[_0xb22a('0x1c')],{'host':_0xb22a('0x1d'),'port':0x18eb});var socket=require(_0xb22a('0x1e'))(new Redis(config[_0xb22a('0x1c')]));require('./plugin.socket')[_0xb22a('0x1f')](socket);function respondWithStatusCode(_0x5a31b6,_0xf0d3e2){_0xf0d3e2=_0xf0d3e2||0xcc;return function(_0x2c124b){if(_0x2c124b){return _0x5a31b6[_0xb22a('0x20')](_0xf0d3e2);}return _0x5a31b6['status'](_0xf0d3e2)[_0xb22a('0x21')]();};}function respondWithResult(_0x1a8cd0,_0x27a46b){_0x27a46b=_0x27a46b||0xc8;return function(_0x39234e){if(_0x39234e){return _0x1a8cd0[_0xb22a('0x22')](_0x27a46b)[_0xb22a('0x23')](_0x39234e);}};}function respondWithFilteredResult(_0x54d9f6,_0x4db5d5){return function(_0x48c98e){if(_0x48c98e){var _0x3c6497=_0x48c98e[_0xb22a('0x24')],_0x4475b3=_0x4db5d5['offset'],_0x532466=_0x4db5d5[_0xb22a('0x25')]+_0x4db5d5[_0xb22a('0x26')],_0x44be83;if(_0x532466>=_0x3c6497){_0x532466=_0x3c6497;_0x44be83=0xc8;}else{_0x44be83=0xce;}_0x54d9f6['status'](_0x44be83);return _0x54d9f6[_0xb22a('0x27')](_0xb22a('0x28'),_0x4475b3+'-'+_0x532466+'/'+_0x3c6497)[_0xb22a('0x23')](_0x48c98e);}return null;};}function patchUpdates(_0x184452){return function(_0xc1614d){try{jsonpatch['apply'](_0xc1614d,_0x184452,!![]);}catch(_0x30c7ef){return BPromise[_0xb22a('0x29')](_0x30c7ef);}return _0xc1614d[_0xb22a('0x2a')]();};}function saveUpdates(_0x2c6dc0,_0xadfb9){return function(_0x41861c){if(_0x41861c){return _0x41861c['update'](_0x2c6dc0)['then'](function(_0x5e6856){return _0x5e6856;});}return null;};}function removeEntity(_0x4501db,_0x3d53cb){return function(_0x4c2cac){if(_0x4c2cac){return _0x4c2cac[_0xb22a('0x2b')]()['then'](function(){var _0x25f1ec=_0x4c2cac[_0xb22a('0x2c')]({'plain':!![]});var _0x53bf5f=_0xb22a('0x2d');return db[_0xb22a('0x2e')][_0xb22a('0x2b')]({'where':{'type':_0x53bf5f,'resourceId':_0x25f1ec['id']}})[_0xb22a('0x2f')](function(){return _0x4c2cac;});})[_0xb22a('0x2f')](function(){_0x4501db['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x317b48,_0x1fc24e){return function(_0x48590b){if(!_0x48590b){_0x317b48[_0xb22a('0x20')](0x194);}return _0x48590b;};}function handleError(_0xa3a89f,_0x3b65ea){_0x3b65ea=_0x3b65ea||0x1f4;return function(_0x33fd91){logger[_0xb22a('0x30')](_0x33fd91['stack']);if(_0x33fd91[_0xb22a('0x31')]){delete _0x33fd91[_0xb22a('0x31')];}_0xa3a89f[_0xb22a('0x22')](_0x3b65ea)[_0xb22a('0x32')](_0x33fd91);};}exports[_0xb22a('0x33')]=function(_0x4d1510,_0x1c6e86){var _0x45f609={},_0x1876fe={},_0x12d74e={'count':0x0,'rows':[]};var _0x5cb545=db[_0xb22a('0x34')]['rawAttributes'];_0x1876fe['model']=_[_0xb22a('0x35')](_0x5cb545);_0x1876fe[_0xb22a('0x36')]=_['keys'](_0x4d1510[_0xb22a('0x36')]);_0x1876fe[_0xb22a('0x37')]=_[_0xb22a('0x38')](_0x1876fe[_0xb22a('0x39')],_0x1876fe[_0xb22a('0x36')]);_0x45f609[_0xb22a('0x3a')]=_[_0xb22a('0x38')](_0x1876fe['model'],qs[_0xb22a('0x3b')](_0x4d1510[_0xb22a('0x36')][_0xb22a('0x3b')]));_0x45f609[_0xb22a('0x3a')]=_0x45f609[_0xb22a('0x3a')]['length']?_0x45f609[_0xb22a('0x3a')]:_0x1876fe[_0xb22a('0x39')];if(!_0x4d1510[_0xb22a('0x36')][_0xb22a('0x3c')](_0xb22a('0x3d'))){_0x45f609[_0xb22a('0x26')]=qs[_0xb22a('0x26')](_0x4d1510['query'][_0xb22a('0x26')]);_0x45f609[_0xb22a('0x25')]=qs['offset'](_0x4d1510['query']['offset']);}_0x45f609['order']=qs[_0xb22a('0x3e')](_0x4d1510[_0xb22a('0x36')][_0xb22a('0x3e')]);_0x45f609[_0xb22a('0x3f')]=qs['filters'](_[_0xb22a('0x40')](_0x4d1510[_0xb22a('0x36')],_0x1876fe['filters']));if(_0x4d1510['query'][_0xb22a('0x41')]){_0x45f609['where']=_[_0xb22a('0x42')](_0x45f609['where'],{'$or':_[_0xb22a('0x43')](_0x5cb545,function(_0x42d6b1){if(_0x42d6b1[_0xb22a('0x44')]['key']!=='VIRTUAL'){var _0x1b8b8d={};_0x1b8b8d[_0x42d6b1[_0xb22a('0x45')]]={'$like':'%'+_0x4d1510[_0xb22a('0x36')][_0xb22a('0x41')]+'%'};return _0x1b8b8d;}})});}_0x45f609=_[_0xb22a('0x42')]({},_0x45f609,_0x4d1510['options']);var _0x5891fe={'where':_0x45f609['where']};return db[_0xb22a('0x34')]['count'](_0x5891fe)[_0xb22a('0x2f')](function(_0x24fd10){_0x12d74e[_0xb22a('0x24')]=_0x24fd10;if(_0x4d1510['query'][_0xb22a('0x46')]){_0x45f609[_0xb22a('0x47')]=[{'all':!![]}];}return db[_0xb22a('0x34')]['findAll'](_0x45f609);})[_0xb22a('0x2f')](function(_0x520937){_0x12d74e['rows']=_0x520937;return _0x12d74e;})[_0xb22a('0x2f')](respondWithFilteredResult(_0x1c6e86,_0x45f609))[_0xb22a('0x48')](handleError(_0x1c6e86,null));};exports['show']=function(_0x3f9ec1,_0x328b7f){var _0x953dec={'raw':!![],'where':{'id':_0x3f9ec1['params']['id']}},_0xea2640={};_0xea2640['model']=_[_0xb22a('0x35')](db[_0xb22a('0x34')]['rawAttributes']);_0xea2640[_0xb22a('0x36')]=_[_0xb22a('0x35')](_0x3f9ec1[_0xb22a('0x36')]);_0xea2640[_0xb22a('0x37')]=_['intersection'](_0xea2640[_0xb22a('0x39')],_0xea2640['query']);_0x953dec['attributes']=_[_0xb22a('0x38')](_0xea2640[_0xb22a('0x39')],qs[_0xb22a('0x3b')](_0x3f9ec1[_0xb22a('0x36')]['fields']));_0x953dec['attributes']=_0x953dec[_0xb22a('0x3a')]['length']?_0x953dec[_0xb22a('0x3a')]:_0xea2640[_0xb22a('0x39')];if(_0x3f9ec1['query'][_0xb22a('0x46')]){_0x953dec[_0xb22a('0x47')]=[{'all':!![]}];}_0x953dec=_['merge']({},_0x953dec,_0x3f9ec1[_0xb22a('0x49')]);return db['Plugin'][_0xb22a('0x4a')](_0x953dec)['then'](handleEntityNotFound(_0x328b7f,null))[_0xb22a('0x2f')](respondWithResult(_0x328b7f,null))[_0xb22a('0x48')](handleError(_0x328b7f,null));};exports[_0xb22a('0x4b')]=function(_0xe89c5d,_0x106a31,_0x37cde5){return db[_0xb22a('0x34')][_0xb22a('0x4a')]({'where':{'id':_0xe89c5d[_0xb22a('0x4c')]['id']},'attributes':[_0xb22a('0x31'),_0xb22a('0x7')],'raw':!![]})[_0xb22a('0x2f')](handleEntityNotFound(_0x106a31,null))['then'](function(_0x304f6f){if(_0x304f6f){var _0x4e0398=path['join'](config[_0xb22a('0x4d')],_0xb22a('0x4e'),util[_0xb22a('0x4f')](_0xb22a('0x50'),path['basename'](_0x304f6f[_0xb22a('0x7')])));var _0x2ccc9e=fs['createWriteStream'](_0x4e0398);var _0x21d94f=archiver(_0xb22a('0x51'),{'zlib':{'level':0x9}});_0x21d94f['on'](_0xb22a('0x52'),function(_0x37f35b){if(_0x37f35b['code']===_0xb22a('0x53')){logger[_0xb22a('0x30')](_0x37f35b);}else{throw new db[(_0xb22a('0x54'))]['Error']('Error\x20while\x20generating\x20the\x20zip\x20archive');}});_0x21d94f['on'](_0xb22a('0x30'),function(_0x2ac40f){throw new db[(_0xb22a('0x54'))]['Error']('Error\x20while\x20generating\x20the\x20zip\x20archive');});_0x21d94f[_0xb22a('0x55')](_0x2ccc9e);_0x21d94f[_0xb22a('0x56')](_0xb22a('0x57'),{'cwd':path[_0xb22a('0x58')](config[_0xb22a('0x4d')],_0xb22a('0x4e'),path[_0xb22a('0x59')](_0x304f6f[_0xb22a('0x7')])),'ignore':[path['join'](path['basename'](_0x304f6f[_0xb22a('0x7')]),_0xb22a('0x5a')),path[_0xb22a('0x58')](path[_0xb22a('0x5b')](_0x304f6f['path']),_0xb22a('0x5c'))],'nodir':!![]})[_0xb22a('0x5d')]();_0x2ccc9e['on'](_0xb22a('0x5e'),function(){if(!fs[_0xb22a('0x5f')](_0x4e0398)){throw new db[(_0xb22a('0x54'))]['Error']('Plugin\x20not\x20found');}return _0x106a31[_0xb22a('0x4b')](_0x4e0398,util['format']('%s.zip',path[_0xb22a('0x5b')](_0x304f6f[_0xb22a('0x7')])),function(_0x495175){if(_0x495175){throw new db['Sequelize'][(_0xb22a('0x60'))](_0xb22a('0x61'));}fs['unlinkSync'](_0x4e0398);logger[_0xb22a('0x62')](_0xb22a('0x63'));logger[_0xb22a('0x62')](_0xb22a('0x64'));});});}return null;})['catch'](handleError(_0x106a31,null));};exports[_0xb22a('0x65')]=function(_0x36bfe3,_0x33ce40,_0x1c6c50){var _0x27533e=path['basename'](_0x36bfe3[_0xb22a('0x66')]['filename'],path[_0xb22a('0x67')](_0x36bfe3[_0xb22a('0x66')][_0xb22a('0x68')]));var _0x3cfd2c=path[_0xb22a('0x58')](config[_0xb22a('0x4d')],_0xb22a('0x4e'),_0x36bfe3[_0xb22a('0x66')][_0xb22a('0x68')]);var _0x1acf7e=path[_0xb22a('0x58')](config[_0xb22a('0x4d')],_0xb22a('0x4e'),_0x27533e);logger[_0xb22a('0x62')](_0xb22a('0x69'),_0x3cfd2c);logger['info'](_0xb22a('0x6a'),_0x1acf7e);try{fs[_0xb22a('0x6b')](_0x3cfd2c,parseInt(_0xb22a('0x6c'),0x8));extract(_0x3cfd2c,{'dir':_0x1acf7e},function(_0x3a3ed9){if(_0x3a3ed9){logger[_0xb22a('0x30')](_0x3a3ed9);handleError(_0x3a3ed9,!![]);};var _0x452a6b=fs[_0xb22a('0x6d')](_0x1acf7e);if(_0x452a6b[_0xb22a('0x6e')]>0x1){removeReferences(_0x3cfd2c,_0x1acf7e);logger[_0xb22a('0x30')](_0xb22a('0x6f'));return _0x1c6c50(new Error(_0xb22a('0x6f')));}var _0x4030c3=fs[_0xb22a('0x70')](path[_0xb22a('0x58')](_0x1acf7e,_0x452a6b[0x0]));if(_0x4030c3['isFile']()){removeReferences(_0x3cfd2c,_0x1acf7e);logger[_0xb22a('0x30')](_0xb22a('0x6f'));return _0x1c6c50(new Error(_0xb22a('0x6f')));}if(_0x4030c3['isDirectory']()){var _0x4a7dc7=fs[_0xb22a('0x6d')](path[_0xb22a('0x58')](_0x1acf7e,_0x452a6b[0x0]));if(_0x4a7dc7['length']===0x0){removeReferences(_0x3cfd2c,_0x1acf7e);logger['error'](_0xb22a('0x6f'));return _0x1c6c50(new Error('Invalid\x20plugin\x20structure'));}var _0x4481b3=_0x4a7dc7[_0xb22a('0x71')](function(_0x54a501){return _0x54a501==='manifest.json';});if(!_0x4481b3){return _0x1c6c50(new Error(_0xb22a('0x72')));}var _0x201346=fs[_0xb22a('0x73')](path[_0xb22a('0x58')](_0x1acf7e,_0x452a6b[0x0],_0xb22a('0x74')));var _0x21532a=JSON['parse'](_0x201346);if('undefined'==typeof _0x21532a['name']){return _0x1c6c50(new Error(_0xb22a('0x75')));}if(_0xb22a('0x76')==typeof _0x21532a[_0xb22a('0x44')]){return _0x1c6c50(new Error(_0xb22a('0x77')));}if(_0xb22a('0x76')==typeof _0x21532a[_0xb22a('0x78')]){return _0x1c6c50(new Error('Invalid\x20manifest:\x20version\x20not\x20specified'));}if('undefined'==typeof _0x21532a[_0xb22a('0x79')]){return _0x1c6c50(new Error(_0xb22a('0x7a')));}if(_0x21532a[_0xb22a('0x44')]===_0xb22a('0x7b')){if(_0xb22a('0x76')==typeof _0x21532a[_0xb22a('0x79')]['views']){return _0x1c6c50(new Error('Invalid\x20manifest:\x20views\x20missing'));}if('undefined'==typeof _0x21532a[_0xb22a('0x79')][_0xb22a('0x7c')][_0xb22a('0x7d')]&&_0xb22a('0x76')==typeof _0x21532a[_0xb22a('0x79')][_0xb22a('0x7c')][_0xb22a('0x7e')]){return _0x1c6c50(new Error(_0xb22a('0x7f')));}}else if(_0x21532a[_0xb22a('0x44')]===_0xb22a('0x80')){if(_0xb22a('0x76')==typeof _0x21532a[_0xb22a('0x79')][_0xb22a('0x81')]){return _0x1c6c50(new Error(_0xb22a('0x82')));}if(_0xb22a('0x76')==typeof _0x21532a[_0xb22a('0x79')]['scriptPath']){return _0x1c6c50(new Error('Invalid\x20manifest:\x20script\x20path\x20missing'));}}else{return _0x1c6c50(new Error(_0xb22a('0x83')));}var _0x5eab64=_0x21532a['name'];var _0x2bab72=_0x21532a['description'];var _0x3287d1=_0x21532a[_0xb22a('0x44')];var _0x4f30b1=_0x21532a[_0xb22a('0x84')]?_0x21532a['sidebar']:_0xb22a('0x85');var _0x91f1bf=_0x21532a[_0xb22a('0x86')]?_0x21532a['icon']:_0xb22a('0x87');var _0x3b5dc3='';var _0x1c66bb='';var _0x319179='';var _0x48e421='';var _0x19f851=_0x21532a[_0xb22a('0x78')];if(_0x3287d1===_0xb22a('0x7b')){if('undefined'!=typeof _0x21532a[_0xb22a('0x79')][_0xb22a('0x7c')][_0xb22a('0x7d')]){var _0x6df3c5=_0x21532a[_0xb22a('0x79')][_0xb22a('0x7c')]['admin'];if(!/^(f|ht)tps?:\/\//i['test'](_0x6df3c5)){_0x3b5dc3=path[_0xb22a('0x58')](_0xb22a('0x88'),_0x27533e,_0x452a6b[0x0],_0x6df3c5);}else{_0x3b5dc3=_0x6df3c5;}}else{logger['info'](_0xb22a('0x89'));}if(_0xb22a('0x76')!=typeof _0x21532a[_0xb22a('0x79')][_0xb22a('0x7c')][_0xb22a('0x7e')]){var _0x51c1fd=_0x21532a[_0xb22a('0x79')]['views'][_0xb22a('0x7e')];if(!/^(f|ht)tps?:\/\//i[_0xb22a('0x8a')](_0x51c1fd)){_0x1c66bb=path[_0xb22a('0x58')]('plugins',_0x27533e,_0x452a6b[0x0],_0x51c1fd);}else{_0x1c66bb=_0x51c1fd;}}else{logger['info']('Warning:\x20agent\x20view\x20not\x20specified');}}else if(_0x3287d1===_0xb22a('0x80')){_0x319179=_0x21532a['parameters']['scriptName'];_0x48e421=_0x21532a[_0xb22a('0x79')][_0xb22a('0x8b')];if(_0xb22a('0x76')!=typeof _0x21532a[_0xb22a('0x79')][_0xb22a('0x7c')]){if(_0xb22a('0x76')!=typeof _0x21532a['parameters'][_0xb22a('0x7c')][_0xb22a('0x7d')]){var _0x6df3c5=_0x21532a[_0xb22a('0x79')][_0xb22a('0x7c')][_0xb22a('0x7d')];if(!/^(f|ht)tps?:\/\//i[_0xb22a('0x8a')](_0x6df3c5)){_0x3b5dc3=path['join']('plugins',_0x27533e,_0x452a6b[0x0],_0x6df3c5);}else{_0x3b5dc3=_0x6df3c5;}}if(_0xb22a('0x76')!=typeof _0x21532a['parameters'][_0xb22a('0x7c')]['agent']){var _0x51c1fd=_0x21532a[_0xb22a('0x79')][_0xb22a('0x7c')][_0xb22a('0x7e')];if(!/^(f|ht)tps?:\/\//i[_0xb22a('0x8a')](_0x51c1fd)){_0x1c66bb=path[_0xb22a('0x58')]('plugins',_0x27533e,_0x452a6b[0x0],_0x51c1fd);}else{_0x1c66bb=_0x51c1fd;}}}}var _0x46c945={'name':_0x5eab64,'description':_0x2bab72,'path':path[_0xb22a('0x58')](_0x27533e,_0x452a6b[0x0]),'type':_0x3287d1,'sidebar':_0x4f30b1,'icon':_0x91f1bf,'adminUrl':_0x3b5dc3,'agentUrl':_0x1c66bb,'scriptName':_0x319179,'scriptPath':_0x48e421,'version':_0x19f851};removeReferences(_0x3cfd2c,null);return db['Plugin'][_0xb22a('0x8c')](_0x46c945)[_0xb22a('0x2f')](function(_0x2781fd){var _0xd1e2af={'role':_0x36bfe3[_0xb22a('0x8d')][_0xb22a('0x8e')],'userProfileId':_0x36bfe3['body']['userProfileId']};if(!_0xd1e2af)throw new Error(_0xb22a('0x8f'));if(_0xd1e2af[_0xb22a('0x8e')]===_0xb22a('0x90')){var _0xa9a59e=_0x2781fd['get']({'plain':!![]});return db['UserProfileSection'][_0xb22a('0x4a')]({'where':{'name':_0xb22a('0x2d'),'userProfileId':_0xd1e2af[_0xb22a('0x91')]},'raw':!![]})[_0xb22a('0x2f')](function(_0x1af618){if(_0x1af618&&_0x1af618['autoAssociation']===0x0){return db[_0xb22a('0x2e')]['create']({'name':_0xa9a59e['name'],'resourceId':_0xa9a59e['id'],'type':_0x1af618[_0xb22a('0x31')],'sectionId':_0x1af618['id']},{})[_0xb22a('0x2f')](function(){return _0x2781fd;});}else{return _0x2781fd;}})[_0xb22a('0x48')](function(_0x95ad09){logger[_0xb22a('0x30')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x95ad09);throw _0x95ad09;});}return _0x2781fd;})[_0xb22a('0x2f')](respondWithResult(_0x33ce40,null))[_0xb22a('0x48')](handleError(_0x33ce40,null));}});}catch(_0x57615c){_0x33ce40['status'](0x1f4)[_0xb22a('0x32')](_0x57615c);}};function removeReferences(_0x467d9e,_0x1a2d44){try{if(_0x467d9e){fs[_0xb22a('0x92')](_0x467d9e);logger[_0xb22a('0x62')](_0xb22a('0x93'));}if(_0x1a2d44){rimraf(_0x1a2d44,function(){});logger[_0xb22a('0x62')](_0xb22a('0x94'));}}catch(_0x6b7bce){logger[_0xb22a('0x30')](_0x6b7bce);}}exports[_0xb22a('0x95')]=function(_0x1021bb,_0x3c3392,_0x5610f2){return db[_0xb22a('0x34')][_0xb22a('0x4a')]({'where':{'id':_0x1021bb[_0xb22a('0x4c')]['id']}})[_0xb22a('0x2f')](handleEntityNotFound(_0x3c3392,null))['then'](saveUpdates(_0x1021bb['body'],null))[_0xb22a('0x2f')](respondWithResult(_0x3c3392,null))[_0xb22a('0x48')](handleError(_0x3c3392,null));};exports[_0xb22a('0x96')]=function(_0x159752,_0x206273,_0x1b906f){return db['Plugin'][_0xb22a('0x4a')]({'where':{'id':_0x159752['params']['id']}})['then'](function(_0x1a2d98){if(_0x1a2d98){return _0x1a2d98[_0xb22a('0x2b')]();}})[_0xb22a('0x2f')](function(_0x2590c5){rimraf(path[_0xb22a('0x58')](config[_0xb22a('0x4d')],_0xb22a('0x4e'),path['dirname'](_0x2590c5['path'])),function(){});return _0x2590c5;})[_0xb22a('0x2f')](handleEntityNotFound(_0x206273,null))[_0xb22a('0x2f')](respondWithStatusCode(_0x206273,null))['catch'](handleError(_0x206273,null));};exports[_0xb22a('0x97')]=function(_0x2785ff,_0x25da64,_0x32fb59){return BPromise[_0xb22a('0x98')]()[_0xb22a('0x2f')](function(){if(!_0x2785ff[_0xb22a('0x36')][_0xb22a('0x7')]){throw new Error(_0xb22a('0x99'));}if(!_0x2785ff['query'][_0xb22a('0x9a')]){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0x596354=_0x2785ff[_0xb22a('0x36')][_0xb22a('0x9b')]?_0x2785ff[_0xb22a('0x36')][_0xb22a('0x9b')]+':'+_0x2785ff[_0xb22a('0x36')][_0xb22a('0x9a')]:_0xb22a('0x9c')+_0x2785ff[_0xb22a('0x36')][_0xb22a('0x9a')];var _0x1b748f=_0x2785ff[_0xb22a('0x36')]['json']?_0x2785ff['query'][_0xb22a('0x23')]:!![];var _0x5c8492=_0x2785ff[_0xb22a('0x36')][_0xb22a('0x9d')]?_0x2785ff[_0xb22a('0x36')][_0xb22a('0x9d')]:null;var _0x414f2b={'method':_0x2785ff['method'],'uri':util[_0xb22a('0x4f')](_0xb22a('0x9e'),_0x596354,_0x2785ff[_0xb22a('0x36')][_0xb22a('0x7')]),'json':_0x1b748f,'resolveWithFullResponse':!![],'encoding':_0x5c8492,'qs':_0x2785ff[_0xb22a('0x36')]};if(_0x2785ff[_0xb22a('0x9f')]){_0x414f2b['headers']=_0x2785ff['headers'];if(_0x414f2b[_0xb22a('0x9f')][_0xb22a('0xa0')]){delete _0x414f2b[_0xb22a('0x9f')][_0xb22a('0xa0')];}}if(_0x414f2b['headers'][_0xb22a('0xa1')]){delete _0x414f2b[_0xb22a('0x9f')][_0xb22a('0xa1')];}return rp(_0x414f2b);})[_0xb22a('0x2f')](function(_0x1c6fb7){if(_0x1c6fb7){_0x25da64[_0xb22a('0x27')](_0x1c6fb7[_0xb22a('0x9f')]);logger['info'](_0x1c6fb7[_0xb22a('0x8d')]);if(_[_0xb22a('0xa2')](_0x2785ff['query'][_0xb22a('0x7')],_0xb22a('0x4b'))&&_0x1c6fb7[_0xb22a('0xa3')]==0x1f4){return _0x25da64[_0xb22a('0x20')](_0x1c6fb7[_0xb22a('0xa3')]);}else{return _0x25da64[_0xb22a('0x22')](_0x1c6fb7['statusCode'])[_0xb22a('0x32')](_0x1c6fb7[_0xb22a('0x8d')]);}}else{return _0x25da64[_0xb22a('0x20')](0xc8);}})[_0xb22a('0x48')](handleError(_0x25da64,null));};exports[_0xb22a('0xa4')]=function(_0x42bf75,_0x4da445,_0x524c62){return BPromise[_0xb22a('0x98')]()[_0xb22a('0x2f')](function(){if(!_0x42bf75[_0xb22a('0x36')][_0xb22a('0x7')]){throw new Error(_0xb22a('0x99'));}if(!_0x42bf75[_0xb22a('0x36')][_0xb22a('0x9a')]){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0x15d005=_0x42bf75['query'][_0xb22a('0x9b')]?_0x42bf75[_0xb22a('0x36')][_0xb22a('0x9b')]+':'+_0x42bf75[_0xb22a('0x36')][_0xb22a('0x9a')]:'http://localhost:'+_0x42bf75[_0xb22a('0x36')]['port'];var _0x2a5664=_0x42bf75['query']['json']?_0x42bf75['query'][_0xb22a('0x23')]:!![];var _0x372100=_0x42bf75[_0xb22a('0x36')]['encoding']?_0x42bf75[_0xb22a('0x36')]['encoding']:null;var _0x995e2a={'method':_0x42bf75['method'],'uri':util[_0xb22a('0x4f')](_0xb22a('0x9e'),_0x15d005,_0x42bf75[_0xb22a('0x36')][_0xb22a('0x7')]),'json':_0x2a5664,'resolveWithFullResponse':!![],'encoding':_0x372100,'body':_0x42bf75[_0xb22a('0x8d')]};if(_0x42bf75['headers']){_0x995e2a['headers']=_0x42bf75['headers'];if(_0x995e2a['headers'][_0xb22a('0xa0')]){delete _0x995e2a[_0xb22a('0x9f')][_0xb22a('0xa0')];}}if(_0x995e2a[_0xb22a('0x9f')]['content-type']){delete _0x995e2a[_0xb22a('0x9f')][_0xb22a('0xa1')];}return rp(_0x995e2a);})[_0xb22a('0x2f')](function(_0x383073){if(_0x383073){_0x4da445[_0xb22a('0x27')](_0x383073[_0xb22a('0x9f')]);logger[_0xb22a('0x62')](_0x383073['body']);return _0x4da445[_0xb22a('0x22')](_0x383073[_0xb22a('0xa3')])[_0xb22a('0x32')](_0x383073[_0xb22a('0x8d')]);}else{return _0x4da445[_0xb22a('0x20')](0xc8);}})['catch'](handleError(_0x4da445,null));}; \ No newline at end of file diff --git a/server/api/plugin/plugin.events.js b/server/api/plugin/plugin.events.js index b2b4069..2fe440b 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 _0xd662=['emit','hasOwnProperty','hook','exports','../../mysqldb','Plugin','setMaxListeners','save','update','remove'];(function(_0x360d9a,_0x154fd0){var _0x5c838d=function(_0x3f38ff){while(--_0x3f38ff){_0x360d9a['push'](_0x360d9a['shift']());}};_0x5c838d(++_0x154fd0);}(_0xd662,0x1d0));var _0x2d66=function(_0xf6f208,_0x5b09c2){_0xf6f208=_0xf6f208-0x0;var _0x244420=_0xd662[_0xf6f208];return _0x244420;};'use strict';var EventEmitter=require('events');var Plugin=require(_0x2d66('0x0'))['db'][_0x2d66('0x1')];var PluginEvents=new EventEmitter();PluginEvents[_0x2d66('0x2')](0x0);var events={'afterCreate':_0x2d66('0x3'),'afterUpdate':_0x2d66('0x4'),'afterDestroy':_0x2d66('0x5')};function emitEvent(_0x414f12){return function(_0x5368ec,_0x36286f,_0xef80e7){PluginEvents[_0x2d66('0x6')](_0x414f12+':'+_0x5368ec['id'],_0x5368ec);PluginEvents['emit'](_0x414f12,_0x5368ec);_0xef80e7(null);};}for(var e in events){if(events[_0x2d66('0x7')](e)){var event=events[e];Plugin[_0x2d66('0x8')](e,emitEvent(event));}}module[_0x2d66('0x9')]=PluginEvents; \ No newline at end of file +var _0xd9ec=['update','emit','hook','exports','events','Plugin','setMaxListeners'];(function(_0x512c83,_0x42a67a){var _0x1f7f25=function(_0x1e656c){while(--_0x1e656c){_0x512c83['push'](_0x512c83['shift']());}};_0x1f7f25(++_0x42a67a);}(_0xd9ec,0xe4));var _0xcd9e=function(_0xc1ece5,_0x11849a){_0xc1ece5=_0xc1ece5-0x0;var _0x27b075=_0xd9ec[_0xc1ece5];return _0x27b075;};'use strict';var EventEmitter=require(_0xcd9e('0x0'));var Plugin=require('../../mysqldb')['db'][_0xcd9e('0x1')];var PluginEvents=new EventEmitter();PluginEvents[_0xcd9e('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xcd9e('0x3'),'afterDestroy':'remove'};function emitEvent(_0x5688e8){return function(_0x41e89a,_0x215445,_0xb95a93){PluginEvents[_0xcd9e('0x4')](_0x5688e8+':'+_0x41e89a['id'],_0x41e89a);PluginEvents[_0xcd9e('0x4')](_0x5688e8,_0x41e89a);_0xb95a93(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Plugin[_0xcd9e('0x5')](e,emitEvent(event));}}module[_0xcd9e('0x6')]=PluginEvents; \ No newline at end of file diff --git a/server/api/plugin/plugin.model.js b/server/api/plugin/plugin.model.js index 74d0a85..e71a940 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 _0x5c12=['./plugin.attributes','define','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x5628cd,_0x4a36fe){var _0x4f0dee=function(_0x35905c){while(--_0x35905c){_0x5628cd['push'](_0x5628cd['shift']());}};_0x4f0dee(++_0x4a36fe);}(_0x5c12,0x188));var _0x25c1=function(_0x120123,_0x4eff59){_0x120123=_0x120123-0x0;var _0x3bec4c=_0x5c12[_0x120123];return _0x3bec4c;};'use strict';var _=require('lodash');var util=require(_0x25c1('0x0'));var logger=require(_0x25c1('0x1'))('api');var moment=require(_0x25c1('0x2'));var BPromise=require(_0x25c1('0x3'));var rp=require(_0x25c1('0x4'));var fs=require('fs');var path=require(_0x25c1('0x5'));var rimraf=require(_0x25c1('0x6'));var config=require(_0x25c1('0x7'));var attributes=require(_0x25c1('0x8'));module['exports']=function(_0x204287,_0x42ac16){return _0x204287[_0x25c1('0x9')]('Plugin',attributes,{'tableName':'plugins','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9c5a=['define','lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports'];(function(_0x586931,_0x34885c){var _0xf646ed=function(_0x317072){while(--_0x317072){_0x586931['push'](_0x586931['shift']());}};_0xf646ed(++_0x34885c);}(_0x9c5a,0x1c3));var _0xa9c5=function(_0x46b516,_0x10bf5f){_0x46b516=_0x46b516-0x0;var _0x5d4ae6=_0x9c5a[_0x46b516];return _0x5d4ae6;};'use strict';var _=require(_0xa9c5('0x0'));var util=require(_0xa9c5('0x1'));var logger=require('../../config/logger')(_0xa9c5('0x2'));var moment=require(_0xa9c5('0x3'));var BPromise=require(_0xa9c5('0x4'));var rp=require(_0xa9c5('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa9c5('0x6'));var config=require(_0xa9c5('0x7'));var attributes=require('./plugin.attributes');module[_0xa9c5('0x8')]=function(_0x4d9c7a,_0x394d84){return _0x4d9c7a[_0xa9c5('0x9')]('Plugin',attributes,{'tableName':'plugins','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.rpc.js b/server/api/plugin/plugin.rpc.js index 68ed78a..5da3833 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 _0x0ab4=['../../mysqldb','../../config/logger','rpc','../../config/environment','http','redis','defaults','localhost','socket.io-emitter','register','request','info','request\x20sent','debug','Plugin,\x20%s,\x20%s,\x20%s','stringify','error','code','Plugin,\x20%s,\x20%s','message','CreatePlugin','Plugin','create','body','options','raw','then','lodash','util','moment','bluebird','randomstring'];(function(_0x739b76,_0x2250f8){var _0x3b471f=function(_0x249b87){while(--_0x249b87){_0x739b76['push'](_0x739b76['shift']());}};_0x3b471f(++_0x2250f8);}(_0x0ab4,0x7b));var _0x40ab=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x0ab4[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x40ab('0x0'));var util=require(_0x40ab('0x1'));var moment=require(_0x40ab('0x2'));var BPromise=require(_0x40ab('0x3'));var rs=require(_0x40ab('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x40ab('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x40ab('0x6'))(_0x40ab('0x7'));var config=require(_0x40ab('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x40ab('0x9')]({'port':0x232a});config[_0x40ab('0xa')]=_[_0x40ab('0xb')](config['redis'],{'host':_0x40ab('0xc'),'port':0x18eb});var socket=require(_0x40ab('0xd'))(new Redis(config['redis']));require('./plugin.socket')[_0x40ab('0xe')](socket);function respondWithRpcPromise(_0x5b5f09,_0xdc2f6c,_0x369ea6){return new BPromise(function(_0x58605d,_0x2416b6){return client[_0x40ab('0xf')](_0x5b5f09,_0x369ea6)['then'](function(_0x3a0e49){logger[_0x40ab('0x10')]('Plugin,\x20%s,\x20%s',_0xdc2f6c,_0x40ab('0x11'));logger[_0x40ab('0x12')](_0x40ab('0x13'),_0xdc2f6c,_0x40ab('0x11'),JSON[_0x40ab('0x14')](_0x3a0e49));if(_0x3a0e49[_0x40ab('0x15')]){if(_0x3a0e49[_0x40ab('0x15')][_0x40ab('0x16')]===0x1f4){logger[_0x40ab('0x15')](_0x40ab('0x17'),_0xdc2f6c,_0x3a0e49[_0x40ab('0x15')][_0x40ab('0x18')]);return _0x2416b6(_0x3a0e49[_0x40ab('0x15')][_0x40ab('0x18')]);}logger[_0x40ab('0x15')](_0x40ab('0x17'),_0xdc2f6c,_0x3a0e49[_0x40ab('0x15')][_0x40ab('0x18')]);return _0x58605d(_0x3a0e49[_0x40ab('0x15')][_0x40ab('0x18')]);}else{logger['info'](_0x40ab('0x17'),_0xdc2f6c,'request\x20sent');_0x58605d(_0x3a0e49['result'][_0x40ab('0x18')]);}})['catch'](function(_0x4ec277){logger[_0x40ab('0x15')](_0x40ab('0x17'),_0xdc2f6c,_0x4ec277);_0x2416b6(_0x4ec277);});});}exports[_0x40ab('0x19')]=function(_0x2c0425){var _0x26418a=this;return new Promise(function(_0x5bf5ed,_0x1ffeb2){return db[_0x40ab('0x1a')][_0x40ab('0x1b')](_0x2c0425[_0x40ab('0x1c')],{'raw':_0x2c0425['options']?_0x2c0425[_0x40ab('0x1d')][_0x40ab('0x1e')]===undefined?!![]:![]:!![]})[_0x40ab('0x1f')](function(_0x4c41a6){logger[_0x40ab('0x10')](_0x40ab('0x19'),_0x2c0425);logger[_0x40ab('0x12')]('CreatePlugin',_0x2c0425,JSON[_0x40ab('0x14')](_0x4c41a6));_0x5bf5ed(_0x4c41a6);})['catch'](function(_0x3c5923){logger[_0x40ab('0x15')](_0x40ab('0x19'),_0x3c5923[_0x40ab('0x18')],_0x2c0425);_0x1ffeb2(_0x26418a['error'](0x1f4,_0x3c5923[_0x40ab('0x18')]));});});}; \ No newline at end of file +var _0x8bfc=['request\x20sent','debug','Plugin,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreatePlugin','Plugin','create','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','request','then','info','Plugin,\x20%s,\x20%s'];(function(_0x41a196,_0x42e3fc){var _0x318d6c=function(_0x365c0f){while(--_0x365c0f){_0x41a196['push'](_0x41a196['shift']());}};_0x318d6c(++_0x42e3fc);}(_0x8bfc,0xc0));var _0xc8bf=function(_0x1a8f86,_0x5ed9c4){_0x1a8f86=_0x1a8f86-0x0;var _0x20d876=_0x8bfc[_0x1a8f86];return _0x20d876;};'use strict';var _=require(_0xc8bf('0x0'));var util=require(_0xc8bf('0x1'));var moment=require(_0xc8bf('0x2'));var BPromise=require(_0xc8bf('0x3'));var rs=require(_0xc8bf('0x4'));var fs=require('fs');var Redis=require(_0xc8bf('0x5'));var db=require(_0xc8bf('0x6'))['db'];var utils=require(_0xc8bf('0x7'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xc8bf('0x8'));var client=jayson[_0xc8bf('0x9')]['http']({'port':0x232a});config[_0xc8bf('0xa')]=_[_0xc8bf('0xb')](config[_0xc8bf('0xa')],{'host':_0xc8bf('0xc'),'port':0x18eb});var socket=require(_0xc8bf('0xd'))(new Redis(config[_0xc8bf('0xa')]));require('./plugin.socket')['register'](socket);function respondWithRpcPromise(_0x50de4c,_0x21bdcf,_0x1cdcd5){return new BPromise(function(_0x4282b8,_0x195f95){return client[_0xc8bf('0xe')](_0x50de4c,_0x1cdcd5)[_0xc8bf('0xf')](function(_0x2aeadf){logger[_0xc8bf('0x10')](_0xc8bf('0x11'),_0x21bdcf,_0xc8bf('0x12'));logger[_0xc8bf('0x13')](_0xc8bf('0x14'),_0x21bdcf,_0xc8bf('0x12'),JSON[_0xc8bf('0x15')](_0x2aeadf));if(_0x2aeadf[_0xc8bf('0x16')]){if(_0x2aeadf[_0xc8bf('0x16')][_0xc8bf('0x17')]===0x1f4){logger[_0xc8bf('0x16')]('Plugin,\x20%s,\x20%s',_0x21bdcf,_0x2aeadf[_0xc8bf('0x16')][_0xc8bf('0x18')]);return _0x195f95(_0x2aeadf[_0xc8bf('0x16')][_0xc8bf('0x18')]);}logger[_0xc8bf('0x16')](_0xc8bf('0x11'),_0x21bdcf,_0x2aeadf[_0xc8bf('0x16')][_0xc8bf('0x18')]);return _0x4282b8(_0x2aeadf[_0xc8bf('0x16')]['message']);}else{logger[_0xc8bf('0x10')](_0xc8bf('0x11'),_0x21bdcf,_0xc8bf('0x12'));_0x4282b8(_0x2aeadf[_0xc8bf('0x19')][_0xc8bf('0x18')]);}})[_0xc8bf('0x1a')](function(_0xead709){logger[_0xc8bf('0x16')](_0xc8bf('0x11'),_0x21bdcf,_0xead709);_0x195f95(_0xead709);});});}exports[_0xc8bf('0x1b')]=function(_0x5381ac){var _0x2b5198=this;return new Promise(function(_0x2c42e2,_0x9fccb1){return db[_0xc8bf('0x1c')][_0xc8bf('0x1d')](_0x5381ac['body'],{'raw':_0x5381ac['options']?_0x5381ac['options']['raw']===undefined?!![]:![]:!![]})[_0xc8bf('0xf')](function(_0x2d5798){logger[_0xc8bf('0x10')](_0xc8bf('0x1b'),_0x5381ac);logger[_0xc8bf('0x13')]('CreatePlugin',_0x5381ac,JSON[_0xc8bf('0x15')](_0x2d5798));_0x2c42e2(_0x2d5798);})[_0xc8bf('0x1a')](function(_0x1028e7){logger[_0xc8bf('0x16')]('CreatePlugin',_0x1028e7['message'],_0x5381ac);_0x9fccb1(_0x2b5198[_0xc8bf('0x16')](0x1f4,_0x1028e7[_0xc8bf('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.socket.js b/server/api/plugin/plugin.socket.js index 2410f6c..b717dde 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 _0xc3af=['plugin:','./plugin.events','save','update','removeListener','register','length'];(function(_0x37249a,_0x1ec7eb){var _0x545fab=function(_0x53ebd2){while(--_0x53ebd2){_0x37249a['push'](_0x37249a['shift']());}};_0x545fab(++_0x1ec7eb);}(_0xc3af,0x112));var _0xfc3a=function(_0x149a9b,_0x5bb275){_0x149a9b=_0x149a9b-0x0;var _0x2c2bf6=_0xc3af[_0x149a9b];return _0x2c2bf6;};'use strict';var PluginEvents=require(_0xfc3a('0x0'));var events=[_0xfc3a('0x1'),'remove',_0xfc3a('0x2')];function createListener(_0x4a53e2,_0x2bac90){return function(_0x598e1e){_0x2bac90['emit'](_0x4a53e2,_0x598e1e);};}function removeListener(_0x440859,_0x4aa8db){return function(){PluginEvents[_0xfc3a('0x3')](_0x440859,_0x4aa8db);};}exports[_0xfc3a('0x4')]=function(_0x20c214){for(var _0x5dedef=0x0,_0x1333e6=events[_0xfc3a('0x5')];_0x5dedef<_0x1333e6;_0x5dedef++){var _0x2704e9=events[_0x5dedef];var _0x20ec18=createListener(_0xfc3a('0x6')+_0x2704e9,_0x20c214);PluginEvents['on'](_0x2704e9,_0x20ec18);}}; \ No newline at end of file +var _0x7348=['removeListener','length','plugin:','save','remove','emit'];(function(_0x55f8b4,_0x43f30d){var _0x2475f9=function(_0xdd6f4a){while(--_0xdd6f4a){_0x55f8b4['push'](_0x55f8b4['shift']());}};_0x2475f9(++_0x43f30d);}(_0x7348,0x16b));var _0x8734=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x7348[_0x19950b];return _0x3c6b41;};'use strict';var PluginEvents=require('./plugin.events');var events=[_0x8734('0x0'),_0x8734('0x1'),'update'];function createListener(_0x21b4cd,_0x266fc1){return function(_0x1f73b6){_0x266fc1[_0x8734('0x2')](_0x21b4cd,_0x1f73b6);};}function removeListener(_0x2f295e,_0x59af3d){return function(){PluginEvents[_0x8734('0x3')](_0x2f295e,_0x59af3d);};}exports['register']=function(_0x449b86){for(var _0x5e04ea=0x0,_0x11505f=events[_0x8734('0x4')];_0x5e04ea<_0x11505f;_0x5e04ea++){var _0x409987=events[_0x5e04ea];var _0x4b55fc=createListener(_0x8734('0x5')+_0x409987,_0x449b86);PluginEvents['on'](_0x409987,_0x4b55fc);}}; \ No newline at end of file diff --git a/server/api/pm2/index.js b/server/api/pm2/index.js index a39407f..acb9110 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 _0x0f94=['update','delete','destroy','express','Router','./pm2.controller','index','get','/:id','isAuthenticated','show','put'];(function(_0x52e3a1,_0x3c2b90){var _0x20a3eb=function(_0x34282b){while(--_0x34282b){_0x52e3a1['push'](_0x52e3a1['shift']());}};_0x20a3eb(++_0x3c2b90);}(_0x0f94,0xb7));var _0x40f9=function(_0x2c74d1,_0x2a6591){_0x2c74d1=_0x2c74d1-0x0;var _0xde0840=_0x0f94[_0x2c74d1];return _0xde0840;};'use strict';var express=require(_0x40f9('0x0'));var router=express[_0x40f9('0x1')]();var auth=require('../../components/auth/service');var controller=require(_0x40f9('0x2'));router['get']('/',auth['isAuthenticated'](),controller[_0x40f9('0x3')]);router[_0x40f9('0x4')](_0x40f9('0x5'),auth[_0x40f9('0x6')](),controller[_0x40f9('0x7')]);router['post']('/',auth[_0x40f9('0x6')](),controller['create']);router[_0x40f9('0x8')]('/:id',auth[_0x40f9('0x6')](),controller[_0x40f9('0x9')]);router[_0x40f9('0xa')](_0x40f9('0x5'),auth[_0x40f9('0x6')](),controller[_0x40f9('0xb')]);module['exports']=router; \ No newline at end of file +var _0xa7ee=['create','put','update','delete','exports','express','Router','./pm2.controller','get','isAuthenticated','index','/:id','show','post'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0xa7ee,0x139));var _0xea7e=function(_0x1a0600,_0x41feef){_0x1a0600=_0x1a0600-0x0;var _0x734670=_0xa7ee[_0x1a0600];return _0x734670;};'use strict';var express=require(_0xea7e('0x0'));var router=express[_0xea7e('0x1')]();var auth=require('../../components/auth/service');var controller=require(_0xea7e('0x2'));router[_0xea7e('0x3')]('/',auth[_0xea7e('0x4')](),controller[_0xea7e('0x5')]);router[_0xea7e('0x3')](_0xea7e('0x6'),auth[_0xea7e('0x4')](),controller[_0xea7e('0x7')]);router[_0xea7e('0x8')]('/',auth[_0xea7e('0x4')](),controller[_0xea7e('0x9')]);router[_0xea7e('0xa')]('/:id',auth[_0xea7e('0x4')](),controller[_0xea7e('0xb')]);router[_0xea7e('0xc')](_0xea7e('0x6'),auth['isAuthenticated'](),controller['destroy']);module[_0xea7e('0xd')]=router; \ No newline at end of file diff --git a/server/api/pm2/pm2.controller.js b/server/api/pm2/pm2.controller.js index e223a16..c12451e 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 _0xadd3=['status','info','index','then','reject','express','motion2','length','catch','show','create','body','../../files/plugins','script','cwd','chdir','start','Missing\x20name\x20and/or\x20path','stop','hasOwnProperty','params','send','Unknown\x20status','destroy','dump','Unknown\x20id','lodash','../../config/pm2','api','path','child_process','exec','bluebird','sendStatus','json','error','stack','name'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0xadd3,0xfe));var _0x3add=function(_0x47aa64,_0xfb8a07){_0x47aa64=_0x47aa64-0x0;var _0x549c7a=_0xadd3[_0x47aa64];return _0x549c7a;};'use strict';var _=require(_0x3add('0x0'));var pm2=require(_0x3add('0x1'));var logger=require('../../config/logger')(_0x3add('0x2'));var path=require(_0x3add('0x3'));var exec=require(_0x3add('0x4'))[_0x3add('0x5')];var BPromise=require(_0x3add('0x6'));function handleEntityNotFound(_0x4a4d7b,_0x5b5d6a){return function(_0x1e3dec){if(!_0x1e3dec){_0x4a4d7b[_0x3add('0x7')](0x194);;}return _0x1e3dec;};}function respondWithResult(_0x10ce27,_0xbabc42){_0xbabc42=_0xbabc42||0xc8;return function(_0x296f0f){if(_0x296f0f){return _0x10ce27['status'](_0xbabc42)[_0x3add('0x8')](_0x296f0f);}return null;};}function handleError(_0x5cf856,_0x1dd51b){_0x1dd51b=_0x1dd51b||0x1f4;return function(_0x41797d){logger[_0x3add('0x9')](_0x41797d[_0x3add('0xa')]);if(_0x41797d[_0x3add('0xb')]){delete _0x41797d[_0x3add('0xb')];}_0x5cf856[_0x3add('0xc')](_0x1dd51b)['send'](_0x41797d);};}function execChildProcess(){return new BPromise(function(_0x85db6c,_0x46e533){exec('npm\x20install',function(_0x359788,_0x6be078,_0x216db4){logger[_0x3add('0xd')](_0x6be078);logger['info'](_0x216db4);if(_0x359788){logger[_0x3add('0x9')](_0x359788);return _0x46e533(_0x359788);}return _0x85db6c(_0x6be078);});});}exports[_0x3add('0xe')]=function(_0x4fa9a3,_0x4d649e){return pm2['list']()[_0x3add('0xf')](function(_0x9280e5){if(_0x9280e5){var _0xf9bd44=_[_0x3add('0x10')](_0x9280e5,function(_0x33cabf){return _0x33cabf[_0x3add('0xb')]===_0x3add('0x11')||_0x33cabf['name']===_0x3add('0x12');});return{'rows':_0xf9bd44,'count':_0xf9bd44[_0x3add('0x13')]};}return null;})[_0x3add('0xf')](respondWithResult(_0x4d649e,null))[_0x3add('0x14')](handleError(_0x4d649e,null));};exports[_0x3add('0x15')]=function(_0x2cb2a7,_0x5b084b){return pm2['describe'](_0x2cb2a7['params']['id'])['then'](respondWithResult(_0x5b084b,null))[_0x3add('0xf')](handleEntityNotFound(_0x5b084b,null))[_0x3add('0x14')](handleError(_0x5b084b,null));};exports[_0x3add('0x16')]=function(_0x2a64b1,_0x449776){if(_0x2a64b1['body']['name']&&_0x2a64b1[_0x3add('0x17')]['script']){var _0x218ca0=path['join'](__dirname,_0x3add('0x18'),_0x2a64b1[_0x3add('0x17')][_0x3add('0x19')]);var _0x14ea1b=process[_0x3add('0x1a')]();process[_0x3add('0x1b')](path['dirname'](_0x218ca0));return execChildProcess()[_0x3add('0xf')](function(_0x193cca){process[_0x3add('0x1b')](_0x14ea1b);return pm2[_0x3add('0x1c')]({'name':_0x2a64b1[_0x3add('0x17')][_0x3add('0xb')],'script':_0x218ca0});})['then'](function(_0x223bd5){pm2['dump']();return _0x223bd5[0x0];})[_0x3add('0xf')](respondWithResult(_0x449776,0xc9))[_0x3add('0x14')](handleError(_0x449776,null));}else{return _0x449776['status'](0x1f4)['send']({'message':_0x3add('0x1d')});}};exports['update']=function(_0x29028b,_0x1c74aa){if(_0x29028b[_0x3add('0x17')]['id']){delete _0x29028b[_0x3add('0x17')]['id'];}var _0x438634={'online':'restart','stopped':_0x3add('0x1e')};if(_0x438634[_0x3add('0x1f')](_0x29028b[_0x3add('0x17')][_0x3add('0xc')])){return pm2[_0x438634[_0x29028b['body'][_0x3add('0xc')]]](_0x29028b[_0x3add('0x20')]['id'])[_0x3add('0xf')](respondWithResult(_0x1c74aa,0xc8))['catch'](handleError(_0x1c74aa,null));}else{return _0x1c74aa['status'](0x1f4)[_0x3add('0x21')]({'message':_0x3add('0x22')});}};exports[_0x3add('0x23')]=function(_0x3c41bb,_0x10536b){if(_0x3c41bb['body']['id']){delete _0x3c41bb[_0x3add('0x17')]['id'];}if(_0x3c41bb['params']['id']){return pm2['delete'](_0x3c41bb['params']['id'])[_0x3add('0xf')](function(_0xa382c2){pm2[_0x3add('0x24')]();return _0xa382c2[0x0];})[_0x3add('0xf')](respondWithResult(_0x10536b,null))[_0x3add('0x14')](handleError(_0x10536b,null));}else{return _0x10536b[_0x3add('0xc')](0x1f4)[_0x3add('0x21')]({'message':_0x3add('0x25')});}}; \ No newline at end of file +var _0xd644=['status','json','stack','name','send','npm\x20install','info','error','index','list','then','express','motion2','length','catch','show','describe','params','create','body','script','join','../../files/plugins','cwd','dirname','start','Missing\x20name\x20and/or\x20path','update','restart','stop','hasOwnProperty','Unknown\x20status','destroy','Unknown\x20id','../../config/pm2','../../config/logger','api','path','child_process','exec','bluebird','sendStatus'];(function(_0x38577a,_0x42f2c9){var _0x5b2f6d=function(_0x22d23a){while(--_0x22d23a){_0x38577a['push'](_0x38577a['shift']());}};_0x5b2f6d(++_0x42f2c9);}(_0xd644,0xf4));var _0x4d64=function(_0x5e8b65,_0xc07628){_0x5e8b65=_0x5e8b65-0x0;var _0x280a5c=_0xd644[_0x5e8b65];return _0x280a5c;};'use strict';var _=require('lodash');var pm2=require(_0x4d64('0x0'));var logger=require(_0x4d64('0x1'))(_0x4d64('0x2'));var path=require(_0x4d64('0x3'));var exec=require(_0x4d64('0x4'))[_0x4d64('0x5')];var BPromise=require(_0x4d64('0x6'));function handleEntityNotFound(_0x37a962,_0x3b70c3){return function(_0x28b239){if(!_0x28b239){_0x37a962[_0x4d64('0x7')](0x194);;}return _0x28b239;};}function respondWithResult(_0x3f0432,_0xdacfc7){_0xdacfc7=_0xdacfc7||0xc8;return function(_0x1c0409){if(_0x1c0409){return _0x3f0432[_0x4d64('0x8')](_0xdacfc7)[_0x4d64('0x9')](_0x1c0409);}return null;};}function handleError(_0x356100,_0xe3a558){_0xe3a558=_0xe3a558||0x1f4;return function(_0xbff6e3){logger['error'](_0xbff6e3[_0x4d64('0xa')]);if(_0xbff6e3[_0x4d64('0xb')]){delete _0xbff6e3['name'];}_0x356100['status'](_0xe3a558)[_0x4d64('0xc')](_0xbff6e3);};}function execChildProcess(){return new BPromise(function(_0x339734,_0x19fe15){exec(_0x4d64('0xd'),function(_0x579342,_0x5013c0,_0x12cc8){logger[_0x4d64('0xe')](_0x5013c0);logger['info'](_0x12cc8);if(_0x579342){logger[_0x4d64('0xf')](_0x579342);return _0x19fe15(_0x579342);}return _0x339734(_0x5013c0);});});}exports[_0x4d64('0x10')]=function(_0xfdeea5,_0x22b5f3){return pm2[_0x4d64('0x11')]()[_0x4d64('0x12')](function(_0xa29db2){if(_0xa29db2){var _0x443289=_['reject'](_0xa29db2,function(_0x5edca4){return _0x5edca4[_0x4d64('0xb')]===_0x4d64('0x13')||_0x5edca4['name']===_0x4d64('0x14');});return{'rows':_0x443289,'count':_0x443289[_0x4d64('0x15')]};}return null;})['then'](respondWithResult(_0x22b5f3,null))[_0x4d64('0x16')](handleError(_0x22b5f3,null));};exports[_0x4d64('0x17')]=function(_0x40486d,_0x46defb){return pm2[_0x4d64('0x18')](_0x40486d[_0x4d64('0x19')]['id'])[_0x4d64('0x12')](respondWithResult(_0x46defb,null))['then'](handleEntityNotFound(_0x46defb,null))[_0x4d64('0x16')](handleError(_0x46defb,null));};exports[_0x4d64('0x1a')]=function(_0xf8b3cb,_0x2f0f4c){if(_0xf8b3cb[_0x4d64('0x1b')][_0x4d64('0xb')]&&_0xf8b3cb[_0x4d64('0x1b')][_0x4d64('0x1c')]){var _0xfceb18=path[_0x4d64('0x1d')](__dirname,_0x4d64('0x1e'),_0xf8b3cb['body']['script']);var _0x5ec5ec=process[_0x4d64('0x1f')]();process['chdir'](path[_0x4d64('0x20')](_0xfceb18));return execChildProcess()[_0x4d64('0x12')](function(_0x5ea9ad){process['chdir'](_0x5ec5ec);return pm2[_0x4d64('0x21')]({'name':_0xf8b3cb['body']['name'],'script':_0xfceb18});})['then'](function(_0x456246){pm2['dump']();return _0x456246[0x0];})[_0x4d64('0x12')](respondWithResult(_0x2f0f4c,0xc9))['catch'](handleError(_0x2f0f4c,null));}else{return _0x2f0f4c[_0x4d64('0x8')](0x1f4)[_0x4d64('0xc')]({'message':_0x4d64('0x22')});}};exports[_0x4d64('0x23')]=function(_0x2dac74,_0x19739a){if(_0x2dac74[_0x4d64('0x1b')]['id']){delete _0x2dac74[_0x4d64('0x1b')]['id'];}var _0x2a03d1={'online':_0x4d64('0x24'),'stopped':_0x4d64('0x25')};if(_0x2a03d1[_0x4d64('0x26')](_0x2dac74[_0x4d64('0x1b')][_0x4d64('0x8')])){return pm2[_0x2a03d1[_0x2dac74[_0x4d64('0x1b')]['status']]](_0x2dac74['params']['id'])['then'](respondWithResult(_0x19739a,0xc8))[_0x4d64('0x16')](handleError(_0x19739a,null));}else{return _0x19739a['status'](0x1f4)[_0x4d64('0xc')]({'message':_0x4d64('0x27')});}};exports[_0x4d64('0x28')]=function(_0x3c48d7,_0x4aeaba){if(_0x3c48d7[_0x4d64('0x1b')]['id']){delete _0x3c48d7[_0x4d64('0x1b')]['id'];}if(_0x3c48d7[_0x4d64('0x19')]['id']){return pm2['delete'](_0x3c48d7[_0x4d64('0x19')]['id'])['then'](function(_0x116b9b){pm2['dump']();return _0x116b9b[0x0];})[_0x4d64('0x12')](respondWithResult(_0x4aeaba,null))[_0x4d64('0x16')](handleError(_0x4aeaba,null));}else{return _0x4aeaba[_0x4d64('0x8')](0x1f4)[_0x4d64('0xc')]({'message':_0x4d64('0x29')});}}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/index.js b/server/api/reportAgentPreview/index.js index 79caa17..5b5078e 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 _0xa166=['../../config/environment','multer','express','Router','../../components/auth/service'];(function(_0x11946c,_0x12152c){var _0x383935=function(_0x61fce2){while(--_0x61fce2){_0x11946c['push'](_0x11946c['shift']());}};_0x383935(++_0x12152c);}(_0xa166,0x1be));var _0x6a16=function(_0x3c7868,_0x532e1c){_0x3c7868=_0x3c7868-0x0;var _0x52e74=_0xa166[_0x3c7868];return _0x52e74;};'use strict';var multer=require(_0x6a16('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x6a16('0x1'));var router=express[_0x6a16('0x2')]();var auth=require(_0x6a16('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x6a16('0x4'));module['exports']=router; \ No newline at end of file +var _0xe6f8=['connect-timeout','express','Router','../../config/environment','exports','multer','util','path'];(function(_0x119e2c,_0x2a0058){var _0x6ef22e=function(_0x1dabbe){while(--_0x1dabbe){_0x119e2c['push'](_0x119e2c['shift']());}};_0x6ef22e(++_0x2a0058);}(_0xe6f8,0x75));var _0x8e6f=function(_0x4cf470,_0x5af212){_0x4cf470=_0x4cf470-0x0;var _0x908981=_0xe6f8[_0x4cf470];return _0x908981;};'use strict';var multer=require(_0x8e6f('0x0'));var util=require(_0x8e6f('0x1'));var path=require(_0x8e6f('0x2'));var timeout=require(_0x8e6f('0x3'));var express=require(_0x8e6f('0x4'));var router=express[_0x8e6f('0x5')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x8e6f('0x6'));module[_0x8e6f('0x7')]=router; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.attributes.js b/server/api/reportAgentPreview/reportAgentPreview.attributes.js index 3267af7..1d6da83 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 _0xa843=['sequelize','exports','INTEGER','STRING','DATE'];(function(_0x22db3a,_0x383329){var _0x5a0f0b=function(_0x312462){while(--_0x312462){_0x22db3a['push'](_0x22db3a['shift']());}};_0x5a0f0b(++_0x383329);}(_0xa843,0xb4));var _0x3a84=function(_0x23bea4,_0x38a38){_0x23bea4=_0x23bea4-0x0;var _0xb54789=_0xa843[_0x23bea4];return _0xb54789;};'use strict';var Sequelize=require(_0x3a84('0x0'));module[_0x3a84('0x1')]={'state':{'type':Sequelize[_0x3a84('0x2')](0x2)},'statedesc':{'type':Sequelize[_0x3a84('0x3')]},'scheduledat':{'type':Sequelize[_0x3a84('0x4')]},'uniqueid':{'type':Sequelize[_0x3a84('0x3')]},'starttime':{'type':Sequelize[_0x3a84('0x4')]},'responsetime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize[_0x3a84('0x2')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0x3a84('0x3')]},'campaigntype':{'type':Sequelize[_0x3a84('0x3')]},'membername':{'type':Sequelize[_0x3a84('0x3')]}}; \ No newline at end of file +var _0x2d44=['INTEGER','DATE','STRING','sequelize'];(function(_0x13442f,_0x1750c6){var _0x28980c=function(_0x50e9fe){while(--_0x50e9fe){_0x13442f['push'](_0x13442f['shift']());}};_0x28980c(++_0x1750c6);}(_0x2d44,0xf7));var _0x42d4=function(_0x5f4d2f,_0xc0c381){_0x5f4d2f=_0x5f4d2f-0x0;var _0x44646e=_0x2d44[_0x5f4d2f];return _0x44646e;};'use strict';var Sequelize=require(_0x42d4('0x0'));module['exports']={'state':{'type':Sequelize[_0x42d4('0x1')](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0x42d4('0x2')]},'uniqueid':{'type':Sequelize[_0x42d4('0x3')]},'starttime':{'type':Sequelize[_0x42d4('0x2')]},'responsetime':{'type':Sequelize[_0x42d4('0x2')]},'ringtime':{'type':Sequelize[_0x42d4('0x1')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0x42d4('0x3')]},'campaigntype':{'type':Sequelize[_0x42d4('0x3')]},'membername':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.model.js b/server/api/reportAgentPreview/reportAgentPreview.model.js index a091acf..c783687 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 _0x996a=['api','moment','bluebird','request-promise','rimraf','../../config/environment','./reportAgentPreview.attributes','ReportAgentPreview','report_agent_preview','lodash','util','../../config/logger'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x996a,0x1d1));var _0xa996=function(_0x15a32b,_0x5e439d){_0x15a32b=_0x15a32b-0x0;var _0x1e4acc=_0x996a[_0x15a32b];return _0x1e4acc;};'use strict';var _=require(_0xa996('0x0'));var util=require(_0xa996('0x1'));var logger=require(_0xa996('0x2'))(_0xa996('0x3'));var moment=require(_0xa996('0x4'));var BPromise=require(_0xa996('0x5'));var rp=require(_0xa996('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa996('0x7'));var config=require(_0xa996('0x8'));var attributes=require(_0xa996('0x9'));module['exports']=function(_0x407980,_0xad668c){return _0x407980['define'](_0xa996('0xa'),attributes,{'tableName':_0xa996('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x12c1=['define','ReportAgentPreview','lodash','util','api','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x381943,_0x90d6f9){var _0x27b2f9=function(_0xf6df9e){while(--_0xf6df9e){_0x381943['push'](_0x381943['shift']());}};_0x27b2f9(++_0x90d6f9);}(_0x12c1,0x138));var _0x112c=function(_0x29a528,_0x4f7dbf){_0x29a528=_0x29a528-0x0;var _0x238f6e=_0x12c1[_0x29a528];return _0x238f6e;};'use strict';var _=require(_0x112c('0x0'));var util=require(_0x112c('0x1'));var logger=require('../../config/logger')(_0x112c('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x112c('0x3'));var fs=require('fs');var path=require(_0x112c('0x4'));var rimraf=require(_0x112c('0x5'));var config=require(_0x112c('0x6'));var attributes=require('./reportAgentPreview.attributes');module[_0x112c('0x7')]=function(_0xa50f6f,_0x34948b){return _0xa50f6f[_0x112c('0x8')](_0x112c('0x9'),attributes,{'tableName':'report_agent_preview','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.rpc.js b/server/api/reportAgentPreview/reportAgentPreview.rpc.js index 9b7d717..a412896 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 _0x9fb8=['http','then','info','debug','request\x20sent','stringify','error','code','ReportAgentPreview,\x20%s,\x20%s','message','result','CreateReportAgentPreview','ReportAgentPreview','create','body','options','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','client'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x9fb8,0xf2));var _0x89fb=function(_0xaa0be9,_0x4506b4){_0xaa0be9=_0xaa0be9-0x0;var _0x4e0a8b=_0x9fb8[_0xaa0be9];return _0x4e0a8b;};'use strict';var _=require(_0x89fb('0x0'));var util=require('util');var moment=require(_0x89fb('0x1'));var BPromise=require(_0x89fb('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x89fb('0x3'));var db=require(_0x89fb('0x4'))['db'];var utils=require(_0x89fb('0x5'));var logger=require(_0x89fb('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x89fb('0x7')][_0x89fb('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2f2217,_0x22600d,_0x36857a){return new BPromise(function(_0x515d94,_0x242389){return client['request'](_0x2f2217,_0x36857a)[_0x89fb('0x9')](function(_0x3a452f){logger[_0x89fb('0xa')]('ReportAgentPreview,\x20%s,\x20%s',_0x22600d,'request\x20sent');logger[_0x89fb('0xb')]('ReportAgentPreview,\x20%s,\x20%s,\x20%s',_0x22600d,_0x89fb('0xc'),JSON[_0x89fb('0xd')](_0x3a452f));if(_0x3a452f[_0x89fb('0xe')]){if(_0x3a452f[_0x89fb('0xe')][_0x89fb('0xf')]===0x1f4){logger[_0x89fb('0xe')](_0x89fb('0x10'),_0x22600d,_0x3a452f['error']['message']);return _0x242389(_0x3a452f['error'][_0x89fb('0x11')]);}logger['error'](_0x89fb('0x10'),_0x22600d,_0x3a452f[_0x89fb('0xe')][_0x89fb('0x11')]);return _0x515d94(_0x3a452f[_0x89fb('0xe')][_0x89fb('0x11')]);}else{logger['info'](_0x89fb('0x10'),_0x22600d,_0x89fb('0xc'));_0x515d94(_0x3a452f[_0x89fb('0x12')][_0x89fb('0x11')]);}})['catch'](function(_0x343465){logger[_0x89fb('0xe')](_0x89fb('0x10'),_0x22600d,_0x343465);_0x242389(_0x343465);});});}exports[_0x89fb('0x13')]=function(_0x39cd0c){var _0x1a606c=this;return new Promise(function(_0x351be4,_0x268730){return db[_0x89fb('0x14')][_0x89fb('0x15')](_0x39cd0c[_0x89fb('0x16')],{'raw':_0x39cd0c[_0x89fb('0x17')]?_0x39cd0c[_0x89fb('0x17')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0xe03532){logger[_0x89fb('0xa')](_0x89fb('0x13'),_0x39cd0c);logger[_0x89fb('0xb')](_0x89fb('0x13'),_0x39cd0c,JSON[_0x89fb('0xd')](_0xe03532));_0x351be4(_0xe03532);})[_0x89fb('0x18')](function(_0x2aac83){logger[_0x89fb('0xe')](_0x89fb('0x13'),_0x2aac83['message'],_0x39cd0c);_0x268730(_0x1a606c['error'](0x1f4,_0x2aac83[_0x89fb('0x11')]));});});}; \ No newline at end of file +var _0x5a09=['../../config/logger','rpc','jayson/promise','client','http','request','then','info','ReportAgentPreview,\x20%s,\x20%s','debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','ReportAgentPreview','create','body','options','raw','CreateReportAgentPreview','util','moment','randomstring','ioredis','../../config/utils'];(function(_0x2ce2b3,_0x272f46){var _0x2e9e2d=function(_0xa7ad76){while(--_0xa7ad76){_0x2ce2b3['push'](_0x2ce2b3['shift']());}};_0x2e9e2d(++_0x272f46);}(_0x5a09,0x8c));var _0x95a0=function(_0x5805d7,_0x3d584a){_0x5805d7=_0x5805d7-0x0;var _0x170fe4=_0x5a09[_0x5805d7];return _0x170fe4;};'use strict';var _=require('lodash');var util=require(_0x95a0('0x0'));var moment=require(_0x95a0('0x1'));var BPromise=require('bluebird');var rs=require(_0x95a0('0x2'));var fs=require('fs');var Redis=require(_0x95a0('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x95a0('0x4'));var logger=require(_0x95a0('0x5'))(_0x95a0('0x6'));var config=require('../../config/environment');var jayson=require(_0x95a0('0x7'));var client=jayson[_0x95a0('0x8')][_0x95a0('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x530554,_0x44cc04,_0x3160ee){return new BPromise(function(_0x1aea34,_0x58d3f1){return client[_0x95a0('0xa')](_0x530554,_0x3160ee)[_0x95a0('0xb')](function(_0x13ecbc){logger[_0x95a0('0xc')](_0x95a0('0xd'),_0x44cc04,'request\x20sent');logger[_0x95a0('0xe')](_0x95a0('0xf'),_0x44cc04,_0x95a0('0x10'),JSON[_0x95a0('0x11')](_0x13ecbc));if(_0x13ecbc[_0x95a0('0x12')]){if(_0x13ecbc[_0x95a0('0x12')][_0x95a0('0x13')]===0x1f4){logger[_0x95a0('0x12')](_0x95a0('0xd'),_0x44cc04,_0x13ecbc[_0x95a0('0x12')]['message']);return _0x58d3f1(_0x13ecbc[_0x95a0('0x12')][_0x95a0('0x14')]);}logger[_0x95a0('0x12')](_0x95a0('0xd'),_0x44cc04,_0x13ecbc[_0x95a0('0x12')][_0x95a0('0x14')]);return _0x1aea34(_0x13ecbc[_0x95a0('0x12')][_0x95a0('0x14')]);}else{logger[_0x95a0('0xc')](_0x95a0('0xd'),_0x44cc04,_0x95a0('0x10'));_0x1aea34(_0x13ecbc[_0x95a0('0x15')][_0x95a0('0x14')]);}})[_0x95a0('0x16')](function(_0x1fa944){logger[_0x95a0('0x12')](_0x95a0('0xd'),_0x44cc04,_0x1fa944);_0x58d3f1(_0x1fa944);});});}exports['CreateReportAgentPreview']=function(_0x395a7f){var _0x556b0f=this;return new Promise(function(_0x54b7fb,_0x1f86f2){return db[_0x95a0('0x17')][_0x95a0('0x18')](_0x395a7f[_0x95a0('0x19')],{'raw':_0x395a7f[_0x95a0('0x1a')]?_0x395a7f['options'][_0x95a0('0x1b')]===undefined?!![]:![]:!![]})[_0x95a0('0xb')](function(_0x1f9f16){logger[_0x95a0('0xc')](_0x95a0('0x1c'),_0x395a7f);logger[_0x95a0('0xe')](_0x95a0('0x1c'),_0x395a7f,JSON[_0x95a0('0x11')](_0x1f9f16));_0x54b7fb(_0x1f9f16);})[_0x95a0('0x16')](function(_0x2da761){logger[_0x95a0('0x12')](_0x95a0('0x1c'),_0x2da761[_0x95a0('0x14')],_0x395a7f);_0x1f86f2(_0x556b0f[_0x95a0('0x12')](0x1f4,_0x2da761['message']));});});}; \ No newline at end of file diff --git a/server/api/rpc/index.js b/server/api/rpc/index.js index 21bb0fb..c585e36 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 _0xd0b3=['mailAccounts','/openchannel/queues','openchannelQueues','/sms/queues','smsQueues','/fax/queues','faxQueues','/voice/queues/preview/:id','voiceQueuesPreview','/voice/queues/channels','voiceQueuesChannels','/voice/queues/channels/:uniqueid','voiceQueuesChannel','voiceQueuesChannelHangup','voiceQueuesChannelRedirect','/voice/queues/:id','/outbound','/outbound/channels','outboundChannels','/agents','put','/agents/:id/capacity','agentCapacity','/telephones','telephones','/trunks','trunks','/campaigns','/fax/accounts','faxAccounts','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','post','queueNotify','mail','/mail/queues/:id','showMailQueues','/chat/queues/:id/notify','chat','/chat/queues/:id','/fax/queues/:id/notify','fax','/fax/queues/:id','/openchannel/queues/:id','showOpenchannelQueues','sms','/sms/queues/:id','showSmsQueues','/agents/:id/notify','agentNotify','multer','util','path','express','Router','../../components/auth/service','get','isAuthenticated','/voice/channels/:uniqueid/mixmonitor','voiceChannelMixMonitor','voiceChannelStopMixMonitor','/voice/queues','voiceQueues','/chat/queues','chatQueues','/mail/queues','mailQueues','/mail/accounts'];(function(_0x3403d5,_0x3d99fc){var _0xf9df4f=function(_0x33d748){while(--_0x33d748){_0x3403d5['push'](_0x3403d5['shift']());}};_0xf9df4f(++_0x3d99fc);}(_0xd0b3,0xcf));var _0x3d0b=function(_0x10791a,_0x332510){_0x10791a=_0x10791a-0x0;var _0x45f825=_0xd0b3[_0x10791a];return _0x45f825;};'use strict';var multer=require(_0x3d0b('0x0'));var util=require(_0x3d0b('0x1'));var path=require(_0x3d0b('0x2'));var express=require(_0x3d0b('0x3'));var router=express[_0x3d0b('0x4')]();var auth=require(_0x3d0b('0x5'));var controller=require('./rpc.controller');router[_0x3d0b('0x6')]('/voice/channels',auth[_0x3d0b('0x7')](),controller['voiceChannels']);router['get'](_0x3d0b('0x8'),auth['isAuthenticated'](),controller[_0x3d0b('0x9')]);router[_0x3d0b('0x6')]('/voice/channels/:uniqueid/stopmixmonitor',auth['isAuthenticated'](),controller[_0x3d0b('0xa')]);router[_0x3d0b('0x6')](_0x3d0b('0xb'),auth[_0x3d0b('0x7')](),controller[_0x3d0b('0xc')]);router[_0x3d0b('0x6')](_0x3d0b('0xd'),auth[_0x3d0b('0x7')](),controller[_0x3d0b('0xe')]);router['get'](_0x3d0b('0xf'),auth['isAuthenticated'](),controller[_0x3d0b('0x10')]);router['get'](_0x3d0b('0x11'),auth['isAuthenticated'](),controller[_0x3d0b('0x12')]);router[_0x3d0b('0x6')](_0x3d0b('0x13'),auth[_0x3d0b('0x7')](),controller[_0x3d0b('0x14')]);router[_0x3d0b('0x6')](_0x3d0b('0x15'),auth[_0x3d0b('0x7')](),controller[_0x3d0b('0x16')]);router[_0x3d0b('0x6')](_0x3d0b('0x17'),auth[_0x3d0b('0x7')](),controller[_0x3d0b('0x18')]);router[_0x3d0b('0x6')](_0x3d0b('0x19'),auth[_0x3d0b('0x7')](),controller[_0x3d0b('0x1a')]);router[_0x3d0b('0x6')](_0x3d0b('0x1b'),auth[_0x3d0b('0x7')](),controller[_0x3d0b('0x1c')]);router[_0x3d0b('0x6')](_0x3d0b('0x1d'),auth[_0x3d0b('0x7')](),controller[_0x3d0b('0x1e')]);router[_0x3d0b('0x6')]('/voice/queues/channels/:uniqueid/hangup',auth[_0x3d0b('0x7')](),controller[_0x3d0b('0x1f')]);router['get']('/voice/queues/channels/:uniqueid/redirect/:exten',auth['isAuthenticated'](),controller[_0x3d0b('0x20')]);router[_0x3d0b('0x6')](_0x3d0b('0x21'),auth[_0x3d0b('0x7')](),controller['showVoiceQueues']);router[_0x3d0b('0x6')](_0x3d0b('0x22'),auth[_0x3d0b('0x7')](),controller['outbound']);router[_0x3d0b('0x6')](_0x3d0b('0x23'),auth[_0x3d0b('0x7')](),controller[_0x3d0b('0x24')]);router[_0x3d0b('0x6')](_0x3d0b('0x25'),auth[_0x3d0b('0x7')](),controller['agents']);router[_0x3d0b('0x26')](_0x3d0b('0x27'),auth[_0x3d0b('0x7')](),controller[_0x3d0b('0x28')]);router[_0x3d0b('0x6')](_0x3d0b('0x29'),auth[_0x3d0b('0x7')](),controller[_0x3d0b('0x2a')]);router['get'](_0x3d0b('0x2b'),auth[_0x3d0b('0x7')](),controller[_0x3d0b('0x2c')]);router['get'](_0x3d0b('0x2d'),auth[_0x3d0b('0x7')](),controller['campaigns']);router[_0x3d0b('0x6')](_0x3d0b('0x2e'),auth[_0x3d0b('0x7')](),controller[_0x3d0b('0x2f')]);router['get'](_0x3d0b('0x30'),auth[_0x3d0b('0x7')](),controller[_0x3d0b('0x31')]);router[_0x3d0b('0x6')](_0x3d0b('0x32'),auth[_0x3d0b('0x7')](),controller[_0x3d0b('0x33')]);router[_0x3d0b('0x6')](_0x3d0b('0x34'),auth[_0x3d0b('0x7')](),controller['openchannelQueuesWaitingInteractions']);router[_0x3d0b('0x6')](_0x3d0b('0x35'),auth[_0x3d0b('0x7')](),controller[_0x3d0b('0x36')]);router['get'](_0x3d0b('0x37'),auth['isAuthenticated'](),controller[_0x3d0b('0x38')]);router[_0x3d0b('0x39')]('/mail/queues/:id/notify',auth[_0x3d0b('0x7')](),controller[_0x3d0b('0x3a')](_0x3d0b('0x3b')));router['get'](_0x3d0b('0x3c'),auth[_0x3d0b('0x7')](),controller[_0x3d0b('0x3d')]);router[_0x3d0b('0x39')](_0x3d0b('0x3e'),auth[_0x3d0b('0x7')](),controller[_0x3d0b('0x3a')](_0x3d0b('0x3f')));router[_0x3d0b('0x6')](_0x3d0b('0x40'),auth[_0x3d0b('0x7')](),controller['showChatQueues']);router['post'](_0x3d0b('0x41'),auth['isAuthenticated'](),controller[_0x3d0b('0x3a')](_0x3d0b('0x42')));router[_0x3d0b('0x6')](_0x3d0b('0x43'),auth[_0x3d0b('0x7')](),controller['showFaxQueues']);router['post']('/openchannel/queues/:id/notify',auth['isAuthenticated'](),controller[_0x3d0b('0x3a')]('openchannel'));router[_0x3d0b('0x6')](_0x3d0b('0x44'),auth[_0x3d0b('0x7')](),controller[_0x3d0b('0x45')]);router[_0x3d0b('0x39')]('/sms/queues/:id/notify',auth['isAuthenticated'](),controller[_0x3d0b('0x3a')](_0x3d0b('0x46')));router[_0x3d0b('0x6')](_0x3d0b('0x47'),auth['isAuthenticated'](),controller[_0x3d0b('0x48')]);router[_0x3d0b('0x39')](_0x3d0b('0x49'),auth['isAuthenticated'](),controller[_0x3d0b('0x4a')]);module['exports']=router; \ No newline at end of file +var _0xe323=['/fax/accounts','faxAccounts','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','post','/mail/queues/:id/notify','queueNotify','mail','/mail/queues/:id','showMailQueues','/chat/queues/:id/notify','chat','/chat/queues/:id','showChatQueues','/fax/queues/:id/notify','/fax/queues/:id','showFaxQueues','/openchannel/queues/:id/notify','openchannel','/openchannel/queues/:id','showOpenchannelQueues','/sms/queues/:id/notify','showSmsQueues','/agents/:id/notify','agentNotify','exports','multer','util','express','../../components/auth/service','./rpc.controller','get','/voice/channels','isAuthenticated','voiceChannels','voiceChannelMixMonitor','/voice/channels/:uniqueid/stopmixmonitor','/voice/queues','/chat/queues','chatQueues','/mail/queues','mailQueues','mailAccounts','/openchannel/queues','openchannelQueues','smsQueues','/fax/queues','faxQueues','voiceQueuesPreview','voiceQueuesChannelHangup','voiceQueuesChannelRedirect','/voice/queues/:id','showVoiceQueues','/outbound','/outbound/channels','/agents','agents','put','/agents/:id/capacity','agentCapacity','/telephones','/trunks','trunks','campaigns'];(function(_0x3e44fa,_0x75ed2a){var _0x2a0aba=function(_0x1db6a7){while(--_0x1db6a7){_0x3e44fa['push'](_0x3e44fa['shift']());}};_0x2a0aba(++_0x75ed2a);}(_0xe323,0x16c));var _0x3e32=function(_0x4b4001,_0x3e4531){_0x4b4001=_0x4b4001-0x0;var _0x5dc2c0=_0xe323[_0x4b4001];return _0x5dc2c0;};'use strict';var multer=require(_0x3e32('0x0'));var util=require(_0x3e32('0x1'));var path=require('path');var express=require(_0x3e32('0x2'));var router=express['Router']();var auth=require(_0x3e32('0x3'));var controller=require(_0x3e32('0x4'));router[_0x3e32('0x5')](_0x3e32('0x6'),auth[_0x3e32('0x7')](),controller[_0x3e32('0x8')]);router[_0x3e32('0x5')]('/voice/channels/:uniqueid/mixmonitor',auth['isAuthenticated'](),controller[_0x3e32('0x9')]);router[_0x3e32('0x5')](_0x3e32('0xa'),auth['isAuthenticated'](),controller['voiceChannelStopMixMonitor']);router[_0x3e32('0x5')](_0x3e32('0xb'),auth[_0x3e32('0x7')](),controller['voiceQueues']);router[_0x3e32('0x5')](_0x3e32('0xc'),auth[_0x3e32('0x7')](),controller[_0x3e32('0xd')]);router[_0x3e32('0x5')](_0x3e32('0xe'),auth[_0x3e32('0x7')](),controller[_0x3e32('0xf')]);router[_0x3e32('0x5')]('/mail/accounts',auth['isAuthenticated'](),controller[_0x3e32('0x10')]);router[_0x3e32('0x5')](_0x3e32('0x11'),auth[_0x3e32('0x7')](),controller[_0x3e32('0x12')]);router['get']('/sms/queues',auth[_0x3e32('0x7')](),controller[_0x3e32('0x13')]);router['get'](_0x3e32('0x14'),auth[_0x3e32('0x7')](),controller[_0x3e32('0x15')]);router['get']('/voice/queues/preview/:id',auth[_0x3e32('0x7')](),controller[_0x3e32('0x16')]);router[_0x3e32('0x5')]('/voice/queues/channels',auth[_0x3e32('0x7')](),controller['voiceQueuesChannels']);router[_0x3e32('0x5')]('/voice/queues/channels/:uniqueid',auth[_0x3e32('0x7')](),controller['voiceQueuesChannel']);router['get']('/voice/queues/channels/:uniqueid/hangup',auth[_0x3e32('0x7')](),controller[_0x3e32('0x17')]);router['get']('/voice/queues/channels/:uniqueid/redirect/:exten',auth[_0x3e32('0x7')](),controller[_0x3e32('0x18')]);router[_0x3e32('0x5')](_0x3e32('0x19'),auth['isAuthenticated'](),controller[_0x3e32('0x1a')]);router[_0x3e32('0x5')](_0x3e32('0x1b'),auth[_0x3e32('0x7')](),controller['outbound']);router['get'](_0x3e32('0x1c'),auth[_0x3e32('0x7')](),controller['outboundChannels']);router[_0x3e32('0x5')](_0x3e32('0x1d'),auth[_0x3e32('0x7')](),controller[_0x3e32('0x1e')]);router[_0x3e32('0x1f')](_0x3e32('0x20'),auth[_0x3e32('0x7')](),controller[_0x3e32('0x21')]);router[_0x3e32('0x5')](_0x3e32('0x22'),auth['isAuthenticated'](),controller['telephones']);router[_0x3e32('0x5')](_0x3e32('0x23'),auth[_0x3e32('0x7')](),controller[_0x3e32('0x24')]);router[_0x3e32('0x5')]('/campaigns',auth[_0x3e32('0x7')](),controller[_0x3e32('0x25')]);router[_0x3e32('0x5')](_0x3e32('0x26'),auth[_0x3e32('0x7')](),controller[_0x3e32('0x27')]);router[_0x3e32('0x5')]('/chat/queues/waitinginteractions',auth[_0x3e32('0x7')](),controller['chatQueuesWaitingInteractions']);router[_0x3e32('0x5')]('/mail/queues/waitinginteractions',auth[_0x3e32('0x7')](),controller['mailQueuesWaitingInteractions']);router[_0x3e32('0x5')](_0x3e32('0x28'),auth[_0x3e32('0x7')](),controller[_0x3e32('0x29')]);router[_0x3e32('0x5')]('/sms/queues/waitinginteractions',auth[_0x3e32('0x7')](),controller[_0x3e32('0x2a')]);router['get'](_0x3e32('0x2b'),auth['isAuthenticated'](),controller[_0x3e32('0x2c')]);router[_0x3e32('0x2d')](_0x3e32('0x2e'),auth[_0x3e32('0x7')](),controller[_0x3e32('0x2f')](_0x3e32('0x30')));router[_0x3e32('0x5')](_0x3e32('0x31'),auth['isAuthenticated'](),controller[_0x3e32('0x32')]);router[_0x3e32('0x2d')](_0x3e32('0x33'),auth[_0x3e32('0x7')](),controller['queueNotify'](_0x3e32('0x34')));router[_0x3e32('0x5')](_0x3e32('0x35'),auth['isAuthenticated'](),controller[_0x3e32('0x36')]);router['post'](_0x3e32('0x37'),auth[_0x3e32('0x7')](),controller[_0x3e32('0x2f')]('fax'));router[_0x3e32('0x5')](_0x3e32('0x38'),auth['isAuthenticated'](),controller[_0x3e32('0x39')]);router['post'](_0x3e32('0x3a'),auth[_0x3e32('0x7')](),controller['queueNotify'](_0x3e32('0x3b')));router[_0x3e32('0x5')](_0x3e32('0x3c'),auth[_0x3e32('0x7')](),controller[_0x3e32('0x3d')]);router[_0x3e32('0x2d')](_0x3e32('0x3e'),auth['isAuthenticated'](),controller['queueNotify']('sms'));router['get']('/sms/queues/:id',auth[_0x3e32('0x7')](),controller[_0x3e32('0x3f')]);router[_0x3e32('0x2d')](_0x3e32('0x40'),auth[_0x3e32('0x7')](),controller[_0x3e32('0x41')]);module[_0x3e32('0x42')]=router; \ No newline at end of file diff --git a/server/api/rpc/rpc.controller.js b/server/api/rpc/rpc.controller.js index c3c318e..d561299 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 _0xed42=['ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','MailQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','queueNotify','chat','Website','Queue','findOne','\x20Queue\x20not\x20found','messageId','Interaction','Account','\x20Message\x20not\x20found','update','QueueId','TransferReport','create','Start','queue','queueTransferTimeout','*,*,*,*','agentNotify','channel','capitalize','User','Agent\x20not\x20found','Message','MessageId','InteractionId','From','agentTransferTimeout','moment','lodash','../../mysqldb','../../config/logger','api','client','http','request','error','code','message','result','catch','status','json','sendStatus','stack','name','isNil','rows','find','voiceChannels','VoiceChannels','query','then','VoiceChannelMixMonitor','merge','params','voiceQueues','VoiceQueues','showVoiceQueues','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannel','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','outboundChannels','OutboundChannels','agents','Agents','body','interaction','user','MemberReport','findAll','length','format','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','findOrCreate','INTERACTION','interface','SIP/%s','agent','internal','AgentCapacity','capacity','telephones','Telephones','trunks','Trunks','campaigns','Campaigns','chatQueues','showChatQueues','MailQueues','mailAccounts','MailAccounts','OpenchannelQueues','showOpenchannelQueues','smsQueues','SmsQueues','showSmsQueues','faxQueues','FaxQueues','showFaxQueues','FaxAccounts','chatQueuesWaitingInteractions'];(function(_0x3e45e6,_0x191f4c){var _0x6cfd01=function(_0x44f48e){while(--_0x44f48e){_0x3e45e6['push'](_0x3e45e6['shift']());}};_0x6cfd01(++_0x191f4c);}(_0xed42,0x95));var _0x2ed4=function(_0x553e20,_0x4c3076){_0x553e20=_0x553e20-0x0;var _0x530586=_0xed42[_0x553e20];return _0x530586;};'use strict';var BPromise=require('bluebird');var moment=require(_0x2ed4('0x0'));var _=require(_0x2ed4('0x1'));var util=require('util');var db=require(_0x2ed4('0x2'))['db'];var logger=require(_0x2ed4('0x3'))(_0x2ed4('0x4'));var jayson=require('jayson/promise');var amiClient=jayson[_0x2ed4('0x5')][_0x2ed4('0x6')]({'port':0x232a});var mailClient=jayson[_0x2ed4('0x5')][_0x2ed4('0x6')]({'port':0x232b});var routingClient=jayson['client']['http']({'port':0x232c});function respondWithRpcPromise(_0x1ba135,_0x24bd19,_0x29d69c){return new BPromise(function(_0x4956d5,_0x173a04){var _0xf7db6c=_0x29d69c?_0x29d69c:amiClient;return _0xf7db6c[_0x2ed4('0x7')](_0x1ba135,_0x24bd19)['then'](function(_0xa3302f){if(_0xa3302f[_0x2ed4('0x8')]){if(_0xa3302f['error'][_0x2ed4('0x9')]===0x1f4){return _0x173a04(_0xa3302f[_0x2ed4('0x8')][_0x2ed4('0xa')]);}return _0x4956d5(_0xa3302f[_0x2ed4('0x8')][_0x2ed4('0xa')]);}else{_0x4956d5(_0xa3302f[_0x2ed4('0xb')]);}})[_0x2ed4('0xc')](function(_0x31f45e){_0x173a04(_0x31f45e);});});}function respondWithResult(_0xb8c727,_0x16ed31){_0x16ed31=_0x16ed31||0xc8;return function(_0x477ad4){if(_0x477ad4){return _0xb8c727[_0x2ed4('0xd')](_0x16ed31)[_0x2ed4('0xe')](_0x477ad4);}return _0xb8c727[_0x2ed4('0xf')](0x194);};}function handleError(_0x5872c6,_0x332750){_0x332750=_0x332750||0x1f4;return function(_0x5d825c){logger['error'](_0x5d825c[_0x2ed4('0x10')]);if(_0x5d825c['name']){delete _0x5d825c[_0x2ed4('0x11')];}_0x5872c6[_0x2ed4('0xd')](_0x332750)['send'](_0x5d825c);};}function findById(_0x130a48){return function(_0x53d2df){if(!_['isNil'](_0x130a48)&&!_['isNil'](_0x53d2df)&&!_[_0x2ed4('0x12')](_0x53d2df[_0x2ed4('0x13')])){return _[_0x2ed4('0x14')](_0x53d2df['rows'],function(_0x2d3358){return _0x2d3358['id']==_0x130a48;});}return null;};}exports[_0x2ed4('0x15')]=function(_0x36866b,_0x15fa66){return respondWithRpcPromise(_0x2ed4('0x16'),_0x36866b[_0x2ed4('0x17')])[_0x2ed4('0x18')](respondWithResult(_0x15fa66,null))['catch'](handleError(_0x15fa66,null));};exports['voiceChannelMixMonitor']=function(_0x11ead6,_0x42ff3c){return respondWithRpcPromise(_0x2ed4('0x19'),_[_0x2ed4('0x1a')](_0x11ead6['query'],_0x11ead6[_0x2ed4('0x1b')]))[_0x2ed4('0x18')](respondWithResult(_0x42ff3c,null))[_0x2ed4('0xc')](handleError(_0x42ff3c,null));};exports['voiceChannelStopMixMonitor']=function(_0x389eae,_0xe1fe5b){return respondWithRpcPromise('VoiceChannelStopMixMonitor',_[_0x2ed4('0x1a')](_0x389eae[_0x2ed4('0x17')],_0x389eae[_0x2ed4('0x1b')]))[_0x2ed4('0x18')](respondWithResult(_0xe1fe5b,null))[_0x2ed4('0xc')](handleError(_0xe1fe5b,null));};exports[_0x2ed4('0x1c')]=function(_0x6e8bd4,_0x1fb1a3){return respondWithRpcPromise(_0x2ed4('0x1d'),_0x6e8bd4['query'])[_0x2ed4('0x18')](respondWithResult(_0x1fb1a3,null))[_0x2ed4('0xc')](handleError(_0x1fb1a3,null));};exports[_0x2ed4('0x1e')]=function(_0x2cb4ae,_0x336870){return respondWithRpcPromise(_0x2ed4('0x1d'),_0x2cb4ae[_0x2ed4('0x17')])[_0x2ed4('0x18')](findById(_0x2cb4ae['params']['id']))[_0x2ed4('0x18')](respondWithResult(_0x336870,null))['catch'](handleError(_0x336870,null));};exports[_0x2ed4('0x1f')]=function(_0x34ce47,_0x16e7ca){return respondWithRpcPromise(_0x2ed4('0x20'),_[_0x2ed4('0x1a')](_0x34ce47[_0x2ed4('0x17')],_0x34ce47[_0x2ed4('0x1b')]))[_0x2ed4('0x18')](respondWithResult(_0x16e7ca,null))[_0x2ed4('0xc')](handleError(_0x16e7ca,null));};exports[_0x2ed4('0x21')]=function(_0x477c80,_0x1f818b){return respondWithRpcPromise('VoiceQueuesChannels',_0x477c80[_0x2ed4('0x17')])[_0x2ed4('0x18')](respondWithResult(_0x1f818b,null))['catch'](handleError(_0x1f818b,null));};exports[_0x2ed4('0x22')]=function(_0x182c2b,_0x2d4827){return respondWithRpcPromise(_0x2ed4('0x23'),_['merge'](_0x182c2b[_0x2ed4('0x17')],_0x182c2b['params']))[_0x2ed4('0x18')](respondWithResult(_0x2d4827,null))[_0x2ed4('0xc')](handleError(_0x2d4827,null));};exports['voiceQueuesChannelHangup']=function(_0x56891c,_0xa87117){return respondWithRpcPromise(_0x2ed4('0x24'),_[_0x2ed4('0x1a')](_0x56891c[_0x2ed4('0x17')],_0x56891c[_0x2ed4('0x1b')]))[_0x2ed4('0x18')](respondWithResult(_0xa87117,null))[_0x2ed4('0xc')](handleError(_0xa87117,null));};exports[_0x2ed4('0x25')]=function(_0x310b47,_0x47274f){return respondWithRpcPromise(_0x2ed4('0x26'),_[_0x2ed4('0x1a')](_0x310b47[_0x2ed4('0x17')],_0x310b47['params']))[_0x2ed4('0x18')](respondWithResult(_0x47274f,null))[_0x2ed4('0xc')](handleError(_0x47274f,null));};exports['outbound']=function(_0x18b179,_0x79a41a){return respondWithRpcPromise('Outbound',_0x18b179[_0x2ed4('0x17')])['then'](respondWithResult(_0x79a41a,null))[_0x2ed4('0xc')](handleError(_0x79a41a,null));};exports[_0x2ed4('0x27')]=function(_0x2d6ab8,_0x22bb8e){return respondWithRpcPromise(_0x2ed4('0x28'),_0x2d6ab8[_0x2ed4('0x17')])[_0x2ed4('0x18')](respondWithResult(_0x22bb8e,null))[_0x2ed4('0xc')](handleError(_0x22bb8e,null));};exports[_0x2ed4('0x29')]=function(_0x1739c0,_0x2c79bf){var _0x9c2e52;return respondWithRpcPromise(_0x2ed4('0x2a'),_0x1739c0[_0x2ed4('0x17')])[_0x2ed4('0x18')](function(_0xf85cca){_0x9c2e52=_0xf85cca;return respondWithRpcPromise('Agents',_0x1739c0['query'],routingClient);})[_0x2ed4('0x18')](function(_0x3b25a6){return _[_0x2ed4('0x1a')]({},_0x3b25a6,_0x9c2e52);})[_0x2ed4('0x18')](respondWithResult(_0x2c79bf,null))[_0x2ed4('0xc')](handleError(_0x2c79bf,null));};exports['agentCapacity']=function(_0x462399,_0x5b9d24){if(_0x462399[_0x2ed4('0x2b')]&&_0x462399[_0x2ed4('0x2b')][_0x2ed4('0x2c')]&&_0x462399[_0x2ed4('0x2d')]&&_0x462399[_0x2ed4('0x2d')][_0x2ed4('0x11')]){for(var _0xf93a82 in _0x462399['body'][_0x2ed4('0x2c')]){if(_0x462399[_0x2ed4('0x2b')][_0x2ed4('0x2c')]['hasOwnProperty'](_0xf93a82)){db[_0x2ed4('0x2e')][_0x2ed4('0x2f')]({'where':{'channel':_0xf93a82,'membername':_0x462399['user'][_0x2ed4('0x11')],'type':'INTERACTION','exitAt':null,'uniqueid':_0x462399[_0x2ed4('0x2b')][_0x2ed4('0x2c')][_0xf93a82]&&_0x462399[_0x2ed4('0x2b')][_0x2ed4('0x2c')][_0xf93a82][_0x2ed4('0x30')]?{'$notIn':_0x462399[_0x2ed4('0x2b')][_0x2ed4('0x2c')][_0xf93a82]}:{'$ne':null}}})[_0x2ed4('0x18')](function(_0x27db3f){var _0x13afbc=moment()[_0x2ed4('0x31')](_0x2ed4('0x32'));for(var _0x5bb2e6=0x0,_0x59446a=_0x27db3f[_0x2ed4('0x30')];_0x5bb2e6<_0x59446a;_0x5bb2e6+=0x1){_0x27db3f[_0x5bb2e6][_0x2ed4('0x33')]({'exitAt':_0x13afbc});}});for(var _0x52166f=0x0;_0x52166f<_0x462399[_0x2ed4('0x2b')][_0x2ed4('0x2c')][_0xf93a82]['length'];_0x52166f+=0x1){db[_0x2ed4('0x2e')][_0x2ed4('0x34')]({'where':{'channel':_0xf93a82,'membername':_0x462399[_0x2ed4('0x2d')][_0x2ed4('0x11')],'type':_0x2ed4('0x35'),'uniqueid':_0x462399[_0x2ed4('0x2b')]['interaction'][_0xf93a82][_0x52166f],'exitAt':null},'defaults':{'channel':_0xf93a82,'membername':_0x462399['user'][_0x2ed4('0x11')],'interface':_['isNil'](_0x462399['user'][_0x2ed4('0x36')])?util[_0x2ed4('0x31')](_0x2ed4('0x37'),_0x462399[_0x2ed4('0x2d')]['name']):_0x462399[_0x2ed4('0x2d')][_0x2ed4('0x36')],'type':_0x2ed4('0x35'),'enterAt':moment()[_0x2ed4('0x31')](_0x2ed4('0x32')),'role':_0x2ed4('0x38'),'internal':_0x462399[_0x2ed4('0x2d')][_0x2ed4('0x39')],'uniqueid':_0x462399[_0x2ed4('0x2b')][_0x2ed4('0x2c')][_0xf93a82][_0x52166f]}});}}}}return respondWithRpcPromise(_0x2ed4('0x3a'),{'id':_0x462399[_0x2ed4('0x1b')]['id'],'capacity':_0x462399[_0x2ed4('0x2b')][_0x2ed4('0x3b')]},routingClient)[_0x2ed4('0x18')](respondWithResult(_0x5b9d24,null))[_0x2ed4('0xc')](handleError(_0x5b9d24,null));};exports[_0x2ed4('0x3c')]=function(_0x1a11e8,_0x51429f){return respondWithRpcPromise(_0x2ed4('0x3d'),_0x1a11e8['query'])['then'](respondWithResult(_0x51429f,null))[_0x2ed4('0xc')](handleError(_0x51429f,null));};exports[_0x2ed4('0x3e')]=function(_0x197420,_0x51d56d){return respondWithRpcPromise(_0x2ed4('0x3f'),_0x197420['query'])[_0x2ed4('0x18')](respondWithResult(_0x51d56d,null))[_0x2ed4('0xc')](handleError(_0x51d56d,null));};exports[_0x2ed4('0x40')]=function(_0xe4a5c,_0xfecb70){return respondWithRpcPromise(_0x2ed4('0x41'),_0xe4a5c['query'])[_0x2ed4('0x18')](respondWithResult(_0xfecb70,null))[_0x2ed4('0xc')](handleError(_0xfecb70,null));};exports[_0x2ed4('0x42')]=function(_0x57cd0f,_0x355b47){return respondWithRpcPromise('ChatQueues',_0x57cd0f['query'],routingClient)['then'](respondWithResult(_0x355b47,null))[_0x2ed4('0xc')](handleError(_0x355b47,null));};exports[_0x2ed4('0x43')]=function(_0x19b542,_0x1d58d4){return respondWithRpcPromise('ChatQueues',_0x19b542['query'],routingClient)[_0x2ed4('0x18')](findById(_0x19b542[_0x2ed4('0x1b')]['id']))[_0x2ed4('0x18')](respondWithResult(_0x1d58d4,null))['catch'](handleError(_0x1d58d4,null));};exports['mailQueues']=function(_0x44e4a4,_0x107cdc){return respondWithRpcPromise(_0x2ed4('0x44'),_0x44e4a4[_0x2ed4('0x17')],routingClient)[_0x2ed4('0x18')](respondWithResult(_0x107cdc,null))[_0x2ed4('0xc')](handleError(_0x107cdc,null));};exports['showMailQueues']=function(_0x2ce4ce,_0x5399e4){return respondWithRpcPromise(_0x2ed4('0x44'),_0x2ce4ce[_0x2ed4('0x17')],routingClient)[_0x2ed4('0x18')](findById(_0x2ce4ce['params']['id']))[_0x2ed4('0x18')](respondWithResult(_0x5399e4,null))[_0x2ed4('0xc')](handleError(_0x5399e4,null));};exports[_0x2ed4('0x45')]=function(_0x5abae7,_0x4a40c6){return respondWithRpcPromise(_0x2ed4('0x46'),_0x5abae7['query'],mailClient)[_0x2ed4('0x18')](respondWithResult(_0x4a40c6,null))[_0x2ed4('0xc')](handleError(_0x4a40c6,null));};exports['openchannelQueues']=function(_0x2cb462,_0x315f4b){return respondWithRpcPromise(_0x2ed4('0x47'),_0x2cb462['query'],routingClient)[_0x2ed4('0x18')](respondWithResult(_0x315f4b,null))[_0x2ed4('0xc')](handleError(_0x315f4b,null));};exports[_0x2ed4('0x48')]=function(_0x61beb9,_0x4edbc2){return respondWithRpcPromise(_0x2ed4('0x47'),_0x61beb9[_0x2ed4('0x17')],routingClient)[_0x2ed4('0x18')](findById(_0x61beb9[_0x2ed4('0x1b')]['id']))[_0x2ed4('0x18')](respondWithResult(_0x4edbc2,null))[_0x2ed4('0xc')](handleError(_0x4edbc2,null));};exports[_0x2ed4('0x49')]=function(_0x5a130c,_0x458bf1){return respondWithRpcPromise(_0x2ed4('0x4a'),_0x5a130c[_0x2ed4('0x17')],routingClient)[_0x2ed4('0x18')](respondWithResult(_0x458bf1,null))[_0x2ed4('0xc')](handleError(_0x458bf1,null));};exports[_0x2ed4('0x4b')]=function(_0x2062f5,_0x4ae55e){return respondWithRpcPromise('SmsQueues',_0x2062f5['query'],routingClient)['then'](findById(_0x2062f5[_0x2ed4('0x1b')]['id']))[_0x2ed4('0x18')](respondWithResult(_0x4ae55e,null))[_0x2ed4('0xc')](handleError(_0x4ae55e,null));};exports[_0x2ed4('0x4c')]=function(_0x41d44b,_0x32e663){return respondWithRpcPromise(_0x2ed4('0x4d'),_0x41d44b[_0x2ed4('0x17')],routingClient)[_0x2ed4('0x18')](respondWithResult(_0x32e663,null))[_0x2ed4('0xc')](handleError(_0x32e663,null));};exports[_0x2ed4('0x4e')]=function(_0x3b895e,_0x759461){return respondWithRpcPromise('FaxQueues',_0x3b895e[_0x2ed4('0x17')],routingClient)[_0x2ed4('0x18')](findById(_0x3b895e[_0x2ed4('0x1b')]['id']))['then'](respondWithResult(_0x759461,null))['catch'](handleError(_0x759461,null));};exports['faxAccounts']=function(_0x57810e,_0x959439){return respondWithRpcPromise(_0x2ed4('0x4f'),_0x57810e[_0x2ed4('0x17')])[_0x2ed4('0x18')](respondWithResult(_0x959439,null))[_0x2ed4('0xc')](handleError(_0x959439,null));};exports[_0x2ed4('0x50')]=function(_0x5c74ec,_0x577de9){return respondWithRpcPromise(_0x2ed4('0x51'),_0x5c74ec[_0x2ed4('0x17')],routingClient)[_0x2ed4('0x18')](respondWithResult(_0x577de9,null))[_0x2ed4('0xc')](handleError(_0x577de9,null));};exports[_0x2ed4('0x52')]=function(_0x2d808b,_0x18dc5f){return respondWithRpcPromise(_0x2ed4('0x53'),_0x2d808b[_0x2ed4('0x17')],routingClient)['then'](respondWithResult(_0x18dc5f,null))['catch'](handleError(_0x18dc5f,null));};exports['openchannelQueuesWaitingInteractions']=function(_0xf12df2,_0x5188b1){return respondWithRpcPromise(_0x2ed4('0x54'),_0xf12df2[_0x2ed4('0x17')],routingClient)[_0x2ed4('0x18')](respondWithResult(_0x5188b1,null))['catch'](handleError(_0x5188b1,null));};exports[_0x2ed4('0x55')]=function(_0x5d6272,_0x404cb0){return respondWithRpcPromise(_0x2ed4('0x56'),_0x5d6272[_0x2ed4('0x17')],routingClient)[_0x2ed4('0x18')](respondWithResult(_0x404cb0,null))[_0x2ed4('0xc')](handleError(_0x404cb0,null));};exports['faxQueuesWaitingInteractions']=function(_0x3f009d,_0x45752a){return respondWithRpcPromise('FaxQueuesWaitingInteractions',_0x3f009d['query'],routingClient)['then'](respondWithResult(_0x45752a,null))['catch'](handleError(_0x45752a,null));};exports[_0x2ed4('0x57')]=function(_0x5a0ab9){return function(_0x5e5af6,_0x21adbf){var _0x5bb04b,_0x1d5792;var _0x514a86=_['capitalize'](_0x5a0ab9);var _0x32f839=_0x5a0ab9===_0x2ed4('0x58')?_0x2ed4('0x59'):'Account';return db[_0x514a86+_0x2ed4('0x5a')][_0x2ed4('0x5b')]({'raw':!![],'where':{'id':_0x5e5af6['params']['id']}})[_0x2ed4('0x18')](function(_0x12661d){if(_['isNil'](_0x12661d)){throw new Error(_0x514a86+_0x2ed4('0x5c'));}_0x5bb04b=_0x12661d;return db[_0x514a86+'Message']['findOne']({'where':{'id':_0x5e5af6[_0x2ed4('0x2b')][_0x2ed4('0x5d')]},'include':[{'model':db[_0x514a86+_0x2ed4('0x5e')],'as':_0x2ed4('0x5e')},{'model':db[_0x514a86+_0x32f839],'as':_0x2ed4('0x5f')}]});})[_0x2ed4('0x18')](function(_0x3018fd){if(_[_0x2ed4('0x12')](_0x3018fd)){throw new Error(_0x514a86+_0x2ed4('0x60'));}_0x1d5792=_0x3018fd;return _0x3018fd[_0x2ed4('0x61')]({'read':0x0,'readAt':null,'UserId':null});})[_0x2ed4('0x18')](function(){var _0x23c102={'uniqueid':_0x5a0ab9+'.'+_0x1d5792['id']+'.'+_0x1d5792[_0x2ed4('0x5e')]['id'],'FromUserId':_0x5e5af6[_0x2ed4('0x2d')]['id'],'type':'queue'};_0x23c102[_0x514a86+'MessageId']=_0x1d5792['id'];_0x23c102[_0x514a86+'InteractionId']=_0x1d5792[_0x2ed4('0x5e')]['id'];_0x23c102['From'+_0x514a86+_0x32f839+'Id']=_0x1d5792[_0x2ed4('0x5f')]['id'];_0x23c102['To'+_0x514a86+_0x2ed4('0x62')]=_0x5bb04b['id'];return db[_0x514a86+_0x2ed4('0x63')][_0x2ed4('0x64')](_0x23c102);})[_0x2ed4('0x18')](function(){return respondWithRpcPromise(_0x2ed4('0x65'),{'channel':_0x5a0ab9,'interaction':_0x1d5792[_0x2ed4('0x5e')],'message':_0x1d5792,'account':_0x1d5792[_0x2ed4('0x5f')],'applications':[{'id':0x0,'priority':0x1,'app':_0x2ed4('0x66'),'appdata':_0x5bb04b[_0x2ed4('0x11')]+','+(_0x1d5792['Account'][_0x2ed4('0x67')]||0x12c),'interval':_0x2ed4('0x68')}]},routingClient);})[_0x2ed4('0x18')](respondWithResult(_0x21adbf,null))[_0x2ed4('0xc')](handleError(_0x21adbf,null));};};exports[_0x2ed4('0x69')]=function(_0x1de093,_0x2ada62){var _0x36b633,_0x59f98c;if(_[_0x2ed4('0x12')](_0x1de093[_0x2ed4('0x2b')][_0x2ed4('0x6a')])){throw new Error('Channel\x20field\x20is\x20mandatory');}var _0x16792d=_0x1de093[_0x2ed4('0x2b')][_0x2ed4('0x6a')];var _0x216c29=_[_0x2ed4('0x6b')](_0x16792d);var _0x36ed8b=_0x16792d==='chat'?_0x2ed4('0x59'):_0x2ed4('0x5f');return db[_0x2ed4('0x6c')][_0x2ed4('0x5b')]({'raw':!![],'where':{'id':_0x1de093[_0x2ed4('0x1b')]['id'],'role':_0x2ed4('0x38')}})['then'](function(_0x2a0838){if(_['isNil'](_0x2a0838)){throw new Error(_0x2ed4('0x6d'));}_0x36b633=_0x2a0838;return db[_0x216c29+_0x2ed4('0x6e')][_0x2ed4('0x5b')]({'where':{'id':_0x1de093['body'][_0x2ed4('0x5d')]},'include':[{'model':db[_0x216c29+_0x2ed4('0x5e')],'as':_0x2ed4('0x5e')},{'model':db[_0x216c29+_0x36ed8b],'as':_0x2ed4('0x5f')}]});})[_0x2ed4('0x18')](function(_0x1ec8ac){if(_[_0x2ed4('0x12')](_0x1ec8ac)){throw new Error(_0x216c29+_0x2ed4('0x60'));}_0x59f98c=_0x1ec8ac;return _0x1ec8ac[_0x2ed4('0x61')]({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x17262b={'uniqueid':_0x16792d+'.'+_0x59f98c['id']+'.'+_0x59f98c[_0x2ed4('0x5e')]['id'],'FromUserId':_0x1de093['user']['id'],'type':_0x2ed4('0x66'),'ToUserId':_0x36b633['id']};_0x17262b[_0x216c29+_0x2ed4('0x6f')]=_0x59f98c['id'];_0x17262b[_0x216c29+_0x2ed4('0x70')]=_0x59f98c[_0x2ed4('0x5e')]['id'];_0x17262b[_0x2ed4('0x71')+_0x216c29+_0x36ed8b+'Id']=_0x59f98c[_0x2ed4('0x5f')]['id'];return db[_0x216c29+_0x2ed4('0x63')][_0x2ed4('0x64')](_0x17262b);})[_0x2ed4('0x18')](function(){return respondWithRpcPromise(_0x2ed4('0x65'),{'channel':_0x16792d,'interaction':_0x59f98c[_0x2ed4('0x5e')],'message':_0x59f98c,'account':_0x59f98c[_0x2ed4('0x5f')],'applications':[{'id':0x0,'priority':0x1,'app':_0x2ed4('0x38'),'appdata':_0x36b633[_0x2ed4('0x11')]+','+(_0x59f98c[_0x2ed4('0x5f')][_0x2ed4('0x72')]||0x12c),'interval':'*,*,*,*'}]},routingClient);})[_0x2ed4('0x18')](respondWithResult(_0x2ada62,null))[_0x2ed4('0xc')](handleError(_0x2ada62,null));}; \ No newline at end of file +var _0xe117=['api','jayson/promise','http','client','request','error','message','result','catch','status','json','sendStatus','stack','name','isNil','rows','find','voiceChannels','query','then','voiceChannelMixMonitor','VoiceChannelMixMonitor','merge','params','voiceChannelStopMixMonitor','VoiceChannelStopMixMonitor','VoiceQueues','showVoiceQueues','voiceQueuesChannels','VoiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','Outbound','outboundChannels','OutboundChannels','agents','Agents','agentCapacity','body','interaction','hasOwnProperty','MemberReport','findAll','user','INTERACTION','length','format','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','findOrCreate','interface','SIP/%s','internal','AgentCapacity','telephones','Telephones','trunks','Trunks','campaigns','Campaigns','chatQueues','ChatQueues','showChatQueues','MailQueues','showMailQueues','mailAccounts','MailAccounts','openchannelQueues','showOpenchannelQueues','OpenchannelQueues','SmsQueues','showSmsQueues','faxQueues','FaxQueues','showFaxQueues','faxAccounts','FaxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','MailQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','FaxQueuesWaitingInteractions','queueNotify','capitalize','chat','Website','Account','Queue','findOne','\x20Queue\x20not\x20found','Message','messageId','Interaction','MessageId','InteractionId','From','QueueId','TransferReport','create','queue','queueTransferTimeout','*,*,*,*','agentNotify','channel','Channel\x20field\x20is\x20mandatory','User','agent','Agent\x20not\x20found','\x20Message\x20not\x20found','update','Start','agentTransferTimeout','moment','util','../../mysqldb'];(function(_0x4fca02,_0x3f097a){var _0x3fa948=function(_0x9573b0){while(--_0x9573b0){_0x4fca02['push'](_0x4fca02['shift']());}};_0x3fa948(++_0x3f097a);}(_0xe117,0x75));var _0x7e11=function(_0x21015f,_0x3be511){_0x21015f=_0x21015f-0x0;var _0x1ec262=_0xe117[_0x21015f];return _0x1ec262;};'use strict';var BPromise=require('bluebird');var moment=require(_0x7e11('0x0'));var _=require('lodash');var util=require(_0x7e11('0x1'));var db=require(_0x7e11('0x2'))['db'];var logger=require('../../config/logger')(_0x7e11('0x3'));var jayson=require(_0x7e11('0x4'));var amiClient=jayson['client'][_0x7e11('0x5')]({'port':0x232a});var mailClient=jayson[_0x7e11('0x6')][_0x7e11('0x5')]({'port':0x232b});var routingClient=jayson[_0x7e11('0x6')][_0x7e11('0x5')]({'port':0x232c});function respondWithRpcPromise(_0x2ee6da,_0xc2819,_0x29d335){return new BPromise(function(_0x4d0195,_0x158705){var _0x438993=_0x29d335?_0x29d335:amiClient;return _0x438993[_0x7e11('0x7')](_0x2ee6da,_0xc2819)['then'](function(_0x32a891){if(_0x32a891[_0x7e11('0x8')]){if(_0x32a891[_0x7e11('0x8')]['code']===0x1f4){return _0x158705(_0x32a891[_0x7e11('0x8')]['message']);}return _0x4d0195(_0x32a891['error'][_0x7e11('0x9')]);}else{_0x4d0195(_0x32a891[_0x7e11('0xa')]);}})[_0x7e11('0xb')](function(_0x4983b3){_0x158705(_0x4983b3);});});}function respondWithResult(_0x14cfb6,_0x47cf57){_0x47cf57=_0x47cf57||0xc8;return function(_0x5b01ab){if(_0x5b01ab){return _0x14cfb6[_0x7e11('0xc')](_0x47cf57)[_0x7e11('0xd')](_0x5b01ab);}return _0x14cfb6[_0x7e11('0xe')](0x194);};}function handleError(_0x50162e,_0x3564cb){_0x3564cb=_0x3564cb||0x1f4;return function(_0x1cf2e3){logger[_0x7e11('0x8')](_0x1cf2e3[_0x7e11('0xf')]);if(_0x1cf2e3['name']){delete _0x1cf2e3[_0x7e11('0x10')];}_0x50162e[_0x7e11('0xc')](_0x3564cb)['send'](_0x1cf2e3);};}function findById(_0x38d90b){return function(_0x234835){if(!_[_0x7e11('0x11')](_0x38d90b)&&!_[_0x7e11('0x11')](_0x234835)&&!_['isNil'](_0x234835[_0x7e11('0x12')])){return _[_0x7e11('0x13')](_0x234835[_0x7e11('0x12')],function(_0x346954){return _0x346954['id']==_0x38d90b;});}return null;};}exports[_0x7e11('0x14')]=function(_0x103cc2,_0x1731b6){return respondWithRpcPromise('VoiceChannels',_0x103cc2[_0x7e11('0x15')])[_0x7e11('0x16')](respondWithResult(_0x1731b6,null))['catch'](handleError(_0x1731b6,null));};exports[_0x7e11('0x17')]=function(_0x420e61,_0x299511){return respondWithRpcPromise(_0x7e11('0x18'),_[_0x7e11('0x19')](_0x420e61[_0x7e11('0x15')],_0x420e61[_0x7e11('0x1a')]))['then'](respondWithResult(_0x299511,null))['catch'](handleError(_0x299511,null));};exports[_0x7e11('0x1b')]=function(_0x417f32,_0x16fa41){return respondWithRpcPromise(_0x7e11('0x1c'),_[_0x7e11('0x19')](_0x417f32[_0x7e11('0x15')],_0x417f32[_0x7e11('0x1a')]))[_0x7e11('0x16')](respondWithResult(_0x16fa41,null))[_0x7e11('0xb')](handleError(_0x16fa41,null));};exports['voiceQueues']=function(_0x4004c5,_0x5aa90c){return respondWithRpcPromise(_0x7e11('0x1d'),_0x4004c5[_0x7e11('0x15')])[_0x7e11('0x16')](respondWithResult(_0x5aa90c,null))[_0x7e11('0xb')](handleError(_0x5aa90c,null));};exports[_0x7e11('0x1e')]=function(_0x49b364,_0x966db2){return respondWithRpcPromise(_0x7e11('0x1d'),_0x49b364[_0x7e11('0x15')])['then'](findById(_0x49b364[_0x7e11('0x1a')]['id']))[_0x7e11('0x16')](respondWithResult(_0x966db2,null))[_0x7e11('0xb')](handleError(_0x966db2,null));};exports['voiceQueuesPreview']=function(_0x3d0cdf,_0xb157c7){return respondWithRpcPromise('VoiceQueuesPreview',_['merge'](_0x3d0cdf['query'],_0x3d0cdf[_0x7e11('0x1a')]))[_0x7e11('0x16')](respondWithResult(_0xb157c7,null))[_0x7e11('0xb')](handleError(_0xb157c7,null));};exports[_0x7e11('0x1f')]=function(_0x344cac,_0x510dad){return respondWithRpcPromise(_0x7e11('0x20'),_0x344cac[_0x7e11('0x15')])['then'](respondWithResult(_0x510dad,null))[_0x7e11('0xb')](handleError(_0x510dad,null));};exports[_0x7e11('0x21')]=function(_0xe7f4ac,_0x35602e){return respondWithRpcPromise(_0x7e11('0x22'),_[_0x7e11('0x19')](_0xe7f4ac[_0x7e11('0x15')],_0xe7f4ac[_0x7e11('0x1a')]))[_0x7e11('0x16')](respondWithResult(_0x35602e,null))[_0x7e11('0xb')](handleError(_0x35602e,null));};exports[_0x7e11('0x23')]=function(_0x58599c,_0x5c7216){return respondWithRpcPromise(_0x7e11('0x24'),_['merge'](_0x58599c[_0x7e11('0x15')],_0x58599c[_0x7e11('0x1a')]))[_0x7e11('0x16')](respondWithResult(_0x5c7216,null))[_0x7e11('0xb')](handleError(_0x5c7216,null));};exports['voiceQueuesChannelRedirect']=function(_0x7bb23,_0x456813){return respondWithRpcPromise('VoiceQueuesChannelRedirect',_[_0x7e11('0x19')](_0x7bb23[_0x7e11('0x15')],_0x7bb23[_0x7e11('0x1a')]))[_0x7e11('0x16')](respondWithResult(_0x456813,null))['catch'](handleError(_0x456813,null));};exports['outbound']=function(_0x581f37,_0x1b609b){return respondWithRpcPromise(_0x7e11('0x25'),_0x581f37[_0x7e11('0x15')])[_0x7e11('0x16')](respondWithResult(_0x1b609b,null))[_0x7e11('0xb')](handleError(_0x1b609b,null));};exports[_0x7e11('0x26')]=function(_0xeb604f,_0x1408fa){return respondWithRpcPromise(_0x7e11('0x27'),_0xeb604f[_0x7e11('0x15')])['then'](respondWithResult(_0x1408fa,null))[_0x7e11('0xb')](handleError(_0x1408fa,null));};exports[_0x7e11('0x28')]=function(_0xf05046,_0x3f954b){var _0x495521;return respondWithRpcPromise(_0x7e11('0x29'),_0xf05046[_0x7e11('0x15')])[_0x7e11('0x16')](function(_0x54818b){_0x495521=_0x54818b;return respondWithRpcPromise(_0x7e11('0x29'),_0xf05046['query'],routingClient);})[_0x7e11('0x16')](function(_0x26795a){return _[_0x7e11('0x19')]({},_0x26795a,_0x495521);})[_0x7e11('0x16')](respondWithResult(_0x3f954b,null))[_0x7e11('0xb')](handleError(_0x3f954b,null));};exports[_0x7e11('0x2a')]=function(_0x213198,_0x580a10){if(_0x213198[_0x7e11('0x2b')]&&_0x213198[_0x7e11('0x2b')][_0x7e11('0x2c')]&&_0x213198['user']&&_0x213198['user'][_0x7e11('0x10')]){for(var _0x36155b in _0x213198[_0x7e11('0x2b')][_0x7e11('0x2c')]){if(_0x213198[_0x7e11('0x2b')][_0x7e11('0x2c')][_0x7e11('0x2d')](_0x36155b)){db[_0x7e11('0x2e')][_0x7e11('0x2f')]({'where':{'channel':_0x36155b,'membername':_0x213198[_0x7e11('0x30')][_0x7e11('0x10')],'type':_0x7e11('0x31'),'exitAt':null,'uniqueid':_0x213198[_0x7e11('0x2b')][_0x7e11('0x2c')][_0x36155b]&&_0x213198[_0x7e11('0x2b')][_0x7e11('0x2c')][_0x36155b][_0x7e11('0x32')]?{'$notIn':_0x213198[_0x7e11('0x2b')]['interaction'][_0x36155b]}:{'$ne':null}}})[_0x7e11('0x16')](function(_0xdfd45a){var _0x54efcc=moment()[_0x7e11('0x33')](_0x7e11('0x34'));for(var _0x2257f4=0x0,_0x68d82a=_0xdfd45a['length'];_0x2257f4<_0x68d82a;_0x2257f4+=0x1){_0xdfd45a[_0x2257f4][_0x7e11('0x35')]({'exitAt':_0x54efcc});}});for(var _0x29fc1e=0x0;_0x29fc1e<_0x213198[_0x7e11('0x2b')]['interaction'][_0x36155b][_0x7e11('0x32')];_0x29fc1e+=0x1){db[_0x7e11('0x2e')][_0x7e11('0x36')]({'where':{'channel':_0x36155b,'membername':_0x213198[_0x7e11('0x30')]['name'],'type':'INTERACTION','uniqueid':_0x213198['body'][_0x7e11('0x2c')][_0x36155b][_0x29fc1e],'exitAt':null},'defaults':{'channel':_0x36155b,'membername':_0x213198[_0x7e11('0x30')][_0x7e11('0x10')],'interface':_[_0x7e11('0x11')](_0x213198[_0x7e11('0x30')][_0x7e11('0x37')])?util[_0x7e11('0x33')](_0x7e11('0x38'),_0x213198['user'][_0x7e11('0x10')]):_0x213198[_0x7e11('0x30')][_0x7e11('0x37')],'type':_0x7e11('0x31'),'enterAt':moment()[_0x7e11('0x33')](_0x7e11('0x34')),'role':'agent','internal':_0x213198[_0x7e11('0x30')][_0x7e11('0x39')],'uniqueid':_0x213198[_0x7e11('0x2b')][_0x7e11('0x2c')][_0x36155b][_0x29fc1e]}});}}}}return respondWithRpcPromise(_0x7e11('0x3a'),{'id':_0x213198[_0x7e11('0x1a')]['id'],'capacity':_0x213198[_0x7e11('0x2b')]['capacity']},routingClient)[_0x7e11('0x16')](respondWithResult(_0x580a10,null))[_0x7e11('0xb')](handleError(_0x580a10,null));};exports[_0x7e11('0x3b')]=function(_0x176200,_0x25d09c){return respondWithRpcPromise(_0x7e11('0x3c'),_0x176200[_0x7e11('0x15')])[_0x7e11('0x16')](respondWithResult(_0x25d09c,null))['catch'](handleError(_0x25d09c,null));};exports[_0x7e11('0x3d')]=function(_0x3dabaa,_0x11dbc1){return respondWithRpcPromise(_0x7e11('0x3e'),_0x3dabaa['query'])[_0x7e11('0x16')](respondWithResult(_0x11dbc1,null))[_0x7e11('0xb')](handleError(_0x11dbc1,null));};exports[_0x7e11('0x3f')]=function(_0x2ef6c6,_0x259e1a){return respondWithRpcPromise(_0x7e11('0x40'),_0x2ef6c6[_0x7e11('0x15')])[_0x7e11('0x16')](respondWithResult(_0x259e1a,null))[_0x7e11('0xb')](handleError(_0x259e1a,null));};exports[_0x7e11('0x41')]=function(_0x4f6952,_0x5c99a2){return respondWithRpcPromise(_0x7e11('0x42'),_0x4f6952[_0x7e11('0x15')],routingClient)['then'](respondWithResult(_0x5c99a2,null))['catch'](handleError(_0x5c99a2,null));};exports[_0x7e11('0x43')]=function(_0x283645,_0x8c927f){return respondWithRpcPromise(_0x7e11('0x42'),_0x283645['query'],routingClient)[_0x7e11('0x16')](findById(_0x283645[_0x7e11('0x1a')]['id']))['then'](respondWithResult(_0x8c927f,null))['catch'](handleError(_0x8c927f,null));};exports['mailQueues']=function(_0x263484,_0xc2298e){return respondWithRpcPromise(_0x7e11('0x44'),_0x263484['query'],routingClient)[_0x7e11('0x16')](respondWithResult(_0xc2298e,null))['catch'](handleError(_0xc2298e,null));};exports[_0x7e11('0x45')]=function(_0xb1d52c,_0x3387be){return respondWithRpcPromise(_0x7e11('0x44'),_0xb1d52c[_0x7e11('0x15')],routingClient)[_0x7e11('0x16')](findById(_0xb1d52c['params']['id']))['then'](respondWithResult(_0x3387be,null))[_0x7e11('0xb')](handleError(_0x3387be,null));};exports[_0x7e11('0x46')]=function(_0x59f142,_0x2c35ed){return respondWithRpcPromise(_0x7e11('0x47'),_0x59f142[_0x7e11('0x15')],mailClient)[_0x7e11('0x16')](respondWithResult(_0x2c35ed,null))[_0x7e11('0xb')](handleError(_0x2c35ed,null));};exports[_0x7e11('0x48')]=function(_0x224065,_0x10f1e8){return respondWithRpcPromise('OpenchannelQueues',_0x224065[_0x7e11('0x15')],routingClient)[_0x7e11('0x16')](respondWithResult(_0x10f1e8,null))[_0x7e11('0xb')](handleError(_0x10f1e8,null));};exports[_0x7e11('0x49')]=function(_0x31b04d,_0x36b1ba){return respondWithRpcPromise(_0x7e11('0x4a'),_0x31b04d[_0x7e11('0x15')],routingClient)[_0x7e11('0x16')](findById(_0x31b04d[_0x7e11('0x1a')]['id']))['then'](respondWithResult(_0x36b1ba,null))[_0x7e11('0xb')](handleError(_0x36b1ba,null));};exports['smsQueues']=function(_0x90ecd3,_0x3492cc){return respondWithRpcPromise(_0x7e11('0x4b'),_0x90ecd3[_0x7e11('0x15')],routingClient)[_0x7e11('0x16')](respondWithResult(_0x3492cc,null))[_0x7e11('0xb')](handleError(_0x3492cc,null));};exports[_0x7e11('0x4c')]=function(_0x534959,_0x31892a){return respondWithRpcPromise(_0x7e11('0x4b'),_0x534959[_0x7e11('0x15')],routingClient)[_0x7e11('0x16')](findById(_0x534959[_0x7e11('0x1a')]['id']))[_0x7e11('0x16')](respondWithResult(_0x31892a,null))[_0x7e11('0xb')](handleError(_0x31892a,null));};exports[_0x7e11('0x4d')]=function(_0x5cf050,_0x25d6c2){return respondWithRpcPromise(_0x7e11('0x4e'),_0x5cf050['query'],routingClient)[_0x7e11('0x16')](respondWithResult(_0x25d6c2,null))[_0x7e11('0xb')](handleError(_0x25d6c2,null));};exports[_0x7e11('0x4f')]=function(_0x1e3c91,_0x33d5d9){return respondWithRpcPromise(_0x7e11('0x4e'),_0x1e3c91['query'],routingClient)['then'](findById(_0x1e3c91['params']['id']))['then'](respondWithResult(_0x33d5d9,null))[_0x7e11('0xb')](handleError(_0x33d5d9,null));};exports[_0x7e11('0x50')]=function(_0x175902,_0xf4aae0){return respondWithRpcPromise(_0x7e11('0x51'),_0x175902['query'])[_0x7e11('0x16')](respondWithResult(_0xf4aae0,null))[_0x7e11('0xb')](handleError(_0xf4aae0,null));};exports[_0x7e11('0x52')]=function(_0x5611e7,_0x88781d){return respondWithRpcPromise(_0x7e11('0x53'),_0x5611e7[_0x7e11('0x15')],routingClient)['then'](respondWithResult(_0x88781d,null))[_0x7e11('0xb')](handleError(_0x88781d,null));};exports[_0x7e11('0x54')]=function(_0x2c96ca,_0x18a10e){return respondWithRpcPromise(_0x7e11('0x55'),_0x2c96ca[_0x7e11('0x15')],routingClient)[_0x7e11('0x16')](respondWithResult(_0x18a10e,null))[_0x7e11('0xb')](handleError(_0x18a10e,null));};exports['openchannelQueuesWaitingInteractions']=function(_0x4573f0,_0x1a63b6){return respondWithRpcPromise(_0x7e11('0x56'),_0x4573f0['query'],routingClient)[_0x7e11('0x16')](respondWithResult(_0x1a63b6,null))[_0x7e11('0xb')](handleError(_0x1a63b6,null));};exports[_0x7e11('0x57')]=function(_0x923769,_0x24cba7){return respondWithRpcPromise('SmsQueuesWaitingInteractions',_0x923769[_0x7e11('0x15')],routingClient)[_0x7e11('0x16')](respondWithResult(_0x24cba7,null))[_0x7e11('0xb')](handleError(_0x24cba7,null));};exports[_0x7e11('0x58')]=function(_0x5b9639,_0x552994){return respondWithRpcPromise(_0x7e11('0x59'),_0x5b9639[_0x7e11('0x15')],routingClient)[_0x7e11('0x16')](respondWithResult(_0x552994,null))[_0x7e11('0xb')](handleError(_0x552994,null));};exports[_0x7e11('0x5a')]=function(_0x4cfc64){return function(_0xa6037f,_0x145317){var _0x11057f,_0x10fecc;var _0x330f42=_[_0x7e11('0x5b')](_0x4cfc64);var _0x343d5b=_0x4cfc64===_0x7e11('0x5c')?_0x7e11('0x5d'):_0x7e11('0x5e');return db[_0x330f42+_0x7e11('0x5f')][_0x7e11('0x60')]({'raw':!![],'where':{'id':_0xa6037f[_0x7e11('0x1a')]['id']}})[_0x7e11('0x16')](function(_0x25555e){if(_[_0x7e11('0x11')](_0x25555e)){throw new Error(_0x330f42+_0x7e11('0x61'));}_0x11057f=_0x25555e;return db[_0x330f42+_0x7e11('0x62')]['findOne']({'where':{'id':_0xa6037f['body'][_0x7e11('0x63')]},'include':[{'model':db[_0x330f42+'Interaction'],'as':'Interaction'},{'model':db[_0x330f42+_0x343d5b],'as':'Account'}]});})[_0x7e11('0x16')](function(_0x1ffdec){if(_[_0x7e11('0x11')](_0x1ffdec)){throw new Error(_0x330f42+'\x20Message\x20not\x20found');}_0x10fecc=_0x1ffdec;return _0x1ffdec['update']({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0xe2dc15={'uniqueid':_0x4cfc64+'.'+_0x10fecc['id']+'.'+_0x10fecc[_0x7e11('0x64')]['id'],'FromUserId':_0xa6037f['user']['id'],'type':'queue'};_0xe2dc15[_0x330f42+_0x7e11('0x65')]=_0x10fecc['id'];_0xe2dc15[_0x330f42+_0x7e11('0x66')]=_0x10fecc[_0x7e11('0x64')]['id'];_0xe2dc15[_0x7e11('0x67')+_0x330f42+_0x343d5b+'Id']=_0x10fecc[_0x7e11('0x5e')]['id'];_0xe2dc15['To'+_0x330f42+_0x7e11('0x68')]=_0x11057f['id'];return db[_0x330f42+_0x7e11('0x69')][_0x7e11('0x6a')](_0xe2dc15);})['then'](function(){return respondWithRpcPromise('Start',{'channel':_0x4cfc64,'interaction':_0x10fecc[_0x7e11('0x64')],'message':_0x10fecc,'account':_0x10fecc[_0x7e11('0x5e')],'applications':[{'id':0x0,'priority':0x1,'app':_0x7e11('0x6b'),'appdata':_0x11057f[_0x7e11('0x10')]+','+(_0x10fecc[_0x7e11('0x5e')][_0x7e11('0x6c')]||0x12c),'interval':_0x7e11('0x6d')}]},routingClient);})[_0x7e11('0x16')](respondWithResult(_0x145317,null))[_0x7e11('0xb')](handleError(_0x145317,null));};};exports[_0x7e11('0x6e')]=function(_0x13eefc,_0x50b446){var _0x593d81,_0x141479;if(_['isNil'](_0x13eefc[_0x7e11('0x2b')][_0x7e11('0x6f')])){throw new Error(_0x7e11('0x70'));}var _0x136ff6=_0x13eefc['body'][_0x7e11('0x6f')];var _0x34ce02=_['capitalize'](_0x136ff6);var _0x43c559=_0x136ff6===_0x7e11('0x5c')?_0x7e11('0x5d'):_0x7e11('0x5e');return db[_0x7e11('0x71')]['findOne']({'raw':!![],'where':{'id':_0x13eefc[_0x7e11('0x1a')]['id'],'role':_0x7e11('0x72')}})['then'](function(_0x4ac594){if(_['isNil'](_0x4ac594)){throw new Error(_0x7e11('0x73'));}_0x593d81=_0x4ac594;return db[_0x34ce02+_0x7e11('0x62')][_0x7e11('0x60')]({'where':{'id':_0x13eefc['body'][_0x7e11('0x63')]},'include':[{'model':db[_0x34ce02+_0x7e11('0x64')],'as':_0x7e11('0x64')},{'model':db[_0x34ce02+_0x43c559],'as':'Account'}]});})[_0x7e11('0x16')](function(_0x596a06){if(_[_0x7e11('0x11')](_0x596a06)){throw new Error(_0x34ce02+_0x7e11('0x74'));}_0x141479=_0x596a06;return _0x596a06[_0x7e11('0x75')]({'read':0x0,'readAt':null,'UserId':null});})[_0x7e11('0x16')](function(){var _0x2824e7={'uniqueid':_0x136ff6+'.'+_0x141479['id']+'.'+_0x141479[_0x7e11('0x64')]['id'],'FromUserId':_0x13eefc[_0x7e11('0x30')]['id'],'type':_0x7e11('0x6b'),'ToUserId':_0x593d81['id']};_0x2824e7[_0x34ce02+_0x7e11('0x65')]=_0x141479['id'];_0x2824e7[_0x34ce02+_0x7e11('0x66')]=_0x141479['Interaction']['id'];_0x2824e7[_0x7e11('0x67')+_0x34ce02+_0x43c559+'Id']=_0x141479[_0x7e11('0x5e')]['id'];return db[_0x34ce02+_0x7e11('0x69')][_0x7e11('0x6a')](_0x2824e7);})[_0x7e11('0x16')](function(){return respondWithRpcPromise(_0x7e11('0x76'),{'channel':_0x136ff6,'interaction':_0x141479[_0x7e11('0x64')],'message':_0x141479,'account':_0x141479['Account'],'applications':[{'id':0x0,'priority':0x1,'app':_0x7e11('0x72'),'appdata':_0x593d81[_0x7e11('0x10')]+','+(_0x141479[_0x7e11('0x5e')][_0x7e11('0x77')]||0x12c),'interval':_0x7e11('0x6d')}]},routingClient);})[_0x7e11('0x16')](respondWithResult(_0x50b446,null))[_0x7e11('0xb')](handleError(_0x50b446,null));}; \ No newline at end of file diff --git a/server/api/schedule/index.js b/server/api/schedule/index.js index 33764e8..c1b0193 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 _0xf2bc=['util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./schedule.controller','isAuthenticated','index','get','/:id','/:id/run','post','create','put','update','delete','destroy','multer'];(function(_0x182648,_0x2a7b01){var _0x10d106=function(_0x343645){while(--_0x343645){_0x182648['push'](_0x182648['shift']());}};_0x10d106(++_0x2a7b01);}(_0xf2bc,0xb3));var _0xcf2b=function(_0x290cda,_0x265739){_0x290cda=_0x290cda-0x0;var _0x32229b=_0xf2bc[_0x290cda];return _0x32229b;};'use strict';var multer=require(_0xcf2b('0x0'));var util=require(_0xcf2b('0x1'));var path=require(_0xcf2b('0x2'));var timeout=require(_0xcf2b('0x3'));var express=require(_0xcf2b('0x4'));var router=express[_0xcf2b('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0xcf2b('0x6'));var config=require(_0xcf2b('0x7'));var controller=require(_0xcf2b('0x8'));router['get']('/',auth[_0xcf2b('0x9')](),controller[_0xcf2b('0xa')]);router[_0xcf2b('0xb')](_0xcf2b('0xc'),auth[_0xcf2b('0x9')](),controller['show']);router[_0xcf2b('0xb')](_0xcf2b('0xd'),auth[_0xcf2b('0x9')](),controller['run']);router[_0xcf2b('0xe')]('/',auth[_0xcf2b('0x9')](),controller[_0xcf2b('0xf')]);router[_0xcf2b('0x10')](_0xcf2b('0xc'),auth[_0xcf2b('0x9')](),controller[_0xcf2b('0x11')]);router[_0xcf2b('0x12')](_0xcf2b('0xc'),auth[_0xcf2b('0x9')](),controller[_0xcf2b('0x13')]);module['exports']=router; \ No newline at end of file +var _0x6941=['show','run','post','create','put','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../config/environment','isAuthenticated','index','get','/:id'];(function(_0x53a62c,_0x8e0f22){var _0x40e9a2=function(_0x4ffb2e){while(--_0x4ffb2e){_0x53a62c['push'](_0x53a62c['shift']());}};_0x40e9a2(++_0x8e0f22);}(_0x6941,0xb3));var _0x1694=function(_0x3635ce,_0x33a6f9){_0x3635ce=_0x3635ce-0x0;var _0x97ecd0=_0x6941[_0x3635ce];return _0x97ecd0;};'use strict';var multer=require(_0x1694('0x0'));var util=require(_0x1694('0x1'));var path=require(_0x1694('0x2'));var timeout=require(_0x1694('0x3'));var express=require(_0x1694('0x4'));var router=express['Router']();var auth=require(_0x1694('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x1694('0x6'));var controller=require('./schedule.controller');router['get']('/',auth[_0x1694('0x7')](),controller[_0x1694('0x8')]);router[_0x1694('0x9')](_0x1694('0xa'),auth[_0x1694('0x7')](),controller[_0x1694('0xb')]);router['get']('/:id/run',auth[_0x1694('0x7')](),controller[_0x1694('0xc')]);router[_0x1694('0xd')]('/',auth[_0x1694('0x7')](),controller[_0x1694('0xe')]);router[_0x1694('0xf')](_0x1694('0xa'),auth[_0x1694('0x7')](),controller['update']);router[_0x1694('0x10')](_0x1694('0xa'),auth['isAuthenticated'](),controller[_0x1694('0x11')]);module[_0x1694('0x12')]=router; \ No newline at end of file diff --git a/server/api/schedule/schedule.attributes.js b/server/api/schedule/schedule.attributes.js index 46368d7..a9f0b94 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 _0x565f=['minutes','ENUM','pdf','csv','custom','default','BOOLEAN','TEXT','exports','STRING','0\x200\x20*\x20*\x20*','DATE','INTEGER','months','days','hours'];(function(_0x1c1c80,_0x4a0a3e){var _0x3970f8=function(_0xe30ae4){while(--_0xe30ae4){_0x1c1c80['push'](_0x1c1c80['shift']());}};_0x3970f8(++_0x4a0a3e);}(_0x565f,0x68));var _0xf565=function(_0x8a1d40,_0x4e04a8){_0x8a1d40=_0x8a1d40-0x0;var _0x288913=_0x565f[_0x8a1d40];return _0x288913;};'use strict';var Sequelize=require('sequelize');module[_0xf565('0x0')]={'name':{'type':Sequelize[_0xf565('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xf565('0x1')]},'active':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0xf565('0x1')],'allowNull':![],'defaultValue':_0xf565('0x2')},'startAt':{'type':Sequelize[_0xf565('0x3')],'allowNull':![]},'endAt':{'type':Sequelize[_0xf565('0x3')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0xf565('0x4')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize['ENUM']('years','quarters',_0xf565('0x5'),'weeks',_0xf565('0x6'),_0xf565('0x7'),_0xf565('0x8')),'allowNull':![],'defaultValue':'days'},'output':{'type':Sequelize[_0xf565('0x9')]('csv',_0xf565('0xa'),'xlsx'),'allowNull':![],'defaultValue':_0xf565('0xb')},'type':{'type':Sequelize[_0xf565('0x9')](_0xf565('0xc'),_0xf565('0xd')),'allowNull':![],'defaultValue':_0xf565('0xc')},'sendMail':{'type':Sequelize[_0xf565('0xe')],'defaultValue':![]},'email':{'type':Sequelize['STRING']},'cc':{'type':Sequelize['TEXT']},'bcc':{'type':Sequelize[_0xf565('0xf')]},'sendIfEmpty':{'type':Sequelize[_0xf565('0xe')],'defaultValue':!![]}}; \ No newline at end of file +var _0x07e8=['pdf','xlsx','custom','default','TEXT','sequelize','exports','STRING','BOOLEAN','0\x200\x20*\x20*\x20*','INTEGER','ENUM','years','months','weeks','days','hours','minutes','csv'];(function(_0x30c649,_0x2ebbac){var _0x3edfb9=function(_0xab82f5){while(--_0xab82f5){_0x30c649['push'](_0x30c649['shift']());}};_0x3edfb9(++_0x2ebbac);}(_0x07e8,0x10f));var _0x807e=function(_0x46aae3,_0x11d46c){_0x46aae3=_0x46aae3-0x0;var _0x4e5ff6=_0x07e8[_0x46aae3];return _0x4e5ff6;};'use strict';var Sequelize=require(_0x807e('0x0'));module[_0x807e('0x1')]={'name':{'type':Sequelize[_0x807e('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0x807e('0x3')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x807e('0x4')},'startAt':{'type':Sequelize['DATE'],'allowNull':![]},'endAt':{'type':Sequelize['DATE'],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0x807e('0x5')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0x807e('0x6')](_0x807e('0x7'),'quarters',_0x807e('0x8'),_0x807e('0x9'),_0x807e('0xa'),_0x807e('0xb'),_0x807e('0xc')),'allowNull':![],'defaultValue':'days'},'output':{'type':Sequelize[_0x807e('0x6')](_0x807e('0xd'),_0x807e('0xe'),_0x807e('0xf')),'allowNull':![],'defaultValue':_0x807e('0xd')},'type':{'type':Sequelize[_0x807e('0x6')](_0x807e('0x10'),_0x807e('0x11')),'allowNull':![],'defaultValue':_0x807e('0x10')},'sendMail':{'type':Sequelize[_0x807e('0x3')],'defaultValue':![]},'email':{'type':Sequelize[_0x807e('0x2')]},'cc':{'type':Sequelize[_0x807e('0x12')]},'bcc':{'type':Sequelize[_0x807e('0x12')]},'sendIfEmpty':{'type':Sequelize[_0x807e('0x3')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/schedule/schedule.controller.js b/server/api/schedule/schedule.controller.js index e288900..4d4a284 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 _0xe933=['userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','run','../../config/schedule','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','count','offset','limit','set','Content-Range','apply','reject','then','destroy','get','UserProfileResource','sendStatus','error','stack','name','send','index','Schedule','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','map','type','key','VIRTUAL','field','options','includeAll','include','catch','show','params','rawAttributes','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find'];(function(_0x219d87,_0x1cb6f7){var _0x22823d=function(_0x5357bf){while(--_0x5357bf){_0x219d87['push'](_0x219d87['shift']());}};_0x22823d(++_0x1cb6f7);}(_0xe933,0x103));var _0x3e93=function(_0x36884e,_0x48008f){_0x36884e=_0x36884e-0x0;var _0x1cc367=_0xe933[_0x36884e];return _0x1cc367;};'use strict';var pdf=require(_0x3e93('0x0'));var emlformat=require(_0x3e93('0x1'));var rimraf=require(_0x3e93('0x2'));var zipdir=require(_0x3e93('0x3'));var jsonpatch=require(_0x3e93('0x4'));var rp=require('request-promise');var moment=require(_0x3e93('0x5'));var BPromise=require(_0x3e93('0x6'));var Mustache=require(_0x3e93('0x7'));var util=require(_0x3e93('0x8'));var path=require(_0x3e93('0x9'));var sox=require('sox');var csv=require(_0x3e93('0xa'));var ejs=require(_0x3e93('0xb'));var fs=require('fs');var _=require(_0x3e93('0xc'));var squel=require(_0x3e93('0xd'));var crypto=require(_0x3e93('0xe'));var jsforce=require(_0x3e93('0xf'));var deskjs=require(_0x3e93('0x10'));var toCsv=require(_0x3e93('0xa'));var querystring=require(_0x3e93('0x11'));var Papa=require(_0x3e93('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x3e93('0x13'));var as=require(_0x3e93('0x14'));var hardwareService=require(_0x3e93('0x15'));var logger=require(_0x3e93('0x16'))(_0x3e93('0x17'));var utils=require(_0x3e93('0x18'));var config=require(_0x3e93('0x19'));var db=require(_0x3e93('0x1a'))['db'];function respondWithStatusCode(_0x125d58,_0x5596de){_0x5596de=_0x5596de||0xcc;return function(_0x1fbddc){if(_0x1fbddc){return _0x125d58['sendStatus'](_0x5596de);}return _0x125d58[_0x3e93('0x1b')](_0x5596de)[_0x3e93('0x1c')]();};}function respondWithResult(_0x208729,_0x30d9ac){_0x30d9ac=_0x30d9ac||0xc8;return function(_0x3acf84){if(_0x3acf84){return _0x208729[_0x3e93('0x1b')](_0x30d9ac)[_0x3e93('0x1d')](_0x3acf84);}};}function respondWithFilteredResult(_0x3916d5,_0x182258){return function(_0x105fda){if(_0x105fda){var _0xaf6ec5=_0x105fda[_0x3e93('0x1e')],_0x348a64=_0x182258[_0x3e93('0x1f')],_0x4bece2=_0x182258[_0x3e93('0x1f')]+_0x182258[_0x3e93('0x20')],_0x155ebb;if(_0x4bece2>=_0xaf6ec5){_0x4bece2=_0xaf6ec5;_0x155ebb=0xc8;}else{_0x155ebb=0xce;}_0x3916d5['status'](_0x155ebb);return _0x3916d5[_0x3e93('0x21')](_0x3e93('0x22'),_0x348a64+'-'+_0x4bece2+'/'+_0xaf6ec5)['json'](_0x105fda);}return null;};}function patchUpdates(_0x35e340){return function(_0x19b052){try{jsonpatch[_0x3e93('0x23')](_0x19b052,_0x35e340,!![]);}catch(_0xf665d){return BPromise[_0x3e93('0x24')](_0xf665d);}return _0x19b052['save']();};}function saveUpdates(_0x1f902e,_0x395ba9){return function(_0x1163ef){if(_0x1163ef){return _0x1163ef['update'](_0x1f902e)[_0x3e93('0x25')](function(_0x3a5d66){return _0x3a5d66;});}return null;};}function removeEntity(_0x511899,_0x13b8c1){return function(_0x276931){if(_0x276931){return _0x276931[_0x3e93('0x26')]()[_0x3e93('0x25')](function(){var _0x4903b8=_0x276931[_0x3e93('0x27')]({'plain':!![]});var _0x22d714='Scheduler';return db[_0x3e93('0x28')][_0x3e93('0x26')]({'where':{'type':_0x22d714,'resourceId':_0x4903b8['id']}})[_0x3e93('0x25')](function(){return _0x276931;});})['then'](function(){_0x511899[_0x3e93('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3c9ca7,_0x1cfad1){return function(_0x1a9506){if(!_0x1a9506){_0x3c9ca7[_0x3e93('0x29')](0x194);}return _0x1a9506;};}function handleError(_0x4cf3a4,_0x52a0d3){_0x52a0d3=_0x52a0d3||0x1f4;return function(_0x2901fd){logger[_0x3e93('0x2a')](_0x2901fd[_0x3e93('0x2b')]);if(_0x2901fd[_0x3e93('0x2c')]){delete _0x2901fd['name'];}_0x4cf3a4[_0x3e93('0x1b')](_0x52a0d3)[_0x3e93('0x2d')](_0x2901fd);};}exports[_0x3e93('0x2e')]=function(_0x142b22,_0x7bed97){var _0x44aba4={},_0x298bcb={},_0x1da03c={'count':0x0,'rows':[]};var _0x240ebe=db[_0x3e93('0x2f')]['rawAttributes'];_0x298bcb[_0x3e93('0x30')]=_[_0x3e93('0x31')](_0x240ebe);_0x298bcb[_0x3e93('0x32')]=_['keys'](_0x142b22[_0x3e93('0x32')]);_0x298bcb[_0x3e93('0x33')]=_[_0x3e93('0x34')](_0x298bcb[_0x3e93('0x30')],_0x298bcb['query']);_0x44aba4[_0x3e93('0x35')]=_[_0x3e93('0x34')](_0x298bcb[_0x3e93('0x30')],qs[_0x3e93('0x36')](_0x142b22[_0x3e93('0x32')][_0x3e93('0x36')]));_0x44aba4[_0x3e93('0x35')]=_0x44aba4[_0x3e93('0x35')][_0x3e93('0x37')]?_0x44aba4[_0x3e93('0x35')]:_0x298bcb[_0x3e93('0x30')];if(!_0x142b22[_0x3e93('0x32')][_0x3e93('0x38')]('nolimit')){_0x44aba4['limit']=qs[_0x3e93('0x20')](_0x142b22[_0x3e93('0x32')]['limit']);_0x44aba4[_0x3e93('0x1f')]=qs['offset'](_0x142b22['query'][_0x3e93('0x1f')]);}_0x44aba4[_0x3e93('0x39')]=qs[_0x3e93('0x3a')](_0x142b22[_0x3e93('0x32')]['sort']);_0x44aba4[_0x3e93('0x3b')]=qs[_0x3e93('0x33')](_[_0x3e93('0x3c')](_0x142b22[_0x3e93('0x32')],_0x298bcb[_0x3e93('0x33')]));if(_0x142b22[_0x3e93('0x32')][_0x3e93('0x3d')]){_0x44aba4['where']=_[_0x3e93('0x3e')](_0x44aba4[_0x3e93('0x3b')],{'$or':_[_0x3e93('0x3f')](_0x240ebe,function(_0x41fbca){if(_0x41fbca[_0x3e93('0x40')][_0x3e93('0x41')]!==_0x3e93('0x42')){var _0x275137={};_0x275137[_0x41fbca[_0x3e93('0x43')]]={'$like':'%'+_0x142b22[_0x3e93('0x32')][_0x3e93('0x3d')]+'%'};return _0x275137;}})});}_0x44aba4=_[_0x3e93('0x3e')]({},_0x44aba4,_0x142b22[_0x3e93('0x44')]);var _0x3e20e5={'where':_0x44aba4[_0x3e93('0x3b')]};return db[_0x3e93('0x2f')]['count'](_0x3e20e5)[_0x3e93('0x25')](function(_0xb499a8){_0x1da03c['count']=_0xb499a8;if(_0x142b22[_0x3e93('0x32')][_0x3e93('0x45')]){_0x44aba4[_0x3e93('0x46')]=[{'all':!![]}];}return db[_0x3e93('0x2f')]['findAll'](_0x44aba4);})['then'](function(_0x510532){_0x1da03c['rows']=_0x510532;return _0x1da03c;})['then'](respondWithFilteredResult(_0x7bed97,_0x44aba4))[_0x3e93('0x47')](handleError(_0x7bed97,null));};exports[_0x3e93('0x48')]=function(_0x3db7f4,_0x29effd){var _0x51b701={'raw':![],'where':{'id':_0x3db7f4[_0x3e93('0x49')]['id']}},_0x3f6635={};_0x3f6635[_0x3e93('0x30')]=_[_0x3e93('0x31')](db[_0x3e93('0x2f')][_0x3e93('0x4a')]);_0x3f6635[_0x3e93('0x32')]=_['keys'](_0x3db7f4[_0x3e93('0x32')]);_0x3f6635[_0x3e93('0x33')]=_[_0x3e93('0x34')](_0x3f6635['model'],_0x3f6635['query']);_0x51b701[_0x3e93('0x35')]=_['intersection'](_0x3f6635['model'],qs[_0x3e93('0x36')](_0x3db7f4[_0x3e93('0x32')][_0x3e93('0x36')]));_0x51b701['attributes']=_0x51b701['attributes'][_0x3e93('0x37')]?_0x51b701[_0x3e93('0x35')]:_0x3f6635[_0x3e93('0x30')];if(_0x3db7f4[_0x3e93('0x32')][_0x3e93('0x45')]){_0x51b701['include']=[{'all':!![]}];}_0x51b701=_[_0x3e93('0x3e')]({},_0x51b701,_0x3db7f4[_0x3e93('0x44')]);return db[_0x3e93('0x2f')]['find'](_0x51b701)[_0x3e93('0x25')](handleEntityNotFound(_0x29effd,null))[_0x3e93('0x25')](respondWithResult(_0x29effd,null))[_0x3e93('0x47')](handleError(_0x29effd,null));};exports[_0x3e93('0x4b')]=function(_0x383de4,_0x25d6d4){return db['Schedule'][_0x3e93('0x4b')](_0x383de4[_0x3e93('0x4c')],{})[_0x3e93('0x25')](function(_0x4b1a15){var _0x59bf9a=_0x383de4[_0x3e93('0x4d')][_0x3e93('0x27')]({'plain':!![]});if(!_0x59bf9a)throw new Error(_0x3e93('0x4e'));if(_0x59bf9a['role']===_0x3e93('0x4d')){var _0x1f2fec=_0x4b1a15[_0x3e93('0x27')]({'plain':!![]});var _0x148779='Scheduler';return db[_0x3e93('0x4f')][_0x3e93('0x50')]({'where':{'name':_0x148779,'userProfileId':_0x59bf9a[_0x3e93('0x51')]},'raw':!![]})[_0x3e93('0x25')](function(_0x86f7ec){if(_0x86f7ec&&_0x86f7ec['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x1f2fec['name'],'resourceId':_0x1f2fec['id'],'type':_0x86f7ec[_0x3e93('0x2c')],'sectionId':_0x86f7ec['id']},{})[_0x3e93('0x25')](function(){return _0x4b1a15;});}else{return _0x4b1a15;}})[_0x3e93('0x47')](function(_0x5594d4){logger['error'](_0x3e93('0x52'),_0x5594d4);throw _0x5594d4;});}return _0x4b1a15;})[_0x3e93('0x25')](respondWithResult(_0x25d6d4,0xc9))['catch'](handleError(_0x25d6d4,null));};exports['update']=function(_0x5b4d31,_0x49b894){if(_0x5b4d31[_0x3e93('0x4c')]['id']){delete _0x5b4d31[_0x3e93('0x4c')]['id'];}return db[_0x3e93('0x2f')]['find']({'where':{'id':_0x5b4d31[_0x3e93('0x49')]['id']}})['then'](handleEntityNotFound(_0x49b894,null))['then'](saveUpdates(_0x5b4d31['body'],null))[_0x3e93('0x25')](respondWithResult(_0x49b894,null))[_0x3e93('0x47')](handleError(_0x49b894,null));};exports[_0x3e93('0x26')]=function(_0x4f9055,_0x299ee1){return db[_0x3e93('0x2f')]['find']({'where':{'id':_0x4f9055[_0x3e93('0x49')]['id']}})[_0x3e93('0x25')](handleEntityNotFound(_0x299ee1,null))[_0x3e93('0x25')](removeEntity(_0x299ee1,null))[_0x3e93('0x47')](handleError(_0x299ee1,null));};exports[_0x3e93('0x53')]=function(_0x4f3ee9,_0xbf1857,_0x3bb4fb){var _0x462a43=require(_0x3e93('0x54'));return db[_0x3e93('0x2f')][_0x3e93('0x50')]({'where':{'id':_0x4f3ee9[_0x3e93('0x49')]['id']},'raw':!![]})[_0x3e93('0x25')](handleEntityNotFound(_0xbf1857,null))[_0x3e93('0x25')](function(){_0x462a43['run'](_0x4f3ee9[_0x3e93('0x49')]['id']);})[_0x3e93('0x25')](respondWithStatusCode(_0xbf1857,null))['catch'](handleError(_0xbf1857,null));}; \ No newline at end of file +var _0x27b3=['destroy','get','Scheduler','UserProfileResource','end','stack','name','send','index','rawAttributes','query','keys','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filters','filter','merge','map','key','VIRTUAL','Schedule','includeAll','include','findAll','rows','params','find','catch','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','run','../../config/schedule','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','bluebird','path','sox','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then'];(function(_0x2865c9,_0x575948){var _0x585985=function(_0x3f03c2){while(--_0x3f03c2){_0x2865c9['push'](_0x2865c9['shift']());}};_0x585985(++_0x575948);}(_0x27b3,0xd7));var _0x327b=function(_0x3404fb,_0x3cc242){_0x3404fb=_0x3404fb-0x0;var _0x55d37c=_0x27b3[_0x3404fb];return _0x55d37c;};'use strict';var pdf=require(_0x327b('0x0'));var emlformat=require(_0x327b('0x1'));var rimraf=require(_0x327b('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x327b('0x3'));var rp=require(_0x327b('0x4'));var moment=require('moment');var BPromise=require(_0x327b('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x327b('0x6'));var sox=require(_0x327b('0x7'));var csv=require('to-csv');var ejs=require(_0x327b('0x8'));var fs=require('fs');var _=require(_0x327b('0x9'));var squel=require('squel');var crypto=require(_0x327b('0xa'));var jsforce=require(_0x327b('0xb'));var deskjs=require(_0x327b('0xc'));var toCsv=require(_0x327b('0xd'));var querystring=require(_0x327b('0xe'));var Papa=require(_0x327b('0xf'));var Redis=require(_0x327b('0x10'));var authService=require(_0x327b('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x327b('0x12'));var hardwareService=require(_0x327b('0x13'));var logger=require(_0x327b('0x14'))(_0x327b('0x15'));var utils=require(_0x327b('0x16'));var config=require('../../config/environment');var db=require(_0x327b('0x17'))['db'];function respondWithStatusCode(_0x52c049,_0x66d6e9){_0x66d6e9=_0x66d6e9||0xcc;return function(_0x1fb4ed){if(_0x1fb4ed){return _0x52c049[_0x327b('0x18')](_0x66d6e9);}return _0x52c049[_0x327b('0x19')](_0x66d6e9)['end']();};}function respondWithResult(_0x5d6c9c,_0xa339d){_0xa339d=_0xa339d||0xc8;return function(_0x2b42f8){if(_0x2b42f8){return _0x5d6c9c[_0x327b('0x19')](_0xa339d)[_0x327b('0x1a')](_0x2b42f8);}};}function respondWithFilteredResult(_0x30722e,_0x3ae625){return function(_0x3bf82c){if(_0x3bf82c){var _0x231d17=_0x3bf82c[_0x327b('0x1b')],_0x22a193=_0x3ae625['offset'],_0x358465=_0x3ae625[_0x327b('0x1c')]+_0x3ae625[_0x327b('0x1d')],_0x16c50d;if(_0x358465>=_0x231d17){_0x358465=_0x231d17;_0x16c50d=0xc8;}else{_0x16c50d=0xce;}_0x30722e[_0x327b('0x19')](_0x16c50d);return _0x30722e[_0x327b('0x1e')](_0x327b('0x1f'),_0x22a193+'-'+_0x358465+'/'+_0x231d17)[_0x327b('0x1a')](_0x3bf82c);}return null;};}function patchUpdates(_0x495423){return function(_0x2237b2){try{jsonpatch[_0x327b('0x20')](_0x2237b2,_0x495423,!![]);}catch(_0x1096d7){return BPromise[_0x327b('0x21')](_0x1096d7);}return _0x2237b2[_0x327b('0x22')]();};}function saveUpdates(_0x1c589f,_0x1fd773){return function(_0x544bc4){if(_0x544bc4){return _0x544bc4[_0x327b('0x23')](_0x1c589f)[_0x327b('0x24')](function(_0x31a6d9){return _0x31a6d9;});}return null;};}function removeEntity(_0x314b61,_0x5a11c1){return function(_0x22f54d){if(_0x22f54d){return _0x22f54d[_0x327b('0x25')]()[_0x327b('0x24')](function(){var _0x31a256=_0x22f54d[_0x327b('0x26')]({'plain':!![]});var _0x5e78d5=_0x327b('0x27');return db[_0x327b('0x28')]['destroy']({'where':{'type':_0x5e78d5,'resourceId':_0x31a256['id']}})[_0x327b('0x24')](function(){return _0x22f54d;});})['then'](function(){_0x314b61[_0x327b('0x19')](0xcc)[_0x327b('0x29')]();});}};}function handleEntityNotFound(_0x22fb78,_0xb4e51e){return function(_0x3f900b){if(!_0x3f900b){_0x22fb78[_0x327b('0x18')](0x194);}return _0x3f900b;};}function handleError(_0x465976,_0x44fab6){_0x44fab6=_0x44fab6||0x1f4;return function(_0x4ed746){logger['error'](_0x4ed746[_0x327b('0x2a')]);if(_0x4ed746['name']){delete _0x4ed746[_0x327b('0x2b')];}_0x465976[_0x327b('0x19')](_0x44fab6)[_0x327b('0x2c')](_0x4ed746);};}exports[_0x327b('0x2d')]=function(_0x498201,_0x33c9f){var _0x42e439={},_0x28fb38={},_0x54b347={'count':0x0,'rows':[]};var _0x4d7d4b=db['Schedule'][_0x327b('0x2e')];_0x28fb38['model']=_['keys'](_0x4d7d4b);_0x28fb38[_0x327b('0x2f')]=_[_0x327b('0x30')](_0x498201[_0x327b('0x2f')]);_0x28fb38['filters']=_[_0x327b('0x31')](_0x28fb38[_0x327b('0x32')],_0x28fb38['query']);_0x42e439['attributes']=_[_0x327b('0x31')](_0x28fb38[_0x327b('0x32')],qs[_0x327b('0x33')](_0x498201[_0x327b('0x2f')][_0x327b('0x33')]));_0x42e439[_0x327b('0x34')]=_0x42e439[_0x327b('0x34')][_0x327b('0x35')]?_0x42e439[_0x327b('0x34')]:_0x28fb38[_0x327b('0x32')];if(!_0x498201[_0x327b('0x2f')][_0x327b('0x36')](_0x327b('0x37'))){_0x42e439[_0x327b('0x1d')]=qs['limit'](_0x498201[_0x327b('0x2f')][_0x327b('0x1d')]);_0x42e439['offset']=qs[_0x327b('0x1c')](_0x498201[_0x327b('0x2f')][_0x327b('0x1c')]);}_0x42e439['order']=qs['sort'](_0x498201[_0x327b('0x2f')][_0x327b('0x38')]);_0x42e439[_0x327b('0x39')]=qs['filters'](_[_0x327b('0x3a')](_0x498201[_0x327b('0x2f')],_0x28fb38[_0x327b('0x3b')]));if(_0x498201[_0x327b('0x2f')][_0x327b('0x3c')]){_0x42e439[_0x327b('0x39')]=_[_0x327b('0x3d')](_0x42e439[_0x327b('0x39')],{'$or':_[_0x327b('0x3e')](_0x4d7d4b,function(_0x5e77be){if(_0x5e77be['type'][_0x327b('0x3f')]!==_0x327b('0x40')){var _0x2c57d5={};_0x2c57d5[_0x5e77be['field']]={'$like':'%'+_0x498201[_0x327b('0x2f')]['filter']+'%'};return _0x2c57d5;}})});}_0x42e439=_[_0x327b('0x3d')]({},_0x42e439,_0x498201['options']);var _0x4c3dc8={'where':_0x42e439[_0x327b('0x39')]};return db[_0x327b('0x41')]['count'](_0x4c3dc8)[_0x327b('0x24')](function(_0xb6130e){_0x54b347[_0x327b('0x1b')]=_0xb6130e;if(_0x498201['query'][_0x327b('0x42')]){_0x42e439[_0x327b('0x43')]=[{'all':!![]}];}return db[_0x327b('0x41')][_0x327b('0x44')](_0x42e439);})['then'](function(_0x14220a){_0x54b347[_0x327b('0x45')]=_0x14220a;return _0x54b347;})['then'](respondWithFilteredResult(_0x33c9f,_0x42e439))['catch'](handleError(_0x33c9f,null));};exports['show']=function(_0x27e31e,_0x101e84){var _0x33a321={'raw':![],'where':{'id':_0x27e31e[_0x327b('0x46')]['id']}},_0x147395={};_0x147395[_0x327b('0x32')]=_[_0x327b('0x30')](db[_0x327b('0x41')][_0x327b('0x2e')]);_0x147395[_0x327b('0x2f')]=_[_0x327b('0x30')](_0x27e31e[_0x327b('0x2f')]);_0x147395['filters']=_[_0x327b('0x31')](_0x147395[_0x327b('0x32')],_0x147395['query']);_0x33a321[_0x327b('0x34')]=_[_0x327b('0x31')](_0x147395[_0x327b('0x32')],qs[_0x327b('0x33')](_0x27e31e[_0x327b('0x2f')][_0x327b('0x33')]));_0x33a321[_0x327b('0x34')]=_0x33a321[_0x327b('0x34')][_0x327b('0x35')]?_0x33a321[_0x327b('0x34')]:_0x147395[_0x327b('0x32')];if(_0x27e31e[_0x327b('0x2f')][_0x327b('0x42')]){_0x33a321[_0x327b('0x43')]=[{'all':!![]}];}_0x33a321=_[_0x327b('0x3d')]({},_0x33a321,_0x27e31e['options']);return db[_0x327b('0x41')][_0x327b('0x47')](_0x33a321)['then'](handleEntityNotFound(_0x101e84,null))[_0x327b('0x24')](respondWithResult(_0x101e84,null))[_0x327b('0x48')](handleError(_0x101e84,null));};exports['create']=function(_0x33156e,_0x168b1c){return db[_0x327b('0x41')]['create'](_0x33156e[_0x327b('0x49')],{})['then'](function(_0xe1376f){var _0x13862c=_0x33156e[_0x327b('0x4a')][_0x327b('0x26')]({'plain':!![]});if(!_0x13862c)throw new Error(_0x327b('0x4b'));if(_0x13862c[_0x327b('0x4c')]===_0x327b('0x4a')){var _0x574030=_0xe1376f[_0x327b('0x26')]({'plain':!![]});var _0x33b359=_0x327b('0x27');return db[_0x327b('0x4d')][_0x327b('0x47')]({'where':{'name':_0x33b359,'userProfileId':_0x13862c[_0x327b('0x4e')]},'raw':!![]})['then'](function(_0x47ab4a){if(_0x47ab4a&&_0x47ab4a[_0x327b('0x4f')]===0x0){return db[_0x327b('0x28')]['create']({'name':_0x574030[_0x327b('0x2b')],'resourceId':_0x574030['id'],'type':_0x47ab4a[_0x327b('0x2b')],'sectionId':_0x47ab4a['id']},{})[_0x327b('0x24')](function(){return _0xe1376f;});}else{return _0xe1376f;}})['catch'](function(_0xe9ef91){logger[_0x327b('0x50')](_0x327b('0x51'),_0xe9ef91);throw _0xe9ef91;});}return _0xe1376f;})[_0x327b('0x24')](respondWithResult(_0x168b1c,0xc9))[_0x327b('0x48')](handleError(_0x168b1c,null));};exports[_0x327b('0x23')]=function(_0x2a5611,_0x3e75de){if(_0x2a5611[_0x327b('0x49')]['id']){delete _0x2a5611[_0x327b('0x49')]['id'];}return db[_0x327b('0x41')][_0x327b('0x47')]({'where':{'id':_0x2a5611[_0x327b('0x46')]['id']}})[_0x327b('0x24')](handleEntityNotFound(_0x3e75de,null))[_0x327b('0x24')](saveUpdates(_0x2a5611[_0x327b('0x49')],null))['then'](respondWithResult(_0x3e75de,null))[_0x327b('0x48')](handleError(_0x3e75de,null));};exports[_0x327b('0x25')]=function(_0x5d2855,_0x559ae5){return db[_0x327b('0x41')][_0x327b('0x47')]({'where':{'id':_0x5d2855[_0x327b('0x46')]['id']}})[_0x327b('0x24')](handleEntityNotFound(_0x559ae5,null))[_0x327b('0x24')](removeEntity(_0x559ae5,null))['catch'](handleError(_0x559ae5,null));};exports[_0x327b('0x52')]=function(_0xe47d18,_0x484a31,_0x249250){var _0x1d07c9=require(_0x327b('0x53'));return db[_0x327b('0x41')][_0x327b('0x47')]({'where':{'id':_0xe47d18['params']['id']},'raw':!![]})['then'](handleEntityNotFound(_0x484a31,null))['then'](function(){_0x1d07c9[_0x327b('0x52')](_0xe47d18[_0x327b('0x46')]['id']);})[_0x327b('0x24')](respondWithStatusCode(_0x484a31,null))[_0x327b('0x48')](handleError(_0x484a31,null));}; \ No newline at end of file diff --git a/server/api/schedule/schedule.model.js b/server/api/schedule/schedule.model.js index 6450f1a..6ffbefe 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 _0xb895=['./schedule.attributes','exports','define','Schedule','tools_schedules','util','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x4512bf,_0x5b57d1){var _0x2166bb=function(_0x137338){while(--_0x137338){_0x4512bf['push'](_0x4512bf['shift']());}};_0x2166bb(++_0x5b57d1);}(_0xb895,0x155));var _0x5b89=function(_0xca501d,_0x294db0){_0xca501d=_0xca501d-0x0;var _0x4c63c8=_0xb895[_0xca501d];return _0x4c63c8;};'use strict';var _=require('lodash');var util=require(_0x5b89('0x0'));var logger=require('../../config/logger')(_0x5b89('0x1'));var moment=require(_0x5b89('0x2'));var BPromise=require(_0x5b89('0x3'));var rp=require(_0x5b89('0x4'));var fs=require('fs');var path=require(_0x5b89('0x5'));var rimraf=require(_0x5b89('0x6'));var config=require('../../config/environment');var attributes=require(_0x5b89('0x7'));module[_0x5b89('0x8')]=function(_0x658528,_0x3d9522){return _0x658528[_0x5b89('0x9')](_0x5b89('0xa'),attributes,{'tableName':_0x5b89('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1d4a=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./schedule.attributes','exports','define','Schedule','tools_schedules','lodash','util','../../config/logger','api'];(function(_0x37366c,_0x1ab934){var _0xfe9b0a=function(_0x28d71d){while(--_0x28d71d){_0x37366c['push'](_0x37366c['shift']());}};_0xfe9b0a(++_0x1ab934);}(_0x1d4a,0x83));var _0xa1d4=function(_0x31214e,_0x24f114){_0x31214e=_0x31214e-0x0;var _0x4f0c8a=_0x1d4a[_0x31214e];return _0x4f0c8a;};'use strict';var _=require(_0xa1d4('0x0'));var util=require(_0xa1d4('0x1'));var logger=require(_0xa1d4('0x2'))(_0xa1d4('0x3'));var moment=require(_0xa1d4('0x4'));var BPromise=require(_0xa1d4('0x5'));var rp=require(_0xa1d4('0x6'));var fs=require('fs');var path=require(_0xa1d4('0x7'));var rimraf=require(_0xa1d4('0x8'));var config=require(_0xa1d4('0x9'));var attributes=require(_0xa1d4('0xa'));module[_0xa1d4('0xb')]=function(_0x39ab53,_0x9d2994){return _0x39ab53[_0xa1d4('0xc')](_0xa1d4('0xd'),attributes,{'tableName':_0xa1d4('0xe'),'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 2cfdb65..1abbc7f 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 _0x1e4b=['lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/environment','jayson/promise','http','request','then','info','Schedule,\x20%s,\x20%s','Schedule,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch'];(function(_0x59a1f7,_0x3158cc){var _0x14f2b7=function(_0x5bffd1){while(--_0x5bffd1){_0x59a1f7['push'](_0x59a1f7['shift']());}};_0x14f2b7(++_0x3158cc);}(_0x1e4b,0x1db));var _0xb1e4=function(_0x1423e9,_0x1c53d3){_0x1423e9=_0x1423e9-0x0;var _0xc76fb4=_0x1e4b[_0x1423e9];return _0xc76fb4;};'use strict';var _=require(_0xb1e4('0x0'));var util=require(_0xb1e4('0x1'));var moment=require('moment');var BPromise=require(_0xb1e4('0x2'));var rs=require(_0xb1e4('0x3'));var fs=require('fs');var Redis=require(_0xb1e4('0x4'));var db=require(_0xb1e4('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xb1e4('0x6'));var jayson=require(_0xb1e4('0x7'));var client=jayson['client'][_0xb1e4('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x175647,_0x256a43,_0x502611){return new BPromise(function(_0x26cdbf,_0x1b664d){return client[_0xb1e4('0x9')](_0x175647,_0x502611)[_0xb1e4('0xa')](function(_0x1b4ff0){logger[_0xb1e4('0xb')](_0xb1e4('0xc'),_0x256a43,'request\x20sent');logger['debug'](_0xb1e4('0xd'),_0x256a43,_0xb1e4('0xe'),JSON[_0xb1e4('0xf')](_0x1b4ff0));if(_0x1b4ff0[_0xb1e4('0x10')]){if(_0x1b4ff0[_0xb1e4('0x10')]['code']===0x1f4){logger[_0xb1e4('0x10')]('Schedule,\x20%s,\x20%s',_0x256a43,_0x1b4ff0[_0xb1e4('0x10')][_0xb1e4('0x11')]);return _0x1b664d(_0x1b4ff0[_0xb1e4('0x10')][_0xb1e4('0x11')]);}logger['error']('Schedule,\x20%s,\x20%s',_0x256a43,_0x1b4ff0[_0xb1e4('0x10')][_0xb1e4('0x11')]);return _0x26cdbf(_0x1b4ff0['error'][_0xb1e4('0x11')]);}else{logger[_0xb1e4('0xb')](_0xb1e4('0xc'),_0x256a43,_0xb1e4('0xe'));_0x26cdbf(_0x1b4ff0['result'][_0xb1e4('0x11')]);}})[_0xb1e4('0x12')](function(_0x21bc9a){logger['error'](_0xb1e4('0xc'),_0x256a43,_0x21bc9a);_0x1b664d(_0x21bc9a);});});} \ No newline at end of file +var _0xd005=['util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','Schedule,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash'];(function(_0x44ac58,_0x1662e4){var _0x2de73f=function(_0x25f4f0){while(--_0x25f4f0){_0x44ac58['push'](_0x44ac58['shift']());}};_0x2de73f(++_0x1662e4);}(_0xd005,0x16f));var _0x5d00=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd005[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x5d00('0x0'));var util=require(_0x5d00('0x1'));var moment=require(_0x5d00('0x2'));var BPromise=require(_0x5d00('0x3'));var rs=require(_0x5d00('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5d00('0x5'))['db'];var utils=require(_0x5d00('0x6'));var logger=require(_0x5d00('0x7'))(_0x5d00('0x8'));var config=require(_0x5d00('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x5d00('0xa')][_0x5d00('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x6a17a3,_0x596beb,_0x26bb89){return new BPromise(function(_0x4103c7,_0x3510bd){return client[_0x5d00('0xc')](_0x6a17a3,_0x26bb89)[_0x5d00('0xd')](function(_0x518e25){logger['info'](_0x5d00('0xe'),_0x596beb,_0x5d00('0xf'));logger[_0x5d00('0x10')]('Schedule,\x20%s,\x20%s,\x20%s',_0x596beb,'request\x20sent',JSON[_0x5d00('0x11')](_0x518e25));if(_0x518e25[_0x5d00('0x12')]){if(_0x518e25[_0x5d00('0x12')][_0x5d00('0x13')]===0x1f4){logger[_0x5d00('0x12')]('Schedule,\x20%s,\x20%s',_0x596beb,_0x518e25['error'][_0x5d00('0x14')]);return _0x3510bd(_0x518e25[_0x5d00('0x12')][_0x5d00('0x14')]);}logger['error'](_0x5d00('0xe'),_0x596beb,_0x518e25[_0x5d00('0x12')][_0x5d00('0x14')]);return _0x4103c7(_0x518e25[_0x5d00('0x12')][_0x5d00('0x14')]);}else{logger['info']('Schedule,\x20%s,\x20%s',_0x596beb,_0x5d00('0xf'));_0x4103c7(_0x518e25[_0x5d00('0x15')][_0x5d00('0x14')]);}})[_0x5d00('0x16')](function(_0x2dde38){logger[_0x5d00('0x12')](_0x5d00('0xe'),_0x596beb,_0x2dde38);_0x3510bd(_0x2dde38);});});} \ No newline at end of file diff --git a/server/api/screenRecording/index.js b/server/api/screenRecording/index.js index 51c67b7..d8517f5 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 _0x5edb=['delete','destroy','multer','Router','../../components/auth/service','../../components/interaction/service','./screenRecording.controller','get','isAuthenticated','index','/describe','describe','/:id/download','download','post','create','update'];(function(_0x28dae4,_0x3d7372){var _0x17647a=function(_0x3338b2){while(--_0x3338b2){_0x28dae4['push'](_0x28dae4['shift']());}};_0x17647a(++_0x3d7372);}(_0x5edb,0x19a));var _0xb5ed=function(_0x6bf908,_0x66e26d){_0x6bf908=_0x6bf908-0x0;var _0x2f3834=_0x5edb[_0x6bf908];return _0x2f3834;};'use strict';var multer=require(_0xb5ed('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xb5ed('0x1')]();var auth=require(_0xb5ed('0x2'));var interaction=require(_0xb5ed('0x3'));var config=require('../../config/environment');var controller=require(_0xb5ed('0x4'));router[_0xb5ed('0x5')]('/',auth[_0xb5ed('0x6')](),controller[_0xb5ed('0x7')]);router[_0xb5ed('0x5')](_0xb5ed('0x8'),auth['isAuthenticated'](),controller[_0xb5ed('0x9')]);router[_0xb5ed('0x5')]('/:id',auth[_0xb5ed('0x6')](),controller['show']);router[_0xb5ed('0x5')](_0xb5ed('0xa'),auth[_0xb5ed('0x6')](),controller[_0xb5ed('0xb')]);router[_0xb5ed('0xc')]('/',auth['isAuthenticated'](),controller[_0xb5ed('0xd')]);router['put']('/:id',auth[_0xb5ed('0x6')](),controller[_0xb5ed('0xe')]);router[_0xb5ed('0xf')]('/:id',auth['isAuthenticated'](),controller[_0xb5ed('0x10')]);module['exports']=router; \ No newline at end of file +var _0xc2c2=['path','connect-timeout','Router','../../config/environment','./screenRecording.controller','get','isAuthenticated','/describe','describe','/:id','show','post','put','update','delete','destroy','exports','multer'];(function(_0x21aec3,_0x5c97e9){var _0x288bbc=function(_0x2283fe){while(--_0x2283fe){_0x21aec3['push'](_0x21aec3['shift']());}};_0x288bbc(++_0x5c97e9);}(_0xc2c2,0x155));var _0x2c2c=function(_0x46007a,_0x5c715a){_0x46007a=_0x46007a-0x0;var _0x41f8eb=_0xc2c2[_0x46007a];return _0x41f8eb;};'use strict';var multer=require(_0x2c2c('0x0'));var util=require('util');var path=require(_0x2c2c('0x1'));var timeout=require(_0x2c2c('0x2'));var express=require('express');var router=express[_0x2c2c('0x3')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x2c2c('0x4'));var controller=require(_0x2c2c('0x5'));router[_0x2c2c('0x6')]('/',auth[_0x2c2c('0x7')](),controller['index']);router['get'](_0x2c2c('0x8'),auth[_0x2c2c('0x7')](),controller[_0x2c2c('0x9')]);router[_0x2c2c('0x6')](_0x2c2c('0xa'),auth[_0x2c2c('0x7')](),controller[_0x2c2c('0xb')]);router[_0x2c2c('0x6')]('/:id/download',auth['isAuthenticated'](),controller['download']);router[_0x2c2c('0xc')]('/',auth[_0x2c2c('0x7')](),controller['create']);router[_0x2c2c('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x2c2c('0xe')]);router[_0x2c2c('0xf')](_0x2c2c('0xa'),auth[_0x2c2c('0x7')](),controller[_0x2c2c('0x10')]);module[_0x2c2c('0x11')]=router; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.attributes.js b/server/api/screenRecording/screenRecording.attributes.js index 7f2d466..36aef04 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 _0x98a8=['updatedAt','sequelize','moment','path','../../config/environment','exports','VIRTUAL','getDataValue','extname','value','STRING','replace','INTEGER','setDataValue','startedAt','subtract','closedAt','duration','format','MM-DD-YYYY\x20HH:mm','toString','DATE','createdAt'];(function(_0x839798,_0x494885){var _0x1272e0=function(_0x20ea3d){while(--_0x20ea3d){_0x839798['push'](_0x839798['shift']());}};_0x1272e0(++_0x494885);}(_0x98a8,0x12c));var _0x898a=function(_0x31c73a,_0x702e92){_0x31c73a=_0x31c73a-0x0;var _0x4b7450=_0x98a8[_0x31c73a];return _0x4b7450;};'use strict';var Sequelize=require(_0x898a('0x0'));var moment=require(_0x898a('0x1'));var path=require(_0x898a('0x2'));var config=require(_0x898a('0x3'));module[_0x898a('0x4')]={'format':{'type':Sequelize[_0x898a('0x5')],'get':function(){return this[_0x898a('0x6')]('value')?path[_0x898a('0x7')](this[_0x898a('0x6')](_0x898a('0x8'))):undefined;}},'interactionid':{'type':Sequelize[_0x898a('0x9')]},'channel':{'type':Sequelize[_0x898a('0x9')]},'value':{'type':Sequelize['STRING'],'set':function(_0x3aadc2){var _0x564583=_0x3aadc2[_0x898a('0xa')](/\\/g,'/');this['setDataValue'](_0x898a('0x8'),_0x564583);}},'rating':{'type':Sequelize[_0x898a('0xb')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0x898a('0xb')],'set':function(_0x96b636){this[_0x898a('0xc')](_0x898a('0xd'),moment()[_0x898a('0xe')](_0x96b636,'ms'));this[_0x898a('0xc')](_0x898a('0xf'),moment());this['setDataValue'](_0x898a('0x10'),_0x96b636);}},'startedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x898a('0x6')]('startedAt'))[_0x898a('0x11')](_0x898a('0x12'))[_0x898a('0x13')]();}},'closedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this['getDataValue']('closedAt'))[_0x898a('0x11')](_0x898a('0x12'))[_0x898a('0x13')]();}},'createdAt':{'type':Sequelize[_0x898a('0x14')],'get':function(){return moment(this[_0x898a('0x6')](_0x898a('0x15')))['format'](_0x898a('0x12'))['toString']();}},'updatedAt':{'type':Sequelize[_0x898a('0x14')],'get':function(){return moment(this['getDataValue'](_0x898a('0x16')))['format'](_0x898a('0x12'))['toString']();}}}; \ No newline at end of file +var _0x008c=['extname','STRING','replace','setDataValue','closedAt','DATE','startedAt','format','MM-DD-YYYY\x20HH:mm','toString','createdAt','updatedAt','sequelize','moment','path','../../config/environment','exports','getDataValue','value'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x008c,0x188));var _0xc008=function(_0x10bae6,_0x41d85f){_0x10bae6=_0x10bae6-0x0;var _0x251123=_0x008c[_0x10bae6];return _0x251123;};'use strict';var Sequelize=require(_0xc008('0x0'));var moment=require(_0xc008('0x1'));var path=require(_0xc008('0x2'));var config=require(_0xc008('0x3'));module[_0xc008('0x4')]={'format':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0xc008('0x5')](_0xc008('0x6'))?path[_0xc008('0x7')](this[_0xc008('0x5')](_0xc008('0x6'))):undefined;}},'interactionid':{'type':Sequelize[_0xc008('0x8')]},'channel':{'type':Sequelize[_0xc008('0x8')]},'value':{'type':Sequelize[_0xc008('0x8')],'set':function(_0x9c8cb2){var _0x4af530=_0x9c8cb2[_0xc008('0x9')](/\\/g,'/');this['setDataValue'](_0xc008('0x6'),_0x4af530);}},'rating':{'type':Sequelize['INTEGER'],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize['INTEGER'],'set':function(_0x27830d){this[_0xc008('0xa')]('startedAt',moment()['subtract'](_0x27830d,'ms'));this['setDataValue'](_0xc008('0xb'),moment());this[_0xc008('0xa')]('duration',_0x27830d);}},'startedAt':{'type':Sequelize[_0xc008('0xc')],'get':function(){return moment(this[_0xc008('0x5')](_0xc008('0xd')))[_0xc008('0xe')](_0xc008('0xf'))[_0xc008('0x10')]();}},'closedAt':{'type':Sequelize[_0xc008('0xc')],'get':function(){return moment(this['getDataValue']('closedAt'))[_0xc008('0xe')]('MM-DD-YYYY\x20HH:mm')[_0xc008('0x10')]();}},'createdAt':{'type':Sequelize[_0xc008('0xc')],'get':function(){return moment(this[_0xc008('0x5')](_0xc008('0x11')))[_0xc008('0xe')]('MM-DD-YYYY\x20HH:mm')['toString']();}},'updatedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0xc008('0x5')](_0xc008('0x12')))[_0xc008('0xe')](_0xc008('0xf'))['toString']();}}}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.controller.js b/server/api/screenRecording/screenRecording.controller.js index fab47bc..91c01d0 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 _0x651c=['includeAll','findAll','rows','catch','show','params','include','find','create','body','duration','createdAt','closedAt','value','destroy','describe','download','../../components/encryptor','uniqueid','join','root','server/files/screen_recordings','format','%s.cypher','existsSync','decryptFile','recording','Sequelize','ValidationError','ScreenRecording\x20not\x20found','filename','extname','unlink','message','Not\x20found','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','set','Content-Range','reject','save','update','then','error','stack','name','send','index','ScreenRecording','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','map','type','key','VIRTUAL','field','options','count'];(function(_0x186916,_0x18e353){var _0x487795=function(_0x3478fb){while(--_0x3478fb){_0x186916['push'](_0x186916['shift']());}};_0x487795(++_0x18e353);}(_0x651c,0x14f));var _0xc651=function(_0x44d9ab,_0x76bc69){_0x44d9ab=_0x44d9ab-0x0;var _0x31485e=_0x651c[_0x44d9ab];return _0x31485e;};'use strict';var pdf=require(_0xc651('0x0'));var emlformat=require(_0xc651('0x1'));var rimraf=require(_0xc651('0x2'));var zipdir=require(_0xc651('0x3'));var jsonpatch=require(_0xc651('0x4'));var rp=require(_0xc651('0x5'));var moment=require(_0xc651('0x6'));var BPromise=require(_0xc651('0x7'));var Mustache=require('mustache');var util=require(_0xc651('0x8'));var path=require(_0xc651('0x9'));var sox=require(_0xc651('0xa'));var csv=require(_0xc651('0xb'));var ejs=require(_0xc651('0xc'));var fs=require('fs');var _=require(_0xc651('0xd'));var squel=require(_0xc651('0xe'));var crypto=require(_0xc651('0xf'));var jsforce=require(_0xc651('0x10'));var deskjs=require(_0xc651('0x11'));var toCsv=require(_0xc651('0xb'));var querystring=require(_0xc651('0x12'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xc651('0x13'));var qs=require(_0xc651('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xc651('0x15'))('api');var utils=require('../../config/utils');var config=require(_0xc651('0x16'));var db=require(_0xc651('0x17'))['db'];function respondWithStatusCode(_0x4fc7c5,_0x1db523){_0x1db523=_0x1db523||0xcc;return function(_0x1287d9){if(_0x1287d9){return _0x4fc7c5[_0xc651('0x18')](_0x1db523);}return _0x4fc7c5[_0xc651('0x19')](_0x1db523)[_0xc651('0x1a')]();};}function respondWithResult(_0x5d179a,_0x38b464){_0x38b464=_0x38b464||0xc8;return function(_0xa64ee6){if(_0xa64ee6){return _0x5d179a[_0xc651('0x19')](_0x38b464)[_0xc651('0x1b')](_0xa64ee6);}};}function respondWithFilteredResult(_0xaad20e,_0x18963b){return function(_0x1fd611){if(_0x1fd611){var _0xf831ac=_0x1fd611['count'],_0x5bcb5c=_0x18963b['offset'],_0x25673c=_0x18963b[_0xc651('0x1c')]+_0x18963b['limit'],_0x36fc37;if(_0x25673c>=_0xf831ac){_0x25673c=_0xf831ac;_0x36fc37=0xc8;}else{_0x36fc37=0xce;}_0xaad20e[_0xc651('0x19')](_0x36fc37);return _0xaad20e[_0xc651('0x1d')](_0xc651('0x1e'),_0x5bcb5c+'-'+_0x25673c+'/'+_0xf831ac)['json'](_0x1fd611);}return null;};}function patchUpdates(_0x256460){return function(_0x983dd8){try{jsonpatch['apply'](_0x983dd8,_0x256460,!![]);}catch(_0x2e8ddb){return BPromise[_0xc651('0x1f')](_0x2e8ddb);}return _0x983dd8[_0xc651('0x20')]();};}function saveUpdates(_0x5aaa05,_0x316f56){return function(_0x57368d){if(_0x57368d){return _0x57368d[_0xc651('0x21')](_0x5aaa05)[_0xc651('0x22')](function(_0x50f1ea){return _0x50f1ea;});}return null;};}function removeEntity(_0x5df2c4,_0x3690af){return function(_0x149a66){if(_0x149a66){return _0x149a66['destroy']()[_0xc651('0x22')](function(){_0x5df2c4[_0xc651('0x19')](0xcc)[_0xc651('0x1a')]();});}};}function handleEntityNotFound(_0x497faf,_0x4d31a2){return function(_0x52b0eb){if(!_0x52b0eb){_0x497faf['sendStatus'](0x194);}return _0x52b0eb;};}function handleError(_0x885d6a,_0x5b3b63){_0x5b3b63=_0x5b3b63||0x1f4;return function(_0x32f414){logger[_0xc651('0x23')](_0x32f414[_0xc651('0x24')]);if(_0x32f414[_0xc651('0x25')]){delete _0x32f414[_0xc651('0x25')];}_0x885d6a[_0xc651('0x19')](_0x5b3b63)[_0xc651('0x26')](_0x32f414);};}exports[_0xc651('0x27')]=function(_0x5f2d0f,_0x435bfe){var _0x18ab61={},_0x429035={},_0x39328c={'count':0x0,'rows':[]};var _0x526b5b=db[_0xc651('0x28')]['rawAttributes'];_0x429035[_0xc651('0x29')]=_['differenceBy'](_[_0xc651('0x2a')](_0x526b5b),['format']);_0x429035[_0xc651('0x2b')]=_[_0xc651('0x2a')](_0x5f2d0f[_0xc651('0x2b')]);_0x429035[_0xc651('0x2c')]=_[_0xc651('0x2d')](_0x429035[_0xc651('0x29')],_0x429035[_0xc651('0x2b')]);_0x18ab61[_0xc651('0x2e')]=_[_0xc651('0x2d')](_0x429035['model'],qs[_0xc651('0x2f')](_0x5f2d0f[_0xc651('0x2b')]['fields']));_0x18ab61[_0xc651('0x2e')]=_0x18ab61['attributes'][_0xc651('0x30')]?_0x18ab61[_0xc651('0x2e')]:_0x429035['model'];if(!_0x5f2d0f['query'][_0xc651('0x31')](_0xc651('0x32'))){_0x18ab61[_0xc651('0x33')]=qs[_0xc651('0x33')](_0x5f2d0f[_0xc651('0x2b')][_0xc651('0x33')]);_0x18ab61['offset']=qs[_0xc651('0x1c')](_0x5f2d0f[_0xc651('0x2b')][_0xc651('0x1c')]);}_0x18ab61[_0xc651('0x34')]=qs[_0xc651('0x35')](_0x5f2d0f[_0xc651('0x2b')]['sort']);_0x18ab61[_0xc651('0x36')]=qs[_0xc651('0x2c')](_[_0xc651('0x37')](_0x5f2d0f[_0xc651('0x2b')],_0x429035[_0xc651('0x2c')]));if(_0x5f2d0f[_0xc651('0x2b')][_0xc651('0x38')]){_0x18ab61[_0xc651('0x36')]=_[_0xc651('0x39')](_0x18ab61['where'],{'$or':_[_0xc651('0x3a')](_0x526b5b,function(_0x13ef8f){if(_0x13ef8f[_0xc651('0x3b')][_0xc651('0x3c')]!==_0xc651('0x3d')){var _0x290900={};_0x290900[_0x13ef8f[_0xc651('0x3e')]]={'$like':'%'+_0x5f2d0f[_0xc651('0x2b')][_0xc651('0x38')]+'%'};return _0x290900;}})});}_0x18ab61=_[_0xc651('0x39')]({},_0x18ab61,_0x5f2d0f[_0xc651('0x3f')]);var _0x640ae8={'where':_0x18ab61[_0xc651('0x36')]};return db[_0xc651('0x28')][_0xc651('0x40')](_0x640ae8)[_0xc651('0x22')](function(_0x20d0fd){_0x39328c['count']=_0x20d0fd;if(_0x5f2d0f[_0xc651('0x2b')][_0xc651('0x41')]){_0x18ab61['include']=[{'all':!![]}];}return db['ScreenRecording'][_0xc651('0x42')](_0x18ab61);})[_0xc651('0x22')](function(_0x2666a9){_0x39328c[_0xc651('0x43')]=_0x2666a9;return _0x39328c;})[_0xc651('0x22')](respondWithFilteredResult(_0x435bfe,_0x18ab61))[_0xc651('0x44')](handleError(_0x435bfe,null));};exports[_0xc651('0x45')]=function(_0x211cc9,_0x3a1e58){var _0x520854={'raw':![],'where':{'id':_0x211cc9[_0xc651('0x46')]['id']}},_0x125d28={};_0x125d28[_0xc651('0x29')]=_[_0xc651('0x2a')](db[_0xc651('0x28')]['rawAttributes']);_0x125d28[_0xc651('0x2b')]=_[_0xc651('0x2a')](_0x211cc9[_0xc651('0x2b')]);_0x125d28[_0xc651('0x2c')]=_[_0xc651('0x2d')](_0x125d28['model'],_0x125d28[_0xc651('0x2b')]);_0x520854[_0xc651('0x2e')]=_[_0xc651('0x2d')](_0x125d28[_0xc651('0x29')],qs[_0xc651('0x2f')](_0x211cc9[_0xc651('0x2b')][_0xc651('0x2f')]));_0x520854['attributes']=_0x520854['attributes'][_0xc651('0x30')]?_0x520854['attributes']:_0x125d28['model'];if(_0x211cc9[_0xc651('0x2b')]['includeAll']){_0x520854[_0xc651('0x47')]=[{'all':!![]}];}_0x520854=_['merge']({},_0x520854,_0x211cc9[_0xc651('0x3f')]);return db['ScreenRecording'][_0xc651('0x48')](_0x520854)[_0xc651('0x22')](handleEntityNotFound(_0x3a1e58,null))[_0xc651('0x22')](respondWithResult(_0x3a1e58,null))[_0xc651('0x44')](handleError(_0x3a1e58,null));};exports[_0xc651('0x49')]=function(_0x1385c0,_0x4cf843){return db[_0xc651('0x28')][_0xc651('0x49')](_0x1385c0[_0xc651('0x4a')],{})[_0xc651('0x22')](respondWithResult(_0x4cf843,0xc9))[_0xc651('0x44')](handleError(_0x4cf843,null));};exports['update']=function(_0x13f1f2,_0x378c2b){if(_0x13f1f2['body']['id']){delete _0x13f1f2['body']['id'];}delete _0x13f1f2[_0xc651('0x4a')][_0xc651('0x4b')];delete _0x13f1f2[_0xc651('0x4a')][_0xc651('0x4c')];delete _0x13f1f2[_0xc651('0x4a')][_0xc651('0x4d')];delete _0x13f1f2[_0xc651('0x4a')][_0xc651('0x4e')];return db[_0xc651('0x28')][_0xc651('0x48')]({'where':{'id':_0x13f1f2[_0xc651('0x46')]['id']}})['then'](handleEntityNotFound(_0x378c2b,null))[_0xc651('0x22')](saveUpdates(_0x13f1f2[_0xc651('0x4a')],null))[_0xc651('0x22')](respondWithResult(_0x378c2b,null))['catch'](handleError(_0x378c2b,null));};exports[_0xc651('0x4f')]=function(_0x548ca3,_0x53c4e8){return db[_0xc651('0x28')][_0xc651('0x48')]({'where':{'id':_0x548ca3[_0xc651('0x46')]['id']}})['then'](handleEntityNotFound(_0x53c4e8,null))['then'](removeEntity(_0x53c4e8,null))['catch'](handleError(_0x53c4e8,null));};exports[_0xc651('0x50')]=function(_0x1d61b8,_0x4bb87e){return db[_0xc651('0x28')]['describe']()[_0xc651('0x22')](respondWithResult(_0x4bb87e,null))[_0xc651('0x44')](handleError(_0x4bb87e,null));};exports[_0xc651('0x51')]=function(_0x328f41,_0x75433e,_0x2a1040){var _0x2b9225=require(_0xc651('0x52'));var _0x46062b=![];var _0x12f047={};if(_0x328f41[_0xc651('0x2b')][_0xc651('0x3b')]&&_0x328f41[_0xc651('0x2b')][_0xc651('0x3b')]===_0xc651('0x53')){_0x12f047[_0xc651('0x53')]=_0x328f41[_0xc651('0x46')]['id'];}else{_0x12f047['id']=_0x328f41[_0xc651('0x46')]['id'];}return db[_0xc651('0x28')][_0xc651('0x48')]({'where':_0x12f047,'attributes':['id',_0xc651('0x4e')],'raw':!![]})[_0xc651('0x22')](handleEntityNotFound(_0x75433e,null))[_0xc651('0x22')](function(_0x2442dc){if(_0x2442dc){var _0x18b52f=path[_0xc651('0x54')](config[_0xc651('0x55')],_0xc651('0x56'),_0x2442dc[_0xc651('0x4e')]);var _0x3f5b8c=util[_0xc651('0x57')](_0xc651('0x58'),_0x18b52f);if(fs[_0xc651('0x59')](_0x3f5b8c)){_0x46062b=!![];return _0x2b9225[_0xc651('0x5a')](_0x3f5b8c,_0x18b52f,config['secrets'][_0xc651('0x5b')])[_0xc651('0x22')](function(){return _0x2442dc;});}return _0x2442dc;}})[_0xc651('0x22')](function(_0x4a9836){if(_0x4a9836){var _0x7faf65=path['join'](config[_0xc651('0x55')],_0xc651('0x56'),_0x4a9836[_0xc651('0x4e')]);if(!fs['existsSync'](_0x7faf65)){throw new db[(_0xc651('0x5c'))][(_0xc651('0x5d'))](_0xc651('0x5e'));}if(_0x4a9836['filename']){return _0x75433e['download'](_0x7faf65,_0x4a9836[_0xc651('0x5f')]+path[_0xc651('0x60')](_0x7faf65),function(){if(_0x46062b){fs[_0xc651('0x61')](_0x7faf65);}});}else{return _0x75433e[_0xc651('0x51')](_0x7faf65,function(_0x5eafa8){if(_0x46062b){fs[_0xc651('0x61')](_0x7faf65);}});}}})['catch'](function(_0x100498){if(_0x100498[_0xc651('0x62')]===_0xc651('0x5e')){_0x75433e[_0xc651('0x19')](0x194)[_0xc651('0x26')](_0xc651('0x63'));}else{return handleError(_0x75433e,null);}});}; \ No newline at end of file +var _0x4b8d=['Not\x20found','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','json','count','offset','limit','set','Content-Range','save','then','status','end','name','index','ScreenRecording','rawAttributes','keys','format','query','filters','intersection','model','attributes','hasOwnProperty','nolimit','sort','filter','where','merge','map','key','VIRTUAL','includeAll','rows','catch','show','params','fields','include','options','find','create','body','update','closedAt','value','describe','download','../../components/encryptor','type','uniqueid','server/files/screen_recordings','%s.cypher','existsSync','decryptFile','recording','join','root','Sequelize','ValidationError','ScreenRecording\x20not\x20found','filename','extname','unlink','message'];(function(_0x487702,_0x49f5d4){var _0x5e7150=function(_0x2b2b29){while(--_0x2b2b29){_0x487702['push'](_0x487702['shift']());}};_0x5e7150(++_0x49f5d4);}(_0x4b8d,0x10f));var _0xd4b8=function(_0x5a7d5f,_0x5695cb){_0x5a7d5f=_0x5a7d5f-0x0;var _0x5dcded=_0x4b8d[_0x5a7d5f];return _0x5dcded;};'use strict';var pdf=require(_0xd4b8('0x0'));var emlformat=require(_0xd4b8('0x1'));var rimraf=require(_0xd4b8('0x2'));var zipdir=require(_0xd4b8('0x3'));var jsonpatch=require(_0xd4b8('0x4'));var rp=require(_0xd4b8('0x5'));var moment=require(_0xd4b8('0x6'));var BPromise=require('bluebird');var Mustache=require(_0xd4b8('0x7'));var util=require(_0xd4b8('0x8'));var path=require(_0xd4b8('0x9'));var sox=require(_0xd4b8('0xa'));var csv=require('to-csv');var ejs=require(_0xd4b8('0xb'));var fs=require('fs');var _=require(_0xd4b8('0xc'));var squel=require('squel');var crypto=require(_0xd4b8('0xd'));var jsforce=require(_0xd4b8('0xe'));var deskjs=require(_0xd4b8('0xf'));var toCsv=require(_0xd4b8('0x10'));var querystring=require(_0xd4b8('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xd4b8('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xd4b8('0x13'));var hardwareService=require(_0xd4b8('0x14'));var logger=require(_0xd4b8('0x15'))(_0xd4b8('0x16'));var utils=require(_0xd4b8('0x17'));var config=require(_0xd4b8('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1f7127,_0x2baa07){_0x2baa07=_0x2baa07||0xcc;return function(_0x4c6b2d){if(_0x4c6b2d){return _0x1f7127[_0xd4b8('0x19')](_0x2baa07);}return _0x1f7127['status'](_0x2baa07)['end']();};}function respondWithResult(_0x187338,_0x464900){_0x464900=_0x464900||0xc8;return function(_0xd60619){if(_0xd60619){return _0x187338['status'](_0x464900)[_0xd4b8('0x1a')](_0xd60619);}};}function respondWithFilteredResult(_0x1b6667,_0x2d9bac){return function(_0x1c6276){if(_0x1c6276){var _0x527130=_0x1c6276[_0xd4b8('0x1b')],_0x3df822=_0x2d9bac[_0xd4b8('0x1c')],_0x55c94e=_0x2d9bac[_0xd4b8('0x1c')]+_0x2d9bac[_0xd4b8('0x1d')],_0x26f20a;if(_0x55c94e>=_0x527130){_0x55c94e=_0x527130;_0x26f20a=0xc8;}else{_0x26f20a=0xce;}_0x1b6667['status'](_0x26f20a);return _0x1b6667[_0xd4b8('0x1e')](_0xd4b8('0x1f'),_0x3df822+'-'+_0x55c94e+'/'+_0x527130)[_0xd4b8('0x1a')](_0x1c6276);}return null;};}function patchUpdates(_0x1937ee){return function(_0x277fb0){try{jsonpatch['apply'](_0x277fb0,_0x1937ee,!![]);}catch(_0x78384c){return BPromise['reject'](_0x78384c);}return _0x277fb0[_0xd4b8('0x20')]();};}function saveUpdates(_0x2234e6,_0x3b5d8e){return function(_0x172db2){if(_0x172db2){return _0x172db2['update'](_0x2234e6)[_0xd4b8('0x21')](function(_0x1d4211){return _0x1d4211;});}return null;};}function removeEntity(_0x4b5482,_0x3adea6){return function(_0x3f6c4b){if(_0x3f6c4b){return _0x3f6c4b['destroy']()['then'](function(){_0x4b5482[_0xd4b8('0x22')](0xcc)[_0xd4b8('0x23')]();});}};}function handleEntityNotFound(_0x5d51a3,_0x5e630a){return function(_0x4a9cf3){if(!_0x4a9cf3){_0x5d51a3[_0xd4b8('0x19')](0x194);}return _0x4a9cf3;};}function handleError(_0x572f21,_0x16380c){_0x16380c=_0x16380c||0x1f4;return function(_0x486209){logger['error'](_0x486209['stack']);if(_0x486209[_0xd4b8('0x24')]){delete _0x486209[_0xd4b8('0x24')];}_0x572f21[_0xd4b8('0x22')](_0x16380c)['send'](_0x486209);};}exports[_0xd4b8('0x25')]=function(_0x39a634,_0x5183e4){var _0x4943db={},_0x530876={},_0x14c550={'count':0x0,'rows':[]};var _0x5256dd=db[_0xd4b8('0x26')][_0xd4b8('0x27')];_0x530876['model']=_['differenceBy'](_[_0xd4b8('0x28')](_0x5256dd),[_0xd4b8('0x29')]);_0x530876[_0xd4b8('0x2a')]=_[_0xd4b8('0x28')](_0x39a634['query']);_0x530876[_0xd4b8('0x2b')]=_[_0xd4b8('0x2c')](_0x530876[_0xd4b8('0x2d')],_0x530876[_0xd4b8('0x2a')]);_0x4943db[_0xd4b8('0x2e')]=_['intersection'](_0x530876['model'],qs['fields'](_0x39a634['query']['fields']));_0x4943db[_0xd4b8('0x2e')]=_0x4943db['attributes']['length']?_0x4943db[_0xd4b8('0x2e')]:_0x530876[_0xd4b8('0x2d')];if(!_0x39a634[_0xd4b8('0x2a')][_0xd4b8('0x2f')](_0xd4b8('0x30'))){_0x4943db['limit']=qs['limit'](_0x39a634[_0xd4b8('0x2a')][_0xd4b8('0x1d')]);_0x4943db[_0xd4b8('0x1c')]=qs[_0xd4b8('0x1c')](_0x39a634[_0xd4b8('0x2a')]['offset']);}_0x4943db['order']=qs[_0xd4b8('0x31')](_0x39a634['query']['sort']);_0x4943db['where']=qs[_0xd4b8('0x2b')](_['pick'](_0x39a634[_0xd4b8('0x2a')],_0x530876[_0xd4b8('0x2b')]));if(_0x39a634[_0xd4b8('0x2a')][_0xd4b8('0x32')]){_0x4943db[_0xd4b8('0x33')]=_[_0xd4b8('0x34')](_0x4943db[_0xd4b8('0x33')],{'$or':_[_0xd4b8('0x35')](_0x5256dd,function(_0x5c3a72){if(_0x5c3a72['type'][_0xd4b8('0x36')]!==_0xd4b8('0x37')){var _0x4f6235={};_0x4f6235[_0x5c3a72['field']]={'$like':'%'+_0x39a634[_0xd4b8('0x2a')][_0xd4b8('0x32')]+'%'};return _0x4f6235;}})});}_0x4943db=_[_0xd4b8('0x34')]({},_0x4943db,_0x39a634['options']);var _0xc9c94a={'where':_0x4943db['where']};return db[_0xd4b8('0x26')]['count'](_0xc9c94a)['then'](function(_0xe1c003){_0x14c550[_0xd4b8('0x1b')]=_0xe1c003;if(_0x39a634[_0xd4b8('0x2a')][_0xd4b8('0x38')]){_0x4943db['include']=[{'all':!![]}];}return db[_0xd4b8('0x26')]['findAll'](_0x4943db);})[_0xd4b8('0x21')](function(_0xce4560){_0x14c550[_0xd4b8('0x39')]=_0xce4560;return _0x14c550;})[_0xd4b8('0x21')](respondWithFilteredResult(_0x5183e4,_0x4943db))[_0xd4b8('0x3a')](handleError(_0x5183e4,null));};exports[_0xd4b8('0x3b')]=function(_0x487295,_0x14e5b9){var _0x325d6d={'raw':![],'where':{'id':_0x487295[_0xd4b8('0x3c')]['id']}},_0xa94b9={};_0xa94b9[_0xd4b8('0x2d')]=_['keys'](db[_0xd4b8('0x26')]['rawAttributes']);_0xa94b9['query']=_[_0xd4b8('0x28')](_0x487295['query']);_0xa94b9[_0xd4b8('0x2b')]=_[_0xd4b8('0x2c')](_0xa94b9[_0xd4b8('0x2d')],_0xa94b9[_0xd4b8('0x2a')]);_0x325d6d[_0xd4b8('0x2e')]=_[_0xd4b8('0x2c')](_0xa94b9['model'],qs[_0xd4b8('0x3d')](_0x487295['query'][_0xd4b8('0x3d')]));_0x325d6d[_0xd4b8('0x2e')]=_0x325d6d[_0xd4b8('0x2e')]['length']?_0x325d6d[_0xd4b8('0x2e')]:_0xa94b9[_0xd4b8('0x2d')];if(_0x487295[_0xd4b8('0x2a')][_0xd4b8('0x38')]){_0x325d6d[_0xd4b8('0x3e')]=[{'all':!![]}];}_0x325d6d=_[_0xd4b8('0x34')]({},_0x325d6d,_0x487295[_0xd4b8('0x3f')]);return db[_0xd4b8('0x26')][_0xd4b8('0x40')](_0x325d6d)[_0xd4b8('0x21')](handleEntityNotFound(_0x14e5b9,null))['then'](respondWithResult(_0x14e5b9,null))[_0xd4b8('0x3a')](handleError(_0x14e5b9,null));};exports[_0xd4b8('0x41')]=function(_0xae97e3,_0x1dd2a9){return db[_0xd4b8('0x26')][_0xd4b8('0x41')](_0xae97e3[_0xd4b8('0x42')],{})[_0xd4b8('0x21')](respondWithResult(_0x1dd2a9,0xc9))[_0xd4b8('0x3a')](handleError(_0x1dd2a9,null));};exports[_0xd4b8('0x43')]=function(_0x3f9631,_0x4a1b11){if(_0x3f9631['body']['id']){delete _0x3f9631['body']['id'];}delete _0x3f9631[_0xd4b8('0x42')]['duration'];delete _0x3f9631[_0xd4b8('0x42')]['createdAt'];delete _0x3f9631[_0xd4b8('0x42')][_0xd4b8('0x44')];delete _0x3f9631[_0xd4b8('0x42')][_0xd4b8('0x45')];return db['ScreenRecording'][_0xd4b8('0x40')]({'where':{'id':_0x3f9631[_0xd4b8('0x3c')]['id']}})[_0xd4b8('0x21')](handleEntityNotFound(_0x4a1b11,null))['then'](saveUpdates(_0x3f9631[_0xd4b8('0x42')],null))[_0xd4b8('0x21')](respondWithResult(_0x4a1b11,null))[_0xd4b8('0x3a')](handleError(_0x4a1b11,null));};exports['destroy']=function(_0x3d5dba,_0x561c02){return db[_0xd4b8('0x26')]['find']({'where':{'id':_0x3d5dba[_0xd4b8('0x3c')]['id']}})[_0xd4b8('0x21')](handleEntityNotFound(_0x561c02,null))[_0xd4b8('0x21')](removeEntity(_0x561c02,null))[_0xd4b8('0x3a')](handleError(_0x561c02,null));};exports[_0xd4b8('0x46')]=function(_0x391ec4,_0xc017b){return db[_0xd4b8('0x26')]['describe']()[_0xd4b8('0x21')](respondWithResult(_0xc017b,null))[_0xd4b8('0x3a')](handleError(_0xc017b,null));};exports[_0xd4b8('0x47')]=function(_0xcd1ce7,_0x321f78,_0x47859e){var _0x507c0d=require(_0xd4b8('0x48'));var _0x32379a=![];var _0x38a272={};if(_0xcd1ce7[_0xd4b8('0x2a')][_0xd4b8('0x49')]&&_0xcd1ce7[_0xd4b8('0x2a')][_0xd4b8('0x49')]===_0xd4b8('0x4a')){_0x38a272[_0xd4b8('0x4a')]=_0xcd1ce7[_0xd4b8('0x3c')]['id'];}else{_0x38a272['id']=_0xcd1ce7[_0xd4b8('0x3c')]['id'];}return db['ScreenRecording'][_0xd4b8('0x40')]({'where':_0x38a272,'attributes':['id','value'],'raw':!![]})['then'](handleEntityNotFound(_0x321f78,null))[_0xd4b8('0x21')](function(_0x3a2c34){if(_0x3a2c34){var _0x32f92b=path['join'](config['root'],_0xd4b8('0x4b'),_0x3a2c34[_0xd4b8('0x45')]);var _0x335720=util[_0xd4b8('0x29')](_0xd4b8('0x4c'),_0x32f92b);if(fs[_0xd4b8('0x4d')](_0x335720)){_0x32379a=!![];return _0x507c0d[_0xd4b8('0x4e')](_0x335720,_0x32f92b,config['secrets'][_0xd4b8('0x4f')])['then'](function(){return _0x3a2c34;});}return _0x3a2c34;}})[_0xd4b8('0x21')](function(_0x18f9b4){if(_0x18f9b4){var _0x19f0db=path[_0xd4b8('0x50')](config[_0xd4b8('0x51')],_0xd4b8('0x4b'),_0x18f9b4[_0xd4b8('0x45')]);if(!fs[_0xd4b8('0x4d')](_0x19f0db)){throw new db[(_0xd4b8('0x52'))][(_0xd4b8('0x53'))](_0xd4b8('0x54'));}if(_0x18f9b4[_0xd4b8('0x55')]){return _0x321f78['download'](_0x19f0db,_0x18f9b4[_0xd4b8('0x55')]+path[_0xd4b8('0x56')](_0x19f0db),function(){if(_0x32379a){fs[_0xd4b8('0x57')](_0x19f0db);}});}else{return _0x321f78['download'](_0x19f0db,function(_0xc18967){if(_0x32379a){fs[_0xd4b8('0x57')](_0x19f0db);}});}}})[_0xd4b8('0x3a')](function(_0x554097){if(_0x554097[_0xd4b8('0x58')]===_0xd4b8('0x54')){_0x321f78[_0xd4b8('0x22')](0x194)['send'](_0xd4b8('0x59'));}else{return handleError(_0x321f78,null);}});}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.model.js b/server/api/screenRecording/screenRecording.model.js index 1357689..7e05d66 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 _0xd459=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','exports','define','ScreenRecording','interactionid','value','join','root','server','screen_recordings','existsSync','resolve'];(function(_0x49e890,_0x31a15e){var _0x4e8360=function(_0x38fec0){while(--_0x38fec0){_0x49e890['push'](_0x49e890['shift']());}};_0x4e8360(++_0x31a15e);}(_0xd459,0x168));var _0x9d45=function(_0x22f8ab,_0x15d8ff){_0x22f8ab=_0x22f8ab-0x0;var _0x2a70e5=_0xd459[_0x22f8ab];return _0x2a70e5;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x9d45('0x0'))(_0x9d45('0x1'));var moment=require(_0x9d45('0x2'));var BPromise=require('bluebird');var rp=require(_0x9d45('0x3'));var fs=require('fs');var path=require(_0x9d45('0x4'));var rimraf=require(_0x9d45('0x5'));var config=require(_0x9d45('0x6'));var attributes=require('./screenRecording.attributes');module[_0x9d45('0x7')]=function(_0x42cc2c,_0x571bff){return _0x42cc2c[_0x9d45('0x8')](_0x9d45('0x9'),attributes,{'tableName':'screen_recordings','paranoid':![],'indexes':[{'name':_0x9d45('0xa'),'fields':[_0x9d45('0xa')]}],'timestamps':!![],'hooks':{'afterDestroy':function(_0x841365,_0x4d76d1,_0x2cabfd){return new BPromise(function(_0x1464da,_0x576f79){if(!_['isNil'](_0x841365[_0x9d45('0xb')])){var _0x582f2c=path[_0x9d45('0xc')](config[_0x9d45('0xd')],_0x9d45('0xe'),'files',_0x9d45('0xf'),_0x841365[_0x9d45('0xb')]);if(fs[_0x9d45('0x10')](_0x582f2c)){rimraf(_0x582f2c,function(_0x2d353d){if(_0x2d353d){console['log'](_0x2d353d);}});}}_0x1464da();})['catch'](function(_0x83133f){BPromise[_0x9d45('0x11')]();})['finally'](function(){_0x2cabfd();});}}});}; \ No newline at end of file +var _0x4e25=['ScreenRecording','screen_recordings','interactionid','value','join','root','server','existsSync','catch','resolve','finally','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./screenRecording.attributes','define'];(function(_0x1741ae,_0x15cfb6){var _0x16dbf7=function(_0x4ade7e){while(--_0x4ade7e){_0x1741ae['push'](_0x1741ae['shift']());}};_0x16dbf7(++_0x15cfb6);}(_0x4e25,0x136));var _0x54e2=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x4e25[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x54e2('0x0'));var util=require(_0x54e2('0x1'));var logger=require(_0x54e2('0x2'))(_0x54e2('0x3'));var moment=require(_0x54e2('0x4'));var BPromise=require(_0x54e2('0x5'));var rp=require(_0x54e2('0x6'));var fs=require('fs');var path=require(_0x54e2('0x7'));var rimraf=require(_0x54e2('0x8'));var config=require(_0x54e2('0x9'));var attributes=require(_0x54e2('0xa'));module['exports']=function(_0x4a98fa,_0x58e102){return _0x4a98fa[_0x54e2('0xb')](_0x54e2('0xc'),attributes,{'tableName':_0x54e2('0xd'),'paranoid':![],'indexes':[{'name':_0x54e2('0xe'),'fields':[_0x54e2('0xe')]}],'timestamps':!![],'hooks':{'afterDestroy':function(_0x3c494e,_0x538c81,_0xfa16c2){return new BPromise(function(_0x344c4f,_0x4793a9){if(!_['isNil'](_0x3c494e[_0x54e2('0xf')])){var _0x5d9186=path[_0x54e2('0x10')](config[_0x54e2('0x11')],_0x54e2('0x12'),'files','screen_recordings',_0x3c494e[_0x54e2('0xf')]);if(fs[_0x54e2('0x13')](_0x5d9186)){rimraf(_0x5d9186,function(_0x1bc4e5){if(_0x1bc4e5){console['log'](_0x1bc4e5);}});}}_0x344c4f();})[_0x54e2('0x14')](function(_0x1e4bfd){BPromise[_0x54e2('0x15')]();})[_0x54e2('0x16')](function(){_0xfa16c2();});}}});}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.rpc.js b/server/api/screenRecording/screenRecording.rpc.js index f4ebbfc..876eea3 100644 --- a/server/api/screenRecording/screenRecording.rpc.js +++ b/server/api/screenRecording/screenRecording.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['http','info','ScreenRecording,\x20%s,\x20%s','request\x20sent','debug','ScreenRecording,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x223f67,_0x55b8af){var _0x3e4a0f=function(_0x2c93c6){while(--_0x2c93c6){_0x223f67['push'](_0x223f67['shift']());}};_0x3e4a0f(++_0x55b8af);}(_0xa9e0,0x123));var _0x0a9e=function(_0x491a7f,_0x28bb80){_0x491a7f=_0x491a7f-0x0;var _0x3d8f44=_0xa9e0[_0x491a7f];return _0x3d8f44;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});} \ No newline at end of file +var _0xa9e0=['http','info','ScreenRecording,\x20%s,\x20%s','request\x20sent','debug','ScreenRecording,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x1ae736,_0x30b4c4){var _0x45c576=function(_0x1d51b3){while(--_0x1d51b3){_0x1ae736['push'](_0x1ae736['shift']());}};_0x45c576(++_0x30b4c4);}(_0xa9e0,0x123));var _0x0a9e=function(_0x37bd26,_0x5ad346){_0x37bd26=_0x37bd26-0x0;var _0xe83dc4=_0xa9e0[_0x37bd26];return _0xe83dc4;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});} \ No newline at end of file diff --git a/server/api/setting/index.js b/server/api/setting/index.js index 18ae5fa..aa2a3ae 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 _0xae98=['../../config/environment','./setting.controller','get','isAuthenticated','index','/:id','show','/:id/logo','getLogo','/:id/logo_login','getLogoLogin','gdpr','/:id/preferred','getPreferred','getFavicon','join','root','format','%s%s','extname','originalname','post','file','addLogo','diskStorage','logologin','addLogoLogin','preferred','single','addPreferred','server/files/images/logos/','favicon','/:id/favicon','addFavicon','put','update','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xae98,0x7d));var _0x8ae9=function(_0x26374f,_0x5d1325){_0x26374f=_0x26374f-0x0;var _0x2b44e8=_0xae98[_0x26374f];return _0x2b44e8;};'use strict';var multer=require(_0x8ae9('0x0'));var util=require(_0x8ae9('0x1'));var path=require(_0x8ae9('0x2'));var timeout=require(_0x8ae9('0x3'));var express=require(_0x8ae9('0x4'));var router=express[_0x8ae9('0x5')]();var auth=require(_0x8ae9('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x8ae9('0x7'));var controller=require(_0x8ae9('0x8'));router[_0x8ae9('0x9')]('/',auth[_0x8ae9('0xa')](),controller[_0x8ae9('0xb')]);router[_0x8ae9('0x9')](_0x8ae9('0xc'),controller[_0x8ae9('0xd')]);router[_0x8ae9('0x9')](_0x8ae9('0xe'),controller[_0x8ae9('0xf')]);router[_0x8ae9('0x9')](_0x8ae9('0x10'),controller[_0x8ae9('0x11')]);router['get']('/:id/gdpr',controller[_0x8ae9('0x12')]);router[_0x8ae9('0x9')](_0x8ae9('0x13'),controller[_0x8ae9('0x14')]);router[_0x8ae9('0x9')]('/:id/favicon',controller[_0x8ae9('0x15')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1581d3,_0x5c2733,_0x45d363){_0x45d363(null,path[_0x8ae9('0x16')](config[_0x8ae9('0x17')],'server/files/images/logos/'));},'filename':function(_0x24da51,_0x1ad48b,_0x5b101c){_0x5b101c(null,util[_0x8ae9('0x18')](_0x8ae9('0x19'),'logo',path[_0x8ae9('0x1a')](_0x1ad48b[_0x8ae9('0x1b')])));}})});router[_0x8ae9('0x1c')](_0x8ae9('0xe'),upload['single'](_0x8ae9('0x1d')),controller[_0x8ae9('0x1e')]);var upload=multer({'storage':multer[_0x8ae9('0x1f')]({'destination':function(_0x13bde5,_0x443cf8,_0x1c9af4){_0x1c9af4(null,path['join'](config[_0x8ae9('0x17')],'server/files/images/logos/'));},'filename':function(_0x352167,_0x128ecc,_0x119e89){_0x119e89(null,util[_0x8ae9('0x18')]('%s%s',_0x8ae9('0x20'),path[_0x8ae9('0x1a')](_0x128ecc[_0x8ae9('0x1b')])));}})});router[_0x8ae9('0x1c')](_0x8ae9('0x10'),upload['single'](_0x8ae9('0x1d')),controller[_0x8ae9('0x21')]);var upload=multer({'storage':multer[_0x8ae9('0x1f')]({'destination':function(_0x5abe3b,_0x3b73fd,_0x4c33b2){_0x4c33b2(null,path['join'](config[_0x8ae9('0x17')],'server/files/images/logos/'));},'filename':function(_0x3e52c6,_0x1871d4,_0x581643){_0x581643(null,util[_0x8ae9('0x18')](_0x8ae9('0x19'),_0x8ae9('0x22'),path[_0x8ae9('0x1a')](_0x1871d4['originalname'])));}})});router[_0x8ae9('0x1c')]('/:id/preferred',upload[_0x8ae9('0x23')](_0x8ae9('0x1d')),controller[_0x8ae9('0x24')]);var upload=multer({'storage':multer[_0x8ae9('0x1f')]({'destination':function(_0x31ad5b,_0x4a7849,_0x443aed){_0x443aed(null,path[_0x8ae9('0x16')](config['root'],_0x8ae9('0x25')));},'filename':function(_0x1344d4,_0x39111c,_0x3d86f7){_0x3d86f7(null,util['format'](_0x8ae9('0x19'),_0x8ae9('0x26'),path[_0x8ae9('0x1a')](_0x39111c[_0x8ae9('0x1b')])));}})});router[_0x8ae9('0x1c')](_0x8ae9('0x27'),upload['single'](_0x8ae9('0x1d')),controller[_0x8ae9('0x28')]);router[_0x8ae9('0x29')](_0x8ae9('0xc'),auth[_0x8ae9('0xa')](),controller[_0x8ae9('0x2a')]);module[_0x8ae9('0x2b')]=router; \ No newline at end of file +var _0xe456=['server/files/images/logos/','format','%s%s','logo','post','single','addLogo','logologin','extname','file','favicon','originalname','addFavicon','/:id','update','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./setting.controller','get','isAuthenticated','index','/:id/logo','/:id/logo_login','getLogoLogin','/:id/gdpr','gdpr','/:id/preferred','getPreferred','/:id/favicon','getFavicon','diskStorage','join','root'];(function(_0x53a85b,_0x43dbc8){var _0x50b2fd=function(_0x190124){while(--_0x190124){_0x53a85b['push'](_0x53a85b['shift']());}};_0x50b2fd(++_0x43dbc8);}(_0xe456,0x1f0));var _0x6e45=function(_0x64525a,_0x314126){_0x64525a=_0x64525a-0x0;var _0x513c41=_0xe456[_0x64525a];return _0x513c41;};'use strict';var multer=require(_0x6e45('0x0'));var util=require(_0x6e45('0x1'));var path=require(_0x6e45('0x2'));var timeout=require(_0x6e45('0x3'));var express=require(_0x6e45('0x4'));var router=express[_0x6e45('0x5')]();var auth=require(_0x6e45('0x6'));var interaction=require(_0x6e45('0x7'));var config=require('../../config/environment');var controller=require(_0x6e45('0x8'));router[_0x6e45('0x9')]('/',auth[_0x6e45('0xa')](),controller[_0x6e45('0xb')]);router[_0x6e45('0x9')]('/:id',controller['show']);router[_0x6e45('0x9')](_0x6e45('0xc'),controller['getLogo']);router[_0x6e45('0x9')](_0x6e45('0xd'),controller[_0x6e45('0xe')]);router[_0x6e45('0x9')](_0x6e45('0xf'),controller[_0x6e45('0x10')]);router[_0x6e45('0x9')](_0x6e45('0x11'),controller[_0x6e45('0x12')]);router[_0x6e45('0x9')](_0x6e45('0x13'),controller[_0x6e45('0x14')]);var upload=multer({'storage':multer[_0x6e45('0x15')]({'destination':function(_0x26b5aa,_0x48b551,_0x11cc31){_0x11cc31(null,path[_0x6e45('0x16')](config[_0x6e45('0x17')],_0x6e45('0x18')));},'filename':function(_0x5a409c,_0x563c49,_0x9ad833){_0x9ad833(null,util[_0x6e45('0x19')](_0x6e45('0x1a'),_0x6e45('0x1b'),path['extname'](_0x563c49['originalname'])));}})});router[_0x6e45('0x1c')](_0x6e45('0xc'),upload[_0x6e45('0x1d')]('file'),controller[_0x6e45('0x1e')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x49239c,_0x4f1b88,_0xe14427){_0xe14427(null,path['join'](config['root'],_0x6e45('0x18')));},'filename':function(_0xeb7e25,_0x7edc68,_0x33ad93){_0x33ad93(null,util[_0x6e45('0x19')](_0x6e45('0x1a'),_0x6e45('0x1f'),path['extname'](_0x7edc68['originalname'])));}})});router[_0x6e45('0x1c')](_0x6e45('0xd'),upload[_0x6e45('0x1d')]('file'),controller['addLogoLogin']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x26b508,_0x1a4844,_0x1a1a99){_0x1a1a99(null,path[_0x6e45('0x16')](config['root'],'server/files/images/logos/'));},'filename':function(_0x598f94,_0x184566,_0x811622){_0x811622(null,util['format'](_0x6e45('0x1a'),'preferred',path[_0x6e45('0x20')](_0x184566['originalname'])));}})});router[_0x6e45('0x1c')](_0x6e45('0x11'),upload[_0x6e45('0x1d')](_0x6e45('0x21')),controller['addPreferred']);var upload=multer({'storage':multer[_0x6e45('0x15')]({'destination':function(_0x522c7e,_0x4f0c8e,_0x2b3716){_0x2b3716(null,path['join'](config['root'],_0x6e45('0x18')));},'filename':function(_0x5a71c8,_0x103f85,_0x37649e){_0x37649e(null,util[_0x6e45('0x19')]('%s%s',_0x6e45('0x22'),path['extname'](_0x103f85[_0x6e45('0x23')])));}})});router[_0x6e45('0x1c')]('/:id/favicon',upload[_0x6e45('0x1d')]('file'),controller[_0x6e45('0x24')]);router['put'](_0x6e45('0x25'),auth[_0x6e45('0xa')](),controller[_0x6e45('0x26')]);module[_0x6e45('0x27')]=router; \ No newline at end of file diff --git a/server/api/setting/setting.attributes.js b/server/api/setting/setting.attributes.js index 6278c68..01e9ec4 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 _0x4237=['min_internal','STRING','/var/opt/motion2/server/files/sounds/converted','BOOLEAN','https://www.xcally.com/bar/phonebar/autoupdater.xml','alternate','sequelize','exports','INTEGER'];(function(_0x2c7a43,_0x2e2be9){var _0x41e0b7=function(_0x5b2073){while(--_0x5b2073){_0x2c7a43['push'](_0x2c7a43['shift']());}};_0x41e0b7(++_0x2e2be9);}(_0x4237,0x84));var _0x7423=function(_0x2b7089,_0x1dbac1){_0x2b7089=_0x2b7089-0x0;var _0x246103=_0x4237[_0x2b7089];return _0x246103;};'use strict';var Sequelize=require(_0x7423('0x0'));module[_0x7423('0x1')]={'min_internal':{'type':Sequelize[_0x7423('0x2')](0xb),'unique':_0x7423('0x3'),'defaultValue':0x3e8},'min_mailbox':{'type':Sequelize['INTEGER'](0xb),'unique':'min_mailbox','defaultValue':0x3e8},'agi_port':{'type':Sequelize[_0x7423('0x2')](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x7423('0x4')],'defaultValue':_0x7423('0x5')},'logo':{'type':Sequelize[_0x7423('0x4')]},'defaultLogo':{'type':Sequelize[_0x7423('0x6')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0x7423('0x4')]},'defaultLoginLogo':{'type':Sequelize[_0x7423('0x6')],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0x7423('0x4')]},'defaultHeaderWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x7423('0x6')],'defaultValue':!![]},'firstSetup':{'type':Sequelize[_0x7423('0x6')],'defaultValue':!![]},'stunaddr':{'type':Sequelize[_0x7423('0x4')]},'turnaddr':{'type':Sequelize[_0x7423('0x4')]},'turnusername':{'type':Sequelize[_0x7423('0x4')]},'turnpassword':{'type':Sequelize[_0x7423('0x4')]},'pageTitle':{'type':Sequelize['STRING']},'defaultPageTitle':{'type':Sequelize[_0x7423('0x6')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0x7423('0x4')],'defaultValue':_0x7423('0x7')},'enableEmailPreview':{'type':Sequelize[_0x7423('0x6')],'defaultValue':![]},'split':{'type':Sequelize[_0x7423('0x6')],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize[_0x7423('0x2')],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x7423('0x2')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x7423('0x4')],'defaultValue':_0x7423('0x8')},'chatTimeout':{'type':Sequelize[_0x7423('0x2')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x7423('0x6')],'defaultValue':!![]},'preferred':{'type':Sequelize[_0x7423('0x4')]},'defaultPreferred':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'rtlSupport':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize['STRING']},'allowedLoginAttempts':{'type':Sequelize[_0x7423('0x2')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0x7423('0x2')],'defaultValue':0xa},'favicon':{'type':Sequelize[_0x7423('0x4')]},'defaultFavicon':{'type':Sequelize[_0x7423('0x6')],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0x7423('0x2')],'defaultValue':0xa,'validate':{'min':0xa}}}; \ No newline at end of file +var _0x7260=['alternate','sequelize','INTEGER','min_internal','min_mailbox','/var/opt/motion2/server/files/sounds/converted','STRING','BOOLEAN'];(function(_0x396466,_0xe9857b){var _0x5e9ab4=function(_0x362f66){while(--_0x362f66){_0x396466['push'](_0x396466['shift']());}};_0x5e9ab4(++_0xe9857b);}(_0x7260,0xd9));var _0x0726=function(_0x1aefb4,_0x57b56e){_0x1aefb4=_0x1aefb4-0x0;var _0xd5fb96=_0x7260[_0x1aefb4];return _0xd5fb96;};'use strict';var Sequelize=require(_0x0726('0x0'));module['exports']={'min_internal':{'type':Sequelize[_0x0726('0x1')](0xb),'unique':_0x0726('0x2'),'defaultValue':0x3e8},'min_mailbox':{'type':Sequelize['INTEGER'](0xb),'unique':_0x0726('0x3'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize[_0x0726('0x1')](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize['STRING'],'defaultValue':_0x0726('0x4')},'logo':{'type':Sequelize[_0x0726('0x5')]},'defaultLogo':{'type':Sequelize[_0x0726('0x6')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0x0726('0x5')]},'defaultLoginLogo':{'type':Sequelize[_0x0726('0x6')],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize['STRING']},'defaultHeaderWhiteLabel':{'type':Sequelize[_0x0726('0x6')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x0726('0x6')],'defaultValue':!![]},'firstSetup':{'type':Sequelize[_0x0726('0x6')],'defaultValue':!![]},'stunaddr':{'type':Sequelize['STRING']},'turnaddr':{'type':Sequelize['STRING']},'turnusername':{'type':Sequelize['STRING']},'turnpassword':{'type':Sequelize[_0x0726('0x5')]},'pageTitle':{'type':Sequelize['STRING']},'defaultPageTitle':{'type':Sequelize[_0x0726('0x6')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x0726('0x6')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0x0726('0x1')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize['STRING'],'defaultValue':'https://www.xcally.com/bar/phonebar/autoupdater.xml'},'enableEmailPreview':{'type':Sequelize[_0x0726('0x6')],'defaultValue':![]},'split':{'type':Sequelize[_0x0726('0x6')],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize[_0x0726('0x1')],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x0726('0x1')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x0726('0x5')],'defaultValue':_0x0726('0x7')},'chatTimeout':{'type':Sequelize[_0x0726('0x1')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'preferred':{'type':Sequelize['STRING']},'defaultPreferred':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'rtlSupport':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0x0726('0x5')]},'allowedLoginAttempts':{'type':Sequelize[_0x0726('0x1')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0x0726('0x1')],'defaultValue':0xa},'favicon':{'type':Sequelize[_0x0726('0x5')]},'defaultFavicon':{'type':Sequelize[_0x0726('0x6')],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize['INTEGER'],'defaultValue':0xa,'validate':{'min':0xa}}}; \ No newline at end of file diff --git a/server/api/setting/setting.controller.js b/server/api/setting/setting.controller.js index 37927fa..1d4f262 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 _0x44e8=['getLicense','preferred','defaultPreferred','defaultFavicon','existsSync','toLower','default_logo.png','custom','ValidationError','\x20not\x20found','download','getLogoLogin','favicon','defaultLogo','defaultLoginLogo','default_loginLogo.png','upperFirst','gdpr','securePassword','addPreferred','getPreferred','default','Sequelize','addFavicon','getFavicon','default_favicon.ico','eml-format','rimraf','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../mysqldb','jayson/promise','client','http','test','Setting,\x20%s,\x20%s','request\x20sent','Setting,\x20%s,\x20%s,\x20%s','stringify','error','message','status','json','offset','limit','set','apply','reject','save','update','destroy','then','end','sendStatus','stack','name','send','index','Setting','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','type','key','VIRTUAL','options','count','includeAll','findAll','rows','catch','show','params','rawAttributes','find','body','get','readFileSync','join','root','server/files/templates/stun.ejs','utf8','server/files/templates/turn.ejs','render','writeFileSync','/etc/asterisk/stun_xcally.conf','/etc/asterisk/turn_xcally.conf','Reload','res_stun_monitor.so','res_rtp_asterisk.so','file','logo','filename','addLogoLogin','loginLogo','../../config/license/util','server/files/images/logos'];(function(_0x338c8c,_0x19df14){var _0x371a9a=function(_0x4da3fe){while(--_0x4da3fe){_0x338c8c['push'](_0x338c8c['shift']());}};_0x371a9a(++_0x19df14);}(_0x44e8,0x194));var _0x844e=function(_0x40d4d6,_0x2c6206){_0x40d4d6=_0x40d4d6-0x0;var _0x3e9531=_0x44e8[_0x40d4d6];return _0x3e9531;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x844e('0x0'));var rimraf=require(_0x844e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x844e('0x2'));var rp=require('request-promise');var moment=require(_0x844e('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x844e('0x4'));var util=require(_0x844e('0x5'));var path=require(_0x844e('0x6'));var sox=require(_0x844e('0x7'));var csv=require(_0x844e('0x8'));var ejs=require(_0x844e('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0x844e('0xa'));var crypto=require('crypto');var jsforce=require(_0x844e('0xb'));var deskjs=require(_0x844e('0xc'));var toCsv=require(_0x844e('0x8'));var querystring=require(_0x844e('0xd'));var Papa=require(_0x844e('0xe'));var Redis=require('ioredis');var authService=require(_0x844e('0xf'));var qs=require(_0x844e('0x10'));var as=require(_0x844e('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x844e('0x12'));var utils=require('../../config/utils');var config=require(_0x844e('0x13'));var db=require(_0x844e('0x14'))['db'];var jayson=require(_0x844e('0x15'));var client=jayson[_0x844e('0x16')][_0x844e('0x17')]({'port':0x232a});function checkPasswordPattern(_0x377da6,_0x172119,_0x2ac751){if(_0x2ac751){var _0x20b58d=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x20b58d[_0x844e('0x18')](_0x172119)){return _0x377da6;}else{throw new Error('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x377da6;}}function respondWithRpcPromise(_0x1d965d,_0x5ac857,_0x49b937,_0x1fcec4){return new BPromise(function(_0x3e0cd8,_0x4889d2){var _0x8069d1=_0x1fcec4||client;return _0x8069d1['request'](_0x1d965d,_0x49b937)['then'](function(_0x52e0f0){logger['info'](_0x844e('0x19'),_0x5ac857,_0x844e('0x1a'));logger['debug'](_0x844e('0x1b'),_0x5ac857,_0x844e('0x1a'),JSON[_0x844e('0x1c')](_0x52e0f0));if(_0x52e0f0[_0x844e('0x1d')]){if(_0x52e0f0['error']['code']===0x1f4){logger['error']('Setting,\x20%s,\x20%s',_0x5ac857,_0x52e0f0['error'][_0x844e('0x1e')]);return _0x4889d2(_0x52e0f0[_0x844e('0x1d')][_0x844e('0x1e')]);}logger['error'](_0x844e('0x19'),_0x5ac857,_0x52e0f0[_0x844e('0x1d')][_0x844e('0x1e')]);return _0x3e0cd8(_0x52e0f0['error'][_0x844e('0x1e')]);}else{logger['info'](_0x844e('0x19'),_0x5ac857,_0x844e('0x1a'));_0x3e0cd8(_0x52e0f0['result'][_0x844e('0x1e')]);}})['catch'](function(_0x4d6a9e){logger['error'](_0x844e('0x19'),_0x5ac857,_0x4d6a9e);_0x4889d2(_0x4d6a9e);});});}function respondWithStatusCode(_0x344073,_0xaefe91){_0xaefe91=_0xaefe91||0xcc;return function(_0x19d08a){if(_0x19d08a){return _0x344073['sendStatus'](_0xaefe91);}return _0x344073[_0x844e('0x1f')](_0xaefe91)['end']();};}function respondWithResult(_0x54d99f,_0x1b3560){_0x1b3560=_0x1b3560||0xc8;return function(_0x3e92fa){if(_0x3e92fa){return _0x54d99f['status'](_0x1b3560)[_0x844e('0x20')](_0x3e92fa);}};}function respondWithFilteredResult(_0xa66dd4,_0x2b5606){return function(_0x52c24a){if(_0x52c24a){var _0x429b5c=_0x52c24a['count'],_0x2ac7de=_0x2b5606['offset'],_0x5244d4=_0x2b5606[_0x844e('0x21')]+_0x2b5606[_0x844e('0x22')],_0x34145e;if(_0x5244d4>=_0x429b5c){_0x5244d4=_0x429b5c;_0x34145e=0xc8;}else{_0x34145e=0xce;}_0xa66dd4['status'](_0x34145e);return _0xa66dd4[_0x844e('0x23')]('Content-Range',_0x2ac7de+'-'+_0x5244d4+'/'+_0x429b5c)[_0x844e('0x20')](_0x52c24a);}return null;};}function patchUpdates(_0x16009e){return function(_0x40ac81){try{jsonpatch[_0x844e('0x24')](_0x40ac81,_0x16009e,!![]);}catch(_0x34a759){return BPromise[_0x844e('0x25')](_0x34a759);}return _0x40ac81[_0x844e('0x26')]();};}function saveUpdates(_0x5436ec,_0x53315f){return function(_0x3ccd54){if(_0x3ccd54){return _0x3ccd54[_0x844e('0x27')](_0x5436ec)['then'](function(_0x167694){return _0x167694;});}return null;};}function removeEntity(_0x10b8ad,_0x12c6b5){return function(_0xa4f50a){if(_0xa4f50a){return _0xa4f50a[_0x844e('0x28')]()[_0x844e('0x29')](function(){_0x10b8ad['status'](0xcc)[_0x844e('0x2a')]();});}};}function handleEntityNotFound(_0x33a5c4,_0x1d275e){return function(_0xc3795e){if(!_0xc3795e){_0x33a5c4[_0x844e('0x2b')](0x194);}return _0xc3795e;};}function handleError(_0x5e538d,_0x16f73a){_0x16f73a=_0x16f73a||0x1f4;return function(_0x2f9ede){logger['error'](_0x2f9ede[_0x844e('0x2c')]);if(_0x2f9ede[_0x844e('0x2d')]){delete _0x2f9ede['name'];}_0x5e538d[_0x844e('0x1f')](_0x16f73a)[_0x844e('0x2e')](_0x2f9ede);};}exports[_0x844e('0x2f')]=function(_0xce1c1d,_0x3faf72){var _0x1ad0a6={},_0x116d7d={},_0x234bc9={'count':0x0,'rows':[]};var _0x4f916e=db[_0x844e('0x30')]['rawAttributes'];_0x116d7d[_0x844e('0x31')]=_[_0x844e('0x32')](_0x4f916e);_0x116d7d[_0x844e('0x33')]=_[_0x844e('0x32')](_0xce1c1d[_0x844e('0x33')]);_0x116d7d[_0x844e('0x34')]=_['intersection'](_0x116d7d['model'],_0x116d7d[_0x844e('0x33')]);_0x1ad0a6['attributes']=_[_0x844e('0x35')](_0x116d7d[_0x844e('0x31')],qs['fields'](_0xce1c1d[_0x844e('0x33')][_0x844e('0x36')]));_0x1ad0a6[_0x844e('0x37')]=_0x1ad0a6[_0x844e('0x37')][_0x844e('0x38')]?_0x1ad0a6[_0x844e('0x37')]:_0x116d7d[_0x844e('0x31')];if(!_0xce1c1d[_0x844e('0x33')][_0x844e('0x39')](_0x844e('0x3a'))){_0x1ad0a6[_0x844e('0x22')]=qs[_0x844e('0x22')](_0xce1c1d[_0x844e('0x33')]['limit']);_0x1ad0a6[_0x844e('0x21')]=qs[_0x844e('0x21')](_0xce1c1d[_0x844e('0x33')][_0x844e('0x21')]);}_0x1ad0a6[_0x844e('0x3b')]=qs[_0x844e('0x3c')](_0xce1c1d['query'][_0x844e('0x3c')]);_0x1ad0a6['where']=qs[_0x844e('0x34')](_[_0x844e('0x3d')](_0xce1c1d['query'],_0x116d7d[_0x844e('0x34')]));if(_0xce1c1d[_0x844e('0x33')][_0x844e('0x3e')]){_0x1ad0a6[_0x844e('0x3f')]=_[_0x844e('0x40')](_0x1ad0a6[_0x844e('0x3f')],{'$or':_['map'](_0x4f916e,function(_0x55595d){if(_0x55595d[_0x844e('0x41')][_0x844e('0x42')]!==_0x844e('0x43')){var _0x5c182b={};_0x5c182b[_0x55595d['field']]={'$like':'%'+_0xce1c1d[_0x844e('0x33')][_0x844e('0x3e')]+'%'};return _0x5c182b;}})});}_0x1ad0a6=_[_0x844e('0x40')]({},_0x1ad0a6,_0xce1c1d[_0x844e('0x44')]);var _0x322268={'where':_0x1ad0a6[_0x844e('0x3f')]};return db[_0x844e('0x30')][_0x844e('0x45')](_0x322268)[_0x844e('0x29')](function(_0x357b22){_0x234bc9[_0x844e('0x45')]=_0x357b22;if(_0xce1c1d[_0x844e('0x33')][_0x844e('0x46')]){_0x1ad0a6['include']=[{'all':!![]}];}return db[_0x844e('0x30')][_0x844e('0x47')](_0x1ad0a6);})[_0x844e('0x29')](function(_0x39ae76){_0x234bc9[_0x844e('0x48')]=_0x39ae76;return _0x234bc9;})[_0x844e('0x29')](respondWithFilteredResult(_0x3faf72,_0x1ad0a6))[_0x844e('0x49')](handleError(_0x3faf72,null));};exports[_0x844e('0x4a')]=function(_0x1333b8,_0x2d0fde){var _0x111f15={'raw':![],'where':{'id':_0x1333b8[_0x844e('0x4b')]['id']}},_0x4e65b6={};_0x4e65b6[_0x844e('0x31')]=_[_0x844e('0x32')](db[_0x844e('0x30')][_0x844e('0x4c')]);_0x4e65b6[_0x844e('0x33')]=_[_0x844e('0x32')](_0x1333b8['query']);_0x4e65b6[_0x844e('0x34')]=_[_0x844e('0x35')](_0x4e65b6[_0x844e('0x31')],_0x4e65b6[_0x844e('0x33')]);_0x111f15[_0x844e('0x37')]=_[_0x844e('0x35')](_0x4e65b6[_0x844e('0x31')],qs[_0x844e('0x36')](_0x1333b8['query'][_0x844e('0x36')]));_0x111f15[_0x844e('0x37')]=_0x111f15[_0x844e('0x37')]['length']?_0x111f15['attributes']:_0x4e65b6[_0x844e('0x31')];if(_0x1333b8['query'][_0x844e('0x46')]){_0x111f15['include']=[{'all':!![]}];}_0x111f15=_[_0x844e('0x40')]({},_0x111f15,_0x1333b8[_0x844e('0x44')]);return db[_0x844e('0x30')][_0x844e('0x4d')](_0x111f15)[_0x844e('0x29')](handleEntityNotFound(_0x2d0fde,null))[_0x844e('0x29')](respondWithResult(_0x2d0fde,null))['catch'](handleError(_0x2d0fde,null));};exports[_0x844e('0x27')]=function(_0x3b3ed7,_0x1f4d3f,_0x88929c){var _0x3899ee;return db[_0x844e('0x30')]['find']({'where':{'id':_0x3b3ed7[_0x844e('0x4b')]['id']}})[_0x844e('0x29')](handleEntityNotFound(_0x1f4d3f,null))[_0x844e('0x29')](saveUpdates(_0x3b3ed7[_0x844e('0x4e')],null))['then'](function(_0x138fc9){if(_0x138fc9){_0x3899ee=_0x138fc9[_0x844e('0x4f')]({'plain':!![]});var _0xe80a70=fs[_0x844e('0x50')](path[_0x844e('0x51')](config[_0x844e('0x52')],_0x844e('0x53')),_0x844e('0x54'));var _0x466979=ejs['render'](_0xe80a70,_0x3899ee);var _0x47789d=fs[_0x844e('0x50')](path[_0x844e('0x51')](config[_0x844e('0x52')],_0x844e('0x55')),_0x844e('0x54'));var _0x51292d=ejs[_0x844e('0x56')](_0x47789d,_0x3899ee);fs[_0x844e('0x57')](_0x844e('0x58'),_0x466979);fs['writeFileSync'](_0x844e('0x59'),_0x51292d);return respondWithRpcPromise(_0x844e('0x5a'),_0x844e('0x27'),{'module':_0x844e('0x5b')});}})[_0x844e('0x29')](function(){return respondWithRpcPromise(_0x844e('0x5a'),_0x844e('0x27'),{'module':_0x844e('0x5c')});})[_0x844e('0x29')](function(){return _0x3899ee||null;})[_0x844e('0x29')](respondWithResult(_0x1f4d3f,null))[_0x844e('0x49')](handleError(_0x1f4d3f,null));};exports['addLogo']=function(_0x4ad33d,_0x7711a4,_0x49f756){if(_0x4ad33d[_0x844e('0x5d')]&&_0x4ad33d['file']['filename']){_0x4ad33d[_0x844e('0x4e')][_0x844e('0x5e')]=_0x4ad33d[_0x844e('0x5d')][_0x844e('0x5f')];}return db[_0x844e('0x30')][_0x844e('0x4d')]({'where':{'id':_0x4ad33d['params']['id']}})[_0x844e('0x29')](handleEntityNotFound(_0x7711a4,null))['then'](saveUpdates(_0x4ad33d['body'],null))[_0x844e('0x29')](respondWithResult(_0x7711a4,null))[_0x844e('0x49')](handleError(_0x7711a4,null));};exports[_0x844e('0x60')]=function(_0x4e7e25,_0x5e4a40,_0x4a0503){if(_0x4e7e25[_0x844e('0x5d')]&&_0x4e7e25[_0x844e('0x5d')]['filename']){_0x4e7e25[_0x844e('0x4e')][_0x844e('0x61')]=_0x4e7e25['file']['filename'];}return db['Setting'][_0x844e('0x4d')]({'where':{'id':_0x4e7e25['params']['id']}})[_0x844e('0x29')](handleEntityNotFound(_0x5e4a40,null))[_0x844e('0x29')](saveUpdates(_0x4e7e25[_0x844e('0x4e')],null))[_0x844e('0x29')](respondWithResult(_0x5e4a40,null))[_0x844e('0x49')](handleError(_0x5e4a40,null));};var utilLicense=require(_0x844e('0x62'));exports['getLogo']=function(_0x3f493d,_0xb7faf7,_0x15932b){var _0x4b002d=_0x844e('0x63');var _0x46bf59={'custom':![]};return utilLicense[_0x844e('0x64')]()[_0x844e('0x29')](function(_0x187fe0){if(_0x187fe0){_0x46bf59=_0x187fe0;}return db[_0x844e('0x30')][_0x844e('0x4d')]({'where':{'id':_0x3f493d[_0x844e('0x4b')]['id']},'attributes':[_0x844e('0x5e'),'loginLogo',_0x844e('0x65'),'favicon','defaultLogo','defaultLoginLogo',_0x844e('0x66'),_0x844e('0x67')],'raw':!![]});})['then'](handleEntityNotFound(_0xb7faf7,null))['then'](function(_0x530b4d){if(_0x530b4d){var _0x5abe2c=_0x530b4d[_0x844e('0x5e')]&&fs[_0x844e('0x68')](path[_0x844e('0x51')](config[_0x844e('0x52')],_0x4b002d,_['toLower'](_0x530b4d[_0x844e('0x5e')])))?path['join'](config[_0x844e('0x52')],_0x4b002d,_[_0x844e('0x69')](_0x530b4d[_0x844e('0x5e')])):path['join'](config[_0x844e('0x52')],_0x4b002d,_[_0x844e('0x69')](_0x844e('0x6a')));var _0x22d345='default'+_['upperFirst'](_0x844e('0x5e'));if(_0x530b4d[_0x22d345]||!_0x46bf59[_0x844e('0x6b')]){_0x5abe2c=path['join'](config['root'],_0x4b002d,_[_0x844e('0x69')](_0x844e('0x6a')));}if(!fs['existsSync'](_0x5abe2c)){throw new db['Sequelize'][(_0x844e('0x6c'))](_['upperFirst'](_0x844e('0x5e'))+_0x844e('0x6d'));}return _0xb7faf7[_0x844e('0x6e')](_0x5abe2c);}})[_0x844e('0x49')](handleError(_0xb7faf7,null));};var utilLicense=require(_0x844e('0x62'));exports[_0x844e('0x6f')]=function(_0x343f29,_0x39350b,_0x1f7b88){var _0x1da140='server/files/images/logos';var _0xb372c5={'custom':![]};return utilLicense[_0x844e('0x64')]()[_0x844e('0x29')](function(_0x5cee37){if(_0x5cee37){_0xb372c5=_0x5cee37;}return db[_0x844e('0x30')]['find']({'where':{'id':_0x343f29['params']['id']},'attributes':[_0x844e('0x5e'),_0x844e('0x61'),'preferred',_0x844e('0x70'),_0x844e('0x71'),_0x844e('0x72'),'defaultPreferred',_0x844e('0x67')],'raw':!![]});})[_0x844e('0x29')](handleEntityNotFound(_0x39350b,null))[_0x844e('0x29')](function(_0x3b2329){if(_0x3b2329){var _0x338eb0=_0x3b2329['loginLogo']&&fs['existsSync'](path['join'](config[_0x844e('0x52')],_0x1da140,_[_0x844e('0x69')](_0x3b2329[_0x844e('0x61')])))?path['join'](config[_0x844e('0x52')],_0x1da140,_[_0x844e('0x69')](_0x3b2329[_0x844e('0x61')])):path[_0x844e('0x51')](config[_0x844e('0x52')],_0x1da140,_[_0x844e('0x69')](_0x844e('0x73')));var _0x3beb36='default'+_[_0x844e('0x74')]('loginLogo');if(_0x3b2329[_0x3beb36]||!_0xb372c5[_0x844e('0x6b')]){_0x338eb0=path[_0x844e('0x51')](config[_0x844e('0x52')],_0x1da140,_['toLower']('default_loginLogo.png'));}if(!fs['existsSync'](_0x338eb0)){throw new db['Sequelize'][(_0x844e('0x6c'))](_[_0x844e('0x74')](_0x844e('0x61'))+_0x844e('0x6d'));}return _0x39350b[_0x844e('0x6e')](_0x338eb0);}})[_0x844e('0x49')](handleError(_0x39350b,null));};exports[_0x844e('0x75')]=function(_0x30b18b,_0x4eeade){return db[_0x844e('0x30')][_0x844e('0x4d')]({'where':{'id':_0x30b18b['params']['id']},'attributes':[_0x844e('0x76')]})[_0x844e('0x29')](respondWithResult(_0x4eeade,null))[_0x844e('0x49')](handleError(_0x4eeade,null));};exports[_0x844e('0x77')]=function(_0x439251,_0xa8aa48,_0x40216e){if(_0x439251[_0x844e('0x5d')]&&_0x439251[_0x844e('0x5d')][_0x844e('0x5f')]){_0x439251[_0x844e('0x4e')][_0x844e('0x65')]=_0x439251[_0x844e('0x5d')]['filename'];}return db[_0x844e('0x30')]['find']({'where':{'id':_0x439251[_0x844e('0x4b')]['id']}})['then'](handleEntityNotFound(_0xa8aa48,null))[_0x844e('0x29')](saveUpdates(_0x439251[_0x844e('0x4e')],null))[_0x844e('0x29')](respondWithResult(_0xa8aa48,null))[_0x844e('0x49')](handleError(_0xa8aa48,null));};var utilLicense=require('../../config/license/util');exports[_0x844e('0x78')]=function(_0x2af79f,_0x53968c,_0x50de19){var _0x2fc8d4='server/files/images/logos';var _0x581165={'custom':![]};return utilLicense['getLicense']()[_0x844e('0x29')](function(_0xb87589){if(_0xb87589){_0x581165=_0xb87589;}return db[_0x844e('0x30')][_0x844e('0x4d')]({'where':{'id':_0x2af79f[_0x844e('0x4b')]['id']},'attributes':[_0x844e('0x5e'),_0x844e('0x61'),_0x844e('0x65'),_0x844e('0x70'),'defaultLogo',_0x844e('0x72'),_0x844e('0x66'),_0x844e('0x67')],'raw':!![]});})[_0x844e('0x29')](handleEntityNotFound(_0x53968c,null))[_0x844e('0x29')](function(_0xf035ce){if(_0xf035ce){var _0x3865a7=_0xf035ce[_0x844e('0x65')]&&fs[_0x844e('0x68')](path['join'](config[_0x844e('0x52')],_0x2fc8d4,_['toLower'](_0xf035ce[_0x844e('0x65')])))?path[_0x844e('0x51')](config[_0x844e('0x52')],_0x2fc8d4,_[_0x844e('0x69')](_0xf035ce['preferred'])):path[_0x844e('0x51')](config['root'],_0x2fc8d4,_['toLower']('default_preferred.png'));var _0x4122e4=_0x844e('0x79')+_[_0x844e('0x74')](_0x844e('0x65'));if(_0xf035ce[_0x4122e4]||!_0x581165[_0x844e('0x6b')]||!_0x581165[_0x844e('0x65')]){_0x3865a7=path[_0x844e('0x51')](config[_0x844e('0x52')],_0x2fc8d4,_[_0x844e('0x69')]('default_preferred.png'));}if(!fs[_0x844e('0x68')](_0x3865a7)){throw new db[(_0x844e('0x7a'))][(_0x844e('0x6c'))](_[_0x844e('0x74')](_0x844e('0x65'))+_0x844e('0x6d'));}return _0x53968c[_0x844e('0x6e')](_0x3865a7);}})[_0x844e('0x49')](handleError(_0x53968c,null));};exports[_0x844e('0x7b')]=function(_0x56fdea,_0x2239df,_0x19bae7){if(_0x56fdea['file']&&_0x56fdea[_0x844e('0x5d')]['filename']){_0x56fdea[_0x844e('0x4e')][_0x844e('0x70')]=_0x56fdea[_0x844e('0x5d')][_0x844e('0x5f')];}return db[_0x844e('0x30')][_0x844e('0x4d')]({'where':{'id':_0x56fdea[_0x844e('0x4b')]['id']}})[_0x844e('0x29')](handleEntityNotFound(_0x2239df,null))[_0x844e('0x29')](saveUpdates(_0x56fdea[_0x844e('0x4e')],null))[_0x844e('0x29')](respondWithResult(_0x2239df,null))[_0x844e('0x49')](handleError(_0x2239df,null));};var utilLicense=require(_0x844e('0x62'));exports[_0x844e('0x7c')]=function(_0xed002f,_0x3aeb5f,_0x447c7e){var _0x2ba142=_0x844e('0x63');var _0x438938={'custom':![]};return utilLicense['getLicense']()[_0x844e('0x29')](function(_0xb11d0d){if(_0xb11d0d){_0x438938=_0xb11d0d;}return db[_0x844e('0x30')][_0x844e('0x4d')]({'where':{'id':_0xed002f['params']['id']},'attributes':['logo',_0x844e('0x61'),'preferred','favicon',_0x844e('0x71'),_0x844e('0x72'),_0x844e('0x66'),_0x844e('0x67')],'raw':!![]});})[_0x844e('0x29')](handleEntityNotFound(_0x3aeb5f,null))[_0x844e('0x29')](function(_0x56df65){if(_0x56df65){var _0x3c377a=_0x56df65[_0x844e('0x70')]&&fs[_0x844e('0x68')](path[_0x844e('0x51')](config[_0x844e('0x52')],_0x2ba142,_[_0x844e('0x69')](_0x56df65[_0x844e('0x70')])))?path[_0x844e('0x51')](config[_0x844e('0x52')],_0x2ba142,_['toLower'](_0x56df65[_0x844e('0x70')])):path['join'](config['root'],_0x2ba142,_[_0x844e('0x69')]('default_favicon.ico'));var _0x4f740c='default'+_[_0x844e('0x74')](_0x844e('0x70'));if(_0x56df65[_0x4f740c]||!_0x438938[_0x844e('0x6b')]){_0x3c377a=path[_0x844e('0x51')](config['root'],_0x2ba142,_['toLower'](_0x844e('0x7d')));}if(!fs['existsSync'](_0x3c377a)){throw new db[(_0x844e('0x7a'))][(_0x844e('0x6c'))](_[_0x844e('0x74')](_0x844e('0x70'))+_0x844e('0x6d'));}return _0x3aeb5f[_0x844e('0x6e')](_0x3c377a);}})['catch'](handleError(_0x3aeb5f,null));}; \ No newline at end of file +var _0x6107=['end','count','offset','limit','Content-Range','json','apply','reject','save','update','destroy','send','Setting','rawAttributes','keys','query','filters','model','intersection','fields','attributes','length','hasOwnProperty','sort','pick','merge','where','type','key','field','filter','options','include','findAll','catch','show','params','includeAll','find','body','get','readFileSync','join','root','utf8','writeFileSync','/etc/asterisk/turn_xcally.conf','Reload','res_rtp_asterisk.so','addLogo','file','filename','addLogoLogin','loginLogo','../../config/license/util','getLogo','server/files/images/logos','getLicense','preferred','favicon','defaultLogo','defaultFavicon','logo','toLower','default_logo.png','default','custom','existsSync','Sequelize','ValidationError','upperFirst','download','getLogoLogin','defaultLoginLogo','gdpr','securePassword','addPreferred','defaultPreferred','default_preferred.png','\x20not\x20found','getFavicon','default_favicon.ico','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','status'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6107,0x14c));var _0x7610=function(_0x4ab07b,_0x1b5369){_0x4ab07b=_0x4ab07b-0x0;var _0x1f1201=_0x6107[_0x4ab07b];return _0x1f1201;};'use strict';var pdf=require(_0x7610('0x0'));var emlformat=require(_0x7610('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x7610('0x2'));var jsonpatch=require(_0x7610('0x3'));var rp=require(_0x7610('0x4'));var moment=require(_0x7610('0x5'));var BPromise=require(_0x7610('0x6'));var Mustache=require(_0x7610('0x7'));var util=require('util');var path=require(_0x7610('0x8'));var sox=require(_0x7610('0x9'));var csv=require(_0x7610('0xa'));var ejs=require(_0x7610('0xb'));var fs=require('fs');var _=require(_0x7610('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x7610('0xd'));var deskjs=require(_0x7610('0xe'));var toCsv=require(_0x7610('0xa'));var querystring=require(_0x7610('0xf'));var Papa=require(_0x7610('0x10'));var Redis=require(_0x7610('0x11'));var authService=require(_0x7610('0x12'));var qs=require(_0x7610('0x13'));var as=require(_0x7610('0x14'));var hardwareService=require(_0x7610('0x15'));var logger=require(_0x7610('0x16'))('api');var utils=require(_0x7610('0x17'));var config=require(_0x7610('0x18'));var db=require(_0x7610('0x19'))['db'];var jayson=require('jayson/promise');var client=jayson['client'][_0x7610('0x1a')]({'port':0x232a});function checkPasswordPattern(_0x51e6b2,_0x1d06da,_0x5c4d66){if(_0x5c4d66){var _0x3e698f=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3e698f[_0x7610('0x1b')](_0x1d06da)){return _0x51e6b2;}else{throw new Error(_0x7610('0x1c'));}}else{return _0x51e6b2;}}function respondWithRpcPromise(_0x4eb3a5,_0x303e54,_0x2fc9a6,_0x333015){return new BPromise(function(_0x586bee,_0xc7557e){var _0x2ab0b0=_0x333015||client;return _0x2ab0b0[_0x7610('0x1d')](_0x4eb3a5,_0x2fc9a6)[_0x7610('0x1e')](function(_0x79244){logger[_0x7610('0x1f')](_0x7610('0x20'),_0x303e54,_0x7610('0x21'));logger[_0x7610('0x22')](_0x7610('0x23'),_0x303e54,'request\x20sent',JSON[_0x7610('0x24')](_0x79244));if(_0x79244[_0x7610('0x25')]){if(_0x79244[_0x7610('0x25')][_0x7610('0x26')]===0x1f4){logger['error'](_0x7610('0x20'),_0x303e54,_0x79244[_0x7610('0x25')]['message']);return _0xc7557e(_0x79244[_0x7610('0x25')][_0x7610('0x27')]);}logger['error']('Setting,\x20%s,\x20%s',_0x303e54,_0x79244['error']['message']);return _0x586bee(_0x79244[_0x7610('0x25')]['message']);}else{logger['info'](_0x7610('0x20'),_0x303e54,'request\x20sent');_0x586bee(_0x79244[_0x7610('0x28')][_0x7610('0x27')]);}})['catch'](function(_0x161f44){logger['error'](_0x7610('0x20'),_0x303e54,_0x161f44);_0xc7557e(_0x161f44);});});}function respondWithStatusCode(_0x47683a,_0x345589){_0x345589=_0x345589||0xcc;return function(_0x3fe3b6){if(_0x3fe3b6){return _0x47683a[_0x7610('0x29')](_0x345589);}return _0x47683a[_0x7610('0x2a')](_0x345589)[_0x7610('0x2b')]();};}function respondWithResult(_0x2f3270,_0x3d8117){_0x3d8117=_0x3d8117||0xc8;return function(_0x5f0fb0){if(_0x5f0fb0){return _0x2f3270[_0x7610('0x2a')](_0x3d8117)['json'](_0x5f0fb0);}};}function respondWithFilteredResult(_0x52d0df,_0x2a829e){return function(_0x4f5bcf){if(_0x4f5bcf){var _0x5cd6ba=_0x4f5bcf[_0x7610('0x2c')],_0x32f2b9=_0x2a829e[_0x7610('0x2d')],_0x43eae6=_0x2a829e[_0x7610('0x2d')]+_0x2a829e[_0x7610('0x2e')],_0x2639c6;if(_0x43eae6>=_0x5cd6ba){_0x43eae6=_0x5cd6ba;_0x2639c6=0xc8;}else{_0x2639c6=0xce;}_0x52d0df['status'](_0x2639c6);return _0x52d0df['set'](_0x7610('0x2f'),_0x32f2b9+'-'+_0x43eae6+'/'+_0x5cd6ba)[_0x7610('0x30')](_0x4f5bcf);}return null;};}function patchUpdates(_0x5a573f){return function(_0x59d6b0){try{jsonpatch[_0x7610('0x31')](_0x59d6b0,_0x5a573f,!![]);}catch(_0x4cc913){return BPromise[_0x7610('0x32')](_0x4cc913);}return _0x59d6b0[_0x7610('0x33')]();};}function saveUpdates(_0x18e89b,_0x1c6e11){return function(_0x1e289c){if(_0x1e289c){return _0x1e289c[_0x7610('0x34')](_0x18e89b)[_0x7610('0x1e')](function(_0x118aba){return _0x118aba;});}return null;};}function removeEntity(_0x443221,_0x49ec51){return function(_0x425b17){if(_0x425b17){return _0x425b17[_0x7610('0x35')]()['then'](function(){_0x443221['status'](0xcc)[_0x7610('0x2b')]();});}};}function handleEntityNotFound(_0x1cfdc3,_0x3ec806){return function(_0xd1622c){if(!_0xd1622c){_0x1cfdc3[_0x7610('0x29')](0x194);}return _0xd1622c;};}function handleError(_0x27f5f2,_0x257d97){_0x257d97=_0x257d97||0x1f4;return function(_0x31f049){logger[_0x7610('0x25')](_0x31f049['stack']);if(_0x31f049['name']){delete _0x31f049['name'];}_0x27f5f2[_0x7610('0x2a')](_0x257d97)[_0x7610('0x36')](_0x31f049);};}exports['index']=function(_0x5f3763,_0x2d62ba){var _0x109c9e={},_0x160e08={},_0x4830c9={'count':0x0,'rows':[]};var _0x1a1cf0=db[_0x7610('0x37')][_0x7610('0x38')];_0x160e08['model']=_[_0x7610('0x39')](_0x1a1cf0);_0x160e08[_0x7610('0x3a')]=_['keys'](_0x5f3763[_0x7610('0x3a')]);_0x160e08[_0x7610('0x3b')]=_['intersection'](_0x160e08[_0x7610('0x3c')],_0x160e08[_0x7610('0x3a')]);_0x109c9e['attributes']=_[_0x7610('0x3d')](_0x160e08[_0x7610('0x3c')],qs[_0x7610('0x3e')](_0x5f3763[_0x7610('0x3a')][_0x7610('0x3e')]));_0x109c9e[_0x7610('0x3f')]=_0x109c9e['attributes'][_0x7610('0x40')]?_0x109c9e[_0x7610('0x3f')]:_0x160e08[_0x7610('0x3c')];if(!_0x5f3763[_0x7610('0x3a')][_0x7610('0x41')]('nolimit')){_0x109c9e[_0x7610('0x2e')]=qs['limit'](_0x5f3763[_0x7610('0x3a')][_0x7610('0x2e')]);_0x109c9e['offset']=qs[_0x7610('0x2d')](_0x5f3763[_0x7610('0x3a')][_0x7610('0x2d')]);}_0x109c9e['order']=qs['sort'](_0x5f3763[_0x7610('0x3a')][_0x7610('0x42')]);_0x109c9e['where']=qs[_0x7610('0x3b')](_[_0x7610('0x43')](_0x5f3763['query'],_0x160e08[_0x7610('0x3b')]));if(_0x5f3763[_0x7610('0x3a')]['filter']){_0x109c9e['where']=_[_0x7610('0x44')](_0x109c9e[_0x7610('0x45')],{'$or':_['map'](_0x1a1cf0,function(_0x53171b){if(_0x53171b[_0x7610('0x46')][_0x7610('0x47')]!=='VIRTUAL'){var _0x182226={};_0x182226[_0x53171b[_0x7610('0x48')]]={'$like':'%'+_0x5f3763['query'][_0x7610('0x49')]+'%'};return _0x182226;}})});}_0x109c9e=_[_0x7610('0x44')]({},_0x109c9e,_0x5f3763[_0x7610('0x4a')]);var _0x10df8c={'where':_0x109c9e[_0x7610('0x45')]};return db[_0x7610('0x37')][_0x7610('0x2c')](_0x10df8c)[_0x7610('0x1e')](function(_0x246f8a){_0x4830c9[_0x7610('0x2c')]=_0x246f8a;if(_0x5f3763[_0x7610('0x3a')]['includeAll']){_0x109c9e[_0x7610('0x4b')]=[{'all':!![]}];}return db[_0x7610('0x37')][_0x7610('0x4c')](_0x109c9e);})[_0x7610('0x1e')](function(_0x25876b){_0x4830c9['rows']=_0x25876b;return _0x4830c9;})[_0x7610('0x1e')](respondWithFilteredResult(_0x2d62ba,_0x109c9e))[_0x7610('0x4d')](handleError(_0x2d62ba,null));};exports[_0x7610('0x4e')]=function(_0x3c766c,_0x56dcba){var _0x8af9b2={'raw':![],'where':{'id':_0x3c766c[_0x7610('0x4f')]['id']}},_0x3acf60={};_0x3acf60[_0x7610('0x3c')]=_[_0x7610('0x39')](db[_0x7610('0x37')][_0x7610('0x38')]);_0x3acf60[_0x7610('0x3a')]=_['keys'](_0x3c766c[_0x7610('0x3a')]);_0x3acf60[_0x7610('0x3b')]=_['intersection'](_0x3acf60[_0x7610('0x3c')],_0x3acf60[_0x7610('0x3a')]);_0x8af9b2[_0x7610('0x3f')]=_[_0x7610('0x3d')](_0x3acf60[_0x7610('0x3c')],qs[_0x7610('0x3e')](_0x3c766c[_0x7610('0x3a')]['fields']));_0x8af9b2[_0x7610('0x3f')]=_0x8af9b2[_0x7610('0x3f')][_0x7610('0x40')]?_0x8af9b2[_0x7610('0x3f')]:_0x3acf60['model'];if(_0x3c766c[_0x7610('0x3a')][_0x7610('0x50')]){_0x8af9b2[_0x7610('0x4b')]=[{'all':!![]}];}_0x8af9b2=_['merge']({},_0x8af9b2,_0x3c766c[_0x7610('0x4a')]);return db[_0x7610('0x37')]['find'](_0x8af9b2)[_0x7610('0x1e')](handleEntityNotFound(_0x56dcba,null))['then'](respondWithResult(_0x56dcba,null))['catch'](handleError(_0x56dcba,null));};exports[_0x7610('0x34')]=function(_0x53f384,_0x47997e,_0x2a02ac){var _0xab0238;return db[_0x7610('0x37')][_0x7610('0x51')]({'where':{'id':_0x53f384[_0x7610('0x4f')]['id']}})['then'](handleEntityNotFound(_0x47997e,null))[_0x7610('0x1e')](saveUpdates(_0x53f384[_0x7610('0x52')],null))['then'](function(_0x392124){if(_0x392124){_0xab0238=_0x392124[_0x7610('0x53')]({'plain':!![]});var _0x244cae=fs[_0x7610('0x54')](path[_0x7610('0x55')](config[_0x7610('0x56')],'server/files/templates/stun.ejs'),_0x7610('0x57'));var _0x5324d3=ejs['render'](_0x244cae,_0xab0238);var _0x366787=fs[_0x7610('0x54')](path[_0x7610('0x55')](config[_0x7610('0x56')],'server/files/templates/turn.ejs'),'utf8');var _0x234c1d=ejs['render'](_0x366787,_0xab0238);fs[_0x7610('0x58')]('/etc/asterisk/stun_xcally.conf',_0x5324d3);fs['writeFileSync'](_0x7610('0x59'),_0x234c1d);return respondWithRpcPromise(_0x7610('0x5a'),_0x7610('0x34'),{'module':'res_stun_monitor.so'});}})[_0x7610('0x1e')](function(){return respondWithRpcPromise(_0x7610('0x5a'),'update',{'module':_0x7610('0x5b')});})[_0x7610('0x1e')](function(){return _0xab0238||null;})['then'](respondWithResult(_0x47997e,null))['catch'](handleError(_0x47997e,null));};exports[_0x7610('0x5c')]=function(_0x3f16c7,_0x2d834f,_0x8b7b5e){if(_0x3f16c7[_0x7610('0x5d')]&&_0x3f16c7[_0x7610('0x5d')][_0x7610('0x5e')]){_0x3f16c7['body']['logo']=_0x3f16c7[_0x7610('0x5d')][_0x7610('0x5e')];}return db[_0x7610('0x37')][_0x7610('0x51')]({'where':{'id':_0x3f16c7[_0x7610('0x4f')]['id']}})[_0x7610('0x1e')](handleEntityNotFound(_0x2d834f,null))[_0x7610('0x1e')](saveUpdates(_0x3f16c7[_0x7610('0x52')],null))[_0x7610('0x1e')](respondWithResult(_0x2d834f,null))['catch'](handleError(_0x2d834f,null));};exports[_0x7610('0x5f')]=function(_0x37aa6a,_0x586af8,_0x35ed16){if(_0x37aa6a['file']&&_0x37aa6a['file'][_0x7610('0x5e')]){_0x37aa6a[_0x7610('0x52')][_0x7610('0x60')]=_0x37aa6a[_0x7610('0x5d')][_0x7610('0x5e')];}return db[_0x7610('0x37')][_0x7610('0x51')]({'where':{'id':_0x37aa6a[_0x7610('0x4f')]['id']}})[_0x7610('0x1e')](handleEntityNotFound(_0x586af8,null))[_0x7610('0x1e')](saveUpdates(_0x37aa6a[_0x7610('0x52')],null))[_0x7610('0x1e')](respondWithResult(_0x586af8,null))[_0x7610('0x4d')](handleError(_0x586af8,null));};var utilLicense=require(_0x7610('0x61'));exports[_0x7610('0x62')]=function(_0x3ff919,_0x180fe8,_0x16cd7d){var _0x229694=_0x7610('0x63');var _0x45195d={'custom':![]};return utilLicense[_0x7610('0x64')]()[_0x7610('0x1e')](function(_0x7c4f16){if(_0x7c4f16){_0x45195d=_0x7c4f16;}return db['Setting'][_0x7610('0x51')]({'where':{'id':_0x3ff919[_0x7610('0x4f')]['id']},'attributes':['logo',_0x7610('0x60'),_0x7610('0x65'),_0x7610('0x66'),_0x7610('0x67'),'defaultLoginLogo','defaultPreferred',_0x7610('0x68')],'raw':!![]});})[_0x7610('0x1e')](handleEntityNotFound(_0x180fe8,null))[_0x7610('0x1e')](function(_0x46ff27){if(_0x46ff27){var _0x102036=_0x46ff27[_0x7610('0x69')]&&fs['existsSync'](path[_0x7610('0x55')](config[_0x7610('0x56')],_0x229694,_[_0x7610('0x6a')](_0x46ff27[_0x7610('0x69')])))?path[_0x7610('0x55')](config['root'],_0x229694,_['toLower'](_0x46ff27[_0x7610('0x69')])):path['join'](config[_0x7610('0x56')],_0x229694,_[_0x7610('0x6a')](_0x7610('0x6b')));var _0x59c9a6=_0x7610('0x6c')+_['upperFirst'](_0x7610('0x69'));if(_0x46ff27[_0x59c9a6]||!_0x45195d[_0x7610('0x6d')]){_0x102036=path[_0x7610('0x55')](config['root'],_0x229694,_['toLower']('default_logo.png'));}if(!fs[_0x7610('0x6e')](_0x102036)){throw new db[(_0x7610('0x6f'))][(_0x7610('0x70'))](_[_0x7610('0x71')](_0x7610('0x69'))+'\x20not\x20found');}return _0x180fe8[_0x7610('0x72')](_0x102036);}})[_0x7610('0x4d')](handleError(_0x180fe8,null));};var utilLicense=require(_0x7610('0x61'));exports[_0x7610('0x73')]=function(_0x48edb6,_0x1d32a7,_0x54b189){var _0x13194a=_0x7610('0x63');var _0x3b1f8e={'custom':![]};return utilLicense['getLicense']()[_0x7610('0x1e')](function(_0x462225){if(_0x462225){_0x3b1f8e=_0x462225;}return db[_0x7610('0x37')][_0x7610('0x51')]({'where':{'id':_0x48edb6[_0x7610('0x4f')]['id']},'attributes':[_0x7610('0x69'),_0x7610('0x60'),'preferred','favicon',_0x7610('0x67'),_0x7610('0x74'),'defaultPreferred',_0x7610('0x68')],'raw':!![]});})['then'](handleEntityNotFound(_0x1d32a7,null))[_0x7610('0x1e')](function(_0xcf6117){if(_0xcf6117){var _0x178a33=_0xcf6117[_0x7610('0x60')]&&fs[_0x7610('0x6e')](path[_0x7610('0x55')](config[_0x7610('0x56')],_0x13194a,_[_0x7610('0x6a')](_0xcf6117[_0x7610('0x60')])))?path['join'](config[_0x7610('0x56')],_0x13194a,_[_0x7610('0x6a')](_0xcf6117[_0x7610('0x60')])):path[_0x7610('0x55')](config[_0x7610('0x56')],_0x13194a,_[_0x7610('0x6a')]('default_loginLogo.png'));var _0x4beba3=_0x7610('0x6c')+_['upperFirst'](_0x7610('0x60'));if(_0xcf6117[_0x4beba3]||!_0x3b1f8e[_0x7610('0x6d')]){_0x178a33=path['join'](config[_0x7610('0x56')],_0x13194a,_[_0x7610('0x6a')]('default_loginLogo.png'));}if(!fs['existsSync'](_0x178a33)){throw new db[(_0x7610('0x6f'))][(_0x7610('0x70'))](_[_0x7610('0x71')](_0x7610('0x60'))+'\x20not\x20found');}return _0x1d32a7[_0x7610('0x72')](_0x178a33);}})[_0x7610('0x4d')](handleError(_0x1d32a7,null));};exports[_0x7610('0x75')]=function(_0x27daa4,_0x54f52e){return db['Setting']['find']({'where':{'id':_0x27daa4[_0x7610('0x4f')]['id']},'attributes':[_0x7610('0x76')]})[_0x7610('0x1e')](respondWithResult(_0x54f52e,null))[_0x7610('0x4d')](handleError(_0x54f52e,null));};exports[_0x7610('0x77')]=function(_0x157dbf,_0x5f47aa,_0x38ea1b){if(_0x157dbf[_0x7610('0x5d')]&&_0x157dbf['file'][_0x7610('0x5e')]){_0x157dbf[_0x7610('0x52')][_0x7610('0x65')]=_0x157dbf['file']['filename'];}return db[_0x7610('0x37')][_0x7610('0x51')]({'where':{'id':_0x157dbf[_0x7610('0x4f')]['id']}})['then'](handleEntityNotFound(_0x5f47aa,null))[_0x7610('0x1e')](saveUpdates(_0x157dbf[_0x7610('0x52')],null))[_0x7610('0x1e')](respondWithResult(_0x5f47aa,null))[_0x7610('0x4d')](handleError(_0x5f47aa,null));};var utilLicense=require(_0x7610('0x61'));exports['getPreferred']=function(_0xd8e706,_0x178a29,_0x305095){var _0x52aae2='server/files/images/logos';var _0x37a246={'custom':![]};return utilLicense[_0x7610('0x64')]()[_0x7610('0x1e')](function(_0x3ae5f5){if(_0x3ae5f5){_0x37a246=_0x3ae5f5;}return db[_0x7610('0x37')]['find']({'where':{'id':_0xd8e706[_0x7610('0x4f')]['id']},'attributes':[_0x7610('0x69'),_0x7610('0x60'),_0x7610('0x65'),_0x7610('0x66'),_0x7610('0x67'),_0x7610('0x74'),_0x7610('0x78'),_0x7610('0x68')],'raw':!![]});})[_0x7610('0x1e')](handleEntityNotFound(_0x178a29,null))[_0x7610('0x1e')](function(_0x4812ce){if(_0x4812ce){var _0x4e9024=_0x4812ce[_0x7610('0x65')]&&fs[_0x7610('0x6e')](path[_0x7610('0x55')](config[_0x7610('0x56')],_0x52aae2,_['toLower'](_0x4812ce[_0x7610('0x65')])))?path[_0x7610('0x55')](config['root'],_0x52aae2,_['toLower'](_0x4812ce[_0x7610('0x65')])):path[_0x7610('0x55')](config['root'],_0x52aae2,_[_0x7610('0x6a')]('default_preferred.png'));var _0x130e42=_0x7610('0x6c')+_['upperFirst']('preferred');if(_0x4812ce[_0x130e42]||!_0x37a246['custom']||!_0x37a246[_0x7610('0x65')]){_0x4e9024=path[_0x7610('0x55')](config['root'],_0x52aae2,_['toLower'](_0x7610('0x79')));}if(!fs[_0x7610('0x6e')](_0x4e9024)){throw new db[(_0x7610('0x6f'))][(_0x7610('0x70'))](_[_0x7610('0x71')](_0x7610('0x65'))+_0x7610('0x7a'));}return _0x178a29[_0x7610('0x72')](_0x4e9024);}})[_0x7610('0x4d')](handleError(_0x178a29,null));};exports['addFavicon']=function(_0x1f67b4,_0x6938e8,_0x50a65d){if(_0x1f67b4[_0x7610('0x5d')]&&_0x1f67b4[_0x7610('0x5d')][_0x7610('0x5e')]){_0x1f67b4[_0x7610('0x52')][_0x7610('0x66')]=_0x1f67b4[_0x7610('0x5d')]['filename'];}return db[_0x7610('0x37')]['find']({'where':{'id':_0x1f67b4['params']['id']}})[_0x7610('0x1e')](handleEntityNotFound(_0x6938e8,null))[_0x7610('0x1e')](saveUpdates(_0x1f67b4[_0x7610('0x52')],null))[_0x7610('0x1e')](respondWithResult(_0x6938e8,null))[_0x7610('0x4d')](handleError(_0x6938e8,null));};var utilLicense=require('../../config/license/util');exports[_0x7610('0x7b')]=function(_0x17692f,_0x4edee5,_0xcd2449){var _0x1c6e5a='server/files/images/logos';var _0x237d3e={'custom':![]};return utilLicense[_0x7610('0x64')]()['then'](function(_0x39acaf){if(_0x39acaf){_0x237d3e=_0x39acaf;}return db[_0x7610('0x37')][_0x7610('0x51')]({'where':{'id':_0x17692f['params']['id']},'attributes':[_0x7610('0x69'),_0x7610('0x60'),_0x7610('0x65'),_0x7610('0x66'),_0x7610('0x67'),_0x7610('0x74'),'defaultPreferred',_0x7610('0x68')],'raw':!![]});})[_0x7610('0x1e')](handleEntityNotFound(_0x4edee5,null))['then'](function(_0x54ad1e){if(_0x54ad1e){var _0x32ce48=_0x54ad1e['favicon']&&fs['existsSync'](path['join'](config[_0x7610('0x56')],_0x1c6e5a,_[_0x7610('0x6a')](_0x54ad1e['favicon'])))?path[_0x7610('0x55')](config[_0x7610('0x56')],_0x1c6e5a,_['toLower'](_0x54ad1e[_0x7610('0x66')])):path[_0x7610('0x55')](config[_0x7610('0x56')],_0x1c6e5a,_[_0x7610('0x6a')](_0x7610('0x7c')));var _0x5706dc='default'+_[_0x7610('0x71')](_0x7610('0x66'));if(_0x54ad1e[_0x5706dc]||!_0x237d3e[_0x7610('0x6d')]){_0x32ce48=path[_0x7610('0x55')](config[_0x7610('0x56')],_0x1c6e5a,_[_0x7610('0x6a')](_0x7610('0x7c')));}if(!fs[_0x7610('0x6e')](_0x32ce48)){throw new db[(_0x7610('0x6f'))][(_0x7610('0x70'))](_['upperFirst'](_0x7610('0x66'))+_0x7610('0x7a'));}return _0x4edee5[_0x7610('0x72')](_0x32ce48);}})[_0x7610('0x4d')](handleError(_0x4edee5,null));}; \ No newline at end of file diff --git a/server/api/setting/setting.model.js b/server/api/setting/setting.model.js index 378c10a..50b8eee 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 _0xa2aa=['../../config/logger','api','bluebird','request-promise','rimraf','exports','define','Setting','settings'];(function(_0x54f813,_0x57f58f){var _0x3ec172=function(_0x2ad15c){while(--_0x2ad15c){_0x54f813['push'](_0x54f813['shift']());}};_0x3ec172(++_0x57f58f);}(_0xa2aa,0x129));var _0xaa2a=function(_0x45dfdb,_0x533084){_0x45dfdb=_0x45dfdb-0x0;var _0x459a86=_0xa2aa[_0x45dfdb];return _0x459a86;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xaa2a('0x0'))(_0xaa2a('0x1'));var moment=require('moment');var BPromise=require(_0xaa2a('0x2'));var rp=require(_0xaa2a('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xaa2a('0x4'));var config=require('../../config/environment');var attributes=require('./setting.attributes');module[_0xaa2a('0x5')]=function(_0x3c4d53,_0x3e7957){return _0x3c4d53[_0xaa2a('0x6')](_0xaa2a('0x7'),attributes,{'tableName':_0xaa2a('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9dbf=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./setting.attributes','define','Setting','lodash'];(function(_0x59d0cc,_0xa7c52b){var _0x2ae79f=function(_0x33042e){while(--_0x33042e){_0x59d0cc['push'](_0x59d0cc['shift']());}};_0x2ae79f(++_0xa7c52b);}(_0x9dbf,0x99));var _0xf9db=function(_0x3738b1,_0x2de384){_0x3738b1=_0x3738b1-0x0;var _0x464265=_0x9dbf[_0x3738b1];return _0x464265;};'use strict';var _=require(_0xf9db('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xf9db('0x1'));var moment=require(_0xf9db('0x2'));var BPromise=require(_0xf9db('0x3'));var rp=require(_0xf9db('0x4'));var fs=require('fs');var path=require(_0xf9db('0x5'));var rimraf=require(_0xf9db('0x6'));var config=require(_0xf9db('0x7'));var attributes=require(_0xf9db('0x8'));module['exports']=function(_0xc9f8a7,_0x127970){return _0xc9f8a7[_0xf9db('0x9')](_0xf9db('0xa'),attributes,{'tableName':'settings','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/setting/setting.rpc.js b/server/api/setting/setting.rpc.js index 60a6833..49649ac 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 _0x3c38=['ioredis','../../config/utils','../../config/logger','rpc','client','http','request','then','info','Setting,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','lodash','util','moment','bluebird','randomstring'];(function(_0x14e660,_0x2dacd2){var _0x3090af=function(_0x1ac007){while(--_0x1ac007){_0x14e660['push'](_0x14e660['shift']());}};_0x3090af(++_0x2dacd2);}(_0x3c38,0x1c9));var _0x83c3=function(_0xe7d5c7,_0x2a6fb6){_0xe7d5c7=_0xe7d5c7-0x0;var _0x15a9c6=_0x3c38[_0xe7d5c7];return _0x15a9c6;};'use strict';var _=require(_0x83c3('0x0'));var util=require(_0x83c3('0x1'));var moment=require(_0x83c3('0x2'));var BPromise=require(_0x83c3('0x3'));var rs=require(_0x83c3('0x4'));var fs=require('fs');var Redis=require(_0x83c3('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x83c3('0x6'));var logger=require(_0x83c3('0x7'))(_0x83c3('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x83c3('0x9')][_0x83c3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4bbeb4,_0x9def9b,_0x3c85c){return new BPromise(function(_0x4b3b57,_0x110204){return client[_0x83c3('0xb')](_0x4bbeb4,_0x3c85c)[_0x83c3('0xc')](function(_0x22cea8){logger[_0x83c3('0xd')](_0x83c3('0xe'),_0x9def9b,_0x83c3('0xf'));logger[_0x83c3('0x10')]('Setting,\x20%s,\x20%s,\x20%s',_0x9def9b,'request\x20sent',JSON[_0x83c3('0x11')](_0x22cea8));if(_0x22cea8[_0x83c3('0x12')]){if(_0x22cea8[_0x83c3('0x12')][_0x83c3('0x13')]===0x1f4){logger[_0x83c3('0x12')](_0x83c3('0xe'),_0x9def9b,_0x22cea8[_0x83c3('0x12')][_0x83c3('0x14')]);return _0x110204(_0x22cea8[_0x83c3('0x12')][_0x83c3('0x14')]);}logger['error'](_0x83c3('0xe'),_0x9def9b,_0x22cea8[_0x83c3('0x12')][_0x83c3('0x14')]);return _0x4b3b57(_0x22cea8[_0x83c3('0x12')][_0x83c3('0x14')]);}else{logger[_0x83c3('0xd')](_0x83c3('0xe'),_0x9def9b,_0x83c3('0xf'));_0x4b3b57(_0x22cea8['result'][_0x83c3('0x14')]);}})['catch'](function(_0x294fd9){logger['error'](_0x83c3('0xe'),_0x9def9b,_0x294fd9);_0x110204(_0x294fd9);});});} \ No newline at end of file +var _0x9fae=['Setting,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info'];(function(_0x39b77c,_0x487571){var _0x4931e1=function(_0xacdc93){while(--_0xacdc93){_0x39b77c['push'](_0x39b77c['shift']());}};_0x4931e1(++_0x487571);}(_0x9fae,0x134));var _0xe9fa=function(_0x3c5ebd,_0x3f8982){_0x3c5ebd=_0x3c5ebd-0x0;var _0x33e1fa=_0x9fae[_0x3c5ebd];return _0x33e1fa;};'use strict';var _=require(_0xe9fa('0x0'));var util=require(_0xe9fa('0x1'));var moment=require('moment');var BPromise=require(_0xe9fa('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe9fa('0x3'))['db'];var utils=require(_0xe9fa('0x4'));var logger=require(_0xe9fa('0x5'))(_0xe9fa('0x6'));var config=require(_0xe9fa('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0xe9fa('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4b5f54,_0x3f2ec7,_0x40eb89){return new BPromise(function(_0x2b77fc,_0x59afea){return client[_0xe9fa('0x9')](_0x4b5f54,_0x40eb89)[_0xe9fa('0xa')](function(_0x18ae0c){logger[_0xe9fa('0xb')](_0xe9fa('0xc'),_0x3f2ec7,_0xe9fa('0xd'));logger['debug']('Setting,\x20%s,\x20%s,\x20%s',_0x3f2ec7,_0xe9fa('0xd'),JSON[_0xe9fa('0xe')](_0x18ae0c));if(_0x18ae0c[_0xe9fa('0xf')]){if(_0x18ae0c[_0xe9fa('0xf')][_0xe9fa('0x10')]===0x1f4){logger[_0xe9fa('0xf')](_0xe9fa('0xc'),_0x3f2ec7,_0x18ae0c['error'][_0xe9fa('0x11')]);return _0x59afea(_0x18ae0c[_0xe9fa('0xf')][_0xe9fa('0x11')]);}logger[_0xe9fa('0xf')](_0xe9fa('0xc'),_0x3f2ec7,_0x18ae0c[_0xe9fa('0xf')]['message']);return _0x2b77fc(_0x18ae0c[_0xe9fa('0xf')][_0xe9fa('0x11')]);}else{logger['info']('Setting,\x20%s,\x20%s',_0x3f2ec7,_0xe9fa('0xd'));_0x2b77fc(_0x18ae0c[_0xe9fa('0x12')][_0xe9fa('0x11')]);}})[_0xe9fa('0x13')](function(_0x4d324c){logger[_0xe9fa('0xf')](_0xe9fa('0xc'),_0x3f2ec7,_0x4d324c);_0x59afea(_0x4d324c);});});} \ No newline at end of file diff --git a/server/api/smsAccount/index.js b/server/api/smsAccount/index.js index 8e3af89..c6506be 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 _0xe620=['post','addDisposition','/:id/canned_answers','/:id/notify','notify','/:id/applications','addApplications','/:id/send','send','status','addAgents','put','/:id','update','delete','destroy','/:id/dispositions','removeDispositions','multer','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','./smsAccount.controller','get','isAuthenticated','index','/describe','describe','show','getDispositions','getAnswers','getApplications','/:id/interactions','getInteractions','/:id/users','getAgents'];(function(_0x43e284,_0x53b7b6){var _0x392817=function(_0x5b3247){while(--_0x5b3247){_0x43e284['push'](_0x43e284['shift']());}};_0x392817(++_0x53b7b6);}(_0xe620,0x1b4));var _0x0e62=function(_0x11441f,_0x1dbdaa){_0x11441f=_0x11441f-0x0;var _0x54fe22=_0xe620[_0x11441f];return _0x54fe22;};'use strict';var multer=require(_0x0e62('0x0'));var util=require(_0x0e62('0x1'));var path=require(_0x0e62('0x2'));var timeout=require(_0x0e62('0x3'));var express=require('express');var router=express['Router']();var auth=require(_0x0e62('0x4'));var interaction=require(_0x0e62('0x5'));var config=require('../../config/environment');var controller=require(_0x0e62('0x6'));router[_0x0e62('0x7')]('/',auth[_0x0e62('0x8')](),controller[_0x0e62('0x9')]);router['get'](_0x0e62('0xa'),auth['isAuthenticated'](),controller[_0x0e62('0xb')]);router[_0x0e62('0x7')]('/:id',auth['isAuthenticated'](),controller[_0x0e62('0xc')]);router[_0x0e62('0x7')]('/:id/dispositions',auth[_0x0e62('0x8')](),controller[_0x0e62('0xd')]);router[_0x0e62('0x7')]('/:id/canned_answers',auth[_0x0e62('0x8')](),controller[_0x0e62('0xe')]);router[_0x0e62('0x7')]('/:id/applications',auth[_0x0e62('0x8')](),controller[_0x0e62('0xf')]);router[_0x0e62('0x7')](_0x0e62('0x10'),auth[_0x0e62('0x8')](),controller[_0x0e62('0x11')]);router['get']('/:id/status',controller['statusGet']);router[_0x0e62('0x7')](_0x0e62('0x12'),auth[_0x0e62('0x8')](),controller[_0x0e62('0x13')]);router[_0x0e62('0x14')]('/',auth[_0x0e62('0x8')](),controller['create']);router[_0x0e62('0x14')]('/:id/dispositions',auth[_0x0e62('0x8')](),controller[_0x0e62('0x15')]);router[_0x0e62('0x14')](_0x0e62('0x16'),auth[_0x0e62('0x8')](),controller['addAnswer']);router[_0x0e62('0x14')](_0x0e62('0x17'),controller[_0x0e62('0x18')]);router[_0x0e62('0x14')](_0x0e62('0x19'),auth['isAuthenticated'](),controller[_0x0e62('0x1a')]);router[_0x0e62('0x14')](_0x0e62('0x1b'),auth[_0x0e62('0x8')](),controller[_0x0e62('0x1c')]);router[_0x0e62('0x14')]('/:id/status',controller[_0x0e62('0x1d')]);router[_0x0e62('0x14')](_0x0e62('0x12'),auth[_0x0e62('0x8')](),controller[_0x0e62('0x1e')]);router[_0x0e62('0x1f')](_0x0e62('0x20'),auth[_0x0e62('0x8')](),controller[_0x0e62('0x21')]);router[_0x0e62('0x22')](_0x0e62('0x20'),auth['isAuthenticated'](),controller[_0x0e62('0x23')]);router[_0x0e62('0x22')](_0x0e62('0x24'),auth['isAuthenticated'](),controller[_0x0e62('0x25')]);router[_0x0e62('0x22')](_0x0e62('0x16'),auth['isAuthenticated'](),controller['removeAnswers']);router[_0x0e62('0x22')]('/:id/users',auth['isAuthenticated'](),controller['removeAgents']);module['exports']=router; \ No newline at end of file +var _0xd1f6=['/:id/notify','notify','send','status','addAgents','put','/:id','delete','destroy','removeAnswers','exports','util','path','express','Router','../../components/auth/service','../../components/interaction/service','./smsAccount.controller','get','isAuthenticated','index','/describe','show','/:id/dispositions','getDispositions','getAnswers','/:id/applications','getApplications','/:id/interactions','getInteractions','/:id/status','/:id/users','post','create','/:id/canned_answers'];(function(_0x3b2a78,_0x1c1c98){var _0x4e8c10=function(_0x851b10){while(--_0x851b10){_0x3b2a78['push'](_0x3b2a78['shift']());}};_0x4e8c10(++_0x1c1c98);}(_0xd1f6,0xba));var _0x6d1f=function(_0x1f9938,_0x2eb1ec){_0x1f9938=_0x1f9938-0x0;var _0x5bc97e=_0xd1f6[_0x1f9938];return _0x5bc97e;};'use strict';var multer=require('multer');var util=require(_0x6d1f('0x0'));var path=require(_0x6d1f('0x1'));var timeout=require('connect-timeout');var express=require(_0x6d1f('0x2'));var router=express[_0x6d1f('0x3')]();var auth=require(_0x6d1f('0x4'));var interaction=require(_0x6d1f('0x5'));var config=require('../../config/environment');var controller=require(_0x6d1f('0x6'));router[_0x6d1f('0x7')]('/',auth[_0x6d1f('0x8')](),controller[_0x6d1f('0x9')]);router[_0x6d1f('0x7')](_0x6d1f('0xa'),auth[_0x6d1f('0x8')](),controller['describe']);router['get']('/:id',auth['isAuthenticated'](),controller[_0x6d1f('0xb')]);router[_0x6d1f('0x7')](_0x6d1f('0xc'),auth[_0x6d1f('0x8')](),controller[_0x6d1f('0xd')]);router[_0x6d1f('0x7')]('/:id/canned_answers',auth[_0x6d1f('0x8')](),controller[_0x6d1f('0xe')]);router[_0x6d1f('0x7')](_0x6d1f('0xf'),auth[_0x6d1f('0x8')](),controller[_0x6d1f('0x10')]);router[_0x6d1f('0x7')](_0x6d1f('0x11'),auth[_0x6d1f('0x8')](),controller[_0x6d1f('0x12')]);router[_0x6d1f('0x7')](_0x6d1f('0x13'),controller['statusGet']);router[_0x6d1f('0x7')](_0x6d1f('0x14'),auth[_0x6d1f('0x8')](),controller['getAgents']);router[_0x6d1f('0x15')]('/',auth[_0x6d1f('0x8')](),controller[_0x6d1f('0x16')]);router[_0x6d1f('0x15')](_0x6d1f('0xc'),auth['isAuthenticated'](),controller['addDisposition']);router[_0x6d1f('0x15')](_0x6d1f('0x17'),auth[_0x6d1f('0x8')](),controller['addAnswer']);router[_0x6d1f('0x15')](_0x6d1f('0x18'),controller[_0x6d1f('0x19')]);router['post']('/:id/applications',auth[_0x6d1f('0x8')](),controller['addApplications']);router['post']('/:id/send',auth[_0x6d1f('0x8')](),controller[_0x6d1f('0x1a')]);router['post'](_0x6d1f('0x13'),controller[_0x6d1f('0x1b')]);router[_0x6d1f('0x15')](_0x6d1f('0x14'),auth[_0x6d1f('0x8')](),controller[_0x6d1f('0x1c')]);router[_0x6d1f('0x1d')](_0x6d1f('0x1e'),auth[_0x6d1f('0x8')](),controller['update']);router[_0x6d1f('0x1f')](_0x6d1f('0x1e'),auth['isAuthenticated'](),controller[_0x6d1f('0x20')]);router[_0x6d1f('0x1f')](_0x6d1f('0xc'),auth[_0x6d1f('0x8')](),controller['removeDispositions']);router[_0x6d1f('0x1f')]('/:id/canned_answers',auth[_0x6d1f('0x8')](),controller[_0x6d1f('0x21')]);router[_0x6d1f('0x1f')](_0x6d1f('0x14'),auth[_0x6d1f('0x8')](),controller['removeAgents']);module[_0x6d1f('0x22')]=router; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.attributes.js b/server/api/smsAccount/smsAccount.attributes.js index f9ba5ad..e50a49d 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 _0x5b02=['randomstring','exports','STRING','generate','ENUM','twilio','skebby','clicksend','plivo','csc','BOOLEAN','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','sequelize'];(function(_0x29d950,_0x4922b9){var _0x5b14d0=function(_0x43900d){while(--_0x43900d){_0x29d950['push'](_0x29d950['shift']());}};_0x5b14d0(++_0x4922b9);}(_0x5b02,0xe9));var _0x25b0=function(_0x4d02a7,_0x59dee2){_0x4d02a7=_0x4d02a7-0x0;var _0x4d4c79=_0x5b02[_0x4d02a7];return _0x4d4c79;};'use strict';var Sequelize=require(_0x25b0('0x0'));var rs=require(_0x25b0('0x1'));module[_0x25b0('0x2')]={'name':{'type':Sequelize[_0x25b0('0x3')],'unique':'name','allowNull':![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'remote':{'type':Sequelize[_0x25b0('0x3')],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x25b0('0x4')]();}},'phone':{'type':Sequelize[_0x25b0('0x3')]},'type':{'type':Sequelize[_0x25b0('0x5')](_0x25b0('0x6'),_0x25b0('0x7'),'connectel',_0x25b0('0x8'),_0x25b0('0x9'),'clickatell',_0x25b0('0xa'),'infobip','intelepeer')},'accountSid':{'type':Sequelize[_0x25b0('0x3')]},'authId':{'type':Sequelize[_0x25b0('0x3')]},'authToken':{'type':Sequelize[_0x25b0('0x3')]},'smsMethod':{'type':Sequelize['ENUM']('SI','TI','GP')},'username':{'type':Sequelize[_0x25b0('0x3')]},'password':{'type':Sequelize[_0x25b0('0x3')]},'apiKey':{'type':Sequelize[_0x25b0('0x3')]},'senderString':{'type':Sequelize[_0x25b0('0x3')]},'deliveryReport':{'type':Sequelize[_0x25b0('0xb')],'defaultValue':![]},'description':{'type':Sequelize[_0x25b0('0x3')]},'notificationTemplate':{'type':Sequelize[_0x25b0('0xc')],'defaultValue':function(){return _0x25b0('0xd');}},'notificationSound':{'type':Sequelize[_0x25b0('0xb')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x25b0('0xb')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x25b0('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x25b0('0xb')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x25b0('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x25b0('0xb')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x25b0('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0x25b0('0x3')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x25b0('0xe')],'comment':_0x25b0('0xf')},'mandatoryDisposition':{'type':Sequelize[_0x25b0('0xb')],'defaultValue':![],'comment':_0x25b0('0x10'),'set':function(_0x40071c){if(!_0x40071c)this['setDataValue']('mandatoryDispositionPauseId',null);this[_0x25b0('0x11')]('mandatoryDisposition',_0x40071c);}}}; \ No newline at end of file +var _0xa8a8=['twilio','skebby','connectel','clicksend','plivo','clickatell','csc','infobip','intelepeer','BOOLEAN','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','exports','STRING','generate','ENUM'];(function(_0x2fbb8e,_0x39edeb){var _0x556d49=function(_0x34c8bb){while(--_0x34c8bb){_0x2fbb8e['push'](_0x2fbb8e['shift']());}};_0x556d49(++_0x39edeb);}(_0xa8a8,0xec));var _0x8a8a=function(_0x4a6488,_0x28b20a){_0x4a6488=_0x4a6488-0x0;var _0x3b5911=_0xa8a8[_0x4a6488];return _0x3b5911;};'use strict';var Sequelize=require(_0x8a8a('0x0'));var rs=require(_0x8a8a('0x1'));module[_0x8a8a('0x2')]={'name':{'type':Sequelize[_0x8a8a('0x3')],'unique':'name','allowNull':![]},'key':{'type':Sequelize[_0x8a8a('0x3')],'allowNull':![]},'remote':{'type':Sequelize[_0x8a8a('0x3')],'allowNull':![]},'token':{'type':Sequelize[_0x8a8a('0x3')],'defaultValue':function(){return rs[_0x8a8a('0x4')]();}},'phone':{'type':Sequelize[_0x8a8a('0x3')]},'type':{'type':Sequelize[_0x8a8a('0x5')](_0x8a8a('0x6'),_0x8a8a('0x7'),_0x8a8a('0x8'),_0x8a8a('0x9'),_0x8a8a('0xa'),_0x8a8a('0xb'),_0x8a8a('0xc'),_0x8a8a('0xd'),_0x8a8a('0xe'))},'accountSid':{'type':Sequelize['STRING']},'authId':{'type':Sequelize['STRING']},'authToken':{'type':Sequelize[_0x8a8a('0x3')]},'smsMethod':{'type':Sequelize['ENUM']('SI','TI','GP')},'username':{'type':Sequelize[_0x8a8a('0x3')]},'password':{'type':Sequelize[_0x8a8a('0x3')]},'apiKey':{'type':Sequelize['STRING']},'senderString':{'type':Sequelize[_0x8a8a('0x3')]},'deliveryReport':{'type':Sequelize[_0x8a8a('0xf')],'defaultValue':![]},'description':{'type':Sequelize[_0x8a8a('0x3')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x8a8a('0x10');}},'notificationSound':{'type':Sequelize[_0x8a8a('0xf')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x8a8a('0xf')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x8a8a('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x8a8a('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x8a8a('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0x8a8a('0x3')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x8a8a('0x11')],'comment':_0x8a8a('0x12')},'mandatoryDisposition':{'type':Sequelize[_0x8a8a('0xf')],'defaultValue':![],'comment':_0x8a8a('0x13'),'set':function(_0x16d38d){if(!_0x16d38d)this['setDataValue'](_0x8a8a('0x14'),null);this['setDataValue'](_0x8a8a('0x15'),_0x16d38d);}}}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.controller.js b/server/api/smsAccount/smsAccount.controller.js index 74b84dc..0eb7dbf 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 _0xc25f=['keys','query','filters','attributes','intersection','fields','length','nolimit','limit','order','sort','pick','filter','where','map','type','key','VIRTUAL','field','merge','options','findAll','rows','show','params','rawAttributes','include','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','SmsAccountId','Disposition','getDispositions','findOne','removeDispositions','ids','CannedAnswer','getAnswers','hasOwnProperty','includeAll','removeAnswers','SmsApplication','account','applications','Applications','priority','asc','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','mobile','twilio','from','From','Body','MessageSid','skebby','sender','text','connectel','clicksend','messageId','message_id','Text','MessageUUID','infobip','results','originatingAddress','segmentedMessage','clickatell','fromNumber','replyMessageId','intelepeer','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','defaults','CmContact','contact','SmsInteraction','spread','interaction','created','push','close','unmanaged','SmsMessage','ContactId','UserId','User','agent','waitForTheAssignedAgent','*,*,*,*','Start','startRouting','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','entity\x20found','Content-Type','\x0a','addApplications','sequelize','bulkCreate','findAndCountAll','getApplications','getInteractions','Contact','Owner','Tag','Tags','color','tag','to\x20is\x20mandatory','List','Messages','dataValues','log','endpoint\x20/status\x20POST\x20/','skebby_dispatch_id','requestid','statusInt','status_code','groupName','DELIVERED','redif','inspect','error_code','DELIVERED_TO_GATEWAY','ACCEPTD','statusGet','received\x20delivery\x20report\x20from','csc','message-id','state','omit','emit','userSmsAccount:save','removeAgents','isArray','getAgents','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./smsAccount.socket','register','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','info','debug','SmsAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','SmsAccount,\x20%s,\x20%s','result','catch','sendStatus','status','end','json','count','offset','set','apply','reject','save','update','then','destroy','get','SmsAccounts','stack','name','send','Pause','mandatoryDispositionPause','SmsAccount','model'];(function(_0x594e64,_0x106e5f){var _0x4012a2=function(_0x8b9ebb){while(--_0x8b9ebb){_0x594e64['push'](_0x594e64['shift']());}};_0x4012a2(++_0x106e5f);}(_0xc25f,0xa0));var _0xfc25=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xc25f[_0x14add3];return _0x4a174f;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xfc25('0x0'));var jsonpatch=require(_0xfc25('0x1'));var rp=require(_0xfc25('0x2'));var moment=require('moment');var BPromise=require(_0xfc25('0x3'));var Mustache=require(_0xfc25('0x4'));var util=require(_0xfc25('0x5'));var path=require(_0xfc25('0x6'));var sox=require(_0xfc25('0x7'));var csv=require(_0xfc25('0x8'));var ejs=require(_0xfc25('0x9'));var fs=require('fs');var _=require(_0xfc25('0xa'));var squel=require(_0xfc25('0xb'));var crypto=require(_0xfc25('0xc'));var jsforce=require(_0xfc25('0xd'));var deskjs=require(_0xfc25('0xe'));var toCsv=require(_0xfc25('0x8'));var querystring=require(_0xfc25('0xf'));var Papa=require(_0xfc25('0x10'));var Redis=require(_0xfc25('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xfc25('0x12'));var as=require(_0xfc25('0x13'));var hardwareService=require(_0xfc25('0x14'));var logger=require(_0xfc25('0x15'))('api');var utils=require(_0xfc25('0x16'));var config=require(_0xfc25('0x17'));var db=require(_0xfc25('0x18'))['db'];config[_0xfc25('0x19')]=_['defaults'](config['redis'],{'host':_0xfc25('0x1a'),'port':0x18eb});var socket=require(_0xfc25('0x1b'))(new Redis(config['redis']));require(_0xfc25('0x1c'))[_0xfc25('0x1d')](socket);var jayson=require(_0xfc25('0x1e'));var client=jayson[_0xfc25('0x1f')][_0xfc25('0x20')]({'port':0x232c});function checkPasswordPattern(_0x3e1aef,_0x11b982,_0x57ce41){if(_0x57ce41){var _0x4e0515=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4e0515[_0xfc25('0x21')](_0x11b982)){return _0x3e1aef;}else{throw new Error(_0xfc25('0x22'));}}else{return _0x3e1aef;}}function respondWithRpcPromise(_0x3d6c26,_0x40ee34,_0x192f16,_0xcbcc5b){return new BPromise(function(_0x1345d0,_0x2b4bf4){var _0x3e5162=_0xcbcc5b||client;return _0x3e5162[_0xfc25('0x23')](_0x3d6c26,_0x192f16)['then'](function(_0x44a750){logger[_0xfc25('0x24')]('SmsAccount,\x20%s,\x20%s',_0x40ee34,'request\x20sent');logger[_0xfc25('0x25')](_0xfc25('0x26'),_0x40ee34,_0xfc25('0x27'),JSON[_0xfc25('0x28')](_0x44a750));if(_0x44a750[_0xfc25('0x29')]){if(_0x44a750['error'][_0xfc25('0x2a')]===0x1f4){logger['error']('SmsAccount,\x20%s,\x20%s',_0x40ee34,_0x44a750[_0xfc25('0x29')][_0xfc25('0x2b')]);return _0x2b4bf4(_0x44a750[_0xfc25('0x29')][_0xfc25('0x2b')]);}logger[_0xfc25('0x29')](_0xfc25('0x2c'),_0x40ee34,_0x44a750[_0xfc25('0x29')][_0xfc25('0x2b')]);return _0x1345d0(_0x44a750['error'][_0xfc25('0x2b')]);}else{logger['info'](_0xfc25('0x2c'),_0x40ee34,'request\x20sent');_0x1345d0(_0x44a750[_0xfc25('0x2d')][_0xfc25('0x2b')]);}})[_0xfc25('0x2e')](function(_0x35402d){logger[_0xfc25('0x29')](_0xfc25('0x2c'),_0x40ee34,_0x35402d);_0x2b4bf4(_0x35402d);});});}function respondWithStatusCode(_0x3723b9,_0x344a9b){_0x344a9b=_0x344a9b||0xcc;return function(_0x2da7d9){if(_0x2da7d9){return _0x3723b9[_0xfc25('0x2f')](_0x344a9b);}return _0x3723b9[_0xfc25('0x30')](_0x344a9b)[_0xfc25('0x31')]();};}function respondWithResult(_0x81f65f,_0x246c2a){_0x246c2a=_0x246c2a||0xc8;return function(_0x2b419a){if(_0x2b419a){return _0x81f65f['status'](_0x246c2a)[_0xfc25('0x32')](_0x2b419a);}};}function respondWithFilteredResult(_0x3fc52c,_0x550de6){return function(_0x5955b2){if(_0x5955b2){var _0x51e11b=_0x5955b2[_0xfc25('0x33')],_0x4eee4d=_0x550de6['offset'],_0x104aa2=_0x550de6[_0xfc25('0x34')]+_0x550de6['limit'],_0x3da4da;if(_0x104aa2>=_0x51e11b){_0x104aa2=_0x51e11b;_0x3da4da=0xc8;}else{_0x3da4da=0xce;}_0x3fc52c[_0xfc25('0x30')](_0x3da4da);return _0x3fc52c[_0xfc25('0x35')]('Content-Range',_0x4eee4d+'-'+_0x104aa2+'/'+_0x51e11b)[_0xfc25('0x32')](_0x5955b2);}return null;};}function patchUpdates(_0x28eafd){return function(_0x2451fa){try{jsonpatch[_0xfc25('0x36')](_0x2451fa,_0x28eafd,!![]);}catch(_0x49fc12){return BPromise[_0xfc25('0x37')](_0x49fc12);}return _0x2451fa[_0xfc25('0x38')]();};}function saveUpdates(_0x5617e9,_0x488bb3){return function(_0x571b59){if(_0x571b59){return _0x571b59[_0xfc25('0x39')](_0x5617e9)[_0xfc25('0x3a')](function(_0x44c43b){return _0x44c43b;});}return null;};}function removeEntity(_0x26a5a5,_0x364a6d){return function(_0x5f28cf){if(_0x5f28cf){return _0x5f28cf[_0xfc25('0x3b')]()['then'](function(){var _0x400a2c=_0x5f28cf[_0xfc25('0x3c')]({'plain':!![]});var _0x205c7f=_0xfc25('0x3d');return db['UserProfileResource'][_0xfc25('0x3b')]({'where':{'type':_0x205c7f,'resourceId':_0x400a2c['id']}})[_0xfc25('0x3a')](function(){return _0x5f28cf;});})['then'](function(){_0x26a5a5[_0xfc25('0x30')](0xcc)['end']();});}};}function handleEntityNotFound(_0x205768,_0x5dd586){return function(_0x298072){if(!_0x298072){_0x205768['sendStatus'](0x194);}return _0x298072;};}function handleError(_0x1fcde2,_0x1253c0){_0x1253c0=_0x1253c0||0x1f4;return function(_0x47d47e){logger[_0xfc25('0x29')](_0x47d47e[_0xfc25('0x3e')]);if(_0x47d47e[_0xfc25('0x3f')]){delete _0x47d47e[_0xfc25('0x3f')];}_0x1fcde2['status'](_0x1253c0)[_0xfc25('0x40')](_0x47d47e);};}exports['index']=function(_0x4e8b19,_0x19fe9c){var _0x2bb680={'include':[{'model':db[_0xfc25('0x41')],'as':_0xfc25('0x42')}]},_0x5e0e37={},_0x96aa0f={'count':0x0,'rows':[]};var _0x270846=db[_0xfc25('0x43')]['rawAttributes'];_0x5e0e37[_0xfc25('0x44')]=_[_0xfc25('0x45')](_0x270846);_0x5e0e37[_0xfc25('0x46')]=_[_0xfc25('0x45')](_0x4e8b19[_0xfc25('0x46')]);_0x5e0e37[_0xfc25('0x47')]=_['intersection'](_0x5e0e37[_0xfc25('0x44')],_0x5e0e37[_0xfc25('0x46')]);_0x2bb680[_0xfc25('0x48')]=_[_0xfc25('0x49')](_0x5e0e37['model'],qs[_0xfc25('0x4a')](_0x4e8b19[_0xfc25('0x46')][_0xfc25('0x4a')]));_0x2bb680[_0xfc25('0x48')]=_0x2bb680[_0xfc25('0x48')][_0xfc25('0x4b')]?_0x2bb680[_0xfc25('0x48')]:_0x5e0e37['model'];if(!_0x4e8b19[_0xfc25('0x46')]['hasOwnProperty'](_0xfc25('0x4c'))){_0x2bb680[_0xfc25('0x4d')]=qs[_0xfc25('0x4d')](_0x4e8b19['query']['limit']);_0x2bb680[_0xfc25('0x34')]=qs[_0xfc25('0x34')](_0x4e8b19[_0xfc25('0x46')][_0xfc25('0x34')]);}_0x2bb680[_0xfc25('0x4e')]=qs[_0xfc25('0x4f')](_0x4e8b19[_0xfc25('0x46')][_0xfc25('0x4f')]);_0x2bb680['where']=qs['filters'](_[_0xfc25('0x50')](_0x4e8b19['query'],_0x5e0e37['filters']));if(_0x4e8b19[_0xfc25('0x46')][_0xfc25('0x51')]){_0x2bb680['where']=_['merge'](_0x2bb680[_0xfc25('0x52')],{'$or':_[_0xfc25('0x53')](_0x270846,function(_0x1b7ebb){if(_0x1b7ebb[_0xfc25('0x54')][_0xfc25('0x55')]!==_0xfc25('0x56')){var _0x2d79e8={};_0x2d79e8[_0x1b7ebb[_0xfc25('0x57')]]={'$like':'%'+_0x4e8b19['query'][_0xfc25('0x51')]+'%'};return _0x2d79e8;}})});}_0x2bb680=_[_0xfc25('0x58')]({},_0x2bb680,_0x4e8b19[_0xfc25('0x59')]);var _0x2975a8={'where':_0x2bb680[_0xfc25('0x52')]};return db['SmsAccount']['count'](_0x2975a8)[_0xfc25('0x3a')](function(_0x432a50){_0x96aa0f[_0xfc25('0x33')]=_0x432a50;if(_0x4e8b19['query']['includeAll']){_0x2bb680['include']=[{'all':!![]}];}return db[_0xfc25('0x43')][_0xfc25('0x5a')](_0x2bb680);})[_0xfc25('0x3a')](function(_0x553ff3){_0x96aa0f[_0xfc25('0x5b')]=_0x553ff3;return _0x96aa0f;})[_0xfc25('0x3a')](respondWithFilteredResult(_0x19fe9c,_0x2bb680))[_0xfc25('0x2e')](handleError(_0x19fe9c,null));};exports[_0xfc25('0x5c')]=function(_0x343b1f,_0x4d5e81){var _0x5b80ee={'raw':![],'where':{'id':_0x343b1f[_0xfc25('0x5d')]['id']},'include':[{'model':db['Pause'],'as':_0xfc25('0x42')}]},_0x12de52={};_0x12de52[_0xfc25('0x44')]=_[_0xfc25('0x45')](db[_0xfc25('0x43')][_0xfc25('0x5e')]);_0x12de52[_0xfc25('0x46')]=_[_0xfc25('0x45')](_0x343b1f[_0xfc25('0x46')]);_0x12de52[_0xfc25('0x47')]=_[_0xfc25('0x49')](_0x12de52[_0xfc25('0x44')],_0x12de52['query']);_0x5b80ee[_0xfc25('0x48')]=_[_0xfc25('0x49')](_0x12de52['model'],qs[_0xfc25('0x4a')](_0x343b1f[_0xfc25('0x46')][_0xfc25('0x4a')]));_0x5b80ee[_0xfc25('0x48')]=_0x5b80ee[_0xfc25('0x48')]['length']?_0x5b80ee['attributes']:_0x12de52[_0xfc25('0x44')];if(_0x343b1f[_0xfc25('0x46')]['includeAll']){_0x5b80ee[_0xfc25('0x5f')]=[{'all':!![]}];}_0x5b80ee=_[_0xfc25('0x58')]({},_0x5b80ee,_0x343b1f['options']);return db[_0xfc25('0x43')][_0xfc25('0x60')](_0x5b80ee)[_0xfc25('0x3a')](handleEntityNotFound(_0x4d5e81,null))[_0xfc25('0x3a')](respondWithResult(_0x4d5e81,null))[_0xfc25('0x2e')](handleError(_0x4d5e81,null));};exports[_0xfc25('0x61')]=function(_0x597b55,_0x513f7d){return db['SmsAccount'][_0xfc25('0x61')](_0x597b55[_0xfc25('0x62')],{})['then'](function(_0x5ecb5c){var _0x4310fb=_0x597b55['user']['get']({'plain':!![]});if(!_0x4310fb)throw new Error(_0xfc25('0x63'));if(_0x4310fb['role']===_0xfc25('0x64')){var _0x2a8b64=_0x5ecb5c[_0xfc25('0x3c')]({'plain':!![]});var _0x37d723='SmsAccounts';return db[_0xfc25('0x65')][_0xfc25('0x60')]({'where':{'name':_0x37d723,'userProfileId':_0x4310fb['userProfileId']},'raw':!![]})[_0xfc25('0x3a')](function(_0x52455b){if(_0x52455b&&_0x52455b[_0xfc25('0x66')]===0x0){return db[_0xfc25('0x67')]['create']({'name':_0x2a8b64[_0xfc25('0x3f')],'resourceId':_0x2a8b64['id'],'type':_0x52455b[_0xfc25('0x3f')],'sectionId':_0x52455b['id']},{})[_0xfc25('0x3a')](function(){return _0x5ecb5c;});}else{return _0x5ecb5c;}})[_0xfc25('0x2e')](function(_0x5bcd19){logger[_0xfc25('0x29')](_0xfc25('0x68'),_0x5bcd19);throw _0x5bcd19;});}return _0x5ecb5c;})[_0xfc25('0x3a')](respondWithResult(_0x513f7d,0xc9))[_0xfc25('0x2e')](handleError(_0x513f7d,null));};exports[_0xfc25('0x39')]=function(_0x193dad,_0xefe4c6){if(_0x193dad['body']['id']){delete _0x193dad[_0xfc25('0x62')]['id'];}return db[_0xfc25('0x43')][_0xfc25('0x60')]({'where':{'id':_0x193dad['params']['id']},'include':[{'model':db[_0xfc25('0x41')],'as':'mandatoryDispositionPause'}]})[_0xfc25('0x3a')](handleEntityNotFound(_0xefe4c6,null))[_0xfc25('0x3a')](saveUpdates(_0x193dad[_0xfc25('0x62')],null))[_0xfc25('0x3a')](respondWithResult(_0xefe4c6,null))['catch'](handleError(_0xefe4c6,null));};exports['destroy']=function(_0x4c9341,_0x3a4348){return db[_0xfc25('0x43')][_0xfc25('0x60')]({'where':{'id':_0x4c9341[_0xfc25('0x5d')]['id']}})['then'](handleEntityNotFound(_0x3a4348,null))[_0xfc25('0x3a')](removeEntity(_0x3a4348,null))[_0xfc25('0x2e')](handleError(_0x3a4348,null));};exports['describe']=function(_0x5b1b9b,_0x257811){return db[_0xfc25('0x43')][_0xfc25('0x69')]()[_0xfc25('0x3a')](respondWithResult(_0x257811,null))[_0xfc25('0x2e')](handleError(_0x257811,null));};exports[_0xfc25('0x6a')]=function(_0x20fcab,_0x30c078,_0x4b0eaf){if(_0x20fcab[_0xfc25('0x62')]['id']){delete _0x20fcab[_0xfc25('0x62')]['id'];}return db[_0xfc25('0x43')]['find']({'where':{'id':_0x20fcab[_0xfc25('0x5d')]['id']}})[_0xfc25('0x3a')](handleEntityNotFound(_0x30c078,null))[_0xfc25('0x3a')](function(_0xf9274e){if(_0xf9274e){_0x20fcab[_0xfc25('0x62')][_0xfc25('0x6b')]=_0xf9274e['id'];return db[_0xfc25('0x6c')]['create'](_0x20fcab[_0xfc25('0x62')]);}})[_0xfc25('0x3a')](respondWithResult(_0x30c078,null))[_0xfc25('0x2e')](handleError(_0x30c078,null));};exports[_0xfc25('0x6d')]=function(_0x8cc23a,_0x1145d0,_0x51dc58){var _0x304912={'raw':![],'where':{}};var _0x218136={};var _0x5574c9={'count':0x0,'rows':[]};return db[_0xfc25('0x43')][_0xfc25('0x6e')]({'where':{'id':_0x8cc23a[_0xfc25('0x5d')]['id']}})[_0xfc25('0x3a')](handleEntityNotFound(_0x1145d0,null))[_0xfc25('0x3a')](function(_0x4f58e0){if(_0x4f58e0){_0x218136[_0xfc25('0x44')]=_['keys'](db[_0xfc25('0x6c')][_0xfc25('0x5e')]);_0x218136[_0xfc25('0x46')]=_[_0xfc25('0x45')](_0x8cc23a[_0xfc25('0x46')]);_0x218136[_0xfc25('0x47')]=_[_0xfc25('0x49')](_0x218136[_0xfc25('0x44')],_0x218136['query']);_0x304912['attributes']=_[_0xfc25('0x49')](_0x218136[_0xfc25('0x44')],qs[_0xfc25('0x4a')](_0x8cc23a[_0xfc25('0x46')][_0xfc25('0x4a')]));_0x304912['attributes']=_0x304912[_0xfc25('0x48')]['length']?_0x304912[_0xfc25('0x48')]:_0x218136[_0xfc25('0x44')];if(!_0x8cc23a[_0xfc25('0x46')]['hasOwnProperty']('nolimit')){_0x304912[_0xfc25('0x4d')]=qs[_0xfc25('0x4d')](_0x8cc23a[_0xfc25('0x46')][_0xfc25('0x4d')]);_0x304912[_0xfc25('0x34')]=qs[_0xfc25('0x34')](_0x8cc23a[_0xfc25('0x46')]['offset']);}_0x304912[_0xfc25('0x4e')]=qs[_0xfc25('0x4f')](_0x8cc23a[_0xfc25('0x46')][_0xfc25('0x4f')]);_0x304912['where']=qs['filters'](_['pick'](_0x8cc23a[_0xfc25('0x46')],_0x218136[_0xfc25('0x47')]));_0x304912['where'][_0xfc25('0x6b')]=_0x4f58e0['id'];if(_0x8cc23a[_0xfc25('0x46')][_0xfc25('0x51')]){_0x304912[_0xfc25('0x52')]=_[_0xfc25('0x58')](_0x304912[_0xfc25('0x52')],{'$or':_[_0xfc25('0x53')](_0x304912[_0xfc25('0x48')],function(_0x5cbe5c){var _0x3acf64={};_0x3acf64[_0x5cbe5c]={'$like':'%'+_0x8cc23a[_0xfc25('0x46')][_0xfc25('0x51')]+'%'};return _0x3acf64;})});}_0x304912=_[_0xfc25('0x58')]({},_0x304912,_0x8cc23a['options']);return db[_0xfc25('0x6c')][_0xfc25('0x33')]({'where':_0x304912[_0xfc25('0x52')]})[_0xfc25('0x3a')](function(_0x165755){_0x5574c9[_0xfc25('0x33')]=_0x165755;if(_0x8cc23a[_0xfc25('0x46')]['includeAll']){_0x304912[_0xfc25('0x5f')]=[{'all':!![]}];}return db[_0xfc25('0x6c')][_0xfc25('0x5a')](_0x304912);})['then'](function(_0x578bb5){_0x5574c9[_0xfc25('0x5b')]=_0x578bb5;return _0x5574c9;});}})['then'](respondWithFilteredResult(_0x1145d0,_0x304912))[_0xfc25('0x2e')](handleError(_0x1145d0,null));};exports['removeDispositions']=function(_0x575a9e,_0x23f57e,_0x147f84){return db[_0xfc25('0x43')][_0xfc25('0x60')]({'where':{'id':_0x575a9e[_0xfc25('0x5d')]['id']}})[_0xfc25('0x3a')](handleEntityNotFound(_0x23f57e,null))[_0xfc25('0x3a')](function(_0x2a34a3){if(_0x2a34a3){return _0x2a34a3[_0xfc25('0x6f')](_0x575a9e[_0xfc25('0x46')][_0xfc25('0x70')]);}})[_0xfc25('0x3a')](respondWithStatusCode(_0x23f57e,null))['catch'](handleError(_0x23f57e,null));};exports['addAnswer']=function(_0x4df5b7,_0x38f5c8,_0x1a2f14){if(_0x4df5b7['body']['id']){delete _0x4df5b7[_0xfc25('0x62')]['id'];}return db['SmsAccount'][_0xfc25('0x60')]({'where':{'id':_0x4df5b7['params']['id']}})[_0xfc25('0x3a')](handleEntityNotFound(_0x38f5c8,null))[_0xfc25('0x3a')](function(_0xad7266){if(_0xad7266){_0x4df5b7['body']['SmsAccountId']=_0xad7266['id'];return db[_0xfc25('0x71')][_0xfc25('0x61')](_0x4df5b7[_0xfc25('0x62')]);}})[_0xfc25('0x3a')](respondWithResult(_0x38f5c8,null))[_0xfc25('0x2e')](handleError(_0x38f5c8,null));};exports[_0xfc25('0x72')]=function(_0x276dab,_0x360dbb,_0x4fc16c){var _0x154db7={'raw':![],'where':{}};var _0x1bf711={};var _0x59ad39={'count':0x0,'rows':[]};return db[_0xfc25('0x43')][_0xfc25('0x6e')]({'where':{'id':_0x276dab['params']['id']}})[_0xfc25('0x3a')](handleEntityNotFound(_0x360dbb,null))[_0xfc25('0x3a')](function(_0x4d58a9){if(_0x4d58a9){_0x1bf711[_0xfc25('0x44')]=_[_0xfc25('0x45')](db['CannedAnswer'][_0xfc25('0x5e')]);_0x1bf711['query']=_[_0xfc25('0x45')](_0x276dab[_0xfc25('0x46')]);_0x1bf711[_0xfc25('0x47')]=_[_0xfc25('0x49')](_0x1bf711[_0xfc25('0x44')],_0x1bf711[_0xfc25('0x46')]);_0x154db7[_0xfc25('0x48')]=_[_0xfc25('0x49')](_0x1bf711[_0xfc25('0x44')],qs['fields'](_0x276dab[_0xfc25('0x46')][_0xfc25('0x4a')]));_0x154db7[_0xfc25('0x48')]=_0x154db7[_0xfc25('0x48')]['length']?_0x154db7[_0xfc25('0x48')]:_0x1bf711[_0xfc25('0x44')];if(!_0x276dab[_0xfc25('0x46')][_0xfc25('0x73')](_0xfc25('0x4c'))){_0x154db7[_0xfc25('0x4d')]=qs['limit'](_0x276dab[_0xfc25('0x46')][_0xfc25('0x4d')]);_0x154db7['offset']=qs['offset'](_0x276dab[_0xfc25('0x46')][_0xfc25('0x34')]);}_0x154db7['order']=qs['sort'](_0x276dab[_0xfc25('0x46')][_0xfc25('0x4f')]);_0x154db7['where']=qs[_0xfc25('0x47')](_['pick'](_0x276dab[_0xfc25('0x46')],_0x1bf711[_0xfc25('0x47')]));_0x154db7[_0xfc25('0x52')][_0xfc25('0x6b')]=_0x4d58a9['id'];if(_0x276dab['query'][_0xfc25('0x51')]){_0x154db7[_0xfc25('0x52')]=_['merge'](_0x154db7[_0xfc25('0x52')],{'$or':_[_0xfc25('0x53')](_0x154db7[_0xfc25('0x48')],function(_0x560783){var _0x170a1b={};_0x170a1b[_0x560783]={'$like':'%'+_0x276dab['query']['filter']+'%'};return _0x170a1b;})});}_0x154db7=_[_0xfc25('0x58')]({},_0x154db7,_0x276dab['options']);return db[_0xfc25('0x71')][_0xfc25('0x33')]({'where':_0x154db7[_0xfc25('0x52')]})['then'](function(_0x1097d4){_0x59ad39[_0xfc25('0x33')]=_0x1097d4;if(_0x276dab['query'][_0xfc25('0x74')]){_0x154db7[_0xfc25('0x5f')]=[{'all':!![]}];}return db[_0xfc25('0x71')][_0xfc25('0x5a')](_0x154db7);})[_0xfc25('0x3a')](function(_0x11e41a){_0x59ad39['rows']=_0x11e41a;return _0x59ad39;});}})[_0xfc25('0x3a')](respondWithFilteredResult(_0x360dbb,_0x154db7))['catch'](handleError(_0x360dbb,null));};exports[_0xfc25('0x75')]=function(_0xab564d,_0x2c2ebc,_0xce6d22){return db[_0xfc25('0x43')]['find']({'where':{'id':_0xab564d[_0xfc25('0x5d')]['id']}})[_0xfc25('0x3a')](handleEntityNotFound(_0x2c2ebc,null))[_0xfc25('0x3a')](function(_0x4cb9d5){if(_0x4cb9d5){return _0x4cb9d5[_0xfc25('0x75')](_0xab564d[_0xfc25('0x46')]['ids']);}})[_0xfc25('0x3a')](respondWithStatusCode(_0x2c2ebc,null))[_0xfc25('0x2e')](handleError(_0x2c2ebc,null));};exports['notify']=function(_0x1d47de,_0x508d9a,_0x2215bb){var _0x128b51={'channel':'sms'};var _0x46e4e6=[];var _0x58d1e0=[];var _0x2a8430={};return db[_0xfc25('0x43')][_0xfc25('0x60')]({'where':{'id':_0x1d47de['params']['id']},'include':[{'model':db[_0xfc25('0x76')],'as':'Applications'}]})[_0xfc25('0x3a')](handleEntityNotFound(_0x508d9a,null))[_0xfc25('0x3a')](function(_0x61be7c){_0x128b51[_0xfc25('0x77')]=_0x61be7c;_0x128b51[_0xfc25('0x78')]=_['orderBy'](_0x61be7c[_0xfc25('0x79')],[_0xfc25('0x7a')],[_0xfc25('0x7b')]);if(_0x128b51[_0xfc25('0x77')][_0xfc25('0x79')]){delete _0x128b51[_0xfc25('0x77')][_0xfc25('0x79')];}return db['CmContact'][_0xfc25('0x69')]();})[_0xfc25('0x3a')](function(_0x9a3ec4){if(!_0x9a3ec4){throw new db[(_0xfc25('0x7c'))][(_0xfc25('0x7d'))](_0xfc25('0x7e'));}_0x46e4e6=_[_0xfc25('0x7f')](_[_0xfc25('0x45')](_0x9a3ec4),[_0xfc25('0x80'),_0xfc25('0x81')]);_0x58d1e0=_[_0xfc25('0x7f')](_[_0xfc25('0x45')](_0x9a3ec4),['createdAt',_0xfc25('0x81'),_0xfc25('0x82'),_0xfc25('0x83')]);_0x128b51['body']={'mapKey':_0xfc25('0x84')};if(_0x128b51[_0xfc25('0x77')]['type']){switch(_0x128b51['account']['type']){case _0xfc25('0x85'):_0x128b51[_0xfc25('0x62')][_0xfc25('0x86')]=_0x1d47de[_0xfc25('0x62')][_0xfc25('0x87')];_0x128b51[_0xfc25('0x62')][_0xfc25('0x62')]=_0x1d47de[_0xfc25('0x62')][_0xfc25('0x88')];_0x128b51[_0xfc25('0x62')]['messageId']=_0x1d47de[_0xfc25('0x62')][_0xfc25('0x89')];break;case _0xfc25('0x8a'):_0x128b51[_0xfc25('0x62')]['from']='+'+_0x1d47de[_0xfc25('0x62')][_0xfc25('0x8b')];_0x128b51['body'][_0xfc25('0x62')]=_0x1d47de['body'][_0xfc25('0x8c')];break;case _0xfc25('0x8d'):_0x128b51['body']['from']=_0x1d47de[_0xfc25('0x62')][_0xfc25('0x86')];_0x128b51[_0xfc25('0x62')]['body']=_0x1d47de[_0xfc25('0x62')][_0xfc25('0x2b')];break;case _0xfc25('0x8e'):_0x128b51[_0xfc25('0x62')]['from']=_0x1d47de[_0xfc25('0x62')]['from'];_0x128b51[_0xfc25('0x62')][_0xfc25('0x62')]=_0x1d47de['body'][_0xfc25('0x62')];_0x128b51['body'][_0xfc25('0x8f')]=_0x1d47de[_0xfc25('0x62')][_0xfc25('0x90')];break;case'plivo':_0x128b51[_0xfc25('0x62')][_0xfc25('0x86')]=_0x1d47de['body']['From'];_0x128b51['body'][_0xfc25('0x62')]=_0x1d47de[_0xfc25('0x62')][_0xfc25('0x91')];_0x128b51[_0xfc25('0x62')][_0xfc25('0x8f')]=_0x1d47de['body'][_0xfc25('0x92')];break;case _0xfc25('0x93'):_0x128b51['body'][_0xfc25('0x86')]='+'+_0x1d47de['body'][_0xfc25('0x94')][0x0][_0xfc25('0x86')];_0x128b51['body'][_0xfc25('0x62')]=_0x1d47de[_0xfc25('0x62')][_0xfc25('0x94')][0x0][_0xfc25('0x8c')];_0x128b51['body'][_0xfc25('0x8f')]=_0x1d47de[_0xfc25('0x62')][_0xfc25('0x94')][0x0][_0xfc25('0x8f')];break;case'csc':_0x128b51[_0xfc25('0x62')][_0xfc25('0x86')]=_0x1d47de['body'][_0xfc25('0x95')];_0x128b51[_0xfc25('0x62')][_0xfc25('0x62')]=_0x1d47de['body'][_0xfc25('0x96')][_0xfc25('0x2b')];break;case _0xfc25('0x97'):_0x128b51['body']['from']=_0x1d47de[_0xfc25('0x62')][_0xfc25('0x98')];_0x128b51[_0xfc25('0x62')][_0xfc25('0x62')]=_0x1d47de['body'][_0xfc25('0x8c')];_0x128b51[_0xfc25('0x62')][_0xfc25('0x8f')]=_0x1d47de['body'][_0xfc25('0x99')];break;case _0xfc25('0x9a'):_0x128b51[_0xfc25('0x62')]['from']=_0x1d47de[_0xfc25('0x62')][_0xfc25('0x86')];_0x128b51[_0xfc25('0x62')][_0xfc25('0x62')]=_0x1d47de[_0xfc25('0x62')][_0xfc25('0x2b')];_0x128b51[_0xfc25('0x62')][_0xfc25('0x8f')]=_0x1d47de[_0xfc25('0x62')]['refid'];break;}}if(_0x128b51['body']['id']){delete _0x128b51[_0xfc25('0x62')]['id'];}if(_[_0xfc25('0x9b')](_0x128b51[_0xfc25('0x62')][_0xfc25('0x86')])){throw new db['Sequelize']['ValidationError'](_0xfc25('0x9c'));}if(_[_0xfc25('0x9b')](_0x128b51[_0xfc25('0x62')][_0xfc25('0x62')])||_0x128b51[_0xfc25('0x62')][_0xfc25('0x62')]===''){throw new db[(_0xfc25('0x7c'))][(_0xfc25('0x7d'))](_0xfc25('0x9d'));}if(_[_0xfc25('0x9b')](_0x128b51[_0xfc25('0x62')][_0xfc25('0x9e')])){throw new db[(_0xfc25('0x7c'))][(_0xfc25('0x7d'))](_0xfc25('0x9f')+_0x58d1e0);}if(!_[_0xfc25('0xa0')](_0x58d1e0,_0x128b51['body'][_0xfc25('0x9e')])){throw new db[(_0xfc25('0x7c'))]['ValidationError'](_0xfc25('0xa1')+_0x58d1e0);}_0x2a8430[_0x128b51[_0xfc25('0x62')]['mapKey']]=_0x128b51[_0xfc25('0x62')][_0xfc25('0x86')];return db[_0xfc25('0xa2')][_0xfc25('0x60')]({'where':{'id':_0x128b51[_0xfc25('0x77')][_0xfc25('0x83')]},'include':[{'model':db['CmContact'],'as':_0xfc25('0xa3'),'where':_0x2a8430,'limit':0x1,'order':[[_0xfc25('0x81'),_0xfc25('0xa4')]]}]});})[_0xfc25('0x3a')](handleEntityNotFound(_0x508d9a,null))[_0xfc25('0x3a')](function(_0x3c239e){if(_0x3c239e){_0x128b51[_0xfc25('0xa5')]=_['omit'](_0x3c239e,[_0xfc25('0xa3')]);if(_0x3c239e[_0xfc25('0xa3')][_0xfc25('0x4b')]){return _0x3c239e[_0xfc25('0xa3')][0x0];}var _0x48a5c1=_[_0xfc25('0xa6')](_0x128b51[_0xfc25('0x62')],{'firstName':_0x128b51[_0xfc25('0x62')][_0xfc25('0x86')],'ListId':_0x3c239e['id']});_0x48a5c1[_0x128b51[_0xfc25('0x62')][_0xfc25('0x9e')]]=_0x128b51[_0xfc25('0x62')]['from'];return db[_0xfc25('0xa7')]['create'](_0x48a5c1,{'fields':_0x46e4e6,'raw':!![]});}})['then'](handleEntityNotFound(_0x508d9a,null))['then'](function(_0x290d0a){if(_0x290d0a){_0x128b51[_0xfc25('0xa8')]=_0x290d0a;var _0xa4369d={'ContactId':_0x290d0a['id'],'phone':_0x128b51['body'][_0xfc25('0x86')],'SmsAccountId':_0x1d47de['params']['id']};var _0x447e36={'ContactId':_0x290d0a['id'],'SmsAccountId':_0x1d47de[_0xfc25('0x5d')]['id'],'closed':![]};return db[_0xfc25('0xa9')][_0xfc25('0x60')]({'where':_0x447e36})['then'](function(_0x2471c5){if(_0x2471c5){return[_0x2471c5,![]];}return db[_0xfc25('0xa9')][_0xfc25('0x61')](_0xa4369d)[_0xfc25('0x3a')](function(_0x28bf1b){return[_0x28bf1b,!![]];});});}})[_0xfc25('0xaa')](function(_0x5bb069,_0x5956cf){_0x128b51[_0xfc25('0xab')]=_0x5bb069[_0xfc25('0x3c')]({'plain':!![]});_0x128b51[_0xfc25('0xab')][_0xfc25('0xac')]=![];if(_0x5956cf){if(_0x128b51['account']['autoclose']){_0x128b51[_0xfc25('0x78')][_0xfc25('0xad')]({'id':0x0,'priority':_0x128b51[_0xfc25('0x78')][_0xfc25('0x4b')]+0x1,'app':_0xfc25('0xae'),'appdata':_0xfc25('0xaf'),'interval':'*,*,*,*'});}_0x128b51['interaction']['created']=!![];}return db[_0xfc25('0xb0')][_0xfc25('0x61')]({'phone':_0x128b51[_0xfc25('0x62')][_0xfc25('0x86')],'messageId':_0x128b51[_0xfc25('0x62')]['messageId'],'body':_0x128b51[_0xfc25('0x62')][_0xfc25('0x62')],'SmsAccountId':_0x1d47de[_0xfc25('0x5d')]['id'],'SmsInteractionId':_0x5bb069['id'],'direction':'in','ContactId':_0x5bb069[_0xfc25('0xb1')],'AttachmentId':_0x128b51[_0xfc25('0x62')]['AttachmentId']});})[_0xfc25('0x3a')](function(_0xf01dc6){_0x128b51['message']=_0xf01dc6;if(_0x128b51[_0xfc25('0xab')][_0xfc25('0xb2')]){return db[_0xfc25('0xb3')][_0xfc25('0x60')]({'attributes':['id',_0xfc25('0x3f')],'where':{'id':_0x128b51[_0xfc25('0xab')][_0xfc25('0xb2')]}})['then'](function(_0x5df477){if(_0x5df477){_0x128b51[_0xfc25('0x78')]['unshift']({'id':0x0,'priority':0x0,'app':_0xfc25('0xb4'),'appdata':_0x5df477['name']+','+(_0x128b51[_0xfc25('0x77')][_0xfc25('0xb5')]||0xa),'interval':_0xfc25('0xb6')});}return respondWithRpcPromise(_0xfc25('0xb7'),_0xfc25('0xb8'),_0x128b51);});}return respondWithRpcPromise(_0xfc25('0xb7'),'startRouting',_0x128b51);})[_0xfc25('0x3a')](function(_0x37e286){if(_0x37e286){var _0xac752e=0xc8;var _0x4ffe98='receiveMessage';logger[_0xfc25('0x24')](_0xfc25('0x26'),_0x4ffe98,_0xac752e,'entity\x20found');logger[_0xfc25('0x25')](_0xfc25('0xb9'),_0x4ffe98,_0xac752e,_0xfc25('0xba'),JSON[_0xfc25('0x28')](_0x37e286));if(_0x128b51[_0xfc25('0x77')][_0xfc25('0x54')]===_0xfc25('0x85')){return _0x508d9a['status'](_0xac752e)[_0xfc25('0x35')](_0xfc25('0xbb'),'text/xml')[_0xfc25('0x40')](_0xfc25('0xbc'));}else{return _0x508d9a[_0xfc25('0x30')](_0xac752e)[_0xfc25('0x32')](_0x37e286);}}})[_0xfc25('0x2e')](handleError(_0x508d9a,null));};exports[_0xfc25('0xbd')]=function(_0x4f36d2,_0x3c3dbe,_0xb60919){return db['SmsAccount'][_0xfc25('0x6e')]({'where':{'id':_0x4f36d2[_0xfc25('0x5d')]['id']}})[_0xfc25('0x3a')](handleEntityNotFound(_0x3c3dbe,null))[_0xfc25('0x3a')](function(_0x139b4e){if(_0x139b4e){return db[_0xfc25('0xbe')]['transaction'](function(_0x39ffd5){return db[_0xfc25('0x76')][_0xfc25('0x3b')]({'where':{'SmsAccountId':_0x4f36d2[_0xfc25('0x5d')]['id']},'transaction':_0x39ffd5})[_0xfc25('0x3a')](function(_0x466549){var _0x37a8c5=_[_0xfc25('0x53')](_0x4f36d2['body'],function(_0x323c2b){_0x323c2b[_0xfc25('0x6b')]=_0x4f36d2[_0xfc25('0x5d')]['id'];return _0x323c2b;});return db[_0xfc25('0x76')][_0xfc25('0xbf')](_0x37a8c5,{'transaction':_0x39ffd5});});})['then'](function(){return db[_0xfc25('0x76')][_0xfc25('0xc0')]({'where':{'SmsAccountId':_0x4f36d2[_0xfc25('0x5d')]['id']},'order':_0xfc25('0x7a')});});}})[_0xfc25('0x3a')](respondWithResult(_0x3c3dbe,null))[_0xfc25('0x2e')](handleError(_0x3c3dbe,null));};exports[_0xfc25('0xc1')]=function(_0x565e36,_0x5efa91,_0x1e4975){var _0x3159ca={};var _0x2757ad={};var _0x37fc25;var _0x2c4456;return db[_0xfc25('0x43')]['findOne']({'where':{'id':_0x565e36['params']['id']}})[_0xfc25('0x3a')](handleEntityNotFound(_0x5efa91,null))[_0xfc25('0x3a')](function(_0x3d49a2){if(_0x3d49a2){_0x37fc25=_0x3d49a2;_0x2757ad['model']=_[_0xfc25('0x45')](db[_0xfc25('0x76')][_0xfc25('0x5e')]);_0x2757ad['query']=_[_0xfc25('0x45')](_0x565e36[_0xfc25('0x46')]);_0x2757ad[_0xfc25('0x47')]=_['intersection'](_0x2757ad[_0xfc25('0x44')],_0x2757ad[_0xfc25('0x46')]);_0x3159ca[_0xfc25('0x48')]=_[_0xfc25('0x49')](_0x2757ad['model'],qs[_0xfc25('0x4a')](_0x565e36[_0xfc25('0x46')][_0xfc25('0x4a')]));_0x3159ca[_0xfc25('0x48')]=_0x3159ca[_0xfc25('0x48')][_0xfc25('0x4b')]?_0x3159ca[_0xfc25('0x48')]:_0x2757ad[_0xfc25('0x44')];_0x3159ca[_0xfc25('0x4e')]=qs[_0xfc25('0x4f')](_0x565e36[_0xfc25('0x46')][_0xfc25('0x4f')]);_0x3159ca[_0xfc25('0x52')]=qs[_0xfc25('0x47')](_[_0xfc25('0x50')](_0x565e36[_0xfc25('0x46')],_0x2757ad['filters']));if(_0x565e36[_0xfc25('0x46')][_0xfc25('0x51')]){_0x3159ca[_0xfc25('0x52')]=_[_0xfc25('0x58')](_0x3159ca[_0xfc25('0x52')],{'$or':_[_0xfc25('0x53')](_0x3159ca[_0xfc25('0x48')],function(_0x425aad){var _0x42e7d6={};_0x42e7d6[_0x425aad]={'$like':'%'+_0x565e36[_0xfc25('0x46')]['filter']+'%'};return _0x42e7d6;})});}_0x3159ca=_['merge']({},_0x3159ca,_0x565e36[_0xfc25('0x59')]);return _0x37fc25[_0xfc25('0xc1')](_0x3159ca);}})[_0xfc25('0x3a')](function(_0x53f251){if(_0x53f251){_0x2c4456=_0x53f251[_0xfc25('0x4b')];if(!_0x565e36[_0xfc25('0x46')][_0xfc25('0x73')](_0xfc25('0x4c'))){_0x3159ca[_0xfc25('0x4d')]=qs['limit'](_0x565e36[_0xfc25('0x46')][_0xfc25('0x4d')]);_0x3159ca[_0xfc25('0x34')]=qs[_0xfc25('0x34')](_0x565e36['query'][_0xfc25('0x34')]);}return _0x37fc25[_0xfc25('0xc1')](_0x3159ca);}})['then'](function(_0x264800){if(_0x264800){return _0x264800?{'count':_0x2c4456,'rows':_0x264800}:null;}})[_0xfc25('0x3a')](respondWithResult(_0x5efa91,null))[_0xfc25('0x2e')](handleError(_0x5efa91,null));};exports[_0xfc25('0xc2')]=function(_0x5bbb86,_0x22341b,_0x4e3634){var _0x390b8b={'raw':![],'where':{}};var _0x26dabf={};var _0x1436c8={'count':0x0,'rows':[]};return db[_0xfc25('0x43')]['findOne']({'where':{'id':_0x5bbb86[_0xfc25('0x5d')]['id']}})['then'](handleEntityNotFound(_0x22341b,null))['then'](function(_0x4c2d7c){if(_0x4c2d7c){_0x26dabf[_0xfc25('0x44')]=_[_0xfc25('0x45')](db['SmsInteraction'][_0xfc25('0x5e')]);_0x26dabf[_0xfc25('0x46')]=_[_0xfc25('0x45')](_0x5bbb86[_0xfc25('0x46')]);_0x26dabf[_0xfc25('0x47')]=_[_0xfc25('0x49')](_0x26dabf[_0xfc25('0x44')],_0x26dabf[_0xfc25('0x46')]);_0x390b8b[_0xfc25('0x48')]=_[_0xfc25('0x49')](_0x26dabf['model'],qs['fields'](_0x5bbb86[_0xfc25('0x46')][_0xfc25('0x4a')]));_0x390b8b['attributes']=_0x390b8b['attributes'][_0xfc25('0x4b')]?_0x390b8b['attributes']:_0x26dabf[_0xfc25('0x44')];if(!_0x5bbb86['query'][_0xfc25('0x73')]('nolimit')){_0x390b8b[_0xfc25('0x4d')]=qs[_0xfc25('0x4d')](_0x5bbb86['query'][_0xfc25('0x4d')]);_0x390b8b[_0xfc25('0x34')]=qs[_0xfc25('0x34')](_0x5bbb86[_0xfc25('0x46')][_0xfc25('0x34')]);}_0x390b8b[_0xfc25('0x4e')]=qs[_0xfc25('0x4f')](_0x5bbb86['query'][_0xfc25('0x4f')]);_0x390b8b[_0xfc25('0x52')]=qs[_0xfc25('0x47')](_[_0xfc25('0x50')](_0x5bbb86[_0xfc25('0x46')],_0x26dabf[_0xfc25('0x47')]));_0x390b8b[_0xfc25('0x52')][_0xfc25('0x6b')]=_0x4c2d7c['id'];if(_0x5bbb86['query']['filter']){_0x390b8b[_0xfc25('0x52')]=_[_0xfc25('0x58')](_0x390b8b['where'],{'$or':_[_0xfc25('0x53')](_0x390b8b[_0xfc25('0x48')],function(_0x25c2f9){var _0x21afdf={};_0x21afdf[_0x25c2f9]={'$like':'%'+_0x5bbb86[_0xfc25('0x46')][_0xfc25('0x51')]+'%'};return _0x21afdf;})});}_0x390b8b=_[_0xfc25('0x58')]({},_0x390b8b,_0x5bbb86[_0xfc25('0x59')]);return db[_0xfc25('0xa9')][_0xfc25('0x33')]({'where':_0x390b8b[_0xfc25('0x52')]})[_0xfc25('0x3a')](function(_0x6ec0c5){_0x1436c8[_0xfc25('0x33')]=_0x6ec0c5;if(_0x5bbb86[_0xfc25('0x46')][_0xfc25('0x74')]){_0x390b8b['include']=[{'model':db['CmContact'],'as':_0xfc25('0xc3'),'required':![]},{'model':db[_0xfc25('0xb3')],'as':_0xfc25('0xc4'),'attributes':[_0xfc25('0x3f'),'fullname','internal'],'required':![]},{'model':db[_0xfc25('0xc5')],'as':_0xfc25('0xc6'),'attributes':['id',_0xfc25('0x3f'),_0xfc25('0xc7')],'where':_0x5bbb86[_0xfc25('0x46')][_0xfc25('0xc8')]?{'id':_0x5bbb86[_0xfc25('0x46')][_0xfc25('0xc8')]}:undefined,'required':_0x5bbb86[_0xfc25('0x46')][_0xfc25('0xc8')]?!![]:![]}];}return db['SmsInteraction'][_0xfc25('0x5a')](_0x390b8b);})['then'](function(_0x5dc75f){_0x1436c8[_0xfc25('0x5b')]=_0x5dc75f;return _0x1436c8;});}})[_0xfc25('0x3a')](respondWithFilteredResult(_0x22341b,_0x390b8b))[_0xfc25('0x2e')](handleError(_0x22341b,null));};exports['send']=function(_0x3ec4fc,_0x5a1e30,_0x40e66c){var _0x4389af,_0x3dc8b9,_0x223ef9;if(_[_0xfc25('0x9b')](_0x3ec4fc[_0xfc25('0x62')]['body'])||_0x3ec4fc[_0xfc25('0x62')][_0xfc25('0x62')]===''){throw new db[(_0xfc25('0x7c'))][(_0xfc25('0x7d'))](_0xfc25('0x9d'));}if(_['isNil'](_0x3ec4fc[_0xfc25('0x62')]['to'])){throw new db[(_0xfc25('0x7c'))][(_0xfc25('0x7d'))](_0xfc25('0xc9'));}_0x4389af=_0x3ec4fc['body']['to'];return db['SmsAccount'][_0xfc25('0x60')]({'where':{'id':_0x3ec4fc['params']['id']},'include':[{'model':db[_0xfc25('0xa2')],'as':_0xfc25('0xca'),'include':[{'model':db[_0xfc25('0xa7')],'as':_0xfc25('0xa3'),'where':{'mobile':_0x4389af},'limit':0x1,'order':[[_0xfc25('0x81'),_0xfc25('0xa4')]]}]}]})['then'](handleEntityNotFound(_0x5a1e30,null))[_0xfc25('0x3a')](function(_0x43f250){if(_0x43f250&&_0x43f250[_0xfc25('0xca')]){_0x3dc8b9=_0x43f250[_0xfc25('0x3c')]({'plain':!![]});if(_0x3dc8b9[_0xfc25('0xca')]&&_0x3dc8b9[_0xfc25('0xca')][_0xfc25('0xa3')][_0xfc25('0x4b')]){return _0x3dc8b9['List']['Contacts'][0x0];}return db['CmContact'][_0xfc25('0x61')](_[_0xfc25('0xa6')](_0x3ec4fc['body'],{'firstName':_0x4389af,'mobile':_0x4389af,'phone':_0x4389af,'ListId':_0x3dc8b9[_0xfc25('0x83')]}));}})[_0xfc25('0x3a')](handleEntityNotFound(_0x5a1e30,null))[_0xfc25('0x3a')](function(_0x468a05){if(_0x468a05){_0x223ef9=_0x468a05;return db['SmsInteraction'][_0xfc25('0x60')]({'where':{'ContactId':_0x223ef9['id'],'closed':![],'SmsAccountId':_0x3dc8b9['id']}})['then'](function(_0x277ea8){if(_0x277ea8){return[_0x277ea8,![]];}return db[_0xfc25('0xa9')][_0xfc25('0x61')]({'UserId':_0x3ec4fc['user']['id'],'ContactId':_0x223ef9['id'],'SmsAccountId':_0x3dc8b9['id'],'phone':_0x4389af,'firstMsgDirection':'out','Messages':[_['merge'](_0x3ec4fc[_0xfc25('0x62')],{'read':![],'body':_0x3ec4fc[_0xfc25('0x62')][_0xfc25('0x62')],'phone':_0x4389af,'SmsAccountId':_0x3dc8b9['id'],'UserId':_0x3ec4fc['user']['id'],'ContactId':_0x223ef9['id']})]},{'include':[{'model':db['SmsMessage'],'as':_0xfc25('0xcb')}]})[_0xfc25('0x3a')](function(_0x2fae4a){return[_0x2fae4a,!![]];});});}})['spread'](function(_0x1c340c,_0x2fda49){if(_0x2fda49){return _0x1c340c;}return db['SmsMessage']['create'](_[_0xfc25('0x58')](_0x3ec4fc['body'],{'read':![],'body':_0x3ec4fc[_0xfc25('0x62')]['body'],'phone':_0x4389af,'SmsAccountId':_0x3dc8b9['id'],'SmsInteractionId':_0x1c340c['id'],'UserId':_0x3ec4fc['user']['id'],'ContactId':_0x223ef9['id']}))['then'](function(_0x459ec0){_0x1c340c['dataValues'][_0xfc25('0xcb')]=[];_0x1c340c[_0xfc25('0xcc')][_0xfc25('0xcb')][_0xfc25('0xad')](_0x459ec0[_0xfc25('0xcc')]);return _0x1c340c;});})[_0xfc25('0x3a')](respondWithResult(_0x5a1e30,null))[_0xfc25('0x2e')](handleError(_0x5a1e30,null));};exports['status']=function(_0x4c1eed,_0x4f5280,_0x59bd7a){if(_0x4c1eed['body']['id']){delete _0x4c1eed[_0xfc25('0x62')]['id'];}console[_0xfc25('0xcd')](_0xfc25('0xce'),_0x4c1eed[_0xfc25('0x62')]);var _0x325e14,_0xb98296,_0x1f0d12;return db[_0xfc25('0x43')][_0xfc25('0x60')]({'where':{'id':_0x4c1eed[_0xfc25('0x5d')]['id']}})[_0xfc25('0x3a')](handleEntityNotFound(_0x4f5280,null))[_0xfc25('0x3a')](function(_0x2b0c48){if(_0x2b0c48){_0x1f0d12=_0x2b0c48;logger[_0xfc25('0x25')](_0xfc25('0x26'),_0xfc25('0x30'),'received\x20delivery\x20report\x20from',_0x2b0c48['type'],util['inspect'](_0x4c1eed['body'],{'showHidden':![],'depth':null}));switch(_0x2b0c48[_0xfc25('0x54')]){case _0xfc25('0x8a'):if(_0x4c1eed[_0xfc25('0x62')][_0xfc25('0xcf')]&&_0x4c1eed[_0xfc25('0x62')]['status']){_0xb98296=_0x4c1eed[_0xfc25('0x62')][_0xfc25('0x30')];return db['SmsMessage'][_0xfc25('0x60')]({'where':{'messageId':_0x4c1eed['body']['skebby_dispatch_id']}});}break;case _0xfc25('0x8d'):if(_0x4c1eed[_0xfc25('0x62')][_0xfc25('0xd0')]&&_0x4c1eed[_0xfc25('0x62')][_0xfc25('0xd1')]){_0xb98296=_0x4c1eed['body']['statusInt'];return db['SmsMessage'][_0xfc25('0x60')]({'where':{'messageId':_0x4c1eed[_0xfc25('0x62')][_0xfc25('0xd0')]}});}break;case _0xfc25('0x8e'):if(_0x4c1eed['body'][_0xfc25('0x90')]&&_0x4c1eed[_0xfc25('0x62')][_0xfc25('0xd2')]){_0xb98296=_0x4c1eed[_0xfc25('0x62')][_0xfc25('0xd2')];return db[_0xfc25('0xb0')][_0xfc25('0x60')]({'where':{'messageId':_0x4c1eed['body']['message_id']}});}break;case'infobip':var _0x412cd0=_0x4c1eed[_0xfc25('0x62')][_0xfc25('0x94')][0x0];if(_0x412cd0[_0xfc25('0x8f')]&&_0x412cd0[_0xfc25('0x30')][_0xfc25('0xd3')]===_0xfc25('0xd4')){_0xb98296=_0x412cd0[_0xfc25('0x30')]['groupName'];return db[_0xfc25('0xb0')][_0xfc25('0x60')]({'where':{'messageId':_0x412cd0[_0xfc25('0x8f')]}});}break;case'clickatell':if(_0x4c1eed[_0xfc25('0x62')][_0xfc25('0x8f')]&&_0x4c1eed[_0xfc25('0x62')][_0xfc25('0x30')]){_0xb98296=_0x4c1eed[_0xfc25('0x62')][_0xfc25('0x30')];return db[_0xfc25('0xb0')][_0xfc25('0x60')]({'where':{'messageId':_0x4c1eed[_0xfc25('0x62')][_0xfc25('0x8f')]}});}break;case _0xfc25('0x9a'):if(_0x4c1eed[_0xfc25('0x62')][_0xfc25('0xd5')]&&_0x4c1eed[_0xfc25('0x62')][_0xfc25('0x30')]){_0xb98296=_0x4c1eed[_0xfc25('0x62')]['status'];return db['SmsMessage'][_0xfc25('0x60')]({'where':{'messageId':_0x4c1eed['body'][_0xfc25('0xd5')]}});}break;}}})[_0xfc25('0x3a')](handleEntityNotFound(_0x4f5280,null))[_0xfc25('0x3a')](function(_0x38234a){if(_0x38234a){_0x325e14=_0x38234a;switch(_0x1f0d12[_0xfc25('0x54')]){case _0xfc25('0x8a'):if(_0xb98296===_0xfc25('0xd4')){return _0x325e14[_0xfc25('0x39')]({'read':!![]});}else{logger[_0xfc25('0x29')](_0xfc25('0x26'),_0xfc25('0x30'),_0xfc25('0x8a'),util[_0xfc25('0xd6')](_0x4c1eed[_0xfc25('0x62')],{'showHidden':![],'depth':null}));}break;case _0xfc25('0x8d'):if(_0xb98296==='1'){return _0x325e14['update']({'read':!![]});}else{logger[_0xfc25('0x29')](_0xfc25('0x26'),_0xfc25('0x30'),_0xfc25('0x8a'),util['inspect'](_0x4c1eed[_0xfc25('0x62')],{'showHidden':![],'depth':null}));}break;case _0xfc25('0x8e'):if(!_0x4c1eed[_0xfc25('0x62')][_0xfc25('0xd7')]&&_0xb98296>=0xc8&&_0xb98296<=0xce){return _0x325e14[_0xfc25('0x39')]({'read':!![]});}else{logger[_0xfc25('0x29')]('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0xfc25('0x8e'),util['inspect'](_0x4c1eed[_0xfc25('0x62')],{'showHidden':![],'depth':null}));}break;case _0xfc25('0x93'):var _0x4b01b3=_0x4c1eed[_0xfc25('0x62')][_0xfc25('0x94')][0x0];if(_0x4b01b3[_0xfc25('0x30')][_0xfc25('0xd3')]===_0xfc25('0xd4')){return _0x325e14['update']({'read':!![]});}else{logger['error'](_0xfc25('0x26'),'status',_0xfc25('0x93'),util[_0xfc25('0xd6')](_0x4c1eed[_0xfc25('0x62')],{'showHidden':![],'depth':null}));}break;case _0xfc25('0x97'):if(_0xb98296==_0xfc25('0xd8')||_0xb98296=='RECEIVED_BY_RECIPIENT'){return _0x325e14['update']({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0xfc25('0x30'),_0xfc25('0x97'),util[_0xfc25('0xd6')](_0x4c1eed[_0xfc25('0x62')],{'showHidden':![],'depth':null}));}break;case _0xfc25('0x9a'):if(_0xb98296==='DELIVRD'||_0xb98296===_0xfc25('0xd9')){return _0x325e14[_0xfc25('0x39')]({'read':!![]});}else{logger[_0xfc25('0x29')](_0xfc25('0x26'),_0xfc25('0x30'),'intelepeer',util[_0xfc25('0xd6')](_0x4c1eed[_0xfc25('0x62')],{'showHidden':![],'depth':null}));}break;}return _0x325e14;}})[_0xfc25('0x3a')](respondWithResult(_0x4f5280,null))[_0xfc25('0x2e')](handleError(_0x4f5280,null));};exports[_0xfc25('0xda')]=function(_0x5aaef8,_0x5df655,_0x12f9d2){var _0x55a917,_0xca3895,_0xccf701;return db[_0xfc25('0x43')][_0xfc25('0x60')]({'where':{'id':_0x5aaef8[_0xfc25('0x5d')]['id']}})[_0xfc25('0x3a')](handleEntityNotFound(_0x5df655,null))['then'](function(_0x4e3f9c){if(_0x4e3f9c){_0xccf701=_0x4e3f9c;logger[_0xfc25('0x25')](_0xfc25('0x26'),'status',_0xfc25('0xdb'),_0x4e3f9c['type'],util[_0xfc25('0xd6')](_0x5aaef8[_0xfc25('0x46')],{'showHidden':![],'depth':null}));switch(_0x4e3f9c[_0xfc25('0x54')]){case _0xfc25('0xdc'):if(_0x5aaef8[_0xfc25('0x46')][_0xfc25('0xdd')]&&_0x5aaef8[_0xfc25('0x46')][_0xfc25('0xde')]){_0xca3895=_0x5aaef8[_0xfc25('0x46')][_0xfc25('0xde')];return db[_0xfc25('0xb0')][_0xfc25('0x60')]({'where':{'messageId':_0x5aaef8['query'][_0xfc25('0xdd')]}});}break;}}})[_0xfc25('0x3a')](handleEntityNotFound(_0x5df655,null))[_0xfc25('0x3a')](function(_0x3a1583){if(_0x3a1583){_0x55a917=_0x3a1583;switch(_0xccf701[_0xfc25('0x54')]){case _0xfc25('0xdc'):if(_0xca3895==='2'||_0xca3895==='6'){return _0x55a917[_0xfc25('0x39')]({'read':!![]});}else{logger['error'](_0xfc25('0x26'),'status',_0xfc25('0xdc'),util['inspect'](_0x5aaef8[_0xfc25('0x46')],{'showHidden':![],'depth':null}));};break;}return _0x55a917;}})[_0xfc25('0x3a')](respondWithResult(_0x5df655,null))[_0xfc25('0x2e')](handleError(_0x5df655,null));};exports['addAgents']=function(_0x154fe7,_0x1bef4c,_0x2e2fbc){return db[_0xfc25('0x43')]['find']({'where':{'id':_0x154fe7[_0xfc25('0x5d')]['id']}})[_0xfc25('0x3a')](handleEntityNotFound(_0x1bef4c,null))[_0xfc25('0x3a')](function(_0x2b74bf){if(_0x2b74bf){return _0x2b74bf['addAgents'](_0x154fe7[_0xfc25('0x62')]['ids'],_[_0xfc25('0xdf')](_0x154fe7[_0xfc25('0x62')],[_0xfc25('0x70'),'id'])||{})[_0xfc25('0xaa')](function(_0xeb338){for(var _0x5907c1=0x0;_0x5907c1<_0x154fe7[_0xfc25('0x62')]['ids'][_0xfc25('0x4b')];_0x5907c1+=0x1){socket[_0xfc25('0xe0')](_0xfc25('0xe1'),{'UserId':_0x154fe7[_0xfc25('0x62')][_0xfc25('0x70')][_0x5907c1],'SmsAccountId':_0x154fe7[_0xfc25('0x5d')]['id']});}return _0xeb338;});}})[_0xfc25('0x3a')](respondWithResult(_0x1bef4c,null))[_0xfc25('0x2e')](handleError(_0x1bef4c,null));};exports[_0xfc25('0xe2')]=function(_0x473ee6,_0x4f9127,_0x197b2c){return db[_0xfc25('0x43')][_0xfc25('0x60')]({'where':{'id':_0x473ee6['params']['id']}})['then'](handleEntityNotFound(_0x4f9127,null))[_0xfc25('0x3a')](function(_0x14eff0){if(_0x14eff0){return _0x14eff0['removeAgents'](_0x473ee6[_0xfc25('0x46')]['ids'])[_0xfc25('0x3a')](function(){if(_[_0xfc25('0xe3')](_0x473ee6[_0xfc25('0x46')][_0xfc25('0x70')])){for(var _0x3c245e=0x0;_0x3c245e<_0x473ee6[_0xfc25('0x46')]['ids'][_0xfc25('0x4b')];_0x3c245e+=0x1){socket[_0xfc25('0xe0')]('userSmsAccount:remove',{'UserId':Number(_0x473ee6[_0xfc25('0x46')][_0xfc25('0x70')][_0x3c245e]),'SmsAccountId':Number(_0x473ee6[_0xfc25('0x5d')]['id'])});}}else{socket[_0xfc25('0xe0')]('userSmsAccount:remove',{'UserId':Number(_0x473ee6[_0xfc25('0x46')]['ids']),'SmsAccountId':Number(_0x473ee6[_0xfc25('0x5d')]['id'])});}});}})[_0xfc25('0x3a')](respondWithStatusCode(_0x4f9127,null))[_0xfc25('0x2e')](handleError(_0x4f9127,null));};exports[_0xfc25('0xe4')]=function(_0x4f9102,_0x55cb0a,_0x4f5a2a){var _0x57bc28={};var _0x581b33={};var _0x1ba640;var _0x11866d;return db[_0xfc25('0x43')]['findOne']({'where':{'id':_0x4f9102[_0xfc25('0x5d')]['id']}})[_0xfc25('0x3a')](handleEntityNotFound(_0x55cb0a,null))[_0xfc25('0x3a')](function(_0x122d84){if(_0x122d84){_0x1ba640=_0x122d84;_0x581b33['model']=_[_0xfc25('0x45')](db['User']['rawAttributes']);_0x581b33[_0xfc25('0x46')]=_[_0xfc25('0x45')](_0x4f9102['query']);_0x581b33[_0xfc25('0x47')]=_[_0xfc25('0x49')](_0x581b33[_0xfc25('0x44')],_0x581b33[_0xfc25('0x46')]);_0x57bc28[_0xfc25('0x48')]=_['intersection'](_0x581b33[_0xfc25('0x44')],qs[_0xfc25('0x4a')](_0x4f9102[_0xfc25('0x46')][_0xfc25('0x4a')]));_0x57bc28[_0xfc25('0x48')]=_0x57bc28[_0xfc25('0x48')]['length']?_0x57bc28[_0xfc25('0x48')]:_0x581b33[_0xfc25('0x44')];_0x57bc28[_0xfc25('0x4e')]=qs['sort'](_0x4f9102[_0xfc25('0x46')][_0xfc25('0x4f')]);_0x57bc28['where']=qs[_0xfc25('0x47')](_[_0xfc25('0x50')](_0x4f9102['query'],_0x581b33['filters']));if(_0x4f9102[_0xfc25('0x46')][_0xfc25('0x51')]){_0x57bc28[_0xfc25('0x52')]=_[_0xfc25('0x58')](_0x57bc28[_0xfc25('0x52')],{'$or':_[_0xfc25('0x53')](_0x57bc28['attributes'],function(_0x23d593){var _0x1a17d4={};_0x1a17d4[_0x23d593]={'$like':'%'+_0x4f9102[_0xfc25('0x46')]['filter']+'%'};return _0x1a17d4;})});}_0x57bc28=_['merge']({},_0x57bc28,_0x4f9102['options']);return _0x1ba640[_0xfc25('0xe4')](_0x57bc28);}})[_0xfc25('0x3a')](function(_0x3142e0){if(_0x3142e0){_0x11866d=_0x3142e0[_0xfc25('0x4b')];if(!_0x4f9102[_0xfc25('0x46')][_0xfc25('0x73')](_0xfc25('0x4c'))){_0x57bc28[_0xfc25('0x4d')]=qs['limit'](_0x4f9102[_0xfc25('0x46')][_0xfc25('0x4d')]);_0x57bc28[_0xfc25('0x34')]=qs[_0xfc25('0x34')](_0x4f9102[_0xfc25('0x46')][_0xfc25('0x34')]);}return _0x1ba640['getAgents'](_0x57bc28);}})[_0xfc25('0x3a')](function(_0x2723ea){if(_0x2723ea){return _0x2723ea?{'count':_0x11866d,'rows':_0x2723ea}:null;}})['then'](respondWithResult(_0x55cb0a,null))[_0xfc25('0x2e')](handleError(_0x55cb0a,null));}; \ No newline at end of file +var _0x5ef9=['bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','test','then','info','SmsAccount,\x20%s,\x20%s','debug','SmsAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','get','SmsAccounts','stack','name','send','SmsAccount','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','map','type','VIRTUAL','field','includeAll','rows','catch','show','params','Pause','mandatoryDispositionPause','rawAttributes','include','create','body','user','role','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','describe','SmsAccountId','Disposition','getDispositions','hasOwnProperty','options','findAll','removeDispositions','ids','CannedAnswer','getAnswers','findOne','removeAnswers','sms','SmsApplication','Applications','account','applications','priority','asc','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','updatedAt','createdAt','mobile','twilio','from','From','MessageSid','sender','connectel','messageId','message_id','Text','infobip','results','text','csc','originatingAddress','fromNumber','replyMessageId','isNil','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','CmList','Contacts','DESC','list','omit','contact','SmsInteraction','push','close','unmanaged','*,*,*,*','interaction','SmsMessage','AttachmentId','UserId','unshift','agent','waitForTheAssignedAgent','startRouting','Start','receiveMessage','entity\x20found','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','text/xml','\x0a','addApplications','sequelize','transaction','bulkCreate','getApplications','getInteractions','Contact','User','Owner','internal','Tag','Tags','color','tag','body\x20is\x20mandatory\x20and\x20not\x20empty','to\x20is\x20mandatory','List','ListId','out','Messages','spread','dataValues','log','endpoint\x20/status\x20POST\x20/','received\x20delivery\x20report\x20from','skebby_dispatch_id','requestid','statusInt','clicksend','status_code','DELIVERED','groupName','clickatell','redif','skebby','inspect','DELIVERED_TO_GATEWAY','intelepeer','DELIVRD','ACCEPTD','message-id','state','addAgents','emit','userSmsAccount:save','removeAgents','userSmsAccount:remove','getAgents','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise'];(function(_0x1b7368,_0x3286ed){var _0x25d54c=function(_0x2366da){while(--_0x2366da){_0x1b7368['push'](_0x1b7368['shift']());}};_0x25d54c(++_0x3286ed);}(_0x5ef9,0x1b1));var _0x95ef=function(_0x2235bf,_0x3a06a7){_0x2235bf=_0x2235bf-0x0;var _0x4c3a64=_0x5ef9[_0x2235bf];return _0x4c3a64;};'use strict';var pdf=require(_0x95ef('0x0'));var emlformat=require(_0x95ef('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x95ef('0x2'));var jsonpatch=require(_0x95ef('0x3'));var rp=require(_0x95ef('0x4'));var moment=require('moment');var BPromise=require(_0x95ef('0x5'));var Mustache=require(_0x95ef('0x6'));var util=require(_0x95ef('0x7'));var path=require('path');var sox=require(_0x95ef('0x8'));var csv=require(_0x95ef('0x9'));var ejs=require(_0x95ef('0xa'));var fs=require('fs');var _=require(_0x95ef('0xb'));var squel=require(_0x95ef('0xc'));var crypto=require(_0x95ef('0xd'));var jsforce=require(_0x95ef('0xe'));var deskjs=require(_0x95ef('0xf'));var toCsv=require(_0x95ef('0x9'));var querystring=require(_0x95ef('0x10'));var Papa=require('papaparse');var Redis=require(_0x95ef('0x11'));var authService=require(_0x95ef('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x95ef('0x13'));var logger=require(_0x95ef('0x14'))(_0x95ef('0x15'));var utils=require(_0x95ef('0x16'));var config=require('../../config/environment');var db=require(_0x95ef('0x17'))['db'];config[_0x95ef('0x18')]=_[_0x95ef('0x19')](config[_0x95ef('0x18')],{'host':_0x95ef('0x1a'),'port':0x18eb});var socket=require(_0x95ef('0x1b'))(new Redis(config[_0x95ef('0x18')]));require('./smsAccount.socket')[_0x95ef('0x1c')](socket);var jayson=require(_0x95ef('0x1d'));var client=jayson['client']['http']({'port':0x232c});function checkPasswordPattern(_0x3d0f0d,_0x345534,_0x5396bb){if(_0x5396bb){var _0x599324=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x599324[_0x95ef('0x1e')](_0x345534)){return _0x3d0f0d;}else{throw new Error('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x3d0f0d;}}function respondWithRpcPromise(_0x152d22,_0x599fd3,_0x111de8,_0x2570a8){return new BPromise(function(_0x45e48f,_0xb74da5){var _0x4ee702=_0x2570a8||client;return _0x4ee702['request'](_0x152d22,_0x111de8)[_0x95ef('0x1f')](function(_0x54153b){logger[_0x95ef('0x20')](_0x95ef('0x21'),_0x599fd3,'request\x20sent');logger[_0x95ef('0x22')](_0x95ef('0x23'),_0x599fd3,_0x95ef('0x24'),JSON[_0x95ef('0x25')](_0x54153b));if(_0x54153b[_0x95ef('0x26')]){if(_0x54153b[_0x95ef('0x26')][_0x95ef('0x27')]===0x1f4){logger[_0x95ef('0x26')]('SmsAccount,\x20%s,\x20%s',_0x599fd3,_0x54153b[_0x95ef('0x26')][_0x95ef('0x28')]);return _0xb74da5(_0x54153b[_0x95ef('0x26')][_0x95ef('0x28')]);}logger[_0x95ef('0x26')]('SmsAccount,\x20%s,\x20%s',_0x599fd3,_0x54153b[_0x95ef('0x26')][_0x95ef('0x28')]);return _0x45e48f(_0x54153b['error'][_0x95ef('0x28')]);}else{logger[_0x95ef('0x20')](_0x95ef('0x21'),_0x599fd3,_0x95ef('0x24'));_0x45e48f(_0x54153b[_0x95ef('0x29')][_0x95ef('0x28')]);}})['catch'](function(_0x2c064b){logger[_0x95ef('0x26')]('SmsAccount,\x20%s,\x20%s',_0x599fd3,_0x2c064b);_0xb74da5(_0x2c064b);});});}function respondWithStatusCode(_0x1be85b,_0x52ac8b){_0x52ac8b=_0x52ac8b||0xcc;return function(_0x39d004){if(_0x39d004){return _0x1be85b[_0x95ef('0x2a')](_0x52ac8b);}return _0x1be85b[_0x95ef('0x2b')](_0x52ac8b)['end']();};}function respondWithResult(_0x3228d5,_0x572e97){_0x572e97=_0x572e97||0xc8;return function(_0x1052af){if(_0x1052af){return _0x3228d5[_0x95ef('0x2b')](_0x572e97)[_0x95ef('0x2c')](_0x1052af);}};}function respondWithFilteredResult(_0x160199,_0x265dd9){return function(_0x2ae8ba){if(_0x2ae8ba){var _0x1716b6=_0x2ae8ba[_0x95ef('0x2d')],_0x3b7064=_0x265dd9[_0x95ef('0x2e')],_0xa2298e=_0x265dd9[_0x95ef('0x2e')]+_0x265dd9[_0x95ef('0x2f')],_0x14e90d;if(_0xa2298e>=_0x1716b6){_0xa2298e=_0x1716b6;_0x14e90d=0xc8;}else{_0x14e90d=0xce;}_0x160199[_0x95ef('0x2b')](_0x14e90d);return _0x160199[_0x95ef('0x30')](_0x95ef('0x31'),_0x3b7064+'-'+_0xa2298e+'/'+_0x1716b6)[_0x95ef('0x2c')](_0x2ae8ba);}return null;};}function patchUpdates(_0x33a280){return function(_0x1f453c){try{jsonpatch[_0x95ef('0x32')](_0x1f453c,_0x33a280,!![]);}catch(_0x57e830){return BPromise[_0x95ef('0x33')](_0x57e830);}return _0x1f453c[_0x95ef('0x34')]();};}function saveUpdates(_0x20fa5e,_0x100581){return function(_0x82754e){if(_0x82754e){return _0x82754e[_0x95ef('0x35')](_0x20fa5e)[_0x95ef('0x1f')](function(_0x141f4e){return _0x141f4e;});}return null;};}function removeEntity(_0xf864cf,_0x4204a7){return function(_0x43fc39){if(_0x43fc39){return _0x43fc39[_0x95ef('0x36')]()[_0x95ef('0x1f')](function(){var _0x78d6b5=_0x43fc39[_0x95ef('0x37')]({'plain':!![]});var _0x4886c7=_0x95ef('0x38');return db['UserProfileResource'][_0x95ef('0x36')]({'where':{'type':_0x4886c7,'resourceId':_0x78d6b5['id']}})['then'](function(){return _0x43fc39;});})[_0x95ef('0x1f')](function(){_0xf864cf[_0x95ef('0x2b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x26b6cd,_0x1a4441){return function(_0x1d36a6){if(!_0x1d36a6){_0x26b6cd[_0x95ef('0x2a')](0x194);}return _0x1d36a6;};}function handleError(_0x1454c7,_0xc7889e){_0xc7889e=_0xc7889e||0x1f4;return function(_0x4b5cf6){logger[_0x95ef('0x26')](_0x4b5cf6[_0x95ef('0x39')]);if(_0x4b5cf6[_0x95ef('0x3a')]){delete _0x4b5cf6[_0x95ef('0x3a')];}_0x1454c7[_0x95ef('0x2b')](_0xc7889e)[_0x95ef('0x3b')](_0x4b5cf6);};}exports['index']=function(_0x50c6c0,_0x2df408){var _0x6ef0f3={'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x38c818={},_0x3fe1e1={'count':0x0,'rows':[]};var _0x47f2a2=db[_0x95ef('0x3c')]['rawAttributes'];_0x38c818[_0x95ef('0x3d')]=_['keys'](_0x47f2a2);_0x38c818['query']=_[_0x95ef('0x3e')](_0x50c6c0[_0x95ef('0x3f')]);_0x38c818[_0x95ef('0x40')]=_[_0x95ef('0x41')](_0x38c818[_0x95ef('0x3d')],_0x38c818[_0x95ef('0x3f')]);_0x6ef0f3[_0x95ef('0x42')]=_['intersection'](_0x38c818[_0x95ef('0x3d')],qs[_0x95ef('0x43')](_0x50c6c0[_0x95ef('0x3f')][_0x95ef('0x43')]));_0x6ef0f3[_0x95ef('0x42')]=_0x6ef0f3[_0x95ef('0x42')][_0x95ef('0x44')]?_0x6ef0f3['attributes']:_0x38c818[_0x95ef('0x3d')];if(!_0x50c6c0[_0x95ef('0x3f')]['hasOwnProperty'](_0x95ef('0x45'))){_0x6ef0f3[_0x95ef('0x2f')]=qs[_0x95ef('0x2f')](_0x50c6c0[_0x95ef('0x3f')][_0x95ef('0x2f')]);_0x6ef0f3['offset']=qs[_0x95ef('0x2e')](_0x50c6c0[_0x95ef('0x3f')]['offset']);}_0x6ef0f3[_0x95ef('0x46')]=qs['sort'](_0x50c6c0[_0x95ef('0x3f')][_0x95ef('0x47')]);_0x6ef0f3[_0x95ef('0x48')]=qs['filters'](_[_0x95ef('0x49')](_0x50c6c0[_0x95ef('0x3f')],_0x38c818['filters']));if(_0x50c6c0[_0x95ef('0x3f')][_0x95ef('0x4a')]){_0x6ef0f3[_0x95ef('0x48')]=_[_0x95ef('0x4b')](_0x6ef0f3[_0x95ef('0x48')],{'$or':_[_0x95ef('0x4c')](_0x47f2a2,function(_0x165453){if(_0x165453[_0x95ef('0x4d')]['key']!==_0x95ef('0x4e')){var _0x541a28={};_0x541a28[_0x165453[_0x95ef('0x4f')]]={'$like':'%'+_0x50c6c0[_0x95ef('0x3f')][_0x95ef('0x4a')]+'%'};return _0x541a28;}})});}_0x6ef0f3=_[_0x95ef('0x4b')]({},_0x6ef0f3,_0x50c6c0['options']);var _0xc6cb4={'where':_0x6ef0f3['where']};return db[_0x95ef('0x3c')][_0x95ef('0x2d')](_0xc6cb4)[_0x95ef('0x1f')](function(_0x5dfdfa){_0x3fe1e1['count']=_0x5dfdfa;if(_0x50c6c0[_0x95ef('0x3f')][_0x95ef('0x50')]){_0x6ef0f3['include']=[{'all':!![]}];}return db[_0x95ef('0x3c')]['findAll'](_0x6ef0f3);})[_0x95ef('0x1f')](function(_0x36702d){_0x3fe1e1[_0x95ef('0x51')]=_0x36702d;return _0x3fe1e1;})['then'](respondWithFilteredResult(_0x2df408,_0x6ef0f3))[_0x95ef('0x52')](handleError(_0x2df408,null));};exports[_0x95ef('0x53')]=function(_0x4ea228,_0x18a00e){var _0x400797={'raw':![],'where':{'id':_0x4ea228[_0x95ef('0x54')]['id']},'include':[{'model':db[_0x95ef('0x55')],'as':_0x95ef('0x56')}]},_0xc29c43={};_0xc29c43[_0x95ef('0x3d')]=_[_0x95ef('0x3e')](db[_0x95ef('0x3c')][_0x95ef('0x57')]);_0xc29c43[_0x95ef('0x3f')]=_[_0x95ef('0x3e')](_0x4ea228[_0x95ef('0x3f')]);_0xc29c43[_0x95ef('0x40')]=_['intersection'](_0xc29c43['model'],_0xc29c43['query']);_0x400797[_0x95ef('0x42')]=_['intersection'](_0xc29c43[_0x95ef('0x3d')],qs[_0x95ef('0x43')](_0x4ea228[_0x95ef('0x3f')][_0x95ef('0x43')]));_0x400797['attributes']=_0x400797[_0x95ef('0x42')][_0x95ef('0x44')]?_0x400797['attributes']:_0xc29c43['model'];if(_0x4ea228[_0x95ef('0x3f')]['includeAll']){_0x400797[_0x95ef('0x58')]=[{'all':!![]}];}_0x400797=_[_0x95ef('0x4b')]({},_0x400797,_0x4ea228['options']);return db[_0x95ef('0x3c')]['find'](_0x400797)['then'](handleEntityNotFound(_0x18a00e,null))[_0x95ef('0x1f')](respondWithResult(_0x18a00e,null))[_0x95ef('0x52')](handleError(_0x18a00e,null));};exports['create']=function(_0xae5668,_0x3f9c08){return db['SmsAccount'][_0x95ef('0x59')](_0xae5668[_0x95ef('0x5a')],{})[_0x95ef('0x1f')](function(_0x1d9dee){var _0x2b8fa8=_0xae5668[_0x95ef('0x5b')][_0x95ef('0x37')]({'plain':!![]});if(!_0x2b8fa8)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2b8fa8[_0x95ef('0x5c')]==='user'){var _0x59d774=_0x1d9dee[_0x95ef('0x37')]({'plain':!![]});var _0x5dd3e7=_0x95ef('0x38');return db['UserProfileSection']['find']({'where':{'name':_0x5dd3e7,'userProfileId':_0x2b8fa8[_0x95ef('0x5d')]},'raw':!![]})[_0x95ef('0x1f')](function(_0x3baf03){if(_0x3baf03&&_0x3baf03[_0x95ef('0x5e')]===0x0){return db[_0x95ef('0x5f')][_0x95ef('0x59')]({'name':_0x59d774[_0x95ef('0x3a')],'resourceId':_0x59d774['id'],'type':_0x3baf03[_0x95ef('0x3a')],'sectionId':_0x3baf03['id']},{})['then'](function(){return _0x1d9dee;});}else{return _0x1d9dee;}})['catch'](function(_0x4d4056){logger['error'](_0x95ef('0x60'),_0x4d4056);throw _0x4d4056;});}return _0x1d9dee;})[_0x95ef('0x1f')](respondWithResult(_0x3f9c08,0xc9))[_0x95ef('0x52')](handleError(_0x3f9c08,null));};exports[_0x95ef('0x35')]=function(_0xde530,_0x80794a){if(_0xde530['body']['id']){delete _0xde530[_0x95ef('0x5a')]['id'];}return db[_0x95ef('0x3c')][_0x95ef('0x61')]({'where':{'id':_0xde530['params']['id']},'include':[{'model':db[_0x95ef('0x55')],'as':_0x95ef('0x56')}]})[_0x95ef('0x1f')](handleEntityNotFound(_0x80794a,null))[_0x95ef('0x1f')](saveUpdates(_0xde530[_0x95ef('0x5a')],null))['then'](respondWithResult(_0x80794a,null))[_0x95ef('0x52')](handleError(_0x80794a,null));};exports[_0x95ef('0x36')]=function(_0x5d3ce3,_0x1502dd){return db[_0x95ef('0x3c')][_0x95ef('0x61')]({'where':{'id':_0x5d3ce3[_0x95ef('0x54')]['id']}})['then'](handleEntityNotFound(_0x1502dd,null))['then'](removeEntity(_0x1502dd,null))[_0x95ef('0x52')](handleError(_0x1502dd,null));};exports[_0x95ef('0x62')]=function(_0x4ccdd5,_0x94bab6){return db[_0x95ef('0x3c')][_0x95ef('0x62')]()[_0x95ef('0x1f')](respondWithResult(_0x94bab6,null))[_0x95ef('0x52')](handleError(_0x94bab6,null));};exports['addDisposition']=function(_0x56602a,_0xb2786d,_0x2fb3f9){if(_0x56602a[_0x95ef('0x5a')]['id']){delete _0x56602a[_0x95ef('0x5a')]['id'];}return db[_0x95ef('0x3c')][_0x95ef('0x61')]({'where':{'id':_0x56602a[_0x95ef('0x54')]['id']}})[_0x95ef('0x1f')](handleEntityNotFound(_0xb2786d,null))[_0x95ef('0x1f')](function(_0x3e3361){if(_0x3e3361){_0x56602a[_0x95ef('0x5a')][_0x95ef('0x63')]=_0x3e3361['id'];return db[_0x95ef('0x64')][_0x95ef('0x59')](_0x56602a['body']);}})['then'](respondWithResult(_0xb2786d,null))[_0x95ef('0x52')](handleError(_0xb2786d,null));};exports[_0x95ef('0x65')]=function(_0x28cb17,_0x35e6ca,_0x3b70e3){var _0x4e76cf={'raw':![],'where':{}};var _0xf1f2d4={};var _0x13b52b={'count':0x0,'rows':[]};return db[_0x95ef('0x3c')]['findOne']({'where':{'id':_0x28cb17[_0x95ef('0x54')]['id']}})[_0x95ef('0x1f')](handleEntityNotFound(_0x35e6ca,null))[_0x95ef('0x1f')](function(_0x4029e6){if(_0x4029e6){_0xf1f2d4[_0x95ef('0x3d')]=_[_0x95ef('0x3e')](db[_0x95ef('0x64')][_0x95ef('0x57')]);_0xf1f2d4['query']=_[_0x95ef('0x3e')](_0x28cb17['query']);_0xf1f2d4[_0x95ef('0x40')]=_['intersection'](_0xf1f2d4[_0x95ef('0x3d')],_0xf1f2d4['query']);_0x4e76cf['attributes']=_[_0x95ef('0x41')](_0xf1f2d4[_0x95ef('0x3d')],qs[_0x95ef('0x43')](_0x28cb17[_0x95ef('0x3f')][_0x95ef('0x43')]));_0x4e76cf['attributes']=_0x4e76cf[_0x95ef('0x42')]['length']?_0x4e76cf[_0x95ef('0x42')]:_0xf1f2d4[_0x95ef('0x3d')];if(!_0x28cb17[_0x95ef('0x3f')][_0x95ef('0x66')](_0x95ef('0x45'))){_0x4e76cf[_0x95ef('0x2f')]=qs[_0x95ef('0x2f')](_0x28cb17[_0x95ef('0x3f')][_0x95ef('0x2f')]);_0x4e76cf[_0x95ef('0x2e')]=qs[_0x95ef('0x2e')](_0x28cb17[_0x95ef('0x3f')]['offset']);}_0x4e76cf[_0x95ef('0x46')]=qs[_0x95ef('0x47')](_0x28cb17[_0x95ef('0x3f')][_0x95ef('0x47')]);_0x4e76cf['where']=qs['filters'](_[_0x95ef('0x49')](_0x28cb17[_0x95ef('0x3f')],_0xf1f2d4[_0x95ef('0x40')]));_0x4e76cf[_0x95ef('0x48')]['SmsAccountId']=_0x4029e6['id'];if(_0x28cb17[_0x95ef('0x3f')]['filter']){_0x4e76cf[_0x95ef('0x48')]=_[_0x95ef('0x4b')](_0x4e76cf[_0x95ef('0x48')],{'$or':_[_0x95ef('0x4c')](_0x4e76cf[_0x95ef('0x42')],function(_0x129d53){var _0x5eba43={};_0x5eba43[_0x129d53]={'$like':'%'+_0x28cb17[_0x95ef('0x3f')]['filter']+'%'};return _0x5eba43;})});}_0x4e76cf=_[_0x95ef('0x4b')]({},_0x4e76cf,_0x28cb17[_0x95ef('0x67')]);return db[_0x95ef('0x64')][_0x95ef('0x2d')]({'where':_0x4e76cf[_0x95ef('0x48')]})[_0x95ef('0x1f')](function(_0x32ef80){_0x13b52b['count']=_0x32ef80;if(_0x28cb17['query'][_0x95ef('0x50')]){_0x4e76cf['include']=[{'all':!![]}];}return db[_0x95ef('0x64')][_0x95ef('0x68')](_0x4e76cf);})[_0x95ef('0x1f')](function(_0x5a6aa5){_0x13b52b['rows']=_0x5a6aa5;return _0x13b52b;});}})['then'](respondWithFilteredResult(_0x35e6ca,_0x4e76cf))[_0x95ef('0x52')](handleError(_0x35e6ca,null));};exports[_0x95ef('0x69')]=function(_0x187aaf,_0x1d8e9d,_0x21b661){return db[_0x95ef('0x3c')][_0x95ef('0x61')]({'where':{'id':_0x187aaf[_0x95ef('0x54')]['id']}})[_0x95ef('0x1f')](handleEntityNotFound(_0x1d8e9d,null))['then'](function(_0x37d66e){if(_0x37d66e){return _0x37d66e[_0x95ef('0x69')](_0x187aaf['query'][_0x95ef('0x6a')]);}})[_0x95ef('0x1f')](respondWithStatusCode(_0x1d8e9d,null))[_0x95ef('0x52')](handleError(_0x1d8e9d,null));};exports['addAnswer']=function(_0x2993aa,_0x16ae5a,_0xfd9a64){if(_0x2993aa[_0x95ef('0x5a')]['id']){delete _0x2993aa['body']['id'];}return db['SmsAccount'][_0x95ef('0x61')]({'where':{'id':_0x2993aa[_0x95ef('0x54')]['id']}})[_0x95ef('0x1f')](handleEntityNotFound(_0x16ae5a,null))[_0x95ef('0x1f')](function(_0x5219b2){if(_0x5219b2){_0x2993aa['body'][_0x95ef('0x63')]=_0x5219b2['id'];return db[_0x95ef('0x6b')][_0x95ef('0x59')](_0x2993aa['body']);}})[_0x95ef('0x1f')](respondWithResult(_0x16ae5a,null))[_0x95ef('0x52')](handleError(_0x16ae5a,null));};exports[_0x95ef('0x6c')]=function(_0x1cc8c8,_0x192ec8,_0x2d9374){var _0x43e382={'raw':![],'where':{}};var _0x157cdb={};var _0x14fa38={'count':0x0,'rows':[]};return db[_0x95ef('0x3c')][_0x95ef('0x6d')]({'where':{'id':_0x1cc8c8[_0x95ef('0x54')]['id']}})['then'](handleEntityNotFound(_0x192ec8,null))[_0x95ef('0x1f')](function(_0x3edf17){if(_0x3edf17){_0x157cdb[_0x95ef('0x3d')]=_[_0x95ef('0x3e')](db[_0x95ef('0x6b')]['rawAttributes']);_0x157cdb[_0x95ef('0x3f')]=_[_0x95ef('0x3e')](_0x1cc8c8[_0x95ef('0x3f')]);_0x157cdb[_0x95ef('0x40')]=_[_0x95ef('0x41')](_0x157cdb[_0x95ef('0x3d')],_0x157cdb[_0x95ef('0x3f')]);_0x43e382['attributes']=_[_0x95ef('0x41')](_0x157cdb[_0x95ef('0x3d')],qs[_0x95ef('0x43')](_0x1cc8c8['query']['fields']));_0x43e382[_0x95ef('0x42')]=_0x43e382[_0x95ef('0x42')][_0x95ef('0x44')]?_0x43e382[_0x95ef('0x42')]:_0x157cdb[_0x95ef('0x3d')];if(!_0x1cc8c8[_0x95ef('0x3f')][_0x95ef('0x66')]('nolimit')){_0x43e382[_0x95ef('0x2f')]=qs[_0x95ef('0x2f')](_0x1cc8c8[_0x95ef('0x3f')][_0x95ef('0x2f')]);_0x43e382['offset']=qs['offset'](_0x1cc8c8[_0x95ef('0x3f')][_0x95ef('0x2e')]);}_0x43e382[_0x95ef('0x46')]=qs[_0x95ef('0x47')](_0x1cc8c8[_0x95ef('0x3f')][_0x95ef('0x47')]);_0x43e382['where']=qs['filters'](_[_0x95ef('0x49')](_0x1cc8c8[_0x95ef('0x3f')],_0x157cdb[_0x95ef('0x40')]));_0x43e382['where'][_0x95ef('0x63')]=_0x3edf17['id'];if(_0x1cc8c8['query'][_0x95ef('0x4a')]){_0x43e382[_0x95ef('0x48')]=_[_0x95ef('0x4b')](_0x43e382[_0x95ef('0x48')],{'$or':_[_0x95ef('0x4c')](_0x43e382[_0x95ef('0x42')],function(_0x592f2e){var _0x54cd5b={};_0x54cd5b[_0x592f2e]={'$like':'%'+_0x1cc8c8[_0x95ef('0x3f')][_0x95ef('0x4a')]+'%'};return _0x54cd5b;})});}_0x43e382=_[_0x95ef('0x4b')]({},_0x43e382,_0x1cc8c8[_0x95ef('0x67')]);return db[_0x95ef('0x6b')][_0x95ef('0x2d')]({'where':_0x43e382[_0x95ef('0x48')]})[_0x95ef('0x1f')](function(_0x56fac7){_0x14fa38[_0x95ef('0x2d')]=_0x56fac7;if(_0x1cc8c8['query'][_0x95ef('0x50')]){_0x43e382[_0x95ef('0x58')]=[{'all':!![]}];}return db['CannedAnswer'][_0x95ef('0x68')](_0x43e382);})[_0x95ef('0x1f')](function(_0x2b76f1){_0x14fa38[_0x95ef('0x51')]=_0x2b76f1;return _0x14fa38;});}})[_0x95ef('0x1f')](respondWithFilteredResult(_0x192ec8,_0x43e382))['catch'](handleError(_0x192ec8,null));};exports['removeAnswers']=function(_0x24a113,_0x149b1b,_0x4e787b){return db[_0x95ef('0x3c')][_0x95ef('0x61')]({'where':{'id':_0x24a113[_0x95ef('0x54')]['id']}})[_0x95ef('0x1f')](handleEntityNotFound(_0x149b1b,null))[_0x95ef('0x1f')](function(_0x2c1ce6){if(_0x2c1ce6){return _0x2c1ce6[_0x95ef('0x6e')](_0x24a113[_0x95ef('0x3f')][_0x95ef('0x6a')]);}})[_0x95ef('0x1f')](respondWithStatusCode(_0x149b1b,null))['catch'](handleError(_0x149b1b,null));};exports['notify']=function(_0x1738fe,_0x35f7a2,_0x370fc9){var _0x4a2abc={'channel':_0x95ef('0x6f')};var _0x373912=[];var _0x1cb040=[];var _0x4baecb={};return db[_0x95ef('0x3c')][_0x95ef('0x61')]({'where':{'id':_0x1738fe[_0x95ef('0x54')]['id']},'include':[{'model':db[_0x95ef('0x70')],'as':_0x95ef('0x71')}]})['then'](handleEntityNotFound(_0x35f7a2,null))[_0x95ef('0x1f')](function(_0x5a01af){_0x4a2abc[_0x95ef('0x72')]=_0x5a01af;_0x4a2abc[_0x95ef('0x73')]=_['orderBy'](_0x5a01af[_0x95ef('0x71')],[_0x95ef('0x74')],[_0x95ef('0x75')]);if(_0x4a2abc['account'][_0x95ef('0x71')]){delete _0x4a2abc[_0x95ef('0x72')][_0x95ef('0x71')];}return db[_0x95ef('0x76')][_0x95ef('0x62')]();})[_0x95ef('0x1f')](function(_0x42bb24){if(!_0x42bb24){throw new db[(_0x95ef('0x77'))][(_0x95ef('0x78'))](_0x95ef('0x79'));}_0x373912=_[_0x95ef('0x7a')](_[_0x95ef('0x3e')](_0x42bb24),['createdAt',_0x95ef('0x7b')]);_0x1cb040=_[_0x95ef('0x7a')](_[_0x95ef('0x3e')](_0x42bb24),[_0x95ef('0x7c'),_0x95ef('0x7b'),'CompanyId','ListId']);_0x4a2abc[_0x95ef('0x5a')]={'mapKey':_0x95ef('0x7d')};if(_0x4a2abc['account'][_0x95ef('0x4d')]){switch(_0x4a2abc[_0x95ef('0x72')][_0x95ef('0x4d')]){case _0x95ef('0x7e'):_0x4a2abc['body'][_0x95ef('0x7f')]=_0x1738fe[_0x95ef('0x5a')][_0x95ef('0x80')];_0x4a2abc[_0x95ef('0x5a')]['body']=_0x1738fe[_0x95ef('0x5a')]['Body'];_0x4a2abc[_0x95ef('0x5a')]['messageId']=_0x1738fe[_0x95ef('0x5a')][_0x95ef('0x81')];break;case'skebby':_0x4a2abc[_0x95ef('0x5a')]['from']='+'+_0x1738fe[_0x95ef('0x5a')][_0x95ef('0x82')];_0x4a2abc[_0x95ef('0x5a')][_0x95ef('0x5a')]=_0x1738fe['body']['text'];break;case _0x95ef('0x83'):_0x4a2abc[_0x95ef('0x5a')][_0x95ef('0x7f')]=_0x1738fe[_0x95ef('0x5a')][_0x95ef('0x7f')];_0x4a2abc[_0x95ef('0x5a')][_0x95ef('0x5a')]=_0x1738fe[_0x95ef('0x5a')]['message'];break;case'clicksend':_0x4a2abc[_0x95ef('0x5a')][_0x95ef('0x7f')]=_0x1738fe[_0x95ef('0x5a')][_0x95ef('0x7f')];_0x4a2abc[_0x95ef('0x5a')][_0x95ef('0x5a')]=_0x1738fe[_0x95ef('0x5a')][_0x95ef('0x5a')];_0x4a2abc[_0x95ef('0x5a')][_0x95ef('0x84')]=_0x1738fe['body'][_0x95ef('0x85')];break;case'plivo':_0x4a2abc[_0x95ef('0x5a')][_0x95ef('0x7f')]=_0x1738fe[_0x95ef('0x5a')][_0x95ef('0x80')];_0x4a2abc['body'][_0x95ef('0x5a')]=_0x1738fe['body'][_0x95ef('0x86')];_0x4a2abc[_0x95ef('0x5a')][_0x95ef('0x84')]=_0x1738fe[_0x95ef('0x5a')]['MessageUUID'];break;case _0x95ef('0x87'):_0x4a2abc[_0x95ef('0x5a')][_0x95ef('0x7f')]='+'+_0x1738fe[_0x95ef('0x5a')][_0x95ef('0x88')][0x0][_0x95ef('0x7f')];_0x4a2abc['body'][_0x95ef('0x5a')]=_0x1738fe[_0x95ef('0x5a')][_0x95ef('0x88')][0x0][_0x95ef('0x89')];_0x4a2abc['body'][_0x95ef('0x84')]=_0x1738fe['body'][_0x95ef('0x88')][0x0][_0x95ef('0x84')];break;case _0x95ef('0x8a'):_0x4a2abc[_0x95ef('0x5a')][_0x95ef('0x7f')]=_0x1738fe[_0x95ef('0x5a')][_0x95ef('0x8b')];_0x4a2abc[_0x95ef('0x5a')][_0x95ef('0x5a')]=_0x1738fe['body']['segmentedMessage'][_0x95ef('0x28')];break;case'clickatell':_0x4a2abc[_0x95ef('0x5a')][_0x95ef('0x7f')]=_0x1738fe[_0x95ef('0x5a')][_0x95ef('0x8c')];_0x4a2abc[_0x95ef('0x5a')]['body']=_0x1738fe[_0x95ef('0x5a')][_0x95ef('0x89')];_0x4a2abc[_0x95ef('0x5a')][_0x95ef('0x84')]=_0x1738fe[_0x95ef('0x5a')][_0x95ef('0x8d')];break;case'intelepeer':_0x4a2abc[_0x95ef('0x5a')][_0x95ef('0x7f')]=_0x1738fe['body'][_0x95ef('0x7f')];_0x4a2abc[_0x95ef('0x5a')]['body']=_0x1738fe[_0x95ef('0x5a')][_0x95ef('0x28')];_0x4a2abc[_0x95ef('0x5a')]['messageId']=_0x1738fe[_0x95ef('0x5a')]['refid'];break;}}if(_0x4a2abc[_0x95ef('0x5a')]['id']){delete _0x4a2abc[_0x95ef('0x5a')]['id'];}if(_['isNil'](_0x4a2abc[_0x95ef('0x5a')][_0x95ef('0x7f')])){throw new db[(_0x95ef('0x77'))][(_0x95ef('0x78'))]('from\x20is\x20mandatory');}if(_[_0x95ef('0x8e')](_0x4a2abc[_0x95ef('0x5a')][_0x95ef('0x5a')])||_0x4a2abc[_0x95ef('0x5a')][_0x95ef('0x5a')]===''){throw new db[(_0x95ef('0x77'))][(_0x95ef('0x78'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x95ef('0x8e')](_0x4a2abc[_0x95ef('0x5a')][_0x95ef('0x8f')])){throw new db[(_0x95ef('0x77'))][(_0x95ef('0x78'))](_0x95ef('0x90')+_0x1cb040);}if(!_[_0x95ef('0x91')](_0x1cb040,_0x4a2abc[_0x95ef('0x5a')]['mapKey'])){throw new db[(_0x95ef('0x77'))][(_0x95ef('0x78'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x1cb040);}_0x4baecb[_0x4a2abc[_0x95ef('0x5a')][_0x95ef('0x8f')]]=_0x4a2abc['body'][_0x95ef('0x7f')];return db[_0x95ef('0x92')]['find']({'where':{'id':_0x4a2abc[_0x95ef('0x72')]['ListId']},'include':[{'model':db[_0x95ef('0x76')],'as':_0x95ef('0x93'),'where':_0x4baecb,'limit':0x1,'order':[[_0x95ef('0x7b'),_0x95ef('0x94')]]}]});})[_0x95ef('0x1f')](handleEntityNotFound(_0x35f7a2,null))[_0x95ef('0x1f')](function(_0x3bcd54){if(_0x3bcd54){_0x4a2abc[_0x95ef('0x95')]=_[_0x95ef('0x96')](_0x3bcd54,[_0x95ef('0x93')]);if(_0x3bcd54[_0x95ef('0x93')][_0x95ef('0x44')]){return _0x3bcd54['Contacts'][0x0];}var _0x6fb49=_[_0x95ef('0x19')](_0x4a2abc['body'],{'firstName':_0x4a2abc['body'][_0x95ef('0x7f')],'ListId':_0x3bcd54['id']});_0x6fb49[_0x4a2abc[_0x95ef('0x5a')][_0x95ef('0x8f')]]=_0x4a2abc['body'][_0x95ef('0x7f')];return db['CmContact'][_0x95ef('0x59')](_0x6fb49,{'fields':_0x373912,'raw':!![]});}})[_0x95ef('0x1f')](handleEntityNotFound(_0x35f7a2,null))[_0x95ef('0x1f')](function(_0x4cd76b){if(_0x4cd76b){_0x4a2abc[_0x95ef('0x97')]=_0x4cd76b;var _0x30384b={'ContactId':_0x4cd76b['id'],'phone':_0x4a2abc[_0x95ef('0x5a')]['from'],'SmsAccountId':_0x1738fe[_0x95ef('0x54')]['id']};var _0xbc8689={'ContactId':_0x4cd76b['id'],'SmsAccountId':_0x1738fe[_0x95ef('0x54')]['id'],'closed':![]};return db['SmsInteraction'][_0x95ef('0x61')]({'where':_0xbc8689})[_0x95ef('0x1f')](function(_0x4389de){if(_0x4389de){return[_0x4389de,![]];}return db[_0x95ef('0x98')]['create'](_0x30384b)[_0x95ef('0x1f')](function(_0x4ba3f2){return[_0x4ba3f2,!![]];});});}})['spread'](function(_0x1a0727,_0x3a468f){_0x4a2abc['interaction']=_0x1a0727[_0x95ef('0x37')]({'plain':!![]});_0x4a2abc['interaction']['created']=![];if(_0x3a468f){if(_0x4a2abc['account']['autoclose']){_0x4a2abc[_0x95ef('0x73')][_0x95ef('0x99')]({'id':0x0,'priority':_0x4a2abc[_0x95ef('0x73')][_0x95ef('0x44')]+0x1,'app':_0x95ef('0x9a'),'appdata':_0x95ef('0x9b'),'interval':_0x95ef('0x9c')});}_0x4a2abc[_0x95ef('0x9d')]['created']=!![];}return db[_0x95ef('0x9e')][_0x95ef('0x59')]({'phone':_0x4a2abc['body']['from'],'messageId':_0x4a2abc['body'][_0x95ef('0x84')],'body':_0x4a2abc[_0x95ef('0x5a')]['body'],'SmsAccountId':_0x1738fe[_0x95ef('0x54')]['id'],'SmsInteractionId':_0x1a0727['id'],'direction':'in','ContactId':_0x1a0727['ContactId'],'AttachmentId':_0x4a2abc[_0x95ef('0x5a')][_0x95ef('0x9f')]});})[_0x95ef('0x1f')](function(_0x53322b){_0x4a2abc[_0x95ef('0x28')]=_0x53322b;if(_0x4a2abc[_0x95ef('0x9d')][_0x95ef('0xa0')]){return db['User'][_0x95ef('0x61')]({'attributes':['id',_0x95ef('0x3a')],'where':{'id':_0x4a2abc[_0x95ef('0x9d')][_0x95ef('0xa0')]}})['then'](function(_0x39bd6c){if(_0x39bd6c){_0x4a2abc[_0x95ef('0x73')][_0x95ef('0xa1')]({'id':0x0,'priority':0x0,'app':_0x95ef('0xa2'),'appdata':_0x39bd6c[_0x95ef('0x3a')]+','+(_0x4a2abc[_0x95ef('0x72')][_0x95ef('0xa3')]||0xa),'interval':_0x95ef('0x9c')});}return respondWithRpcPromise('Start',_0x95ef('0xa4'),_0x4a2abc);});}return respondWithRpcPromise(_0x95ef('0xa5'),_0x95ef('0xa4'),_0x4a2abc);})['then'](function(_0x136e9b){if(_0x136e9b){var _0x54fd48=0xc8;var _0x241934=_0x95ef('0xa6');logger[_0x95ef('0x20')](_0x95ef('0x23'),_0x241934,_0x54fd48,_0x95ef('0xa7'));logger[_0x95ef('0x22')](_0x95ef('0xa8'),_0x241934,_0x54fd48,_0x95ef('0xa7'),JSON[_0x95ef('0x25')](_0x136e9b));if(_0x4a2abc[_0x95ef('0x72')]['type']===_0x95ef('0x7e')){return _0x35f7a2['status'](_0x54fd48)[_0x95ef('0x30')]('Content-Type',_0x95ef('0xa9'))[_0x95ef('0x3b')](_0x95ef('0xaa'));}else{return _0x35f7a2['status'](_0x54fd48)['json'](_0x136e9b);}}})[_0x95ef('0x52')](handleError(_0x35f7a2,null));};exports[_0x95ef('0xab')]=function(_0x135395,_0x75989d,_0x405f40){return db[_0x95ef('0x3c')][_0x95ef('0x6d')]({'where':{'id':_0x135395['params']['id']}})['then'](handleEntityNotFound(_0x75989d,null))[_0x95ef('0x1f')](function(_0x5dfb98){if(_0x5dfb98){return db[_0x95ef('0xac')][_0x95ef('0xad')](function(_0x13ad96){return db[_0x95ef('0x70')][_0x95ef('0x36')]({'where':{'SmsAccountId':_0x135395['params']['id']},'transaction':_0x13ad96})[_0x95ef('0x1f')](function(_0x30d6ae){var _0x2c09cd=_[_0x95ef('0x4c')](_0x135395[_0x95ef('0x5a')],function(_0x52f846){_0x52f846[_0x95ef('0x63')]=_0x135395[_0x95ef('0x54')]['id'];return _0x52f846;});return db[_0x95ef('0x70')][_0x95ef('0xae')](_0x2c09cd,{'transaction':_0x13ad96});});})[_0x95ef('0x1f')](function(){return db['SmsApplication']['findAndCountAll']({'where':{'SmsAccountId':_0x135395['params']['id']},'order':_0x95ef('0x74')});});}})['then'](respondWithResult(_0x75989d,null))[_0x95ef('0x52')](handleError(_0x75989d,null));};exports[_0x95ef('0xaf')]=function(_0x3cf653,_0x3ec9fd,_0x1a5fb9){var _0x1d8cf5={};var _0x516bdb={};var _0x448aa1;var _0x4201cc;return db[_0x95ef('0x3c')]['findOne']({'where':{'id':_0x3cf653[_0x95ef('0x54')]['id']}})[_0x95ef('0x1f')](handleEntityNotFound(_0x3ec9fd,null))[_0x95ef('0x1f')](function(_0x20c576){if(_0x20c576){_0x448aa1=_0x20c576;_0x516bdb[_0x95ef('0x3d')]=_['keys'](db['SmsApplication'][_0x95ef('0x57')]);_0x516bdb[_0x95ef('0x3f')]=_['keys'](_0x3cf653[_0x95ef('0x3f')]);_0x516bdb[_0x95ef('0x40')]=_['intersection'](_0x516bdb[_0x95ef('0x3d')],_0x516bdb[_0x95ef('0x3f')]);_0x1d8cf5[_0x95ef('0x42')]=_['intersection'](_0x516bdb['model'],qs[_0x95ef('0x43')](_0x3cf653[_0x95ef('0x3f')][_0x95ef('0x43')]));_0x1d8cf5[_0x95ef('0x42')]=_0x1d8cf5['attributes'][_0x95ef('0x44')]?_0x1d8cf5[_0x95ef('0x42')]:_0x516bdb[_0x95ef('0x3d')];_0x1d8cf5['order']=qs[_0x95ef('0x47')](_0x3cf653[_0x95ef('0x3f')][_0x95ef('0x47')]);_0x1d8cf5[_0x95ef('0x48')]=qs[_0x95ef('0x40')](_['pick'](_0x3cf653['query'],_0x516bdb['filters']));if(_0x3cf653[_0x95ef('0x3f')][_0x95ef('0x4a')]){_0x1d8cf5['where']=_[_0x95ef('0x4b')](_0x1d8cf5[_0x95ef('0x48')],{'$or':_[_0x95ef('0x4c')](_0x1d8cf5[_0x95ef('0x42')],function(_0x1c7a8d){var _0xa5d6b6={};_0xa5d6b6[_0x1c7a8d]={'$like':'%'+_0x3cf653['query'][_0x95ef('0x4a')]+'%'};return _0xa5d6b6;})});}_0x1d8cf5=_['merge']({},_0x1d8cf5,_0x3cf653[_0x95ef('0x67')]);return _0x448aa1[_0x95ef('0xaf')](_0x1d8cf5);}})[_0x95ef('0x1f')](function(_0x4b9f0e){if(_0x4b9f0e){_0x4201cc=_0x4b9f0e[_0x95ef('0x44')];if(!_0x3cf653[_0x95ef('0x3f')][_0x95ef('0x66')](_0x95ef('0x45'))){_0x1d8cf5['limit']=qs['limit'](_0x3cf653[_0x95ef('0x3f')][_0x95ef('0x2f')]);_0x1d8cf5[_0x95ef('0x2e')]=qs[_0x95ef('0x2e')](_0x3cf653['query'][_0x95ef('0x2e')]);}return _0x448aa1['getApplications'](_0x1d8cf5);}})['then'](function(_0x1bb711){if(_0x1bb711){return _0x1bb711?{'count':_0x4201cc,'rows':_0x1bb711}:null;}})['then'](respondWithResult(_0x3ec9fd,null))['catch'](handleError(_0x3ec9fd,null));};exports[_0x95ef('0xb0')]=function(_0x3fd1d0,_0x4b7417,_0x4a79d8){var _0x334f1e={'raw':![],'where':{}};var _0x3c0386={};var _0x1d6043={'count':0x0,'rows':[]};return db[_0x95ef('0x3c')][_0x95ef('0x6d')]({'where':{'id':_0x3fd1d0[_0x95ef('0x54')]['id']}})[_0x95ef('0x1f')](handleEntityNotFound(_0x4b7417,null))[_0x95ef('0x1f')](function(_0x1c29e3){if(_0x1c29e3){_0x3c0386[_0x95ef('0x3d')]=_[_0x95ef('0x3e')](db['SmsInteraction'][_0x95ef('0x57')]);_0x3c0386['query']=_[_0x95ef('0x3e')](_0x3fd1d0[_0x95ef('0x3f')]);_0x3c0386[_0x95ef('0x40')]=_[_0x95ef('0x41')](_0x3c0386[_0x95ef('0x3d')],_0x3c0386[_0x95ef('0x3f')]);_0x334f1e[_0x95ef('0x42')]=_['intersection'](_0x3c0386[_0x95ef('0x3d')],qs[_0x95ef('0x43')](_0x3fd1d0[_0x95ef('0x3f')][_0x95ef('0x43')]));_0x334f1e['attributes']=_0x334f1e['attributes'][_0x95ef('0x44')]?_0x334f1e[_0x95ef('0x42')]:_0x3c0386[_0x95ef('0x3d')];if(!_0x3fd1d0[_0x95ef('0x3f')][_0x95ef('0x66')](_0x95ef('0x45'))){_0x334f1e[_0x95ef('0x2f')]=qs[_0x95ef('0x2f')](_0x3fd1d0['query'][_0x95ef('0x2f')]);_0x334f1e[_0x95ef('0x2e')]=qs['offset'](_0x3fd1d0['query'][_0x95ef('0x2e')]);}_0x334f1e[_0x95ef('0x46')]=qs[_0x95ef('0x47')](_0x3fd1d0[_0x95ef('0x3f')][_0x95ef('0x47')]);_0x334f1e['where']=qs[_0x95ef('0x40')](_[_0x95ef('0x49')](_0x3fd1d0[_0x95ef('0x3f')],_0x3c0386[_0x95ef('0x40')]));_0x334f1e[_0x95ef('0x48')][_0x95ef('0x63')]=_0x1c29e3['id'];if(_0x3fd1d0[_0x95ef('0x3f')][_0x95ef('0x4a')]){_0x334f1e['where']=_['merge'](_0x334f1e[_0x95ef('0x48')],{'$or':_['map'](_0x334f1e[_0x95ef('0x42')],function(_0x5310c3){var _0x2c9ce4={};_0x2c9ce4[_0x5310c3]={'$like':'%'+_0x3fd1d0[_0x95ef('0x3f')][_0x95ef('0x4a')]+'%'};return _0x2c9ce4;})});}_0x334f1e=_[_0x95ef('0x4b')]({},_0x334f1e,_0x3fd1d0[_0x95ef('0x67')]);return db['SmsInteraction'][_0x95ef('0x2d')]({'where':_0x334f1e[_0x95ef('0x48')]})[_0x95ef('0x1f')](function(_0x14ced0){_0x1d6043[_0x95ef('0x2d')]=_0x14ced0;if(_0x3fd1d0['query']['includeAll']){_0x334f1e[_0x95ef('0x58')]=[{'model':db[_0x95ef('0x76')],'as':_0x95ef('0xb1'),'required':![]},{'model':db[_0x95ef('0xb2')],'as':_0x95ef('0xb3'),'attributes':[_0x95ef('0x3a'),'fullname',_0x95ef('0xb4')],'required':![]},{'model':db[_0x95ef('0xb5')],'as':_0x95ef('0xb6'),'attributes':['id',_0x95ef('0x3a'),_0x95ef('0xb7')],'where':_0x3fd1d0[_0x95ef('0x3f')][_0x95ef('0xb8')]?{'id':_0x3fd1d0['query'][_0x95ef('0xb8')]}:undefined,'required':_0x3fd1d0[_0x95ef('0x3f')][_0x95ef('0xb8')]?!![]:![]}];}return db[_0x95ef('0x98')]['findAll'](_0x334f1e);})[_0x95ef('0x1f')](function(_0x4c6c7d){_0x1d6043['rows']=_0x4c6c7d;return _0x1d6043;});}})[_0x95ef('0x1f')](respondWithFilteredResult(_0x4b7417,_0x334f1e))[_0x95ef('0x52')](handleError(_0x4b7417,null));};exports['send']=function(_0x51d675,_0x6d2f60,_0xdeec32){var _0x33ad14,_0xa267c2,_0x554e79;if(_[_0x95ef('0x8e')](_0x51d675[_0x95ef('0x5a')]['body'])||_0x51d675[_0x95ef('0x5a')][_0x95ef('0x5a')]===''){throw new db[(_0x95ef('0x77'))][(_0x95ef('0x78'))](_0x95ef('0xb9'));}if(_['isNil'](_0x51d675[_0x95ef('0x5a')]['to'])){throw new db[(_0x95ef('0x77'))][(_0x95ef('0x78'))](_0x95ef('0xba'));}_0x33ad14=_0x51d675['body']['to'];return db[_0x95ef('0x3c')][_0x95ef('0x61')]({'where':{'id':_0x51d675[_0x95ef('0x54')]['id']},'include':[{'model':db[_0x95ef('0x92')],'as':_0x95ef('0xbb'),'include':[{'model':db[_0x95ef('0x76')],'as':'Contacts','where':{'mobile':_0x33ad14},'limit':0x1,'order':[['updatedAt',_0x95ef('0x94')]]}]}]})[_0x95ef('0x1f')](handleEntityNotFound(_0x6d2f60,null))[_0x95ef('0x1f')](function(_0x58d706){if(_0x58d706&&_0x58d706['List']){_0xa267c2=_0x58d706['get']({'plain':!![]});if(_0xa267c2['List']&&_0xa267c2[_0x95ef('0xbb')][_0x95ef('0x93')][_0x95ef('0x44')]){return _0xa267c2[_0x95ef('0xbb')][_0x95ef('0x93')][0x0];}return db[_0x95ef('0x76')]['create'](_[_0x95ef('0x19')](_0x51d675[_0x95ef('0x5a')],{'firstName':_0x33ad14,'mobile':_0x33ad14,'phone':_0x33ad14,'ListId':_0xa267c2[_0x95ef('0xbc')]}));}})[_0x95ef('0x1f')](handleEntityNotFound(_0x6d2f60,null))[_0x95ef('0x1f')](function(_0x314a81){if(_0x314a81){_0x554e79=_0x314a81;return db[_0x95ef('0x98')]['find']({'where':{'ContactId':_0x554e79['id'],'closed':![],'SmsAccountId':_0xa267c2['id']}})['then'](function(_0x31c7d0){if(_0x31c7d0){return[_0x31c7d0,![]];}return db['SmsInteraction'][_0x95ef('0x59')]({'UserId':_0x51d675[_0x95ef('0x5b')]['id'],'ContactId':_0x554e79['id'],'SmsAccountId':_0xa267c2['id'],'phone':_0x33ad14,'firstMsgDirection':_0x95ef('0xbd'),'Messages':[_['merge'](_0x51d675[_0x95ef('0x5a')],{'read':![],'body':_0x51d675[_0x95ef('0x5a')][_0x95ef('0x5a')],'phone':_0x33ad14,'SmsAccountId':_0xa267c2['id'],'UserId':_0x51d675[_0x95ef('0x5b')]['id'],'ContactId':_0x554e79['id']})]},{'include':[{'model':db[_0x95ef('0x9e')],'as':_0x95ef('0xbe')}]})[_0x95ef('0x1f')](function(_0x4686c4){return[_0x4686c4,!![]];});});}})[_0x95ef('0xbf')](function(_0x1be439,_0x10c9ac){if(_0x10c9ac){return _0x1be439;}return db['SmsMessage']['create'](_[_0x95ef('0x4b')](_0x51d675[_0x95ef('0x5a')],{'read':![],'body':_0x51d675[_0x95ef('0x5a')][_0x95ef('0x5a')],'phone':_0x33ad14,'SmsAccountId':_0xa267c2['id'],'SmsInteractionId':_0x1be439['id'],'UserId':_0x51d675[_0x95ef('0x5b')]['id'],'ContactId':_0x554e79['id']}))['then'](function(_0x476c52){_0x1be439[_0x95ef('0xc0')][_0x95ef('0xbe')]=[];_0x1be439[_0x95ef('0xc0')][_0x95ef('0xbe')][_0x95ef('0x99')](_0x476c52['dataValues']);return _0x1be439;});})[_0x95ef('0x1f')](respondWithResult(_0x6d2f60,null))[_0x95ef('0x52')](handleError(_0x6d2f60,null));};exports[_0x95ef('0x2b')]=function(_0xf7cbd4,_0x2fb766,_0x3e6d7b){if(_0xf7cbd4[_0x95ef('0x5a')]['id']){delete _0xf7cbd4[_0x95ef('0x5a')]['id'];}console[_0x95ef('0xc1')](_0x95ef('0xc2'),_0xf7cbd4[_0x95ef('0x5a')]);var _0x5bfef8,_0x54bf72,_0x44425d;return db['SmsAccount'][_0x95ef('0x61')]({'where':{'id':_0xf7cbd4['params']['id']}})[_0x95ef('0x1f')](handleEntityNotFound(_0x2fb766,null))[_0x95ef('0x1f')](function(_0x1e35aa){if(_0x1e35aa){_0x44425d=_0x1e35aa;logger['debug'](_0x95ef('0x23'),_0x95ef('0x2b'),_0x95ef('0xc3'),_0x1e35aa[_0x95ef('0x4d')],util['inspect'](_0xf7cbd4[_0x95ef('0x5a')],{'showHidden':![],'depth':null}));switch(_0x1e35aa[_0x95ef('0x4d')]){case'skebby':if(_0xf7cbd4[_0x95ef('0x5a')][_0x95ef('0xc4')]&&_0xf7cbd4[_0x95ef('0x5a')][_0x95ef('0x2b')]){_0x54bf72=_0xf7cbd4[_0x95ef('0x5a')][_0x95ef('0x2b')];return db[_0x95ef('0x9e')][_0x95ef('0x61')]({'where':{'messageId':_0xf7cbd4[_0x95ef('0x5a')][_0x95ef('0xc4')]}});}break;case'connectel':if(_0xf7cbd4[_0x95ef('0x5a')][_0x95ef('0xc5')]&&_0xf7cbd4['body']['statusInt']){_0x54bf72=_0xf7cbd4[_0x95ef('0x5a')][_0x95ef('0xc6')];return db[_0x95ef('0x9e')]['find']({'where':{'messageId':_0xf7cbd4[_0x95ef('0x5a')]['requestid']}});}break;case _0x95ef('0xc7'):if(_0xf7cbd4[_0x95ef('0x5a')][_0x95ef('0x85')]&&_0xf7cbd4[_0x95ef('0x5a')][_0x95ef('0xc8')]){_0x54bf72=_0xf7cbd4[_0x95ef('0x5a')][_0x95ef('0xc8')];return db[_0x95ef('0x9e')][_0x95ef('0x61')]({'where':{'messageId':_0xf7cbd4['body'][_0x95ef('0x85')]}});}break;case'infobip':var _0xbac069=_0xf7cbd4[_0x95ef('0x5a')]['results'][0x0];if(_0xbac069['messageId']&&_0xbac069[_0x95ef('0x2b')]['groupName']===_0x95ef('0xc9')){_0x54bf72=_0xbac069[_0x95ef('0x2b')][_0x95ef('0xca')];return db[_0x95ef('0x9e')][_0x95ef('0x61')]({'where':{'messageId':_0xbac069[_0x95ef('0x84')]}});}break;case _0x95ef('0xcb'):if(_0xf7cbd4[_0x95ef('0x5a')][_0x95ef('0x84')]&&_0xf7cbd4[_0x95ef('0x5a')]['status']){_0x54bf72=_0xf7cbd4['body'][_0x95ef('0x2b')];return db[_0x95ef('0x9e')][_0x95ef('0x61')]({'where':{'messageId':_0xf7cbd4[_0x95ef('0x5a')][_0x95ef('0x84')]}});}break;case'intelepeer':if(_0xf7cbd4[_0x95ef('0x5a')][_0x95ef('0xcc')]&&_0xf7cbd4[_0x95ef('0x5a')]['status']){_0x54bf72=_0xf7cbd4[_0x95ef('0x5a')][_0x95ef('0x2b')];return db[_0x95ef('0x9e')]['find']({'where':{'messageId':_0xf7cbd4[_0x95ef('0x5a')][_0x95ef('0xcc')]}});}break;}}})['then'](handleEntityNotFound(_0x2fb766,null))[_0x95ef('0x1f')](function(_0x3282f6){if(_0x3282f6){_0x5bfef8=_0x3282f6;switch(_0x44425d['type']){case _0x95ef('0xcd'):if(_0x54bf72===_0x95ef('0xc9')){return _0x5bfef8[_0x95ef('0x35')]({'read':!![]});}else{logger[_0x95ef('0x26')](_0x95ef('0x23'),'status','skebby',util[_0x95ef('0xce')](_0xf7cbd4[_0x95ef('0x5a')],{'showHidden':![],'depth':null}));}break;case _0x95ef('0x83'):if(_0x54bf72==='1'){return _0x5bfef8[_0x95ef('0x35')]({'read':!![]});}else{logger['error'](_0x95ef('0x23'),_0x95ef('0x2b'),_0x95ef('0xcd'),util['inspect'](_0xf7cbd4[_0x95ef('0x5a')],{'showHidden':![],'depth':null}));}break;case'clicksend':if(!_0xf7cbd4[_0x95ef('0x5a')]['error_code']&&_0x54bf72>=0xc8&&_0x54bf72<=0xce){return _0x5bfef8['update']({'read':!![]});}else{logger['error'](_0x95ef('0x23'),'status',_0x95ef('0xc7'),util[_0x95ef('0xce')](_0xf7cbd4[_0x95ef('0x5a')],{'showHidden':![],'depth':null}));}break;case _0x95ef('0x87'):var _0x4ee815=_0xf7cbd4[_0x95ef('0x5a')]['results'][0x0];if(_0x4ee815[_0x95ef('0x2b')][_0x95ef('0xca')]===_0x95ef('0xc9')){return _0x5bfef8[_0x95ef('0x35')]({'read':!![]});}else{logger[_0x95ef('0x26')](_0x95ef('0x23'),_0x95ef('0x2b'),_0x95ef('0x87'),util['inspect'](_0xf7cbd4[_0x95ef('0x5a')],{'showHidden':![],'depth':null}));}break;case _0x95ef('0xcb'):if(_0x54bf72==_0x95ef('0xcf')||_0x54bf72=='RECEIVED_BY_RECIPIENT'){return _0x5bfef8['update']({'read':!![]});}else{logger['error'](_0x95ef('0x23'),_0x95ef('0x2b'),'clickatell',util['inspect'](_0xf7cbd4[_0x95ef('0x5a')],{'showHidden':![],'depth':null}));}break;case _0x95ef('0xd0'):if(_0x54bf72===_0x95ef('0xd1')||_0x54bf72===_0x95ef('0xd2')){return _0x5bfef8[_0x95ef('0x35')]({'read':!![]});}else{logger[_0x95ef('0x26')](_0x95ef('0x23'),_0x95ef('0x2b'),_0x95ef('0xd0'),util['inspect'](_0xf7cbd4[_0x95ef('0x5a')],{'showHidden':![],'depth':null}));}break;}return _0x5bfef8;}})[_0x95ef('0x1f')](respondWithResult(_0x2fb766,null))[_0x95ef('0x52')](handleError(_0x2fb766,null));};exports['statusGet']=function(_0x285c06,_0x2fb9b6,_0x4f3c00){var _0x530eff,_0x39ffda,_0x2ada7c;return db[_0x95ef('0x3c')][_0x95ef('0x61')]({'where':{'id':_0x285c06[_0x95ef('0x54')]['id']}})[_0x95ef('0x1f')](handleEntityNotFound(_0x2fb9b6,null))[_0x95ef('0x1f')](function(_0x53cb04){if(_0x53cb04){_0x2ada7c=_0x53cb04;logger[_0x95ef('0x22')](_0x95ef('0x23'),_0x95ef('0x2b'),_0x95ef('0xc3'),_0x53cb04[_0x95ef('0x4d')],util[_0x95ef('0xce')](_0x285c06[_0x95ef('0x3f')],{'showHidden':![],'depth':null}));switch(_0x53cb04[_0x95ef('0x4d')]){case'csc':if(_0x285c06[_0x95ef('0x3f')][_0x95ef('0xd3')]&&_0x285c06[_0x95ef('0x3f')][_0x95ef('0xd4')]){_0x39ffda=_0x285c06[_0x95ef('0x3f')][_0x95ef('0xd4')];return db[_0x95ef('0x9e')][_0x95ef('0x61')]({'where':{'messageId':_0x285c06['query'][_0x95ef('0xd3')]}});}break;}}})[_0x95ef('0x1f')](handleEntityNotFound(_0x2fb9b6,null))['then'](function(_0x3c6adb){if(_0x3c6adb){_0x530eff=_0x3c6adb;switch(_0x2ada7c[_0x95ef('0x4d')]){case _0x95ef('0x8a'):if(_0x39ffda==='2'||_0x39ffda==='6'){return _0x530eff[_0x95ef('0x35')]({'read':!![]});}else{logger[_0x95ef('0x26')](_0x95ef('0x23'),_0x95ef('0x2b'),_0x95ef('0x8a'),util[_0x95ef('0xce')](_0x285c06[_0x95ef('0x3f')],{'showHidden':![],'depth':null}));};break;}return _0x530eff;}})[_0x95ef('0x1f')](respondWithResult(_0x2fb9b6,null))[_0x95ef('0x52')](handleError(_0x2fb9b6,null));};exports[_0x95ef('0xd5')]=function(_0x176c47,_0x553845,_0x43c76f){return db[_0x95ef('0x3c')][_0x95ef('0x61')]({'where':{'id':_0x176c47[_0x95ef('0x54')]['id']}})[_0x95ef('0x1f')](handleEntityNotFound(_0x553845,null))[_0x95ef('0x1f')](function(_0x15a360){if(_0x15a360){return _0x15a360[_0x95ef('0xd5')](_0x176c47[_0x95ef('0x5a')][_0x95ef('0x6a')],_[_0x95ef('0x96')](_0x176c47[_0x95ef('0x5a')],[_0x95ef('0x6a'),'id'])||{})[_0x95ef('0xbf')](function(_0x465488){for(var _0x6ebea0=0x0;_0x6ebea0<_0x176c47[_0x95ef('0x5a')][_0x95ef('0x6a')][_0x95ef('0x44')];_0x6ebea0+=0x1){socket[_0x95ef('0xd6')](_0x95ef('0xd7'),{'UserId':_0x176c47[_0x95ef('0x5a')][_0x95ef('0x6a')][_0x6ebea0],'SmsAccountId':_0x176c47[_0x95ef('0x54')]['id']});}return _0x465488;});}})[_0x95ef('0x1f')](respondWithResult(_0x553845,null))[_0x95ef('0x52')](handleError(_0x553845,null));};exports[_0x95ef('0xd8')]=function(_0xac7707,_0x2d06fb,_0x1859b7){return db[_0x95ef('0x3c')][_0x95ef('0x61')]({'where':{'id':_0xac7707[_0x95ef('0x54')]['id']}})[_0x95ef('0x1f')](handleEntityNotFound(_0x2d06fb,null))['then'](function(_0x1bfba6){if(_0x1bfba6){return _0x1bfba6[_0x95ef('0xd8')](_0xac7707[_0x95ef('0x3f')]['ids'])[_0x95ef('0x1f')](function(){if(_['isArray'](_0xac7707[_0x95ef('0x3f')]['ids'])){for(var _0x5d2f92=0x0;_0x5d2f92<_0xac7707[_0x95ef('0x3f')][_0x95ef('0x6a')][_0x95ef('0x44')];_0x5d2f92+=0x1){socket['emit'](_0x95ef('0xd9'),{'UserId':Number(_0xac7707[_0x95ef('0x3f')][_0x95ef('0x6a')][_0x5d2f92]),'SmsAccountId':Number(_0xac7707['params']['id'])});}}else{socket[_0x95ef('0xd6')](_0x95ef('0xd9'),{'UserId':Number(_0xac7707[_0x95ef('0x3f')]['ids']),'SmsAccountId':Number(_0xac7707['params']['id'])});}});}})['then'](respondWithStatusCode(_0x2d06fb,null))[_0x95ef('0x52')](handleError(_0x2d06fb,null));};exports[_0x95ef('0xda')]=function(_0x2c1794,_0x428385,_0x41c193){var _0x959b1c={};var _0x5901d4={};var _0x45febf;var _0x53c2d7;return db[_0x95ef('0x3c')][_0x95ef('0x6d')]({'where':{'id':_0x2c1794[_0x95ef('0x54')]['id']}})['then'](handleEntityNotFound(_0x428385,null))[_0x95ef('0x1f')](function(_0x2c973b){if(_0x2c973b){_0x45febf=_0x2c973b;_0x5901d4[_0x95ef('0x3d')]=_[_0x95ef('0x3e')](db[_0x95ef('0xb2')]['rawAttributes']);_0x5901d4[_0x95ef('0x3f')]=_['keys'](_0x2c1794[_0x95ef('0x3f')]);_0x5901d4[_0x95ef('0x40')]=_[_0x95ef('0x41')](_0x5901d4[_0x95ef('0x3d')],_0x5901d4[_0x95ef('0x3f')]);_0x959b1c[_0x95ef('0x42')]=_[_0x95ef('0x41')](_0x5901d4['model'],qs[_0x95ef('0x43')](_0x2c1794[_0x95ef('0x3f')][_0x95ef('0x43')]));_0x959b1c[_0x95ef('0x42')]=_0x959b1c[_0x95ef('0x42')][_0x95ef('0x44')]?_0x959b1c[_0x95ef('0x42')]:_0x5901d4[_0x95ef('0x3d')];_0x959b1c[_0x95ef('0x46')]=qs[_0x95ef('0x47')](_0x2c1794[_0x95ef('0x3f')][_0x95ef('0x47')]);_0x959b1c[_0x95ef('0x48')]=qs[_0x95ef('0x40')](_[_0x95ef('0x49')](_0x2c1794[_0x95ef('0x3f')],_0x5901d4[_0x95ef('0x40')]));if(_0x2c1794['query'][_0x95ef('0x4a')]){_0x959b1c[_0x95ef('0x48')]=_['merge'](_0x959b1c[_0x95ef('0x48')],{'$or':_['map'](_0x959b1c[_0x95ef('0x42')],function(_0x10cc69){var _0x239ee6={};_0x239ee6[_0x10cc69]={'$like':'%'+_0x2c1794['query'][_0x95ef('0x4a')]+'%'};return _0x239ee6;})});}_0x959b1c=_[_0x95ef('0x4b')]({},_0x959b1c,_0x2c1794[_0x95ef('0x67')]);return _0x45febf['getAgents'](_0x959b1c);}})[_0x95ef('0x1f')](function(_0x1d3351){if(_0x1d3351){_0x53c2d7=_0x1d3351[_0x95ef('0x44')];if(!_0x2c1794[_0x95ef('0x3f')][_0x95ef('0x66')](_0x95ef('0x45'))){_0x959b1c['limit']=qs[_0x95ef('0x2f')](_0x2c1794[_0x95ef('0x3f')][_0x95ef('0x2f')]);_0x959b1c[_0x95ef('0x2e')]=qs[_0x95ef('0x2e')](_0x2c1794[_0x95ef('0x3f')][_0x95ef('0x2e')]);}return _0x45febf[_0x95ef('0xda')](_0x959b1c);}})[_0x95ef('0x1f')](function(_0x6649c6){if(_0x6649c6){return _0x6649c6?{'count':_0x53c2d7,'rows':_0x6649c6}:null;}})[_0x95ef('0x1f')](respondWithResult(_0x428385,null))[_0x95ef('0x52')](handleError(_0x428385,null));}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.events.js b/server/api/smsAccount/smsAccount.events.js index a12be98..fed1bcc 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 _0x86dc=['save','update','remove','emit','hasOwnProperty','hook','events','setMaxListeners'];(function(_0x5b0084,_0x4ccfb3){var _0x5bdb5e=function(_0x33a101){while(--_0x33a101){_0x5b0084['push'](_0x5b0084['shift']());}};_0x5bdb5e(++_0x4ccfb3);}(_0x86dc,0x13e));var _0xc86d=function(_0x1d2e9c,_0x3090ae){_0x1d2e9c=_0x1d2e9c-0x0;var _0x597e8b=_0x86dc[_0x1d2e9c];return _0x597e8b;};'use strict';var EventEmitter=require(_0xc86d('0x0'));var SmsAccount=require('../../mysqldb')['db']['SmsAccount'];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0xc86d('0x1')](0x0);var events={'afterCreate':_0xc86d('0x2'),'afterUpdate':_0xc86d('0x3'),'afterDestroy':_0xc86d('0x4')};function emitEvent(_0x4ee770){return function(_0x3a4383,_0x496d00,_0x271eb1){SmsAccountEvents['emit'](_0x4ee770+':'+_0x3a4383['id'],_0x3a4383);SmsAccountEvents[_0xc86d('0x5')](_0x4ee770,_0x3a4383);_0x271eb1(null);};}for(var e in events){if(events[_0xc86d('0x6')](e)){var event=events[e];SmsAccount[_0xc86d('0x7')](e,emitEvent(event));}}module['exports']=SmsAccountEvents; \ No newline at end of file +var _0x4efb=['hook','exports','../../mysqldb','SmsAccount','setMaxListeners','update','emit','hasOwnProperty'];(function(_0x39ef12,_0x5b58ce){var _0x450030=function(_0x2b7afd){while(--_0x2b7afd){_0x39ef12['push'](_0x39ef12['shift']());}};_0x450030(++_0x5b58ce);}(_0x4efb,0xfa));var _0xb4ef=function(_0x5b08b0,_0x1c0f06){_0x5b08b0=_0x5b08b0-0x0;var _0x1da707=_0x4efb[_0x5b08b0];return _0x1da707;};'use strict';var EventEmitter=require('events');var SmsAccount=require(_0xb4ef('0x0'))['db'][_0xb4ef('0x1')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0xb4ef('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xb4ef('0x3'),'afterDestroy':'remove'};function emitEvent(_0x1d3ded){return function(_0x1cbfd0,_0x5d1d0f,_0x1a8665){SmsAccountEvents['emit'](_0x1d3ded+':'+_0x1cbfd0['id'],_0x1cbfd0);SmsAccountEvents[_0xb4ef('0x4')](_0x1d3ded,_0x1cbfd0);_0x1a8665(null);};}for(var e in events){if(events[_0xb4ef('0x5')](e)){var event=events[e];SmsAccount[_0xb4ef('0x6')](e,emitEvent(event));}}module[_0xb4ef('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 b9852de..7f77017 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 _0xd214=['SmsAccount','sms_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./smsAccount.attributes','exports','define'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0xd214,0x8e));var _0x4d21=function(_0x396d05,_0x5cbf27){_0x396d05=_0x396d05-0x0;var _0x3b206e=_0xd214[_0x396d05];return _0x3b206e;};'use strict';var _=require(_0x4d21('0x0'));var util=require(_0x4d21('0x1'));var logger=require(_0x4d21('0x2'))(_0x4d21('0x3'));var moment=require(_0x4d21('0x4'));var BPromise=require(_0x4d21('0x5'));var rp=require(_0x4d21('0x6'));var fs=require('fs');var path=require(_0x4d21('0x7'));var rimraf=require('rimraf');var config=require(_0x4d21('0x8'));var attributes=require(_0x4d21('0x9'));module[_0x4d21('0xa')]=function(_0x194c85,_0x32d87a){return _0x194c85[_0x4d21('0xb')](_0x4d21('0xc'),attributes,{'tableName':_0x4d21('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2413=['exports','SmsAccount','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./smsAccount.attributes'];(function(_0x219fc1,_0xcc0f94){var _0x2dfdbe=function(_0x550d7a){while(--_0x550d7a){_0x219fc1['push'](_0x219fc1['shift']());}};_0x2dfdbe(++_0xcc0f94);}(_0x2413,0x1e6));var _0x3241=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x2413[_0x42cae2];return _0x5f256f;};'use strict';var _=require(_0x3241('0x0'));var util=require('util');var logger=require(_0x3241('0x1'))(_0x3241('0x2'));var moment=require(_0x3241('0x3'));var BPromise=require(_0x3241('0x4'));var rp=require(_0x3241('0x5'));var fs=require('fs');var path=require(_0x3241('0x6'));var rimraf=require(_0x3241('0x7'));var config=require('../../config/environment');var attributes=require(_0x3241('0x8'));module[_0x3241('0x9')]=function(_0x2d2ce0,_0x48e636){return _0x2d2ce0['define'](_0x3241('0xa'),attributes,{'tableName':'sms_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.rpc.js b/server/api/smsAccount/smsAccount.rpc.js index ee656a4..1b31b07 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 _0x54a5=['client','http','redis','defaults','localhost','socket.io-emitter','./smsAccount.socket','register','request','info','debug','SmsAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','SmsAccount,\x20%s,\x20%s','message','result','catch','ShowSmsAccount','SmsAccount','find','options','raw','include','model','attributes','map','then','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x30ae5e,_0x391fc4){var _0x1f2e93=function(_0x60307d){while(--_0x60307d){_0x30ae5e['push'](_0x30ae5e['shift']());}};_0x1f2e93(++_0x391fc4);}(_0x54a5,0x72));var _0x554a=function(_0x44db5e,_0x5f0ffc){_0x44db5e=_0x44db5e-0x0;var _0x5ee163=_0x54a5[_0x44db5e];return _0x5ee163;};'use strict';var _=require(_0x554a('0x0'));var util=require(_0x554a('0x1'));var moment=require(_0x554a('0x2'));var BPromise=require(_0x554a('0x3'));var rs=require(_0x554a('0x4'));var fs=require('fs');var Redis=require(_0x554a('0x5'));var db=require(_0x554a('0x6'))['db'];var utils=require(_0x554a('0x7'));var logger=require(_0x554a('0x8'))(_0x554a('0x9'));var config=require(_0x554a('0xa'));var jayson=require(_0x554a('0xb'));var client=jayson[_0x554a('0xc')][_0x554a('0xd')]({'port':0x232a});config[_0x554a('0xe')]=_[_0x554a('0xf')](config[_0x554a('0xe')],{'host':_0x554a('0x10'),'port':0x18eb});var socket=require(_0x554a('0x11'))(new Redis(config[_0x554a('0xe')]));require(_0x554a('0x12'))[_0x554a('0x13')](socket);function respondWithRpcPromise(_0x41f353,_0x5e16ae,_0x594dc3){return new BPromise(function(_0x405254,_0xdfbc37){return client[_0x554a('0x14')](_0x41f353,_0x594dc3)['then'](function(_0x3df15b){logger[_0x554a('0x15')]('SmsAccount,\x20%s,\x20%s',_0x5e16ae,'request\x20sent');logger[_0x554a('0x16')](_0x554a('0x17'),_0x5e16ae,_0x554a('0x18'),JSON[_0x554a('0x19')](_0x3df15b));if(_0x3df15b['error']){if(_0x3df15b['error'][_0x554a('0x1a')]===0x1f4){logger[_0x554a('0x1b')](_0x554a('0x1c'),_0x5e16ae,_0x3df15b['error'][_0x554a('0x1d')]);return _0xdfbc37(_0x3df15b[_0x554a('0x1b')]['message']);}logger[_0x554a('0x1b')](_0x554a('0x1c'),_0x5e16ae,_0x3df15b['error'][_0x554a('0x1d')]);return _0x405254(_0x3df15b[_0x554a('0x1b')][_0x554a('0x1d')]);}else{logger[_0x554a('0x15')](_0x554a('0x1c'),_0x5e16ae,_0x554a('0x18'));_0x405254(_0x3df15b[_0x554a('0x1e')][_0x554a('0x1d')]);}})[_0x554a('0x1f')](function(_0x2c6563){logger[_0x554a('0x1b')](_0x554a('0x1c'),_0x5e16ae,_0x2c6563);_0xdfbc37(_0x2c6563);});});}exports[_0x554a('0x20')]=function(_0x8f7606){var _0x479876=this;return new Promise(function(_0x3f19ef,_0x399ccb){return db[_0x554a('0x21')][_0x554a('0x22')]({'raw':_0x8f7606[_0x554a('0x23')]?_0x8f7606[_0x554a('0x23')][_0x554a('0x24')]===undefined?!![]:![]:!![],'where':_0x8f7606[_0x554a('0x23')]?_0x8f7606[_0x554a('0x23')]['where']||null:null,'attributes':_0x8f7606[_0x554a('0x23')]?_0x8f7606[_0x554a('0x23')]['attributes']||null:null,'include':_0x8f7606[_0x554a('0x23')]?_0x8f7606[_0x554a('0x23')][_0x554a('0x25')]?_['map'](_0x8f7606[_0x554a('0x23')][_0x554a('0x25')],function(_0x34ef86){return{'model':db[_0x34ef86[_0x554a('0x26')]],'as':_0x34ef86['as'],'attributes':_0x34ef86[_0x554a('0x27')],'include':_0x34ef86[_0x554a('0x25')]?_[_0x554a('0x28')](_0x34ef86['include'],function(_0x16dd95){return{'model':db[_0x16dd95[_0x554a('0x26')]],'as':_0x16dd95['as'],'attributes':_0x16dd95[_0x554a('0x27')],'include':_0x16dd95[_0x554a('0x25')]?_[_0x554a('0x28')](_0x16dd95[_0x554a('0x25')],function(_0x5e69c3){return{'model':db[_0x5e69c3[_0x554a('0x26')]],'as':_0x5e69c3['as'],'attributes':_0x5e69c3[_0x554a('0x27')]};}):[]};}):[]};}):[]:[]})[_0x554a('0x29')](function(_0x3c6387){logger[_0x554a('0x15')]('ShowSmsAccount',_0x8f7606);logger[_0x554a('0x16')]('ShowSmsAccount',_0x8f7606,JSON[_0x554a('0x19')](_0x3c6387));_0x3f19ef(_0x3c6387);})[_0x554a('0x1f')](function(_0x3aa8a7){logger[_0x554a('0x1b')](_0x554a('0x20'),_0x3aa8a7[_0x554a('0x1d')],_0x8f7606);_0x399ccb(_0x479876['error'](0x1f4,_0x3aa8a7['message']));});});}; \ No newline at end of file +var _0x8b0d=['jayson/promise','http','defaults','redis','socket.io-emitter','register','request','then','request\x20sent','debug','error','code','SmsAccount,\x20%s,\x20%s','message','info','result','catch','SmsAccount','find','options','raw','where','map','include','model','attributes','ShowSmsAccount','stringify','lodash','util','moment','bluebird','rpc','../../config/environment'];(function(_0x441a45,_0x515a05){var _0x53cc9e=function(_0x38a8e1){while(--_0x38a8e1){_0x441a45['push'](_0x441a45['shift']());}};_0x53cc9e(++_0x515a05);}(_0x8b0d,0x12c));var _0xd8b0=function(_0x55965e,_0xf21137){_0x55965e=_0x55965e-0x0;var _0x48bd0a=_0x8b0d[_0x55965e];return _0x48bd0a;};'use strict';var _=require(_0xd8b0('0x0'));var util=require(_0xd8b0('0x1'));var moment=require(_0xd8b0('0x2'));var BPromise=require(_0xd8b0('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xd8b0('0x4'));var config=require(_0xd8b0('0x5'));var jayson=require(_0xd8b0('0x6'));var client=jayson['client'][_0xd8b0('0x7')]({'port':0x232a});config['redis']=_[_0xd8b0('0x8')](config[_0xd8b0('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0xd8b0('0xa'))(new Redis(config['redis']));require('./smsAccount.socket')[_0xd8b0('0xb')](socket);function respondWithRpcPromise(_0x168145,_0x26eca9,_0x542b45){return new BPromise(function(_0x53b598,_0x4435ed){return client[_0xd8b0('0xc')](_0x168145,_0x542b45)[_0xd8b0('0xd')](function(_0x274638){logger['info']('SmsAccount,\x20%s,\x20%s',_0x26eca9,_0xd8b0('0xe'));logger[_0xd8b0('0xf')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x26eca9,_0xd8b0('0xe'),JSON['stringify'](_0x274638));if(_0x274638[_0xd8b0('0x10')]){if(_0x274638[_0xd8b0('0x10')][_0xd8b0('0x11')]===0x1f4){logger[_0xd8b0('0x10')](_0xd8b0('0x12'),_0x26eca9,_0x274638[_0xd8b0('0x10')][_0xd8b0('0x13')]);return _0x4435ed(_0x274638[_0xd8b0('0x10')][_0xd8b0('0x13')]);}logger[_0xd8b0('0x10')](_0xd8b0('0x12'),_0x26eca9,_0x274638[_0xd8b0('0x10')][_0xd8b0('0x13')]);return _0x53b598(_0x274638['error'][_0xd8b0('0x13')]);}else{logger[_0xd8b0('0x14')](_0xd8b0('0x12'),_0x26eca9,_0xd8b0('0xe'));_0x53b598(_0x274638[_0xd8b0('0x15')][_0xd8b0('0x13')]);}})[_0xd8b0('0x16')](function(_0x5e3c7c){logger[_0xd8b0('0x10')](_0xd8b0('0x12'),_0x26eca9,_0x5e3c7c);_0x4435ed(_0x5e3c7c);});});}exports['ShowSmsAccount']=function(_0x3bff2a){var _0x5ed5df=this;return new Promise(function(_0x5c9810,_0x233add){return db[_0xd8b0('0x17')][_0xd8b0('0x18')]({'raw':_0x3bff2a[_0xd8b0('0x19')]?_0x3bff2a[_0xd8b0('0x19')][_0xd8b0('0x1a')]===undefined?!![]:![]:!![],'where':_0x3bff2a[_0xd8b0('0x19')]?_0x3bff2a[_0xd8b0('0x19')][_0xd8b0('0x1b')]||null:null,'attributes':_0x3bff2a[_0xd8b0('0x19')]?_0x3bff2a['options']['attributes']||null:null,'include':_0x3bff2a['options']?_0x3bff2a['options']['include']?_[_0xd8b0('0x1c')](_0x3bff2a[_0xd8b0('0x19')][_0xd8b0('0x1d')],function(_0x4fb3fb){return{'model':db[_0x4fb3fb[_0xd8b0('0x1e')]],'as':_0x4fb3fb['as'],'attributes':_0x4fb3fb[_0xd8b0('0x1f')],'include':_0x4fb3fb['include']?_[_0xd8b0('0x1c')](_0x4fb3fb[_0xd8b0('0x1d')],function(_0x980993){return{'model':db[_0x980993[_0xd8b0('0x1e')]],'as':_0x980993['as'],'attributes':_0x980993[_0xd8b0('0x1f')],'include':_0x980993[_0xd8b0('0x1d')]?_[_0xd8b0('0x1c')](_0x980993[_0xd8b0('0x1d')],function(_0x53f1a3){return{'model':db[_0x53f1a3[_0xd8b0('0x1e')]],'as':_0x53f1a3['as'],'attributes':_0x53f1a3['attributes']};}):[]};}):[]};}):[]:[]})[_0xd8b0('0xd')](function(_0x26df8b){logger[_0xd8b0('0x14')]('ShowSmsAccount',_0x3bff2a);logger[_0xd8b0('0xf')](_0xd8b0('0x20'),_0x3bff2a,JSON[_0xd8b0('0x21')](_0x26df8b));_0x5c9810(_0x26df8b);})[_0xd8b0('0x16')](function(_0x5ea689){logger[_0xd8b0('0x10')](_0xd8b0('0x20'),_0x5ea689['message'],_0x3bff2a);_0x233add(_0x5ed5df[_0xd8b0('0x10')](0x1f4,_0x5ea689['message']));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.socket.js b/server/api/smsAccount/smsAccount.socket.js index f53f0a0..27e4f0a 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 _0xb581=['removeListener','register','length','./smsAccount.events','save','remove','update','emit'];(function(_0x41c842,_0x3865f6){var _0x15ee6b=function(_0x2505f5){while(--_0x2505f5){_0x41c842['push'](_0x41c842['shift']());}};_0x15ee6b(++_0x3865f6);}(_0xb581,0x17b));var _0x1b58=function(_0x76b40c,_0x35c098){_0x76b40c=_0x76b40c-0x0;var _0x59c59=_0xb581[_0x76b40c];return _0x59c59;};'use strict';var SmsAccountEvents=require(_0x1b58('0x0'));var events=[_0x1b58('0x1'),_0x1b58('0x2'),_0x1b58('0x3')];function createListener(_0x156710,_0x179433){return function(_0x502142){_0x179433[_0x1b58('0x4')](_0x156710,_0x502142);};}function removeListener(_0x1ed3bd,_0x43af5d){return function(){SmsAccountEvents[_0x1b58('0x5')](_0x1ed3bd,_0x43af5d);};}exports[_0x1b58('0x6')]=function(_0x32afbe){for(var _0x24870a=0x0,_0x2f5c36=events[_0x1b58('0x7')];_0x24870a<_0x2f5c36;_0x24870a++){var _0x304671=events[_0x24870a];var _0x4dccc5=createListener('smsAccount:'+_0x304671,_0x32afbe);SmsAccountEvents['on'](_0x304671,_0x4dccc5);}}; \ No newline at end of file +var _0xfae3=['save','remove','update','emit','removeListener','./smsAccount.events'];(function(_0x475a0f,_0x37033b){var _0x503858=function(_0x2d8e4d){while(--_0x2d8e4d){_0x475a0f['push'](_0x475a0f['shift']());}};_0x503858(++_0x37033b);}(_0xfae3,0xa1));var _0x3fae=function(_0x182394,_0xc13ead){_0x182394=_0x182394-0x0;var _0x23a459=_0xfae3[_0x182394];return _0x23a459;};'use strict';var SmsAccountEvents=require(_0x3fae('0x0'));var events=[_0x3fae('0x1'),_0x3fae('0x2'),_0x3fae('0x3')];function createListener(_0x2e7d22,_0x187017){return function(_0x7a6b5a){_0x187017[_0x3fae('0x4')](_0x2e7d22,_0x7a6b5a);};}function removeListener(_0x1418bf,_0x32980e){return function(){SmsAccountEvents[_0x3fae('0x5')](_0x1418bf,_0x32980e);};}exports['register']=function(_0x2d42d6){for(var _0x3b2e37=0x0,_0x47a827=events['length'];_0x3b2e37<_0x47a827;_0x3b2e37++){var _0x28c778=events[_0x3b2e37];var _0x1f5ce2=createListener('smsAccount:'+_0x28c778,_0x2d42d6);SmsAccountEvents['on'](_0x28c778,_0x1f5ce2);}}; \ No newline at end of file diff --git a/server/api/smsApplication/index.js b/server/api/smsApplication/index.js index 4446a13..b620d61 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 _0x2546=['/:id','isAuthenticated','show','post','create','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsApplication.controller','get','index'];(function(_0x4fdcc0,_0x560a01){var _0xc0ce94=function(_0x36ea12){while(--_0x36ea12){_0x4fdcc0['push'](_0x4fdcc0['shift']());}};_0xc0ce94(++_0x560a01);}(_0x2546,0x1d0));var _0x6254=function(_0x42a7ce,_0x44e0b7){_0x42a7ce=_0x42a7ce-0x0;var _0x16a0fa=_0x2546[_0x42a7ce];return _0x16a0fa;};'use strict';var multer=require(_0x6254('0x0'));var util=require(_0x6254('0x1'));var path=require(_0x6254('0x2'));var timeout=require(_0x6254('0x3'));var express=require('express');var router=express[_0x6254('0x4')]();var auth=require(_0x6254('0x5'));var interaction=require(_0x6254('0x6'));var config=require(_0x6254('0x7'));var controller=require(_0x6254('0x8'));router[_0x6254('0x9')]('/',auth['isAuthenticated'](),controller[_0x6254('0xa')]);router[_0x6254('0x9')](_0x6254('0xb'),auth[_0x6254('0xc')](),controller[_0x6254('0xd')]);router[_0x6254('0xe')]('/',auth[_0x6254('0xc')](),controller[_0x6254('0xf')]);router['put'](_0x6254('0xb'),auth[_0x6254('0xc')](),controller['update']);router[_0x6254('0x10')](_0x6254('0xb'),auth['isAuthenticated'](),controller[_0x6254('0x11')]);module[_0x6254('0x12')]=router; \ No newline at end of file +var _0x3296=['../../config/environment','get','index','/:id','isAuthenticated','show','post','put','delete','destroy','exports','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service'];(function(_0xb9020e,_0x15b9d6){var _0x17f0ba=function(_0x4d3090){while(--_0x4d3090){_0xb9020e['push'](_0xb9020e['shift']());}};_0x17f0ba(++_0x15b9d6);}(_0x3296,0xbb));var _0x6329=function(_0x26dfa5,_0x2ed3e9){_0x26dfa5=_0x26dfa5-0x0;var _0x408dd2=_0x3296[_0x26dfa5];return _0x408dd2;};'use strict';var multer=require('multer');var util=require(_0x6329('0x0'));var path=require(_0x6329('0x1'));var timeout=require(_0x6329('0x2'));var express=require('express');var router=express['Router']();var auth=require(_0x6329('0x3'));var interaction=require(_0x6329('0x4'));var config=require(_0x6329('0x5'));var controller=require('./smsApplication.controller');router[_0x6329('0x6')]('/',auth['isAuthenticated'](),controller[_0x6329('0x7')]);router[_0x6329('0x6')](_0x6329('0x8'),auth[_0x6329('0x9')](),controller[_0x6329('0xa')]);router[_0x6329('0xb')]('/',auth[_0x6329('0x9')](),controller['create']);router[_0x6329('0xc')](_0x6329('0x8'),auth['isAuthenticated'](),controller['update']);router[_0x6329('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x6329('0xe')]);module[_0x6329('0xf')]=router; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.attributes.js b/server/api/smsApplication/smsApplication.attributes.js index ec0f608..4f64639 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 _0xa4bb=['exports','INTEGER','STRING','noop','*,*,*,*','sequelize'];(function(_0x2adf46,_0xab375d){var _0x40fb40=function(_0x28e5f7){while(--_0x28e5f7){_0x2adf46['push'](_0x2adf46['shift']());}};_0x40fb40(++_0xab375d);}(_0xa4bb,0x197));var _0xba4b=function(_0x407d21,_0x3e1594){_0x407d21=_0x407d21-0x0;var _0x48774b=_0xa4bb[_0x407d21];return _0x48774b;};'use strict';var Sequelize=require(_0xba4b('0x0'));module[_0xba4b('0x1')]={'priority':{'type':Sequelize[_0xba4b('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xba4b('0x3')],'allowNull':![],'defaultValue':_0xba4b('0x4')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0xba4b('0x3')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0xba4b('0x5')}}; \ No newline at end of file +var _0xbb65=['exports','STRING','sequelize'];(function(_0x122c52,_0x5894cf){var _0x5e9b87=function(_0x1ad225){while(--_0x1ad225){_0x122c52['push'](_0x122c52['shift']());}};_0x5e9b87(++_0x5894cf);}(_0xbb65,0x80));var _0x5bb6=function(_0x25d78f,_0x10c7be){_0x25d78f=_0x25d78f-0x0;var _0x14bb26=_0xbb65[_0x25d78f];return _0x14bb26;};'use strict';var Sequelize=require(_0x5bb6('0x0'));module[_0x5bb6('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x5bb6('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x5bb6('0x2')]},'interval':{'type':Sequelize[_0x5bb6('0x2')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.controller.js b/server/api/smsApplication/smsApplication.controller.js index b0293c4..ebb9300 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 _0x4024=['pick','filter','merge','map','type','VIRTUAL','options','include','findAll','catch','rawAttributes','length','includeAll','find','create','body','params','html-pdf','eml-format','zip-dir','fast-json-patch','moment','mustache','util','to-csv','ejs','lodash','crypto','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','limit','apply','save','update','then','destroy','stack','name','index','SmsApplication','model','query','keys','intersection','attributes','fields','nolimit','sort','where','filters'];(function(_0x34ba12,_0x1bc8e2){var _0x1fa831=function(_0x5d743c){while(--_0x5d743c){_0x34ba12['push'](_0x34ba12['shift']());}};_0x1fa831(++_0x1bc8e2);}(_0x4024,0x89));var _0x4402=function(_0x2f5ea1,_0x348b7c){_0x2f5ea1=_0x2f5ea1-0x0;var _0x27c214=_0x4024[_0x2f5ea1];return _0x27c214;};'use strict';var pdf=require(_0x4402('0x0'));var emlformat=require(_0x4402('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x4402('0x2'));var jsonpatch=require(_0x4402('0x3'));var rp=require('request-promise');var moment=require(_0x4402('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x4402('0x5'));var util=require(_0x4402('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x4402('0x7'));var ejs=require(_0x4402('0x8'));var fs=require('fs');var _=require(_0x4402('0x9'));var squel=require('squel');var crypto=require(_0x4402('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x4402('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x4402('0xb'));var authService=require('../../components/auth/service');var qs=require(_0x4402('0xc'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4402('0xd'));var logger=require('../../config/logger')(_0x4402('0xe'));var utils=require(_0x4402('0xf'));var config=require('../../config/environment');var db=require(_0x4402('0x10'))['db'];function respondWithStatusCode(_0x302c4d,_0xa819e9){_0xa819e9=_0xa819e9||0xcc;return function(_0x4c9032){if(_0x4c9032){return _0x302c4d[_0x4402('0x11')](_0xa819e9);}return _0x302c4d[_0x4402('0x12')](_0xa819e9)[_0x4402('0x13')]();};}function respondWithResult(_0x19d2f4,_0x248ad9){_0x248ad9=_0x248ad9||0xc8;return function(_0x31710c){if(_0x31710c){return _0x19d2f4[_0x4402('0x12')](_0x248ad9)[_0x4402('0x14')](_0x31710c);}};}function respondWithFilteredResult(_0x295ac5,_0x263a57){return function(_0x375166){if(_0x375166){var _0xc03f65=_0x375166[_0x4402('0x15')],_0x2a2ce8=_0x263a57[_0x4402('0x16')],_0x19fe7b=_0x263a57[_0x4402('0x16')]+_0x263a57[_0x4402('0x17')],_0xfd9853;if(_0x19fe7b>=_0xc03f65){_0x19fe7b=_0xc03f65;_0xfd9853=0xc8;}else{_0xfd9853=0xce;}_0x295ac5[_0x4402('0x12')](_0xfd9853);return _0x295ac5['set']('Content-Range',_0x2a2ce8+'-'+_0x19fe7b+'/'+_0xc03f65)[_0x4402('0x14')](_0x375166);}return null;};}function patchUpdates(_0x2a7afc){return function(_0x5681c5){try{jsonpatch[_0x4402('0x18')](_0x5681c5,_0x2a7afc,!![]);}catch(_0x192855){return BPromise['reject'](_0x192855);}return _0x5681c5[_0x4402('0x19')]();};}function saveUpdates(_0x4e0340,_0x55cc8c){return function(_0x1b9599){if(_0x1b9599){return _0x1b9599[_0x4402('0x1a')](_0x4e0340)[_0x4402('0x1b')](function(_0x49bc21){return _0x49bc21;});}return null;};}function removeEntity(_0x42509b,_0x57a25e){return function(_0x47ab54){if(_0x47ab54){return _0x47ab54[_0x4402('0x1c')]()[_0x4402('0x1b')](function(){_0x42509b[_0x4402('0x12')](0xcc)[_0x4402('0x13')]();});}};}function handleEntityNotFound(_0x258d10,_0x2e6fee){return function(_0x289a3e){if(!_0x289a3e){_0x258d10[_0x4402('0x11')](0x194);}return _0x289a3e;};}function handleError(_0x24a9b8,_0x4d6846){_0x4d6846=_0x4d6846||0x1f4;return function(_0x1409a9){logger['error'](_0x1409a9[_0x4402('0x1d')]);if(_0x1409a9[_0x4402('0x1e')]){delete _0x1409a9[_0x4402('0x1e')];}_0x24a9b8[_0x4402('0x12')](_0x4d6846)['send'](_0x1409a9);};}exports[_0x4402('0x1f')]=function(_0x4e9cb5,_0x59d52f){var _0x1be54d={},_0x395e49={},_0x327d60={'count':0x0,'rows':[]};var _0xabf61b=db[_0x4402('0x20')]['rawAttributes'];_0x395e49[_0x4402('0x21')]=_['keys'](_0xabf61b);_0x395e49[_0x4402('0x22')]=_[_0x4402('0x23')](_0x4e9cb5[_0x4402('0x22')]);_0x395e49['filters']=_[_0x4402('0x24')](_0x395e49[_0x4402('0x21')],_0x395e49[_0x4402('0x22')]);_0x1be54d[_0x4402('0x25')]=_[_0x4402('0x24')](_0x395e49[_0x4402('0x21')],qs[_0x4402('0x26')](_0x4e9cb5[_0x4402('0x22')][_0x4402('0x26')]));_0x1be54d[_0x4402('0x25')]=_0x1be54d[_0x4402('0x25')]['length']?_0x1be54d[_0x4402('0x25')]:_0x395e49['model'];if(!_0x4e9cb5[_0x4402('0x22')]['hasOwnProperty'](_0x4402('0x27'))){_0x1be54d[_0x4402('0x17')]=qs[_0x4402('0x17')](_0x4e9cb5[_0x4402('0x22')][_0x4402('0x17')]);_0x1be54d['offset']=qs[_0x4402('0x16')](_0x4e9cb5[_0x4402('0x22')][_0x4402('0x16')]);}_0x1be54d['order']=qs[_0x4402('0x28')](_0x4e9cb5[_0x4402('0x22')]['sort']);_0x1be54d[_0x4402('0x29')]=qs[_0x4402('0x2a')](_[_0x4402('0x2b')](_0x4e9cb5[_0x4402('0x22')],_0x395e49[_0x4402('0x2a')]));if(_0x4e9cb5[_0x4402('0x22')][_0x4402('0x2c')]){_0x1be54d[_0x4402('0x29')]=_[_0x4402('0x2d')](_0x1be54d['where'],{'$or':_[_0x4402('0x2e')](_0xabf61b,function(_0x28fee8){if(_0x28fee8[_0x4402('0x2f')]['key']!==_0x4402('0x30')){var _0x1c1ac3={};_0x1c1ac3[_0x28fee8['field']]={'$like':'%'+_0x4e9cb5['query'][_0x4402('0x2c')]+'%'};return _0x1c1ac3;}})});}_0x1be54d=_[_0x4402('0x2d')]({},_0x1be54d,_0x4e9cb5[_0x4402('0x31')]);var _0xc7ab7e={'where':_0x1be54d['where']};return db['SmsApplication']['count'](_0xc7ab7e)[_0x4402('0x1b')](function(_0x3f564f){_0x327d60[_0x4402('0x15')]=_0x3f564f;if(_0x4e9cb5[_0x4402('0x22')]['includeAll']){_0x1be54d[_0x4402('0x32')]=[{'all':!![]}];}return db[_0x4402('0x20')][_0x4402('0x33')](_0x1be54d);})['then'](function(_0x2b92b7){_0x327d60['rows']=_0x2b92b7;return _0x327d60;})[_0x4402('0x1b')](respondWithFilteredResult(_0x59d52f,_0x1be54d))[_0x4402('0x34')](handleError(_0x59d52f,null));};exports['show']=function(_0x16ef2e,_0x529526){var _0x423628={'raw':!![],'where':{'id':_0x16ef2e['params']['id']}},_0x238312={};_0x238312[_0x4402('0x21')]=_[_0x4402('0x23')](db[_0x4402('0x20')][_0x4402('0x35')]);_0x238312['query']=_['keys'](_0x16ef2e[_0x4402('0x22')]);_0x238312['filters']=_[_0x4402('0x24')](_0x238312[_0x4402('0x21')],_0x238312[_0x4402('0x22')]);_0x423628[_0x4402('0x25')]=_[_0x4402('0x24')](_0x238312[_0x4402('0x21')],qs[_0x4402('0x26')](_0x16ef2e[_0x4402('0x22')][_0x4402('0x26')]));_0x423628[_0x4402('0x25')]=_0x423628['attributes'][_0x4402('0x36')]?_0x423628[_0x4402('0x25')]:_0x238312['model'];if(_0x16ef2e[_0x4402('0x22')][_0x4402('0x37')]){_0x423628['include']=[{'all':!![]}];}_0x423628=_[_0x4402('0x2d')]({},_0x423628,_0x16ef2e[_0x4402('0x31')]);return db[_0x4402('0x20')][_0x4402('0x38')](_0x423628)[_0x4402('0x1b')](handleEntityNotFound(_0x529526,null))['then'](respondWithResult(_0x529526,null))[_0x4402('0x34')](handleError(_0x529526,null));};exports[_0x4402('0x39')]=function(_0x21d34f,_0x443c53){return db[_0x4402('0x20')][_0x4402('0x39')](_0x21d34f[_0x4402('0x3a')],{})[_0x4402('0x1b')](respondWithResult(_0x443c53,0xc9))[_0x4402('0x34')](handleError(_0x443c53,null));};exports[_0x4402('0x1a')]=function(_0x22b463,_0x55df37){if(_0x22b463[_0x4402('0x3a')]['id']){delete _0x22b463['body']['id'];}return db[_0x4402('0x20')][_0x4402('0x38')]({'where':{'id':_0x22b463['params']['id']}})[_0x4402('0x1b')](handleEntityNotFound(_0x55df37,null))[_0x4402('0x1b')](saveUpdates(_0x22b463[_0x4402('0x3a')],null))[_0x4402('0x1b')](respondWithResult(_0x55df37,null))[_0x4402('0x34')](handleError(_0x55df37,null));};exports[_0x4402('0x1c')]=function(_0x5b094b,_0xd0c9a5){return db[_0x4402('0x20')][_0x4402('0x38')]({'where':{'id':_0x5b094b[_0x4402('0x3b')]['id']}})[_0x4402('0x1b')](handleEntityNotFound(_0xd0c9a5,null))[_0x4402('0x1b')](removeEntity(_0xd0c9a5,null))[_0x4402('0x34')](handleError(_0xd0c9a5,null));}; \ No newline at end of file +var _0x6cb4=['path','to-csv','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','sendStatus','end','status','json','offset','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','SmsApplication','rawAttributes','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','limit','order','sort','where','filter','merge','map','type','key','options','count','include','rows','catch','show','params','find','body','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x6cb4,0xff));var _0x46cb=function(_0x3491f2,_0x10902d){_0x3491f2=_0x3491f2-0x0;var _0x157548=_0x6cb4[_0x3491f2];return _0x157548;};'use strict';var pdf=require(_0x46cb('0x0'));var emlformat=require(_0x46cb('0x1'));var rimraf=require(_0x46cb('0x2'));var zipdir=require(_0x46cb('0x3'));var jsonpatch=require(_0x46cb('0x4'));var rp=require(_0x46cb('0x5'));var moment=require(_0x46cb('0x6'));var BPromise=require(_0x46cb('0x7'));var Mustache=require(_0x46cb('0x8'));var util=require('util');var path=require(_0x46cb('0x9'));var sox=require('sox');var csv=require(_0x46cb('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x46cb('0xb'));var squel=require(_0x46cb('0xc'));var crypto=require(_0x46cb('0xd'));var jsforce=require(_0x46cb('0xe'));var deskjs=require(_0x46cb('0xf'));var toCsv=require(_0x46cb('0xa'));var querystring=require('querystring');var Papa=require(_0x46cb('0x10'));var Redis=require(_0x46cb('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x46cb('0x12'));var as=require(_0x46cb('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x46cb('0x14'))(_0x46cb('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1e5f96,_0x323ac2){_0x323ac2=_0x323ac2||0xcc;return function(_0x1058a8){if(_0x1058a8){return _0x1e5f96[_0x46cb('0x16')](_0x323ac2);}return _0x1e5f96['status'](_0x323ac2)[_0x46cb('0x17')]();};}function respondWithResult(_0x2ad351,_0x2a1f9d){_0x2a1f9d=_0x2a1f9d||0xc8;return function(_0x3c0071){if(_0x3c0071){return _0x2ad351[_0x46cb('0x18')](_0x2a1f9d)[_0x46cb('0x19')](_0x3c0071);}};}function respondWithFilteredResult(_0x3d2557,_0x3c396b){return function(_0x37d368){if(_0x37d368){var _0x41e398=_0x37d368['count'],_0x136215=_0x3c396b[_0x46cb('0x1a')],_0x5cdb4b=_0x3c396b['offset']+_0x3c396b['limit'],_0x3da031;if(_0x5cdb4b>=_0x41e398){_0x5cdb4b=_0x41e398;_0x3da031=0xc8;}else{_0x3da031=0xce;}_0x3d2557['status'](_0x3da031);return _0x3d2557[_0x46cb('0x1b')](_0x46cb('0x1c'),_0x136215+'-'+_0x5cdb4b+'/'+_0x41e398)[_0x46cb('0x19')](_0x37d368);}return null;};}function patchUpdates(_0xcc8e2){return function(_0xbd488f){try{jsonpatch[_0x46cb('0x1d')](_0xbd488f,_0xcc8e2,!![]);}catch(_0x264497){return BPromise[_0x46cb('0x1e')](_0x264497);}return _0xbd488f[_0x46cb('0x1f')]();};}function saveUpdates(_0xfc9064,_0x149483){return function(_0x46e541){if(_0x46e541){return _0x46e541[_0x46cb('0x20')](_0xfc9064)[_0x46cb('0x21')](function(_0x188c28){return _0x188c28;});}return null;};}function removeEntity(_0xf11f19,_0x7084b2){return function(_0x1fb467){if(_0x1fb467){return _0x1fb467[_0x46cb('0x22')]()[_0x46cb('0x21')](function(){_0xf11f19[_0x46cb('0x18')](0xcc)[_0x46cb('0x17')]();});}};}function handleEntityNotFound(_0x309e4b,_0xadcad6){return function(_0x40e0e5){if(!_0x40e0e5){_0x309e4b['sendStatus'](0x194);}return _0x40e0e5;};}function handleError(_0x4d663e,_0x6588f3){_0x6588f3=_0x6588f3||0x1f4;return function(_0x7f9d){logger[_0x46cb('0x23')](_0x7f9d[_0x46cb('0x24')]);if(_0x7f9d[_0x46cb('0x25')]){delete _0x7f9d['name'];}_0x4d663e[_0x46cb('0x18')](_0x6588f3)['send'](_0x7f9d);};}exports['index']=function(_0x544465,_0x180ce1){var _0x119bf6={},_0x2242e7={},_0xc1efd3={'count':0x0,'rows':[]};var _0x7cd177=db[_0x46cb('0x26')][_0x46cb('0x27')];_0x2242e7[_0x46cb('0x28')]=_[_0x46cb('0x29')](_0x7cd177);_0x2242e7[_0x46cb('0x2a')]=_[_0x46cb('0x29')](_0x544465['query']);_0x2242e7[_0x46cb('0x2b')]=_[_0x46cb('0x2c')](_0x2242e7['model'],_0x2242e7['query']);_0x119bf6[_0x46cb('0x2d')]=_['intersection'](_0x2242e7[_0x46cb('0x28')],qs[_0x46cb('0x2e')](_0x544465[_0x46cb('0x2a')][_0x46cb('0x2e')]));_0x119bf6[_0x46cb('0x2d')]=_0x119bf6[_0x46cb('0x2d')]['length']?_0x119bf6[_0x46cb('0x2d')]:_0x2242e7['model'];if(!_0x544465[_0x46cb('0x2a')][_0x46cb('0x2f')]('nolimit')){_0x119bf6[_0x46cb('0x30')]=qs[_0x46cb('0x30')](_0x544465[_0x46cb('0x2a')][_0x46cb('0x30')]);_0x119bf6[_0x46cb('0x1a')]=qs['offset'](_0x544465[_0x46cb('0x2a')]['offset']);}_0x119bf6[_0x46cb('0x31')]=qs[_0x46cb('0x32')](_0x544465[_0x46cb('0x2a')]['sort']);_0x119bf6[_0x46cb('0x33')]=qs[_0x46cb('0x2b')](_['pick'](_0x544465[_0x46cb('0x2a')],_0x2242e7[_0x46cb('0x2b')]));if(_0x544465[_0x46cb('0x2a')][_0x46cb('0x34')]){_0x119bf6[_0x46cb('0x33')]=_[_0x46cb('0x35')](_0x119bf6[_0x46cb('0x33')],{'$or':_[_0x46cb('0x36')](_0x7cd177,function(_0x19e0ad){if(_0x19e0ad[_0x46cb('0x37')][_0x46cb('0x38')]!=='VIRTUAL'){var _0x5f1df0={};_0x5f1df0[_0x19e0ad['field']]={'$like':'%'+_0x544465[_0x46cb('0x2a')][_0x46cb('0x34')]+'%'};return _0x5f1df0;}})});}_0x119bf6=_[_0x46cb('0x35')]({},_0x119bf6,_0x544465[_0x46cb('0x39')]);var _0x1252dd={'where':_0x119bf6[_0x46cb('0x33')]};return db['SmsApplication'][_0x46cb('0x3a')](_0x1252dd)['then'](function(_0x4e8c14){_0xc1efd3[_0x46cb('0x3a')]=_0x4e8c14;if(_0x544465['query']['includeAll']){_0x119bf6[_0x46cb('0x3b')]=[{'all':!![]}];}return db['SmsApplication']['findAll'](_0x119bf6);})[_0x46cb('0x21')](function(_0x10017d){_0xc1efd3[_0x46cb('0x3c')]=_0x10017d;return _0xc1efd3;})[_0x46cb('0x21')](respondWithFilteredResult(_0x180ce1,_0x119bf6))[_0x46cb('0x3d')](handleError(_0x180ce1,null));};exports[_0x46cb('0x3e')]=function(_0x21f9a6,_0x56efa8){var _0x358ed4={'raw':!![],'where':{'id':_0x21f9a6[_0x46cb('0x3f')]['id']}},_0x5c354a={};_0x5c354a['model']=_[_0x46cb('0x29')](db[_0x46cb('0x26')][_0x46cb('0x27')]);_0x5c354a['query']=_[_0x46cb('0x29')](_0x21f9a6[_0x46cb('0x2a')]);_0x5c354a['filters']=_[_0x46cb('0x2c')](_0x5c354a[_0x46cb('0x28')],_0x5c354a[_0x46cb('0x2a')]);_0x358ed4[_0x46cb('0x2d')]=_[_0x46cb('0x2c')](_0x5c354a['model'],qs['fields'](_0x21f9a6[_0x46cb('0x2a')]['fields']));_0x358ed4[_0x46cb('0x2d')]=_0x358ed4[_0x46cb('0x2d')]['length']?_0x358ed4[_0x46cb('0x2d')]:_0x5c354a[_0x46cb('0x28')];if(_0x21f9a6[_0x46cb('0x2a')]['includeAll']){_0x358ed4['include']=[{'all':!![]}];}_0x358ed4=_['merge']({},_0x358ed4,_0x21f9a6['options']);return db[_0x46cb('0x26')][_0x46cb('0x40')](_0x358ed4)[_0x46cb('0x21')](handleEntityNotFound(_0x56efa8,null))[_0x46cb('0x21')](respondWithResult(_0x56efa8,null))[_0x46cb('0x3d')](handleError(_0x56efa8,null));};exports['create']=function(_0x4becfa,_0x2908fb){return db[_0x46cb('0x26')]['create'](_0x4becfa[_0x46cb('0x41')],{})[_0x46cb('0x21')](respondWithResult(_0x2908fb,0xc9))[_0x46cb('0x3d')](handleError(_0x2908fb,null));};exports[_0x46cb('0x20')]=function(_0x189809,_0x223688){if(_0x189809[_0x46cb('0x41')]['id']){delete _0x189809['body']['id'];}return db['SmsApplication'][_0x46cb('0x40')]({'where':{'id':_0x189809['params']['id']}})[_0x46cb('0x21')](handleEntityNotFound(_0x223688,null))[_0x46cb('0x21')](saveUpdates(_0x189809[_0x46cb('0x41')],null))['then'](respondWithResult(_0x223688,null))[_0x46cb('0x3d')](handleError(_0x223688,null));};exports['destroy']=function(_0x5c02c9,_0x16c500){return db[_0x46cb('0x26')][_0x46cb('0x40')]({'where':{'id':_0x5c02c9[_0x46cb('0x3f')]['id']}})[_0x46cb('0x21')](handleEntityNotFound(_0x16c500,null))[_0x46cb('0x21')](removeEntity(_0x16c500,null))[_0x46cb('0x3d')](handleError(_0x16c500,null));}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.model.js b/server/api/smsApplication/smsApplication.model.js index e18d4b2..9cc27e0 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 _0x1952=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsApplication.attributes','exports','define','sms_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util'];(function(_0x509b2f,_0x59382e){var _0x5df95e=function(_0x8a44fd){while(--_0x8a44fd){_0x509b2f['push'](_0x509b2f['shift']());}};_0x5df95e(++_0x59382e);}(_0x1952,0x139));var _0x2195=function(_0x194b6d,_0x337e48){_0x194b6d=_0x194b6d-0x0;var _0x27fa90=_0x1952[_0x194b6d];return _0x27fa90;};'use strict';var _=require(_0x2195('0x0'));var util=require(_0x2195('0x1'));var logger=require('../../config/logger')(_0x2195('0x2'));var moment=require(_0x2195('0x3'));var BPromise=require(_0x2195('0x4'));var rp=require(_0x2195('0x5'));var fs=require('fs');var path=require(_0x2195('0x6'));var rimraf=require(_0x2195('0x7'));var config=require(_0x2195('0x8'));var attributes=require(_0x2195('0x9'));module[_0x2195('0xa')]=function(_0x35d7a3,_0x434368){return _0x35d7a3[_0x2195('0xb')]('SmsApplication',attributes,{'tableName':_0x2195('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x2195('0xd'),'collate':_0x2195('0xe')});}; \ No newline at end of file +var _0x8c43=['utf8mb4_unicode_ci','util','../../config/logger','api','request-promise','../../config/environment','exports','define','SmsApplication','sms_applications','utf8mb4'];(function(_0x37a014,_0x555f73){var _0x5be41b=function(_0x443721){while(--_0x443721){_0x37a014['push'](_0x37a014['shift']());}};_0x5be41b(++_0x555f73);}(_0x8c43,0x156));var _0x38c4=function(_0x3af2b7,_0x1e68fe){_0x3af2b7=_0x3af2b7-0x0;var _0x258076=_0x8c43[_0x3af2b7];return _0x258076;};'use strict';var _=require('lodash');var util=require(_0x38c4('0x0'));var logger=require(_0x38c4('0x1'))(_0x38c4('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x38c4('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x38c4('0x4'));var attributes=require('./smsApplication.attributes');module[_0x38c4('0x5')]=function(_0xa24d10,_0x5f5942){return _0xa24d10[_0x38c4('0x6')](_0x38c4('0x7'),attributes,{'tableName':_0x38c4('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x38c4('0x9'),'collate':_0x38c4('0xa')});}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.rpc.js b/server/api/smsApplication/smsApplication.rpc.js index acb2c41..d556f85 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 _0x29b1=['../../config/environment','jayson/promise','client','then','info','SmsApplication,\x20%s,\x20%s','request\x20sent','debug','SmsApplication,\x20%s,\x20%s,\x20%s','error','message','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x20845e,_0x211e78){var _0x28cf2b=function(_0x31d613){while(--_0x31d613){_0x20845e['push'](_0x20845e['shift']());}};_0x28cf2b(++_0x211e78);}(_0x29b1,0x13b));var _0x129b=function(_0x5834bc,_0x3d4801){_0x5834bc=_0x5834bc-0x0;var _0x3e183a=_0x29b1[_0x5834bc];return _0x3e183a;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x129b('0x0'));var BPromise=require(_0x129b('0x1'));var rs=require(_0x129b('0x2'));var fs=require('fs');var Redis=require(_0x129b('0x3'));var db=require(_0x129b('0x4'))['db'];var utils=require(_0x129b('0x5'));var logger=require(_0x129b('0x6'))(_0x129b('0x7'));var config=require(_0x129b('0x8'));var jayson=require(_0x129b('0x9'));var client=jayson[_0x129b('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4b0923,_0x5f0bcc,_0x1155dd){return new BPromise(function(_0x31e697,_0x54a406){return client['request'](_0x4b0923,_0x1155dd)[_0x129b('0xb')](function(_0x5b7597){logger[_0x129b('0xc')](_0x129b('0xd'),_0x5f0bcc,_0x129b('0xe'));logger[_0x129b('0xf')](_0x129b('0x10'),_0x5f0bcc,_0x129b('0xe'),JSON['stringify'](_0x5b7597));if(_0x5b7597[_0x129b('0x11')]){if(_0x5b7597[_0x129b('0x11')]['code']===0x1f4){logger[_0x129b('0x11')](_0x129b('0xd'),_0x5f0bcc,_0x5b7597['error'][_0x129b('0x12')]);return _0x54a406(_0x5b7597[_0x129b('0x11')][_0x129b('0x12')]);}logger[_0x129b('0x11')](_0x129b('0xd'),_0x5f0bcc,_0x5b7597['error'][_0x129b('0x12')]);return _0x31e697(_0x5b7597[_0x129b('0x11')][_0x129b('0x12')]);}else{logger['info'](_0x129b('0xd'),_0x5f0bcc,_0x129b('0xe'));_0x31e697(_0x5b7597['result'][_0x129b('0x12')]);}})['catch'](function(_0x168620){logger[_0x129b('0x11')](_0x129b('0xd'),_0x5f0bcc,_0x168620);_0x54a406(_0x168620);});});} \ No newline at end of file +var _0xe4d6=['stringify','code','error','message','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','http','request','then','SmsApplication,\x20%s,\x20%s','debug','SmsApplication,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x17b270,_0x32b61d){var _0x32eb1c=function(_0x2e2baf){while(--_0x2e2baf){_0x17b270['push'](_0x17b270['shift']());}};_0x32eb1c(++_0x32b61d);}(_0xe4d6,0xd7));var _0x6e4d=function(_0x4db1ed,_0x29d26b){_0x4db1ed=_0x4db1ed-0x0;var _0xc8dffe=_0xe4d6[_0x4db1ed];return _0xc8dffe;};'use strict';var _=require(_0x6e4d('0x0'));var util=require(_0x6e4d('0x1'));var moment=require(_0x6e4d('0x2'));var BPromise=require(_0x6e4d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6e4d('0x4'));var db=require(_0x6e4d('0x5'))['db'];var utils=require(_0x6e4d('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x6e4d('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x6e4d('0x8')][_0x6e4d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x241d30,_0x907c47,_0x14706a){return new BPromise(function(_0x50f0cc,_0x4ba2fc){return client[_0x6e4d('0xa')](_0x241d30,_0x14706a)[_0x6e4d('0xb')](function(_0x472876){logger['info'](_0x6e4d('0xc'),_0x907c47,'request\x20sent');logger[_0x6e4d('0xd')](_0x6e4d('0xe'),_0x907c47,_0x6e4d('0xf'),JSON[_0x6e4d('0x10')](_0x472876));if(_0x472876['error']){if(_0x472876['error'][_0x6e4d('0x11')]===0x1f4){logger[_0x6e4d('0x12')](_0x6e4d('0xc'),_0x907c47,_0x472876[_0x6e4d('0x12')][_0x6e4d('0x13')]);return _0x4ba2fc(_0x472876[_0x6e4d('0x12')][_0x6e4d('0x13')]);}logger[_0x6e4d('0x12')](_0x6e4d('0xc'),_0x907c47,_0x472876['error'][_0x6e4d('0x13')]);return _0x50f0cc(_0x472876[_0x6e4d('0x12')][_0x6e4d('0x13')]);}else{logger['info']('SmsApplication,\x20%s,\x20%s',_0x907c47,_0x6e4d('0xf'));_0x50f0cc(_0x472876['result'][_0x6e4d('0x13')]);}})[_0x6e4d('0x14')](function(_0x4c792c){logger[_0x6e4d('0x12')]('SmsApplication,\x20%s,\x20%s',_0x907c47,_0x4c792c);_0x4ba2fc(_0x4c792c);});});} \ No newline at end of file diff --git a/server/api/smsInteraction/index.js b/server/api/smsInteraction/index.js index adc6c2d..abe153a 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 _0x52fd=['path','express','Router','../../components/auth/service','../../components/interaction/service','./smsInteraction.controller','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/messages','getMessages','/:id/download','download','post','create','tracked','smsinteraction:addtags','addTags','put','sms','smsinteraction:update','update','delete','smsinteraction:destroy','/:id/tags','removeTags','exports','util'];(function(_0x3cf713,_0x3901a9){var _0x174d42=function(_0x3bff25){while(--_0x3bff25){_0x3cf713['push'](_0x3cf713['shift']());}};_0x174d42(++_0x3901a9);}(_0x52fd,0x1df));var _0xd52f=function(_0x2235bf,_0x3a06a7){_0x2235bf=_0x2235bf-0x0;var _0x4c3a64=_0x52fd[_0x2235bf];return _0x4c3a64;};'use strict';var multer=require('multer');var util=require(_0xd52f('0x0'));var path=require(_0xd52f('0x1'));var timeout=require('connect-timeout');var express=require(_0xd52f('0x2'));var router=express[_0xd52f('0x3')]();var auth=require(_0xd52f('0x4'));var interaction=require(_0xd52f('0x5'));var config=require('../../config/environment');var controller=require(_0xd52f('0x6'));router[_0xd52f('0x7')]('/',auth['isAuthenticated'](),controller[_0xd52f('0x8')]);router[_0xd52f('0x7')](_0xd52f('0x9'),auth[_0xd52f('0xa')](),controller[_0xd52f('0xb')]);router[_0xd52f('0x7')](_0xd52f('0xc'),auth[_0xd52f('0xa')](),controller[_0xd52f('0xd')]);router[_0xd52f('0x7')](_0xd52f('0xe'),auth[_0xd52f('0xa')](),controller[_0xd52f('0xf')]);router[_0xd52f('0x7')](_0xd52f('0x10'),auth[_0xd52f('0xa')](),controller[_0xd52f('0x11')]);router[_0xd52f('0x12')]('/',auth[_0xd52f('0xa')](),controller[_0xd52f('0x13')]);router['post']('/:id/messages',auth[_0xd52f('0xa')](),controller['addMessage']);router[_0xd52f('0x12')]('/:id/tags',auth[_0xd52f('0xa')](),interaction[_0xd52f('0x14')]('sms',_0xd52f('0x15')),controller[_0xd52f('0x16')]);router[_0xd52f('0x17')](_0xd52f('0xc'),auth[_0xd52f('0xa')](),interaction[_0xd52f('0x14')](_0xd52f('0x18'),_0xd52f('0x19')),controller[_0xd52f('0x1a')]);router[_0xd52f('0x1b')](_0xd52f('0xc'),auth[_0xd52f('0xa')](),interaction[_0xd52f('0x14')](_0xd52f('0x18'),_0xd52f('0x1c')),controller['destroy']);router[_0xd52f('0x1b')](_0xd52f('0x1d'),auth['isAuthenticated'](),controller[_0xd52f('0x1e')]);module[_0xd52f('0x1f')]=router; \ No newline at end of file +var _0xc3f3=['/:id/tags','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/messages','getMessages','post','tracked','sms','addTags','update','delete','smsinteraction:destroy'];(function(_0x1952cc,_0x4e5f8c){var _0x290019=function(_0x402416){while(--_0x402416){_0x1952cc['push'](_0x1952cc['shift']());}};_0x290019(++_0x4e5f8c);}(_0xc3f3,0xd2));var _0x3c3f=function(_0x3b5955,_0x37ccb8){_0x3b5955=_0x3b5955-0x0;var _0x54b56b=_0xc3f3[_0x3b5955];return _0x54b56b;};'use strict';var multer=require('multer');var util=require(_0x3c3f('0x0'));var path=require(_0x3c3f('0x1'));var timeout=require(_0x3c3f('0x2'));var express=require(_0x3c3f('0x3'));var router=express[_0x3c3f('0x4')]();var auth=require(_0x3c3f('0x5'));var interaction=require(_0x3c3f('0x6'));var config=require(_0x3c3f('0x7'));var controller=require(_0x3c3f('0x8'));router[_0x3c3f('0x9')]('/',auth[_0x3c3f('0xa')](),controller[_0x3c3f('0xb')]);router[_0x3c3f('0x9')](_0x3c3f('0xc'),auth[_0x3c3f('0xa')](),controller[_0x3c3f('0xd')]);router['get'](_0x3c3f('0xe'),auth[_0x3c3f('0xa')](),controller['show']);router[_0x3c3f('0x9')](_0x3c3f('0xf'),auth[_0x3c3f('0xa')](),controller[_0x3c3f('0x10')]);router[_0x3c3f('0x9')]('/:id/download',auth['isAuthenticated'](),controller['download']);router['post']('/',auth[_0x3c3f('0xa')](),controller['create']);router[_0x3c3f('0x11')](_0x3c3f('0xf'),auth['isAuthenticated'](),controller['addMessage']);router[_0x3c3f('0x11')]('/:id/tags',auth[_0x3c3f('0xa')](),interaction[_0x3c3f('0x12')](_0x3c3f('0x13'),'smsinteraction:addtags'),controller[_0x3c3f('0x14')]);router['put'](_0x3c3f('0xe'),auth[_0x3c3f('0xa')](),interaction['tracked']('sms','smsinteraction:update'),controller[_0x3c3f('0x15')]);router[_0x3c3f('0x16')](_0x3c3f('0xe'),auth[_0x3c3f('0xa')](),interaction[_0x3c3f('0x12')](_0x3c3f('0x13'),_0x3c3f('0x17')),controller['destroy']);router[_0x3c3f('0x16')](_0x3c3f('0x18'),auth[_0x3c3f('0xa')](),controller['removeTags']);module[_0x3c3f('0x19')]=router; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.attributes.js b/server/api/smsInteraction/smsInteraction.attributes.js index 6aca2f4..e2ae22f 100644 --- a/server/api/smsInteraction/smsInteraction.attributes.js +++ b/server/api/smsInteraction/smsInteraction.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbaf0=['DATE','STRING','ENUM','out','moment','exports','BOOLEAN'];(function(_0x3a297d,_0x2ab451){var _0xaca3e5=function(_0x99ed12){while(--_0x99ed12){_0x3a297d['push'](_0x3a297d['shift']());}};_0xaca3e5(++_0x2ab451);}(_0xbaf0,0x12a));var _0x0baf=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xbaf0[_0x19e35c];return _0x3e1fe8;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x0baf('0x0'));module[_0x0baf('0x1')]={'closed':{'type':Sequelize[_0x0baf('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x0baf('0x3')]},'disposition':{'type':Sequelize[_0x0baf('0x4')]},'note':{'type':Sequelize[_0x0baf('0x4')]},'phone':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x0baf('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x0baf('0x5')]('in',_0x0baf('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x0baf('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x0baf('0x5')]('in',_0x0baf('0x6')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file +var _0xe706=['ENUM','out','sequelize','moment','exports','DATE','STRING'];(function(_0x2942bb,_0x10262a){var _0x147670=function(_0x320871){while(--_0x320871){_0x2942bb['push'](_0x2942bb['shift']());}};_0x147670(++_0x10262a);}(_0xe706,0xa3));var _0x6e70=function(_0x202d24,_0x5e8641){_0x202d24=_0x202d24-0x0;var _0x2b3a8e=_0xe706[_0x202d24];return _0x2b3a8e;};'use strict';var Sequelize=require(_0x6e70('0x0'));var moment=require(_0x6e70('0x1'));module[_0x6e70('0x2')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x6e70('0x3')]},'disposition':{'type':Sequelize[_0x6e70('0x4')]},'note':{'type':Sequelize[_0x6e70('0x4')]},'phone':{'type':Sequelize[_0x6e70('0x4')]},'read1stAt':{'type':Sequelize[_0x6e70('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x6e70('0x5')]('in',_0x6e70('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x6e70('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x6e70('0x5')]('in',_0x6e70('0x6')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.controller.js b/server/api/smsInteraction/smsInteraction.controller.js index 04af125..d41dc57 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 _0xa35d=['length','hasOwnProperty','nolimit','order','sort','where','select','field','color','from','tools_tags','u.id','ui.SmsInteractionId','left_join','users','cm_contacts','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','expr','advancedFilter','parse','matchType','omitBy','options','values','value','table','parseOperator','getConditionValue','isRangeCondition','columns','hasMultipleConditions','having','$between','`\x20=\x200','filter','isEmpty','SmsAccountId','i.SmsAccountId\x20IN\x20?','concat','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','replace','i.id\x20LIKE\x20?','split','toString','join','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','i.id','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','DESC','tag','isArray','it.SmsInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','t.id\x20IN\x20?','TagId','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','it.MailInteractionId\x20=\x20i.id','sequelize','keyBy','merge','unreadMessages','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.fax','Contact.fax','GROUP_CONCAT(DISTINCT\x20t.id)','groupBy','SmsInteractionId','rows','intersection','includeAll','create','body','find','params','describe','addMessage','SmsMessage','ids','omit','getMessages','findOne','pick','format','include','findAll','addTags','setTags','spread','emit','removeTags','download','unix','root','files','tmp','server','transcript-%d-%s.zip','Messages','createdAt','direction','secret','User','fullname','CmContact','Owner','get','10px','40px','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
Interaction\x20Transcript
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','30px','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{{page}}/{{pages}}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','mkdirSync','Account','N.A.','closed','closedAt','disposition','YYYY-MM-DD\x20HH:mm:ss','out','System','Contact','firstName','lastName','renderFile','downloadInteraction.html','toFile','.pdf','err','html-pdf','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','./smsInteraction.socket','register','end','json','count','offset','limit','status','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','name','send','Users','map','Tags','TagIds','forEach','push','catch','SmsInteraction','rawAttributes','model','keys','query','filters','attributes','fields'];(function(_0x4a5bf7,_0x1db350){var _0x39b96d=function(_0x29343a){while(--_0x29343a){_0x4a5bf7['push'](_0x4a5bf7['shift']());}};_0x39b96d(++_0x1db350);}(_0xa35d,0x9d));var _0xda35=function(_0x366171,_0x160e18){_0x366171=_0x366171-0x0;var _0x2fb0af=_0xa35d[_0x366171];return _0x2fb0af;};'use strict';var pdf=require(_0xda35('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xda35('0x1'));var zipdir=require(_0xda35('0x2'));var jsonpatch=require(_0xda35('0x3'));var rp=require('request-promise');var moment=require(_0xda35('0x4'));var BPromise=require(_0xda35('0x5'));var Mustache=require(_0xda35('0x6'));var util=require(_0xda35('0x7'));var path=require(_0xda35('0x8'));var sox=require(_0xda35('0x9'));var csv=require(_0xda35('0xa'));var ejs=require(_0xda35('0xb'));var fs=require('fs');var _=require(_0xda35('0xc'));var squel=require('squel');var crypto=require(_0xda35('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xda35('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xda35('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xda35('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xda35('0x10'));var logger=require(_0xda35('0x11'))(_0xda35('0x12'));var utils=require(_0xda35('0x13'));var config=require(_0xda35('0x14'));var db=require('../../mysqldb')['db'];config[_0xda35('0x15')]=_[_0xda35('0x16')](config[_0xda35('0x15')],{'host':_0xda35('0x17'),'port':0x18eb});var socket=require(_0xda35('0x18'))(new Redis(config[_0xda35('0x15')]));require(_0xda35('0x19'))[_0xda35('0x1a')](socket);function respondWithStatusCode(_0xcc408d,_0x16b01e){_0x16b01e=_0x16b01e||0xcc;return function(_0x505b8c){if(_0x505b8c){return _0xcc408d['sendStatus'](_0x16b01e);}return _0xcc408d['status'](_0x16b01e)[_0xda35('0x1b')]();};}function respondWithResult(_0x30b629,_0x2d5407){_0x2d5407=_0x2d5407||0xc8;return function(_0x58b232){if(_0x58b232){return _0x30b629['status'](_0x2d5407)[_0xda35('0x1c')](_0x58b232);}};}function respondWithFilteredResult(_0x3a2de1,_0xabdd8b){return function(_0x235a14){if(_0x235a14){var _0x2b9b74=_0x235a14[_0xda35('0x1d')],_0x112d78=_0xabdd8b[_0xda35('0x1e')],_0x2f95b9=_0xabdd8b[_0xda35('0x1e')]+_0xabdd8b[_0xda35('0x1f')],_0x258303;if(_0x2f95b9>=_0x2b9b74){_0x2f95b9=_0x2b9b74;_0x258303=0xc8;}else{_0x258303=0xce;}_0x3a2de1[_0xda35('0x20')](_0x258303);return _0x3a2de1[_0xda35('0x21')](_0xda35('0x22'),_0x112d78+'-'+_0x2f95b9+'/'+_0x2b9b74)[_0xda35('0x1c')](_0x235a14);}return null;};}function patchUpdates(_0x4d1b66){return function(_0x164bd2){try{jsonpatch[_0xda35('0x23')](_0x164bd2,_0x4d1b66,!![]);}catch(_0x5e7ec9){return BPromise[_0xda35('0x24')](_0x5e7ec9);}return _0x164bd2[_0xda35('0x25')]();};}function saveUpdates(_0x21e7f5,_0x14b47f){return function(_0x39b8a5){if(_0x39b8a5){return _0x39b8a5[_0xda35('0x26')](_0x21e7f5)[_0xda35('0x27')](function(_0x22c4cc){return _0x22c4cc;});}return null;};}function removeEntity(_0x468dfc,_0xc0fe5e){return function(_0x7a4e45){if(_0x7a4e45){return _0x7a4e45[_0xda35('0x28')]()[_0xda35('0x27')](function(){_0x468dfc[_0xda35('0x20')](0xcc)[_0xda35('0x1b')]();});}};}function handleEntityNotFound(_0x20c56b,_0x1a0a52){return function(_0x1cc27a){if(!_0x1cc27a){_0x20c56b[_0xda35('0x29')](0x194);}return _0x1cc27a;};}function handleError(_0x1dffe8,_0x40507f){_0x40507f=_0x40507f||0x1f4;return function(_0x41ffc6){logger['error'](_0x41ffc6['stack']);if(_0x41ffc6[_0xda35('0x2a')]){delete _0x41ffc6[_0xda35('0x2a')];}_0x1dffe8['status'](_0x40507f)[_0xda35('0x2b')](_0x41ffc6);};}function getInteractionUsers(_0x2d338b,_0xaf3442){return new BPromise(function(_0x1499f8,_0x7596c3){try{if(_0xaf3442[_0x2d338b['id']]){_0x2d338b[_0xda35('0x2c')]=_[_0xda35('0x2d')](_0xaf3442[_0x2d338b['id']],function(_0x356c70){return{'id':_0x356c70['id']};});}}catch(_0x5a7e27){_0x7596c3(_0x5a7e27);}_0x1499f8(_0x2d338b);});}function getInteractionTags(_0x519a77,_0x58c30b){return new BPromise(function(_0x18df9e,_0x55a463){try{if(_0x519a77['TagIds']){_0x519a77[_0xda35('0x2e')]=[];_0x519a77[_0xda35('0x2f')]['split'](',')[_0xda35('0x30')](function(_0x5242e0){_0x519a77['Tags'][_0xda35('0x31')](_0x58c30b[_0x5242e0]);});}delete _0x519a77[_0xda35('0x2f')];}catch(_0x4c8f09){_0x55a463(_0x4c8f09);}_0x18df9e(_0x519a77);});}function updateSmsInteraction(_0x9b0835,_0x2a1686,_0x3aebfd){return new BPromise(function(_0x1427e9,_0x4faf8a){return getInteractionUsers(_0x9b0835,_0x3aebfd)[_0xda35('0x27')](function(_0x598405){return getInteractionTags(_0x598405,_0x2a1686);})[_0xda35('0x27')](function(_0x55dfae){_0x1427e9(_0x55dfae);})[_0xda35('0x32')](function(_0x35c1fb){_0x4faf8a(_0x35c1fb);});});}exports['index']=function(_0x4bbcbf,_0x18dc90){var _0x359a38={},_0x1b71ea={},_0x3b2dd1={'count':0x0,'rows':[]};var _0x550735=db[_0xda35('0x33')][_0xda35('0x34')];_0x1b71ea[_0xda35('0x35')]=_[_0xda35('0x36')](_0x550735);_0x1b71ea[_0xda35('0x37')]=_[_0xda35('0x36')](_0x4bbcbf[_0xda35('0x37')]);_0x1b71ea[_0xda35('0x38')]=_['intersection'](_0x1b71ea[_0xda35('0x35')],_0x1b71ea[_0xda35('0x37')]);_0x359a38[_0xda35('0x39')]=_['intersection'](_0x1b71ea['model'],qs[_0xda35('0x3a')](_0x4bbcbf['query']['fields']));_0x359a38[_0xda35('0x39')]=_0x359a38['attributes'][_0xda35('0x3b')]?_0x359a38['attributes']:_0x1b71ea['model'];if(!_0x4bbcbf[_0xda35('0x37')][_0xda35('0x3c')](_0xda35('0x3d'))){_0x359a38[_0xda35('0x1f')]=qs[_0xda35('0x1f')](_0x4bbcbf[_0xda35('0x37')]['limit']);_0x359a38[_0xda35('0x1e')]=qs['offset'](_0x4bbcbf[_0xda35('0x37')][_0xda35('0x1e')]);}_0x359a38[_0xda35('0x3e')]=qs[_0xda35('0x3f')](_0x4bbcbf[_0xda35('0x37')][_0xda35('0x3f')]);_0x359a38[_0xda35('0x40')]=qs[_0xda35('0x38')](_['pick'](_0x4bbcbf['query'],_0x1b71ea[_0xda35('0x38')]));var _0x255472=[];var _0x2dbc95=squel[_0xda35('0x41')]()[_0xda35('0x42')]('id')[_0xda35('0x42')]('name')[_0xda35('0x42')](_0xda35('0x43'))[_0xda35('0x44')](_0xda35('0x45'));var _0x16a98c=squel[_0xda35('0x41')]()['field'](_0xda35('0x46'))[_0xda35('0x42')](_0xda35('0x47'))['from']('user_has_sms_interactions','ui')[_0xda35('0x48')](_0xda35('0x49'),'u','u.id\x20=\x20ui.UserId');var _0x3a8915=squel[_0xda35('0x41')]()['from']('sms_interactions','i')[_0xda35('0x48')](_0xda35('0x4a'),'c',_0xda35('0x4b'))[_0xda35('0x48')]('users','o',_0xda35('0x4c'))[_0xda35('0x48')]('sms_accounts','a',_0xda35('0x4d'))['left_join'](_0xda35('0x4e'),'me',_0xda35('0x4f'));var _0x4ecaf3=squel[_0xda35('0x50')]();var _0x22ee1d=_0x4bbcbf[_0xda35('0x37')][_0xda35('0x51')]?JSON[_0xda35('0x52')](_0x4bbcbf[_0xda35('0x37')]['advancedFilter']):undefined;if(_0x22ee1d){var _0x32c98c=_0x22ee1d[_0xda35('0x53')]['substr'](0x1);_(_0x22ee1d)['omit'](_0xda35('0x53'))[_0xda35('0x54')](function(_0xef8095,_0x46198f){return _0xef8095['options']['custom']===!![];})[_0xda35('0x36')]()['forEach'](function(_0x5dd134){var _0x2ca2f5=_0x22ee1d[_0x5dd134];if(_0x2ca2f5[_0xda35('0x55')]['columns']){var _0x3326b9=squel[_0xda35('0x50')]();if(as['hasMultipleConditions'](_0x2ca2f5['value'])){var _0xb4ec80=_[_0xda35('0x56')](_0x2ca2f5[_0xda35('0x57')])[0x0];_0xb4ec80[_0xda35('0x30')](function(_0x3f691f){_0x2ca2f5[_0xda35('0x55')]['columns'][_0xda35('0x30')](function(_0x388803){_0x3326b9['or'](_0x2ca2f5['options'][_0xda35('0x58')]+'.'+_0x388803+'\x20'+as[_0xda35('0x59')](_0x3f691f),as[_0xda35('0x5a')](_0x3f691f));});});}else{var _0xb6af4c=as[_0xda35('0x5b')](_0x2ca2f5['value'])?_0x2ca2f5[_0xda35('0x57')][0x1]:undefined;_0x2ca2f5[_0xda35('0x55')][_0xda35('0x5c')][_0xda35('0x30')](function(_0x2739a4){_0x3326b9['or'](_0x2ca2f5['options'][_0xda35('0x58')]+'.'+_0x2739a4+'\x20'+as[_0xda35('0x59')](_0x2ca2f5[_0xda35('0x57')]),as[_0xda35('0x5a')](_0x2ca2f5[_0xda35('0x57')]),_0xb6af4c);});}_0x4ecaf3[_0x32c98c](_0x3326b9);}else if(as[_0xda35('0x5d')](_0x2ca2f5[_0xda35('0x57')])){var _0xb4ec80=_[_0xda35('0x56')](_0x2ca2f5['value'])[0x0];_0xb4ec80['forEach'](function(_0x5c11aa){if(!_0x2ca2f5[_0xda35('0x55')][_0xda35('0x5e')]){var _0x14e919=as['isRangeCondition'](_0x5c11aa)?_0x5c11aa[_0xda35('0x5f')][0x1]:undefined;_0x4ecaf3[_0x32c98c](_0x2ca2f5[_0xda35('0x55')][_0xda35('0x58')]+'.'+_0x5dd134+'\x20'+as[_0xda35('0x59')](_0x5c11aa),as['getConditionValue'](_0x5c11aa),_0x14e919);}});}else{if(_0x2ca2f5[_0xda35('0x55')][_0xda35('0x5e')]){var _0x556d31=as[_0xda35('0x5a')](_0x2ca2f5[_0xda35('0x57')]);if(_0x556d31[_0xda35('0x3b')]===0x1){if(_0x556d31==0x1){_0x3a8915[_0xda35('0x5e')]('`'+_0x5dd134+_0xda35('0x60'));}else{_0x3a8915[_0xda35('0x5e')]('`'+_0x5dd134+'`\x20>\x200');}}}else{var _0xb6af4c=as[_0xda35('0x5b')](_0x2ca2f5[_0xda35('0x57')])?_0x2ca2f5['value']['$between'][0x1]:undefined;_0x4ecaf3[_0x32c98c](_0x2ca2f5[_0xda35('0x55')][_0xda35('0x58')]+'.'+_0x5dd134+'\x20'+as[_0xda35('0x59')](_0x2ca2f5[_0xda35('0x57')]),as[_0xda35('0x5a')](_0x2ca2f5['value']),_0xb6af4c);}}});}else{var _0x357b5a=_(Object[_0xda35('0x36')](_0x4bbcbf['query']))['map'](function(_0x376ae4){return _0x550735['hasOwnProperty'](_0x376ae4)?_0x376ae4:undefined;})[_0xda35('0x61')](function(_0x4d785b){return!_['isNil'](_0x4d785b);})[_0xda35('0x57')]();if(!_[_0xda35('0x62')](_0x357b5a)){_0x357b5a[_0xda35('0x30')](function(_0x57efb0){if(_0x57efb0===_0xda35('0x63')){_0x3a8915['where'](_0xda35('0x64'),[][_0xda35('0x65')](_0x4bbcbf[_0xda35('0x37')][_0x57efb0]));}else if(_0x57efb0==='createdAt'){var _0x501159=JSON[_0xda35('0x52')](_0x4bbcbf[_0xda35('0x37')][_0x57efb0])[_0xda35('0x66')];var _0x14a9f0=JSON[_0xda35('0x52')](_0x4bbcbf[_0xda35('0x37')][_0x57efb0])[_0xda35('0x67')];_0x3a8915[_0xda35('0x40')](_0xda35('0x68'),_0x501159,_0x14a9f0);}else{if(_0x4bbcbf[_0xda35('0x37')][_0x57efb0]===_0xda35('0x69')){_0x3a8915[_0xda35('0x40')]('i.'+_0x57efb0+_0xda35('0x6a'));}else{_0x3a8915[_0xda35('0x40')]('i.'+_0x57efb0+_0xda35('0x6b'),_0x4bbcbf[_0xda35('0x37')][_0x57efb0]);}}});}if(_0x4bbcbf['query'][_0xda35('0x6c')]){if(_0x4bbcbf[_0xda35('0x37')][_0xda35('0x6c')]==0x1){_0x3a8915['having'](_0xda35('0x6d'));}else{_0x3a8915['having'](_0xda35('0x6e'));}}if(_0x4bbcbf[_0xda35('0x37')][_0xda35('0x61')]){var _0x5d35fb=_0x4bbcbf['query'][_0xda35('0x61')]['replace']('\x5c','\x5c\x5c')[_0xda35('0x6f')]('\x27\x27','\x27\x27\x27\x27');if(qs['isNumeric'](_0x5d35fb)){_0x4ecaf3['or'](_0xda35('0x70'),_0x5d35fb+'%')['or']('i.phone\x20LIKE\x20?',_0x5d35fb+'%');}else{var _0x4b5f6b=[];_0x5d35fb[_0xda35('0x71')]('\x20')[_0xda35('0x30')](function(_0x5b846b){_0x4b5f6b[_0xda35('0x31')]('+'+_0x5b846b[_0xda35('0x72')]());});var _0x463f74=_0x4b5f6b[_0xda35('0x73')]('\x20');_0x4ecaf3['or'](_0xda35('0x74'),_0x463f74)['or'](_0xda35('0x75'),_0x5d35fb+'%');}}}_0x3a8915[_0xda35('0x40')](_0x4ecaf3);_0x3a8915['group'](_0xda35('0x76'));var _0x4851d5={'type':db[_0xda35('0x77')][_0xda35('0x78')][_0xda35('0x79')],'raw':!![]};var _0x319e0d=_0x3a8915[_0xda35('0x7a')]();_0x319e0d['field'](_0xda35('0x76'));_0x319e0d['field'](_0xda35('0x7b'),'unreadMessages');if(_0x359a38['order']){_0x359a38[_0xda35('0x3e')]['forEach'](function(_0x51aecb){_0x3a8915[_0xda35('0x3e')]('i.'+_0x51aecb[0x0],_0x51aecb[0x1]===_0xda35('0x7c')?![]:!![]);});}var _0x1fb73e=[];var _0x3397de=squel[_0xda35('0x50')]();if(!_0x22ee1d){if(_0x4bbcbf['query'][_0xda35('0x7d')]){_0x1fb73e=_[_0xda35('0x7e')](_0x4bbcbf[_0xda35('0x37')][_0xda35('0x7d')])?_0x4bbcbf[_0xda35('0x37')]['tag']:new Array(_0x4bbcbf[_0xda35('0x37')][_0xda35('0x7d')]);_0x1fb73e[_0xda35('0x30')](function(_0x401793){_0x3397de['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x401793+',%');});_0x3a8915[_0xda35('0x5e')](_0x3397de);_0x319e0d[_0xda35('0x48')]('sms_interaction_has_tags','it',_0xda35('0x7f'));_0x319e0d[_0xda35('0x48')](_0xda35('0x45'),'t',_0xda35('0x80'));_0x319e0d[_0xda35('0x40')](_0xda35('0x81'),_0x1fb73e);}}else{if(_0x22ee1d[_0xda35('0x3c')]('TagId')){if(as[_0xda35('0x5d')](_0x22ee1d[_0xda35('0x82')][_0xda35('0x57')])){var _0x39063f=_['values'](_0x22ee1d['TagId']['value'])[0x0];_0x39063f['forEach'](function(_0x3f667b){as[_0xda35('0x5a')](_0x3f667b)[_0xda35('0x30')](function(_0x18a96a){_0x1fb73e['push'](_0x18a96a);});});}else{_0x1fb73e=as[_0xda35('0x5a')](_0x22ee1d[_0xda35('0x82')][_0xda35('0x57')]);}_0x1fb73e['forEach'](function(_0x28568b){_0x3397de['or'](_0xda35('0x83'),'%,'+_0x28568b+',%');});_0x3a8915[_0xda35('0x5e')](_0x3397de);_0x319e0d[_0xda35('0x48')]('mail_interaction_has_tags','it',_0xda35('0x84'));_0x319e0d[_0xda35('0x48')]('tools_tags','t',_0xda35('0x80'));_0x319e0d['where'](_0xda35('0x81'),_0x1fb73e);}}db[_0xda35('0x85')]['query'](_0x319e0d[_0xda35('0x72')](),_0x4851d5)[_0xda35('0x27')](function(_0x436c30){_0x3b2dd1[_0xda35('0x1d')]=_0x436c30['length'];if(_0x3b2dd1[_0xda35('0x1d')]===0x0)return[];return db[_0xda35('0x85')][_0xda35('0x37')](_0x2dbc95[_0xda35('0x72')](),_0x4851d5)['then'](function(_0x381ba1){_0x255472=_[_0xda35('0x86')](_0x381ba1,'id');_0x4851d5=_[_0xda35('0x87')](_0x4851d5,{'model':db[_0xda35('0x33')],'mapToModel':!![],'raw':!![],'nest':!![]});_0x3a8915['field']('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xda35('0x88'));_0x3a8915[_0xda35('0x42')](_0xda35('0x89'),_0xda35('0x8a'));_0x3a8915[_0xda35('0x42')](_0xda35('0x8b'),_0xda35('0x8c'));_0x3a8915['field'](_0xda35('0x8d'));_0x3a8915[_0xda35('0x42')](_0xda35('0x8e'),_0xda35('0x8f'));_0x3a8915[_0xda35('0x42')](_0xda35('0x90'),_0xda35('0x91'));_0x3a8915[_0xda35('0x42')](_0xda35('0x92'),_0xda35('0x93'));_0x3a8915['field'](_0xda35('0x94'),_0xda35('0x95'));_0x3a8915[_0xda35('0x42')]('c.mobile','Contact.mobile');_0x3a8915[_0xda35('0x42')](_0xda35('0x96'),_0xda35('0x97'));_0x3a8915[_0xda35('0x42')](_0xda35('0x98'),_0xda35('0x2f'));_0x3a8915['left_join']('sms_interaction_has_tags','it',_0xda35('0x7f'));_0x3a8915[_0xda35('0x48')](_0xda35('0x45'),'t','t.id\x20=\x20it.TagId');_0x3a8915[_0xda35('0x1f')](_0x359a38[_0xda35('0x1f')]);_0x3a8915[_0xda35('0x1e')](_0x359a38[_0xda35('0x1e')]);return db[_0xda35('0x85')][_0xda35('0x37')](_0x3a8915['toString'](),_0x4851d5);})[_0xda35('0x27')](function(_0x20ca14){_0x16a98c[_0xda35('0x40')]('ui.SmsInteractionId\x20IN\x20?',_[_0xda35('0x2d')](_0x20ca14,'id'));return db[_0xda35('0x85')][_0xda35('0x37')](_0x16a98c[_0xda35('0x72')](),_0x4851d5)['then'](function(_0x1fbb52){var _0x263f26=_[_0xda35('0x99')](_0x1fbb52,_0xda35('0x9a'));var _0x1ce76a=[];_0x20ca14[_0xda35('0x30')](function(_0x3b45e2){_0x1ce76a[_0xda35('0x31')](updateSmsInteraction(_0x3b45e2,_0x255472,_0x263f26));});return BPromise['all'](_0x1ce76a);});});})[_0xda35('0x27')](function(_0x4d11ff){_0x3b2dd1[_0xda35('0x9b')]=_0x4d11ff;return _0x3b2dd1;})[_0xda35('0x27')](respondWithFilteredResult(_0x18dc90,_0x359a38))[_0xda35('0x32')](handleError(_0x18dc90,null));};exports['show']=function(_0x2432ca,_0x1f856e){var _0x2876c3={'raw':![],'where':{'id':_0x2432ca['params']['id']}},_0x40a988={};_0x40a988[_0xda35('0x35')]=_[_0xda35('0x36')](db[_0xda35('0x33')][_0xda35('0x34')]);_0x40a988['query']=_[_0xda35('0x36')](_0x2432ca['query']);_0x40a988[_0xda35('0x38')]=_[_0xda35('0x9c')](_0x40a988[_0xda35('0x35')],_0x40a988['query']);_0x2876c3[_0xda35('0x39')]=_[_0xda35('0x9c')](_0x40a988['model'],qs[_0xda35('0x3a')](_0x2432ca[_0xda35('0x37')][_0xda35('0x3a')]));_0x2876c3[_0xda35('0x39')]=_0x2876c3[_0xda35('0x39')][_0xda35('0x3b')]?_0x2876c3[_0xda35('0x39')]:_0x40a988['model'];if(_0x2432ca[_0xda35('0x37')][_0xda35('0x9d')]){_0x2876c3['include']=[{'all':!![]}];}_0x2876c3=_[_0xda35('0x87')]({},_0x2876c3,_0x2432ca['options']);return db[_0xda35('0x33')]['find'](_0x2876c3)[_0xda35('0x27')](handleEntityNotFound(_0x1f856e,null))[_0xda35('0x27')](respondWithResult(_0x1f856e,null))[_0xda35('0x32')](handleError(_0x1f856e,null));};exports['create']=function(_0x34535a,_0x67367a){return db[_0xda35('0x33')][_0xda35('0x9e')](_0x34535a[_0xda35('0x9f')],{})['then'](respondWithResult(_0x67367a,0xc9))[_0xda35('0x32')](handleError(_0x67367a,null));};exports[_0xda35('0x26')]=function(_0x2996cd,_0x3dca35){if(_0x2996cd[_0xda35('0x9f')]['id']){delete _0x2996cd['body']['id'];}return db[_0xda35('0x33')][_0xda35('0xa0')]({'where':{'id':_0x2996cd[_0xda35('0xa1')]['id']}})[_0xda35('0x27')](handleEntityNotFound(_0x3dca35,null))[_0xda35('0x27')](saveUpdates(_0x2996cd[_0xda35('0x9f')],null))[_0xda35('0x27')](respondWithResult(_0x3dca35,null))[_0xda35('0x32')](handleError(_0x3dca35,null));};exports[_0xda35('0x28')]=function(_0x257e5a,_0x2e5b24){return db[_0xda35('0x33')][_0xda35('0xa0')]({'where':{'id':_0x257e5a[_0xda35('0xa1')]['id']}})[_0xda35('0x27')](handleEntityNotFound(_0x2e5b24,null))[_0xda35('0x27')](removeEntity(_0x2e5b24,null))['catch'](handleError(_0x2e5b24,null));};exports[_0xda35('0xa2')]=function(_0x370a61,_0xbed217){return db[_0xda35('0x33')][_0xda35('0xa2')]()[_0xda35('0x27')](respondWithResult(_0xbed217,null))[_0xda35('0x32')](handleError(_0xbed217,null));};exports[_0xda35('0xa3')]=function(_0x1046b1,_0x211919,_0x324ddf){return db[_0xda35('0xa4')][_0xda35('0xa0')]({'where':{'id':_0x1046b1[_0xda35('0xa1')]['id']}})['then'](handleEntityNotFound(_0x211919,null))['then'](function(_0x25151e){if(_0x25151e){return _0x25151e['addMessage'](_0x1046b1['body'][_0xda35('0xa5')],_[_0xda35('0xa6')](_0x1046b1[_0xda35('0x9f')],[_0xda35('0xa5'),'id'])||{});}})[_0xda35('0x27')](respondWithResult(_0x211919,null))['catch'](handleError(_0x211919,null));};exports[_0xda35('0xa7')]=function(_0x40c985,_0x531463,_0x3c3e6a){var _0x964b5={'raw':![],'where':{}};var _0x2b4165={};var _0x2de076={'count':0x0,'rows':[]};return db[_0xda35('0x33')][_0xda35('0xa8')]({'where':{'id':_0x40c985[_0xda35('0xa1')]['id']}})['then'](handleEntityNotFound(_0x531463,null))[_0xda35('0x27')](function(_0x2586fa){if(_0x2586fa){_0x2b4165[_0xda35('0x35')]=_[_0xda35('0x36')](db[_0xda35('0xa4')][_0xda35('0x34')]);_0x2b4165['query']=_['keys'](_0x40c985[_0xda35('0x37')]);_0x2b4165[_0xda35('0x38')]=_['intersection'](_0x2b4165[_0xda35('0x35')],_0x2b4165[_0xda35('0x37')]);_0x964b5[_0xda35('0x39')]=_[_0xda35('0x9c')](_0x2b4165[_0xda35('0x35')],qs[_0xda35('0x3a')](_0x40c985[_0xda35('0x37')][_0xda35('0x3a')]));_0x964b5[_0xda35('0x39')]=_0x964b5[_0xda35('0x39')]['length']?_0x964b5[_0xda35('0x39')]:_0x2b4165[_0xda35('0x35')];if(!_0x40c985[_0xda35('0x37')][_0xda35('0x3c')]('nolimit')){_0x964b5[_0xda35('0x1f')]=qs[_0xda35('0x1f')](_0x40c985[_0xda35('0x37')][_0xda35('0x1f')]);_0x964b5['offset']=qs[_0xda35('0x1e')](_0x40c985['query'][_0xda35('0x1e')]);}_0x964b5[_0xda35('0x3e')]=qs[_0xda35('0x3f')](_0x40c985['query'][_0xda35('0x3f')]);_0x964b5[_0xda35('0x40')]=qs[_0xda35('0x38')](_[_0xda35('0xa9')](_0x40c985[_0xda35('0x37')],_0x2b4165[_0xda35('0x38')]));_0x964b5[_0xda35('0x40')][_0xda35('0x9a')]=_0x2586fa['id'];if(_0x40c985[_0xda35('0x37')]['filter']){_0x964b5[_0xda35('0x40')]=_[_0xda35('0x87')](_0x964b5[_0xda35('0x40')],{'$or':_[_0xda35('0x2d')](_0x964b5[_0xda35('0x39')],function(_0x568bc1){var _0x45d458={};_0x45d458[_0x568bc1]={'$like':'%'+_0x40c985[_0xda35('0x37')][_0xda35('0x61')]+'%'};return _0x45d458;})});}if(_0x40c985['query'][_0xda35('0x66')]){var _0x3af98a=_0x40c985[_0xda35('0x37')]['$gte'][_0xda35('0x71')](',');var _0x1b2303={};_0x1b2303[_0x3af98a[0x0]]={'$gte':moment(_0x3af98a[0x1])[_0xda35('0xaa')]('YYYY-MM-DD\x20HH:mm:ss')};_0x964b5['where']=_['merge'](_0x964b5[_0xda35('0x40')],_0x1b2303);}_0x964b5=_[_0xda35('0x87')]({},_0x964b5,_0x40c985['options']);return db['SmsMessage'][_0xda35('0x1d')]({'where':_0x964b5['where']})[_0xda35('0x27')](function(_0x2e4245){_0x2de076[_0xda35('0x1d')]=_0x2e4245;if(_0x40c985['query']['includeAll']){_0x964b5[_0xda35('0xab')]=[{'all':!![]}];}return db[_0xda35('0xa4')][_0xda35('0xac')](_0x964b5);})[_0xda35('0x27')](function(_0x5471c1){_0x2de076[_0xda35('0x9b')]=_0x5471c1;return _0x2de076;});}})[_0xda35('0x27')](respondWithFilteredResult(_0x531463,_0x964b5))[_0xda35('0x32')](handleError(_0x531463,null));};exports[_0xda35('0xad')]=function(_0x49d1e0,_0x207d8b,_0x260fff){return db[_0xda35('0x33')][_0xda35('0xa0')]({'where':{'id':_0x49d1e0[_0xda35('0xa1')]['id']}})[_0xda35('0x27')](handleEntityNotFound(_0x207d8b,null))[_0xda35('0x27')](function(_0x1e7128){if(_0x1e7128){return _0x1e7128[_0xda35('0xae')](_0x49d1e0[_0xda35('0x9f')]['ids'],_['omit'](_0x49d1e0[_0xda35('0x9f')],[_0xda35('0xa5'),'id'])||{})[_0xda35('0xaf')](function(){return db['Tag'][_0xda35('0xac')]({'attributes':['id',_0xda35('0x2a'),_0xda35('0x43')],'where':{'id':_0x49d1e0[_0xda35('0x9f')]['ids']}});})['then'](function(_0x1c9534){socket[_0xda35('0xb0')]('smsInteractionTags:save',{'id':Number(_0x49d1e0[_0xda35('0xa1')]['id']),'tags':_0x1c9534||[]});return{'id':Number(_0x49d1e0['params']['id']),'tags':_0x1c9534||[]};});}})[_0xda35('0x27')](respondWithResult(_0x207d8b,null))['catch'](handleError(_0x207d8b,null));};exports[_0xda35('0xb1')]=function(_0x58e3a5,_0x572923,_0xd34ba2){return db['SmsInteraction'][_0xda35('0xa0')]({'where':{'id':_0x58e3a5[_0xda35('0xa1')]['id']}})['then'](handleEntityNotFound(_0x572923,null))['then'](function(_0x1c85b0){if(_0x1c85b0){return _0x1c85b0[_0xda35('0xb1')](_0x58e3a5['query'][_0xda35('0xa5')]);}})[_0xda35('0x27')](respondWithStatusCode(_0x572923,null))[_0xda35('0x32')](handleError(_0x572923,null));};exports[_0xda35('0xb2')]=function(_0xe01197,_0x58fad1){var _0x5326ca=moment()[_0xda35('0xb3')]()[_0xda35('0x72')]();var _0x6569d5=path[_0xda35('0x73')](config[_0xda35('0xb4')],'server',_0xda35('0xb5'),_0xda35('0xb6'));var _0x562a7a=path[_0xda35('0x73')](config[_0xda35('0xb4')],_0xda35('0xb7'),_0xda35('0xb5'),'attachments');var _0x11f014=path[_0xda35('0x73')](_0x6569d5,_0x5326ca);var _0x6dd346=util[_0xda35('0xaa')](_0xda35('0xb8'),_0xe01197[_0xda35('0xa1')]['id'],_0x5326ca);var _0x525a57=path[_0xda35('0x73')](_0x6569d5,_0x6dd346);var _0x2a2454=![];return db[_0xda35('0x33')][_0xda35('0xa0')]({'where':{'id':_0xe01197[_0xda35('0xa1')]['id']},'include':[{'model':db[_0xda35('0xa4')],'as':_0xda35('0xb9'),'attributes':['id',_0xda35('0x9f'),_0xda35('0xba'),_0xda35('0xbb'),_0xda35('0xbc'),_0xda35('0x6c')],'include':[{'model':db[_0xda35('0xbd')],'as':_0xda35('0xbd'),'attributes':['id',_0xda35('0xbe')],'raw':!![]},{'model':db[_0xda35('0xbf')],'as':'Contact','attributes':['id','firstName','lastName'],'raw':!![]}]},{'model':db['SmsAccount'],'as':'Account','attributes':['id',_0xda35('0x2a')]},{'model':db[_0xda35('0xbd')],'as':_0xda35('0xc0'),'attributes':['id',_0xda35('0xbe')]}]})[_0xda35('0x27')](handleEntityNotFound(_0x58fad1,null))[_0xda35('0x27')](function(_0x36fe7c){if(_0x36fe7c){var _0x277d69=_0x36fe7c[_0xda35('0xc1')]({'plain':!![]});_0x2a2454=!![];var _0x56f63b={'format':'A4','border':_0xda35('0xc2'),'header':{'height':_0xda35('0xc3'),'contents':{'first':_0xda35('0xc4')}},'footer':{'height':_0xda35('0xc5'),'contents':{'default':util[_0xda35('0xaa')](_0xda35('0xc6'),util[_0xda35('0xaa')]('%s\x20#%d','Sms',_0x277d69['id']),moment()[_0xda35('0xaa')]('YYYY-MM-DD')[_0xda35('0x72')]())}}};fs[_0xda35('0xc7')](_0x11f014);var _0x4213cb={'channel':'Sms','account':_0x277d69[_0xda35('0xc8')][_0xda35('0x2a')],'agent':_0x277d69[_0xda35('0xc0')]?_0x277d69[_0xda35('0xc0')][_0xda35('0xbe')]:_0xda35('0xc9'),'createdAt':moment(_0x277d69['createdAt'])[_0xda35('0xaa')]('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'closedAt':_0x277d69[_0xda35('0xca')]?moment(_0x277d69[_0xda35('0xcb')])[_0xda35('0xaa')]('YYYY-MM-DD\x20HH:mm:ss')[_0xda35('0x72')]():'','disposition':_0x277d69[_0xda35('0xcc')],'messages':_(_0x277d69['Messages'])[_0xda35('0x61')]({'secret':![]})[_0xda35('0x2d')](function(_0x213c18){return{'date':moment(_0x213c18['createdAt'])[_0xda35('0xaa')](_0xda35('0xcd'))['toString'](),'sender':_0x213c18[_0xda35('0xbb')]===_0xda35('0xce')?_0x213c18[_0xda35('0xbd')]?_0x213c18[_0xda35('0xbd')]['fullname']:_0xda35('0xcf'):_0x213c18[_0xda35('0xd0')][_0xda35('0xd1')]+(_0x213c18[_0xda35('0xd0')][_0xda35('0xd2')]?'\x20'+_0x213c18[_0xda35('0xd0')]['lastName']:''),'body':_0x213c18['body'],'direction':_0x213c18['direction']===_0xda35('0xce')?'A':'C','secret':_0x213c18[_0xda35('0xbc')],'read':_0x213c18[_0xda35('0x6c')]};})['value']()};return ejs[_0xda35('0xd3')](path['join'](config[_0xda35('0xb4')],_0xda35('0xb7'),'views',_0xda35('0xd4')),{'interaction':_0x4213cb})[_0xda35('0x27')](function(_0x15ca1d){return new BPromise(function(_0x52bf09,_0x363a59){pdf[_0xda35('0x9e')](_0x15ca1d,_0x56f63b)[_0xda35('0xd5')](path[_0xda35('0x73')](_0x11f014,'transcript-'+_0x277d69['id']+'-'+_0x5326ca+_0xda35('0xd6')),function(_0x52f0ef,_0x110b90){if(_0x52f0ef)return _0x363a59(_0x52f0ef);_0x52bf09(_0x110b90);});});});}})[_0xda35('0x27')](function(){if(_0x2a2454){return new BPromise(function(_0x108e27,_0x42be82){zipdir(_0x11f014,{'saveTo':_0x525a57},function(_0x2981e6,_0x4bfc85){if(_0x2981e6)return _0x42be82(_0x2981e6);return _0x108e27(_0x4bfc85);});})[_0xda35('0x27')](function(){return new BPromise(function(_0x30b947,_0xebbe03){rimraf(_0x11f014,function(_0x10fc98){if(_0x10fc98)_0xebbe03(_0x10fc98);return _0x30b947();});});})['then'](function(){return _0x58fad1['download'](_0x525a57,_0x6dd346,function(_0x205fa6){if(_0x205fa6){console['log'](_0xda35('0xd7'),_0x205fa6);}else{fs['unlinkSync'](_0x525a57);}});});}else{return _0x58fad1['sendStatus'](0xc8);}})[_0xda35('0x32')](handleError(_0x58fad1,null));}; \ No newline at end of file +var _0x036b=['../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./smsInteraction.socket','sendStatus','end','status','json','count','Content-Range','apply','reject','update','destroy','then','error','stack','name','send','Users','map','TagIds','Tags','split','forEach','push','catch','SmsInteraction','model','keys','query','filters','intersection','attributes','fields','nolimit','limit','offset','order','sort','select','field','from','u.id','ui.SmsInteractionId','user_has_sms_interactions','left_join','users','u.id\x20=\x20ui.UserId','sms_interactions','cm_contacts','o.id\x20=\x20i.UserId','a.id\x20=\x20i.SmsAccountId','me.SmsInteractionId\x20=\x20i.id','expr','parse','matchType','omit','omitBy','options','custom','columns','hasMultipleConditions','value','values','table','parseOperator','getConditionValue','isRangeCondition','having','$between','length','`\x20=\x200','`\x20>\x200','hasOwnProperty','filter','isEmpty','SmsAccountId','where','i.SmsAccountId\x20IN\x20?','$gte','null','\x20IS\x20NULL','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','replace','\x27\x27\x27\x27','isNumeric','i.id\x20LIKE\x20?','i.phone\x20LIKE\x20?','toString','join','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','i.id','Sequelize','QueryTypes','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','DESC','tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','sms_interaction_has_tags','it.SmsInteractionId\x20=\x20i.id','tools_tags','t.id\x20=\x20it.TagId','t.id\x20IN\x20?','TagId','sequelize','keyBy','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','i.*','Contact.firstName','c.lastName','Contact.lastName','Contact.email','c.phone','c.mobile','Contact.fax','GROUP_CONCAT(DISTINCT\x20t.id)','ui.SmsInteractionId\x20IN\x20?','all','rows','params','rawAttributes','includeAll','include','merge','find','create','body','describe','SmsMessage','addMessage','ids','getMessages','format','YYYY-MM-DD\x20HH:mm:ss','findAll','addTags','setTags','Tag','color','emit','smsInteractionTags:save','removeTags','unix','root','server','files','tmp','attachments','transcript-%d-%s.zip','direction','secret','User','Contact','Account','Owner','fullname','get','40px','30px','Sms','YYYY-MM-DD','mkdirSync','N.A.','createdAt','closedAt','disposition','Messages','out','System','firstName','lastName','renderFile','views','toFile','transcript-','download','unlinkSync','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api'];(function(_0x2d5125,_0x2df756){var _0x84e213=function(_0x5deaaa){while(--_0x5deaaa){_0x2d5125['push'](_0x2d5125['shift']());}};_0x84e213(++_0x2df756);}(_0x036b,0x190));var _0xb036=function(_0xd9baeb,_0x4647da){_0xd9baeb=_0xd9baeb-0x0;var _0xf4921d=_0x036b[_0xd9baeb];return _0xf4921d;};'use strict';var pdf=require(_0xb036('0x0'));var emlformat=require(_0xb036('0x1'));var rimraf=require(_0xb036('0x2'));var zipdir=require(_0xb036('0x3'));var jsonpatch=require(_0xb036('0x4'));var rp=require(_0xb036('0x5'));var moment=require(_0xb036('0x6'));var BPromise=require('bluebird');var Mustache=require(_0xb036('0x7'));var util=require('util');var path=require(_0xb036('0x8'));var sox=require('sox');var csv=require(_0xb036('0x9'));var ejs=require(_0xb036('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0xb036('0xb'));var crypto=require(_0xb036('0xc'));var jsforce=require(_0xb036('0xd'));var deskjs=require(_0xb036('0xe'));var toCsv=require(_0xb036('0x9'));var querystring=require(_0xb036('0xf'));var Papa=require(_0xb036('0x10'));var Redis=require(_0xb036('0x11'));var authService=require(_0xb036('0x12'));var qs=require(_0xb036('0x13'));var as=require(_0xb036('0x14'));var hardwareService=require(_0xb036('0x15'));var logger=require(_0xb036('0x16'))(_0xb036('0x17'));var utils=require(_0xb036('0x18'));var config=require(_0xb036('0x19'));var db=require(_0xb036('0x1a'))['db'];config[_0xb036('0x1b')]=_[_0xb036('0x1c')](config[_0xb036('0x1b')],{'host':'localhost','port':0x18eb});var socket=require(_0xb036('0x1d'))(new Redis(config['redis']));require(_0xb036('0x1e'))['register'](socket);function respondWithStatusCode(_0x3a442f,_0x1bfe06){_0x1bfe06=_0x1bfe06||0xcc;return function(_0x5827a6){if(_0x5827a6){return _0x3a442f[_0xb036('0x1f')](_0x1bfe06);}return _0x3a442f['status'](_0x1bfe06)[_0xb036('0x20')]();};}function respondWithResult(_0x469981,_0x24b63a){_0x24b63a=_0x24b63a||0xc8;return function(_0x39d0bd){if(_0x39d0bd){return _0x469981[_0xb036('0x21')](_0x24b63a)[_0xb036('0x22')](_0x39d0bd);}};}function respondWithFilteredResult(_0x5e71d6,_0x571479){return function(_0x4d1e8b){if(_0x4d1e8b){var _0x9fbad5=_0x4d1e8b[_0xb036('0x23')],_0x24b37b=_0x571479['offset'],_0x5127fd=_0x571479['offset']+_0x571479['limit'],_0xa30139;if(_0x5127fd>=_0x9fbad5){_0x5127fd=_0x9fbad5;_0xa30139=0xc8;}else{_0xa30139=0xce;}_0x5e71d6['status'](_0xa30139);return _0x5e71d6['set'](_0xb036('0x24'),_0x24b37b+'-'+_0x5127fd+'/'+_0x9fbad5)['json'](_0x4d1e8b);}return null;};}function patchUpdates(_0x3a69b4){return function(_0x26f770){try{jsonpatch[_0xb036('0x25')](_0x26f770,_0x3a69b4,!![]);}catch(_0x11e6e2){return BPromise[_0xb036('0x26')](_0x11e6e2);}return _0x26f770['save']();};}function saveUpdates(_0x1ecf01,_0x1871dd){return function(_0x4a1c0e){if(_0x4a1c0e){return _0x4a1c0e[_0xb036('0x27')](_0x1ecf01)['then'](function(_0x131de3){return _0x131de3;});}return null;};}function removeEntity(_0x4a931d,_0x76a83c){return function(_0xac6096){if(_0xac6096){return _0xac6096[_0xb036('0x28')]()[_0xb036('0x29')](function(){_0x4a931d[_0xb036('0x21')](0xcc)['end']();});}};}function handleEntityNotFound(_0x385a85,_0x9dcc61){return function(_0xe3bec8){if(!_0xe3bec8){_0x385a85[_0xb036('0x1f')](0x194);}return _0xe3bec8;};}function handleError(_0x25a7d6,_0x22a1e1){_0x22a1e1=_0x22a1e1||0x1f4;return function(_0x23f713){logger[_0xb036('0x2a')](_0x23f713[_0xb036('0x2b')]);if(_0x23f713[_0xb036('0x2c')]){delete _0x23f713[_0xb036('0x2c')];}_0x25a7d6[_0xb036('0x21')](_0x22a1e1)[_0xb036('0x2d')](_0x23f713);};}function getInteractionUsers(_0x8d0181,_0x7c1e67){return new BPromise(function(_0x40d2c1,_0xf5c5ad){try{if(_0x7c1e67[_0x8d0181['id']]){_0x8d0181[_0xb036('0x2e')]=_[_0xb036('0x2f')](_0x7c1e67[_0x8d0181['id']],function(_0x4bcc9a){return{'id':_0x4bcc9a['id']};});}}catch(_0x540a4c){_0xf5c5ad(_0x540a4c);}_0x40d2c1(_0x8d0181);});}function getInteractionTags(_0x344eed,_0x18d6f6){return new BPromise(function(_0xe8752b,_0x390440){try{if(_0x344eed[_0xb036('0x30')]){_0x344eed[_0xb036('0x31')]=[];_0x344eed[_0xb036('0x30')][_0xb036('0x32')](',')[_0xb036('0x33')](function(_0x446e6c){_0x344eed[_0xb036('0x31')][_0xb036('0x34')](_0x18d6f6[_0x446e6c]);});}delete _0x344eed['TagIds'];}catch(_0x2a383a){_0x390440(_0x2a383a);}_0xe8752b(_0x344eed);});}function updateSmsInteraction(_0x5de540,_0x1b9554,_0x3bdfbf){return new BPromise(function(_0x248fd8,_0x369da2){return getInteractionUsers(_0x5de540,_0x3bdfbf)['then'](function(_0x573153){return getInteractionTags(_0x573153,_0x1b9554);})[_0xb036('0x29')](function(_0x4c1646){_0x248fd8(_0x4c1646);})[_0xb036('0x35')](function(_0x520d1d){_0x369da2(_0x520d1d);});});}exports['index']=function(_0x567d9c,_0x3fe9d2){var _0x421c54={},_0x4475f6={},_0x53925b={'count':0x0,'rows':[]};var _0x1cb817=db[_0xb036('0x36')]['rawAttributes'];_0x4475f6[_0xb036('0x37')]=_[_0xb036('0x38')](_0x1cb817);_0x4475f6['query']=_[_0xb036('0x38')](_0x567d9c[_0xb036('0x39')]);_0x4475f6[_0xb036('0x3a')]=_[_0xb036('0x3b')](_0x4475f6['model'],_0x4475f6[_0xb036('0x39')]);_0x421c54[_0xb036('0x3c')]=_[_0xb036('0x3b')](_0x4475f6[_0xb036('0x37')],qs['fields'](_0x567d9c[_0xb036('0x39')][_0xb036('0x3d')]));_0x421c54['attributes']=_0x421c54[_0xb036('0x3c')]['length']?_0x421c54[_0xb036('0x3c')]:_0x4475f6['model'];if(!_0x567d9c[_0xb036('0x39')]['hasOwnProperty'](_0xb036('0x3e'))){_0x421c54[_0xb036('0x3f')]=qs[_0xb036('0x3f')](_0x567d9c['query'][_0xb036('0x3f')]);_0x421c54['offset']=qs[_0xb036('0x40')](_0x567d9c['query'][_0xb036('0x40')]);}_0x421c54[_0xb036('0x41')]=qs[_0xb036('0x42')](_0x567d9c[_0xb036('0x39')]['sort']);_0x421c54['where']=qs['filters'](_['pick'](_0x567d9c['query'],_0x4475f6[_0xb036('0x3a')]));var _0x187349=[];var _0x49bdd9=squel[_0xb036('0x43')]()[_0xb036('0x44')]('id')[_0xb036('0x44')](_0xb036('0x2c'))['field']('color')[_0xb036('0x45')]('tools_tags');var _0x2a215d=squel[_0xb036('0x43')]()[_0xb036('0x44')](_0xb036('0x46'))[_0xb036('0x44')](_0xb036('0x47'))[_0xb036('0x45')](_0xb036('0x48'),'ui')[_0xb036('0x49')](_0xb036('0x4a'),'u',_0xb036('0x4b'));var _0x5c672f=squel[_0xb036('0x43')]()[_0xb036('0x45')](_0xb036('0x4c'),'i')[_0xb036('0x49')](_0xb036('0x4d'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0xb036('0x49')](_0xb036('0x4a'),'o',_0xb036('0x4e'))[_0xb036('0x49')]('sms_accounts','a',_0xb036('0x4f'))[_0xb036('0x49')]('sms_messages','me',_0xb036('0x50'));var _0x41261b=squel[_0xb036('0x51')]();var _0x5974eb=_0x567d9c['query']['advancedFilter']?JSON[_0xb036('0x52')](_0x567d9c['query']['advancedFilter']):undefined;if(_0x5974eb){var _0x151e8e=_0x5974eb[_0xb036('0x53')]['substr'](0x1);_(_0x5974eb)[_0xb036('0x54')](_0xb036('0x53'))[_0xb036('0x55')](function(_0x2c0ed2,_0x49ec84){return _0x2c0ed2[_0xb036('0x56')][_0xb036('0x57')]===!![];})[_0xb036('0x38')]()[_0xb036('0x33')](function(_0x47a8f0){var _0x5d56c1=_0x5974eb[_0x47a8f0];if(_0x5d56c1['options'][_0xb036('0x58')]){var _0x50a50f=squel[_0xb036('0x51')]();if(as[_0xb036('0x59')](_0x5d56c1[_0xb036('0x5a')])){var _0x1f0e1f=_[_0xb036('0x5b')](_0x5d56c1[_0xb036('0x5a')])[0x0];_0x1f0e1f[_0xb036('0x33')](function(_0x43bc33){_0x5d56c1[_0xb036('0x56')][_0xb036('0x58')]['forEach'](function(_0x40a77d){_0x50a50f['or'](_0x5d56c1[_0xb036('0x56')][_0xb036('0x5c')]+'.'+_0x40a77d+'\x20'+as[_0xb036('0x5d')](_0x43bc33),as[_0xb036('0x5e')](_0x43bc33));});});}else{var _0x4cfd42=as[_0xb036('0x5f')](_0x5d56c1[_0xb036('0x5a')])?_0x5d56c1[_0xb036('0x5a')][0x1]:undefined;_0x5d56c1['options'][_0xb036('0x58')][_0xb036('0x33')](function(_0x2d48c9){_0x50a50f['or'](_0x5d56c1[_0xb036('0x56')][_0xb036('0x5c')]+'.'+_0x2d48c9+'\x20'+as[_0xb036('0x5d')](_0x5d56c1[_0xb036('0x5a')]),as[_0xb036('0x5e')](_0x5d56c1[_0xb036('0x5a')]),_0x4cfd42);});}_0x41261b[_0x151e8e](_0x50a50f);}else if(as[_0xb036('0x59')](_0x5d56c1[_0xb036('0x5a')])){var _0x1f0e1f=_[_0xb036('0x5b')](_0x5d56c1['value'])[0x0];_0x1f0e1f[_0xb036('0x33')](function(_0xa1e22a){if(!_0x5d56c1[_0xb036('0x56')][_0xb036('0x60')]){var _0x47f822=as[_0xb036('0x5f')](_0xa1e22a)?_0xa1e22a[_0xb036('0x61')][0x1]:undefined;_0x41261b[_0x151e8e](_0x5d56c1[_0xb036('0x56')][_0xb036('0x5c')]+'.'+_0x47a8f0+'\x20'+as[_0xb036('0x5d')](_0xa1e22a),as[_0xb036('0x5e')](_0xa1e22a),_0x47f822);}});}else{if(_0x5d56c1[_0xb036('0x56')][_0xb036('0x60')]){var _0x434173=as['getConditionValue'](_0x5d56c1[_0xb036('0x5a')]);if(_0x434173[_0xb036('0x62')]===0x1){if(_0x434173==0x1){_0x5c672f[_0xb036('0x60')]('`'+_0x47a8f0+_0xb036('0x63'));}else{_0x5c672f[_0xb036('0x60')]('`'+_0x47a8f0+_0xb036('0x64'));}}}else{var _0x4cfd42=as['isRangeCondition'](_0x5d56c1[_0xb036('0x5a')])?_0x5d56c1[_0xb036('0x5a')][_0xb036('0x61')][0x1]:undefined;_0x41261b[_0x151e8e](_0x5d56c1['options'][_0xb036('0x5c')]+'.'+_0x47a8f0+'\x20'+as[_0xb036('0x5d')](_0x5d56c1[_0xb036('0x5a')]),as[_0xb036('0x5e')](_0x5d56c1[_0xb036('0x5a')]),_0x4cfd42);}}});}else{var _0x81ac9e=_(Object[_0xb036('0x38')](_0x567d9c[_0xb036('0x39')]))[_0xb036('0x2f')](function(_0x53bfee){return _0x1cb817[_0xb036('0x65')](_0x53bfee)?_0x53bfee:undefined;})[_0xb036('0x66')](function(_0x5a1712){return!_['isNil'](_0x5a1712);})[_0xb036('0x5a')]();if(!_[_0xb036('0x67')](_0x81ac9e)){_0x81ac9e[_0xb036('0x33')](function(_0x10d28d){if(_0x10d28d===_0xb036('0x68')){_0x5c672f[_0xb036('0x69')](_0xb036('0x6a'),[]['concat'](_0x567d9c['query'][_0x10d28d]));}else if(_0x10d28d==='createdAt'){var _0x5d2c2b=JSON[_0xb036('0x52')](_0x567d9c[_0xb036('0x39')][_0x10d28d])[_0xb036('0x6b')];var _0x4dc800=JSON[_0xb036('0x52')](_0x567d9c[_0xb036('0x39')][_0x10d28d])['$lte'];_0x5c672f[_0xb036('0x69')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x5d2c2b,_0x4dc800);}else{if(_0x567d9c[_0xb036('0x39')][_0x10d28d]===_0xb036('0x6c')){_0x5c672f[_0xb036('0x69')]('i.'+_0x10d28d+_0xb036('0x6d'));}else{_0x5c672f['where']('i.'+_0x10d28d+'\x20=\x20?',_0x567d9c[_0xb036('0x39')][_0x10d28d]);}}});}if(_0x567d9c[_0xb036('0x39')][_0xb036('0x6e')]){if(_0x567d9c[_0xb036('0x39')][_0xb036('0x6e')]==0x1){_0x5c672f['having'](_0xb036('0x6f'));}else{_0x5c672f['having'](_0xb036('0x70'));}}if(_0x567d9c['query'][_0xb036('0x66')]){var _0x5390d6=_0x567d9c['query'][_0xb036('0x66')]['replace']('\x5c','\x5c\x5c')[_0xb036('0x71')]('\x27\x27',_0xb036('0x72'));if(qs[_0xb036('0x73')](_0x5390d6)){_0x41261b['or'](_0xb036('0x74'),_0x5390d6+'%')['or'](_0xb036('0x75'),_0x5390d6+'%');}else{var _0x1d18cb=[];_0x5390d6[_0xb036('0x32')]('\x20')[_0xb036('0x33')](function(_0xf38e3c){_0x1d18cb[_0xb036('0x34')]('+'+_0xf38e3c[_0xb036('0x76')]());});var _0x58cc57=_0x1d18cb[_0xb036('0x77')]('\x20');_0x41261b['or'](_0xb036('0x78'),_0x58cc57)['or'](_0xb036('0x79'),_0x5390d6+'%');}}}_0x5c672f[_0xb036('0x69')](_0x41261b);_0x5c672f['group'](_0xb036('0x7a'));var _0x32dba1={'type':db[_0xb036('0x7b')][_0xb036('0x7c')]['SELECT'],'raw':!![]};var _0x17527d=_0x5c672f['clone']();_0x17527d[_0xb036('0x44')](_0xb036('0x7a'));_0x17527d['field'](_0xb036('0x7d'),_0xb036('0x7e'));if(_0x421c54[_0xb036('0x41')]){_0x421c54['order']['forEach'](function(_0xdb8073){_0x5c672f[_0xb036('0x41')]('i.'+_0xdb8073[0x0],_0xdb8073[0x1]===_0xb036('0x7f')?![]:!![]);});}var _0x36851b=[];var _0x33fedc=squel['expr']();if(!_0x5974eb){if(_0x567d9c[_0xb036('0x39')][_0xb036('0x80')]){_0x36851b=_['isArray'](_0x567d9c[_0xb036('0x39')]['tag'])?_0x567d9c['query'][_0xb036('0x80')]:new Array(_0x567d9c[_0xb036('0x39')][_0xb036('0x80')]);_0x36851b[_0xb036('0x33')](function(_0x2bb558){_0x33fedc['or'](_0xb036('0x81'),'%,'+_0x2bb558+',%');});_0x5c672f[_0xb036('0x60')](_0x33fedc);_0x17527d[_0xb036('0x49')](_0xb036('0x82'),'it',_0xb036('0x83'));_0x17527d[_0xb036('0x49')](_0xb036('0x84'),'t',_0xb036('0x85'));_0x17527d[_0xb036('0x69')](_0xb036('0x86'),_0x36851b);}}else{if(_0x5974eb['hasOwnProperty'](_0xb036('0x87'))){if(as['hasMultipleConditions'](_0x5974eb[_0xb036('0x87')][_0xb036('0x5a')])){var _0x5c604e=_[_0xb036('0x5b')](_0x5974eb['TagId'][_0xb036('0x5a')])[0x0];_0x5c604e['forEach'](function(_0x2395fb){as[_0xb036('0x5e')](_0x2395fb)[_0xb036('0x33')](function(_0x12b6ef){_0x36851b[_0xb036('0x34')](_0x12b6ef);});});}else{_0x36851b=as[_0xb036('0x5e')](_0x5974eb[_0xb036('0x87')]['value']);}_0x36851b['forEach'](function(_0x50bcb2){_0x33fedc['or'](_0xb036('0x81'),'%,'+_0x50bcb2+',%');});_0x5c672f[_0xb036('0x60')](_0x33fedc);_0x17527d[_0xb036('0x49')]('mail_interaction_has_tags','it','it.MailInteractionId\x20=\x20i.id');_0x17527d['left_join'](_0xb036('0x84'),'t',_0xb036('0x85'));_0x17527d[_0xb036('0x69')](_0xb036('0x86'),_0x36851b);}}db['sequelize'][_0xb036('0x39')](_0x17527d[_0xb036('0x76')](),_0x32dba1)[_0xb036('0x29')](function(_0x37c5fa){_0x53925b[_0xb036('0x23')]=_0x37c5fa[_0xb036('0x62')];if(_0x53925b[_0xb036('0x23')]===0x0)return[];return db[_0xb036('0x88')]['query'](_0x49bdd9[_0xb036('0x76')](),_0x32dba1)[_0xb036('0x29')](function(_0x1bf741){_0x187349=_[_0xb036('0x89')](_0x1bf741,'id');_0x32dba1=_['merge'](_0x32dba1,{'model':db[_0xb036('0x36')],'mapToModel':!![],'raw':!![],'nest':!![]});_0x5c672f[_0xb036('0x44')](_0xb036('0x7d'),_0xb036('0x7e'));_0x5c672f[_0xb036('0x44')](_0xb036('0x8a'),_0xb036('0x8b'));_0x5c672f[_0xb036('0x44')](_0xb036('0x8c'),_0xb036('0x8d'));_0x5c672f[_0xb036('0x44')](_0xb036('0x8e'));_0x5c672f[_0xb036('0x44')]('c.firstName',_0xb036('0x8f'));_0x5c672f[_0xb036('0x44')](_0xb036('0x90'),_0xb036('0x91'));_0x5c672f[_0xb036('0x44')]('c.email',_0xb036('0x92'));_0x5c672f[_0xb036('0x44')](_0xb036('0x93'),'Contact.phone');_0x5c672f[_0xb036('0x44')](_0xb036('0x94'),'Contact.mobile');_0x5c672f[_0xb036('0x44')]('c.fax',_0xb036('0x95'));_0x5c672f[_0xb036('0x44')](_0xb036('0x96'),_0xb036('0x30'));_0x5c672f[_0xb036('0x49')](_0xb036('0x82'),'it','it.SmsInteractionId\x20=\x20i.id');_0x5c672f[_0xb036('0x49')](_0xb036('0x84'),'t','t.id\x20=\x20it.TagId');_0x5c672f[_0xb036('0x3f')](_0x421c54[_0xb036('0x3f')]);_0x5c672f['offset'](_0x421c54[_0xb036('0x40')]);return db[_0xb036('0x88')][_0xb036('0x39')](_0x5c672f['toString'](),_0x32dba1);})['then'](function(_0x4c6d96){_0x2a215d[_0xb036('0x69')](_0xb036('0x97'),_[_0xb036('0x2f')](_0x4c6d96,'id'));return db[_0xb036('0x88')][_0xb036('0x39')](_0x2a215d['toString'](),_0x32dba1)[_0xb036('0x29')](function(_0x352b90){var _0x3330bc=_['groupBy'](_0x352b90,'SmsInteractionId');var _0x15491d=[];_0x4c6d96['forEach'](function(_0xb3e18a){_0x15491d['push'](updateSmsInteraction(_0xb3e18a,_0x187349,_0x3330bc));});return BPromise[_0xb036('0x98')](_0x15491d);});});})[_0xb036('0x29')](function(_0x5624a7){_0x53925b[_0xb036('0x99')]=_0x5624a7;return _0x53925b;})[_0xb036('0x29')](respondWithFilteredResult(_0x3fe9d2,_0x421c54))[_0xb036('0x35')](handleError(_0x3fe9d2,null));};exports['show']=function(_0x4fd2ea,_0x46d3d0){var _0x5c6667={'raw':![],'where':{'id':_0x4fd2ea[_0xb036('0x9a')]['id']}},_0x38f8b7={};_0x38f8b7[_0xb036('0x37')]=_[_0xb036('0x38')](db[_0xb036('0x36')][_0xb036('0x9b')]);_0x38f8b7[_0xb036('0x39')]=_[_0xb036('0x38')](_0x4fd2ea[_0xb036('0x39')]);_0x38f8b7[_0xb036('0x3a')]=_['intersection'](_0x38f8b7[_0xb036('0x37')],_0x38f8b7[_0xb036('0x39')]);_0x5c6667[_0xb036('0x3c')]=_[_0xb036('0x3b')](_0x38f8b7['model'],qs[_0xb036('0x3d')](_0x4fd2ea[_0xb036('0x39')]['fields']));_0x5c6667[_0xb036('0x3c')]=_0x5c6667[_0xb036('0x3c')][_0xb036('0x62')]?_0x5c6667[_0xb036('0x3c')]:_0x38f8b7[_0xb036('0x37')];if(_0x4fd2ea['query'][_0xb036('0x9c')]){_0x5c6667[_0xb036('0x9d')]=[{'all':!![]}];}_0x5c6667=_[_0xb036('0x9e')]({},_0x5c6667,_0x4fd2ea['options']);return db[_0xb036('0x36')][_0xb036('0x9f')](_0x5c6667)['then'](handleEntityNotFound(_0x46d3d0,null))[_0xb036('0x29')](respondWithResult(_0x46d3d0,null))[_0xb036('0x35')](handleError(_0x46d3d0,null));};exports[_0xb036('0xa0')]=function(_0x559dd4,_0xf4cf91){return db[_0xb036('0x36')]['create'](_0x559dd4[_0xb036('0xa1')],{})[_0xb036('0x29')](respondWithResult(_0xf4cf91,0xc9))[_0xb036('0x35')](handleError(_0xf4cf91,null));};exports[_0xb036('0x27')]=function(_0x442285,_0x29b7c6){if(_0x442285['body']['id']){delete _0x442285[_0xb036('0xa1')]['id'];}return db[_0xb036('0x36')][_0xb036('0x9f')]({'where':{'id':_0x442285[_0xb036('0x9a')]['id']}})[_0xb036('0x29')](handleEntityNotFound(_0x29b7c6,null))[_0xb036('0x29')](saveUpdates(_0x442285[_0xb036('0xa1')],null))['then'](respondWithResult(_0x29b7c6,null))[_0xb036('0x35')](handleError(_0x29b7c6,null));};exports[_0xb036('0x28')]=function(_0x2f0417,_0x578640){return db[_0xb036('0x36')][_0xb036('0x9f')]({'where':{'id':_0x2f0417[_0xb036('0x9a')]['id']}})[_0xb036('0x29')](handleEntityNotFound(_0x578640,null))[_0xb036('0x29')](removeEntity(_0x578640,null))[_0xb036('0x35')](handleError(_0x578640,null));};exports[_0xb036('0xa2')]=function(_0x236b5a,_0x2a7589){return db[_0xb036('0x36')][_0xb036('0xa2')]()[_0xb036('0x29')](respondWithResult(_0x2a7589,null))[_0xb036('0x35')](handleError(_0x2a7589,null));};exports['addMessage']=function(_0x553f93,_0x4772ca,_0x5a0e16){return db[_0xb036('0xa3')][_0xb036('0x9f')]({'where':{'id':_0x553f93[_0xb036('0x9a')]['id']}})['then'](handleEntityNotFound(_0x4772ca,null))[_0xb036('0x29')](function(_0x8190d9){if(_0x8190d9){return _0x8190d9[_0xb036('0xa4')](_0x553f93[_0xb036('0xa1')][_0xb036('0xa5')],_[_0xb036('0x54')](_0x553f93[_0xb036('0xa1')],[_0xb036('0xa5'),'id'])||{});}})[_0xb036('0x29')](respondWithResult(_0x4772ca,null))[_0xb036('0x35')](handleError(_0x4772ca,null));};exports[_0xb036('0xa6')]=function(_0x33a379,_0x47a46f,_0x27a504){var _0x3d6619={'raw':![],'where':{}};var _0x14a758={};var _0x2d1b63={'count':0x0,'rows':[]};return db[_0xb036('0x36')]['findOne']({'where':{'id':_0x33a379[_0xb036('0x9a')]['id']}})[_0xb036('0x29')](handleEntityNotFound(_0x47a46f,null))[_0xb036('0x29')](function(_0x5e2e75){if(_0x5e2e75){_0x14a758['model']=_[_0xb036('0x38')](db['SmsMessage']['rawAttributes']);_0x14a758[_0xb036('0x39')]=_[_0xb036('0x38')](_0x33a379[_0xb036('0x39')]);_0x14a758[_0xb036('0x3a')]=_['intersection'](_0x14a758[_0xb036('0x37')],_0x14a758[_0xb036('0x39')]);_0x3d6619[_0xb036('0x3c')]=_['intersection'](_0x14a758[_0xb036('0x37')],qs[_0xb036('0x3d')](_0x33a379[_0xb036('0x39')][_0xb036('0x3d')]));_0x3d6619[_0xb036('0x3c')]=_0x3d6619[_0xb036('0x3c')][_0xb036('0x62')]?_0x3d6619[_0xb036('0x3c')]:_0x14a758[_0xb036('0x37')];if(!_0x33a379[_0xb036('0x39')]['hasOwnProperty'](_0xb036('0x3e'))){_0x3d6619[_0xb036('0x3f')]=qs[_0xb036('0x3f')](_0x33a379[_0xb036('0x39')]['limit']);_0x3d6619['offset']=qs[_0xb036('0x40')](_0x33a379[_0xb036('0x39')][_0xb036('0x40')]);}_0x3d6619['order']=qs['sort'](_0x33a379['query'][_0xb036('0x42')]);_0x3d6619[_0xb036('0x69')]=qs[_0xb036('0x3a')](_['pick'](_0x33a379[_0xb036('0x39')],_0x14a758[_0xb036('0x3a')]));_0x3d6619[_0xb036('0x69')]['SmsInteractionId']=_0x5e2e75['id'];if(_0x33a379[_0xb036('0x39')]['filter']){_0x3d6619['where']=_['merge'](_0x3d6619[_0xb036('0x69')],{'$or':_[_0xb036('0x2f')](_0x3d6619[_0xb036('0x3c')],function(_0x159b18){var _0x480f9e={};_0x480f9e[_0x159b18]={'$like':'%'+_0x33a379[_0xb036('0x39')][_0xb036('0x66')]+'%'};return _0x480f9e;})});}if(_0x33a379['query'][_0xb036('0x6b')]){var _0x2ca28c=_0x33a379[_0xb036('0x39')]['$gte'][_0xb036('0x32')](',');var _0x2f3bdb={};_0x2f3bdb[_0x2ca28c[0x0]]={'$gte':moment(_0x2ca28c[0x1])[_0xb036('0xa7')](_0xb036('0xa8'))};_0x3d6619[_0xb036('0x69')]=_[_0xb036('0x9e')](_0x3d6619[_0xb036('0x69')],_0x2f3bdb);}_0x3d6619=_[_0xb036('0x9e')]({},_0x3d6619,_0x33a379[_0xb036('0x56')]);return db[_0xb036('0xa3')][_0xb036('0x23')]({'where':_0x3d6619[_0xb036('0x69')]})['then'](function(_0x327ca0){_0x2d1b63[_0xb036('0x23')]=_0x327ca0;if(_0x33a379[_0xb036('0x39')]['includeAll']){_0x3d6619['include']=[{'all':!![]}];}return db[_0xb036('0xa3')][_0xb036('0xa9')](_0x3d6619);})[_0xb036('0x29')](function(_0x272e31){_0x2d1b63[_0xb036('0x99')]=_0x272e31;return _0x2d1b63;});}})[_0xb036('0x29')](respondWithFilteredResult(_0x47a46f,_0x3d6619))[_0xb036('0x35')](handleError(_0x47a46f,null));};exports[_0xb036('0xaa')]=function(_0x4a3928,_0x484cd8,_0x66d5d0){return db['SmsInteraction'][_0xb036('0x9f')]({'where':{'id':_0x4a3928[_0xb036('0x9a')]['id']}})['then'](handleEntityNotFound(_0x484cd8,null))[_0xb036('0x29')](function(_0x28b4c1){if(_0x28b4c1){return _0x28b4c1[_0xb036('0xab')](_0x4a3928[_0xb036('0xa1')][_0xb036('0xa5')],_[_0xb036('0x54')](_0x4a3928[_0xb036('0xa1')],[_0xb036('0xa5'),'id'])||{})['spread'](function(){return db[_0xb036('0xac')]['findAll']({'attributes':['id',_0xb036('0x2c'),_0xb036('0xad')],'where':{'id':_0x4a3928[_0xb036('0xa1')][_0xb036('0xa5')]}});})[_0xb036('0x29')](function(_0x3bdd21){socket[_0xb036('0xae')](_0xb036('0xaf'),{'id':Number(_0x4a3928[_0xb036('0x9a')]['id']),'tags':_0x3bdd21||[]});return{'id':Number(_0x4a3928[_0xb036('0x9a')]['id']),'tags':_0x3bdd21||[]};});}})['then'](respondWithResult(_0x484cd8,null))[_0xb036('0x35')](handleError(_0x484cd8,null));};exports['removeTags']=function(_0x2ae4d0,_0x38a4a8,_0x543435){return db[_0xb036('0x36')]['find']({'where':{'id':_0x2ae4d0['params']['id']}})['then'](handleEntityNotFound(_0x38a4a8,null))[_0xb036('0x29')](function(_0x21d70c){if(_0x21d70c){return _0x21d70c[_0xb036('0xb0')](_0x2ae4d0[_0xb036('0x39')][_0xb036('0xa5')]);}})[_0xb036('0x29')](respondWithStatusCode(_0x38a4a8,null))[_0xb036('0x35')](handleError(_0x38a4a8,null));};exports['download']=function(_0xc6a340,_0x563376){var _0x239b8e=moment()[_0xb036('0xb1')]()[_0xb036('0x76')]();var _0xefd45d=path[_0xb036('0x77')](config[_0xb036('0xb2')],_0xb036('0xb3'),_0xb036('0xb4'),_0xb036('0xb5'));var _0x3dbedf=path[_0xb036('0x77')](config[_0xb036('0xb2')],_0xb036('0xb3'),_0xb036('0xb4'),_0xb036('0xb6'));var _0x6935d9=path[_0xb036('0x77')](_0xefd45d,_0x239b8e);var _0x3d1a56=util[_0xb036('0xa7')](_0xb036('0xb7'),_0xc6a340['params']['id'],_0x239b8e);var _0x22f7f9=path[_0xb036('0x77')](_0xefd45d,_0x3d1a56);var _0x3c340b=![];return db['SmsInteraction'][_0xb036('0x9f')]({'where':{'id':_0xc6a340[_0xb036('0x9a')]['id']},'include':[{'model':db[_0xb036('0xa3')],'as':'Messages','attributes':['id','body','createdAt',_0xb036('0xb8'),_0xb036('0xb9'),_0xb036('0x6e')],'include':[{'model':db[_0xb036('0xba')],'as':_0xb036('0xba'),'attributes':['id','fullname'],'raw':!![]},{'model':db['CmContact'],'as':_0xb036('0xbb'),'attributes':['id','firstName','lastName'],'raw':!![]}]},{'model':db['SmsAccount'],'as':_0xb036('0xbc'),'attributes':['id',_0xb036('0x2c')]},{'model':db[_0xb036('0xba')],'as':_0xb036('0xbd'),'attributes':['id',_0xb036('0xbe')]}]})[_0xb036('0x29')](handleEntityNotFound(_0x563376,null))[_0xb036('0x29')](function(_0x38c911){if(_0x38c911){var _0x577365=_0x38c911[_0xb036('0xbf')]({'plain':!![]});_0x3c340b=!![];var _0x18fb9e={'format':'A4','border':'10px','header':{'height':_0xb036('0xc0'),'contents':{'first':'\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
Interaction\x20Transcript
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20'}},'footer':{'height':_0xb036('0xc1'),'contents':{'default':util[_0xb036('0xa7')]('\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{{page}}/{{pages}}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',util[_0xb036('0xa7')]('%s\x20#%d',_0xb036('0xc2'),_0x577365['id']),moment()[_0xb036('0xa7')](_0xb036('0xc3'))['toString']())}}};fs[_0xb036('0xc4')](_0x6935d9);var _0x36d47c={'channel':'Sms','account':_0x577365[_0xb036('0xbc')][_0xb036('0x2c')],'agent':_0x577365[_0xb036('0xbd')]?_0x577365[_0xb036('0xbd')][_0xb036('0xbe')]:_0xb036('0xc5'),'createdAt':moment(_0x577365[_0xb036('0xc6')])[_0xb036('0xa7')]('YYYY-MM-DD\x20HH:mm:ss')[_0xb036('0x76')](),'closedAt':_0x577365['closed']?moment(_0x577365[_0xb036('0xc7')])[_0xb036('0xa7')]('YYYY-MM-DD\x20HH:mm:ss')[_0xb036('0x76')]():'','disposition':_0x577365[_0xb036('0xc8')],'messages':_(_0x577365[_0xb036('0xc9')])['filter']({'secret':![]})[_0xb036('0x2f')](function(_0x47855a){return{'date':moment(_0x47855a['createdAt'])[_0xb036('0xa7')]('YYYY-MM-DD\x20HH:mm:ss')[_0xb036('0x76')](),'sender':_0x47855a['direction']===_0xb036('0xca')?_0x47855a[_0xb036('0xba')]?_0x47855a['User'][_0xb036('0xbe')]:_0xb036('0xcb'):_0x47855a['Contact'][_0xb036('0xcc')]+(_0x47855a['Contact'][_0xb036('0xcd')]?'\x20'+_0x47855a[_0xb036('0xbb')][_0xb036('0xcd')]:''),'body':_0x47855a[_0xb036('0xa1')],'direction':_0x47855a[_0xb036('0xb8')]===_0xb036('0xca')?'A':'C','secret':_0x47855a[_0xb036('0xb9')],'read':_0x47855a[_0xb036('0x6e')]};})['value']()};return ejs[_0xb036('0xce')](path[_0xb036('0x77')](config[_0xb036('0xb2')],_0xb036('0xb3'),_0xb036('0xcf'),'downloadInteraction.html'),{'interaction':_0x36d47c})[_0xb036('0x29')](function(_0x75e8aa){return new BPromise(function(_0x5a4eab,_0x5f5c39){pdf['create'](_0x75e8aa,_0x18fb9e)[_0xb036('0xd0')](path[_0xb036('0x77')](_0x6935d9,_0xb036('0xd1')+_0x577365['id']+'-'+_0x239b8e+'.pdf'),function(_0x50130e,_0x3be31e){if(_0x50130e)return _0x5f5c39(_0x50130e);_0x5a4eab(_0x3be31e);});});});}})[_0xb036('0x29')](function(){if(_0x3c340b){return new BPromise(function(_0x8653fe,_0x5e2b59){zipdir(_0x6935d9,{'saveTo':_0x22f7f9},function(_0x466e39,_0x37a163){if(_0x466e39)return _0x5e2b59(_0x466e39);return _0x8653fe(_0x37a163);});})['then'](function(){return new BPromise(function(_0x3e271e,_0x5808b8){rimraf(_0x6935d9,function(_0x3cbf00){if(_0x3cbf00)_0x5808b8(_0x3cbf00);return _0x3e271e();});});})[_0xb036('0x29')](function(){return _0x563376[_0xb036('0xd2')](_0x22f7f9,_0x3d1a56,function(_0x50b73c){if(_0x50b73c){console['log']('err',_0x50b73c);}else{fs[_0xb036('0xd3')](_0x22f7f9);}});});}else{return _0x563376[_0xb036('0x1f')](0xc8);}})[_0xb036('0x35')](handleError(_0x563376,null));}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.events.js b/server/api/smsInteraction/smsInteraction.events.js index 5226f4e..a76bafd 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 _0xd0e0=['hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','update','remove','getUsers','setDataValue','Users','map','findAll','unreadMessages','length','emit','catch'];(function(_0x2a6809,_0x44edde){var _0x11c371=function(_0x1a4888){while(--_0x1a4888){_0x2a6809['push'](_0x2a6809['shift']());}};_0x11c371(++_0x44edde);}(_0xd0e0,0x146));var _0x0d0e=function(_0x5b54bc,_0x400fac){_0x5b54bc=_0x5b54bc-0x0;var _0x20c0d8=_0xd0e0[_0x5b54bc];return _0x20c0d8;};'use strict';var EventEmitter=require(_0x0d0e('0x0'));var SmsInteraction=require(_0x0d0e('0x1'))['db']['SmsInteraction'];var SmsMessage=require(_0x0d0e('0x1'))['db']['SmsMessage'];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x0d0e('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x0d0e('0x3'),'afterDestroy':_0x0d0e('0x4')};function emitEvent(_0xf606db){return function(_0x41078b,_0x16c52d,_0x5c5e38){_0x41078b[_0x0d0e('0x5')]({'attributes':['id'],'raw':!![]})['then'](function(_0xa38ca6){_0x41078b[_0x0d0e('0x6')](_0x0d0e('0x7'),_0xa38ca6[_0x0d0e('0x8')](function(_0x4d1227){return{'id':_0x4d1227['id']};}));return SmsMessage[_0x0d0e('0x9')]({'where':{'SmsInteractionId':_0x41078b['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0xffefd3){_0x41078b[_0x0d0e('0x6')](_0x0d0e('0xa'),_0xffefd3[_0x0d0e('0xb')]);SmsInteractionEvents[_0x0d0e('0xc')](_0xf606db+':'+_0x41078b['id'],_0x41078b);SmsInteractionEvents[_0x0d0e('0xc')](_0xf606db,_0x41078b);_0x5c5e38(null);})[_0x0d0e('0xd')](_0x5c5e38(null));};}for(var e in events){if(events[_0x0d0e('0xe')](e)){var event=events[e];SmsInteraction[_0x0d0e('0xf')](e,emitEvent(event));}}module[_0x0d0e('0x10')]=SmsInteractionEvents; \ No newline at end of file +var _0x3989=['SmsMessage','setMaxListeners','save','update','remove','getUsers','setDataValue','Users','map','findAll','unreadMessages','emit','catch','hasOwnProperty','exports','events','SmsInteraction','../../mysqldb'];(function(_0x3a50c4,_0x123e07){var _0x29c348=function(_0x2555f4){while(--_0x2555f4){_0x3a50c4['push'](_0x3a50c4['shift']());}};_0x29c348(++_0x123e07);}(_0x3989,0x12f));var _0x9398=function(_0xc7c75,_0x514afc){_0xc7c75=_0xc7c75-0x0;var _0x53365f=_0x3989[_0xc7c75];return _0x53365f;};'use strict';var EventEmitter=require(_0x9398('0x0'));var SmsInteraction=require('../../mysqldb')['db'][_0x9398('0x1')];var SmsMessage=require(_0x9398('0x2'))['db'][_0x9398('0x3')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x9398('0x4')](0x0);var events={'afterCreate':_0x9398('0x5'),'afterUpdate':_0x9398('0x6'),'afterDestroy':_0x9398('0x7')};function emitEvent(_0x2f9145){return function(_0x2774cb,_0x10237e,_0x1456ab){_0x2774cb[_0x9398('0x8')]({'attributes':['id'],'raw':!![]})['then'](function(_0x53d5ca){_0x2774cb[_0x9398('0x9')](_0x9398('0xa'),_0x53d5ca[_0x9398('0xb')](function(_0x3f1b0c){return{'id':_0x3f1b0c['id']};}));return SmsMessage[_0x9398('0xc')]({'where':{'SmsInteractionId':_0x2774cb['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x4d1fac){_0x2774cb[_0x9398('0x9')](_0x9398('0xd'),_0x4d1fac['length']);SmsInteractionEvents[_0x9398('0xe')](_0x2f9145+':'+_0x2774cb['id'],_0x2774cb);SmsInteractionEvents[_0x9398('0xe')](_0x2f9145,_0x2774cb);_0x1456ab(null);})[_0x9398('0xf')](_0x1456ab(null));};}for(var e in events){if(events[_0x9398('0x10')](e)){var event=events[e];SmsInteraction['hook'](e,emitEvent(event));}}module[_0x9398('0x11')]=SmsInteractionEvents; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.model.js b/server/api/smsInteraction/smsInteraction.model.js index 9e29db1..041efa2 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 _0x3565=['format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','api','moment','bluebird','rimraf','../../config/environment','./smsInteraction.attributes','exports','define','SmsInteraction','sms_interactions','changed','closed','closedAt'];(function(_0x34f7bb,_0x547eb3){var _0x2efee3=function(_0x1fc766){while(--_0x1fc766){_0x34f7bb['push'](_0x34f7bb['shift']());}};_0x2efee3(++_0x547eb3);}(_0x3565,0xce));var _0x5356=function(_0x26e74c,_0x3b8337){_0x26e74c=_0x26e74c-0x0;var _0xc86ff5=_0x3565[_0x26e74c];return _0xc86ff5;};'use strict';var _=require(_0x5356('0x0'));var util=require(_0x5356('0x1'));var logger=require('../../config/logger')(_0x5356('0x2'));var moment=require(_0x5356('0x3'));var BPromise=require(_0x5356('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x5356('0x5'));var config=require(_0x5356('0x6'));var attributes=require(_0x5356('0x7'));module[_0x5356('0x8')]=function(_0x10b0dc,_0x4cfbb7){return _0x10b0dc[_0x5356('0x9')](_0x5356('0xa'),attributes,{'tableName':_0x5356('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x457f97,_0x3b7463,_0x501bce){if(_0x457f97[_0x5356('0xc')](_0x5356('0xd'))){_0x457f97[_0x5356('0xe')]=moment()[_0x5356('0xf')](_0x5356('0x10'));}_0x501bce(null,_0x457f97);}}});}; \ No newline at end of file +var _0x5566=['util','api','moment','bluebird','path','./smsInteraction.attributes','define','SmsInteraction','sms_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash'];(function(_0x30c6af,_0x5125a6){var _0x5986c4=function(_0x2a6546){while(--_0x2a6546){_0x30c6af['push'](_0x30c6af['shift']());}};_0x5986c4(++_0x5125a6);}(_0x5566,0x1df));var _0x6556=function(_0x34f591,_0x55fb1c){_0x34f591=_0x34f591-0x0;var _0xda3ec2=_0x5566[_0x34f591];return _0xda3ec2;};'use strict';var _=require(_0x6556('0x0'));var util=require(_0x6556('0x1'));var logger=require('../../config/logger')(_0x6556('0x2'));var moment=require(_0x6556('0x3'));var BPromise=require(_0x6556('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6556('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x6556('0x6'));module['exports']=function(_0x236dfc,_0x5adb15){return _0x236dfc[_0x6556('0x7')](_0x6556('0x8'),attributes,{'tableName':_0x6556('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x5d13b3,_0x235dd4,_0x23d6dc){if(_0x5d13b3[_0x6556('0xa')](_0x6556('0xb'))){_0x5d13b3[_0x6556('0xc')]=moment()[_0x6556('0xd')](_0x6556('0xe'));}_0x23d6dc(null,_0x5d13b3);}}});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.rpc.js b/server/api/smsInteraction/smsInteraction.rpc.js index bf0b79e..28104b6 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 _0x3812=['body','options','raw','where','attributes','SmsInteraction','find','addTags','omit','spread','AddTags','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','defaults','localhost','socket.io-emitter','./smsInteraction.socket','register','request','then','info','SmsInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','UpdateSmsInteraction','update'];(function(_0x46e94c,_0x461216){var _0x597221=function(_0x17b6d9){while(--_0x17b6d9){_0x46e94c['push'](_0x46e94c['shift']());}};_0x597221(++_0x461216);}(_0x3812,0x17c));var _0x2381=function(_0x267cd5,_0x412dd5){_0x267cd5=_0x267cd5-0x0;var _0x507baf=_0x3812[_0x267cd5];return _0x507baf;};'use strict';var _=require(_0x2381('0x0'));var util=require('util');var moment=require(_0x2381('0x1'));var BPromise=require(_0x2381('0x2'));var rs=require(_0x2381('0x3'));var fs=require('fs');var Redis=require(_0x2381('0x4'));var db=require(_0x2381('0x5'))['db'];var utils=require(_0x2381('0x6'));var logger=require('../../config/logger')(_0x2381('0x7'));var config=require(_0x2381('0x8'));var jayson=require(_0x2381('0x9'));var client=jayson[_0x2381('0xa')]['http']({'port':0x232a});config['redis']=_[_0x2381('0xb')](config['redis'],{'host':_0x2381('0xc'),'port':0x18eb});var socket=require(_0x2381('0xd'))(new Redis(config['redis']));require(_0x2381('0xe'))[_0x2381('0xf')](socket);function respondWithRpcPromise(_0x18ff62,_0x3e7ab0,_0x1a7253){return new BPromise(function(_0x3d3237,_0x357806){return client[_0x2381('0x10')](_0x18ff62,_0x1a7253)[_0x2381('0x11')](function(_0x296d5d){logger[_0x2381('0x12')](_0x2381('0x13'),_0x3e7ab0,_0x2381('0x14'));logger[_0x2381('0x15')]('SmsInteraction,\x20%s,\x20%s,\x20%s',_0x3e7ab0,_0x2381('0x14'),JSON[_0x2381('0x16')](_0x296d5d));if(_0x296d5d[_0x2381('0x17')]){if(_0x296d5d[_0x2381('0x17')][_0x2381('0x18')]===0x1f4){logger['error'](_0x2381('0x13'),_0x3e7ab0,_0x296d5d[_0x2381('0x17')][_0x2381('0x19')]);return _0x357806(_0x296d5d[_0x2381('0x17')][_0x2381('0x19')]);}logger[_0x2381('0x17')](_0x2381('0x13'),_0x3e7ab0,_0x296d5d[_0x2381('0x17')][_0x2381('0x19')]);return _0x3d3237(_0x296d5d[_0x2381('0x17')]['message']);}else{logger['info'](_0x2381('0x13'),_0x3e7ab0,'request\x20sent');_0x3d3237(_0x296d5d[_0x2381('0x1a')][_0x2381('0x19')]);}})[_0x2381('0x1b')](function(_0x479ef0){logger['error'](_0x2381('0x13'),_0x3e7ab0,_0x479ef0);_0x357806(_0x479ef0);});});}exports[_0x2381('0x1c')]=function(_0x38e063){var _0x3da898=this;return new Promise(function(_0x4ddb70,_0x4024a7){return db['SmsInteraction'][_0x2381('0x1d')](_0x38e063[_0x2381('0x1e')],{'raw':_0x38e063[_0x2381('0x1f')]?_0x38e063['options'][_0x2381('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x38e063[_0x2381('0x1f')]?_0x38e063['options'][_0x2381('0x21')]||null:null,'attributes':_0x38e063['options']?_0x38e063[_0x2381('0x1f')][_0x2381('0x22')]||null:null,'limit':_0x38e063['options']?_0x38e063['options']['limit']||null:null})[_0x2381('0x11')](function(_0x3cb93d){logger['info'](_0x2381('0x1c'),_0x38e063);logger[_0x2381('0x15')](_0x2381('0x1c'),_0x38e063,JSON[_0x2381('0x16')](_0x3cb93d));_0x4ddb70(_0x3cb93d);})[_0x2381('0x1b')](function(_0x59c907){logger[_0x2381('0x17')]('UpdateSmsInteraction',_0x59c907['message'],_0x38e063);_0x4024a7(_0x3da898[_0x2381('0x17')](0x1f4,_0x59c907[_0x2381('0x19')]));});});};exports['AddTagsToSmsInteraction']=function(_0x48a7b3){return new Promise(function(_0x53a857,_0x352de9){return db[_0x2381('0x23')][_0x2381('0x24')]({'where':_0x48a7b3['options']?_0x48a7b3[_0x2381('0x1f')][_0x2381('0x21')]||null:null})[_0x2381('0x11')](function(_0x1ec7f4){if(_0x1ec7f4){return _0x1ec7f4[_0x2381('0x25')](_0x48a7b3[_0x2381('0x1e')]['ids'],_[_0x2381('0x26')](_0x48a7b3['body'],['ids','id'])||{});}})[_0x2381('0x27')](function(_0x408cc3){logger['info'](_0x2381('0x28'),_0x48a7b3);logger['debug'](_0x2381('0x28'),_0x48a7b3,JSON[_0x2381('0x16')](_0x408cc3));_0x53a857(_0x408cc3);})[_0x2381('0x1b')](function(_0x2bff21){logger[_0x2381('0x17')](_0x2381('0x28'),_0x2bff21[_0x2381('0x19')],_0x48a7b3);_0x352de9(_this[_0x2381('0x17')](0x1f4,_0x2bff21[_0x2381('0x19')]));});});}; \ No newline at end of file +var _0x4199=['catch','AddTagsToSmsInteraction','SmsInteraction','find','where','addTags','omit','spread','AddTags','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','http','redis','defaults','localhost','socket.io-emitter','./smsInteraction.socket','request','SmsInteraction,\x20%s,\x20%s','request\x20sent','SmsInteraction,\x20%s,\x20%s,\x20%s','stringify','code','error','message','info','UpdateSmsInteraction','update','body','options','attributes','limit','then','debug'];(function(_0x45974d,_0x16fd32){var _0x7a059e=function(_0x47af46){while(--_0x47af46){_0x45974d['push'](_0x45974d['shift']());}};_0x7a059e(++_0x16fd32);}(_0x4199,0x1cc));var _0x9419=function(_0x1ee5d9,_0x4cf6e2){_0x1ee5d9=_0x1ee5d9-0x0;var _0x57d517=_0x4199[_0x1ee5d9];return _0x57d517;};'use strict';var _=require(_0x9419('0x0'));var util=require(_0x9419('0x1'));var moment=require('moment');var BPromise=require(_0x9419('0x2'));var rs=require(_0x9419('0x3'));var fs=require('fs');var Redis=require(_0x9419('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x9419('0x5'));var logger=require(_0x9419('0x6'))(_0x9419('0x7'));var config=require(_0x9419('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x9419('0x9')]({'port':0x232a});config[_0x9419('0xa')]=_[_0x9419('0xb')](config[_0x9419('0xa')],{'host':_0x9419('0xc'),'port':0x18eb});var socket=require(_0x9419('0xd'))(new Redis(config[_0x9419('0xa')]));require(_0x9419('0xe'))['register'](socket);function respondWithRpcPromise(_0x43d8ba,_0x477211,_0x462ade){return new BPromise(function(_0x78419b,_0x419935){return client[_0x9419('0xf')](_0x43d8ba,_0x462ade)['then'](function(_0x53038e){logger['info'](_0x9419('0x10'),_0x477211,_0x9419('0x11'));logger['debug'](_0x9419('0x12'),_0x477211,_0x9419('0x11'),JSON[_0x9419('0x13')](_0x53038e));if(_0x53038e['error']){if(_0x53038e['error'][_0x9419('0x14')]===0x1f4){logger[_0x9419('0x15')]('SmsInteraction,\x20%s,\x20%s',_0x477211,_0x53038e['error']['message']);return _0x419935(_0x53038e[_0x9419('0x15')][_0x9419('0x16')]);}logger[_0x9419('0x15')](_0x9419('0x10'),_0x477211,_0x53038e['error'][_0x9419('0x16')]);return _0x78419b(_0x53038e[_0x9419('0x15')][_0x9419('0x16')]);}else{logger[_0x9419('0x17')](_0x9419('0x10'),_0x477211,_0x9419('0x11'));_0x78419b(_0x53038e['result'][_0x9419('0x16')]);}})['catch'](function(_0x25d413){logger['error'](_0x9419('0x10'),_0x477211,_0x25d413);_0x419935(_0x25d413);});});}exports[_0x9419('0x18')]=function(_0x5a4c45){var _0x5f3cff=this;return new Promise(function(_0x18b553,_0x4c1553){return db['SmsInteraction'][_0x9419('0x19')](_0x5a4c45[_0x9419('0x1a')],{'raw':_0x5a4c45[_0x9419('0x1b')]?_0x5a4c45[_0x9419('0x1b')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5a4c45['options']?_0x5a4c45[_0x9419('0x1b')]['where']||null:null,'attributes':_0x5a4c45[_0x9419('0x1b')]?_0x5a4c45[_0x9419('0x1b')][_0x9419('0x1c')]||null:null,'limit':_0x5a4c45['options']?_0x5a4c45[_0x9419('0x1b')][_0x9419('0x1d')]||null:null})[_0x9419('0x1e')](function(_0x257787){logger['info']('UpdateSmsInteraction',_0x5a4c45);logger[_0x9419('0x1f')](_0x9419('0x18'),_0x5a4c45,JSON[_0x9419('0x13')](_0x257787));_0x18b553(_0x257787);})[_0x9419('0x20')](function(_0x1c2269){logger['error'](_0x9419('0x18'),_0x1c2269[_0x9419('0x16')],_0x5a4c45);_0x4c1553(_0x5f3cff['error'](0x1f4,_0x1c2269['message']));});});};exports[_0x9419('0x21')]=function(_0x5b8d31){return new Promise(function(_0x58d7ee,_0x2863ee){return db[_0x9419('0x22')][_0x9419('0x23')]({'where':_0x5b8d31[_0x9419('0x1b')]?_0x5b8d31[_0x9419('0x1b')][_0x9419('0x24')]||null:null})[_0x9419('0x1e')](function(_0x52ca87){if(_0x52ca87){return _0x52ca87[_0x9419('0x25')](_0x5b8d31[_0x9419('0x1a')]['ids'],_[_0x9419('0x26')](_0x5b8d31['body'],['ids','id'])||{});}})[_0x9419('0x27')](function(_0x449c15){logger[_0x9419('0x17')]('AddTags',_0x5b8d31);logger['debug'](_0x9419('0x28'),_0x5b8d31,JSON[_0x9419('0x13')](_0x449c15));_0x58d7ee(_0x449c15);})[_0x9419('0x20')](function(_0x5eac4f){logger[_0x9419('0x15')]('AddTags',_0x5eac4f[_0x9419('0x16')],_0x5b8d31);_0x2863ee(_this[_0x9419('0x15')](0x1f4,_0x5eac4f[_0x9419('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.socket.js b/server/api/smsInteraction/smsInteraction.socket.js index 39ba6d4..b1c1c9c 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 _0xb10b=['emit','removeListener','register','smsInteraction:','./smsInteraction.events','remove','update'];(function(_0x52c8e8,_0x5ee20d){var _0x31bb1a=function(_0x47233a){while(--_0x47233a){_0x52c8e8['push'](_0x52c8e8['shift']());}};_0x31bb1a(++_0x5ee20d);}(_0xb10b,0x12a));var _0xbb10=function(_0x163f58,_0x1c8ae4){_0x163f58=_0x163f58-0x0;var _0x472ed9=_0xb10b[_0x163f58];return _0x472ed9;};'use strict';var SmsInteractionEvents=require(_0xbb10('0x0'));var events=['save',_0xbb10('0x1'),_0xbb10('0x2')];function createListener(_0x1dcb08,_0x4d688c){return function(_0x4541ae){_0x4d688c[_0xbb10('0x3')](_0x1dcb08,_0x4541ae);};}function removeListener(_0x460981,_0x22320e){return function(){SmsInteractionEvents[_0xbb10('0x4')](_0x460981,_0x22320e);};}exports[_0xbb10('0x5')]=function(_0x481979){for(var _0x328583=0x0,_0x3cdd53=events['length'];_0x328583<_0x3cdd53;_0x328583++){var _0x1b9e94=events[_0x328583];var _0x3fb675=createListener(_0xbb10('0x6')+_0x1b9e94,_0x481979);SmsInteractionEvents['on'](_0x1b9e94,_0x3fb675);}}; \ No newline at end of file +var _0x2032=['save','remove','update','removeListener','register','length','smsInteraction:'];(function(_0x38c699,_0x56fea7){var _0x3b1ded=function(_0x100851){while(--_0x100851){_0x38c699['push'](_0x38c699['shift']());}};_0x3b1ded(++_0x56fea7);}(_0x2032,0xd9));var _0x2203=function(_0x5a1737,_0x5df798){_0x5a1737=_0x5a1737-0x0;var _0x154557=_0x2032[_0x5a1737];return _0x154557;};'use strict';var SmsInteractionEvents=require('./smsInteraction.events');var events=[_0x2203('0x0'),_0x2203('0x1'),_0x2203('0x2')];function createListener(_0x4c28da,_0x486390){return function(_0x228a29){_0x486390['emit'](_0x4c28da,_0x228a29);};}function removeListener(_0x46c49a,_0x880dcd){return function(){SmsInteractionEvents[_0x2203('0x3')](_0x46c49a,_0x880dcd);};}exports[_0x2203('0x4')]=function(_0x3f7ba1){for(var _0x13367a=0x0,_0x2e0f63=events[_0x2203('0x5')];_0x13367a<_0x2e0f63;_0x13367a++){var _0x18c4d6=events[_0x13367a];var _0x2049ff=createListener(_0x2203('0x6')+_0x18c4d6,_0x3f7ba1);SmsInteractionEvents['on'](_0x18c4d6,_0x2049ff);}}; \ No newline at end of file diff --git a/server/api/smsMessage/index.js b/server/api/smsMessage/index.js index a9148b2..5ead527 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 _0x929a=['delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsMessage.controller','isAuthenticated','/describe','describe','show','post','create','status','put','/:id/accept','accept','/:id/reject','reject'];(function(_0x4b2436,_0x452299){var _0x4f5ab2=function(_0x5c6679){while(--_0x5c6679){_0x4b2436['push'](_0x4b2436['shift']());}};_0x4f5ab2(++_0x452299);}(_0x929a,0x10a));var _0xa929=function(_0x5118ae,_0x287af1){_0x5118ae=_0x5118ae-0x0;var _0x22c216=_0x929a[_0x5118ae];return _0x22c216;};'use strict';var multer=require(_0xa929('0x0'));var util=require(_0xa929('0x1'));var path=require(_0xa929('0x2'));var timeout=require(_0xa929('0x3'));var express=require(_0xa929('0x4'));var router=express[_0xa929('0x5')]();var auth=require(_0xa929('0x6'));var interaction=require(_0xa929('0x7'));var config=require(_0xa929('0x8'));var controller=require(_0xa929('0x9'));router['get']('/',auth[_0xa929('0xa')](),controller['index']);router['get'](_0xa929('0xb'),auth['isAuthenticated'](),controller[_0xa929('0xc')]);router['get']('/:id',auth[_0xa929('0xa')](),controller[_0xa929('0xd')]);router[_0xa929('0xe')]('/',auth['isAuthenticated'](),interaction['tracked']('sms','smsmessage:create'),controller[_0xa929('0xf')]);router['post']('/:id/status',controller[_0xa929('0x10')]);router[_0xa929('0x11')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0xa929('0x11')](_0xa929('0x12'),auth[_0xa929('0xa')](),controller[_0xa929('0x13')]);router[_0xa929('0x11')](_0xa929('0x14'),auth['isAuthenticated'](),controller[_0xa929('0x15')]);router[_0xa929('0x16')]('/:id',auth['isAuthenticated'](),controller[_0xa929('0x17')]);module['exports']=router; \ No newline at end of file +var _0x6466=['/describe','/:id','show','post','tracked','sms','smsmessage:create','create','/:id/status','status','put','update','/:id/reject','reject','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsMessage.controller','get','isAuthenticated'];(function(_0x2c5340,_0x5c86e5){var _0x3c505e=function(_0x1089d9){while(--_0x1089d9){_0x2c5340['push'](_0x2c5340['shift']());}};_0x3c505e(++_0x5c86e5);}(_0x6466,0x1b4));var _0x6646=function(_0x2db020,_0x3555db){_0x2db020=_0x2db020-0x0;var _0x46bfd7=_0x6466[_0x2db020];return _0x46bfd7;};'use strict';var multer=require(_0x6646('0x0'));var util=require(_0x6646('0x1'));var path=require(_0x6646('0x2'));var timeout=require(_0x6646('0x3'));var express=require(_0x6646('0x4'));var router=express[_0x6646('0x5')]();var auth=require(_0x6646('0x6'));var interaction=require(_0x6646('0x7'));var config=require(_0x6646('0x8'));var controller=require(_0x6646('0x9'));router[_0x6646('0xa')]('/',auth[_0x6646('0xb')](),controller['index']);router['get'](_0x6646('0xc'),auth[_0x6646('0xb')](),controller['describe']);router[_0x6646('0xa')](_0x6646('0xd'),auth[_0x6646('0xb')](),controller[_0x6646('0xe')]);router[_0x6646('0xf')]('/',auth['isAuthenticated'](),interaction[_0x6646('0x10')](_0x6646('0x11'),_0x6646('0x12')),controller[_0x6646('0x13')]);router[_0x6646('0xf')](_0x6646('0x14'),controller[_0x6646('0x15')]);router[_0x6646('0x16')](_0x6646('0xd'),auth['isAuthenticated'](),controller[_0x6646('0x17')]);router[_0x6646('0x16')]('/:id/accept',auth[_0x6646('0xb')](),controller['accept']);router['put'](_0x6646('0x18'),auth[_0x6646('0xb')](),controller[_0x6646('0x19')]);router[_0x6646('0x1a')](_0x6646('0xd'),auth[_0x6646('0xb')](),controller[_0x6646('0x1b')]);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 1e573b2..88117f6 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 _0x2ba6=['out','STRING','DATE','sequelize','exports','TEXT','medium','BOOLEAN','ENUM'];(function(_0x14ea6e,_0x24217c){var _0xfe836c=function(_0x51406d){while(--_0x51406d){_0x14ea6e['push'](_0x14ea6e['shift']());}};_0xfe836c(++_0x24217c);}(_0x2ba6,0x135));var _0x62ba=function(_0x291b51,_0x393d1a){_0x291b51=_0x291b51-0x0;var _0x15a94=_0x2ba6[_0x291b51];return _0x15a94;};'use strict';var Sequelize=require(_0x62ba('0x0'));module[_0x62ba('0x1')]={'body':{'type':Sequelize[_0x62ba('0x2')](_0x62ba('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x62ba('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x62ba('0x5')]('in',_0x62ba('0x6')),'defaultValue':_0x62ba('0x6'),'allowNull':![]},'messageId':{'type':Sequelize[_0x62ba('0x7')](0xbe)},'phone':{'type':Sequelize['STRING']},'readAt':{'type':Sequelize[_0x62ba('0x8')]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0xaaee=['sequelize','exports','TEXT','medium','ENUM','out','STRING','BOOLEAN'];(function(_0x567769,_0xf22e3e){var _0x1589c6=function(_0x856270){while(--_0x856270){_0x567769['push'](_0x567769['shift']());}};_0x1589c6(++_0xf22e3e);}(_0xaaee,0x158));var _0xeaae=function(_0x1a127a,_0x423c58){_0x1a127a=_0x1a127a-0x0;var _0x522e90=_0xaaee[_0x1a127a];return _0x522e90;};'use strict';var Sequelize=require(_0xeaae('0x0'));module[_0xeaae('0x1')]={'body':{'type':Sequelize[_0xeaae('0x2')](_0xeaae('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0xeaae('0x4')]('in',_0xeaae('0x5')),'defaultValue':_0xeaae('0x5'),'allowNull':![]},'messageId':{'type':Sequelize[_0xeaae('0x6')](0xbe)},'phone':{'type':Sequelize[_0xeaae('0x6')]},'readAt':{'type':Sequelize['DATE']},'secret':{'type':Sequelize[_0xeaae('0x7')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.controller.js b/server/api/smsMessage/smsMessage.controller.js index 46e4464..3e0c502 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 _0x3e3c=['findAll','catch','show','params','keys','rawAttributes','includeAll','create','update','body','find','describe','sms-interactions','accept','sms','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','CmContact','get','SmsInteraction','SmsInteractionId','isNil','read1stAt','interaction','role','acceptMessage','channel','event','EventManager','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','rejectMessage','interface','format','rejectmessage','SmsAccount','SmsAccountId','received\x20delivery\x20report\x20from','inspect','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','twilio','plivo','MessageUUID','indexOf','sent','delivered','Status','plivio','infobip','results','groupName','DELIVERED','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','path','to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsMessage.socket','jayson/promise','http','client','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','reject','save','destroy','stack','name','send','SmsMessage','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','type','field','filter','merge','options','count','include'];(function(_0xbe200f,_0x4b50eb){var _0x192597=function(_0x106cfd){while(--_0x106cfd){_0xbe200f['push'](_0xbe200f['shift']());}};_0x192597(++_0x4b50eb);}(_0x3e3c,0xc1));var _0xc3e3=function(_0x3d1a28,_0x421dfe){_0x3d1a28=_0x3d1a28-0x0;var _0x3d57d3=_0x3e3c[_0x3d1a28];return _0x3d57d3;};'use strict';var pdf=require(_0xc3e3('0x0'));var emlformat=require(_0xc3e3('0x1'));var rimraf=require(_0xc3e3('0x2'));var zipdir=require(_0xc3e3('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc3e3('0x4'));var moment=require(_0xc3e3('0x5'));var BPromise=require(_0xc3e3('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0xc3e3('0x7'));var sox=require('sox');var csv=require(_0xc3e3('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xc3e3('0x9'));var squel=require('squel');var crypto=require(_0xc3e3('0xa'));var jsforce=require(_0xc3e3('0xb'));var deskjs=require(_0xc3e3('0xc'));var toCsv=require(_0xc3e3('0x8'));var querystring=require(_0xc3e3('0xd'));var Papa=require(_0xc3e3('0xe'));var Redis=require(_0xc3e3('0xf'));var authService=require(_0xc3e3('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xc3e3('0x11'));var hardwareService=require(_0xc3e3('0x12'));var logger=require(_0xc3e3('0x13'))('api');var utils=require(_0xc3e3('0x14'));var config=require('../../config/environment');var db=require(_0xc3e3('0x15'))['db'];config[_0xc3e3('0x16')]=_[_0xc3e3('0x17')](config[_0xc3e3('0x16')],{'host':_0xc3e3('0x18'),'port':0x18eb});var socket=require(_0xc3e3('0x19'))(new Redis(config[_0xc3e3('0x16')]));require(_0xc3e3('0x1a'))['register'](socket);var jayson=require(_0xc3e3('0x1b'));var client=jayson['client'][_0xc3e3('0x1c')]({'port':0x232c});var client9002=jayson[_0xc3e3('0x1d')][_0xc3e3('0x1c')]({'port':0x232a});function checkPasswordPattern(_0x1ffa73,_0x3ee142,_0x185c8a){if(_0x185c8a){var _0x39b1f4=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x39b1f4[_0xc3e3('0x1e')](_0x3ee142)){return _0x1ffa73;}else{throw new Error(_0xc3e3('0x1f'));}}else{return _0x1ffa73;}}function respondWithRpcPromise(_0x5ae7ce,_0x1be47a,_0x2a6975,_0x3eaf12){return new BPromise(function(_0x41db2b,_0x2ecb25){var _0x438cda=_0x3eaf12||client;return _0x438cda[_0xc3e3('0x20')](_0x5ae7ce,_0x2a6975)[_0xc3e3('0x21')](function(_0x486621){logger['info'](_0xc3e3('0x22'),_0x1be47a,_0xc3e3('0x23'));logger[_0xc3e3('0x24')](_0xc3e3('0x25'),_0x1be47a,'request\x20sent',JSON[_0xc3e3('0x26')](_0x486621));if(_0x486621[_0xc3e3('0x27')]){if(_0x486621[_0xc3e3('0x27')][_0xc3e3('0x28')]===0x1f4){logger[_0xc3e3('0x27')](_0xc3e3('0x22'),_0x1be47a,_0x486621[_0xc3e3('0x27')][_0xc3e3('0x29')]);return _0x2ecb25(_0x486621[_0xc3e3('0x27')]['message']);}logger[_0xc3e3('0x27')](_0xc3e3('0x22'),_0x1be47a,_0x486621[_0xc3e3('0x27')][_0xc3e3('0x29')]);return _0x41db2b(_0x486621['error'][_0xc3e3('0x29')]);}else{logger[_0xc3e3('0x2a')](_0xc3e3('0x22'),_0x1be47a,_0xc3e3('0x23'));_0x41db2b(_0x486621[_0xc3e3('0x2b')][_0xc3e3('0x29')]);}})['catch'](function(_0x47868d){logger[_0xc3e3('0x27')](_0xc3e3('0x22'),_0x1be47a,_0x47868d);_0x2ecb25(_0x47868d);});});}function respondWithStatusCode(_0x220b06,_0x7a0a04){_0x7a0a04=_0x7a0a04||0xcc;return function(_0x1ca83c){if(_0x1ca83c){return _0x220b06[_0xc3e3('0x2c')](_0x7a0a04);}return _0x220b06[_0xc3e3('0x2d')](_0x7a0a04)[_0xc3e3('0x2e')]();};}function respondWithResult(_0x167117,_0xd96e59){_0xd96e59=_0xd96e59||0xc8;return function(_0x3d827c){if(_0x3d827c){return _0x167117['status'](_0xd96e59)[_0xc3e3('0x2f')](_0x3d827c);}};}function respondWithFilteredResult(_0x46ede3,_0x49bc24){return function(_0x1029ad){if(_0x1029ad){var _0x5962af=_0x1029ad['count'],_0x23dfce=_0x49bc24[_0xc3e3('0x30')],_0x1f2352=_0x49bc24['offset']+_0x49bc24[_0xc3e3('0x31')],_0x441e7e;if(_0x1f2352>=_0x5962af){_0x1f2352=_0x5962af;_0x441e7e=0xc8;}else{_0x441e7e=0xce;}_0x46ede3[_0xc3e3('0x2d')](_0x441e7e);return _0x46ede3[_0xc3e3('0x32')](_0xc3e3('0x33'),_0x23dfce+'-'+_0x1f2352+'/'+_0x5962af)[_0xc3e3('0x2f')](_0x1029ad);}return null;};}function patchUpdates(_0x53dc7c){return function(_0x4d9215){try{jsonpatch[_0xc3e3('0x34')](_0x4d9215,_0x53dc7c,!![]);}catch(_0x104a27){return BPromise[_0xc3e3('0x35')](_0x104a27);}return _0x4d9215[_0xc3e3('0x36')]();};}function saveUpdates(_0x2fbf07,_0x594ad9){return function(_0x11fda6){if(_0x11fda6){return _0x11fda6['update'](_0x2fbf07)['then'](function(_0x2beeca){return _0x2beeca;});}return null;};}function removeEntity(_0x13d535,_0x1cf9e8){return function(_0x1fbc28){if(_0x1fbc28){return _0x1fbc28[_0xc3e3('0x37')]()[_0xc3e3('0x21')](function(){_0x13d535[_0xc3e3('0x2d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x7bd39f,_0x284ee7){return function(_0x3494b7){if(!_0x3494b7){_0x7bd39f[_0xc3e3('0x2c')](0x194);}return _0x3494b7;};}function handleError(_0x5f4a2e,_0x275684){_0x275684=_0x275684||0x1f4;return function(_0x3cd946){logger[_0xc3e3('0x27')](_0x3cd946[_0xc3e3('0x38')]);if(_0x3cd946[_0xc3e3('0x39')]){delete _0x3cd946[_0xc3e3('0x39')];}_0x5f4a2e[_0xc3e3('0x2d')](_0x275684)[_0xc3e3('0x3a')](_0x3cd946);};}exports['index']=function(_0x1fb15e,_0x44f5c3){var _0x126b2f={},_0x354661={},_0x46a9c2={'count':0x0,'rows':[]};var _0xf6deb0=db[_0xc3e3('0x3b')]['rawAttributes'];_0x354661[_0xc3e3('0x3c')]=_['keys'](_0xf6deb0);_0x354661[_0xc3e3('0x3d')]=_['keys'](_0x1fb15e[_0xc3e3('0x3d')]);_0x354661[_0xc3e3('0x3e')]=_[_0xc3e3('0x3f')](_0x354661[_0xc3e3('0x3c')],_0x354661[_0xc3e3('0x3d')]);_0x126b2f[_0xc3e3('0x40')]=_[_0xc3e3('0x3f')](_0x354661[_0xc3e3('0x3c')],qs[_0xc3e3('0x41')](_0x1fb15e[_0xc3e3('0x3d')]['fields']));_0x126b2f['attributes']=_0x126b2f[_0xc3e3('0x40')][_0xc3e3('0x42')]?_0x126b2f['attributes']:_0x354661[_0xc3e3('0x3c')];if(!_0x1fb15e['query'][_0xc3e3('0x43')](_0xc3e3('0x44'))){_0x126b2f[_0xc3e3('0x31')]=qs[_0xc3e3('0x31')](_0x1fb15e[_0xc3e3('0x3d')][_0xc3e3('0x31')]);_0x126b2f[_0xc3e3('0x30')]=qs[_0xc3e3('0x30')](_0x1fb15e[_0xc3e3('0x3d')][_0xc3e3('0x30')]);}_0x126b2f[_0xc3e3('0x45')]=qs[_0xc3e3('0x46')](_0x1fb15e[_0xc3e3('0x3d')][_0xc3e3('0x46')]);_0x126b2f['where']=qs[_0xc3e3('0x3e')](_['pick'](_0x1fb15e['query'],_0x354661[_0xc3e3('0x3e')]));if(_0x1fb15e['query']['filter']){_0x126b2f[_0xc3e3('0x47')]=_['merge'](_0x126b2f[_0xc3e3('0x47')],{'$or':_['map'](_0xf6deb0,function(_0x4d5025){if(_0x4d5025[_0xc3e3('0x48')]['key']!=='VIRTUAL'){var _0x43d83e={};_0x43d83e[_0x4d5025[_0xc3e3('0x49')]]={'$like':'%'+_0x1fb15e[_0xc3e3('0x3d')][_0xc3e3('0x4a')]+'%'};return _0x43d83e;}})});}_0x126b2f=_[_0xc3e3('0x4b')]({},_0x126b2f,_0x1fb15e[_0xc3e3('0x4c')]);var _0x5e2476={'where':_0x126b2f['where']};return db['SmsMessage'][_0xc3e3('0x4d')](_0x5e2476)['then'](function(_0x2d6776){_0x46a9c2[_0xc3e3('0x4d')]=_0x2d6776;if(_0x1fb15e[_0xc3e3('0x3d')]['includeAll']){_0x126b2f[_0xc3e3('0x4e')]=[{'all':!![]}];}return db[_0xc3e3('0x3b')][_0xc3e3('0x4f')](_0x126b2f);})[_0xc3e3('0x21')](function(_0x26dd4f){_0x46a9c2['rows']=_0x26dd4f;return _0x46a9c2;})[_0xc3e3('0x21')](respondWithFilteredResult(_0x44f5c3,_0x126b2f))[_0xc3e3('0x50')](handleError(_0x44f5c3,null));};exports[_0xc3e3('0x51')]=function(_0x464a93,_0x150f7b){var _0x1f6fa4={'raw':!![],'where':{'id':_0x464a93[_0xc3e3('0x52')]['id']}},_0x398af6={};_0x398af6[_0xc3e3('0x3c')]=_[_0xc3e3('0x53')](db[_0xc3e3('0x3b')][_0xc3e3('0x54')]);_0x398af6['query']=_['keys'](_0x464a93['query']);_0x398af6[_0xc3e3('0x3e')]=_[_0xc3e3('0x3f')](_0x398af6[_0xc3e3('0x3c')],_0x398af6['query']);_0x1f6fa4[_0xc3e3('0x40')]=_['intersection'](_0x398af6[_0xc3e3('0x3c')],qs[_0xc3e3('0x41')](_0x464a93[_0xc3e3('0x3d')][_0xc3e3('0x41')]));_0x1f6fa4[_0xc3e3('0x40')]=_0x1f6fa4['attributes'][_0xc3e3('0x42')]?_0x1f6fa4[_0xc3e3('0x40')]:_0x398af6[_0xc3e3('0x3c')];if(_0x464a93['query'][_0xc3e3('0x55')]){_0x1f6fa4[_0xc3e3('0x4e')]=[{'all':!![]}];}_0x1f6fa4=_[_0xc3e3('0x4b')]({},_0x1f6fa4,_0x464a93['options']);return db['SmsMessage']['find'](_0x1f6fa4)[_0xc3e3('0x21')](handleEntityNotFound(_0x150f7b,null))[_0xc3e3('0x21')](respondWithResult(_0x150f7b,null))[_0xc3e3('0x50')](handleError(_0x150f7b,null));};exports[_0xc3e3('0x56')]=function(_0x175d9b,_0x38ea6a){return db[_0xc3e3('0x3b')][_0xc3e3('0x56')](_0x175d9b['body'],{})[_0xc3e3('0x21')](respondWithResult(_0x38ea6a,0xc9))[_0xc3e3('0x50')](handleError(_0x38ea6a,null));};exports[_0xc3e3('0x57')]=function(_0xedaa6b,_0x284fc5){if(_0xedaa6b[_0xc3e3('0x58')]['id']){delete _0xedaa6b[_0xc3e3('0x58')]['id'];}return db['SmsMessage'][_0xc3e3('0x59')]({'where':{'id':_0xedaa6b[_0xc3e3('0x52')]['id']}})[_0xc3e3('0x21')](handleEntityNotFound(_0x284fc5,null))[_0xc3e3('0x21')](saveUpdates(_0xedaa6b[_0xc3e3('0x58')],null))[_0xc3e3('0x21')](respondWithResult(_0x284fc5,null))[_0xc3e3('0x50')](handleError(_0x284fc5,null));};exports['destroy']=function(_0x4f37e0,_0x17744c){return db[_0xc3e3('0x3b')][_0xc3e3('0x59')]({'where':{'id':_0x4f37e0[_0xc3e3('0x52')]['id']}})[_0xc3e3('0x21')](handleEntityNotFound(_0x17744c,null))[_0xc3e3('0x21')](removeEntity(_0x17744c,null))[_0xc3e3('0x50')](handleError(_0x17744c,null));};exports['describe']=function(_0x55d489,_0x48aee8){return db[_0xc3e3('0x3b')][_0xc3e3('0x5a')]()[_0xc3e3('0x21')](respondWithResult(_0x48aee8,null))['catch'](handleError(_0x48aee8,null));};var interaction_log=require('../../config/logger')(_0xc3e3('0x5b'));exports[_0xc3e3('0x5c')]=function(_0x1a5e4a,_0x3afa9b,_0xb495aa){var _0x5ba360={'channel':_0xc3e3('0x5d')};if(_0x1a5e4a[_0xc3e3('0x58')]['id']){delete _0x1a5e4a['body']['id'];}_0x1a5e4a['body']['read']=!![];_0x1a5e4a[_0xc3e3('0x58')][_0xc3e3('0x5e')]=moment()['format'](_0xc3e3('0x5f'));_0x1a5e4a[_0xc3e3('0x58')][_0xc3e3('0x60')]=_0x1a5e4a[_0xc3e3('0x58')][_0xc3e3('0x60')]||_0x1a5e4a[_0xc3e3('0x61')]['id'];return db[_0xc3e3('0x3b')][_0xc3e3('0x59')]({'where':{'id':_0x1a5e4a['params']['id'],'UserId':null},'include':[{'model':db[_0xc3e3('0x62')],'as':'Contact'}]})['then'](handleEntityNotFound(_0x3afa9b,null))[_0xc3e3('0x21')](saveUpdates(_0x1a5e4a[_0xc3e3('0x58')],null))['then'](function(_0x37cab1){if(_0x37cab1){_0x5ba360[_0xc3e3('0x29')]=_0x37cab1[_0xc3e3('0x63')]({'plain':!![]});return db[_0xc3e3('0x64')][_0xc3e3('0x59')]({'where':{'id':_0x37cab1[_0xc3e3('0x65')]}});}return null;})[_0xc3e3('0x21')](handleEntityNotFound(_0x3afa9b,null))[_0xc3e3('0x21')](function(_0x4a8e82){if(_0x4a8e82){return _0x4a8e82[_0xc3e3('0x57')]({'UserId':_0x1a5e4a[_0xc3e3('0x58')][_0xc3e3('0x60')],'read1stAt':_[_0xc3e3('0x66')](_0x4a8e82[_0xc3e3('0x67')])?moment()['format'](_0xc3e3('0x5f')):undefined});}return null;})[_0xc3e3('0x21')](function(_0x1b9ad7){if(_0x1b9ad7){_0x5ba360[_0xc3e3('0x68')]=_0x1b9ad7['get']({'plain':!![]});interaction_log['info']('[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x1a5e4a[_0xc3e3('0x61')]['id'],_0x1a5e4a[_0xc3e3('0x61')]['name'],_0x1a5e4a[_0xc3e3('0x61')][_0xc3e3('0x69')],_0x5ba360['interaction']['id'],_0x1a5e4a[_0xc3e3('0x58')]?JSON[_0xc3e3('0x26')](_0x1a5e4a[_0xc3e3('0x58')]):'null');return respondWithRpcPromise('AcceptMessage',_0xc3e3('0x6a'),_0x5ba360);}return null;})[_0xc3e3('0x21')](function(_0x5a44bf){if(_0x5a44bf){if(_0x1a5e4a[_0xc3e3('0x58')]['manual']){_0x5ba360[_0xc3e3('0x29')]['interface']=util['format']('SIP/%s',_0x1a5e4a[_0xc3e3('0x61')][_0xc3e3('0x39')]);_0x5ba360[_0xc3e3('0x29')][_0xc3e3('0x6b')]=_0x5ba360[_0xc3e3('0x6b')];_0x5ba360[_0xc3e3('0x29')][_0xc3e3('0x6c')]=_0xc3e3('0x5c');return respondWithRpcPromise(_0xc3e3('0x6d'),'EventManager',{'event':'acceptmessage','message':_0x5ba360['message']},client9002)[_0xc3e3('0x21')](function(){return _0x5ba360;});}return _0x5ba360;}return null;})['then'](respondWithResult(_0x3afa9b,null))[_0xc3e3('0x50')](handleError(_0x3afa9b,null));};var interaction_log=require('../../config/logger')(_0xc3e3('0x5b'));exports['reject']=function(_0x4f9168,_0x4e6db2,_0x30ccd5){var _0x4be1e8={'agent':{},'channel':_0xc3e3('0x5d')};if(_0x4f9168[_0xc3e3('0x58')]['id']){delete _0x4f9168[_0xc3e3('0x58')]['id'];}_0x4f9168[_0xc3e3('0x58')][_0xc3e3('0x60')]=_0x4f9168[_0xc3e3('0x58')][_0xc3e3('0x60')]||_0x4f9168[_0xc3e3('0x61')]['id'];_0x4be1e8['agent']['id']=_0x4f9168[_0xc3e3('0x58')][_0xc3e3('0x60')];return db['SmsMessage'][_0xc3e3('0x59')]({'where':{'id':_0x4f9168['params']['id'],'UserId':null}})[_0xc3e3('0x21')](handleEntityNotFound(_0x4e6db2,null))[_0xc3e3('0x21')](function(_0x56f460){if(_0x56f460){_0x4be1e8[_0xc3e3('0x29')]=_0x56f460[_0xc3e3('0x63')]({'plain':!![]});return db[_0xc3e3('0x64')][_0xc3e3('0x59')]({'where':{'id':_0x56f460[_0xc3e3('0x65')]}});}return null;})[_0xc3e3('0x21')](handleEntityNotFound(_0x4e6db2,null))[_0xc3e3('0x21')](function(_0xaba20){if(_0xaba20){_0x4be1e8[_0xc3e3('0x68')]=_0xaba20[_0xc3e3('0x63')]({'plain':!![]});interaction_log[_0xc3e3('0x2a')](_0xc3e3('0x6e'),_0x4f9168[_0xc3e3('0x61')]['id'],_0x4f9168[_0xc3e3('0x61')][_0xc3e3('0x39')],_0x4f9168[_0xc3e3('0x61')][_0xc3e3('0x69')],_0x4be1e8[_0xc3e3('0x68')]['id'],_0x4f9168[_0xc3e3('0x58')]?JSON[_0xc3e3('0x26')](_0x4f9168[_0xc3e3('0x58')]):_0xc3e3('0x6f'));return respondWithRpcPromise(_0xc3e3('0x70'),_0xc3e3('0x71'),_0x4be1e8);}return null;})[_0xc3e3('0x21')](function(_0x3f03db){if(_0x3f03db){_0x3f03db[_0xc3e3('0x29')][_0xc3e3('0x72')]=util[_0xc3e3('0x73')]('SIP/%s',_0x4f9168[_0xc3e3('0x61')][_0xc3e3('0x39')]);_0x3f03db[_0xc3e3('0x29')]['channel']=_0x4be1e8[_0xc3e3('0x6b')];_0x3f03db[_0xc3e3('0x29')]['event']=_0xc3e3('0x35');respondWithRpcPromise(_0xc3e3('0x6d'),_0xc3e3('0x6d'),{'event':_0xc3e3('0x74'),'message':_0x3f03db['message']},client9002);return _0x4be1e8;}return null;})[_0xc3e3('0x21')](respondWithResult(_0x4e6db2,null))['catch'](handleError(_0x4e6db2,null));};exports[_0xc3e3('0x2d')]=function(_0x4da2c4,_0x9776de,_0x2191f8){if(_0x4da2c4[_0xc3e3('0x58')]['id']){delete _0x4da2c4['body']['id'];}var _0x189356;return db[_0xc3e3('0x3b')][_0xc3e3('0x59')]({'where':{'id':_0x4da2c4[_0xc3e3('0x52')]['id']}})[_0xc3e3('0x21')](handleEntityNotFound(_0x9776de,null))[_0xc3e3('0x21')](function(_0x1da026){if(_0x1da026){_0x189356=_0x1da026;return db[_0xc3e3('0x75')]['find']({'where':{'id':_0x1da026[_0xc3e3('0x76')]}});}})[_0xc3e3('0x21')](handleEntityNotFound(_0x9776de,null))[_0xc3e3('0x21')](function(_0x563d53){if(_0x563d53){logger[_0xc3e3('0x24')](_0xc3e3('0x25'),_0xc3e3('0x2d'),_0xc3e3('0x77'),_0x563d53[_0xc3e3('0x48')],util[_0xc3e3('0x78')](_0x4da2c4[_0xc3e3('0x58')],{'showHidden':![],'depth':null}));switch(_0x563d53[_0xc3e3('0x48')]){case'twilio':if(_0x4da2c4[_0xc3e3('0x58')]['MessageSid']&&_0x4da2c4[_0xc3e3('0x58')][_0xc3e3('0x79')]===_0x189356[_0xc3e3('0x7a')]){return _0x189356[_0xc3e3('0x57')]({'read':!![]});}else{logger['error'](_0xc3e3('0x7b'),_0xc3e3('0x2d'),_0xc3e3('0x7c'),util['inspect'](_0x4da2c4[_0xc3e3('0x58')],{'showHidden':![],'depth':null}));}break;case _0xc3e3('0x7d'):if(_0x4da2c4[_0xc3e3('0x58')][_0xc3e3('0x7e')]&&_0x4da2c4[_0xc3e3('0x58')][_0xc3e3('0x7e')]===_0x189356[_0xc3e3('0x7a')]&&_[_0xc3e3('0x7f')]([_0xc3e3('0x80'),_0xc3e3('0x81')],_0x4da2c4[_0xc3e3('0x58')][_0xc3e3('0x82')])>=0x0){return _0x189356[_0xc3e3('0x57')]({'read':!![]});}else{logger[_0xc3e3('0x27')](_0xc3e3('0x7b'),_0xc3e3('0x2d'),_0xc3e3('0x83'),util[_0xc3e3('0x78')](_0x4da2c4[_0xc3e3('0x58')],{'showHidden':![],'depth':null}));}break;case _0xc3e3('0x84'):var _0x1ed794=_0x4da2c4[_0xc3e3('0x58')][_0xc3e3('0x85')][0x0];if(_0x1ed794[_0xc3e3('0x2d')][_0xc3e3('0x86')]===_0xc3e3('0x87')){return _0x189356[_0xc3e3('0x57')]({'read':!![]});}else{logger[_0xc3e3('0x27')](_0xc3e3('0x7b'),'status',_0xc3e3('0x84'),util[_0xc3e3('0x78')](_0x4da2c4[_0xc3e3('0x58')],{'showHidden':![],'depth':null}));}break;}return _0x189356;}})['then'](respondWithResult(_0x9776de,null))[_0xc3e3('0x50')](handleError(_0x9776de,null));}; \ No newline at end of file +var _0xc664=['channel','EventManager','agent','SmsInteractionId','RejectMessage','rejectMessage','event','rejectmessage','SmsAccount','SmsAccountId','received\x20delivery\x20report\x20from','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','twilio','inspect','MessageUUID','indexOf','sent','Status','plivio','results','DELIVERED','infobip','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','redis','defaults','socket.io-emitter','register','jayson/promise','client','http','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','info','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','SmsMessage,\x20%s,\x20%s','message','request\x20sent','result','catch','sendStatus','end','status','json','count','offset','limit','set','Content-Range','reject','update','destroy','stack','name','send','rawAttributes','keys','query','filters','intersection','attributes','fields','length','model','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','key','VIRTUAL','merge','options','SmsMessage','includeAll','include','show','params','find','create','body','describe','sms-interactions','accept','sms','format','UserId','CmContact','Contact','get','SmsInteraction','isNil','read1stAt','interaction','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','null','AcceptMessage','acceptMessage','interface','SIP/%s'];(function(_0x11ba83,_0xd5611a){var _0x3f3925=function(_0x3d7cb0){while(--_0x3d7cb0){_0x11ba83['push'](_0x11ba83['shift']());}};_0x3f3925(++_0xd5611a);}(_0xc664,0x1ad));var _0x4c66=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc664[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require(_0x4c66('0x0'));var emlformat=require(_0x4c66('0x1'));var rimraf=require(_0x4c66('0x2'));var zipdir=require(_0x4c66('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4c66('0x4'));var moment=require(_0x4c66('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x4c66('0x6'));var util=require(_0x4c66('0x7'));var path=require('path');var sox=require(_0x4c66('0x8'));var csv=require(_0x4c66('0x9'));var ejs=require(_0x4c66('0xa'));var fs=require('fs');var _=require(_0x4c66('0xb'));var squel=require(_0x4c66('0xc'));var crypto=require(_0x4c66('0xd'));var jsforce=require(_0x4c66('0xe'));var deskjs=require(_0x4c66('0xf'));var toCsv=require(_0x4c66('0x9'));var querystring=require(_0x4c66('0x10'));var Papa=require(_0x4c66('0x11'));var Redis=require(_0x4c66('0x12'));var authService=require(_0x4c66('0x13'));var qs=require(_0x4c66('0x14'));var as=require(_0x4c66('0x15'));var hardwareService=require(_0x4c66('0x16'));var logger=require(_0x4c66('0x17'))(_0x4c66('0x18'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x4c66('0x19'))['db'];config[_0x4c66('0x1a')]=_[_0x4c66('0x1b')](config[_0x4c66('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0x4c66('0x1c'))(new Redis(config[_0x4c66('0x1a')]));require('./smsMessage.socket')[_0x4c66('0x1d')](socket);var jayson=require(_0x4c66('0x1e'));var client=jayson[_0x4c66('0x1f')][_0x4c66('0x20')]({'port':0x232c});var client9002=jayson['client'][_0x4c66('0x20')]({'port':0x232a});function checkPasswordPattern(_0x3277fe,_0x23f808,_0x189685){if(_0x189685){var _0x521e66=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x521e66['test'](_0x23f808)){return _0x3277fe;}else{throw new Error(_0x4c66('0x21'));}}else{return _0x3277fe;}}function respondWithRpcPromise(_0xf1a931,_0x269681,_0x5514cb,_0x56aa85){return new BPromise(function(_0xa28f43,_0x23374a){var _0x15d4a8=_0x56aa85||client;return _0x15d4a8['request'](_0xf1a931,_0x5514cb)[_0x4c66('0x22')](function(_0x33df15){logger[_0x4c66('0x23')]('SmsMessage,\x20%s,\x20%s',_0x269681,'request\x20sent');logger[_0x4c66('0x24')](_0x4c66('0x25'),_0x269681,'request\x20sent',JSON[_0x4c66('0x26')](_0x33df15));if(_0x33df15[_0x4c66('0x27')]){if(_0x33df15['error'][_0x4c66('0x28')]===0x1f4){logger[_0x4c66('0x27')](_0x4c66('0x29'),_0x269681,_0x33df15[_0x4c66('0x27')][_0x4c66('0x2a')]);return _0x23374a(_0x33df15[_0x4c66('0x27')][_0x4c66('0x2a')]);}logger[_0x4c66('0x27')](_0x4c66('0x29'),_0x269681,_0x33df15['error']['message']);return _0xa28f43(_0x33df15['error'][_0x4c66('0x2a')]);}else{logger[_0x4c66('0x23')](_0x4c66('0x29'),_0x269681,_0x4c66('0x2b'));_0xa28f43(_0x33df15[_0x4c66('0x2c')][_0x4c66('0x2a')]);}})[_0x4c66('0x2d')](function(_0x52151d){logger[_0x4c66('0x27')](_0x4c66('0x29'),_0x269681,_0x52151d);_0x23374a(_0x52151d);});});}function respondWithStatusCode(_0x3e023f,_0x1bc4f0){_0x1bc4f0=_0x1bc4f0||0xcc;return function(_0x46066b){if(_0x46066b){return _0x3e023f[_0x4c66('0x2e')](_0x1bc4f0);}return _0x3e023f['status'](_0x1bc4f0)[_0x4c66('0x2f')]();};}function respondWithResult(_0x2256bc,_0x562ba7){_0x562ba7=_0x562ba7||0xc8;return function(_0x39a1fc){if(_0x39a1fc){return _0x2256bc[_0x4c66('0x30')](_0x562ba7)[_0x4c66('0x31')](_0x39a1fc);}};}function respondWithFilteredResult(_0x3f9a44,_0x3604a2){return function(_0x632a96){if(_0x632a96){var _0x108c1a=_0x632a96[_0x4c66('0x32')],_0x59096d=_0x3604a2[_0x4c66('0x33')],_0x413cd1=_0x3604a2[_0x4c66('0x33')]+_0x3604a2[_0x4c66('0x34')],_0x13924f;if(_0x413cd1>=_0x108c1a){_0x413cd1=_0x108c1a;_0x13924f=0xc8;}else{_0x13924f=0xce;}_0x3f9a44[_0x4c66('0x30')](_0x13924f);return _0x3f9a44[_0x4c66('0x35')](_0x4c66('0x36'),_0x59096d+'-'+_0x413cd1+'/'+_0x108c1a)[_0x4c66('0x31')](_0x632a96);}return null;};}function patchUpdates(_0x529827){return function(_0xfe0ec4){try{jsonpatch['apply'](_0xfe0ec4,_0x529827,!![]);}catch(_0x1e81da){return BPromise[_0x4c66('0x37')](_0x1e81da);}return _0xfe0ec4['save']();};}function saveUpdates(_0x5953b3,_0x214f3c){return function(_0x5cfbab){if(_0x5cfbab){return _0x5cfbab[_0x4c66('0x38')](_0x5953b3)[_0x4c66('0x22')](function(_0x42a64f){return _0x42a64f;});}return null;};}function removeEntity(_0x508d28,_0x380b4f){return function(_0x38c504){if(_0x38c504){return _0x38c504[_0x4c66('0x39')]()[_0x4c66('0x22')](function(){_0x508d28[_0x4c66('0x30')](0xcc)['end']();});}};}function handleEntityNotFound(_0x38f89e,_0x21f1a0){return function(_0x40c417){if(!_0x40c417){_0x38f89e[_0x4c66('0x2e')](0x194);}return _0x40c417;};}function handleError(_0xbdba34,_0x53dcc3){_0x53dcc3=_0x53dcc3||0x1f4;return function(_0x2a710e){logger[_0x4c66('0x27')](_0x2a710e[_0x4c66('0x3a')]);if(_0x2a710e['name']){delete _0x2a710e[_0x4c66('0x3b')];}_0xbdba34[_0x4c66('0x30')](_0x53dcc3)[_0x4c66('0x3c')](_0x2a710e);};}exports['index']=function(_0x4ea52b,_0x41d7c6){var _0x21a6d6={},_0x91db05={},_0xd22de1={'count':0x0,'rows':[]};var _0x5d7a67=db['SmsMessage'][_0x4c66('0x3d')];_0x91db05['model']=_[_0x4c66('0x3e')](_0x5d7a67);_0x91db05[_0x4c66('0x3f')]=_[_0x4c66('0x3e')](_0x4ea52b[_0x4c66('0x3f')]);_0x91db05[_0x4c66('0x40')]=_[_0x4c66('0x41')](_0x91db05['model'],_0x91db05[_0x4c66('0x3f')]);_0x21a6d6[_0x4c66('0x42')]=_[_0x4c66('0x41')](_0x91db05['model'],qs[_0x4c66('0x43')](_0x4ea52b[_0x4c66('0x3f')]['fields']));_0x21a6d6[_0x4c66('0x42')]=_0x21a6d6[_0x4c66('0x42')][_0x4c66('0x44')]?_0x21a6d6[_0x4c66('0x42')]:_0x91db05[_0x4c66('0x45')];if(!_0x4ea52b[_0x4c66('0x3f')][_0x4c66('0x46')](_0x4c66('0x47'))){_0x21a6d6[_0x4c66('0x34')]=qs[_0x4c66('0x34')](_0x4ea52b[_0x4c66('0x3f')][_0x4c66('0x34')]);_0x21a6d6[_0x4c66('0x33')]=qs['offset'](_0x4ea52b[_0x4c66('0x3f')][_0x4c66('0x33')]);}_0x21a6d6[_0x4c66('0x48')]=qs[_0x4c66('0x49')](_0x4ea52b[_0x4c66('0x3f')][_0x4c66('0x49')]);_0x21a6d6[_0x4c66('0x4a')]=qs['filters'](_[_0x4c66('0x4b')](_0x4ea52b[_0x4c66('0x3f')],_0x91db05[_0x4c66('0x40')]));if(_0x4ea52b[_0x4c66('0x3f')][_0x4c66('0x4c')]){_0x21a6d6[_0x4c66('0x4a')]=_['merge'](_0x21a6d6[_0x4c66('0x4a')],{'$or':_['map'](_0x5d7a67,function(_0x859be5){if(_0x859be5[_0x4c66('0x4d')][_0x4c66('0x4e')]!==_0x4c66('0x4f')){var _0x5a273d={};_0x5a273d[_0x859be5['field']]={'$like':'%'+_0x4ea52b[_0x4c66('0x3f')][_0x4c66('0x4c')]+'%'};return _0x5a273d;}})});}_0x21a6d6=_[_0x4c66('0x50')]({},_0x21a6d6,_0x4ea52b[_0x4c66('0x51')]);var _0x1edd8a={'where':_0x21a6d6[_0x4c66('0x4a')]};return db[_0x4c66('0x52')]['count'](_0x1edd8a)['then'](function(_0x276a08){_0xd22de1[_0x4c66('0x32')]=_0x276a08;if(_0x4ea52b[_0x4c66('0x3f')][_0x4c66('0x53')]){_0x21a6d6[_0x4c66('0x54')]=[{'all':!![]}];}return db[_0x4c66('0x52')]['findAll'](_0x21a6d6);})['then'](function(_0x49b5d7){_0xd22de1['rows']=_0x49b5d7;return _0xd22de1;})[_0x4c66('0x22')](respondWithFilteredResult(_0x41d7c6,_0x21a6d6))[_0x4c66('0x2d')](handleError(_0x41d7c6,null));};exports[_0x4c66('0x55')]=function(_0x110cce,_0x4926f9){var _0x3b26c8={'raw':!![],'where':{'id':_0x110cce[_0x4c66('0x56')]['id']}},_0xac12f8={};_0xac12f8[_0x4c66('0x45')]=_['keys'](db[_0x4c66('0x52')][_0x4c66('0x3d')]);_0xac12f8[_0x4c66('0x3f')]=_['keys'](_0x110cce['query']);_0xac12f8[_0x4c66('0x40')]=_[_0x4c66('0x41')](_0xac12f8[_0x4c66('0x45')],_0xac12f8[_0x4c66('0x3f')]);_0x3b26c8[_0x4c66('0x42')]=_[_0x4c66('0x41')](_0xac12f8[_0x4c66('0x45')],qs[_0x4c66('0x43')](_0x110cce[_0x4c66('0x3f')][_0x4c66('0x43')]));_0x3b26c8[_0x4c66('0x42')]=_0x3b26c8['attributes'][_0x4c66('0x44')]?_0x3b26c8['attributes']:_0xac12f8[_0x4c66('0x45')];if(_0x110cce[_0x4c66('0x3f')][_0x4c66('0x53')]){_0x3b26c8['include']=[{'all':!![]}];}_0x3b26c8=_['merge']({},_0x3b26c8,_0x110cce[_0x4c66('0x51')]);return db[_0x4c66('0x52')][_0x4c66('0x57')](_0x3b26c8)[_0x4c66('0x22')](handleEntityNotFound(_0x4926f9,null))[_0x4c66('0x22')](respondWithResult(_0x4926f9,null))[_0x4c66('0x2d')](handleError(_0x4926f9,null));};exports[_0x4c66('0x58')]=function(_0x5b6cab,_0x178c9e){return db['SmsMessage'][_0x4c66('0x58')](_0x5b6cab[_0x4c66('0x59')],{})[_0x4c66('0x22')](respondWithResult(_0x178c9e,0xc9))['catch'](handleError(_0x178c9e,null));};exports[_0x4c66('0x38')]=function(_0x47eeb7,_0xf52808){if(_0x47eeb7[_0x4c66('0x59')]['id']){delete _0x47eeb7['body']['id'];}return db[_0x4c66('0x52')][_0x4c66('0x57')]({'where':{'id':_0x47eeb7[_0x4c66('0x56')]['id']}})['then'](handleEntityNotFound(_0xf52808,null))[_0x4c66('0x22')](saveUpdates(_0x47eeb7[_0x4c66('0x59')],null))[_0x4c66('0x22')](respondWithResult(_0xf52808,null))[_0x4c66('0x2d')](handleError(_0xf52808,null));};exports['destroy']=function(_0x4182e0,_0x11b2db){return db[_0x4c66('0x52')]['find']({'where':{'id':_0x4182e0[_0x4c66('0x56')]['id']}})[_0x4c66('0x22')](handleEntityNotFound(_0x11b2db,null))[_0x4c66('0x22')](removeEntity(_0x11b2db,null))[_0x4c66('0x2d')](handleError(_0x11b2db,null));};exports[_0x4c66('0x5a')]=function(_0x111e6f,_0x4b82a2){return db[_0x4c66('0x52')][_0x4c66('0x5a')]()['then'](respondWithResult(_0x4b82a2,null))[_0x4c66('0x2d')](handleError(_0x4b82a2,null));};var interaction_log=require(_0x4c66('0x17'))(_0x4c66('0x5b'));exports[_0x4c66('0x5c')]=function(_0x4894a3,_0x530047,_0x1c51f4){var _0x365c6f={'channel':_0x4c66('0x5d')};if(_0x4894a3['body']['id']){delete _0x4894a3['body']['id'];}_0x4894a3[_0x4c66('0x59')]['read']=!![];_0x4894a3[_0x4c66('0x59')]['readAt']=moment()[_0x4c66('0x5e')]('YYYY-MM-DD\x20HH:mm:ss');_0x4894a3[_0x4c66('0x59')][_0x4c66('0x5f')]=_0x4894a3[_0x4c66('0x59')][_0x4c66('0x5f')]||_0x4894a3['user']['id'];return db[_0x4c66('0x52')][_0x4c66('0x57')]({'where':{'id':_0x4894a3['params']['id'],'UserId':null},'include':[{'model':db[_0x4c66('0x60')],'as':_0x4c66('0x61')}]})[_0x4c66('0x22')](handleEntityNotFound(_0x530047,null))[_0x4c66('0x22')](saveUpdates(_0x4894a3['body'],null))['then'](function(_0xbc3d86){if(_0xbc3d86){_0x365c6f['message']=_0xbc3d86[_0x4c66('0x62')]({'plain':!![]});return db[_0x4c66('0x63')][_0x4c66('0x57')]({'where':{'id':_0xbc3d86['SmsInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x530047,null))[_0x4c66('0x22')](function(_0x146eef){if(_0x146eef){return _0x146eef[_0x4c66('0x38')]({'UserId':_0x4894a3[_0x4c66('0x59')][_0x4c66('0x5f')],'read1stAt':_[_0x4c66('0x64')](_0x146eef[_0x4c66('0x65')])?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x4c66('0x22')](function(_0xcc0295){if(_0xcc0295){_0x365c6f[_0x4c66('0x66')]=_0xcc0295[_0x4c66('0x62')]({'plain':!![]});interaction_log[_0x4c66('0x23')](_0x4c66('0x67'),_0x4894a3[_0x4c66('0x68')]['id'],_0x4894a3[_0x4c66('0x68')][_0x4c66('0x3b')],_0x4894a3[_0x4c66('0x68')][_0x4c66('0x69')],_0x365c6f[_0x4c66('0x66')]['id'],_0x4894a3[_0x4c66('0x59')]?JSON[_0x4c66('0x26')](_0x4894a3[_0x4c66('0x59')]):_0x4c66('0x6a'));return respondWithRpcPromise(_0x4c66('0x6b'),_0x4c66('0x6c'),_0x365c6f);}return null;})[_0x4c66('0x22')](function(_0xc786f5){if(_0xc786f5){if(_0x4894a3[_0x4c66('0x59')]['manual']){_0x365c6f[_0x4c66('0x2a')][_0x4c66('0x6d')]=util['format'](_0x4c66('0x6e'),_0x4894a3[_0x4c66('0x68')]['name']);_0x365c6f[_0x4c66('0x2a')]['channel']=_0x365c6f[_0x4c66('0x6f')];_0x365c6f[_0x4c66('0x2a')]['event']=_0x4c66('0x5c');return respondWithRpcPromise(_0x4c66('0x70'),'EventManager',{'event':'acceptmessage','message':_0x365c6f[_0x4c66('0x2a')]},client9002)[_0x4c66('0x22')](function(){return _0x365c6f;});}return _0x365c6f;}return null;})[_0x4c66('0x22')](respondWithResult(_0x530047,null))['catch'](handleError(_0x530047,null));};var interaction_log=require(_0x4c66('0x17'))(_0x4c66('0x5b'));exports['reject']=function(_0x31f364,_0x2aeca9,_0x5d41bc){var _0x1f116f={'agent':{},'channel':'sms'};if(_0x31f364['body']['id']){delete _0x31f364[_0x4c66('0x59')]['id'];}_0x31f364[_0x4c66('0x59')][_0x4c66('0x5f')]=_0x31f364[_0x4c66('0x59')][_0x4c66('0x5f')]||_0x31f364[_0x4c66('0x68')]['id'];_0x1f116f[_0x4c66('0x71')]['id']=_0x31f364[_0x4c66('0x59')][_0x4c66('0x5f')];return db[_0x4c66('0x52')]['find']({'where':{'id':_0x31f364[_0x4c66('0x56')]['id'],'UserId':null}})[_0x4c66('0x22')](handleEntityNotFound(_0x2aeca9,null))[_0x4c66('0x22')](function(_0x3b330d){if(_0x3b330d){_0x1f116f[_0x4c66('0x2a')]=_0x3b330d[_0x4c66('0x62')]({'plain':!![]});return db[_0x4c66('0x63')][_0x4c66('0x57')]({'where':{'id':_0x3b330d[_0x4c66('0x72')]}});}return null;})[_0x4c66('0x22')](handleEntityNotFound(_0x2aeca9,null))[_0x4c66('0x22')](function(_0xab9be1){if(_0xab9be1){_0x1f116f['interaction']=_0xab9be1['get']({'plain':!![]});interaction_log['info']('[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x31f364['user']['id'],_0x31f364[_0x4c66('0x68')][_0x4c66('0x3b')],_0x31f364[_0x4c66('0x68')][_0x4c66('0x69')],_0x1f116f[_0x4c66('0x66')]['id'],_0x31f364['body']?JSON['stringify'](_0x31f364[_0x4c66('0x59')]):_0x4c66('0x6a'));return respondWithRpcPromise(_0x4c66('0x73'),_0x4c66('0x74'),_0x1f116f);}return null;})[_0x4c66('0x22')](function(_0x55a721){if(_0x55a721){_0x55a721[_0x4c66('0x2a')][_0x4c66('0x6d')]=util[_0x4c66('0x5e')](_0x4c66('0x6e'),_0x31f364[_0x4c66('0x68')][_0x4c66('0x3b')]);_0x55a721[_0x4c66('0x2a')][_0x4c66('0x6f')]=_0x1f116f['channel'];_0x55a721[_0x4c66('0x2a')][_0x4c66('0x75')]=_0x4c66('0x37');respondWithRpcPromise(_0x4c66('0x70'),'EventManager',{'event':_0x4c66('0x76'),'message':_0x55a721[_0x4c66('0x2a')]},client9002);return _0x1f116f;}return null;})['then'](respondWithResult(_0x2aeca9,null))[_0x4c66('0x2d')](handleError(_0x2aeca9,null));};exports['status']=function(_0x1e1fd7,_0x52c8fa,_0x39922a){if(_0x1e1fd7[_0x4c66('0x59')]['id']){delete _0x1e1fd7[_0x4c66('0x59')]['id'];}var _0x131af4;return db['SmsMessage']['find']({'where':{'id':_0x1e1fd7[_0x4c66('0x56')]['id']}})[_0x4c66('0x22')](handleEntityNotFound(_0x52c8fa,null))[_0x4c66('0x22')](function(_0x5b464a){if(_0x5b464a){_0x131af4=_0x5b464a;return db[_0x4c66('0x77')][_0x4c66('0x57')]({'where':{'id':_0x5b464a[_0x4c66('0x78')]}});}})[_0x4c66('0x22')](handleEntityNotFound(_0x52c8fa,null))[_0x4c66('0x22')](function(_0x173be3){if(_0x173be3){logger[_0x4c66('0x24')](_0x4c66('0x25'),'status',_0x4c66('0x79'),_0x173be3[_0x4c66('0x4d')],util['inspect'](_0x1e1fd7[_0x4c66('0x59')],{'showHidden':![],'depth':null}));switch(_0x173be3['type']){case'twilio':if(_0x1e1fd7[_0x4c66('0x59')][_0x4c66('0x7a')]&&_0x1e1fd7['body'][_0x4c66('0x7a')]===_0x131af4[_0x4c66('0x7b')]){return _0x131af4[_0x4c66('0x38')]({'read':!![]});}else{logger[_0x4c66('0x27')](_0x4c66('0x7c'),_0x4c66('0x30'),_0x4c66('0x7d'),util[_0x4c66('0x7e')](_0x1e1fd7[_0x4c66('0x59')],{'showHidden':![],'depth':null}));}break;case'plivo':if(_0x1e1fd7['body'][_0x4c66('0x7f')]&&_0x1e1fd7[_0x4c66('0x59')][_0x4c66('0x7f')]===_0x131af4[_0x4c66('0x7b')]&&_[_0x4c66('0x80')]([_0x4c66('0x81'),'delivered'],_0x1e1fd7[_0x4c66('0x59')][_0x4c66('0x82')])>=0x0){return _0x131af4[_0x4c66('0x38')]({'read':!![]});}else{logger['error'](_0x4c66('0x7c'),_0x4c66('0x30'),_0x4c66('0x83'),util[_0x4c66('0x7e')](_0x1e1fd7[_0x4c66('0x59')],{'showHidden':![],'depth':null}));}break;case'infobip':var _0x51db52=_0x1e1fd7['body'][_0x4c66('0x84')][0x0];if(_0x51db52['status']['groupName']===_0x4c66('0x85')){return _0x131af4[_0x4c66('0x38')]({'read':!![]});}else{logger[_0x4c66('0x27')](_0x4c66('0x7c'),'status',_0x4c66('0x86'),util[_0x4c66('0x7e')](_0x1e1fd7['body'],{'showHidden':![],'depth':null}));}break;}return _0x131af4;}})['then'](respondWithResult(_0x52c8fa,null))['catch'](handleError(_0x52c8fa,null));}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.events.js b/server/api/smsMessage/smsMessage.events.js index d9ad243..09bf343 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 _0x0b0e=['SmsMessage','save','update','remove','emit','hasOwnProperty','hook','events'];(function(_0x77b5d4,_0x189c45){var _0x3f59fc=function(_0x179509){while(--_0x179509){_0x77b5d4['push'](_0x77b5d4['shift']());}};_0x3f59fc(++_0x189c45);}(_0x0b0e,0x187));var _0xe0b0=function(_0x9db5d3,_0x4eea5e){_0x9db5d3=_0x9db5d3-0x0;var _0x477a81=_0x0b0e[_0x9db5d3];return _0x477a81;};'use strict';var EventEmitter=require(_0xe0b0('0x0'));var SmsMessage=require('../../mysqldb')['db'][_0xe0b0('0x1')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xe0b0('0x2'),'afterUpdate':_0xe0b0('0x3'),'afterDestroy':_0xe0b0('0x4')};function emitEvent(_0x25153a){return function(_0x28040c,_0x38a058,_0x399e67){SmsMessageEvents[_0xe0b0('0x5')](_0x25153a+':'+_0x28040c['id'],_0x28040c);SmsMessageEvents[_0xe0b0('0x5')](_0x25153a,_0x28040c);_0x399e67(null);};}for(var e in events){if(events[_0xe0b0('0x6')](e)){var event=events[e];SmsMessage[_0xe0b0('0x7')](e,emitEvent(event));}}module['exports']=SmsMessageEvents; \ No newline at end of file +var _0x5f2f=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','SmsMessage','setMaxListeners','save','update'];(function(_0x48f6fb,_0x187eb6){var _0x36e6b4=function(_0x5e53f4){while(--_0x5e53f4){_0x48f6fb['push'](_0x48f6fb['shift']());}};_0x36e6b4(++_0x187eb6);}(_0x5f2f,0x73));var _0xf5f2=function(_0x4c079e,_0x533ece){_0x4c079e=_0x4c079e-0x0;var _0xc6ae7d=_0x5f2f[_0x4c079e];return _0xc6ae7d;};'use strict';var EventEmitter=require(_0xf5f2('0x0'));var SmsMessage=require(_0xf5f2('0x1'))['db'][_0xf5f2('0x2')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0xf5f2('0x3')](0x0);var events={'afterCreate':_0xf5f2('0x4'),'afterUpdate':_0xf5f2('0x5'),'afterDestroy':_0xf5f2('0x6')};function emitEvent(_0x107cf){return function(_0x501fbd,_0x4854b6,_0x1665c7){SmsMessageEvents[_0xf5f2('0x7')](_0x107cf+':'+_0x501fbd['id'],_0x501fbd);SmsMessageEvents[_0xf5f2('0x7')](_0x107cf,_0x501fbd);_0x1665c7(null);};}for(var e in events){if(events[_0xf5f2('0x8')](e)){var event=events[e];SmsMessage[_0xf5f2('0x9')](e,emitEvent(event));}}module[_0xf5f2('0xa')]=SmsMessageEvents; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.model.js b/server/api/smsMessage/smsMessage.model.js index 2ffd171..c037a67 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 _0x74fd=['connectel','authToken','body','https://smsapi.connectel.se/api/send/','requestid','clicksend','password','xCALLY\x20Motion','format','%s:%s','https://rest.clicksend.com/v3/sms/send','toString','base64','http_code','data','queued_count','head','clickSend','plivo','authId','senderString','remote','/api/sms/messages/','https://api.plivo.com/v1/Account/%s/Message/','Basic\x20%s','message_uuid','infobip','baseUrl','/auth/1/session','application/json','IBSSO\x20','Missing\x20parameters:\x20base_url','csc','crypto','apiKey','login','text','timestamp','sort','length','createHash','digest','hex','https://sms.csc.lv/external/get/send.php?','keys','id_sms','Missing\x20parameters:\x20apiKey','clickatell','https://platform.clickatell.com/messages','uuid','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','https://api.intelepeer.com/_rest/v4/app/sms/mdr','refid','status','message','Token\x20not\x20received','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','exports','define','SmsMessage','sms_messages','messageId','fti_sms_messages','FULLTEXT','models','get','toLowerCase','direction','out','secret','UserId','SmsInteraction','findOne','SmsInteractionId','then','update','createdAt','catch','error','find','SmsAccountId','type','twilio','accountSid','phone','messages','create','/status?token=','token','sid','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','skebby','https://api.skebby.it/API/v1.0/REST/','username','smsMethod','sender','GET','split','POST','user_key','session_key','total_sent','internal_order_id','deliveryReport','read','inspect','Missing\x20parameters:\x20username,\x20password'];(function(_0x3ee15d,_0x32be13){var _0x1d9c14=function(_0x4cef78){while(--_0x4cef78){_0x3ee15d['push'](_0x3ee15d['shift']());}};_0x1d9c14(++_0x32be13);}(_0x74fd,0x1a1));var _0xd74f=function(_0x382c73,_0x199cab){_0x382c73=_0x382c73-0x0;var _0x1dd0bf=_0x74fd[_0x382c73];return _0x1dd0bf;};'use strict';var _=require(_0xd74f('0x0'));var util=require(_0xd74f('0x1'));var logger=require(_0xd74f('0x2'))(_0xd74f('0x3'));var moment=require('moment');var BPromise=require(_0xd74f('0x4'));var rp=require(_0xd74f('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd74f('0x6'));var config=require('../../config/environment');var attributes=require('./smsMessage.attributes');module[_0xd74f('0x7')]=function(_0xc4af39,_0x2023b3){return _0xc4af39[_0xd74f('0x8')](_0xd74f('0x9'),attributes,{'tableName':_0xd74f('0xa'),'paranoid':![],'indexes':[{'name':_0xd74f('0xb'),'fields':['messageId']},{'name':_0xd74f('0xc'),'fields':['body'],'type':_0xd74f('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x563066,_0x75c5f4,_0x2e1c17){var _0x2523b4=_0xc4af39[_0xd74f('0xe')];var _0x3cc83d=_0x563066[_0xd74f('0xf')]({'plain':!![]});if(_0x3cc83d['direction'][_0xd74f('0x10')]()==='in'||_0x3cc83d[_0xd74f('0x11')][_0xd74f('0x10')]()===_0xd74f('0x12')&&!_0x3cc83d[_0xd74f('0x13')]&&!_['isNil'](_0x3cc83d[_0xd74f('0x14')])){_0x2523b4[_0xd74f('0x15')][_0xd74f('0x16')]({'where':{'id':_0x3cc83d[_0xd74f('0x17')]}})[_0xd74f('0x18')](function(_0x205cb8){if(_0x205cb8){_0x205cb8[_0xd74f('0x19')]({'lastMsgAt':_0x3cc83d[_0xd74f('0x1a')],'lastMsgDirection':_0x3cc83d[_0xd74f('0x11')][_0xd74f('0x10')]()});}})[_0xd74f('0x1b')](function(_0xd8ea9f){console[_0xd74f('0x1c')](_0xd8ea9f);});}if(_0x3cc83d['direction']===_0xd74f('0x12')&&!_0x3cc83d['secret']){var _0x2b6a33;_0x2523b4['SmsAccount'][_0xd74f('0x1d')]({'where':{'id':_0x3cc83d[_0xd74f('0x1e')]},'raw':!![]})[_0xd74f('0x18')](function(_0x370471){_0x2b6a33=_0x370471;if(_0x2b6a33&&_0x2b6a33[_0xd74f('0x1f')]){switch(_0x2b6a33['type']){case _0xd74f('0x20'):var _0x2ea02c=require(_0xd74f('0x20'));if(_0x2b6a33[_0xd74f('0x21')]&&_0x2b6a33['authToken']&&_0x2b6a33[_0xd74f('0x22')]){var _0xa03e91=new _0x2ea02c(_0x2b6a33[_0xd74f('0x21')],_0x2b6a33['authToken']);_0xa03e91[_0xd74f('0x23')][_0xd74f('0x24')]({'body':_0x3cc83d['body'],'to':_0x3cc83d['phone'],'from':_0x2b6a33[_0xd74f('0x22')],'statusCallback':_0x2b6a33['remote']+'/api/sms/messages/'+_0x3cc83d['id']+_0xd74f('0x25')+_0x2b6a33[_0xd74f('0x26')]})['then'](function(_0x3608b7){if(_0x3608b7[_0xd74f('0x27')]){return _0x563066[_0xd74f('0x19')]({'messageId':_0x3608b7[_0xd74f('0x27')]});}})[_0xd74f('0x1b')](function(_0x221fb8){logger[_0xd74f('0x1c')](_0xd74f('0x28'),_0xd74f('0x29'),_0xd74f('0x20'),util['inspect'](_0x221fb8,{'showHidden':![],'depth':null}));});}else{logger[_0xd74f('0x1c')](_0xd74f('0x28'),_0xd74f('0x29'),_0xd74f('0x20'),_0xd74f('0x2a'));}break;case _0xd74f('0x2b'):var _0xc9d1c6=_0xd74f('0x2c');if(_0x2b6a33[_0xd74f('0x2d')]&&_0x2b6a33['password']){var _0x366c0e={'recipient':[_0x3cc83d[_0xd74f('0x22')]],'message':_0x3cc83d['body'],'message_type':_0x2b6a33[_0xd74f('0x2e')]};if(_0x2b6a33[_0xd74f('0x2e')]&&_0x2b6a33[_0xd74f('0x2e')]!=='SI'){_0x366c0e[_0xd74f('0x2f')]=_0x2b6a33[_0xd74f('0x22')];}var _0x25147e={'url':_0xc9d1c6+'login?username='+_0x2b6a33['username']+'&password='+_0x2b6a33['password'],'method':_0xd74f('0x30')};rp(_0x25147e)[_0xd74f('0x18')](function(_0x39234f){var _0x3d3831=_0x39234f[_0xd74f('0x31')](';');var _0x4dc28a={'user_key':_0x3d3831[0x0],'session_key':_0x3d3831[0x1]};_0x25147e={'url':_0xc9d1c6+'sms','method':_0xd74f('0x32'),'headers':{'user_key':_0x4dc28a[_0xd74f('0x33')],'Session_key':_0x4dc28a[_0xd74f('0x34')]},'json':!![],'body':_0x366c0e};return rp(_0x25147e);})[_0xd74f('0x18')](function(_0x3b7d1a){if(_0x3b7d1a[_0xd74f('0x35')]>=0x1){var _0x37afa7={'messageId':_0x3b7d1a[_0xd74f('0x36')]};if(_0x2b6a33['smsMethod']!=='GP'||!_0x2b6a33[_0xd74f('0x37')]){_0x37afa7[_0xd74f('0x38')]=!![];}return _0x563066[_0xd74f('0x19')](_0x37afa7);}else{return logger[_0xd74f('0x1c')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xd74f('0x29'),_0xd74f('0x2b'),util[_0xd74f('0x39')](_0x3b7d1a,{'showHidden':![],'depth':null}));}})['catch'](function(_0x228c35){return logger[_0xd74f('0x1c')](_0xd74f('0x28'),'afterCreate',_0xd74f('0x2b'),util[_0xd74f('0x39')](_0x228c35,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xd74f('0x28'),_0xd74f('0x29'),_0xd74f('0x2b'),_0xd74f('0x3a'));}break;case _0xd74f('0x3b'):if(_0x2b6a33[_0xd74f('0x3c')]){var _0x4af342={'recipient':_0x3cc83d['phone'],'message':_0x3cc83d[_0xd74f('0x3d')],'sender':_0x2b6a33['senderString']||_0x2b6a33[_0xd74f('0x22')],'authorization':_0x2b6a33[_0xd74f('0x3c')]};var _0x75c5f4={'method':_0xd74f('0x32'),'uri':_0xd74f('0x3e'),'body':_0x4af342,'json':!![]};rp(_0x75c5f4)[_0xd74f('0x18')](function(_0x3d0e4b){var _0x2fe11c={'messageId':_0x3d0e4b[_0xd74f('0x3f')]};if(!_0x2b6a33['deliveryReport']){_0x2fe11c[_0xd74f('0x38')]=!![];}return _0x563066['update'](_0x2fe11c);})[_0xd74f('0x1b')](function(_0x5c6fc8){logger[_0xd74f('0x1c')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xd74f('0x29'),_0xd74f('0x3b'),util[_0xd74f('0x39')](_0x5c6fc8,{'showHidden':![],'depth':null}));});}else{logger[_0xd74f('0x1c')](_0xd74f('0x28'),'afterCreate',_0xd74f('0x3b'),'Missing\x20parameters:\x20authToken');}break;case _0xd74f('0x40'):if(_0x2b6a33[_0xd74f('0x2d')]&&_0x2b6a33[_0xd74f('0x41')]){var _0x4af342={'messages':[{'source':_0xd74f('0x42'),'to':_0x3cc83d['phone'],'body':_0x3cc83d[_0xd74f('0x3d')],'from':_0x2b6a33['senderString']||_0x2b6a33[_0xd74f('0x22')]}]};var _0x57ee53=util[_0xd74f('0x43')](_0xd74f('0x44'),_0x2b6a33[_0xd74f('0x2d')],_0x2b6a33['password']);var _0x75c5f4={'method':_0xd74f('0x32'),'uri':_0xd74f('0x45'),'body':_0x4af342,'headers':{'Authorization':util[_0xd74f('0x43')]('Basic\x20%s',new Buffer(_0x57ee53)[_0xd74f('0x46')](_0xd74f('0x47')))},'json':!![]};rp(_0x75c5f4)[_0xd74f('0x18')](function(_0x22abb2){if(_0x22abb2[_0xd74f('0x48')]>=0xc8&&_0x22abb2[_0xd74f('0x48')]<=0xce){if(_0x22abb2[_0xd74f('0x49')]&&_0x22abb2[_0xd74f('0x49')][_0xd74f('0x4a')]>0x0){var _0x150856=_[_0xd74f('0x4b')](_0x22abb2['data']['messages']);var _0xf5d3dd={'messageId':_0x150856['message_id']};if(!_0x2b6a33[_0xd74f('0x37')]){_0xf5d3dd[_0xd74f('0x38')]=!![];}return _0x563066[_0xd74f('0x19')](_0xf5d3dd);}else{logger[_0xd74f('0x1c')](_0xd74f('0x28'),'afterCreate',_0xd74f('0x4c'),util[_0xd74f('0x39')](_0x22abb2,{'showHidden':![],'depth':null}));}}else{logger['error'](_0xd74f('0x28'),_0xd74f('0x29'),_0xd74f('0x4c'),util[_0xd74f('0x39')](_0x22abb2,{'showHidden':![],'depth':null}));}})[_0xd74f('0x1b')](function(_0x4b6af2){logger[_0xd74f('0x1c')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xd74f('0x29'),_0xd74f('0x4c'),util['inspect'](_0x4b6af2,{'showHidden':![],'depth':null}));});}else{logger[_0xd74f('0x1c')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xd74f('0x29'),_0xd74f('0x4c'),_0xd74f('0x3a'));}break;case _0xd74f('0x4d'):if(_0x2b6a33[_0xd74f('0x4e')]&&_0x2b6a33[_0xd74f('0x3c')]){var _0x4af342={'dst':_0x3cc83d[_0xd74f('0x22')],'text':_0x3cc83d[_0xd74f('0x3d')],'src':_0x2b6a33[_0xd74f('0x4f')]||_0x2b6a33[_0xd74f('0x22')],'url':_0x2b6a33[_0xd74f('0x50')]+_0xd74f('0x51')+_0x3cc83d['id']+_0xd74f('0x25')+_0x2b6a33[_0xd74f('0x26')]};var _0x57ee53=util[_0xd74f('0x43')](_0xd74f('0x44'),_0x2b6a33['authId'],_0x2b6a33[_0xd74f('0x3c')]);var _0x75c5f4={'method':_0xd74f('0x32'),'uri':util[_0xd74f('0x43')](_0xd74f('0x52'),_0x2b6a33['authId']),'body':_0x4af342,'headers':{'Authorization':util[_0xd74f('0x43')](_0xd74f('0x53'),new Buffer(_0x57ee53)[_0xd74f('0x46')](_0xd74f('0x47')))},'json':!![]};rp(_0x75c5f4)[_0xd74f('0x18')](function(_0x30ccfb){var _0x572d41={'messageId':_0x30ccfb[_0xd74f('0x54')][0x0]};return _0x563066['update'](_0x572d41);})[_0xd74f('0x1b')](function(_0x48b438){logger[_0xd74f('0x1c')](_0xd74f('0x28'),_0xd74f('0x29'),_0xd74f('0x4d'),util[_0xd74f('0x39')](_0x48b438,{'showHidden':![],'depth':null}));});}else{logger[_0xd74f('0x1c')](_0xd74f('0x28'),'afterCreate','plivo','Missing\x20parameters:\x20authId,\x20authToken');}break;case _0xd74f('0x55'):if(_0x2b6a33['username']&&_0x2b6a33[_0xd74f('0x41')]){if(_0x2b6a33[_0xd74f('0x56')]){var _0x1519c9={'method':_0xd74f('0x32'),'uri':_0x2b6a33[_0xd74f('0x56')]+_0xd74f('0x57'),'body':{'username':_0x2b6a33['username'],'password':_0x2b6a33[_0xd74f('0x41')]},'json':!![]};return rp(_0x1519c9)['then'](function(_0x497ace){var _0x3159a1={'method':_0xd74f('0x32'),'uri':_0x2b6a33[_0xd74f('0x56')]+'/sms/2/text/advanced','body':{'messages':[{'from':_0x2b6a33['phone'],'destinations':[{'to':_0x3cc83d[_0xd74f('0x22')]}],'text':_0x3cc83d[_0xd74f('0x3d')],'notifyUrl':_0x2b6a33[_0xd74f('0x50')]+_0xd74f('0x51')+_0x3cc83d['id']+'/status?token='+_0x2b6a33[_0xd74f('0x26')],'notifyContentType':_0xd74f('0x58'),'callbackData':_0x2b6a33[_0xd74f('0x22')]+';'+_0x3cc83d['body']}]},'headers':{'Authorization':_0xd74f('0x59')+_0x497ace[_0xd74f('0x26')]},'json':!![]};return rp(_0x3159a1)[_0xd74f('0x18')](function(_0x2d9349){if(_0x2d9349[_0xd74f('0x23')]){var _0x133dde={'messageId':_0x2d9349[_0xd74f('0x23')][0x0][_0xd74f('0xb')]};if(!_0x2b6a33['deliveryReport']){_0x133dde[_0xd74f('0x38')]=!![];}return _0x563066[_0xd74f('0x19')](_0x133dde);}else{return logger['error'](_0xd74f('0x28'),_0xd74f('0x29'),_0xd74f('0x55'),util[_0xd74f('0x39')](_0x2d9349,{'showHidden':![],'depth':null}));}});})[_0xd74f('0x1b')](function(_0x255799){return logger[_0xd74f('0x1c')](_0xd74f('0x28'),_0xd74f('0x29'),_0xd74f('0x55'),util['inspect'](_0x255799,{'showHidden':![],'depth':null}));});}else{logger[_0xd74f('0x1c')](_0xd74f('0x28'),_0xd74f('0x29'),'infobip',_0xd74f('0x5a'));}}else{logger[_0xd74f('0x1c')](_0xd74f('0x28'),_0xd74f('0x29'),_0xd74f('0x55'),_0xd74f('0x3a'));}break;case _0xd74f('0x5b'):var _0x322a82=require(_0xd74f('0x5c'));if(_0x2b6a33[_0xd74f('0x5d')]){var _0x312e15={};_0x312e15[_0xd74f('0x5e')]=_0x2b6a33[_0xd74f('0x2d')];_0x312e15['phone']=_0x3cc83d[_0xd74f('0x22')];_0x312e15[_0xd74f('0x2f')]=_0x2b6a33[_0xd74f('0x22')];_0x312e15[_0xd74f('0x5f')]=_0x3cc83d[_0xd74f('0x3d')];_0x312e15[_0xd74f('0x60')]=+new Date();var _0x6a3ddf='';var _0x16a631='';var _0xe46c4a=Object['keys'](_0x312e15);_0xe46c4a[_0xd74f('0x61')]();for(var _0x58506d=0x0;_0x58506d<_0xe46c4a[_0xd74f('0x62')];_0x58506d++){if(_0x6a3ddf!=''){_0x6a3ddf+='&';}_0x6a3ddf+=_0xe46c4a[_0x58506d]+'='+encodeURIComponent(_0x312e15[_0xe46c4a[_0x58506d]]);_0x16a631+=_0x312e15[_0xe46c4a[_0x58506d]];}_0x16a631+=_0x2b6a33[_0xd74f('0x5d')];_0x16a631=_0x322a82[_0xd74f('0x63')]('md5')[_0xd74f('0x19')](_0x16a631)[_0xd74f('0x64')](_0xd74f('0x65'));if(_0x6a3ddf!==''){_0x6a3ddf+='&';}_0x6a3ddf+='signature='+_0x16a631;var _0x25147e={'method':_0xd74f('0x30'),'uri':_0xd74f('0x66')+_0x6a3ddf,'json':!![]};return rp(_0x25147e)[_0xd74f('0x18')](function(_0x9fd0f2){var _0x4f98e2=Object[_0xd74f('0x67')](_0x9fd0f2);if(_0x9fd0f2[_0x4f98e2[0x0]]['error']&&parseInt(_0x9fd0f2[_0x4f98e2[0x0]][_0xd74f('0x1c')])===0x0){var _0x46398a={'messageId':_0x9fd0f2[_0x4f98e2[0x0]][_0xd74f('0x68')]};if(!_0x2b6a33['deliveryReport']){_0x46398a['read']=!![];}return _0x563066[_0xd74f('0x19')](_0x46398a);}else{return logger[_0xd74f('0x1c')](_0xd74f('0x28'),_0xd74f('0x29'),'csc',util[_0xd74f('0x39')](_0x9fd0f2[_0xd74f('0x1c')],{'showHidden':![],'depth':null}));}})[_0xd74f('0x1b')](function(_0x31a882){return logger[_0xd74f('0x1c')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','csc',util[_0xd74f('0x39')](_0x31a882,{'showHidden':![],'depth':null}));});}else{logger[_0xd74f('0x1c')](_0xd74f('0x28'),'afterCreate',_0xd74f('0x5b'),_0xd74f('0x69'));}break;case _0xd74f('0x6a'):if(_0x2b6a33[_0xd74f('0x5d')]){var _0xe55ef9={'method':_0xd74f('0x32'),'uri':_0xd74f('0x6b'),'headers':{'Authorization':_0x2b6a33[_0xd74f('0x5d')]},'body':{'content':_0x3cc83d[_0xd74f('0x3d')],'to':[_0x3cc83d[_0xd74f('0x22')]],'from':_0x2b6a33[_0xd74f('0x22')],'binary':![],'clientMessageId':_0xd74f('0x6c'),'charset':'UTF-8'},'json':!![]};rp(_0xe55ef9)[_0xd74f('0x18')](function(_0x5e7dba){if(!_0x5e7dba['error']){var _0x10672d={'messageId':_0x5e7dba[_0xd74f('0x23')][0x0]['apiMessageId']};if(!_0x2b6a33[_0xd74f('0x37')]){_0x10672d['read']=!![];}return _0x563066[_0xd74f('0x19')](_0x10672d);}else{return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0xd74f('0x29'),_0xd74f('0x6a'),util[_0xd74f('0x39')](_0x5e7dba[_0xd74f('0x1c')],{'showHidden':![],'depth':null}));}})[_0xd74f('0x1b')](function(_0x2690df){return logger['error'](_0xd74f('0x28'),_0xd74f('0x29'),'clickatell',util['inspect'](_0x2690df,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xd74f('0x28'),'afterCreate',_0xd74f('0x6a'),_0xd74f('0x69'));}break;case _0xd74f('0x6d'):if(_0x2b6a33[_0xd74f('0x5d')]){var _0xda4773={};var _0x25147e={'method':_0xd74f('0x32'),'uri':_0xd74f('0x6e'),'headers':{'Authorization':_0xd74f('0x6f')+_0x2b6a33[_0xd74f('0x5d')],'Content-Type':'application/json'},'body':{'from':_0x2b6a33[_0xd74f('0x22')],'to':_0x3cc83d[_0xd74f('0x22')],'text':_0x3cc83d[_0xd74f('0x3d')]},'json':!![]};return rp(_0x25147e)[_0xd74f('0x18')](function(_0x2bbb52){if(_0x2bbb52['code']==0xca){_0xda4773['message']=_0x2bbb52;var _0x7679cc={'method':_0xd74f('0x32'),'uri':_0xd74f('0x70'),'headers':{'Authorization':_0xd74f('0x6f')+_0x2b6a33['apiKey'],'Content-Type':_0xd74f('0x58')},'body':{'refid':_0xda4773['message'][_0xd74f('0x71')]},'json':!![]};return rp(_0x7679cc)[_0xd74f('0x18')](function(_0x1e6c04){_0xda4773[_0xd74f('0x72')]=_0x1e6c04;var _0x38c1ab={'messageId':_0xda4773[_0xd74f('0x73')]['refid'],'read':!![]};return _0x563066['update'](_0x38c1ab);});}else{return logger[_0xd74f('0x1c')](_0xd74f('0x28'),'afterCreate',_0xd74f('0x6d'),util[_0xd74f('0x39')](_0x2bbb52,{'showHidden':![],'depth':null}));}})[_0xd74f('0x1b')](function(_0x4cfddf){return logger[_0xd74f('0x1c')](_0xd74f('0x28'),_0xd74f('0x29'),_0xd74f('0x6d'),util[_0xd74f('0x39')](_0x4cfddf,{'showHidden':![],'depth':null}));});}else{return logger['error'](_0xd74f('0x28'),_0xd74f('0x29'),_0xd74f('0x6d'),_0xd74f('0x74'));}break;}}})['finally'](function(){_0x2e1c17();});}else{_0x2e1c17();}}},'charset':_0xd74f('0x75'),'collate':_0xd74f('0x76')});}; \ No newline at end of file +var _0xa331=['uuid','apiMessageId','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','code','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','refid','status','Token\x20not\x20received','finally','utf8mb4','utf8mb4_unicode_ci','../../config/logger','api','request-promise','path','rimraf','../../config/environment','exports','define','SmsMessage','messageId','fti_sms_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','isNil','UserId','update','catch','error','secret','SmsAccount','find','then','type','twilio','authToken','phone','accountSid','create','/api/sms/messages/','/status?token=','sid','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','https://api.skebby.it/API/v1.0/REST/','username','password','smsMethod','sender','login?username=','&password=','GET','split','sms','POST','session_key','total_sent','internal_order_id','read','skebby','inspect','Missing\x20parameters:\x20username,\x20password','senderString','https://smsapi.connectel.se/api/send/','requestid','deliveryReport','connectel','Missing\x20parameters:\x20authToken','clicksend','xCALLY\x20Motion','format','%s:%s','Basic\x20%s','toString','base64','http_code','data','queued_count','head','message_id','clickSend','authId','remote','token','https://api.plivo.com/v1/Account/%s/Message/','plivo','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','/auth/1/session','/sms/2/text/advanced','application/json','IBSSO\x20','messages','csc','apiKey','login','text','timestamp','keys','sort','length','createHash','md5','digest','hex','https://sms.csc.lv/external/get/send.php?','Missing\x20parameters:\x20apiKey','clickatell'];(function(_0x7b341f,_0x11e481){var _0x46d0a1=function(_0x6f779d){while(--_0x6f779d){_0x7b341f['push'](_0x7b341f['shift']());}};_0x46d0a1(++_0x11e481);}(_0xa331,0x1e6));var _0x1a33=function(_0x42673d,_0x1e43b2){_0x42673d=_0x42673d-0x0;var _0x2a3074=_0xa331[_0x42673d];return _0x2a3074;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1a33('0x0'))(_0x1a33('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x1a33('0x2'));var fs=require('fs');var path=require(_0x1a33('0x3'));var rimraf=require(_0x1a33('0x4'));var config=require(_0x1a33('0x5'));var attributes=require('./smsMessage.attributes');module[_0x1a33('0x6')]=function(_0x18d8a1,_0x4335b3){return _0x18d8a1[_0x1a33('0x7')](_0x1a33('0x8'),attributes,{'tableName':'sms_messages','paranoid':![],'indexes':[{'name':_0x1a33('0x9'),'fields':['messageId']},{'name':_0x1a33('0xa'),'fields':[_0x1a33('0xb')],'type':_0x1a33('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x5c5cfe,_0x16d8e1,_0x4468a2){var _0x580005=_0x18d8a1[_0x1a33('0xd')];var _0x19a098=_0x5c5cfe[_0x1a33('0xe')]({'plain':!![]});if(_0x19a098[_0x1a33('0xf')][_0x1a33('0x10')]()==='in'||_0x19a098[_0x1a33('0xf')][_0x1a33('0x10')]()===_0x1a33('0x11')&&!_0x19a098['secret']&&!_[_0x1a33('0x12')](_0x19a098[_0x1a33('0x13')])){_0x580005['SmsInteraction']['findOne']({'where':{'id':_0x19a098['SmsInteractionId']}})['then'](function(_0x57b35f){if(_0x57b35f){_0x57b35f[_0x1a33('0x14')]({'lastMsgAt':_0x19a098['createdAt'],'lastMsgDirection':_0x19a098[_0x1a33('0xf')]['toLowerCase']()});}})[_0x1a33('0x15')](function(_0x49efb8){console[_0x1a33('0x16')](_0x49efb8);});}if(_0x19a098[_0x1a33('0xf')]===_0x1a33('0x11')&&!_0x19a098[_0x1a33('0x17')]){var _0x110ecc;_0x580005[_0x1a33('0x18')][_0x1a33('0x19')]({'where':{'id':_0x19a098['SmsAccountId']},'raw':!![]})[_0x1a33('0x1a')](function(_0x649cb){_0x110ecc=_0x649cb;if(_0x110ecc&&_0x110ecc['type']){switch(_0x110ecc[_0x1a33('0x1b')]){case _0x1a33('0x1c'):var _0x21e4a1=require('twilio');if(_0x110ecc['accountSid']&&_0x110ecc[_0x1a33('0x1d')]&&_0x110ecc[_0x1a33('0x1e')]){var _0x333bc0=new _0x21e4a1(_0x110ecc[_0x1a33('0x1f')],_0x110ecc[_0x1a33('0x1d')]);_0x333bc0['messages'][_0x1a33('0x20')]({'body':_0x19a098[_0x1a33('0xb')],'to':_0x19a098[_0x1a33('0x1e')],'from':_0x110ecc[_0x1a33('0x1e')],'statusCallback':_0x110ecc['remote']+_0x1a33('0x21')+_0x19a098['id']+_0x1a33('0x22')+_0x110ecc['token']})[_0x1a33('0x1a')](function(_0x1a49ec){if(_0x1a49ec[_0x1a33('0x23')]){return _0x5c5cfe[_0x1a33('0x14')]({'messageId':_0x1a49ec['sid']});}})[_0x1a33('0x15')](function(_0xaa7dab){logger['error'](_0x1a33('0x24'),_0x1a33('0x25'),_0x1a33('0x1c'),util['inspect'](_0xaa7dab,{'showHidden':![],'depth':null}));});}else{logger[_0x1a33('0x16')](_0x1a33('0x24'),_0x1a33('0x25'),_0x1a33('0x1c'),_0x1a33('0x26'));}break;case'skebby':var _0x3753c9=_0x1a33('0x27');if(_0x110ecc[_0x1a33('0x28')]&&_0x110ecc[_0x1a33('0x29')]){var _0x4a5f05={'recipient':[_0x19a098[_0x1a33('0x1e')]],'message':_0x19a098[_0x1a33('0xb')],'message_type':_0x110ecc['smsMethod']};if(_0x110ecc[_0x1a33('0x2a')]&&_0x110ecc[_0x1a33('0x2a')]!=='SI'){_0x4a5f05[_0x1a33('0x2b')]=_0x110ecc[_0x1a33('0x1e')];}var _0xd728b5={'url':_0x3753c9+_0x1a33('0x2c')+_0x110ecc['username']+_0x1a33('0x2d')+_0x110ecc['password'],'method':_0x1a33('0x2e')};rp(_0xd728b5)[_0x1a33('0x1a')](function(_0x6529c8){var _0x606535=_0x6529c8[_0x1a33('0x2f')](';');var _0x2960e5={'user_key':_0x606535[0x0],'session_key':_0x606535[0x1]};_0xd728b5={'url':_0x3753c9+_0x1a33('0x30'),'method':_0x1a33('0x31'),'headers':{'user_key':_0x2960e5['user_key'],'Session_key':_0x2960e5[_0x1a33('0x32')]},'json':!![],'body':_0x4a5f05};return rp(_0xd728b5);})['then'](function(_0x5071f6){if(_0x5071f6[_0x1a33('0x33')]>=0x1){var _0x51632c={'messageId':_0x5071f6[_0x1a33('0x34')]};if(_0x110ecc[_0x1a33('0x2a')]!=='GP'||!_0x110ecc['deliveryReport']){_0x51632c[_0x1a33('0x35')]=!![];}return _0x5c5cfe['update'](_0x51632c);}else{return logger['error'](_0x1a33('0x24'),_0x1a33('0x25'),_0x1a33('0x36'),util[_0x1a33('0x37')](_0x5071f6,{'showHidden':![],'depth':null}));}})['catch'](function(_0x23ba9d){return logger[_0x1a33('0x16')](_0x1a33('0x24'),'afterCreate',_0x1a33('0x36'),util[_0x1a33('0x37')](_0x23ba9d,{'showHidden':![],'depth':null}));});}else{logger[_0x1a33('0x16')](_0x1a33('0x24'),_0x1a33('0x25'),_0x1a33('0x36'),_0x1a33('0x38'));}break;case'connectel':if(_0x110ecc[_0x1a33('0x1d')]){var _0x2fea95={'recipient':_0x19a098[_0x1a33('0x1e')],'message':_0x19a098[_0x1a33('0xb')],'sender':_0x110ecc[_0x1a33('0x39')]||_0x110ecc['phone'],'authorization':_0x110ecc[_0x1a33('0x1d')]};var _0x16d8e1={'method':_0x1a33('0x31'),'uri':_0x1a33('0x3a'),'body':_0x2fea95,'json':!![]};rp(_0x16d8e1)[_0x1a33('0x1a')](function(_0xb22ef0){var _0x2bec89={'messageId':_0xb22ef0[_0x1a33('0x3b')]};if(!_0x110ecc[_0x1a33('0x3c')]){_0x2bec89[_0x1a33('0x35')]=!![];}return _0x5c5cfe[_0x1a33('0x14')](_0x2bec89);})[_0x1a33('0x15')](function(_0x2bbf9e){logger[_0x1a33('0x16')](_0x1a33('0x24'),_0x1a33('0x25'),_0x1a33('0x3d'),util[_0x1a33('0x37')](_0x2bbf9e,{'showHidden':![],'depth':null}));});}else{logger[_0x1a33('0x16')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x1a33('0x3d'),_0x1a33('0x3e'));}break;case _0x1a33('0x3f'):if(_0x110ecc[_0x1a33('0x28')]&&_0x110ecc['password']){var _0x2fea95={'messages':[{'source':_0x1a33('0x40'),'to':_0x19a098[_0x1a33('0x1e')],'body':_0x19a098['body'],'from':_0x110ecc['senderString']||_0x110ecc[_0x1a33('0x1e')]}]};var _0x49e8f9=util[_0x1a33('0x41')](_0x1a33('0x42'),_0x110ecc['username'],_0x110ecc['password']);var _0x16d8e1={'method':_0x1a33('0x31'),'uri':'https://rest.clicksend.com/v3/sms/send','body':_0x2fea95,'headers':{'Authorization':util[_0x1a33('0x41')](_0x1a33('0x43'),new Buffer(_0x49e8f9)[_0x1a33('0x44')](_0x1a33('0x45')))},'json':!![]};rp(_0x16d8e1)[_0x1a33('0x1a')](function(_0x24ed06){if(_0x24ed06[_0x1a33('0x46')]>=0xc8&&_0x24ed06[_0x1a33('0x46')]<=0xce){if(_0x24ed06[_0x1a33('0x47')]&&_0x24ed06[_0x1a33('0x47')][_0x1a33('0x48')]>0x0){var _0x27889e=_[_0x1a33('0x49')](_0x24ed06[_0x1a33('0x47')]['messages']);var _0x109994={'messageId':_0x27889e[_0x1a33('0x4a')]};if(!_0x110ecc[_0x1a33('0x3c')]){_0x109994['read']=!![];}return _0x5c5cfe[_0x1a33('0x14')](_0x109994);}else{logger[_0x1a33('0x16')](_0x1a33('0x24'),_0x1a33('0x25'),_0x1a33('0x4b'),util[_0x1a33('0x37')](_0x24ed06,{'showHidden':![],'depth':null}));}}else{logger[_0x1a33('0x16')](_0x1a33('0x24'),_0x1a33('0x25'),_0x1a33('0x4b'),util['inspect'](_0x24ed06,{'showHidden':![],'depth':null}));}})[_0x1a33('0x15')](function(_0x4b749f){logger[_0x1a33('0x16')](_0x1a33('0x24'),_0x1a33('0x25'),'clickSend',util[_0x1a33('0x37')](_0x4b749f,{'showHidden':![],'depth':null}));});}else{logger[_0x1a33('0x16')](_0x1a33('0x24'),_0x1a33('0x25'),_0x1a33('0x4b'),_0x1a33('0x38'));}break;case'plivo':if(_0x110ecc[_0x1a33('0x4c')]&&_0x110ecc['authToken']){var _0x2fea95={'dst':_0x19a098['phone'],'text':_0x19a098[_0x1a33('0xb')],'src':_0x110ecc[_0x1a33('0x39')]||_0x110ecc['phone'],'url':_0x110ecc[_0x1a33('0x4d')]+_0x1a33('0x21')+_0x19a098['id']+'/status?token='+_0x110ecc[_0x1a33('0x4e')]};var _0x49e8f9=util[_0x1a33('0x41')](_0x1a33('0x42'),_0x110ecc[_0x1a33('0x4c')],_0x110ecc[_0x1a33('0x1d')]);var _0x16d8e1={'method':_0x1a33('0x31'),'uri':util['format'](_0x1a33('0x4f'),_0x110ecc['authId']),'body':_0x2fea95,'headers':{'Authorization':util[_0x1a33('0x41')]('Basic\x20%s',new Buffer(_0x49e8f9)[_0x1a33('0x44')]('base64'))},'json':!![]};rp(_0x16d8e1)[_0x1a33('0x1a')](function(_0x182424){var _0x3e95a2={'messageId':_0x182424['message_uuid'][0x0]};return _0x5c5cfe[_0x1a33('0x14')](_0x3e95a2);})[_0x1a33('0x15')](function(_0x2365ea){logger[_0x1a33('0x16')](_0x1a33('0x24'),_0x1a33('0x25'),_0x1a33('0x50'),util[_0x1a33('0x37')](_0x2365ea,{'showHidden':![],'depth':null}));});}else{logger[_0x1a33('0x16')](_0x1a33('0x24'),_0x1a33('0x25'),'plivo',_0x1a33('0x51'));}break;case _0x1a33('0x52'):if(_0x110ecc['username']&&_0x110ecc[_0x1a33('0x29')]){if(_0x110ecc[_0x1a33('0x53')]){var _0x339670={'method':'POST','uri':_0x110ecc[_0x1a33('0x53')]+_0x1a33('0x54'),'body':{'username':_0x110ecc[_0x1a33('0x28')],'password':_0x110ecc[_0x1a33('0x29')]},'json':!![]};return rp(_0x339670)['then'](function(_0xcab314){var _0x1a2f6f={'method':_0x1a33('0x31'),'uri':_0x110ecc['baseUrl']+_0x1a33('0x55'),'body':{'messages':[{'from':_0x110ecc[_0x1a33('0x1e')],'destinations':[{'to':_0x19a098[_0x1a33('0x1e')]}],'text':_0x19a098['body'],'notifyUrl':_0x110ecc[_0x1a33('0x4d')]+'/api/sms/messages/'+_0x19a098['id']+_0x1a33('0x22')+_0x110ecc[_0x1a33('0x4e')],'notifyContentType':_0x1a33('0x56'),'callbackData':_0x110ecc[_0x1a33('0x1e')]+';'+_0x19a098[_0x1a33('0xb')]}]},'headers':{'Authorization':_0x1a33('0x57')+_0xcab314[_0x1a33('0x4e')]},'json':!![]};return rp(_0x1a2f6f)[_0x1a33('0x1a')](function(_0x912313){if(_0x912313[_0x1a33('0x58')]){var _0x3fbf10={'messageId':_0x912313[_0x1a33('0x58')][0x0][_0x1a33('0x9')]};if(!_0x110ecc[_0x1a33('0x3c')]){_0x3fbf10['read']=!![];}return _0x5c5cfe[_0x1a33('0x14')](_0x3fbf10);}else{return logger['error'](_0x1a33('0x24'),'afterCreate','infobip',util[_0x1a33('0x37')](_0x912313,{'showHidden':![],'depth':null}));}});})[_0x1a33('0x15')](function(_0x1e7a88){return logger[_0x1a33('0x16')](_0x1a33('0x24'),_0x1a33('0x25'),_0x1a33('0x52'),util['inspect'](_0x1e7a88,{'showHidden':![],'depth':null}));});}else{logger[_0x1a33('0x16')](_0x1a33('0x24'),_0x1a33('0x25'),_0x1a33('0x52'),'Missing\x20parameters:\x20base_url');}}else{logger[_0x1a33('0x16')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x1a33('0x25'),_0x1a33('0x52'),'Missing\x20parameters:\x20username,\x20password');}break;case _0x1a33('0x59'):var _0x1cd40f=require('crypto');if(_0x110ecc[_0x1a33('0x5a')]){var _0x4eaf2e={};_0x4eaf2e[_0x1a33('0x5b')]=_0x110ecc[_0x1a33('0x28')];_0x4eaf2e[_0x1a33('0x1e')]=_0x19a098[_0x1a33('0x1e')];_0x4eaf2e[_0x1a33('0x2b')]=_0x110ecc['phone'];_0x4eaf2e[_0x1a33('0x5c')]=_0x19a098[_0x1a33('0xb')];_0x4eaf2e[_0x1a33('0x5d')]=+new Date();var _0x4b2fdf='';var _0x4537e5='';var _0x586bf9=Object[_0x1a33('0x5e')](_0x4eaf2e);_0x586bf9[_0x1a33('0x5f')]();for(var _0x574170=0x0;_0x574170<_0x586bf9[_0x1a33('0x60')];_0x574170++){if(_0x4b2fdf!=''){_0x4b2fdf+='&';}_0x4b2fdf+=_0x586bf9[_0x574170]+'='+encodeURIComponent(_0x4eaf2e[_0x586bf9[_0x574170]]);_0x4537e5+=_0x4eaf2e[_0x586bf9[_0x574170]];}_0x4537e5+=_0x110ecc[_0x1a33('0x5a')];_0x4537e5=_0x1cd40f[_0x1a33('0x61')](_0x1a33('0x62'))[_0x1a33('0x14')](_0x4537e5)[_0x1a33('0x63')](_0x1a33('0x64'));if(_0x4b2fdf!==''){_0x4b2fdf+='&';}_0x4b2fdf+='signature='+_0x4537e5;var _0xd728b5={'method':_0x1a33('0x2e'),'uri':_0x1a33('0x65')+_0x4b2fdf,'json':!![]};return rp(_0xd728b5)[_0x1a33('0x1a')](function(_0x3f881e){var _0x13a2e2=Object[_0x1a33('0x5e')](_0x3f881e);if(_0x3f881e[_0x13a2e2[0x0]][_0x1a33('0x16')]&&parseInt(_0x3f881e[_0x13a2e2[0x0]][_0x1a33('0x16')])===0x0){var _0x5ae945={'messageId':_0x3f881e[_0x13a2e2[0x0]]['id_sms']};if(!_0x110ecc[_0x1a33('0x3c')]){_0x5ae945[_0x1a33('0x35')]=!![];}return _0x5c5cfe[_0x1a33('0x14')](_0x5ae945);}else{return logger[_0x1a33('0x16')](_0x1a33('0x24'),_0x1a33('0x25'),_0x1a33('0x59'),util[_0x1a33('0x37')](_0x3f881e[_0x1a33('0x16')],{'showHidden':![],'depth':null}));}})['catch'](function(_0x2ab1b5){return logger[_0x1a33('0x16')](_0x1a33('0x24'),_0x1a33('0x25'),_0x1a33('0x59'),util[_0x1a33('0x37')](_0x2ab1b5,{'showHidden':![],'depth':null}));});}else{logger[_0x1a33('0x16')](_0x1a33('0x24'),_0x1a33('0x25'),_0x1a33('0x59'),_0x1a33('0x66'));}break;case _0x1a33('0x67'):if(_0x110ecc[_0x1a33('0x5a')]){var _0x5e10f0={'method':_0x1a33('0x31'),'uri':'https://platform.clickatell.com/messages','headers':{'Authorization':_0x110ecc[_0x1a33('0x5a')]},'body':{'content':_0x19a098['body'],'to':[_0x19a098[_0x1a33('0x1e')]],'from':_0x110ecc[_0x1a33('0x1e')],'binary':![],'clientMessageId':_0x1a33('0x68'),'charset':'UTF-8'},'json':!![]};rp(_0x5e10f0)['then'](function(_0xff4e00){if(!_0xff4e00[_0x1a33('0x16')]){var _0x5205fb={'messageId':_0xff4e00[_0x1a33('0x58')][0x0][_0x1a33('0x69')]};if(!_0x110ecc['deliveryReport']){_0x5205fb[_0x1a33('0x35')]=!![];}return _0x5c5cfe[_0x1a33('0x14')](_0x5205fb);}else{return logger[_0x1a33('0x16')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x1a33('0x25'),_0x1a33('0x67'),util[_0x1a33('0x37')](_0xff4e00[_0x1a33('0x16')],{'showHidden':![],'depth':null}));}})['catch'](function(_0x51af2a){return logger[_0x1a33('0x16')](_0x1a33('0x24'),'afterCreate',_0x1a33('0x67'),util[_0x1a33('0x37')](_0x51af2a,{'showHidden':![],'depth':null}));});}else{logger[_0x1a33('0x16')](_0x1a33('0x24'),_0x1a33('0x25'),'clickatell',_0x1a33('0x66'));}break;case _0x1a33('0x6a'):if(_0x110ecc[_0x1a33('0x5a')]){var _0x2a0c96={};var _0xd728b5={'method':_0x1a33('0x31'),'uri':_0x1a33('0x6b'),'headers':{'Authorization':_0x1a33('0x6c')+_0x110ecc[_0x1a33('0x5a')],'Content-Type':_0x1a33('0x56')},'body':{'from':_0x110ecc[_0x1a33('0x1e')],'to':_0x19a098[_0x1a33('0x1e')],'text':_0x19a098[_0x1a33('0xb')]},'json':!![]};return rp(_0xd728b5)[_0x1a33('0x1a')](function(_0x5bda25){if(_0x5bda25[_0x1a33('0x6d')]==0xca){_0x2a0c96[_0x1a33('0x6e')]=_0x5bda25;var _0x157630={'method':_0x1a33('0x31'),'uri':_0x1a33('0x6f'),'headers':{'Authorization':_0x1a33('0x6c')+_0x110ecc[_0x1a33('0x5a')],'Content-Type':_0x1a33('0x56')},'body':{'refid':_0x2a0c96[_0x1a33('0x6e')][_0x1a33('0x70')]},'json':!![]};return rp(_0x157630)['then'](function(_0x29b5af){_0x2a0c96[_0x1a33('0x71')]=_0x29b5af;var _0x4878ec={'messageId':_0x2a0c96[_0x1a33('0x6e')][_0x1a33('0x70')],'read':!![]};return _0x5c5cfe[_0x1a33('0x14')](_0x4878ec);});}else{return logger[_0x1a33('0x16')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x1a33('0x25'),_0x1a33('0x6a'),util[_0x1a33('0x37')](_0x5bda25,{'showHidden':![],'depth':null}));}})[_0x1a33('0x15')](function(_0xe8cd93){return logger[_0x1a33('0x16')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x1a33('0x25'),_0x1a33('0x6a'),util[_0x1a33('0x37')](_0xe8cd93,{'showHidden':![],'depth':null}));});}else{return logger['error'](_0x1a33('0x24'),_0x1a33('0x25'),_0x1a33('0x6a'),_0x1a33('0x72'));}break;}}})[_0x1a33('0x73')](function(){_0x4468a2();});}else{_0x4468a2();}}},'charset':_0x1a33('0x74'),'collate':_0x1a33('0x75')});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.rpc.js b/server/api/smsMessage/smsMessage.rpc.js index 2d6908f..4026218 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 _0x0b0e=['message','result','SmsMessage','create','body','options','CreateSmsMessage','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./smsMessage.socket','then','info','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','SmsMessage,\x20%s,\x20%s'];(function(_0x1381ee,_0x334424){var _0x26b8ef=function(_0x11e6eb){while(--_0x11e6eb){_0x1381ee['push'](_0x1381ee['shift']());}};_0x26b8ef(++_0x334424);}(_0x0b0e,0x187));var _0xe0b0=function(_0x1a9204,_0x1c9e00){_0x1a9204=_0x1a9204-0x0;var _0x17ca68=_0x0b0e[_0x1a9204];return _0x17ca68;};'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')]('SmsMessage,\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')]('SmsMessage,\x20%s,\x20%s',_0x1dd3b8,'request\x20sent');_0x1fef28(_0x2cdad2[_0xe0b0('0x1a')]['message']);}})['catch'](function(_0x4bce65){logger[_0xe0b0('0x16')]('SmsMessage,\x20%s,\x20%s',_0x1dd3b8,_0x4bce65);_0x2f32b6(_0x4bce65);});});}exports['CreateSmsMessage']=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')]('CreateSmsMessage',_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 _0xdb28=['then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','CreateSmsMessage','SmsMessage','create','body','options','raw','stringify','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','./smsMessage.socket','register','request'];(function(_0x286bfb,_0x46ac3c){var _0x52b683=function(_0x3e7fb1){while(--_0x3e7fb1){_0x286bfb['push'](_0x286bfb['shift']());}};_0x52b683(++_0x46ac3c);}(_0xdb28,0x106));var _0x8db2=function(_0x9e17ad,_0x22ec7a){_0x9e17ad=_0x9e17ad-0x0;var _0x16d896=_0xdb28[_0x9e17ad];return _0x16d896;};'use strict';var _=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var moment=require(_0x8db2('0x2'));var BPromise=require(_0x8db2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8db2('0x4'));var db=require(_0x8db2('0x5'))['db'];var utils=require(_0x8db2('0x6'));var logger=require(_0x8db2('0x7'))(_0x8db2('0x8'));var config=require('../../config/environment');var jayson=require(_0x8db2('0x9'));var client=jayson[_0x8db2('0xa')]['http']({'port':0x232a});config['redis']=_[_0x8db2('0xb')](config[_0x8db2('0xc')],{'host':_0x8db2('0xd'),'port':0x18eb});var socket=require(_0x8db2('0xe'))(new Redis(config[_0x8db2('0xc')]));require(_0x8db2('0xf'))[_0x8db2('0x10')](socket);function respondWithRpcPromise(_0x4ba340,_0x30dc90,_0x476216){return new BPromise(function(_0x1f62af,_0x57015f){return client[_0x8db2('0x11')](_0x4ba340,_0x476216)[_0x8db2('0x12')](function(_0x576475){logger[_0x8db2('0x13')](_0x8db2('0x14'),_0x30dc90,_0x8db2('0x15'));logger[_0x8db2('0x16')](_0x8db2('0x17'),_0x30dc90,'request\x20sent',JSON['stringify'](_0x576475));if(_0x576475[_0x8db2('0x18')]){if(_0x576475[_0x8db2('0x18')][_0x8db2('0x19')]===0x1f4){logger[_0x8db2('0x18')](_0x8db2('0x14'),_0x30dc90,_0x576475[_0x8db2('0x18')][_0x8db2('0x1a')]);return _0x57015f(_0x576475[_0x8db2('0x18')][_0x8db2('0x1a')]);}logger[_0x8db2('0x18')]('SmsMessage,\x20%s,\x20%s',_0x30dc90,_0x576475[_0x8db2('0x18')][_0x8db2('0x1a')]);return _0x1f62af(_0x576475['error'][_0x8db2('0x1a')]);}else{logger[_0x8db2('0x13')](_0x8db2('0x14'),_0x30dc90,_0x8db2('0x15'));_0x1f62af(_0x576475[_0x8db2('0x1b')][_0x8db2('0x1a')]);}})['catch'](function(_0x5df464){logger[_0x8db2('0x18')](_0x8db2('0x14'),_0x30dc90,_0x5df464);_0x57015f(_0x5df464);});});}exports[_0x8db2('0x1c')]=function(_0x1b64e4){var _0x58562e=this;return new Promise(function(_0x431d60,_0x36a9ff){return db[_0x8db2('0x1d')][_0x8db2('0x1e')](_0x1b64e4[_0x8db2('0x1f')],{'raw':_0x1b64e4['options']?_0x1b64e4[_0x8db2('0x20')][_0x8db2('0x21')]===undefined?!![]:![]:!![]})[_0x8db2('0x12')](function(_0x125be2){logger[_0x8db2('0x13')](_0x8db2('0x1c'),_0x1b64e4);logger[_0x8db2('0x16')]('CreateSmsMessage',_0x1b64e4,JSON[_0x8db2('0x22')](_0x125be2));_0x431d60(_0x125be2);})['catch'](function(_0x5725f0){logger['error']('CreateSmsMessage',_0x5725f0[_0x8db2('0x1a')],_0x1b64e4);_0x36a9ff(_0x58562e[_0x8db2('0x18')](0x1f4,_0x5725f0[_0x8db2('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.socket.js b/server/api/smsMessage/smsMessage.socket.js index a9c7919..8000694 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 _0x55fa=['remove','update','emit','removeListener','length','smsMessage:','save'];(function(_0x444b1b,_0x1be132){var _0x16d63f=function(_0x43b949){while(--_0x43b949){_0x444b1b['push'](_0x444b1b['shift']());}};_0x16d63f(++_0x1be132);}(_0x55fa,0x13a));var _0xa55f=function(_0x2301f5,_0x250268){_0x2301f5=_0x2301f5-0x0;var _0x27bb8e=_0x55fa[_0x2301f5];return _0x27bb8e;};'use strict';var SmsMessageEvents=require('./smsMessage.events');var events=[_0xa55f('0x0'),_0xa55f('0x1'),_0xa55f('0x2')];function createListener(_0x4541e3,_0x40d5c1){return function(_0x475a7f){_0x40d5c1[_0xa55f('0x3')](_0x4541e3,_0x475a7f);};}function removeListener(_0x3d6926,_0x324fb5){return function(){SmsMessageEvents[_0xa55f('0x4')](_0x3d6926,_0x324fb5);};}exports['register']=function(_0x45d20f){for(var _0x424b9f=0x0,_0x1c1299=events[_0xa55f('0x5')];_0x424b9f<_0x1c1299;_0x424b9f++){var _0x44d21a=events[_0x424b9f];var _0x4cbadb=createListener(_0xa55f('0x6')+_0x44d21a,_0x45d20f);SmsMessageEvents['on'](_0x44d21a,_0x4cbadb);}}; \ No newline at end of file +var _0x0ac5=['remove','emit','register','length','smsMessage:','./smsMessage.events','save'];(function(_0x3746fe,_0x30b6b0){var _0xb3093d=function(_0x424b01){while(--_0x424b01){_0x3746fe['push'](_0x3746fe['shift']());}};_0xb3093d(++_0x30b6b0);}(_0x0ac5,0x18d));var _0x50ac=function(_0x5aacff,_0x850a31){_0x5aacff=_0x5aacff-0x0;var _0x344274=_0x0ac5[_0x5aacff];return _0x344274;};'use strict';var SmsMessageEvents=require(_0x50ac('0x0'));var events=[_0x50ac('0x1'),_0x50ac('0x2'),'update'];function createListener(_0x1c95f8,_0x5404e2){return function(_0x20ec57){_0x5404e2[_0x50ac('0x3')](_0x1c95f8,_0x20ec57);};}function removeListener(_0x3ea310,_0x1afe1c){return function(){SmsMessageEvents['removeListener'](_0x3ea310,_0x1afe1c);};}exports[_0x50ac('0x4')]=function(_0x2f1478){for(var _0x37688e=0x0,_0x103007=events[_0x50ac('0x5')];_0x37688e<_0x103007;_0x37688e++){var _0x23dd7a=events[_0x37688e];var _0x430fe0=createListener(_0x50ac('0x6')+_0x23dd7a,_0x2f1478);SmsMessageEvents['on'](_0x23dd7a,_0x430fe0);}}; \ No newline at end of file diff --git a/server/api/smsQueue/index.js b/server/api/smsQueue/index.js index c737d88..c17e67a 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 _0x5d17=['update','delete','destroy','removeTeams','removeAgents','exports','multer','util','express','Router','../../components/auth/service','../../config/environment','./smsQueue.controller','get','isAuthenticated','/describe','describe','/:id','/:id/members','/:id/teams','getTeams','/:id/users','getAgents','post','create','addAgents','put'];(function(_0x237868,_0x267e95){var _0x3bc4f6=function(_0x4bed0d){while(--_0x4bed0d){_0x237868['push'](_0x237868['shift']());}};_0x3bc4f6(++_0x267e95);}(_0x5d17,0x114));var _0x75d1=function(_0x293fa4,_0x3ee6cc){_0x293fa4=_0x293fa4-0x0;var _0x58d190=_0x5d17[_0x293fa4];return _0x58d190;};'use strict';var multer=require(_0x75d1('0x0'));var util=require(_0x75d1('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x75d1('0x2'));var router=express[_0x75d1('0x3')]();var auth=require(_0x75d1('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x75d1('0x5'));var controller=require(_0x75d1('0x6'));router[_0x75d1('0x7')]('/',auth[_0x75d1('0x8')](),controller['index']);router[_0x75d1('0x7')](_0x75d1('0x9'),auth[_0x75d1('0x8')](),controller[_0x75d1('0xa')]);router[_0x75d1('0x7')](_0x75d1('0xb'),auth[_0x75d1('0x8')](),controller['show']);router['get'](_0x75d1('0xc'),auth['isAuthenticated'](),controller['getMembers']);router[_0x75d1('0x7')](_0x75d1('0xd'),auth['isAuthenticated'](),controller[_0x75d1('0xe')]);router[_0x75d1('0x7')](_0x75d1('0xf'),auth[_0x75d1('0x8')](),controller[_0x75d1('0x10')]);router[_0x75d1('0x11')]('/',auth['isAuthenticated'](),controller[_0x75d1('0x12')]);router[_0x75d1('0x11')](_0x75d1('0xd'),auth[_0x75d1('0x8')](),controller['addTeams']);router['post']('/:id/users',auth[_0x75d1('0x8')](),controller[_0x75d1('0x13')]);router[_0x75d1('0x14')]('/:id',auth[_0x75d1('0x8')](),controller[_0x75d1('0x15')]);router[_0x75d1('0x16')](_0x75d1('0xb'),auth[_0x75d1('0x8')](),controller[_0x75d1('0x17')]);router[_0x75d1('0x16')](_0x75d1('0xd'),auth[_0x75d1('0x8')](),controller[_0x75d1('0x18')]);router[_0x75d1('0x16')]('/:id/users',auth['isAuthenticated'](),controller[_0x75d1('0x19')]);module[_0x75d1('0x1a')]=router; \ No newline at end of file +var _0xd9c8=['multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsQueue.controller','get','/describe','isAuthenticated','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','post','create','addTeams','addAgents','put','update','delete','destroy','removeTeams','exports'];(function(_0x37087e,_0x719222){var _0x117e6f=function(_0x1591bf){while(--_0x1591bf){_0x37087e['push'](_0x37087e['shift']());}};_0x117e6f(++_0x719222);}(_0xd9c8,0x15c));var _0x8d9c=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd9c8[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x8d9c('0x0'));var util=require(_0x8d9c('0x1'));var path=require('path');var timeout=require(_0x8d9c('0x2'));var express=require(_0x8d9c('0x3'));var router=express[_0x8d9c('0x4')]();var auth=require(_0x8d9c('0x5'));var interaction=require(_0x8d9c('0x6'));var config=require(_0x8d9c('0x7'));var controller=require(_0x8d9c('0x8'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x8d9c('0x9')](_0x8d9c('0xa'),auth[_0x8d9c('0xb')](),controller['describe']);router[_0x8d9c('0x9')](_0x8d9c('0xc'),auth[_0x8d9c('0xb')](),controller[_0x8d9c('0xd')]);router[_0x8d9c('0x9')](_0x8d9c('0xe'),auth[_0x8d9c('0xb')](),controller[_0x8d9c('0xf')]);router['get'](_0x8d9c('0x10'),auth['isAuthenticated'](),controller[_0x8d9c('0x11')]);router['get'](_0x8d9c('0x12'),auth['isAuthenticated'](),controller['getAgents']);router[_0x8d9c('0x13')]('/',auth['isAuthenticated'](),controller[_0x8d9c('0x14')]);router[_0x8d9c('0x13')](_0x8d9c('0x10'),auth[_0x8d9c('0xb')](),controller[_0x8d9c('0x15')]);router[_0x8d9c('0x13')](_0x8d9c('0x12'),auth[_0x8d9c('0xb')](),controller[_0x8d9c('0x16')]);router[_0x8d9c('0x17')]('/:id',auth[_0x8d9c('0xb')](),controller[_0x8d9c('0x18')]);router[_0x8d9c('0x19')](_0x8d9c('0xc'),auth[_0x8d9c('0xb')](),controller[_0x8d9c('0x1a')]);router[_0x8d9c('0x19')](_0x8d9c('0x10'),auth[_0x8d9c('0xb')](),controller[_0x8d9c('0x1b')]);router['delete'](_0x8d9c('0x12'),auth[_0x8d9c('0xb')](),controller['removeAgents']);module[_0x8d9c('0x1c')]=router; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.attributes.js b/server/api/smsQueue/smsQueue.attributes.js index 0dfad97..215bb19 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 _0x8c9c=['ENUM','rrmemory','beepall','roundrobin','sequelize','exports','STRING','INTEGER'];(function(_0x148d5e,_0x58335e){var _0x4a0116=function(_0x498ae1){while(--_0x498ae1){_0x148d5e['push'](_0x148d5e['shift']());}};_0x4a0116(++_0x58335e);}(_0x8c9c,0xbc));var _0xc8c9=function(_0x1bf228,_0x43de68){_0x1bf228=_0x1bf228-0x0;var _0x336d6b=_0x8c9c[_0x1bf228];return _0x336d6b;};'use strict';var Sequelize=require(_0xc8c9('0x0'));module[_0xc8c9('0x1')]={'name':{'type':Sequelize[_0xc8c9('0x2')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xc8c9('0x2')]},'timeout':{'type':Sequelize[_0xc8c9('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xc8c9('0x4')](_0xc8c9('0x5'),_0xc8c9('0x6'),_0xc8c9('0x7'))}}; \ No newline at end of file +var _0x5295=['exports','name','STRING','ENUM','rrmemory','beepall','sequelize'];(function(_0x579b84,_0x1f6922){var _0x423049=function(_0x32a1ac){while(--_0x32a1ac){_0x579b84['push'](_0x579b84['shift']());}};_0x423049(++_0x1f6922);}(_0x5295,0x14f));var _0x5529=function(_0x39e905,_0x5de4f2){_0x39e905=_0x39e905-0x0;var _0x303779=_0x5295[_0x39e905];return _0x303779;};'use strict';var Sequelize=require(_0x5529('0x0'));module[_0x5529('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x5529('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x5529('0x3')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x5529('0x4')](_0x5529('0x5'),_0x5529('0x6'),'roundrobin')}}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.controller.js b/server/api/smsQueue/smsQueue.controller.js index ff461cc..c1be882 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 _0xc3a8=['model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','map','key','options','SmsQueue','includeAll','include','rows','catch','params','merge','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','SmsQueues','UserProfileSection','userProfileId','autoAssociation','destroy','describe','getMembers','UserSmsQueue','nolimit','order','SmsQueueId','User','findAndCountAll','UserId','agent','createdAt','format','%s/%s','SIP','smsPause','updatedAt','getTeams','ids','findAll','voicePause','interface','flatMap','Agents','sequelize','transaction','addTeams','each','findOrCreate','forEach','emit','userSmsQueue:save','removeTeams','Team','select','field','tq.TeamId','from','team_has_sms_queues','join','ut.TeamId\x20=\x20tq.TeamId','SmsQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','QueryTypes','SELECT','TeamId','includes','all','union','compact','isEmpty','removeAgents','userSmsQueue:remove','addAgents','omit','spread','isArray','getAgents','html-pdf','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','./smsQueue.socket','register','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','update','then','get','UserProfileResource','error','stack','name','send','rawAttributes'];(function(_0x30a00d,_0x10d207){var _0x24d279=function(_0x132450){while(--_0x132450){_0x30a00d['push'](_0x30a00d['shift']());}};_0x24d279(++_0x10d207);}(_0xc3a8,0xe8));var _0x8c3a=function(_0x5f46e7,_0x62f9f8){_0x5f46e7=_0x5f46e7-0x0;var _0x567e95=_0xc3a8[_0x5f46e7];return _0x567e95;};'use strict';var pdf=require(_0x8c3a('0x0'));var emlformat=require(_0x8c3a('0x1'));var rimraf=require(_0x8c3a('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8c3a('0x3'));var rp=require('request-promise');var moment=require(_0x8c3a('0x4'));var BPromise=require(_0x8c3a('0x5'));var Mustache=require(_0x8c3a('0x6'));var util=require(_0x8c3a('0x7'));var path=require('path');var sox=require(_0x8c3a('0x8'));var csv=require(_0x8c3a('0x9'));var ejs=require(_0x8c3a('0xa'));var fs=require('fs');var _=require(_0x8c3a('0xb'));var squel=require(_0x8c3a('0xc'));var crypto=require(_0x8c3a('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x8c3a('0xe'));var toCsv=require(_0x8c3a('0x9'));var querystring=require(_0x8c3a('0xf'));var Papa=require(_0x8c3a('0x10'));var Redis=require(_0x8c3a('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x8c3a('0x12'));var as=require(_0x8c3a('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8c3a('0x14'))(_0x8c3a('0x15'));var utils=require(_0x8c3a('0x16'));var config=require(_0x8c3a('0x17'));var db=require(_0x8c3a('0x18'))['db'];config[_0x8c3a('0x19')]=_['defaults'](config[_0x8c3a('0x19')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8c3a('0x19')]));require(_0x8c3a('0x1a'))[_0x8c3a('0x1b')](socket);function respondWithStatusCode(_0x31f3d4,_0x290298){_0x290298=_0x290298||0xcc;return function(_0x42604f){if(_0x42604f){return _0x31f3d4[_0x8c3a('0x1c')](_0x290298);}return _0x31f3d4[_0x8c3a('0x1d')](_0x290298)[_0x8c3a('0x1e')]();};}function respondWithResult(_0x5be4ea,_0x1d8b7b){_0x1d8b7b=_0x1d8b7b||0xc8;return function(_0x1766b3){if(_0x1766b3){return _0x5be4ea[_0x8c3a('0x1d')](_0x1d8b7b)[_0x8c3a('0x1f')](_0x1766b3);}};}function respondWithFilteredResult(_0x95e9d4,_0x54fe05){return function(_0x580838){if(_0x580838){var _0x51acdb=_0x580838[_0x8c3a('0x20')],_0x54fa56=_0x54fe05[_0x8c3a('0x21')],_0x29502b=_0x54fe05[_0x8c3a('0x21')]+_0x54fe05[_0x8c3a('0x22')],_0x39b0dc;if(_0x29502b>=_0x51acdb){_0x29502b=_0x51acdb;_0x39b0dc=0xc8;}else{_0x39b0dc=0xce;}_0x95e9d4['status'](_0x39b0dc);return _0x95e9d4[_0x8c3a('0x23')](_0x8c3a('0x24'),_0x54fa56+'-'+_0x29502b+'/'+_0x51acdb)['json'](_0x580838);}return null;};}function patchUpdates(_0x1590a7){return function(_0x59edf0){try{jsonpatch[_0x8c3a('0x25')](_0x59edf0,_0x1590a7,!![]);}catch(_0x1ed2c1){return BPromise[_0x8c3a('0x26')](_0x1ed2c1);}return _0x59edf0['save']();};}function saveUpdates(_0x429ca6,_0xb78cfc){return function(_0x39feb6){if(_0x39feb6){return _0x39feb6[_0x8c3a('0x27')](_0x429ca6)[_0x8c3a('0x28')](function(_0x3c5f12){return _0x3c5f12;});}return null;};}function removeEntity(_0x427917,_0x5546c3){return function(_0x4113dd){if(_0x4113dd){return _0x4113dd['destroy']()[_0x8c3a('0x28')](function(){var _0x59f2ee=_0x4113dd[_0x8c3a('0x29')]({'plain':!![]});var _0xe50c44='SmsQueues';return db[_0x8c3a('0x2a')]['destroy']({'where':{'type':_0xe50c44,'resourceId':_0x59f2ee['id']}})[_0x8c3a('0x28')](function(){return _0x4113dd;});})[_0x8c3a('0x28')](function(){_0x427917[_0x8c3a('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x47ca8a,_0x1228bd){return function(_0xff242b){if(!_0xff242b){_0x47ca8a['sendStatus'](0x194);}return _0xff242b;};}function handleError(_0x3287b2,_0x2f77b1){_0x2f77b1=_0x2f77b1||0x1f4;return function(_0x4ae1e4){logger[_0x8c3a('0x2b')](_0x4ae1e4[_0x8c3a('0x2c')]);if(_0x4ae1e4[_0x8c3a('0x2d')]){delete _0x4ae1e4['name'];}_0x3287b2[_0x8c3a('0x1d')](_0x2f77b1)[_0x8c3a('0x2e')](_0x4ae1e4);};}exports['index']=function(_0x3ba072,_0x289d0a){var _0x48638e={},_0x18608b={},_0x2cb9a5={'count':0x0,'rows':[]};var _0x2ef28a=db['SmsQueue'][_0x8c3a('0x2f')];_0x18608b[_0x8c3a('0x30')]=_[_0x8c3a('0x31')](_0x2ef28a);_0x18608b[_0x8c3a('0x32')]=_['keys'](_0x3ba072['query']);_0x18608b[_0x8c3a('0x33')]=_[_0x8c3a('0x34')](_0x18608b[_0x8c3a('0x30')],_0x18608b[_0x8c3a('0x32')]);_0x48638e[_0x8c3a('0x35')]=_['intersection'](_0x18608b[_0x8c3a('0x30')],qs[_0x8c3a('0x36')](_0x3ba072[_0x8c3a('0x32')][_0x8c3a('0x36')]));_0x48638e[_0x8c3a('0x35')]=_0x48638e['attributes'][_0x8c3a('0x37')]?_0x48638e['attributes']:_0x18608b[_0x8c3a('0x30')];if(!_0x3ba072['query'][_0x8c3a('0x38')]('nolimit')){_0x48638e[_0x8c3a('0x22')]=qs[_0x8c3a('0x22')](_0x3ba072[_0x8c3a('0x32')][_0x8c3a('0x22')]);_0x48638e['offset']=qs[_0x8c3a('0x21')](_0x3ba072[_0x8c3a('0x32')][_0x8c3a('0x21')]);}_0x48638e['order']=qs[_0x8c3a('0x39')](_0x3ba072[_0x8c3a('0x32')][_0x8c3a('0x39')]);_0x48638e[_0x8c3a('0x3a')]=qs[_0x8c3a('0x33')](_[_0x8c3a('0x3b')](_0x3ba072[_0x8c3a('0x32')],_0x18608b[_0x8c3a('0x33')]));if(_0x3ba072[_0x8c3a('0x32')][_0x8c3a('0x3c')]){_0x48638e[_0x8c3a('0x3a')]=_['merge'](_0x48638e[_0x8c3a('0x3a')],{'$or':_[_0x8c3a('0x3d')](_0x2ef28a,function(_0x14d710){if(_0x14d710['type'][_0x8c3a('0x3e')]!=='VIRTUAL'){var _0x13f665={};_0x13f665[_0x14d710['field']]={'$like':'%'+_0x3ba072[_0x8c3a('0x32')][_0x8c3a('0x3c')]+'%'};return _0x13f665;}})});}_0x48638e=_['merge']({},_0x48638e,_0x3ba072[_0x8c3a('0x3f')]);var _0x886d46={'where':_0x48638e[_0x8c3a('0x3a')]};return db[_0x8c3a('0x40')][_0x8c3a('0x20')](_0x886d46)[_0x8c3a('0x28')](function(_0x575014){_0x2cb9a5['count']=_0x575014;if(_0x3ba072[_0x8c3a('0x32')][_0x8c3a('0x41')]){_0x48638e[_0x8c3a('0x42')]=[{'all':!![]}];}return db[_0x8c3a('0x40')]['findAll'](_0x48638e);})[_0x8c3a('0x28')](function(_0x5d383a){_0x2cb9a5[_0x8c3a('0x43')]=_0x5d383a;return _0x2cb9a5;})[_0x8c3a('0x28')](respondWithFilteredResult(_0x289d0a,_0x48638e))[_0x8c3a('0x44')](handleError(_0x289d0a,null));};exports['show']=function(_0x10b644,_0x3f44ca){var _0x1d9c6c={'raw':!![],'where':{'id':_0x10b644[_0x8c3a('0x45')]['id']}},_0xe3776e={};_0xe3776e[_0x8c3a('0x30')]=_['keys'](db['SmsQueue'][_0x8c3a('0x2f')]);_0xe3776e[_0x8c3a('0x32')]=_[_0x8c3a('0x31')](_0x10b644['query']);_0xe3776e[_0x8c3a('0x33')]=_[_0x8c3a('0x34')](_0xe3776e[_0x8c3a('0x30')],_0xe3776e['query']);_0x1d9c6c[_0x8c3a('0x35')]=_[_0x8c3a('0x34')](_0xe3776e[_0x8c3a('0x30')],qs[_0x8c3a('0x36')](_0x10b644['query'][_0x8c3a('0x36')]));_0x1d9c6c[_0x8c3a('0x35')]=_0x1d9c6c['attributes'][_0x8c3a('0x37')]?_0x1d9c6c['attributes']:_0xe3776e['model'];if(_0x10b644['query'][_0x8c3a('0x41')]){_0x1d9c6c[_0x8c3a('0x42')]=[{'all':!![]}];}_0x1d9c6c=_[_0x8c3a('0x46')]({},_0x1d9c6c,_0x10b644[_0x8c3a('0x3f')]);return db[_0x8c3a('0x40')][_0x8c3a('0x47')](_0x1d9c6c)[_0x8c3a('0x28')](handleEntityNotFound(_0x3f44ca,null))[_0x8c3a('0x28')](respondWithResult(_0x3f44ca,null))[_0x8c3a('0x44')](handleError(_0x3f44ca,null));};exports[_0x8c3a('0x48')]=function(_0x1fb15d,_0x5bb316){return db[_0x8c3a('0x40')][_0x8c3a('0x48')](_0x1fb15d[_0x8c3a('0x49')],{})[_0x8c3a('0x28')](function(_0x3adf43){var _0x3b8167=_0x1fb15d[_0x8c3a('0x4a')][_0x8c3a('0x29')]({'plain':!![]});if(!_0x3b8167)throw new Error(_0x8c3a('0x4b'));if(_0x3b8167[_0x8c3a('0x4c')]===_0x8c3a('0x4a')){var _0x584c05=_0x3adf43[_0x8c3a('0x29')]({'plain':!![]});var _0x3d908f=_0x8c3a('0x4d');return db[_0x8c3a('0x4e')][_0x8c3a('0x47')]({'where':{'name':_0x3d908f,'userProfileId':_0x3b8167[_0x8c3a('0x4f')]},'raw':!![]})[_0x8c3a('0x28')](function(_0x26c320){if(_0x26c320&&_0x26c320[_0x8c3a('0x50')]===0x0){return db['UserProfileResource'][_0x8c3a('0x48')]({'name':_0x584c05[_0x8c3a('0x2d')],'resourceId':_0x584c05['id'],'type':_0x26c320[_0x8c3a('0x2d')],'sectionId':_0x26c320['id']},{})[_0x8c3a('0x28')](function(){return _0x3adf43;});}else{return _0x3adf43;}})['catch'](function(_0xa4008e){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xa4008e);throw _0xa4008e;});}return _0x3adf43;})[_0x8c3a('0x28')](respondWithResult(_0x5bb316,0xc9))[_0x8c3a('0x44')](handleError(_0x5bb316,null));};exports['update']=function(_0x17a75a,_0x407d84){if(_0x17a75a[_0x8c3a('0x49')]['id']){delete _0x17a75a[_0x8c3a('0x49')]['id'];}return db[_0x8c3a('0x40')][_0x8c3a('0x47')]({'where':{'id':_0x17a75a[_0x8c3a('0x45')]['id']}})[_0x8c3a('0x28')](handleEntityNotFound(_0x407d84,null))[_0x8c3a('0x28')](saveUpdates(_0x17a75a[_0x8c3a('0x49')],null))[_0x8c3a('0x28')](respondWithResult(_0x407d84,null))[_0x8c3a('0x44')](handleError(_0x407d84,null));};exports[_0x8c3a('0x51')]=function(_0x2ff6dc,_0x25ea3b){return db['SmsQueue'][_0x8c3a('0x47')]({'where':{'id':_0x2ff6dc['params']['id']}})[_0x8c3a('0x28')](handleEntityNotFound(_0x25ea3b,null))[_0x8c3a('0x28')](removeEntity(_0x25ea3b,null))[_0x8c3a('0x44')](handleError(_0x25ea3b,null));};exports['describe']=function(_0x3e1a44,_0x2fc5a2){return db[_0x8c3a('0x40')][_0x8c3a('0x52')]()['then'](respondWithResult(_0x2fc5a2,null))['catch'](handleError(_0x2fc5a2,null));};exports[_0x8c3a('0x53')]=function(_0x389575,_0x2d15e6,_0x590404){var _0x17073d={'raw':!![],'where':{}},_0x37f86f={},_0x1258c8;return db[_0x8c3a('0x40')]['findOne']({'where':{'id':_0x389575[_0x8c3a('0x45')]['id']}})[_0x8c3a('0x28')](handleEntityNotFound(_0x2d15e6,null))[_0x8c3a('0x28')](function(_0xa3c719){if(_0xa3c719){_0x1258c8=_0xa3c719[_0x8c3a('0x29')]({'plain':!![]});_0x37f86f[_0x8c3a('0x30')]=_['keys'](db[_0x8c3a('0x54')][_0x8c3a('0x2f')]);_0x37f86f['query']=_[_0x8c3a('0x31')](_0x389575[_0x8c3a('0x32')]);_0x37f86f[_0x8c3a('0x33')]=_[_0x8c3a('0x34')](_0x37f86f[_0x8c3a('0x30')],_0x37f86f[_0x8c3a('0x32')]);_0x17073d[_0x8c3a('0x35')]=_[_0x8c3a('0x34')](_0x37f86f['model'],qs[_0x8c3a('0x36')](_0x389575['query'][_0x8c3a('0x36')]));_0x17073d[_0x8c3a('0x35')]=_0x17073d[_0x8c3a('0x35')]['length']?_0x17073d[_0x8c3a('0x35')]:_0x37f86f['model'];if(!_0x389575['query']['hasOwnProperty'](_0x8c3a('0x55'))){_0x17073d[_0x8c3a('0x22')]=qs[_0x8c3a('0x22')](_0x389575['query'][_0x8c3a('0x22')]);_0x17073d[_0x8c3a('0x21')]=qs['offset'](_0x389575['query'][_0x8c3a('0x21')]);}_0x17073d[_0x8c3a('0x56')]=qs[_0x8c3a('0x39')](_0x389575[_0x8c3a('0x32')][_0x8c3a('0x39')]);_0x17073d[_0x8c3a('0x3a')]=qs['filters'](_['pick'](_0x389575['query'],_0x37f86f['filters']));_0x17073d[_0x8c3a('0x3a')][_0x8c3a('0x57')]=_0xa3c719['id'];if(_0x389575[_0x8c3a('0x32')][_0x8c3a('0x3c')]){_0x17073d[_0x8c3a('0x3a')]=_[_0x8c3a('0x46')](_0x17073d[_0x8c3a('0x3a')],{'$or':_[_0x8c3a('0x3d')](_0x17073d[_0x8c3a('0x35')],function(_0x236e5f){var _0x15e3b6={};_0x15e3b6[_0x236e5f]={'$like':'%'+_0x389575[_0x8c3a('0x32')][_0x8c3a('0x3c')]+'%'};return _0x15e3b6;})});}_0x17073d=_['merge']({},_0x17073d,_0x389575[_0x8c3a('0x3f')]);return db['UserSmsQueue']['findAll'](_0x17073d);}})[_0x8c3a('0x28')](function(_0x519eb8){if(_0x519eb8){return db[_0x8c3a('0x58')][_0x8c3a('0x59')]({'where':{'id':_[_0x8c3a('0x3d')](_0x519eb8,_0x8c3a('0x5a')),'role':_0x8c3a('0x5b')},'attributes':['id',_0x8c3a('0x2d'),'smsPause','updatedAt',_0x8c3a('0x5c')]});}})['then'](function(_0x52390b){if(_0x52390b){return{'count':_0x52390b['count'],'rows':_['map'](_0x52390b[_0x8c3a('0x43')],function(_0x4a10b7){return{'membername':_0x4a10b7['name'],'UserId':_0x4a10b7['id'],'queue_name':_0x1258c8[_0x8c3a('0x2d')],'SmsQueueId':_0x1258c8['id'],'interface':util[_0x8c3a('0x5d')](_0x8c3a('0x5e'),_0x8c3a('0x5f'),_0x4a10b7[_0x8c3a('0x2d')]),'penalty':0x0,'paused':_0x4a10b7[_0x8c3a('0x60')],'createdAt':_0x4a10b7[_0x8c3a('0x5c')],'updatedAt':_0x4a10b7[_0x8c3a('0x61')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x2d15e6,_0x17073d))[_0x8c3a('0x44')](handleError(_0x2d15e6,null));};exports['getTeams']=function(_0x2d54d8,_0x3924a1,_0x31a024){var _0x17a51d={};var _0x231624={};var _0x585898;var _0x5d68f1;return db[_0x8c3a('0x40')]['findOne']({'where':{'id':_0x2d54d8[_0x8c3a('0x45')]['id']}})[_0x8c3a('0x28')](handleEntityNotFound(_0x3924a1,null))['then'](function(_0x1d8283){if(_0x1d8283){_0x585898=_0x1d8283;_0x231624[_0x8c3a('0x30')]=_[_0x8c3a('0x31')](db['Team'][_0x8c3a('0x2f')]);_0x231624[_0x8c3a('0x32')]=_[_0x8c3a('0x31')](_0x2d54d8[_0x8c3a('0x32')]);_0x231624['filters']=_[_0x8c3a('0x34')](_0x231624[_0x8c3a('0x30')],_0x231624[_0x8c3a('0x32')]);_0x17a51d[_0x8c3a('0x35')]=_['intersection'](_0x231624[_0x8c3a('0x30')],qs[_0x8c3a('0x36')](_0x2d54d8[_0x8c3a('0x32')][_0x8c3a('0x36')]));_0x17a51d[_0x8c3a('0x35')]=_0x17a51d[_0x8c3a('0x35')][_0x8c3a('0x37')]?_0x17a51d[_0x8c3a('0x35')]:_0x231624[_0x8c3a('0x30')];_0x17a51d[_0x8c3a('0x56')]=qs[_0x8c3a('0x39')](_0x2d54d8['query'][_0x8c3a('0x39')]);_0x17a51d[_0x8c3a('0x3a')]=qs[_0x8c3a('0x33')](_[_0x8c3a('0x3b')](_0x2d54d8[_0x8c3a('0x32')],_0x231624[_0x8c3a('0x33')]));if(_0x2d54d8[_0x8c3a('0x32')][_0x8c3a('0x3c')]){_0x17a51d[_0x8c3a('0x3a')]=_[_0x8c3a('0x46')](_0x17a51d[_0x8c3a('0x3a')],{'$or':_[_0x8c3a('0x3d')](_0x17a51d['attributes'],function(_0x177e90){var _0x3a9b86={};_0x3a9b86[_0x177e90]={'$like':'%'+_0x2d54d8[_0x8c3a('0x32')][_0x8c3a('0x3c')]+'%'};return _0x3a9b86;})});}_0x17a51d=_[_0x8c3a('0x46')]({},_0x17a51d,_0x2d54d8[_0x8c3a('0x3f')]);return _0x585898[_0x8c3a('0x62')](_0x17a51d);}})[_0x8c3a('0x28')](function(_0xe631e5){if(_0xe631e5){_0x5d68f1=_0xe631e5[_0x8c3a('0x37')];if(!_0x2d54d8['query']['hasOwnProperty'](_0x8c3a('0x55'))){_0x17a51d[_0x8c3a('0x22')]=qs[_0x8c3a('0x22')](_0x2d54d8[_0x8c3a('0x32')][_0x8c3a('0x22')]);_0x17a51d[_0x8c3a('0x21')]=qs[_0x8c3a('0x21')](_0x2d54d8['query']['offset']);}return _0x585898[_0x8c3a('0x62')](_0x17a51d);}})[_0x8c3a('0x28')](function(_0x36ffcb){if(_0x36ffcb){return _0x36ffcb?{'count':_0x5d68f1,'rows':_0x36ffcb}:null;}})['then'](respondWithResult(_0x3924a1,null))[_0x8c3a('0x44')](handleError(_0x3924a1,null));};exports['addTeams']=function(_0x235da9,_0x22f24c,_0x4877d9){var _0xbfc48f=_0x235da9[_0x8c3a('0x49')][_0x8c3a('0x63')];return db['Team'][_0x8c3a('0x64')]({'where':{'id':_0xbfc48f},'attributes':['id'],'include':[{'model':db[_0x8c3a('0x58')],'as':'Agents','attributes':['id',_0x8c3a('0x2d'),'online',_0x8c3a('0x65'),_0x8c3a('0x66')],'raw':!![]}]})[_0x8c3a('0x28')](function(_0x32e97e){if(_0x32e97e){var _0x4069bc=_[_0x8c3a('0x67')](_0x32e97e,function(_0x3a411a){var _0x246690=_0x3a411a[_0x8c3a('0x29')]({'plain':!![]});return _0x246690[_0x8c3a('0x68')];});return db[_0x8c3a('0x40')][_0x8c3a('0x47')]({'where':{'id':_0x235da9[_0x8c3a('0x45')]['id']}})[_0x8c3a('0x28')](function(_0x4bdf77){return db[_0x8c3a('0x69')][_0x8c3a('0x6a')](function(_0x4170f9){return _0x4bdf77[_0x8c3a('0x6b')](_0xbfc48f,{'transaction':_0x4170f9})[_0x8c3a('0x28')](function(){return BPromise[_0x8c3a('0x6c')](_0x4069bc,function(_0x4ea951){return db['UserSmsQueue'][_0x8c3a('0x6d')]({'where':{'UserId':_0x4ea951['id'],'SmsQueueId':_0x235da9['params']['id']},'transaction':_0x4170f9});});})[_0x8c3a('0x28')](function(){_0x4069bc[_0x8c3a('0x6e')](function(_0x17cf08){socket[_0x8c3a('0x6f')](_0x8c3a('0x70'),{'UserId':_0x17cf08['id'],'SmsQueueId':_0x4bdf77['id']});});});});});}})[_0x8c3a('0x28')](respondWithStatusCode(_0x22f24c,null))[_0x8c3a('0x44')](handleError(_0x22f24c,null));};exports[_0x8c3a('0x71')]=function(_0x5d1bfd,_0x34d8e0,_0x31aa5b){return db[_0x8c3a('0x72')]['findAll']({'where':{'id':_0x5d1bfd[_0x8c3a('0x32')][_0x8c3a('0x63')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x8c3a('0x68'),'attributes':['id'],'raw':!![]}]})[_0x8c3a('0x28')](handleEntityNotFound(_0x34d8e0,null))[_0x8c3a('0x28')](function(_0x122287){var _0x26de13=_[_0x8c3a('0x3d')](_0x122287,'id');var _0x58bd44=[];var _0x2826da=[];var _0x4c4e8d=squel[_0x8c3a('0x73')]();_0x4c4e8d[_0x8c3a('0x74')](_0x8c3a('0x75'))[_0x8c3a('0x76')](_0x8c3a('0x77'),'tq')[_0x8c3a('0x78')]('user_has_teams','ut',_0x8c3a('0x79'))[_0x8c3a('0x3a')](_0x8c3a('0x7a'),_0x5d1bfd['params']['id']);for(var _0x395958=0x0;_0x395958<_0x122287[_0x8c3a('0x37')];_0x395958+=0x1){let _0x4d3021=_0x122287[_0x395958];for(var _0x5d0f8a=0x0;_0x5d0f8a<_0x4d3021[_0x8c3a('0x68')][_0x8c3a('0x37')];_0x5d0f8a+=0x1){let _0x521531=_0x4d3021[_0x8c3a('0x68')][_0x5d0f8a];var _0x18f15d=_0x4c4e8d[_0x8c3a('0x7b')]();_0x18f15d[_0x8c3a('0x3a')](_0x8c3a('0x7c'),_0x521531['id']);_0x2826da['push'](db[_0x8c3a('0x69')][_0x8c3a('0x32')](_0x18f15d['toString'](),{'type':db[_0x8c3a('0x69')][_0x8c3a('0x7d')][_0x8c3a('0x7e')]})[_0x8c3a('0x28')](function(_0x453025){if(_0x453025[_0x8c3a('0x37')]===0x1){return _0x521531['id'];}else{var _0x1adf9e=_['every'](_[_0x8c3a('0x3d')](_0x453025,_0x8c3a('0x7f')),function(_0x276439){return _[_0x8c3a('0x80')](_0x26de13,_0x276439);});if(_0x1adf9e){return _0x521531['id'];}}}));}}return BPromise[_0x8c3a('0x81')](_0x2826da)['then'](function(_0xff1705){_0x58bd44=_(_0x58bd44)[_0x8c3a('0x82')](_0xff1705)[_0x8c3a('0x83')]()['value']();return db[_0x8c3a('0x40')]['find']({'where':{'id':_0x5d1bfd['params']['id']}})[_0x8c3a('0x28')](function(_0x3c7309){return db[_0x8c3a('0x69')][_0x8c3a('0x6a')](function(_0x325203){return _0x3c7309[_0x8c3a('0x71')](_0x5d1bfd['query'][_0x8c3a('0x63')],{'transaction':_0x325203})[_0x8c3a('0x28')](function(){if(!_[_0x8c3a('0x84')](_0x58bd44)){return _0x3c7309[_0x8c3a('0x85')](_0x58bd44,{'transaction':_0x325203});}})[_0x8c3a('0x28')](function(){_0x58bd44['forEach'](function(_0x147bbf){socket[_0x8c3a('0x6f')](_0x8c3a('0x86'),{'UserId':_0x147bbf,'SmsQueueId':_0x3c7309['id']});});});});});});})[_0x8c3a('0x28')](respondWithStatusCode(_0x34d8e0,null))['catch'](handleError(_0x34d8e0,null));};exports[_0x8c3a('0x87')]=function(_0x510813,_0x1c0bc9,_0x9ab354){return db['SmsQueue'][_0x8c3a('0x47')]({'where':{'id':_0x510813[_0x8c3a('0x45')]['id']}})[_0x8c3a('0x28')](handleEntityNotFound(_0x1c0bc9,null))[_0x8c3a('0x28')](function(_0x5dba56){if(_0x5dba56){return _0x5dba56[_0x8c3a('0x87')](_0x510813[_0x8c3a('0x49')][_0x8c3a('0x63')],_[_0x8c3a('0x88')](_0x510813[_0x8c3a('0x49')],[_0x8c3a('0x63'),'id'])||{})[_0x8c3a('0x89')](function(_0x1612c2){for(var _0x8d28ff=0x0;_0x8d28ff<_0x510813[_0x8c3a('0x49')][_0x8c3a('0x63')][_0x8c3a('0x37')];_0x8d28ff+=0x1){socket[_0x8c3a('0x6f')](_0x8c3a('0x70'),{'UserId':_0x510813['body'][_0x8c3a('0x63')][_0x8d28ff],'SmsQueueId':_0x510813['params']['id']});}return _0x1612c2;});}})[_0x8c3a('0x28')](respondWithResult(_0x1c0bc9,null))[_0x8c3a('0x44')](handleError(_0x1c0bc9,null));};exports[_0x8c3a('0x85')]=function(_0x5ec18b,_0x2857dd,_0x1b141a){return db[_0x8c3a('0x40')][_0x8c3a('0x47')]({'where':{'id':_0x5ec18b[_0x8c3a('0x45')]['id']}})['then'](handleEntityNotFound(_0x2857dd,null))[_0x8c3a('0x28')](function(_0x961e4c){if(_0x961e4c){return _0x961e4c[_0x8c3a('0x85')](_0x5ec18b[_0x8c3a('0x32')][_0x8c3a('0x63')])['then'](function(){if(_[_0x8c3a('0x8a')](_0x5ec18b[_0x8c3a('0x32')]['ids'])){for(var _0x4f2206=0x0;_0x4f2206<_0x5ec18b[_0x8c3a('0x32')][_0x8c3a('0x63')][_0x8c3a('0x37')];_0x4f2206+=0x1){socket[_0x8c3a('0x6f')]('userSmsQueue:remove',{'UserId':Number(_0x5ec18b[_0x8c3a('0x32')][_0x8c3a('0x63')][_0x4f2206]),'SmsQueueId':Number(_0x5ec18b['params']['id'])});}}else{socket[_0x8c3a('0x6f')](_0x8c3a('0x86'),{'UserId':Number(_0x5ec18b[_0x8c3a('0x32')][_0x8c3a('0x63')]),'SmsQueueId':Number(_0x5ec18b[_0x8c3a('0x45')]['id'])});}});}})[_0x8c3a('0x28')](respondWithStatusCode(_0x2857dd,null))[_0x8c3a('0x44')](handleError(_0x2857dd,null));};exports[_0x8c3a('0x8b')]=function(_0x1a799c,_0x2ba68e,_0x1320b5){var _0x5d4c14={};var _0x377615={};var _0x2f947a;var _0x494715;return db['SmsQueue']['findOne']({'where':{'id':_0x1a799c[_0x8c3a('0x45')]['id']}})[_0x8c3a('0x28')](handleEntityNotFound(_0x2ba68e,null))['then'](function(_0x2cf4b7){if(_0x2cf4b7){_0x2f947a=_0x2cf4b7;_0x377615[_0x8c3a('0x30')]=_[_0x8c3a('0x31')](db[_0x8c3a('0x58')][_0x8c3a('0x2f')]);_0x377615[_0x8c3a('0x32')]=_['keys'](_0x1a799c['query']);_0x377615[_0x8c3a('0x33')]=_[_0x8c3a('0x34')](_0x377615['model'],_0x377615[_0x8c3a('0x32')]);_0x5d4c14[_0x8c3a('0x35')]=_[_0x8c3a('0x34')](_0x377615['model'],qs[_0x8c3a('0x36')](_0x1a799c['query']['fields']));_0x5d4c14[_0x8c3a('0x35')]=_0x5d4c14[_0x8c3a('0x35')][_0x8c3a('0x37')]?_0x5d4c14['attributes']:_0x377615[_0x8c3a('0x30')];_0x5d4c14[_0x8c3a('0x56')]=qs['sort'](_0x1a799c[_0x8c3a('0x32')]['sort']);_0x5d4c14[_0x8c3a('0x3a')]=qs[_0x8c3a('0x33')](_[_0x8c3a('0x3b')](_0x1a799c[_0x8c3a('0x32')],_0x377615[_0x8c3a('0x33')]));if(_0x1a799c['query'][_0x8c3a('0x3c')]){_0x5d4c14[_0x8c3a('0x3a')]=_[_0x8c3a('0x46')](_0x5d4c14[_0x8c3a('0x3a')],{'$or':_[_0x8c3a('0x3d')](_0x5d4c14[_0x8c3a('0x35')],function(_0x24a722){var _0x1e7bc8={};_0x1e7bc8[_0x24a722]={'$like':'%'+_0x1a799c[_0x8c3a('0x32')][_0x8c3a('0x3c')]+'%'};return _0x1e7bc8;})});}_0x5d4c14=_['merge']({},_0x5d4c14,_0x1a799c[_0x8c3a('0x3f')]);return _0x2f947a[_0x8c3a('0x8b')](_0x5d4c14);}})['then'](function(_0x1c5297){if(_0x1c5297){_0x494715=_0x1c5297[_0x8c3a('0x37')];if(!_0x1a799c[_0x8c3a('0x32')][_0x8c3a('0x38')]('nolimit')){_0x5d4c14['limit']=qs[_0x8c3a('0x22')](_0x1a799c[_0x8c3a('0x32')][_0x8c3a('0x22')]);_0x5d4c14[_0x8c3a('0x21')]=qs['offset'](_0x1a799c[_0x8c3a('0x32')][_0x8c3a('0x21')]);}return _0x2f947a[_0x8c3a('0x8b')](_0x5d4c14);}})[_0x8c3a('0x28')](function(_0x3504e5){if(_0x3504e5){return _0x3504e5?{'count':_0x494715,'rows':_0x3504e5}:null;}})[_0x8c3a('0x28')](respondWithResult(_0x2ba68e,null))[_0x8c3a('0x44')](handleError(_0x2ba68e,null));}; \ No newline at end of file +var _0x556b=['where','merge','VIRTUAL','field','count','include','findAll','rows','params','rawAttributes','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','name','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserSmsQueue','SmsQueueId','map','options','agent','smsPause','updatedAt','createdAt','format','SIP','getTeams','Team','Agents','online','voicePause','interface','flatMap','transaction','addTeams','each','findOrCreate','forEach','emit','userSmsQueue:save','removeTeams','ids','User','select','from','join','user_has_teams','SmsQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','sequelize','toString','SELECT','every','TeamId','includes','all','compact','removeAgents','omit','spread','isArray','userSmsQueue:remove','getAgents','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','localhost','./smsQueue.socket','status','end','json','offset','limit','Content-Range','reject','save','update','then','destroy','get','SmsQueues','UserProfileResource','sendStatus','error','stack','send','index','SmsQueue','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter'];(function(_0x2ec9c3,_0x263c66){var _0x3b771b=function(_0x595c06){while(--_0x595c06){_0x2ec9c3['push'](_0x2ec9c3['shift']());}};_0x3b771b(++_0x263c66);}(_0x556b,0x1d7));var _0xb556=function(_0x1a88bc,_0x16b7ba){_0x1a88bc=_0x1a88bc-0x0;var _0x476c3a=_0x556b[_0x1a88bc];return _0x476c3a;};'use strict';var pdf=require(_0xb556('0x0'));var emlformat=require(_0xb556('0x1'));var rimraf=require(_0xb556('0x2'));var zipdir=require(_0xb556('0x3'));var jsonpatch=require(_0xb556('0x4'));var rp=require('request-promise');var moment=require(_0xb556('0x5'));var BPromise=require(_0xb556('0x6'));var Mustache=require(_0xb556('0x7'));var util=require(_0xb556('0x8'));var path=require(_0xb556('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0xb556('0xa'));var squel=require(_0xb556('0xb'));var crypto=require(_0xb556('0xc'));var jsforce=require(_0xb556('0xd'));var deskjs=require(_0xb556('0xe'));var toCsv=require(_0xb556('0xf'));var querystring=require(_0xb556('0x10'));var Papa=require(_0xb556('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xb556('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb556('0x13'));var logger=require(_0xb556('0x14'))('api');var utils=require('../../config/utils');var config=require(_0xb556('0x15'));var db=require(_0xb556('0x16'))['db'];config[_0xb556('0x17')]=_[_0xb556('0x18')](config[_0xb556('0x17')],{'host':_0xb556('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xb556('0x1a'))['register'](socket);function respondWithStatusCode(_0x29fa7e,_0x52ff5e){_0x52ff5e=_0x52ff5e||0xcc;return function(_0x496737){if(_0x496737){return _0x29fa7e['sendStatus'](_0x52ff5e);}return _0x29fa7e[_0xb556('0x1b')](_0x52ff5e)[_0xb556('0x1c')]();};}function respondWithResult(_0xffd07,_0x329bd0){_0x329bd0=_0x329bd0||0xc8;return function(_0x26b4b9){if(_0x26b4b9){return _0xffd07[_0xb556('0x1b')](_0x329bd0)[_0xb556('0x1d')](_0x26b4b9);}};}function respondWithFilteredResult(_0x81e473,_0xcfaa19){return function(_0x485187){if(_0x485187){var _0x475808=_0x485187['count'],_0xaa8168=_0xcfaa19[_0xb556('0x1e')],_0xb378b2=_0xcfaa19[_0xb556('0x1e')]+_0xcfaa19[_0xb556('0x1f')],_0x23ada8;if(_0xb378b2>=_0x475808){_0xb378b2=_0x475808;_0x23ada8=0xc8;}else{_0x23ada8=0xce;}_0x81e473[_0xb556('0x1b')](_0x23ada8);return _0x81e473['set'](_0xb556('0x20'),_0xaa8168+'-'+_0xb378b2+'/'+_0x475808)[_0xb556('0x1d')](_0x485187);}return null;};}function patchUpdates(_0xa840e7){return function(_0x44ea29){try{jsonpatch['apply'](_0x44ea29,_0xa840e7,!![]);}catch(_0x110501){return BPromise[_0xb556('0x21')](_0x110501);}return _0x44ea29[_0xb556('0x22')]();};}function saveUpdates(_0x126af6,_0x420ddb){return function(_0x2973b5){if(_0x2973b5){return _0x2973b5[_0xb556('0x23')](_0x126af6)[_0xb556('0x24')](function(_0x33797a){return _0x33797a;});}return null;};}function removeEntity(_0x3d5ae7,_0x12b195){return function(_0xdeb065){if(_0xdeb065){return _0xdeb065[_0xb556('0x25')]()[_0xb556('0x24')](function(){var _0x35ca0b=_0xdeb065[_0xb556('0x26')]({'plain':!![]});var _0x22abed=_0xb556('0x27');return db[_0xb556('0x28')][_0xb556('0x25')]({'where':{'type':_0x22abed,'resourceId':_0x35ca0b['id']}})[_0xb556('0x24')](function(){return _0xdeb065;});})[_0xb556('0x24')](function(){_0x3d5ae7['status'](0xcc)[_0xb556('0x1c')]();});}};}function handleEntityNotFound(_0x5781e0,_0x4a43a0){return function(_0x530df7){if(!_0x530df7){_0x5781e0[_0xb556('0x29')](0x194);}return _0x530df7;};}function handleError(_0xc31c14,_0x27fd7e){_0x27fd7e=_0x27fd7e||0x1f4;return function(_0x58180c){logger[_0xb556('0x2a')](_0x58180c[_0xb556('0x2b')]);if(_0x58180c['name']){delete _0x58180c['name'];}_0xc31c14['status'](_0x27fd7e)[_0xb556('0x2c')](_0x58180c);};}exports[_0xb556('0x2d')]=function(_0x4bba03,_0x4d5311){var _0x3a6548={},_0x5d989c={},_0x2694de={'count':0x0,'rows':[]};var _0x50fddc=db[_0xb556('0x2e')]['rawAttributes'];_0x5d989c[_0xb556('0x2f')]=_[_0xb556('0x30')](_0x50fddc);_0x5d989c['query']=_['keys'](_0x4bba03[_0xb556('0x31')]);_0x5d989c[_0xb556('0x32')]=_[_0xb556('0x33')](_0x5d989c['model'],_0x5d989c[_0xb556('0x31')]);_0x3a6548[_0xb556('0x34')]=_[_0xb556('0x33')](_0x5d989c[_0xb556('0x2f')],qs['fields'](_0x4bba03[_0xb556('0x31')][_0xb556('0x35')]));_0x3a6548['attributes']=_0x3a6548['attributes'][_0xb556('0x36')]?_0x3a6548[_0xb556('0x34')]:_0x5d989c[_0xb556('0x2f')];if(!_0x4bba03['query'][_0xb556('0x37')](_0xb556('0x38'))){_0x3a6548['limit']=qs[_0xb556('0x1f')](_0x4bba03[_0xb556('0x31')][_0xb556('0x1f')]);_0x3a6548['offset']=qs['offset'](_0x4bba03[_0xb556('0x31')][_0xb556('0x1e')]);}_0x3a6548[_0xb556('0x39')]=qs['sort'](_0x4bba03[_0xb556('0x31')][_0xb556('0x3a')]);_0x3a6548['where']=qs['filters'](_[_0xb556('0x3b')](_0x4bba03[_0xb556('0x31')],_0x5d989c['filters']));if(_0x4bba03['query'][_0xb556('0x3c')]){_0x3a6548[_0xb556('0x3d')]=_[_0xb556('0x3e')](_0x3a6548[_0xb556('0x3d')],{'$or':_['map'](_0x50fddc,function(_0x348a8e){if(_0x348a8e['type']['key']!==_0xb556('0x3f')){var _0x553aa1={};_0x553aa1[_0x348a8e[_0xb556('0x40')]]={'$like':'%'+_0x4bba03[_0xb556('0x31')][_0xb556('0x3c')]+'%'};return _0x553aa1;}})});}_0x3a6548=_[_0xb556('0x3e')]({},_0x3a6548,_0x4bba03['options']);var _0x322538={'where':_0x3a6548[_0xb556('0x3d')]};return db[_0xb556('0x2e')][_0xb556('0x41')](_0x322538)[_0xb556('0x24')](function(_0x5a9efa){_0x2694de[_0xb556('0x41')]=_0x5a9efa;if(_0x4bba03[_0xb556('0x31')]['includeAll']){_0x3a6548[_0xb556('0x42')]=[{'all':!![]}];}return db[_0xb556('0x2e')][_0xb556('0x43')](_0x3a6548);})[_0xb556('0x24')](function(_0xb8f835){_0x2694de[_0xb556('0x44')]=_0xb8f835;return _0x2694de;})[_0xb556('0x24')](respondWithFilteredResult(_0x4d5311,_0x3a6548))['catch'](handleError(_0x4d5311,null));};exports['show']=function(_0x242558,_0x10c432){var _0x56e797={'raw':!![],'where':{'id':_0x242558[_0xb556('0x45')]['id']}},_0x513ba4={};_0x513ba4[_0xb556('0x2f')]=_[_0xb556('0x30')](db['SmsQueue'][_0xb556('0x46')]);_0x513ba4['query']=_[_0xb556('0x30')](_0x242558[_0xb556('0x31')]);_0x513ba4[_0xb556('0x32')]=_[_0xb556('0x33')](_0x513ba4['model'],_0x513ba4[_0xb556('0x31')]);_0x56e797[_0xb556('0x34')]=_['intersection'](_0x513ba4[_0xb556('0x2f')],qs[_0xb556('0x35')](_0x242558[_0xb556('0x31')][_0xb556('0x35')]));_0x56e797['attributes']=_0x56e797[_0xb556('0x34')][_0xb556('0x36')]?_0x56e797[_0xb556('0x34')]:_0x513ba4[_0xb556('0x2f')];if(_0x242558['query']['includeAll']){_0x56e797[_0xb556('0x42')]=[{'all':!![]}];}_0x56e797=_[_0xb556('0x3e')]({},_0x56e797,_0x242558['options']);return db[_0xb556('0x2e')][_0xb556('0x47')](_0x56e797)['then'](handleEntityNotFound(_0x10c432,null))[_0xb556('0x24')](respondWithResult(_0x10c432,null))[_0xb556('0x48')](handleError(_0x10c432,null));};exports[_0xb556('0x49')]=function(_0x15f288,_0x1085f5){return db[_0xb556('0x2e')][_0xb556('0x49')](_0x15f288[_0xb556('0x4a')],{})[_0xb556('0x24')](function(_0x42b2d8){var _0x1e222a=_0x15f288[_0xb556('0x4b')][_0xb556('0x26')]({'plain':!![]});if(!_0x1e222a)throw new Error(_0xb556('0x4c'));if(_0x1e222a[_0xb556('0x4d')]===_0xb556('0x4b')){var _0x52c0b1=_0x42b2d8[_0xb556('0x26')]({'plain':!![]});var _0x6211fc='SmsQueues';return db['UserProfileSection'][_0xb556('0x47')]({'where':{'name':_0x6211fc,'userProfileId':_0x1e222a[_0xb556('0x4e')]},'raw':!![]})[_0xb556('0x24')](function(_0x4544c3){if(_0x4544c3&&_0x4544c3['autoAssociation']===0x0){return db['UserProfileResource'][_0xb556('0x49')]({'name':_0x52c0b1[_0xb556('0x4f')],'resourceId':_0x52c0b1['id'],'type':_0x4544c3[_0xb556('0x4f')],'sectionId':_0x4544c3['id']},{})[_0xb556('0x24')](function(){return _0x42b2d8;});}else{return _0x42b2d8;}})[_0xb556('0x48')](function(_0xa12085){logger[_0xb556('0x2a')](_0xb556('0x50'),_0xa12085);throw _0xa12085;});}return _0x42b2d8;})[_0xb556('0x24')](respondWithResult(_0x1085f5,0xc9))['catch'](handleError(_0x1085f5,null));};exports[_0xb556('0x23')]=function(_0x4b986c,_0x4a2bc5){if(_0x4b986c[_0xb556('0x4a')]['id']){delete _0x4b986c[_0xb556('0x4a')]['id'];}return db[_0xb556('0x2e')][_0xb556('0x47')]({'where':{'id':_0x4b986c['params']['id']}})[_0xb556('0x24')](handleEntityNotFound(_0x4a2bc5,null))[_0xb556('0x24')](saveUpdates(_0x4b986c[_0xb556('0x4a')],null))[_0xb556('0x24')](respondWithResult(_0x4a2bc5,null))[_0xb556('0x48')](handleError(_0x4a2bc5,null));};exports[_0xb556('0x25')]=function(_0x59d406,_0x21cd40){return db[_0xb556('0x2e')][_0xb556('0x47')]({'where':{'id':_0x59d406['params']['id']}})['then'](handleEntityNotFound(_0x21cd40,null))[_0xb556('0x24')](removeEntity(_0x21cd40,null))[_0xb556('0x48')](handleError(_0x21cd40,null));};exports['describe']=function(_0x18c0be,_0x342416){return db[_0xb556('0x2e')][_0xb556('0x51')]()['then'](respondWithResult(_0x342416,null))[_0xb556('0x48')](handleError(_0x342416,null));};exports[_0xb556('0x52')]=function(_0x4c5933,_0x392c8b,_0x128a30){var _0x5bcca5={'raw':!![],'where':{}},_0x288c37={},_0x21ad02;return db[_0xb556('0x2e')][_0xb556('0x53')]({'where':{'id':_0x4c5933[_0xb556('0x45')]['id']}})[_0xb556('0x24')](handleEntityNotFound(_0x392c8b,null))['then'](function(_0x178f08){if(_0x178f08){_0x21ad02=_0x178f08['get']({'plain':!![]});_0x288c37[_0xb556('0x2f')]=_['keys'](db[_0xb556('0x54')][_0xb556('0x46')]);_0x288c37[_0xb556('0x31')]=_['keys'](_0x4c5933[_0xb556('0x31')]);_0x288c37[_0xb556('0x32')]=_[_0xb556('0x33')](_0x288c37[_0xb556('0x2f')],_0x288c37['query']);_0x5bcca5[_0xb556('0x34')]=_[_0xb556('0x33')](_0x288c37[_0xb556('0x2f')],qs[_0xb556('0x35')](_0x4c5933[_0xb556('0x31')][_0xb556('0x35')]));_0x5bcca5['attributes']=_0x5bcca5[_0xb556('0x34')]['length']?_0x5bcca5[_0xb556('0x34')]:_0x288c37['model'];if(!_0x4c5933[_0xb556('0x31')][_0xb556('0x37')](_0xb556('0x38'))){_0x5bcca5[_0xb556('0x1f')]=qs[_0xb556('0x1f')](_0x4c5933['query'][_0xb556('0x1f')]);_0x5bcca5['offset']=qs['offset'](_0x4c5933[_0xb556('0x31')][_0xb556('0x1e')]);}_0x5bcca5['order']=qs[_0xb556('0x3a')](_0x4c5933[_0xb556('0x31')][_0xb556('0x3a')]);_0x5bcca5['where']=qs[_0xb556('0x32')](_[_0xb556('0x3b')](_0x4c5933[_0xb556('0x31')],_0x288c37[_0xb556('0x32')]));_0x5bcca5['where'][_0xb556('0x55')]=_0x178f08['id'];if(_0x4c5933[_0xb556('0x31')][_0xb556('0x3c')]){_0x5bcca5[_0xb556('0x3d')]=_[_0xb556('0x3e')](_0x5bcca5['where'],{'$or':_[_0xb556('0x56')](_0x5bcca5[_0xb556('0x34')],function(_0x17376a){var _0x1cfa23={};_0x1cfa23[_0x17376a]={'$like':'%'+_0x4c5933['query'][_0xb556('0x3c')]+'%'};return _0x1cfa23;})});}_0x5bcca5=_[_0xb556('0x3e')]({},_0x5bcca5,_0x4c5933[_0xb556('0x57')]);return db[_0xb556('0x54')]['findAll'](_0x5bcca5);}})[_0xb556('0x24')](function(_0x1b1998){if(_0x1b1998){return db['User']['findAndCountAll']({'where':{'id':_[_0xb556('0x56')](_0x1b1998,'UserId'),'role':_0xb556('0x58')},'attributes':['id',_0xb556('0x4f'),_0xb556('0x59'),_0xb556('0x5a'),_0xb556('0x5b')]});}})[_0xb556('0x24')](function(_0x5cf17f){if(_0x5cf17f){return{'count':_0x5cf17f[_0xb556('0x41')],'rows':_['map'](_0x5cf17f[_0xb556('0x44')],function(_0x14a07a){return{'membername':_0x14a07a[_0xb556('0x4f')],'UserId':_0x14a07a['id'],'queue_name':_0x21ad02[_0xb556('0x4f')],'SmsQueueId':_0x21ad02['id'],'interface':util[_0xb556('0x5c')]('%s/%s',_0xb556('0x5d'),_0x14a07a[_0xb556('0x4f')]),'penalty':0x0,'paused':_0x14a07a[_0xb556('0x59')],'createdAt':_0x14a07a[_0xb556('0x5b')],'updatedAt':_0x14a07a[_0xb556('0x5a')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xb556('0x24')](respondWithFilteredResult(_0x392c8b,_0x5bcca5))['catch'](handleError(_0x392c8b,null));};exports[_0xb556('0x5e')]=function(_0x278e89,_0x5bae62,_0x429a82){var _0x1a386a={};var _0x3116fb={};var _0x1f656d;var _0x478245;return db[_0xb556('0x2e')][_0xb556('0x53')]({'where':{'id':_0x278e89[_0xb556('0x45')]['id']}})[_0xb556('0x24')](handleEntityNotFound(_0x5bae62,null))[_0xb556('0x24')](function(_0x37ca3a){if(_0x37ca3a){_0x1f656d=_0x37ca3a;_0x3116fb[_0xb556('0x2f')]=_[_0xb556('0x30')](db[_0xb556('0x5f')]['rawAttributes']);_0x3116fb[_0xb556('0x31')]=_[_0xb556('0x30')](_0x278e89[_0xb556('0x31')]);_0x3116fb[_0xb556('0x32')]=_[_0xb556('0x33')](_0x3116fb['model'],_0x3116fb[_0xb556('0x31')]);_0x1a386a[_0xb556('0x34')]=_[_0xb556('0x33')](_0x3116fb['model'],qs[_0xb556('0x35')](_0x278e89[_0xb556('0x31')][_0xb556('0x35')]));_0x1a386a[_0xb556('0x34')]=_0x1a386a[_0xb556('0x34')][_0xb556('0x36')]?_0x1a386a[_0xb556('0x34')]:_0x3116fb[_0xb556('0x2f')];_0x1a386a['order']=qs[_0xb556('0x3a')](_0x278e89[_0xb556('0x31')][_0xb556('0x3a')]);_0x1a386a[_0xb556('0x3d')]=qs[_0xb556('0x32')](_[_0xb556('0x3b')](_0x278e89[_0xb556('0x31')],_0x3116fb[_0xb556('0x32')]));if(_0x278e89['query']['filter']){_0x1a386a[_0xb556('0x3d')]=_[_0xb556('0x3e')](_0x1a386a[_0xb556('0x3d')],{'$or':_[_0xb556('0x56')](_0x1a386a[_0xb556('0x34')],function(_0x5ce0a9){var _0x571b50={};_0x571b50[_0x5ce0a9]={'$like':'%'+_0x278e89['query'][_0xb556('0x3c')]+'%'};return _0x571b50;})});}_0x1a386a=_[_0xb556('0x3e')]({},_0x1a386a,_0x278e89[_0xb556('0x57')]);return _0x1f656d[_0xb556('0x5e')](_0x1a386a);}})[_0xb556('0x24')](function(_0x1b0708){if(_0x1b0708){_0x478245=_0x1b0708[_0xb556('0x36')];if(!_0x278e89[_0xb556('0x31')][_0xb556('0x37')]('nolimit')){_0x1a386a[_0xb556('0x1f')]=qs[_0xb556('0x1f')](_0x278e89[_0xb556('0x31')][_0xb556('0x1f')]);_0x1a386a[_0xb556('0x1e')]=qs[_0xb556('0x1e')](_0x278e89[_0xb556('0x31')][_0xb556('0x1e')]);}return _0x1f656d[_0xb556('0x5e')](_0x1a386a);}})[_0xb556('0x24')](function(_0x2edb5c){if(_0x2edb5c){return _0x2edb5c?{'count':_0x478245,'rows':_0x2edb5c}:null;}})[_0xb556('0x24')](respondWithResult(_0x5bae62,null))['catch'](handleError(_0x5bae62,null));};exports['addTeams']=function(_0x318926,_0x9f170d,_0x3e6fdd){var _0xf85a3c=_0x318926[_0xb556('0x4a')]['ids'];return db[_0xb556('0x5f')]['findAll']({'where':{'id':_0xf85a3c},'attributes':['id'],'include':[{'model':db['User'],'as':_0xb556('0x60'),'attributes':['id',_0xb556('0x4f'),_0xb556('0x61'),_0xb556('0x62'),_0xb556('0x63')],'raw':!![]}]})['then'](function(_0x397429){if(_0x397429){var _0x18a65b=_[_0xb556('0x64')](_0x397429,function(_0x39f25e){var _0x302eaa=_0x39f25e[_0xb556('0x26')]({'plain':!![]});return _0x302eaa[_0xb556('0x60')];});return db[_0xb556('0x2e')][_0xb556('0x47')]({'where':{'id':_0x318926[_0xb556('0x45')]['id']}})[_0xb556('0x24')](function(_0x3970c3){return db['sequelize'][_0xb556('0x65')](function(_0x43068c){return _0x3970c3[_0xb556('0x66')](_0xf85a3c,{'transaction':_0x43068c})[_0xb556('0x24')](function(){return BPromise[_0xb556('0x67')](_0x18a65b,function(_0x51df10){return db[_0xb556('0x54')][_0xb556('0x68')]({'where':{'UserId':_0x51df10['id'],'SmsQueueId':_0x318926[_0xb556('0x45')]['id']},'transaction':_0x43068c});});})[_0xb556('0x24')](function(){_0x18a65b[_0xb556('0x69')](function(_0x43d5a5){socket[_0xb556('0x6a')](_0xb556('0x6b'),{'UserId':_0x43d5a5['id'],'SmsQueueId':_0x3970c3['id']});});});});});}})[_0xb556('0x24')](respondWithStatusCode(_0x9f170d,null))[_0xb556('0x48')](handleError(_0x9f170d,null));};exports[_0xb556('0x6c')]=function(_0x3a4283,_0x50c118,_0x18c462){return db[_0xb556('0x5f')][_0xb556('0x43')]({'where':{'id':_0x3a4283[_0xb556('0x31')][_0xb556('0x6d')]},'attributes':['id'],'include':[{'model':db[_0xb556('0x6e')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xb556('0x24')](handleEntityNotFound(_0x50c118,null))[_0xb556('0x24')](function(_0x4541d3){var _0x39d3a1=_[_0xb556('0x56')](_0x4541d3,'id');var _0x25f134=[];var _0x6e35db=[];var _0x5b0d62=squel[_0xb556('0x6f')]();_0x5b0d62[_0xb556('0x40')]('tq.TeamId')[_0xb556('0x70')]('team_has_sms_queues','tq')[_0xb556('0x71')](_0xb556('0x72'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0xb556('0x3d')](_0xb556('0x73'),_0x3a4283[_0xb556('0x45')]['id']);for(var _0x9edc7d=0x0;_0x9edc7d<_0x4541d3[_0xb556('0x36')];_0x9edc7d+=0x1){let _0x3ae24c=_0x4541d3[_0x9edc7d];for(var _0x22cafe=0x0;_0x22cafe<_0x3ae24c[_0xb556('0x60')][_0xb556('0x36')];_0x22cafe+=0x1){let _0x3db7b6=_0x3ae24c['Agents'][_0x22cafe];var _0x2d9ead=_0x5b0d62[_0xb556('0x74')]();_0x2d9ead[_0xb556('0x3d')](_0xb556('0x75'),_0x3db7b6['id']);_0x6e35db[_0xb556('0x76')](db[_0xb556('0x77')]['query'](_0x2d9ead[_0xb556('0x78')](),{'type':db[_0xb556('0x77')]['QueryTypes'][_0xb556('0x79')]})[_0xb556('0x24')](function(_0x35bafb){if(_0x35bafb[_0xb556('0x36')]===0x1){return _0x3db7b6['id'];}else{var _0xf25a45=_[_0xb556('0x7a')](_['map'](_0x35bafb,_0xb556('0x7b')),function(_0x4b0117){return _[_0xb556('0x7c')](_0x39d3a1,_0x4b0117);});if(_0xf25a45){return _0x3db7b6['id'];}}}));}}return BPromise[_0xb556('0x7d')](_0x6e35db)[_0xb556('0x24')](function(_0x2c875f){_0x25f134=_(_0x25f134)['union'](_0x2c875f)[_0xb556('0x7e')]()['value']();return db[_0xb556('0x2e')][_0xb556('0x47')]({'where':{'id':_0x3a4283['params']['id']}})['then'](function(_0xaea1c1){return db[_0xb556('0x77')][_0xb556('0x65')](function(_0xd13c58){return _0xaea1c1['removeTeams'](_0x3a4283[_0xb556('0x31')][_0xb556('0x6d')],{'transaction':_0xd13c58})['then'](function(){if(!_['isEmpty'](_0x25f134)){return _0xaea1c1[_0xb556('0x7f')](_0x25f134,{'transaction':_0xd13c58});}})[_0xb556('0x24')](function(){_0x25f134[_0xb556('0x69')](function(_0x20af70){socket[_0xb556('0x6a')]('userSmsQueue:remove',{'UserId':_0x20af70,'SmsQueueId':_0xaea1c1['id']});});});});});});})[_0xb556('0x24')](respondWithStatusCode(_0x50c118,null))['catch'](handleError(_0x50c118,null));};exports['addAgents']=function(_0x13d205,_0x24e59c,_0x2602d6){return db['SmsQueue'][_0xb556('0x47')]({'where':{'id':_0x13d205['params']['id']}})['then'](handleEntityNotFound(_0x24e59c,null))[_0xb556('0x24')](function(_0x1c3842){if(_0x1c3842){return _0x1c3842['addAgents'](_0x13d205[_0xb556('0x4a')][_0xb556('0x6d')],_[_0xb556('0x80')](_0x13d205['body'],[_0xb556('0x6d'),'id'])||{})[_0xb556('0x81')](function(_0x589462){for(var _0x408a63=0x0;_0x408a63<_0x13d205[_0xb556('0x4a')][_0xb556('0x6d')][_0xb556('0x36')];_0x408a63+=0x1){socket['emit']('userSmsQueue:save',{'UserId':_0x13d205[_0xb556('0x4a')][_0xb556('0x6d')][_0x408a63],'SmsQueueId':_0x13d205[_0xb556('0x45')]['id']});}return _0x589462;});}})[_0xb556('0x24')](respondWithResult(_0x24e59c,null))[_0xb556('0x48')](handleError(_0x24e59c,null));};exports[_0xb556('0x7f')]=function(_0x5697bd,_0x25a7a5,_0xd6bc2){return db[_0xb556('0x2e')]['find']({'where':{'id':_0x5697bd[_0xb556('0x45')]['id']}})[_0xb556('0x24')](handleEntityNotFound(_0x25a7a5,null))[_0xb556('0x24')](function(_0x5e8901){if(_0x5e8901){return _0x5e8901[_0xb556('0x7f')](_0x5697bd[_0xb556('0x31')][_0xb556('0x6d')])[_0xb556('0x24')](function(){if(_[_0xb556('0x82')](_0x5697bd[_0xb556('0x31')][_0xb556('0x6d')])){for(var _0x599ff7=0x0;_0x599ff7<_0x5697bd[_0xb556('0x31')][_0xb556('0x6d')][_0xb556('0x36')];_0x599ff7+=0x1){socket[_0xb556('0x6a')]('userSmsQueue:remove',{'UserId':Number(_0x5697bd[_0xb556('0x31')][_0xb556('0x6d')][_0x599ff7]),'SmsQueueId':Number(_0x5697bd[_0xb556('0x45')]['id'])});}}else{socket[_0xb556('0x6a')](_0xb556('0x83'),{'UserId':Number(_0x5697bd[_0xb556('0x31')][_0xb556('0x6d')]),'SmsQueueId':Number(_0x5697bd[_0xb556('0x45')]['id'])});}});}})['then'](respondWithStatusCode(_0x25a7a5,null))[_0xb556('0x48')](handleError(_0x25a7a5,null));};exports['getAgents']=function(_0x54eb6d,_0x2b904f,_0x4d5271){var _0x20dba8={};var _0x5e54a2={};var _0x1cd01c;var _0x31138c;return db['SmsQueue']['findOne']({'where':{'id':_0x54eb6d['params']['id']}})['then'](handleEntityNotFound(_0x2b904f,null))['then'](function(_0x588648){if(_0x588648){_0x1cd01c=_0x588648;_0x5e54a2['model']=_[_0xb556('0x30')](db[_0xb556('0x6e')][_0xb556('0x46')]);_0x5e54a2[_0xb556('0x31')]=_[_0xb556('0x30')](_0x54eb6d[_0xb556('0x31')]);_0x5e54a2['filters']=_[_0xb556('0x33')](_0x5e54a2[_0xb556('0x2f')],_0x5e54a2[_0xb556('0x31')]);_0x20dba8[_0xb556('0x34')]=_['intersection'](_0x5e54a2[_0xb556('0x2f')],qs[_0xb556('0x35')](_0x54eb6d[_0xb556('0x31')][_0xb556('0x35')]));_0x20dba8['attributes']=_0x20dba8['attributes'][_0xb556('0x36')]?_0x20dba8[_0xb556('0x34')]:_0x5e54a2[_0xb556('0x2f')];_0x20dba8[_0xb556('0x39')]=qs['sort'](_0x54eb6d['query'][_0xb556('0x3a')]);_0x20dba8[_0xb556('0x3d')]=qs[_0xb556('0x32')](_[_0xb556('0x3b')](_0x54eb6d[_0xb556('0x31')],_0x5e54a2[_0xb556('0x32')]));if(_0x54eb6d[_0xb556('0x31')][_0xb556('0x3c')]){_0x20dba8['where']=_[_0xb556('0x3e')](_0x20dba8[_0xb556('0x3d')],{'$or':_['map'](_0x20dba8[_0xb556('0x34')],function(_0x516792){var _0xfedd2e={};_0xfedd2e[_0x516792]={'$like':'%'+_0x54eb6d[_0xb556('0x31')][_0xb556('0x3c')]+'%'};return _0xfedd2e;})});}_0x20dba8=_['merge']({},_0x20dba8,_0x54eb6d['options']);return _0x1cd01c[_0xb556('0x84')](_0x20dba8);}})['then'](function(_0x4e5ab1){if(_0x4e5ab1){_0x31138c=_0x4e5ab1['length'];if(!_0x54eb6d[_0xb556('0x31')][_0xb556('0x37')](_0xb556('0x38'))){_0x20dba8[_0xb556('0x1f')]=qs[_0xb556('0x1f')](_0x54eb6d['query']['limit']);_0x20dba8[_0xb556('0x1e')]=qs[_0xb556('0x1e')](_0x54eb6d['query'][_0xb556('0x1e')]);}return _0x1cd01c[_0xb556('0x84')](_0x20dba8);}})['then'](function(_0x2ed098){if(_0x2ed098){return _0x2ed098?{'count':_0x31138c,'rows':_0x2ed098}:null;}})[_0xb556('0x24')](respondWithResult(_0x2b904f,null))[_0xb556('0x48')](handleError(_0x2b904f,null));}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.events.js b/server/api/smsQueue/smsQueue.events.js index b302d92..f3ae13f 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 _0x6536=['save','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners'];(function(_0x36ee82,_0x34a0d1){var _0x431bb8=function(_0x1d2565){while(--_0x1d2565){_0x36ee82['push'](_0x36ee82['shift']());}};_0x431bb8(++_0x34a0d1);}(_0x6536,0x141));var _0x6653=function(_0x356dcc,_0x51f8f7){_0x356dcc=_0x356dcc-0x0;var _0xe6c019=_0x6536[_0x356dcc];return _0xe6c019;};'use strict';var EventEmitter=require(_0x6653('0x0'));var SmsQueue=require(_0x6653('0x1'))['db']['SmsQueue'];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0x6653('0x2')](0x0);var events={'afterCreate':_0x6653('0x3'),'afterUpdate':'update','afterDestroy':_0x6653('0x4')};function emitEvent(_0x2dd186){return function(_0x360451,_0x5c7637,_0x289ccc){SmsQueueEvents[_0x6653('0x5')](_0x2dd186+':'+_0x360451['id'],_0x360451);SmsQueueEvents[_0x6653('0x5')](_0x2dd186,_0x360451);_0x289ccc(null);};}for(var e in events){if(events[_0x6653('0x6')](e)){var event=events[e];SmsQueue[_0x6653('0x7')](e,emitEvent(event));}}module[_0x6653('0x8')]=SmsQueueEvents; \ No newline at end of file +var _0x8411=['update','remove','emit','hasOwnProperty','events','save'];(function(_0xd56971,_0x139df4){var _0x450f42=function(_0x26a5a8){while(--_0x26a5a8){_0xd56971['push'](_0xd56971['shift']());}};_0x450f42(++_0x139df4);}(_0x8411,0x1ba));var _0x1841=function(_0x537c29,_0x4ad0a5){_0x537c29=_0x537c29-0x0;var _0x4f501d=_0x8411[_0x537c29];return _0x4f501d;};'use strict';var EventEmitter=require(_0x1841('0x0'));var SmsQueue=require('../../mysqldb')['db']['SmsQueue'];var SmsQueueEvents=new EventEmitter();SmsQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x1841('0x1'),'afterUpdate':_0x1841('0x2'),'afterDestroy':_0x1841('0x3')};function emitEvent(_0x57dd2f){return function(_0x2da5e0,_0x31dbe8,_0x41d487){SmsQueueEvents['emit'](_0x57dd2f+':'+_0x2da5e0['id'],_0x2da5e0);SmsQueueEvents[_0x1841('0x4')](_0x57dd2f,_0x2da5e0);_0x41d487(null);};}for(var e in events){if(events[_0x1841('0x5')](e)){var event=events[e];SmsQueue['hook'](e,emitEvent(event));}}module['exports']=SmsQueueEvents; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.model.js b/server/api/smsQueue/smsQueue.model.js index 10539f5..4c0a65e 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 _0x09f4=['define','SmsQueue','sms_queues','util','../../config/logger','moment','bluebird','path','rimraf','./smsQueue.attributes','exports'];(function(_0x123310,_0x1b03e0){var _0x25a23a=function(_0x1cbd2a){while(--_0x1cbd2a){_0x123310['push'](_0x123310['shift']());}};_0x25a23a(++_0x1b03e0);}(_0x09f4,0x1a5));var _0x409f=function(_0x34c51f,_0x1588bf){_0x34c51f=_0x34c51f-0x0;var _0xa24429=_0x09f4[_0x34c51f];return _0xa24429;};'use strict';var _=require('lodash');var util=require(_0x409f('0x0'));var logger=require(_0x409f('0x1'))('api');var moment=require(_0x409f('0x2'));var BPromise=require(_0x409f('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x409f('0x4'));var rimraf=require(_0x409f('0x5'));var config=require('../../config/environment');var attributes=require(_0x409f('0x6'));module[_0x409f('0x7')]=function(_0x96907f,_0x44d4d1){return _0x96907f[_0x409f('0x8')](_0x409f('0x9'),attributes,{'tableName':_0x409f('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9d3b=['SmsQueue','sms_queues','lodash','util','bluebird','request-promise','rimraf','../../config/environment','./smsQueue.attributes','exports','define'];(function(_0x4ded65,_0xc8d7c1){var _0x5864fb=function(_0x40df9d){while(--_0x40df9d){_0x4ded65['push'](_0x4ded65['shift']());}};_0x5864fb(++_0xc8d7c1);}(_0x9d3b,0x86));var _0xb9d3=function(_0x133277,_0xb1d6b2){_0x133277=_0x133277-0x0;var _0x5b4a22=_0x9d3b[_0x133277];return _0x5b4a22;};'use strict';var _=require(_0xb9d3('0x0'));var util=require(_0xb9d3('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xb9d3('0x2'));var rp=require(_0xb9d3('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb9d3('0x4'));var config=require(_0xb9d3('0x5'));var attributes=require(_0xb9d3('0x6'));module[_0xb9d3('0x7')]=function(_0x5061fc,_0x44a5eb){return _0x5061fc[_0xb9d3('0x8')](_0xb9d3('0x9'),attributes,{'tableName':_0xb9d3('0xa'),'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 a2fbe0a..c9672cc 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 _0x97c6=['include','map','model','ShowSmsQueue','find','raw','where','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','redis','defaults','./smsQueue.socket','register','then','SmsQueue,\x20%s,\x20%s','debug','SmsQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','catch','GetSmsQueue','SmsQueue','findAll','options','attributes','limit'];(function(_0x11b831,_0xef73c8){var _0x22c1b0=function(_0x20ac7f){while(--_0x20ac7f){_0x11b831['push'](_0x11b831['shift']());}};_0x22c1b0(++_0xef73c8);}(_0x97c6,0x1c3));var _0x697c=function(_0x2e819c,_0x3f99a5){_0x2e819c=_0x2e819c-0x0;var _0x24e271=_0x97c6[_0x2e819c];return _0x24e271;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x697c('0x0'));var rs=require(_0x697c('0x1'));var fs=require('fs');var Redis=require(_0x697c('0x2'));var db=require(_0x697c('0x3'))['db'];var utils=require(_0x697c('0x4'));var logger=require(_0x697c('0x5'))(_0x697c('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x697c('0x7')][_0x697c('0x8')]({'port':0x232a});config[_0x697c('0x9')]=_[_0x697c('0xa')](config[_0x697c('0x9')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x697c('0x9')]));require(_0x697c('0xb'))[_0x697c('0xc')](socket);function respondWithRpcPromise(_0x422a66,_0x4e972d,_0x1dbe4d){return new BPromise(function(_0x3772fc,_0x126d02){return client['request'](_0x422a66,_0x1dbe4d)[_0x697c('0xd')](function(_0x22e7e3){logger['info'](_0x697c('0xe'),_0x4e972d,'request\x20sent');logger[_0x697c('0xf')](_0x697c('0x10'),_0x4e972d,_0x697c('0x11'),JSON[_0x697c('0x12')](_0x22e7e3));if(_0x22e7e3[_0x697c('0x13')]){if(_0x22e7e3[_0x697c('0x13')][_0x697c('0x14')]===0x1f4){logger[_0x697c('0x13')](_0x697c('0xe'),_0x4e972d,_0x22e7e3['error'][_0x697c('0x15')]);return _0x126d02(_0x22e7e3[_0x697c('0x13')]['message']);}logger[_0x697c('0x13')](_0x697c('0xe'),_0x4e972d,_0x22e7e3[_0x697c('0x13')][_0x697c('0x15')]);return _0x3772fc(_0x22e7e3[_0x697c('0x13')][_0x697c('0x15')]);}else{logger[_0x697c('0x16')]('SmsQueue,\x20%s,\x20%s',_0x4e972d,'request\x20sent');_0x3772fc(_0x22e7e3['result'][_0x697c('0x15')]);}})[_0x697c('0x17')](function(_0x5a9386){logger[_0x697c('0x13')]('SmsQueue,\x20%s,\x20%s',_0x4e972d,_0x5a9386);_0x126d02(_0x5a9386);});});}exports[_0x697c('0x18')]=function(_0x15c611){var _0x152de3=this;return new Promise(function(_0x2ccf33,_0x14083f){return db[_0x697c('0x19')][_0x697c('0x1a')]({'raw':_0x15c611[_0x697c('0x1b')]?_0x15c611[_0x697c('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x15c611[_0x697c('0x1b')]?_0x15c611[_0x697c('0x1b')]['where']||null:null,'attributes':_0x15c611['options']?_0x15c611['options'][_0x697c('0x1c')]||null:null,'limit':_0x15c611[_0x697c('0x1b')]?_0x15c611['options'][_0x697c('0x1d')]||null:null,'include':_0x15c611['options']?_0x15c611[_0x697c('0x1b')][_0x697c('0x1e')]?_[_0x697c('0x1f')](_0x15c611[_0x697c('0x1b')]['include'],function(_0x122337){return{'model':db[_0x122337['model']],'as':_0x122337['as'],'attributes':_0x122337[_0x697c('0x1c')],'include':_0x122337[_0x697c('0x1e')]?_['map'](_0x122337['include'],function(_0x87cd74){return{'model':db[_0x87cd74[_0x697c('0x20')]],'as':_0x87cd74['as'],'attributes':_0x87cd74[_0x697c('0x1c')],'include':_0x87cd74['include']?_[_0x697c('0x1f')](_0x87cd74['include'],function(_0x4d1f98){return{'model':db[_0x4d1f98[_0x697c('0x20')]],'as':_0x4d1f98['as'],'attributes':_0x4d1f98[_0x697c('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x69a4e8){logger[_0x697c('0x16')](_0x697c('0x18'),_0x15c611);logger[_0x697c('0xf')]('GetSmsQueue',_0x15c611,JSON[_0x697c('0x12')](_0x69a4e8));_0x2ccf33(_0x69a4e8);})[_0x697c('0x17')](function(_0x2f838c){logger['error'](_0x697c('0x18'),_0x2f838c[_0x697c('0x15')],_0x15c611);_0x14083f(_0x152de3[_0x697c('0x13')](0x1f4,_0x2f838c[_0x697c('0x15')]));});});};exports[_0x697c('0x21')]=function(_0x23a3f2){var _0x489255=this;return new Promise(function(_0x6b48ea,_0x49cc24){return db['SmsQueue'][_0x697c('0x22')]({'raw':_0x23a3f2[_0x697c('0x1b')]?_0x23a3f2['options'][_0x697c('0x23')]===undefined?!![]:![]:!![],'where':_0x23a3f2[_0x697c('0x1b')]?_0x23a3f2[_0x697c('0x1b')][_0x697c('0x24')]||null:null,'attributes':_0x23a3f2[_0x697c('0x1b')]?_0x23a3f2[_0x697c('0x1b')][_0x697c('0x1c')]||null:null,'include':_0x23a3f2[_0x697c('0x1b')]?_0x23a3f2[_0x697c('0x1b')][_0x697c('0x1e')]?_['map'](_0x23a3f2[_0x697c('0x1b')][_0x697c('0x1e')],function(_0xf43bad){return{'model':db[_0xf43bad['model']],'as':_0xf43bad['as'],'attributes':_0xf43bad['attributes'],'include':_0xf43bad[_0x697c('0x1e')]?_[_0x697c('0x1f')](_0xf43bad['include'],function(_0x38870f){return{'model':db[_0x38870f[_0x697c('0x20')]],'as':_0x38870f['as'],'attributes':_0x38870f[_0x697c('0x1c')],'include':_0x38870f[_0x697c('0x1e')]?_[_0x697c('0x1f')](_0x38870f['include'],function(_0x1928e9){return{'model':db[_0x1928e9['model']],'as':_0x1928e9['as'],'attributes':_0x1928e9[_0x697c('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x697c('0xd')](function(_0x459dbe){logger[_0x697c('0x16')](_0x697c('0x21'),_0x23a3f2);logger[_0x697c('0xf')]('ShowSmsQueue',_0x23a3f2,JSON[_0x697c('0x12')](_0x459dbe));_0x6b48ea(_0x459dbe);})[_0x697c('0x17')](function(_0x3f135d){logger['error'](_0x697c('0x21'),_0x3f135d[_0x697c('0x15')],_0x23a3f2);_0x49cc24(_0x489255[_0x697c('0x13')](0x1f4,_0x3f135d[_0x697c('0x15')]));});});}; \ No newline at end of file +var _0xacc3=['http','redis','localhost','./smsQueue.socket','then','info','SmsQueue,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetSmsQueue','SmsQueue','options','raw','where','limit','include','map','model','attributes','debug','ShowSmsQueue','find','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise'];(function(_0x20c356,_0xcf42fe){var _0x33bdd7=function(_0x1e0f4c){while(--_0x1e0f4c){_0x20c356['push'](_0x20c356['shift']());}};_0x33bdd7(++_0xcf42fe);}(_0xacc3,0x1b2));var _0x3acc=function(_0x486ace,_0x2acf99){_0x486ace=_0x486ace-0x0;var _0x236c9b=_0xacc3[_0x486ace];return _0x236c9b;};'use strict';var _=require(_0x3acc('0x0'));var util=require(_0x3acc('0x1'));var moment=require(_0x3acc('0x2'));var BPromise=require('bluebird');var rs=require(_0x3acc('0x3'));var fs=require('fs');var Redis=require(_0x3acc('0x4'));var db=require(_0x3acc('0x5'))['db'];var utils=require(_0x3acc('0x6'));var logger=require(_0x3acc('0x7'))(_0x3acc('0x8'));var config=require('../../config/environment');var jayson=require(_0x3acc('0x9'));var client=jayson['client'][_0x3acc('0xa')]({'port':0x232a});config[_0x3acc('0xb')]=_['defaults'](config['redis'],{'host':_0x3acc('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3acc('0xb')]));require(_0x3acc('0xd'))['register'](socket);function respondWithRpcPromise(_0x51f72e,_0x57aec6,_0x240cc4){return new BPromise(function(_0x5eeb41,_0x2c5161){return client['request'](_0x51f72e,_0x240cc4)[_0x3acc('0xe')](function(_0x354dc5){logger[_0x3acc('0xf')](_0x3acc('0x10'),_0x57aec6,'request\x20sent');logger['debug']('SmsQueue,\x20%s,\x20%s,\x20%s',_0x57aec6,_0x3acc('0x11'),JSON[_0x3acc('0x12')](_0x354dc5));if(_0x354dc5[_0x3acc('0x13')]){if(_0x354dc5['error'][_0x3acc('0x14')]===0x1f4){logger[_0x3acc('0x13')](_0x3acc('0x10'),_0x57aec6,_0x354dc5['error'][_0x3acc('0x15')]);return _0x2c5161(_0x354dc5['error'][_0x3acc('0x15')]);}logger['error'](_0x3acc('0x10'),_0x57aec6,_0x354dc5['error']['message']);return _0x5eeb41(_0x354dc5[_0x3acc('0x13')][_0x3acc('0x15')]);}else{logger['info'](_0x3acc('0x10'),_0x57aec6,_0x3acc('0x11'));_0x5eeb41(_0x354dc5[_0x3acc('0x16')][_0x3acc('0x15')]);}})[_0x3acc('0x17')](function(_0x100ce5){logger['error']('SmsQueue,\x20%s,\x20%s',_0x57aec6,_0x100ce5);_0x2c5161(_0x100ce5);});});}exports[_0x3acc('0x18')]=function(_0x5194fe){var _0x5a87ff=this;return new Promise(function(_0x537c51,_0x170cc4){return db[_0x3acc('0x19')]['findAll']({'raw':_0x5194fe[_0x3acc('0x1a')]?_0x5194fe[_0x3acc('0x1a')][_0x3acc('0x1b')]===undefined?!![]:![]:!![],'where':_0x5194fe['options']?_0x5194fe[_0x3acc('0x1a')][_0x3acc('0x1c')]||null:null,'attributes':_0x5194fe[_0x3acc('0x1a')]?_0x5194fe[_0x3acc('0x1a')]['attributes']||null:null,'limit':_0x5194fe[_0x3acc('0x1a')]?_0x5194fe[_0x3acc('0x1a')][_0x3acc('0x1d')]||null:null,'include':_0x5194fe[_0x3acc('0x1a')]?_0x5194fe[_0x3acc('0x1a')][_0x3acc('0x1e')]?_[_0x3acc('0x1f')](_0x5194fe[_0x3acc('0x1a')]['include'],function(_0x375614){return{'model':db[_0x375614[_0x3acc('0x20')]],'as':_0x375614['as'],'attributes':_0x375614[_0x3acc('0x21')],'include':_0x375614[_0x3acc('0x1e')]?_[_0x3acc('0x1f')](_0x375614[_0x3acc('0x1e')],function(_0x5116f9){return{'model':db[_0x5116f9['model']],'as':_0x5116f9['as'],'attributes':_0x5116f9[_0x3acc('0x21')],'include':_0x5116f9[_0x3acc('0x1e')]?_[_0x3acc('0x1f')](_0x5116f9[_0x3acc('0x1e')],function(_0x26ccaa){return{'model':db[_0x26ccaa[_0x3acc('0x20')]],'as':_0x26ccaa['as'],'attributes':_0x26ccaa['attributes']};}):[]};}):[]};}):[]:[]})[_0x3acc('0xe')](function(_0x589235){logger['info']('GetSmsQueue',_0x5194fe);logger[_0x3acc('0x22')](_0x3acc('0x18'),_0x5194fe,JSON[_0x3acc('0x12')](_0x589235));_0x537c51(_0x589235);})[_0x3acc('0x17')](function(_0x54409b){logger[_0x3acc('0x13')]('GetSmsQueue',_0x54409b[_0x3acc('0x15')],_0x5194fe);_0x170cc4(_0x5a87ff['error'](0x1f4,_0x54409b['message']));});});};exports[_0x3acc('0x23')]=function(_0x293ae8){var _0x4469c0=this;return new Promise(function(_0x5e20ed,_0x53cd24){return db[_0x3acc('0x19')][_0x3acc('0x24')]({'raw':_0x293ae8['options']?_0x293ae8[_0x3acc('0x1a')][_0x3acc('0x1b')]===undefined?!![]:![]:!![],'where':_0x293ae8[_0x3acc('0x1a')]?_0x293ae8[_0x3acc('0x1a')][_0x3acc('0x1c')]||null:null,'attributes':_0x293ae8[_0x3acc('0x1a')]?_0x293ae8[_0x3acc('0x1a')][_0x3acc('0x21')]||null:null,'include':_0x293ae8[_0x3acc('0x1a')]?_0x293ae8[_0x3acc('0x1a')]['include']?_[_0x3acc('0x1f')](_0x293ae8['options'][_0x3acc('0x1e')],function(_0x3c261a){return{'model':db[_0x3c261a['model']],'as':_0x3c261a['as'],'attributes':_0x3c261a[_0x3acc('0x21')],'include':_0x3c261a['include']?_['map'](_0x3c261a['include'],function(_0x9de3cd){return{'model':db[_0x9de3cd[_0x3acc('0x20')]],'as':_0x9de3cd['as'],'attributes':_0x9de3cd[_0x3acc('0x21')],'include':_0x9de3cd[_0x3acc('0x1e')]?_[_0x3acc('0x1f')](_0x9de3cd[_0x3acc('0x1e')],function(_0x35d0c9){return{'model':db[_0x35d0c9[_0x3acc('0x20')]],'as':_0x35d0c9['as'],'attributes':_0x35d0c9[_0x3acc('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x28daaa){logger[_0x3acc('0xf')]('ShowSmsQueue',_0x293ae8);logger[_0x3acc('0x22')](_0x3acc('0x23'),_0x293ae8,JSON['stringify'](_0x28daaa));_0x5e20ed(_0x28daaa);})[_0x3acc('0x17')](function(_0x16a865){logger[_0x3acc('0x13')]('ShowSmsQueue',_0x16a865[_0x3acc('0x15')],_0x293ae8);_0x53cd24(_0x4469c0[_0x3acc('0x13')](0x1f4,_0x16a865[_0x3acc('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.socket.js b/server/api/smsQueue/smsQueue.socket.js index 549ca4d..e7b6a7c 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 _0xf6eb=['save','remove','register','smsQueue:','./smsQueue.events'];(function(_0xc9cd47,_0x35a546){var _0x26827e=function(_0x32d967){while(--_0x32d967){_0xc9cd47['push'](_0xc9cd47['shift']());}};_0x26827e(++_0x35a546);}(_0xf6eb,0x1a8));var _0xbf6e=function(_0x375ec0,_0x3224e3){_0x375ec0=_0x375ec0-0x0;var _0x3f779f=_0xf6eb[_0x375ec0];return _0x3f779f;};'use strict';var SmsQueueEvents=require(_0xbf6e('0x0'));var events=[_0xbf6e('0x1'),_0xbf6e('0x2'),'update'];function createListener(_0x10d0a3,_0x5ccafc){return function(_0x31eb1e){_0x5ccafc['emit'](_0x10d0a3,_0x31eb1e);};}function removeListener(_0x100977,_0x92da3c){return function(){SmsQueueEvents['removeListener'](_0x100977,_0x92da3c);};}exports[_0xbf6e('0x3')]=function(_0x29c1f8){for(var _0x32cc1a=0x0,_0x564c19=events['length'];_0x32cc1a<_0x564c19;_0x32cc1a++){var _0x1af877=events[_0x32cc1a];var _0x45662d=createListener(_0xbf6e('0x4')+_0x1af877,_0x29c1f8);SmsQueueEvents['on'](_0x1af877,_0x45662d);}}; \ No newline at end of file +var _0x016a=['emit','length','smsQueue:','save','remove'];(function(_0x210cbe,_0x2cacf7){var _0x2f08b1=function(_0x2690f7){while(--_0x2690f7){_0x210cbe['push'](_0x210cbe['shift']());}};_0x2f08b1(++_0x2cacf7);}(_0x016a,0x1ca));var _0xa016=function(_0x5e36d1,_0x471178){_0x5e36d1=_0x5e36d1-0x0;var _0x950b9e=_0x016a[_0x5e36d1];return _0x950b9e;};'use strict';var SmsQueueEvents=require('./smsQueue.events');var events=[_0xa016('0x0'),_0xa016('0x1'),'update'];function createListener(_0x3ff643,_0x34feb3){return function(_0x196951){_0x34feb3[_0xa016('0x2')](_0x3ff643,_0x196951);};}function removeListener(_0x28382b,_0x1da4b7){return function(){SmsQueueEvents['removeListener'](_0x28382b,_0x1da4b7);};}exports['register']=function(_0x4317bb){for(var _0x4c3c47=0x0,_0x2401e9=events[_0xa016('0x3')];_0x4c3c47<_0x2401e9;_0x4c3c47++){var _0x172f09=events[_0x4c3c47];var _0xbffa54=createListener(_0xa016('0x4')+_0x172f09,_0x4317bb);SmsQueueEvents['on'](_0x172f09,_0xbffa54);}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/index.js b/server/api/smsQueueReport/index.js index 7b0ee8d..e144c35 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 _0x2993=['create','put','update','delete','destroy','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','isAuthenticated','index','get','describe','/:id','show'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x2993,0x113));var _0x3299=function(_0x9f6f64,_0x4cd6df){_0x9f6f64=_0x9f6f64-0x0;var _0x3b9f5c=_0x2993[_0x9f6f64];return _0x3b9f5c;};'use strict';var multer=require('multer');var util=require(_0x3299('0x0'));var path=require(_0x3299('0x1'));var timeout=require(_0x3299('0x2'));var express=require(_0x3299('0x3'));var router=express[_0x3299('0x4')]();var auth=require(_0x3299('0x5'));var interaction=require(_0x3299('0x6'));var config=require('../../config/environment');var controller=require('./smsQueueReport.controller');router['get']('/',auth[_0x3299('0x7')](),controller[_0x3299('0x8')]);router[_0x3299('0x9')]('/describe',auth[_0x3299('0x7')](),controller[_0x3299('0xa')]);router['get'](_0x3299('0xb'),auth['isAuthenticated'](),controller[_0x3299('0xc')]);router['post']('/',auth[_0x3299('0x7')](),controller[_0x3299('0xd')]);router[_0x3299('0xe')](_0x3299('0xb'),auth[_0x3299('0x7')](),controller[_0x3299('0xf')]);router[_0x3299('0x10')](_0x3299('0xb'),auth[_0x3299('0x7')](),controller[_0x3299('0x11')]);module['exports']=router; \ No newline at end of file +var _0x01da=['multer','connect-timeout','express','Router','../../components/auth/service','./smsQueueReport.controller','get','isAuthenticated','index','describe','show','post','create','put','update','/:id','destroy','exports'];(function(_0x2a01d7,_0x86488d){var _0x425e7d=function(_0x5f3358){while(--_0x5f3358){_0x2a01d7['push'](_0x2a01d7['shift']());}};_0x425e7d(++_0x86488d);}(_0x01da,0x1b0));var _0xa01d=function(_0x337764,_0x3fe8fa){_0x337764=_0x337764-0x0;var _0x135e18=_0x01da[_0x337764];return _0x135e18;};'use strict';var multer=require(_0xa01d('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xa01d('0x1'));var express=require(_0xa01d('0x2'));var router=express[_0xa01d('0x3')]();var auth=require(_0xa01d('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xa01d('0x5'));router[_0xa01d('0x6')]('/',auth[_0xa01d('0x7')](),controller[_0xa01d('0x8')]);router[_0xa01d('0x6')]('/describe',auth[_0xa01d('0x7')](),controller[_0xa01d('0x9')]);router[_0xa01d('0x6')]('/:id',auth[_0xa01d('0x7')](),controller[_0xa01d('0xa')]);router[_0xa01d('0xb')]('/',auth[_0xa01d('0x7')](),controller[_0xa01d('0xc')]);router[_0xa01d('0xd')]('/:id',auth[_0xa01d('0x7')](),controller[_0xa01d('0xe')]);router['delete'](_0xa01d('0xf'),auth[_0xa01d('0x7')](),controller[_0xa01d('0x10')]);module[_0xa01d('0x11')]=router; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.attributes.js b/server/api/smsQueueReport/smsQueueReport.attributes.js index d101e3c..a993176 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 _0xfc35=['moment','sequelize','exports','STRING','DATE'];(function(_0x2a63ee,_0x5cf767){var _0x261fd4=function(_0x3b3e4f){while(--_0x3b3e4f){_0x2a63ee['push'](_0x2a63ee['shift']());}};_0x261fd4(++_0x5cf767);}(_0xfc35,0xc3));var _0x5fc3=function(_0x59dfc6,_0x1ef28d){_0x59dfc6=_0x59dfc6-0x0;var _0x3c074e=_0xfc35[_0x59dfc6];return _0x3c074e;};'use strict';var moment=require(_0x5fc3('0x0'));var Sequelize=require(_0x5fc3('0x1'));module[_0x5fc3('0x2')]={'uniqueid':{'type':Sequelize[_0x5fc3('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x5fc3('0x3')]},'joinAt':{'type':Sequelize[_0x5fc3('0x4')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x5fc3('0x4')]},'exitAt':{'type':Sequelize[_0x5fc3('0x4')]},'reason':{'type':Sequelize[_0x5fc3('0x3')]}}; \ No newline at end of file +var _0x3156=['STRING','DATE','moment','sequelize'];(function(_0x4311a5,_0x52cbe1){var _0x1720ea=function(_0x4e10c1){while(--_0x4e10c1){_0x4311a5['push'](_0x4311a5['shift']());}};_0x1720ea(++_0x52cbe1);}(_0x3156,0xfe));var _0x6315=function(_0x2a4c96,_0x592179){_0x2a4c96=_0x2a4c96-0x0;var _0xa7199d=_0x3156[_0x2a4c96];return _0xa7199d;};'use strict';var moment=require(_0x6315('0x0'));var Sequelize=require(_0x6315('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0x6315('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x6315('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x6315('0x3')]},'exitAt':{'type':Sequelize[_0x6315('0x3')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.controller.js b/server/api/smsQueueReport/smsQueueReport.controller.js index aa5543b..a65818a 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 _0x2612=['Content-Range','apply','reject','update','then','destroy','end','name','index','SmsQueueReport','rawAttributes','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','map','type','key','VIRTUAL','field','filter','options','includeAll','include','findAll','catch','show','params','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','set'];(function(_0x47a43c,_0x25d9b8){var _0x137012=function(_0x2c737a){while(--_0x2c737a){_0x47a43c['push'](_0x47a43c['shift']());}};_0x137012(++_0x25d9b8);}(_0x2612,0x1a6));var _0x2261=function(_0x260ea3,_0x3bef27){_0x260ea3=_0x260ea3-0x0;var _0x88de9c=_0x2612[_0x260ea3];return _0x88de9c;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x2261('0x0'));var rimraf=require(_0x2261('0x1'));var zipdir=require(_0x2261('0x2'));var jsonpatch=require(_0x2261('0x3'));var rp=require(_0x2261('0x4'));var moment=require(_0x2261('0x5'));var BPromise=require(_0x2261('0x6'));var Mustache=require(_0x2261('0x7'));var util=require(_0x2261('0x8'));var path=require(_0x2261('0x9'));var sox=require(_0x2261('0xa'));var csv=require(_0x2261('0xb'));var ejs=require(_0x2261('0xc'));var fs=require('fs');var _=require(_0x2261('0xd'));var squel=require(_0x2261('0xe'));var crypto=require(_0x2261('0xf'));var jsforce=require(_0x2261('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x2261('0xb'));var querystring=require(_0x2261('0x11'));var Papa=require('papaparse');var Redis=require(_0x2261('0x12'));var authService=require(_0x2261('0x13'));var qs=require(_0x2261('0x14'));var as=require(_0x2261('0x15'));var hardwareService=require(_0x2261('0x16'));var logger=require('../../config/logger')(_0x2261('0x17'));var utils=require(_0x2261('0x18'));var config=require(_0x2261('0x19'));var db=require(_0x2261('0x1a'))['db'];function respondWithStatusCode(_0x22da08,_0x57df7c){_0x57df7c=_0x57df7c||0xcc;return function(_0x2e4ae0){if(_0x2e4ae0){return _0x22da08[_0x2261('0x1b')](_0x57df7c);}return _0x22da08[_0x2261('0x1c')](_0x57df7c)['end']();};}function respondWithResult(_0x553491,_0x5abdc5){_0x5abdc5=_0x5abdc5||0xc8;return function(_0x5803a4){if(_0x5803a4){return _0x553491[_0x2261('0x1c')](_0x5abdc5)[_0x2261('0x1d')](_0x5803a4);}};}function respondWithFilteredResult(_0x1ca06d,_0x4e51e6){return function(_0x53820e){if(_0x53820e){var _0xf0ebe0=_0x53820e[_0x2261('0x1e')],_0x52128d=_0x4e51e6['offset'],_0x39fc02=_0x4e51e6[_0x2261('0x1f')]+_0x4e51e6[_0x2261('0x20')],_0x11e7a1;if(_0x39fc02>=_0xf0ebe0){_0x39fc02=_0xf0ebe0;_0x11e7a1=0xc8;}else{_0x11e7a1=0xce;}_0x1ca06d[_0x2261('0x1c')](_0x11e7a1);return _0x1ca06d[_0x2261('0x21')](_0x2261('0x22'),_0x52128d+'-'+_0x39fc02+'/'+_0xf0ebe0)['json'](_0x53820e);}return null;};}function patchUpdates(_0x52897e){return function(_0x192c5c){try{jsonpatch[_0x2261('0x23')](_0x192c5c,_0x52897e,!![]);}catch(_0x25fa82){return BPromise[_0x2261('0x24')](_0x25fa82);}return _0x192c5c['save']();};}function saveUpdates(_0x12d8ce,_0x5d5214){return function(_0x1d1563){if(_0x1d1563){return _0x1d1563[_0x2261('0x25')](_0x12d8ce)[_0x2261('0x26')](function(_0x1b029d){return _0x1b029d;});}return null;};}function removeEntity(_0x1184ae,_0x257e7d){return function(_0x5f15cc){if(_0x5f15cc){return _0x5f15cc[_0x2261('0x27')]()[_0x2261('0x26')](function(){_0x1184ae[_0x2261('0x1c')](0xcc)[_0x2261('0x28')]();});}};}function handleEntityNotFound(_0x42f376,_0x1140e2){return function(_0x1cb586){if(!_0x1cb586){_0x42f376['sendStatus'](0x194);}return _0x1cb586;};}function handleError(_0xc343bb,_0x18e271){_0x18e271=_0x18e271||0x1f4;return function(_0x34e8e9){logger['error'](_0x34e8e9['stack']);if(_0x34e8e9['name']){delete _0x34e8e9[_0x2261('0x29')];}_0xc343bb[_0x2261('0x1c')](_0x18e271)['send'](_0x34e8e9);};}exports[_0x2261('0x2a')]=function(_0x537107,_0xa8f1bc){var _0x4a2123={},_0x2bdaf3={},_0x663809={'count':0x0,'rows':[]};var _0x403f95=db[_0x2261('0x2b')][_0x2261('0x2c')];_0x2bdaf3[_0x2261('0x2d')]=_['keys'](_0x403f95);_0x2bdaf3[_0x2261('0x2e')]=_[_0x2261('0x2f')](_0x537107['query']);_0x2bdaf3[_0x2261('0x30')]=_[_0x2261('0x31')](_0x2bdaf3[_0x2261('0x2d')],_0x2bdaf3['query']);_0x4a2123[_0x2261('0x32')]=_[_0x2261('0x31')](_0x2bdaf3[_0x2261('0x2d')],qs[_0x2261('0x33')](_0x537107[_0x2261('0x2e')][_0x2261('0x33')]));_0x4a2123['attributes']=_0x4a2123[_0x2261('0x32')][_0x2261('0x34')]?_0x4a2123[_0x2261('0x32')]:_0x2bdaf3[_0x2261('0x2d')];if(!_0x537107[_0x2261('0x2e')][_0x2261('0x35')](_0x2261('0x36'))){_0x4a2123[_0x2261('0x20')]=qs[_0x2261('0x20')](_0x537107[_0x2261('0x2e')][_0x2261('0x20')]);_0x4a2123['offset']=qs[_0x2261('0x1f')](_0x537107['query'][_0x2261('0x1f')]);}_0x4a2123[_0x2261('0x37')]=qs[_0x2261('0x38')](_0x537107[_0x2261('0x2e')][_0x2261('0x38')]);_0x4a2123[_0x2261('0x39')]=qs['filters'](_['pick'](_0x537107[_0x2261('0x2e')],_0x2bdaf3[_0x2261('0x30')]));if(_0x537107['query']['filter']){_0x4a2123[_0x2261('0x39')]=_[_0x2261('0x3a')](_0x4a2123[_0x2261('0x39')],{'$or':_[_0x2261('0x3b')](_0x403f95,function(_0x28e378){if(_0x28e378[_0x2261('0x3c')][_0x2261('0x3d')]!==_0x2261('0x3e')){var _0x4b1602={};_0x4b1602[_0x28e378[_0x2261('0x3f')]]={'$like':'%'+_0x537107[_0x2261('0x2e')][_0x2261('0x40')]+'%'};return _0x4b1602;}})});}_0x4a2123=_['merge']({},_0x4a2123,_0x537107[_0x2261('0x41')]);var _0x5e572a={'where':_0x4a2123[_0x2261('0x39')]};return db[_0x2261('0x2b')]['count'](_0x5e572a)['then'](function(_0x13fe88){_0x663809[_0x2261('0x1e')]=_0x13fe88;if(_0x537107[_0x2261('0x2e')][_0x2261('0x42')]){_0x4a2123[_0x2261('0x43')]=[{'all':!![]}];}return db[_0x2261('0x2b')][_0x2261('0x44')](_0x4a2123);})[_0x2261('0x26')](function(_0x47f141){_0x663809['rows']=_0x47f141;return _0x663809;})[_0x2261('0x26')](respondWithFilteredResult(_0xa8f1bc,_0x4a2123))[_0x2261('0x45')](handleError(_0xa8f1bc,null));};exports[_0x2261('0x46')]=function(_0x4e5743,_0x48dd2f){var _0x54f797={'raw':!![],'where':{'id':_0x4e5743[_0x2261('0x47')]['id']}},_0x3972c0={};_0x3972c0['model']=_[_0x2261('0x2f')](db[_0x2261('0x2b')][_0x2261('0x2c')]);_0x3972c0['query']=_[_0x2261('0x2f')](_0x4e5743['query']);_0x3972c0['filters']=_[_0x2261('0x31')](_0x3972c0[_0x2261('0x2d')],_0x3972c0[_0x2261('0x2e')]);_0x54f797[_0x2261('0x32')]=_['intersection'](_0x3972c0[_0x2261('0x2d')],qs['fields'](_0x4e5743[_0x2261('0x2e')][_0x2261('0x33')]));_0x54f797[_0x2261('0x32')]=_0x54f797[_0x2261('0x32')]['length']?_0x54f797[_0x2261('0x32')]:_0x3972c0['model'];if(_0x4e5743['query']['includeAll']){_0x54f797['include']=[{'all':!![]}];}_0x54f797=_[_0x2261('0x3a')]({},_0x54f797,_0x4e5743[_0x2261('0x41')]);return db[_0x2261('0x2b')][_0x2261('0x48')](_0x54f797)['then'](handleEntityNotFound(_0x48dd2f,null))[_0x2261('0x26')](respondWithResult(_0x48dd2f,null))[_0x2261('0x45')](handleError(_0x48dd2f,null));};exports[_0x2261('0x49')]=function(_0x59ca7e,_0x409b0c){return db[_0x2261('0x2b')][_0x2261('0x49')](_0x59ca7e[_0x2261('0x4a')],{})[_0x2261('0x26')](respondWithResult(_0x409b0c,0xc9))[_0x2261('0x45')](handleError(_0x409b0c,null));};exports[_0x2261('0x25')]=function(_0x4015dc,_0x2c9803){if(_0x4015dc[_0x2261('0x4a')]['id']){delete _0x4015dc[_0x2261('0x4a')]['id'];}return db['SmsQueueReport'][_0x2261('0x48')]({'where':{'id':_0x4015dc[_0x2261('0x47')]['id']}})[_0x2261('0x26')](handleEntityNotFound(_0x2c9803,null))[_0x2261('0x26')](saveUpdates(_0x4015dc[_0x2261('0x4a')],null))['then'](respondWithResult(_0x2c9803,null))[_0x2261('0x45')](handleError(_0x2c9803,null));};exports[_0x2261('0x27')]=function(_0x4dbbfe,_0x5741cb){return db[_0x2261('0x2b')][_0x2261('0x48')]({'where':{'id':_0x4dbbfe['params']['id']}})[_0x2261('0x26')](handleEntityNotFound(_0x5741cb,null))['then'](removeEntity(_0x5741cb,null))[_0x2261('0x45')](handleError(_0x5741cb,null));};exports[_0x2261('0x4b')]=function(_0x270965,_0x39118c){return db[_0x2261('0x2b')][_0x2261('0x4b')]()[_0x2261('0x26')](respondWithResult(_0x39118c,null))[_0x2261('0x45')](handleError(_0x39118c,null));}; \ No newline at end of file +var _0x3b14=['json','count','offset','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','rawAttributes','model','keys','query','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','filter','merge','map','type','key','VIRTUAL','field','options','SmsQueueReport','includeAll','findAll','rows','catch','show','params','intersection','include','find','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end'];(function(_0x1ebab3,_0x65b63f){var _0x16bfe6=function(_0x563fb9){while(--_0x563fb9){_0x1ebab3['push'](_0x1ebab3['shift']());}};_0x16bfe6(++_0x65b63f);}(_0x3b14,0x81));var _0x43b1=function(_0x50154b,_0x4425c7){_0x50154b=_0x50154b-0x0;var _0x55a028=_0x3b14[_0x50154b];return _0x55a028;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x43b1('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x43b1('0x1'));var jsonpatch=require(_0x43b1('0x2'));var rp=require(_0x43b1('0x3'));var moment=require(_0x43b1('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x43b1('0x5'));var util=require(_0x43b1('0x6'));var path=require(_0x43b1('0x7'));var sox=require(_0x43b1('0x8'));var csv=require(_0x43b1('0x9'));var ejs=require(_0x43b1('0xa'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x43b1('0xb'));var deskjs=require(_0x43b1('0xc'));var toCsv=require(_0x43b1('0x9'));var querystring=require(_0x43b1('0xd'));var Papa=require(_0x43b1('0xe'));var Redis=require(_0x43b1('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x43b1('0x10'));var as=require(_0x43b1('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x43b1('0x12'))(_0x43b1('0x13'));var utils=require(_0x43b1('0x14'));var config=require(_0x43b1('0x15'));var db=require(_0x43b1('0x16'))['db'];function respondWithStatusCode(_0x18ec33,_0x59b2a3){_0x59b2a3=_0x59b2a3||0xcc;return function(_0x526035){if(_0x526035){return _0x18ec33['sendStatus'](_0x59b2a3);}return _0x18ec33[_0x43b1('0x17')](_0x59b2a3)[_0x43b1('0x18')]();};}function respondWithResult(_0x48a30e,_0x365404){_0x365404=_0x365404||0xc8;return function(_0xb7d38f){if(_0xb7d38f){return _0x48a30e['status'](_0x365404)[_0x43b1('0x19')](_0xb7d38f);}};}function respondWithFilteredResult(_0x31eaa7,_0x37eb72){return function(_0x5e568d){if(_0x5e568d){var _0x351eb1=_0x5e568d[_0x43b1('0x1a')],_0x2d2026=_0x37eb72[_0x43b1('0x1b')],_0x3414d3=_0x37eb72[_0x43b1('0x1b')]+_0x37eb72['limit'],_0x3585d4;if(_0x3414d3>=_0x351eb1){_0x3414d3=_0x351eb1;_0x3585d4=0xc8;}else{_0x3585d4=0xce;}_0x31eaa7['status'](_0x3585d4);return _0x31eaa7['set'](_0x43b1('0x1c'),_0x2d2026+'-'+_0x3414d3+'/'+_0x351eb1)[_0x43b1('0x19')](_0x5e568d);}return null;};}function patchUpdates(_0x2284a2){return function(_0x407a9f){try{jsonpatch[_0x43b1('0x1d')](_0x407a9f,_0x2284a2,!![]);}catch(_0x261c6d){return BPromise[_0x43b1('0x1e')](_0x261c6d);}return _0x407a9f[_0x43b1('0x1f')]();};}function saveUpdates(_0x203fd7,_0x585c30){return function(_0x1d430a){if(_0x1d430a){return _0x1d430a[_0x43b1('0x20')](_0x203fd7)[_0x43b1('0x21')](function(_0xa3bb54){return _0xa3bb54;});}return null;};}function removeEntity(_0x2f9725,_0x2dd68f){return function(_0x2dd374){if(_0x2dd374){return _0x2dd374[_0x43b1('0x22')]()['then'](function(){_0x2f9725['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3cfac3,_0x4f2ac4){return function(_0x19b085){if(!_0x19b085){_0x3cfac3[_0x43b1('0x23')](0x194);}return _0x19b085;};}function handleError(_0x5e050d,_0x2cd831){_0x2cd831=_0x2cd831||0x1f4;return function(_0x5b16d4){logger[_0x43b1('0x24')](_0x5b16d4[_0x43b1('0x25')]);if(_0x5b16d4[_0x43b1('0x26')]){delete _0x5b16d4[_0x43b1('0x26')];}_0x5e050d['status'](_0x2cd831)[_0x43b1('0x27')](_0x5b16d4);};}exports[_0x43b1('0x28')]=function(_0x9de352,_0x64c76f){var _0x110ab5={},_0x5169ba={},_0x598aab={'count':0x0,'rows':[]};var _0x329f6c=db['SmsQueueReport'][_0x43b1('0x29')];_0x5169ba[_0x43b1('0x2a')]=_[_0x43b1('0x2b')](_0x329f6c);_0x5169ba[_0x43b1('0x2c')]=_['keys'](_0x9de352[_0x43b1('0x2c')]);_0x5169ba['filters']=_['intersection'](_0x5169ba[_0x43b1('0x2a')],_0x5169ba[_0x43b1('0x2c')]);_0x110ab5['attributes']=_['intersection'](_0x5169ba[_0x43b1('0x2a')],qs[_0x43b1('0x2d')](_0x9de352[_0x43b1('0x2c')][_0x43b1('0x2d')]));_0x110ab5[_0x43b1('0x2e')]=_0x110ab5['attributes'][_0x43b1('0x2f')]?_0x110ab5['attributes']:_0x5169ba[_0x43b1('0x2a')];if(!_0x9de352[_0x43b1('0x2c')][_0x43b1('0x30')](_0x43b1('0x31'))){_0x110ab5[_0x43b1('0x32')]=qs[_0x43b1('0x32')](_0x9de352[_0x43b1('0x2c')]['limit']);_0x110ab5['offset']=qs[_0x43b1('0x1b')](_0x9de352[_0x43b1('0x2c')][_0x43b1('0x1b')]);}_0x110ab5[_0x43b1('0x33')]=qs['sort'](_0x9de352[_0x43b1('0x2c')][_0x43b1('0x34')]);_0x110ab5[_0x43b1('0x35')]=qs[_0x43b1('0x36')](_[_0x43b1('0x37')](_0x9de352['query'],_0x5169ba[_0x43b1('0x36')]));if(_0x9de352['query'][_0x43b1('0x38')]){_0x110ab5[_0x43b1('0x35')]=_[_0x43b1('0x39')](_0x110ab5[_0x43b1('0x35')],{'$or':_[_0x43b1('0x3a')](_0x329f6c,function(_0x2e2041){if(_0x2e2041[_0x43b1('0x3b')][_0x43b1('0x3c')]!==_0x43b1('0x3d')){var _0x3e5ca5={};_0x3e5ca5[_0x2e2041[_0x43b1('0x3e')]]={'$like':'%'+_0x9de352[_0x43b1('0x2c')][_0x43b1('0x38')]+'%'};return _0x3e5ca5;}})});}_0x110ab5=_[_0x43b1('0x39')]({},_0x110ab5,_0x9de352[_0x43b1('0x3f')]);var _0x148c07={'where':_0x110ab5[_0x43b1('0x35')]};return db[_0x43b1('0x40')][_0x43b1('0x1a')](_0x148c07)[_0x43b1('0x21')](function(_0x1cb35d){_0x598aab[_0x43b1('0x1a')]=_0x1cb35d;if(_0x9de352['query'][_0x43b1('0x41')]){_0x110ab5['include']=[{'all':!![]}];}return db[_0x43b1('0x40')][_0x43b1('0x42')](_0x110ab5);})[_0x43b1('0x21')](function(_0x27ae1d){_0x598aab[_0x43b1('0x43')]=_0x27ae1d;return _0x598aab;})[_0x43b1('0x21')](respondWithFilteredResult(_0x64c76f,_0x110ab5))[_0x43b1('0x44')](handleError(_0x64c76f,null));};exports[_0x43b1('0x45')]=function(_0x34acc3,_0x1e7366){var _0x4f08f6={'raw':!![],'where':{'id':_0x34acc3[_0x43b1('0x46')]['id']}},_0x5c5657={};_0x5c5657['model']=_[_0x43b1('0x2b')](db['SmsQueueReport'][_0x43b1('0x29')]);_0x5c5657['query']=_[_0x43b1('0x2b')](_0x34acc3[_0x43b1('0x2c')]);_0x5c5657[_0x43b1('0x36')]=_['intersection'](_0x5c5657[_0x43b1('0x2a')],_0x5c5657[_0x43b1('0x2c')]);_0x4f08f6[_0x43b1('0x2e')]=_[_0x43b1('0x47')](_0x5c5657[_0x43b1('0x2a')],qs[_0x43b1('0x2d')](_0x34acc3[_0x43b1('0x2c')][_0x43b1('0x2d')]));_0x4f08f6['attributes']=_0x4f08f6[_0x43b1('0x2e')][_0x43b1('0x2f')]?_0x4f08f6[_0x43b1('0x2e')]:_0x5c5657[_0x43b1('0x2a')];if(_0x34acc3[_0x43b1('0x2c')][_0x43b1('0x41')]){_0x4f08f6[_0x43b1('0x48')]=[{'all':!![]}];}_0x4f08f6=_[_0x43b1('0x39')]({},_0x4f08f6,_0x34acc3[_0x43b1('0x3f')]);return db[_0x43b1('0x40')][_0x43b1('0x49')](_0x4f08f6)[_0x43b1('0x21')](handleEntityNotFound(_0x1e7366,null))[_0x43b1('0x21')](respondWithResult(_0x1e7366,null))['catch'](handleError(_0x1e7366,null));};exports[_0x43b1('0x4a')]=function(_0x2eab85,_0x4a8295){return db['SmsQueueReport']['create'](_0x2eab85['body'],{})[_0x43b1('0x21')](respondWithResult(_0x4a8295,0xc9))[_0x43b1('0x44')](handleError(_0x4a8295,null));};exports['update']=function(_0x292ef7,_0x54a9ce){if(_0x292ef7[_0x43b1('0x4b')]['id']){delete _0x292ef7[_0x43b1('0x4b')]['id'];}return db['SmsQueueReport']['find']({'where':{'id':_0x292ef7['params']['id']}})[_0x43b1('0x21')](handleEntityNotFound(_0x54a9ce,null))[_0x43b1('0x21')](saveUpdates(_0x292ef7[_0x43b1('0x4b')],null))[_0x43b1('0x21')](respondWithResult(_0x54a9ce,null))[_0x43b1('0x44')](handleError(_0x54a9ce,null));};exports['destroy']=function(_0x3ad44e,_0x46a81b){return db[_0x43b1('0x40')][_0x43b1('0x49')]({'where':{'id':_0x3ad44e[_0x43b1('0x46')]['id']}})[_0x43b1('0x21')](handleEntityNotFound(_0x46a81b,null))[_0x43b1('0x21')](removeEntity(_0x46a81b,null))[_0x43b1('0x44')](handleError(_0x46a81b,null));};exports[_0x43b1('0x4c')]=function(_0x5e7cd1,_0x252ffb){return db['SmsQueueReport'][_0x43b1('0x4c')]()[_0x43b1('0x21')](respondWithResult(_0x252ffb,null))[_0x43b1('0x44')](handleError(_0x252ffb,null));}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.model.js b/server/api/smsQueueReport/smsQueueReport.model.js index fdbbfad..359dee8 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 _0xacdf=['./smsQueueReport.attributes','exports','define','SmsQueueReport','report_sms_queue','uniqueid','lodash','api','moment'];(function(_0x504620,_0x4bceb0){var _0x4f3557=function(_0x1a5452){while(--_0x1a5452){_0x504620['push'](_0x504620['shift']());}};_0x4f3557(++_0x4bceb0);}(_0xacdf,0x69));var _0xfacd=function(_0x101e7b,_0x4ef05b){_0x101e7b=_0x101e7b-0x0;var _0x4995c0=_0xacdf[_0x101e7b];return _0x4995c0;};'use strict';var _=require(_0xfacd('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xfacd('0x1'));var moment=require(_0xfacd('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xfacd('0x3'));module[_0xfacd('0x4')]=function(_0x4c4ffc,_0x54118d){return _0x4c4ffc[_0xfacd('0x5')](_0xfacd('0x6'),attributes,{'tableName':_0xfacd('0x7'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xfacd('0x8')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x9e0d=['util','../../config/logger','api','moment','path','rimraf','../../config/environment','./smsQueueReport.attributes','define','SmsQueueReport','report_sms_queue','uniqueid','lodash'];(function(_0x4704dc,_0x575a5f){var _0x254d81=function(_0x3b135d){while(--_0x3b135d){_0x4704dc['push'](_0x4704dc['shift']());}};_0x254d81(++_0x575a5f);}(_0x9e0d,0x9b));var _0xd9e0=function(_0x3188a3,_0x398499){_0x3188a3=_0x3188a3-0x0;var _0x55d16f=_0x9e0d[_0x3188a3];return _0x55d16f;};'use strict';var _=require(_0xd9e0('0x0'));var util=require(_0xd9e0('0x1'));var logger=require(_0xd9e0('0x2'))(_0xd9e0('0x3'));var moment=require(_0xd9e0('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xd9e0('0x5'));var rimraf=require(_0xd9e0('0x6'));var config=require(_0xd9e0('0x7'));var attributes=require(_0xd9e0('0x8'));module['exports']=function(_0x2808e9,_0x36ad03){return _0x2808e9[_0xd9e0('0x9')](_0xd9e0('0xa'),attributes,{'tableName':_0xd9e0('0xb'),'paranoid':![],'indexes':[{'name':_0xd9e0('0xc'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.rpc.js b/server/api/smsQueueReport/smsQueueReport.rpc.js index 6bd1634..d794ad5 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 _0x8a0d=['http','then','info','SmsQueueReport,\x20%s,\x20%s','request\x20sent','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','error','message','result','catch','CreateSmsQueueReport','SmsQueueReport','body','options','raw','stringify','update','where','attributes','limit','UpdateSmsQueueReport','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client'];(function(_0x1cd555,_0x4a1338){var _0x4ced8a=function(_0x5df937){while(--_0x5df937){_0x1cd555['push'](_0x1cd555['shift']());}};_0x4ced8a(++_0x4a1338);}(_0x8a0d,0xb6));var _0xd8a0=function(_0x538c39,_0x358a69){_0x538c39=_0x538c39-0x0;var _0x29273c=_0x8a0d[_0x538c39];return _0x29273c;};'use strict';var _=require(_0xd8a0('0x0'));var util=require(_0xd8a0('0x1'));var moment=require(_0xd8a0('0x2'));var BPromise=require('bluebird');var rs=require(_0xd8a0('0x3'));var fs=require('fs');var Redis=require(_0xd8a0('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xd8a0('0x5'));var logger=require(_0xd8a0('0x6'))(_0xd8a0('0x7'));var config=require('../../config/environment');var jayson=require(_0xd8a0('0x8'));var client=jayson[_0xd8a0('0x9')][_0xd8a0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4674d7,_0x349663,_0x3adb5c){return new BPromise(function(_0x55ceaf,_0xa52b87){return client['request'](_0x4674d7,_0x3adb5c)[_0xd8a0('0xb')](function(_0x22462a){logger[_0xd8a0('0xc')](_0xd8a0('0xd'),_0x349663,_0xd8a0('0xe'));logger[_0xd8a0('0xf')](_0xd8a0('0x10'),_0x349663,'request\x20sent',JSON['stringify'](_0x22462a));if(_0x22462a[_0xd8a0('0x11')]){if(_0x22462a[_0xd8a0('0x11')]['code']===0x1f4){logger['error']('SmsQueueReport,\x20%s,\x20%s',_0x349663,_0x22462a[_0xd8a0('0x11')]['message']);return _0xa52b87(_0x22462a['error'][_0xd8a0('0x12')]);}logger[_0xd8a0('0x11')]('SmsQueueReport,\x20%s,\x20%s',_0x349663,_0x22462a[_0xd8a0('0x11')][_0xd8a0('0x12')]);return _0x55ceaf(_0x22462a[_0xd8a0('0x11')][_0xd8a0('0x12')]);}else{logger[_0xd8a0('0xc')](_0xd8a0('0xd'),_0x349663,_0xd8a0('0xe'));_0x55ceaf(_0x22462a[_0xd8a0('0x13')][_0xd8a0('0x12')]);}})[_0xd8a0('0x14')](function(_0x4623ab){logger[_0xd8a0('0x11')](_0xd8a0('0xd'),_0x349663,_0x4623ab);_0xa52b87(_0x4623ab);});});}exports[_0xd8a0('0x15')]=function(_0x5c8637){var _0x721647=this;return new Promise(function(_0x406d43,_0x19f85d){return db[_0xd8a0('0x16')]['create'](_0x5c8637[_0xd8a0('0x17')],{'raw':_0x5c8637[_0xd8a0('0x18')]?_0x5c8637[_0xd8a0('0x18')][_0xd8a0('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x5a1ae3){logger[_0xd8a0('0xc')](_0xd8a0('0x15'),_0x5c8637);logger[_0xd8a0('0xf')]('CreateSmsQueueReport',_0x5c8637,JSON[_0xd8a0('0x1a')](_0x5a1ae3));_0x406d43(_0x5a1ae3);})[_0xd8a0('0x14')](function(_0x34b8a4){logger[_0xd8a0('0x11')](_0xd8a0('0x15'),_0x34b8a4[_0xd8a0('0x12')],_0x5c8637);_0x19f85d(_0x721647['error'](0x1f4,_0x34b8a4[_0xd8a0('0x12')]));});});};exports['UpdateSmsQueueReport']=function(_0x4675b0){var _0xc46ff4=this;return new Promise(function(_0x5d8fe3,_0x37e2db){return db[_0xd8a0('0x16')][_0xd8a0('0x1b')](_0x4675b0[_0xd8a0('0x17')],{'raw':_0x4675b0[_0xd8a0('0x18')]?_0x4675b0['options'][_0xd8a0('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4675b0[_0xd8a0('0x18')]?_0x4675b0[_0xd8a0('0x18')][_0xd8a0('0x1c')]||null:null,'attributes':_0x4675b0[_0xd8a0('0x18')]?_0x4675b0[_0xd8a0('0x18')][_0xd8a0('0x1d')]||null:null,'limit':_0x4675b0[_0xd8a0('0x18')]?_0x4675b0['options'][_0xd8a0('0x1e')]||null:null})[_0xd8a0('0xb')](function(_0x54c516){logger['info'](_0xd8a0('0x1f'),_0x4675b0);logger['debug'](_0xd8a0('0x1f'),_0x4675b0,JSON['stringify'](_0x54c516));_0x5d8fe3(_0x54c516);})[_0xd8a0('0x14')](function(_0x18933d){logger[_0xd8a0('0x11')](_0xd8a0('0x1f'),_0x18933d[_0xd8a0('0x12')],_0x4675b0);_0x37e2db(_0xc46ff4[_0xd8a0('0x11')](0x1f4,_0x18933d[_0xd8a0('0x12')]));});});}; \ No newline at end of file +var _0xe301=['message','result','catch','SmsQueueReport','create','body','options','raw','CreateSmsQueueReport','UpdateSmsQueueReport','update','where','lodash','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','info','SmsQueueReport,\x20%s,\x20%s','request\x20sent','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x40be86,_0x68fe5d){var _0xda3c3b=function(_0x39deab){while(--_0x39deab){_0x40be86['push'](_0x40be86['shift']());}};_0xda3c3b(++_0x68fe5d);}(_0xe301,0xf4));var _0x1e30=function(_0x7994a9,_0x3703fe){_0x7994a9=_0x7994a9-0x0;var _0x5bda86=_0xe301[_0x7994a9];return _0x5bda86;};'use strict';var _=require(_0x1e30('0x0'));var util=require('util');var moment=require(_0x1e30('0x1'));var BPromise=require(_0x1e30('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1e30('0x3'))['db'];var utils=require(_0x1e30('0x4'));var logger=require(_0x1e30('0x5'))(_0x1e30('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x1e30('0x7')][_0x1e30('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x474cb3,_0x5816bb,_0x2237eb){return new BPromise(function(_0x1262f1,_0x2e3642){return client[_0x1e30('0x9')](_0x474cb3,_0x2237eb)['then'](function(_0x2d9953){logger[_0x1e30('0xa')](_0x1e30('0xb'),_0x5816bb,_0x1e30('0xc'));logger[_0x1e30('0xd')](_0x1e30('0xe'),_0x5816bb,_0x1e30('0xc'),JSON[_0x1e30('0xf')](_0x2d9953));if(_0x2d9953[_0x1e30('0x10')]){if(_0x2d9953[_0x1e30('0x10')]['code']===0x1f4){logger[_0x1e30('0x10')](_0x1e30('0xb'),_0x5816bb,_0x2d9953[_0x1e30('0x10')]['message']);return _0x2e3642(_0x2d9953['error'][_0x1e30('0x11')]);}logger[_0x1e30('0x10')](_0x1e30('0xb'),_0x5816bb,_0x2d9953[_0x1e30('0x10')]['message']);return _0x1262f1(_0x2d9953['error'][_0x1e30('0x11')]);}else{logger['info'](_0x1e30('0xb'),_0x5816bb,'request\x20sent');_0x1262f1(_0x2d9953[_0x1e30('0x12')][_0x1e30('0x11')]);}})[_0x1e30('0x13')](function(_0x490ca4){logger[_0x1e30('0x10')](_0x1e30('0xb'),_0x5816bb,_0x490ca4);_0x2e3642(_0x490ca4);});});}exports['CreateSmsQueueReport']=function(_0x3837c9){var _0xa20523=this;return new Promise(function(_0x4839f9,_0x10fd2a){return db[_0x1e30('0x14')][_0x1e30('0x15')](_0x3837c9[_0x1e30('0x16')],{'raw':_0x3837c9[_0x1e30('0x17')]?_0x3837c9[_0x1e30('0x17')][_0x1e30('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0x2fee96){logger['info']('CreateSmsQueueReport',_0x3837c9);logger[_0x1e30('0xd')](_0x1e30('0x19'),_0x3837c9,JSON[_0x1e30('0xf')](_0x2fee96));_0x4839f9(_0x2fee96);})[_0x1e30('0x13')](function(_0x89e5fa){logger['error']('CreateSmsQueueReport',_0x89e5fa[_0x1e30('0x11')],_0x3837c9);_0x10fd2a(_0xa20523[_0x1e30('0x10')](0x1f4,_0x89e5fa[_0x1e30('0x11')]));});});};exports[_0x1e30('0x1a')]=function(_0x58c595){var _0x495297=this;return new Promise(function(_0x4cf11a,_0x22a26b){return db[_0x1e30('0x14')][_0x1e30('0x1b')](_0x58c595[_0x1e30('0x16')],{'raw':_0x58c595[_0x1e30('0x17')]?_0x58c595[_0x1e30('0x17')][_0x1e30('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x58c595[_0x1e30('0x17')]?_0x58c595[_0x1e30('0x17')][_0x1e30('0x1c')]||null:null,'attributes':_0x58c595[_0x1e30('0x17')]?_0x58c595[_0x1e30('0x17')]['attributes']||null:null,'limit':_0x58c595[_0x1e30('0x17')]?_0x58c595[_0x1e30('0x17')]['limit']||null:null})['then'](function(_0x31c744){logger['info']('UpdateSmsQueueReport',_0x58c595);logger[_0x1e30('0xd')](_0x1e30('0x1a'),_0x58c595,JSON[_0x1e30('0xf')](_0x31c744));_0x4cf11a(_0x31c744);})['catch'](function(_0x586281){logger[_0x1e30('0x10')](_0x1e30('0x1a'),_0x586281[_0x1e30('0x11')],_0x58c595);_0x22a26b(_0x495297[_0x1e30('0x10')](0x1f4,_0x586281[_0x1e30('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/index.js b/server/api/smsTransferReport/index.js index 4d91983..d0fb074 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 _0xdd4f=['isAuthenticated','index','get','/describe','show','post','create','/:id','update','delete','destroy','exports','multer','express','Router','../../components/interaction/service','../../config/environment','./smsTransferReport.controller'];(function(_0x47b138,_0x2d3419){var _0x3cceca=function(_0xbfbe2c){while(--_0xbfbe2c){_0x47b138['push'](_0x47b138['shift']());}};_0x3cceca(++_0x2d3419);}(_0xdd4f,0x1ce));var _0xfdd4=function(_0x7578bc,_0x27fe04){_0x7578bc=_0x7578bc-0x0;var _0x32a1c1=_0xdd4f[_0x7578bc];return _0x32a1c1;};'use strict';var multer=require(_0xfdd4('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xfdd4('0x1'));var router=express[_0xfdd4('0x2')]();var auth=require('../../components/auth/service');var interaction=require(_0xfdd4('0x3'));var config=require(_0xfdd4('0x4'));var controller=require(_0xfdd4('0x5'));router['get']('/',auth[_0xfdd4('0x6')](),controller[_0xfdd4('0x7')]);router[_0xfdd4('0x8')](_0xfdd4('0x9'),auth[_0xfdd4('0x6')](),controller['describe']);router[_0xfdd4('0x8')]('/:id',auth[_0xfdd4('0x6')](),controller[_0xfdd4('0xa')]);router[_0xfdd4('0xb')]('/',auth['isAuthenticated'](),controller[_0xfdd4('0xc')]);router['put'](_0xfdd4('0xd'),auth[_0xfdd4('0x6')](),controller[_0xfdd4('0xe')]);router[_0xfdd4('0xf')](_0xfdd4('0xd'),auth[_0xfdd4('0x6')](),controller[_0xfdd4('0x10')]);module[_0xfdd4('0x11')]=router; \ No newline at end of file +var _0x4213=['put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','index','describe','/:id','post'];(function(_0x4953c9,_0x24591d){var _0x263a5e=function(_0x4181bf){while(--_0x4181bf){_0x4953c9['push'](_0x4953c9['shift']());}};_0x263a5e(++_0x24591d);}(_0x4213,0x77));var _0x3421=function(_0x302e12,_0x18b3be){_0x302e12=_0x302e12-0x0;var _0x115b17=_0x4213[_0x302e12];return _0x115b17;};'use strict';var multer=require(_0x3421('0x0'));var util=require(_0x3421('0x1'));var path=require(_0x3421('0x2'));var timeout=require(_0x3421('0x3'));var express=require(_0x3421('0x4'));var router=express[_0x3421('0x5')]();var auth=require(_0x3421('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x3421('0x7'));var controller=require('./smsTransferReport.controller');router[_0x3421('0x8')]('/',auth[_0x3421('0x9')](),controller[_0x3421('0xa')]);router[_0x3421('0x8')]('/describe',auth[_0x3421('0x9')](),controller[_0x3421('0xb')]);router[_0x3421('0x8')](_0x3421('0xc'),auth[_0x3421('0x9')](),controller['show']);router[_0x3421('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x3421('0xe')]('/:id',auth[_0x3421('0x9')](),controller[_0x3421('0xf')]);router[_0x3421('0x10')](_0x3421('0xc'),auth[_0x3421('0x9')](),controller[_0x3421('0x11')]);module[_0x3421('0x12')]=router; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.attributes.js b/server/api/smsTransferReport/smsTransferReport.attributes.js index a14b8d3..cb474a3 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 _0x30e8=['sequelize','exports','ENUM','account','agent','queue','DATE','NOW','moment'];(function(_0x5140b3,_0x3ede66){var _0x406ae9=function(_0x22928a){while(--_0x22928a){_0x5140b3['push'](_0x5140b3['shift']());}};_0x406ae9(++_0x3ede66);}(_0x30e8,0x128));var _0x830e=function(_0x2a4c65,_0x5a6e7){_0x2a4c65=_0x2a4c65-0x0;var _0x16578a=_0x30e8[_0x2a4c65];return _0x16578a;};'use strict';var moment=require(_0x830e('0x0'));var Sequelize=require(_0x830e('0x1'));module[_0x830e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x830e('0x3')](_0x830e('0x4'),_0x830e('0x5'),_0x830e('0x6')),'allowNull':![],'defaultValue':_0x830e('0x6')},'transferredAt':{'type':Sequelize[_0x830e('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x830e('0x8')]}}; \ No newline at end of file +var _0xc9c7=['DATE','moment','sequelize','exports','STRING','ENUM','agent','queue'];(function(_0x31b9cf,_0x1a809b){var _0x357b8a=function(_0x50a273){while(--_0x50a273){_0x31b9cf['push'](_0x31b9cf['shift']());}};_0x357b8a(++_0x1a809b);}(_0xc9c7,0x1c9));var _0x7c9c=function(_0xf6881d,_0x35e8e7){_0xf6881d=_0xf6881d-0x0;var _0x20bf2e=_0xc9c7[_0xf6881d];return _0x20bf2e;};'use strict';var moment=require(_0x7c9c('0x0'));var Sequelize=require(_0x7c9c('0x1'));module[_0x7c9c('0x2')]={'uniqueid':{'type':Sequelize[_0x7c9c('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x7c9c('0x4')]('account',_0x7c9c('0x5'),_0x7c9c('0x6')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize[_0x7c9c('0x7')],'allowNull':![],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.controller.js b/server/api/smsTransferReport/smsTransferReport.controller.js index 1ff618b..45b838e 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 _0xbba2=['destroy','stack','name','send','SmsTransferReport','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','key','VIRTUAL','field','options','count','includeAll','findAll','rows','catch','show','include','find','create','body','update','params','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','to-csv','ejs','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus','status','json','offset','limit','apply','save','then'];(function(_0x1d8b2e,_0xd25267){var _0x2e1285=function(_0xa73467){while(--_0xa73467){_0x1d8b2e['push'](_0x1d8b2e['shift']());}};_0x2e1285(++_0xd25267);}(_0xbba2,0x6c));var _0x2bba=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbba2[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require(_0x2bba('0x0'));var emlformat=require(_0x2bba('0x1'));var rimraf=require(_0x2bba('0x2'));var zipdir=require(_0x2bba('0x3'));var jsonpatch=require(_0x2bba('0x4'));var rp=require(_0x2bba('0x5'));var moment=require(_0x2bba('0x6'));var BPromise=require('bluebird');var Mustache=require(_0x2bba('0x7'));var util=require('util');var path=require(_0x2bba('0x8'));var sox=require('sox');var csv=require(_0x2bba('0x9'));var ejs=require(_0x2bba('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x2bba('0xb'));var crypto=require('crypto');var jsforce=require(_0x2bba('0xc'));var deskjs=require(_0x2bba('0xd'));var toCsv=require(_0x2bba('0x9'));var querystring=require('querystring');var Papa=require(_0x2bba('0xe'));var Redis=require(_0x2bba('0xf'));var authService=require(_0x2bba('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x2bba('0x11'));var hardwareService=require(_0x2bba('0x12'));var logger=require(_0x2bba('0x13'))(_0x2bba('0x14'));var utils=require('../../config/utils');var config=require(_0x2bba('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x424614,_0x2c485b){_0x2c485b=_0x2c485b||0xcc;return function(_0x32cb79){if(_0x32cb79){return _0x424614[_0x2bba('0x16')](_0x2c485b);}return _0x424614[_0x2bba('0x17')](_0x2c485b)['end']();};}function respondWithResult(_0x2331b4,_0x4e1c33){_0x4e1c33=_0x4e1c33||0xc8;return function(_0x2d4f63){if(_0x2d4f63){return _0x2331b4['status'](_0x4e1c33)[_0x2bba('0x18')](_0x2d4f63);}};}function respondWithFilteredResult(_0x40ca38,_0x15fed2){return function(_0x343bd4){if(_0x343bd4){var _0x1ffec0=_0x343bd4['count'],_0x4dd3a7=_0x15fed2[_0x2bba('0x19')],_0xa52bbe=_0x15fed2['offset']+_0x15fed2[_0x2bba('0x1a')],_0x548838;if(_0xa52bbe>=_0x1ffec0){_0xa52bbe=_0x1ffec0;_0x548838=0xc8;}else{_0x548838=0xce;}_0x40ca38[_0x2bba('0x17')](_0x548838);return _0x40ca38['set']('Content-Range',_0x4dd3a7+'-'+_0xa52bbe+'/'+_0x1ffec0)[_0x2bba('0x18')](_0x343bd4);}return null;};}function patchUpdates(_0x27657e){return function(_0x2cd520){try{jsonpatch[_0x2bba('0x1b')](_0x2cd520,_0x27657e,!![]);}catch(_0x50f856){return BPromise['reject'](_0x50f856);}return _0x2cd520[_0x2bba('0x1c')]();};}function saveUpdates(_0x1bc00b,_0x571b3a){return function(_0x12c56f){if(_0x12c56f){return _0x12c56f['update'](_0x1bc00b)[_0x2bba('0x1d')](function(_0x186485){return _0x186485;});}return null;};}function removeEntity(_0xc0ad0,_0x19db51){return function(_0x53b6cd){if(_0x53b6cd){return _0x53b6cd[_0x2bba('0x1e')]()[_0x2bba('0x1d')](function(){_0xc0ad0[_0x2bba('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0xd08b51,_0x1d00e6){return function(_0x19b3b7){if(!_0x19b3b7){_0xd08b51[_0x2bba('0x16')](0x194);}return _0x19b3b7;};}function handleError(_0x2e6cf7,_0x376596){_0x376596=_0x376596||0x1f4;return function(_0x3d5dea){logger['error'](_0x3d5dea[_0x2bba('0x1f')]);if(_0x3d5dea[_0x2bba('0x20')]){delete _0x3d5dea[_0x2bba('0x20')];}_0x2e6cf7[_0x2bba('0x17')](_0x376596)[_0x2bba('0x21')](_0x3d5dea);};}exports['index']=function(_0x517215,_0x3c6c8e){var _0x2a7131={},_0x62f13a={},_0x4af741={'count':0x0,'rows':[]};var _0x30c516=db[_0x2bba('0x22')][_0x2bba('0x23')];_0x62f13a[_0x2bba('0x24')]=_[_0x2bba('0x25')](_0x30c516);_0x62f13a['query']=_[_0x2bba('0x25')](_0x517215[_0x2bba('0x26')]);_0x62f13a[_0x2bba('0x27')]=_[_0x2bba('0x28')](_0x62f13a[_0x2bba('0x24')],_0x62f13a[_0x2bba('0x26')]);_0x2a7131[_0x2bba('0x29')]=_[_0x2bba('0x28')](_0x62f13a[_0x2bba('0x24')],qs['fields'](_0x517215[_0x2bba('0x26')][_0x2bba('0x2a')]));_0x2a7131[_0x2bba('0x29')]=_0x2a7131[_0x2bba('0x29')][_0x2bba('0x2b')]?_0x2a7131[_0x2bba('0x29')]:_0x62f13a[_0x2bba('0x24')];if(!_0x517215['query'][_0x2bba('0x2c')](_0x2bba('0x2d'))){_0x2a7131[_0x2bba('0x1a')]=qs[_0x2bba('0x1a')](_0x517215[_0x2bba('0x26')][_0x2bba('0x1a')]);_0x2a7131[_0x2bba('0x19')]=qs[_0x2bba('0x19')](_0x517215[_0x2bba('0x26')][_0x2bba('0x19')]);}_0x2a7131[_0x2bba('0x2e')]=qs[_0x2bba('0x2f')](_0x517215[_0x2bba('0x26')][_0x2bba('0x2f')]);_0x2a7131[_0x2bba('0x30')]=qs[_0x2bba('0x27')](_[_0x2bba('0x31')](_0x517215[_0x2bba('0x26')],_0x62f13a[_0x2bba('0x27')]));if(_0x517215[_0x2bba('0x26')][_0x2bba('0x32')]){_0x2a7131[_0x2bba('0x30')]=_[_0x2bba('0x33')](_0x2a7131[_0x2bba('0x30')],{'$or':_['map'](_0x30c516,function(_0x5d7aca){if(_0x5d7aca['type'][_0x2bba('0x34')]!==_0x2bba('0x35')){var _0x350d77={};_0x350d77[_0x5d7aca[_0x2bba('0x36')]]={'$like':'%'+_0x517215[_0x2bba('0x26')][_0x2bba('0x32')]+'%'};return _0x350d77;}})});}_0x2a7131=_[_0x2bba('0x33')]({},_0x2a7131,_0x517215[_0x2bba('0x37')]);var _0x5a8b11={'where':_0x2a7131[_0x2bba('0x30')]};return db[_0x2bba('0x22')][_0x2bba('0x38')](_0x5a8b11)[_0x2bba('0x1d')](function(_0x614081){_0x4af741[_0x2bba('0x38')]=_0x614081;if(_0x517215['query'][_0x2bba('0x39')]){_0x2a7131['include']=[{'all':!![]}];}return db[_0x2bba('0x22')][_0x2bba('0x3a')](_0x2a7131);})[_0x2bba('0x1d')](function(_0x37de43){_0x4af741[_0x2bba('0x3b')]=_0x37de43;return _0x4af741;})[_0x2bba('0x1d')](respondWithFilteredResult(_0x3c6c8e,_0x2a7131))[_0x2bba('0x3c')](handleError(_0x3c6c8e,null));};exports[_0x2bba('0x3d')]=function(_0x2fe585,_0x17a22e){var _0x8b7ce1={'raw':!![],'where':{'id':_0x2fe585['params']['id']}},_0xbc4de9={};_0xbc4de9['model']=_['keys'](db['SmsTransferReport'][_0x2bba('0x23')]);_0xbc4de9[_0x2bba('0x26')]=_[_0x2bba('0x25')](_0x2fe585['query']);_0xbc4de9[_0x2bba('0x27')]=_[_0x2bba('0x28')](_0xbc4de9[_0x2bba('0x24')],_0xbc4de9['query']);_0x8b7ce1[_0x2bba('0x29')]=_[_0x2bba('0x28')](_0xbc4de9[_0x2bba('0x24')],qs[_0x2bba('0x2a')](_0x2fe585[_0x2bba('0x26')][_0x2bba('0x2a')]));_0x8b7ce1['attributes']=_0x8b7ce1[_0x2bba('0x29')]['length']?_0x8b7ce1[_0x2bba('0x29')]:_0xbc4de9[_0x2bba('0x24')];if(_0x2fe585[_0x2bba('0x26')][_0x2bba('0x39')]){_0x8b7ce1[_0x2bba('0x3e')]=[{'all':!![]}];}_0x8b7ce1=_['merge']({},_0x8b7ce1,_0x2fe585[_0x2bba('0x37')]);return db[_0x2bba('0x22')][_0x2bba('0x3f')](_0x8b7ce1)[_0x2bba('0x1d')](handleEntityNotFound(_0x17a22e,null))[_0x2bba('0x1d')](respondWithResult(_0x17a22e,null))['catch'](handleError(_0x17a22e,null));};exports[_0x2bba('0x40')]=function(_0x4da64c,_0x26fbb0){return db[_0x2bba('0x22')][_0x2bba('0x40')](_0x4da64c[_0x2bba('0x41')],{})[_0x2bba('0x1d')](respondWithResult(_0x26fbb0,0xc9))[_0x2bba('0x3c')](handleError(_0x26fbb0,null));};exports[_0x2bba('0x42')]=function(_0x27d4ed,_0xe53895){if(_0x27d4ed['body']['id']){delete _0x27d4ed[_0x2bba('0x41')]['id'];}return db[_0x2bba('0x22')]['find']({'where':{'id':_0x27d4ed[_0x2bba('0x43')]['id']}})[_0x2bba('0x1d')](handleEntityNotFound(_0xe53895,null))[_0x2bba('0x1d')](saveUpdates(_0x27d4ed['body'],null))[_0x2bba('0x1d')](respondWithResult(_0xe53895,null))[_0x2bba('0x3c')](handleError(_0xe53895,null));};exports[_0x2bba('0x1e')]=function(_0x5d6d69,_0x17e196){return db[_0x2bba('0x22')][_0x2bba('0x3f')]({'where':{'id':_0x5d6d69['params']['id']}})[_0x2bba('0x1d')](handleEntityNotFound(_0x17e196,null))[_0x2bba('0x1d')](removeEntity(_0x17e196,null))[_0x2bba('0x3c')](handleError(_0x17e196,null));};exports[_0x2bba('0x44')]=function(_0x3b1859,_0x4223c1){return db[_0x2bba('0x22')]['describe']()[_0x2bba('0x1d')](respondWithResult(_0x4223c1,null))[_0x2bba('0x3c')](handleError(_0x4223c1,null));}; \ No newline at end of file +var _0x4817=['papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','Content-Range','apply','save','update','then','error','stack','name','send','index','SmsTransferReport','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','nolimit','limit','order','sort','where','pick','filter','map','type','key','VIRTUAL','field','options','findAll','catch','show','params','includeAll','include','merge','find','create','body','destroy','describe','eml-format','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','desk.js','querystring'];(function(_0x3a7125,_0x4df8a3){var _0x5b0ec5=function(_0xc36075){while(--_0xc36075){_0x3a7125['push'](_0x3a7125['shift']());}};_0x5b0ec5(++_0x4df8a3);}(_0x4817,0x11e));var _0x7481=function(_0x26a150,_0x22b64a){_0x26a150=_0x26a150-0x0;var _0x5e3251=_0x4817[_0x26a150];return _0x5e3251;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x7481('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x7481('0x1'));var rp=require('request-promise');var moment=require(_0x7481('0x2'));var BPromise=require(_0x7481('0x3'));var Mustache=require(_0x7481('0x4'));var util=require(_0x7481('0x5'));var path=require(_0x7481('0x6'));var sox=require(_0x7481('0x7'));var csv=require('to-csv');var ejs=require(_0x7481('0x8'));var fs=require('fs');var _=require(_0x7481('0x9'));var squel=require(_0x7481('0xa'));var crypto=require(_0x7481('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x7481('0xc'));var toCsv=require('to-csv');var querystring=require(_0x7481('0xd'));var Papa=require(_0x7481('0xe'));var Redis=require(_0x7481('0xf'));var authService=require(_0x7481('0x10'));var qs=require(_0x7481('0x11'));var as=require(_0x7481('0x12'));var hardwareService=require(_0x7481('0x13'));var logger=require(_0x7481('0x14'))(_0x7481('0x15'));var utils=require(_0x7481('0x16'));var config=require('../../config/environment');var db=require(_0x7481('0x17'))['db'];function respondWithStatusCode(_0x22805c,_0x19682b){_0x19682b=_0x19682b||0xcc;return function(_0x229eff){if(_0x229eff){return _0x22805c[_0x7481('0x18')](_0x19682b);}return _0x22805c[_0x7481('0x19')](_0x19682b)[_0x7481('0x1a')]();};}function respondWithResult(_0x164247,_0x15450b){_0x15450b=_0x15450b||0xc8;return function(_0x563ecc){if(_0x563ecc){return _0x164247[_0x7481('0x19')](_0x15450b)[_0x7481('0x1b')](_0x563ecc);}};}function respondWithFilteredResult(_0x370c1f,_0x47df4b){return function(_0x3ee29b){if(_0x3ee29b){var _0x2f02a7=_0x3ee29b[_0x7481('0x1c')],_0x3b6d34=_0x47df4b['offset'],_0x3cf6c5=_0x47df4b[_0x7481('0x1d')]+_0x47df4b['limit'],_0x34087e;if(_0x3cf6c5>=_0x2f02a7){_0x3cf6c5=_0x2f02a7;_0x34087e=0xc8;}else{_0x34087e=0xce;}_0x370c1f[_0x7481('0x19')](_0x34087e);return _0x370c1f['set'](_0x7481('0x1e'),_0x3b6d34+'-'+_0x3cf6c5+'/'+_0x2f02a7)[_0x7481('0x1b')](_0x3ee29b);}return null;};}function patchUpdates(_0x41061a){return function(_0xa5274f){try{jsonpatch[_0x7481('0x1f')](_0xa5274f,_0x41061a,!![]);}catch(_0x2bbeb6){return BPromise['reject'](_0x2bbeb6);}return _0xa5274f[_0x7481('0x20')]();};}function saveUpdates(_0x36fe73,_0x3db79){return function(_0x1932d8){if(_0x1932d8){return _0x1932d8[_0x7481('0x21')](_0x36fe73)[_0x7481('0x22')](function(_0x39530f){return _0x39530f;});}return null;};}function removeEntity(_0x3d6257,_0x580b8d){return function(_0x45285c){if(_0x45285c){return _0x45285c['destroy']()[_0x7481('0x22')](function(){_0x3d6257[_0x7481('0x19')](0xcc)[_0x7481('0x1a')]();});}};}function handleEntityNotFound(_0x8c1b2,_0x46da7c){return function(_0xe7efa1){if(!_0xe7efa1){_0x8c1b2[_0x7481('0x18')](0x194);}return _0xe7efa1;};}function handleError(_0x59c5bb,_0x30beac){_0x30beac=_0x30beac||0x1f4;return function(_0x17b347){logger[_0x7481('0x23')](_0x17b347[_0x7481('0x24')]);if(_0x17b347[_0x7481('0x25')]){delete _0x17b347[_0x7481('0x25')];}_0x59c5bb['status'](_0x30beac)[_0x7481('0x26')](_0x17b347);};}exports[_0x7481('0x27')]=function(_0x20b9f4,_0x4f148d){var _0x6cc72e={},_0x2dc42e={},_0x2f3e0a={'count':0x0,'rows':[]};var _0x1bf480=db[_0x7481('0x28')][_0x7481('0x29')];_0x2dc42e[_0x7481('0x2a')]=_[_0x7481('0x2b')](_0x1bf480);_0x2dc42e['query']=_[_0x7481('0x2b')](_0x20b9f4[_0x7481('0x2c')]);_0x2dc42e[_0x7481('0x2d')]=_[_0x7481('0x2e')](_0x2dc42e[_0x7481('0x2a')],_0x2dc42e['query']);_0x6cc72e[_0x7481('0x2f')]=_[_0x7481('0x2e')](_0x2dc42e[_0x7481('0x2a')],qs[_0x7481('0x30')](_0x20b9f4[_0x7481('0x2c')][_0x7481('0x30')]));_0x6cc72e[_0x7481('0x2f')]=_0x6cc72e[_0x7481('0x2f')][_0x7481('0x31')]?_0x6cc72e[_0x7481('0x2f')]:_0x2dc42e[_0x7481('0x2a')];if(!_0x20b9f4[_0x7481('0x2c')]['hasOwnProperty'](_0x7481('0x32'))){_0x6cc72e[_0x7481('0x33')]=qs[_0x7481('0x33')](_0x20b9f4[_0x7481('0x2c')][_0x7481('0x33')]);_0x6cc72e[_0x7481('0x1d')]=qs['offset'](_0x20b9f4['query'][_0x7481('0x1d')]);}_0x6cc72e[_0x7481('0x34')]=qs[_0x7481('0x35')](_0x20b9f4[_0x7481('0x2c')]['sort']);_0x6cc72e[_0x7481('0x36')]=qs['filters'](_[_0x7481('0x37')](_0x20b9f4[_0x7481('0x2c')],_0x2dc42e[_0x7481('0x2d')]));if(_0x20b9f4[_0x7481('0x2c')][_0x7481('0x38')]){_0x6cc72e['where']=_['merge'](_0x6cc72e[_0x7481('0x36')],{'$or':_[_0x7481('0x39')](_0x1bf480,function(_0x52d3b4){if(_0x52d3b4[_0x7481('0x3a')][_0x7481('0x3b')]!==_0x7481('0x3c')){var _0x4cf52d={};_0x4cf52d[_0x52d3b4[_0x7481('0x3d')]]={'$like':'%'+_0x20b9f4[_0x7481('0x2c')][_0x7481('0x38')]+'%'};return _0x4cf52d;}})});}_0x6cc72e=_['merge']({},_0x6cc72e,_0x20b9f4[_0x7481('0x3e')]);var _0x287827={'where':_0x6cc72e[_0x7481('0x36')]};return db[_0x7481('0x28')][_0x7481('0x1c')](_0x287827)['then'](function(_0x4f9157){_0x2f3e0a[_0x7481('0x1c')]=_0x4f9157;if(_0x20b9f4[_0x7481('0x2c')]['includeAll']){_0x6cc72e['include']=[{'all':!![]}];}return db['SmsTransferReport'][_0x7481('0x3f')](_0x6cc72e);})[_0x7481('0x22')](function(_0xba1d8a){_0x2f3e0a['rows']=_0xba1d8a;return _0x2f3e0a;})[_0x7481('0x22')](respondWithFilteredResult(_0x4f148d,_0x6cc72e))[_0x7481('0x40')](handleError(_0x4f148d,null));};exports[_0x7481('0x41')]=function(_0x5f12db,_0x5a7788){var _0x76d51e={'raw':!![],'where':{'id':_0x5f12db[_0x7481('0x42')]['id']}},_0x8a0274={};_0x8a0274[_0x7481('0x2a')]=_[_0x7481('0x2b')](db[_0x7481('0x28')][_0x7481('0x29')]);_0x8a0274['query']=_[_0x7481('0x2b')](_0x5f12db['query']);_0x8a0274[_0x7481('0x2d')]=_['intersection'](_0x8a0274[_0x7481('0x2a')],_0x8a0274[_0x7481('0x2c')]);_0x76d51e[_0x7481('0x2f')]=_['intersection'](_0x8a0274['model'],qs['fields'](_0x5f12db[_0x7481('0x2c')][_0x7481('0x30')]));_0x76d51e[_0x7481('0x2f')]=_0x76d51e[_0x7481('0x2f')][_0x7481('0x31')]?_0x76d51e['attributes']:_0x8a0274['model'];if(_0x5f12db[_0x7481('0x2c')][_0x7481('0x43')]){_0x76d51e[_0x7481('0x44')]=[{'all':!![]}];}_0x76d51e=_[_0x7481('0x45')]({},_0x76d51e,_0x5f12db[_0x7481('0x3e')]);return db[_0x7481('0x28')][_0x7481('0x46')](_0x76d51e)[_0x7481('0x22')](handleEntityNotFound(_0x5a7788,null))[_0x7481('0x22')](respondWithResult(_0x5a7788,null))[_0x7481('0x40')](handleError(_0x5a7788,null));};exports[_0x7481('0x47')]=function(_0x5ad7ef,_0x2197fe){return db[_0x7481('0x28')][_0x7481('0x47')](_0x5ad7ef[_0x7481('0x48')],{})[_0x7481('0x22')](respondWithResult(_0x2197fe,0xc9))[_0x7481('0x40')](handleError(_0x2197fe,null));};exports[_0x7481('0x21')]=function(_0x1fb1b1,_0x2c6ae0){if(_0x1fb1b1[_0x7481('0x48')]['id']){delete _0x1fb1b1[_0x7481('0x48')]['id'];}return db[_0x7481('0x28')][_0x7481('0x46')]({'where':{'id':_0x1fb1b1['params']['id']}})[_0x7481('0x22')](handleEntityNotFound(_0x2c6ae0,null))[_0x7481('0x22')](saveUpdates(_0x1fb1b1[_0x7481('0x48')],null))[_0x7481('0x22')](respondWithResult(_0x2c6ae0,null))[_0x7481('0x40')](handleError(_0x2c6ae0,null));};exports[_0x7481('0x49')]=function(_0x625a73,_0x52edf4){return db[_0x7481('0x28')][_0x7481('0x46')]({'where':{'id':_0x625a73[_0x7481('0x42')]['id']}})[_0x7481('0x22')](handleEntityNotFound(_0x52edf4,null))['then'](removeEntity(_0x52edf4,null))[_0x7481('0x40')](handleError(_0x52edf4,null));};exports[_0x7481('0x4a')]=function(_0x249ebb,_0x2522ef){return db[_0x7481('0x28')][_0x7481('0x4a')]()[_0x7481('0x22')](respondWithResult(_0x2522ef,null))[_0x7481('0x40')](handleError(_0x2522ef,null));}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.model.js b/server/api/smsTransferReport/smsTransferReport.model.js index 26e1a40..c9621db 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 _0x11e5=['path','../../config/environment','define','uniqueid','lodash','../../config/logger','api','bluebird','request-promise'];(function(_0x56e340,_0x52ffe9){var _0x20b2c7=function(_0x4d3420){while(--_0x4d3420){_0x56e340['push'](_0x56e340['shift']());}};_0x20b2c7(++_0x52ffe9);}(_0x11e5,0x8b));var _0x511e=function(_0x59cc07,_0x4166f5){_0x59cc07=_0x59cc07-0x0;var _0x1f1c4d=_0x11e5[_0x59cc07];return _0x1f1c4d;};'use strict';var _=require(_0x511e('0x0'));var util=require('util');var logger=require(_0x511e('0x1'))(_0x511e('0x2'));var moment=require('moment');var BPromise=require(_0x511e('0x3'));var rp=require(_0x511e('0x4'));var fs=require('fs');var path=require(_0x511e('0x5'));var rimraf=require('rimraf');var config=require(_0x511e('0x6'));var attributes=require('./smsTransferReport.attributes');module['exports']=function(_0x342539,_0x323f8c){return _0x342539[_0x511e('0x7')]('SmsTransferReport',attributes,{'tableName':'report_sms_transfer','paranoid':![],'indexes':[{'name':_0x511e('0x8'),'fields':[_0x511e('0x8')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xb091=['request-promise','../../config/environment','./smsTransferReport.attributes','define','report_sms_transfer','uniqueid','util','../../config/logger','api','moment'];(function(_0x5d90b8,_0x528b3a){var _0x5712b3=function(_0x478049){while(--_0x478049){_0x5d90b8['push'](_0x5d90b8['shift']());}};_0x5712b3(++_0x528b3a);}(_0xb091,0x16e));var _0x1b09=function(_0x4ab4ce,_0xe857e1){_0x4ab4ce=_0x4ab4ce-0x0;var _0x3c3374=_0xb091[_0x4ab4ce];return _0x3c3374;};'use strict';var _=require('lodash');var util=require(_0x1b09('0x0'));var logger=require(_0x1b09('0x1'))(_0x1b09('0x2'));var moment=require(_0x1b09('0x3'));var BPromise=require('bluebird');var rp=require(_0x1b09('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x1b09('0x5'));var attributes=require(_0x1b09('0x6'));module['exports']=function(_0xda8caa,_0x5fa348){return _0xda8caa[_0x1b09('0x7')]('SmsTransferReport',attributes,{'tableName':_0x1b09('0x8'),'paranoid':![],'indexes':[{'name':_0x1b09('0x9'),'fields':[_0x1b09('0x9')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.rpc.js b/server/api/smsTransferReport/smsTransferReport.rpc.js index 0461988..e9caffc 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 _0x3e44=['http','then','info','SmsTransferReport,\x20%s,\x20%s','request\x20sent','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','../../config/environment','client'];(function(_0x4a979b,_0xfcf329){var _0x3618c0=function(_0x5646ad){while(--_0x5646ad){_0x4a979b['push'](_0x4a979b['shift']());}};_0x3618c0(++_0xfcf329);}(_0x3e44,0x15c));var _0x43e4=function(_0x245c6f,_0xdadb84){_0x245c6f=_0x245c6f-0x0;var _0x202439=_0x3e44[_0x245c6f];return _0x202439;};'use strict';var _=require(_0x43e4('0x0'));var util=require(_0x43e4('0x1'));var moment=require(_0x43e4('0x2'));var BPromise=require(_0x43e4('0x3'));var rs=require(_0x43e4('0x4'));var fs=require('fs');var Redis=require(_0x43e4('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x43e4('0x6'))('rpc');var config=require(_0x43e4('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x43e4('0x8')][_0x43e4('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x225c80,_0x14c672,_0x494149){return new BPromise(function(_0x4e18fe,_0x3eeff9){return client['request'](_0x225c80,_0x494149)[_0x43e4('0xa')](function(_0x328de3){logger[_0x43e4('0xb')](_0x43e4('0xc'),_0x14c672,_0x43e4('0xd'));logger[_0x43e4('0xe')](_0x43e4('0xf'),_0x14c672,_0x43e4('0xd'),JSON[_0x43e4('0x10')](_0x328de3));if(_0x328de3[_0x43e4('0x11')]){if(_0x328de3[_0x43e4('0x11')][_0x43e4('0x12')]===0x1f4){logger[_0x43e4('0x11')](_0x43e4('0xc'),_0x14c672,_0x328de3['error'][_0x43e4('0x13')]);return _0x3eeff9(_0x328de3[_0x43e4('0x11')]['message']);}logger[_0x43e4('0x11')]('SmsTransferReport,\x20%s,\x20%s',_0x14c672,_0x328de3[_0x43e4('0x11')][_0x43e4('0x13')]);return _0x4e18fe(_0x328de3[_0x43e4('0x11')][_0x43e4('0x13')]);}else{logger[_0x43e4('0xb')](_0x43e4('0xc'),_0x14c672,_0x43e4('0xd'));_0x4e18fe(_0x328de3[_0x43e4('0x14')][_0x43e4('0x13')]);}})['catch'](function(_0x32bc5e){logger['error'](_0x43e4('0xc'),_0x14c672,_0x32bc5e);_0x3eeff9(_0x32bc5e);});});} \ No newline at end of file +var _0x2206=['SmsTransferReport,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','request\x20sent','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x260d45,_0x182f53){var _0x2fd44e=function(_0x57de55){while(--_0x57de55){_0x260d45['push'](_0x260d45['shift']());}};_0x2fd44e(++_0x182f53);}(_0x2206,0xcc));var _0x6220=function(_0x42ae4c,_0x5a070f){_0x42ae4c=_0x42ae4c-0x0;var _0xe9804b=_0x2206[_0x42ae4c];return _0xe9804b;};'use strict';var _=require(_0x6220('0x0'));var util=require(_0x6220('0x1'));var moment=require(_0x6220('0x2'));var BPromise=require(_0x6220('0x3'));var rs=require(_0x6220('0x4'));var fs=require('fs');var Redis=require(_0x6220('0x5'));var db=require(_0x6220('0x6'))['db'];var utils=require(_0x6220('0x7'));var logger=require(_0x6220('0x8'))(_0x6220('0x9'));var config=require(_0x6220('0xa'));var jayson=require(_0x6220('0xb'));var client=jayson[_0x6220('0xc')][_0x6220('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x588793,_0x2ee45f,_0x588be2){return new BPromise(function(_0x370d90,_0x58398b){return client['request'](_0x588793,_0x588be2)['then'](function(_0x149260){logger[_0x6220('0xe')]('SmsTransferReport,\x20%s,\x20%s',_0x2ee45f,_0x6220('0xf'));logger[_0x6220('0x10')](_0x6220('0x11'),_0x2ee45f,'request\x20sent',JSON[_0x6220('0x12')](_0x149260));if(_0x149260['error']){if(_0x149260[_0x6220('0x13')][_0x6220('0x14')]===0x1f4){logger['error'](_0x6220('0x15'),_0x2ee45f,_0x149260[_0x6220('0x13')][_0x6220('0x16')]);return _0x58398b(_0x149260[_0x6220('0x13')][_0x6220('0x16')]);}logger[_0x6220('0x13')](_0x6220('0x15'),_0x2ee45f,_0x149260[_0x6220('0x13')][_0x6220('0x16')]);return _0x370d90(_0x149260['error'][_0x6220('0x16')]);}else{logger['info'](_0x6220('0x15'),_0x2ee45f,'request\x20sent');_0x370d90(_0x149260[_0x6220('0x17')][_0x6220('0x16')]);}})[_0x6220('0x18')](function(_0x2b6640){logger[_0x6220('0x13')](_0x6220('0x15'),_0x2ee45f,_0x2b6640);_0x58398b(_0x2b6640);});});} \ No newline at end of file diff --git a/server/api/sound/index.js b/server/api/sound/index.js index 752da19..c728b09 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 _0xbc30=['put','update','delete','multer','path','connect-timeout','express','Router','./sound.controller','get','index','/:id','isAuthenticated','show','/:id/download','diskStorage','join','server/files/sounds/original/','originalname','replace','%s-%s%s','now','post','single','file'];(function(_0x49464b,_0x21d0b9){var _0x76d446=function(_0x10f84e){while(--_0x10f84e){_0x49464b['push'](_0x49464b['shift']());}};_0x76d446(++_0x21d0b9);}(_0xbc30,0x148));var _0x0bc3=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0xbc30[_0x1d1779];return _0x2377e9;};'use strict';var multer=require(_0x0bc3('0x0'));var util=require('util');var path=require(_0x0bc3('0x1'));var timeout=require(_0x0bc3('0x2'));var express=require(_0x0bc3('0x3'));var router=express[_0x0bc3('0x4')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x0bc3('0x5'));router[_0x0bc3('0x6')]('/',auth['isAuthenticated'](),controller[_0x0bc3('0x7')]);router[_0x0bc3('0x6')](_0x0bc3('0x8'),auth[_0x0bc3('0x9')](),controller[_0x0bc3('0xa')]);router['get'](_0x0bc3('0xb'),auth[_0x0bc3('0x9')](),controller['download']);var upload=multer({'storage':multer[_0x0bc3('0xc')]({'destination':function(_0x434188,_0x486877,_0x2f16c3){_0x2f16c3(null,path[_0x0bc3('0xd')](config['root'],_0x0bc3('0xe')));},'filename':function(_0x29961f,_0x127d18,_0x4fef93){_0x127d18[_0x0bc3('0xf')]=_0x127d18[_0x0bc3('0xf')][_0x0bc3('0x10')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x4fef93(null,util['format'](_0x0bc3('0x11'),path['basename'](_0x127d18[_0x0bc3('0xf')],path['extname'](_0x127d18['originalname'])),Date[_0x0bc3('0x12')](),path['extname'](_0x127d18['originalname'])));}})});router[_0x0bc3('0x13')]('/',upload[_0x0bc3('0x14')](_0x0bc3('0x15')),controller['create']);router[_0x0bc3('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x0bc3('0x17')]);router[_0x0bc3('0x18')](_0x0bc3('0x8'),auth['isAuthenticated'](),controller[_0x0bc3('0x18')]);module['exports']=router; \ No newline at end of file +var _0xabd9=['get','index','/:id','isAuthenticated','show','download','diskStorage','root','server/files/sounds/original/','originalname','replace','format','%s-%s%s','basename','extname','now','file','create','update','delete','multer','util','express','Router','../../components/auth/service','../../config/environment'];(function(_0x308e50,_0x1599bb){var _0x52971c=function(_0x99deda){while(--_0x99deda){_0x308e50['push'](_0x308e50['shift']());}};_0x52971c(++_0x1599bb);}(_0xabd9,0x7c));var _0x9abd=function(_0x40ee99,_0xa133f4){_0x40ee99=_0x40ee99-0x0;var _0x473ab9=_0xabd9[_0x40ee99];return _0x473ab9;};'use strict';var multer=require(_0x9abd('0x0'));var util=require(_0x9abd('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x9abd('0x2'));var router=express[_0x9abd('0x3')]();var auth=require(_0x9abd('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x9abd('0x5'));var controller=require('./sound.controller');router[_0x9abd('0x6')]('/',auth['isAuthenticated'](),controller[_0x9abd('0x7')]);router['get'](_0x9abd('0x8'),auth[_0x9abd('0x9')](),controller[_0x9abd('0xa')]);router[_0x9abd('0x6')]('/:id/download',auth[_0x9abd('0x9')](),controller[_0x9abd('0xb')]);var upload=multer({'storage':multer[_0x9abd('0xc')]({'destination':function(_0xd50771,_0x409264,_0x5f12f3){_0x5f12f3(null,path['join'](config[_0x9abd('0xd')],_0x9abd('0xe')));},'filename':function(_0x43e462,_0x257c98,_0x234010){_0x257c98[_0x9abd('0xf')]=_0x257c98[_0x9abd('0xf')][_0x9abd('0x10')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x234010(null,util[_0x9abd('0x11')](_0x9abd('0x12'),path[_0x9abd('0x13')](_0x257c98[_0x9abd('0xf')],path[_0x9abd('0x14')](_0x257c98['originalname'])),Date[_0x9abd('0x15')](),path['extname'](_0x257c98[_0x9abd('0xf')])));}})});router['post']('/',upload['single'](_0x9abd('0x16')),controller[_0x9abd('0x17')]);router['put'](_0x9abd('0x8'),auth[_0x9abd('0x9')](),controller[_0x9abd('0x18')]);router[_0x9abd('0x19')]('/:id',auth[_0x9abd('0x9')](),controller['delete']);module['exports']=router; \ No newline at end of file diff --git a/server/api/sound/sound.attributes.js b/server/api/sound/sound.attributes.js index 45a454c..05f45d7 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 _0x17fb=['name','FLOAT','BIGINT','INTEGER','sequelize','exports','STRING'];(function(_0x4b4d9b,_0x4858a8){var _0x4df780=function(_0x1261fa){while(--_0x1261fa){_0x4b4d9b['push'](_0x4b4d9b['shift']());}};_0x4df780(++_0x4858a8);}(_0x17fb,0x107));var _0xb17f=function(_0x5465e6,_0x2a8809){_0x5465e6=_0x5465e6-0x0;var _0x10044e=_0x17fb[_0x5465e6];return _0x10044e;};'use strict';var Sequelize=require(_0xb17f('0x0'));module[_0xb17f('0x1')]={'name':{'type':Sequelize[_0xb17f('0x2')],'unique':_0xb17f('0x3'),'allowNull':![]},'save_name':{'type':Sequelize[_0xb17f('0x2')]},'display_name':{'type':Sequelize[_0xb17f('0x2')],'defaultValue':''},'description':{'type':Sequelize[_0xb17f('0x2')]},'original_format':{'type':Sequelize['STRING']},'original_duration':{'type':Sequelize[_0xb17f('0x4')]},'original_sampleCount':{'type':Sequelize[_0xb17f('0x5')]},'original_channelCount':{'type':Sequelize[_0xb17f('0x6')]},'original_bitRate':{'type':Sequelize['BIGINT']},'original_sampleRate':{'type':Sequelize['INTEGER']},'converted_format':{'type':Sequelize[_0xb17f('0x2')]},'converted_duration':{'type':Sequelize[_0xb17f('0x4')]},'converted_sampleCount':{'type':Sequelize[_0xb17f('0x5')]},'converted_channelCount':{'type':Sequelize['INTEGER']},'converted_bitRate':{'type':Sequelize[_0xb17f('0x5')]},'converted_sampleRate':{'type':Sequelize[_0xb17f('0x6')]}}; \ No newline at end of file +var _0x43bc=['STRING','BIGINT','INTEGER','FLOAT','exports'];(function(_0x3d90b4,_0x1e2fc6){var _0x4c65d3=function(_0x311abc){while(--_0x311abc){_0x3d90b4['push'](_0x3d90b4['shift']());}};_0x4c65d3(++_0x1e2fc6);}(_0x43bc,0x167));var _0xc43b=function(_0x48f7cf,_0x4baa04){_0x48f7cf=_0x48f7cf-0x0;var _0xc201c0=_0x43bc[_0x48f7cf];return _0xc201c0;};'use strict';var Sequelize=require('sequelize');module[_0xc43b('0x0')]={'name':{'type':Sequelize[_0xc43b('0x1')],'unique':'name','allowNull':![]},'save_name':{'type':Sequelize[_0xc43b('0x1')]},'display_name':{'type':Sequelize[_0xc43b('0x1')],'defaultValue':''},'description':{'type':Sequelize[_0xc43b('0x1')]},'original_format':{'type':Sequelize['STRING']},'original_duration':{'type':Sequelize['FLOAT']},'original_sampleCount':{'type':Sequelize[_0xc43b('0x2')]},'original_channelCount':{'type':Sequelize[_0xc43b('0x3')]},'original_bitRate':{'type':Sequelize['BIGINT']},'original_sampleRate':{'type':Sequelize[_0xc43b('0x3')]},'converted_format':{'type':Sequelize['STRING']},'converted_duration':{'type':Sequelize[_0xc43b('0x4')]},'converted_sampleCount':{'type':Sequelize[_0xc43b('0x2')]},'converted_channelCount':{'type':Sequelize['INTEGER']},'converted_bitRate':{'type':Sequelize[_0xc43b('0x2')]},'converted_sampleRate':{'type':Sequelize[_0xc43b('0x3')]}}; \ No newline at end of file diff --git a/server/api/sound/sound.controller.js b/server/api/sound/sound.controller.js index 481d790..3b295e5 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 _0xb411=['limit','order','sort','where','pick','filter','merge','map','type','key','VIRTUAL','field','options','includeAll','rows','show','include','find','catch','save_name','converted_format','existsSync','join','root','Sequelize','ValidationError','Sound\x20not\x20found','server/files/sounds/converted','format','%s.%s','create','basename','originalname','extname','file','filename','substring','wav','server/files/sounds/original','info','Sound\x20upload\x20destination:\x20%s','chmodSync','0777','unlinkSync','send','original_duration','duration','original_sampleCount','sampleCount','original_channelCount','channelCount','original_bitRate','bitRate','original_sampleRate','sampleRate','dest','converted_duration','converted_sampleCount','converted_channelCount','converted_bitRate','converted_sampleRate','body','role','Unable\x20to\x20retrieve\x20the\x20current\x20user','get','Sounds','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','start','update','params','description','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','Content-Range','apply','reject','save','then','destroy','UserProfileResource','error','stack','name','index','Sound','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty'];(function(_0x459bc3,_0x3ced9e){var _0x5401e6=function(_0x5c2783){while(--_0x5c2783){_0x459bc3['push'](_0x459bc3['shift']());}};_0x5401e6(++_0x3ced9e);}(_0xb411,0x1bd));var _0x1b41=function(_0x1407ea,_0x11581b){_0x1407ea=_0x1407ea-0x0;var _0x300309=_0xb411[_0x1407ea];return _0x300309;};'use strict';var pdf=require(_0x1b41('0x0'));var emlformat=require(_0x1b41('0x1'));var rimraf=require(_0x1b41('0x2'));var zipdir=require(_0x1b41('0x3'));var jsonpatch=require(_0x1b41('0x4'));var rp=require(_0x1b41('0x5'));var moment=require('moment');var BPromise=require(_0x1b41('0x6'));var Mustache=require(_0x1b41('0x7'));var util=require(_0x1b41('0x8'));var path=require('path');var sox=require(_0x1b41('0x9'));var csv=require(_0x1b41('0xa'));var ejs=require(_0x1b41('0xb'));var fs=require('fs');var _=require(_0x1b41('0xc'));var squel=require(_0x1b41('0xd'));var crypto=require(_0x1b41('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x1b41('0xa'));var querystring=require('querystring');var Papa=require(_0x1b41('0xf'));var Redis=require(_0x1b41('0x10'));var authService=require(_0x1b41('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x1b41('0x12'));var hardwareService=require(_0x1b41('0x13'));var logger=require('../../config/logger')(_0x1b41('0x14'));var utils=require(_0x1b41('0x15'));var config=require(_0x1b41('0x16'));var db=require(_0x1b41('0x17'))['db'];function respondWithStatusCode(_0x33fc3f,_0x2751b0){_0x2751b0=_0x2751b0||0xcc;return function(_0x2616c7){if(_0x2616c7){return _0x33fc3f[_0x1b41('0x18')](_0x2751b0);}return _0x33fc3f[_0x1b41('0x19')](_0x2751b0)[_0x1b41('0x1a')]();};}function respondWithResult(_0x554f53,_0x36c5e0){_0x36c5e0=_0x36c5e0||0xc8;return function(_0x3b7ce9){if(_0x3b7ce9){return _0x554f53[_0x1b41('0x19')](_0x36c5e0)[_0x1b41('0x1b')](_0x3b7ce9);}};}function respondWithFilteredResult(_0x479185,_0x422814){return function(_0xf5efe2){if(_0xf5efe2){var _0x3ab2f0=_0xf5efe2[_0x1b41('0x1c')],_0x1ea99e=_0x422814[_0x1b41('0x1d')],_0x152f07=_0x422814[_0x1b41('0x1d')]+_0x422814['limit'],_0x5d6f53;if(_0x152f07>=_0x3ab2f0){_0x152f07=_0x3ab2f0;_0x5d6f53=0xc8;}else{_0x5d6f53=0xce;}_0x479185[_0x1b41('0x19')](_0x5d6f53);return _0x479185['set'](_0x1b41('0x1e'),_0x1ea99e+'-'+_0x152f07+'/'+_0x3ab2f0)[_0x1b41('0x1b')](_0xf5efe2);}return null;};}function patchUpdates(_0x392d3e){return function(_0x1197f2){try{jsonpatch[_0x1b41('0x1f')](_0x1197f2,_0x392d3e,!![]);}catch(_0x106122){return BPromise[_0x1b41('0x20')](_0x106122);}return _0x1197f2[_0x1b41('0x21')]();};}function saveUpdates(_0x4ad67e,_0x24bc7a){return function(_0x1da733){if(_0x1da733){return _0x1da733['update'](_0x4ad67e)[_0x1b41('0x22')](function(_0x17cd99){return _0x17cd99;});}return null;};}function removeEntity(_0x3068ca,_0x365d56){return function(_0x12e9cd){if(_0x12e9cd){return _0x12e9cd[_0x1b41('0x23')]()[_0x1b41('0x22')](function(){var _0x17d869=_0x12e9cd['get']({'plain':!![]});var _0x5bff75='Sounds';return db[_0x1b41('0x24')][_0x1b41('0x23')]({'where':{'type':_0x5bff75,'resourceId':_0x17d869['id']}})[_0x1b41('0x22')](function(){return _0x12e9cd;});})[_0x1b41('0x22')](function(){_0x3068ca[_0x1b41('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x48227b,_0x257cce){return function(_0x3852fa){if(!_0x3852fa){_0x48227b[_0x1b41('0x18')](0x194);}return _0x3852fa;};}function handleError(_0x462d46,_0x11c6af){_0x11c6af=_0x11c6af||0x1f4;return function(_0x47eb0d){logger[_0x1b41('0x25')](_0x47eb0d[_0x1b41('0x26')]);if(_0x47eb0d[_0x1b41('0x27')]){delete _0x47eb0d[_0x1b41('0x27')];}_0x462d46['status'](_0x11c6af)['send'](_0x47eb0d);};}exports[_0x1b41('0x28')]=function(_0x46c057,_0x281784){var _0x1f75ce={},_0x528934={},_0x24dca5={'count':0x0,'rows':[]};var _0x27ee96=db[_0x1b41('0x29')]['rawAttributes'];_0x528934[_0x1b41('0x2a')]=_['keys'](_0x27ee96);_0x528934[_0x1b41('0x2b')]=_[_0x1b41('0x2c')](_0x46c057[_0x1b41('0x2b')]);_0x528934[_0x1b41('0x2d')]=_[_0x1b41('0x2e')](_0x528934[_0x1b41('0x2a')],_0x528934[_0x1b41('0x2b')]);_0x1f75ce[_0x1b41('0x2f')]=_[_0x1b41('0x2e')](_0x528934[_0x1b41('0x2a')],qs[_0x1b41('0x30')](_0x46c057[_0x1b41('0x2b')][_0x1b41('0x30')]));_0x1f75ce[_0x1b41('0x2f')]=_0x1f75ce['attributes'][_0x1b41('0x31')]?_0x1f75ce[_0x1b41('0x2f')]:_0x528934[_0x1b41('0x2a')];if(!_0x46c057[_0x1b41('0x2b')][_0x1b41('0x32')]('nolimit')){_0x1f75ce[_0x1b41('0x33')]=qs[_0x1b41('0x33')](_0x46c057[_0x1b41('0x2b')][_0x1b41('0x33')]);_0x1f75ce[_0x1b41('0x1d')]=qs[_0x1b41('0x1d')](_0x46c057[_0x1b41('0x2b')][_0x1b41('0x1d')]);}_0x1f75ce[_0x1b41('0x34')]=qs[_0x1b41('0x35')](_0x46c057['query'][_0x1b41('0x35')]);_0x1f75ce[_0x1b41('0x36')]=qs[_0x1b41('0x2d')](_[_0x1b41('0x37')](_0x46c057[_0x1b41('0x2b')],_0x528934['filters']));if(_0x46c057[_0x1b41('0x2b')][_0x1b41('0x38')]){_0x1f75ce[_0x1b41('0x36')]=_[_0x1b41('0x39')](_0x1f75ce[_0x1b41('0x36')],{'$or':_[_0x1b41('0x3a')](_0x27ee96,function(_0x2e7229){if(_0x2e7229[_0x1b41('0x3b')][_0x1b41('0x3c')]!==_0x1b41('0x3d')){var _0x2591a9={};_0x2591a9[_0x2e7229[_0x1b41('0x3e')]]={'$like':'%'+_0x46c057[_0x1b41('0x2b')]['filter']+'%'};return _0x2591a9;}})});}_0x1f75ce=_[_0x1b41('0x39')]({},_0x1f75ce,_0x46c057[_0x1b41('0x3f')]);var _0x7639a1={'where':_0x1f75ce[_0x1b41('0x36')]};return db[_0x1b41('0x29')][_0x1b41('0x1c')](_0x7639a1)[_0x1b41('0x22')](function(_0x2f6c79){_0x24dca5[_0x1b41('0x1c')]=_0x2f6c79;if(_0x46c057['query'][_0x1b41('0x40')]){_0x1f75ce['include']=[{'all':!![]}];}return db[_0x1b41('0x29')]['findAll'](_0x1f75ce);})[_0x1b41('0x22')](function(_0x4af00c){_0x24dca5[_0x1b41('0x41')]=_0x4af00c;return _0x24dca5;})[_0x1b41('0x22')](respondWithFilteredResult(_0x281784,_0x1f75ce))['catch'](handleError(_0x281784,null));};exports[_0x1b41('0x42')]=function(_0x3e6bb3,_0x590890){var _0x920f91={'raw':!![],'where':{'id':_0x3e6bb3['params']['id']}},_0x376aa1={};_0x376aa1['model']=_[_0x1b41('0x2c')](db['Sound']['rawAttributes']);_0x376aa1[_0x1b41('0x2b')]=_[_0x1b41('0x2c')](_0x3e6bb3[_0x1b41('0x2b')]);_0x376aa1[_0x1b41('0x2d')]=_[_0x1b41('0x2e')](_0x376aa1[_0x1b41('0x2a')],_0x376aa1[_0x1b41('0x2b')]);_0x920f91[_0x1b41('0x2f')]=_[_0x1b41('0x2e')](_0x376aa1[_0x1b41('0x2a')],qs[_0x1b41('0x30')](_0x3e6bb3[_0x1b41('0x2b')][_0x1b41('0x30')]));_0x920f91['attributes']=_0x920f91[_0x1b41('0x2f')][_0x1b41('0x31')]?_0x920f91[_0x1b41('0x2f')]:_0x376aa1[_0x1b41('0x2a')];if(_0x3e6bb3[_0x1b41('0x2b')]['includeAll']){_0x920f91[_0x1b41('0x43')]=[{'all':!![]}];}_0x920f91=_[_0x1b41('0x39')]({},_0x920f91,_0x3e6bb3[_0x1b41('0x3f')]);return db[_0x1b41('0x29')][_0x1b41('0x44')](_0x920f91)[_0x1b41('0x22')](handleEntityNotFound(_0x590890,null))[_0x1b41('0x22')](respondWithResult(_0x590890,null))[_0x1b41('0x45')](handleError(_0x590890,null));};exports['download']=function(_0x3d0d72,_0xc665cc,_0x8c175f){return db['Sound'][_0x1b41('0x44')]({'where':{'id':_0x3d0d72['params']['id']},'attributes':[_0x1b41('0x27'),_0x1b41('0x46'),_0x1b41('0x47')],'raw':!![]})[_0x1b41('0x22')](handleEntityNotFound(_0xc665cc,null))[_0x1b41('0x22')](function(_0x9537f2){if(_0x9537f2){if(!fs[_0x1b41('0x48')](path[_0x1b41('0x49')](config[_0x1b41('0x4a')],'server/files/sounds/converted',_0x9537f2[_0x1b41('0x46')]+'.'+_0x9537f2[_0x1b41('0x47')]))){throw new db[(_0x1b41('0x4b'))][(_0x1b41('0x4c'))](_0x1b41('0x4d'));}return _0xc665cc['download'](path[_0x1b41('0x49')](config[_0x1b41('0x4a')],_0x1b41('0x4e'),util[_0x1b41('0x4f')]('%s.%s',_0x9537f2[_0x1b41('0x46')],_0x9537f2[_0x1b41('0x47')])),util['format'](_0x1b41('0x50'),_0x9537f2[_0x1b41('0x27')],_0x9537f2['converted_format']));}return null;})[_0x1b41('0x45')](handleError(_0xc665cc,null));};exports[_0x1b41('0x51')]=function(_0x10c0d0,_0xdc6a4c,_0x40608e){var _0x57b735={'name':path[_0x1b41('0x52')](_0x10c0d0['file'][_0x1b41('0x53')],path[_0x1b41('0x54')](_0x10c0d0['file'][_0x1b41('0x53')])),'save_name':path['basename'](_0x10c0d0[_0x1b41('0x55')]['filename'],path[_0x1b41('0x54')](_0x10c0d0[_0x1b41('0x55')][_0x1b41('0x56')])),'original_format':path[_0x1b41('0x54')](_0x10c0d0['file'][_0x1b41('0x53')])[_0x1b41('0x57')](0x1),'converted_format':_0x1b41('0x58')};var _0x5e8a3d=path[_0x1b41('0x49')](config[_0x1b41('0x4a')],_0x1b41('0x59'),_0x10c0d0[_0x1b41('0x55')][_0x1b41('0x56')]);var _0x5b44dc=path[_0x1b41('0x49')](config[_0x1b41('0x4a')],'server/files/sounds/converted',util['format'](_0x1b41('0x50'),path[_0x1b41('0x52')](_0x10c0d0[_0x1b41('0x55')][_0x1b41('0x56')],path[_0x1b41('0x54')](_0x10c0d0[_0x1b41('0x55')][_0x1b41('0x56')])),_0x57b735[_0x1b41('0x47')]));logger[_0x1b41('0x5a')]('Sound\x20upload\x20filepath:\x20%s',_0x5e8a3d);logger['info'](_0x1b41('0x5b'),_0x5b44dc);try{fs[_0x1b41('0x5c')](_0x5e8a3d,parseInt(_0x1b41('0x5d'),0x8));var _0x11214e=sox['transcode'](_0x5e8a3d,_0x5b44dc,{'sampleRate':0x1f40,'format':_0x1b41('0x58'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x11214e['on'](_0x1b41('0x25'),function(_0x504bf3){fs[_0x1b41('0x5e')](_0x5e8a3d);_0xdc6a4c[_0x1b41('0x19')](0x1f4)[_0x1b41('0x5f')](_0x504bf3);});_0x11214e['on']('src',function(_0x251bfd){_0x57b735[_0x1b41('0x60')]=isNaN(_0x251bfd['duration'])?null:_0x251bfd[_0x1b41('0x61')]*0x3e8;_0x57b735[_0x1b41('0x62')]=isNaN(_0x251bfd[_0x1b41('0x63')])?null:_0x251bfd['sampleCount'];_0x57b735[_0x1b41('0x64')]=isNaN(_0x251bfd[_0x1b41('0x65')])?null:_0x251bfd[_0x1b41('0x65')];_0x57b735[_0x1b41('0x66')]=isNaN(_0x251bfd[_0x1b41('0x67')])?null:_0x251bfd[_0x1b41('0x67')];_0x57b735[_0x1b41('0x68')]=isNaN(_0x251bfd[_0x1b41('0x69')])?null:_0x251bfd[_0x1b41('0x69')];});_0x11214e['on'](_0x1b41('0x6a'),function(_0xb50109){_0x57b735[_0x1b41('0x6b')]=isNaN(_0xb50109[_0x1b41('0x61')])?null:_0xb50109[_0x1b41('0x61')]*0x3e8;_0x57b735[_0x1b41('0x6c')]=isNaN(_0xb50109[_0x1b41('0x63')])?null:_0xb50109[_0x1b41('0x63')];_0x57b735[_0x1b41('0x6d')]=isNaN(_0xb50109[_0x1b41('0x65')])?null:_0xb50109['channelCount'];_0x57b735[_0x1b41('0x6e')]=isNaN(_0xb50109['bitRate'])?null:_0xb50109[_0x1b41('0x67')];_0x57b735[_0x1b41('0x6f')]=isNaN(_0xb50109[_0x1b41('0x69')])?null:_0xb50109['sampleRate'];});_0x11214e['on'](_0x1b41('0x1a'),function(){fs[_0x1b41('0x5c')](_0x5b44dc,parseInt(_0x1b41('0x5d'),0x8));return db[_0x1b41('0x29')][_0x1b41('0x51')](_0x57b735)[_0x1b41('0x22')](function(_0x562a4c){var _0x344162={'role':_0x10c0d0[_0x1b41('0x70')][_0x1b41('0x71')],'userProfileId':_0x10c0d0[_0x1b41('0x70')]['userProfileId']};if(!_0x344162)throw new Error(_0x1b41('0x72'));if(_0x344162[_0x1b41('0x71')]==='user'){var _0x8dc778=_0x562a4c[_0x1b41('0x73')]({'plain':!![]});return db['UserProfileSection']['find']({'where':{'name':_0x1b41('0x74'),'userProfileId':_0x344162[_0x1b41('0x75')]},'raw':!![]})[_0x1b41('0x22')](function(_0x4378d0){if(_0x4378d0&&_0x4378d0[_0x1b41('0x76')]===0x0){return db['UserProfileResource']['create']({'name':_0x8dc778[_0x1b41('0x27')],'resourceId':_0x8dc778['id'],'type':_0x4378d0[_0x1b41('0x27')],'sectionId':_0x4378d0['id']},{})[_0x1b41('0x22')](function(){return _0x562a4c;});}else{return _0x562a4c;}})[_0x1b41('0x45')](function(_0x3bf0fa){logger['error'](_0x1b41('0x77'),_0x3bf0fa);throw _0x3bf0fa;});}return _0x562a4c;})[_0x1b41('0x22')](respondWithResult(_0xdc6a4c,null))[_0x1b41('0x45')](handleError(_0xdc6a4c,null));});_0x11214e[_0x1b41('0x78')]();}catch(_0x44be22){_0xdc6a4c[_0x1b41('0x19')](0x1f4)['send'](_0x44be22);}};exports[_0x1b41('0x79')]=function(_0x4ecb5a,_0x406f7a,_0x58eeb6){return db[_0x1b41('0x29')]['find']({'where':{'id':_0x4ecb5a[_0x1b41('0x7a')]['id']}})[_0x1b41('0x22')](handleEntityNotFound(_0x406f7a,null))[_0x1b41('0x22')](saveUpdates(_[_0x1b41('0x37')](_0x4ecb5a[_0x1b41('0x70')],[_0x1b41('0x27'),_0x1b41('0x7b')]),null))[_0x1b41('0x22')](respondWithResult(_0x406f7a,null))[_0x1b41('0x45')](handleError(_0x406f7a,null));};exports['delete']=function(_0x4e61d5,_0xcf94d9,_0x53b9e2){return db[_0x1b41('0x29')][_0x1b41('0x44')]({'where':{'id':_0x4e61d5[_0x1b41('0x7a')]['id']}})['then'](function(_0x13ddb9){if(_0x13ddb9){return _0x13ddb9[_0x1b41('0x23')]();}})[_0x1b41('0x22')](function(_0x28a1fd){var _0x135b9e=path[_0x1b41('0x49')](config[_0x1b41('0x4a')],_0x1b41('0x59'),util[_0x1b41('0x4f')](_0x1b41('0x50'),_0x28a1fd[_0x1b41('0x46')],_0x28a1fd['original_format']));var _0x1690f1=path[_0x1b41('0x49')](config[_0x1b41('0x4a')],_0x1b41('0x4e'),util[_0x1b41('0x4f')](_0x1b41('0x50'),_0x28a1fd['save_name'],_0x28a1fd['converted_format']));fs[_0x1b41('0x5e')](_0x135b9e);fs['unlinkSync'](_0x1690f1);return _0x28a1fd;})[_0x1b41('0x22')](function(_0x22c0a2){if(_0x22c0a2){return _0xcf94d9[_0x1b41('0x19')](0xcc)[_0x1b41('0x1a')]();}})[_0x1b41('0x22')](handleEntityNotFound(_0xcf94d9,null))[_0x1b41('0x45')](handleError(_0xcf94d9,null));}; \ No newline at end of file +var _0x3b51=['extname','filename','substring','wav','server/files/sounds/original','info','Sound\x20upload\x20filepath:\x20%s','Sound\x20upload\x20destination:\x20%s','chmodSync','0777','unlinkSync','src','original_duration','duration','original_sampleCount','sampleCount','original_channelCount','channelCount','bitRate','original_sampleRate','sampleRate','dest','converted_bitRate','converted_sampleRate','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','description','delete','original_format','html-pdf','eml-format','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','reject','save','then','destroy','get','Sounds','UserProfileResource','error','name','send','index','Sound','rawAttributes','model','keys','query','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','filters','pick','merge','type','key','VIRTUAL','field','options','includeAll','include','findAll','rows','catch','show','params','find','download','save_name','existsSync','join','root','server/files/sounds/converted','converted_format','Sequelize','ValidationError','Sound\x20not\x20found','format','%s.%s','create','basename','file','originalname'];(function(_0x265447,_0x445ce4){var _0x4f1d24=function(_0x2b3005){while(--_0x2b3005){_0x265447['push'](_0x265447['shift']());}};_0x4f1d24(++_0x445ce4);}(_0x3b51,0x119));var _0x13b5=function(_0x1d90ef,_0x39ab6d){_0x1d90ef=_0x1d90ef-0x0;var _0x554777=_0x3b51[_0x1d90ef];return _0x554777;};'use strict';var pdf=require(_0x13b5('0x0'));var emlformat=require(_0x13b5('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x13b5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x13b5('0x3'));var moment=require(_0x13b5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x13b5('0x5'));var util=require(_0x13b5('0x6'));var path=require(_0x13b5('0x7'));var sox=require(_0x13b5('0x8'));var csv=require(_0x13b5('0x9'));var ejs=require(_0x13b5('0xa'));var fs=require('fs');var _=require(_0x13b5('0xb'));var squel=require(_0x13b5('0xc'));var crypto=require(_0x13b5('0xd'));var jsforce=require(_0x13b5('0xe'));var deskjs=require(_0x13b5('0xf'));var toCsv=require(_0x13b5('0x9'));var querystring=require(_0x13b5('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x13b5('0x11'));var qs=require(_0x13b5('0x12'));var as=require(_0x13b5('0x13'));var hardwareService=require(_0x13b5('0x14'));var logger=require(_0x13b5('0x15'))('api');var utils=require(_0x13b5('0x16'));var config=require('../../config/environment');var db=require(_0x13b5('0x17'))['db'];function respondWithStatusCode(_0x4f3d24,_0x2b0c2d){_0x2b0c2d=_0x2b0c2d||0xcc;return function(_0x72e7c2){if(_0x72e7c2){return _0x4f3d24[_0x13b5('0x18')](_0x2b0c2d);}return _0x4f3d24[_0x13b5('0x19')](_0x2b0c2d)[_0x13b5('0x1a')]();};}function respondWithResult(_0x3d6215,_0x2c99cf){_0x2c99cf=_0x2c99cf||0xc8;return function(_0xdd9dba){if(_0xdd9dba){return _0x3d6215[_0x13b5('0x19')](_0x2c99cf)[_0x13b5('0x1b')](_0xdd9dba);}};}function respondWithFilteredResult(_0x1ceb48,_0x5c8b27){return function(_0x58296f){if(_0x58296f){var _0x50c7ae=_0x58296f[_0x13b5('0x1c')],_0x8b1d09=_0x5c8b27['offset'],_0x291c18=_0x5c8b27[_0x13b5('0x1d')]+_0x5c8b27[_0x13b5('0x1e')],_0x502786;if(_0x291c18>=_0x50c7ae){_0x291c18=_0x50c7ae;_0x502786=0xc8;}else{_0x502786=0xce;}_0x1ceb48[_0x13b5('0x19')](_0x502786);return _0x1ceb48[_0x13b5('0x1f')]('Content-Range',_0x8b1d09+'-'+_0x291c18+'/'+_0x50c7ae)[_0x13b5('0x1b')](_0x58296f);}return null;};}function patchUpdates(_0x4726b7){return function(_0x1d3b19){try{jsonpatch['apply'](_0x1d3b19,_0x4726b7,!![]);}catch(_0x4dd373){return BPromise[_0x13b5('0x20')](_0x4dd373);}return _0x1d3b19[_0x13b5('0x21')]();};}function saveUpdates(_0x614f5c,_0x576be3){return function(_0x56055b){if(_0x56055b){return _0x56055b['update'](_0x614f5c)[_0x13b5('0x22')](function(_0x2ab3be){return _0x2ab3be;});}return null;};}function removeEntity(_0x1fd373,_0x78b26d){return function(_0x570c2d){if(_0x570c2d){return _0x570c2d[_0x13b5('0x23')]()[_0x13b5('0x22')](function(){var _0x43cf1e=_0x570c2d[_0x13b5('0x24')]({'plain':!![]});var _0x9bd14b=_0x13b5('0x25');return db[_0x13b5('0x26')][_0x13b5('0x23')]({'where':{'type':_0x9bd14b,'resourceId':_0x43cf1e['id']}})[_0x13b5('0x22')](function(){return _0x570c2d;});})[_0x13b5('0x22')](function(){_0x1fd373[_0x13b5('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x264a93,_0x55deaa){return function(_0x55f7d5){if(!_0x55f7d5){_0x264a93[_0x13b5('0x18')](0x194);}return _0x55f7d5;};}function handleError(_0x167429,_0x1f6c40){_0x1f6c40=_0x1f6c40||0x1f4;return function(_0x2c0056){logger[_0x13b5('0x27')](_0x2c0056['stack']);if(_0x2c0056[_0x13b5('0x28')]){delete _0x2c0056[_0x13b5('0x28')];}_0x167429[_0x13b5('0x19')](_0x1f6c40)[_0x13b5('0x29')](_0x2c0056);};}exports[_0x13b5('0x2a')]=function(_0x4aaf90,_0x20641a){var _0x261b4a={},_0x19f06c={},_0x19ecae={'count':0x0,'rows':[]};var _0x3c2529=db[_0x13b5('0x2b')][_0x13b5('0x2c')];_0x19f06c[_0x13b5('0x2d')]=_[_0x13b5('0x2e')](_0x3c2529);_0x19f06c[_0x13b5('0x2f')]=_[_0x13b5('0x2e')](_0x4aaf90[_0x13b5('0x2f')]);_0x19f06c['filters']=_['intersection'](_0x19f06c[_0x13b5('0x2d')],_0x19f06c[_0x13b5('0x2f')]);_0x261b4a['attributes']=_[_0x13b5('0x30')](_0x19f06c[_0x13b5('0x2d')],qs[_0x13b5('0x31')](_0x4aaf90['query'][_0x13b5('0x31')]));_0x261b4a['attributes']=_0x261b4a[_0x13b5('0x32')][_0x13b5('0x33')]?_0x261b4a[_0x13b5('0x32')]:_0x19f06c[_0x13b5('0x2d')];if(!_0x4aaf90['query'][_0x13b5('0x34')]('nolimit')){_0x261b4a[_0x13b5('0x1e')]=qs[_0x13b5('0x1e')](_0x4aaf90['query'][_0x13b5('0x1e')]);_0x261b4a[_0x13b5('0x1d')]=qs[_0x13b5('0x1d')](_0x4aaf90['query'][_0x13b5('0x1d')]);}_0x261b4a[_0x13b5('0x35')]=qs[_0x13b5('0x36')](_0x4aaf90['query'][_0x13b5('0x36')]);_0x261b4a[_0x13b5('0x37')]=qs[_0x13b5('0x38')](_[_0x13b5('0x39')](_0x4aaf90[_0x13b5('0x2f')],_0x19f06c[_0x13b5('0x38')]));if(_0x4aaf90[_0x13b5('0x2f')]['filter']){_0x261b4a[_0x13b5('0x37')]=_[_0x13b5('0x3a')](_0x261b4a[_0x13b5('0x37')],{'$or':_['map'](_0x3c2529,function(_0xdd653){if(_0xdd653[_0x13b5('0x3b')][_0x13b5('0x3c')]!==_0x13b5('0x3d')){var _0x3efcdb={};_0x3efcdb[_0xdd653[_0x13b5('0x3e')]]={'$like':'%'+_0x4aaf90[_0x13b5('0x2f')]['filter']+'%'};return _0x3efcdb;}})});}_0x261b4a=_['merge']({},_0x261b4a,_0x4aaf90[_0x13b5('0x3f')]);var _0x3f0101={'where':_0x261b4a[_0x13b5('0x37')]};return db[_0x13b5('0x2b')][_0x13b5('0x1c')](_0x3f0101)[_0x13b5('0x22')](function(_0x32b829){_0x19ecae[_0x13b5('0x1c')]=_0x32b829;if(_0x4aaf90[_0x13b5('0x2f')][_0x13b5('0x40')]){_0x261b4a[_0x13b5('0x41')]=[{'all':!![]}];}return db[_0x13b5('0x2b')][_0x13b5('0x42')](_0x261b4a);})['then'](function(_0x58c29f){_0x19ecae[_0x13b5('0x43')]=_0x58c29f;return _0x19ecae;})[_0x13b5('0x22')](respondWithFilteredResult(_0x20641a,_0x261b4a))[_0x13b5('0x44')](handleError(_0x20641a,null));};exports[_0x13b5('0x45')]=function(_0x547398,_0x43d3e0){var _0x34c546={'raw':!![],'where':{'id':_0x547398[_0x13b5('0x46')]['id']}},_0x18e309={};_0x18e309['model']=_[_0x13b5('0x2e')](db['Sound'][_0x13b5('0x2c')]);_0x18e309[_0x13b5('0x2f')]=_['keys'](_0x547398[_0x13b5('0x2f')]);_0x18e309[_0x13b5('0x38')]=_['intersection'](_0x18e309[_0x13b5('0x2d')],_0x18e309[_0x13b5('0x2f')]);_0x34c546[_0x13b5('0x32')]=_[_0x13b5('0x30')](_0x18e309[_0x13b5('0x2d')],qs[_0x13b5('0x31')](_0x547398[_0x13b5('0x2f')][_0x13b5('0x31')]));_0x34c546[_0x13b5('0x32')]=_0x34c546[_0x13b5('0x32')][_0x13b5('0x33')]?_0x34c546['attributes']:_0x18e309[_0x13b5('0x2d')];if(_0x547398[_0x13b5('0x2f')][_0x13b5('0x40')]){_0x34c546[_0x13b5('0x41')]=[{'all':!![]}];}_0x34c546=_[_0x13b5('0x3a')]({},_0x34c546,_0x547398[_0x13b5('0x3f')]);return db[_0x13b5('0x2b')][_0x13b5('0x47')](_0x34c546)['then'](handleEntityNotFound(_0x43d3e0,null))[_0x13b5('0x22')](respondWithResult(_0x43d3e0,null))[_0x13b5('0x44')](handleError(_0x43d3e0,null));};exports[_0x13b5('0x48')]=function(_0x4eee92,_0x2fc1c2,_0x80ec80){return db['Sound']['find']({'where':{'id':_0x4eee92[_0x13b5('0x46')]['id']},'attributes':[_0x13b5('0x28'),_0x13b5('0x49'),'converted_format'],'raw':!![]})['then'](handleEntityNotFound(_0x2fc1c2,null))[_0x13b5('0x22')](function(_0x2e46ef){if(_0x2e46ef){if(!fs[_0x13b5('0x4a')](path[_0x13b5('0x4b')](config[_0x13b5('0x4c')],_0x13b5('0x4d'),_0x2e46ef['save_name']+'.'+_0x2e46ef[_0x13b5('0x4e')]))){throw new db[(_0x13b5('0x4f'))][(_0x13b5('0x50'))](_0x13b5('0x51'));}return _0x2fc1c2['download'](path[_0x13b5('0x4b')](config['root'],_0x13b5('0x4d'),util[_0x13b5('0x52')](_0x13b5('0x53'),_0x2e46ef['save_name'],_0x2e46ef[_0x13b5('0x4e')])),util[_0x13b5('0x52')](_0x13b5('0x53'),_0x2e46ef[_0x13b5('0x28')],_0x2e46ef[_0x13b5('0x4e')]));}return null;})[_0x13b5('0x44')](handleError(_0x2fc1c2,null));};exports[_0x13b5('0x54')]=function(_0x56b790,_0xd03a79,_0x280f29){var _0x20204f={'name':path[_0x13b5('0x55')](_0x56b790[_0x13b5('0x56')][_0x13b5('0x57')],path[_0x13b5('0x58')](_0x56b790[_0x13b5('0x56')][_0x13b5('0x57')])),'save_name':path[_0x13b5('0x55')](_0x56b790['file'][_0x13b5('0x59')],path[_0x13b5('0x58')](_0x56b790[_0x13b5('0x56')][_0x13b5('0x59')])),'original_format':path['extname'](_0x56b790[_0x13b5('0x56')][_0x13b5('0x57')])[_0x13b5('0x5a')](0x1),'converted_format':_0x13b5('0x5b')};var _0xc73f86=path[_0x13b5('0x4b')](config[_0x13b5('0x4c')],_0x13b5('0x5c'),_0x56b790[_0x13b5('0x56')][_0x13b5('0x59')]);var _0x3c72ec=path[_0x13b5('0x4b')](config[_0x13b5('0x4c')],_0x13b5('0x4d'),util[_0x13b5('0x52')](_0x13b5('0x53'),path['basename'](_0x56b790[_0x13b5('0x56')]['filename'],path['extname'](_0x56b790['file']['filename'])),_0x20204f[_0x13b5('0x4e')]));logger[_0x13b5('0x5d')](_0x13b5('0x5e'),_0xc73f86);logger[_0x13b5('0x5d')](_0x13b5('0x5f'),_0x3c72ec);try{fs[_0x13b5('0x60')](_0xc73f86,parseInt(_0x13b5('0x61'),0x8));var _0x246f55=sox['transcode'](_0xc73f86,_0x3c72ec,{'sampleRate':0x1f40,'format':_0x13b5('0x5b'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x246f55['on']('error',function(_0xc42af2){fs[_0x13b5('0x62')](_0xc73f86);_0xd03a79['status'](0x1f4)['send'](_0xc42af2);});_0x246f55['on'](_0x13b5('0x63'),function(_0x2ab51d){_0x20204f[_0x13b5('0x64')]=isNaN(_0x2ab51d[_0x13b5('0x65')])?null:_0x2ab51d[_0x13b5('0x65')]*0x3e8;_0x20204f[_0x13b5('0x66')]=isNaN(_0x2ab51d[_0x13b5('0x67')])?null:_0x2ab51d[_0x13b5('0x67')];_0x20204f[_0x13b5('0x68')]=isNaN(_0x2ab51d[_0x13b5('0x69')])?null:_0x2ab51d[_0x13b5('0x69')];_0x20204f['original_bitRate']=isNaN(_0x2ab51d[_0x13b5('0x6a')])?null:_0x2ab51d[_0x13b5('0x6a')];_0x20204f[_0x13b5('0x6b')]=isNaN(_0x2ab51d['sampleRate'])?null:_0x2ab51d[_0x13b5('0x6c')];});_0x246f55['on'](_0x13b5('0x6d'),function(_0x3e85e9){_0x20204f['converted_duration']=isNaN(_0x3e85e9[_0x13b5('0x65')])?null:_0x3e85e9[_0x13b5('0x65')]*0x3e8;_0x20204f['converted_sampleCount']=isNaN(_0x3e85e9[_0x13b5('0x67')])?null:_0x3e85e9[_0x13b5('0x67')];_0x20204f['converted_channelCount']=isNaN(_0x3e85e9[_0x13b5('0x69')])?null:_0x3e85e9[_0x13b5('0x69')];_0x20204f[_0x13b5('0x6e')]=isNaN(_0x3e85e9[_0x13b5('0x6a')])?null:_0x3e85e9['bitRate'];_0x20204f[_0x13b5('0x6f')]=isNaN(_0x3e85e9[_0x13b5('0x6c')])?null:_0x3e85e9[_0x13b5('0x6c')];});_0x246f55['on'](_0x13b5('0x1a'),function(){fs[_0x13b5('0x60')](_0x3c72ec,parseInt(_0x13b5('0x61'),0x8));return db[_0x13b5('0x2b')]['create'](_0x20204f)[_0x13b5('0x22')](function(_0x471186){var _0x1560c5={'role':_0x56b790['body'][_0x13b5('0x70')],'userProfileId':_0x56b790['body'][_0x13b5('0x71')]};if(!_0x1560c5)throw new Error(_0x13b5('0x72'));if(_0x1560c5[_0x13b5('0x70')]===_0x13b5('0x73')){var _0x103e88=_0x471186[_0x13b5('0x24')]({'plain':!![]});return db[_0x13b5('0x74')][_0x13b5('0x47')]({'where':{'name':'Sounds','userProfileId':_0x1560c5['userProfileId']},'raw':!![]})['then'](function(_0x999792){if(_0x999792&&_0x999792[_0x13b5('0x75')]===0x0){return db['UserProfileResource'][_0x13b5('0x54')]({'name':_0x103e88['name'],'resourceId':_0x103e88['id'],'type':_0x999792[_0x13b5('0x28')],'sectionId':_0x999792['id']},{})[_0x13b5('0x22')](function(){return _0x471186;});}else{return _0x471186;}})['catch'](function(_0x245494){logger[_0x13b5('0x27')](_0x13b5('0x76'),_0x245494);throw _0x245494;});}return _0x471186;})[_0x13b5('0x22')](respondWithResult(_0xd03a79,null))['catch'](handleError(_0xd03a79,null));});_0x246f55['start']();}catch(_0x5f0f73){_0xd03a79[_0x13b5('0x19')](0x1f4)[_0x13b5('0x29')](_0x5f0f73);}};exports['update']=function(_0x16e067,_0x45c1f7,_0xb3a6bc){return db[_0x13b5('0x2b')][_0x13b5('0x47')]({'where':{'id':_0x16e067['params']['id']}})[_0x13b5('0x22')](handleEntityNotFound(_0x45c1f7,null))['then'](saveUpdates(_[_0x13b5('0x39')](_0x16e067[_0x13b5('0x77')],['name',_0x13b5('0x78')]),null))['then'](respondWithResult(_0x45c1f7,null))['catch'](handleError(_0x45c1f7,null));};exports[_0x13b5('0x79')]=function(_0x51a5f8,_0x17c75f,_0x41ce16){return db['Sound'][_0x13b5('0x47')]({'where':{'id':_0x51a5f8[_0x13b5('0x46')]['id']}})[_0x13b5('0x22')](function(_0x4fd52e){if(_0x4fd52e){return _0x4fd52e[_0x13b5('0x23')]();}})[_0x13b5('0x22')](function(_0x144f3e){var _0x593a4f=path[_0x13b5('0x4b')](config[_0x13b5('0x4c')],_0x13b5('0x5c'),util['format'](_0x13b5('0x53'),_0x144f3e[_0x13b5('0x49')],_0x144f3e[_0x13b5('0x7a')]));var _0x3afad6=path['join'](config[_0x13b5('0x4c')],'server/files/sounds/converted',util[_0x13b5('0x52')](_0x13b5('0x53'),_0x144f3e[_0x13b5('0x49')],_0x144f3e[_0x13b5('0x4e')]));fs[_0x13b5('0x62')](_0x593a4f);fs[_0x13b5('0x62')](_0x3afad6);return _0x144f3e;})[_0x13b5('0x22')](function(_0x504793){if(_0x504793){return _0x17c75f[_0x13b5('0x19')](0xcc)[_0x13b5('0x1a')]();}})['then'](handleEntityNotFound(_0x17c75f,null))['catch'](handleError(_0x17c75f,null));}; \ No newline at end of file diff --git a/server/api/sound/sound.model.js b/server/api/sound/sound.model.js index 6a150e0..4e97709 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 _0xd81f=['request-promise','path','rimraf','./sound.attributes','exports','define','tools_sounds','util','../../config/logger','moment','bluebird'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd81f,0x172));var _0xfd81=function(_0x1ccdf7,_0x215d5a){_0x1ccdf7=_0x1ccdf7-0x0;var _0x52a0ae=_0xd81f[_0x1ccdf7];return _0x52a0ae;};'use strict';var _=require('lodash');var util=require(_0xfd81('0x0'));var logger=require(_0xfd81('0x1'))('api');var moment=require(_0xfd81('0x2'));var BPromise=require(_0xfd81('0x3'));var rp=require(_0xfd81('0x4'));var fs=require('fs');var path=require(_0xfd81('0x5'));var rimraf=require(_0xfd81('0x6'));var config=require('../../config/environment');var attributes=require(_0xfd81('0x7'));module[_0xfd81('0x8')]=function(_0x224d63,_0x499b66){return _0x224d63[_0xfd81('0x9')]('Sound',attributes,{'tableName':_0xfd81('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x508f=['Sound','tools_sounds','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./sound.attributes','exports','define'];(function(_0x122cc1,_0x5c956e){var _0x1e33af=function(_0x949b75){while(--_0x949b75){_0x122cc1['push'](_0x122cc1['shift']());}};_0x1e33af(++_0x5c956e);}(_0x508f,0x160));var _0xf508=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x508f[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xf508('0x0'));var util=require(_0xf508('0x1'));var logger=require(_0xf508('0x2'))(_0xf508('0x3'));var moment=require('moment');var BPromise=require(_0xf508('0x4'));var rp=require(_0xf508('0x5'));var fs=require('fs');var path=require(_0xf508('0x6'));var rimraf=require(_0xf508('0x7'));var config=require(_0xf508('0x8'));var attributes=require(_0xf508('0x9'));module[_0xf508('0xa')]=function(_0x512a3a,_0x2ec6c4){return _0x512a3a[_0xf508('0xb')](_0xf508('0xc'),attributes,{'tableName':_0xf508('0xd'),'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 892e361..b08e8de 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 _0xc3f7=['../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','request\x20sent','debug','Sound,\x20%s,\x20%s,\x20%s','error','code','Sound,\x20%s,\x20%s','message','result','catch','ShowSound','Sound','options','raw','attributes','include','map','model','info','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc3f7,0xfa));var _0x7c3f=function(_0x392f82,_0x4dc713){_0x392f82=_0x392f82-0x0;var _0x3ad0b8=_0xc3f7[_0x392f82];return _0x3ad0b8;};'use strict';var _=require(_0x7c3f('0x0'));var util=require(_0x7c3f('0x1'));var moment=require(_0x7c3f('0x2'));var BPromise=require(_0x7c3f('0x3'));var rs=require(_0x7c3f('0x4'));var fs=require('fs');var Redis=require(_0x7c3f('0x5'));var db=require(_0x7c3f('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x7c3f('0x7'))(_0x7c3f('0x8'));var config=require(_0x7c3f('0x9'));var jayson=require(_0x7c3f('0xa'));var client=jayson[_0x7c3f('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x31ee52,_0x41775b,_0x400ab3){return new BPromise(function(_0x31dc28,_0x3aff00){return client[_0x7c3f('0xc')](_0x31ee52,_0x400ab3)[_0x7c3f('0xd')](function(_0x4ee2e2){logger['info']('Sound,\x20%s,\x20%s',_0x41775b,_0x7c3f('0xe'));logger[_0x7c3f('0xf')](_0x7c3f('0x10'),_0x41775b,_0x7c3f('0xe'),JSON['stringify'](_0x4ee2e2));if(_0x4ee2e2[_0x7c3f('0x11')]){if(_0x4ee2e2[_0x7c3f('0x11')][_0x7c3f('0x12')]===0x1f4){logger['error'](_0x7c3f('0x13'),_0x41775b,_0x4ee2e2['error'][_0x7c3f('0x14')]);return _0x3aff00(_0x4ee2e2[_0x7c3f('0x11')][_0x7c3f('0x14')]);}logger[_0x7c3f('0x11')](_0x7c3f('0x13'),_0x41775b,_0x4ee2e2[_0x7c3f('0x11')][_0x7c3f('0x14')]);return _0x31dc28(_0x4ee2e2[_0x7c3f('0x11')][_0x7c3f('0x14')]);}else{logger['info'](_0x7c3f('0x13'),_0x41775b,_0x7c3f('0xe'));_0x31dc28(_0x4ee2e2[_0x7c3f('0x15')]['message']);}})[_0x7c3f('0x16')](function(_0x468d6b){logger[_0x7c3f('0x11')]('Sound,\x20%s,\x20%s',_0x41775b,_0x468d6b);_0x3aff00(_0x468d6b);});});}exports[_0x7c3f('0x17')]=function(_0x3e6aad){var _0x5738d8=this;return new Promise(function(_0x1ba321,_0x47ec0d){return db[_0x7c3f('0x18')]['find']({'raw':_0x3e6aad[_0x7c3f('0x19')]?_0x3e6aad[_0x7c3f('0x19')][_0x7c3f('0x1a')]===undefined?!![]:![]:!![],'where':_0x3e6aad[_0x7c3f('0x19')]?_0x3e6aad['options']['where']||null:null,'attributes':_0x3e6aad[_0x7c3f('0x19')]?_0x3e6aad[_0x7c3f('0x19')][_0x7c3f('0x1b')]||null:null,'include':_0x3e6aad['options']?_0x3e6aad[_0x7c3f('0x19')][_0x7c3f('0x1c')]?_[_0x7c3f('0x1d')](_0x3e6aad['options'][_0x7c3f('0x1c')],function(_0x842224){return{'model':db[_0x842224['model']],'as':_0x842224['as'],'attributes':_0x842224[_0x7c3f('0x1b')],'include':_0x842224[_0x7c3f('0x1c')]?_[_0x7c3f('0x1d')](_0x842224[_0x7c3f('0x1c')],function(_0x38b258){return{'model':db[_0x38b258[_0x7c3f('0x1e')]],'as':_0x38b258['as'],'attributes':_0x38b258[_0x7c3f('0x1b')],'include':_0x38b258['include']?_['map'](_0x38b258[_0x7c3f('0x1c')],function(_0x39b2ea){return{'model':db[_0x39b2ea[_0x7c3f('0x1e')]],'as':_0x39b2ea['as'],'attributes':_0x39b2ea[_0x7c3f('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x597473){logger[_0x7c3f('0x1f')](_0x7c3f('0x17'),_0x3e6aad);logger['debug'](_0x7c3f('0x17'),_0x3e6aad,JSON['stringify'](_0x597473));_0x1ba321(_0x597473);})[_0x7c3f('0x16')](function(_0x4028f5){logger['error']('ShowSound',_0x4028f5[_0x7c3f('0x14')],_0x3e6aad);_0x47ec0d(_0x5738d8[_0x7c3f('0x11')](0x1f4,_0x4028f5[_0x7c3f('0x14')]));});});}; \ No newline at end of file +var _0x6a95=['Sound,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','ShowSound','Sound','find','options','raw','where','map','attributes','include','model','debug','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','Sound,\x20%s,\x20%s','request\x20sent'];(function(_0x49b076,_0x4fb74e){var _0xa3609=function(_0x474e71){while(--_0x474e71){_0x49b076['push'](_0x49b076['shift']());}};_0xa3609(++_0x4fb74e);}(_0x6a95,0x95));var _0x56a9=function(_0x28d18d,_0x55896b){_0x28d18d=_0x28d18d-0x0;var _0x470640=_0x6a95[_0x28d18d];return _0x470640;};'use strict';var _=require(_0x56a9('0x0'));var util=require(_0x56a9('0x1'));var moment=require('moment');var BPromise=require(_0x56a9('0x2'));var rs=require(_0x56a9('0x3'));var fs=require('fs');var Redis=require(_0x56a9('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x56a9('0x5'));var logger=require(_0x56a9('0x6'))(_0x56a9('0x7'));var config=require(_0x56a9('0x8'));var jayson=require(_0x56a9('0x9'));var client=jayson[_0x56a9('0xa')][_0x56a9('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5b06f4,_0x5f5850,_0x2f4d11){return new BPromise(function(_0x49781e,_0x4e7a61){return client['request'](_0x5b06f4,_0x2f4d11)[_0x56a9('0xc')](function(_0x419281){logger[_0x56a9('0xd')](_0x56a9('0xe'),_0x5f5850,_0x56a9('0xf'));logger['debug'](_0x56a9('0x10'),_0x5f5850,_0x56a9('0xf'),JSON[_0x56a9('0x11')](_0x419281));if(_0x419281[_0x56a9('0x12')]){if(_0x419281[_0x56a9('0x12')][_0x56a9('0x13')]===0x1f4){logger[_0x56a9('0x12')](_0x56a9('0xe'),_0x5f5850,_0x419281[_0x56a9('0x12')]['message']);return _0x4e7a61(_0x419281['error'][_0x56a9('0x14')]);}logger['error']('Sound,\x20%s,\x20%s',_0x5f5850,_0x419281[_0x56a9('0x12')][_0x56a9('0x14')]);return _0x49781e(_0x419281[_0x56a9('0x12')][_0x56a9('0x14')]);}else{logger[_0x56a9('0xd')](_0x56a9('0xe'),_0x5f5850,_0x56a9('0xf'));_0x49781e(_0x419281['result']['message']);}})[_0x56a9('0x15')](function(_0x34b1bd){logger[_0x56a9('0x12')]('Sound,\x20%s,\x20%s',_0x5f5850,_0x34b1bd);_0x4e7a61(_0x34b1bd);});});}exports[_0x56a9('0x16')]=function(_0x92384c){var _0x4b31ef=this;return new Promise(function(_0x445636,_0x378853){return db[_0x56a9('0x17')][_0x56a9('0x18')]({'raw':_0x92384c[_0x56a9('0x19')]?_0x92384c[_0x56a9('0x19')][_0x56a9('0x1a')]===undefined?!![]:![]:!![],'where':_0x92384c['options']?_0x92384c[_0x56a9('0x19')][_0x56a9('0x1b')]||null:null,'attributes':_0x92384c[_0x56a9('0x19')]?_0x92384c['options']['attributes']||null:null,'include':_0x92384c[_0x56a9('0x19')]?_0x92384c[_0x56a9('0x19')]['include']?_[_0x56a9('0x1c')](_0x92384c['options']['include'],function(_0x32839e){return{'model':db[_0x32839e['model']],'as':_0x32839e['as'],'attributes':_0x32839e[_0x56a9('0x1d')],'include':_0x32839e['include']?_['map'](_0x32839e[_0x56a9('0x1e')],function(_0x3df546){return{'model':db[_0x3df546[_0x56a9('0x1f')]],'as':_0x3df546['as'],'attributes':_0x3df546[_0x56a9('0x1d')],'include':_0x3df546[_0x56a9('0x1e')]?_['map'](_0x3df546[_0x56a9('0x1e')],function(_0x4f26a3){return{'model':db[_0x4f26a3[_0x56a9('0x1f')]],'as':_0x4f26a3['as'],'attributes':_0x4f26a3[_0x56a9('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x56a9('0xc')](function(_0x20f8c0){logger[_0x56a9('0xd')](_0x56a9('0x16'),_0x92384c);logger[_0x56a9('0x20')](_0x56a9('0x16'),_0x92384c,JSON[_0x56a9('0x11')](_0x20f8c0));_0x445636(_0x20f8c0);})['catch'](function(_0x442b97){logger[_0x56a9('0x12')](_0x56a9('0x16'),_0x442b97[_0x56a9('0x14')],_0x92384c);_0x378853(_0x4b31ef[_0x56a9('0x12')](0x1f4,_0x442b97[_0x56a9('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/squareMessage/index.js b/server/api/squareMessage/index.js index 144eabf..293101c 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 _0x0fdd=['index','get','/:id','create','put','delete','destroy','exports','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareMessage.controller','isAuthenticated'];(function(_0x4629ed,_0x59ef85){var _0x52ca04=function(_0x59dc63){while(--_0x59dc63){_0x4629ed['push'](_0x4629ed['shift']());}};_0x52ca04(++_0x59ef85);}(_0x0fdd,0x143));var _0xd0fd=function(_0x50e110,_0x3a0ee2){_0x50e110=_0x50e110-0x0;var _0x4e0ea9=_0x0fdd[_0x50e110];return _0x4e0ea9;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xd0fd('0x0'));var express=require('express');var router=express[_0xd0fd('0x1')]();var auth=require(_0xd0fd('0x2'));var interaction=require(_0xd0fd('0x3'));var config=require(_0xd0fd('0x4'));var controller=require(_0xd0fd('0x5'));router['get']('/',auth[_0xd0fd('0x6')](),controller[_0xd0fd('0x7')]);router[_0xd0fd('0x8')](_0xd0fd('0x9'),auth[_0xd0fd('0x6')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0xd0fd('0xa')]);router[_0xd0fd('0xb')]('/:id',auth[_0xd0fd('0x6')](),controller['update']);router[_0xd0fd('0xc')](_0xd0fd('0x9'),auth[_0xd0fd('0x6')](),controller[_0xd0fd('0xd')]);module[_0xd0fd('0xe')]=router; \ No newline at end of file +var _0x5e02=['post','create','put','update','destroy','exports','util','path','connect-timeout','express','Router','../../config/environment','./squareMessage.controller','get','isAuthenticated','index','/:id'];(function(_0x390c46,_0x5873a0){var _0x2db77e=function(_0x58d0a){while(--_0x58d0a){_0x390c46['push'](_0x390c46['shift']());}};_0x2db77e(++_0x5873a0);}(_0x5e02,0x8e));var _0x25e0=function(_0x462e4d,_0x7ce6f7){_0x462e4d=_0x462e4d-0x0;var _0x49a7e5=_0x5e02[_0x462e4d];return _0x49a7e5;};'use strict';var multer=require('multer');var util=require(_0x25e0('0x0'));var path=require(_0x25e0('0x1'));var timeout=require(_0x25e0('0x2'));var express=require(_0x25e0('0x3'));var router=express[_0x25e0('0x4')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x25e0('0x5'));var controller=require(_0x25e0('0x6'));router[_0x25e0('0x7')]('/',auth[_0x25e0('0x8')](),controller[_0x25e0('0x9')]);router[_0x25e0('0x7')](_0x25e0('0xa'),auth[_0x25e0('0x8')](),controller['show']);router[_0x25e0('0xb')]('/',auth['isAuthenticated'](),controller[_0x25e0('0xc')]);router[_0x25e0('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x25e0('0xe')]);router['delete'](_0x25e0('0xa'),auth[_0x25e0('0x8')](),controller[_0x25e0('0xf')]);module[_0x25e0('0x10')]=router; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.attributes.js b/server/api/squareMessage/squareMessage.attributes.js index ce18b20..4a37883 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 _0xbe29=['ENUM','out','sequelize','exports','STRING','TEXT','medium'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0xbe29,0x17c));var _0x9be2=function(_0x4e198a,_0x5a6bad){_0x4e198a=_0x4e198a-0x0;var _0xb84bfe=_0xbe29[_0x4e198a];return _0xb84bfe;};'use strict';var Sequelize=require(_0x9be2('0x0'));module[_0x9be2('0x1')]={'uniqueid':{'type':Sequelize[_0x9be2('0x2')]},'body':{'type':Sequelize[_0x9be2('0x3')](_0x9be2('0x4')),'allowNull':![]},'direction':{'type':Sequelize[_0x9be2('0x5')]('in',_0x9be2('0x6')),'defaultValue':'out','allowNull':![]}}; \ No newline at end of file +var _0xbc76=['out','exports','STRING','TEXT','medium','ENUM'];(function(_0x1049e7,_0x2c8a7f){var _0x453340=function(_0x1e5a41){while(--_0x1e5a41){_0x1049e7['push'](_0x1049e7['shift']());}};_0x453340(++_0x2c8a7f);}(_0xbc76,0xf1));var _0x6bc7=function(_0xa63010,_0x20d96f){_0xa63010=_0xa63010-0x0;var _0x135d86=_0xbc76[_0xa63010];return _0x135d86;};'use strict';var Sequelize=require('sequelize');module[_0x6bc7('0x0')]={'uniqueid':{'type':Sequelize[_0x6bc7('0x1')]},'body':{'type':Sequelize[_0x6bc7('0x2')](_0x6bc7('0x3')),'allowNull':![]},'direction':{'type':Sequelize[_0x6bc7('0x4')]('in',_0x6bc7('0x5')),'defaultValue':'out','allowNull':![]}}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.controller.js b/server/api/squareMessage/squareMessage.controller.js index db46f1c..6c91fdd 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 _0x8fc6=['zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','squel','crypto','jsforce','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','reject','save','update','then','destroy','error','stack','name','send','index','SquareMessage','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','type','key','VIRTUAL','options','count','includeAll','include','rows','show','params','rawAttributes','length','find','create','body','catch','html-pdf','eml-format','rimraf'];(function(_0x5ad771,_0x34186f){var _0x5b5dce=function(_0x5ad0fb){while(--_0x5ad0fb){_0x5ad771['push'](_0x5ad771['shift']());}};_0x5b5dce(++_0x34186f);}(_0x8fc6,0x121));var _0x68fc=function(_0x10371c,_0x4b83a2){_0x10371c=_0x10371c-0x0;var _0x57e601=_0x8fc6[_0x10371c];return _0x57e601;};'use strict';var pdf=require(_0x68fc('0x0'));var emlformat=require(_0x68fc('0x1'));var rimraf=require(_0x68fc('0x2'));var zipdir=require(_0x68fc('0x3'));var jsonpatch=require(_0x68fc('0x4'));var rp=require(_0x68fc('0x5'));var moment=require(_0x68fc('0x6'));var BPromise=require(_0x68fc('0x7'));var Mustache=require(_0x68fc('0x8'));var util=require(_0x68fc('0x9'));var path=require(_0x68fc('0xa'));var sox=require(_0x68fc('0xb'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x68fc('0xc'));var crypto=require(_0x68fc('0xd'));var jsforce=require(_0x68fc('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x68fc('0xf'));var Papa=require('papaparse');var Redis=require(_0x68fc('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x68fc('0x11'));var as=require(_0x68fc('0x12'));var hardwareService=require(_0x68fc('0x13'));var logger=require(_0x68fc('0x14'))('api');var utils=require(_0x68fc('0x15'));var config=require(_0x68fc('0x16'));var db=require(_0x68fc('0x17'))['db'];function respondWithStatusCode(_0x5617c3,_0x4778be){_0x4778be=_0x4778be||0xcc;return function(_0x185428){if(_0x185428){return _0x5617c3[_0x68fc('0x18')](_0x4778be);}return _0x5617c3[_0x68fc('0x19')](_0x4778be)[_0x68fc('0x1a')]();};}function respondWithResult(_0xb51f2d,_0x2faecd){_0x2faecd=_0x2faecd||0xc8;return function(_0x2e4a4c){if(_0x2e4a4c){return _0xb51f2d[_0x68fc('0x19')](_0x2faecd)[_0x68fc('0x1b')](_0x2e4a4c);}};}function respondWithFilteredResult(_0x3af3db,_0x2be724){return function(_0x50dd99){if(_0x50dd99){var _0xfefea8=_0x50dd99['count'],_0x54e2b8=_0x2be724[_0x68fc('0x1c')],_0x103eb7=_0x2be724[_0x68fc('0x1c')]+_0x2be724[_0x68fc('0x1d')],_0x338d10;if(_0x103eb7>=_0xfefea8){_0x103eb7=_0xfefea8;_0x338d10=0xc8;}else{_0x338d10=0xce;}_0x3af3db['status'](_0x338d10);return _0x3af3db['set']('Content-Range',_0x54e2b8+'-'+_0x103eb7+'/'+_0xfefea8)[_0x68fc('0x1b')](_0x50dd99);}return null;};}function patchUpdates(_0x554c6c){return function(_0x20fc14){try{jsonpatch['apply'](_0x20fc14,_0x554c6c,!![]);}catch(_0x1edc6f){return BPromise[_0x68fc('0x1e')](_0x1edc6f);}return _0x20fc14[_0x68fc('0x1f')]();};}function saveUpdates(_0x39b1df,_0x5bc19b){return function(_0x287358){if(_0x287358){return _0x287358[_0x68fc('0x20')](_0x39b1df)[_0x68fc('0x21')](function(_0x48bc4f){return _0x48bc4f;});}return null;};}function removeEntity(_0x1ff4f9,_0xc91f43){return function(_0x52aff3){if(_0x52aff3){return _0x52aff3[_0x68fc('0x22')]()[_0x68fc('0x21')](function(){_0x1ff4f9[_0x68fc('0x19')](0xcc)[_0x68fc('0x1a')]();});}};}function handleEntityNotFound(_0x516a5e,_0x53d3f1){return function(_0x25a802){if(!_0x25a802){_0x516a5e['sendStatus'](0x194);}return _0x25a802;};}function handleError(_0x2f8f4e,_0x4e0894){_0x4e0894=_0x4e0894||0x1f4;return function(_0xc92028){logger[_0x68fc('0x23')](_0xc92028[_0x68fc('0x24')]);if(_0xc92028[_0x68fc('0x25')]){delete _0xc92028[_0x68fc('0x25')];}_0x2f8f4e[_0x68fc('0x19')](_0x4e0894)[_0x68fc('0x26')](_0xc92028);};}exports[_0x68fc('0x27')]=function(_0x42695a,_0x33ca49){var _0x2ac89b={},_0x48a041={},_0x3d81d4={'count':0x0,'rows':[]};var _0x40bad7=db[_0x68fc('0x28')]['rawAttributes'];_0x48a041[_0x68fc('0x29')]=_[_0x68fc('0x2a')](_0x40bad7);_0x48a041[_0x68fc('0x2b')]=_[_0x68fc('0x2a')](_0x42695a[_0x68fc('0x2b')]);_0x48a041[_0x68fc('0x2c')]=_[_0x68fc('0x2d')](_0x48a041['model'],_0x48a041[_0x68fc('0x2b')]);_0x2ac89b[_0x68fc('0x2e')]=_['intersection'](_0x48a041['model'],qs['fields'](_0x42695a[_0x68fc('0x2b')][_0x68fc('0x2f')]));_0x2ac89b[_0x68fc('0x2e')]=_0x2ac89b['attributes']['length']?_0x2ac89b[_0x68fc('0x2e')]:_0x48a041[_0x68fc('0x29')];if(!_0x42695a['query'][_0x68fc('0x30')](_0x68fc('0x31'))){_0x2ac89b[_0x68fc('0x1d')]=qs['limit'](_0x42695a[_0x68fc('0x2b')]['limit']);_0x2ac89b[_0x68fc('0x1c')]=qs[_0x68fc('0x1c')](_0x42695a[_0x68fc('0x2b')][_0x68fc('0x1c')]);}_0x2ac89b[_0x68fc('0x32')]=qs[_0x68fc('0x33')](_0x42695a[_0x68fc('0x2b')]['sort']);_0x2ac89b[_0x68fc('0x34')]=qs['filters'](_[_0x68fc('0x35')](_0x42695a[_0x68fc('0x2b')],_0x48a041['filters']));if(_0x42695a[_0x68fc('0x2b')][_0x68fc('0x36')]){_0x2ac89b['where']=_[_0x68fc('0x37')](_0x2ac89b['where'],{'$or':_[_0x68fc('0x38')](_0x40bad7,function(_0x4bde34){if(_0x4bde34[_0x68fc('0x39')][_0x68fc('0x3a')]!==_0x68fc('0x3b')){var _0x56df10={};_0x56df10[_0x4bde34['field']]={'$like':'%'+_0x42695a[_0x68fc('0x2b')][_0x68fc('0x36')]+'%'};return _0x56df10;}})});}_0x2ac89b=_[_0x68fc('0x37')]({},_0x2ac89b,_0x42695a[_0x68fc('0x3c')]);var _0x16c9f7={'where':_0x2ac89b[_0x68fc('0x34')]};return db[_0x68fc('0x28')][_0x68fc('0x3d')](_0x16c9f7)[_0x68fc('0x21')](function(_0x435812){_0x3d81d4[_0x68fc('0x3d')]=_0x435812;if(_0x42695a[_0x68fc('0x2b')][_0x68fc('0x3e')]){_0x2ac89b[_0x68fc('0x3f')]=[{'all':!![]}];}return db[_0x68fc('0x28')]['findAll'](_0x2ac89b);})['then'](function(_0x225a86){_0x3d81d4[_0x68fc('0x40')]=_0x225a86;return _0x3d81d4;})[_0x68fc('0x21')](respondWithFilteredResult(_0x33ca49,_0x2ac89b))['catch'](handleError(_0x33ca49,null));};exports[_0x68fc('0x41')]=function(_0x3b4de9,_0x298712){var _0x1cd343={'raw':!![],'where':{'id':_0x3b4de9[_0x68fc('0x42')]['id']}},_0x16a7db={};_0x16a7db[_0x68fc('0x29')]=_[_0x68fc('0x2a')](db[_0x68fc('0x28')][_0x68fc('0x43')]);_0x16a7db[_0x68fc('0x2b')]=_[_0x68fc('0x2a')](_0x3b4de9[_0x68fc('0x2b')]);_0x16a7db[_0x68fc('0x2c')]=_[_0x68fc('0x2d')](_0x16a7db[_0x68fc('0x29')],_0x16a7db[_0x68fc('0x2b')]);_0x1cd343[_0x68fc('0x2e')]=_[_0x68fc('0x2d')](_0x16a7db[_0x68fc('0x29')],qs[_0x68fc('0x2f')](_0x3b4de9['query'][_0x68fc('0x2f')]));_0x1cd343[_0x68fc('0x2e')]=_0x1cd343[_0x68fc('0x2e')][_0x68fc('0x44')]?_0x1cd343[_0x68fc('0x2e')]:_0x16a7db['model'];if(_0x3b4de9[_0x68fc('0x2b')]['includeAll']){_0x1cd343['include']=[{'all':!![]}];}_0x1cd343=_['merge']({},_0x1cd343,_0x3b4de9[_0x68fc('0x3c')]);return db[_0x68fc('0x28')][_0x68fc('0x45')](_0x1cd343)[_0x68fc('0x21')](handleEntityNotFound(_0x298712,null))[_0x68fc('0x21')](respondWithResult(_0x298712,null))['catch'](handleError(_0x298712,null));};exports[_0x68fc('0x46')]=function(_0x4d8e75,_0x1bddce){return db['SquareMessage'][_0x68fc('0x46')](_0x4d8e75[_0x68fc('0x47')],{})[_0x68fc('0x21')](respondWithResult(_0x1bddce,0xc9))[_0x68fc('0x48')](handleError(_0x1bddce,null));};exports[_0x68fc('0x20')]=function(_0x52f6db,_0x498474){if(_0x52f6db[_0x68fc('0x47')]['id']){delete _0x52f6db[_0x68fc('0x47')]['id'];}return db[_0x68fc('0x28')][_0x68fc('0x45')]({'where':{'id':_0x52f6db[_0x68fc('0x42')]['id']}})[_0x68fc('0x21')](handleEntityNotFound(_0x498474,null))[_0x68fc('0x21')](saveUpdates(_0x52f6db[_0x68fc('0x47')],null))[_0x68fc('0x21')](respondWithResult(_0x498474,null))[_0x68fc('0x48')](handleError(_0x498474,null));};exports[_0x68fc('0x22')]=function(_0x4cdb46,_0x4a3c01){return db['SquareMessage']['find']({'where':{'id':_0x4cdb46[_0x68fc('0x42')]['id']}})[_0x68fc('0x21')](handleEntityNotFound(_0x4a3c01,null))['then'](removeEntity(_0x4a3c01,null))['catch'](handleError(_0x4a3c01,null));}; \ No newline at end of file +var _0xf38c=['../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','json','count','offset','status','set','reject','save','update','then','destroy','error','name','send','SquareMessage','model','keys','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','limit','order','sort','pick','filter','merge','where','map','type','key','VIRTUAL','field','options','includeAll','include','rows','catch','show','length','find','create','body','params','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','lodash','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x2479db,_0x1f1c61){var _0x1666ec=function(_0x1adf7e){while(--_0x1adf7e){_0x2479db['push'](_0x2479db['shift']());}};_0x1666ec(++_0x1f1c61);}(_0xf38c,0x1e5));var _0xcf38=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xf38c[_0xa464c9];return _0x3d73c4;};'use strict';var pdf=require(_0xcf38('0x0'));var emlformat=require(_0xcf38('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xcf38('0x2'));var jsonpatch=require(_0xcf38('0x3'));var rp=require(_0xcf38('0x4'));var moment=require(_0xcf38('0x5'));var BPromise=require(_0xcf38('0x6'));var Mustache=require(_0xcf38('0x7'));var util=require(_0xcf38('0x8'));var path=require('path');var sox=require(_0xcf38('0x9'));var csv=require(_0xcf38('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xcf38('0xb'));var squel=require('squel');var crypto=require(_0xcf38('0xc'));var jsforce=require(_0xcf38('0xd'));var deskjs=require(_0xcf38('0xe'));var toCsv=require(_0xcf38('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xcf38('0xf'));var authService=require(_0xcf38('0x10'));var qs=require(_0xcf38('0x11'));var as=require(_0xcf38('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xcf38('0x13'))(_0xcf38('0x14'));var utils=require(_0xcf38('0x15'));var config=require(_0xcf38('0x16'));var db=require(_0xcf38('0x17'))['db'];function respondWithStatusCode(_0x235ab8,_0x38f36d){_0x38f36d=_0x38f36d||0xcc;return function(_0xb341a4){if(_0xb341a4){return _0x235ab8[_0xcf38('0x18')](_0x38f36d);}return _0x235ab8['status'](_0x38f36d)[_0xcf38('0x19')]();};}function respondWithResult(_0x17ebac,_0x214158){_0x214158=_0x214158||0xc8;return function(_0x281664){if(_0x281664){return _0x17ebac['status'](_0x214158)[_0xcf38('0x1a')](_0x281664);}};}function respondWithFilteredResult(_0x55edd4,_0x3719bb){return function(_0x23f7ed){if(_0x23f7ed){var _0x106d70=_0x23f7ed[_0xcf38('0x1b')],_0x71ff5a=_0x3719bb[_0xcf38('0x1c')],_0x13532b=_0x3719bb[_0xcf38('0x1c')]+_0x3719bb['limit'],_0x1125ac;if(_0x13532b>=_0x106d70){_0x13532b=_0x106d70;_0x1125ac=0xc8;}else{_0x1125ac=0xce;}_0x55edd4[_0xcf38('0x1d')](_0x1125ac);return _0x55edd4[_0xcf38('0x1e')]('Content-Range',_0x71ff5a+'-'+_0x13532b+'/'+_0x106d70)[_0xcf38('0x1a')](_0x23f7ed);}return null;};}function patchUpdates(_0x5f008c){return function(_0x3ed007){try{jsonpatch['apply'](_0x3ed007,_0x5f008c,!![]);}catch(_0x7190d7){return BPromise[_0xcf38('0x1f')](_0x7190d7);}return _0x3ed007[_0xcf38('0x20')]();};}function saveUpdates(_0x3b295d,_0x5009df){return function(_0x1fb715){if(_0x1fb715){return _0x1fb715[_0xcf38('0x21')](_0x3b295d)[_0xcf38('0x22')](function(_0x34af7c){return _0x34af7c;});}return null;};}function removeEntity(_0x28653b,_0x308fbd){return function(_0x141ccc){if(_0x141ccc){return _0x141ccc[_0xcf38('0x23')]()[_0xcf38('0x22')](function(){_0x28653b[_0xcf38('0x1d')](0xcc)[_0xcf38('0x19')]();});}};}function handleEntityNotFound(_0x4bf580,_0x2c99c5){return function(_0x1d1c6e){if(!_0x1d1c6e){_0x4bf580[_0xcf38('0x18')](0x194);}return _0x1d1c6e;};}function handleError(_0x397ef3,_0x3d3d10){_0x3d3d10=_0x3d3d10||0x1f4;return function(_0x48f397){logger[_0xcf38('0x24')](_0x48f397['stack']);if(_0x48f397[_0xcf38('0x25')]){delete _0x48f397[_0xcf38('0x25')];}_0x397ef3[_0xcf38('0x1d')](_0x3d3d10)[_0xcf38('0x26')](_0x48f397);};}exports['index']=function(_0x4f8138,_0x1cddcf){var _0x1d86f3={},_0x350e5f={},_0x24f416={'count':0x0,'rows':[]};var _0xcd878e=db[_0xcf38('0x27')]['rawAttributes'];_0x350e5f[_0xcf38('0x28')]=_[_0xcf38('0x29')](_0xcd878e);_0x350e5f[_0xcf38('0x2a')]=_['keys'](_0x4f8138['query']);_0x350e5f[_0xcf38('0x2b')]=_['intersection'](_0x350e5f[_0xcf38('0x28')],_0x350e5f['query']);_0x1d86f3['attributes']=_[_0xcf38('0x2c')](_0x350e5f['model'],qs['fields'](_0x4f8138[_0xcf38('0x2a')][_0xcf38('0x2d')]));_0x1d86f3[_0xcf38('0x2e')]=_0x1d86f3[_0xcf38('0x2e')]['length']?_0x1d86f3['attributes']:_0x350e5f['model'];if(!_0x4f8138[_0xcf38('0x2a')][_0xcf38('0x2f')](_0xcf38('0x30'))){_0x1d86f3[_0xcf38('0x31')]=qs[_0xcf38('0x31')](_0x4f8138['query'][_0xcf38('0x31')]);_0x1d86f3['offset']=qs[_0xcf38('0x1c')](_0x4f8138[_0xcf38('0x2a')][_0xcf38('0x1c')]);}_0x1d86f3[_0xcf38('0x32')]=qs[_0xcf38('0x33')](_0x4f8138[_0xcf38('0x2a')]['sort']);_0x1d86f3['where']=qs[_0xcf38('0x2b')](_[_0xcf38('0x34')](_0x4f8138['query'],_0x350e5f[_0xcf38('0x2b')]));if(_0x4f8138[_0xcf38('0x2a')][_0xcf38('0x35')]){_0x1d86f3['where']=_[_0xcf38('0x36')](_0x1d86f3[_0xcf38('0x37')],{'$or':_[_0xcf38('0x38')](_0xcd878e,function(_0x31f406){if(_0x31f406[_0xcf38('0x39')][_0xcf38('0x3a')]!==_0xcf38('0x3b')){var _0x5d6803={};_0x5d6803[_0x31f406[_0xcf38('0x3c')]]={'$like':'%'+_0x4f8138[_0xcf38('0x2a')][_0xcf38('0x35')]+'%'};return _0x5d6803;}})});}_0x1d86f3=_[_0xcf38('0x36')]({},_0x1d86f3,_0x4f8138[_0xcf38('0x3d')]);var _0x18ad44={'where':_0x1d86f3['where']};return db[_0xcf38('0x27')][_0xcf38('0x1b')](_0x18ad44)[_0xcf38('0x22')](function(_0x210bb0){_0x24f416['count']=_0x210bb0;if(_0x4f8138[_0xcf38('0x2a')][_0xcf38('0x3e')]){_0x1d86f3[_0xcf38('0x3f')]=[{'all':!![]}];}return db[_0xcf38('0x27')]['findAll'](_0x1d86f3);})[_0xcf38('0x22')](function(_0x32018e){_0x24f416[_0xcf38('0x40')]=_0x32018e;return _0x24f416;})[_0xcf38('0x22')](respondWithFilteredResult(_0x1cddcf,_0x1d86f3))[_0xcf38('0x41')](handleError(_0x1cddcf,null));};exports[_0xcf38('0x42')]=function(_0x41d230,_0x1d3bcd){var _0x2f1aa7={'raw':!![],'where':{'id':_0x41d230['params']['id']}},_0x18f24b={};_0x18f24b[_0xcf38('0x28')]=_[_0xcf38('0x29')](db[_0xcf38('0x27')]['rawAttributes']);_0x18f24b['query']=_[_0xcf38('0x29')](_0x41d230['query']);_0x18f24b[_0xcf38('0x2b')]=_[_0xcf38('0x2c')](_0x18f24b[_0xcf38('0x28')],_0x18f24b['query']);_0x2f1aa7['attributes']=_[_0xcf38('0x2c')](_0x18f24b['model'],qs[_0xcf38('0x2d')](_0x41d230[_0xcf38('0x2a')]['fields']));_0x2f1aa7['attributes']=_0x2f1aa7['attributes'][_0xcf38('0x43')]?_0x2f1aa7[_0xcf38('0x2e')]:_0x18f24b[_0xcf38('0x28')];if(_0x41d230['query'][_0xcf38('0x3e')]){_0x2f1aa7[_0xcf38('0x3f')]=[{'all':!![]}];}_0x2f1aa7=_[_0xcf38('0x36')]({},_0x2f1aa7,_0x41d230['options']);return db[_0xcf38('0x27')][_0xcf38('0x44')](_0x2f1aa7)[_0xcf38('0x22')](handleEntityNotFound(_0x1d3bcd,null))[_0xcf38('0x22')](respondWithResult(_0x1d3bcd,null))['catch'](handleError(_0x1d3bcd,null));};exports[_0xcf38('0x45')]=function(_0x18278c,_0x375045){return db[_0xcf38('0x27')][_0xcf38('0x45')](_0x18278c['body'],{})['then'](respondWithResult(_0x375045,0xc9))[_0xcf38('0x41')](handleError(_0x375045,null));};exports[_0xcf38('0x21')]=function(_0x4f00d2,_0x39c03b){if(_0x4f00d2[_0xcf38('0x46')]['id']){delete _0x4f00d2[_0xcf38('0x46')]['id'];}return db[_0xcf38('0x27')][_0xcf38('0x44')]({'where':{'id':_0x4f00d2[_0xcf38('0x47')]['id']}})[_0xcf38('0x22')](handleEntityNotFound(_0x39c03b,null))[_0xcf38('0x22')](saveUpdates(_0x4f00d2[_0xcf38('0x46')],null))[_0xcf38('0x22')](respondWithResult(_0x39c03b,null))[_0xcf38('0x41')](handleError(_0x39c03b,null));};exports[_0xcf38('0x23')]=function(_0x358da8,_0x52c71f){return db[_0xcf38('0x27')][_0xcf38('0x44')]({'where':{'id':_0x358da8['params']['id']}})[_0xcf38('0x22')](handleEntityNotFound(_0x52c71f,null))[_0xcf38('0x22')](removeEntity(_0x52c71f,null))[_0xcf38('0x41')](handleError(_0x52c71f,null));}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.model.js b/server/api/squareMessage/squareMessage.model.js index 0b25424..9b3c660 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 _0xbb9d=['../../config/environment','./squareMessage.attributes','exports','define','lodash','util','api','moment','bluebird','request-promise'];(function(_0x1d474b,_0x3d8a55){var _0x526ca5=function(_0xbf15be){while(--_0xbf15be){_0x1d474b['push'](_0x1d474b['shift']());}};_0x526ca5(++_0x3d8a55);}(_0xbb9d,0x7c));var _0xdbb9=function(_0x4abfcc,_0x2c8e89){_0x4abfcc=_0x4abfcc-0x0;var _0x408466=_0xbb9d[_0x4abfcc];return _0x408466;};'use strict';var _=require(_0xdbb9('0x0'));var util=require(_0xdbb9('0x1'));var logger=require('../../config/logger')(_0xdbb9('0x2'));var moment=require(_0xdbb9('0x3'));var BPromise=require(_0xdbb9('0x4'));var rp=require(_0xdbb9('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xdbb9('0x6'));var attributes=require(_0xdbb9('0x7'));module[_0xdbb9('0x8')]=function(_0x5c5265,_0x4ecfd6){return _0x5c5265[_0xdbb9('0x9')]('SquareMessage',attributes,{'tableName':'square_messages','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x79c4=['SquareMessage','util','../../config/logger','api','moment','bluebird','request-promise','path','./squareMessage.attributes','define'];(function(_0x24b5b1,_0x4cd102){var _0x4d0d22=function(_0x2dc492){while(--_0x2dc492){_0x24b5b1['push'](_0x24b5b1['shift']());}};_0x4d0d22(++_0x4cd102);}(_0x79c4,0x10f));var _0x479c=function(_0x432135,_0x342a82){_0x432135=_0x432135-0x0;var _0x10a74c=_0x79c4[_0x432135];return _0x10a74c;};'use strict';var _=require('lodash');var util=require(_0x479c('0x0'));var logger=require(_0x479c('0x1'))(_0x479c('0x2'));var moment=require(_0x479c('0x3'));var BPromise=require(_0x479c('0x4'));var rp=require(_0x479c('0x5'));var fs=require('fs');var path=require(_0x479c('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x479c('0x7'));module['exports']=function(_0x4c429f,_0x6c6cb9){return _0x4c429f[_0x479c('0x8')](_0x479c('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 36695b4..5f11adb 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 _0xc4aa=['catch','CreateSquareMessage','SquareMessage','create','body','options','raw','lodash','util','moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','SquareMessage,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info'];(function(_0x1db481,_0x1627b2){var _0x3db95b=function(_0x2d54e4){while(--_0x2d54e4){_0x1db481['push'](_0x1db481['shift']());}};_0x3db95b(++_0x1627b2);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x68c979,_0x431cff){_0x68c979=_0x68c979-0x0;var _0x4f0001=_0xc4aa[_0x68c979];return _0x4f0001;};'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')]('SquareMessage,\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);});});}exports[_0xac4a('0x15')]=function(_0x28e304){var _0x44ec59=this;return new Promise(function(_0x546c5d,_0x5ac21e){return db[_0xac4a('0x16')][_0xac4a('0x17')](_0x28e304[_0xac4a('0x18')],{'raw':_0x28e304['options']?_0x28e304[_0xac4a('0x19')][_0xac4a('0x1a')]===undefined?!![]:![]:!![]})[_0xac4a('0xc')](function(_0x3a3cdb){logger[_0xac4a('0x13')](_0xac4a('0x15'),_0x28e304);logger[_0xac4a('0xf')](_0xac4a('0x15'),_0x28e304,JSON['stringify'](_0x3a3cdb));_0x546c5d(_0x3a3cdb);})[_0xac4a('0x14')](function(_0x3204ad){logger['error'](_0xac4a('0x15'),_0x3204ad[_0xac4a('0x12')],_0x28e304);_0x5ac21e(_0x44ec59[_0xac4a('0x10')](0x1f4,_0x3204ad[_0xac4a('0x12')]));});});}; \ No newline at end of file +var _0x1298=['options','then','info','CreateSquareMessage','stringify','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','request\x20sent','debug','error','SquareMessage,\x20%s,\x20%s','message','SquareMessage','create'];(function(_0x528ee6,_0x39685d){var _0x3cc13c=function(_0x1f924a){while(--_0x1f924a){_0x528ee6['push'](_0x528ee6['shift']());}};_0x3cc13c(++_0x39685d);}(_0x1298,0x19e));var _0x8129=function(_0x2d3551,_0x50d913){_0x2d3551=_0x2d3551-0x0;var _0xa208ac=_0x1298[_0x2d3551];return _0xa208ac;};'use strict';var _=require('lodash');var util=require(_0x8129('0x0'));var moment=require('moment');var BPromise=require(_0x8129('0x1'));var rs=require(_0x8129('0x2'));var fs=require('fs');var Redis=require(_0x8129('0x3'));var db=require(_0x8129('0x4'))['db'];var utils=require(_0x8129('0x5'));var logger=require(_0x8129('0x6'))(_0x8129('0x7'));var config=require('../../config/environment');var jayson=require(_0x8129('0x8'));var client=jayson[_0x8129('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4f0a40,_0x1cd6a6,_0x2d07d5){return new BPromise(function(_0x3ff6e0,_0x3d94f8){return client[_0x8129('0xa')](_0x4f0a40,_0x2d07d5)['then'](function(_0x5a0545){logger['info']('SquareMessage,\x20%s,\x20%s',_0x1cd6a6,_0x8129('0xb'));logger[_0x8129('0xc')]('SquareMessage,\x20%s,\x20%s,\x20%s',_0x1cd6a6,_0x8129('0xb'),JSON['stringify'](_0x5a0545));if(_0x5a0545['error']){if(_0x5a0545[_0x8129('0xd')]['code']===0x1f4){logger['error'](_0x8129('0xe'),_0x1cd6a6,_0x5a0545[_0x8129('0xd')][_0x8129('0xf')]);return _0x3d94f8(_0x5a0545[_0x8129('0xd')][_0x8129('0xf')]);}logger[_0x8129('0xd')]('SquareMessage,\x20%s,\x20%s',_0x1cd6a6,_0x5a0545['error'][_0x8129('0xf')]);return _0x3ff6e0(_0x5a0545['error'][_0x8129('0xf')]);}else{logger['info'](_0x8129('0xe'),_0x1cd6a6,_0x8129('0xb'));_0x3ff6e0(_0x5a0545['result'][_0x8129('0xf')]);}})['catch'](function(_0x3b15ac){logger[_0x8129('0xd')](_0x8129('0xe'),_0x1cd6a6,_0x3b15ac);_0x3d94f8(_0x3b15ac);});});}exports['CreateSquareMessage']=function(_0x17e742){var _0x1ec668=this;return new Promise(function(_0x21c6c2,_0x1a5940){return db[_0x8129('0x10')][_0x8129('0x11')](_0x17e742['body'],{'raw':_0x17e742['options']?_0x17e742[_0x8129('0x12')]['raw']===undefined?!![]:![]:!![]})[_0x8129('0x13')](function(_0x1b419c){logger[_0x8129('0x14')](_0x8129('0x15'),_0x17e742);logger[_0x8129('0xc')](_0x8129('0x15'),_0x17e742,JSON[_0x8129('0x16')](_0x1b419c));_0x21c6c2(_0x1b419c);})[_0x8129('0x17')](function(_0x4368e2){logger[_0x8129('0xd')]('CreateSquareMessage',_0x4368e2[_0x8129('0xf')],_0x17e742);_0x1a5940(_0x1ec668[_0x8129('0xd')](0x1f4,_0x4368e2[_0x8129('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/squareOdbc/index.js b/server/api/squareOdbc/index.js index 3d5ec45..487b100 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 _0x4943=['multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareOdbc.controller','get','/:id','isAuthenticated','show','15s','post','create','update','delete','destroy','exports'];(function(_0x322bef,_0x4890d4){var _0x229e60=function(_0x45f89b){while(--_0x45f89b){_0x322bef['push'](_0x322bef['shift']());}};_0x229e60(++_0x4890d4);}(_0x4943,0x1cc));var _0x3494=function(_0x1b7111,_0x12877a){_0x1b7111=_0x1b7111-0x0;var _0x2dee61=_0x4943[_0x1b7111];return _0x2dee61;};'use strict';var multer=require(_0x3494('0x0'));var util=require(_0x3494('0x1'));var path=require('path');var timeout=require(_0x3494('0x2'));var express=require(_0x3494('0x3'));var router=express[_0x3494('0x4')]();var auth=require(_0x3494('0x5'));var interaction=require(_0x3494('0x6'));var config=require(_0x3494('0x7'));var controller=require(_0x3494('0x8'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x3494('0x9')](_0x3494('0xa'),auth[_0x3494('0xb')](),controller[_0x3494('0xc')]);router[_0x3494('0x9')]('/:id/test',auth[_0x3494('0xb')](),timeout(_0x3494('0xd')),controller['test']);router[_0x3494('0xe')]('/',auth[_0x3494('0xb')](),controller[_0x3494('0xf')]);router['put']('/:id',auth[_0x3494('0xb')](),controller[_0x3494('0x10')]);router[_0x3494('0x11')](_0x3494('0xa'),auth[_0x3494('0xb')](),controller[_0x3494('0x12')]);module[_0x3494('0x13')]=router; \ No newline at end of file +var _0x010f=['destroy','exports','util','path','express','Router','../../components/interaction/service','./squareOdbc.controller','get','isAuthenticated','/:id','show','/:id/test','15s','test','post','put','update'];(function(_0x4dbaad,_0x730318){var _0x226c72=function(_0x501972){while(--_0x501972){_0x4dbaad['push'](_0x4dbaad['shift']());}};_0x226c72(++_0x730318);}(_0x010f,0xa4));var _0xf010=function(_0x25ca8e,_0x200638){_0x25ca8e=_0x25ca8e-0x0;var _0x38cd06=_0x010f[_0x25ca8e];return _0x38cd06;};'use strict';var multer=require('multer');var util=require(_0xf010('0x0'));var path=require(_0xf010('0x1'));var timeout=require('connect-timeout');var express=require(_0xf010('0x2'));var router=express[_0xf010('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0xf010('0x4'));var config=require('../../config/environment');var controller=require(_0xf010('0x5'));router[_0xf010('0x6')]('/',auth[_0xf010('0x7')](),controller['index']);router['get'](_0xf010('0x8'),auth[_0xf010('0x7')](),controller[_0xf010('0x9')]);router['get'](_0xf010('0xa'),auth[_0xf010('0x7')](),timeout(_0xf010('0xb')),controller[_0xf010('0xc')]);router[_0xf010('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0xf010('0xe')](_0xf010('0x8'),auth[_0xf010('0x7')](),controller[_0xf010('0xf')]);router['delete'](_0xf010('0x8'),auth['isAuthenticated'](),controller[_0xf010('0x10')]);module[_0xf010('0x11')]=router; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.attributes.js b/server/api/squareOdbc/squareOdbc.attributes.js index f5573cc..556986b 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 _0x6252=['sequelize','exports','name','STRING'];(function(_0x126a11,_0x126345){var _0x163b7e=function(_0x432eb7){while(--_0x432eb7){_0x126a11['push'](_0x126a11['shift']());}};_0x163b7e(++_0x126345);}(_0x6252,0x1c0));var _0x2625=function(_0x1a7846,_0x59723e){_0x1a7846=_0x1a7846-0x0;var _0x48049=_0x6252[_0x1a7846];return _0x48049;};'use strict';var Sequelize=require(_0x2625('0x0'));module[_0x2625('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x2625('0x2'),'allowNull':![]},'dsn':{'type':Sequelize[_0x2625('0x3')]},'description':{'type':Sequelize[_0x2625('0x3')]}}; \ No newline at end of file +var _0xcc1a=['sequelize','STRING'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xcc1a,0x168));var _0xacc1=function(_0x47bc58,_0x1e1998){_0x47bc58=_0x47bc58-0x0;var _0x4a0860=_0xcc1a[_0x47bc58];return _0x4a0860;};'use strict';var Sequelize=require(_0xacc1('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![]},'dsn':{'type':Sequelize[_0xacc1('0x1')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.controller.js b/server/api/squareOdbc/squareOdbc.controller.js index 5ddd5b2..6681d08 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 _0x0539=['update','then','destroy','get','ODBC','UserProfileResource','sendStatus','error','stack','name','send','index','SquareOdbc','model','query','filters','intersection','attributes','fields','length','nolimit','limit','order','sort','where','pick','filter','merge','key','VIRTUAL','field','options','includeAll','include','catch','params','keys','rawAttributes','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','test','openSync','dsn','closeSync','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','count','offset','set','Content-Range','apply','save'];(function(_0x1f9a8a,_0x140e63){var _0x1e0ef2=function(_0x41785d){while(--_0x41785d){_0x1f9a8a['push'](_0x1f9a8a['shift']());}};_0x1e0ef2(++_0x140e63);}(_0x0539,0x1d0));var _0x9053=function(_0x8a1a24,_0x2b34d2){_0x8a1a24=_0x8a1a24-0x0;var _0x2b33ef=_0x0539[_0x8a1a24];return _0x2b33ef;};'use strict';var pdf=require(_0x9053('0x0'));var emlformat=require(_0x9053('0x1'));var rimraf=require(_0x9053('0x2'));var zipdir=require(_0x9053('0x3'));var jsonpatch=require(_0x9053('0x4'));var rp=require(_0x9053('0x5'));var moment=require(_0x9053('0x6'));var BPromise=require('bluebird');var Mustache=require(_0x9053('0x7'));var util=require(_0x9053('0x8'));var path=require('path');var sox=require(_0x9053('0x9'));var csv=require(_0x9053('0xa'));var ejs=require(_0x9053('0xb'));var fs=require('fs');var _=require(_0x9053('0xc'));var squel=require(_0x9053('0xd'));var crypto=require(_0x9053('0xe'));var jsforce=require(_0x9053('0xf'));var deskjs=require(_0x9053('0x10'));var toCsv=require(_0x9053('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x9053('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x9053('0x12'));var as=require(_0x9053('0x13'));var hardwareService=require(_0x9053('0x14'));var logger=require(_0x9053('0x15'))(_0x9053('0x16'));var utils=require(_0x9053('0x17'));var config=require(_0x9053('0x18'));var db=require(_0x9053('0x19'))['db'];function respondWithStatusCode(_0x245378,_0x48c0b7){_0x48c0b7=_0x48c0b7||0xcc;return function(_0x925e49){if(_0x925e49){return _0x245378['sendStatus'](_0x48c0b7);}return _0x245378[_0x9053('0x1a')](_0x48c0b7)[_0x9053('0x1b')]();};}function respondWithResult(_0x4b7e10,_0x5a47d7){_0x5a47d7=_0x5a47d7||0xc8;return function(_0x6cd68){if(_0x6cd68){return _0x4b7e10['status'](_0x5a47d7)['json'](_0x6cd68);}};}function respondWithFilteredResult(_0x5b92dd,_0x2b60a2){return function(_0x3fd58b){if(_0x3fd58b){var _0x2cef47=_0x3fd58b[_0x9053('0x1c')],_0x416b34=_0x2b60a2['offset'],_0x5ea6f6=_0x2b60a2[_0x9053('0x1d')]+_0x2b60a2['limit'],_0x361b6b;if(_0x5ea6f6>=_0x2cef47){_0x5ea6f6=_0x2cef47;_0x361b6b=0xc8;}else{_0x361b6b=0xce;}_0x5b92dd[_0x9053('0x1a')](_0x361b6b);return _0x5b92dd[_0x9053('0x1e')](_0x9053('0x1f'),_0x416b34+'-'+_0x5ea6f6+'/'+_0x2cef47)['json'](_0x3fd58b);}return null;};}function patchUpdates(_0x2a2ee4){return function(_0x57032f){try{jsonpatch[_0x9053('0x20')](_0x57032f,_0x2a2ee4,!![]);}catch(_0x477045){return BPromise['reject'](_0x477045);}return _0x57032f[_0x9053('0x21')]();};}function saveUpdates(_0x3f1f40,_0x49f803){return function(_0x170e3a){if(_0x170e3a){return _0x170e3a[_0x9053('0x22')](_0x3f1f40)[_0x9053('0x23')](function(_0x341172){return _0x341172;});}return null;};}function removeEntity(_0x366e6b,_0x30e12a){return function(_0x165c45){if(_0x165c45){return _0x165c45[_0x9053('0x24')]()[_0x9053('0x23')](function(){var _0x3787b7=_0x165c45[_0x9053('0x25')]({'plain':!![]});var _0x14511f=_0x9053('0x26');return db[_0x9053('0x27')][_0x9053('0x24')]({'where':{'type':_0x14511f,'resourceId':_0x3787b7['id']}})[_0x9053('0x23')](function(){return _0x165c45;});})[_0x9053('0x23')](function(){_0x366e6b[_0x9053('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x544914,_0x555270){return function(_0x513e73){if(!_0x513e73){_0x544914[_0x9053('0x28')](0x194);}return _0x513e73;};}function handleError(_0x29ab35,_0x43c0e7){_0x43c0e7=_0x43c0e7||0x1f4;return function(_0x31e0a4){logger[_0x9053('0x29')](_0x31e0a4[_0x9053('0x2a')]);if(_0x31e0a4[_0x9053('0x2b')]){delete _0x31e0a4[_0x9053('0x2b')];}_0x29ab35[_0x9053('0x1a')](_0x43c0e7)[_0x9053('0x2c')](_0x31e0a4);};}exports[_0x9053('0x2d')]=function(_0x1288e7,_0x15b9b7){var _0x37878f={},_0x50d3cb={},_0x10d8f7={'count':0x0,'rows':[]};var _0x1fc8a8=db[_0x9053('0x2e')]['rawAttributes'];_0x50d3cb[_0x9053('0x2f')]=_['keys'](_0x1fc8a8);_0x50d3cb['query']=_['keys'](_0x1288e7[_0x9053('0x30')]);_0x50d3cb[_0x9053('0x31')]=_[_0x9053('0x32')](_0x50d3cb[_0x9053('0x2f')],_0x50d3cb[_0x9053('0x30')]);_0x37878f[_0x9053('0x33')]=_['intersection'](_0x50d3cb[_0x9053('0x2f')],qs[_0x9053('0x34')](_0x1288e7[_0x9053('0x30')][_0x9053('0x34')]));_0x37878f[_0x9053('0x33')]=_0x37878f['attributes'][_0x9053('0x35')]?_0x37878f[_0x9053('0x33')]:_0x50d3cb[_0x9053('0x2f')];if(!_0x1288e7[_0x9053('0x30')]['hasOwnProperty'](_0x9053('0x36'))){_0x37878f[_0x9053('0x37')]=qs[_0x9053('0x37')](_0x1288e7[_0x9053('0x30')]['limit']);_0x37878f[_0x9053('0x1d')]=qs[_0x9053('0x1d')](_0x1288e7[_0x9053('0x30')][_0x9053('0x1d')]);}_0x37878f[_0x9053('0x38')]=qs['sort'](_0x1288e7[_0x9053('0x30')][_0x9053('0x39')]);_0x37878f[_0x9053('0x3a')]=qs[_0x9053('0x31')](_[_0x9053('0x3b')](_0x1288e7[_0x9053('0x30')],_0x50d3cb[_0x9053('0x31')]));if(_0x1288e7['query'][_0x9053('0x3c')]){_0x37878f[_0x9053('0x3a')]=_[_0x9053('0x3d')](_0x37878f[_0x9053('0x3a')],{'$or':_['map'](_0x1fc8a8,function(_0x7a409f){if(_0x7a409f['type'][_0x9053('0x3e')]!==_0x9053('0x3f')){var _0x4ccbe5={};_0x4ccbe5[_0x7a409f[_0x9053('0x40')]]={'$like':'%'+_0x1288e7[_0x9053('0x30')][_0x9053('0x3c')]+'%'};return _0x4ccbe5;}})});}_0x37878f=_['merge']({},_0x37878f,_0x1288e7[_0x9053('0x41')]);var _0x40a5be={'where':_0x37878f['where']};return db['SquareOdbc']['count'](_0x40a5be)[_0x9053('0x23')](function(_0x14053c){_0x10d8f7[_0x9053('0x1c')]=_0x14053c;if(_0x1288e7[_0x9053('0x30')][_0x9053('0x42')]){_0x37878f[_0x9053('0x43')]=[{'all':!![]}];}return db[_0x9053('0x2e')]['findAll'](_0x37878f);})['then'](function(_0x1b3a8d){_0x10d8f7['rows']=_0x1b3a8d;return _0x10d8f7;})['then'](respondWithFilteredResult(_0x15b9b7,_0x37878f))[_0x9053('0x44')](handleError(_0x15b9b7,null));};exports['show']=function(_0x53f29a,_0x26b741){var _0x4a30ac={'raw':!![],'where':{'id':_0x53f29a[_0x9053('0x45')]['id']}},_0x7a7dd1={};_0x7a7dd1[_0x9053('0x2f')]=_[_0x9053('0x46')](db[_0x9053('0x2e')][_0x9053('0x47')]);_0x7a7dd1[_0x9053('0x30')]=_[_0x9053('0x46')](_0x53f29a['query']);_0x7a7dd1['filters']=_['intersection'](_0x7a7dd1[_0x9053('0x2f')],_0x7a7dd1[_0x9053('0x30')]);_0x4a30ac[_0x9053('0x33')]=_['intersection'](_0x7a7dd1[_0x9053('0x2f')],qs[_0x9053('0x34')](_0x53f29a[_0x9053('0x30')][_0x9053('0x34')]));_0x4a30ac[_0x9053('0x33')]=_0x4a30ac[_0x9053('0x33')][_0x9053('0x35')]?_0x4a30ac[_0x9053('0x33')]:_0x7a7dd1[_0x9053('0x2f')];if(_0x53f29a[_0x9053('0x30')][_0x9053('0x42')]){_0x4a30ac['include']=[{'all':!![]}];}_0x4a30ac=_[_0x9053('0x3d')]({},_0x4a30ac,_0x53f29a[_0x9053('0x41')]);return db[_0x9053('0x2e')]['find'](_0x4a30ac)['then'](handleEntityNotFound(_0x26b741,null))[_0x9053('0x23')](respondWithResult(_0x26b741,null))[_0x9053('0x44')](handleError(_0x26b741,null));};exports['create']=function(_0x1d6941,_0x445ed0){return db[_0x9053('0x2e')]['create'](_0x1d6941['body'],{})[_0x9053('0x23')](function(_0x3f21c9){var _0x54fefb=_0x1d6941[_0x9053('0x48')]['get']({'plain':!![]});if(!_0x54fefb)throw new Error(_0x9053('0x49'));if(_0x54fefb[_0x9053('0x4a')]===_0x9053('0x48')){var _0x4eb1be=_0x3f21c9['get']({'plain':!![]});var _0x5d2a46=_0x9053('0x26');return db['UserProfileSection'][_0x9053('0x4b')]({'where':{'name':_0x5d2a46,'userProfileId':_0x54fefb[_0x9053('0x4c')]},'raw':!![]})[_0x9053('0x23')](function(_0xd47e8d){if(_0xd47e8d&&_0xd47e8d['autoAssociation']===0x0){return db[_0x9053('0x27')]['create']({'name':_0x4eb1be[_0x9053('0x2b')],'resourceId':_0x4eb1be['id'],'type':_0xd47e8d[_0x9053('0x2b')],'sectionId':_0xd47e8d['id']},{})[_0x9053('0x23')](function(){return _0x3f21c9;});}else{return _0x3f21c9;}})[_0x9053('0x44')](function(_0xd0c541){logger[_0x9053('0x29')](_0x9053('0x4d'),_0xd0c541);throw _0xd0c541;});}return _0x3f21c9;})['then'](respondWithResult(_0x445ed0,0xc9))['catch'](handleError(_0x445ed0,null));};exports[_0x9053('0x22')]=function(_0xa4f9e1,_0x124fac){if(_0xa4f9e1[_0x9053('0x4e')]['id']){delete _0xa4f9e1['body']['id'];}return db[_0x9053('0x2e')][_0x9053('0x4b')]({'where':{'id':_0xa4f9e1[_0x9053('0x45')]['id']}})[_0x9053('0x23')](handleEntityNotFound(_0x124fac,null))[_0x9053('0x23')](saveUpdates(_0xa4f9e1[_0x9053('0x4e')],null))[_0x9053('0x23')](respondWithResult(_0x124fac,null))[_0x9053('0x44')](handleError(_0x124fac,null));};exports[_0x9053('0x24')]=function(_0x338e57,_0x101747){return db['SquareOdbc'][_0x9053('0x4b')]({'where':{'id':_0x338e57['params']['id']}})[_0x9053('0x23')](handleEntityNotFound(_0x101747,null))['then'](removeEntity(_0x101747,null))[_0x9053('0x44')](handleError(_0x101747,null));};exports[_0x9053('0x4f')]=function(_0x4fd05f,_0x38cfd4,_0x3cebad){var _0x1019fd;return db[_0x9053('0x2e')][_0x9053('0x4b')]({'where':{'id':_0x4fd05f[_0x9053('0x45')]['id']},'attributes':['id','dsn']})[_0x9053('0x23')](handleEntityNotFound(_0x38cfd4,null))[_0x9053('0x23')](function(_0x5cbfaf){if(_0x5cbfaf){var _0x3ef224=require('odbc')();_0x3ef224[_0x9053('0x50')](_0x5cbfaf[_0x9053('0x51')]);_0x3ef224[_0x9053('0x52')]();return _0x5cbfaf;}})[_0x9053('0x23')](respondWithResult(_0x38cfd4,null))[_0x9053('0x44')](handleError(_0x38cfd4,null));}; \ No newline at end of file +var _0x1cb1=['role','UserProfileSection','userProfileId','autoAssociation','dsn','odbc','openSync','closeSync','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','reject','update','then','get','ODBC','UserProfileResource','destroy','error','stack','name','send','index','SquareOdbc','rawAttributes','model','keys','filters','intersection','fields','query','attributes','length','hasOwnProperty','nolimit','order','where','pick','filter','map','type','field','options','includeAll','include','rows','catch','params','merge','find','create','body','user'];(function(_0x4d29a6,_0x46969e){var _0x3131ab=function(_0x145f1d){while(--_0x145f1d){_0x4d29a6['push'](_0x4d29a6['shift']());}};_0x3131ab(++_0x46969e);}(_0x1cb1,0x154));var _0x11cb=function(_0x14ada5,_0x3e684a){_0x14ada5=_0x14ada5-0x0;var _0x3e67d7=_0x1cb1[_0x14ada5];return _0x3e67d7;};'use strict';var pdf=require(_0x11cb('0x0'));var emlformat=require(_0x11cb('0x1'));var rimraf=require(_0x11cb('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x11cb('0x3'));var rp=require(_0x11cb('0x4'));var moment=require(_0x11cb('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x11cb('0x6'));var util=require(_0x11cb('0x7'));var path=require(_0x11cb('0x8'));var sox=require(_0x11cb('0x9'));var csv=require(_0x11cb('0xa'));var ejs=require(_0x11cb('0xb'));var fs=require('fs');var _=require(_0x11cb('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x11cb('0xd'));var toCsv=require(_0x11cb('0xa'));var querystring=require(_0x11cb('0xe'));var Papa=require(_0x11cb('0xf'));var Redis=require(_0x11cb('0x10'));var authService=require(_0x11cb('0x11'));var qs=require(_0x11cb('0x12'));var as=require(_0x11cb('0x13'));var hardwareService=require(_0x11cb('0x14'));var logger=require(_0x11cb('0x15'))(_0x11cb('0x16'));var utils=require(_0x11cb('0x17'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4db6d4,_0x357240){_0x357240=_0x357240||0xcc;return function(_0x304c70){if(_0x304c70){return _0x4db6d4[_0x11cb('0x18')](_0x357240);}return _0x4db6d4[_0x11cb('0x19')](_0x357240)[_0x11cb('0x1a')]();};}function respondWithResult(_0x7dee62,_0x1b7763){_0x1b7763=_0x1b7763||0xc8;return function(_0x243bb1){if(_0x243bb1){return _0x7dee62[_0x11cb('0x19')](_0x1b7763)[_0x11cb('0x1b')](_0x243bb1);}};}function respondWithFilteredResult(_0x377cda,_0x13364c){return function(_0x349fd7){if(_0x349fd7){var _0x4368fc=_0x349fd7[_0x11cb('0x1c')],_0x27e825=_0x13364c['offset'],_0x54b003=_0x13364c[_0x11cb('0x1d')]+_0x13364c[_0x11cb('0x1e')],_0x5c6aa1;if(_0x54b003>=_0x4368fc){_0x54b003=_0x4368fc;_0x5c6aa1=0xc8;}else{_0x5c6aa1=0xce;}_0x377cda[_0x11cb('0x19')](_0x5c6aa1);return _0x377cda['set'](_0x11cb('0x1f'),_0x27e825+'-'+_0x54b003+'/'+_0x4368fc)['json'](_0x349fd7);}return null;};}function patchUpdates(_0x4073e5){return function(_0x45cd0a){try{jsonpatch[_0x11cb('0x20')](_0x45cd0a,_0x4073e5,!![]);}catch(_0x43633c){return BPromise[_0x11cb('0x21')](_0x43633c);}return _0x45cd0a['save']();};}function saveUpdates(_0x12506e,_0x27487a){return function(_0x505702){if(_0x505702){return _0x505702[_0x11cb('0x22')](_0x12506e)[_0x11cb('0x23')](function(_0x1f3668){return _0x1f3668;});}return null;};}function removeEntity(_0x34a84b,_0x31ee47){return function(_0x446837){if(_0x446837){return _0x446837['destroy']()[_0x11cb('0x23')](function(){var _0xa369dc=_0x446837[_0x11cb('0x24')]({'plain':!![]});var _0x478998=_0x11cb('0x25');return db[_0x11cb('0x26')][_0x11cb('0x27')]({'where':{'type':_0x478998,'resourceId':_0xa369dc['id']}})[_0x11cb('0x23')](function(){return _0x446837;});})[_0x11cb('0x23')](function(){_0x34a84b[_0x11cb('0x19')](0xcc)[_0x11cb('0x1a')]();});}};}function handleEntityNotFound(_0x4a2a98,_0x248361){return function(_0x5b7349){if(!_0x5b7349){_0x4a2a98[_0x11cb('0x18')](0x194);}return _0x5b7349;};}function handleError(_0x580108,_0x178e6c){_0x178e6c=_0x178e6c||0x1f4;return function(_0x1918cb){logger[_0x11cb('0x28')](_0x1918cb[_0x11cb('0x29')]);if(_0x1918cb[_0x11cb('0x2a')]){delete _0x1918cb['name'];}_0x580108['status'](_0x178e6c)[_0x11cb('0x2b')](_0x1918cb);};}exports[_0x11cb('0x2c')]=function(_0x11a9ae,_0xc2f096){var _0x1e2307={},_0x1a8738={},_0x42f911={'count':0x0,'rows':[]};var _0xb12714=db[_0x11cb('0x2d')][_0x11cb('0x2e')];_0x1a8738[_0x11cb('0x2f')]=_[_0x11cb('0x30')](_0xb12714);_0x1a8738['query']=_[_0x11cb('0x30')](_0x11a9ae['query']);_0x1a8738[_0x11cb('0x31')]=_[_0x11cb('0x32')](_0x1a8738[_0x11cb('0x2f')],_0x1a8738['query']);_0x1e2307['attributes']=_[_0x11cb('0x32')](_0x1a8738[_0x11cb('0x2f')],qs[_0x11cb('0x33')](_0x11a9ae[_0x11cb('0x34')][_0x11cb('0x33')]));_0x1e2307['attributes']=_0x1e2307[_0x11cb('0x35')][_0x11cb('0x36')]?_0x1e2307['attributes']:_0x1a8738[_0x11cb('0x2f')];if(!_0x11a9ae[_0x11cb('0x34')][_0x11cb('0x37')](_0x11cb('0x38'))){_0x1e2307[_0x11cb('0x1e')]=qs[_0x11cb('0x1e')](_0x11a9ae[_0x11cb('0x34')][_0x11cb('0x1e')]);_0x1e2307[_0x11cb('0x1d')]=qs[_0x11cb('0x1d')](_0x11a9ae[_0x11cb('0x34')][_0x11cb('0x1d')]);}_0x1e2307[_0x11cb('0x39')]=qs['sort'](_0x11a9ae[_0x11cb('0x34')]['sort']);_0x1e2307[_0x11cb('0x3a')]=qs[_0x11cb('0x31')](_[_0x11cb('0x3b')](_0x11a9ae[_0x11cb('0x34')],_0x1a8738[_0x11cb('0x31')]));if(_0x11a9ae[_0x11cb('0x34')][_0x11cb('0x3c')]){_0x1e2307['where']=_['merge'](_0x1e2307[_0x11cb('0x3a')],{'$or':_[_0x11cb('0x3d')](_0xb12714,function(_0x4dc30b){if(_0x4dc30b[_0x11cb('0x3e')]['key']!=='VIRTUAL'){var _0x210f15={};_0x210f15[_0x4dc30b[_0x11cb('0x3f')]]={'$like':'%'+_0x11a9ae[_0x11cb('0x34')][_0x11cb('0x3c')]+'%'};return _0x210f15;}})});}_0x1e2307=_['merge']({},_0x1e2307,_0x11a9ae[_0x11cb('0x40')]);var _0x2ac988={'where':_0x1e2307[_0x11cb('0x3a')]};return db['SquareOdbc']['count'](_0x2ac988)[_0x11cb('0x23')](function(_0x26ed87){_0x42f911[_0x11cb('0x1c')]=_0x26ed87;if(_0x11a9ae[_0x11cb('0x34')][_0x11cb('0x41')]){_0x1e2307[_0x11cb('0x42')]=[{'all':!![]}];}return db[_0x11cb('0x2d')]['findAll'](_0x1e2307);})[_0x11cb('0x23')](function(_0x5d004d){_0x42f911[_0x11cb('0x43')]=_0x5d004d;return _0x42f911;})[_0x11cb('0x23')](respondWithFilteredResult(_0xc2f096,_0x1e2307))[_0x11cb('0x44')](handleError(_0xc2f096,null));};exports['show']=function(_0x6e01ee,_0x33632f){var _0x45ea9e={'raw':!![],'where':{'id':_0x6e01ee[_0x11cb('0x45')]['id']}},_0x4e0058={};_0x4e0058[_0x11cb('0x2f')]=_[_0x11cb('0x30')](db[_0x11cb('0x2d')][_0x11cb('0x2e')]);_0x4e0058[_0x11cb('0x34')]=_[_0x11cb('0x30')](_0x6e01ee[_0x11cb('0x34')]);_0x4e0058[_0x11cb('0x31')]=_[_0x11cb('0x32')](_0x4e0058[_0x11cb('0x2f')],_0x4e0058[_0x11cb('0x34')]);_0x45ea9e[_0x11cb('0x35')]=_[_0x11cb('0x32')](_0x4e0058[_0x11cb('0x2f')],qs[_0x11cb('0x33')](_0x6e01ee[_0x11cb('0x34')][_0x11cb('0x33')]));_0x45ea9e['attributes']=_0x45ea9e[_0x11cb('0x35')]['length']?_0x45ea9e[_0x11cb('0x35')]:_0x4e0058[_0x11cb('0x2f')];if(_0x6e01ee[_0x11cb('0x34')][_0x11cb('0x41')]){_0x45ea9e[_0x11cb('0x42')]=[{'all':!![]}];}_0x45ea9e=_[_0x11cb('0x46')]({},_0x45ea9e,_0x6e01ee[_0x11cb('0x40')]);return db['SquareOdbc'][_0x11cb('0x47')](_0x45ea9e)[_0x11cb('0x23')](handleEntityNotFound(_0x33632f,null))[_0x11cb('0x23')](respondWithResult(_0x33632f,null))[_0x11cb('0x44')](handleError(_0x33632f,null));};exports[_0x11cb('0x48')]=function(_0x5e45e6,_0x84fe9f){return db[_0x11cb('0x2d')]['create'](_0x5e45e6[_0x11cb('0x49')],{})[_0x11cb('0x23')](function(_0xbbba9c){var _0x571642=_0x5e45e6[_0x11cb('0x4a')][_0x11cb('0x24')]({'plain':!![]});if(!_0x571642)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x571642[_0x11cb('0x4b')]===_0x11cb('0x4a')){var _0x2d5af4=_0xbbba9c['get']({'plain':!![]});var _0x47a458='ODBC';return db[_0x11cb('0x4c')][_0x11cb('0x47')]({'where':{'name':_0x47a458,'userProfileId':_0x571642[_0x11cb('0x4d')]},'raw':!![]})['then'](function(_0x58aeb6){if(_0x58aeb6&&_0x58aeb6[_0x11cb('0x4e')]===0x0){return db['UserProfileResource'][_0x11cb('0x48')]({'name':_0x2d5af4[_0x11cb('0x2a')],'resourceId':_0x2d5af4['id'],'type':_0x58aeb6['name'],'sectionId':_0x58aeb6['id']},{})[_0x11cb('0x23')](function(){return _0xbbba9c;});}else{return _0xbbba9c;}})[_0x11cb('0x44')](function(_0x323ea7){logger[_0x11cb('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x323ea7);throw _0x323ea7;});}return _0xbbba9c;})[_0x11cb('0x23')](respondWithResult(_0x84fe9f,0xc9))[_0x11cb('0x44')](handleError(_0x84fe9f,null));};exports[_0x11cb('0x22')]=function(_0x5b8fb0,_0x3990f1){if(_0x5b8fb0[_0x11cb('0x49')]['id']){delete _0x5b8fb0[_0x11cb('0x49')]['id'];}return db['SquareOdbc'][_0x11cb('0x47')]({'where':{'id':_0x5b8fb0[_0x11cb('0x45')]['id']}})['then'](handleEntityNotFound(_0x3990f1,null))[_0x11cb('0x23')](saveUpdates(_0x5b8fb0['body'],null))[_0x11cb('0x23')](respondWithResult(_0x3990f1,null))['catch'](handleError(_0x3990f1,null));};exports[_0x11cb('0x27')]=function(_0xb9ea80,_0x5790c5){return db['SquareOdbc'][_0x11cb('0x47')]({'where':{'id':_0xb9ea80[_0x11cb('0x45')]['id']}})['then'](handleEntityNotFound(_0x5790c5,null))['then'](removeEntity(_0x5790c5,null))[_0x11cb('0x44')](handleError(_0x5790c5,null));};exports['test']=function(_0x23cd08,_0x4ed93b,_0x53cf48){var _0x4abd62;return db[_0x11cb('0x2d')][_0x11cb('0x47')]({'where':{'id':_0x23cd08[_0x11cb('0x45')]['id']},'attributes':['id',_0x11cb('0x4f')]})[_0x11cb('0x23')](handleEntityNotFound(_0x4ed93b,null))[_0x11cb('0x23')](function(_0x426e5b){if(_0x426e5b){var _0x6367e0=require(_0x11cb('0x50'))();_0x6367e0[_0x11cb('0x51')](_0x426e5b[_0x11cb('0x4f')]);_0x6367e0[_0x11cb('0x52')]();return _0x426e5b;}})['then'](respondWithResult(_0x4ed93b,null))['catch'](handleError(_0x4ed93b,null));}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.model.js b/server/api/squareOdbc/squareOdbc.model.js index 037c214..8b396bc 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 _0xd5b6=['square_odbc','api','moment','request-promise','path','rimraf','../../config/environment','exports','define','SquareOdbc'];(function(_0x11092d,_0x10a680){var _0x5b030d=function(_0x3ed995){while(--_0x3ed995){_0x11092d['push'](_0x11092d['shift']());}};_0x5b030d(++_0x10a680);}(_0xd5b6,0x191));var _0x6d5b=function(_0x2b5de1,_0x8ce0eb){_0x2b5de1=_0x2b5de1-0x0;var _0x4471d1=_0xd5b6[_0x2b5de1];return _0x4471d1;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x6d5b('0x0'));var moment=require(_0x6d5b('0x1'));var BPromise=require('bluebird');var rp=require(_0x6d5b('0x2'));var fs=require('fs');var path=require(_0x6d5b('0x3'));var rimraf=require(_0x6d5b('0x4'));var config=require(_0x6d5b('0x5'));var attributes=require('./squareOdbc.attributes');module[_0x6d5b('0x6')]=function(_0x287a5e,_0x4e1bab){return _0x287a5e[_0x6d5b('0x7')](_0x6d5b('0x8'),attributes,{'tableName':_0x6d5b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf35d=['lodash','../../config/logger','moment','bluebird','path','../../config/environment','./squareOdbc.attributes','exports','define','SquareOdbc'];(function(_0x230994,_0x5a43d3){var _0x5387a4=function(_0x5daf24){while(--_0x5daf24){_0x230994['push'](_0x230994['shift']());}};_0x5387a4(++_0x5a43d3);}(_0xf35d,0x17c));var _0xdf35=function(_0x1559a8,_0x31a9af){_0x1559a8=_0x1559a8-0x0;var _0x2c1bfb=_0xf35d[_0x1559a8];return _0x2c1bfb;};'use strict';var _=require(_0xdf35('0x0'));var util=require('util');var logger=require(_0xdf35('0x1'))('api');var moment=require(_0xdf35('0x2'));var BPromise=require(_0xdf35('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xdf35('0x4'));var rimraf=require('rimraf');var config=require(_0xdf35('0x5'));var attributes=require(_0xdf35('0x6'));module[_0xdf35('0x7')]=function(_0x7cfe71,_0x41036b){return _0x7cfe71[_0xdf35('0x8')](_0xdf35('0x9'),attributes,{'tableName':'square_odbc','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.rpc.js b/server/api/squareOdbc/squareOdbc.rpc.js index 0d1f608..5dd4cc0 100644 --- a/server/api/squareOdbc/squareOdbc.rpc.js +++ b/server/api/squareOdbc/squareOdbc.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7217=['where','attributes','map','include','model','ShowSquareOdbc','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SquareOdbc,\x20%s,\x20%s','debug','SquareOdbc,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','SquareOdbc','find','options','raw'];(function(_0x29852a,_0xddbd30){var _0x2ff0ae=function(_0x2528a1){while(--_0x2528a1){_0x29852a['push'](_0x29852a['shift']());}};_0x2ff0ae(++_0xddbd30);}(_0x7217,0x19e));var _0x7721=function(_0x3899d1,_0x4aa04c){_0x3899d1=_0x3899d1-0x0;var _0xeb4a7d=_0x7217[_0x3899d1];return _0xeb4a7d;};'use strict';var _=require(_0x7721('0x0'));var util=require('util');var moment=require(_0x7721('0x1'));var BPromise=require(_0x7721('0x2'));var rs=require(_0x7721('0x3'));var fs=require('fs');var Redis=require(_0x7721('0x4'));var db=require(_0x7721('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x7721('0x6'));var config=require(_0x7721('0x7'));var jayson=require(_0x7721('0x8'));var client=jayson[_0x7721('0x9')][_0x7721('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xf7ff37,_0x18ab6b,_0x21f680){return new BPromise(function(_0x225610,_0x2f99ed){return client[_0x7721('0xb')](_0xf7ff37,_0x21f680)[_0x7721('0xc')](function(_0xfa8835){logger[_0x7721('0xd')](_0x7721('0xe'),_0x18ab6b,'request\x20sent');logger[_0x7721('0xf')](_0x7721('0x10'),_0x18ab6b,_0x7721('0x11'),JSON[_0x7721('0x12')](_0xfa8835));if(_0xfa8835[_0x7721('0x13')]){if(_0xfa8835[_0x7721('0x13')][_0x7721('0x14')]===0x1f4){logger[_0x7721('0x13')]('SquareOdbc,\x20%s,\x20%s',_0x18ab6b,_0xfa8835[_0x7721('0x13')][_0x7721('0x15')]);return _0x2f99ed(_0xfa8835['error'][_0x7721('0x15')]);}logger[_0x7721('0x13')](_0x7721('0xe'),_0x18ab6b,_0xfa8835[_0x7721('0x13')]['message']);return _0x225610(_0xfa8835[_0x7721('0x13')][_0x7721('0x15')]);}else{logger['info']('SquareOdbc,\x20%s,\x20%s',_0x18ab6b,'request\x20sent');_0x225610(_0xfa8835[_0x7721('0x16')][_0x7721('0x15')]);}})[_0x7721('0x17')](function(_0x32550d){logger['error'](_0x7721('0xe'),_0x18ab6b,_0x32550d);_0x2f99ed(_0x32550d);});});}exports['ShowSquareOdbc']=function(_0x3fc09e){var _0x5cb0e6=this;return new Promise(function(_0xfec626,_0x4e96fb){return db[_0x7721('0x18')][_0x7721('0x19')]({'raw':_0x3fc09e[_0x7721('0x1a')]?_0x3fc09e[_0x7721('0x1a')][_0x7721('0x1b')]===undefined?!![]:![]:!![],'where':_0x3fc09e[_0x7721('0x1a')]?_0x3fc09e[_0x7721('0x1a')][_0x7721('0x1c')]||null:null,'attributes':_0x3fc09e['options']?_0x3fc09e[_0x7721('0x1a')][_0x7721('0x1d')]||null:null,'include':_0x3fc09e[_0x7721('0x1a')]?_0x3fc09e[_0x7721('0x1a')]['include']?_[_0x7721('0x1e')](_0x3fc09e['options'][_0x7721('0x1f')],function(_0x288e3a){return{'model':db[_0x288e3a[_0x7721('0x20')]],'as':_0x288e3a['as'],'attributes':_0x288e3a[_0x7721('0x1d')],'include':_0x288e3a[_0x7721('0x1f')]?_[_0x7721('0x1e')](_0x288e3a[_0x7721('0x1f')],function(_0x5b4d74){return{'model':db[_0x5b4d74[_0x7721('0x20')]],'as':_0x5b4d74['as'],'attributes':_0x5b4d74[_0x7721('0x1d')],'include':_0x5b4d74[_0x7721('0x1f')]?_[_0x7721('0x1e')](_0x5b4d74[_0x7721('0x1f')],function(_0x16355a){return{'model':db[_0x16355a[_0x7721('0x20')]],'as':_0x16355a['as'],'attributes':_0x16355a[_0x7721('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x7721('0xc')](function(_0x52316e){logger[_0x7721('0xd')]('ShowSquareOdbc',_0x3fc09e);logger['debug'](_0x7721('0x21'),_0x3fc09e,JSON[_0x7721('0x12')](_0x52316e));_0xfec626(_0x52316e);})[_0x7721('0x17')](function(_0x158d98){logger[_0x7721('0x13')](_0x7721('0x21'),_0x158d98[_0x7721('0x15')],_0x3fc09e);_0x4e96fb(_0x5cb0e6[_0x7721('0x13')](0x1f4,_0x158d98['message']));});});}; \ No newline at end of file +var _0xe14b=['ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','then','info','SquareOdbc,\x20%s,\x20%s','SquareOdbc,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','ShowSquareOdbc','SquareOdbc','find','options','raw','where','attributes','map','include','model','stringify','lodash','util','randomstring'];(function(_0x351a91,_0x1b45f6){var _0x430dd3=function(_0x8b51f0){while(--_0x8b51f0){_0x351a91['push'](_0x351a91['shift']());}};_0x430dd3(++_0x1b45f6);}(_0xe14b,0x93));var _0xbe14=function(_0xa11664,_0x15c2a6){_0xa11664=_0xa11664-0x0;var _0x5edabd=_0xe14b[_0xa11664];return _0x5edabd;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xbe14('0x2'));var fs=require('fs');var Redis=require(_0xbe14('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xbe14('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xbe14('0x5'));var jayson=require(_0xbe14('0x6'));var client=jayson[_0xbe14('0x7')][_0xbe14('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1d9ade,_0x39387e,_0x196fca){return new BPromise(function(_0x566ae7,_0x50f909){return client['request'](_0x1d9ade,_0x196fca)[_0xbe14('0x9')](function(_0x6fceff){logger[_0xbe14('0xa')](_0xbe14('0xb'),_0x39387e,'request\x20sent');logger['debug'](_0xbe14('0xc'),_0x39387e,_0xbe14('0xd'),JSON['stringify'](_0x6fceff));if(_0x6fceff[_0xbe14('0xe')]){if(_0x6fceff[_0xbe14('0xe')][_0xbe14('0xf')]===0x1f4){logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);return _0x50f909(_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);}logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);return _0x566ae7(_0x6fceff['error']['message']);}else{logger[_0xbe14('0xa')](_0xbe14('0xb'),_0x39387e,_0xbe14('0xd'));_0x566ae7(_0x6fceff[_0xbe14('0x11')]['message']);}})[_0xbe14('0x12')](function(_0xe9c3ec){logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0xe9c3ec);_0x50f909(_0xe9c3ec);});});}exports[_0xbe14('0x13')]=function(_0x29ab73){var _0x17ae86=this;return new Promise(function(_0x5ea1f8,_0x137ee5){return db[_0xbe14('0x14')][_0xbe14('0x15')]({'raw':_0x29ab73[_0xbe14('0x16')]?_0x29ab73[_0xbe14('0x16')][_0xbe14('0x17')]===undefined?!![]:![]:!![],'where':_0x29ab73['options']?_0x29ab73[_0xbe14('0x16')][_0xbe14('0x18')]||null:null,'attributes':_0x29ab73[_0xbe14('0x16')]?_0x29ab73[_0xbe14('0x16')][_0xbe14('0x19')]||null:null,'include':_0x29ab73['options']?_0x29ab73[_0xbe14('0x16')]['include']?_[_0xbe14('0x1a')](_0x29ab73['options'][_0xbe14('0x1b')],function(_0x4a25fa){return{'model':db[_0x4a25fa[_0xbe14('0x1c')]],'as':_0x4a25fa['as'],'attributes':_0x4a25fa[_0xbe14('0x19')],'include':_0x4a25fa['include']?_[_0xbe14('0x1a')](_0x4a25fa['include'],function(_0x4587a8){return{'model':db[_0x4587a8['model']],'as':_0x4587a8['as'],'attributes':_0x4587a8[_0xbe14('0x19')],'include':_0x4587a8[_0xbe14('0x1b')]?_[_0xbe14('0x1a')](_0x4587a8[_0xbe14('0x1b')],function(_0x15ef02){return{'model':db[_0x15ef02[_0xbe14('0x1c')]],'as':_0x15ef02['as'],'attributes':_0x15ef02['attributes']};}):[]};}):[]};}):[]:[]})[_0xbe14('0x9')](function(_0x1ba46a){logger[_0xbe14('0xa')](_0xbe14('0x13'),_0x29ab73);logger['debug'](_0xbe14('0x13'),_0x29ab73,JSON[_0xbe14('0x1d')](_0x1ba46a));_0x5ea1f8(_0x1ba46a);})['catch'](function(_0x3c3613){logger[_0xbe14('0xe')](_0xbe14('0x13'),_0x3c3613[_0xbe14('0x10')],_0x29ab73);_0x137ee5(_0x17ae86[_0xbe14('0xe')](0x1f4,_0x3c3613[_0xbe14('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/index.js b/server/api/squareProject/index.js index a616f3f..a01374d 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 _0xd7d1=['path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareProject.controller','get','isAuthenticated','index','/:id','show','/:id/users','getUsers','post','create','put','update','delete','exports','multer','util'];(function(_0xb26065,_0x36df08){var _0x974dce=function(_0x1b5ace){while(--_0x1b5ace){_0xb26065['push'](_0xb26065['shift']());}};_0x974dce(++_0x36df08);}(_0xd7d1,0x1b3));var _0x1d7d=function(_0x5eb2e5,_0x3cc081){_0x5eb2e5=_0x5eb2e5-0x0;var _0x584f48=_0xd7d1[_0x5eb2e5];return _0x584f48;};'use strict';var multer=require(_0x1d7d('0x0'));var util=require(_0x1d7d('0x1'));var path=require(_0x1d7d('0x2'));var timeout=require(_0x1d7d('0x3'));var express=require(_0x1d7d('0x4'));var router=express[_0x1d7d('0x5')]();var auth=require(_0x1d7d('0x6'));var interaction=require(_0x1d7d('0x7'));var config=require(_0x1d7d('0x8'));var controller=require(_0x1d7d('0x9'));router[_0x1d7d('0xa')]('/',auth[_0x1d7d('0xb')](),controller[_0x1d7d('0xc')]);router['get'](_0x1d7d('0xd'),auth[_0x1d7d('0xb')](),controller[_0x1d7d('0xe')]);router[_0x1d7d('0xa')](_0x1d7d('0xf'),auth[_0x1d7d('0xb')](),controller[_0x1d7d('0x10')]);router[_0x1d7d('0x11')]('/',auth[_0x1d7d('0xb')](),controller[_0x1d7d('0x12')]);router[_0x1d7d('0x11')]('/:id/users',auth[_0x1d7d('0xb')](),controller['addUsers']);router[_0x1d7d('0x13')](_0x1d7d('0xd'),auth[_0x1d7d('0xb')](),controller[_0x1d7d('0x14')]);router['delete'](_0x1d7d('0xd'),auth['isAuthenticated'](),controller['destroy']);router[_0x1d7d('0x15')](_0x1d7d('0xf'),auth['isAuthenticated'](),controller['removeUsers']);module[_0x1d7d('0x16')]=router; \ No newline at end of file +var _0xcf2f=['util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareProject.controller','get','isAuthenticated','index','/:id','show','/:id/users','create','post','addUsers','put','delete','destroy','multer'];(function(_0xb0e1e4,_0x54515a){var _0x3fe25d=function(_0x552112){while(--_0x552112){_0xb0e1e4['push'](_0xb0e1e4['shift']());}};_0x3fe25d(++_0x54515a);}(_0xcf2f,0xa7));var _0xfcf2=function(_0x3382b8,_0x55e759){_0x3382b8=_0x3382b8-0x0;var _0x5b2b95=_0xcf2f[_0x3382b8];return _0x5b2b95;};'use strict';var multer=require(_0xfcf2('0x0'));var util=require(_0xfcf2('0x1'));var path=require(_0xfcf2('0x2'));var timeout=require(_0xfcf2('0x3'));var express=require(_0xfcf2('0x4'));var router=express['Router']();var auth=require(_0xfcf2('0x5'));var interaction=require(_0xfcf2('0x6'));var config=require(_0xfcf2('0x7'));var controller=require(_0xfcf2('0x8'));router[_0xfcf2('0x9')]('/',auth[_0xfcf2('0xa')](),controller[_0xfcf2('0xb')]);router[_0xfcf2('0x9')](_0xfcf2('0xc'),auth[_0xfcf2('0xa')](),controller[_0xfcf2('0xd')]);router[_0xfcf2('0x9')](_0xfcf2('0xe'),auth[_0xfcf2('0xa')](),controller['getUsers']);router['post']('/',auth['isAuthenticated'](),controller[_0xfcf2('0xf')]);router[_0xfcf2('0x10')]('/:id/users',auth[_0xfcf2('0xa')](),controller[_0xfcf2('0x11')]);router[_0xfcf2('0x12')](_0xfcf2('0xc'),auth['isAuthenticated'](),controller['update']);router[_0xfcf2('0x13')](_0xfcf2('0xc'),auth[_0xfcf2('0xa')](),controller[_0xfcf2('0x14')]);router['delete'](_0xfcf2('0xe'),auth['isAuthenticated'](),controller['removeUsers']);module['exports']=router; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.attributes.js b/server/api/squareProject/squareProject.attributes.js index 21ad2e4..35ea4b6 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 _0xe3b1=['getDataValue','toString','production','sequelize','exports','name','STRING','TEXT','BLOB','long','preproduction'];(function(_0x2f0798,_0x1f748c){var _0x53585a=function(_0xe620ff){while(--_0xe620ff){_0x2f0798['push'](_0x2f0798['shift']());}};_0x53585a(++_0x1f748c);}(_0xe3b1,0x163));var _0x1e3b=function(_0x1e768e,_0x26e25e){_0x1e768e=_0x1e768e-0x0;var _0x34217d=_0xe3b1[_0x1e768e];return _0x34217d;};'use strict';var Sequelize=require(_0x1e3b('0x0'));module[_0x1e3b('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x1e3b('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0x1e3b('0x3')]},'notes':{'type':Sequelize[_0x1e3b('0x4')]},'preproduction':{'type':Sequelize[_0x1e3b('0x5')](_0x1e3b('0x6')),'get':function(){if(this['getDataValue'](_0x1e3b('0x7'))){return this[_0x1e3b('0x8')](_0x1e3b('0x7'))[_0x1e3b('0x9')]('utf8');}}},'production':{'type':Sequelize[_0x1e3b('0x5')](_0x1e3b('0x6')),'get':function(){if(this[_0x1e3b('0x8')]('production')){return this['getDataValue'](_0x1e3b('0xa'))[_0x1e3b('0x9')]('utf8');}}}}; \ No newline at end of file +var _0x5f2b=['production','sequelize','STRING','name','TEXT','getDataValue','preproduction','toString','utf8','BLOB'];(function(_0x4154a6,_0x2c0b8e){var _0x3b2786=function(_0x2f5936){while(--_0x2f5936){_0x4154a6['push'](_0x4154a6['shift']());}};_0x3b2786(++_0x2c0b8e);}(_0x5f2b,0x173));var _0xb5f2=function(_0x1d1737,_0x5a7cdb){_0x1d1737=_0x1d1737-0x0;var _0x1e7875=_0x5f2b[_0x1d1737];return _0x1e7875;};'use strict';var Sequelize=require(_0xb5f2('0x0'));module['exports']={'name':{'type':Sequelize[_0xb5f2('0x1')],'unique':_0xb5f2('0x2'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'notes':{'type':Sequelize[_0xb5f2('0x3')]},'preproduction':{'type':Sequelize['BLOB']('long'),'get':function(){if(this[_0xb5f2('0x4')]('preproduction')){return this[_0xb5f2('0x4')](_0xb5f2('0x5'))[_0xb5f2('0x6')](_0xb5f2('0x7'));}}},'production':{'type':Sequelize[_0xb5f2('0x8')]('long'),'get':function(){if(this[_0xb5f2('0x4')](_0xb5f2('0x9'))){return this[_0xb5f2('0x4')](_0xb5f2('0x9'))[_0xb5f2('0x6')](_0xb5f2('0x7'));}}}}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.controller.js b/server/api/squareProject/squareProject.controller.js index 90dd4e7..8a3bf1e 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 _0x0148=['userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','params','addUsers','ids','removeUsers','isArray','emit','userSquareProject:remove','findOne','User','order','getUsers','html-pdf','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','sox','ejs','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./squareProject.socket','register','sendStatus','end','status','json','offset','limit','set','Content-Range','apply','update','then','destroy','get','error','stack','name','send','SquareProject','rawAttributes','keys','query','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','map','type','VIRTUAL','field','merge','options','count','includeAll','include','findAll','rows','show','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','SquareProjects'];(function(_0x31432e,_0xc79cd2){var _0x54e556=function(_0xafd809){while(--_0xafd809){_0x31432e['push'](_0x31432e['shift']());}};_0x54e556(++_0xc79cd2);}(_0x0148,0x12c));var _0x8014=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x0148[_0x59ee6f];return _0x4c0979;};'use strict';var pdf=require(_0x8014('0x0'));var emlformat=require(_0x8014('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x8014('0x2'));var jsonpatch=require(_0x8014('0x3'));var rp=require('request-promise');var moment=require(_0x8014('0x4'));var BPromise=require(_0x8014('0x5'));var Mustache=require(_0x8014('0x6'));var util=require('util');var path=require('path');var sox=require(_0x8014('0x7'));var csv=require('to-csv');var ejs=require(_0x8014('0x8'));var fs=require('fs');var _=require(_0x8014('0x9'));var squel=require(_0x8014('0xa'));var crypto=require(_0x8014('0xb'));var jsforce=require(_0x8014('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x8014('0xd'));var Papa=require('papaparse');var Redis=require(_0x8014('0xe'));var authService=require(_0x8014('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x8014('0x10'));var hardwareService=require(_0x8014('0x11'));var logger=require('../../config/logger')(_0x8014('0x12'));var utils=require(_0x8014('0x13'));var config=require(_0x8014('0x14'));var db=require(_0x8014('0x15'))['db'];config[_0x8014('0x16')]=_[_0x8014('0x17')](config[_0x8014('0x16')],{'host':_0x8014('0x18'),'port':0x18eb});var socket=require(_0x8014('0x19'))(new Redis(config['redis']));require(_0x8014('0x1a'))[_0x8014('0x1b')](socket);function respondWithStatusCode(_0x532800,_0x5cc0bc){_0x5cc0bc=_0x5cc0bc||0xcc;return function(_0x4766e1){if(_0x4766e1){return _0x532800[_0x8014('0x1c')](_0x5cc0bc);}return _0x532800['status'](_0x5cc0bc)[_0x8014('0x1d')]();};}function respondWithResult(_0x1b20f9,_0x18174a){_0x18174a=_0x18174a||0xc8;return function(_0x8cf388){if(_0x8cf388){return _0x1b20f9[_0x8014('0x1e')](_0x18174a)[_0x8014('0x1f')](_0x8cf388);}};}function respondWithFilteredResult(_0x1ad07d,_0x43ba52){return function(_0x142d61){if(_0x142d61){var _0x5290bc=_0x142d61['count'],_0x23d539=_0x43ba52[_0x8014('0x20')],_0x39b9c1=_0x43ba52['offset']+_0x43ba52[_0x8014('0x21')],_0x4fa330;if(_0x39b9c1>=_0x5290bc){_0x39b9c1=_0x5290bc;_0x4fa330=0xc8;}else{_0x4fa330=0xce;}_0x1ad07d[_0x8014('0x1e')](_0x4fa330);return _0x1ad07d[_0x8014('0x22')](_0x8014('0x23'),_0x23d539+'-'+_0x39b9c1+'/'+_0x5290bc)[_0x8014('0x1f')](_0x142d61);}return null;};}function patchUpdates(_0x3b6bbc){return function(_0x1e12f5){try{jsonpatch[_0x8014('0x24')](_0x1e12f5,_0x3b6bbc,!![]);}catch(_0x265ef5){return BPromise['reject'](_0x265ef5);}return _0x1e12f5['save']();};}function saveUpdates(_0x56aa1b,_0x368b56){return function(_0x2a9077){if(_0x2a9077){return _0x2a9077[_0x8014('0x25')](_0x56aa1b)[_0x8014('0x26')](function(_0x509a2d){return _0x509a2d;});}return null;};}function removeEntity(_0x2b98ac,_0x1a64ef){return function(_0x2f67f5){if(_0x2f67f5){return _0x2f67f5[_0x8014('0x27')]()[_0x8014('0x26')](function(){var _0x4c591a=_0x2f67f5[_0x8014('0x28')]({'plain':!![]});var _0x586ec4='SquareProjects';return db['UserProfileResource']['destroy']({'where':{'type':_0x586ec4,'resourceId':_0x4c591a['id']}})[_0x8014('0x26')](function(){return _0x2f67f5;});})[_0x8014('0x26')](function(){_0x2b98ac[_0x8014('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1824bf,_0x35a490){return function(_0x1c3287){if(!_0x1c3287){_0x1824bf['sendStatus'](0x194);}return _0x1c3287;};}function handleError(_0x3ff5db,_0x98bef6){_0x98bef6=_0x98bef6||0x1f4;return function(_0x14febc){logger[_0x8014('0x29')](_0x14febc[_0x8014('0x2a')]);if(_0x14febc[_0x8014('0x2b')]){delete _0x14febc[_0x8014('0x2b')];}_0x3ff5db[_0x8014('0x1e')](_0x98bef6)[_0x8014('0x2c')](_0x14febc);};}exports['index']=function(_0x1533dd,_0x47236f){var _0x6dd011={},_0x3d5873={},_0x1b34bb={'count':0x0,'rows':[]};var _0x4d01f7=db[_0x8014('0x2d')][_0x8014('0x2e')];_0x3d5873['model']=_[_0x8014('0x2f')](_0x4d01f7);_0x3d5873[_0x8014('0x30')]=_[_0x8014('0x2f')](_0x1533dd[_0x8014('0x30')]);_0x3d5873['filters']=_[_0x8014('0x31')](_0x3d5873[_0x8014('0x32')],_0x3d5873[_0x8014('0x30')]);_0x6dd011['attributes']=_[_0x8014('0x31')](_0x3d5873[_0x8014('0x32')],qs[_0x8014('0x33')](_0x1533dd[_0x8014('0x30')][_0x8014('0x33')]));_0x6dd011[_0x8014('0x34')]=_0x6dd011['attributes'][_0x8014('0x35')]?_0x6dd011[_0x8014('0x34')]:_0x3d5873[_0x8014('0x32')];if(!_0x1533dd['query'][_0x8014('0x36')](_0x8014('0x37'))){_0x6dd011[_0x8014('0x21')]=qs[_0x8014('0x21')](_0x1533dd[_0x8014('0x30')][_0x8014('0x21')]);_0x6dd011[_0x8014('0x20')]=qs[_0x8014('0x20')](_0x1533dd[_0x8014('0x30')][_0x8014('0x20')]);}_0x6dd011['order']=qs[_0x8014('0x38')](_0x1533dd[_0x8014('0x30')][_0x8014('0x38')]);_0x6dd011[_0x8014('0x39')]=qs[_0x8014('0x3a')](_[_0x8014('0x3b')](_0x1533dd['query'],_0x3d5873[_0x8014('0x3a')]));if(_0x1533dd[_0x8014('0x30')][_0x8014('0x3c')]){_0x6dd011['where']=_['merge'](_0x6dd011['where'],{'$or':_[_0x8014('0x3d')](_0x4d01f7,function(_0x36c80f){if(_0x36c80f[_0x8014('0x3e')]['key']!==_0x8014('0x3f')){var _0x4bc81c={};_0x4bc81c[_0x36c80f[_0x8014('0x40')]]={'$like':'%'+_0x1533dd[_0x8014('0x30')][_0x8014('0x3c')]+'%'};return _0x4bc81c;}})});}_0x6dd011=_[_0x8014('0x41')]({},_0x6dd011,_0x1533dd[_0x8014('0x42')]);var _0x4afad6={'where':_0x6dd011['where']};return db[_0x8014('0x2d')][_0x8014('0x43')](_0x4afad6)[_0x8014('0x26')](function(_0x3ce7e0){_0x1b34bb[_0x8014('0x43')]=_0x3ce7e0;if(_0x1533dd[_0x8014('0x30')][_0x8014('0x44')]){_0x6dd011[_0x8014('0x45')]=[{'all':!![]}];}return db['SquareProject'][_0x8014('0x46')](_0x6dd011);})[_0x8014('0x26')](function(_0x38e94e){_0x1b34bb[_0x8014('0x47')]=_0x38e94e;return _0x1b34bb;})[_0x8014('0x26')](respondWithFilteredResult(_0x47236f,_0x6dd011))['catch'](handleError(_0x47236f,null));};exports[_0x8014('0x48')]=function(_0x30ff5c,_0x58a60e){var _0x3aad06={'raw':![],'where':{'id':_0x30ff5c['params']['id']}},_0xe72017={};_0xe72017['model']=_[_0x8014('0x2f')](db[_0x8014('0x2d')]['rawAttributes']);_0xe72017[_0x8014('0x30')]=_['keys'](_0x30ff5c['query']);_0xe72017[_0x8014('0x3a')]=_[_0x8014('0x31')](_0xe72017[_0x8014('0x32')],_0xe72017[_0x8014('0x30')]);_0x3aad06['attributes']=_[_0x8014('0x31')](_0xe72017[_0x8014('0x32')],qs['fields'](_0x30ff5c[_0x8014('0x30')][_0x8014('0x33')]));_0x3aad06[_0x8014('0x34')]=_0x3aad06[_0x8014('0x34')][_0x8014('0x35')]?_0x3aad06[_0x8014('0x34')]:_0xe72017[_0x8014('0x32')];if(_0x30ff5c[_0x8014('0x30')][_0x8014('0x44')]){_0x3aad06[_0x8014('0x45')]=[{'all':!![]}];}_0x3aad06=_['merge']({},_0x3aad06,_0x30ff5c[_0x8014('0x42')]);return db[_0x8014('0x2d')]['find'](_0x3aad06)[_0x8014('0x26')](handleEntityNotFound(_0x58a60e,null))[_0x8014('0x26')](respondWithResult(_0x58a60e,null))[_0x8014('0x49')](handleError(_0x58a60e,null));};exports['create']=function(_0x3e3743,_0x295bdf){return db[_0x8014('0x2d')][_0x8014('0x4a')](_0x3e3743[_0x8014('0x4b')],{})[_0x8014('0x26')](function(_0x38619a){var _0x3a1531=_0x3e3743[_0x8014('0x4c')][_0x8014('0x28')]({'plain':!![]});if(!_0x3a1531)throw new Error(_0x8014('0x4d'));if(_0x3a1531[_0x8014('0x4e')]===_0x8014('0x4c')){var _0x4f3f7a=_0x38619a[_0x8014('0x28')]({'plain':!![]});var _0x26ae57=_0x8014('0x4f');return db['UserProfileSection']['find']({'where':{'name':_0x26ae57,'userProfileId':_0x3a1531[_0x8014('0x50')]},'raw':!![]})['then'](function(_0x144169){if(_0x144169&&_0x144169[_0x8014('0x51')]===0x0){return db['UserProfileResource']['create']({'name':_0x4f3f7a[_0x8014('0x2b')],'resourceId':_0x4f3f7a['id'],'type':_0x144169[_0x8014('0x2b')],'sectionId':_0x144169['id']},{})['then'](function(){return _0x38619a;});}else{return _0x38619a;}})[_0x8014('0x49')](function(_0x186fb8){logger[_0x8014('0x29')](_0x8014('0x52'),_0x186fb8);throw _0x186fb8;});}return _0x38619a;})[_0x8014('0x26')](respondWithResult(_0x295bdf,0xc9))[_0x8014('0x49')](handleError(_0x295bdf,null));};exports[_0x8014('0x25')]=function(_0x505dda,_0xf52081){if(_0x505dda[_0x8014('0x4b')]['id']){delete _0x505dda[_0x8014('0x4b')]['id'];}return db['SquareProject'][_0x8014('0x53')]({'where':{'id':_0x505dda[_0x8014('0x54')]['id']}})['then'](handleEntityNotFound(_0xf52081,null))['then'](saveUpdates(_0x505dda['body'],null))['then'](respondWithResult(_0xf52081,null))[_0x8014('0x49')](handleError(_0xf52081,null));};exports[_0x8014('0x27')]=function(_0x230517,_0x54ebbd){return db['SquareProject'][_0x8014('0x53')]({'where':{'id':_0x230517[_0x8014('0x54')]['id']}})[_0x8014('0x26')](handleEntityNotFound(_0x54ebbd,null))[_0x8014('0x26')](removeEntity(_0x54ebbd,null))['catch'](handleError(_0x54ebbd,null));};exports[_0x8014('0x55')]=function(_0x5e4e13,_0x6656a,_0x46d6e7){return db['SquareProject'][_0x8014('0x53')]({'where':{'id':_0x5e4e13[_0x8014('0x54')]['id']}})[_0x8014('0x26')](handleEntityNotFound(_0x6656a,null))[_0x8014('0x26')](function(_0x2c7c94){if(_0x2c7c94){return _0x2c7c94[_0x8014('0x55')](_0x5e4e13['body'][_0x8014('0x56')],_['omit'](_0x5e4e13[_0x8014('0x4b')],['ids','id'])||{});}})['then'](respondWithResult(_0x6656a,null))[_0x8014('0x49')](handleError(_0x6656a,null));};exports['removeUsers']=function(_0x12187c,_0x4b9bcf,_0x1f429c){return db['SquareProject'][_0x8014('0x53')]({'where':{'id':_0x12187c[_0x8014('0x54')]['id']}})[_0x8014('0x26')](handleEntityNotFound(_0x4b9bcf,null))[_0x8014('0x26')](function(_0x5dd157){if(_0x5dd157){return _0x5dd157[_0x8014('0x57')](_0x12187c[_0x8014('0x30')]['ids'])[_0x8014('0x26')](function(){if(_[_0x8014('0x58')](_0x12187c[_0x8014('0x30')]['ids'])){for(var _0x5bccaa=0x0;_0x5bccaa<_0x12187c['query'][_0x8014('0x56')]['length'];_0x5bccaa+=0x1){socket[_0x8014('0x59')](_0x8014('0x5a'),{'UserId':Number(_0x12187c[_0x8014('0x30')][_0x8014('0x56')][_0x5bccaa]),'SquareProjectId':Number(_0x12187c[_0x8014('0x54')]['id'])});}}else{socket[_0x8014('0x59')](_0x8014('0x5a'),{'UserId':Number(_0x12187c[_0x8014('0x30')]['ids']),'SquareProjectId':Number(_0x12187c[_0x8014('0x54')]['id'])});}});}})['then'](respondWithStatusCode(_0x4b9bcf,null))[_0x8014('0x49')](handleError(_0x4b9bcf,null));};exports['getUsers']=function(_0x19acea,_0x1a25da,_0x27427a){var _0x321a9b={};var _0x1b4778={};var _0x5073a9;var _0x5a4891;return db['SquareProject'][_0x8014('0x5b')]({'where':{'id':_0x19acea[_0x8014('0x54')]['id']}})['then'](handleEntityNotFound(_0x1a25da,null))[_0x8014('0x26')](function(_0x26d5df){if(_0x26d5df){_0x5073a9=_0x26d5df;_0x1b4778[_0x8014('0x32')]=_[_0x8014('0x2f')](db[_0x8014('0x5c')]['rawAttributes']);_0x1b4778[_0x8014('0x30')]=_[_0x8014('0x2f')](_0x19acea['query']);_0x1b4778[_0x8014('0x3a')]=_[_0x8014('0x31')](_0x1b4778[_0x8014('0x32')],_0x1b4778[_0x8014('0x30')]);_0x321a9b['attributes']=_['intersection'](_0x1b4778[_0x8014('0x32')],qs[_0x8014('0x33')](_0x19acea[_0x8014('0x30')][_0x8014('0x33')]));_0x321a9b[_0x8014('0x34')]=_0x321a9b[_0x8014('0x34')][_0x8014('0x35')]?_0x321a9b['attributes']:_0x1b4778[_0x8014('0x32')];_0x321a9b[_0x8014('0x5d')]=qs['sort'](_0x19acea[_0x8014('0x30')][_0x8014('0x38')]);_0x321a9b[_0x8014('0x39')]=qs['filters'](_['pick'](_0x19acea[_0x8014('0x30')],_0x1b4778[_0x8014('0x3a')]));if(_0x19acea['query'][_0x8014('0x3c')]){_0x321a9b[_0x8014('0x39')]=_[_0x8014('0x41')](_0x321a9b[_0x8014('0x39')],{'$or':_[_0x8014('0x3d')](_0x321a9b[_0x8014('0x34')],function(_0x329352){var _0x1f8f13={};_0x1f8f13[_0x329352]={'$like':'%'+_0x19acea[_0x8014('0x30')][_0x8014('0x3c')]+'%'};return _0x1f8f13;})});}_0x321a9b=_['merge']({},_0x321a9b,_0x19acea[_0x8014('0x42')]);return _0x5073a9[_0x8014('0x5e')](_0x321a9b);}})[_0x8014('0x26')](function(_0x3c39ac){if(_0x3c39ac){_0x5a4891=_0x3c39ac[_0x8014('0x35')];if(!_0x19acea[_0x8014('0x30')][_0x8014('0x36')](_0x8014('0x37'))){_0x321a9b[_0x8014('0x21')]=qs['limit'](_0x19acea[_0x8014('0x30')][_0x8014('0x21')]);_0x321a9b['offset']=qs[_0x8014('0x20')](_0x19acea['query'][_0x8014('0x20')]);}return _0x5073a9[_0x8014('0x5e')](_0x321a9b);}})[_0x8014('0x26')](function(_0x25eb2a){if(_0x25eb2a){return _0x25eb2a?{'count':_0x5a4891,'rows':_0x25eb2a}:null;}})[_0x8014('0x26')](respondWithResult(_0x1a25da,null))[_0x8014('0x49')](handleError(_0x1a25da,null));}; \ No newline at end of file +var _0xdaa1=['pick','map','getUsers','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../mysqldb','redis','socket.io-emitter','./squareProject.socket','register','status','end','count','limit','set','json','reject','update','then','destroy','get','sendStatus','error','stack','name','send','index','SquareProject','rawAttributes','model','keys','query','filters','fields','attributes','length','hasOwnProperty','offset','order','sort','filter','merge','where','type','key','VIRTUAL','field','includeAll','findAll','catch','show','intersection','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','addUsers','ids','omit','removeUsers','userSquareProject:remove','User'];(function(_0x3711e7,_0x29880f){var _0x234f2e=function(_0x50c5a0){while(--_0x50c5a0){_0x3711e7['push'](_0x3711e7['shift']());}};_0x234f2e(++_0x29880f);}(_0xdaa1,0xbb));var _0x1daa=function(_0x287976,_0x46cf91){_0x287976=_0x287976-0x0;var _0x12f7fd=_0xdaa1[_0x287976];return _0x12f7fd;};'use strict';var pdf=require(_0x1daa('0x0'));var emlformat=require(_0x1daa('0x1'));var rimraf=require(_0x1daa('0x2'));var zipdir=require(_0x1daa('0x3'));var jsonpatch=require(_0x1daa('0x4'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x1daa('0x5'));var Mustache=require(_0x1daa('0x6'));var util=require(_0x1daa('0x7'));var path=require('path');var sox=require(_0x1daa('0x8'));var csv=require(_0x1daa('0x9'));var ejs=require(_0x1daa('0xa'));var fs=require('fs');var _=require(_0x1daa('0xb'));var squel=require(_0x1daa('0xc'));var crypto=require(_0x1daa('0xd'));var jsforce=require(_0x1daa('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x1daa('0x9'));var querystring=require(_0x1daa('0xf'));var Papa=require(_0x1daa('0x10'));var Redis=require(_0x1daa('0x11'));var authService=require(_0x1daa('0x12'));var qs=require(_0x1daa('0x13'));var as=require(_0x1daa('0x14'));var hardwareService=require(_0x1daa('0x15'));var logger=require('../../config/logger')(_0x1daa('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x1daa('0x17'))['db'];config[_0x1daa('0x18')]=_['defaults'](config[_0x1daa('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0x1daa('0x19'))(new Redis(config[_0x1daa('0x18')]));require(_0x1daa('0x1a'))[_0x1daa('0x1b')](socket);function respondWithStatusCode(_0x761a7,_0x500a11){_0x500a11=_0x500a11||0xcc;return function(_0x38a368){if(_0x38a368){return _0x761a7['sendStatus'](_0x500a11);}return _0x761a7[_0x1daa('0x1c')](_0x500a11)[_0x1daa('0x1d')]();};}function respondWithResult(_0x128520,_0x2f34da){_0x2f34da=_0x2f34da||0xc8;return function(_0x4691a0){if(_0x4691a0){return _0x128520[_0x1daa('0x1c')](_0x2f34da)['json'](_0x4691a0);}};}function respondWithFilteredResult(_0x48a5e3,_0x3697be){return function(_0x42f70f){if(_0x42f70f){var _0x32dbbd=_0x42f70f[_0x1daa('0x1e')],_0x1f10cb=_0x3697be['offset'],_0x3e2b78=_0x3697be['offset']+_0x3697be[_0x1daa('0x1f')],_0x5355b1;if(_0x3e2b78>=_0x32dbbd){_0x3e2b78=_0x32dbbd;_0x5355b1=0xc8;}else{_0x5355b1=0xce;}_0x48a5e3[_0x1daa('0x1c')](_0x5355b1);return _0x48a5e3[_0x1daa('0x20')]('Content-Range',_0x1f10cb+'-'+_0x3e2b78+'/'+_0x32dbbd)[_0x1daa('0x21')](_0x42f70f);}return null;};}function patchUpdates(_0x4f9c76){return function(_0x11a9ba){try{jsonpatch['apply'](_0x11a9ba,_0x4f9c76,!![]);}catch(_0x30d743){return BPromise[_0x1daa('0x22')](_0x30d743);}return _0x11a9ba['save']();};}function saveUpdates(_0x1d00b0,_0x58044a){return function(_0x3d53d7){if(_0x3d53d7){return _0x3d53d7[_0x1daa('0x23')](_0x1d00b0)[_0x1daa('0x24')](function(_0x3abfbb){return _0x3abfbb;});}return null;};}function removeEntity(_0x1ea194,_0x46dcec){return function(_0xbc7fd5){if(_0xbc7fd5){return _0xbc7fd5[_0x1daa('0x25')]()[_0x1daa('0x24')](function(){var _0x3f047a=_0xbc7fd5[_0x1daa('0x26')]({'plain':!![]});var _0x2c4cc0='SquareProjects';return db['UserProfileResource'][_0x1daa('0x25')]({'where':{'type':_0x2c4cc0,'resourceId':_0x3f047a['id']}})[_0x1daa('0x24')](function(){return _0xbc7fd5;});})['then'](function(){_0x1ea194['status'](0xcc)[_0x1daa('0x1d')]();});}};}function handleEntityNotFound(_0x4745fb,_0x40f500){return function(_0x2dbd6e){if(!_0x2dbd6e){_0x4745fb[_0x1daa('0x27')](0x194);}return _0x2dbd6e;};}function handleError(_0x20e34f,_0x1e23cd){_0x1e23cd=_0x1e23cd||0x1f4;return function(_0x456c6e){logger[_0x1daa('0x28')](_0x456c6e[_0x1daa('0x29')]);if(_0x456c6e[_0x1daa('0x2a')]){delete _0x456c6e['name'];}_0x20e34f['status'](_0x1e23cd)[_0x1daa('0x2b')](_0x456c6e);};}exports[_0x1daa('0x2c')]=function(_0x5df588,_0x4ade18){var _0x515a99={},_0x5b95ac={},_0x19f548={'count':0x0,'rows':[]};var _0x1068ad=db[_0x1daa('0x2d')][_0x1daa('0x2e')];_0x5b95ac[_0x1daa('0x2f')]=_[_0x1daa('0x30')](_0x1068ad);_0x5b95ac[_0x1daa('0x31')]=_[_0x1daa('0x30')](_0x5df588[_0x1daa('0x31')]);_0x5b95ac[_0x1daa('0x32')]=_['intersection'](_0x5b95ac[_0x1daa('0x2f')],_0x5b95ac[_0x1daa('0x31')]);_0x515a99['attributes']=_['intersection'](_0x5b95ac['model'],qs[_0x1daa('0x33')](_0x5df588[_0x1daa('0x31')][_0x1daa('0x33')]));_0x515a99[_0x1daa('0x34')]=_0x515a99['attributes'][_0x1daa('0x35')]?_0x515a99[_0x1daa('0x34')]:_0x5b95ac[_0x1daa('0x2f')];if(!_0x5df588['query'][_0x1daa('0x36')]('nolimit')){_0x515a99[_0x1daa('0x1f')]=qs[_0x1daa('0x1f')](_0x5df588[_0x1daa('0x31')][_0x1daa('0x1f')]);_0x515a99[_0x1daa('0x37')]=qs['offset'](_0x5df588[_0x1daa('0x31')][_0x1daa('0x37')]);}_0x515a99[_0x1daa('0x38')]=qs['sort'](_0x5df588['query'][_0x1daa('0x39')]);_0x515a99['where']=qs[_0x1daa('0x32')](_['pick'](_0x5df588[_0x1daa('0x31')],_0x5b95ac[_0x1daa('0x32')]));if(_0x5df588[_0x1daa('0x31')][_0x1daa('0x3a')]){_0x515a99['where']=_[_0x1daa('0x3b')](_0x515a99[_0x1daa('0x3c')],{'$or':_['map'](_0x1068ad,function(_0x4a3be5){if(_0x4a3be5[_0x1daa('0x3d')][_0x1daa('0x3e')]!==_0x1daa('0x3f')){var _0x53a799={};_0x53a799[_0x4a3be5[_0x1daa('0x40')]]={'$like':'%'+_0x5df588[_0x1daa('0x31')]['filter']+'%'};return _0x53a799;}})});}_0x515a99=_['merge']({},_0x515a99,_0x5df588['options']);var _0x19dc57={'where':_0x515a99['where']};return db['SquareProject'][_0x1daa('0x1e')](_0x19dc57)[_0x1daa('0x24')](function(_0x3c5db2){_0x19f548[_0x1daa('0x1e')]=_0x3c5db2;if(_0x5df588['query'][_0x1daa('0x41')]){_0x515a99['include']=[{'all':!![]}];}return db[_0x1daa('0x2d')][_0x1daa('0x42')](_0x515a99);})[_0x1daa('0x24')](function(_0xd27742){_0x19f548['rows']=_0xd27742;return _0x19f548;})[_0x1daa('0x24')](respondWithFilteredResult(_0x4ade18,_0x515a99))[_0x1daa('0x43')](handleError(_0x4ade18,null));};exports[_0x1daa('0x44')]=function(_0x1bb610,_0x68ba16){var _0xa53ecf={'raw':![],'where':{'id':_0x1bb610['params']['id']}},_0x4d1b26={};_0x4d1b26[_0x1daa('0x2f')]=_['keys'](db[_0x1daa('0x2d')][_0x1daa('0x2e')]);_0x4d1b26[_0x1daa('0x31')]=_[_0x1daa('0x30')](_0x1bb610[_0x1daa('0x31')]);_0x4d1b26[_0x1daa('0x32')]=_['intersection'](_0x4d1b26[_0x1daa('0x2f')],_0x4d1b26[_0x1daa('0x31')]);_0xa53ecf['attributes']=_[_0x1daa('0x45')](_0x4d1b26[_0x1daa('0x2f')],qs[_0x1daa('0x33')](_0x1bb610[_0x1daa('0x31')]['fields']));_0xa53ecf[_0x1daa('0x34')]=_0xa53ecf[_0x1daa('0x34')][_0x1daa('0x35')]?_0xa53ecf[_0x1daa('0x34')]:_0x4d1b26[_0x1daa('0x2f')];if(_0x1bb610[_0x1daa('0x31')][_0x1daa('0x41')]){_0xa53ecf['include']=[{'all':!![]}];}_0xa53ecf=_['merge']({},_0xa53ecf,_0x1bb610[_0x1daa('0x46')]);return db['SquareProject'][_0x1daa('0x47')](_0xa53ecf)[_0x1daa('0x24')](handleEntityNotFound(_0x68ba16,null))[_0x1daa('0x24')](respondWithResult(_0x68ba16,null))[_0x1daa('0x43')](handleError(_0x68ba16,null));};exports[_0x1daa('0x48')]=function(_0x45a4e6,_0x47e65c){return db[_0x1daa('0x2d')][_0x1daa('0x48')](_0x45a4e6['body'],{})[_0x1daa('0x24')](function(_0x2d8541){var _0x6ffe58=_0x45a4e6[_0x1daa('0x49')][_0x1daa('0x26')]({'plain':!![]});if(!_0x6ffe58)throw new Error(_0x1daa('0x4a'));if(_0x6ffe58[_0x1daa('0x4b')]===_0x1daa('0x49')){var _0x3ad31b=_0x2d8541['get']({'plain':!![]});var _0x1e144e='SquareProjects';return db[_0x1daa('0x4c')][_0x1daa('0x47')]({'where':{'name':_0x1e144e,'userProfileId':_0x6ffe58[_0x1daa('0x4d')]},'raw':!![]})[_0x1daa('0x24')](function(_0x185dc){if(_0x185dc&&_0x185dc[_0x1daa('0x4e')]===0x0){return db[_0x1daa('0x4f')][_0x1daa('0x48')]({'name':_0x3ad31b[_0x1daa('0x2a')],'resourceId':_0x3ad31b['id'],'type':_0x185dc['name'],'sectionId':_0x185dc['id']},{})['then'](function(){return _0x2d8541;});}else{return _0x2d8541;}})['catch'](function(_0x3ba245){logger[_0x1daa('0x28')](_0x1daa('0x50'),_0x3ba245);throw _0x3ba245;});}return _0x2d8541;})[_0x1daa('0x24')](respondWithResult(_0x47e65c,0xc9))[_0x1daa('0x43')](handleError(_0x47e65c,null));};exports['update']=function(_0x2e4fe4,_0x1ff218){if(_0x2e4fe4['body']['id']){delete _0x2e4fe4[_0x1daa('0x51')]['id'];}return db[_0x1daa('0x2d')][_0x1daa('0x47')]({'where':{'id':_0x2e4fe4[_0x1daa('0x52')]['id']}})[_0x1daa('0x24')](handleEntityNotFound(_0x1ff218,null))[_0x1daa('0x24')](saveUpdates(_0x2e4fe4[_0x1daa('0x51')],null))[_0x1daa('0x24')](respondWithResult(_0x1ff218,null))[_0x1daa('0x43')](handleError(_0x1ff218,null));};exports['destroy']=function(_0x41e7ea,_0xae60a1){return db[_0x1daa('0x2d')][_0x1daa('0x47')]({'where':{'id':_0x41e7ea[_0x1daa('0x52')]['id']}})[_0x1daa('0x24')](handleEntityNotFound(_0xae60a1,null))[_0x1daa('0x24')](removeEntity(_0xae60a1,null))[_0x1daa('0x43')](handleError(_0xae60a1,null));};exports[_0x1daa('0x53')]=function(_0x32d5d2,_0x3fbaa6,_0x553a61){return db[_0x1daa('0x2d')]['find']({'where':{'id':_0x32d5d2[_0x1daa('0x52')]['id']}})['then'](handleEntityNotFound(_0x3fbaa6,null))[_0x1daa('0x24')](function(_0x2882f0){if(_0x2882f0){return _0x2882f0[_0x1daa('0x53')](_0x32d5d2[_0x1daa('0x51')][_0x1daa('0x54')],_[_0x1daa('0x55')](_0x32d5d2[_0x1daa('0x51')],[_0x1daa('0x54'),'id'])||{});}})[_0x1daa('0x24')](respondWithResult(_0x3fbaa6,null))[_0x1daa('0x43')](handleError(_0x3fbaa6,null));};exports[_0x1daa('0x56')]=function(_0x30216f,_0x178ef9,_0x15925c){return db[_0x1daa('0x2d')][_0x1daa('0x47')]({'where':{'id':_0x30216f[_0x1daa('0x52')]['id']}})[_0x1daa('0x24')](handleEntityNotFound(_0x178ef9,null))[_0x1daa('0x24')](function(_0x2da295){if(_0x2da295){return _0x2da295[_0x1daa('0x56')](_0x30216f[_0x1daa('0x31')][_0x1daa('0x54')])[_0x1daa('0x24')](function(){if(_['isArray'](_0x30216f['query']['ids'])){for(var _0x3a9ad7=0x0;_0x3a9ad7<_0x30216f[_0x1daa('0x31')][_0x1daa('0x54')][_0x1daa('0x35')];_0x3a9ad7+=0x1){socket['emit']('userSquareProject:remove',{'UserId':Number(_0x30216f[_0x1daa('0x31')][_0x1daa('0x54')][_0x3a9ad7]),'SquareProjectId':Number(_0x30216f[_0x1daa('0x52')]['id'])});}}else{socket['emit'](_0x1daa('0x57'),{'UserId':Number(_0x30216f[_0x1daa('0x31')]['ids']),'SquareProjectId':Number(_0x30216f[_0x1daa('0x52')]['id'])});}});}})[_0x1daa('0x24')](respondWithStatusCode(_0x178ef9,null))[_0x1daa('0x43')](handleError(_0x178ef9,null));};exports['getUsers']=function(_0x5a43e1,_0x35749c,_0x5d1154){var _0x3c9fb1={};var _0x2c4c50={};var _0x3c12e8;var _0x27fbda;return db[_0x1daa('0x2d')]['findOne']({'where':{'id':_0x5a43e1[_0x1daa('0x52')]['id']}})['then'](handleEntityNotFound(_0x35749c,null))[_0x1daa('0x24')](function(_0x13ce38){if(_0x13ce38){_0x3c12e8=_0x13ce38;_0x2c4c50[_0x1daa('0x2f')]=_[_0x1daa('0x30')](db[_0x1daa('0x58')][_0x1daa('0x2e')]);_0x2c4c50['query']=_[_0x1daa('0x30')](_0x5a43e1[_0x1daa('0x31')]);_0x2c4c50[_0x1daa('0x32')]=_[_0x1daa('0x45')](_0x2c4c50[_0x1daa('0x2f')],_0x2c4c50[_0x1daa('0x31')]);_0x3c9fb1[_0x1daa('0x34')]=_[_0x1daa('0x45')](_0x2c4c50[_0x1daa('0x2f')],qs['fields'](_0x5a43e1[_0x1daa('0x31')][_0x1daa('0x33')]));_0x3c9fb1[_0x1daa('0x34')]=_0x3c9fb1['attributes'][_0x1daa('0x35')]?_0x3c9fb1[_0x1daa('0x34')]:_0x2c4c50[_0x1daa('0x2f')];_0x3c9fb1['order']=qs[_0x1daa('0x39')](_0x5a43e1[_0x1daa('0x31')][_0x1daa('0x39')]);_0x3c9fb1['where']=qs[_0x1daa('0x32')](_[_0x1daa('0x59')](_0x5a43e1[_0x1daa('0x31')],_0x2c4c50[_0x1daa('0x32')]));if(_0x5a43e1[_0x1daa('0x31')][_0x1daa('0x3a')]){_0x3c9fb1[_0x1daa('0x3c')]=_[_0x1daa('0x3b')](_0x3c9fb1[_0x1daa('0x3c')],{'$or':_[_0x1daa('0x5a')](_0x3c9fb1[_0x1daa('0x34')],function(_0x50e46c){var _0x497dd5={};_0x497dd5[_0x50e46c]={'$like':'%'+_0x5a43e1['query']['filter']+'%'};return _0x497dd5;})});}_0x3c9fb1=_[_0x1daa('0x3b')]({},_0x3c9fb1,_0x5a43e1[_0x1daa('0x46')]);return _0x3c12e8[_0x1daa('0x5b')](_0x3c9fb1);}})[_0x1daa('0x24')](function(_0x1c60fb){if(_0x1c60fb){_0x27fbda=_0x1c60fb[_0x1daa('0x35')];if(!_0x5a43e1[_0x1daa('0x31')]['hasOwnProperty']('nolimit')){_0x3c9fb1[_0x1daa('0x1f')]=qs[_0x1daa('0x1f')](_0x5a43e1[_0x1daa('0x31')]['limit']);_0x3c9fb1[_0x1daa('0x37')]=qs['offset'](_0x5a43e1[_0x1daa('0x31')][_0x1daa('0x37')]);}return _0x3c12e8['getUsers'](_0x3c9fb1);}})[_0x1daa('0x24')](function(_0x2a9501){if(_0x2a9501){return _0x2a9501?{'count':_0x27fbda,'rows':_0x2a9501}:null;}})['then'](respondWithResult(_0x35749c,null))['catch'](handleError(_0x35749c,null));}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.events.js b/server/api/squareProject/squareProject.events.js index 551d4cd..68f5600 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 _0x4782=['emit','hasOwnProperty','events','../../mysqldb','update','remove'];(function(_0x4e6fc7,_0x6b9a5d){var _0x3c2ef6=function(_0x3907ed){while(--_0x3907ed){_0x4e6fc7['push'](_0x4e6fc7['shift']());}};_0x3c2ef6(++_0x6b9a5d);}(_0x4782,0x152));var _0x2478=function(_0x415d30,_0x4f6685){_0x415d30=_0x415d30-0x0;var _0xf20dc4=_0x4782[_0x415d30];return _0xf20dc4;};'use strict';var EventEmitter=require(_0x2478('0x0'));var SquareProject=require(_0x2478('0x1'))['db']['SquareProject'];var SquareProjectEvents=new EventEmitter();SquareProjectEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x2478('0x2'),'afterDestroy':_0x2478('0x3')};function emitEvent(_0xebd0a6){return function(_0x42752b,_0x3cd2e0,_0x4975d9){SquareProjectEvents[_0x2478('0x4')](_0xebd0a6+':'+_0x42752b['id'],_0x42752b);SquareProjectEvents[_0x2478('0x4')](_0xebd0a6,_0x42752b);_0x4975d9(null);};}for(var e in events){if(events[_0x2478('0x5')](e)){var event=events[e];SquareProject['hook'](e,emitEvent(event));}}module['exports']=SquareProjectEvents; \ No newline at end of file +var _0x568f=['hook','exports','events','../../mysqldb','SquareProject','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x1afeb0,_0x1ef64c){var _0xe6bed6=function(_0xbb6f95){while(--_0xbb6f95){_0x1afeb0['push'](_0x1afeb0['shift']());}};_0xe6bed6(++_0x1ef64c);}(_0x568f,0x183));var _0xf568=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x568f[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0xf568('0x0'));var SquareProject=require(_0xf568('0x1'))['db'][_0xf568('0x2')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0xf568('0x3')](0x0);var events={'afterCreate':_0xf568('0x4'),'afterUpdate':_0xf568('0x5'),'afterDestroy':_0xf568('0x6')};function emitEvent(_0x4a0d4d){return function(_0x489359,_0x65930a,_0xf227a7){SquareProjectEvents[_0xf568('0x7')](_0x4a0d4d+':'+_0x489359['id'],_0x489359);SquareProjectEvents[_0xf568('0x7')](_0x4a0d4d,_0x489359);_0xf227a7(null);};}for(var e in events){if(events[_0xf568('0x8')](e)){var event=events[e];SquareProject[_0xf568('0x9')](e,emitEvent(event));}}module[_0xf568('0xa')]=SquareProjectEvents; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.model.js b/server/api/squareProject/squareProject.model.js index 8dc94ef..c4643ed 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 _0x725d=['./squareProject.attributes','exports','SquareProject','square_projects','util','api','bluebird','path','rimraf','../../config/environment'];(function(_0x25f797,_0x449916){var _0x157fdd=function(_0x329fe1){while(--_0x329fe1){_0x25f797['push'](_0x25f797['shift']());}};_0x157fdd(++_0x449916);}(_0x725d,0x130));var _0xd725=function(_0x1822fc,_0x54e5fd){_0x1822fc=_0x1822fc-0x0;var _0x8214c3=_0x725d[_0x1822fc];return _0x8214c3;};'use strict';var _=require('lodash');var util=require(_0xd725('0x0'));var logger=require('../../config/logger')(_0xd725('0x1'));var moment=require('moment');var BPromise=require(_0xd725('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd725('0x3'));var rimraf=require(_0xd725('0x4'));var config=require(_0xd725('0x5'));var attributes=require(_0xd725('0x6'));module[_0xd725('0x7')]=function(_0x18cb1c,_0x12ba92){return _0x18cb1c['define'](_0xd725('0x8'),attributes,{'tableName':_0xd725('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3434=['define','SquareProject','square_projects','lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','exports'];(function(_0x3d8d95,_0x14d7d3){var _0x302f5b=function(_0x3416b9){while(--_0x3416b9){_0x3d8d95['push'](_0x3d8d95['shift']());}};_0x302f5b(++_0x14d7d3);}(_0x3434,0x93));var _0x4343=function(_0x47ff2b,_0x1d6486){_0x47ff2b=_0x47ff2b-0x0;var _0x167728=_0x3434[_0x47ff2b];return _0x167728;};'use strict';var _=require(_0x4343('0x0'));var util=require(_0x4343('0x1'));var logger=require(_0x4343('0x2'))('api');var moment=require(_0x4343('0x3'));var BPromise=require(_0x4343('0x4'));var rp=require(_0x4343('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4343('0x6'));var config=require(_0x4343('0x7'));var attributes=require('./squareProject.attributes');module[_0x4343('0x8')]=function(_0x23b94a,_0x596b6a){return _0x23b94a[_0x4343('0x9')](_0x4343('0xa'),attributes,{'tableName':_0x4343('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.rpc.js b/server/api/squareProject/squareProject.rpc.js index 545c7a1..a3bb38d 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 _0xf859=['options','where','attributes','include','map','model','debug','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','redis','localhost','socket.io-emitter','./squareProject.socket','register','request','then','request\x20sent','SquareProject,\x20%s,\x20%s,\x20%s','error','SquareProject,\x20%s,\x20%s','message','info','result','ShowSquareProject','SquareProject'];(function(_0x214207,_0x246c95){var _0xb5748e=function(_0x4c9ea5){while(--_0x4c9ea5){_0x214207['push'](_0x214207['shift']());}};_0xb5748e(++_0x246c95);}(_0xf859,0x1f2));var _0x9f85=function(_0x2c3e6f,_0x4c2d07){_0x2c3e6f=_0x2c3e6f-0x0;var _0x366dc1=_0xf859[_0x2c3e6f];return _0x366dc1;};'use strict';var _=require(_0x9f85('0x0'));var util=require(_0x9f85('0x1'));var moment=require(_0x9f85('0x2'));var BPromise=require(_0x9f85('0x3'));var rs=require(_0x9f85('0x4'));var fs=require('fs');var Redis=require(_0x9f85('0x5'));var db=require(_0x9f85('0x6'))['db'];var utils=require(_0x9f85('0x7'));var logger=require(_0x9f85('0x8'))('rpc');var config=require(_0x9f85('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x9f85('0xa')]({'port':0x232a});config[_0x9f85('0xb')]=_['defaults'](config[_0x9f85('0xb')],{'host':_0x9f85('0xc'),'port':0x18eb});var socket=require(_0x9f85('0xd'))(new Redis(config[_0x9f85('0xb')]));require(_0x9f85('0xe'))[_0x9f85('0xf')](socket);function respondWithRpcPromise(_0x248c95,_0x48486f,_0x3febea){return new BPromise(function(_0x37fa20,_0x4ca5f0){return client[_0x9f85('0x10')](_0x248c95,_0x3febea)[_0x9f85('0x11')](function(_0x832808){logger['info']('SquareProject,\x20%s,\x20%s',_0x48486f,_0x9f85('0x12'));logger['debug'](_0x9f85('0x13'),_0x48486f,_0x9f85('0x12'),JSON['stringify'](_0x832808));if(_0x832808[_0x9f85('0x14')]){if(_0x832808[_0x9f85('0x14')]['code']===0x1f4){logger[_0x9f85('0x14')](_0x9f85('0x15'),_0x48486f,_0x832808['error'][_0x9f85('0x16')]);return _0x4ca5f0(_0x832808['error'][_0x9f85('0x16')]);}logger[_0x9f85('0x14')](_0x9f85('0x15'),_0x48486f,_0x832808[_0x9f85('0x14')][_0x9f85('0x16')]);return _0x37fa20(_0x832808['error'][_0x9f85('0x16')]);}else{logger[_0x9f85('0x17')](_0x9f85('0x15'),_0x48486f,'request\x20sent');_0x37fa20(_0x832808[_0x9f85('0x18')][_0x9f85('0x16')]);}})['catch'](function(_0x3630ee){logger[_0x9f85('0x14')](_0x9f85('0x15'),_0x48486f,_0x3630ee);_0x4ca5f0(_0x3630ee);});});}exports[_0x9f85('0x19')]=function(_0xd076d9){var _0x185e02=this;return new Promise(function(_0x16c19c,_0x53c6f3){return db[_0x9f85('0x1a')]['find']({'raw':_0xd076d9['options']?_0xd076d9[_0x9f85('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0xd076d9['options']?_0xd076d9['options'][_0x9f85('0x1c')]||null:null,'attributes':_0xd076d9['options']?_0xd076d9[_0x9f85('0x1b')][_0x9f85('0x1d')]||null:null,'include':_0xd076d9[_0x9f85('0x1b')]?_0xd076d9[_0x9f85('0x1b')][_0x9f85('0x1e')]?_[_0x9f85('0x1f')](_0xd076d9[_0x9f85('0x1b')][_0x9f85('0x1e')],function(_0x5f157b){return{'model':db[_0x5f157b[_0x9f85('0x20')]],'as':_0x5f157b['as'],'attributes':_0x5f157b[_0x9f85('0x1d')],'include':_0x5f157b[_0x9f85('0x1e')]?_[_0x9f85('0x1f')](_0x5f157b[_0x9f85('0x1e')],function(_0xb3e766){return{'model':db[_0xb3e766[_0x9f85('0x20')]],'as':_0xb3e766['as'],'attributes':_0xb3e766[_0x9f85('0x1d')],'include':_0xb3e766[_0x9f85('0x1e')]?_[_0x9f85('0x1f')](_0xb3e766[_0x9f85('0x1e')],function(_0xc33e61){return{'model':db[_0xc33e61['model']],'as':_0xc33e61['as'],'attributes':_0xc33e61['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0xe9fe87){logger[_0x9f85('0x17')]('ShowSquareProject',_0xd076d9);logger[_0x9f85('0x21')](_0x9f85('0x19'),_0xd076d9,JSON[_0x9f85('0x22')](_0xe9fe87));_0x16c19c(_0xe9fe87);})['catch'](function(_0x156c19){logger[_0x9f85('0x14')](_0x9f85('0x19'),_0x156c19['message'],_0xd076d9);_0x53c6f3(_0x185e02[_0x9f85('0x14')](0x1f4,_0x156c19[_0x9f85('0x16')]));});});}; \ No newline at end of file +var _0x343c=['debug','SquareProject,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','ShowSquareProject','find','options','raw','where','attributes','include','map','model','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./squareProject.socket','register','request','then','info','SquareProject,\x20%s,\x20%s','request\x20sent'];(function(_0x8bd36e,_0x356088){var _0x562a81=function(_0x4a3ab1){while(--_0x4a3ab1){_0x8bd36e['push'](_0x8bd36e['shift']());}};_0x562a81(++_0x356088);}(_0x343c,0x1f0));var _0xc343=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x343c[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var util=require(_0xc343('0x0'));var moment=require(_0xc343('0x1'));var BPromise=require(_0xc343('0x2'));var rs=require(_0xc343('0x3'));var fs=require('fs');var Redis=require(_0xc343('0x4'));var db=require(_0xc343('0x5'))['db'];var utils=require(_0xc343('0x6'));var logger=require(_0xc343('0x7'))('rpc');var config=require(_0xc343('0x8'));var jayson=require(_0xc343('0x9'));var client=jayson['client'][_0xc343('0xa')]({'port':0x232a});config[_0xc343('0xb')]=_[_0xc343('0xc')](config[_0xc343('0xb')],{'host':_0xc343('0xd'),'port':0x18eb});var socket=require(_0xc343('0xe'))(new Redis(config['redis']));require(_0xc343('0xf'))[_0xc343('0x10')](socket);function respondWithRpcPromise(_0x5d6d9a,_0x2b85e8,_0x33a211){return new BPromise(function(_0x2e64d2,_0x2cbea9){return client[_0xc343('0x11')](_0x5d6d9a,_0x33a211)[_0xc343('0x12')](function(_0x2ee270){logger[_0xc343('0x13')](_0xc343('0x14'),_0x2b85e8,_0xc343('0x15'));logger[_0xc343('0x16')](_0xc343('0x17'),_0x2b85e8,_0xc343('0x15'),JSON[_0xc343('0x18')](_0x2ee270));if(_0x2ee270[_0xc343('0x19')]){if(_0x2ee270[_0xc343('0x19')]['code']===0x1f4){logger[_0xc343('0x19')](_0xc343('0x14'),_0x2b85e8,_0x2ee270[_0xc343('0x19')]['message']);return _0x2cbea9(_0x2ee270[_0xc343('0x19')][_0xc343('0x1a')]);}logger[_0xc343('0x19')]('SquareProject,\x20%s,\x20%s',_0x2b85e8,_0x2ee270[_0xc343('0x19')][_0xc343('0x1a')]);return _0x2e64d2(_0x2ee270[_0xc343('0x19')][_0xc343('0x1a')]);}else{logger['info'](_0xc343('0x14'),_0x2b85e8,_0xc343('0x15'));_0x2e64d2(_0x2ee270['result'][_0xc343('0x1a')]);}})[_0xc343('0x1b')](function(_0x36a58c){logger[_0xc343('0x19')](_0xc343('0x14'),_0x2b85e8,_0x36a58c);_0x2cbea9(_0x36a58c);});});}exports[_0xc343('0x1c')]=function(_0x275c94){var _0x3301c6=this;return new Promise(function(_0xdb856b,_0x6f4bfb){return db['SquareProject'][_0xc343('0x1d')]({'raw':_0x275c94[_0xc343('0x1e')]?_0x275c94[_0xc343('0x1e')][_0xc343('0x1f')]===undefined?!![]:![]:!![],'where':_0x275c94['options']?_0x275c94[_0xc343('0x1e')][_0xc343('0x20')]||null:null,'attributes':_0x275c94[_0xc343('0x1e')]?_0x275c94['options'][_0xc343('0x21')]||null:null,'include':_0x275c94[_0xc343('0x1e')]?_0x275c94[_0xc343('0x1e')][_0xc343('0x22')]?_[_0xc343('0x23')](_0x275c94[_0xc343('0x1e')][_0xc343('0x22')],function(_0x3d796a){return{'model':db[_0x3d796a[_0xc343('0x24')]],'as':_0x3d796a['as'],'attributes':_0x3d796a['attributes'],'include':_0x3d796a[_0xc343('0x22')]?_[_0xc343('0x23')](_0x3d796a[_0xc343('0x22')],function(_0xe6da70){return{'model':db[_0xe6da70[_0xc343('0x24')]],'as':_0xe6da70['as'],'attributes':_0xe6da70[_0xc343('0x21')],'include':_0xe6da70[_0xc343('0x22')]?_[_0xc343('0x23')](_0xe6da70[_0xc343('0x22')],function(_0x1ac4aa){return{'model':db[_0x1ac4aa[_0xc343('0x24')]],'as':_0x1ac4aa['as'],'attributes':_0x1ac4aa[_0xc343('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x35b69f){logger[_0xc343('0x13')](_0xc343('0x1c'),_0x275c94);logger[_0xc343('0x16')](_0xc343('0x1c'),_0x275c94,JSON[_0xc343('0x18')](_0x35b69f));_0xdb856b(_0x35b69f);})[_0xc343('0x1b')](function(_0x360b9f){logger['error'](_0xc343('0x1c'),_0x360b9f[_0xc343('0x1a')],_0x275c94);_0x6f4bfb(_0x3301c6[_0xc343('0x19')](0x1f4,_0x360b9f[_0xc343('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.socket.js b/server/api/squareProject/squareProject.socket.js index 1f7e6a2..712b3d2 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 _0x3f8a=['squareProject:','./squareProject.events','save','remove','update','emit','removeListener','register','length'];(function(_0x4f9ac5,_0xc36855){var _0x431dae=function(_0x53748c){while(--_0x53748c){_0x4f9ac5['push'](_0x4f9ac5['shift']());}};_0x431dae(++_0xc36855);}(_0x3f8a,0x1d5));var _0xa3f8=function(_0x546bbf,_0x26f2a2){_0x546bbf=_0x546bbf-0x0;var _0x40e3ca=_0x3f8a[_0x546bbf];return _0x40e3ca;};'use strict';var SquareProjectEvents=require(_0xa3f8('0x0'));var events=[_0xa3f8('0x1'),_0xa3f8('0x2'),_0xa3f8('0x3')];function createListener(_0x512b4c,_0x467a6c){return function(_0x143375){_0x467a6c[_0xa3f8('0x4')](_0x512b4c,_0x143375);};}function removeListener(_0x15b6aa,_0x2553fd){return function(){SquareProjectEvents[_0xa3f8('0x5')](_0x15b6aa,_0x2553fd);};}exports[_0xa3f8('0x6')]=function(_0x471464){for(var _0x1f160a=0x0,_0xf895d9=events[_0xa3f8('0x7')];_0x1f160a<_0xf895d9;_0x1f160a++){var _0x268332=events[_0x1f160a];var _0x2faf2e=createListener(_0xa3f8('0x8')+_0x268332,_0x471464);SquareProjectEvents['on'](_0x268332,_0x2faf2e);}}; \ No newline at end of file +var _0x7c09=['save','remove','emit','removeListener','length','squareProject:'];(function(_0x53f4dc,_0x572504){var _0x4df349=function(_0xcc732f){while(--_0xcc732f){_0x53f4dc['push'](_0x53f4dc['shift']());}};_0x4df349(++_0x572504);}(_0x7c09,0x102));var _0x97c0=function(_0x4be78d,_0x448275){_0x4be78d=_0x4be78d-0x0;var _0x13f521=_0x7c09[_0x4be78d];return _0x13f521;};'use strict';var SquareProjectEvents=require('./squareProject.events');var events=[_0x97c0('0x0'),_0x97c0('0x1'),'update'];function createListener(_0xfbf689,_0x7d8f6f){return function(_0x2d04b9){_0x7d8f6f[_0x97c0('0x2')](_0xfbf689,_0x2d04b9);};}function removeListener(_0x12eb6d,_0x99bf54){return function(){SquareProjectEvents[_0x97c0('0x3')](_0x12eb6d,_0x99bf54);};}exports['register']=function(_0x4b2f81){for(var _0x590368=0x0,_0x46fdd9=events[_0x97c0('0x4')];_0x590368<_0x46fdd9;_0x590368++){var _0x2c19fa=events[_0x590368];var _0x109bc8=createListener(_0x97c0('0x5')+_0x2c19fa,_0x4b2f81);SquareProjectEvents['on'](_0x2c19fa,_0x109bc8);}}; \ No newline at end of file diff --git a/server/api/squareRecording/index.js b/server/api/squareRecording/index.js index 8039442..5222c04 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 _0xdb28=['download','post','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareRecording.controller','isAuthenticated','index','show','get','/:id/download'];(function(_0x1f2037,_0x3b0ce4){var _0x38868f=function(_0x18d916){while(--_0x18d916){_0x1f2037['push'](_0x1f2037['shift']());}};_0x38868f(++_0x3b0ce4);}(_0xdb28,0x106));var _0x8db2=function(_0x4b09fd,_0x260510){_0x4b09fd=_0x4b09fd-0x0;var _0x3914c2=_0xdb28[_0x4b09fd];return _0x3914c2;};'use strict';var multer=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var path=require(_0x8db2('0x2'));var timeout=require(_0x8db2('0x3'));var express=require('express');var router=express[_0x8db2('0x4')]();var auth=require(_0x8db2('0x5'));var interaction=require(_0x8db2('0x6'));var config=require(_0x8db2('0x7'));var controller=require(_0x8db2('0x8'));router['get']('/',auth[_0x8db2('0x9')](),controller[_0x8db2('0xa')]);router['get']('/:id',auth[_0x8db2('0x9')](),controller[_0x8db2('0xb')]);router[_0x8db2('0xc')](_0x8db2('0xd'),auth[_0x8db2('0x9')](),controller[_0x8db2('0xe')]);router[_0x8db2('0xf')]('/',auth['isAuthenticated'](),controller[_0x8db2('0x10')]);router[_0x8db2('0x11')](_0x8db2('0x12'),auth['isAuthenticated'](),controller[_0x8db2('0x13')]);router[_0x8db2('0x14')]('/:id',auth[_0x8db2('0x9')](),controller[_0x8db2('0x15')]);module[_0x8db2('0x16')]=router; \ No newline at end of file +var _0xdb28=['download','post','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareRecording.controller','isAuthenticated','index','show','get','/:id/download'];(function(_0x1f2104,_0x3d1a56){var _0x590031=function(_0x16e37d){while(--_0x16e37d){_0x1f2104['push'](_0x1f2104['shift']());}};_0x590031(++_0x3d1a56);}(_0xdb28,0x106));var _0x8db2=function(_0xe379cc,_0xec028c){_0xe379cc=_0xe379cc-0x0;var _0xc95234=_0xdb28[_0xe379cc];return _0xc95234;};'use strict';var multer=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var path=require(_0x8db2('0x2'));var timeout=require(_0x8db2('0x3'));var express=require('express');var router=express[_0x8db2('0x4')]();var auth=require(_0x8db2('0x5'));var interaction=require(_0x8db2('0x6'));var config=require(_0x8db2('0x7'));var controller=require(_0x8db2('0x8'));router['get']('/',auth[_0x8db2('0x9')](),controller[_0x8db2('0xa')]);router['get']('/:id',auth[_0x8db2('0x9')](),controller[_0x8db2('0xb')]);router[_0x8db2('0xc')](_0x8db2('0xd'),auth[_0x8db2('0x9')](),controller[_0x8db2('0xe')]);router[_0x8db2('0xf')]('/',auth['isAuthenticated'](),controller[_0x8db2('0x10')]);router[_0x8db2('0x11')](_0x8db2('0x12'),auth['isAuthenticated'](),controller[_0x8db2('0x13')]);router[_0x8db2('0x14')]('/:id',auth[_0x8db2('0x9')](),controller[_0x8db2('0x15')]);module[_0x8db2('0x16')]=router; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.attributes.js b/server/api/squareRecording/squareRecording.attributes.js index a5516cc..4df3a56 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 _0xd3ec=['sequelize','exports','STRING'];(function(_0x244c92,_0x7a8ecb){var _0x56066b=function(_0x5c1b82){while(--_0x5c1b82){_0x244c92['push'](_0x244c92['shift']());}};_0x56066b(++_0x7a8ecb);}(_0xd3ec,0xf6));var _0xcd3e=function(_0x5f44ab,_0x46bf0b){_0x5f44ab=_0x5f44ab-0x0;var _0x23ccb3=_0xd3ec[_0x5f44ab];return _0x23ccb3;};'use strict';var Sequelize=require(_0xcd3e('0x0'));module[_0xcd3e('0x1')]={'uniqueid':{'type':Sequelize[_0xcd3e('0x2')]},'callerid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xcd3e('0x2')]},'context':{'type':Sequelize[_0xcd3e('0x2')]},'extension':{'type':Sequelize[_0xcd3e('0x2')]},'priority':{'type':Sequelize[_0xcd3e('0x2')]},'accountcode':{'type':Sequelize[_0xcd3e('0x2')]},'dnid':{'type':Sequelize['STRING']},'projectName':{'type':Sequelize[_0xcd3e('0x2')]},'saveName':{'type':Sequelize['STRING']},'filename':{'type':Sequelize['STRING']},'savePath':{'type':Sequelize[_0xcd3e('0x2')]}}; \ No newline at end of file +var _0xf5f1=['STRING','sequelize','exports'];(function(_0x34bf97,_0xc60f9d){var _0x292719=function(_0x31354e){while(--_0x31354e){_0x34bf97['push'](_0x34bf97['shift']());}};_0x292719(++_0xc60f9d);}(_0xf5f1,0x112));var _0x1f5f=function(_0x293187,_0x5790f0){_0x293187=_0x293187-0x0;var _0x2346db=_0xf5f1[_0x293187];return _0x2346db;};'use strict';var Sequelize=require(_0x1f5f('0x0'));module[_0x1f5f('0x1')]={'uniqueid':{'type':Sequelize[_0x1f5f('0x2')]},'callerid':{'type':Sequelize[_0x1f5f('0x2')]},'calleridname':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x1f5f('0x2')]},'extension':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x1f5f('0x2')]},'accountcode':{'type':Sequelize[_0x1f5f('0x2')]},'dnid':{'type':Sequelize[_0x1f5f('0x2')]},'projectName':{'type':Sequelize[_0x1f5f('0x2')]},'saveName':{'type':Sequelize[_0x1f5f('0x2')]},'filename':{'type':Sequelize[_0x1f5f('0x2')]},'savePath':{'type':Sequelize[_0x1f5f('0x2')]}}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.controller.js b/server/api/squareRecording/squareRecording.controller.js index aeaa7d7..4f99b26 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 _0x8861=['pick','filters','filter','where','merge','map','type','key','VIRTUAL','field','findAll','catch','show','params','includeAll','body','download','uniqueid','format','existsSync','decryptFile','secrets','recording','filename','unlink','SquareRecording\x20not\x20found','Not\x20found','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','count','offset','set','Content-Range','json','apply','save','update','then','destroy','error','stack','name','send','index','SquareRecording','rawAttributes','model','query','keys','intersection','fields','attributes','length','nolimit','limit','order','sort'];(function(_0x5d2338,_0x4d3336){var _0x1f2924=function(_0x3cd01b){while(--_0x3cd01b){_0x5d2338['push'](_0x5d2338['shift']());}};_0x1f2924(++_0x4d3336);}(_0x8861,0x6d));var _0x1886=function(_0x3bd139,_0x52a505){_0x3bd139=_0x3bd139-0x0;var _0xa9342a=_0x8861[_0x3bd139];return _0xa9342a;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x1886('0x0'));var zipdir=require(_0x1886('0x1'));var jsonpatch=require(_0x1886('0x2'));var rp=require(_0x1886('0x3'));var moment=require(_0x1886('0x4'));var BPromise=require(_0x1886('0x5'));var Mustache=require(_0x1886('0x6'));var util=require(_0x1886('0x7'));var path=require(_0x1886('0x8'));var sox=require(_0x1886('0x9'));var csv=require(_0x1886('0xa'));var ejs=require(_0x1886('0xb'));var fs=require('fs');var _=require(_0x1886('0xc'));var squel=require(_0x1886('0xd'));var crypto=require(_0x1886('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x1886('0xf'));var toCsv=require('to-csv');var querystring=require(_0x1886('0x10'));var Papa=require('papaparse');var Redis=require(_0x1886('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x1886('0x12'));var as=require(_0x1886('0x13'));var hardwareService=require(_0x1886('0x14'));var logger=require(_0x1886('0x15'))(_0x1886('0x16'));var utils=require(_0x1886('0x17'));var config=require('../../config/environment');var db=require(_0x1886('0x18'))['db'];function respondWithStatusCode(_0x3abb3c,_0x13a77f){_0x13a77f=_0x13a77f||0xcc;return function(_0x30c26a){if(_0x30c26a){return _0x3abb3c[_0x1886('0x19')](_0x13a77f);}return _0x3abb3c[_0x1886('0x1a')](_0x13a77f)['end']();};}function respondWithResult(_0x5d92b6,_0x26dcf9){_0x26dcf9=_0x26dcf9||0xc8;return function(_0x23ec3f){if(_0x23ec3f){return _0x5d92b6[_0x1886('0x1a')](_0x26dcf9)['json'](_0x23ec3f);}};}function respondWithFilteredResult(_0xb22f22,_0x43f020){return function(_0x3767ba){if(_0x3767ba){var _0x4993fe=_0x3767ba[_0x1886('0x1b')],_0x54d2ee=_0x43f020['offset'],_0x4083d5=_0x43f020[_0x1886('0x1c')]+_0x43f020['limit'],_0x5afc6b;if(_0x4083d5>=_0x4993fe){_0x4083d5=_0x4993fe;_0x5afc6b=0xc8;}else{_0x5afc6b=0xce;}_0xb22f22['status'](_0x5afc6b);return _0xb22f22[_0x1886('0x1d')](_0x1886('0x1e'),_0x54d2ee+'-'+_0x4083d5+'/'+_0x4993fe)[_0x1886('0x1f')](_0x3767ba);}return null;};}function patchUpdates(_0x3ce4ea){return function(_0x299859){try{jsonpatch[_0x1886('0x20')](_0x299859,_0x3ce4ea,!![]);}catch(_0x433507){return BPromise['reject'](_0x433507);}return _0x299859[_0x1886('0x21')]();};}function saveUpdates(_0x183579,_0x49dc6c){return function(_0x3df84f){if(_0x3df84f){return _0x3df84f[_0x1886('0x22')](_0x183579)[_0x1886('0x23')](function(_0x5dc431){return _0x5dc431;});}return null;};}function removeEntity(_0x444d3c,_0x1b4fb0){return function(_0x257831){if(_0x257831){return _0x257831[_0x1886('0x24')]()[_0x1886('0x23')](function(){_0x444d3c['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3f7bb1,_0x345bd7){return function(_0x2e508c){if(!_0x2e508c){_0x3f7bb1[_0x1886('0x19')](0x194);}return _0x2e508c;};}function handleError(_0x2bf330,_0x5081b0){_0x5081b0=_0x5081b0||0x1f4;return function(_0x49822a){logger[_0x1886('0x25')](_0x49822a[_0x1886('0x26')]);if(_0x49822a[_0x1886('0x27')]){delete _0x49822a['name'];}_0x2bf330[_0x1886('0x1a')](_0x5081b0)[_0x1886('0x28')](_0x49822a);};}exports[_0x1886('0x29')]=function(_0x3e1b2c,_0x41fdcc){var _0x1a9ce3={},_0xcd0ac5={},_0x148cf5={'count':0x0,'rows':[]};var _0x8bcaf7=db[_0x1886('0x2a')][_0x1886('0x2b')];_0xcd0ac5[_0x1886('0x2c')]=_['keys'](_0x8bcaf7);_0xcd0ac5[_0x1886('0x2d')]=_[_0x1886('0x2e')](_0x3e1b2c[_0x1886('0x2d')]);_0xcd0ac5['filters']=_[_0x1886('0x2f')](_0xcd0ac5[_0x1886('0x2c')],_0xcd0ac5[_0x1886('0x2d')]);_0x1a9ce3['attributes']=_['intersection'](_0xcd0ac5['model'],qs[_0x1886('0x30')](_0x3e1b2c[_0x1886('0x2d')][_0x1886('0x30')]));_0x1a9ce3[_0x1886('0x31')]=_0x1a9ce3[_0x1886('0x31')][_0x1886('0x32')]?_0x1a9ce3['attributes']:_0xcd0ac5[_0x1886('0x2c')];if(!_0x3e1b2c[_0x1886('0x2d')]['hasOwnProperty'](_0x1886('0x33'))){_0x1a9ce3['limit']=qs['limit'](_0x3e1b2c[_0x1886('0x2d')][_0x1886('0x34')]);_0x1a9ce3[_0x1886('0x1c')]=qs[_0x1886('0x1c')](_0x3e1b2c[_0x1886('0x2d')][_0x1886('0x1c')]);}_0x1a9ce3[_0x1886('0x35')]=qs[_0x1886('0x36')](_0x3e1b2c[_0x1886('0x2d')][_0x1886('0x36')]);_0x1a9ce3['where']=qs['filters'](_[_0x1886('0x37')](_0x3e1b2c['query'],_0xcd0ac5[_0x1886('0x38')]));if(_0x3e1b2c[_0x1886('0x2d')][_0x1886('0x39')]){_0x1a9ce3[_0x1886('0x3a')]=_[_0x1886('0x3b')](_0x1a9ce3[_0x1886('0x3a')],{'$or':_[_0x1886('0x3c')](_0x8bcaf7,function(_0x5b3e40){if(_0x5b3e40[_0x1886('0x3d')][_0x1886('0x3e')]!==_0x1886('0x3f')){var _0x22377e={};_0x22377e[_0x5b3e40[_0x1886('0x40')]]={'$like':'%'+_0x3e1b2c[_0x1886('0x2d')][_0x1886('0x39')]+'%'};return _0x22377e;}})});}_0x1a9ce3=_[_0x1886('0x3b')]({},_0x1a9ce3,_0x3e1b2c['options']);var _0x3a8bf0={'where':_0x1a9ce3[_0x1886('0x3a')]};return db[_0x1886('0x2a')][_0x1886('0x1b')](_0x3a8bf0)[_0x1886('0x23')](function(_0x4e50b4){_0x148cf5[_0x1886('0x1b')]=_0x4e50b4;if(_0x3e1b2c['query']['includeAll']){_0x1a9ce3['include']=[{'all':!![]}];}return db[_0x1886('0x2a')][_0x1886('0x41')](_0x1a9ce3);})['then'](function(_0x2b3223){_0x148cf5['rows']=_0x2b3223;return _0x148cf5;})['then'](respondWithFilteredResult(_0x41fdcc,_0x1a9ce3))[_0x1886('0x42')](handleError(_0x41fdcc,null));};exports[_0x1886('0x43')]=function(_0x446552,_0x3a3e88){var _0x2b8357={'raw':!![],'where':{'id':_0x446552[_0x1886('0x44')]['id']}},_0x4731de={};_0x4731de[_0x1886('0x2c')]=_[_0x1886('0x2e')](db[_0x1886('0x2a')][_0x1886('0x2b')]);_0x4731de[_0x1886('0x2d')]=_[_0x1886('0x2e')](_0x446552[_0x1886('0x2d')]);_0x4731de[_0x1886('0x38')]=_[_0x1886('0x2f')](_0x4731de[_0x1886('0x2c')],_0x4731de[_0x1886('0x2d')]);_0x2b8357[_0x1886('0x31')]=_[_0x1886('0x2f')](_0x4731de[_0x1886('0x2c')],qs[_0x1886('0x30')](_0x446552[_0x1886('0x2d')][_0x1886('0x30')]));_0x2b8357[_0x1886('0x31')]=_0x2b8357['attributes'][_0x1886('0x32')]?_0x2b8357['attributes']:_0x4731de[_0x1886('0x2c')];if(_0x446552['query'][_0x1886('0x45')]){_0x2b8357['include']=[{'all':!![]}];}_0x2b8357=_[_0x1886('0x3b')]({},_0x2b8357,_0x446552['options']);return db[_0x1886('0x2a')]['find'](_0x2b8357)[_0x1886('0x23')](handleEntityNotFound(_0x3a3e88,null))['then'](respondWithResult(_0x3a3e88,null))[_0x1886('0x42')](handleError(_0x3a3e88,null));};exports['create']=function(_0x3d8749,_0x5d83e7){return db[_0x1886('0x2a')]['create'](_0x3d8749[_0x1886('0x46')],{})[_0x1886('0x23')](respondWithResult(_0x5d83e7,0xc9))['catch'](handleError(_0x5d83e7,null));};exports[_0x1886('0x22')]=function(_0x2db88d,_0x2278da){if(_0x2db88d['body']['id']){delete _0x2db88d[_0x1886('0x46')]['id'];}return db[_0x1886('0x2a')]['find']({'where':{'id':_0x2db88d[_0x1886('0x44')]['id']}})[_0x1886('0x23')](handleEntityNotFound(_0x2278da,null))[_0x1886('0x23')](saveUpdates(_0x2db88d[_0x1886('0x46')],null))[_0x1886('0x23')](respondWithResult(_0x2278da,null))[_0x1886('0x42')](handleError(_0x2278da,null));};exports[_0x1886('0x24')]=function(_0x5022ae,_0xeeeab3){return db['SquareRecording']['find']({'where':{'id':_0x5022ae['params']['id']}})[_0x1886('0x23')](handleEntityNotFound(_0xeeeab3,null))[_0x1886('0x23')](removeEntity(_0xeeeab3,null))['catch'](handleError(_0xeeeab3,null));};exports[_0x1886('0x47')]=function(_0x3355ac,_0x36234c,_0x40c263){var _0x303a43=require('../../components/encryptor');var _0x198fe2=![];var _0x5c062b={};if(_0x3355ac[_0x1886('0x2d')][_0x1886('0x3d')]&&_0x3355ac[_0x1886('0x2d')][_0x1886('0x3d')]==='uniqueid'){_0x5c062b[_0x1886('0x48')]=_0x3355ac[_0x1886('0x44')]['id'];}else{_0x5c062b['id']=_0x3355ac['params']['id'];}return db['SquareRecording']['find']({'where':_0x5c062b,'attributes':['id','savePath','filename'],'raw':!![]})[_0x1886('0x23')](handleEntityNotFound(_0x36234c,null))['then'](function(_0x305b64){if(_0x305b64){var _0x4d883b=_0x305b64['savePath'];var _0x11707b=util[_0x1886('0x49')]('%s.cypher',_0x4d883b);if(fs[_0x1886('0x4a')](_0x11707b)){_0x198fe2=!![];return _0x303a43[_0x1886('0x4b')](_0x11707b,_0x4d883b,config[_0x1886('0x4c')][_0x1886('0x4d')])[_0x1886('0x23')](function(){return _0x305b64;});}return _0x305b64;}})[_0x1886('0x23')](function(_0x1735bb){if(_0x1735bb){var _0x20622d=_0x1735bb['savePath'];if(!fs[_0x1886('0x4a')](_0x20622d)){throw new db['Sequelize']['ValidationError']('SquareRecording\x20not\x20found');}if(_0x1735bb[_0x1886('0x4e')]){return _0x36234c['download'](_0x20622d,_0x1735bb[_0x1886('0x4e')]+path['extname'](_0x20622d),function(){if(_0x198fe2){fs['unlink'](_0x20622d);}});}else{return _0x36234c[_0x1886('0x47')](_0x20622d,function(_0x4edd14){if(_0x198fe2){fs[_0x1886('0x4f')](_0x20622d);}});}}})['catch'](function(_0x3be557){if(_0x3be557['message']===_0x1886('0x50')){_0x36234c[_0x1886('0x1a')](0x194)[_0x1886('0x28')](_0x1886('0x51'));}else{return handleError(_0x36234c,null);}});}; \ No newline at end of file +var _0x3d2f=['query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','map','type','key','VIRTUAL','field','options','SquareRecording','includeAll','include','params','intersection','find','catch','create','body','download','../../components/encryptor','uniqueid','savePath','filename','format','%s.cypher','secrets','Sequelize','ValidationError','SquareRecording\x20not\x20found','unlink','message','send','Not\x20found','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','end','error','name','index','rawAttributes','model','keys'];(function(_0x51b4d8,_0x9d770f){var _0x203bce=function(_0x525c90){while(--_0x525c90){_0x51b4d8['push'](_0x51b4d8['shift']());}};_0x203bce(++_0x9d770f);}(_0x3d2f,0x18f));var _0xf3d2=function(_0x1d3362,_0x534b74){_0x1d3362=_0x1d3362-0x0;var _0x2a4bde=_0x3d2f[_0x1d3362];return _0x2a4bde;};'use strict';var pdf=require(_0xf3d2('0x0'));var emlformat=require(_0xf3d2('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xf3d2('0x2'));var jsonpatch=require(_0xf3d2('0x3'));var rp=require(_0xf3d2('0x4'));var moment=require(_0xf3d2('0x5'));var BPromise=require(_0xf3d2('0x6'));var Mustache=require(_0xf3d2('0x7'));var util=require(_0xf3d2('0x8'));var path=require('path');var sox=require(_0xf3d2('0x9'));var csv=require(_0xf3d2('0xa'));var ejs=require(_0xf3d2('0xb'));var fs=require('fs');var _=require(_0xf3d2('0xc'));var squel=require(_0xf3d2('0xd'));var crypto=require('crypto');var jsforce=require(_0xf3d2('0xe'));var deskjs=require(_0xf3d2('0xf'));var toCsv=require('to-csv');var querystring=require(_0xf3d2('0x10'));var Papa=require('papaparse');var Redis=require(_0xf3d2('0x11'));var authService=require(_0xf3d2('0x12'));var qs=require(_0xf3d2('0x13'));var as=require(_0xf3d2('0x14'));var hardwareService=require(_0xf3d2('0x15'));var logger=require(_0xf3d2('0x16'))('api');var utils=require(_0xf3d2('0x17'));var config=require(_0xf3d2('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2c374f,_0x5aac69){_0x5aac69=_0x5aac69||0xcc;return function(_0xbe3353){if(_0xbe3353){return _0x2c374f[_0xf3d2('0x19')](_0x5aac69);}return _0x2c374f[_0xf3d2('0x1a')](_0x5aac69)['end']();};}function respondWithResult(_0x1f8589,_0x31d380){_0x31d380=_0x31d380||0xc8;return function(_0x25f46f){if(_0x25f46f){return _0x1f8589[_0xf3d2('0x1a')](_0x31d380)[_0xf3d2('0x1b')](_0x25f46f);}};}function respondWithFilteredResult(_0x4483d7,_0x589789){return function(_0x302110){if(_0x302110){var _0x892094=_0x302110[_0xf3d2('0x1c')],_0x3a43f6=_0x589789[_0xf3d2('0x1d')],_0x24cfc1=_0x589789[_0xf3d2('0x1d')]+_0x589789[_0xf3d2('0x1e')],_0x92ba9c;if(_0x24cfc1>=_0x892094){_0x24cfc1=_0x892094;_0x92ba9c=0xc8;}else{_0x92ba9c=0xce;}_0x4483d7['status'](_0x92ba9c);return _0x4483d7[_0xf3d2('0x1f')](_0xf3d2('0x20'),_0x3a43f6+'-'+_0x24cfc1+'/'+_0x892094)['json'](_0x302110);}return null;};}function patchUpdates(_0x1dfc9f){return function(_0x1e0046){try{jsonpatch[_0xf3d2('0x21')](_0x1e0046,_0x1dfc9f,!![]);}catch(_0x5a6f51){return BPromise[_0xf3d2('0x22')](_0x5a6f51);}return _0x1e0046[_0xf3d2('0x23')]();};}function saveUpdates(_0xbc222e,_0x22eb78){return function(_0x14c016){if(_0x14c016){return _0x14c016[_0xf3d2('0x24')](_0xbc222e)[_0xf3d2('0x25')](function(_0x2a1820){return _0x2a1820;});}return null;};}function removeEntity(_0x12b0d3,_0x232e80){return function(_0x5584ac){if(_0x5584ac){return _0x5584ac[_0xf3d2('0x26')]()[_0xf3d2('0x25')](function(){_0x12b0d3[_0xf3d2('0x1a')](0xcc)[_0xf3d2('0x27')]();});}};}function handleEntityNotFound(_0x31858c,_0x3d40ff){return function(_0x1d1b44){if(!_0x1d1b44){_0x31858c[_0xf3d2('0x19')](0x194);}return _0x1d1b44;};}function handleError(_0x11eed0,_0x5eadd6){_0x5eadd6=_0x5eadd6||0x1f4;return function(_0x140092){logger[_0xf3d2('0x28')](_0x140092['stack']);if(_0x140092[_0xf3d2('0x29')]){delete _0x140092['name'];}_0x11eed0[_0xf3d2('0x1a')](_0x5eadd6)['send'](_0x140092);};}exports[_0xf3d2('0x2a')]=function(_0x4654ec,_0x5d8319){var _0x5f298d={},_0x3ea85d={},_0x135191={'count':0x0,'rows':[]};var _0x179e23=db['SquareRecording'][_0xf3d2('0x2b')];_0x3ea85d[_0xf3d2('0x2c')]=_[_0xf3d2('0x2d')](_0x179e23);_0x3ea85d['query']=_[_0xf3d2('0x2d')](_0x4654ec[_0xf3d2('0x2e')]);_0x3ea85d['filters']=_['intersection'](_0x3ea85d[_0xf3d2('0x2c')],_0x3ea85d[_0xf3d2('0x2e')]);_0x5f298d[_0xf3d2('0x2f')]=_['intersection'](_0x3ea85d[_0xf3d2('0x2c')],qs[_0xf3d2('0x30')](_0x4654ec[_0xf3d2('0x2e')][_0xf3d2('0x30')]));_0x5f298d['attributes']=_0x5f298d['attributes'][_0xf3d2('0x31')]?_0x5f298d[_0xf3d2('0x2f')]:_0x3ea85d['model'];if(!_0x4654ec['query'][_0xf3d2('0x32')](_0xf3d2('0x33'))){_0x5f298d[_0xf3d2('0x1e')]=qs[_0xf3d2('0x1e')](_0x4654ec[_0xf3d2('0x2e')][_0xf3d2('0x1e')]);_0x5f298d[_0xf3d2('0x1d')]=qs[_0xf3d2('0x1d')](_0x4654ec[_0xf3d2('0x2e')][_0xf3d2('0x1d')]);}_0x5f298d[_0xf3d2('0x34')]=qs['sort'](_0x4654ec['query'][_0xf3d2('0x35')]);_0x5f298d[_0xf3d2('0x36')]=qs[_0xf3d2('0x37')](_[_0xf3d2('0x38')](_0x4654ec['query'],_0x3ea85d[_0xf3d2('0x37')]));if(_0x4654ec[_0xf3d2('0x2e')][_0xf3d2('0x39')]){_0x5f298d[_0xf3d2('0x36')]=_[_0xf3d2('0x3a')](_0x5f298d[_0xf3d2('0x36')],{'$or':_[_0xf3d2('0x3b')](_0x179e23,function(_0x5005e3){if(_0x5005e3[_0xf3d2('0x3c')][_0xf3d2('0x3d')]!==_0xf3d2('0x3e')){var _0x518e2d={};_0x518e2d[_0x5005e3[_0xf3d2('0x3f')]]={'$like':'%'+_0x4654ec[_0xf3d2('0x2e')]['filter']+'%'};return _0x518e2d;}})});}_0x5f298d=_['merge']({},_0x5f298d,_0x4654ec[_0xf3d2('0x40')]);var _0x39f2a3={'where':_0x5f298d[_0xf3d2('0x36')]};return db[_0xf3d2('0x41')][_0xf3d2('0x1c')](_0x39f2a3)[_0xf3d2('0x25')](function(_0x439c6c){_0x135191[_0xf3d2('0x1c')]=_0x439c6c;if(_0x4654ec['query'][_0xf3d2('0x42')]){_0x5f298d[_0xf3d2('0x43')]=[{'all':!![]}];}return db[_0xf3d2('0x41')]['findAll'](_0x5f298d);})[_0xf3d2('0x25')](function(_0x1e9d8e){_0x135191['rows']=_0x1e9d8e;return _0x135191;})[_0xf3d2('0x25')](respondWithFilteredResult(_0x5d8319,_0x5f298d))['catch'](handleError(_0x5d8319,null));};exports['show']=function(_0x10fd9e,_0x35f6a9){var _0x2f2dc1={'raw':!![],'where':{'id':_0x10fd9e[_0xf3d2('0x44')]['id']}},_0x108fdc={};_0x108fdc['model']=_[_0xf3d2('0x2d')](db[_0xf3d2('0x41')]['rawAttributes']);_0x108fdc['query']=_[_0xf3d2('0x2d')](_0x10fd9e[_0xf3d2('0x2e')]);_0x108fdc[_0xf3d2('0x37')]=_[_0xf3d2('0x45')](_0x108fdc['model'],_0x108fdc['query']);_0x2f2dc1[_0xf3d2('0x2f')]=_[_0xf3d2('0x45')](_0x108fdc[_0xf3d2('0x2c')],qs[_0xf3d2('0x30')](_0x10fd9e['query'][_0xf3d2('0x30')]));_0x2f2dc1[_0xf3d2('0x2f')]=_0x2f2dc1['attributes']['length']?_0x2f2dc1[_0xf3d2('0x2f')]:_0x108fdc[_0xf3d2('0x2c')];if(_0x10fd9e[_0xf3d2('0x2e')][_0xf3d2('0x42')]){_0x2f2dc1[_0xf3d2('0x43')]=[{'all':!![]}];}_0x2f2dc1=_[_0xf3d2('0x3a')]({},_0x2f2dc1,_0x10fd9e[_0xf3d2('0x40')]);return db[_0xf3d2('0x41')][_0xf3d2('0x46')](_0x2f2dc1)[_0xf3d2('0x25')](handleEntityNotFound(_0x35f6a9,null))['then'](respondWithResult(_0x35f6a9,null))[_0xf3d2('0x47')](handleError(_0x35f6a9,null));};exports[_0xf3d2('0x48')]=function(_0x2d0a88,_0x50339c){return db[_0xf3d2('0x41')][_0xf3d2('0x48')](_0x2d0a88[_0xf3d2('0x49')],{})[_0xf3d2('0x25')](respondWithResult(_0x50339c,0xc9))['catch'](handleError(_0x50339c,null));};exports[_0xf3d2('0x24')]=function(_0x35bea1,_0x24bef2){if(_0x35bea1[_0xf3d2('0x49')]['id']){delete _0x35bea1[_0xf3d2('0x49')]['id'];}return db[_0xf3d2('0x41')][_0xf3d2('0x46')]({'where':{'id':_0x35bea1[_0xf3d2('0x44')]['id']}})[_0xf3d2('0x25')](handleEntityNotFound(_0x24bef2,null))[_0xf3d2('0x25')](saveUpdates(_0x35bea1[_0xf3d2('0x49')],null))[_0xf3d2('0x25')](respondWithResult(_0x24bef2,null))[_0xf3d2('0x47')](handleError(_0x24bef2,null));};exports[_0xf3d2('0x26')]=function(_0x3be6c1,_0x213b33){return db[_0xf3d2('0x41')]['find']({'where':{'id':_0x3be6c1[_0xf3d2('0x44')]['id']}})[_0xf3d2('0x25')](handleEntityNotFound(_0x213b33,null))[_0xf3d2('0x25')](removeEntity(_0x213b33,null))[_0xf3d2('0x47')](handleError(_0x213b33,null));};exports[_0xf3d2('0x4a')]=function(_0x902184,_0x28a76d,_0x50e922){var _0x5abcf2=require(_0xf3d2('0x4b'));var _0x34ab14=![];var _0x1d64c0={};if(_0x902184[_0xf3d2('0x2e')][_0xf3d2('0x3c')]&&_0x902184[_0xf3d2('0x2e')][_0xf3d2('0x3c')]===_0xf3d2('0x4c')){_0x1d64c0['uniqueid']=_0x902184[_0xf3d2('0x44')]['id'];}else{_0x1d64c0['id']=_0x902184[_0xf3d2('0x44')]['id'];}return db[_0xf3d2('0x41')][_0xf3d2('0x46')]({'where':_0x1d64c0,'attributes':['id',_0xf3d2('0x4d'),_0xf3d2('0x4e')],'raw':!![]})[_0xf3d2('0x25')](handleEntityNotFound(_0x28a76d,null))[_0xf3d2('0x25')](function(_0x580fbf){if(_0x580fbf){var _0x4da774=_0x580fbf[_0xf3d2('0x4d')];var _0x2b56c2=util[_0xf3d2('0x4f')](_0xf3d2('0x50'),_0x4da774);if(fs['existsSync'](_0x2b56c2)){_0x34ab14=!![];return _0x5abcf2['decryptFile'](_0x2b56c2,_0x4da774,config[_0xf3d2('0x51')]['recording'])[_0xf3d2('0x25')](function(){return _0x580fbf;});}return _0x580fbf;}})['then'](function(_0x996395){if(_0x996395){var _0x1b78f6=_0x996395[_0xf3d2('0x4d')];if(!fs['existsSync'](_0x1b78f6)){throw new db[(_0xf3d2('0x52'))][(_0xf3d2('0x53'))](_0xf3d2('0x54'));}if(_0x996395[_0xf3d2('0x4e')]){return _0x28a76d[_0xf3d2('0x4a')](_0x1b78f6,_0x996395[_0xf3d2('0x4e')]+path['extname'](_0x1b78f6),function(){if(_0x34ab14){fs[_0xf3d2('0x55')](_0x1b78f6);}});}else{return _0x28a76d[_0xf3d2('0x4a')](_0x1b78f6,function(_0x1dacdb){if(_0x34ab14){fs['unlink'](_0x1b78f6);}});}}})[_0xf3d2('0x47')](function(_0x45073a){if(_0x45073a[_0xf3d2('0x56')]===_0xf3d2('0x54')){_0x28a76d['status'](0x194)[_0xf3d2('0x57')](_0xf3d2('0x58'));}else{return handleError(_0x28a76d,null);}});}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.model.js b/server/api/squareRecording/squareRecording.model.js index d9fc598..0931506 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 _0x5ed9=['moment','bluebird','request-promise','rimraf','../../config/environment','./squareRecording.attributes','define','SquareRecording','square_recordings','lodash','util','api'];(function(_0x2d2d37,_0x5778a6){var _0x55bbce=function(_0x319445){while(--_0x319445){_0x2d2d37['push'](_0x2d2d37['shift']());}};_0x55bbce(++_0x5778a6);}(_0x5ed9,0x1e9));var _0x95ed=function(_0x278e3c,_0x1c9cfd){_0x278e3c=_0x278e3c-0x0;var _0x3e2d9b=_0x5ed9[_0x278e3c];return _0x3e2d9b;};'use strict';var _=require(_0x95ed('0x0'));var util=require(_0x95ed('0x1'));var logger=require('../../config/logger')(_0x95ed('0x2'));var moment=require(_0x95ed('0x3'));var BPromise=require(_0x95ed('0x4'));var rp=require(_0x95ed('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x95ed('0x6'));var config=require(_0x95ed('0x7'));var attributes=require(_0x95ed('0x8'));module['exports']=function(_0x2c9009,_0x5a5117){return _0x2c9009[_0x95ed('0x9')](_0x95ed('0xa'),attributes,{'tableName':_0x95ed('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x958a=['bluebird','request-promise','path','../../config/environment','exports','define','SquareRecording','square_recordings','lodash','util','api','moment'];(function(_0x2aea9e,_0x1f587f){var _0x430b92=function(_0x416c37){while(--_0x416c37){_0x2aea9e['push'](_0x2aea9e['shift']());}};_0x430b92(++_0x1f587f);}(_0x958a,0x128));var _0xa958=function(_0x4a8e4f,_0x2595e6){_0x4a8e4f=_0x4a8e4f-0x0;var _0x4c6738=_0x958a[_0x4a8e4f];return _0x4c6738;};'use strict';var _=require(_0xa958('0x0'));var util=require(_0xa958('0x1'));var logger=require('../../config/logger')(_0xa958('0x2'));var moment=require(_0xa958('0x3'));var BPromise=require(_0xa958('0x4'));var rp=require(_0xa958('0x5'));var fs=require('fs');var path=require(_0xa958('0x6'));var rimraf=require('rimraf');var config=require(_0xa958('0x7'));var attributes=require('./squareRecording.attributes');module[_0xa958('0x8')]=function(_0x9b7d9e,_0x2692d6){return _0x9b7d9e[_0xa958('0x9')](_0xa958('0xa'),attributes,{'tableName':_0xa958('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.rpc.js b/server/api/squareRecording/squareRecording.rpc.js index 3074dad..2b8a282 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 _0xe3ea=['rpc','jayson/promise','client','then','info','SquareRecording,\x20%s,\x20%s','request\x20sent','debug','SquareRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateSquareRecording','SquareRecording','create','body','options','raw','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils'];(function(_0x2280c3,_0x54b106){var _0x21c470=function(_0x59dc1c){while(--_0x59dc1c){_0x2280c3['push'](_0x2280c3['shift']());}};_0x21c470(++_0x54b106);}(_0xe3ea,0xa1));var _0xae3e=function(_0x4a3bc4,_0x284e2e){_0x4a3bc4=_0x4a3bc4-0x0;var _0x1428c5=_0xe3ea[_0x4a3bc4];return _0x1428c5;};'use strict';var _=require(_0xae3e('0x0'));var util=require(_0xae3e('0x1'));var moment=require(_0xae3e('0x2'));var BPromise=require(_0xae3e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xae3e('0x4'));var db=require(_0xae3e('0x5'))['db'];var utils=require(_0xae3e('0x6'));var logger=require('../../config/logger')(_0xae3e('0x7'));var config=require('../../config/environment');var jayson=require(_0xae3e('0x8'));var client=jayson[_0xae3e('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3eda3a,_0x4a7ba7,_0x1e9014){return new BPromise(function(_0x5e43ca,_0x554d18){return client['request'](_0x3eda3a,_0x1e9014)[_0xae3e('0xa')](function(_0x169897){logger[_0xae3e('0xb')](_0xae3e('0xc'),_0x4a7ba7,_0xae3e('0xd'));logger[_0xae3e('0xe')](_0xae3e('0xf'),_0x4a7ba7,_0xae3e('0xd'),JSON[_0xae3e('0x10')](_0x169897));if(_0x169897[_0xae3e('0x11')]){if(_0x169897[_0xae3e('0x11')][_0xae3e('0x12')]===0x1f4){logger[_0xae3e('0x11')](_0xae3e('0xc'),_0x4a7ba7,_0x169897[_0xae3e('0x11')][_0xae3e('0x13')]);return _0x554d18(_0x169897[_0xae3e('0x11')][_0xae3e('0x13')]);}logger[_0xae3e('0x11')]('SquareRecording,\x20%s,\x20%s',_0x4a7ba7,_0x169897[_0xae3e('0x11')]['message']);return _0x5e43ca(_0x169897['error'][_0xae3e('0x13')]);}else{logger[_0xae3e('0xb')]('SquareRecording,\x20%s,\x20%s',_0x4a7ba7,_0xae3e('0xd'));_0x5e43ca(_0x169897[_0xae3e('0x14')][_0xae3e('0x13')]);}})[_0xae3e('0x15')](function(_0x56fb80){logger[_0xae3e('0x11')](_0xae3e('0xc'),_0x4a7ba7,_0x56fb80);_0x554d18(_0x56fb80);});});}exports[_0xae3e('0x16')]=function(_0x1b594b){var _0x360b72=this;return new Promise(function(_0x23a56d,_0x3476de){return db[_0xae3e('0x17')][_0xae3e('0x18')](_0x1b594b[_0xae3e('0x19')],{'raw':_0x1b594b[_0xae3e('0x1a')]?_0x1b594b[_0xae3e('0x1a')][_0xae3e('0x1b')]===undefined?!![]:![]:!![]})[_0xae3e('0xa')](function(_0x1225a5){logger['info'](_0xae3e('0x16'),_0x1b594b);logger[_0xae3e('0xe')]('CreateSquareRecording',_0x1b594b,JSON[_0xae3e('0x10')](_0x1225a5));_0x23a56d(_0x1225a5);})[_0xae3e('0x15')](function(_0x548a02){logger[_0xae3e('0x11')](_0xae3e('0x16'),_0x548a02[_0xae3e('0x13')],_0x1b594b);_0x3476de(_0x360b72['error'](0x1f4,_0x548a02['message']));});});}; \ No newline at end of file +var _0xd197=['randomstring','ioredis','../../config/logger','rpc','jayson/promise','request','then','SquareRecording,\x20%s,\x20%s','SquareRecording,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','catch','CreateSquareRecording','SquareRecording','options','raw','debug','stringify','lodash','util','moment'];(function(_0x1c2345,_0x70c3ee){var _0x3ce94c=function(_0x2d0b31){while(--_0x2d0b31){_0x1c2345['push'](_0x1c2345['shift']());}};_0x3ce94c(++_0x70c3ee);}(_0xd197,0x1bf));var _0x7d19=function(_0x2a0ae7,_0x54e8b9){_0x2a0ae7=_0x2a0ae7-0x0;var _0x4ca1e8=_0xd197[_0x2a0ae7];return _0x4ca1e8;};'use strict';var _=require(_0x7d19('0x0'));var util=require(_0x7d19('0x1'));var moment=require(_0x7d19('0x2'));var BPromise=require('bluebird');var rs=require(_0x7d19('0x3'));var fs=require('fs');var Redis=require(_0x7d19('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x7d19('0x5'))(_0x7d19('0x6'));var config=require('../../config/environment');var jayson=require(_0x7d19('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x15d55e,_0x3decc1,_0xf7229a){return new BPromise(function(_0x485c64,_0xc7b631){return client[_0x7d19('0x8')](_0x15d55e,_0xf7229a)[_0x7d19('0x9')](function(_0x3bd653){logger['info'](_0x7d19('0xa'),_0x3decc1,'request\x20sent');logger['debug'](_0x7d19('0xb'),_0x3decc1,_0x7d19('0xc'),JSON['stringify'](_0x3bd653));if(_0x3bd653[_0x7d19('0xd')]){if(_0x3bd653[_0x7d19('0xd')][_0x7d19('0xe')]===0x1f4){logger['error'](_0x7d19('0xa'),_0x3decc1,_0x3bd653[_0x7d19('0xd')][_0x7d19('0xf')]);return _0xc7b631(_0x3bd653[_0x7d19('0xd')]['message']);}logger['error'](_0x7d19('0xa'),_0x3decc1,_0x3bd653[_0x7d19('0xd')][_0x7d19('0xf')]);return _0x485c64(_0x3bd653['error'][_0x7d19('0xf')]);}else{logger[_0x7d19('0x10')](_0x7d19('0xa'),_0x3decc1,_0x7d19('0xc'));_0x485c64(_0x3bd653[_0x7d19('0x11')][_0x7d19('0xf')]);}})[_0x7d19('0x12')](function(_0x25c0ce){logger[_0x7d19('0xd')]('SquareRecording,\x20%s,\x20%s',_0x3decc1,_0x25c0ce);_0xc7b631(_0x25c0ce);});});}exports[_0x7d19('0x13')]=function(_0x9e2b7e){var _0x5d2a3c=this;return new Promise(function(_0x26dcc8,_0x8d558){return db[_0x7d19('0x14')]['create'](_0x9e2b7e['body'],{'raw':_0x9e2b7e[_0x7d19('0x15')]?_0x9e2b7e['options'][_0x7d19('0x16')]===undefined?!![]:![]:!![]})[_0x7d19('0x9')](function(_0x46286c){logger['info'](_0x7d19('0x13'),_0x9e2b7e);logger[_0x7d19('0x17')](_0x7d19('0x13'),_0x9e2b7e,JSON[_0x7d19('0x18')](_0x46286c));_0x26dcc8(_0x46286c);})[_0x7d19('0x12')](function(_0x2fda03){logger[_0x7d19('0xd')]('CreateSquareRecording',_0x2fda03[_0x7d19('0xf')],_0x9e2b7e);_0x8d558(_0x5d2a3c[_0x7d19('0xd')](0x1f4,_0x2fda03['message']));});});}; \ No newline at end of file diff --git a/server/api/squareReport/index.js b/server/api/squareReport/index.js index d5d75cf..624d02f 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 _0xfb7c=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x55bede,_0x4599b8){var _0x487bcf=function(_0x2f2178){while(--_0x2f2178){_0x55bede['push'](_0x55bede['shift']());}};_0x487bcf(++_0x4599b8);}(_0xfb7c,0xb9));var _0xcfb7=function(_0x53c6af,_0x5108f2){_0x53c6af=_0x53c6af-0x0;var _0x9cefc6=_0xfb7c[_0x53c6af];return _0x9cefc6;};'use strict';var multer=require(_0xcfb7('0x0'));var util=require(_0xcfb7('0x1'));var path=require(_0xcfb7('0x2'));var timeout=require(_0xcfb7('0x3'));var express=require(_0xcfb7('0x4'));var router=express[_0xcfb7('0x5')]();var auth=require(_0xcfb7('0x6'));var interaction=require(_0xcfb7('0x7'));var config=require(_0xcfb7('0x8'));var controller=require('./squareReport.controller');router[_0xcfb7('0x9')]('/',auth[_0xcfb7('0xa')](),controller[_0xcfb7('0xb')]);router[_0xcfb7('0x9')]('/describe',auth['isAuthenticated'](),controller['describe']);router['get'](_0xcfb7('0xc'),auth[_0xcfb7('0xa')](),controller[_0xcfb7('0xd')]);router[_0xcfb7('0xe')]('/',auth['isAuthenticated'](),controller[_0xcfb7('0xf')]);router[_0xcfb7('0x10')]('/:id',auth[_0xcfb7('0xa')](),controller[_0xcfb7('0x11')]);router[_0xcfb7('0x12')]('/:id',auth[_0xcfb7('0xa')](),controller[_0xcfb7('0x13')]);module[_0xcfb7('0x14')]=router; \ No newline at end of file +var _0x3643=['create','put','delete','destroy','path','connect-timeout','express','../../components/interaction/service','../../config/environment','./squareReport.controller','get','index','isAuthenticated','/:id','post'];(function(_0x2c3a88,_0x48637e){var _0x4a7925=function(_0x15780f){while(--_0x15780f){_0x2c3a88['push'](_0x2c3a88['shift']());}};_0x4a7925(++_0x48637e);}(_0x3643,0x199));var _0x3364=function(_0x4c77c6,_0x4db587){_0x4c77c6=_0x4c77c6-0x0;var _0x25808a=_0x3643[_0x4c77c6];return _0x25808a;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3364('0x0'));var timeout=require(_0x3364('0x1'));var express=require(_0x3364('0x2'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x3364('0x3'));var config=require(_0x3364('0x4'));var controller=require(_0x3364('0x5'));router[_0x3364('0x6')]('/',auth['isAuthenticated'](),controller[_0x3364('0x7')]);router[_0x3364('0x6')]('/describe',auth[_0x3364('0x8')](),controller['describe']);router[_0x3364('0x6')](_0x3364('0x9'),auth[_0x3364('0x8')](),controller['show']);router[_0x3364('0xa')]('/',auth['isAuthenticated'](),controller[_0x3364('0xb')]);router[_0x3364('0xc')](_0x3364('0x9'),auth[_0x3364('0x8')](),controller['update']);router[_0x3364('0xd')](_0x3364('0x9'),auth[_0x3364('0x8')](),controller[_0x3364('0xe')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.attributes.js b/server/api/squareReport/squareReport.attributes.js index 9b1f243..9f2188d 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 _0x4174=['sequelize','exports','STRING','DATE','BOOLEAN'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4174,0x154));var _0x4417=function(_0x174d5e,_0x18a9b2){_0x174d5e=_0x174d5e-0x0;var _0x55f4df=_0x4174[_0x174d5e];return _0x55f4df;};'use strict';var Sequelize=require(_0x4417('0x0'));module[_0x4417('0x1')]={'network':{'type':Sequelize[_0x4417('0x2')]},'network_script':{'type':Sequelize['STRING']},'request':{'type':Sequelize[_0x4417('0x2')]},'channel':{'type':Sequelize['STRING']},'language':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x4417('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'version':{'type':Sequelize[_0x4417('0x2')]},'callerid':{'type':Sequelize[_0x4417('0x2')]},'calleridname':{'type':Sequelize[_0x4417('0x2')]},'callingpres':{'type':Sequelize[_0x4417('0x2')]},'callingani2':{'type':Sequelize[_0x4417('0x2')]},'callington':{'type':Sequelize[_0x4417('0x2')]},'callingtns':{'type':Sequelize[_0x4417('0x2')]},'dnid':{'type':Sequelize[_0x4417('0x2')]},'rdnis':{'type':Sequelize[_0x4417('0x2')]},'context':{'type':Sequelize[_0x4417('0x2')]},'extension':{'type':Sequelize[_0x4417('0x2')]},'priority':{'type':Sequelize[_0x4417('0x2')]},'enhanced':{'type':Sequelize[_0x4417('0x2')]},'accountcode':{'type':Sequelize[_0x4417('0x2')]},'threadid':{'type':Sequelize[_0x4417('0x2')]},'project_name':{'type':Sequelize[_0x4417('0x2')]},'joinAt':{'type':Sequelize[_0x4417('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'bot':{'type':Sequelize[_0x4417('0x4')],'defaultValue':![]}}; \ No newline at end of file +var _0x71b7=['DATE','BOOLEAN','sequelize','exports','STRING'];(function(_0x75d143,_0x4ef4b0){var _0x2b89c1=function(_0x397487){while(--_0x397487){_0x75d143['push'](_0x75d143['shift']());}};_0x2b89c1(++_0x4ef4b0);}(_0x71b7,0x165));var _0x771b=function(_0x5742c4,_0x5d94fc){_0x5742c4=_0x5742c4-0x0;var _0x3eecc9=_0x71b7[_0x5742c4];return _0x3eecc9;};'use strict';var Sequelize=require(_0x771b('0x0'));module[_0x771b('0x1')]={'network':{'type':Sequelize['STRING']},'network_script':{'type':Sequelize[_0x771b('0x2')]},'request':{'type':Sequelize[_0x771b('0x2')]},'channel':{'type':Sequelize[_0x771b('0x2')]},'language':{'type':Sequelize[_0x771b('0x2')]},'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x771b('0x2')]},'version':{'type':Sequelize[_0x771b('0x2')]},'callerid':{'type':Sequelize[_0x771b('0x2')]},'calleridname':{'type':Sequelize[_0x771b('0x2')]},'callingpres':{'type':Sequelize[_0x771b('0x2')]},'callingani2':{'type':Sequelize['STRING']},'callington':{'type':Sequelize[_0x771b('0x2')]},'callingtns':{'type':Sequelize[_0x771b('0x2')]},'dnid':{'type':Sequelize['STRING']},'rdnis':{'type':Sequelize[_0x771b('0x2')]},'context':{'type':Sequelize[_0x771b('0x2')]},'extension':{'type':Sequelize[_0x771b('0x2')]},'priority':{'type':Sequelize['STRING']},'enhanced':{'type':Sequelize[_0x771b('0x2')]},'accountcode':{'type':Sequelize['STRING']},'threadid':{'type':Sequelize[_0x771b('0x2')]},'project_name':{'type':Sequelize[_0x771b('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x771b('0x3')]},'bot':{'type':Sequelize[_0x771b('0x4')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.controller.js b/server/api/squareReport/squareReport.controller.js index 486723a..d96fb4c 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 _0x814b=['sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','save','update','destroy','then','error','stack','name','send','index','SquareReport','model','keys','query','filters','attributes','fields','nolimit','order','sort','where','merge','map','type','key','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','intersection','length','options','create','body','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb'];(function(_0x34f9ec,_0x40195b){var _0x275a68=function(_0x132e88){while(--_0x132e88){_0x34f9ec['push'](_0x34f9ec['shift']());}};_0x275a68(++_0x40195b);}(_0x814b,0x1a2));var _0xb814=function(_0x1261c2,_0x3ef819){_0x1261c2=_0x1261c2-0x0;var _0x3aabd2=_0x814b[_0x1261c2];return _0x3aabd2;};'use strict';var pdf=require(_0xb814('0x0'));var emlformat=require(_0xb814('0x1'));var rimraf=require(_0xb814('0x2'));var zipdir=require(_0xb814('0x3'));var jsonpatch=require(_0xb814('0x4'));var rp=require(_0xb814('0x5'));var moment=require('moment');var BPromise=require(_0xb814('0x6'));var Mustache=require(_0xb814('0x7'));var util=require(_0xb814('0x8'));var path=require(_0xb814('0x9'));var sox=require(_0xb814('0xa'));var csv=require(_0xb814('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xb814('0xc'));var squel=require(_0xb814('0xd'));var crypto=require('crypto');var jsforce=require(_0xb814('0xe'));var deskjs=require(_0xb814('0xf'));var toCsv=require(_0xb814('0xb'));var querystring=require(_0xb814('0x10'));var Papa=require(_0xb814('0x11'));var Redis=require(_0xb814('0x12'));var authService=require(_0xb814('0x13'));var qs=require(_0xb814('0x14'));var as=require(_0xb814('0x15'));var hardwareService=require(_0xb814('0x16'));var logger=require(_0xb814('0x17'))('api');var utils=require(_0xb814('0x18'));var config=require('../../config/environment');var db=require(_0xb814('0x19'))['db'];function respondWithStatusCode(_0x15d6ef,_0x35b10d){_0x35b10d=_0x35b10d||0xcc;return function(_0x2cc46b){if(_0x2cc46b){return _0x15d6ef[_0xb814('0x1a')](_0x35b10d);}return _0x15d6ef[_0xb814('0x1b')](_0x35b10d)[_0xb814('0x1c')]();};}function respondWithResult(_0x41ed7b,_0xa0a2e5){_0xa0a2e5=_0xa0a2e5||0xc8;return function(_0x2ab627){if(_0x2ab627){return _0x41ed7b[_0xb814('0x1b')](_0xa0a2e5)[_0xb814('0x1d')](_0x2ab627);}};}function respondWithFilteredResult(_0x17f5bd,_0x39bfcf){return function(_0x303aca){if(_0x303aca){var _0x3a71d6=_0x303aca[_0xb814('0x1e')],_0x45e0d0=_0x39bfcf[_0xb814('0x1f')],_0x265a83=_0x39bfcf['offset']+_0x39bfcf[_0xb814('0x20')],_0x125ce2;if(_0x265a83>=_0x3a71d6){_0x265a83=_0x3a71d6;_0x125ce2=0xc8;}else{_0x125ce2=0xce;}_0x17f5bd['status'](_0x125ce2);return _0x17f5bd[_0xb814('0x21')](_0xb814('0x22'),_0x45e0d0+'-'+_0x265a83+'/'+_0x3a71d6)['json'](_0x303aca);}return null;};}function patchUpdates(_0x4b55a7){return function(_0x55d63c){try{jsonpatch[_0xb814('0x23')](_0x55d63c,_0x4b55a7,!![]);}catch(_0x4d5276){return BPromise['reject'](_0x4d5276);}return _0x55d63c[_0xb814('0x24')]();};}function saveUpdates(_0x24211d,_0x25b6b6){return function(_0x4e139e){if(_0x4e139e){return _0x4e139e[_0xb814('0x25')](_0x24211d)['then'](function(_0x1e6393){return _0x1e6393;});}return null;};}function removeEntity(_0x1808a3,_0x3b267e){return function(_0x470e81){if(_0x470e81){return _0x470e81[_0xb814('0x26')]()[_0xb814('0x27')](function(){_0x1808a3[_0xb814('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2ead86,_0x52b7a3){return function(_0x3f81d0){if(!_0x3f81d0){_0x2ead86[_0xb814('0x1a')](0x194);}return _0x3f81d0;};}function handleError(_0x31c7ec,_0x208927){_0x208927=_0x208927||0x1f4;return function(_0x1c8a2e){logger[_0xb814('0x28')](_0x1c8a2e[_0xb814('0x29')]);if(_0x1c8a2e['name']){delete _0x1c8a2e[_0xb814('0x2a')];}_0x31c7ec[_0xb814('0x1b')](_0x208927)[_0xb814('0x2b')](_0x1c8a2e);};}exports[_0xb814('0x2c')]=function(_0x32ed56,_0x1d5965){var _0x3f0150={},_0x1e4e89={},_0x5a6291={'count':0x0,'rows':[]};var _0x271aa8=db[_0xb814('0x2d')]['rawAttributes'];_0x1e4e89[_0xb814('0x2e')]=_[_0xb814('0x2f')](_0x271aa8);_0x1e4e89[_0xb814('0x30')]=_['keys'](_0x32ed56[_0xb814('0x30')]);_0x1e4e89[_0xb814('0x31')]=_['intersection'](_0x1e4e89[_0xb814('0x2e')],_0x1e4e89['query']);_0x3f0150[_0xb814('0x32')]=_['intersection'](_0x1e4e89['model'],qs[_0xb814('0x33')](_0x32ed56['query'][_0xb814('0x33')]));_0x3f0150[_0xb814('0x32')]=_0x3f0150[_0xb814('0x32')]['length']?_0x3f0150['attributes']:_0x1e4e89[_0xb814('0x2e')];if(!_0x32ed56[_0xb814('0x30')]['hasOwnProperty'](_0xb814('0x34'))){_0x3f0150[_0xb814('0x20')]=qs[_0xb814('0x20')](_0x32ed56[_0xb814('0x30')][_0xb814('0x20')]);_0x3f0150[_0xb814('0x1f')]=qs[_0xb814('0x1f')](_0x32ed56['query'][_0xb814('0x1f')]);}_0x3f0150[_0xb814('0x35')]=qs[_0xb814('0x36')](_0x32ed56[_0xb814('0x30')][_0xb814('0x36')]);_0x3f0150['where']=qs[_0xb814('0x31')](_['pick'](_0x32ed56[_0xb814('0x30')],_0x1e4e89[_0xb814('0x31')]));if(_0x32ed56[_0xb814('0x30')]['filter']){_0x3f0150[_0xb814('0x37')]=_[_0xb814('0x38')](_0x3f0150['where'],{'$or':_[_0xb814('0x39')](_0x271aa8,function(_0x2d0e27){if(_0x2d0e27[_0xb814('0x3a')][_0xb814('0x3b')]!==_0xb814('0x3c')){var _0x467cf9={};_0x467cf9[_0x2d0e27['field']]={'$like':'%'+_0x32ed56[_0xb814('0x30')]['filter']+'%'};return _0x467cf9;}})});}_0x3f0150=_[_0xb814('0x38')]({},_0x3f0150,_0x32ed56['options']);var _0x4492ef={'where':_0x3f0150['where']};return db[_0xb814('0x2d')][_0xb814('0x1e')](_0x4492ef)['then'](function(_0x4d308a){_0x5a6291['count']=_0x4d308a;if(_0x32ed56['query'][_0xb814('0x3d')]){_0x3f0150[_0xb814('0x3e')]=[{'all':!![]}];}return db[_0xb814('0x2d')][_0xb814('0x3f')](_0x3f0150);})['then'](function(_0x47d782){_0x5a6291[_0xb814('0x40')]=_0x47d782;return _0x5a6291;})['then'](respondWithFilteredResult(_0x1d5965,_0x3f0150))[_0xb814('0x41')](handleError(_0x1d5965,null));};exports[_0xb814('0x42')]=function(_0x178823,_0x3063bf){var _0x42653f={'raw':!![],'where':{'id':_0x178823[_0xb814('0x43')]['id']}},_0x37369f={};_0x37369f[_0xb814('0x2e')]=_[_0xb814('0x2f')](db['SquareReport']['rawAttributes']);_0x37369f['query']=_[_0xb814('0x2f')](_0x178823['query']);_0x37369f[_0xb814('0x31')]=_['intersection'](_0x37369f[_0xb814('0x2e')],_0x37369f[_0xb814('0x30')]);_0x42653f[_0xb814('0x32')]=_[_0xb814('0x44')](_0x37369f['model'],qs[_0xb814('0x33')](_0x178823[_0xb814('0x30')][_0xb814('0x33')]));_0x42653f[_0xb814('0x32')]=_0x42653f[_0xb814('0x32')][_0xb814('0x45')]?_0x42653f['attributes']:_0x37369f[_0xb814('0x2e')];if(_0x178823[_0xb814('0x30')][_0xb814('0x3d')]){_0x42653f[_0xb814('0x3e')]=[{'all':!![]}];}_0x42653f=_[_0xb814('0x38')]({},_0x42653f,_0x178823[_0xb814('0x46')]);return db[_0xb814('0x2d')]['find'](_0x42653f)['then'](handleEntityNotFound(_0x3063bf,null))[_0xb814('0x27')](respondWithResult(_0x3063bf,null))[_0xb814('0x41')](handleError(_0x3063bf,null));};exports[_0xb814('0x47')]=function(_0x2bf906,_0x43f1b){return db[_0xb814('0x2d')][_0xb814('0x47')](_0x2bf906[_0xb814('0x48')],{})[_0xb814('0x27')](respondWithResult(_0x43f1b,0xc9))[_0xb814('0x41')](handleError(_0x43f1b,null));};exports[_0xb814('0x25')]=function(_0x5c7a49,_0x37800a){if(_0x5c7a49[_0xb814('0x48')]['id']){delete _0x5c7a49['body']['id'];}return db[_0xb814('0x2d')]['find']({'where':{'id':_0x5c7a49[_0xb814('0x43')]['id']}})[_0xb814('0x27')](handleEntityNotFound(_0x37800a,null))[_0xb814('0x27')](saveUpdates(_0x5c7a49[_0xb814('0x48')],null))[_0xb814('0x27')](respondWithResult(_0x37800a,null))[_0xb814('0x41')](handleError(_0x37800a,null));};exports[_0xb814('0x26')]=function(_0x45480e,_0x32a397){return db[_0xb814('0x2d')]['find']({'where':{'id':_0x45480e['params']['id']}})[_0xb814('0x27')](handleEntityNotFound(_0x32a397,null))[_0xb814('0x27')](removeEntity(_0x32a397,null))[_0xb814('0x41')](handleError(_0x32a397,null));};exports[_0xb814('0x49')]=function(_0x1b565c,_0x37ffc6){return db[_0xb814('0x2d')]['describe']()[_0xb814('0x27')](respondWithResult(_0x37ffc6,null))[_0xb814('0x41')](handleError(_0x37ffc6,null));}; \ No newline at end of file +var _0x9957=['zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','limit','set','Content-Range','reject','save','then','destroy','error','stack','name','send','SquareReport','model','query','keys','attributes','intersection','fields','hasOwnProperty','nolimit','sort','where','filters','merge','map','type','key','VIRTUAL','field','filter','count','includeAll','include','findAll','rows','catch','show','params','rawAttributes','options','find','create','body','update','html-pdf','eml-format','rimraf'];(function(_0x1db9b0,_0x54c220){var _0xb216cb=function(_0xe2ff7c){while(--_0xe2ff7c){_0x1db9b0['push'](_0x1db9b0['shift']());}};_0xb216cb(++_0x54c220);}(_0x9957,0x93));var _0x7995=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9957[_0x3947c9];return _0x2e7871;};'use strict';var pdf=require(_0x7995('0x0'));var emlformat=require(_0x7995('0x1'));var rimraf=require(_0x7995('0x2'));var zipdir=require(_0x7995('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7995('0x4'));var moment=require(_0x7995('0x5'));var BPromise=require(_0x7995('0x6'));var Mustache=require(_0x7995('0x7'));var util=require('util');var path=require(_0x7995('0x8'));var sox=require(_0x7995('0x9'));var csv=require(_0x7995('0xa'));var ejs=require(_0x7995('0xb'));var fs=require('fs');var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var db=require(_0x7995('0x19'))['db'];function respondWithStatusCode(_0x2cb37a,_0x19a27e){_0x19a27e=_0x19a27e||0xcc;return function(_0x385f00){if(_0x385f00){return _0x2cb37a[_0x7995('0x1a')](_0x19a27e);}return _0x2cb37a[_0x7995('0x1b')](_0x19a27e)[_0x7995('0x1c')]();};}function respondWithResult(_0x4cc004,_0x58f5ad){_0x58f5ad=_0x58f5ad||0xc8;return function(_0x2b4e94){if(_0x2b4e94){return _0x4cc004[_0x7995('0x1b')](_0x58f5ad)[_0x7995('0x1d')](_0x2b4e94);}};}function respondWithFilteredResult(_0x321ae8,_0x3f1d3e){return function(_0x1a5310){if(_0x1a5310){var _0x2202ce=_0x1a5310['count'],_0x41cbf0=_0x3f1d3e[_0x7995('0x1e')],_0x5377e5=_0x3f1d3e[_0x7995('0x1e')]+_0x3f1d3e[_0x7995('0x1f')],_0x2eeacc;if(_0x5377e5>=_0x2202ce){_0x5377e5=_0x2202ce;_0x2eeacc=0xc8;}else{_0x2eeacc=0xce;}_0x321ae8[_0x7995('0x1b')](_0x2eeacc);return _0x321ae8[_0x7995('0x20')](_0x7995('0x21'),_0x41cbf0+'-'+_0x5377e5+'/'+_0x2202ce)['json'](_0x1a5310);}return null;};}function patchUpdates(_0x54c9ae){return function(_0x2536c8){try{jsonpatch['apply'](_0x2536c8,_0x54c9ae,!![]);}catch(_0x555f74){return BPromise[_0x7995('0x22')](_0x555f74);}return _0x2536c8[_0x7995('0x23')]();};}function saveUpdates(_0x4cbe10,_0x3a9b54){return function(_0x51f276){if(_0x51f276){return _0x51f276['update'](_0x4cbe10)[_0x7995('0x24')](function(_0x327b1f){return _0x327b1f;});}return null;};}function removeEntity(_0x350fd9,_0x1a8568){return function(_0x460924){if(_0x460924){return _0x460924[_0x7995('0x25')]()['then'](function(){_0x350fd9[_0x7995('0x1b')](0xcc)[_0x7995('0x1c')]();});}};}function handleEntityNotFound(_0x204507,_0x285437){return function(_0x563799){if(!_0x563799){_0x204507[_0x7995('0x1a')](0x194);}return _0x563799;};}function handleError(_0x475351,_0x472195){_0x472195=_0x472195||0x1f4;return function(_0x59405a){logger[_0x7995('0x26')](_0x59405a[_0x7995('0x27')]);if(_0x59405a[_0x7995('0x28')]){delete _0x59405a[_0x7995('0x28')];}_0x475351[_0x7995('0x1b')](_0x472195)[_0x7995('0x29')](_0x59405a);};}exports['index']=function(_0x47625f,_0x5911c3){var _0x229742={},_0x49bc7e={},_0xf16cc2={'count':0x0,'rows':[]};var _0x132a42=db[_0x7995('0x2a')]['rawAttributes'];_0x49bc7e[_0x7995('0x2b')]=_['keys'](_0x132a42);_0x49bc7e[_0x7995('0x2c')]=_[_0x7995('0x2d')](_0x47625f[_0x7995('0x2c')]);_0x49bc7e['filters']=_['intersection'](_0x49bc7e['model'],_0x49bc7e[_0x7995('0x2c')]);_0x229742[_0x7995('0x2e')]=_[_0x7995('0x2f')](_0x49bc7e[_0x7995('0x2b')],qs[_0x7995('0x30')](_0x47625f[_0x7995('0x2c')]['fields']));_0x229742['attributes']=_0x229742[_0x7995('0x2e')]['length']?_0x229742[_0x7995('0x2e')]:_0x49bc7e[_0x7995('0x2b')];if(!_0x47625f[_0x7995('0x2c')][_0x7995('0x31')](_0x7995('0x32'))){_0x229742['limit']=qs[_0x7995('0x1f')](_0x47625f[_0x7995('0x2c')]['limit']);_0x229742['offset']=qs['offset'](_0x47625f[_0x7995('0x2c')][_0x7995('0x1e')]);}_0x229742['order']=qs[_0x7995('0x33')](_0x47625f['query'][_0x7995('0x33')]);_0x229742[_0x7995('0x34')]=qs[_0x7995('0x35')](_['pick'](_0x47625f['query'],_0x49bc7e[_0x7995('0x35')]));if(_0x47625f['query']['filter']){_0x229742[_0x7995('0x34')]=_[_0x7995('0x36')](_0x229742['where'],{'$or':_[_0x7995('0x37')](_0x132a42,function(_0x1922b4){if(_0x1922b4[_0x7995('0x38')][_0x7995('0x39')]!==_0x7995('0x3a')){var _0x53002a={};_0x53002a[_0x1922b4[_0x7995('0x3b')]]={'$like':'%'+_0x47625f[_0x7995('0x2c')][_0x7995('0x3c')]+'%'};return _0x53002a;}})});}_0x229742=_[_0x7995('0x36')]({},_0x229742,_0x47625f['options']);var _0x2be2c0={'where':_0x229742[_0x7995('0x34')]};return db[_0x7995('0x2a')][_0x7995('0x3d')](_0x2be2c0)[_0x7995('0x24')](function(_0x1035dc){_0xf16cc2['count']=_0x1035dc;if(_0x47625f[_0x7995('0x2c')][_0x7995('0x3e')]){_0x229742[_0x7995('0x3f')]=[{'all':!![]}];}return db[_0x7995('0x2a')][_0x7995('0x40')](_0x229742);})[_0x7995('0x24')](function(_0x14d638){_0xf16cc2[_0x7995('0x41')]=_0x14d638;return _0xf16cc2;})[_0x7995('0x24')](respondWithFilteredResult(_0x5911c3,_0x229742))[_0x7995('0x42')](handleError(_0x5911c3,null));};exports[_0x7995('0x43')]=function(_0x270d52,_0x7b4e67){var _0x53cda2={'raw':!![],'where':{'id':_0x270d52[_0x7995('0x44')]['id']}},_0x50a98e={};_0x50a98e[_0x7995('0x2b')]=_['keys'](db['SquareReport'][_0x7995('0x45')]);_0x50a98e['query']=_['keys'](_0x270d52[_0x7995('0x2c')]);_0x50a98e[_0x7995('0x35')]=_[_0x7995('0x2f')](_0x50a98e['model'],_0x50a98e[_0x7995('0x2c')]);_0x53cda2['attributes']=_[_0x7995('0x2f')](_0x50a98e['model'],qs['fields'](_0x270d52[_0x7995('0x2c')][_0x7995('0x30')]));_0x53cda2[_0x7995('0x2e')]=_0x53cda2[_0x7995('0x2e')]['length']?_0x53cda2[_0x7995('0x2e')]:_0x50a98e[_0x7995('0x2b')];if(_0x270d52[_0x7995('0x2c')][_0x7995('0x3e')]){_0x53cda2['include']=[{'all':!![]}];}_0x53cda2=_['merge']({},_0x53cda2,_0x270d52[_0x7995('0x46')]);return db['SquareReport'][_0x7995('0x47')](_0x53cda2)['then'](handleEntityNotFound(_0x7b4e67,null))[_0x7995('0x24')](respondWithResult(_0x7b4e67,null))['catch'](handleError(_0x7b4e67,null));};exports[_0x7995('0x48')]=function(_0x1b0373,_0x4d9245){return db[_0x7995('0x2a')][_0x7995('0x48')](_0x1b0373[_0x7995('0x49')],{})[_0x7995('0x24')](respondWithResult(_0x4d9245,0xc9))['catch'](handleError(_0x4d9245,null));};exports[_0x7995('0x4a')]=function(_0x3e787d,_0x237270){if(_0x3e787d['body']['id']){delete _0x3e787d[_0x7995('0x49')]['id'];}return db[_0x7995('0x2a')][_0x7995('0x47')]({'where':{'id':_0x3e787d[_0x7995('0x44')]['id']}})[_0x7995('0x24')](handleEntityNotFound(_0x237270,null))['then'](saveUpdates(_0x3e787d[_0x7995('0x49')],null))[_0x7995('0x24')](respondWithResult(_0x237270,null))['catch'](handleError(_0x237270,null));};exports[_0x7995('0x25')]=function(_0x5843ba,_0x1d87f9){return db[_0x7995('0x2a')][_0x7995('0x47')]({'where':{'id':_0x5843ba[_0x7995('0x44')]['id']}})[_0x7995('0x24')](handleEntityNotFound(_0x1d87f9,null))[_0x7995('0x24')](removeEntity(_0x1d87f9,null))[_0x7995('0x42')](handleError(_0x1d87f9,null));};exports['describe']=function(_0x427dcf,_0x32f4be){return db[_0x7995('0x2a')]['describe']()[_0x7995('0x24')](respondWithResult(_0x32f4be,null))[_0x7995('0x42')](handleError(_0x32f4be,null));}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.model.js b/server/api/squareReport/squareReport.model.js index fe4f081..0f07aeb 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 _0x906c=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./squareReport.attributes','exports','define','SquareReport','report_square','uid_pname','uniqueid','project_name','leaveAt'];(function(_0x25d6b2,_0x1c4d28){var _0x4ea5a9=function(_0x429ea1){while(--_0x429ea1){_0x25d6b2['push'](_0x25d6b2['shift']());}};_0x4ea5a9(++_0x1c4d28);}(_0x906c,0xbe));var _0xc906=function(_0x4c79e7,_0x49969b){_0x4c79e7=_0x4c79e7-0x0;var _0x35a3c3=_0x906c[_0x4c79e7];return _0x35a3c3;};'use strict';var _=require(_0xc906('0x0'));var util=require(_0xc906('0x1'));var logger=require(_0xc906('0x2'))(_0xc906('0x3'));var moment=require(_0xc906('0x4'));var BPromise=require(_0xc906('0x5'));var rp=require(_0xc906('0x6'));var fs=require('fs');var path=require(_0xc906('0x7'));var rimraf=require(_0xc906('0x8'));var config=require(_0xc906('0x9'));var attributes=require(_0xc906('0xa'));module[_0xc906('0xb')]=function(_0x1bc5a5,_0x3d393b){return _0x1bc5a5[_0xc906('0xc')](_0xc906('0xd'),attributes,{'tableName':_0xc906('0xe'),'paranoid':![],'indexes':[{'name':_0xc906('0xf'),'fields':[_0xc906('0x10'),_0xc906('0x11')]},{'name':_0xc906('0x12'),'fields':[_0xc906('0x12')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xf974=['./squareReport.attributes','exports','define','SquareReport','report_square','uniqueid','project_name','leaveAt','lodash','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment'];(function(_0x53bc30,_0x2c9f32){var _0x5a7579=function(_0x514db4){while(--_0x514db4){_0x53bc30['push'](_0x53bc30['shift']());}};_0x5a7579(++_0x2c9f32);}(_0xf974,0x1d8));var _0x4f97=function(_0xfe1d7c,_0x4b513b){_0xfe1d7c=_0xfe1d7c-0x0;var _0x1fc24c=_0xf974[_0xfe1d7c];return _0x1fc24c;};'use strict';var _=require(_0x4f97('0x0'));var util=require(_0x4f97('0x1'));var logger=require(_0x4f97('0x2'))(_0x4f97('0x3'));var moment=require('moment');var BPromise=require(_0x4f97('0x4'));var rp=require(_0x4f97('0x5'));var fs=require('fs');var path=require(_0x4f97('0x6'));var rimraf=require('rimraf');var config=require(_0x4f97('0x7'));var attributes=require(_0x4f97('0x8'));module[_0x4f97('0x9')]=function(_0xae05b9,_0x17b3c7){return _0xae05b9[_0x4f97('0xa')](_0x4f97('0xb'),attributes,{'tableName':_0x4f97('0xc'),'paranoid':![],'indexes':[{'name':'uid_pname','fields':[_0x4f97('0xd'),_0x4f97('0xe')]},{'name':_0x4f97('0xf'),'fields':['leaveAt']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.rpc.js b/server/api/squareReport/squareReport.rpc.js index bee3280..e2cbb44 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 _0xcbd7=['request\x20sent','SquareReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','CreateSquareReport','create','body','options','debug','catch','UpdateSquareReport','SquareReport','raw','where','attributes','limit','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','SquareReport,\x20%s,\x20%s'];(function(_0x17b6e3,_0x4522ed){var _0x3906f3=function(_0x430f87){while(--_0x430f87){_0x17b6e3['push'](_0x17b6e3['shift']());}};_0x3906f3(++_0x4522ed);}(_0xcbd7,0x19e));var _0x7cbd=function(_0x1ac1a8,_0x79eb6e){_0x1ac1a8=_0x1ac1a8-0x0;var _0x39cd63=_0xcbd7[_0x1ac1a8];return _0x39cd63;};'use strict';var _=require(_0x7cbd('0x0'));var util=require(_0x7cbd('0x1'));var moment=require('moment');var BPromise=require(_0x7cbd('0x2'));var rs=require(_0x7cbd('0x3'));var fs=require('fs');var Redis=require(_0x7cbd('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x7cbd('0x5'));var logger=require(_0x7cbd('0x6'))(_0x7cbd('0x7'));var config=require(_0x7cbd('0x8'));var jayson=require(_0x7cbd('0x9'));var client=jayson[_0x7cbd('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x27700d,_0x4c6cee,_0x58f75b){return new BPromise(function(_0x5d2512,_0x301864){return client[_0x7cbd('0xb')](_0x27700d,_0x58f75b)[_0x7cbd('0xc')](function(_0xbd0eef){logger[_0x7cbd('0xd')](_0x7cbd('0xe'),_0x4c6cee,_0x7cbd('0xf'));logger['debug'](_0x7cbd('0x10'),_0x4c6cee,_0x7cbd('0xf'),JSON[_0x7cbd('0x11')](_0xbd0eef));if(_0xbd0eef[_0x7cbd('0x12')]){if(_0xbd0eef[_0x7cbd('0x12')]['code']===0x1f4){logger[_0x7cbd('0x12')]('SquareReport,\x20%s,\x20%s',_0x4c6cee,_0xbd0eef[_0x7cbd('0x12')][_0x7cbd('0x13')]);return _0x301864(_0xbd0eef[_0x7cbd('0x12')][_0x7cbd('0x13')]);}logger[_0x7cbd('0x12')](_0x7cbd('0xe'),_0x4c6cee,_0xbd0eef['error'][_0x7cbd('0x13')]);return _0x5d2512(_0xbd0eef[_0x7cbd('0x12')][_0x7cbd('0x13')]);}else{logger['info'](_0x7cbd('0xe'),_0x4c6cee,'request\x20sent');_0x5d2512(_0xbd0eef[_0x7cbd('0x14')][_0x7cbd('0x13')]);}})['catch'](function(_0x3bf222){logger['error'](_0x7cbd('0xe'),_0x4c6cee,_0x3bf222);_0x301864(_0x3bf222);});});}exports[_0x7cbd('0x15')]=function(_0x4f7159){var _0x219dd3=this;return new Promise(function(_0x2c6c05,_0x5c9619){return db['SquareReport'][_0x7cbd('0x16')](_0x4f7159[_0x7cbd('0x17')],{'raw':_0x4f7159[_0x7cbd('0x18')]?_0x4f7159['options']['raw']===undefined?!![]:![]:!![]})[_0x7cbd('0xc')](function(_0x16f941){logger[_0x7cbd('0xd')](_0x7cbd('0x15'),_0x4f7159);logger[_0x7cbd('0x19')](_0x7cbd('0x15'),_0x4f7159,JSON['stringify'](_0x16f941));_0x2c6c05(_0x16f941);})[_0x7cbd('0x1a')](function(_0x344bd1){logger[_0x7cbd('0x12')](_0x7cbd('0x15'),_0x344bd1[_0x7cbd('0x13')],_0x4f7159);_0x5c9619(_0x219dd3[_0x7cbd('0x12')](0x1f4,_0x344bd1[_0x7cbd('0x13')]));});});};exports[_0x7cbd('0x1b')]=function(_0xa390cc){var _0x5a58b8=this;return new Promise(function(_0x203b09,_0x456923){return db[_0x7cbd('0x1c')]['update'](_0xa390cc['body'],{'raw':_0xa390cc[_0x7cbd('0x18')]?_0xa390cc[_0x7cbd('0x18')][_0x7cbd('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xa390cc[_0x7cbd('0x18')]?_0xa390cc[_0x7cbd('0x18')][_0x7cbd('0x1e')]||null:null,'attributes':_0xa390cc[_0x7cbd('0x18')]?_0xa390cc[_0x7cbd('0x18')][_0x7cbd('0x1f')]||null:null,'limit':_0xa390cc[_0x7cbd('0x18')]?_0xa390cc[_0x7cbd('0x18')][_0x7cbd('0x20')]||null:null})[_0x7cbd('0xc')](function(_0x226c8a){logger[_0x7cbd('0xd')](_0x7cbd('0x1b'),_0xa390cc);logger['debug'](_0x7cbd('0x1b'),_0xa390cc,JSON[_0x7cbd('0x11')](_0x226c8a));_0x203b09(_0x226c8a);})[_0x7cbd('0x1a')](function(_0x3352a6){logger[_0x7cbd('0x12')](_0x7cbd('0x1b'),_0x3352a6[_0x7cbd('0x13')],_0xa390cc);_0x456923(_0x5a58b8['error'](0x1f4,_0x3352a6[_0x7cbd('0x13')]));});});}; \ No newline at end of file +var _0xf74d=['error','code','message','SquareReport,\x20%s,\x20%s','result','SquareReport','create','body','options','raw','CreateSquareReport','catch','UpdateSquareReport','update','attributes','limit','util','moment','bluebird','randomstring','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify'];(function(_0x376718,_0x4c97de){var _0x1635e7=function(_0x28ac1a){while(--_0x28ac1a){_0x376718['push'](_0x376718['shift']());}};_0x1635e7(++_0x4c97de);}(_0xf74d,0x1e1));var _0xdf74=function(_0x1a4a7b,_0x480e12){_0x1a4a7b=_0x1a4a7b-0x0;var _0x1df136=_0xf74d[_0x1a4a7b];return _0x1df136;};'use strict';var _=require('lodash');var util=require(_0xdf74('0x0'));var moment=require(_0xdf74('0x1'));var BPromise=require(_0xdf74('0x2'));var rs=require(_0xdf74('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xdf74('0x4'));var config=require(_0xdf74('0x5'));var jayson=require(_0xdf74('0x6'));var client=jayson[_0xdf74('0x7')][_0xdf74('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x340fbe,_0x5a2a92,_0x43798e){return new BPromise(function(_0x381750,_0x23d434){return client[_0xdf74('0x9')](_0x340fbe,_0x43798e)[_0xdf74('0xa')](function(_0x24624f){logger[_0xdf74('0xb')]('SquareReport,\x20%s,\x20%s',_0x5a2a92,_0xdf74('0xc'));logger[_0xdf74('0xd')]('SquareReport,\x20%s,\x20%s,\x20%s',_0x5a2a92,_0xdf74('0xc'),JSON[_0xdf74('0xe')](_0x24624f));if(_0x24624f[_0xdf74('0xf')]){if(_0x24624f[_0xdf74('0xf')][_0xdf74('0x10')]===0x1f4){logger[_0xdf74('0xf')]('SquareReport,\x20%s,\x20%s',_0x5a2a92,_0x24624f[_0xdf74('0xf')][_0xdf74('0x11')]);return _0x23d434(_0x24624f[_0xdf74('0xf')][_0xdf74('0x11')]);}logger[_0xdf74('0xf')]('SquareReport,\x20%s,\x20%s',_0x5a2a92,_0x24624f[_0xdf74('0xf')][_0xdf74('0x11')]);return _0x381750(_0x24624f[_0xdf74('0xf')][_0xdf74('0x11')]);}else{logger[_0xdf74('0xb')](_0xdf74('0x12'),_0x5a2a92,_0xdf74('0xc'));_0x381750(_0x24624f[_0xdf74('0x13')]['message']);}})['catch'](function(_0x273ea2){logger[_0xdf74('0xf')](_0xdf74('0x12'),_0x5a2a92,_0x273ea2);_0x23d434(_0x273ea2);});});}exports['CreateSquareReport']=function(_0x4e72f8){var _0x107556=this;return new Promise(function(_0x27d283,_0x2475df){return db[_0xdf74('0x14')][_0xdf74('0x15')](_0x4e72f8[_0xdf74('0x16')],{'raw':_0x4e72f8['options']?_0x4e72f8[_0xdf74('0x17')][_0xdf74('0x18')]===undefined?!![]:![]:!![]})[_0xdf74('0xa')](function(_0xda0223){logger[_0xdf74('0xb')](_0xdf74('0x19'),_0x4e72f8);logger[_0xdf74('0xd')](_0xdf74('0x19'),_0x4e72f8,JSON[_0xdf74('0xe')](_0xda0223));_0x27d283(_0xda0223);})[_0xdf74('0x1a')](function(_0x4ab45c){logger[_0xdf74('0xf')](_0xdf74('0x19'),_0x4ab45c['message'],_0x4e72f8);_0x2475df(_0x107556['error'](0x1f4,_0x4ab45c[_0xdf74('0x11')]));});});};exports[_0xdf74('0x1b')]=function(_0x68865f){var _0x6d1d61=this;return new Promise(function(_0xa604e5,_0x1b0e5d){return db['SquareReport'][_0xdf74('0x1c')](_0x68865f[_0xdf74('0x16')],{'raw':_0x68865f[_0xdf74('0x17')]?_0x68865f[_0xdf74('0x17')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x68865f[_0xdf74('0x17')]?_0x68865f['options']['where']||null:null,'attributes':_0x68865f[_0xdf74('0x17')]?_0x68865f['options'][_0xdf74('0x1d')]||null:null,'limit':_0x68865f[_0xdf74('0x17')]?_0x68865f[_0xdf74('0x17')][_0xdf74('0x1e')]||null:null})[_0xdf74('0xa')](function(_0x2836f1){logger['info'](_0xdf74('0x1b'),_0x68865f);logger['debug'](_0xdf74('0x1b'),_0x68865f,JSON[_0xdf74('0xe')](_0x2836f1));_0xa604e5(_0x2836f1);})[_0xdf74('0x1a')](function(_0x1fd7ea){logger[_0xdf74('0xf')](_0xdf74('0x1b'),_0x1fd7ea[_0xdf74('0x11')],_0x68865f);_0x1b0e5d(_0x6d1d61[_0xdf74('0xf')](0x1f4,_0x1fd7ea[_0xdf74('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/index.js b/server/api/squareReportDetail/index.js index dfed2ee..6f88a9e 100644 --- a/server/api/squareReportDetail/index.js +++ b/server/api/squareReportDetail/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5f2f=['/describe','/:id','post','create','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index'];(function(_0x2026ee,_0x5d603c){var _0x16712a=function(_0x3ef4cb){while(--_0x3ef4cb){_0x2026ee['push'](_0x2026ee['shift']());}};_0x16712a(++_0x5d603c);}(_0x5f2f,0x73));var _0xf5f2=function(_0x38f0e8,_0x4a0681){_0x38f0e8=_0x38f0e8-0x0;var _0x514c0d=_0x5f2f[_0x38f0e8];return _0x514c0d;};'use strict';var multer=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var path=require(_0xf5f2('0x2'));var timeout=require(_0xf5f2('0x3'));var express=require(_0xf5f2('0x4'));var router=express[_0xf5f2('0x5')]();var auth=require(_0xf5f2('0x6'));var interaction=require(_0xf5f2('0x7'));var config=require('../../config/environment');var controller=require('./squareReportDetail.controller');router[_0xf5f2('0x8')]('/',auth[_0xf5f2('0x9')](),controller[_0xf5f2('0xa')]);router[_0xf5f2('0x8')](_0xf5f2('0xb'),auth[_0xf5f2('0x9')](),controller['describe']);router[_0xf5f2('0x8')](_0xf5f2('0xc'),auth[_0xf5f2('0x9')](),controller['show']);router[_0xf5f2('0xd')]('/',auth[_0xf5f2('0x9')](),controller[_0xf5f2('0xe')]);router['put'](_0xf5f2('0xc'),auth['isAuthenticated'](),controller['update']);router[_0xf5f2('0xf')](_0xf5f2('0xc'),auth['isAuthenticated'](),controller[_0xf5f2('0x10')]);module[_0xf5f2('0x11')]=router; \ No newline at end of file +var _0x814b=['path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./squareReportDetail.controller','get','isAuthenticated','index','/describe','/:id','show','post','create','put','update','destroy','exports','multer','util'];(function(_0x122096,_0x60c295){var _0x3d1966=function(_0x3d569e){while(--_0x3d569e){_0x122096['push'](_0x122096['shift']());}};_0x3d1966(++_0x60c295);}(_0x814b,0x1a2));var _0xb814=function(_0x122096,_0x60c295){_0x122096=_0x122096-0x0;var _0x3d1966=_0x814b[_0x122096];return _0x3d1966;};'use strict';var multer=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var path=require(_0xb814('0x2'));var timeout=require(_0xb814('0x3'));var express=require(_0xb814('0x4'));var router=express[_0xb814('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0xb814('0x6'));var config=require(_0xb814('0x7'));var controller=require(_0xb814('0x8'));router[_0xb814('0x9')]('/',auth[_0xb814('0xa')](),controller[_0xb814('0xb')]);router['get'](_0xb814('0xc'),auth[_0xb814('0xa')](),controller['describe']);router[_0xb814('0x9')](_0xb814('0xd'),auth[_0xb814('0xa')](),controller[_0xb814('0xe')]);router[_0xb814('0xf')]('/',auth[_0xb814('0xa')](),controller[_0xb814('0x10')]);router[_0xb814('0x11')](_0xb814('0xd'),auth[_0xb814('0xa')](),controller[_0xb814('0x12')]);router['delete'](_0xb814('0xd'),auth['isAuthenticated'](),controller[_0xb814('0x13')]);module[_0xb814('0x14')]=router; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.attributes.js b/server/api/squareReportDetail/squareReportDetail.attributes.js index 7812e7b..99cf311 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 _0xe456=['STRING','TEXT'];(function(_0x5bcb23,_0xbe6a50){var _0x8e4b61=function(_0x54bdf4){while(--_0x54bdf4){_0x5bcb23['push'](_0x5bcb23['shift']());}};_0x8e4b61(++_0xbe6a50);}(_0xe456,0xd6));var _0x6e45=function(_0x5bc648,_0x4b44f0){_0x5bc648=_0x5bc648-0x0;var _0x38052a=_0xe456[_0x5bc648];return _0x38052a;};'use strict';var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0x6e45('0x0')]},'node':{'type':Sequelize[_0x6e45('0x0')]},'application':{'type':Sequelize[_0x6e45('0x0')]},'data':{'type':Sequelize[_0x6e45('0x1')]},'project_name':{'type':Sequelize[_0x6e45('0x0')]},'callerid':{'type':Sequelize[_0x6e45('0x0')]}}; \ No newline at end of file +var _0x746f=['exports','STRING','TEXT','sequelize'];(function(_0x580576,_0x2f107d){var _0x3f55a0=function(_0x2e180b){while(--_0x2e180b){_0x580576['push'](_0x580576['shift']());}};_0x3f55a0(++_0x2f107d);}(_0x746f,0xaf));var _0xf746=function(_0x15a0fd,_0x36d103){_0x15a0fd=_0x15a0fd-0x0;var _0x4ba725=_0x746f[_0x15a0fd];return _0x4ba725;};'use strict';var Sequelize=require(_0xf746('0x0'));module[_0xf746('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'node':{'type':Sequelize[_0xf746('0x2')]},'application':{'type':Sequelize[_0xf746('0x2')]},'data':{'type':Sequelize[_0xf746('0x3')]},'project_name':{'type':Sequelize[_0xf746('0x2')]},'callerid':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.controller.js b/server/api/squareReportDetail/squareReportDetail.controller.js index 4fbfe7c..f5f0a45 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 _0x4487=['zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','set','json','apply','reject','save','then','destroy','error','stack','name','send','index','SquareDetailsReport','rawAttributes','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','sort','pick','filter','where','merge','type','key','VIRTUAL','field','options','include','findAll','rows','catch','show','includeAll','find','create','body','params','describe','eml-format'];(function(_0x3bcdb0,_0x49cdd7){var _0x57528d=function(_0x4dd5f0){while(--_0x4dd5f0){_0x3bcdb0['push'](_0x3bcdb0['shift']());}};_0x57528d(++_0x49cdd7);}(_0x4487,0x127));var _0x7448=function(_0x5a9c0c,_0x4ec485){_0x5a9c0c=_0x5a9c0c-0x0;var _0x53c77d=_0x4487[_0x5a9c0c];return _0x53c77d;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x7448('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7448('0x1'));var jsonpatch=require(_0x7448('0x2'));var rp=require(_0x7448('0x3'));var moment=require(_0x7448('0x4'));var BPromise=require(_0x7448('0x5'));var Mustache=require(_0x7448('0x6'));var util=require(_0x7448('0x7'));var path=require(_0x7448('0x8'));var sox=require(_0x7448('0x9'));var csv=require('to-csv');var ejs=require(_0x7448('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x7448('0xb'));var crypto=require(_0x7448('0xc'));var jsforce=require(_0x7448('0xd'));var deskjs=require(_0x7448('0xe'));var toCsv=require(_0x7448('0xf'));var querystring=require(_0x7448('0x10'));var Papa=require('papaparse');var Redis=require(_0x7448('0x11'));var authService=require(_0x7448('0x12'));var qs=require(_0x7448('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x7448('0x14'));var config=require(_0x7448('0x15'));var db=require(_0x7448('0x16'))['db'];function respondWithStatusCode(_0x43996f,_0x57d306){_0x57d306=_0x57d306||0xcc;return function(_0x41b038){if(_0x41b038){return _0x43996f[_0x7448('0x17')](_0x57d306);}return _0x43996f[_0x7448('0x18')](_0x57d306)[_0x7448('0x19')]();};}function respondWithResult(_0x4a7dcd,_0x3f30f6){_0x3f30f6=_0x3f30f6||0xc8;return function(_0x485638){if(_0x485638){return _0x4a7dcd[_0x7448('0x18')](_0x3f30f6)['json'](_0x485638);}};}function respondWithFilteredResult(_0x368267,_0x5ce514){return function(_0x2d3715){if(_0x2d3715){var _0x44981e=_0x2d3715[_0x7448('0x1a')],_0x3cf4d3=_0x5ce514[_0x7448('0x1b')],_0x24c08d=_0x5ce514[_0x7448('0x1b')]+_0x5ce514['limit'],_0x37eefb;if(_0x24c08d>=_0x44981e){_0x24c08d=_0x44981e;_0x37eefb=0xc8;}else{_0x37eefb=0xce;}_0x368267[_0x7448('0x18')](_0x37eefb);return _0x368267[_0x7448('0x1c')]('Content-Range',_0x3cf4d3+'-'+_0x24c08d+'/'+_0x44981e)[_0x7448('0x1d')](_0x2d3715);}return null;};}function patchUpdates(_0x41d996){return function(_0x48461f){try{jsonpatch[_0x7448('0x1e')](_0x48461f,_0x41d996,!![]);}catch(_0x53e324){return BPromise[_0x7448('0x1f')](_0x53e324);}return _0x48461f[_0x7448('0x20')]();};}function saveUpdates(_0x246382,_0x338343){return function(_0x246913){if(_0x246913){return _0x246913['update'](_0x246382)[_0x7448('0x21')](function(_0x33f501){return _0x33f501;});}return null;};}function removeEntity(_0x519657,_0x979602){return function(_0xb08705){if(_0xb08705){return _0xb08705[_0x7448('0x22')]()['then'](function(){_0x519657[_0x7448('0x18')](0xcc)[_0x7448('0x19')]();});}};}function handleEntityNotFound(_0x2df1c9,_0x5c66ab){return function(_0x173839){if(!_0x173839){_0x2df1c9[_0x7448('0x17')](0x194);}return _0x173839;};}function handleError(_0x138083,_0x5be542){_0x5be542=_0x5be542||0x1f4;return function(_0x1e7f4c){logger[_0x7448('0x23')](_0x1e7f4c[_0x7448('0x24')]);if(_0x1e7f4c[_0x7448('0x25')]){delete _0x1e7f4c[_0x7448('0x25')];}_0x138083[_0x7448('0x18')](_0x5be542)[_0x7448('0x26')](_0x1e7f4c);};}exports[_0x7448('0x27')]=function(_0x143348,_0xfad92e){var _0x4de042={},_0x2f1e01={},_0x3dbcd1={'count':0x0,'rows':[]};var _0x140fdd=db[_0x7448('0x28')][_0x7448('0x29')];_0x2f1e01[_0x7448('0x2a')]=_[_0x7448('0x2b')](_0x140fdd);_0x2f1e01[_0x7448('0x2c')]=_[_0x7448('0x2b')](_0x143348[_0x7448('0x2c')]);_0x2f1e01[_0x7448('0x2d')]=_[_0x7448('0x2e')](_0x2f1e01['model'],_0x2f1e01[_0x7448('0x2c')]);_0x4de042['attributes']=_[_0x7448('0x2e')](_0x2f1e01[_0x7448('0x2a')],qs[_0x7448('0x2f')](_0x143348[_0x7448('0x2c')][_0x7448('0x2f')]));_0x4de042[_0x7448('0x30')]=_0x4de042['attributes'][_0x7448('0x31')]?_0x4de042[_0x7448('0x30')]:_0x2f1e01[_0x7448('0x2a')];if(!_0x143348[_0x7448('0x2c')][_0x7448('0x32')](_0x7448('0x33'))){_0x4de042[_0x7448('0x34')]=qs[_0x7448('0x34')](_0x143348[_0x7448('0x2c')][_0x7448('0x34')]);_0x4de042['offset']=qs[_0x7448('0x1b')](_0x143348[_0x7448('0x2c')][_0x7448('0x1b')]);}_0x4de042['order']=qs[_0x7448('0x35')](_0x143348[_0x7448('0x2c')][_0x7448('0x35')]);_0x4de042['where']=qs[_0x7448('0x2d')](_[_0x7448('0x36')](_0x143348[_0x7448('0x2c')],_0x2f1e01[_0x7448('0x2d')]));if(_0x143348[_0x7448('0x2c')][_0x7448('0x37')]){_0x4de042[_0x7448('0x38')]=_[_0x7448('0x39')](_0x4de042['where'],{'$or':_['map'](_0x140fdd,function(_0x14f78e){if(_0x14f78e[_0x7448('0x3a')][_0x7448('0x3b')]!==_0x7448('0x3c')){var _0x4ee205={};_0x4ee205[_0x14f78e[_0x7448('0x3d')]]={'$like':'%'+_0x143348['query'][_0x7448('0x37')]+'%'};return _0x4ee205;}})});}_0x4de042=_[_0x7448('0x39')]({},_0x4de042,_0x143348[_0x7448('0x3e')]);var _0x3c57c7={'where':_0x4de042['where']};return db['SquareDetailsReport'][_0x7448('0x1a')](_0x3c57c7)['then'](function(_0x2045b2){_0x3dbcd1[_0x7448('0x1a')]=_0x2045b2;if(_0x143348['query']['includeAll']){_0x4de042[_0x7448('0x3f')]=[{'all':!![]}];}return db[_0x7448('0x28')][_0x7448('0x40')](_0x4de042);})['then'](function(_0x5dcc5e){_0x3dbcd1[_0x7448('0x41')]=_0x5dcc5e;return _0x3dbcd1;})[_0x7448('0x21')](respondWithFilteredResult(_0xfad92e,_0x4de042))[_0x7448('0x42')](handleError(_0xfad92e,null));};exports[_0x7448('0x43')]=function(_0x2ae85c,_0x5de5af){var _0x56377d={'raw':!![],'where':{'id':_0x2ae85c['params']['id']}},_0x1a991d={};_0x1a991d[_0x7448('0x2a')]=_[_0x7448('0x2b')](db['SquareDetailsReport'][_0x7448('0x29')]);_0x1a991d[_0x7448('0x2c')]=_[_0x7448('0x2b')](_0x2ae85c[_0x7448('0x2c')]);_0x1a991d[_0x7448('0x2d')]=_[_0x7448('0x2e')](_0x1a991d[_0x7448('0x2a')],_0x1a991d['query']);_0x56377d[_0x7448('0x30')]=_[_0x7448('0x2e')](_0x1a991d[_0x7448('0x2a')],qs[_0x7448('0x2f')](_0x2ae85c[_0x7448('0x2c')][_0x7448('0x2f')]));_0x56377d[_0x7448('0x30')]=_0x56377d['attributes'][_0x7448('0x31')]?_0x56377d[_0x7448('0x30')]:_0x1a991d[_0x7448('0x2a')];if(_0x2ae85c['query'][_0x7448('0x44')]){_0x56377d[_0x7448('0x3f')]=[{'all':!![]}];}_0x56377d=_[_0x7448('0x39')]({},_0x56377d,_0x2ae85c['options']);return db[_0x7448('0x28')][_0x7448('0x45')](_0x56377d)['then'](handleEntityNotFound(_0x5de5af,null))[_0x7448('0x21')](respondWithResult(_0x5de5af,null))[_0x7448('0x42')](handleError(_0x5de5af,null));};exports[_0x7448('0x46')]=function(_0x570262,_0x277b87){return db['SquareDetailsReport'][_0x7448('0x46')](_0x570262['body'],{})[_0x7448('0x21')](respondWithResult(_0x277b87,0xc9))[_0x7448('0x42')](handleError(_0x277b87,null));};exports['update']=function(_0x437ef4,_0x15a2ab){if(_0x437ef4[_0x7448('0x47')]['id']){delete _0x437ef4[_0x7448('0x47')]['id'];}return db['SquareDetailsReport'][_0x7448('0x45')]({'where':{'id':_0x437ef4['params']['id']}})[_0x7448('0x21')](handleEntityNotFound(_0x15a2ab,null))[_0x7448('0x21')](saveUpdates(_0x437ef4['body'],null))['then'](respondWithResult(_0x15a2ab,null))[_0x7448('0x42')](handleError(_0x15a2ab,null));};exports['destroy']=function(_0x5dd9d5,_0x18b9bc){return db[_0x7448('0x28')][_0x7448('0x45')]({'where':{'id':_0x5dd9d5[_0x7448('0x48')]['id']}})['then'](handleEntityNotFound(_0x18b9bc,null))[_0x7448('0x21')](removeEntity(_0x18b9bc,null))['catch'](handleError(_0x18b9bc,null));};exports[_0x7448('0x49')]=function(_0x28d83e,_0x57f89d){return db[_0x7448('0x28')][_0x7448('0x49')]()[_0x7448('0x21')](respondWithResult(_0x57f89d,null))['catch'](handleError(_0x57f89d,null));}; \ No newline at end of file +var _0x9603=['catch','params','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','reject','update','then','destroy','error','name','send','index','rawAttributes','model','keys','query','filters','intersection','fields','attributes','nolimit','sort','where','pick','filter','merge','map','type','key','VIRTUAL','field','includeAll','include','findAll','show','SquareDetailsReport','length','find','create','body'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x9603,0xe1));var _0x3960=function(_0x39d271,_0x2ff1c5){_0x39d271=_0x39d271-0x0;var _0x3d0ff4=_0x9603[_0x39d271];return _0x3d0ff4;};'use strict';var pdf=require(_0x3960('0x0'));var emlformat=require(_0x3960('0x1'));var rimraf=require(_0x3960('0x2'));var zipdir=require(_0x3960('0x3'));var jsonpatch=require(_0x3960('0x4'));var rp=require(_0x3960('0x5'));var moment=require('moment');var BPromise=require(_0x3960('0x6'));var Mustache=require(_0x3960('0x7'));var util=require(_0x3960('0x8'));var path=require('path');var sox=require(_0x3960('0x9'));var csv=require(_0x3960('0xa'));var ejs=require(_0x3960('0xb'));var fs=require('fs');var _=require(_0x3960('0xc'));var squel=require(_0x3960('0xd'));var crypto=require('crypto');var jsforce=require(_0x3960('0xe'));var deskjs=require(_0x3960('0xf'));var toCsv=require(_0x3960('0xa'));var querystring=require('querystring');var Papa=require(_0x3960('0x10'));var Redis=require(_0x3960('0x11'));var authService=require(_0x3960('0x12'));var qs=require(_0x3960('0x13'));var as=require(_0x3960('0x14'));var hardwareService=require(_0x3960('0x15'));var logger=require(_0x3960('0x16'))('api');var utils=require(_0x3960('0x17'));var config=require(_0x3960('0x18'));var db=require(_0x3960('0x19'))['db'];function respondWithStatusCode(_0x3aedcc,_0x5a1715){_0x5a1715=_0x5a1715||0xcc;return function(_0x56b7dd){if(_0x56b7dd){return _0x3aedcc[_0x3960('0x1a')](_0x5a1715);}return _0x3aedcc[_0x3960('0x1b')](_0x5a1715)[_0x3960('0x1c')]();};}function respondWithResult(_0x52a0d4,_0x550331){_0x550331=_0x550331||0xc8;return function(_0x5bd104){if(_0x5bd104){return _0x52a0d4['status'](_0x550331)[_0x3960('0x1d')](_0x5bd104);}};}function respondWithFilteredResult(_0xe1ef56,_0x2b90fc){return function(_0x2894cd){if(_0x2894cd){var _0x22d62b=_0x2894cd[_0x3960('0x1e')],_0x2b2d47=_0x2b90fc['offset'],_0xb0211e=_0x2b90fc[_0x3960('0x1f')]+_0x2b90fc[_0x3960('0x20')],_0x47dcff;if(_0xb0211e>=_0x22d62b){_0xb0211e=_0x22d62b;_0x47dcff=0xc8;}else{_0x47dcff=0xce;}_0xe1ef56[_0x3960('0x1b')](_0x47dcff);return _0xe1ef56['set'](_0x3960('0x21'),_0x2b2d47+'-'+_0xb0211e+'/'+_0x22d62b)['json'](_0x2894cd);}return null;};}function patchUpdates(_0x43220a){return function(_0x2fd770){try{jsonpatch[_0x3960('0x22')](_0x2fd770,_0x43220a,!![]);}catch(_0x759cdf){return BPromise[_0x3960('0x23')](_0x759cdf);}return _0x2fd770['save']();};}function saveUpdates(_0x149808,_0xa1aef9){return function(_0x2c650e){if(_0x2c650e){return _0x2c650e[_0x3960('0x24')](_0x149808)[_0x3960('0x25')](function(_0x42a17b){return _0x42a17b;});}return null;};}function removeEntity(_0x1c4b98,_0x18cf7f){return function(_0x38c8a6){if(_0x38c8a6){return _0x38c8a6[_0x3960('0x26')]()[_0x3960('0x25')](function(){_0x1c4b98[_0x3960('0x1b')](0xcc)[_0x3960('0x1c')]();});}};}function handleEntityNotFound(_0x54654c,_0x230e8a){return function(_0x1553b5){if(!_0x1553b5){_0x54654c[_0x3960('0x1a')](0x194);}return _0x1553b5;};}function handleError(_0x229795,_0x3b3314){_0x3b3314=_0x3b3314||0x1f4;return function(_0x3445d7){logger[_0x3960('0x27')](_0x3445d7['stack']);if(_0x3445d7[_0x3960('0x28')]){delete _0x3445d7['name'];}_0x229795[_0x3960('0x1b')](_0x3b3314)[_0x3960('0x29')](_0x3445d7);};}exports[_0x3960('0x2a')]=function(_0x4a6c3a,_0x130230){var _0x2de71c={},_0x4a95c7={},_0x285c0b={'count':0x0,'rows':[]};var _0x139392=db['SquareDetailsReport'][_0x3960('0x2b')];_0x4a95c7[_0x3960('0x2c')]=_[_0x3960('0x2d')](_0x139392);_0x4a95c7[_0x3960('0x2e')]=_['keys'](_0x4a6c3a[_0x3960('0x2e')]);_0x4a95c7[_0x3960('0x2f')]=_[_0x3960('0x30')](_0x4a95c7[_0x3960('0x2c')],_0x4a95c7[_0x3960('0x2e')]);_0x2de71c['attributes']=_['intersection'](_0x4a95c7[_0x3960('0x2c')],qs[_0x3960('0x31')](_0x4a6c3a[_0x3960('0x2e')]['fields']));_0x2de71c['attributes']=_0x2de71c[_0x3960('0x32')]['length']?_0x2de71c[_0x3960('0x32')]:_0x4a95c7[_0x3960('0x2c')];if(!_0x4a6c3a[_0x3960('0x2e')]['hasOwnProperty'](_0x3960('0x33'))){_0x2de71c['limit']=qs[_0x3960('0x20')](_0x4a6c3a[_0x3960('0x2e')][_0x3960('0x20')]);_0x2de71c[_0x3960('0x1f')]=qs[_0x3960('0x1f')](_0x4a6c3a[_0x3960('0x2e')][_0x3960('0x1f')]);}_0x2de71c['order']=qs[_0x3960('0x34')](_0x4a6c3a['query']['sort']);_0x2de71c[_0x3960('0x35')]=qs[_0x3960('0x2f')](_[_0x3960('0x36')](_0x4a6c3a[_0x3960('0x2e')],_0x4a95c7[_0x3960('0x2f')]));if(_0x4a6c3a['query'][_0x3960('0x37')]){_0x2de71c[_0x3960('0x35')]=_[_0x3960('0x38')](_0x2de71c[_0x3960('0x35')],{'$or':_[_0x3960('0x39')](_0x139392,function(_0x4ca14e){if(_0x4ca14e[_0x3960('0x3a')][_0x3960('0x3b')]!==_0x3960('0x3c')){var _0x149198={};_0x149198[_0x4ca14e[_0x3960('0x3d')]]={'$like':'%'+_0x4a6c3a[_0x3960('0x2e')][_0x3960('0x37')]+'%'};return _0x149198;}})});}_0x2de71c=_[_0x3960('0x38')]({},_0x2de71c,_0x4a6c3a['options']);var _0x141ca2={'where':_0x2de71c[_0x3960('0x35')]};return db['SquareDetailsReport'][_0x3960('0x1e')](_0x141ca2)[_0x3960('0x25')](function(_0x4a3803){_0x285c0b[_0x3960('0x1e')]=_0x4a3803;if(_0x4a6c3a[_0x3960('0x2e')][_0x3960('0x3e')]){_0x2de71c[_0x3960('0x3f')]=[{'all':!![]}];}return db['SquareDetailsReport'][_0x3960('0x40')](_0x2de71c);})[_0x3960('0x25')](function(_0x4fa443){_0x285c0b['rows']=_0x4fa443;return _0x285c0b;})[_0x3960('0x25')](respondWithFilteredResult(_0x130230,_0x2de71c))['catch'](handleError(_0x130230,null));};exports[_0x3960('0x41')]=function(_0x5a5f69,_0x21cffe){var _0x1f76c5={'raw':!![],'where':{'id':_0x5a5f69['params']['id']}},_0x320d21={};_0x320d21[_0x3960('0x2c')]=_['keys'](db[_0x3960('0x42')]['rawAttributes']);_0x320d21[_0x3960('0x2e')]=_['keys'](_0x5a5f69[_0x3960('0x2e')]);_0x320d21[_0x3960('0x2f')]=_['intersection'](_0x320d21['model'],_0x320d21[_0x3960('0x2e')]);_0x1f76c5[_0x3960('0x32')]=_[_0x3960('0x30')](_0x320d21['model'],qs[_0x3960('0x31')](_0x5a5f69[_0x3960('0x2e')][_0x3960('0x31')]));_0x1f76c5[_0x3960('0x32')]=_0x1f76c5[_0x3960('0x32')][_0x3960('0x43')]?_0x1f76c5[_0x3960('0x32')]:_0x320d21[_0x3960('0x2c')];if(_0x5a5f69[_0x3960('0x2e')]['includeAll']){_0x1f76c5[_0x3960('0x3f')]=[{'all':!![]}];}_0x1f76c5=_[_0x3960('0x38')]({},_0x1f76c5,_0x5a5f69['options']);return db['SquareDetailsReport'][_0x3960('0x44')](_0x1f76c5)[_0x3960('0x25')](handleEntityNotFound(_0x21cffe,null))['then'](respondWithResult(_0x21cffe,null))['catch'](handleError(_0x21cffe,null));};exports[_0x3960('0x45')]=function(_0x5e0787,_0x3ca137){return db[_0x3960('0x42')][_0x3960('0x45')](_0x5e0787[_0x3960('0x46')],{})[_0x3960('0x25')](respondWithResult(_0x3ca137,0xc9))[_0x3960('0x47')](handleError(_0x3ca137,null));};exports[_0x3960('0x24')]=function(_0x189f9c,_0x4f675e){if(_0x189f9c['body']['id']){delete _0x189f9c[_0x3960('0x46')]['id'];}return db[_0x3960('0x42')][_0x3960('0x44')]({'where':{'id':_0x189f9c[_0x3960('0x48')]['id']}})['then'](handleEntityNotFound(_0x4f675e,null))[_0x3960('0x25')](saveUpdates(_0x189f9c[_0x3960('0x46')],null))[_0x3960('0x25')](respondWithResult(_0x4f675e,null))['catch'](handleError(_0x4f675e,null));};exports[_0x3960('0x26')]=function(_0x1843ac,_0x4fd70f){return db[_0x3960('0x42')][_0x3960('0x44')]({'where':{'id':_0x1843ac[_0x3960('0x48')]['id']}})[_0x3960('0x25')](handleEntityNotFound(_0x4fd70f,null))[_0x3960('0x25')](removeEntity(_0x4fd70f,null))[_0x3960('0x47')](handleError(_0x4fd70f,null));};exports[_0x3960('0x49')]=function(_0x484a80,_0x111abd){return db[_0x3960('0x42')][_0x3960('0x49')]()[_0x3960('0x25')](respondWithResult(_0x111abd,null))[_0x3960('0x47')](handleError(_0x111abd,null));}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.model.js b/server/api/squareReportDetail/squareReportDetail.model.js index e671111..e6fbed5 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 _0xc25b=['request-promise','path','./squareReportDetail.attributes','exports','define','SquareDetailsReport','report_square_details','lodash','../../config/logger','bluebird'];(function(_0xe8129c,_0x2fb03c){var _0x709fc5=function(_0xb8e0c6){while(--_0xb8e0c6){_0xe8129c['push'](_0xe8129c['shift']());}};_0x709fc5(++_0x2fb03c);}(_0xc25b,0x133));var _0xbc25=function(_0x4b44d3,_0x5d4a93){_0x4b44d3=_0x4b44d3-0x0;var _0x205bc4=_0xc25b[_0x4b44d3];return _0x205bc4;};'use strict';var _=require(_0xbc25('0x0'));var util=require('util');var logger=require(_0xbc25('0x1'))('api');var moment=require('moment');var BPromise=require(_0xbc25('0x2'));var rp=require(_0xbc25('0x3'));var fs=require('fs');var path=require(_0xbc25('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xbc25('0x5'));module[_0xbc25('0x6')]=function(_0x4ec3f2,_0x55ba65){return _0x4ec3f2[_0xbc25('0x7')](_0xbc25('0x8'),attributes,{'tableName':_0xbc25('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3588=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./squareReportDetail.attributes','exports','define','report_square_details'];(function(_0x249f94,_0x3cbe0b){var _0x540158=function(_0x28c4be){while(--_0x28c4be){_0x249f94['push'](_0x249f94['shift']());}};_0x540158(++_0x3cbe0b);}(_0x3588,0x82));var _0x8358=function(_0x2b9120,_0x4cba82){_0x2b9120=_0x2b9120-0x0;var _0x459db0=_0x3588[_0x2b9120];return _0x459db0;};'use strict';var _=require(_0x8358('0x0'));var util=require(_0x8358('0x1'));var logger=require(_0x8358('0x2'))(_0x8358('0x3'));var moment=require(_0x8358('0x4'));var BPromise=require(_0x8358('0x5'));var rp=require(_0x8358('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8358('0x7'));var config=require(_0x8358('0x8'));var attributes=require(_0x8358('0x9'));module[_0x8358('0xa')]=function(_0x483bf0,_0x15dc94){return _0x483bf0[_0x8358('0xb')]('SquareDetailsReport',attributes,{'tableName':_0x8358('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 ebf9fd9..2a3cff1 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 _0xb4eb=['request\x20sent','debug','SquareDetailsReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CreateSquareDetailsReport','SquareDetailsReport','create','options','raw','catch','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','info','SquareDetailsReport,\x20%s,\x20%s'];(function(_0x2cdd16,_0x5603a9){var _0x1deed=function(_0x518972){while(--_0x518972){_0x2cdd16['push'](_0x2cdd16['shift']());}};_0x1deed(++_0x5603a9);}(_0xb4eb,0x101));var _0xbb4e=function(_0x59ea2c,_0x106c69){_0x59ea2c=_0x59ea2c-0x0;var _0xf25149=_0xb4eb[_0x59ea2c];return _0xf25149;};'use strict';var _=require('lodash');var util=require(_0xbb4e('0x0'));var moment=require(_0xbb4e('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbb4e('0x2'));var db=require(_0xbb4e('0x3'))['db'];var utils=require(_0xbb4e('0x4'));var logger=require(_0xbb4e('0x5'))(_0xbb4e('0x6'));var config=require('../../config/environment');var jayson=require(_0xbb4e('0x7'));var client=jayson[_0xbb4e('0x8')][_0xbb4e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x417806,_0xa1938a,_0x261677){return new BPromise(function(_0x491f25,_0x554fb9){return client[_0xbb4e('0xa')](_0x417806,_0x261677)['then'](function(_0x32fe81){logger[_0xbb4e('0xb')](_0xbb4e('0xc'),_0xa1938a,_0xbb4e('0xd'));logger[_0xbb4e('0xe')](_0xbb4e('0xf'),_0xa1938a,_0xbb4e('0xd'),JSON[_0xbb4e('0x10')](_0x32fe81));if(_0x32fe81[_0xbb4e('0x11')]){if(_0x32fe81[_0xbb4e('0x11')][_0xbb4e('0x12')]===0x1f4){logger['error'](_0xbb4e('0xc'),_0xa1938a,_0x32fe81['error'][_0xbb4e('0x13')]);return _0x554fb9(_0x32fe81[_0xbb4e('0x11')][_0xbb4e('0x13')]);}logger[_0xbb4e('0x11')]('SquareDetailsReport,\x20%s,\x20%s',_0xa1938a,_0x32fe81[_0xbb4e('0x11')][_0xbb4e('0x13')]);return _0x491f25(_0x32fe81[_0xbb4e('0x11')][_0xbb4e('0x13')]);}else{logger[_0xbb4e('0xb')](_0xbb4e('0xc'),_0xa1938a,'request\x20sent');_0x491f25(_0x32fe81[_0xbb4e('0x14')]['message']);}})['catch'](function(_0x5ecc21){logger[_0xbb4e('0x11')](_0xbb4e('0xc'),_0xa1938a,_0x5ecc21);_0x554fb9(_0x5ecc21);});});}exports[_0xbb4e('0x15')]=function(_0x155639){var _0x42ddae=this;return new Promise(function(_0x564249,_0x3f83ba){return db[_0xbb4e('0x16')][_0xbb4e('0x17')](_0x155639['body'],{'raw':_0x155639[_0xbb4e('0x18')]?_0x155639['options'][_0xbb4e('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x1a851d){logger[_0xbb4e('0xb')](_0xbb4e('0x15'),_0x155639);logger['debug'](_0xbb4e('0x15'),_0x155639,JSON['stringify'](_0x1a851d));_0x564249(_0x1a851d);})[_0xbb4e('0x1a')](function(_0x183fd0){logger[_0xbb4e('0x11')](_0xbb4e('0x15'),_0x183fd0['message'],_0x155639);_0x3f83ba(_0x42ddae[_0xbb4e('0x11')](0x1f4,_0x183fd0[_0xbb4e('0x13')]));});});}; \ No newline at end of file +var _0x3fe6=['result','catch','CreateSquareDetailsReport','SquareDetailsReport','create','body','options','raw','then','stringify','lodash','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','client','request','info','SquareDetailsReport,\x20%s,\x20%s','request\x20sent','debug','SquareDetailsReport,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x22eb25,_0x396131){var _0x4040eb=function(_0x3bcc88){while(--_0x3bcc88){_0x22eb25['push'](_0x22eb25['shift']());}};_0x4040eb(++_0x396131);}(_0x3fe6,0x15a));var _0x63fe=function(_0x473ee7,_0x4dd754){_0x473ee7=_0x473ee7-0x0;var _0x30f0d4=_0x3fe6[_0x473ee7];return _0x30f0d4;};'use strict';var _=require(_0x63fe('0x0'));var util=require('util');var moment=require(_0x63fe('0x1'));var BPromise=require(_0x63fe('0x2'));var rs=require(_0x63fe('0x3'));var fs=require('fs');var Redis=require(_0x63fe('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x63fe('0x5'))(_0x63fe('0x6'));var config=require(_0x63fe('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x63fe('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3f72ec,_0x44fb31,_0x5468e1){return new BPromise(function(_0x3e7f8a,_0x9afbd1){return client[_0x63fe('0x9')](_0x3f72ec,_0x5468e1)['then'](function(_0x2de661){logger[_0x63fe('0xa')](_0x63fe('0xb'),_0x44fb31,_0x63fe('0xc'));logger[_0x63fe('0xd')](_0x63fe('0xe'),_0x44fb31,_0x63fe('0xc'),JSON['stringify'](_0x2de661));if(_0x2de661[_0x63fe('0xf')]){if(_0x2de661[_0x63fe('0xf')][_0x63fe('0x10')]===0x1f4){logger[_0x63fe('0xf')](_0x63fe('0xb'),_0x44fb31,_0x2de661[_0x63fe('0xf')]['message']);return _0x9afbd1(_0x2de661[_0x63fe('0xf')][_0x63fe('0x11')]);}logger[_0x63fe('0xf')]('SquareDetailsReport,\x20%s,\x20%s',_0x44fb31,_0x2de661[_0x63fe('0xf')][_0x63fe('0x11')]);return _0x3e7f8a(_0x2de661[_0x63fe('0xf')][_0x63fe('0x11')]);}else{logger[_0x63fe('0xa')](_0x63fe('0xb'),_0x44fb31,_0x63fe('0xc'));_0x3e7f8a(_0x2de661[_0x63fe('0x12')][_0x63fe('0x11')]);}})[_0x63fe('0x13')](function(_0x31d896){logger[_0x63fe('0xf')](_0x63fe('0xb'),_0x44fb31,_0x31d896);_0x9afbd1(_0x31d896);});});}exports[_0x63fe('0x14')]=function(_0x12ba96){var _0x22c96d=this;return new Promise(function(_0x2f407d,_0x9d282b){return db[_0x63fe('0x15')][_0x63fe('0x16')](_0x12ba96[_0x63fe('0x17')],{'raw':_0x12ba96[_0x63fe('0x18')]?_0x12ba96[_0x63fe('0x18')][_0x63fe('0x19')]===undefined?!![]:![]:!![]})[_0x63fe('0x1a')](function(_0x5ac2d2){logger[_0x63fe('0xa')](_0x63fe('0x14'),_0x12ba96);logger['debug']('CreateSquareDetailsReport',_0x12ba96,JSON[_0x63fe('0x1b')](_0x5ac2d2));_0x2f407d(_0x5ac2d2);})['catch'](function(_0x2ffe4f){logger['error'](_0x63fe('0x14'),_0x2ffe4f[_0x63fe('0x11')],_0x12ba96);_0x9d282b(_0x22c96d[_0x63fe('0xf')](0x1f4,_0x2ffe4f['message']));});});}; \ No newline at end of file diff --git a/server/api/system/index.js b/server/api/system/index.js index 5c69522..13da47e 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 _0xf122=['../../components/auth/service','./system.controller','get','isAuthenticated','/process/:pid/kill','killProcess','express'];(function(_0x158e3b,_0x4534b){var _0x551a1d=function(_0x629c21){while(--_0x629c21){_0x158e3b['push'](_0x158e3b['shift']());}};_0x551a1d(++_0x4534b);}(_0xf122,0x1e2));var _0x2f12=function(_0x5aa757,_0x57f7d3){_0x5aa757=_0x5aa757-0x0;var _0x3bf2f5=_0xf122[_0x5aa757];return _0x3bf2f5;};'use strict';var express=require(_0x2f12('0x0'));var router=express['Router']();var auth=require(_0x2f12('0x1'));var controller=require(_0x2f12('0x2'));router[_0x2f12('0x3')]('/',auth[_0x2f12('0x4')](),controller['index']);router[_0x2f12('0x3')](_0x2f12('0x5'),auth['isAuthenticated'](),controller[_0x2f12('0x6')]);module['exports']=router; \ No newline at end of file +var _0x9ac5=['get','killProcess','express','Router','../../components/auth/service','./system.controller','isAuthenticated'];(function(_0x639566,_0x5a6190){var _0x3b15aa=function(_0x23c067){while(--_0x23c067){_0x639566['push'](_0x639566['shift']());}};_0x3b15aa(++_0x5a6190);}(_0x9ac5,0x17c));var _0x59ac=function(_0x56e114,_0x3c036b){_0x56e114=_0x56e114-0x0;var _0x530911=_0x9ac5[_0x56e114];return _0x530911;};'use strict';var express=require(_0x59ac('0x0'));var router=express[_0x59ac('0x1')]();var auth=require(_0x59ac('0x2'));var controller=require(_0x59ac('0x3'));router['get']('/',auth[_0x59ac('0x4')](),controller['index']);router[_0x59ac('0x5')]('/process/:pid/kill',auth[_0x59ac('0x4')](),controller[_0x59ac('0x6')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/system/system.controller.js b/server/api/system/system.controller.js index da9ab9e..25577e1 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 _0x80eb=['error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','name','status','index','getAllData','json','catch','killProcess','components/import/cm','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','pid','then','split','indexOf','Process\x20with\x20pid\x20%s\x20not\x20found!','SIGINT','Process\x20with\x20pid\x20%s\x20killed\x20correctly','systeminformation','exec','../../config/logger','api','util','lodash'];(function(_0x2fb87c,_0x2dee49){var _0x43038b=function(_0x7e5396){while(--_0x7e5396){_0x2fb87c['push'](_0x2fb87c['shift']());}};_0x43038b(++_0x2dee49);}(_0x80eb,0x118));var _0xb80e=function(_0x32ddfa,_0x32baff){_0x32ddfa=_0x32ddfa-0x0;var _0x19194e=_0x80eb[_0x32ddfa];return _0x19194e;};'use strict';var info=require(_0xb80e('0x0'));var exec=require('child_process')[_0xb80e('0x1')];var logger=require(_0xb80e('0x2'))(_0xb80e('0x3'));var util=require(_0xb80e('0x4'));var BPromise=require('bluebird');var _=require(_0xb80e('0x5'));function handleError(_0xa7aaa0,_0x1e2a30,_0xc0af77){_0x1e2a30=_0x1e2a30||0x1f4;return function(_0x2e8b43){logger[_0xb80e('0x6')](_0xb80e('0x7'),_0xc0af77,_0x1e2a30,util['inspect'](_0x2e8b43,{'showHidden':![],'depth':null}));delete _0x2e8b43[_0xb80e('0x8')];_0xa7aaa0[_0xb80e('0x9')](_0x1e2a30)['send'](_0x2e8b43);};}exports[_0xb80e('0xa')]=function(_0x3d70fc,_0xb175e4){return info[_0xb80e('0xb')]()['then'](function(_0x2cc04e){return _0xb175e4[_0xb80e('0x9')](0xc8)[_0xb80e('0xc')](_0x2cc04e);})[_0xb80e('0xd')](function(_0x374804){return _0xb175e4[_0xb80e('0x9')](0x1f4)[_0xb80e('0xc')](_0x374804);});};exports[_0xb80e('0xe')]=function(_0x1257c8,_0x4eafdc){var _0x300359=[_0xb80e('0xf')];return new BPromise(function(_0x442b35,_0x2f9c84){return exec(util[_0xb80e('0x10')](_0xb80e('0x11'),_0x1257c8[_0xb80e('0x12')][_0xb80e('0x13')]),function(_0x4c9701,_0x2d07d0,_0x431251){if(_0x4c9701){return _0x2f9c84(_0x4c9701);}return _0x442b35(_0x2d07d0);});})[_0xb80e('0x14')](function(_0x3fb210){var _0x3b8584=![];var _0x3470df=_0x3fb210[_0xb80e('0x15')](/\n/);for(var _0x4df251=0x0,_0x226234=_0x300359['length'];_0x4df251<_0x226234,_0x3b8584===![];_0x4df251+=0x1){if(_0x3fb210[_0xb80e('0x16')](_0x300359[_0x4df251])>=0x0){_0x3b8584=!![];}}if(!_0x3b8584){throw new Error(util[_0xb80e('0x10')](_0xb80e('0x17'),_0x1257c8[_0xb80e('0x12')][_0xb80e('0x13')]));}process['kill'](_0x1257c8[_0xb80e('0x12')][_0xb80e('0x13')],_0xb80e('0x18'));return _0x4eafdc[_0xb80e('0x9')](0xc8)[_0xb80e('0xc')]({'message':util[_0xb80e('0x10')](_0xb80e('0x19'),_0x1257c8[_0xb80e('0x12')][_0xb80e('0x13')])});})[_0xb80e('0xd')](handleError(_0x4eafdc,null,_0xb80e('0xe')));}; \ No newline at end of file +var _0x4819=['index','getAllData','json','catch','killProcess','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','pid','then','length','indexOf','SIGINT','child_process','exec','../../config/logger','api','util','bluebird','lodash','error','name','status','send'];(function(_0x588439,_0x47d225){var _0x29f167=function(_0x4ae058){while(--_0x4ae058){_0x588439['push'](_0x588439['shift']());}};_0x29f167(++_0x47d225);}(_0x4819,0xcd));var _0x9481=function(_0x57b5d5,_0x25b4ee){_0x57b5d5=_0x57b5d5-0x0;var _0x24e2b5=_0x4819[_0x57b5d5];return _0x24e2b5;};'use strict';var info=require('systeminformation');var exec=require(_0x9481('0x0'))[_0x9481('0x1')];var logger=require(_0x9481('0x2'))(_0x9481('0x3'));var util=require(_0x9481('0x4'));var BPromise=require(_0x9481('0x5'));var _=require(_0x9481('0x6'));function handleError(_0x14dc10,_0xc39edf,_0x16c617){_0xc39edf=_0xc39edf||0x1f4;return function(_0x5ac51c){logger[_0x9481('0x7')]('<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s',_0x16c617,_0xc39edf,util['inspect'](_0x5ac51c,{'showHidden':![],'depth':null}));delete _0x5ac51c[_0x9481('0x8')];_0x14dc10[_0x9481('0x9')](_0xc39edf)[_0x9481('0xa')](_0x5ac51c);};}exports[_0x9481('0xb')]=function(_0x15d895,_0x4c7d9c){return info[_0x9481('0xc')]()['then'](function(_0x2fabf1){return _0x4c7d9c['status'](0xc8)[_0x9481('0xd')](_0x2fabf1);})[_0x9481('0xe')](function(_0x2d4d44){return _0x4c7d9c[_0x9481('0x9')](0x1f4)[_0x9481('0xd')](_0x2d4d44);});};exports[_0x9481('0xf')]=function(_0xa38c93,_0xe410c3){var _0xed8e9=['components/import/cm'];return new BPromise(function(_0x5aac02,_0xce6fa2){return exec(util[_0x9481('0x10')](_0x9481('0x11'),_0xa38c93[_0x9481('0x12')][_0x9481('0x13')]),function(_0xc7a0b5,_0x3fb97f,_0x495b30){if(_0xc7a0b5){return _0xce6fa2(_0xc7a0b5);}return _0x5aac02(_0x3fb97f);});})[_0x9481('0x14')](function(_0x7a7ee){var _0x5b1fe6=![];var _0x2266d5=_0x7a7ee['split'](/\n/);for(var _0x34108d=0x0,_0x7a2ac8=_0xed8e9[_0x9481('0x15')];_0x34108d<_0x7a2ac8,_0x5b1fe6===![];_0x34108d+=0x1){if(_0x7a7ee[_0x9481('0x16')](_0xed8e9[_0x34108d])>=0x0){_0x5b1fe6=!![];}}if(!_0x5b1fe6){throw new Error(util['format']('Process\x20with\x20pid\x20%s\x20not\x20found!',_0xa38c93[_0x9481('0x12')]['pid']));}process['kill'](_0xa38c93[_0x9481('0x12')][_0x9481('0x13')],_0x9481('0x17'));return _0xe410c3[_0x9481('0x9')](0xc8)[_0x9481('0xd')]({'message':util[_0x9481('0x10')]('Process\x20with\x20pid\x20%s\x20killed\x20correctly',_0xa38c93[_0x9481('0x12')][_0x9481('0x13')])});})[_0x9481('0xe')](handleError(_0xe410c3,null,_0x9481('0xf')));}; \ No newline at end of file diff --git a/server/api/tag/index.js b/server/api/tag/index.js index d57f937..ca5b088 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 _0xbec5=['isAuthenticated','/:id','show','post','create','put','delete','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./tag.controller','get'];(function(_0xa1bcbe,_0x4569a5){var _0x416e7f=function(_0x23b94a){while(--_0x23b94a){_0xa1bcbe['push'](_0xa1bcbe['shift']());}};_0x416e7f(++_0x4569a5);}(_0xbec5,0xe5));var _0x5bec=function(_0x54f3e8,_0x3ed493){_0x54f3e8=_0x54f3e8-0x0;var _0x267b37=_0xbec5[_0x54f3e8];return _0x267b37;};'use strict';var multer=require(_0x5bec('0x0'));var util=require(_0x5bec('0x1'));var path=require('path');var timeout=require(_0x5bec('0x2'));var express=require(_0x5bec('0x3'));var router=express[_0x5bec('0x4')]();var auth=require(_0x5bec('0x5'));var interaction=require(_0x5bec('0x6'));var config=require('../../config/environment');var controller=require(_0x5bec('0x7'));router[_0x5bec('0x8')]('/',auth[_0x5bec('0x9')](),controller['index']);router[_0x5bec('0x8')](_0x5bec('0xa'),auth[_0x5bec('0x9')](),controller[_0x5bec('0xb')]);router[_0x5bec('0xc')]('/',auth[_0x5bec('0x9')](),controller[_0x5bec('0xd')]);router[_0x5bec('0xe')]('/:id',auth[_0x5bec('0x9')](),controller['update']);router[_0x5bec('0xf')](_0x5bec('0xa'),auth[_0x5bec('0x9')](),controller['destroy']);module[_0x5bec('0x10')]=router; \ No newline at end of file +var _0x6c76=['update','delete','destroy','exports','multer','util','path','express','Router','../../config/environment','./tag.controller','isAuthenticated','index','/:id','post','create'];(function(_0x4ae5b9,_0x4a42d2){var _0x3f94f4=function(_0x324f87){while(--_0x324f87){_0x4ae5b9['push'](_0x4ae5b9['shift']());}};_0x3f94f4(++_0x4a42d2);}(_0x6c76,0x184));var _0x66c7=function(_0x4474b8,_0x53c0aa){_0x4474b8=_0x4474b8-0x0;var _0x53a6cf=_0x6c76[_0x4474b8];return _0x53a6cf;};'use strict';var multer=require(_0x66c7('0x0'));var util=require(_0x66c7('0x1'));var path=require(_0x66c7('0x2'));var timeout=require('connect-timeout');var express=require(_0x66c7('0x3'));var router=express[_0x66c7('0x4')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x66c7('0x5'));var controller=require(_0x66c7('0x6'));router['get']('/',auth[_0x66c7('0x7')](),controller[_0x66c7('0x8')]);router['get'](_0x66c7('0x9'),auth['isAuthenticated'](),controller['show']);router[_0x66c7('0xa')]('/',auth[_0x66c7('0x7')](),controller[_0x66c7('0xb')]);router['put'](_0x66c7('0x9'),auth[_0x66c7('0x7')](),controller[_0x66c7('0xc')]);router[_0x66c7('0xd')]('/:id',auth[_0x66c7('0x7')](),controller[_0x66c7('0xe')]);module[_0x66c7('0xf')]=router; \ No newline at end of file diff --git a/server/api/tag/tag.attributes.js b/server/api/tag/tag.attributes.js index 2ef0e72..daf9f7e 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 _0xdd4f=['sequelize','STRING','#0091EA'];(function(_0x526b5f,_0x38ccc7){var _0x1fe771=function(_0x1916d0){while(--_0x1916d0){_0x526b5f['push'](_0x526b5f['shift']());}};_0x1fe771(++_0x38ccc7);}(_0xdd4f,0x1ce));var _0xfdd4=function(_0x5050bc,_0x2d6180){_0x5050bc=_0x5050bc-0x0;var _0x52b36e=_0xdd4f[_0x5050bc];return _0x52b36e;};'use strict';var Sequelize=require(_0xfdd4('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0xfdd4('0x1')],'defaultValue':_0xfdd4('0x2')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x2032=['#0091EA','exports','STRING','name'];(function(_0xcef603,_0x317479){var _0x546163=function(_0x42d922){while(--_0x42d922){_0xcef603['push'](_0xcef603['shift']());}};_0x546163(++_0x317479);}(_0x2032,0xd9));var _0x2203=function(_0x1d510a,_0x3f904e){_0x1d510a=_0x1d510a-0x0;var _0x1cecd2=_0x2032[_0x1d510a];return _0x1cecd2;};'use strict';var Sequelize=require('sequelize');module[_0x2203('0x0')]={'name':{'type':Sequelize[_0x2203('0x1')],'unique':_0x2203('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize['STRING'],'defaultValue':_0x2203('0x3')},'description':{'type':Sequelize[_0x2203('0x1')]}}; \ No newline at end of file diff --git a/server/api/tag/tag.controller.js b/server/api/tag/tag.controller.js index d8c140e..94eb4dd 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 _0x5581=['findAll','rows','catch','params','rawAttributes','include','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','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','count','offset','limit','Content-Range','apply','reject','save','update','then','destroy','get','Tags','UserProfileResource','error','stack','name','send','index','Tag','keys','query','filters','attributes','intersection','model','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','map','type','key','VIRTUAL','field','options','includeAll'];(function(_0x2a910e,_0x523920){var _0x4277bf=function(_0xd0513){while(--_0xd0513){_0x2a910e['push'](_0x2a910e['shift']());}};_0x4277bf(++_0x523920);}(_0x5581,0x115));var _0x1558=function(_0x36884e,_0x48008f){_0x36884e=_0x36884e-0x0;var _0x1cc367=_0x5581[_0x36884e];return _0x1cc367;};'use strict';var pdf=require(_0x1558('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x1558('0x1'));var zipdir=require(_0x1558('0x2'));var jsonpatch=require(_0x1558('0x3'));var rp=require(_0x1558('0x4'));var moment=require(_0x1558('0x5'));var BPromise=require(_0x1558('0x6'));var Mustache=require('mustache');var util=require(_0x1558('0x7'));var path=require(_0x1558('0x8'));var sox=require('sox');var csv=require(_0x1558('0x9'));var ejs=require(_0x1558('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x1558('0xb'));var crypto=require(_0x1558('0xc'));var jsforce=require(_0x1558('0xd'));var deskjs=require(_0x1558('0xe'));var toCsv=require(_0x1558('0x9'));var querystring=require('querystring');var Papa=require(_0x1558('0xf'));var Redis=require(_0x1558('0x10'));var authService=require(_0x1558('0x11'));var qs=require(_0x1558('0x12'));var as=require(_0x1558('0x13'));var hardwareService=require(_0x1558('0x14'));var logger=require(_0x1558('0x15'))(_0x1558('0x16'));var utils=require(_0x1558('0x17'));var config=require(_0x1558('0x18'));var db=require(_0x1558('0x19'))['db'];function respondWithStatusCode(_0x26c435,_0x2044d1){_0x2044d1=_0x2044d1||0xcc;return function(_0x5ba878){if(_0x5ba878){return _0x26c435[_0x1558('0x1a')](_0x2044d1);}return _0x26c435[_0x1558('0x1b')](_0x2044d1)[_0x1558('0x1c')]();};}function respondWithResult(_0x188694,_0x27e978){_0x27e978=_0x27e978||0xc8;return function(_0x284608){if(_0x284608){return _0x188694[_0x1558('0x1b')](_0x27e978)[_0x1558('0x1d')](_0x284608);}};}function respondWithFilteredResult(_0x130fc7,_0x5ae8ce){return function(_0x47347c){if(_0x47347c){var _0xba47ba=_0x47347c[_0x1558('0x1e')],_0x1b781=_0x5ae8ce[_0x1558('0x1f')],_0x5371ea=_0x5ae8ce[_0x1558('0x1f')]+_0x5ae8ce[_0x1558('0x20')],_0x14ea77;if(_0x5371ea>=_0xba47ba){_0x5371ea=_0xba47ba;_0x14ea77=0xc8;}else{_0x14ea77=0xce;}_0x130fc7['status'](_0x14ea77);return _0x130fc7['set'](_0x1558('0x21'),_0x1b781+'-'+_0x5371ea+'/'+_0xba47ba)[_0x1558('0x1d')](_0x47347c);}return null;};}function patchUpdates(_0xaa0a82){return function(_0x14803d){try{jsonpatch[_0x1558('0x22')](_0x14803d,_0xaa0a82,!![]);}catch(_0x114d86){return BPromise[_0x1558('0x23')](_0x114d86);}return _0x14803d[_0x1558('0x24')]();};}function saveUpdates(_0x5719fb,_0x5bb8b3){return function(_0x56118b){if(_0x56118b){return _0x56118b[_0x1558('0x25')](_0x5719fb)[_0x1558('0x26')](function(_0xb86dbd){return _0xb86dbd;});}return null;};}function removeEntity(_0x146b66,_0x37f448){return function(_0x1646b7){if(_0x1646b7){return _0x1646b7[_0x1558('0x27')]()[_0x1558('0x26')](function(){var _0x5a88c3=_0x1646b7[_0x1558('0x28')]({'plain':!![]});var _0x487c0c=_0x1558('0x29');return db[_0x1558('0x2a')][_0x1558('0x27')]({'where':{'type':_0x487c0c,'resourceId':_0x5a88c3['id']}})[_0x1558('0x26')](function(){return _0x1646b7;});})[_0x1558('0x26')](function(){_0x146b66[_0x1558('0x1b')](0xcc)[_0x1558('0x1c')]();});}};}function handleEntityNotFound(_0x4dff68,_0x46cbd5){return function(_0x19f884){if(!_0x19f884){_0x4dff68[_0x1558('0x1a')](0x194);}return _0x19f884;};}function handleError(_0x1ae7c4,_0xca0eac){_0xca0eac=_0xca0eac||0x1f4;return function(_0x52f44e){logger[_0x1558('0x2b')](_0x52f44e[_0x1558('0x2c')]);if(_0x52f44e[_0x1558('0x2d')]){delete _0x52f44e['name'];}_0x1ae7c4[_0x1558('0x1b')](_0xca0eac)[_0x1558('0x2e')](_0x52f44e);};}exports[_0x1558('0x2f')]=function(_0x56edc3,_0x2d0f08){var _0x53b11a={},_0x2bf88d={},_0x2a7637={'count':0x0,'rows':[]};var _0x58bb2b=db[_0x1558('0x30')]['rawAttributes'];_0x2bf88d['model']=_[_0x1558('0x31')](_0x58bb2b);_0x2bf88d[_0x1558('0x32')]=_[_0x1558('0x31')](_0x56edc3[_0x1558('0x32')]);_0x2bf88d[_0x1558('0x33')]=_['intersection'](_0x2bf88d['model'],_0x2bf88d[_0x1558('0x32')]);_0x53b11a[_0x1558('0x34')]=_[_0x1558('0x35')](_0x2bf88d[_0x1558('0x36')],qs[_0x1558('0x37')](_0x56edc3[_0x1558('0x32')]['fields']));_0x53b11a[_0x1558('0x34')]=_0x53b11a['attributes'][_0x1558('0x38')]?_0x53b11a[_0x1558('0x34')]:_0x2bf88d[_0x1558('0x36')];if(!_0x56edc3[_0x1558('0x32')][_0x1558('0x39')](_0x1558('0x3a'))){_0x53b11a[_0x1558('0x20')]=qs[_0x1558('0x20')](_0x56edc3['query']['limit']);_0x53b11a[_0x1558('0x1f')]=qs[_0x1558('0x1f')](_0x56edc3['query']['offset']);}_0x53b11a['order']=qs[_0x1558('0x3b')](_0x56edc3['query'][_0x1558('0x3b')]);_0x53b11a[_0x1558('0x3c')]=qs['filters'](_[_0x1558('0x3d')](_0x56edc3['query'],_0x2bf88d[_0x1558('0x33')]));if(_0x56edc3['query'][_0x1558('0x3e')]){_0x53b11a['where']=_[_0x1558('0x3f')](_0x53b11a[_0x1558('0x3c')],{'$or':_[_0x1558('0x40')](_0x58bb2b,function(_0x2ab65f){if(_0x2ab65f[_0x1558('0x41')][_0x1558('0x42')]!==_0x1558('0x43')){var _0x29e413={};_0x29e413[_0x2ab65f[_0x1558('0x44')]]={'$like':'%'+_0x56edc3['query']['filter']+'%'};return _0x29e413;}})});}_0x53b11a=_[_0x1558('0x3f')]({},_0x53b11a,_0x56edc3[_0x1558('0x45')]);var _0x1526f4={'where':_0x53b11a[_0x1558('0x3c')]};return db[_0x1558('0x30')][_0x1558('0x1e')](_0x1526f4)[_0x1558('0x26')](function(_0x4d2c14){_0x2a7637[_0x1558('0x1e')]=_0x4d2c14;if(_0x56edc3['query'][_0x1558('0x46')]){_0x53b11a['include']=[{'all':!![]}];}return db[_0x1558('0x30')][_0x1558('0x47')](_0x53b11a);})[_0x1558('0x26')](function(_0x667d0a){_0x2a7637[_0x1558('0x48')]=_0x667d0a;return _0x2a7637;})['then'](respondWithFilteredResult(_0x2d0f08,_0x53b11a))[_0x1558('0x49')](handleError(_0x2d0f08,null));};exports['show']=function(_0xc35c46,_0x304b9c){var _0x346af2={'raw':!![],'where':{'id':_0xc35c46[_0x1558('0x4a')]['id']}},_0x3f8503={};_0x3f8503[_0x1558('0x36')]=_[_0x1558('0x31')](db[_0x1558('0x30')][_0x1558('0x4b')]);_0x3f8503['query']=_['keys'](_0xc35c46[_0x1558('0x32')]);_0x3f8503[_0x1558('0x33')]=_['intersection'](_0x3f8503[_0x1558('0x36')],_0x3f8503[_0x1558('0x32')]);_0x346af2[_0x1558('0x34')]=_['intersection'](_0x3f8503[_0x1558('0x36')],qs[_0x1558('0x37')](_0xc35c46['query'][_0x1558('0x37')]));_0x346af2[_0x1558('0x34')]=_0x346af2[_0x1558('0x34')]['length']?_0x346af2[_0x1558('0x34')]:_0x3f8503['model'];if(_0xc35c46[_0x1558('0x32')][_0x1558('0x46')]){_0x346af2[_0x1558('0x4c')]=[{'all':!![]}];}_0x346af2=_[_0x1558('0x3f')]({},_0x346af2,_0xc35c46[_0x1558('0x45')]);return db[_0x1558('0x30')][_0x1558('0x4d')](_0x346af2)['then'](handleEntityNotFound(_0x304b9c,null))[_0x1558('0x26')](respondWithResult(_0x304b9c,null))['catch'](handleError(_0x304b9c,null));};exports[_0x1558('0x4e')]=function(_0x5e482a,_0x4ca61e){return db[_0x1558('0x30')]['create'](_0x5e482a['body'],{})[_0x1558('0x26')](function(_0x247f55){var _0x341ab7=_0x5e482a['user'][_0x1558('0x28')]({'plain':!![]});if(!_0x341ab7)throw new Error(_0x1558('0x4f'));if(_0x341ab7[_0x1558('0x50')]===_0x1558('0x51')){var _0x22ff42=_0x247f55[_0x1558('0x28')]({'plain':!![]});var _0x5c614f=_0x1558('0x29');return db[_0x1558('0x52')][_0x1558('0x4d')]({'where':{'name':_0x5c614f,'userProfileId':_0x341ab7[_0x1558('0x53')]},'raw':!![]})[_0x1558('0x26')](function(_0x493834){if(_0x493834&&_0x493834[_0x1558('0x54')]===0x0){return db[_0x1558('0x2a')]['create']({'name':_0x22ff42['name'],'resourceId':_0x22ff42['id'],'type':_0x493834[_0x1558('0x2d')],'sectionId':_0x493834['id']},{})['then'](function(){return _0x247f55;});}else{return _0x247f55;}})[_0x1558('0x49')](function(_0x4c9e28){logger[_0x1558('0x2b')](_0x1558('0x55'),_0x4c9e28);throw _0x4c9e28;});}return _0x247f55;})[_0x1558('0x26')](respondWithResult(_0x4ca61e,0xc9))[_0x1558('0x49')](handleError(_0x4ca61e,null));};exports['update']=function(_0x2429bd,_0xa32a22){if(_0x2429bd[_0x1558('0x56')]['id']){delete _0x2429bd['body']['id'];}return db[_0x1558('0x30')]['find']({'where':{'id':_0x2429bd[_0x1558('0x4a')]['id']}})['then'](handleEntityNotFound(_0xa32a22,null))[_0x1558('0x26')](saveUpdates(_0x2429bd[_0x1558('0x56')],null))[_0x1558('0x26')](respondWithResult(_0xa32a22,null))[_0x1558('0x49')](handleError(_0xa32a22,null));};exports['destroy']=function(_0x30b1a5,_0x416df0){return db[_0x1558('0x30')][_0x1558('0x4d')]({'where':{'id':_0x30b1a5[_0x1558('0x4a')]['id']}})[_0x1558('0x26')](handleEntityNotFound(_0x416df0,null))[_0x1558('0x26')](removeEntity(_0x416df0,null))['catch'](handleError(_0x416df0,null));}; \ No newline at end of file +var _0x87d8=['eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','set','apply','reject','save','update','destroy','then','get','UserProfileResource','end','error','stack','name','send','index','rawAttributes','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','limit','order','sort','pick','filter','where','merge','map','type','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','Tag','keys','length','include','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Tags','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s'];(function(_0x5d510e,_0x2ca627){var _0x6c40a4=function(_0x157bbe){while(--_0x157bbe){_0x5d510e['push'](_0x5d510e['shift']());}};_0x6c40a4(++_0x2ca627);}(_0x87d8,0x1a9));var _0x887d=function(_0x22342c,_0x218835){_0x22342c=_0x22342c-0x0;var _0xd3b434=_0x87d8[_0x22342c];return _0xd3b434;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x887d('0x0'));var rimraf=require(_0x887d('0x1'));var zipdir=require(_0x887d('0x2'));var jsonpatch=require(_0x887d('0x3'));var rp=require(_0x887d('0x4'));var moment=require(_0x887d('0x5'));var BPromise=require(_0x887d('0x6'));var Mustache=require(_0x887d('0x7'));var util=require(_0x887d('0x8'));var path=require(_0x887d('0x9'));var sox=require(_0x887d('0xa'));var csv=require(_0x887d('0xb'));var ejs=require(_0x887d('0xc'));var fs=require('fs');var _=require(_0x887d('0xd'));var squel=require(_0x887d('0xe'));var crypto=require('crypto');var jsforce=require(_0x887d('0xf'));var deskjs=require(_0x887d('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x887d('0x11'));var qs=require(_0x887d('0x12'));var as=require(_0x887d('0x13'));var hardwareService=require(_0x887d('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x887d('0x15'));var config=require(_0x887d('0x16'));var db=require(_0x887d('0x17'))['db'];function respondWithStatusCode(_0x3989d7,_0x33227a){_0x33227a=_0x33227a||0xcc;return function(_0x40b460){if(_0x40b460){return _0x3989d7[_0x887d('0x18')](_0x33227a);}return _0x3989d7[_0x887d('0x19')](_0x33227a)['end']();};}function respondWithResult(_0x170729,_0x3c7c9d){_0x3c7c9d=_0x3c7c9d||0xc8;return function(_0x8004b0){if(_0x8004b0){return _0x170729['status'](_0x3c7c9d)[_0x887d('0x1a')](_0x8004b0);}};}function respondWithFilteredResult(_0x1d243f,_0x47b8dd){return function(_0x572435){if(_0x572435){var _0x592951=_0x572435[_0x887d('0x1b')],_0x2ae0f0=_0x47b8dd[_0x887d('0x1c')],_0xbebeee=_0x47b8dd[_0x887d('0x1c')]+_0x47b8dd['limit'],_0x5d4fce;if(_0xbebeee>=_0x592951){_0xbebeee=_0x592951;_0x5d4fce=0xc8;}else{_0x5d4fce=0xce;}_0x1d243f[_0x887d('0x19')](_0x5d4fce);return _0x1d243f[_0x887d('0x1d')]('Content-Range',_0x2ae0f0+'-'+_0xbebeee+'/'+_0x592951)[_0x887d('0x1a')](_0x572435);}return null;};}function patchUpdates(_0x54481b){return function(_0x3adfc1){try{jsonpatch[_0x887d('0x1e')](_0x3adfc1,_0x54481b,!![]);}catch(_0x1ab5fc){return BPromise[_0x887d('0x1f')](_0x1ab5fc);}return _0x3adfc1[_0x887d('0x20')]();};}function saveUpdates(_0x378edb,_0x2efaa8){return function(_0x3200fc){if(_0x3200fc){return _0x3200fc[_0x887d('0x21')](_0x378edb)['then'](function(_0x5c4f2d){return _0x5c4f2d;});}return null;};}function removeEntity(_0x9c59e3,_0x4e0c55){return function(_0x2aca37){if(_0x2aca37){return _0x2aca37[_0x887d('0x22')]()[_0x887d('0x23')](function(){var _0x1dcfd2=_0x2aca37[_0x887d('0x24')]({'plain':!![]});var _0x3d4a92='Tags';return db[_0x887d('0x25')][_0x887d('0x22')]({'where':{'type':_0x3d4a92,'resourceId':_0x1dcfd2['id']}})['then'](function(){return _0x2aca37;});})['then'](function(){_0x9c59e3[_0x887d('0x19')](0xcc)[_0x887d('0x26')]();});}};}function handleEntityNotFound(_0x15c730,_0x36d9fd){return function(_0x47e86a){if(!_0x47e86a){_0x15c730[_0x887d('0x18')](0x194);}return _0x47e86a;};}function handleError(_0x3c67ee,_0x2cc7f7){_0x2cc7f7=_0x2cc7f7||0x1f4;return function(_0x487f63){logger[_0x887d('0x27')](_0x487f63[_0x887d('0x28')]);if(_0x487f63[_0x887d('0x29')]){delete _0x487f63['name'];}_0x3c67ee['status'](_0x2cc7f7)[_0x887d('0x2a')](_0x487f63);};}exports[_0x887d('0x2b')]=function(_0x57affa,_0x5dd9db){var _0x329b92={},_0x5768c0={},_0x26a239={'count':0x0,'rows':[]};var _0x41680b=db['Tag'][_0x887d('0x2c')];_0x5768c0[_0x887d('0x2d')]=_['keys'](_0x41680b);_0x5768c0['query']=_['keys'](_0x57affa[_0x887d('0x2e')]);_0x5768c0[_0x887d('0x2f')]=_[_0x887d('0x30')](_0x5768c0[_0x887d('0x2d')],_0x5768c0[_0x887d('0x2e')]);_0x329b92['attributes']=_[_0x887d('0x30')](_0x5768c0[_0x887d('0x2d')],qs[_0x887d('0x31')](_0x57affa['query']['fields']));_0x329b92[_0x887d('0x32')]=_0x329b92['attributes']['length']?_0x329b92[_0x887d('0x32')]:_0x5768c0['model'];if(!_0x57affa[_0x887d('0x2e')][_0x887d('0x33')](_0x887d('0x34'))){_0x329b92[_0x887d('0x35')]=qs['limit'](_0x57affa[_0x887d('0x2e')][_0x887d('0x35')]);_0x329b92[_0x887d('0x1c')]=qs[_0x887d('0x1c')](_0x57affa[_0x887d('0x2e')]['offset']);}_0x329b92[_0x887d('0x36')]=qs[_0x887d('0x37')](_0x57affa['query'][_0x887d('0x37')]);_0x329b92['where']=qs[_0x887d('0x2f')](_[_0x887d('0x38')](_0x57affa['query'],_0x5768c0['filters']));if(_0x57affa['query'][_0x887d('0x39')]){_0x329b92[_0x887d('0x3a')]=_[_0x887d('0x3b')](_0x329b92[_0x887d('0x3a')],{'$or':_[_0x887d('0x3c')](_0x41680b,function(_0x294ee3){if(_0x294ee3[_0x887d('0x3d')]['key']!==_0x887d('0x3e')){var _0x53d7a3={};_0x53d7a3[_0x294ee3['field']]={'$like':'%'+_0x57affa['query']['filter']+'%'};return _0x53d7a3;}})});}_0x329b92=_[_0x887d('0x3b')]({},_0x329b92,_0x57affa[_0x887d('0x3f')]);var _0x32f8ce={'where':_0x329b92[_0x887d('0x3a')]};return db['Tag'][_0x887d('0x1b')](_0x32f8ce)[_0x887d('0x23')](function(_0x489960){_0x26a239[_0x887d('0x1b')]=_0x489960;if(_0x57affa['query'][_0x887d('0x40')]){_0x329b92['include']=[{'all':!![]}];}return db['Tag'][_0x887d('0x41')](_0x329b92);})['then'](function(_0x585386){_0x26a239[_0x887d('0x42')]=_0x585386;return _0x26a239;})[_0x887d('0x23')](respondWithFilteredResult(_0x5dd9db,_0x329b92))[_0x887d('0x43')](handleError(_0x5dd9db,null));};exports[_0x887d('0x44')]=function(_0x585364,_0x5155e1){var _0x115fc5={'raw':!![],'where':{'id':_0x585364[_0x887d('0x45')]['id']}},_0x3480e0={};_0x3480e0[_0x887d('0x2d')]=_['keys'](db[_0x887d('0x46')][_0x887d('0x2c')]);_0x3480e0['query']=_[_0x887d('0x47')](_0x585364[_0x887d('0x2e')]);_0x3480e0['filters']=_[_0x887d('0x30')](_0x3480e0['model'],_0x3480e0['query']);_0x115fc5['attributes']=_[_0x887d('0x30')](_0x3480e0[_0x887d('0x2d')],qs[_0x887d('0x31')](_0x585364[_0x887d('0x2e')]['fields']));_0x115fc5[_0x887d('0x32')]=_0x115fc5['attributes'][_0x887d('0x48')]?_0x115fc5['attributes']:_0x3480e0[_0x887d('0x2d')];if(_0x585364['query'][_0x887d('0x40')]){_0x115fc5[_0x887d('0x49')]=[{'all':!![]}];}_0x115fc5=_['merge']({},_0x115fc5,_0x585364[_0x887d('0x3f')]);return db[_0x887d('0x46')][_0x887d('0x4a')](_0x115fc5)[_0x887d('0x23')](handleEntityNotFound(_0x5155e1,null))['then'](respondWithResult(_0x5155e1,null))[_0x887d('0x43')](handleError(_0x5155e1,null));};exports[_0x887d('0x4b')]=function(_0x46a566,_0x288a8b){return db[_0x887d('0x46')][_0x887d('0x4b')](_0x46a566[_0x887d('0x4c')],{})[_0x887d('0x23')](function(_0x3ccfd0){var _0x44d069=_0x46a566['user'][_0x887d('0x24')]({'plain':!![]});if(!_0x44d069)throw new Error(_0x887d('0x4d'));if(_0x44d069[_0x887d('0x4e')]===_0x887d('0x4f')){var _0x3a42b9=_0x3ccfd0[_0x887d('0x24')]({'plain':!![]});var _0x4e3a08=_0x887d('0x50');return db[_0x887d('0x51')][_0x887d('0x4a')]({'where':{'name':_0x4e3a08,'userProfileId':_0x44d069[_0x887d('0x52')]},'raw':!![]})[_0x887d('0x23')](function(_0x2f6e78){if(_0x2f6e78&&_0x2f6e78[_0x887d('0x53')]===0x0){return db[_0x887d('0x25')][_0x887d('0x4b')]({'name':_0x3a42b9['name'],'resourceId':_0x3a42b9['id'],'type':_0x2f6e78['name'],'sectionId':_0x2f6e78['id']},{})[_0x887d('0x23')](function(){return _0x3ccfd0;});}else{return _0x3ccfd0;}})[_0x887d('0x43')](function(_0x5572a1){logger[_0x887d('0x27')](_0x887d('0x54'),_0x5572a1);throw _0x5572a1;});}return _0x3ccfd0;})['then'](respondWithResult(_0x288a8b,0xc9))[_0x887d('0x43')](handleError(_0x288a8b,null));};exports['update']=function(_0x45607c,_0x41ac09){if(_0x45607c['body']['id']){delete _0x45607c[_0x887d('0x4c')]['id'];}return db[_0x887d('0x46')][_0x887d('0x4a')]({'where':{'id':_0x45607c['params']['id']}})['then'](handleEntityNotFound(_0x41ac09,null))['then'](saveUpdates(_0x45607c['body'],null))['then'](respondWithResult(_0x41ac09,null))['catch'](handleError(_0x41ac09,null));};exports[_0x887d('0x22')]=function(_0x5332e5,_0x4c3563){return db[_0x887d('0x46')]['find']({'where':{'id':_0x5332e5[_0x887d('0x45')]['id']}})[_0x887d('0x23')](handleEntityNotFound(_0x4c3563,null))['then'](removeEntity(_0x4c3563,null))[_0x887d('0x43')](handleError(_0x4c3563,null));}; \ No newline at end of file diff --git a/server/api/tag/tag.model.js b/server/api/tag/tag.model.js index 6b6a59b..df2c86e 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 _0x40bc=['moment','bluebird','request-promise','../../config/environment','./tag.attributes','define','lodash','util'];(function(_0x35e6db,_0x53779d){var _0x249409=function(_0x72785d){while(--_0x72785d){_0x35e6db['push'](_0x35e6db['shift']());}};_0x249409(++_0x53779d);}(_0x40bc,0x10e));var _0xc40b=function(_0x6b65d5,_0x504060){_0x6b65d5=_0x6b65d5-0x0;var _0x5c0416=_0x40bc[_0x6b65d5];return _0x5c0416;};'use strict';var _=require(_0xc40b('0x0'));var util=require(_0xc40b('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xc40b('0x2'));var BPromise=require(_0xc40b('0x3'));var rp=require(_0xc40b('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xc40b('0x5'));var attributes=require(_0xc40b('0x6'));module['exports']=function(_0x4bb225,_0x1a29fe){return _0x4bb225[_0xc40b('0x7')]('Tag',attributes,{'tableName':'tools_tags','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8e54=['../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./tag.attributes','exports','define','Tag','tools_tags','lodash','util'];(function(_0x44044a,_0x3a0097){var _0x43bb6e=function(_0x1afe12){while(--_0x1afe12){_0x44044a['push'](_0x44044a['shift']());}};_0x43bb6e(++_0x3a0097);}(_0x8e54,0x108));var _0x48e5=function(_0x5a31e0,_0x363532){_0x5a31e0=_0x5a31e0-0x0;var _0xb4ce1f=_0x8e54[_0x5a31e0];return _0xb4ce1f;};'use strict';var _=require(_0x48e5('0x0'));var util=require(_0x48e5('0x1'));var logger=require(_0x48e5('0x2'))(_0x48e5('0x3'));var moment=require(_0x48e5('0x4'));var BPromise=require(_0x48e5('0x5'));var rp=require(_0x48e5('0x6'));var fs=require('fs');var path=require(_0x48e5('0x7'));var rimraf=require('rimraf');var config=require(_0x48e5('0x8'));var attributes=require(_0x48e5('0x9'));module[_0x48e5('0xa')]=function(_0x7112f7,_0x7b6fc6){return _0x7112f7[_0x48e5('0xb')](_0x48e5('0xc'),attributes,{'tableName':_0x48e5('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/tag/tag.rpc.js b/server/api/tag/tag.rpc.js index 6356624..68ffa67 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 _0xc6d8=['debug','Tag,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','moment','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','info','Tag,\x20%s,\x20%s','request\x20sent'];(function(_0xf0a56f,_0x2baad0){var _0x359c6e=function(_0x12da3b){while(--_0x12da3b){_0xf0a56f['push'](_0xf0a56f['shift']());}};_0x359c6e(++_0x2baad0);}(_0xc6d8,0xd7));var _0x8c6d=function(_0x61bb05,_0x47421f){_0x61bb05=_0x61bb05-0x0;var _0x3ceb3e=_0xc6d8[_0x61bb05];return _0x3ceb3e;};'use strict';var _=require(_0x8c6d('0x0'));var util=require('util');var moment=require(_0x8c6d('0x1'));var BPromise=require('bluebird');var rs=require(_0x8c6d('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8c6d('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x8c6d('0x4'));var config=require(_0x8c6d('0x5'));var jayson=require(_0x8c6d('0x6'));var client=jayson[_0x8c6d('0x7')][_0x8c6d('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2dbb52,_0x98cae4,_0x5529f1){return new BPromise(function(_0x1496ba,_0x75c49f){return client[_0x8c6d('0x9')](_0x2dbb52,_0x5529f1)['then'](function(_0x3cecc1){logger[_0x8c6d('0xa')](_0x8c6d('0xb'),_0x98cae4,_0x8c6d('0xc'));logger[_0x8c6d('0xd')](_0x8c6d('0xe'),_0x98cae4,_0x8c6d('0xc'),JSON[_0x8c6d('0xf')](_0x3cecc1));if(_0x3cecc1['error']){if(_0x3cecc1[_0x8c6d('0x10')]['code']===0x1f4){logger['error'](_0x8c6d('0xb'),_0x98cae4,_0x3cecc1[_0x8c6d('0x10')][_0x8c6d('0x11')]);return _0x75c49f(_0x3cecc1[_0x8c6d('0x10')][_0x8c6d('0x11')]);}logger[_0x8c6d('0x10')](_0x8c6d('0xb'),_0x98cae4,_0x3cecc1[_0x8c6d('0x10')][_0x8c6d('0x11')]);return _0x1496ba(_0x3cecc1[_0x8c6d('0x10')]['message']);}else{logger[_0x8c6d('0xa')]('Tag,\x20%s,\x20%s',_0x98cae4,_0x8c6d('0xc'));_0x1496ba(_0x3cecc1['result'][_0x8c6d('0x11')]);}})[_0x8c6d('0x12')](function(_0x52ed7b){logger[_0x8c6d('0x10')](_0x8c6d('0xb'),_0x98cae4,_0x52ed7b);_0x75c49f(_0x52ed7b);});});} \ No newline at end of file +var _0xde2c=['Tag,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','Tag,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x5de479,_0x546a70){var _0x2ece75=function(_0x535d90){while(--_0x535d90){_0x5de479['push'](_0x5de479['shift']());}};_0x2ece75(++_0x546a70);}(_0xde2c,0x7f));var _0xcde2=function(_0x82140,_0x3a9d87){_0x82140=_0x82140-0x0;var _0x2b15a6=_0xde2c[_0x82140];return _0x2b15a6;};'use strict';var _=require(_0xcde2('0x0'));var util=require(_0xcde2('0x1'));var moment=require(_0xcde2('0x2'));var BPromise=require(_0xcde2('0x3'));var rs=require(_0xcde2('0x4'));var fs=require('fs');var Redis=require(_0xcde2('0x5'));var db=require(_0xcde2('0x6'))['db'];var utils=require(_0xcde2('0x7'));var logger=require('../../config/logger')(_0xcde2('0x8'));var config=require(_0xcde2('0x9'));var jayson=require(_0xcde2('0xa'));var client=jayson[_0xcde2('0xb')][_0xcde2('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x53c558,_0x2b27ef,_0x385e83){return new BPromise(function(_0x9c7036,_0x544235){return client['request'](_0x53c558,_0x385e83)[_0xcde2('0xd')](function(_0x1c8b3c){logger['info'](_0xcde2('0xe'),_0x2b27ef,_0xcde2('0xf'));logger[_0xcde2('0x10')](_0xcde2('0x11'),_0x2b27ef,'request\x20sent',JSON['stringify'](_0x1c8b3c));if(_0x1c8b3c[_0xcde2('0x12')]){if(_0x1c8b3c[_0xcde2('0x12')][_0xcde2('0x13')]===0x1f4){logger[_0xcde2('0x12')](_0xcde2('0xe'),_0x2b27ef,_0x1c8b3c[_0xcde2('0x12')]['message']);return _0x544235(_0x1c8b3c[_0xcde2('0x12')]['message']);}logger[_0xcde2('0x12')]('Tag,\x20%s,\x20%s',_0x2b27ef,_0x1c8b3c['error'][_0xcde2('0x14')]);return _0x9c7036(_0x1c8b3c[_0xcde2('0x12')][_0xcde2('0x14')]);}else{logger[_0xcde2('0x15')](_0xcde2('0xe'),_0x2b27ef,'request\x20sent');_0x9c7036(_0x1c8b3c[_0xcde2('0x16')]['message']);}})[_0xcde2('0x17')](function(_0x198840){logger[_0xcde2('0x12')](_0xcde2('0xe'),_0x2b27ef,_0x198840);_0x544235(_0x198840);});});} \ No newline at end of file diff --git a/server/api/team/index.js b/server/api/team/index.js index 8375ee9..6d8b570 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 _0x1055=['./team.controller','get','index','/:id','isAuthenticated','show','getQueues','/:id/users','getAgents','post','create','/:id/queues','addQueues','put','delete','destroy','multer','util','path','express','Router','../../components/interaction/service','../../config/environment'];(function(_0x462633,_0x25888a){var _0xecd6be=function(_0x23f790){while(--_0x23f790){_0x462633['push'](_0x462633['shift']());}};_0xecd6be(++_0x25888a);}(_0x1055,0x1ae));var _0x5105=function(_0x1fb7d1,_0x108781){_0x1fb7d1=_0x1fb7d1-0x0;var _0x2480d8=_0x1055[_0x1fb7d1];return _0x2480d8;};'use strict';var multer=require(_0x5105('0x0'));var util=require(_0x5105('0x1'));var path=require(_0x5105('0x2'));var timeout=require('connect-timeout');var express=require(_0x5105('0x3'));var router=express[_0x5105('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x5105('0x5'));var config=require(_0x5105('0x6'));var controller=require(_0x5105('0x7'));router[_0x5105('0x8')]('/',auth['isAuthenticated'](),controller[_0x5105('0x9')]);router[_0x5105('0x8')](_0x5105('0xa'),auth[_0x5105('0xb')](),controller[_0x5105('0xc')]);router[_0x5105('0x8')]('/:id/queues',auth[_0x5105('0xb')](),controller[_0x5105('0xd')]);router[_0x5105('0x8')](_0x5105('0xe'),auth[_0x5105('0xb')](),controller[_0x5105('0xf')]);router[_0x5105('0x10')]('/',auth[_0x5105('0xb')](),controller[_0x5105('0x11')]);router[_0x5105('0x10')](_0x5105('0x12'),auth[_0x5105('0xb')](),controller[_0x5105('0x13')]);router[_0x5105('0x10')](_0x5105('0xe'),auth['isAuthenticated'](),controller['addAgents']);router[_0x5105('0x14')](_0x5105('0xa'),auth[_0x5105('0xb')](),controller['update']);router[_0x5105('0x15')](_0x5105('0xa'),auth[_0x5105('0xb')](),controller[_0x5105('0x16')]);router[_0x5105('0x15')](_0x5105('0x12'),auth[_0x5105('0xb')](),controller['removeQueues']);router['delete'](_0x5105('0xe'),auth[_0x5105('0xb')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file +var _0x3bc3=['Router','../../components/interaction/service','./team.controller','get','index','/:id','isAuthenticated','/:id/queues','/:id/users','getAgents','post','create','addQueues','addAgents','put','update','delete','removeAgents','exports','multer','util','path','express'];(function(_0xdc74ff,_0x480b9f){var _0x406078=function(_0x2e8aba){while(--_0x2e8aba){_0xdc74ff['push'](_0xdc74ff['shift']());}};_0x406078(++_0x480b9f);}(_0x3bc3,0x1df));var _0x33bc=function(_0x2af0a1,_0x49c5b1){_0x2af0a1=_0x2af0a1-0x0;var _0x2b7a16=_0x3bc3[_0x2af0a1];return _0x2b7a16;};'use strict';var multer=require(_0x33bc('0x0'));var util=require(_0x33bc('0x1'));var path=require(_0x33bc('0x2'));var timeout=require('connect-timeout');var express=require(_0x33bc('0x3'));var router=express[_0x33bc('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x33bc('0x5'));var config=require('../../config/environment');var controller=require(_0x33bc('0x6'));router[_0x33bc('0x7')]('/',auth['isAuthenticated'](),controller[_0x33bc('0x8')]);router[_0x33bc('0x7')](_0x33bc('0x9'),auth[_0x33bc('0xa')](),controller['show']);router[_0x33bc('0x7')](_0x33bc('0xb'),auth[_0x33bc('0xa')](),controller['getQueues']);router[_0x33bc('0x7')](_0x33bc('0xc'),auth[_0x33bc('0xa')](),controller[_0x33bc('0xd')]);router[_0x33bc('0xe')]('/',auth[_0x33bc('0xa')](),controller[_0x33bc('0xf')]);router[_0x33bc('0xe')]('/:id/queues',auth[_0x33bc('0xa')](),controller[_0x33bc('0x10')]);router[_0x33bc('0xe')]('/:id/users',auth[_0x33bc('0xa')](),controller[_0x33bc('0x11')]);router[_0x33bc('0x12')](_0x33bc('0x9'),auth[_0x33bc('0xa')](),controller[_0x33bc('0x13')]);router['delete'](_0x33bc('0x9'),auth[_0x33bc('0xa')](),controller['destroy']);router['delete'](_0x33bc('0xb'),auth[_0x33bc('0xa')](),controller['removeQueues']);router[_0x33bc('0x14')](_0x33bc('0xc'),auth['isAuthenticated'](),controller[_0x33bc('0x15')]);module[_0x33bc('0x16')]=router; \ No newline at end of file diff --git a/server/api/team/team.attributes.js b/server/api/team/team.attributes.js index b1266dd..2c2df19 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 _0x971b=['sequelize','exports','STRING'];(function(_0x3a0631,_0x2d8a7e){var _0x44bdf0=function(_0x3d5b19){while(--_0x3d5b19){_0x3a0631['push'](_0x3a0631['shift']());}};_0x44bdf0(++_0x2d8a7e);}(_0x971b,0x10e));var _0xb971=function(_0x272ea6,_0x3f0673){_0x272ea6=_0x272ea6-0x0;var _0x43ef03=_0x971b[_0x272ea6];return _0x43ef03;};'use strict';var Sequelize=require(_0xb971('0x0'));module[_0xb971('0x1')]={'name':{'type':Sequelize[_0xb971('0x2')],'allowNull':![],'unique':'name'},'description':{'type':Sequelize[_0xb971('0x2')]}}; \ No newline at end of file +var _0x9912=['sequelize','exports','STRING','name'];(function(_0x2a9bb2,_0xccdbcb){var _0x58c695=function(_0x3ef90a){while(--_0x3ef90a){_0x2a9bb2['push'](_0x2a9bb2['shift']());}};_0x58c695(++_0xccdbcb);}(_0x9912,0x68));var _0x2991=function(_0x171082,_0x2476e5){_0x171082=_0x171082-0x0;var _0x544c7a=_0x9912[_0x171082];return _0x544c7a;};'use strict';var Sequelize=require(_0x2991('0x0'));module[_0x2991('0x1')]={'name':{'type':Sequelize[_0x2991('0x2')],'allowNull':![],'unique':_0x2991('0x3')},'description':{'type':Sequelize[_0x2991('0x2')]}}; \ No newline at end of file diff --git a/server/api/team/team.controller.js b/server/api/team/team.controller.js index 1c8d836..7ea7581 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 _0x8c38=['openchannel','isArray','userTeam:remove','pick','getAgents','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','redis','localhost','socket.io-emitter','./team.socket','register','sendStatus','status','json','count','offset','limit','Content-Range','apply','reject','save','update','then','get','Teams','UserProfileResource','destroy','end','error','stack','name','send','index','Team','model','keys','query','filters','intersection','fields','length','attributes','hasOwnProperty','nolimit','order','sort','where','merge','map','type','key','field','options','includeAll','findAll','rows','catch','show','params','rawAttributes','include','find','create','user','role','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','getQueues','channel','isValidChannel','Sequelize','Unknown\x20channel','capitalize','toLowerCase','Queue','addQueues','findOne','ValidationError','add','ids','Queues','Voice','Mail','Sms','each','User','interface','filter','UserVoiceQueueRt','upsert','isNil','format','SIP/%s','addAgents','omit','spread','emit','removeAgents','voice','chat','mail','sms','fax'];(function(_0x3c7dfa,_0x3b001b){var _0x59585f=function(_0x479d41){while(--_0x479d41){_0x3c7dfa['push'](_0x3c7dfa['shift']());}};_0x59585f(++_0x3b001b);}(_0x8c38,0x83));var _0x88c3=function(_0x33a758,_0x4d18b4){_0x33a758=_0x33a758-0x0;var _0x4ce8a5=_0x8c38[_0x33a758];return _0x4ce8a5;};'use strict';var pdf=require(_0x88c3('0x0'));var emlformat=require(_0x88c3('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x88c3('0x2'));var jsonpatch=require(_0x88c3('0x3'));var rp=require(_0x88c3('0x4'));var moment=require(_0x88c3('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x88c3('0x6'));var util=require(_0x88c3('0x7'));var path=require(_0x88c3('0x8'));var sox=require(_0x88c3('0x9'));var csv=require(_0x88c3('0xa'));var ejs=require(_0x88c3('0xb'));var fs=require('fs');var _=require(_0x88c3('0xc'));var squel=require(_0x88c3('0xd'));var crypto=require('crypto');var jsforce=require(_0x88c3('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x88c3('0xa'));var querystring=require('querystring');var Papa=require(_0x88c3('0xf'));var Redis=require('ioredis');var authService=require(_0x88c3('0x10'));var qs=require(_0x88c3('0x11'));var as=require(_0x88c3('0x12'));var hardwareService=require(_0x88c3('0x13'));var logger=require('../../config/logger')(_0x88c3('0x14'));var utils=require(_0x88c3('0x15'));var config=require(_0x88c3('0x16'));var db=require('../../mysqldb')['db'];config[_0x88c3('0x17')]=_['defaults'](config['redis'],{'host':_0x88c3('0x18'),'port':0x18eb});var socket=require(_0x88c3('0x19'))(new Redis(config[_0x88c3('0x17')]));require(_0x88c3('0x1a'))[_0x88c3('0x1b')](socket);function respondWithStatusCode(_0x524f2a,_0x3620e3){_0x3620e3=_0x3620e3||0xcc;return function(_0x3a282c){if(_0x3a282c){return _0x524f2a[_0x88c3('0x1c')](_0x3620e3);}return _0x524f2a[_0x88c3('0x1d')](_0x3620e3)['end']();};}function respondWithResult(_0x3128ac,_0x5e105f){_0x5e105f=_0x5e105f||0xc8;return function(_0x3a8345){if(_0x3a8345){return _0x3128ac[_0x88c3('0x1d')](_0x5e105f)[_0x88c3('0x1e')](_0x3a8345);}};}function respondWithFilteredResult(_0x17ea73,_0x53debd){return function(_0x4c6749){if(_0x4c6749){var _0x3b8d75=_0x4c6749[_0x88c3('0x1f')],_0x16ee57=_0x53debd[_0x88c3('0x20')],_0x2ecca1=_0x53debd[_0x88c3('0x20')]+_0x53debd[_0x88c3('0x21')],_0x594394;if(_0x2ecca1>=_0x3b8d75){_0x2ecca1=_0x3b8d75;_0x594394=0xc8;}else{_0x594394=0xce;}_0x17ea73['status'](_0x594394);return _0x17ea73['set'](_0x88c3('0x22'),_0x16ee57+'-'+_0x2ecca1+'/'+_0x3b8d75)['json'](_0x4c6749);}return null;};}function patchUpdates(_0x5302d1){return function(_0x2c5cb3){try{jsonpatch[_0x88c3('0x23')](_0x2c5cb3,_0x5302d1,!![]);}catch(_0x3666a2){return BPromise[_0x88c3('0x24')](_0x3666a2);}return _0x2c5cb3[_0x88c3('0x25')]();};}function saveUpdates(_0x3e01cc,_0x226077){return function(_0x43a933){if(_0x43a933){return _0x43a933[_0x88c3('0x26')](_0x3e01cc)[_0x88c3('0x27')](function(_0x173a97){return _0x173a97;});}return null;};}function removeEntity(_0x24b867,_0x5aa804){return function(_0x2988cd){if(_0x2988cd){return _0x2988cd['destroy']()[_0x88c3('0x27')](function(){var _0xde936d=_0x2988cd[_0x88c3('0x28')]({'plain':!![]});var _0x5ef07f=_0x88c3('0x29');return db[_0x88c3('0x2a')][_0x88c3('0x2b')]({'where':{'type':_0x5ef07f,'resourceId':_0xde936d['id']}})[_0x88c3('0x27')](function(){return _0x2988cd;});})[_0x88c3('0x27')](function(){_0x24b867[_0x88c3('0x1d')](0xcc)[_0x88c3('0x2c')]();});}};}function handleEntityNotFound(_0x454372,_0x193e2d){return function(_0x2072ce){if(!_0x2072ce){_0x454372[_0x88c3('0x1c')](0x194);}return _0x2072ce;};}function handleError(_0x2607ec,_0x3d8c32){_0x3d8c32=_0x3d8c32||0x1f4;return function(_0x50aefc){logger[_0x88c3('0x2d')](_0x50aefc[_0x88c3('0x2e')]);if(_0x50aefc[_0x88c3('0x2f')]){delete _0x50aefc[_0x88c3('0x2f')];}_0x2607ec[_0x88c3('0x1d')](_0x3d8c32)[_0x88c3('0x30')](_0x50aefc);};}exports[_0x88c3('0x31')]=function(_0x5337e8,_0x1d5341){var _0x17abfe={},_0xd00aa7={},_0x5a76f5={'count':0x0,'rows':[]};var _0x48cf6e=db[_0x88c3('0x32')]['rawAttributes'];_0xd00aa7[_0x88c3('0x33')]=_[_0x88c3('0x34')](_0x48cf6e);_0xd00aa7[_0x88c3('0x35')]=_['keys'](_0x5337e8[_0x88c3('0x35')]);_0xd00aa7[_0x88c3('0x36')]=_['intersection'](_0xd00aa7[_0x88c3('0x33')],_0xd00aa7[_0x88c3('0x35')]);_0x17abfe['attributes']=_[_0x88c3('0x37')](_0xd00aa7['model'],qs['fields'](_0x5337e8[_0x88c3('0x35')][_0x88c3('0x38')]));_0x17abfe['attributes']=_0x17abfe['attributes'][_0x88c3('0x39')]?_0x17abfe[_0x88c3('0x3a')]:_0xd00aa7[_0x88c3('0x33')];if(!_0x5337e8['query'][_0x88c3('0x3b')](_0x88c3('0x3c'))){_0x17abfe[_0x88c3('0x21')]=qs[_0x88c3('0x21')](_0x5337e8[_0x88c3('0x35')][_0x88c3('0x21')]);_0x17abfe[_0x88c3('0x20')]=qs[_0x88c3('0x20')](_0x5337e8['query'][_0x88c3('0x20')]);}_0x17abfe[_0x88c3('0x3d')]=qs[_0x88c3('0x3e')](_0x5337e8[_0x88c3('0x35')][_0x88c3('0x3e')]);_0x17abfe[_0x88c3('0x3f')]=qs[_0x88c3('0x36')](_['pick'](_0x5337e8[_0x88c3('0x35')],_0xd00aa7[_0x88c3('0x36')]));if(_0x5337e8[_0x88c3('0x35')]['filter']){_0x17abfe[_0x88c3('0x3f')]=_[_0x88c3('0x40')](_0x17abfe[_0x88c3('0x3f')],{'$or':_[_0x88c3('0x41')](_0x48cf6e,function(_0x445221){if(_0x445221[_0x88c3('0x42')][_0x88c3('0x43')]!=='VIRTUAL'){var _0x3533d8={};_0x3533d8[_0x445221[_0x88c3('0x44')]]={'$like':'%'+_0x5337e8[_0x88c3('0x35')]['filter']+'%'};return _0x3533d8;}})});}_0x17abfe=_[_0x88c3('0x40')]({},_0x17abfe,_0x5337e8[_0x88c3('0x45')]);var _0x2b488e={'where':_0x17abfe[_0x88c3('0x3f')]};return db['Team']['count'](_0x2b488e)[_0x88c3('0x27')](function(_0x510c86){_0x5a76f5[_0x88c3('0x1f')]=_0x510c86;if(_0x5337e8['query'][_0x88c3('0x46')]){_0x17abfe['include']=[{'all':!![]}];}return db['Team'][_0x88c3('0x47')](_0x17abfe);})[_0x88c3('0x27')](function(_0xefd204){_0x5a76f5[_0x88c3('0x48')]=_0xefd204;return _0x5a76f5;})[_0x88c3('0x27')](respondWithFilteredResult(_0x1d5341,_0x17abfe))[_0x88c3('0x49')](handleError(_0x1d5341,null));};exports[_0x88c3('0x4a')]=function(_0x48620d,_0x4e7056){var _0x2362f5={'raw':![],'where':{'id':_0x48620d[_0x88c3('0x4b')]['id']}},_0x27ed2e={};_0x27ed2e[_0x88c3('0x33')]=_[_0x88c3('0x34')](db['Team'][_0x88c3('0x4c')]);_0x27ed2e[_0x88c3('0x35')]=_[_0x88c3('0x34')](_0x48620d[_0x88c3('0x35')]);_0x27ed2e[_0x88c3('0x36')]=_[_0x88c3('0x37')](_0x27ed2e['model'],_0x27ed2e[_0x88c3('0x35')]);_0x2362f5[_0x88c3('0x3a')]=_[_0x88c3('0x37')](_0x27ed2e[_0x88c3('0x33')],qs['fields'](_0x48620d[_0x88c3('0x35')]['fields']));_0x2362f5[_0x88c3('0x3a')]=_0x2362f5[_0x88c3('0x3a')]['length']?_0x2362f5[_0x88c3('0x3a')]:_0x27ed2e[_0x88c3('0x33')];if(_0x48620d[_0x88c3('0x35')][_0x88c3('0x46')]){_0x2362f5[_0x88c3('0x4d')]=[{'all':!![]}];}_0x2362f5=_[_0x88c3('0x40')]({},_0x2362f5,_0x48620d[_0x88c3('0x45')]);return db['Team'][_0x88c3('0x4e')](_0x2362f5)['then'](handleEntityNotFound(_0x4e7056,null))['then'](respondWithResult(_0x4e7056,null))[_0x88c3('0x49')](handleError(_0x4e7056,null));};exports[_0x88c3('0x4f')]=function(_0x1abbf3,_0x2ed720){return db[_0x88c3('0x32')][_0x88c3('0x4f')](_0x1abbf3['body'],{})[_0x88c3('0x27')](function(_0x5d0973){var _0x240985=_0x1abbf3[_0x88c3('0x50')][_0x88c3('0x28')]({'plain':!![]});if(!_0x240985)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x240985[_0x88c3('0x51')]===_0x88c3('0x50')){var _0x5dd4c4=_0x5d0973[_0x88c3('0x28')]({'plain':!![]});var _0x2b21c0='Teams';return db['UserProfileSection'][_0x88c3('0x4e')]({'where':{'name':_0x2b21c0,'userProfileId':_0x240985[_0x88c3('0x52')]},'raw':!![]})['then'](function(_0x51c822){if(_0x51c822&&_0x51c822['autoAssociation']===0x0){return db[_0x88c3('0x2a')][_0x88c3('0x4f')]({'name':_0x5dd4c4[_0x88c3('0x2f')],'resourceId':_0x5dd4c4['id'],'type':_0x51c822[_0x88c3('0x2f')],'sectionId':_0x51c822['id']},{})[_0x88c3('0x27')](function(){return _0x5d0973;});}else{return _0x5d0973;}})[_0x88c3('0x49')](function(_0x20cc62){logger[_0x88c3('0x2d')](_0x88c3('0x53'),_0x20cc62);throw _0x20cc62;});}return _0x5d0973;})[_0x88c3('0x27')](respondWithResult(_0x2ed720,0xc9))[_0x88c3('0x49')](handleError(_0x2ed720,null));};exports[_0x88c3('0x26')]=function(_0x5d1259,_0x3271e2){if(_0x5d1259['body']['id']){delete _0x5d1259[_0x88c3('0x54')]['id'];}return db[_0x88c3('0x32')][_0x88c3('0x4e')]({'where':{'id':_0x5d1259[_0x88c3('0x4b')]['id']}})[_0x88c3('0x27')](handleEntityNotFound(_0x3271e2,null))[_0x88c3('0x27')](saveUpdates(_0x5d1259['body'],null))[_0x88c3('0x27')](respondWithResult(_0x3271e2,null))[_0x88c3('0x49')](handleError(_0x3271e2,null));};exports[_0x88c3('0x2b')]=function(_0x25e207,_0x48f72b){return db[_0x88c3('0x32')][_0x88c3('0x4e')]({'where':{'id':_0x25e207['params']['id']}})[_0x88c3('0x27')](handleEntityNotFound(_0x48f72b,null))['then'](removeEntity(_0x48f72b,null))[_0x88c3('0x49')](handleError(_0x48f72b,null));};exports[_0x88c3('0x55')]=function(_0x3a1334,_0x5860bb,_0x32463a){return db[_0x88c3('0x32')]['findOne']({'where':{'id':_0x3a1334[_0x88c3('0x4b')]['id']}})[_0x88c3('0x27')](handleEntityNotFound(_0x5860bb,null))[_0x88c3('0x27')](function(_0x6fb6be){if(!_0x3a1334[_0x88c3('0x35')][_0x88c3('0x56')]||!utils[_0x88c3('0x57')](_0x3a1334[_0x88c3('0x35')][_0x88c3('0x56')])){throw new db[(_0x88c3('0x58'))]['ValidationError'](_0x88c3('0x59'));}var _0x28419f={};var _0x4a4187={};_0x4a4187[_0x88c3('0x33')]=_[_0x88c3('0x34')](db[_[_0x88c3('0x5a')](_0x3a1334['query'][_0x88c3('0x56')][_0x88c3('0x5b')]())+_0x88c3('0x5c')][_0x88c3('0x4c')]);_0x4a4187[_0x88c3('0x35')]=_[_0x88c3('0x34')](_0x3a1334[_0x88c3('0x35')]);_0x4a4187[_0x88c3('0x36')]=_[_0x88c3('0x37')](_0x4a4187[_0x88c3('0x33')],_0x4a4187[_0x88c3('0x35')]);_0x28419f['attributes']=_[_0x88c3('0x37')](_0x4a4187[_0x88c3('0x33')],qs[_0x88c3('0x38')](_0x3a1334[_0x88c3('0x35')][_0x88c3('0x38')]));_0x28419f['attributes']=_0x28419f[_0x88c3('0x3a')][_0x88c3('0x39')]?_0x28419f['attributes']:_0x4a4187[_0x88c3('0x33')];_0x28419f[_0x88c3('0x21')]=qs[_0x88c3('0x21')](_0x3a1334[_0x88c3('0x35')][_0x88c3('0x21')]);_0x28419f['offset']=qs[_0x88c3('0x20')](_0x3a1334['query']['offset']);_0x28419f[_0x88c3('0x3d')]=qs[_0x88c3('0x3e')](_0x3a1334[_0x88c3('0x35')][_0x88c3('0x3e')]);_0x28419f[_0x88c3('0x3f')]=qs[_0x88c3('0x36')](_['pick'](_0x3a1334[_0x88c3('0x35')],_0x4a4187[_0x88c3('0x36')]));_0x28419f=_['merge']({},_0x28419f,_0x3a1334[_0x88c3('0x45')]);return _0x6fb6be['get'+_[_0x88c3('0x5a')](_0x3a1334['query'][_0x88c3('0x56')][_0x88c3('0x5b')]())+'Queues'](_0x28419f);})[_0x88c3('0x27')](respondWithResult(_0x5860bb,null))[_0x88c3('0x49')](handleError(_0x5860bb,null));};exports[_0x88c3('0x5d')]=function(_0x2ff031,_0xaff446,_0x1a0aff){return db[_0x88c3('0x32')][_0x88c3('0x5e')]({'where':{'id':_0x2ff031[_0x88c3('0x4b')]['id']}})[_0x88c3('0x27')](function(_0xe04a22){if(_0xe04a22){if(!_0x2ff031[_0x88c3('0x54')][_0x88c3('0x56')]||!utils[_0x88c3('0x57')](_0x2ff031[_0x88c3('0x54')][_0x88c3('0x56')])){throw new db[(_0x88c3('0x58'))][(_0x88c3('0x5f'))](_0x88c3('0x59'));}return _0xe04a22[_0x88c3('0x60')+_[_0x88c3('0x5a')](_0x2ff031[_0x88c3('0x54')]['channel'][_0x88c3('0x5b')]())+'Queues'](_0x2ff031[_0x88c3('0x54')][_0x88c3('0x61')]);}return null;})[_0x88c3('0x27')](handleEntityNotFound(_0xaff446,null))['then'](respondWithStatusCode(_0xaff446,null))[_0x88c3('0x49')](handleError(_0xaff446,null));};exports['removeQueues']=function(_0x5522e2,_0x568bd9,_0x1549e8){return db[_0x88c3('0x32')][_0x88c3('0x5e')]({'where':{'id':_0x5522e2[_0x88c3('0x4b')]['id']}})[_0x88c3('0x27')](function(_0x4eca4c){if(_0x4eca4c){if(!_0x5522e2[_0x88c3('0x35')][_0x88c3('0x56')]||!utils['isValidChannel'](_0x5522e2[_0x88c3('0x35')]['channel'])){throw new db[(_0x88c3('0x58'))][(_0x88c3('0x5f'))]('Unknown\x20channel');}return _0x4eca4c['remove'+_['capitalize'](_0x5522e2[_0x88c3('0x35')]['channel'][_0x88c3('0x5b')]())+_0x88c3('0x62')](_0x5522e2[_0x88c3('0x35')][_0x88c3('0x61')]);}return null;})[_0x88c3('0x27')](handleEntityNotFound(_0x568bd9,null))['then'](respondWithStatusCode(_0x568bd9,null))[_0x88c3('0x49')](handleError(_0x568bd9,null));};exports['addAgents']=function(_0x362003,_0x49fa82,_0x39f818){return db[_0x88c3('0x32')][_0x88c3('0x4e')]({'where':{'id':_0x362003[_0x88c3('0x4b')]['id']}})[_0x88c3('0x27')](handleEntityNotFound(_0x49fa82,null))[_0x88c3('0x27')](function(_0x405c2b){if(_0x405c2b){var _0x4fa320=[_0x88c3('0x63'),'Chat',_0x88c3('0x64'),_0x88c3('0x65'),'Fax','Openchannel'];return BPromise[_0x88c3('0x66')](_0x4fa320,function(_0x4ddafa){return _0x405c2b[_0x88c3('0x28')+_0x4ddafa+_0x88c3('0x62')]({'attributes':['id',_0x88c3('0x2f')]})[_0x88c3('0x27')](function(_0x23c0ff){return BPromise[_0x88c3('0x66')](_0x23c0ff,function(_0x18dba6){return _0x18dba6['addAgents'](_0x362003[_0x88c3('0x54')][_0x88c3('0x61')])['then'](function(){if(_0x4ddafa==='Voice'){return db[_0x88c3('0x67')]['findAll']({'where':{'id':_0x362003[_0x88c3('0x54')][_0x88c3('0x61')]},'attributes':['id',_0x88c3('0x2f'),'online','voicePause',_0x88c3('0x68')],'raw':!![]})[_0x88c3('0x27')](function(_0x17687f){return BPromise[_0x88c3('0x66')](_[_0x88c3('0x69')](_0x17687f,{'online':0x1}),function(_0x439eb7){return db[_0x88c3('0x6a')][_0x88c3('0x6b')]({'membername':_0x439eb7[_0x88c3('0x2f')],'UserId':_0x439eb7['id'],'queue_name':_0x18dba6[_0x88c3('0x2f')],'VoiceQueueId':_0x18dba6['id'],'interface':_[_0x88c3('0x6c')](_0x439eb7[_0x88c3('0x68')])?util[_0x88c3('0x6d')](_0x88c3('0x6e'),_0x439eb7[_0x88c3('0x2f')]):_0x439eb7[_0x88c3('0x68')],'paused':_0x439eb7['voicePause']||![],'penalty':0x0});});});}});});})[_0x88c3('0x27')](function(){return _0x405c2b;});})[_0x88c3('0x27')](function(){return _0x405c2b;});}})[_0x88c3('0x27')](function(_0x4c589a){if(_0x4c589a){return _0x4c589a[_0x88c3('0x6f')](_0x362003['body'][_0x88c3('0x61')],_[_0x88c3('0x70')](_0x362003[_0x88c3('0x54')],[_0x88c3('0x61'),'id'])||{})[_0x88c3('0x71')](function(_0x2c10d6){for(var _0x508887=0x0;_0x508887<_0x362003['body']['ids'][_0x88c3('0x39')];_0x508887+=0x1){socket[_0x88c3('0x72')]('userTeam:save',{'UserId':_0x362003[_0x88c3('0x54')]['ids'][_0x508887],'TeamId':_0x362003[_0x88c3('0x4b')]['id']});}return _0x2c10d6;});}})['then'](respondWithResult(_0x49fa82,null))['catch'](handleError(_0x49fa82,null));};exports[_0x88c3('0x73')]=function(_0x2c779f,_0x5d6821,_0x252268){return db[_0x88c3('0x32')][_0x88c3('0x4e')]({'where':{'id':_0x2c779f[_0x88c3('0x4b')]['id']}})['then'](handleEntityNotFound(_0x5d6821,null))[_0x88c3('0x27')](function(_0x1d23db){if(_0x1d23db){return BPromise[_0x88c3('0x66')]([_0x88c3('0x74'),_0x88c3('0x75'),_0x88c3('0x76'),_0x88c3('0x77'),_0x88c3('0x78'),_0x88c3('0x79')],function(_0x3b1462){return _0x1d23db[_0x88c3('0x28')+_[_0x88c3('0x5a')](_0x3b1462)+_0x88c3('0x62')]({'attributes':['id',_0x88c3('0x2f')]})[_0x88c3('0x27')](function(_0x50db64){return BPromise[_0x88c3('0x66')](_0x50db64,function(_0x18e5c3){return _0x18e5c3[_0x88c3('0x73')](_0x2c779f['query'][_0x88c3('0x61')])[_0x88c3('0x27')](function(){if(_0x3b1462==='voice'){return db['UserVoiceQueueRt']['destroy']({'where':{'VoiceQueueId':_0x18e5c3['id'],'UserId':_0x2c779f['query']['ids']}});}});});})[_0x88c3('0x27')](function(){return _0x1d23db;});})[_0x88c3('0x27')](function(){return _0x1d23db;});}})[_0x88c3('0x27')](function(_0x48ec67){if(_0x48ec67){return _0x48ec67[_0x88c3('0x73')](_0x2c779f[_0x88c3('0x35')]['ids'])[_0x88c3('0x27')](function(){if(_[_0x88c3('0x7a')](_0x2c779f[_0x88c3('0x35')]['ids'])){for(var _0x476adb=0x0;_0x476adb<_0x2c779f[_0x88c3('0x35')]['ids'][_0x88c3('0x39')];_0x476adb+=0x1){socket[_0x88c3('0x72')](_0x88c3('0x7b'),{'UserId':Number(_0x2c779f[_0x88c3('0x35')][_0x88c3('0x61')][_0x476adb]),'TeamId':Number(_0x2c779f[_0x88c3('0x4b')]['id'])});}}else{socket[_0x88c3('0x72')](_0x88c3('0x7b'),{'UserId':Number(_0x2c779f[_0x88c3('0x35')]['ids']),'TeamId':Number(_0x2c779f[_0x88c3('0x4b')]['id'])});}});}})[_0x88c3('0x27')](respondWithStatusCode(_0x5d6821,null))[_0x88c3('0x49')](handleError(_0x5d6821,null));};exports['getAgents']=function(_0x35132a,_0x234f24,_0x416510){var _0x11808e={};var _0x48e890={};var _0x2268a6;var _0x4481fc;return db[_0x88c3('0x32')][_0x88c3('0x5e')]({'where':{'id':_0x35132a[_0x88c3('0x4b')]['id']}})[_0x88c3('0x27')](handleEntityNotFound(_0x234f24,null))[_0x88c3('0x27')](function(_0x517f12){if(_0x517f12){_0x2268a6=_0x517f12;_0x48e890[_0x88c3('0x33')]=_[_0x88c3('0x34')](db[_0x88c3('0x67')]['rawAttributes']);_0x48e890['query']=_[_0x88c3('0x34')](_0x35132a[_0x88c3('0x35')]);_0x48e890['filters']=_[_0x88c3('0x37')](_0x48e890[_0x88c3('0x33')],_0x48e890['query']);_0x11808e[_0x88c3('0x3a')]=_[_0x88c3('0x37')](_0x48e890[_0x88c3('0x33')],qs[_0x88c3('0x38')](_0x35132a[_0x88c3('0x35')][_0x88c3('0x38')]));_0x11808e[_0x88c3('0x3a')]=_0x11808e[_0x88c3('0x3a')][_0x88c3('0x39')]?_0x11808e[_0x88c3('0x3a')]:_0x48e890[_0x88c3('0x33')];_0x11808e[_0x88c3('0x3d')]=qs[_0x88c3('0x3e')](_0x35132a[_0x88c3('0x35')][_0x88c3('0x3e')]);_0x11808e[_0x88c3('0x3f')]=qs[_0x88c3('0x36')](_[_0x88c3('0x7c')](_0x35132a['query'],_0x48e890['filters']));if(_0x35132a[_0x88c3('0x35')][_0x88c3('0x69')]){_0x11808e['where']=_['merge'](_0x11808e[_0x88c3('0x3f')],{'$or':_[_0x88c3('0x41')](_0x11808e[_0x88c3('0x3a')],function(_0x1c6c87){var _0x12b92a={};_0x12b92a[_0x1c6c87]={'$like':'%'+_0x35132a[_0x88c3('0x35')][_0x88c3('0x69')]+'%'};return _0x12b92a;})});}_0x11808e=_[_0x88c3('0x40')]({},_0x11808e,_0x35132a['options']);return _0x2268a6[_0x88c3('0x7d')](_0x11808e);}})['then'](function(_0x31709d){if(_0x31709d){_0x4481fc=_0x31709d[_0x88c3('0x39')];if(!_0x35132a[_0x88c3('0x35')][_0x88c3('0x3b')](_0x88c3('0x3c'))){_0x11808e[_0x88c3('0x21')]=qs[_0x88c3('0x21')](_0x35132a[_0x88c3('0x35')][_0x88c3('0x21')]);_0x11808e[_0x88c3('0x20')]=qs[_0x88c3('0x20')](_0x35132a[_0x88c3('0x35')][_0x88c3('0x20')]);}return _0x2268a6[_0x88c3('0x7d')](_0x11808e);}})[_0x88c3('0x27')](function(_0x4958b6){if(_0x4958b6){return _0x4958b6?{'count':_0x4481fc,'rows':_0x4958b6}:null;}})[_0x88c3('0x27')](respondWithResult(_0x234f24,null))[_0x88c3('0x49')](handleError(_0x234f24,null));}; \ No newline at end of file +var _0x0e35=['VIRTUAL','field','count','includeAll','findAll','rows','show','params','include','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','catch','getQueues','findOne','channel','isValidChannel','Sequelize','ValidationError','Unknown\x20channel','Queue','capitalize','toLowerCase','Queues','addQueues','ids','removeQueues','remove','Chat','Sms','Fax','Openchannel','each','addAgents','Voice','User','voicePause','interface','filter','UserVoiceQueueRt','upsert','format','SIP/%s','omit','spread','removeAgents','voice','chat','sms','fax','openchannel','emit','userTeam:remove','getAgents','hasOwnProperty','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./team.socket','register','sendStatus','status','end','json','offset','limit','apply','reject','save','update','then','destroy','get','Teams','UserProfileResource','error','stack','name','send','index','Team','rawAttributes','keys','query','filters','intersection','attributes','model','fields','length','nolimit','order','sort','where','pick','merge','map','key'];(function(_0x30dfa4,_0x1a6275){var _0x185b37=function(_0x1a8025){while(--_0x1a8025){_0x30dfa4['push'](_0x30dfa4['shift']());}};_0x185b37(++_0x1a6275);}(_0x0e35,0xc2));var _0x50e3=function(_0x37cae5,_0xf8d04b){_0x37cae5=_0x37cae5-0x0;var _0x49a4fe=_0x0e35[_0x37cae5];return _0x49a4fe;};'use strict';var pdf=require(_0x50e3('0x0'));var emlformat=require(_0x50e3('0x1'));var rimraf=require(_0x50e3('0x2'));var zipdir=require(_0x50e3('0x3'));var jsonpatch=require(_0x50e3('0x4'));var rp=require(_0x50e3('0x5'));var moment=require(_0x50e3('0x6'));var BPromise=require(_0x50e3('0x7'));var Mustache=require(_0x50e3('0x8'));var util=require(_0x50e3('0x9'));var path=require('path');var sox=require(_0x50e3('0xa'));var csv=require(_0x50e3('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x50e3('0xc'));var crypto=require(_0x50e3('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x50e3('0xb'));var querystring=require(_0x50e3('0xe'));var Papa=require(_0x50e3('0xf'));var Redis=require(_0x50e3('0x10'));var authService=require(_0x50e3('0x11'));var qs=require(_0x50e3('0x12'));var as=require(_0x50e3('0x13'));var hardwareService=require(_0x50e3('0x14'));var logger=require(_0x50e3('0x15'))(_0x50e3('0x16'));var utils=require(_0x50e3('0x17'));var config=require(_0x50e3('0x18'));var db=require(_0x50e3('0x19'))['db'];config['redis']=_[_0x50e3('0x1a')](config[_0x50e3('0x1b')],{'host':_0x50e3('0x1c'),'port':0x18eb});var socket=require(_0x50e3('0x1d'))(new Redis(config['redis']));require(_0x50e3('0x1e'))[_0x50e3('0x1f')](socket);function respondWithStatusCode(_0x4b4d6f,_0x43bb4d){_0x43bb4d=_0x43bb4d||0xcc;return function(_0x3f7cfa){if(_0x3f7cfa){return _0x4b4d6f[_0x50e3('0x20')](_0x43bb4d);}return _0x4b4d6f[_0x50e3('0x21')](_0x43bb4d)[_0x50e3('0x22')]();};}function respondWithResult(_0x5b020c,_0x2aff1c){_0x2aff1c=_0x2aff1c||0xc8;return function(_0x5f44e1){if(_0x5f44e1){return _0x5b020c[_0x50e3('0x21')](_0x2aff1c)[_0x50e3('0x23')](_0x5f44e1);}};}function respondWithFilteredResult(_0x892ab2,_0x4b1b85){return function(_0x447a60){if(_0x447a60){var _0x2d25e6=_0x447a60['count'],_0x1b4279=_0x4b1b85[_0x50e3('0x24')],_0x3e56b6=_0x4b1b85['offset']+_0x4b1b85[_0x50e3('0x25')],_0x47ea2c;if(_0x3e56b6>=_0x2d25e6){_0x3e56b6=_0x2d25e6;_0x47ea2c=0xc8;}else{_0x47ea2c=0xce;}_0x892ab2[_0x50e3('0x21')](_0x47ea2c);return _0x892ab2['set']('Content-Range',_0x1b4279+'-'+_0x3e56b6+'/'+_0x2d25e6)[_0x50e3('0x23')](_0x447a60);}return null;};}function patchUpdates(_0x29f6d9){return function(_0x4956d5){try{jsonpatch[_0x50e3('0x26')](_0x4956d5,_0x29f6d9,!![]);}catch(_0x410e19){return BPromise[_0x50e3('0x27')](_0x410e19);}return _0x4956d5[_0x50e3('0x28')]();};}function saveUpdates(_0x3fdd65,_0x164e11){return function(_0x499b07){if(_0x499b07){return _0x499b07[_0x50e3('0x29')](_0x3fdd65)[_0x50e3('0x2a')](function(_0x37acdb){return _0x37acdb;});}return null;};}function removeEntity(_0x2ab8cb,_0x34c68c){return function(_0x283459){if(_0x283459){return _0x283459[_0x50e3('0x2b')]()[_0x50e3('0x2a')](function(){var _0x4dec8c=_0x283459[_0x50e3('0x2c')]({'plain':!![]});var _0x576c7c=_0x50e3('0x2d');return db[_0x50e3('0x2e')][_0x50e3('0x2b')]({'where':{'type':_0x576c7c,'resourceId':_0x4dec8c['id']}})[_0x50e3('0x2a')](function(){return _0x283459;});})[_0x50e3('0x2a')](function(){_0x2ab8cb['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xd7bc00,_0x54ca59){return function(_0x3675db){if(!_0x3675db){_0xd7bc00['sendStatus'](0x194);}return _0x3675db;};}function handleError(_0x4fb7ae,_0x5e5b36){_0x5e5b36=_0x5e5b36||0x1f4;return function(_0x455c5e){logger[_0x50e3('0x2f')](_0x455c5e[_0x50e3('0x30')]);if(_0x455c5e[_0x50e3('0x31')]){delete _0x455c5e[_0x50e3('0x31')];}_0x4fb7ae[_0x50e3('0x21')](_0x5e5b36)[_0x50e3('0x32')](_0x455c5e);};}exports[_0x50e3('0x33')]=function(_0x518a11,_0x3ed213){var _0x13edd9={},_0x34fb1c={},_0x47cae9={'count':0x0,'rows':[]};var _0x2228e6=db[_0x50e3('0x34')][_0x50e3('0x35')];_0x34fb1c['model']=_[_0x50e3('0x36')](_0x2228e6);_0x34fb1c[_0x50e3('0x37')]=_['keys'](_0x518a11[_0x50e3('0x37')]);_0x34fb1c[_0x50e3('0x38')]=_[_0x50e3('0x39')](_0x34fb1c['model'],_0x34fb1c[_0x50e3('0x37')]);_0x13edd9[_0x50e3('0x3a')]=_[_0x50e3('0x39')](_0x34fb1c[_0x50e3('0x3b')],qs[_0x50e3('0x3c')](_0x518a11[_0x50e3('0x37')]['fields']));_0x13edd9[_0x50e3('0x3a')]=_0x13edd9[_0x50e3('0x3a')][_0x50e3('0x3d')]?_0x13edd9['attributes']:_0x34fb1c[_0x50e3('0x3b')];if(!_0x518a11[_0x50e3('0x37')]['hasOwnProperty'](_0x50e3('0x3e'))){_0x13edd9['limit']=qs[_0x50e3('0x25')](_0x518a11['query'][_0x50e3('0x25')]);_0x13edd9['offset']=qs[_0x50e3('0x24')](_0x518a11['query']['offset']);}_0x13edd9[_0x50e3('0x3f')]=qs['sort'](_0x518a11[_0x50e3('0x37')][_0x50e3('0x40')]);_0x13edd9[_0x50e3('0x41')]=qs[_0x50e3('0x38')](_[_0x50e3('0x42')](_0x518a11[_0x50e3('0x37')],_0x34fb1c[_0x50e3('0x38')]));if(_0x518a11[_0x50e3('0x37')]['filter']){_0x13edd9[_0x50e3('0x41')]=_[_0x50e3('0x43')](_0x13edd9['where'],{'$or':_[_0x50e3('0x44')](_0x2228e6,function(_0x3b1385){if(_0x3b1385['type'][_0x50e3('0x45')]!==_0x50e3('0x46')){var _0x3197dc={};_0x3197dc[_0x3b1385[_0x50e3('0x47')]]={'$like':'%'+_0x518a11['query']['filter']+'%'};return _0x3197dc;}})});}_0x13edd9=_[_0x50e3('0x43')]({},_0x13edd9,_0x518a11['options']);var _0x50d628={'where':_0x13edd9[_0x50e3('0x41')]};return db[_0x50e3('0x34')][_0x50e3('0x48')](_0x50d628)['then'](function(_0x127977){_0x47cae9[_0x50e3('0x48')]=_0x127977;if(_0x518a11[_0x50e3('0x37')][_0x50e3('0x49')]){_0x13edd9['include']=[{'all':!![]}];}return db['Team'][_0x50e3('0x4a')](_0x13edd9);})[_0x50e3('0x2a')](function(_0x46d2c2){_0x47cae9[_0x50e3('0x4b')]=_0x46d2c2;return _0x47cae9;})['then'](respondWithFilteredResult(_0x3ed213,_0x13edd9))['catch'](handleError(_0x3ed213,null));};exports[_0x50e3('0x4c')]=function(_0x34d0b8,_0x41f0e2){var _0x2d6af9={'raw':![],'where':{'id':_0x34d0b8[_0x50e3('0x4d')]['id']}},_0x2c4011={};_0x2c4011[_0x50e3('0x3b')]=_[_0x50e3('0x36')](db[_0x50e3('0x34')][_0x50e3('0x35')]);_0x2c4011[_0x50e3('0x37')]=_[_0x50e3('0x36')](_0x34d0b8[_0x50e3('0x37')]);_0x2c4011['filters']=_[_0x50e3('0x39')](_0x2c4011[_0x50e3('0x3b')],_0x2c4011[_0x50e3('0x37')]);_0x2d6af9[_0x50e3('0x3a')]=_['intersection'](_0x2c4011[_0x50e3('0x3b')],qs[_0x50e3('0x3c')](_0x34d0b8[_0x50e3('0x37')]['fields']));_0x2d6af9[_0x50e3('0x3a')]=_0x2d6af9[_0x50e3('0x3a')]['length']?_0x2d6af9[_0x50e3('0x3a')]:_0x2c4011[_0x50e3('0x3b')];if(_0x34d0b8[_0x50e3('0x37')][_0x50e3('0x49')]){_0x2d6af9[_0x50e3('0x4e')]=[{'all':!![]}];}_0x2d6af9=_[_0x50e3('0x43')]({},_0x2d6af9,_0x34d0b8[_0x50e3('0x4f')]);return db[_0x50e3('0x34')][_0x50e3('0x50')](_0x2d6af9)[_0x50e3('0x2a')](handleEntityNotFound(_0x41f0e2,null))[_0x50e3('0x2a')](respondWithResult(_0x41f0e2,null))['catch'](handleError(_0x41f0e2,null));};exports[_0x50e3('0x51')]=function(_0x1449df,_0x366dba){return db[_0x50e3('0x34')][_0x50e3('0x51')](_0x1449df[_0x50e3('0x52')],{})[_0x50e3('0x2a')](function(_0x42ce22){var _0x844360=_0x1449df[_0x50e3('0x53')]['get']({'plain':!![]});if(!_0x844360)throw new Error(_0x50e3('0x54'));if(_0x844360[_0x50e3('0x55')]==='user'){var _0x2d9f33=_0x42ce22['get']({'plain':!![]});var _0x25cc01=_0x50e3('0x2d');return db[_0x50e3('0x56')][_0x50e3('0x50')]({'where':{'name':_0x25cc01,'userProfileId':_0x844360[_0x50e3('0x57')]},'raw':!![]})['then'](function(_0x5a1a20){if(_0x5a1a20&&_0x5a1a20[_0x50e3('0x58')]===0x0){return db[_0x50e3('0x2e')]['create']({'name':_0x2d9f33[_0x50e3('0x31')],'resourceId':_0x2d9f33['id'],'type':_0x5a1a20[_0x50e3('0x31')],'sectionId':_0x5a1a20['id']},{})[_0x50e3('0x2a')](function(){return _0x42ce22;});}else{return _0x42ce22;}})[_0x50e3('0x59')](function(_0x5e30d1){logger[_0x50e3('0x2f')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5e30d1);throw _0x5e30d1;});}return _0x42ce22;})[_0x50e3('0x2a')](respondWithResult(_0x366dba,0xc9))['catch'](handleError(_0x366dba,null));};exports[_0x50e3('0x29')]=function(_0x2c0d74,_0xf539e9){if(_0x2c0d74[_0x50e3('0x52')]['id']){delete _0x2c0d74[_0x50e3('0x52')]['id'];}return db[_0x50e3('0x34')][_0x50e3('0x50')]({'where':{'id':_0x2c0d74[_0x50e3('0x4d')]['id']}})['then'](handleEntityNotFound(_0xf539e9,null))['then'](saveUpdates(_0x2c0d74[_0x50e3('0x52')],null))['then'](respondWithResult(_0xf539e9,null))[_0x50e3('0x59')](handleError(_0xf539e9,null));};exports[_0x50e3('0x2b')]=function(_0x3e8790,_0x5f245b){return db[_0x50e3('0x34')]['find']({'where':{'id':_0x3e8790['params']['id']}})['then'](handleEntityNotFound(_0x5f245b,null))[_0x50e3('0x2a')](removeEntity(_0x5f245b,null))[_0x50e3('0x59')](handleError(_0x5f245b,null));};exports[_0x50e3('0x5a')]=function(_0x48c2ab,_0x171b6a,_0x4f956f){return db['Team'][_0x50e3('0x5b')]({'where':{'id':_0x48c2ab[_0x50e3('0x4d')]['id']}})['then'](handleEntityNotFound(_0x171b6a,null))[_0x50e3('0x2a')](function(_0x21b543){if(!_0x48c2ab[_0x50e3('0x37')][_0x50e3('0x5c')]||!utils[_0x50e3('0x5d')](_0x48c2ab[_0x50e3('0x37')][_0x50e3('0x5c')])){throw new db[(_0x50e3('0x5e'))][(_0x50e3('0x5f'))](_0x50e3('0x60'));}var _0x470635={};var _0x2b5b95={};_0x2b5b95['model']=_[_0x50e3('0x36')](db[_['capitalize'](_0x48c2ab[_0x50e3('0x37')][_0x50e3('0x5c')]['toLowerCase']())+_0x50e3('0x61')][_0x50e3('0x35')]);_0x2b5b95[_0x50e3('0x37')]=_[_0x50e3('0x36')](_0x48c2ab[_0x50e3('0x37')]);_0x2b5b95[_0x50e3('0x38')]=_[_0x50e3('0x39')](_0x2b5b95[_0x50e3('0x3b')],_0x2b5b95[_0x50e3('0x37')]);_0x470635[_0x50e3('0x3a')]=_['intersection'](_0x2b5b95['model'],qs[_0x50e3('0x3c')](_0x48c2ab[_0x50e3('0x37')][_0x50e3('0x3c')]));_0x470635[_0x50e3('0x3a')]=_0x470635[_0x50e3('0x3a')]['length']?_0x470635[_0x50e3('0x3a')]:_0x2b5b95[_0x50e3('0x3b')];_0x470635[_0x50e3('0x25')]=qs[_0x50e3('0x25')](_0x48c2ab[_0x50e3('0x37')][_0x50e3('0x25')]);_0x470635[_0x50e3('0x24')]=qs[_0x50e3('0x24')](_0x48c2ab[_0x50e3('0x37')]['offset']);_0x470635[_0x50e3('0x3f')]=qs['sort'](_0x48c2ab['query'][_0x50e3('0x40')]);_0x470635[_0x50e3('0x41')]=qs[_0x50e3('0x38')](_[_0x50e3('0x42')](_0x48c2ab[_0x50e3('0x37')],_0x2b5b95[_0x50e3('0x38')]));_0x470635=_[_0x50e3('0x43')]({},_0x470635,_0x48c2ab['options']);return _0x21b543[_0x50e3('0x2c')+_[_0x50e3('0x62')](_0x48c2ab[_0x50e3('0x37')][_0x50e3('0x5c')][_0x50e3('0x63')]())+_0x50e3('0x64')](_0x470635);})['then'](respondWithResult(_0x171b6a,null))['catch'](handleError(_0x171b6a,null));};exports[_0x50e3('0x65')]=function(_0x597223,_0x3bff80,_0x1f259e){return db['Team'][_0x50e3('0x5b')]({'where':{'id':_0x597223[_0x50e3('0x4d')]['id']}})['then'](function(_0x311c25){if(_0x311c25){if(!_0x597223[_0x50e3('0x52')]['channel']||!utils[_0x50e3('0x5d')](_0x597223['body'][_0x50e3('0x5c')])){throw new db[(_0x50e3('0x5e'))][(_0x50e3('0x5f'))](_0x50e3('0x60'));}return _0x311c25['add'+_['capitalize'](_0x597223['body'][_0x50e3('0x5c')][_0x50e3('0x63')]())+_0x50e3('0x64')](_0x597223['body'][_0x50e3('0x66')]);}return null;})['then'](handleEntityNotFound(_0x3bff80,null))['then'](respondWithStatusCode(_0x3bff80,null))[_0x50e3('0x59')](handleError(_0x3bff80,null));};exports[_0x50e3('0x67')]=function(_0x3d7ae8,_0x166643,_0x581587){return db[_0x50e3('0x34')][_0x50e3('0x5b')]({'where':{'id':_0x3d7ae8[_0x50e3('0x4d')]['id']}})[_0x50e3('0x2a')](function(_0xb5c0b1){if(_0xb5c0b1){if(!_0x3d7ae8[_0x50e3('0x37')][_0x50e3('0x5c')]||!utils['isValidChannel'](_0x3d7ae8[_0x50e3('0x37')][_0x50e3('0x5c')])){throw new db['Sequelize'][(_0x50e3('0x5f'))](_0x50e3('0x60'));}return _0xb5c0b1[_0x50e3('0x68')+_['capitalize'](_0x3d7ae8[_0x50e3('0x37')]['channel']['toLowerCase']())+'Queues'](_0x3d7ae8[_0x50e3('0x37')][_0x50e3('0x66')]);}return null;})['then'](handleEntityNotFound(_0x166643,null))[_0x50e3('0x2a')](respondWithStatusCode(_0x166643,null))[_0x50e3('0x59')](handleError(_0x166643,null));};exports['addAgents']=function(_0x52d93c,_0x5aa137,_0x391af2){return db[_0x50e3('0x34')]['find']({'where':{'id':_0x52d93c[_0x50e3('0x4d')]['id']}})[_0x50e3('0x2a')](handleEntityNotFound(_0x5aa137,null))[_0x50e3('0x2a')](function(_0x3b1ad9){if(_0x3b1ad9){var _0x5cbbb6=['Voice',_0x50e3('0x69'),'Mail',_0x50e3('0x6a'),_0x50e3('0x6b'),_0x50e3('0x6c')];return BPromise[_0x50e3('0x6d')](_0x5cbbb6,function(_0x199dcd){return _0x3b1ad9[_0x50e3('0x2c')+_0x199dcd+_0x50e3('0x64')]({'attributes':['id','name']})['then'](function(_0x13ff6e){return BPromise[_0x50e3('0x6d')](_0x13ff6e,function(_0x128624){return _0x128624[_0x50e3('0x6e')](_0x52d93c[_0x50e3('0x52')]['ids'])[_0x50e3('0x2a')](function(){if(_0x199dcd===_0x50e3('0x6f')){return db[_0x50e3('0x70')]['findAll']({'where':{'id':_0x52d93c['body'][_0x50e3('0x66')]},'attributes':['id',_0x50e3('0x31'),'online',_0x50e3('0x71'),_0x50e3('0x72')],'raw':!![]})[_0x50e3('0x2a')](function(_0xeeea40){return BPromise[_0x50e3('0x6d')](_[_0x50e3('0x73')](_0xeeea40,{'online':0x1}),function(_0x4caf37){return db[_0x50e3('0x74')][_0x50e3('0x75')]({'membername':_0x4caf37[_0x50e3('0x31')],'UserId':_0x4caf37['id'],'queue_name':_0x128624['name'],'VoiceQueueId':_0x128624['id'],'interface':_['isNil'](_0x4caf37[_0x50e3('0x72')])?util[_0x50e3('0x76')](_0x50e3('0x77'),_0x4caf37[_0x50e3('0x31')]):_0x4caf37[_0x50e3('0x72')],'paused':_0x4caf37[_0x50e3('0x71')]||![],'penalty':0x0});});});}});});})[_0x50e3('0x2a')](function(){return _0x3b1ad9;});})['then'](function(){return _0x3b1ad9;});}})['then'](function(_0x1bdc6d){if(_0x1bdc6d){return _0x1bdc6d['addAgents'](_0x52d93c[_0x50e3('0x52')]['ids'],_[_0x50e3('0x78')](_0x52d93c['body'],['ids','id'])||{})[_0x50e3('0x79')](function(_0x4cdbcc){for(var _0x58ff76=0x0;_0x58ff76<_0x52d93c[_0x50e3('0x52')][_0x50e3('0x66')][_0x50e3('0x3d')];_0x58ff76+=0x1){socket['emit']('userTeam:save',{'UserId':_0x52d93c[_0x50e3('0x52')][_0x50e3('0x66')][_0x58ff76],'TeamId':_0x52d93c[_0x50e3('0x4d')]['id']});}return _0x4cdbcc;});}})['then'](respondWithResult(_0x5aa137,null))[_0x50e3('0x59')](handleError(_0x5aa137,null));};exports[_0x50e3('0x7a')]=function(_0x4e2233,_0x3415cd,_0x14272f){return db[_0x50e3('0x34')][_0x50e3('0x50')]({'where':{'id':_0x4e2233['params']['id']}})[_0x50e3('0x2a')](handleEntityNotFound(_0x3415cd,null))[_0x50e3('0x2a')](function(_0x2ef47f){if(_0x2ef47f){return BPromise[_0x50e3('0x6d')]([_0x50e3('0x7b'),_0x50e3('0x7c'),'mail',_0x50e3('0x7d'),_0x50e3('0x7e'),_0x50e3('0x7f')],function(_0x57ca79){return _0x2ef47f[_0x50e3('0x2c')+_[_0x50e3('0x62')](_0x57ca79)+_0x50e3('0x64')]({'attributes':['id',_0x50e3('0x31')]})['then'](function(_0x231901){return BPromise[_0x50e3('0x6d')](_0x231901,function(_0x522b5d){return _0x522b5d[_0x50e3('0x7a')](_0x4e2233['query'][_0x50e3('0x66')])[_0x50e3('0x2a')](function(){if(_0x57ca79===_0x50e3('0x7b')){return db[_0x50e3('0x74')][_0x50e3('0x2b')]({'where':{'VoiceQueueId':_0x522b5d['id'],'UserId':_0x4e2233['query'][_0x50e3('0x66')]}});}});});})[_0x50e3('0x2a')](function(){return _0x2ef47f;});})[_0x50e3('0x2a')](function(){return _0x2ef47f;});}})[_0x50e3('0x2a')](function(_0x411c40){if(_0x411c40){return _0x411c40[_0x50e3('0x7a')](_0x4e2233[_0x50e3('0x37')][_0x50e3('0x66')])['then'](function(){if(_['isArray'](_0x4e2233['query'][_0x50e3('0x66')])){for(var _0x475719=0x0;_0x475719<_0x4e2233[_0x50e3('0x37')][_0x50e3('0x66')][_0x50e3('0x3d')];_0x475719+=0x1){socket[_0x50e3('0x80')](_0x50e3('0x81'),{'UserId':Number(_0x4e2233['query'][_0x50e3('0x66')][_0x475719]),'TeamId':Number(_0x4e2233[_0x50e3('0x4d')]['id'])});}}else{socket[_0x50e3('0x80')](_0x50e3('0x81'),{'UserId':Number(_0x4e2233[_0x50e3('0x37')][_0x50e3('0x66')]),'TeamId':Number(_0x4e2233['params']['id'])});}});}})[_0x50e3('0x2a')](respondWithStatusCode(_0x3415cd,null))[_0x50e3('0x59')](handleError(_0x3415cd,null));};exports[_0x50e3('0x82')]=function(_0x55aacc,_0x44ce9b,_0x46e64b){var _0x45c24d={};var _0x35891a={};var _0x3b298b;var _0x37601f;return db['Team'][_0x50e3('0x5b')]({'where':{'id':_0x55aacc[_0x50e3('0x4d')]['id']}})['then'](handleEntityNotFound(_0x44ce9b,null))['then'](function(_0x1607d1){if(_0x1607d1){_0x3b298b=_0x1607d1;_0x35891a['model']=_[_0x50e3('0x36')](db[_0x50e3('0x70')]['rawAttributes']);_0x35891a[_0x50e3('0x37')]=_[_0x50e3('0x36')](_0x55aacc['query']);_0x35891a[_0x50e3('0x38')]=_[_0x50e3('0x39')](_0x35891a[_0x50e3('0x3b')],_0x35891a[_0x50e3('0x37')]);_0x45c24d[_0x50e3('0x3a')]=_['intersection'](_0x35891a['model'],qs['fields'](_0x55aacc[_0x50e3('0x37')]['fields']));_0x45c24d[_0x50e3('0x3a')]=_0x45c24d[_0x50e3('0x3a')][_0x50e3('0x3d')]?_0x45c24d['attributes']:_0x35891a[_0x50e3('0x3b')];_0x45c24d[_0x50e3('0x3f')]=qs[_0x50e3('0x40')](_0x55aacc[_0x50e3('0x37')][_0x50e3('0x40')]);_0x45c24d[_0x50e3('0x41')]=qs[_0x50e3('0x38')](_[_0x50e3('0x42')](_0x55aacc[_0x50e3('0x37')],_0x35891a[_0x50e3('0x38')]));if(_0x55aacc[_0x50e3('0x37')]['filter']){_0x45c24d[_0x50e3('0x41')]=_[_0x50e3('0x43')](_0x45c24d[_0x50e3('0x41')],{'$or':_[_0x50e3('0x44')](_0x45c24d[_0x50e3('0x3a')],function(_0xb72549){var _0x534987={};_0x534987[_0xb72549]={'$like':'%'+_0x55aacc[_0x50e3('0x37')][_0x50e3('0x73')]+'%'};return _0x534987;})});}_0x45c24d=_['merge']({},_0x45c24d,_0x55aacc[_0x50e3('0x4f')]);return _0x3b298b['getAgents'](_0x45c24d);}})[_0x50e3('0x2a')](function(_0x37a43d){if(_0x37a43d){_0x37601f=_0x37a43d[_0x50e3('0x3d')];if(!_0x55aacc[_0x50e3('0x37')][_0x50e3('0x83')]('nolimit')){_0x45c24d[_0x50e3('0x25')]=qs[_0x50e3('0x25')](_0x55aacc[_0x50e3('0x37')][_0x50e3('0x25')]);_0x45c24d[_0x50e3('0x24')]=qs['offset'](_0x55aacc['query'][_0x50e3('0x24')]);}return _0x3b298b[_0x50e3('0x82')](_0x45c24d);}})[_0x50e3('0x2a')](function(_0x31d103){if(_0x31d103){return _0x31d103?{'count':_0x37601f,'rows':_0x31d103}:null;}})[_0x50e3('0x2a')](respondWithResult(_0x44ce9b,null))['catch'](handleError(_0x44ce9b,null));}; \ No newline at end of file diff --git a/server/api/team/team.events.js b/server/api/team/team.events.js index 97f00d6..1478bfb 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 _0xbfac=['update','remove','emit','hook','events','../../mysqldb','Team'];(function(_0x27e69e,_0xa397c3){var _0x205d13=function(_0x8db969){while(--_0x8db969){_0x27e69e['push'](_0x27e69e['shift']());}};_0x205d13(++_0xa397c3);}(_0xbfac,0xa5));var _0xcbfa=function(_0x1328e7,_0x403bf6){_0x1328e7=_0x1328e7-0x0;var _0x242470=_0xbfac[_0x1328e7];return _0x242470;};'use strict';var EventEmitter=require(_0xcbfa('0x0'));var Team=require(_0xcbfa('0x1'))['db'][_0xcbfa('0x2')];var TeamEvents=new EventEmitter();TeamEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xcbfa('0x3'),'afterDestroy':_0xcbfa('0x4')};function emitEvent(_0x3cf4cc){return function(_0x3e47d2,_0x3d6ad4,_0xef61e){TeamEvents[_0xcbfa('0x5')](_0x3cf4cc+':'+_0x3e47d2['id'],_0x3e47d2);TeamEvents[_0xcbfa('0x5')](_0x3cf4cc,_0x3e47d2);_0xef61e(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Team[_0xcbfa('0x6')](e,emitEvent(event));}}module['exports']=TeamEvents; \ No newline at end of file +var _0x0e5e=['setMaxListeners','remove','emit','events','../../mysqldb'];(function(_0x5a84d4,_0x577c13){var _0x119fc2=function(_0x591c01){while(--_0x591c01){_0x5a84d4['push'](_0x5a84d4['shift']());}};_0x119fc2(++_0x577c13);}(_0x0e5e,0xd0));var _0xe0e5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0e5e[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0xe0e5('0x0'));var Team=require(_0xe0e5('0x1'))['db']['Team'];var TeamEvents=new EventEmitter();TeamEvents[_0xe0e5('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xe0e5('0x3')};function emitEvent(_0x53b754){return function(_0x3bc1ce,_0x2ab54d,_0x5e3113){TeamEvents[_0xe0e5('0x4')](_0x53b754+':'+_0x3bc1ce['id'],_0x3bc1ce);TeamEvents[_0xe0e5('0x4')](_0x53b754,_0x3bc1ce);_0x5e3113(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Team['hook'](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 a90c426..7210b43 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 _0x4ddf=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./team.attributes','define','Team','teams','lodash','util'];(function(_0x3721be,_0x2cdd7a){var _0x35e200=function(_0x297bc6){while(--_0x297bc6){_0x3721be['push'](_0x3721be['shift']());}};_0x35e200(++_0x2cdd7a);}(_0x4ddf,0x124));var _0xf4dd=function(_0x30bc79,_0x392ee0){_0x30bc79=_0x30bc79-0x0;var _0x3f530c=_0x4ddf[_0x30bc79];return _0x3f530c;};'use strict';var _=require(_0xf4dd('0x0'));var util=require(_0xf4dd('0x1'));var logger=require(_0xf4dd('0x2'))(_0xf4dd('0x3'));var moment=require(_0xf4dd('0x4'));var BPromise=require(_0xf4dd('0x5'));var rp=require(_0xf4dd('0x6'));var fs=require('fs');var path=require(_0xf4dd('0x7'));var rimraf=require(_0xf4dd('0x8'));var config=require(_0xf4dd('0x9'));var attributes=require(_0xf4dd('0xa'));module['exports']=function(_0x311a57,_0x349b72){return _0x311a57[_0xf4dd('0xb')](_0xf4dd('0xc'),attributes,{'tableName':_0xf4dd('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6015=['define','Team','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x1e8dd5,_0x571f6d){var _0x9aa844=function(_0x21dee6){while(--_0x21dee6){_0x1e8dd5['push'](_0x1e8dd5['shift']());}};_0x9aa844(++_0x571f6d);}(_0x6015,0x84));var _0x5601=function(_0x4ee590,_0x38db75){_0x4ee590=_0x4ee590-0x0;var _0x2c97ef=_0x6015[_0x4ee590];return _0x2c97ef;};'use strict';var _=require(_0x5601('0x0'));var util=require(_0x5601('0x1'));var logger=require(_0x5601('0x2'))(_0x5601('0x3'));var moment=require(_0x5601('0x4'));var BPromise=require(_0x5601('0x5'));var rp=require(_0x5601('0x6'));var fs=require('fs');var path=require(_0x5601('0x7'));var rimraf=require(_0x5601('0x8'));var config=require(_0x5601('0x9'));var attributes=require('./team.attributes');module[_0x5601('0xa')]=function(_0x6c7ada,_0x4be28d){return _0x6c7ada[_0x5601('0xb')](_0x5601('0xc'),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 9be12c1..d7a3cfb 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 _0x4899=['socket.io-emitter','register','request','then','info','Team,\x20%s,\x20%s','debug','Team,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','redis','defaults'];(function(_0x1d25f5,_0x482ce1){var _0x566f84=function(_0x4ea321){while(--_0x4ea321){_0x1d25f5['push'](_0x1d25f5['shift']());}};_0x566f84(++_0x482ce1);}(_0x4899,0xa3));var _0x9489=function(_0x587dc1,_0x2b6577){_0x587dc1=_0x587dc1-0x0;var _0x5c8b33=_0x4899[_0x587dc1];return _0x5c8b33;};'use strict';var _=require(_0x9489('0x0'));var util=require('util');var moment=require(_0x9489('0x1'));var BPromise=require('bluebird');var rs=require(_0x9489('0x2'));var fs=require('fs');var Redis=require(_0x9489('0x3'));var db=require(_0x9489('0x4'))['db'];var utils=require(_0x9489('0x5'));var logger=require('../../config/logger')(_0x9489('0x6'));var config=require('../../config/environment');var jayson=require(_0x9489('0x7'));var client=jayson[_0x9489('0x8')][_0x9489('0x9')]({'port':0x232a});config[_0x9489('0xa')]=_[_0x9489('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x9489('0xc'))(new Redis(config[_0x9489('0xa')]));require('./team.socket')[_0x9489('0xd')](socket);function respondWithRpcPromise(_0xc344ed,_0x2fa60e,_0x12bccc){return new BPromise(function(_0x2d7510,_0x33ce0f){return client[_0x9489('0xe')](_0xc344ed,_0x12bccc)[_0x9489('0xf')](function(_0x2ddce2){logger[_0x9489('0x10')](_0x9489('0x11'),_0x2fa60e,'request\x20sent');logger[_0x9489('0x12')](_0x9489('0x13'),_0x2fa60e,_0x9489('0x14'),JSON['stringify'](_0x2ddce2));if(_0x2ddce2[_0x9489('0x15')]){if(_0x2ddce2['error'][_0x9489('0x16')]===0x1f4){logger[_0x9489('0x15')](_0x9489('0x11'),_0x2fa60e,_0x2ddce2['error'][_0x9489('0x17')]);return _0x33ce0f(_0x2ddce2[_0x9489('0x15')][_0x9489('0x17')]);}logger['error']('Team,\x20%s,\x20%s',_0x2fa60e,_0x2ddce2['error']['message']);return _0x2d7510(_0x2ddce2[_0x9489('0x15')][_0x9489('0x17')]);}else{logger[_0x9489('0x10')](_0x9489('0x11'),_0x2fa60e,'request\x20sent');_0x2d7510(_0x2ddce2[_0x9489('0x18')][_0x9489('0x17')]);}})['catch'](function(_0x22c2ab){logger['error'](_0x9489('0x11'),_0x2fa60e,_0x22c2ab);_0x33ce0f(_0x22c2ab);});});} \ No newline at end of file +var _0x1dfa=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./team.socket','register','request','then','info','Team,\x20%s,\x20%s','request\x20sent','debug','Team,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment'];(function(_0x4d8666,_0x2ff19d){var _0x37175b=function(_0x1b8de6){while(--_0x1b8de6){_0x4d8666['push'](_0x4d8666['shift']());}};_0x37175b(++_0x2ff19d);}(_0x1dfa,0x7d));var _0xa1df=function(_0x34bf97,_0xc60f9d){_0x34bf97=_0x34bf97-0x0;var _0x292719=_0x1dfa[_0x34bf97];return _0x292719;};'use strict';var _=require(_0xa1df('0x0'));var util=require(_0xa1df('0x1'));var moment=require(_0xa1df('0x2'));var BPromise=require(_0xa1df('0x3'));var rs=require(_0xa1df('0x4'));var fs=require('fs');var Redis=require(_0xa1df('0x5'));var db=require(_0xa1df('0x6'))['db'];var utils=require(_0xa1df('0x7'));var logger=require(_0xa1df('0x8'))(_0xa1df('0x9'));var config=require(_0xa1df('0xa'));var jayson=require(_0xa1df('0xb'));var client=jayson[_0xa1df('0xc')][_0xa1df('0xd')]({'port':0x232a});config[_0xa1df('0xe')]=_[_0xa1df('0xf')](config[_0xa1df('0xe')],{'host':_0xa1df('0x10'),'port':0x18eb});var socket=require(_0xa1df('0x11'))(new Redis(config['redis']));require(_0xa1df('0x12'))[_0xa1df('0x13')](socket);function respondWithRpcPromise(_0x2421a0,_0x363b58,_0x155078){return new BPromise(function(_0x510d8b,_0x27be9b){return client[_0xa1df('0x14')](_0x2421a0,_0x155078)[_0xa1df('0x15')](function(_0x45865d){logger[_0xa1df('0x16')](_0xa1df('0x17'),_0x363b58,_0xa1df('0x18'));logger[_0xa1df('0x19')](_0xa1df('0x1a'),_0x363b58,_0xa1df('0x18'),JSON[_0xa1df('0x1b')](_0x45865d));if(_0x45865d[_0xa1df('0x1c')]){if(_0x45865d[_0xa1df('0x1c')]['code']===0x1f4){logger[_0xa1df('0x1c')](_0xa1df('0x17'),_0x363b58,_0x45865d[_0xa1df('0x1c')][_0xa1df('0x1d')]);return _0x27be9b(_0x45865d[_0xa1df('0x1c')]['message']);}logger[_0xa1df('0x1c')](_0xa1df('0x17'),_0x363b58,_0x45865d[_0xa1df('0x1c')]['message']);return _0x510d8b(_0x45865d[_0xa1df('0x1c')][_0xa1df('0x1d')]);}else{logger[_0xa1df('0x16')](_0xa1df('0x17'),_0x363b58,'request\x20sent');_0x510d8b(_0x45865d[_0xa1df('0x1e')][_0xa1df('0x1d')]);}})[_0xa1df('0x1f')](function(_0x21bbf6){logger[_0xa1df('0x1c')](_0xa1df('0x17'),_0x363b58,_0x21bbf6);_0x27be9b(_0x21bbf6);});});} \ No newline at end of file diff --git a/server/api/team/team.socket.js b/server/api/team/team.socket.js index 0c05df3..3823823 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 _0x8110=['emit','removeListener','register','length','team:','save'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x8110,0x185));var _0x0811=function(_0x4636b4,_0x50fa59){_0x4636b4=_0x4636b4-0x0;var _0x4da19e=_0x8110[_0x4636b4];return _0x4da19e;};'use strict';var TeamEvents=require('./team.events');var events=[_0x0811('0x0'),'remove','update'];function createListener(_0x50711c,_0x4167c8){return function(_0x4b623f){_0x4167c8[_0x0811('0x1')](_0x50711c,_0x4b623f);};}function removeListener(_0x266310,_0x424170){return function(){TeamEvents[_0x0811('0x2')](_0x266310,_0x424170);};}exports[_0x0811('0x3')]=function(_0x4ed4e1){for(var _0x263e0f=0x0,_0x53b418=events[_0x0811('0x4')];_0x263e0f<_0x53b418;_0x263e0f++){var _0x375ae0=events[_0x263e0f];var _0x934f6c=createListener(_0x0811('0x5')+_0x375ae0,_0x4ed4e1);TeamEvents['on'](_0x375ae0,_0x934f6c);}}; \ No newline at end of file +var _0xcaaf=['register','length','./team.events','remove'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0xcaaf,0x66));var _0xfcaa=function(_0x4bfc5a,_0x498318){_0x4bfc5a=_0x4bfc5a-0x0;var _0x3727ca=_0xcaaf[_0x4bfc5a];return _0x3727ca;};'use strict';var TeamEvents=require(_0xfcaa('0x0'));var events=['save',_0xfcaa('0x1'),'update'];function createListener(_0x4e0557,_0x2b2669){return function(_0x2b6d2b){_0x2b2669['emit'](_0x4e0557,_0x2b6d2b);};}function removeListener(_0xf120fe,_0x540311){return function(){TeamEvents['removeListener'](_0xf120fe,_0x540311);};}exports[_0xfcaa('0x2')]=function(_0x83f91d){for(var _0x146224=0x0,_0x28a6b6=events[_0xfcaa('0x3')];_0x146224<_0x28a6b6;_0x146224++){var _0x287c48=events[_0x146224];var _0x15ef84=createListener('team:'+_0x287c48,_0x83f91d);TeamEvents['on'](_0x287c48,_0x15ef84);}}; \ No newline at end of file diff --git a/server/api/template/index.js b/server/api/template/index.js index 12b3a7a..f44c565 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 _0xf6e6=['../../components/interaction/service','../../config/environment','./template.controller','isAuthenticated','/:id','show','post','create','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x978b2,_0x57c899){var _0x2ade5e=function(_0x4ccd8f){while(--_0x4ccd8f){_0x978b2['push'](_0x978b2['shift']());}};_0x2ade5e(++_0x57c899);}(_0xf6e6,0x104));var _0x6f6e=function(_0x32375b,_0x36676d){_0x32375b=_0x32375b-0x0;var _0xe57825=_0xf6e6[_0x32375b];return _0xe57825;};'use strict';var multer=require(_0x6f6e('0x0'));var util=require('util');var path=require(_0x6f6e('0x1'));var timeout=require(_0x6f6e('0x2'));var express=require(_0x6f6e('0x3'));var router=express[_0x6f6e('0x4')]();var auth=require(_0x6f6e('0x5'));var interaction=require(_0x6f6e('0x6'));var config=require(_0x6f6e('0x7'));var controller=require(_0x6f6e('0x8'));router['get']('/',auth[_0x6f6e('0x9')](),controller['index']);router['get'](_0x6f6e('0xa'),auth[_0x6f6e('0x9')](),controller[_0x6f6e('0xb')]);router[_0x6f6e('0xc')]('/',auth[_0x6f6e('0x9')](),controller[_0x6f6e('0xd')]);router[_0x6f6e('0xe')](_0x6f6e('0xa'),auth[_0x6f6e('0x9')](),controller[_0x6f6e('0xf')]);router[_0x6f6e('0x10')](_0x6f6e('0xa'),auth['isAuthenticated'](),controller[_0x6f6e('0x11')]);module[_0x6f6e('0x12')]=router; \ No newline at end of file +var _0x9223=['exports','util','path','express','Router','../../components/auth/service','../../components/interaction/service','./template.controller','get','isAuthenticated','index','/:id','show','create','put'];(function(_0x33a6fd,_0x27ae82){var _0x120a16=function(_0x4471ba){while(--_0x4471ba){_0x33a6fd['push'](_0x33a6fd['shift']());}};_0x120a16(++_0x27ae82);}(_0x9223,0x13c));var _0x3922=function(_0x3cfb0d,_0x4df584){_0x3cfb0d=_0x3cfb0d-0x0;var _0x3486b4=_0x9223[_0x3cfb0d];return _0x3486b4;};'use strict';var multer=require('multer');var util=require(_0x3922('0x0'));var path=require(_0x3922('0x1'));var timeout=require('connect-timeout');var express=require(_0x3922('0x2'));var router=express[_0x3922('0x3')]();var auth=require(_0x3922('0x4'));var interaction=require(_0x3922('0x5'));var config=require('../../config/environment');var controller=require(_0x3922('0x6'));router[_0x3922('0x7')]('/',auth[_0x3922('0x8')](),controller[_0x3922('0x9')]);router['get'](_0x3922('0xa'),auth['isAuthenticated'](),controller[_0x3922('0xb')]);router['post']('/',auth[_0x3922('0x8')](),controller[_0x3922('0xc')]);router[_0x3922('0xd')](_0x3922('0xa'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x3922('0xa'),auth[_0x3922('0x8')](),controller['destroy']);module[_0x3922('0xe')]=router; \ No newline at end of file diff --git a/server/api/template/template.attributes.js b/server/api/template/template.attributes.js index 6430e9e..c8a639f 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 _0xcb39=['STRING','TEXT','sequelize','exports'];(function(_0x20630e,_0x278ffb){var _0xf15e88=function(_0xa13e77){while(--_0xa13e77){_0x20630e['push'](_0x20630e['shift']());}};_0xf15e88(++_0x278ffb);}(_0xcb39,0xee));var _0x9cb3=function(_0x1b3463,_0x43e1f5){_0x1b3463=_0x1b3463-0x0;var _0x29d544=_0xcb39[_0x1b3463];return _0x29d544;};'use strict';var Sequelize=require(_0x9cb3('0x0'));module[_0x9cb3('0x1')]={'name':{'type':Sequelize[_0x9cb3('0x2')]},'description':{'type':Sequelize[_0x9cb3('0x2')]},'html':{'type':Sequelize[_0x9cb3('0x3')]}}; \ No newline at end of file +var _0x1613=['sequelize','exports','STRING'];(function(_0x332eb0,_0x201560){var _0x3a1f49=function(_0x53942c){while(--_0x53942c){_0x332eb0['push'](_0x332eb0['shift']());}};_0x3a1f49(++_0x201560);}(_0x1613,0x180));var _0x3161=function(_0x2c9715,_0x21389f){_0x2c9715=_0x2c9715-0x0;var _0x3d2239=_0x1613[_0x2c9715];return _0x3d2239;};'use strict';var Sequelize=require(_0x3161('0x0'));module[_0x3161('0x1')]={'name':{'type':Sequelize[_0x3161('0x2')]},'description':{'type':Sequelize[_0x3161('0x2')]},'html':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/template/template.controller.js b/server/api/template/template.controller.js index 37e4833..c9d085d 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 _0xf3d3=['query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','map','type','key','field','merge','count','includeAll','findAll','rows','catch','show','params','rawAttributes','include','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','name','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','html-pdf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','set','Content-Range','apply','reject','save','update','destroy','then','get','Templates','error','stack','send','index','Template','model','keys'];(function(_0x167c11,_0x1a0221){var _0x1fafad=function(_0x599a48){while(--_0x599a48){_0x167c11['push'](_0x167c11['shift']());}};_0x1fafad(++_0x1a0221);}(_0xf3d3,0x123));var _0x3f3d=function(_0x4d8fbb,_0x28e69e){_0x4d8fbb=_0x4d8fbb-0x0;var _0x4ace9c=_0xf3d3[_0x4d8fbb];return _0x4ace9c;};'use strict';var pdf=require(_0x3f3d('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x3f3d('0x1'));var jsonpatch=require(_0x3f3d('0x2'));var rp=require(_0x3f3d('0x3'));var moment=require(_0x3f3d('0x4'));var BPromise=require(_0x3f3d('0x5'));var Mustache=require('mustache');var util=require(_0x3f3d('0x6'));var path=require('path');var sox=require(_0x3f3d('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x3f3d('0x8'));var squel=require(_0x3f3d('0x9'));var crypto=require(_0x3f3d('0xa'));var jsforce=require(_0x3f3d('0xb'));var deskjs=require(_0x3f3d('0xc'));var toCsv=require(_0x3f3d('0xd'));var querystring=require(_0x3f3d('0xe'));var Papa=require(_0x3f3d('0xf'));var Redis=require(_0x3f3d('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x3f3d('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3f3d('0x12'));var logger=require(_0x3f3d('0x13'))(_0x3f3d('0x14'));var utils=require(_0x3f3d('0x15'));var config=require('../../config/environment');var db=require(_0x3f3d('0x16'))['db'];function respondWithStatusCode(_0x539016,_0x4bf873){_0x4bf873=_0x4bf873||0xcc;return function(_0x343972){if(_0x343972){return _0x539016[_0x3f3d('0x17')](_0x4bf873);}return _0x539016[_0x3f3d('0x18')](_0x4bf873)[_0x3f3d('0x19')]();};}function respondWithResult(_0x56a2cd,_0xdb77f3){_0xdb77f3=_0xdb77f3||0xc8;return function(_0x225751){if(_0x225751){return _0x56a2cd[_0x3f3d('0x18')](_0xdb77f3)[_0x3f3d('0x1a')](_0x225751);}};}function respondWithFilteredResult(_0x3dd92a,_0x15f817){return function(_0x4d9e69){if(_0x4d9e69){var _0x407a84=_0x4d9e69['count'],_0x49b85a=_0x15f817[_0x3f3d('0x1b')],_0x25aee7=_0x15f817['offset']+_0x15f817['limit'],_0x11c2f8;if(_0x25aee7>=_0x407a84){_0x25aee7=_0x407a84;_0x11c2f8=0xc8;}else{_0x11c2f8=0xce;}_0x3dd92a[_0x3f3d('0x18')](_0x11c2f8);return _0x3dd92a[_0x3f3d('0x1c')](_0x3f3d('0x1d'),_0x49b85a+'-'+_0x25aee7+'/'+_0x407a84)[_0x3f3d('0x1a')](_0x4d9e69);}return null;};}function patchUpdates(_0x358268){return function(_0x528383){try{jsonpatch[_0x3f3d('0x1e')](_0x528383,_0x358268,!![]);}catch(_0x2a7f5a){return BPromise[_0x3f3d('0x1f')](_0x2a7f5a);}return _0x528383[_0x3f3d('0x20')]();};}function saveUpdates(_0x328f48,_0x53cae6){return function(_0x238c0d){if(_0x238c0d){return _0x238c0d[_0x3f3d('0x21')](_0x328f48)['then'](function(_0x33842b){return _0x33842b;});}return null;};}function removeEntity(_0x2d0fbd,_0x4842b2){return function(_0x40aa8f){if(_0x40aa8f){return _0x40aa8f[_0x3f3d('0x22')]()[_0x3f3d('0x23')](function(){var _0x267b75=_0x40aa8f[_0x3f3d('0x24')]({'plain':!![]});var _0x33dc62=_0x3f3d('0x25');return db['UserProfileResource'][_0x3f3d('0x22')]({'where':{'type':_0x33dc62,'resourceId':_0x267b75['id']}})['then'](function(){return _0x40aa8f;});})[_0x3f3d('0x23')](function(){_0x2d0fbd[_0x3f3d('0x18')](0xcc)[_0x3f3d('0x19')]();});}};}function handleEntityNotFound(_0x4b6b6a,_0x36f0b5){return function(_0x1d7ab7){if(!_0x1d7ab7){_0x4b6b6a['sendStatus'](0x194);}return _0x1d7ab7;};}function handleError(_0x4d3a55,_0x1bd6d2){_0x1bd6d2=_0x1bd6d2||0x1f4;return function(_0x1a67e4){logger[_0x3f3d('0x26')](_0x1a67e4[_0x3f3d('0x27')]);if(_0x1a67e4['name']){delete _0x1a67e4['name'];}_0x4d3a55[_0x3f3d('0x18')](_0x1bd6d2)[_0x3f3d('0x28')](_0x1a67e4);};}exports[_0x3f3d('0x29')]=function(_0x23e41f,_0x47846e){var _0x1ba357={},_0x4ec87c={},_0x3606c3={'count':0x0,'rows':[]};var _0x3d4945=db[_0x3f3d('0x2a')]['rawAttributes'];_0x4ec87c[_0x3f3d('0x2b')]=_[_0x3f3d('0x2c')](_0x3d4945);_0x4ec87c[_0x3f3d('0x2d')]=_[_0x3f3d('0x2c')](_0x23e41f[_0x3f3d('0x2d')]);_0x4ec87c[_0x3f3d('0x2e')]=_[_0x3f3d('0x2f')](_0x4ec87c[_0x3f3d('0x2b')],_0x4ec87c[_0x3f3d('0x2d')]);_0x1ba357['attributes']=_[_0x3f3d('0x2f')](_0x4ec87c[_0x3f3d('0x2b')],qs[_0x3f3d('0x30')](_0x23e41f['query'][_0x3f3d('0x30')]));_0x1ba357[_0x3f3d('0x31')]=_0x1ba357['attributes'][_0x3f3d('0x32')]?_0x1ba357['attributes']:_0x4ec87c['model'];if(!_0x23e41f[_0x3f3d('0x2d')][_0x3f3d('0x33')](_0x3f3d('0x34'))){_0x1ba357[_0x3f3d('0x35')]=qs['limit'](_0x23e41f[_0x3f3d('0x2d')][_0x3f3d('0x35')]);_0x1ba357[_0x3f3d('0x1b')]=qs[_0x3f3d('0x1b')](_0x23e41f[_0x3f3d('0x2d')][_0x3f3d('0x1b')]);}_0x1ba357[_0x3f3d('0x36')]=qs['sort'](_0x23e41f[_0x3f3d('0x2d')][_0x3f3d('0x37')]);_0x1ba357[_0x3f3d('0x38')]=qs['filters'](_[_0x3f3d('0x39')](_0x23e41f[_0x3f3d('0x2d')],_0x4ec87c[_0x3f3d('0x2e')]));if(_0x23e41f[_0x3f3d('0x2d')]['filter']){_0x1ba357[_0x3f3d('0x38')]=_['merge'](_0x1ba357['where'],{'$or':_[_0x3f3d('0x3a')](_0x3d4945,function(_0x2f0df9){if(_0x2f0df9[_0x3f3d('0x3b')][_0x3f3d('0x3c')]!=='VIRTUAL'){var _0x54d272={};_0x54d272[_0x2f0df9[_0x3f3d('0x3d')]]={'$like':'%'+_0x23e41f['query']['filter']+'%'};return _0x54d272;}})});}_0x1ba357=_[_0x3f3d('0x3e')]({},_0x1ba357,_0x23e41f['options']);var _0x47882f={'where':_0x1ba357[_0x3f3d('0x38')]};return db[_0x3f3d('0x2a')][_0x3f3d('0x3f')](_0x47882f)[_0x3f3d('0x23')](function(_0x3b7de3){_0x3606c3[_0x3f3d('0x3f')]=_0x3b7de3;if(_0x23e41f[_0x3f3d('0x2d')][_0x3f3d('0x40')]){_0x1ba357['include']=[{'all':!![]}];}return db[_0x3f3d('0x2a')][_0x3f3d('0x41')](_0x1ba357);})[_0x3f3d('0x23')](function(_0x725452){_0x3606c3[_0x3f3d('0x42')]=_0x725452;return _0x3606c3;})['then'](respondWithFilteredResult(_0x47846e,_0x1ba357))[_0x3f3d('0x43')](handleError(_0x47846e,null));};exports[_0x3f3d('0x44')]=function(_0x2fe646,_0x48e7c3){var _0x5ef5ec={'raw':!![],'where':{'id':_0x2fe646[_0x3f3d('0x45')]['id']}},_0x46bdcd={};_0x46bdcd[_0x3f3d('0x2b')]=_[_0x3f3d('0x2c')](db[_0x3f3d('0x2a')][_0x3f3d('0x46')]);_0x46bdcd[_0x3f3d('0x2d')]=_['keys'](_0x2fe646[_0x3f3d('0x2d')]);_0x46bdcd['filters']=_[_0x3f3d('0x2f')](_0x46bdcd[_0x3f3d('0x2b')],_0x46bdcd[_0x3f3d('0x2d')]);_0x5ef5ec['attributes']=_[_0x3f3d('0x2f')](_0x46bdcd[_0x3f3d('0x2b')],qs['fields'](_0x2fe646['query'][_0x3f3d('0x30')]));_0x5ef5ec[_0x3f3d('0x31')]=_0x5ef5ec[_0x3f3d('0x31')][_0x3f3d('0x32')]?_0x5ef5ec[_0x3f3d('0x31')]:_0x46bdcd[_0x3f3d('0x2b')];if(_0x2fe646['query'][_0x3f3d('0x40')]){_0x5ef5ec[_0x3f3d('0x47')]=[{'all':!![]}];}_0x5ef5ec=_['merge']({},_0x5ef5ec,_0x2fe646['options']);return db[_0x3f3d('0x2a')][_0x3f3d('0x48')](_0x5ef5ec)[_0x3f3d('0x23')](handleEntityNotFound(_0x48e7c3,null))[_0x3f3d('0x23')](respondWithResult(_0x48e7c3,null))[_0x3f3d('0x43')](handleError(_0x48e7c3,null));};exports[_0x3f3d('0x49')]=function(_0x28ae30,_0x14c71b){return db[_0x3f3d('0x2a')][_0x3f3d('0x49')](_0x28ae30['body'],{})[_0x3f3d('0x23')](function(_0x5eea56){var _0x1b8e15=_0x28ae30[_0x3f3d('0x4a')][_0x3f3d('0x24')]({'plain':!![]});if(!_0x1b8e15)throw new Error(_0x3f3d('0x4b'));if(_0x1b8e15[_0x3f3d('0x4c')]===_0x3f3d('0x4a')){var _0x40968d=_0x5eea56['get']({'plain':!![]});var _0x4b7714=_0x3f3d('0x25');return db[_0x3f3d('0x4d')][_0x3f3d('0x48')]({'where':{'name':_0x4b7714,'userProfileId':_0x1b8e15[_0x3f3d('0x4e')]},'raw':!![]})['then'](function(_0x4f686c){if(_0x4f686c&&_0x4f686c[_0x3f3d('0x4f')]===0x0){return db[_0x3f3d('0x50')][_0x3f3d('0x49')]({'name':_0x40968d[_0x3f3d('0x51')],'resourceId':_0x40968d['id'],'type':_0x4f686c[_0x3f3d('0x51')],'sectionId':_0x4f686c['id']},{})[_0x3f3d('0x23')](function(){return _0x5eea56;});}else{return _0x5eea56;}})[_0x3f3d('0x43')](function(_0x3dddd7){logger[_0x3f3d('0x26')](_0x3f3d('0x52'),_0x3dddd7);throw _0x3dddd7;});}return _0x5eea56;})[_0x3f3d('0x23')](respondWithResult(_0x14c71b,0xc9))[_0x3f3d('0x43')](handleError(_0x14c71b,null));};exports['update']=function(_0x460e91,_0x27947a){if(_0x460e91[_0x3f3d('0x53')]['id']){delete _0x460e91[_0x3f3d('0x53')]['id'];}return db['Template'][_0x3f3d('0x48')]({'where':{'id':_0x460e91[_0x3f3d('0x45')]['id']}})['then'](handleEntityNotFound(_0x27947a,null))[_0x3f3d('0x23')](saveUpdates(_0x460e91[_0x3f3d('0x53')],null))[_0x3f3d('0x23')](respondWithResult(_0x27947a,null))['catch'](handleError(_0x27947a,null));};exports[_0x3f3d('0x22')]=function(_0xa11ba4,_0x14a040){return db['Template'][_0x3f3d('0x48')]({'where':{'id':_0xa11ba4[_0x3f3d('0x45')]['id']}})[_0x3f3d('0x23')](handleEntityNotFound(_0x14a040,null))[_0x3f3d('0x23')](removeEntity(_0x14a040,null))[_0x3f3d('0x43')](handleError(_0x14a040,null));}; \ No newline at end of file +var _0x22e5=['eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','sendStatus','status','end','json','count','offset','limit','set','apply','reject','update','then','destroy','get','UserProfileResource','error','stack','name','send','index','Template','keys','query','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','sort','pick','filter','where','merge','map','type','key','VIRTUAL','field','options','includeAll','include','findAll','rows','catch','show','length','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Templates','UserProfileSection','userProfileId','autoAssociation','body','params','html-pdf'];(function(_0x56e063,_0x453233){var _0x766fcf=function(_0x59415a){while(--_0x59415a){_0x56e063['push'](_0x56e063['shift']());}};_0x766fcf(++_0x453233);}(_0x22e5,0x1df));var _0x522e=function(_0x3f22cf,_0x1bb66e){_0x3f22cf=_0x3f22cf-0x0;var _0x27a021=_0x22e5[_0x3f22cf];return _0x27a021;};'use strict';var pdf=require(_0x522e('0x0'));var emlformat=require(_0x522e('0x1'));var rimraf=require(_0x522e('0x2'));var zipdir=require(_0x522e('0x3'));var jsonpatch=require(_0x522e('0x4'));var rp=require(_0x522e('0x5'));var moment=require(_0x522e('0x6'));var BPromise=require(_0x522e('0x7'));var Mustache=require(_0x522e('0x8'));var util=require(_0x522e('0x9'));var path=require('path');var sox=require('sox');var csv=require(_0x522e('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x522e('0xb'));var jsforce=require(_0x522e('0xc'));var deskjs=require(_0x522e('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x522e('0xe'));var authService=require(_0x522e('0xf'));var qs=require(_0x522e('0x10'));var as=require(_0x522e('0x11'));var hardwareService=require(_0x522e('0x12'));var logger=require(_0x522e('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x522e('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x444903,_0x22b2f0){_0x22b2f0=_0x22b2f0||0xcc;return function(_0x23406e){if(_0x23406e){return _0x444903[_0x522e('0x15')](_0x22b2f0);}return _0x444903[_0x522e('0x16')](_0x22b2f0)[_0x522e('0x17')]();};}function respondWithResult(_0x4b5e63,_0x458db5){_0x458db5=_0x458db5||0xc8;return function(_0x51056c){if(_0x51056c){return _0x4b5e63['status'](_0x458db5)[_0x522e('0x18')](_0x51056c);}};}function respondWithFilteredResult(_0x48cd58,_0xf1c63a){return function(_0x17f7c3){if(_0x17f7c3){var _0x1e1762=_0x17f7c3[_0x522e('0x19')],_0x5093fc=_0xf1c63a[_0x522e('0x1a')],_0xa1b829=_0xf1c63a[_0x522e('0x1a')]+_0xf1c63a[_0x522e('0x1b')],_0x1ef852;if(_0xa1b829>=_0x1e1762){_0xa1b829=_0x1e1762;_0x1ef852=0xc8;}else{_0x1ef852=0xce;}_0x48cd58['status'](_0x1ef852);return _0x48cd58[_0x522e('0x1c')]('Content-Range',_0x5093fc+'-'+_0xa1b829+'/'+_0x1e1762)[_0x522e('0x18')](_0x17f7c3);}return null;};}function patchUpdates(_0x494b00){return function(_0x435668){try{jsonpatch[_0x522e('0x1d')](_0x435668,_0x494b00,!![]);}catch(_0x9afc36){return BPromise[_0x522e('0x1e')](_0x9afc36);}return _0x435668['save']();};}function saveUpdates(_0x394f54,_0x50c9b4){return function(_0x3793a3){if(_0x3793a3){return _0x3793a3[_0x522e('0x1f')](_0x394f54)[_0x522e('0x20')](function(_0x234b98){return _0x234b98;});}return null;};}function removeEntity(_0x3a231e,_0x5632ff){return function(_0x1b02b7){if(_0x1b02b7){return _0x1b02b7[_0x522e('0x21')]()[_0x522e('0x20')](function(){var _0x17b9c4=_0x1b02b7[_0x522e('0x22')]({'plain':!![]});var _0x23633d='Templates';return db[_0x522e('0x23')]['destroy']({'where':{'type':_0x23633d,'resourceId':_0x17b9c4['id']}})[_0x522e('0x20')](function(){return _0x1b02b7;});})[_0x522e('0x20')](function(){_0x3a231e[_0x522e('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5f14c2,_0x1598b5){return function(_0x2f042d){if(!_0x2f042d){_0x5f14c2[_0x522e('0x15')](0x194);}return _0x2f042d;};}function handleError(_0x108fdb,_0x354aa8){_0x354aa8=_0x354aa8||0x1f4;return function(_0x5987b4){logger[_0x522e('0x24')](_0x5987b4[_0x522e('0x25')]);if(_0x5987b4[_0x522e('0x26')]){delete _0x5987b4[_0x522e('0x26')];}_0x108fdb[_0x522e('0x16')](_0x354aa8)[_0x522e('0x27')](_0x5987b4);};}exports[_0x522e('0x28')]=function(_0x3f6750,_0x4a65ae){var _0x14fd80={},_0x4e5471={},_0x368ea8={'count':0x0,'rows':[]};var _0x4bf232=db[_0x522e('0x29')]['rawAttributes'];_0x4e5471['model']=_[_0x522e('0x2a')](_0x4bf232);_0x4e5471[_0x522e('0x2b')]=_[_0x522e('0x2a')](_0x3f6750[_0x522e('0x2b')]);_0x4e5471[_0x522e('0x2c')]=_[_0x522e('0x2d')](_0x4e5471[_0x522e('0x2e')],_0x4e5471[_0x522e('0x2b')]);_0x14fd80['attributes']=_[_0x522e('0x2d')](_0x4e5471['model'],qs[_0x522e('0x2f')](_0x3f6750['query'][_0x522e('0x2f')]));_0x14fd80['attributes']=_0x14fd80[_0x522e('0x30')]['length']?_0x14fd80['attributes']:_0x4e5471[_0x522e('0x2e')];if(!_0x3f6750[_0x522e('0x2b')][_0x522e('0x31')](_0x522e('0x32'))){_0x14fd80['limit']=qs['limit'](_0x3f6750[_0x522e('0x2b')]['limit']);_0x14fd80[_0x522e('0x1a')]=qs[_0x522e('0x1a')](_0x3f6750[_0x522e('0x2b')]['offset']);}_0x14fd80['order']=qs['sort'](_0x3f6750[_0x522e('0x2b')][_0x522e('0x33')]);_0x14fd80['where']=qs[_0x522e('0x2c')](_[_0x522e('0x34')](_0x3f6750[_0x522e('0x2b')],_0x4e5471[_0x522e('0x2c')]));if(_0x3f6750['query'][_0x522e('0x35')]){_0x14fd80[_0x522e('0x36')]=_[_0x522e('0x37')](_0x14fd80[_0x522e('0x36')],{'$or':_[_0x522e('0x38')](_0x4bf232,function(_0x353232){if(_0x353232[_0x522e('0x39')][_0x522e('0x3a')]!==_0x522e('0x3b')){var _0x549171={};_0x549171[_0x353232[_0x522e('0x3c')]]={'$like':'%'+_0x3f6750[_0x522e('0x2b')][_0x522e('0x35')]+'%'};return _0x549171;}})});}_0x14fd80=_[_0x522e('0x37')]({},_0x14fd80,_0x3f6750[_0x522e('0x3d')]);var _0x2da0bf={'where':_0x14fd80[_0x522e('0x36')]};return db[_0x522e('0x29')][_0x522e('0x19')](_0x2da0bf)[_0x522e('0x20')](function(_0x3e8c81){_0x368ea8['count']=_0x3e8c81;if(_0x3f6750[_0x522e('0x2b')][_0x522e('0x3e')]){_0x14fd80[_0x522e('0x3f')]=[{'all':!![]}];}return db[_0x522e('0x29')][_0x522e('0x40')](_0x14fd80);})[_0x522e('0x20')](function(_0xd262c0){_0x368ea8[_0x522e('0x41')]=_0xd262c0;return _0x368ea8;})[_0x522e('0x20')](respondWithFilteredResult(_0x4a65ae,_0x14fd80))[_0x522e('0x42')](handleError(_0x4a65ae,null));};exports[_0x522e('0x43')]=function(_0xeb5c51,_0x3d3e6c){var _0xd58c9e={'raw':!![],'where':{'id':_0xeb5c51['params']['id']}},_0x185158={};_0x185158[_0x522e('0x2e')]=_['keys'](db[_0x522e('0x29')]['rawAttributes']);_0x185158[_0x522e('0x2b')]=_[_0x522e('0x2a')](_0xeb5c51[_0x522e('0x2b')]);_0x185158[_0x522e('0x2c')]=_['intersection'](_0x185158[_0x522e('0x2e')],_0x185158[_0x522e('0x2b')]);_0xd58c9e['attributes']=_[_0x522e('0x2d')](_0x185158[_0x522e('0x2e')],qs[_0x522e('0x2f')](_0xeb5c51['query'][_0x522e('0x2f')]));_0xd58c9e[_0x522e('0x30')]=_0xd58c9e[_0x522e('0x30')][_0x522e('0x44')]?_0xd58c9e['attributes']:_0x185158[_0x522e('0x2e')];if(_0xeb5c51[_0x522e('0x2b')]['includeAll']){_0xd58c9e[_0x522e('0x3f')]=[{'all':!![]}];}_0xd58c9e=_[_0x522e('0x37')]({},_0xd58c9e,_0xeb5c51['options']);return db[_0x522e('0x29')][_0x522e('0x45')](_0xd58c9e)[_0x522e('0x20')](handleEntityNotFound(_0x3d3e6c,null))[_0x522e('0x20')](respondWithResult(_0x3d3e6c,null))[_0x522e('0x42')](handleError(_0x3d3e6c,null));};exports[_0x522e('0x46')]=function(_0x378342,_0x383831){return db[_0x522e('0x29')][_0x522e('0x46')](_0x378342['body'],{})['then'](function(_0x50c4f5){var _0x4b344d=_0x378342[_0x522e('0x47')]['get']({'plain':!![]});if(!_0x4b344d)throw new Error(_0x522e('0x48'));if(_0x4b344d[_0x522e('0x49')]===_0x522e('0x47')){var _0x23f96d=_0x50c4f5[_0x522e('0x22')]({'plain':!![]});var _0x2881d1=_0x522e('0x4a');return db[_0x522e('0x4b')][_0x522e('0x45')]({'where':{'name':_0x2881d1,'userProfileId':_0x4b344d[_0x522e('0x4c')]},'raw':!![]})[_0x522e('0x20')](function(_0x319f24){if(_0x319f24&&_0x319f24[_0x522e('0x4d')]===0x0){return db['UserProfileResource'][_0x522e('0x46')]({'name':_0x23f96d[_0x522e('0x26')],'resourceId':_0x23f96d['id'],'type':_0x319f24[_0x522e('0x26')],'sectionId':_0x319f24['id']},{})[_0x522e('0x20')](function(){return _0x50c4f5;});}else{return _0x50c4f5;}})['catch'](function(_0x377b6e){logger[_0x522e('0x24')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x377b6e);throw _0x377b6e;});}return _0x50c4f5;})[_0x522e('0x20')](respondWithResult(_0x383831,0xc9))[_0x522e('0x42')](handleError(_0x383831,null));};exports[_0x522e('0x1f')]=function(_0x1322c4,_0x272e3e){if(_0x1322c4[_0x522e('0x4e')]['id']){delete _0x1322c4[_0x522e('0x4e')]['id'];}return db[_0x522e('0x29')][_0x522e('0x45')]({'where':{'id':_0x1322c4[_0x522e('0x4f')]['id']}})[_0x522e('0x20')](handleEntityNotFound(_0x272e3e,null))[_0x522e('0x20')](saveUpdates(_0x1322c4[_0x522e('0x4e')],null))['then'](respondWithResult(_0x272e3e,null))[_0x522e('0x42')](handleError(_0x272e3e,null));};exports[_0x522e('0x21')]=function(_0x2e74e2,_0x17298b){return db[_0x522e('0x29')][_0x522e('0x45')]({'where':{'id':_0x2e74e2[_0x522e('0x4f')]['id']}})[_0x522e('0x20')](handleEntityNotFound(_0x17298b,null))[_0x522e('0x20')](removeEntity(_0x17298b,null))[_0x522e('0x42')](handleError(_0x17298b,null));}; \ No newline at end of file diff --git a/server/api/template/template.model.js b/server/api/template/template.model.js index b43f953..8f3f7a4 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 _0x0f74=['Template','tools_templates','lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./template.attributes','exports','define'];(function(_0x38e749,_0x1b82d8){var _0x443821=function(_0x233d0e){while(--_0x233d0e){_0x38e749['push'](_0x38e749['shift']());}};_0x443821(++_0x1b82d8);}(_0x0f74,0x1a2));var _0x40f7=function(_0x5b295c,_0x312ce7){_0x5b295c=_0x5b295c-0x0;var _0x3d9f4d=_0x0f74[_0x5b295c];return _0x3d9f4d;};'use strict';var _=require(_0x40f7('0x0'));var util=require('util');var logger=require(_0x40f7('0x1'))(_0x40f7('0x2'));var moment=require(_0x40f7('0x3'));var BPromise=require(_0x40f7('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x40f7('0x5'));var rimraf=require(_0x40f7('0x6'));var config=require(_0x40f7('0x7'));var attributes=require(_0x40f7('0x8'));module[_0x40f7('0x9')]=function(_0x46cc07,_0x59a74e){return _0x46cc07[_0x40f7('0xa')](_0x40f7('0xb'),attributes,{'tableName':_0x40f7('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xeeec=['../../config/logger','api','moment','bluebird','path','rimraf','exports','define','Template','tools_templates','lodash','util'];(function(_0x262736,_0x1c6067){var _0x5e018a=function(_0x5e96fc){while(--_0x5e96fc){_0x262736['push'](_0x262736['shift']());}};_0x5e018a(++_0x1c6067);}(_0xeeec,0xe2));var _0xceee=function(_0x2aea9e,_0x1f587f){_0x2aea9e=_0x2aea9e-0x0;var _0x430b92=_0xeeec[_0x2aea9e];return _0x430b92;};'use strict';var _=require(_0xceee('0x0'));var util=require(_0xceee('0x1'));var logger=require(_0xceee('0x2'))(_0xceee('0x3'));var moment=require(_0xceee('0x4'));var BPromise=require(_0xceee('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xceee('0x6'));var rimraf=require(_0xceee('0x7'));var config=require('../../config/environment');var attributes=require('./template.attributes');module[_0xceee('0x8')]=function(_0x446e28,_0x4060d8){return _0x446e28[_0xceee('0x9')](_0xceee('0xa'),attributes,{'tableName':_0xceee('0xb'),'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 5055b55..a7ba843 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 _0x4cad=['../../config/environment','jayson/promise','client','http','request','info','Template,\x20%s,\x20%s','request\x20sent','debug','Template,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetTemplate','Template','findAll','options','raw','where','attributes','limit','include','map','model','then','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x3a5036,_0x3c4af5){var _0x3cd454=function(_0x431797){while(--_0x431797){_0x3a5036['push'](_0x3a5036['shift']());}};_0x3cd454(++_0x3c4af5);}(_0x4cad,0x184));var _0xd4ca=function(_0x163862,_0x2e0714){_0x163862=_0x163862-0x0;var _0x3e86bf=_0x4cad[_0x163862];return _0x3e86bf;};'use strict';var _=require('lodash');var util=require(_0xd4ca('0x0'));var moment=require(_0xd4ca('0x1'));var BPromise=require(_0xd4ca('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd4ca('0x3'));var db=require(_0xd4ca('0x4'))['db'];var utils=require(_0xd4ca('0x5'));var logger=require(_0xd4ca('0x6'))(_0xd4ca('0x7'));var config=require(_0xd4ca('0x8'));var jayson=require(_0xd4ca('0x9'));var client=jayson[_0xd4ca('0xa')][_0xd4ca('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x30f120,_0x4aaae0,_0x57183e){return new BPromise(function(_0x3175e3,_0x2d0d50){return client[_0xd4ca('0xc')](_0x30f120,_0x57183e)['then'](function(_0xe5466){logger[_0xd4ca('0xd')](_0xd4ca('0xe'),_0x4aaae0,_0xd4ca('0xf'));logger[_0xd4ca('0x10')](_0xd4ca('0x11'),_0x4aaae0,_0xd4ca('0xf'),JSON[_0xd4ca('0x12')](_0xe5466));if(_0xe5466['error']){if(_0xe5466[_0xd4ca('0x13')][_0xd4ca('0x14')]===0x1f4){logger[_0xd4ca('0x13')](_0xd4ca('0xe'),_0x4aaae0,_0xe5466[_0xd4ca('0x13')][_0xd4ca('0x15')]);return _0x2d0d50(_0xe5466[_0xd4ca('0x13')]['message']);}logger[_0xd4ca('0x13')](_0xd4ca('0xe'),_0x4aaae0,_0xe5466[_0xd4ca('0x13')][_0xd4ca('0x15')]);return _0x3175e3(_0xe5466[_0xd4ca('0x13')][_0xd4ca('0x15')]);}else{logger[_0xd4ca('0xd')](_0xd4ca('0xe'),_0x4aaae0,_0xd4ca('0xf'));_0x3175e3(_0xe5466[_0xd4ca('0x16')]['message']);}})['catch'](function(_0x30ad08){logger['error'](_0xd4ca('0xe'),_0x4aaae0,_0x30ad08);_0x2d0d50(_0x30ad08);});});}exports[_0xd4ca('0x17')]=function(_0x1ac2c3){var _0x4731d6=this;return new Promise(function(_0x40bdae,_0x114da1){return db[_0xd4ca('0x18')][_0xd4ca('0x19')]({'raw':_0x1ac2c3[_0xd4ca('0x1a')]?_0x1ac2c3[_0xd4ca('0x1a')][_0xd4ca('0x1b')]===undefined?!![]:![]:!![],'where':_0x1ac2c3[_0xd4ca('0x1a')]?_0x1ac2c3[_0xd4ca('0x1a')][_0xd4ca('0x1c')]||null:null,'attributes':_0x1ac2c3[_0xd4ca('0x1a')]?_0x1ac2c3[_0xd4ca('0x1a')][_0xd4ca('0x1d')]||null:null,'limit':_0x1ac2c3[_0xd4ca('0x1a')]?_0x1ac2c3[_0xd4ca('0x1a')][_0xd4ca('0x1e')]||null:null,'include':_0x1ac2c3[_0xd4ca('0x1a')]?_0x1ac2c3[_0xd4ca('0x1a')][_0xd4ca('0x1f')]?_[_0xd4ca('0x20')](_0x1ac2c3['options'][_0xd4ca('0x1f')],function(_0x36c11b){return{'model':db[_0x36c11b[_0xd4ca('0x21')]],'as':_0x36c11b['as'],'attributes':_0x36c11b['attributes'],'include':_0x36c11b['include']?_[_0xd4ca('0x20')](_0x36c11b[_0xd4ca('0x1f')],function(_0x5ec060){return{'model':db[_0x5ec060[_0xd4ca('0x21')]],'as':_0x5ec060['as'],'attributes':_0x5ec060[_0xd4ca('0x1d')],'include':_0x5ec060[_0xd4ca('0x1f')]?_['map'](_0x5ec060[_0xd4ca('0x1f')],function(_0x337bb1){return{'model':db[_0x337bb1[_0xd4ca('0x21')]],'as':_0x337bb1['as'],'attributes':_0x337bb1['attributes']};}):[]};}):[]};}):[]:[]})[_0xd4ca('0x22')](function(_0x59270d){logger[_0xd4ca('0xd')]('GetTemplate',_0x1ac2c3);logger[_0xd4ca('0x10')](_0xd4ca('0x17'),_0x1ac2c3,JSON[_0xd4ca('0x12')](_0x59270d));_0x40bdae(_0x59270d);})[_0xd4ca('0x23')](function(_0x39db79){logger[_0xd4ca('0x13')](_0xd4ca('0x17'),_0x39db79[_0xd4ca('0x15')],_0x1ac2c3);_0x114da1(_0x4731d6[_0xd4ca('0x13')](0x1f4,_0x39db79[_0xd4ca('0x15')]));});});}; \ No newline at end of file +var _0x1437=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','Template,\x20%s,\x20%s','request\x20sent','debug','Template,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetTemplate','options','raw','where','attributes','limit','include','map','model','lodash'];(function(_0x42f53a,_0x4d4317){var _0x3fd4a3=function(_0xf48e79){while(--_0xf48e79){_0x42f53a['push'](_0x42f53a['shift']());}};_0x3fd4a3(++_0x4d4317);}(_0x1437,0x16a));var _0x7143=function(_0x5d3dd0,_0x163b90){_0x5d3dd0=_0x5d3dd0-0x0;var _0x51ce00=_0x1437[_0x5d3dd0];return _0x51ce00;};'use strict';var _=require(_0x7143('0x0'));var util=require(_0x7143('0x1'));var moment=require(_0x7143('0x2'));var BPromise=require(_0x7143('0x3'));var rs=require(_0x7143('0x4'));var fs=require('fs');var Redis=require(_0x7143('0x5'));var db=require(_0x7143('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x7143('0x7'))(_0x7143('0x8'));var config=require(_0x7143('0x9'));var jayson=require(_0x7143('0xa'));var client=jayson[_0x7143('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x43208d,_0x121a97,_0x210e6f){return new BPromise(function(_0x3cd9e4,_0x38188f){return client['request'](_0x43208d,_0x210e6f)[_0x7143('0xc')](function(_0x5813c7){logger[_0x7143('0xd')](_0x7143('0xe'),_0x121a97,_0x7143('0xf'));logger[_0x7143('0x10')](_0x7143('0x11'),_0x121a97,'request\x20sent',JSON[_0x7143('0x12')](_0x5813c7));if(_0x5813c7[_0x7143('0x13')]){if(_0x5813c7[_0x7143('0x13')][_0x7143('0x14')]===0x1f4){logger[_0x7143('0x13')](_0x7143('0xe'),_0x121a97,_0x5813c7[_0x7143('0x13')]['message']);return _0x38188f(_0x5813c7[_0x7143('0x13')][_0x7143('0x15')]);}logger['error']('Template,\x20%s,\x20%s',_0x121a97,_0x5813c7[_0x7143('0x13')][_0x7143('0x15')]);return _0x3cd9e4(_0x5813c7['error']['message']);}else{logger['info'](_0x7143('0xe'),_0x121a97,_0x7143('0xf'));_0x3cd9e4(_0x5813c7[_0x7143('0x16')][_0x7143('0x15')]);}})[_0x7143('0x17')](function(_0x7a47ba){logger['error'](_0x7143('0xe'),_0x121a97,_0x7a47ba);_0x38188f(_0x7a47ba);});});}exports[_0x7143('0x18')]=function(_0x282591){var _0x3e1e6c=this;return new Promise(function(_0x470bc8,_0x16afdc){return db['Template']['findAll']({'raw':_0x282591[_0x7143('0x19')]?_0x282591[_0x7143('0x19')][_0x7143('0x1a')]===undefined?!![]:![]:!![],'where':_0x282591[_0x7143('0x19')]?_0x282591[_0x7143('0x19')][_0x7143('0x1b')]||null:null,'attributes':_0x282591[_0x7143('0x19')]?_0x282591[_0x7143('0x19')][_0x7143('0x1c')]||null:null,'limit':_0x282591['options']?_0x282591[_0x7143('0x19')][_0x7143('0x1d')]||null:null,'include':_0x282591[_0x7143('0x19')]?_0x282591[_0x7143('0x19')][_0x7143('0x1e')]?_['map'](_0x282591[_0x7143('0x19')][_0x7143('0x1e')],function(_0x52d80a){return{'model':db[_0x52d80a['model']],'as':_0x52d80a['as'],'attributes':_0x52d80a[_0x7143('0x1c')],'include':_0x52d80a[_0x7143('0x1e')]?_[_0x7143('0x1f')](_0x52d80a['include'],function(_0x134750){return{'model':db[_0x134750[_0x7143('0x20')]],'as':_0x134750['as'],'attributes':_0x134750[_0x7143('0x1c')],'include':_0x134750[_0x7143('0x1e')]?_[_0x7143('0x1f')](_0x134750[_0x7143('0x1e')],function(_0x1281a6){return{'model':db[_0x1281a6[_0x7143('0x20')]],'as':_0x1281a6['as'],'attributes':_0x1281a6['attributes']};}):[]};}):[]};}):[]:[]})[_0x7143('0xc')](function(_0x8dc4bb){logger[_0x7143('0xd')](_0x7143('0x18'),_0x282591);logger[_0x7143('0x10')]('GetTemplate',_0x282591,JSON[_0x7143('0x12')](_0x8dc4bb));_0x470bc8(_0x8dc4bb);})['catch'](function(_0x2cfb18){logger[_0x7143('0x13')]('GetTemplate',_0x2cfb18[_0x7143('0x15')],_0x282591);_0x16afdc(_0x3e1e6c[_0x7143('0x13')](0x1f4,_0x2cfb18[_0x7143('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/trigger/index.js b/server/api/trigger/index.js index 47a4a93..3b8f6ef 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 _0xcf4e=['/:id/all_conditions','addAnyCondition','addAction','put','update','delete','exports','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./trigger.controller','get','index','/:id','isAuthenticated','show','getAllConditions','/:id/any_conditions','getAnyConditions','/:id/actions','getActions','create','post'];(function(_0x5eef05,_0x1be989){var _0x56d4b8=function(_0x57993d){while(--_0x57993d){_0x5eef05['push'](_0x5eef05['shift']());}};_0x56d4b8(++_0x1be989);}(_0xcf4e,0x1ed));var _0xecf4=function(_0x47c047,_0x5c3923){_0x47c047=_0x47c047-0x0;var _0x397c38=_0xcf4e[_0x47c047];return _0x397c38;};'use strict';var multer=require('multer');var util=require(_0xecf4('0x0'));var path=require('path');var timeout=require(_0xecf4('0x1'));var express=require(_0xecf4('0x2'));var router=express[_0xecf4('0x3')]();var auth=require(_0xecf4('0x4'));var interaction=require(_0xecf4('0x5'));var config=require(_0xecf4('0x6'));var controller=require(_0xecf4('0x7'));router[_0xecf4('0x8')]('/',auth['isAuthenticated'](),controller[_0xecf4('0x9')]);router[_0xecf4('0x8')](_0xecf4('0xa'),auth[_0xecf4('0xb')](),controller[_0xecf4('0xc')]);router['get']('/:id/all_conditions',auth['isAuthenticated'](),controller[_0xecf4('0xd')]);router[_0xecf4('0x8')](_0xecf4('0xe'),auth['isAuthenticated'](),controller[_0xecf4('0xf')]);router[_0xecf4('0x8')](_0xecf4('0x10'),auth[_0xecf4('0xb')](),controller[_0xecf4('0x11')]);router['post']('/',auth[_0xecf4('0xb')](),controller[_0xecf4('0x12')]);router[_0xecf4('0x13')](_0xecf4('0x14'),auth[_0xecf4('0xb')](),controller['addAllCondition']);router['post'](_0xecf4('0xe'),auth['isAuthenticated'](),controller[_0xecf4('0x15')]);router['post'](_0xecf4('0x10'),auth[_0xecf4('0xb')](),controller[_0xecf4('0x16')]);router[_0xecf4('0x17')](_0xecf4('0xa'),auth[_0xecf4('0xb')](),controller[_0xecf4('0x18')]);router[_0xecf4('0x19')](_0xecf4('0xa'),auth[_0xecf4('0xb')](),controller['destroy']);module[_0xecf4('0x1a')]=router; \ No newline at end of file +var _0xf227=['./trigger.controller','get','isAuthenticated','index','/:id','show','/:id/all_conditions','getAllConditions','/:id/any_conditions','getAnyConditions','/:id/actions','getActions','create','post','addAllCondition','addAnyCondition','addAction','multer','path','express','Router','../../config/environment'];(function(_0xc5abc7,_0x4fae06){var _0x742211=function(_0x52c3e0){while(--_0x52c3e0){_0xc5abc7['push'](_0xc5abc7['shift']());}};_0x742211(++_0x4fae06);}(_0xf227,0x103));var _0x7f22=function(_0x5379aa,_0x817f5){_0x5379aa=_0x5379aa-0x0;var _0x15971a=_0xf227[_0x5379aa];return _0x15971a;};'use strict';var multer=require(_0x7f22('0x0'));var util=require('util');var path=require(_0x7f22('0x1'));var timeout=require('connect-timeout');var express=require(_0x7f22('0x2'));var router=express[_0x7f22('0x3')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x7f22('0x4'));var controller=require(_0x7f22('0x5'));router[_0x7f22('0x6')]('/',auth[_0x7f22('0x7')](),controller[_0x7f22('0x8')]);router[_0x7f22('0x6')](_0x7f22('0x9'),auth[_0x7f22('0x7')](),controller[_0x7f22('0xa')]);router[_0x7f22('0x6')](_0x7f22('0xb'),auth['isAuthenticated'](),controller[_0x7f22('0xc')]);router[_0x7f22('0x6')](_0x7f22('0xd'),auth[_0x7f22('0x7')](),controller[_0x7f22('0xe')]);router['get'](_0x7f22('0xf'),auth[_0x7f22('0x7')](),controller[_0x7f22('0x10')]);router['post']('/',auth[_0x7f22('0x7')](),controller[_0x7f22('0x11')]);router[_0x7f22('0x12')](_0x7f22('0xb'),auth['isAuthenticated'](),controller[_0x7f22('0x13')]);router[_0x7f22('0x12')]('/:id/any_conditions',auth[_0x7f22('0x7')](),controller[_0x7f22('0x14')]);router[_0x7f22('0x12')]('/:id/actions',auth[_0x7f22('0x7')](),controller[_0x7f22('0x15')]);router['put'](_0x7f22('0x9'),auth[_0x7f22('0x7')](),controller['update']);router['delete'](_0x7f22('0x9'),auth[_0x7f22('0x7')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/trigger/trigger.attributes.js b/server/api/trigger/trigger.attributes.js index 1ad8f18..cfebb7a 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 _0xb13f=['sequelize','exports','STRING'];(function(_0x4ebe56,_0x2d3685){var _0x55e94b=function(_0x47d79c){while(--_0x47d79c){_0x4ebe56['push'](_0x4ebe56['shift']());}};_0x55e94b(++_0x2d3685);}(_0xb13f,0xe4));var _0xfb13=function(_0x1bf2ac,_0x7226f8){_0x1bf2ac=_0x1bf2ac-0x0;var _0x17e8e2=_0xb13f[_0x1bf2ac];return _0x17e8e2;};'use strict';var Sequelize=require(_0xfb13('0x0'));module[_0xfb13('0x1')]={'name':{'type':Sequelize[_0xfb13('0x2')]},'channel':{'type':Sequelize[_0xfb13('0x2')]},'description':{'type':Sequelize[_0xfb13('0x2')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0xdd6f=['STRING','BOOLEAN','sequelize','exports'];(function(_0x4d1cc7,_0x2783a2){var _0xb28b58=function(_0x238978){while(--_0x238978){_0x4d1cc7['push'](_0x4d1cc7['shift']());}};_0xb28b58(++_0x2783a2);}(_0xdd6f,0x1e2));var _0xfdd6=function(_0x482fa1,_0x12b3d3){_0x482fa1=_0x482fa1-0x0;var _0x587405=_0xdd6f[_0x482fa1];return _0x587405;};'use strict';var Sequelize=require(_0xfdd6('0x0'));module[_0xfdd6('0x1')]={'name':{'type':Sequelize['STRING']},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xfdd6('0x2')]},'status':{'type':Sequelize[_0xfdd6('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/trigger/trigger.controller.js b/server/api/trigger/trigger.controller.js index ddb546e..6a77812 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 _0x0b3f=['user','Unable\x20to\x20retrieve\x20the\x20current\x20user','Triggers','UserProfileSection','error','find','params','addAllCondition','Condition','TriggerAnyId','getAllConditions','findOne','length','pick','getAnyConditions','TriggerId','Action','getActions','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','status','end','offset','limit','set','Content-Range','json','apply','reject','update','get','destroy','then','name','index','Trigger','rawAttributes','model','keys','query','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','filters','filter','merge','where','map','type','key','field','options','includeAll','include','findAll','catch','show','create','body'];(function(_0x2b1675,_0x435d4b){var _0x5b46fa=function(_0x50b27e){while(--_0x50b27e){_0x2b1675['push'](_0x2b1675['shift']());}};_0x5b46fa(++_0x435d4b);}(_0x0b3f,0xba));var _0xf0b3=function(_0x3d2573,_0x3aeff9){_0x3d2573=_0x3d2573-0x0;var _0xf58562=_0x0b3f[_0x3d2573];return _0xf58562;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xf0b3('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf0b3('0x1'));var jsonpatch=require(_0xf0b3('0x2'));var rp=require(_0xf0b3('0x3'));var moment=require(_0xf0b3('0x4'));var BPromise=require(_0xf0b3('0x5'));var Mustache=require(_0xf0b3('0x6'));var util=require(_0xf0b3('0x7'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0xf0b3('0x8'));var squel=require(_0xf0b3('0x9'));var crypto=require(_0xf0b3('0xa'));var jsforce=require(_0xf0b3('0xb'));var deskjs=require(_0xf0b3('0xc'));var toCsv=require(_0xf0b3('0xd'));var querystring=require(_0xf0b3('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xf0b3('0xf'));var qs=require(_0xf0b3('0x10'));var as=require(_0xf0b3('0x11'));var hardwareService=require(_0xf0b3('0x12'));var logger=require('../../config/logger')(_0xf0b3('0x13'));var utils=require(_0xf0b3('0x14'));var config=require(_0xf0b3('0x15'));var db=require(_0xf0b3('0x16'))['db'];function respondWithStatusCode(_0x24bd85,_0x1f3ae3){_0x1f3ae3=_0x1f3ae3||0xcc;return function(_0x14ab8b){if(_0x14ab8b){return _0x24bd85['sendStatus'](_0x1f3ae3);}return _0x24bd85[_0xf0b3('0x17')](_0x1f3ae3)[_0xf0b3('0x18')]();};}function respondWithResult(_0x17c294,_0x22b125){_0x22b125=_0x22b125||0xc8;return function(_0x18a00f){if(_0x18a00f){return _0x17c294['status'](_0x22b125)['json'](_0x18a00f);}};}function respondWithFilteredResult(_0x522710,_0x3815a1){return function(_0x2298db){if(_0x2298db){var _0x70b18e=_0x2298db['count'],_0x2e3317=_0x3815a1[_0xf0b3('0x19')],_0x3bbe3b=_0x3815a1[_0xf0b3('0x19')]+_0x3815a1[_0xf0b3('0x1a')],_0x3bd966;if(_0x3bbe3b>=_0x70b18e){_0x3bbe3b=_0x70b18e;_0x3bd966=0xc8;}else{_0x3bd966=0xce;}_0x522710[_0xf0b3('0x17')](_0x3bd966);return _0x522710[_0xf0b3('0x1b')](_0xf0b3('0x1c'),_0x2e3317+'-'+_0x3bbe3b+'/'+_0x70b18e)[_0xf0b3('0x1d')](_0x2298db);}return null;};}function patchUpdates(_0x26c67d){return function(_0x4befc2){try{jsonpatch[_0xf0b3('0x1e')](_0x4befc2,_0x26c67d,!![]);}catch(_0x27bf00){return BPromise[_0xf0b3('0x1f')](_0x27bf00);}return _0x4befc2['save']();};}function saveUpdates(_0x24bfb9,_0x4a515c){return function(_0x4122fb){if(_0x4122fb){return _0x4122fb[_0xf0b3('0x20')](_0x24bfb9)['then'](function(_0x3dcf17){return _0x3dcf17;});}return null;};}function removeEntity(_0x5d7d2e,_0x4f2779){return function(_0x224989){if(_0x224989){return _0x224989['destroy']()['then'](function(){var _0x44044e=_0x224989[_0xf0b3('0x21')]({'plain':!![]});var _0x72cb88='Triggers';return db['UserProfileResource'][_0xf0b3('0x22')]({'where':{'type':_0x72cb88,'resourceId':_0x44044e['id']}})[_0xf0b3('0x23')](function(){return _0x224989;});})[_0xf0b3('0x23')](function(){_0x5d7d2e[_0xf0b3('0x17')](0xcc)[_0xf0b3('0x18')]();});}};}function handleEntityNotFound(_0x1717f5,_0x2b3317){return function(_0x2452dd){if(!_0x2452dd){_0x1717f5['sendStatus'](0x194);}return _0x2452dd;};}function handleError(_0x1347fd,_0x3b2af9){_0x3b2af9=_0x3b2af9||0x1f4;return function(_0x556437){logger['error'](_0x556437['stack']);if(_0x556437['name']){delete _0x556437[_0xf0b3('0x24')];}_0x1347fd[_0xf0b3('0x17')](_0x3b2af9)['send'](_0x556437);};}exports[_0xf0b3('0x25')]=function(_0x5a1340,_0x26e050){var _0x4e6fcf={},_0xe8ea17={},_0x542afd={'count':0x0,'rows':[]};var _0x1be1f3=db[_0xf0b3('0x26')][_0xf0b3('0x27')];_0xe8ea17[_0xf0b3('0x28')]=_['keys'](_0x1be1f3);_0xe8ea17['query']=_[_0xf0b3('0x29')](_0x5a1340[_0xf0b3('0x2a')]);_0xe8ea17['filters']=_[_0xf0b3('0x2b')](_0xe8ea17[_0xf0b3('0x28')],_0xe8ea17['query']);_0x4e6fcf['attributes']=_['intersection'](_0xe8ea17[_0xf0b3('0x28')],qs[_0xf0b3('0x2c')](_0x5a1340[_0xf0b3('0x2a')]['fields']));_0x4e6fcf[_0xf0b3('0x2d')]=_0x4e6fcf[_0xf0b3('0x2d')]['length']?_0x4e6fcf[_0xf0b3('0x2d')]:_0xe8ea17[_0xf0b3('0x28')];if(!_0x5a1340['query'][_0xf0b3('0x2e')](_0xf0b3('0x2f'))){_0x4e6fcf[_0xf0b3('0x1a')]=qs[_0xf0b3('0x1a')](_0x5a1340[_0xf0b3('0x2a')][_0xf0b3('0x1a')]);_0x4e6fcf[_0xf0b3('0x19')]=qs[_0xf0b3('0x19')](_0x5a1340[_0xf0b3('0x2a')]['offset']);}_0x4e6fcf[_0xf0b3('0x30')]=qs[_0xf0b3('0x31')](_0x5a1340[_0xf0b3('0x2a')][_0xf0b3('0x31')]);_0x4e6fcf['where']=qs[_0xf0b3('0x32')](_['pick'](_0x5a1340[_0xf0b3('0x2a')],_0xe8ea17[_0xf0b3('0x32')]));if(_0x5a1340['query'][_0xf0b3('0x33')]){_0x4e6fcf['where']=_[_0xf0b3('0x34')](_0x4e6fcf[_0xf0b3('0x35')],{'$or':_[_0xf0b3('0x36')](_0x1be1f3,function(_0x1c1371){if(_0x1c1371[_0xf0b3('0x37')][_0xf0b3('0x38')]!=='VIRTUAL'){var _0x447bc6={};_0x447bc6[_0x1c1371[_0xf0b3('0x39')]]={'$like':'%'+_0x5a1340[_0xf0b3('0x2a')][_0xf0b3('0x33')]+'%'};return _0x447bc6;}})});}_0x4e6fcf=_[_0xf0b3('0x34')]({},_0x4e6fcf,_0x5a1340[_0xf0b3('0x3a')]);var _0x5ad670={'where':_0x4e6fcf[_0xf0b3('0x35')]};return db[_0xf0b3('0x26')]['count'](_0x5ad670)['then'](function(_0x3d2f56){_0x542afd['count']=_0x3d2f56;if(_0x5a1340[_0xf0b3('0x2a')][_0xf0b3('0x3b')]){_0x4e6fcf[_0xf0b3('0x3c')]=[{'all':!![]}];}return db[_0xf0b3('0x26')][_0xf0b3('0x3d')](_0x4e6fcf);})['then'](function(_0x12a3bd){_0x542afd['rows']=_0x12a3bd;return _0x542afd;})[_0xf0b3('0x23')](respondWithFilteredResult(_0x26e050,_0x4e6fcf))[_0xf0b3('0x3e')](handleError(_0x26e050,null));};exports[_0xf0b3('0x3f')]=function(_0x36059e,_0x48a8c6){var _0x439a95={'raw':![],'where':{'id':_0x36059e['params']['id']}},_0x23842f={};_0x23842f[_0xf0b3('0x28')]=_['keys'](db[_0xf0b3('0x26')][_0xf0b3('0x27')]);_0x23842f['query']=_[_0xf0b3('0x29')](_0x36059e[_0xf0b3('0x2a')]);_0x23842f['filters']=_[_0xf0b3('0x2b')](_0x23842f['model'],_0x23842f[_0xf0b3('0x2a')]);_0x439a95[_0xf0b3('0x2d')]=_[_0xf0b3('0x2b')](_0x23842f[_0xf0b3('0x28')],qs[_0xf0b3('0x2c')](_0x36059e['query'][_0xf0b3('0x2c')]));_0x439a95[_0xf0b3('0x2d')]=_0x439a95[_0xf0b3('0x2d')]['length']?_0x439a95[_0xf0b3('0x2d')]:_0x23842f[_0xf0b3('0x28')];if(_0x36059e[_0xf0b3('0x2a')][_0xf0b3('0x3b')]){_0x439a95[_0xf0b3('0x3c')]=[{'all':!![]}];}_0x439a95=_['merge']({},_0x439a95,_0x36059e[_0xf0b3('0x3a')]);return db[_0xf0b3('0x26')]['find'](_0x439a95)[_0xf0b3('0x23')](handleEntityNotFound(_0x48a8c6,null))[_0xf0b3('0x23')](respondWithResult(_0x48a8c6,null))[_0xf0b3('0x3e')](handleError(_0x48a8c6,null));};exports[_0xf0b3('0x40')]=function(_0x2ca09e,_0x4a061e){return db['Trigger'][_0xf0b3('0x40')](_0x2ca09e[_0xf0b3('0x41')],{})[_0xf0b3('0x23')](function(_0x3599bd){var _0x2c1066=_0x2ca09e[_0xf0b3('0x42')]['get']({'plain':!![]});if(!_0x2c1066)throw new Error(_0xf0b3('0x43'));if(_0x2c1066['role']===_0xf0b3('0x42')){var _0x16f093=_0x3599bd['get']({'plain':!![]});var _0x17a609=_0xf0b3('0x44');return db[_0xf0b3('0x45')]['find']({'where':{'name':_0x17a609,'userProfileId':_0x2c1066['userProfileId']},'raw':!![]})['then'](function(_0x24f23e){if(_0x24f23e&&_0x24f23e['autoAssociation']===0x0){return db['UserProfileResource'][_0xf0b3('0x40')]({'name':_0x16f093[_0xf0b3('0x24')],'resourceId':_0x16f093['id'],'type':_0x24f23e[_0xf0b3('0x24')],'sectionId':_0x24f23e['id']},{})[_0xf0b3('0x23')](function(){return _0x3599bd;});}else{return _0x3599bd;}})[_0xf0b3('0x3e')](function(_0x535408){logger[_0xf0b3('0x46')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x535408);throw _0x535408;});}return _0x3599bd;})[_0xf0b3('0x23')](respondWithResult(_0x4a061e,0xc9))['catch'](handleError(_0x4a061e,null));};exports[_0xf0b3('0x20')]=function(_0x10d1cb,_0x5658b9){if(_0x10d1cb[_0xf0b3('0x41')]['id']){delete _0x10d1cb['body']['id'];}return db['Trigger'][_0xf0b3('0x47')]({'where':{'id':_0x10d1cb[_0xf0b3('0x48')]['id']}})[_0xf0b3('0x23')](handleEntityNotFound(_0x5658b9,null))[_0xf0b3('0x23')](saveUpdates(_0x10d1cb['body'],null))[_0xf0b3('0x23')](respondWithResult(_0x5658b9,null))[_0xf0b3('0x3e')](handleError(_0x5658b9,null));};exports[_0xf0b3('0x22')]=function(_0xb966d0,_0x14f344){return db['Trigger'][_0xf0b3('0x47')]({'where':{'id':_0xb966d0[_0xf0b3('0x48')]['id']}})['then'](handleEntityNotFound(_0x14f344,null))['then'](removeEntity(_0x14f344,null))[_0xf0b3('0x3e')](handleError(_0x14f344,null));};exports[_0xf0b3('0x49')]=function(_0x260744,_0x4d298f,_0xfc8ed9){if(_0x260744[_0xf0b3('0x41')]['id']){delete _0x260744['body']['id'];}return db[_0xf0b3('0x26')]['find']({'where':{'id':_0x260744[_0xf0b3('0x48')]['id']}})['then'](handleEntityNotFound(_0x4d298f,null))[_0xf0b3('0x23')](function(_0x2d1db3){if(_0x2d1db3){_0x260744[_0xf0b3('0x41')]['TriggerAllId']=_0x2d1db3['id'];return db[_0xf0b3('0x4a')][_0xf0b3('0x40')](_0x260744[_0xf0b3('0x41')]);}})[_0xf0b3('0x23')](respondWithResult(_0x4d298f,null))[_0xf0b3('0x3e')](handleError(_0x4d298f,null));};exports['addAnyCondition']=function(_0x3d38e1,_0x4c54ee,_0x567bac){if(_0x3d38e1[_0xf0b3('0x41')]['id']){delete _0x3d38e1[_0xf0b3('0x41')]['id'];}return db[_0xf0b3('0x26')][_0xf0b3('0x47')]({'where':{'id':_0x3d38e1[_0xf0b3('0x48')]['id']}})['then'](handleEntityNotFound(_0x4c54ee,null))[_0xf0b3('0x23')](function(_0x48ce4b){if(_0x48ce4b){_0x3d38e1[_0xf0b3('0x41')][_0xf0b3('0x4b')]=_0x48ce4b['id'];return db[_0xf0b3('0x4a')]['create'](_0x3d38e1['body']);}})['then'](respondWithResult(_0x4c54ee,null))['catch'](handleError(_0x4c54ee,null));};exports[_0xf0b3('0x4c')]=function(_0x141fca,_0x39acf1,_0x140ca2){var _0x52e088={};var _0x2fc25b={};var _0x274c54;var _0x49bcbe;return db['Trigger'][_0xf0b3('0x4d')]({'where':{'id':_0x141fca[_0xf0b3('0x48')]['id']}})['then'](handleEntityNotFound(_0x39acf1,null))[_0xf0b3('0x23')](function(_0xc18cb0){if(_0xc18cb0){_0x274c54=_0xc18cb0;_0x2fc25b['model']=_[_0xf0b3('0x29')](db[_0xf0b3('0x4a')][_0xf0b3('0x27')]);_0x2fc25b[_0xf0b3('0x2a')]=_[_0xf0b3('0x29')](_0x141fca[_0xf0b3('0x2a')]);_0x2fc25b[_0xf0b3('0x32')]=_[_0xf0b3('0x2b')](_0x2fc25b['model'],_0x2fc25b[_0xf0b3('0x2a')]);_0x52e088['attributes']=_[_0xf0b3('0x2b')](_0x2fc25b[_0xf0b3('0x28')],qs[_0xf0b3('0x2c')](_0x141fca[_0xf0b3('0x2a')]['fields']));_0x52e088['attributes']=_0x52e088['attributes'][_0xf0b3('0x4e')]?_0x52e088['attributes']:_0x2fc25b[_0xf0b3('0x28')];_0x52e088[_0xf0b3('0x30')]=qs['sort'](_0x141fca[_0xf0b3('0x2a')][_0xf0b3('0x31')]);_0x52e088[_0xf0b3('0x35')]=qs[_0xf0b3('0x32')](_[_0xf0b3('0x4f')](_0x141fca[_0xf0b3('0x2a')],_0x2fc25b[_0xf0b3('0x32')]));if(_0x141fca[_0xf0b3('0x2a')]['filter']){_0x52e088['where']=_[_0xf0b3('0x34')](_0x52e088['where'],{'$or':_[_0xf0b3('0x36')](_0x52e088[_0xf0b3('0x2d')],function(_0x342b7b){var _0x3437c6={};_0x3437c6[_0x342b7b]={'$like':'%'+_0x141fca[_0xf0b3('0x2a')]['filter']+'%'};return _0x3437c6;})});}_0x52e088=_[_0xf0b3('0x34')]({},_0x52e088,_0x141fca['options']);return _0x274c54[_0xf0b3('0x4c')](_0x52e088);}})['then'](function(_0x116cac){if(_0x116cac){_0x49bcbe=_0x116cac[_0xf0b3('0x4e')];if(!_0x141fca[_0xf0b3('0x2a')]['hasOwnProperty'](_0xf0b3('0x2f'))){_0x52e088[_0xf0b3('0x1a')]=qs[_0xf0b3('0x1a')](_0x141fca[_0xf0b3('0x2a')]['limit']);_0x52e088[_0xf0b3('0x19')]=qs[_0xf0b3('0x19')](_0x141fca['query']['offset']);}return _0x274c54[_0xf0b3('0x4c')](_0x52e088);}})[_0xf0b3('0x23')](function(_0x22289c){if(_0x22289c){return _0x22289c?{'count':_0x49bcbe,'rows':_0x22289c}:null;}})['then'](respondWithResult(_0x39acf1,null))['catch'](handleError(_0x39acf1,null));};exports[_0xf0b3('0x50')]=function(_0x334cf3,_0x3d3ab2,_0x1f0a3a){var _0x4f79b1={};var _0x320ff1={};var _0x58af6d;var _0x468874;return db[_0xf0b3('0x26')][_0xf0b3('0x4d')]({'where':{'id':_0x334cf3[_0xf0b3('0x48')]['id']}})[_0xf0b3('0x23')](handleEntityNotFound(_0x3d3ab2,null))[_0xf0b3('0x23')](function(_0x4b269f){if(_0x4b269f){_0x58af6d=_0x4b269f;_0x320ff1['model']=_['keys'](db['Condition']['rawAttributes']);_0x320ff1['query']=_['keys'](_0x334cf3['query']);_0x320ff1[_0xf0b3('0x32')]=_[_0xf0b3('0x2b')](_0x320ff1[_0xf0b3('0x28')],_0x320ff1['query']);_0x4f79b1['attributes']=_['intersection'](_0x320ff1['model'],qs[_0xf0b3('0x2c')](_0x334cf3['query'][_0xf0b3('0x2c')]));_0x4f79b1[_0xf0b3('0x2d')]=_0x4f79b1['attributes'][_0xf0b3('0x4e')]?_0x4f79b1[_0xf0b3('0x2d')]:_0x320ff1['model'];_0x4f79b1['order']=qs[_0xf0b3('0x31')](_0x334cf3['query'][_0xf0b3('0x31')]);_0x4f79b1[_0xf0b3('0x35')]=qs[_0xf0b3('0x32')](_[_0xf0b3('0x4f')](_0x334cf3[_0xf0b3('0x2a')],_0x320ff1[_0xf0b3('0x32')]));if(_0x334cf3[_0xf0b3('0x2a')][_0xf0b3('0x33')]){_0x4f79b1[_0xf0b3('0x35')]=_['merge'](_0x4f79b1['where'],{'$or':_[_0xf0b3('0x36')](_0x4f79b1['attributes'],function(_0x2672d3){var _0x9ffac6={};_0x9ffac6[_0x2672d3]={'$like':'%'+_0x334cf3['query'][_0xf0b3('0x33')]+'%'};return _0x9ffac6;})});}_0x4f79b1=_[_0xf0b3('0x34')]({},_0x4f79b1,_0x334cf3[_0xf0b3('0x3a')]);return _0x58af6d[_0xf0b3('0x50')](_0x4f79b1);}})[_0xf0b3('0x23')](function(_0x573807){if(_0x573807){_0x468874=_0x573807['length'];if(!_0x334cf3['query'][_0xf0b3('0x2e')](_0xf0b3('0x2f'))){_0x4f79b1[_0xf0b3('0x1a')]=qs[_0xf0b3('0x1a')](_0x334cf3[_0xf0b3('0x2a')]['limit']);_0x4f79b1[_0xf0b3('0x19')]=qs[_0xf0b3('0x19')](_0x334cf3[_0xf0b3('0x2a')][_0xf0b3('0x19')]);}return _0x58af6d[_0xf0b3('0x50')](_0x4f79b1);}})[_0xf0b3('0x23')](function(_0x3a5ecf){if(_0x3a5ecf){return _0x3a5ecf?{'count':_0x468874,'rows':_0x3a5ecf}:null;}})[_0xf0b3('0x23')](respondWithResult(_0x3d3ab2,null))[_0xf0b3('0x3e')](handleError(_0x3d3ab2,null));};exports['addAction']=function(_0xec5254,_0x33e05a,_0x46af71){if(_0xec5254[_0xf0b3('0x41')]['id']){delete _0xec5254[_0xf0b3('0x41')]['id'];}return db['Trigger'][_0xf0b3('0x47')]({'where':{'id':_0xec5254['params']['id']}})['then'](handleEntityNotFound(_0x33e05a,null))['then'](function(_0x1c954a){if(_0x1c954a){_0xec5254[_0xf0b3('0x41')][_0xf0b3('0x51')]=_0x1c954a['id'];return db[_0xf0b3('0x52')][_0xf0b3('0x40')](_0xec5254[_0xf0b3('0x41')]);}})[_0xf0b3('0x23')](respondWithResult(_0x33e05a,null))[_0xf0b3('0x3e')](handleError(_0x33e05a,null));};exports[_0xf0b3('0x53')]=function(_0x247372,_0x4da1f7,_0x100bd4){var _0x232a22={};var _0x5b8e72={};var _0x14d2dc;var _0x15583a;return db[_0xf0b3('0x26')][_0xf0b3('0x4d')]({'where':{'id':_0x247372[_0xf0b3('0x48')]['id']}})[_0xf0b3('0x23')](handleEntityNotFound(_0x4da1f7,null))['then'](function(_0x35c73c){if(_0x35c73c){_0x14d2dc=_0x35c73c;_0x5b8e72[_0xf0b3('0x28')]=_[_0xf0b3('0x29')](db[_0xf0b3('0x52')][_0xf0b3('0x27')]);_0x5b8e72[_0xf0b3('0x2a')]=_[_0xf0b3('0x29')](_0x247372[_0xf0b3('0x2a')]);_0x5b8e72[_0xf0b3('0x32')]=_['intersection'](_0x5b8e72[_0xf0b3('0x28')],_0x5b8e72[_0xf0b3('0x2a')]);_0x232a22[_0xf0b3('0x2d')]=_[_0xf0b3('0x2b')](_0x5b8e72['model'],qs['fields'](_0x247372[_0xf0b3('0x2a')][_0xf0b3('0x2c')]));_0x232a22[_0xf0b3('0x2d')]=_0x232a22[_0xf0b3('0x2d')]['length']?_0x232a22['attributes']:_0x5b8e72[_0xf0b3('0x28')];_0x232a22[_0xf0b3('0x30')]=qs[_0xf0b3('0x31')](_0x247372[_0xf0b3('0x2a')][_0xf0b3('0x31')]);_0x232a22['where']=qs[_0xf0b3('0x32')](_[_0xf0b3('0x4f')](_0x247372[_0xf0b3('0x2a')],_0x5b8e72[_0xf0b3('0x32')]));if(_0x247372[_0xf0b3('0x2a')][_0xf0b3('0x33')]){_0x232a22['where']=_[_0xf0b3('0x34')](_0x232a22['where'],{'$or':_['map'](_0x232a22['attributes'],function(_0x115a17){var _0x2f0f8a={};_0x2f0f8a[_0x115a17]={'$like':'%'+_0x247372[_0xf0b3('0x2a')]['filter']+'%'};return _0x2f0f8a;})});}_0x232a22=_['merge']({},_0x232a22,_0x247372['options']);return _0x14d2dc[_0xf0b3('0x53')](_0x232a22);}})[_0xf0b3('0x23')](function(_0x142cb1){if(_0x142cb1){_0x15583a=_0x142cb1[_0xf0b3('0x4e')];if(!_0x247372[_0xf0b3('0x2a')][_0xf0b3('0x2e')](_0xf0b3('0x2f'))){_0x232a22[_0xf0b3('0x1a')]=qs[_0xf0b3('0x1a')](_0x247372[_0xf0b3('0x2a')][_0xf0b3('0x1a')]);_0x232a22[_0xf0b3('0x19')]=qs['offset'](_0x247372[_0xf0b3('0x2a')]['offset']);}return _0x14d2dc[_0xf0b3('0x53')](_0x232a22);}})[_0xf0b3('0x23')](function(_0x48af99){if(_0x48af99){return _0x48af99?{'count':_0x15583a,'rows':_0x48af99}:null;}})[_0xf0b3('0x23')](respondWithResult(_0x4da1f7,null))[_0xf0b3('0x3e')](handleError(_0x4da1f7,null));}; \ No newline at end of file +var _0xb2f2=['userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','addAllCondition','TriggerAllId','addAnyCondition','TriggerAnyId','Condition','getAllConditions','getAnyConditions','addAction','TriggerId','Action','getActions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','status','end','json','count','offset','limit','set','Content-Range','apply','reject','then','destroy','Triggers','UserProfileResource','sendStatus','name','send','index','Trigger','rawAttributes','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','options','includeAll','include','findAll','catch','show','create','body','user','role','get','UserProfileSection','find'];(function(_0x3b910a,_0x3665ac){var _0x6eeee1=function(_0x5e8be9){while(--_0x5e8be9){_0x3b910a['push'](_0x3b910a['shift']());}};_0x6eeee1(++_0x3665ac);}(_0xb2f2,0xc0));var _0x2b2f=function(_0x1b557a,_0x48eede){_0x1b557a=_0x1b557a-0x0;var _0x5cfd74=_0xb2f2[_0x1b557a];return _0x5cfd74;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x2b2f('0x0'));var rimraf=require(_0x2b2f('0x1'));var zipdir=require(_0x2b2f('0x2'));var jsonpatch=require(_0x2b2f('0x3'));var rp=require(_0x2b2f('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x2b2f('0x5'));var util=require(_0x2b2f('0x6'));var path=require(_0x2b2f('0x7'));var sox=require(_0x2b2f('0x8'));var csv=require(_0x2b2f('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x2b2f('0xa'));var crypto=require(_0x2b2f('0xb'));var jsforce=require(_0x2b2f('0xc'));var deskjs=require(_0x2b2f('0xd'));var toCsv=require(_0x2b2f('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x2b2f('0xe'));var authService=require(_0x2b2f('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x2b2f('0x10'));var hardwareService=require(_0x2b2f('0x11'));var logger=require(_0x2b2f('0x12'))('api');var utils=require(_0x2b2f('0x13'));var config=require(_0x2b2f('0x14'));var db=require(_0x2b2f('0x15'))['db'];function respondWithStatusCode(_0x51a809,_0x33fb3d){_0x33fb3d=_0x33fb3d||0xcc;return function(_0x4b6c84){if(_0x4b6c84){return _0x51a809['sendStatus'](_0x33fb3d);}return _0x51a809[_0x2b2f('0x16')](_0x33fb3d)[_0x2b2f('0x17')]();};}function respondWithResult(_0x38c817,_0x564148){_0x564148=_0x564148||0xc8;return function(_0x518445){if(_0x518445){return _0x38c817['status'](_0x564148)[_0x2b2f('0x18')](_0x518445);}};}function respondWithFilteredResult(_0x451f3d,_0x29b808){return function(_0x1bdf19){if(_0x1bdf19){var _0x5296b4=_0x1bdf19[_0x2b2f('0x19')],_0x4ccb50=_0x29b808[_0x2b2f('0x1a')],_0x45d377=_0x29b808[_0x2b2f('0x1a')]+_0x29b808[_0x2b2f('0x1b')],_0x4541ac;if(_0x45d377>=_0x5296b4){_0x45d377=_0x5296b4;_0x4541ac=0xc8;}else{_0x4541ac=0xce;}_0x451f3d[_0x2b2f('0x16')](_0x4541ac);return _0x451f3d[_0x2b2f('0x1c')](_0x2b2f('0x1d'),_0x4ccb50+'-'+_0x45d377+'/'+_0x5296b4)['json'](_0x1bdf19);}return null;};}function patchUpdates(_0x3db016){return function(_0x5472e0){try{jsonpatch[_0x2b2f('0x1e')](_0x5472e0,_0x3db016,!![]);}catch(_0x3b0eb7){return BPromise[_0x2b2f('0x1f')](_0x3b0eb7);}return _0x5472e0['save']();};}function saveUpdates(_0x5ac1a4,_0xc7bd58){return function(_0x1dc1f3){if(_0x1dc1f3){return _0x1dc1f3['update'](_0x5ac1a4)[_0x2b2f('0x20')](function(_0x3cb00e){return _0x3cb00e;});}return null;};}function removeEntity(_0x4efcff,_0x502a18){return function(_0x4eb6cd){if(_0x4eb6cd){return _0x4eb6cd[_0x2b2f('0x21')]()[_0x2b2f('0x20')](function(){var _0x1fc7db=_0x4eb6cd['get']({'plain':!![]});var _0x11af65=_0x2b2f('0x22');return db[_0x2b2f('0x23')]['destroy']({'where':{'type':_0x11af65,'resourceId':_0x1fc7db['id']}})[_0x2b2f('0x20')](function(){return _0x4eb6cd;});})['then'](function(){_0x4efcff[_0x2b2f('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x12a729,_0x14d39f){return function(_0x36ef09){if(!_0x36ef09){_0x12a729[_0x2b2f('0x24')](0x194);}return _0x36ef09;};}function handleError(_0x25b65c,_0x339a20){_0x339a20=_0x339a20||0x1f4;return function(_0x38f280){logger['error'](_0x38f280['stack']);if(_0x38f280[_0x2b2f('0x25')]){delete _0x38f280[_0x2b2f('0x25')];}_0x25b65c[_0x2b2f('0x16')](_0x339a20)[_0x2b2f('0x26')](_0x38f280);};}exports[_0x2b2f('0x27')]=function(_0x5b2c58,_0xc93e19){var _0x162ff6={},_0x169afb={},_0x46a70c={'count':0x0,'rows':[]};var _0x3224f2=db[_0x2b2f('0x28')][_0x2b2f('0x29')];_0x169afb[_0x2b2f('0x2a')]=_['keys'](_0x3224f2);_0x169afb[_0x2b2f('0x2b')]=_[_0x2b2f('0x2c')](_0x5b2c58['query']);_0x169afb[_0x2b2f('0x2d')]=_[_0x2b2f('0x2e')](_0x169afb['model'],_0x169afb['query']);_0x162ff6[_0x2b2f('0x2f')]=_[_0x2b2f('0x2e')](_0x169afb[_0x2b2f('0x2a')],qs['fields'](_0x5b2c58[_0x2b2f('0x2b')][_0x2b2f('0x30')]));_0x162ff6[_0x2b2f('0x2f')]=_0x162ff6[_0x2b2f('0x2f')][_0x2b2f('0x31')]?_0x162ff6[_0x2b2f('0x2f')]:_0x169afb[_0x2b2f('0x2a')];if(!_0x5b2c58[_0x2b2f('0x2b')][_0x2b2f('0x32')](_0x2b2f('0x33'))){_0x162ff6[_0x2b2f('0x1b')]=qs[_0x2b2f('0x1b')](_0x5b2c58[_0x2b2f('0x2b')][_0x2b2f('0x1b')]);_0x162ff6[_0x2b2f('0x1a')]=qs[_0x2b2f('0x1a')](_0x5b2c58[_0x2b2f('0x2b')][_0x2b2f('0x1a')]);}_0x162ff6[_0x2b2f('0x34')]=qs[_0x2b2f('0x35')](_0x5b2c58['query']['sort']);_0x162ff6[_0x2b2f('0x36')]=qs['filters'](_[_0x2b2f('0x37')](_0x5b2c58[_0x2b2f('0x2b')],_0x169afb['filters']));if(_0x5b2c58[_0x2b2f('0x2b')][_0x2b2f('0x38')]){_0x162ff6['where']=_[_0x2b2f('0x39')](_0x162ff6[_0x2b2f('0x36')],{'$or':_[_0x2b2f('0x3a')](_0x3224f2,function(_0xc31410){if(_0xc31410['type']['key']!=='VIRTUAL'){var _0x1dcc6a={};_0x1dcc6a[_0xc31410['field']]={'$like':'%'+_0x5b2c58[_0x2b2f('0x2b')][_0x2b2f('0x38')]+'%'};return _0x1dcc6a;}})});}_0x162ff6=_[_0x2b2f('0x39')]({},_0x162ff6,_0x5b2c58[_0x2b2f('0x3b')]);var _0xf61c5={'where':_0x162ff6[_0x2b2f('0x36')]};return db[_0x2b2f('0x28')][_0x2b2f('0x19')](_0xf61c5)['then'](function(_0x3e01ac){_0x46a70c[_0x2b2f('0x19')]=_0x3e01ac;if(_0x5b2c58[_0x2b2f('0x2b')][_0x2b2f('0x3c')]){_0x162ff6[_0x2b2f('0x3d')]=[{'all':!![]}];}return db[_0x2b2f('0x28')][_0x2b2f('0x3e')](_0x162ff6);})[_0x2b2f('0x20')](function(_0x1293b9){_0x46a70c['rows']=_0x1293b9;return _0x46a70c;})[_0x2b2f('0x20')](respondWithFilteredResult(_0xc93e19,_0x162ff6))[_0x2b2f('0x3f')](handleError(_0xc93e19,null));};exports[_0x2b2f('0x40')]=function(_0x21b364,_0xd8ba3){var _0x308db2={'raw':![],'where':{'id':_0x21b364['params']['id']}},_0x44b391={};_0x44b391[_0x2b2f('0x2a')]=_[_0x2b2f('0x2c')](db[_0x2b2f('0x28')][_0x2b2f('0x29')]);_0x44b391['query']=_[_0x2b2f('0x2c')](_0x21b364['query']);_0x44b391[_0x2b2f('0x2d')]=_['intersection'](_0x44b391[_0x2b2f('0x2a')],_0x44b391[_0x2b2f('0x2b')]);_0x308db2[_0x2b2f('0x2f')]=_[_0x2b2f('0x2e')](_0x44b391[_0x2b2f('0x2a')],qs[_0x2b2f('0x30')](_0x21b364[_0x2b2f('0x2b')][_0x2b2f('0x30')]));_0x308db2[_0x2b2f('0x2f')]=_0x308db2[_0x2b2f('0x2f')][_0x2b2f('0x31')]?_0x308db2[_0x2b2f('0x2f')]:_0x44b391[_0x2b2f('0x2a')];if(_0x21b364[_0x2b2f('0x2b')][_0x2b2f('0x3c')]){_0x308db2['include']=[{'all':!![]}];}_0x308db2=_[_0x2b2f('0x39')]({},_0x308db2,_0x21b364[_0x2b2f('0x3b')]);return db['Trigger']['find'](_0x308db2)[_0x2b2f('0x20')](handleEntityNotFound(_0xd8ba3,null))[_0x2b2f('0x20')](respondWithResult(_0xd8ba3,null))[_0x2b2f('0x3f')](handleError(_0xd8ba3,null));};exports[_0x2b2f('0x41')]=function(_0x4747cf,_0x455cd2){return db[_0x2b2f('0x28')]['create'](_0x4747cf[_0x2b2f('0x42')],{})[_0x2b2f('0x20')](function(_0x5c1925){var _0x5f0d49=_0x4747cf[_0x2b2f('0x43')]['get']({'plain':!![]});if(!_0x5f0d49)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5f0d49[_0x2b2f('0x44')]==='user'){var _0x559c53=_0x5c1925[_0x2b2f('0x45')]({'plain':!![]});var _0x9e0d62='Triggers';return db[_0x2b2f('0x46')][_0x2b2f('0x47')]({'where':{'name':_0x9e0d62,'userProfileId':_0x5f0d49[_0x2b2f('0x48')]},'raw':!![]})[_0x2b2f('0x20')](function(_0x31dd67){if(_0x31dd67&&_0x31dd67['autoAssociation']===0x0){return db[_0x2b2f('0x23')]['create']({'name':_0x559c53[_0x2b2f('0x25')],'resourceId':_0x559c53['id'],'type':_0x31dd67[_0x2b2f('0x25')],'sectionId':_0x31dd67['id']},{})['then'](function(){return _0x5c1925;});}else{return _0x5c1925;}})[_0x2b2f('0x3f')](function(_0x422eef){logger[_0x2b2f('0x49')](_0x2b2f('0x4a'),_0x422eef);throw _0x422eef;});}return _0x5c1925;})[_0x2b2f('0x20')](respondWithResult(_0x455cd2,0xc9))[_0x2b2f('0x3f')](handleError(_0x455cd2,null));};exports[_0x2b2f('0x4b')]=function(_0x68327c,_0x205d42){if(_0x68327c['body']['id']){delete _0x68327c[_0x2b2f('0x42')]['id'];}return db[_0x2b2f('0x28')]['find']({'where':{'id':_0x68327c[_0x2b2f('0x4c')]['id']}})[_0x2b2f('0x20')](handleEntityNotFound(_0x205d42,null))[_0x2b2f('0x20')](saveUpdates(_0x68327c[_0x2b2f('0x42')],null))['then'](respondWithResult(_0x205d42,null))['catch'](handleError(_0x205d42,null));};exports[_0x2b2f('0x21')]=function(_0x807be7,_0x396b88){return db['Trigger']['find']({'where':{'id':_0x807be7[_0x2b2f('0x4c')]['id']}})[_0x2b2f('0x20')](handleEntityNotFound(_0x396b88,null))[_0x2b2f('0x20')](removeEntity(_0x396b88,null))['catch'](handleError(_0x396b88,null));};exports[_0x2b2f('0x4d')]=function(_0x499d26,_0x39d389,_0x4d9d41){if(_0x499d26[_0x2b2f('0x42')]['id']){delete _0x499d26[_0x2b2f('0x42')]['id'];}return db[_0x2b2f('0x28')]['find']({'where':{'id':_0x499d26[_0x2b2f('0x4c')]['id']}})[_0x2b2f('0x20')](handleEntityNotFound(_0x39d389,null))[_0x2b2f('0x20')](function(_0x533904){if(_0x533904){_0x499d26[_0x2b2f('0x42')][_0x2b2f('0x4e')]=_0x533904['id'];return db['Condition'][_0x2b2f('0x41')](_0x499d26[_0x2b2f('0x42')]);}})[_0x2b2f('0x20')](respondWithResult(_0x39d389,null))[_0x2b2f('0x3f')](handleError(_0x39d389,null));};exports[_0x2b2f('0x4f')]=function(_0x15cb8c,_0x500907,_0x42d036){if(_0x15cb8c[_0x2b2f('0x42')]['id']){delete _0x15cb8c[_0x2b2f('0x42')]['id'];}return db[_0x2b2f('0x28')][_0x2b2f('0x47')]({'where':{'id':_0x15cb8c['params']['id']}})[_0x2b2f('0x20')](handleEntityNotFound(_0x500907,null))[_0x2b2f('0x20')](function(_0x54ffe6){if(_0x54ffe6){_0x15cb8c[_0x2b2f('0x42')][_0x2b2f('0x50')]=_0x54ffe6['id'];return db['Condition']['create'](_0x15cb8c['body']);}})[_0x2b2f('0x20')](respondWithResult(_0x500907,null))['catch'](handleError(_0x500907,null));};exports['getAllConditions']=function(_0x44af97,_0x53a967,_0x4099bb){var _0x1c9cfc={};var _0x5d5b95={};var _0x4bd12a;var _0x42edbc;return db[_0x2b2f('0x28')]['findOne']({'where':{'id':_0x44af97[_0x2b2f('0x4c')]['id']}})['then'](handleEntityNotFound(_0x53a967,null))[_0x2b2f('0x20')](function(_0x27169e){if(_0x27169e){_0x4bd12a=_0x27169e;_0x5d5b95[_0x2b2f('0x2a')]=_[_0x2b2f('0x2c')](db[_0x2b2f('0x51')][_0x2b2f('0x29')]);_0x5d5b95[_0x2b2f('0x2b')]=_[_0x2b2f('0x2c')](_0x44af97['query']);_0x5d5b95[_0x2b2f('0x2d')]=_[_0x2b2f('0x2e')](_0x5d5b95[_0x2b2f('0x2a')],_0x5d5b95[_0x2b2f('0x2b')]);_0x1c9cfc['attributes']=_[_0x2b2f('0x2e')](_0x5d5b95[_0x2b2f('0x2a')],qs[_0x2b2f('0x30')](_0x44af97['query']['fields']));_0x1c9cfc[_0x2b2f('0x2f')]=_0x1c9cfc[_0x2b2f('0x2f')][_0x2b2f('0x31')]?_0x1c9cfc['attributes']:_0x5d5b95['model'];_0x1c9cfc[_0x2b2f('0x34')]=qs[_0x2b2f('0x35')](_0x44af97[_0x2b2f('0x2b')][_0x2b2f('0x35')]);_0x1c9cfc[_0x2b2f('0x36')]=qs['filters'](_[_0x2b2f('0x37')](_0x44af97[_0x2b2f('0x2b')],_0x5d5b95[_0x2b2f('0x2d')]));if(_0x44af97['query']['filter']){_0x1c9cfc[_0x2b2f('0x36')]=_[_0x2b2f('0x39')](_0x1c9cfc['where'],{'$or':_[_0x2b2f('0x3a')](_0x1c9cfc[_0x2b2f('0x2f')],function(_0x5c7d89){var _0x344c7c={};_0x344c7c[_0x5c7d89]={'$like':'%'+_0x44af97[_0x2b2f('0x2b')][_0x2b2f('0x38')]+'%'};return _0x344c7c;})});}_0x1c9cfc=_[_0x2b2f('0x39')]({},_0x1c9cfc,_0x44af97[_0x2b2f('0x3b')]);return _0x4bd12a[_0x2b2f('0x52')](_0x1c9cfc);}})[_0x2b2f('0x20')](function(_0x49d2a7){if(_0x49d2a7){_0x42edbc=_0x49d2a7[_0x2b2f('0x31')];if(!_0x44af97[_0x2b2f('0x2b')][_0x2b2f('0x32')]('nolimit')){_0x1c9cfc[_0x2b2f('0x1b')]=qs['limit'](_0x44af97[_0x2b2f('0x2b')][_0x2b2f('0x1b')]);_0x1c9cfc[_0x2b2f('0x1a')]=qs[_0x2b2f('0x1a')](_0x44af97[_0x2b2f('0x2b')][_0x2b2f('0x1a')]);}return _0x4bd12a['getAllConditions'](_0x1c9cfc);}})[_0x2b2f('0x20')](function(_0xa07e28){if(_0xa07e28){return _0xa07e28?{'count':_0x42edbc,'rows':_0xa07e28}:null;}})[_0x2b2f('0x20')](respondWithResult(_0x53a967,null))[_0x2b2f('0x3f')](handleError(_0x53a967,null));};exports['getAnyConditions']=function(_0x185dda,_0x2f1b28,_0x3b5193){var _0xb7e3b9={};var _0x418bf9={};var _0xe4ed2b;var _0x3c6d81;return db[_0x2b2f('0x28')]['findOne']({'where':{'id':_0x185dda[_0x2b2f('0x4c')]['id']}})[_0x2b2f('0x20')](handleEntityNotFound(_0x2f1b28,null))['then'](function(_0x49c4a1){if(_0x49c4a1){_0xe4ed2b=_0x49c4a1;_0x418bf9[_0x2b2f('0x2a')]=_[_0x2b2f('0x2c')](db['Condition'][_0x2b2f('0x29')]);_0x418bf9[_0x2b2f('0x2b')]=_['keys'](_0x185dda[_0x2b2f('0x2b')]);_0x418bf9['filters']=_[_0x2b2f('0x2e')](_0x418bf9[_0x2b2f('0x2a')],_0x418bf9['query']);_0xb7e3b9['attributes']=_[_0x2b2f('0x2e')](_0x418bf9[_0x2b2f('0x2a')],qs['fields'](_0x185dda[_0x2b2f('0x2b')][_0x2b2f('0x30')]));_0xb7e3b9[_0x2b2f('0x2f')]=_0xb7e3b9[_0x2b2f('0x2f')]['length']?_0xb7e3b9[_0x2b2f('0x2f')]:_0x418bf9['model'];_0xb7e3b9[_0x2b2f('0x34')]=qs['sort'](_0x185dda[_0x2b2f('0x2b')][_0x2b2f('0x35')]);_0xb7e3b9[_0x2b2f('0x36')]=qs['filters'](_[_0x2b2f('0x37')](_0x185dda[_0x2b2f('0x2b')],_0x418bf9[_0x2b2f('0x2d')]));if(_0x185dda[_0x2b2f('0x2b')][_0x2b2f('0x38')]){_0xb7e3b9[_0x2b2f('0x36')]=_['merge'](_0xb7e3b9['where'],{'$or':_[_0x2b2f('0x3a')](_0xb7e3b9[_0x2b2f('0x2f')],function(_0x5d9762){var _0x1a253c={};_0x1a253c[_0x5d9762]={'$like':'%'+_0x185dda['query'][_0x2b2f('0x38')]+'%'};return _0x1a253c;})});}_0xb7e3b9=_[_0x2b2f('0x39')]({},_0xb7e3b9,_0x185dda[_0x2b2f('0x3b')]);return _0xe4ed2b[_0x2b2f('0x53')](_0xb7e3b9);}})['then'](function(_0x1b427f){if(_0x1b427f){_0x3c6d81=_0x1b427f[_0x2b2f('0x31')];if(!_0x185dda[_0x2b2f('0x2b')][_0x2b2f('0x32')](_0x2b2f('0x33'))){_0xb7e3b9[_0x2b2f('0x1b')]=qs['limit'](_0x185dda['query'][_0x2b2f('0x1b')]);_0xb7e3b9[_0x2b2f('0x1a')]=qs[_0x2b2f('0x1a')](_0x185dda[_0x2b2f('0x2b')][_0x2b2f('0x1a')]);}return _0xe4ed2b[_0x2b2f('0x53')](_0xb7e3b9);}})[_0x2b2f('0x20')](function(_0x2e853e){if(_0x2e853e){return _0x2e853e?{'count':_0x3c6d81,'rows':_0x2e853e}:null;}})[_0x2b2f('0x20')](respondWithResult(_0x2f1b28,null))['catch'](handleError(_0x2f1b28,null));};exports[_0x2b2f('0x54')]=function(_0x3d63b0,_0x158a18,_0x5da91e){if(_0x3d63b0[_0x2b2f('0x42')]['id']){delete _0x3d63b0[_0x2b2f('0x42')]['id'];}return db['Trigger'][_0x2b2f('0x47')]({'where':{'id':_0x3d63b0[_0x2b2f('0x4c')]['id']}})[_0x2b2f('0x20')](handleEntityNotFound(_0x158a18,null))['then'](function(_0x161fd1){if(_0x161fd1){_0x3d63b0[_0x2b2f('0x42')][_0x2b2f('0x55')]=_0x161fd1['id'];return db[_0x2b2f('0x56')][_0x2b2f('0x41')](_0x3d63b0[_0x2b2f('0x42')]);}})[_0x2b2f('0x20')](respondWithResult(_0x158a18,null))[_0x2b2f('0x3f')](handleError(_0x158a18,null));};exports[_0x2b2f('0x57')]=function(_0x2db548,_0x40a6d8,_0x5612dc){var _0x3bac89={};var _0x2a86b2={};var _0x22fc48;var _0x123a8a;return db[_0x2b2f('0x28')]['findOne']({'where':{'id':_0x2db548['params']['id']}})['then'](handleEntityNotFound(_0x40a6d8,null))['then'](function(_0x20a37a){if(_0x20a37a){_0x22fc48=_0x20a37a;_0x2a86b2['model']=_[_0x2b2f('0x2c')](db[_0x2b2f('0x56')]['rawAttributes']);_0x2a86b2[_0x2b2f('0x2b')]=_[_0x2b2f('0x2c')](_0x2db548[_0x2b2f('0x2b')]);_0x2a86b2[_0x2b2f('0x2d')]=_[_0x2b2f('0x2e')](_0x2a86b2['model'],_0x2a86b2[_0x2b2f('0x2b')]);_0x3bac89[_0x2b2f('0x2f')]=_[_0x2b2f('0x2e')](_0x2a86b2['model'],qs[_0x2b2f('0x30')](_0x2db548[_0x2b2f('0x2b')][_0x2b2f('0x30')]));_0x3bac89[_0x2b2f('0x2f')]=_0x3bac89['attributes'][_0x2b2f('0x31')]?_0x3bac89[_0x2b2f('0x2f')]:_0x2a86b2[_0x2b2f('0x2a')];_0x3bac89[_0x2b2f('0x34')]=qs[_0x2b2f('0x35')](_0x2db548[_0x2b2f('0x2b')][_0x2b2f('0x35')]);_0x3bac89[_0x2b2f('0x36')]=qs[_0x2b2f('0x2d')](_[_0x2b2f('0x37')](_0x2db548[_0x2b2f('0x2b')],_0x2a86b2[_0x2b2f('0x2d')]));if(_0x2db548['query'][_0x2b2f('0x38')]){_0x3bac89['where']=_['merge'](_0x3bac89[_0x2b2f('0x36')],{'$or':_[_0x2b2f('0x3a')](_0x3bac89[_0x2b2f('0x2f')],function(_0x22c79e){var _0x3977d4={};_0x3977d4[_0x22c79e]={'$like':'%'+_0x2db548[_0x2b2f('0x2b')][_0x2b2f('0x38')]+'%'};return _0x3977d4;})});}_0x3bac89=_['merge']({},_0x3bac89,_0x2db548[_0x2b2f('0x3b')]);return _0x22fc48[_0x2b2f('0x57')](_0x3bac89);}})[_0x2b2f('0x20')](function(_0x46e22e){if(_0x46e22e){_0x123a8a=_0x46e22e[_0x2b2f('0x31')];if(!_0x2db548[_0x2b2f('0x2b')]['hasOwnProperty'](_0x2b2f('0x33'))){_0x3bac89[_0x2b2f('0x1b')]=qs[_0x2b2f('0x1b')](_0x2db548[_0x2b2f('0x2b')][_0x2b2f('0x1b')]);_0x3bac89[_0x2b2f('0x1a')]=qs[_0x2b2f('0x1a')](_0x2db548[_0x2b2f('0x2b')][_0x2b2f('0x1a')]);}return _0x22fc48[_0x2b2f('0x57')](_0x3bac89);}})[_0x2b2f('0x20')](function(_0x34d73b){if(_0x34d73b){return _0x34d73b?{'count':_0x123a8a,'rows':_0x34d73b}:null;}})[_0x2b2f('0x20')](respondWithResult(_0x40a6d8,null))['catch'](handleError(_0x40a6d8,null));}; \ No newline at end of file diff --git a/server/api/trigger/trigger.model.js b/server/api/trigger/trigger.model.js index ad44c24..c802fc4 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 _0x7567=['./trigger.attributes','exports','define','Trigger','tools_triggers','lodash','util','moment','bluebird','rimraf','../../config/environment'];(function(_0x2b0f81,_0x3917f0){var _0x5ce74c=function(_0x12dc0d){while(--_0x12dc0d){_0x2b0f81['push'](_0x2b0f81['shift']());}};_0x5ce74c(++_0x3917f0);}(_0x7567,0x1c8));var _0x7756=function(_0x22df96,_0x2fe8b3){_0x22df96=_0x22df96-0x0;var _0x2936cb=_0x7567[_0x22df96];return _0x2936cb;};'use strict';var _=require(_0x7756('0x0'));var util=require(_0x7756('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x7756('0x2'));var BPromise=require(_0x7756('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x7756('0x4'));var config=require(_0x7756('0x5'));var attributes=require(_0x7756('0x6'));module[_0x7756('0x7')]=function(_0x25930b,_0x5e4b6c){return _0x25930b[_0x7756('0x8')](_0x7756('0x9'),attributes,{'tableName':_0x7756('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x804f=['./trigger.attributes','exports','Trigger','tools_triggers','lodash','util','request-promise','path','rimraf','../../config/environment'];(function(_0x4ff616,_0x5c7dad){var _0x548bdb=function(_0x592573){while(--_0x592573){_0x4ff616['push'](_0x4ff616['shift']());}};_0x548bdb(++_0x5c7dad);}(_0x804f,0x180));var _0xf804=function(_0x2ee4e9,_0x3f1cec){_0x2ee4e9=_0x2ee4e9-0x0;var _0x1f2d9b=_0x804f[_0x2ee4e9];return _0x1f2d9b;};'use strict';var _=require(_0xf804('0x0'));var util=require(_0xf804('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xf804('0x2'));var fs=require('fs');var path=require(_0xf804('0x3'));var rimraf=require(_0xf804('0x4'));var config=require(_0xf804('0x5'));var attributes=require(_0xf804('0x6'));module[_0xf804('0x7')]=function(_0xa9bfb2,_0xf3a3ce){return _0xa9bfb2['define'](_0xf804('0x8'),attributes,{'tableName':_0xf804('0x9'),'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 dc3aca8..514cbb3 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 _0x2032=['error','code','message','info','result','catch','GetTrigger','Trigger','options','raw','where','map','model','attributes','include','stringify','ShowTrigger','find','then','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','Trigger,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x14b4a0,_0x23ccc3){var _0x22be64=function(_0x16f1a8){while(--_0x16f1a8){_0x14b4a0['push'](_0x14b4a0['shift']());}};_0x22be64(++_0x23ccc3);}(_0x2032,0xd9));var _0x2203=function(_0x435446,_0x24f399){_0x435446=_0x435446-0x0;var _0x402109=_0x2032[_0x435446];return _0x402109;};'use strict';var _=require('lodash');var util=require(_0x2203('0x0'));var moment=require(_0x2203('0x1'));var BPromise=require(_0x2203('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2203('0x3'));var db=require(_0x2203('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x2203('0x5'))(_0x2203('0x6'));var config=require(_0x2203('0x7'));var jayson=require(_0x2203('0x8'));var client=jayson[_0x2203('0x9')][_0x2203('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2e0f63,_0x2676aa,_0x18c4d6){return new BPromise(function(_0x2049ff,_0x2999ed){return client['request'](_0x2e0f63,_0x18c4d6)['then'](function(_0x10f055){logger['info'](_0x2203('0xb'),_0x2676aa,_0x2203('0xc'));logger[_0x2203('0xd')]('Trigger,\x20%s,\x20%s,\x20%s',_0x2676aa,_0x2203('0xc'),JSON['stringify'](_0x10f055));if(_0x10f055[_0x2203('0xe')]){if(_0x10f055['error'][_0x2203('0xf')]===0x1f4){logger[_0x2203('0xe')]('Trigger,\x20%s,\x20%s',_0x2676aa,_0x10f055['error']['message']);return _0x2999ed(_0x10f055['error']['message']);}logger[_0x2203('0xe')]('Trigger,\x20%s,\x20%s',_0x2676aa,_0x10f055['error'][_0x2203('0x10')]);return _0x2049ff(_0x10f055[_0x2203('0xe')][_0x2203('0x10')]);}else{logger[_0x2203('0x11')](_0x2203('0xb'),_0x2676aa,_0x2203('0xc'));_0x2049ff(_0x10f055[_0x2203('0x12')][_0x2203('0x10')]);}})[_0x2203('0x13')](function(_0x3053f3){logger['error'](_0x2203('0xb'),_0x2676aa,_0x3053f3);_0x2999ed(_0x3053f3);});});}exports[_0x2203('0x14')]=function(_0x4893ff){var _0x3f9ef6=this;return new Promise(function(_0x8906e1,_0x4aeb9f){return db[_0x2203('0x15')]['findAll']({'raw':_0x4893ff[_0x2203('0x16')]?_0x4893ff[_0x2203('0x16')][_0x2203('0x17')]===undefined?!![]:![]:!![],'where':_0x4893ff[_0x2203('0x16')]?_0x4893ff[_0x2203('0x16')][_0x2203('0x18')]||null:null,'attributes':_0x4893ff['options']?_0x4893ff[_0x2203('0x16')]['attributes']||null:null,'limit':_0x4893ff['options']?_0x4893ff[_0x2203('0x16')]['limit']||null:null,'include':_0x4893ff[_0x2203('0x16')]?_0x4893ff[_0x2203('0x16')]['include']?_[_0x2203('0x19')](_0x4893ff['options']['include'],function(_0x226374){return{'model':db[_0x226374[_0x2203('0x1a')]],'as':_0x226374['as'],'attributes':_0x226374[_0x2203('0x1b')],'include':_0x226374[_0x2203('0x1c')]?_[_0x2203('0x19')](_0x226374[_0x2203('0x1c')],function(_0x49c12){return{'model':db[_0x49c12[_0x2203('0x1a')]],'as':_0x49c12['as'],'attributes':_0x49c12['attributes'],'include':_0x49c12[_0x2203('0x1c')]?_[_0x2203('0x19')](_0x49c12[_0x2203('0x1c')],function(_0x5f11bf){return{'model':db[_0x5f11bf[_0x2203('0x1a')]],'as':_0x5f11bf['as'],'attributes':_0x5f11bf[_0x2203('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xd6e109){logger[_0x2203('0x11')](_0x2203('0x14'),_0x4893ff);logger[_0x2203('0xd')](_0x2203('0x14'),_0x4893ff,JSON[_0x2203('0x1d')](_0xd6e109));_0x8906e1(_0xd6e109);})[_0x2203('0x13')](function(_0x5a95c1){logger[_0x2203('0xe')](_0x2203('0x14'),_0x5a95c1[_0x2203('0x10')],_0x4893ff);_0x4aeb9f(_0x3f9ef6[_0x2203('0xe')](0x1f4,_0x5a95c1['message']));});});};exports[_0x2203('0x1e')]=function(_0x21ff0d){var _0x287c95=this;return new Promise(function(_0xf59954,_0x520602){return db[_0x2203('0x15')][_0x2203('0x1f')]({'raw':_0x21ff0d['options']?_0x21ff0d['options'][_0x2203('0x17')]===undefined?!![]:![]:!![],'where':_0x21ff0d['options']?_0x21ff0d['options'][_0x2203('0x18')]||null:null,'attributes':_0x21ff0d[_0x2203('0x16')]?_0x21ff0d[_0x2203('0x16')][_0x2203('0x1b')]||null:null,'include':_0x21ff0d[_0x2203('0x16')]?_0x21ff0d['options'][_0x2203('0x1c')]?_[_0x2203('0x19')](_0x21ff0d['options'][_0x2203('0x1c')],function(_0x20fbe1){return{'model':db[_0x20fbe1[_0x2203('0x1a')]],'as':_0x20fbe1['as'],'attributes':_0x20fbe1[_0x2203('0x1b')],'include':_0x20fbe1[_0x2203('0x1c')]?_[_0x2203('0x19')](_0x20fbe1[_0x2203('0x1c')],function(_0x44228e){return{'model':db[_0x44228e[_0x2203('0x1a')]],'as':_0x44228e['as'],'attributes':_0x44228e['attributes'],'include':_0x44228e[_0x2203('0x1c')]?_[_0x2203('0x19')](_0x44228e['include'],function(_0x54b90b){return{'model':db[_0x54b90b[_0x2203('0x1a')]],'as':_0x54b90b['as'],'attributes':_0x54b90b['attributes']};}):[]};}):[]};}):[]:[]})[_0x2203('0x20')](function(_0x3b1eeb){logger[_0x2203('0x11')]('ShowTrigger',_0x21ff0d);logger['debug'](_0x2203('0x1e'),_0x21ff0d,JSON['stringify'](_0x3b1eeb));_0xf59954(_0x3b1eeb);})[_0x2203('0x13')](function(_0x5cfe5e){logger[_0x2203('0xe')]('ShowTrigger',_0x5cfe5e[_0x2203('0x10')],_0x21ff0d);_0x520602(_0x287c95[_0x2203('0xe')](0x1f4,_0x5cfe5e[_0x2203('0x10')]));});});}; \ No newline at end of file +var _0x0b0e=['model','GetTrigger','Trigger','find','where','include','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Trigger,\x20%s,\x20%s','debug','Trigger,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','catch','findAll','raw','options','attributes','map'];(function(_0x2fd0fb,_0x63155a){var _0x4515f2=function(_0x33556d){while(--_0x33556d){_0x2fd0fb['push'](_0x2fd0fb['shift']());}};_0x4515f2(++_0x63155a);}(_0x0b0e,0x187));var _0xe0b0=function(_0x12d951,_0x249808){_0x12d951=_0x12d951-0x0;var _0x44de17=_0x0b0e[_0x12d951];return _0x44de17;};'use strict';var _=require(_0xe0b0('0x0'));var util=require('util');var moment=require(_0xe0b0('0x1'));var BPromise=require('bluebird');var rs=require(_0xe0b0('0x2'));var fs=require('fs');var Redis=require(_0xe0b0('0x3'));var db=require(_0xe0b0('0x4'))['db'];var utils=require(_0xe0b0('0x5'));var logger=require(_0xe0b0('0x6'))(_0xe0b0('0x7'));var config=require(_0xe0b0('0x8'));var jayson=require(_0xe0b0('0x9'));var client=jayson[_0xe0b0('0xa')][_0xe0b0('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x219b1c,_0x5cf9cc,_0x50be7f){return new BPromise(function(_0x11effc,_0x435060){return client[_0xe0b0('0xc')](_0x219b1c,_0x50be7f)[_0xe0b0('0xd')](function(_0x4c24f9){logger[_0xe0b0('0xe')](_0xe0b0('0xf'),_0x5cf9cc,'request\x20sent');logger[_0xe0b0('0x10')](_0xe0b0('0x11'),_0x5cf9cc,'request\x20sent',JSON[_0xe0b0('0x12')](_0x4c24f9));if(_0x4c24f9[_0xe0b0('0x13')]){if(_0x4c24f9[_0xe0b0('0x13')]['code']===0x1f4){logger[_0xe0b0('0x13')](_0xe0b0('0xf'),_0x5cf9cc,_0x4c24f9[_0xe0b0('0x13')][_0xe0b0('0x14')]);return _0x435060(_0x4c24f9[_0xe0b0('0x13')]['message']);}logger[_0xe0b0('0x13')](_0xe0b0('0xf'),_0x5cf9cc,_0x4c24f9[_0xe0b0('0x13')][_0xe0b0('0x14')]);return _0x11effc(_0x4c24f9[_0xe0b0('0x13')]['message']);}else{logger[_0xe0b0('0xe')]('Trigger,\x20%s,\x20%s',_0x5cf9cc,_0xe0b0('0x15'));_0x11effc(_0x4c24f9[_0xe0b0('0x16')]['message']);}})[_0xe0b0('0x17')](function(_0x4a4cc0){logger[_0xe0b0('0x13')](_0xe0b0('0xf'),_0x5cf9cc,_0x4a4cc0);_0x435060(_0x4a4cc0);});});}exports['GetTrigger']=function(_0x54a3eb){var _0x46bb44=this;return new Promise(function(_0x50a441,_0x4df8da){return db['Trigger'][_0xe0b0('0x18')]({'raw':_0x54a3eb['options']?_0x54a3eb['options'][_0xe0b0('0x19')]===undefined?!![]:![]:!![],'where':_0x54a3eb['options']?_0x54a3eb[_0xe0b0('0x1a')]['where']||null:null,'attributes':_0x54a3eb[_0xe0b0('0x1a')]?_0x54a3eb[_0xe0b0('0x1a')][_0xe0b0('0x1b')]||null:null,'limit':_0x54a3eb[_0xe0b0('0x1a')]?_0x54a3eb[_0xe0b0('0x1a')]['limit']||null:null,'include':_0x54a3eb['options']?_0x54a3eb[_0xe0b0('0x1a')]['include']?_[_0xe0b0('0x1c')](_0x54a3eb[_0xe0b0('0x1a')]['include'],function(_0x170ad8){return{'model':db[_0x170ad8['model']],'as':_0x170ad8['as'],'attributes':_0x170ad8[_0xe0b0('0x1b')],'include':_0x170ad8['include']?_[_0xe0b0('0x1c')](_0x170ad8['include'],function(_0x3e5c88){return{'model':db[_0x3e5c88['model']],'as':_0x3e5c88['as'],'attributes':_0x3e5c88[_0xe0b0('0x1b')],'include':_0x3e5c88['include']?_[_0xe0b0('0x1c')](_0x3e5c88['include'],function(_0x362aba){return{'model':db[_0x362aba[_0xe0b0('0x1d')]],'as':_0x362aba['as'],'attributes':_0x362aba[_0xe0b0('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xe0b0('0xd')](function(_0x3ec2){logger[_0xe0b0('0xe')]('GetTrigger',_0x54a3eb);logger[_0xe0b0('0x10')](_0xe0b0('0x1e'),_0x54a3eb,JSON['stringify'](_0x3ec2));_0x50a441(_0x3ec2);})[_0xe0b0('0x17')](function(_0x419b1f){logger[_0xe0b0('0x13')](_0xe0b0('0x1e'),_0x419b1f[_0xe0b0('0x14')],_0x54a3eb);_0x4df8da(_0x46bb44[_0xe0b0('0x13')](0x1f4,_0x419b1f[_0xe0b0('0x14')]));});});};exports['ShowTrigger']=function(_0x1854b8){var _0x3c0109=this;return new Promise(function(_0x48a9b5,_0x4fe400){return db[_0xe0b0('0x1f')][_0xe0b0('0x20')]({'raw':_0x1854b8[_0xe0b0('0x1a')]?_0x1854b8[_0xe0b0('0x1a')][_0xe0b0('0x19')]===undefined?!![]:![]:!![],'where':_0x1854b8['options']?_0x1854b8[_0xe0b0('0x1a')][_0xe0b0('0x21')]||null:null,'attributes':_0x1854b8[_0xe0b0('0x1a')]?_0x1854b8[_0xe0b0('0x1a')][_0xe0b0('0x1b')]||null:null,'include':_0x1854b8['options']?_0x1854b8[_0xe0b0('0x1a')][_0xe0b0('0x22')]?_[_0xe0b0('0x1c')](_0x1854b8[_0xe0b0('0x1a')][_0xe0b0('0x22')],function(_0x12eeb8){return{'model':db[_0x12eeb8[_0xe0b0('0x1d')]],'as':_0x12eeb8['as'],'attributes':_0x12eeb8[_0xe0b0('0x1b')],'include':_0x12eeb8[_0xe0b0('0x22')]?_[_0xe0b0('0x1c')](_0x12eeb8[_0xe0b0('0x22')],function(_0x1a0c90){return{'model':db[_0x1a0c90[_0xe0b0('0x1d')]],'as':_0x1a0c90['as'],'attributes':_0x1a0c90[_0xe0b0('0x1b')],'include':_0x1a0c90[_0xe0b0('0x22')]?_['map'](_0x1a0c90[_0xe0b0('0x22')],function(_0x135be5){return{'model':db[_0x135be5[_0xe0b0('0x1d')]],'as':_0x135be5['as'],'attributes':_0x135be5[_0xe0b0('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xe0b0('0xd')](function(_0x2c6e60){logger[_0xe0b0('0xe')]('ShowTrigger',_0x1854b8);logger['debug']('ShowTrigger',_0x1854b8,JSON['stringify'](_0x2c6e60));_0x48a9b5(_0x2c6e60);})[_0xe0b0('0x17')](function(_0xc3d967){logger[_0xe0b0('0x13')]('ShowTrigger',_0xc3d967[_0xe0b0('0x14')],_0x1854b8);_0x4fe400(_0x3c0109[_0xe0b0('0x13')](0x1f4,_0xc3d967[_0xe0b0('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/trunk/index.js b/server/api/trunk/index.js index 5ece512..77176c6 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 _0xbd50=['show','clone','post','create','put','update','destroy','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','index','get','/:id','isAuthenticated'];(function(_0x143cc6,_0xf94536){var _0x2cedba=function(_0x15a2ad){while(--_0x15a2ad){_0x143cc6['push'](_0x143cc6['shift']());}};_0x2cedba(++_0xf94536);}(_0xbd50,0x196));var _0x0bd5=function(_0x1c4c17,_0x278a23){_0x1c4c17=_0x1c4c17-0x0;var _0x51e66b=_0xbd50[_0x1c4c17];return _0x51e66b;};'use strict';var multer=require(_0x0bd5('0x0'));var util=require(_0x0bd5('0x1'));var path=require(_0x0bd5('0x2'));var timeout=require('connect-timeout');var express=require(_0x0bd5('0x3'));var router=express[_0x0bd5('0x4')]();var auth=require(_0x0bd5('0x5'));var interaction=require(_0x0bd5('0x6'));var config=require(_0x0bd5('0x7'));var controller=require('./trunk.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x0bd5('0x8')]);router[_0x0bd5('0x9')](_0x0bd5('0xa'),auth[_0x0bd5('0xb')](),controller[_0x0bd5('0xc')]);router['post']('/:id/clone',auth[_0x0bd5('0xb')](),controller[_0x0bd5('0xd')]);router[_0x0bd5('0xe')]('/',auth['isAuthenticated'](),controller[_0x0bd5('0xf')]);router[_0x0bd5('0x10')]('/:id',auth[_0x0bd5('0xb')](),controller[_0x0bd5('0x11')]);router['delete'](_0x0bd5('0xa'),auth[_0x0bd5('0xb')](),controller[_0x0bd5('0x12')]);module['exports']=router; \ No newline at end of file +var _0xedd9=['get','isAuthenticated','index','post','/:id/clone','clone','put','/:id','update','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0xe02296,_0x93dfa6){var _0x31df57=function(_0x5a8f25){while(--_0x5a8f25){_0xe02296['push'](_0xe02296['shift']());}};_0x31df57(++_0x93dfa6);}(_0xedd9,0xfc));var _0x9edd=function(_0x49a9ec,_0x134aa7){_0x49a9ec=_0x49a9ec-0x0;var _0x4d8192=_0xedd9[_0x49a9ec];return _0x4d8192;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var auth=require(_0x9edd('0x5'));var interaction=require(_0x9edd('0x6'));var config=require(_0x9edd('0x7'));var controller=require('./trunk.controller');router[_0x9edd('0x8')]('/',auth[_0x9edd('0x9')](),controller[_0x9edd('0xa')]);router[_0x9edd('0x8')]('/:id',auth[_0x9edd('0x9')](),controller['show']);router[_0x9edd('0xb')](_0x9edd('0xc'),auth[_0x9edd('0x9')](),controller[_0x9edd('0xd')]);router['post']('/',auth[_0x9edd('0x9')](),controller['create']);router[_0x9edd('0xe')](_0x9edd('0xf'),auth['isAuthenticated'](),controller[_0x9edd('0x10')]);router[_0x9edd('0x11')]('/:id',auth[_0x9edd('0x9')](),controller[_0x9edd('0x12')]);module[_0x9edd('0x13')]=router; \ No newline at end of file diff --git a/server/api/trunk/trunk.attributes.js b/server/api/trunk/trunk.attributes.js index 64fecfa..2b52e02 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 _0xf79b=['update,nonat','BOOLEAN','name','user','peer','STRING','from-voip-provider','ENUM','ALLOWED_NOT_SCREENED','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB','udp','setDataValue','join','transport','getDataValue','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','shortinfo','inband','auto','yes','update','force_rport,comedia','nat','all','allow','ulaw;alaw;gsm','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','port,invite','insecure','never','INTEGER','\x22\x22\x20<>','accept','originate','uas','pai','fingerprint','certificate','active','passive','dynamic','nonat'];(function(_0x1e43b9,_0x36f67e){var _0x237bcc=function(_0x4de813){while(--_0x4de813){_0x1e43b9['push'](_0x1e43b9['shift']());}};_0x237bcc(++_0x36f67e);}(_0xf79b,0x11c));var _0xbf79=function(_0x103ccf,_0x3eec48){_0x103ccf=_0x103ccf-0x0;var _0x2d020a=_0xf79b[_0x103ccf];return _0x2d020a;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xbf79('0x0'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM']('friend',_0xbf79('0x1'),_0xbf79('0x2')),'allowNull':![],'defaultValue':'friend'},'context':{'type':Sequelize[_0xbf79('0x3')],'allowNull':![],'defaultValue':_0xbf79('0x4')},'callingpres':{'type':Sequelize[_0xbf79('0x5')](_0xbf79('0x6'),'ALLOWED_PASSED_SCREEN',_0xbf79('0x7'),_0xbf79('0x8'),_0xbf79('0x9'),'PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN',_0xbf79('0xa'))},'deny':{'type':Sequelize[_0xbf79('0x3')]},'permit':{'type':Sequelize['STRING']},'secret':{'type':Sequelize[_0xbf79('0x3')]},'md5secret':{'type':Sequelize[_0xbf79('0x3')]},'remotesecret':{'type':Sequelize[_0xbf79('0x3')]},'transport':{'type':Sequelize[_0xbf79('0x3')],'defaultValue':_0xbf79('0xb'),'set':function(_0x4be2c0){this[_0xbf79('0xc')]('transport',_0x4be2c0?_0x4be2c0[_0xbf79('0xd')](','):null);},'get':function(){return this['getDataValue'](_0xbf79('0xe'))?this[_0xbf79('0xf')]('transport')[_0xbf79('0x10')](','):null;},'comment':_0xbf79('0x11')},'dtmfmode':{'type':Sequelize[_0xbf79('0x5')](_0xbf79('0x12'),'info',_0xbf79('0x13'),_0xbf79('0x14'),_0xbf79('0x15')),'defaultValue':_0xbf79('0x12')},'directmedia':{'type':Sequelize[_0xbf79('0x5')](_0xbf79('0x16'),'no','nonat',_0xbf79('0x17'),'outgoing'),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0xbf79('0x5')](_0xbf79('0x16'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0xbf79('0x3')]},'directmediadeny':{'type':Sequelize['STRING']},'nat':{'type':Sequelize['STRING'],'defaultValue':_0xbf79('0x18'),'set':function(_0x1cfbfb){this[_0xbf79('0xc')](_0xbf79('0x19'),_0x1cfbfb?_0x1cfbfb[_0xbf79('0xd')](','):null);},'get':function(){return this[_0xbf79('0xf')](_0xbf79('0x19'))?this[_0xbf79('0xf')](_0xbf79('0x19'))['split'](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize[_0xbf79('0x3')]},'namedcallgroup':{'type':Sequelize[_0xbf79('0x3')]},'pickupgroup':{'type':Sequelize[_0xbf79('0x3')]},'namedpickupgroup':{'type':Sequelize[_0xbf79('0x3')]},'language':{'type':Sequelize[_0xbf79('0x3')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0xbf79('0x3')],'allowNull':!![]},'disallow':{'type':Sequelize[_0xbf79('0x3')],'defaultValue':_0xbf79('0x1a')},'allow':{'type':Sequelize[_0xbf79('0x3')],'allowNull':![],'defaultValue':'ulaw;alaw;gsm','set':function(_0xef01e7){this[_0xbf79('0xc')](_0xbf79('0x1b'),_0xef01e7?_0xef01e7['join'](';'):_0xbf79('0x1c'));},'get':function(){return this[_0xbf79('0xf')]('allow')?this[_0xbf79('0xf')](_0xbf79('0x1b'))[_0xbf79('0x10')](';'):null;},'comment':_0xbf79('0x1d')},'autoframing':{'type':Sequelize[_0xbf79('0x5')]('yes','no')},'insecure':{'type':Sequelize[_0xbf79('0x3')],'defaultValue':_0xbf79('0x1e'),'set':function(_0x596622){this[_0xbf79('0xc')](_0xbf79('0x1f'),_0x596622?_0x596622[_0xbf79('0xd')](','):null);},'get':function(){return this[_0xbf79('0xf')](_0xbf79('0x1f'))?this[_0xbf79('0xf')](_0xbf79('0x1f'))[_0xbf79('0x10')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize['ENUM'](_0xbf79('0x16'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0xbf79('0x5')]('yes','no'),'defaultValue':'no'},'progressinband':{'type':Sequelize['ENUM'](_0xbf79('0x16'),'no',_0xbf79('0x20'))},'promiscredir':{'type':Sequelize['ENUM'](_0xbf79('0x16'),'no')},'useclientcode':{'type':Sequelize[_0xbf79('0x5')](_0xbf79('0x16'),'no')},'accountcode':{'type':Sequelize[_0xbf79('0x21')](0xb)},'setvar':{'type':Sequelize[_0xbf79('0x3')]},'callerid':{'type':Sequelize[_0xbf79('0x3')],'defaultValue':_0xbf79('0x22')},'amaflags':{'type':Sequelize[_0xbf79('0x3')]},'callcounter':{'type':Sequelize[_0xbf79('0x5')](_0xbf79('0x16'),'no'),'defaultValue':_0xbf79('0x16')},'busylevel':{'type':Sequelize[_0xbf79('0x21')](0xb)},'allowoverlap':{'type':Sequelize['ENUM'](_0xbf79('0x16'),'no')},'allowsubscribe':{'type':Sequelize[_0xbf79('0x5')](_0xbf79('0x16'),'no')},'allowtransfer':{'type':Sequelize[_0xbf79('0x5')]('yes','no')},'ignoresdpversion':{'type':Sequelize[_0xbf79('0x5')]('yes','no')},'subscribecontext':{'type':Sequelize[_0xbf79('0x3')]},'template':{'type':Sequelize['STRING']},'videosupport':{'type':Sequelize[_0xbf79('0x5')]('yes','no','always'),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0xbf79('0x21')](0xb)},'rfc2833compensate':{'type':Sequelize[_0xbf79('0x5')](_0xbf79('0x16'),'no')},'mailbox':{'type':Sequelize[_0xbf79('0x3')]},'session_timers':{'type':Sequelize[_0xbf79('0x5')](_0xbf79('0x23'),'refuse',_0xbf79('0x24'))},'session_expires':{'type':Sequelize[_0xbf79('0x21')](0xb)},'session_minse':{'type':Sequelize[_0xbf79('0x21')](0xb)},'session_refresher':{'type':Sequelize[_0xbf79('0x5')]('uac',_0xbf79('0x25')),'defaultValue':_0xbf79('0x25')},'t38pt_usertpsource':{'type':Sequelize['STRING']},'regexten':{'type':Sequelize[_0xbf79('0x3')]},'fromdomain':{'type':Sequelize['STRING']},'fromuser':{'type':Sequelize[_0xbf79('0x3')]},'port':{'type':Sequelize[_0xbf79('0x21')](0x5)},'qualify':{'type':Sequelize[_0xbf79('0x5')](_0xbf79('0x16'),'no'),'defaultValue':'yes'},'keepalive':{'type':Sequelize[_0xbf79('0x21')](0xb)},'defaultip':{'type':Sequelize[_0xbf79('0x3')]},'defaultuser':{'type':Sequelize[_0xbf79('0x3')]},'rtptimeout':{'type':Sequelize[_0xbf79('0x21')](0xb)},'rtpholdtimeout':{'type':Sequelize[_0xbf79('0x21')](0xb)},'rtpkeepalive':{'type':Sequelize[_0xbf79('0x21')](0xb)},'sendrpid':{'type':Sequelize[_0xbf79('0x5')](_0xbf79('0x16'),'no',_0xbf79('0x26')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize['STRING']},'callbackextension':{'type':Sequelize[_0xbf79('0x3')]},'timert1':{'type':Sequelize['INTEGER'](0xb)},'timerb':{'type':Sequelize[_0xbf79('0x21')](0xb)},'qualifyfreq':{'type':Sequelize['INTEGER'](0xb)},'contactpermit':{'type':Sequelize[_0xbf79('0x3')]},'contactdeny':{'type':Sequelize[_0xbf79('0x3')]},'contactacl':{'type':Sequelize['STRING']},'unsolicited_mailbox':{'type':Sequelize['STRING']},'use_q850_reason':{'type':Sequelize['STRING']},'maxforwards':{'type':Sequelize[_0xbf79('0x21')](0xb)},'encryption':{'type':Sequelize['ENUM'](_0xbf79('0x16'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0xbf79('0x5')](_0xbf79('0x16'),'no')},'force_avp':{'type':Sequelize[_0xbf79('0x5')](_0xbf79('0x16'),'no')},'icesupport':{'type':Sequelize[_0xbf79('0x5')](_0xbf79('0x16'),'no')},'dtlsenable':{'type':Sequelize['ENUM'](_0xbf79('0x16'),'no')},'dtlsverify':{'type':Sequelize[_0xbf79('0x5')](_0xbf79('0x16'),'no',_0xbf79('0x27'),_0xbf79('0x28'))},'dtlsrekey':{'type':Sequelize[_0xbf79('0x21')](0xb)},'dtlscertfile':{'type':Sequelize[_0xbf79('0x3')]},'dtlsprivatekey':{'type':Sequelize[_0xbf79('0x3')]},'dtlscipher':{'type':Sequelize[_0xbf79('0x3')]},'dtlscafile':{'type':Sequelize[_0xbf79('0x3')]},'dtlscapath':{'type':Sequelize[_0xbf79('0x3')]},'dtlssetup':{'type':Sequelize[_0xbf79('0x5')](_0xbf79('0x29'),_0xbf79('0x2a'),'actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0xbf79('0x3')]},'usereqphone':{'type':Sequelize['ENUM'](_0xbf79('0x16'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING']},'recordofffeature':{'type':Sequelize[_0xbf79('0x3')]},'call_limit':{'type':Sequelize[_0xbf79('0x21')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0xbf79('0x5')](_0xbf79('0x16'),'no')},'subscribemwi':{'type':Sequelize[_0xbf79('0x5')]('yes','no')},'vmexten':{'type':Sequelize[_0xbf79('0x3')]},'mohinterpret':{'type':Sequelize[_0xbf79('0x3')]},'mohsuggest':{'type':Sequelize['STRING']},'parkinglot':{'type':Sequelize[_0xbf79('0x3')]},'description':{'type':Sequelize[_0xbf79('0x3')]},'host':{'type':Sequelize['STRING'],'defaultValue':_0xbf79('0x2b')},'canreinvite':{'type':Sequelize[_0xbf79('0x5')]('yes','no',_0xbf79('0x2c'),'update',_0xbf79('0x2d')),'defaultValue':'no'},'registry':{'type':Sequelize['STRING']},'otherFields':{'type':Sequelize[_0xbf79('0x3')]},'active':{'type':Sequelize[_0xbf79('0x2e')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0xbf79('0x3')],'defaultValue':'no'}}; \ No newline at end of file +var _0x7e99=['ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp','setDataValue','transport','join','getDataValue','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','inband','auto','nonat','update','outgoing','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','yes','never','\x22\x22\x20<>','accept','refuse','originate','INTEGER','uac','uas','pai','fingerprint','certificate','active','update,nonat','BOOLEAN','sequelize','exports','name','friend','peer','STRING','from-voip-provider','ENUM'];(function(_0x4b8ecc,_0x4cd01c){var _0x48c1b9=function(_0x308aa3){while(--_0x308aa3){_0x4b8ecc['push'](_0x4b8ecc['shift']());}};_0x48c1b9(++_0x4cd01c);}(_0x7e99,0x164));var _0x97e9=function(_0x5b740b,_0x381833){_0x5b740b=_0x5b740b-0x0;var _0x6f8f4e=_0x7e99[_0x5b740b];return _0x6f8f4e;};'use strict';var Sequelize=require(_0x97e9('0x0'));module[_0x97e9('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x97e9('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM'](_0x97e9('0x3'),'user',_0x97e9('0x4')),'allowNull':![],'defaultValue':_0x97e9('0x3')},'context':{'type':Sequelize[_0x97e9('0x5')],'allowNull':![],'defaultValue':_0x97e9('0x6')},'callingpres':{'type':Sequelize[_0x97e9('0x7')](_0x97e9('0x8'),_0x97e9('0x9'),'ALLOWED_FAILED_SCREEN',_0x97e9('0xa'),_0x97e9('0xb'),_0x97e9('0xc'),_0x97e9('0xd'),_0x97e9('0xe'))},'deny':{'type':Sequelize[_0x97e9('0x5')]},'permit':{'type':Sequelize['STRING']},'secret':{'type':Sequelize[_0x97e9('0x5')]},'md5secret':{'type':Sequelize[_0x97e9('0x5')]},'remotesecret':{'type':Sequelize[_0x97e9('0x5')]},'transport':{'type':Sequelize['STRING'],'defaultValue':_0x97e9('0xf'),'set':function(_0x2c3966){this[_0x97e9('0x10')](_0x97e9('0x11'),_0x2c3966?_0x2c3966[_0x97e9('0x12')](','):null);},'get':function(){return this['getDataValue']('transport')?this[_0x97e9('0x13')](_0x97e9('0x11'))[_0x97e9('0x14')](','):null;},'comment':_0x97e9('0x15')},'dtmfmode':{'type':Sequelize['ENUM'](_0x97e9('0x16'),_0x97e9('0x17'),'shortinfo',_0x97e9('0x18'),_0x97e9('0x19')),'defaultValue':_0x97e9('0x16')},'directmedia':{'type':Sequelize[_0x97e9('0x7')]('yes','no',_0x97e9('0x1a'),_0x97e9('0x1b'),_0x97e9('0x1c')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x97e9('0x5')]},'directmediadeny':{'type':Sequelize['STRING']},'nat':{'type':Sequelize[_0x97e9('0x5')],'defaultValue':_0x97e9('0x1d'),'set':function(_0x66eb87){this['setDataValue'](_0x97e9('0x1e'),_0x66eb87?_0x66eb87[_0x97e9('0x12')](','):null);},'get':function(){return this[_0x97e9('0x13')](_0x97e9('0x1e'))?this['getDataValue'](_0x97e9('0x1e'))['split'](','):null;},'comment':_0x97e9('0x1f')},'callgroup':{'type':Sequelize[_0x97e9('0x5')]},'namedcallgroup':{'type':Sequelize[_0x97e9('0x5')]},'pickupgroup':{'type':Sequelize[_0x97e9('0x5')]},'namedpickupgroup':{'type':Sequelize['STRING']},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x97e9('0x5')],'allowNull':!![]},'disallow':{'type':Sequelize[_0x97e9('0x5')],'defaultValue':_0x97e9('0x20')},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'ulaw;alaw;gsm','set':function(_0x53add0){this['setDataValue'](_0x97e9('0x21'),_0x53add0?_0x53add0[_0x97e9('0x12')](';'):'ulaw;alaw;gsm');},'get':function(){return this['getDataValue'](_0x97e9('0x21'))?this[_0x97e9('0x13')](_0x97e9('0x21'))[_0x97e9('0x14')](';'):null;},'comment':_0x97e9('0x22')},'autoframing':{'type':Sequelize[_0x97e9('0x7')]('yes','no')},'insecure':{'type':Sequelize[_0x97e9('0x5')],'defaultValue':'port,invite','set':function(_0x7e8ed){this['setDataValue'](_0x97e9('0x23'),_0x7e8ed?_0x7e8ed[_0x97e9('0x12')](','):null);},'get':function(){return this[_0x97e9('0x13')](_0x97e9('0x23'))?this[_0x97e9('0x13')](_0x97e9('0x23'))[_0x97e9('0x14')](','):null;},'comment':_0x97e9('0x24')},'trustrpid':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x97e9('0x7')](_0x97e9('0x25'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize['ENUM']('yes','no',_0x97e9('0x26'))},'promiscredir':{'type':Sequelize[_0x97e9('0x7')](_0x97e9('0x25'),'no')},'useclientcode':{'type':Sequelize[_0x97e9('0x7')](_0x97e9('0x25'),'no')},'accountcode':{'type':Sequelize['INTEGER'](0xb)},'setvar':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0x97e9('0x5')],'defaultValue':_0x97e9('0x27')},'amaflags':{'type':Sequelize['STRING']},'callcounter':{'type':Sequelize[_0x97e9('0x7')](_0x97e9('0x25'),'no'),'defaultValue':'yes'},'busylevel':{'type':Sequelize['INTEGER'](0xb)},'allowoverlap':{'type':Sequelize[_0x97e9('0x7')]('yes','no')},'allowsubscribe':{'type':Sequelize['ENUM'](_0x97e9('0x25'),'no')},'allowtransfer':{'type':Sequelize[_0x97e9('0x7')](_0x97e9('0x25'),'no')},'ignoresdpversion':{'type':Sequelize[_0x97e9('0x7')](_0x97e9('0x25'),'no')},'subscribecontext':{'type':Sequelize[_0x97e9('0x5')]},'template':{'type':Sequelize['STRING']},'videosupport':{'type':Sequelize[_0x97e9('0x7')](_0x97e9('0x25'),'no','always'),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize['INTEGER'](0xb)},'rfc2833compensate':{'type':Sequelize[_0x97e9('0x7')]('yes','no')},'mailbox':{'type':Sequelize[_0x97e9('0x5')]},'session_timers':{'type':Sequelize['ENUM'](_0x97e9('0x28'),_0x97e9('0x29'),_0x97e9('0x2a'))},'session_expires':{'type':Sequelize[_0x97e9('0x2b')](0xb)},'session_minse':{'type':Sequelize[_0x97e9('0x2b')](0xb)},'session_refresher':{'type':Sequelize['ENUM'](_0x97e9('0x2c'),_0x97e9('0x2d')),'defaultValue':_0x97e9('0x2d')},'t38pt_usertpsource':{'type':Sequelize[_0x97e9('0x5')]},'regexten':{'type':Sequelize['STRING']},'fromdomain':{'type':Sequelize[_0x97e9('0x5')]},'fromuser':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0x97e9('0x2b')](0x5)},'qualify':{'type':Sequelize[_0x97e9('0x7')](_0x97e9('0x25'),'no'),'defaultValue':_0x97e9('0x25')},'keepalive':{'type':Sequelize[_0x97e9('0x2b')](0xb)},'defaultip':{'type':Sequelize['STRING']},'defaultuser':{'type':Sequelize[_0x97e9('0x5')]},'rtptimeout':{'type':Sequelize[_0x97e9('0x2b')](0xb)},'rtpholdtimeout':{'type':Sequelize[_0x97e9('0x2b')](0xb)},'rtpkeepalive':{'type':Sequelize[_0x97e9('0x2b')](0xb)},'sendrpid':{'type':Sequelize[_0x97e9('0x7')](_0x97e9('0x25'),'no',_0x97e9('0x2e')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x97e9('0x5')]},'callbackextension':{'type':Sequelize[_0x97e9('0x5')]},'timert1':{'type':Sequelize[_0x97e9('0x2b')](0xb)},'timerb':{'type':Sequelize[_0x97e9('0x2b')](0xb)},'qualifyfreq':{'type':Sequelize[_0x97e9('0x2b')](0xb)},'contactpermit':{'type':Sequelize[_0x97e9('0x5')]},'contactdeny':{'type':Sequelize[_0x97e9('0x5')]},'contactacl':{'type':Sequelize[_0x97e9('0x5')]},'unsolicited_mailbox':{'type':Sequelize[_0x97e9('0x5')]},'use_q850_reason':{'type':Sequelize[_0x97e9('0x5')]},'maxforwards':{'type':Sequelize[_0x97e9('0x2b')](0xb)},'encryption':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0x97e9('0x7')](_0x97e9('0x25'),'no')},'force_avp':{'type':Sequelize[_0x97e9('0x7')](_0x97e9('0x25'),'no')},'icesupport':{'type':Sequelize[_0x97e9('0x7')]('yes','no')},'dtlsenable':{'type':Sequelize[_0x97e9('0x7')](_0x97e9('0x25'),'no')},'dtlsverify':{'type':Sequelize[_0x97e9('0x7')](_0x97e9('0x25'),'no',_0x97e9('0x2f'),_0x97e9('0x30'))},'dtlsrekey':{'type':Sequelize[_0x97e9('0x2b')](0xb)},'dtlscertfile':{'type':Sequelize[_0x97e9('0x5')]},'dtlsprivatekey':{'type':Sequelize[_0x97e9('0x5')]},'dtlscipher':{'type':Sequelize[_0x97e9('0x5')]},'dtlscafile':{'type':Sequelize[_0x97e9('0x5')]},'dtlscapath':{'type':Sequelize[_0x97e9('0x5')]},'dtlssetup':{'type':Sequelize[_0x97e9('0x7')](_0x97e9('0x31'),'passive','actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x97e9('0x5')]},'usereqphone':{'type':Sequelize['ENUM'](_0x97e9('0x25'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING']},'recordofffeature':{'type':Sequelize[_0x97e9('0x5')]},'call_limit':{'type':Sequelize[_0x97e9('0x2b')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0x97e9('0x7')]('yes','no')},'subscribemwi':{'type':Sequelize[_0x97e9('0x7')](_0x97e9('0x25'),'no')},'vmexten':{'type':Sequelize['STRING']},'mohinterpret':{'type':Sequelize['STRING']},'mohsuggest':{'type':Sequelize[_0x97e9('0x5')]},'parkinglot':{'type':Sequelize[_0x97e9('0x5')]},'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0x97e9('0x5')],'defaultValue':'dynamic'},'canreinvite':{'type':Sequelize['ENUM'](_0x97e9('0x25'),'no',_0x97e9('0x1a'),'update',_0x97e9('0x32')),'defaultValue':'no'},'registry':{'type':Sequelize['STRING']},'otherFields':{'type':Sequelize[_0x97e9('0x5')]},'active':{'type':Sequelize[_0x97e9('0x33')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0x97e9('0x5')],'defaultValue':'no'}}; \ No newline at end of file diff --git a/server/api/trunk/trunk.controller.js b/server/api/trunk/trunk.controller.js index 26ee09a..3054849 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 _0x7dec=['to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','Trunk,\x20%s,\x20%s','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','json','count','offset','limit','set','Content-Range','reject','save','update','destroy','get','Trunks','stack','name','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','sort','where','pick','filter','merge','type','key','field','options','Trunk','includeAll','findAll','rows','show','params','include','omit','createdAt','updatedAt','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','create','readFileSync','root','server/files/templates/trunk.ejs','utf8','join','server/files/templates/registry.ejs','render','writeFileSync','registry','/etc/asterisk/sip_xcally_registers.conf','Reload','chan_sip.so','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','/etc/asterisk/sip_xcally_trunks.conf','html-pdf','rimraf','zip-dir','fast-json-patch','mustache','util','path','sox','ejs','lodash','crypto','jsforce','desk.js'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0x7dec,0x12e));var _0xc7de=function(_0x30abff,_0x5f2c5f){_0x30abff=_0x30abff-0x0;var _0x4c571e=_0x7dec[_0x30abff];return _0x4c571e;};'use strict';var pdf=require(_0xc7de('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xc7de('0x1'));var zipdir=require(_0xc7de('0x2'));var jsonpatch=require(_0xc7de('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xc7de('0x4'));var util=require(_0xc7de('0x5'));var path=require(_0xc7de('0x6'));var sox=require(_0xc7de('0x7'));var csv=require('to-csv');var ejs=require(_0xc7de('0x8'));var fs=require('fs');var _=require(_0xc7de('0x9'));var squel=require('squel');var crypto=require(_0xc7de('0xa'));var jsforce=require(_0xc7de('0xb'));var deskjs=require(_0xc7de('0xc'));var toCsv=require(_0xc7de('0xd'));var querystring=require(_0xc7de('0xe'));var Papa=require(_0xc7de('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xc7de('0x10'));var as=require(_0xc7de('0x11'));var hardwareService=require(_0xc7de('0x12'));var logger=require(_0xc7de('0x13'))(_0xc7de('0x14'));var utils=require('../../config/utils');var config=require(_0xc7de('0x15'));var db=require('../../mysqldb')['db'];var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function checkPasswordPattern(_0x3b4f11,_0x573b7b,_0x4d1269){if(_0x4d1269){var _0x236fc8=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x236fc8[_0xc7de('0x16')](_0x573b7b)){return _0x3b4f11;}else{throw new Error(_0xc7de('0x17'));}}else{return _0x3b4f11;}}function respondWithRpcPromise(_0x188bd7,_0x1b21a9,_0x3ae684,_0xc3ef78){return new BPromise(function(_0x333cc1,_0xaa3a65){var _0x16e92b=_0xc3ef78||client;return _0x16e92b[_0xc7de('0x18')](_0x188bd7,_0x3ae684)[_0xc7de('0x19')](function(_0x5bedee){logger[_0xc7de('0x1a')](_0xc7de('0x1b'),_0x1b21a9,_0xc7de('0x1c'));logger[_0xc7de('0x1d')](_0xc7de('0x1e'),_0x1b21a9,_0xc7de('0x1c'),JSON[_0xc7de('0x1f')](_0x5bedee));if(_0x5bedee[_0xc7de('0x20')]){if(_0x5bedee[_0xc7de('0x20')][_0xc7de('0x21')]===0x1f4){logger[_0xc7de('0x20')](_0xc7de('0x1b'),_0x1b21a9,_0x5bedee[_0xc7de('0x20')][_0xc7de('0x22')]);return _0xaa3a65(_0x5bedee[_0xc7de('0x20')][_0xc7de('0x22')]);}logger[_0xc7de('0x20')]('Trunk,\x20%s,\x20%s',_0x1b21a9,_0x5bedee['error'][_0xc7de('0x22')]);return _0x333cc1(_0x5bedee[_0xc7de('0x20')][_0xc7de('0x22')]);}else{logger[_0xc7de('0x1a')](_0xc7de('0x1b'),_0x1b21a9,_0xc7de('0x1c'));_0x333cc1(_0x5bedee[_0xc7de('0x23')][_0xc7de('0x22')]);}})[_0xc7de('0x24')](function(_0x1a5e53){logger[_0xc7de('0x20')](_0xc7de('0x1b'),_0x1b21a9,_0x1a5e53);_0xaa3a65(_0x1a5e53);});});}function respondWithStatusCode(_0x2e667b,_0x5d6f5a){_0x5d6f5a=_0x5d6f5a||0xcc;return function(_0x27b0d0){if(_0x27b0d0){return _0x2e667b[_0xc7de('0x25')](_0x5d6f5a);}return _0x2e667b[_0xc7de('0x26')](_0x5d6f5a)['end']();};}function respondWithResult(_0x13a94b,_0x5acf8d){_0x5acf8d=_0x5acf8d||0xc8;return function(_0x1972dd){if(_0x1972dd){return _0x13a94b[_0xc7de('0x26')](_0x5acf8d)[_0xc7de('0x27')](_0x1972dd);}};}function respondWithFilteredResult(_0x542aeb,_0x252003){return function(_0x4c8459){if(_0x4c8459){var _0x3b86a3=_0x4c8459[_0xc7de('0x28')],_0x2aa460=_0x252003['offset'],_0x105c53=_0x252003[_0xc7de('0x29')]+_0x252003[_0xc7de('0x2a')],_0x3985b4;if(_0x105c53>=_0x3b86a3){_0x105c53=_0x3b86a3;_0x3985b4=0xc8;}else{_0x3985b4=0xce;}_0x542aeb[_0xc7de('0x26')](_0x3985b4);return _0x542aeb[_0xc7de('0x2b')](_0xc7de('0x2c'),_0x2aa460+'-'+_0x105c53+'/'+_0x3b86a3)['json'](_0x4c8459);}return null;};}function patchUpdates(_0x4d6fe4){return function(_0x9ddab){try{jsonpatch['apply'](_0x9ddab,_0x4d6fe4,!![]);}catch(_0x53082a){return BPromise[_0xc7de('0x2d')](_0x53082a);}return _0x9ddab[_0xc7de('0x2e')]();};}function saveUpdates(_0x298041,_0x89b589){return function(_0x4d6443){if(_0x4d6443){return _0x4d6443[_0xc7de('0x2f')](_0x298041)[_0xc7de('0x19')](function(_0xae8219){return _0xae8219;});}return null;};}function removeEntity(_0x3a46a0,_0x585a49){return function(_0x4e23b1){if(_0x4e23b1){return _0x4e23b1[_0xc7de('0x30')]()['then'](function(){var _0x559856=_0x4e23b1[_0xc7de('0x31')]({'plain':!![]});var _0x3e883f=_0xc7de('0x32');return db['UserProfileResource'][_0xc7de('0x30')]({'where':{'type':_0x3e883f,'resourceId':_0x559856['id']}})['then'](function(){return _0x4e23b1;});})['then'](function(){_0x3a46a0[_0xc7de('0x26')](0xcc)['end']();});}};}function handleEntityNotFound(_0x38abee,_0x13a24f){return function(_0x16331e){if(!_0x16331e){_0x38abee[_0xc7de('0x25')](0x194);}return _0x16331e;};}function handleError(_0x8e1a26,_0x1dad24){_0x1dad24=_0x1dad24||0x1f4;return function(_0x58b7f8){logger[_0xc7de('0x20')](_0x58b7f8[_0xc7de('0x33')]);if(_0x58b7f8[_0xc7de('0x34')]){delete _0x58b7f8[_0xc7de('0x34')];}_0x8e1a26[_0xc7de('0x26')](_0x1dad24)['send'](_0x58b7f8);};}exports['index']=function(_0x2682a4,_0x2d3ace){var _0x41d290={},_0x1b61df={},_0x1a6afb={'count':0x0,'rows':[]};var _0x2ccd10=db['Trunk'][_0xc7de('0x35')];_0x1b61df[_0xc7de('0x36')]=_[_0xc7de('0x37')](_0x2ccd10);_0x1b61df[_0xc7de('0x38')]=_['keys'](_0x2682a4[_0xc7de('0x38')]);_0x1b61df[_0xc7de('0x39')]=_[_0xc7de('0x3a')](_0x1b61df['model'],_0x1b61df[_0xc7de('0x38')]);_0x41d290[_0xc7de('0x3b')]=_['intersection'](_0x1b61df['model'],qs[_0xc7de('0x3c')](_0x2682a4[_0xc7de('0x38')][_0xc7de('0x3c')]));_0x41d290[_0xc7de('0x3b')]=_0x41d290[_0xc7de('0x3b')][_0xc7de('0x3d')]?_0x41d290['attributes']:_0x1b61df[_0xc7de('0x36')];if(!_0x2682a4[_0xc7de('0x38')]['hasOwnProperty']('nolimit')){_0x41d290[_0xc7de('0x2a')]=qs[_0xc7de('0x2a')](_0x2682a4[_0xc7de('0x38')][_0xc7de('0x2a')]);_0x41d290[_0xc7de('0x29')]=qs['offset'](_0x2682a4['query']['offset']);}_0x41d290['order']=qs[_0xc7de('0x3e')](_0x2682a4[_0xc7de('0x38')][_0xc7de('0x3e')]);_0x41d290[_0xc7de('0x3f')]=qs[_0xc7de('0x39')](_[_0xc7de('0x40')](_0x2682a4[_0xc7de('0x38')],_0x1b61df[_0xc7de('0x39')]));if(_0x2682a4['query'][_0xc7de('0x41')]){_0x41d290[_0xc7de('0x3f')]=_[_0xc7de('0x42')](_0x41d290[_0xc7de('0x3f')],{'$or':_['map'](_0x2ccd10,function(_0x4460f0){if(_0x4460f0[_0xc7de('0x43')][_0xc7de('0x44')]!=='VIRTUAL'){var _0x31bb8d={};_0x31bb8d[_0x4460f0[_0xc7de('0x45')]]={'$like':'%'+_0x2682a4['query'][_0xc7de('0x41')]+'%'};return _0x31bb8d;}})});}_0x41d290=_[_0xc7de('0x42')]({},_0x41d290,_0x2682a4[_0xc7de('0x46')]);var _0x4550fa={'where':_0x41d290[_0xc7de('0x3f')]};return db[_0xc7de('0x47')][_0xc7de('0x28')](_0x4550fa)[_0xc7de('0x19')](function(_0x5131c3){_0x1a6afb[_0xc7de('0x28')]=_0x5131c3;if(_0x2682a4[_0xc7de('0x38')][_0xc7de('0x48')]){_0x41d290['include']=[{'all':!![]}];}return db[_0xc7de('0x47')][_0xc7de('0x49')](_0x41d290);})[_0xc7de('0x19')](function(_0x1f6450){_0x1a6afb[_0xc7de('0x4a')]=_0x1f6450;return _0x1a6afb;})['then'](respondWithFilteredResult(_0x2d3ace,_0x41d290))[_0xc7de('0x24')](handleError(_0x2d3ace,null));};exports[_0xc7de('0x4b')]=function(_0x481bb0,_0x299b0f){var _0x565ca7={'raw':![],'where':{'id':_0x481bb0[_0xc7de('0x4c')]['id']}},_0x6628bb={};_0x6628bb[_0xc7de('0x36')]=_[_0xc7de('0x37')](db[_0xc7de('0x47')]['rawAttributes']);_0x6628bb[_0xc7de('0x38')]=_[_0xc7de('0x37')](_0x481bb0[_0xc7de('0x38')]);_0x6628bb[_0xc7de('0x39')]=_[_0xc7de('0x3a')](_0x6628bb[_0xc7de('0x36')],_0x6628bb[_0xc7de('0x38')]);_0x565ca7[_0xc7de('0x3b')]=_[_0xc7de('0x3a')](_0x6628bb[_0xc7de('0x36')],qs['fields'](_0x481bb0[_0xc7de('0x38')][_0xc7de('0x3c')]));_0x565ca7[_0xc7de('0x3b')]=_0x565ca7[_0xc7de('0x3b')][_0xc7de('0x3d')]?_0x565ca7[_0xc7de('0x3b')]:_0x6628bb[_0xc7de('0x36')];if(_0x481bb0[_0xc7de('0x38')][_0xc7de('0x48')]){_0x565ca7[_0xc7de('0x4d')]=[{'all':!![]}];}_0x565ca7=_[_0xc7de('0x42')]({},_0x565ca7,_0x481bb0[_0xc7de('0x46')]);return db[_0xc7de('0x47')]['find'](_0x565ca7)[_0xc7de('0x19')](handleEntityNotFound(_0x299b0f,null))[_0xc7de('0x19')](respondWithResult(_0x299b0f,null))[_0xc7de('0x24')](handleError(_0x299b0f,null));};exports['clone']=function(_0x2f5b04,_0x482358){var _0x894cc4={'raw':![],'where':{'id':_0x2f5b04[_0xc7de('0x4c')]['id']}},_0x5b784d={};_0x5b784d[_0xc7de('0x36')]=_[_0xc7de('0x37')](db[_0xc7de('0x47')]['rawAttributes']);_0x894cc4['attributes']=_[_0xc7de('0x3a')](_0x5b784d['model'],qs[_0xc7de('0x3c')](_0x2f5b04[_0xc7de('0x38')][_0xc7de('0x3c')]));_0x894cc4[_0xc7de('0x3b')]=_0x894cc4['attributes'][_0xc7de('0x3d')]?_0x894cc4[_0xc7de('0x3b')]:_0x5b784d[_0xc7de('0x36')];if(_0x2f5b04[_0xc7de('0x38')]['includeAll']){_0x894cc4[_0xc7de('0x4d')]=[{'all':!![]}];}_0x894cc4=_[_0xc7de('0x42')]({},_0x894cc4,_0x2f5b04[_0xc7de('0x46')]);return db['Trunk']['find'](_0x894cc4)[_0xc7de('0x19')](handleEntityNotFound(_0x482358,null))[_0xc7de('0x19')](function(_0x4362fd){if(_0x4362fd){var _0x80df6f=_0x4362fd[_0xc7de('0x31')]({'plain':!![]});_0x80df6f=qs[_0xc7de('0x4e')](_0x80df6f,['id',_0xc7de('0x4f'),_0xc7de('0x50')]);_0x2f5b04[_0xc7de('0x51')]=_[_0xc7de('0x4e')](_0x2f5b04[_0xc7de('0x51')],['id',_0xc7de('0x4f'),_0xc7de('0x50')]);return db[_0xc7de('0x47')]['create'](_[_0xc7de('0x42')](_0x80df6f,_0x2f5b04[_0xc7de('0x51')]),{'include':_0x2f5b04[_0xc7de('0x38')][_0xc7de('0x48')]?[{'all':!![]}]:undefined})[_0xc7de('0x19')](function(_0x4feb76){var _0x2d024e=_0x2f5b04[_0xc7de('0x52')][_0xc7de('0x31')]({'plain':!![]});if(!_0x2d024e)throw new Error(_0xc7de('0x53'));if(_0x2d024e[_0xc7de('0x54')]==='user'){var _0x6b8cbf=_0x4feb76['get']({'plain':!![]});var _0x91ef35=_0xc7de('0x32');return db[_0xc7de('0x55')][_0xc7de('0x56')]({'where':{'name':_0x91ef35,'userProfileId':_0x2d024e[_0xc7de('0x57')]},'raw':!![]})[_0xc7de('0x19')](function(_0x2dbf1e){if(_0x2dbf1e&&_0x2dbf1e[_0xc7de('0x58')]===0x0){return db[_0xc7de('0x59')][_0xc7de('0x5a')]({'name':_0x6b8cbf[_0xc7de('0x34')],'resourceId':_0x6b8cbf['id'],'type':_0x2dbf1e[_0xc7de('0x34')],'sectionId':_0x2dbf1e['id']},{})[_0xc7de('0x19')](function(){return _0x4feb76;});}else{return _0x4feb76;}})['catch'](function(_0x38d2a5){logger[_0xc7de('0x20')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x38d2a5);throw _0x38d2a5;});}return _0x4feb76;});}})[_0xc7de('0x19')](respondWithResult(_0x482358,0xc9))[_0xc7de('0x24')](handleError(_0x482358,null));};exports['create']=function(_0x5f7ff7,_0xc9241b,_0x2b2884){var _0x586cd5;return db[_0xc7de('0x47')]['create'](_0x5f7ff7['body'],{'raw':!![]})[_0xc7de('0x19')](function(_0x304649){_0x586cd5=_0x304649;return db[_0xc7de('0x47')][_0xc7de('0x49')]({'raw':!![]});})[_0xc7de('0x19')](function(_0x4e0cdb){var _0x360f38=fs[_0xc7de('0x5b')](path['join'](config[_0xc7de('0x5c')],_0xc7de('0x5d')),_0xc7de('0x5e'));var _0x3652cf=fs[_0xc7de('0x5b')](path[_0xc7de('0x5f')](config[_0xc7de('0x5c')],_0xc7de('0x60')),_0xc7de('0x5e'));var _0x3849f0=ejs[_0xc7de('0x61')](_0x360f38,{'trunks':_0x4e0cdb||[]});fs[_0xc7de('0x62')]('/etc/asterisk/sip_xcally_trunks.conf',_0x3849f0);if(_0x586cd5[_0xc7de('0x63')]){var _0x2e39ea=ejs[_0xc7de('0x61')](_0x3652cf,{'trunks':_0x4e0cdb||[]});fs[_0xc7de('0x62')](_0xc7de('0x64'),_0x2e39ea);}})[_0xc7de('0x19')](function(){return respondWithRpcPromise(_0xc7de('0x65'),_0xc7de('0x5a'),{'module':_0xc7de('0x66')});})[_0xc7de('0x19')](function(){var _0x19a32d=_0x5f7ff7[_0xc7de('0x52')][_0xc7de('0x31')]({'plain':!![]});if(!_0x19a32d)throw new Error(_0xc7de('0x53'));if(_0x19a32d['role']===_0xc7de('0x52')){var _0x77cfad=_0x586cd5['get']({'plain':!![]});return db[_0xc7de('0x55')][_0xc7de('0x56')]({'where':{'name':_0xc7de('0x32'),'userProfileId':_0x19a32d[_0xc7de('0x57')]},'raw':!![]})[_0xc7de('0x19')](function(_0x5a696c){if(_0x5a696c&&_0x5a696c['autoAssociation']===0x0){return db[_0xc7de('0x59')][_0xc7de('0x5a')]({'name':_0x77cfad['name'],'resourceId':_0x77cfad['id'],'type':_0x5a696c[_0xc7de('0x34')],'sectionId':_0x5a696c['id']},{})[_0xc7de('0x19')](function(){return _0x586cd5;});}else{return _0x586cd5;}})[_0xc7de('0x24')](function(_0x44ec19){logger[_0xc7de('0x20')](_0xc7de('0x67'),_0x44ec19);throw _0x44ec19;});}return _0x586cd5;})['then'](respondWithResult(_0xc9241b,0xc9))[_0xc7de('0x24')](handleError(_0xc9241b,null));};exports[_0xc7de('0x2f')]=function(_0xcb6cc2,_0x32a3f1,_0x40c38f){var _0x3a1e44;return db[_0xc7de('0x47')][_0xc7de('0x56')]({'where':{'id':_0xcb6cc2[_0xc7de('0x4c')]['id']}})[_0xc7de('0x19')](handleEntityNotFound(_0x32a3f1,null))[_0xc7de('0x19')](saveUpdates(_0xcb6cc2['body'],null))['then'](function(_0x7de888){if(_0x7de888){_0x3a1e44=_0x7de888;return db[_0xc7de('0x47')][_0xc7de('0x49')]({'raw':!![]});}})[_0xc7de('0x19')](function(_0x1602d6){if(_0x1602d6){var _0x4a9f4a=fs['readFileSync'](path[_0xc7de('0x5f')](config['root'],_0xc7de('0x5d')),'utf8');var _0x4e7f17=fs[_0xc7de('0x5b')](path[_0xc7de('0x5f')](config[_0xc7de('0x5c')],_0xc7de('0x60')),_0xc7de('0x5e'));var _0x41057f=ejs[_0xc7de('0x61')](_0x4a9f4a,{'trunks':_0x1602d6||[]});fs['writeFileSync'](_0xc7de('0x68'),_0x41057f);var _0x47eb29=ejs[_0xc7de('0x61')](_0x4e7f17,{'trunks':_0x1602d6||[]});fs[_0xc7de('0x62')](_0xc7de('0x64'),_0x47eb29);return respondWithRpcPromise(_0xc7de('0x65'),_0xc7de('0x2f'),{'module':_0xc7de('0x66')});}return null;})[_0xc7de('0x19')](function(_0x4e123b){if(_0x4e123b){return _0x3a1e44;}})[_0xc7de('0x19')](respondWithResult(_0x32a3f1,null))[_0xc7de('0x24')](handleError(_0x32a3f1,null));};exports[_0xc7de('0x30')]=function(_0x19ea33,_0x3413af,_0x1245a6){var _0x112d53;return db[_0xc7de('0x47')][_0xc7de('0x56')]({'where':{'id':_0x19ea33[_0xc7de('0x4c')]['id']}})[_0xc7de('0x19')](handleEntityNotFound(_0x3413af,null))[_0xc7de('0x19')](removeEntity(_0x3413af,null))[_0xc7de('0x19')](function(){return db[_0xc7de('0x47')][_0xc7de('0x49')]({'raw':!![]});})[_0xc7de('0x19')](function(_0x578c4d){var _0x13686f=fs['readFileSync'](path[_0xc7de('0x5f')](config[_0xc7de('0x5c')],_0xc7de('0x5d')),_0xc7de('0x5e'));var _0x2afb2f=fs[_0xc7de('0x5b')](path[_0xc7de('0x5f')](config[_0xc7de('0x5c')],_0xc7de('0x60')),_0xc7de('0x5e'));var _0x544836=ejs['render'](_0x13686f,{'trunks':_0x578c4d});var _0x27e911=ejs['render'](_0x2afb2f,{'trunks':_0x578c4d});fs[_0xc7de('0x62')](_0xc7de('0x68'),_0x544836);fs[_0xc7de('0x62')](_0xc7de('0x64'),_0x27e911);return respondWithRpcPromise(_0xc7de('0x65'),'destroy',{'module':_0xc7de('0x66')});})['catch'](handleError(_0x3413af,null));}; \ No newline at end of file +var _0xe3f7=['model','keys','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','map','key','VIRTUAL','field','options','Trunk','include','findAll','rows','catch','show','params','rawAttributes','includeAll','clone','length','omit','createdAt','updatedAt','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','userProfileId','autoAssociation','create','readFileSync','join','root','server/files/templates/trunk.ejs','utf8','server/files/templates/registry.ejs','render','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','registry','Reload','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','chan_sip.so','destroy','/etc/asterisk/sip_xcally_registers.conf','html-pdf','eml-format','zip-dir','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','Trunk,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','info','sendStatus','status','end','json','count','offset','limit','set','apply','reject','update','then','get','Trunks','UserProfileResource','stack','name','send'];(function(_0x2e0bc3,_0x7481e7){var _0x3db3d3=function(_0x1c2107){while(--_0x1c2107){_0x2e0bc3['push'](_0x2e0bc3['shift']());}};_0x3db3d3(++_0x7481e7);}(_0xe3f7,0x1ec));var _0x7e3f=function(_0x252e3e,_0x16625a){_0x252e3e=_0x252e3e-0x0;var _0x348898=_0xe3f7[_0x252e3e];return _0x348898;};'use strict';var pdf=require(_0x7e3f('0x0'));var emlformat=require(_0x7e3f('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x7e3f('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x7e3f('0x3'));var Mustache=require(_0x7e3f('0x4'));var util=require(_0x7e3f('0x5'));var path=require(_0x7e3f('0x6'));var sox=require('sox');var csv=require(_0x7e3f('0x7'));var ejs=require(_0x7e3f('0x8'));var fs=require('fs');var _=require(_0x7e3f('0x9'));var squel=require(_0x7e3f('0xa'));var crypto=require(_0x7e3f('0xb'));var jsforce=require(_0x7e3f('0xc'));var deskjs=require(_0x7e3f('0xd'));var toCsv=require(_0x7e3f('0x7'));var querystring=require('querystring');var Papa=require(_0x7e3f('0xe'));var Redis=require(_0x7e3f('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x7e3f('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7e3f('0x11'));var logger=require(_0x7e3f('0x12'))(_0x7e3f('0x13'));var utils=require('../../config/utils');var config=require(_0x7e3f('0x14'));var db=require(_0x7e3f('0x15'))['db'];var jayson=require(_0x7e3f('0x16'));var client=jayson[_0x7e3f('0x17')][_0x7e3f('0x18')]({'port':0x232a});function checkPasswordPattern(_0x17b6c7,_0x4a078f,_0x13635e){if(_0x13635e){var _0x25ebfd=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x25ebfd[_0x7e3f('0x19')](_0x4a078f)){return _0x17b6c7;}else{throw new Error(_0x7e3f('0x1a'));}}else{return _0x17b6c7;}}function respondWithRpcPromise(_0x2caecd,_0x4684e8,_0x563420,_0x5a172b){return new BPromise(function(_0x131dcd,_0x1501ff){var _0x2cbd4a=_0x5a172b||client;return _0x2cbd4a[_0x7e3f('0x1b')](_0x2caecd,_0x563420)['then'](function(_0x4cb54a){logger['info'](_0x7e3f('0x1c'),_0x4684e8,_0x7e3f('0x1d'));logger[_0x7e3f('0x1e')]('Trunk,\x20%s,\x20%s,\x20%s',_0x4684e8,_0x7e3f('0x1d'),JSON[_0x7e3f('0x1f')](_0x4cb54a));if(_0x4cb54a['error']){if(_0x4cb54a[_0x7e3f('0x20')]['code']===0x1f4){logger['error'](_0x7e3f('0x1c'),_0x4684e8,_0x4cb54a[_0x7e3f('0x20')][_0x7e3f('0x21')]);return _0x1501ff(_0x4cb54a[_0x7e3f('0x20')]['message']);}logger[_0x7e3f('0x20')](_0x7e3f('0x1c'),_0x4684e8,_0x4cb54a[_0x7e3f('0x20')][_0x7e3f('0x21')]);return _0x131dcd(_0x4cb54a[_0x7e3f('0x20')][_0x7e3f('0x21')]);}else{logger[_0x7e3f('0x22')](_0x7e3f('0x1c'),_0x4684e8,_0x7e3f('0x1d'));_0x131dcd(_0x4cb54a['result']['message']);}})['catch'](function(_0x358896){logger[_0x7e3f('0x20')](_0x7e3f('0x1c'),_0x4684e8,_0x358896);_0x1501ff(_0x358896);});});}function respondWithStatusCode(_0x1ede1c,_0x3135d2){_0x3135d2=_0x3135d2||0xcc;return function(_0x51622c){if(_0x51622c){return _0x1ede1c[_0x7e3f('0x23')](_0x3135d2);}return _0x1ede1c[_0x7e3f('0x24')](_0x3135d2)[_0x7e3f('0x25')]();};}function respondWithResult(_0x2bed4a,_0xf84772){_0xf84772=_0xf84772||0xc8;return function(_0x53a689){if(_0x53a689){return _0x2bed4a['status'](_0xf84772)[_0x7e3f('0x26')](_0x53a689);}};}function respondWithFilteredResult(_0x27f770,_0x5b21e8){return function(_0x427796){if(_0x427796){var _0x435239=_0x427796[_0x7e3f('0x27')],_0xe337b8=_0x5b21e8['offset'],_0x2b8840=_0x5b21e8[_0x7e3f('0x28')]+_0x5b21e8[_0x7e3f('0x29')],_0x201607;if(_0x2b8840>=_0x435239){_0x2b8840=_0x435239;_0x201607=0xc8;}else{_0x201607=0xce;}_0x27f770[_0x7e3f('0x24')](_0x201607);return _0x27f770[_0x7e3f('0x2a')]('Content-Range',_0xe337b8+'-'+_0x2b8840+'/'+_0x435239)['json'](_0x427796);}return null;};}function patchUpdates(_0xe911a1){return function(_0x15b6b0){try{jsonpatch[_0x7e3f('0x2b')](_0x15b6b0,_0xe911a1,!![]);}catch(_0x2b6340){return BPromise[_0x7e3f('0x2c')](_0x2b6340);}return _0x15b6b0['save']();};}function saveUpdates(_0x30ace3,_0x242816){return function(_0x33b268){if(_0x33b268){return _0x33b268[_0x7e3f('0x2d')](_0x30ace3)[_0x7e3f('0x2e')](function(_0x1f0d4a){return _0x1f0d4a;});}return null;};}function removeEntity(_0x4a4d03,_0x29c756){return function(_0x3d1613){if(_0x3d1613){return _0x3d1613['destroy']()[_0x7e3f('0x2e')](function(){var _0xc472c3=_0x3d1613[_0x7e3f('0x2f')]({'plain':!![]});var _0x44be84=_0x7e3f('0x30');return db[_0x7e3f('0x31')]['destroy']({'where':{'type':_0x44be84,'resourceId':_0xc472c3['id']}})[_0x7e3f('0x2e')](function(){return _0x3d1613;});})['then'](function(){_0x4a4d03[_0x7e3f('0x24')](0xcc)[_0x7e3f('0x25')]();});}};}function handleEntityNotFound(_0x434d9d,_0x108c9d){return function(_0x192507){if(!_0x192507){_0x434d9d[_0x7e3f('0x23')](0x194);}return _0x192507;};}function handleError(_0x4912b2,_0x22e367){_0x22e367=_0x22e367||0x1f4;return function(_0x32496b){logger[_0x7e3f('0x20')](_0x32496b[_0x7e3f('0x32')]);if(_0x32496b[_0x7e3f('0x33')]){delete _0x32496b['name'];}_0x4912b2['status'](_0x22e367)[_0x7e3f('0x34')](_0x32496b);};}exports['index']=function(_0x4f7d55,_0x1c2af3){var _0x5f31c1={},_0x2cd82d={},_0x1a327a={'count':0x0,'rows':[]};var _0x2240b5=db['Trunk']['rawAttributes'];_0x2cd82d[_0x7e3f('0x35')]=_[_0x7e3f('0x36')](_0x2240b5);_0x2cd82d[_0x7e3f('0x37')]=_[_0x7e3f('0x36')](_0x4f7d55['query']);_0x2cd82d['filters']=_[_0x7e3f('0x38')](_0x2cd82d[_0x7e3f('0x35')],_0x2cd82d[_0x7e3f('0x37')]);_0x5f31c1[_0x7e3f('0x39')]=_[_0x7e3f('0x38')](_0x2cd82d[_0x7e3f('0x35')],qs[_0x7e3f('0x3a')](_0x4f7d55[_0x7e3f('0x37')]['fields']));_0x5f31c1[_0x7e3f('0x39')]=_0x5f31c1[_0x7e3f('0x39')]['length']?_0x5f31c1[_0x7e3f('0x39')]:_0x2cd82d[_0x7e3f('0x35')];if(!_0x4f7d55['query'][_0x7e3f('0x3b')](_0x7e3f('0x3c'))){_0x5f31c1[_0x7e3f('0x29')]=qs[_0x7e3f('0x29')](_0x4f7d55[_0x7e3f('0x37')][_0x7e3f('0x29')]);_0x5f31c1[_0x7e3f('0x28')]=qs['offset'](_0x4f7d55[_0x7e3f('0x37')][_0x7e3f('0x28')]);}_0x5f31c1[_0x7e3f('0x3d')]=qs[_0x7e3f('0x3e')](_0x4f7d55['query'][_0x7e3f('0x3e')]);_0x5f31c1[_0x7e3f('0x3f')]=qs[_0x7e3f('0x40')](_[_0x7e3f('0x41')](_0x4f7d55[_0x7e3f('0x37')],_0x2cd82d['filters']));if(_0x4f7d55['query']['filter']){_0x5f31c1[_0x7e3f('0x3f')]=_[_0x7e3f('0x42')](_0x5f31c1[_0x7e3f('0x3f')],{'$or':_[_0x7e3f('0x43')](_0x2240b5,function(_0x4db50c){if(_0x4db50c['type'][_0x7e3f('0x44')]!==_0x7e3f('0x45')){var _0xefc51d={};_0xefc51d[_0x4db50c[_0x7e3f('0x46')]]={'$like':'%'+_0x4f7d55[_0x7e3f('0x37')]['filter']+'%'};return _0xefc51d;}})});}_0x5f31c1=_['merge']({},_0x5f31c1,_0x4f7d55[_0x7e3f('0x47')]);var _0x45bc90={'where':_0x5f31c1[_0x7e3f('0x3f')]};return db[_0x7e3f('0x48')][_0x7e3f('0x27')](_0x45bc90)[_0x7e3f('0x2e')](function(_0x3630da){_0x1a327a[_0x7e3f('0x27')]=_0x3630da;if(_0x4f7d55[_0x7e3f('0x37')]['includeAll']){_0x5f31c1[_0x7e3f('0x49')]=[{'all':!![]}];}return db[_0x7e3f('0x48')][_0x7e3f('0x4a')](_0x5f31c1);})['then'](function(_0x357903){_0x1a327a[_0x7e3f('0x4b')]=_0x357903;return _0x1a327a;})[_0x7e3f('0x2e')](respondWithFilteredResult(_0x1c2af3,_0x5f31c1))[_0x7e3f('0x4c')](handleError(_0x1c2af3,null));};exports[_0x7e3f('0x4d')]=function(_0x21aeb4,_0x5febb){var _0x34fda0={'raw':![],'where':{'id':_0x21aeb4[_0x7e3f('0x4e')]['id']}},_0x16fffb={};_0x16fffb[_0x7e3f('0x35')]=_['keys'](db[_0x7e3f('0x48')][_0x7e3f('0x4f')]);_0x16fffb[_0x7e3f('0x37')]=_[_0x7e3f('0x36')](_0x21aeb4[_0x7e3f('0x37')]);_0x16fffb[_0x7e3f('0x40')]=_[_0x7e3f('0x38')](_0x16fffb[_0x7e3f('0x35')],_0x16fffb[_0x7e3f('0x37')]);_0x34fda0[_0x7e3f('0x39')]=_[_0x7e3f('0x38')](_0x16fffb['model'],qs[_0x7e3f('0x3a')](_0x21aeb4[_0x7e3f('0x37')][_0x7e3f('0x3a')]));_0x34fda0[_0x7e3f('0x39')]=_0x34fda0[_0x7e3f('0x39')]['length']?_0x34fda0['attributes']:_0x16fffb[_0x7e3f('0x35')];if(_0x21aeb4[_0x7e3f('0x37')][_0x7e3f('0x50')]){_0x34fda0['include']=[{'all':!![]}];}_0x34fda0=_[_0x7e3f('0x42')]({},_0x34fda0,_0x21aeb4['options']);return db[_0x7e3f('0x48')]['find'](_0x34fda0)[_0x7e3f('0x2e')](handleEntityNotFound(_0x5febb,null))[_0x7e3f('0x2e')](respondWithResult(_0x5febb,null))[_0x7e3f('0x4c')](handleError(_0x5febb,null));};exports[_0x7e3f('0x51')]=function(_0x48e7c2,_0x1dfccd){var _0x5ebd35={'raw':![],'where':{'id':_0x48e7c2[_0x7e3f('0x4e')]['id']}},_0x1e7303={};_0x1e7303['model']=_['keys'](db[_0x7e3f('0x48')][_0x7e3f('0x4f')]);_0x5ebd35[_0x7e3f('0x39')]=_['intersection'](_0x1e7303['model'],qs[_0x7e3f('0x3a')](_0x48e7c2[_0x7e3f('0x37')]['fields']));_0x5ebd35[_0x7e3f('0x39')]=_0x5ebd35[_0x7e3f('0x39')][_0x7e3f('0x52')]?_0x5ebd35[_0x7e3f('0x39')]:_0x1e7303[_0x7e3f('0x35')];if(_0x48e7c2[_0x7e3f('0x37')][_0x7e3f('0x50')]){_0x5ebd35[_0x7e3f('0x49')]=[{'all':!![]}];}_0x5ebd35=_[_0x7e3f('0x42')]({},_0x5ebd35,_0x48e7c2[_0x7e3f('0x47')]);return db[_0x7e3f('0x48')]['find'](_0x5ebd35)['then'](handleEntityNotFound(_0x1dfccd,null))[_0x7e3f('0x2e')](function(_0x3d7f7e){if(_0x3d7f7e){var _0x2c6bcb=_0x3d7f7e[_0x7e3f('0x2f')]({'plain':!![]});_0x2c6bcb=qs[_0x7e3f('0x53')](_0x2c6bcb,['id',_0x7e3f('0x54'),_0x7e3f('0x55')]);_0x48e7c2[_0x7e3f('0x56')]=_[_0x7e3f('0x53')](_0x48e7c2[_0x7e3f('0x56')],['id',_0x7e3f('0x54'),_0x7e3f('0x55')]);return db[_0x7e3f('0x48')]['create'](_[_0x7e3f('0x42')](_0x2c6bcb,_0x48e7c2['body']),{'include':_0x48e7c2[_0x7e3f('0x37')][_0x7e3f('0x50')]?[{'all':!![]}]:undefined})[_0x7e3f('0x2e')](function(_0x2397a4){var _0x304aa2=_0x48e7c2[_0x7e3f('0x57')][_0x7e3f('0x2f')]({'plain':!![]});if(!_0x304aa2)throw new Error(_0x7e3f('0x58'));if(_0x304aa2['role']===_0x7e3f('0x57')){var _0x4a835f=_0x2397a4['get']({'plain':!![]});var _0xc36d17=_0x7e3f('0x30');return db[_0x7e3f('0x59')][_0x7e3f('0x5a')]({'where':{'name':_0xc36d17,'userProfileId':_0x304aa2[_0x7e3f('0x5b')]},'raw':!![]})[_0x7e3f('0x2e')](function(_0x503548){if(_0x503548&&_0x503548[_0x7e3f('0x5c')]===0x0){return db[_0x7e3f('0x31')]['create']({'name':_0x4a835f[_0x7e3f('0x33')],'resourceId':_0x4a835f['id'],'type':_0x503548[_0x7e3f('0x33')],'sectionId':_0x503548['id']},{})['then'](function(){return _0x2397a4;});}else{return _0x2397a4;}})[_0x7e3f('0x4c')](function(_0x4bbdc3){logger[_0x7e3f('0x20')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4bbdc3);throw _0x4bbdc3;});}return _0x2397a4;});}})[_0x7e3f('0x2e')](respondWithResult(_0x1dfccd,0xc9))['catch'](handleError(_0x1dfccd,null));};exports[_0x7e3f('0x5d')]=function(_0x12d198,_0x305b53,_0x18006d){var _0x2d6484;return db['Trunk']['create'](_0x12d198[_0x7e3f('0x56')],{'raw':!![]})['then'](function(_0x46d4cc){_0x2d6484=_0x46d4cc;return db['Trunk'][_0x7e3f('0x4a')]({'raw':!![]});})[_0x7e3f('0x2e')](function(_0xd942f9){var _0x27c02c=fs[_0x7e3f('0x5e')](path[_0x7e3f('0x5f')](config[_0x7e3f('0x60')],_0x7e3f('0x61')),_0x7e3f('0x62'));var _0x3e5dee=fs[_0x7e3f('0x5e')](path[_0x7e3f('0x5f')](config['root'],_0x7e3f('0x63')),_0x7e3f('0x62'));var _0x2e9691=ejs[_0x7e3f('0x64')](_0x27c02c,{'trunks':_0xd942f9||[]});fs[_0x7e3f('0x65')](_0x7e3f('0x66'),_0x2e9691);if(_0x2d6484[_0x7e3f('0x67')]){var _0x3d5e02=ejs['render'](_0x3e5dee,{'trunks':_0xd942f9||[]});fs[_0x7e3f('0x65')]('/etc/asterisk/sip_xcally_registers.conf',_0x3d5e02);}})[_0x7e3f('0x2e')](function(){return respondWithRpcPromise(_0x7e3f('0x68'),'create',{'module':'chan_sip.so'});})[_0x7e3f('0x2e')](function(){var _0x5c7e34=_0x12d198[_0x7e3f('0x57')]['get']({'plain':!![]});if(!_0x5c7e34)throw new Error(_0x7e3f('0x58'));if(_0x5c7e34['role']==='user'){var _0x4c2615=_0x2d6484['get']({'plain':!![]});return db[_0x7e3f('0x59')]['find']({'where':{'name':_0x7e3f('0x30'),'userProfileId':_0x5c7e34['userProfileId']},'raw':!![]})[_0x7e3f('0x2e')](function(_0x598169){if(_0x598169&&_0x598169['autoAssociation']===0x0){return db[_0x7e3f('0x31')]['create']({'name':_0x4c2615[_0x7e3f('0x33')],'resourceId':_0x4c2615['id'],'type':_0x598169['name'],'sectionId':_0x598169['id']},{})['then'](function(){return _0x2d6484;});}else{return _0x2d6484;}})[_0x7e3f('0x4c')](function(_0x1f3e1a){logger['error'](_0x7e3f('0x69'),_0x1f3e1a);throw _0x1f3e1a;});}return _0x2d6484;})[_0x7e3f('0x2e')](respondWithResult(_0x305b53,0xc9))[_0x7e3f('0x4c')](handleError(_0x305b53,null));};exports[_0x7e3f('0x2d')]=function(_0x23213e,_0x5df463,_0x4a1be3){var _0xbda01e;return db['Trunk'][_0x7e3f('0x5a')]({'where':{'id':_0x23213e[_0x7e3f('0x4e')]['id']}})['then'](handleEntityNotFound(_0x5df463,null))[_0x7e3f('0x2e')](saveUpdates(_0x23213e['body'],null))[_0x7e3f('0x2e')](function(_0x5a311f){if(_0x5a311f){_0xbda01e=_0x5a311f;return db[_0x7e3f('0x48')][_0x7e3f('0x4a')]({'raw':!![]});}})[_0x7e3f('0x2e')](function(_0x491302){if(_0x491302){var _0x149714=fs[_0x7e3f('0x5e')](path['join'](config[_0x7e3f('0x60')],_0x7e3f('0x61')),_0x7e3f('0x62'));var _0xfa69d=fs[_0x7e3f('0x5e')](path['join'](config[_0x7e3f('0x60')],'server/files/templates/registry.ejs'),_0x7e3f('0x62'));var _0x55293a=ejs[_0x7e3f('0x64')](_0x149714,{'trunks':_0x491302||[]});fs[_0x7e3f('0x65')](_0x7e3f('0x66'),_0x55293a);var _0x3116d5=ejs[_0x7e3f('0x64')](_0xfa69d,{'trunks':_0x491302||[]});fs[_0x7e3f('0x65')]('/etc/asterisk/sip_xcally_registers.conf',_0x3116d5);return respondWithRpcPromise(_0x7e3f('0x68'),_0x7e3f('0x2d'),{'module':_0x7e3f('0x6a')});}return null;})[_0x7e3f('0x2e')](function(_0x4837c3){if(_0x4837c3){return _0xbda01e;}})[_0x7e3f('0x2e')](respondWithResult(_0x5df463,null))[_0x7e3f('0x4c')](handleError(_0x5df463,null));};exports[_0x7e3f('0x6b')]=function(_0xa336cf,_0x3b0217,_0x6c282b){var _0x59171d;return db['Trunk'][_0x7e3f('0x5a')]({'where':{'id':_0xa336cf[_0x7e3f('0x4e')]['id']}})[_0x7e3f('0x2e')](handleEntityNotFound(_0x3b0217,null))[_0x7e3f('0x2e')](removeEntity(_0x3b0217,null))[_0x7e3f('0x2e')](function(){return db[_0x7e3f('0x48')][_0x7e3f('0x4a')]({'raw':!![]});})['then'](function(_0x4f5531){var _0x25f667=fs[_0x7e3f('0x5e')](path['join'](config[_0x7e3f('0x60')],'server/files/templates/trunk.ejs'),_0x7e3f('0x62'));var _0xda37f0=fs[_0x7e3f('0x5e')](path[_0x7e3f('0x5f')](config[_0x7e3f('0x60')],_0x7e3f('0x63')),'utf8');var _0x335f9a=ejs[_0x7e3f('0x64')](_0x25f667,{'trunks':_0x4f5531});var _0x285025=ejs[_0x7e3f('0x64')](_0xda37f0,{'trunks':_0x4f5531});fs[_0x7e3f('0x65')](_0x7e3f('0x66'),_0x335f9a);fs[_0x7e3f('0x65')](_0x7e3f('0x6c'),_0x285025);return respondWithRpcPromise(_0x7e3f('0x68'),_0x7e3f('0x6b'),{'module':_0x7e3f('0x6a')});})[_0x7e3f('0x4c')](handleError(_0x3b0217,null));}; \ No newline at end of file diff --git a/server/api/trunk/trunk.model.js b/server/api/trunk/trunk.model.js index 71c7051..cab0cfb 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 _0x6192=['Trunk','tools_trunks','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0x23ac30,_0x2a1d00){var _0x208fec=function(_0x23213a){while(--_0x23213a){_0x23ac30['push'](_0x23ac30['shift']());}};_0x208fec(++_0x2a1d00);}(_0x6192,0x1b4));var _0x2619=function(_0x404405,_0x271a2e){_0x404405=_0x404405-0x0;var _0x4930df=_0x6192[_0x404405];return _0x4930df;};'use strict';var _=require(_0x2619('0x0'));var util=require(_0x2619('0x1'));var logger=require(_0x2619('0x2'))(_0x2619('0x3'));var moment=require(_0x2619('0x4'));var BPromise=require(_0x2619('0x5'));var rp=require(_0x2619('0x6'));var fs=require('fs');var path=require(_0x2619('0x7'));var rimraf=require(_0x2619('0x8'));var config=require(_0x2619('0x9'));var attributes=require('./trunk.attributes');module[_0x2619('0xa')]=function(_0x50014d,_0x38fa90){return _0x50014d[_0x2619('0xb')](_0x2619('0xc'),attributes,{'tableName':_0x2619('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd96a=['path','./trunk.attributes','exports','Trunk','tools_trunks','lodash','util','../../config/logger','api','moment'];(function(_0x2dd195,_0x4c1c1b){var _0x3358c8=function(_0x4fd47b){while(--_0x4fd47b){_0x2dd195['push'](_0x2dd195['shift']());}};_0x3358c8(++_0x4c1c1b);}(_0xd96a,0x1c7));var _0xad96=function(_0x1f5fca,_0x41e112){_0x1f5fca=_0x1f5fca-0x0;var _0x2bc202=_0xd96a[_0x1f5fca];return _0x2bc202;};'use strict';var _=require(_0xad96('0x0'));var util=require(_0xad96('0x1'));var logger=require(_0xad96('0x2'))(_0xad96('0x3'));var moment=require(_0xad96('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xad96('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xad96('0x6'));module[_0xad96('0x7')]=function(_0x174f41,_0x23422a){return _0x174f41['define'](_0xad96('0x8'),attributes,{'tableName':_0xad96('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/trunk/trunk.rpc.js b/server/api/trunk/trunk.rpc.js index 33bd888..ec8474e 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 _0x14a0=['limit','include','model','map','find','ShowTrunk','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','then','debug','request\x20sent','stringify','error','code','Trunk,\x20%s,\x20%s','message','info','result','catch','GetTrunk','Trunk','findAll','options','raw','where','attributes'];(function(_0x48233b,_0x257df1){var _0x23769d=function(_0x4d698b){while(--_0x4d698b){_0x48233b['push'](_0x48233b['shift']());}};_0x23769d(++_0x257df1);}(_0x14a0,0x8e));var _0x014a=function(_0x46d2a4,_0x57991c){_0x46d2a4=_0x46d2a4-0x0;var _0x4c1a03=_0x14a0[_0x46d2a4];return _0x4c1a03;};'use strict';var _=require('lodash');var util=require(_0x014a('0x0'));var moment=require(_0x014a('0x1'));var BPromise=require(_0x014a('0x2'));var rs=require(_0x014a('0x3'));var fs=require('fs');var Redis=require(_0x014a('0x4'));var db=require(_0x014a('0x5'))['db'];var utils=require(_0x014a('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x014a('0x7'));var jayson=require(_0x014a('0x8'));var client=jayson[_0x014a('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5a61ac,_0x11b8ce,_0x6d05f2){return new BPromise(function(_0x22f17c,_0x4d943b){return client['request'](_0x5a61ac,_0x6d05f2)[_0x014a('0xa')](function(_0x4f5506){logger['info']('Trunk,\x20%s,\x20%s',_0x11b8ce,'request\x20sent');logger[_0x014a('0xb')]('Trunk,\x20%s,\x20%s,\x20%s',_0x11b8ce,_0x014a('0xc'),JSON[_0x014a('0xd')](_0x4f5506));if(_0x4f5506['error']){if(_0x4f5506[_0x014a('0xe')][_0x014a('0xf')]===0x1f4){logger[_0x014a('0xe')](_0x014a('0x10'),_0x11b8ce,_0x4f5506[_0x014a('0xe')][_0x014a('0x11')]);return _0x4d943b(_0x4f5506[_0x014a('0xe')][_0x014a('0x11')]);}logger[_0x014a('0xe')](_0x014a('0x10'),_0x11b8ce,_0x4f5506[_0x014a('0xe')][_0x014a('0x11')]);return _0x22f17c(_0x4f5506['error'][_0x014a('0x11')]);}else{logger[_0x014a('0x12')]('Trunk,\x20%s,\x20%s',_0x11b8ce,_0x014a('0xc'));_0x22f17c(_0x4f5506[_0x014a('0x13')]['message']);}})[_0x014a('0x14')](function(_0x17e4be){logger[_0x014a('0xe')](_0x014a('0x10'),_0x11b8ce,_0x17e4be);_0x4d943b(_0x17e4be);});});}exports[_0x014a('0x15')]=function(_0x12d339){var _0x61ec9f=this;return new Promise(function(_0x263b07,_0x16490a){return db[_0x014a('0x16')][_0x014a('0x17')]({'raw':_0x12d339[_0x014a('0x18')]?_0x12d339[_0x014a('0x18')][_0x014a('0x19')]===undefined?!![]:![]:!![],'where':_0x12d339['options']?_0x12d339[_0x014a('0x18')][_0x014a('0x1a')]||null:null,'attributes':_0x12d339[_0x014a('0x18')]?_0x12d339[_0x014a('0x18')][_0x014a('0x1b')]||null:null,'limit':_0x12d339[_0x014a('0x18')]?_0x12d339[_0x014a('0x18')][_0x014a('0x1c')]||null:null,'include':_0x12d339[_0x014a('0x18')]?_0x12d339['options'][_0x014a('0x1d')]?_['map'](_0x12d339[_0x014a('0x18')][_0x014a('0x1d')],function(_0x44d921){return{'model':db[_0x44d921[_0x014a('0x1e')]],'as':_0x44d921['as'],'attributes':_0x44d921[_0x014a('0x1b')],'include':_0x44d921[_0x014a('0x1d')]?_[_0x014a('0x1f')](_0x44d921[_0x014a('0x1d')],function(_0x165a42){return{'model':db[_0x165a42['model']],'as':_0x165a42['as'],'attributes':_0x165a42[_0x014a('0x1b')],'include':_0x165a42['include']?_[_0x014a('0x1f')](_0x165a42[_0x014a('0x1d')],function(_0x4f1c44){return{'model':db[_0x4f1c44['model']],'as':_0x4f1c44['as'],'attributes':_0x4f1c44[_0x014a('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x014a('0xa')](function(_0x143346){logger['info'](_0x014a('0x15'),_0x12d339);logger[_0x014a('0xb')]('GetTrunk',_0x12d339,JSON[_0x014a('0xd')](_0x143346));_0x263b07(_0x143346);})[_0x014a('0x14')](function(_0x496040){logger['error'](_0x014a('0x15'),_0x496040[_0x014a('0x11')],_0x12d339);_0x16490a(_0x61ec9f[_0x014a('0xe')](0x1f4,_0x496040[_0x014a('0x11')]));});});};exports['ShowTrunk']=function(_0x434038){var _0x147e7e=this;return new Promise(function(_0x15af07,_0x402d3b){return db[_0x014a('0x16')][_0x014a('0x20')]({'raw':_0x434038[_0x014a('0x18')]?_0x434038[_0x014a('0x18')][_0x014a('0x19')]===undefined?!![]:![]:!![],'where':_0x434038[_0x014a('0x18')]?_0x434038[_0x014a('0x18')]['where']||null:null,'attributes':_0x434038[_0x014a('0x18')]?_0x434038[_0x014a('0x18')][_0x014a('0x1b')]||null:null,'include':_0x434038[_0x014a('0x18')]?_0x434038[_0x014a('0x18')][_0x014a('0x1d')]?_[_0x014a('0x1f')](_0x434038['options'][_0x014a('0x1d')],function(_0x325b3c){return{'model':db[_0x325b3c['model']],'as':_0x325b3c['as'],'attributes':_0x325b3c[_0x014a('0x1b')],'include':_0x325b3c[_0x014a('0x1d')]?_[_0x014a('0x1f')](_0x325b3c[_0x014a('0x1d')],function(_0x329136){return{'model':db[_0x329136[_0x014a('0x1e')]],'as':_0x329136['as'],'attributes':_0x329136[_0x014a('0x1b')],'include':_0x329136[_0x014a('0x1d')]?_['map'](_0x329136[_0x014a('0x1d')],function(_0x1dfe6e){return{'model':db[_0x1dfe6e[_0x014a('0x1e')]],'as':_0x1dfe6e['as'],'attributes':_0x1dfe6e[_0x014a('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x427c7a){logger[_0x014a('0x12')](_0x014a('0x21'),_0x434038);logger[_0x014a('0xb')](_0x014a('0x21'),_0x434038,JSON[_0x014a('0xd')](_0x427c7a));_0x15af07(_0x427c7a);})[_0x014a('0x14')](function(_0x36187b){logger[_0x014a('0xe')]('ShowTrunk',_0x36187b[_0x014a('0x11')],_0x434038);_0x402d3b(_0x147e7e['error'](0x1f4,_0x36187b[_0x014a('0x11')]));});});}; \ No newline at end of file +var _0x5eb8=['where','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','Trunk,\x20%s,\x20%s','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','error','message','catch','Trunk','findAll','options','raw','limit','include','model','attributes','map','then','GetTrunk','stringify','ShowTrunk'];(function(_0x2070da,_0x45e586){var _0x4f9fe1=function(_0x5b6f2a){while(--_0x5b6f2a){_0x2070da['push'](_0x2070da['shift']());}};_0x4f9fe1(++_0x45e586);}(_0x5eb8,0xb0));var _0x85eb=function(_0x503641,_0x33a3cf){_0x503641=_0x503641-0x0;var _0x17757d=_0x5eb8[_0x503641];return _0x17757d;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x85eb('0x0'));var BPromise=require(_0x85eb('0x1'));var rs=require(_0x85eb('0x2'));var fs=require('fs');var Redis=require(_0x85eb('0x3'));var db=require(_0x85eb('0x4'))['db'];var utils=require(_0x85eb('0x5'));var logger=require(_0x85eb('0x6'))(_0x85eb('0x7'));var config=require(_0x85eb('0x8'));var jayson=require(_0x85eb('0x9'));var client=jayson[_0x85eb('0xa')][_0x85eb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4a8814,_0x16d7b9,_0x3af658){return new BPromise(function(_0x448345,_0x5cd4ec){return client[_0x85eb('0xc')](_0x4a8814,_0x3af658)['then'](function(_0x1f0036){logger[_0x85eb('0xd')](_0x85eb('0xe'),_0x16d7b9,_0x85eb('0xf'));logger[_0x85eb('0x10')](_0x85eb('0x11'),_0x16d7b9,_0x85eb('0xf'),JSON['stringify'](_0x1f0036));if(_0x1f0036[_0x85eb('0x12')]){if(_0x1f0036[_0x85eb('0x12')]['code']===0x1f4){logger[_0x85eb('0x12')](_0x85eb('0xe'),_0x16d7b9,_0x1f0036[_0x85eb('0x12')][_0x85eb('0x13')]);return _0x5cd4ec(_0x1f0036['error']['message']);}logger[_0x85eb('0x12')]('Trunk,\x20%s,\x20%s',_0x16d7b9,_0x1f0036[_0x85eb('0x12')][_0x85eb('0x13')]);return _0x448345(_0x1f0036[_0x85eb('0x12')][_0x85eb('0x13')]);}else{logger[_0x85eb('0xd')]('Trunk,\x20%s,\x20%s',_0x16d7b9,_0x85eb('0xf'));_0x448345(_0x1f0036['result'][_0x85eb('0x13')]);}})[_0x85eb('0x14')](function(_0x3e23e8){logger[_0x85eb('0x12')]('Trunk,\x20%s,\x20%s',_0x16d7b9,_0x3e23e8);_0x5cd4ec(_0x3e23e8);});});}exports['GetTrunk']=function(_0x50d2a8){var _0xe198ca=this;return new Promise(function(_0x39ca96,_0x10cf2f){return db[_0x85eb('0x15')][_0x85eb('0x16')]({'raw':_0x50d2a8[_0x85eb('0x17')]?_0x50d2a8['options'][_0x85eb('0x18')]===undefined?!![]:![]:!![],'where':_0x50d2a8[_0x85eb('0x17')]?_0x50d2a8[_0x85eb('0x17')]['where']||null:null,'attributes':_0x50d2a8['options']?_0x50d2a8['options']['attributes']||null:null,'limit':_0x50d2a8[_0x85eb('0x17')]?_0x50d2a8[_0x85eb('0x17')][_0x85eb('0x19')]||null:null,'include':_0x50d2a8[_0x85eb('0x17')]?_0x50d2a8[_0x85eb('0x17')][_0x85eb('0x1a')]?_['map'](_0x50d2a8['options']['include'],function(_0x298e84){return{'model':db[_0x298e84[_0x85eb('0x1b')]],'as':_0x298e84['as'],'attributes':_0x298e84[_0x85eb('0x1c')],'include':_0x298e84[_0x85eb('0x1a')]?_[_0x85eb('0x1d')](_0x298e84[_0x85eb('0x1a')],function(_0x5dfc96){return{'model':db[_0x5dfc96[_0x85eb('0x1b')]],'as':_0x5dfc96['as'],'attributes':_0x5dfc96[_0x85eb('0x1c')],'include':_0x5dfc96[_0x85eb('0x1a')]?_[_0x85eb('0x1d')](_0x5dfc96[_0x85eb('0x1a')],function(_0x57a03c){return{'model':db[_0x57a03c[_0x85eb('0x1b')]],'as':_0x57a03c['as'],'attributes':_0x57a03c[_0x85eb('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x85eb('0x1e')](function(_0x3e7eb9){logger[_0x85eb('0xd')](_0x85eb('0x1f'),_0x50d2a8);logger['debug']('GetTrunk',_0x50d2a8,JSON[_0x85eb('0x20')](_0x3e7eb9));_0x39ca96(_0x3e7eb9);})['catch'](function(_0xa9b14f){logger['error'](_0x85eb('0x1f'),_0xa9b14f[_0x85eb('0x13')],_0x50d2a8);_0x10cf2f(_0xe198ca[_0x85eb('0x12')](0x1f4,_0xa9b14f[_0x85eb('0x13')]));});});};exports[_0x85eb('0x21')]=function(_0xf4ac13){var _0x41ed76=this;return new Promise(function(_0x5decd5,_0x237f19){return db[_0x85eb('0x15')]['find']({'raw':_0xf4ac13[_0x85eb('0x17')]?_0xf4ac13['options']['raw']===undefined?!![]:![]:!![],'where':_0xf4ac13[_0x85eb('0x17')]?_0xf4ac13[_0x85eb('0x17')][_0x85eb('0x22')]||null:null,'attributes':_0xf4ac13[_0x85eb('0x17')]?_0xf4ac13[_0x85eb('0x17')][_0x85eb('0x1c')]||null:null,'include':_0xf4ac13[_0x85eb('0x17')]?_0xf4ac13[_0x85eb('0x17')][_0x85eb('0x1a')]?_[_0x85eb('0x1d')](_0xf4ac13['options'][_0x85eb('0x1a')],function(_0x3a5b87){return{'model':db[_0x3a5b87['model']],'as':_0x3a5b87['as'],'attributes':_0x3a5b87['attributes'],'include':_0x3a5b87[_0x85eb('0x1a')]?_[_0x85eb('0x1d')](_0x3a5b87[_0x85eb('0x1a')],function(_0x12cb4c){return{'model':db[_0x12cb4c[_0x85eb('0x1b')]],'as':_0x12cb4c['as'],'attributes':_0x12cb4c[_0x85eb('0x1c')],'include':_0x12cb4c[_0x85eb('0x1a')]?_[_0x85eb('0x1d')](_0x12cb4c[_0x85eb('0x1a')],function(_0x373e5f){return{'model':db[_0x373e5f[_0x85eb('0x1b')]],'as':_0x373e5f['as'],'attributes':_0x373e5f[_0x85eb('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x85eb('0x1e')](function(_0x33605a){logger['info'](_0x85eb('0x21'),_0xf4ac13);logger[_0x85eb('0x10')]('ShowTrunk',_0xf4ac13,JSON['stringify'](_0x33605a));_0x5decd5(_0x33605a);})[_0x85eb('0x14')](function(_0xe22d16){logger['error'](_0x85eb('0x21'),_0xe22d16['message'],_0xf4ac13);_0x237f19(_0x41ed76[_0x85eb('0x12')](0x1f4,_0xe22d16['message']));});});}; \ No newline at end of file diff --git a/server/api/user/index.js b/server/api/user/index.js index cb6dc65..72994b6 100644 --- a/server/api/user/index.js +++ b/server/api/user/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xadb5=['/:id/openchannel/interactions','getOpenchannelInteractions','getMailInteractions','/:id/sms/interactions','getFaxInteractions','/:id/teams','getTeams','/:id/lists','getLists','/:id/agents','getAgents','/:id/prefixes','/:id/fax_accounts','/:id/mail_accounts','getMailAccounts','/:id/openchannel_accounts','/:id/sms_accounts','getSmsAccounts','/:id/chat_websites','getChatWebsites','/:id/square_projects','getSquareProjects','/:id/scheduled_calls','getScheduledCalls','post','/create_many','bulkCreate','addContacts','addQueues','diskStorage','join','root','server/files/images/','format','now','single','addAvatar','/:id/logout','/:id/pause','pause','addTeams','/:id/chat_interactions','addChatInteractions','addMailInteractions','/:id/fax_interactions','addFaxInteractions','/:id/sms_interactions','addSmsInteractions','addOpenchannelInteractions','addFaxAccounts','addMailAccounts','addOpenchannelAccounts','addChatWebsites','addSquareProjects','/:id/api_key','createApiKey','put','update','removeQueues','delete','removeChatInteractions','/:id/mail_interactions','removeMailInteractions','removeFaxInteractions','/:id/openchannel_interactions','removeFaxAccounts','removeMailAccounts','removeOpenchannelAccounts','removeSmsAccounts','removeApiKey','exports','util','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./user.controller','isAuthenticated','index','get','/describe','describe','/whoami','whoami','/:id','show','getAvatar','/:id/contacts','getContacts','/:id/queues','getQueues','/:id/queues_rt','getVoiceQueuesRt','/:id/groups','getGroups','/:id/recordings','getRecordings','/:id/screen_recordings','getScreenRecordings','/:id/chat/interactions','getChatInteractions'];(function(_0x53cedd,_0x25df05){var _0x3b1655=function(_0x3a90d8){while(--_0x3a90d8){_0x53cedd['push'](_0x53cedd['shift']());}};_0x3b1655(++_0x25df05);}(_0xadb5,0xad));var _0x5adb=function(_0x11d538,_0x57cd57){_0x11d538=_0x11d538-0x0;var _0x2a45a3=_0xadb5[_0x11d538];return _0x2a45a3;};'use strict';var multer=require('multer');var util=require(_0x5adb('0x0'));var path=require('path');var timeout=require(_0x5adb('0x1'));var express=require(_0x5adb('0x2'));var router=express[_0x5adb('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x5adb('0x4'));var config=require(_0x5adb('0x5'));var controller=require(_0x5adb('0x6'));router['get']('/',auth[_0x5adb('0x7')](),controller[_0x5adb('0x8')]);router[_0x5adb('0x9')](_0x5adb('0xa'),auth[_0x5adb('0x7')](),controller[_0x5adb('0xb')]);router[_0x5adb('0x9')](_0x5adb('0xc'),auth[_0x5adb('0x7')](),controller[_0x5adb('0xd')]);router[_0x5adb('0x9')](_0x5adb('0xe'),auth[_0x5adb('0x7')](),controller[_0x5adb('0xf')]);router['get']('/:id/avatar',controller[_0x5adb('0x10')]);router[_0x5adb('0x9')](_0x5adb('0x11'),auth['isAuthenticated'](),controller[_0x5adb('0x12')]);router['get'](_0x5adb('0x13'),auth['isAuthenticated'](),controller[_0x5adb('0x14')]);router[_0x5adb('0x9')](_0x5adb('0x15'),auth['isAuthenticated'](),controller[_0x5adb('0x16')]);router[_0x5adb('0x9')](_0x5adb('0x17'),auth['isAuthenticated'](),controller[_0x5adb('0x18')]);router['get'](_0x5adb('0x19'),auth[_0x5adb('0x7')](),controller[_0x5adb('0x1a')]);router[_0x5adb('0x9')](_0x5adb('0x1b'),auth[_0x5adb('0x7')](),controller[_0x5adb('0x1c')]);router[_0x5adb('0x9')](_0x5adb('0x1d'),auth['isAuthenticated'](),controller[_0x5adb('0x1e')]);router['get'](_0x5adb('0x1f'),auth['isAuthenticated'](),controller[_0x5adb('0x20')]);router['get']('/:id/mail/interactions',auth[_0x5adb('0x7')](),controller[_0x5adb('0x21')]);router[_0x5adb('0x9')](_0x5adb('0x22'),auth[_0x5adb('0x7')](),controller['getSmsInteractions']);router[_0x5adb('0x9')]('/:id/fax/interactions',auth['isAuthenticated'](),controller[_0x5adb('0x23')]);router[_0x5adb('0x9')](_0x5adb('0x24'),auth[_0x5adb('0x7')](),controller[_0x5adb('0x25')]);router[_0x5adb('0x9')](_0x5adb('0x26'),auth['isAuthenticated'](),controller[_0x5adb('0x27')]);router[_0x5adb('0x9')](_0x5adb('0x28'),auth[_0x5adb('0x7')](),controller[_0x5adb('0x29')]);router['get'](_0x5adb('0x2a'),auth[_0x5adb('0x7')](),controller['getVoicePrefixes']);router[_0x5adb('0x9')](_0x5adb('0x2b'),auth[_0x5adb('0x7')](),controller['getFaxAccounts']);router[_0x5adb('0x9')](_0x5adb('0x2c'),auth[_0x5adb('0x7')](),controller[_0x5adb('0x2d')]);router[_0x5adb('0x9')](_0x5adb('0x2e'),auth['isAuthenticated'](),controller['getOpenchannelAccounts']);router['get'](_0x5adb('0x2f'),auth[_0x5adb('0x7')](),controller[_0x5adb('0x30')]);router[_0x5adb('0x9')](_0x5adb('0x31'),auth['isAuthenticated'](),controller[_0x5adb('0x32')]);router[_0x5adb('0x9')](_0x5adb('0x33'),auth[_0x5adb('0x7')](),controller[_0x5adb('0x34')]);router[_0x5adb('0x9')](_0x5adb('0x35'),auth[_0x5adb('0x7')](),controller[_0x5adb('0x36')]);router[_0x5adb('0x9')]('/:id/api_key',auth[_0x5adb('0x7')](),controller['getApiKey']);router[_0x5adb('0x37')](_0x5adb('0x38'),auth['isAuthenticated'](),controller[_0x5adb('0x39')]);router[_0x5adb('0x37')](_0x5adb('0x11'),auth['isAuthenticated'](),controller[_0x5adb('0x3a')]);router[_0x5adb('0x37')]('/',auth['isAuthenticated'](),controller['create']);router[_0x5adb('0x37')]('/:id/queues',auth[_0x5adb('0x7')](),controller[_0x5adb('0x3b')]);var upload=multer({'storage':multer[_0x5adb('0x3c')]({'destination':function(_0x2da912,_0x9bdece,_0x5ece39){_0x5ece39(null,path[_0x5adb('0x3d')](config[_0x5adb('0x3e')],_0x5adb('0x3f')));},'filename':function(_0x54851b,_0x4c8870,_0x32eb69){_0x32eb69(null,util[_0x5adb('0x40')]('%s-%s',Date[_0x5adb('0x41')](),_0x4c8870['originalname']));}})});router[_0x5adb('0x37')]('/:id/avatar',upload[_0x5adb('0x42')]('file'),controller[_0x5adb('0x43')]);router[_0x5adb('0x37')]('/:id/login',auth[_0x5adb('0x7')](),controller['login']);router[_0x5adb('0x37')](_0x5adb('0x44'),auth[_0x5adb('0x7')](),controller['logout']);router[_0x5adb('0x37')](_0x5adb('0x45'),auth[_0x5adb('0x7')](),controller[_0x5adb('0x46')]);router[_0x5adb('0x37')]('/:id/unpause',auth['isAuthenticated'](),controller['unpause']);router['post'](_0x5adb('0x24'),auth[_0x5adb('0x7')](),controller[_0x5adb('0x47')]);router[_0x5adb('0x37')](_0x5adb('0x48'),auth[_0x5adb('0x7')](),controller[_0x5adb('0x49')]);router[_0x5adb('0x37')]('/:id/mail_interactions',auth['isAuthenticated'](),controller[_0x5adb('0x4a')]);router['post'](_0x5adb('0x4b'),auth[_0x5adb('0x7')](),controller[_0x5adb('0x4c')]);router[_0x5adb('0x37')](_0x5adb('0x4d'),auth['isAuthenticated'](),controller[_0x5adb('0x4e')]);router[_0x5adb('0x37')]('/:id/openchannel_interactions',auth[_0x5adb('0x7')](),controller[_0x5adb('0x4f')]);router['post'](_0x5adb('0x2b'),auth[_0x5adb('0x7')](),controller[_0x5adb('0x50')]);router[_0x5adb('0x37')](_0x5adb('0x2c'),auth[_0x5adb('0x7')](),controller[_0x5adb('0x51')]);router['post']('/:id/openchannel_accounts',auth[_0x5adb('0x7')](),controller[_0x5adb('0x52')]);router[_0x5adb('0x37')](_0x5adb('0x2f'),auth['isAuthenticated'](),controller['addSmsAccounts']);router[_0x5adb('0x37')](_0x5adb('0x31'),auth[_0x5adb('0x7')](),controller[_0x5adb('0x53')]);router[_0x5adb('0x37')]('/:id/square_projects',auth[_0x5adb('0x7')](),controller[_0x5adb('0x54')]);router['post'](_0x5adb('0x55'),auth[_0x5adb('0x7')](),controller[_0x5adb('0x56')]);router[_0x5adb('0x57')](_0x5adb('0xe'),auth[_0x5adb('0x7')](),controller[_0x5adb('0x58')]);router[_0x5adb('0x57')]('/:id/password',auth[_0x5adb('0x7')](),controller['changePassword']);router['delete']('/:id/queues',auth[_0x5adb('0x7')](),controller[_0x5adb('0x59')]);router[_0x5adb('0x5a')]('/:id/teams',auth[_0x5adb('0x7')](),controller['removeTeams']);router[_0x5adb('0x5a')](_0x5adb('0xe'),auth[_0x5adb('0x7')](),controller['destroy']);router[_0x5adb('0x5a')]('/:id/chat_interactions',auth[_0x5adb('0x7')](),controller[_0x5adb('0x5b')]);router['delete'](_0x5adb('0x5c'),auth[_0x5adb('0x7')](),controller[_0x5adb('0x5d')]);router[_0x5adb('0x5a')](_0x5adb('0x4b'),auth['isAuthenticated'](),controller[_0x5adb('0x5e')]);router[_0x5adb('0x5a')](_0x5adb('0x4d'),auth[_0x5adb('0x7')](),controller['removeSmsInteractions']);router[_0x5adb('0x5a')](_0x5adb('0x5f'),auth[_0x5adb('0x7')](),controller['removeOpenchannelInteractions']);router[_0x5adb('0x5a')](_0x5adb('0x2b'),auth[_0x5adb('0x7')](),controller[_0x5adb('0x60')]);router['delete'](_0x5adb('0x2c'),auth[_0x5adb('0x7')](),controller[_0x5adb('0x61')]);router[_0x5adb('0x5a')](_0x5adb('0x2e'),auth['isAuthenticated'](),controller[_0x5adb('0x62')]);router['delete'](_0x5adb('0x2f'),auth['isAuthenticated'](),controller[_0x5adb('0x63')]);router[_0x5adb('0x5a')](_0x5adb('0x31'),auth[_0x5adb('0x7')](),controller['removeChatWebsites']);router[_0x5adb('0x5a')](_0x5adb('0x33'),auth[_0x5adb('0x7')](),controller['removeSquareProjects']);router['delete']('/:id/api_key',auth[_0x5adb('0x7')](),controller[_0x5adb('0x64')]);module[_0x5adb('0x65')]=router; \ No newline at end of file +var _0xdb28=['/:id/logout','logout','/:id/pause','pause','/:id/unpause','unpause','addTeams','/:id/chat_interactions','addChatInteractions','addMailInteractions','/:id/fax_interactions','addFaxInteractions','/:id/sms_interactions','addSmsInteractions','/:id/openchannel_interactions','addOpenchannelInteractions','addFaxAccounts','addMailAccounts','addOpenchannelAccounts','addChatWebsites','addSquareProjects','/:id/api_key','createApiKey','/:id','update','put','changePassword','delete','removeTeams','destroy','removeChatInteractions','/:id/mail_interactions','removeMailInteractions','removeFaxInteractions','removeSmsInteractions','removeOpenchannelInteractions','/:id/fax_accounts','removeFaxAccounts','removeMailAccounts','removeOpenchannelAccounts','removeSmsAccounts','removeChatWebsites','removeSquareProjects','removeApiKey','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./user.controller','isAuthenticated','index','describe','get','/whoami','whoami','show','getAvatar','getContacts','/:id/queues','/:id/queues_rt','getVoiceQueuesRt','/:id/groups','getGroups','/:id/recordings','/:id/screen_recordings','getScreenRecordings','/:id/chat/interactions','getChatInteractions','getOpenchannelInteractions','/:id/mail/interactions','/:id/sms/interactions','getSmsInteractions','getFaxInteractions','/:id/teams','getTeams','getAgents','/:id/prefixes','getVoicePrefixes','getFaxAccounts','/:id/mail_accounts','getMailAccounts','/:id/openchannel_accounts','getOpenchannelAccounts','/:id/sms_accounts','getSmsAccounts','/:id/chat_websites','/:id/square_projects','getScheduledCalls','getApiKey','post','bulkCreate','/:id/contacts','addContacts','create','addQueues','diskStorage','server/files/images/','format','%s-%s','originalname','/:id/avatar','single','file','addAvatar','login'];(function(_0x91e2c1,_0x2b825a){var _0xcdd14c=function(_0x242457){while(--_0x242457){_0x91e2c1['push'](_0x91e2c1['shift']());}};_0xcdd14c(++_0x2b825a);}(_0xdb28,0x106));var _0x8db2=function(_0x48a858,_0x1db584){_0x48a858=_0x48a858-0x0;var _0x141461=_0xdb28[_0x48a858];return _0x141461;};'use strict';var multer=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var path=require(_0x8db2('0x2'));var timeout=require(_0x8db2('0x3'));var express=require('express');var router=express[_0x8db2('0x4')]();var auth=require(_0x8db2('0x5'));var interaction=require(_0x8db2('0x6'));var config=require(_0x8db2('0x7'));var controller=require(_0x8db2('0x8'));router['get']('/',auth[_0x8db2('0x9')](),controller[_0x8db2('0xa')]);router['get']('/describe',auth[_0x8db2('0x9')](),controller[_0x8db2('0xb')]);router[_0x8db2('0xc')](_0x8db2('0xd'),auth[_0x8db2('0x9')](),controller[_0x8db2('0xe')]);router[_0x8db2('0xc')]('/:id',auth[_0x8db2('0x9')](),controller[_0x8db2('0xf')]);router[_0x8db2('0xc')]('/:id/avatar',controller[_0x8db2('0x10')]);router[_0x8db2('0xc')]('/:id/contacts',auth[_0x8db2('0x9')](),controller[_0x8db2('0x11')]);router[_0x8db2('0xc')](_0x8db2('0x12'),auth[_0x8db2('0x9')](),controller['getQueues']);router['get'](_0x8db2('0x13'),auth[_0x8db2('0x9')](),controller[_0x8db2('0x14')]);router[_0x8db2('0xc')](_0x8db2('0x15'),auth[_0x8db2('0x9')](),controller[_0x8db2('0x16')]);router[_0x8db2('0xc')](_0x8db2('0x17'),auth[_0x8db2('0x9')](),controller['getRecordings']);router[_0x8db2('0xc')](_0x8db2('0x18'),auth['isAuthenticated'](),controller[_0x8db2('0x19')]);router[_0x8db2('0xc')](_0x8db2('0x1a'),auth[_0x8db2('0x9')](),controller[_0x8db2('0x1b')]);router[_0x8db2('0xc')]('/:id/openchannel/interactions',auth['isAuthenticated'](),controller[_0x8db2('0x1c')]);router[_0x8db2('0xc')](_0x8db2('0x1d'),auth[_0x8db2('0x9')](),controller['getMailInteractions']);router[_0x8db2('0xc')](_0x8db2('0x1e'),auth[_0x8db2('0x9')](),controller[_0x8db2('0x1f')]);router[_0x8db2('0xc')]('/:id/fax/interactions',auth[_0x8db2('0x9')](),controller[_0x8db2('0x20')]);router[_0x8db2('0xc')](_0x8db2('0x21'),auth[_0x8db2('0x9')](),controller[_0x8db2('0x22')]);router[_0x8db2('0xc')]('/:id/lists',auth[_0x8db2('0x9')](),controller['getLists']);router['get']('/:id/agents',auth['isAuthenticated'](),controller[_0x8db2('0x23')]);router[_0x8db2('0xc')](_0x8db2('0x24'),auth[_0x8db2('0x9')](),controller[_0x8db2('0x25')]);router[_0x8db2('0xc')]('/:id/fax_accounts',auth[_0x8db2('0x9')](),controller[_0x8db2('0x26')]);router[_0x8db2('0xc')](_0x8db2('0x27'),auth['isAuthenticated'](),controller[_0x8db2('0x28')]);router[_0x8db2('0xc')](_0x8db2('0x29'),auth[_0x8db2('0x9')](),controller[_0x8db2('0x2a')]);router[_0x8db2('0xc')](_0x8db2('0x2b'),auth[_0x8db2('0x9')](),controller[_0x8db2('0x2c')]);router['get'](_0x8db2('0x2d'),auth['isAuthenticated'](),controller['getChatWebsites']);router[_0x8db2('0xc')](_0x8db2('0x2e'),auth[_0x8db2('0x9')](),controller['getSquareProjects']);router[_0x8db2('0xc')]('/:id/scheduled_calls',auth[_0x8db2('0x9')](),controller[_0x8db2('0x2f')]);router[_0x8db2('0xc')]('/:id/api_key',auth['isAuthenticated'](),controller[_0x8db2('0x30')]);router[_0x8db2('0x31')]('/create_many',auth['isAuthenticated'](),controller[_0x8db2('0x32')]);router[_0x8db2('0x31')](_0x8db2('0x33'),auth[_0x8db2('0x9')](),controller[_0x8db2('0x34')]);router[_0x8db2('0x31')]('/',auth[_0x8db2('0x9')](),controller[_0x8db2('0x35')]);router[_0x8db2('0x31')](_0x8db2('0x12'),auth['isAuthenticated'](),controller[_0x8db2('0x36')]);var upload=multer({'storage':multer[_0x8db2('0x37')]({'destination':function(_0x5d2a5b,_0x41594c,_0x3ca80b){_0x3ca80b(null,path['join'](config['root'],_0x8db2('0x38')));},'filename':function(_0x4a45dd,_0x3dfbaa,_0x264696){_0x264696(null,util[_0x8db2('0x39')](_0x8db2('0x3a'),Date['now'](),_0x3dfbaa[_0x8db2('0x3b')]));}})});router['post'](_0x8db2('0x3c'),upload[_0x8db2('0x3d')](_0x8db2('0x3e')),controller[_0x8db2('0x3f')]);router['post']('/:id/login',auth[_0x8db2('0x9')](),controller[_0x8db2('0x40')]);router['post'](_0x8db2('0x41'),auth[_0x8db2('0x9')](),controller[_0x8db2('0x42')]);router['post'](_0x8db2('0x43'),auth[_0x8db2('0x9')](),controller[_0x8db2('0x44')]);router[_0x8db2('0x31')](_0x8db2('0x45'),auth[_0x8db2('0x9')](),controller[_0x8db2('0x46')]);router[_0x8db2('0x31')](_0x8db2('0x21'),auth[_0x8db2('0x9')](),controller[_0x8db2('0x47')]);router[_0x8db2('0x31')](_0x8db2('0x48'),auth['isAuthenticated'](),controller[_0x8db2('0x49')]);router[_0x8db2('0x31')]('/:id/mail_interactions',auth['isAuthenticated'](),controller[_0x8db2('0x4a')]);router['post'](_0x8db2('0x4b'),auth[_0x8db2('0x9')](),controller[_0x8db2('0x4c')]);router[_0x8db2('0x31')](_0x8db2('0x4d'),auth[_0x8db2('0x9')](),controller[_0x8db2('0x4e')]);router['post'](_0x8db2('0x4f'),auth[_0x8db2('0x9')](),controller[_0x8db2('0x50')]);router[_0x8db2('0x31')]('/:id/fax_accounts',auth[_0x8db2('0x9')](),controller[_0x8db2('0x51')]);router[_0x8db2('0x31')](_0x8db2('0x27'),auth['isAuthenticated'](),controller[_0x8db2('0x52')]);router['post'](_0x8db2('0x29'),auth[_0x8db2('0x9')](),controller[_0x8db2('0x53')]);router['post']('/:id/sms_accounts',auth[_0x8db2('0x9')](),controller['addSmsAccounts']);router[_0x8db2('0x31')](_0x8db2('0x2d'),auth[_0x8db2('0x9')](),controller[_0x8db2('0x54')]);router[_0x8db2('0x31')](_0x8db2('0x2e'),auth[_0x8db2('0x9')](),controller[_0x8db2('0x55')]);router[_0x8db2('0x31')](_0x8db2('0x56'),auth[_0x8db2('0x9')](),controller[_0x8db2('0x57')]);router['put'](_0x8db2('0x58'),auth[_0x8db2('0x9')](),controller[_0x8db2('0x59')]);router[_0x8db2('0x5a')]('/:id/password',auth['isAuthenticated'](),controller[_0x8db2('0x5b')]);router[_0x8db2('0x5c')](_0x8db2('0x12'),auth['isAuthenticated'](),controller['removeQueues']);router['delete'](_0x8db2('0x21'),auth[_0x8db2('0x9')](),controller[_0x8db2('0x5d')]);router[_0x8db2('0x5c')](_0x8db2('0x58'),auth[_0x8db2('0x9')](),controller[_0x8db2('0x5e')]);router['delete']('/:id/chat_interactions',auth[_0x8db2('0x9')](),controller[_0x8db2('0x5f')]);router[_0x8db2('0x5c')](_0x8db2('0x60'),auth[_0x8db2('0x9')](),controller[_0x8db2('0x61')]);router[_0x8db2('0x5c')](_0x8db2('0x4b'),auth[_0x8db2('0x9')](),controller[_0x8db2('0x62')]);router[_0x8db2('0x5c')](_0x8db2('0x4d'),auth[_0x8db2('0x9')](),controller[_0x8db2('0x63')]);router[_0x8db2('0x5c')]('/:id/openchannel_interactions',auth[_0x8db2('0x9')](),controller[_0x8db2('0x64')]);router['delete'](_0x8db2('0x65'),auth[_0x8db2('0x9')](),controller[_0x8db2('0x66')]);router['delete'](_0x8db2('0x27'),auth[_0x8db2('0x9')](),controller[_0x8db2('0x67')]);router[_0x8db2('0x5c')](_0x8db2('0x29'),auth['isAuthenticated'](),controller[_0x8db2('0x68')]);router[_0x8db2('0x5c')](_0x8db2('0x2b'),auth['isAuthenticated'](),controller[_0x8db2('0x69')]);router[_0x8db2('0x5c')](_0x8db2('0x2d'),auth[_0x8db2('0x9')](),controller[_0x8db2('0x6a')]);router[_0x8db2('0x5c')](_0x8db2('0x2e'),auth['isAuthenticated'](),controller[_0x8db2('0x6b')]);router[_0x8db2('0x5c')]('/:id/api_key',auth[_0x8db2('0x9')](),controller[_0x8db2('0x6c')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/user/user.attributes.js b/server/api/user/user.attributes.js index bdaad9b..46dcc18 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 _0x5235=['yes','force_rport,comedia','nat','join','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','allow','ulaw;alaw;gsm','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','accept','refuse','originate','uas','fingerprint','certificate','active','passive','actpass','update,nonat','showWebBar','get','isArray','wss','encryption','avpf','force_avp','icesupport','dtlsenable','dtlsverify','dtlssetup','dtlscertfile','dtlsprivatekey','rtcp_mux','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','TEXT','permissions','VIRTUAL','phoneBarEnableScreenRecordingByAgent','string','true','false','screenrecording','blockedAt','sequelize','moment','STRING','name','setDataValue','defaultuser','callerid','\x22%s\x22\x20<%s>','getDataValue','email','toLowerCase','ENUM','admin','user','agent','telephone','local','INTEGER','internal','accountcode','format','fullname','BOOLEAN','DATE','DEFAULT\x20PAUSE','dynamic','friend','peer','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp','transport','split','info','shortinfo','inband','auto','rfc2833','nonat','update','outgoing'];(function(_0x117ab3,_0x4f0f34){var _0x1d54fd=function(_0x50eff5){while(--_0x50eff5){_0x117ab3['push'](_0x117ab3['shift']());}};_0x1d54fd(++_0x4f0f34);}(_0x5235,0x89));var _0x5523=function(_0x152aa1,_0x307718){_0x152aa1=_0x152aa1-0x0;var _0x1bc01a=_0x5235[_0x152aa1];return _0x1bc01a;};'use strict';var Sequelize=require(_0x5523('0x0'));var moment=require(_0x5523('0x1'));var util=require('util');var _=require('lodash');module['exports']={'name':{'type':Sequelize[_0x5523('0x2')],'allowNull':![],'unique':_0x5523('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x1e4f90){this[_0x5523('0x4')](_0x5523('0x3'),_0x1e4f90);this[_0x5523('0x4')](_0x5523('0x5'),_0x1e4f90);},'comment':'The\x20name\x20of\x20the\x20user'},'fullname':{'type':Sequelize['STRING'],'allowNull':![],'set':function(_0x55a625){this[_0x5523('0x4')]('fullname',_0x55a625);this['setDataValue'](_0x5523('0x6'),util['format'](_0x5523('0x7'),_0x55a625,this[_0x5523('0x8')]('internal')));}},'alias':{'type':Sequelize[_0x5523('0x2')]},'email':{'type':Sequelize[_0x5523('0x2')],'allowNull':![],'unique':_0x5523('0x9'),'validate':{'isEmail':!![]},'set':function(_0x51427f){if(_0x51427f){this['setDataValue']('email',_0x51427f[_0x5523('0xa')]());}}},'role':{'type':Sequelize[_0x5523('0xb')](_0x5523('0xc'),_0x5523('0xd'),_0x5523('0xe'),_0x5523('0xf')),'allowNull':![]},'password':{'type':Sequelize[_0x5523('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0x5523('0x2')],'defaultValue':_0x5523('0x10')},'internal':{'type':Sequelize[_0x5523('0x11')](0xb),'allowNull':![],'unique':'internal','set':function(_0x4c8530){this[_0x5523('0x4')](_0x5523('0x12'),_0x4c8530);this[_0x5523('0x4')](_0x5523('0x13'),_0x4c8530);this[_0x5523('0x4')]('callerid',util[_0x5523('0x14')](_0x5523('0x7'),this[_0x5523('0x8')](_0x5523('0x15')),_0x4c8530));}},'salt':{'type':Sequelize[_0x5523('0x2')]},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize[_0x5523('0x2')]},'address':{'type':Sequelize[_0x5523('0x2')]},'zipcode':{'type':Sequelize[_0x5523('0x2')]},'userpic':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x5523('0x2')]},'country':{'type':Sequelize[_0x5523('0x2')]},'online':{'type':Sequelize[_0x5523('0x16')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0x5523('0x17')]},'voicePause':{'type':Sequelize[_0x5523('0x16')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x5523('0x16')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x5523('0x16')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0x5523('0x16')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0x5523('0x16')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0x5523('0x16')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x5523('0x2')],'defaultValue':_0x5523('0x18')},'lastPauseAt':{'type':Sequelize[_0x5523('0x17')]},'chatCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0x5523('0x11')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0x5523('0x11')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0x5523('0x11')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0x5523('0x16')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0x5523('0x11')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0x5523('0x11')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0x5523('0x11')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0x5523('0x16')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0x5523('0x16')],'defaultValue':![]},'chanspy':{'type':Sequelize[_0x5523('0x16')],'defaultValue':![]},'description':{'type':Sequelize[_0x5523('0x2')],'allowNull':!![]},'host':{'type':Sequelize[_0x5523('0x2')],'allowNull':!![],'defaultValue':_0x5523('0x19')},'ipaddr':{'type':Sequelize[_0x5523('0x2')],'allowNull':!![]},'port':{'type':Sequelize[_0x5523('0x11')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0x5523('0x11')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x5523('0x2')],'allowNull':!![]},'regserver':{'type':Sequelize[_0x5523('0x2')],'allowNull':!![]},'useragent':{'type':Sequelize['STRING'],'allowNull':!![]},'lastms':{'type':Sequelize[_0x5523('0x11')](0xb),'allowNull':!![]},'type':{'type':Sequelize['ENUM'](_0x5523('0x1a'),_0x5523('0xd'),_0x5523('0x1b')),'allowNull':!![],'defaultValue':_0x5523('0x1a')},'context':{'type':Sequelize[_0x5523('0x2')],'allowNull':!![],'defaultValue':_0x5523('0x1c')},'callingpres':{'type':Sequelize['ENUM'](_0x5523('0x1d'),_0x5523('0x1e'),'ALLOWED_FAILED_SCREEN',_0x5523('0x1f'),_0x5523('0x20'),_0x5523('0x21'),_0x5523('0x22'),_0x5523('0x23')),'allowNull':!![]},'deny':{'type':Sequelize[_0x5523('0x2')],'allowNull':!![]},'permit':{'type':Sequelize[_0x5523('0x2')],'allowNull':!![]},'secret':{'type':Sequelize[_0x5523('0x2')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0x5523('0x2')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0x5523('0x2')],'allowNull':!![]},'transport':{'type':Sequelize[_0x5523('0x2')],'allowNull':!![],'defaultValue':_0x5523('0x24'),'set':function(_0x296cc1){this['setDataValue']('transport',_0x296cc1?_0x296cc1['join'](','):null);},'get':function(){return this['getDataValue'](_0x5523('0x25'))?this[_0x5523('0x8')](_0x5523('0x25'))[_0x5523('0x26')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]'},'dtmfmode':{'type':Sequelize[_0x5523('0xb')]('rfc2833',_0x5523('0x27'),_0x5523('0x28'),_0x5523('0x29'),_0x5523('0x2a')),'allowNull':!![],'defaultValue':_0x5523('0x2b')},'directmedia':{'type':Sequelize[_0x5523('0xb')]('yes','no',_0x5523('0x2c'),_0x5523('0x2d'),_0x5523('0x2e')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize['ENUM'](_0x5523('0x2f'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x5523('0x2')],'allowNull':!![]},'directmediadeny':{'type':Sequelize['STRING'],'allowNull':!![]},'nat':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x5523('0x30'),'set':function(_0xa08399){this[_0x5523('0x4')](_0x5523('0x31'),_0xa08399?_0xa08399[_0x5523('0x32')](','):null);},'get':function(){return this['getDataValue'](_0x5523('0x31'))?this[_0x5523('0x8')](_0x5523('0x31'))['split'](','):null;},'comment':_0x5523('0x33')},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize[_0x5523('0x2')]},'pickupgroup':{'type':Sequelize[_0x5523('0x2')]},'namedpickupgroup':{'type':Sequelize[_0x5523('0x2')]},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x5523('0x2')]},'disallow':{'type':Sequelize[_0x5523('0x2')],'allowNull':![],'defaultValue':'all'},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'ulaw;alaw;gsm','set':function(_0x5192ca){this[_0x5523('0x4')](_0x5523('0x34'),_0x5192ca?_0x5192ca[_0x5523('0x32')](';'):_0x5523('0x35'));},'get':function(){return this['getDataValue'](_0x5523('0x34'))?this['getDataValue'](_0x5523('0x34'))[_0x5523('0x26')](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]'},'autoframing':{'type':Sequelize[_0x5523('0xb')](_0x5523('0x2f'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x5523('0x2')],'allowNull':!![],'set':function(_0x1f3808){this['setDataValue'](_0x5523('0x36'),_0x1f3808?_0x1f3808['join'](','):null);},'get':function(){return this[_0x5523('0x8')](_0x5523('0x36'))?this[_0x5523('0x8')](_0x5523('0x36'))[_0x5523('0x26')](','):null;},'comment':_0x5523('0x37')},'trustrpid':{'type':Sequelize[_0x5523('0xb')](_0x5523('0x2f'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize['ENUM'](_0x5523('0x2f'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x5523('0xb')](_0x5523('0x2f'),'no',_0x5523('0x38')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x5523('0xb')](_0x5523('0x2f'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0x5523('0xb')](_0x5523('0x2f'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x5523('0x11')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0x5523('0x2')],'allowNull':!![]},'callerid':{'type':Sequelize[_0x5523('0x2')],'allowNull':!![],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize[_0x5523('0x2')],'allowNull':!![]},'callcounter':{'type':Sequelize['ENUM'](_0x5523('0x2f'),'no'),'allowNull':!![],'defaultValue':_0x5523('0x2f')},'busylevel':{'type':Sequelize[_0x5523('0x11')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x5523('0xb')](_0x5523('0x2f'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x5523('0xb')](_0x5523('0x2f'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x5523('0xb')]('yes','no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x5523('0x2')],'allowNull':!![]},'template':{'type':Sequelize[_0x5523('0x2')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0x5523('0xb')](_0x5523('0x2f'),'no','always'),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x5523('0x11')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0x5523('0xb')](_0x5523('0x2f'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x5523('0x2')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0x5523('0xb')](_0x5523('0x39'),_0x5523('0x3a'),_0x5523('0x3b')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0x5523('0x11')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x5523('0x11')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x5523('0xb')]('uac',_0x5523('0x3c')),'allowNull':!![],'defaultValue':_0x5523('0x3c')},'t38pt_usertpsource':{'type':Sequelize[_0x5523('0x2')],'allowNull':!![]},'regexten':{'type':Sequelize[_0x5523('0x2')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x5523('0x2')],'allowNull':!![]},'fromuser':{'type':Sequelize['STRING'],'allowNull':!![]},'qualify':{'type':Sequelize['ENUM'](_0x5523('0x2f'),'no'),'allowNull':!![],'defaultValue':_0x5523('0x2f')},'keepalive':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0x5523('0x2')],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0x5523('0x11')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0x5523('0x11')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x5523('0x11')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0x5523('0xb')](_0x5523('0x2f'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x5523('0x2')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0x5523('0x2')],'allowNull':!![]},'timert1':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x5523('0x11')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x5523('0x11')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0x5523('0x2')],'allowNull':!![]},'contactdeny':{'type':Sequelize['STRING'],'allowNull':!![]},'contactacl':{'type':Sequelize[_0x5523('0x2')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0x5523('0x2')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0x5523('0x2')],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x5523('0x11')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0x5523('0xb')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0x5523('0xb')](_0x5523('0x2f'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0x5523('0xb')](_0x5523('0x2f'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0x5523('0xb')]('yes','no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize['ENUM'](_0x5523('0x2f'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0x5523('0xb')](_0x5523('0x2f'),'no',_0x5523('0x3d'),_0x5523('0x3e')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x5523('0x2')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x5523('0x2')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0x5523('0x2')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0x5523('0x2')],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0x5523('0x2')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x5523('0xb')](_0x5523('0x3f'),_0x5523('0x40'),_0x5523('0x41')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x5523('0x2')],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0x5523('0xb')](_0x5523('0x2f'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x5523('0x2')],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0x5523('0x2')],'allowNull':!![]},'call_limit':{'type':Sequelize[_0x5523('0x11')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0x5523('0xb')]('yes','no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x5523('0xb')](_0x5523('0x2f'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0x5523('0x2')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x5523('0x2')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x5523('0x2')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0x5523('0x2')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0x5523('0xb')](_0x5523('0x2f'),'no',_0x5523('0x2c'),_0x5523('0x2d'),_0x5523('0x42')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x5523('0x16')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0x5523('0x2')]},'resetPasswordExpires':{'type':Sequelize[_0x5523('0x17')]},'showWebBar':{'type':Sequelize['INTEGER'],'defaultValue':0x0,'set':function(_0x35ac46){this['setDataValue'](_0x5523('0x43'),_0x35ac46);var _0x13a3f3=this[_0x5523('0x44')]({'plain':!![]});switch(_0x35ac46){case 0x0:case 0x1:var _0x50f6df=_0x13a3f3[_0x5523('0x25')]?_[_0x5523('0x45')](_0x13a3f3[_0x5523('0x25')])?_0x13a3f3[_0x5523('0x25')]['join']():_0x13a3f3[_0x5523('0x25')]:_0x5523('0x24');if(_0x50f6df===_0x5523('0x46')){_0x50f6df=_0x5523('0x24');}this['setDataValue'](_0x5523('0x25'),_0x50f6df);this[_0x5523('0x4')](_0x5523('0x47'),'no');this[_0x5523('0x4')](_0x5523('0x48'),null);this[_0x5523('0x4')](_0x5523('0x49'),null);this['setDataValue'](_0x5523('0x4a'),null);this[_0x5523('0x4')](_0x5523('0x4b'),null);this[_0x5523('0x4')](_0x5523('0x4c'),null);this[_0x5523('0x4')](_0x5523('0x4d'),null);this[_0x5523('0x4')](_0x5523('0x4e'),null);this[_0x5523('0x4')](_0x5523('0x4f'),null);this['setDataValue'](_0x5523('0x50'),'no');break;case 0x2:this['setDataValue'](_0x5523('0x25'),_0x5523('0x46'));this[_0x5523('0x4')](_0x5523('0x47'),_0x5523('0x2f'));this[_0x5523('0x4')](_0x5523('0x48'),_0x5523('0x2f'));this[_0x5523('0x4')]('force_avp',_0x5523('0x2f'));this[_0x5523('0x4')](_0x5523('0x4a'),_0x5523('0x2f'));this[_0x5523('0x4')](_0x5523('0x4b'),_0x5523('0x2f'));this[_0x5523('0x4')]('dtlsverify','no');this['setDataValue'](_0x5523('0x4d'),_0x5523('0x41'));this[_0x5523('0x4')](_0x5523('0x4e'),_0x13a3f3[_0x5523('0x4e')]||_0x5523('0x51'));this[_0x5523('0x4')](_0x5523('0x4f'),_0x13a3f3['dtlsprivatekey']||_0x5523('0x52'));this['setDataValue'](_0x5523('0x50'),_0x5523('0x2f'));break;default:}}},'permissions':{'type':Sequelize[_0x5523('0x53')],'set':function(_0x3b7c32){this[_0x5523('0x4')](_0x5523('0x54'),_0x3b7c32?_0x3b7c32[_0x5523('0x32')](','):[]);},'get':function(){return this[_0x5523('0x8')](_0x5523('0x54'))?_['map'](this[_0x5523('0x8')](_0x5523('0x54'))[_0x5523('0x26')](','),function(_0x1745bc){return parseInt(_0x1745bc,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize['STRING']},'phoneBarNoReplyNumber':{'type':Sequelize['STRING']},'phoneBarBusyNumber':{'type':Sequelize[_0x5523('0x2')]},'phoneBarUnconditional':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0x5523('0x16')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x5523('0x16')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0x5523('0x16')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0x5523('0x11')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize['STRING'],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0x5523('0x11')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x5523('0xb')](_0x5523('0x2f'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x5523('0x16')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize['STRING']},'passwordResetAt':{'type':Sequelize[_0x5523('0x17')],'defaultValue':null},'phoneBarEnableJaws':{'type':Sequelize[_0x5523('0x16')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x5523('0x16')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0x5523('0x55')],'get':function(){return this[_0x5523('0x8')](_0x5523('0x56'))?this[_0x5523('0x8')](_0x5523('0x56')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0x5523('0x16')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0x5523('0x16')],'defaultValue':![]},'interface':{'type':Sequelize[_0x5523('0x2')],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0x5523('0x16')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0x5523('0x2')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x5523('0x2')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0x5523('0x16')],'defaultValue':![],'set':function(_0x571d37){if(typeof _0x571d37===_0x5523('0x57')){var _0x3655e=_0x571d37==='1'?!![]:_0x571d37==='0'?![]:_0x571d37===_0x5523('0x58')?!![]:_0x571d37===_0x5523('0x59')?![]:![];this[_0x5523('0x4')]('screenrecording',_0x3655e);}else{this[_0x5523('0x4')](_0x5523('0x5a'),_0x571d37);}}},'blocked':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'set':function(_0x3b86f3){this[_0x5523('0x4')]('blocked',_0x3b86f3);if(_0x3b86f3===!![]){this[_0x5523('0x4')](_0x5523('0x5b'),moment());this['setDataValue']('loginAttempts',0x0);}else{this[_0x5523('0x4')](_0x5523('0x5b'),null);}}},'blockedAt':{'type':Sequelize[_0x5523('0x17')],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0x5523('0x11')],'defaultValue':0x0},'disabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0xa283=['false','screenrecording','blocked','blockedAt','loginAttempts','sequelize','moment','util','lodash','exports','STRING','name','setDataValue','defaultuser','The\x20name\x20of\x20the\x20user','format','\x22%s\x22\x20<%s>','internal','email','admin','user','agent','telephone','local','INTEGER','getDataValue','fullname','BOOLEAN','DATE','dynamic','ENUM','friend','peer','from-sip','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','PROHIB_FAILED_SCREEN','udp','transport','join','split','inband','rfc2833','yes','nonat','outgoing','force_rport,comedia','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','always','accept','refuse','originate','uac','uas','fingerprint','actpass','update,nonat','get','isArray','wss','encryption','force_avp','dtlsenable','dtlsverify','dtlscertfile','dtlsprivatekey','avpf','dtlssetup','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','rtcp_mux','TEXT','permissions','map','VIRTUAL','phoneBarEnableScreenRecordingByAgent','string','true'];(function(_0x16eee8,_0xae5f04){var _0x37fb4c=function(_0x2b3e5c){while(--_0x2b3e5c){_0x16eee8['push'](_0x16eee8['shift']());}};_0x37fb4c(++_0xae5f04);}(_0xa283,0x151));var _0x3a28=function(_0x4da367,_0x48a3d0){_0x4da367=_0x4da367-0x0;var _0x3a5a42=_0xa283[_0x4da367];return _0x3a5a42;};'use strict';var Sequelize=require(_0x3a28('0x0'));var moment=require(_0x3a28('0x1'));var util=require(_0x3a28('0x2'));var _=require(_0x3a28('0x3'));module[_0x3a28('0x4')]={'name':{'type':Sequelize[_0x3a28('0x5')],'allowNull':![],'unique':_0x3a28('0x6'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x14b8ee){this[_0x3a28('0x7')]('name',_0x14b8ee);this[_0x3a28('0x7')](_0x3a28('0x8'),_0x14b8ee);},'comment':_0x3a28('0x9')},'fullname':{'type':Sequelize['STRING'],'allowNull':![],'set':function(_0x151554){this[_0x3a28('0x7')]('fullname',_0x151554);this[_0x3a28('0x7')]('callerid',util[_0x3a28('0xa')](_0x3a28('0xb'),_0x151554,this['getDataValue'](_0x3a28('0xc'))));}},'alias':{'type':Sequelize[_0x3a28('0x5')]},'email':{'type':Sequelize[_0x3a28('0x5')],'allowNull':![],'unique':_0x3a28('0xd'),'validate':{'isEmail':!![]},'set':function(_0x40402b){if(_0x40402b){this[_0x3a28('0x7')](_0x3a28('0xd'),_0x40402b['toLowerCase']());}}},'role':{'type':Sequelize['ENUM'](_0x3a28('0xe'),_0x3a28('0xf'),_0x3a28('0x10'),_0x3a28('0x11')),'allowNull':![]},'password':{'type':Sequelize[_0x3a28('0x5')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize['STRING'],'defaultValue':_0x3a28('0x12')},'internal':{'type':Sequelize[_0x3a28('0x13')](0xb),'allowNull':![],'unique':'internal','set':function(_0x564e34){this[_0x3a28('0x7')]('internal',_0x564e34);this[_0x3a28('0x7')]('accountcode',_0x564e34);this[_0x3a28('0x7')]('callerid',util['format'](_0x3a28('0xb'),this[_0x3a28('0x14')](_0x3a28('0x15')),_0x564e34));}},'salt':{'type':Sequelize[_0x3a28('0x5')]},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize[_0x3a28('0x5')]},'address':{'type':Sequelize[_0x3a28('0x5')]},'zipcode':{'type':Sequelize[_0x3a28('0x5')]},'userpic':{'type':Sequelize['STRING']},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0x3a28('0x5')]},'online':{'type':Sequelize[_0x3a28('0x16')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize['DATE']},'voicePause':{'type':Sequelize[_0x3a28('0x16')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x3a28('0x16')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x3a28('0x16')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0x3a28('0x16')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0x3a28('0x16')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0x3a28('0x16')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x3a28('0x5')],'defaultValue':'DEFAULT\x20PAUSE'},'lastPauseAt':{'type':Sequelize[_0x3a28('0x17')]},'chatCapacity':{'type':Sequelize[_0x3a28('0x13')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0x3a28('0x13')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0x3a28('0x13')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0x3a28('0x13')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0x3a28('0x16')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x3a28('0x16')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0x3a28('0x13')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0x3a28('0x13')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0x3a28('0x16')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0x3a28('0x13')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0x3a28('0x16')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chanspy':{'type':Sequelize[_0x3a28('0x16')],'defaultValue':![]},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'host':{'type':Sequelize[_0x3a28('0x5')],'allowNull':!![],'defaultValue':_0x3a28('0x18')},'ipaddr':{'type':Sequelize[_0x3a28('0x5')],'allowNull':!![]},'port':{'type':Sequelize['INTEGER'](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0x3a28('0x13')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize['STRING'],'allowNull':!![]},'regserver':{'type':Sequelize[_0x3a28('0x5')],'allowNull':!![]},'useragent':{'type':Sequelize[_0x3a28('0x5')],'allowNull':!![]},'lastms':{'type':Sequelize[_0x3a28('0x13')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x3a28('0x19')](_0x3a28('0x1a'),_0x3a28('0xf'),_0x3a28('0x1b')),'allowNull':!![],'defaultValue':_0x3a28('0x1a')},'context':{'type':Sequelize[_0x3a28('0x5')],'allowNull':!![],'defaultValue':_0x3a28('0x1c')},'callingpres':{'type':Sequelize[_0x3a28('0x19')]('ALLOWED_NOT_SCREENED',_0x3a28('0x1d'),_0x3a28('0x1e'),'ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN',_0x3a28('0x1f'),'PROHIB'),'allowNull':!![]},'deny':{'type':Sequelize[_0x3a28('0x5')],'allowNull':!![]},'permit':{'type':Sequelize[_0x3a28('0x5')],'allowNull':!![]},'secret':{'type':Sequelize[_0x3a28('0x5')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0x3a28('0x5')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0x3a28('0x5')],'allowNull':!![]},'transport':{'type':Sequelize[_0x3a28('0x5')],'allowNull':!![],'defaultValue':_0x3a28('0x20'),'set':function(_0x33759e){this[_0x3a28('0x7')](_0x3a28('0x21'),_0x33759e?_0x33759e[_0x3a28('0x22')](','):null);},'get':function(){return this['getDataValue'](_0x3a28('0x21'))?this[_0x3a28('0x14')](_0x3a28('0x21'))[_0x3a28('0x23')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]'},'dtmfmode':{'type':Sequelize[_0x3a28('0x19')]('rfc2833','info','shortinfo',_0x3a28('0x24'),'auto'),'allowNull':!![],'defaultValue':_0x3a28('0x25')},'directmedia':{'type':Sequelize[_0x3a28('0x19')](_0x3a28('0x26'),'no',_0x3a28('0x27'),'update',_0x3a28('0x28')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x3a28('0x19')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize['STRING'],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x3a28('0x5')],'allowNull':!![]},'nat':{'type':Sequelize[_0x3a28('0x5')],'allowNull':!![],'defaultValue':_0x3a28('0x29'),'set':function(_0xb25de){this[_0x3a28('0x7')]('nat',_0xb25de?_0xb25de[_0x3a28('0x22')](','):null);},'get':function(){return this['getDataValue']('nat')?this[_0x3a28('0x14')]('nat')[_0x3a28('0x23')](','):null;},'comment':_0x3a28('0x2a')},'callgroup':{'type':Sequelize[_0x3a28('0x5')]},'namedcallgroup':{'type':Sequelize[_0x3a28('0x5')]},'pickupgroup':{'type':Sequelize[_0x3a28('0x5')]},'namedpickupgroup':{'type':Sequelize[_0x3a28('0x5')]},'language':{'type':Sequelize[_0x3a28('0x5')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x3a28('0x5')]},'disallow':{'type':Sequelize[_0x3a28('0x5')],'allowNull':![],'defaultValue':_0x3a28('0x2b')},'allow':{'type':Sequelize[_0x3a28('0x5')],'allowNull':![],'defaultValue':_0x3a28('0x2c'),'set':function(_0xecc88e){this[_0x3a28('0x7')](_0x3a28('0x2d'),_0xecc88e?_0xecc88e[_0x3a28('0x22')](';'):'ulaw;alaw;gsm');},'get':function(){return this[_0x3a28('0x14')](_0x3a28('0x2d'))?this['getDataValue'](_0x3a28('0x2d'))['split'](';'):null;},'comment':_0x3a28('0x2e')},'autoframing':{'type':Sequelize[_0x3a28('0x19')](_0x3a28('0x26'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x3a28('0x5')],'allowNull':!![],'set':function(_0x532d3c){this['setDataValue']('insecure',_0x532d3c?_0x532d3c['join'](','):null);},'get':function(){return this[_0x3a28('0x14')](_0x3a28('0x2f'))?this[_0x3a28('0x14')](_0x3a28('0x2f'))['split'](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize[_0x3a28('0x19')](_0x3a28('0x26'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x3a28('0x19')](_0x3a28('0x26'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x3a28('0x19')](_0x3a28('0x26'),'no','never'),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x3a28('0x19')](_0x3a28('0x26'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize['ENUM'](_0x3a28('0x26'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x3a28('0x13')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0x3a28('0x5')],'allowNull':!![]},'callerid':{'type':Sequelize[_0x3a28('0x5')],'allowNull':!![],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize[_0x3a28('0x5')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x3a28('0x19')]('yes','no'),'allowNull':!![],'defaultValue':_0x3a28('0x26')},'busylevel':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x3a28('0x19')]('yes','no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0x3a28('0x19')](_0x3a28('0x26'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x3a28('0x19')](_0x3a28('0x26'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x3a28('0x5')],'allowNull':!![]},'template':{'type':Sequelize['STRING'],'allowNull':!![]},'videosupport':{'type':Sequelize[_0x3a28('0x19')](_0x3a28('0x26'),'no',_0x3a28('0x30')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x3a28('0x13')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0x3a28('0x19')](_0x3a28('0x26'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x3a28('0x5')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0x3a28('0x19')](_0x3a28('0x31'),_0x3a28('0x32'),_0x3a28('0x33')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0x3a28('0x13')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x3a28('0x13')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize['ENUM'](_0x3a28('0x34'),'uas'),'allowNull':!![],'defaultValue':_0x3a28('0x35')},'t38pt_usertpsource':{'type':Sequelize[_0x3a28('0x5')],'allowNull':!![]},'regexten':{'type':Sequelize[_0x3a28('0x5')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x3a28('0x5')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0x3a28('0x5')],'allowNull':!![]},'qualify':{'type':Sequelize[_0x3a28('0x19')]('yes','no'),'allowNull':!![],'defaultValue':_0x3a28('0x26')},'keepalive':{'type':Sequelize[_0x3a28('0x13')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0x3a28('0x5')],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0x3a28('0x5')],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0x3a28('0x13')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x3a28('0x13')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0x3a28('0x19')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize['STRING'],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0x3a28('0x5')],'allowNull':!![]},'timert1':{'type':Sequelize[_0x3a28('0x13')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x3a28('0x13')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x3a28('0x13')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0x3a28('0x5')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0x3a28('0x5')],'allowNull':!![]},'contactacl':{'type':Sequelize[_0x3a28('0x5')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize['STRING'],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0x3a28('0x5')],'allowNull':!![]},'maxforwards':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0x3a28('0x19')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0x3a28('0x19')]('yes','no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0x3a28('0x19')](_0x3a28('0x26'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0x3a28('0x19')](_0x3a28('0x26'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0x3a28('0x19')](_0x3a28('0x26'),'no',_0x3a28('0x36'),'certificate'),'allowNull':!![]},'dtlsrekey':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x3a28('0x5')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x3a28('0x5')],'allowNull':!![]},'dtlscipher':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscafile':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0x3a28('0x5')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x3a28('0x19')]('active','passive',_0x3a28('0x37')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x3a28('0x5')],'allowNull':!![]},'usereqphone':{'type':Sequelize['ENUM'](_0x3a28('0x26'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x3a28('0x5')],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0x3a28('0x5')],'allowNull':!![]},'call_limit':{'type':Sequelize[_0x3a28('0x13')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize['ENUM'](_0x3a28('0x26'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x3a28('0x19')](_0x3a28('0x26'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0x3a28('0x5')],'allowNull':!![]},'mohinterpret':{'type':Sequelize['STRING'],'allowNull':!![]},'mohsuggest':{'type':Sequelize['STRING'],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0x3a28('0x5')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0x3a28('0x19')](_0x3a28('0x26'),'no','nonat','update',_0x3a28('0x38')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x3a28('0x16')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0x3a28('0x5')]},'resetPasswordExpires':{'type':Sequelize['DATE']},'showWebBar':{'type':Sequelize[_0x3a28('0x13')],'defaultValue':0x0,'set':function(_0x2060d0){this[_0x3a28('0x7')]('showWebBar',_0x2060d0);var _0xd22899=this[_0x3a28('0x39')]({'plain':!![]});switch(_0x2060d0){case 0x0:case 0x1:var _0x3666b0=_0xd22899[_0x3a28('0x21')]?_[_0x3a28('0x3a')](_0xd22899[_0x3a28('0x21')])?_0xd22899[_0x3a28('0x21')][_0x3a28('0x22')]():_0xd22899[_0x3a28('0x21')]:'udp';if(_0x3666b0===_0x3a28('0x3b')){_0x3666b0=_0x3a28('0x20');}this['setDataValue'](_0x3a28('0x21'),_0x3666b0);this[_0x3a28('0x7')](_0x3a28('0x3c'),'no');this[_0x3a28('0x7')]('avpf',null);this[_0x3a28('0x7')](_0x3a28('0x3d'),null);this[_0x3a28('0x7')]('icesupport',null);this[_0x3a28('0x7')](_0x3a28('0x3e'),null);this['setDataValue'](_0x3a28('0x3f'),null);this['setDataValue']('dtlssetup',null);this['setDataValue'](_0x3a28('0x40'),null);this['setDataValue'](_0x3a28('0x41'),null);this[_0x3a28('0x7')]('rtcp_mux','no');break;case 0x2:this[_0x3a28('0x7')](_0x3a28('0x21'),_0x3a28('0x3b'));this[_0x3a28('0x7')]('encryption',_0x3a28('0x26'));this[_0x3a28('0x7')](_0x3a28('0x42'),'yes');this['setDataValue'](_0x3a28('0x3d'),'yes');this[_0x3a28('0x7')]('icesupport',_0x3a28('0x26'));this[_0x3a28('0x7')](_0x3a28('0x3e'),_0x3a28('0x26'));this[_0x3a28('0x7')](_0x3a28('0x3f'),'no');this[_0x3a28('0x7')](_0x3a28('0x43'),'actpass');this[_0x3a28('0x7')]('dtlscertfile',_0xd22899[_0x3a28('0x40')]||_0x3a28('0x44'));this[_0x3a28('0x7')]('dtlsprivatekey',_0xd22899[_0x3a28('0x41')]||_0x3a28('0x45'));this[_0x3a28('0x7')](_0x3a28('0x46'),_0x3a28('0x26'));break;default:}}},'permissions':{'type':Sequelize[_0x3a28('0x47')],'set':function(_0x39503){this['setDataValue'](_0x3a28('0x48'),_0x39503?_0x39503['join'](','):[]);},'get':function(){return this[_0x3a28('0x14')](_0x3a28('0x48'))?_[_0x3a28('0x49')](this[_0x3a28('0x14')](_0x3a28('0x48'))[_0x3a28('0x23')](','),function(_0x5eee5e){return parseInt(_0x5eee5e,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize['STRING']},'phoneBarNoReplyNumber':{'type':Sequelize['STRING']},'phoneBarBusyNumber':{'type':Sequelize[_0x3a28('0x5')]},'phoneBarUnconditional':{'type':Sequelize[_0x3a28('0x16')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x3a28('0x16')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0x3a28('0x16')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0x3a28('0x13')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x3a28('0x5')],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0x3a28('0x13')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x3a28('0x19')](_0x3a28('0x26'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x3a28('0x16')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0x3a28('0x5')]},'passwordResetAt':{'type':Sequelize[_0x3a28('0x17')],'defaultValue':null},'phoneBarEnableJaws':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0x3a28('0x4a')],'get':function(){return this['getDataValue'](_0x3a28('0x4b'))?this['getDataValue'](_0x3a28('0x4b')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0x3a28('0x16')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0x3a28('0x16')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0x3a28('0x16')],'defaultValue':![]},'interface':{'type':Sequelize['STRING'],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0x3a28('0x16')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0x3a28('0x5')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x3a28('0x5')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0x3a28('0x16')],'defaultValue':![],'set':function(_0x555376){if(typeof _0x555376===_0x3a28('0x4c')){var _0x1dc505=_0x555376==='1'?!![]:_0x555376==='0'?![]:_0x555376===_0x3a28('0x4d')?!![]:_0x555376===_0x3a28('0x4e')?![]:![];this[_0x3a28('0x7')](_0x3a28('0x4f'),_0x1dc505);}else{this[_0x3a28('0x7')](_0x3a28('0x4f'),_0x555376);}}},'blocked':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'set':function(_0x46979e){this[_0x3a28('0x7')](_0x3a28('0x50'),_0x46979e);if(_0x46979e===!![]){this[_0x3a28('0x7')](_0x3a28('0x51'),moment());this[_0x3a28('0x7')](_0x3a28('0x52'),0x0);}else{this['setDataValue'](_0x3a28('0x51'),null);}}},'blockedAt':{'type':Sequelize[_0x3a28('0x17')],'defaultValue':null},'loginAttempts':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'disabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/user/user.controller.js b/server/api/user/user.controller.js index 1cee4a8..0c0784e 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 _0xda55=['DEFAULT\x20PAUSE','unpause','mailPause','chatPause','faxPause','openchannelPause','smsPause','pauseType','manual','mail','chat','sms','openchannel','%s%s','Pause','getTeams','Team','addTeams','getVoiceQueues','setDataValue','Voice','getChatQueues','Chat','getMailQueues','Mail','getSmsQueues','Sms','Openchannel','flatten','transaction','online','getDataValue','removeTeams','Fax','getOpenchannelQueues','removeAgent','Queue:remove','getLists','getAgents','values','addChatInteractions','user_has_chat_interactions:save','removeChatInteractions','isArray','user_has_chat_interactions:remove','addMailInteractions','user_has_mail_interactions:save','removeMailInteractions','user_has_mail_interactions:remove','addFaxInteractions','user_has_fax_interactions:save','removeFaxInteractions','user_has_fax_interactions:remove','addSmsInteractions','user_has_sms_interactions:save','removeSmsInteractions','user_has_sms_interactions:remove','addOpenchannelInteractions','user_has_openchannel_interactions:save','user_has_openchannel_interactions:remove','getVoicePrefixes','getFaxAccounts','FaxAccount','addFaxAccounts','removeFaxAccounts','getMailAccounts','addMailAccounts','removeMailAccounts','getOpenchannelAccounts','removeOpenchannelAccounts','getSmsAccounts','SmsAccount','addSmsAccounts','removeSmsAccounts','getChatWebsites','ChatWebsite','addChatWebsites','removeChatWebsites','getSquareProjects','addSquareProjects','removeSquareProjects','getScheduledCalls','CmHopper','$and','$or','$gt','$gte','$ne','$eq','$in','$notIn','$like','$notLike','$iLike','$notILike','$overlap','$contains','$contained','$any','firstName','lastName','dialActive','getApiKey','token','No\x20API\x20access\x20key\x20found!','You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.','generateApiKey','iat','removeApiKey','html-pdf','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','localhost','socket.io-emitter','./user.socket','register','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','info','User,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','status','end','json','offset','limit','set','save','update','then','get','Users','user','Agents','agent','Telephones','telephone','filter','ignore','value','includes','role','find','name','UserProfileResource','sendStatus','stack','send','index','User','rawAttributes','model','differenceBy','keys','password','salt','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','merge','map','type','key','VIRTUAL','sequelize','field','lower','findAll','catch','show','params','options','bulkCreate','body','describe','addContacts','ids','omit','agent\x20role','count','../../config/license/util','getLicense','telephones','users','isNil','count\x20%s:\x20%s','create','internal','Setting','findById','securePassword','min_internal','max','select\x20(select\x20IFNULL(max(internal)+1,1)\x20from\x20users\x20where\x20internal\x20<\x20md.internal)\x20as\x20\x27from\x27,\x20md.internal\x20-\x201\x20as\x20\x27to\x27\x20from\x20users\x20md\x20where\x20md.internal\x20!=\x201\x20and\x20not\x20exists\x20(select\x201\x20from\x20users\x20md2\x20where\x20md2.internal\x20=\x20md.internal\x20-\x201)','QueryTypes','SELECT','length','from','mailbox','VoiceMail','fullname','permissions','101','102','103','110','104','106','107','108','109','100','111','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','changePassword','oldPassword','newPassword','Sequelize','ValidationError','Invalid\x20body\x20format.\x20Use\x20oldPassord\x20and\x20newPassword','authenticate','Wrong\x20credentials','admin','Invalid\x20body\x20format.\x20Use\x20newPassword','Unauthorized','addQueues','loginInPause','voicePause','interface','Unknown\x20channel','toLowerCase','Queues','spread','capitalize','QueueId','emit','Queue:save','voice','VoiceQueue','push','format','penalty','each','UserVoiceQueueRt','upsert','removeQueues','channel','filename','getAvatar','join','root','server/files/images/logos/default_profile.png','userpic','download','server/files/images/','getContacts','findOne','CmContact','includeAll','include','CmList','Tag','Tags','color','tag','getQueues','isValidChannel','order','Queue','Unknown\x20role','getVoiceQueuesRt','getGroups','getRecordings','UserId','VoiceRecording','rows','getScreenRecordings','ScreenRecording','getChatInteractions','ChatInteraction','OpenchannelInteraction','getOpenchannelInteractions','getMailInteractions','MailInteraction','SmsInteraction','getSmsInteractions','FaxInteraction','getFaxInteractions','login','phone','mobile','LOCAL/%s@from-sip/n','intrf','SIP/%s','user:%s','headers','x-forwarded-for','connection','remoteAddress','destroy','UserVoiceQueue.penalty','MemberReport','all','forEach','LOGIN','device','PAUSE','LOGININPAUSE','concat','YYYY-MM-DD\x20HH:mm:ss','isMiddleware','QueuePause','pause','updateAttributes','getChannels'];(function(_0x403d29,_0xf568f9){var _0x21e4ac=function(_0x36f199){while(--_0x36f199){_0x403d29['push'](_0x403d29['shift']());}};_0x21e4ac(++_0xf568f9);}(_0xda55,0x6d));var _0x5da5=function(_0x185d17,_0x36bb78){_0x185d17=_0x185d17-0x0;var _0x2debcb=_0xda55[_0x185d17];return _0x2debcb;};'use strict';var pdf=require(_0x5da5('0x0'));var emlformat=require(_0x5da5('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x5da5('0x2'));var rp=require(_0x5da5('0x3'));var moment=require(_0x5da5('0x4'));var BPromise=require(_0x5da5('0x5'));var Mustache=require(_0x5da5('0x6'));var util=require('util');var path=require(_0x5da5('0x7'));var sox=require('sox');var csv=require(_0x5da5('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x5da5('0x9'));var squel=require(_0x5da5('0xa'));var crypto=require(_0x5da5('0xb'));var jsforce=require(_0x5da5('0xc'));var deskjs=require(_0x5da5('0xd'));var toCsv=require(_0x5da5('0x8'));var querystring=require(_0x5da5('0xe'));var Papa=require(_0x5da5('0xf'));var Redis=require('ioredis');var authService=require(_0x5da5('0x10'));var qs=require(_0x5da5('0x11'));var as=require(_0x5da5('0x12'));var hardwareService=require(_0x5da5('0x13'));var logger=require(_0x5da5('0x14'))(_0x5da5('0x15'));var utils=require(_0x5da5('0x16'));var config=require('../../config/environment');var db=require(_0x5da5('0x17'))['db'];config[_0x5da5('0x18')]=_['defaults'](config[_0x5da5('0x18')],{'host':_0x5da5('0x19'),'port':0x18eb});var socket=require(_0x5da5('0x1a'))(new Redis(config[_0x5da5('0x18')]));require(_0x5da5('0x1b'))[_0x5da5('0x1c')](socket);var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function checkPasswordPattern(_0x4267cd,_0x126fc8,_0x13c701){if(_0x13c701){var _0x665ce8=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x665ce8[_0x5da5('0x1d')](_0x126fc8)){return _0x4267cd;}else{throw new Error(_0x5da5('0x1e'));}}else{return _0x4267cd;}}function respondWithRpcPromise(_0x3aff51,_0x4a952a,_0x124dc5,_0x290136){return new BPromise(function(_0x1a4849,_0x16b11f){var _0x3f7e98=_0x290136||client;return _0x3f7e98[_0x5da5('0x1f')](_0x3aff51,_0x124dc5)['then'](function(_0x1920e2){logger[_0x5da5('0x20')](_0x5da5('0x21'),_0x4a952a,_0x5da5('0x22'));logger[_0x5da5('0x23')]('User,\x20%s,\x20%s,\x20%s',_0x4a952a,_0x5da5('0x22'),JSON[_0x5da5('0x24')](_0x1920e2));if(_0x1920e2[_0x5da5('0x25')]){if(_0x1920e2['error'][_0x5da5('0x26')]===0x1f4){logger[_0x5da5('0x25')](_0x5da5('0x21'),_0x4a952a,_0x1920e2[_0x5da5('0x25')][_0x5da5('0x27')]);return _0x16b11f(_0x1920e2[_0x5da5('0x25')]['message']);}logger[_0x5da5('0x25')]('User,\x20%s,\x20%s',_0x4a952a,_0x1920e2[_0x5da5('0x25')][_0x5da5('0x27')]);return _0x1a4849(_0x1920e2[_0x5da5('0x25')]['message']);}else{logger[_0x5da5('0x20')](_0x5da5('0x21'),_0x4a952a,_0x5da5('0x22'));_0x1a4849(_0x1920e2[_0x5da5('0x28')]['message']);}})['catch'](function(_0x50aadc){logger[_0x5da5('0x25')]('User,\x20%s,\x20%s',_0x4a952a,_0x50aadc);_0x16b11f(_0x50aadc);});});}function respondWithStatusCode(_0x4e8890,_0x1f75f3){_0x1f75f3=_0x1f75f3||0xcc;return function(_0x3974d8){if(_0x3974d8){return _0x4e8890['sendStatus'](_0x1f75f3);}return _0x4e8890[_0x5da5('0x29')](_0x1f75f3)[_0x5da5('0x2a')]();};}function respondWithResult(_0x558b12,_0x3b815e){_0x3b815e=_0x3b815e||0xc8;return function(_0x27de55){if(_0x27de55){return _0x558b12[_0x5da5('0x29')](_0x3b815e)[_0x5da5('0x2b')](_0x27de55);}};}function respondWithFilteredResult(_0x766ed9,_0x5734ce){return function(_0x3ae664){if(_0x3ae664){var _0x2e3c5d=_0x3ae664['count'],_0x31cb5f=_0x5734ce['offset'],_0x15a0c0=_0x5734ce[_0x5da5('0x2c')]+_0x5734ce[_0x5da5('0x2d')],_0x55e2bf;if(_0x15a0c0>=_0x2e3c5d){_0x15a0c0=_0x2e3c5d;_0x55e2bf=0xc8;}else{_0x55e2bf=0xce;}_0x766ed9[_0x5da5('0x29')](_0x55e2bf);return _0x766ed9[_0x5da5('0x2e')]('Content-Range',_0x31cb5f+'-'+_0x15a0c0+'/'+_0x2e3c5d)['json'](_0x3ae664);}return null;};}function patchUpdates(_0x24e115){return function(_0x4afb58){try{jsonpatch['apply'](_0x4afb58,_0x24e115,!![]);}catch(_0x2dd4b6){return BPromise['reject'](_0x2dd4b6);}return _0x4afb58[_0x5da5('0x2f')]();};}function saveUpdates(_0x59fba9,_0x33f138){return function(_0x20475c){if(_0x20475c){return _0x20475c[_0x5da5('0x30')](_0x59fba9)[_0x5da5('0x31')](function(_0x402dae){return _0x402dae;});}return null;};}function removeEntity(_0x3dc66a,_0x52ce3c){return function(_0x231e8c){if(_0x231e8c){return _0x231e8c['destroy']()[_0x5da5('0x31')](function(){var _0xadfcb9=_0x231e8c[_0x5da5('0x32')]({'plain':!![]});var _0x464623=[{'name':_0x5da5('0x33'),'value':_0x5da5('0x34'),'ignore':!![]},{'name':_0x5da5('0x35'),'value':_0x5da5('0x36'),'ignore':![]},{'name':_0x5da5('0x37'),'value':_0x5da5('0x38'),'ignore':![]}];var _0x44f35d=_(_0x464623)[_0x5da5('0x39')](_0x5da5('0x3a'))['map'](_0x5da5('0x3b'))['value']();if(_[_0x5da5('0x3c')](_0x44f35d,_0xadfcb9[_0x5da5('0x3d')])){return;}var _0x29d6aa=_[_0x5da5('0x3e')](_0x464623,['value',_0xadfcb9[_0x5da5('0x3d')]])[_0x5da5('0x3f')];return db[_0x5da5('0x40')]['destroy']({'where':{'type':_0x29d6aa,'resourceId':_0xadfcb9['id']}})[_0x5da5('0x31')](function(){return _0x231e8c;});})[_0x5da5('0x31')](function(){_0x3dc66a['status'](0xcc)[_0x5da5('0x2a')]();});}};}function handleEntityNotFound(_0xa90d5,_0xe9888e){return function(_0x38a974){if(!_0x38a974){_0xa90d5[_0x5da5('0x41')](0x194);}return _0x38a974;};}function handleError(_0x664a8d,_0x52a902){_0x52a902=_0x52a902||0x1f4;return function(_0x1ab02){logger[_0x5da5('0x25')](_0x1ab02[_0x5da5('0x42')]);if(_0x1ab02[_0x5da5('0x3f')]){delete _0x1ab02[_0x5da5('0x3f')];}_0x664a8d['status'](_0x52a902)[_0x5da5('0x43')](_0x1ab02);};}exports[_0x5da5('0x44')]=function(_0x5a189e,_0x38caed){var _0x5643e7={},_0x5121cd={},_0x1da9ef={'count':0x0,'rows':[]};var _0x21c579=db[_0x5da5('0x45')][_0x5da5('0x46')];_0x5121cd[_0x5da5('0x47')]=_[_0x5da5('0x48')](_[_0x5da5('0x49')](_0x21c579),[_0x5da5('0x4a'),_0x5da5('0x4b')]);_0x5121cd[_0x5da5('0x4c')]=_[_0x5da5('0x49')](_0x5a189e[_0x5da5('0x4c')]);_0x5121cd[_0x5da5('0x4d')]=_[_0x5da5('0x4e')](_0x5121cd[_0x5da5('0x47')],_0x5121cd[_0x5da5('0x4c')]);_0x5643e7[_0x5da5('0x4f')]=_[_0x5da5('0x4e')](_0x5121cd[_0x5da5('0x47')],qs[_0x5da5('0x50')](_0x5a189e['query']['fields']));_0x5643e7[_0x5da5('0x4f')]=_0x5643e7[_0x5da5('0x4f')]['length']?_0x5643e7[_0x5da5('0x4f')]:_0x5121cd[_0x5da5('0x47')];if(!_0x5a189e[_0x5da5('0x4c')][_0x5da5('0x51')](_0x5da5('0x52'))){_0x5643e7[_0x5da5('0x2d')]=qs[_0x5da5('0x2d')](_0x5a189e[_0x5da5('0x4c')][_0x5da5('0x2d')]);_0x5643e7[_0x5da5('0x2c')]=qs['offset'](_0x5a189e[_0x5da5('0x4c')]['offset']);}_0x5643e7['order']=qs[_0x5da5('0x53')](_0x5a189e[_0x5da5('0x4c')][_0x5da5('0x53')]);_0x5643e7[_0x5da5('0x54')]=qs[_0x5da5('0x4d')](_[_0x5da5('0x55')](_0x5a189e['query'],_0x5121cd[_0x5da5('0x4d')]));if(_0x5a189e['query']['filter']){_0x5643e7[_0x5da5('0x54')]=_[_0x5da5('0x56')](_0x5643e7['where'],{'$or':_[_0x5da5('0x57')](_0x21c579,function(_0x322b08){if(_0x322b08[_0x5da5('0x58')][_0x5da5('0x59')]!==_0x5da5('0x5a')){return db['sequelize'][_0x5da5('0x54')](db['sequelize']['fn']('lower',db[_0x5da5('0x5b')]['col'](_0x322b08[_0x5da5('0x5c')])),{'$like':db[_0x5da5('0x5b')]['fn'](_0x5da5('0x5d'),'%'+_0x5a189e[_0x5da5('0x4c')][_0x5da5('0x39')]+'%')});}})});}_0x5643e7=_[_0x5da5('0x56')]({},_0x5643e7,_0x5a189e['options']);var _0x5cb8d8={'where':_0x5643e7[_0x5da5('0x54')]};return db[_0x5da5('0x45')]['count'](_0x5cb8d8)['then'](function(_0x13edde){_0x1da9ef['count']=_0x13edde;if(_0x5a189e[_0x5da5('0x4c')]['includeAll']){_0x5643e7['include']=[{'all':!![]}];}return db[_0x5da5('0x45')][_0x5da5('0x5e')](_0x5643e7);})[_0x5da5('0x31')](function(_0x39d428){_0x1da9ef['rows']=_0x39d428;return _0x1da9ef;})[_0x5da5('0x31')](respondWithFilteredResult(_0x38caed,_0x5643e7))[_0x5da5('0x5f')](handleError(_0x38caed,null));};exports[_0x5da5('0x60')]=function(_0x56523b,_0x2c316e){var _0x370178={'raw':![],'where':{'id':_0x56523b[_0x5da5('0x61')]['id']}},_0x311378={};_0x311378[_0x5da5('0x47')]=_[_0x5da5('0x48')](_[_0x5da5('0x49')](db[_0x5da5('0x45')][_0x5da5('0x46')]),[_0x5da5('0x4a'),_0x5da5('0x4b')]);_0x311378[_0x5da5('0x4c')]=_[_0x5da5('0x49')](_0x56523b[_0x5da5('0x4c')]);_0x311378[_0x5da5('0x4d')]=_[_0x5da5('0x4e')](_0x311378[_0x5da5('0x47')],_0x311378[_0x5da5('0x4c')]);_0x370178[_0x5da5('0x4f')]=_[_0x5da5('0x4e')](_0x311378[_0x5da5('0x47')],qs['fields'](_0x56523b[_0x5da5('0x4c')][_0x5da5('0x50')]));_0x370178['attributes']=_0x370178['attributes']['length']?_0x370178[_0x5da5('0x4f')]:_0x311378[_0x5da5('0x47')];if(_0x56523b[_0x5da5('0x4c')]['includeAll']){_0x370178['include']=[{'all':!![]}];}_0x370178=_[_0x5da5('0x56')]({},_0x370178,_0x56523b[_0x5da5('0x62')]);return db[_0x5da5('0x45')][_0x5da5('0x3e')](_0x370178)['then'](handleEntityNotFound(_0x2c316e,null))[_0x5da5('0x31')](respondWithResult(_0x2c316e,null))[_0x5da5('0x5f')](handleError(_0x2c316e,null));};exports[_0x5da5('0x63')]=function(_0x4e4ffa,_0x2d6e0f){return db['User'][_0x5da5('0x63')](_0x4e4ffa[_0x5da5('0x64')],{'raw':![],'individualHooks':!![]})[_0x5da5('0x31')](respondWithResult(_0x2d6e0f,0xc9))[_0x5da5('0x5f')](handleError(_0x2d6e0f,null));};exports[_0x5da5('0x30')]=function(_0x182189,_0xda2325){if(_0x182189[_0x5da5('0x64')]['id']){delete _0x182189[_0x5da5('0x64')]['id'];}delete _0x182189[_0x5da5('0x64')][_0x5da5('0x3d')];return db[_0x5da5('0x45')][_0x5da5('0x3e')]({'where':{'id':_0x182189[_0x5da5('0x61')]['id']}})[_0x5da5('0x31')](handleEntityNotFound(_0xda2325,null))[_0x5da5('0x31')](saveUpdates(_0x182189[_0x5da5('0x64')],null))[_0x5da5('0x31')](respondWithResult(_0xda2325,null))[_0x5da5('0x5f')](handleError(_0xda2325,null));};exports[_0x5da5('0x65')]=function(_0x3de7d7,_0x536236){return db['User'][_0x5da5('0x65')]()[_0x5da5('0x31')](respondWithResult(_0x536236,null))[_0x5da5('0x5f')](handleError(_0x536236,null));};exports['addContacts']=function(_0x2ca7b9,_0x4520ea,_0x43b55e){return db[_0x5da5('0x45')]['find']({'where':{'id':_0x2ca7b9[_0x5da5('0x61')]['id']}})['then'](handleEntityNotFound(_0x4520ea,null))[_0x5da5('0x31')](function(_0x5f862f){if(_0x5f862f){return _0x5f862f[_0x5da5('0x66')](_0x2ca7b9[_0x5da5('0x64')][_0x5da5('0x67')],_[_0x5da5('0x68')](_0x2ca7b9[_0x5da5('0x64')],['ids','id'])||{});}})['then'](respondWithResult(_0x4520ea,null))['catch'](handleError(_0x4520ea,null));};var getLicense=function(_0x100426){return new BPromise(function(_0x446241,_0x2b5cd5){var _0x152b61=0x0;_0x100426[_0x5da5('0x64')][_0x5da5('0x3d')]===_0x5da5('0x36')&&_0x446241(_0x5da5('0x69'));return db['User'][_0x5da5('0x6a')]({'where':{'$or':[{'role':_0x100426[_0x5da5('0x64')]['role']==='telephone'?_0x5da5('0x38'):['admin',_0x5da5('0x34')]}]}})['then'](function(_0x2adeab){_0x152b61=_0x2adeab;return require(_0x5da5('0x6b'))[_0x5da5('0x6c')]();})[_0x5da5('0x31')](function(_0x3724a2){var _0x9f6467=_0x100426[_0x5da5('0x64')][_0x5da5('0x3d')]===_0x5da5('0x38')?_0x5da5('0x6d'):_0x5da5('0x6e');if(!_[_0x5da5('0x6f')](_0x3724a2[_0x9f6467])&&_0x152b61>=_0x3724a2[_0x9f6467]){return _0x2b5cd5({'message':'License\x20limit\x20reached'});}return _0x446241(util['format'](_0x5da5('0x70'),_0x9f6467,_0x152b61));})[_0x5da5('0x5f')](function(_0x34ee4f){return _0x2b5cd5(_0x34ee4f);});});};exports[_0x5da5('0x71')]=function(_0x4ff455,_0x487282){return getLicense(_0x4ff455)['then'](function(_0x243111){if(!_0x4ff455[_0x5da5('0x64')][_0x5da5('0x72')]){var _0x8f66c1;return db[_0x5da5('0x73')][_0x5da5('0x74')](0x1)[_0x5da5('0x31')](function(_0x3c0e6d){return checkPasswordPattern(_0x3c0e6d,_0x4ff455[_0x5da5('0x64')][_0x5da5('0x4a')],_0x3c0e6d[_0x5da5('0x75')]);})[_0x5da5('0x31')](function(_0xcdf5bc){_0x8f66c1=_0xcdf5bc[_0x5da5('0x76')];return db[_0x5da5('0x45')][_0x5da5('0x77')](_0x5da5('0x72'));})[_0x5da5('0x31')](function(_0x362ddc){if(_[_0x5da5('0x6f')](_0x362ddc)){if(_0x8f66c1){_0x4ff455[_0x5da5('0x64')]['internal']=_0x8f66c1;}else{_0x4ff455[_0x5da5('0x64')][_0x5da5('0x72')]=0x1;}}else{if(_[_0x5da5('0x6f')](_0x8f66c1)||_0x8f66c1==_0x362ddc){_0x4ff455[_0x5da5('0x64')]['internal']=_0x362ddc+0x1;}else if(_0x8f66c1>_0x362ddc){_0x4ff455['body'][_0x5da5('0x72')]=_0x8f66c1;}else{return db['sequelize'][_0x5da5('0x4c')](_0x5da5('0x78'),{'type':db[_0x5da5('0x5b')][_0x5da5('0x79')][_0x5da5('0x7a')]})[_0x5da5('0x31')](function(_0xc5894){if(_0xc5894&&_0xc5894[_0x5da5('0x7b')]){for(var _0x3fed81=0x0,_0x50a6d2=_0xc5894[_0x5da5('0x7b')];_0x3fed81<_0x50a6d2&&_['isNil'](_0x4ff455[_0x5da5('0x64')][_0x5da5('0x72')]);_0x3fed81++){if(_0x8f66c1<=_0xc5894[_0x3fed81]['from']){_0x4ff455[_0x5da5('0x64')]['internal']=_0xc5894[_0x3fed81][_0x5da5('0x7c')];}else if(_0x8f66c1>_0xc5894[_0x3fed81]['from']&&_0x8f66c1<=_0xc5894[_0x3fed81]['to']){_0x4ff455[_0x5da5('0x64')][_0x5da5('0x72')]=_0x8f66c1;}}}if(_[_0x5da5('0x6f')](_0x4ff455[_0x5da5('0x64')][_0x5da5('0x72')])){_0x4ff455[_0x5da5('0x64')][_0x5da5('0x72')]=_0x362ddc+0x1;}});}}});}})[_0x5da5('0x31')](function(){if(_0x4ff455[_0x5da5('0x64')]['voicemail']){_0x4ff455[_0x5da5('0x64')][_0x5da5('0x7d')]=_0x4ff455['body']['internal'];_0x4ff455[_0x5da5('0x64')][_0x5da5('0x7e')]={'mailbox':_0x4ff455[_0x5da5('0x64')][_0x5da5('0x72')],'password':_0x4ff455['body'][_0x5da5('0x4a')],'fullname':_0x4ff455['body'][_0x5da5('0x7f')],'email':_0x4ff455['body']['email']};}if(_0x4ff455[_0x5da5('0x64')]&&_0x4ff455['body']['role']===_0x5da5('0x36')){_0x4ff455[_0x5da5('0x64')][_0x5da5('0x80')]=[_0x5da5('0x81'),_0x5da5('0x82'),_0x5da5('0x83'),_0x5da5('0x84'),_0x5da5('0x85'),'105',_0x5da5('0x86'),_0x5da5('0x87'),_0x5da5('0x88'),_0x5da5('0x89'),_0x5da5('0x8a'),_0x5da5('0x8b')];}return db[_0x5da5('0x45')][_0x5da5('0x71')](_0x4ff455[_0x5da5('0x64')],{'include':[{'model':db[_0x5da5('0x7e')],'as':_0x5da5('0x7e')}]});})[_0x5da5('0x31')](function(_0x104ae6){if(_0x4ff455[_0x5da5('0x64')][_0x5da5('0x3d')]===_0x5da5('0x34'))return _0x104ae6;var _0x267c23=_0x4ff455[_0x5da5('0x34')][_0x5da5('0x32')]({'plain':!![]});if(!_0x267c23)throw new Error(_0x5da5('0x8c'));if(_0x267c23[_0x5da5('0x3d')]===_0x5da5('0x34')){var _0x27d704=_0x104ae6[_0x5da5('0x32')]({'plain':!![]});var _0x559ec5=[{'name':_0x5da5('0x35'),'value':_0x5da5('0x36')},{'name':'Telephones','value':_0x5da5('0x38')}];var _0x4f9e25=_[_0x5da5('0x3e')](_0x559ec5,[_0x5da5('0x3b'),_0x27d704[_0x5da5('0x3d')]])[_0x5da5('0x3f')];return db[_0x5da5('0x8d')][_0x5da5('0x3e')]({'where':{'name':_0x4f9e25,'userProfileId':_0x267c23['userProfileId']},'raw':!![]})[_0x5da5('0x31')](function(_0x319490){if(_0x319490&&_0x319490['autoAssociation']===0x0){return db[_0x5da5('0x40')][_0x5da5('0x71')]({'name':_0x27d704['name'],'resourceId':_0x27d704['id'],'type':_0x319490[_0x5da5('0x3f')],'sectionId':_0x319490['id']},{})[_0x5da5('0x31')](function(){return _0x104ae6;});}else{return _0x104ae6;}})[_0x5da5('0x5f')](function(_0x2faa78){logger[_0x5da5('0x25')](_0x5da5('0x8e'),_0x2faa78);throw _0x2faa78;});}return _0x104ae6;})[_0x5da5('0x31')](respondWithResult(_0x487282,0xc9))[_0x5da5('0x5f')](handleError(_0x487282,null));};exports[_0x5da5('0x8f')]=function(_0x2c08a0,_0x4a9d03,_0x449fe0){var _0x2fba9e=![];if(_0x2c08a0[_0x5da5('0x64')]['id']){delete _0x2c08a0[_0x5da5('0x64')]['id'];}if(!_[_0x5da5('0x6f')](_0x2c08a0[_0x5da5('0x64')][_0x5da5('0x90')])){if(_0x2c08a0['body']['oldPassword']===_0x2c08a0[_0x5da5('0x64')]['newPassword']){throw new Error('New\x20password\x20must\x20be\x20different\x20from\x20old\x20one');}}return db[_0x5da5('0x45')]['find']({'where':{'id':_0x2c08a0[_0x5da5('0x61')]['id']}})['then'](function(_0xdc3a74){if(_0xdc3a74){if(_0xdc3a74['id']==_0x2c08a0[_0x5da5('0x34')]['id']){if(!_0x2c08a0[_0x5da5('0x64')][_0x5da5('0x90')]||!_0x2c08a0['body'][_0x5da5('0x91')]){throw new db[(_0x5da5('0x92'))][(_0x5da5('0x93'))](_0x5da5('0x94'));}if(!_0xdc3a74[_0x5da5('0x95')](_0x2c08a0[_0x5da5('0x64')][_0x5da5('0x90')])){throw new db[(_0x5da5('0x92'))]['ValidationError'](_0x5da5('0x96'));}if(_0x2c08a0[_0x5da5('0x64')]['oldPassword']==_0x2c08a0[_0x5da5('0x64')][_0x5da5('0x91')]){throw new db[(_0x5da5('0x92'))][(_0x5da5('0x93'))]('New\x20password\x20must\x20be\x20different\x20from\x20old\x20password');}return _0xdc3a74;}else if(_0x2c08a0['user'][_0x5da5('0x3d')]==_0x5da5('0x97')){if(!_0x2c08a0[_0x5da5('0x64')][_0x5da5('0x91')]){throw new db[(_0x5da5('0x92'))]['ValidationError'](_0x5da5('0x98'));}return _0xdc3a74;}else if(_0x2c08a0[_0x5da5('0x34')][_0x5da5('0x3d')]==_0x5da5('0x34')){if(!_0x2c08a0[_0x5da5('0x64')][_0x5da5('0x91')]){throw new db[(_0x5da5('0x92'))][(_0x5da5('0x93'))](_0x5da5('0x98'));}if(_0xdc3a74[_0x5da5('0x3d')]!=_0x5da5('0x36')){throw new db[(_0x5da5('0x92'))][(_0x5da5('0x93'))](_0x5da5('0x99'));}return _0xdc3a74;}else{throw new db[(_0x5da5('0x92'))][(_0x5da5('0x93'))](_0x5da5('0x99'));}}return null;})[_0x5da5('0x31')](handleEntityNotFound(_0x4a9d03,null))[_0x5da5('0x31')](function(_0x5c73ab){return db[_0x5da5('0x73')]['findOne']({'attributes':['id',_0x5da5('0x75')]})[_0x5da5('0x31')](function(_0x3f6b67){_0x2fba9e=_0x3f6b67[_0x5da5('0x75')];return checkPasswordPattern(_0x5c73ab,_0x2c08a0[_0x5da5('0x64')]['newPassword'],_0x2fba9e);});})[_0x5da5('0x31')](saveUpdates({'password':_0x2c08a0[_0x5da5('0x64')]['newPassword'],'passwordResetAt':_0x2c08a0['user']['id']==_0x2c08a0[_0x5da5('0x61')]['id']?moment():null},null))['then'](respondWithResult(_0x4a9d03,null))[_0x5da5('0x5f')](handleError(_0x4a9d03,null));};exports[_0x5da5('0x9a')]=function(_0x1782a6,_0x1b555f,_0x315e6f){var _0x3611f7=_0x1782a6[_0x5da5('0x64')]['channel'];return db['User']['find']({'where':{'id':_0x1782a6[_0x5da5('0x61')]['id']},'attributes':['id',_0x5da5('0x3f'),_0x5da5('0x3d'),'online',_0x5da5('0x9b'),_0x5da5('0x9c'),_0x5da5('0x9d')]})[_0x5da5('0x31')](handleEntityNotFound(_0x1b555f,null))[_0x5da5('0x31')](function(_0xd56fa3){if(_0xd56fa3){if(!utils['isValidChannel'](_0x3611f7)){throw new db[(_0x5da5('0x92'))][(_0x5da5('0x93'))](_0x5da5('0x9e'));}return _0xd56fa3['add'+_['capitalize'](_0x3611f7[_0x5da5('0x9f')]())+_0x5da5('0xa0')](_0x1782a6['body'][_0x5da5('0x67')],{'penalty':_0x1782a6[_0x5da5('0x64')]['penalty']||0x0})[_0x5da5('0xa1')](function(_0x499d6a){for(var _0x4f68f5=0x0;_0x4f68f5<_0x1782a6[_0x5da5('0x64')]['ids'][_0x5da5('0x7b')];_0x4f68f5+=0x1){var _0x5a9191={'UserId':_0x1782a6[_0x5da5('0x61')]['id']};_0x5a9191[_[_0x5da5('0xa2')](_0x3611f7['toLowerCase']())+_0x5da5('0xa3')]=_0x1782a6[_0x5da5('0x64')][_0x5da5('0x67')][_0x4f68f5];socket[_0x5da5('0xa4')]('user'+_['capitalize'](_0x3611f7[_0x5da5('0x9f')]())+_0x5da5('0xa5'),_0x5a9191);}return _0x499d6a;})[_0x5da5('0x31')](function(){if(_0x3611f7===_0x5da5('0xa6')){return db[_0x5da5('0xa7')][_0x5da5('0x5e')]({'where':{'id':_0x1782a6['body'][_0x5da5('0x67')]||[]},'raw':!![],'attributes':['id',_0x5da5('0x3f')]});}})[_0x5da5('0x31')](function(_0x29dc0a){var _0x502d47=_0xd56fa3['get']({'plain':!![]});var _0x35fdce=[];if(_0x3611f7===_0x5da5('0xa6')&&_0x502d47[_0x5da5('0x3d')]==='agent'&&_0x502d47['online']){for(var _0x112569=0x0;_0x112569<_0x29dc0a[_0x5da5('0x7b')];_0x112569+=0x1){_0x35fdce[_0x5da5('0xa8')]({'membername':_0x502d47[_0x5da5('0x3f')],'UserId':_0x502d47['id'],'queue_name':_0x29dc0a[_0x112569]['name'],'VoiceQueueId':_0x29dc0a[_0x112569]['id'],'interface':_['isNil'](_0x502d47['interface'])?util[_0x5da5('0xa9')]('SIP/%s',_0x502d47[_0x5da5('0x3f')]):_0x502d47[_0x5da5('0x9d')],'paused':_0x502d47[_0x5da5('0x9c')]||![],'penalty':_0x1782a6[_0x5da5('0x64')][_0x5da5('0xaa')]||0x0});}return BPromise[_0x5da5('0xab')](_0x35fdce,function(_0x480e3c){return db[_0x5da5('0xac')][_0x5da5('0xad')](_0x480e3c);});}return _0xd56fa3;});}})[_0x5da5('0x31')](respondWithStatusCode(_0x1b555f,null))[_0x5da5('0x5f')](handleError(_0x1b555f,null));};exports[_0x5da5('0xae')]=function(_0x5551b9,_0x3c4952,_0x3141a0){var _0x59e663;return db[_0x5da5('0x45')][_0x5da5('0x3e')]({'where':{'id':_0x5551b9[_0x5da5('0x61')]['id']},'attributes':['id',_0x5da5('0x3f'),_0x5da5('0x3d')]})[_0x5da5('0x31')](handleEntityNotFound(_0x3c4952,null))[_0x5da5('0x31')](function(_0x2daf1d){if(_0x2daf1d){_0x59e663=_0x2daf1d;if(!_0x5551b9[_0x5da5('0x4c')][_0x5da5('0xaf')]||!utils['isValidChannel'](_0x5551b9[_0x5da5('0x4c')][_0x5da5('0xaf')])){throw new db[(_0x5da5('0x92'))]['ValidationError'](_0x5da5('0x9e'));}return _0x2daf1d['remove'+_['capitalize'](_0x5551b9['query'][_0x5da5('0xaf')][_0x5da5('0x9f')]())+_0x5da5('0xa0')](_0x5551b9[_0x5da5('0x4c')]['ids']);}})[_0x5da5('0x31')](function(_0x280477){for(var _0x2b810d=0x0;_0x2b810d<_0x5551b9[_0x5da5('0x4c')][_0x5da5('0x67')][_0x5da5('0x7b')];_0x2b810d+=0x1){var _0x1c3cb0={'UserId':_0x5551b9['params']['id']};_0x1c3cb0[_[_0x5da5('0xa2')](_0x5551b9[_0x5da5('0x4c')][_0x5da5('0xaf')][_0x5da5('0x9f')]())+'QueueId']=_0x5551b9[_0x5da5('0x4c')][_0x5da5('0x67')][_0x2b810d];socket['emit'](_0x5da5('0x34')+_[_0x5da5('0xa2')](_0x5551b9[_0x5da5('0x4c')][_0x5da5('0xaf')]['toLowerCase']())+'Queue:remove',_0x1c3cb0);}return _0x280477;})[_0x5da5('0x31')](function(){if(_0x5551b9[_0x5da5('0x4c')][_0x5da5('0xaf')]==='voice'){return db[_0x5da5('0xac')]['destroy']({'where':{'UserId':_0x5551b9['params']['id'],'VoiceQueueId':_0x5551b9[_0x5da5('0x4c')][_0x5da5('0x67')]},'individualHooks':!![]})[_0x5da5('0x31')](function(){return _0x59e663;});}return _0x59e663;})['then'](respondWithStatusCode(_0x3c4952,null))[_0x5da5('0x5f')](handleError(_0x3c4952,null));};exports['addAvatar']=function(_0x56de9a,_0x1588e8,_0x2397d4){_0x56de9a[_0x5da5('0x64')]['userpic']=_0x56de9a['file'][_0x5da5('0xb0')];return db[_0x5da5('0x45')]['find']({'where':{'id':_0x56de9a['params']['id']}})[_0x5da5('0x31')](handleEntityNotFound(_0x1588e8,null))['then'](saveUpdates(_0x56de9a[_0x5da5('0x64')],null))[_0x5da5('0x31')](respondWithResult(_0x1588e8,null))[_0x5da5('0x5f')](handleError(_0x1588e8,null));};exports[_0x5da5('0xb1')]=function(_0x144252,_0x39f85d,_0x4814d5){var _0x17c226=path[_0x5da5('0xb2')](config[_0x5da5('0xb3')],_0x5da5('0xb4'));return db[_0x5da5('0x45')][_0x5da5('0x3e')]({'where':{'id':_0x144252[_0x5da5('0x61')]['id']},'attributes':['id','userpic'],'raw':!![]})['then'](handleEntityNotFound(_0x39f85d,null))[_0x5da5('0x31')](function(_0x36750c){if(_0x36750c){if(_[_0x5da5('0x6f')](_0x36750c[_0x5da5('0xb5')])){return _0x39f85d[_0x5da5('0xb6')](_0x17c226);}else{if(!fs['existsSync'](path[_0x5da5('0xb2')](config[_0x5da5('0xb3')],_0x5da5('0xb7'),_0x36750c['userpic']))){return _0x39f85d[_0x5da5('0xb6')](_0x17c226);}return _0x39f85d[_0x5da5('0xb6')](path[_0x5da5('0xb2')](config[_0x5da5('0xb3')],_0x5da5('0xb7'),_0x36750c[_0x5da5('0xb5')]));}}})[_0x5da5('0x5f')](handleError(_0x39f85d,null));};exports[_0x5da5('0xb8')]=function(_0x443e9b,_0xaa8cec,_0x32d41d){var _0x5ca3f9={};var _0x28ae91={};var _0x327593;var _0x1bb705;return db['User'][_0x5da5('0xb9')]({'where':{'id':_0x443e9b['params']['id']}})[_0x5da5('0x31')](handleEntityNotFound(_0xaa8cec,null))[_0x5da5('0x31')](function(_0x841bca){if(_0x841bca){_0x327593=_0x841bca;_0x28ae91['model']=_['keys'](db[_0x5da5('0xba')][_0x5da5('0x46')]);_0x28ae91[_0x5da5('0x4c')]=_[_0x5da5('0x49')](_0x443e9b[_0x5da5('0x4c')]);_0x28ae91[_0x5da5('0x4d')]=_['intersection'](_0x28ae91[_0x5da5('0x47')],_0x28ae91['query']);_0x5ca3f9[_0x5da5('0x4f')]=_[_0x5da5('0x4e')](_0x28ae91[_0x5da5('0x47')],qs['fields'](_0x443e9b['query'][_0x5da5('0x50')]));_0x5ca3f9[_0x5da5('0x4f')]=_0x5ca3f9[_0x5da5('0x4f')][_0x5da5('0x7b')]?_0x5ca3f9[_0x5da5('0x4f')]:_0x28ae91['model'];_0x5ca3f9['order']=qs[_0x5da5('0x53')](_0x443e9b['query'][_0x5da5('0x53')]);_0x5ca3f9[_0x5da5('0x54')]=qs[_0x5da5('0x4d')](_[_0x5da5('0x55')](_0x443e9b[_0x5da5('0x4c')],_0x28ae91[_0x5da5('0x4d')]));if(_0x443e9b[_0x5da5('0x4c')]['filter']){_0x5ca3f9[_0x5da5('0x54')]=_[_0x5da5('0x56')](_0x5ca3f9[_0x5da5('0x54')],{'$or':_[_0x5da5('0x57')](_0x5ca3f9[_0x5da5('0x4f')],function(_0x5835e1){var _0xf58af0={};_0xf58af0[_0x5835e1]={'$like':'%'+_0x443e9b[_0x5da5('0x4c')][_0x5da5('0x39')]+'%'};return _0xf58af0;})});}_0x5ca3f9=_[_0x5da5('0x56')]({},_0x5ca3f9,_0x443e9b[_0x5da5('0x62')]);return _0x327593['getContacts'](_0x5ca3f9);}})[_0x5da5('0x31')](function(_0x2b0d5){if(_0x2b0d5){_0x1bb705=_0x2b0d5['length'];if(_0x443e9b['query']['hasOwnProperty'](_0x5da5('0xbb'))){_0x5ca3f9[_0x5da5('0xbc')]=[{'model':db[_0x5da5('0xbd')],'as':'List','required':![]},{'model':db[_0x5da5('0xbe')],'as':_0x5da5('0xbf'),'attributes':['id','name',_0x5da5('0xc0')],'where':_0x443e9b[_0x5da5('0x4c')][_0x5da5('0xc1')]?{'id':_0x443e9b[_0x5da5('0x4c')]['tag']}:undefined,'required':_0x443e9b[_0x5da5('0x4c')]['tag']?!![]:![]}];}if(!_0x443e9b[_0x5da5('0x4c')][_0x5da5('0x51')]('nolimit')){_0x5ca3f9[_0x5da5('0x2d')]=qs[_0x5da5('0x2d')](_0x443e9b[_0x5da5('0x4c')][_0x5da5('0x2d')]);_0x5ca3f9[_0x5da5('0x2c')]=qs[_0x5da5('0x2c')](_0x443e9b[_0x5da5('0x4c')][_0x5da5('0x2c')]);}return _0x327593[_0x5da5('0xb8')](_0x5ca3f9);}})[_0x5da5('0x31')](function(_0x1c3d57){if(_0x1c3d57){return _0x1c3d57?{'count':_0x1bb705,'rows':_0x1c3d57}:null;}})[_0x5da5('0x31')](respondWithResult(_0xaa8cec,null))[_0x5da5('0x5f')](handleError(_0xaa8cec,null));};exports[_0x5da5('0xc2')]=function(_0x14ce87,_0x1e6621,_0x3ef660){var _0x22cbb3;var _0x3bc61a;var _0x2098c2={};var _0x169b96;return db[_0x5da5('0x45')][_0x5da5('0xb9')]({'where':{'id':_0x14ce87[_0x5da5('0x61')]['id']},'attributes':['id',_0x5da5('0x3f'),_0x5da5('0x3d')]})[_0x5da5('0x31')](handleEntityNotFound(_0x1e6621,null))[_0x5da5('0x31')](function(_0xafe658){if(!utils[_0x5da5('0xc3')](_0x14ce87[_0x5da5('0x4c')][_0x5da5('0xaf')])){throw new db[(_0x5da5('0x92'))][(_0x5da5('0x93'))](_0x5da5('0x9e'));}_0x22cbb3=_0xafe658;var _0x231009={};_0x231009[_0x5da5('0x47')]=_[_0x5da5('0x49')](db[_[_0x5da5('0xa2')](_0x14ce87[_0x5da5('0x4c')]['channel'])+'Queue'][_0x5da5('0x46')]);_0x231009[_0x5da5('0x4c')]=_['keys'](_0x14ce87['query']);_0x231009[_0x5da5('0x4d')]=_[_0x5da5('0x4e')](_0x231009[_0x5da5('0x47')],_0x231009[_0x5da5('0x4c')]);_0x2098c2[_0x5da5('0x4f')]=_[_0x5da5('0x4e')](_0x231009[_0x5da5('0x47')],qs['fields'](_0x14ce87[_0x5da5('0x4c')][_0x5da5('0x50')]));_0x2098c2[_0x5da5('0x4f')]=_0x2098c2[_0x5da5('0x4f')][_0x5da5('0x7b')]?_0x2098c2['attributes']:_0x231009['model'];_0x2098c2[_0x5da5('0xc4')]=qs[_0x5da5('0x53')](_0x14ce87['query']['sort']);_0x2098c2[_0x5da5('0x54')]=qs[_0x5da5('0x4d')](_[_0x5da5('0x55')](_0x14ce87['query'],_0x231009[_0x5da5('0x4d')]));if(_0x14ce87[_0x5da5('0x4c')]['filter']){_0x2098c2['where']=_[_0x5da5('0x56')](_0x2098c2[_0x5da5('0x54')],{'$or':_[_0x5da5('0x57')](_0x2098c2[_0x5da5('0x4f')],function(_0x23ebee){var _0x3cfacf={};_0x3cfacf[_0x23ebee]={'$like':'%'+_0x14ce87[_0x5da5('0x4c')]['filter']+'%'};return _0x3cfacf;})});}_0x2098c2=_[_0x5da5('0x56')]({},_0x2098c2,_0x14ce87['options']);switch(_0x22cbb3[_0x5da5('0x3d')]){case _0x5da5('0x97'):return db[_[_0x5da5('0xa2')](_0x14ce87[_0x5da5('0x4c')][_0x5da5('0xaf')])+_0x5da5('0xc5')][_0x5da5('0x5e')](_0x2098c2);case _0x5da5('0x34'):case _0x5da5('0x36'):return _0x22cbb3[_0x5da5('0x32')+_[_0x5da5('0xa2')](_0x14ce87['query'][_0x5da5('0xaf')])+_0x5da5('0xa0')](_0x2098c2);default:throw new db[(_0x5da5('0x92'))]['ValidationError'](_0x5da5('0xc6'));}})[_0x5da5('0x31')](function(_0x3a75c4){_0x169b96=_0x3a75c4[_0x5da5('0x7b')];if(!_0x14ce87[_0x5da5('0x4c')][_0x5da5('0x51')](_0x5da5('0x52'))){_0x2098c2['limit']=qs['limit'](_0x14ce87[_0x5da5('0x4c')][_0x5da5('0x2d')]);_0x2098c2[_0x5da5('0x2c')]=qs[_0x5da5('0x2c')](_0x14ce87['query'][_0x5da5('0x2c')]);}switch(_0x22cbb3[_0x5da5('0x3d')]){case'admin':return db[_[_0x5da5('0xa2')](_0x14ce87[_0x5da5('0x4c')][_0x5da5('0xaf')])+'Queue'][_0x5da5('0x5e')](_0x2098c2);case _0x5da5('0x34'):case'agent':return _0x22cbb3[_0x5da5('0x32')+_[_0x5da5('0xa2')](_0x14ce87[_0x5da5('0x4c')][_0x5da5('0xaf')])+_0x5da5('0xa0')](_0x2098c2);}})['then'](function(_0x13b785){return{'count':_0x169b96,'rows':_0x13b785};})[_0x5da5('0x31')](respondWithResult(_0x1e6621,null))[_0x5da5('0x5f')](handleError(_0x1e6621,null));};exports[_0x5da5('0xc7')]=function(_0xe318d2,_0x392bf7,_0x283982){var _0x5471f2={};var _0x497e5f={};var _0x55b42a;var _0x3b4b3e;return db[_0x5da5('0x45')]['findOne']({'where':{'id':_0xe318d2[_0x5da5('0x61')]['id']}})['then'](handleEntityNotFound(_0x392bf7,null))['then'](function(_0x24b616){if(_0x24b616){_0x55b42a=_0x24b616;_0x497e5f['model']=_[_0x5da5('0x49')](db['UserVoiceQueueRt'][_0x5da5('0x46')]);_0x497e5f[_0x5da5('0x4c')]=_['keys'](_0xe318d2[_0x5da5('0x4c')]);_0x497e5f[_0x5da5('0x4d')]=_[_0x5da5('0x4e')](_0x497e5f[_0x5da5('0x47')],_0x497e5f[_0x5da5('0x4c')]);_0x5471f2[_0x5da5('0x4f')]=_['intersection'](_0x497e5f['model'],qs[_0x5da5('0x50')](_0xe318d2[_0x5da5('0x4c')]['fields']));_0x5471f2[_0x5da5('0x4f')]=_0x5471f2[_0x5da5('0x4f')][_0x5da5('0x7b')]?_0x5471f2['attributes']:_0x497e5f['model'];_0x5471f2['order']=qs[_0x5da5('0x53')](_0xe318d2[_0x5da5('0x4c')][_0x5da5('0x53')]);_0x5471f2[_0x5da5('0x54')]=qs['filters'](_[_0x5da5('0x55')](_0xe318d2[_0x5da5('0x4c')],_0x497e5f[_0x5da5('0x4d')]));if(_0xe318d2[_0x5da5('0x4c')]['filter']){_0x5471f2['where']=_[_0x5da5('0x56')](_0x5471f2[_0x5da5('0x54')],{'$or':_[_0x5da5('0x57')](_0x5471f2['attributes'],function(_0x179f00){var _0x207fb7={};_0x207fb7[_0x179f00]={'$like':'%'+_0xe318d2['query']['filter']+'%'};return _0x207fb7;})});}_0x5471f2=_[_0x5da5('0x56')]({},_0x5471f2,_0xe318d2['options']);return _0x55b42a[_0x5da5('0xc7')](_0x5471f2);}})[_0x5da5('0x31')](function(_0x2a0837){if(_0x2a0837){_0x3b4b3e=_0x2a0837[_0x5da5('0x7b')];if(!_0xe318d2['query']['hasOwnProperty'](_0x5da5('0x52'))){_0x5471f2[_0x5da5('0x2d')]=qs[_0x5da5('0x2d')](_0xe318d2[_0x5da5('0x4c')][_0x5da5('0x2d')]);_0x5471f2[_0x5da5('0x2c')]=qs[_0x5da5('0x2c')](_0xe318d2[_0x5da5('0x4c')]['offset']);}return _0x55b42a[_0x5da5('0xc7')](_0x5471f2);}})[_0x5da5('0x31')](function(_0x496346){if(_0x496346){return _0x496346?{'count':_0x3b4b3e,'rows':_0x496346}:null;}})['then'](respondWithResult(_0x392bf7,null))[_0x5da5('0x5f')](handleError(_0x392bf7,null));};exports[_0x5da5('0xc8')]=function(_0x5d36fb,_0x663647,_0x4635ed){var _0x596d96={};var _0x104190={};var _0x5d5819;var _0x2c9378;return db[_0x5da5('0x45')][_0x5da5('0xb9')]({'where':{'id':_0x5d36fb[_0x5da5('0x61')]['id']}})['then'](handleEntityNotFound(_0x663647,null))[_0x5da5('0x31')](function(_0x435c64){if(_0x435c64){_0x5d5819=_0x435c64;_0x104190[_0x5da5('0x47')]=_[_0x5da5('0x49')](db['ChatGroup'][_0x5da5('0x46')]);_0x104190[_0x5da5('0x4c')]=_['keys'](_0x5d36fb[_0x5da5('0x4c')]);_0x104190[_0x5da5('0x4d')]=_[_0x5da5('0x4e')](_0x104190[_0x5da5('0x47')],_0x104190[_0x5da5('0x4c')]);_0x596d96[_0x5da5('0x4f')]=_[_0x5da5('0x4e')](_0x104190[_0x5da5('0x47')],qs[_0x5da5('0x50')](_0x5d36fb[_0x5da5('0x4c')][_0x5da5('0x50')]));_0x596d96[_0x5da5('0x4f')]=_0x596d96[_0x5da5('0x4f')]['length']?_0x596d96['attributes']:_0x104190['model'];_0x596d96['order']=qs[_0x5da5('0x53')](_0x5d36fb[_0x5da5('0x4c')]['sort']);_0x596d96['where']=qs[_0x5da5('0x4d')](_['pick'](_0x5d36fb[_0x5da5('0x4c')],_0x104190[_0x5da5('0x4d')]));if(_0x5d36fb['query'][_0x5da5('0x39')]){_0x596d96['where']=_[_0x5da5('0x56')](_0x596d96[_0x5da5('0x54')],{'$or':_[_0x5da5('0x57')](_0x596d96['attributes'],function(_0x4cd9f4){var _0x2a59ea={};_0x2a59ea[_0x4cd9f4]={'$like':'%'+_0x5d36fb[_0x5da5('0x4c')][_0x5da5('0x39')]+'%'};return _0x2a59ea;})});}_0x596d96=_[_0x5da5('0x56')]({},_0x596d96,_0x5d36fb[_0x5da5('0x62')]);return _0x5d5819[_0x5da5('0xc8')](_0x596d96);}})[_0x5da5('0x31')](function(_0x2057e6){if(_0x2057e6){_0x2c9378=_0x2057e6[_0x5da5('0x7b')];if(!_0x5d36fb[_0x5da5('0x4c')]['hasOwnProperty'](_0x5da5('0x52'))){_0x596d96[_0x5da5('0x2d')]=qs[_0x5da5('0x2d')](_0x5d36fb['query'][_0x5da5('0x2d')]);_0x596d96[_0x5da5('0x2c')]=qs['offset'](_0x5d36fb[_0x5da5('0x4c')]['offset']);}return _0x5d5819[_0x5da5('0xc8')](_0x596d96);}})[_0x5da5('0x31')](function(_0x3378aa){if(_0x3378aa){return _0x3378aa?{'count':_0x2c9378,'rows':_0x3378aa}:null;}})[_0x5da5('0x31')](respondWithResult(_0x663647,null))[_0x5da5('0x5f')](handleError(_0x663647,null));};exports[_0x5da5('0xc9')]=function(_0x566973,_0x587502,_0x2b1cb2){var _0x306cf8={'raw':!![],'where':{}};var _0x53f8b5={};var _0x99b8b7={'count':0x0,'rows':[]};return db[_0x5da5('0x45')][_0x5da5('0xb9')]({'where':{'id':_0x566973['params']['id']}})[_0x5da5('0x31')](handleEntityNotFound(_0x587502,null))['then'](function(_0x54df1a){if(_0x54df1a){_0x53f8b5[_0x5da5('0x47')]=_[_0x5da5('0x49')](db['VoiceRecording'][_0x5da5('0x46')]);_0x53f8b5['query']=_[_0x5da5('0x49')](_0x566973[_0x5da5('0x4c')]);_0x53f8b5[_0x5da5('0x4d')]=_[_0x5da5('0x4e')](_0x53f8b5['model'],_0x53f8b5[_0x5da5('0x4c')]);_0x306cf8[_0x5da5('0x4f')]=_[_0x5da5('0x4e')](_0x53f8b5[_0x5da5('0x47')],qs[_0x5da5('0x50')](_0x566973['query'][_0x5da5('0x50')]));_0x306cf8[_0x5da5('0x4f')]=_0x306cf8[_0x5da5('0x4f')][_0x5da5('0x7b')]?_0x306cf8[_0x5da5('0x4f')]:_0x53f8b5['model'];if(!_0x566973[_0x5da5('0x4c')]['hasOwnProperty']('nolimit')){_0x306cf8[_0x5da5('0x2d')]=qs['limit'](_0x566973[_0x5da5('0x4c')][_0x5da5('0x2d')]);_0x306cf8[_0x5da5('0x2c')]=qs[_0x5da5('0x2c')](_0x566973[_0x5da5('0x4c')][_0x5da5('0x2c')]);}_0x306cf8[_0x5da5('0xc4')]=qs[_0x5da5('0x53')](_0x566973[_0x5da5('0x4c')][_0x5da5('0x53')]);_0x306cf8[_0x5da5('0x54')]=qs[_0x5da5('0x4d')](_[_0x5da5('0x55')](_0x566973['query'],_0x53f8b5['filters']));_0x306cf8['where'][_0x5da5('0xca')]=_0x54df1a['id'];if(_0x566973[_0x5da5('0x4c')][_0x5da5('0x39')]){_0x306cf8[_0x5da5('0x54')]=_[_0x5da5('0x56')](_0x306cf8['where'],{'$or':_[_0x5da5('0x57')](_0x306cf8[_0x5da5('0x4f')],function(_0x221326){var _0x41805a={};_0x41805a[_0x221326]={'$like':'%'+_0x566973[_0x5da5('0x4c')]['filter']+'%'};return _0x41805a;})});}_0x306cf8=_[_0x5da5('0x56')]({},_0x306cf8,_0x566973[_0x5da5('0x62')]);return db[_0x5da5('0xcb')][_0x5da5('0x6a')]({'where':_0x306cf8['where']})[_0x5da5('0x31')](function(_0x37e8ee){_0x99b8b7[_0x5da5('0x6a')]=_0x37e8ee;if(_0x566973[_0x5da5('0x4c')]['includeAll']){_0x306cf8[_0x5da5('0xbc')]=[{'all':!![]}];}return db[_0x5da5('0xcb')]['findAll'](_0x306cf8);})[_0x5da5('0x31')](function(_0x253aec){_0x99b8b7[_0x5da5('0xcc')]=_0x253aec;return _0x99b8b7;});}})[_0x5da5('0x31')](respondWithFilteredResult(_0x587502,_0x306cf8))['catch'](handleError(_0x587502,null));};exports[_0x5da5('0xcd')]=function(_0x29c8a0,_0x3e2619,_0x19f718){var _0x3d8708={'raw':!![],'where':{}};var _0x45b4c6={};var _0x10e296={'count':0x0,'rows':[]};return db[_0x5da5('0x45')][_0x5da5('0xb9')]({'where':{'id':_0x29c8a0[_0x5da5('0x61')]['id']}})[_0x5da5('0x31')](handleEntityNotFound(_0x3e2619,null))[_0x5da5('0x31')](function(_0x3b8ea7){if(_0x3b8ea7){_0x45b4c6['model']=_[_0x5da5('0x49')](db[_0x5da5('0xce')][_0x5da5('0x46')]);_0x45b4c6[_0x5da5('0x4c')]=_[_0x5da5('0x49')](_0x29c8a0[_0x5da5('0x4c')]);_0x45b4c6[_0x5da5('0x4d')]=_[_0x5da5('0x4e')](_0x45b4c6[_0x5da5('0x47')],_0x45b4c6[_0x5da5('0x4c')]);_0x3d8708[_0x5da5('0x4f')]=_[_0x5da5('0x4e')](_0x45b4c6[_0x5da5('0x47')],qs[_0x5da5('0x50')](_0x29c8a0[_0x5da5('0x4c')][_0x5da5('0x50')]));_0x3d8708[_0x5da5('0x4f')]=_0x3d8708[_0x5da5('0x4f')][_0x5da5('0x7b')]?_0x3d8708[_0x5da5('0x4f')]:_0x45b4c6[_0x5da5('0x47')];if(!_0x29c8a0[_0x5da5('0x4c')][_0x5da5('0x51')](_0x5da5('0x52'))){_0x3d8708[_0x5da5('0x2d')]=qs[_0x5da5('0x2d')](_0x29c8a0[_0x5da5('0x4c')][_0x5da5('0x2d')]);_0x3d8708[_0x5da5('0x2c')]=qs[_0x5da5('0x2c')](_0x29c8a0['query'][_0x5da5('0x2c')]);}_0x3d8708[_0x5da5('0xc4')]=qs[_0x5da5('0x53')](_0x29c8a0['query'][_0x5da5('0x53')]);_0x3d8708[_0x5da5('0x54')]=qs[_0x5da5('0x4d')](_['pick'](_0x29c8a0[_0x5da5('0x4c')],_0x45b4c6[_0x5da5('0x4d')]));_0x3d8708[_0x5da5('0x54')][_0x5da5('0xca')]=_0x3b8ea7['id'];if(_0x29c8a0[_0x5da5('0x4c')][_0x5da5('0x39')]){_0x3d8708[_0x5da5('0x54')]=_[_0x5da5('0x56')](_0x3d8708[_0x5da5('0x54')],{'$or':_['map'](_0x3d8708[_0x5da5('0x4f')],function(_0xf5525f){var _0x1680e1={};_0x1680e1[_0xf5525f]={'$like':'%'+_0x29c8a0[_0x5da5('0x4c')]['filter']+'%'};return _0x1680e1;})});}_0x3d8708=_[_0x5da5('0x56')]({},_0x3d8708,_0x29c8a0[_0x5da5('0x62')]);return db[_0x5da5('0xce')][_0x5da5('0x6a')]({'where':_0x3d8708[_0x5da5('0x54')]})[_0x5da5('0x31')](function(_0x5acd12){_0x10e296['count']=_0x5acd12;if(_0x29c8a0[_0x5da5('0x4c')][_0x5da5('0xbb')]){_0x3d8708[_0x5da5('0xbc')]=[{'all':!![]}];}return db['ScreenRecording'][_0x5da5('0x5e')](_0x3d8708);})[_0x5da5('0x31')](function(_0x8c75fe){_0x10e296[_0x5da5('0xcc')]=_0x8c75fe;return _0x10e296;});}})[_0x5da5('0x31')](respondWithFilteredResult(_0x3e2619,_0x3d8708))[_0x5da5('0x5f')](handleError(_0x3e2619,null));};exports[_0x5da5('0xcf')]=function(_0x3f246e,_0x1d40fa,_0x281f2e){var _0x2e1ebb={};var _0x2cbc77={};var _0x334447;var _0x1a3bdd;return db[_0x5da5('0x45')]['findOne']({'where':{'id':_0x3f246e[_0x5da5('0x61')]['id']}})[_0x5da5('0x31')](handleEntityNotFound(_0x1d40fa,null))[_0x5da5('0x31')](function(_0x3ec6d0){if(_0x3ec6d0){_0x334447=_0x3ec6d0;_0x2cbc77['model']=_[_0x5da5('0x49')](db[_0x5da5('0xd0')][_0x5da5('0x46')]);_0x2cbc77['query']=_[_0x5da5('0x49')](_0x3f246e[_0x5da5('0x4c')]);_0x2cbc77[_0x5da5('0x4d')]=_['intersection'](_0x2cbc77[_0x5da5('0x47')],_0x2cbc77['query']);_0x2e1ebb[_0x5da5('0x4f')]=_[_0x5da5('0x4e')](_0x2cbc77[_0x5da5('0x47')],qs[_0x5da5('0x50')](_0x3f246e['query'][_0x5da5('0x50')]));_0x2e1ebb[_0x5da5('0x4f')]=_0x2e1ebb['attributes'][_0x5da5('0x7b')]?_0x2e1ebb[_0x5da5('0x4f')]:_0x2cbc77[_0x5da5('0x47')];_0x2e1ebb[_0x5da5('0xc4')]=qs[_0x5da5('0x53')](_0x3f246e[_0x5da5('0x4c')][_0x5da5('0x53')]);_0x2e1ebb[_0x5da5('0x54')]=qs[_0x5da5('0x4d')](_[_0x5da5('0x55')](_0x3f246e['query'],_0x2cbc77[_0x5da5('0x4d')]));if(_0x3f246e[_0x5da5('0x4c')]['filter']){_0x2e1ebb[_0x5da5('0x54')]=_[_0x5da5('0x56')](_0x2e1ebb[_0x5da5('0x54')],{'$or':_[_0x5da5('0x57')](_0x2e1ebb['attributes'],function(_0x106a55){var _0x5a99a7={};_0x5a99a7[_0x106a55]={'$like':'%'+_0x3f246e[_0x5da5('0x4c')]['filter']+'%'};return _0x5a99a7;})});}_0x2e1ebb=_[_0x5da5('0x56')]({},_0x2e1ebb,_0x3f246e[_0x5da5('0x62')]);return _0x334447['getChatInteractions'](_0x2e1ebb);}})[_0x5da5('0x31')](function(_0x4c13d8){if(_0x4c13d8){_0x1a3bdd=_0x4c13d8[_0x5da5('0x7b')];if(!_0x3f246e['query'][_0x5da5('0x51')]('nolimit')){_0x2e1ebb['limit']=qs[_0x5da5('0x2d')](_0x3f246e[_0x5da5('0x4c')][_0x5da5('0x2d')]);_0x2e1ebb[_0x5da5('0x2c')]=qs[_0x5da5('0x2c')](_0x3f246e[_0x5da5('0x4c')][_0x5da5('0x2c')]);}return _0x334447[_0x5da5('0xcf')](_0x2e1ebb);}})[_0x5da5('0x31')](function(_0x1560a5){if(_0x1560a5){return _0x1560a5?{'count':_0x1a3bdd,'rows':_0x1560a5}:null;}})[_0x5da5('0x31')](respondWithResult(_0x1d40fa,null))[_0x5da5('0x5f')](handleError(_0x1d40fa,null));};exports['getOpenchannelInteractions']=function(_0x5bb2be,_0x376693,_0x575cc0){var _0x2091f5={};var _0xd44a41={};var _0x349d71;var _0x1d7a07;return db[_0x5da5('0x45')][_0x5da5('0xb9')]({'where':{'id':_0x5bb2be[_0x5da5('0x61')]['id']}})[_0x5da5('0x31')](handleEntityNotFound(_0x376693,null))[_0x5da5('0x31')](function(_0x1ef9ec){if(_0x1ef9ec){_0x349d71=_0x1ef9ec;_0xd44a41[_0x5da5('0x47')]=_[_0x5da5('0x49')](db[_0x5da5('0xd1')]['rawAttributes']);_0xd44a41[_0x5da5('0x4c')]=_[_0x5da5('0x49')](_0x5bb2be['query']);_0xd44a41['filters']=_['intersection'](_0xd44a41['model'],_0xd44a41[_0x5da5('0x4c')]);_0x2091f5[_0x5da5('0x4f')]=_[_0x5da5('0x4e')](_0xd44a41[_0x5da5('0x47')],qs['fields'](_0x5bb2be[_0x5da5('0x4c')][_0x5da5('0x50')]));_0x2091f5[_0x5da5('0x4f')]=_0x2091f5[_0x5da5('0x4f')][_0x5da5('0x7b')]?_0x2091f5['attributes']:_0xd44a41['model'];_0x2091f5[_0x5da5('0xc4')]=qs[_0x5da5('0x53')](_0x5bb2be['query'][_0x5da5('0x53')]);_0x2091f5[_0x5da5('0x54')]=qs[_0x5da5('0x4d')](_['pick'](_0x5bb2be[_0x5da5('0x4c')],_0xd44a41[_0x5da5('0x4d')]));if(_0x5bb2be['query'][_0x5da5('0x39')]){_0x2091f5['where']=_['merge'](_0x2091f5[_0x5da5('0x54')],{'$or':_[_0x5da5('0x57')](_0x2091f5[_0x5da5('0x4f')],function(_0xadbf12){var _0x48798d={};_0x48798d[_0xadbf12]={'$like':'%'+_0x5bb2be[_0x5da5('0x4c')][_0x5da5('0x39')]+'%'};return _0x48798d;})});}_0x2091f5=_[_0x5da5('0x56')]({},_0x2091f5,_0x5bb2be[_0x5da5('0x62')]);return _0x349d71[_0x5da5('0xd2')](_0x2091f5);}})[_0x5da5('0x31')](function(_0x1d7adf){if(_0x1d7adf){_0x1d7a07=_0x1d7adf['length'];if(!_0x5bb2be[_0x5da5('0x4c')][_0x5da5('0x51')](_0x5da5('0x52'))){_0x2091f5[_0x5da5('0x2d')]=qs[_0x5da5('0x2d')](_0x5bb2be[_0x5da5('0x4c')][_0x5da5('0x2d')]);_0x2091f5[_0x5da5('0x2c')]=qs[_0x5da5('0x2c')](_0x5bb2be[_0x5da5('0x4c')][_0x5da5('0x2c')]);}return _0x349d71['getOpenchannelInteractions'](_0x2091f5);}})[_0x5da5('0x31')](function(_0x1b346c){if(_0x1b346c){return _0x1b346c?{'count':_0x1d7a07,'rows':_0x1b346c}:null;}})[_0x5da5('0x31')](respondWithResult(_0x376693,null))[_0x5da5('0x5f')](handleError(_0x376693,null));};exports[_0x5da5('0xd3')]=function(_0x41045a,_0x4822c4,_0x517f88){var _0x547e7b={'raw':!![],'where':{}};var _0x53cf3f={};var _0x3ef11b={'count':0x0,'rows':[]};return db[_0x5da5('0x45')]['findOne']({'where':{'id':_0x41045a[_0x5da5('0x61')]['id']}})[_0x5da5('0x31')](handleEntityNotFound(_0x4822c4,null))[_0x5da5('0x31')](function(_0x2a5cf9){if(_0x2a5cf9){_0x53cf3f['model']=_['keys'](db[_0x5da5('0xd4')][_0x5da5('0x46')]);_0x53cf3f[_0x5da5('0x4c')]=_[_0x5da5('0x49')](_0x41045a['query']);_0x53cf3f[_0x5da5('0x4d')]=_[_0x5da5('0x4e')](_0x53cf3f[_0x5da5('0x47')],_0x53cf3f[_0x5da5('0x4c')]);_0x547e7b['attributes']=_[_0x5da5('0x4e')](_0x53cf3f[_0x5da5('0x47')],qs[_0x5da5('0x50')](_0x41045a[_0x5da5('0x4c')]['fields']));_0x547e7b['attributes']=_0x547e7b[_0x5da5('0x4f')][_0x5da5('0x7b')]?_0x547e7b[_0x5da5('0x4f')]:_0x53cf3f[_0x5da5('0x47')];if(!_0x41045a[_0x5da5('0x4c')][_0x5da5('0x51')]('nolimit')){_0x547e7b['limit']=qs['limit'](_0x41045a[_0x5da5('0x4c')][_0x5da5('0x2d')]);_0x547e7b[_0x5da5('0x2c')]=qs[_0x5da5('0x2c')](_0x41045a[_0x5da5('0x4c')][_0x5da5('0x2c')]);}_0x547e7b[_0x5da5('0xc4')]=qs[_0x5da5('0x53')](_0x41045a[_0x5da5('0x4c')][_0x5da5('0x53')]);_0x547e7b[_0x5da5('0x54')]=qs[_0x5da5('0x4d')](_[_0x5da5('0x55')](_0x41045a['query'],_0x53cf3f[_0x5da5('0x4d')]));_0x547e7b[_0x5da5('0x54')][_0x5da5('0xca')]=_0x2a5cf9['id'];if(_0x41045a[_0x5da5('0x4c')]['filter']){_0x547e7b[_0x5da5('0x54')]=_[_0x5da5('0x56')](_0x547e7b[_0x5da5('0x54')],{'$or':_[_0x5da5('0x57')](_0x547e7b['attributes'],function(_0x3ad308){var _0x2a8c1d={};_0x2a8c1d[_0x3ad308]={'$like':'%'+_0x41045a[_0x5da5('0x4c')][_0x5da5('0x39')]+'%'};return _0x2a8c1d;})});}_0x547e7b=_[_0x5da5('0x56')]({},_0x547e7b,_0x41045a[_0x5da5('0x62')]);return db[_0x5da5('0xd4')][_0x5da5('0x6a')]({'where':_0x547e7b[_0x5da5('0x54')]})[_0x5da5('0x31')](function(_0x2b5379){_0x3ef11b[_0x5da5('0x6a')]=_0x2b5379;if(_0x41045a[_0x5da5('0x4c')][_0x5da5('0xbb')]){_0x547e7b[_0x5da5('0xbc')]=[{'all':!![]}];}return db['MailInteraction']['findAll'](_0x547e7b);})[_0x5da5('0x31')](function(_0x3c934f){_0x3ef11b[_0x5da5('0xcc')]=_0x3c934f;return _0x3ef11b;});}})[_0x5da5('0x31')](respondWithFilteredResult(_0x4822c4,_0x547e7b))[_0x5da5('0x5f')](handleError(_0x4822c4,null));};exports['getSmsInteractions']=function(_0x645b4b,_0x3df350,_0x3ce08e){var _0x5ced8e={};var _0xec769a={};var _0x26a1bc;var _0x16622c;return db[_0x5da5('0x45')][_0x5da5('0xb9')]({'where':{'id':_0x645b4b[_0x5da5('0x61')]['id']}})[_0x5da5('0x31')](handleEntityNotFound(_0x3df350,null))['then'](function(_0x1d14ac){if(_0x1d14ac){_0x26a1bc=_0x1d14ac;_0xec769a['model']=_[_0x5da5('0x49')](db[_0x5da5('0xd5')]['rawAttributes']);_0xec769a[_0x5da5('0x4c')]=_[_0x5da5('0x49')](_0x645b4b[_0x5da5('0x4c')]);_0xec769a[_0x5da5('0x4d')]=_[_0x5da5('0x4e')](_0xec769a['model'],_0xec769a[_0x5da5('0x4c')]);_0x5ced8e['attributes']=_[_0x5da5('0x4e')](_0xec769a[_0x5da5('0x47')],qs[_0x5da5('0x50')](_0x645b4b[_0x5da5('0x4c')][_0x5da5('0x50')]));_0x5ced8e['attributes']=_0x5ced8e[_0x5da5('0x4f')][_0x5da5('0x7b')]?_0x5ced8e['attributes']:_0xec769a[_0x5da5('0x47')];_0x5ced8e['order']=qs[_0x5da5('0x53')](_0x645b4b[_0x5da5('0x4c')][_0x5da5('0x53')]);_0x5ced8e['where']=qs[_0x5da5('0x4d')](_[_0x5da5('0x55')](_0x645b4b[_0x5da5('0x4c')],_0xec769a['filters']));if(_0x645b4b['query']['filter']){_0x5ced8e[_0x5da5('0x54')]=_['merge'](_0x5ced8e[_0x5da5('0x54')],{'$or':_['map'](_0x5ced8e[_0x5da5('0x4f')],function(_0xc30062){var _0xd1e349={};_0xd1e349[_0xc30062]={'$like':'%'+_0x645b4b[_0x5da5('0x4c')]['filter']+'%'};return _0xd1e349;})});}_0x5ced8e=_[_0x5da5('0x56')]({},_0x5ced8e,_0x645b4b[_0x5da5('0x62')]);return _0x26a1bc['getSmsInteractions'](_0x5ced8e);}})[_0x5da5('0x31')](function(_0x2968d5){if(_0x2968d5){_0x16622c=_0x2968d5[_0x5da5('0x7b')];if(!_0x645b4b[_0x5da5('0x4c')]['hasOwnProperty'](_0x5da5('0x52'))){_0x5ced8e[_0x5da5('0x2d')]=qs['limit'](_0x645b4b[_0x5da5('0x4c')][_0x5da5('0x2d')]);_0x5ced8e[_0x5da5('0x2c')]=qs[_0x5da5('0x2c')](_0x645b4b[_0x5da5('0x4c')][_0x5da5('0x2c')]);}return _0x26a1bc[_0x5da5('0xd6')](_0x5ced8e);}})[_0x5da5('0x31')](function(_0x1fd7e5){if(_0x1fd7e5){return _0x1fd7e5?{'count':_0x16622c,'rows':_0x1fd7e5}:null;}})[_0x5da5('0x31')](respondWithResult(_0x3df350,null))[_0x5da5('0x5f')](handleError(_0x3df350,null));};exports['getFaxInteractions']=function(_0x55a633,_0x2a66c7,_0x1d9b45){var _0x1c1928={};var _0x4650b6={};var _0x83ca0;var _0x1b9d7f;return db[_0x5da5('0x45')][_0x5da5('0xb9')]({'where':{'id':_0x55a633[_0x5da5('0x61')]['id']}})[_0x5da5('0x31')](handleEntityNotFound(_0x2a66c7,null))[_0x5da5('0x31')](function(_0x38ea66){if(_0x38ea66){_0x83ca0=_0x38ea66;_0x4650b6[_0x5da5('0x47')]=_['keys'](db[_0x5da5('0xd7')]['rawAttributes']);_0x4650b6[_0x5da5('0x4c')]=_['keys'](_0x55a633['query']);_0x4650b6['filters']=_[_0x5da5('0x4e')](_0x4650b6[_0x5da5('0x47')],_0x4650b6[_0x5da5('0x4c')]);_0x1c1928[_0x5da5('0x4f')]=_[_0x5da5('0x4e')](_0x4650b6[_0x5da5('0x47')],qs[_0x5da5('0x50')](_0x55a633[_0x5da5('0x4c')][_0x5da5('0x50')]));_0x1c1928['attributes']=_0x1c1928['attributes'][_0x5da5('0x7b')]?_0x1c1928[_0x5da5('0x4f')]:_0x4650b6[_0x5da5('0x47')];_0x1c1928[_0x5da5('0xc4')]=qs[_0x5da5('0x53')](_0x55a633[_0x5da5('0x4c')][_0x5da5('0x53')]);_0x1c1928[_0x5da5('0x54')]=qs[_0x5da5('0x4d')](_[_0x5da5('0x55')](_0x55a633[_0x5da5('0x4c')],_0x4650b6[_0x5da5('0x4d')]));if(_0x55a633['query']['filter']){_0x1c1928[_0x5da5('0x54')]=_['merge'](_0x1c1928[_0x5da5('0x54')],{'$or':_['map'](_0x1c1928['attributes'],function(_0x4580cd){var _0xea0135={};_0xea0135[_0x4580cd]={'$like':'%'+_0x55a633[_0x5da5('0x4c')][_0x5da5('0x39')]+'%'};return _0xea0135;})});}_0x1c1928=_[_0x5da5('0x56')]({},_0x1c1928,_0x55a633[_0x5da5('0x62')]);return _0x83ca0[_0x5da5('0xd8')](_0x1c1928);}})[_0x5da5('0x31')](function(_0x45a53b){if(_0x45a53b){_0x1b9d7f=_0x45a53b[_0x5da5('0x7b')];if(!_0x55a633[_0x5da5('0x4c')][_0x5da5('0x51')](_0x5da5('0x52'))){_0x1c1928[_0x5da5('0x2d')]=qs[_0x5da5('0x2d')](_0x55a633[_0x5da5('0x4c')][_0x5da5('0x2d')]);_0x1c1928[_0x5da5('0x2c')]=qs[_0x5da5('0x2c')](_0x55a633[_0x5da5('0x4c')][_0x5da5('0x2c')]);}return _0x83ca0[_0x5da5('0xd8')](_0x1c1928);}})[_0x5da5('0x31')](function(_0x231d9e){if(_0x231d9e){return _0x231d9e?{'count':_0x1b9d7f,'rows':_0x231d9e}:null;}})[_0x5da5('0x31')](respondWithResult(_0x2a66c7,null))[_0x5da5('0x5f')](handleError(_0x2a66c7,null));};exports[_0x5da5('0xd9')]=function(_0x170c5c,_0x18deee,_0x4527c4){var _0x123e14;var _0x5efd3d;var _0x58f1cd;var _0x40af37=!_[_0x5da5('0x6f')](_0x170c5c[_0x5da5('0x61')]['id'])?_0x170c5c[_0x5da5('0x61')]['id']:!_[_0x5da5('0x6f')](_0x170c5c['user']['id'])?_0x170c5c['user']['id']:null;return db[_0x5da5('0x45')][_0x5da5('0x3e')]({'where':{'id':_0x40af37,'role':_0x5da5('0x36')},'attributes':['id',_0x5da5('0x3f'),_0x5da5('0xda'),_0x5da5('0xdb'),_0x5da5('0x3d'),_0x5da5('0x72'),_0x5da5('0x9b')]})['then'](handleEntityNotFound(_0x18deee,null))[_0x5da5('0x31')](function(_0x2b1c94){if(_0x2b1c94){_0x123e14=_0x2b1c94;if(_0x170c5c[_0x5da5('0x64')]['interface']){_0x58f1cd=util['format'](_0x5da5('0xdc'),_0x123e14[_0x170c5c[_0x5da5('0x64')][_0x5da5('0x9d')]]);}else if(_0x170c5c[_0x5da5('0x64')][_0x5da5('0xdd')]){_0x58f1cd=util[_0x5da5('0xa9')](_0x5da5('0xde'),_0x170c5c[_0x5da5('0x64')]['intrf']);}else{_0x58f1cd=util['format'](_0x5da5('0xde'),_0x123e14[_0x5da5('0x3f')]);}socket['to'](util['format'](_0x5da5('0xdf'),_0x123e14['name']))[_0x5da5('0xa4')]('user:forcelogout',{'ip':_0x170c5c[_0x5da5('0xe0')][_0x5da5('0xe1')]||_0x170c5c[_0x5da5('0xe2')]['remoteAddress']||_0x170c5c['socket'][_0x5da5('0xe3')]||_0x170c5c['connection']['socket']['remoteAddress']});return db[_0x5da5('0xac')][_0x5da5('0xe4')]({'where':{'membername':_0x123e14[_0x5da5('0x3f')]},'individualHooks':!![]});}})[_0x5da5('0x31')](function(_0xfb85ae){if(_0x123e14){return _0x123e14['getVoiceQueues']({'raw':!![]});}})[_0x5da5('0x31')](function(_0x25a854){var _0x33aaf6=[];if(_0x25a854){_0x5efd3d=_0x25a854;if(_0x5efd3d[_0x5da5('0x7b')]){for(var _0x43bd48=0x0;_0x43bd48<_0x5efd3d[_0x5da5('0x7b')];_0x43bd48++){_0x33aaf6['push']({'membername':_0x123e14[_0x5da5('0x3f')],'UserId':_0x123e14['id'],'queue_name':_0x5efd3d[_0x43bd48][_0x5da5('0x3f')],'VoiceQueueId':_0x5efd3d[_0x43bd48]['id'],'interface':_0x58f1cd,'paused':_0x123e14[_0x5da5('0x9b')]||![],'penalty':_0x5efd3d[_0x43bd48][_0x5da5('0xe5')]||0x0});}return BPromise[_0x5da5('0xab')](_0x33aaf6,function(_0x391fce){return db[_0x5da5('0xac')][_0x5da5('0xad')](_0x391fce);});}}})[_0x5da5('0x31')](function(){return db[_0x5da5('0xe6')][_0x5da5('0x5e')]({'where':{'membername':_0x123e14[_0x5da5('0x3f')],'exitAt':null}});})['then'](function(_0x4c71e0){var _0x149a02=[];_0x4c71e0['forEach'](function(_0x295bfb){_0x149a02[_0x5da5('0xa8')](_0x295bfb[_0x5da5('0x30')]({'exitAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')}));});return BPromise[_0x5da5('0xe7')](_0x149a02);})[_0x5da5('0x31')](function(){var _0xef2474=[];var _0x1eabb5=[];var _0x18109e=utils['getChannels']();var _0x2e6d46={'membername':_0x123e14[_0x5da5('0x3f')],'interface':_0x58f1cd,'enterAt':moment()[_0x5da5('0xa9')]('YYYY-MM-DD\x20HH:mm:ss'),'role':_0x123e14[_0x5da5('0x3d')],'internal':_0x123e14[_0x5da5('0x72')]};_0x18109e[_0x5da5('0xe8')](function(_0x13d8e5){_0xef2474[_0x5da5('0xa8')](_['merge']({'channel':_0x13d8e5,'type':_0x5da5('0xe9'),'data1':_0x170c5c[_0x5da5('0x64')][_0x5da5('0xea')],'data2':_0x58f1cd},_0x2e6d46));if(_0x123e14[_0x5da5('0x9b')]){_0x1eabb5[_0x5da5('0xa8')](_[_0x5da5('0x56')]({'channel':_0x13d8e5,'type':_0x5da5('0xeb'),'data1':_0x5da5('0xec')},_0x2e6d46));}});return db['MemberReport']['bulkCreate'](_0xef2474[_0x5da5('0xed')](_0x1eabb5),{'individualHooks':!![]});})[_0x5da5('0x31')](function(){return _0x123e14['update']({'online':!![],'lastLoginAt':moment()[_0x5da5('0xa9')](_0x5da5('0xee')),'voicePause':_0x123e14[_0x5da5('0x9b')]||![],'mailPause':_0x123e14[_0x5da5('0x9b')]||![],'chatPause':_0x123e14[_0x5da5('0x9b')]||![],'faxPause':_0x123e14[_0x5da5('0x9b')]||![],'smsPause':_0x123e14['loginInPause']||![],'openchannelPause':_0x123e14['loginInPause']||![],'pauseType':_0x123e14[_0x5da5('0x9b')]?_0x5da5('0xec'):null,'interface':_0x58f1cd,'lastPauseAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')});})[_0x5da5('0x31')](function(_0x4f0284){if(_0x170c5c[_0x5da5('0xef')]){return _0x4527c4();}else{return BPromise['resolve'](_0x4f0284)[_0x5da5('0x31')](respondWithResult(_0x18deee,null));}})[_0x5da5('0x5f')](handleError(_0x18deee,null));};exports['logout']=function(_0x2f5769,_0x26bfa1,_0x5cfbc3){var _0x2b5a70;return db[_0x5da5('0x45')][_0x5da5('0x3e')]({'where':{'id':_0x2f5769[_0x5da5('0x61')]['id'],'role':_0x5da5('0x36')},'attributes':['id',_0x5da5('0x3f'),'role']})[_0x5da5('0x31')](handleEntityNotFound(_0x26bfa1,null))[_0x5da5('0x31')](function(_0x40eaec){if(_0x40eaec){_0x2b5a70=_0x40eaec;return db['UserVoiceQueueRt'][_0x5da5('0xe4')]({'where':{'membername':_0x2b5a70[_0x5da5('0x3f')]},'individualHooks':!![]});}})['then'](function(){return db[_0x5da5('0xe6')][_0x5da5('0x5e')]({'where':{'membername':_0x2b5a70[_0x5da5('0x3f')],'exitAt':null}});})[_0x5da5('0x31')](function(_0x197aa1){var _0x271412=[];_0x197aa1[_0x5da5('0xe8')](function(_0x23a2ff){_0x271412[_0x5da5('0xa8')](_0x23a2ff[_0x5da5('0x30')]({'exitAt':moment()['format'](_0x5da5('0xee'))}));});return BPromise['all'](_0x271412);})[_0x5da5('0x31')](function(){return _0x2b5a70[_0x5da5('0x30')]({'online':![],'lastLoginAt':null,'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'interface':null});})[_0x5da5('0x31')](respondWithResult(_0x26bfa1,null))['catch'](handleError(_0x26bfa1,null));};exports['pause']=function(_0x1d60e2,_0x2ecd73,_0x3b2cf1){var _0x3564c8;return db[_0x5da5('0xac')][_0x5da5('0x30')]({'paused':0x1},{'where':{'UserId':_0x1d60e2['params']['id']},'individualHooks':!![]})['then'](function(){return db['User']['find']({'where':{'id':_0x1d60e2[_0x5da5('0x61')]['id'],'role':_0x5da5('0x36')},'attributes':['id',_0x5da5('0x3f'),_0x5da5('0x3d'),_0x5da5('0x72'),_0x5da5('0x9d')]});})['then'](handleEntityNotFound(_0x2ecd73,null))[_0x5da5('0x31')](function(_0x40db22){if(_0x40db22){_0x3564c8=_0x40db22;return respondWithRpcPromise(_0x5da5('0xf0'),_0x5da5('0xf1'),{'id':_0x3564c8['id'],'name':_0x3564c8[_0x5da5('0x3f')],'pause':!![]});}})['then'](function(){if(_0x3564c8){return db[_0x5da5('0xe6')][_0x5da5('0x5e')]({'where':{'membername':_0x3564c8[_0x5da5('0x3f')],'type':'PAUSE','exitAt':null}});}})[_0x5da5('0x31')](function(_0x3acdca){if(_0x3acdca[_0x5da5('0x7b')]){var _0x316ec2=moment()[_0x5da5('0xa9')](_0x5da5('0xee'));for(var _0x4770c0=0x0,_0x4ad965=_0x3acdca[_0x5da5('0x7b')];_0x4770c0<_0x4ad965;_0x4770c0++){_0x3acdca[_0x4770c0][_0x5da5('0xf2')]({'exitAt':_0x316ec2});}}})[_0x5da5('0x31')](function(){var _0x38b7af=[];var _0x48605f=utils[_0x5da5('0xf3')]();_0x48605f[_0x5da5('0xe8')](function(_0x119ab5){_0x38b7af['push']({'channel':_0x119ab5,'membername':_0x3564c8[_0x5da5('0x3f')],'interface':_[_0x5da5('0x6f')](_0x3564c8['interface'])?util[_0x5da5('0xa9')]('SIP/%s',_0x3564c8['name']):_0x3564c8['interface'],'type':_0x5da5('0xeb'),'enterAt':moment()[_0x5da5('0xa9')](_0x5da5('0xee')),'data1':_0x1d60e2['body']['type']||'DEFAULT\x20PAUSE','role':_0x3564c8['role'],'internal':_0x3564c8[_0x5da5('0x72')]});});return db['MemberReport'][_0x5da5('0x63')](_0x38b7af,{'individualHooks':!![]});})[_0x5da5('0x31')](function(){return _0x3564c8[_0x5da5('0x30')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'pauseType':_0x1d60e2[_0x5da5('0x64')][_0x5da5('0x58')]||_0x5da5('0xf4'),'lastPauseAt':moment()[_0x5da5('0xa9')](_0x5da5('0xee'))});})[_0x5da5('0x31')](respondWithResult(_0x2ecd73,null))[_0x5da5('0x5f')](handleError(_0x2ecd73,null));};exports[_0x5da5('0xf5')]=function(_0x96df24,_0x4f71f7,_0x31394c){var _0x5a9de8;return db[_0x5da5('0x45')][_0x5da5('0x3e')]({'where':{'id':_0x96df24[_0x5da5('0x61')]['id']},'attributes':['id',_0x5da5('0x3f'),_0x5da5('0x3d'),'voicePause',_0x5da5('0xf6'),_0x5da5('0xf7'),_0x5da5('0xf8'),_0x5da5('0xf9'),_0x5da5('0xfa'),_0x5da5('0xfb'),'lastPauseAt']})[_0x5da5('0x31')](handleEntityNotFound(_0x4f71f7,null))['then'](function(_0x1c6697){if(_0x1c6697){_0x5a9de8=_0x1c6697;if(_0x96df24[_0x5da5('0x64')][_0x5da5('0xaf')]&&!utils[_0x5da5('0xc3')](_0x96df24[_0x5da5('0x64')]['channel'])){throw new db[(_0x5da5('0x92'))][(_0x5da5('0x93'))](_0x5da5('0x9e'));}switch(_0x96df24[_0x5da5('0x64')]['channel']){case'voice':return respondWithRpcPromise(_0x5da5('0xf0'),_0x5da5('0xf5'),{'id':_0x5a9de8['id'],'name':_0x5a9de8[_0x5da5('0x3f')],'pause':![]})[_0x5da5('0x31')](function(){return db['UserVoiceQueueRt'][_0x5da5('0x30')]({'paused':0x0},{'where':{'UserId':_0x5a9de8['id']},'individualHooks':!![]});})['then'](function(){return db[_0x5da5('0xe6')][_0x5da5('0x3e')]({'where':{'channel':_0x96df24[_0x5da5('0x64')][_0x5da5('0xaf')],'membername':_0x5a9de8[_0x5da5('0x3f')],'type':_0x5da5('0xeb'),'exitAt':null}});})[_0x5da5('0x31')](function(_0x546967){if(_0x546967){return _0x546967[_0x5da5('0x30')]({'exitAt':moment()[_0x5da5('0xa9')]('YYYY-MM-DD\x20HH:mm:ss'),'data2':_0x5da5('0xfc')},{'individualHooks':!![]});}return null;})[_0x5da5('0x31')](function(){return _0x5a9de8[_0x5da5('0x30')]({'voicePause':![]});});case _0x5da5('0xfd'):case _0x5da5('0xfe'):case'fax':case _0x5da5('0xff'):case _0x5da5('0x100'):return db[_0x5da5('0xe6')]['find']({'where':{'channel':_0x96df24['body']['channel'],'membername':_0x5a9de8[_0x5da5('0x3f')],'type':_0x5da5('0xeb'),'exitAt':null}})['then'](function(_0x126883){if(_0x126883){return _0x126883['update']({'exitAt':moment()[_0x5da5('0xa9')]('YYYY-MM-DD\x20HH:mm:ss'),'data2':_0x5da5('0xfc')},{'individualHooks':!![]});}return null;})[_0x5da5('0x31')](function(){var _0x384b18={};_[_0x5da5('0x2e')](_0x384b18,util[_0x5da5('0xa9')](_0x5da5('0x101'),_0x96df24[_0x5da5('0x64')]['channel'],_0x5da5('0x102')),![]);return _0x5a9de8[_0x5da5('0x30')](_0x384b18);});default:return respondWithRpcPromise(_0x5da5('0xf0'),_0x5da5('0xf5'),{'id':_0x5a9de8['id'],'name':_0x5a9de8[_0x5da5('0x3f')],'pause':![]})[_0x5da5('0x31')](function(){return db['UserVoiceQueueRt']['update']({'paused':0x0},{'where':{'UserId':_0x5a9de8['id']}});})[_0x5da5('0x31')](function(){return db[_0x5da5('0xe6')][_0x5da5('0x5e')]({'where':{'membername':_0x5a9de8[_0x5da5('0x3f')],'type':_0x5da5('0xeb'),'exitAt':null}});})[_0x5da5('0x31')](function(_0x400c47){var _0x4b7f42=[];_0x400c47[_0x5da5('0xe8')](function(_0xfa4d9){_0x4b7f42[_0x5da5('0xa8')](_0xfa4d9[_0x5da5('0x30')]({'exitAt':moment()[_0x5da5('0xa9')](_0x5da5('0xee')),'data2':_0x5da5('0xfc')}));});return BPromise[_0x5da5('0xe7')](_0x4b7f42);})[_0x5da5('0x31')](function(){return _0x5a9de8[_0x5da5('0x30')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});});}}})[_0x5da5('0x31')](respondWithResult(_0x4f71f7,null))[_0x5da5('0x5f')](handleError(_0x4f71f7,null));};exports[_0x5da5('0x103')]=function(_0x2a698e,_0x2cc200,_0x58f53d){var _0x35ea9e={};var _0x370692={};var _0x1e5789;var _0x2e606d;return db[_0x5da5('0x45')]['findOne']({'where':{'id':_0x2a698e['params']['id']}})[_0x5da5('0x31')](handleEntityNotFound(_0x2cc200,null))[_0x5da5('0x31')](function(_0x234e0c){if(_0x234e0c){_0x1e5789=_0x234e0c;_0x370692[_0x5da5('0x47')]=_[_0x5da5('0x49')](db[_0x5da5('0x104')]['rawAttributes']);_0x370692[_0x5da5('0x4c')]=_['keys'](_0x2a698e[_0x5da5('0x4c')]);_0x370692['filters']=_[_0x5da5('0x4e')](_0x370692[_0x5da5('0x47')],_0x370692['query']);_0x35ea9e[_0x5da5('0x4f')]=_['intersection'](_0x370692[_0x5da5('0x47')],qs[_0x5da5('0x50')](_0x2a698e['query'][_0x5da5('0x50')]));_0x35ea9e[_0x5da5('0x4f')]=_0x35ea9e[_0x5da5('0x4f')][_0x5da5('0x7b')]?_0x35ea9e[_0x5da5('0x4f')]:_0x370692[_0x5da5('0x47')];_0x35ea9e[_0x5da5('0xc4')]=qs['sort'](_0x2a698e[_0x5da5('0x4c')][_0x5da5('0x53')]);_0x35ea9e[_0x5da5('0x54')]=qs['filters'](_[_0x5da5('0x55')](_0x2a698e[_0x5da5('0x4c')],_0x370692[_0x5da5('0x4d')]));if(_0x2a698e[_0x5da5('0x4c')][_0x5da5('0x39')]){_0x35ea9e[_0x5da5('0x54')]=_[_0x5da5('0x56')](_0x35ea9e[_0x5da5('0x54')],{'$or':_[_0x5da5('0x57')](_0x35ea9e['attributes'],function(_0x4e2176){var _0x98016f={};_0x98016f[_0x4e2176]={'$like':'%'+_0x2a698e[_0x5da5('0x4c')][_0x5da5('0x39')]+'%'};return _0x98016f;})});}_0x35ea9e=_[_0x5da5('0x56')]({},_0x35ea9e,_0x2a698e['options']);return _0x1e5789[_0x5da5('0x103')](_0x35ea9e);}})[_0x5da5('0x31')](function(_0x5f4db9){if(_0x5f4db9){_0x2e606d=_0x5f4db9[_0x5da5('0x7b')];if(!_0x2a698e[_0x5da5('0x4c')][_0x5da5('0x51')](_0x5da5('0x52'))){_0x35ea9e['limit']=qs['limit'](_0x2a698e[_0x5da5('0x4c')][_0x5da5('0x2d')]);_0x35ea9e[_0x5da5('0x2c')]=qs[_0x5da5('0x2c')](_0x2a698e[_0x5da5('0x4c')][_0x5da5('0x2c')]);}return _0x1e5789[_0x5da5('0x103')](_0x35ea9e);}})[_0x5da5('0x31')](function(_0x2c7821){if(_0x2c7821){return _0x2c7821?{'count':_0x2e606d,'rows':_0x2c7821}:null;}})['then'](respondWithResult(_0x2cc200,null))['catch'](handleError(_0x2cc200,null));};exports[_0x5da5('0x105')]=function(_0x176097,_0x318cc8){return db['User']['find']({'where':{'id':_0x176097['params']['id']}})[_0x5da5('0x31')](handleEntityNotFound(_0x318cc8,null))[_0x5da5('0x31')](function(_0x7bc6a8){if(_0x7bc6a8){var _0x46e327=_0x7bc6a8['get']({'plain':!![]});return _0x7bc6a8[_0x5da5('0x105')](_0x176097[_0x5da5('0x64')][_0x5da5('0x67')],_[_0x5da5('0x68')](_0x176097[_0x5da5('0x64')],[_0x5da5('0x67'),'id'])||{})[_0x5da5('0x31')](function(){for(var _0x1fc3ef=0x0;_0x1fc3ef<_0x176097[_0x5da5('0x64')][_0x5da5('0x67')]['length'];_0x1fc3ef++){var _0x5bea07=[];db['Team'][_0x5da5('0xb9')]({'where':{'id':_0x176097[_0x5da5('0x64')]['ids'][_0x1fc3ef]}})[_0x5da5('0x31')](function(_0x561de0){_0x5bea07[_0x5da5('0xa8')](_0x561de0[_0x5da5('0x106')]()[_0x5da5('0x31')](function(_0x2b81d0){for(var _0x51d094=0x0;_0x51d094<_0x2b81d0[_0x5da5('0x7b')];_0x51d094++){_0x2b81d0[_0x51d094][_0x5da5('0x107')](_0x5da5('0xaf'),_0x5da5('0x108'));}return _0x2b81d0;}));_0x5bea07[_0x5da5('0xa8')](_0x561de0[_0x5da5('0x109')]()[_0x5da5('0x31')](function(_0x2c2257){for(var _0x3d70e4=0x0;_0x3d70e4<_0x2c2257[_0x5da5('0x7b')];_0x3d70e4++){_0x2c2257[_0x3d70e4][_0x5da5('0x107')](_0x5da5('0xaf'),_0x5da5('0x10a'));}return _0x2c2257;}));_0x5bea07[_0x5da5('0xa8')](_0x561de0[_0x5da5('0x10b')]()[_0x5da5('0x31')](function(_0x323c0c){for(var _0xdd3157=0x0;_0xdd3157<_0x323c0c[_0x5da5('0x7b')];_0xdd3157++){_0x323c0c[_0xdd3157][_0x5da5('0x107')](_0x5da5('0xaf'),_0x5da5('0x10c'));}return _0x323c0c;}));_0x5bea07['push'](_0x561de0[_0x5da5('0x10d')]()['then'](function(_0x3a0b6d){for(var _0x2dcbd1=0x0;_0x2dcbd1<_0x3a0b6d['length'];_0x2dcbd1++){_0x3a0b6d[_0x2dcbd1]['setDataValue']('channel',_0x5da5('0x10e'));}return _0x3a0b6d;}));_0x5bea07[_0x5da5('0xa8')](_0x561de0['getFaxQueues']()[_0x5da5('0x31')](function(_0x129334){for(var _0x5af83f=0x0;_0x5af83f<_0x129334[_0x5da5('0x7b')];_0x5af83f++){_0x129334[_0x5af83f][_0x5da5('0x107')](_0x5da5('0xaf'),'Fax');}return _0x129334;}));_0x5bea07[_0x5da5('0xa8')](_0x561de0['getOpenchannelQueues']()['then'](function(_0x14dacc){for(var _0x4f82ba=0x0;_0x4f82ba<_0x14dacc[_0x5da5('0x7b')];_0x4f82ba++){_0x14dacc[_0x4f82ba][_0x5da5('0x107')](_0x5da5('0xaf'),_0x5da5('0x10f'));}return _0x14dacc;}));return BPromise[_0x5da5('0xe7')](_0x5bea07);})[_0x5da5('0x31')](function(_0x5c07fe){var _0x4366d3=_[_0x5da5('0x110')](_0x5c07fe);_0x5bea07=[];return db[_0x5da5('0x5b')][_0x5da5('0x111')](function(_0xcc4a15){for(var _0x39e3f7=0x0;_0x39e3f7<_0x4366d3[_0x5da5('0x7b')];_0x39e3f7++){_0x5bea07[_0x5da5('0xa8')](_0x4366d3[_0x39e3f7]['addAgent'](_0x46e327['id']),{'transaction':_0xcc4a15});}return BPromise[_0x5da5('0xe7')](_0x5bea07)[_0x5da5('0x31')](function(){if(_0x46e327[_0x5da5('0x112')]){return BPromise['each'](_['filter'](_0x4366d3,function(_0x457461){return _0x457461[_0x5da5('0x113')]('channel')===_0x5da5('0x108');}),function(_0x30b8e6){return db[_0x5da5('0xac')][_0x5da5('0xad')]({'membername':_0x46e327[_0x5da5('0x3f')],'UserId':_0x46e327['id'],'queue_name':_0x30b8e6[_0x5da5('0x3f')],'VoiceQueueId':_0x30b8e6['id'],'interface':_[_0x5da5('0x6f')](_0x46e327['interface'])?util[_0x5da5('0xa9')](_0x5da5('0xde'),_0x46e327[_0x5da5('0x3f')]):_0x46e327[_0x5da5('0x9d')],'paused':_0x46e327['voicePause']||![],'penalty':_0x46e327[_0x5da5('0xaa')]},{'transaction':_0xcc4a15});});}else{return;}})['then'](function(){for(var _0x32739d=0x0;_0x32739d<_0x4366d3[_0x5da5('0x7b')];_0x32739d++){var _0x3e5a8e=_0x4366d3[_0x32739d][_0x5da5('0x113')](_0x5da5('0xaf'));var _0x426480=_0x3e5a8e+'QueueId';socket[_0x5da5('0xa4')](_0x5da5('0x34')+_0x3e5a8e+_0x5da5('0xa5'),{'UserId':_0x46e327['id'],['queueField']:_0x4366d3[_0x32739d]['id']});}});});});}});}})['then'](respondWithStatusCode(_0x318cc8,null))[_0x5da5('0x5f')](handleError(_0x318cc8,null));};exports[_0x5da5('0x114')]=function(_0x32227d,_0x294d7a){return db[_0x5da5('0x45')][_0x5da5('0xb9')]({'where':{'id':_0x32227d[_0x5da5('0x61')]['id']}})['then'](handleEntityNotFound(_0x294d7a,null))['then'](function(_0x32eb72){if(_0x32eb72){var _0x37cbaf=_0x32eb72[_0x5da5('0x32')]({'plain':!![]});var _0x1721ab=_0x32227d['query'][_0x5da5('0x67')];return _0x32eb72['removeTeams'](_0x1721ab)[_0x5da5('0x31')](function(){for(var _0x2fc521=0x0;_0x2fc521<_0x1721ab[_0x5da5('0x7b')];_0x2fc521++){var _0x354473=[];db[_0x5da5('0x104')][_0x5da5('0xb9')]({'where':{'id':_0x1721ab[_0x2fc521]}})[_0x5da5('0x31')](function(_0x5b52c0){_0x354473['push'](_0x5b52c0[_0x5da5('0x106')]()[_0x5da5('0x31')](function(_0x5aebc7){for(var _0x1fdf99=0x0;_0x1fdf99<_0x5aebc7[_0x5da5('0x7b')];_0x1fdf99++){_0x5aebc7[_0x1fdf99][_0x5da5('0x107')]('channel',_0x5da5('0x108'));}return _0x5aebc7;}));_0x354473[_0x5da5('0xa8')](_0x5b52c0['getChatQueues']()['then'](function(_0x42cb1a){for(var _0x182c5c=0x0;_0x182c5c<_0x42cb1a['length'];_0x182c5c++){_0x42cb1a[_0x182c5c][_0x5da5('0x107')](_0x5da5('0xaf'),_0x5da5('0x10a'));}return _0x42cb1a;}));_0x354473[_0x5da5('0xa8')](_0x5b52c0['getMailQueues']()[_0x5da5('0x31')](function(_0x49c3cb){for(var _0x4578b1=0x0;_0x4578b1<_0x49c3cb['length'];_0x4578b1++){_0x49c3cb[_0x4578b1][_0x5da5('0x107')](_0x5da5('0xaf'),_0x5da5('0x10c'));}return _0x49c3cb;}));_0x354473['push'](_0x5b52c0[_0x5da5('0x10d')]()[_0x5da5('0x31')](function(_0x5502bf){for(var _0x1daa8f=0x0;_0x1daa8f<_0x5502bf[_0x5da5('0x7b')];_0x1daa8f++){_0x5502bf[_0x1daa8f][_0x5da5('0x107')](_0x5da5('0xaf'),_0x5da5('0x10e'));}return _0x5502bf;}));_0x354473[_0x5da5('0xa8')](_0x5b52c0['getFaxQueues']()[_0x5da5('0x31')](function(_0x45a2c2){for(var _0x5db683=0x0;_0x5db683<_0x45a2c2[_0x5da5('0x7b')];_0x5db683++){_0x45a2c2[_0x5db683][_0x5da5('0x107')](_0x5da5('0xaf'),_0x5da5('0x115'));}return _0x45a2c2;}));_0x354473['push'](_0x5b52c0[_0x5da5('0x116')]()[_0x5da5('0x31')](function(_0x2aadf8){for(var _0x8804b5=0x0;_0x8804b5<_0x2aadf8['length'];_0x8804b5++){_0x2aadf8[_0x8804b5][_0x5da5('0x107')](_0x5da5('0xaf'),_0x5da5('0x10f'));}return _0x2aadf8;}));return BPromise['all'](_0x354473);})[_0x5da5('0x31')](function(_0x3117c7){var _0x846a17=_[_0x5da5('0x110')](_0x3117c7);_0x354473=[];return db[_0x5da5('0x5b')][_0x5da5('0x111')](function(_0x33fad5){for(var _0x3e1327=0x0;_0x3e1327<_0x846a17[_0x5da5('0x7b')];_0x3e1327++){_0x354473['push'](_0x846a17[_0x3e1327][_0x5da5('0x117')](_0x37cbaf['id']),{'transaction':_0x33fad5});}return BPromise[_0x5da5('0xe7')](_0x354473)['then'](function(){if(_0x37cbaf['online']){return BPromise[_0x5da5('0xab')](_[_0x5da5('0x39')](_0x846a17,function(_0x47bc7a){return _0x47bc7a[_0x5da5('0x113')]('channel')===_0x5da5('0x108');}),function(_0x57c04d){return db['UserVoiceQueueRt']['destroy']({'where':{'VoiceQueueId':_0x57c04d['id'],'UserId':_0x37cbaf['id']},'transaction':_0x33fad5});});}else{return;}})['then'](function(){for(var _0x27ef3f=0x0;_0x27ef3f<_0x846a17[_0x5da5('0x7b')];_0x27ef3f++){var _0x4f64b4=_0x846a17[_0x27ef3f][_0x5da5('0x113')](_0x5da5('0xaf'));var _0x5a8dd5=_0x4f64b4+_0x5da5('0xa3');socket['emit'](_0x5da5('0x34')+_0x4f64b4+_0x5da5('0x118'),{'UserId':_0x37cbaf['id'],['queueField']:_0x846a17[_0x27ef3f]['id']});}});});});}});}})[_0x5da5('0x31')](respondWithStatusCode(_0x294d7a,null))['catch'](handleError(_0x294d7a,null));};exports[_0x5da5('0x119')]=function(_0x17a078,_0x383a50,_0x1a464a){var _0x22bb2c={};var _0x1f8ce8={};var _0x57e637;var _0xc6aabc;return db[_0x5da5('0x45')]['findOne']({'where':{'id':_0x17a078['params']['id']}})[_0x5da5('0x31')](handleEntityNotFound(_0x383a50,null))[_0x5da5('0x31')](function(_0x33f51a){if(_0x33f51a){_0x57e637=_0x33f51a;_0x1f8ce8[_0x5da5('0x47')]=_['keys'](db['CmList'][_0x5da5('0x46')]);_0x1f8ce8[_0x5da5('0x4c')]=_[_0x5da5('0x49')](_0x17a078[_0x5da5('0x4c')]);_0x1f8ce8['filters']=_[_0x5da5('0x4e')](_0x1f8ce8[_0x5da5('0x47')],_0x1f8ce8[_0x5da5('0x4c')]);_0x22bb2c[_0x5da5('0x4f')]=_['intersection'](_0x1f8ce8['model'],qs[_0x5da5('0x50')](_0x17a078[_0x5da5('0x4c')]['fields']));_0x22bb2c[_0x5da5('0x4f')]=_0x22bb2c[_0x5da5('0x4f')][_0x5da5('0x7b')]?_0x22bb2c[_0x5da5('0x4f')]:_0x1f8ce8['model'];_0x22bb2c[_0x5da5('0xc4')]=qs[_0x5da5('0x53')](_0x17a078[_0x5da5('0x4c')]['sort']);_0x22bb2c[_0x5da5('0x54')]=qs[_0x5da5('0x4d')](_[_0x5da5('0x55')](_0x17a078[_0x5da5('0x4c')],_0x1f8ce8[_0x5da5('0x4d')]));if(_0x17a078['query'][_0x5da5('0x39')]){_0x22bb2c[_0x5da5('0x54')]=_[_0x5da5('0x56')](_0x22bb2c[_0x5da5('0x54')],{'$or':_[_0x5da5('0x57')](_0x22bb2c[_0x5da5('0x4f')],function(_0x3c4801){var _0x33b378={};_0x33b378[_0x3c4801]={'$like':'%'+_0x17a078[_0x5da5('0x4c')][_0x5da5('0x39')]+'%'};return _0x33b378;})});}_0x22bb2c=_[_0x5da5('0x56')]({},_0x22bb2c,_0x17a078[_0x5da5('0x62')]);return _0x57e637[_0x5da5('0x119')](_0x22bb2c);}})[_0x5da5('0x31')](function(_0x47112b){if(_0x47112b){_0xc6aabc=_0x47112b[_0x5da5('0x7b')];if(!_0x17a078['query'][_0x5da5('0x51')](_0x5da5('0x52'))){_0x22bb2c[_0x5da5('0x2d')]=qs[_0x5da5('0x2d')](_0x17a078[_0x5da5('0x4c')][_0x5da5('0x2d')]);_0x22bb2c[_0x5da5('0x2c')]=qs['offset'](_0x17a078[_0x5da5('0x4c')][_0x5da5('0x2c')]);}return _0x57e637[_0x5da5('0x119')](_0x22bb2c);}})[_0x5da5('0x31')](function(_0x1a62c9){if(_0x1a62c9){return _0x1a62c9?{'count':_0xc6aabc,'rows':_0x1a62c9}:null;}})[_0x5da5('0x31')](respondWithResult(_0x383a50,null))['catch'](handleError(_0x383a50,null));};exports[_0x5da5('0x11a')]=function(_0x2dd71a,_0x3fcf2b,_0xa1358f){var _0x538b50={};var _0x156b6e={};var _0xdc17ff;var _0x1ec027;return db[_0x5da5('0x45')][_0x5da5('0xb9')]({'where':{'id':_0x2dd71a['params']['id']}})[_0x5da5('0x31')](handleEntityNotFound(_0x3fcf2b,null))[_0x5da5('0x31')](function(_0x5680bd){if(_0x5680bd){_0xdc17ff=_0x5680bd;_0x156b6e[_0x5da5('0x47')]=_['keys'](db['User'][_0x5da5('0x46')]);_0x156b6e['query']=_[_0x5da5('0x49')](_0x2dd71a[_0x5da5('0x4c')]);_0x156b6e[_0x5da5('0x4d')]=_[_0x5da5('0x4e')](_0x156b6e['model'],_0x156b6e[_0x5da5('0x4c')]);_0x538b50[_0x5da5('0x4f')]=_[_0x5da5('0x4e')](_0x156b6e[_0x5da5('0x47')],qs[_0x5da5('0x50')](_0x2dd71a[_0x5da5('0x4c')][_0x5da5('0x50')]));_0x538b50[_0x5da5('0x4f')]=_0x538b50[_0x5da5('0x4f')][_0x5da5('0x7b')]?_0x538b50[_0x5da5('0x4f')]:_0x156b6e['model'];_0x538b50[_0x5da5('0xc4')]=qs[_0x5da5('0x53')](_0x2dd71a[_0x5da5('0x4c')][_0x5da5('0x53')]);_0x538b50[_0x5da5('0x54')]=qs[_0x5da5('0x4d')](_['pick'](_0x2dd71a[_0x5da5('0x4c')],_0x156b6e['filters']));if(_0x2dd71a[_0x5da5('0x4c')]['filter']){_0x538b50[_0x5da5('0x54')]=_['merge'](_0x538b50['where'],{'$or':_[_0x5da5('0x57')](_0x538b50[_0x5da5('0x4f')],function(_0x8873fe){var _0xb93f94={};_0xb93f94[_0x8873fe]={'$like':'%'+_0x2dd71a[_0x5da5('0x4c')][_0x5da5('0x39')]+'%'};return _0xb93f94;})});}_0x538b50[_0x5da5('0x47')]=db[_0x5da5('0x45')];_0x538b50['as']='Agents';_0x538b50=_[_0x5da5('0x56')]({},_0x538b50,_0x2dd71a[_0x5da5('0x62')]);return _0xdc17ff['getVoiceQueues']({'include':[_0x538b50]});}})['then'](function(_0x1589db){if(_0x1589db){var _0x1587e0={},_0x4e902b=[],_0x303b5d=0x0;for(var _0x7d24ca=0x0;_0x7d24ca<_0x1589db[_0x5da5('0x7b')];_0x7d24ca+=0x1){for(var _0x7ae54f=0x0,_0x5431b1;_0x7ae54f<_0x1589db[_0x7d24ca]['Agents'][_0x5da5('0x7b')];_0x7ae54f+=0x1){_0x5431b1=_0x1589db[_0x7d24ca][_0x5da5('0x35')][_0x7ae54f][_0x5da5('0x32')]({'plain':!![]});_0x1587e0[_0x5431b1['id']]=_0x5431b1;}}_0x1587e0=_[_0x5da5('0x11b')](_0x1587e0);for(var _0x5e74fc=qs[_0x5da5('0x2c')](_0x2dd71a['query'][_0x5da5('0x2c')]);_0x5e74fc<_0x1587e0['length']&&_0x4e902b[_0x5da5('0x7b')]=_0x1a3967){_0x351fda=_0x1a3967;_0x3151f8=0xc8;}else{_0x3151f8=0xce;}_0x385947[_0xd6f0('0x2e')](_0x3151f8);return _0x385947[_0xd6f0('0x34')](_0xd6f0('0x35'),_0x39e96a+'-'+_0x351fda+'/'+_0x1a3967)[_0xd6f0('0x30')](_0xb61222);}return null;};}function patchUpdates(_0x31c493){return function(_0x376890){try{jsonpatch[_0xd6f0('0x36')](_0x376890,_0x31c493,!![]);}catch(_0x180e5f){return BPromise[_0xd6f0('0x37')](_0x180e5f);}return _0x376890[_0xd6f0('0x38')]();};}function saveUpdates(_0x4a8ebe,_0x11124c){return function(_0x4ed523){if(_0x4ed523){return _0x4ed523['update'](_0x4a8ebe)[_0xd6f0('0x23')](function(_0x52e894){return _0x52e894;});}return null;};}function removeEntity(_0x12a6fa,_0x27ad7e){return function(_0x202838){if(_0x202838){return _0x202838['destroy']()[_0xd6f0('0x23')](function(){var _0x4e5f97=_0x202838[_0xd6f0('0x39')]({'plain':!![]});var _0xbe1408=[{'name':_0xd6f0('0x3a'),'value':_0xd6f0('0x3b'),'ignore':!![]},{'name':_0xd6f0('0x3c'),'value':'agent','ignore':![]},{'name':'Telephones','value':_0xd6f0('0x3d'),'ignore':![]}];var _0xe2958d=_(_0xbe1408)['filter'](_0xd6f0('0x3e'))['map'](_0xd6f0('0x3f'))[_0xd6f0('0x3f')]();if(_[_0xd6f0('0x40')](_0xe2958d,_0x4e5f97[_0xd6f0('0x41')])){return;}var _0x451834=_[_0xd6f0('0x42')](_0xbe1408,[_0xd6f0('0x3f'),_0x4e5f97['role']])['name'];return db[_0xd6f0('0x43')][_0xd6f0('0x44')]({'where':{'type':_0x451834,'resourceId':_0x4e5f97['id']}})[_0xd6f0('0x23')](function(){return _0x202838;});})['then'](function(){_0x12a6fa['status'](0xcc)[_0xd6f0('0x2f')]();});}};}function handleEntityNotFound(_0x2def01,_0x39fd07){return function(_0x38d06f){if(!_0x38d06f){_0x2def01[_0xd6f0('0x2d')](0x194);}return _0x38d06f;};}function handleError(_0x2b5df5,_0x2e9043){_0x2e9043=_0x2e9043||0x1f4;return function(_0x64359c){logger['error'](_0x64359c[_0xd6f0('0x45')]);if(_0x64359c[_0xd6f0('0x46')]){delete _0x64359c[_0xd6f0('0x46')];}_0x2b5df5[_0xd6f0('0x2e')](_0x2e9043)['send'](_0x64359c);};}exports[_0xd6f0('0x47')]=function(_0x94ec6d,_0x30d1ba){var _0x1fd79b={},_0x232ab4={},_0x49181b={'count':0x0,'rows':[]};var _0x332809=db[_0xd6f0('0x48')][_0xd6f0('0x49')];_0x232ab4['model']=_[_0xd6f0('0x4a')](_[_0xd6f0('0x4b')](_0x332809),['password','salt']);_0x232ab4[_0xd6f0('0x4c')]=_[_0xd6f0('0x4b')](_0x94ec6d[_0xd6f0('0x4c')]);_0x232ab4['filters']=_[_0xd6f0('0x4d')](_0x232ab4[_0xd6f0('0x4e')],_0x232ab4['query']);_0x1fd79b[_0xd6f0('0x4f')]=_[_0xd6f0('0x4d')](_0x232ab4[_0xd6f0('0x4e')],qs[_0xd6f0('0x50')](_0x94ec6d['query'][_0xd6f0('0x50')]));_0x1fd79b[_0xd6f0('0x4f')]=_0x1fd79b[_0xd6f0('0x4f')][_0xd6f0('0x51')]?_0x1fd79b[_0xd6f0('0x4f')]:_0x232ab4[_0xd6f0('0x4e')];if(!_0x94ec6d[_0xd6f0('0x4c')][_0xd6f0('0x52')]('nolimit')){_0x1fd79b[_0xd6f0('0x33')]=qs[_0xd6f0('0x33')](_0x94ec6d['query'][_0xd6f0('0x33')]);_0x1fd79b[_0xd6f0('0x32')]=qs[_0xd6f0('0x32')](_0x94ec6d[_0xd6f0('0x4c')]['offset']);}_0x1fd79b[_0xd6f0('0x53')]=qs[_0xd6f0('0x54')](_0x94ec6d['query']['sort']);_0x1fd79b[_0xd6f0('0x55')]=qs['filters'](_[_0xd6f0('0x56')](_0x94ec6d[_0xd6f0('0x4c')],_0x232ab4[_0xd6f0('0x57')]));if(_0x94ec6d['query'][_0xd6f0('0x58')]){_0x1fd79b[_0xd6f0('0x55')]=_[_0xd6f0('0x59')](_0x1fd79b[_0xd6f0('0x55')],{'$or':_[_0xd6f0('0x5a')](_0x332809,function(_0x4c42ce){if(_0x4c42ce[_0xd6f0('0x5b')]['key']!==_0xd6f0('0x5c')){return db[_0xd6f0('0x5d')][_0xd6f0('0x55')](db[_0xd6f0('0x5d')]['fn']('lower',db['sequelize'][_0xd6f0('0x5e')](_0x4c42ce[_0xd6f0('0x5f')])),{'$like':db['sequelize']['fn'](_0xd6f0('0x60'),'%'+_0x94ec6d['query'][_0xd6f0('0x58')]+'%')});}})});}_0x1fd79b=_[_0xd6f0('0x59')]({},_0x1fd79b,_0x94ec6d[_0xd6f0('0x61')]);var _0x41d115={'where':_0x1fd79b[_0xd6f0('0x55')]};return db['User'][_0xd6f0('0x31')](_0x41d115)[_0xd6f0('0x23')](function(_0x3f9d29){_0x49181b[_0xd6f0('0x31')]=_0x3f9d29;if(_0x94ec6d[_0xd6f0('0x4c')][_0xd6f0('0x62')]){_0x1fd79b[_0xd6f0('0x63')]=[{'all':!![]}];}return db[_0xd6f0('0x48')]['findAll'](_0x1fd79b);})[_0xd6f0('0x23')](function(_0x3eb4dc){_0x49181b[_0xd6f0('0x64')]=_0x3eb4dc;return _0x49181b;})[_0xd6f0('0x23')](respondWithFilteredResult(_0x30d1ba,_0x1fd79b))[_0xd6f0('0x2c')](handleError(_0x30d1ba,null));};exports[_0xd6f0('0x65')]=function(_0x43563d,_0x398cb4){var _0x231411={'raw':![],'where':{'id':_0x43563d[_0xd6f0('0x66')]['id']}},_0x5216d8={};_0x5216d8['model']=_['differenceBy'](_[_0xd6f0('0x4b')](db['User']['rawAttributes']),[_0xd6f0('0x67'),_0xd6f0('0x68')]);_0x5216d8[_0xd6f0('0x4c')]=_['keys'](_0x43563d[_0xd6f0('0x4c')]);_0x5216d8[_0xd6f0('0x57')]=_[_0xd6f0('0x4d')](_0x5216d8['model'],_0x5216d8[_0xd6f0('0x4c')]);_0x231411[_0xd6f0('0x4f')]=_['intersection'](_0x5216d8[_0xd6f0('0x4e')],qs[_0xd6f0('0x50')](_0x43563d['query'][_0xd6f0('0x50')]));_0x231411[_0xd6f0('0x4f')]=_0x231411[_0xd6f0('0x4f')][_0xd6f0('0x51')]?_0x231411[_0xd6f0('0x4f')]:_0x5216d8['model'];if(_0x43563d[_0xd6f0('0x4c')][_0xd6f0('0x62')]){_0x231411['include']=[{'all':!![]}];}_0x231411=_[_0xd6f0('0x59')]({},_0x231411,_0x43563d[_0xd6f0('0x61')]);return db[_0xd6f0('0x48')]['find'](_0x231411)[_0xd6f0('0x23')](handleEntityNotFound(_0x398cb4,null))['then'](respondWithResult(_0x398cb4,null))['catch'](handleError(_0x398cb4,null));};exports['bulkCreate']=function(_0x5c5aa4,_0x311140){return db[_0xd6f0('0x48')][_0xd6f0('0x69')](_0x5c5aa4[_0xd6f0('0x6a')],{'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x311140,0xc9))[_0xd6f0('0x2c')](handleError(_0x311140,null));};exports['update']=function(_0x13c194,_0x12162b){if(_0x13c194[_0xd6f0('0x6a')]['id']){delete _0x13c194['body']['id'];}delete _0x13c194[_0xd6f0('0x6a')][_0xd6f0('0x41')];return db[_0xd6f0('0x48')][_0xd6f0('0x42')]({'where':{'id':_0x13c194['params']['id']}})[_0xd6f0('0x23')](handleEntityNotFound(_0x12162b,null))[_0xd6f0('0x23')](saveUpdates(_0x13c194[_0xd6f0('0x6a')],null))['then'](respondWithResult(_0x12162b,null))[_0xd6f0('0x2c')](handleError(_0x12162b,null));};exports[_0xd6f0('0x6b')]=function(_0x1fee47,_0x23d8cb){return db['User'][_0xd6f0('0x6b')]()[_0xd6f0('0x23')](respondWithResult(_0x23d8cb,null))[_0xd6f0('0x2c')](handleError(_0x23d8cb,null));};exports[_0xd6f0('0x6c')]=function(_0x49fc4a,_0x535910,_0x490bc4){return db['User'][_0xd6f0('0x42')]({'where':{'id':_0x49fc4a[_0xd6f0('0x66')]['id']}})[_0xd6f0('0x23')](handleEntityNotFound(_0x535910,null))[_0xd6f0('0x23')](function(_0x318a64){if(_0x318a64){return _0x318a64[_0xd6f0('0x6c')](_0x49fc4a[_0xd6f0('0x6a')][_0xd6f0('0x6d')],_[_0xd6f0('0x6e')](_0x49fc4a['body'],['ids','id'])||{});}})[_0xd6f0('0x23')](respondWithResult(_0x535910,null))['catch'](handleError(_0x535910,null));};var getLicense=function(_0x237bea){return new BPromise(function(_0x3a85bd,_0x30349d){var _0x3dbeb5=0x0;_0x237bea[_0xd6f0('0x6a')][_0xd6f0('0x41')]===_0xd6f0('0x6f')&&_0x3a85bd('agent\x20role');return db[_0xd6f0('0x48')][_0xd6f0('0x31')]({'where':{'$or':[{'role':_0x237bea[_0xd6f0('0x6a')]['role']===_0xd6f0('0x3d')?_0xd6f0('0x3d'):['admin',_0xd6f0('0x3b')]}]}})[_0xd6f0('0x23')](function(_0x1bf313){_0x3dbeb5=_0x1bf313;return require(_0xd6f0('0x70'))[_0xd6f0('0x71')]();})[_0xd6f0('0x23')](function(_0x1c6140){var _0x2efbad=_0x237bea[_0xd6f0('0x6a')]['role']===_0xd6f0('0x3d')?_0xd6f0('0x72'):_0xd6f0('0x73');if(!_[_0xd6f0('0x74')](_0x1c6140[_0x2efbad])&&_0x3dbeb5>=_0x1c6140[_0x2efbad]){return _0x30349d({'message':'License\x20limit\x20reached'});}return _0x3a85bd(util[_0xd6f0('0x75')](_0xd6f0('0x76'),_0x2efbad,_0x3dbeb5));})[_0xd6f0('0x2c')](function(_0x3e74eb){return _0x30349d(_0x3e74eb);});});};exports[_0xd6f0('0x77')]=function(_0x12e0e5,_0x907a6f){return getLicense(_0x12e0e5)[_0xd6f0('0x23')](function(_0x92b8d0){if(!_0x12e0e5[_0xd6f0('0x6a')]['internal']){var _0x440d5c;return db[_0xd6f0('0x78')][_0xd6f0('0x79')](0x1)['then'](function(_0x12a37c){return checkPasswordPattern(_0x12a37c,_0x12e0e5[_0xd6f0('0x6a')][_0xd6f0('0x67')],_0x12a37c[_0xd6f0('0x7a')]);})[_0xd6f0('0x23')](function(_0xa41e33){_0x440d5c=_0xa41e33[_0xd6f0('0x7b')];return db[_0xd6f0('0x48')][_0xd6f0('0x7c')](_0xd6f0('0x7d'));})[_0xd6f0('0x23')](function(_0x5b3155){if(_['isNil'](_0x5b3155)){if(_0x440d5c){_0x12e0e5[_0xd6f0('0x6a')][_0xd6f0('0x7d')]=_0x440d5c;}else{_0x12e0e5[_0xd6f0('0x6a')][_0xd6f0('0x7d')]=0x1;}}else{if(_[_0xd6f0('0x74')](_0x440d5c)||_0x440d5c==_0x5b3155){_0x12e0e5['body'][_0xd6f0('0x7d')]=_0x5b3155+0x1;}else if(_0x440d5c>_0x5b3155){_0x12e0e5[_0xd6f0('0x6a')]['internal']=_0x440d5c;}else{return db[_0xd6f0('0x5d')]['query'](_0xd6f0('0x7e'),{'type':db[_0xd6f0('0x5d')][_0xd6f0('0x7f')][_0xd6f0('0x80')]})[_0xd6f0('0x23')](function(_0x5e4e6c){if(_0x5e4e6c&&_0x5e4e6c['length']){for(var _0x1025df=0x0,_0x17b320=_0x5e4e6c['length'];_0x1025df<_0x17b320&&_[_0xd6f0('0x74')](_0x12e0e5['body']['internal']);_0x1025df++){if(_0x440d5c<=_0x5e4e6c[_0x1025df][_0xd6f0('0x81')]){_0x12e0e5['body']['internal']=_0x5e4e6c[_0x1025df]['from'];}else if(_0x440d5c>_0x5e4e6c[_0x1025df]['from']&&_0x440d5c<=_0x5e4e6c[_0x1025df]['to']){_0x12e0e5[_0xd6f0('0x6a')][_0xd6f0('0x7d')]=_0x440d5c;}}}if(_[_0xd6f0('0x74')](_0x12e0e5[_0xd6f0('0x6a')][_0xd6f0('0x7d')])){_0x12e0e5[_0xd6f0('0x6a')][_0xd6f0('0x7d')]=_0x5b3155+0x1;}});}}});}})[_0xd6f0('0x23')](function(){if(_0x12e0e5[_0xd6f0('0x6a')]['voicemail']){_0x12e0e5[_0xd6f0('0x6a')]['mailbox']=_0x12e0e5['body'][_0xd6f0('0x7d')];_0x12e0e5[_0xd6f0('0x6a')][_0xd6f0('0x82')]={'mailbox':_0x12e0e5['body'][_0xd6f0('0x7d')],'password':_0x12e0e5[_0xd6f0('0x6a')][_0xd6f0('0x67')],'fullname':_0x12e0e5[_0xd6f0('0x6a')][_0xd6f0('0x83')],'email':_0x12e0e5[_0xd6f0('0x6a')][_0xd6f0('0x84')]};}if(_0x12e0e5[_0xd6f0('0x6a')]&&_0x12e0e5['body'][_0xd6f0('0x41')]===_0xd6f0('0x6f')){_0x12e0e5['body'][_0xd6f0('0x85')]=[_0xd6f0('0x86'),_0xd6f0('0x87'),_0xd6f0('0x88'),_0xd6f0('0x89'),_0xd6f0('0x8a'),_0xd6f0('0x8b'),'106',_0xd6f0('0x8c'),_0xd6f0('0x8d'),_0xd6f0('0x8e'),'100','111'];}return db['User'][_0xd6f0('0x77')](_0x12e0e5[_0xd6f0('0x6a')],{'include':[{'model':db[_0xd6f0('0x82')],'as':_0xd6f0('0x82')}]});})[_0xd6f0('0x23')](function(_0x48d87d){if(_0x12e0e5['body'][_0xd6f0('0x41')]===_0xd6f0('0x3b'))return _0x48d87d;var _0x422c55=_0x12e0e5[_0xd6f0('0x3b')]['get']({'plain':!![]});if(!_0x422c55)throw new Error(_0xd6f0('0x8f'));if(_0x422c55['role']===_0xd6f0('0x3b')){var _0x4d53fc=_0x48d87d[_0xd6f0('0x39')]({'plain':!![]});var _0x159e51=[{'name':'Agents','value':_0xd6f0('0x6f')},{'name':_0xd6f0('0x90'),'value':_0xd6f0('0x3d')}];var _0x3ac31d=_[_0xd6f0('0x42')](_0x159e51,[_0xd6f0('0x3f'),_0x4d53fc[_0xd6f0('0x41')]])[_0xd6f0('0x46')];return db[_0xd6f0('0x91')][_0xd6f0('0x42')]({'where':{'name':_0x3ac31d,'userProfileId':_0x422c55[_0xd6f0('0x92')]},'raw':!![]})[_0xd6f0('0x23')](function(_0x1e495f){if(_0x1e495f&&_0x1e495f[_0xd6f0('0x93')]===0x0){return db['UserProfileResource'][_0xd6f0('0x77')]({'name':_0x4d53fc[_0xd6f0('0x46')],'resourceId':_0x4d53fc['id'],'type':_0x1e495f[_0xd6f0('0x46')],'sectionId':_0x1e495f['id']},{})[_0xd6f0('0x23')](function(){return _0x48d87d;});}else{return _0x48d87d;}})[_0xd6f0('0x2c')](function(_0x32159d){logger[_0xd6f0('0x28')](_0xd6f0('0x94'),_0x32159d);throw _0x32159d;});}return _0x48d87d;})[_0xd6f0('0x23')](respondWithResult(_0x907a6f,0xc9))[_0xd6f0('0x2c')](handleError(_0x907a6f,null));};exports[_0xd6f0('0x95')]=function(_0x34b6fa,_0xcefe48,_0x1e8e6a){var _0x515d68=![];if(_0x34b6fa['body']['id']){delete _0x34b6fa[_0xd6f0('0x6a')]['id'];}if(!_[_0xd6f0('0x74')](_0x34b6fa[_0xd6f0('0x6a')][_0xd6f0('0x96')])){if(_0x34b6fa[_0xd6f0('0x6a')]['oldPassword']===_0x34b6fa[_0xd6f0('0x6a')][_0xd6f0('0x97')]){throw new Error(_0xd6f0('0x98'));}}return db[_0xd6f0('0x48')]['find']({'where':{'id':_0x34b6fa[_0xd6f0('0x66')]['id']}})[_0xd6f0('0x23')](function(_0xdf9554){if(_0xdf9554){if(_0xdf9554['id']==_0x34b6fa[_0xd6f0('0x3b')]['id']){if(!_0x34b6fa[_0xd6f0('0x6a')][_0xd6f0('0x96')]||!_0x34b6fa['body']['newPassword']){throw new db[(_0xd6f0('0x99'))]['ValidationError'](_0xd6f0('0x9a'));}if(!_0xdf9554['authenticate'](_0x34b6fa[_0xd6f0('0x6a')][_0xd6f0('0x96')])){throw new db['Sequelize'][(_0xd6f0('0x9b'))]('Wrong\x20credentials');}if(_0x34b6fa[_0xd6f0('0x6a')][_0xd6f0('0x96')]==_0x34b6fa[_0xd6f0('0x6a')][_0xd6f0('0x97')]){throw new db['Sequelize'][(_0xd6f0('0x9b'))](_0xd6f0('0x9c'));}return _0xdf9554;}else if(_0x34b6fa[_0xd6f0('0x3b')]['role']==_0xd6f0('0x9d')){if(!_0x34b6fa[_0xd6f0('0x6a')][_0xd6f0('0x97')]){throw new db['Sequelize']['ValidationError'](_0xd6f0('0x9e'));}return _0xdf9554;}else if(_0x34b6fa[_0xd6f0('0x3b')][_0xd6f0('0x41')]=='user'){if(!_0x34b6fa[_0xd6f0('0x6a')][_0xd6f0('0x97')]){throw new db[(_0xd6f0('0x99'))][(_0xd6f0('0x9b'))](_0xd6f0('0x9e'));}if(_0xdf9554[_0xd6f0('0x41')]!=_0xd6f0('0x6f')){throw new db['Sequelize'][(_0xd6f0('0x9b'))]('Unauthorized');}return _0xdf9554;}else{throw new db[(_0xd6f0('0x99'))][(_0xd6f0('0x9b'))](_0xd6f0('0x9f'));}}return null;})['then'](handleEntityNotFound(_0xcefe48,null))[_0xd6f0('0x23')](function(_0x557b3c){return db['Setting'][_0xd6f0('0xa0')]({'attributes':['id',_0xd6f0('0x7a')]})[_0xd6f0('0x23')](function(_0x5b270f){_0x515d68=_0x5b270f[_0xd6f0('0x7a')];return checkPasswordPattern(_0x557b3c,_0x34b6fa['body']['newPassword'],_0x515d68);});})[_0xd6f0('0x23')](saveUpdates({'password':_0x34b6fa[_0xd6f0('0x6a')][_0xd6f0('0x97')],'passwordResetAt':_0x34b6fa[_0xd6f0('0x3b')]['id']==_0x34b6fa[_0xd6f0('0x66')]['id']?moment():null},null))[_0xd6f0('0x23')](respondWithResult(_0xcefe48,null))['catch'](handleError(_0xcefe48,null));};exports[_0xd6f0('0xa1')]=function(_0x5b8770,_0x1c07b8,_0x4f4517){var _0x468016=_0x5b8770[_0xd6f0('0x6a')]['channel'];return db[_0xd6f0('0x48')][_0xd6f0('0x42')]({'where':{'id':_0x5b8770[_0xd6f0('0x66')]['id']},'attributes':['id',_0xd6f0('0x46'),_0xd6f0('0x41'),_0xd6f0('0xa2'),_0xd6f0('0xa3'),_0xd6f0('0xa4'),'interface']})[_0xd6f0('0x23')](handleEntityNotFound(_0x1c07b8,null))[_0xd6f0('0x23')](function(_0x529c3d){if(_0x529c3d){if(!utils[_0xd6f0('0xa5')](_0x468016)){throw new db['Sequelize'][(_0xd6f0('0x9b'))](_0xd6f0('0xa6'));}return _0x529c3d[_0xd6f0('0xa7')+_[_0xd6f0('0xa8')](_0x468016['toLowerCase']())+'Queues'](_0x5b8770[_0xd6f0('0x6a')][_0xd6f0('0x6d')],{'penalty':_0x5b8770[_0xd6f0('0x6a')][_0xd6f0('0xa9')]||0x0})[_0xd6f0('0xaa')](function(_0x335011){for(var _0x15bb65=0x0;_0x15bb65<_0x5b8770['body'][_0xd6f0('0x6d')][_0xd6f0('0x51')];_0x15bb65+=0x1){var _0x2c609b={'UserId':_0x5b8770[_0xd6f0('0x66')]['id']};_0x2c609b[_['capitalize'](_0x468016[_0xd6f0('0xab')]())+'QueueId']=_0x5b8770['body'][_0xd6f0('0x6d')][_0x15bb65];socket['emit'](_0xd6f0('0x3b')+_[_0xd6f0('0xa8')](_0x468016[_0xd6f0('0xab')]())+_0xd6f0('0xac'),_0x2c609b);}return _0x335011;})[_0xd6f0('0x23')](function(){if(_0x468016===_0xd6f0('0xad')){return db[_0xd6f0('0xae')]['findAll']({'where':{'id':_0x5b8770[_0xd6f0('0x6a')][_0xd6f0('0x6d')]||[]},'raw':!![],'attributes':['id',_0xd6f0('0x46')]});}})['then'](function(_0x28918e){var _0x195902=_0x529c3d[_0xd6f0('0x39')]({'plain':!![]});var _0x7455cf=[];if(_0x468016==='voice'&&_0x195902[_0xd6f0('0x41')]==='agent'&&_0x195902[_0xd6f0('0xa2')]){for(var _0x4feccf=0x0;_0x4feccf<_0x28918e[_0xd6f0('0x51')];_0x4feccf+=0x1){_0x7455cf[_0xd6f0('0xaf')]({'membername':_0x195902[_0xd6f0('0x46')],'UserId':_0x195902['id'],'queue_name':_0x28918e[_0x4feccf][_0xd6f0('0x46')],'VoiceQueueId':_0x28918e[_0x4feccf]['id'],'interface':_[_0xd6f0('0x74')](_0x195902[_0xd6f0('0xb0')])?util[_0xd6f0('0x75')]('SIP/%s',_0x195902['name']):_0x195902[_0xd6f0('0xb0')],'paused':_0x195902['voicePause']||![],'penalty':_0x5b8770[_0xd6f0('0x6a')][_0xd6f0('0xa9')]||0x0});}return BPromise[_0xd6f0('0xb1')](_0x7455cf,function(_0x2bae25){return db[_0xd6f0('0xb2')][_0xd6f0('0xb3')](_0x2bae25);});}return _0x529c3d;});}})[_0xd6f0('0x23')](respondWithStatusCode(_0x1c07b8,null))[_0xd6f0('0x2c')](handleError(_0x1c07b8,null));};exports[_0xd6f0('0xb4')]=function(_0x33ae30,_0x37df8d,_0x4a11dc){var _0x35aa46;return db['User'][_0xd6f0('0x42')]({'where':{'id':_0x33ae30[_0xd6f0('0x66')]['id']},'attributes':['id','name',_0xd6f0('0x41')]})[_0xd6f0('0x23')](handleEntityNotFound(_0x37df8d,null))[_0xd6f0('0x23')](function(_0xcc9d50){if(_0xcc9d50){_0x35aa46=_0xcc9d50;if(!_0x33ae30[_0xd6f0('0x4c')][_0xd6f0('0xb5')]||!utils[_0xd6f0('0xa5')](_0x33ae30[_0xd6f0('0x4c')][_0xd6f0('0xb5')])){throw new db['Sequelize'][(_0xd6f0('0x9b'))](_0xd6f0('0xa6'));}return _0xcc9d50['remove'+_[_0xd6f0('0xa8')](_0x33ae30['query']['channel']['toLowerCase']())+_0xd6f0('0xb6')](_0x33ae30[_0xd6f0('0x4c')]['ids']);}})[_0xd6f0('0x23')](function(_0x387a9c){for(var _0x3fb73f=0x0;_0x3fb73f<_0x33ae30[_0xd6f0('0x4c')][_0xd6f0('0x6d')][_0xd6f0('0x51')];_0x3fb73f+=0x1){var _0x4589dd={'UserId':_0x33ae30[_0xd6f0('0x66')]['id']};_0x4589dd[_['capitalize'](_0x33ae30[_0xd6f0('0x4c')][_0xd6f0('0xb5')]['toLowerCase']())+_0xd6f0('0xb7')]=_0x33ae30['query'][_0xd6f0('0x6d')][_0x3fb73f];socket[_0xd6f0('0xb8')](_0xd6f0('0x3b')+_[_0xd6f0('0xa8')](_0x33ae30['query'][_0xd6f0('0xb5')]['toLowerCase']())+'Queue:remove',_0x4589dd);}return _0x387a9c;})[_0xd6f0('0x23')](function(){if(_0x33ae30[_0xd6f0('0x4c')][_0xd6f0('0xb5')]==='voice'){return db[_0xd6f0('0xb2')][_0xd6f0('0x44')]({'where':{'UserId':_0x33ae30[_0xd6f0('0x66')]['id'],'VoiceQueueId':_0x33ae30[_0xd6f0('0x4c')][_0xd6f0('0x6d')]},'individualHooks':!![]})['then'](function(){return _0x35aa46;});}return _0x35aa46;})[_0xd6f0('0x23')](respondWithStatusCode(_0x37df8d,null))[_0xd6f0('0x2c')](handleError(_0x37df8d,null));};exports['addAvatar']=function(_0x3c86ac,_0x5a6a6f,_0x3bbeb9){_0x3c86ac[_0xd6f0('0x6a')][_0xd6f0('0xb9')]=_0x3c86ac[_0xd6f0('0xba')][_0xd6f0('0xbb')];return db[_0xd6f0('0x48')][_0xd6f0('0x42')]({'where':{'id':_0x3c86ac['params']['id']}})['then'](handleEntityNotFound(_0x5a6a6f,null))[_0xd6f0('0x23')](saveUpdates(_0x3c86ac['body'],null))[_0xd6f0('0x23')](respondWithResult(_0x5a6a6f,null))[_0xd6f0('0x2c')](handleError(_0x5a6a6f,null));};exports[_0xd6f0('0xbc')]=function(_0x5be6e9,_0xdd12a1,_0x498cc2){var _0x39f781=path[_0xd6f0('0xbd')](config['root'],_0xd6f0('0xbe'));return db[_0xd6f0('0x48')]['find']({'where':{'id':_0x5be6e9['params']['id']},'attributes':['id','userpic'],'raw':!![]})[_0xd6f0('0x23')](handleEntityNotFound(_0xdd12a1,null))[_0xd6f0('0x23')](function(_0x3c5883){if(_0x3c5883){if(_[_0xd6f0('0x74')](_0x3c5883[_0xd6f0('0xb9')])){return _0xdd12a1['download'](_0x39f781);}else{if(!fs[_0xd6f0('0xbf')](path[_0xd6f0('0xbd')](config[_0xd6f0('0xc0')],_0xd6f0('0xc1'),_0x3c5883[_0xd6f0('0xb9')]))){return _0xdd12a1[_0xd6f0('0xc2')](_0x39f781);}return _0xdd12a1[_0xd6f0('0xc2')](path[_0xd6f0('0xbd')](config[_0xd6f0('0xc0')],_0xd6f0('0xc1'),_0x3c5883[_0xd6f0('0xb9')]));}}})[_0xd6f0('0x2c')](handleError(_0xdd12a1,null));};exports[_0xd6f0('0xc3')]=function(_0x14cc19,_0x4dafe2,_0x514f0c){var _0x138fa2={};var _0x2749c1={};var _0x5ecd78;var _0x1bd3ef;return db[_0xd6f0('0x48')][_0xd6f0('0xa0')]({'where':{'id':_0x14cc19[_0xd6f0('0x66')]['id']}})[_0xd6f0('0x23')](handleEntityNotFound(_0x4dafe2,null))[_0xd6f0('0x23')](function(_0x42ffcf){if(_0x42ffcf){_0x5ecd78=_0x42ffcf;_0x2749c1['model']=_[_0xd6f0('0x4b')](db[_0xd6f0('0xc4')][_0xd6f0('0x49')]);_0x2749c1[_0xd6f0('0x4c')]=_['keys'](_0x14cc19[_0xd6f0('0x4c')]);_0x2749c1[_0xd6f0('0x57')]=_[_0xd6f0('0x4d')](_0x2749c1['model'],_0x2749c1[_0xd6f0('0x4c')]);_0x138fa2['attributes']=_[_0xd6f0('0x4d')](_0x2749c1[_0xd6f0('0x4e')],qs[_0xd6f0('0x50')](_0x14cc19[_0xd6f0('0x4c')][_0xd6f0('0x50')]));_0x138fa2[_0xd6f0('0x4f')]=_0x138fa2[_0xd6f0('0x4f')][_0xd6f0('0x51')]?_0x138fa2[_0xd6f0('0x4f')]:_0x2749c1[_0xd6f0('0x4e')];_0x138fa2[_0xd6f0('0x53')]=qs[_0xd6f0('0x54')](_0x14cc19[_0xd6f0('0x4c')][_0xd6f0('0x54')]);_0x138fa2[_0xd6f0('0x55')]=qs[_0xd6f0('0x57')](_['pick'](_0x14cc19[_0xd6f0('0x4c')],_0x2749c1[_0xd6f0('0x57')]));if(_0x14cc19[_0xd6f0('0x4c')][_0xd6f0('0x58')]){_0x138fa2['where']=_[_0xd6f0('0x59')](_0x138fa2['where'],{'$or':_['map'](_0x138fa2[_0xd6f0('0x4f')],function(_0x5a4a86){var _0x369d4e={};_0x369d4e[_0x5a4a86]={'$like':'%'+_0x14cc19[_0xd6f0('0x4c')][_0xd6f0('0x58')]+'%'};return _0x369d4e;})});}_0x138fa2=_['merge']({},_0x138fa2,_0x14cc19[_0xd6f0('0x61')]);return _0x5ecd78['getContacts'](_0x138fa2);}})[_0xd6f0('0x23')](function(_0x160bca){if(_0x160bca){_0x1bd3ef=_0x160bca[_0xd6f0('0x51')];if(_0x14cc19['query'][_0xd6f0('0x52')](_0xd6f0('0x62'))){_0x138fa2[_0xd6f0('0x63')]=[{'model':db[_0xd6f0('0xc5')],'as':_0xd6f0('0xc6'),'required':![]},{'model':db[_0xd6f0('0xc7')],'as':'Tags','attributes':['id',_0xd6f0('0x46'),_0xd6f0('0xc8')],'where':_0x14cc19[_0xd6f0('0x4c')][_0xd6f0('0xc9')]?{'id':_0x14cc19['query'][_0xd6f0('0xc9')]}:undefined,'required':_0x14cc19['query'][_0xd6f0('0xc9')]?!![]:![]}];}if(!_0x14cc19['query']['hasOwnProperty'](_0xd6f0('0xca'))){_0x138fa2[_0xd6f0('0x33')]=qs[_0xd6f0('0x33')](_0x14cc19['query'][_0xd6f0('0x33')]);_0x138fa2['offset']=qs[_0xd6f0('0x32')](_0x14cc19[_0xd6f0('0x4c')][_0xd6f0('0x32')]);}return _0x5ecd78[_0xd6f0('0xc3')](_0x138fa2);}})[_0xd6f0('0x23')](function(_0x33a5c9){if(_0x33a5c9){return _0x33a5c9?{'count':_0x1bd3ef,'rows':_0x33a5c9}:null;}})[_0xd6f0('0x23')](respondWithResult(_0x4dafe2,null))[_0xd6f0('0x2c')](handleError(_0x4dafe2,null));};exports[_0xd6f0('0xcb')]=function(_0x148bf3,_0x26a9ef,_0x1b4af2){var _0x4b964b;var _0x4d99ac;var _0xbc8f6d={};var _0x45d23a;return db[_0xd6f0('0x48')][_0xd6f0('0xa0')]({'where':{'id':_0x148bf3['params']['id']},'attributes':['id',_0xd6f0('0x46'),'role']})[_0xd6f0('0x23')](handleEntityNotFound(_0x26a9ef,null))[_0xd6f0('0x23')](function(_0x3f32e6){if(!utils[_0xd6f0('0xa5')](_0x148bf3[_0xd6f0('0x4c')]['channel'])){throw new db[(_0xd6f0('0x99'))][(_0xd6f0('0x9b'))]('Unknown\x20channel');}_0x4b964b=_0x3f32e6;var _0x88b850={};_0x88b850[_0xd6f0('0x4e')]=_[_0xd6f0('0x4b')](db[_[_0xd6f0('0xa8')](_0x148bf3['query']['channel'])+_0xd6f0('0xcc')][_0xd6f0('0x49')]);_0x88b850[_0xd6f0('0x4c')]=_[_0xd6f0('0x4b')](_0x148bf3[_0xd6f0('0x4c')]);_0x88b850[_0xd6f0('0x57')]=_[_0xd6f0('0x4d')](_0x88b850[_0xd6f0('0x4e')],_0x88b850['query']);_0xbc8f6d[_0xd6f0('0x4f')]=_[_0xd6f0('0x4d')](_0x88b850[_0xd6f0('0x4e')],qs[_0xd6f0('0x50')](_0x148bf3[_0xd6f0('0x4c')][_0xd6f0('0x50')]));_0xbc8f6d[_0xd6f0('0x4f')]=_0xbc8f6d[_0xd6f0('0x4f')][_0xd6f0('0x51')]?_0xbc8f6d[_0xd6f0('0x4f')]:_0x88b850[_0xd6f0('0x4e')];_0xbc8f6d['order']=qs['sort'](_0x148bf3[_0xd6f0('0x4c')]['sort']);_0xbc8f6d[_0xd6f0('0x55')]=qs[_0xd6f0('0x57')](_[_0xd6f0('0x56')](_0x148bf3[_0xd6f0('0x4c')],_0x88b850[_0xd6f0('0x57')]));if(_0x148bf3[_0xd6f0('0x4c')][_0xd6f0('0x58')]){_0xbc8f6d['where']=_[_0xd6f0('0x59')](_0xbc8f6d[_0xd6f0('0x55')],{'$or':_[_0xd6f0('0x5a')](_0xbc8f6d['attributes'],function(_0x50d549){var _0x225381={};_0x225381[_0x50d549]={'$like':'%'+_0x148bf3[_0xd6f0('0x4c')][_0xd6f0('0x58')]+'%'};return _0x225381;})});}_0xbc8f6d=_[_0xd6f0('0x59')]({},_0xbc8f6d,_0x148bf3['options']);switch(_0x4b964b[_0xd6f0('0x41')]){case _0xd6f0('0x9d'):return db[_['capitalize'](_0x148bf3[_0xd6f0('0x4c')][_0xd6f0('0xb5')])+_0xd6f0('0xcc')][_0xd6f0('0xcd')](_0xbc8f6d);case'user':case _0xd6f0('0x6f'):return _0x4b964b[_0xd6f0('0x39')+_['capitalize'](_0x148bf3['query'][_0xd6f0('0xb5')])+_0xd6f0('0xb6')](_0xbc8f6d);default:throw new db[(_0xd6f0('0x99'))][(_0xd6f0('0x9b'))](_0xd6f0('0xce'));}})[_0xd6f0('0x23')](function(_0x3dad2c){_0x45d23a=_0x3dad2c[_0xd6f0('0x51')];if(!_0x148bf3[_0xd6f0('0x4c')][_0xd6f0('0x52')]('nolimit')){_0xbc8f6d[_0xd6f0('0x33')]=qs[_0xd6f0('0x33')](_0x148bf3[_0xd6f0('0x4c')][_0xd6f0('0x33')]);_0xbc8f6d[_0xd6f0('0x32')]=qs[_0xd6f0('0x32')](_0x148bf3['query']['offset']);}switch(_0x4b964b[_0xd6f0('0x41')]){case _0xd6f0('0x9d'):return db[_[_0xd6f0('0xa8')](_0x148bf3[_0xd6f0('0x4c')]['channel'])+_0xd6f0('0xcc')][_0xd6f0('0xcd')](_0xbc8f6d);case _0xd6f0('0x3b'):case _0xd6f0('0x6f'):return _0x4b964b[_0xd6f0('0x39')+_['capitalize'](_0x148bf3[_0xd6f0('0x4c')][_0xd6f0('0xb5')])+'Queues'](_0xbc8f6d);}})[_0xd6f0('0x23')](function(_0x147dc9){return{'count':_0x45d23a,'rows':_0x147dc9};})['then'](respondWithResult(_0x26a9ef,null))[_0xd6f0('0x2c')](handleError(_0x26a9ef,null));};exports[_0xd6f0('0xcf')]=function(_0x420387,_0x1bdcd6,_0x11e1e9){var _0x14dbb5={};var _0x1fa8ed={};var _0x3c1e84;var _0x18609f;return db[_0xd6f0('0x48')][_0xd6f0('0xa0')]({'where':{'id':_0x420387['params']['id']}})[_0xd6f0('0x23')](handleEntityNotFound(_0x1bdcd6,null))['then'](function(_0x13e15c){if(_0x13e15c){_0x3c1e84=_0x13e15c;_0x1fa8ed[_0xd6f0('0x4e')]=_[_0xd6f0('0x4b')](db['UserVoiceQueueRt'][_0xd6f0('0x49')]);_0x1fa8ed[_0xd6f0('0x4c')]=_[_0xd6f0('0x4b')](_0x420387[_0xd6f0('0x4c')]);_0x1fa8ed[_0xd6f0('0x57')]=_['intersection'](_0x1fa8ed['model'],_0x1fa8ed[_0xd6f0('0x4c')]);_0x14dbb5[_0xd6f0('0x4f')]=_[_0xd6f0('0x4d')](_0x1fa8ed[_0xd6f0('0x4e')],qs[_0xd6f0('0x50')](_0x420387[_0xd6f0('0x4c')][_0xd6f0('0x50')]));_0x14dbb5[_0xd6f0('0x4f')]=_0x14dbb5['attributes']['length']?_0x14dbb5['attributes']:_0x1fa8ed[_0xd6f0('0x4e')];_0x14dbb5['order']=qs[_0xd6f0('0x54')](_0x420387[_0xd6f0('0x4c')][_0xd6f0('0x54')]);_0x14dbb5[_0xd6f0('0x55')]=qs[_0xd6f0('0x57')](_[_0xd6f0('0x56')](_0x420387[_0xd6f0('0x4c')],_0x1fa8ed[_0xd6f0('0x57')]));if(_0x420387[_0xd6f0('0x4c')][_0xd6f0('0x58')]){_0x14dbb5['where']=_[_0xd6f0('0x59')](_0x14dbb5['where'],{'$or':_[_0xd6f0('0x5a')](_0x14dbb5[_0xd6f0('0x4f')],function(_0x5d685f){var _0x22ac86={};_0x22ac86[_0x5d685f]={'$like':'%'+_0x420387[_0xd6f0('0x4c')][_0xd6f0('0x58')]+'%'};return _0x22ac86;})});}_0x14dbb5=_[_0xd6f0('0x59')]({},_0x14dbb5,_0x420387[_0xd6f0('0x61')]);return _0x3c1e84['getVoiceQueuesRt'](_0x14dbb5);}})['then'](function(_0x5b3d83){if(_0x5b3d83){_0x18609f=_0x5b3d83['length'];if(!_0x420387[_0xd6f0('0x4c')]['hasOwnProperty'](_0xd6f0('0xca'))){_0x14dbb5[_0xd6f0('0x33')]=qs[_0xd6f0('0x33')](_0x420387[_0xd6f0('0x4c')][_0xd6f0('0x33')]);_0x14dbb5[_0xd6f0('0x32')]=qs['offset'](_0x420387[_0xd6f0('0x4c')][_0xd6f0('0x32')]);}return _0x3c1e84[_0xd6f0('0xcf')](_0x14dbb5);}})[_0xd6f0('0x23')](function(_0xefe3e){if(_0xefe3e){return _0xefe3e?{'count':_0x18609f,'rows':_0xefe3e}:null;}})[_0xd6f0('0x23')](respondWithResult(_0x1bdcd6,null))['catch'](handleError(_0x1bdcd6,null));};exports['getGroups']=function(_0x103544,_0x69694c,_0x5bd53f){var _0x45fcbe={};var _0x270f8f={};var _0x47be7a;var _0x42cf7d;return db[_0xd6f0('0x48')][_0xd6f0('0xa0')]({'where':{'id':_0x103544['params']['id']}})[_0xd6f0('0x23')](handleEntityNotFound(_0x69694c,null))[_0xd6f0('0x23')](function(_0x46fe26){if(_0x46fe26){_0x47be7a=_0x46fe26;_0x270f8f[_0xd6f0('0x4e')]=_[_0xd6f0('0x4b')](db['ChatGroup'][_0xd6f0('0x49')]);_0x270f8f[_0xd6f0('0x4c')]=_[_0xd6f0('0x4b')](_0x103544[_0xd6f0('0x4c')]);_0x270f8f[_0xd6f0('0x57')]=_[_0xd6f0('0x4d')](_0x270f8f[_0xd6f0('0x4e')],_0x270f8f[_0xd6f0('0x4c')]);_0x45fcbe[_0xd6f0('0x4f')]=_[_0xd6f0('0x4d')](_0x270f8f[_0xd6f0('0x4e')],qs['fields'](_0x103544[_0xd6f0('0x4c')][_0xd6f0('0x50')]));_0x45fcbe['attributes']=_0x45fcbe[_0xd6f0('0x4f')]['length']?_0x45fcbe[_0xd6f0('0x4f')]:_0x270f8f[_0xd6f0('0x4e')];_0x45fcbe['order']=qs[_0xd6f0('0x54')](_0x103544['query'][_0xd6f0('0x54')]);_0x45fcbe['where']=qs[_0xd6f0('0x57')](_[_0xd6f0('0x56')](_0x103544['query'],_0x270f8f['filters']));if(_0x103544[_0xd6f0('0x4c')][_0xd6f0('0x58')]){_0x45fcbe[_0xd6f0('0x55')]=_['merge'](_0x45fcbe[_0xd6f0('0x55')],{'$or':_[_0xd6f0('0x5a')](_0x45fcbe[_0xd6f0('0x4f')],function(_0x44613f){var _0x2a9fb9={};_0x2a9fb9[_0x44613f]={'$like':'%'+_0x103544['query'][_0xd6f0('0x58')]+'%'};return _0x2a9fb9;})});}_0x45fcbe=_[_0xd6f0('0x59')]({},_0x45fcbe,_0x103544[_0xd6f0('0x61')]);return _0x47be7a[_0xd6f0('0xd0')](_0x45fcbe);}})[_0xd6f0('0x23')](function(_0x17f814){if(_0x17f814){_0x42cf7d=_0x17f814[_0xd6f0('0x51')];if(!_0x103544['query'][_0xd6f0('0x52')](_0xd6f0('0xca'))){_0x45fcbe['limit']=qs[_0xd6f0('0x33')](_0x103544[_0xd6f0('0x4c')]['limit']);_0x45fcbe[_0xd6f0('0x32')]=qs[_0xd6f0('0x32')](_0x103544[_0xd6f0('0x4c')][_0xd6f0('0x32')]);}return _0x47be7a[_0xd6f0('0xd0')](_0x45fcbe);}})[_0xd6f0('0x23')](function(_0x5b684f){if(_0x5b684f){return _0x5b684f?{'count':_0x42cf7d,'rows':_0x5b684f}:null;}})[_0xd6f0('0x23')](respondWithResult(_0x69694c,null))['catch'](handleError(_0x69694c,null));};exports[_0xd6f0('0xd1')]=function(_0x475e8d,_0x5e7768,_0x161ff0){var _0x48f192={'raw':!![],'where':{}};var _0x3d68d5={};var _0x2a87b5={'count':0x0,'rows':[]};return db[_0xd6f0('0x48')][_0xd6f0('0xa0')]({'where':{'id':_0x475e8d[_0xd6f0('0x66')]['id']}})[_0xd6f0('0x23')](handleEntityNotFound(_0x5e7768,null))[_0xd6f0('0x23')](function(_0x5e1062){if(_0x5e1062){_0x3d68d5[_0xd6f0('0x4e')]=_[_0xd6f0('0x4b')](db[_0xd6f0('0xd2')][_0xd6f0('0x49')]);_0x3d68d5[_0xd6f0('0x4c')]=_['keys'](_0x475e8d[_0xd6f0('0x4c')]);_0x3d68d5['filters']=_[_0xd6f0('0x4d')](_0x3d68d5['model'],_0x3d68d5[_0xd6f0('0x4c')]);_0x48f192[_0xd6f0('0x4f')]=_['intersection'](_0x3d68d5[_0xd6f0('0x4e')],qs['fields'](_0x475e8d['query'][_0xd6f0('0x50')]));_0x48f192[_0xd6f0('0x4f')]=_0x48f192[_0xd6f0('0x4f')][_0xd6f0('0x51')]?_0x48f192[_0xd6f0('0x4f')]:_0x3d68d5[_0xd6f0('0x4e')];if(!_0x475e8d[_0xd6f0('0x4c')][_0xd6f0('0x52')](_0xd6f0('0xca'))){_0x48f192[_0xd6f0('0x33')]=qs[_0xd6f0('0x33')](_0x475e8d[_0xd6f0('0x4c')][_0xd6f0('0x33')]);_0x48f192[_0xd6f0('0x32')]=qs[_0xd6f0('0x32')](_0x475e8d['query'][_0xd6f0('0x32')]);}_0x48f192[_0xd6f0('0x53')]=qs['sort'](_0x475e8d[_0xd6f0('0x4c')][_0xd6f0('0x54')]);_0x48f192[_0xd6f0('0x55')]=qs[_0xd6f0('0x57')](_[_0xd6f0('0x56')](_0x475e8d[_0xd6f0('0x4c')],_0x3d68d5[_0xd6f0('0x57')]));_0x48f192['where'][_0xd6f0('0xd3')]=_0x5e1062['id'];if(_0x475e8d[_0xd6f0('0x4c')][_0xd6f0('0x58')]){_0x48f192[_0xd6f0('0x55')]=_[_0xd6f0('0x59')](_0x48f192['where'],{'$or':_[_0xd6f0('0x5a')](_0x48f192[_0xd6f0('0x4f')],function(_0x2eda7f){var _0x56c2e1={};_0x56c2e1[_0x2eda7f]={'$like':'%'+_0x475e8d[_0xd6f0('0x4c')][_0xd6f0('0x58')]+'%'};return _0x56c2e1;})});}_0x48f192=_[_0xd6f0('0x59')]({},_0x48f192,_0x475e8d[_0xd6f0('0x61')]);return db['VoiceRecording'][_0xd6f0('0x31')]({'where':_0x48f192[_0xd6f0('0x55')]})[_0xd6f0('0x23')](function(_0x32c2af){_0x2a87b5[_0xd6f0('0x31')]=_0x32c2af;if(_0x475e8d[_0xd6f0('0x4c')][_0xd6f0('0x62')]){_0x48f192[_0xd6f0('0x63')]=[{'all':!![]}];}return db[_0xd6f0('0xd2')][_0xd6f0('0xcd')](_0x48f192);})['then'](function(_0x48e6f1){_0x2a87b5[_0xd6f0('0x64')]=_0x48e6f1;return _0x2a87b5;});}})[_0xd6f0('0x23')](respondWithFilteredResult(_0x5e7768,_0x48f192))[_0xd6f0('0x2c')](handleError(_0x5e7768,null));};exports[_0xd6f0('0xd4')]=function(_0x422cd8,_0x40bbd9,_0x2122d4){var _0xd874c6={'raw':!![],'where':{}};var _0x192119={};var _0x920605={'count':0x0,'rows':[]};return db[_0xd6f0('0x48')][_0xd6f0('0xa0')]({'where':{'id':_0x422cd8[_0xd6f0('0x66')]['id']}})[_0xd6f0('0x23')](handleEntityNotFound(_0x40bbd9,null))[_0xd6f0('0x23')](function(_0x5508e0){if(_0x5508e0){_0x192119[_0xd6f0('0x4e')]=_[_0xd6f0('0x4b')](db['ScreenRecording'][_0xd6f0('0x49')]);_0x192119['query']=_[_0xd6f0('0x4b')](_0x422cd8[_0xd6f0('0x4c')]);_0x192119[_0xd6f0('0x57')]=_['intersection'](_0x192119[_0xd6f0('0x4e')],_0x192119[_0xd6f0('0x4c')]);_0xd874c6[_0xd6f0('0x4f')]=_[_0xd6f0('0x4d')](_0x192119['model'],qs[_0xd6f0('0x50')](_0x422cd8[_0xd6f0('0x4c')]['fields']));_0xd874c6[_0xd6f0('0x4f')]=_0xd874c6[_0xd6f0('0x4f')][_0xd6f0('0x51')]?_0xd874c6[_0xd6f0('0x4f')]:_0x192119['model'];if(!_0x422cd8[_0xd6f0('0x4c')][_0xd6f0('0x52')]('nolimit')){_0xd874c6[_0xd6f0('0x33')]=qs[_0xd6f0('0x33')](_0x422cd8['query'][_0xd6f0('0x33')]);_0xd874c6[_0xd6f0('0x32')]=qs[_0xd6f0('0x32')](_0x422cd8[_0xd6f0('0x4c')][_0xd6f0('0x32')]);}_0xd874c6[_0xd6f0('0x53')]=qs[_0xd6f0('0x54')](_0x422cd8[_0xd6f0('0x4c')][_0xd6f0('0x54')]);_0xd874c6[_0xd6f0('0x55')]=qs[_0xd6f0('0x57')](_['pick'](_0x422cd8[_0xd6f0('0x4c')],_0x192119['filters']));_0xd874c6[_0xd6f0('0x55')][_0xd6f0('0xd3')]=_0x5508e0['id'];if(_0x422cd8[_0xd6f0('0x4c')][_0xd6f0('0x58')]){_0xd874c6['where']=_['merge'](_0xd874c6[_0xd6f0('0x55')],{'$or':_['map'](_0xd874c6[_0xd6f0('0x4f')],function(_0x3869c4){var _0x42ce1d={};_0x42ce1d[_0x3869c4]={'$like':'%'+_0x422cd8['query']['filter']+'%'};return _0x42ce1d;})});}_0xd874c6=_[_0xd6f0('0x59')]({},_0xd874c6,_0x422cd8['options']);return db[_0xd6f0('0xd5')][_0xd6f0('0x31')]({'where':_0xd874c6[_0xd6f0('0x55')]})[_0xd6f0('0x23')](function(_0x19a9c9){_0x920605[_0xd6f0('0x31')]=_0x19a9c9;if(_0x422cd8['query'][_0xd6f0('0x62')]){_0xd874c6[_0xd6f0('0x63')]=[{'all':!![]}];}return db['ScreenRecording'][_0xd6f0('0xcd')](_0xd874c6);})[_0xd6f0('0x23')](function(_0xeea5f){_0x920605[_0xd6f0('0x64')]=_0xeea5f;return _0x920605;});}})[_0xd6f0('0x23')](respondWithFilteredResult(_0x40bbd9,_0xd874c6))['catch'](handleError(_0x40bbd9,null));};exports['getChatInteractions']=function(_0x1b3567,_0x4cefca,_0x3006cb){var _0x3a1710={};var _0x97904c={};var _0x57caec;var _0x55605e;return db[_0xd6f0('0x48')][_0xd6f0('0xa0')]({'where':{'id':_0x1b3567[_0xd6f0('0x66')]['id']}})[_0xd6f0('0x23')](handleEntityNotFound(_0x4cefca,null))['then'](function(_0x69f880){if(_0x69f880){_0x57caec=_0x69f880;_0x97904c[_0xd6f0('0x4e')]=_['keys'](db[_0xd6f0('0xd6')][_0xd6f0('0x49')]);_0x97904c[_0xd6f0('0x4c')]=_[_0xd6f0('0x4b')](_0x1b3567[_0xd6f0('0x4c')]);_0x97904c['filters']=_['intersection'](_0x97904c[_0xd6f0('0x4e')],_0x97904c[_0xd6f0('0x4c')]);_0x3a1710['attributes']=_[_0xd6f0('0x4d')](_0x97904c[_0xd6f0('0x4e')],qs[_0xd6f0('0x50')](_0x1b3567[_0xd6f0('0x4c')][_0xd6f0('0x50')]));_0x3a1710[_0xd6f0('0x4f')]=_0x3a1710[_0xd6f0('0x4f')][_0xd6f0('0x51')]?_0x3a1710[_0xd6f0('0x4f')]:_0x97904c[_0xd6f0('0x4e')];_0x3a1710[_0xd6f0('0x53')]=qs['sort'](_0x1b3567['query'][_0xd6f0('0x54')]);_0x3a1710['where']=qs[_0xd6f0('0x57')](_[_0xd6f0('0x56')](_0x1b3567[_0xd6f0('0x4c')],_0x97904c['filters']));if(_0x1b3567['query']['filter']){_0x3a1710[_0xd6f0('0x55')]=_[_0xd6f0('0x59')](_0x3a1710['where'],{'$or':_['map'](_0x3a1710[_0xd6f0('0x4f')],function(_0x2522ab){var _0x28fde6={};_0x28fde6[_0x2522ab]={'$like':'%'+_0x1b3567['query']['filter']+'%'};return _0x28fde6;})});}_0x3a1710=_[_0xd6f0('0x59')]({},_0x3a1710,_0x1b3567[_0xd6f0('0x61')]);return _0x57caec[_0xd6f0('0xd7')](_0x3a1710);}})['then'](function(_0xa4ae76){if(_0xa4ae76){_0x55605e=_0xa4ae76[_0xd6f0('0x51')];if(!_0x1b3567['query'][_0xd6f0('0x52')](_0xd6f0('0xca'))){_0x3a1710[_0xd6f0('0x33')]=qs[_0xd6f0('0x33')](_0x1b3567[_0xd6f0('0x4c')][_0xd6f0('0x33')]);_0x3a1710[_0xd6f0('0x32')]=qs[_0xd6f0('0x32')](_0x1b3567['query']['offset']);}return _0x57caec[_0xd6f0('0xd7')](_0x3a1710);}})['then'](function(_0x5d0e6e){if(_0x5d0e6e){return _0x5d0e6e?{'count':_0x55605e,'rows':_0x5d0e6e}:null;}})[_0xd6f0('0x23')](respondWithResult(_0x4cefca,null))[_0xd6f0('0x2c')](handleError(_0x4cefca,null));};exports[_0xd6f0('0xd8')]=function(_0x4fc550,_0x566478,_0x4af87e){var _0x1cb6f0={};var _0x31b6c1={};var _0x437365;var _0xc79db7;return db[_0xd6f0('0x48')][_0xd6f0('0xa0')]({'where':{'id':_0x4fc550[_0xd6f0('0x66')]['id']}})['then'](handleEntityNotFound(_0x566478,null))[_0xd6f0('0x23')](function(_0x3228b2){if(_0x3228b2){_0x437365=_0x3228b2;_0x31b6c1[_0xd6f0('0x4e')]=_[_0xd6f0('0x4b')](db[_0xd6f0('0xd9')][_0xd6f0('0x49')]);_0x31b6c1[_0xd6f0('0x4c')]=_[_0xd6f0('0x4b')](_0x4fc550[_0xd6f0('0x4c')]);_0x31b6c1[_0xd6f0('0x57')]=_[_0xd6f0('0x4d')](_0x31b6c1[_0xd6f0('0x4e')],_0x31b6c1[_0xd6f0('0x4c')]);_0x1cb6f0[_0xd6f0('0x4f')]=_['intersection'](_0x31b6c1[_0xd6f0('0x4e')],qs[_0xd6f0('0x50')](_0x4fc550['query'][_0xd6f0('0x50')]));_0x1cb6f0[_0xd6f0('0x4f')]=_0x1cb6f0[_0xd6f0('0x4f')][_0xd6f0('0x51')]?_0x1cb6f0['attributes']:_0x31b6c1[_0xd6f0('0x4e')];_0x1cb6f0[_0xd6f0('0x53')]=qs['sort'](_0x4fc550[_0xd6f0('0x4c')][_0xd6f0('0x54')]);_0x1cb6f0[_0xd6f0('0x55')]=qs['filters'](_[_0xd6f0('0x56')](_0x4fc550['query'],_0x31b6c1[_0xd6f0('0x57')]));if(_0x4fc550[_0xd6f0('0x4c')][_0xd6f0('0x58')]){_0x1cb6f0[_0xd6f0('0x55')]=_['merge'](_0x1cb6f0[_0xd6f0('0x55')],{'$or':_[_0xd6f0('0x5a')](_0x1cb6f0[_0xd6f0('0x4f')],function(_0x3c9992){var _0x2f21c4={};_0x2f21c4[_0x3c9992]={'$like':'%'+_0x4fc550['query']['filter']+'%'};return _0x2f21c4;})});}_0x1cb6f0=_[_0xd6f0('0x59')]({},_0x1cb6f0,_0x4fc550[_0xd6f0('0x61')]);return _0x437365[_0xd6f0('0xd8')](_0x1cb6f0);}})['then'](function(_0x3f6837){if(_0x3f6837){_0xc79db7=_0x3f6837[_0xd6f0('0x51')];if(!_0x4fc550[_0xd6f0('0x4c')][_0xd6f0('0x52')](_0xd6f0('0xca'))){_0x1cb6f0['limit']=qs[_0xd6f0('0x33')](_0x4fc550[_0xd6f0('0x4c')][_0xd6f0('0x33')]);_0x1cb6f0['offset']=qs[_0xd6f0('0x32')](_0x4fc550[_0xd6f0('0x4c')][_0xd6f0('0x32')]);}return _0x437365[_0xd6f0('0xd8')](_0x1cb6f0);}})['then'](function(_0x3a1c4a){if(_0x3a1c4a){return _0x3a1c4a?{'count':_0xc79db7,'rows':_0x3a1c4a}:null;}})[_0xd6f0('0x23')](respondWithResult(_0x566478,null))['catch'](handleError(_0x566478,null));};exports[_0xd6f0('0xda')]=function(_0x43a779,_0x13c5e1,_0x7ea09c){var _0x4b8bbf={'raw':!![],'where':{}};var _0x591b3e={};var _0x6a50e8={'count':0x0,'rows':[]};return db[_0xd6f0('0x48')][_0xd6f0('0xa0')]({'where':{'id':_0x43a779[_0xd6f0('0x66')]['id']}})[_0xd6f0('0x23')](handleEntityNotFound(_0x13c5e1,null))[_0xd6f0('0x23')](function(_0x14ab04){if(_0x14ab04){_0x591b3e['model']=_[_0xd6f0('0x4b')](db[_0xd6f0('0xdb')]['rawAttributes']);_0x591b3e[_0xd6f0('0x4c')]=_[_0xd6f0('0x4b')](_0x43a779[_0xd6f0('0x4c')]);_0x591b3e['filters']=_['intersection'](_0x591b3e[_0xd6f0('0x4e')],_0x591b3e[_0xd6f0('0x4c')]);_0x4b8bbf['attributes']=_[_0xd6f0('0x4d')](_0x591b3e['model'],qs[_0xd6f0('0x50')](_0x43a779[_0xd6f0('0x4c')][_0xd6f0('0x50')]));_0x4b8bbf['attributes']=_0x4b8bbf[_0xd6f0('0x4f')]['length']?_0x4b8bbf[_0xd6f0('0x4f')]:_0x591b3e[_0xd6f0('0x4e')];if(!_0x43a779['query'][_0xd6f0('0x52')](_0xd6f0('0xca'))){_0x4b8bbf['limit']=qs[_0xd6f0('0x33')](_0x43a779[_0xd6f0('0x4c')][_0xd6f0('0x33')]);_0x4b8bbf[_0xd6f0('0x32')]=qs[_0xd6f0('0x32')](_0x43a779[_0xd6f0('0x4c')][_0xd6f0('0x32')]);}_0x4b8bbf['order']=qs[_0xd6f0('0x54')](_0x43a779[_0xd6f0('0x4c')][_0xd6f0('0x54')]);_0x4b8bbf[_0xd6f0('0x55')]=qs['filters'](_[_0xd6f0('0x56')](_0x43a779[_0xd6f0('0x4c')],_0x591b3e[_0xd6f0('0x57')]));_0x4b8bbf[_0xd6f0('0x55')]['UserId']=_0x14ab04['id'];if(_0x43a779[_0xd6f0('0x4c')][_0xd6f0('0x58')]){_0x4b8bbf[_0xd6f0('0x55')]=_['merge'](_0x4b8bbf[_0xd6f0('0x55')],{'$or':_[_0xd6f0('0x5a')](_0x4b8bbf['attributes'],function(_0x9bc0ba){var _0x6fa67={};_0x6fa67[_0x9bc0ba]={'$like':'%'+_0x43a779[_0xd6f0('0x4c')]['filter']+'%'};return _0x6fa67;})});}_0x4b8bbf=_['merge']({},_0x4b8bbf,_0x43a779[_0xd6f0('0x61')]);return db[_0xd6f0('0xdb')][_0xd6f0('0x31')]({'where':_0x4b8bbf[_0xd6f0('0x55')]})[_0xd6f0('0x23')](function(_0x323e20){_0x6a50e8['count']=_0x323e20;if(_0x43a779[_0xd6f0('0x4c')][_0xd6f0('0x62')]){_0x4b8bbf[_0xd6f0('0x63')]=[{'all':!![]}];}return db[_0xd6f0('0xdb')][_0xd6f0('0xcd')](_0x4b8bbf);})[_0xd6f0('0x23')](function(_0x138f98){_0x6a50e8[_0xd6f0('0x64')]=_0x138f98;return _0x6a50e8;});}})[_0xd6f0('0x23')](respondWithFilteredResult(_0x13c5e1,_0x4b8bbf))['catch'](handleError(_0x13c5e1,null));};exports[_0xd6f0('0xdc')]=function(_0x53e58b,_0x57ed5c,_0x314678){var _0x4f0f96={};var _0x1b6f74={};var _0x1e88d0;var _0x49f998;return db[_0xd6f0('0x48')][_0xd6f0('0xa0')]({'where':{'id':_0x53e58b[_0xd6f0('0x66')]['id']}})[_0xd6f0('0x23')](handleEntityNotFound(_0x57ed5c,null))[_0xd6f0('0x23')](function(_0x9a496){if(_0x9a496){_0x1e88d0=_0x9a496;_0x1b6f74[_0xd6f0('0x4e')]=_[_0xd6f0('0x4b')](db[_0xd6f0('0xdd')][_0xd6f0('0x49')]);_0x1b6f74[_0xd6f0('0x4c')]=_[_0xd6f0('0x4b')](_0x53e58b[_0xd6f0('0x4c')]);_0x1b6f74[_0xd6f0('0x57')]=_[_0xd6f0('0x4d')](_0x1b6f74[_0xd6f0('0x4e')],_0x1b6f74[_0xd6f0('0x4c')]);_0x4f0f96[_0xd6f0('0x4f')]=_[_0xd6f0('0x4d')](_0x1b6f74[_0xd6f0('0x4e')],qs[_0xd6f0('0x50')](_0x53e58b[_0xd6f0('0x4c')][_0xd6f0('0x50')]));_0x4f0f96[_0xd6f0('0x4f')]=_0x4f0f96[_0xd6f0('0x4f')]['length']?_0x4f0f96[_0xd6f0('0x4f')]:_0x1b6f74[_0xd6f0('0x4e')];_0x4f0f96[_0xd6f0('0x53')]=qs[_0xd6f0('0x54')](_0x53e58b['query'][_0xd6f0('0x54')]);_0x4f0f96['where']=qs[_0xd6f0('0x57')](_['pick'](_0x53e58b[_0xd6f0('0x4c')],_0x1b6f74[_0xd6f0('0x57')]));if(_0x53e58b[_0xd6f0('0x4c')][_0xd6f0('0x58')]){_0x4f0f96['where']=_[_0xd6f0('0x59')](_0x4f0f96['where'],{'$or':_[_0xd6f0('0x5a')](_0x4f0f96[_0xd6f0('0x4f')],function(_0x4929b5){var _0xc8a6cf={};_0xc8a6cf[_0x4929b5]={'$like':'%'+_0x53e58b[_0xd6f0('0x4c')][_0xd6f0('0x58')]+'%'};return _0xc8a6cf;})});}_0x4f0f96=_[_0xd6f0('0x59')]({},_0x4f0f96,_0x53e58b['options']);return _0x1e88d0[_0xd6f0('0xdc')](_0x4f0f96);}})[_0xd6f0('0x23')](function(_0x4f2855){if(_0x4f2855){_0x49f998=_0x4f2855[_0xd6f0('0x51')];if(!_0x53e58b[_0xd6f0('0x4c')][_0xd6f0('0x52')](_0xd6f0('0xca'))){_0x4f0f96[_0xd6f0('0x33')]=qs[_0xd6f0('0x33')](_0x53e58b['query'][_0xd6f0('0x33')]);_0x4f0f96[_0xd6f0('0x32')]=qs[_0xd6f0('0x32')](_0x53e58b[_0xd6f0('0x4c')][_0xd6f0('0x32')]);}return _0x1e88d0[_0xd6f0('0xdc')](_0x4f0f96);}})[_0xd6f0('0x23')](function(_0x371d64){if(_0x371d64){return _0x371d64?{'count':_0x49f998,'rows':_0x371d64}:null;}})[_0xd6f0('0x23')](respondWithResult(_0x57ed5c,null))[_0xd6f0('0x2c')](handleError(_0x57ed5c,null));};exports[_0xd6f0('0xde')]=function(_0x7b48d9,_0x2bf71b,_0xf87966){var _0x598104={};var _0x1e2489={};var _0x518b14;var _0x529495;return db[_0xd6f0('0x48')][_0xd6f0('0xa0')]({'where':{'id':_0x7b48d9[_0xd6f0('0x66')]['id']}})['then'](handleEntityNotFound(_0x2bf71b,null))[_0xd6f0('0x23')](function(_0xd4c9b5){if(_0xd4c9b5){_0x518b14=_0xd4c9b5;_0x1e2489[_0xd6f0('0x4e')]=_['keys'](db['FaxInteraction'][_0xd6f0('0x49')]);_0x1e2489[_0xd6f0('0x4c')]=_[_0xd6f0('0x4b')](_0x7b48d9['query']);_0x1e2489[_0xd6f0('0x57')]=_[_0xd6f0('0x4d')](_0x1e2489['model'],_0x1e2489['query']);_0x598104[_0xd6f0('0x4f')]=_[_0xd6f0('0x4d')](_0x1e2489['model'],qs[_0xd6f0('0x50')](_0x7b48d9['query'][_0xd6f0('0x50')]));_0x598104['attributes']=_0x598104[_0xd6f0('0x4f')][_0xd6f0('0x51')]?_0x598104[_0xd6f0('0x4f')]:_0x1e2489[_0xd6f0('0x4e')];_0x598104[_0xd6f0('0x53')]=qs[_0xd6f0('0x54')](_0x7b48d9['query'][_0xd6f0('0x54')]);_0x598104[_0xd6f0('0x55')]=qs[_0xd6f0('0x57')](_[_0xd6f0('0x56')](_0x7b48d9[_0xd6f0('0x4c')],_0x1e2489[_0xd6f0('0x57')]));if(_0x7b48d9[_0xd6f0('0x4c')][_0xd6f0('0x58')]){_0x598104[_0xd6f0('0x55')]=_[_0xd6f0('0x59')](_0x598104[_0xd6f0('0x55')],{'$or':_['map'](_0x598104[_0xd6f0('0x4f')],function(_0x2bf43e){var _0x47b24b={};_0x47b24b[_0x2bf43e]={'$like':'%'+_0x7b48d9[_0xd6f0('0x4c')][_0xd6f0('0x58')]+'%'};return _0x47b24b;})});}_0x598104=_[_0xd6f0('0x59')]({},_0x598104,_0x7b48d9[_0xd6f0('0x61')]);return _0x518b14['getFaxInteractions'](_0x598104);}})[_0xd6f0('0x23')](function(_0x4d316a){if(_0x4d316a){_0x529495=_0x4d316a[_0xd6f0('0x51')];if(!_0x7b48d9[_0xd6f0('0x4c')][_0xd6f0('0x52')]('nolimit')){_0x598104['limit']=qs['limit'](_0x7b48d9[_0xd6f0('0x4c')][_0xd6f0('0x33')]);_0x598104[_0xd6f0('0x32')]=qs[_0xd6f0('0x32')](_0x7b48d9['query'][_0xd6f0('0x32')]);}return _0x518b14[_0xd6f0('0xde')](_0x598104);}})[_0xd6f0('0x23')](function(_0x2d5ba0){if(_0x2d5ba0){return _0x2d5ba0?{'count':_0x529495,'rows':_0x2d5ba0}:null;}})[_0xd6f0('0x23')](respondWithResult(_0x2bf71b,null))[_0xd6f0('0x2c')](handleError(_0x2bf71b,null));};exports[_0xd6f0('0xdf')]=function(_0x5b398c,_0x962074,_0x369dcf){var _0x16533b;var _0x4096d1;var _0x1ac07c;var _0x4e7cb4=!_[_0xd6f0('0x74')](_0x5b398c[_0xd6f0('0x66')]['id'])?_0x5b398c[_0xd6f0('0x66')]['id']:!_[_0xd6f0('0x74')](_0x5b398c[_0xd6f0('0x3b')]['id'])?_0x5b398c[_0xd6f0('0x3b')]['id']:null;return db[_0xd6f0('0x48')][_0xd6f0('0x42')]({'where':{'id':_0x4e7cb4,'role':_0xd6f0('0x6f')},'attributes':['id',_0xd6f0('0x46'),_0xd6f0('0xe0'),_0xd6f0('0xe1'),_0xd6f0('0x41'),_0xd6f0('0x7d'),'loginInPause']})[_0xd6f0('0x23')](handleEntityNotFound(_0x962074,null))[_0xd6f0('0x23')](function(_0x378779){if(_0x378779){_0x16533b=_0x378779;if(_0x5b398c[_0xd6f0('0x6a')]['interface']){_0x1ac07c=util[_0xd6f0('0x75')](_0xd6f0('0xe2'),_0x16533b[_0x5b398c[_0xd6f0('0x6a')][_0xd6f0('0xb0')]]);}else if(_0x5b398c[_0xd6f0('0x6a')][_0xd6f0('0xe3')]){_0x1ac07c=util[_0xd6f0('0x75')](_0xd6f0('0xe4'),_0x5b398c[_0xd6f0('0x6a')]['intrf']);}else{_0x1ac07c=util[_0xd6f0('0x75')](_0xd6f0('0xe4'),_0x16533b['name']);}socket['to'](util[_0xd6f0('0x75')](_0xd6f0('0xe5'),_0x16533b['name']))[_0xd6f0('0xb8')](_0xd6f0('0xe6'),{'ip':_0x5b398c['headers'][_0xd6f0('0xe7')]||_0x5b398c['connection'][_0xd6f0('0xe8')]||_0x5b398c[_0xd6f0('0xe9')][_0xd6f0('0xe8')]||_0x5b398c['connection'][_0xd6f0('0xe9')][_0xd6f0('0xe8')]});return db[_0xd6f0('0xb2')][_0xd6f0('0x44')]({'where':{'membername':_0x16533b[_0xd6f0('0x46')]},'individualHooks':!![]});}})[_0xd6f0('0x23')](function(_0x693d8b){if(_0x16533b){return _0x16533b[_0xd6f0('0xea')]({'raw':!![]});}})['then'](function(_0x3b06fa){var _0x297f19=[];if(_0x3b06fa){_0x4096d1=_0x3b06fa;if(_0x4096d1['length']){for(var _0x163f83=0x0;_0x163f83<_0x4096d1[_0xd6f0('0x51')];_0x163f83++){_0x297f19[_0xd6f0('0xaf')]({'membername':_0x16533b[_0xd6f0('0x46')],'UserId':_0x16533b['id'],'queue_name':_0x4096d1[_0x163f83][_0xd6f0('0x46')],'VoiceQueueId':_0x4096d1[_0x163f83]['id'],'interface':_0x1ac07c,'paused':_0x16533b[_0xd6f0('0xa3')]||![],'penalty':_0x4096d1[_0x163f83][_0xd6f0('0xeb')]||0x0});}return BPromise[_0xd6f0('0xb1')](_0x297f19,function(_0x4774e2){return db[_0xd6f0('0xb2')][_0xd6f0('0xb3')](_0x4774e2);});}}})[_0xd6f0('0x23')](function(){return db['MemberReport'][_0xd6f0('0xcd')]({'where':{'membername':_0x16533b['name'],'exitAt':null}});})[_0xd6f0('0x23')](function(_0x4397b2){var _0x311c91=[];_0x4397b2[_0xd6f0('0xec')](function(_0x22845c){_0x311c91['push'](_0x22845c['update']({'exitAt':moment()[_0xd6f0('0x75')](_0xd6f0('0xed'))}));});return BPromise[_0xd6f0('0xee')](_0x311c91);})[_0xd6f0('0x23')](function(){var _0x1e2151=[];var _0x5895ee=[];var _0xe88814=utils[_0xd6f0('0xef')]();var _0x2b9f45={'membername':_0x16533b['name'],'interface':_0x1ac07c,'enterAt':moment()[_0xd6f0('0x75')](_0xd6f0('0xed')),'role':_0x16533b[_0xd6f0('0x41')],'internal':_0x16533b[_0xd6f0('0x7d')]};_0xe88814[_0xd6f0('0xec')](function(_0x35231f){_0x1e2151['push'](_['merge']({'channel':_0x35231f,'type':_0xd6f0('0xf0'),'data1':_0x5b398c[_0xd6f0('0x6a')]['device'],'data2':_0x1ac07c},_0x2b9f45));if(_0x16533b['loginInPause']){_0x5895ee[_0xd6f0('0xaf')](_[_0xd6f0('0x59')]({'channel':_0x35231f,'type':_0xd6f0('0xf1'),'data1':'LOGININPAUSE'},_0x2b9f45));}});return db[_0xd6f0('0xf2')]['bulkCreate'](_0x1e2151[_0xd6f0('0xf3')](_0x5895ee),{'individualHooks':!![]});})['then'](function(){return _0x16533b['update']({'online':!![],'lastLoginAt':moment()[_0xd6f0('0x75')]('YYYY-MM-DD\x20HH:mm:ss'),'voicePause':_0x16533b[_0xd6f0('0xa3')]||![],'mailPause':_0x16533b[_0xd6f0('0xa3')]||![],'chatPause':_0x16533b[_0xd6f0('0xa3')]||![],'faxPause':_0x16533b[_0xd6f0('0xa3')]||![],'smsPause':_0x16533b[_0xd6f0('0xa3')]||![],'openchannelPause':_0x16533b['loginInPause']||![],'pauseType':_0x16533b['loginInPause']?_0xd6f0('0xf4'):null,'interface':_0x1ac07c,'lastPauseAt':moment()[_0xd6f0('0x75')](_0xd6f0('0xed'))});})[_0xd6f0('0x23')](function(_0x4fe519){if(_0x5b398c[_0xd6f0('0xf5')]){return _0x369dcf();}else{return BPromise['resolve'](_0x4fe519)['then'](respondWithResult(_0x962074,null));}})[_0xd6f0('0x2c')](handleError(_0x962074,null));};exports[_0xd6f0('0xf6')]=function(_0x342356,_0xddf7e6,_0x560569){var _0x136197;return db[_0xd6f0('0x48')][_0xd6f0('0x42')]({'where':{'id':_0x342356[_0xd6f0('0x66')]['id'],'role':'agent'},'attributes':['id',_0xd6f0('0x46'),'role']})[_0xd6f0('0x23')](handleEntityNotFound(_0xddf7e6,null))['then'](function(_0x52e74b){if(_0x52e74b){_0x136197=_0x52e74b;return db[_0xd6f0('0xb2')][_0xd6f0('0x44')]({'where':{'membername':_0x136197['name']},'individualHooks':!![]});}})[_0xd6f0('0x23')](function(){return db['MemberReport']['findAll']({'where':{'membername':_0x136197['name'],'exitAt':null}});})['then'](function(_0x70c2f8){var _0x21df2b=[];_0x70c2f8[_0xd6f0('0xec')](function(_0x329fab){_0x21df2b[_0xd6f0('0xaf')](_0x329fab[_0xd6f0('0xf7')]({'exitAt':moment()[_0xd6f0('0x75')](_0xd6f0('0xed'))}));});return BPromise['all'](_0x21df2b);})['then'](function(){return _0x136197['update']({'online':![],'lastLoginAt':null,'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'interface':null});})['then'](respondWithResult(_0xddf7e6,null))['catch'](handleError(_0xddf7e6,null));};exports[_0xd6f0('0xf8')]=function(_0x2a82a5,_0x17e746,_0x5d32d7){var _0xf83cfd;return db[_0xd6f0('0xb2')][_0xd6f0('0xf7')]({'paused':0x1},{'where':{'UserId':_0x2a82a5['params']['id']},'individualHooks':!![]})[_0xd6f0('0x23')](function(){return db[_0xd6f0('0x48')]['find']({'where':{'id':_0x2a82a5[_0xd6f0('0x66')]['id'],'role':'agent'},'attributes':['id',_0xd6f0('0x46'),_0xd6f0('0x41'),_0xd6f0('0x7d'),_0xd6f0('0xb0')]});})[_0xd6f0('0x23')](handleEntityNotFound(_0x17e746,null))[_0xd6f0('0x23')](function(_0xbea3d5){if(_0xbea3d5){_0xf83cfd=_0xbea3d5;return respondWithRpcPromise(_0xd6f0('0xf9'),_0xd6f0('0xf8'),{'id':_0xf83cfd['id'],'name':_0xf83cfd[_0xd6f0('0x46')],'pause':!![]});}})[_0xd6f0('0x23')](function(){if(_0xf83cfd){return db[_0xd6f0('0xf2')][_0xd6f0('0xcd')]({'where':{'membername':_0xf83cfd['name'],'type':_0xd6f0('0xf1'),'exitAt':null}});}})[_0xd6f0('0x23')](function(_0x3d86d0){if(_0x3d86d0[_0xd6f0('0x51')]){var _0x125e62=moment()[_0xd6f0('0x75')](_0xd6f0('0xed'));for(var _0x76ea85=0x0,_0x565bca=_0x3d86d0[_0xd6f0('0x51')];_0x76ea85<_0x565bca;_0x76ea85++){_0x3d86d0[_0x76ea85][_0xd6f0('0xfa')]({'exitAt':_0x125e62});}}})[_0xd6f0('0x23')](function(){var _0x3b0cd4=[];var _0x12aba2=utils[_0xd6f0('0xef')]();_0x12aba2['forEach'](function(_0x34fe0b){_0x3b0cd4['push']({'channel':_0x34fe0b,'membername':_0xf83cfd[_0xd6f0('0x46')],'interface':_[_0xd6f0('0x74')](_0xf83cfd[_0xd6f0('0xb0')])?util['format'](_0xd6f0('0xe4'),_0xf83cfd[_0xd6f0('0x46')]):_0xf83cfd['interface'],'type':_0xd6f0('0xf1'),'enterAt':moment()[_0xd6f0('0x75')]('YYYY-MM-DD\x20HH:mm:ss'),'data1':_0x2a82a5[_0xd6f0('0x6a')][_0xd6f0('0x5b')]||'DEFAULT\x20PAUSE','role':_0xf83cfd[_0xd6f0('0x41')],'internal':_0xf83cfd[_0xd6f0('0x7d')]});});return db[_0xd6f0('0xf2')][_0xd6f0('0x69')](_0x3b0cd4,{'individualHooks':!![]});})[_0xd6f0('0x23')](function(){return _0xf83cfd[_0xd6f0('0xf7')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'pauseType':_0x2a82a5[_0xd6f0('0x6a')]['type']||'DEFAULT\x20PAUSE','lastPauseAt':moment()['format'](_0xd6f0('0xed'))});})[_0xd6f0('0x23')](respondWithResult(_0x17e746,null))[_0xd6f0('0x2c')](handleError(_0x17e746,null));};exports[_0xd6f0('0xfb')]=function(_0x278672,_0x11564b,_0x4a35c7){var _0x518419;return db[_0xd6f0('0x48')][_0xd6f0('0x42')]({'where':{'id':_0x278672['params']['id']},'attributes':['id',_0xd6f0('0x46'),'role',_0xd6f0('0xa4'),'mailPause',_0xd6f0('0xfc'),'faxPause','openchannelPause',_0xd6f0('0xfd'),'pauseType','lastPauseAt']})['then'](handleEntityNotFound(_0x11564b,null))[_0xd6f0('0x23')](function(_0x17ae43){if(_0x17ae43){_0x518419=_0x17ae43;if(_0x278672[_0xd6f0('0x6a')]['channel']&&!utils[_0xd6f0('0xa5')](_0x278672[_0xd6f0('0x6a')]['channel'])){throw new db['Sequelize'][(_0xd6f0('0x9b'))](_0xd6f0('0xa6'));}switch(_0x278672[_0xd6f0('0x6a')][_0xd6f0('0xb5')]){case _0xd6f0('0xad'):return respondWithRpcPromise(_0xd6f0('0xf9'),_0xd6f0('0xfb'),{'id':_0x518419['id'],'name':_0x518419[_0xd6f0('0x46')],'pause':![]})['then'](function(){return db[_0xd6f0('0xb2')][_0xd6f0('0xf7')]({'paused':0x0},{'where':{'UserId':_0x518419['id']},'individualHooks':!![]});})[_0xd6f0('0x23')](function(){return db['MemberReport'][_0xd6f0('0x42')]({'where':{'channel':_0x278672['body'][_0xd6f0('0xb5')],'membername':_0x518419[_0xd6f0('0x46')],'type':_0xd6f0('0xf1'),'exitAt':null}});})['then'](function(_0x26880d){if(_0x26880d){return _0x26880d[_0xd6f0('0xf7')]({'exitAt':moment()[_0xd6f0('0x75')](_0xd6f0('0xed')),'data2':_0xd6f0('0xfe')},{'individualHooks':!![]});}return null;})['then'](function(){return _0x518419['update']({'voicePause':![]});});case _0xd6f0('0xff'):case _0xd6f0('0x100'):case'fax':case _0xd6f0('0x101'):case'openchannel':return db['MemberReport']['find']({'where':{'channel':_0x278672[_0xd6f0('0x6a')][_0xd6f0('0xb5')],'membername':_0x518419[_0xd6f0('0x46')],'type':_0xd6f0('0xf1'),'exitAt':null}})[_0xd6f0('0x23')](function(_0x32d696){if(_0x32d696){return _0x32d696['update']({'exitAt':moment()[_0xd6f0('0x75')](_0xd6f0('0xed')),'data2':_0xd6f0('0xfe')},{'individualHooks':!![]});}return null;})[_0xd6f0('0x23')](function(){var _0x5f45d2={};_['set'](_0x5f45d2,util[_0xd6f0('0x75')](_0xd6f0('0x102'),_0x278672['body'][_0xd6f0('0xb5')],_0xd6f0('0x103')),![]);return _0x518419['update'](_0x5f45d2);});default:return respondWithRpcPromise('QueuePause','unpause',{'id':_0x518419['id'],'name':_0x518419[_0xd6f0('0x46')],'pause':![]})[_0xd6f0('0x23')](function(){return db[_0xd6f0('0xb2')][_0xd6f0('0xf7')]({'paused':0x0},{'where':{'UserId':_0x518419['id']}});})['then'](function(){return db[_0xd6f0('0xf2')][_0xd6f0('0xcd')]({'where':{'membername':_0x518419[_0xd6f0('0x46')],'type':'PAUSE','exitAt':null}});})[_0xd6f0('0x23')](function(_0x53a659){var _0x4d80a3=[];_0x53a659[_0xd6f0('0xec')](function(_0x456331){_0x4d80a3[_0xd6f0('0xaf')](_0x456331['update']({'exitAt':moment()[_0xd6f0('0x75')](_0xd6f0('0xed')),'data2':_0xd6f0('0xfe')}));});return BPromise[_0xd6f0('0xee')](_0x4d80a3);})[_0xd6f0('0x23')](function(){return _0x518419['update']({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});});}}})[_0xd6f0('0x23')](respondWithResult(_0x11564b,null))[_0xd6f0('0x2c')](handleError(_0x11564b,null));};exports[_0xd6f0('0x104')]=function(_0x5d0ec6,_0x29fec7,_0x20ab76){var _0x5dcdcd={};var _0x4e631e={};var _0x200c21;var _0xe47e09;return db[_0xd6f0('0x48')][_0xd6f0('0xa0')]({'where':{'id':_0x5d0ec6['params']['id']}})[_0xd6f0('0x23')](handleEntityNotFound(_0x29fec7,null))[_0xd6f0('0x23')](function(_0xea0635){if(_0xea0635){_0x200c21=_0xea0635;_0x4e631e[_0xd6f0('0x4e')]=_[_0xd6f0('0x4b')](db[_0xd6f0('0x105')][_0xd6f0('0x49')]);_0x4e631e['query']=_['keys'](_0x5d0ec6[_0xd6f0('0x4c')]);_0x4e631e['filters']=_['intersection'](_0x4e631e[_0xd6f0('0x4e')],_0x4e631e['query']);_0x5dcdcd['attributes']=_[_0xd6f0('0x4d')](_0x4e631e[_0xd6f0('0x4e')],qs[_0xd6f0('0x50')](_0x5d0ec6['query'][_0xd6f0('0x50')]));_0x5dcdcd[_0xd6f0('0x4f')]=_0x5dcdcd[_0xd6f0('0x4f')][_0xd6f0('0x51')]?_0x5dcdcd[_0xd6f0('0x4f')]:_0x4e631e[_0xd6f0('0x4e')];_0x5dcdcd[_0xd6f0('0x53')]=qs[_0xd6f0('0x54')](_0x5d0ec6[_0xd6f0('0x4c')][_0xd6f0('0x54')]);_0x5dcdcd['where']=qs[_0xd6f0('0x57')](_[_0xd6f0('0x56')](_0x5d0ec6[_0xd6f0('0x4c')],_0x4e631e[_0xd6f0('0x57')]));if(_0x5d0ec6[_0xd6f0('0x4c')][_0xd6f0('0x58')]){_0x5dcdcd['where']=_[_0xd6f0('0x59')](_0x5dcdcd[_0xd6f0('0x55')],{'$or':_[_0xd6f0('0x5a')](_0x5dcdcd[_0xd6f0('0x4f')],function(_0x1a2e3b){var _0x27cb81={};_0x27cb81[_0x1a2e3b]={'$like':'%'+_0x5d0ec6[_0xd6f0('0x4c')][_0xd6f0('0x58')]+'%'};return _0x27cb81;})});}_0x5dcdcd=_['merge']({},_0x5dcdcd,_0x5d0ec6['options']);return _0x200c21[_0xd6f0('0x104')](_0x5dcdcd);}})[_0xd6f0('0x23')](function(_0x4c110f){if(_0x4c110f){_0xe47e09=_0x4c110f[_0xd6f0('0x51')];if(!_0x5d0ec6[_0xd6f0('0x4c')][_0xd6f0('0x52')](_0xd6f0('0xca'))){_0x5dcdcd[_0xd6f0('0x33')]=qs[_0xd6f0('0x33')](_0x5d0ec6[_0xd6f0('0x4c')][_0xd6f0('0x33')]);_0x5dcdcd[_0xd6f0('0x32')]=qs[_0xd6f0('0x32')](_0x5d0ec6['query'][_0xd6f0('0x32')]);}return _0x200c21[_0xd6f0('0x104')](_0x5dcdcd);}})[_0xd6f0('0x23')](function(_0x32f015){if(_0x32f015){return _0x32f015?{'count':_0xe47e09,'rows':_0x32f015}:null;}})[_0xd6f0('0x23')](respondWithResult(_0x29fec7,null))[_0xd6f0('0x2c')](handleError(_0x29fec7,null));};exports[_0xd6f0('0x106')]=function(_0x2f3513,_0x4d558a){return db[_0xd6f0('0x48')][_0xd6f0('0x42')]({'where':{'id':_0x2f3513[_0xd6f0('0x66')]['id']}})[_0xd6f0('0x23')](handleEntityNotFound(_0x4d558a,null))[_0xd6f0('0x23')](function(_0x32333f){if(_0x32333f){var _0x5c0e59=_0x32333f[_0xd6f0('0x39')]({'plain':!![]});return _0x32333f[_0xd6f0('0x106')](_0x2f3513[_0xd6f0('0x6a')][_0xd6f0('0x6d')],_[_0xd6f0('0x6e')](_0x2f3513[_0xd6f0('0x6a')],[_0xd6f0('0x6d'),'id'])||{})[_0xd6f0('0x23')](function(){for(var _0x38613a=0x0;_0x38613a<_0x2f3513['body'][_0xd6f0('0x6d')]['length'];_0x38613a++){var _0x442161=[];db[_0xd6f0('0x105')]['findOne']({'where':{'id':_0x2f3513[_0xd6f0('0x6a')][_0xd6f0('0x6d')][_0x38613a]}})['then'](function(_0x1a8678){_0x442161[_0xd6f0('0xaf')](_0x1a8678[_0xd6f0('0xea')]()[_0xd6f0('0x23')](function(_0x465a4b){for(var _0x14932e=0x0;_0x14932e<_0x465a4b[_0xd6f0('0x51')];_0x14932e++){_0x465a4b[_0x14932e]['setDataValue']('channel',_0xd6f0('0x107'));}return _0x465a4b;}));_0x442161['push'](_0x1a8678[_0xd6f0('0x108')]()[_0xd6f0('0x23')](function(_0x25c4cb){for(var _0x10cd92=0x0;_0x10cd92<_0x25c4cb[_0xd6f0('0x51')];_0x10cd92++){_0x25c4cb[_0x10cd92]['setDataValue'](_0xd6f0('0xb5'),_0xd6f0('0x109'));}return _0x25c4cb;}));_0x442161[_0xd6f0('0xaf')](_0x1a8678[_0xd6f0('0x10a')]()['then'](function(_0x56be4d){for(var _0x410f82=0x0;_0x410f82<_0x56be4d[_0xd6f0('0x51')];_0x410f82++){_0x56be4d[_0x410f82][_0xd6f0('0x10b')](_0xd6f0('0xb5'),'Mail');}return _0x56be4d;}));_0x442161['push'](_0x1a8678[_0xd6f0('0x10c')]()[_0xd6f0('0x23')](function(_0x527247){for(var _0x869db9=0x0;_0x869db9<_0x527247['length'];_0x869db9++){_0x527247[_0x869db9][_0xd6f0('0x10b')](_0xd6f0('0xb5'),_0xd6f0('0x10d'));}return _0x527247;}));_0x442161[_0xd6f0('0xaf')](_0x1a8678[_0xd6f0('0x10e')]()[_0xd6f0('0x23')](function(_0x21ceb1){for(var _0x5e0522=0x0;_0x5e0522<_0x21ceb1[_0xd6f0('0x51')];_0x5e0522++){_0x21ceb1[_0x5e0522][_0xd6f0('0x10b')](_0xd6f0('0xb5'),'Fax');}return _0x21ceb1;}));_0x442161[_0xd6f0('0xaf')](_0x1a8678[_0xd6f0('0x10f')]()['then'](function(_0x1f9e04){for(var _0x33be17=0x0;_0x33be17<_0x1f9e04[_0xd6f0('0x51')];_0x33be17++){_0x1f9e04[_0x33be17][_0xd6f0('0x10b')](_0xd6f0('0xb5'),'Openchannel');}return _0x1f9e04;}));return BPromise[_0xd6f0('0xee')](_0x442161);})['then'](function(_0x2be80e){var _0x176605=_[_0xd6f0('0x110')](_0x2be80e);_0x442161=[];return db[_0xd6f0('0x5d')][_0xd6f0('0x111')](function(_0x533a62){for(var _0x2e90ec=0x0;_0x2e90ec<_0x176605['length'];_0x2e90ec++){_0x442161['push'](_0x176605[_0x2e90ec][_0xd6f0('0x112')](_0x5c0e59['id']),{'transaction':_0x533a62});}return BPromise['all'](_0x442161)[_0xd6f0('0x23')](function(){if(_0x5c0e59[_0xd6f0('0xa2')]){return BPromise[_0xd6f0('0xb1')](_[_0xd6f0('0x58')](_0x176605,function(_0x4723af){return _0x4723af[_0xd6f0('0x113')](_0xd6f0('0xb5'))===_0xd6f0('0x107');}),function(_0x4ee4d1){return db[_0xd6f0('0xb2')][_0xd6f0('0xb3')]({'membername':_0x5c0e59[_0xd6f0('0x46')],'UserId':_0x5c0e59['id'],'queue_name':_0x4ee4d1[_0xd6f0('0x46')],'VoiceQueueId':_0x4ee4d1['id'],'interface':_[_0xd6f0('0x74')](_0x5c0e59[_0xd6f0('0xb0')])?util['format']('SIP/%s',_0x5c0e59[_0xd6f0('0x46')]):_0x5c0e59['interface'],'paused':_0x5c0e59[_0xd6f0('0xa4')]||![],'penalty':_0x5c0e59['penalty']},{'transaction':_0x533a62});});}else{return;}})['then'](function(){for(var _0x1ee8d4=0x0;_0x1ee8d4<_0x176605[_0xd6f0('0x51')];_0x1ee8d4++){var _0x342aa=_0x176605[_0x1ee8d4]['getDataValue'](_0xd6f0('0xb5'));var _0x1e59ba=_0x342aa+'QueueId';socket[_0xd6f0('0xb8')](_0xd6f0('0x3b')+_0x342aa+_0xd6f0('0xac'),{'UserId':_0x5c0e59['id'],['queueField']:_0x176605[_0x1ee8d4]['id']});}});});});}});}})[_0xd6f0('0x23')](respondWithStatusCode(_0x4d558a,null))[_0xd6f0('0x2c')](handleError(_0x4d558a,null));};exports[_0xd6f0('0x114')]=function(_0x498ac8,_0x2310e9){return db[_0xd6f0('0x48')][_0xd6f0('0xa0')]({'where':{'id':_0x498ac8[_0xd6f0('0x66')]['id']}})[_0xd6f0('0x23')](handleEntityNotFound(_0x2310e9,null))[_0xd6f0('0x23')](function(_0x58b11d){if(_0x58b11d){var _0x1f1117=_0x58b11d[_0xd6f0('0x39')]({'plain':!![]});var _0x512913=_0x498ac8['query'][_0xd6f0('0x6d')];return _0x58b11d[_0xd6f0('0x114')](_0x512913)[_0xd6f0('0x23')](function(){for(var _0x2d1dd0=0x0;_0x2d1dd0<_0x512913[_0xd6f0('0x51')];_0x2d1dd0++){var _0x4fdce6=[];db[_0xd6f0('0x105')]['findOne']({'where':{'id':_0x512913[_0x2d1dd0]}})[_0xd6f0('0x23')](function(_0x1c6e85){_0x4fdce6['push'](_0x1c6e85[_0xd6f0('0xea')]()[_0xd6f0('0x23')](function(_0x32c49a){for(var _0x5a4beb=0x0;_0x5a4beb<_0x32c49a[_0xd6f0('0x51')];_0x5a4beb++){_0x32c49a[_0x5a4beb][_0xd6f0('0x10b')](_0xd6f0('0xb5'),_0xd6f0('0x107'));}return _0x32c49a;}));_0x4fdce6[_0xd6f0('0xaf')](_0x1c6e85[_0xd6f0('0x108')]()['then'](function(_0x182eb2){for(var _0x397d76=0x0;_0x397d76<_0x182eb2[_0xd6f0('0x51')];_0x397d76++){_0x182eb2[_0x397d76][_0xd6f0('0x10b')]('channel',_0xd6f0('0x109'));}return _0x182eb2;}));_0x4fdce6['push'](_0x1c6e85[_0xd6f0('0x10a')]()[_0xd6f0('0x23')](function(_0x17ac54){for(var _0xd16048=0x0;_0xd16048<_0x17ac54['length'];_0xd16048++){_0x17ac54[_0xd16048]['setDataValue'](_0xd6f0('0xb5'),'Mail');}return _0x17ac54;}));_0x4fdce6[_0xd6f0('0xaf')](_0x1c6e85[_0xd6f0('0x10c')]()[_0xd6f0('0x23')](function(_0xebe61b){for(var _0x40e17b=0x0;_0x40e17b<_0xebe61b['length'];_0x40e17b++){_0xebe61b[_0x40e17b][_0xd6f0('0x10b')](_0xd6f0('0xb5'),_0xd6f0('0x10d'));}return _0xebe61b;}));_0x4fdce6[_0xd6f0('0xaf')](_0x1c6e85[_0xd6f0('0x10e')]()[_0xd6f0('0x23')](function(_0x25b61c){for(var _0x17083e=0x0;_0x17083e<_0x25b61c[_0xd6f0('0x51')];_0x17083e++){_0x25b61c[_0x17083e][_0xd6f0('0x10b')](_0xd6f0('0xb5'),_0xd6f0('0x115'));}return _0x25b61c;}));_0x4fdce6[_0xd6f0('0xaf')](_0x1c6e85[_0xd6f0('0x10f')]()[_0xd6f0('0x23')](function(_0x5d3752){for(var _0x4c646f=0x0;_0x4c646f<_0x5d3752[_0xd6f0('0x51')];_0x4c646f++){_0x5d3752[_0x4c646f]['setDataValue'](_0xd6f0('0xb5'),'Openchannel');}return _0x5d3752;}));return BPromise['all'](_0x4fdce6);})[_0xd6f0('0x23')](function(_0x2849b4){var _0x40df44=_[_0xd6f0('0x110')](_0x2849b4);_0x4fdce6=[];return db[_0xd6f0('0x5d')][_0xd6f0('0x111')](function(_0x379327){for(var _0x22e0f5=0x0;_0x22e0f5<_0x40df44[_0xd6f0('0x51')];_0x22e0f5++){_0x4fdce6['push'](_0x40df44[_0x22e0f5]['removeAgent'](_0x1f1117['id']),{'transaction':_0x379327});}return BPromise[_0xd6f0('0xee')](_0x4fdce6)[_0xd6f0('0x23')](function(){if(_0x1f1117['online']){return BPromise[_0xd6f0('0xb1')](_['filter'](_0x40df44,function(_0x1b0c3a){return _0x1b0c3a['getDataValue']('channel')===_0xd6f0('0x107');}),function(_0x1b37fb){return db['UserVoiceQueueRt'][_0xd6f0('0x44')]({'where':{'VoiceQueueId':_0x1b37fb['id'],'UserId':_0x1f1117['id']},'transaction':_0x379327});});}else{return;}})[_0xd6f0('0x23')](function(){for(var _0x5395f8=0x0;_0x5395f8<_0x40df44[_0xd6f0('0x51')];_0x5395f8++){var _0x14291e=_0x40df44[_0x5395f8]['getDataValue'](_0xd6f0('0xb5'));var _0x3e29be=_0x14291e+_0xd6f0('0xb7');socket[_0xd6f0('0xb8')](_0xd6f0('0x3b')+_0x14291e+_0xd6f0('0x116'),{'UserId':_0x1f1117['id'],['queueField']:_0x40df44[_0x5395f8]['id']});}});});});}});}})['then'](respondWithStatusCode(_0x2310e9,null))['catch'](handleError(_0x2310e9,null));};exports[_0xd6f0('0x117')]=function(_0x38a966,_0x281f20,_0x22a4b3){var _0x3bb001={};var _0x39b77f={};var _0x53eb93;var _0x386dc2;return db[_0xd6f0('0x48')][_0xd6f0('0xa0')]({'where':{'id':_0x38a966[_0xd6f0('0x66')]['id']}})[_0xd6f0('0x23')](handleEntityNotFound(_0x281f20,null))[_0xd6f0('0x23')](function(_0x437018){if(_0x437018){_0x53eb93=_0x437018;_0x39b77f['model']=_[_0xd6f0('0x4b')](db[_0xd6f0('0xc5')][_0xd6f0('0x49')]);_0x39b77f['query']=_[_0xd6f0('0x4b')](_0x38a966['query']);_0x39b77f['filters']=_[_0xd6f0('0x4d')](_0x39b77f[_0xd6f0('0x4e')],_0x39b77f[_0xd6f0('0x4c')]);_0x3bb001[_0xd6f0('0x4f')]=_['intersection'](_0x39b77f[_0xd6f0('0x4e')],qs[_0xd6f0('0x50')](_0x38a966['query'][_0xd6f0('0x50')]));_0x3bb001[_0xd6f0('0x4f')]=_0x3bb001['attributes'][_0xd6f0('0x51')]?_0x3bb001[_0xd6f0('0x4f')]:_0x39b77f[_0xd6f0('0x4e')];_0x3bb001[_0xd6f0('0x53')]=qs[_0xd6f0('0x54')](_0x38a966[_0xd6f0('0x4c')][_0xd6f0('0x54')]);_0x3bb001[_0xd6f0('0x55')]=qs[_0xd6f0('0x57')](_['pick'](_0x38a966[_0xd6f0('0x4c')],_0x39b77f[_0xd6f0('0x57')]));if(_0x38a966[_0xd6f0('0x4c')][_0xd6f0('0x58')]){_0x3bb001[_0xd6f0('0x55')]=_[_0xd6f0('0x59')](_0x3bb001[_0xd6f0('0x55')],{'$or':_[_0xd6f0('0x5a')](_0x3bb001[_0xd6f0('0x4f')],function(_0x7d0081){var _0xc0b69c={};_0xc0b69c[_0x7d0081]={'$like':'%'+_0x38a966[_0xd6f0('0x4c')][_0xd6f0('0x58')]+'%'};return _0xc0b69c;})});}_0x3bb001=_[_0xd6f0('0x59')]({},_0x3bb001,_0x38a966[_0xd6f0('0x61')]);return _0x53eb93[_0xd6f0('0x117')](_0x3bb001);}})[_0xd6f0('0x23')](function(_0x1c743c){if(_0x1c743c){_0x386dc2=_0x1c743c[_0xd6f0('0x51')];if(!_0x38a966[_0xd6f0('0x4c')][_0xd6f0('0x52')]('nolimit')){_0x3bb001[_0xd6f0('0x33')]=qs[_0xd6f0('0x33')](_0x38a966[_0xd6f0('0x4c')][_0xd6f0('0x33')]);_0x3bb001[_0xd6f0('0x32')]=qs[_0xd6f0('0x32')](_0x38a966['query'][_0xd6f0('0x32')]);}return _0x53eb93['getLists'](_0x3bb001);}})[_0xd6f0('0x23')](function(_0x25a4dc){if(_0x25a4dc){return _0x25a4dc?{'count':_0x386dc2,'rows':_0x25a4dc}:null;}})['then'](respondWithResult(_0x281f20,null))[_0xd6f0('0x2c')](handleError(_0x281f20,null));};exports[_0xd6f0('0x118')]=function(_0x5b9692,_0x3cefef,_0x14beff){var _0x3ad6d4={};var _0x53afb0={};var _0x46189a;var _0x3be193;return db[_0xd6f0('0x48')]['findOne']({'where':{'id':_0x5b9692['params']['id']}})[_0xd6f0('0x23')](handleEntityNotFound(_0x3cefef,null))[_0xd6f0('0x23')](function(_0x3a8562){if(_0x3a8562){_0x46189a=_0x3a8562;_0x53afb0[_0xd6f0('0x4e')]=_[_0xd6f0('0x4b')](db[_0xd6f0('0x48')][_0xd6f0('0x49')]);_0x53afb0['query']=_[_0xd6f0('0x4b')](_0x5b9692[_0xd6f0('0x4c')]);_0x53afb0[_0xd6f0('0x57')]=_['intersection'](_0x53afb0[_0xd6f0('0x4e')],_0x53afb0['query']);_0x3ad6d4[_0xd6f0('0x4f')]=_[_0xd6f0('0x4d')](_0x53afb0[_0xd6f0('0x4e')],qs[_0xd6f0('0x50')](_0x5b9692[_0xd6f0('0x4c')][_0xd6f0('0x50')]));_0x3ad6d4[_0xd6f0('0x4f')]=_0x3ad6d4[_0xd6f0('0x4f')][_0xd6f0('0x51')]?_0x3ad6d4[_0xd6f0('0x4f')]:_0x53afb0[_0xd6f0('0x4e')];_0x3ad6d4['order']=qs['sort'](_0x5b9692[_0xd6f0('0x4c')][_0xd6f0('0x54')]);_0x3ad6d4[_0xd6f0('0x55')]=qs[_0xd6f0('0x57')](_[_0xd6f0('0x56')](_0x5b9692[_0xd6f0('0x4c')],_0x53afb0[_0xd6f0('0x57')]));if(_0x5b9692[_0xd6f0('0x4c')][_0xd6f0('0x58')]){_0x3ad6d4[_0xd6f0('0x55')]=_[_0xd6f0('0x59')](_0x3ad6d4[_0xd6f0('0x55')],{'$or':_[_0xd6f0('0x5a')](_0x3ad6d4[_0xd6f0('0x4f')],function(_0x177ea0){var _0x2866b0={};_0x2866b0[_0x177ea0]={'$like':'%'+_0x5b9692[_0xd6f0('0x4c')][_0xd6f0('0x58')]+'%'};return _0x2866b0;})});}_0x3ad6d4['model']=db[_0xd6f0('0x48')];_0x3ad6d4['as']='Agents';_0x3ad6d4=_[_0xd6f0('0x59')]({},_0x3ad6d4,_0x5b9692[_0xd6f0('0x61')]);return _0x46189a[_0xd6f0('0xea')]({'include':[_0x3ad6d4]});}})[_0xd6f0('0x23')](function(_0x327646){if(_0x327646){var _0xcad5a3={},_0x55011b=[],_0x1fe44d=0x0;for(var _0x172397=0x0;_0x172397<_0x327646[_0xd6f0('0x51')];_0x172397+=0x1){for(var _0x3800ba=0x0,_0x560bec;_0x3800ba<_0x327646[_0x172397][_0xd6f0('0x3c')][_0xd6f0('0x51')];_0x3800ba+=0x1){_0x560bec=_0x327646[_0x172397]['Agents'][_0x3800ba][_0xd6f0('0x39')]({'plain':!![]});_0xcad5a3[_0x560bec['id']]=_0x560bec;}}_0xcad5a3=_['values'](_0xcad5a3);for(var _0x5250bb=qs['offset'](_0x5b9692[_0xd6f0('0x4c')][_0xd6f0('0x32')]);_0x5250bb<_0xcad5a3[_0xd6f0('0x51')]&&_0x55011b[_0xd6f0('0x51')]=_0x480c22[_0xf584('0x55')]){throw new Error('Maximum\x20login\x20has\x20been\x20reached');}})[_0xf584('0x11')](function(){if(_0x3413c9){return db[_0xf584('0x2d')][_0xf584('0x4b')]({'where':{'membername':_0x3413c9['name']},'individualHooks':!![]});}})[_0xf584('0x11')](function(){if(_0x3413c9){return _0x3413c9[_0xf584('0x56')]({'raw':!![]});}})[_0xf584('0x11')](function(_0x405291){if(_0x3413c9){if(_0x405291){var _0x10dcae=[];_0x8a4df3=_0x405291;if(_0x8a4df3['length']){for(var _0x31842a=0x0;_0x31842a<_0x8a4df3[_0xf584('0x30')];_0x31842a++){_0x10dcae[_0xf584('0x35')](db[_0xf584('0x2d')]['upsert']({'membername':_0x3413c9[_0xf584('0x2e')],'UserId':_0x3413c9['id'],'queue_name':_0x8a4df3[_0x31842a][_0xf584('0x2e')],'VoiceQueueId':_0x8a4df3[_0x31842a]['id'],'interface':_0x594c78,'paused':_0x3413c9[_0xf584('0x50')]||![],'penalty':_0x8a4df3[_0x31842a][_0xf584('0x57')]||0x0}));}return BPromise['all'](_0x10dcae);}}}})[_0xf584('0x11')](function(){if(_0x3413c9){return db[_0xf584('0x39')][_0xf584('0x1e')]({'where':{'membername':_0x3413c9['name'],'exitAt':null}});}})['then'](function(_0x5976d2){if(_0x3413c9){if(_0x5976d2&&_0x5976d2[_0xf584('0x30')]){var _0x5a9de8=[];_0x5976d2[_0xf584('0x34')](function(_0x3c72d4){_0x5a9de8[_0xf584('0x35')](_0x3c72d4['update']({'exitAt':moment()['format'](_0xf584('0x31'))}));});return BPromise[_0xf584('0x4c')](_0x5a9de8);}}})[_0xf584('0x11')](function(_0x373614){if(_0x3413c9){var _0x3f25da=[];var _0x15648c=[];var _0x3e8cc4=utils['getChannels']();var _0xb2d6d6={'membername':_0x3413c9[_0xf584('0x2e')],'interface':_0x594c78,'enterAt':moment()[_0xf584('0x3c')](_0xf584('0x31')),'role':_0x3413c9['role'],'internal':_0x3413c9[_0xf584('0x2c')]};_0x3e8cc4[_0xf584('0x34')](function(_0x4e41f7){_0x3f25da[_0xf584('0x35')](_[_0xf584('0x58')]({'channel':_0x4e41f7,'type':_0xf584('0x59'),'data1':_0xf584('0x5a'),'data2':_0x594c78},_0xb2d6d6));if(_0x3413c9[_0xf584('0x50')]){_0x15648c[_0xf584('0x35')](_[_0xf584('0x58')]({'channel':_0x4e41f7,'type':'PAUSE','data1':'LOGININPAUSE'},_0xb2d6d6));}});return db[_0xf584('0x39')][_0xf584('0x5b')](_0x3f25da['concat'](_0x15648c),{'individualHooks':!![]});}})[_0xf584('0x11')](function(){if(_0x3413c9){return _0x3413c9[_0xf584('0x42')]({'online':!![],'lastLoginAt':moment()['format'](_0xf584('0x31')),'voicePause':_0x3413c9['loginInPause']||![],'mailPause':_0x3413c9[_0xf584('0x50')]||![],'chatPause':_0x3413c9['loginInPause']||![],'faxPause':_0x3413c9['loginInPause']||![],'smsPause':_0x3413c9[_0xf584('0x50')]||![],'openchannelPause':_0x3413c9[_0xf584('0x50')]||![],'pauseType':_0x3413c9[_0xf584('0x50')]?_0xf584('0x5c'):null,'lastPauseAt':moment()[_0xf584('0x3c')](_0xf584('0x31')),'interface':_0x594c78});}})[_0xf584('0x11')](function(_0x195d56){_0x49084d(_0x195d56);})['catch'](function(_0x10feba){_0x125555(_0x1ffd01[_0xf584('0x15')](0x1f4,_0x10feba[_0xf584('0x17')]));});});}; \ No newline at end of file +var _0x859e=['error','code','message','result','catch','GetUser','User','findAll','options','raw','where','attributes','limit','include','map','model','stringify','ShowUser','find','PauseUser','name','role','internal','interface','UserVoiceQueueRt','update','MemberReport','PAUSE','format','YYYY-MM-DD\x20HH:mm:ss','length','getChannels','push','isNil','SIP/%s','body','type','DEFAULT\x20PAUSE','bulkCreate','UnpauseUser','channel','isValidChannel','Unknown\x20channel','voice','system','mail','chat','sms','openchannel','set','%s%s','Pause','forEach','LogoutUser','findOne','destroy','all','LoginUser','phone','count','../../config/license/util','agents','Maximum\x20login\x20has\x20been\x20reached','getVoiceQueues','upsert','loginInPause','UserVoiceQueue.penalty','merge','LOGIN','callysquare','LOGININPAUSE','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','localhost','socket.io-emitter','./user.socket','register','then','info','User,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x278f7d,_0x2d428c){var _0x266288=function(_0x43a3d1){while(--_0x43a3d1){_0x278f7d['push'](_0x278f7d['shift']());}};_0x266288(++_0x2d428c);}(_0x859e,0xf9));var _0xe859=function(_0x3e2dcc,_0x1d1bbc){_0x3e2dcc=_0x3e2dcc-0x0;var _0x2a512c=_0x859e[_0x3e2dcc];return _0x2a512c;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe859('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe859('0x1'));var db=require('../../mysqldb')['db'];var utils=require(_0xe859('0x2'));var logger=require(_0xe859('0x3'))(_0xe859('0x4'));var config=require(_0xe859('0x5'));var jayson=require('jayson/promise');var client=jayson[_0xe859('0x6')][_0xe859('0x7')]({'port':0x232a});config[_0xe859('0x8')]=_['defaults'](config[_0xe859('0x8')],{'host':_0xe859('0x9'),'port':0x18eb});var socket=require(_0xe859('0xa'))(new Redis(config[_0xe859('0x8')]));require(_0xe859('0xb'))[_0xe859('0xc')](socket);function respondWithRpcPromise(_0xe04026,_0x54976f,_0x3c1829){return new BPromise(function(_0x9dfcf,_0x4d00d6){return client['request'](_0xe04026,_0x3c1829)[_0xe859('0xd')](function(_0x34a60a){logger[_0xe859('0xe')](_0xe859('0xf'),_0x54976f,_0xe859('0x10'));logger[_0xe859('0x11')]('User,\x20%s,\x20%s,\x20%s',_0x54976f,'request\x20sent',JSON['stringify'](_0x34a60a));if(_0x34a60a['error']){if(_0x34a60a[_0xe859('0x12')][_0xe859('0x13')]===0x1f4){logger['error'](_0xe859('0xf'),_0x54976f,_0x34a60a['error'][_0xe859('0x14')]);return _0x4d00d6(_0x34a60a['error'][_0xe859('0x14')]);}logger[_0xe859('0x12')]('User,\x20%s,\x20%s',_0x54976f,_0x34a60a[_0xe859('0x12')][_0xe859('0x14')]);return _0x9dfcf(_0x34a60a[_0xe859('0x12')][_0xe859('0x14')]);}else{logger['info'](_0xe859('0xf'),_0x54976f,'request\x20sent');_0x9dfcf(_0x34a60a[_0xe859('0x15')]['message']);}})[_0xe859('0x16')](function(_0x850da2){logger['error'](_0xe859('0xf'),_0x54976f,_0x850da2);_0x4d00d6(_0x850da2);});});}exports[_0xe859('0x17')]=function(_0x25b9fe){var _0x7946c=this;return new Promise(function(_0x5b8afe,_0x461c37){return db[_0xe859('0x18')][_0xe859('0x19')]({'raw':_0x25b9fe['options']?_0x25b9fe[_0xe859('0x1a')][_0xe859('0x1b')]===undefined?!![]:![]:!![],'where':_0x25b9fe[_0xe859('0x1a')]?_0x25b9fe[_0xe859('0x1a')][_0xe859('0x1c')]||null:null,'attributes':_0x25b9fe[_0xe859('0x1a')]?_0x25b9fe[_0xe859('0x1a')][_0xe859('0x1d')]||null:null,'limit':_0x25b9fe['options']?_0x25b9fe['options'][_0xe859('0x1e')]||null:null,'include':_0x25b9fe[_0xe859('0x1a')]?_0x25b9fe[_0xe859('0x1a')][_0xe859('0x1f')]?_[_0xe859('0x20')](_0x25b9fe[_0xe859('0x1a')][_0xe859('0x1f')],function(_0x28c099){return{'model':db[_0x28c099['model']],'as':_0x28c099['as'],'attributes':_0x28c099['attributes'],'include':_0x28c099[_0xe859('0x1f')]?_[_0xe859('0x20')](_0x28c099[_0xe859('0x1f')],function(_0x5579e){return{'model':db[_0x5579e[_0xe859('0x21')]],'as':_0x5579e['as'],'attributes':_0x5579e[_0xe859('0x1d')],'include':_0x5579e[_0xe859('0x1f')]?_[_0xe859('0x20')](_0x5579e['include'],function(_0x353261){return{'model':db[_0x353261[_0xe859('0x21')]],'as':_0x353261['as'],'attributes':_0x353261['attributes']};}):[]};}):[]};}):[]:[]})[_0xe859('0xd')](function(_0x1c3c22){logger[_0xe859('0xe')](_0xe859('0x17'),_0x25b9fe);logger['debug'](_0xe859('0x17'),_0x25b9fe,JSON[_0xe859('0x22')](_0x1c3c22));_0x5b8afe(_0x1c3c22);})[_0xe859('0x16')](function(_0x56b85f){logger[_0xe859('0x12')](_0xe859('0x17'),_0x56b85f['message'],_0x25b9fe);_0x461c37(_0x7946c[_0xe859('0x12')](0x1f4,_0x56b85f[_0xe859('0x14')]));});});};exports[_0xe859('0x23')]=function(_0x5491ea){var _0x337964=this;return new Promise(function(_0x1fec85,_0x34124a){return db[_0xe859('0x18')][_0xe859('0x24')]({'raw':_0x5491ea[_0xe859('0x1a')]?_0x5491ea[_0xe859('0x1a')][_0xe859('0x1b')]===undefined?!![]:![]:!![],'where':_0x5491ea[_0xe859('0x1a')]?_0x5491ea['options']['where']||null:null,'attributes':_0x5491ea[_0xe859('0x1a')]?_0x5491ea[_0xe859('0x1a')][_0xe859('0x1d')]||null:null,'include':_0x5491ea[_0xe859('0x1a')]?_0x5491ea[_0xe859('0x1a')][_0xe859('0x1f')]?_[_0xe859('0x20')](_0x5491ea[_0xe859('0x1a')]['include'],function(_0xd70057){return{'model':db[_0xd70057[_0xe859('0x21')]],'as':_0xd70057['as'],'attributes':_0xd70057[_0xe859('0x1d')],'include':_0xd70057['include']?_[_0xe859('0x20')](_0xd70057['include'],function(_0x518d67){return{'model':db[_0x518d67[_0xe859('0x21')]],'as':_0x518d67['as'],'attributes':_0x518d67[_0xe859('0x1d')],'include':_0x518d67[_0xe859('0x1f')]?_[_0xe859('0x20')](_0x518d67['include'],function(_0x8d3f79){return{'model':db[_0x8d3f79[_0xe859('0x21')]],'as':_0x8d3f79['as'],'attributes':_0x8d3f79[_0xe859('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1e5dfe){logger[_0xe859('0xe')]('ShowUser',_0x5491ea);logger[_0xe859('0x11')](_0xe859('0x23'),_0x5491ea,JSON[_0xe859('0x22')](_0x1e5dfe));_0x1fec85(_0x1e5dfe);})[_0xe859('0x16')](function(_0x465298){logger[_0xe859('0x12')](_0xe859('0x23'),_0x465298[_0xe859('0x14')],_0x5491ea);_0x34124a(_0x337964['error'](0x1f4,_0x465298['message']));});});};exports[_0xe859('0x25')]=function(_0x46815d){var _0x457516=this;return new Promise(function(_0x44d401,_0x3e19e1){var _0x58c8b6;return db[_0xe859('0x18')][_0xe859('0x24')]({'where':_0x46815d[_0xe859('0x1a')][_0xe859('0x1c')]||{},'attributes':['id',_0xe859('0x26'),_0xe859('0x27'),_0xe859('0x28'),_0xe859('0x29')]})[_0xe859('0xd')](function(_0x2e22be){if(_0x2e22be){_0x58c8b6=_0x2e22be;return db[_0xe859('0x2a')][_0xe859('0x2b')]({'paused':0x1},{'where':{'UserId':_0x58c8b6['id']},'individualHooks':!![]});}})['then'](function(){if(_0x58c8b6){return db[_0xe859('0x2c')]['findAll']({'where':{'membername':_0x58c8b6[_0xe859('0x26')],'type':_0xe859('0x2d'),'exitAt':null}});}})[_0xe859('0xd')](function(_0x266deb){if(_0x58c8b6){if(_0x266deb&&_0x266deb['length']){var _0x1b3822=moment()[_0xe859('0x2e')](_0xe859('0x2f'));for(var _0x1023d5=0x0,_0x14d6de=_0x266deb[_0xe859('0x30')];_0x1023d5<_0x14d6de;_0x1023d5++){_0x266deb[_0x1023d5]['updateAttributes']({'exitAt':_0x1b3822});}}}})[_0xe859('0xd')](function(){if(_0x58c8b6){var _0x4cbd5a=[];var _0x1cbb36=utils[_0xe859('0x31')]();_0x1cbb36['forEach'](function(_0x3d9efc){_0x4cbd5a[_0xe859('0x32')]({'channel':_0x3d9efc,'membername':_0x58c8b6[_0xe859('0x26')],'interface':_[_0xe859('0x33')](_0x58c8b6[_0xe859('0x29')])?util['format'](_0xe859('0x34'),_0x58c8b6[_0xe859('0x26')]):_0x58c8b6[_0xe859('0x29')],'type':'PAUSE','enterAt':moment()[_0xe859('0x2e')]('YYYY-MM-DD\x20HH:mm:ss'),'data1':_0x46815d[_0xe859('0x35')][_0xe859('0x36')]||_0xe859('0x37'),'role':_0x58c8b6[_0xe859('0x27')],'internal':_0x58c8b6[_0xe859('0x28')],'uniqueid':_0x46815d[_0xe859('0x35')]['uniqueid']||null});});return db[_0xe859('0x2c')][_0xe859('0x38')](_0x4cbd5a,{'individualHooks':!![]});}})['then'](function(){if(_0x58c8b6){return _0x58c8b6[_0xe859('0x2b')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'pauseType':_0x46815d[_0xe859('0x35')]['type']||'DEFAULT\x20PAUSE','lastPauseAt':moment()[_0xe859('0x2e')](_0xe859('0x2f'))});}})[_0xe859('0xd')](function(_0x1d2820){_0x44d401(_0x1d2820);})[_0xe859('0x16')](function(_0x1f82d9){_0x3e19e1(_0x457516[_0xe859('0x12')](0x1f4,_0x1f82d9['message']));});});};exports[_0xe859('0x39')]=function(_0x400f64){var _0x6f92c9=this;return new Promise(function(_0x51ad32,_0x28bd83){var _0x2f4e4a;return db[_0xe859('0x18')]['findOne']({'where':_0x400f64[_0xe859('0x1a')][_0xe859('0x1c')]||{},'attributes':['id','name']})[_0xe859('0xd')](function(_0x565b23){if(_0x565b23){_0x2f4e4a=_0x565b23;if(_0x400f64[_0xe859('0x35')][_0xe859('0x3a')]&&!utils[_0xe859('0x3b')](_0x400f64[_0xe859('0x35')][_0xe859('0x3a')])){throw new Error(_0xe859('0x3c'));}switch(_0x400f64[_0xe859('0x35')][_0xe859('0x3a')]){case _0xe859('0x3d'):return db['UserVoiceQueueRt'][_0xe859('0x2b')]({'paused':0x0},{'where':{'UserId':_0x2f4e4a['id']}})[_0xe859('0xd')](function(){return db[_0xe859('0x2c')][_0xe859('0x24')]({'where':{'channel':_0x400f64[_0xe859('0x35')][_0xe859('0x3a')],'membername':_0x2f4e4a[_0xe859('0x26')],'type':_0xe859('0x2d'),'exitAt':null}});})['then'](function(_0x5e85bb){if(_0x5e85bb){return _0x5e85bb[_0xe859('0x2b')]({'exitAt':moment()[_0xe859('0x2e')](_0xe859('0x2f')),'data2':_0xe859('0x3e')},{'individualHooks':!![]});}return null;})[_0xe859('0xd')](function(){return _0x2f4e4a[_0xe859('0x2b')]({'voicePause':![]});});case _0xe859('0x3f'):case _0xe859('0x40'):case'fax':case _0xe859('0x41'):case _0xe859('0x42'):return db[_0xe859('0x2c')][_0xe859('0x24')]({'where':{'channel':_0x400f64['body'][_0xe859('0x3a')],'membername':_0x2f4e4a[_0xe859('0x26')],'type':_0xe859('0x2d'),'exitAt':null}})['then'](function(_0x7d79d8){return _0x7d79d8['update']({'exitAt':moment()['format'](_0xe859('0x2f')),'data2':_0xe859('0x3e')},{'individualHooks':!![]});})['then'](function(){var _0x149b5a={};_[_0xe859('0x43')](_0x149b5a,util[_0xe859('0x2e')](_0xe859('0x44'),_0x400f64[_0xe859('0x35')][_0xe859('0x3a')],_0xe859('0x45')),![]);return _0x2f4e4a[_0xe859('0x2b')](_0x149b5a);});default:return db[_0xe859('0x2a')][_0xe859('0x2b')]({'paused':0x0},{'where':{'UserId':_0x2f4e4a['id']}})[_0xe859('0xd')](function(){return db['MemberReport'][_0xe859('0x19')]({'where':{'membername':_0x2f4e4a[_0xe859('0x26')],'type':'PAUSE','exitAt':null}});})[_0xe859('0xd')](function(_0x2f77f7){var _0x3d2be1=[];_0x2f77f7[_0xe859('0x46')](function(_0x20b352){_0x3d2be1[_0xe859('0x32')](_0x20b352[_0xe859('0x2b')]({'exitAt':moment()[_0xe859('0x2e')](_0xe859('0x2f')),'data2':'system'}));});return BPromise['all'](_0x3d2be1);})[_0xe859('0xd')](function(){return _0x2f4e4a[_0xe859('0x2b')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});});}}})[_0xe859('0xd')](function(_0x22725f){_0x51ad32(_0x22725f);})[_0xe859('0x16')](function(_0x3e8370){_0x28bd83(_0x6f92c9[_0xe859('0x12')](0x1f4,_0x3e8370[_0xe859('0x14')]));});});};exports[_0xe859('0x47')]=function(_0x3e929d){var _0x314e21=this;return new Promise(function(_0x4ff409,_0x5e3236){var _0x5882aa;return db['User'][_0xe859('0x48')]({'where':_0x3e929d[_0xe859('0x1a')][_0xe859('0x1c')]||{},'attributes':['id',_0xe859('0x26')]})[_0xe859('0xd')](function(_0x2ae02a){if(_0x2ae02a){_0x5882aa=_0x2ae02a;return db[_0xe859('0x2a')][_0xe859('0x49')]({'where':{'membername':_0x5882aa['name']},'individualHooks':!![]});}})[_0xe859('0xd')](function(){if(_0x5882aa){return db[_0xe859('0x2c')]['findAll']({'where':{'membername':_0x5882aa['name'],'exitAt':null}});}})[_0xe859('0xd')](function(_0x163e01){if(_0x5882aa){if(_0x163e01&&_0x163e01[_0xe859('0x30')]){var _0x319f0a=[];_0x163e01[_0xe859('0x46')](function(_0x378d12){_0x319f0a[_0xe859('0x32')](_0x378d12['update']({'exitAt':moment()[_0xe859('0x2e')]('YYYY-MM-DD\x20HH:mm:ss')}));});return BPromise[_0xe859('0x4a')](_0x319f0a);}}})[_0xe859('0xd')](function(){if(_0x5882aa){return _0x5882aa[_0xe859('0x2b')]({'online':![],'lastLoginAt':null,'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})[_0xe859('0xd')](function(_0x5cd593){_0x4ff409(_0x5cd593);})['catch'](function(_0x20b40b){_0x5e3236(_0x314e21[_0xe859('0x12')](0x1f4,_0x20b40b[_0xe859('0x14')]));});});};exports[_0xe859('0x4b')]=function(_0x7d4906){var _0x15c913=this;return new Promise(function(_0xd911c3,_0x20d4db){var _0x487dad;var _0x133f93;var _0x8bb9b4;var _0x3c2f45;return db['User'][_0xe859('0x48')]({'where':_0x7d4906[_0xe859('0x1a')][_0xe859('0x1c')]||{},'attributes':['id','name',_0xe859('0x27'),'mobile',_0xe859('0x4c'),_0xe859('0x28'),'loginInPause',_0xe859('0x29')]})['then'](function(_0x2d471a){if(_0x2d471a){_0x487dad=_0x2d471a;_0x3c2f45=_0x7d4906['body']['interface']?_0x7d4906[_0xe859('0x35')][_0xe859('0x29')]:util['format'](_0xe859('0x34'),_0x487dad['name']);return db[_0xe859('0x18')][_0xe859('0x4d')]({'where':{'role':'agent','online':!![],'id':{'$ne':_0x487dad['id']}}});}})[_0xe859('0xd')](function(_0x5b89cb){if(_0x5b89cb){_0x8bb9b4=_0x5b89cb;return require(_0xe859('0x4e'))['getLicense']();}})['then'](function(_0x13b8c6){if(_0x13b8c6&&_0x13b8c6[_0xe859('0x4f')]&&_0x8bb9b4>=_0x13b8c6[_0xe859('0x4f')]){throw new Error(_0xe859('0x50'));}})[_0xe859('0xd')](function(){if(_0x487dad){return db[_0xe859('0x2a')]['destroy']({'where':{'membername':_0x487dad[_0xe859('0x26')]},'individualHooks':!![]});}})[_0xe859('0xd')](function(){if(_0x487dad){return _0x487dad[_0xe859('0x51')]({'raw':!![]});}})[_0xe859('0xd')](function(_0x117b07){if(_0x487dad){if(_0x117b07){var _0x1ada65=[];_0x133f93=_0x117b07;if(_0x133f93[_0xe859('0x30')]){for(var _0x10215f=0x0;_0x10215f<_0x133f93[_0xe859('0x30')];_0x10215f++){_0x1ada65[_0xe859('0x32')](db['UserVoiceQueueRt'][_0xe859('0x52')]({'membername':_0x487dad[_0xe859('0x26')],'UserId':_0x487dad['id'],'queue_name':_0x133f93[_0x10215f][_0xe859('0x26')],'VoiceQueueId':_0x133f93[_0x10215f]['id'],'interface':_0x3c2f45,'paused':_0x487dad[_0xe859('0x53')]||![],'penalty':_0x133f93[_0x10215f][_0xe859('0x54')]||0x0}));}return BPromise[_0xe859('0x4a')](_0x1ada65);}}}})[_0xe859('0xd')](function(){if(_0x487dad){return db[_0xe859('0x2c')][_0xe859('0x19')]({'where':{'membername':_0x487dad[_0xe859('0x26')],'exitAt':null}});}})[_0xe859('0xd')](function(_0x36cc94){if(_0x487dad){if(_0x36cc94&&_0x36cc94['length']){var _0x14db7b=[];_0x36cc94[_0xe859('0x46')](function(_0x3a642b){_0x14db7b[_0xe859('0x32')](_0x3a642b[_0xe859('0x2b')]({'exitAt':moment()[_0xe859('0x2e')](_0xe859('0x2f'))}));});return BPromise['all'](_0x14db7b);}}})['then'](function(_0x9b4f40){if(_0x487dad){var _0x4cdcc2=[];var _0x511fd6=[];var _0x57e7bb=utils['getChannels']();var _0x18be8a={'membername':_0x487dad['name'],'interface':_0x3c2f45,'enterAt':moment()[_0xe859('0x2e')](_0xe859('0x2f')),'role':_0x487dad[_0xe859('0x27')],'internal':_0x487dad[_0xe859('0x28')]};_0x57e7bb['forEach'](function(_0x2adce3){_0x4cdcc2[_0xe859('0x32')](_[_0xe859('0x55')]({'channel':_0x2adce3,'type':_0xe859('0x56'),'data1':_0xe859('0x57'),'data2':_0x3c2f45},_0x18be8a));if(_0x487dad[_0xe859('0x53')]){_0x511fd6['push'](_[_0xe859('0x55')]({'channel':_0x2adce3,'type':_0xe859('0x2d'),'data1':_0xe859('0x58')},_0x18be8a));}});return db[_0xe859('0x2c')][_0xe859('0x38')](_0x4cdcc2['concat'](_0x511fd6),{'individualHooks':!![]});}})[_0xe859('0xd')](function(){if(_0x487dad){return _0x487dad['update']({'online':!![],'lastLoginAt':moment()[_0xe859('0x2e')](_0xe859('0x2f')),'voicePause':_0x487dad[_0xe859('0x53')]||![],'mailPause':_0x487dad['loginInPause']||![],'chatPause':_0x487dad[_0xe859('0x53')]||![],'faxPause':_0x487dad[_0xe859('0x53')]||![],'smsPause':_0x487dad['loginInPause']||![],'openchannelPause':_0x487dad[_0xe859('0x53')]||![],'pauseType':_0x487dad[_0xe859('0x53')]?_0xe859('0x58'):null,'lastPauseAt':moment()[_0xe859('0x2e')](_0xe859('0x2f')),'interface':_0x3c2f45});}})[_0xe859('0xd')](function(_0x1a2ec1){_0xd911c3(_0x1a2ec1);})[_0xe859('0x16')](function(_0x20d68a){_0x20d4db(_0x15c913['error'](0x1f4,_0x20d68a['message']));});});}; \ No newline at end of file diff --git a/server/api/user/user.socket.js b/server/api/user/user.socket.js index 563eaa3..52b4896 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 _0x26dd=['./user.events','remove','removeListener','register','length','user:'];(function(_0x3dd531,_0xedaa84){var _0x299141=function(_0x2ca740){while(--_0x2ca740){_0x3dd531['push'](_0x3dd531['shift']());}};_0x299141(++_0xedaa84);}(_0x26dd,0x108));var _0xd26d=function(_0x4fc4c8,_0x211d52){_0x4fc4c8=_0x4fc4c8-0x0;var _0x5539fb=_0x26dd[_0x4fc4c8];return _0x5539fb;};'use strict';var UserEvents=require(_0xd26d('0x0'));var events=['save',_0xd26d('0x1'),'update'];function createListener(_0x547cc9,_0x232a1f){return function(_0x492e97){_0x232a1f['emit'](_0x547cc9,_0x492e97);};}function removeListener(_0x1ee97c,_0x5b130b){return function(){UserEvents[_0xd26d('0x2')](_0x1ee97c,_0x5b130b);};}exports[_0xd26d('0x3')]=function(_0x37ca5a){for(var _0x5d30c5=0x0,_0x230a05=events[_0xd26d('0x4')];_0x5d30c5<_0x230a05;_0x5d30c5++){var _0x4c39be=events[_0x5d30c5];var _0x201e7e=createListener(_0xd26d('0x5')+_0x4c39be,_0x37ca5a);UserEvents['on'](_0x4c39be,_0x201e7e);}}; \ No newline at end of file +var _0x35f4=['./user.events','save','remove','update','emit','register','length','user:'];(function(_0x12934a,_0x306574){var _0x23ddb7=function(_0x576962){while(--_0x576962){_0x12934a['push'](_0x12934a['shift']());}};_0x23ddb7(++_0x306574);}(_0x35f4,0x108));var _0x435f=function(_0x1d2bbb,_0x202267){_0x1d2bbb=_0x1d2bbb-0x0;var _0x38082b=_0x35f4[_0x1d2bbb];return _0x38082b;};'use strict';var UserEvents=require(_0x435f('0x0'));var events=[_0x435f('0x1'),_0x435f('0x2'),_0x435f('0x3')];function createListener(_0x2c2af1,_0x424ad3){return function(_0x1b076d){_0x424ad3[_0x435f('0x4')](_0x2c2af1,_0x1b076d);};}function removeListener(_0x536594,_0x12b54b){return function(){UserEvents['removeListener'](_0x536594,_0x12b54b);};}exports[_0x435f('0x5')]=function(_0x4eb89b){for(var _0x463b26=0x0,_0xa45a7a=events[_0x435f('0x6')];_0x463b26<_0xa45a7a;_0x463b26++){var _0xc22217=events[_0x463b26];var _0xff8c69=createListener(_0x435f('0x7')+_0xc22217,_0x4eb89b);UserEvents['on'](_0xc22217,_0xff8c69);}}; \ No newline at end of file diff --git a/server/api/userChatQueue/index.js b/server/api/userChatQueue/index.js index e1bd3aa..586b6ac 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 _0x2982=['exports','multer','util','path','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x155bb9,_0x1266d6){var _0x88cdda=function(_0xe227c0){while(--_0xe227c0){_0x155bb9['push'](_0x155bb9['shift']());}};_0x88cdda(++_0x1266d6);}(_0x2982,0x1e4));var _0x2298=function(_0x14e069,_0x2921c9){_0x14e069=_0x14e069-0x0;var _0x4534f0=_0x2982[_0x14e069];return _0x4534f0;};'use strict';var multer=require(_0x2298('0x0'));var util=require(_0x2298('0x1'));var path=require(_0x2298('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var auth=require(_0x2298('0x3'));var interaction=require(_0x2298('0x4'));var config=require(_0x2298('0x5'));module[_0x2298('0x6')]=router; \ No newline at end of file +var _0xbbe1=['../../config/environment','exports','multer','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xbbe1,0xc2));var _0x1bbe=function(_0x56500a,_0x5953c7){_0x56500a=_0x56500a-0x0;var _0x333977=_0xbbe1[_0x56500a];return _0x333977;};'use strict';var multer=require(_0x1bbe('0x0'));var util=require('util');var path=require(_0x1bbe('0x1'));var timeout=require(_0x1bbe('0x2'));var express=require(_0x1bbe('0x3'));var router=express[_0x1bbe('0x4')]();var auth=require(_0x1bbe('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x1bbe('0x6'));module[_0x1bbe('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 e95ae89..8ad1ba6 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 _0xbaf0=['exports','INTEGER'];(function(_0x22d655,_0x3941dd){var _0x257739=function(_0x98136e){while(--_0x98136e){_0x22d655['push'](_0x22d655['shift']());}};_0x257739(++_0x3941dd);}(_0xbaf0,0x12a));var _0x0baf=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xbaf0[_0x6c993a];return _0x27f547;};'use strict';var Sequelize=require('sequelize');module[_0x0baf('0x0')]={'penalty':{'type':Sequelize[_0x0baf('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0xa9e0=['sequelize','exports','INTEGER'];(function(_0x4cb2be,_0x5e4d8e){var _0x4d054f=function(_0x5a3132){while(--_0x5a3132){_0x4cb2be['push'](_0x4cb2be['shift']());}};_0x4d054f(++_0x5e4d8e);}(_0xa9e0,0x123));var _0x0a9e=function(_0xea8947,_0x1b573d){_0xea8947=_0xea8947-0x0;var _0x2455e9=_0xa9e0[_0xea8947];return _0x2455e9;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'penalty':{'type':Sequelize[_0x0a9e('0x2')],'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 a9936b0..42a29ee 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 _0x62a7=['UserChatQueue','user_has_chat_queues','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0x2becd7,_0xe22fc0){var _0x6226be=function(_0x33dc68){while(--_0x33dc68){_0x2becd7['push'](_0x2becd7['shift']());}};_0x6226be(++_0xe22fc0);}(_0x62a7,0x84));var _0x762a=function(_0xe38764,_0x28ce79){_0xe38764=_0xe38764-0x0;var _0x5979cf=_0x62a7[_0xe38764];return _0x5979cf;};'use strict';var _=require('lodash');var util=require(_0x762a('0x0'));var logger=require(_0x762a('0x1'))(_0x762a('0x2'));var moment=require(_0x762a('0x3'));var BPromise=require(_0x762a('0x4'));var rp=require(_0x762a('0x5'));var fs=require('fs');var path=require(_0x762a('0x6'));var rimraf=require(_0x762a('0x7'));var config=require(_0x762a('0x8'));var attributes=require('./userChatQueue.attributes');module[_0x762a('0x9')]=function(_0x1d67c3,_0x4a5693){return _0x1d67c3[_0x762a('0xa')](_0x762a('0xb'),attributes,{'tableName':_0x762a('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1012=['user_has_chat_queues','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','define','UserChatQueue'];(function(_0xca1f0e,_0x2713d5){var _0x35e4ef=function(_0x44c40f){while(--_0x44c40f){_0xca1f0e['push'](_0xca1f0e['shift']());}};_0x35e4ef(++_0x2713d5);}(_0x1012,0x1f0));var _0x2101=function(_0xb3b452,_0x582e8e){_0xb3b452=_0xb3b452-0x0;var _0x238983=_0x1012[_0xb3b452];return _0x238983;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x2101('0x0'))('api');var moment=require(_0x2101('0x1'));var BPromise=require(_0x2101('0x2'));var rp=require(_0x2101('0x3'));var fs=require('fs');var path=require(_0x2101('0x4'));var rimraf=require('rimraf');var config=require(_0x2101('0x5'));var attributes=require('./userChatQueue.attributes');module['exports']=function(_0x1d91cd,_0x4a2188){return _0x1d91cd[_0x2101('0x6')](_0x2101('0x7'),attributes,{'tableName':_0x2101('0x8'),'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 906440e..113e8d9 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 _0xba17=['client','http','request','info','UserChatQueue,\x20%s,\x20%s','request\x20sent','debug','UserChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x42e53d,_0x2278e0){var _0x410d07=function(_0x35e60a){while(--_0x35e60a){_0x42e53d['push'](_0x42e53d['shift']());}};_0x410d07(++_0x2278e0);}(_0xba17,0x138));var _0x7ba1=function(_0x3e665d,_0xef863d){_0x3e665d=_0x3e665d-0x0;var _0x24a155=_0xba17[_0x3e665d];return _0x24a155;};'use strict';var _=require('lodash');var util=require(_0x7ba1('0x0'));var moment=require(_0x7ba1('0x1'));var BPromise=require(_0x7ba1('0x2'));var rs=require(_0x7ba1('0x3'));var fs=require('fs');var Redis=require(_0x7ba1('0x4'));var db=require(_0x7ba1('0x5'))['db'];var utils=require(_0x7ba1('0x6'));var logger=require(_0x7ba1('0x7'))(_0x7ba1('0x8'));var config=require(_0x7ba1('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x7ba1('0xa')][_0x7ba1('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5d65bc,_0x5ddcd8,_0x34e71f){return new BPromise(function(_0x45127,_0x38e162){return client[_0x7ba1('0xc')](_0x5d65bc,_0x34e71f)['then'](function(_0x593756){logger[_0x7ba1('0xd')](_0x7ba1('0xe'),_0x5ddcd8,_0x7ba1('0xf'));logger[_0x7ba1('0x10')](_0x7ba1('0x11'),_0x5ddcd8,_0x7ba1('0xf'),JSON[_0x7ba1('0x12')](_0x593756));if(_0x593756[_0x7ba1('0x13')]){if(_0x593756['error']['code']===0x1f4){logger[_0x7ba1('0x13')]('UserChatQueue,\x20%s,\x20%s',_0x5ddcd8,_0x593756[_0x7ba1('0x13')][_0x7ba1('0x14')]);return _0x38e162(_0x593756[_0x7ba1('0x13')]['message']);}logger[_0x7ba1('0x13')](_0x7ba1('0xe'),_0x5ddcd8,_0x593756[_0x7ba1('0x13')][_0x7ba1('0x14')]);return _0x45127(_0x593756[_0x7ba1('0x13')][_0x7ba1('0x14')]);}else{logger[_0x7ba1('0xd')](_0x7ba1('0xe'),_0x5ddcd8,_0x7ba1('0xf'));_0x45127(_0x593756[_0x7ba1('0x15')][_0x7ba1('0x14')]);}})[_0x7ba1('0x16')](function(_0x336d0c){logger['error']('UserChatQueue,\x20%s,\x20%s',_0x5ddcd8,_0x336d0c);_0x38e162(_0x336d0c);});});} \ No newline at end of file +var _0x17a3=['message','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info','UserChatQueue,\x20%s,\x20%s','request\x20sent','error'];(function(_0x373096,_0x4d37aa){var _0x14a6d0=function(_0xb3b614){while(--_0xb3b614){_0x373096['push'](_0x373096['shift']());}};_0x14a6d0(++_0x4d37aa);}(_0x17a3,0x133));var _0x317a=function(_0x230aa5,_0x3110bf){_0x230aa5=_0x230aa5-0x0;var _0x21087e=_0x17a3[_0x230aa5];return _0x21087e;};'use strict';var _=require(_0x317a('0x0'));var util=require('util');var moment=require(_0x317a('0x1'));var BPromise=require(_0x317a('0x2'));var rs=require(_0x317a('0x3'));var fs=require('fs');var Redis=require(_0x317a('0x4'));var db=require(_0x317a('0x5'))['db'];var utils=require(_0x317a('0x6'));var logger=require('../../config/logger')(_0x317a('0x7'));var config=require(_0x317a('0x8'));var jayson=require(_0x317a('0x9'));var client=jayson[_0x317a('0xa')][_0x317a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xdb62ee,_0x1ba4fd,_0x499a42){return new BPromise(function(_0xf165e9,_0x4f8486){return client['request'](_0xdb62ee,_0x499a42)[_0x317a('0xc')](function(_0x1f26ec){logger[_0x317a('0xd')](_0x317a('0xe'),_0x1ba4fd,'request\x20sent');logger['debug']('UserChatQueue,\x20%s,\x20%s,\x20%s',_0x1ba4fd,_0x317a('0xf'),JSON['stringify'](_0x1f26ec));if(_0x1f26ec[_0x317a('0x10')]){if(_0x1f26ec[_0x317a('0x10')]['code']===0x1f4){logger['error']('UserChatQueue,\x20%s,\x20%s',_0x1ba4fd,_0x1f26ec['error'][_0x317a('0x11')]);return _0x4f8486(_0x1f26ec['error'][_0x317a('0x11')]);}logger[_0x317a('0x10')](_0x317a('0xe'),_0x1ba4fd,_0x1f26ec['error'][_0x317a('0x11')]);return _0xf165e9(_0x1f26ec[_0x317a('0x10')][_0x317a('0x11')]);}else{logger[_0x317a('0xd')](_0x317a('0xe'),_0x1ba4fd,_0x317a('0xf'));_0xf165e9(_0x1f26ec['result'][_0x317a('0x11')]);}})['catch'](function(_0x2e5827){logger[_0x317a('0x10')]('UserChatQueue,\x20%s,\x20%s',_0x1ba4fd,_0x2e5827);_0x4f8486(_0x2e5827);});});} \ No newline at end of file diff --git a/server/api/userFaxQueue/index.js b/server/api/userFaxQueue/index.js index cdbeab9..491e86e 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 _0xebd5=['../../config/environment','exports','multer','path','connect-timeout','Router','../../components/interaction/service'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xebd5,0xcd));var _0x5ebd=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0xebd5[_0x53ccf2];return _0x5a2964;};'use strict';var multer=require(_0x5ebd('0x0'));var util=require('util');var path=require(_0x5ebd('0x1'));var timeout=require(_0x5ebd('0x2'));var express=require('express');var router=express[_0x5ebd('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x5ebd('0x4'));var config=require(_0x5ebd('0x5'));module[_0x5ebd('0x6')]=router; \ No newline at end of file +var _0xc09a=['path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','exports','multer','util'];(function(_0x1a77e6,_0x3b75e6){var _0x9ea6e8=function(_0x48d15d){while(--_0x48d15d){_0x1a77e6['push'](_0x1a77e6['shift']());}};_0x9ea6e8(++_0x3b75e6);}(_0xc09a,0x8e));var _0xac09=function(_0x5eea7d,_0x3a07d9){_0x5eea7d=_0x5eea7d-0x0;var _0x398d81=_0xc09a[_0x5eea7d];return _0x398d81;};'use strict';var multer=require(_0xac09('0x0'));var util=require(_0xac09('0x1'));var path=require(_0xac09('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xac09('0x3')]();var auth=require(_0xac09('0x4'));var interaction=require(_0xac09('0x5'));var config=require(_0xac09('0x6'));module[_0xac09('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 4a9b8fd..a096d6b 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 _0x3423=['INTEGER','STRING'];(function(_0x253263,_0x4ab0af){var _0xbddbc5=function(_0x577afd){while(--_0x577afd){_0x253263['push'](_0x253263['shift']());}};_0xbddbc5(++_0x4ab0af);}(_0x3423,0x188));var _0x3342=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3423[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module['exports']={'penalty':{'type':Sequelize[_0x3342('0x0')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x3342('0x0')],'defaultValue':0x0},'queue':{'type':Sequelize[_0x3342('0x1')]}}; \ No newline at end of file +var _0xf4f4=['exports','INTEGER','STRING','sequelize'];(function(_0x4394b6,_0x12357f){var _0x360244=function(_0x5689a1){while(--_0x5689a1){_0x4394b6['push'](_0x4394b6['shift']());}};_0x360244(++_0x12357f);}(_0xf4f4,0xe3));var _0x4f4f=function(_0x1dfc20,_0x4432cc){_0x1dfc20=_0x1dfc20-0x0;var _0x1187f7=_0xf4f4[_0x1dfc20];return _0x1187f7;};'use strict';var Sequelize=require(_0x4f4f('0x0'));module[_0x4f4f('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x4f4f('0x2')],'defaultValue':0x0},'queue':{'type':Sequelize[_0x4f4f('0x3')]}}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.model.js b/server/api/userFaxQueue/userFaxQueue.model.js index 138546b..5fd8472 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 _0xc125=['rimraf','./userFaxQueue.attributes','define','UserFaxQueue','user_has_fax_queues','lodash','util','api','moment','request-promise','path'];(function(_0x412943,_0x47b85a){var _0x3600b9=function(_0x2f1408){while(--_0x2f1408){_0x412943['push'](_0x412943['shift']());}};_0x3600b9(++_0x47b85a);}(_0xc125,0x19c));var _0x5c12=function(_0x26c5f0,_0xcb35b9){_0x26c5f0=_0x26c5f0-0x0;var _0x18efdb=_0xc125[_0x26c5f0];return _0x18efdb;};'use strict';var _=require(_0x5c12('0x0'));var util=require(_0x5c12('0x1'));var logger=require('../../config/logger')(_0x5c12('0x2'));var moment=require(_0x5c12('0x3'));var BPromise=require('bluebird');var rp=require(_0x5c12('0x4'));var fs=require('fs');var path=require(_0x5c12('0x5'));var rimraf=require(_0x5c12('0x6'));var config=require('../../config/environment');var attributes=require(_0x5c12('0x7'));module['exports']=function(_0x221d83,_0x4bfd21){return _0x221d83[_0x5c12('0x8')](_0x5c12('0x9'),attributes,{'tableName':_0x5c12('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3b43=['request-promise','rimraf','../../config/environment','./userFaxQueue.attributes','define','UserFaxQueue','user_has_fax_queues','lodash','api','moment'];(function(_0x2f6c82,_0x2afe7f){var _0x2197da=function(_0x1ef885){while(--_0x1ef885){_0x2f6c82['push'](_0x2f6c82['shift']());}};_0x2197da(++_0x2afe7f);}(_0x3b43,0x115));var _0x33b4=function(_0xa88b02,_0x257cd7){_0xa88b02=_0xa88b02-0x0;var _0x5ccd46=_0x3b43[_0xa88b02];return _0x5ccd46;};'use strict';var _=require(_0x33b4('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x33b4('0x1'));var moment=require(_0x33b4('0x2'));var BPromise=require('bluebird');var rp=require(_0x33b4('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x33b4('0x4'));var config=require(_0x33b4('0x5'));var attributes=require(_0x33b4('0x6'));module['exports']=function(_0x22cb14,_0x3e8c59){return _0x22cb14[_0x33b4('0x7')](_0x33b4('0x8'),attributes,{'tableName':_0x33b4('0x9'),'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 e43abc3..8a3fcb7 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 _0x2fd0=['moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','jayson/promise','client','http','then','info','UserFaxQueue,\x20%s,\x20%s','request\x20sent','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util'];(function(_0x24ba47,_0x5c98f2){var _0x11fa7c=function(_0x5b12ca){while(--_0x5b12ca){_0x24ba47['push'](_0x24ba47['shift']());}};_0x11fa7c(++_0x5c98f2);}(_0x2fd0,0x1e1));var _0x02fd=function(_0x22f8ab,_0x15d8ff){_0x22f8ab=_0x22f8ab-0x0;var _0x2a70e5=_0x2fd0[_0x22f8ab];return _0x2a70e5;};'use strict';var _=require(_0x02fd('0x0'));var util=require(_0x02fd('0x1'));var moment=require(_0x02fd('0x2'));var BPromise=require(_0x02fd('0x3'));var rs=require(_0x02fd('0x4'));var fs=require('fs');var Redis=require(_0x02fd('0x5'));var db=require(_0x02fd('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x02fd('0x7'));var config=require('../../config/environment');var jayson=require(_0x02fd('0x8'));var client=jayson[_0x02fd('0x9')][_0x02fd('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x522f88,_0x286bac,_0x3ca1d8){return new BPromise(function(_0x1e282f,_0x3a2715){return client['request'](_0x522f88,_0x3ca1d8)[_0x02fd('0xb')](function(_0x26651f){logger[_0x02fd('0xc')](_0x02fd('0xd'),_0x286bac,_0x02fd('0xe'));logger[_0x02fd('0xf')](_0x02fd('0x10'),_0x286bac,'request\x20sent',JSON[_0x02fd('0x11')](_0x26651f));if(_0x26651f['error']){if(_0x26651f[_0x02fd('0x12')][_0x02fd('0x13')]===0x1f4){logger[_0x02fd('0x12')](_0x02fd('0xd'),_0x286bac,_0x26651f[_0x02fd('0x12')]['message']);return _0x3a2715(_0x26651f[_0x02fd('0x12')][_0x02fd('0x14')]);}logger[_0x02fd('0x12')](_0x02fd('0xd'),_0x286bac,_0x26651f[_0x02fd('0x12')][_0x02fd('0x14')]);return _0x1e282f(_0x26651f['error'][_0x02fd('0x14')]);}else{logger[_0x02fd('0xc')](_0x02fd('0xd'),_0x286bac,_0x02fd('0xe'));_0x1e282f(_0x26651f[_0x02fd('0x15')]['message']);}})[_0x02fd('0x16')](function(_0x2a27b3){logger['error'](_0x02fd('0xd'),_0x286bac,_0x2a27b3);_0x3a2715(_0x2a27b3);});});} \ No newline at end of file +var _0x47c5=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','UserFaxQueue,\x20%s,\x20%s','request\x20sent','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment'];(function(_0x215e65,_0x183f97){var _0xa85842=function(_0x43bf45){while(--_0x43bf45){_0x215e65['push'](_0x215e65['shift']());}};_0xa85842(++_0x183f97);}(_0x47c5,0x165));var _0x547c=function(_0x333bb9,_0x334274){_0x333bb9=_0x333bb9-0x0;var _0xfa004a=_0x47c5[_0x333bb9];return _0xfa004a;};'use strict';var _=require(_0x547c('0x0'));var util=require(_0x547c('0x1'));var moment=require(_0x547c('0x2'));var BPromise=require(_0x547c('0x3'));var rs=require(_0x547c('0x4'));var fs=require('fs');var Redis=require(_0x547c('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x547c('0x6'));var logger=require(_0x547c('0x7'))('rpc');var config=require(_0x547c('0x8'));var jayson=require(_0x547c('0x9'));var client=jayson['client'][_0x547c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x439f25,_0x381f2e,_0x10a334){return new BPromise(function(_0x12fb7d,_0x4ef079){return client[_0x547c('0xb')](_0x439f25,_0x10a334)[_0x547c('0xc')](function(_0x10dec9){logger[_0x547c('0xd')](_0x547c('0xe'),_0x381f2e,_0x547c('0xf'));logger[_0x547c('0x10')](_0x547c('0x11'),_0x381f2e,_0x547c('0xf'),JSON[_0x547c('0x12')](_0x10dec9));if(_0x10dec9[_0x547c('0x13')]){if(_0x10dec9['error'][_0x547c('0x14')]===0x1f4){logger[_0x547c('0x13')]('UserFaxQueue,\x20%s,\x20%s',_0x381f2e,_0x10dec9[_0x547c('0x13')][_0x547c('0x15')]);return _0x4ef079(_0x10dec9[_0x547c('0x13')][_0x547c('0x15')]);}logger[_0x547c('0x13')](_0x547c('0xe'),_0x381f2e,_0x10dec9[_0x547c('0x13')][_0x547c('0x15')]);return _0x12fb7d(_0x10dec9[_0x547c('0x13')][_0x547c('0x15')]);}else{logger[_0x547c('0xd')](_0x547c('0xe'),_0x381f2e,_0x547c('0xf'));_0x12fb7d(_0x10dec9[_0x547c('0x16')][_0x547c('0x15')]);}})[_0x547c('0x17')](function(_0x39498d){logger[_0x547c('0x13')]('UserFaxQueue,\x20%s,\x20%s',_0x381f2e,_0x39498d);_0x4ef079(_0x39498d);});});} \ No newline at end of file diff --git a/server/api/userMailQueue/index.js b/server/api/userMailQueue/index.js index cbf8921..1fbefa3 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 _0xf6ca=['exports','multer','path','connect-timeout','express','../../components/interaction/service','../../config/environment'];(function(_0x4323be,_0x4127a9){var _0x51e495=function(_0x12208c){while(--_0x12208c){_0x4323be['push'](_0x4323be['shift']());}};_0x51e495(++_0x4127a9);}(_0xf6ca,0x6a));var _0xaf6c=function(_0x56460a,_0x4f8f01){_0x56460a=_0x56460a-0x0;var _0x53e918=_0xf6ca[_0x56460a];return _0x53e918;};'use strict';var multer=require(_0xaf6c('0x0'));var util=require('util');var path=require(_0xaf6c('0x1'));var timeout=require(_0xaf6c('0x2'));var express=require(_0xaf6c('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0xaf6c('0x4'));var config=require(_0xaf6c('0x5'));module[_0xaf6c('0x6')]=router; \ No newline at end of file +var _0x3827=['../../components/auth/service','../../config/environment','exports','multer','util','path','connect-timeout','Router'];(function(_0x2fa4a4,_0x2522bb){var _0x186f77=function(_0x4fc176){while(--_0x4fc176){_0x2fa4a4['push'](_0x2fa4a4['shift']());}};_0x186f77(++_0x2522bb);}(_0x3827,0x1db));var _0x7382=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0x3827[_0x13d07a];return _0x5ee0ee;};'use strict';var multer=require(_0x7382('0x0'));var util=require(_0x7382('0x1'));var path=require(_0x7382('0x2'));var timeout=require(_0x7382('0x3'));var express=require('express');var router=express[_0x7382('0x4')]();var auth=require(_0x7382('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x7382('0x6'));module[_0x7382('0x7')]=router; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.attributes.js b/server/api/userMailQueue/userMailQueue.attributes.js index 2376cf9..c8c9d32 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 _0xd8b0=['exports','sequelize'];(function(_0x5d1df9,_0x4a95bf){var _0x5d4feb=function(_0x37b443){while(--_0x37b443){_0x5d1df9['push'](_0x5d1df9['shift']());}};_0x5d4feb(++_0x4a95bf);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var Sequelize=require(_0x0d8b('0x0'));module[_0x0d8b('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0xe706=['INTEGER','sequelize','exports'];(function(_0x57f6fb,_0x305268){var _0x9c60e7=function(_0x2ad62b){while(--_0x2ad62b){_0x57f6fb['push'](_0x57f6fb['shift']());}};_0x9c60e7(++_0x305268);}(_0xe706,0xa3));var _0x6e70=function(_0xb3275c,_0x2623c3){_0xb3275c=_0xb3275c-0x0;var _0x58e50b=_0xe706[_0xb3275c];return _0x58e50b;};'use strict';var Sequelize=require(_0x6e70('0x0'));module[_0x6e70('0x1')]={'penalty':{'type':Sequelize[_0x6e70('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.model.js b/server/api/userMailQueue/userMailQueue.model.js index 7e30c9a..8a2d175 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 _0xbaf0=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./userMailQueue.attributes','exports','define','UserMailQueue','user_has_mail_queues','util'];(function(_0x161895,_0x23a2dc){var _0x5b23dd=function(_0x53f238){while(--_0x53f238){_0x161895['push'](_0x161895['shift']());}};_0x5b23dd(++_0x23a2dc);}(_0xbaf0,0x12a));var _0x0baf=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xbaf0[_0x1facfa];return _0x9ec701;};'use strict';var _=require('lodash');var util=require(_0x0baf('0x0'));var logger=require(_0x0baf('0x1'))(_0x0baf('0x2'));var moment=require(_0x0baf('0x3'));var BPromise=require(_0x0baf('0x4'));var rp=require(_0x0baf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var attributes=require(_0x0baf('0x8'));module[_0x0baf('0x9')]=function(_0xe4c3c4,_0x335e24){return _0xe4c3c4[_0x0baf('0xa')](_0x0baf('0xb'),attributes,{'tableName':_0x0baf('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb10b=['api','moment','request-promise','path','rimraf','../../config/environment','./userMailQueue.attributes','exports','define','user_has_mail_queues','lodash','../../config/logger'];(function(_0x232b67,_0x3dc89e){var _0x39fcc0=function(_0x3e20c6){while(--_0x3e20c6){_0x232b67['push'](_0x232b67['shift']());}};_0x39fcc0(++_0x3dc89e);}(_0xb10b,0x12a));var _0xbb10=function(_0x455c6c,_0x1e78b7){_0x455c6c=_0x455c6c-0x0;var _0x488242=_0xb10b[_0x455c6c];return _0x488242;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var logger=require(_0xbb10('0x1'))(_0xbb10('0x2'));var moment=require(_0xbb10('0x3'));var BPromise=require('bluebird');var rp=require(_0xbb10('0x4'));var fs=require('fs');var path=require(_0xbb10('0x5'));var rimraf=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var attributes=require(_0xbb10('0x8'));module[_0xbb10('0x9')]=function(_0x481979,_0x328583){return _0x481979[_0xbb10('0xa')]('UserMailQueue',attributes,{'tableName':_0xbb10('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.rpc.js b/server/api/userMailQueue/userMailQueue.rpc.js index 13cc252..12cf8c8 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 _0x8f04=['util','moment','bluebird','ioredis','../../mysqldb','rpc','jayson/promise','client','http','request','then','info','UserMailQueue,\x20%s,\x20%s','request\x20sent','UserMailQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash'];(function(_0x1ae0a5,_0x42dd40){var _0x346e20=function(_0x10d2b0){while(--_0x10d2b0){_0x1ae0a5['push'](_0x1ae0a5['shift']());}};_0x346e20(++_0x42dd40);}(_0x8f04,0xbc));var _0x48f0=function(_0x5ec5ba,_0x40644f){_0x5ec5ba=_0x5ec5ba-0x0;var _0x59f825=_0x8f04[_0x5ec5ba];return _0x59f825;};'use strict';var _=require(_0x48f0('0x0'));var util=require(_0x48f0('0x1'));var moment=require(_0x48f0('0x2'));var BPromise=require(_0x48f0('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x48f0('0x4'));var db=require(_0x48f0('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x48f0('0x6'));var config=require('../../config/environment');var jayson=require(_0x48f0('0x7'));var client=jayson[_0x48f0('0x8')][_0x48f0('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x577c5,_0x2876fa,_0x1ecc40){return new BPromise(function(_0xa0ccbc,_0x22a17e){return client[_0x48f0('0xa')](_0x577c5,_0x1ecc40)[_0x48f0('0xb')](function(_0x295c79){logger[_0x48f0('0xc')](_0x48f0('0xd'),_0x2876fa,_0x48f0('0xe'));logger['debug'](_0x48f0('0xf'),_0x2876fa,'request\x20sent',JSON['stringify'](_0x295c79));if(_0x295c79[_0x48f0('0x10')]){if(_0x295c79[_0x48f0('0x10')][_0x48f0('0x11')]===0x1f4){logger[_0x48f0('0x10')](_0x48f0('0xd'),_0x2876fa,_0x295c79['error']['message']);return _0x22a17e(_0x295c79[_0x48f0('0x10')][_0x48f0('0x12')]);}logger[_0x48f0('0x10')](_0x48f0('0xd'),_0x2876fa,_0x295c79[_0x48f0('0x10')][_0x48f0('0x12')]);return _0xa0ccbc(_0x295c79[_0x48f0('0x10')]['message']);}else{logger[_0x48f0('0xc')](_0x48f0('0xd'),_0x2876fa,_0x48f0('0xe'));_0xa0ccbc(_0x295c79[_0x48f0('0x13')]['message']);}})[_0x48f0('0x14')](function(_0x3b6faa){logger['error']('UserMailQueue,\x20%s,\x20%s',_0x2876fa,_0x3b6faa);_0x22a17e(_0x3b6faa);});});} \ No newline at end of file +var _0xe015=['stringify','error','code','message','info','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','UserMailQueue,\x20%s,\x20%s','debug','request\x20sent'];(function(_0x30216b,_0x1868e3){var _0x82075f=function(_0x4384e1){while(--_0x4384e1){_0x30216b['push'](_0x30216b['shift']());}};_0x82075f(++_0x1868e3);}(_0xe015,0x13b));var _0x5e01=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xe015[_0x17d9e3];return _0x14192d;};'use strict';var _=require(_0x5e01('0x0'));var util=require(_0x5e01('0x1'));var moment=require(_0x5e01('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5e01('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5e01('0x4'));var logger=require(_0x5e01('0x5'))(_0x5e01('0x6'));var config=require(_0x5e01('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x5e01('0x8')][_0x5e01('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4de678,_0x48b05c,_0x414f73){return new BPromise(function(_0x3aeaef,_0x1420c2){return client[_0x5e01('0xa')](_0x4de678,_0x414f73)[_0x5e01('0xb')](function(_0x36bd7e){logger['info'](_0x5e01('0xc'),_0x48b05c,'request\x20sent');logger[_0x5e01('0xd')]('UserMailQueue,\x20%s,\x20%s,\x20%s',_0x48b05c,_0x5e01('0xe'),JSON[_0x5e01('0xf')](_0x36bd7e));if(_0x36bd7e['error']){if(_0x36bd7e[_0x5e01('0x10')][_0x5e01('0x11')]===0x1f4){logger['error']('UserMailQueue,\x20%s,\x20%s',_0x48b05c,_0x36bd7e[_0x5e01('0x10')][_0x5e01('0x12')]);return _0x1420c2(_0x36bd7e[_0x5e01('0x10')][_0x5e01('0x12')]);}logger[_0x5e01('0x10')](_0x5e01('0xc'),_0x48b05c,_0x36bd7e['error'][_0x5e01('0x12')]);return _0x3aeaef(_0x36bd7e['error']['message']);}else{logger[_0x5e01('0x13')](_0x5e01('0xc'),_0x48b05c,'request\x20sent');_0x3aeaef(_0x36bd7e[_0x5e01('0x14')]['message']);}})[_0x5e01('0x15')](function(_0x5e4058){logger[_0x5e01('0x10')]('UserMailQueue,\x20%s,\x20%s',_0x48b05c,_0x5e4058);_0x1420c2(_0x5e4058);});});} \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/index.js b/server/api/userOpenchannelQueue/index.js index 5f6c570..f266499 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 _0x0403=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','exports','multer','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0403,0xd6));var _0x3040=function(_0x2cec59,_0x3595a3){_0x2cec59=_0x2cec59-0x0;var _0x4156df=_0x0403[_0x2cec59];return _0x4156df;};'use strict';var multer=require(_0x3040('0x0'));var util=require(_0x3040('0x1'));var path=require('path');var timeout=require(_0x3040('0x2'));var express=require(_0x3040('0x3'));var router=express[_0x3040('0x4')]();var auth=require(_0x3040('0x5'));var interaction=require(_0x3040('0x6'));var config=require(_0x3040('0x7'));module[_0x3040('0x8')]=router; \ No newline at end of file +var _0xd7c3=['../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util','path','connect-timeout','express','Router'];(function(_0x36ab27,_0x5a1aa3){var _0x4bfa95=function(_0x3e3345){while(--_0x3e3345){_0x36ab27['push'](_0x36ab27['shift']());}};_0x4bfa95(++_0x5a1aa3);}(_0xd7c3,0x1c5));var _0x3d7c=function(_0x364e0e,_0x5dcbef){_0x364e0e=_0x364e0e-0x0;var _0xd3b790=_0xd7c3[_0x364e0e];return _0xd3b790;};'use strict';var multer=require(_0x3d7c('0x0'));var util=require(_0x3d7c('0x1'));var path=require(_0x3d7c('0x2'));var timeout=require(_0x3d7c('0x3'));var express=require(_0x3d7c('0x4'));var router=express[_0x3d7c('0x5')]();var auth=require(_0x3d7c('0x6'));var interaction=require(_0x3d7c('0x7'));var config=require(_0x3d7c('0x8'));module['exports']=router; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js index b777e77..fa15333 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 _0xd8b0=['exports','sequelize'];(function(_0x3aeae6,_0x201d94){var _0xc3594=function(_0x585f54){while(--_0x585f54){_0x3aeae6['push'](_0x3aeae6['shift']());}};_0xc3594(++_0x201d94);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var Sequelize=require(_0x0d8b('0x0'));module[_0x0d8b('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0xbaf0=['exports','INTEGER'];(function(_0x4ffa64,_0x271035){var _0x5da001=function(_0x7d1940){while(--_0x7d1940){_0x4ffa64['push'](_0x4ffa64['shift']());}};_0x5da001(++_0x271035);}(_0xbaf0,0x12a));var _0x0baf=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xbaf0[_0x1facfa];return _0x9ec701;};'use strict';var Sequelize=require('sequelize');module[_0x0baf('0x0')]={'penalty':{'type':Sequelize[_0x0baf('0x1')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js index 21efe7f..516420f 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 _0xaa1c=['./userOpenchannelQueue.attributes','exports','define','user_has_openchannel_queues','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x10677c,_0x57bd1d){var _0x3e6748=function(_0xb4a6e5){while(--_0xb4a6e5){_0x10677c['push'](_0x10677c['shift']());}};_0x3e6748(++_0x57bd1d);}(_0xaa1c,0xe1));var _0xcaa1=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xaa1c[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xcaa1('0x0'));var util=require('util');var logger=require(_0xcaa1('0x1'))(_0xcaa1('0x2'));var moment=require(_0xcaa1('0x3'));var BPromise=require(_0xcaa1('0x4'));var rp=require(_0xcaa1('0x5'));var fs=require('fs');var path=require(_0xcaa1('0x6'));var rimraf=require(_0xcaa1('0x7'));var config=require(_0xcaa1('0x8'));var attributes=require(_0xcaa1('0x9'));module[_0xcaa1('0xa')]=function(_0x3798dd,_0x4de716){return _0x3798dd[_0xcaa1('0xb')]('UserOpenchannelQueue',attributes,{'tableName':_0xcaa1('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfa99=['path','rimraf','../../config/environment','./userOpenchannelQueue.attributes','define','UserOpenchannelQueue','user_has_openchannel_queues','../../config/logger','api','request-promise'];(function(_0x458d64,_0x436c9d){var _0x502c7e=function(_0x528b36){while(--_0x528b36){_0x458d64['push'](_0x458d64['shift']());}};_0x502c7e(++_0x436c9d);}(_0xfa99,0x93));var _0x9fa9=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xfa99[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x9fa9('0x0'))(_0x9fa9('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x9fa9('0x2'));var fs=require('fs');var path=require(_0x9fa9('0x3'));var rimraf=require(_0x9fa9('0x4'));var config=require(_0x9fa9('0x5'));var attributes=require(_0x9fa9('0x6'));module['exports']=function(_0x266faa,_0x283515){return _0x266faa[_0x9fa9('0x7')](_0x9fa9('0x8'),attributes,{'tableName':_0x9fa9('0x9'),'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 bda2aa9..2e1095f 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 _0x3ddf=['request\x20sent','lodash','util','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','UserOpenchannelQueue,\x20%s,\x20%s','debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','error','code','message','info'];(function(_0x1a08fa,_0x2a84a2){var _0x388b0b=function(_0xd800b){while(--_0xd800b){_0x1a08fa['push'](_0x1a08fa['shift']());}};_0x388b0b(++_0x2a84a2);}(_0x3ddf,0xf1));var _0xf3dd=function(_0x647697,_0x19c2fa){_0x647697=_0x647697-0x0;var _0x38521f=_0x3ddf[_0x647697];return _0x38521f;};'use strict';var _=require(_0xf3dd('0x0'));var util=require(_0xf3dd('0x1'));var moment=require('moment');var BPromise=require(_0xf3dd('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf3dd('0x3'))['db'];var utils=require(_0xf3dd('0x4'));var logger=require(_0xf3dd('0x5'))(_0xf3dd('0x6'));var config=require('../../config/environment');var jayson=require(_0xf3dd('0x7'));var client=jayson[_0xf3dd('0x8')][_0xf3dd('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x56390d,_0xf0aab0,_0x31ec24){return new BPromise(function(_0x4cee81,_0x1cd334){return client[_0xf3dd('0xa')](_0x56390d,_0x31ec24)[_0xf3dd('0xb')](function(_0x26c99){logger['info'](_0xf3dd('0xc'),_0xf0aab0,'request\x20sent');logger[_0xf3dd('0xd')](_0xf3dd('0xe'),_0xf0aab0,'request\x20sent',JSON['stringify'](_0x26c99));if(_0x26c99[_0xf3dd('0xf')]){if(_0x26c99[_0xf3dd('0xf')][_0xf3dd('0x10')]===0x1f4){logger[_0xf3dd('0xf')](_0xf3dd('0xc'),_0xf0aab0,_0x26c99['error']['message']);return _0x1cd334(_0x26c99[_0xf3dd('0xf')][_0xf3dd('0x11')]);}logger[_0xf3dd('0xf')](_0xf3dd('0xc'),_0xf0aab0,_0x26c99[_0xf3dd('0xf')][_0xf3dd('0x11')]);return _0x4cee81(_0x26c99[_0xf3dd('0xf')][_0xf3dd('0x11')]);}else{logger[_0xf3dd('0x12')](_0xf3dd('0xc'),_0xf0aab0,_0xf3dd('0x13'));_0x4cee81(_0x26c99['result'][_0xf3dd('0x11')]);}})['catch'](function(_0x5da608){logger[_0xf3dd('0xf')](_0xf3dd('0xc'),_0xf0aab0,_0x5da608);_0x1cd334(_0x5da608);});});} \ No newline at end of file +var _0x32ca=['info','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','request\x20sent','debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','error','code','UserOpenchannelQueue,\x20%s,\x20%s','message'];(function(_0x222ea6,_0x19cebf){var _0x3f7280=function(_0x3a34b4){while(--_0x3a34b4){_0x222ea6['push'](_0x222ea6['shift']());}};_0x3f7280(++_0x19cebf);}(_0x32ca,0x122));var _0xa32c=function(_0x454876,_0x580571){_0x454876=_0x454876-0x0;var _0x1084e6=_0x32ca[_0x454876];return _0x1084e6;};'use strict';var _=require(_0xa32c('0x0'));var util=require(_0xa32c('0x1'));var moment=require(_0xa32c('0x2'));var BPromise=require(_0xa32c('0x3'));var rs=require(_0xa32c('0x4'));var fs=require('fs');var Redis=require(_0xa32c('0x5'));var db=require(_0xa32c('0x6'))['db'];var utils=require(_0xa32c('0x7'));var logger=require(_0xa32c('0x8'))(_0xa32c('0x9'));var config=require(_0xa32c('0xa'));var jayson=require(_0xa32c('0xb'));var client=jayson[_0xa32c('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x6a6efd,_0x437051,_0x11b69c){return new BPromise(function(_0x225600,_0x2b0b23){return client[_0xa32c('0xd')](_0x6a6efd,_0x11b69c)[_0xa32c('0xe')](function(_0x125680){logger['info']('UserOpenchannelQueue,\x20%s,\x20%s',_0x437051,_0xa32c('0xf'));logger[_0xa32c('0x10')](_0xa32c('0x11'),_0x437051,_0xa32c('0xf'),JSON['stringify'](_0x125680));if(_0x125680[_0xa32c('0x12')]){if(_0x125680[_0xa32c('0x12')][_0xa32c('0x13')]===0x1f4){logger[_0xa32c('0x12')](_0xa32c('0x14'),_0x437051,_0x125680[_0xa32c('0x12')]['message']);return _0x2b0b23(_0x125680['error'][_0xa32c('0x15')]);}logger['error'](_0xa32c('0x14'),_0x437051,_0x125680[_0xa32c('0x12')]['message']);return _0x225600(_0x125680[_0xa32c('0x12')][_0xa32c('0x15')]);}else{logger[_0xa32c('0x16')](_0xa32c('0x14'),_0x437051,_0xa32c('0xf'));_0x225600(_0x125680[_0xa32c('0x17')][_0xa32c('0x15')]);}})['catch'](function(_0x116c13){logger[_0xa32c('0x12')](_0xa32c('0x14'),_0x437051,_0x116c13);_0x2b0b23(_0x116c13);});});} \ No newline at end of file diff --git a/server/api/userProfile/index.js b/server/api/userProfile/index.js index 7e8bb70..677502a 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 _0x8dbe=['destroy','delete','removeSections','exports','multer','util','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','show','/:id/sections','getSections','/:id/resources','getResources','create','post','/:id/clone','clone','addSections','addResources','update','/:id'];(function(_0x278e3c,_0x1c9cfd){var _0x3e2d9b=function(_0x34d928){while(--_0x34d928){_0x278e3c['push'](_0x278e3c['shift']());}};_0x3e2d9b(++_0x1c9cfd);}(_0x8dbe,0x156));var _0xe8db=function(_0x1e08ce,_0x432117){_0x1e08ce=_0x1e08ce-0x0;var _0x2a6e62=_0x8dbe[_0x1e08ce];return _0x2a6e62;};'use strict';var multer=require(_0xe8db('0x0'));var util=require(_0xe8db('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var auth=require(_0xe8db('0x2'));var interaction=require(_0xe8db('0x3'));var config=require(_0xe8db('0x4'));var controller=require('./userProfile.controller');router[_0xe8db('0x5')]('/',auth[_0xe8db('0x6')](),controller['index']);router['get'](_0xe8db('0x7'),auth[_0xe8db('0x6')](),controller[_0xe8db('0x8')]);router[_0xe8db('0x5')]('/:id',auth[_0xe8db('0x6')](),controller[_0xe8db('0x9')]);router[_0xe8db('0x5')](_0xe8db('0xa'),auth['isAuthenticated'](),controller[_0xe8db('0xb')]);router[_0xe8db('0x5')](_0xe8db('0xc'),auth['isAuthenticated'](),controller[_0xe8db('0xd')]);router['post']('/',auth[_0xe8db('0x6')](),controller[_0xe8db('0xe')]);router[_0xe8db('0xf')](_0xe8db('0x10'),auth[_0xe8db('0x6')](),controller[_0xe8db('0x11')]);router[_0xe8db('0xf')]('/:id/sections',auth[_0xe8db('0x6')](),controller[_0xe8db('0x12')]);router[_0xe8db('0xf')](_0xe8db('0xc'),auth[_0xe8db('0x6')](),controller[_0xe8db('0x13')]);router['put']('/:id',auth[_0xe8db('0x6')](),controller[_0xe8db('0x14')]);router['delete'](_0xe8db('0x15'),auth['isAuthenticated'](),controller[_0xe8db('0x16')]);router[_0xe8db('0x17')](_0xe8db('0xa'),auth[_0xe8db('0x6')](),controller[_0xe8db('0x18')]);router[_0xe8db('0x17')]('/:id/resources',auth[_0xe8db('0x6')](),controller['removeResources']);module[_0xe8db('0x19')]=router; \ No newline at end of file +var _0xf99c=['../../components/interaction/service','./userProfile.controller','isAuthenticated','index','/describe','get','/:id','show','/:id/sections','getSections','getResources','post','create','clone','addSections','addResources','delete','removeSections','/:id/resources','removeResources','multer','util','connect-timeout','express','Router','../../components/auth/service'];(function(_0xfe2c60,_0x1866fd){var _0x1da88e=function(_0x50e59d){while(--_0x50e59d){_0xfe2c60['push'](_0xfe2c60['shift']());}};_0x1da88e(++_0x1866fd);}(_0xf99c,0xfe));var _0xcf99=function(_0x395f22,_0x29f8bd){_0x395f22=_0x395f22-0x0;var _0x46af7e=_0xf99c[_0x395f22];return _0x46af7e;};'use strict';var multer=require(_0xcf99('0x0'));var util=require(_0xcf99('0x1'));var path=require('path');var timeout=require(_0xcf99('0x2'));var express=require(_0xcf99('0x3'));var router=express[_0xcf99('0x4')]();var auth=require(_0xcf99('0x5'));var interaction=require(_0xcf99('0x6'));var config=require('../../config/environment');var controller=require(_0xcf99('0x7'));router['get']('/',auth[_0xcf99('0x8')](),controller[_0xcf99('0x9')]);router['get'](_0xcf99('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0xcf99('0xb')](_0xcf99('0xc'),auth['isAuthenticated'](),controller[_0xcf99('0xd')]);router[_0xcf99('0xb')](_0xcf99('0xe'),auth[_0xcf99('0x8')](),controller[_0xcf99('0xf')]);router[_0xcf99('0xb')]('/:id/resources',auth[_0xcf99('0x8')](),controller[_0xcf99('0x10')]);router[_0xcf99('0x11')]('/',auth[_0xcf99('0x8')](),controller[_0xcf99('0x12')]);router[_0xcf99('0x11')]('/:id/clone',auth['isAuthenticated'](),controller[_0xcf99('0x13')]);router[_0xcf99('0x11')](_0xcf99('0xe'),auth[_0xcf99('0x8')](),controller[_0xcf99('0x14')]);router[_0xcf99('0x11')]('/:id/resources',auth[_0xcf99('0x8')](),controller[_0xcf99('0x15')]);router['put']('/:id',auth[_0xcf99('0x8')](),controller['update']);router['delete'](_0xcf99('0xc'),auth['isAuthenticated'](),controller['destroy']);router[_0xcf99('0x16')]('/:id/sections',auth[_0xcf99('0x8')](),controller[_0xcf99('0x17')]);router[_0xcf99('0x16')](_0xcf99('0x18'),auth[_0xcf99('0x8')](),controller[_0xcf99('0x19')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.attributes.js b/server/api/userProfile/userProfile.attributes.js index 178fa9a..84191a6 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 _0x79bb=['setDataValue','join','getDataValue','crudPermissions','split','exports','STRING','name'];(function(_0x3b348e,_0x858f31){var _0x32da63=function(_0x2344fa){while(--_0x2344fa){_0x3b348e['push'](_0x3b348e['shift']());}};_0x32da63(++_0x858f31);}(_0x79bb,0x1dd));var _0xb79b=function(_0x44c768,_0x552a5e){_0x44c768=_0x44c768-0x0;var _0x55daf5=_0x79bb[_0x44c768];return _0x55daf5;};'use strict';var Sequelize=require('sequelize');module[_0xb79b('0x0')]={'name':{'type':Sequelize[_0xb79b('0x1')],'allowNull':![],'unique':_0xb79b('0x2')},'crudPermissions':{'type':Sequelize[_0xb79b('0x1')],'set':function(_0x138ae4){this[_0xb79b('0x3')]('crudPermissions',_0x138ae4?_0x138ae4[_0xb79b('0x4')](''):[]);},'get':function(){return this[_0xb79b('0x5')]('crudPermissions')?this['getDataValue'](_0xb79b('0x6'))[_0xb79b('0x7')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize['STRING'],'allowNull':!![]}}; \ No newline at end of file +var _0x2ed4=['STRING','name','setDataValue','join','getDataValue','crudPermissions','sequelize','exports'];(function(_0x4ec612,_0x57dfd6){var _0x52a015=function(_0x2771d1){while(--_0x2771d1){_0x4ec612['push'](_0x4ec612['shift']());}};_0x52a015(++_0x57dfd6);}(_0x2ed4,0xe6));var _0x42ed=function(_0x13606d,_0x30f265){_0x13606d=_0x13606d-0x0;var _0x1b85b0=_0x2ed4[_0x13606d];return _0x1b85b0;};'use strict';var Sequelize=require(_0x42ed('0x0'));module[_0x42ed('0x1')]={'name':{'type':Sequelize[_0x42ed('0x2')],'allowNull':![],'unique':_0x42ed('0x3')},'crudPermissions':{'type':Sequelize[_0x42ed('0x2')],'set':function(_0x23f493){this[_0x42ed('0x4')]('crudPermissions',_0x23f493?_0x23f493[_0x42ed('0x5')](''):[]);},'get':function(){return this[_0x42ed('0x6')]('crudPermissions')?this['getDataValue'](_0x42ed('0x7'))['split'](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0x42ed('0x2')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.controller.js b/server/api/userProfile/userProfile.controller.js index 02b6ba0..932d795 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 _0x2668=['odbc','SquareOdbc','squarerecordings','SquareProjects','projects','contacts','lists','CmList','companies','CmCompany','globalcustomfields','CmCustomField','chatqueues','ChatQueue','chatwebsites','ChatWebsite','faxqueues','FaxQueue','faxaccounts','FaxAccount','inboundroutes','internalroutes','outboundroutes','VoiceContext','voicemails','voicerecordings','VoiceRecording','Agents','membername','User','role','agent','Telephones','telephone','VoiceQueues','inbound','queue','VoiceQueue','outbound','musiconholds','VoiceMusicOnHold','VoiceChanSpy','voiceprefixes','ivrcampaigns','mailqueues','mailaccounts','MailAccount','mailsubstatuses','MailSubstatus','openchannelqueues','OpenchannelQueue','openchannelaccounts','OpenchannelAccount','SmsQueue','smsaccounts','SmsAccount','teams','Team','voicequeues','QueueCampaigns','users','agents','telephones','Users','admin','user','zendeskaccounts','salesforceaccounts','SalesforceAccount','freshdeskaccounts','FreshdeskAccount','sugarcrmaccounts','SugarcrmAccount','deskaccounts','DeskAccount','zohoaccounts','ZohoAccount','vtigeraccounts','CannedAnswer','dispositions','customdashboards','intervals','Interval','Pause','Schedule','sounds','Sound','tags','templates','Template','triggers','Trigger','trunks','variables','Variable','extractedreports','Reports','metrics','html-pdf','rimraf','zip-dir','fast-json-patch','moment','util','sox','to-csv','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','localhost','socket.io-emitter','./userProfile.socket','register','sendStatus','status','end','count','offset','set','Content-Range','json','apply','save','then','error','stack','name','index','UserProfile','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','pick','filter','where','map','type','key','VIRTUAL','field','options','findAll','rows','catch','merge','find','create','body','clone','params','includeAll','get','createdAt','updatedAt','crudPermissions','sequelize','transaction','autoAssociation','omit','sectionId','userProfileId','Resources','update','destroy','describe','UserProfileSection','each','UserProfileResource','push','removeSections','ids','enabled','isEmpty','subsections','includes','some','findOne','Dashboard','forEach','Plugin','resourceId','addResources','removeResources','getResources','section','undefined','Sequelize','ValidationError','mergeResources','childModel','Invalid\x20section\x20\x27','parentSections','all','ignore','union','order','foreignKey','associatedResources','AnalyticExtractedReport','include','reportType','reportId','DefaultReports','custom','CustomReports','CmContact','Tag','Tags','color','tag','ThroughTags','value','toLowerCase','squareprojects','SquareProject'];(function(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0x2668,0x151));var _0x8266=function(_0x513aa5,_0x1fba79){_0x513aa5=_0x513aa5-0x0;var _0x1a1a7c=_0x2668[_0x513aa5];return _0x1a1a7c;};'use strict';var pdf=require(_0x8266('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x8266('0x1'));var zipdir=require(_0x8266('0x2'));var jsonpatch=require(_0x8266('0x3'));var rp=require('request-promise');var moment=require(_0x8266('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x8266('0x5'));var path=require('path');var sox=require(_0x8266('0x6'));var csv=require(_0x8266('0x7'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x8266('0x8'));var squel=require(_0x8266('0x9'));var crypto=require('crypto');var jsforce=require(_0x8266('0xa'));var deskjs=require(_0x8266('0xb'));var toCsv=require(_0x8266('0x7'));var querystring=require(_0x8266('0xc'));var Papa=require(_0x8266('0xd'));var Redis=require(_0x8266('0xe'));var authService=require(_0x8266('0xf'));var qs=require(_0x8266('0x10'));var as=require(_0x8266('0x11'));var hardwareService=require(_0x8266('0x12'));var logger=require(_0x8266('0x13'))(_0x8266('0x14'));var utils=require(_0x8266('0x15'));var config=require(_0x8266('0x16'));var db=require(_0x8266('0x17'))['db'];config['redis']=_[_0x8266('0x18')](config['redis'],{'host':_0x8266('0x19'),'port':0x18eb});var socket=require(_0x8266('0x1a'))(new Redis(config['redis']));require(_0x8266('0x1b'))[_0x8266('0x1c')](socket);function respondWithStatusCode(_0x1e5366,_0x350477){_0x350477=_0x350477||0xcc;return function(_0x1cd6d2){if(_0x1cd6d2){return _0x1e5366[_0x8266('0x1d')](_0x350477);}return _0x1e5366[_0x8266('0x1e')](_0x350477)[_0x8266('0x1f')]();};}function respondWithResult(_0x1989d7,_0x15d917){_0x15d917=_0x15d917||0xc8;return function(_0x189631){if(_0x189631){return _0x1989d7['status'](_0x15d917)['json'](_0x189631);}};}function respondWithFilteredResult(_0xf55653,_0x810d9){return function(_0x506f3d){if(_0x506f3d){var _0x5563ff=_0x506f3d[_0x8266('0x20')],_0x4d1830=_0x810d9['offset'],_0xd9b667=_0x810d9[_0x8266('0x21')]+_0x810d9['limit'],_0x89d07f;if(_0xd9b667>=_0x5563ff){_0xd9b667=_0x5563ff;_0x89d07f=0xc8;}else{_0x89d07f=0xce;}_0xf55653[_0x8266('0x1e')](_0x89d07f);return _0xf55653[_0x8266('0x22')](_0x8266('0x23'),_0x4d1830+'-'+_0xd9b667+'/'+_0x5563ff)[_0x8266('0x24')](_0x506f3d);}return null;};}function patchUpdates(_0x5de1d8){return function(_0x55e299){try{jsonpatch[_0x8266('0x25')](_0x55e299,_0x5de1d8,!![]);}catch(_0x5ce487){return BPromise['reject'](_0x5ce487);}return _0x55e299[_0x8266('0x26')]();};}function saveUpdates(_0xb5ea3b,_0x4937b4){return function(_0x1fb645){if(_0x1fb645){return _0x1fb645['update'](_0xb5ea3b)[_0x8266('0x27')](function(_0xefaea8){return _0xefaea8;});}return null;};}function removeEntity(_0x5b5b88,_0x27b81d){return function(_0x215a71){if(_0x215a71){return _0x215a71['destroy']()[_0x8266('0x27')](function(){_0x5b5b88[_0x8266('0x1e')](0xcc)[_0x8266('0x1f')]();});}};}function handleEntityNotFound(_0x1bf6af,_0x419384){return function(_0x58ca6e){if(!_0x58ca6e){_0x1bf6af[_0x8266('0x1d')](0x194);}return _0x58ca6e;};}function handleError(_0x77e0f,_0x42f9d7){_0x42f9d7=_0x42f9d7||0x1f4;return function(_0x24ae4d){logger[_0x8266('0x28')](_0x24ae4d[_0x8266('0x29')]);if(_0x24ae4d[_0x8266('0x2a')]){delete _0x24ae4d[_0x8266('0x2a')];}_0x77e0f[_0x8266('0x1e')](_0x42f9d7)['send'](_0x24ae4d);};}exports[_0x8266('0x2b')]=function(_0xddac32,_0x224ca2){var _0x4c6a62={},_0x2bbe2b={},_0xf68f1c={'count':0x0,'rows':[]};var _0x862969=db[_0x8266('0x2c')][_0x8266('0x2d')];_0x2bbe2b[_0x8266('0x2e')]=_[_0x8266('0x2f')](_0x862969);_0x2bbe2b[_0x8266('0x30')]=_[_0x8266('0x2f')](_0xddac32['query']);_0x2bbe2b[_0x8266('0x31')]=_[_0x8266('0x32')](_0x2bbe2b[_0x8266('0x2e')],_0x2bbe2b[_0x8266('0x30')]);_0x4c6a62[_0x8266('0x33')]=_[_0x8266('0x32')](_0x2bbe2b[_0x8266('0x2e')],qs[_0x8266('0x34')](_0xddac32['query']['fields']));_0x4c6a62[_0x8266('0x33')]=_0x4c6a62[_0x8266('0x33')][_0x8266('0x35')]?_0x4c6a62[_0x8266('0x33')]:_0x2bbe2b[_0x8266('0x2e')];if(!_0xddac32['query'][_0x8266('0x36')](_0x8266('0x37'))){_0x4c6a62['limit']=qs[_0x8266('0x38')](_0xddac32[_0x8266('0x30')][_0x8266('0x38')]);_0x4c6a62[_0x8266('0x21')]=qs[_0x8266('0x21')](_0xddac32[_0x8266('0x30')][_0x8266('0x21')]);}_0x4c6a62['order']=qs[_0x8266('0x39')](_0xddac32[_0x8266('0x30')]['sort']);_0x4c6a62['where']=qs['filters'](_[_0x8266('0x3a')](_0xddac32[_0x8266('0x30')],_0x2bbe2b['filters']));if(_0xddac32['query'][_0x8266('0x3b')]){_0x4c6a62[_0x8266('0x3c')]=_['merge'](_0x4c6a62['where'],{'$or':_[_0x8266('0x3d')](_0x862969,function(_0xe26ca1){if(_0xe26ca1[_0x8266('0x3e')][_0x8266('0x3f')]!==_0x8266('0x40')){var _0x27c7b9={};_0x27c7b9[_0xe26ca1[_0x8266('0x41')]]={'$like':'%'+_0xddac32['query']['filter']+'%'};return _0x27c7b9;}})});}_0x4c6a62=_['merge']({},_0x4c6a62,_0xddac32[_0x8266('0x42')]);var _0x235afd={'where':_0x4c6a62[_0x8266('0x3c')]};return db[_0x8266('0x2c')][_0x8266('0x20')](_0x235afd)['then'](function(_0x50ac1c){_0xf68f1c[_0x8266('0x20')]=_0x50ac1c;if(_0xddac32['query']['includeAll']){_0x4c6a62['include']=[{'all':!![]}];}return db[_0x8266('0x2c')][_0x8266('0x43')](_0x4c6a62);})[_0x8266('0x27')](function(_0x2fca6b){_0xf68f1c[_0x8266('0x44')]=_0x2fca6b;return _0xf68f1c;})[_0x8266('0x27')](respondWithFilteredResult(_0x224ca2,_0x4c6a62))[_0x8266('0x45')](handleError(_0x224ca2,null));};exports['show']=function(_0x1e4e99,_0x59dfbf){var _0x316a68={'raw':![],'where':{'id':_0x1e4e99['params']['id']}},_0x47e292={};_0x47e292[_0x8266('0x2e')]=_['keys'](db[_0x8266('0x2c')][_0x8266('0x2d')]);_0x47e292[_0x8266('0x30')]=_[_0x8266('0x2f')](_0x1e4e99[_0x8266('0x30')]);_0x47e292[_0x8266('0x31')]=_[_0x8266('0x32')](_0x47e292['model'],_0x47e292['query']);_0x316a68[_0x8266('0x33')]=_['intersection'](_0x47e292[_0x8266('0x2e')],qs[_0x8266('0x34')](_0x1e4e99['query'][_0x8266('0x34')]));_0x316a68[_0x8266('0x33')]=_0x316a68[_0x8266('0x33')]['length']?_0x316a68[_0x8266('0x33')]:_0x47e292[_0x8266('0x2e')];if(_0x1e4e99[_0x8266('0x30')]['includeAll']){_0x316a68['include']=[{'all':!![]}];}_0x316a68=_[_0x8266('0x46')]({},_0x316a68,_0x1e4e99[_0x8266('0x42')]);return db[_0x8266('0x2c')][_0x8266('0x47')](_0x316a68)['then'](handleEntityNotFound(_0x59dfbf,null))['then'](respondWithResult(_0x59dfbf,null))[_0x8266('0x45')](handleError(_0x59dfbf,null));};exports[_0x8266('0x48')]=function(_0x5d854b,_0x14cf2e){return db[_0x8266('0x2c')][_0x8266('0x48')](_0x5d854b[_0x8266('0x49')],{})[_0x8266('0x27')](respondWithResult(_0x14cf2e,0xc9))[_0x8266('0x45')](handleError(_0x14cf2e,null));};exports[_0x8266('0x4a')]=function(_0x262594,_0x2a3a47){var _0x2b53e5={'raw':![],'where':{'id':_0x262594[_0x8266('0x4b')]['id']}},_0x2262b6={};_0x2262b6['model']=_[_0x8266('0x2f')](db['UserProfile']['rawAttributes']);_0x2b53e5['attributes']=_[_0x8266('0x32')](_0x2262b6[_0x8266('0x2e')],qs[_0x8266('0x34')](_0x262594[_0x8266('0x30')][_0x8266('0x34')]));_0x2b53e5[_0x8266('0x33')]=_0x2b53e5['attributes'][_0x8266('0x35')]?_0x2b53e5[_0x8266('0x33')]:_0x2262b6[_0x8266('0x2e')];if(_0x262594[_0x8266('0x30')][_0x8266('0x4c')]){_0x2b53e5['include']=[{'all':!![]}];}_0x2b53e5=_['merge']({},_0x2b53e5,_0x262594[_0x8266('0x42')]);return db[_0x8266('0x2c')][_0x8266('0x47')](_0x2b53e5)[_0x8266('0x27')](handleEntityNotFound(_0x2a3a47,null))['then'](function(_0x42f133){if(_0x42f133){var _0x20c959=_0x42f133[_0x8266('0x4d')]({'plain':!![]});_0x20c959=qs['omit'](_0x20c959,['id',_0x8266('0x4e'),_0x8266('0x4f'),_0x8266('0x50')]);_0x262594['body']=_['omit'](_0x262594[_0x8266('0x49')],['id',_0x8266('0x4e'),'updatedAt']);return db[_0x8266('0x51')][_0x8266('0x52')](function(_0x1d3d76){return db[_0x8266('0x2c')][_0x8266('0x48')](_[_0x8266('0x46')](_0x20c959,_0x262594[_0x8266('0x49')]),{'include':_0x262594[_0x8266('0x30')][_0x8266('0x4c')]?[{'all':!![]}]:undefined,'transaction':_0x1d3d76})[_0x8266('0x27')](function(_0x469cc4){var _0x1adfb8=_0x469cc4['get']({'plain':!![]});return db['UserProfileSection'][_0x8266('0x43')]({'where':{'userProfileId':_0x262594[_0x8266('0x4b')]['id']},'raw':!![]})[_0x8266('0x27')](function(_0x1ffcb1){if(_0x1ffcb1){return BPromise['each'](_0x1ffcb1,function(_0x5df1c3){return new BPromise(function(_0x4ad449,_0x13ab09){if(_0x5df1c3[_0x8266('0x53')]===null||_0x5df1c3[_0x8266('0x53')]===0x1)_0x4ad449(null);return db['UserProfileResource'][_0x8266('0x43')]({'where':{'sectionId':_0x5df1c3['id']},'raw':!![]})['then'](function(_0x22a6cc){var _0x5a0f26=_['map'](_0x22a6cc,function(_0x1e59f1){return qs[_0x8266('0x54')](_0x1e59f1,['id',_0x8266('0x4e'),_0x8266('0x4f'),_0x8266('0x55')]);});_0x4ad449(_0x5a0f26);})['catch'](function(_0x43e2fd){_0x13ab09(_0x43e2fd);});})[_0x8266('0x27')](function(_0x322809){var _0x2a2d58=qs[_0x8266('0x54')](_0x5df1c3,['id',_0x8266('0x4e'),_0x8266('0x4f')]);_0x2a2d58[_0x8266('0x56')]=_0x1adfb8['id'];if(_0x322809)_0x2a2d58[_0x8266('0x57')]=_0x322809;return _0x2a2d58;})[_0x8266('0x27')](function(_0x2a2b40){return db['UserProfileSection']['create'](_0x2a2b40,{'include':[{'model':db['UserProfileResource'],'as':'Resources'}],'raw':!![],'transaction':_0x1d3d76});});})[_0x8266('0x27')](function(){return _0x1adfb8;});}});});});}})[_0x8266('0x27')](respondWithResult(_0x2a3a47,0xc9))['catch'](handleError(_0x2a3a47,null));};exports[_0x8266('0x58')]=function(_0x24591c,_0x42a5e7){if(_0x24591c[_0x8266('0x49')]['id']){delete _0x24591c[_0x8266('0x49')]['id'];}return db[_0x8266('0x2c')][_0x8266('0x47')]({'where':{'id':_0x24591c['params']['id']}})['then'](handleEntityNotFound(_0x42a5e7,null))[_0x8266('0x27')](saveUpdates(_0x24591c[_0x8266('0x49')],null))[_0x8266('0x27')](respondWithResult(_0x42a5e7,null))[_0x8266('0x45')](handleError(_0x42a5e7,null));};exports[_0x8266('0x59')]=function(_0x1402c2,_0x5f52d6){return db[_0x8266('0x2c')]['find']({'where':{'id':_0x1402c2[_0x8266('0x4b')]['id']}})[_0x8266('0x27')](handleEntityNotFound(_0x5f52d6,null))['then'](removeEntity(_0x5f52d6,null))[_0x8266('0x45')](handleError(_0x5f52d6,null));};exports[_0x8266('0x5a')]=function(_0x17c137,_0x3af63b){return db[_0x8266('0x2c')]['describe']()[_0x8266('0x27')](respondWithResult(_0x3af63b,null))['catch'](handleError(_0x3af63b,null));};exports['addSections']=function(_0x1eb1ee,_0x486dfc){var _0x100918=_0x1eb1ee['body'];return db[_0x8266('0x2c')][_0x8266('0x47')]({'where':{'id':_0x1eb1ee[_0x8266('0x4b')]['id']}})['then'](handleEntityNotFound(_0x486dfc,null))['then'](function(_0x1e33ed){if(_0x1e33ed){return db[_0x8266('0x51')][_0x8266('0x52')](function(_0x4dcf28){return db[_0x8266('0x5b')]['destroy']({'where':{'userProfileId':_0x1eb1ee[_0x8266('0x4b')]['id'],'sectionId':_['map'](_0x100918,function(_0x3e5e80){return _0x3e5e80[_0x8266('0x55')];})},'transaction':_0x4dcf28})['then'](function(){var _0x2297be=_[_0x8266('0x3d')](_0x100918,function(_0x597056){_0x597056[_0x8266('0x56')]=_0x1eb1ee[_0x8266('0x4b')]['id'];return _0x597056;});var _0x44a369=[];return BPromise[_0x8266('0x5c')](_0x2297be,function(_0x23c137){return db[_0x8266('0x5b')][_0x8266('0x48')](_0x23c137,{'include':[{'model':db[_0x8266('0x5d')],'as':'Resources'}],'raw':!![],'transaction':_0x4dcf28})[_0x8266('0x27')](function(_0x4373ff){_0x44a369[_0x8266('0x5e')](_0x4373ff[_0x8266('0x4d')]({'plain':!![]}));});})['then'](function(){return _0x44a369;});});});}})['then'](function(_0x226866){return _0x226866;})['then'](respondWithResult(_0x486dfc,null))[_0x8266('0x45')](handleError(_0x486dfc,null));};exports[_0x8266('0x5f')]=function(_0x3db805,_0x482b46){var _0x3980db;return db[_0x8266('0x2c')][_0x8266('0x47')]({'where':{'id':_0x3db805['params']['id']},'attributes':['id',_0x8266('0x2a')]})[_0x8266('0x27')](handleEntityNotFound(_0x482b46,null))['then'](function(_0x16b8c8){if(_0x16b8c8){_0x3980db=_0x16b8c8;return db['UserProfileSection'][_0x8266('0x59')]({'where':{'userProfileId':_0x3db805[_0x8266('0x4b')]['id'],'sectionId':_0x3db805[_0x8266('0x30')][_0x8266('0x60')]}});}})['then'](function(){return _0x3980db;})['then'](respondWithStatusCode(_0x482b46,null))['catch'](handleError(_0x482b46,null));};exports['getSections']=function(_0x9cc0dd,_0x11a9cb){var _0x13e4de=[];var _0x280ccc=[];return db[_0x8266('0x5b')][_0x8266('0x43')]({'where':{'userProfileId':_0x9cc0dd[_0x8266('0x4b')]['id']},'raw':!![]})[_0x8266('0x27')](function(_0x4af25e){_0x13e4de=_[_0x8266('0x3b')](_0x4af25e,function(_0x34026f){return _0x34026f[_0x8266('0x61')]===0x1;});if(!_[_0x8266('0x62')](_0x13e4de)){return _[_0x8266('0x3d')](_0x13e4de,function(_0x30f96d){return _0x30f96d['sectionId'];});}else{return;}})[_0x8266('0x27')](function(_0x30bd65){if(_0x30bd65)_0x280ccc=_0x30bd65;if(_['includes'](_0x280ccc,0x64)){var _0xe8975d=_['find'](_0x13e4de,{'sectionId':0x64});return hasDefaultDashboard(_0xe8975d)[_0x8266('0x27')](function(_0x3b46c2){return _[_0x8266('0x3d')](_0x13e4de,function(_0x1e161e){if(_0x1e161e[_0x8266('0x55')]===0x64){_0x1e161e[_0x8266('0x63')]=_0x3b46c2;}return _0x1e161e;});});}else{return;}})[_0x8266('0x27')](function(_0x50f44e){if(_0x50f44e)_0x13e4de=_0x50f44e;if(_[_0x8266('0x64')](_0x280ccc,0x3eb)||_[_0x8266('0x65')](_0x13e4de,{'enabled':![],'sectionId':0x3eb})){var _0x2eea58=_[_0x8266('0x47')](_0x13e4de,{'sectionId':0x3eb});return getCustomDashboards(_0x2eea58)[_0x8266('0x27')](function(_0x63b678){return _[_0x8266('0x3d')](_0x13e4de,function(_0x183572){if(_0x183572[_0x8266('0x55')]===0x3eb){_0x183572['subsections']=_0x63b678;}return _0x183572;});});}else{return;}})[_0x8266('0x27')](function(_0xe15806){if(_0xe15806)_0x13e4de=_0xe15806;if(_[_0x8266('0x64')](_0x280ccc,0x709)||_[_0x8266('0x65')](_0x13e4de,{'enabled':![],'sectionId':0x709})){var _0x1fb70a=_[_0x8266('0x47')](_0x13e4de,{'sectionId':0x709});return getPlugins(_0x1fb70a)[_0x8266('0x27')](function(_0x5b4ab3){return _['map'](_0x13e4de,function(_0x2187c2){if(_0x2187c2[_0x8266('0x55')]===0x709){_0x2187c2[_0x8266('0x63')]=_0x5b4ab3;}return _0x2187c2;});});}else{return;}})[_0x8266('0x27')](function(_0x54728f){if(_0x54728f)_0x13e4de=_0x54728f;return _0x13e4de;})['then'](respondWithResult(_0x11a9cb,null))[_0x8266('0x45')](handleError(_0x11a9cb,null));};function hasDefaultDashboard(_0x13b518){var _0x10483c=[0x65];return new BPromise(function(_0x944ff0,_0x3567a0){try{if(_0x13b518[_0x8266('0x53')]){_0x944ff0(_0x10483c);}else{return db[_0x8266('0x5d')][_0x8266('0x66')]({'where':{'sectionId':_0x13b518['id']},'raw':!![]})[_0x8266('0x27')](function(_0x4fb218){if(_0x4fb218){_0x944ff0(_0x10483c);}});}}catch(_0x10b896){_0x3567a0(_0x10b896);}});}function getCustomDashboards(_0x328fa9){var _0x543f7a=[];return new BPromise(function(_0x2529f1,_0x358088){try{if(_0x328fa9['autoAssociation']){return db[_0x8266('0x67')][_0x8266('0x43')]({'raw':!![]})[_0x8266('0x27')](function(_0x4b1f9c){_0x4b1f9c[_0x8266('0x68')](function(_0x4718f4){_0x543f7a[_0x8266('0x5e')](_0x4718f4['id']+0x1869f);});_0x2529f1(_0x543f7a);});}else{return db[_0x8266('0x5d')][_0x8266('0x43')]({'where':{'sectionId':_0x328fa9['id']},'raw':!![]})[_0x8266('0x27')](function(_0x2378b7){_0x2378b7[_0x8266('0x68')](function(_0x2312c3){_0x543f7a[_0x8266('0x5e')](_0x2312c3['resourceId']+0x1869f);});_0x2529f1(_0x543f7a);});}}catch(_0x3cd321){_0x358088(_0x3cd321);}});}function getPlugins(_0x1f880c){var _0x1a8bb0=[];return new BPromise(function(_0x2df799,_0x3609e2){try{if(_0x1f880c['autoAssociation']){return db[_0x8266('0x69')][_0x8266('0x43')]({'raw':!![]})['then'](function(_0x1b3222){_0x1b3222['forEach'](function(_0x228614){_0x1a8bb0[_0x8266('0x5e')](_0x228614['id']+0x15b38);});_0x2df799(_0x1a8bb0);});}else{return db[_0x8266('0x5d')][_0x8266('0x43')]({'where':{'sectionId':_0x1f880c['id']},'raw':!![]})['then'](function(_0x3140e3){_0x3140e3['forEach'](function(_0x5239e1){_0x1a8bb0[_0x8266('0x5e')](_0x5239e1[_0x8266('0x6a')]+0x15b38);});_0x2df799(_0x1a8bb0);});}}catch(_0x545935){_0x3609e2(_0x545935);}});}exports[_0x8266('0x6b')]=function(_0x4aaeb3,_0x5477af){return db[_0x8266('0x2c')][_0x8266('0x47')]({'where':{'id':_0x4aaeb3['params']['id']}})[_0x8266('0x27')](handleEntityNotFound(_0x5477af,null))[_0x8266('0x27')](function(_0x4525d3){if(_0x4525d3){return db[_0x8266('0x51')][_0x8266('0x52')](function(_0x544348){return db[_0x8266('0x5b')][_0x8266('0x43')]({'where':{'userProfileId':_0x4aaeb3[_0x8266('0x4b')]['id']},'attributes':['id'],'raw':!![]})[_0x8266('0x27')](function(_0x38c401){if(_0x38c401){return db[_0x8266('0x5b')]['destroy']({'where':{'userProfileId':_0x4aaeb3[_0x8266('0x4b')]['id'],'id':_[_0x8266('0x3d')](_0x38c401,function(_0x17dbce){return _0x17dbce['id'];})},'transaction':_0x544348});}})[_0x8266('0x27')](function(_0x31108a){var _0x19c5fc=_['map'](_0x4aaeb3[_0x8266('0x49')],function(_0xf4cb7b){_0xf4cb7b['userProfileId']=_0x4aaeb3[_0x8266('0x4b')]['id'];return _0xf4cb7b;});return db[_0x8266('0x5b')]['bulkCreate'](_0x19c5fc,{'raw':!![],'transaction':_0x544348});})[_0x8266('0x27')](function(_0x550b3e){var _0x424378=_[_0x8266('0x3b')](_[_0x8266('0x3d')](_0x550b3e,function(_0x2ab06d){return _0x2ab06d[_0x8266('0x4d')]({'plain':!![]});}),{'includeAll':![]});if(_0x424378){return db['UserProfileSection'][_0x8266('0x43')]({'where':{'userProfileId':_0x4aaeb3[_0x8266('0x4b')]['id'],'sectionId':_[_0x8266('0x3d')](_0x424378,function(_0x160426){return _0x160426[_0x8266('0x55')];})},'attributes':['id',_0x8266('0x55')],'raw':!![]})[_0x8266('0x27')](function(_0x527489){var _0x1526d9=_[_0x8266('0x3d')](_0x4aaeb3['body'],function(_0x1f235e){_0x1f235e['userProfileId']=_0x4aaeb3[_0x8266('0x4b')]['id'];return _0x1f235e;});return db[_0x8266('0x5d')]['bulkCreate'](_0x1526d9,{'raw':!![],'transaction':_0x544348});});}})[_0x8266('0x45')](handleError(_0x5477af,null));});}})[_0x8266('0x27')](function(_0x523973){var _0x991e93=_[_0x8266('0x3d')](_0x523973,function(_0x29f95d){return _0x29f95d[_0x8266('0x4d')]({'plain':!![]});});})[_0x8266('0x27')](respondWithResult(_0x5477af,null))['catch'](handleError(_0x5477af,null));};exports[_0x8266('0x6c')]=function(_0x578833,_0x26bcff,_0x3503ed){return db[_0x8266('0x2c')][_0x8266('0x47')]({'where':{'id':_0x578833[_0x8266('0x4b')]['id']}})[_0x8266('0x27')](handleEntityNotFound(_0x26bcff,null))[_0x8266('0x27')](function(_0x214f28){if(_0x214f28){return _0x214f28['removeResources'](_0x578833[_0x8266('0x30')][_0x8266('0x60')]);}})[_0x8266('0x27')](respondWithStatusCode(_0x26bcff,null))['catch'](handleError(_0x26bcff,null));};exports[_0x8266('0x6d')]=function(_0x1194f5,_0x4bf27b){var _0x1d4c3e={'raw':![],'where':{}};var _0x5b897b={};var _0x4256e9={'count':0x0,'rows':[]};var _0x39ba16=_0x1194f5['query'][_0x8266('0x6e')];if(typeof _0x39ba16===_0x8266('0x6f')){throw new db[(_0x8266('0x70'))][(_0x8266('0x71'))]('Unknown\x20section');}var _0xac57de=_0x1194f5[_0x8266('0x30')][_0x8266('0x72')]||![];var _0x1d2177=getQueryModels(_0x39ba16,_0xac57de);if(typeof _0x1d2177[_0x8266('0x73')]===_0x8266('0x6f')){throw new db[(_0x8266('0x70'))][(_0x8266('0x71'))](_0x8266('0x74')+_0x39ba16+'\x27');}var _0xc2f32d=[];if(!_['isEmpty'](_0x1d2177[_0x8266('0x75')])){_0xc2f32d=_0x1d2177['parentSections'];}else{_0xc2f32d=[{'name':_0x39ba16}];}return db[_0x8266('0x2c')][_0x8266('0x66')]({'where':{'id':_0x1194f5[_0x8266('0x4b')]['id']}})[_0x8266('0x27')](handleEntityNotFound(_0x4bf27b,null))[_0x8266('0x27')](function(_0x1eb4ce){if(_0x1eb4ce){var _0x4079e8=[];for(var _0x14e4ba=0x0;_0x14e4ba<_0xc2f32d[_0x8266('0x35')];_0x14e4ba++){_0x4079e8['push'](db[_0x8266('0x5b')][_0x8266('0x66')]({'where':{'userProfileId':_0x1eb4ce['id'],'name':_0xc2f32d[_0x14e4ba][_0x8266('0x2a')]},'raw':!![]}));}return BPromise[_0x8266('0x76')](_0x4079e8);}})['then'](function(_0x357cbc){var _0x32bb67=_[_0x8266('0x3b')](_0x357cbc,function(_0x1498bd){return _0x1498bd?_0x1498bd:undefined;});var _0x445da1=_['filter'](_0xc2f32d,[_0x8266('0x77'),!![]]);var _0x200bc2=_[_0x8266('0x62')](_0x32bb67)&&_[_0x8266('0x62')](_0x445da1)?null:_[_0x8266('0x78')](_0x445da1,_0x32bb67);if(_0x200bc2){var _0x468d62=[];for(var _0x5829ce=0x0;_0x5829ce<_0x200bc2['length'];_0x5829ce++){var _0x16de8f=_['find'](_0xc2f32d,function(_0x526a89){return _0x200bc2[_0x5829ce]?_0x526a89[_0x8266('0x2a')]===_0x200bc2[_0x5829ce][_0x8266('0x2a')]:null;});if(_0x16de8f){if(_0x200bc2[_0x5829ce][_0x8266('0x77')]){_0x468d62[_0x8266('0x5e')](getAllResources(_0x1d2177[_0x8266('0x73')],_0x200bc2[_0x5829ce]));}else{if(!_0x200bc2[_0x5829ce]['autoAssociation']){_0x468d62['push'](getAllowedResources(_0x16de8f,_0x200bc2[_0x5829ce],_0x1d2177[_0x8266('0x73')]));}else{if(_0x16de8f[_0x8266('0x2e')]){_0x468d62[_0x8266('0x5e')](getAllFilteredResources(_0x16de8f,_0x200bc2[_0x5829ce]));}}}}}return BPromise[_0x8266('0x76')](_0x468d62);}else{return null;}})[_0x8266('0x27')](function(_0x2ffabe){var _0x4e1a6a=_0x2ffabe;var _0x593684=null;if(_0x4e1a6a){_0x593684=_0x4e1a6a['length']===0x1?_0x4e1a6a[0x0]:null;}if(_0x593684||_0x4e1a6a){var _0x23fd21=db[_0x1d2177['childModel']][_0x8266('0x2d')];_0x5b897b[_0x8266('0x2e')]=_['keys'](_0x23fd21);_0x5b897b['query']=_[_0x8266('0x2f')](_0x1194f5[_0x8266('0x30')]);_0x5b897b[_0x8266('0x31')]=_[_0x8266('0x32')](_0x5b897b[_0x8266('0x2e')],_0x5b897b[_0x8266('0x30')]);_0x1d4c3e[_0x8266('0x33')]=_[_0x8266('0x32')](_0x5b897b[_0x8266('0x2e')],qs[_0x8266('0x34')](_0x1194f5[_0x8266('0x30')][_0x8266('0x34')]));_0x1d4c3e[_0x8266('0x33')]=_0x1d4c3e[_0x8266('0x33')][_0x8266('0x35')]?_0x1d4c3e['attributes']:_0x5b897b[_0x8266('0x2e')];if(!_0x1194f5['query'][_0x8266('0x36')](_0x8266('0x37'))){_0x1d4c3e['limit']=qs[_0x8266('0x38')](_0x1194f5[_0x8266('0x30')][_0x8266('0x38')]);_0x1d4c3e[_0x8266('0x21')]=qs[_0x8266('0x21')](_0x1194f5[_0x8266('0x30')]['offset']);}_0x1d4c3e[_0x8266('0x79')]=qs['sort'](_0x1194f5[_0x8266('0x30')]['sort']);_0x1d4c3e[_0x8266('0x3c')]=qs['filters'](_[_0x8266('0x3a')](_0x1194f5[_0x8266('0x30')],_0x5b897b[_0x8266('0x31')]));if(_0x1194f5['query'][_0x8266('0x3b')]){_0x1d4c3e[_0x8266('0x3c')]=_[_0x8266('0x46')](_0x1d4c3e['where'],{'$or':_[_0x8266('0x3d')](_0x23fd21,function(_0x1ba3f7){if(_0x1ba3f7[_0x8266('0x3e')][_0x8266('0x3f')]!=='VIRTUAL'){var _0xa72750={};_0xa72750[_0x1ba3f7['field']]={'$like':'%'+_0x1194f5[_0x8266('0x30')][_0x8266('0x3b')]+'%'};return _0xa72750;}})});}var _0x5a464c=[];if(_0x593684){var _0x2a2bde=_[_0x8266('0x47')](_0xc2f32d,['name',_0x593684[_0x8266('0x2a')]]);if(_0x2a2bde[_0x8266('0x41')]){var _0x5c88c9={};if(_0x1d2177['childModel']==='AnalyticExtractedReport'){_0x5c88c9[_0x2a2bde['foreignKey']]=_[_0x8266('0x3d')](_0x593684['associatedResources'],'id');}else{_0x5c88c9[_0x2a2bde[_0x8266('0x7a')]]=_0x593684[_0x8266('0x7b')];}_0x5a464c[_0x8266('0x5e')](_0x5c88c9);}else{_0x1d4c3e[_0x8266('0x3c')]['id']=_0x593684[_0x8266('0x7b')];}}else{for(var _0x4ee8d4=0x0;_0x4ee8d4<_0x4e1a6a[_0x8266('0x35')];_0x4ee8d4++){var _0x2a2bde=_[_0x8266('0x47')](_0xc2f32d,[_0x8266('0x2a'),_0x4e1a6a[_0x4ee8d4]['name']]);if(_0x2a2bde[_0x8266('0x41')]){var _0x5c88c9={};_0x5c88c9[_0x2a2bde[_0x8266('0x7a')]]=_0x4e1a6a[_0x4ee8d4]['associatedResources'];_0x5a464c[_0x8266('0x5e')](_0x5c88c9);}else{if(!_0x1d4c3e['where']['id'])_0x1d4c3e[_0x8266('0x3c')]['id']=[];_0x4e1a6a[_0x4ee8d4][_0x8266('0x7b')][_0x8266('0x68')](function(_0xc61363){_0x1d4c3e[_0x8266('0x3c')]['id'][_0x8266('0x5e')](_0xc61363);});}}}if(!_[_0x8266('0x62')](_0x5a464c)){_0x1d4c3e[_0x8266('0x3c')]=_[_0x8266('0x46')](_0x1d4c3e[_0x8266('0x3c')],{'$and':{'$or':_0x5a464c}});}_0x1d4c3e=_[_0x8266('0x46')]({},_0x1d4c3e,_0x1194f5['options']);if(_0x593684&&!_0x593684[_0x8266('0x53')]&&_0x1d2177[_0x8266('0x73')]===_0x8266('0x7c')){if(_0x1194f5[_0x8266('0x30')][_0x8266('0x4c')]){_0x1d4c3e[_0x8266('0x7d')]=[{'all':!![]}];}return db[_0x1d2177[_0x8266('0x73')]][_0x8266('0x43')](_0x1d4c3e)[_0x8266('0x27')](function(_0x1cb07c){var _0x17d1a8=[];_0x1cb07c['forEach'](function(_0x4c12b2){var _0x17e185;switch(_0x4c12b2[_0x8266('0x7e')]){case'default':_0x17e185=_[_0x8266('0x47')](_0x593684[_0x8266('0x7b')],function(_0x5542ac){return _0x5542ac['id']===_0x4c12b2[_0x8266('0x7f')]&&_0x5542ac[_0x8266('0x3e')]===_0x8266('0x80');});break;case _0x8266('0x81'):_0x17e185=_[_0x8266('0x47')](_0x593684[_0x8266('0x7b')],function(_0x205c74){return _0x205c74['id']===_0x4c12b2[_0x8266('0x7f')]&&_0x205c74[_0x8266('0x3e')]===_0x8266('0x82');});break;}if(_0x17e185)_0x17d1a8[_0x8266('0x5e')](_0x4c12b2);});_0x4256e9[_0x8266('0x20')]=_0x17d1a8[_0x8266('0x35')];_0x4256e9[_0x8266('0x44')]=_0x17d1a8;return _0x4256e9;});}else{return db[_0x1d2177['childModel']][_0x8266('0x20')]({'where':_0x1d4c3e[_0x8266('0x3c')]})[_0x8266('0x27')](function(_0x21b113){_0x4256e9[_0x8266('0x20')]=_0x21b113;if(_0x1194f5[_0x8266('0x30')][_0x8266('0x4c')]){if(_0x1d2177[_0x8266('0x73')]===_0x8266('0x83')){_0x1d4c3e[_0x8266('0x7d')]=[{'model':db[_0x8266('0x84')],'as':_0x8266('0x85'),'attributes':['id','name',_0x8266('0x86')],'required':_0x1194f5[_0x8266('0x30')][_0x8266('0x87')]?!![]:![]},{'model':db['Tag'],'as':_0x8266('0x88'),'attributes':['id','name',_0x8266('0x86')],'through':_0x1194f5[_0x8266('0x30')][_0x8266('0x87')]?{'attributes':[],'where':{'TagId':_0x1194f5[_0x8266('0x30')][_0x8266('0x87')]||undefined}}:{},'required':_0x1194f5['query'][_0x8266('0x87')]?!![]:![]}];}else{_0x1d4c3e[_0x8266('0x7d')]=[{'all':!![]}];}}return db[_0x1d2177[_0x8266('0x73')]][_0x8266('0x43')](_0x1d4c3e);})[_0x8266('0x27')](function(_0xde9f7c){_0x4256e9[_0x8266('0x44')]=_0xde9f7c;return _0x4256e9;});}}else{return _0x4256e9;}})[_0x8266('0x27')](respondWithFilteredResult(_0x4bf27b,_0x1d4c3e))[_0x8266('0x45')](handleError(_0x4bf27b,null));};function getAllResources(_0x2546b7,_0x312777){return new BPromise(function(_0x39bee1,_0x12d402){if(_0x312777){var _0x2abfe9=_0x312777[_0x8266('0x3b')]?{[_0x312777[_0x8266('0x3b')][_0x8266('0x41')]]:_0x312777['filter'][_0x8266('0x89')]}:undefined;return db[_0x2546b7][_0x8266('0x43')]({'where':_0x2abfe9,'raw':!![]})['then'](function(_0x1a27d6){_0x312777[_0x8266('0x7b')]=_[_0x8266('0x3d')](_0x1a27d6,'id');_0x39bee1(_0x312777);})[_0x8266('0x45')](function(_0x4ef150){_0x12d402(_0x4ef150);});}else{_0x39bee1(null);}});}function getAllFilteredResources(_0x2a91df,_0x1bef39){return new BPromise(function(_0x46b233,_0x4b7f6b){var _0x29c155=_0x2a91df[_0x8266('0x3b')]?{[_0x2a91df['filter']['field']]:_0x2a91df[_0x8266('0x3b')][_0x8266('0x89')]}:undefined;return db[_0x2a91df['model']][_0x8266('0x43')]({'where':_0x29c155,'raw':!![]})[_0x8266('0x27')](function(_0x84bebc){_0x1bef39[_0x8266('0x7b')]=_[_0x8266('0x3d')](_0x84bebc,function(_0x212319){return _0x212319['name'];});_0x46b233(_0x1bef39);})[_0x8266('0x45')](function(_0x52bda5){_0x4b7f6b(_0x52bda5);});});}function getAllowedResources(_0x1c0282,_0x5cb826,_0x191c7d){return new BPromise(function(_0x3a7ee1,_0x46ba55){if(_0x5cb826){return db['UserProfileResource'][_0x8266('0x43')]({'where':{'sectionId':_0x5cb826['id']},'raw':!![]})[_0x8266('0x27')](function(_0x511ae7){if(_0x1c0282['field']&&_0x1c0282[_0x8266('0x41')]!=='id'){_0x5cb826[_0x8266('0x7b')]=_['map'](_0x511ae7,function(_0x37a94b){return _0x37a94b[_0x1c0282['field']];});}else{if(_0x191c7d===_0x8266('0x7c')){_0x5cb826[_0x8266('0x7b')]=_[_0x8266('0x3d')](_0x511ae7,function(_0x3c8338){return{'id':_0x3c8338['resourceId'],'type':_0x3c8338['type']};});}else{_0x5cb826[_0x8266('0x7b')]=_['map'](_0x511ae7,function(_0x5ada6a){return _0x5ada6a['resourceId'];});}}_0x3a7ee1(_0x5cb826);})[_0x8266('0x45')](function(_0x50756f){_0x46ba55(_0x50756f);});}else{_0x3a7ee1(null);}});}function getQueryModels(_0x45f0ca,_0x196ae1){var _0x4b30bd=_0x45f0ca[_0x8266('0x8a')]();var _0x3b19fb={'childModel':undefined,'parentSections':[]};switch(_0x4b30bd){case _0x8266('0x8b'):_0x3b19fb[_0x8266('0x73')]=_0x8266('0x8c');break;case _0x8266('0x8d'):_0x3b19fb[_0x8266('0x73')]=_0x8266('0x8e');break;case _0x8266('0x8f'):_0x3b19fb[_0x8266('0x73')]='SquareRecording';_0x3b19fb[_0x8266('0x75')]=[{'name':_0x8266('0x90'),'field':'name','foreignKey':'projectName'}];break;case _0x8266('0x91'):_0x3b19fb['childModel']='JscriptyProject';break;case _0x8266('0x92'):_0x3b19fb[_0x8266('0x73')]=_0x8266('0x83');_0x3b19fb[_0x8266('0x75')]=[{'name':'Lists','field':'id','foreignKey':'ListId'}];break;case _0x8266('0x93'):_0x3b19fb[_0x8266('0x73')]=_0x8266('0x94');break;case _0x8266('0x95'):_0x3b19fb[_0x8266('0x73')]=_0x8266('0x96');break;case _0x8266('0x97'):_0x3b19fb[_0x8266('0x73')]=_0x8266('0x98');break;case _0x8266('0x99'):_0x3b19fb[_0x8266('0x73')]=_0x8266('0x9a');break;case _0x8266('0x9b'):_0x3b19fb[_0x8266('0x73')]=_0x8266('0x9c');break;case _0x8266('0x9d'):_0x3b19fb[_0x8266('0x73')]=_0x8266('0x9e');break;case _0x8266('0x9f'):_0x3b19fb[_0x8266('0x73')]=_0x8266('0xa0');break;case _0x8266('0xa1'):case _0x8266('0xa2'):case _0x8266('0xa3'):_0x3b19fb[_0x8266('0x73')]='VoiceExtension';break;case'contexts':_0x3b19fb[_0x8266('0x73')]=_0x8266('0xa4');break;case _0x8266('0xa5'):_0x3b19fb[_0x8266('0x73')]='VoiceMail';break;case _0x8266('0xa6'):_0x3b19fb[_0x8266('0x73')]=_0x8266('0xa7');_0x3b19fb[_0x8266('0x75')]=[{'name':_0x8266('0xa8'),'field':_0x8266('0x2a'),'foreignKey':_0x8266('0xa9'),'model':_0x8266('0xaa'),'filter':{'field':_0x8266('0xab'),'value':[_0x8266('0xac')]}},{'name':_0x8266('0xad'),'field':_0x8266('0x2a'),'foreignKey':_0x8266('0xa9'),'model':_0x8266('0xaa'),'filter':{'field':'role','value':[_0x8266('0xae')]}},{'name':_0x8266('0xaf'),'field':'name','foreignKey':'queue','model':'VoiceQueue','filter':{'field':_0x8266('0x3e'),'value':[_0x8266('0xb0')]}},{'name':'QueueCampaigns','field':_0x8266('0x2a'),'foreignKey':_0x8266('0xb1'),'model':_0x8266('0xb2'),'filter':{'field':'type','value':[_0x8266('0xb3')]}}];break;case _0x8266('0xb4'):_0x3b19fb['childModel']=_0x8266('0xb5');break;case'chanspies':_0x3b19fb[_0x8266('0x73')]=_0x8266('0xb6');break;case _0x8266('0xb7'):_0x3b19fb[_0x8266('0x73')]='VoicePrefix';break;case _0x8266('0xb8'):_0x3b19fb[_0x8266('0x73')]='Campaign';break;case _0x8266('0xb9'):_0x3b19fb['childModel']='MailQueue';break;case _0x8266('0xba'):_0x3b19fb['childModel']=_0x8266('0xbb');break;case _0x8266('0xbc'):_0x3b19fb[_0x8266('0x73')]=_0x8266('0xbd');break;case _0x8266('0xbe'):_0x3b19fb[_0x8266('0x73')]=_0x8266('0xbf');break;case _0x8266('0xc0'):_0x3b19fb[_0x8266('0x73')]=_0x8266('0xc1');break;case'smsqueues':_0x3b19fb['childModel']=_0x8266('0xc2');break;case _0x8266('0xc3'):_0x3b19fb[_0x8266('0x73')]=_0x8266('0xc4');break;case _0x8266('0xc5'):_0x3b19fb[_0x8266('0x73')]=_0x8266('0xc6');break;case _0x8266('0xc7'):case'queuecampaigns':_0x3b19fb['childModel']=_0x8266('0xb2');if(_0x196ae1){_0x3b19fb[_0x8266('0x75')]=[{'name':_0x8266('0xaf')},{'name':_0x8266('0xc8')}];}break;case _0x8266('0xc9'):case _0x8266('0xca'):case _0x8266('0xcb'):_0x3b19fb['childModel']=_0x8266('0xaa');if(_0x196ae1){_0x3b19fb[_0x8266('0x75')]=[{'name':_0x8266('0xcc'),'filter':{'field':_0x8266('0xab'),'value':[_0x8266('0xcd'),_0x8266('0xce')]},'ignore':!![]},{'name':_0x8266('0xa8')},{'name':'Telephones'}];}break;case _0x8266('0xcf'):_0x3b19fb[_0x8266('0x73')]='ZendeskAccount';break;case _0x8266('0xd0'):_0x3b19fb[_0x8266('0x73')]=_0x8266('0xd1');break;case _0x8266('0xd2'):_0x3b19fb['childModel']=_0x8266('0xd3');break;case _0x8266('0xd4'):_0x3b19fb[_0x8266('0x73')]=_0x8266('0xd5');break;case _0x8266('0xd6'):_0x3b19fb[_0x8266('0x73')]=_0x8266('0xd7');break;case _0x8266('0xd8'):_0x3b19fb['childModel']=_0x8266('0xd9');break;case _0x8266('0xda'):_0x3b19fb[_0x8266('0x73')]='User';break;case'cannedanswers':_0x3b19fb[_0x8266('0x73')]=_0x8266('0xdb');break;case _0x8266('0xdc'):_0x3b19fb['childModel']='Disposition';break;case _0x8266('0xdd'):_0x3b19fb['childModel']=_0x8266('0x67');break;case _0x8266('0xde'):_0x3b19fb[_0x8266('0x73')]=_0x8266('0xdf');break;case'pauses':_0x3b19fb[_0x8266('0x73')]=_0x8266('0xe0');break;case'scheduler':_0x3b19fb[_0x8266('0x73')]=_0x8266('0xe1');break;case _0x8266('0xe2'):_0x3b19fb[_0x8266('0x73')]=_0x8266('0xe3');break;case _0x8266('0xe4'):_0x3b19fb['childModel']=_0x8266('0x84');break;case _0x8266('0xe5'):_0x3b19fb[_0x8266('0x73')]=_0x8266('0xe6');break;case _0x8266('0xe7'):_0x3b19fb[_0x8266('0x73')]=_0x8266('0xe8');break;case _0x8266('0xe9'):_0x3b19fb['childModel']='Trunk';break;case _0x8266('0xea'):_0x3b19fb[_0x8266('0x73')]=_0x8266('0xeb');break;case'plugins':_0x3b19fb[_0x8266('0x73')]=_0x8266('0x69');break;case _0x8266('0xec'):_0x3b19fb[_0x8266('0x73')]=_0x8266('0x7c');_0x3b19fb['parentSections']=[{'name':_0x8266('0xed'),'field':'id','foreignKey':_0x8266('0x7f')}];break;case _0x8266('0xee'):_0x3b19fb[_0x8266('0x73')]='AnalyticMetric';break;default:return _0x3b19fb;}return _0x3b19fb;} \ No newline at end of file +var _0xced7=['name','send','index','UserProfile','rawAttributes','model','query','intersection','attributes','fields','length','hasOwnProperty','limit','order','sort','where','filters','pick','filter','merge','map','type','key','VIRTUAL','options','includeAll','include','findAll','rows','then','show','params','keys','find','catch','create','clone','get','omit','createdAt','body','sequelize','UserProfileSection','autoAssociation','updatedAt','sectionId','userProfileId','Resources','update','describe','addSections','transaction','each','UserProfileResource','removeSections','ids','subsections','includes','some','findOne','Dashboard','forEach','push','resourceId','Plugin','addResources','bulkCreate','removeResources','getResources','section','undefined','Sequelize','ValidationError','Unknown\x20section','mergeResources','childModel','Invalid\x20section\x20\x27','parentSections','all','ignore','isEmpty','union','nolimit','AnalyticExtractedReport','foreignKey','associatedResources','field','reportType','default','reportId','DefaultReports','custom','CustomReports','CmContact','Tags','tag','Tag','ThroughTags','color','value','toLowerCase','squareprojects','SquareProject','odbc','SquareOdbc','squarerecordings','SquareRecording','SquareProjects','projects','JscriptyProject','Lists','ListId','lists','CmList','companies','globalcustomfields','CmCustomField','ChatQueue','chatwebsites','ChatWebsite','faxqueues','FaxQueue','FaxAccount','inboundroutes','internalroutes','VoiceExtension','contexts','VoiceContext','voicemails','VoiceMail','voicerecordings','VoiceRecording','Agents','User','role','agent','Telephones','telephone','queue','VoiceQueue','QueueCampaigns','VoiceMusicOnHold','chanspies','VoiceChanSpy','voiceprefixes','VoicePrefix','Campaign','MailQueue','mailaccounts','MailAccount','mailsubstatuses','openchannelqueues','OpenchannelQueue','openchannelaccounts','OpenchannelAccount','smsqueues','SmsQueue','smsaccounts','teams','Team','voicequeues','VoiceQueues','users','agents','telephones','Users','admin','zendeskaccounts','ZendeskAccount','SalesforceAccount','freshdeskaccounts','FreshdeskAccount','DeskAccount','zohoaccounts','vtigeraccounts','cannedanswers','CannedAnswer','dispositions','Disposition','customdashboards','intervals','Pause','scheduler','Schedule','sounds','Sound','tags','templates','Template','triggers','trunks','Trunk','variables','Variable','plugins','Reports','AnalyticMetric','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','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','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./userProfile.socket','register','sendStatus','status','end','json','count','offset','destroy','error','stack'];(function(_0x18ac4a,_0x3970f0){var _0x48cb7a=function(_0x48ad44){while(--_0x48ad44){_0x18ac4a['push'](_0x18ac4a['shift']());}};_0x48cb7a(++_0x3970f0);}(_0xced7,0x1b5));var _0x7ced=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xced7[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x7ced('0x0'));var rimraf=require(_0x7ced('0x1'));var zipdir=require(_0x7ced('0x2'));var jsonpatch=require(_0x7ced('0x3'));var rp=require(_0x7ced('0x4'));var moment=require(_0x7ced('0x5'));var BPromise=require(_0x7ced('0x6'));var Mustache=require(_0x7ced('0x7'));var util=require(_0x7ced('0x8'));var path=require(_0x7ced('0x9'));var sox=require(_0x7ced('0xa'));var csv=require('to-csv');var ejs=require(_0x7ced('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x7ced('0xc'));var crypto=require(_0x7ced('0xd'));var jsforce=require(_0x7ced('0xe'));var deskjs=require(_0x7ced('0xf'));var toCsv=require(_0x7ced('0x10'));var querystring=require(_0x7ced('0x11'));var Papa=require(_0x7ced('0x12'));var Redis=require(_0x7ced('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x7ced('0x14'));var as=require(_0x7ced('0x15'));var hardwareService=require(_0x7ced('0x16'));var logger=require(_0x7ced('0x17'))(_0x7ced('0x18'));var utils=require(_0x7ced('0x19'));var config=require(_0x7ced('0x1a'));var db=require(_0x7ced('0x1b'))['db'];config[_0x7ced('0x1c')]=_[_0x7ced('0x1d')](config[_0x7ced('0x1c')],{'host':_0x7ced('0x1e'),'port':0x18eb});var socket=require(_0x7ced('0x1f'))(new Redis(config['redis']));require(_0x7ced('0x20'))[_0x7ced('0x21')](socket);function respondWithStatusCode(_0x11313b,_0x3313f2){_0x3313f2=_0x3313f2||0xcc;return function(_0x5a28c6){if(_0x5a28c6){return _0x11313b[_0x7ced('0x22')](_0x3313f2);}return _0x11313b[_0x7ced('0x23')](_0x3313f2)[_0x7ced('0x24')]();};}function respondWithResult(_0x2eeca1,_0x3a272a){_0x3a272a=_0x3a272a||0xc8;return function(_0x30a03f){if(_0x30a03f){return _0x2eeca1[_0x7ced('0x23')](_0x3a272a)[_0x7ced('0x25')](_0x30a03f);}};}function respondWithFilteredResult(_0x14f594,_0x4c2aa1){return function(_0x5129bb){if(_0x5129bb){var _0x1985c0=_0x5129bb[_0x7ced('0x26')],_0x43a66e=_0x4c2aa1[_0x7ced('0x27')],_0x1e2b4f=_0x4c2aa1[_0x7ced('0x27')]+_0x4c2aa1['limit'],_0x2723c2;if(_0x1e2b4f>=_0x1985c0){_0x1e2b4f=_0x1985c0;_0x2723c2=0xc8;}else{_0x2723c2=0xce;}_0x14f594[_0x7ced('0x23')](_0x2723c2);return _0x14f594['set']('Content-Range',_0x43a66e+'-'+_0x1e2b4f+'/'+_0x1985c0)[_0x7ced('0x25')](_0x5129bb);}return null;};}function patchUpdates(_0x1ba79b){return function(_0x1a37fa){try{jsonpatch['apply'](_0x1a37fa,_0x1ba79b,!![]);}catch(_0x1ddc59){return BPromise['reject'](_0x1ddc59);}return _0x1a37fa['save']();};}function saveUpdates(_0x2a7d5a,_0xd8e7de){return function(_0x3fcd57){if(_0x3fcd57){return _0x3fcd57['update'](_0x2a7d5a)['then'](function(_0x20a45d){return _0x20a45d;});}return null;};}function removeEntity(_0x19913a,_0x387cd4){return function(_0x14d2d0){if(_0x14d2d0){return _0x14d2d0[_0x7ced('0x28')]()['then'](function(){_0x19913a[_0x7ced('0x23')](0xcc)[_0x7ced('0x24')]();});}};}function handleEntityNotFound(_0x514f2a,_0x26aff8){return function(_0x311a30){if(!_0x311a30){_0x514f2a[_0x7ced('0x22')](0x194);}return _0x311a30;};}function handleError(_0x395ef4,_0x5c59fc){_0x5c59fc=_0x5c59fc||0x1f4;return function(_0x210968){logger[_0x7ced('0x29')](_0x210968[_0x7ced('0x2a')]);if(_0x210968[_0x7ced('0x2b')]){delete _0x210968[_0x7ced('0x2b')];}_0x395ef4['status'](_0x5c59fc)[_0x7ced('0x2c')](_0x210968);};}exports[_0x7ced('0x2d')]=function(_0x358bc5,_0x569e91){var _0x7eef0e={},_0x2dd0a4={},_0x2f1bfb={'count':0x0,'rows':[]};var _0x551f10=db[_0x7ced('0x2e')][_0x7ced('0x2f')];_0x2dd0a4[_0x7ced('0x30')]=_['keys'](_0x551f10);_0x2dd0a4[_0x7ced('0x31')]=_['keys'](_0x358bc5[_0x7ced('0x31')]);_0x2dd0a4['filters']=_[_0x7ced('0x32')](_0x2dd0a4[_0x7ced('0x30')],_0x2dd0a4[_0x7ced('0x31')]);_0x7eef0e[_0x7ced('0x33')]=_[_0x7ced('0x32')](_0x2dd0a4[_0x7ced('0x30')],qs[_0x7ced('0x34')](_0x358bc5[_0x7ced('0x31')][_0x7ced('0x34')]));_0x7eef0e[_0x7ced('0x33')]=_0x7eef0e[_0x7ced('0x33')][_0x7ced('0x35')]?_0x7eef0e['attributes']:_0x2dd0a4[_0x7ced('0x30')];if(!_0x358bc5['query'][_0x7ced('0x36')]('nolimit')){_0x7eef0e[_0x7ced('0x37')]=qs[_0x7ced('0x37')](_0x358bc5[_0x7ced('0x31')][_0x7ced('0x37')]);_0x7eef0e['offset']=qs[_0x7ced('0x27')](_0x358bc5[_0x7ced('0x31')][_0x7ced('0x27')]);}_0x7eef0e[_0x7ced('0x38')]=qs['sort'](_0x358bc5['query'][_0x7ced('0x39')]);_0x7eef0e[_0x7ced('0x3a')]=qs[_0x7ced('0x3b')](_[_0x7ced('0x3c')](_0x358bc5[_0x7ced('0x31')],_0x2dd0a4[_0x7ced('0x3b')]));if(_0x358bc5[_0x7ced('0x31')][_0x7ced('0x3d')]){_0x7eef0e[_0x7ced('0x3a')]=_[_0x7ced('0x3e')](_0x7eef0e['where'],{'$or':_[_0x7ced('0x3f')](_0x551f10,function(_0x260a11){if(_0x260a11[_0x7ced('0x40')][_0x7ced('0x41')]!==_0x7ced('0x42')){var _0x5847f={};_0x5847f[_0x260a11['field']]={'$like':'%'+_0x358bc5['query']['filter']+'%'};return _0x5847f;}})});}_0x7eef0e=_[_0x7ced('0x3e')]({},_0x7eef0e,_0x358bc5[_0x7ced('0x43')]);var _0xd23f6b={'where':_0x7eef0e[_0x7ced('0x3a')]};return db[_0x7ced('0x2e')][_0x7ced('0x26')](_0xd23f6b)['then'](function(_0x2e6818){_0x2f1bfb[_0x7ced('0x26')]=_0x2e6818;if(_0x358bc5['query'][_0x7ced('0x44')]){_0x7eef0e[_0x7ced('0x45')]=[{'all':!![]}];}return db[_0x7ced('0x2e')][_0x7ced('0x46')](_0x7eef0e);})['then'](function(_0x535f1c){_0x2f1bfb[_0x7ced('0x47')]=_0x535f1c;return _0x2f1bfb;})[_0x7ced('0x48')](respondWithFilteredResult(_0x569e91,_0x7eef0e))['catch'](handleError(_0x569e91,null));};exports[_0x7ced('0x49')]=function(_0x2d689a,_0x1cbdbc){var _0x117050={'raw':![],'where':{'id':_0x2d689a[_0x7ced('0x4a')]['id']}},_0x3b4df9={};_0x3b4df9[_0x7ced('0x30')]=_['keys'](db[_0x7ced('0x2e')][_0x7ced('0x2f')]);_0x3b4df9[_0x7ced('0x31')]=_[_0x7ced('0x4b')](_0x2d689a['query']);_0x3b4df9['filters']=_[_0x7ced('0x32')](_0x3b4df9[_0x7ced('0x30')],_0x3b4df9[_0x7ced('0x31')]);_0x117050[_0x7ced('0x33')]=_[_0x7ced('0x32')](_0x3b4df9[_0x7ced('0x30')],qs[_0x7ced('0x34')](_0x2d689a['query'][_0x7ced('0x34')]));_0x117050[_0x7ced('0x33')]=_0x117050[_0x7ced('0x33')][_0x7ced('0x35')]?_0x117050['attributes']:_0x3b4df9[_0x7ced('0x30')];if(_0x2d689a[_0x7ced('0x31')][_0x7ced('0x44')]){_0x117050[_0x7ced('0x45')]=[{'all':!![]}];}_0x117050=_[_0x7ced('0x3e')]({},_0x117050,_0x2d689a[_0x7ced('0x43')]);return db['UserProfile'][_0x7ced('0x4c')](_0x117050)[_0x7ced('0x48')](handleEntityNotFound(_0x1cbdbc,null))[_0x7ced('0x48')](respondWithResult(_0x1cbdbc,null))[_0x7ced('0x4d')](handleError(_0x1cbdbc,null));};exports[_0x7ced('0x4e')]=function(_0x592021,_0x50ac3b){return db[_0x7ced('0x2e')][_0x7ced('0x4e')](_0x592021['body'],{})[_0x7ced('0x48')](respondWithResult(_0x50ac3b,0xc9))[_0x7ced('0x4d')](handleError(_0x50ac3b,null));};exports[_0x7ced('0x4f')]=function(_0x2e2afc,_0x5a4291){var _0x523ca4={'raw':![],'where':{'id':_0x2e2afc[_0x7ced('0x4a')]['id']}},_0x90903a={};_0x90903a[_0x7ced('0x30')]=_['keys'](db[_0x7ced('0x2e')][_0x7ced('0x2f')]);_0x523ca4[_0x7ced('0x33')]=_[_0x7ced('0x32')](_0x90903a[_0x7ced('0x30')],qs[_0x7ced('0x34')](_0x2e2afc[_0x7ced('0x31')][_0x7ced('0x34')]));_0x523ca4[_0x7ced('0x33')]=_0x523ca4[_0x7ced('0x33')][_0x7ced('0x35')]?_0x523ca4[_0x7ced('0x33')]:_0x90903a['model'];if(_0x2e2afc['query'][_0x7ced('0x44')]){_0x523ca4[_0x7ced('0x45')]=[{'all':!![]}];}_0x523ca4=_[_0x7ced('0x3e')]({},_0x523ca4,_0x2e2afc[_0x7ced('0x43')]);return db[_0x7ced('0x2e')]['find'](_0x523ca4)[_0x7ced('0x48')](handleEntityNotFound(_0x5a4291,null))['then'](function(_0x438a){if(_0x438a){var _0x249134=_0x438a[_0x7ced('0x50')]({'plain':!![]});_0x249134=qs[_0x7ced('0x51')](_0x249134,['id',_0x7ced('0x52'),'updatedAt','crudPermissions']);_0x2e2afc[_0x7ced('0x53')]=_[_0x7ced('0x51')](_0x2e2afc[_0x7ced('0x53')],['id',_0x7ced('0x52'),'updatedAt']);return db[_0x7ced('0x54')]['transaction'](function(_0x2e7b3f){return db['UserProfile'][_0x7ced('0x4e')](_[_0x7ced('0x3e')](_0x249134,_0x2e2afc['body']),{'include':_0x2e2afc[_0x7ced('0x31')][_0x7ced('0x44')]?[{'all':!![]}]:undefined,'transaction':_0x2e7b3f})['then'](function(_0x481943){var _0x10b9c1=_0x481943[_0x7ced('0x50')]({'plain':!![]});return db[_0x7ced('0x55')][_0x7ced('0x46')]({'where':{'userProfileId':_0x2e2afc['params']['id']},'raw':!![]})[_0x7ced('0x48')](function(_0x2fa2bf){if(_0x2fa2bf){return BPromise['each'](_0x2fa2bf,function(_0x63c101){return new BPromise(function(_0x2436e8,_0x502ffe){if(_0x63c101[_0x7ced('0x56')]===null||_0x63c101[_0x7ced('0x56')]===0x1)_0x2436e8(null);return db['UserProfileResource'][_0x7ced('0x46')]({'where':{'sectionId':_0x63c101['id']},'raw':!![]})[_0x7ced('0x48')](function(_0x18f965){var _0x25dd61=_['map'](_0x18f965,function(_0x4ffd22){return qs[_0x7ced('0x51')](_0x4ffd22,['id',_0x7ced('0x52'),_0x7ced('0x57'),_0x7ced('0x58')]);});_0x2436e8(_0x25dd61);})['catch'](function(_0x4947c2){_0x502ffe(_0x4947c2);});})[_0x7ced('0x48')](function(_0x16016e){var _0x496605=qs[_0x7ced('0x51')](_0x63c101,['id','createdAt',_0x7ced('0x57')]);_0x496605[_0x7ced('0x59')]=_0x10b9c1['id'];if(_0x16016e)_0x496605[_0x7ced('0x5a')]=_0x16016e;return _0x496605;})[_0x7ced('0x48')](function(_0x3797c5){return db['UserProfileSection'][_0x7ced('0x4e')](_0x3797c5,{'include':[{'model':db['UserProfileResource'],'as':_0x7ced('0x5a')}],'raw':!![],'transaction':_0x2e7b3f});});})['then'](function(){return _0x10b9c1;});}});});});}})[_0x7ced('0x48')](respondWithResult(_0x5a4291,0xc9))[_0x7ced('0x4d')](handleError(_0x5a4291,null));};exports[_0x7ced('0x5b')]=function(_0x5773d3,_0xb593d3){if(_0x5773d3[_0x7ced('0x53')]['id']){delete _0x5773d3[_0x7ced('0x53')]['id'];}return db[_0x7ced('0x2e')][_0x7ced('0x4c')]({'where':{'id':_0x5773d3[_0x7ced('0x4a')]['id']}})['then'](handleEntityNotFound(_0xb593d3,null))[_0x7ced('0x48')](saveUpdates(_0x5773d3[_0x7ced('0x53')],null))[_0x7ced('0x48')](respondWithResult(_0xb593d3,null))[_0x7ced('0x4d')](handleError(_0xb593d3,null));};exports[_0x7ced('0x28')]=function(_0x30d0c3,_0x56c15d){return db[_0x7ced('0x2e')]['find']({'where':{'id':_0x30d0c3[_0x7ced('0x4a')]['id']}})[_0x7ced('0x48')](handleEntityNotFound(_0x56c15d,null))['then'](removeEntity(_0x56c15d,null))[_0x7ced('0x4d')](handleError(_0x56c15d,null));};exports[_0x7ced('0x5c')]=function(_0x13b914,_0x4bcb77){return db[_0x7ced('0x2e')][_0x7ced('0x5c')]()[_0x7ced('0x48')](respondWithResult(_0x4bcb77,null))['catch'](handleError(_0x4bcb77,null));};exports[_0x7ced('0x5d')]=function(_0x25265f,_0xce8a33){var _0x16764d=_0x25265f['body'];return db['UserProfile']['find']({'where':{'id':_0x25265f['params']['id']}})[_0x7ced('0x48')](handleEntityNotFound(_0xce8a33,null))[_0x7ced('0x48')](function(_0x268d83){if(_0x268d83){return db[_0x7ced('0x54')][_0x7ced('0x5e')](function(_0x43fddc){return db[_0x7ced('0x55')][_0x7ced('0x28')]({'where':{'userProfileId':_0x25265f['params']['id'],'sectionId':_[_0x7ced('0x3f')](_0x16764d,function(_0x3aa504){return _0x3aa504[_0x7ced('0x58')];})},'transaction':_0x43fddc})[_0x7ced('0x48')](function(){var _0xed84c7=_[_0x7ced('0x3f')](_0x16764d,function(_0x11a50f){_0x11a50f[_0x7ced('0x59')]=_0x25265f[_0x7ced('0x4a')]['id'];return _0x11a50f;});var _0x5bfaba=[];return BPromise[_0x7ced('0x5f')](_0xed84c7,function(_0x27366c){return db[_0x7ced('0x55')][_0x7ced('0x4e')](_0x27366c,{'include':[{'model':db[_0x7ced('0x60')],'as':'Resources'}],'raw':!![],'transaction':_0x43fddc})[_0x7ced('0x48')](function(_0x2e2cf8){_0x5bfaba['push'](_0x2e2cf8[_0x7ced('0x50')]({'plain':!![]}));});})['then'](function(){return _0x5bfaba;});});});}})[_0x7ced('0x48')](function(_0x88bf22){return _0x88bf22;})['then'](respondWithResult(_0xce8a33,null))[_0x7ced('0x4d')](handleError(_0xce8a33,null));};exports[_0x7ced('0x61')]=function(_0x457349,_0x4ee98e){var _0x347fd1;return db[_0x7ced('0x2e')]['find']({'where':{'id':_0x457349['params']['id']},'attributes':['id',_0x7ced('0x2b')]})[_0x7ced('0x48')](handleEntityNotFound(_0x4ee98e,null))[_0x7ced('0x48')](function(_0x431fab){if(_0x431fab){_0x347fd1=_0x431fab;return db[_0x7ced('0x55')][_0x7ced('0x28')]({'where':{'userProfileId':_0x457349[_0x7ced('0x4a')]['id'],'sectionId':_0x457349[_0x7ced('0x31')][_0x7ced('0x62')]}});}})[_0x7ced('0x48')](function(){return _0x347fd1;})['then'](respondWithStatusCode(_0x4ee98e,null))[_0x7ced('0x4d')](handleError(_0x4ee98e,null));};exports['getSections']=function(_0xdba860,_0x38cc4d){var _0x24f060=[];var _0x578845=[];return db['UserProfileSection'][_0x7ced('0x46')]({'where':{'userProfileId':_0xdba860[_0x7ced('0x4a')]['id']},'raw':!![]})[_0x7ced('0x48')](function(_0x2ccca8){_0x24f060=_[_0x7ced('0x3d')](_0x2ccca8,function(_0x5a487b){return _0x5a487b['enabled']===0x1;});if(!_['isEmpty'](_0x24f060)){return _[_0x7ced('0x3f')](_0x24f060,function(_0x159d08){return _0x159d08[_0x7ced('0x58')];});}else{return;}})[_0x7ced('0x48')](function(_0x46bb3a){if(_0x46bb3a)_0x578845=_0x46bb3a;if(_['includes'](_0x578845,0x64)){var _0x55f0eb=_['find'](_0x24f060,{'sectionId':0x64});return hasDefaultDashboard(_0x55f0eb)['then'](function(_0x953054){return _['map'](_0x24f060,function(_0x395103){if(_0x395103['sectionId']===0x64){_0x395103[_0x7ced('0x63')]=_0x953054;}return _0x395103;});});}else{return;}})[_0x7ced('0x48')](function(_0x24f823){if(_0x24f823)_0x24f060=_0x24f823;if(_[_0x7ced('0x64')](_0x578845,0x3eb)||_[_0x7ced('0x65')](_0x24f060,{'enabled':![],'sectionId':0x3eb})){var _0x5838ce=_[_0x7ced('0x4c')](_0x24f060,{'sectionId':0x3eb});return getCustomDashboards(_0x5838ce)[_0x7ced('0x48')](function(_0x26302c){return _['map'](_0x24f060,function(_0x28de94){if(_0x28de94['sectionId']===0x3eb){_0x28de94[_0x7ced('0x63')]=_0x26302c;}return _0x28de94;});});}else{return;}})[_0x7ced('0x48')](function(_0x4714d9){if(_0x4714d9)_0x24f060=_0x4714d9;if(_[_0x7ced('0x64')](_0x578845,0x709)||_['some'](_0x24f060,{'enabled':![],'sectionId':0x709})){var _0x52d8e4=_[_0x7ced('0x4c')](_0x24f060,{'sectionId':0x709});return getPlugins(_0x52d8e4)['then'](function(_0x4df2ee){return _[_0x7ced('0x3f')](_0x24f060,function(_0x432b6b){if(_0x432b6b[_0x7ced('0x58')]===0x709){_0x432b6b[_0x7ced('0x63')]=_0x4df2ee;}return _0x432b6b;});});}else{return;}})[_0x7ced('0x48')](function(_0x76c9c8){if(_0x76c9c8)_0x24f060=_0x76c9c8;return _0x24f060;})[_0x7ced('0x48')](respondWithResult(_0x38cc4d,null))[_0x7ced('0x4d')](handleError(_0x38cc4d,null));};function hasDefaultDashboard(_0x5beed8){var _0x1c4ac3=[0x65];return new BPromise(function(_0x558388,_0x42936f){try{if(_0x5beed8[_0x7ced('0x56')]){_0x558388(_0x1c4ac3);}else{return db[_0x7ced('0x60')][_0x7ced('0x66')]({'where':{'sectionId':_0x5beed8['id']},'raw':!![]})[_0x7ced('0x48')](function(_0x5d7feb){if(_0x5d7feb){_0x558388(_0x1c4ac3);}});}}catch(_0x21ea02){_0x42936f(_0x21ea02);}});}function getCustomDashboards(_0x25f024){var _0xf33cf2=[];return new BPromise(function(_0x5cc709,_0x26a17a){try{if(_0x25f024[_0x7ced('0x56')]){return db[_0x7ced('0x67')]['findAll']({'raw':!![]})[_0x7ced('0x48')](function(_0x33cda8){_0x33cda8[_0x7ced('0x68')](function(_0x156653){_0xf33cf2[_0x7ced('0x69')](_0x156653['id']+0x1869f);});_0x5cc709(_0xf33cf2);});}else{return db[_0x7ced('0x60')][_0x7ced('0x46')]({'where':{'sectionId':_0x25f024['id']},'raw':!![]})[_0x7ced('0x48')](function(_0x2fa8f0){_0x2fa8f0[_0x7ced('0x68')](function(_0x26a47c){_0xf33cf2[_0x7ced('0x69')](_0x26a47c[_0x7ced('0x6a')]+0x1869f);});_0x5cc709(_0xf33cf2);});}}catch(_0x59c4af){_0x26a17a(_0x59c4af);}});}function getPlugins(_0x3c5a38){var _0x41a263=[];return new BPromise(function(_0x408363,_0x2cd986){try{if(_0x3c5a38['autoAssociation']){return db[_0x7ced('0x6b')][_0x7ced('0x46')]({'raw':!![]})[_0x7ced('0x48')](function(_0xd560d3){_0xd560d3[_0x7ced('0x68')](function(_0x4e67c4){_0x41a263[_0x7ced('0x69')](_0x4e67c4['id']+0x15b38);});_0x408363(_0x41a263);});}else{return db[_0x7ced('0x60')][_0x7ced('0x46')]({'where':{'sectionId':_0x3c5a38['id']},'raw':!![]})['then'](function(_0x267242){_0x267242[_0x7ced('0x68')](function(_0x11e0a7){_0x41a263[_0x7ced('0x69')](_0x11e0a7[_0x7ced('0x6a')]+0x15b38);});_0x408363(_0x41a263);});}}catch(_0x27d635){_0x2cd986(_0x27d635);}});}exports[_0x7ced('0x6c')]=function(_0x261e8a,_0x4a8d44){return db[_0x7ced('0x2e')][_0x7ced('0x4c')]({'where':{'id':_0x261e8a[_0x7ced('0x4a')]['id']}})['then'](handleEntityNotFound(_0x4a8d44,null))['then'](function(_0x27af73){if(_0x27af73){return db[_0x7ced('0x54')]['transaction'](function(_0x326a11){return db['UserProfileSection'][_0x7ced('0x46')]({'where':{'userProfileId':_0x261e8a[_0x7ced('0x4a')]['id']},'attributes':['id'],'raw':!![]})[_0x7ced('0x48')](function(_0x4f193d){if(_0x4f193d){return db['UserProfileSection'][_0x7ced('0x28')]({'where':{'userProfileId':_0x261e8a[_0x7ced('0x4a')]['id'],'id':_['map'](_0x4f193d,function(_0x39b882){return _0x39b882['id'];})},'transaction':_0x326a11});}})[_0x7ced('0x48')](function(_0xe96dbe){var _0x2db4c7=_[_0x7ced('0x3f')](_0x261e8a[_0x7ced('0x53')],function(_0x46531f){_0x46531f[_0x7ced('0x59')]=_0x261e8a['params']['id'];return _0x46531f;});return db[_0x7ced('0x55')][_0x7ced('0x6d')](_0x2db4c7,{'raw':!![],'transaction':_0x326a11});})[_0x7ced('0x48')](function(_0x1672bd){var _0x4d4da4=_[_0x7ced('0x3d')](_['map'](_0x1672bd,function(_0x28f149){return _0x28f149[_0x7ced('0x50')]({'plain':!![]});}),{'includeAll':![]});if(_0x4d4da4){return db[_0x7ced('0x55')]['findAll']({'where':{'userProfileId':_0x261e8a['params']['id'],'sectionId':_['map'](_0x4d4da4,function(_0x431c8e){return _0x431c8e[_0x7ced('0x58')];})},'attributes':['id','sectionId'],'raw':!![]})[_0x7ced('0x48')](function(_0x1765ea){var _0x25e329=_['map'](_0x261e8a[_0x7ced('0x53')],function(_0x17ee77){_0x17ee77[_0x7ced('0x59')]=_0x261e8a[_0x7ced('0x4a')]['id'];return _0x17ee77;});return db[_0x7ced('0x60')]['bulkCreate'](_0x25e329,{'raw':!![],'transaction':_0x326a11});});}})[_0x7ced('0x4d')](handleError(_0x4a8d44,null));});}})[_0x7ced('0x48')](function(_0x2688ed){var _0x595ac3=_[_0x7ced('0x3f')](_0x2688ed,function(_0x40c250){return _0x40c250['get']({'plain':!![]});});})[_0x7ced('0x48')](respondWithResult(_0x4a8d44,null))['catch'](handleError(_0x4a8d44,null));};exports[_0x7ced('0x6e')]=function(_0x57d41b,_0x1e9aef,_0x27930c){return db[_0x7ced('0x2e')][_0x7ced('0x4c')]({'where':{'id':_0x57d41b[_0x7ced('0x4a')]['id']}})[_0x7ced('0x48')](handleEntityNotFound(_0x1e9aef,null))[_0x7ced('0x48')](function(_0x1c51d2){if(_0x1c51d2){return _0x1c51d2[_0x7ced('0x6e')](_0x57d41b[_0x7ced('0x31')][_0x7ced('0x62')]);}})[_0x7ced('0x48')](respondWithStatusCode(_0x1e9aef,null))[_0x7ced('0x4d')](handleError(_0x1e9aef,null));};exports[_0x7ced('0x6f')]=function(_0x5a8df9,_0x4c1520){var _0x3b3431={'raw':![],'where':{}};var _0x2ce831={};var _0x56cad3={'count':0x0,'rows':[]};var _0x46d297=_0x5a8df9['query'][_0x7ced('0x70')];if(typeof _0x46d297===_0x7ced('0x71')){throw new db[(_0x7ced('0x72'))][(_0x7ced('0x73'))](_0x7ced('0x74'));}var _0xeb2919=_0x5a8df9[_0x7ced('0x31')][_0x7ced('0x75')]||![];var _0xbe89e5=getQueryModels(_0x46d297,_0xeb2919);if(typeof _0xbe89e5[_0x7ced('0x76')]===_0x7ced('0x71')){throw new db['Sequelize']['ValidationError'](_0x7ced('0x77')+_0x46d297+'\x27');}var _0x5c753e=[];if(!_['isEmpty'](_0xbe89e5[_0x7ced('0x78')])){_0x5c753e=_0xbe89e5[_0x7ced('0x78')];}else{_0x5c753e=[{'name':_0x46d297}];}return db[_0x7ced('0x2e')][_0x7ced('0x66')]({'where':{'id':_0x5a8df9[_0x7ced('0x4a')]['id']}})[_0x7ced('0x48')](handleEntityNotFound(_0x4c1520,null))['then'](function(_0x1fd095){if(_0x1fd095){var _0x4181b7=[];for(var _0x11b1c7=0x0;_0x11b1c7<_0x5c753e[_0x7ced('0x35')];_0x11b1c7++){_0x4181b7[_0x7ced('0x69')](db[_0x7ced('0x55')][_0x7ced('0x66')]({'where':{'userProfileId':_0x1fd095['id'],'name':_0x5c753e[_0x11b1c7][_0x7ced('0x2b')]},'raw':!![]}));}return BPromise[_0x7ced('0x79')](_0x4181b7);}})[_0x7ced('0x48')](function(_0x4180ea){var _0x348421=_[_0x7ced('0x3d')](_0x4180ea,function(_0x2726c2){return _0x2726c2?_0x2726c2:undefined;});var _0x27bf06=_[_0x7ced('0x3d')](_0x5c753e,[_0x7ced('0x7a'),!![]]);var _0x2ab7e6=_[_0x7ced('0x7b')](_0x348421)&&_[_0x7ced('0x7b')](_0x27bf06)?null:_[_0x7ced('0x7c')](_0x27bf06,_0x348421);if(_0x2ab7e6){var _0x270531=[];for(var _0x37ddc8=0x0;_0x37ddc8<_0x2ab7e6[_0x7ced('0x35')];_0x37ddc8++){var _0x3a7903=_[_0x7ced('0x4c')](_0x5c753e,function(_0x5d77c1){return _0x2ab7e6[_0x37ddc8]?_0x5d77c1[_0x7ced('0x2b')]===_0x2ab7e6[_0x37ddc8][_0x7ced('0x2b')]:null;});if(_0x3a7903){if(_0x2ab7e6[_0x37ddc8][_0x7ced('0x7a')]){_0x270531['push'](getAllResources(_0xbe89e5[_0x7ced('0x76')],_0x2ab7e6[_0x37ddc8]));}else{if(!_0x2ab7e6[_0x37ddc8][_0x7ced('0x56')]){_0x270531[_0x7ced('0x69')](getAllowedResources(_0x3a7903,_0x2ab7e6[_0x37ddc8],_0xbe89e5[_0x7ced('0x76')]));}else{if(_0x3a7903[_0x7ced('0x30')]){_0x270531['push'](getAllFilteredResources(_0x3a7903,_0x2ab7e6[_0x37ddc8]));}}}}}return BPromise['all'](_0x270531);}else{return null;}})['then'](function(_0x54f95c){var _0xf2a588=_0x54f95c;var _0x21513b=null;if(_0xf2a588){_0x21513b=_0xf2a588[_0x7ced('0x35')]===0x1?_0xf2a588[0x0]:null;}if(_0x21513b||_0xf2a588){var _0x1e4f9c=db[_0xbe89e5['childModel']][_0x7ced('0x2f')];_0x2ce831[_0x7ced('0x30')]=_[_0x7ced('0x4b')](_0x1e4f9c);_0x2ce831[_0x7ced('0x31')]=_[_0x7ced('0x4b')](_0x5a8df9[_0x7ced('0x31')]);_0x2ce831[_0x7ced('0x3b')]=_[_0x7ced('0x32')](_0x2ce831[_0x7ced('0x30')],_0x2ce831[_0x7ced('0x31')]);_0x3b3431[_0x7ced('0x33')]=_[_0x7ced('0x32')](_0x2ce831['model'],qs['fields'](_0x5a8df9[_0x7ced('0x31')][_0x7ced('0x34')]));_0x3b3431[_0x7ced('0x33')]=_0x3b3431[_0x7ced('0x33')]['length']?_0x3b3431['attributes']:_0x2ce831[_0x7ced('0x30')];if(!_0x5a8df9[_0x7ced('0x31')][_0x7ced('0x36')](_0x7ced('0x7d'))){_0x3b3431[_0x7ced('0x37')]=qs[_0x7ced('0x37')](_0x5a8df9[_0x7ced('0x31')][_0x7ced('0x37')]);_0x3b3431[_0x7ced('0x27')]=qs[_0x7ced('0x27')](_0x5a8df9[_0x7ced('0x31')]['offset']);}_0x3b3431[_0x7ced('0x38')]=qs[_0x7ced('0x39')](_0x5a8df9[_0x7ced('0x31')][_0x7ced('0x39')]);_0x3b3431[_0x7ced('0x3a')]=qs[_0x7ced('0x3b')](_[_0x7ced('0x3c')](_0x5a8df9[_0x7ced('0x31')],_0x2ce831[_0x7ced('0x3b')]));if(_0x5a8df9[_0x7ced('0x31')][_0x7ced('0x3d')]){_0x3b3431[_0x7ced('0x3a')]=_[_0x7ced('0x3e')](_0x3b3431['where'],{'$or':_['map'](_0x1e4f9c,function(_0x10de9b){if(_0x10de9b[_0x7ced('0x40')][_0x7ced('0x41')]!=='VIRTUAL'){var _0x2e1dde={};_0x2e1dde[_0x10de9b['field']]={'$like':'%'+_0x5a8df9['query'][_0x7ced('0x3d')]+'%'};return _0x2e1dde;}})});}var _0x998762=[];if(_0x21513b){var _0x328ebf=_['find'](_0x5c753e,[_0x7ced('0x2b'),_0x21513b['name']]);if(_0x328ebf['field']){var _0x7e5bd4={};if(_0xbe89e5[_0x7ced('0x76')]===_0x7ced('0x7e')){_0x7e5bd4[_0x328ebf[_0x7ced('0x7f')]]=_[_0x7ced('0x3f')](_0x21513b[_0x7ced('0x80')],'id');}else{_0x7e5bd4[_0x328ebf[_0x7ced('0x7f')]]=_0x21513b[_0x7ced('0x80')];}_0x998762[_0x7ced('0x69')](_0x7e5bd4);}else{_0x3b3431[_0x7ced('0x3a')]['id']=_0x21513b[_0x7ced('0x80')];}}else{for(var _0x1035fe=0x0;_0x1035fe<_0xf2a588[_0x7ced('0x35')];_0x1035fe++){var _0x328ebf=_[_0x7ced('0x4c')](_0x5c753e,[_0x7ced('0x2b'),_0xf2a588[_0x1035fe]['name']]);if(_0x328ebf[_0x7ced('0x81')]){var _0x7e5bd4={};_0x7e5bd4[_0x328ebf[_0x7ced('0x7f')]]=_0xf2a588[_0x1035fe][_0x7ced('0x80')];_0x998762[_0x7ced('0x69')](_0x7e5bd4);}else{if(!_0x3b3431[_0x7ced('0x3a')]['id'])_0x3b3431[_0x7ced('0x3a')]['id']=[];_0xf2a588[_0x1035fe][_0x7ced('0x80')][_0x7ced('0x68')](function(_0x8790af){_0x3b3431[_0x7ced('0x3a')]['id']['push'](_0x8790af);});}}}if(!_[_0x7ced('0x7b')](_0x998762)){_0x3b3431[_0x7ced('0x3a')]=_['merge'](_0x3b3431[_0x7ced('0x3a')],{'$and':{'$or':_0x998762}});}_0x3b3431=_[_0x7ced('0x3e')]({},_0x3b3431,_0x5a8df9[_0x7ced('0x43')]);if(_0x21513b&&!_0x21513b[_0x7ced('0x56')]&&_0xbe89e5[_0x7ced('0x76')]===_0x7ced('0x7e')){if(_0x5a8df9[_0x7ced('0x31')][_0x7ced('0x44')]){_0x3b3431[_0x7ced('0x45')]=[{'all':!![]}];}return db[_0xbe89e5[_0x7ced('0x76')]][_0x7ced('0x46')](_0x3b3431)[_0x7ced('0x48')](function(_0x6919){var _0xd125a9=[];_0x6919[_0x7ced('0x68')](function(_0x22c434){var _0x23b29e;switch(_0x22c434[_0x7ced('0x82')]){case _0x7ced('0x83'):_0x23b29e=_['find'](_0x21513b[_0x7ced('0x80')],function(_0x3c56c5){return _0x3c56c5['id']===_0x22c434[_0x7ced('0x84')]&&_0x3c56c5['type']===_0x7ced('0x85');});break;case _0x7ced('0x86'):_0x23b29e=_[_0x7ced('0x4c')](_0x21513b['associatedResources'],function(_0x9e512d){return _0x9e512d['id']===_0x22c434[_0x7ced('0x84')]&&_0x9e512d[_0x7ced('0x40')]===_0x7ced('0x87');});break;}if(_0x23b29e)_0xd125a9['push'](_0x22c434);});_0x56cad3[_0x7ced('0x26')]=_0xd125a9[_0x7ced('0x35')];_0x56cad3[_0x7ced('0x47')]=_0xd125a9;return _0x56cad3;});}else{return db[_0xbe89e5[_0x7ced('0x76')]][_0x7ced('0x26')]({'where':_0x3b3431[_0x7ced('0x3a')]})['then'](function(_0x4ba8bd){_0x56cad3['count']=_0x4ba8bd;if(_0x5a8df9[_0x7ced('0x31')][_0x7ced('0x44')]){if(_0xbe89e5[_0x7ced('0x76')]===_0x7ced('0x88')){_0x3b3431[_0x7ced('0x45')]=[{'model':db['Tag'],'as':_0x7ced('0x89'),'attributes':['id',_0x7ced('0x2b'),'color'],'required':_0x5a8df9[_0x7ced('0x31')][_0x7ced('0x8a')]?!![]:![]},{'model':db[_0x7ced('0x8b')],'as':_0x7ced('0x8c'),'attributes':['id',_0x7ced('0x2b'),_0x7ced('0x8d')],'through':_0x5a8df9[_0x7ced('0x31')][_0x7ced('0x8a')]?{'attributes':[],'where':{'TagId':_0x5a8df9['query'][_0x7ced('0x8a')]||undefined}}:{},'required':_0x5a8df9[_0x7ced('0x31')][_0x7ced('0x8a')]?!![]:![]}];}else{_0x3b3431[_0x7ced('0x45')]=[{'all':!![]}];}}return db[_0xbe89e5[_0x7ced('0x76')]][_0x7ced('0x46')](_0x3b3431);})['then'](function(_0x5dfd9e){_0x56cad3[_0x7ced('0x47')]=_0x5dfd9e;return _0x56cad3;});}}else{return _0x56cad3;}})[_0x7ced('0x48')](respondWithFilteredResult(_0x4c1520,_0x3b3431))[_0x7ced('0x4d')](handleError(_0x4c1520,null));};function getAllResources(_0x3ec815,_0x26ac4f){return new BPromise(function(_0x8c9672,_0x4d870e){if(_0x26ac4f){var _0x22c33a=_0x26ac4f[_0x7ced('0x3d')]?{[_0x26ac4f[_0x7ced('0x3d')][_0x7ced('0x81')]]:_0x26ac4f[_0x7ced('0x3d')]['value']}:undefined;return db[_0x3ec815]['findAll']({'where':_0x22c33a,'raw':!![]})[_0x7ced('0x48')](function(_0x1bce29){_0x26ac4f[_0x7ced('0x80')]=_['map'](_0x1bce29,'id');_0x8c9672(_0x26ac4f);})[_0x7ced('0x4d')](function(_0x2ad66f){_0x4d870e(_0x2ad66f);});}else{_0x8c9672(null);}});}function getAllFilteredResources(_0x475811,_0x359f0e){return new BPromise(function(_0x2e0e22,_0x3b043d){var _0x29890b=_0x475811[_0x7ced('0x3d')]?{[_0x475811[_0x7ced('0x3d')][_0x7ced('0x81')]]:_0x475811['filter'][_0x7ced('0x8e')]}:undefined;return db[_0x475811['model']][_0x7ced('0x46')]({'where':_0x29890b,'raw':!![]})[_0x7ced('0x48')](function(_0x2252e3){_0x359f0e['associatedResources']=_[_0x7ced('0x3f')](_0x2252e3,function(_0x487d6b){return _0x487d6b[_0x7ced('0x2b')];});_0x2e0e22(_0x359f0e);})['catch'](function(_0x275ce5){_0x3b043d(_0x275ce5);});});}function getAllowedResources(_0x3a982c,_0x8464e0,_0x4fea75){return new BPromise(function(_0x4c3b8c,_0x103de9){if(_0x8464e0){return db[_0x7ced('0x60')][_0x7ced('0x46')]({'where':{'sectionId':_0x8464e0['id']},'raw':!![]})[_0x7ced('0x48')](function(_0x496f1d){if(_0x3a982c['field']&&_0x3a982c['field']!=='id'){_0x8464e0[_0x7ced('0x80')]=_[_0x7ced('0x3f')](_0x496f1d,function(_0xfa2531){return _0xfa2531[_0x3a982c[_0x7ced('0x81')]];});}else{if(_0x4fea75===_0x7ced('0x7e')){_0x8464e0['associatedResources']=_[_0x7ced('0x3f')](_0x496f1d,function(_0x258ec6){return{'id':_0x258ec6[_0x7ced('0x6a')],'type':_0x258ec6[_0x7ced('0x40')]};});}else{_0x8464e0[_0x7ced('0x80')]=_['map'](_0x496f1d,function(_0x57afc4){return _0x57afc4[_0x7ced('0x6a')];});}}_0x4c3b8c(_0x8464e0);})[_0x7ced('0x4d')](function(_0x4cb215){_0x103de9(_0x4cb215);});}else{_0x4c3b8c(null);}});}function getQueryModels(_0x2e4713,_0xfa3645){var _0x13ebe5=_0x2e4713[_0x7ced('0x8f')]();var _0x464edf={'childModel':undefined,'parentSections':[]};switch(_0x13ebe5){case _0x7ced('0x90'):_0x464edf['childModel']=_0x7ced('0x91');break;case _0x7ced('0x92'):_0x464edf[_0x7ced('0x76')]=_0x7ced('0x93');break;case _0x7ced('0x94'):_0x464edf[_0x7ced('0x76')]=_0x7ced('0x95');_0x464edf['parentSections']=[{'name':_0x7ced('0x96'),'field':'name','foreignKey':'projectName'}];break;case _0x7ced('0x97'):_0x464edf[_0x7ced('0x76')]=_0x7ced('0x98');break;case'contacts':_0x464edf[_0x7ced('0x76')]=_0x7ced('0x88');_0x464edf[_0x7ced('0x78')]=[{'name':_0x7ced('0x99'),'field':'id','foreignKey':_0x7ced('0x9a')}];break;case _0x7ced('0x9b'):_0x464edf[_0x7ced('0x76')]=_0x7ced('0x9c');break;case _0x7ced('0x9d'):_0x464edf[_0x7ced('0x76')]='CmCompany';break;case _0x7ced('0x9e'):_0x464edf[_0x7ced('0x76')]=_0x7ced('0x9f');break;case'chatqueues':_0x464edf[_0x7ced('0x76')]=_0x7ced('0xa0');break;case _0x7ced('0xa1'):_0x464edf['childModel']=_0x7ced('0xa2');break;case _0x7ced('0xa3'):_0x464edf[_0x7ced('0x76')]=_0x7ced('0xa4');break;case'faxaccounts':_0x464edf['childModel']=_0x7ced('0xa5');break;case _0x7ced('0xa6'):case _0x7ced('0xa7'):case'outboundroutes':_0x464edf['childModel']=_0x7ced('0xa8');break;case _0x7ced('0xa9'):_0x464edf[_0x7ced('0x76')]=_0x7ced('0xaa');break;case _0x7ced('0xab'):_0x464edf[_0x7ced('0x76')]=_0x7ced('0xac');break;case _0x7ced('0xad'):_0x464edf[_0x7ced('0x76')]=_0x7ced('0xae');_0x464edf['parentSections']=[{'name':_0x7ced('0xaf'),'field':_0x7ced('0x2b'),'foreignKey':'membername','model':_0x7ced('0xb0'),'filter':{'field':_0x7ced('0xb1'),'value':[_0x7ced('0xb2')]}},{'name':_0x7ced('0xb3'),'field':'name','foreignKey':'membername','model':_0x7ced('0xb0'),'filter':{'field':_0x7ced('0xb1'),'value':[_0x7ced('0xb4')]}},{'name':'VoiceQueues','field':_0x7ced('0x2b'),'foreignKey':_0x7ced('0xb5'),'model':_0x7ced('0xb6'),'filter':{'field':'type','value':['inbound']}},{'name':_0x7ced('0xb7'),'field':_0x7ced('0x2b'),'foreignKey':'queue','model':_0x7ced('0xb6'),'filter':{'field':'type','value':['outbound']}}];break;case'musiconholds':_0x464edf[_0x7ced('0x76')]=_0x7ced('0xb8');break;case _0x7ced('0xb9'):_0x464edf[_0x7ced('0x76')]=_0x7ced('0xba');break;case _0x7ced('0xbb'):_0x464edf[_0x7ced('0x76')]=_0x7ced('0xbc');break;case'ivrcampaigns':_0x464edf[_0x7ced('0x76')]=_0x7ced('0xbd');break;case'mailqueues':_0x464edf['childModel']=_0x7ced('0xbe');break;case _0x7ced('0xbf'):_0x464edf[_0x7ced('0x76')]=_0x7ced('0xc0');break;case _0x7ced('0xc1'):_0x464edf[_0x7ced('0x76')]='MailSubstatus';break;case _0x7ced('0xc2'):_0x464edf[_0x7ced('0x76')]=_0x7ced('0xc3');break;case _0x7ced('0xc4'):_0x464edf[_0x7ced('0x76')]=_0x7ced('0xc5');break;case _0x7ced('0xc6'):_0x464edf['childModel']=_0x7ced('0xc7');break;case _0x7ced('0xc8'):_0x464edf[_0x7ced('0x76')]='SmsAccount';break;case _0x7ced('0xc9'):_0x464edf[_0x7ced('0x76')]=_0x7ced('0xca');break;case _0x7ced('0xcb'):case'queuecampaigns':_0x464edf['childModel']='VoiceQueue';if(_0xfa3645){_0x464edf[_0x7ced('0x78')]=[{'name':_0x7ced('0xcc')},{'name':_0x7ced('0xb7')}];}break;case _0x7ced('0xcd'):case _0x7ced('0xce'):case _0x7ced('0xcf'):_0x464edf[_0x7ced('0x76')]=_0x7ced('0xb0');if(_0xfa3645){_0x464edf['parentSections']=[{'name':_0x7ced('0xd0'),'filter':{'field':_0x7ced('0xb1'),'value':[_0x7ced('0xd1'),'user']},'ignore':!![]},{'name':_0x7ced('0xaf')},{'name':'Telephones'}];}break;case _0x7ced('0xd2'):_0x464edf['childModel']=_0x7ced('0xd3');break;case'salesforceaccounts':_0x464edf[_0x7ced('0x76')]=_0x7ced('0xd4');break;case _0x7ced('0xd5'):_0x464edf[_0x7ced('0x76')]=_0x7ced('0xd6');break;case'sugarcrmaccounts':_0x464edf[_0x7ced('0x76')]='SugarcrmAccount';break;case'deskaccounts':_0x464edf[_0x7ced('0x76')]=_0x7ced('0xd7');break;case _0x7ced('0xd8'):_0x464edf[_0x7ced('0x76')]='ZohoAccount';break;case _0x7ced('0xd9'):_0x464edf[_0x7ced('0x76')]=_0x7ced('0xb0');break;case _0x7ced('0xda'):_0x464edf[_0x7ced('0x76')]=_0x7ced('0xdb');break;case _0x7ced('0xdc'):_0x464edf['childModel']=_0x7ced('0xdd');break;case _0x7ced('0xde'):_0x464edf[_0x7ced('0x76')]='Dashboard';break;case _0x7ced('0xdf'):_0x464edf['childModel']='Interval';break;case'pauses':_0x464edf['childModel']=_0x7ced('0xe0');break;case _0x7ced('0xe1'):_0x464edf[_0x7ced('0x76')]=_0x7ced('0xe2');break;case _0x7ced('0xe3'):_0x464edf[_0x7ced('0x76')]=_0x7ced('0xe4');break;case _0x7ced('0xe5'):_0x464edf[_0x7ced('0x76')]=_0x7ced('0x8b');break;case _0x7ced('0xe6'):_0x464edf[_0x7ced('0x76')]=_0x7ced('0xe7');break;case _0x7ced('0xe8'):_0x464edf['childModel']='Trigger';break;case _0x7ced('0xe9'):_0x464edf[_0x7ced('0x76')]=_0x7ced('0xea');break;case _0x7ced('0xeb'):_0x464edf[_0x7ced('0x76')]=_0x7ced('0xec');break;case _0x7ced('0xed'):_0x464edf[_0x7ced('0x76')]=_0x7ced('0x6b');break;case'extractedreports':_0x464edf[_0x7ced('0x76')]=_0x7ced('0x7e');_0x464edf[_0x7ced('0x78')]=[{'name':_0x7ced('0xee'),'field':'id','foreignKey':_0x7ced('0x84')}];break;case'metrics':_0x464edf[_0x7ced('0x76')]=_0x7ced('0xef');break;default:return _0x464edf;}return _0x464edf;} \ No newline at end of file diff --git a/server/api/userProfile/userProfile.events.js b/server/api/userProfile/userProfile.events.js index b654384..db7ece0 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 _0x48a8=['events','../../mysqldb','UserProfile','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x1ab5db,_0x7ab820){var _0x3b398f=function(_0x50504d){while(--_0x50504d){_0x1ab5db['push'](_0x1ab5db['shift']());}};_0x3b398f(++_0x7ab820);}(_0x48a8,0x12c));var _0x848a=function(_0x5c2505,_0x2e34bd){_0x5c2505=_0x5c2505-0x0;var _0x7e42c4=_0x48a8[_0x5c2505];return _0x7e42c4;};'use strict';var EventEmitter=require(_0x848a('0x0'));var UserProfile=require(_0x848a('0x1'))['db'][_0x848a('0x2')];var UserProfileEvents=new EventEmitter();UserProfileEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x848a('0x3'),'afterUpdate':_0x848a('0x4'),'afterDestroy':_0x848a('0x5')};function emitEvent(_0x61713){return function(_0x12868d,_0x2ad33e,_0x4123d6){UserProfileEvents[_0x848a('0x6')](_0x61713+':'+_0x12868d['id'],_0x12868d);UserProfileEvents[_0x848a('0x6')](_0x61713,_0x12868d);_0x4123d6(null);};}for(var e in events){if(events[_0x848a('0x7')](e)){var event=events[e];UserProfile[_0x848a('0x8')](e,emitEvent(event));}}module[_0x848a('0x9')]=UserProfileEvents; \ No newline at end of file +var _0x3c8b=['save','update','emit','hasOwnProperty','exports','events','../../mysqldb','UserProfile'];(function(_0x2d0da9,_0x54d406){var _0xbb1638=function(_0x26352e){while(--_0x26352e){_0x2d0da9['push'](_0x2d0da9['shift']());}};_0xbb1638(++_0x54d406);}(_0x3c8b,0x19d));var _0xb3c8=function(_0x457ee5,_0x49570b){_0x457ee5=_0x457ee5-0x0;var _0x306a71=_0x3c8b[_0x457ee5];return _0x306a71;};'use strict';var EventEmitter=require(_0xb3c8('0x0'));var UserProfile=require(_0xb3c8('0x1'))['db'][_0xb3c8('0x2')];var UserProfileEvents=new EventEmitter();UserProfileEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xb3c8('0x3'),'afterUpdate':_0xb3c8('0x4'),'afterDestroy':'remove'};function emitEvent(_0x7e5e36){return function(_0x242618,_0x4d03fd,_0x5e21c3){UserProfileEvents[_0xb3c8('0x5')](_0x7e5e36+':'+_0x242618['id'],_0x242618);UserProfileEvents[_0xb3c8('0x5')](_0x7e5e36,_0x242618);_0x5e21c3(null);};}for(var e in events){if(events[_0xb3c8('0x6')](e)){var event=events[e];UserProfile['hook'](e,emitEvent(event));}}module[_0xb3c8('0x7')]=UserProfileEvents; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.model.js b/server/api/userProfile/userProfile.model.js index 78ffe69..0b3baa0 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 _0xc134=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./userProfile.attributes','UserProfile','user_profiles','util','../../config/logger','api'];(function(_0x3217b6,_0x2ab5f9){var _0x460c8e=function(_0x1651eb){while(--_0x1651eb){_0x3217b6['push'](_0x3217b6['shift']());}};_0x460c8e(++_0x2ab5f9);}(_0xc134,0x135));var _0x4c13=function(_0x4553ff,_0x2ea3a0){_0x4553ff=_0x4553ff-0x0;var _0x558a4=_0xc134[_0x4553ff];return _0x558a4;};'use strict';var _=require('lodash');var util=require(_0x4c13('0x0'));var logger=require(_0x4c13('0x1'))(_0x4c13('0x2'));var moment=require(_0x4c13('0x3'));var BPromise=require(_0x4c13('0x4'));var rp=require(_0x4c13('0x5'));var fs=require('fs');var path=require(_0x4c13('0x6'));var rimraf=require(_0x4c13('0x7'));var config=require(_0x4c13('0x8'));var attributes=require(_0x4c13('0x9'));module['exports']=function(_0x5e94bd,_0x4a3396){return _0x5e94bd['define'](_0x4c13('0xa'),attributes,{'tableName':_0x4c13('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0c80=['./userProfile.attributes','exports','define','UserProfile','user_profiles','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x5401ae,_0x5e58ac){var _0x286068=function(_0x2cac88){while(--_0x2cac88){_0x5401ae['push'](_0x5401ae['shift']());}};_0x286068(++_0x5e58ac);}(_0x0c80,0xbb));var _0x00c8=function(_0x51020b,_0x38c2c7){_0x51020b=_0x51020b-0x0;var _0x371e47=_0x0c80[_0x51020b];return _0x371e47;};'use strict';var _=require('lodash');var util=require(_0x00c8('0x0'));var logger=require(_0x00c8('0x1'))(_0x00c8('0x2'));var moment=require(_0x00c8('0x3'));var BPromise=require(_0x00c8('0x4'));var rp=require(_0x00c8('0x5'));var fs=require('fs');var path=require(_0x00c8('0x6'));var rimraf=require('rimraf');var config=require(_0x00c8('0x7'));var attributes=require(_0x00c8('0x8'));module[_0x00c8('0x9')]=function(_0x56a88e,_0x20902f){return _0x56a88e[_0x00c8('0xa')](_0x00c8('0xb'),attributes,{'tableName':_0x00c8('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.rpc.js b/server/api/userProfile/userProfile.rpc.js index 4fa4426..f632e38 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 _0xf494=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./userProfile.socket','register','request','request\x20sent','debug','stringify','error','code','UserProfile,\x20%s,\x20%s','message','info','lodash','util','moment','randomstring','ioredis'];(function(_0x1b3224,_0x3351d9){var _0x5dae4f=function(_0x22894a){while(--_0x22894a){_0x1b3224['push'](_0x1b3224['shift']());}};_0x5dae4f(++_0x3351d9);}(_0xf494,0x1c6));var _0x4f49=function(_0x4a44af,_0x53a79f){_0x4a44af=_0x4a44af-0x0;var _0x6b8e36=_0xf494[_0x4a44af];return _0x6b8e36;};'use strict';var _=require(_0x4f49('0x0'));var util=require(_0x4f49('0x1'));var moment=require(_0x4f49('0x2'));var BPromise=require('bluebird');var rs=require(_0x4f49('0x3'));var fs=require('fs');var Redis=require(_0x4f49('0x4'));var db=require(_0x4f49('0x5'))['db'];var utils=require(_0x4f49('0x6'));var logger=require(_0x4f49('0x7'))(_0x4f49('0x8'));var config=require(_0x4f49('0x9'));var jayson=require(_0x4f49('0xa'));var client=jayson[_0x4f49('0xb')][_0x4f49('0xc')]({'port':0x232a});config[_0x4f49('0xd')]=_['defaults'](config['redis'],{'host':_0x4f49('0xe'),'port':0x18eb});var socket=require(_0x4f49('0xf'))(new Redis(config[_0x4f49('0xd')]));require(_0x4f49('0x10'))[_0x4f49('0x11')](socket);function respondWithRpcPromise(_0x174d0d,_0x151d8c,_0x410884){return new BPromise(function(_0x53ee74,_0x3e464f){return client[_0x4f49('0x12')](_0x174d0d,_0x410884)['then'](function(_0x15e7a1){logger['info']('UserProfile,\x20%s,\x20%s',_0x151d8c,_0x4f49('0x13'));logger[_0x4f49('0x14')]('UserProfile,\x20%s,\x20%s,\x20%s',_0x151d8c,_0x4f49('0x13'),JSON[_0x4f49('0x15')](_0x15e7a1));if(_0x15e7a1[_0x4f49('0x16')]){if(_0x15e7a1[_0x4f49('0x16')][_0x4f49('0x17')]===0x1f4){logger[_0x4f49('0x16')](_0x4f49('0x18'),_0x151d8c,_0x15e7a1['error'][_0x4f49('0x19')]);return _0x3e464f(_0x15e7a1[_0x4f49('0x16')][_0x4f49('0x19')]);}logger['error']('UserProfile,\x20%s,\x20%s',_0x151d8c,_0x15e7a1[_0x4f49('0x16')][_0x4f49('0x19')]);return _0x53ee74(_0x15e7a1[_0x4f49('0x16')]['message']);}else{logger[_0x4f49('0x1a')](_0x4f49('0x18'),_0x151d8c,_0x4f49('0x13'));_0x53ee74(_0x15e7a1['result']['message']);}})['catch'](function(_0x47f1e8){logger[_0x4f49('0x16')](_0x4f49('0x18'),_0x151d8c,_0x47f1e8);_0x3e464f(_0x47f1e8);});});} \ No newline at end of file +var _0xd8fb=['http','defaults','localhost','socket.io-emitter','register','info','UserProfile,\x20%s,\x20%s','debug','UserProfile,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','lodash','util','moment','bluebird','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0x4bcb7c,_0x564ac5){var _0x321ad7=function(_0x501065){while(--_0x501065){_0x4bcb7c['push'](_0x4bcb7c['shift']());}};_0x321ad7(++_0x564ac5);}(_0xd8fb,0x99));var _0xbd8f=function(_0x12bd6b,_0x26c1d0){_0x12bd6b=_0x12bd6b-0x0;var _0x138d8d=_0xd8fb[_0x12bd6b];return _0x138d8d;};'use strict';var _=require(_0xbd8f('0x0'));var util=require(_0xbd8f('0x1'));var moment=require(_0xbd8f('0x2'));var BPromise=require(_0xbd8f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xbd8f('0x4'));var logger=require(_0xbd8f('0x5'))('rpc');var config=require(_0xbd8f('0x6'));var jayson=require(_0xbd8f('0x7'));var client=jayson['client'][_0xbd8f('0x8')]({'port':0x232a});config['redis']=_[_0xbd8f('0x9')](config['redis'],{'host':_0xbd8f('0xa'),'port':0x18eb});var socket=require(_0xbd8f('0xb'))(new Redis(config['redis']));require('./userProfile.socket')[_0xbd8f('0xc')](socket);function respondWithRpcPromise(_0x2393a9,_0x2a55b5,_0x53a2c6){return new BPromise(function(_0x255af3,_0x42ae20){return client['request'](_0x2393a9,_0x53a2c6)['then'](function(_0x342bcb){logger[_0xbd8f('0xd')](_0xbd8f('0xe'),_0x2a55b5,'request\x20sent');logger[_0xbd8f('0xf')](_0xbd8f('0x10'),_0x2a55b5,_0xbd8f('0x11'),JSON[_0xbd8f('0x12')](_0x342bcb));if(_0x342bcb[_0xbd8f('0x13')]){if(_0x342bcb[_0xbd8f('0x13')][_0xbd8f('0x14')]===0x1f4){logger[_0xbd8f('0x13')](_0xbd8f('0xe'),_0x2a55b5,_0x342bcb['error'][_0xbd8f('0x15')]);return _0x42ae20(_0x342bcb[_0xbd8f('0x13')][_0xbd8f('0x15')]);}logger[_0xbd8f('0x13')]('UserProfile,\x20%s,\x20%s',_0x2a55b5,_0x342bcb[_0xbd8f('0x13')][_0xbd8f('0x15')]);return _0x255af3(_0x342bcb['error'][_0xbd8f('0x15')]);}else{logger[_0xbd8f('0xd')]('UserProfile,\x20%s,\x20%s',_0x2a55b5,_0xbd8f('0x11'));_0x255af3(_0x342bcb[_0xbd8f('0x16')]['message']);}})['catch'](function(_0x33f77c){logger['error']('UserProfile,\x20%s,\x20%s',_0x2a55b5,_0x33f77c);_0x42ae20(_0x33f77c);});});} \ No newline at end of file diff --git a/server/api/userProfile/userProfile.socket.js b/server/api/userProfile/userProfile.socket.js index a51140c..28860d6 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 _0xd3da=['./userProfile.events','save','update','emit','register','length'];(function(_0x5f20b3,_0x1fba4d){var _0x20e8bb=function(_0x5ed10d){while(--_0x5ed10d){_0x5f20b3['push'](_0x5f20b3['shift']());}};_0x20e8bb(++_0x1fba4d);}(_0xd3da,0x180));var _0xad3d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd3da[_0x3dd15e];return _0x231fd0;};'use strict';var UserProfileEvents=require(_0xad3d('0x0'));var events=[_0xad3d('0x1'),'remove',_0xad3d('0x2')];function createListener(_0x226733,_0xfa120f){return function(_0x40d832){_0xfa120f[_0xad3d('0x3')](_0x226733,_0x40d832);};}function removeListener(_0x59e331,_0x5260a3){return function(){UserProfileEvents['removeListener'](_0x59e331,_0x5260a3);};}exports[_0xad3d('0x4')]=function(_0x1421eb){for(var _0x331ce7=0x0,_0x52fab5=events[_0xad3d('0x5')];_0x331ce7<_0x52fab5;_0x331ce7++){var _0x3399dd=events[_0x331ce7];var _0x5e8148=createListener('userProfile:'+_0x3399dd,_0x1421eb);UserProfileEvents['on'](_0x3399dd,_0x5e8148);}}; \ No newline at end of file +var _0x677a=['length','./userProfile.events','save','update','removeListener','register'];(function(_0x5ba24b,_0x198755){var _0x3f84a8=function(_0x563cfb){while(--_0x563cfb){_0x5ba24b['push'](_0x5ba24b['shift']());}};_0x3f84a8(++_0x198755);}(_0x677a,0xd3));var _0xa677=function(_0x3ddfde,_0x4ab1ac){_0x3ddfde=_0x3ddfde-0x0;var _0x3b845c=_0x677a[_0x3ddfde];return _0x3b845c;};'use strict';var UserProfileEvents=require(_0xa677('0x0'));var events=[_0xa677('0x1'),'remove',_0xa677('0x2')];function createListener(_0xd2cf50,_0x363bdf){return function(_0x58613a){_0x363bdf['emit'](_0xd2cf50,_0x58613a);};}function removeListener(_0x22cc67,_0x2174af){return function(){UserProfileEvents[_0xa677('0x3')](_0x22cc67,_0x2174af);};}exports[_0xa677('0x4')]=function(_0x2eb82b){for(var _0x233d05=0x0,_0x3bd2fc=events[_0xa677('0x5')];_0x233d05<_0x3bd2fc;_0x233d05++){var _0x2c825c=events[_0x233d05];var _0x1f6a3a=createListener('userProfile:'+_0x2c825c,_0x2eb82b);UserProfileEvents['on'](_0x2c825c,_0x1f6a3a);}}; \ No newline at end of file diff --git a/server/api/userProfileResource/index.js b/server/api/userProfileResource/index.js index 014e081..edf68c4 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 _0x4170=['connect-timeout','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/describe','describe','show','post','create','update','delete','/:id','destroy','multer','util','path'];(function(_0x3dd78c,_0x3fc775){var _0x56e423=function(_0x7e027e){while(--_0x7e027e){_0x3dd78c['push'](_0x3dd78c['shift']());}};_0x56e423(++_0x3fc775);}(_0x4170,0x166));var _0x0417=function(_0x36d470,_0x2676bb){_0x36d470=_0x36d470-0x0;var _0x52c9b4=_0x4170[_0x36d470];return _0x52c9b4;};'use strict';var multer=require(_0x0417('0x0'));var util=require(_0x0417('0x1'));var path=require(_0x0417('0x2'));var timeout=require(_0x0417('0x3'));var express=require('express');var router=express[_0x0417('0x4')]();var auth=require(_0x0417('0x5'));var interaction=require(_0x0417('0x6'));var config=require('../../config/environment');var controller=require('./userProfileResource.controller');router[_0x0417('0x7')]('/',auth[_0x0417('0x8')](),controller[_0x0417('0x9')]);router[_0x0417('0x7')](_0x0417('0xa'),auth[_0x0417('0x8')](),controller[_0x0417('0xb')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x0417('0xc')]);router[_0x0417('0xd')]('/',auth[_0x0417('0x8')](),controller[_0x0417('0xe')]);router['put']('/:id',auth[_0x0417('0x8')](),controller[_0x0417('0xf')]);router[_0x0417('0x10')](_0x0417('0x11'),auth[_0x0417('0x8')](),controller[_0x0417('0x12')]);module['exports']=router; \ No newline at end of file +var _0x4205=['show','isAuthenticated','create','put','/:id','delete','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','describe'];(function(_0x100682,_0x11afec){var _0xcb6e87=function(_0x3ef421){while(--_0x3ef421){_0x100682['push'](_0x100682['shift']());}};_0xcb6e87(++_0x11afec);}(_0x4205,0x1b6));var _0x5420=function(_0x1b6b59,_0x5f08bf){_0x1b6b59=_0x1b6b59-0x0;var _0x1edec5=_0x4205[_0x1b6b59];return _0x1edec5;};'use strict';var multer=require(_0x5420('0x0'));var util=require('util');var path=require(_0x5420('0x1'));var timeout=require(_0x5420('0x2'));var express=require(_0x5420('0x3'));var router=express[_0x5420('0x4')]();var auth=require(_0x5420('0x5'));var interaction=require(_0x5420('0x6'));var config=require(_0x5420('0x7'));var controller=require('./userProfileResource.controller');router[_0x5420('0x8')]('/',auth['isAuthenticated'](),controller[_0x5420('0x9')]);router[_0x5420('0x8')](_0x5420('0xa'),auth['isAuthenticated'](),controller[_0x5420('0xb')]);router[_0x5420('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x5420('0xc')]);router['post']('/',auth[_0x5420('0xd')](),controller[_0x5420('0xe')]);router[_0x5420('0xf')](_0x5420('0x10'),auth['isAuthenticated'](),controller['update']);router[_0x5420('0x11')](_0x5420('0x10'),auth[_0x5420('0xd')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.attributes.js b/server/api/userProfileResource/userProfileResource.attributes.js index b34bf0c..4d08e67 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 _0x5ddd=['STRING','INTEGER','sequelize','exports'];(function(_0x1b6c6d,_0x2983b0){var _0x290d9d=function(_0x5b9779){while(--_0x5b9779){_0x1b6c6d['push'](_0x1b6c6d['shift']());}};_0x290d9d(++_0x2983b0);}(_0x5ddd,0x116));var _0xd5dd=function(_0x2cbd58,_0x278e75){_0x2cbd58=_0x2cbd58-0x0;var _0x42ef2a=_0x5ddd[_0x2cbd58];return _0x42ef2a;};'use strict';var Sequelize=require(_0xd5dd('0x0'));module[_0xd5dd('0x1')]={'name':{'type':Sequelize[_0xd5dd('0x2')],'allowNull':![]},'resourceId':{'type':Sequelize[_0xd5dd('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xd5dd('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x816a=['STRING','sequelize','exports','INTEGER'];(function(_0x52826c,_0x3c3896){var _0x1b8c9b=function(_0x1aa6f5){while(--_0x1aa6f5){_0x52826c['push'](_0x52826c['shift']());}};_0x1b8c9b(++_0x3c3896);}(_0x816a,0x10d));var _0xa816=function(_0x277f42,_0x5cf16d){_0x277f42=_0x277f42-0x0;var _0x49c20f=_0x816a[_0x277f42];return _0x49c20f;};'use strict';var Sequelize=require(_0xa816('0x0'));module[_0xa816('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'resourceId':{'type':Sequelize[_0xa816('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xa816('0x3')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.controller.js b/server/api/userProfileResource/userProfileResource.controller.js index 08f3f61..43cda88 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 _0x5e53=['order','sort','where','filter','map','type','key','field','merge','options','UserProfileResource','count','includeAll','include','show','params','rawAttributes','catch','body','find','describe','html-pdf','eml-format','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','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','sendStatus','status','end','json','offset','limit','set','Content-Range','reject','update','then','destroy','error','stack','name','send','index','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit'];(function(_0x2700ad,_0x417ccc){var _0x295953=function(_0x25e830){while(--_0x25e830){_0x2700ad['push'](_0x2700ad['shift']());}};_0x295953(++_0x417ccc);}(_0x5e53,0xa7));var _0x35e5=function(_0x5108fd,_0x5be96e){_0x5108fd=_0x5108fd-0x0;var _0x1da98c=_0x5e53[_0x5108fd];return _0x1da98c;};'use strict';var pdf=require(_0x35e5('0x0'));var emlformat=require(_0x35e5('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x35e5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x35e5('0x3'));var moment=require(_0x35e5('0x4'));var BPromise=require(_0x35e5('0x5'));var Mustache=require('mustache');var util=require(_0x35e5('0x6'));var path=require(_0x35e5('0x7'));var sox=require(_0x35e5('0x8'));var csv=require(_0x35e5('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x35e5('0xa'));var squel=require('squel');var crypto=require(_0x35e5('0xb'));var jsforce=require(_0x35e5('0xc'));var deskjs=require(_0x35e5('0xd'));var toCsv=require(_0x35e5('0x9'));var querystring=require(_0x35e5('0xe'));var Papa=require(_0x35e5('0xf'));var Redis=require(_0x35e5('0x10'));var authService=require(_0x35e5('0x11'));var qs=require(_0x35e5('0x12'));var as=require(_0x35e5('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x35e5('0x14'))(_0x35e5('0x15'));var utils=require(_0x35e5('0x16'));var config=require(_0x35e5('0x17'));var db=require(_0x35e5('0x18'))['db'];function respondWithStatusCode(_0x803886,_0x2574c5){_0x2574c5=_0x2574c5||0xcc;return function(_0x293837){if(_0x293837){return _0x803886[_0x35e5('0x19')](_0x2574c5);}return _0x803886[_0x35e5('0x1a')](_0x2574c5)[_0x35e5('0x1b')]();};}function respondWithResult(_0x372bec,_0x524dbe){_0x524dbe=_0x524dbe||0xc8;return function(_0x1ff8d6){if(_0x1ff8d6){return _0x372bec['status'](_0x524dbe)[_0x35e5('0x1c')](_0x1ff8d6);}};}function respondWithFilteredResult(_0xf880ce,_0x300980){return function(_0x102a00){if(_0x102a00){var _0x2d446a=_0x102a00['count'],_0x37819f=_0x300980[_0x35e5('0x1d')],_0xb85dba=_0x300980[_0x35e5('0x1d')]+_0x300980[_0x35e5('0x1e')],_0x475643;if(_0xb85dba>=_0x2d446a){_0xb85dba=_0x2d446a;_0x475643=0xc8;}else{_0x475643=0xce;}_0xf880ce[_0x35e5('0x1a')](_0x475643);return _0xf880ce[_0x35e5('0x1f')](_0x35e5('0x20'),_0x37819f+'-'+_0xb85dba+'/'+_0x2d446a)[_0x35e5('0x1c')](_0x102a00);}return null;};}function patchUpdates(_0x51d026){return function(_0x343f35){try{jsonpatch['apply'](_0x343f35,_0x51d026,!![]);}catch(_0x2ef749){return BPromise[_0x35e5('0x21')](_0x2ef749);}return _0x343f35['save']();};}function saveUpdates(_0x5428c1,_0x5b8b14){return function(_0x48614f){if(_0x48614f){return _0x48614f[_0x35e5('0x22')](_0x5428c1)[_0x35e5('0x23')](function(_0x35f0e0){return _0x35f0e0;});}return null;};}function removeEntity(_0x554884,_0x5b000f){return function(_0x225548){if(_0x225548){return _0x225548[_0x35e5('0x24')]()['then'](function(){_0x554884[_0x35e5('0x1a')](0xcc)[_0x35e5('0x1b')]();});}};}function handleEntityNotFound(_0x460c4e,_0x20aee6){return function(_0x5dc396){if(!_0x5dc396){_0x460c4e['sendStatus'](0x194);}return _0x5dc396;};}function handleError(_0x5c56b9,_0x163474){_0x163474=_0x163474||0x1f4;return function(_0x4bc215){logger[_0x35e5('0x25')](_0x4bc215[_0x35e5('0x26')]);if(_0x4bc215[_0x35e5('0x27')]){delete _0x4bc215[_0x35e5('0x27')];}_0x5c56b9[_0x35e5('0x1a')](_0x163474)[_0x35e5('0x28')](_0x4bc215);};}exports[_0x35e5('0x29')]=function(_0x3f0932,_0x3f70cb){var _0x4f064d={},_0x3d24fa={},_0x57e01e={'count':0x0,'rows':[]};var _0x26e628=db['UserProfileResource']['rawAttributes'];_0x3d24fa[_0x35e5('0x2a')]=_[_0x35e5('0x2b')](_0x26e628);_0x3d24fa[_0x35e5('0x2c')]=_[_0x35e5('0x2b')](_0x3f0932[_0x35e5('0x2c')]);_0x3d24fa[_0x35e5('0x2d')]=_['intersection'](_0x3d24fa[_0x35e5('0x2a')],_0x3d24fa['query']);_0x4f064d[_0x35e5('0x2e')]=_[_0x35e5('0x2f')](_0x3d24fa[_0x35e5('0x2a')],qs[_0x35e5('0x30')](_0x3f0932[_0x35e5('0x2c')][_0x35e5('0x30')]));_0x4f064d['attributes']=_0x4f064d[_0x35e5('0x2e')][_0x35e5('0x31')]?_0x4f064d[_0x35e5('0x2e')]:_0x3d24fa[_0x35e5('0x2a')];if(!_0x3f0932[_0x35e5('0x2c')][_0x35e5('0x32')](_0x35e5('0x33'))){_0x4f064d['limit']=qs[_0x35e5('0x1e')](_0x3f0932[_0x35e5('0x2c')][_0x35e5('0x1e')]);_0x4f064d[_0x35e5('0x1d')]=qs['offset'](_0x3f0932['query'][_0x35e5('0x1d')]);}_0x4f064d[_0x35e5('0x34')]=qs[_0x35e5('0x35')](_0x3f0932[_0x35e5('0x2c')][_0x35e5('0x35')]);_0x4f064d[_0x35e5('0x36')]=qs['filters'](_['pick'](_0x3f0932['query'],_0x3d24fa[_0x35e5('0x2d')]));if(_0x3f0932[_0x35e5('0x2c')][_0x35e5('0x37')]){_0x4f064d[_0x35e5('0x36')]=_['merge'](_0x4f064d[_0x35e5('0x36')],{'$or':_[_0x35e5('0x38')](_0x26e628,function(_0x47cc61){if(_0x47cc61[_0x35e5('0x39')][_0x35e5('0x3a')]!=='VIRTUAL'){var _0x452218={};_0x452218[_0x47cc61[_0x35e5('0x3b')]]={'$like':'%'+_0x3f0932[_0x35e5('0x2c')]['filter']+'%'};return _0x452218;}})});}_0x4f064d=_[_0x35e5('0x3c')]({},_0x4f064d,_0x3f0932[_0x35e5('0x3d')]);var _0x40a7ee={'where':_0x4f064d[_0x35e5('0x36')]};return db[_0x35e5('0x3e')]['count'](_0x40a7ee)[_0x35e5('0x23')](function(_0x4c9565){_0x57e01e[_0x35e5('0x3f')]=_0x4c9565;if(_0x3f0932[_0x35e5('0x2c')][_0x35e5('0x40')]){_0x4f064d[_0x35e5('0x41')]=[{'all':!![]}];}return db[_0x35e5('0x3e')]['findAll'](_0x4f064d);})[_0x35e5('0x23')](function(_0x316bab){_0x57e01e['rows']=_0x316bab;return _0x57e01e;})['then'](respondWithFilteredResult(_0x3f70cb,_0x4f064d))['catch'](handleError(_0x3f70cb,null));};exports[_0x35e5('0x42')]=function(_0x557ff0,_0x3298e5){var _0x30a605={'raw':![],'where':{'id':_0x557ff0[_0x35e5('0x43')]['id']}},_0x45b6c2={};_0x45b6c2[_0x35e5('0x2a')]=_['keys'](db['UserProfileResource'][_0x35e5('0x44')]);_0x45b6c2[_0x35e5('0x2c')]=_[_0x35e5('0x2b')](_0x557ff0['query']);_0x45b6c2[_0x35e5('0x2d')]=_[_0x35e5('0x2f')](_0x45b6c2[_0x35e5('0x2a')],_0x45b6c2[_0x35e5('0x2c')]);_0x30a605[_0x35e5('0x2e')]=_['intersection'](_0x45b6c2[_0x35e5('0x2a')],qs['fields'](_0x557ff0[_0x35e5('0x2c')]['fields']));_0x30a605[_0x35e5('0x2e')]=_0x30a605[_0x35e5('0x2e')][_0x35e5('0x31')]?_0x30a605['attributes']:_0x45b6c2[_0x35e5('0x2a')];if(_0x557ff0['query'][_0x35e5('0x40')]){_0x30a605[_0x35e5('0x41')]=[{'all':!![]}];}_0x30a605=_['merge']({},_0x30a605,_0x557ff0[_0x35e5('0x3d')]);return db[_0x35e5('0x3e')]['find'](_0x30a605)[_0x35e5('0x23')](handleEntityNotFound(_0x3298e5,null))[_0x35e5('0x23')](respondWithResult(_0x3298e5,null))[_0x35e5('0x45')](handleError(_0x3298e5,null));};exports['create']=function(_0x1e0850,_0x34dc44){return db[_0x35e5('0x3e')]['create'](_0x1e0850[_0x35e5('0x46')],{})[_0x35e5('0x23')](respondWithResult(_0x34dc44,0xc9))['catch'](handleError(_0x34dc44,null));};exports[_0x35e5('0x22')]=function(_0x4cb154,_0x1bab6f){if(_0x4cb154['body']['id']){delete _0x4cb154[_0x35e5('0x46')]['id'];}return db[_0x35e5('0x3e')]['find']({'where':{'id':_0x4cb154[_0x35e5('0x43')]['id']}})[_0x35e5('0x23')](handleEntityNotFound(_0x1bab6f,null))['then'](saveUpdates(_0x4cb154[_0x35e5('0x46')],null))[_0x35e5('0x23')](respondWithResult(_0x1bab6f,null))[_0x35e5('0x45')](handleError(_0x1bab6f,null));};exports[_0x35e5('0x24')]=function(_0x19600d,_0x435b07){return db[_0x35e5('0x3e')][_0x35e5('0x47')]({'where':{'id':_0x19600d['params']['id']}})[_0x35e5('0x23')](handleEntityNotFound(_0x435b07,null))['then'](removeEntity(_0x435b07,null))['catch'](handleError(_0x435b07,null));};exports[_0x35e5('0x48')]=function(_0x473ebf,_0x5dd32a){return db[_0x35e5('0x3e')]['describe']()['then'](respondWithResult(_0x5dd32a,null))['catch'](handleError(_0x5dd32a,null));}; \ No newline at end of file +var _0xa02e=['merge','type','VIRTUAL','field','options','includeAll','include','findAll','rows','catch','params','create','body','find','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','count','offset','set','Content-Range','apply','reject','update','then','destroy','stack','name','send','index','UserProfileResource','rawAttributes','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','pick','filter','where'];(function(_0x17eec6,_0x54a955){var _0x1e4d32=function(_0x3d2e36){while(--_0x3d2e36){_0x17eec6['push'](_0x17eec6['shift']());}};_0x1e4d32(++_0x54a955);}(_0xa02e,0xa3));var _0xea02=function(_0x259497,_0x4a4d3b){_0x259497=_0x259497-0x0;var _0x1e5958=_0xa02e[_0x259497];return _0x1e5958;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xea02('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xea02('0x1'));var jsonpatch=require(_0xea02('0x2'));var rp=require(_0xea02('0x3'));var moment=require(_0xea02('0x4'));var BPromise=require(_0xea02('0x5'));var Mustache=require(_0xea02('0x6'));var util=require(_0xea02('0x7'));var path=require(_0xea02('0x8'));var sox=require(_0xea02('0x9'));var csv=require(_0xea02('0xa'));var ejs=require(_0xea02('0xb'));var fs=require('fs');var _=require(_0xea02('0xc'));var squel=require(_0xea02('0xd'));var crypto=require(_0xea02('0xe'));var jsforce=require(_0xea02('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xea02('0xa'));var querystring=require(_0xea02('0x10'));var Papa=require(_0xea02('0x11'));var Redis=require(_0xea02('0x12'));var authService=require(_0xea02('0x13'));var qs=require(_0xea02('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xea02('0x15'));var logger=require(_0xea02('0x16'))(_0xea02('0x17'));var utils=require(_0xea02('0x18'));var config=require('../../config/environment');var db=require(_0xea02('0x19'))['db'];function respondWithStatusCode(_0x49b068,_0x21230b){_0x21230b=_0x21230b||0xcc;return function(_0x460376){if(_0x460376){return _0x49b068[_0xea02('0x1a')](_0x21230b);}return _0x49b068[_0xea02('0x1b')](_0x21230b)['end']();};}function respondWithResult(_0x236eac,_0x8c253d){_0x8c253d=_0x8c253d||0xc8;return function(_0x4e3c3c){if(_0x4e3c3c){return _0x236eac[_0xea02('0x1b')](_0x8c253d)['json'](_0x4e3c3c);}};}function respondWithFilteredResult(_0x2cf4ae,_0x320c7d){return function(_0x12e389){if(_0x12e389){var _0x229c8c=_0x12e389[_0xea02('0x1c')],_0x52d3bb=_0x320c7d[_0xea02('0x1d')],_0x5492f7=_0x320c7d[_0xea02('0x1d')]+_0x320c7d['limit'],_0x520a0f;if(_0x5492f7>=_0x229c8c){_0x5492f7=_0x229c8c;_0x520a0f=0xc8;}else{_0x520a0f=0xce;}_0x2cf4ae[_0xea02('0x1b')](_0x520a0f);return _0x2cf4ae[_0xea02('0x1e')](_0xea02('0x1f'),_0x52d3bb+'-'+_0x5492f7+'/'+_0x229c8c)['json'](_0x12e389);}return null;};}function patchUpdates(_0x170474){return function(_0x2d73e9){try{jsonpatch[_0xea02('0x20')](_0x2d73e9,_0x170474,!![]);}catch(_0x1ede33){return BPromise[_0xea02('0x21')](_0x1ede33);}return _0x2d73e9['save']();};}function saveUpdates(_0x3683d3,_0x59cf65){return function(_0x442446){if(_0x442446){return _0x442446[_0xea02('0x22')](_0x3683d3)[_0xea02('0x23')](function(_0x5c61f4){return _0x5c61f4;});}return null;};}function removeEntity(_0x39ea06,_0x193a33){return function(_0x1ce3f7){if(_0x1ce3f7){return _0x1ce3f7[_0xea02('0x24')]()[_0xea02('0x23')](function(){_0x39ea06['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x55fe8a,_0x15ffb2){return function(_0x48a22f){if(!_0x48a22f){_0x55fe8a[_0xea02('0x1a')](0x194);}return _0x48a22f;};}function handleError(_0x3c6a94,_0xe7c9aa){_0xe7c9aa=_0xe7c9aa||0x1f4;return function(_0x54f7f9){logger['error'](_0x54f7f9[_0xea02('0x25')]);if(_0x54f7f9[_0xea02('0x26')]){delete _0x54f7f9[_0xea02('0x26')];}_0x3c6a94[_0xea02('0x1b')](_0xe7c9aa)[_0xea02('0x27')](_0x54f7f9);};}exports[_0xea02('0x28')]=function(_0x3f4673,_0x4c7133){var _0x318898={},_0x212d63={},_0x4ac2d5={'count':0x0,'rows':[]};var _0x3d717d=db[_0xea02('0x29')][_0xea02('0x2a')];_0x212d63['model']=_[_0xea02('0x2b')](_0x3d717d);_0x212d63[_0xea02('0x2c')]=_[_0xea02('0x2b')](_0x3f4673[_0xea02('0x2c')]);_0x212d63[_0xea02('0x2d')]=_[_0xea02('0x2e')](_0x212d63[_0xea02('0x2f')],_0x212d63[_0xea02('0x2c')]);_0x318898[_0xea02('0x30')]=_[_0xea02('0x2e')](_0x212d63[_0xea02('0x2f')],qs[_0xea02('0x31')](_0x3f4673[_0xea02('0x2c')]['fields']));_0x318898[_0xea02('0x30')]=_0x318898['attributes'][_0xea02('0x32')]?_0x318898[_0xea02('0x30')]:_0x212d63[_0xea02('0x2f')];if(!_0x3f4673[_0xea02('0x2c')][_0xea02('0x33')](_0xea02('0x34'))){_0x318898[_0xea02('0x35')]=qs[_0xea02('0x35')](_0x3f4673['query'][_0xea02('0x35')]);_0x318898[_0xea02('0x1d')]=qs[_0xea02('0x1d')](_0x3f4673[_0xea02('0x2c')][_0xea02('0x1d')]);}_0x318898[_0xea02('0x36')]=qs[_0xea02('0x37')](_0x3f4673[_0xea02('0x2c')][_0xea02('0x37')]);_0x318898['where']=qs[_0xea02('0x2d')](_[_0xea02('0x38')](_0x3f4673['query'],_0x212d63[_0xea02('0x2d')]));if(_0x3f4673['query'][_0xea02('0x39')]){_0x318898[_0xea02('0x3a')]=_[_0xea02('0x3b')](_0x318898[_0xea02('0x3a')],{'$or':_['map'](_0x3d717d,function(_0x47841f){if(_0x47841f[_0xea02('0x3c')]['key']!==_0xea02('0x3d')){var _0x43bace={};_0x43bace[_0x47841f[_0xea02('0x3e')]]={'$like':'%'+_0x3f4673['query']['filter']+'%'};return _0x43bace;}})});}_0x318898=_[_0xea02('0x3b')]({},_0x318898,_0x3f4673[_0xea02('0x3f')]);var _0x4ae448={'where':_0x318898[_0xea02('0x3a')]};return db[_0xea02('0x29')][_0xea02('0x1c')](_0x4ae448)[_0xea02('0x23')](function(_0x395b20){_0x4ac2d5[_0xea02('0x1c')]=_0x395b20;if(_0x3f4673[_0xea02('0x2c')][_0xea02('0x40')]){_0x318898[_0xea02('0x41')]=[{'all':!![]}];}return db['UserProfileResource'][_0xea02('0x42')](_0x318898);})[_0xea02('0x23')](function(_0x45161f){_0x4ac2d5[_0xea02('0x43')]=_0x45161f;return _0x4ac2d5;})[_0xea02('0x23')](respondWithFilteredResult(_0x4c7133,_0x318898))[_0xea02('0x44')](handleError(_0x4c7133,null));};exports['show']=function(_0x4a9a21,_0x167377){var _0x2f75c9={'raw':![],'where':{'id':_0x4a9a21[_0xea02('0x45')]['id']}},_0x29f042={};_0x29f042[_0xea02('0x2f')]=_[_0xea02('0x2b')](db[_0xea02('0x29')][_0xea02('0x2a')]);_0x29f042[_0xea02('0x2c')]=_[_0xea02('0x2b')](_0x4a9a21['query']);_0x29f042[_0xea02('0x2d')]=_[_0xea02('0x2e')](_0x29f042['model'],_0x29f042[_0xea02('0x2c')]);_0x2f75c9[_0xea02('0x30')]=_[_0xea02('0x2e')](_0x29f042['model'],qs['fields'](_0x4a9a21[_0xea02('0x2c')][_0xea02('0x31')]));_0x2f75c9[_0xea02('0x30')]=_0x2f75c9['attributes'][_0xea02('0x32')]?_0x2f75c9[_0xea02('0x30')]:_0x29f042[_0xea02('0x2f')];if(_0x4a9a21[_0xea02('0x2c')][_0xea02('0x40')]){_0x2f75c9[_0xea02('0x41')]=[{'all':!![]}];}_0x2f75c9=_[_0xea02('0x3b')]({},_0x2f75c9,_0x4a9a21[_0xea02('0x3f')]);return db[_0xea02('0x29')]['find'](_0x2f75c9)[_0xea02('0x23')](handleEntityNotFound(_0x167377,null))[_0xea02('0x23')](respondWithResult(_0x167377,null))[_0xea02('0x44')](handleError(_0x167377,null));};exports[_0xea02('0x46')]=function(_0x1b9471,_0x1d9c3d){return db['UserProfileResource'][_0xea02('0x46')](_0x1b9471[_0xea02('0x47')],{})[_0xea02('0x23')](respondWithResult(_0x1d9c3d,0xc9))['catch'](handleError(_0x1d9c3d,null));};exports[_0xea02('0x22')]=function(_0x582bf8,_0x3a8a78){if(_0x582bf8[_0xea02('0x47')]['id']){delete _0x582bf8['body']['id'];}return db[_0xea02('0x29')][_0xea02('0x48')]({'where':{'id':_0x582bf8[_0xea02('0x45')]['id']}})[_0xea02('0x23')](handleEntityNotFound(_0x3a8a78,null))[_0xea02('0x23')](saveUpdates(_0x582bf8[_0xea02('0x47')],null))['then'](respondWithResult(_0x3a8a78,null))[_0xea02('0x44')](handleError(_0x3a8a78,null));};exports['destroy']=function(_0x3dbfcf,_0x32a1da){return db[_0xea02('0x29')]['find']({'where':{'id':_0x3dbfcf[_0xea02('0x45')]['id']}})['then'](handleEntityNotFound(_0x32a1da,null))[_0xea02('0x23')](removeEntity(_0x32a1da,null))['catch'](handleError(_0x32a1da,null));};exports[_0xea02('0x49')]=function(_0x2d6df9,_0x4427ad){return db[_0xea02('0x29')][_0xea02('0x49')]()['then'](respondWithResult(_0x4427ad,null))[_0xea02('0x44')](handleError(_0x4427ad,null));}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.model.js b/server/api/userProfileResource/userProfileResource.model.js index 218ce30..249019e 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 _0x46bd=['util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./userProfileResource.attributes','exports','define','UserProfileResource','resourceId','sectionId'];(function(_0x37e183,_0x26459c){var _0x2228fe=function(_0x44070f){while(--_0x44070f){_0x37e183['push'](_0x37e183['shift']());}};_0x2228fe(++_0x26459c);}(_0x46bd,0x186));var _0xd46b=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0x46bd[_0x1cc8fe];return _0x230054;};'use strict';var _=require('lodash');var util=require(_0xd46b('0x0'));var logger=require(_0xd46b('0x1'))('api');var moment=require('moment');var BPromise=require(_0xd46b('0x2'));var rp=require(_0xd46b('0x3'));var fs=require('fs');var path=require(_0xd46b('0x4'));var rimraf=require(_0xd46b('0x5'));var config=require(_0xd46b('0x6'));var attributes=require(_0xd46b('0x7'));module[_0xd46b('0x8')]=function(_0x2481ff,_0x236941){return _0x2481ff[_0xd46b('0x9')](_0xd46b('0xa'),attributes,{'tableName':'user_profile_has_resources','paranoid':![],'indexes':[{'name':'compositeIndex','fields':[_0xd46b('0xb'),_0xd46b('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x92e1=['api','moment','request-promise','path','rimraf','./userProfileResource.attributes','exports','define','user_profile_has_resources','compositeIndex','resourceId','sectionId','lodash','util','../../config/logger'];(function(_0x3cbd04,_0x50fc33){var _0x7cbd09=function(_0x57d599){while(--_0x57d599){_0x3cbd04['push'](_0x3cbd04['shift']());}};_0x7cbd09(++_0x50fc33);}(_0x92e1,0xcf));var _0x192e=function(_0xcd0918,_0x56bdf9){_0xcd0918=_0xcd0918-0x0;var _0x250704=_0x92e1[_0xcd0918];return _0x250704;};'use strict';var _=require(_0x192e('0x0'));var util=require(_0x192e('0x1'));var logger=require(_0x192e('0x2'))(_0x192e('0x3'));var moment=require(_0x192e('0x4'));var BPromise=require('bluebird');var rp=require(_0x192e('0x5'));var fs=require('fs');var path=require(_0x192e('0x6'));var rimraf=require(_0x192e('0x7'));var config=require('../../config/environment');var attributes=require(_0x192e('0x8'));module[_0x192e('0x9')]=function(_0x38e4f4,_0x195066){return _0x38e4f4[_0x192e('0xa')]('UserProfileResource',attributes,{'tableName':_0x192e('0xb'),'paranoid':![],'indexes':[{'name':_0x192e('0xc'),'fields':[_0x192e('0xd'),_0x192e('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.rpc.js b/server/api/userProfileResource/userProfileResource.rpc.js index ddb6713..f6d457d 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 _0xe11c=['lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','request','then','info','request\x20sent','debug','error','code','UserProfileResource,\x20%s,\x20%s','message','catch'];(function(_0x43153a,_0x277d63){var _0x259ec1=function(_0x58a3b1){while(--_0x58a3b1){_0x43153a['push'](_0x43153a['shift']());}};_0x259ec1(++_0x277d63);}(_0xe11c,0x17c));var _0xce11=function(_0xbf92a7,_0x501e6c){_0xbf92a7=_0xbf92a7-0x0;var _0x5cc874=_0xe11c[_0xbf92a7];return _0x5cc874;};'use strict';var _=require(_0xce11('0x0'));var util=require(_0xce11('0x1'));var moment=require('moment');var BPromise=require(_0xce11('0x2'));var rs=require(_0xce11('0x3'));var fs=require('fs');var Redis=require(_0xce11('0x4'));var db=require(_0xce11('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xce11('0x6'))(_0xce11('0x7'));var config=require(_0xce11('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xce11('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3f4c94,_0x3e1262,_0x5d734f){return new BPromise(function(_0x46f88a,_0x3a93a5){return client[_0xce11('0xa')](_0x3f4c94,_0x5d734f)[_0xce11('0xb')](function(_0x4a4201){logger[_0xce11('0xc')]('UserProfileResource,\x20%s,\x20%s',_0x3e1262,_0xce11('0xd'));logger[_0xce11('0xe')]('UserProfileResource,\x20%s,\x20%s,\x20%s',_0x3e1262,_0xce11('0xd'),JSON['stringify'](_0x4a4201));if(_0x4a4201[_0xce11('0xf')]){if(_0x4a4201[_0xce11('0xf')][_0xce11('0x10')]===0x1f4){logger[_0xce11('0xf')](_0xce11('0x11'),_0x3e1262,_0x4a4201[_0xce11('0xf')][_0xce11('0x12')]);return _0x3a93a5(_0x4a4201[_0xce11('0xf')]['message']);}logger[_0xce11('0xf')](_0xce11('0x11'),_0x3e1262,_0x4a4201['error'][_0xce11('0x12')]);return _0x46f88a(_0x4a4201[_0xce11('0xf')][_0xce11('0x12')]);}else{logger[_0xce11('0xc')](_0xce11('0x11'),_0x3e1262,_0xce11('0xd'));_0x46f88a(_0x4a4201['result'][_0xce11('0x12')]);}})[_0xce11('0x13')](function(_0x1c0637){logger['error']('UserProfileResource,\x20%s,\x20%s',_0x3e1262,_0x1c0637);_0x3a93a5(_0x1c0637);});});} \ No newline at end of file +var _0x25a2=['../../config/utils','../../config/environment','jayson/promise','http','request','then','info','stringify','error','code','UserProfileResource,\x20%s,\x20%s','message','request\x20sent','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb'];(function(_0x290ef5,_0x32cfa7){var _0x450d92=function(_0x4308db){while(--_0x4308db){_0x290ef5['push'](_0x290ef5['shift']());}};_0x450d92(++_0x32cfa7);}(_0x25a2,0xfe));var _0x225a=function(_0x45327e,_0x4ee2e9){_0x45327e=_0x45327e-0x0;var _0xcfb829=_0x25a2[_0x45327e];return _0xcfb829;};'use strict';var _=require(_0x225a('0x0'));var util=require(_0x225a('0x1'));var moment=require(_0x225a('0x2'));var BPromise=require(_0x225a('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x225a('0x4'));var db=require(_0x225a('0x5'))['db'];var utils=require(_0x225a('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x225a('0x7'));var jayson=require(_0x225a('0x8'));var client=jayson['client'][_0x225a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2f0e66,_0x241902,_0x544d6c){return new BPromise(function(_0x55003c,_0x127151){return client[_0x225a('0xa')](_0x2f0e66,_0x544d6c)[_0x225a('0xb')](function(_0x36bd9a){logger[_0x225a('0xc')]('UserProfileResource,\x20%s,\x20%s',_0x241902,'request\x20sent');logger['debug']('UserProfileResource,\x20%s,\x20%s,\x20%s',_0x241902,'request\x20sent',JSON[_0x225a('0xd')](_0x36bd9a));if(_0x36bd9a[_0x225a('0xe')]){if(_0x36bd9a[_0x225a('0xe')][_0x225a('0xf')]===0x1f4){logger[_0x225a('0xe')](_0x225a('0x10'),_0x241902,_0x36bd9a[_0x225a('0xe')][_0x225a('0x11')]);return _0x127151(_0x36bd9a[_0x225a('0xe')]['message']);}logger[_0x225a('0xe')](_0x225a('0x10'),_0x241902,_0x36bd9a[_0x225a('0xe')][_0x225a('0x11')]);return _0x55003c(_0x36bd9a[_0x225a('0xe')][_0x225a('0x11')]);}else{logger[_0x225a('0xc')](_0x225a('0x10'),_0x241902,_0x225a('0x12'));_0x55003c(_0x36bd9a['result'][_0x225a('0x11')]);}})[_0x225a('0x13')](function(_0x2fc461){logger['error'](_0x225a('0x10'),_0x241902,_0x2fc461);_0x127151(_0x2fc461);});});} \ No newline at end of file diff --git a/server/api/userProfileSection/index.js b/server/api/userProfileSection/index.js index 788e132..adff039 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 _0x9b8c=['create','put','update','delete','destroy','exports','multer','util','path','express','Router','../../components/interaction/service','./userProfileSection.controller','isAuthenticated','index','/describe','get','/:id','post'];(function(_0x133277,_0xb1d6b2){var _0x5b4a22=function(_0x484c26){while(--_0x484c26){_0x133277['push'](_0x133277['shift']());}};_0x5b4a22(++_0xb1d6b2);}(_0x9b8c,0x16f));var _0xc9b8=function(_0x54d4a8,_0x585a59){_0x54d4a8=_0x54d4a8-0x0;var _0x3b321b=_0x9b8c[_0x54d4a8];return _0x3b321b;};'use strict';var multer=require(_0xc9b8('0x0'));var util=require(_0xc9b8('0x1'));var path=require(_0xc9b8('0x2'));var timeout=require('connect-timeout');var express=require(_0xc9b8('0x3'));var router=express[_0xc9b8('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xc9b8('0x5'));var config=require('../../config/environment');var controller=require(_0xc9b8('0x6'));router['get']('/',auth[_0xc9b8('0x7')](),controller[_0xc9b8('0x8')]);router['get'](_0xc9b8('0x9'),auth[_0xc9b8('0x7')](),controller['describe']);router[_0xc9b8('0xa')](_0xc9b8('0xb'),auth[_0xc9b8('0x7')](),controller['show']);router[_0xc9b8('0xc')]('/',auth[_0xc9b8('0x7')](),controller[_0xc9b8('0xd')]);router[_0xc9b8('0xe')](_0xc9b8('0xb'),auth[_0xc9b8('0x7')](),controller[_0xc9b8('0xf')]);router[_0xc9b8('0x10')](_0xc9b8('0xb'),auth[_0xc9b8('0x7')](),controller[_0xc9b8('0x11')]);module[_0xc9b8('0x12')]=router; \ No newline at end of file +var _0x1c55=['multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfileSection.controller','isAuthenticated','index','get','/describe','describe','/:id','show','post','create','update','delete','destroy','exports'];(function(_0x38a283,_0x3ba609){var _0xeb0c3=function(_0x59a6d7){while(--_0x59a6d7){_0x38a283['push'](_0x38a283['shift']());}};_0xeb0c3(++_0x3ba609);}(_0x1c55,0x1e3));var _0x51c5=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x1c55[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0x51c5('0x0'));var util=require(_0x51c5('0x1'));var path=require(_0x51c5('0x2'));var timeout=require(_0x51c5('0x3'));var express=require(_0x51c5('0x4'));var router=express[_0x51c5('0x5')]();var auth=require(_0x51c5('0x6'));var interaction=require(_0x51c5('0x7'));var config=require(_0x51c5('0x8'));var controller=require(_0x51c5('0x9'));router['get']('/',auth[_0x51c5('0xa')](),controller[_0x51c5('0xb')]);router[_0x51c5('0xc')](_0x51c5('0xd'),auth[_0x51c5('0xa')](),controller[_0x51c5('0xe')]);router[_0x51c5('0xc')](_0x51c5('0xf'),auth[_0x51c5('0xa')](),controller[_0x51c5('0x10')]);router[_0x51c5('0x11')]('/',auth[_0x51c5('0xa')](),controller[_0x51c5('0x12')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x51c5('0x13')]);router[_0x51c5('0x14')]('/:id',auth[_0x51c5('0xa')](),controller[_0x51c5('0x15')]);module[_0x51c5('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 31a4279..47111d2 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 _0x2dab=['STRING','INTEGER','BOOLEAN','setDataValue','crudPermissions','join','getDataValue','split','sequelize','exports'];(function(_0x2b59db,_0x2fd753){var _0x1b8a3b=function(_0x41c9ab){while(--_0x41c9ab){_0x2b59db['push'](_0x2b59db['shift']());}};_0x1b8a3b(++_0x2fd753);}(_0x2dab,0x120));var _0xb2da=function(_0x1654f8,_0x21713d){_0x1654f8=_0x1654f8-0x0;var _0x2a46b9=_0x2dab[_0x1654f8];return _0x2a46b9;};'use strict';var Sequelize=require(_0xb2da('0x0'));module[_0xb2da('0x1')]={'name':{'type':Sequelize[_0xb2da('0x2')],'allowNull':![]},'category':{'type':Sequelize[_0xb2da('0x2')],'allowNull':![]},'sectionId':{'type':Sequelize[_0xb2da('0x3')],'allowNull':![]},'enabled':{'type':Sequelize['BOOLEAN'],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0xb2da('0x4')],'defaultValue':null},'crudPermissions':{'type':Sequelize['STRING'],'set':function(_0x15df9b){this[_0xb2da('0x5')](_0xb2da('0x6'),_0x15df9b?_0x15df9b[_0xb2da('0x7')](''):[]);},'get':function(){return this[_0xb2da('0x8')](_0xb2da('0x6'))?this[_0xb2da('0x8')]('crudPermissions')[_0xb2da('0x9')](''):[];}}}; \ No newline at end of file +var _0x544a=['BOOLEAN','crudPermissions','join','getDataValue','split','sequelize','exports','STRING'];(function(_0x48b33b,_0x304e72){var _0x30ba8f=function(_0x5ef7a5){while(--_0x5ef7a5){_0x48b33b['push'](_0x48b33b['shift']());}};_0x30ba8f(++_0x304e72);}(_0x544a,0xbd));var _0xa544=function(_0x4eb89d,_0x44e447){_0x4eb89d=_0x4eb89d-0x0;var _0x15fed3=_0x544a[_0x4eb89d];return _0x15fed3;};'use strict';var Sequelize=require(_0xa544('0x0'));module[_0xa544('0x1')]={'name':{'type':Sequelize[_0xa544('0x2')],'allowNull':![]},'category':{'type':Sequelize['STRING'],'allowNull':![]},'sectionId':{'type':Sequelize['INTEGER'],'allowNull':![]},'enabled':{'type':Sequelize[_0xa544('0x3')],'defaultValue':null},'autoAssociation':{'type':Sequelize['BOOLEAN'],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0xa544('0x2')],'set':function(_0xdca212){this['setDataValue'](_0xa544('0x4'),_0xdca212?_0xdca212[_0xa544('0x5')](''):[]);},'get':function(){return this[_0xa544('0x6')](_0xa544('0x4'))?this[_0xa544('0x6')]('crudPermissions')[_0xa544('0x7')](''):[];}}}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.controller.js b/server/api/userProfileSection/userProfileSection.controller.js index e70fe14..513768f 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 _0xfb15=['options','includeAll','include','rows','catch','params','create','body','find','destroy','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','end','status','json','count','offset','limit','set','Content-Range','apply','update','then','error','name','send','UserProfileSection','rawAttributes','keys','query','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','merge','map','type','key','VIRTUAL','field'];(function(_0x1a79c6,_0x5bad0b){var _0x301647=function(_0x9d3817){while(--_0x9d3817){_0x1a79c6['push'](_0x1a79c6['shift']());}};_0x301647(++_0x5bad0b);}(_0xfb15,0x12f));var _0x5fb1=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xfb15[_0x3947c9];return _0x2e7871;};'use strict';var pdf=require(_0x5fb1('0x0'));var emlformat=require(_0x5fb1('0x1'));var rimraf=require(_0x5fb1('0x2'));var zipdir=require(_0x5fb1('0x3'));var jsonpatch=require(_0x5fb1('0x4'));var rp=require(_0x5fb1('0x5'));var moment=require('moment');var BPromise=require(_0x5fb1('0x6'));var Mustache=require(_0x5fb1('0x7'));var util=require(_0x5fb1('0x8'));var path=require(_0x5fb1('0x9'));var sox=require(_0x5fb1('0xa'));var csv=require(_0x5fb1('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x5fb1('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x5fb1('0xd'));var deskjs=require(_0x5fb1('0xe'));var toCsv=require(_0x5fb1('0xb'));var querystring=require(_0x5fb1('0xf'));var Papa=require(_0x5fb1('0x10'));var Redis=require(_0x5fb1('0x11'));var authService=require(_0x5fb1('0x12'));var qs=require(_0x5fb1('0x13'));var as=require(_0x5fb1('0x14'));var hardwareService=require(_0x5fb1('0x15'));var logger=require(_0x5fb1('0x16'))(_0x5fb1('0x17'));var utils=require(_0x5fb1('0x18'));var config=require('../../config/environment');var db=require(_0x5fb1('0x19'))['db'];function respondWithStatusCode(_0x353bdf,_0x57593c){_0x57593c=_0x57593c||0xcc;return function(_0x173046){if(_0x173046){return _0x353bdf[_0x5fb1('0x1a')](_0x57593c);}return _0x353bdf['status'](_0x57593c)[_0x5fb1('0x1b')]();};}function respondWithResult(_0xe65c8c,_0x348c9f){_0x348c9f=_0x348c9f||0xc8;return function(_0x3256d1){if(_0x3256d1){return _0xe65c8c[_0x5fb1('0x1c')](_0x348c9f)[_0x5fb1('0x1d')](_0x3256d1);}};}function respondWithFilteredResult(_0x24343a,_0x36b516){return function(_0x588543){if(_0x588543){var _0x5332f5=_0x588543[_0x5fb1('0x1e')],_0x55be50=_0x36b516[_0x5fb1('0x1f')],_0x1caba0=_0x36b516[_0x5fb1('0x1f')]+_0x36b516[_0x5fb1('0x20')],_0x94e21a;if(_0x1caba0>=_0x5332f5){_0x1caba0=_0x5332f5;_0x94e21a=0xc8;}else{_0x94e21a=0xce;}_0x24343a['status'](_0x94e21a);return _0x24343a[_0x5fb1('0x21')](_0x5fb1('0x22'),_0x55be50+'-'+_0x1caba0+'/'+_0x5332f5)[_0x5fb1('0x1d')](_0x588543);}return null;};}function patchUpdates(_0x3548ff){return function(_0x6322b7){try{jsonpatch[_0x5fb1('0x23')](_0x6322b7,_0x3548ff,!![]);}catch(_0x57336d){return BPromise['reject'](_0x57336d);}return _0x6322b7['save']();};}function saveUpdates(_0x2174e5,_0x1fa373){return function(_0x592399){if(_0x592399){return _0x592399[_0x5fb1('0x24')](_0x2174e5)[_0x5fb1('0x25')](function(_0x15518f){return _0x15518f;});}return null;};}function removeEntity(_0x3639cc,_0x3b0303){return function(_0x41e89a){if(_0x41e89a){return _0x41e89a['destroy']()[_0x5fb1('0x25')](function(){_0x3639cc['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1c359e,_0x29638a){return function(_0x3555b5){if(!_0x3555b5){_0x1c359e[_0x5fb1('0x1a')](0x194);}return _0x3555b5;};}function handleError(_0x6483,_0x5db04e){_0x5db04e=_0x5db04e||0x1f4;return function(_0x3d068c){logger[_0x5fb1('0x26')](_0x3d068c['stack']);if(_0x3d068c[_0x5fb1('0x27')]){delete _0x3d068c[_0x5fb1('0x27')];}_0x6483[_0x5fb1('0x1c')](_0x5db04e)[_0x5fb1('0x28')](_0x3d068c);};}exports['index']=function(_0x2082f0,_0x52aeb8){var _0x105cec={},_0x1b3224={},_0x510aa4={'count':0x0,'rows':[]};var _0x3cac18=db[_0x5fb1('0x29')][_0x5fb1('0x2a')];_0x1b3224['model']=_[_0x5fb1('0x2b')](_0x3cac18);_0x1b3224['query']=_['keys'](_0x2082f0[_0x5fb1('0x2c')]);_0x1b3224[_0x5fb1('0x2d')]=_[_0x5fb1('0x2e')](_0x1b3224['model'],_0x1b3224[_0x5fb1('0x2c')]);_0x105cec['attributes']=_['intersection'](_0x1b3224[_0x5fb1('0x2f')],qs['fields'](_0x2082f0[_0x5fb1('0x2c')][_0x5fb1('0x30')]));_0x105cec[_0x5fb1('0x31')]=_0x105cec['attributes']['length']?_0x105cec[_0x5fb1('0x31')]:_0x1b3224[_0x5fb1('0x2f')];if(!_0x2082f0['query'][_0x5fb1('0x32')](_0x5fb1('0x33'))){_0x105cec[_0x5fb1('0x20')]=qs[_0x5fb1('0x20')](_0x2082f0[_0x5fb1('0x2c')][_0x5fb1('0x20')]);_0x105cec[_0x5fb1('0x1f')]=qs[_0x5fb1('0x1f')](_0x2082f0[_0x5fb1('0x2c')]['offset']);}_0x105cec[_0x5fb1('0x34')]=qs[_0x5fb1('0x35')](_0x2082f0[_0x5fb1('0x2c')][_0x5fb1('0x35')]);_0x105cec[_0x5fb1('0x36')]=qs['filters'](_[_0x5fb1('0x37')](_0x2082f0[_0x5fb1('0x2c')],_0x1b3224[_0x5fb1('0x2d')]));if(_0x2082f0['query']['filter']){_0x105cec['where']=_[_0x5fb1('0x38')](_0x105cec[_0x5fb1('0x36')],{'$or':_[_0x5fb1('0x39')](_0x3cac18,function(_0x480d5c){if(_0x480d5c[_0x5fb1('0x3a')][_0x5fb1('0x3b')]!==_0x5fb1('0x3c')){var _0x12166c={};_0x12166c[_0x480d5c[_0x5fb1('0x3d')]]={'$like':'%'+_0x2082f0[_0x5fb1('0x2c')]['filter']+'%'};return _0x12166c;}})});}_0x105cec=_[_0x5fb1('0x38')]({},_0x105cec,_0x2082f0[_0x5fb1('0x3e')]);var _0x342b5a={'where':_0x105cec[_0x5fb1('0x36')]};return db[_0x5fb1('0x29')][_0x5fb1('0x1e')](_0x342b5a)[_0x5fb1('0x25')](function(_0x24ccee){_0x510aa4[_0x5fb1('0x1e')]=_0x24ccee;if(_0x2082f0[_0x5fb1('0x2c')][_0x5fb1('0x3f')]){_0x105cec[_0x5fb1('0x40')]=[{'all':!![]}];}return db['UserProfileSection']['findAll'](_0x105cec);})[_0x5fb1('0x25')](function(_0x20c517){_0x510aa4[_0x5fb1('0x41')]=_0x20c517;return _0x510aa4;})[_0x5fb1('0x25')](respondWithFilteredResult(_0x52aeb8,_0x105cec))[_0x5fb1('0x42')](handleError(_0x52aeb8,null));};exports['show']=function(_0x2069c1,_0x1ff66b){var _0x26ccf0={'raw':![],'where':{'id':_0x2069c1[_0x5fb1('0x43')]['id']}},_0x855458={};_0x855458['model']=_[_0x5fb1('0x2b')](db[_0x5fb1('0x29')][_0x5fb1('0x2a')]);_0x855458[_0x5fb1('0x2c')]=_[_0x5fb1('0x2b')](_0x2069c1[_0x5fb1('0x2c')]);_0x855458[_0x5fb1('0x2d')]=_[_0x5fb1('0x2e')](_0x855458[_0x5fb1('0x2f')],_0x855458['query']);_0x26ccf0[_0x5fb1('0x31')]=_[_0x5fb1('0x2e')](_0x855458[_0x5fb1('0x2f')],qs['fields'](_0x2069c1[_0x5fb1('0x2c')]['fields']));_0x26ccf0[_0x5fb1('0x31')]=_0x26ccf0[_0x5fb1('0x31')]['length']?_0x26ccf0['attributes']:_0x855458[_0x5fb1('0x2f')];if(_0x2069c1[_0x5fb1('0x2c')][_0x5fb1('0x3f')]){_0x26ccf0[_0x5fb1('0x40')]=[{'all':!![]}];}_0x26ccf0=_['merge']({},_0x26ccf0,_0x2069c1['options']);return db['UserProfileSection']['find'](_0x26ccf0)[_0x5fb1('0x25')](handleEntityNotFound(_0x1ff66b,null))[_0x5fb1('0x25')](respondWithResult(_0x1ff66b,null))[_0x5fb1('0x42')](handleError(_0x1ff66b,null));};exports[_0x5fb1('0x44')]=function(_0x5c9ef9,_0x5bc0b4){return db['UserProfileSection'][_0x5fb1('0x44')](_0x5c9ef9['body'],{})['then'](respondWithResult(_0x5bc0b4,0xc9))[_0x5fb1('0x42')](handleError(_0x5bc0b4,null));};exports[_0x5fb1('0x24')]=function(_0x5327df,_0x427b15){if(_0x5327df[_0x5fb1('0x45')]['id']){delete _0x5327df[_0x5fb1('0x45')]['id'];}return db[_0x5fb1('0x29')][_0x5fb1('0x46')]({'where':{'id':_0x5327df[_0x5fb1('0x43')]['id']}})[_0x5fb1('0x25')](handleEntityNotFound(_0x427b15,null))[_0x5fb1('0x25')](saveUpdates(_0x5327df[_0x5fb1('0x45')],null))[_0x5fb1('0x25')](respondWithResult(_0x427b15,null))[_0x5fb1('0x42')](handleError(_0x427b15,null));};exports[_0x5fb1('0x47')]=function(_0x401d2a,_0x402dda){return db[_0x5fb1('0x29')][_0x5fb1('0x46')]({'where':{'id':_0x401d2a[_0x5fb1('0x43')]['id']}})[_0x5fb1('0x25')](handleEntityNotFound(_0x402dda,null))['then'](removeEntity(_0x402dda,null))[_0x5fb1('0x42')](handleError(_0x402dda,null));};exports[_0x5fb1('0x48')]=function(_0x496b6e,_0x330135){return db[_0x5fb1('0x29')][_0x5fb1('0x48')]()[_0x5fb1('0x25')](respondWithResult(_0x330135,null))[_0x5fb1('0x42')](handleError(_0x330135,null));}; \ No newline at end of file +var _0x27c7=['model','keys','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','merge','where','map','type','key','VIRTUAL','field','options','includeAll','findAll','rows','show','rawAttributes','include','find','catch','create','body','update','params','describe','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','lodash','squel','crypto','desk.js','to-csv','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','count','offset','limit','set','Content-Range','save','then','destroy','sendStatus','error','stack','name','send','index','UserProfileSection'];(function(_0x40ac5e,_0x2de228){var _0x2839d6=function(_0x123d47){while(--_0x123d47){_0x40ac5e['push'](_0x40ac5e['shift']());}};_0x2839d6(++_0x2de228);}(_0x27c7,0x10d));var _0x727c=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x27c7[_0x1ac595];return _0x455fff;};'use strict';var pdf=require(_0x727c('0x0'));var emlformat=require(_0x727c('0x1'));var rimraf=require(_0x727c('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x727c('0x3'));var rp=require(_0x727c('0x4'));var moment=require(_0x727c('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x727c('0x6'));var util=require(_0x727c('0x7'));var path=require(_0x727c('0x8'));var sox=require(_0x727c('0x9'));var csv=require('to-csv');var ejs=require(_0x727c('0xa'));var fs=require('fs');var _=require(_0x727c('0xb'));var squel=require(_0x727c('0xc'));var crypto=require(_0x727c('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x727c('0xe'));var toCsv=require(_0x727c('0xf'));var querystring=require(_0x727c('0x10'));var Papa=require('papaparse');var Redis=require(_0x727c('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x727c('0x12'));var as=require(_0x727c('0x13'));var hardwareService=require(_0x727c('0x14'));var logger=require('../../config/logger')(_0x727c('0x15'));var utils=require(_0x727c('0x16'));var config=require(_0x727c('0x17'));var db=require(_0x727c('0x18'))['db'];function respondWithStatusCode(_0x59d1e9,_0xae5fd5){_0xae5fd5=_0xae5fd5||0xcc;return function(_0x12c5d9){if(_0x12c5d9){return _0x59d1e9['sendStatus'](_0xae5fd5);}return _0x59d1e9[_0x727c('0x19')](_0xae5fd5)[_0x727c('0x1a')]();};}function respondWithResult(_0x4d7b1,_0x4b633a){_0x4b633a=_0x4b633a||0xc8;return function(_0x411428){if(_0x411428){return _0x4d7b1[_0x727c('0x19')](_0x4b633a)[_0x727c('0x1b')](_0x411428);}};}function respondWithFilteredResult(_0x5ec953,_0x5903d6){return function(_0xa7dd67){if(_0xa7dd67){var _0x91a581=_0xa7dd67[_0x727c('0x1c')],_0x52e9f0=_0x5903d6[_0x727c('0x1d')],_0xf8729d=_0x5903d6[_0x727c('0x1d')]+_0x5903d6[_0x727c('0x1e')],_0x88d8a7;if(_0xf8729d>=_0x91a581){_0xf8729d=_0x91a581;_0x88d8a7=0xc8;}else{_0x88d8a7=0xce;}_0x5ec953['status'](_0x88d8a7);return _0x5ec953[_0x727c('0x1f')](_0x727c('0x20'),_0x52e9f0+'-'+_0xf8729d+'/'+_0x91a581)[_0x727c('0x1b')](_0xa7dd67);}return null;};}function patchUpdates(_0x1a7fef){return function(_0x2924b1){try{jsonpatch['apply'](_0x2924b1,_0x1a7fef,!![]);}catch(_0x2b7b11){return BPromise['reject'](_0x2b7b11);}return _0x2924b1[_0x727c('0x21')]();};}function saveUpdates(_0x653d5b,_0x1ca483){return function(_0x403aa2){if(_0x403aa2){return _0x403aa2['update'](_0x653d5b)[_0x727c('0x22')](function(_0x3f3738){return _0x3f3738;});}return null;};}function removeEntity(_0x5d5b3f,_0x2937bc){return function(_0x54dcd4){if(_0x54dcd4){return _0x54dcd4[_0x727c('0x23')]()[_0x727c('0x22')](function(){_0x5d5b3f[_0x727c('0x19')](0xcc)[_0x727c('0x1a')]();});}};}function handleEntityNotFound(_0x3c6b66,_0x437747){return function(_0x5a24db){if(!_0x5a24db){_0x3c6b66[_0x727c('0x24')](0x194);}return _0x5a24db;};}function handleError(_0x10bf38,_0x35d95a){_0x35d95a=_0x35d95a||0x1f4;return function(_0x28cc18){logger[_0x727c('0x25')](_0x28cc18[_0x727c('0x26')]);if(_0x28cc18[_0x727c('0x27')]){delete _0x28cc18[_0x727c('0x27')];}_0x10bf38[_0x727c('0x19')](_0x35d95a)[_0x727c('0x28')](_0x28cc18);};}exports[_0x727c('0x29')]=function(_0x2287b0,_0x488092){var _0x4da3e6={},_0x413685={},_0x57e975={'count':0x0,'rows':[]};var _0x4e46e1=db[_0x727c('0x2a')]['rawAttributes'];_0x413685[_0x727c('0x2b')]=_[_0x727c('0x2c')](_0x4e46e1);_0x413685[_0x727c('0x2d')]=_['keys'](_0x2287b0['query']);_0x413685['filters']=_[_0x727c('0x2e')](_0x413685[_0x727c('0x2b')],_0x413685[_0x727c('0x2d')]);_0x4da3e6['attributes']=_[_0x727c('0x2e')](_0x413685[_0x727c('0x2b')],qs[_0x727c('0x2f')](_0x2287b0[_0x727c('0x2d')]['fields']));_0x4da3e6['attributes']=_0x4da3e6[_0x727c('0x30')][_0x727c('0x31')]?_0x4da3e6['attributes']:_0x413685[_0x727c('0x2b')];if(!_0x2287b0[_0x727c('0x2d')][_0x727c('0x32')](_0x727c('0x33'))){_0x4da3e6[_0x727c('0x1e')]=qs[_0x727c('0x1e')](_0x2287b0[_0x727c('0x2d')][_0x727c('0x1e')]);_0x4da3e6[_0x727c('0x1d')]=qs['offset'](_0x2287b0['query'][_0x727c('0x1d')]);}_0x4da3e6[_0x727c('0x34')]=qs[_0x727c('0x35')](_0x2287b0[_0x727c('0x2d')]['sort']);_0x4da3e6['where']=qs[_0x727c('0x36')](_[_0x727c('0x37')](_0x2287b0[_0x727c('0x2d')],_0x413685['filters']));if(_0x2287b0[_0x727c('0x2d')][_0x727c('0x38')]){_0x4da3e6['where']=_[_0x727c('0x39')](_0x4da3e6[_0x727c('0x3a')],{'$or':_[_0x727c('0x3b')](_0x4e46e1,function(_0x129635){if(_0x129635[_0x727c('0x3c')][_0x727c('0x3d')]!==_0x727c('0x3e')){var _0x57c819={};_0x57c819[_0x129635[_0x727c('0x3f')]]={'$like':'%'+_0x2287b0['query'][_0x727c('0x38')]+'%'};return _0x57c819;}})});}_0x4da3e6=_[_0x727c('0x39')]({},_0x4da3e6,_0x2287b0[_0x727c('0x40')]);var _0x528b45={'where':_0x4da3e6['where']};return db[_0x727c('0x2a')][_0x727c('0x1c')](_0x528b45)[_0x727c('0x22')](function(_0x5b959a){_0x57e975['count']=_0x5b959a;if(_0x2287b0[_0x727c('0x2d')][_0x727c('0x41')]){_0x4da3e6['include']=[{'all':!![]}];}return db[_0x727c('0x2a')][_0x727c('0x42')](_0x4da3e6);})[_0x727c('0x22')](function(_0x1521b0){_0x57e975[_0x727c('0x43')]=_0x1521b0;return _0x57e975;})[_0x727c('0x22')](respondWithFilteredResult(_0x488092,_0x4da3e6))['catch'](handleError(_0x488092,null));};exports[_0x727c('0x44')]=function(_0x3d46f8,_0x5f35ac){var _0x21d628={'raw':![],'where':{'id':_0x3d46f8['params']['id']}},_0x545711={};_0x545711[_0x727c('0x2b')]=_[_0x727c('0x2c')](db[_0x727c('0x2a')][_0x727c('0x45')]);_0x545711['query']=_['keys'](_0x3d46f8[_0x727c('0x2d')]);_0x545711[_0x727c('0x36')]=_[_0x727c('0x2e')](_0x545711[_0x727c('0x2b')],_0x545711[_0x727c('0x2d')]);_0x21d628[_0x727c('0x30')]=_[_0x727c('0x2e')](_0x545711[_0x727c('0x2b')],qs[_0x727c('0x2f')](_0x3d46f8[_0x727c('0x2d')]['fields']));_0x21d628[_0x727c('0x30')]=_0x21d628['attributes'][_0x727c('0x31')]?_0x21d628[_0x727c('0x30')]:_0x545711[_0x727c('0x2b')];if(_0x3d46f8['query'][_0x727c('0x41')]){_0x21d628[_0x727c('0x46')]=[{'all':!![]}];}_0x21d628=_['merge']({},_0x21d628,_0x3d46f8['options']);return db[_0x727c('0x2a')][_0x727c('0x47')](_0x21d628)[_0x727c('0x22')](handleEntityNotFound(_0x5f35ac,null))[_0x727c('0x22')](respondWithResult(_0x5f35ac,null))[_0x727c('0x48')](handleError(_0x5f35ac,null));};exports[_0x727c('0x49')]=function(_0x375803,_0x3cf0af){return db['UserProfileSection']['create'](_0x375803[_0x727c('0x4a')],{})[_0x727c('0x22')](respondWithResult(_0x3cf0af,0xc9))[_0x727c('0x48')](handleError(_0x3cf0af,null));};exports[_0x727c('0x4b')]=function(_0x4158be,_0x571b17){if(_0x4158be['body']['id']){delete _0x4158be[_0x727c('0x4a')]['id'];}return db[_0x727c('0x2a')][_0x727c('0x47')]({'where':{'id':_0x4158be[_0x727c('0x4c')]['id']}})[_0x727c('0x22')](handleEntityNotFound(_0x571b17,null))[_0x727c('0x22')](saveUpdates(_0x4158be['body'],null))[_0x727c('0x22')](respondWithResult(_0x571b17,null))[_0x727c('0x48')](handleError(_0x571b17,null));};exports['destroy']=function(_0x494681,_0x27c469){return db['UserProfileSection'][_0x727c('0x47')]({'where':{'id':_0x494681[_0x727c('0x4c')]['id']}})[_0x727c('0x22')](handleEntityNotFound(_0x27c469,null))[_0x727c('0x22')](removeEntity(_0x27c469,null))['catch'](handleError(_0x27c469,null));};exports[_0x727c('0x4d')]=function(_0x57d5bb,_0x6aabbc){return db[_0x727c('0x2a')][_0x727c('0x4d')]()[_0x727c('0x22')](respondWithResult(_0x6aabbc,null))['catch'](handleError(_0x6aabbc,null));}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.model.js b/server/api/userProfileSection/userProfileSection.model.js index e6fc409..db6ead3 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 _0xbfa0=['UserProfileSection','compositeIndex','sectionId','userProfileId','util','../../config/logger','moment','bluebird','path','rimraf','./userProfileSection.attributes','exports','define'];(function(_0x3ad82c,_0x203bb4){var _0x1abed2=function(_0x30d588){while(--_0x30d588){_0x3ad82c['push'](_0x3ad82c['shift']());}};_0x1abed2(++_0x203bb4);}(_0xbfa0,0x86));var _0x0bfa=function(_0x2ac2a7,_0x4dad2d){_0x2ac2a7=_0x2ac2a7-0x0;var _0x2a06b9=_0xbfa0[_0x2ac2a7];return _0x2a06b9;};'use strict';var _=require('lodash');var util=require(_0x0bfa('0x0'));var logger=require(_0x0bfa('0x1'))('api');var moment=require(_0x0bfa('0x2'));var BPromise=require(_0x0bfa('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0bfa('0x4'));var rimraf=require(_0x0bfa('0x5'));var config=require('../../config/environment');var attributes=require(_0x0bfa('0x6'));module[_0x0bfa('0x7')]=function(_0x404b83,_0x56a831){return _0x404b83[_0x0bfa('0x8')](_0x0bfa('0x9'),attributes,{'tableName':'user_profile_has_sections','paranoid':![],'indexes':[{'name':_0x0bfa('0xa'),'fields':[_0x0bfa('0xb'),_0x0bfa('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x3c29=['compositeIndex','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userProfileSection.attributes','UserProfileSection','user_profile_has_sections'];(function(_0x376169,_0x340eee){var _0x3d4f85=function(_0x3eae3a){while(--_0x3eae3a){_0x376169['push'](_0x376169['shift']());}};_0x3d4f85(++_0x340eee);}(_0x3c29,0x16d));var _0x93c2=function(_0x39a829,_0x412782){_0x39a829=_0x39a829-0x0;var _0x125496=_0x3c29[_0x39a829];return _0x125496;};'use strict';var _=require(_0x93c2('0x0'));var util=require(_0x93c2('0x1'));var logger=require(_0x93c2('0x2'))('api');var moment=require(_0x93c2('0x3'));var BPromise=require(_0x93c2('0x4'));var rp=require(_0x93c2('0x5'));var fs=require('fs');var path=require(_0x93c2('0x6'));var rimraf=require(_0x93c2('0x7'));var config=require(_0x93c2('0x8'));var attributes=require(_0x93c2('0x9'));module['exports']=function(_0x3d19e0,_0x2d34ef){return _0x3d19e0['define'](_0x93c2('0xa'),attributes,{'tableName':_0x93c2('0xb'),'paranoid':![],'indexes':[{'name':_0x93c2('0xc'),'fields':['sectionId','userProfileId']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.rpc.js b/server/api/userProfileSection/userProfileSection.rpc.js index 6820bac..fc55adc 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 _0x42ab=['../../config/logger','rpc','../../config/environment','jayson/promise','http','info','UserProfileSection,\x20%s,\x20%s','request\x20sent','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x391400,_0x95546c){var _0x463202=function(_0x432d72){while(--_0x432d72){_0x391400['push'](_0x391400['shift']());}};_0x463202(++_0x95546c);}(_0x42ab,0x10b));var _0xb42a=function(_0x2d8fdb,_0x30e70c){_0x2d8fdb=_0x2d8fdb-0x0;var _0x3bc1c2=_0x42ab[_0x2d8fdb];return _0x3bc1c2;};'use strict';var _=require(_0xb42a('0x0'));var util=require('util');var moment=require(_0xb42a('0x1'));var BPromise=require('bluebird');var rs=require(_0xb42a('0x2'));var fs=require('fs');var Redis=require(_0xb42a('0x3'));var db=require(_0xb42a('0x4'))['db'];var utils=require(_0xb42a('0x5'));var logger=require(_0xb42a('0x6'))(_0xb42a('0x7'));var config=require(_0xb42a('0x8'));var jayson=require(_0xb42a('0x9'));var client=jayson['client'][_0xb42a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1bd4b4,_0x1e458d,_0x19f26a){return new BPromise(function(_0x376481,_0x4e4acf){return client['request'](_0x1bd4b4,_0x19f26a)['then'](function(_0x53637d){logger[_0xb42a('0xb')](_0xb42a('0xc'),_0x1e458d,_0xb42a('0xd'));logger[_0xb42a('0xe')](_0xb42a('0xf'),_0x1e458d,'request\x20sent',JSON[_0xb42a('0x10')](_0x53637d));if(_0x53637d[_0xb42a('0x11')]){if(_0x53637d[_0xb42a('0x11')][_0xb42a('0x12')]===0x1f4){logger['error'](_0xb42a('0xc'),_0x1e458d,_0x53637d[_0xb42a('0x11')][_0xb42a('0x13')]);return _0x4e4acf(_0x53637d[_0xb42a('0x11')][_0xb42a('0x13')]);}logger['error'](_0xb42a('0xc'),_0x1e458d,_0x53637d[_0xb42a('0x11')][_0xb42a('0x13')]);return _0x376481(_0x53637d[_0xb42a('0x11')]['message']);}else{logger[_0xb42a('0xb')](_0xb42a('0xc'),_0x1e458d,_0xb42a('0xd'));_0x376481(_0x53637d[_0xb42a('0x14')][_0xb42a('0x13')]);}})['catch'](function(_0x52ec0c){logger[_0xb42a('0x11')](_0xb42a('0xc'),_0x1e458d,_0x52ec0c);_0x4e4acf(_0x52ec0c);});});} \ No newline at end of file +var _0xa410=['UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','UserProfileSection,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x29b609,_0x19d388){var _0x54c952=function(_0xb3c38d){while(--_0xb3c38d){_0x29b609['push'](_0x29b609['shift']());}};_0x54c952(++_0x19d388);}(_0xa410,0x9d));var _0x0a41=function(_0x332bda,_0x1ccafa){_0x332bda=_0x332bda-0x0;var _0x243c20=_0xa410[_0x332bda];return _0x243c20;};'use strict';var _=require(_0x0a41('0x0'));var util=require(_0x0a41('0x1'));var moment=require(_0x0a41('0x2'));var BPromise=require(_0x0a41('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a41('0x4'));var db=require(_0x0a41('0x5'))['db'];var utils=require(_0x0a41('0x6'));var logger=require('../../config/logger')(_0x0a41('0x7'));var config=require(_0x0a41('0x8'));var jayson=require(_0x0a41('0x9'));var client=jayson[_0x0a41('0xa')][_0x0a41('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xd333a7,_0x28cdef,_0x26d03f){return new BPromise(function(_0x2214b9,_0x54bfa8){return client[_0x0a41('0xc')](_0xd333a7,_0x26d03f)[_0x0a41('0xd')](function(_0x7d70f0){logger[_0x0a41('0xe')](_0x0a41('0xf'),_0x28cdef,_0x0a41('0x10'));logger[_0x0a41('0x11')](_0x0a41('0x12'),_0x28cdef,_0x0a41('0x10'),JSON[_0x0a41('0x13')](_0x7d70f0));if(_0x7d70f0['error']){if(_0x7d70f0[_0x0a41('0x14')][_0x0a41('0x15')]===0x1f4){logger['error']('UserProfileSection,\x20%s,\x20%s',_0x28cdef,_0x7d70f0['error'][_0x0a41('0x16')]);return _0x54bfa8(_0x7d70f0[_0x0a41('0x14')][_0x0a41('0x16')]);}logger[_0x0a41('0x14')](_0x0a41('0xf'),_0x28cdef,_0x7d70f0[_0x0a41('0x14')][_0x0a41('0x16')]);return _0x2214b9(_0x7d70f0[_0x0a41('0x14')][_0x0a41('0x16')]);}else{logger[_0x0a41('0xe')](_0x0a41('0xf'),_0x28cdef,_0x0a41('0x10'));_0x2214b9(_0x7d70f0[_0x0a41('0x17')][_0x0a41('0x16')]);}})[_0x0a41('0x18')](function(_0x11e2d9){logger[_0x0a41('0x14')]('UserProfileSection,\x20%s,\x20%s',_0x28cdef,_0x11e2d9);_0x54bfa8(_0x11e2d9);});});} \ No newline at end of file diff --git a/server/api/userSmsQueue/index.js b/server/api/userSmsQueue/index.js index 89aa59f..e821d1d 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 _0x33ad=['express','../../components/auth/service','../../components/interaction/service','../../config/environment','util','path','connect-timeout'];(function(_0x2c961d,_0x106e3a){var _0xb29a42=function(_0xc899d8){while(--_0xc899d8){_0x2c961d['push'](_0x2c961d['shift']());}};_0xb29a42(++_0x106e3a);}(_0x33ad,0x18c));var _0xd33a=function(_0x10b339,_0x1ed868){_0x10b339=_0x10b339-0x0;var _0x4bbae8=_0x33ad[_0x10b339];return _0x4bbae8;};'use strict';var multer=require('multer');var util=require(_0xd33a('0x0'));var path=require(_0xd33a('0x1'));var timeout=require(_0xd33a('0x2'));var express=require(_0xd33a('0x3'));var router=express['Router']();var auth=require(_0xd33a('0x4'));var interaction=require(_0xd33a('0x5'));var config=require(_0xd33a('0x6'));module['exports']=router; \ No newline at end of file +var _0x002c=['connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','exports','multer'];(function(_0xf79bae,_0x263b2a){var _0x5d2cb7=function(_0x27c86b){while(--_0x27c86b){_0xf79bae['push'](_0xf79bae['shift']());}};_0x5d2cb7(++_0x263b2a);}(_0x002c,0x185));var _0xc002=function(_0x2c99e9,_0x51940d){_0x2c99e9=_0x2c99e9-0x0;var _0x4f621e=_0x002c[_0x2c99e9];return _0x4f621e;};'use strict';var multer=require(_0xc002('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xc002('0x1'));var express=require('express');var router=express['Router']();var auth=require(_0xc002('0x2'));var interaction=require(_0xc002('0x3'));var config=require(_0xc002('0x4'));module[_0xc002('0x5')]=router; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.attributes.js b/server/api/userSmsQueue/userSmsQueue.attributes.js index 493b428..8d9fddc 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 _0xe706=['INTEGER','sequelize','exports'];(function(_0x3a7ecd,_0x141bc3){var _0x156bbd=function(_0x10a892){while(--_0x10a892){_0x3a7ecd['push'](_0x3a7ecd['shift']());}};_0x156bbd(++_0x141bc3);}(_0xe706,0xa3));var _0x6e70=function(_0x5efb3c,_0x852a5a){_0x5efb3c=_0x5efb3c-0x0;var _0x349be3=_0xe706[_0x5efb3c];return _0x349be3;};'use strict';var Sequelize=require(_0x6e70('0x0'));module[_0x6e70('0x1')]={'penalty':{'type':Sequelize[_0x6e70('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xbaf0=['exports','INTEGER'];(function(_0x55a802,_0x10ab3a){var _0x1a0461=function(_0x43d162){while(--_0x43d162){_0x55a802['push'](_0x55a802['shift']());}};_0x1a0461(++_0x10ab3a);}(_0xbaf0,0x12a));var _0x0baf=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xbaf0[_0xa464c9];return _0x3d73c4;};'use strict';var Sequelize=require('sequelize');module[_0x0baf('0x0')]={'penalty':{'type':Sequelize[_0x0baf('0x1')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.model.js b/server/api/userSmsQueue/userSmsQueue.model.js index 539c83e..51d75a9 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 _0xdc5f=['bluebird','request-promise','path','rimraf','../../config/environment','exports','define','UserSmsQueue','user_has_sms_queues','lodash','util','../../config/logger','api','moment'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xdc5f,0x95));var _0xfdc5=function(_0x2a6809,_0x44edde){_0x2a6809=_0x2a6809-0x0;var _0x11c371=_0xdc5f[_0x2a6809];return _0x11c371;};'use strict';var _=require(_0xfdc5('0x0'));var util=require(_0xfdc5('0x1'));var logger=require(_0xfdc5('0x2'))(_0xfdc5('0x3'));var moment=require(_0xfdc5('0x4'));var BPromise=require(_0xfdc5('0x5'));var rp=require(_0xfdc5('0x6'));var fs=require('fs');var path=require(_0xfdc5('0x7'));var rimraf=require(_0xfdc5('0x8'));var config=require(_0xfdc5('0x9'));var attributes=require('./userSmsQueue.attributes');module[_0xfdc5('0xa')]=function(_0x1811de,_0x110109){return _0x1811de[_0xfdc5('0xb')](_0xfdc5('0xc'),attributes,{'tableName':_0xfdc5('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcfaf=['bluebird','request-promise','path','rimraf','../../config/environment','./userSmsQueue.attributes','exports','define','UserSmsQueue','user_has_sms_queues','lodash','../../config/logger','api','moment'];(function(_0x32199f,_0xff92bb){var _0x136511=function(_0x1772ff){while(--_0x1772ff){_0x32199f['push'](_0x32199f['shift']());}};_0x136511(++_0xff92bb);}(_0xcfaf,0x14c));var _0xfcfa=function(_0x44d882,_0x570b78){_0x44d882=_0x44d882-0x0;var _0x17ddf9=_0xcfaf[_0x44d882];return _0x17ddf9;};'use strict';var _=require(_0xfcfa('0x0'));var util=require('util');var logger=require(_0xfcfa('0x1'))(_0xfcfa('0x2'));var moment=require(_0xfcfa('0x3'));var BPromise=require(_0xfcfa('0x4'));var rp=require(_0xfcfa('0x5'));var fs=require('fs');var path=require(_0xfcfa('0x6'));var rimraf=require(_0xfcfa('0x7'));var config=require(_0xfcfa('0x8'));var attributes=require(_0xfcfa('0x9'));module[_0xfcfa('0xa')]=function(_0x49398f,_0x339198){return _0x49398f[_0xfcfa('0xb')](_0xfcfa('0xc'),attributes,{'tableName':_0xfcfa('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.rpc.js b/server/api/userSmsQueue/userSmsQueue.rpc.js index ebd1191..29d6c38 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 _0x1ce4=['http','request','UserSmsQueue,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client'];(function(_0x7e2eb0,_0x17cd58){var _0xd92de4=function(_0x5d005b){while(--_0x5d005b){_0x7e2eb0['push'](_0x7e2eb0['shift']());}};_0xd92de4(++_0x17cd58);}(_0x1ce4,0x121));var _0x41ce=function(_0x17ded8,_0x2aa22d){_0x17ded8=_0x17ded8-0x0;var _0x37e7a5=_0x1ce4[_0x17ded8];return _0x37e7a5;};'use strict';var _=require(_0x41ce('0x0'));var util=require(_0x41ce('0x1'));var moment=require(_0x41ce('0x2'));var BPromise=require('bluebird');var rs=require(_0x41ce('0x3'));var fs=require('fs');var Redis=require(_0x41ce('0x4'));var db=require(_0x41ce('0x5'))['db'];var utils=require(_0x41ce('0x6'));var logger=require(_0x41ce('0x7'))('rpc');var config=require(_0x41ce('0x8'));var jayson=require(_0x41ce('0x9'));var client=jayson[_0x41ce('0xa')][_0x41ce('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5120d4,_0x111a18,_0x24b66e){return new BPromise(function(_0x400f8a,_0x140136){return client[_0x41ce('0xc')](_0x5120d4,_0x24b66e)['then'](function(_0x5eb6ea){logger['info'](_0x41ce('0xd'),_0x111a18,_0x41ce('0xe'));logger['debug']('UserSmsQueue,\x20%s,\x20%s,\x20%s',_0x111a18,'request\x20sent',JSON['stringify'](_0x5eb6ea));if(_0x5eb6ea[_0x41ce('0xf')]){if(_0x5eb6ea[_0x41ce('0xf')][_0x41ce('0x10')]===0x1f4){logger['error']('UserSmsQueue,\x20%s,\x20%s',_0x111a18,_0x5eb6ea[_0x41ce('0xf')][_0x41ce('0x11')]);return _0x140136(_0x5eb6ea['error'][_0x41ce('0x11')]);}logger[_0x41ce('0xf')](_0x41ce('0xd'),_0x111a18,_0x5eb6ea[_0x41ce('0xf')][_0x41ce('0x11')]);return _0x400f8a(_0x5eb6ea[_0x41ce('0xf')][_0x41ce('0x11')]);}else{logger[_0x41ce('0x12')](_0x41ce('0xd'),_0x111a18,_0x41ce('0xe'));_0x400f8a(_0x5eb6ea[_0x41ce('0x13')][_0x41ce('0x11')]);}})['catch'](function(_0x5ea38b){logger[_0x41ce('0xf')](_0x41ce('0xd'),_0x111a18,_0x5ea38b);_0x140136(_0x5ea38b);});});} \ No newline at end of file +var _0x66aa=['code','message','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','UserSmsQueue,\x20%s,\x20%s','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error'];(function(_0x43e155,_0x2c5eda){var _0x130b94=function(_0x2edcac){while(--_0x2edcac){_0x43e155['push'](_0x43e155['shift']());}};_0x130b94(++_0x2c5eda);}(_0x66aa,0x128));var _0xa66a=function(_0x193ab1,_0x58f51e){_0x193ab1=_0x193ab1-0x0;var _0x1099b0=_0x66aa[_0x193ab1];return _0x1099b0;};'use strict';var _=require(_0xa66a('0x0'));var util=require(_0xa66a('0x1'));var moment=require(_0xa66a('0x2'));var BPromise=require(_0xa66a('0x3'));var rs=require(_0xa66a('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa66a('0x5'))['db'];var utils=require(_0xa66a('0x6'));var logger=require(_0xa66a('0x7'))(_0xa66a('0x8'));var config=require(_0xa66a('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xa66a('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2d514b,_0x11d4e4,_0x413da6){return new BPromise(function(_0x25dcf1,_0xc539ab){return client[_0xa66a('0xb')](_0x2d514b,_0x413da6)[_0xa66a('0xc')](function(_0x40a604){logger[_0xa66a('0xd')](_0xa66a('0xe'),_0x11d4e4,'request\x20sent');logger[_0xa66a('0xf')](_0xa66a('0x10'),_0x11d4e4,_0xa66a('0x11'),JSON['stringify'](_0x40a604));if(_0x40a604[_0xa66a('0x12')]){if(_0x40a604['error'][_0xa66a('0x13')]===0x1f4){logger[_0xa66a('0x12')](_0xa66a('0xe'),_0x11d4e4,_0x40a604['error'][_0xa66a('0x14')]);return _0xc539ab(_0x40a604[_0xa66a('0x12')][_0xa66a('0x14')]);}logger[_0xa66a('0x12')](_0xa66a('0xe'),_0x11d4e4,_0x40a604[_0xa66a('0x12')][_0xa66a('0x14')]);return _0x25dcf1(_0x40a604[_0xa66a('0x12')][_0xa66a('0x14')]);}else{logger[_0xa66a('0xd')]('UserSmsQueue,\x20%s,\x20%s',_0x11d4e4,'request\x20sent');_0x25dcf1(_0x40a604['result'][_0xa66a('0x14')]);}})['catch'](function(_0x2b84ed){logger[_0xa66a('0x12')](_0xa66a('0xe'),_0x11d4e4,_0x2b84ed);_0xc539ab(_0x2b84ed);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueue/index.js b/server/api/userVoiceQueue/index.js index 4974133..a14a352 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 _0x7e7b=['../../config/environment','multer','util','path','express','Router','../../components/auth/service'];(function(_0x5d6021,_0x5c57a3){var _0x20208a=function(_0x5a9f4c){while(--_0x5a9f4c){_0x5d6021['push'](_0x5d6021['shift']());}};_0x20208a(++_0x5c57a3);}(_0x7e7b,0x120));var _0xb7e7=function(_0x2291e2,_0x2f2898){_0x2291e2=_0x2291e2-0x0;var _0x33d13f=_0x7e7b[_0x2291e2];return _0x33d13f;};'use strict';var multer=require(_0xb7e7('0x0'));var util=require(_0xb7e7('0x1'));var path=require(_0xb7e7('0x2'));var timeout=require('connect-timeout');var express=require(_0xb7e7('0x3'));var router=express[_0xb7e7('0x4')]();var auth=require(_0xb7e7('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xb7e7('0x6'));module['exports']=router; \ No newline at end of file +var _0x3068=['multer','util','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','exports'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x3068,0xe7));var _0x8306=function(_0x5d2a93,_0x4fe70a){_0x5d2a93=_0x5d2a93-0x0;var _0x2f25f5=_0x3068[_0x5d2a93];return _0x2f25f5;};'use strict';var multer=require(_0x8306('0x0'));var util=require(_0x8306('0x1'));var path=require('path');var timeout=require(_0x8306('0x2'));var express=require('express');var router=express['Router']();var auth=require(_0x8306('0x3'));var interaction=require(_0x8306('0x4'));var config=require(_0x8306('0x5'));module[_0x8306('0x6')]=router; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.attributes.js b/server/api/userVoiceQueue/userVoiceQueue.attributes.js index 593054f..44135ef 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 _0xa9e0=['sequelize','exports','INTEGER'];(function(_0x2cce8e,_0x571784){var _0x209933=function(_0xfa2530){while(--_0xfa2530){_0x2cce8e['push'](_0x2cce8e['shift']());}};_0x209933(++_0x571784);}(_0xa9e0,0x123));var _0x0a9e=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0xa9e0[_0xc6be3a];return _0x56a310;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'penalty':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xa9e0=['sequelize','exports','INTEGER'];(function(_0x2c5d2b,_0x3605b4){var _0x1c81e4=function(_0x47129c){while(--_0x47129c){_0x2c5d2b['push'](_0x2c5d2b['shift']());}};_0x1c81e4(++_0x3605b4);}(_0xa9e0,0x123));var _0x0a9e=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0xa9e0[_0x9df060];return _0x338dfe;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'penalty':{'type':Sequelize[_0x0a9e('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 3659b66..8ce8f38 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 _0x34e5=['request-promise','path','../../config/environment','./userVoiceQueue.attributes','exports','define','UserVoiceQueue','util','api','moment','bluebird'];(function(_0x22d76c,_0x1feded){var _0x9cc8fb=function(_0x2ab6ec){while(--_0x2ab6ec){_0x22d76c['push'](_0x22d76c['shift']());}};_0x9cc8fb(++_0x1feded);}(_0x34e5,0x172));var _0x534e=function(_0xd6a0cf,_0x499672){_0xd6a0cf=_0xd6a0cf-0x0;var _0x3c1a2f=_0x34e5[_0xd6a0cf];return _0x3c1a2f;};'use strict';var _=require('lodash');var util=require(_0x534e('0x0'));var logger=require('../../config/logger')(_0x534e('0x1'));var moment=require(_0x534e('0x2'));var BPromise=require(_0x534e('0x3'));var rp=require(_0x534e('0x4'));var fs=require('fs');var path=require(_0x534e('0x5'));var rimraf=require('rimraf');var config=require(_0x534e('0x6'));var attributes=require(_0x534e('0x7'));module[_0x534e('0x8')]=function(_0x117f0c,_0x436a92){return _0x117f0c[_0x534e('0x9')](_0x534e('0xa'),attributes,{'tableName':'user_has_voice_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5292=['bluebird','request-promise','path','rimraf','./userVoiceQueue.attributes','define','UserVoiceQueue','lodash','util','api'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5292,0xf7));var _0x2529=function(_0x5ac4b6,_0x4d9360){_0x5ac4b6=_0x5ac4b6-0x0;var _0x29ced8=_0x5292[_0x5ac4b6];return _0x29ced8;};'use strict';var _=require(_0x2529('0x0'));var util=require(_0x2529('0x1'));var logger=require('../../config/logger')(_0x2529('0x2'));var moment=require('moment');var BPromise=require(_0x2529('0x3'));var rp=require(_0x2529('0x4'));var fs=require('fs');var path=require(_0x2529('0x5'));var rimraf=require(_0x2529('0x6'));var config=require('../../config/environment');var attributes=require(_0x2529('0x7'));module['exports']=function(_0x4c9b4c,_0x4e7a9e){return _0x4c9b4c[_0x2529('0x8')](_0x2529('0x9'),attributes,{'tableName':'user_has_voice_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.rpc.js b/server/api/userVoiceQueue/userVoiceQueue.rpc.js index 874918b..afbbd4a 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 _0x6b69=['../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','UserVoiceQueue,\x20%s,\x20%s','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','catch','moment','bluebird','randomstring','ioredis'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6b69,0x19e));var _0x96b6=function(_0xc61d33,_0xa9b035){_0xc61d33=_0xc61d33-0x0;var _0x25de52=_0x6b69[_0xc61d33];return _0x25de52;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x96b6('0x0'));var BPromise=require(_0x96b6('0x1'));var rs=require(_0x96b6('0x2'));var fs=require('fs');var Redis=require(_0x96b6('0x3'));var db=require(_0x96b6('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x96b6('0x5'))(_0x96b6('0x6'));var config=require(_0x96b6('0x7'));var jayson=require(_0x96b6('0x8'));var client=jayson[_0x96b6('0x9')][_0x96b6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4a57e6,_0x5585fb,_0x8fa59c){return new BPromise(function(_0x57e59c,_0x2fb074){return client['request'](_0x4a57e6,_0x8fa59c)[_0x96b6('0xb')](function(_0x1260c7){logger['info'](_0x96b6('0xc'),_0x5585fb,'request\x20sent');logger[_0x96b6('0xd')](_0x96b6('0xe'),_0x5585fb,_0x96b6('0xf'),JSON[_0x96b6('0x10')](_0x1260c7));if(_0x1260c7[_0x96b6('0x11')]){if(_0x1260c7[_0x96b6('0x11')][_0x96b6('0x12')]===0x1f4){logger['error']('UserVoiceQueue,\x20%s,\x20%s',_0x5585fb,_0x1260c7[_0x96b6('0x11')][_0x96b6('0x13')]);return _0x2fb074(_0x1260c7[_0x96b6('0x11')][_0x96b6('0x13')]);}logger['error']('UserVoiceQueue,\x20%s,\x20%s',_0x5585fb,_0x1260c7[_0x96b6('0x11')][_0x96b6('0x13')]);return _0x57e59c(_0x1260c7[_0x96b6('0x11')][_0x96b6('0x13')]);}else{logger[_0x96b6('0x14')]('UserVoiceQueue,\x20%s,\x20%s',_0x5585fb,_0x96b6('0xf'));_0x57e59c(_0x1260c7['result'][_0x96b6('0x13')]);}})[_0x96b6('0x15')](function(_0x54fe78){logger['error'](_0x96b6('0xc'),_0x5585fb,_0x54fe78);_0x2fb074(_0x54fe78);});});} \ No newline at end of file +var _0x88c9=['jayson/promise','client','http','request','then','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','util','moment','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x761ef8,_0x322352){var _0x42e592=function(_0x5f0ea1){while(--_0x5f0ea1){_0x761ef8['push'](_0x761ef8['shift']());}};_0x42e592(++_0x322352);}(_0x88c9,0x188));var _0x988c=function(_0x5c9ead,_0x20b0be){_0x5c9ead=_0x5c9ead-0x0;var _0x1cb97c=_0x88c9[_0x5c9ead];return _0x1cb97c;};'use strict';var _=require('lodash');var util=require(_0x988c('0x0'));var moment=require(_0x988c('0x1'));var BPromise=require('bluebird');var rs=require(_0x988c('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x988c('0x3'));var logger=require(_0x988c('0x4'))(_0x988c('0x5'));var config=require(_0x988c('0x6'));var jayson=require(_0x988c('0x7'));var client=jayson[_0x988c('0x8')][_0x988c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4eb8cf,_0xd8468b,_0x32a455){return new BPromise(function(_0x210865,_0x5eb59f){return client[_0x988c('0xa')](_0x4eb8cf,_0x32a455)[_0x988c('0xb')](function(_0xfc477d){logger['info'](_0x988c('0xc'),_0xd8468b,_0x988c('0xd'));logger[_0x988c('0xe')](_0x988c('0xf'),_0xd8468b,_0x988c('0xd'),JSON['stringify'](_0xfc477d));if(_0xfc477d[_0x988c('0x10')]){if(_0xfc477d[_0x988c('0x10')][_0x988c('0x11')]===0x1f4){logger[_0x988c('0x10')](_0x988c('0xc'),_0xd8468b,_0xfc477d[_0x988c('0x10')][_0x988c('0x12')]);return _0x5eb59f(_0xfc477d[_0x988c('0x10')][_0x988c('0x12')]);}logger[_0x988c('0x10')](_0x988c('0xc'),_0xd8468b,_0xfc477d[_0x988c('0x10')]['message']);return _0x210865(_0xfc477d['error'][_0x988c('0x12')]);}else{logger['info'](_0x988c('0xc'),_0xd8468b,_0x988c('0xd'));_0x210865(_0xfc477d[_0x988c('0x13')][_0x988c('0x12')]);}})[_0x988c('0x14')](function(_0x4ff78c){logger[_0x988c('0x10')]('UserVoiceQueue,\x20%s,\x20%s',_0xd8468b,_0x4ff78c);_0x5eb59f(_0x4ff78c);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/index.js b/server/api/userVoiceQueueRt/index.js index ec9218e..c1cbf5e 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 _0x6a3f=['exports','multer','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x47e316,_0x4e1556){var _0x4ada1f=function(_0x7d6c94){while(--_0x7d6c94){_0x47e316['push'](_0x47e316['shift']());}};_0x4ada1f(++_0x4e1556);}(_0x6a3f,0xa9));var _0xf6a3=function(_0x9339c0,_0x5cd34c){_0x9339c0=_0x9339c0-0x0;var _0x58a7b5=_0x6a3f[_0x9339c0];return _0x58a7b5;};'use strict';var multer=require(_0xf6a3('0x0'));var util=require(_0xf6a3('0x1'));var path=require(_0xf6a3('0x2'));var timeout=require(_0xf6a3('0x3'));var express=require('express');var router=express['Router']();var auth=require(_0xf6a3('0x4'));var interaction=require(_0xf6a3('0x5'));var config=require(_0xf6a3('0x6'));module[_0xf6a3('0x7')]=router; \ No newline at end of file +var _0x6a73=['../../components/auth/service','../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router'];(function(_0x5507a3,_0x48d4e5){var _0xb56a86=function(_0x296f0e){while(--_0x296f0e){_0x5507a3['push'](_0x5507a3['shift']());}};_0xb56a86(++_0x48d4e5);}(_0x6a73,0x1c6));var _0x36a7=function(_0x11005e,_0x20c3d2){_0x11005e=_0x11005e-0x0;var _0x29338f=_0x6a73[_0x11005e];return _0x29338f;};'use strict';var multer=require(_0x36a7('0x0'));var util=require(_0x36a7('0x1'));var path=require(_0x36a7('0x2'));var timeout=require('connect-timeout');var express=require(_0x36a7('0x3'));var router=express[_0x36a7('0x4')]();var auth=require(_0x36a7('0x5'));var interaction=require(_0x36a7('0x6'));var config=require(_0x36a7('0x7'));module[_0x36a7('0x8')]=router; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js index ee1b791..7e32602 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 _0x4822=['Required\x20by\x20Asterisk','STRING','queue_interface','exports','INTEGER'];(function(_0x88cd7b,_0x4c884c){var _0x56fcc8=function(_0x513b3d){while(--_0x513b3d){_0x88cd7b['push'](_0x88cd7b['shift']());}};_0x56fcc8(++_0x4c884c);}(_0x4822,0x148));var _0x2482=function(_0x2642cb,_0x4b917f){_0x2642cb=_0x2642cb-0x0;var _0xe6e41=_0x4822[_0x2642cb];return _0xe6e41;};'use strict';var Sequelize=require('sequelize');module[_0x2482('0x0')]={'uniqueid':{'type':Sequelize[_0x2482('0x1')],'primaryKey':!![],'autoIncrement':!![],'comment':_0x2482('0x2')},'membername':{'type':Sequelize[_0x2482('0x3')],'allowNull':![],'comment':'Required\x20by\x20Asterisk'},'UserId':{'type':Sequelize[_0x2482('0x1')],'allowNull':![]},'queue_name':{'type':Sequelize[_0x2482('0x3')],'allowNull':![],'unique':_0x2482('0x4'),'comment':_0x2482('0x2')},'VoiceQueueId':{'type':Sequelize[_0x2482('0x1')],'allowNull':![]},'interface':{'type':Sequelize[_0x2482('0x3')],'allowNull':![],'unique':_0x2482('0x4'),'comment':_0x2482('0x2')},'penalty':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'comment':'Required\x20by\x20Asterisk'},'paused':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'comment':'Required\x20by\x20Asterisk'}}; \ No newline at end of file +var _0xda72=['INTEGER','Required\x20by\x20Asterisk','STRING','queue_interface','sequelize'];(function(_0x31697e,_0x1b7586){var _0x10b5cb=function(_0x27ac07){while(--_0x27ac07){_0x31697e['push'](_0x31697e['shift']());}};_0x10b5cb(++_0x1b7586);}(_0xda72,0x117));var _0x2da7=function(_0x3f711d,_0x240c40){_0x3f711d=_0x3f711d-0x0;var _0x4cb97a=_0xda72[_0x3f711d];return _0x4cb97a;};'use strict';var Sequelize=require(_0x2da7('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x2da7('0x1')],'primaryKey':!![],'autoIncrement':!![],'comment':_0x2da7('0x2')},'membername':{'type':Sequelize[_0x2da7('0x3')],'allowNull':![],'comment':_0x2da7('0x2')},'UserId':{'type':Sequelize[_0x2da7('0x1')],'allowNull':![]},'queue_name':{'type':Sequelize[_0x2da7('0x3')],'allowNull':![],'unique':_0x2da7('0x4'),'comment':_0x2da7('0x2')},'VoiceQueueId':{'type':Sequelize[_0x2da7('0x1')],'allowNull':![]},'interface':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x2da7('0x4'),'comment':'Required\x20by\x20Asterisk'},'penalty':{'type':Sequelize[_0x2da7('0x1')](0xb),'defaultValue':0x0,'comment':'Required\x20by\x20Asterisk'},'paused':{'type':Sequelize[_0x2da7('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 f169f3d..c51a6be 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 _0xdc5c=['exports','../../mysqldb','UserVoiceQueueRt','update','remove','emit','hasOwnProperty','hook'];(function(_0xfcd308,_0x258094){var _0x4c6e2a=function(_0x466843){while(--_0x466843){_0xfcd308['push'](_0xfcd308['shift']());}};_0x4c6e2a(++_0x258094);}(_0xdc5c,0x99));var _0xcdc5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xdc5c[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require('events');var UserVoiceQueueRt=require(_0xcdc5('0x0'))['db'][_0xcdc5('0x1')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xcdc5('0x2'),'afterDestroy':_0xcdc5('0x3')};function emitEvent(_0x2d8027){return function(_0x38c3fc,_0x15e71a,_0x308446){UserVoiceQueueRtEvents[_0xcdc5('0x4')](_0x2d8027+':'+_0x38c3fc['id'],_0x38c3fc);UserVoiceQueueRtEvents[_0xcdc5('0x4')](_0x2d8027,_0x38c3fc);_0x308446(null);};}for(var e in events){if(events[_0xcdc5('0x5')](e)){var event=events[e];UserVoiceQueueRt[_0xcdc5('0x6')](e,emitEvent(event));}}module[_0xcdc5('0x7')]=UserVoiceQueueRtEvents; \ No newline at end of file +var _0x4bcd=['exports','UserVoiceQueueRt','setMaxListeners','update','emit','hasOwnProperty','hook'];(function(_0x90d801,_0x5e10e5){var _0x136d39=function(_0x5b723c){while(--_0x5b723c){_0x90d801['push'](_0x90d801['shift']());}};_0x136d39(++_0x5e10e5);}(_0x4bcd,0xef));var _0xd4bc=function(_0x4b3311,_0x395eb0){_0x4b3311=_0x4b3311-0x0;var _0x3e8d47=_0x4bcd[_0x4b3311];return _0x3e8d47;};'use strict';var EventEmitter=require('events');var UserVoiceQueueRt=require('../../mysqldb')['db'][_0xd4bc('0x0')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0xd4bc('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0xd4bc('0x2'),'afterDestroy':'remove'};function emitEvent(_0xaf266c){return function(_0x86b37a,_0x44a1d1,_0xa578d0){UserVoiceQueueRtEvents[_0xd4bc('0x3')](_0xaf266c+':'+_0x86b37a['id'],_0x86b37a);UserVoiceQueueRtEvents[_0xd4bc('0x3')](_0xaf266c,_0x86b37a);_0xa578d0(null);};}for(var e in events){if(events[_0xd4bc('0x4')](e)){var event=events[e];UserVoiceQueueRt[_0xd4bc('0x5')](e,emitEvent(event));}}module[_0xd4bc('0x6')]=UserVoiceQueueRtEvents; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js index 2cdb6c6..407b0ce 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 _0x2a8e=['exports','define','UserVoiceQueueRt','user_has_voice_queues_rt','lodash','util','../../config/logger','moment','path','rimraf','../../config/environment'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x2a8e,0x1c7));var _0xe2a8=function(_0x42b39d,_0x20bd57){_0x42b39d=_0x42b39d-0x0;var _0x2d7a85=_0x2a8e[_0x42b39d];return _0x2d7a85;};'use strict';var _=require(_0xe2a8('0x0'));var util=require(_0xe2a8('0x1'));var logger=require(_0xe2a8('0x2'))('api');var moment=require(_0xe2a8('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xe2a8('0x4'));var rimraf=require(_0xe2a8('0x5'));var config=require(_0xe2a8('0x6'));var attributes=require('./userVoiceQueueRt.attributes');module[_0xe2a8('0x7')]=function(_0x47d6ac,_0x29145a){return _0x47d6ac[_0xe2a8('0x8')](_0xe2a8('0x9'),attributes,{'tableName':_0xe2a8('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5998=['api','request-promise','rimraf','./userVoiceQueueRt.attributes','exports','define','UserVoiceQueueRt','user_has_voice_queues_rt','lodash','util','../../config/logger'];(function(_0x52f1e6,_0xf70489){var _0x21f104=function(_0xb89f9e){while(--_0xb89f9e){_0x52f1e6['push'](_0x52f1e6['shift']());}};_0x21f104(++_0xf70489);}(_0x5998,0xc3));var _0x8599=function(_0x571fe4,_0x542cae){_0x571fe4=_0x571fe4-0x0;var _0x223b8f=_0x5998[_0x571fe4];return _0x223b8f;};'use strict';var _=require(_0x8599('0x0'));var util=require(_0x8599('0x1'));var logger=require(_0x8599('0x2'))(_0x8599('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x8599('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8599('0x5'));var config=require('../../config/environment');var attributes=require(_0x8599('0x6'));module[_0x8599('0x7')]=function(_0x27e302,_0x145cc5){return _0x27e302[_0x8599('0x8')](_0x8599('0x9'),attributes,{'tableName':_0x8599('0xa'),'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 b0fa31a..b998f2d 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 _0x9a73=['socket.io-emitter','register','then','info','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','GetVoiceQueueRtPauses','UserVoiceQueueRt','options','raw','where','sequelize','COUNT','literal','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','catch','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','defaults','redis','localhost'];(function(_0x1355ec,_0x1bb0cb){var _0x5c6cdd=function(_0x101a23){while(--_0x101a23){_0x1355ec['push'](_0x1355ec['shift']());}};_0x5c6cdd(++_0x1bb0cb);}(_0x9a73,0x1a3));var _0x39a7=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x9a73[_0x17d9e3];return _0x14192d;};'use strict';var _=require('lodash');var util=require(_0x39a7('0x0'));var moment=require('moment');var BPromise=require(_0x39a7('0x1'));var rs=require(_0x39a7('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x39a7('0x3'))['db'];var utils=require(_0x39a7('0x4'));var logger=require(_0x39a7('0x5'))(_0x39a7('0x6'));var config=require(_0x39a7('0x7'));var jayson=require(_0x39a7('0x8'));var client=jayson['client'][_0x39a7('0x9')]({'port':0x232a});config['redis']=_[_0x39a7('0xa')](config[_0x39a7('0xb')],{'host':_0x39a7('0xc'),'port':0x18eb});var socket=require(_0x39a7('0xd'))(new Redis(config[_0x39a7('0xb')]));require('./userVoiceQueueRt.socket')[_0x39a7('0xe')](socket);function respondWithRpcPromise(_0x3e0074,_0x5679d3,_0x402fc0){return new BPromise(function(_0x24cf20,_0xa96c7e){return client['request'](_0x3e0074,_0x402fc0)[_0x39a7('0xf')](function(_0x38524b){logger[_0x39a7('0x10')](_0x39a7('0x11'),_0x5679d3,_0x39a7('0x12'));logger[_0x39a7('0x13')]('UserVoiceQueueRt,\x20%s,\x20%s,\x20%s',_0x5679d3,_0x39a7('0x12'),JSON[_0x39a7('0x14')](_0x38524b));if(_0x38524b[_0x39a7('0x15')]){if(_0x38524b[_0x39a7('0x15')][_0x39a7('0x16')]===0x1f4){logger[_0x39a7('0x15')](_0x39a7('0x11'),_0x5679d3,_0x38524b[_0x39a7('0x15')][_0x39a7('0x17')]);return _0xa96c7e(_0x38524b['error']['message']);}logger[_0x39a7('0x15')](_0x39a7('0x11'),_0x5679d3,_0x38524b[_0x39a7('0x15')][_0x39a7('0x17')]);return _0x24cf20(_0x38524b[_0x39a7('0x15')][_0x39a7('0x17')]);}else{logger[_0x39a7('0x10')](_0x39a7('0x11'),_0x5679d3,_0x39a7('0x12'));_0x24cf20(_0x38524b[_0x39a7('0x18')][_0x39a7('0x17')]);}})['catch'](function(_0x40f04d){logger['error'](_0x39a7('0x11'),_0x5679d3,_0x40f04d);_0xa96c7e(_0x40f04d);});});}exports[_0x39a7('0x19')]=function(_0x34d711){var _0x13368f=this;return new Promise(function(_0x4174d5,_0x157030){return db[_0x39a7('0x1a')]['findAll']({'raw':_0x34d711[_0x39a7('0x1b')]?_0x34d711[_0x39a7('0x1b')][_0x39a7('0x1c')]===undefined?!![]:![]:!![],'where':_0x34d711['options']?_0x34d711[_0x39a7('0x1b')][_0x39a7('0x1d')]||null:null,'attributes':[[db[_0x39a7('0x1e')]['fn'](_0x39a7('0x1f'),db[_0x39a7('0x1e')]['fn']('IF',db[_0x39a7('0x1e')][_0x39a7('0x20')](_0x39a7('0x21')))),_0x39a7('0x22')]]})[_0x39a7('0xf')](function(_0x481a5c){logger[_0x39a7('0x10')]('GetVoiceQueueRtPauses',_0x34d711);logger[_0x39a7('0x13')](_0x39a7('0x19'),_0x34d711,JSON[_0x39a7('0x14')](_0x481a5c));_0x4174d5(_0x481a5c);})[_0x39a7('0x23')](function(_0x5f3114){logger['error'](_0x39a7('0x19'),_0x5f3114['message'],_0x34d711);_0x157030(_0x13368f[_0x39a7('0x15')](0x1f4,_0x5f3114[_0x39a7('0x17')]));});});}; \ No newline at end of file +var _0xb939=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','./userVoiceQueueRt.socket','register','then','info','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent','debug','error','code','message','catch','GetVoiceQueueRtPauses','findAll','options','raw','where','sequelize','COUNT','literal','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','stringify','lodash'];(function(_0x34c442,_0x5f2e18){var _0x2791a9=function(_0x5dc28d){while(--_0x5dc28d){_0x34c442['push'](_0x34c442['shift']());}};_0x2791a9(++_0x5f2e18);}(_0xb939,0x11f));var _0x9b93=function(_0x2a2e6e,_0x23a407){_0x2a2e6e=_0x2a2e6e-0x0;var _0x4cd36c=_0xb939[_0x2a2e6e];return _0x4cd36c;};'use strict';var _=require(_0x9b93('0x0'));var util=require('util');var moment=require(_0x9b93('0x1'));var BPromise=require(_0x9b93('0x2'));var rs=require(_0x9b93('0x3'));var fs=require('fs');var Redis=require(_0x9b93('0x4'));var db=require(_0x9b93('0x5'))['db'];var utils=require(_0x9b93('0x6'));var logger=require(_0x9b93('0x7'))('rpc');var config=require(_0x9b93('0x8'));var jayson=require(_0x9b93('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0x9b93('0xa')]=_[_0x9b93('0xb')](config[_0x9b93('0xa')],{'host':_0x9b93('0xc'),'port':0x18eb});var socket=require(_0x9b93('0xd'))(new Redis(config[_0x9b93('0xa')]));require(_0x9b93('0xe'))[_0x9b93('0xf')](socket);function respondWithRpcPromise(_0x5b0c3d,_0x569428,_0x37115c){return new BPromise(function(_0x22b77f,_0x34c5de){return client['request'](_0x5b0c3d,_0x37115c)[_0x9b93('0x10')](function(_0x4b8357){logger[_0x9b93('0x11')](_0x9b93('0x12'),_0x569428,_0x9b93('0x13'));logger[_0x9b93('0x14')]('UserVoiceQueueRt,\x20%s,\x20%s,\x20%s',_0x569428,_0x9b93('0x13'),JSON['stringify'](_0x4b8357));if(_0x4b8357[_0x9b93('0x15')]){if(_0x4b8357['error'][_0x9b93('0x16')]===0x1f4){logger[_0x9b93('0x15')](_0x9b93('0x12'),_0x569428,_0x4b8357[_0x9b93('0x15')][_0x9b93('0x17')]);return _0x34c5de(_0x4b8357[_0x9b93('0x15')]['message']);}logger[_0x9b93('0x15')](_0x9b93('0x12'),_0x569428,_0x4b8357['error'][_0x9b93('0x17')]);return _0x22b77f(_0x4b8357[_0x9b93('0x15')][_0x9b93('0x17')]);}else{logger['info'](_0x9b93('0x12'),_0x569428,'request\x20sent');_0x22b77f(_0x4b8357['result']['message']);}})[_0x9b93('0x18')](function(_0x4408ca){logger[_0x9b93('0x15')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x569428,_0x4408ca);_0x34c5de(_0x4408ca);});});}exports[_0x9b93('0x19')]=function(_0x48443b){var _0x342add=this;return new Promise(function(_0x45fd1c,_0xfaacf6){return db['UserVoiceQueueRt'][_0x9b93('0x1a')]({'raw':_0x48443b[_0x9b93('0x1b')]?_0x48443b['options'][_0x9b93('0x1c')]===undefined?!![]:![]:!![],'where':_0x48443b[_0x9b93('0x1b')]?_0x48443b[_0x9b93('0x1b')][_0x9b93('0x1d')]||null:null,'attributes':[[db[_0x9b93('0x1e')]['fn'](_0x9b93('0x1f'),db[_0x9b93('0x1e')]['fn']('IF',db[_0x9b93('0x1e')][_0x9b93('0x20')](_0x9b93('0x21')))),_0x9b93('0x22')]]})['then'](function(_0x6c4701){logger['info']('GetVoiceQueueRtPauses',_0x48443b);logger['debug'](_0x9b93('0x19'),_0x48443b,JSON[_0x9b93('0x23')](_0x6c4701));_0x45fd1c(_0x6c4701);})[_0x9b93('0x18')](function(_0x26f6cf){logger[_0x9b93('0x15')](_0x9b93('0x19'),_0x26f6cf[_0x9b93('0x17')],_0x48443b);_0xfaacf6(_0x342add[_0x9b93('0x15')](0x1f4,_0x26f6cf[_0x9b93('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js index 668759d..ca56b5c 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 _0xb6ce=['userVoiceQueueRt:','./userVoiceQueueRt.events','remove','update','emit','register','length'];(function(_0x1cecd4,_0x14cedb){var _0x24526a=function(_0x385fd9){while(--_0x385fd9){_0x1cecd4['push'](_0x1cecd4['shift']());}};_0x24526a(++_0x14cedb);}(_0xb6ce,0xc5));var _0xeb6c=function(_0x498b0e,_0x520d94){_0x498b0e=_0x498b0e-0x0;var _0x431849=_0xb6ce[_0x498b0e];return _0x431849;};'use strict';var UserVoiceQueueRtEvents=require(_0xeb6c('0x0'));var events=['save',_0xeb6c('0x1'),_0xeb6c('0x2')];function createListener(_0x9b452c,_0x1fd447){return function(_0x25afca){_0x1fd447[_0xeb6c('0x3')](_0x9b452c,_0x25afca);};}function removeListener(_0x5c4697,_0x18c324){return function(){UserVoiceQueueRtEvents['removeListener'](_0x5c4697,_0x18c324);};}exports[_0xeb6c('0x4')]=function(_0x2f21a4){for(var _0x59744b=0x0,_0x1d664d=events[_0xeb6c('0x5')];_0x59744b<_0x1d664d;_0x59744b++){var _0x18a6d5=events[_0x59744b];var _0x55a7c7=createListener(_0xeb6c('0x6')+_0x18a6d5,_0x2f21a4);UserVoiceQueueRtEvents['on'](_0x18a6d5,_0x55a7c7);}}; \ No newline at end of file +var _0x3e7f=['length','userVoiceQueueRt:','./userVoiceQueueRt.events','save','update','emit','register'];(function(_0x1f267c,_0x4a53f2){var _0x229bdd=function(_0x27b122){while(--_0x27b122){_0x1f267c['push'](_0x1f267c['shift']());}};_0x229bdd(++_0x4a53f2);}(_0x3e7f,0x136));var _0xf3e7=function(_0x3205c9,_0x59beea){_0x3205c9=_0x3205c9-0x0;var _0x5777f3=_0x3e7f[_0x3205c9];return _0x5777f3;};'use strict';var UserVoiceQueueRtEvents=require(_0xf3e7('0x0'));var events=[_0xf3e7('0x1'),'remove',_0xf3e7('0x2')];function createListener(_0x2ad7ab,_0x4e1f51){return function(_0x17ef9c){_0x4e1f51[_0xf3e7('0x3')](_0x2ad7ab,_0x17ef9c);};}function removeListener(_0x4dea6c,_0x2ced1b){return function(){UserVoiceQueueRtEvents['removeListener'](_0x4dea6c,_0x2ced1b);};}exports[_0xf3e7('0x4')]=function(_0x3b3255){for(var _0x22e309=0x0,_0x185e69=events[_0xf3e7('0x5')];_0x22e309<_0x185e69;_0x22e309++){var _0xf7403=events[_0x22e309];var _0x38f468=createListener(_0xf3e7('0x6')+_0xf7403,_0x3b3255);UserVoiceQueueRtEvents['on'](_0xf7403,_0x38f468);}}; \ No newline at end of file diff --git a/server/api/variable/index.js b/server/api/variable/index.js index 57fb85d..3bff770 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 _0x597e=['../../components/auth/service','../../components/interaction/service','../../config/environment','./variable.controller','get','isAuthenticated','/:id','post','create','put','update','destroy','exports','multer','path','connect-timeout','express','Router'];(function(_0x2dc28f,_0x3b0c6c){var _0xeed1ef=function(_0x2b8553){while(--_0x2b8553){_0x2dc28f['push'](_0x2dc28f['shift']());}};_0xeed1ef(++_0x3b0c6c);}(_0x597e,0x79));var _0xe597=function(_0x54fd37,_0x9c8582){_0x54fd37=_0x54fd37-0x0;var _0x2df3f2=_0x597e[_0x54fd37];return _0x2df3f2;};'use strict';var multer=require(_0xe597('0x0'));var util=require('util');var path=require(_0xe597('0x1'));var timeout=require(_0xe597('0x2'));var express=require(_0xe597('0x3'));var router=express[_0xe597('0x4')]();var auth=require(_0xe597('0x5'));var interaction=require(_0xe597('0x6'));var config=require(_0xe597('0x7'));var controller=require(_0xe597('0x8'));router[_0xe597('0x9')]('/',auth[_0xe597('0xa')](),controller['index']);router[_0xe597('0x9')](_0xe597('0xb'),auth['isAuthenticated'](),controller['show']);router[_0xe597('0xc')]('/',auth[_0xe597('0xa')](),controller[_0xe597('0xd')]);router[_0xe597('0xe')](_0xe597('0xb'),auth[_0xe597('0xa')](),controller[_0xe597('0xf')]);router['delete'](_0xe597('0xb'),auth[_0xe597('0xa')](),controller[_0xe597('0x10')]);module[_0xe597('0x11')]=router; \ No newline at end of file +var _0x6823=['../../components/interaction/service','./variable.controller','get','isAuthenticated','index','/:id','post','put','update','delete','multer','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x28f81d,_0x42c263){var _0x24e7be=function(_0x4e37d2){while(--_0x4e37d2){_0x28f81d['push'](_0x28f81d['shift']());}};_0x24e7be(++_0x42c263);}(_0x6823,0x1b3));var _0x3682=function(_0x254585,_0x199cde){_0x254585=_0x254585-0x0;var _0x721ea7=_0x6823[_0x254585];return _0x721ea7;};'use strict';var multer=require(_0x3682('0x0'));var util=require(_0x3682('0x1'));var path=require(_0x3682('0x2'));var timeout=require(_0x3682('0x3'));var express=require(_0x3682('0x4'));var router=express[_0x3682('0x5')]();var auth=require(_0x3682('0x6'));var interaction=require(_0x3682('0x7'));var config=require('../../config/environment');var controller=require(_0x3682('0x8'));router[_0x3682('0x9')]('/',auth[_0x3682('0xa')](),controller[_0x3682('0xb')]);router[_0x3682('0x9')](_0x3682('0xc'),auth[_0x3682('0xa')](),controller['show']);router[_0x3682('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x3682('0xe')](_0x3682('0xc'),auth[_0x3682('0xa')](),controller[_0x3682('0xf')]);router[_0x3682('0x10')](_0x3682('0xc'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/variable/variable.attributes.js b/server/api/variable/variable.attributes.js index 0475b81..11373b8 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 _0x4dbd=['exports','STRING','name','sequelize'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0x4dbd,0x1e7));var _0xd4db=function(_0x1e007a,_0x445183){_0x1e007a=_0x1e007a-0x0;var _0x305e4b=_0x4dbd[_0x1e007a];return _0x305e4b;};'use strict';var Sequelize=require(_0xd4db('0x0'));module[_0xd4db('0x1')]={'name':{'type':Sequelize[_0xd4db('0x2')],'unique':_0xd4db('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xd4db('0x2')]}}; \ No newline at end of file +var _0x369d=['name','sequelize','STRING'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0x369d,0x169));var _0xd369=function(_0x3c066a,_0xb329a){_0x3c066a=_0x3c066a-0x0;var _0x2cf8e1=_0x369d[_0x3c066a];return _0x2cf8e1;};'use strict';var Sequelize=require(_0xd369('0x0'));module['exports']={'name':{'type':Sequelize[_0xd369('0x1')],'unique':_0xd369('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xd369('0x1')]}}; \ No newline at end of file diff --git a/server/api/variable/variable.controller.js b/server/api/variable/variable.controller.js index cd29ffd..a4d31af 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 _0x2aa4=['end','json','count','offset','limit','set','Content-Range','reject','update','destroy','then','get','Variables','sendStatus','error','stack','name','send','index','Variable','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','merge','map','type','key','field','filter','options','where','includeAll','include','rows','catch','params','create','body','user','role','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','html-pdf','eml-format','rimraf','request-promise','util','path','sox','to-csv','ejs','squel','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','status'];(function(_0x12b01f,_0x29cc87){var _0x3a3d66=function(_0x2834a1){while(--_0x2834a1){_0x12b01f['push'](_0x12b01f['shift']());}};_0x3a3d66(++_0x29cc87);}(_0x2aa4,0xd4));var _0x42aa=function(_0x39faae,_0x28c439){_0x39faae=_0x39faae-0x0;var _0x5c323c=_0x2aa4[_0x39faae];return _0x5c323c;};'use strict';var pdf=require(_0x42aa('0x0'));var emlformat=require(_0x42aa('0x1'));var rimraf=require(_0x42aa('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x42aa('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x42aa('0x4'));var path=require(_0x42aa('0x5'));var sox=require(_0x42aa('0x6'));var csv=require(_0x42aa('0x7'));var ejs=require(_0x42aa('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0x42aa('0x9'));var crypto=require('crypto');var jsforce=require(_0x42aa('0xa'));var deskjs=require(_0x42aa('0xb'));var toCsv=require(_0x42aa('0x7'));var querystring=require('querystring');var Papa=require(_0x42aa('0xc'));var Redis=require('ioredis');var authService=require(_0x42aa('0xd'));var qs=require(_0x42aa('0xe'));var as=require(_0x42aa('0xf'));var hardwareService=require(_0x42aa('0x10'));var logger=require('../../config/logger')(_0x42aa('0x11'));var utils=require(_0x42aa('0x12'));var config=require(_0x42aa('0x13'));var db=require(_0x42aa('0x14'))['db'];function respondWithStatusCode(_0x340623,_0x5c8369){_0x5c8369=_0x5c8369||0xcc;return function(_0x281a82){if(_0x281a82){return _0x340623['sendStatus'](_0x5c8369);}return _0x340623[_0x42aa('0x15')](_0x5c8369)[_0x42aa('0x16')]();};}function respondWithResult(_0x121381,_0x4e9956){_0x4e9956=_0x4e9956||0xc8;return function(_0x15dfc5){if(_0x15dfc5){return _0x121381[_0x42aa('0x15')](_0x4e9956)[_0x42aa('0x17')](_0x15dfc5);}};}function respondWithFilteredResult(_0x107cf1,_0x4bef2a){return function(_0x565773){if(_0x565773){var _0x32ce15=_0x565773[_0x42aa('0x18')],_0xac0c53=_0x4bef2a[_0x42aa('0x19')],_0x4d75c2=_0x4bef2a[_0x42aa('0x19')]+_0x4bef2a[_0x42aa('0x1a')],_0x1d255d;if(_0x4d75c2>=_0x32ce15){_0x4d75c2=_0x32ce15;_0x1d255d=0xc8;}else{_0x1d255d=0xce;}_0x107cf1[_0x42aa('0x15')](_0x1d255d);return _0x107cf1[_0x42aa('0x1b')](_0x42aa('0x1c'),_0xac0c53+'-'+_0x4d75c2+'/'+_0x32ce15)[_0x42aa('0x17')](_0x565773);}return null;};}function patchUpdates(_0x86fbe){return function(_0x2eda1b){try{jsonpatch['apply'](_0x2eda1b,_0x86fbe,!![]);}catch(_0x1973a6){return BPromise[_0x42aa('0x1d')](_0x1973a6);}return _0x2eda1b['save']();};}function saveUpdates(_0x49b76d,_0x13ab0c){return function(_0x229604){if(_0x229604){return _0x229604[_0x42aa('0x1e')](_0x49b76d)['then'](function(_0x586fc2){return _0x586fc2;});}return null;};}function removeEntity(_0x5421c2,_0x2f13e7){return function(_0x55d3b2){if(_0x55d3b2){return _0x55d3b2[_0x42aa('0x1f')]()[_0x42aa('0x20')](function(){var _0x29d2e5=_0x55d3b2[_0x42aa('0x21')]({'plain':!![]});var _0x269d83=_0x42aa('0x22');return db['UserProfileResource']['destroy']({'where':{'type':_0x269d83,'resourceId':_0x29d2e5['id']}})['then'](function(){return _0x55d3b2;});})[_0x42aa('0x20')](function(){_0x5421c2[_0x42aa('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x10bbaf,_0xd0d732){return function(_0x7d5ef5){if(!_0x7d5ef5){_0x10bbaf[_0x42aa('0x23')](0x194);}return _0x7d5ef5;};}function handleError(_0xca6f5d,_0x496d48){_0x496d48=_0x496d48||0x1f4;return function(_0x3ef2ec){logger[_0x42aa('0x24')](_0x3ef2ec[_0x42aa('0x25')]);if(_0x3ef2ec['name']){delete _0x3ef2ec[_0x42aa('0x26')];}_0xca6f5d[_0x42aa('0x15')](_0x496d48)[_0x42aa('0x27')](_0x3ef2ec);};}exports[_0x42aa('0x28')]=function(_0x99bf76,_0x18dfe2){var _0xf4e33e={},_0x4cbd66={},_0x41d036={'count':0x0,'rows':[]};var _0x553076=db[_0x42aa('0x29')][_0x42aa('0x2a')];_0x4cbd66[_0x42aa('0x2b')]=_[_0x42aa('0x2c')](_0x553076);_0x4cbd66[_0x42aa('0x2d')]=_['keys'](_0x99bf76[_0x42aa('0x2d')]);_0x4cbd66[_0x42aa('0x2e')]=_[_0x42aa('0x2f')](_0x4cbd66[_0x42aa('0x2b')],_0x4cbd66[_0x42aa('0x2d')]);_0xf4e33e[_0x42aa('0x30')]=_[_0x42aa('0x2f')](_0x4cbd66[_0x42aa('0x2b')],qs[_0x42aa('0x31')](_0x99bf76['query'][_0x42aa('0x31')]));_0xf4e33e[_0x42aa('0x30')]=_0xf4e33e[_0x42aa('0x30')][_0x42aa('0x32')]?_0xf4e33e[_0x42aa('0x30')]:_0x4cbd66[_0x42aa('0x2b')];if(!_0x99bf76[_0x42aa('0x2d')][_0x42aa('0x33')](_0x42aa('0x34'))){_0xf4e33e[_0x42aa('0x1a')]=qs['limit'](_0x99bf76[_0x42aa('0x2d')][_0x42aa('0x1a')]);_0xf4e33e['offset']=qs[_0x42aa('0x19')](_0x99bf76[_0x42aa('0x2d')]['offset']);}_0xf4e33e[_0x42aa('0x35')]=qs[_0x42aa('0x36')](_0x99bf76[_0x42aa('0x2d')][_0x42aa('0x36')]);_0xf4e33e['where']=qs[_0x42aa('0x2e')](_[_0x42aa('0x37')](_0x99bf76[_0x42aa('0x2d')],_0x4cbd66[_0x42aa('0x2e')]));if(_0x99bf76[_0x42aa('0x2d')]['filter']){_0xf4e33e['where']=_[_0x42aa('0x38')](_0xf4e33e['where'],{'$or':_[_0x42aa('0x39')](_0x553076,function(_0x12c1e2){if(_0x12c1e2[_0x42aa('0x3a')][_0x42aa('0x3b')]!=='VIRTUAL'){var _0x55a18b={};_0x55a18b[_0x12c1e2[_0x42aa('0x3c')]]={'$like':'%'+_0x99bf76[_0x42aa('0x2d')][_0x42aa('0x3d')]+'%'};return _0x55a18b;}})});}_0xf4e33e=_[_0x42aa('0x38')]({},_0xf4e33e,_0x99bf76[_0x42aa('0x3e')]);var _0x4f6a3c={'where':_0xf4e33e[_0x42aa('0x3f')]};return db[_0x42aa('0x29')]['count'](_0x4f6a3c)['then'](function(_0x1c5482){_0x41d036[_0x42aa('0x18')]=_0x1c5482;if(_0x99bf76[_0x42aa('0x2d')][_0x42aa('0x40')]){_0xf4e33e[_0x42aa('0x41')]=[{'all':!![]}];}return db['Variable']['findAll'](_0xf4e33e);})['then'](function(_0x14fee3){_0x41d036[_0x42aa('0x42')]=_0x14fee3;return _0x41d036;})[_0x42aa('0x20')](respondWithFilteredResult(_0x18dfe2,_0xf4e33e))[_0x42aa('0x43')](handleError(_0x18dfe2,null));};exports['show']=function(_0x4588d1,_0x583bc1){var _0x2120a0={'raw':!![],'where':{'id':_0x4588d1[_0x42aa('0x44')]['id']}},_0x352ef5={};_0x352ef5[_0x42aa('0x2b')]=_[_0x42aa('0x2c')](db[_0x42aa('0x29')][_0x42aa('0x2a')]);_0x352ef5[_0x42aa('0x2d')]=_['keys'](_0x4588d1[_0x42aa('0x2d')]);_0x352ef5[_0x42aa('0x2e')]=_['intersection'](_0x352ef5['model'],_0x352ef5['query']);_0x2120a0['attributes']=_['intersection'](_0x352ef5[_0x42aa('0x2b')],qs[_0x42aa('0x31')](_0x4588d1[_0x42aa('0x2d')][_0x42aa('0x31')]));_0x2120a0['attributes']=_0x2120a0['attributes'][_0x42aa('0x32')]?_0x2120a0[_0x42aa('0x30')]:_0x352ef5[_0x42aa('0x2b')];if(_0x4588d1[_0x42aa('0x2d')][_0x42aa('0x40')]){_0x2120a0['include']=[{'all':!![]}];}_0x2120a0=_[_0x42aa('0x38')]({},_0x2120a0,_0x4588d1[_0x42aa('0x3e')]);return db[_0x42aa('0x29')]['find'](_0x2120a0)[_0x42aa('0x20')](handleEntityNotFound(_0x583bc1,null))[_0x42aa('0x20')](respondWithResult(_0x583bc1,null))[_0x42aa('0x43')](handleError(_0x583bc1,null));};exports[_0x42aa('0x45')]=function(_0x112151,_0x5b235e){return db[_0x42aa('0x29')]['create'](_0x112151[_0x42aa('0x46')],{})['then'](function(_0x3b5a13){var _0x4f17b9=_0x112151[_0x42aa('0x47')][_0x42aa('0x21')]({'plain':!![]});if(!_0x4f17b9)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4f17b9[_0x42aa('0x48')]==='user'){var _0x408d85=_0x3b5a13[_0x42aa('0x21')]({'plain':!![]});var _0xbae7c7=_0x42aa('0x22');return db['UserProfileSection']['find']({'where':{'name':_0xbae7c7,'userProfileId':_0x4f17b9[_0x42aa('0x49')]},'raw':!![]})['then'](function(_0x4ea7ee){if(_0x4ea7ee&&_0x4ea7ee[_0x42aa('0x4a')]===0x0){return db[_0x42aa('0x4b')][_0x42aa('0x45')]({'name':_0x408d85[_0x42aa('0x26')],'resourceId':_0x408d85['id'],'type':_0x4ea7ee[_0x42aa('0x26')],'sectionId':_0x4ea7ee['id']},{})[_0x42aa('0x20')](function(){return _0x3b5a13;});}else{return _0x3b5a13;}})[_0x42aa('0x43')](function(_0x1b276a){logger[_0x42aa('0x24')](_0x42aa('0x4c'),_0x1b276a);throw _0x1b276a;});}return _0x3b5a13;})[_0x42aa('0x20')](respondWithResult(_0x5b235e,0xc9))[_0x42aa('0x43')](handleError(_0x5b235e,null));};exports[_0x42aa('0x1e')]=function(_0x233078,_0x4b97d9){if(_0x233078[_0x42aa('0x46')]['id']){delete _0x233078['body']['id'];}return db[_0x42aa('0x29')][_0x42aa('0x4d')]({'where':{'id':_0x233078['params']['id']}})['then'](handleEntityNotFound(_0x4b97d9,null))[_0x42aa('0x20')](saveUpdates(_0x233078[_0x42aa('0x46')],null))['then'](respondWithResult(_0x4b97d9,null))[_0x42aa('0x43')](handleError(_0x4b97d9,null));};exports['destroy']=function(_0x39e4df,_0x1bbb78){return db[_0x42aa('0x29')][_0x42aa('0x4d')]({'where':{'id':_0x39e4df[_0x42aa('0x44')]['id']}})[_0x42aa('0x20')](handleEntityNotFound(_0x1bbb78,null))[_0x42aa('0x20')](removeEntity(_0x1bbb78,null))[_0x42aa('0x43')](handleError(_0x1bbb78,null));}; \ No newline at end of file +var _0xefb0=['querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','status','end','json','offset','apply','reject','save','then','get','UserProfileResource','destroy','sendStatus','stack','name','send','index','rawAttributes','keys','query','filters','intersection','model','attributes','fields','length','limit','order','where','filter','merge','key','field','Variable','count','includeAll','findAll','rows','params','include','find','catch','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','create','error','body','html-pdf','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','squel','crypto'];(function(_0x8ba63,_0x3082f7){var _0x1d1327=function(_0x11d8e3){while(--_0x11d8e3){_0x8ba63['push'](_0x8ba63['shift']());}};_0x1d1327(++_0x3082f7);}(_0xefb0,0x81));var _0x0efb=function(_0x3ee6c1,_0x5177cf){_0x3ee6c1=_0x3ee6c1-0x0;var _0x3cea68=_0xefb0[_0x3ee6c1];return _0x3cea68;};'use strict';var pdf=require(_0x0efb('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x0efb('0x1'));var zipdir=require(_0x0efb('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0efb('0x3'));var moment=require(_0x0efb('0x4'));var BPromise=require(_0x0efb('0x5'));var Mustache=require(_0x0efb('0x6'));var util=require(_0x0efb('0x7'));var path=require('path');var sox=require(_0x0efb('0x8'));var csv=require(_0x0efb('0x9'));var ejs=require(_0x0efb('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x0efb('0xb'));var crypto=require(_0x0efb('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x0efb('0xd'));var Papa=require('papaparse');var Redis=require(_0x0efb('0xe'));var authService=require(_0x0efb('0xf'));var qs=require(_0x0efb('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0efb('0x11'));var logger=require(_0x0efb('0x12'))(_0x0efb('0x13'));var utils=require(_0x0efb('0x14'));var config=require('../../config/environment');var db=require(_0x0efb('0x15'))['db'];function respondWithStatusCode(_0x205d57,_0x5a1a95){_0x5a1a95=_0x5a1a95||0xcc;return function(_0x5e8d93){if(_0x5e8d93){return _0x205d57['sendStatus'](_0x5a1a95);}return _0x205d57[_0x0efb('0x16')](_0x5a1a95)[_0x0efb('0x17')]();};}function respondWithResult(_0x356f57,_0x497b29){_0x497b29=_0x497b29||0xc8;return function(_0x3658fa){if(_0x3658fa){return _0x356f57['status'](_0x497b29)[_0x0efb('0x18')](_0x3658fa);}};}function respondWithFilteredResult(_0x40d8fb,_0x1b0630){return function(_0x515c54){if(_0x515c54){var _0x502e97=_0x515c54['count'],_0x5ccb09=_0x1b0630[_0x0efb('0x19')],_0x2b626d=_0x1b0630[_0x0efb('0x19')]+_0x1b0630['limit'],_0x133eed;if(_0x2b626d>=_0x502e97){_0x2b626d=_0x502e97;_0x133eed=0xc8;}else{_0x133eed=0xce;}_0x40d8fb[_0x0efb('0x16')](_0x133eed);return _0x40d8fb['set']('Content-Range',_0x5ccb09+'-'+_0x2b626d+'/'+_0x502e97)[_0x0efb('0x18')](_0x515c54);}return null;};}function patchUpdates(_0x2bc100){return function(_0xe009e2){try{jsonpatch[_0x0efb('0x1a')](_0xe009e2,_0x2bc100,!![]);}catch(_0x151cfd){return BPromise[_0x0efb('0x1b')](_0x151cfd);}return _0xe009e2[_0x0efb('0x1c')]();};}function saveUpdates(_0x19b01a,_0x36a5aa){return function(_0x17de86){if(_0x17de86){return _0x17de86['update'](_0x19b01a)[_0x0efb('0x1d')](function(_0x99b4a){return _0x99b4a;});}return null;};}function removeEntity(_0x274eb3,_0x3ceaf3){return function(_0x53a2e6){if(_0x53a2e6){return _0x53a2e6['destroy']()[_0x0efb('0x1d')](function(){var _0x3aa2cc=_0x53a2e6[_0x0efb('0x1e')]({'plain':!![]});var _0x1db6c9='Variables';return db[_0x0efb('0x1f')][_0x0efb('0x20')]({'where':{'type':_0x1db6c9,'resourceId':_0x3aa2cc['id']}})[_0x0efb('0x1d')](function(){return _0x53a2e6;});})[_0x0efb('0x1d')](function(){_0x274eb3[_0x0efb('0x16')](0xcc)[_0x0efb('0x17')]();});}};}function handleEntityNotFound(_0x57fc96,_0x2f13fc){return function(_0xe5fb38){if(!_0xe5fb38){_0x57fc96[_0x0efb('0x21')](0x194);}return _0xe5fb38;};}function handleError(_0x446ce4,_0x2e3a62){_0x2e3a62=_0x2e3a62||0x1f4;return function(_0x5ce9dd){logger['error'](_0x5ce9dd[_0x0efb('0x22')]);if(_0x5ce9dd['name']){delete _0x5ce9dd[_0x0efb('0x23')];}_0x446ce4[_0x0efb('0x16')](_0x2e3a62)[_0x0efb('0x24')](_0x5ce9dd);};}exports[_0x0efb('0x25')]=function(_0xa2a976,_0x3c9a35){var _0x2906ba={},_0x37ac5d={},_0x4b3e92={'count':0x0,'rows':[]};var _0x548d7c=db['Variable'][_0x0efb('0x26')];_0x37ac5d['model']=_[_0x0efb('0x27')](_0x548d7c);_0x37ac5d[_0x0efb('0x28')]=_[_0x0efb('0x27')](_0xa2a976[_0x0efb('0x28')]);_0x37ac5d[_0x0efb('0x29')]=_[_0x0efb('0x2a')](_0x37ac5d[_0x0efb('0x2b')],_0x37ac5d['query']);_0x2906ba[_0x0efb('0x2c')]=_[_0x0efb('0x2a')](_0x37ac5d[_0x0efb('0x2b')],qs[_0x0efb('0x2d')](_0xa2a976[_0x0efb('0x28')]['fields']));_0x2906ba['attributes']=_0x2906ba[_0x0efb('0x2c')][_0x0efb('0x2e')]?_0x2906ba[_0x0efb('0x2c')]:_0x37ac5d['model'];if(!_0xa2a976[_0x0efb('0x28')]['hasOwnProperty']('nolimit')){_0x2906ba[_0x0efb('0x2f')]=qs[_0x0efb('0x2f')](_0xa2a976[_0x0efb('0x28')]['limit']);_0x2906ba[_0x0efb('0x19')]=qs['offset'](_0xa2a976[_0x0efb('0x28')][_0x0efb('0x19')]);}_0x2906ba[_0x0efb('0x30')]=qs['sort'](_0xa2a976[_0x0efb('0x28')]['sort']);_0x2906ba[_0x0efb('0x31')]=qs['filters'](_['pick'](_0xa2a976[_0x0efb('0x28')],_0x37ac5d[_0x0efb('0x29')]));if(_0xa2a976[_0x0efb('0x28')][_0x0efb('0x32')]){_0x2906ba[_0x0efb('0x31')]=_[_0x0efb('0x33')](_0x2906ba[_0x0efb('0x31')],{'$or':_['map'](_0x548d7c,function(_0x4140bc){if(_0x4140bc['type'][_0x0efb('0x34')]!=='VIRTUAL'){var _0x30f711={};_0x30f711[_0x4140bc[_0x0efb('0x35')]]={'$like':'%'+_0xa2a976[_0x0efb('0x28')][_0x0efb('0x32')]+'%'};return _0x30f711;}})});}_0x2906ba=_['merge']({},_0x2906ba,_0xa2a976['options']);var _0x70e623={'where':_0x2906ba[_0x0efb('0x31')]};return db[_0x0efb('0x36')][_0x0efb('0x37')](_0x70e623)[_0x0efb('0x1d')](function(_0x4d0ef4){_0x4b3e92['count']=_0x4d0ef4;if(_0xa2a976[_0x0efb('0x28')][_0x0efb('0x38')]){_0x2906ba['include']=[{'all':!![]}];}return db[_0x0efb('0x36')][_0x0efb('0x39')](_0x2906ba);})['then'](function(_0x21ff3e){_0x4b3e92[_0x0efb('0x3a')]=_0x21ff3e;return _0x4b3e92;})[_0x0efb('0x1d')](respondWithFilteredResult(_0x3c9a35,_0x2906ba))['catch'](handleError(_0x3c9a35,null));};exports['show']=function(_0x3e526b,_0x1803ed){var _0x221ae8={'raw':!![],'where':{'id':_0x3e526b[_0x0efb('0x3b')]['id']}},_0x2794fa={};_0x2794fa[_0x0efb('0x2b')]=_[_0x0efb('0x27')](db['Variable'][_0x0efb('0x26')]);_0x2794fa[_0x0efb('0x28')]=_['keys'](_0x3e526b[_0x0efb('0x28')]);_0x2794fa['filters']=_[_0x0efb('0x2a')](_0x2794fa[_0x0efb('0x2b')],_0x2794fa['query']);_0x221ae8[_0x0efb('0x2c')]=_['intersection'](_0x2794fa[_0x0efb('0x2b')],qs['fields'](_0x3e526b[_0x0efb('0x28')]['fields']));_0x221ae8[_0x0efb('0x2c')]=_0x221ae8[_0x0efb('0x2c')][_0x0efb('0x2e')]?_0x221ae8[_0x0efb('0x2c')]:_0x2794fa[_0x0efb('0x2b')];if(_0x3e526b[_0x0efb('0x28')][_0x0efb('0x38')]){_0x221ae8[_0x0efb('0x3c')]=[{'all':!![]}];}_0x221ae8=_[_0x0efb('0x33')]({},_0x221ae8,_0x3e526b['options']);return db['Variable'][_0x0efb('0x3d')](_0x221ae8)[_0x0efb('0x1d')](handleEntityNotFound(_0x1803ed,null))['then'](respondWithResult(_0x1803ed,null))[_0x0efb('0x3e')](handleError(_0x1803ed,null));};exports['create']=function(_0x1a9a7b,_0x5d654f){return db[_0x0efb('0x36')]['create'](_0x1a9a7b['body'],{})[_0x0efb('0x1d')](function(_0x5168e9){var _0x3474b1=_0x1a9a7b[_0x0efb('0x3f')][_0x0efb('0x1e')]({'plain':!![]});if(!_0x3474b1)throw new Error(_0x0efb('0x40'));if(_0x3474b1[_0x0efb('0x41')]===_0x0efb('0x3f')){var _0x559eaa=_0x5168e9[_0x0efb('0x1e')]({'plain':!![]});var _0x718283='Variables';return db['UserProfileSection'][_0x0efb('0x3d')]({'where':{'name':_0x718283,'userProfileId':_0x3474b1[_0x0efb('0x42')]},'raw':!![]})[_0x0efb('0x1d')](function(_0x4c8ab7){if(_0x4c8ab7&&_0x4c8ab7[_0x0efb('0x43')]===0x0){return db[_0x0efb('0x1f')][_0x0efb('0x44')]({'name':_0x559eaa[_0x0efb('0x23')],'resourceId':_0x559eaa['id'],'type':_0x4c8ab7[_0x0efb('0x23')],'sectionId':_0x4c8ab7['id']},{})['then'](function(){return _0x5168e9;});}else{return _0x5168e9;}})['catch'](function(_0xc5ba57){logger[_0x0efb('0x45')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xc5ba57);throw _0xc5ba57;});}return _0x5168e9;})[_0x0efb('0x1d')](respondWithResult(_0x5d654f,0xc9))['catch'](handleError(_0x5d654f,null));};exports['update']=function(_0x2ab341,_0x3f05be){if(_0x2ab341[_0x0efb('0x46')]['id']){delete _0x2ab341[_0x0efb('0x46')]['id'];}return db[_0x0efb('0x36')][_0x0efb('0x3d')]({'where':{'id':_0x2ab341[_0x0efb('0x3b')]['id']}})[_0x0efb('0x1d')](handleEntityNotFound(_0x3f05be,null))[_0x0efb('0x1d')](saveUpdates(_0x2ab341[_0x0efb('0x46')],null))[_0x0efb('0x1d')](respondWithResult(_0x3f05be,null))[_0x0efb('0x3e')](handleError(_0x3f05be,null));};exports[_0x0efb('0x20')]=function(_0x47eedd,_0x2a03b8){return db[_0x0efb('0x36')]['find']({'where':{'id':_0x47eedd[_0x0efb('0x3b')]['id']}})[_0x0efb('0x1d')](handleEntityNotFound(_0x2a03b8,null))[_0x0efb('0x1d')](removeEntity(_0x2a03b8,null))[_0x0efb('0x3e')](handleError(_0x2a03b8,null));}; \ No newline at end of file diff --git a/server/api/variable/variable.model.js b/server/api/variable/variable.model.js index e2cb528..c9ef06f 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 _0xcf14=['./variable.attributes','exports','define','Variable','tools_variables','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf'];(function(_0x18bc75,_0x5a3d11){var _0x250a8a=function(_0x148010){while(--_0x148010){_0x18bc75['push'](_0x18bc75['shift']());}};_0x250a8a(++_0x5a3d11);}(_0xcf14,0xa1));var _0x4cf1=function(_0xf06f8,_0x2fd756){_0xf06f8=_0xf06f8-0x0;var _0x25abf7=_0xcf14[_0xf06f8];return _0x25abf7;};'use strict';var _=require(_0x4cf1('0x0'));var util=require('util');var logger=require(_0x4cf1('0x1'))(_0x4cf1('0x2'));var moment=require('moment');var BPromise=require(_0x4cf1('0x3'));var rp=require(_0x4cf1('0x4'));var fs=require('fs');var path=require(_0x4cf1('0x5'));var rimraf=require(_0x4cf1('0x6'));var config=require('../../config/environment');var attributes=require(_0x4cf1('0x7'));module[_0x4cf1('0x8')]=function(_0x11a184,_0x12076f){return _0x11a184[_0x4cf1('0x9')](_0x4cf1('0xa'),attributes,{'tableName':_0x4cf1('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x66f4=['Variable','util','moment','bluebird','request-promise','../../config/environment','define'];(function(_0x4f9108,_0x239362){var _0x5da79b=function(_0x335d6a){while(--_0x335d6a){_0x4f9108['push'](_0x4f9108['shift']());}};_0x5da79b(++_0x239362);}(_0x66f4,0x7f));var _0x466f=function(_0x33b259,_0x33ea16){_0x33b259=_0x33b259-0x0;var _0x2da864=_0x66f4[_0x33b259];return _0x2da864;};'use strict';var _=require('lodash');var util=require(_0x466f('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x466f('0x1'));var BPromise=require(_0x466f('0x2'));var rp=require(_0x466f('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x466f('0x4'));var attributes=require('./variable.attributes');module['exports']=function(_0x231b3c,_0x941ea6){return _0x231b3c[_0x466f('0x5')](_0x466f('0x6'),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 4042def..253fa72 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 _0xa4ae=['ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','Variable,\x20%s,\x20%s,\x20%s','stringify','error','code','Variable,\x20%s,\x20%s','message','result','Variable','find','options','raw','attributes','map','include','model','ShowVariable','lodash','util','bluebird','randomstring'];(function(_0xa148b7,_0x2f3eb2){var _0x51efd3=function(_0x34bcec){while(--_0x34bcec){_0xa148b7['push'](_0xa148b7['shift']());}};_0x51efd3(++_0x2f3eb2);}(_0xa4ae,0x97));var _0xea4a=function(_0x3504a0,_0x3f770f){_0x3504a0=_0x3504a0-0x0;var _0x3dfca3=_0xa4ae[_0x3504a0];return _0x3dfca3;};'use strict';var _=require(_0xea4a('0x0'));var util=require(_0xea4a('0x1'));var moment=require('moment');var BPromise=require(_0xea4a('0x2'));var rs=require(_0xea4a('0x3'));var fs=require('fs');var Redis=require(_0xea4a('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xea4a('0x5'));var config=require(_0xea4a('0x6'));var jayson=require(_0xea4a('0x7'));var client=jayson[_0xea4a('0x8')][_0xea4a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1583f5,_0x4cfb5a,_0xe73dc4){return new BPromise(function(_0x324df0,_0x2f2d41){return client[_0xea4a('0xa')](_0x1583f5,_0xe73dc4)[_0xea4a('0xb')](function(_0x31e3a8){logger[_0xea4a('0xc')]('Variable,\x20%s,\x20%s',_0x4cfb5a,_0xea4a('0xd'));logger[_0xea4a('0xe')](_0xea4a('0xf'),_0x4cfb5a,_0xea4a('0xd'),JSON[_0xea4a('0x10')](_0x31e3a8));if(_0x31e3a8[_0xea4a('0x11')]){if(_0x31e3a8[_0xea4a('0x11')][_0xea4a('0x12')]===0x1f4){logger[_0xea4a('0x11')](_0xea4a('0x13'),_0x4cfb5a,_0x31e3a8[_0xea4a('0x11')][_0xea4a('0x14')]);return _0x2f2d41(_0x31e3a8[_0xea4a('0x11')][_0xea4a('0x14')]);}logger[_0xea4a('0x11')](_0xea4a('0x13'),_0x4cfb5a,_0x31e3a8[_0xea4a('0x11')][_0xea4a('0x14')]);return _0x324df0(_0x31e3a8['error'][_0xea4a('0x14')]);}else{logger[_0xea4a('0xc')](_0xea4a('0x13'),_0x4cfb5a,_0xea4a('0xd'));_0x324df0(_0x31e3a8[_0xea4a('0x15')][_0xea4a('0x14')]);}})['catch'](function(_0x3de345){logger['error'](_0xea4a('0x13'),_0x4cfb5a,_0x3de345);_0x2f2d41(_0x3de345);});});}exports['ShowVariable']=function(_0x3398ad){var _0x822b4d=this;return new Promise(function(_0x19ca65,_0x20fbfc){return db[_0xea4a('0x16')][_0xea4a('0x17')]({'raw':_0x3398ad[_0xea4a('0x18')]?_0x3398ad[_0xea4a('0x18')][_0xea4a('0x19')]===undefined?!![]:![]:!![],'where':_0x3398ad[_0xea4a('0x18')]?_0x3398ad['options']['where']||null:null,'attributes':_0x3398ad[_0xea4a('0x18')]?_0x3398ad[_0xea4a('0x18')][_0xea4a('0x1a')]||null:null,'include':_0x3398ad[_0xea4a('0x18')]?_0x3398ad[_0xea4a('0x18')]['include']?_[_0xea4a('0x1b')](_0x3398ad['options'][_0xea4a('0x1c')],function(_0x36ba1d){return{'model':db[_0x36ba1d[_0xea4a('0x1d')]],'as':_0x36ba1d['as'],'attributes':_0x36ba1d[_0xea4a('0x1a')],'include':_0x36ba1d['include']?_[_0xea4a('0x1b')](_0x36ba1d[_0xea4a('0x1c')],function(_0xc69260){return{'model':db[_0xc69260[_0xea4a('0x1d')]],'as':_0xc69260['as'],'attributes':_0xc69260['attributes'],'include':_0xc69260[_0xea4a('0x1c')]?_[_0xea4a('0x1b')](_0xc69260['include'],function(_0x577d76){return{'model':db[_0x577d76[_0xea4a('0x1d')]],'as':_0x577d76['as'],'attributes':_0x577d76['attributes']};}):[]};}):[]};}):[]:[]})[_0xea4a('0xb')](function(_0x1c2b33){logger[_0xea4a('0xc')](_0xea4a('0x1e'),_0x3398ad);logger['debug']('ShowVariable',_0x3398ad,JSON['stringify'](_0x1c2b33));_0x19ca65(_0x1c2b33);})['catch'](function(_0x3c02e7){logger['error']('ShowVariable',_0x3c02e7[_0xea4a('0x14')],_0x3398ad);_0x20fbfc(_0x822b4d[_0xea4a('0x11')](0x1f4,_0x3c02e7[_0xea4a('0x14')]));});});}; \ No newline at end of file +var _0x2ef7=['rpc','jayson/promise','client','http','request','info','Variable,\x20%s,\x20%s','debug','error','code','message','catch','Variable','options','where','attributes','include','map','model','then','ShowVariable','stringify','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x83a7e4,_0xfdb667){var _0x180b40=function(_0x4a3548){while(--_0x4a3548){_0x83a7e4['push'](_0x83a7e4['shift']());}};_0x180b40(++_0xfdb667);}(_0x2ef7,0x14a));var _0x72ef=function(_0x3db37f,_0x574e6c){_0x3db37f=_0x3db37f-0x0;var _0xeb315b=_0x2ef7[_0x3db37f];return _0xeb315b;};'use strict';var _=require('lodash');var util=require(_0x72ef('0x0'));var moment=require(_0x72ef('0x1'));var BPromise=require(_0x72ef('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x72ef('0x3'))['db'];var utils=require(_0x72ef('0x4'));var logger=require(_0x72ef('0x5'))(_0x72ef('0x6'));var config=require('../../config/environment');var jayson=require(_0x72ef('0x7'));var client=jayson[_0x72ef('0x8')][_0x72ef('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xd3073d,_0x90be70,_0x5a1821){return new BPromise(function(_0x5e166e,_0x1119b5){return client[_0x72ef('0xa')](_0xd3073d,_0x5a1821)['then'](function(_0x3af50b){logger[_0x72ef('0xb')](_0x72ef('0xc'),_0x90be70,'request\x20sent');logger[_0x72ef('0xd')]('Variable,\x20%s,\x20%s,\x20%s',_0x90be70,'request\x20sent',JSON['stringify'](_0x3af50b));if(_0x3af50b[_0x72ef('0xe')]){if(_0x3af50b[_0x72ef('0xe')][_0x72ef('0xf')]===0x1f4){logger['error'](_0x72ef('0xc'),_0x90be70,_0x3af50b[_0x72ef('0xe')][_0x72ef('0x10')]);return _0x1119b5(_0x3af50b[_0x72ef('0xe')][_0x72ef('0x10')]);}logger[_0x72ef('0xe')](_0x72ef('0xc'),_0x90be70,_0x3af50b['error'][_0x72ef('0x10')]);return _0x5e166e(_0x3af50b['error'][_0x72ef('0x10')]);}else{logger['info'](_0x72ef('0xc'),_0x90be70,'request\x20sent');_0x5e166e(_0x3af50b['result'][_0x72ef('0x10')]);}})[_0x72ef('0x11')](function(_0xc6dde0){logger[_0x72ef('0xe')]('Variable,\x20%s,\x20%s',_0x90be70,_0xc6dde0);_0x1119b5(_0xc6dde0);});});}exports['ShowVariable']=function(_0x90a4dc){var _0x5dd610=this;return new Promise(function(_0x329afa,_0x181d5d){return db[_0x72ef('0x12')]['find']({'raw':_0x90a4dc['options']?_0x90a4dc['options']['raw']===undefined?!![]:![]:!![],'where':_0x90a4dc[_0x72ef('0x13')]?_0x90a4dc['options'][_0x72ef('0x14')]||null:null,'attributes':_0x90a4dc[_0x72ef('0x13')]?_0x90a4dc['options'][_0x72ef('0x15')]||null:null,'include':_0x90a4dc['options']?_0x90a4dc['options'][_0x72ef('0x16')]?_[_0x72ef('0x17')](_0x90a4dc[_0x72ef('0x13')][_0x72ef('0x16')],function(_0x271be3){return{'model':db[_0x271be3[_0x72ef('0x18')]],'as':_0x271be3['as'],'attributes':_0x271be3[_0x72ef('0x15')],'include':_0x271be3['include']?_[_0x72ef('0x17')](_0x271be3[_0x72ef('0x16')],function(_0x3a7390){return{'model':db[_0x3a7390[_0x72ef('0x18')]],'as':_0x3a7390['as'],'attributes':_0x3a7390[_0x72ef('0x15')],'include':_0x3a7390['include']?_['map'](_0x3a7390['include'],function(_0x3d247c){return{'model':db[_0x3d247c[_0x72ef('0x18')]],'as':_0x3d247c['as'],'attributes':_0x3d247c[_0x72ef('0x15')]};}):[]};}):[]};}):[]:[]})[_0x72ef('0x19')](function(_0x5908aa){logger[_0x72ef('0xb')]('ShowVariable',_0x90a4dc);logger[_0x72ef('0xd')](_0x72ef('0x1a'),_0x90a4dc,JSON[_0x72ef('0x1b')](_0x5908aa));_0x329afa(_0x5908aa);})['catch'](function(_0x3892ee){logger['error'](_0x72ef('0x1a'),_0x3892ee[_0x72ef('0x10')],_0x90a4dc);_0x181d5d(_0x5dd610['error'](0x1f4,_0x3892ee[_0x72ef('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/version/index.js b/server/api/version/index.js index 770d840..996a5b6 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 _0xaf80=['Router','../../components/auth/service','./version.controller','/fetch','isAuthenticated','canUpdate','fetch','get','/reset','reset','/pull','/restart','/migrations','migrations','exports','express'];(function(_0x3e9777,_0x458ee9){var _0x217ada=function(_0x1bbfca){while(--_0x1bbfca){_0x3e9777['push'](_0x3e9777['shift']());}};_0x217ada(++_0x458ee9);}(_0xaf80,0x1ef));var _0x0af8=function(_0x199c2c,_0x28a931){_0x199c2c=_0x199c2c-0x0;var _0x4f6863=_0xaf80[_0x199c2c];return _0x4f6863;};'use strict';var express=require(_0x0af8('0x0'));var router=express[_0x0af8('0x1')]();var auth=require(_0x0af8('0x2'));var controller=require(_0x0af8('0x3'));router['get']('/',controller['index']);router['get'](_0x0af8('0x4'),auth[_0x0af8('0x5')](),auth[_0x0af8('0x6')](),controller[_0x0af8('0x7')]);router[_0x0af8('0x8')](_0x0af8('0x9'),auth['isAuthenticated'](),auth['canUpdate'](),controller[_0x0af8('0xa')]);router['get'](_0x0af8('0xb'),auth[_0x0af8('0x5')](),auth[_0x0af8('0x6')](),controller['pull']);router[_0x0af8('0x8')](_0x0af8('0xc'),auth[_0x0af8('0x5')](),controller['restart']);router['get'](_0x0af8('0xd'),controller[_0x0af8('0xe')]);module[_0x0af8('0xf')]=router; \ No newline at end of file +var _0x536e=['/fetch','isAuthenticated','canUpdate','fetch','/reset','reset','pull','/migrations','express','get','index'];(function(_0x5bccbf,_0x547e42){var _0x2158c6=function(_0x40f28a){while(--_0x40f28a){_0x5bccbf['push'](_0x5bccbf['shift']());}};_0x2158c6(++_0x547e42);}(_0x536e,0x19f));var _0xe536=function(_0x138d25,_0x3824e5){_0x138d25=_0x138d25-0x0;var _0x51d564=_0x536e[_0x138d25];return _0x51d564;};'use strict';var express=require(_0xe536('0x0'));var router=express['Router']();var auth=require('../../components/auth/service');var controller=require('./version.controller');router[_0xe536('0x1')]('/',controller[_0xe536('0x2')]);router[_0xe536('0x1')](_0xe536('0x3'),auth[_0xe536('0x4')](),auth[_0xe536('0x5')](),controller[_0xe536('0x6')]);router[_0xe536('0x1')](_0xe536('0x7'),auth[_0xe536('0x4')](),auth[_0xe536('0x5')](),controller[_0xe536('0x8')]);router[_0xe536('0x1')]('/pull',auth['isAuthenticated'](),auth[_0xe536('0x5')](),controller[_0xe536('0x9')]);router[_0xe536('0x1')]('/restart',auth['isAuthenticated'](),controller['restart']);router[_0xe536('0x1')](_0xe536('0xa'),controller['migrations']);module['exports']=router; \ No newline at end of file diff --git a/server/api/version/version.controller.js b/server/api/version/version.controller.js index aa7cc49..319dd4b 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 _0x97e6=['motion2','then','pm2\x20restart\x20motion\x20%s','catch','migrations','join','length','replace','push','sort','Migration','sequelize','getQueryInterface','constructor','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','server','Database\x20migrated\x20successfully\x20from\x20version\x20','\x20to\x20','last','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','lodash','pkginfo','version','child_process','exec','../../config/environment','../../config/logger','update','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','npm\x20install\x20--production','restart'];(function(_0x51995f,_0x5507c9){var _0x48412a=function(_0x431614){while(--_0x431614){_0x51995f['push'](_0x51995f['shift']());}};_0x48412a(++_0x5507c9);}(_0x97e6,0x159));var _0x697e=function(_0x5db8e5,_0x35e3d5){_0x5db8e5=_0x5db8e5-0x0;var _0x4f800d=_0x97e6[_0x5db8e5];return _0x4f800d;};'use strict';var Umzug=require(_0x697e('0x0'));var path=require('path');var fs=require('fs');var _=require(_0x697e('0x1'));var pkginfo=require(_0x697e('0x2'))(module,_0x697e('0x3'));var compareVersions=require('compare-versions');var exec=require(_0x697e('0x4'))[_0x697e('0x5')];var db=require('../../mysqldb')['db'];var config=require(_0x697e('0x6'));var pm2=require('../../config/pm2');var logger=require(_0x697e('0x7'))(_0x697e('0x8'));var git=require(_0x697e('0x9'))(config[_0x697e('0xa')]);exports[_0x697e('0xb')]=function(_0x21b9d5,_0x4cf39f){var _0x5670e3={'current':module[_0x697e('0xc')][_0x697e('0x3')],'phonebar':0x2};if(_0x21b9d5[_0x697e('0xd')]&&_0x21b9d5['query'][_0x697e('0xe')]){return git[_0x697e('0xf')]()[_0x697e('0x10')](function(_0x1c7aa7,_0x3c528a){_0x5670e3['latest']=(_0x1c7aa7?module[_0x697e('0xc')]['version']:_0x3c528a['latest'])||_0x697e('0x11');return _0x4cf39f[_0x697e('0x12')](0xc8)[_0x697e('0x13')](_0x5670e3);});}else{return _0x4cf39f['status'](0xc8)[_0x697e('0x13')](_0x5670e3);}};exports[_0x697e('0xf')]=function(_0x53f190,_0x504b68){return git[_0x697e('0xf')]([_0x697e('0x14'),_0x697e('0x15')],function(_0x2254c1){if(_0x2254c1){logger[_0x697e('0x16')](_0x2254c1);return _0x504b68[_0x697e('0x12')](0x1f4)[_0x697e('0x13')](_0x2254c1);}logger[_0x697e('0x17')](_0x697e('0x18'));return _0x504b68['status'](0xc8)[_0x697e('0x13')]({'output':_0x697e('0x19')});});};exports['reset']=function(_0x5ea3ec,_0x5edd20){return git[_0x697e('0x1a')]([_0x697e('0x1b'),'FETCH_HEAD'],function(_0xa000e4){if(_0xa000e4){logger[_0x697e('0x16')](_0xa000e4);return _0x5edd20[_0x697e('0x12')](0x1f4)[_0x697e('0x13')](_0xa000e4);}logger[_0x697e('0x17')](_0x697e('0x1c'));return _0x5edd20[_0x697e('0x12')](0xc8)[_0x697e('0x13')]({'output':_0x697e('0x1d')});});};exports[_0x697e('0x1e')]=function(_0x40525f,_0x495283){exec(_0x697e('0x1f'),function(_0x5949e5,_0x179fab,_0x2e1609){logger['info'](_0x179fab);logger[_0x697e('0x17')](_0x2e1609);if(_0x5949e5){logger['error'](_0x5949e5);return _0x495283[_0x697e('0x12')](0x1f4)[_0x697e('0x13')](_0x5949e5);}return _0x495283[_0x697e('0x12')](0xc8)[_0x697e('0x13')]({'output':_0x179fab});});};exports[_0x697e('0x20')]=function(_0x4b4514,_0x4b5222){return pm2[_0x697e('0x20')](_0x697e('0x21'))[_0x697e('0x22')](function(_0x3f6432){logger[_0x697e('0x17')](_0x697e('0x23'),_0x3f6432);return _0x4b5222[_0x697e('0x12')](0xc8)['json']({'output':'Your\x20system\x20has\x20been\x20restart\x20successfully'});})[_0x697e('0x24')](function(_0x2cc855){logger[_0x697e('0x16')](_0x2cc855);return _0x4b5222[_0x697e('0x12')](0x1f4)[_0x697e('0x13')](_0x2cc855);});};exports[_0x697e('0x25')]=function(_0x33f4b5,_0x55833e){var _0x492b6a=fs['readdirSync'](path[_0x697e('0x26')](config['root'],'server','migrations'));var _0x500b95=[];for(var _0x367f74=0x0;_0x367f74<_0x492b6a[_0x697e('0x27')];_0x367f74++){var _0x164cef=_0x492b6a[_0x367f74][_0x697e('0x28')]('.js','');if(compareVersions(module[_0x697e('0xc')][_0x697e('0x3')],_0x164cef)===-0x1){_0x500b95[_0x697e('0x29')](_0x164cef);}}if(_0x500b95[_0x697e('0x27')]){var _0x3f9688=_0x500b95[_0x697e('0x2a')](compareVersions);var _0x5c54f9=new Umzug({'storage':'sequelize','storageOptions':{'model':db[_0x697e('0x2b')],'modelName':_0x697e('0x2b'),'columnName':'version'},'migrations':{'params':[db[_0x697e('0x2c')][_0x697e('0x2d')](),db['sequelize'][_0x697e('0x2e')],function(){throw new Error(_0x697e('0x2f'));}],'path':path[_0x697e('0x26')](config[_0x697e('0xa')],_0x697e('0x30'),_0x697e('0x25')),'pattern':/\.js$/}});_0x5c54f9['up']({'migrations':_['map'](_0x3f9688,function(_0x119ce9){return _0x119ce9+'.js';})})['then'](function(){return _0x55833e[_0x697e('0x12')](0xc8)[_0x697e('0x13')]({'output':_0x697e('0x31')+module['exports'][_0x697e('0x3')]+_0x697e('0x32')+_[_0x697e('0x33')](_0x3f9688),'migrations':_['join'](_0x3f9688)});})[_0x697e('0x24')](function(_0x1de7a9){if(_0x1de7a9 instanceof db[_0x697e('0x2c')][_0x697e('0x34')]){return _0x55833e[_0x697e('0x12')](0xc8)['json']({'output':'Database\x20already\x20up-to-date'});}else{return _0x55833e[_0x697e('0x12')](0x1f4)[_0x697e('0x13')](_0x1de7a9);}});}else{return _0x55833e[_0x697e('0x12')](0xc8)[_0x697e('0x13')]({'output':_0x697e('0x35')});}}; \ No newline at end of file +var _0xa1cc=['Database\x20migrated\x20successfully\x20from\x20version\x20','exports','\x20to\x20','last','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','path','lodash','version','compare-versions','child_process','../../mysqldb','../../config/pm2','../../config/logger','update','simple-git','query','fetch','tags','latest','status','json','error','info','git\x20fetch','git\x20fetch\x20origin\x20master','reset','--hard','FETCH_HEAD','git\x20reset\x20--hard','pull','npm\x20install\x20--production','restart','motion2','then','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','catch','readdirSync','join','root','server','length','.js','push','sort','Migration','sequelize','getQueryInterface','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','migrations','map'];(function(_0x2761ef,_0x5b3f8f){var _0x2bbd16=function(_0x375a09){while(--_0x375a09){_0x2761ef['push'](_0x2761ef['shift']());}};_0x2bbd16(++_0x5b3f8f);}(_0xa1cc,0x10f));var _0xca1c=function(_0x517d51,_0x776dad){_0x517d51=_0x517d51-0x0;var _0x48f2c0=_0xa1cc[_0x517d51];return _0x48f2c0;};'use strict';var Umzug=require(_0xca1c('0x0'));var path=require(_0xca1c('0x1'));var fs=require('fs');var _=require(_0xca1c('0x2'));var pkginfo=require('pkginfo')(module,_0xca1c('0x3'));var compareVersions=require(_0xca1c('0x4'));var exec=require(_0xca1c('0x5'))['exec'];var db=require(_0xca1c('0x6'))['db'];var config=require('../../config/environment');var pm2=require(_0xca1c('0x7'));var logger=require(_0xca1c('0x8'))(_0xca1c('0x9'));var git=require(_0xca1c('0xa'))(config['root']);exports['index']=function(_0x4ff3f7,_0x8fc787){var _0x21f118={'current':module['exports']['version'],'phonebar':0x2};if(_0x4ff3f7['query']&&_0x4ff3f7[_0xca1c('0xb')]['latest']){return git[_0xca1c('0xc')]()[_0xca1c('0xd')](function(_0x21adef,_0x4e8aee){_0x21f118[_0xca1c('0xe')]=(_0x21adef?module['exports'][_0xca1c('0x3')]:_0x4e8aee[_0xca1c('0xe')])||'2.0.0';return _0x8fc787[_0xca1c('0xf')](0xc8)['json'](_0x21f118);});}else{return _0x8fc787[_0xca1c('0xf')](0xc8)[_0xca1c('0x10')](_0x21f118);}};exports[_0xca1c('0xc')]=function(_0x55c182,_0x344d4c){return git[_0xca1c('0xc')](['origin','master'],function(_0x305077){if(_0x305077){logger[_0xca1c('0x11')](_0x305077);return _0x344d4c[_0xca1c('0xf')](0x1f4)[_0xca1c('0x10')](_0x305077);}logger[_0xca1c('0x12')](_0xca1c('0x13'));return _0x344d4c[_0xca1c('0xf')](0xc8)[_0xca1c('0x10')]({'output':_0xca1c('0x14')});});};exports[_0xca1c('0x15')]=function(_0x33152e,_0x10b126){return git[_0xca1c('0x15')]([_0xca1c('0x16'),_0xca1c('0x17')],function(_0x2c37de){if(_0x2c37de){logger['error'](_0x2c37de);return _0x10b126[_0xca1c('0xf')](0x1f4)[_0xca1c('0x10')](_0x2c37de);}logger['info']('git\x20reset\x20--hard\x20FETCH_HEAD');return _0x10b126[_0xca1c('0xf')](0xc8)[_0xca1c('0x10')]({'output':_0xca1c('0x18')});});};exports[_0xca1c('0x19')]=function(_0x140e90,_0x13fa17){exec(_0xca1c('0x1a'),function(_0x5d23ac,_0x115b4d,_0x540596){logger[_0xca1c('0x12')](_0x115b4d);logger[_0xca1c('0x12')](_0x540596);if(_0x5d23ac){logger[_0xca1c('0x11')](_0x5d23ac);return _0x13fa17[_0xca1c('0xf')](0x1f4)['json'](_0x5d23ac);}return _0x13fa17[_0xca1c('0xf')](0xc8)[_0xca1c('0x10')]({'output':_0x115b4d});});};exports['restart']=function(_0x21b022,_0x5986b2){return pm2[_0xca1c('0x1b')](_0xca1c('0x1c'))[_0xca1c('0x1d')](function(_0x77ea99){logger['info'](_0xca1c('0x1e'),_0x77ea99);return _0x5986b2[_0xca1c('0xf')](0xc8)[_0xca1c('0x10')]({'output':_0xca1c('0x1f')});})[_0xca1c('0x20')](function(_0x40a8ca){logger[_0xca1c('0x11')](_0x40a8ca);return _0x5986b2['status'](0x1f4)[_0xca1c('0x10')](_0x40a8ca);});};exports['migrations']=function(_0x573fc,_0x31042a){var _0x4a2406=fs[_0xca1c('0x21')](path[_0xca1c('0x22')](config[_0xca1c('0x23')],_0xca1c('0x24'),'migrations'));var _0x404579=[];for(var _0x267c92=0x0;_0x267c92<_0x4a2406[_0xca1c('0x25')];_0x267c92++){var _0x3f5335=_0x4a2406[_0x267c92]['replace'](_0xca1c('0x26'),'');if(compareVersions(module['exports']['version'],_0x3f5335)===-0x1){_0x404579[_0xca1c('0x27')](_0x3f5335);}}if(_0x404579[_0xca1c('0x25')]){var _0x1d238b=_0x404579[_0xca1c('0x28')](compareVersions);var _0x451179=new Umzug({'storage':'sequelize','storageOptions':{'model':db['Migration'],'modelName':_0xca1c('0x29'),'columnName':_0xca1c('0x3')},'migrations':{'params':[db[_0xca1c('0x2a')][_0xca1c('0x2b')](),db[_0xca1c('0x2a')]['constructor'],function(){throw new Error(_0xca1c('0x2c'));}],'path':path['join'](config[_0xca1c('0x23')],_0xca1c('0x24'),_0xca1c('0x2d')),'pattern':/\.js$/}});_0x451179['up']({'migrations':_[_0xca1c('0x2e')](_0x1d238b,function(_0x4daf01){return _0x4daf01+_0xca1c('0x26');})})[_0xca1c('0x1d')](function(){return _0x31042a[_0xca1c('0xf')](0xc8)[_0xca1c('0x10')]({'output':_0xca1c('0x2f')+module[_0xca1c('0x30')][_0xca1c('0x3')]+_0xca1c('0x31')+_[_0xca1c('0x32')](_0x1d238b),'migrations':_[_0xca1c('0x22')](_0x1d238b)});})[_0xca1c('0x20')](function(_0x3cf99c){if(_0x3cf99c instanceof db['sequelize'][_0xca1c('0x33')]){return _0x31042a[_0xca1c('0xf')](0xc8)['json']({'output':_0xca1c('0x34')});}else{return _0x31042a[_0xca1c('0xf')](0x1f4)['json'](_0x3cf99c);}});}else{return _0x31042a[_0xca1c('0xf')](0xc8)[_0xca1c('0x10')]({'output':_0xca1c('0x34')});}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/index.js b/server/api/voiceAgentReport/index.js index 528be27..499c52e 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 _0x1b6c=['isAuthenticated','describe','/:id','show','post','create','put','delete','destroy','exports','multer','util','path','express','Router','../../components/interaction/service','../../config/environment','get','index','/describe'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x1b6c,0xbe));var _0xc1b6=function(_0x2247ab,_0x3f4162){_0x2247ab=_0x2247ab-0x0;var _0x430062=_0x1b6c[_0x2247ab];return _0x430062;};'use strict';var multer=require(_0xc1b6('0x0'));var util=require(_0xc1b6('0x1'));var path=require(_0xc1b6('0x2'));var timeout=require('connect-timeout');var express=require(_0xc1b6('0x3'));var router=express[_0xc1b6('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xc1b6('0x5'));var config=require(_0xc1b6('0x6'));var controller=require('./voiceAgentReport.controller');router[_0xc1b6('0x7')]('/',auth['isAuthenticated'](),controller[_0xc1b6('0x8')]);router[_0xc1b6('0x7')](_0xc1b6('0x9'),auth[_0xc1b6('0xa')](),controller[_0xc1b6('0xb')]);router[_0xc1b6('0x7')](_0xc1b6('0xc'),auth['isAuthenticated'](),controller[_0xc1b6('0xd')]);router[_0xc1b6('0xe')]('/',auth[_0xc1b6('0xa')](),controller[_0xc1b6('0xf')]);router[_0xc1b6('0x10')](_0xc1b6('0xc'),auth[_0xc1b6('0xa')](),controller['update']);router[_0xc1b6('0x11')](_0xc1b6('0xc'),auth[_0xc1b6('0xa')](),controller[_0xc1b6('0x12')]);module[_0xc1b6('0x13')]=router; \ No newline at end of file +var _0x69fb=['../../components/interaction/service','../../config/environment','./voiceAgentReport.controller','/describe','isAuthenticated','describe','/:id','post','create','delete','destroy','util','path','express','Router'];(function(_0x492275,_0x44cb8b){var _0xe2777d=function(_0x30f0a2){while(--_0x30f0a2){_0x492275['push'](_0x492275['shift']());}};_0xe2777d(++_0x44cb8b);}(_0x69fb,0x137));var _0xb69f=function(_0x4cbce7,_0x139ba2){_0x4cbce7=_0x4cbce7-0x0;var _0x127bf5=_0x69fb[_0x4cbce7];return _0x127bf5;};'use strict';var multer=require('multer');var util=require(_0xb69f('0x0'));var path=require(_0xb69f('0x1'));var timeout=require('connect-timeout');var express=require(_0xb69f('0x2'));var router=express[_0xb69f('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0xb69f('0x4'));var config=require(_0xb69f('0x5'));var controller=require(_0xb69f('0x6'));router['get']('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xb69f('0x7'),auth[_0xb69f('0x8')](),controller[_0xb69f('0x9')]);router['get'](_0xb69f('0xa'),auth['isAuthenticated'](),controller['show']);router[_0xb69f('0xb')]('/',auth[_0xb69f('0x8')](),controller[_0xb69f('0xc')]);router['put'](_0xb69f('0xa'),auth[_0xb69f('0x8')](),controller['update']);router[_0xb69f('0xd')](_0xb69f('0xa'),auth[_0xb69f('0x8')](),controller[_0xb69f('0xe')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.attributes.js b/server/api/voiceAgentReport/voiceAgentReport.attributes.js index 4a2708d..7f73e45 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 _0x7217=['sequelize','STRING','DATE','INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x7217,0x19e));var _0x7721=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x7217[_0x2b4411];return _0x8e41ef;};'use strict';var Sequelize=require(_0x7721('0x0'));module['exports']={'type':{'type':Sequelize[_0x7721('0x1')]},'uniqueid':{'type':Sequelize[_0x7721('0x1')]},'calleridnum':{'type':Sequelize[_0x7721('0x1')]},'calleridname':{'type':Sequelize[_0x7721('0x1')]},'queue':{'type':Sequelize[_0x7721('0x1')]},'interface':{'type':Sequelize['STRING']},'membername':{'type':Sequelize['STRING']},'agentcalledAt':{'type':Sequelize[_0x7721('0x2')]},'agentconnectAt':{'type':Sequelize[_0x7721('0x2')]},'agentcompleteAt':{'type':Sequelize[_0x7721('0x2')]},'agentringnoanswerAt':{'type':Sequelize[_0x7721('0x2')]},'agentdumpAt':{'type':Sequelize[_0x7721('0x2')]},'holdtime':{'type':Sequelize[_0x7721('0x3')]},'agentcomplete':{'type':Sequelize[_0x7721('0x4')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0x7721('0x4')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0x7721('0x4')],'defaultValue':![]},'talktime':{'type':Sequelize[_0x7721('0x3')]},'agentacw':{'type':Sequelize[_0x7721('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x7721('0x3')]},'reason':{'type':Sequelize[_0x7721('0x1')]},'lastevent':{'type':Sequelize[_0x7721('0x1')]},'channel':{'type':Sequelize[_0x7721('0x1')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0x7721('0x1')]},'connectedlinenum':{'type':Sequelize[_0x7721('0x1')]},'connectedlinename':{'type':Sequelize[_0x7721('0x1')]},'language':{'type':Sequelize[_0x7721('0x1')]},'accountcode':{'type':Sequelize[_0x7721('0x1')]},'context':{'type':Sequelize[_0x7721('0x1')]},'exten':{'type':Sequelize[_0x7721('0x1')]},'priority':{'type':Sequelize[_0x7721('0x1')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0x7721('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0x7721('0x1')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0x7721('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0x7721('0x1')]},'destconnectedlinename':{'type':Sequelize[_0x7721('0x1')]},'destlanguage':{'type':Sequelize[_0x7721('0x1')]},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0x7721('0x1')]},'destexten':{'type':Sequelize[_0x7721('0x1')]},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize['STRING']},'answeredelsewheredestinationuniqueid':{'type':Sequelize['STRING']},'answeredelsewheremembername':{'type':Sequelize[_0x7721('0x1')]},'transfer':{'type':Sequelize[_0x7721('0x4')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x7721('0x1')],'comment':_0x7721('0x5')},'transferexten':{'type':Sequelize['STRING']},'transferuniqueid':{'type':Sequelize[_0x7721('0x1')]},'agententerreason':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x31f0=['INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','STRING','DATE'];(function(_0x12fc8d,_0x19ee33){var _0x3f9d04=function(_0x52e51c){while(--_0x52e51c){_0x12fc8d['push'](_0x12fc8d['shift']());}};_0x3f9d04(++_0x19ee33);}(_0x31f0,0xb7));var _0x031f=function(_0x206e2e,_0xe45790){_0x206e2e=_0x206e2e-0x0;var _0x1e3266=_0x31f0[_0x206e2e];return _0x1e3266;};'use strict';var Sequelize=require(_0x031f('0x0'));module['exports']={'type':{'type':Sequelize[_0x031f('0x1')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x031f('0x1')]},'calleridname':{'type':Sequelize[_0x031f('0x1')]},'queue':{'type':Sequelize[_0x031f('0x1')]},'interface':{'type':Sequelize[_0x031f('0x1')]},'membername':{'type':Sequelize['STRING']},'agentcalledAt':{'type':Sequelize[_0x031f('0x2')]},'agentconnectAt':{'type':Sequelize[_0x031f('0x2')]},'agentcompleteAt':{'type':Sequelize['DATE']},'agentringnoanswerAt':{'type':Sequelize['DATE']},'agentdumpAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize[_0x031f('0x3')]},'agentcomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0x031f('0x4')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0x031f('0x4')],'defaultValue':![]},'talktime':{'type':Sequelize[_0x031f('0x3')]},'agentacw':{'type':Sequelize[_0x031f('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize['INTEGER']},'reason':{'type':Sequelize[_0x031f('0x1')]},'lastevent':{'type':Sequelize[_0x031f('0x1')]},'channel':{'type':Sequelize[_0x031f('0x1')]},'channelstate':{'type':Sequelize[_0x031f('0x3')]},'channelstatedesc':{'type':Sequelize[_0x031f('0x1')]},'connectedlinenum':{'type':Sequelize[_0x031f('0x1')]},'connectedlinename':{'type':Sequelize[_0x031f('0x1')]},'language':{'type':Sequelize[_0x031f('0x1')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x031f('0x1')]},'exten':{'type':Sequelize[_0x031f('0x1')]},'priority':{'type':Sequelize[_0x031f('0x1')]},'destchannel':{'type':Sequelize[_0x031f('0x1')]},'destchannelstate':{'type':Sequelize[_0x031f('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0x031f('0x1')]},'destcalleridnum':{'type':Sequelize[_0x031f('0x1')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0x031f('0x1')]},'destconnectedlinename':{'type':Sequelize[_0x031f('0x1')]},'destlanguage':{'type':Sequelize[_0x031f('0x1')]},'destaccountcode':{'type':Sequelize[_0x031f('0x1')]},'destcontext':{'type':Sequelize[_0x031f('0x1')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize[_0x031f('0x1')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0x031f('0x1')]},'answeredelsewheremembername':{'type':Sequelize[_0x031f('0x1')]},'transfer':{'type':Sequelize[_0x031f('0x4')],'defaultValue':![]},'transfertype':{'type':Sequelize['STRING'],'comment':_0x031f('0x5')},'transferexten':{'type':Sequelize[_0x031f('0x1')]},'transferuniqueid':{'type':Sequelize['STRING']},'agententerreason':{'type':Sequelize[_0x031f('0x3')],'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 9f4c804..27ba3bf 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 _0x20ab=['where','pick','filter','map','type','key','VIRTUAL','field','options','VoiceAgentReport','includeAll','findAll','catch','params','include','merge','find','create','body','destroy','describe','html-pdf','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../mysqldb','sendStatus','end','count','offset','status','set','Content-Range','json','reject','save','update','then','error','stack','name','send','index','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','nolimit','limit','order','sort'];(function(_0x20cf1a,_0x43c3b6){var _0x406c67=function(_0x35f824){while(--_0x35f824){_0x20cf1a['push'](_0x20cf1a['shift']());}};_0x406c67(++_0x43c3b6);}(_0x20ab,0x139));var _0xb20a=function(_0x24fc2c,_0x47b500){_0x24fc2c=_0x24fc2c-0x0;var _0x483de4=_0x20ab[_0x24fc2c];return _0x483de4;};'use strict';var pdf=require(_0xb20a('0x0'));var emlformat=require(_0xb20a('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xb20a('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb20a('0x3'));var moment=require(_0xb20a('0x4'));var BPromise=require(_0xb20a('0x5'));var Mustache=require(_0xb20a('0x6'));var util=require(_0xb20a('0x7'));var path=require(_0xb20a('0x8'));var sox=require(_0xb20a('0x9'));var csv=require(_0xb20a('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xb20a('0xb'));var squel=require(_0xb20a('0xc'));var crypto=require(_0xb20a('0xd'));var jsforce=require(_0xb20a('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xb20a('0xa'));var querystring=require(_0xb20a('0xf'));var Papa=require(_0xb20a('0x10'));var Redis=require(_0xb20a('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xb20a('0x12'));var as=require(_0xb20a('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xb20a('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0xb20a('0x15'))['db'];function respondWithStatusCode(_0x2e79b5,_0x2108ed){_0x2108ed=_0x2108ed||0xcc;return function(_0x3bbbe9){if(_0x3bbbe9){return _0x2e79b5[_0xb20a('0x16')](_0x2108ed);}return _0x2e79b5['status'](_0x2108ed)[_0xb20a('0x17')]();};}function respondWithResult(_0x5a69fb,_0xc376a7){_0xc376a7=_0xc376a7||0xc8;return function(_0x1d102e){if(_0x1d102e){return _0x5a69fb['status'](_0xc376a7)['json'](_0x1d102e);}};}function respondWithFilteredResult(_0x1328c2,_0x4bebba){return function(_0x1f90ab){if(_0x1f90ab){var _0x149a74=_0x1f90ab[_0xb20a('0x18')],_0x35bad1=_0x4bebba[_0xb20a('0x19')],_0x46aa1f=_0x4bebba[_0xb20a('0x19')]+_0x4bebba['limit'],_0x59df4f;if(_0x46aa1f>=_0x149a74){_0x46aa1f=_0x149a74;_0x59df4f=0xc8;}else{_0x59df4f=0xce;}_0x1328c2[_0xb20a('0x1a')](_0x59df4f);return _0x1328c2[_0xb20a('0x1b')](_0xb20a('0x1c'),_0x35bad1+'-'+_0x46aa1f+'/'+_0x149a74)[_0xb20a('0x1d')](_0x1f90ab);}return null;};}function patchUpdates(_0xbf87b2){return function(_0xa81d85){try{jsonpatch['apply'](_0xa81d85,_0xbf87b2,!![]);}catch(_0x469148){return BPromise[_0xb20a('0x1e')](_0x469148);}return _0xa81d85[_0xb20a('0x1f')]();};}function saveUpdates(_0x558615,_0x501cbd){return function(_0x270d83){if(_0x270d83){return _0x270d83[_0xb20a('0x20')](_0x558615)['then'](function(_0x1562ff){return _0x1562ff;});}return null;};}function removeEntity(_0x415b65,_0x461ecb){return function(_0x4703a2){if(_0x4703a2){return _0x4703a2['destroy']()[_0xb20a('0x21')](function(){_0x415b65['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1bce7b,_0x2e8102){return function(_0x4ff980){if(!_0x4ff980){_0x1bce7b[_0xb20a('0x16')](0x194);}return _0x4ff980;};}function handleError(_0x213f85,_0x50f85d){_0x50f85d=_0x50f85d||0x1f4;return function(_0x3d7d92){logger[_0xb20a('0x22')](_0x3d7d92[_0xb20a('0x23')]);if(_0x3d7d92[_0xb20a('0x24')]){delete _0x3d7d92[_0xb20a('0x24')];}_0x213f85['status'](_0x50f85d)[_0xb20a('0x25')](_0x3d7d92);};}exports[_0xb20a('0x26')]=function(_0x48da39,_0x12adf1){var _0x1eac21={},_0x2e812c={},_0x6f52e3={'count':0x0,'rows':[]};var _0x1e56f2=db['VoiceAgentReport'][_0xb20a('0x27')];_0x2e812c[_0xb20a('0x28')]=_[_0xb20a('0x29')](_0x1e56f2);_0x2e812c[_0xb20a('0x2a')]=_[_0xb20a('0x29')](_0x48da39[_0xb20a('0x2a')]);_0x2e812c[_0xb20a('0x2b')]=_[_0xb20a('0x2c')](_0x2e812c['model'],_0x2e812c[_0xb20a('0x2a')]);_0x1eac21[_0xb20a('0x2d')]=_[_0xb20a('0x2c')](_0x2e812c['model'],qs['fields'](_0x48da39[_0xb20a('0x2a')][_0xb20a('0x2e')]));_0x1eac21[_0xb20a('0x2d')]=_0x1eac21[_0xb20a('0x2d')][_0xb20a('0x2f')]?_0x1eac21[_0xb20a('0x2d')]:_0x2e812c['model'];if(!_0x48da39[_0xb20a('0x2a')]['hasOwnProperty'](_0xb20a('0x30'))){_0x1eac21[_0xb20a('0x31')]=qs['limit'](_0x48da39[_0xb20a('0x2a')]['limit']);_0x1eac21[_0xb20a('0x19')]=qs[_0xb20a('0x19')](_0x48da39[_0xb20a('0x2a')][_0xb20a('0x19')]);}_0x1eac21[_0xb20a('0x32')]=qs[_0xb20a('0x33')](_0x48da39[_0xb20a('0x2a')]['sort']);_0x1eac21[_0xb20a('0x34')]=qs[_0xb20a('0x2b')](_[_0xb20a('0x35')](_0x48da39['query'],_0x2e812c['filters']));if(_0x48da39[_0xb20a('0x2a')][_0xb20a('0x36')]){_0x1eac21[_0xb20a('0x34')]=_['merge'](_0x1eac21[_0xb20a('0x34')],{'$or':_[_0xb20a('0x37')](_0x1e56f2,function(_0x294066){if(_0x294066[_0xb20a('0x38')][_0xb20a('0x39')]!==_0xb20a('0x3a')){var _0x5c413a={};_0x5c413a[_0x294066[_0xb20a('0x3b')]]={'$like':'%'+_0x48da39[_0xb20a('0x2a')][_0xb20a('0x36')]+'%'};return _0x5c413a;}})});}_0x1eac21=_['merge']({},_0x1eac21,_0x48da39[_0xb20a('0x3c')]);var _0x3b705d={'where':_0x1eac21['where']};return db[_0xb20a('0x3d')][_0xb20a('0x18')](_0x3b705d)[_0xb20a('0x21')](function(_0x3a68da){_0x6f52e3[_0xb20a('0x18')]=_0x3a68da;if(_0x48da39[_0xb20a('0x2a')][_0xb20a('0x3e')]){_0x1eac21['include']=[{'all':!![]}];}return db[_0xb20a('0x3d')][_0xb20a('0x3f')](_0x1eac21);})[_0xb20a('0x21')](function(_0x4be173){_0x6f52e3['rows']=_0x4be173;return _0x6f52e3;})['then'](respondWithFilteredResult(_0x12adf1,_0x1eac21))[_0xb20a('0x40')](handleError(_0x12adf1,null));};exports['show']=function(_0x336874,_0x382ab1){var _0x1cc67a={'raw':![],'where':{'id':_0x336874[_0xb20a('0x41')]['id']}},_0x4e5df3={};_0x4e5df3['model']=_[_0xb20a('0x29')](db['VoiceAgentReport'][_0xb20a('0x27')]);_0x4e5df3[_0xb20a('0x2a')]=_[_0xb20a('0x29')](_0x336874[_0xb20a('0x2a')]);_0x4e5df3[_0xb20a('0x2b')]=_['intersection'](_0x4e5df3[_0xb20a('0x28')],_0x4e5df3[_0xb20a('0x2a')]);_0x1cc67a[_0xb20a('0x2d')]=_[_0xb20a('0x2c')](_0x4e5df3[_0xb20a('0x28')],qs[_0xb20a('0x2e')](_0x336874[_0xb20a('0x2a')]['fields']));_0x1cc67a['attributes']=_0x1cc67a[_0xb20a('0x2d')]['length']?_0x1cc67a[_0xb20a('0x2d')]:_0x4e5df3['model'];if(_0x336874['query'][_0xb20a('0x3e')]){_0x1cc67a[_0xb20a('0x42')]=[{'all':!![]}];}_0x1cc67a=_[_0xb20a('0x43')]({},_0x1cc67a,_0x336874[_0xb20a('0x3c')]);return db[_0xb20a('0x3d')][_0xb20a('0x44')](_0x1cc67a)['then'](handleEntityNotFound(_0x382ab1,null))[_0xb20a('0x21')](respondWithResult(_0x382ab1,null))[_0xb20a('0x40')](handleError(_0x382ab1,null));};exports[_0xb20a('0x45')]=function(_0x364045,_0x300a71){return db[_0xb20a('0x3d')]['create'](_0x364045[_0xb20a('0x46')],{})[_0xb20a('0x21')](respondWithResult(_0x300a71,0xc9))[_0xb20a('0x40')](handleError(_0x300a71,null));};exports['update']=function(_0x1bcd2b,_0x79ee5b){if(_0x1bcd2b[_0xb20a('0x46')]['id']){delete _0x1bcd2b['body']['id'];}return db[_0xb20a('0x3d')]['find']({'where':{'id':_0x1bcd2b[_0xb20a('0x41')]['id']}})[_0xb20a('0x21')](handleEntityNotFound(_0x79ee5b,null))[_0xb20a('0x21')](saveUpdates(_0x1bcd2b[_0xb20a('0x46')],null))[_0xb20a('0x21')](respondWithResult(_0x79ee5b,null))['catch'](handleError(_0x79ee5b,null));};exports[_0xb20a('0x47')]=function(_0x4a76c9,_0x691869){return db['VoiceAgentReport']['find']({'where':{'id':_0x4a76c9[_0xb20a('0x41')]['id']}})[_0xb20a('0x21')](handleEntityNotFound(_0x691869,null))['then'](removeEntity(_0x691869,null))[_0xb20a('0x40')](handleError(_0x691869,null));};exports['describe']=function(_0x51875d,_0x2e1ded){return db[_0xb20a('0x3d')][_0xb20a('0x48')]()[_0xb20a('0x21')](respondWithResult(_0x2e1ded,null))[_0xb20a('0x40')](handleError(_0x2e1ded,null));}; \ No newline at end of file +var _0x9d99=['then','error','stack','name','send','index','VoiceAgentReport','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','key','options','includeAll','findAll','catch','show','params','include','find','create','body','update','destroy','describe','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','end','status','json','count','offset','limit','set','Content-Range','apply','reject','save'];(function(_0x5c1352,_0x1da832){var _0x13c430=function(_0x2580f7){while(--_0x2580f7){_0x5c1352['push'](_0x5c1352['shift']());}};_0x13c430(++_0x1da832);}(_0x9d99,0x1e9));var _0x99d9=function(_0x2e0443,_0x7e5974){_0x2e0443=_0x2e0443-0x0;var _0x52d450=_0x9d99[_0x2e0443];return _0x52d450;};'use strict';var pdf=require(_0x99d9('0x0'));var emlformat=require(_0x99d9('0x1'));var rimraf=require(_0x99d9('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x99d9('0x3'));var rp=require(_0x99d9('0x4'));var moment=require(_0x99d9('0x5'));var BPromise=require(_0x99d9('0x6'));var Mustache=require(_0x99d9('0x7'));var util=require(_0x99d9('0x8'));var path=require(_0x99d9('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x99d9('0xa'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x99d9('0xb'));var deskjs=require(_0x99d9('0xc'));var toCsv=require(_0x99d9('0xd'));var querystring=require(_0x99d9('0xe'));var Papa=require(_0x99d9('0xf'));var Redis=require('ioredis');var authService=require(_0x99d9('0x10'));var qs=require(_0x99d9('0x11'));var as=require(_0x99d9('0x12'));var hardwareService=require(_0x99d9('0x13'));var logger=require(_0x99d9('0x14'))(_0x99d9('0x15'));var utils=require('../../config/utils');var config=require(_0x99d9('0x16'));var db=require(_0x99d9('0x17'))['db'];function respondWithStatusCode(_0x4f53b0,_0x27946b){_0x27946b=_0x27946b||0xcc;return function(_0x273022){if(_0x273022){return _0x4f53b0[_0x99d9('0x18')](_0x27946b);}return _0x4f53b0['status'](_0x27946b)[_0x99d9('0x19')]();};}function respondWithResult(_0x45412d,_0x1291da){_0x1291da=_0x1291da||0xc8;return function(_0x3c17e0){if(_0x3c17e0){return _0x45412d[_0x99d9('0x1a')](_0x1291da)[_0x99d9('0x1b')](_0x3c17e0);}};}function respondWithFilteredResult(_0x5683fe,_0x45e777){return function(_0x18fd09){if(_0x18fd09){var _0x563571=_0x18fd09[_0x99d9('0x1c')],_0x39f7a8=_0x45e777[_0x99d9('0x1d')],_0x15e1d1=_0x45e777[_0x99d9('0x1d')]+_0x45e777[_0x99d9('0x1e')],_0x30ffb7;if(_0x15e1d1>=_0x563571){_0x15e1d1=_0x563571;_0x30ffb7=0xc8;}else{_0x30ffb7=0xce;}_0x5683fe[_0x99d9('0x1a')](_0x30ffb7);return _0x5683fe[_0x99d9('0x1f')](_0x99d9('0x20'),_0x39f7a8+'-'+_0x15e1d1+'/'+_0x563571)[_0x99d9('0x1b')](_0x18fd09);}return null;};}function patchUpdates(_0x298943){return function(_0x267213){try{jsonpatch[_0x99d9('0x21')](_0x267213,_0x298943,!![]);}catch(_0x26f535){return BPromise[_0x99d9('0x22')](_0x26f535);}return _0x267213[_0x99d9('0x23')]();};}function saveUpdates(_0x5b0d4c,_0x479c7a){return function(_0x3c0856){if(_0x3c0856){return _0x3c0856['update'](_0x5b0d4c)[_0x99d9('0x24')](function(_0x3675a2){return _0x3675a2;});}return null;};}function removeEntity(_0x476850,_0x43dda0){return function(_0x210f05){if(_0x210f05){return _0x210f05['destroy']()[_0x99d9('0x24')](function(){_0x476850[_0x99d9('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4a7961,_0x58fa53){return function(_0x242edf){if(!_0x242edf){_0x4a7961['sendStatus'](0x194);}return _0x242edf;};}function handleError(_0x438e5d,_0xfccf1e){_0xfccf1e=_0xfccf1e||0x1f4;return function(_0x490159){logger[_0x99d9('0x25')](_0x490159[_0x99d9('0x26')]);if(_0x490159[_0x99d9('0x27')]){delete _0x490159['name'];}_0x438e5d['status'](_0xfccf1e)[_0x99d9('0x28')](_0x490159);};}exports[_0x99d9('0x29')]=function(_0x5a8c5e,_0x69b0f6){var _0x26ebde={},_0x878466={},_0x483810={'count':0x0,'rows':[]};var _0x12e731=db[_0x99d9('0x2a')][_0x99d9('0x2b')];_0x878466[_0x99d9('0x2c')]=_[_0x99d9('0x2d')](_0x12e731);_0x878466[_0x99d9('0x2e')]=_[_0x99d9('0x2d')](_0x5a8c5e[_0x99d9('0x2e')]);_0x878466[_0x99d9('0x2f')]=_[_0x99d9('0x30')](_0x878466[_0x99d9('0x2c')],_0x878466[_0x99d9('0x2e')]);_0x26ebde[_0x99d9('0x31')]=_[_0x99d9('0x30')](_0x878466['model'],qs[_0x99d9('0x32')](_0x5a8c5e[_0x99d9('0x2e')]['fields']));_0x26ebde['attributes']=_0x26ebde[_0x99d9('0x31')][_0x99d9('0x33')]?_0x26ebde[_0x99d9('0x31')]:_0x878466[_0x99d9('0x2c')];if(!_0x5a8c5e['query'][_0x99d9('0x34')](_0x99d9('0x35'))){_0x26ebde[_0x99d9('0x1e')]=qs[_0x99d9('0x1e')](_0x5a8c5e['query'][_0x99d9('0x1e')]);_0x26ebde[_0x99d9('0x1d')]=qs['offset'](_0x5a8c5e[_0x99d9('0x2e')][_0x99d9('0x1d')]);}_0x26ebde[_0x99d9('0x36')]=qs['sort'](_0x5a8c5e['query'][_0x99d9('0x37')]);_0x26ebde[_0x99d9('0x38')]=qs[_0x99d9('0x2f')](_[_0x99d9('0x39')](_0x5a8c5e[_0x99d9('0x2e')],_0x878466[_0x99d9('0x2f')]));if(_0x5a8c5e[_0x99d9('0x2e')][_0x99d9('0x3a')]){_0x26ebde[_0x99d9('0x38')]=_[_0x99d9('0x3b')](_0x26ebde['where'],{'$or':_[_0x99d9('0x3c')](_0x12e731,function(_0xb25cf1){if(_0xb25cf1['type'][_0x99d9('0x3d')]!=='VIRTUAL'){var _0x273f28={};_0x273f28[_0xb25cf1['field']]={'$like':'%'+_0x5a8c5e[_0x99d9('0x2e')][_0x99d9('0x3a')]+'%'};return _0x273f28;}})});}_0x26ebde=_[_0x99d9('0x3b')]({},_0x26ebde,_0x5a8c5e[_0x99d9('0x3e')]);var _0xece326={'where':_0x26ebde[_0x99d9('0x38')]};return db[_0x99d9('0x2a')][_0x99d9('0x1c')](_0xece326)[_0x99d9('0x24')](function(_0x3e0db0){_0x483810[_0x99d9('0x1c')]=_0x3e0db0;if(_0x5a8c5e[_0x99d9('0x2e')][_0x99d9('0x3f')]){_0x26ebde['include']=[{'all':!![]}];}return db[_0x99d9('0x2a')][_0x99d9('0x40')](_0x26ebde);})[_0x99d9('0x24')](function(_0x3d35d4){_0x483810['rows']=_0x3d35d4;return _0x483810;})['then'](respondWithFilteredResult(_0x69b0f6,_0x26ebde))[_0x99d9('0x41')](handleError(_0x69b0f6,null));};exports[_0x99d9('0x42')]=function(_0x52a6ac,_0x1644a3){var _0x3baf7e={'raw':![],'where':{'id':_0x52a6ac[_0x99d9('0x43')]['id']}},_0x4345ba={};_0x4345ba[_0x99d9('0x2c')]=_[_0x99d9('0x2d')](db[_0x99d9('0x2a')][_0x99d9('0x2b')]);_0x4345ba[_0x99d9('0x2e')]=_['keys'](_0x52a6ac[_0x99d9('0x2e')]);_0x4345ba[_0x99d9('0x2f')]=_['intersection'](_0x4345ba[_0x99d9('0x2c')],_0x4345ba[_0x99d9('0x2e')]);_0x3baf7e[_0x99d9('0x31')]=_[_0x99d9('0x30')](_0x4345ba[_0x99d9('0x2c')],qs[_0x99d9('0x32')](_0x52a6ac['query'][_0x99d9('0x32')]));_0x3baf7e[_0x99d9('0x31')]=_0x3baf7e['attributes'][_0x99d9('0x33')]?_0x3baf7e[_0x99d9('0x31')]:_0x4345ba[_0x99d9('0x2c')];if(_0x52a6ac['query'][_0x99d9('0x3f')]){_0x3baf7e[_0x99d9('0x44')]=[{'all':!![]}];}_0x3baf7e=_[_0x99d9('0x3b')]({},_0x3baf7e,_0x52a6ac[_0x99d9('0x3e')]);return db[_0x99d9('0x2a')][_0x99d9('0x45')](_0x3baf7e)[_0x99d9('0x24')](handleEntityNotFound(_0x1644a3,null))[_0x99d9('0x24')](respondWithResult(_0x1644a3,null))[_0x99d9('0x41')](handleError(_0x1644a3,null));};exports[_0x99d9('0x46')]=function(_0xc0a196,_0x3d0c8e){return db['VoiceAgentReport'][_0x99d9('0x46')](_0xc0a196[_0x99d9('0x47')],{})[_0x99d9('0x24')](respondWithResult(_0x3d0c8e,0xc9))[_0x99d9('0x41')](handleError(_0x3d0c8e,null));};exports[_0x99d9('0x48')]=function(_0x203dce,_0x2389aa){if(_0x203dce[_0x99d9('0x47')]['id']){delete _0x203dce['body']['id'];}return db[_0x99d9('0x2a')]['find']({'where':{'id':_0x203dce['params']['id']}})['then'](handleEntityNotFound(_0x2389aa,null))[_0x99d9('0x24')](saveUpdates(_0x203dce[_0x99d9('0x47')],null))[_0x99d9('0x24')](respondWithResult(_0x2389aa,null))[_0x99d9('0x41')](handleError(_0x2389aa,null));};exports[_0x99d9('0x49')]=function(_0x40e9ce,_0xb8670){return db['VoiceAgentReport'][_0x99d9('0x45')]({'where':{'id':_0x40e9ce['params']['id']}})[_0x99d9('0x24')](handleEntityNotFound(_0xb8670,null))[_0x99d9('0x24')](removeEntity(_0xb8670,null))[_0x99d9('0x41')](handleError(_0xb8670,null));};exports['describe']=function(_0xc55b3e,_0x5d9f0c){return db[_0x99d9('0x2a')][_0x99d9('0x4a')]()['then'](respondWithResult(_0x5d9f0c,null))[_0x99d9('0x41')](handleError(_0x5d9f0c,null));}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.model.js b/server/api/voiceAgentReport/voiceAgentReport.model.js index ec11292..5b65ca9 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 _0xeb9a=['uniqueid','lodash','api','moment','bluebird','path','rimraf','../../config/environment','exports','define','VoiceAgentReport','report_agent'];(function(_0x476e79,_0x2f3250){var _0x5c548b=function(_0x4b6f7e){while(--_0x4b6f7e){_0x476e79['push'](_0x476e79['shift']());}};_0x5c548b(++_0x2f3250);}(_0xeb9a,0x145));var _0xaeb9=function(_0x36c5b0,_0x5001da){_0x36c5b0=_0x36c5b0-0x0;var _0xf19333=_0xeb9a[_0x36c5b0];return _0xf19333;};'use strict';var _=require(_0xaeb9('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xaeb9('0x1'));var moment=require(_0xaeb9('0x2'));var BPromise=require(_0xaeb9('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xaeb9('0x4'));var rimraf=require(_0xaeb9('0x5'));var config=require(_0xaeb9('0x6'));var attributes=require('./voiceAgentReport.attributes');module[_0xaeb9('0x7')]=function(_0x2d91a0,_0x56f4fe){return _0x2d91a0[_0xaeb9('0x8')](_0xaeb9('0x9'),attributes,{'tableName':_0xaeb9('0xa'),'paranoid':![],'indexes':[{'fields':[_0xaeb9('0xb'),'destuniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x98af=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceAgentReport.attributes','exports','VoiceAgentReport','uniqueid','destuniqueid','lodash','../../config/logger','api'];(function(_0x392dbc,_0x4d31cf){var _0x119302=function(_0x250580){while(--_0x250580){_0x392dbc['push'](_0x392dbc['shift']());}};_0x119302(++_0x4d31cf);}(_0x98af,0x131));var _0xf98a=function(_0x46f2b1,_0x45afee){_0x46f2b1=_0x46f2b1-0x0;var _0x5a833c=_0x98af[_0x46f2b1];return _0x5a833c;};'use strict';var _=require(_0xf98a('0x0'));var util=require('util');var logger=require(_0xf98a('0x1'))(_0xf98a('0x2'));var moment=require(_0xf98a('0x3'));var BPromise=require(_0xf98a('0x4'));var rp=require(_0xf98a('0x5'));var fs=require('fs');var path=require(_0xf98a('0x6'));var rimraf=require(_0xf98a('0x7'));var config=require(_0xf98a('0x8'));var attributes=require(_0xf98a('0x9'));module[_0xf98a('0xa')]=function(_0x39b862,_0x867bd5){return _0x39b862['define'](_0xf98a('0xb'),attributes,{'tableName':'report_agent','paranoid':![],'indexes':[{'fields':[_0xf98a('0xc'),_0xf98a('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.rpc.js b/server/api/voiceAgentReport/voiceAgentReport.rpc.js index 8495852..5654d82 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 _0x64b4=['stringify','error','code','message','result','catch','CreateVoiceAgentReport','VoiceAgentReport','create','body','options','raw','UpdateVoiceAgentReport','update','where','attributes','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then','info','VoiceAgentReport,\x20%s,\x20%s','request\x20sent','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x64b4,0x1d7));var _0x464b=function(_0x386959,_0x410eb4){_0x386959=_0x386959-0x0;var _0x19d81c=_0x64b4[_0x386959];return _0x19d81c;};'use strict';var _=require(_0x464b('0x0'));var util=require(_0x464b('0x1'));var moment=require(_0x464b('0x2'));var BPromise=require(_0x464b('0x3'));var rs=require(_0x464b('0x4'));var fs=require('fs');var Redis=require(_0x464b('0x5'));var db=require(_0x464b('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x464b('0x7'))(_0x464b('0x8'));var config=require('../../config/environment');var jayson=require(_0x464b('0x9'));var client=jayson[_0x464b('0xa')][_0x464b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1501ba,_0x3c19f7,_0x31354c){return new BPromise(function(_0x1289c6,_0x24068a){return client[_0x464b('0xc')](_0x1501ba,_0x31354c)[_0x464b('0xd')](function(_0x2af2fd){logger[_0x464b('0xe')](_0x464b('0xf'),_0x3c19f7,_0x464b('0x10'));logger[_0x464b('0x11')](_0x464b('0x12'),_0x3c19f7,_0x464b('0x10'),JSON[_0x464b('0x13')](_0x2af2fd));if(_0x2af2fd[_0x464b('0x14')]){if(_0x2af2fd[_0x464b('0x14')][_0x464b('0x15')]===0x1f4){logger[_0x464b('0x14')]('VoiceAgentReport,\x20%s,\x20%s',_0x3c19f7,_0x2af2fd[_0x464b('0x14')]['message']);return _0x24068a(_0x2af2fd[_0x464b('0x14')][_0x464b('0x16')]);}logger[_0x464b('0x14')](_0x464b('0xf'),_0x3c19f7,_0x2af2fd['error'][_0x464b('0x16')]);return _0x1289c6(_0x2af2fd[_0x464b('0x14')]['message']);}else{logger[_0x464b('0xe')](_0x464b('0xf'),_0x3c19f7,_0x464b('0x10'));_0x1289c6(_0x2af2fd[_0x464b('0x17')][_0x464b('0x16')]);}})[_0x464b('0x18')](function(_0x551339){logger[_0x464b('0x14')](_0x464b('0xf'),_0x3c19f7,_0x551339);_0x24068a(_0x551339);});});}exports[_0x464b('0x19')]=function(_0x5799fb){var _0x104a17=this;return new Promise(function(_0x3ab152,_0x1590d9){return db[_0x464b('0x1a')][_0x464b('0x1b')](_0x5799fb[_0x464b('0x1c')],{'raw':_0x5799fb[_0x464b('0x1d')]?_0x5799fb[_0x464b('0x1d')][_0x464b('0x1e')]===undefined?!![]:![]:!![]})[_0x464b('0xd')](function(_0x426e7d){logger['info'](_0x464b('0x19'),_0x5799fb);logger[_0x464b('0x11')]('CreateVoiceAgentReport',_0x5799fb,JSON['stringify'](_0x426e7d));_0x3ab152(_0x426e7d);})[_0x464b('0x18')](function(_0x308d51){logger['error'](_0x464b('0x19'),_0x308d51[_0x464b('0x16')],_0x5799fb);_0x1590d9(_0x104a17[_0x464b('0x14')](0x1f4,_0x308d51[_0x464b('0x16')]));});});};exports[_0x464b('0x1f')]=function(_0x404724){var _0x590f23=this;return new Promise(function(_0x745e42,_0x34d019){return db['VoiceAgentReport'][_0x464b('0x20')](_0x404724[_0x464b('0x1c')],{'raw':_0x404724['options']?_0x404724[_0x464b('0x1d')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x404724[_0x464b('0x1d')]?_0x404724[_0x464b('0x1d')][_0x464b('0x21')]||null:null,'attributes':_0x404724[_0x464b('0x1d')]?_0x404724[_0x464b('0x1d')][_0x464b('0x22')]||null:null,'limit':_0x404724['options']?_0x404724[_0x464b('0x1d')]['limit']||null:null})[_0x464b('0xd')](function(_0x80c6a7){logger['info'](_0x464b('0x1f'),_0x404724);logger[_0x464b('0x11')](_0x464b('0x1f'),_0x404724,JSON[_0x464b('0x13')](_0x80c6a7));_0x745e42(_0x80c6a7);})[_0x464b('0x18')](function(_0x363204){logger[_0x464b('0x14')](_0x464b('0x1f'),_0x363204['message'],_0x404724);_0x34d019(_0x590f23[_0x464b('0x14')](0x1f4,_0x363204[_0x464b('0x16')]));});});}; \ No newline at end of file +var _0x5836=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceAgentReport,\x20%s,\x20%s','request\x20sent','VoiceAgentReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateVoiceAgentReport','VoiceAgentReport','create','body','options','raw','debug','UpdateVoiceAgentReport','update','where','limit','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger'];(function(_0x218c24,_0x12e2cb){var _0x2470d9=function(_0x509684){while(--_0x509684){_0x218c24['push'](_0x218c24['shift']());}};_0x2470d9(++_0x12e2cb);}(_0x5836,0x16f));var _0x6583=function(_0x5aaf95,_0x5e8f9b){_0x5aaf95=_0x5aaf95-0x0;var _0x1eb0c5=_0x5836[_0x5aaf95];return _0x1eb0c5;};'use strict';var _=require(_0x6583('0x0'));var util=require(_0x6583('0x1'));var moment=require(_0x6583('0x2'));var BPromise=require('bluebird');var rs=require(_0x6583('0x3'));var fs=require('fs');var Redis=require(_0x6583('0x4'));var db=require(_0x6583('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x6583('0x6'))(_0x6583('0x7'));var config=require(_0x6583('0x8'));var jayson=require(_0x6583('0x9'));var client=jayson[_0x6583('0xa')][_0x6583('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x13da72,_0x521994,_0x5d991c){return new BPromise(function(_0xacf43b,_0x1863b6){return client[_0x6583('0xc')](_0x13da72,_0x5d991c)[_0x6583('0xd')](function(_0x10778e){logger[_0x6583('0xe')](_0x6583('0xf'),_0x521994,_0x6583('0x10'));logger['debug'](_0x6583('0x11'),_0x521994,_0x6583('0x10'),JSON[_0x6583('0x12')](_0x10778e));if(_0x10778e[_0x6583('0x13')]){if(_0x10778e[_0x6583('0x13')]['code']===0x1f4){logger[_0x6583('0x13')]('VoiceAgentReport,\x20%s,\x20%s',_0x521994,_0x10778e[_0x6583('0x13')]['message']);return _0x1863b6(_0x10778e[_0x6583('0x13')][_0x6583('0x14')]);}logger['error'](_0x6583('0xf'),_0x521994,_0x10778e['error']['message']);return _0xacf43b(_0x10778e[_0x6583('0x13')][_0x6583('0x14')]);}else{logger[_0x6583('0xe')](_0x6583('0xf'),_0x521994,_0x6583('0x10'));_0xacf43b(_0x10778e[_0x6583('0x15')][_0x6583('0x14')]);}})[_0x6583('0x16')](function(_0x318af6){logger[_0x6583('0x13')](_0x6583('0xf'),_0x521994,_0x318af6);_0x1863b6(_0x318af6);});});}exports[_0x6583('0x17')]=function(_0x3abb5c){var _0x432775=this;return new Promise(function(_0x2700ef,_0x26b01e){return db[_0x6583('0x18')][_0x6583('0x19')](_0x3abb5c[_0x6583('0x1a')],{'raw':_0x3abb5c[_0x6583('0x1b')]?_0x3abb5c[_0x6583('0x1b')][_0x6583('0x1c')]===undefined?!![]:![]:!![]})[_0x6583('0xd')](function(_0x3c0d1b){logger[_0x6583('0xe')]('CreateVoiceAgentReport',_0x3abb5c);logger[_0x6583('0x1d')](_0x6583('0x17'),_0x3abb5c,JSON[_0x6583('0x12')](_0x3c0d1b));_0x2700ef(_0x3c0d1b);})['catch'](function(_0x3c8cfc){logger[_0x6583('0x13')](_0x6583('0x17'),_0x3c8cfc[_0x6583('0x14')],_0x3abb5c);_0x26b01e(_0x432775[_0x6583('0x13')](0x1f4,_0x3c8cfc['message']));});});};exports[_0x6583('0x1e')]=function(_0x2571b5){var _0x2e9040=this;return new Promise(function(_0x11bd71,_0x2c6af3){return db[_0x6583('0x18')][_0x6583('0x1f')](_0x2571b5[_0x6583('0x1a')],{'raw':_0x2571b5[_0x6583('0x1b')]?_0x2571b5[_0x6583('0x1b')][_0x6583('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2571b5['options']?_0x2571b5[_0x6583('0x1b')][_0x6583('0x20')]||null:null,'attributes':_0x2571b5['options']?_0x2571b5[_0x6583('0x1b')]['attributes']||null:null,'limit':_0x2571b5[_0x6583('0x1b')]?_0x2571b5[_0x6583('0x1b')][_0x6583('0x21')]||null:null})[_0x6583('0xd')](function(_0x56d0ea){logger[_0x6583('0xe')](_0x6583('0x1e'),_0x2571b5);logger['debug'](_0x6583('0x1e'),_0x2571b5,JSON[_0x6583('0x12')](_0x56d0ea));_0x11bd71(_0x56d0ea);})[_0x6583('0x16')](function(_0x5c798f){logger[_0x6583('0x13')](_0x6583('0x1e'),_0x5c798f['message'],_0x2571b5);_0x2c6af3(_0x2e9040['error'](0x1f4,_0x5c798f['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/index.js b/server/api/voiceCallReport/index.js index 418046d..731ffd2 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 _0x0dcc=['get','isAuthenticated','index','/describe','describe','/:id','post','create','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./voiceCallReport.controller'];(function(_0x497d19,_0x347880){var _0x381e7e=function(_0x2f3b43){while(--_0x2f3b43){_0x497d19['push'](_0x497d19['shift']());}};_0x381e7e(++_0x347880);}(_0x0dcc,0x19c));var _0xc0dc=function(_0x1e9843,_0x290c80){_0x1e9843=_0x1e9843-0x0;var _0x24a0d3=_0x0dcc[_0x1e9843];return _0x24a0d3;};'use strict';var multer=require(_0xc0dc('0x0'));var util=require('util');var path=require(_0xc0dc('0x1'));var timeout=require(_0xc0dc('0x2'));var express=require(_0xc0dc('0x3'));var router=express[_0xc0dc('0x4')]();var auth=require(_0xc0dc('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xc0dc('0x6'));var controller=require(_0xc0dc('0x7'));router[_0xc0dc('0x8')]('/',auth[_0xc0dc('0x9')](),controller[_0xc0dc('0xa')]);router[_0xc0dc('0x8')](_0xc0dc('0xb'),auth[_0xc0dc('0x9')](),controller[_0xc0dc('0xc')]);router[_0xc0dc('0x8')](_0xc0dc('0xd'),auth[_0xc0dc('0x9')](),controller['show']);router[_0xc0dc('0xe')]('/',auth['isAuthenticated'](),controller[_0xc0dc('0xf')]);router[_0xc0dc('0x10')](_0xc0dc('0xd'),auth[_0xc0dc('0x9')](),controller[_0xc0dc('0x11')]);router[_0xc0dc('0x12')](_0xc0dc('0xd'),auth[_0xc0dc('0x9')](),controller[_0xc0dc('0x13')]);module[_0xc0dc('0x14')]=router; \ No newline at end of file +var _0x167b=['destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','/:id','put','update','delete'];(function(_0x178f52,_0x5d9675){var _0x556f99=function(_0x4a7b17){while(--_0x4a7b17){_0x178f52['push'](_0x178f52['shift']());}};_0x556f99(++_0x5d9675);}(_0x167b,0x17e));var _0xb167=function(_0xa41fa7,_0x58663c){_0xa41fa7=_0xa41fa7-0x0;var _0x291741=_0x167b[_0xa41fa7];return _0x291741;};'use strict';var multer=require(_0xb167('0x0'));var util=require(_0xb167('0x1'));var path=require(_0xb167('0x2'));var timeout=require(_0xb167('0x3'));var express=require(_0xb167('0x4'));var router=express[_0xb167('0x5')]();var auth=require(_0xb167('0x6'));var interaction=require(_0xb167('0x7'));var config=require(_0xb167('0x8'));var controller=require('./voiceCallReport.controller');router[_0xb167('0x9')]('/',auth[_0xb167('0xa')](),controller[_0xb167('0xb')]);router[_0xb167('0x9')](_0xb167('0xc'),auth[_0xb167('0xa')](),controller['describe']);router['get'](_0xb167('0xd'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0xb167('0xa')](),controller['create']);router[_0xb167('0xe')](_0xb167('0xd'),auth[_0xb167('0xa')](),controller[_0xb167('0xf')]);router[_0xb167('0x10')](_0xb167('0xd'),auth[_0xb167('0xa')](),controller[_0xb167('0x11')]);module[_0xb167('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 4880d83..12d2b91 100644 --- a/server/api/voiceCallReport/voiceCallReport.attributes.js +++ b/server/api/voiceCallReport/voiceCallReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['dialer','DATE','INTEGER','sequelize','exports','STRING','internal','inbound-fax','outbound-fax'];(function(_0x15ec35,_0x5b9972){var _0x937cce=function(_0x59326b){while(--_0x59326b){_0x15ec35['push'](_0x15ec35['shift']());}};_0x937cce(++_0x5b9972);}(_0xa9e0,0x123));var _0x0a9e=function(_0x34bc30,_0x177cb0){_0x34bc30=_0x34bc30-0x0;var _0x5706de=_0xa9e0[_0x34bc30];return _0x5706de;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'uniqueid':{'type':Sequelize[_0x0a9e('0x2')]},'type':{'type':Sequelize['ENUM']('inbound',_0x0a9e('0x3'),'outbound',_0x0a9e('0x4'),_0x0a9e('0x5'),_0x0a9e('0x6'))},'tag':{'type':Sequelize[_0x0a9e('0x2')]},'accountcode':{'type':Sequelize[_0x0a9e('0x2')]},'source':{'type':Sequelize['STRING']},'destination':{'type':Sequelize[_0x0a9e('0x2')]},'destinationcontext':{'type':Sequelize[_0x0a9e('0x2')]},'callerid':{'type':Sequelize[_0x0a9e('0x2')]},'channel':{'type':Sequelize['STRING']},'destinationchannel':{'type':Sequelize['STRING']},'lastapplication':{'type':Sequelize[_0x0a9e('0x2')]},'lastdata':{'type':Sequelize['TEXT']},'starttime':{'type':Sequelize['DATE']},'systemanswertime':{'type':Sequelize[_0x0a9e('0x7')]},'answertime':{'type':Sequelize[_0x0a9e('0x7')]},'endtime':{'type':Sequelize[_0x0a9e('0x7')]},'duration':{'type':Sequelize[_0x0a9e('0x8')]},'billableseconds':{'type':Sequelize[_0x0a9e('0x8')]},'mohtime':{'type':Sequelize[_0x0a9e('0x8')],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize['STRING']},'userDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x0a9e('0x2')]},'prefix':{'type':Sequelize[_0x0a9e('0x2')]},'routeid':{'type':Sequelize[_0x0a9e('0x8')]},'sipcallid':{'type':Sequelize[_0x0a9e('0x2')]}}; \ No newline at end of file +var _0xa9e0=['dialer','DATE','INTEGER','sequelize','exports','STRING','internal','inbound-fax','outbound-fax'];(function(_0x4b7b9b,_0xa4aff9){var _0x3be710=function(_0x5b64fa){while(--_0x5b64fa){_0x4b7b9b['push'](_0x4b7b9b['shift']());}};_0x3be710(++_0xa4aff9);}(_0xa9e0,0x123));var _0x0a9e=function(_0x102e37,_0x14a181){_0x102e37=_0x102e37-0x0;var _0x35a07c=_0xa9e0[_0x102e37];return _0x35a07c;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'uniqueid':{'type':Sequelize[_0x0a9e('0x2')]},'type':{'type':Sequelize['ENUM']('inbound',_0x0a9e('0x3'),'outbound',_0x0a9e('0x4'),_0x0a9e('0x5'),_0x0a9e('0x6'))},'tag':{'type':Sequelize[_0x0a9e('0x2')]},'accountcode':{'type':Sequelize[_0x0a9e('0x2')]},'source':{'type':Sequelize['STRING']},'destination':{'type':Sequelize[_0x0a9e('0x2')]},'destinationcontext':{'type':Sequelize[_0x0a9e('0x2')]},'callerid':{'type':Sequelize[_0x0a9e('0x2')]},'channel':{'type':Sequelize['STRING']},'destinationchannel':{'type':Sequelize['STRING']},'lastapplication':{'type':Sequelize[_0x0a9e('0x2')]},'lastdata':{'type':Sequelize['TEXT']},'starttime':{'type':Sequelize['DATE']},'systemanswertime':{'type':Sequelize[_0x0a9e('0x7')]},'answertime':{'type':Sequelize[_0x0a9e('0x7')]},'endtime':{'type':Sequelize[_0x0a9e('0x7')]},'duration':{'type':Sequelize[_0x0a9e('0x8')]},'billableseconds':{'type':Sequelize[_0x0a9e('0x8')]},'mohtime':{'type':Sequelize[_0x0a9e('0x8')],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize['STRING']},'userDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x0a9e('0x2')]},'prefix':{'type':Sequelize[_0x0a9e('0x2')]},'routeid':{'type':Sequelize[_0x0a9e('0x8')]},'sipcallid':{'type':Sequelize[_0x0a9e('0x2')]}}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.controller.js b/server/api/voiceCallReport/voiceCallReport.controller.js index 84d7e99..ee1c325 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 _0x7217=['show','includeAll','create','body','params','describe','uniqueid','find','user','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','json','count','offset','status','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','VoiceCallReport','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','nolimit','limit','order','sort','where','pick','filter','merge','map','type','key','VIRTUAL','options','include','User','findAll','rows','catch'];(function(_0x12dfb7,_0x211cf1){var _0x3f2144=function(_0x42fc1e){while(--_0x42fc1e){_0x12dfb7['push'](_0x12dfb7['shift']());}};_0x3f2144(++_0x211cf1);}(_0x7217,0x19e));var _0x7721=function(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0x7217[_0x4baae2];return _0x1a2285;};'use strict';var pdf=require(_0x7721('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x7721('0x1'));var zipdir=require(_0x7721('0x2'));var jsonpatch=require(_0x7721('0x3'));var rp=require(_0x7721('0x4'));var moment=require(_0x7721('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x7721('0x6'));var path=require(_0x7721('0x7'));var sox=require(_0x7721('0x8'));var csv=require(_0x7721('0x9'));var ejs=require(_0x7721('0xa'));var fs=require('fs');var _=require(_0x7721('0xb'));var squel=require(_0x7721('0xc'));var crypto=require(_0x7721('0xd'));var jsforce=require(_0x7721('0xe'));var deskjs=require(_0x7721('0xf'));var toCsv=require(_0x7721('0x9'));var querystring=require(_0x7721('0x10'));var Papa=require(_0x7721('0x11'));var Redis=require(_0x7721('0x12'));var authService=require(_0x7721('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x7721('0x14'));var hardwareService=require(_0x7721('0x15'));var logger=require(_0x7721('0x16'))(_0x7721('0x17'));var utils=require(_0x7721('0x18'));var config=require(_0x7721('0x19'));var db=require(_0x7721('0x1a'))['db'];function respondWithStatusCode(_0x27b36b,_0x55b4ca){_0x55b4ca=_0x55b4ca||0xcc;return function(_0x2911ec){if(_0x2911ec){return _0x27b36b[_0x7721('0x1b')](_0x55b4ca);}return _0x27b36b['status'](_0x55b4ca)[_0x7721('0x1c')]();};}function respondWithResult(_0x30da54,_0x3f01c5){_0x3f01c5=_0x3f01c5||0xc8;return function(_0x2e9752){if(_0x2e9752){return _0x30da54['status'](_0x3f01c5)[_0x7721('0x1d')](_0x2e9752);}};}function respondWithFilteredResult(_0x25b1c0,_0x534f1b){return function(_0x4e199a){if(_0x4e199a){var _0x4b183e=_0x4e199a[_0x7721('0x1e')],_0x5ed54=_0x534f1b['offset'],_0x25a628=_0x534f1b[_0x7721('0x1f')]+_0x534f1b['limit'],_0x3cc909;if(_0x25a628>=_0x4b183e){_0x25a628=_0x4b183e;_0x3cc909=0xc8;}else{_0x3cc909=0xce;}_0x25b1c0[_0x7721('0x20')](_0x3cc909);return _0x25b1c0['set'](_0x7721('0x21'),_0x5ed54+'-'+_0x25a628+'/'+_0x4b183e)[_0x7721('0x1d')](_0x4e199a);}return null;};}function patchUpdates(_0x3ab5a5){return function(_0x3e140d){try{jsonpatch[_0x7721('0x22')](_0x3e140d,_0x3ab5a5,!![]);}catch(_0x40af90){return BPromise[_0x7721('0x23')](_0x40af90);}return _0x3e140d[_0x7721('0x24')]();};}function saveUpdates(_0x3b29ac,_0xaeccc4){return function(_0x4ce1db){if(_0x4ce1db){return _0x4ce1db[_0x7721('0x25')](_0x3b29ac)[_0x7721('0x26')](function(_0x3a053f){return _0x3a053f;});}return null;};}function removeEntity(_0xd8ad3c,_0x57140c){return function(_0x28f5a6){if(_0x28f5a6){return _0x28f5a6['destroy']()[_0x7721('0x26')](function(){_0xd8ad3c[_0x7721('0x20')](0xcc)[_0x7721('0x1c')]();});}};}function handleEntityNotFound(_0x1caad8,_0x121cc4){return function(_0x395b15){if(!_0x395b15){_0x1caad8[_0x7721('0x1b')](0x194);}return _0x395b15;};}function handleError(_0x5b4d74,_0x216f20){_0x216f20=_0x216f20||0x1f4;return function(_0x1abedb){logger[_0x7721('0x27')](_0x1abedb[_0x7721('0x28')]);if(_0x1abedb[_0x7721('0x29')]){delete _0x1abedb[_0x7721('0x29')];}_0x5b4d74[_0x7721('0x20')](_0x216f20)[_0x7721('0x2a')](_0x1abedb);};}exports[_0x7721('0x2b')]=function(_0x52316e,_0x258ddf){var _0x5b0551={},_0x499b87={},_0x315202={'count':0x0,'rows':[]};var _0x343c19=db[_0x7721('0x2c')][_0x7721('0x2d')];_0x499b87[_0x7721('0x2e')]=_[_0x7721('0x2f')](_0x343c19);_0x499b87[_0x7721('0x30')]=_[_0x7721('0x2f')](_0x52316e['query']);_0x499b87[_0x7721('0x31')]=_[_0x7721('0x32')](_0x499b87['model'],_0x499b87['query']);_0x5b0551[_0x7721('0x33')]=_[_0x7721('0x32')](_0x499b87['model'],qs[_0x7721('0x34')](_0x52316e[_0x7721('0x30')][_0x7721('0x34')]));_0x5b0551['attributes']=_0x5b0551[_0x7721('0x33')][_0x7721('0x35')]?_0x5b0551[_0x7721('0x33')]:_0x499b87[_0x7721('0x2e')];if(!_0x52316e[_0x7721('0x30')]['hasOwnProperty'](_0x7721('0x36'))){_0x5b0551[_0x7721('0x37')]=qs[_0x7721('0x37')](_0x52316e['query'][_0x7721('0x37')]);_0x5b0551[_0x7721('0x1f')]=qs['offset'](_0x52316e[_0x7721('0x30')]['offset']);}_0x5b0551[_0x7721('0x38')]=qs[_0x7721('0x39')](_0x52316e[_0x7721('0x30')][_0x7721('0x39')]);_0x5b0551[_0x7721('0x3a')]=qs[_0x7721('0x31')](_[_0x7721('0x3b')](_0x52316e[_0x7721('0x30')],_0x499b87[_0x7721('0x31')]));if(_0x52316e[_0x7721('0x30')][_0x7721('0x3c')]){_0x5b0551['where']=_[_0x7721('0x3d')](_0x5b0551['where'],{'$or':_[_0x7721('0x3e')](_0x343c19,function(_0x35614c){if(_0x35614c[_0x7721('0x3f')][_0x7721('0x40')]!==_0x7721('0x41')){var _0x378ba5={};_0x378ba5[_0x35614c['field']]={'$like':'%'+_0x52316e['query']['filter']+'%'};return _0x378ba5;}})});}_0x5b0551=_['merge']({},_0x5b0551,_0x52316e[_0x7721('0x42')]);var _0x1b3f8d={'where':_0x5b0551[_0x7721('0x3a')]};return db[_0x7721('0x2c')]['count'](_0x1b3f8d)[_0x7721('0x26')](function(_0x4cf659){_0x315202[_0x7721('0x1e')]=_0x4cf659;if(_0x52316e[_0x7721('0x30')]['includeAll']){_0x5b0551[_0x7721('0x43')]=[{'attributes':['id',_0x7721('0x29'),'fullname','alias'],'model':db[_0x7721('0x44')],'as':_0x7721('0x44')}];}return db[_0x7721('0x2c')][_0x7721('0x45')](_0x5b0551);})['then'](function(_0x2db173){_0x315202[_0x7721('0x46')]=_0x2db173;return _0x315202;})[_0x7721('0x26')](respondWithFilteredResult(_0x258ddf,_0x5b0551))[_0x7721('0x47')](handleError(_0x258ddf,null));};exports[_0x7721('0x48')]=function(_0x52ab67,_0x490d4){var _0x4a2c28={'raw':!![],'where':{'id':_0x52ab67['params']['id']}},_0xaa3216={};_0xaa3216[_0x7721('0x2e')]=_[_0x7721('0x2f')](db[_0x7721('0x2c')]['rawAttributes']);_0xaa3216[_0x7721('0x30')]=_[_0x7721('0x2f')](_0x52ab67[_0x7721('0x30')]);_0xaa3216['filters']=_[_0x7721('0x32')](_0xaa3216[_0x7721('0x2e')],_0xaa3216[_0x7721('0x30')]);_0x4a2c28[_0x7721('0x33')]=_[_0x7721('0x32')](_0xaa3216[_0x7721('0x2e')],qs[_0x7721('0x34')](_0x52ab67['query']['fields']));_0x4a2c28[_0x7721('0x33')]=_0x4a2c28[_0x7721('0x33')][_0x7721('0x35')]?_0x4a2c28[_0x7721('0x33')]:_0xaa3216[_0x7721('0x2e')];if(_0x52ab67[_0x7721('0x30')][_0x7721('0x49')]){_0x4a2c28[_0x7721('0x43')]=[{'all':!![]}];}_0x4a2c28=_[_0x7721('0x3d')]({},_0x4a2c28,_0x52ab67[_0x7721('0x42')]);return db['VoiceCallReport']['find'](_0x4a2c28)[_0x7721('0x26')](handleEntityNotFound(_0x490d4,null))[_0x7721('0x26')](respondWithResult(_0x490d4,null))[_0x7721('0x47')](handleError(_0x490d4,null));};exports[_0x7721('0x4a')]=function(_0x589e95,_0x30107e){return db[_0x7721('0x2c')]['create'](_0x589e95[_0x7721('0x4b')],{})['then'](respondWithResult(_0x30107e,0xc9))[_0x7721('0x47')](handleError(_0x30107e,null));};exports['destroy']=function(_0x334f23,_0x196be4){return db[_0x7721('0x2c')]['find']({'where':{'id':_0x334f23[_0x7721('0x4c')]['id']}})[_0x7721('0x26')](handleEntityNotFound(_0x196be4,null))['then'](removeEntity(_0x196be4,null))[_0x7721('0x47')](handleError(_0x196be4,null));};exports[_0x7721('0x4d')]=function(_0xf88e8c,_0x5c4078){return db[_0x7721('0x2c')]['describe']()[_0x7721('0x26')](respondWithResult(_0x5c4078,null))[_0x7721('0x47')](handleError(_0x5c4078,null));};exports[_0x7721('0x25')]=function(_0x443503,_0x1c95d8){if(_0x443503[_0x7721('0x4b')][_0x7721('0x4e')]){delete _0x443503[_0x7721('0x4b')][_0x7721('0x4e')];}return db[_0x7721('0x2c')][_0x7721('0x4f')]({'where':{'uniqueid':_0x443503[_0x7721('0x4c')]['id'],'UserId':{'$or':[null,_0x443503[_0x7721('0x50')]['id']]}}})[_0x7721('0x26')](handleEntityNotFound(_0x1c95d8,null))[_0x7721('0x26')](saveUpdates(_0x443503['body'],null))[_0x7721('0x26')](respondWithResult(_0x1c95d8,null))[_0x7721('0x47')](handleError(_0x1c95d8,null));}; \ No newline at end of file +var _0x326f=['util','path','sox','to-csv','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../mysqldb','status','end','count','offset','limit','set','Content-Range','json','reject','save','destroy','then','sendStatus','stack','name','send','index','model','keys','query','filters','attributes','intersection','fields','nolimit','order','sort','pick','filter','where','key','VIRTUAL','options','VoiceCallReport','includeAll','fullname','User','rows','catch','show','params','rawAttributes','length','create','body','find','describe','update','uniqueid','html-pdf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache'];(function(_0x239edd,_0x4dd103){var _0x593ed5=function(_0x312f02){while(--_0x312f02){_0x239edd['push'](_0x239edd['shift']());}};_0x593ed5(++_0x4dd103);}(_0x326f,0xd1));var _0xf326=function(_0x5f07ed,_0x2ae4b6){_0x5f07ed=_0x5f07ed-0x0;var _0x22b9a4=_0x326f[_0x5f07ed];return _0x22b9a4;};'use strict';var pdf=require(_0xf326('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xf326('0x1'));var jsonpatch=require(_0xf326('0x2'));var rp=require(_0xf326('0x3'));var moment=require(_0xf326('0x4'));var BPromise=require(_0xf326('0x5'));var Mustache=require(_0xf326('0x6'));var util=require(_0xf326('0x7'));var path=require(_0xf326('0x8'));var sox=require(_0xf326('0x9'));var csv=require(_0xf326('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xf326('0xb'));var squel=require(_0xf326('0xc'));var crypto=require(_0xf326('0xd'));var jsforce=require(_0xf326('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xf326('0xf'));var Redis=require(_0xf326('0x10'));var authService=require(_0xf326('0x11'));var qs=require(_0xf326('0x12'));var as=require(_0xf326('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf326('0x14'))('api');var utils=require(_0xf326('0x15'));var config=require('../../config/environment');var db=require(_0xf326('0x16'))['db'];function respondWithStatusCode(_0x518ab5,_0x3162f9){_0x3162f9=_0x3162f9||0xcc;return function(_0x9ed463){if(_0x9ed463){return _0x518ab5['sendStatus'](_0x3162f9);}return _0x518ab5[_0xf326('0x17')](_0x3162f9)[_0xf326('0x18')]();};}function respondWithResult(_0x3504eb,_0x17a098){_0x17a098=_0x17a098||0xc8;return function(_0x5c8483){if(_0x5c8483){return _0x3504eb[_0xf326('0x17')](_0x17a098)['json'](_0x5c8483);}};}function respondWithFilteredResult(_0x54bd1a,_0xdf21d9){return function(_0x11f6d2){if(_0x11f6d2){var _0x1f2e5a=_0x11f6d2[_0xf326('0x19')],_0xa63d1a=_0xdf21d9[_0xf326('0x1a')],_0x292f4b=_0xdf21d9['offset']+_0xdf21d9[_0xf326('0x1b')],_0x287a2a;if(_0x292f4b>=_0x1f2e5a){_0x292f4b=_0x1f2e5a;_0x287a2a=0xc8;}else{_0x287a2a=0xce;}_0x54bd1a[_0xf326('0x17')](_0x287a2a);return _0x54bd1a[_0xf326('0x1c')](_0xf326('0x1d'),_0xa63d1a+'-'+_0x292f4b+'/'+_0x1f2e5a)[_0xf326('0x1e')](_0x11f6d2);}return null;};}function patchUpdates(_0x311af0){return function(_0x4d3d41){try{jsonpatch['apply'](_0x4d3d41,_0x311af0,!![]);}catch(_0x56ad41){return BPromise[_0xf326('0x1f')](_0x56ad41);}return _0x4d3d41[_0xf326('0x20')]();};}function saveUpdates(_0x484cbe,_0x4cabce){return function(_0x128c68){if(_0x128c68){return _0x128c68['update'](_0x484cbe)['then'](function(_0x448b92){return _0x448b92;});}return null;};}function removeEntity(_0x18ead3,_0x549b46){return function(_0x5aa184){if(_0x5aa184){return _0x5aa184[_0xf326('0x21')]()[_0xf326('0x22')](function(){_0x18ead3['status'](0xcc)[_0xf326('0x18')]();});}};}function handleEntityNotFound(_0x1b9039,_0x43c53e){return function(_0x295752){if(!_0x295752){_0x1b9039[_0xf326('0x23')](0x194);}return _0x295752;};}function handleError(_0x2049ec,_0x5ce532){_0x5ce532=_0x5ce532||0x1f4;return function(_0x55b9f4){logger['error'](_0x55b9f4[_0xf326('0x24')]);if(_0x55b9f4[_0xf326('0x25')]){delete _0x55b9f4[_0xf326('0x25')];}_0x2049ec[_0xf326('0x17')](_0x5ce532)[_0xf326('0x26')](_0x55b9f4);};}exports[_0xf326('0x27')]=function(_0x5217d4,_0x201d28){var _0xa3c0b={},_0x212d5d={},_0x581531={'count':0x0,'rows':[]};var _0x1617d2=db['VoiceCallReport']['rawAttributes'];_0x212d5d[_0xf326('0x28')]=_[_0xf326('0x29')](_0x1617d2);_0x212d5d[_0xf326('0x2a')]=_['keys'](_0x5217d4[_0xf326('0x2a')]);_0x212d5d[_0xf326('0x2b')]=_['intersection'](_0x212d5d[_0xf326('0x28')],_0x212d5d[_0xf326('0x2a')]);_0xa3c0b[_0xf326('0x2c')]=_[_0xf326('0x2d')](_0x212d5d[_0xf326('0x28')],qs[_0xf326('0x2e')](_0x5217d4[_0xf326('0x2a')][_0xf326('0x2e')]));_0xa3c0b[_0xf326('0x2c')]=_0xa3c0b[_0xf326('0x2c')]['length']?_0xa3c0b[_0xf326('0x2c')]:_0x212d5d[_0xf326('0x28')];if(!_0x5217d4[_0xf326('0x2a')]['hasOwnProperty'](_0xf326('0x2f'))){_0xa3c0b[_0xf326('0x1b')]=qs[_0xf326('0x1b')](_0x5217d4['query']['limit']);_0xa3c0b[_0xf326('0x1a')]=qs[_0xf326('0x1a')](_0x5217d4[_0xf326('0x2a')][_0xf326('0x1a')]);}_0xa3c0b[_0xf326('0x30')]=qs[_0xf326('0x31')](_0x5217d4[_0xf326('0x2a')][_0xf326('0x31')]);_0xa3c0b['where']=qs[_0xf326('0x2b')](_[_0xf326('0x32')](_0x5217d4['query'],_0x212d5d[_0xf326('0x2b')]));if(_0x5217d4['query'][_0xf326('0x33')]){_0xa3c0b['where']=_['merge'](_0xa3c0b[_0xf326('0x34')],{'$or':_['map'](_0x1617d2,function(_0x40dcb4){if(_0x40dcb4['type'][_0xf326('0x35')]!==_0xf326('0x36')){var _0x2750ae={};_0x2750ae[_0x40dcb4['field']]={'$like':'%'+_0x5217d4[_0xf326('0x2a')][_0xf326('0x33')]+'%'};return _0x2750ae;}})});}_0xa3c0b=_['merge']({},_0xa3c0b,_0x5217d4[_0xf326('0x37')]);var _0xf64dd0={'where':_0xa3c0b[_0xf326('0x34')]};return db[_0xf326('0x38')]['count'](_0xf64dd0)[_0xf326('0x22')](function(_0xb1ef35){_0x581531[_0xf326('0x19')]=_0xb1ef35;if(_0x5217d4[_0xf326('0x2a')][_0xf326('0x39')]){_0xa3c0b['include']=[{'attributes':['id',_0xf326('0x25'),_0xf326('0x3a'),'alias'],'model':db['User'],'as':_0xf326('0x3b')}];}return db['VoiceCallReport']['findAll'](_0xa3c0b);})[_0xf326('0x22')](function(_0x5d6ae2){_0x581531[_0xf326('0x3c')]=_0x5d6ae2;return _0x581531;})[_0xf326('0x22')](respondWithFilteredResult(_0x201d28,_0xa3c0b))[_0xf326('0x3d')](handleError(_0x201d28,null));};exports[_0xf326('0x3e')]=function(_0x49112d,_0x9dda89){var _0x45d344={'raw':!![],'where':{'id':_0x49112d[_0xf326('0x3f')]['id']}},_0x347e7b={};_0x347e7b[_0xf326('0x28')]=_[_0xf326('0x29')](db[_0xf326('0x38')][_0xf326('0x40')]);_0x347e7b[_0xf326('0x2a')]=_[_0xf326('0x29')](_0x49112d[_0xf326('0x2a')]);_0x347e7b[_0xf326('0x2b')]=_['intersection'](_0x347e7b[_0xf326('0x28')],_0x347e7b[_0xf326('0x2a')]);_0x45d344[_0xf326('0x2c')]=_[_0xf326('0x2d')](_0x347e7b[_0xf326('0x28')],qs[_0xf326('0x2e')](_0x49112d['query'][_0xf326('0x2e')]));_0x45d344[_0xf326('0x2c')]=_0x45d344['attributes'][_0xf326('0x41')]?_0x45d344[_0xf326('0x2c')]:_0x347e7b[_0xf326('0x28')];if(_0x49112d[_0xf326('0x2a')][_0xf326('0x39')]){_0x45d344['include']=[{'all':!![]}];}_0x45d344=_['merge']({},_0x45d344,_0x49112d[_0xf326('0x37')]);return db[_0xf326('0x38')]['find'](_0x45d344)['then'](handleEntityNotFound(_0x9dda89,null))[_0xf326('0x22')](respondWithResult(_0x9dda89,null))[_0xf326('0x3d')](handleError(_0x9dda89,null));};exports[_0xf326('0x42')]=function(_0x5b3705,_0x301e65){return db[_0xf326('0x38')][_0xf326('0x42')](_0x5b3705[_0xf326('0x43')],{})[_0xf326('0x22')](respondWithResult(_0x301e65,0xc9))[_0xf326('0x3d')](handleError(_0x301e65,null));};exports[_0xf326('0x21')]=function(_0x3b90dc,_0x3df9a8){return db[_0xf326('0x38')][_0xf326('0x44')]({'where':{'id':_0x3b90dc[_0xf326('0x3f')]['id']}})[_0xf326('0x22')](handleEntityNotFound(_0x3df9a8,null))[_0xf326('0x22')](removeEntity(_0x3df9a8,null))[_0xf326('0x3d')](handleError(_0x3df9a8,null));};exports['describe']=function(_0x199f8b,_0x1b0e03){return db[_0xf326('0x38')][_0xf326('0x45')]()['then'](respondWithResult(_0x1b0e03,null))[_0xf326('0x3d')](handleError(_0x1b0e03,null));};exports[_0xf326('0x46')]=function(_0xca88e,_0x46fe85){if(_0xca88e['body'][_0xf326('0x47')]){delete _0xca88e[_0xf326('0x43')][_0xf326('0x47')];}return db[_0xf326('0x38')][_0xf326('0x44')]({'where':{'uniqueid':_0xca88e['params']['id'],'UserId':{'$or':[null,_0xca88e['user']['id']]}}})[_0xf326('0x22')](handleEntityNotFound(_0x46fe85,null))[_0xf326('0x22')](saveUpdates(_0xca88e[_0xf326('0x43')],null))['then'](respondWithResult(_0x46fe85,null))[_0xf326('0x3d')](handleError(_0x46fe85,null));}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.model.js b/server/api/voiceCallReport/voiceCallReport.model.js index bc637f4..02a157b 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 _0xf055=['request-promise','path','rimraf','../../config/environment','./voiceCallReport.attributes','exports','define','VoiceCallReport','report_call','uniqueid','lodash','util','../../config/logger','api','moment'];(function(_0x54afd0,_0x518863){var _0x48f09f=function(_0x5605a5){while(--_0x5605a5){_0x54afd0['push'](_0x54afd0['shift']());}};_0x48f09f(++_0x518863);}(_0xf055,0x190));var _0x5f05=function(_0x395155,_0x192ffd){_0x395155=_0x395155-0x0;var _0x179767=_0xf055[_0x395155];return _0x179767;};'use strict';var _=require(_0x5f05('0x0'));var util=require(_0x5f05('0x1'));var logger=require(_0x5f05('0x2'))(_0x5f05('0x3'));var moment=require(_0x5f05('0x4'));var BPromise=require('bluebird');var rp=require(_0x5f05('0x5'));var fs=require('fs');var path=require(_0x5f05('0x6'));var rimraf=require(_0x5f05('0x7'));var config=require(_0x5f05('0x8'));var attributes=require(_0x5f05('0x9'));module[_0x5f05('0xa')]=function(_0x1c7995,_0x44b826){return _0x1c7995[_0x5f05('0xb')](_0x5f05('0xc'),attributes,{'tableName':_0x5f05('0xd'),'paranoid':![],'indexes':[{'fields':[_0x5f05('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x27ad=['path','../../config/environment','./voiceCallReport.attributes','exports','define','VoiceCallReport','report_call','uniqueid','util','api','moment','request-promise'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x27ad,0xa4));var _0xd27a=function(_0x2a96fa,_0x2616fd){_0x2a96fa=_0x2a96fa-0x0;var _0x159933=_0x27ad[_0x2a96fa];return _0x159933;};'use strict';var _=require('lodash');var util=require(_0xd27a('0x0'));var logger=require('../../config/logger')(_0xd27a('0x1'));var moment=require(_0xd27a('0x2'));var BPromise=require('bluebird');var rp=require(_0xd27a('0x3'));var fs=require('fs');var path=require(_0xd27a('0x4'));var rimraf=require('rimraf');var config=require(_0xd27a('0x5'));var attributes=require(_0xd27a('0x6'));module[_0xd27a('0x7')]=function(_0x482c25,_0x3d8fd9){return _0x482c25[_0xd27a('0x8')](_0xd27a('0x9'),attributes,{'tableName':_0xd27a('0xa'),'paranoid':![],'indexes':[{'fields':[_0xd27a('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.rpc.js b/server/api/voiceCallReport/voiceCallReport.rpc.js index cd03fc3..7919ddd 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 _0x7e2c=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','info','VoiceCallReport,\x20%s,\x20%s','request\x20sent','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','VoiceCallReport','findAll','options','raw','where','attributes','limit','map','include','model','GetVoiceCallReport','CreateVoiceCallReport','create','body','UpdateVoiceCallReport'];(function(_0x8b2ec9,_0x34e4fd){var _0xfb7766=function(_0x947c1a){while(--_0x947c1a){_0x8b2ec9['push'](_0x8b2ec9['shift']());}};_0xfb7766(++_0x34e4fd);}(_0x7e2c,0xa0));var _0xc7e2=function(_0x2c376d,_0x340348){_0x2c376d=_0x2c376d-0x0;var _0x305b48=_0x7e2c[_0x2c376d];return _0x305b48;};'use strict';var _=require(_0xc7e2('0x0'));var util=require(_0xc7e2('0x1'));var moment=require(_0xc7e2('0x2'));var BPromise=require(_0xc7e2('0x3'));var rs=require(_0xc7e2('0x4'));var fs=require('fs');var Redis=require(_0xc7e2('0x5'));var db=require(_0xc7e2('0x6'))['db'];var utils=require(_0xc7e2('0x7'));var logger=require(_0xc7e2('0x8'))(_0xc7e2('0x9'));var config=require(_0xc7e2('0xa'));var jayson=require('jayson/promise');var client=jayson[_0xc7e2('0xb')][_0xc7e2('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x156ddd,_0x42437f,_0x2117f9){return new BPromise(function(_0x27d7a0,_0x175113){return client['request'](_0x156ddd,_0x2117f9)[_0xc7e2('0xd')](function(_0x445a6a){logger[_0xc7e2('0xe')](_0xc7e2('0xf'),_0x42437f,_0xc7e2('0x10'));logger[_0xc7e2('0x11')](_0xc7e2('0x12'),_0x42437f,_0xc7e2('0x10'),JSON[_0xc7e2('0x13')](_0x445a6a));if(_0x445a6a['error']){if(_0x445a6a[_0xc7e2('0x14')][_0xc7e2('0x15')]===0x1f4){logger[_0xc7e2('0x14')](_0xc7e2('0xf'),_0x42437f,_0x445a6a[_0xc7e2('0x14')]['message']);return _0x175113(_0x445a6a[_0xc7e2('0x14')]['message']);}logger[_0xc7e2('0x14')](_0xc7e2('0xf'),_0x42437f,_0x445a6a[_0xc7e2('0x14')][_0xc7e2('0x16')]);return _0x27d7a0(_0x445a6a['error']['message']);}else{logger[_0xc7e2('0xe')](_0xc7e2('0xf'),_0x42437f,_0xc7e2('0x10'));_0x27d7a0(_0x445a6a[_0xc7e2('0x17')][_0xc7e2('0x16')]);}})[_0xc7e2('0x18')](function(_0x5d3ff2){logger['error'](_0xc7e2('0xf'),_0x42437f,_0x5d3ff2);_0x175113(_0x5d3ff2);});});}exports['GetVoiceCallReport']=function(_0xf5347e){var _0x5ac1a3=this;return new Promise(function(_0x431af6,_0x30218f){return db[_0xc7e2('0x19')][_0xc7e2('0x1a')]({'raw':_0xf5347e[_0xc7e2('0x1b')]?_0xf5347e['options'][_0xc7e2('0x1c')]===undefined?!![]:![]:!![],'where':_0xf5347e[_0xc7e2('0x1b')]?_0xf5347e[_0xc7e2('0x1b')][_0xc7e2('0x1d')]||null:null,'attributes':_0xf5347e[_0xc7e2('0x1b')]?_0xf5347e[_0xc7e2('0x1b')][_0xc7e2('0x1e')]||null:null,'limit':_0xf5347e[_0xc7e2('0x1b')]?_0xf5347e['options'][_0xc7e2('0x1f')]||null:null,'include':_0xf5347e[_0xc7e2('0x1b')]?_0xf5347e['options']['include']?_[_0xc7e2('0x20')](_0xf5347e[_0xc7e2('0x1b')][_0xc7e2('0x21')],function(_0x827ece){return{'model':db[_0x827ece[_0xc7e2('0x22')]],'as':_0x827ece['as'],'attributes':_0x827ece[_0xc7e2('0x1e')],'include':_0x827ece[_0xc7e2('0x21')]?_[_0xc7e2('0x20')](_0x827ece[_0xc7e2('0x21')],function(_0x555fac){return{'model':db[_0x555fac[_0xc7e2('0x22')]],'as':_0x555fac['as'],'attributes':_0x555fac[_0xc7e2('0x1e')],'include':_0x555fac[_0xc7e2('0x21')]?_[_0xc7e2('0x20')](_0x555fac[_0xc7e2('0x21')],function(_0x14fe05){return{'model':db[_0x14fe05[_0xc7e2('0x22')]],'as':_0x14fe05['as'],'attributes':_0x14fe05[_0xc7e2('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xc7e2('0xd')](function(_0x2d5f89){logger['info']('GetVoiceCallReport',_0xf5347e);logger['debug'](_0xc7e2('0x23'),_0xf5347e,JSON[_0xc7e2('0x13')](_0x2d5f89));_0x431af6(_0x2d5f89);})[_0xc7e2('0x18')](function(_0x39744c){logger['error']('GetVoiceCallReport',_0x39744c[_0xc7e2('0x16')],_0xf5347e);_0x30218f(_0x5ac1a3[_0xc7e2('0x14')](0x1f4,_0x39744c[_0xc7e2('0x16')]));});});};exports[_0xc7e2('0x24')]=function(_0x320e7e){var _0x36e038=this;return new Promise(function(_0x155f71,_0x4b534c){return db['VoiceCallReport'][_0xc7e2('0x25')](_0x320e7e[_0xc7e2('0x26')],{'raw':_0x320e7e[_0xc7e2('0x1b')]?_0x320e7e[_0xc7e2('0x1b')][_0xc7e2('0x1c')]===undefined?!![]:![]:!![]})[_0xc7e2('0xd')](function(_0x120a06){logger[_0xc7e2('0xe')](_0xc7e2('0x24'),_0x320e7e);logger[_0xc7e2('0x11')]('CreateVoiceCallReport',_0x320e7e,JSON[_0xc7e2('0x13')](_0x120a06));_0x155f71(_0x120a06);})['catch'](function(_0x1c2ad0){logger[_0xc7e2('0x14')](_0xc7e2('0x24'),_0x1c2ad0['message'],_0x320e7e);_0x4b534c(_0x36e038[_0xc7e2('0x14')](0x1f4,_0x1c2ad0[_0xc7e2('0x16')]));});});};exports['UpdateVoiceCallReport']=function(_0x2c4629){var _0x55d535=this;return new Promise(function(_0x5df496,_0x27b96a){return db['VoiceCallReport']['update'](_0x2c4629[_0xc7e2('0x26')],{'raw':_0x2c4629[_0xc7e2('0x1b')]?_0x2c4629[_0xc7e2('0x1b')][_0xc7e2('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2c4629[_0xc7e2('0x1b')]?_0x2c4629[_0xc7e2('0x1b')]['where']||null:null,'attributes':_0x2c4629['options']?_0x2c4629[_0xc7e2('0x1b')][_0xc7e2('0x1e')]||null:null,'limit':_0x2c4629[_0xc7e2('0x1b')]?_0x2c4629[_0xc7e2('0x1b')][_0xc7e2('0x1f')]||null:null})[_0xc7e2('0xd')](function(_0x23fb77){logger[_0xc7e2('0xe')](_0xc7e2('0x27'),_0x2c4629);logger[_0xc7e2('0x11')](_0xc7e2('0x27'),_0x2c4629,JSON[_0xc7e2('0x13')](_0x23fb77));_0x5df496(_0x23fb77);})['catch'](function(_0x2a625f){logger[_0xc7e2('0x14')](_0xc7e2('0x27'),_0x2a625f[_0xc7e2('0x16')],_0x2c4629);_0x27b96a(_0x55d535[_0xc7e2('0x14')](0x1f4,_0x2a625f[_0xc7e2('0x16')]));});});}; \ No newline at end of file +var _0xd086=['body','where','UpdateVoiceCallReport','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','jayson/promise','http','request','then','VoiceCallReport,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','info','result','GetVoiceCallReport','VoiceCallReport','options','raw','attributes','include','map','model','CreateVoiceCallReport','create'];(function(_0x3ce563,_0x23467b){var _0x1836b9=function(_0x157bab){while(--_0x157bab){_0x3ce563['push'](_0x3ce563['shift']());}};_0x1836b9(++_0x23467b);}(_0xd086,0x13f));var _0x6d08=function(_0x9b12f,_0xfc0f3d){_0x9b12f=_0x9b12f-0x0;var _0x1d4304=_0xd086[_0x9b12f];return _0x1d4304;};'use strict';var _=require(_0x6d08('0x0'));var util=require(_0x6d08('0x1'));var moment=require(_0x6d08('0x2'));var BPromise=require(_0x6d08('0x3'));var rs=require(_0x6d08('0x4'));var fs=require('fs');var Redis=require(_0x6d08('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x6d08('0x6'));var logger=require(_0x6d08('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x6d08('0x8'));var client=jayson['client'][_0x6d08('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x480493,_0x5b312c,_0x36f3ef){return new BPromise(function(_0x441f81,_0x3150df){return client[_0x6d08('0xa')](_0x480493,_0x36f3ef)[_0x6d08('0xb')](function(_0x10f07e){logger['info'](_0x6d08('0xc'),_0x5b312c,'request\x20sent');logger[_0x6d08('0xd')]('VoiceCallReport,\x20%s,\x20%s,\x20%s',_0x5b312c,_0x6d08('0xe'),JSON[_0x6d08('0xf')](_0x10f07e));if(_0x10f07e[_0x6d08('0x10')]){if(_0x10f07e['error'][_0x6d08('0x11')]===0x1f4){logger[_0x6d08('0x10')](_0x6d08('0xc'),_0x5b312c,_0x10f07e[_0x6d08('0x10')][_0x6d08('0x12')]);return _0x3150df(_0x10f07e['error']['message']);}logger[_0x6d08('0x10')](_0x6d08('0xc'),_0x5b312c,_0x10f07e['error']['message']);return _0x441f81(_0x10f07e[_0x6d08('0x10')][_0x6d08('0x12')]);}else{logger[_0x6d08('0x13')](_0x6d08('0xc'),_0x5b312c,_0x6d08('0xe'));_0x441f81(_0x10f07e[_0x6d08('0x14')][_0x6d08('0x12')]);}})['catch'](function(_0x3d1856){logger[_0x6d08('0x10')](_0x6d08('0xc'),_0x5b312c,_0x3d1856);_0x3150df(_0x3d1856);});});}exports[_0x6d08('0x15')]=function(_0xaee4d0){var _0x4c3e3a=this;return new Promise(function(_0x299ba3,_0xc30f63){return db[_0x6d08('0x16')]['findAll']({'raw':_0xaee4d0[_0x6d08('0x17')]?_0xaee4d0[_0x6d08('0x17')][_0x6d08('0x18')]===undefined?!![]:![]:!![],'where':_0xaee4d0[_0x6d08('0x17')]?_0xaee4d0[_0x6d08('0x17')]['where']||null:null,'attributes':_0xaee4d0[_0x6d08('0x17')]?_0xaee4d0[_0x6d08('0x17')][_0x6d08('0x19')]||null:null,'limit':_0xaee4d0[_0x6d08('0x17')]?_0xaee4d0[_0x6d08('0x17')]['limit']||null:null,'include':_0xaee4d0[_0x6d08('0x17')]?_0xaee4d0[_0x6d08('0x17')][_0x6d08('0x1a')]?_[_0x6d08('0x1b')](_0xaee4d0['options'][_0x6d08('0x1a')],function(_0x1c3697){return{'model':db[_0x1c3697[_0x6d08('0x1c')]],'as':_0x1c3697['as'],'attributes':_0x1c3697[_0x6d08('0x19')],'include':_0x1c3697[_0x6d08('0x1a')]?_[_0x6d08('0x1b')](_0x1c3697['include'],function(_0x3d3bf9){return{'model':db[_0x3d3bf9[_0x6d08('0x1c')]],'as':_0x3d3bf9['as'],'attributes':_0x3d3bf9[_0x6d08('0x19')],'include':_0x3d3bf9[_0x6d08('0x1a')]?_[_0x6d08('0x1b')](_0x3d3bf9[_0x6d08('0x1a')],function(_0x515009){return{'model':db[_0x515009[_0x6d08('0x1c')]],'as':_0x515009['as'],'attributes':_0x515009[_0x6d08('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x14e5f5){logger[_0x6d08('0x13')](_0x6d08('0x15'),_0xaee4d0);logger[_0x6d08('0xd')](_0x6d08('0x15'),_0xaee4d0,JSON[_0x6d08('0xf')](_0x14e5f5));_0x299ba3(_0x14e5f5);})['catch'](function(_0x161ae4){logger[_0x6d08('0x10')](_0x6d08('0x15'),_0x161ae4[_0x6d08('0x12')],_0xaee4d0);_0xc30f63(_0x4c3e3a[_0x6d08('0x10')](0x1f4,_0x161ae4[_0x6d08('0x12')]));});});};exports[_0x6d08('0x1d')]=function(_0x53d70c){var _0x150fa6=this;return new Promise(function(_0x37a3c5,_0x2ccea4){return db[_0x6d08('0x16')][_0x6d08('0x1e')](_0x53d70c[_0x6d08('0x1f')],{'raw':_0x53d70c[_0x6d08('0x17')]?_0x53d70c[_0x6d08('0x17')][_0x6d08('0x18')]===undefined?!![]:![]:!![]})[_0x6d08('0xb')](function(_0x1ef14a){logger[_0x6d08('0x13')](_0x6d08('0x1d'),_0x53d70c);logger[_0x6d08('0xd')]('CreateVoiceCallReport',_0x53d70c,JSON[_0x6d08('0xf')](_0x1ef14a));_0x37a3c5(_0x1ef14a);})['catch'](function(_0x432945){logger[_0x6d08('0x10')](_0x6d08('0x1d'),_0x432945[_0x6d08('0x12')],_0x53d70c);_0x2ccea4(_0x150fa6[_0x6d08('0x10')](0x1f4,_0x432945[_0x6d08('0x12')]));});});};exports['UpdateVoiceCallReport']=function(_0x2b4b51){var _0x5da794=this;return new Promise(function(_0x5af952,_0x480b60){return db['VoiceCallReport']['update'](_0x2b4b51[_0x6d08('0x1f')],{'raw':_0x2b4b51[_0x6d08('0x17')]?_0x2b4b51[_0x6d08('0x17')][_0x6d08('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2b4b51['options']?_0x2b4b51['options'][_0x6d08('0x20')]||null:null,'attributes':_0x2b4b51[_0x6d08('0x17')]?_0x2b4b51[_0x6d08('0x17')][_0x6d08('0x19')]||null:null,'limit':_0x2b4b51['options']?_0x2b4b51[_0x6d08('0x17')]['limit']||null:null})[_0x6d08('0xb')](function(_0x312a77){logger[_0x6d08('0x13')](_0x6d08('0x21'),_0x2b4b51);logger[_0x6d08('0xd')](_0x6d08('0x21'),_0x2b4b51,JSON[_0x6d08('0xf')](_0x312a77));_0x5af952(_0x312a77);})[_0x6d08('0x22')](function(_0x5d1fc1){logger[_0x6d08('0x10')]('UpdateVoiceCallReport',_0x5d1fc1['message'],_0x2b4b51);_0x480b60(_0x5da794[_0x6d08('0x10')](0x1f4,_0x5d1fc1[_0x6d08('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/index.js b/server/api/voiceChanSpy/index.js index 7dceb91..6c0c1d4 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 _0x9dd4=['exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceChanSpy.controller','isAuthenticated','index','get','/:id','show','post','update','delete','destroy'];(function(_0x196e1b,_0x55fa06){var _0x5e1f18=function(_0x3bdb41){while(--_0x3bdb41){_0x196e1b['push'](_0x196e1b['shift']());}};_0x5e1f18(++_0x55fa06);}(_0x9dd4,0x157));var _0x49dd=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9dd4[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x49dd('0x0'));var util=require(_0x49dd('0x1'));var path=require('path');var timeout=require(_0x49dd('0x2'));var express=require(_0x49dd('0x3'));var router=express[_0x49dd('0x4')]();var auth=require(_0x49dd('0x5'));var interaction=require(_0x49dd('0x6'));var config=require(_0x49dd('0x7'));var controller=require(_0x49dd('0x8'));router['get']('/',auth[_0x49dd('0x9')](),controller[_0x49dd('0xa')]);router[_0x49dd('0xb')](_0x49dd('0xc'),auth['isAuthenticated'](),controller[_0x49dd('0xd')]);router[_0x49dd('0xe')]('/',auth[_0x49dd('0x9')](),controller['create']);router['put'](_0x49dd('0xc'),auth[_0x49dd('0x9')](),controller[_0x49dd('0xf')]);router[_0x49dd('0x10')](_0x49dd('0xc'),auth['isAuthenticated'](),controller[_0x49dd('0x11')]);module[_0x49dd('0x12')]=router; \ No newline at end of file +var _0x31e7=['isAuthenticated','show','post','create','put','/:id','destroy','exports','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceChanSpy.controller','get','index'];(function(_0x2b7e1b,_0x23b5f5){var _0x2edd1e=function(_0x42793e){while(--_0x42793e){_0x2b7e1b['push'](_0x2b7e1b['shift']());}};_0x2edd1e(++_0x23b5f5);}(_0x31e7,0x74));var _0x731e=function(_0x5184d1,_0x419f02){_0x5184d1=_0x5184d1-0x0;var _0x10c2b6=_0x31e7[_0x5184d1];return _0x10c2b6;};'use strict';var multer=require('multer');var util=require(_0x731e('0x0'));var path=require('path');var timeout=require(_0x731e('0x1'));var express=require(_0x731e('0x2'));var router=express[_0x731e('0x3')]();var auth=require(_0x731e('0x4'));var interaction=require(_0x731e('0x5'));var config=require(_0x731e('0x6'));var controller=require(_0x731e('0x7'));router[_0x731e('0x8')]('/',auth['isAuthenticated'](),controller[_0x731e('0x9')]);router['get']('/:id',auth[_0x731e('0xa')](),controller[_0x731e('0xb')]);router[_0x731e('0xc')]('/',auth[_0x731e('0xa')](),controller[_0x731e('0xd')]);router[_0x731e('0xe')](_0x731e('0xf'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x731e('0xf'),auth[_0x731e('0xa')](),controller[_0x731e('0x10')]);module[_0x731e('0x11')]=router; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.attributes.js b/server/api/voiceChanSpy/voiceChanSpy.attributes.js index bb3304a..d787162 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 _0xb027=['options','getDataValue','split','BOOLEAN','STRING','name','setDataValue'];(function(_0x22ee8d,_0x1fb843){var _0x208789=function(_0x280ef8){while(--_0x280ef8){_0x22ee8d['push'](_0x22ee8d['shift']());}};_0x208789(++_0x1fb843);}(_0xb027,0xc8));var _0x7b02=function(_0x1d4034,_0x5ad320){_0x1d4034=_0x1d4034-0x0;var _0x1ab392=_0xb027[_0x1d4034];return _0x1ab392;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x7b02('0x0')]},'prefix':{'type':Sequelize['STRING'],'unique':_0x7b02('0x1'),'allowNull':![]},'options':{'type':Sequelize[_0x7b02('0x0')],'set':function(_0xba0f7a){this[_0x7b02('0x2')](_0x7b02('0x3'),_0xba0f7a?_0xba0f7a['join'](''):[]);},'get':function(){return this[_0x7b02('0x4')](_0x7b02('0x3'))?this[_0x7b02('0x4')](_0x7b02('0x3'))[_0x7b02('0x5')](''):[];}},'auth':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'password':{'type':Sequelize[_0x7b02('0x0')]},'record':{'type':Sequelize[_0x7b02('0x6')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0x7b02('0x0')]},'description':{'type':Sequelize[_0x7b02('0x0')]}}; \ No newline at end of file +var _0x9956=['name','setDataValue','getDataValue','options','BOOLEAN','sequelize','exports','STRING'];(function(_0x105766,_0x9bb481){var _0x470ea5=function(_0x3fe96e){while(--_0x3fe96e){_0x105766['push'](_0x105766['shift']());}};_0x470ea5(++_0x9bb481);}(_0x9956,0x115));var _0x6995=function(_0x248d04,_0x3c4b92){_0x248d04=_0x248d04-0x0;var _0x48a7a1=_0x9956[_0x248d04];return _0x48a7a1;};'use strict';var Sequelize=require(_0x6995('0x0'));module[_0x6995('0x1')]={'name':{'type':Sequelize[_0x6995('0x2')]},'prefix':{'type':Sequelize['STRING'],'unique':_0x6995('0x3'),'allowNull':![]},'options':{'type':Sequelize['STRING'],'set':function(_0x458465){this[_0x6995('0x4')]('options',_0x458465?_0x458465['join'](''):[]);},'get':function(){return this[_0x6995('0x5')](_0x6995('0x6'))?this[_0x6995('0x5')](_0x6995('0x6'))['split'](''):[];}},'auth':{'type':Sequelize[_0x6995('0x7')],'defaultValue':![]},'password':{'type':Sequelize['STRING']},'record':{'type':Sequelize[_0x6995('0x7')],'defaultValue':![]},'recordingFormat':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x6995('0x2')]}}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.controller.js b/server/api/voiceChanSpy/voiceChanSpy.controller.js index 66c5c95..c86e40b 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 _0x8f73=['field','options','findAll','catch','show','params','includeAll','include','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','get','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','status','end','count','offset','limit','set','Content-Range','json','apply','save','update','then','ChanSpies','UserProfileResource','error','stack','name','send','VoiceChanSpy','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','map','type','VIRTUAL'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8f73,0x108));var _0x38f7=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x8f73[_0x3b380d];return _0x54502b;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x38f7('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x38f7('0x1'));var jsonpatch=require(_0x38f7('0x2'));var rp=require(_0x38f7('0x3'));var moment=require(_0x38f7('0x4'));var BPromise=require(_0x38f7('0x5'));var Mustache=require(_0x38f7('0x6'));var util=require('util');var path=require(_0x38f7('0x7'));var sox=require(_0x38f7('0x8'));var csv=require(_0x38f7('0x9'));var ejs=require(_0x38f7('0xa'));var fs=require('fs');var _=require(_0x38f7('0xb'));var squel=require(_0x38f7('0xc'));var crypto=require(_0x38f7('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x38f7('0xe'));var toCsv=require(_0x38f7('0x9'));var querystring=require(_0x38f7('0xf'));var Papa=require(_0x38f7('0x10'));var Redis=require(_0x38f7('0x11'));var authService=require(_0x38f7('0x12'));var qs=require(_0x38f7('0x13'));var as=require(_0x38f7('0x14'));var hardwareService=require(_0x38f7('0x15'));var logger=require('../../config/logger')(_0x38f7('0x16'));var utils=require(_0x38f7('0x17'));var config=require(_0x38f7('0x18'));var db=require(_0x38f7('0x19'))['db'];function respondWithStatusCode(_0x59078d,_0x2dbc3a){_0x2dbc3a=_0x2dbc3a||0xcc;return function(_0x542015){if(_0x542015){return _0x59078d['sendStatus'](_0x2dbc3a);}return _0x59078d[_0x38f7('0x1a')](_0x2dbc3a)[_0x38f7('0x1b')]();};}function respondWithResult(_0x1a74f4,_0x2917b2){_0x2917b2=_0x2917b2||0xc8;return function(_0x1ab421){if(_0x1ab421){return _0x1a74f4[_0x38f7('0x1a')](_0x2917b2)['json'](_0x1ab421);}};}function respondWithFilteredResult(_0x55b7cf,_0x222c55){return function(_0x4bb3d3){if(_0x4bb3d3){var _0x3b88f5=_0x4bb3d3[_0x38f7('0x1c')],_0x3b995f=_0x222c55['offset'],_0x32d1e2=_0x222c55[_0x38f7('0x1d')]+_0x222c55[_0x38f7('0x1e')],_0x4eb6ca;if(_0x32d1e2>=_0x3b88f5){_0x32d1e2=_0x3b88f5;_0x4eb6ca=0xc8;}else{_0x4eb6ca=0xce;}_0x55b7cf[_0x38f7('0x1a')](_0x4eb6ca);return _0x55b7cf[_0x38f7('0x1f')](_0x38f7('0x20'),_0x3b995f+'-'+_0x32d1e2+'/'+_0x3b88f5)[_0x38f7('0x21')](_0x4bb3d3);}return null;};}function patchUpdates(_0x5b8f83){return function(_0x122801){try{jsonpatch[_0x38f7('0x22')](_0x122801,_0x5b8f83,!![]);}catch(_0xdc562d){return BPromise['reject'](_0xdc562d);}return _0x122801[_0x38f7('0x23')]();};}function saveUpdates(_0x33c72e,_0x10bb3e){return function(_0x2fbd98){if(_0x2fbd98){return _0x2fbd98[_0x38f7('0x24')](_0x33c72e)[_0x38f7('0x25')](function(_0x591e79){return _0x591e79;});}return null;};}function removeEntity(_0x16120e,_0xb82b17){return function(_0x13f16b){if(_0x13f16b){return _0x13f16b['destroy']()['then'](function(){var _0x562efe=_0x13f16b['get']({'plain':!![]});var _0x4086eb=_0x38f7('0x26');return db[_0x38f7('0x27')]['destroy']({'where':{'type':_0x4086eb,'resourceId':_0x562efe['id']}})[_0x38f7('0x25')](function(){return _0x13f16b;});})[_0x38f7('0x25')](function(){_0x16120e[_0x38f7('0x1a')](0xcc)[_0x38f7('0x1b')]();});}};}function handleEntityNotFound(_0x573118,_0x2c0698){return function(_0x1ba5f1){if(!_0x1ba5f1){_0x573118['sendStatus'](0x194);}return _0x1ba5f1;};}function handleError(_0x5e2593,_0x5c02c8){_0x5c02c8=_0x5c02c8||0x1f4;return function(_0x2a178a){logger[_0x38f7('0x28')](_0x2a178a[_0x38f7('0x29')]);if(_0x2a178a[_0x38f7('0x2a')]){delete _0x2a178a['name'];}_0x5e2593[_0x38f7('0x1a')](_0x5c02c8)[_0x38f7('0x2b')](_0x2a178a);};}exports['index']=function(_0x1346da,_0x3641eb){var _0x2857a6={},_0x8fa371={},_0x1d787d={'count':0x0,'rows':[]};var _0x109791=db[_0x38f7('0x2c')][_0x38f7('0x2d')];_0x8fa371[_0x38f7('0x2e')]=_[_0x38f7('0x2f')](_0x109791);_0x8fa371[_0x38f7('0x30')]=_[_0x38f7('0x2f')](_0x1346da[_0x38f7('0x30')]);_0x8fa371[_0x38f7('0x31')]=_[_0x38f7('0x32')](_0x8fa371[_0x38f7('0x2e')],_0x8fa371[_0x38f7('0x30')]);_0x2857a6[_0x38f7('0x33')]=_[_0x38f7('0x32')](_0x8fa371[_0x38f7('0x2e')],qs[_0x38f7('0x34')](_0x1346da[_0x38f7('0x30')]['fields']));_0x2857a6['attributes']=_0x2857a6[_0x38f7('0x33')][_0x38f7('0x35')]?_0x2857a6[_0x38f7('0x33')]:_0x8fa371['model'];if(!_0x1346da[_0x38f7('0x30')][_0x38f7('0x36')](_0x38f7('0x37'))){_0x2857a6[_0x38f7('0x1e')]=qs[_0x38f7('0x1e')](_0x1346da[_0x38f7('0x30')][_0x38f7('0x1e')]);_0x2857a6['offset']=qs[_0x38f7('0x1d')](_0x1346da[_0x38f7('0x30')][_0x38f7('0x1d')]);}_0x2857a6[_0x38f7('0x38')]=qs[_0x38f7('0x39')](_0x1346da[_0x38f7('0x30')][_0x38f7('0x39')]);_0x2857a6[_0x38f7('0x3a')]=qs[_0x38f7('0x31')](_[_0x38f7('0x3b')](_0x1346da[_0x38f7('0x30')],_0x8fa371[_0x38f7('0x31')]));if(_0x1346da['query']['filter']){_0x2857a6[_0x38f7('0x3a')]=_[_0x38f7('0x3c')](_0x2857a6[_0x38f7('0x3a')],{'$or':_[_0x38f7('0x3d')](_0x109791,function(_0x1d94af){if(_0x1d94af[_0x38f7('0x3e')]['key']!==_0x38f7('0x3f')){var _0x39d4b6={};_0x39d4b6[_0x1d94af[_0x38f7('0x40')]]={'$like':'%'+_0x1346da['query']['filter']+'%'};return _0x39d4b6;}})});}_0x2857a6=_[_0x38f7('0x3c')]({},_0x2857a6,_0x1346da[_0x38f7('0x41')]);var _0x54d452={'where':_0x2857a6[_0x38f7('0x3a')]};return db[_0x38f7('0x2c')][_0x38f7('0x1c')](_0x54d452)['then'](function(_0x47e709){_0x1d787d['count']=_0x47e709;if(_0x1346da['query']['includeAll']){_0x2857a6['include']=[{'all':!![]}];}return db[_0x38f7('0x2c')][_0x38f7('0x42')](_0x2857a6);})[_0x38f7('0x25')](function(_0x1e6b7b){_0x1d787d['rows']=_0x1e6b7b;return _0x1d787d;})[_0x38f7('0x25')](respondWithFilteredResult(_0x3641eb,_0x2857a6))[_0x38f7('0x43')](handleError(_0x3641eb,null));};exports[_0x38f7('0x44')]=function(_0xf1d4fc,_0x542a1b){var _0x2244a1={'raw':![],'where':{'id':_0xf1d4fc[_0x38f7('0x45')]['id']}},_0x49edcd={};_0x49edcd[_0x38f7('0x2e')]=_[_0x38f7('0x2f')](db[_0x38f7('0x2c')][_0x38f7('0x2d')]);_0x49edcd[_0x38f7('0x30')]=_[_0x38f7('0x2f')](_0xf1d4fc[_0x38f7('0x30')]);_0x49edcd['filters']=_[_0x38f7('0x32')](_0x49edcd[_0x38f7('0x2e')],_0x49edcd[_0x38f7('0x30')]);_0x2244a1[_0x38f7('0x33')]=_['intersection'](_0x49edcd[_0x38f7('0x2e')],qs[_0x38f7('0x34')](_0xf1d4fc['query'][_0x38f7('0x34')]));_0x2244a1[_0x38f7('0x33')]=_0x2244a1[_0x38f7('0x33')][_0x38f7('0x35')]?_0x2244a1[_0x38f7('0x33')]:_0x49edcd[_0x38f7('0x2e')];if(_0xf1d4fc[_0x38f7('0x30')][_0x38f7('0x46')]){_0x2244a1[_0x38f7('0x47')]=[{'all':!![]}];}_0x2244a1=_[_0x38f7('0x3c')]({},_0x2244a1,_0xf1d4fc[_0x38f7('0x41')]);return db[_0x38f7('0x2c')]['find'](_0x2244a1)['then'](handleEntityNotFound(_0x542a1b,null))[_0x38f7('0x25')](respondWithResult(_0x542a1b,null))[_0x38f7('0x43')](handleError(_0x542a1b,null));};exports[_0x38f7('0x48')]=function(_0x80695,_0xb59ec1){return db[_0x38f7('0x2c')][_0x38f7('0x48')](_0x80695[_0x38f7('0x49')],{})['then'](function(_0x4847d5){var _0x53bd69=_0x80695['user']['get']({'plain':!![]});if(!_0x53bd69)throw new Error(_0x38f7('0x4a'));if(_0x53bd69[_0x38f7('0x4b')]===_0x38f7('0x4c')){var _0x615468=_0x4847d5[_0x38f7('0x4d')]({'plain':!![]});var _0x428c12=_0x38f7('0x26');return db['UserProfileSection'][_0x38f7('0x4e')]({'where':{'name':_0x428c12,'userProfileId':_0x53bd69[_0x38f7('0x4f')]},'raw':!![]})[_0x38f7('0x25')](function(_0x12e8a2){if(_0x12e8a2&&_0x12e8a2['autoAssociation']===0x0){return db['UserProfileResource'][_0x38f7('0x48')]({'name':_0x615468[_0x38f7('0x2a')],'resourceId':_0x615468['id'],'type':_0x12e8a2[_0x38f7('0x2a')],'sectionId':_0x12e8a2['id']},{})[_0x38f7('0x25')](function(){return _0x4847d5;});}else{return _0x4847d5;}})[_0x38f7('0x43')](function(_0x327178){logger[_0x38f7('0x28')](_0x38f7('0x50'),_0x327178);throw _0x327178;});}return _0x4847d5;})[_0x38f7('0x25')](respondWithResult(_0xb59ec1,0xc9))[_0x38f7('0x43')](handleError(_0xb59ec1,null));};exports[_0x38f7('0x24')]=function(_0x228526,_0x7aeea7){if(_0x228526['body']['id']){delete _0x228526[_0x38f7('0x49')]['id'];}return db[_0x38f7('0x2c')][_0x38f7('0x4e')]({'where':{'id':_0x228526['params']['id']}})[_0x38f7('0x25')](handleEntityNotFound(_0x7aeea7,null))[_0x38f7('0x25')](saveUpdates(_0x228526['body'],null))[_0x38f7('0x25')](respondWithResult(_0x7aeea7,null))[_0x38f7('0x43')](handleError(_0x7aeea7,null));};exports[_0x38f7('0x51')]=function(_0x32fdfa,_0x1cdd30){return db[_0x38f7('0x2c')][_0x38f7('0x4e')]({'where':{'id':_0x32fdfa['params']['id']}})[_0x38f7('0x25')](handleEntityNotFound(_0x1cdd30,null))[_0x38f7('0x25')](removeEntity(_0x1cdd30,null))[_0x38f7('0x43')](handleError(_0x1cdd30,null));}; \ No newline at end of file +var _0xe633=['show','VoiceChanSpy','options','find','create','body','user','get','role','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','destroy','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','set','json','reject','save','update','then','ChanSpies','UserProfileResource','error','stack','name','index','rawAttributes','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','limit','order','sort','where','pick','filter','merge','map','type','key','VIRTUAL','field','includeAll','include','findAll','rows','catch'];(function(_0x57eaa8,_0x400c4e){var _0x4a07d4=function(_0x296b45){while(--_0x296b45){_0x57eaa8['push'](_0x57eaa8['shift']());}};_0x4a07d4(++_0x400c4e);}(_0xe633,0x14d));var _0x3e63=function(_0x1a1edf,_0x3fc67a){_0x1a1edf=_0x1a1edf-0x0;var _0x34fe76=_0xe633[_0x1a1edf];return _0x34fe76;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x3e63('0x0'));var rimraf=require(_0x3e63('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3e63('0x2'));var rp=require(_0x3e63('0x3'));var moment=require(_0x3e63('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x3e63('0x5'));var util=require(_0x3e63('0x6'));var path=require(_0x3e63('0x7'));var sox=require(_0x3e63('0x8'));var csv=require(_0x3e63('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x3e63('0xa'));var squel=require(_0x3e63('0xb'));var crypto=require('crypto');var jsforce=require(_0x3e63('0xc'));var deskjs=require(_0x3e63('0xd'));var toCsv=require(_0x3e63('0x9'));var querystring=require(_0x3e63('0xe'));var Papa=require(_0x3e63('0xf'));var Redis=require(_0x3e63('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x3e63('0x11'));var as=require(_0x3e63('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3e63('0x13'))('api');var utils=require(_0x3e63('0x14'));var config=require(_0x3e63('0x15'));var db=require(_0x3e63('0x16'))['db'];function respondWithStatusCode(_0x484d16,_0x476b4a){_0x476b4a=_0x476b4a||0xcc;return function(_0x2f18f9){if(_0x2f18f9){return _0x484d16[_0x3e63('0x17')](_0x476b4a);}return _0x484d16[_0x3e63('0x18')](_0x476b4a)[_0x3e63('0x19')]();};}function respondWithResult(_0x219bf7,_0x31b00f){_0x31b00f=_0x31b00f||0xc8;return function(_0x29652e){if(_0x29652e){return _0x219bf7[_0x3e63('0x18')](_0x31b00f)['json'](_0x29652e);}};}function respondWithFilteredResult(_0x5552c1,_0x2d1d01){return function(_0x4bcb2c){if(_0x4bcb2c){var _0x3ac5f7=_0x4bcb2c[_0x3e63('0x1a')],_0x5d6415=_0x2d1d01[_0x3e63('0x1b')],_0x2ec83a=_0x2d1d01[_0x3e63('0x1b')]+_0x2d1d01['limit'],_0x110b02;if(_0x2ec83a>=_0x3ac5f7){_0x2ec83a=_0x3ac5f7;_0x110b02=0xc8;}else{_0x110b02=0xce;}_0x5552c1['status'](_0x110b02);return _0x5552c1[_0x3e63('0x1c')]('Content-Range',_0x5d6415+'-'+_0x2ec83a+'/'+_0x3ac5f7)[_0x3e63('0x1d')](_0x4bcb2c);}return null;};}function patchUpdates(_0x4327dc){return function(_0x44f177){try{jsonpatch['apply'](_0x44f177,_0x4327dc,!![]);}catch(_0xdaccc8){return BPromise[_0x3e63('0x1e')](_0xdaccc8);}return _0x44f177[_0x3e63('0x1f')]();};}function saveUpdates(_0x2fd833,_0x41cfec){return function(_0x188ff3){if(_0x188ff3){return _0x188ff3[_0x3e63('0x20')](_0x2fd833)[_0x3e63('0x21')](function(_0x5e8bf4){return _0x5e8bf4;});}return null;};}function removeEntity(_0x129394,_0x5af532){return function(_0x2869fc){if(_0x2869fc){return _0x2869fc['destroy']()[_0x3e63('0x21')](function(){var _0x5b1fc1=_0x2869fc['get']({'plain':!![]});var _0x4434ef=_0x3e63('0x22');return db[_0x3e63('0x23')]['destroy']({'where':{'type':_0x4434ef,'resourceId':_0x5b1fc1['id']}})[_0x3e63('0x21')](function(){return _0x2869fc;});})['then'](function(){_0x129394[_0x3e63('0x18')](0xcc)[_0x3e63('0x19')]();});}};}function handleEntityNotFound(_0x442f7a,_0x536cf5){return function(_0xae15f4){if(!_0xae15f4){_0x442f7a[_0x3e63('0x17')](0x194);}return _0xae15f4;};}function handleError(_0xf36f8a,_0x417135){_0x417135=_0x417135||0x1f4;return function(_0x31aa64){logger[_0x3e63('0x24')](_0x31aa64[_0x3e63('0x25')]);if(_0x31aa64[_0x3e63('0x26')]){delete _0x31aa64[_0x3e63('0x26')];}_0xf36f8a[_0x3e63('0x18')](_0x417135)['send'](_0x31aa64);};}exports[_0x3e63('0x27')]=function(_0x25abf5,_0xe607f5){var _0x385f6a={},_0x1c8b21={},_0x34b5d6={'count':0x0,'rows':[]};var _0x5070b8=db['VoiceChanSpy'][_0x3e63('0x28')];_0x1c8b21[_0x3e63('0x29')]=_[_0x3e63('0x2a')](_0x5070b8);_0x1c8b21[_0x3e63('0x2b')]=_[_0x3e63('0x2a')](_0x25abf5[_0x3e63('0x2b')]);_0x1c8b21[_0x3e63('0x2c')]=_['intersection'](_0x1c8b21['model'],_0x1c8b21['query']);_0x385f6a[_0x3e63('0x2d')]=_[_0x3e63('0x2e')](_0x1c8b21['model'],qs[_0x3e63('0x2f')](_0x25abf5[_0x3e63('0x2b')][_0x3e63('0x2f')]));_0x385f6a[_0x3e63('0x2d')]=_0x385f6a[_0x3e63('0x2d')][_0x3e63('0x30')]?_0x385f6a[_0x3e63('0x2d')]:_0x1c8b21[_0x3e63('0x29')];if(!_0x25abf5['query'][_0x3e63('0x31')]('nolimit')){_0x385f6a[_0x3e63('0x32')]=qs[_0x3e63('0x32')](_0x25abf5[_0x3e63('0x2b')]['limit']);_0x385f6a[_0x3e63('0x1b')]=qs[_0x3e63('0x1b')](_0x25abf5['query'][_0x3e63('0x1b')]);}_0x385f6a[_0x3e63('0x33')]=qs[_0x3e63('0x34')](_0x25abf5[_0x3e63('0x2b')][_0x3e63('0x34')]);_0x385f6a[_0x3e63('0x35')]=qs[_0x3e63('0x2c')](_[_0x3e63('0x36')](_0x25abf5[_0x3e63('0x2b')],_0x1c8b21[_0x3e63('0x2c')]));if(_0x25abf5[_0x3e63('0x2b')][_0x3e63('0x37')]){_0x385f6a['where']=_[_0x3e63('0x38')](_0x385f6a[_0x3e63('0x35')],{'$or':_[_0x3e63('0x39')](_0x5070b8,function(_0x275303){if(_0x275303[_0x3e63('0x3a')][_0x3e63('0x3b')]!==_0x3e63('0x3c')){var _0x3614f8={};_0x3614f8[_0x275303[_0x3e63('0x3d')]]={'$like':'%'+_0x25abf5['query']['filter']+'%'};return _0x3614f8;}})});}_0x385f6a=_['merge']({},_0x385f6a,_0x25abf5['options']);var _0x3c56f4={'where':_0x385f6a['where']};return db['VoiceChanSpy'][_0x3e63('0x1a')](_0x3c56f4)[_0x3e63('0x21')](function(_0x577644){_0x34b5d6['count']=_0x577644;if(_0x25abf5[_0x3e63('0x2b')][_0x3e63('0x3e')]){_0x385f6a[_0x3e63('0x3f')]=[{'all':!![]}];}return db['VoiceChanSpy'][_0x3e63('0x40')](_0x385f6a);})[_0x3e63('0x21')](function(_0x145b38){_0x34b5d6[_0x3e63('0x41')]=_0x145b38;return _0x34b5d6;})[_0x3e63('0x21')](respondWithFilteredResult(_0xe607f5,_0x385f6a))[_0x3e63('0x42')](handleError(_0xe607f5,null));};exports[_0x3e63('0x43')]=function(_0x2d3514,_0x241c52){var _0x2c684b={'raw':![],'where':{'id':_0x2d3514['params']['id']}},_0x5ac62a={};_0x5ac62a[_0x3e63('0x29')]=_[_0x3e63('0x2a')](db[_0x3e63('0x44')]['rawAttributes']);_0x5ac62a[_0x3e63('0x2b')]=_[_0x3e63('0x2a')](_0x2d3514['query']);_0x5ac62a['filters']=_[_0x3e63('0x2e')](_0x5ac62a[_0x3e63('0x29')],_0x5ac62a[_0x3e63('0x2b')]);_0x2c684b[_0x3e63('0x2d')]=_[_0x3e63('0x2e')](_0x5ac62a['model'],qs[_0x3e63('0x2f')](_0x2d3514['query'][_0x3e63('0x2f')]));_0x2c684b['attributes']=_0x2c684b['attributes'][_0x3e63('0x30')]?_0x2c684b['attributes']:_0x5ac62a[_0x3e63('0x29')];if(_0x2d3514[_0x3e63('0x2b')][_0x3e63('0x3e')]){_0x2c684b[_0x3e63('0x3f')]=[{'all':!![]}];}_0x2c684b=_['merge']({},_0x2c684b,_0x2d3514[_0x3e63('0x45')]);return db[_0x3e63('0x44')][_0x3e63('0x46')](_0x2c684b)['then'](handleEntityNotFound(_0x241c52,null))[_0x3e63('0x21')](respondWithResult(_0x241c52,null))[_0x3e63('0x42')](handleError(_0x241c52,null));};exports['create']=function(_0xdd81f4,_0x24c6a5){return db['VoiceChanSpy'][_0x3e63('0x47')](_0xdd81f4[_0x3e63('0x48')],{})['then'](function(_0x503717){var _0x36addb=_0xdd81f4[_0x3e63('0x49')][_0x3e63('0x4a')]({'plain':!![]});if(!_0x36addb)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x36addb[_0x3e63('0x4b')]==='user'){var _0x3501bb=_0x503717[_0x3e63('0x4a')]({'plain':!![]});var _0x54931c='ChanSpies';return db['UserProfileSection'][_0x3e63('0x46')]({'where':{'name':_0x54931c,'userProfileId':_0x36addb[_0x3e63('0x4c')]},'raw':!![]})[_0x3e63('0x21')](function(_0x17bf05){if(_0x17bf05&&_0x17bf05['autoAssociation']===0x0){return db[_0x3e63('0x23')]['create']({'name':_0x3501bb[_0x3e63('0x26')],'resourceId':_0x3501bb['id'],'type':_0x17bf05[_0x3e63('0x26')],'sectionId':_0x17bf05['id']},{})[_0x3e63('0x21')](function(){return _0x503717;});}else{return _0x503717;}})['catch'](function(_0x8d0e10){logger[_0x3e63('0x24')](_0x3e63('0x4d'),_0x8d0e10);throw _0x8d0e10;});}return _0x503717;})[_0x3e63('0x21')](respondWithResult(_0x24c6a5,0xc9))['catch'](handleError(_0x24c6a5,null));};exports[_0x3e63('0x20')]=function(_0x564a3b,_0x221ac2){if(_0x564a3b[_0x3e63('0x48')]['id']){delete _0x564a3b['body']['id'];}return db[_0x3e63('0x44')]['find']({'where':{'id':_0x564a3b[_0x3e63('0x4e')]['id']}})[_0x3e63('0x21')](handleEntityNotFound(_0x221ac2,null))['then'](saveUpdates(_0x564a3b[_0x3e63('0x48')],null))[_0x3e63('0x21')](respondWithResult(_0x221ac2,null))['catch'](handleError(_0x221ac2,null));};exports[_0x3e63('0x4f')]=function(_0x358e27,_0x38dde8){return db[_0x3e63('0x44')][_0x3e63('0x46')]({'where':{'id':_0x358e27['params']['id']}})['then'](handleEntityNotFound(_0x38dde8,null))['then'](removeEntity(_0x38dde8,null))['catch'](handleError(_0x38dde8,null));}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.model.js b/server/api/voiceChanSpy/voiceChanSpy.model.js index 008374f..d380343 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 _0x3bc7=['VoiceExtension','destroy','lodash','util','bluebird','./voiceChanSpy.attributes','context','from-sip','format','%s%s','prefix','system','push','Set','CDR(type)=%s','chanspy','record','merge','MixMonitor','${UNIQUEID}.%s,ab','recordingFormat','auth','Authenticate','SIP/%s,%s','name','options','join','StopMixMonitor','length','concat','internal','User','agent','then','catch','define','voice_chanspy','bulkCreate'];(function(_0x1452f4,_0x423e49){var _0x539c08=function(_0x33d55b){while(--_0x33d55b){_0x1452f4['push'](_0x1452f4['shift']());}};_0x539c08(++_0x423e49);}(_0x3bc7,0x10c));var _0x73bc=function(_0x299585,_0x790cef){_0x299585=_0x299585-0x0;var _0x8f7fca=_0x3bc7[_0x299585];return _0x8f7fca;};'use strict';var _=require(_0x73bc('0x0'));var util=require(_0x73bc('0x1'));var BPromise=require(_0x73bc('0x2'));var attributes=require(_0x73bc('0x3'));var getUserApplications=function(_0x528b2e,_0x1a04d6,_0x5480e0){var _0x2a7bc5=0x1;var _0x5158a8=[];var _0x25df9c={'context':_0x1a04d6[_0x73bc('0x4')]||_0x73bc('0x5'),'exten':util[_0x73bc('0x6')](_0x73bc('0x7'),_0x528b2e[_0x73bc('0x8')],_0x5480e0),'type':_0x73bc('0x9'),'isApp':![],'ChanSpyId':_0x528b2e['id'],'UserId':_0x1a04d6['id']};_0x5158a8[_0x73bc('0xa')](_['merge']({'app':_0x73bc('0xb'),'appdata':util[_0x73bc('0x6')](_0x73bc('0xc'),_0x73bc('0xd')),'priority':_0x2a7bc5++},_0x25df9c));if(_0x528b2e[_0x73bc('0xe')]){_0x5158a8[_0x73bc('0xa')](_[_0x73bc('0xf')]({'app':_0x73bc('0x10'),'appdata':util[_0x73bc('0x6')](_0x73bc('0x11'),_0x528b2e[_0x73bc('0x12')]),'priority':_0x2a7bc5++},_0x25df9c));}if(_0x528b2e[_0x73bc('0x13')]){_0x5158a8[_0x73bc('0xa')](_[_0x73bc('0xf')]({'app':_0x73bc('0x14'),'appdata':_0x528b2e['password'],'priority':_0x2a7bc5++},_0x25df9c));}_0x5158a8[_0x73bc('0xa')](_['merge']({'app':'ChanSpy','appdata':util[_0x73bc('0x6')](_0x73bc('0x15'),_0x1a04d6[_0x73bc('0x16')],_0x528b2e['options']?_0x528b2e[_0x73bc('0x17')][_0x73bc('0x18')](''):''),'priority':_0x2a7bc5++},_0x25df9c));if(_0x528b2e[_0x73bc('0xe')]){_0x5158a8[_0x73bc('0xa')](_[_0x73bc('0xf')]({'app':_0x73bc('0x19'),'priority':_0x2a7bc5++},_0x25df9c));}return _0x5158a8;};var getChanSpyApplications=function(_0x240e69,_0x12d74d){var _0x5ac755=[];for(var _0x124c7d=0x0,_0x5801b1=0x1;_0x124c7d<_0x12d74d[_0x73bc('0x1a')];_0x124c7d++,_0x5801b1=0x1){_0x5ac755=_0x5ac755[_0x73bc('0x1b')](getUserApplications(_0x240e69,_0x12d74d[_0x124c7d],_0x12d74d[_0x124c7d][_0x73bc('0x1c')]));if(_0x12d74d[_0x124c7d][_0x73bc('0x1c')]!=_0x12d74d[_0x124c7d][_0x73bc('0x16')]){_0x5ac755=_0x5ac755[_0x73bc('0x1b')](getUserApplications(_0x240e69,_0x12d74d[_0x124c7d],_0x12d74d[_0x124c7d]['name']));}}return _0x5ac755;};var getChanSpyPromise=function(_0x3dc7da,_0x231139){return new BPromise(function(_0x4f7a85,_0x4c5a1e){return _0x3dc7da[_0x73bc('0x1d')]['findAll']({'attributes':['id',_0x73bc('0x16'),_0x73bc('0x1c')],'where':{'role':_0x73bc('0x1e'),'chanspy':!![]},'raw':!![]})[_0x73bc('0x1f')](function(_0x1faa97){if(_0x1faa97){return _0x4f7a85(getChanSpyApplications(_0x231139,_0x1faa97));}return _0x4f7a85([]);})[_0x73bc('0x20')](function(_0x259560){_0x4c5a1e(_0x259560);});});};module['exports']=function(_0x3af997,_0x52e39a){var _0x405b2d=_0x3af997['models'];return _0x3af997[_0x73bc('0x21')]('VoiceChanSpy',attributes,{'tableName':_0x73bc('0x22'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x164071,_0x4a5ec9,_0x3d4a4f){return getChanSpyPromise(_0x405b2d,_0x164071)[_0x73bc('0x1f')](function(_0x14b710){if(_0x14b710&&_0x14b710[_0x73bc('0x1a')]){return _0x405b2d['VoiceExtension'][_0x73bc('0x23')](_0x14b710);}})[_0x73bc('0x1f')](function(){_0x3d4a4f();})[_0x73bc('0x20')](function(_0x337ede){_0x3d4a4f(_0x337ede);});},'afterUpdate':function(_0x1075d0,_0x495e6b,_0x4d7923){return _0x405b2d[_0x73bc('0x24')][_0x73bc('0x25')]({'where':{'ChanSpyId':_0x1075d0['id']}})[_0x73bc('0x1f')](function(){return getChanSpyPromise(_0x405b2d,_0x1075d0);})[_0x73bc('0x1f')](function(_0x312ea1){if(_0x312ea1&&_0x312ea1[_0x73bc('0x1a')]){return _0x405b2d[_0x73bc('0x24')][_0x73bc('0x23')](_0x312ea1);}})['then'](function(){_0x4d7923();})[_0x73bc('0x20')](function(_0x457a){_0x4d7923(_0x457a);});},'afterDestroy':function(_0x21f4b8,_0x33fb38,_0x4cba46){return _0x405b2d[_0x73bc('0x24')][_0x73bc('0x25')]({'where':{'ChanSpyId':_0x21f4b8['id']}})[_0x73bc('0x1f')](function(){_0x4cba46();})['catch'](function(_0x35a8b6){_0x4cba46(_0x35a8b6);});}}});}; \ No newline at end of file +var _0xa876=['auth','Authenticate','ChanSpy','SIP/%s,%s','name','options','join','StopMixMonitor','length','concat','internal','User','agent','then','catch','exports','define','voice_chanspy','VoiceExtension','bulkCreate','destroy','lodash','util','bluebird','./voiceChanSpy.attributes','context','format','%s%s','prefix','system','push','merge','Set','CDR(type)=%s','chanspy','MixMonitor','${UNIQUEID}.%s,ab','recordingFormat'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa876,0xd3));var _0x6a87=function(_0x2bbbbb,_0x54c31e){_0x2bbbbb=_0x2bbbbb-0x0;var _0x1f0581=_0xa876[_0x2bbbbb];return _0x1f0581;};'use strict';var _=require(_0x6a87('0x0'));var util=require(_0x6a87('0x1'));var BPromise=require(_0x6a87('0x2'));var attributes=require(_0x6a87('0x3'));var getUserApplications=function(_0xe4cda1,_0x4efcaf,_0x11a0a1){var _0x3bc0c1=0x1;var _0x1dcce8=[];var _0x259618={'context':_0x4efcaf[_0x6a87('0x4')]||'from-sip','exten':util[_0x6a87('0x5')](_0x6a87('0x6'),_0xe4cda1[_0x6a87('0x7')],_0x11a0a1),'type':_0x6a87('0x8'),'isApp':![],'ChanSpyId':_0xe4cda1['id'],'UserId':_0x4efcaf['id']};_0x1dcce8[_0x6a87('0x9')](_[_0x6a87('0xa')]({'app':_0x6a87('0xb'),'appdata':util[_0x6a87('0x5')](_0x6a87('0xc'),_0x6a87('0xd')),'priority':_0x3bc0c1++},_0x259618));if(_0xe4cda1['record']){_0x1dcce8[_0x6a87('0x9')](_['merge']({'app':_0x6a87('0xe'),'appdata':util['format'](_0x6a87('0xf'),_0xe4cda1[_0x6a87('0x10')]),'priority':_0x3bc0c1++},_0x259618));}if(_0xe4cda1[_0x6a87('0x11')]){_0x1dcce8['push'](_['merge']({'app':_0x6a87('0x12'),'appdata':_0xe4cda1['password'],'priority':_0x3bc0c1++},_0x259618));}_0x1dcce8[_0x6a87('0x9')](_[_0x6a87('0xa')]({'app':_0x6a87('0x13'),'appdata':util[_0x6a87('0x5')](_0x6a87('0x14'),_0x4efcaf[_0x6a87('0x15')],_0xe4cda1[_0x6a87('0x16')]?_0xe4cda1[_0x6a87('0x16')][_0x6a87('0x17')](''):''),'priority':_0x3bc0c1++},_0x259618));if(_0xe4cda1['record']){_0x1dcce8[_0x6a87('0x9')](_[_0x6a87('0xa')]({'app':_0x6a87('0x18'),'priority':_0x3bc0c1++},_0x259618));}return _0x1dcce8;};var getChanSpyApplications=function(_0x38d003,_0x3059e3){var _0x402942=[];for(var _0x1fc893=0x0,_0x515256=0x1;_0x1fc893<_0x3059e3[_0x6a87('0x19')];_0x1fc893++,_0x515256=0x1){_0x402942=_0x402942[_0x6a87('0x1a')](getUserApplications(_0x38d003,_0x3059e3[_0x1fc893],_0x3059e3[_0x1fc893]['internal']));if(_0x3059e3[_0x1fc893][_0x6a87('0x1b')]!=_0x3059e3[_0x1fc893][_0x6a87('0x15')]){_0x402942=_0x402942['concat'](getUserApplications(_0x38d003,_0x3059e3[_0x1fc893],_0x3059e3[_0x1fc893][_0x6a87('0x15')]));}}return _0x402942;};var getChanSpyPromise=function(_0x57ab70,_0x214a45){return new BPromise(function(_0x25f8fe,_0x2e27fc){return _0x57ab70[_0x6a87('0x1c')]['findAll']({'attributes':['id','name','internal'],'where':{'role':_0x6a87('0x1d'),'chanspy':!![]},'raw':!![]})[_0x6a87('0x1e')](function(_0x4d9eb3){if(_0x4d9eb3){return _0x25f8fe(getChanSpyApplications(_0x214a45,_0x4d9eb3));}return _0x25f8fe([]);})[_0x6a87('0x1f')](function(_0x4115c6){_0x2e27fc(_0x4115c6);});});};module[_0x6a87('0x20')]=function(_0x3da007,_0x4c5e0e){var _0x2386f1=_0x3da007['models'];return _0x3da007[_0x6a87('0x21')]('VoiceChanSpy',attributes,{'tableName':_0x6a87('0x22'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x3e840a,_0x186e92,_0x8c62de){return getChanSpyPromise(_0x2386f1,_0x3e840a)[_0x6a87('0x1e')](function(_0x30769b){if(_0x30769b&&_0x30769b['length']){return _0x2386f1[_0x6a87('0x23')][_0x6a87('0x24')](_0x30769b);}})[_0x6a87('0x1e')](function(){_0x8c62de();})[_0x6a87('0x1f')](function(_0x1e99fb){_0x8c62de(_0x1e99fb);});},'afterUpdate':function(_0x2ff089,_0x58e215,_0x550b9){return _0x2386f1['VoiceExtension'][_0x6a87('0x25')]({'where':{'ChanSpyId':_0x2ff089['id']}})[_0x6a87('0x1e')](function(){return getChanSpyPromise(_0x2386f1,_0x2ff089);})['then'](function(_0x25299e){if(_0x25299e&&_0x25299e['length']){return _0x2386f1['VoiceExtension'][_0x6a87('0x24')](_0x25299e);}})[_0x6a87('0x1e')](function(){_0x550b9();})[_0x6a87('0x1f')](function(_0x1ba695){_0x550b9(_0x1ba695);});},'afterDestroy':function(_0x44640c,_0x38b285,_0x3abb4e){return _0x2386f1[_0x6a87('0x23')][_0x6a87('0x25')]({'where':{'ChanSpyId':_0x44640c['id']}})['then'](function(){_0x3abb4e();})[_0x6a87('0x1f')](function(_0x31caf7){_0x3abb4e(_0x31caf7);});}}});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.rpc.js b/server/api/voiceChanSpy/voiceChanSpy.rpc.js index b369b47..caca074 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 _0xa968=['http','then','info','VoiceChanSpy,\x20%s,\x20%s','request\x20sent','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','util','randomstring','../../mysqldb','../../config/utils','jayson/promise','client'];(function(_0x1b768e,_0x8ee33c){var _0x31ea76=function(_0x4adf75){while(--_0x4adf75){_0x1b768e['push'](_0x1b768e['shift']());}};_0x31ea76(++_0x8ee33c);}(_0xa968,0x108));var _0x8a96=function(_0xd3cc7a,_0x1adf7d){_0xd3cc7a=_0xd3cc7a-0x0;var _0x3328cf=_0xa968[_0xd3cc7a];return _0x3328cf;};'use strict';var _=require('lodash');var util=require(_0x8a96('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x8a96('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8a96('0x2'))['db'];var utils=require(_0x8a96('0x3'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x8a96('0x4'));var client=jayson[_0x8a96('0x5')][_0x8a96('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x47be3a,_0x2c8e24,_0x54b7bb){return new BPromise(function(_0x29ea92,_0x5f3da7){return client['request'](_0x47be3a,_0x54b7bb)[_0x8a96('0x7')](function(_0x170bc8){logger[_0x8a96('0x8')](_0x8a96('0x9'),_0x2c8e24,_0x8a96('0xa'));logger[_0x8a96('0xb')](_0x8a96('0xc'),_0x2c8e24,_0x8a96('0xa'),JSON[_0x8a96('0xd')](_0x170bc8));if(_0x170bc8[_0x8a96('0xe')]){if(_0x170bc8[_0x8a96('0xe')][_0x8a96('0xf')]===0x1f4){logger[_0x8a96('0xe')](_0x8a96('0x9'),_0x2c8e24,_0x170bc8[_0x8a96('0xe')][_0x8a96('0x10')]);return _0x5f3da7(_0x170bc8[_0x8a96('0xe')][_0x8a96('0x10')]);}logger[_0x8a96('0xe')](_0x8a96('0x9'),_0x2c8e24,_0x170bc8[_0x8a96('0xe')]['message']);return _0x29ea92(_0x170bc8['error']['message']);}else{logger[_0x8a96('0x8')](_0x8a96('0x9'),_0x2c8e24,_0x8a96('0xa'));_0x29ea92(_0x170bc8[_0x8a96('0x11')][_0x8a96('0x10')]);}})['catch'](function(_0xa5ab7b){logger[_0x8a96('0xe')]('VoiceChanSpy,\x20%s,\x20%s',_0x2c8e24,_0xa5ab7b);_0x5f3da7(_0xa5ab7b);});});} \ No newline at end of file +var _0x8a1c=['code','message','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','http','request','then','info','VoiceChanSpy,\x20%s,\x20%s','request\x20sent','VoiceChanSpy,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x174a72,_0x46034c){var _0x32cecd=function(_0x188a47){while(--_0x188a47){_0x174a72['push'](_0x174a72['shift']());}};_0x32cecd(++_0x46034c);}(_0x8a1c,0x17e));var _0xc8a1=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x8a1c[_0x40a045];return _0x1a687c;};'use strict';var _=require('lodash');var util=require(_0xc8a1('0x0'));var moment=require(_0xc8a1('0x1'));var BPromise=require(_0xc8a1('0x2'));var rs=require(_0xc8a1('0x3'));var fs=require('fs');var Redis=require(_0xc8a1('0x4'));var db=require(_0xc8a1('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xc8a1('0x6'));var config=require(_0xc8a1('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0xc8a1('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2ebf15,_0x42058f,_0x20a1ff){return new BPromise(function(_0x5ade82,_0x91879a){return client[_0xc8a1('0x9')](_0x2ebf15,_0x20a1ff)[_0xc8a1('0xa')](function(_0x24b474){logger[_0xc8a1('0xb')](_0xc8a1('0xc'),_0x42058f,_0xc8a1('0xd'));logger['debug'](_0xc8a1('0xe'),_0x42058f,_0xc8a1('0xd'),JSON[_0xc8a1('0xf')](_0x24b474));if(_0x24b474[_0xc8a1('0x10')]){if(_0x24b474[_0xc8a1('0x10')][_0xc8a1('0x11')]===0x1f4){logger['error'](_0xc8a1('0xc'),_0x42058f,_0x24b474[_0xc8a1('0x10')][_0xc8a1('0x12')]);return _0x91879a(_0x24b474[_0xc8a1('0x10')][_0xc8a1('0x12')]);}logger['error']('VoiceChanSpy,\x20%s,\x20%s',_0x42058f,_0x24b474[_0xc8a1('0x10')][_0xc8a1('0x12')]);return _0x5ade82(_0x24b474['error'][_0xc8a1('0x12')]);}else{logger['info'](_0xc8a1('0xc'),_0x42058f,_0xc8a1('0xd'));_0x5ade82(_0x24b474['result']['message']);}})['catch'](function(_0x53fd51){logger[_0xc8a1('0x10')](_0xc8a1('0xc'),_0x42058f,_0x53fd51);_0x91879a(_0x53fd51);});});} \ No newline at end of file diff --git a/server/api/voiceContext/index.js b/server/api/voiceContext/index.js index 098eba8..ed1e690 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 _0xb658=['../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','post','create','put','update','delete','destroy','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x5d2de6,_0x3d1311){var _0x5da8b5=function(_0x4c130c){while(--_0x4c130c){_0x5d2de6['push'](_0x5d2de6['shift']());}};_0x5da8b5(++_0x3d1311);}(_0xb658,0xfa));var _0x8b65=function(_0x124a50,_0x3ceb95){_0x124a50=_0x124a50-0x0;var _0x57b609=_0xb658[_0x124a50];return _0x57b609;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x8b65('0x0'));var timeout=require(_0x8b65('0x1'));var express=require(_0x8b65('0x2'));var router=express[_0x8b65('0x3')]();var auth=require(_0x8b65('0x4'));var interaction=require(_0x8b65('0x5'));var config=require(_0x8b65('0x6'));var controller=require('./voiceContext.controller');router[_0x8b65('0x7')]('/',auth[_0x8b65('0x8')](),controller[_0x8b65('0x9')]);router[_0x8b65('0x7')](_0x8b65('0xa'),auth[_0x8b65('0x8')](),controller['show']);router[_0x8b65('0xb')]('/',auth['isAuthenticated'](),controller[_0x8b65('0xc')]);router[_0x8b65('0xd')](_0x8b65('0xa'),auth['isAuthenticated'](),controller[_0x8b65('0xe')]);router[_0x8b65('0xf')](_0x8b65('0xa'),auth[_0x8b65('0x8')](),controller[_0x8b65('0x10')]);module['exports']=router; \ No newline at end of file +var _0xe091=['util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceContext.controller','isAuthenticated','get','/:id','post','put','update','destroy','exports','multer'];(function(_0x4f9ad9,_0x50f4b8){var _0x1abdad=function(_0x113610){while(--_0x113610){_0x4f9ad9['push'](_0x4f9ad9['shift']());}};_0x1abdad(++_0x50f4b8);}(_0xe091,0x10f));var _0x1e09=function(_0x1e009a,_0x483b1){_0x1e009a=_0x1e009a-0x0;var _0x64dfc6=_0xe091[_0x1e009a];return _0x64dfc6;};'use strict';var multer=require(_0x1e09('0x0'));var util=require(_0x1e09('0x1'));var path=require(_0x1e09('0x2'));var timeout=require('connect-timeout');var express=require(_0x1e09('0x3'));var router=express[_0x1e09('0x4')]();var auth=require(_0x1e09('0x5'));var interaction=require(_0x1e09('0x6'));var config=require(_0x1e09('0x7'));var controller=require(_0x1e09('0x8'));router['get']('/',auth[_0x1e09('0x9')](),controller['index']);router[_0x1e09('0xa')](_0x1e09('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x1e09('0xc')]('/',auth[_0x1e09('0x9')](),controller['create']);router[_0x1e09('0xd')](_0x1e09('0xb'),auth['isAuthenticated'](),controller[_0x1e09('0xe')]);router['delete']('/:id',auth[_0x1e09('0x9')](),controller[_0x1e09('0xf')]);module[_0x1e09('0x10')]=router; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.attributes.js b/server/api/voiceContext/voiceContext.attributes.js index 9367c6a..a88009d 100644 --- a/server/api/voiceContext/voiceContext.attributes.js +++ b/server/api/voiceContext/voiceContext.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3e74=['name','sequelize','STRING'];(function(_0x11c5cf,_0x2994e6){var _0x21932c=function(_0x31d78d){while(--_0x31d78d){_0x11c5cf['push'](_0x11c5cf['shift']());}};_0x21932c(++_0x2994e6);}(_0x3e74,0x175));var _0x43e7=function(_0x3d1c5b,_0x41ad34){_0x3d1c5b=_0x3d1c5b-0x0;var _0x4e14e7=_0x3e74[_0x3d1c5b];return _0x4e14e7;};'use strict';var Sequelize=require(_0x43e7('0x0'));module['exports']={'name':{'type':Sequelize[_0x43e7('0x1')],'unique':_0x43e7('0x2')},'description':{'type':Sequelize[_0x43e7('0x1')],'allowNull':!![]},'defaultEntry':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0}}; \ No newline at end of file +var _0x9957=['name','BOOLEAN','sequelize','exports','STRING'];(function(_0x5b190e,_0x3d240d){var _0x14d44e=function(_0x50a134){while(--_0x50a134){_0x5b190e['push'](_0x5b190e['shift']());}};_0x14d44e(++_0x3d240d);}(_0x9957,0x93));var _0x7995=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9957[_0x501510];return _0x1e6ee5;};'use strict';var Sequelize=require(_0x7995('0x0'));module[_0x7995('0x1')]={'name':{'type':Sequelize[_0x7995('0x2')],'unique':_0x7995('0x3')},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0x7995('0x4')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.controller.js b/server/api/voiceContext/voiceContext.controller.js index 87aa315..2ce90ed 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 _0xc76e=['message','VoiceContext,\x20%s,\x20%s','result','catch','sendStatus','status','end','offset','limit','set','Content-Range','json','apply','save','update','destroy','get','Contexts','UserProfileResource','name','rawAttributes','keys','query','model','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','filters','pick','filter','where','merge','map','type','key','VIRTUAL','field','options','VoiceContext','count','include','findAll','rows','show','includeAll','create','join','root','render','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','Reload','user','UserProfileSection','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','readFileSync','server/files/templates/context.ejs','utf8','chan_sip.so','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../mysqldb','jayson/promise','client','http','test','request','then','info','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x32f970,_0x468e50){var _0xafa5b6=function(_0xe55c63){while(--_0xe55c63){_0x32f970['push'](_0x32f970['shift']());}};_0xafa5b6(++_0x468e50);}(_0xc76e,0xa8));var _0xec76=function(_0x2712b6,_0x34f6cf){_0x2712b6=_0x2712b6-0x0;var _0x631450=_0xc76e[_0x2712b6];return _0x631450;};'use strict';var pdf=require(_0xec76('0x0'));var emlformat=require(_0xec76('0x1'));var rimraf=require(_0xec76('0x2'));var zipdir=require(_0xec76('0x3'));var jsonpatch=require(_0xec76('0x4'));var rp=require(_0xec76('0x5'));var moment=require(_0xec76('0x6'));var BPromise=require(_0xec76('0x7'));var Mustache=require(_0xec76('0x8'));var util=require('util');var path=require(_0xec76('0x9'));var sox=require(_0xec76('0xa'));var csv=require(_0xec76('0xb'));var ejs=require(_0xec76('0xc'));var fs=require('fs');var _=require('lodash');var squel=require(_0xec76('0xd'));var crypto=require('crypto');var jsforce=require(_0xec76('0xe'));var deskjs=require(_0xec76('0xf'));var toCsv=require(_0xec76('0xb'));var querystring=require(_0xec76('0x10'));var Papa=require(_0xec76('0x11'));var Redis=require(_0xec76('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xec76('0x13'));var as=require(_0xec76('0x14'));var hardwareService=require(_0xec76('0x15'));var logger=require('../../config/logger')(_0xec76('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0xec76('0x17'))['db'];var jayson=require(_0xec76('0x18'));var client=jayson[_0xec76('0x19')][_0xec76('0x1a')]({'port':0x232a});function checkPasswordPattern(_0x42b580,_0x885130,_0x1adf68){if(_0x1adf68){var _0x1deeb7=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1deeb7[_0xec76('0x1b')](_0x885130)){return _0x42b580;}else{throw new Error('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x42b580;}}function respondWithRpcPromise(_0x37a980,_0x5a575f,_0x20c0a3,_0x2629a9){return new BPromise(function(_0x57d767,_0x7ffca1){var _0x5b665f=_0x2629a9||client;return _0x5b665f[_0xec76('0x1c')](_0x37a980,_0x20c0a3)[_0xec76('0x1d')](function(_0x2da6f7){logger[_0xec76('0x1e')]('VoiceContext,\x20%s,\x20%s',_0x5a575f,_0xec76('0x1f'));logger[_0xec76('0x20')](_0xec76('0x21'),_0x5a575f,_0xec76('0x1f'),JSON[_0xec76('0x22')](_0x2da6f7));if(_0x2da6f7['error']){if(_0x2da6f7['error']['code']===0x1f4){logger[_0xec76('0x23')]('VoiceContext,\x20%s,\x20%s',_0x5a575f,_0x2da6f7[_0xec76('0x23')][_0xec76('0x24')]);return _0x7ffca1(_0x2da6f7[_0xec76('0x23')]['message']);}logger[_0xec76('0x23')](_0xec76('0x25'),_0x5a575f,_0x2da6f7[_0xec76('0x23')][_0xec76('0x24')]);return _0x57d767(_0x2da6f7['error'][_0xec76('0x24')]);}else{logger['info'](_0xec76('0x25'),_0x5a575f,'request\x20sent');_0x57d767(_0x2da6f7[_0xec76('0x26')][_0xec76('0x24')]);}})[_0xec76('0x27')](function(_0x171b0a){logger[_0xec76('0x23')]('VoiceContext,\x20%s,\x20%s',_0x5a575f,_0x171b0a);_0x7ffca1(_0x171b0a);});});}function respondWithStatusCode(_0x993025,_0x4bfdc3){_0x4bfdc3=_0x4bfdc3||0xcc;return function(_0x5d005c){if(_0x5d005c){return _0x993025[_0xec76('0x28')](_0x4bfdc3);}return _0x993025[_0xec76('0x29')](_0x4bfdc3)[_0xec76('0x2a')]();};}function respondWithResult(_0x32e487,_0x4f4709){_0x4f4709=_0x4f4709||0xc8;return function(_0x3c54d5){if(_0x3c54d5){return _0x32e487[_0xec76('0x29')](_0x4f4709)['json'](_0x3c54d5);}};}function respondWithFilteredResult(_0x49c83d,_0x49f390){return function(_0x346f94){if(_0x346f94){var _0xb2a32=_0x346f94['count'],_0x541000=_0x49f390['offset'],_0x12417f=_0x49f390[_0xec76('0x2b')]+_0x49f390[_0xec76('0x2c')],_0x30309a;if(_0x12417f>=_0xb2a32){_0x12417f=_0xb2a32;_0x30309a=0xc8;}else{_0x30309a=0xce;}_0x49c83d[_0xec76('0x29')](_0x30309a);return _0x49c83d[_0xec76('0x2d')](_0xec76('0x2e'),_0x541000+'-'+_0x12417f+'/'+_0xb2a32)[_0xec76('0x2f')](_0x346f94);}return null;};}function patchUpdates(_0x441ff7){return function(_0x20948f){try{jsonpatch[_0xec76('0x30')](_0x20948f,_0x441ff7,!![]);}catch(_0x1872c4){return BPromise['reject'](_0x1872c4);}return _0x20948f[_0xec76('0x31')]();};}function saveUpdates(_0x88bd1f,_0x38d9e2){return function(_0x33407e){if(_0x33407e){return _0x33407e[_0xec76('0x32')](_0x88bd1f)[_0xec76('0x1d')](function(_0x520b4e){return _0x520b4e;});}return null;};}function removeEntity(_0x2649ea,_0x42bbcf){return function(_0x1d734f){if(_0x1d734f){return _0x1d734f[_0xec76('0x33')]()[_0xec76('0x1d')](function(){var _0x36d406=_0x1d734f[_0xec76('0x34')]({'plain':!![]});var _0x1606fe=_0xec76('0x35');return db[_0xec76('0x36')][_0xec76('0x33')]({'where':{'type':_0x1606fe,'resourceId':_0x36d406['id']}})[_0xec76('0x1d')](function(){return _0x1d734f;});})[_0xec76('0x1d')](function(){_0x2649ea[_0xec76('0x29')](0xcc)[_0xec76('0x2a')]();});}};}function handleEntityNotFound(_0x1dd367,_0x48a2ca){return function(_0x3ac0db){if(!_0x3ac0db){_0x1dd367[_0xec76('0x28')](0x194);}return _0x3ac0db;};}function handleError(_0x295b11,_0x4ca080){_0x4ca080=_0x4ca080||0x1f4;return function(_0x49235a){logger[_0xec76('0x23')](_0x49235a['stack']);if(_0x49235a[_0xec76('0x37')]){delete _0x49235a[_0xec76('0x37')];}_0x295b11[_0xec76('0x29')](_0x4ca080)['send'](_0x49235a);};}exports['index']=function(_0x5308eb,_0x517860){var _0x52dd36={},_0x2bfced={},_0xbdb0f={'count':0x0,'rows':[]};var _0x589efa=db['VoiceContext'][_0xec76('0x38')];_0x2bfced['model']=_[_0xec76('0x39')](_0x589efa);_0x2bfced[_0xec76('0x3a')]=_['keys'](_0x5308eb[_0xec76('0x3a')]);_0x2bfced['filters']=_['intersection'](_0x2bfced[_0xec76('0x3b')],_0x2bfced[_0xec76('0x3a')]);_0x52dd36['attributes']=_[_0xec76('0x3c')](_0x2bfced[_0xec76('0x3b')],qs['fields'](_0x5308eb[_0xec76('0x3a')][_0xec76('0x3d')]));_0x52dd36[_0xec76('0x3e')]=_0x52dd36[_0xec76('0x3e')][_0xec76('0x3f')]?_0x52dd36[_0xec76('0x3e')]:_0x2bfced[_0xec76('0x3b')];if(!_0x5308eb[_0xec76('0x3a')][_0xec76('0x40')](_0xec76('0x41'))){_0x52dd36[_0xec76('0x2c')]=qs['limit'](_0x5308eb[_0xec76('0x3a')][_0xec76('0x2c')]);_0x52dd36[_0xec76('0x2b')]=qs['offset'](_0x5308eb[_0xec76('0x3a')]['offset']);}_0x52dd36['order']=qs[_0xec76('0x42')](_0x5308eb[_0xec76('0x3a')][_0xec76('0x42')]);_0x52dd36['where']=qs[_0xec76('0x43')](_[_0xec76('0x44')](_0x5308eb['query'],_0x2bfced[_0xec76('0x43')]));if(_0x5308eb[_0xec76('0x3a')][_0xec76('0x45')]){_0x52dd36[_0xec76('0x46')]=_[_0xec76('0x47')](_0x52dd36[_0xec76('0x46')],{'$or':_[_0xec76('0x48')](_0x589efa,function(_0x416151){if(_0x416151[_0xec76('0x49')][_0xec76('0x4a')]!==_0xec76('0x4b')){var _0x508af1={};_0x508af1[_0x416151[_0xec76('0x4c')]]={'$like':'%'+_0x5308eb[_0xec76('0x3a')][_0xec76('0x45')]+'%'};return _0x508af1;}})});}_0x52dd36=_[_0xec76('0x47')]({},_0x52dd36,_0x5308eb[_0xec76('0x4d')]);var _0xe8dfa0={'where':_0x52dd36[_0xec76('0x46')]};return db[_0xec76('0x4e')][_0xec76('0x4f')](_0xe8dfa0)[_0xec76('0x1d')](function(_0x20a3c5){_0xbdb0f[_0xec76('0x4f')]=_0x20a3c5;if(_0x5308eb[_0xec76('0x3a')]['includeAll']){_0x52dd36[_0xec76('0x50')]=[{'all':!![]}];}return db[_0xec76('0x4e')][_0xec76('0x51')](_0x52dd36);})[_0xec76('0x1d')](function(_0x2200f9){_0xbdb0f[_0xec76('0x52')]=_0x2200f9;return _0xbdb0f;})['then'](respondWithFilteredResult(_0x517860,_0x52dd36))['catch'](handleError(_0x517860,null));};exports[_0xec76('0x53')]=function(_0x41800b,_0x567350){var _0x56b481={'raw':![],'where':{'id':_0x41800b['params']['id']}},_0x47963c={};_0x47963c['model']=_[_0xec76('0x39')](db['VoiceContext'][_0xec76('0x38')]);_0x47963c[_0xec76('0x3a')]=_[_0xec76('0x39')](_0x41800b[_0xec76('0x3a')]);_0x47963c[_0xec76('0x43')]=_[_0xec76('0x3c')](_0x47963c['model'],_0x47963c[_0xec76('0x3a')]);_0x56b481[_0xec76('0x3e')]=_['intersection'](_0x47963c['model'],qs[_0xec76('0x3d')](_0x41800b['query']['fields']));_0x56b481[_0xec76('0x3e')]=_0x56b481['attributes']['length']?_0x56b481['attributes']:_0x47963c[_0xec76('0x3b')];if(_0x41800b[_0xec76('0x3a')][_0xec76('0x54')]){_0x56b481[_0xec76('0x50')]=[{'all':!![]}];}_0x56b481=_[_0xec76('0x47')]({},_0x56b481,_0x41800b[_0xec76('0x4d')]);return db[_0xec76('0x4e')]['find'](_0x56b481)[_0xec76('0x1d')](handleEntityNotFound(_0x567350,null))[_0xec76('0x1d')](respondWithResult(_0x567350,null))['catch'](handleError(_0x567350,null));};exports[_0xec76('0x55')]=function(_0x147fbd,_0x48f637,_0x34adb1){var _0x53a67e;return db[_0xec76('0x4e')][_0xec76('0x55')](_0x147fbd['body'],{'raw':!![]})[_0xec76('0x1d')](function(_0x24627d){_0x53a67e=_0x24627d;return db['VoiceContext'][_0xec76('0x51')]({'raw':!![]});})[_0xec76('0x1d')](function(_0x2bc322){var _0x1ae25c=fs['readFileSync'](path[_0xec76('0x56')](config[_0xec76('0x57')],'server/files/templates/context.ejs'),'utf8');var _0x27a12d=ejs[_0xec76('0x58')](_0x1ae25c,{'contexts':_0x2bc322||[]});fs[_0xec76('0x59')](_0xec76('0x5a'),_0x27a12d);})[_0xec76('0x1d')](function(){return respondWithRpcPromise(_0xec76('0x5b'),_0xec76('0x55'),{'module':'chan_sip.so'});})['then'](function(){var _0x287044=_0x147fbd[_0xec76('0x5c')]['get']({'plain':!![]});if(!_0x287044)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x287044['role']===_0xec76('0x5c')){var _0x3cf395=_0x53a67e['get']({'plain':!![]});return db[_0xec76('0x5d')][_0xec76('0x5e')]({'where':{'name':_0xec76('0x35'),'userProfileId':_0x287044['userProfileId']},'raw':!![]})[_0xec76('0x1d')](function(_0x364c25){if(_0x364c25&&_0x364c25[_0xec76('0x5f')]===0x0){return db[_0xec76('0x36')][_0xec76('0x55')]({'name':_0x3cf395[_0xec76('0x37')],'resourceId':_0x3cf395['id'],'type':_0x364c25[_0xec76('0x37')],'sectionId':_0x364c25['id']},{})[_0xec76('0x1d')](function(){return _0x53a67e;});}else{return _0x53a67e;}})[_0xec76('0x27')](function(_0x23c27c){logger[_0xec76('0x23')](_0xec76('0x60'),_0x23c27c);throw _0x23c27c;});}return _0x53a67e;})[_0xec76('0x1d')](respondWithResult(_0x48f637,0xc9))[_0xec76('0x27')](handleError(_0x48f637,null));};exports[_0xec76('0x32')]=function(_0x182add,_0x20de43,_0x2f6716){var _0x495bb5;return db[_0xec76('0x4e')][_0xec76('0x5e')]({'where':{'id':_0x182add['params']['id']}})['then'](handleEntityNotFound(_0x20de43,null))[_0xec76('0x1d')](saveUpdates(_0x182add[_0xec76('0x61')],null))['then'](function(_0x127740){if(_0x127740){_0x495bb5=_0x127740;return db['VoiceContext']['findAll']({'raw':!![]});}})[_0xec76('0x1d')](function(_0x43b9c1){var _0x32aac1=fs[_0xec76('0x62')](path['join'](config[_0xec76('0x57')],_0xec76('0x63')),_0xec76('0x64'));var _0x3bc703=ejs[_0xec76('0x58')](_0x32aac1,{'contexts':_0x43b9c1||[]});fs[_0xec76('0x59')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x3bc703);})[_0xec76('0x1d')](function(){return respondWithRpcPromise(_0xec76('0x5b'),_0xec76('0x32'),{'module':_0xec76('0x65')});})[_0xec76('0x1d')](function(){return _0x495bb5;})[_0xec76('0x1d')](respondWithResult(_0x20de43,null))['catch'](handleError(_0x20de43,null));};exports[_0xec76('0x33')]=function(_0x3be56c,_0x2db647,_0x43f5a5){var _0x383461;return db[_0xec76('0x4e')][_0xec76('0x5e')]({'where':{'id':_0x3be56c['params']['id']}})[_0xec76('0x1d')](handleEntityNotFound(_0x2db647,null))[_0xec76('0x1d')](removeEntity(_0x2db647,null))['then'](function(){return db['VoiceContext'][_0xec76('0x51')]({'raw':!![]});})['then'](function(_0x4f4a66){var _0x3b085a=fs[_0xec76('0x62')](path[_0xec76('0x56')](config[_0xec76('0x57')],'server/files/templates/context.ejs'),'utf8');var _0x8cd845=ejs[_0xec76('0x58')](_0x3b085a,{'contexts':_0x4f4a66});fs[_0xec76('0x59')](_0xec76('0x5a'),_0x8cd845);return respondWithRpcPromise(_0xec76('0x5b'),_0xec76('0x33'),{'module':_0xec76('0x65')});})[_0xec76('0x27')](handleError(_0x2db647,null));}; \ No newline at end of file +var _0x9f97=['mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','jayson/promise','http','test','request','then','info','VoiceContext,\x20%s,\x20%s','VoiceContext,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','sendStatus','status','end','json','count','offset','set','Content-Range','apply','reject','update','Contexts','UserProfileResource','destroy','stack','name','index','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','map','type','key','VIRTUAL','field','options','includeAll','include','VoiceContext','show','params','find','body','findAll','readFileSync','join','root','server/files/templates/context.ejs','utf8','render','writeFileSync','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','/etc/asterisk/extensions_xcally_contexts.conf','Reload','chan_sip.so','eml-format','rimraf','request-promise','moment','bluebird'];(function(_0x354067,_0x3d475c){var _0x365847=function(_0x341683){while(--_0x341683){_0x354067['push'](_0x354067['shift']());}};_0x365847(++_0x3d475c);}(_0x9f97,0x1ef));var _0x79f9=function(_0x485f35,_0x45a0fc){_0x485f35=_0x485f35-0x0;var _0x2ad118=_0x9f97[_0x485f35];return _0x2ad118;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x79f9('0x0'));var rimraf=require(_0x79f9('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x79f9('0x2'));var moment=require(_0x79f9('0x3'));var BPromise=require(_0x79f9('0x4'));var Mustache=require(_0x79f9('0x5'));var util=require(_0x79f9('0x6'));var path=require('path');var sox=require(_0x79f9('0x7'));var csv=require(_0x79f9('0x8'));var ejs=require(_0x79f9('0x9'));var fs=require('fs');var _=require(_0x79f9('0xa'));var squel=require(_0x79f9('0xb'));var crypto=require(_0x79f9('0xc'));var jsforce=require(_0x79f9('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x79f9('0xe'));var Redis=require(_0x79f9('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x79f9('0x10'));var as=require(_0x79f9('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x79f9('0x12'));var utils=require('../../config/utils');var config=require(_0x79f9('0x13'));var db=require('../../mysqldb')['db'];var jayson=require(_0x79f9('0x14'));var client=jayson['client'][_0x79f9('0x15')]({'port':0x232a});function checkPasswordPattern(_0x4e1c49,_0x2b7749,_0x18d6ee){if(_0x18d6ee){var _0x21a73a=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x21a73a[_0x79f9('0x16')](_0x2b7749)){return _0x4e1c49;}else{throw new Error('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x4e1c49;}}function respondWithRpcPromise(_0x97427f,_0x5b2c04,_0x473bf7,_0x4abf98){return new BPromise(function(_0x29e9d5,_0x21f178){var _0x2049e9=_0x4abf98||client;return _0x2049e9[_0x79f9('0x17')](_0x97427f,_0x473bf7)[_0x79f9('0x18')](function(_0x4a6ae0){logger[_0x79f9('0x19')](_0x79f9('0x1a'),_0x5b2c04,'request\x20sent');logger['debug'](_0x79f9('0x1b'),_0x5b2c04,_0x79f9('0x1c'),JSON[_0x79f9('0x1d')](_0x4a6ae0));if(_0x4a6ae0[_0x79f9('0x1e')]){if(_0x4a6ae0[_0x79f9('0x1e')]['code']===0x1f4){logger[_0x79f9('0x1e')](_0x79f9('0x1a'),_0x5b2c04,_0x4a6ae0[_0x79f9('0x1e')]['message']);return _0x21f178(_0x4a6ae0['error']['message']);}logger[_0x79f9('0x1e')](_0x79f9('0x1a'),_0x5b2c04,_0x4a6ae0[_0x79f9('0x1e')]['message']);return _0x29e9d5(_0x4a6ae0[_0x79f9('0x1e')][_0x79f9('0x1f')]);}else{logger[_0x79f9('0x19')](_0x79f9('0x1a'),_0x5b2c04,'request\x20sent');_0x29e9d5(_0x4a6ae0[_0x79f9('0x20')][_0x79f9('0x1f')]);}})[_0x79f9('0x21')](function(_0x3cd903){logger[_0x79f9('0x1e')](_0x79f9('0x1a'),_0x5b2c04,_0x3cd903);_0x21f178(_0x3cd903);});});}function respondWithStatusCode(_0x15b165,_0x14561e){_0x14561e=_0x14561e||0xcc;return function(_0xdfeccc){if(_0xdfeccc){return _0x15b165[_0x79f9('0x22')](_0x14561e);}return _0x15b165[_0x79f9('0x23')](_0x14561e)[_0x79f9('0x24')]();};}function respondWithResult(_0x1852c6,_0x1215b2){_0x1215b2=_0x1215b2||0xc8;return function(_0x5a771e){if(_0x5a771e){return _0x1852c6['status'](_0x1215b2)[_0x79f9('0x25')](_0x5a771e);}};}function respondWithFilteredResult(_0x108226,_0x177af3){return function(_0x36e466){if(_0x36e466){var _0x531f02=_0x36e466[_0x79f9('0x26')],_0x511f37=_0x177af3[_0x79f9('0x27')],_0x518871=_0x177af3['offset']+_0x177af3['limit'],_0xde94a5;if(_0x518871>=_0x531f02){_0x518871=_0x531f02;_0xde94a5=0xc8;}else{_0xde94a5=0xce;}_0x108226[_0x79f9('0x23')](_0xde94a5);return _0x108226[_0x79f9('0x28')](_0x79f9('0x29'),_0x511f37+'-'+_0x518871+'/'+_0x531f02)['json'](_0x36e466);}return null;};}function patchUpdates(_0x5cf30c){return function(_0x50c29e){try{jsonpatch[_0x79f9('0x2a')](_0x50c29e,_0x5cf30c,!![]);}catch(_0x302a62){return BPromise[_0x79f9('0x2b')](_0x302a62);}return _0x50c29e['save']();};}function saveUpdates(_0x105522,_0xa027f9){return function(_0x5b8d00){if(_0x5b8d00){return _0x5b8d00[_0x79f9('0x2c')](_0x105522)[_0x79f9('0x18')](function(_0x37dbf4){return _0x37dbf4;});}return null;};}function removeEntity(_0x16a144,_0x737b9c){return function(_0x149bc8){if(_0x149bc8){return _0x149bc8['destroy']()[_0x79f9('0x18')](function(){var _0xcb13f1=_0x149bc8['get']({'plain':!![]});var _0x3bd3d2=_0x79f9('0x2d');return db[_0x79f9('0x2e')][_0x79f9('0x2f')]({'where':{'type':_0x3bd3d2,'resourceId':_0xcb13f1['id']}})[_0x79f9('0x18')](function(){return _0x149bc8;});})[_0x79f9('0x18')](function(){_0x16a144[_0x79f9('0x23')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4058ae,_0x527aea){return function(_0x39f28c){if(!_0x39f28c){_0x4058ae[_0x79f9('0x22')](0x194);}return _0x39f28c;};}function handleError(_0x4a16b8,_0x24a092){_0x24a092=_0x24a092||0x1f4;return function(_0x26d9ea){logger['error'](_0x26d9ea[_0x79f9('0x30')]);if(_0x26d9ea[_0x79f9('0x31')]){delete _0x26d9ea[_0x79f9('0x31')];}_0x4a16b8[_0x79f9('0x23')](_0x24a092)['send'](_0x26d9ea);};}exports[_0x79f9('0x32')]=function(_0x3b782b,_0x4a1f17){var _0x5521d7={},_0x1c9fd9={},_0x16ebec={'count':0x0,'rows':[]};var _0x31cc58=db['VoiceContext'][_0x79f9('0x33')];_0x1c9fd9[_0x79f9('0x34')]=_[_0x79f9('0x35')](_0x31cc58);_0x1c9fd9['query']=_['keys'](_0x3b782b[_0x79f9('0x36')]);_0x1c9fd9[_0x79f9('0x37')]=_[_0x79f9('0x38')](_0x1c9fd9[_0x79f9('0x34')],_0x1c9fd9[_0x79f9('0x36')]);_0x5521d7[_0x79f9('0x39')]=_[_0x79f9('0x38')](_0x1c9fd9['model'],qs[_0x79f9('0x3a')](_0x3b782b[_0x79f9('0x36')][_0x79f9('0x3a')]));_0x5521d7[_0x79f9('0x39')]=_0x5521d7[_0x79f9('0x39')][_0x79f9('0x3b')]?_0x5521d7[_0x79f9('0x39')]:_0x1c9fd9[_0x79f9('0x34')];if(!_0x3b782b['query'][_0x79f9('0x3c')](_0x79f9('0x3d'))){_0x5521d7['limit']=qs['limit'](_0x3b782b['query']['limit']);_0x5521d7[_0x79f9('0x27')]=qs[_0x79f9('0x27')](_0x3b782b[_0x79f9('0x36')]['offset']);}_0x5521d7[_0x79f9('0x3e')]=qs[_0x79f9('0x3f')](_0x3b782b[_0x79f9('0x36')]['sort']);_0x5521d7[_0x79f9('0x40')]=qs[_0x79f9('0x37')](_['pick'](_0x3b782b['query'],_0x1c9fd9[_0x79f9('0x37')]));if(_0x3b782b[_0x79f9('0x36')][_0x79f9('0x41')]){_0x5521d7[_0x79f9('0x40')]=_[_0x79f9('0x42')](_0x5521d7['where'],{'$or':_[_0x79f9('0x43')](_0x31cc58,function(_0x2b5a29){if(_0x2b5a29[_0x79f9('0x44')][_0x79f9('0x45')]!==_0x79f9('0x46')){var _0x3601f0={};_0x3601f0[_0x2b5a29[_0x79f9('0x47')]]={'$like':'%'+_0x3b782b[_0x79f9('0x36')][_0x79f9('0x41')]+'%'};return _0x3601f0;}})});}_0x5521d7=_[_0x79f9('0x42')]({},_0x5521d7,_0x3b782b[_0x79f9('0x48')]);var _0x53bec1={'where':_0x5521d7[_0x79f9('0x40')]};return db['VoiceContext'][_0x79f9('0x26')](_0x53bec1)[_0x79f9('0x18')](function(_0xb8f05e){_0x16ebec[_0x79f9('0x26')]=_0xb8f05e;if(_0x3b782b[_0x79f9('0x36')][_0x79f9('0x49')]){_0x5521d7[_0x79f9('0x4a')]=[{'all':!![]}];}return db[_0x79f9('0x4b')]['findAll'](_0x5521d7);})[_0x79f9('0x18')](function(_0xcb1c1){_0x16ebec['rows']=_0xcb1c1;return _0x16ebec;})[_0x79f9('0x18')](respondWithFilteredResult(_0x4a1f17,_0x5521d7))[_0x79f9('0x21')](handleError(_0x4a1f17,null));};exports[_0x79f9('0x4c')]=function(_0x14fd43,_0x30e4a8){var _0x4c5d10={'raw':![],'where':{'id':_0x14fd43[_0x79f9('0x4d')]['id']}},_0xd65aa2={};_0xd65aa2[_0x79f9('0x34')]=_[_0x79f9('0x35')](db[_0x79f9('0x4b')][_0x79f9('0x33')]);_0xd65aa2['query']=_[_0x79f9('0x35')](_0x14fd43['query']);_0xd65aa2[_0x79f9('0x37')]=_[_0x79f9('0x38')](_0xd65aa2['model'],_0xd65aa2['query']);_0x4c5d10['attributes']=_['intersection'](_0xd65aa2[_0x79f9('0x34')],qs[_0x79f9('0x3a')](_0x14fd43[_0x79f9('0x36')][_0x79f9('0x3a')]));_0x4c5d10[_0x79f9('0x39')]=_0x4c5d10[_0x79f9('0x39')][_0x79f9('0x3b')]?_0x4c5d10[_0x79f9('0x39')]:_0xd65aa2[_0x79f9('0x34')];if(_0x14fd43[_0x79f9('0x36')][_0x79f9('0x49')]){_0x4c5d10[_0x79f9('0x4a')]=[{'all':!![]}];}_0x4c5d10=_[_0x79f9('0x42')]({},_0x4c5d10,_0x14fd43['options']);return db[_0x79f9('0x4b')][_0x79f9('0x4e')](_0x4c5d10)[_0x79f9('0x18')](handleEntityNotFound(_0x30e4a8,null))[_0x79f9('0x18')](respondWithResult(_0x30e4a8,null))[_0x79f9('0x21')](handleError(_0x30e4a8,null));};exports['create']=function(_0x372e28,_0x19c44a,_0x256ca4){var _0x383354;return db[_0x79f9('0x4b')]['create'](_0x372e28[_0x79f9('0x4f')],{'raw':!![]})[_0x79f9('0x18')](function(_0x1643de){_0x383354=_0x1643de;return db[_0x79f9('0x4b')][_0x79f9('0x50')]({'raw':!![]});})[_0x79f9('0x18')](function(_0x560885){var _0xe9c2c0=fs[_0x79f9('0x51')](path[_0x79f9('0x52')](config[_0x79f9('0x53')],_0x79f9('0x54')),_0x79f9('0x55'));var _0x1707c7=ejs[_0x79f9('0x56')](_0xe9c2c0,{'contexts':_0x560885||[]});fs[_0x79f9('0x57')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x1707c7);})[_0x79f9('0x18')](function(){return respondWithRpcPromise('Reload',_0x79f9('0x58'),{'module':'chan_sip.so'});})[_0x79f9('0x18')](function(){var _0xa27b3b=_0x372e28[_0x79f9('0x59')][_0x79f9('0x5a')]({'plain':!![]});if(!_0xa27b3b)throw new Error(_0x79f9('0x5b'));if(_0xa27b3b[_0x79f9('0x5c')]===_0x79f9('0x59')){var _0x13fa6a=_0x383354[_0x79f9('0x5a')]({'plain':!![]});return db[_0x79f9('0x5d')]['find']({'where':{'name':_0x79f9('0x2d'),'userProfileId':_0xa27b3b[_0x79f9('0x5e')]},'raw':!![]})[_0x79f9('0x18')](function(_0x5193f1){if(_0x5193f1&&_0x5193f1[_0x79f9('0x5f')]===0x0){return db[_0x79f9('0x2e')][_0x79f9('0x58')]({'name':_0x13fa6a[_0x79f9('0x31')],'resourceId':_0x13fa6a['id'],'type':_0x5193f1[_0x79f9('0x31')],'sectionId':_0x5193f1['id']},{})['then'](function(){return _0x383354;});}else{return _0x383354;}})[_0x79f9('0x21')](function(_0x2f9e44){logger[_0x79f9('0x1e')](_0x79f9('0x60'),_0x2f9e44);throw _0x2f9e44;});}return _0x383354;})[_0x79f9('0x18')](respondWithResult(_0x19c44a,0xc9))['catch'](handleError(_0x19c44a,null));};exports[_0x79f9('0x2c')]=function(_0x85cc0,_0x605b12,_0x2f0075){var _0x17a7eb;return db[_0x79f9('0x4b')][_0x79f9('0x4e')]({'where':{'id':_0x85cc0['params']['id']}})[_0x79f9('0x18')](handleEntityNotFound(_0x605b12,null))[_0x79f9('0x18')](saveUpdates(_0x85cc0[_0x79f9('0x4f')],null))[_0x79f9('0x18')](function(_0xd61b44){if(_0xd61b44){_0x17a7eb=_0xd61b44;return db[_0x79f9('0x4b')][_0x79f9('0x50')]({'raw':!![]});}})[_0x79f9('0x18')](function(_0x105f3f){var _0x41b60a=fs[_0x79f9('0x51')](path['join'](config[_0x79f9('0x53')],'server/files/templates/context.ejs'),'utf8');var _0x527556=ejs[_0x79f9('0x56')](_0x41b60a,{'contexts':_0x105f3f||[]});fs['writeFileSync'](_0x79f9('0x61'),_0x527556);})[_0x79f9('0x18')](function(){return respondWithRpcPromise(_0x79f9('0x62'),_0x79f9('0x2c'),{'module':_0x79f9('0x63')});})['then'](function(){return _0x17a7eb;})[_0x79f9('0x18')](respondWithResult(_0x605b12,null))[_0x79f9('0x21')](handleError(_0x605b12,null));};exports['destroy']=function(_0x5c3b44,_0x1e1900,_0x1db42f){var _0xf5f279;return db[_0x79f9('0x4b')][_0x79f9('0x4e')]({'where':{'id':_0x5c3b44['params']['id']}})[_0x79f9('0x18')](handleEntityNotFound(_0x1e1900,null))['then'](removeEntity(_0x1e1900,null))[_0x79f9('0x18')](function(){return db[_0x79f9('0x4b')][_0x79f9('0x50')]({'raw':!![]});})[_0x79f9('0x18')](function(_0x23c2e2){var _0x1ecfc8=fs[_0x79f9('0x51')](path[_0x79f9('0x52')](config['root'],_0x79f9('0x54')),'utf8');var _0x33a38c=ejs[_0x79f9('0x56')](_0x1ecfc8,{'contexts':_0x23c2e2});fs['writeFileSync'](_0x79f9('0x61'),_0x33a38c);return respondWithRpcPromise(_0x79f9('0x62'),'destroy',{'module':_0x79f9('0x63')});})[_0x79f9('0x21')](handleError(_0x1e1900,null));}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.model.js b/server/api/voiceContext/voiceContext.model.js index 827f710..7beded3 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 _0x123d=['rimraf','../../config/environment','./voiceContext.attributes','define','VoiceContext','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0x1dd175,_0x590a7b){var _0x53539a=function(_0x24501b){while(--_0x24501b){_0x1dd175['push'](_0x1dd175['shift']());}};_0x53539a(++_0x590a7b);}(_0x123d,0x89));var _0xd123=function(_0x500c99,_0x5ba884){_0x500c99=_0x500c99-0x0;var _0x12bec8=_0x123d[_0x500c99];return _0x12bec8;};'use strict';var _=require(_0xd123('0x0'));var util=require(_0xd123('0x1'));var logger=require(_0xd123('0x2'))(_0xd123('0x3'));var moment=require(_0xd123('0x4'));var BPromise=require('bluebird');var rp=require(_0xd123('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd123('0x6'));var config=require(_0xd123('0x7'));var attributes=require(_0xd123('0x8'));module['exports']=function(_0x311691,_0x34f953){return _0x311691[_0xd123('0x9')](_0xd123('0xa'),attributes,{'tableName':'voice_contexts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbeb3=['request-promise','path','../../config/environment','exports','define','VoiceContext','../../config/logger','api','moment','bluebird'];(function(_0x380057,_0xe83463){var _0x36a388=function(_0x4287ea){while(--_0x4287ea){_0x380057['push'](_0x380057['shift']());}};_0x36a388(++_0xe83463);}(_0xbeb3,0x150));var _0x3beb=function(_0x4b1032,_0x36952e){_0x4b1032=_0x4b1032-0x0;var _0x5a1d55=_0xbeb3[_0x4b1032];return _0x5a1d55;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3beb('0x0'))(_0x3beb('0x1'));var moment=require(_0x3beb('0x2'));var BPromise=require(_0x3beb('0x3'));var rp=require(_0x3beb('0x4'));var fs=require('fs');var path=require(_0x3beb('0x5'));var rimraf=require('rimraf');var config=require(_0x3beb('0x6'));var attributes=require('./voiceContext.attributes');module[_0x3beb('0x7')]=function(_0x3f6ec7,_0x3c10f1){return _0x3f6ec7[_0x3beb('0x8')](_0x3beb('0x9'),attributes,{'tableName':'voice_contexts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.rpc.js b/server/api/voiceContext/voiceContext.rpc.js index 70487fc..6108efd 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 _0x7ac9=['code','VoiceContext,\x20%s,\x20%s','message','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0x7ac9,0xeb));var _0x97ac=function(_0x1e2879,_0x7c9a48){_0x1e2879=_0x1e2879-0x0;var _0x1c996f=_0x7ac9[_0x1e2879];return _0x1c996f;};'use strict';var _=require(_0x97ac('0x0'));var util=require(_0x97ac('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x97ac('0x2'));var fs=require('fs');var Redis=require(_0x97ac('0x3'));var db=require(_0x97ac('0x4'))['db'];var utils=require(_0x97ac('0x5'));var logger=require(_0x97ac('0x6'))(_0x97ac('0x7'));var config=require(_0x97ac('0x8'));var jayson=require(_0x97ac('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xaf2e80,_0x21c447,_0x53cc12){return new BPromise(function(_0x1c702c,_0x457583){return client[_0x97ac('0xa')](_0xaf2e80,_0x53cc12)[_0x97ac('0xb')](function(_0x191474){logger[_0x97ac('0xc')]('VoiceContext,\x20%s,\x20%s',_0x21c447,_0x97ac('0xd'));logger[_0x97ac('0xe')](_0x97ac('0xf'),_0x21c447,_0x97ac('0xd'),JSON[_0x97ac('0x10')](_0x191474));if(_0x191474[_0x97ac('0x11')]){if(_0x191474['error'][_0x97ac('0x12')]===0x1f4){logger[_0x97ac('0x11')](_0x97ac('0x13'),_0x21c447,_0x191474[_0x97ac('0x11')][_0x97ac('0x14')]);return _0x457583(_0x191474[_0x97ac('0x11')][_0x97ac('0x14')]);}logger['error']('VoiceContext,\x20%s,\x20%s',_0x21c447,_0x191474['error'][_0x97ac('0x14')]);return _0x1c702c(_0x191474[_0x97ac('0x11')][_0x97ac('0x14')]);}else{logger['info'](_0x97ac('0x13'),_0x21c447,'request\x20sent');_0x1c702c(_0x191474[_0x97ac('0x15')][_0x97ac('0x14')]);}})[_0x97ac('0x16')](function(_0x21b5a1){logger[_0x97ac('0x11')]('VoiceContext,\x20%s,\x20%s',_0x21c447,_0x21b5a1);_0x457583(_0x21b5a1);});});} \ No newline at end of file +var _0xb87d=['rpc','jayson/promise','client','request','then','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','code','error','message','info','result','lodash','util','bluebird','randomstring','../../config/utils','../../config/logger'];(function(_0x55326b,_0x2a567c){var _0x2b6de6=function(_0x5e17ea){while(--_0x5e17ea){_0x55326b['push'](_0x55326b['shift']());}};_0x2b6de6(++_0x2a567c);}(_0xb87d,0x15f));var _0xdb87=function(_0x145c29,_0x2b5239){_0x145c29=_0x145c29-0x0;var _0x35c269=_0xb87d[_0x145c29];return _0x35c269;};'use strict';var _=require(_0xdb87('0x0'));var util=require(_0xdb87('0x1'));var moment=require('moment');var BPromise=require(_0xdb87('0x2'));var rs=require(_0xdb87('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xdb87('0x4'));var logger=require(_0xdb87('0x5'))(_0xdb87('0x6'));var config=require('../../config/environment');var jayson=require(_0xdb87('0x7'));var client=jayson[_0xdb87('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x52653a,_0x274cf4,_0x586724){return new BPromise(function(_0x1ed292,_0x430dd3){return client[_0xdb87('0x9')](_0x52653a,_0x586724)[_0xdb87('0xa')](function(_0x55ce9f){logger['info'](_0xdb87('0xb'),_0x274cf4,_0xdb87('0xc'));logger[_0xdb87('0xd')](_0xdb87('0xe'),_0x274cf4,'request\x20sent',JSON[_0xdb87('0xf')](_0x55ce9f));if(_0x55ce9f['error']){if(_0x55ce9f['error'][_0xdb87('0x10')]===0x1f4){logger[_0xdb87('0x11')](_0xdb87('0xb'),_0x274cf4,_0x55ce9f[_0xdb87('0x11')][_0xdb87('0x12')]);return _0x430dd3(_0x55ce9f[_0xdb87('0x11')]['message']);}logger[_0xdb87('0x11')](_0xdb87('0xb'),_0x274cf4,_0x55ce9f[_0xdb87('0x11')]['message']);return _0x1ed292(_0x55ce9f[_0xdb87('0x11')]['message']);}else{logger[_0xdb87('0x13')](_0xdb87('0xb'),_0x274cf4,_0xdb87('0xc'));_0x1ed292(_0x55ce9f[_0xdb87('0x14')][_0xdb87('0x12')]);}})['catch'](function(_0x334059){logger[_0xdb87('0x11')](_0xdb87('0xb'),_0x274cf4,_0x334059);_0x430dd3(_0x334059);});});} \ No newline at end of file diff --git a/server/api/voiceDialReport/index.js b/server/api/voiceDialReport/index.js index e0f98d0..80ebbea 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 _0x6986=['post','update','destroy','multer','util','path','connect-timeout','Router','../../components/auth/service','./voiceDialReport.controller','isAuthenticated','index','get','/describe','describe','/:id'];(function(_0x2c1dcd,_0x350452){var _0x158ce5=function(_0x5c1c57){while(--_0x5c1c57){_0x2c1dcd['push'](_0x2c1dcd['shift']());}};_0x158ce5(++_0x350452);}(_0x6986,0xf3));var _0x6698=function(_0x56e0e8,_0x16ef91){_0x56e0e8=_0x56e0e8-0x0;var _0x2dab50=_0x6986[_0x56e0e8];return _0x2dab50;};'use strict';var multer=require(_0x6698('0x0'));var util=require(_0x6698('0x1'));var path=require(_0x6698('0x2'));var timeout=require(_0x6698('0x3'));var express=require('express');var router=express[_0x6698('0x4')]();var auth=require(_0x6698('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x6698('0x6'));router['get']('/',auth[_0x6698('0x7')](),controller[_0x6698('0x8')]);router[_0x6698('0x9')](_0x6698('0xa'),auth['isAuthenticated'](),controller[_0x6698('0xb')]);router[_0x6698('0x9')](_0x6698('0xc'),auth[_0x6698('0x7')](),controller['show']);router[_0x6698('0xd')]('/',auth[_0x6698('0x7')](),controller['create']);router['put'](_0x6698('0xc'),auth['isAuthenticated'](),controller[_0x6698('0xe')]);router['delete'](_0x6698('0xc'),auth[_0x6698('0x7')](),controller[_0x6698('0xf')]);module['exports']=router; \ No newline at end of file +var _0xe759=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceDialReport.controller','get','isAuthenticated','index','describe','/:id','show','post','create','put','delete','exports','connect-timeout'];(function(_0xf16b1,_0x33c637){var _0x26f94d=function(_0x5643d7){while(--_0x5643d7){_0xf16b1['push'](_0xf16b1['shift']());}};_0x26f94d(++_0x33c637);}(_0xe759,0x1c1));var _0x9e75=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xe759[_0x19e35c];return _0x3e1fe8;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x9e75('0x0'));var express=require(_0x9e75('0x1'));var router=express[_0x9e75('0x2')]();var auth=require(_0x9e75('0x3'));var interaction=require(_0x9e75('0x4'));var config=require(_0x9e75('0x5'));var controller=require(_0x9e75('0x6'));router[_0x9e75('0x7')]('/',auth[_0x9e75('0x8')](),controller[_0x9e75('0x9')]);router[_0x9e75('0x7')]('/describe',auth[_0x9e75('0x8')](),controller[_0x9e75('0xa')]);router[_0x9e75('0x7')](_0x9e75('0xb'),auth[_0x9e75('0x8')](),controller[_0x9e75('0xc')]);router[_0x9e75('0xd')]('/',auth[_0x9e75('0x8')](),controller[_0x9e75('0xe')]);router[_0x9e75('0xf')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x9e75('0x10')](_0x9e75('0xb'),auth[_0x9e75('0x8')](),controller['destroy']);module[_0x9e75('0x11')]=router; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.attributes.js b/server/api/voiceDialReport/voiceDialReport.attributes.js index 0e11b56..6474614 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 _0x3560=['STRING','INTEGER','DATE','exports'];(function(_0x3ad83a,_0x3fb374){var _0x52c7a5=function(_0x38605f){while(--_0x38605f){_0x3ad83a['push'](_0x3ad83a['shift']());}};_0x52c7a5(++_0x3fb374);}(_0x3560,0x1d7));var _0x0356=function(_0x5e4a6a,_0x287632){_0x5e4a6a=_0x5e4a6a-0x0;var _0xc8879f=_0x3560[_0x5e4a6a];return _0xc8879f;};'use strict';var Sequelize=require('sequelize');module[_0x0356('0x0')]={'privilege':{'type':Sequelize[_0x0356('0x1')]},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize[_0x0356('0x2')]},'channelstatedesc':{'type':Sequelize[_0x0356('0x1')]},'calleridnum':{'type':Sequelize[_0x0356('0x1')]},'calleridname':{'type':Sequelize[_0x0356('0x1')]},'connectedlinenum':{'type':Sequelize[_0x0356('0x1')]},'connectedlinename':{'type':Sequelize[_0x0356('0x1')]},'language':{'type':Sequelize[_0x0356('0x1')]},'accountcode':{'type':Sequelize[_0x0356('0x1')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x0356('0x1')]},'priority':{'type':Sequelize[_0x0356('0x2')]},'uniqueid':{'type':Sequelize[_0x0356('0x1')]},'linkedid':{'type':Sequelize[_0x0356('0x1')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0x0356('0x2')]},'destchannelstatedesc':{'type':Sequelize[_0x0356('0x1')]},'destcalleridnum':{'type':Sequelize[_0x0356('0x1')]},'destcalleridname':{'type':Sequelize[_0x0356('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0x0356('0x1')]},'destconnectedlinename':{'type':Sequelize[_0x0356('0x1')]},'destlanguage':{'type':Sequelize[_0x0356('0x1')]},'destaccountcode':{'type':Sequelize[_0x0356('0x1')]},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0x0356('0x1')]},'destpriority':{'type':Sequelize[_0x0356('0x2')]},'destuniqueid':{'type':Sequelize[_0x0356('0x1')]},'destlinkedid':{'type':Sequelize[_0x0356('0x1')]},'dialstring':{'type':Sequelize[_0x0356('0x1')]},'dialstatus':{'type':Sequelize[_0x0356('0x1')]},'starttime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0x0356('0x3')]},'endtime':{'type':Sequelize['DATE']},'lastevent':{'type':Sequelize[_0x0356('0x1')],'comment':'called,connect,complete'},'routeId':{'type':Sequelize[_0x0356('0x2')]},'duration':{'type':Sequelize[_0x0356('0x2')]},'holdtime':{'type':Sequelize['INTEGER']},'billableseconds':{'type':Sequelize[_0x0356('0x2')]}}; \ No newline at end of file +var _0x551f=['STRING','INTEGER','DATE','called,connect,complete','sequelize','exports'];(function(_0x2699b3,_0x2831bb){var _0x2d363c=function(_0x5add3c){while(--_0x5add3c){_0x2699b3['push'](_0x2699b3['shift']());}};_0x2d363c(++_0x2831bb);}(_0x551f,0x148));var _0xf551=function(_0x5962af,_0x3d7318){_0x5962af=_0x5962af-0x0;var _0x2afe09=_0x551f[_0x5962af];return _0x2afe09;};'use strict';var Sequelize=require(_0xf551('0x0'));module[_0xf551('0x1')]={'privilege':{'type':Sequelize[_0xf551('0x2')]},'channel':{'type':Sequelize[_0xf551('0x2')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0xf551('0x2')]},'calleridnum':{'type':Sequelize[_0xf551('0x2')]},'calleridname':{'type':Sequelize[_0xf551('0x2')]},'connectedlinenum':{'type':Sequelize[_0xf551('0x2')]},'connectedlinename':{'type':Sequelize[_0xf551('0x2')]},'language':{'type':Sequelize[_0xf551('0x2')]},'accountcode':{'type':Sequelize[_0xf551('0x2')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0xf551('0x2')]},'priority':{'type':Sequelize[_0xf551('0x3')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0xf551('0x2')]},'destchannel':{'type':Sequelize[_0xf551('0x2')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0xf551('0x2')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0xf551('0x2')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize[_0xf551('0x2')]},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0xf551('0x2')]},'destexten':{'type':Sequelize[_0xf551('0x2')]},'destpriority':{'type':Sequelize[_0xf551('0x3')]},'destuniqueid':{'type':Sequelize[_0xf551('0x2')]},'destlinkedid':{'type':Sequelize['STRING']},'dialstring':{'type':Sequelize[_0xf551('0x2')]},'dialstatus':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0xf551('0x4')]},'answertime':{'type':Sequelize[_0xf551('0x4')]},'endtime':{'type':Sequelize[_0xf551('0x4')]},'lastevent':{'type':Sequelize['STRING'],'comment':_0xf551('0x5')},'routeId':{'type':Sequelize[_0xf551('0x3')]},'duration':{'type':Sequelize['INTEGER']},'holdtime':{'type':Sequelize[_0xf551('0x3')]},'billableseconds':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.controller.js b/server/api/voiceDialReport/voiceDialReport.controller.js index b05b622..b68cef2 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 _0x568e=['includeAll','rows','catch','show','params','include','create','body','update','find','describe','html-pdf','eml-format','rimraf','fast-json-patch','moment','path','sox','ejs','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','VoiceDialReport','rawAttributes','model','query','keys','intersection','attributes','fields','length','nolimit','sort','where','filters','pick','merge','map','type','key','VIRTUAL','field','filter','options'];(function(_0x1bf3fc,_0x2ac036){var _0xa7ff3a=function(_0x138175){while(--_0x138175){_0x1bf3fc['push'](_0x1bf3fc['shift']());}};_0xa7ff3a(++_0x2ac036);}(_0x568e,0x1bb));var _0xe568=function(_0x13e741,_0x5d3c24){_0x13e741=_0x13e741-0x0;var _0x3f8bb3=_0x568e[_0x13e741];return _0x3f8bb3;};'use strict';var pdf=require(_0xe568('0x0'));var emlformat=require(_0xe568('0x1'));var rimraf=require(_0xe568('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe568('0x3'));var rp=require('request-promise');var moment=require(_0xe568('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xe568('0x5'));var sox=require(_0xe568('0x6'));var csv=require('to-csv');var ejs=require(_0xe568('0x7'));var fs=require('fs');var _=require(_0xe568('0x8'));var squel=require('squel');var crypto=require(_0xe568('0x9'));var jsforce=require(_0xe568('0xa'));var deskjs=require(_0xe568('0xb'));var toCsv=require('to-csv');var querystring=require(_0xe568('0xc'));var Papa=require('papaparse');var Redis=require(_0xe568('0xd'));var authService=require(_0xe568('0xe'));var qs=require(_0xe568('0xf'));var as=require(_0xe568('0x10'));var hardwareService=require(_0xe568('0x11'));var logger=require('../../config/logger')(_0xe568('0x12'));var utils=require(_0xe568('0x13'));var config=require(_0xe568('0x14'));var db=require(_0xe568('0x15'))['db'];function respondWithStatusCode(_0x4ad6b4,_0x22ac7b){_0x22ac7b=_0x22ac7b||0xcc;return function(_0x29cbb8){if(_0x29cbb8){return _0x4ad6b4[_0xe568('0x16')](_0x22ac7b);}return _0x4ad6b4[_0xe568('0x17')](_0x22ac7b)[_0xe568('0x18')]();};}function respondWithResult(_0x5199a4,_0x597070){_0x597070=_0x597070||0xc8;return function(_0x4c6a80){if(_0x4c6a80){return _0x5199a4[_0xe568('0x17')](_0x597070)[_0xe568('0x19')](_0x4c6a80);}};}function respondWithFilteredResult(_0x2a905d,_0x197095){return function(_0x1df609){if(_0x1df609){var _0x50e14d=_0x1df609[_0xe568('0x1a')],_0x55d8d6=_0x197095['offset'],_0x394a7e=_0x197095[_0xe568('0x1b')]+_0x197095[_0xe568('0x1c')],_0x1594d5;if(_0x394a7e>=_0x50e14d){_0x394a7e=_0x50e14d;_0x1594d5=0xc8;}else{_0x1594d5=0xce;}_0x2a905d[_0xe568('0x17')](_0x1594d5);return _0x2a905d[_0xe568('0x1d')](_0xe568('0x1e'),_0x55d8d6+'-'+_0x394a7e+'/'+_0x50e14d)[_0xe568('0x19')](_0x1df609);}return null;};}function patchUpdates(_0x38649b){return function(_0x535aeb){try{jsonpatch[_0xe568('0x1f')](_0x535aeb,_0x38649b,!![]);}catch(_0x45c2b6){return BPromise[_0xe568('0x20')](_0x45c2b6);}return _0x535aeb[_0xe568('0x21')]();};}function saveUpdates(_0x4e66e8,_0x58e191){return function(_0x13cdab){if(_0x13cdab){return _0x13cdab['update'](_0x4e66e8)[_0xe568('0x22')](function(_0x5b71ca){return _0x5b71ca;});}return null;};}function removeEntity(_0x565d6c,_0x1f6c95){return function(_0x5b5bef){if(_0x5b5bef){return _0x5b5bef[_0xe568('0x23')]()[_0xe568('0x22')](function(){_0x565d6c[_0xe568('0x17')](0xcc)[_0xe568('0x18')]();});}};}function handleEntityNotFound(_0x843193,_0x38bc0f){return function(_0xf4479f){if(!_0xf4479f){_0x843193[_0xe568('0x16')](0x194);}return _0xf4479f;};}function handleError(_0x411c24,_0x573123){_0x573123=_0x573123||0x1f4;return function(_0x20cb69){logger[_0xe568('0x24')](_0x20cb69[_0xe568('0x25')]);if(_0x20cb69['name']){delete _0x20cb69[_0xe568('0x26')];}_0x411c24[_0xe568('0x17')](_0x573123)['send'](_0x20cb69);};}exports['index']=function(_0x55af53,_0x58ff28){var _0x2f222f={},_0x2e1bf2={},_0x3f54ec={'count':0x0,'rows':[]};var _0x27f88b=db[_0xe568('0x27')][_0xe568('0x28')];_0x2e1bf2[_0xe568('0x29')]=_['keys'](_0x27f88b);_0x2e1bf2[_0xe568('0x2a')]=_[_0xe568('0x2b')](_0x55af53[_0xe568('0x2a')]);_0x2e1bf2['filters']=_[_0xe568('0x2c')](_0x2e1bf2[_0xe568('0x29')],_0x2e1bf2[_0xe568('0x2a')]);_0x2f222f[_0xe568('0x2d')]=_[_0xe568('0x2c')](_0x2e1bf2[_0xe568('0x29')],qs[_0xe568('0x2e')](_0x55af53[_0xe568('0x2a')][_0xe568('0x2e')]));_0x2f222f['attributes']=_0x2f222f[_0xe568('0x2d')][_0xe568('0x2f')]?_0x2f222f[_0xe568('0x2d')]:_0x2e1bf2[_0xe568('0x29')];if(!_0x55af53[_0xe568('0x2a')]['hasOwnProperty'](_0xe568('0x30'))){_0x2f222f[_0xe568('0x1c')]=qs['limit'](_0x55af53[_0xe568('0x2a')]['limit']);_0x2f222f[_0xe568('0x1b')]=qs[_0xe568('0x1b')](_0x55af53[_0xe568('0x2a')][_0xe568('0x1b')]);}_0x2f222f['order']=qs['sort'](_0x55af53['query'][_0xe568('0x31')]);_0x2f222f[_0xe568('0x32')]=qs[_0xe568('0x33')](_[_0xe568('0x34')](_0x55af53['query'],_0x2e1bf2[_0xe568('0x33')]));if(_0x55af53[_0xe568('0x2a')]['filter']){_0x2f222f[_0xe568('0x32')]=_[_0xe568('0x35')](_0x2f222f[_0xe568('0x32')],{'$or':_[_0xe568('0x36')](_0x27f88b,function(_0xf91bdd){if(_0xf91bdd[_0xe568('0x37')][_0xe568('0x38')]!==_0xe568('0x39')){var _0x391f9c={};_0x391f9c[_0xf91bdd[_0xe568('0x3a')]]={'$like':'%'+_0x55af53[_0xe568('0x2a')][_0xe568('0x3b')]+'%'};return _0x391f9c;}})});}_0x2f222f=_[_0xe568('0x35')]({},_0x2f222f,_0x55af53[_0xe568('0x3c')]);var _0x24e400={'where':_0x2f222f['where']};return db[_0xe568('0x27')]['count'](_0x24e400)[_0xe568('0x22')](function(_0x2c8b29){_0x3f54ec[_0xe568('0x1a')]=_0x2c8b29;if(_0x55af53[_0xe568('0x2a')][_0xe568('0x3d')]){_0x2f222f['include']=[{'all':!![]}];}return db[_0xe568('0x27')]['findAll'](_0x2f222f);})[_0xe568('0x22')](function(_0x1241df){_0x3f54ec[_0xe568('0x3e')]=_0x1241df;return _0x3f54ec;})[_0xe568('0x22')](respondWithFilteredResult(_0x58ff28,_0x2f222f))[_0xe568('0x3f')](handleError(_0x58ff28,null));};exports[_0xe568('0x40')]=function(_0x38c821,_0x3ece0e){var _0x10c9db={'raw':!![],'where':{'id':_0x38c821[_0xe568('0x41')]['id']}},_0x27e7ad={};_0x27e7ad[_0xe568('0x29')]=_['keys'](db[_0xe568('0x27')][_0xe568('0x28')]);_0x27e7ad[_0xe568('0x2a')]=_['keys'](_0x38c821['query']);_0x27e7ad[_0xe568('0x33')]=_[_0xe568('0x2c')](_0x27e7ad[_0xe568('0x29')],_0x27e7ad[_0xe568('0x2a')]);_0x10c9db['attributes']=_['intersection'](_0x27e7ad[_0xe568('0x29')],qs[_0xe568('0x2e')](_0x38c821[_0xe568('0x2a')][_0xe568('0x2e')]));_0x10c9db[_0xe568('0x2d')]=_0x10c9db['attributes'][_0xe568('0x2f')]?_0x10c9db['attributes']:_0x27e7ad[_0xe568('0x29')];if(_0x38c821[_0xe568('0x2a')][_0xe568('0x3d')]){_0x10c9db[_0xe568('0x42')]=[{'all':!![]}];}_0x10c9db=_[_0xe568('0x35')]({},_0x10c9db,_0x38c821[_0xe568('0x3c')]);return db[_0xe568('0x27')]['find'](_0x10c9db)['then'](handleEntityNotFound(_0x3ece0e,null))[_0xe568('0x22')](respondWithResult(_0x3ece0e,null))[_0xe568('0x3f')](handleError(_0x3ece0e,null));};exports[_0xe568('0x43')]=function(_0x1e9c96,_0x12b58f){return db[_0xe568('0x27')]['create'](_0x1e9c96[_0xe568('0x44')],{})['then'](respondWithResult(_0x12b58f,0xc9))[_0xe568('0x3f')](handleError(_0x12b58f,null));};exports[_0xe568('0x45')]=function(_0x2a028c,_0x250452){if(_0x2a028c[_0xe568('0x44')]['id']){delete _0x2a028c[_0xe568('0x44')]['id'];}return db[_0xe568('0x27')]['find']({'where':{'id':_0x2a028c[_0xe568('0x41')]['id']}})[_0xe568('0x22')](handleEntityNotFound(_0x250452,null))[_0xe568('0x22')](saveUpdates(_0x2a028c['body'],null))[_0xe568('0x22')](respondWithResult(_0x250452,null))[_0xe568('0x3f')](handleError(_0x250452,null));};exports[_0xe568('0x23')]=function(_0x2053f0,_0x25c4fb){return db['VoiceDialReport'][_0xe568('0x46')]({'where':{'id':_0x2053f0[_0xe568('0x41')]['id']}})[_0xe568('0x22')](handleEntityNotFound(_0x25c4fb,null))[_0xe568('0x22')](removeEntity(_0x25c4fb,null))[_0xe568('0x3f')](handleError(_0x25c4fb,null));};exports['describe']=function(_0x19ec25,_0x1f4149){return db[_0xe568('0x27')][_0xe568('0x47')]()['then'](respondWithResult(_0x1f4149,null))['catch'](handleError(_0x1f4149,null));}; \ No newline at end of file +var _0x2116=['apply','save','update','then','error','stack','name','send','index','VoiceDialReport','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','order','sort','where','pick','merge','map','key','VIRTUAL','field','filter','options','include','findAll','catch','show','params','find','create','body','destroy','rimraf','moment','bluebird','mustache','util','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','sendStatus','status','end','count','offset','limit','set','Content-Range'];(function(_0x5e4563,_0x3ff918){var _0x8d1bf5=function(_0x3bf7a9){while(--_0x3bf7a9){_0x5e4563['push'](_0x5e4563['shift']());}};_0x8d1bf5(++_0x3ff918);}(_0x2116,0x6a));var _0x6211=function(_0x575111,_0x33ef62){_0x575111=_0x575111-0x0;var _0x280fcf=_0x2116[_0x575111];return _0x280fcf;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x6211('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x6211('0x1'));var BPromise=require(_0x6211('0x2'));var Mustache=require(_0x6211('0x3'));var util=require(_0x6211('0x4'));var path=require('path');var sox=require(_0x6211('0x5'));var csv=require(_0x6211('0x6'));var ejs=require(_0x6211('0x7'));var fs=require('fs');var _=require('lodash');var squel=require(_0x6211('0x8'));var crypto=require(_0x6211('0x9'));var jsforce=require(_0x6211('0xa'));var deskjs=require(_0x6211('0xb'));var toCsv=require(_0x6211('0x6'));var querystring=require(_0x6211('0xc'));var Papa=require(_0x6211('0xd'));var Redis=require(_0x6211('0xe'));var authService=require(_0x6211('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x6211('0x10'));var hardwareService=require(_0x6211('0x11'));var logger=require('../../config/logger')(_0x6211('0x12'));var utils=require(_0x6211('0x13'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x18b60d,_0x5049b7){_0x5049b7=_0x5049b7||0xcc;return function(_0x2176c7){if(_0x2176c7){return _0x18b60d[_0x6211('0x14')](_0x5049b7);}return _0x18b60d[_0x6211('0x15')](_0x5049b7)[_0x6211('0x16')]();};}function respondWithResult(_0x2a1579,_0x5b3514){_0x5b3514=_0x5b3514||0xc8;return function(_0x47df1f){if(_0x47df1f){return _0x2a1579['status'](_0x5b3514)['json'](_0x47df1f);}};}function respondWithFilteredResult(_0x561652,_0x2a37b1){return function(_0x328705){if(_0x328705){var _0x1f13ad=_0x328705[_0x6211('0x17')],_0x172a72=_0x2a37b1[_0x6211('0x18')],_0x5d9300=_0x2a37b1['offset']+_0x2a37b1[_0x6211('0x19')],_0x541ca9;if(_0x5d9300>=_0x1f13ad){_0x5d9300=_0x1f13ad;_0x541ca9=0xc8;}else{_0x541ca9=0xce;}_0x561652[_0x6211('0x15')](_0x541ca9);return _0x561652[_0x6211('0x1a')](_0x6211('0x1b'),_0x172a72+'-'+_0x5d9300+'/'+_0x1f13ad)['json'](_0x328705);}return null;};}function patchUpdates(_0x1e45f9){return function(_0x24957c){try{jsonpatch[_0x6211('0x1c')](_0x24957c,_0x1e45f9,!![]);}catch(_0x1afa71){return BPromise['reject'](_0x1afa71);}return _0x24957c[_0x6211('0x1d')]();};}function saveUpdates(_0x575d14,_0x2e539f){return function(_0x1cb882){if(_0x1cb882){return _0x1cb882[_0x6211('0x1e')](_0x575d14)[_0x6211('0x1f')](function(_0x417f91){return _0x417f91;});}return null;};}function removeEntity(_0x5f3b3b,_0x52cfa1){return function(_0x3d3052){if(_0x3d3052){return _0x3d3052['destroy']()['then'](function(){_0x5f3b3b[_0x6211('0x15')](0xcc)[_0x6211('0x16')]();});}};}function handleEntityNotFound(_0x59b976,_0x278308){return function(_0x10d432){if(!_0x10d432){_0x59b976[_0x6211('0x14')](0x194);}return _0x10d432;};}function handleError(_0x39a89f,_0x463057){_0x463057=_0x463057||0x1f4;return function(_0x350792){logger[_0x6211('0x20')](_0x350792[_0x6211('0x21')]);if(_0x350792[_0x6211('0x22')]){delete _0x350792[_0x6211('0x22')];}_0x39a89f[_0x6211('0x15')](_0x463057)[_0x6211('0x23')](_0x350792);};}exports[_0x6211('0x24')]=function(_0x570bac,_0x167c5d){var _0x254dca={},_0x569db7={},_0x4ceb71={'count':0x0,'rows':[]};var _0x57bd3f=db[_0x6211('0x25')][_0x6211('0x26')];_0x569db7[_0x6211('0x27')]=_[_0x6211('0x28')](_0x57bd3f);_0x569db7[_0x6211('0x29')]=_[_0x6211('0x28')](_0x570bac[_0x6211('0x29')]);_0x569db7[_0x6211('0x2a')]=_[_0x6211('0x2b')](_0x569db7[_0x6211('0x27')],_0x569db7[_0x6211('0x29')]);_0x254dca[_0x6211('0x2c')]=_[_0x6211('0x2b')](_0x569db7['model'],qs[_0x6211('0x2d')](_0x570bac[_0x6211('0x29')][_0x6211('0x2d')]));_0x254dca[_0x6211('0x2c')]=_0x254dca['attributes'][_0x6211('0x2e')]?_0x254dca[_0x6211('0x2c')]:_0x569db7[_0x6211('0x27')];if(!_0x570bac['query']['hasOwnProperty']('nolimit')){_0x254dca[_0x6211('0x19')]=qs[_0x6211('0x19')](_0x570bac[_0x6211('0x29')][_0x6211('0x19')]);_0x254dca[_0x6211('0x18')]=qs['offset'](_0x570bac['query'][_0x6211('0x18')]);}_0x254dca[_0x6211('0x2f')]=qs[_0x6211('0x30')](_0x570bac[_0x6211('0x29')][_0x6211('0x30')]);_0x254dca[_0x6211('0x31')]=qs[_0x6211('0x2a')](_[_0x6211('0x32')](_0x570bac[_0x6211('0x29')],_0x569db7['filters']));if(_0x570bac['query']['filter']){_0x254dca['where']=_[_0x6211('0x33')](_0x254dca[_0x6211('0x31')],{'$or':_[_0x6211('0x34')](_0x57bd3f,function(_0x33b6be){if(_0x33b6be['type'][_0x6211('0x35')]!==_0x6211('0x36')){var _0x595143={};_0x595143[_0x33b6be[_0x6211('0x37')]]={'$like':'%'+_0x570bac['query'][_0x6211('0x38')]+'%'};return _0x595143;}})});}_0x254dca=_[_0x6211('0x33')]({},_0x254dca,_0x570bac[_0x6211('0x39')]);var _0x1337fd={'where':_0x254dca[_0x6211('0x31')]};return db['VoiceDialReport'][_0x6211('0x17')](_0x1337fd)[_0x6211('0x1f')](function(_0xe85f68){_0x4ceb71[_0x6211('0x17')]=_0xe85f68;if(_0x570bac[_0x6211('0x29')]['includeAll']){_0x254dca[_0x6211('0x3a')]=[{'all':!![]}];}return db[_0x6211('0x25')][_0x6211('0x3b')](_0x254dca);})[_0x6211('0x1f')](function(_0x116a24){_0x4ceb71['rows']=_0x116a24;return _0x4ceb71;})[_0x6211('0x1f')](respondWithFilteredResult(_0x167c5d,_0x254dca))[_0x6211('0x3c')](handleError(_0x167c5d,null));};exports[_0x6211('0x3d')]=function(_0x40fbf3,_0x2afb9d){var _0x3c974d={'raw':!![],'where':{'id':_0x40fbf3[_0x6211('0x3e')]['id']}},_0x4c5655={};_0x4c5655[_0x6211('0x27')]=_['keys'](db['VoiceDialReport']['rawAttributes']);_0x4c5655[_0x6211('0x29')]=_[_0x6211('0x28')](_0x40fbf3[_0x6211('0x29')]);_0x4c5655[_0x6211('0x2a')]=_[_0x6211('0x2b')](_0x4c5655['model'],_0x4c5655[_0x6211('0x29')]);_0x3c974d['attributes']=_[_0x6211('0x2b')](_0x4c5655['model'],qs[_0x6211('0x2d')](_0x40fbf3[_0x6211('0x29')][_0x6211('0x2d')]));_0x3c974d[_0x6211('0x2c')]=_0x3c974d[_0x6211('0x2c')][_0x6211('0x2e')]?_0x3c974d[_0x6211('0x2c')]:_0x4c5655[_0x6211('0x27')];if(_0x40fbf3[_0x6211('0x29')]['includeAll']){_0x3c974d[_0x6211('0x3a')]=[{'all':!![]}];}_0x3c974d=_['merge']({},_0x3c974d,_0x40fbf3['options']);return db[_0x6211('0x25')][_0x6211('0x3f')](_0x3c974d)['then'](handleEntityNotFound(_0x2afb9d,null))['then'](respondWithResult(_0x2afb9d,null))['catch'](handleError(_0x2afb9d,null));};exports[_0x6211('0x40')]=function(_0x53a54c,_0x23f545){return db[_0x6211('0x25')][_0x6211('0x40')](_0x53a54c[_0x6211('0x41')],{})[_0x6211('0x1f')](respondWithResult(_0x23f545,0xc9))[_0x6211('0x3c')](handleError(_0x23f545,null));};exports[_0x6211('0x1e')]=function(_0x4b2790,_0x33a2ce){if(_0x4b2790[_0x6211('0x41')]['id']){delete _0x4b2790['body']['id'];}return db[_0x6211('0x25')][_0x6211('0x3f')]({'where':{'id':_0x4b2790[_0x6211('0x3e')]['id']}})['then'](handleEntityNotFound(_0x33a2ce,null))[_0x6211('0x1f')](saveUpdates(_0x4b2790[_0x6211('0x41')],null))[_0x6211('0x1f')](respondWithResult(_0x33a2ce,null))[_0x6211('0x3c')](handleError(_0x33a2ce,null));};exports[_0x6211('0x42')]=function(_0x6852d1,_0x417712){return db[_0x6211('0x25')][_0x6211('0x3f')]({'where':{'id':_0x6852d1[_0x6211('0x3e')]['id']}})[_0x6211('0x1f')](handleEntityNotFound(_0x417712,null))['then'](removeEntity(_0x417712,null))[_0x6211('0x3c')](handleError(_0x417712,null));};exports['describe']=function(_0x4cf1dc,_0x54bc76){return db[_0x6211('0x25')]['describe']()['then'](respondWithResult(_0x54bc76,null))[_0x6211('0x3c')](handleError(_0x54bc76,null));}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.model.js b/server/api/voiceDialReport/voiceDialReport.model.js index bf18aef..5de5979 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 _0x5e20=['moment','request-promise','rimraf','../../config/environment','./voiceDialReport.attributes','exports','define','VoiceDialReport','report_dial','uniqueid','lodash','util','../../config/logger','api'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0x5e20,0x15a));var _0x05e2=function(_0x23cc52,_0x25f16b){_0x23cc52=_0x23cc52-0x0;var _0x390f3e=_0x5e20[_0x23cc52];return _0x390f3e;};'use strict';var _=require(_0x05e2('0x0'));var util=require(_0x05e2('0x1'));var logger=require(_0x05e2('0x2'))(_0x05e2('0x3'));var moment=require(_0x05e2('0x4'));var BPromise=require('bluebird');var rp=require(_0x05e2('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x05e2('0x6'));var config=require(_0x05e2('0x7'));var attributes=require(_0x05e2('0x8'));module[_0x05e2('0x9')]=function(_0x1759a4,_0x5ec48c){return _0x1759a4[_0x05e2('0xa')](_0x05e2('0xb'),attributes,{'tableName':_0x05e2('0xc'),'paranoid':![],'indexes':[{'fields':[_0x05e2('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x3fc7=['./voiceDialReport.attributes','exports','define','report_dial','uniqueid','lodash','util','../../config/logger','moment','bluebird','request-promise','../../config/environment'];(function(_0x39125a,_0xddf20e){var _0x2dae54=function(_0x49594d){while(--_0x49594d){_0x39125a['push'](_0x39125a['shift']());}};_0x2dae54(++_0xddf20e);}(_0x3fc7,0x179));var _0x73fc=function(_0x2d9c6a,_0x59393d){_0x2d9c6a=_0x2d9c6a-0x0;var _0xf3c918=_0x3fc7[_0x2d9c6a];return _0xf3c918;};'use strict';var _=require(_0x73fc('0x0'));var util=require(_0x73fc('0x1'));var logger=require(_0x73fc('0x2'))('api');var moment=require(_0x73fc('0x3'));var BPromise=require(_0x73fc('0x4'));var rp=require(_0x73fc('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x73fc('0x6'));var attributes=require(_0x73fc('0x7'));module[_0x73fc('0x8')]=function(_0x38f66e,_0x2f26d4){return _0x38f66e[_0x73fc('0x9')]('VoiceDialReport',attributes,{'tableName':_0x73fc('0xa'),'paranoid':![],'indexes':[{'fields':[_0x73fc('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.rpc.js b/server/api/voiceDialReport/voiceDialReport.rpc.js index c77d786..7d980b9 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 _0xc39c=['util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info','VoiceDialReport,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','result','catch','CreateVoiceDialReport','create','body','options','raw','UpdateVoiceDialReport','where','attributes','limit'];(function(_0x1466c4,_0x1fad04){var _0x2f8d0e=function(_0x33ad84){while(--_0x33ad84){_0x1466c4['push'](_0x1466c4['shift']());}};_0x2f8d0e(++_0x1fad04);}(_0xc39c,0xd2));var _0xcc39=function(_0x30bb28,_0x21ccf5){_0x30bb28=_0x30bb28-0x0;var _0x107a0f=_0xc39c[_0x30bb28];return _0x107a0f;};'use strict';var _=require('lodash');var util=require(_0xcc39('0x0'));var moment=require(_0xcc39('0x1'));var BPromise=require(_0xcc39('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xcc39('0x3'));var db=require(_0xcc39('0x4'))['db'];var utils=require(_0xcc39('0x5'));var logger=require('../../config/logger')(_0xcc39('0x6'));var config=require(_0xcc39('0x7'));var jayson=require(_0xcc39('0x8'));var client=jayson[_0xcc39('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x32cf84,_0x45dd86,_0x12361a){return new BPromise(function(_0x46bb71,_0x2f8544){return client[_0xcc39('0xa')](_0x32cf84,_0x12361a)[_0xcc39('0xb')](function(_0xa8e3cb){logger[_0xcc39('0xc')](_0xcc39('0xd'),_0x45dd86,'request\x20sent');logger[_0xcc39('0xe')]('VoiceDialReport,\x20%s,\x20%s,\x20%s',_0x45dd86,_0xcc39('0xf'),JSON[_0xcc39('0x10')](_0xa8e3cb));if(_0xa8e3cb[_0xcc39('0x11')]){if(_0xa8e3cb[_0xcc39('0x11')]['code']===0x1f4){logger['error'](_0xcc39('0xd'),_0x45dd86,_0xa8e3cb[_0xcc39('0x11')]['message']);return _0x2f8544(_0xa8e3cb[_0xcc39('0x11')][_0xcc39('0x12')]);}logger[_0xcc39('0x11')](_0xcc39('0xd'),_0x45dd86,_0xa8e3cb[_0xcc39('0x11')][_0xcc39('0x12')]);return _0x46bb71(_0xa8e3cb['error']['message']);}else{logger[_0xcc39('0xc')](_0xcc39('0xd'),_0x45dd86,_0xcc39('0xf'));_0x46bb71(_0xa8e3cb[_0xcc39('0x13')][_0xcc39('0x12')]);}})[_0xcc39('0x14')](function(_0x59246b){logger[_0xcc39('0x11')](_0xcc39('0xd'),_0x45dd86,_0x59246b);_0x2f8544(_0x59246b);});});}exports[_0xcc39('0x15')]=function(_0x3f04f4){var _0x4ba92b=this;return new Promise(function(_0x4bd2ae,_0x20cbe1){return db['VoiceDialReport'][_0xcc39('0x16')](_0x3f04f4[_0xcc39('0x17')],{'raw':_0x3f04f4[_0xcc39('0x18')]?_0x3f04f4['options'][_0xcc39('0x19')]===undefined?!![]:![]:!![]})[_0xcc39('0xb')](function(_0x195ffd){logger['info'](_0xcc39('0x15'),_0x3f04f4);logger['debug'](_0xcc39('0x15'),_0x3f04f4,JSON[_0xcc39('0x10')](_0x195ffd));_0x4bd2ae(_0x195ffd);})['catch'](function(_0x1ade0d){logger[_0xcc39('0x11')](_0xcc39('0x15'),_0x1ade0d['message'],_0x3f04f4);_0x20cbe1(_0x4ba92b[_0xcc39('0x11')](0x1f4,_0x1ade0d[_0xcc39('0x12')]));});});};exports[_0xcc39('0x1a')]=function(_0x1ec9c6){var _0x9ce9f3=this;return new Promise(function(_0x548d54,_0x1170ab){return db['VoiceDialReport']['update'](_0x1ec9c6[_0xcc39('0x17')],{'raw':_0x1ec9c6[_0xcc39('0x18')]?_0x1ec9c6[_0xcc39('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1ec9c6[_0xcc39('0x18')]?_0x1ec9c6[_0xcc39('0x18')][_0xcc39('0x1b')]||null:null,'attributes':_0x1ec9c6[_0xcc39('0x18')]?_0x1ec9c6[_0xcc39('0x18')][_0xcc39('0x1c')]||null:null,'limit':_0x1ec9c6[_0xcc39('0x18')]?_0x1ec9c6[_0xcc39('0x18')][_0xcc39('0x1d')]||null:null})[_0xcc39('0xb')](function(_0x1dac9a){logger[_0xcc39('0xc')](_0xcc39('0x1a'),_0x1ec9c6);logger[_0xcc39('0xe')]('UpdateVoiceDialReport',_0x1ec9c6,JSON[_0xcc39('0x10')](_0x1dac9a));_0x548d54(_0x1dac9a);})['catch'](function(_0x4d57db){logger[_0xcc39('0x11')]('UpdateVoiceDialReport',_0x4d57db['message'],_0x1ec9c6);_0x1170ab(_0x9ce9f3['error'](0x1f4,_0x4d57db[_0xcc39('0x12')]));});});}; \ No newline at end of file +var _0x833b=['rpc','../../config/environment','jayson/promise','client','http','request','then','VoiceDialReport,\x20%s,\x20%s','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','catch','VoiceDialReport','create','options','raw','CreateVoiceDialReport','UpdateVoiceDialReport','body','where','attributes','info','util','bluebird','ioredis','../../config/utils','../../config/logger'];(function(_0x2ff252,_0x222a1b){var _0x327741=function(_0x250617){while(--_0x250617){_0x2ff252['push'](_0x2ff252['shift']());}};_0x327741(++_0x222a1b);}(_0x833b,0x131));var _0xb833=function(_0x36ed3c,_0x44a00a){_0x36ed3c=_0x36ed3c-0x0;var _0x52a2e0=_0x833b[_0x36ed3c];return _0x52a2e0;};'use strict';var _=require('lodash');var util=require(_0xb833('0x0'));var moment=require('moment');var BPromise=require(_0xb833('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb833('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xb833('0x3'));var logger=require(_0xb833('0x4'))(_0xb833('0x5'));var config=require(_0xb833('0x6'));var jayson=require(_0xb833('0x7'));var client=jayson[_0xb833('0x8')][_0xb833('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4eaff4,_0x3afa71,_0xb60891){return new BPromise(function(_0x3922f5,_0x2525aa){return client[_0xb833('0xa')](_0x4eaff4,_0xb60891)[_0xb833('0xb')](function(_0x26cbf6){logger['info'](_0xb833('0xc'),_0x3afa71,'request\x20sent');logger[_0xb833('0xd')](_0xb833('0xe'),_0x3afa71,_0xb833('0xf'),JSON[_0xb833('0x10')](_0x26cbf6));if(_0x26cbf6['error']){if(_0x26cbf6['error'][_0xb833('0x11')]===0x1f4){logger[_0xb833('0x12')]('VoiceDialReport,\x20%s,\x20%s',_0x3afa71,_0x26cbf6[_0xb833('0x12')]['message']);return _0x2525aa(_0x26cbf6[_0xb833('0x12')][_0xb833('0x13')]);}logger[_0xb833('0x12')](_0xb833('0xc'),_0x3afa71,_0x26cbf6[_0xb833('0x12')][_0xb833('0x13')]);return _0x3922f5(_0x26cbf6[_0xb833('0x12')][_0xb833('0x13')]);}else{logger['info'](_0xb833('0xc'),_0x3afa71,_0xb833('0xf'));_0x3922f5(_0x26cbf6['result']['message']);}})[_0xb833('0x14')](function(_0x59d65f){logger[_0xb833('0x12')](_0xb833('0xc'),_0x3afa71,_0x59d65f);_0x2525aa(_0x59d65f);});});}exports['CreateVoiceDialReport']=function(_0x36ce8f){var _0x174724=this;return new Promise(function(_0x5798e2,_0xa02eca){return db[_0xb833('0x15')][_0xb833('0x16')](_0x36ce8f['body'],{'raw':_0x36ce8f[_0xb833('0x17')]?_0x36ce8f[_0xb833('0x17')][_0xb833('0x18')]===undefined?!![]:![]:!![]})[_0xb833('0xb')](function(_0x4a4ac4){logger['info'](_0xb833('0x19'),_0x36ce8f);logger[_0xb833('0xd')](_0xb833('0x19'),_0x36ce8f,JSON[_0xb833('0x10')](_0x4a4ac4));_0x5798e2(_0x4a4ac4);})[_0xb833('0x14')](function(_0x166a79){logger['error'](_0xb833('0x19'),_0x166a79['message'],_0x36ce8f);_0xa02eca(_0x174724['error'](0x1f4,_0x166a79['message']));});});};exports[_0xb833('0x1a')]=function(_0x9e7cdb){var _0x2e11d0=this;return new Promise(function(_0x532661,_0x191349){return db[_0xb833('0x15')]['update'](_0x9e7cdb[_0xb833('0x1b')],{'raw':_0x9e7cdb[_0xb833('0x17')]?_0x9e7cdb['options'][_0xb833('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x9e7cdb['options']?_0x9e7cdb[_0xb833('0x17')][_0xb833('0x1c')]||null:null,'attributes':_0x9e7cdb[_0xb833('0x17')]?_0x9e7cdb['options'][_0xb833('0x1d')]||null:null,'limit':_0x9e7cdb[_0xb833('0x17')]?_0x9e7cdb[_0xb833('0x17')]['limit']||null:null})[_0xb833('0xb')](function(_0xbfaf92){logger[_0xb833('0x1e')]('UpdateVoiceDialReport',_0x9e7cdb);logger['debug'](_0xb833('0x1a'),_0x9e7cdb,JSON['stringify'](_0xbfaf92));_0x532661(_0xbfaf92);})[_0xb833('0x14')](function(_0x3854e7){logger[_0xb833('0x12')](_0xb833('0x1a'),_0x3854e7[_0xb833('0x13')],_0x9e7cdb);_0x191349(_0x2e11d0[_0xb833('0x12')](0x1f4,_0x3854e7['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/index.js b/server/api/voiceExtension/index.js index 38e8404..40768e3 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 _0x5e0d=['../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceExtension.controller','isAuthenticated','get','post','create','put','/:id','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x1f78c6,_0x41f3b2){var _0x2ed786=function(_0x481a71){while(--_0x481a71){_0x1f78c6['push'](_0x1f78c6['shift']());}};_0x2ed786(++_0x41f3b2);}(_0x5e0d,0x10c));var _0xd5e0=function(_0xe66cf2,_0x32ba5f){_0xe66cf2=_0xe66cf2-0x0;var _0x2d84e7=_0x5e0d[_0xe66cf2];return _0x2d84e7;};'use strict';var multer=require(_0xd5e0('0x0'));var util=require(_0xd5e0('0x1'));var path=require(_0xd5e0('0x2'));var timeout=require(_0xd5e0('0x3'));var express=require('express');var router=express['Router']();var auth=require(_0xd5e0('0x4'));var interaction=require(_0xd5e0('0x5'));var config=require(_0xd5e0('0x6'));var controller=require(_0xd5e0('0x7'));router['get']('/',auth[_0xd5e0('0x8')](),controller['index']);router[_0xd5e0('0x9')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0xd5e0('0xa')]('/',auth[_0xd5e0('0x8')](),controller[_0xd5e0('0xb')]);router[_0xd5e0('0xa')]('/:id/applications',auth[_0xd5e0('0x8')](),controller['addApplications']);router[_0xd5e0('0xc')](_0xd5e0('0xd'),auth['isAuthenticated'](),controller['update']);router[_0xd5e0('0xe')](_0xd5e0('0xd'),auth[_0xd5e0('0x8')](),controller[_0xd5e0('0xf')]);module[_0xd5e0('0x10')]=router; \ No newline at end of file +var _0xc58f=['addApplications','put','update','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceExtension.controller','get','isAuthenticated','/:id','show','post','create','/:id/applications'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xc58f,0xad));var _0xfc58=function(_0x1d06a5,_0x4fc577){_0x1d06a5=_0x1d06a5-0x0;var _0xbaab59=_0xc58f[_0x1d06a5];return _0xbaab59;};'use strict';var multer=require(_0xfc58('0x0'));var util=require(_0xfc58('0x1'));var path=require(_0xfc58('0x2'));var timeout=require('connect-timeout');var express=require(_0xfc58('0x3'));var router=express[_0xfc58('0x4')]();var auth=require(_0xfc58('0x5'));var interaction=require(_0xfc58('0x6'));var config=require(_0xfc58('0x7'));var controller=require(_0xfc58('0x8'));router[_0xfc58('0x9')]('/',auth[_0xfc58('0xa')](),controller['index']);router[_0xfc58('0x9')](_0xfc58('0xb'),auth[_0xfc58('0xa')](),controller[_0xfc58('0xc')]);router[_0xfc58('0xd')]('/',auth[_0xfc58('0xa')](),controller[_0xfc58('0xe')]);router[_0xfc58('0xd')](_0xfc58('0xf'),auth[_0xfc58('0xa')](),controller[_0xfc58('0x10')]);router[_0xfc58('0x11')](_0xfc58('0xb'),auth[_0xfc58('0xa')](),controller[_0xfc58('0x12')]);router['delete']('/:id',auth[_0xfc58('0xa')](),controller[_0xfc58('0x13')]);module[_0xfc58('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 6ec6606..9e8b691 100644 --- a/server/api/voiceExtension/voiceExtension.attributes.js +++ b/server/api/voiceExtension/voiceExtension.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['*,*,*,*','INTEGER','BOOLEAN','VIRTUAL','getDataValue','exten','sequelize','exports','STRING','compositeIndex','NoOp','inbound','outbound','internal','system'];(function(_0x47bc83,_0x2b4d6c){var _0x5d9841=function(_0x18c400){while(--_0x18c400){_0x47bc83['push'](_0x47bc83['shift']());}};_0x5d9841(++_0x2b4d6c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x220dbb,_0x99328d){_0x220dbb=_0x220dbb-0x0;var _0x2b77de=_0xa9e0[_0x220dbb];return _0x2b77de;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'context':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![],'unique':'compositeIndex','validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x0a9e('0x3')},'priority':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'1','unique':_0x0a9e('0x3')},'tag':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![],'defaultValue':_0x0a9e('0x4')},'appdata':{'type':Sequelize[_0x0a9e('0x2')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize['ENUM'](_0x0a9e('0x5'),_0x0a9e('0x6'),_0x0a9e('0x7'),'inbound-fax','outbound-fax',_0x0a9e('0x8'),'any'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![],'defaultValue':_0x0a9e('0x9')},'IntervalId':{'type':Sequelize[_0x0a9e('0xa')]},'isApp':{'type':Sequelize[_0x0a9e('0xb')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':null},'callerID':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':!![]},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'cutdigits':{'type':Sequelize['INTEGER']},'recordingFormat':{'type':Sequelize['STRING'],'defaultValue':'wav'},'answer':{'type':Sequelize[_0x0a9e('0xb')],'defaultValue':!![]},'name':{'type':Sequelize[_0x0a9e('0xc')],'get':function(_0xd5b662){return this[_0x0a9e('0xd')](_0x0a9e('0xe'));}}}; \ No newline at end of file +var _0xa9e0=['*,*,*,*','INTEGER','BOOLEAN','VIRTUAL','getDataValue','exten','sequelize','exports','STRING','compositeIndex','NoOp','inbound','outbound','internal','system'];(function(_0x22e5c0,_0x4fc930){var _0x4e1c2d=function(_0x3bcaf0){while(--_0x3bcaf0){_0x22e5c0['push'](_0x22e5c0['shift']());}};_0x4e1c2d(++_0x4fc930);}(_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')]={'context':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![],'unique':'compositeIndex','validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x0a9e('0x3')},'priority':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'1','unique':_0x0a9e('0x3')},'tag':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![],'defaultValue':_0x0a9e('0x4')},'appdata':{'type':Sequelize[_0x0a9e('0x2')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize['ENUM'](_0x0a9e('0x5'),_0x0a9e('0x6'),_0x0a9e('0x7'),'inbound-fax','outbound-fax',_0x0a9e('0x8'),'any'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![],'defaultValue':_0x0a9e('0x9')},'IntervalId':{'type':Sequelize[_0x0a9e('0xa')]},'isApp':{'type':Sequelize[_0x0a9e('0xb')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':null},'callerID':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':!![]},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'cutdigits':{'type':Sequelize['INTEGER']},'recordingFormat':{'type':Sequelize['STRING'],'defaultValue':'wav'},'answer':{'type':Sequelize[_0x0a9e('0xb')],'defaultValue':!![]},'name':{'type':Sequelize[_0x0a9e('0xc')],'get':function(_0xd5b662){return this[_0x0a9e('0xd')](_0x0a9e('0xe'));}}}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.controller.js b/server/api/voiceExtension/voiceExtension.controller.js index 07f9a3d..8fa2aa8 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 _0xafbc=['then','get','InboundRoutes','inbound','OutboundRoutes','outbound','InternalRoutes','filter','ignore','map','value','name','destroy','error','stack','send','index','keys','query','filters','attributes','intersection','model','fields','order','sort','where','pick','merge','type','VIRTUAL','field','options','VoiceExtension','count','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','startsWith','exten','concat','user','role','internal','UserProfileSection','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','description','recordingFormat','mandatoryDisposition','context','findOne','sequelize','VoiceExtensionId','bulkCreate','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','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','../../mysqldb','redis','localhost','socket.io-emitter','./voiceExtension.socket','register','sendStatus','status','offset','limit','Content-Range','json','apply','reject','update'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xafbc,0xa6));var _0xcafb=function(_0x5c14bc,_0x1a96da){_0x5c14bc=_0x5c14bc-0x0;var _0xd6f578=_0xafbc[_0x5c14bc];return _0xd6f578;};'use strict';var pdf=require(_0xcafb('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xcafb('0x1'));var zipdir=require(_0xcafb('0x2'));var jsonpatch=require(_0xcafb('0x3'));var rp=require(_0xcafb('0x4'));var moment=require(_0xcafb('0x5'));var BPromise=require(_0xcafb('0x6'));var Mustache=require(_0xcafb('0x7'));var util=require(_0xcafb('0x8'));var path=require(_0xcafb('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xcafb('0xa'));var fs=require('fs');var _=require(_0xcafb('0xb'));var squel=require('squel');var crypto=require(_0xcafb('0xc'));var jsforce=require(_0xcafb('0xd'));var deskjs=require(_0xcafb('0xe'));var toCsv=require('to-csv');var querystring=require(_0xcafb('0xf'));var Papa=require(_0xcafb('0x10'));var Redis=require(_0xcafb('0x11'));var authService=require(_0xcafb('0x12'));var qs=require(_0xcafb('0x13'));var as=require(_0xcafb('0x14'));var hardwareService=require(_0xcafb('0x15'));var logger=require(_0xcafb('0x16'))(_0xcafb('0x17'));var utils=require(_0xcafb('0x18'));var config=require('../../config/environment');var db=require(_0xcafb('0x19'))['db'];config[_0xcafb('0x1a')]=_['defaults'](config[_0xcafb('0x1a')],{'host':_0xcafb('0x1b'),'port':0x18eb});var socket=require(_0xcafb('0x1c'))(new Redis(config[_0xcafb('0x1a')]));require(_0xcafb('0x1d'))[_0xcafb('0x1e')](socket);function respondWithStatusCode(_0x57de5b,_0x247bf0){_0x247bf0=_0x247bf0||0xcc;return function(_0x25bcef){if(_0x25bcef){return _0x57de5b[_0xcafb('0x1f')](_0x247bf0);}return _0x57de5b[_0xcafb('0x20')](_0x247bf0)['end']();};}function respondWithResult(_0x389b30,_0xbdc9b2){_0xbdc9b2=_0xbdc9b2||0xc8;return function(_0x57a300){if(_0x57a300){return _0x389b30[_0xcafb('0x20')](_0xbdc9b2)['json'](_0x57a300);}};}function respondWithFilteredResult(_0x19abf7,_0xbc0daf){return function(_0x2311b1){if(_0x2311b1){var _0x27e061=_0x2311b1['count'],_0x1e53b6=_0xbc0daf[_0xcafb('0x21')],_0x5a0289=_0xbc0daf['offset']+_0xbc0daf[_0xcafb('0x22')],_0x3c570e;if(_0x5a0289>=_0x27e061){_0x5a0289=_0x27e061;_0x3c570e=0xc8;}else{_0x3c570e=0xce;}_0x19abf7['status'](_0x3c570e);return _0x19abf7['set'](_0xcafb('0x23'),_0x1e53b6+'-'+_0x5a0289+'/'+_0x27e061)[_0xcafb('0x24')](_0x2311b1);}return null;};}function patchUpdates(_0x534541){return function(_0x32623a){try{jsonpatch[_0xcafb('0x25')](_0x32623a,_0x534541,!![]);}catch(_0x16634f){return BPromise[_0xcafb('0x26')](_0x16634f);}return _0x32623a['save']();};}function saveUpdates(_0x470510,_0x61ac61){return function(_0x304b2b){if(_0x304b2b){return _0x304b2b[_0xcafb('0x27')](_0x470510)[_0xcafb('0x28')](function(_0xfd8f2){return _0xfd8f2;});}return null;};}function removeEntity(_0x1228bc,_0x5424d9){return function(_0x27f7a2){if(_0x27f7a2){return _0x27f7a2['destroy']()[_0xcafb('0x28')](function(){var _0x3c0eac=_0x27f7a2[_0xcafb('0x29')]({'plain':!![]});var _0x2ec3f3=[{'name':_0xcafb('0x2a'),'value':_0xcafb('0x2b'),'ignore':![]},{'name':_0xcafb('0x2c'),'value':_0xcafb('0x2d'),'ignore':![]},{'name':_0xcafb('0x2e'),'value':'internal','ignore':![]}];var _0x2b76be=_(_0x2ec3f3)[_0xcafb('0x2f')](_0xcafb('0x30'))[_0xcafb('0x31')](_0xcafb('0x32'))['value']();if(_['includes'](_0x2b76be,_0x3c0eac['type'])){return;}var _0x4978e7=_['find'](_0x2ec3f3,[_0xcafb('0x32'),_0x3c0eac['type']])[_0xcafb('0x33')];return db['UserProfileResource'][_0xcafb('0x34')]({'where':{'type':_0x4978e7,'resourceId':_0x3c0eac['id']}})[_0xcafb('0x28')](function(){return _0x27f7a2;});})[_0xcafb('0x28')](function(){_0x1228bc['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5702b4,_0x4db4b3){return function(_0x89d0c1){if(!_0x89d0c1){_0x5702b4[_0xcafb('0x1f')](0x194);}return _0x89d0c1;};}function handleError(_0x1350fd,_0x58ad56){_0x58ad56=_0x58ad56||0x1f4;return function(_0x551b42){logger[_0xcafb('0x35')](_0x551b42[_0xcafb('0x36')]);if(_0x551b42[_0xcafb('0x33')]){delete _0x551b42[_0xcafb('0x33')];}_0x1350fd[_0xcafb('0x20')](_0x58ad56)[_0xcafb('0x37')](_0x551b42);};}exports[_0xcafb('0x38')]=function(_0x3bb30f,_0xff7a31){var _0x528efe={},_0x30ba5b={},_0x200a1c={'count':0x0,'rows':[]};var _0x29cce5=db['VoiceExtension']['rawAttributes'];_0x30ba5b['model']=_[_0xcafb('0x39')](_0x29cce5);_0x30ba5b[_0xcafb('0x3a')]=_['keys'](_0x3bb30f[_0xcafb('0x3a')]);_0x30ba5b[_0xcafb('0x3b')]=_['intersection'](_0x30ba5b['model'],_0x30ba5b['query']);_0x528efe[_0xcafb('0x3c')]=_[_0xcafb('0x3d')](_0x30ba5b[_0xcafb('0x3e')],qs[_0xcafb('0x3f')](_0x3bb30f[_0xcafb('0x3a')][_0xcafb('0x3f')]));_0x528efe[_0xcafb('0x3c')]=_0x528efe['attributes']['length']?_0x528efe[_0xcafb('0x3c')]:_0x30ba5b[_0xcafb('0x3e')];if(!_0x3bb30f['query']['hasOwnProperty']('nolimit')){_0x528efe[_0xcafb('0x22')]=qs[_0xcafb('0x22')](_0x3bb30f[_0xcafb('0x3a')][_0xcafb('0x22')]);_0x528efe[_0xcafb('0x21')]=qs[_0xcafb('0x21')](_0x3bb30f[_0xcafb('0x3a')]['offset']);}_0x528efe[_0xcafb('0x40')]=qs['sort'](_0x3bb30f[_0xcafb('0x3a')][_0xcafb('0x41')]);_0x528efe[_0xcafb('0x42')]=qs[_0xcafb('0x3b')](_[_0xcafb('0x43')](_0x3bb30f['query'],_0x30ba5b[_0xcafb('0x3b')]));if(_0x3bb30f['query'][_0xcafb('0x2f')]){_0x528efe[_0xcafb('0x42')]=_[_0xcafb('0x44')](_0x528efe[_0xcafb('0x42')],{'$or':_[_0xcafb('0x31')](_0x29cce5,function(_0x341ba4){if(_0x341ba4[_0xcafb('0x45')]['key']!==_0xcafb('0x46')){var _0x69ff6c={};_0x69ff6c[_0x341ba4[_0xcafb('0x47')]]={'$like':'%'+_0x3bb30f[_0xcafb('0x3a')]['filter']+'%'};return _0x69ff6c;}})});}_0x528efe=_[_0xcafb('0x44')]({},_0x528efe,_0x3bb30f[_0xcafb('0x48')]);var _0xd994cf={'where':_0x528efe[_0xcafb('0x42')]};return db[_0xcafb('0x49')]['count'](_0xd994cf)['then'](function(_0x4e0e44){_0x200a1c[_0xcafb('0x4a')]=_0x4e0e44;if(_0x3bb30f[_0xcafb('0x3a')][_0xcafb('0x4b')]){_0x528efe[_0xcafb('0x4c')]=[{'all':!![]}];}return db[_0xcafb('0x49')][_0xcafb('0x4d')](_0x528efe);})[_0xcafb('0x28')](function(_0x52109a){_0x200a1c[_0xcafb('0x4e')]=_0x52109a;return _0x200a1c;})[_0xcafb('0x28')](respondWithFilteredResult(_0xff7a31,_0x528efe))[_0xcafb('0x4f')](handleError(_0xff7a31,null));};exports[_0xcafb('0x50')]=function(_0x1b952d,_0x2150d7){var _0x4ca4a3={'raw':![],'where':{'id':_0x1b952d[_0xcafb('0x51')]['id']}},_0x45a0f6={};_0x45a0f6['model']=_[_0xcafb('0x39')](db[_0xcafb('0x49')]['rawAttributes']);_0x45a0f6[_0xcafb('0x3a')]=_['keys'](_0x1b952d[_0xcafb('0x3a')]);_0x45a0f6[_0xcafb('0x3b')]=_['intersection'](_0x45a0f6['model'],_0x45a0f6[_0xcafb('0x3a')]);_0x4ca4a3[_0xcafb('0x3c')]=_[_0xcafb('0x3d')](_0x45a0f6[_0xcafb('0x3e')],qs[_0xcafb('0x3f')](_0x1b952d[_0xcafb('0x3a')]['fields']));_0x4ca4a3[_0xcafb('0x3c')]=_0x4ca4a3[_0xcafb('0x3c')][_0xcafb('0x52')]?_0x4ca4a3[_0xcafb('0x3c')]:_0x45a0f6['model'];if(_0x1b952d[_0xcafb('0x3a')]['includeAll']){_0x4ca4a3['include']=[{'all':!![]}];}_0x4ca4a3=_[_0xcafb('0x44')]({},_0x4ca4a3,_0x1b952d[_0xcafb('0x48')]);return db[_0xcafb('0x49')]['find'](_0x4ca4a3)[_0xcafb('0x28')](handleEntityNotFound(_0x2150d7,null))[_0xcafb('0x28')](respondWithResult(_0x2150d7,null))[_0xcafb('0x4f')](handleError(_0x2150d7,null));};exports['destroy']=function(_0x26084b,_0x27b32b){return db[_0xcafb('0x49')][_0xcafb('0x53')]({'where':{'id':_0x26084b[_0xcafb('0x51')]['id']}})[_0xcafb('0x28')](handleEntityNotFound(_0x27b32b,null))[_0xcafb('0x28')](removeEntity(_0x27b32b,null))[_0xcafb('0x4f')](handleError(_0x27b32b,null));};exports[_0xcafb('0x54')]=function(_0xc0ad6d,_0x4239a2){if(_0xc0ad6d[_0xcafb('0x55')][_0xcafb('0x45')]===_0xcafb('0x2d')&&!_[_0xcafb('0x56')](_0xc0ad6d[_0xcafb('0x55')][_0xcafb('0x57')],'_')){_0xc0ad6d[_0xcafb('0x55')][_0xcafb('0x57')]='_'[_0xcafb('0x58')](_0xc0ad6d[_0xcafb('0x55')][_0xcafb('0x57')]);}return db['VoiceExtension'][_0xcafb('0x54')](_0xc0ad6d[_0xcafb('0x55')],{'raw':![]})[_0xcafb('0x28')](function(_0x3d6956){var _0x499db4=_0xc0ad6d[_0xcafb('0x59')][_0xcafb('0x29')]({'plain':!![]});if(!_0x499db4)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x499db4[_0xcafb('0x5a')]===_0xcafb('0x59')){var _0x2fc493=_0x3d6956['get']({'plain':!![]});var _0x8465ee=[{'name':'InboundRoutes','value':_0xcafb('0x2b')},{'name':_0xcafb('0x2c'),'value':_0xcafb('0x2d')},{'name':_0xcafb('0x2e'),'value':_0xcafb('0x5b')}];var _0x4866a0=_[_0xcafb('0x53')](_0x8465ee,[_0xcafb('0x32'),_0x2fc493[_0xcafb('0x45')]])[_0xcafb('0x33')];return db[_0xcafb('0x5c')][_0xcafb('0x53')]({'where':{'name':_0x4866a0,'userProfileId':_0x499db4['userProfileId']},'raw':!![]})['then'](function(_0x648062){if(_0x648062&&_0x648062['autoAssociation']===0x0){return db[_0xcafb('0x5d')][_0xcafb('0x54')]({'name':_0x2fc493[_0xcafb('0x33')],'resourceId':_0x2fc493['id'],'type':_0x648062[_0xcafb('0x33')],'sectionId':_0x648062['id']},{})[_0xcafb('0x28')](function(){return _0x3d6956;});}else{return _0x3d6956;}})['catch'](function(_0x109f57){logger['error'](_0xcafb('0x5e'),_0x109f57);throw _0x109f57;});}return _0x3d6956;})[_0xcafb('0x28')](respondWithResult(_0x4239a2,0xc9))[_0xcafb('0x4f')](handleError(_0x4239a2,null));};exports[_0xcafb('0x27')]=function(_0x5b3c02,_0x50e08){if(_0x5b3c02['body']['id']){delete _0x5b3c02[_0xcafb('0x55')]['id'];}return db['VoiceExtension'][_0xcafb('0x53')]({'where':{'id':_0x5b3c02[_0xcafb('0x51')]['id']}})[_0xcafb('0x28')](handleEntityNotFound(_0x50e08,null))[_0xcafb('0x28')](function(_0x4041f4){if(_0x4041f4){return db['VoiceExtension'][_0xcafb('0x27')](_[_0xcafb('0x43')](_0x5b3c02[_0xcafb('0x55')],[_0xcafb('0x57'),'context',_0xcafb('0x5f'),_0xcafb('0x60'),'cutdigits',_0xcafb('0x61')]),{'where':{'context':_0x4041f4[_0xcafb('0x62')],'exten':_0x4041f4['exten']},'individualHooks':!![]})[_0xcafb('0x28')](function(_0x16f254){return _0x16f254;});}return null;})['then'](respondWithStatusCode(_0x50e08,null))[_0xcafb('0x4f')](handleError(_0x50e08,null));};exports['addApplications']=function(_0x29a267,_0x4a499b,_0x683e95){return db[_0xcafb('0x49')][_0xcafb('0x63')]({'where':{'id':_0x29a267['params']['id']}})['then'](handleEntityNotFound(_0x4a499b,null))[_0xcafb('0x28')](function(_0x1feb37){if(_0x1feb37){return db[_0xcafb('0x64')]['transaction'](function(_0x53e617){return db[_0xcafb('0x49')][_0xcafb('0x34')]({'where':{'VoiceExtensionId':_0x29a267[_0xcafb('0x51')]['id']},'transaction':_0x53e617})[_0xcafb('0x28')](function(_0x5918f5){var _0xcbe90=_[_0xcafb('0x31')](_0x29a267[_0xcafb('0x55')],function(_0x4db584){_0x4db584[_0xcafb('0x65')]=_0x29a267[_0xcafb('0x51')]['id'];return _0x4db584;});return db['VoiceExtension'][_0xcafb('0x66')](_0xcbe90,{'transaction':_0x53e617});});})[_0xcafb('0x28')](function(){return db[_0xcafb('0x49')]['findAndCountAll']({'where':{'isApp':!![],'VoiceExtensionId':_0x29a267[_0xcafb('0x51')]['id']},'order':'cast(priority\x20as\x20unsigned)'});});}})[_0xcafb('0x28')](respondWithResult(_0x4a499b,null))[_0xcafb('0x4f')](handleError(_0x4a499b,null));}; \ No newline at end of file +var _0x7865=['outbound','exten','concat','user','get','role','userProfileId','autoAssociation','context','description','recordingFormat','cutdigits','mandatoryDisposition','addApplications','findOne','params','VoiceExtensionId','bulkCreate','findAndCountAll','cast(priority\x20as\x20unsigned)','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','socket.io-emitter','./voiceExtension.socket','register','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','save','update','destroy','then','InboundRoutes','inbound','OutboundRoutes','InternalRoutes','internal','map','value','includes','type','find','UserProfileResource','error','name','send','index','VoiceExtension','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','key','VIRTUAL','field','count','includeAll','rows','catch','show','include','options','create','body'];(function(_0x31ce1b,_0x5eb0e3){var _0x1c9ac1=function(_0xa0ede6){while(--_0xa0ede6){_0x31ce1b['push'](_0x31ce1b['shift']());}};_0x1c9ac1(++_0x5eb0e3);}(_0x7865,0xe0));var _0x5786=function(_0x13f7e0,_0x2bdabd){_0x13f7e0=_0x13f7e0-0x0;var _0x52359a=_0x7865[_0x13f7e0];return _0x52359a;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x5786('0x0'));var jsonpatch=require(_0x5786('0x1'));var rp=require(_0x5786('0x2'));var moment=require(_0x5786('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x5786('0x4'));var util=require(_0x5786('0x5'));var path=require(_0x5786('0x6'));var sox=require(_0x5786('0x7'));var csv=require(_0x5786('0x8'));var ejs=require(_0x5786('0x9'));var fs=require('fs');var _=require(_0x5786('0xa'));var squel=require(_0x5786('0xb'));var crypto=require('crypto');var jsforce=require(_0x5786('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x5786('0xd'));var Papa=require(_0x5786('0xe'));var Redis=require(_0x5786('0xf'));var authService=require(_0x5786('0x10'));var qs=require(_0x5786('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5786('0x12'));var logger=require(_0x5786('0x13'))(_0x5786('0x14'));var utils=require(_0x5786('0x15'));var config=require('../../config/environment');var db=require(_0x5786('0x16'))['db'];config[_0x5786('0x17')]=_['defaults'](config[_0x5786('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0x5786('0x18'))(new Redis(config[_0x5786('0x17')]));require(_0x5786('0x19'))[_0x5786('0x1a')](socket);function respondWithStatusCode(_0x4b1de5,_0x3b9c24){_0x3b9c24=_0x3b9c24||0xcc;return function(_0x57d2b1){if(_0x57d2b1){return _0x4b1de5[_0x5786('0x1b')](_0x3b9c24);}return _0x4b1de5[_0x5786('0x1c')](_0x3b9c24)[_0x5786('0x1d')]();};}function respondWithResult(_0x218048,_0x12d80b){_0x12d80b=_0x12d80b||0xc8;return function(_0x3455d2){if(_0x3455d2){return _0x218048[_0x5786('0x1c')](_0x12d80b)[_0x5786('0x1e')](_0x3455d2);}};}function respondWithFilteredResult(_0x5d430e,_0x381634){return function(_0x111c25){if(_0x111c25){var _0x172ff2=_0x111c25['count'],_0x16a3b0=_0x381634['offset'],_0x300a96=_0x381634[_0x5786('0x1f')]+_0x381634[_0x5786('0x20')],_0x254d1b;if(_0x300a96>=_0x172ff2){_0x300a96=_0x172ff2;_0x254d1b=0xc8;}else{_0x254d1b=0xce;}_0x5d430e['status'](_0x254d1b);return _0x5d430e[_0x5786('0x21')](_0x5786('0x22'),_0x16a3b0+'-'+_0x300a96+'/'+_0x172ff2)[_0x5786('0x1e')](_0x111c25);}return null;};}function patchUpdates(_0x36835c){return function(_0x576704){try{jsonpatch[_0x5786('0x23')](_0x576704,_0x36835c,!![]);}catch(_0x5a4a68){return BPromise['reject'](_0x5a4a68);}return _0x576704[_0x5786('0x24')]();};}function saveUpdates(_0x561f79,_0x49a9e0){return function(_0x40a9df){if(_0x40a9df){return _0x40a9df[_0x5786('0x25')](_0x561f79)['then'](function(_0x1255b2){return _0x1255b2;});}return null;};}function removeEntity(_0xdb13b7,_0x2b7c46){return function(_0x22ef42){if(_0x22ef42){return _0x22ef42[_0x5786('0x26')]()[_0x5786('0x27')](function(){var _0x5a67a3=_0x22ef42['get']({'plain':!![]});var _0x102ab5=[{'name':_0x5786('0x28'),'value':_0x5786('0x29'),'ignore':![]},{'name':_0x5786('0x2a'),'value':'outbound','ignore':![]},{'name':_0x5786('0x2b'),'value':_0x5786('0x2c'),'ignore':![]}];var _0x43ff73=_(_0x102ab5)['filter']('ignore')[_0x5786('0x2d')](_0x5786('0x2e'))[_0x5786('0x2e')]();if(_[_0x5786('0x2f')](_0x43ff73,_0x5a67a3[_0x5786('0x30')])){return;}var _0xb33efe=_[_0x5786('0x31')](_0x102ab5,[_0x5786('0x2e'),_0x5a67a3[_0x5786('0x30')]])['name'];return db[_0x5786('0x32')][_0x5786('0x26')]({'where':{'type':_0xb33efe,'resourceId':_0x5a67a3['id']}})[_0x5786('0x27')](function(){return _0x22ef42;});})['then'](function(){_0xdb13b7[_0x5786('0x1c')](0xcc)[_0x5786('0x1d')]();});}};}function handleEntityNotFound(_0x5a90f1,_0x36193c){return function(_0x2c138a){if(!_0x2c138a){_0x5a90f1[_0x5786('0x1b')](0x194);}return _0x2c138a;};}function handleError(_0x10d07a,_0x2cdd2c){_0x2cdd2c=_0x2cdd2c||0x1f4;return function(_0x5154d1){logger[_0x5786('0x33')](_0x5154d1['stack']);if(_0x5154d1[_0x5786('0x34')]){delete _0x5154d1[_0x5786('0x34')];}_0x10d07a[_0x5786('0x1c')](_0x2cdd2c)[_0x5786('0x35')](_0x5154d1);};}exports[_0x5786('0x36')]=function(_0x49fe3a,_0x38aa0f){var _0x4e77d4={},_0xf4908c={},_0x11a2ff={'count':0x0,'rows':[]};var _0x263e32=db[_0x5786('0x37')]['rawAttributes'];_0xf4908c[_0x5786('0x38')]=_[_0x5786('0x39')](_0x263e32);_0xf4908c[_0x5786('0x3a')]=_[_0x5786('0x39')](_0x49fe3a[_0x5786('0x3a')]);_0xf4908c[_0x5786('0x3b')]=_['intersection'](_0xf4908c[_0x5786('0x38')],_0xf4908c[_0x5786('0x3a')]);_0x4e77d4[_0x5786('0x3c')]=_[_0x5786('0x3d')](_0xf4908c[_0x5786('0x38')],qs[_0x5786('0x3e')](_0x49fe3a['query'][_0x5786('0x3e')]));_0x4e77d4['attributes']=_0x4e77d4[_0x5786('0x3c')][_0x5786('0x3f')]?_0x4e77d4[_0x5786('0x3c')]:_0xf4908c['model'];if(!_0x49fe3a[_0x5786('0x3a')][_0x5786('0x40')](_0x5786('0x41'))){_0x4e77d4['limit']=qs['limit'](_0x49fe3a[_0x5786('0x3a')][_0x5786('0x20')]);_0x4e77d4[_0x5786('0x1f')]=qs[_0x5786('0x1f')](_0x49fe3a[_0x5786('0x3a')][_0x5786('0x1f')]);}_0x4e77d4['order']=qs['sort'](_0x49fe3a[_0x5786('0x3a')][_0x5786('0x42')]);_0x4e77d4[_0x5786('0x43')]=qs[_0x5786('0x3b')](_['pick'](_0x49fe3a[_0x5786('0x3a')],_0xf4908c[_0x5786('0x3b')]));if(_0x49fe3a[_0x5786('0x3a')][_0x5786('0x44')]){_0x4e77d4[_0x5786('0x43')]=_[_0x5786('0x45')](_0x4e77d4[_0x5786('0x43')],{'$or':_[_0x5786('0x2d')](_0x263e32,function(_0x3ee96f){if(_0x3ee96f['type'][_0x5786('0x46')]!==_0x5786('0x47')){var _0xd498f9={};_0xd498f9[_0x3ee96f[_0x5786('0x48')]]={'$like':'%'+_0x49fe3a[_0x5786('0x3a')][_0x5786('0x44')]+'%'};return _0xd498f9;}})});}_0x4e77d4=_[_0x5786('0x45')]({},_0x4e77d4,_0x49fe3a['options']);var _0x36536a={'where':_0x4e77d4[_0x5786('0x43')]};return db['VoiceExtension'][_0x5786('0x49')](_0x36536a)[_0x5786('0x27')](function(_0x1e1d51){_0x11a2ff['count']=_0x1e1d51;if(_0x49fe3a['query'][_0x5786('0x4a')]){_0x4e77d4['include']=[{'all':!![]}];}return db['VoiceExtension']['findAll'](_0x4e77d4);})[_0x5786('0x27')](function(_0x389cee){_0x11a2ff[_0x5786('0x4b')]=_0x389cee;return _0x11a2ff;})[_0x5786('0x27')](respondWithFilteredResult(_0x38aa0f,_0x4e77d4))[_0x5786('0x4c')](handleError(_0x38aa0f,null));};exports[_0x5786('0x4d')]=function(_0x575f46,_0x28cc5a){var _0x32779a={'raw':![],'where':{'id':_0x575f46['params']['id']}},_0x3a82b6={};_0x3a82b6[_0x5786('0x38')]=_[_0x5786('0x39')](db[_0x5786('0x37')]['rawAttributes']);_0x3a82b6[_0x5786('0x3a')]=_[_0x5786('0x39')](_0x575f46[_0x5786('0x3a')]);_0x3a82b6[_0x5786('0x3b')]=_['intersection'](_0x3a82b6['model'],_0x3a82b6['query']);_0x32779a[_0x5786('0x3c')]=_['intersection'](_0x3a82b6[_0x5786('0x38')],qs[_0x5786('0x3e')](_0x575f46[_0x5786('0x3a')]['fields']));_0x32779a[_0x5786('0x3c')]=_0x32779a[_0x5786('0x3c')][_0x5786('0x3f')]?_0x32779a['attributes']:_0x3a82b6['model'];if(_0x575f46[_0x5786('0x3a')][_0x5786('0x4a')]){_0x32779a[_0x5786('0x4e')]=[{'all':!![]}];}_0x32779a=_[_0x5786('0x45')]({},_0x32779a,_0x575f46[_0x5786('0x4f')]);return db['VoiceExtension'][_0x5786('0x31')](_0x32779a)[_0x5786('0x27')](handleEntityNotFound(_0x28cc5a,null))[_0x5786('0x27')](respondWithResult(_0x28cc5a,null))[_0x5786('0x4c')](handleError(_0x28cc5a,null));};exports['destroy']=function(_0x2baa68,_0x222d50){return db[_0x5786('0x37')][_0x5786('0x31')]({'where':{'id':_0x2baa68['params']['id']}})['then'](handleEntityNotFound(_0x222d50,null))[_0x5786('0x27')](removeEntity(_0x222d50,null))['catch'](handleError(_0x222d50,null));};exports[_0x5786('0x50')]=function(_0x23075b,_0x1bb349){if(_0x23075b[_0x5786('0x51')][_0x5786('0x30')]===_0x5786('0x52')&&!_['startsWith'](_0x23075b[_0x5786('0x51')][_0x5786('0x53')],'_')){_0x23075b[_0x5786('0x51')][_0x5786('0x53')]='_'[_0x5786('0x54')](_0x23075b[_0x5786('0x51')][_0x5786('0x53')]);}return db[_0x5786('0x37')]['create'](_0x23075b[_0x5786('0x51')],{'raw':![]})['then'](function(_0x67340c){var _0x3ab951=_0x23075b[_0x5786('0x55')][_0x5786('0x56')]({'plain':!![]});if(!_0x3ab951)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3ab951[_0x5786('0x57')]===_0x5786('0x55')){var _0x33681e=_0x67340c[_0x5786('0x56')]({'plain':!![]});var _0x2bb9b3=[{'name':_0x5786('0x28'),'value':'inbound'},{'name':_0x5786('0x2a'),'value':_0x5786('0x52')},{'name':'InternalRoutes','value':_0x5786('0x2c')}];var _0x1a8b15=_[_0x5786('0x31')](_0x2bb9b3,[_0x5786('0x2e'),_0x33681e[_0x5786('0x30')]])['name'];return db['UserProfileSection'][_0x5786('0x31')]({'where':{'name':_0x1a8b15,'userProfileId':_0x3ab951[_0x5786('0x58')]},'raw':!![]})[_0x5786('0x27')](function(_0x4c68b2){if(_0x4c68b2&&_0x4c68b2[_0x5786('0x59')]===0x0){return db[_0x5786('0x32')][_0x5786('0x50')]({'name':_0x33681e[_0x5786('0x34')],'resourceId':_0x33681e['id'],'type':_0x4c68b2[_0x5786('0x34')],'sectionId':_0x4c68b2['id']},{})[_0x5786('0x27')](function(){return _0x67340c;});}else{return _0x67340c;}})['catch'](function(_0x24dc22){logger[_0x5786('0x33')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x24dc22);throw _0x24dc22;});}return _0x67340c;})[_0x5786('0x27')](respondWithResult(_0x1bb349,0xc9))['catch'](handleError(_0x1bb349,null));};exports[_0x5786('0x25')]=function(_0x531bbb,_0x2ad9c0){if(_0x531bbb['body']['id']){delete _0x531bbb[_0x5786('0x51')]['id'];}return db[_0x5786('0x37')][_0x5786('0x31')]({'where':{'id':_0x531bbb['params']['id']}})['then'](handleEntityNotFound(_0x2ad9c0,null))[_0x5786('0x27')](function(_0x25e35a){if(_0x25e35a){return db[_0x5786('0x37')]['update'](_['pick'](_0x531bbb[_0x5786('0x51')],['exten',_0x5786('0x5a'),_0x5786('0x5b'),_0x5786('0x5c'),_0x5786('0x5d'),_0x5786('0x5e')]),{'where':{'context':_0x25e35a[_0x5786('0x5a')],'exten':_0x25e35a[_0x5786('0x53')]},'individualHooks':!![]})[_0x5786('0x27')](function(_0x5af406){return _0x5af406;});}return null;})[_0x5786('0x27')](respondWithStatusCode(_0x2ad9c0,null))[_0x5786('0x4c')](handleError(_0x2ad9c0,null));};exports[_0x5786('0x5f')]=function(_0x41ec9c,_0x49d44c,_0x514637){return db[_0x5786('0x37')][_0x5786('0x60')]({'where':{'id':_0x41ec9c[_0x5786('0x61')]['id']}})['then'](handleEntityNotFound(_0x49d44c,null))[_0x5786('0x27')](function(_0x2fa167){if(_0x2fa167){return db['sequelize']['transaction'](function(_0x33f431){return db['VoiceExtension'][_0x5786('0x26')]({'where':{'VoiceExtensionId':_0x41ec9c[_0x5786('0x61')]['id']},'transaction':_0x33f431})[_0x5786('0x27')](function(_0x595909){var _0x1ca3bc=_[_0x5786('0x2d')](_0x41ec9c['body'],function(_0x1e9b03){_0x1e9b03[_0x5786('0x62')]=_0x41ec9c['params']['id'];return _0x1e9b03;});return db['VoiceExtension'][_0x5786('0x63')](_0x1ca3bc,{'transaction':_0x33f431});});})['then'](function(){return db['VoiceExtension'][_0x5786('0x64')]({'where':{'isApp':!![],'VoiceExtensionId':_0x41ec9c[_0x5786('0x61')]['id']},'order':_0x5786('0x65')});});}})[_0x5786('0x27')](respondWithResult(_0x49d44c,null))[_0x5786('0x4c')](handleError(_0x49d44c,null));}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.events.js b/server/api/voiceExtension/voiceExtension.events.js index a4ec435..27cb830 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 _0x2a30=['hook','exports','events','../../mysqldb','VoiceExtension','setMaxListeners','save','remove','emit'];(function(_0x55257d,_0x3998ec){var _0x4d296d=function(_0x522f05){while(--_0x522f05){_0x55257d['push'](_0x55257d['shift']());}};_0x4d296d(++_0x3998ec);}(_0x2a30,0x1a0));var _0x02a3=function(_0x3a703,_0xd67c81){_0x3a703=_0x3a703-0x0;var _0x8eccaa=_0x2a30[_0x3a703];return _0x8eccaa;};'use strict';var EventEmitter=require(_0x02a3('0x0'));var VoiceExtension=require(_0x02a3('0x1'))['db'][_0x02a3('0x2')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x02a3('0x3')](0x0);var events={'afterCreate':_0x02a3('0x4'),'afterUpdate':'update','afterDestroy':_0x02a3('0x5')};function emitEvent(_0xe0790f){return function(_0x202e5c,_0x4f38e2,_0xaf7643){VoiceExtensionEvents[_0x02a3('0x6')](_0xe0790f+':'+_0x202e5c['id'],_0x202e5c);VoiceExtensionEvents[_0x02a3('0x6')](_0xe0790f,_0x202e5c);_0xaf7643(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceExtension[_0x02a3('0x7')](e,emitEvent(event));}}module[_0x02a3('0x8')]=VoiceExtensionEvents; \ No newline at end of file +var _0xea4b=['VoiceExtension','emit','hasOwnProperty','hook'];(function(_0x23b3cd,_0x4cf458){var _0x5c8f58=function(_0x20c4ca){while(--_0x20c4ca){_0x23b3cd['push'](_0x23b3cd['shift']());}};_0x5c8f58(++_0x4cf458);}(_0xea4b,0xac));var _0xbea4=function(_0x1e5a87,_0xad9d5){_0x1e5a87=_0x1e5a87-0x0;var _0x309977=_0xea4b[_0x1e5a87];return _0x309977;};'use strict';var EventEmitter=require('events');var VoiceExtension=require('../../mysqldb')['db'][_0xbea4('0x0')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0xc12786){return function(_0x445ed6,_0x4574ca,_0x5a1831){VoiceExtensionEvents[_0xbea4('0x1')](_0xc12786+':'+_0x445ed6['id'],_0x445ed6);VoiceExtensionEvents[_0xbea4('0x1')](_0xc12786,_0x445ed6);_0x5a1831(null);};}for(var e in events){if(events[_0xbea4('0x2')](e)){var event=events[e];VoiceExtension[_0xbea4('0x3')](e,emitEvent(event));}}module['exports']=VoiceExtensionEvents; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.model.js b/server/api/voiceExtension/voiceExtension.model.js index 3874741..a9f71ab 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 _0x4c65=['./voiceExtension.attributes','exports','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x1094f3,_0x145ed6){var _0x30b537=function(_0x3549b8){while(--_0x3549b8){_0x1094f3['push'](_0x1094f3['shift']());}};_0x30b537(++_0x145ed6);}(_0x4c65,0x1f1));var _0x54c6=function(_0x4684c8,_0x3f2ca8){_0x4684c8=_0x4684c8-0x0;var _0x1b8554=_0x4c65[_0x4684c8];return _0x1b8554;};'use strict';var _=require(_0x54c6('0x0'));var util=require(_0x54c6('0x1'));var logger=require(_0x54c6('0x2'))(_0x54c6('0x3'));var moment=require(_0x54c6('0x4'));var BPromise=require(_0x54c6('0x5'));var rp=require(_0x54c6('0x6'));var fs=require('fs');var path=require(_0x54c6('0x7'));var rimraf=require('rimraf');var config=require(_0x54c6('0x8'));var attributes=require(_0x54c6('0x9'));module[_0x54c6('0xa')]=function(_0xfd7f62,_0x5308a3){return _0xfd7f62['define']('VoiceExtension',attributes,{'tableName':'voice_extensions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd758=['path','../../config/environment','./voiceExtension.attributes','exports','define','VoiceExtension','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0x4d7084,_0x32912e){var _0x15c385=function(_0x5c4537){while(--_0x5c4537){_0x4d7084['push'](_0x4d7084['shift']());}};_0x15c385(++_0x32912e);}(_0xd758,0xba));var _0x8d75=function(_0x256736,_0x371244){_0x256736=_0x256736-0x0;var _0x4eaa82=_0xd758[_0x256736];return _0x4eaa82;};'use strict';var _=require(_0x8d75('0x0'));var util=require(_0x8d75('0x1'));var logger=require(_0x8d75('0x2'))(_0x8d75('0x3'));var moment=require(_0x8d75('0x4'));var BPromise=require('bluebird');var rp=require(_0x8d75('0x5'));var fs=require('fs');var path=require(_0x8d75('0x6'));var rimraf=require('rimraf');var config=require(_0x8d75('0x7'));var attributes=require(_0x8d75('0x8'));module[_0x8d75('0x9')]=function(_0xbdf556,_0x1f6707){return _0xbdf556[_0x8d75('0xa')](_0x8d75('0xb'),attributes,{'tableName':'voice_extensions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.rpc.js b/server/api/voiceExtension/voiceExtension.rpc.js index ee5f4e6..ffd8cc7 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 _0x97d5=['redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket','register','request','then','request\x20sent','debug','stringify','error','code','VoiceExtension,\x20%s,\x20%s','message','catch','GetVoiceExtension','VoiceExtension','findAll','options','raw','where','limit','include','map','model','attributes','info','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http'];(function(_0x363887,_0x4f5e81){var _0x3dbf=function(_0x35a9b2){while(--_0x35a9b2){_0x363887['push'](_0x363887['shift']());}};_0x3dbf(++_0x4f5e81);}(_0x97d5,0x1a2));var _0x597d=function(_0x4bd1f1,_0x50dc7c){_0x4bd1f1=_0x4bd1f1-0x0;var _0x3ba482=_0x97d5[_0x4bd1f1];return _0x3ba482;};'use strict';var _=require(_0x597d('0x0'));var util=require(_0x597d('0x1'));var moment=require(_0x597d('0x2'));var BPromise=require(_0x597d('0x3'));var rs=require(_0x597d('0x4'));var fs=require('fs');var Redis=require(_0x597d('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x597d('0x6'));var logger=require(_0x597d('0x7'))('rpc');var config=require(_0x597d('0x8'));var jayson=require(_0x597d('0x9'));var client=jayson['client'][_0x597d('0xa')]({'port':0x232a});config[_0x597d('0xb')]=_[_0x597d('0xc')](config[_0x597d('0xb')],{'host':_0x597d('0xd'),'port':0x18eb});var socket=require(_0x597d('0xe'))(new Redis(config[_0x597d('0xb')]));require(_0x597d('0xf'))[_0x597d('0x10')](socket);function respondWithRpcPromise(_0x176dc9,_0x50e6e5,_0x173f14){return new BPromise(function(_0x762123,_0x548f69){return client[_0x597d('0x11')](_0x176dc9,_0x173f14)[_0x597d('0x12')](function(_0x3981b2){logger['info']('VoiceExtension,\x20%s,\x20%s',_0x50e6e5,_0x597d('0x13'));logger[_0x597d('0x14')]('VoiceExtension,\x20%s,\x20%s,\x20%s',_0x50e6e5,_0x597d('0x13'),JSON[_0x597d('0x15')](_0x3981b2));if(_0x3981b2[_0x597d('0x16')]){if(_0x3981b2[_0x597d('0x16')][_0x597d('0x17')]===0x1f4){logger[_0x597d('0x16')](_0x597d('0x18'),_0x50e6e5,_0x3981b2[_0x597d('0x16')][_0x597d('0x19')]);return _0x548f69(_0x3981b2[_0x597d('0x16')][_0x597d('0x19')]);}logger[_0x597d('0x16')](_0x597d('0x18'),_0x50e6e5,_0x3981b2[_0x597d('0x16')][_0x597d('0x19')]);return _0x762123(_0x3981b2[_0x597d('0x16')][_0x597d('0x19')]);}else{logger['info'](_0x597d('0x18'),_0x50e6e5,_0x597d('0x13'));_0x762123(_0x3981b2['result']['message']);}})[_0x597d('0x1a')](function(_0x48eac5){logger[_0x597d('0x16')](_0x597d('0x18'),_0x50e6e5,_0x48eac5);_0x548f69(_0x48eac5);});});}exports[_0x597d('0x1b')]=function(_0x5d061b){var _0x127719=this;return new Promise(function(_0xa429ba,_0xdae21f){return db[_0x597d('0x1c')][_0x597d('0x1d')]({'raw':_0x5d061b[_0x597d('0x1e')]?_0x5d061b[_0x597d('0x1e')][_0x597d('0x1f')]===undefined?!![]:![]:!![],'where':_0x5d061b[_0x597d('0x1e')]?_0x5d061b[_0x597d('0x1e')][_0x597d('0x20')]||null:null,'attributes':_0x5d061b['options']?_0x5d061b[_0x597d('0x1e')]['attributes']||null:null,'limit':_0x5d061b[_0x597d('0x1e')]?_0x5d061b[_0x597d('0x1e')][_0x597d('0x21')]||null:null,'include':_0x5d061b[_0x597d('0x1e')]?_0x5d061b[_0x597d('0x1e')][_0x597d('0x22')]?_[_0x597d('0x23')](_0x5d061b['options']['include'],function(_0x2ff867){return{'model':db[_0x2ff867[_0x597d('0x24')]],'as':_0x2ff867['as'],'attributes':_0x2ff867['attributes'],'include':_0x2ff867[_0x597d('0x22')]?_[_0x597d('0x23')](_0x2ff867['include'],function(_0x5d0b8e){return{'model':db[_0x5d0b8e['model']],'as':_0x5d0b8e['as'],'attributes':_0x5d0b8e[_0x597d('0x25')],'include':_0x5d0b8e[_0x597d('0x22')]?_['map'](_0x5d0b8e[_0x597d('0x22')],function(_0x1e2428){return{'model':db[_0x1e2428['model']],'as':_0x1e2428['as'],'attributes':_0x1e2428['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x18a87b){logger[_0x597d('0x26')]('GetVoiceExtension',_0x5d061b);logger[_0x597d('0x14')](_0x597d('0x1b'),_0x5d061b,JSON[_0x597d('0x15')](_0x18a87b));_0xa429ba(_0x18a87b);})['catch'](function(_0x1bbf5f){logger[_0x597d('0x16')](_0x597d('0x1b'),_0x1bbf5f[_0x597d('0x19')],_0x5d061b);_0xdae21f(_0x127719[_0x597d('0x16')](0x1f4,_0x1bbf5f[_0x597d('0x19')]));});});}; \ No newline at end of file +var _0x1968=['lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','redis','defaults','localhost','./voiceExtension.socket','register','request','then','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','VoiceExtension,\x20%s,\x20%s','message','info','result','catch','GetVoiceExtension','findAll','options','where','attributes','include','map','model'];(function(_0x1df473,_0x1a6931){var _0x1bdd49=function(_0x519be6){while(--_0x519be6){_0x1df473['push'](_0x1df473['shift']());}};_0x1bdd49(++_0x1a6931);}(_0x1968,0x118));var _0x8196=function(_0x565c49,_0x54acd0){_0x565c49=_0x565c49-0x0;var _0x20ca34=_0x1968[_0x565c49];return _0x20ca34;};'use strict';var _=require(_0x8196('0x0'));var util=require(_0x8196('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x8196('0x2'));var fs=require('fs');var Redis=require(_0x8196('0x3'));var db=require(_0x8196('0x4'))['db'];var utils=require(_0x8196('0x5'));var logger=require('../../config/logger')(_0x8196('0x6'));var config=require(_0x8196('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x8196('0x8')]['http']({'port':0x232a});config[_0x8196('0x9')]=_[_0x8196('0xa')](config['redis'],{'host':_0x8196('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8196('0x9')]));require(_0x8196('0xc'))[_0x8196('0xd')](socket);function respondWithRpcPromise(_0x1c6628,_0x532a41,_0x22e9d3){return new BPromise(function(_0x43dea7,_0x37f098){return client[_0x8196('0xe')](_0x1c6628,_0x22e9d3)[_0x8196('0xf')](function(_0x5b8991){logger['info']('VoiceExtension,\x20%s,\x20%s',_0x532a41,'request\x20sent');logger[_0x8196('0x10')](_0x8196('0x11'),_0x532a41,_0x8196('0x12'),JSON[_0x8196('0x13')](_0x5b8991));if(_0x5b8991[_0x8196('0x14')]){if(_0x5b8991[_0x8196('0x14')][_0x8196('0x15')]===0x1f4){logger[_0x8196('0x14')](_0x8196('0x16'),_0x532a41,_0x5b8991[_0x8196('0x14')][_0x8196('0x17')]);return _0x37f098(_0x5b8991['error'][_0x8196('0x17')]);}logger[_0x8196('0x14')](_0x8196('0x16'),_0x532a41,_0x5b8991[_0x8196('0x14')][_0x8196('0x17')]);return _0x43dea7(_0x5b8991['error']['message']);}else{logger[_0x8196('0x18')](_0x8196('0x16'),_0x532a41,_0x8196('0x12'));_0x43dea7(_0x5b8991[_0x8196('0x19')]['message']);}})[_0x8196('0x1a')](function(_0x4bba4c){logger[_0x8196('0x14')]('VoiceExtension,\x20%s,\x20%s',_0x532a41,_0x4bba4c);_0x37f098(_0x4bba4c);});});}exports[_0x8196('0x1b')]=function(_0x268e05){var _0x12ff0d=this;return new Promise(function(_0x1af40f,_0x40e65f){return db['VoiceExtension'][_0x8196('0x1c')]({'raw':_0x268e05[_0x8196('0x1d')]?_0x268e05['options']['raw']===undefined?!![]:![]:!![],'where':_0x268e05[_0x8196('0x1d')]?_0x268e05[_0x8196('0x1d')][_0x8196('0x1e')]||null:null,'attributes':_0x268e05[_0x8196('0x1d')]?_0x268e05[_0x8196('0x1d')][_0x8196('0x1f')]||null:null,'limit':_0x268e05[_0x8196('0x1d')]?_0x268e05[_0x8196('0x1d')]['limit']||null:null,'include':_0x268e05['options']?_0x268e05['options'][_0x8196('0x20')]?_[_0x8196('0x21')](_0x268e05[_0x8196('0x1d')][_0x8196('0x20')],function(_0x1be3ce){return{'model':db[_0x1be3ce[_0x8196('0x22')]],'as':_0x1be3ce['as'],'attributes':_0x1be3ce['attributes'],'include':_0x1be3ce['include']?_[_0x8196('0x21')](_0x1be3ce['include'],function(_0x511c49){return{'model':db[_0x511c49['model']],'as':_0x511c49['as'],'attributes':_0x511c49[_0x8196('0x1f')],'include':_0x511c49[_0x8196('0x20')]?_['map'](_0x511c49[_0x8196('0x20')],function(_0x244101){return{'model':db[_0x244101[_0x8196('0x22')]],'as':_0x244101['as'],'attributes':_0x244101['attributes']};}):[]};}):[]};}):[]:[]})[_0x8196('0xf')](function(_0xd4d704){logger[_0x8196('0x18')]('GetVoiceExtension',_0x268e05);logger['debug'](_0x8196('0x1b'),_0x268e05,JSON['stringify'](_0xd4d704));_0x1af40f(_0xd4d704);})['catch'](function(_0x1200b5){logger[_0x8196('0x14')]('GetVoiceExtension',_0x1200b5['message'],_0x268e05);_0x40e65f(_0x12ff0d[_0x8196('0x14')](0x1f4,_0x1200b5[_0x8196('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.socket.js b/server/api/voiceExtension/voiceExtension.socket.js index b93e5d9..db28021 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 _0x0a37=['register','length','voiceExtension:','remove','emit','removeListener'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0x0a37,0xa5));var _0x70a3=function(_0x3a8dc1,_0x2f03b8){_0x3a8dc1=_0x3a8dc1-0x0;var _0x4b3595=_0x0a37[_0x3a8dc1];return _0x4b3595;};'use strict';var VoiceExtensionEvents=require('./voiceExtension.events');var events=['save',_0x70a3('0x0'),'update'];function createListener(_0x569353,_0x8e56c7){return function(_0x13a078){_0x8e56c7[_0x70a3('0x1')](_0x569353,_0x13a078);};}function removeListener(_0x678245,_0x36c0d7){return function(){VoiceExtensionEvents[_0x70a3('0x2')](_0x678245,_0x36c0d7);};}exports[_0x70a3('0x3')]=function(_0x58d0d0){for(var _0x40d8e0=0x0,_0x5a0ecd=events[_0x70a3('0x4')];_0x40d8e0<_0x5a0ecd;_0x40d8e0++){var _0x48e9f0=events[_0x40d8e0];var _0x148aea=createListener(_0x70a3('0x5')+_0x48e9f0,_0x58d0d0);VoiceExtensionEvents['on'](_0x48e9f0,_0x148aea);}}; \ No newline at end of file +var _0x1738=['save','remove','update','removeListener','register'];(function(_0x21f715,_0x10c730){var _0x789ed1=function(_0x20d055){while(--_0x20d055){_0x21f715['push'](_0x21f715['shift']());}};_0x789ed1(++_0x10c730);}(_0x1738,0xb4));var _0x8173=function(_0x22a3f0,_0x513d0e){_0x22a3f0=_0x22a3f0-0x0;var _0x2d8a9c=_0x1738[_0x22a3f0];return _0x2d8a9c;};'use strict';var VoiceExtensionEvents=require('./voiceExtension.events');var events=[_0x8173('0x0'),_0x8173('0x1'),_0x8173('0x2')];function createListener(_0x7a5383,_0x5751e0){return function(_0x2edcb5){_0x5751e0['emit'](_0x7a5383,_0x2edcb5);};}function removeListener(_0x1bc869,_0x1c3b30){return function(){VoiceExtensionEvents[_0x8173('0x3')](_0x1bc869,_0x1c3b30);};}exports[_0x8173('0x4')]=function(_0x8ef1a8){for(var _0x4284c9=0x0,_0x524da7=events['length'];_0x4284c9<_0x524da7;_0x4284c9++){var _0x3612a5=events[_0x4284c9];var _0x28e12e=createListener('voiceExtension:'+_0x3612a5,_0x8ef1a8);VoiceExtensionEvents['on'](_0x3612a5,_0x28e12e);}}; \ No newline at end of file diff --git a/server/api/voiceMail/index.js b/server/api/voiceMail/index.js index 7e0aa59..d9d8983 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 _0x7349=['exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMail.controller','get','index','/:id','show','isAuthenticated','getMessages','post','create','update','destroy'];(function(_0x2dc70b,_0x24fe39){var _0x4dab13=function(_0x233f7a){while(--_0x233f7a){_0x2dc70b['push'](_0x2dc70b['shift']());}};_0x4dab13(++_0x24fe39);}(_0x7349,0x112));var _0x9734=function(_0x4e7f6d,_0xa88a39){_0x4e7f6d=_0x4e7f6d-0x0;var _0x3f12ec=_0x7349[_0x4e7f6d];return _0x3f12ec;};'use strict';var multer=require(_0x9734('0x0'));var util=require(_0x9734('0x1'));var path=require(_0x9734('0x2'));var timeout=require(_0x9734('0x3'));var express=require(_0x9734('0x4'));var router=express[_0x9734('0x5')]();var auth=require(_0x9734('0x6'));var interaction=require(_0x9734('0x7'));var config=require(_0x9734('0x8'));var controller=require(_0x9734('0x9'));router[_0x9734('0xa')]('/',auth['isAuthenticated'](),controller[_0x9734('0xb')]);router['get'](_0x9734('0xc'),auth['isAuthenticated'](),controller[_0x9734('0xd')]);router[_0x9734('0xa')]('/:id/messages',auth[_0x9734('0xe')](),controller[_0x9734('0xf')]);router[_0x9734('0x10')]('/',auth['isAuthenticated'](),controller[_0x9734('0x11')]);router['put']('/:id',auth[_0x9734('0xe')](),controller[_0x9734('0x12')]);router['delete']('/:id',auth[_0x9734('0xe')](),controller[_0x9734('0x13')]);module[_0x9734('0x14')]=router; \ No newline at end of file +var _0x575f=['/:id/messages','getMessages','create','put','/:id','update','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show'];(function(_0x3aa98c,_0x574cb6){var _0x49e505=function(_0x4de8dd){while(--_0x4de8dd){_0x3aa98c['push'](_0x3aa98c['shift']());}};_0x49e505(++_0x574cb6);}(_0x575f,0x143));var _0xf575=function(_0x22c598,_0x3a766c){_0x22c598=_0x22c598-0x0;var _0x2805ed=_0x575f[_0x22c598];return _0x2805ed;};'use strict';var multer=require(_0xf575('0x0'));var util=require(_0xf575('0x1'));var path=require(_0xf575('0x2'));var timeout=require(_0xf575('0x3'));var express=require(_0xf575('0x4'));var router=express[_0xf575('0x5')]();var auth=require(_0xf575('0x6'));var interaction=require(_0xf575('0x7'));var config=require(_0xf575('0x8'));var controller=require('./voiceMail.controller');router[_0xf575('0x9')]('/',auth[_0xf575('0xa')](),controller[_0xf575('0xb')]);router['get']('/:id',auth[_0xf575('0xa')](),controller[_0xf575('0xc')]);router[_0xf575('0x9')](_0xf575('0xd'),auth[_0xf575('0xa')](),controller[_0xf575('0xe')]);router['post']('/',auth[_0xf575('0xa')](),controller[_0xf575('0xf')]);router[_0xf575('0x10')](_0xf575('0x11'),auth['isAuthenticated'](),controller[_0xf575('0x12')]);router[_0xf575('0x13')]('/:id',auth[_0xf575('0xa')](),controller['destroy']);module[_0xf575('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 1dad104..0ca4248 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 _0x14a0=['from-voicemail','contest_mailbox','setDataValue','trim','ENUM','yes','TINYINT(4)','TIMESTAMP','INTEGER','VIRTUAL','getDataValue','fullname','\x20-\x20','mailbox','exports','STRING'];(function(_0x43e56b,_0x903536){var _0x4eb290=function(_0xd73d19){while(--_0xd73d19){_0x43e56b['push'](_0x43e56b['shift']());}};_0x4eb290(++_0x903536);}(_0x14a0,0x8e));var _0x014a=function(_0x3292ce,_0x3eb57b){_0x3292ce=_0x3292ce-0x0;var _0x4f4c2c=_0x14a0[_0x3292ce];return _0x4f4c2c;};'use strict';var Sequelize=require('sequelize');module[_0x014a('0x0')]={'customer_id':{'type':Sequelize[_0x014a('0x1')]},'context':{'type':Sequelize[_0x014a('0x1')],'defaultValue':_0x014a('0x2'),'unique':_0x014a('0x3')},'mailbox':{'type':Sequelize[_0x014a('0x1')],'defaultValue':'','allowNull':![],'unique':_0x014a('0x3')},'password':{'type':Sequelize['STRING']},'fullname':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x014a('0x1')],'validate':{'isEmail':!![]},'set':function(_0x12e8da){this[_0x014a('0x4')]('email',typeof _0x12e8da==='string'&&_0x12e8da[_0x014a('0x5')]()?_0x12e8da[_0x014a('0x5')]():null);}},'pager':{'type':Sequelize[_0x014a('0x1')]},'tz':{'type':Sequelize['STRING'],'defaultValue':'central'},'attach':{'type':Sequelize[_0x014a('0x6')]('yes','no'),'defaultValue':'yes','allowNull':![]},'saycid':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':_0x014a('0x7'),'allowNull':![]},'dialout':{'type':Sequelize['STRING']},'callback':{'type':Sequelize[_0x014a('0x1')]},'review':{'type':Sequelize[_0x014a('0x6')]('yes','no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0x014a('0x6')](_0x014a('0x7'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0x014a('0x6')](_0x014a('0x7'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x014a('0x6')](_0x014a('0x7'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0x014a('0x8'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0x014a('0x6')](_0x014a('0x7'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x014a('0x6')](_0x014a('0x7'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0x014a('0x6')]('yes','no'),'defaultValue':_0x014a('0x7'),'allowNull':![]},'forcename':{'type':Sequelize[_0x014a('0x6')]('yes','no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0x014a('0x6')](_0x014a('0x7'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize['ENUM'](_0x014a('0x7'),'no'),'defaultValue':_0x014a('0x7'),'allowNull':![]},'stamp':{'type':_0x014a('0x9')},'emailsubject':{'type':Sequelize[_0x014a('0x1')]},'emailbody':{'type':Sequelize[_0x014a('0x1')]},'maxsecs':{'type':Sequelize[_0x014a('0xa')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x014a('0xa')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0x014a('0xb')],'get':function(){return this[_0x014a('0xc')](_0x014a('0xd'))+_0x014a('0xe')+this[_0x014a('0xc')](_0x014a('0xf'));}}}; \ No newline at end of file +var _0x8603=['exports','STRING','contest_mailbox','setDataValue','email','string','trim','ENUM','yes','TINYINT(4)','TIMESTAMP','INTEGER','getDataValue','fullname','\x20-\x20','mailbox'];(function(_0x128fcd,_0x59568f){var _0x4811ad=function(_0x12643a){while(--_0x12643a){_0x128fcd['push'](_0x128fcd['shift']());}};_0x4811ad(++_0x59568f);}(_0x8603,0x190));var _0x3860=function(_0xbccf,_0x5f3f74){_0xbccf=_0xbccf-0x0;var _0x24c504=_0x8603[_0xbccf];return _0x24c504;};'use strict';var Sequelize=require('sequelize');module[_0x3860('0x0')]={'customer_id':{'type':Sequelize[_0x3860('0x1')]},'context':{'type':Sequelize[_0x3860('0x1')],'defaultValue':'from-voicemail','unique':'contest_mailbox'},'mailbox':{'type':Sequelize[_0x3860('0x1')],'defaultValue':'','allowNull':![],'unique':_0x3860('0x2')},'password':{'type':Sequelize[_0x3860('0x1')]},'fullname':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x3860('0x1')],'validate':{'isEmail':!![]},'set':function(_0x56f8c5){this[_0x3860('0x3')](_0x3860('0x4'),typeof _0x56f8c5===_0x3860('0x5')&&_0x56f8c5[_0x3860('0x6')]()?_0x56f8c5[_0x3860('0x6')]():null);}},'pager':{'type':Sequelize['STRING']},'tz':{'type':Sequelize['STRING'],'defaultValue':'central'},'attach':{'type':Sequelize[_0x3860('0x7')](_0x3860('0x8'),'no'),'defaultValue':'yes','allowNull':![]},'saycid':{'type':Sequelize[_0x3860('0x7')](_0x3860('0x8'),'no'),'defaultValue':'yes','allowNull':![]},'dialout':{'type':Sequelize[_0x3860('0x1')]},'callback':{'type':Sequelize[_0x3860('0x1')]},'review':{'type':Sequelize['ENUM'](_0x3860('0x8'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0x3860('0x7')]('yes','no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0x3860('0x7')](_0x3860('0x8'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x3860('0x7')](_0x3860('0x8'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0x3860('0x9'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0x3860('0x7')](_0x3860('0x8'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x3860('0x7')](_0x3860('0x8'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0x3860('0x7')]('yes','no'),'defaultValue':_0x3860('0x8'),'allowNull':![]},'forcename':{'type':Sequelize[_0x3860('0x7')](_0x3860('0x8'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0x3860('0x7')](_0x3860('0x8'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0x3860('0x7')](_0x3860('0x8'),'no'),'defaultValue':_0x3860('0x8'),'allowNull':![]},'stamp':{'type':_0x3860('0xa')},'emailsubject':{'type':Sequelize[_0x3860('0x1')]},'emailbody':{'type':Sequelize[_0x3860('0x1')]},'maxsecs':{'type':Sequelize[_0x3860('0xb')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize['INTEGER'](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x3860('0xc')](_0x3860('0xd'))+_0x3860('0xe')+this['getDataValue'](_0x3860('0xf'));}}}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.controller.js b/server/api/voiceMail/voiceMail.controller.js index aa75e80..7ee85e3 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 _0xb5d4=['merge','map','type','key','VIRTUAL','field','count','includeAll','rows','params','length','options','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','find','userProfileId','autoAssociation','body','getMessages','findOne','VoiceMailMessage','sort','findAndCountAll','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','sendStatus','status','end','json','offset','set','Content-Range','reject','save','update','then','Voicemails','UserProfileResource','destroy','error','stack','name','send','VoiceMail','rawAttributes','model','keys','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','limit','order','pick','filter','where'];(function(_0x3b944d,_0x525eb2){var _0x2743d0=function(_0xbefae7){while(--_0xbefae7){_0x3b944d['push'](_0x3b944d['shift']());}};_0x2743d0(++_0x525eb2);}(_0xb5d4,0xcc));var _0x4b5d=function(_0x2682d1,_0x303ab3){_0x2682d1=_0x2682d1-0x0;var _0x13c0c2=_0xb5d4[_0x2682d1];return _0x13c0c2;};'use strict';var pdf=require(_0x4b5d('0x0'));var emlformat=require(_0x4b5d('0x1'));var rimraf=require(_0x4b5d('0x2'));var zipdir=require(_0x4b5d('0x3'));var jsonpatch=require(_0x4b5d('0x4'));var rp=require(_0x4b5d('0x5'));var moment=require(_0x4b5d('0x6'));var BPromise=require('bluebird');var Mustache=require(_0x4b5d('0x7'));var util=require(_0x4b5d('0x8'));var path=require(_0x4b5d('0x9'));var sox=require(_0x4b5d('0xa'));var csv=require(_0x4b5d('0xb'));var ejs=require(_0x4b5d('0xc'));var fs=require('fs');var _=require(_0x4b5d('0xd'));var squel=require(_0x4b5d('0xe'));var crypto=require(_0x4b5d('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x4b5d('0x10'));var toCsv=require(_0x4b5d('0xb'));var querystring=require(_0x4b5d('0x11'));var Papa=require(_0x4b5d('0x12'));var Redis=require(_0x4b5d('0x13'));var authService=require(_0x4b5d('0x14'));var qs=require(_0x4b5d('0x15'));var as=require(_0x4b5d('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4b5d('0x17'))(_0x4b5d('0x18'));var utils=require(_0x4b5d('0x19'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5334d2,_0xe6f9aa){_0xe6f9aa=_0xe6f9aa||0xcc;return function(_0x1238e4){if(_0x1238e4){return _0x5334d2[_0x4b5d('0x1a')](_0xe6f9aa);}return _0x5334d2[_0x4b5d('0x1b')](_0xe6f9aa)[_0x4b5d('0x1c')]();};}function respondWithResult(_0x4be5f7,_0x4bd9fe){_0x4bd9fe=_0x4bd9fe||0xc8;return function(_0x4d279d){if(_0x4d279d){return _0x4be5f7[_0x4b5d('0x1b')](_0x4bd9fe)[_0x4b5d('0x1d')](_0x4d279d);}};}function respondWithFilteredResult(_0x57866e,_0x28e6ff){return function(_0x154935){if(_0x154935){var _0x96e394=_0x154935['count'],_0x3400db=_0x28e6ff[_0x4b5d('0x1e')],_0x2e0f39=_0x28e6ff[_0x4b5d('0x1e')]+_0x28e6ff['limit'],_0x80cdf;if(_0x2e0f39>=_0x96e394){_0x2e0f39=_0x96e394;_0x80cdf=0xc8;}else{_0x80cdf=0xce;}_0x57866e[_0x4b5d('0x1b')](_0x80cdf);return _0x57866e[_0x4b5d('0x1f')](_0x4b5d('0x20'),_0x3400db+'-'+_0x2e0f39+'/'+_0x96e394)['json'](_0x154935);}return null;};}function patchUpdates(_0x84b21f){return function(_0x25c269){try{jsonpatch['apply'](_0x25c269,_0x84b21f,!![]);}catch(_0x2be538){return BPromise[_0x4b5d('0x21')](_0x2be538);}return _0x25c269[_0x4b5d('0x22')]();};}function saveUpdates(_0x42db06,_0x5c3fa7){return function(_0x15b459){if(_0x15b459){return _0x15b459[_0x4b5d('0x23')](_0x42db06)[_0x4b5d('0x24')](function(_0x3b4e74){return _0x3b4e74;});}return null;};}function removeEntity(_0x44dca8,_0x112efc){return function(_0x5ef859){if(_0x5ef859){return _0x5ef859['destroy']()[_0x4b5d('0x24')](function(){var _0x258162=_0x5ef859['get']({'plain':!![]});var _0xe1c2a6=_0x4b5d('0x25');return db[_0x4b5d('0x26')][_0x4b5d('0x27')]({'where':{'type':_0xe1c2a6,'resourceId':_0x258162['id']}})['then'](function(){return _0x5ef859;});})[_0x4b5d('0x24')](function(){_0x44dca8[_0x4b5d('0x1b')](0xcc)[_0x4b5d('0x1c')]();});}};}function handleEntityNotFound(_0x21710a,_0x3ee18b){return function(_0x485600){if(!_0x485600){_0x21710a[_0x4b5d('0x1a')](0x194);}return _0x485600;};}function handleError(_0x4856ad,_0x1fdc6e){_0x1fdc6e=_0x1fdc6e||0x1f4;return function(_0x5be006){logger[_0x4b5d('0x28')](_0x5be006[_0x4b5d('0x29')]);if(_0x5be006[_0x4b5d('0x2a')]){delete _0x5be006[_0x4b5d('0x2a')];}_0x4856ad[_0x4b5d('0x1b')](_0x1fdc6e)[_0x4b5d('0x2b')](_0x5be006);};}exports['index']=function(_0x2d992e,_0x453917){var _0x3077a1={},_0x236f1f={},_0x43bda5={'count':0x0,'rows':[]};var _0x3b7617=db[_0x4b5d('0x2c')][_0x4b5d('0x2d')];_0x236f1f[_0x4b5d('0x2e')]=_[_0x4b5d('0x2f')](_0x3b7617);_0x236f1f[_0x4b5d('0x30')]=_[_0x4b5d('0x2f')](_0x2d992e['query']);_0x236f1f[_0x4b5d('0x31')]=_['intersection'](_0x236f1f[_0x4b5d('0x2e')],_0x236f1f['query']);_0x3077a1[_0x4b5d('0x32')]=_[_0x4b5d('0x33')](_0x236f1f[_0x4b5d('0x2e')],qs[_0x4b5d('0x34')](_0x2d992e['query'][_0x4b5d('0x34')]));_0x3077a1[_0x4b5d('0x32')]=_0x3077a1[_0x4b5d('0x32')]['length']?_0x3077a1[_0x4b5d('0x32')]:_0x236f1f['model'];if(!_0x2d992e['query'][_0x4b5d('0x35')](_0x4b5d('0x36'))){_0x3077a1[_0x4b5d('0x37')]=qs['limit'](_0x2d992e[_0x4b5d('0x30')][_0x4b5d('0x37')]);_0x3077a1[_0x4b5d('0x1e')]=qs[_0x4b5d('0x1e')](_0x2d992e[_0x4b5d('0x30')][_0x4b5d('0x1e')]);}_0x3077a1[_0x4b5d('0x38')]=qs['sort'](_0x2d992e[_0x4b5d('0x30')]['sort']);_0x3077a1['where']=qs[_0x4b5d('0x31')](_[_0x4b5d('0x39')](_0x2d992e['query'],_0x236f1f[_0x4b5d('0x31')]));if(_0x2d992e[_0x4b5d('0x30')][_0x4b5d('0x3a')]){_0x3077a1[_0x4b5d('0x3b')]=_[_0x4b5d('0x3c')](_0x3077a1[_0x4b5d('0x3b')],{'$or':_[_0x4b5d('0x3d')](_0x3b7617,function(_0x1d763c){if(_0x1d763c[_0x4b5d('0x3e')][_0x4b5d('0x3f')]!==_0x4b5d('0x40')){var _0x316dd6={};_0x316dd6[_0x1d763c[_0x4b5d('0x41')]]={'$like':'%'+_0x2d992e[_0x4b5d('0x30')]['filter']+'%'};return _0x316dd6;}})});}_0x3077a1=_['merge']({},_0x3077a1,_0x2d992e['options']);var _0x225999={'where':_0x3077a1[_0x4b5d('0x3b')]};return db['VoiceMail'][_0x4b5d('0x42')](_0x225999)[_0x4b5d('0x24')](function(_0x56929d){_0x43bda5['count']=_0x56929d;if(_0x2d992e['query'][_0x4b5d('0x43')]){_0x3077a1['include']=[{'all':!![]}];}return db[_0x4b5d('0x2c')]['findAll'](_0x3077a1);})[_0x4b5d('0x24')](function(_0x2ea0bd){_0x43bda5[_0x4b5d('0x44')]=_0x2ea0bd;return _0x43bda5;})[_0x4b5d('0x24')](respondWithFilteredResult(_0x453917,_0x3077a1))['catch'](handleError(_0x453917,null));};exports['show']=function(_0x112693,_0x50575b){var _0x3ac468={'raw':!![],'where':{'id':_0x112693[_0x4b5d('0x45')]['id']}},_0x13bc89={};_0x13bc89['model']=_[_0x4b5d('0x2f')](db[_0x4b5d('0x2c')][_0x4b5d('0x2d')]);_0x13bc89[_0x4b5d('0x30')]=_[_0x4b5d('0x2f')](_0x112693['query']);_0x13bc89[_0x4b5d('0x31')]=_['intersection'](_0x13bc89[_0x4b5d('0x2e')],_0x13bc89[_0x4b5d('0x30')]);_0x3ac468[_0x4b5d('0x32')]=_[_0x4b5d('0x33')](_0x13bc89[_0x4b5d('0x2e')],qs[_0x4b5d('0x34')](_0x112693[_0x4b5d('0x30')]['fields']));_0x3ac468[_0x4b5d('0x32')]=_0x3ac468[_0x4b5d('0x32')][_0x4b5d('0x46')]?_0x3ac468[_0x4b5d('0x32')]:_0x13bc89[_0x4b5d('0x2e')];if(_0x112693[_0x4b5d('0x30')][_0x4b5d('0x43')]){_0x3ac468['include']=[{'all':!![]}];}_0x3ac468=_[_0x4b5d('0x3c')]({},_0x3ac468,_0x112693[_0x4b5d('0x47')]);return db[_0x4b5d('0x2c')]['find'](_0x3ac468)[_0x4b5d('0x24')](handleEntityNotFound(_0x50575b,null))[_0x4b5d('0x24')](respondWithResult(_0x50575b,null))[_0x4b5d('0x48')](handleError(_0x50575b,null));};exports[_0x4b5d('0x49')]=function(_0x23f739,_0x54612c){return db[_0x4b5d('0x2c')]['create'](_0x23f739['body'],{})[_0x4b5d('0x24')](function(_0x317c37){var _0x3a24d0=_0x23f739[_0x4b5d('0x4a')]['get']({'plain':!![]});if(!_0x3a24d0)throw new Error(_0x4b5d('0x4b'));if(_0x3a24d0[_0x4b5d('0x4c')]==='user'){var _0x1eccf0=_0x317c37[_0x4b5d('0x4d')]({'plain':!![]});var _0x16909c=_0x4b5d('0x25');return db[_0x4b5d('0x4e')][_0x4b5d('0x4f')]({'where':{'name':_0x16909c,'userProfileId':_0x3a24d0[_0x4b5d('0x50')]},'raw':!![]})[_0x4b5d('0x24')](function(_0x1d2f30){if(_0x1d2f30&&_0x1d2f30[_0x4b5d('0x51')]===0x0){return db[_0x4b5d('0x26')]['create']({'name':_0x1eccf0[_0x4b5d('0x2a')],'resourceId':_0x1eccf0['id'],'type':_0x1d2f30[_0x4b5d('0x2a')],'sectionId':_0x1d2f30['id']},{})[_0x4b5d('0x24')](function(){return _0x317c37;});}else{return _0x317c37;}})[_0x4b5d('0x48')](function(_0x254942){logger[_0x4b5d('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x254942);throw _0x254942;});}return _0x317c37;})[_0x4b5d('0x24')](respondWithResult(_0x54612c,0xc9))[_0x4b5d('0x48')](handleError(_0x54612c,null));};exports['update']=function(_0x386ad0,_0x2a8430){if(_0x386ad0['body']['id']){delete _0x386ad0[_0x4b5d('0x52')]['id'];}return db[_0x4b5d('0x2c')][_0x4b5d('0x4f')]({'where':{'id':_0x386ad0[_0x4b5d('0x45')]['id']}})[_0x4b5d('0x24')](handleEntityNotFound(_0x2a8430,null))[_0x4b5d('0x24')](saveUpdates(_0x386ad0['body'],null))['then'](respondWithResult(_0x2a8430,null))[_0x4b5d('0x48')](handleError(_0x2a8430,null));};exports[_0x4b5d('0x27')]=function(_0x435f74,_0x53fb69){return db[_0x4b5d('0x2c')][_0x4b5d('0x4f')]({'where':{'id':_0x435f74[_0x4b5d('0x45')]['id']}})[_0x4b5d('0x24')](handleEntityNotFound(_0x53fb69,null))[_0x4b5d('0x24')](removeEntity(_0x53fb69,null))[_0x4b5d('0x48')](handleError(_0x53fb69,null));};exports[_0x4b5d('0x53')]=function(_0xd4d80b,_0x2d901e,_0x4e7d5e){return db[_0x4b5d('0x2c')][_0x4b5d('0x54')]({'where':{'id':_0xd4d80b[_0x4b5d('0x45')]['id']}})['then'](handleEntityNotFound(_0x2d901e,null))['then'](function(_0x4cdf4d){var _0x25406c;var _0x58faf2={},_0x26e0a3={};_0x26e0a3[_0x4b5d('0x2e')]=_[_0x4b5d('0x2f')](db[_0x4b5d('0x55')][_0x4b5d('0x2d')]);_0x26e0a3[_0x4b5d('0x30')]=_['keys'](_0xd4d80b[_0x4b5d('0x30')]);_0x26e0a3['filters']=_['intersection'](_0x26e0a3['model'],_0x26e0a3['query']);_0x58faf2[_0x4b5d('0x32')]=_[_0x4b5d('0x33')](_0x26e0a3['model'],qs[_0x4b5d('0x34')](_0xd4d80b['query']['fields']));_0x58faf2['attributes']=_0x58faf2[_0x4b5d('0x32')]['length']?_0x58faf2[_0x4b5d('0x32')]:_0x26e0a3[_0x4b5d('0x2e')];if(!_0xd4d80b[_0x4b5d('0x30')][_0x4b5d('0x35')]('nolimit')){_0x58faf2[_0x4b5d('0x37')]=qs['limit'](_0xd4d80b[_0x4b5d('0x30')]['limit']);_0x58faf2[_0x4b5d('0x1e')]=qs[_0x4b5d('0x1e')](_0xd4d80b[_0x4b5d('0x30')][_0x4b5d('0x1e')]);}_0x58faf2[_0x4b5d('0x38')]=qs[_0x4b5d('0x56')](_0xd4d80b[_0x4b5d('0x30')][_0x4b5d('0x56')]);_0x58faf2[_0x4b5d('0x3b')]=qs[_0x4b5d('0x31')](_['pick'](_0xd4d80b[_0x4b5d('0x30')],_0x26e0a3[_0x4b5d('0x31')]));if(_0xd4d80b[_0x4b5d('0x30')][_0x4b5d('0x3a')]){_0x58faf2[_0x4b5d('0x3b')]=_[_0x4b5d('0x3c')](_0x58faf2[_0x4b5d('0x3b')],{'$or':_['map'](_0x58faf2[_0x4b5d('0x32')],function(_0x1277d5){var _0x3d4bad={};_0x3d4bad[_0x1277d5]={'$like':'%'+_0xd4d80b[_0x4b5d('0x30')]['filter']+'%'};return _0x3d4bad;})});}_0x58faf2[_0x4b5d('0x3b')]=_[_0x4b5d('0x3c')](_0x58faf2[_0x4b5d('0x3b')],{'mailboxuser':_0x4cdf4d['mailbox']});_0x58faf2=_[_0x4b5d('0x3c')]({},_0x58faf2,_0xd4d80b[_0x4b5d('0x47')]);return db[_0x4b5d('0x55')][_0x4b5d('0x57')](_0x58faf2)[_0x4b5d('0x24')](respondWithFilteredResult(_0x2d901e,_0x58faf2));})['catch'](handleError(_0x2d901e,null));}; \ No newline at end of file +var _0xb5bf=['VoiceMail','rawAttributes','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','pick','filter','where','merge','map','type','key','VIRTUAL','field','options','includeAll','include','findAll','rows','show','find','catch','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','UserProfileResource','error','params','getMessages','findOne','VoiceMailMessage','nolimit','findAndCountAll','html-pdf','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','limit','Content-Range','reject','save','update','then','Voicemails','destroy','name','send','index'];(function(_0x5f4ef2,_0x5a15f8){var _0x21dff7=function(_0x263b09){while(--_0x263b09){_0x5f4ef2['push'](_0x5f4ef2['shift']());}};_0x21dff7(++_0x5a15f8);}(_0xb5bf,0x1d7));var _0xfb5b=function(_0x8a969d,_0x339d9f){_0x8a969d=_0x8a969d-0x0;var _0x1d8dc7=_0xb5bf[_0x8a969d];return _0x1d8dc7;};'use strict';var pdf=require(_0xfb5b('0x0'));var emlformat=require(_0xfb5b('0x1'));var rimraf=require(_0xfb5b('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xfb5b('0x3'));var rp=require('request-promise');var moment=require(_0xfb5b('0x4'));var BPromise=require(_0xfb5b('0x5'));var Mustache=require(_0xfb5b('0x6'));var util=require(_0xfb5b('0x7'));var path=require(_0xfb5b('0x8'));var sox=require(_0xfb5b('0x9'));var csv=require('to-csv');var ejs=require(_0xfb5b('0xa'));var fs=require('fs');var _=require(_0xfb5b('0xb'));var squel=require(_0xfb5b('0xc'));var crypto=require(_0xfb5b('0xd'));var jsforce=require(_0xfb5b('0xe'));var deskjs=require(_0xfb5b('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xfb5b('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xfb5b('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xfb5b('0x12'))(_0xfb5b('0x13'));var utils=require(_0xfb5b('0x14'));var config=require('../../config/environment');var db=require(_0xfb5b('0x15'))['db'];function respondWithStatusCode(_0xc5fb4b,_0x87021a){_0x87021a=_0x87021a||0xcc;return function(_0x38279b){if(_0x38279b){return _0xc5fb4b[_0xfb5b('0x16')](_0x87021a);}return _0xc5fb4b[_0xfb5b('0x17')](_0x87021a)[_0xfb5b('0x18')]();};}function respondWithResult(_0x8a1d24,_0x4a0e1e){_0x4a0e1e=_0x4a0e1e||0xc8;return function(_0x1153ca){if(_0x1153ca){return _0x8a1d24[_0xfb5b('0x17')](_0x4a0e1e)[_0xfb5b('0x19')](_0x1153ca);}};}function respondWithFilteredResult(_0x252318,_0x517d4a){return function(_0x383ec9){if(_0x383ec9){var _0x4024bb=_0x383ec9[_0xfb5b('0x1a')],_0x1b2908=_0x517d4a[_0xfb5b('0x1b')],_0x5e7898=_0x517d4a[_0xfb5b('0x1b')]+_0x517d4a[_0xfb5b('0x1c')],_0x350661;if(_0x5e7898>=_0x4024bb){_0x5e7898=_0x4024bb;_0x350661=0xc8;}else{_0x350661=0xce;}_0x252318[_0xfb5b('0x17')](_0x350661);return _0x252318['set'](_0xfb5b('0x1d'),_0x1b2908+'-'+_0x5e7898+'/'+_0x4024bb)['json'](_0x383ec9);}return null;};}function patchUpdates(_0x4e5f07){return function(_0x14a2fa){try{jsonpatch['apply'](_0x14a2fa,_0x4e5f07,!![]);}catch(_0x2a3fbc){return BPromise[_0xfb5b('0x1e')](_0x2a3fbc);}return _0x14a2fa[_0xfb5b('0x1f')]();};}function saveUpdates(_0x17d942,_0x1bb368){return function(_0x2d2be1){if(_0x2d2be1){return _0x2d2be1[_0xfb5b('0x20')](_0x17d942)[_0xfb5b('0x21')](function(_0x2479c5){return _0x2479c5;});}return null;};}function removeEntity(_0x255e47,_0x49d0c6){return function(_0x3a6ade){if(_0x3a6ade){return _0x3a6ade['destroy']()[_0xfb5b('0x21')](function(){var _0x38f1c3=_0x3a6ade['get']({'plain':!![]});var _0x238f5b=_0xfb5b('0x22');return db['UserProfileResource'][_0xfb5b('0x23')]({'where':{'type':_0x238f5b,'resourceId':_0x38f1c3['id']}})[_0xfb5b('0x21')](function(){return _0x3a6ade;});})[_0xfb5b('0x21')](function(){_0x255e47['status'](0xcc)[_0xfb5b('0x18')]();});}};}function handleEntityNotFound(_0xdd4c5e,_0x58c4a7){return function(_0x311bff){if(!_0x311bff){_0xdd4c5e['sendStatus'](0x194);}return _0x311bff;};}function handleError(_0x2345ec,_0x261d95){_0x261d95=_0x261d95||0x1f4;return function(_0xcbfea4){logger['error'](_0xcbfea4['stack']);if(_0xcbfea4[_0xfb5b('0x24')]){delete _0xcbfea4[_0xfb5b('0x24')];}_0x2345ec[_0xfb5b('0x17')](_0x261d95)[_0xfb5b('0x25')](_0xcbfea4);};}exports[_0xfb5b('0x26')]=function(_0x3281b5,_0x1bd64b){var _0x57b3c1={},_0x36e376={},_0x494b04={'count':0x0,'rows':[]};var _0x2465c1=db[_0xfb5b('0x27')][_0xfb5b('0x28')];_0x36e376[_0xfb5b('0x29')]=_[_0xfb5b('0x2a')](_0x2465c1);_0x36e376[_0xfb5b('0x2b')]=_[_0xfb5b('0x2a')](_0x3281b5['query']);_0x36e376[_0xfb5b('0x2c')]=_['intersection'](_0x36e376['model'],_0x36e376[_0xfb5b('0x2b')]);_0x57b3c1['attributes']=_[_0xfb5b('0x2d')](_0x36e376[_0xfb5b('0x29')],qs[_0xfb5b('0x2e')](_0x3281b5[_0xfb5b('0x2b')][_0xfb5b('0x2e')]));_0x57b3c1[_0xfb5b('0x2f')]=_0x57b3c1[_0xfb5b('0x2f')][_0xfb5b('0x30')]?_0x57b3c1[_0xfb5b('0x2f')]:_0x36e376['model'];if(!_0x3281b5[_0xfb5b('0x2b')][_0xfb5b('0x31')]('nolimit')){_0x57b3c1[_0xfb5b('0x1c')]=qs[_0xfb5b('0x1c')](_0x3281b5[_0xfb5b('0x2b')][_0xfb5b('0x1c')]);_0x57b3c1[_0xfb5b('0x1b')]=qs[_0xfb5b('0x1b')](_0x3281b5[_0xfb5b('0x2b')]['offset']);}_0x57b3c1[_0xfb5b('0x32')]=qs['sort'](_0x3281b5[_0xfb5b('0x2b')][_0xfb5b('0x33')]);_0x57b3c1['where']=qs[_0xfb5b('0x2c')](_[_0xfb5b('0x34')](_0x3281b5[_0xfb5b('0x2b')],_0x36e376[_0xfb5b('0x2c')]));if(_0x3281b5[_0xfb5b('0x2b')][_0xfb5b('0x35')]){_0x57b3c1[_0xfb5b('0x36')]=_[_0xfb5b('0x37')](_0x57b3c1[_0xfb5b('0x36')],{'$or':_[_0xfb5b('0x38')](_0x2465c1,function(_0x200795){if(_0x200795[_0xfb5b('0x39')][_0xfb5b('0x3a')]!==_0xfb5b('0x3b')){var _0x357c7d={};_0x357c7d[_0x200795[_0xfb5b('0x3c')]]={'$like':'%'+_0x3281b5[_0xfb5b('0x2b')][_0xfb5b('0x35')]+'%'};return _0x357c7d;}})});}_0x57b3c1=_[_0xfb5b('0x37')]({},_0x57b3c1,_0x3281b5[_0xfb5b('0x3d')]);var _0x474c2f={'where':_0x57b3c1[_0xfb5b('0x36')]};return db['VoiceMail'][_0xfb5b('0x1a')](_0x474c2f)[_0xfb5b('0x21')](function(_0xb6d303){_0x494b04[_0xfb5b('0x1a')]=_0xb6d303;if(_0x3281b5[_0xfb5b('0x2b')][_0xfb5b('0x3e')]){_0x57b3c1[_0xfb5b('0x3f')]=[{'all':!![]}];}return db[_0xfb5b('0x27')][_0xfb5b('0x40')](_0x57b3c1);})['then'](function(_0x4ed7e7){_0x494b04[_0xfb5b('0x41')]=_0x4ed7e7;return _0x494b04;})[_0xfb5b('0x21')](respondWithFilteredResult(_0x1bd64b,_0x57b3c1))['catch'](handleError(_0x1bd64b,null));};exports[_0xfb5b('0x42')]=function(_0x3423bf,_0x347979){var _0x3336cd={'raw':!![],'where':{'id':_0x3423bf['params']['id']}},_0x10fb2b={};_0x10fb2b[_0xfb5b('0x29')]=_[_0xfb5b('0x2a')](db['VoiceMail'][_0xfb5b('0x28')]);_0x10fb2b[_0xfb5b('0x2b')]=_[_0xfb5b('0x2a')](_0x3423bf['query']);_0x10fb2b[_0xfb5b('0x2c')]=_[_0xfb5b('0x2d')](_0x10fb2b[_0xfb5b('0x29')],_0x10fb2b['query']);_0x3336cd[_0xfb5b('0x2f')]=_[_0xfb5b('0x2d')](_0x10fb2b[_0xfb5b('0x29')],qs[_0xfb5b('0x2e')](_0x3423bf[_0xfb5b('0x2b')][_0xfb5b('0x2e')]));_0x3336cd['attributes']=_0x3336cd[_0xfb5b('0x2f')][_0xfb5b('0x30')]?_0x3336cd[_0xfb5b('0x2f')]:_0x10fb2b[_0xfb5b('0x29')];if(_0x3423bf[_0xfb5b('0x2b')]['includeAll']){_0x3336cd[_0xfb5b('0x3f')]=[{'all':!![]}];}_0x3336cd=_[_0xfb5b('0x37')]({},_0x3336cd,_0x3423bf[_0xfb5b('0x3d')]);return db[_0xfb5b('0x27')][_0xfb5b('0x43')](_0x3336cd)[_0xfb5b('0x21')](handleEntityNotFound(_0x347979,null))[_0xfb5b('0x21')](respondWithResult(_0x347979,null))[_0xfb5b('0x44')](handleError(_0x347979,null));};exports[_0xfb5b('0x45')]=function(_0xa543f8,_0x167378){return db[_0xfb5b('0x27')][_0xfb5b('0x45')](_0xa543f8[_0xfb5b('0x46')],{})[_0xfb5b('0x21')](function(_0x200c97){var _0x40c4f0=_0xa543f8[_0xfb5b('0x47')][_0xfb5b('0x48')]({'plain':!![]});if(!_0x40c4f0)throw new Error(_0xfb5b('0x49'));if(_0x40c4f0[_0xfb5b('0x4a')]===_0xfb5b('0x47')){var _0x2ccdeb=_0x200c97[_0xfb5b('0x48')]({'plain':!![]});var _0x156acf='Voicemails';return db[_0xfb5b('0x4b')]['find']({'where':{'name':_0x156acf,'userProfileId':_0x40c4f0[_0xfb5b('0x4c')]},'raw':!![]})[_0xfb5b('0x21')](function(_0x7e1a38){if(_0x7e1a38&&_0x7e1a38['autoAssociation']===0x0){return db[_0xfb5b('0x4d')][_0xfb5b('0x45')]({'name':_0x2ccdeb['name'],'resourceId':_0x2ccdeb['id'],'type':_0x7e1a38[_0xfb5b('0x24')],'sectionId':_0x7e1a38['id']},{})[_0xfb5b('0x21')](function(){return _0x200c97;});}else{return _0x200c97;}})['catch'](function(_0x461b69){logger[_0xfb5b('0x4e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x461b69);throw _0x461b69;});}return _0x200c97;})[_0xfb5b('0x21')](respondWithResult(_0x167378,0xc9))['catch'](handleError(_0x167378,null));};exports[_0xfb5b('0x20')]=function(_0x321815,_0x63be51){if(_0x321815['body']['id']){delete _0x321815[_0xfb5b('0x46')]['id'];}return db[_0xfb5b('0x27')][_0xfb5b('0x43')]({'where':{'id':_0x321815['params']['id']}})[_0xfb5b('0x21')](handleEntityNotFound(_0x63be51,null))[_0xfb5b('0x21')](saveUpdates(_0x321815[_0xfb5b('0x46')],null))[_0xfb5b('0x21')](respondWithResult(_0x63be51,null))[_0xfb5b('0x44')](handleError(_0x63be51,null));};exports[_0xfb5b('0x23')]=function(_0x58195a,_0x44980f){return db[_0xfb5b('0x27')][_0xfb5b('0x43')]({'where':{'id':_0x58195a[_0xfb5b('0x4f')]['id']}})[_0xfb5b('0x21')](handleEntityNotFound(_0x44980f,null))[_0xfb5b('0x21')](removeEntity(_0x44980f,null))[_0xfb5b('0x44')](handleError(_0x44980f,null));};exports[_0xfb5b('0x50')]=function(_0x2046d7,_0x3b892a,_0x4d3ed2){return db[_0xfb5b('0x27')][_0xfb5b('0x51')]({'where':{'id':_0x2046d7[_0xfb5b('0x4f')]['id']}})[_0xfb5b('0x21')](handleEntityNotFound(_0x3b892a,null))[_0xfb5b('0x21')](function(_0x3fe20c){var _0x228421;var _0x42eb65={},_0x9d56dc={};_0x9d56dc[_0xfb5b('0x29')]=_[_0xfb5b('0x2a')](db[_0xfb5b('0x52')][_0xfb5b('0x28')]);_0x9d56dc['query']=_['keys'](_0x2046d7[_0xfb5b('0x2b')]);_0x9d56dc[_0xfb5b('0x2c')]=_[_0xfb5b('0x2d')](_0x9d56dc[_0xfb5b('0x29')],_0x9d56dc['query']);_0x42eb65[_0xfb5b('0x2f')]=_[_0xfb5b('0x2d')](_0x9d56dc[_0xfb5b('0x29')],qs[_0xfb5b('0x2e')](_0x2046d7[_0xfb5b('0x2b')][_0xfb5b('0x2e')]));_0x42eb65['attributes']=_0x42eb65['attributes'][_0xfb5b('0x30')]?_0x42eb65['attributes']:_0x9d56dc[_0xfb5b('0x29')];if(!_0x2046d7[_0xfb5b('0x2b')][_0xfb5b('0x31')](_0xfb5b('0x53'))){_0x42eb65[_0xfb5b('0x1c')]=qs[_0xfb5b('0x1c')](_0x2046d7[_0xfb5b('0x2b')][_0xfb5b('0x1c')]);_0x42eb65[_0xfb5b('0x1b')]=qs[_0xfb5b('0x1b')](_0x2046d7[_0xfb5b('0x2b')][_0xfb5b('0x1b')]);}_0x42eb65[_0xfb5b('0x32')]=qs[_0xfb5b('0x33')](_0x2046d7['query'][_0xfb5b('0x33')]);_0x42eb65[_0xfb5b('0x36')]=qs['filters'](_[_0xfb5b('0x34')](_0x2046d7[_0xfb5b('0x2b')],_0x9d56dc[_0xfb5b('0x2c')]));if(_0x2046d7[_0xfb5b('0x2b')][_0xfb5b('0x35')]){_0x42eb65['where']=_['merge'](_0x42eb65[_0xfb5b('0x36')],{'$or':_[_0xfb5b('0x38')](_0x42eb65[_0xfb5b('0x2f')],function(_0x3b3d4d){var _0x383fe2={};_0x383fe2[_0x3b3d4d]={'$like':'%'+_0x2046d7[_0xfb5b('0x2b')][_0xfb5b('0x35')]+'%'};return _0x383fe2;})});}_0x42eb65[_0xfb5b('0x36')]=_[_0xfb5b('0x37')](_0x42eb65[_0xfb5b('0x36')],{'mailboxuser':_0x3fe20c['mailbox']});_0x42eb65=_[_0xfb5b('0x37')]({},_0x42eb65,_0x2046d7[_0xfb5b('0x3d')]);return db[_0xfb5b('0x52')][_0xfb5b('0x54')](_0x42eb65)[_0xfb5b('0x21')](respondWithFilteredResult(_0x3b892a,_0x42eb65));})[_0xfb5b('0x44')](handleError(_0x3b892a,null));}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.model.js b/server/api/voiceMail/voiceMail.model.js index 257fb16..809d8f8 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 _0xbcc2=['VoiceMail','voice_voicemail','mailbox_context','context','lodash','../../config/logger','moment','bluebird','rimraf','../../config/environment','./voiceMail.attributes','exports','define'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xbcc2,0x93));var _0x2bcc=function(_0x372fb1,_0x26a1c5){_0x372fb1=_0x372fb1-0x0;var _0x43790d=_0xbcc2[_0x372fb1];return _0x43790d;};'use strict';var _=require(_0x2bcc('0x0'));var util=require('util');var logger=require(_0x2bcc('0x1'))('api');var moment=require(_0x2bcc('0x2'));var BPromise=require(_0x2bcc('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x2bcc('0x4'));var config=require(_0x2bcc('0x5'));var attributes=require(_0x2bcc('0x6'));module[_0x2bcc('0x7')]=function(_0x5615d9,_0x1148ba){return _0x5615d9[_0x2bcc('0x8')](_0x2bcc('0x9'),attributes,{'tableName':_0x2bcc('0xa'),'paranoid':![],'indexes':[{'name':_0x2bcc('0xb'),'fields':['mailbox',_0x2bcc('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xd7ac=['api','moment','request-promise','path','./voiceMail.attributes','exports','define','VoiceMail','voice_voicemail','mailbox_context','context','lodash'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd7ac,0x167));var _0xcd7a=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0xd7ac[_0x59ee6f];return _0x4c0979;};'use strict';var _=require(_0xcd7a('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xcd7a('0x1'));var moment=require(_0xcd7a('0x2'));var BPromise=require('bluebird');var rp=require(_0xcd7a('0x3'));var fs=require('fs');var path=require(_0xcd7a('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xcd7a('0x5'));module[_0xcd7a('0x6')]=function(_0x256150,_0x4c3dc2){return _0x256150[_0xcd7a('0x7')](_0xcd7a('0x8'),attributes,{'tableName':_0xcd7a('0x9'),'paranoid':![],'indexes':[{'name':_0xcd7a('0xa'),'fields':['mailbox',_0xcd7a('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.rpc.js b/server/api/voiceMail/voiceMail.rpc.js index e0f6f9f..477678a 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 _0xefe8=['result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','code','VoiceMail,\x20%s,\x20%s','error','message'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xefe8,0x189));var _0x8efe=function(_0x36fc1f,_0x27c1c8){_0x36fc1f=_0x36fc1f-0x0;var _0x371281=_0xefe8[_0x36fc1f];return _0x371281;};'use strict';var _=require(_0x8efe('0x0'));var util=require(_0x8efe('0x1'));var moment=require(_0x8efe('0x2'));var BPromise=require(_0x8efe('0x3'));var rs=require(_0x8efe('0x4'));var fs=require('fs');var Redis=require(_0x8efe('0x5'));var db=require(_0x8efe('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x8efe('0x7'))(_0x8efe('0x8'));var config=require(_0x8efe('0x9'));var jayson=require(_0x8efe('0xa'));var client=jayson[_0x8efe('0xb')][_0x8efe('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1577e4,_0x53eeed,_0x44f20f){return new BPromise(function(_0x27d96b,_0x5c7f1b){return client['request'](_0x1577e4,_0x44f20f)[_0x8efe('0xd')](function(_0x277bdf){logger[_0x8efe('0xe')]('VoiceMail,\x20%s,\x20%s',_0x53eeed,_0x8efe('0xf'));logger[_0x8efe('0x10')]('VoiceMail,\x20%s,\x20%s,\x20%s',_0x53eeed,_0x8efe('0xf'),JSON['stringify'](_0x277bdf));if(_0x277bdf['error']){if(_0x277bdf['error'][_0x8efe('0x11')]===0x1f4){logger['error'](_0x8efe('0x12'),_0x53eeed,_0x277bdf[_0x8efe('0x13')][_0x8efe('0x14')]);return _0x5c7f1b(_0x277bdf[_0x8efe('0x13')][_0x8efe('0x14')]);}logger['error'](_0x8efe('0x12'),_0x53eeed,_0x277bdf[_0x8efe('0x13')][_0x8efe('0x14')]);return _0x27d96b(_0x277bdf[_0x8efe('0x13')][_0x8efe('0x14')]);}else{logger[_0x8efe('0xe')](_0x8efe('0x12'),_0x53eeed,_0x8efe('0xf'));_0x27d96b(_0x277bdf[_0x8efe('0x15')][_0x8efe('0x14')]);}})[_0x8efe('0x16')](function(_0x1a6739){logger['error']('VoiceMail,\x20%s,\x20%s',_0x53eeed,_0x1a6739);_0x5c7f1b(_0x1a6739);});});} \ No newline at end of file +var _0xf7a2=['http','request','then','info','VoiceMail,\x20%s,\x20%s','debug','VoiceMail,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client'];(function(_0x71d2bc,_0x4082f7){var _0x44282d=function(_0x3f7b63){while(--_0x3f7b63){_0x71d2bc['push'](_0x71d2bc['shift']());}};_0x44282d(++_0x4082f7);}(_0xf7a2,0x12c));var _0x2f7a=function(_0x34ad72,_0x1e43f6){_0x34ad72=_0x34ad72-0x0;var _0x5c9aa8=_0xf7a2[_0x34ad72];return _0x5c9aa8;};'use strict';var _=require(_0x2f7a('0x0'));var util=require(_0x2f7a('0x1'));var moment=require(_0x2f7a('0x2'));var BPromise=require(_0x2f7a('0x3'));var rs=require(_0x2f7a('0x4'));var fs=require('fs');var Redis=require(_0x2f7a('0x5'));var db=require(_0x2f7a('0x6'))['db'];var utils=require(_0x2f7a('0x7'));var logger=require('../../config/logger')(_0x2f7a('0x8'));var config=require(_0x2f7a('0x9'));var jayson=require(_0x2f7a('0xa'));var client=jayson[_0x2f7a('0xb')][_0x2f7a('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x6d489d,_0x49a269,_0x49856a){return new BPromise(function(_0x19f7f,_0x3e653e){return client[_0x2f7a('0xd')](_0x6d489d,_0x49856a)[_0x2f7a('0xe')](function(_0x37942e){logger[_0x2f7a('0xf')](_0x2f7a('0x10'),_0x49a269,'request\x20sent');logger[_0x2f7a('0x11')](_0x2f7a('0x12'),_0x49a269,_0x2f7a('0x13'),JSON[_0x2f7a('0x14')](_0x37942e));if(_0x37942e[_0x2f7a('0x15')]){if(_0x37942e['error']['code']===0x1f4){logger['error']('VoiceMail,\x20%s,\x20%s',_0x49a269,_0x37942e[_0x2f7a('0x15')][_0x2f7a('0x16')]);return _0x3e653e(_0x37942e[_0x2f7a('0x15')][_0x2f7a('0x16')]);}logger['error'](_0x2f7a('0x10'),_0x49a269,_0x37942e[_0x2f7a('0x15')][_0x2f7a('0x16')]);return _0x19f7f(_0x37942e['error'][_0x2f7a('0x16')]);}else{logger[_0x2f7a('0xf')](_0x2f7a('0x10'),_0x49a269,'request\x20sent');_0x19f7f(_0x37942e['result'][_0x2f7a('0x16')]);}})[_0x2f7a('0x17')](function(_0x214d85){logger[_0x2f7a('0x15')](_0x2f7a('0x10'),_0x49a269,_0x214d85);_0x3e653e(_0x214d85);});});} \ No newline at end of file diff --git a/server/api/voiceMailMessage/index.js b/server/api/voiceMailMessage/index.js index cd37b66..2118504 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 _0xe14b=['update','destroy','exports','multer','util','express','Router','../../components/interaction/service','get','isAuthenticated','index','/:id','show','download','post','create'];(function(_0x4fb73e,_0x17f37d){var _0x14de68=function(_0xf5eeed){while(--_0xf5eeed){_0x4fb73e['push'](_0x4fb73e['shift']());}};_0x14de68(++_0x17f37d);}(_0xe14b,0x93));var _0xbe14=function(_0x541560,_0x22797b){_0x541560=_0x541560-0x0;var _0x3d4841=_0xe14b[_0x541560];return _0x3d4841;};'use strict';var multer=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xbe14('0x2'));var router=express[_0xbe14('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0xbe14('0x4'));var config=require('../../config/environment');var controller=require('./voiceMailMessage.controller');router[_0xbe14('0x5')]('/',auth[_0xbe14('0x6')](),controller[_0xbe14('0x7')]);router[_0xbe14('0x5')](_0xbe14('0x8'),auth[_0xbe14('0x6')](),controller[_0xbe14('0x9')]);router['get']('/:id/download',auth['isAuthenticated'](),controller[_0xbe14('0xa')]);router[_0xbe14('0xb')]('/',auth[_0xbe14('0x6')](),controller[_0xbe14('0xc')]);router['put']('/:id',auth[_0xbe14('0x6')](),controller[_0xbe14('0xd')]);router['delete'](_0xbe14('0x8'),auth[_0xbe14('0x6')](),controller[_0xbe14('0xe')]);module[_0xbe14('0xf')]=router; \ No newline at end of file +var _0xda19=['index','/:id','show','post','create','put','update','delete','exports','util','path','express','../../components/auth/service','../../config/environment','./voiceMailMessage.controller','get','isAuthenticated'];(function(_0x13cfcf,_0x20efaa){var _0x36e7b6=function(_0xbff6){while(--_0xbff6){_0x13cfcf['push'](_0x13cfcf['shift']());}};_0x36e7b6(++_0x20efaa);}(_0xda19,0xd5));var _0x9da1=function(_0x401f0d,_0xbbe33c){_0x401f0d=_0x401f0d-0x0;var _0x32497e=_0xda19[_0x401f0d];return _0x32497e;};'use strict';var multer=require('multer');var util=require(_0x9da1('0x0'));var path=require(_0x9da1('0x1'));var timeout=require('connect-timeout');var express=require(_0x9da1('0x2'));var router=express['Router']();var auth=require(_0x9da1('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x9da1('0x4'));var controller=require(_0x9da1('0x5'));router[_0x9da1('0x6')]('/',auth[_0x9da1('0x7')](),controller[_0x9da1('0x8')]);router[_0x9da1('0x6')](_0x9da1('0x9'),auth[_0x9da1('0x7')](),controller[_0x9da1('0xa')]);router[_0x9da1('0x6')]('/:id/download',auth['isAuthenticated'](),controller['download']);router[_0x9da1('0xb')]('/',auth['isAuthenticated'](),controller[_0x9da1('0xc')]);router[_0x9da1('0xd')](_0x9da1('0x9'),auth[_0x9da1('0x7')](),controller[_0x9da1('0xe')]);router[_0x9da1('0xf')](_0x9da1('0x9'),auth['isAuthenticated'](),controller['destroy']);module[_0x9da1('0x10')]=router; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.attributes.js b/server/api/voiceMailMessage/voiceMailMessage.attributes.js index d997f4a..f9d7184 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 _0x2646=['VIRTUAL','getDataValue','INTEGER','STRING','BLOB','TIMESTAMP','exports'];(function(_0x2a5f8d,_0x119fda){var _0x1cb5af=function(_0x1a4093){while(--_0x1a4093){_0x2a5f8d['push'](_0x2a5f8d['shift']());}};_0x1cb5af(++_0x119fda);}(_0x2646,0x133));var _0x6264=function(_0x452259,_0x580308){_0x452259=_0x452259-0x0;var _0x192c46=_0x2646[_0x452259];return _0x192c46;};'use strict';var Sequelize=require('sequelize');module[_0x6264('0x0')]={'name':{'type':Sequelize[_0x6264('0x1')],'get':function(_0x5c2694){return this[_0x6264('0x2')]('id');}},'msgnum':{'type':Sequelize[_0x6264('0x3')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0x6264('0x4')],'defaultValue':''},'context':{'type':Sequelize['STRING'],'defaultValue':''},'macrocontext':{'type':Sequelize['STRING'],'defaultValue':''},'callerid':{'type':Sequelize[_0x6264('0x4')],'defaultValue':''},'origtime':{'type':Sequelize[_0x6264('0x4')],'defaultValue':''},'duration':{'type':Sequelize['STRING'],'defaultValue':''},'mailboxuser':{'type':Sequelize['STRING'],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0x6264('0x4')],'defaultValue':''},'recording':{'type':Sequelize[_0x6264('0x5')]('long'),'defaultValue':null},'flag':{'type':Sequelize[_0x6264('0x4')],'defaultValue':''},'msg_id':{'type':Sequelize['STRING'],'defaultValue':''},'stamp':{'type':_0x6264('0x6'),'allowNull':![]}}; \ No newline at end of file +var _0xb41e=['long','TIMESTAMP','sequelize','VIRTUAL','STRING'];(function(_0x2c619f,_0x1a9503){var _0xb8c66a=function(_0x592dcc){while(--_0x592dcc){_0x2c619f['push'](_0x2c619f['shift']());}};_0xb8c66a(++_0x1a9503);}(_0xb41e,0xb6));var _0xeb41=function(_0x5a5c8e,_0xc99b9c){_0x5a5c8e=_0x5a5c8e-0x0;var _0x32db63=_0xb41e[_0x5a5c8e];return _0x32db63;};'use strict';var Sequelize=require(_0xeb41('0x0'));module['exports']={'name':{'type':Sequelize[_0xeb41('0x1')],'get':function(_0x295736){return this['getDataValue']('id');}},'msgnum':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize['STRING'],'defaultValue':''},'context':{'type':Sequelize['STRING'],'defaultValue':''},'macrocontext':{'type':Sequelize['STRING'],'defaultValue':''},'callerid':{'type':Sequelize[_0xeb41('0x2')],'defaultValue':''},'origtime':{'type':Sequelize[_0xeb41('0x2')],'defaultValue':''},'duration':{'type':Sequelize[_0xeb41('0x2')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0xeb41('0x2')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0xeb41('0x2')],'defaultValue':''},'recording':{'type':Sequelize['BLOB'](_0xeb41('0x3')),'defaultValue':null},'flag':{'type':Sequelize['STRING'],'defaultValue':''},'msg_id':{'type':Sequelize['STRING'],'defaultValue':''},'stamp':{'type':_0xeb41('0x4'),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.controller.js b/server/api/voiceMailMessage/voiceMailMessage.controller.js index 781ab4d..9b06fd3 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 _0xb597=['../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','json','offset','limit','set','apply','reject','save','update','then','end','error','stack','name','index','VoiceMailMessage','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','where','pick','merge','map','type','key','VIRTUAL','field','filter','options','count','includeAll','include','findAll','catch','params','create','body','find','download','recording','msg_id','Sequelize','ValidationError','VoiceMailMessage\x20not\x20found','audio/wav','attachment','Content-Disposition','send','html-pdf','eml-format','zip-dir','fast-json-patch','moment','mustache','util','path','sox','ejs','squel','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x4f9b18,_0x2cb5ca){var _0x29f20c=function(_0x268b3d){while(--_0x268b3d){_0x4f9b18['push'](_0x4f9b18['shift']());}};_0x29f20c(++_0x2cb5ca);}(_0xb597,0x178));var _0x7b59=function(_0x1d7466,_0x161771){_0x1d7466=_0x1d7466-0x0;var _0x3ebbb6=_0xb597[_0x1d7466];return _0x3ebbb6;};'use strict';var pdf=require(_0x7b59('0x0'));var emlformat=require(_0x7b59('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x7b59('0x2'));var jsonpatch=require(_0x7b59('0x3'));var rp=require('request-promise');var moment=require(_0x7b59('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x7b59('0x5'));var util=require(_0x7b59('0x6'));var path=require(_0x7b59('0x7'));var sox=require(_0x7b59('0x8'));var csv=require('to-csv');var ejs=require(_0x7b59('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0x7b59('0xa'));var crypto=require('crypto');var jsforce=require(_0x7b59('0xb'));var deskjs=require(_0x7b59('0xc'));var toCsv=require(_0x7b59('0xd'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x7b59('0xe'));var authService=require(_0x7b59('0xf'));var qs=require(_0x7b59('0x10'));var as=require(_0x7b59('0x11'));var hardwareService=require(_0x7b59('0x12'));var logger=require(_0x7b59('0x13'))(_0x7b59('0x14'));var utils=require(_0x7b59('0x15'));var config=require('../../config/environment');var db=require(_0x7b59('0x16'))['db'];function respondWithStatusCode(_0x94cd54,_0x310dfe){_0x310dfe=_0x310dfe||0xcc;return function(_0x14dc69){if(_0x14dc69){return _0x94cd54[_0x7b59('0x17')](_0x310dfe);}return _0x94cd54['status'](_0x310dfe)['end']();};}function respondWithResult(_0x3ddd6a,_0x517e97){_0x517e97=_0x517e97||0xc8;return function(_0x4e29e6){if(_0x4e29e6){return _0x3ddd6a['status'](_0x517e97)[_0x7b59('0x18')](_0x4e29e6);}};}function respondWithFilteredResult(_0x3a8246,_0x2f34c3){return function(_0x53e26b){if(_0x53e26b){var _0x67d78b=_0x53e26b['count'],_0x58eefc=_0x2f34c3['offset'],_0x14ba86=_0x2f34c3[_0x7b59('0x19')]+_0x2f34c3[_0x7b59('0x1a')],_0x32bbc8;if(_0x14ba86>=_0x67d78b){_0x14ba86=_0x67d78b;_0x32bbc8=0xc8;}else{_0x32bbc8=0xce;}_0x3a8246['status'](_0x32bbc8);return _0x3a8246[_0x7b59('0x1b')]('Content-Range',_0x58eefc+'-'+_0x14ba86+'/'+_0x67d78b)['json'](_0x53e26b);}return null;};}function patchUpdates(_0x19042e){return function(_0x1b3c1){try{jsonpatch[_0x7b59('0x1c')](_0x1b3c1,_0x19042e,!![]);}catch(_0x540fd0){return BPromise[_0x7b59('0x1d')](_0x540fd0);}return _0x1b3c1[_0x7b59('0x1e')]();};}function saveUpdates(_0x4cdda0,_0x862c75){return function(_0x281944){if(_0x281944){return _0x281944[_0x7b59('0x1f')](_0x4cdda0)[_0x7b59('0x20')](function(_0xf79873){return _0xf79873;});}return null;};}function removeEntity(_0x4bbf1a,_0x559ad1){return function(_0x2948d1){if(_0x2948d1){return _0x2948d1['destroy']()['then'](function(){_0x4bbf1a['status'](0xcc)[_0x7b59('0x21')]();});}};}function handleEntityNotFound(_0x51fd36,_0x1f77ef){return function(_0x26ada0){if(!_0x26ada0){_0x51fd36[_0x7b59('0x17')](0x194);}return _0x26ada0;};}function handleError(_0x23a17f,_0x8ee7d1){_0x8ee7d1=_0x8ee7d1||0x1f4;return function(_0x4efd1e){logger[_0x7b59('0x22')](_0x4efd1e[_0x7b59('0x23')]);if(_0x4efd1e[_0x7b59('0x24')]){delete _0x4efd1e[_0x7b59('0x24')];}_0x23a17f['status'](_0x8ee7d1)['send'](_0x4efd1e);};}exports[_0x7b59('0x25')]=function(_0x1105b2,_0x5c5a9c){var _0x5a0bde={},_0x4af859={},_0x20ccb7={'count':0x0,'rows':[]};var _0x163c39=db[_0x7b59('0x26')]['rawAttributes'];_0x4af859[_0x7b59('0x27')]=_['differenceBy'](_[_0x7b59('0x28')](_0x163c39),[_0x7b59('0x24')]);_0x4af859[_0x7b59('0x29')]=_[_0x7b59('0x28')](_0x1105b2[_0x7b59('0x29')]);_0x4af859[_0x7b59('0x2a')]=_[_0x7b59('0x2b')](_0x4af859[_0x7b59('0x27')],_0x4af859[_0x7b59('0x29')]);_0x5a0bde['attributes']=_[_0x7b59('0x2b')](_0x4af859[_0x7b59('0x27')],qs[_0x7b59('0x2c')](_0x1105b2[_0x7b59('0x29')][_0x7b59('0x2c')]));_0x5a0bde[_0x7b59('0x2d')]=_0x5a0bde['attributes'][_0x7b59('0x2e')]?_0x5a0bde[_0x7b59('0x2d')]:_0x4af859[_0x7b59('0x27')];if(!_0x1105b2[_0x7b59('0x29')][_0x7b59('0x2f')](_0x7b59('0x30'))){_0x5a0bde['limit']=qs[_0x7b59('0x1a')](_0x1105b2['query']['limit']);_0x5a0bde['offset']=qs['offset'](_0x1105b2[_0x7b59('0x29')][_0x7b59('0x19')]);}_0x5a0bde[_0x7b59('0x31')]=qs['sort'](_0x1105b2['query']['sort']);_0x5a0bde[_0x7b59('0x32')]=qs['filters'](_[_0x7b59('0x33')](_0x1105b2[_0x7b59('0x29')],_0x4af859[_0x7b59('0x2a')]));if(_0x1105b2[_0x7b59('0x29')]['filter']){_0x5a0bde[_0x7b59('0x32')]=_[_0x7b59('0x34')](_0x5a0bde[_0x7b59('0x32')],{'$or':_[_0x7b59('0x35')](_0x163c39,function(_0x3cab70){if(_0x3cab70[_0x7b59('0x36')][_0x7b59('0x37')]!==_0x7b59('0x38')){var _0x129e65={};_0x129e65[_0x3cab70[_0x7b59('0x39')]]={'$like':'%'+_0x1105b2['query'][_0x7b59('0x3a')]+'%'};return _0x129e65;}})});}_0x5a0bde=_[_0x7b59('0x34')]({},_0x5a0bde,_0x1105b2[_0x7b59('0x3b')]);var _0x4965b6={'where':_0x5a0bde[_0x7b59('0x32')]};return db[_0x7b59('0x26')]['count'](_0x4965b6)['then'](function(_0xced612){_0x20ccb7[_0x7b59('0x3c')]=_0xced612;if(_0x1105b2[_0x7b59('0x29')][_0x7b59('0x3d')]){_0x5a0bde[_0x7b59('0x3e')]=[{'all':!![]}];}return db[_0x7b59('0x26')][_0x7b59('0x3f')](_0x5a0bde);})[_0x7b59('0x20')](function(_0x81ad4f){_0x20ccb7['rows']=_0x81ad4f;return _0x20ccb7;})[_0x7b59('0x20')](respondWithFilteredResult(_0x5c5a9c,_0x5a0bde))[_0x7b59('0x40')](handleError(_0x5c5a9c,null));};exports['show']=function(_0x344585,_0x2ce4df){var _0x19f191={'raw':!![],'where':{'id':_0x344585[_0x7b59('0x41')]['id']}},_0x636357={};_0x636357[_0x7b59('0x27')]=_[_0x7b59('0x28')](db[_0x7b59('0x26')]['rawAttributes']);_0x636357['query']=_[_0x7b59('0x28')](_0x344585[_0x7b59('0x29')]);_0x636357['filters']=_[_0x7b59('0x2b')](_0x636357[_0x7b59('0x27')],_0x636357[_0x7b59('0x29')]);_0x19f191[_0x7b59('0x2d')]=_[_0x7b59('0x2b')](_0x636357[_0x7b59('0x27')],qs[_0x7b59('0x2c')](_0x344585['query'][_0x7b59('0x2c')]));_0x19f191['attributes']=_0x19f191[_0x7b59('0x2d')][_0x7b59('0x2e')]?_0x19f191['attributes']:_0x636357['model'];if(_0x344585['query'][_0x7b59('0x3d')]){_0x19f191[_0x7b59('0x3e')]=[{'all':!![]}];}_0x19f191=_[_0x7b59('0x34')]({},_0x19f191,_0x344585['options']);return db[_0x7b59('0x26')]['find'](_0x19f191)['then'](handleEntityNotFound(_0x2ce4df,null))['then'](respondWithResult(_0x2ce4df,null))['catch'](handleError(_0x2ce4df,null));};exports[_0x7b59('0x42')]=function(_0x12a757,_0x143fbd){return db[_0x7b59('0x26')]['create'](_0x12a757[_0x7b59('0x43')],{})['then'](respondWithResult(_0x143fbd,0xc9))['catch'](handleError(_0x143fbd,null));};exports[_0x7b59('0x1f')]=function(_0x2057f4,_0x5d9443){if(_0x2057f4['body']['id']){delete _0x2057f4['body']['id'];}return db['VoiceMailMessage'][_0x7b59('0x44')]({'where':{'id':_0x2057f4['params']['id']}})[_0x7b59('0x20')](handleEntityNotFound(_0x5d9443,null))['then'](saveUpdates(_0x2057f4[_0x7b59('0x43')],null))[_0x7b59('0x20')](respondWithResult(_0x5d9443,null))[_0x7b59('0x40')](handleError(_0x5d9443,null));};exports['destroy']=function(_0x556df9,_0x2d60ec){return db[_0x7b59('0x26')][_0x7b59('0x44')]({'where':{'id':_0x556df9['params']['id']}})[_0x7b59('0x20')](handleEntityNotFound(_0x2d60ec,null))[_0x7b59('0x20')](removeEntity(_0x2d60ec,null))[_0x7b59('0x40')](handleError(_0x2d60ec,null));};exports[_0x7b59('0x45')]=function(_0x5d2e13,_0xba1358,_0x44b3a7){return db[_0x7b59('0x26')][_0x7b59('0x44')]({'where':{'id':_0x5d2e13[_0x7b59('0x41')]['id']},'attributes':['id',_0x7b59('0x46'),_0x7b59('0x47')]})[_0x7b59('0x20')](handleEntityNotFound(_0xba1358,null))[_0x7b59('0x20')](function(_0x15e2bd){if(_0x15e2bd){if(!_0x15e2bd[_0x7b59('0x46')]){throw new db[(_0x7b59('0x48'))][(_0x7b59('0x49'))](_0x7b59('0x4a'));}var _0x3e9651={'Content-Type':_0x7b59('0x4b'),'Content-Disposition':_0x7b59('0x4c')};if(_0x15e2bd[_0x7b59('0x47')]){_0x3e9651[_0x7b59('0x4d')]='attachment;\x20filename=\x22'+_0x15e2bd[_0x7b59('0x47')]+'.wav\x22';}_0xba1358[_0x7b59('0x1b')](_0x3e9651);return _0xba1358[_0x7b59('0x4e')](new Buffer(_0x15e2bd['recording']));}})[_0x7b59('0x40')](handleError(_0xba1358,null));}; \ No newline at end of file +var _0x6947=['filter','map','type','key','VIRTUAL','options','then','includeAll','include','findAll','rows','rawAttributes','fields','merge','find','catch','create','body','params','download','recording','msg_id','Sequelize','VoiceMailMessage\x20not\x20found','attachment','Content-Disposition','.wav\x22','html-pdf','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','count','offset','limit','set','Content-Range','json','apply','reject','save','update','destroy','sendStatus','error','stack','name','VoiceMailMessage','model','keys','query','filters','attributes','intersection','length','hasOwnProperty','order','sort','where','pick'];(function(_0x36049a,_0x58f6ec){var _0x5001ce=function(_0x223299){while(--_0x223299){_0x36049a['push'](_0x36049a['shift']());}};_0x5001ce(++_0x58f6ec);}(_0x6947,0x1ba));var _0x7694=function(_0x357b85,_0x50dace){_0x357b85=_0x357b85-0x0;var _0x5aa2ae=_0x6947[_0x357b85];return _0x5aa2ae;};'use strict';var pdf=require(_0x7694('0x0'));var emlformat=require(_0x7694('0x1'));var rimraf=require(_0x7694('0x2'));var zipdir=require(_0x7694('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7694('0x4'));var moment=require('moment');var BPromise=require(_0x7694('0x5'));var Mustache=require(_0x7694('0x6'));var util=require(_0x7694('0x7'));var path=require(_0x7694('0x8'));var sox=require(_0x7694('0x9'));var csv=require(_0x7694('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x7694('0xb'));var squel=require(_0x7694('0xc'));var crypto=require(_0x7694('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x7694('0xe'));var toCsv=require(_0x7694('0xa'));var querystring=require(_0x7694('0xf'));var Papa=require(_0x7694('0x10'));var Redis=require(_0x7694('0x11'));var authService=require(_0x7694('0x12'));var qs=require(_0x7694('0x13'));var as=require(_0x7694('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7694('0x15'))(_0x7694('0x16'));var utils=require(_0x7694('0x17'));var config=require(_0x7694('0x18'));var db=require(_0x7694('0x19'))['db'];function respondWithStatusCode(_0x49cc01,_0x1bb6bb){_0x1bb6bb=_0x1bb6bb||0xcc;return function(_0xf6db88){if(_0xf6db88){return _0x49cc01['sendStatus'](_0x1bb6bb);}return _0x49cc01[_0x7694('0x1a')](_0x1bb6bb)[_0x7694('0x1b')]();};}function respondWithResult(_0xf32433,_0x46d153){_0x46d153=_0x46d153||0xc8;return function(_0x2d6c34){if(_0x2d6c34){return _0xf32433[_0x7694('0x1a')](_0x46d153)['json'](_0x2d6c34);}};}function respondWithFilteredResult(_0x5e519f,_0x56a459){return function(_0x46eb1f){if(_0x46eb1f){var _0x111c74=_0x46eb1f[_0x7694('0x1c')],_0x47c4c7=_0x56a459[_0x7694('0x1d')],_0x102b8b=_0x56a459[_0x7694('0x1d')]+_0x56a459[_0x7694('0x1e')],_0x5458ab;if(_0x102b8b>=_0x111c74){_0x102b8b=_0x111c74;_0x5458ab=0xc8;}else{_0x5458ab=0xce;}_0x5e519f[_0x7694('0x1a')](_0x5458ab);return _0x5e519f[_0x7694('0x1f')](_0x7694('0x20'),_0x47c4c7+'-'+_0x102b8b+'/'+_0x111c74)[_0x7694('0x21')](_0x46eb1f);}return null;};}function patchUpdates(_0x69a1c7){return function(_0x484bda){try{jsonpatch[_0x7694('0x22')](_0x484bda,_0x69a1c7,!![]);}catch(_0x572f2b){return BPromise[_0x7694('0x23')](_0x572f2b);}return _0x484bda[_0x7694('0x24')]();};}function saveUpdates(_0x40fca7,_0x53ab67){return function(_0x4335c5){if(_0x4335c5){return _0x4335c5[_0x7694('0x25')](_0x40fca7)['then'](function(_0x484031){return _0x484031;});}return null;};}function removeEntity(_0x140b46,_0x287786){return function(_0x123549){if(_0x123549){return _0x123549[_0x7694('0x26')]()['then'](function(){_0x140b46[_0x7694('0x1a')](0xcc)[_0x7694('0x1b')]();});}};}function handleEntityNotFound(_0x32a590,_0x33a690){return function(_0x31de0d){if(!_0x31de0d){_0x32a590[_0x7694('0x27')](0x194);}return _0x31de0d;};}function handleError(_0x9cd55d,_0x17b6c0){_0x17b6c0=_0x17b6c0||0x1f4;return function(_0x23ed42){logger[_0x7694('0x28')](_0x23ed42[_0x7694('0x29')]);if(_0x23ed42[_0x7694('0x2a')]){delete _0x23ed42[_0x7694('0x2a')];}_0x9cd55d[_0x7694('0x1a')](_0x17b6c0)['send'](_0x23ed42);};}exports['index']=function(_0x307953,_0x31ae84){var _0x1ff2c6={},_0x40ad55={},_0x1f0756={'count':0x0,'rows':[]};var _0x435c04=db[_0x7694('0x2b')]['rawAttributes'];_0x40ad55[_0x7694('0x2c')]=_['differenceBy'](_[_0x7694('0x2d')](_0x435c04),[_0x7694('0x2a')]);_0x40ad55[_0x7694('0x2e')]=_[_0x7694('0x2d')](_0x307953[_0x7694('0x2e')]);_0x40ad55[_0x7694('0x2f')]=_['intersection'](_0x40ad55[_0x7694('0x2c')],_0x40ad55['query']);_0x1ff2c6[_0x7694('0x30')]=_[_0x7694('0x31')](_0x40ad55['model'],qs['fields'](_0x307953['query']['fields']));_0x1ff2c6[_0x7694('0x30')]=_0x1ff2c6[_0x7694('0x30')][_0x7694('0x32')]?_0x1ff2c6[_0x7694('0x30')]:_0x40ad55[_0x7694('0x2c')];if(!_0x307953[_0x7694('0x2e')][_0x7694('0x33')]('nolimit')){_0x1ff2c6[_0x7694('0x1e')]=qs['limit'](_0x307953[_0x7694('0x2e')][_0x7694('0x1e')]);_0x1ff2c6[_0x7694('0x1d')]=qs[_0x7694('0x1d')](_0x307953[_0x7694('0x2e')]['offset']);}_0x1ff2c6[_0x7694('0x34')]=qs[_0x7694('0x35')](_0x307953['query'][_0x7694('0x35')]);_0x1ff2c6[_0x7694('0x36')]=qs[_0x7694('0x2f')](_[_0x7694('0x37')](_0x307953[_0x7694('0x2e')],_0x40ad55[_0x7694('0x2f')]));if(_0x307953['query'][_0x7694('0x38')]){_0x1ff2c6[_0x7694('0x36')]=_['merge'](_0x1ff2c6[_0x7694('0x36')],{'$or':_[_0x7694('0x39')](_0x435c04,function(_0x21e4fc){if(_0x21e4fc[_0x7694('0x3a')][_0x7694('0x3b')]!==_0x7694('0x3c')){var _0xd86e99={};_0xd86e99[_0x21e4fc['field']]={'$like':'%'+_0x307953[_0x7694('0x2e')][_0x7694('0x38')]+'%'};return _0xd86e99;}})});}_0x1ff2c6=_['merge']({},_0x1ff2c6,_0x307953[_0x7694('0x3d')]);var _0x2078b4={'where':_0x1ff2c6[_0x7694('0x36')]};return db[_0x7694('0x2b')][_0x7694('0x1c')](_0x2078b4)[_0x7694('0x3e')](function(_0x2f3dba){_0x1f0756[_0x7694('0x1c')]=_0x2f3dba;if(_0x307953[_0x7694('0x2e')][_0x7694('0x3f')]){_0x1ff2c6[_0x7694('0x40')]=[{'all':!![]}];}return db[_0x7694('0x2b')][_0x7694('0x41')](_0x1ff2c6);})[_0x7694('0x3e')](function(_0x315547){_0x1f0756[_0x7694('0x42')]=_0x315547;return _0x1f0756;})[_0x7694('0x3e')](respondWithFilteredResult(_0x31ae84,_0x1ff2c6))['catch'](handleError(_0x31ae84,null));};exports['show']=function(_0x8082dd,_0xbb2a77){var _0x401caa={'raw':!![],'where':{'id':_0x8082dd['params']['id']}},_0x517b81={};_0x517b81[_0x7694('0x2c')]=_['keys'](db[_0x7694('0x2b')][_0x7694('0x43')]);_0x517b81['query']=_[_0x7694('0x2d')](_0x8082dd['query']);_0x517b81[_0x7694('0x2f')]=_[_0x7694('0x31')](_0x517b81[_0x7694('0x2c')],_0x517b81[_0x7694('0x2e')]);_0x401caa[_0x7694('0x30')]=_[_0x7694('0x31')](_0x517b81['model'],qs[_0x7694('0x44')](_0x8082dd[_0x7694('0x2e')][_0x7694('0x44')]));_0x401caa[_0x7694('0x30')]=_0x401caa[_0x7694('0x30')][_0x7694('0x32')]?_0x401caa['attributes']:_0x517b81['model'];if(_0x8082dd[_0x7694('0x2e')]['includeAll']){_0x401caa['include']=[{'all':!![]}];}_0x401caa=_[_0x7694('0x45')]({},_0x401caa,_0x8082dd[_0x7694('0x3d')]);return db[_0x7694('0x2b')][_0x7694('0x46')](_0x401caa)[_0x7694('0x3e')](handleEntityNotFound(_0xbb2a77,null))[_0x7694('0x3e')](respondWithResult(_0xbb2a77,null))[_0x7694('0x47')](handleError(_0xbb2a77,null));};exports[_0x7694('0x48')]=function(_0x4a296d,_0x2d78e1){return db[_0x7694('0x2b')]['create'](_0x4a296d[_0x7694('0x49')],{})[_0x7694('0x3e')](respondWithResult(_0x2d78e1,0xc9))[_0x7694('0x47')](handleError(_0x2d78e1,null));};exports[_0x7694('0x25')]=function(_0x387e47,_0x1fdfc3){if(_0x387e47['body']['id']){delete _0x387e47[_0x7694('0x49')]['id'];}return db['VoiceMailMessage'][_0x7694('0x46')]({'where':{'id':_0x387e47[_0x7694('0x4a')]['id']}})[_0x7694('0x3e')](handleEntityNotFound(_0x1fdfc3,null))['then'](saveUpdates(_0x387e47[_0x7694('0x49')],null))['then'](respondWithResult(_0x1fdfc3,null))['catch'](handleError(_0x1fdfc3,null));};exports[_0x7694('0x26')]=function(_0xc314de,_0x37c0db){return db[_0x7694('0x2b')]['find']({'where':{'id':_0xc314de['params']['id']}})[_0x7694('0x3e')](handleEntityNotFound(_0x37c0db,null))[_0x7694('0x3e')](removeEntity(_0x37c0db,null))['catch'](handleError(_0x37c0db,null));};exports[_0x7694('0x4b')]=function(_0x291ab5,_0x2eabed,_0x263cf0){return db[_0x7694('0x2b')][_0x7694('0x46')]({'where':{'id':_0x291ab5[_0x7694('0x4a')]['id']},'attributes':['id',_0x7694('0x4c'),_0x7694('0x4d')]})[_0x7694('0x3e')](handleEntityNotFound(_0x2eabed,null))['then'](function(_0x11edc7){if(_0x11edc7){if(!_0x11edc7[_0x7694('0x4c')]){throw new db[(_0x7694('0x4e'))]['ValidationError'](_0x7694('0x4f'));}var _0x17376e={'Content-Type':'audio/wav','Content-Disposition':_0x7694('0x50')};if(_0x11edc7[_0x7694('0x4d')]){_0x17376e[_0x7694('0x51')]='attachment;\x20filename=\x22'+_0x11edc7[_0x7694('0x4d')]+_0x7694('0x52');}_0x2eabed['set'](_0x17376e);return _0x2eabed['send'](new Buffer(_0x11edc7['recording']));}})['catch'](handleError(_0x2eabed,null));}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.model.js b/server/api/voiceMailMessage/voiceMailMessage.model.js index c592fa6..b0c4958 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 _0x9171=['dir','lodash','api','bluebird','rimraf','./voiceMailMessage.attributes','exports','define','VoiceMailMessage','voice_voicemail_messages'];(function(_0x19e08e,_0x178f46){var _0x14c229=function(_0x791b3b){while(--_0x791b3b){_0x19e08e['push'](_0x19e08e['shift']());}};_0x14c229(++_0x178f46);}(_0x9171,0x12d));var _0x1917=function(_0x170723,_0x1c4191){_0x170723=_0x170723-0x0;var _0x589561=_0x9171[_0x170723];return _0x589561;};'use strict';var _=require(_0x1917('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x1917('0x1'));var moment=require('moment');var BPromise=require(_0x1917('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x1917('0x3'));var config=require('../../config/environment');var attributes=require(_0x1917('0x4'));module[_0x1917('0x5')]=function(_0x5af027,_0xa94784){return _0x5af027[_0x1917('0x6')](_0x1917('0x7'),attributes,{'tableName':_0x1917('0x8'),'paranoid':![],'indexes':[{'name':'dir','fields':[_0x1917('0x9')]}],'timestamps':![]});}; \ No newline at end of file +var _0x9b2d=['./voiceMailMessage.attributes','exports','define','voice_voicemail_messages','lodash','util','../../config/logger','api','request-promise','path','../../config/environment'];(function(_0x23e6bb,_0x5c2d69){var _0x1e3b4c=function(_0x1afc46){while(--_0x1afc46){_0x23e6bb['push'](_0x23e6bb['shift']());}};_0x1e3b4c(++_0x5c2d69);}(_0x9b2d,0x1d2));var _0xd9b2=function(_0x465b9a,_0x63e455){_0x465b9a=_0x465b9a-0x0;var _0x4414da=_0x9b2d[_0x465b9a];return _0x4414da;};'use strict';var _=require(_0xd9b2('0x0'));var util=require(_0xd9b2('0x1'));var logger=require(_0xd9b2('0x2'))(_0xd9b2('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xd9b2('0x4'));var fs=require('fs');var path=require(_0xd9b2('0x5'));var rimraf=require('rimraf');var config=require(_0xd9b2('0x6'));var attributes=require(_0xd9b2('0x7'));module[_0xd9b2('0x8')]=function(_0x1dc329,_0x4ea965){return _0x1dc329[_0xd9b2('0x9')]('VoiceMailMessage',attributes,{'tableName':_0xd9b2('0xa'),'paranoid':![],'indexes':[{'name':'dir','fields':['dir']}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.rpc.js b/server/api/voiceMailMessage/voiceMailMessage.rpc.js index 07ab02f..4b10bc2 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 _0x14a0=['../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','then','debug','request\x20sent','stringify','error','code','VoiceMailMessage,\x20%s,\x20%s','message','info','result','catch','util','moment','bluebird','randomstring','ioredis'];(function(_0x3b37d0,_0x5e3d41){var _0x4987b6=function(_0xd63e1c){while(--_0xd63e1c){_0x3b37d0['push'](_0x3b37d0['shift']());}};_0x4987b6(++_0x5e3d41);}(_0x14a0,0x8e));var _0x014a=function(_0x1c1f5a,_0x5f2383){_0x1c1f5a=_0x1c1f5a-0x0;var _0x505066=_0x14a0[_0x1c1f5a];return _0x505066;};'use strict';var _=require('lodash');var util=require(_0x014a('0x0'));var moment=require(_0x014a('0x1'));var BPromise=require(_0x014a('0x2'));var rs=require(_0x014a('0x3'));var fs=require('fs');var Redis=require(_0x014a('0x4'));var db=require(_0x014a('0x5'))['db'];var utils=require(_0x014a('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x014a('0x7'));var jayson=require(_0x014a('0x8'));var client=jayson[_0x014a('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5a61ac,_0x11b8ce,_0x6d05f2){return new BPromise(function(_0x22f17c,_0x4d943b){return client['request'](_0x5a61ac,_0x6d05f2)[_0x014a('0xa')](function(_0x4f5506){logger['info']('VoiceMailMessage,\x20%s,\x20%s',_0x11b8ce,'request\x20sent');logger[_0x014a('0xb')]('VoiceMailMessage,\x20%s,\x20%s,\x20%s',_0x11b8ce,_0x014a('0xc'),JSON[_0x014a('0xd')](_0x4f5506));if(_0x4f5506['error']){if(_0x4f5506[_0x014a('0xe')][_0x014a('0xf')]===0x1f4){logger[_0x014a('0xe')](_0x014a('0x10'),_0x11b8ce,_0x4f5506[_0x014a('0xe')][_0x014a('0x11')]);return _0x4d943b(_0x4f5506[_0x014a('0xe')][_0x014a('0x11')]);}logger[_0x014a('0xe')](_0x014a('0x10'),_0x11b8ce,_0x4f5506[_0x014a('0xe')][_0x014a('0x11')]);return _0x22f17c(_0x4f5506['error'][_0x014a('0x11')]);}else{logger[_0x014a('0x12')]('VoiceMailMessage,\x20%s,\x20%s',_0x11b8ce,_0x014a('0xc'));_0x22f17c(_0x4f5506[_0x014a('0x13')]['message']);}})[_0x014a('0x14')](function(_0x17e4be){logger[_0x014a('0xe')](_0x014a('0x10'),_0x11b8ce,_0x17e4be);_0x4d943b(_0x17e4be);});});} \ No newline at end of file +var _0x1a85=['../../config/logger','rpc','jayson/promise','http','info','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','debug','VoiceMailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','../../config/utils'];(function(_0x38ca0c,_0x5a502e){var _0xaf186=function(_0x17a3f2){while(--_0x17a3f2){_0x38ca0c['push'](_0x38ca0c['shift']());}};_0xaf186(++_0x5a502e);}(_0x1a85,0x178));var _0x51a8=function(_0x576e92,_0x165314){_0x576e92=_0x576e92-0x0;var _0x24c32e=_0x1a85[_0x576e92];return _0x24c32e;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x51a8('0x0'));var BPromise=require(_0x51a8('0x1'));var rs=require(_0x51a8('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x51a8('0x3'));var logger=require(_0x51a8('0x4'))(_0x51a8('0x5'));var config=require('../../config/environment');var jayson=require(_0x51a8('0x6'));var client=jayson['client'][_0x51a8('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x5cf430,_0x331117,_0x16a21e){return new BPromise(function(_0x4f3919,_0x228c64){return client['request'](_0x5cf430,_0x16a21e)['then'](function(_0x39e06a){logger[_0x51a8('0x8')](_0x51a8('0x9'),_0x331117,_0x51a8('0xa'));logger[_0x51a8('0xb')](_0x51a8('0xc'),_0x331117,_0x51a8('0xa'),JSON[_0x51a8('0xd')](_0x39e06a));if(_0x39e06a[_0x51a8('0xe')]){if(_0x39e06a[_0x51a8('0xe')][_0x51a8('0xf')]===0x1f4){logger[_0x51a8('0xe')](_0x51a8('0x9'),_0x331117,_0x39e06a[_0x51a8('0xe')][_0x51a8('0x10')]);return _0x228c64(_0x39e06a[_0x51a8('0xe')][_0x51a8('0x10')]);}logger['error'](_0x51a8('0x9'),_0x331117,_0x39e06a[_0x51a8('0xe')][_0x51a8('0x10')]);return _0x4f3919(_0x39e06a['error'][_0x51a8('0x10')]);}else{logger['info'](_0x51a8('0x9'),_0x331117,_0x51a8('0xa'));_0x4f3919(_0x39e06a[_0x51a8('0x11')][_0x51a8('0x10')]);}})[_0x51a8('0x12')](function(_0x3e0603){logger[_0x51a8('0xe')]('VoiceMailMessage,\x20%s,\x20%s',_0x331117,_0x3e0603);_0x228c64(_0x3e0603);});});} \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/index.js b/server/api/voiceMusicOnHold/index.js index b1696e9..e45ab90 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 _0xe6ce=['../../components/auth/service','../../components/interaction/service','./voiceMusicOnHold.controller','index','get','/:id','isAuthenticated','show','/:id/sounds','post','addSound','put','delete','destroy','/:id/sounds/:id2','removeSound','multer','util','path','express'];(function(_0x29130e,_0x35fb01){var _0x24e6be=function(_0x4cc561){while(--_0x4cc561){_0x29130e['push'](_0x29130e['shift']());}};_0x24e6be(++_0x35fb01);}(_0xe6ce,0xc4));var _0xee6c=function(_0x4f211b,_0x11adbf){_0x4f211b=_0x4f211b-0x0;var _0x366d62=_0xe6ce[_0x4f211b];return _0x366d62;};'use strict';var multer=require(_0xee6c('0x0'));var util=require(_0xee6c('0x1'));var path=require(_0xee6c('0x2'));var timeout=require('connect-timeout');var express=require(_0xee6c('0x3'));var router=express['Router']();var auth=require(_0xee6c('0x4'));var interaction=require(_0xee6c('0x5'));var config=require('../../config/environment');var controller=require(_0xee6c('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0xee6c('0x7')]);router[_0xee6c('0x8')](_0xee6c('0x9'),auth[_0xee6c('0xa')](),controller[_0xee6c('0xb')]);router['get'](_0xee6c('0xc'),auth[_0xee6c('0xa')](),controller['getSounds']);router[_0xee6c('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0xee6c('0xd')](_0xee6c('0xc'),auth['isAuthenticated'](),controller[_0xee6c('0xe')]);router[_0xee6c('0xf')]('/:id',auth[_0xee6c('0xa')](),controller['update']);router[_0xee6c('0x10')]('/:id',auth['isAuthenticated'](),controller[_0xee6c('0x11')]);router[_0xee6c('0x10')](_0xee6c('0x12'),auth['isAuthenticated'](),controller[_0xee6c('0x13')]);module['exports']=router; \ No newline at end of file +var _0x5780=['/:id','update','delete','destroy','removeSound','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','get','index','isAuthenticated','getSounds','post','create','/:id/sounds','addSound'];(function(_0x3b150c,_0x2f93f8){var _0x5cd414=function(_0x26305e){while(--_0x26305e){_0x3b150c['push'](_0x3b150c['shift']());}};_0x5cd414(++_0x2f93f8);}(_0x5780,0x1eb));var _0x0578=function(_0x3e0083,_0x52824e){_0x3e0083=_0x3e0083-0x0;var _0x1cd002=_0x5780[_0x3e0083];return _0x1cd002;};'use strict';var multer=require('multer');var util=require(_0x0578('0x0'));var path=require('path');var timeout=require(_0x0578('0x1'));var express=require(_0x0578('0x2'));var router=express['Router']();var auth=require(_0x0578('0x3'));var interaction=require(_0x0578('0x4'));var config=require('../../config/environment');var controller=require('./voiceMusicOnHold.controller');router[_0x0578('0x5')]('/',auth['isAuthenticated'](),controller[_0x0578('0x6')]);router['get']('/:id',auth[_0x0578('0x7')](),controller['show']);router['get']('/:id/sounds',auth['isAuthenticated'](),controller[_0x0578('0x8')]);router[_0x0578('0x9')]('/',auth['isAuthenticated'](),controller[_0x0578('0xa')]);router['post'](_0x0578('0xb'),auth[_0x0578('0x7')](),controller[_0x0578('0xc')]);router['put'](_0x0578('0xd'),auth[_0x0578('0x7')](),controller[_0x0578('0xe')]);router[_0x0578('0xf')](_0x0578('0xd'),auth[_0x0578('0x7')](),controller[_0x0578('0x10')]);router['delete']('/:id/sounds/:id2',auth[_0x0578('0x7')](),controller[_0x0578('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js index f3b082b..810762f 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 _0x1aa4=['name','ENUM','custom','files','quietmp3nb','quietmp3','mp3','alpha','TIMESTAMP','BOOLEAN','sequelize','STRING'];(function(_0x5db2de,_0x3c55a3){var _0x492a07=function(_0x5a8d2c){while(--_0x5a8d2c){_0x5db2de['push'](_0x5db2de['shift']());}};_0x492a07(++_0x3c55a3);}(_0x1aa4,0xb2));var _0x41aa=function(_0x44c263,_0x327d27){_0x44c263=_0x44c263-0x0;var _0xa6f966=_0x1aa4[_0x44c263];return _0xa6f966;};'use strict';var Sequelize=require(_0x41aa('0x0'));module['exports']={'name':{'type':Sequelize[_0x41aa('0x1')],'allowNull':![],'unique':_0x41aa('0x2')},'mode':{'type':Sequelize[_0x41aa('0x3')](_0x41aa('0x4'),_0x41aa('0x5'),'mp3nb',_0x41aa('0x6'),_0x41aa('0x7'),_0x41aa('0x8')),'allowNull':!![],'defaultValue':_0x41aa('0x5')},'directory':{'type':Sequelize[_0x41aa('0x1')],'allowNull':!![]},'application':{'type':Sequelize['STRING'],'allowNull':!![]},'digit':{'type':Sequelize[_0x41aa('0x1')],'allowNull':!![]},'sort':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x41aa('0x9')},'format':{'type':Sequelize[_0x41aa('0x1')],'allowNull':!![]},'stamp':{'type':_0x41aa('0xa')},'defaultEntry':{'type':Sequelize[_0x41aa('0xb')],'defaultValue':0x0}}; \ No newline at end of file +var _0xe892=['ENUM','custom','files','mp3nb','quietmp3nb','quietmp3','mp3','alpha','TIMESTAMP','BOOLEAN','exports','STRING','name'];(function(_0x509099,_0x422486){var _0xc238bb=function(_0x210757){while(--_0x210757){_0x509099['push'](_0x509099['shift']());}};_0xc238bb(++_0x422486);}(_0xe892,0x101));var _0x2e89=function(_0xc41fd3,_0x48df0d){_0xc41fd3=_0xc41fd3-0x0;var _0x444206=_0xe892[_0xc41fd3];return _0x444206;};'use strict';var Sequelize=require('sequelize');module[_0x2e89('0x0')]={'name':{'type':Sequelize[_0x2e89('0x1')],'allowNull':![],'unique':_0x2e89('0x2')},'mode':{'type':Sequelize[_0x2e89('0x3')](_0x2e89('0x4'),_0x2e89('0x5'),_0x2e89('0x6'),_0x2e89('0x7'),_0x2e89('0x8'),_0x2e89('0x9')),'allowNull':!![],'defaultValue':_0x2e89('0x5')},'directory':{'type':Sequelize[_0x2e89('0x1')],'allowNull':!![]},'application':{'type':Sequelize[_0x2e89('0x1')],'allowNull':!![]},'digit':{'type':Sequelize[_0x2e89('0x1')],'allowNull':!![]},'sort':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x2e89('0xa')},'format':{'type':Sequelize[_0x2e89('0x1')],'allowNull':!![]},'stamp':{'type':_0x2e89('0xb')},'defaultEntry':{'type':Sequelize[_0x2e89('0xc')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.controller.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.controller.js index 0044c66..7e879dc 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 _0x9c44=['type','key','field','options','includeAll','include','findAll','rows','catch','show','params','length','find','body','create','sequelize','mode','files','join','server/files/moh','mkdirSync','directory','0777','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','transaction','readdirSync','forEach','unlinkSync','Sequelize','ValidationError','addSound','Sound','findOne','save_name','root','server/files/sounds/converted','basename','extname','converted_format','%s.%s','symlinkSync','message','removeSound','id2','createdAt','format','getSounds','map','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../mysqldb','sendStatus','end','status','json','count','offset','limit','Content-Range','apply','reject','save','update','then','MusicOnHolds','UserProfileResource','destroy','error','name','send','VoiceMusicOnHold','rawAttributes','model','keys','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge'];(function(_0x3fbb96,_0x40287c){var _0x1f118f=function(_0x2eb2fd){while(--_0x2eb2fd){_0x3fbb96['push'](_0x3fbb96['shift']());}};_0x1f118f(++_0x40287c);}(_0x9c44,0x178));var _0x49c4=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0x9c44[_0x53ccf2];return _0x5a2964;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x49c4('0x0'));var zipdir=require(_0x49c4('0x1'));var jsonpatch=require(_0x49c4('0x2'));var rp=require(_0x49c4('0x3'));var moment=require(_0x49c4('0x4'));var BPromise=require(_0x49c4('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x49c4('0x6'));var sox=require('sox');var csv=require(_0x49c4('0x7'));var ejs=require(_0x49c4('0x8'));var fs=require('fs');var _=require(_0x49c4('0x9'));var squel=require(_0x49c4('0xa'));var crypto=require(_0x49c4('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x49c4('0xc'));var toCsv=require(_0x49c4('0x7'));var querystring=require(_0x49c4('0xd'));var Papa=require(_0x49c4('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x49c4('0xf'));var as=require(_0x49c4('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x49c4('0x11'))(_0x49c4('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x49c4('0x13'))['db'];function respondWithStatusCode(_0x6d1b08,_0x5487cd){_0x5487cd=_0x5487cd||0xcc;return function(_0x7df3a9){if(_0x7df3a9){return _0x6d1b08[_0x49c4('0x14')](_0x5487cd);}return _0x6d1b08['status'](_0x5487cd)[_0x49c4('0x15')]();};}function respondWithResult(_0x280996,_0x21f15a){_0x21f15a=_0x21f15a||0xc8;return function(_0x2decee){if(_0x2decee){return _0x280996[_0x49c4('0x16')](_0x21f15a)[_0x49c4('0x17')](_0x2decee);}};}function respondWithFilteredResult(_0x75ea8,_0x3de397){return function(_0x58d177){if(_0x58d177){var _0x3acd06=_0x58d177[_0x49c4('0x18')],_0x141003=_0x3de397['offset'],_0x13a2db=_0x3de397[_0x49c4('0x19')]+_0x3de397[_0x49c4('0x1a')],_0x81e831;if(_0x13a2db>=_0x3acd06){_0x13a2db=_0x3acd06;_0x81e831=0xc8;}else{_0x81e831=0xce;}_0x75ea8['status'](_0x81e831);return _0x75ea8['set'](_0x49c4('0x1b'),_0x141003+'-'+_0x13a2db+'/'+_0x3acd06)[_0x49c4('0x17')](_0x58d177);}return null;};}function patchUpdates(_0x3addb2){return function(_0x59f29b){try{jsonpatch[_0x49c4('0x1c')](_0x59f29b,_0x3addb2,!![]);}catch(_0x50b151){return BPromise[_0x49c4('0x1d')](_0x50b151);}return _0x59f29b[_0x49c4('0x1e')]();};}function saveUpdates(_0xe31fcc,_0x291526){return function(_0x382040){if(_0x382040){return _0x382040[_0x49c4('0x1f')](_0xe31fcc)[_0x49c4('0x20')](function(_0x46e475){return _0x46e475;});}return null;};}function removeEntity(_0x2197d2,_0x578447){return function(_0x527126){if(_0x527126){return _0x527126['destroy']()[_0x49c4('0x20')](function(){var _0x4f0b62=_0x527126['get']({'plain':!![]});var _0x2263ae=_0x49c4('0x21');return db[_0x49c4('0x22')][_0x49c4('0x23')]({'where':{'type':_0x2263ae,'resourceId':_0x4f0b62['id']}})['then'](function(){return _0x527126;});})['then'](function(){_0x2197d2[_0x49c4('0x16')](0xcc)[_0x49c4('0x15')]();});}};}function handleEntityNotFound(_0x565423,_0x207358){return function(_0x43e014){if(!_0x43e014){_0x565423[_0x49c4('0x14')](0x194);}return _0x43e014;};}function handleError(_0xa7a826,_0x531d92){_0x531d92=_0x531d92||0x1f4;return function(_0x543ea2){logger[_0x49c4('0x24')](_0x543ea2['stack']);if(_0x543ea2[_0x49c4('0x25')]){delete _0x543ea2[_0x49c4('0x25')];}_0xa7a826[_0x49c4('0x16')](_0x531d92)[_0x49c4('0x26')](_0x543ea2);};}exports['index']=function(_0x889909,_0x2b2793){var _0x46e04d={},_0x4f28a2={},_0x6329b3={'count':0x0,'rows':[]};var _0x29f835=db[_0x49c4('0x27')][_0x49c4('0x28')];_0x4f28a2[_0x49c4('0x29')]=_[_0x49c4('0x2a')](_0x29f835);_0x4f28a2[_0x49c4('0x2b')]=_['keys'](_0x889909['query']);_0x4f28a2['filters']=_[_0x49c4('0x2c')](_0x4f28a2[_0x49c4('0x29')],_0x4f28a2[_0x49c4('0x2b')]);_0x46e04d[_0x49c4('0x2d')]=_[_0x49c4('0x2c')](_0x4f28a2['model'],qs[_0x49c4('0x2e')](_0x889909[_0x49c4('0x2b')][_0x49c4('0x2e')]));_0x46e04d[_0x49c4('0x2d')]=_0x46e04d['attributes']['length']?_0x46e04d[_0x49c4('0x2d')]:_0x4f28a2[_0x49c4('0x29')];if(!_0x889909[_0x49c4('0x2b')][_0x49c4('0x2f')](_0x49c4('0x30'))){_0x46e04d['limit']=qs[_0x49c4('0x1a')](_0x889909[_0x49c4('0x2b')][_0x49c4('0x1a')]);_0x46e04d['offset']=qs['offset'](_0x889909[_0x49c4('0x2b')][_0x49c4('0x19')]);}_0x46e04d[_0x49c4('0x31')]=qs[_0x49c4('0x32')](_0x889909[_0x49c4('0x2b')][_0x49c4('0x32')]);_0x46e04d[_0x49c4('0x33')]=qs[_0x49c4('0x34')](_[_0x49c4('0x35')](_0x889909['query'],_0x4f28a2[_0x49c4('0x34')]));if(_0x889909['query'][_0x49c4('0x36')]){_0x46e04d[_0x49c4('0x33')]=_[_0x49c4('0x37')](_0x46e04d[_0x49c4('0x33')],{'$or':_['map'](_0x29f835,function(_0x335f0c){if(_0x335f0c[_0x49c4('0x38')][_0x49c4('0x39')]!=='VIRTUAL'){var _0x3b4feb={};_0x3b4feb[_0x335f0c[_0x49c4('0x3a')]]={'$like':'%'+_0x889909[_0x49c4('0x2b')][_0x49c4('0x36')]+'%'};return _0x3b4feb;}})});}_0x46e04d=_[_0x49c4('0x37')]({},_0x46e04d,_0x889909[_0x49c4('0x3b')]);var _0x143916={'where':_0x46e04d[_0x49c4('0x33')]};return db[_0x49c4('0x27')][_0x49c4('0x18')](_0x143916)[_0x49c4('0x20')](function(_0x4e0663){_0x6329b3[_0x49c4('0x18')]=_0x4e0663;if(_0x889909[_0x49c4('0x2b')][_0x49c4('0x3c')]){_0x46e04d[_0x49c4('0x3d')]=[{'all':!![]}];}return db[_0x49c4('0x27')][_0x49c4('0x3e')](_0x46e04d);})[_0x49c4('0x20')](function(_0xc9722b){_0x6329b3[_0x49c4('0x3f')]=_0xc9722b;return _0x6329b3;})[_0x49c4('0x20')](respondWithFilteredResult(_0x2b2793,_0x46e04d))[_0x49c4('0x40')](handleError(_0x2b2793,null));};exports[_0x49c4('0x41')]=function(_0x326142,_0x4e38bc){var _0x212366={'raw':![],'where':{'id':_0x326142[_0x49c4('0x42')]['id']}},_0x49829e={};_0x49829e[_0x49c4('0x29')]=_[_0x49c4('0x2a')](db[_0x49c4('0x27')][_0x49c4('0x28')]);_0x49829e[_0x49c4('0x2b')]=_['keys'](_0x326142['query']);_0x49829e[_0x49c4('0x34')]=_[_0x49c4('0x2c')](_0x49829e[_0x49c4('0x29')],_0x49829e[_0x49c4('0x2b')]);_0x212366['attributes']=_[_0x49c4('0x2c')](_0x49829e[_0x49c4('0x29')],qs[_0x49c4('0x2e')](_0x326142[_0x49c4('0x2b')][_0x49c4('0x2e')]));_0x212366[_0x49c4('0x2d')]=_0x212366[_0x49c4('0x2d')][_0x49c4('0x43')]?_0x212366[_0x49c4('0x2d')]:_0x49829e['model'];if(_0x326142[_0x49c4('0x2b')]['includeAll']){_0x212366[_0x49c4('0x3d')]=[{'all':!![]}];}_0x212366=_[_0x49c4('0x37')]({},_0x212366,_0x326142[_0x49c4('0x3b')]);return db[_0x49c4('0x27')][_0x49c4('0x44')](_0x212366)['then'](handleEntityNotFound(_0x4e38bc,null))[_0x49c4('0x20')](respondWithResult(_0x4e38bc,null))[_0x49c4('0x40')](handleError(_0x4e38bc,null));};exports[_0x49c4('0x1f')]=function(_0x254d07,_0x1ded71){if(_0x254d07[_0x49c4('0x45')]['id']){delete _0x254d07[_0x49c4('0x45')]['id'];}return db['VoiceMusicOnHold'][_0x49c4('0x44')]({'where':{'id':_0x254d07['params']['id']}})[_0x49c4('0x20')](handleEntityNotFound(_0x1ded71,null))[_0x49c4('0x20')](saveUpdates(_0x254d07[_0x49c4('0x45')],null))[_0x49c4('0x20')](respondWithResult(_0x1ded71,null))[_0x49c4('0x40')](handleError(_0x1ded71,null));};exports[_0x49c4('0x46')]=function(_0x2c6be1,_0x506c71,_0x3b731f){return db[_0x49c4('0x47')]['transaction'](function(_0x1e1ac4){if(_0x2c6be1[_0x49c4('0x45')][_0x49c4('0x48')]===_0x49c4('0x49')){_0x2c6be1['body']['directory']=path[_0x49c4('0x4a')](config['root'],_0x49c4('0x4b'),_0x2c6be1[_0x49c4('0x45')][_0x49c4('0x25')]);}return db[_0x49c4('0x27')][_0x49c4('0x46')](_0x2c6be1[_0x49c4('0x45')],{'transaction':_0x1e1ac4})[_0x49c4('0x20')](function(_0x563f0b){if(_0x2c6be1[_0x49c4('0x45')][_0x49c4('0x48')]===_0x49c4('0x49')){fs[_0x49c4('0x4c')](_0x563f0b[_0x49c4('0x4d')],parseInt(_0x49c4('0x4e'),0x8));}var _0x156748=_0x2c6be1[_0x49c4('0x4f')][_0x49c4('0x50')]({'plain':!![]});if(!_0x156748)throw new Error(_0x49c4('0x51'));if(_0x156748['role']==='user'){var _0x3fd647=_0x563f0b[_0x49c4('0x50')]({'plain':!![]});return db['UserProfileSection']['find']({'where':{'name':_0x49c4('0x21'),'userProfileId':_0x156748['userProfileId']},'raw':!![]})['then'](function(_0x3208c2){if(_0x3208c2&&_0x3208c2[_0x49c4('0x52')]===0x0){return db[_0x49c4('0x22')][_0x49c4('0x46')]({'name':_0x3fd647[_0x49c4('0x25')],'resourceId':_0x3fd647['id'],'type':_0x3208c2[_0x49c4('0x25')],'sectionId':_0x3208c2['id']},{})[_0x49c4('0x20')](function(){return _0x563f0b;});}else{return _0x563f0b;}})['catch'](function(_0x859dde){logger[_0x49c4('0x24')](_0x49c4('0x53'),_0x859dde);});}return _0x563f0b;});})[_0x49c4('0x20')](respondWithResult(_0x506c71,0xc9))[_0x49c4('0x40')](handleError(_0x506c71,null));};exports[_0x49c4('0x23')]=function(_0x5d24f3,_0x5c7ddd,_0x1ef0c1){var _0x155c43;return db[_0x49c4('0x27')][_0x49c4('0x44')]({'where':{'id':_0x5d24f3[_0x49c4('0x42')]['id']}})[_0x49c4('0x20')](function(_0xc2033f){if(_0xc2033f){return db['sequelize'][_0x49c4('0x54')](function(_0x33c9a6){return _0xc2033f['destroy']({'transaction':_0x33c9a6,'raw':!![]})[_0x49c4('0x20')](function(_0x53690f){if(_0x53690f[_0x49c4('0x4d')]){fs[_0x49c4('0x55')](_0x53690f[_0x49c4('0x4d')])[_0x49c4('0x56')](function(_0x845f7e){fs[_0x49c4('0x57')](path[_0x49c4('0x4a')](_0x53690f[_0x49c4('0x4d')],_0x845f7e));});fs['rmdirSync'](_0x53690f[_0x49c4('0x4d')]);}return _0x53690f;});})[_0x49c4('0x40')](function(_0x59dc8d){throw new db[(_0x49c4('0x58'))][(_0x49c4('0x59'))](_0x59dc8d['message']);});}})[_0x49c4('0x20')](handleEntityNotFound(_0x5c7ddd,null))[_0x49c4('0x20')](removeEntity(_0x5c7ddd,null))['catch'](handleError(_0x5c7ddd,null));};exports['addSound']=function(_0x589484,_0x513879,_0xc43386){return db['sequelize'][_0x49c4('0x54')](function(_0x32f344){var _0x515240;return db[_0x49c4('0x27')][_0x49c4('0x44')]({'where':{'id':_0x589484['params']['id']}})[_0x49c4('0x20')](function(_0x3dcf4c){if(_0x3dcf4c){_0x515240=_0x3dcf4c;return _0x3dcf4c[_0x49c4('0x5a')](_0x589484[_0x49c4('0x45')]['id'],{'transaction':_0x32f344});}})['then'](function(_0x431921){if(_0x431921){return db[_0x49c4('0x5b')][_0x49c4('0x5c')]({'where':{'id':_0x589484[_0x49c4('0x45')]['id']},'attributes':['id','name',_0x49c4('0x5d'),'converted_format','createdAt'],'raw':!![]});}})['then'](function(_0x5d6de0){if(_0x5d6de0){var _0x302251=path[_0x49c4('0x4a')](config[_0x49c4('0x5e')],_0x49c4('0x5f'),util['format']('%s.%s',path[_0x49c4('0x60')](_0x5d6de0[_0x49c4('0x5d')],path[_0x49c4('0x61')](_0x5d6de0[_0x49c4('0x5d')])),_0x5d6de0[_0x49c4('0x62')]));var _0x404f98=path[_0x49c4('0x4a')](config[_0x49c4('0x5e')],'server/files/moh',_0x515240[_0x49c4('0x25')],util['format'](_0x49c4('0x63'),_0x5d6de0[_0x49c4('0x25')],_0x5d6de0[_0x49c4('0x62')]));fs[_0x49c4('0x64')](_0x302251,_0x404f98);return _0x5d6de0;}})[_0x49c4('0x40')](function(_0x2e062f){throw new db[(_0x49c4('0x58'))][(_0x49c4('0x59'))](_0x2e062f[_0x49c4('0x65')]);});})[_0x49c4('0x20')](handleEntityNotFound(_0x513879,null))[_0x49c4('0x20')](respondWithResult(_0x513879,0xc9))[_0x49c4('0x40')](handleError(_0x513879,null));};exports[_0x49c4('0x66')]=function(_0x14bd09,_0x2d5f63,_0x453cf2){return db[_0x49c4('0x47')][_0x49c4('0x54')](function(_0x4e1544){var _0x5ec201;return db[_0x49c4('0x27')][_0x49c4('0x5c')]({'where':{'id':_0x14bd09['params']['id']}})[_0x49c4('0x20')](handleEntityNotFound(_0x2d5f63,null))[_0x49c4('0x20')](function(_0x2939fd){if(_0x2939fd){_0x5ec201=_0x2939fd;return _0x2939fd[_0x49c4('0x66')](_0x14bd09['params']['id2']);}})['then'](function(_0x2e90d8){if(_0x2e90d8){return db[_0x49c4('0x5b')][_0x49c4('0x5c')]({'where':{'id':_0x14bd09[_0x49c4('0x42')][_0x49c4('0x67')]},'attributes':['id',_0x49c4('0x25'),_0x49c4('0x5d'),_0x49c4('0x62'),_0x49c4('0x68')],'raw':!![]});}})['then'](function(_0x363b2e){if(_0x363b2e){fs[_0x49c4('0x57')](path[_0x49c4('0x4a')](_0x5ec201['directory'],util[_0x49c4('0x69')](_0x49c4('0x63'),_0x363b2e[_0x49c4('0x25')],_0x363b2e[_0x49c4('0x62')])));return _0x363b2e;}})[_0x49c4('0x40')](function(_0x2fd749){throw new db[(_0x49c4('0x58'))][(_0x49c4('0x59'))](_0x2fd749['message']);});})[_0x49c4('0x20')](handleEntityNotFound(_0x2d5f63,null))[_0x49c4('0x20')](respondWithStatusCode(_0x2d5f63,0xcc))[_0x49c4('0x40')](handleError(_0x2d5f63,null));};exports[_0x49c4('0x6a')]=function(_0x1e948a,_0x4a204d,_0x57a8d8){var _0xa7c311={};var _0x59aa67={};var _0x34cf49;var _0x558880;return db[_0x49c4('0x27')][_0x49c4('0x5c')]({'where':{'id':_0x1e948a[_0x49c4('0x42')]['id']}})[_0x49c4('0x20')](handleEntityNotFound(_0x4a204d,null))['then'](function(_0x123060){if(_0x123060){_0x34cf49=_0x123060;_0x59aa67[_0x49c4('0x29')]=_[_0x49c4('0x2a')](db[_0x49c4('0x5b')][_0x49c4('0x28')]);_0x59aa67[_0x49c4('0x2b')]=_[_0x49c4('0x2a')](_0x1e948a[_0x49c4('0x2b')]);_0x59aa67[_0x49c4('0x34')]=_[_0x49c4('0x2c')](_0x59aa67['model'],_0x59aa67[_0x49c4('0x2b')]);_0xa7c311[_0x49c4('0x2d')]=_['intersection'](_0x59aa67[_0x49c4('0x29')],qs['fields'](_0x1e948a[_0x49c4('0x2b')][_0x49c4('0x2e')]));_0xa7c311[_0x49c4('0x2d')]=_0xa7c311[_0x49c4('0x2d')][_0x49c4('0x43')]?_0xa7c311['attributes']:_0x59aa67[_0x49c4('0x29')];_0xa7c311[_0x49c4('0x31')]=qs['sort'](_0x1e948a[_0x49c4('0x2b')][_0x49c4('0x32')]);_0xa7c311['where']=qs[_0x49c4('0x34')](_[_0x49c4('0x35')](_0x1e948a['query'],_0x59aa67[_0x49c4('0x34')]));if(_0x1e948a[_0x49c4('0x2b')][_0x49c4('0x36')]){_0xa7c311[_0x49c4('0x33')]=_['merge'](_0xa7c311[_0x49c4('0x33')],{'$or':_[_0x49c4('0x6b')](_0xa7c311['attributes'],function(_0x45df7c){var _0x5f0188={};_0x5f0188[_0x45df7c]={'$like':'%'+_0x1e948a['query'][_0x49c4('0x36')]+'%'};return _0x5f0188;})});}_0xa7c311=_['merge']({},_0xa7c311,_0x1e948a['options']);return _0x34cf49[_0x49c4('0x6a')](_0xa7c311);}})[_0x49c4('0x20')](function(_0x5daa58){if(_0x5daa58){_0x558880=_0x5daa58[_0x49c4('0x43')];if(!_0x1e948a['query']['hasOwnProperty']('nolimit')){_0xa7c311[_0x49c4('0x1a')]=qs[_0x49c4('0x1a')](_0x1e948a[_0x49c4('0x2b')][_0x49c4('0x1a')]);_0xa7c311['offset']=qs['offset'](_0x1e948a[_0x49c4('0x2b')]['offset']);}return _0x34cf49[_0x49c4('0x6a')](_0xa7c311);}})['then'](function(_0x4e381c){if(_0x4e381c){return _0x4e381c?{'count':_0x558880,'rows':_0x4e381c}:null;}})[_0x49c4('0x20')](respondWithResult(_0x4a204d,null))[_0x49c4('0x40')](handleError(_0x4a204d,null));}; \ No newline at end of file +var _0xb7e7=['keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','map','type','key','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','body','find','create','sequelize','transaction','mode','files','directory','join','server/files/moh','mkdirSync','0777','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','MusicOnHolds','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readdirSync','Sequelize','ValidationError','message','addSound','findOne','save_name','converted_format','createdAt','root','format','basename','%s.%s','symlinkSync','removeSound','id2','Sound','getSounds','rawAttributes','html-pdf','rimraf','fast-json-patch','moment','mustache','util','path','ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','stack','name','index','VoiceMusicOnHold','model'];(function(_0x593909,_0x2bda9f){var _0x4e3c9a=function(_0x561e8c){while(--_0x561e8c){_0x593909['push'](_0x593909['shift']());}};_0x4e3c9a(++_0x2bda9f);}(_0xb7e7,0x121));var _0x7b7e=function(_0x376b45,_0x5964fb){_0x376b45=_0x376b45-0x0;var _0x2341b3=_0xb7e7[_0x376b45];return _0x2341b3;};'use strict';var pdf=require(_0x7b7e('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x7b7e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7b7e('0x2'));var rp=require('request-promise');var moment=require(_0x7b7e('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x7b7e('0x4'));var util=require(_0x7b7e('0x5'));var path=require(_0x7b7e('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x7b7e('0x7'));var fs=require('fs');var _=require(_0x7b7e('0x8'));var squel=require(_0x7b7e('0x9'));var crypto=require('crypto');var jsforce=require(_0x7b7e('0xa'));var deskjs=require(_0x7b7e('0xb'));var toCsv=require(_0x7b7e('0xc'));var querystring=require(_0x7b7e('0xd'));var Papa=require(_0x7b7e('0xe'));var Redis=require(_0x7b7e('0xf'));var authService=require(_0x7b7e('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x7b7e('0x11'));var hardwareService=require(_0x7b7e('0x12'));var logger=require(_0x7b7e('0x13'))(_0x7b7e('0x14'));var utils=require(_0x7b7e('0x15'));var config=require(_0x7b7e('0x16'));var db=require(_0x7b7e('0x17'))['db'];function respondWithStatusCode(_0x55620b,_0xaadda){_0xaadda=_0xaadda||0xcc;return function(_0x54d8ce){if(_0x54d8ce){return _0x55620b[_0x7b7e('0x18')](_0xaadda);}return _0x55620b[_0x7b7e('0x19')](_0xaadda)['end']();};}function respondWithResult(_0x422d3a,_0x5976ac){_0x5976ac=_0x5976ac||0xc8;return function(_0x4c6011){if(_0x4c6011){return _0x422d3a[_0x7b7e('0x19')](_0x5976ac)[_0x7b7e('0x1a')](_0x4c6011);}};}function respondWithFilteredResult(_0xf067da,_0x457ec5){return function(_0x3d2fb2){if(_0x3d2fb2){var _0x5703fd=_0x3d2fb2[_0x7b7e('0x1b')],_0x51baf6=_0x457ec5[_0x7b7e('0x1c')],_0xc7f087=_0x457ec5[_0x7b7e('0x1c')]+_0x457ec5[_0x7b7e('0x1d')],_0x36444d;if(_0xc7f087>=_0x5703fd){_0xc7f087=_0x5703fd;_0x36444d=0xc8;}else{_0x36444d=0xce;}_0xf067da[_0x7b7e('0x19')](_0x36444d);return _0xf067da[_0x7b7e('0x1e')](_0x7b7e('0x1f'),_0x51baf6+'-'+_0xc7f087+'/'+_0x5703fd)[_0x7b7e('0x1a')](_0x3d2fb2);}return null;};}function patchUpdates(_0x12e8e9){return function(_0x14f4fe){try{jsonpatch[_0x7b7e('0x20')](_0x14f4fe,_0x12e8e9,!![]);}catch(_0x3bec7d){return BPromise[_0x7b7e('0x21')](_0x3bec7d);}return _0x14f4fe[_0x7b7e('0x22')]();};}function saveUpdates(_0x3a7b8b,_0x49eddb){return function(_0x69262b){if(_0x69262b){return _0x69262b[_0x7b7e('0x23')](_0x3a7b8b)[_0x7b7e('0x24')](function(_0x4c0647){return _0x4c0647;});}return null;};}function removeEntity(_0x313122,_0xbf0cb3){return function(_0x14243b){if(_0x14243b){return _0x14243b[_0x7b7e('0x25')]()[_0x7b7e('0x24')](function(){var _0x303d8c=_0x14243b[_0x7b7e('0x26')]({'plain':!![]});var _0x10a66a='MusicOnHolds';return db['UserProfileResource']['destroy']({'where':{'type':_0x10a66a,'resourceId':_0x303d8c['id']}})[_0x7b7e('0x24')](function(){return _0x14243b;});})[_0x7b7e('0x24')](function(){_0x313122[_0x7b7e('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x51d3b1,_0x5dadbb){return function(_0x182245){if(!_0x182245){_0x51d3b1[_0x7b7e('0x18')](0x194);}return _0x182245;};}function handleError(_0x16a3c7,_0x7aa71){_0x7aa71=_0x7aa71||0x1f4;return function(_0x3ceaf5){logger['error'](_0x3ceaf5[_0x7b7e('0x27')]);if(_0x3ceaf5[_0x7b7e('0x28')]){delete _0x3ceaf5['name'];}_0x16a3c7['status'](_0x7aa71)['send'](_0x3ceaf5);};}exports[_0x7b7e('0x29')]=function(_0x423832,_0x503625){var _0x3db8c4={},_0x51d4b5={},_0x1b4341={'count':0x0,'rows':[]};var _0xb9b6bf=db[_0x7b7e('0x2a')]['rawAttributes'];_0x51d4b5[_0x7b7e('0x2b')]=_[_0x7b7e('0x2c')](_0xb9b6bf);_0x51d4b5[_0x7b7e('0x2d')]=_[_0x7b7e('0x2c')](_0x423832[_0x7b7e('0x2d')]);_0x51d4b5['filters']=_[_0x7b7e('0x2e')](_0x51d4b5['model'],_0x51d4b5[_0x7b7e('0x2d')]);_0x3db8c4[_0x7b7e('0x2f')]=_[_0x7b7e('0x2e')](_0x51d4b5[_0x7b7e('0x2b')],qs[_0x7b7e('0x30')](_0x423832[_0x7b7e('0x2d')][_0x7b7e('0x30')]));_0x3db8c4['attributes']=_0x3db8c4['attributes'][_0x7b7e('0x31')]?_0x3db8c4[_0x7b7e('0x2f')]:_0x51d4b5['model'];if(!_0x423832[_0x7b7e('0x2d')][_0x7b7e('0x32')](_0x7b7e('0x33'))){_0x3db8c4['limit']=qs[_0x7b7e('0x1d')](_0x423832[_0x7b7e('0x2d')][_0x7b7e('0x1d')]);_0x3db8c4[_0x7b7e('0x1c')]=qs[_0x7b7e('0x1c')](_0x423832[_0x7b7e('0x2d')][_0x7b7e('0x1c')]);}_0x3db8c4[_0x7b7e('0x34')]=qs[_0x7b7e('0x35')](_0x423832[_0x7b7e('0x2d')][_0x7b7e('0x35')]);_0x3db8c4[_0x7b7e('0x36')]=qs[_0x7b7e('0x37')](_[_0x7b7e('0x38')](_0x423832[_0x7b7e('0x2d')],_0x51d4b5[_0x7b7e('0x37')]));if(_0x423832['query'][_0x7b7e('0x39')]){_0x3db8c4[_0x7b7e('0x36')]=_[_0x7b7e('0x3a')](_0x3db8c4[_0x7b7e('0x36')],{'$or':_[_0x7b7e('0x3b')](_0xb9b6bf,function(_0x909c65){if(_0x909c65[_0x7b7e('0x3c')][_0x7b7e('0x3d')]!==_0x7b7e('0x3e')){var _0x18011c={};_0x18011c[_0x909c65['field']]={'$like':'%'+_0x423832[_0x7b7e('0x2d')][_0x7b7e('0x39')]+'%'};return _0x18011c;}})});}_0x3db8c4=_[_0x7b7e('0x3a')]({},_0x3db8c4,_0x423832[_0x7b7e('0x3f')]);var _0x5a5720={'where':_0x3db8c4[_0x7b7e('0x36')]};return db[_0x7b7e('0x2a')][_0x7b7e('0x1b')](_0x5a5720)['then'](function(_0x4a2888){_0x1b4341[_0x7b7e('0x1b')]=_0x4a2888;if(_0x423832['query'][_0x7b7e('0x40')]){_0x3db8c4[_0x7b7e('0x41')]=[{'all':!![]}];}return db['VoiceMusicOnHold'][_0x7b7e('0x42')](_0x3db8c4);})[_0x7b7e('0x24')](function(_0x2a6f4d){_0x1b4341[_0x7b7e('0x43')]=_0x2a6f4d;return _0x1b4341;})[_0x7b7e('0x24')](respondWithFilteredResult(_0x503625,_0x3db8c4))[_0x7b7e('0x44')](handleError(_0x503625,null));};exports[_0x7b7e('0x45')]=function(_0x1d9bb9,_0x157871){var _0x525a74={'raw':![],'where':{'id':_0x1d9bb9[_0x7b7e('0x46')]['id']}},_0x5d61c1={};_0x5d61c1['model']=_[_0x7b7e('0x2c')](db['VoiceMusicOnHold']['rawAttributes']);_0x5d61c1[_0x7b7e('0x2d')]=_['keys'](_0x1d9bb9[_0x7b7e('0x2d')]);_0x5d61c1['filters']=_[_0x7b7e('0x2e')](_0x5d61c1[_0x7b7e('0x2b')],_0x5d61c1[_0x7b7e('0x2d')]);_0x525a74[_0x7b7e('0x2f')]=_['intersection'](_0x5d61c1[_0x7b7e('0x2b')],qs[_0x7b7e('0x30')](_0x1d9bb9[_0x7b7e('0x2d')][_0x7b7e('0x30')]));_0x525a74[_0x7b7e('0x2f')]=_0x525a74[_0x7b7e('0x2f')]['length']?_0x525a74['attributes']:_0x5d61c1['model'];if(_0x1d9bb9[_0x7b7e('0x2d')][_0x7b7e('0x40')]){_0x525a74[_0x7b7e('0x41')]=[{'all':!![]}];}_0x525a74=_[_0x7b7e('0x3a')]({},_0x525a74,_0x1d9bb9[_0x7b7e('0x3f')]);return db[_0x7b7e('0x2a')]['find'](_0x525a74)[_0x7b7e('0x24')](handleEntityNotFound(_0x157871,null))[_0x7b7e('0x24')](respondWithResult(_0x157871,null))['catch'](handleError(_0x157871,null));};exports['update']=function(_0x1dcb88,_0xc901c4){if(_0x1dcb88[_0x7b7e('0x47')]['id']){delete _0x1dcb88[_0x7b7e('0x47')]['id'];}return db[_0x7b7e('0x2a')][_0x7b7e('0x48')]({'where':{'id':_0x1dcb88['params']['id']}})[_0x7b7e('0x24')](handleEntityNotFound(_0xc901c4,null))['then'](saveUpdates(_0x1dcb88[_0x7b7e('0x47')],null))[_0x7b7e('0x24')](respondWithResult(_0xc901c4,null))[_0x7b7e('0x44')](handleError(_0xc901c4,null));};exports[_0x7b7e('0x49')]=function(_0x58e4e6,_0x3b649e,_0x1010b3){return db[_0x7b7e('0x4a')][_0x7b7e('0x4b')](function(_0x1f9d0f){if(_0x58e4e6['body'][_0x7b7e('0x4c')]===_0x7b7e('0x4d')){_0x58e4e6[_0x7b7e('0x47')][_0x7b7e('0x4e')]=path[_0x7b7e('0x4f')](config['root'],_0x7b7e('0x50'),_0x58e4e6[_0x7b7e('0x47')][_0x7b7e('0x28')]);}return db[_0x7b7e('0x2a')][_0x7b7e('0x49')](_0x58e4e6[_0x7b7e('0x47')],{'transaction':_0x1f9d0f})[_0x7b7e('0x24')](function(_0x4a7be0){if(_0x58e4e6[_0x7b7e('0x47')]['mode']===_0x7b7e('0x4d')){fs[_0x7b7e('0x51')](_0x4a7be0['directory'],parseInt(_0x7b7e('0x52'),0x8));}var _0x44e3a0=_0x58e4e6[_0x7b7e('0x53')][_0x7b7e('0x26')]({'plain':!![]});if(!_0x44e3a0)throw new Error(_0x7b7e('0x54'));if(_0x44e3a0[_0x7b7e('0x55')]===_0x7b7e('0x53')){var _0x5f15ce=_0x4a7be0[_0x7b7e('0x26')]({'plain':!![]});return db[_0x7b7e('0x56')][_0x7b7e('0x48')]({'where':{'name':_0x7b7e('0x57'),'userProfileId':_0x44e3a0['userProfileId']},'raw':!![]})['then'](function(_0x5bdf1d){if(_0x5bdf1d&&_0x5bdf1d[_0x7b7e('0x58')]===0x0){return db[_0x7b7e('0x59')][_0x7b7e('0x49')]({'name':_0x5f15ce['name'],'resourceId':_0x5f15ce['id'],'type':_0x5bdf1d['name'],'sectionId':_0x5bdf1d['id']},{})[_0x7b7e('0x24')](function(){return _0x4a7be0;});}else{return _0x4a7be0;}})[_0x7b7e('0x44')](function(_0x4fecf7){logger[_0x7b7e('0x5a')](_0x7b7e('0x5b'),_0x4fecf7);});}return _0x4a7be0;});})[_0x7b7e('0x24')](respondWithResult(_0x3b649e,0xc9))['catch'](handleError(_0x3b649e,null));};exports[_0x7b7e('0x25')]=function(_0x1d9af5,_0x4d9a71,_0x25c933){var _0x441c3c;return db[_0x7b7e('0x2a')][_0x7b7e('0x48')]({'where':{'id':_0x1d9af5[_0x7b7e('0x46')]['id']}})[_0x7b7e('0x24')](function(_0x39eaf8){if(_0x39eaf8){return db[_0x7b7e('0x4a')][_0x7b7e('0x4b')](function(_0x5509ad){return _0x39eaf8[_0x7b7e('0x25')]({'transaction':_0x5509ad,'raw':!![]})[_0x7b7e('0x24')](function(_0x516e75){if(_0x516e75[_0x7b7e('0x4e')]){fs[_0x7b7e('0x5c')](_0x516e75[_0x7b7e('0x4e')])['forEach'](function(_0x1729e0){fs['unlinkSync'](path[_0x7b7e('0x4f')](_0x516e75[_0x7b7e('0x4e')],_0x1729e0));});fs['rmdirSync'](_0x516e75[_0x7b7e('0x4e')]);}return _0x516e75;});})[_0x7b7e('0x44')](function(_0x561158){throw new db[(_0x7b7e('0x5d'))][(_0x7b7e('0x5e'))](_0x561158[_0x7b7e('0x5f')]);});}})[_0x7b7e('0x24')](handleEntityNotFound(_0x4d9a71,null))['then'](removeEntity(_0x4d9a71,null))[_0x7b7e('0x44')](handleError(_0x4d9a71,null));};exports[_0x7b7e('0x60')]=function(_0x2e11b1,_0x7f705c,_0x2dc7ad){return db[_0x7b7e('0x4a')][_0x7b7e('0x4b')](function(_0x709e87){var _0x3665ca;return db[_0x7b7e('0x2a')]['find']({'where':{'id':_0x2e11b1[_0x7b7e('0x46')]['id']}})['then'](function(_0x53e2f7){if(_0x53e2f7){_0x3665ca=_0x53e2f7;return _0x53e2f7[_0x7b7e('0x60')](_0x2e11b1[_0x7b7e('0x47')]['id'],{'transaction':_0x709e87});}})[_0x7b7e('0x24')](function(_0x3dfd33){if(_0x3dfd33){return db['Sound'][_0x7b7e('0x61')]({'where':{'id':_0x2e11b1[_0x7b7e('0x47')]['id']},'attributes':['id',_0x7b7e('0x28'),_0x7b7e('0x62'),_0x7b7e('0x63'),_0x7b7e('0x64')],'raw':!![]});}})['then'](function(_0x1ebd58){if(_0x1ebd58){var _0x52b070=path['join'](config[_0x7b7e('0x65')],'server/files/sounds/converted',util[_0x7b7e('0x66')]('%s.%s',path[_0x7b7e('0x67')](_0x1ebd58[_0x7b7e('0x62')],path['extname'](_0x1ebd58[_0x7b7e('0x62')])),_0x1ebd58[_0x7b7e('0x63')]));var _0x57e88f=path[_0x7b7e('0x4f')](config[_0x7b7e('0x65')],_0x7b7e('0x50'),_0x3665ca[_0x7b7e('0x28')],util[_0x7b7e('0x66')](_0x7b7e('0x68'),_0x1ebd58[_0x7b7e('0x28')],_0x1ebd58[_0x7b7e('0x63')]));fs[_0x7b7e('0x69')](_0x52b070,_0x57e88f);return _0x1ebd58;}})[_0x7b7e('0x44')](function(_0x589b02){throw new db['Sequelize'][(_0x7b7e('0x5e'))](_0x589b02[_0x7b7e('0x5f')]);});})[_0x7b7e('0x24')](handleEntityNotFound(_0x7f705c,null))[_0x7b7e('0x24')](respondWithResult(_0x7f705c,0xc9))[_0x7b7e('0x44')](handleError(_0x7f705c,null));};exports[_0x7b7e('0x6a')]=function(_0x385f0c,_0x5d2526,_0x28e6ac){return db[_0x7b7e('0x4a')]['transaction'](function(_0x3ce80e){var _0x3f8162;return db[_0x7b7e('0x2a')][_0x7b7e('0x61')]({'where':{'id':_0x385f0c[_0x7b7e('0x46')]['id']}})[_0x7b7e('0x24')](handleEntityNotFound(_0x5d2526,null))[_0x7b7e('0x24')](function(_0x1673cc){if(_0x1673cc){_0x3f8162=_0x1673cc;return _0x1673cc[_0x7b7e('0x6a')](_0x385f0c[_0x7b7e('0x46')][_0x7b7e('0x6b')]);}})['then'](function(_0xf25350){if(_0xf25350){return db[_0x7b7e('0x6c')][_0x7b7e('0x61')]({'where':{'id':_0x385f0c[_0x7b7e('0x46')][_0x7b7e('0x6b')]},'attributes':['id',_0x7b7e('0x28'),_0x7b7e('0x62'),'converted_format',_0x7b7e('0x64')],'raw':!![]});}})[_0x7b7e('0x24')](function(_0x1eb5ce){if(_0x1eb5ce){fs['unlinkSync'](path[_0x7b7e('0x4f')](_0x3f8162[_0x7b7e('0x4e')],util[_0x7b7e('0x66')](_0x7b7e('0x68'),_0x1eb5ce[_0x7b7e('0x28')],_0x1eb5ce['converted_format'])));return _0x1eb5ce;}})['catch'](function(_0x5af831){throw new db[(_0x7b7e('0x5d'))][(_0x7b7e('0x5e'))](_0x5af831[_0x7b7e('0x5f')]);});})['then'](handleEntityNotFound(_0x5d2526,null))[_0x7b7e('0x24')](respondWithStatusCode(_0x5d2526,0xcc))[_0x7b7e('0x44')](handleError(_0x5d2526,null));};exports[_0x7b7e('0x6d')]=function(_0x5bf4d1,_0x2983bf,_0x2b27ef){var _0x111c99={};var _0x34a06c={};var _0x538c5f;var _0x315923;return db[_0x7b7e('0x2a')][_0x7b7e('0x61')]({'where':{'id':_0x5bf4d1[_0x7b7e('0x46')]['id']}})['then'](handleEntityNotFound(_0x2983bf,null))['then'](function(_0x2b5d20){if(_0x2b5d20){_0x538c5f=_0x2b5d20;_0x34a06c['model']=_[_0x7b7e('0x2c')](db[_0x7b7e('0x6c')][_0x7b7e('0x6e')]);_0x34a06c[_0x7b7e('0x2d')]=_['keys'](_0x5bf4d1[_0x7b7e('0x2d')]);_0x34a06c[_0x7b7e('0x37')]=_[_0x7b7e('0x2e')](_0x34a06c[_0x7b7e('0x2b')],_0x34a06c[_0x7b7e('0x2d')]);_0x111c99[_0x7b7e('0x2f')]=_[_0x7b7e('0x2e')](_0x34a06c[_0x7b7e('0x2b')],qs[_0x7b7e('0x30')](_0x5bf4d1[_0x7b7e('0x2d')][_0x7b7e('0x30')]));_0x111c99[_0x7b7e('0x2f')]=_0x111c99[_0x7b7e('0x2f')][_0x7b7e('0x31')]?_0x111c99[_0x7b7e('0x2f')]:_0x34a06c[_0x7b7e('0x2b')];_0x111c99['order']=qs[_0x7b7e('0x35')](_0x5bf4d1[_0x7b7e('0x2d')][_0x7b7e('0x35')]);_0x111c99[_0x7b7e('0x36')]=qs[_0x7b7e('0x37')](_[_0x7b7e('0x38')](_0x5bf4d1[_0x7b7e('0x2d')],_0x34a06c['filters']));if(_0x5bf4d1[_0x7b7e('0x2d')][_0x7b7e('0x39')]){_0x111c99[_0x7b7e('0x36')]=_[_0x7b7e('0x3a')](_0x111c99[_0x7b7e('0x36')],{'$or':_['map'](_0x111c99['attributes'],function(_0xb294bd){var _0x110f2b={};_0x110f2b[_0xb294bd]={'$like':'%'+_0x5bf4d1[_0x7b7e('0x2d')][_0x7b7e('0x39')]+'%'};return _0x110f2b;})});}_0x111c99=_[_0x7b7e('0x3a')]({},_0x111c99,_0x5bf4d1[_0x7b7e('0x3f')]);return _0x538c5f[_0x7b7e('0x6d')](_0x111c99);}})[_0x7b7e('0x24')](function(_0xe0a4b8){if(_0xe0a4b8){_0x315923=_0xe0a4b8[_0x7b7e('0x31')];if(!_0x5bf4d1['query'][_0x7b7e('0x32')](_0x7b7e('0x33'))){_0x111c99[_0x7b7e('0x1d')]=qs[_0x7b7e('0x1d')](_0x5bf4d1[_0x7b7e('0x2d')][_0x7b7e('0x1d')]);_0x111c99[_0x7b7e('0x1c')]=qs['offset'](_0x5bf4d1[_0x7b7e('0x2d')]['offset']);}return _0x538c5f[_0x7b7e('0x6d')](_0x111c99);}})[_0x7b7e('0x24')](function(_0x4981a9){if(_0x4981a9){return _0x4981a9?{'count':_0x315923,'rows':_0x4981a9}:null;}})[_0x7b7e('0x24')](respondWithResult(_0x2983bf,null))[_0x7b7e('0x44')](handleError(_0x2983bf,null));}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js index 8c8d4b8..6d6a09b 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 _0x7645=['define','util','../../config/logger','api','bluebird','request-promise','rimraf','./voiceMusicOnHold.attributes','exports'];(function(_0x2c9f1b,_0x2580df){var _0x21a010=function(_0xbf7c07){while(--_0xbf7c07){_0x2c9f1b['push'](_0x2c9f1b['shift']());}};_0x21a010(++_0x2580df);}(_0x7645,0xa3));var _0x5764=function(_0x2d1730,_0x4000f1){_0x2d1730=_0x2d1730-0x0;var _0x24d4bc=_0x7645[_0x2d1730];return _0x24d4bc;};'use strict';var _=require('lodash');var util=require(_0x5764('0x0'));var logger=require(_0x5764('0x1'))(_0x5764('0x2'));var moment=require('moment');var BPromise=require(_0x5764('0x3'));var rp=require(_0x5764('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5764('0x5'));var config=require('../../config/environment');var attributes=require(_0x5764('0x6'));module[_0x5764('0x7')]=function(_0x57daeb,_0x136471){return _0x57daeb[_0x5764('0x8')]('VoiceMusicOnHold',attributes,{'tableName':'voice_musiconhold','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd60a=['rimraf','../../config/environment','./voiceMusicOnHold.attributes','define','VoiceMusicOnHold','voice_musiconhold','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x93af11,_0x2021e1){var _0xe8f23f=function(_0x38e1ac){while(--_0x38e1ac){_0x93af11['push'](_0x93af11['shift']());}};_0xe8f23f(++_0x2021e1);}(_0xd60a,0x1f4));var _0xad60=function(_0xe50e86,_0x968673){_0xe50e86=_0xe50e86-0x0;var _0x169144=_0xd60a[_0xe50e86];return _0x169144;};'use strict';var _=require('lodash');var util=require(_0xad60('0x0'));var logger=require(_0xad60('0x1'))(_0xad60('0x2'));var moment=require(_0xad60('0x3'));var BPromise=require(_0xad60('0x4'));var rp=require(_0xad60('0x5'));var fs=require('fs');var path=require(_0xad60('0x6'));var rimraf=require(_0xad60('0x7'));var config=require(_0xad60('0x8'));var attributes=require(_0xad60('0x9'));module['exports']=function(_0x562dfb,_0x4fcef1){return _0x562dfb[_0xad60('0xa')](_0xad60('0xb'),attributes,{'tableName':_0xad60('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js index 78066db..9757b3b 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 _0x8bc9=['VoiceMusicOnHold,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','jayson/promise','client','http','request','then','VoiceMusicOnHold,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x230193,_0x30e498){var _0x510793=function(_0x4aab59){while(--_0x4aab59){_0x230193['push'](_0x230193['shift']());}};_0x510793(++_0x30e498);}(_0x8bc9,0x145));var _0x98bc=function(_0x325791,_0x4ba6f8){_0x325791=_0x325791-0x0;var _0x3053a3=_0x8bc9[_0x325791];return _0x3053a3;};'use strict';var _=require(_0x98bc('0x0'));var util=require(_0x98bc('0x1'));var moment=require(_0x98bc('0x2'));var BPromise=require(_0x98bc('0x3'));var rs=require(_0x98bc('0x4'));var fs=require('fs');var Redis=require(_0x98bc('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x98bc('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x98bc('0x7'));var client=jayson[_0x98bc('0x8')][_0x98bc('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x481860,_0x3c233e,_0x546adb){return new BPromise(function(_0x4830fd,_0x108336){return client[_0x98bc('0xa')](_0x481860,_0x546adb)[_0x98bc('0xb')](function(_0x1f5415){logger['info'](_0x98bc('0xc'),_0x3c233e,_0x98bc('0xd'));logger[_0x98bc('0xe')](_0x98bc('0xf'),_0x3c233e,_0x98bc('0xd'),JSON[_0x98bc('0x10')](_0x1f5415));if(_0x1f5415[_0x98bc('0x11')]){if(_0x1f5415['error'][_0x98bc('0x12')]===0x1f4){logger[_0x98bc('0x11')](_0x98bc('0xc'),_0x3c233e,_0x1f5415['error']['message']);return _0x108336(_0x1f5415['error'][_0x98bc('0x13')]);}logger[_0x98bc('0x11')](_0x98bc('0xc'),_0x3c233e,_0x1f5415['error']['message']);return _0x4830fd(_0x1f5415[_0x98bc('0x11')][_0x98bc('0x13')]);}else{logger['info'](_0x98bc('0xc'),_0x3c233e,_0x98bc('0xd'));_0x4830fd(_0x1f5415['result'][_0x98bc('0x13')]);}})['catch'](function(_0x3c1b19){logger[_0x98bc('0x11')](_0x98bc('0xc'),_0x3c233e,_0x3c1b19);_0x108336(_0x3c1b19);});});} \ No newline at end of file +var _0x2f23=['http','request','then','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','VoiceMusicOnHold,\x20%s,\x20%s','result','lodash','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client'];(function(_0x39d544,_0x35c14f){var _0x5a5ff2=function(_0x2271fb){while(--_0x2271fb){_0x39d544['push'](_0x39d544['shift']());}};_0x5a5ff2(++_0x35c14f);}(_0x2f23,0x160));var _0x32f2=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x2f23[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x32f2('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x32f2('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x32f2('0x2'));var db=require(_0x32f2('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x32f2('0x4'))(_0x32f2('0x5'));var config=require(_0x32f2('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x32f2('0x7')][_0x32f2('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x269a6a,_0x2c4798,_0x1fd84d){return new BPromise(function(_0x2821f2,_0x505324){return client[_0x32f2('0x9')](_0x269a6a,_0x1fd84d)[_0x32f2('0xa')](function(_0x465771){logger['info']('VoiceMusicOnHold,\x20%s,\x20%s',_0x2c4798,'request\x20sent');logger[_0x32f2('0xb')](_0x32f2('0xc'),_0x2c4798,_0x32f2('0xd'),JSON[_0x32f2('0xe')](_0x465771));if(_0x465771[_0x32f2('0xf')]){if(_0x465771['error'][_0x32f2('0x10')]===0x1f4){logger[_0x32f2('0xf')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x2c4798,_0x465771[_0x32f2('0xf')][_0x32f2('0x11')]);return _0x505324(_0x465771['error'][_0x32f2('0x11')]);}logger[_0x32f2('0xf')](_0x32f2('0x12'),_0x2c4798,_0x465771[_0x32f2('0xf')][_0x32f2('0x11')]);return _0x2821f2(_0x465771['error'][_0x32f2('0x11')]);}else{logger['info'](_0x32f2('0x12'),_0x2c4798,_0x32f2('0xd'));_0x2821f2(_0x465771[_0x32f2('0x13')][_0x32f2('0x11')]);}})['catch'](function(_0xc93d26){logger[_0x32f2('0xf')](_0x32f2('0x12'),_0x2c4798,_0xc93d26);_0x505324(_0xc93d26);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/index.js b/server/api/voicePrefix/index.js index c83359a..a8c9bb9 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 _0x74d0=['update','delete','removeAgents','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','./voicePrefix.controller','get','index','/describe','/:id','show','getAgents','isAuthenticated','create','/:id/users','addAgents'];(function(_0x2f5f44,_0x1fddf4){var _0x16dce2=function(_0x34f420){while(--_0x34f420){_0x2f5f44['push'](_0x2f5f44['shift']());}};_0x16dce2(++_0x1fddf4);}(_0x74d0,0x88));var _0x074d=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0x74d0[_0xa1e3e3];return _0xc980e9;};'use strict';var multer=require(_0x074d('0x0'));var util=require(_0x074d('0x1'));var path=require(_0x074d('0x2'));var timeout=require(_0x074d('0x3'));var express=require('express');var router=express[_0x074d('0x4')]();var auth=require(_0x074d('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x074d('0x6'));var controller=require(_0x074d('0x7'));router[_0x074d('0x8')]('/',auth['isAuthenticated'](),controller[_0x074d('0x9')]);router['get'](_0x074d('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x074d('0x8')](_0x074d('0xb'),auth['isAuthenticated'](),controller[_0x074d('0xc')]);router[_0x074d('0x8')]('/:id/users',auth['isAuthenticated'](),controller[_0x074d('0xd')]);router['post']('/',auth[_0x074d('0xe')](),controller[_0x074d('0xf')]);router['post'](_0x074d('0x10'),auth[_0x074d('0xe')](),controller[_0x074d('0x11')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x074d('0x12')]);router[_0x074d('0x13')](_0x074d('0xb'),auth[_0x074d('0xe')](),controller['destroy']);router[_0x074d('0x13')](_0x074d('0x10'),auth['isAuthenticated'](),controller[_0x074d('0x14')]);module[_0x074d('0x15')]=router; \ No newline at end of file +var _0x5648=['destroy','delete','removeAgents','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','describe','/:id','show','/:id/users','getAgents','post','create','addAgents','put','update'];(function(_0x349883,_0x53efaa){var _0x47871e=function(_0x6375a3){while(--_0x6375a3){_0x349883['push'](_0x349883['shift']());}};_0x47871e(++_0x53efaa);}(_0x5648,0xfe));var _0x8564=function(_0x5e4f2e,_0x4b7067){_0x5e4f2e=_0x5e4f2e-0x0;var _0x2014ab=_0x5648[_0x5e4f2e];return _0x2014ab;};'use strict';var multer=require(_0x8564('0x0'));var util=require(_0x8564('0x1'));var path=require(_0x8564('0x2'));var timeout=require(_0x8564('0x3'));var express=require(_0x8564('0x4'));var router=express[_0x8564('0x5')]();var auth=require(_0x8564('0x6'));var interaction=require(_0x8564('0x7'));var config=require('../../config/environment');var controller=require('./voicePrefix.controller');router[_0x8564('0x8')]('/',auth[_0x8564('0x9')](),controller[_0x8564('0xa')]);router[_0x8564('0x8')]('/describe',auth[_0x8564('0x9')](),controller[_0x8564('0xb')]);router[_0x8564('0x8')](_0x8564('0xc'),auth[_0x8564('0x9')](),controller[_0x8564('0xd')]);router['get'](_0x8564('0xe'),auth[_0x8564('0x9')](),controller[_0x8564('0xf')]);router[_0x8564('0x10')]('/',auth[_0x8564('0x9')](),controller[_0x8564('0x11')]);router[_0x8564('0x10')](_0x8564('0xe'),auth[_0x8564('0x9')](),controller[_0x8564('0x12')]);router[_0x8564('0x13')](_0x8564('0xc'),auth[_0x8564('0x9')](),controller[_0x8564('0x14')]);router['delete']('/:id',auth[_0x8564('0x9')](),controller[_0x8564('0x15')]);router[_0x8564('0x16')](_0x8564('0xe'),auth[_0x8564('0x9')](),controller[_0x8564('0x17')]);module[_0x8564('0x18')]=router; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.attributes.js b/server/api/voicePrefix/voicePrefix.attributes.js index fc6f2f3..0e3d479 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 _0xb92a=['exports','STRING','name','VIRTUAL','system-','getDataValue','INTEGER','sequelize'];(function(_0x3b49b4,_0x1e0e6e){var _0x3c69fe=function(_0x2e70af){while(--_0x2e70af){_0x3b49b4['push'](_0x3b49b4['shift']());}};_0x3c69fe(++_0x1e0e6e);}(_0xb92a,0x1b7));var _0xab92=function(_0x34448d,_0x58225e){_0x34448d=_0x34448d-0x0;var _0x52bcad=_0xb92a[_0x34448d];return _0x52bcad;};'use strict';var Sequelize=require(_0xab92('0x0'));module[_0xab92('0x1')]={'name':{'type':Sequelize[_0xab92('0x2')],'allowNull':![],'unique':_0xab92('0x3')},'prefix':{'type':Sequelize[_0xab92('0x4')],'get':function(_0x4ee4f0){return _0xab92('0x5')+this[_0xab92('0x6')]('name')+'-';}},'description':{'type':Sequelize[_0xab92('0x2')]},'callerIdAll':{'type':Sequelize['STRING']},'VoiceExtensionId':{'type':Sequelize[_0xab92('0x7')]}}; \ No newline at end of file +var _0x6151=['name','VIRTUAL','system-','getDataValue','INTEGER','sequelize','exports','STRING'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x6151,0xb5));var _0x1615=function(_0x14d250,_0x4b2e12){_0x14d250=_0x14d250-0x0;var _0xb991d8=_0x6151[_0x14d250];return _0xb991d8;};'use strict';var Sequelize=require(_0x1615('0x0'));module[_0x1615('0x1')]={'name':{'type':Sequelize[_0x1615('0x2')],'allowNull':![],'unique':_0x1615('0x3')},'prefix':{'type':Sequelize[_0x1615('0x4')],'get':function(_0x1a4cf6){return _0x1615('0x5')+this[_0x1615('0x6')](_0x1615('0x3'))+'-';}},'description':{'type':Sequelize[_0x1615('0x2')]},'callerIdAll':{'type':Sequelize['STRING']},'VoiceExtensionId':{'type':Sequelize[_0x1615('0x7')]}}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.controller.js b/server/api/voicePrefix/voicePrefix.controller.js index 7363b1c..a1413f5 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 _0xa9e0=['body','VoiceExtension','VoiceExtensionId','user','role','userProfileId','autoAssociation','exten','system','description','Voice\x20Prefix\x20Extension','priority','appdata','prefix','NoOp','Voice\x20Prefix','bulkCreate','Extensions\x20creation\x20failed','Set','CDR(prefix)=','callerIdAll','PREFIX-CALLERIDALL=','push','No\x20callerid\x20available','goto','${EXTEN:','charAt','system-','transaction','findById','addAgents','ids','omit','spread','emit','userVoicePrefix:save','removeAgents','isArray','userVoicePrefix:remove','getAgents','findOne','User','filter','map','hasOwnProperty','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voicePrefix.socket','register','sendStatus','end','status','json','count','offset','limit','set','Content-Range','apply','reject','update','then','destroy','get','UserProfileResource','error','stack','name','send','index','VoicePrefix','rawAttributes','model','keys','query','filters','attributes','intersection','fields','length','nolimit','order','sort','where','pick','merge','type','key','field','options','includeAll','include','findAll','rows','catch','show','params','find','describe','create','sequelize'];(function(_0x30d3c4,_0x14c4d4){var _0x11ce2a=function(_0x225bf6){while(--_0x225bf6){_0x30d3c4['push'](_0x30d3c4['shift']());}};_0x11ce2a(++_0x14c4d4);}(_0xa9e0,0x123));var _0x0a9e=function(_0x36dfbd,_0x5bfe2d){_0x36dfbd=_0x36dfbd-0x0;var _0x4ecad9=_0xa9e0[_0x36dfbd];return _0x4ecad9;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var as=require(_0x0a9e('0x11'));var hardwareService=require(_0x0a9e('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x0a9e('0x13'))['db'];config[_0x0a9e('0x14')]=_[_0x0a9e('0x15')](config[_0x0a9e('0x14')],{'host':_0x0a9e('0x16'),'port':0x18eb});var socket=require(_0x0a9e('0x17'))(new Redis(config['redis']));require(_0x0a9e('0x18'))[_0x0a9e('0x19')](socket);function respondWithStatusCode(_0x2b4227,_0x281129){_0x281129=_0x281129||0xcc;return function(_0x44dcfd){if(_0x44dcfd){return _0x2b4227[_0x0a9e('0x1a')](_0x281129);}return _0x2b4227['status'](_0x281129)[_0x0a9e('0x1b')]();};}function respondWithResult(_0x5d0880,_0x1985b6){_0x1985b6=_0x1985b6||0xc8;return function(_0x519dfd){if(_0x519dfd){return _0x5d0880[_0x0a9e('0x1c')](_0x1985b6)[_0x0a9e('0x1d')](_0x519dfd);}};}function respondWithFilteredResult(_0x48f32d,_0x225616){return function(_0x5a0a06){if(_0x5a0a06){var _0x459eb1=_0x5a0a06[_0x0a9e('0x1e')],_0x478723=_0x225616[_0x0a9e('0x1f')],_0x106033=_0x225616[_0x0a9e('0x1f')]+_0x225616[_0x0a9e('0x20')],_0x205fd6;if(_0x106033>=_0x459eb1){_0x106033=_0x459eb1;_0x205fd6=0xc8;}else{_0x205fd6=0xce;}_0x48f32d[_0x0a9e('0x1c')](_0x205fd6);return _0x48f32d[_0x0a9e('0x21')](_0x0a9e('0x22'),_0x478723+'-'+_0x106033+'/'+_0x459eb1)[_0x0a9e('0x1d')](_0x5a0a06);}return null;};}function patchUpdates(_0x4bb1e3){return function(_0x2c3407){try{jsonpatch[_0x0a9e('0x23')](_0x2c3407,_0x4bb1e3,!![]);}catch(_0x53682f){return BPromise[_0x0a9e('0x24')](_0x53682f);}return _0x2c3407['save']();};}function saveUpdates(_0x588269,_0x3a02e1){return function(_0x432e56){if(_0x432e56){return _0x432e56[_0x0a9e('0x25')](_0x588269)[_0x0a9e('0x26')](function(_0x4abc77){return _0x4abc77;});}return null;};}function removeEntity(_0xfb6e48,_0x2fb0e4){return function(_0x3b45bc){if(_0x3b45bc){return _0x3b45bc[_0x0a9e('0x27')]()[_0x0a9e('0x26')](function(){var _0x42ac8f=_0x3b45bc[_0x0a9e('0x28')]({'plain':!![]});var _0x5ea472='VoicePrefixes';return db[_0x0a9e('0x29')][_0x0a9e('0x27')]({'where':{'type':_0x5ea472,'resourceId':_0x42ac8f['id']}})[_0x0a9e('0x26')](function(){return _0x3b45bc;});})[_0x0a9e('0x26')](function(){_0xfb6e48['status'](0xcc)[_0x0a9e('0x1b')]();});}};}function handleEntityNotFound(_0x479bc4,_0x45a1e7){return function(_0x5bfb33){if(!_0x5bfb33){_0x479bc4[_0x0a9e('0x1a')](0x194);}return _0x5bfb33;};}function handleError(_0x34dc65,_0x25fba9){_0x25fba9=_0x25fba9||0x1f4;return function(_0x14433c){logger[_0x0a9e('0x2a')](_0x14433c[_0x0a9e('0x2b')]);if(_0x14433c[_0x0a9e('0x2c')]){delete _0x14433c[_0x0a9e('0x2c')];}_0x34dc65['status'](_0x25fba9)[_0x0a9e('0x2d')](_0x14433c);};}exports[_0x0a9e('0x2e')]=function(_0x2b1f27,_0x2ec755){var _0x5c877d={},_0x15b200={},_0x40e7a3={'count':0x0,'rows':[]};var _0x1843b2=db[_0x0a9e('0x2f')][_0x0a9e('0x30')];_0x15b200[_0x0a9e('0x31')]=_[_0x0a9e('0x32')](_0x1843b2);_0x15b200[_0x0a9e('0x33')]=_[_0x0a9e('0x32')](_0x2b1f27['query']);_0x15b200[_0x0a9e('0x34')]=_['intersection'](_0x15b200[_0x0a9e('0x31')],_0x15b200[_0x0a9e('0x33')]);_0x5c877d[_0x0a9e('0x35')]=_[_0x0a9e('0x36')](_0x15b200[_0x0a9e('0x31')],qs['fields'](_0x2b1f27[_0x0a9e('0x33')][_0x0a9e('0x37')]));_0x5c877d[_0x0a9e('0x35')]=_0x5c877d[_0x0a9e('0x35')][_0x0a9e('0x38')]?_0x5c877d[_0x0a9e('0x35')]:_0x15b200[_0x0a9e('0x31')];if(!_0x2b1f27[_0x0a9e('0x33')]['hasOwnProperty'](_0x0a9e('0x39'))){_0x5c877d['limit']=qs[_0x0a9e('0x20')](_0x2b1f27[_0x0a9e('0x33')][_0x0a9e('0x20')]);_0x5c877d[_0x0a9e('0x1f')]=qs['offset'](_0x2b1f27[_0x0a9e('0x33')][_0x0a9e('0x1f')]);}_0x5c877d[_0x0a9e('0x3a')]=qs[_0x0a9e('0x3b')](_0x2b1f27['query']['sort']);_0x5c877d[_0x0a9e('0x3c')]=qs['filters'](_[_0x0a9e('0x3d')](_0x2b1f27[_0x0a9e('0x33')],_0x15b200[_0x0a9e('0x34')]));if(_0x2b1f27[_0x0a9e('0x33')]['filter']){_0x5c877d[_0x0a9e('0x3c')]=_[_0x0a9e('0x3e')](_0x5c877d[_0x0a9e('0x3c')],{'$or':_['map'](_0x1843b2,function(_0x1dbf74){if(_0x1dbf74[_0x0a9e('0x3f')][_0x0a9e('0x40')]!=='VIRTUAL'){var _0x546ef8={};_0x546ef8[_0x1dbf74[_0x0a9e('0x41')]]={'$like':'%'+_0x2b1f27[_0x0a9e('0x33')]['filter']+'%'};return _0x546ef8;}})});}_0x5c877d=_[_0x0a9e('0x3e')]({},_0x5c877d,_0x2b1f27[_0x0a9e('0x42')]);var _0x2e1b3a={'where':_0x5c877d[_0x0a9e('0x3c')]};return db['VoicePrefix']['count'](_0x2e1b3a)[_0x0a9e('0x26')](function(_0x45b3d0){_0x40e7a3['count']=_0x45b3d0;if(_0x2b1f27[_0x0a9e('0x33')][_0x0a9e('0x43')]){_0x5c877d[_0x0a9e('0x44')]=[{'all':!![]}];}return db['VoicePrefix'][_0x0a9e('0x45')](_0x5c877d);})[_0x0a9e('0x26')](function(_0x274e8e){_0x40e7a3[_0x0a9e('0x46')]=_0x274e8e;return _0x40e7a3;})[_0x0a9e('0x26')](respondWithFilteredResult(_0x2ec755,_0x5c877d))[_0x0a9e('0x47')](handleError(_0x2ec755,null));};exports[_0x0a9e('0x48')]=function(_0x45a9b8,_0x23b089){var _0x3da2cd={'raw':![],'where':{'id':_0x45a9b8[_0x0a9e('0x49')]['id']}},_0x2c3711={};_0x2c3711[_0x0a9e('0x31')]=_[_0x0a9e('0x32')](db[_0x0a9e('0x2f')]['rawAttributes']);_0x2c3711['query']=_[_0x0a9e('0x32')](_0x45a9b8[_0x0a9e('0x33')]);_0x2c3711[_0x0a9e('0x34')]=_[_0x0a9e('0x36')](_0x2c3711[_0x0a9e('0x31')],_0x2c3711[_0x0a9e('0x33')]);_0x3da2cd[_0x0a9e('0x35')]=_[_0x0a9e('0x36')](_0x2c3711[_0x0a9e('0x31')],qs[_0x0a9e('0x37')](_0x45a9b8[_0x0a9e('0x33')][_0x0a9e('0x37')]));_0x3da2cd['attributes']=_0x3da2cd[_0x0a9e('0x35')][_0x0a9e('0x38')]?_0x3da2cd[_0x0a9e('0x35')]:_0x2c3711[_0x0a9e('0x31')];if(_0x45a9b8[_0x0a9e('0x33')][_0x0a9e('0x43')]){_0x3da2cd[_0x0a9e('0x44')]=[{'all':!![]}];}_0x3da2cd=_[_0x0a9e('0x3e')]({},_0x3da2cd,_0x45a9b8['options']);return db[_0x0a9e('0x2f')]['find'](_0x3da2cd)[_0x0a9e('0x26')](handleEntityNotFound(_0x23b089,null))[_0x0a9e('0x26')](respondWithResult(_0x23b089,null))[_0x0a9e('0x47')](handleError(_0x23b089,null));};exports['destroy']=function(_0x14bec2,_0x7f6eb1){return db[_0x0a9e('0x2f')][_0x0a9e('0x4a')]({'where':{'id':_0x14bec2[_0x0a9e('0x49')]['id']}})[_0x0a9e('0x26')](handleEntityNotFound(_0x7f6eb1,null))[_0x0a9e('0x26')](removeEntity(_0x7f6eb1,null))['catch'](handleError(_0x7f6eb1,null));};exports[_0x0a9e('0x4b')]=function(_0x1bde3c,_0x1b5e80){return db[_0x0a9e('0x2f')][_0x0a9e('0x4b')]()[_0x0a9e('0x26')](respondWithResult(_0x1b5e80,null))[_0x0a9e('0x47')](handleError(_0x1b5e80,null));};exports[_0x0a9e('0x4c')]=function(_0x34febd,_0x58a5c2){var _0xe401a;return db[_0x0a9e('0x4d')]['transaction'](function(_0x4ae14b){return db['VoicePrefix'][_0x0a9e('0x4c')](_0x34febd[_0x0a9e('0x4e')],{'transaction':_0x4ae14b})[_0x0a9e('0x26')](function(_0x11545a){_0xe401a=_0x11545a[_0x0a9e('0x28')]({'plain':!![]});return db[_0x0a9e('0x4f')][_0x0a9e('0x4a')]({'where':{'id':_0xe401a[_0x0a9e('0x50')]},'raw':!![]})['then'](function(_0x4b1b9f){return createVoicePrefixExtensions(_0xe401a,_0x4b1b9f,_0x4ae14b);});});})['then'](function(){var _0x39d77d=_0x34febd[_0x0a9e('0x51')][_0x0a9e('0x28')]({'plain':!![]});if(!_0x39d77d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x39d77d[_0x0a9e('0x52')]===_0x0a9e('0x51')){var _0x53d113=_0xe401a;return db['UserProfileSection'][_0x0a9e('0x4a')]({'where':{'name':'VoicePrefixes','userProfileId':_0x39d77d[_0x0a9e('0x53')]},'raw':!![]})['then'](function(_0x2e5e62){if(_0x2e5e62&&_0x2e5e62[_0x0a9e('0x54')]===0x0){return db[_0x0a9e('0x29')]['create']({'name':_0x53d113[_0x0a9e('0x2c')],'resourceId':_0x53d113['id'],'type':_0x2e5e62[_0x0a9e('0x2c')],'sectionId':_0x2e5e62['id']},{})['then'](function(){return _0xe401a;});}else{return _0xe401a;}})['catch'](function(_0x128aa6){logger[_0x0a9e('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x128aa6);throw _0x128aa6;});}return _0xe401a;})[_0x0a9e('0x26')](respondWithResult(_0x58a5c2,null))['catch'](handleError(_0x58a5c2,null));};function Extension(_0x211ef9,_0x523cd2,_0xe22ccc,_0x4a6deb){this['context']='from-sip';this[_0x0a9e('0x55')]=_0x211ef9;this['app']=_0xe22ccc;this[_0x0a9e('0x3f')]=_0x0a9e('0x56');this[_0x0a9e('0x57')]=_0x0a9e('0x58');this[_0x0a9e('0x59')]=_0x523cd2;this[_0x0a9e('0x5a')]=_0x4a6deb;}function createVoicePrefixExtensions(_0xd10662,_0x28d814,_0x4e67ab){return new BPromise(function(_0x1c693e,_0x121cef){var _0x2642bb=new Extension(formatPrefixName(_0xd10662[_0x0a9e('0x5b')]),0x1,_0x0a9e('0x5c'),_0x0a9e('0x5d'));_0x2642bb['VoicePrefixId']=_0xd10662['id'];return db[_0x0a9e('0x4f')][_0x0a9e('0x4c')](_0x2642bb,{'transaction':_0x4e67ab})['then'](function(_0x3649cc){var _0x5cc8fb=_0x3649cc[_0x0a9e('0x28')]({'plain':!![]});var _0x5ba1f9=_['map'](addVoicePrefixExtensions(_0xd10662,_0x28d814),function(_0x5674ee){_0x5674ee[_0x0a9e('0x50')]=_0x5cc8fb['id'];_0x5674ee['VoicePrefixId']=_0xd10662['id'];return _0x5674ee;});return db[_0x0a9e('0x4f')][_0x0a9e('0x5e')](_0x5ba1f9,{'transaction':_0x4e67ab})[_0x0a9e('0x26')](function(_0x7be420){if(!_0x7be420){return _0x121cef(_0x0a9e('0x5f'));}else{return _0x1c693e(_0x7be420);}})[_0x0a9e('0x47')](function(_0x49eed0){return _0x121cef(_0x49eed0);});});;});};function addVoicePrefixExtensions(_0x1627a7,_0x5854cc){var _0xca4ade=[];var _0x1f07cb=formatPrefixName(_0x1627a7[_0x0a9e('0x5b')]);_0xca4ade['push'](new Extension(_0x1f07cb,0x2,_0x0a9e('0x60'),_0x0a9e('0x61')+_0x1627a7[_0x0a9e('0x2c')]));if(_0x1627a7[_0x0a9e('0x62')]){_0xca4ade['push'](new Extension(_0x1f07cb,0x3,_0x0a9e('0x60'),_0x0a9e('0x63')+_0x1627a7['callerIdAll']));}else{_0xca4ade[_0x0a9e('0x64')](new Extension(_0x1f07cb,0x3,_0x0a9e('0x5c'),_0x0a9e('0x65')));}_0xca4ade[_0x0a9e('0x64')](new Extension(_0x1f07cb,0x4,_0x0a9e('0x66'),_0x5854cc['context']+','+_0x0a9e('0x67')+(0x8+_0x1627a7[_0x0a9e('0x2c')][_0x0a9e('0x38')])+'}'+','+0x1));return _0xca4ade;}function formatPrefixName(_0x47bb43){var _0x3528b7='_';for(var _0x4f1e60=0x0;_0x4f1e60<_0x47bb43['length'];_0x4f1e60++){if(_0x47bb43[_0x0a9e('0x68')](_0x4f1e60)=='-'){_0x3528b7+=_0x47bb43[_0x0a9e('0x68')](_0x4f1e60);}else{_0x3528b7+='['+_0x47bb43[_0x0a9e('0x68')](_0x4f1e60)+']';}}_0x3528b7+='.';return _0x3528b7;}exports[_0x0a9e('0x25')]=function(_0x186f39,_0xc8c264,_0x387489){var _0x54a37d=_0x186f39[_0x0a9e('0x4e')];_0x54a37d[_0x0a9e('0x5b')]=_0x0a9e('0x69')+_0x54a37d[_0x0a9e('0x2c')]+'-';return db[_0x0a9e('0x4d')][_0x0a9e('0x6a')](function(_0x320898){return db[_0x0a9e('0x2f')][_0x0a9e('0x25')](_0x54a37d,{'where':{'id':_0x54a37d['id']},'transaction':_0x320898})[_0x0a9e('0x26')](function(){return db['VoiceExtension'][_0x0a9e('0x27')]({'where':{'VoicePrefixId':_0x54a37d['id']},'transaction':_0x320898})[_0x0a9e('0x26')](function(){return db[_0x0a9e('0x4f')]['find']({'where':{'id':_0x54a37d[_0x0a9e('0x50')]},'raw':!![]})[_0x0a9e('0x26')](function(_0x4b341d){return createVoicePrefixExtensions(_0x54a37d,_0x4b341d,_0x320898);});});});})[_0x0a9e('0x26')](function(){return db[_0x0a9e('0x2f')][_0x0a9e('0x6b')](_0x54a37d['id']);})[_0x0a9e('0x26')](respondWithResult(_0xc8c264,null))[_0x0a9e('0x47')](handleError(_0xc8c264,null));};exports['addAgents']=function(_0x50cdce,_0x4a2438,_0x40fb85){return db[_0x0a9e('0x2f')][_0x0a9e('0x4a')]({'where':{'id':_0x50cdce[_0x0a9e('0x49')]['id']}})[_0x0a9e('0x26')](handleEntityNotFound(_0x4a2438,null))[_0x0a9e('0x26')](function(_0xeef20){if(_0xeef20){return _0xeef20[_0x0a9e('0x6c')](_0x50cdce['body'][_0x0a9e('0x6d')],_[_0x0a9e('0x6e')](_0x50cdce[_0x0a9e('0x4e')],['ids','id'])||{})[_0x0a9e('0x6f')](function(_0x583b2e){for(var _0x4437ff=0x0;_0x4437ff<_0x50cdce[_0x0a9e('0x4e')]['ids'][_0x0a9e('0x38')];_0x4437ff+=0x1){socket[_0x0a9e('0x70')](_0x0a9e('0x71'),{'UserId':_0x50cdce[_0x0a9e('0x4e')]['ids'][_0x4437ff],'VoicePrefixId':_0x50cdce[_0x0a9e('0x49')]['id']});}return _0x583b2e;});}})[_0x0a9e('0x26')](respondWithResult(_0x4a2438,null))[_0x0a9e('0x47')](handleError(_0x4a2438,null));};exports[_0x0a9e('0x72')]=function(_0x5b7fc3,_0x109ccb,_0x3d91db){return db[_0x0a9e('0x2f')][_0x0a9e('0x4a')]({'where':{'id':_0x5b7fc3['params']['id']}})[_0x0a9e('0x26')](handleEntityNotFound(_0x109ccb,null))[_0x0a9e('0x26')](function(_0x30a4c7){if(_0x30a4c7){return _0x30a4c7[_0x0a9e('0x72')](_0x5b7fc3[_0x0a9e('0x33')][_0x0a9e('0x6d')])[_0x0a9e('0x26')](function(){if(_[_0x0a9e('0x73')](_0x5b7fc3[_0x0a9e('0x33')][_0x0a9e('0x6d')])){for(var _0xc4c230=0x0;_0xc4c230<_0x5b7fc3[_0x0a9e('0x33')][_0x0a9e('0x6d')][_0x0a9e('0x38')];_0xc4c230+=0x1){socket['emit'](_0x0a9e('0x74'),{'UserId':Number(_0x5b7fc3[_0x0a9e('0x33')][_0x0a9e('0x6d')][_0xc4c230]),'VoicePrefixId':Number(_0x5b7fc3['params']['id'])});}}else{socket[_0x0a9e('0x70')](_0x0a9e('0x74'),{'UserId':Number(_0x5b7fc3[_0x0a9e('0x33')][_0x0a9e('0x6d')]),'VoicePrefixId':Number(_0x5b7fc3['params']['id'])});}});}})['then'](respondWithStatusCode(_0x109ccb,null))[_0x0a9e('0x47')](handleError(_0x109ccb,null));};exports[_0x0a9e('0x75')]=function(_0x4c54fa,_0x45108c,_0x53a6a1){var _0x260f4b={};var _0x8ebf02={};var _0x5637a1;var _0x28a942;return db[_0x0a9e('0x2f')][_0x0a9e('0x76')]({'where':{'id':_0x4c54fa[_0x0a9e('0x49')]['id']}})[_0x0a9e('0x26')](handleEntityNotFound(_0x45108c,null))[_0x0a9e('0x26')](function(_0x444f1f){if(_0x444f1f){_0x5637a1=_0x444f1f;_0x8ebf02['model']=_[_0x0a9e('0x32')](db[_0x0a9e('0x77')][_0x0a9e('0x30')]);_0x8ebf02[_0x0a9e('0x33')]=_['keys'](_0x4c54fa[_0x0a9e('0x33')]);_0x8ebf02[_0x0a9e('0x34')]=_['intersection'](_0x8ebf02[_0x0a9e('0x31')],_0x8ebf02['query']);_0x260f4b[_0x0a9e('0x35')]=_[_0x0a9e('0x36')](_0x8ebf02[_0x0a9e('0x31')],qs[_0x0a9e('0x37')](_0x4c54fa['query']['fields']));_0x260f4b[_0x0a9e('0x35')]=_0x260f4b[_0x0a9e('0x35')][_0x0a9e('0x38')]?_0x260f4b['attributes']:_0x8ebf02[_0x0a9e('0x31')];_0x260f4b[_0x0a9e('0x3a')]=qs['sort'](_0x4c54fa['query'][_0x0a9e('0x3b')]);_0x260f4b['where']=qs['filters'](_['pick'](_0x4c54fa[_0x0a9e('0x33')],_0x8ebf02[_0x0a9e('0x34')]));if(_0x4c54fa[_0x0a9e('0x33')][_0x0a9e('0x78')]){_0x260f4b[_0x0a9e('0x3c')]=_[_0x0a9e('0x3e')](_0x260f4b['where'],{'$or':_[_0x0a9e('0x79')](_0x260f4b['attributes'],function(_0x2871c1){var _0x2aabab={};_0x2aabab[_0x2871c1]={'$like':'%'+_0x4c54fa[_0x0a9e('0x33')][_0x0a9e('0x78')]+'%'};return _0x2aabab;})});}_0x260f4b=_['merge']({},_0x260f4b,_0x4c54fa[_0x0a9e('0x42')]);return _0x5637a1[_0x0a9e('0x75')](_0x260f4b);}})[_0x0a9e('0x26')](function(_0x5b74c3){if(_0x5b74c3){_0x28a942=_0x5b74c3[_0x0a9e('0x38')];if(!_0x4c54fa[_0x0a9e('0x33')][_0x0a9e('0x7a')](_0x0a9e('0x39'))){_0x260f4b[_0x0a9e('0x20')]=qs[_0x0a9e('0x20')](_0x4c54fa[_0x0a9e('0x33')][_0x0a9e('0x20')]);_0x260f4b['offset']=qs[_0x0a9e('0x1f')](_0x4c54fa[_0x0a9e('0x33')]['offset']);}return _0x5637a1[_0x0a9e('0x75')](_0x260f4b);}})[_0x0a9e('0x26')](function(_0x3a1974){if(_0x3a1974){return _0x3a1974?{'count':_0x28a942,'rows':_0x3a1974}:null;}})['then'](respondWithResult(_0x45108c,null))[_0x0a9e('0x47')](handleError(_0x45108c,null));}; \ No newline at end of file +var _0x9957=['callerIdAll','PREFIX-CALLERIDALL=','No\x20callerid\x20available','goto','${EXTEN:','charAt','system-','findById','addAgents','ids','omit','userVoicePrefix:save','removeAgents','isArray','emit','userVoicePrefix:remove','User','rawAttributes','hasOwnProperty','nolimit','getAgents','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','sendStatus','status','end','offset','set','json','apply','reject','save','update','then','destroy','get','VoicePrefixes','UserProfileResource','stack','name','model','query','keys','filters','intersection','attributes','fields','limit','order','sort','where','pick','filter','merge','map','type','key','VIRTUAL','field','options','VoicePrefix','count','rows','show','params','length','include','find','catch','describe','create','sequelize','transaction','body','VoiceExtension','VoiceExtensionId','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','from-sip','exten','system','description','Voice\x20Prefix\x20Extension','priority','prefix','NoOp','Voice\x20Prefix','VoicePrefixId','bulkCreate','Extensions\x20creation\x20failed','push','Set','CDR(prefix)='];(function(_0x2ee790,_0x5a8661){var _0x5a54a5=function(_0x2713a4){while(--_0x2713a4){_0x2ee790['push'](_0x2ee790['shift']());}};_0x5a54a5(++_0x5a8661);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'use strict';var pdf=require(_0x7995('0x0'));var emlformat=require(_0x7995('0x1'));var rimraf=require(_0x7995('0x2'));var zipdir=require(_0x7995('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7995('0x4'));var moment=require(_0x7995('0x5'));var BPromise=require(_0x7995('0x6'));var Mustache=require(_0x7995('0x7'));var util=require('util');var path=require(_0x7995('0x8'));var sox=require(_0x7995('0x9'));var csv=require(_0x7995('0xa'));var ejs=require(_0x7995('0xb'));var fs=require('fs');var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var db=require(_0x7995('0x19'))['db'];config[_0x7995('0x1a')]=_[_0x7995('0x1b')](config[_0x7995('0x1a')],{'host':_0x7995('0x1c'),'port':0x18eb});var socket=require(_0x7995('0x1d'))(new Redis(config[_0x7995('0x1a')]));require('./voicePrefix.socket')['register'](socket);function respondWithStatusCode(_0x2b4e94,_0x2233dd){_0x2233dd=_0x2233dd||0xcc;return function(_0x24b5bb){if(_0x24b5bb){return _0x2b4e94[_0x7995('0x1e')](_0x2233dd);}return _0x2b4e94[_0x7995('0x1f')](_0x2233dd)[_0x7995('0x20')]();};}function respondWithResult(_0x2202ce,_0x41cbf0){_0x41cbf0=_0x41cbf0||0xc8;return function(_0x5377e5){if(_0x5377e5){return _0x2202ce[_0x7995('0x1f')](_0x41cbf0)['json'](_0x5377e5);}};}function respondWithFilteredResult(_0x2f832e,_0x37f297){return function(_0x43d4b8){if(_0x43d4b8){var _0x291317=_0x43d4b8['count'],_0x1e1415=_0x37f297[_0x7995('0x21')],_0x37a7d4=_0x37f297['offset']+_0x37f297['limit'],_0x4faa60;if(_0x37a7d4>=_0x291317){_0x37a7d4=_0x291317;_0x4faa60=0xc8;}else{_0x4faa60=0xce;}_0x2f832e[_0x7995('0x1f')](_0x4faa60);return _0x2f832e[_0x7995('0x22')]('Content-Range',_0x1e1415+'-'+_0x37a7d4+'/'+_0x291317)[_0x7995('0x23')](_0x43d4b8);}return null;};}function patchUpdates(_0x51f276){return function(_0x4b1a8e){try{jsonpatch[_0x7995('0x24')](_0x4b1a8e,_0x51f276,!![]);}catch(_0x327b1f){return BPromise[_0x7995('0x25')](_0x327b1f);}return _0x4b1a8e[_0x7995('0x26')]();};}function saveUpdates(_0x460924,_0x1c278a){return function(_0x5d40ae){if(_0x5d40ae){return _0x5d40ae[_0x7995('0x27')](_0x460924)[_0x7995('0x28')](function(_0x204507){return _0x204507;});}return null;};}function removeEntity(_0x285437,_0x563799){return function(_0x13bc35){if(_0x13bc35){return _0x13bc35[_0x7995('0x29')]()[_0x7995('0x28')](function(){var _0x59405a=_0x13bc35[_0x7995('0x2a')]({'plain':!![]});var _0x34e70c=_0x7995('0x2b');return db[_0x7995('0x2c')][_0x7995('0x29')]({'where':{'type':_0x34e70c,'resourceId':_0x59405a['id']}})[_0x7995('0x28')](function(){return _0x13bc35;});})['then'](function(){_0x285437[_0x7995('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x229742,_0x49bc7e){return function(_0xf16cc2){if(!_0xf16cc2){_0x229742[_0x7995('0x1e')](0x194);}return _0xf16cc2;};}function handleError(_0x11c1eb,_0x4b6f99){_0x4b6f99=_0x4b6f99||0x1f4;return function(_0x9b2a15){logger['error'](_0x9b2a15[_0x7995('0x2d')]);if(_0x9b2a15[_0x7995('0x2e')]){delete _0x9b2a15[_0x7995('0x2e')];}_0x11c1eb['status'](_0x4b6f99)['send'](_0x9b2a15);};}exports['index']=function(_0x3573be,_0xe6b0b3){var _0x327a81={},_0x2b874d={},_0x2e3493={'count':0x0,'rows':[]};var _0x1ca460=db['VoicePrefix']['rawAttributes'];_0x2b874d[_0x7995('0x2f')]=_['keys'](_0x1ca460);_0x2b874d[_0x7995('0x30')]=_[_0x7995('0x31')](_0x3573be[_0x7995('0x30')]);_0x2b874d[_0x7995('0x32')]=_[_0x7995('0x33')](_0x2b874d['model'],_0x2b874d[_0x7995('0x30')]);_0x327a81[_0x7995('0x34')]=_['intersection'](_0x2b874d['model'],qs['fields'](_0x3573be[_0x7995('0x30')][_0x7995('0x35')]));_0x327a81['attributes']=_0x327a81[_0x7995('0x34')]['length']?_0x327a81[_0x7995('0x34')]:_0x2b874d[_0x7995('0x2f')];if(!_0x3573be[_0x7995('0x30')]['hasOwnProperty']('nolimit')){_0x327a81[_0x7995('0x36')]=qs['limit'](_0x3573be['query'][_0x7995('0x36')]);_0x327a81[_0x7995('0x21')]=qs['offset'](_0x3573be[_0x7995('0x30')][_0x7995('0x21')]);}_0x327a81[_0x7995('0x37')]=qs[_0x7995('0x38')](_0x3573be[_0x7995('0x30')]['sort']);_0x327a81[_0x7995('0x39')]=qs[_0x7995('0x32')](_[_0x7995('0x3a')](_0x3573be[_0x7995('0x30')],_0x2b874d['filters']));if(_0x3573be[_0x7995('0x30')][_0x7995('0x3b')]){_0x327a81[_0x7995('0x39')]=_[_0x7995('0x3c')](_0x327a81[_0x7995('0x39')],{'$or':_[_0x7995('0x3d')](_0x1ca460,function(_0x5688a1){if(_0x5688a1[_0x7995('0x3e')][_0x7995('0x3f')]!==_0x7995('0x40')){var _0x2ea47f={};_0x2ea47f[_0x5688a1[_0x7995('0x41')]]={'$like':'%'+_0x3573be[_0x7995('0x30')][_0x7995('0x3b')]+'%'};return _0x2ea47f;}})});}_0x327a81=_[_0x7995('0x3c')]({},_0x327a81,_0x3573be[_0x7995('0x42')]);var _0x447981={'where':_0x327a81[_0x7995('0x39')]};return db[_0x7995('0x43')][_0x7995('0x44')](_0x447981)['then'](function(_0x50a98e){_0x2e3493[_0x7995('0x44')]=_0x50a98e;if(_0x3573be[_0x7995('0x30')]['includeAll']){_0x327a81['include']=[{'all':!![]}];}return db[_0x7995('0x43')]['findAll'](_0x327a81);})['then'](function(_0x23da6b){_0x2e3493[_0x7995('0x45')]=_0x23da6b;return _0x2e3493;})[_0x7995('0x28')](respondWithFilteredResult(_0xe6b0b3,_0x327a81))['catch'](handleError(_0xe6b0b3,null));};exports[_0x7995('0x46')]=function(_0x5e85b9,_0x3993b5){var _0x5a8881={'raw':![],'where':{'id':_0x5e85b9[_0x7995('0x47')]['id']}},_0x493066={};_0x493066[_0x7995('0x2f')]=_[_0x7995('0x31')](db[_0x7995('0x43')]['rawAttributes']);_0x493066[_0x7995('0x30')]=_[_0x7995('0x31')](_0x5e85b9[_0x7995('0x30')]);_0x493066[_0x7995('0x32')]=_['intersection'](_0x493066['model'],_0x493066[_0x7995('0x30')]);_0x5a8881['attributes']=_[_0x7995('0x33')](_0x493066['model'],qs[_0x7995('0x35')](_0x5e85b9['query'][_0x7995('0x35')]));_0x5a8881[_0x7995('0x34')]=_0x5a8881['attributes'][_0x7995('0x48')]?_0x5a8881[_0x7995('0x34')]:_0x493066[_0x7995('0x2f')];if(_0x5e85b9[_0x7995('0x30')]['includeAll']){_0x5a8881[_0x7995('0x49')]=[{'all':!![]}];}_0x5a8881=_[_0x7995('0x3c')]({},_0x5a8881,_0x5e85b9[_0x7995('0x42')]);return db['VoicePrefix'][_0x7995('0x4a')](_0x5a8881)[_0x7995('0x28')](handleEntityNotFound(_0x3993b5,null))[_0x7995('0x28')](respondWithResult(_0x3993b5,null))[_0x7995('0x4b')](handleError(_0x3993b5,null));};exports[_0x7995('0x29')]=function(_0x51934b,_0x1a5cec){return db[_0x7995('0x43')]['find']({'where':{'id':_0x51934b[_0x7995('0x47')]['id']}})['then'](handleEntityNotFound(_0x1a5cec,null))[_0x7995('0x28')](removeEntity(_0x1a5cec,null))[_0x7995('0x4b')](handleError(_0x1a5cec,null));};exports[_0x7995('0x4c')]=function(_0x30e220,_0xddf537){return db[_0x7995('0x43')][_0x7995('0x4c')]()['then'](respondWithResult(_0xddf537,null))[_0x7995('0x4b')](handleError(_0xddf537,null));};exports[_0x7995('0x4d')]=function(_0x418eb9,_0x4ffc8a){var _0x19da63;return db[_0x7995('0x4e')][_0x7995('0x4f')](function(_0x47d1d8){return db['VoicePrefix']['create'](_0x418eb9[_0x7995('0x50')],{'transaction':_0x47d1d8})[_0x7995('0x28')](function(_0x4cf5db){_0x19da63=_0x4cf5db[_0x7995('0x2a')]({'plain':!![]});return db[_0x7995('0x51')][_0x7995('0x4a')]({'where':{'id':_0x19da63[_0x7995('0x52')]},'raw':!![]})[_0x7995('0x28')](function(_0x528c8e){return createVoicePrefixExtensions(_0x19da63,_0x528c8e,_0x47d1d8);});});})[_0x7995('0x28')](function(){var _0x4ab09f=_0x418eb9[_0x7995('0x53')][_0x7995('0x2a')]({'plain':!![]});if(!_0x4ab09f)throw new Error(_0x7995('0x54'));if(_0x4ab09f['role']==='user'){var _0x54e2b1=_0x19da63;return db['UserProfileSection'][_0x7995('0x4a')]({'where':{'name':_0x7995('0x2b'),'userProfileId':_0x4ab09f[_0x7995('0x55')]},'raw':!![]})[_0x7995('0x28')](function(_0x1d957e){if(_0x1d957e&&_0x1d957e[_0x7995('0x56')]===0x0){return db[_0x7995('0x2c')][_0x7995('0x4d')]({'name':_0x54e2b1[_0x7995('0x2e')],'resourceId':_0x54e2b1['id'],'type':_0x1d957e[_0x7995('0x2e')],'sectionId':_0x1d957e['id']},{})[_0x7995('0x28')](function(){return _0x19da63;});}else{return _0x19da63;}})[_0x7995('0x4b')](function(_0x3da72b){logger[_0x7995('0x57')](_0x7995('0x58'),_0x3da72b);throw _0x3da72b;});}return _0x19da63;})[_0x7995('0x28')](respondWithResult(_0x4ffc8a,null))[_0x7995('0x4b')](handleError(_0x4ffc8a,null));};function Extension(_0x223e08,_0x45e86e,_0x50b7c2,_0x56a374){this[_0x7995('0x59')]=_0x7995('0x5a');this[_0x7995('0x5b')]=_0x223e08;this['app']=_0x50b7c2;this['type']=_0x7995('0x5c');this[_0x7995('0x5d')]=_0x7995('0x5e');this[_0x7995('0x5f')]=_0x45e86e;this['appdata']=_0x56a374;}function createVoicePrefixExtensions(_0x13cd7b,_0x74ff38,_0xef5044){return new BPromise(function(_0x33c49c,_0x502d43){var _0x5e2d97=new Extension(formatPrefixName(_0x13cd7b[_0x7995('0x60')]),0x1,_0x7995('0x61'),_0x7995('0x62'));_0x5e2d97[_0x7995('0x63')]=_0x13cd7b['id'];return db[_0x7995('0x51')][_0x7995('0x4d')](_0x5e2d97,{'transaction':_0xef5044})[_0x7995('0x28')](function(_0x1e2206){var _0x984c23=_0x1e2206['get']({'plain':!![]});var _0x18f230=_[_0x7995('0x3d')](addVoicePrefixExtensions(_0x13cd7b,_0x74ff38),function(_0xdf9e38){_0xdf9e38[_0x7995('0x52')]=_0x984c23['id'];_0xdf9e38['VoicePrefixId']=_0x13cd7b['id'];return _0xdf9e38;});return db['VoiceExtension'][_0x7995('0x64')](_0x18f230,{'transaction':_0xef5044})[_0x7995('0x28')](function(_0x47d5d7){if(!_0x47d5d7){return _0x502d43(_0x7995('0x65'));}else{return _0x33c49c(_0x47d5d7);}})[_0x7995('0x4b')](function(_0x2e3421){return _0x502d43(_0x2e3421);});});;});};function addVoicePrefixExtensions(_0x57727e,_0x32cb04){var _0x4ed662=[];var _0x457d09=formatPrefixName(_0x57727e['prefix']);_0x4ed662[_0x7995('0x66')](new Extension(_0x457d09,0x2,_0x7995('0x67'),_0x7995('0x68')+_0x57727e[_0x7995('0x2e')]));if(_0x57727e[_0x7995('0x69')]){_0x4ed662[_0x7995('0x66')](new Extension(_0x457d09,0x3,_0x7995('0x67'),_0x7995('0x6a')+_0x57727e[_0x7995('0x69')]));}else{_0x4ed662[_0x7995('0x66')](new Extension(_0x457d09,0x3,_0x7995('0x61'),_0x7995('0x6b')));}_0x4ed662['push'](new Extension(_0x457d09,0x4,_0x7995('0x6c'),_0x32cb04[_0x7995('0x59')]+','+_0x7995('0x6d')+(0x8+_0x57727e[_0x7995('0x2e')][_0x7995('0x48')])+'}'+','+0x1));return _0x4ed662;}function formatPrefixName(_0x54a2e0){var _0x4b54f2='_';for(var _0x268fde=0x0;_0x268fde<_0x54a2e0[_0x7995('0x48')];_0x268fde++){if(_0x54a2e0[_0x7995('0x6e')](_0x268fde)=='-'){_0x4b54f2+=_0x54a2e0[_0x7995('0x6e')](_0x268fde);}else{_0x4b54f2+='['+_0x54a2e0['charAt'](_0x268fde)+']';}}_0x4b54f2+='.';return _0x4b54f2;}exports[_0x7995('0x27')]=function(_0x50a12e,_0x5df621,_0xca8238){var _0x36d27d=_0x50a12e[_0x7995('0x50')];_0x36d27d[_0x7995('0x60')]=_0x7995('0x6f')+_0x36d27d[_0x7995('0x2e')]+'-';return db[_0x7995('0x4e')][_0x7995('0x4f')](function(_0x3fde86){return db[_0x7995('0x43')]['update'](_0x36d27d,{'where':{'id':_0x36d27d['id']},'transaction':_0x3fde86})[_0x7995('0x28')](function(){return db[_0x7995('0x51')][_0x7995('0x29')]({'where':{'VoicePrefixId':_0x36d27d['id']},'transaction':_0x3fde86})['then'](function(){return db[_0x7995('0x51')][_0x7995('0x4a')]({'where':{'id':_0x36d27d[_0x7995('0x52')]},'raw':!![]})[_0x7995('0x28')](function(_0x3b0d30){return createVoicePrefixExtensions(_0x36d27d,_0x3b0d30,_0x3fde86);});});});})[_0x7995('0x28')](function(){return db[_0x7995('0x43')][_0x7995('0x70')](_0x36d27d['id']);})[_0x7995('0x28')](respondWithResult(_0x5df621,null))[_0x7995('0x4b')](handleError(_0x5df621,null));};exports[_0x7995('0x71')]=function(_0x535131,_0x5e8b4c,_0xd07c1c){return db[_0x7995('0x43')][_0x7995('0x4a')]({'where':{'id':_0x535131[_0x7995('0x47')]['id']}})['then'](handleEntityNotFound(_0x5e8b4c,null))[_0x7995('0x28')](function(_0x2c9eb6){if(_0x2c9eb6){return _0x2c9eb6['addAgents'](_0x535131['body'][_0x7995('0x72')],_[_0x7995('0x73')](_0x535131['body'],[_0x7995('0x72'),'id'])||{})['spread'](function(_0x3758f9){for(var _0xea9aba=0x0;_0xea9aba<_0x535131['body']['ids'][_0x7995('0x48')];_0xea9aba+=0x1){socket['emit'](_0x7995('0x74'),{'UserId':_0x535131[_0x7995('0x50')][_0x7995('0x72')][_0xea9aba],'VoicePrefixId':_0x535131[_0x7995('0x47')]['id']});}return _0x3758f9;});}})[_0x7995('0x28')](respondWithResult(_0x5e8b4c,null))[_0x7995('0x4b')](handleError(_0x5e8b4c,null));};exports[_0x7995('0x75')]=function(_0x14cb17,_0x29e0ee,_0x117317){return db[_0x7995('0x43')][_0x7995('0x4a')]({'where':{'id':_0x14cb17[_0x7995('0x47')]['id']}})[_0x7995('0x28')](handleEntityNotFound(_0x29e0ee,null))[_0x7995('0x28')](function(_0x3773de){if(_0x3773de){return _0x3773de[_0x7995('0x75')](_0x14cb17[_0x7995('0x30')][_0x7995('0x72')])[_0x7995('0x28')](function(){if(_[_0x7995('0x76')](_0x14cb17[_0x7995('0x30')][_0x7995('0x72')])){for(var _0x280fbb=0x0;_0x280fbb<_0x14cb17[_0x7995('0x30')][_0x7995('0x72')][_0x7995('0x48')];_0x280fbb+=0x1){socket[_0x7995('0x77')]('userVoicePrefix:remove',{'UserId':Number(_0x14cb17[_0x7995('0x30')][_0x7995('0x72')][_0x280fbb]),'VoicePrefixId':Number(_0x14cb17['params']['id'])});}}else{socket['emit'](_0x7995('0x78'),{'UserId':Number(_0x14cb17[_0x7995('0x30')][_0x7995('0x72')]),'VoicePrefixId':Number(_0x14cb17[_0x7995('0x47')]['id'])});}});}})[_0x7995('0x28')](respondWithStatusCode(_0x29e0ee,null))[_0x7995('0x4b')](handleError(_0x29e0ee,null));};exports['getAgents']=function(_0x2f8a2d,_0xb68962,_0x3fea6a){var _0x77b03f={};var _0x7d9c6e={};var _0x3f0bff;var _0x151d99;return db[_0x7995('0x43')]['findOne']({'where':{'id':_0x2f8a2d[_0x7995('0x47')]['id']}})[_0x7995('0x28')](handleEntityNotFound(_0xb68962,null))['then'](function(_0x479271){if(_0x479271){_0x3f0bff=_0x479271;_0x7d9c6e[_0x7995('0x2f')]=_[_0x7995('0x31')](db[_0x7995('0x79')][_0x7995('0x7a')]);_0x7d9c6e[_0x7995('0x30')]=_['keys'](_0x2f8a2d[_0x7995('0x30')]);_0x7d9c6e[_0x7995('0x32')]=_['intersection'](_0x7d9c6e[_0x7995('0x2f')],_0x7d9c6e[_0x7995('0x30')]);_0x77b03f['attributes']=_[_0x7995('0x33')](_0x7d9c6e['model'],qs[_0x7995('0x35')](_0x2f8a2d[_0x7995('0x30')][_0x7995('0x35')]));_0x77b03f[_0x7995('0x34')]=_0x77b03f[_0x7995('0x34')]['length']?_0x77b03f[_0x7995('0x34')]:_0x7d9c6e[_0x7995('0x2f')];_0x77b03f[_0x7995('0x37')]=qs['sort'](_0x2f8a2d[_0x7995('0x30')][_0x7995('0x38')]);_0x77b03f[_0x7995('0x39')]=qs[_0x7995('0x32')](_['pick'](_0x2f8a2d[_0x7995('0x30')],_0x7d9c6e[_0x7995('0x32')]));if(_0x2f8a2d[_0x7995('0x30')]['filter']){_0x77b03f['where']=_[_0x7995('0x3c')](_0x77b03f[_0x7995('0x39')],{'$or':_['map'](_0x77b03f['attributes'],function(_0x2e3dfe){var _0x1e50b1={};_0x1e50b1[_0x2e3dfe]={'$like':'%'+_0x2f8a2d[_0x7995('0x30')][_0x7995('0x3b')]+'%'};return _0x1e50b1;})});}_0x77b03f=_[_0x7995('0x3c')]({},_0x77b03f,_0x2f8a2d['options']);return _0x3f0bff['getAgents'](_0x77b03f);}})[_0x7995('0x28')](function(_0x54fad4){if(_0x54fad4){_0x151d99=_0x54fad4['length'];if(!_0x2f8a2d[_0x7995('0x30')][_0x7995('0x7b')](_0x7995('0x7c'))){_0x77b03f['limit']=qs[_0x7995('0x36')](_0x2f8a2d[_0x7995('0x30')][_0x7995('0x36')]);_0x77b03f[_0x7995('0x21')]=qs[_0x7995('0x21')](_0x2f8a2d['query'][_0x7995('0x21')]);}return _0x3f0bff[_0x7995('0x7d')](_0x77b03f);}})[_0x7995('0x28')](function(_0x14b942){if(_0x14b942){return _0x14b942?{'count':_0x151d99,'rows':_0x14b942}:null;}})['then'](respondWithResult(_0xb68962,null))[_0x7995('0x4b')](handleError(_0xb68962,null));}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.events.js b/server/api/voicePrefix/voicePrefix.events.js index 9446c09..5387a57 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 _0x99cd=['hasOwnProperty','exports','events','VoicePrefix','setMaxListeners','save','update','remove','emit'];(function(_0x5880ad,_0x4da2dc){var _0x5b3222=function(_0x4d59d8){while(--_0x4d59d8){_0x5880ad['push'](_0x5880ad['shift']());}};_0x5b3222(++_0x4da2dc);}(_0x99cd,0x1df));var _0xd99c=function(_0x1b6baa,_0x5779f4){_0x1b6baa=_0x1b6baa-0x0;var _0x352a29=_0x99cd[_0x1b6baa];return _0x352a29;};'use strict';var EventEmitter=require(_0xd99c('0x0'));var VoicePrefix=require('../../mysqldb')['db'][_0xd99c('0x1')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0xd99c('0x2')](0x0);var events={'afterCreate':_0xd99c('0x3'),'afterUpdate':_0xd99c('0x4'),'afterDestroy':_0xd99c('0x5')};function emitEvent(_0x3491f3){return function(_0x21927c,_0x431503,_0x178a00){VoicePrefixEvents[_0xd99c('0x6')](_0x3491f3+':'+_0x21927c['id'],_0x21927c);VoicePrefixEvents['emit'](_0x3491f3,_0x21927c);_0x178a00(null);};}for(var e in events){if(events[_0xd99c('0x7')](e)){var event=events[e];VoicePrefix['hook'](e,emitEvent(event));}}module[_0xd99c('0x8')]=VoicePrefixEvents; \ No newline at end of file +var _0xeb00=['events','VoicePrefix','setMaxListeners','save','update','remove','emit','hook','exports'];(function(_0x178018,_0x26b1f1){var _0x58ab8e=function(_0x9b2671){while(--_0x9b2671){_0x178018['push'](_0x178018['shift']());}};_0x58ab8e(++_0x26b1f1);}(_0xeb00,0x129));var _0x0eb0=function(_0x3a3061,_0x211f18){_0x3a3061=_0x3a3061-0x0;var _0x59a5f1=_0xeb00[_0x3a3061];return _0x59a5f1;};'use strict';var EventEmitter=require(_0x0eb0('0x0'));var VoicePrefix=require('../../mysqldb')['db'][_0x0eb0('0x1')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0x0eb0('0x2')](0x0);var events={'afterCreate':_0x0eb0('0x3'),'afterUpdate':_0x0eb0('0x4'),'afterDestroy':_0x0eb0('0x5')};function emitEvent(_0x4e24b1){return function(_0x48b7f0,_0x69445c,_0x238ad7){VoicePrefixEvents[_0x0eb0('0x6')](_0x4e24b1+':'+_0x48b7f0['id'],_0x48b7f0);VoicePrefixEvents[_0x0eb0('0x6')](_0x4e24b1,_0x48b7f0);_0x238ad7(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoicePrefix[_0x0eb0('0x7')](e,emitEvent(event));}}module[_0x0eb0('0x8')]=VoicePrefixEvents; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.model.js b/server/api/voicePrefix/voicePrefix.model.js index ef0a7e8..b518f03 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 _0xa17b=['path','rimraf','../../config/environment','./voicePrefix.attributes','exports','lodash','../../config/logger','api'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa17b,0x7d));var _0xba17=function(_0x186a9d,_0xf0bb71){_0x186a9d=_0x186a9d-0x0;var _0x2a7e5b=_0xa17b[_0x186a9d];return _0x2a7e5b;};'use strict';var _=require(_0xba17('0x0'));var util=require('util');var logger=require(_0xba17('0x1'))(_0xba17('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xba17('0x3'));var rimraf=require(_0xba17('0x4'));var config=require(_0xba17('0x5'));var attributes=require(_0xba17('0x6'));module[_0xba17('0x7')]=function(_0x4b4503,_0x6c9ab0){return _0x4b4503['define']('VoicePrefix',attributes,{'tableName':'voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1118=['bluebird','request-promise','path','rimraf','./voicePrefix.attributes','exports','define','voice_prefixes','util','../../config/logger','api','moment'];(function(_0x3bb372,_0x4ce51e){var _0x59ab0e=function(_0x9a174a){while(--_0x9a174a){_0x3bb372['push'](_0x3bb372['shift']());}};_0x59ab0e(++_0x4ce51e);}(_0x1118,0x1dc));var _0x8111=function(_0x5dca86,_0x185502){_0x5dca86=_0x5dca86-0x0;var _0x515556=_0x1118[_0x5dca86];return _0x515556;};'use strict';var _=require('lodash');var util=require(_0x8111('0x0'));var logger=require(_0x8111('0x1'))(_0x8111('0x2'));var moment=require(_0x8111('0x3'));var BPromise=require(_0x8111('0x4'));var rp=require(_0x8111('0x5'));var fs=require('fs');var path=require(_0x8111('0x6'));var rimraf=require(_0x8111('0x7'));var config=require('../../config/environment');var attributes=require(_0x8111('0x8'));module[_0x8111('0x9')]=function(_0x1fd886,_0x2470b0){return _0x1fd886[_0x8111('0xa')]('VoicePrefix',attributes,{'tableName':_0x8111('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.rpc.js b/server/api/voicePrefix/voicePrefix.rpc.js index 70d4541..4ae4ac1 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 _0x0611=['then','info','VoicePrefix,\x20%s,\x20%s','request\x20sent','debug','VoicePrefix,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','./voicePrefix.socket','register','request'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0611,0x1bc));var _0x1061=function(_0x4403ce,_0x192fc7){_0x4403ce=_0x4403ce-0x0;var _0x1fa8cf=_0x0611[_0x4403ce];return _0x1fa8cf;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x1061('0x0'));var rs=require(_0x1061('0x1'));var fs=require('fs');var Redis=require(_0x1061('0x2'));var db=require(_0x1061('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x1061('0x4'))(_0x1061('0x5'));var config=require(_0x1061('0x6'));var jayson=require(_0x1061('0x7'));var client=jayson['client'][_0x1061('0x8')]({'port':0x232a});config[_0x1061('0x9')]=_[_0x1061('0xa')](config[_0x1061('0x9')],{'host':_0x1061('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1061('0x9')]));require(_0x1061('0xc'))[_0x1061('0xd')](socket);function respondWithRpcPromise(_0x442963,_0x3a4ac2,_0x30faa5){return new BPromise(function(_0x118c97,_0x3b5d03){return client[_0x1061('0xe')](_0x442963,_0x30faa5)[_0x1061('0xf')](function(_0x1c00c1){logger[_0x1061('0x10')](_0x1061('0x11'),_0x3a4ac2,_0x1061('0x12'));logger[_0x1061('0x13')](_0x1061('0x14'),_0x3a4ac2,_0x1061('0x12'),JSON[_0x1061('0x15')](_0x1c00c1));if(_0x1c00c1[_0x1061('0x16')]){if(_0x1c00c1[_0x1061('0x16')][_0x1061('0x17')]===0x1f4){logger[_0x1061('0x16')](_0x1061('0x11'),_0x3a4ac2,_0x1c00c1[_0x1061('0x16')]['message']);return _0x3b5d03(_0x1c00c1['error']['message']);}logger[_0x1061('0x16')]('VoicePrefix,\x20%s,\x20%s',_0x3a4ac2,_0x1c00c1['error'][_0x1061('0x18')]);return _0x118c97(_0x1c00c1[_0x1061('0x16')][_0x1061('0x18')]);}else{logger[_0x1061('0x10')](_0x1061('0x11'),_0x3a4ac2,_0x1061('0x12'));_0x118c97(_0x1c00c1[_0x1061('0x19')][_0x1061('0x18')]);}})[_0x1061('0x1a')](function(_0x4ec453){logger[_0x1061('0x16')]('VoicePrefix,\x20%s,\x20%s',_0x3a4ac2,_0x4ec453);_0x3b5d03(_0x4ec453);});});} \ No newline at end of file +var _0x5a4f=['VoicePrefix,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./voicePrefix.socket','register','request','then','info','VoicePrefix,\x20%s,\x20%s','debug'];(function(_0x453e38,_0x48864b){var _0x75894e=function(_0x1af443){while(--_0x1af443){_0x453e38['push'](_0x453e38['shift']());}};_0x75894e(++_0x48864b);}(_0x5a4f,0x10d));var _0xf5a4=function(_0x1d24eb,_0x12295b){_0x1d24eb=_0x1d24eb-0x0;var _0x1dc576=_0x5a4f[_0x1d24eb];return _0x1dc576;};'use strict';var _=require(_0xf5a4('0x0'));var util=require('util');var moment=require(_0xf5a4('0x1'));var BPromise=require('bluebird');var rs=require(_0xf5a4('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf5a4('0x3'))['db'];var utils=require(_0xf5a4('0x4'));var logger=require(_0xf5a4('0x5'))(_0xf5a4('0x6'));var config=require(_0xf5a4('0x7'));var jayson=require(_0xf5a4('0x8'));var client=jayson[_0xf5a4('0x9')]['http']({'port':0x232a});config[_0xf5a4('0xa')]=_[_0xf5a4('0xb')](config[_0xf5a4('0xa')],{'host':_0xf5a4('0xc'),'port':0x18eb});var socket=require(_0xf5a4('0xd'))(new Redis(config[_0xf5a4('0xa')]));require(_0xf5a4('0xe'))[_0xf5a4('0xf')](socket);function respondWithRpcPromise(_0x63560e,_0xdb88b7,_0x3cdf31){return new BPromise(function(_0x548bc2,_0x1a9dc4){return client[_0xf5a4('0x10')](_0x63560e,_0x3cdf31)[_0xf5a4('0x11')](function(_0x410121){logger[_0xf5a4('0x12')](_0xf5a4('0x13'),_0xdb88b7,'request\x20sent');logger[_0xf5a4('0x14')](_0xf5a4('0x15'),_0xdb88b7,_0xf5a4('0x16'),JSON[_0xf5a4('0x17')](_0x410121));if(_0x410121[_0xf5a4('0x18')]){if(_0x410121[_0xf5a4('0x18')][_0xf5a4('0x19')]===0x1f4){logger['error'](_0xf5a4('0x13'),_0xdb88b7,_0x410121[_0xf5a4('0x18')][_0xf5a4('0x1a')]);return _0x1a9dc4(_0x410121[_0xf5a4('0x18')][_0xf5a4('0x1a')]);}logger[_0xf5a4('0x18')]('VoicePrefix,\x20%s,\x20%s',_0xdb88b7,_0x410121[_0xf5a4('0x18')][_0xf5a4('0x1a')]);return _0x548bc2(_0x410121['error'][_0xf5a4('0x1a')]);}else{logger['info']('VoicePrefix,\x20%s,\x20%s',_0xdb88b7,_0xf5a4('0x16'));_0x548bc2(_0x410121[_0xf5a4('0x1b')][_0xf5a4('0x1a')]);}})[_0xf5a4('0x1c')](function(_0x3a7acf){logger[_0xf5a4('0x18')](_0xf5a4('0x13'),_0xdb88b7,_0x3a7acf);_0x1a9dc4(_0x3a7acf);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.socket.js b/server/api/voicePrefix/voicePrefix.socket.js index bda3c3d..a42dc4b 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 _0xf943=['update','removeListener','length','voicePrefix:','./voicePrefix.events','save'];(function(_0x6af1b1,_0x4ccf9e){var _0x139dae=function(_0x409ebf){while(--_0x409ebf){_0x6af1b1['push'](_0x6af1b1['shift']());}};_0x139dae(++_0x4ccf9e);}(_0xf943,0x13c));var _0x3f94=function(_0x3d943a,_0x47aa2a){_0x3d943a=_0x3d943a-0x0;var _0x32532e=_0xf943[_0x3d943a];return _0x32532e;};'use strict';var VoicePrefixEvents=require(_0x3f94('0x0'));var events=[_0x3f94('0x1'),'remove',_0x3f94('0x2')];function createListener(_0x5b2df4,_0x3d1324){return function(_0x250b52){_0x3d1324['emit'](_0x5b2df4,_0x250b52);};}function removeListener(_0x5c45b9,_0xcbfde5){return function(){VoicePrefixEvents[_0x3f94('0x3')](_0x5c45b9,_0xcbfde5);};}exports['register']=function(_0x5074ae){for(var _0x166d80=0x0,_0x164f6f=events[_0x3f94('0x4')];_0x166d80<_0x164f6f;_0x166d80++){var _0x3f82de=events[_0x166d80];var _0x1ce0d5=createListener(_0x3f94('0x5')+_0x3f82de,_0x5074ae);VoicePrefixEvents['on'](_0x3f82de,_0x1ce0d5);}}; \ No newline at end of file +var _0xa366=['./voicePrefix.events','save','remove','emit','removeListener','register','length','voicePrefix:'];(function(_0x36ef47,_0x4e9095){var _0x364d32=function(_0x5863f6){while(--_0x5863f6){_0x36ef47['push'](_0x36ef47['shift']());}};_0x364d32(++_0x4e9095);}(_0xa366,0x88));var _0x6a36=function(_0x166cc7,_0x486d0c){_0x166cc7=_0x166cc7-0x0;var _0x196799=_0xa366[_0x166cc7];return _0x196799;};'use strict';var VoicePrefixEvents=require(_0x6a36('0x0'));var events=[_0x6a36('0x1'),_0x6a36('0x2'),'update'];function createListener(_0x2e4ebf,_0x4e3e2e){return function(_0x57393c){_0x4e3e2e[_0x6a36('0x3')](_0x2e4ebf,_0x57393c);};}function removeListener(_0x3e3c2c,_0x562b7c){return function(){VoicePrefixEvents[_0x6a36('0x4')](_0x3e3c2c,_0x562b7c);};}exports[_0x6a36('0x5')]=function(_0x1034c9){for(var _0x561005=0x0,_0x5de510=events[_0x6a36('0x6')];_0x561005<_0x5de510;_0x561005++){var _0x2c0892=events[_0x561005];var _0x368ad6=createListener(_0x6a36('0x7')+_0x2c0892,_0x1034c9);VoicePrefixEvents['on'](_0x2c0892,_0x368ad6);}}; \ No newline at end of file diff --git a/server/api/voiceQueue/index.js b/server/api/voiceQueue/index.js index 28443cd..9ada171 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 _0x2b32=['addTeams','addAgents','/:id/lists','addLists','addBlackLists','put','update','destroy','delete','removeTeams','removeAgents','removeBlackLists','exports','multer','path','connect-timeout','express','Router','../../config/environment','./voiceQueue.controller','isAuthenticated','index','get','/:id','show','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','getHopperFinals','/:id/hopper_black','getTeams','/:id/users','getAgents','/:id/members','getMembers','getLists','/:id/blacklists','getBlackLists','post','create','/:id/clone','clone','/:id/teams'];(function(_0x38c773,_0x199a45){var _0x196e46=function(_0x51e23e){while(--_0x51e23e){_0x38c773['push'](_0x38c773['shift']());}};_0x196e46(++_0x199a45);}(_0x2b32,0x199));var _0x22b3=function(_0x2d5411,_0x1a439f){_0x2d5411=_0x2d5411-0x0;var _0x4f13d7=_0x2b32[_0x2d5411];return _0x4f13d7;};'use strict';var multer=require(_0x22b3('0x0'));var util=require('util');var path=require(_0x22b3('0x1'));var timeout=require(_0x22b3('0x2'));var express=require(_0x22b3('0x3'));var router=express[_0x22b3('0x4')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x22b3('0x5'));var controller=require(_0x22b3('0x6'));router['get']('/',auth[_0x22b3('0x7')](),controller[_0x22b3('0x8')]);router[_0x22b3('0x9')](_0x22b3('0xa'),auth['isAuthenticated'](),controller[_0x22b3('0xb')]);router[_0x22b3('0x9')](_0x22b3('0xc'),auth[_0x22b3('0x7')](),controller[_0x22b3('0xd')]);router['get'](_0x22b3('0xe'),auth[_0x22b3('0x7')](),controller[_0x22b3('0xf')]);router[_0x22b3('0x9')]('/:id/hopper_finals',auth[_0x22b3('0x7')](),controller[_0x22b3('0x10')]);router[_0x22b3('0x9')](_0x22b3('0x11'),auth[_0x22b3('0x7')](),controller['getHopperBlacks']);router[_0x22b3('0x9')]('/:id/teams',auth[_0x22b3('0x7')](),controller[_0x22b3('0x12')]);router[_0x22b3('0x9')](_0x22b3('0x13'),auth[_0x22b3('0x7')](),controller[_0x22b3('0x14')]);router[_0x22b3('0x9')](_0x22b3('0x15'),auth[_0x22b3('0x7')](),controller[_0x22b3('0x16')]);router[_0x22b3('0x9')]('/:id/lists',auth[_0x22b3('0x7')](),controller[_0x22b3('0x17')]);router['get'](_0x22b3('0x18'),auth[_0x22b3('0x7')](),controller[_0x22b3('0x19')]);router[_0x22b3('0x1a')]('/',auth[_0x22b3('0x7')](),controller[_0x22b3('0x1b')]);router[_0x22b3('0x1a')](_0x22b3('0x1c'),auth[_0x22b3('0x7')](),controller[_0x22b3('0x1d')]);router[_0x22b3('0x1a')](_0x22b3('0x1e'),auth[_0x22b3('0x7')](),controller[_0x22b3('0x1f')]);router[_0x22b3('0x1a')](_0x22b3('0x13'),auth['isAuthenticated'](),controller[_0x22b3('0x20')]);router[_0x22b3('0x1a')](_0x22b3('0x21'),auth[_0x22b3('0x7')](),controller[_0x22b3('0x22')]);router[_0x22b3('0x1a')](_0x22b3('0x18'),auth[_0x22b3('0x7')](),controller[_0x22b3('0x23')]);router[_0x22b3('0x24')]('/:id',auth[_0x22b3('0x7')](),controller[_0x22b3('0x25')]);router['delete'](_0x22b3('0xa'),auth[_0x22b3('0x7')](),controller[_0x22b3('0x26')]);router[_0x22b3('0x27')]('/:id/teams',auth[_0x22b3('0x7')](),controller[_0x22b3('0x28')]);router['delete'](_0x22b3('0x13'),auth['isAuthenticated'](),controller[_0x22b3('0x29')]);router[_0x22b3('0x27')](_0x22b3('0x21'),auth[_0x22b3('0x7')](),controller['removeLists']);router[_0x22b3('0x27')](_0x22b3('0x18'),auth[_0x22b3('0x7')](),controller[_0x22b3('0x2a')]);module[_0x22b3('0x2b')]=router; \ No newline at end of file +var _0x3ae7=['post','create','/:id/clone','clone','/:id/teams','addAgents','addLists','/:id/blacklists','addBlackLists','put','delete','removeTeams','removeAgents','removeLists','removeBlackLists','exports','multer','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueue.controller','isAuthenticated','index','get','/:id','getHoppers','getHopperHistories','/:id/hopper_finals','/:id/hopper_black','getHopperBlacks','getTeams','/:id/users','getMembers','/:id/lists'];(function(_0x3eef48,_0x4ddd1d){var _0x3c7008=function(_0x39b225){while(--_0x39b225){_0x3eef48['push'](_0x3eef48['shift']());}};_0x3c7008(++_0x4ddd1d);}(_0x3ae7,0x7c));var _0x73ae=function(_0x949e60,_0xe2f67d){_0x949e60=_0x949e60-0x0;var _0x1eb289=_0x3ae7[_0x949e60];return _0x1eb289;};'use strict';var multer=require(_0x73ae('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x73ae('0x1'));var router=express[_0x73ae('0x2')]();var auth=require(_0x73ae('0x3'));var interaction=require(_0x73ae('0x4'));var config=require(_0x73ae('0x5'));var controller=require(_0x73ae('0x6'));router['get']('/',auth[_0x73ae('0x7')](),controller[_0x73ae('0x8')]);router[_0x73ae('0x9')](_0x73ae('0xa'),auth[_0x73ae('0x7')](),controller['show']);router[_0x73ae('0x9')]('/:id/hoppers',auth[_0x73ae('0x7')](),controller[_0x73ae('0xb')]);router[_0x73ae('0x9')]('/:id/hopper_histories',auth['isAuthenticated'](),controller[_0x73ae('0xc')]);router[_0x73ae('0x9')](_0x73ae('0xd'),auth[_0x73ae('0x7')](),controller['getHopperFinals']);router[_0x73ae('0x9')](_0x73ae('0xe'),auth['isAuthenticated'](),controller[_0x73ae('0xf')]);router[_0x73ae('0x9')]('/:id/teams',auth[_0x73ae('0x7')](),controller[_0x73ae('0x10')]);router[_0x73ae('0x9')](_0x73ae('0x11'),auth[_0x73ae('0x7')](),controller['getAgents']);router[_0x73ae('0x9')]('/:id/members',auth[_0x73ae('0x7')](),controller[_0x73ae('0x12')]);router[_0x73ae('0x9')](_0x73ae('0x13'),auth['isAuthenticated'](),controller['getLists']);router[_0x73ae('0x9')]('/:id/blacklists',auth[_0x73ae('0x7')](),controller['getBlackLists']);router[_0x73ae('0x14')]('/',auth[_0x73ae('0x7')](),controller[_0x73ae('0x15')]);router['post'](_0x73ae('0x16'),auth[_0x73ae('0x7')](),controller[_0x73ae('0x17')]);router['post'](_0x73ae('0x18'),auth[_0x73ae('0x7')](),controller['addTeams']);router[_0x73ae('0x14')](_0x73ae('0x11'),auth[_0x73ae('0x7')](),controller[_0x73ae('0x19')]);router[_0x73ae('0x14')](_0x73ae('0x13'),auth[_0x73ae('0x7')](),controller[_0x73ae('0x1a')]);router[_0x73ae('0x14')](_0x73ae('0x1b'),auth['isAuthenticated'](),controller[_0x73ae('0x1c')]);router[_0x73ae('0x1d')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x73ae('0x1e')]('/:id',auth[_0x73ae('0x7')](),controller['destroy']);router['delete'](_0x73ae('0x18'),auth[_0x73ae('0x7')](),controller[_0x73ae('0x1f')]);router[_0x73ae('0x1e')](_0x73ae('0x11'),auth[_0x73ae('0x7')](),controller[_0x73ae('0x20')]);router[_0x73ae('0x1e')](_0x73ae('0x13'),auth['isAuthenticated'](),controller[_0x73ae('0x21')]);router['delete'](_0x73ae('0x1b'),auth[_0x73ae('0x7')](),controller[_0x73ae('0x22')]);module[_0x73ae('0x23')]=router; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.attributes.js b/server/api/voiceQueue/voiceQueue.attributes.js index a0a89f4..06d7b94 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 _0x5af5=['wrapuptime','Active/Disactive\x20Campaign','preview','power','progressive','UNSIGNED','Max\x209999\x20channels,\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)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','tTxX','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','onlyIfOpen','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Maximum\x20Word\x20Length','DESC','ASC','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','Cut\x20Digit\x20(min:1,\x20max:15)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','STRING','name','inbound','outbound','ringall','rrmemory','linear','wrandom','rrordered','setDataValue','strategy','getDataValue','type','booked','predictive','INTEGER','yes','ENUM','all','once','TEXT','periodic_announce','join','split','joinempty','leavewhenempty','BOOLEAN','acw'];(function(_0x13b02f,_0x462a53){var _0x12e9a6=function(_0x187d57){while(--_0x187d57){_0x13b02f['push'](_0x13b02f['shift']());}};_0x12e9a6(++_0x462a53);}(_0x5af5,0x176));var _0x55af=function(_0x82240e,_0x1c8aa0){_0x82240e=_0x82240e-0x0;var _0x4a33a7=_0x5af5[_0x82240e];return _0x4a33a7;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x55af('0x0')],'allowNull':![],'unique':_0x55af('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM'](_0x55af('0x2'),_0x55af('0x3')),'allowNull':![],'defaultValue':_0x55af('0x2')},'musiconhold':{'type':Sequelize[_0x55af('0x0')],'defaultValue':'default'},'announce':{'type':Sequelize[_0x55af('0x0')],'defaultValue':''},'strategy':{'type':Sequelize['ENUM']('rr',_0x55af('0x4'),'leastrecent','fewestcalls','random',_0x55af('0x5'),_0x55af('0x6'),_0x55af('0x7'),_0x55af('0x8')),'allowNull':![],'defaultValue':'ringall','set':function(_0x550d4a){this[_0x55af('0x9')](_0x55af('0xa'),_0x550d4a?_0x550d4a:_0x55af('0x5'));},'get':function(){var _0x160534=this[_0x55af('0xb')](_0x55af('0xc'));var _0x24f355=this['getDataValue']('dialMethod');var _0x39a5e4=this[_0x55af('0xb')](_0x55af('0xa'));if(_0x160534===_0x55af('0x2')){return _0x39a5e4;}if(_0x24f355===_0x55af('0xd')&&_0x39a5e4===_0x55af('0x5')||_0x24f355===_0x55af('0xd')&&_0x39a5e4==='roundrobin'){return _0x39a5e4;}if(_0x24f355==='progressive'||_0x24f355===_0x55af('0xe')||_0x24f355==='power'){return _0x39a5e4;}return null;}},'servicelevel':{'type':Sequelize[_0x55af('0xf')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x55af('0x0')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0x55af('0xf')](0xb)},'timeout':{'type':Sequelize[_0x55af('0xf')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0x55af('0xf')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize['STRING']},'weight':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x55af('0xf')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize['ENUM'](_0x55af('0x10'),'no'),'defaultValue':_0x55af('0x10')},'autopause':{'type':Sequelize[_0x55af('0x11')](_0x55af('0x10'),'no',_0x55af('0x12')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x55af('0xf')](0xb)},'autopausebusy':{'type':Sequelize[_0x55af('0x11')]('yes','no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0x55af('0x11')](_0x55af('0x10'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0x55af('0x11')](_0x55af('0x10'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0x55af('0x11')]('yes','no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0x55af('0x11')]('yes','no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x55af('0x11')]('yes','no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0x55af('0x0')],'allowNull':!![]},'membergosub':{'type':Sequelize['STRING'],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0x55af('0xf')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x55af('0xf')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x55af('0xf')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0x55af('0x11')](_0x55af('0x10'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0x55af('0x11')](_0x55af('0x10'),'no'),'defaultValue':'yes'},'announce_holdtime':{'type':Sequelize[_0x55af('0x11')]('yes','no',_0x55af('0x13')),'defaultValue':'no'},'announce_position':{'type':Sequelize['STRING'],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0x55af('0x11')](_0x55af('0x10'),'no')},'announce_position_limit':{'type':Sequelize[_0x55af('0xf')](0xb)},'announce_round_seconds':{'type':Sequelize[_0x55af('0x11')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize['STRING'],'defaultValue':''},'monitor_type':{'type':Sequelize['STRING']},'queue_youarenext':{'type':Sequelize[_0x55af('0x0')],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0x55af('0x0')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x55af('0x0')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0x55af('0x0')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x55af('0x0')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0x55af('0x0')],'defaultValue':null},'queue_seconds':{'type':Sequelize['STRING'],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x55af('0x0')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x55af('0x0')]},'queue_quantity1':{'type':Sequelize[_0x55af('0x0')]},'queue_quantity2':{'type':Sequelize['STRING']},'queue_periodic_announce':{'type':Sequelize[_0x55af('0x0')]},'queue_less_than':{'type':Sequelize[_0x55af('0x0')]},'periodic_announce':{'type':Sequelize[_0x55af('0x14')],'set':function(_0x4941b1){this['setDataValue'](_0x55af('0x15'),_0x4941b1?_0x4941b1[_0x55af('0x16')](','):[]);},'get':function(){return this[_0x55af('0xb')](_0x55af('0x15'))?this[_0x55af('0xb')](_0x55af('0x15'))[_0x55af('0x17')](','):[];}},'joinempty':{'type':Sequelize[_0x55af('0x0')],'defaultValue':_0x55af('0x10'),'set':function(_0x4e792b){this['setDataValue']('joinempty',_0x4e792b?_0x4e792b['join'](','):[]);},'get':function(){return this[_0x55af('0xb')](_0x55af('0x18'))?this['getDataValue'](_0x55af('0x18'))[_0x55af('0x17')](','):[];}},'leavewhenempty':{'type':Sequelize[_0x55af('0x0')],'defaultValue':'no','set':function(_0x46252e){this[_0x55af('0x9')](_0x55af('0x19'),_0x46252e?_0x46252e['join'](','):[]);},'get':function(){return this[_0x55af('0xb')](_0x55af('0x19'))?this['getDataValue']('leavewhenempty')['split'](','):[];}},'reportholdtime':{'type':Sequelize[_0x55af('0x11')](_0x55af('0x10'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0x55af('0x11')]('yes','no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0x55af('0xf')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0x55af('0x11')](_0x55af('0x10'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0x55af('0x0')]},'description':{'type':Sequelize['STRING']},'acw':{'type':Sequelize[_0x55af('0x1a')],'defaultValue':0x0,'set':function(_0x10318b){this['setDataValue'](_0x55af('0x1b'),_0x10318b);if(_0x10318b){if(this[_0x55af('0xb')](_0x55af('0x1c'))<0x2){this[_0x55af('0x9')](_0x55af('0x1c'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0x55af('0xf')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0x55af('0x1a')],'defaultValue':0x0,'comment':_0x55af('0x1d')},'dialMethod':{'type':Sequelize[_0x55af('0x11')](_0x55af('0x1e'),'progressive',_0x55af('0x1f'),'predictive',_0x55af('0xd')),'defaultValue':_0x55af('0x20'),'comment':'Dial\x20Method.'},'dialLimitChannel':{'type':Sequelize[_0x55af('0xf')](0x4)[_0x55af('0x21')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x55af('0x22')},'dialLimitQueue':{'type':Sequelize[_0x55af('0xf')](0x4)[_0x55af('0x21')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':'Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.'},'dialPowerLevel':{'type':Sequelize['FLOAT'](0x2)['UNSIGNED'],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0x55af('0x23')},'dialPredictiveOptimization':{'type':Sequelize[_0x55af('0x11')](_0x55af('0x24'),'dropRate'),'defaultValue':_0x55af('0x25'),'comment':_0x55af('0x26')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0x55af('0x27')](0x2)[_0x55af('0x21')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x55af('0x28')},'dialPredictiveInterval':{'type':Sequelize[_0x55af('0xf')](0x3)[_0x55af('0x21')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0x55af('0x29')},'dialOriginateCallerIdName':{'type':Sequelize[_0x55af('0x0')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x55af('0x0')]},'dialOriginateTimeout':{'type':Sequelize[_0x55af('0xf')](0x3)[_0x55af('0x21')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x55af('0x2a')},'dialQueueOptions':{'type':Sequelize['STRING'],'defaultValue':_0x55af('0x2b'),'comment':_0x55af('0x2c')},'dialQueueTimeout':{'type':Sequelize[_0x55af('0xf')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x55af('0x2d')},'dialQueueProject':{'type':Sequelize[_0x55af('0x0')],'comment':'AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)'},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x55af('0x21')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x55af('0x2e')},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x55af('0x21')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x55af('0x2f')},'dialBusyMaxRetry':{'type':Sequelize[_0x55af('0xf')](0x3)[_0x55af('0x21')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize[_0x55af('0xf')](0x5)[_0x55af('0x21')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x55af('0x30')},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x55af('0x31')},'dialGlobalMaxRetry':{'type':Sequelize[_0x55af('0xf')](0x3)[_0x55af('0x21')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x55af('0x32')},'dialTimezone':{'type':Sequelize[_0x55af('0x0')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':_0x55af('0x33')},'dialPrefix':{'type':Sequelize[_0x55af('0x0')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0x55af('0x11')](_0x55af('0x34'),'never',_0x55af('0x35')),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize[_0x55af('0x1a')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0x55af('0x21')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x55af('0x36')},'dialAMDGreeting':{'type':Sequelize[_0x55af('0xf')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x55af('0x37')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)[_0x55af('0x21')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x55af('0xf')](0x9)[_0x55af('0x21')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x55af('0x38')},'dialAMDMinWordLength':{'type':Sequelize[_0x55af('0xf')](0x9)[_0x55af('0x21')],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x55af('0xf')](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x55af('0x39')},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)[_0x55af('0x21')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x55af('0x3a')},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)[_0x55af('0x21')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x55af('0x21')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x55af('0x3b')},'dialRecallMeTimeout':{'type':Sequelize[_0x55af('0xf')](0x5)[_0x55af('0x21')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':'#RecallMe\x20Timeout\x20(min:1)'},'dialRecallInQueue':{'type':Sequelize[_0x55af('0x1a')],'defaultValue':0x0,'comment':'Active/Disactive\x20Recall\x20In\x20Queue'},'dialOrderByScheduledAt':{'type':Sequelize[_0x55af('0x11')](_0x55af('0x3c'),_0x55af('0x3d')),'defaultValue':_0x55af('0x3c')},'dialQueueProject2':{'type':Sequelize[_0x55af('0x0')],'comment':_0x55af('0x3e')},'dialAgiAfterHangupClient':{'type':Sequelize[_0x55af('0x1a')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x55af('0x1a')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x55af('0xf')](0x3)[_0x55af('0x21')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize[_0x55af('0xf')](0x3)[_0x55af('0x21')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x55af('0x3f')},'mandatoryDispositionPauseId':{'type':Sequelize[_0x55af('0xf')],'allowNull':!![],'comment':_0x55af('0x40')},'mandatoryDisposition':{'type':Sequelize[_0x55af('0x1a')],'defaultValue':![],'comment':_0x55af('0x41'),'set':function(_0x55be76){if(!_0x55be76)this[_0x55af('0x9')](_0x55af('0x42'),null);this[_0x55af('0x9')]('mandatoryDisposition',_0x55be76);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize['INTEGER'](0x3)[_0x55af('0x21')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0x55af('0xf')](0x3)[_0x55af('0x21')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}}}; \ No newline at end of file +var _0x81d4=['AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Word\x20Length','#RecallMe\x20Timeout\x20(min:1)','Active/Disactive\x20Recall\x20In\x20Queue','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDisposition','sequelize','exports','STRING','ENUM','inbound','outbound','default','ringall','leastrecent','fewestcalls','random','rrmemory','linear','wrandom','rrordered','setDataValue','strategy','getDataValue','type','dialMethod','booked','roundrobin','progressive','power','INTEGER','yes','all','once','TEXT','periodic_announce','split','joinempty','join','leavewhenempty','BOOLEAN','acw','wrapuptime','Active/Disactive\x20Campaign','preview','predictive','Dial\x20Method.','FLOAT','UNSIGNED','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','dropRate','Only\x20for\x20predictive\x20method.','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','tTxX','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue'];(function(_0x4ed80a,_0x3f36c2){var _0x5174e1=function(_0x5565d7){while(--_0x5565d7){_0x4ed80a['push'](_0x4ed80a['shift']());}};_0x5174e1(++_0x3f36c2);}(_0x81d4,0x67));var _0x481d=function(_0x24095f,_0x297937){_0x24095f=_0x24095f-0x0;var _0x326de4=_0x81d4[_0x24095f];return _0x326de4;};'use strict';var Sequelize=require(_0x481d('0x0'));module[_0x481d('0x1')]={'name':{'type':Sequelize[_0x481d('0x2')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x481d('0x3')](_0x481d('0x4'),_0x481d('0x5')),'allowNull':![],'defaultValue':'inbound'},'musiconhold':{'type':Sequelize[_0x481d('0x2')],'defaultValue':_0x481d('0x6')},'announce':{'type':Sequelize[_0x481d('0x2')],'defaultValue':''},'strategy':{'type':Sequelize[_0x481d('0x3')]('rr',_0x481d('0x7'),_0x481d('0x8'),_0x481d('0x9'),_0x481d('0xa'),_0x481d('0xb'),_0x481d('0xc'),_0x481d('0xd'),_0x481d('0xe')),'allowNull':![],'defaultValue':_0x481d('0x7'),'set':function(_0x5c7054){this[_0x481d('0xf')](_0x481d('0x10'),_0x5c7054?_0x5c7054:_0x481d('0xb'));},'get':function(){var _0x2cbebc=this[_0x481d('0x11')](_0x481d('0x12'));var _0x5c61ce=this[_0x481d('0x11')](_0x481d('0x13'));var _0x58cb5c=this[_0x481d('0x11')](_0x481d('0x10'));if(_0x2cbebc===_0x481d('0x4')){return _0x58cb5c;}if(_0x5c61ce==='booked'&&_0x58cb5c===_0x481d('0xb')||_0x5c61ce===_0x481d('0x14')&&_0x58cb5c===_0x481d('0x15')){return _0x58cb5c;}if(_0x5c61ce===_0x481d('0x16')||_0x5c61ce==='predictive'||_0x5c61ce===_0x481d('0x17')){return _0x58cb5c;}return null;}},'servicelevel':{'type':Sequelize[_0x481d('0x18')](0xb),'defaultValue':0x0},'context':{'type':Sequelize['STRING'],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0x481d('0x18')](0xb)},'timeout':{'type':Sequelize[_0x481d('0x18')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0x481d('0x18')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x481d('0x2')]},'weight':{'type':Sequelize[_0x481d('0x18')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x481d('0x18')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize['ENUM'](_0x481d('0x19'),'no'),'defaultValue':_0x481d('0x19')},'autopause':{'type':Sequelize[_0x481d('0x3')](_0x481d('0x19'),'no',_0x481d('0x1a')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize['INTEGER'](0xb)},'autopausebusy':{'type':Sequelize[_0x481d('0x3')](_0x481d('0x19'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize['ENUM'](_0x481d('0x19'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x481d('0x18')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0x481d('0x3')](_0x481d('0x19'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0x481d('0x3')](_0x481d('0x19'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0x481d('0x3')](_0x481d('0x19'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x481d('0x3')](_0x481d('0x19'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0x481d('0x2')],'allowNull':!![]},'membergosub':{'type':Sequelize[_0x481d('0x2')],'allowNull':!![]},'announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x481d('0x18')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0x481d('0x3')]('yes','no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0x481d('0x3')](_0x481d('0x19'),'no'),'defaultValue':_0x481d('0x19')},'announce_holdtime':{'type':Sequelize[_0x481d('0x3')](_0x481d('0x19'),'no',_0x481d('0x1b')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0x481d('0x2')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0x481d('0x3')](_0x481d('0x19'),'no')},'announce_position_limit':{'type':Sequelize[_0x481d('0x18')](0xb)},'announce_round_seconds':{'type':Sequelize[_0x481d('0x3')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0x481d('0x2')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x481d('0x2')]},'queue_youarenext':{'type':Sequelize['STRING'],'defaultValue':null},'queue_thereare':{'type':Sequelize['STRING'],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x481d('0x2')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0x481d('0x2')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x481d('0x2')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0x481d('0x2')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x481d('0x2')],'defaultValue':null},'queue_thankyou':{'type':Sequelize['STRING'],'defaultValue':null},'queue_reporthold':{'type':Sequelize['STRING']},'queue_quantity1':{'type':Sequelize[_0x481d('0x2')]},'queue_quantity2':{'type':Sequelize['STRING']},'queue_periodic_announce':{'type':Sequelize[_0x481d('0x2')]},'queue_less_than':{'type':Sequelize[_0x481d('0x2')]},'periodic_announce':{'type':Sequelize[_0x481d('0x1c')],'set':function(_0x1fadb6){this['setDataValue'](_0x481d('0x1d'),_0x1fadb6?_0x1fadb6['join'](','):[]);},'get':function(){return this[_0x481d('0x11')](_0x481d('0x1d'))?this[_0x481d('0x11')](_0x481d('0x1d'))[_0x481d('0x1e')](','):[];}},'joinempty':{'type':Sequelize[_0x481d('0x2')],'defaultValue':_0x481d('0x19'),'set':function(_0xe409c){this['setDataValue'](_0x481d('0x1f'),_0xe409c?_0xe409c[_0x481d('0x20')](','):[]);},'get':function(){return this[_0x481d('0x11')](_0x481d('0x1f'))?this[_0x481d('0x11')](_0x481d('0x1f'))[_0x481d('0x1e')](','):[];}},'leavewhenempty':{'type':Sequelize[_0x481d('0x2')],'defaultValue':'no','set':function(_0x3917b9){this[_0x481d('0xf')]('leavewhenempty',_0x3917b9?_0x3917b9['join'](','):[]);},'get':function(){return this[_0x481d('0x11')]('leavewhenempty')?this[_0x481d('0x11')](_0x481d('0x21'))[_0x481d('0x1e')](','):[];}},'reportholdtime':{'type':Sequelize[_0x481d('0x3')](_0x481d('0x19'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0x481d('0x3')](_0x481d('0x19'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0x481d('0x18')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0x481d('0x3')](_0x481d('0x19'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0x481d('0x2')]},'description':{'type':Sequelize[_0x481d('0x2')]},'acw':{'type':Sequelize[_0x481d('0x22')],'defaultValue':0x0,'set':function(_0x250b25){this[_0x481d('0xf')](_0x481d('0x23'),_0x250b25);if(_0x250b25){if(this[_0x481d('0x11')](_0x481d('0x24'))<0x2){this[_0x481d('0xf')](_0x481d('0x24'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0x481d('0x18')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x481d('0x25')},'dialMethod':{'type':Sequelize[_0x481d('0x3')](_0x481d('0x26'),_0x481d('0x16'),_0x481d('0x17'),_0x481d('0x27'),_0x481d('0x14')),'defaultValue':_0x481d('0x16'),'comment':_0x481d('0x28')},'dialLimitChannel':{'type':Sequelize[_0x481d('0x18')](0x4)['UNSIGNED'],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':'Max\x209999\x20channels,\x200\x20means\x20unlimited.'},'dialLimitQueue':{'type':Sequelize[_0x481d('0x18')](0x4)['UNSIGNED'],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':'Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.'},'dialPowerLevel':{'type':Sequelize[_0x481d('0x29')](0x2)[_0x481d('0x2a')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0x481d('0x2b')},'dialPredictiveOptimization':{'type':Sequelize['ENUM']('agentBusyFactor','dropRate'),'defaultValue':_0x481d('0x2c'),'comment':_0x481d('0x2d')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0x481d('0x29')](0x2)[_0x481d('0x2a')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x481d('0x2e')},'dialPredictiveInterval':{'type':Sequelize[_0x481d('0x18')](0x3)['UNSIGNED'],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0x481d('0x2f')},'dialOriginateCallerIdName':{'type':Sequelize[_0x481d('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x481d('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0x481d('0x18')](0x3)[_0x481d('0x2a')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x481d('0x30')},'dialQueueOptions':{'type':Sequelize[_0x481d('0x2')],'defaultValue':_0x481d('0x31'),'comment':_0x481d('0x32')},'dialQueueTimeout':{'type':Sequelize[_0x481d('0x18')](0x3)[_0x481d('0x2a')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialQueueProject':{'type':Sequelize['STRING'],'comment':_0x481d('0x33')},'dialCongestionMaxRetry':{'type':Sequelize[_0x481d('0x18')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x481d('0x34')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x481d('0x18')](0x5)[_0x481d('0x2a')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x481d('0x35')},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize[_0x481d('0x18')](0x5)[_0x481d('0x2a')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x481d('0x36')},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x481d('0x2a')],'defaultValue':0x3,'comment':_0x481d('0x37')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x481d('0x18')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x481d('0x38')},'dialGlobalMaxRetry':{'type':Sequelize[_0x481d('0x18')](0x3)[_0x481d('0x2a')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x481d('0x39')},'dialTimezone':{'type':Sequelize[_0x481d('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':_0x481d('0x3a')},'dialPrefix':{'type':Sequelize[_0x481d('0x2')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0x481d('0x3b'),_0x481d('0x3c'),_0x481d('0x3d')),'defaultValue':_0x481d('0x3b')},'dialAMDActive':{'type':Sequelize[_0x481d('0x22')],'defaultValue':0x0,'comment':_0x481d('0x3e')},'dialAMDInitialSilence':{'type':Sequelize[_0x481d('0x18')](0x9)[_0x481d('0x2a')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)[_0x481d('0x2a')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x481d('0x3f')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)[_0x481d('0x2a')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x481d('0x40')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x481d('0x18')](0x9)[_0x481d('0x2a')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x481d('0x41')},'dialAMDMinWordLength':{'type':Sequelize[_0x481d('0x18')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x481d('0x42')},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x481d('0x43')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x481d('0x18')](0x9)[_0x481d('0x2a')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0x481d('0x18')](0x5)[_0x481d('0x2a')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x481d('0x2a')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x481d('0x44')},'dialRecallMeTimeout':{'type':Sequelize[_0x481d('0x18')](0x5)[_0x481d('0x2a')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x481d('0x45')},'dialRecallInQueue':{'type':Sequelize[_0x481d('0x22')],'defaultValue':0x0,'comment':_0x481d('0x46')},'dialOrderByScheduledAt':{'type':Sequelize[_0x481d('0x3')](_0x481d('0x47'),_0x481d('0x48')),'defaultValue':'DESC'},'dialQueueProject2':{'type':Sequelize['STRING'],'comment':_0x481d('0x33')},'dialAgiAfterHangupClient':{'type':Sequelize[_0x481d('0x22')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x481d('0x22')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x481d('0x18')](0x3)[_0x481d('0x2a')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x481d('0x49')},'dialCutDigit':{'type':Sequelize[_0x481d('0x18')](0x3)[_0x481d('0x2a')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x481d('0x4a')},'mandatoryDispositionPauseId':{'type':Sequelize[_0x481d('0x18')],'allowNull':!![],'comment':_0x481d('0x4b')},'mandatoryDisposition':{'type':Sequelize[_0x481d('0x22')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x4d3f6a){if(!_0x4d3f6a)this[_0x481d('0xf')]('mandatoryDispositionPauseId',null);this[_0x481d('0xf')](_0x481d('0x4c'),_0x4d3f6a);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0x481d('0x18')](0x3)['UNSIGNED'],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'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 8cc46bc..3c44527 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 _0xb458=['CmHopperHistory','getHopperFinals','CmHopperFinal','order','getHopperBlacks','CmHopperBlack','getTeams','Team','teams','User','Agents','voicePause','interface','forEach','penalty','sequelize','transaction','addTeams','each','UserVoiceQueue','UserVoiceQueueRt','upsert','format','emit','userVoiceQueue:save','removeTeams','team_has_voice_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoiceQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','all','union','compact','ids','isEmpty','removeAgents','userVoiceQueue:remove','addAgents','online','SIP/%s','isArray','getAgents','getMembers','getLists','CmList','addLists','spread','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','scheduledAt','ContactId','ListId','select','phone','CmListId','NOW()','from','cm_contacts','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','COALESCE(phone,\x27\x27)','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','removeLists','getBlackLists','addBlackLists','removeBlackLists','html-pdf','eml-format','rimraf','request-promise','moment','bluebird','mustache','path','ejs','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceQueue.socket','register','sendStatus','status','end','json','count','offset','set','Content-Range','apply','update','then','get','inbound','QueueCampaigns','outbound','ignore','map','value','includes','type','find','name','UserProfileResource','destroy','error','stack','send','VoiceQueue','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','sort','where','pick','filter','merge','key','field','options','includeAll','findAll','rows','show','params','rawAttributes','length','include','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','VoiceQueues','UserProfileSection','userProfileId','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','createdAt','updatedAt','omit','findOne','CmHopper','VoiceQueueId'];(function(_0x36eaaa,_0x326732){var _0x461349=function(_0x4e4180){while(--_0x4e4180){_0x36eaaa['push'](_0x36eaaa['shift']());}};_0x461349(++_0x326732);}(_0xb458,0x103));var _0x8b45=function(_0x20d2a0,_0x54f8ab){_0x20d2a0=_0x20d2a0-0x0;var _0x3cb161=_0xb458[_0x20d2a0];return _0x3cb161;};'use strict';var pdf=require(_0x8b45('0x0'));var emlformat=require(_0x8b45('0x1'));var rimraf=require(_0x8b45('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x8b45('0x3'));var moment=require(_0x8b45('0x4'));var BPromise=require(_0x8b45('0x5'));var Mustache=require(_0x8b45('0x6'));var util=require('util');var path=require(_0x8b45('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x8b45('0x8'));var fs=require('fs');var _=require(_0x8b45('0x9'));var squel=require(_0x8b45('0xa'));var crypto=require(_0x8b45('0xb'));var jsforce=require(_0x8b45('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x8b45('0xd'));var querystring=require(_0x8b45('0xe'));var Papa=require(_0x8b45('0xf'));var Redis=require(_0x8b45('0x10'));var authService=require(_0x8b45('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x8b45('0x12'));var hardwareService=require(_0x8b45('0x13'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x8b45('0x14'))['db'];config[_0x8b45('0x15')]=_[_0x8b45('0x16')](config['redis'],{'host':_0x8b45('0x17'),'port':0x18eb});var socket=require(_0x8b45('0x18'))(new Redis(config[_0x8b45('0x15')]));require(_0x8b45('0x19'))[_0x8b45('0x1a')](socket);function respondWithStatusCode(_0x2ad2ae,_0x5f0b20){_0x5f0b20=_0x5f0b20||0xcc;return function(_0x5a14c1){if(_0x5a14c1){return _0x2ad2ae[_0x8b45('0x1b')](_0x5f0b20);}return _0x2ad2ae[_0x8b45('0x1c')](_0x5f0b20)[_0x8b45('0x1d')]();};}function respondWithResult(_0x39c1d1,_0x4781d7){_0x4781d7=_0x4781d7||0xc8;return function(_0x27ebb3){if(_0x27ebb3){return _0x39c1d1[_0x8b45('0x1c')](_0x4781d7)[_0x8b45('0x1e')](_0x27ebb3);}};}function respondWithFilteredResult(_0x33102e,_0x391d1e){return function(_0x287a3b){if(_0x287a3b){var _0x21d5b2=_0x287a3b[_0x8b45('0x1f')],_0x1ed5ca=_0x391d1e[_0x8b45('0x20')],_0x43ffb7=_0x391d1e[_0x8b45('0x20')]+_0x391d1e['limit'],_0x1623d8;if(_0x43ffb7>=_0x21d5b2){_0x43ffb7=_0x21d5b2;_0x1623d8=0xc8;}else{_0x1623d8=0xce;}_0x33102e[_0x8b45('0x1c')](_0x1623d8);return _0x33102e[_0x8b45('0x21')](_0x8b45('0x22'),_0x1ed5ca+'-'+_0x43ffb7+'/'+_0x21d5b2)[_0x8b45('0x1e')](_0x287a3b);}return null;};}function patchUpdates(_0x3e1438){return function(_0x23eae6){try{jsonpatch[_0x8b45('0x23')](_0x23eae6,_0x3e1438,!![]);}catch(_0x32b917){return BPromise['reject'](_0x32b917);}return _0x23eae6['save']();};}function saveUpdates(_0x41154a,_0x580e17){return function(_0x1952fc){if(_0x1952fc){return _0x1952fc[_0x8b45('0x24')](_0x41154a)[_0x8b45('0x25')](function(_0x45e2db){return _0x45e2db;});}return null;};}function removeEntity(_0x165570,_0x2b8526){return function(_0x32b12b){if(_0x32b12b){return _0x32b12b['destroy']()['then'](function(){var _0x11ffcc=_0x32b12b[_0x8b45('0x26')]({'plain':!![]});var _0x500044=[{'name':'VoiceQueues','value':_0x8b45('0x27'),'ignore':![]},{'name':_0x8b45('0x28'),'value':_0x8b45('0x29'),'ignore':![]}];var _0x2f37bc=_(_0x500044)['filter'](_0x8b45('0x2a'))[_0x8b45('0x2b')](_0x8b45('0x2c'))[_0x8b45('0x2c')]();if(_[_0x8b45('0x2d')](_0x2f37bc,_0x11ffcc[_0x8b45('0x2e')])){return;}var _0x461017=_[_0x8b45('0x2f')](_0x500044,[_0x8b45('0x2c'),_0x11ffcc[_0x8b45('0x2e')]])[_0x8b45('0x30')];return db[_0x8b45('0x31')][_0x8b45('0x32')]({'where':{'type':_0x461017,'resourceId':_0x11ffcc['id']}})['then'](function(){return _0x32b12b;});})[_0x8b45('0x25')](function(){_0x165570[_0x8b45('0x1c')](0xcc)[_0x8b45('0x1d')]();});}};}function handleEntityNotFound(_0x15107a,_0x2eb4c2){return function(_0x638f26){if(!_0x638f26){_0x15107a[_0x8b45('0x1b')](0x194);}return _0x638f26;};}function handleError(_0x4216bf,_0x5d8938){_0x5d8938=_0x5d8938||0x1f4;return function(_0x3f5dd3){logger[_0x8b45('0x33')](_0x3f5dd3[_0x8b45('0x34')]);if(_0x3f5dd3[_0x8b45('0x30')]){delete _0x3f5dd3[_0x8b45('0x30')];}_0x4216bf['status'](_0x5d8938)[_0x8b45('0x35')](_0x3f5dd3);};}exports['index']=function(_0x5a07de,_0x1f8a11){var _0x94e3b6={},_0xd3ba91={},_0x8d6790={'count':0x0,'rows':[]};var _0x1e72d2=db[_0x8b45('0x36')]['rawAttributes'];_0xd3ba91[_0x8b45('0x37')]=_[_0x8b45('0x38')](_0x1e72d2);_0xd3ba91[_0x8b45('0x39')]=_[_0x8b45('0x38')](_0x5a07de['query']);_0xd3ba91[_0x8b45('0x3a')]=_[_0x8b45('0x3b')](_0xd3ba91[_0x8b45('0x37')],_0xd3ba91['query']);_0x94e3b6[_0x8b45('0x3c')]=_[_0x8b45('0x3b')](_0xd3ba91[_0x8b45('0x37')],qs['fields'](_0x5a07de[_0x8b45('0x39')][_0x8b45('0x3d')]));_0x94e3b6[_0x8b45('0x3c')]=_0x94e3b6[_0x8b45('0x3c')]['length']?_0x94e3b6[_0x8b45('0x3c')]:_0xd3ba91[_0x8b45('0x37')];if(!_0x5a07de[_0x8b45('0x39')][_0x8b45('0x3e')](_0x8b45('0x3f'))){_0x94e3b6[_0x8b45('0x40')]=qs['limit'](_0x5a07de['query'][_0x8b45('0x40')]);_0x94e3b6[_0x8b45('0x20')]=qs[_0x8b45('0x20')](_0x5a07de[_0x8b45('0x39')][_0x8b45('0x20')]);}_0x94e3b6['order']=qs[_0x8b45('0x41')](_0x5a07de['query'][_0x8b45('0x41')]);_0x94e3b6[_0x8b45('0x42')]=qs[_0x8b45('0x3a')](_[_0x8b45('0x43')](_0x5a07de[_0x8b45('0x39')],_0xd3ba91[_0x8b45('0x3a')]));if(_0x5a07de[_0x8b45('0x39')][_0x8b45('0x44')]){_0x94e3b6[_0x8b45('0x42')]=_[_0x8b45('0x45')](_0x94e3b6[_0x8b45('0x42')],{'$or':_['map'](_0x1e72d2,function(_0x12ea31){if(_0x12ea31['type'][_0x8b45('0x46')]!=='VIRTUAL'){var _0x412c53={};_0x412c53[_0x12ea31[_0x8b45('0x47')]]={'$like':'%'+_0x5a07de[_0x8b45('0x39')][_0x8b45('0x44')]+'%'};return _0x412c53;}})});}_0x94e3b6=_[_0x8b45('0x45')]({},_0x94e3b6,_0x5a07de[_0x8b45('0x48')]);var _0x58e663={'where':_0x94e3b6[_0x8b45('0x42')]};return db['VoiceQueue']['count'](_0x58e663)[_0x8b45('0x25')](function(_0x152d28){_0x8d6790[_0x8b45('0x1f')]=_0x152d28;if(_0x5a07de['query'][_0x8b45('0x49')]){_0x94e3b6['include']=[{'all':!![]}];}return db[_0x8b45('0x36')][_0x8b45('0x4a')](_0x94e3b6);})[_0x8b45('0x25')](function(_0x23f746){_0x8d6790[_0x8b45('0x4b')]=_0x23f746;return _0x8d6790;})[_0x8b45('0x25')](respondWithFilteredResult(_0x1f8a11,_0x94e3b6))['catch'](handleError(_0x1f8a11,null));};exports[_0x8b45('0x4c')]=function(_0x1f8f24,_0x3ad9a4){var _0xee45ac={'raw':![],'where':{'id':_0x1f8f24[_0x8b45('0x4d')]['id']}},_0x1a13dd={};_0x1a13dd[_0x8b45('0x37')]=_[_0x8b45('0x38')](db[_0x8b45('0x36')][_0x8b45('0x4e')]);_0x1a13dd[_0x8b45('0x39')]=_[_0x8b45('0x38')](_0x1f8f24[_0x8b45('0x39')]);_0x1a13dd[_0x8b45('0x3a')]=_[_0x8b45('0x3b')](_0x1a13dd[_0x8b45('0x37')],_0x1a13dd['query']);_0xee45ac['attributes']=_['intersection'](_0x1a13dd[_0x8b45('0x37')],qs[_0x8b45('0x3d')](_0x1f8f24[_0x8b45('0x39')][_0x8b45('0x3d')]));_0xee45ac[_0x8b45('0x3c')]=_0xee45ac[_0x8b45('0x3c')][_0x8b45('0x4f')]?_0xee45ac[_0x8b45('0x3c')]:_0x1a13dd['model'];if(_0x1f8f24[_0x8b45('0x39')]['includeAll']){_0xee45ac[_0x8b45('0x50')]=[{'all':!![]}];}_0xee45ac=_[_0x8b45('0x45')]({},_0xee45ac,_0x1f8f24[_0x8b45('0x48')]);return db[_0x8b45('0x36')]['find'](_0xee45ac)[_0x8b45('0x25')](handleEntityNotFound(_0x3ad9a4,null))[_0x8b45('0x25')](respondWithResult(_0x3ad9a4,null))['catch'](handleError(_0x3ad9a4,null));};exports[_0x8b45('0x51')]=function(_0x119406,_0x52970c){return db[_0x8b45('0x36')][_0x8b45('0x51')](_0x119406[_0x8b45('0x52')],{})[_0x8b45('0x25')](function(_0x219cc0){var _0x3d1bf1=_0x119406['user']['get']({'plain':!![]});if(!_0x3d1bf1)throw new Error(_0x8b45('0x53'));if(_0x3d1bf1[_0x8b45('0x54')]===_0x8b45('0x55')){var _0x5496cf=_0x219cc0[_0x8b45('0x26')]({'plain':!![]});var _0x11d1a5=[{'name':_0x8b45('0x56'),'value':_0x8b45('0x27')},{'name':_0x8b45('0x28'),'value':'outbound'}];var _0x34c05d=_[_0x8b45('0x2f')](_0x11d1a5,['value',_0x5496cf[_0x8b45('0x2e')]])['name'];return db[_0x8b45('0x57')][_0x8b45('0x2f')]({'where':{'name':_0x34c05d,'userProfileId':_0x3d1bf1[_0x8b45('0x58')]},'raw':!![]})[_0x8b45('0x25')](function(_0x5609a8){if(_0x5609a8&&_0x5609a8[_0x8b45('0x59')]===0x0){return db[_0x8b45('0x31')][_0x8b45('0x51')]({'name':_0x5496cf[_0x8b45('0x30')],'resourceId':_0x5496cf['id'],'type':_0x5609a8[_0x8b45('0x30')],'sectionId':_0x5609a8['id']},{})[_0x8b45('0x25')](function(){return _0x219cc0;});}else{return _0x219cc0;}})[_0x8b45('0x5a')](function(_0x2a35c1){logger[_0x8b45('0x33')](_0x8b45('0x5b'),_0x2a35c1);throw _0x2a35c1;});}return _0x219cc0;})[_0x8b45('0x25')](respondWithResult(_0x52970c,0xc9))[_0x8b45('0x5a')](handleError(_0x52970c,null));};exports[_0x8b45('0x5c')]=function(_0x2a01a2,_0x1851c2){var _0x56e1ad={'raw':![],'where':{'id':_0x2a01a2[_0x8b45('0x4d')]['id']}},_0x1744f8={};_0x1744f8[_0x8b45('0x37')]=_['keys'](db[_0x8b45('0x36')][_0x8b45('0x4e')]);_0x56e1ad[_0x8b45('0x3c')]=_[_0x8b45('0x3b')](_0x1744f8['model'],qs[_0x8b45('0x3d')](_0x2a01a2[_0x8b45('0x39')][_0x8b45('0x3d')]));_0x56e1ad[_0x8b45('0x3c')]=_0x56e1ad['attributes'][_0x8b45('0x4f')]?_0x56e1ad[_0x8b45('0x3c')]:_0x1744f8[_0x8b45('0x37')];if(_0x2a01a2[_0x8b45('0x39')][_0x8b45('0x49')]){_0x56e1ad['include']=[{'all':!![]}];}_0x56e1ad=_[_0x8b45('0x45')]({},_0x56e1ad,_0x2a01a2['options']);return db[_0x8b45('0x36')][_0x8b45('0x2f')](_0x56e1ad)[_0x8b45('0x25')](handleEntityNotFound(_0x1851c2,null))[_0x8b45('0x25')](function(_0x6a77bd){if(_0x6a77bd){var _0x3097c8=_0x6a77bd['get']({'plain':!![]});_0x3097c8=qs['omit'](_0x3097c8,['id',_0x8b45('0x5d'),_0x8b45('0x5e')]);_0x2a01a2['body']=_[_0x8b45('0x5f')](_0x2a01a2[_0x8b45('0x52')],['id',_0x8b45('0x5d'),'updatedAt']);return db['VoiceQueue'][_0x8b45('0x51')](_[_0x8b45('0x45')](_0x3097c8,_0x2a01a2['body']),{'include':_0x2a01a2[_0x8b45('0x39')]['includeAll']?[{'all':!![]}]:undefined})[_0x8b45('0x25')](function(_0x560c51){var _0x4c53ff=_0x2a01a2[_0x8b45('0x55')][_0x8b45('0x26')]({'plain':!![]});if(!_0x4c53ff)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4c53ff[_0x8b45('0x54')]===_0x8b45('0x55')){var _0x165b1c=_0x560c51[_0x8b45('0x26')]({'plain':!![]});var _0x299b10=[{'name':'VoiceQueues','value':_0x8b45('0x27')},{'name':_0x8b45('0x28'),'value':_0x8b45('0x29')}];var _0x484f8b=_['find'](_0x299b10,[_0x8b45('0x2c'),_0x165b1c['type']])[_0x8b45('0x30')];return db['UserProfileSection']['find']({'where':{'name':_0x484f8b,'userProfileId':_0x4c53ff['userProfileId']},'raw':!![]})[_0x8b45('0x25')](function(_0x4df581){if(_0x4df581&&_0x4df581[_0x8b45('0x59')]===0x0){return db[_0x8b45('0x31')]['create']({'name':_0x165b1c[_0x8b45('0x30')],'resourceId':_0x165b1c['id'],'type':_0x4df581[_0x8b45('0x30')],'sectionId':_0x4df581['id']},{})['then'](function(){return _0x560c51;});}else{return _0x560c51;}})[_0x8b45('0x5a')](function(_0x46b686){logger[_0x8b45('0x33')](_0x8b45('0x5b'),_0x46b686);throw _0x46b686;});}return _0x560c51;});}})[_0x8b45('0x25')](respondWithResult(_0x1851c2,0xc9))[_0x8b45('0x5a')](handleError(_0x1851c2,null));};exports[_0x8b45('0x24')]=function(_0x35048c,_0x71338f){if(_0x35048c[_0x8b45('0x52')]['id']){delete _0x35048c[_0x8b45('0x52')]['id'];}return db[_0x8b45('0x36')]['find']({'where':{'id':_0x35048c[_0x8b45('0x4d')]['id']}})[_0x8b45('0x25')](handleEntityNotFound(_0x71338f,null))[_0x8b45('0x25')](saveUpdates(_0x35048c[_0x8b45('0x52')],null))[_0x8b45('0x25')](respondWithResult(_0x71338f,null))[_0x8b45('0x5a')](handleError(_0x71338f,null));};exports[_0x8b45('0x32')]=function(_0x3d3216,_0x243632){return db[_0x8b45('0x36')][_0x8b45('0x2f')]({'where':{'id':_0x3d3216[_0x8b45('0x4d')]['id']}})[_0x8b45('0x25')](handleEntityNotFound(_0x243632,null))[_0x8b45('0x25')](removeEntity(_0x243632,null))[_0x8b45('0x5a')](handleError(_0x243632,null));};exports['getHoppers']=function(_0x317053,_0xd30026,_0x1182fa){var _0x1eb853={'raw':![],'where':{}};var _0x3f662a={};var _0xd88538={'count':0x0,'rows':[]};return db[_0x8b45('0x36')][_0x8b45('0x60')]({'where':{'id':_0x317053['params']['id']}})[_0x8b45('0x25')](handleEntityNotFound(_0xd30026,null))[_0x8b45('0x25')](function(_0x1a3cfa){if(_0x1a3cfa){_0x3f662a[_0x8b45('0x37')]=_[_0x8b45('0x38')](db[_0x8b45('0x61')][_0x8b45('0x4e')]);_0x3f662a[_0x8b45('0x39')]=_[_0x8b45('0x38')](_0x317053[_0x8b45('0x39')]);_0x3f662a[_0x8b45('0x3a')]=_['intersection'](_0x3f662a['model'],_0x3f662a[_0x8b45('0x39')]);_0x1eb853[_0x8b45('0x3c')]=_[_0x8b45('0x3b')](_0x3f662a[_0x8b45('0x37')],qs[_0x8b45('0x3d')](_0x317053[_0x8b45('0x39')][_0x8b45('0x3d')]));_0x1eb853[_0x8b45('0x3c')]=_0x1eb853[_0x8b45('0x3c')]['length']?_0x1eb853['attributes']:_0x3f662a[_0x8b45('0x37')];if(!_0x317053[_0x8b45('0x39')][_0x8b45('0x3e')](_0x8b45('0x3f'))){_0x1eb853['limit']=qs[_0x8b45('0x40')](_0x317053[_0x8b45('0x39')][_0x8b45('0x40')]);_0x1eb853[_0x8b45('0x20')]=qs[_0x8b45('0x20')](_0x317053[_0x8b45('0x39')]['offset']);}_0x1eb853['order']=qs[_0x8b45('0x41')](_0x317053['query']['sort']);_0x1eb853['where']=qs[_0x8b45('0x3a')](_[_0x8b45('0x43')](_0x317053[_0x8b45('0x39')],_0x3f662a[_0x8b45('0x3a')]));_0x1eb853[_0x8b45('0x42')][_0x8b45('0x62')]=_0x1a3cfa['id'];if(_0x317053[_0x8b45('0x39')][_0x8b45('0x44')]){_0x1eb853[_0x8b45('0x42')]=_[_0x8b45('0x45')](_0x1eb853[_0x8b45('0x42')],{'$or':_[_0x8b45('0x2b')](_0x1eb853[_0x8b45('0x3c')],function(_0x4769c2){var _0x42b192={};_0x42b192[_0x4769c2]={'$like':'%'+_0x317053['query'][_0x8b45('0x44')]+'%'};return _0x42b192;})});}_0x1eb853=_[_0x8b45('0x45')]({},_0x1eb853,_0x317053[_0x8b45('0x48')]);return db[_0x8b45('0x61')][_0x8b45('0x1f')]({'where':_0x1eb853[_0x8b45('0x42')]})[_0x8b45('0x25')](function(_0x251584){_0xd88538[_0x8b45('0x1f')]=_0x251584;if(_0x317053[_0x8b45('0x39')]['includeAll']){_0x1eb853[_0x8b45('0x50')]=[{'all':!![]}];}return db[_0x8b45('0x61')][_0x8b45('0x4a')](_0x1eb853);})[_0x8b45('0x25')](function(_0x4922e6){_0xd88538[_0x8b45('0x4b')]=_0x4922e6;return _0xd88538;});}})['then'](respondWithFilteredResult(_0xd30026,_0x1eb853))[_0x8b45('0x5a')](handleError(_0xd30026,null));};exports['getHopperHistories']=function(_0x2d3b89,_0x6966ea,_0xdac6aa){var _0x3e4437={'raw':!![],'where':{}};var _0x16bb83={};var _0x45beb9={'count':0x0,'rows':[]};return db['VoiceQueue'][_0x8b45('0x60')]({'where':{'id':_0x2d3b89[_0x8b45('0x4d')]['id']}})[_0x8b45('0x25')](handleEntityNotFound(_0x6966ea,null))[_0x8b45('0x25')](function(_0x4a7cf9){if(_0x4a7cf9){_0x16bb83[_0x8b45('0x37')]=_[_0x8b45('0x38')](db['CmHopperHistory']['rawAttributes']);_0x16bb83[_0x8b45('0x39')]=_[_0x8b45('0x38')](_0x2d3b89[_0x8b45('0x39')]);_0x16bb83['filters']=_[_0x8b45('0x3b')](_0x16bb83['model'],_0x16bb83[_0x8b45('0x39')]);_0x3e4437[_0x8b45('0x3c')]=_['intersection'](_0x16bb83['model'],qs[_0x8b45('0x3d')](_0x2d3b89[_0x8b45('0x39')][_0x8b45('0x3d')]));_0x3e4437[_0x8b45('0x3c')]=_0x3e4437['attributes'][_0x8b45('0x4f')]?_0x3e4437[_0x8b45('0x3c')]:_0x16bb83[_0x8b45('0x37')];if(!_0x2d3b89[_0x8b45('0x39')][_0x8b45('0x3e')](_0x8b45('0x3f'))){_0x3e4437['limit']=qs[_0x8b45('0x40')](_0x2d3b89[_0x8b45('0x39')]['limit']);_0x3e4437[_0x8b45('0x20')]=qs[_0x8b45('0x20')](_0x2d3b89['query']['offset']);}_0x3e4437['order']=qs[_0x8b45('0x41')](_0x2d3b89[_0x8b45('0x39')][_0x8b45('0x41')]);_0x3e4437[_0x8b45('0x42')]=qs[_0x8b45('0x3a')](_[_0x8b45('0x43')](_0x2d3b89[_0x8b45('0x39')],_0x16bb83['filters']));_0x3e4437[_0x8b45('0x42')][_0x8b45('0x62')]=_0x4a7cf9['id'];if(_0x2d3b89[_0x8b45('0x39')][_0x8b45('0x44')]){_0x3e4437[_0x8b45('0x42')]=_[_0x8b45('0x45')](_0x3e4437['where'],{'$or':_[_0x8b45('0x2b')](_0x3e4437[_0x8b45('0x3c')],function(_0x230e2f){var _0x2b11ec={};_0x2b11ec[_0x230e2f]={'$like':'%'+_0x2d3b89[_0x8b45('0x39')]['filter']+'%'};return _0x2b11ec;})});}_0x3e4437=_['merge']({},_0x3e4437,_0x2d3b89[_0x8b45('0x48')]);return db[_0x8b45('0x63')][_0x8b45('0x1f')]({'where':_0x3e4437[_0x8b45('0x42')]})[_0x8b45('0x25')](function(_0x5a4aaf){_0x45beb9[_0x8b45('0x1f')]=_0x5a4aaf;if(_0x2d3b89['query'][_0x8b45('0x49')]){_0x3e4437['include']=[{'all':!![]}];}return db[_0x8b45('0x63')][_0x8b45('0x4a')](_0x3e4437);})[_0x8b45('0x25')](function(_0x59197b){_0x45beb9[_0x8b45('0x4b')]=_0x59197b;return _0x45beb9;});}})[_0x8b45('0x25')](respondWithFilteredResult(_0x6966ea,_0x3e4437))[_0x8b45('0x5a')](handleError(_0x6966ea,null));};exports[_0x8b45('0x64')]=function(_0x39d000,_0xfff1e,_0x404b07){var _0x2f136d={'raw':!![],'where':{}};var _0x2eb241={};var _0x18b68a={'count':0x0,'rows':[]};return db['VoiceQueue'][_0x8b45('0x60')]({'where':{'id':_0x39d000[_0x8b45('0x4d')]['id']}})[_0x8b45('0x25')](handleEntityNotFound(_0xfff1e,null))['then'](function(_0x466c82){if(_0x466c82){_0x2eb241['model']=_[_0x8b45('0x38')](db[_0x8b45('0x65')]['rawAttributes']);_0x2eb241[_0x8b45('0x39')]=_['keys'](_0x39d000[_0x8b45('0x39')]);_0x2eb241[_0x8b45('0x3a')]=_[_0x8b45('0x3b')](_0x2eb241[_0x8b45('0x37')],_0x2eb241[_0x8b45('0x39')]);_0x2f136d[_0x8b45('0x3c')]=_['intersection'](_0x2eb241['model'],qs[_0x8b45('0x3d')](_0x39d000[_0x8b45('0x39')]['fields']));_0x2f136d['attributes']=_0x2f136d['attributes'][_0x8b45('0x4f')]?_0x2f136d['attributes']:_0x2eb241[_0x8b45('0x37')];if(!_0x39d000[_0x8b45('0x39')][_0x8b45('0x3e')](_0x8b45('0x3f'))){_0x2f136d['limit']=qs[_0x8b45('0x40')](_0x39d000[_0x8b45('0x39')][_0x8b45('0x40')]);_0x2f136d[_0x8b45('0x20')]=qs[_0x8b45('0x20')](_0x39d000[_0x8b45('0x39')][_0x8b45('0x20')]);}_0x2f136d[_0x8b45('0x66')]=qs['sort'](_0x39d000[_0x8b45('0x39')]['sort']);_0x2f136d[_0x8b45('0x42')]=qs['filters'](_['pick'](_0x39d000['query'],_0x2eb241[_0x8b45('0x3a')]));_0x2f136d[_0x8b45('0x42')]['VoiceQueueId']=_0x466c82['id'];if(_0x39d000[_0x8b45('0x39')][_0x8b45('0x44')]){_0x2f136d[_0x8b45('0x42')]=_[_0x8b45('0x45')](_0x2f136d[_0x8b45('0x42')],{'$or':_[_0x8b45('0x2b')](_0x2f136d[_0x8b45('0x3c')],function(_0x113bea){var _0x124469={};_0x124469[_0x113bea]={'$like':'%'+_0x39d000['query'][_0x8b45('0x44')]+'%'};return _0x124469;})});}_0x2f136d=_[_0x8b45('0x45')]({},_0x2f136d,_0x39d000[_0x8b45('0x48')]);return db[_0x8b45('0x65')]['count']({'where':_0x2f136d[_0x8b45('0x42')]})[_0x8b45('0x25')](function(_0x3eedad){_0x18b68a[_0x8b45('0x1f')]=_0x3eedad;if(_0x39d000[_0x8b45('0x39')]['includeAll']){_0x2f136d[_0x8b45('0x50')]=[{'all':!![]}];}return db['CmHopperFinal'][_0x8b45('0x4a')](_0x2f136d);})[_0x8b45('0x25')](function(_0x5c5f2f){_0x18b68a['rows']=_0x5c5f2f;return _0x18b68a;});}})[_0x8b45('0x25')](respondWithFilteredResult(_0xfff1e,_0x2f136d))['catch'](handleError(_0xfff1e,null));};exports[_0x8b45('0x67')]=function(_0x5006a6,_0x470d23,_0x2f7d4b){var _0x2af25b={'raw':!![],'where':{}};var _0x520ff7={};var _0x406f43={'count':0x0,'rows':[]};return db['VoiceQueue'][_0x8b45('0x60')]({'where':{'id':_0x5006a6[_0x8b45('0x4d')]['id']}})[_0x8b45('0x25')](handleEntityNotFound(_0x470d23,null))[_0x8b45('0x25')](function(_0x1c5e4c){if(_0x1c5e4c){_0x520ff7[_0x8b45('0x37')]=_[_0x8b45('0x38')](db[_0x8b45('0x68')][_0x8b45('0x4e')]);_0x520ff7[_0x8b45('0x39')]=_[_0x8b45('0x38')](_0x5006a6[_0x8b45('0x39')]);_0x520ff7[_0x8b45('0x3a')]=_[_0x8b45('0x3b')](_0x520ff7[_0x8b45('0x37')],_0x520ff7['query']);_0x2af25b[_0x8b45('0x3c')]=_[_0x8b45('0x3b')](_0x520ff7['model'],qs['fields'](_0x5006a6[_0x8b45('0x39')][_0x8b45('0x3d')]));_0x2af25b[_0x8b45('0x3c')]=_0x2af25b[_0x8b45('0x3c')][_0x8b45('0x4f')]?_0x2af25b[_0x8b45('0x3c')]:_0x520ff7[_0x8b45('0x37')];if(!_0x5006a6[_0x8b45('0x39')][_0x8b45('0x3e')]('nolimit')){_0x2af25b[_0x8b45('0x40')]=qs[_0x8b45('0x40')](_0x5006a6['query'][_0x8b45('0x40')]);_0x2af25b[_0x8b45('0x20')]=qs[_0x8b45('0x20')](_0x5006a6[_0x8b45('0x39')][_0x8b45('0x20')]);}_0x2af25b[_0x8b45('0x66')]=qs[_0x8b45('0x41')](_0x5006a6[_0x8b45('0x39')][_0x8b45('0x41')]);_0x2af25b[_0x8b45('0x42')]=qs[_0x8b45('0x3a')](_[_0x8b45('0x43')](_0x5006a6[_0x8b45('0x39')],_0x520ff7['filters']));_0x2af25b[_0x8b45('0x42')]['VoiceQueueId']=_0x1c5e4c['id'];if(_0x5006a6[_0x8b45('0x39')][_0x8b45('0x44')]){_0x2af25b[_0x8b45('0x42')]=_['merge'](_0x2af25b[_0x8b45('0x42')],{'$or':_[_0x8b45('0x2b')](_0x2af25b[_0x8b45('0x3c')],function(_0x44792b){var _0x39b164={};_0x39b164[_0x44792b]={'$like':'%'+_0x5006a6[_0x8b45('0x39')]['filter']+'%'};return _0x39b164;})});}_0x2af25b=_[_0x8b45('0x45')]({},_0x2af25b,_0x5006a6[_0x8b45('0x48')]);return db[_0x8b45('0x68')][_0x8b45('0x1f')]({'where':_0x2af25b['where']})[_0x8b45('0x25')](function(_0x368b42){_0x406f43[_0x8b45('0x1f')]=_0x368b42;if(_0x5006a6[_0x8b45('0x39')]['includeAll']){_0x2af25b[_0x8b45('0x50')]=[{'all':!![]}];}return db[_0x8b45('0x68')][_0x8b45('0x4a')](_0x2af25b);})['then'](function(_0x1d2f2d){_0x406f43[_0x8b45('0x4b')]=_0x1d2f2d;return _0x406f43;});}})[_0x8b45('0x25')](respondWithFilteredResult(_0x470d23,_0x2af25b))[_0x8b45('0x5a')](handleError(_0x470d23,null));};exports[_0x8b45('0x69')]=function(_0x82ec51,_0x59c08a,_0x3e1263){var _0x3ef748={};var _0x59ea0d={};var _0x237efa;var _0x16d99a;return db['VoiceQueue'][_0x8b45('0x60')]({'where':{'id':_0x82ec51[_0x8b45('0x4d')]['id']}})[_0x8b45('0x25')](handleEntityNotFound(_0x59c08a,null))[_0x8b45('0x25')](function(_0x1d5e77){if(_0x1d5e77){_0x237efa=_0x1d5e77;_0x59ea0d[_0x8b45('0x37')]=_[_0x8b45('0x38')](db[_0x8b45('0x6a')]['rawAttributes']);_0x59ea0d[_0x8b45('0x39')]=_['keys'](_0x82ec51[_0x8b45('0x39')]);_0x59ea0d[_0x8b45('0x3a')]=_[_0x8b45('0x3b')](_0x59ea0d['model'],_0x59ea0d[_0x8b45('0x39')]);_0x3ef748[_0x8b45('0x3c')]=_['intersection'](_0x59ea0d[_0x8b45('0x37')],qs[_0x8b45('0x3d')](_0x82ec51[_0x8b45('0x39')][_0x8b45('0x3d')]));_0x3ef748[_0x8b45('0x3c')]=_0x3ef748[_0x8b45('0x3c')][_0x8b45('0x4f')]?_0x3ef748[_0x8b45('0x3c')]:_0x59ea0d[_0x8b45('0x37')];_0x3ef748['order']=qs[_0x8b45('0x41')](_0x82ec51[_0x8b45('0x39')][_0x8b45('0x41')]);_0x3ef748['where']=qs[_0x8b45('0x3a')](_['pick'](_0x82ec51[_0x8b45('0x39')],_0x59ea0d['filters']));if(_0x82ec51['query'][_0x8b45('0x44')]){_0x3ef748[_0x8b45('0x42')]=_[_0x8b45('0x45')](_0x3ef748['where'],{'$or':_[_0x8b45('0x2b')](_0x3ef748[_0x8b45('0x3c')],function(_0x2f2c38){var _0x43b851={};_0x43b851[_0x2f2c38]={'$like':'%'+_0x82ec51[_0x8b45('0x39')][_0x8b45('0x44')]+'%'};return _0x43b851;})});}_0x3ef748=_[_0x8b45('0x45')]({},_0x3ef748,_0x82ec51[_0x8b45('0x48')]);return _0x237efa['getTeams'](_0x3ef748);}})[_0x8b45('0x25')](function(_0x43c32c){if(_0x43c32c){_0x16d99a=_0x43c32c[_0x8b45('0x4f')];if(!_0x82ec51[_0x8b45('0x39')][_0x8b45('0x3e')](_0x8b45('0x3f'))){_0x3ef748['limit']=qs['limit'](_0x82ec51[_0x8b45('0x39')]['limit']);_0x3ef748['offset']=qs[_0x8b45('0x20')](_0x82ec51[_0x8b45('0x39')][_0x8b45('0x20')]);}return _0x237efa[_0x8b45('0x69')](_0x3ef748);}})[_0x8b45('0x25')](function(_0x5660be){if(_0x5660be){return _0x5660be?{'count':_0x16d99a,'rows':_0x5660be}:null;}})[_0x8b45('0x25')](respondWithResult(_0x59c08a,null))[_0x8b45('0x5a')](handleError(_0x59c08a,null));};exports['addTeams']=function(_0x48ab84,_0xc5bb1f,_0x29ea74){var _0x475d1d=_0x48ab84[_0x8b45('0x52')][_0x8b45('0x6b')];var _0x4884f1=_[_0x8b45('0x2b')](_0x475d1d,'id');return db[_0x8b45('0x6a')][_0x8b45('0x4a')]({'where':{'id':_0x4884f1},'attributes':['id'],'include':[{'model':db[_0x8b45('0x6c')],'as':_0x8b45('0x6d'),'attributes':['id',_0x8b45('0x30'),'online',_0x8b45('0x6e'),_0x8b45('0x6f')],'raw':!![]}]})[_0x8b45('0x25')](function(_0x47a0d9){if(_0x47a0d9){var _0x53eb42=_['flatMap'](_0x47a0d9,function(_0x208e72){var _0x2b7d04=_0x208e72[_0x8b45('0x26')]({'plain':!![]});_0x2b7d04[_0x8b45('0x6d')][_0x8b45('0x70')](function(_0x3f9a2d){_0x3f9a2d[_0x8b45('0x71')]=_[_0x8b45('0x2f')](_0x475d1d,{'id':_0x2b7d04['id']})[_0x8b45('0x71')];});return _0x2b7d04[_0x8b45('0x6d')];});return db['VoiceQueue'][_0x8b45('0x2f')]({'where':{'id':_0x48ab84[_0x8b45('0x4d')]['id']}})['then'](function(_0x252ef3){return db[_0x8b45('0x72')][_0x8b45('0x73')](function(_0x461169){return _0x252ef3[_0x8b45('0x74')](_0x4884f1,{'transaction':_0x461169})[_0x8b45('0x25')](function(){return BPromise[_0x8b45('0x75')](_0x53eb42,function(_0x593609){return db[_0x8b45('0x76')]['findOrCreate']({'where':{'UserId':_0x593609['id'],'VoiceQueueId':_0x48ab84[_0x8b45('0x4d')]['id']},'defaults':{'penalty':_0x593609[_0x8b45('0x71')]},'transaction':_0x461169});});})['then'](function(){return BPromise[_0x8b45('0x75')](_[_0x8b45('0x44')](_0x53eb42,{'online':!![]}),function(_0x3b49d6){return db[_0x8b45('0x77')][_0x8b45('0x78')]({'membername':_0x3b49d6['name'],'UserId':_0x3b49d6['id'],'queue_name':_0x252ef3[_0x8b45('0x30')],'VoiceQueueId':_0x252ef3['id'],'interface':_['isNil'](_0x3b49d6[_0x8b45('0x6f')])?util[_0x8b45('0x79')]('SIP/%s',_0x3b49d6['name']):_0x3b49d6[_0x8b45('0x6f')],'paused':_0x3b49d6['voicePause']||![],'penalty':_0x3b49d6[_0x8b45('0x71')]},{'transaction':_0x461169});});})[_0x8b45('0x25')](function(){_0x53eb42[_0x8b45('0x70')](function(_0x40642c){socket[_0x8b45('0x7a')](_0x8b45('0x7b'),{'UserId':_0x40642c['id'],'VoiceQueueId':_0x252ef3['id']});});});});});}})[_0x8b45('0x25')](respondWithStatusCode(_0xc5bb1f,null))[_0x8b45('0x5a')](handleError(_0xc5bb1f,null));};exports[_0x8b45('0x7c')]=function(_0x52e304,_0x3b6dae,_0x3be32a){return db[_0x8b45('0x6a')][_0x8b45('0x4a')]({'where':{'id':_0x52e304[_0x8b45('0x39')]['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':_0x8b45('0x6d'),'attributes':['id'],'raw':!![]}]})[_0x8b45('0x25')](handleEntityNotFound(_0x3b6dae,null))['then'](function(_0x21fa3a){var _0x2cbfb2=_[_0x8b45('0x2b')](_0x21fa3a,'id');var _0x3cdcdd=[];var _0x3f8977=[];var _0x20036a=squel['select']();_0x20036a[_0x8b45('0x47')]('tq.TeamId')['from'](_0x8b45('0x7d'),'tq')['join'](_0x8b45('0x7e'),'ut',_0x8b45('0x7f'))[_0x8b45('0x42')](_0x8b45('0x80'),_0x52e304[_0x8b45('0x4d')]['id']);for(var _0x71c642=0x0;_0x71c642<_0x21fa3a[_0x8b45('0x4f')];_0x71c642+=0x1){let _0x17a940=_0x21fa3a[_0x71c642];for(var _0x3397ed=0x0;_0x3397ed<_0x17a940[_0x8b45('0x6d')][_0x8b45('0x4f')];_0x3397ed+=0x1){let _0x150266=_0x17a940[_0x8b45('0x6d')][_0x3397ed];var _0x4da4d3=_0x20036a[_0x8b45('0x5c')]();_0x4da4d3[_0x8b45('0x42')](_0x8b45('0x81'),_0x150266['id']);_0x3f8977[_0x8b45('0x82')](db[_0x8b45('0x72')]['query'](_0x4da4d3[_0x8b45('0x83')](),{'type':db[_0x8b45('0x72')][_0x8b45('0x84')][_0x8b45('0x85')]})[_0x8b45('0x25')](function(_0x3b117e){if(_0x3b117e[_0x8b45('0x4f')]===0x1){return _0x150266['id'];}else{var _0x3787f9=_[_0x8b45('0x86')](_[_0x8b45('0x2b')](_0x3b117e,_0x8b45('0x87')),function(_0x3aec32){return _[_0x8b45('0x2d')](_0x2cbfb2,_0x3aec32);});if(_0x3787f9){return _0x150266['id'];}}}));}}return BPromise[_0x8b45('0x88')](_0x3f8977)[_0x8b45('0x25')](function(_0x3976ff){_0x3cdcdd=_(_0x3cdcdd)[_0x8b45('0x89')](_0x3976ff)[_0x8b45('0x8a')]()[_0x8b45('0x2c')]();return db[_0x8b45('0x36')][_0x8b45('0x2f')]({'where':{'id':_0x52e304['params']['id']}})[_0x8b45('0x25')](function(_0x3fbbd7){return db['sequelize'][_0x8b45('0x73')](function(_0x133662){return _0x3fbbd7[_0x8b45('0x7c')](_0x52e304[_0x8b45('0x39')][_0x8b45('0x8b')],{'transaction':_0x133662})['then'](function(){if(!_[_0x8b45('0x8c')](_0x3cdcdd)){return _0x3fbbd7[_0x8b45('0x8d')](_0x3cdcdd,{'transaction':_0x133662})[_0x8b45('0x25')](function(){return db[_0x8b45('0x77')][_0x8b45('0x32')]({'where':{'VoiceQueueId':_0x52e304[_0x8b45('0x4d')]['id'],'UserId':_0x3cdcdd},'transaction':_0x133662});});}})['then'](function(){_0x3cdcdd['forEach'](function(_0x23d14d){socket[_0x8b45('0x7a')](_0x8b45('0x8e'),{'UserId':_0x23d14d,'VoiceQueueId':_0x3fbbd7['id']});});});});});});})['then'](respondWithStatusCode(_0x3b6dae,null))[_0x8b45('0x5a')](handleError(_0x3b6dae,null));};exports[_0x8b45('0x8f')]=function(_0x4e81a8,_0x3cb11b,_0x4d449d){var _0x3427ef,_0x1cf041;return db[_0x8b45('0x36')][_0x8b45('0x2f')]({'where':{'id':_0x4e81a8['params']['id']}})[_0x8b45('0x25')](handleEntityNotFound(_0x3cb11b,null))[_0x8b45('0x25')](function(_0x38acf5){if(_0x38acf5){_0x1cf041=_0x38acf5;return _0x38acf5[_0x8b45('0x8f')](_0x4e81a8[_0x8b45('0x52')][_0x8b45('0x8b')],_[_0x8b45('0x5f')](_0x4e81a8[_0x8b45('0x52')],[_0x8b45('0x8b'),'id'])||{})['spread'](function(_0x1997fd){for(var _0x47a433=0x0;_0x47a433<_0x4e81a8[_0x8b45('0x52')][_0x8b45('0x8b')][_0x8b45('0x4f')];_0x47a433+=0x1){socket[_0x8b45('0x7a')](_0x8b45('0x7b'),{'UserId':_0x4e81a8[_0x8b45('0x52')][_0x8b45('0x8b')][_0x47a433],'VoiceQueueId':_0x4e81a8[_0x8b45('0x4d')]['id']});}return _0x1997fd;});}})[_0x8b45('0x25')](function(_0x127e95){_0x3427ef=_0x127e95||[];if(_0x1cf041){return db[_0x8b45('0x6c')]['findAll']({'where':{'id':_0x4e81a8[_0x8b45('0x52')][_0x8b45('0x8b')]},'attributes':['id',_0x8b45('0x30'),_0x8b45('0x90'),_0x8b45('0x6e'),_0x8b45('0x6f')],'raw':!![]});}})['then'](function(_0x6ed450){if(!_[_0x8b45('0x8c')](_0x6ed450)){var _0x17ecd4=[];for(var _0x1b0ba4=0x0;_0x1b0ba4<_0x6ed450[_0x8b45('0x4f')];_0x1b0ba4++){if(_0x6ed450[_0x1b0ba4][_0x8b45('0x90')]){_0x17ecd4[_0x8b45('0x82')](db[_0x8b45('0x77')][_0x8b45('0x78')]({'membername':_0x6ed450[_0x1b0ba4][_0x8b45('0x30')],'UserId':_0x6ed450[_0x1b0ba4]['id'],'queue_name':_0x1cf041[_0x8b45('0x30')],'VoiceQueueId':_0x1cf041['id'],'interface':_['isNil'](_0x6ed450[_0x1b0ba4][_0x8b45('0x6f')])?util[_0x8b45('0x79')](_0x8b45('0x91'),_0x6ed450[_0x1b0ba4]['name']):_0x6ed450[_0x1b0ba4]['interface'],'paused':_0x6ed450[_0x1b0ba4][_0x8b45('0x6e')]||![],'penalty':_0x4e81a8['body']['penalty']||0x0}));}}return BPromise[_0x8b45('0x88')](_0x17ecd4);}})[_0x8b45('0x25')](function(){return _0x3427ef;})[_0x8b45('0x25')](respondWithResult(_0x3cb11b,null))[_0x8b45('0x5a')](handleError(_0x3cb11b,null));};exports[_0x8b45('0x8d')]=function(_0x26efc2,_0x76c89f,_0x174083){return db[_0x8b45('0x36')]['find']({'where':{'id':_0x26efc2['params']['id']}})[_0x8b45('0x25')](handleEntityNotFound(_0x76c89f,null))[_0x8b45('0x25')](function(_0x54546f){if(_0x54546f){return _0x54546f['removeAgents'](_0x26efc2[_0x8b45('0x39')]['ids'])[_0x8b45('0x25')](function(){if(_[_0x8b45('0x92')](_0x26efc2[_0x8b45('0x39')][_0x8b45('0x8b')])){for(var _0x32389e=0x0;_0x32389e<_0x26efc2[_0x8b45('0x39')][_0x8b45('0x8b')][_0x8b45('0x4f')];_0x32389e+=0x1){socket[_0x8b45('0x7a')](_0x8b45('0x8e'),{'UserId':Number(_0x26efc2[_0x8b45('0x39')][_0x8b45('0x8b')][_0x32389e]),'VoiceQueueId':Number(_0x26efc2[_0x8b45('0x4d')]['id'])});}}else{socket[_0x8b45('0x7a')]('userVoiceQueue:remove',{'UserId':Number(_0x26efc2[_0x8b45('0x39')][_0x8b45('0x8b')]),'VoiceQueueId':Number(_0x26efc2[_0x8b45('0x4d')]['id'])});}});}})['then'](function(_0x5ae53d){return db[_0x8b45('0x77')][_0x8b45('0x32')]({'where':{'VoiceQueueId':_0x26efc2[_0x8b45('0x4d')]['id'],'UserId':_0x26efc2['query']['ids']}})[_0x8b45('0x25')](function(){return _0x5ae53d;});})[_0x8b45('0x25')](respondWithStatusCode(_0x76c89f,null))[_0x8b45('0x5a')](handleError(_0x76c89f,null));};exports[_0x8b45('0x93')]=function(_0x5756c1,_0x335aac,_0x125304){var _0x31d3d0={};var _0x447b54={};var _0x4516d9;var _0x153ef4;return db[_0x8b45('0x36')][_0x8b45('0x60')]({'where':{'id':_0x5756c1[_0x8b45('0x4d')]['id']}})[_0x8b45('0x25')](handleEntityNotFound(_0x335aac,null))['then'](function(_0x4e8da8){if(_0x4e8da8){_0x4516d9=_0x4e8da8;_0x447b54[_0x8b45('0x37')]=_['keys'](db[_0x8b45('0x6c')]['rawAttributes']);_0x447b54[_0x8b45('0x39')]=_[_0x8b45('0x38')](_0x5756c1[_0x8b45('0x39')]);_0x447b54['filters']=_[_0x8b45('0x3b')](_0x447b54[_0x8b45('0x37')],_0x447b54[_0x8b45('0x39')]);_0x31d3d0[_0x8b45('0x3c')]=_[_0x8b45('0x3b')](_0x447b54[_0x8b45('0x37')],qs[_0x8b45('0x3d')](_0x5756c1[_0x8b45('0x39')]['fields']));_0x31d3d0['attributes']=_0x31d3d0[_0x8b45('0x3c')][_0x8b45('0x4f')]?_0x31d3d0['attributes']:_0x447b54[_0x8b45('0x37')];_0x31d3d0['order']=qs[_0x8b45('0x41')](_0x5756c1[_0x8b45('0x39')]['sort']);_0x31d3d0[_0x8b45('0x42')]=qs['filters'](_['pick'](_0x5756c1[_0x8b45('0x39')],_0x447b54[_0x8b45('0x3a')]));if(_0x5756c1[_0x8b45('0x39')][_0x8b45('0x44')]){_0x31d3d0[_0x8b45('0x42')]=_['merge'](_0x31d3d0[_0x8b45('0x42')],{'$or':_[_0x8b45('0x2b')](_0x31d3d0['attributes'],function(_0x3c447a){var _0x246fc6={};_0x246fc6[_0x3c447a]={'$like':'%'+_0x5756c1['query']['filter']+'%'};return _0x246fc6;})});}_0x31d3d0=_[_0x8b45('0x45')]({},_0x31d3d0,_0x5756c1[_0x8b45('0x48')]);return _0x4516d9[_0x8b45('0x93')](_0x31d3d0);}})[_0x8b45('0x25')](function(_0x495fdb){if(_0x495fdb){_0x153ef4=_0x495fdb[_0x8b45('0x4f')];if(!_0x5756c1[_0x8b45('0x39')][_0x8b45('0x3e')](_0x8b45('0x3f'))){_0x31d3d0[_0x8b45('0x40')]=qs[_0x8b45('0x40')](_0x5756c1[_0x8b45('0x39')][_0x8b45('0x40')]);_0x31d3d0[_0x8b45('0x20')]=qs[_0x8b45('0x20')](_0x5756c1[_0x8b45('0x39')]['offset']);}return _0x4516d9[_0x8b45('0x93')](_0x31d3d0);}})[_0x8b45('0x25')](function(_0xb621f6){if(_0xb621f6){return _0xb621f6?{'count':_0x153ef4,'rows':_0xb621f6}:null;}})[_0x8b45('0x25')](respondWithResult(_0x335aac,null))[_0x8b45('0x5a')](handleError(_0x335aac,null));};exports[_0x8b45('0x94')]=function(_0x5d2073,_0x11a7d6,_0x16950f){var _0x10e89f={};var _0x2f70f3={};var _0x41b76e;var _0x2608e6;return db[_0x8b45('0x36')][_0x8b45('0x60')]({'where':{'id':_0x5d2073[_0x8b45('0x4d')]['id']}})[_0x8b45('0x25')](handleEntityNotFound(_0x11a7d6,null))[_0x8b45('0x25')](function(_0x2b7b52){if(_0x2b7b52){_0x41b76e=_0x2b7b52;_0x2f70f3[_0x8b45('0x37')]=_[_0x8b45('0x38')](db[_0x8b45('0x77')][_0x8b45('0x4e')]);_0x2f70f3[_0x8b45('0x39')]=_[_0x8b45('0x38')](_0x5d2073[_0x8b45('0x39')]);_0x2f70f3[_0x8b45('0x3a')]=_[_0x8b45('0x3b')](_0x2f70f3[_0x8b45('0x37')],_0x2f70f3[_0x8b45('0x39')]);_0x10e89f['attributes']=_[_0x8b45('0x3b')](_0x2f70f3[_0x8b45('0x37')],qs['fields'](_0x5d2073[_0x8b45('0x39')][_0x8b45('0x3d')]));_0x10e89f[_0x8b45('0x3c')]=_0x10e89f[_0x8b45('0x3c')][_0x8b45('0x4f')]?_0x10e89f[_0x8b45('0x3c')]:_0x2f70f3['model'];_0x10e89f[_0x8b45('0x66')]=qs['sort'](_0x5d2073[_0x8b45('0x39')][_0x8b45('0x41')]);_0x10e89f[_0x8b45('0x42')]=qs[_0x8b45('0x3a')](_['pick'](_0x5d2073[_0x8b45('0x39')],_0x2f70f3[_0x8b45('0x3a')]));if(_0x5d2073[_0x8b45('0x39')][_0x8b45('0x44')]){_0x10e89f[_0x8b45('0x42')]=_['merge'](_0x10e89f[_0x8b45('0x42')],{'$or':_[_0x8b45('0x2b')](_0x10e89f[_0x8b45('0x3c')],function(_0x5430b0){var _0xbab2a4={};_0xbab2a4[_0x5430b0]={'$like':'%'+_0x5d2073[_0x8b45('0x39')][_0x8b45('0x44')]+'%'};return _0xbab2a4;})});}_0x10e89f=_['merge']({},_0x10e89f,_0x5d2073[_0x8b45('0x48')]);return _0x41b76e[_0x8b45('0x94')](_0x10e89f);}})[_0x8b45('0x25')](function(_0x56bd87){if(_0x56bd87){_0x2608e6=_0x56bd87[_0x8b45('0x4f')];if(!_0x5d2073[_0x8b45('0x39')]['hasOwnProperty'](_0x8b45('0x3f'))){_0x10e89f[_0x8b45('0x40')]=qs[_0x8b45('0x40')](_0x5d2073[_0x8b45('0x39')][_0x8b45('0x40')]);_0x10e89f['offset']=qs['offset'](_0x5d2073[_0x8b45('0x39')]['offset']);}return _0x41b76e[_0x8b45('0x94')](_0x10e89f);}})['then'](function(_0x15e8df){return _0x15e8df?{'count':_0x2608e6,'rows':_0x15e8df}:null;})[_0x8b45('0x25')](respondWithResult(_0x11a7d6,null))['catch'](handleError(_0x11a7d6,null));};exports[_0x8b45('0x95')]=function(_0x26ba71,_0x4ab63b,_0xbc3a99){var _0x187485={};var _0x58117e={};var _0x2a4615;var _0x45e25b;return db[_0x8b45('0x36')][_0x8b45('0x60')]({'where':{'id':_0x26ba71['params']['id']}})[_0x8b45('0x25')](handleEntityNotFound(_0x4ab63b,null))[_0x8b45('0x25')](function(_0xb4fb8b){if(_0xb4fb8b){_0x2a4615=_0xb4fb8b;_0x58117e[_0x8b45('0x37')]=_[_0x8b45('0x38')](db[_0x8b45('0x96')][_0x8b45('0x4e')]);_0x58117e['query']=_['keys'](_0x26ba71[_0x8b45('0x39')]);_0x58117e[_0x8b45('0x3a')]=_['intersection'](_0x58117e[_0x8b45('0x37')],_0x58117e[_0x8b45('0x39')]);_0x187485[_0x8b45('0x3c')]=_[_0x8b45('0x3b')](_0x58117e['model'],qs[_0x8b45('0x3d')](_0x26ba71[_0x8b45('0x39')]['fields']));_0x187485['attributes']=_0x187485[_0x8b45('0x3c')][_0x8b45('0x4f')]?_0x187485[_0x8b45('0x3c')]:_0x58117e[_0x8b45('0x37')];_0x187485[_0x8b45('0x66')]=qs['sort'](_0x26ba71[_0x8b45('0x39')]['sort']);_0x187485[_0x8b45('0x42')]=qs['filters'](_[_0x8b45('0x43')](_0x26ba71[_0x8b45('0x39')],_0x58117e['filters']));if(_0x26ba71[_0x8b45('0x39')][_0x8b45('0x44')]){_0x187485[_0x8b45('0x42')]=_['merge'](_0x187485['where'],{'$or':_[_0x8b45('0x2b')](_0x187485[_0x8b45('0x3c')],function(_0x2d8858){var _0x515774={};_0x515774[_0x2d8858]={'$like':'%'+_0x26ba71[_0x8b45('0x39')][_0x8b45('0x44')]+'%'};return _0x515774;})});}_0x187485=_['merge']({},_0x187485,_0x26ba71['options']);return _0x2a4615[_0x8b45('0x95')](_0x187485);}})[_0x8b45('0x25')](function(_0x5c3245){if(_0x5c3245){_0x45e25b=_0x5c3245[_0x8b45('0x4f')];if(!_0x26ba71['query'][_0x8b45('0x3e')](_0x8b45('0x3f'))){_0x187485[_0x8b45('0x40')]=qs[_0x8b45('0x40')](_0x26ba71[_0x8b45('0x39')][_0x8b45('0x40')]);_0x187485[_0x8b45('0x20')]=qs[_0x8b45('0x20')](_0x26ba71[_0x8b45('0x39')][_0x8b45('0x20')]);}return _0x2a4615[_0x8b45('0x95')](_0x187485);}})[_0x8b45('0x25')](function(_0x27d264){if(_0x27d264){return _0x27d264?{'count':_0x45e25b,'rows':_0x27d264}:null;}})[_0x8b45('0x25')](respondWithResult(_0x4ab63b,null))['catch'](handleError(_0x4ab63b,null));};exports[_0x8b45('0x97')]=function(_0x5369f8,_0x1b140e,_0x2afd7f){var _0x2ae0d,_0x2c6d5b;return db[_0x8b45('0x36')]['find']({'where':{'id':_0x5369f8['params']['id']}})['then'](handleEntityNotFound(_0x1b140e,null))[_0x8b45('0x25')](function(_0x25ef46){if(_0x25ef46){_0x2c6d5b=_0x25ef46;return _0x25ef46[_0x8b45('0x97')](_0x5369f8[_0x8b45('0x52')][_0x8b45('0x8b')],_['omit'](_0x5369f8['body'],[_0x8b45('0x8b'),'id'])||{});}return null;})[_0x8b45('0x98')](function(_0x2343c6){var _0x5d870e;_0x2ae0d=_0x2343c6||[];var _0x169a48=[];if(_0x2343c6){for(var _0x48a51d=0x0;_0x48a51d<_0x2343c6[_0x8b45('0x4f')];_0x48a51d+=0x1){var _0x2312bc=_0x2343c6[_0x48a51d][_0x8b45('0x26')]({'plain':!![]});_0x2c6d5b['dialCheckDuplicateType']=_0x5369f8[_0x8b45('0x52')]['dialCheckDuplicateType']?_0x5369f8['body'][_0x8b45('0x99')]:_0x2c6d5b['dialCheckDuplicateType'];switch(_0x2c6d5b[_0x8b45('0x99')]){case _0x8b45('0x9a'):_0x5d870e=squel[_0x8b45('0x9b')]()[_0x8b45('0x9c')](_0x8b45('0x9d'))[_0x8b45('0x9e')](['phone',_0x8b45('0x9f'),_0x8b45('0xa0'),_0x8b45('0xa1'),'VoiceQueueId',_0x8b45('0x5d'),_0x8b45('0x5e')],squel[_0x8b45('0xa2')]()['field'](_0x8b45('0xa3'),'phone')[_0x8b45('0x47')]('NOW()','scheduledAt')[_0x8b45('0x47')]('id',_0x8b45('0xa0'))[_0x8b45('0x47')](_0x2312bc[_0x8b45('0xa4')][_0x8b45('0x83')](),'ListId')[_0x8b45('0x47')](_0x5369f8['params']['id'][_0x8b45('0x83')](),_0x8b45('0x62'))[_0x8b45('0x47')](_0x8b45('0xa5'),'createdAt')[_0x8b45('0x47')](_0x8b45('0xa5'),'updatedAt')[_0x8b45('0xa6')](_0x8b45('0xa7'))[_0x8b45('0x42')]('deletedAt\x20IS\x20NULL')['where']('ListId\x20=\x20?',_0x2312bc[_0x8b45('0xa4')][_0x8b45('0x83')]())[_0x8b45('0x42')]('phone\x20IS\x20NOT\x20NULL')[_0x8b45('0x42')](_0x8b45('0xa8'),squel[_0x8b45('0xa2')]()[_0x8b45('0x47')](_0x8b45('0xa9'))['from'](_0x8b45('0xaa'))[_0x8b45('0x42')]('VoiceQueueId\x20=\x20?',_0x5369f8[_0x8b45('0x4d')]['id'][_0x8b45('0x83')]()))['where'](_0x8b45('0xa8'),squel[_0x8b45('0xa2')]()[_0x8b45('0x47')](_0x8b45('0xab'))['from'](_0x8b45('0x9d'))[_0x8b45('0x42')](_0x8b45('0x80'),_0x5369f8[_0x8b45('0x4d')]['id'][_0x8b45('0x83')]())))[_0x8b45('0x83')]();break;case'onlyIfOpen':_0x5d870e=squel[_0x8b45('0x9b')]()[_0x8b45('0x9c')](_0x8b45('0x9d'))[_0x8b45('0x9e')]([_0x8b45('0xa3'),_0x8b45('0x9f'),'ContactId',_0x8b45('0xa1'),_0x8b45('0x62'),_0x8b45('0x5d'),'updatedAt'],squel[_0x8b45('0xa2')]()['field']('phone',_0x8b45('0xa3'))[_0x8b45('0x47')](_0x8b45('0xa5'),_0x8b45('0x9f'))[_0x8b45('0x47')]('id',_0x8b45('0xa0'))[_0x8b45('0x47')](_0x2312bc[_0x8b45('0xa4')][_0x8b45('0x83')](),_0x8b45('0xa1'))[_0x8b45('0x47')](_0x5369f8[_0x8b45('0x4d')]['id'][_0x8b45('0x83')](),_0x8b45('0x62'))[_0x8b45('0x47')](_0x8b45('0xa5'),'createdAt')['field'](_0x8b45('0xa5'),'updatedAt')[_0x8b45('0xa6')](_0x8b45('0xa7'))[_0x8b45('0x42')](_0x8b45('0xac'))[_0x8b45('0x42')](_0x8b45('0xad'),_0x2312bc[_0x8b45('0xa4')]['toString']())[_0x8b45('0x42')]('phone\x20IS\x20NOT\x20NULL')[_0x8b45('0x42')]('phone\x20NOT\x20IN\x20(?)',squel[_0x8b45('0xa2')]()[_0x8b45('0x47')]('COALESCE(phone,\x27\x27)')['from']('cm_hopper')[_0x8b45('0x42')](_0x8b45('0x80'),_0x5369f8[_0x8b45('0x4d')]['id'][_0x8b45('0x83')]())))[_0x8b45('0x83')]();break;default:_0x5d870e=squel[_0x8b45('0x9b')]()[_0x8b45('0x9c')](_0x8b45('0x9d'))[_0x8b45('0x9e')]([_0x8b45('0xa3'),_0x8b45('0x9f'),_0x8b45('0xa0'),'ListId','VoiceQueueId',_0x8b45('0x5d'),_0x8b45('0x5e')],squel[_0x8b45('0xa2')]()[_0x8b45('0x47')](_0x8b45('0xa3'),_0x8b45('0xa3'))['field']('NOW()',_0x8b45('0x9f'))[_0x8b45('0x47')]('id','ContactId')[_0x8b45('0x47')](_0x2312bc[_0x8b45('0xa4')][_0x8b45('0x83')](),_0x8b45('0xa1'))['field'](_0x5369f8[_0x8b45('0x4d')]['id'][_0x8b45('0x83')](),_0x8b45('0x62'))[_0x8b45('0x47')](_0x8b45('0xa5'),'createdAt')['field']('NOW()',_0x8b45('0x5e'))[_0x8b45('0xa6')]('cm_contacts')['where'](_0x8b45('0xac'))['where'](_0x8b45('0xad'),_0x2312bc[_0x8b45('0xa4')][_0x8b45('0x83')]())[_0x8b45('0x42')](_0x8b45('0xae')))['toString']();}_0x169a48[_0x8b45('0x82')](db[_0x8b45('0x72')][_0x8b45('0x39')](_0x5d870e));}return BPromise[_0x8b45('0x88')](_0x169a48);}})[_0x8b45('0x25')](function(){return _0x2ae0d;})[_0x8b45('0x25')](respondWithResult(_0x1b140e,null))[_0x8b45('0x5a')](handleError(_0x1b140e,null));};exports['removeLists']=function(_0x314ce2,_0x16e3e5,_0x588863){return db[_0x8b45('0x36')]['find']({'where':{'id':_0x314ce2[_0x8b45('0x4d')]['id']}})[_0x8b45('0x25')](handleEntityNotFound(_0x16e3e5,null))['then'](function(_0x4fe4af){if(_0x4fe4af){return _0x4fe4af[_0x8b45('0xaf')](_0x314ce2[_0x8b45('0x39')][_0x8b45('0x8b')]);}})[_0x8b45('0x25')](function(_0x332139){if(_0x332139){return db[_0x8b45('0x61')][_0x8b45('0x32')]({'where':{'ListId':_0x314ce2['query'][_0x8b45('0x8b')],'VoiceQueueId':_0x314ce2[_0x8b45('0x4d')]['id']}})[_0x8b45('0x25')](function(){return _0x332139;});}})[_0x8b45('0x25')](respondWithStatusCode(_0x16e3e5,null))['catch'](handleError(_0x16e3e5,null));};exports[_0x8b45('0xb0')]=function(_0x13c783,_0x21621c,_0x43c397){var _0x3db4ae={};var _0x542451={};var _0x558267;var _0x3b82dc;return db[_0x8b45('0x36')]['findOne']({'where':{'id':_0x13c783[_0x8b45('0x4d')]['id']}})[_0x8b45('0x25')](handleEntityNotFound(_0x21621c,null))[_0x8b45('0x25')](function(_0x1ba473){if(_0x1ba473){_0x558267=_0x1ba473;_0x542451[_0x8b45('0x37')]=_['keys'](db[_0x8b45('0x96')][_0x8b45('0x4e')]);_0x542451['query']=_[_0x8b45('0x38')](_0x13c783[_0x8b45('0x39')]);_0x542451['filters']=_['intersection'](_0x542451[_0x8b45('0x37')],_0x542451[_0x8b45('0x39')]);_0x3db4ae[_0x8b45('0x3c')]=_['intersection'](_0x542451[_0x8b45('0x37')],qs['fields'](_0x13c783[_0x8b45('0x39')][_0x8b45('0x3d')]));_0x3db4ae[_0x8b45('0x3c')]=_0x3db4ae['attributes'][_0x8b45('0x4f')]?_0x3db4ae[_0x8b45('0x3c')]:_0x542451[_0x8b45('0x37')];_0x3db4ae[_0x8b45('0x66')]=qs[_0x8b45('0x41')](_0x13c783[_0x8b45('0x39')][_0x8b45('0x41')]);_0x3db4ae['where']=qs['filters'](_[_0x8b45('0x43')](_0x13c783['query'],_0x542451[_0x8b45('0x3a')]));if(_0x13c783[_0x8b45('0x39')][_0x8b45('0x44')]){_0x3db4ae[_0x8b45('0x42')]=_[_0x8b45('0x45')](_0x3db4ae[_0x8b45('0x42')],{'$or':_[_0x8b45('0x2b')](_0x3db4ae[_0x8b45('0x3c')],function(_0x4df733){var _0x372e5f={};_0x372e5f[_0x4df733]={'$like':'%'+_0x13c783['query'][_0x8b45('0x44')]+'%'};return _0x372e5f;})});}_0x3db4ae=_['merge']({},_0x3db4ae,_0x13c783['options']);return _0x558267['getBlackLists'](_0x3db4ae);}})[_0x8b45('0x25')](function(_0x2fc542){if(_0x2fc542){_0x3b82dc=_0x2fc542[_0x8b45('0x4f')];if(!_0x13c783[_0x8b45('0x39')][_0x8b45('0x3e')](_0x8b45('0x3f'))){_0x3db4ae['limit']=qs['limit'](_0x13c783[_0x8b45('0x39')][_0x8b45('0x40')]);_0x3db4ae[_0x8b45('0x20')]=qs['offset'](_0x13c783['query']['offset']);}return _0x558267[_0x8b45('0xb0')](_0x3db4ae);}})[_0x8b45('0x25')](function(_0x7f1d8a){if(_0x7f1d8a){return _0x7f1d8a?{'count':_0x3b82dc,'rows':_0x7f1d8a}:null;}})[_0x8b45('0x25')](respondWithResult(_0x21621c,null))[_0x8b45('0x5a')](handleError(_0x21621c,null));};exports[_0x8b45('0xb1')]=function(_0x2d4f0b,_0x33df39,_0x545022){var _0x30ac86,_0x176bf4;return db[_0x8b45('0x36')][_0x8b45('0x2f')]({'where':{'id':_0x2d4f0b['params']['id']}})[_0x8b45('0x25')](handleEntityNotFound(_0x33df39,null))[_0x8b45('0x25')](function(_0x34e7f3){if(_0x34e7f3){_0x176bf4=_0x34e7f3;return _0x34e7f3[_0x8b45('0xb1')](_0x2d4f0b[_0x8b45('0x52')][_0x8b45('0x8b')],_['omit'](_0x2d4f0b['body'],[_0x8b45('0x8b'),'id'])||{});}return null;})[_0x8b45('0x98')](function(_0x9df0bd){var _0x3e99bd;_0x30ac86=_0x9df0bd||[];var _0x3b7dd2=[];if(_0x9df0bd){for(var _0x376e69=0x0;_0x376e69<_0x9df0bd[_0x8b45('0x4f')];_0x376e69+=0x1){var _0x2db2e4=_0x9df0bd[_0x376e69][_0x8b45('0x26')]({'plain':!![]});_0x3e99bd=squel[_0x8b45('0x9b')]()['into']('cm_hopper_black')['fromQuery']([_0x8b45('0xa3'),_0x8b45('0xa0'),_0x8b45('0xa1'),'VoiceQueueId','createdAt',_0x8b45('0x5e')],squel[_0x8b45('0xa2')]()[_0x8b45('0x47')](_0x8b45('0xa3'),_0x8b45('0xa3'))[_0x8b45('0x47')]('id',_0x8b45('0xa0'))[_0x8b45('0x47')](_0x2db2e4[_0x8b45('0xa4')][_0x8b45('0x83')](),_0x8b45('0xa1'))['field'](_0x2d4f0b[_0x8b45('0x4d')]['id'][_0x8b45('0x83')](),_0x8b45('0x62'))[_0x8b45('0x47')](_0x8b45('0xa5'),_0x8b45('0x5d'))[_0x8b45('0x47')]('NOW()',_0x8b45('0x5e'))[_0x8b45('0xa6')](_0x8b45('0xa7'))[_0x8b45('0x42')](_0x8b45('0xac'))[_0x8b45('0x42')]('ListId\x20=\x20?',_0x2db2e4[_0x8b45('0xa4')]['toString']())[_0x8b45('0x42')](_0x8b45('0xae')))[_0x8b45('0x83')]();_0x3b7dd2[_0x8b45('0x82')](db[_0x8b45('0x72')][_0x8b45('0x39')](_0x3e99bd));}return BPromise['all'](_0x3b7dd2);}})['then'](function(){return _0x30ac86;})[_0x8b45('0x25')](respondWithResult(_0x33df39,null))[_0x8b45('0x5a')](handleError(_0x33df39,null));};exports['removeBlackLists']=function(_0xd205f9,_0x4faff1,_0xceebf2){return db[_0x8b45('0x36')][_0x8b45('0x2f')]({'where':{'id':_0xd205f9[_0x8b45('0x4d')]['id']}})[_0x8b45('0x25')](handleEntityNotFound(_0x4faff1,null))[_0x8b45('0x25')](function(_0x540997){if(_0x540997){return _0x540997[_0x8b45('0xb2')](_0xd205f9['query']['ids']);}})[_0x8b45('0x25')](function(_0x661d43){if(_0x661d43){return db['CmHopperBlack']['destroy']({'where':{'ListId':_0xd205f9[_0x8b45('0x39')][_0x8b45('0x8b')],'VoiceQueueId':_0xd205f9[_0x8b45('0x4d')]['id']}})[_0x8b45('0x25')](function(){return _0x661d43;});}})[_0x8b45('0x25')](respondWithStatusCode(_0x4faff1,null))[_0x8b45('0x5a')](handleError(_0x4faff1,null));}; \ No newline at end of file +var _0x3351=['Team','addTeams','teams','User','Agents','online','interface','flatMap','forEach','penalty','sequelize','each','UserVoiceQueue','findOrCreate','UserVoiceQueueRt','upsert','isNil','SIP/%s','emit','userVoiceQueue:save','removeTeams','ids','from','team_has_voice_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','all','union','compact','isEmpty','userVoiceQueue:remove','addAgents','omit','spread','voicePause','removeAgents','isArray','getAgents','getMembers','getLists','addLists','dialCheckDuplicateType','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','select','NOW()','CmListId','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','cm_hopper_final','VoiceQueueId\x20=\x20?','onlyIfOpen','ListId','phone\x20IS\x20NOT\x20NULL','COALESCE(phone,\x27\x27)','removeLists','getBlackLists','CmList','addBlackLists','cm_hopper_black','removeBlackLists','html-pdf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','redis','socket.io-emitter','./voiceQueue.socket','end','status','offset','limit','Content-Range','apply','reject','update','destroy','then','VoiceQueues','inbound','QueueCampaigns','filter','ignore','map','value','includes','type','find','UserProfileResource','sendStatus','error','stack','name','index','VoiceQueue','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filters','merge','where','key','field','options','count','includeAll','include','findAll','catch','show','params','rawAttributes','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','outbound','UserProfileSection','userProfileId','autoAssociation','createdAt','updatedAt','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getHoppers','CmHopper','order','VoiceQueueId','rows','getHopperHistories','CmHopperHistory','findOne','CmHopperFinal','CmHopperBlack','getTeams'];(function(_0x9c2427,_0x17c865){var _0x51984f=function(_0x177af6){while(--_0x177af6){_0x9c2427['push'](_0x9c2427['shift']());}};_0x51984f(++_0x17c865);}(_0x3351,0x1b4));var _0x1335=function(_0x34021d,_0x753aa6){_0x34021d=_0x34021d-0x0;var _0x16597b=_0x3351[_0x34021d];return _0x16597b;};'use strict';var pdf=require(_0x1335('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x1335('0x1'));var jsonpatch=require(_0x1335('0x2'));var rp=require(_0x1335('0x3'));var moment=require(_0x1335('0x4'));var BPromise=require(_0x1335('0x5'));var Mustache=require(_0x1335('0x6'));var util=require(_0x1335('0x7'));var path=require('path');var sox=require(_0x1335('0x8'));var csv=require(_0x1335('0x9'));var ejs=require(_0x1335('0xa'));var fs=require('fs');var _=require(_0x1335('0xb'));var squel=require(_0x1335('0xc'));var crypto=require(_0x1335('0xd'));var jsforce=require(_0x1335('0xe'));var deskjs=require(_0x1335('0xf'));var toCsv=require(_0x1335('0x9'));var querystring=require(_0x1335('0x10'));var Papa=require(_0x1335('0x11'));var Redis=require('ioredis');var authService=require(_0x1335('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x1335('0x13'));var hardwareService=require(_0x1335('0x14'));var logger=require(_0x1335('0x15'))(_0x1335('0x16'));var utils=require(_0x1335('0x17'));var config=require(_0x1335('0x18'));var db=require('../../mysqldb')['db'];config[_0x1335('0x19')]=_['defaults'](config[_0x1335('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0x1335('0x1a'))(new Redis(config['redis']));require(_0x1335('0x1b'))['register'](socket);function respondWithStatusCode(_0x4f9625,_0xc333ce){_0xc333ce=_0xc333ce||0xcc;return function(_0x3ae94b){if(_0x3ae94b){return _0x4f9625['sendStatus'](_0xc333ce);}return _0x4f9625['status'](_0xc333ce)[_0x1335('0x1c')]();};}function respondWithResult(_0x565686,_0x431433){_0x431433=_0x431433||0xc8;return function(_0x3f1d76){if(_0x3f1d76){return _0x565686[_0x1335('0x1d')](_0x431433)['json'](_0x3f1d76);}};}function respondWithFilteredResult(_0x2634dd,_0x4da3b8){return function(_0x3408c6){if(_0x3408c6){var _0x4d5b17=_0x3408c6['count'],_0x122228=_0x4da3b8[_0x1335('0x1e')],_0x36123c=_0x4da3b8[_0x1335('0x1e')]+_0x4da3b8[_0x1335('0x1f')],_0x104dce;if(_0x36123c>=_0x4d5b17){_0x36123c=_0x4d5b17;_0x104dce=0xc8;}else{_0x104dce=0xce;}_0x2634dd[_0x1335('0x1d')](_0x104dce);return _0x2634dd['set'](_0x1335('0x20'),_0x122228+'-'+_0x36123c+'/'+_0x4d5b17)['json'](_0x3408c6);}return null;};}function patchUpdates(_0x5c10d3){return function(_0x582304){try{jsonpatch[_0x1335('0x21')](_0x582304,_0x5c10d3,!![]);}catch(_0x2aaecd){return BPromise[_0x1335('0x22')](_0x2aaecd);}return _0x582304['save']();};}function saveUpdates(_0x4c01c9,_0x25aacb){return function(_0x4a29b4){if(_0x4a29b4){return _0x4a29b4[_0x1335('0x23')](_0x4c01c9)['then'](function(_0x35432b){return _0x35432b;});}return null;};}function removeEntity(_0x1c13a8,_0x383d19){return function(_0x1dd0ef){if(_0x1dd0ef){return _0x1dd0ef[_0x1335('0x24')]()[_0x1335('0x25')](function(){var _0x331317=_0x1dd0ef['get']({'plain':!![]});var _0x37efee=[{'name':_0x1335('0x26'),'value':_0x1335('0x27'),'ignore':![]},{'name':_0x1335('0x28'),'value':'outbound','ignore':![]}];var _0x1498e6=_(_0x37efee)[_0x1335('0x29')](_0x1335('0x2a'))[_0x1335('0x2b')](_0x1335('0x2c'))[_0x1335('0x2c')]();if(_[_0x1335('0x2d')](_0x1498e6,_0x331317[_0x1335('0x2e')])){return;}var _0x23b5cc=_[_0x1335('0x2f')](_0x37efee,[_0x1335('0x2c'),_0x331317[_0x1335('0x2e')]])['name'];return db[_0x1335('0x30')]['destroy']({'where':{'type':_0x23b5cc,'resourceId':_0x331317['id']}})[_0x1335('0x25')](function(){return _0x1dd0ef;});})[_0x1335('0x25')](function(){_0x1c13a8[_0x1335('0x1d')](0xcc)[_0x1335('0x1c')]();});}};}function handleEntityNotFound(_0x564fc4,_0x39eb22){return function(_0x196ecd){if(!_0x196ecd){_0x564fc4[_0x1335('0x31')](0x194);}return _0x196ecd;};}function handleError(_0x36ec2e,_0x5a2d1e){_0x5a2d1e=_0x5a2d1e||0x1f4;return function(_0x36c9dd){logger[_0x1335('0x32')](_0x36c9dd[_0x1335('0x33')]);if(_0x36c9dd[_0x1335('0x34')]){delete _0x36c9dd[_0x1335('0x34')];}_0x36ec2e[_0x1335('0x1d')](_0x5a2d1e)['send'](_0x36c9dd);};}exports[_0x1335('0x35')]=function(_0x4159cc,_0x3bf6c8){var _0xed98a0={},_0x4b848c={},_0x3e7cc5={'count':0x0,'rows':[]};var _0x530fa1=db[_0x1335('0x36')]['rawAttributes'];_0x4b848c[_0x1335('0x37')]=_[_0x1335('0x38')](_0x530fa1);_0x4b848c[_0x1335('0x39')]=_['keys'](_0x4159cc[_0x1335('0x39')]);_0x4b848c['filters']=_[_0x1335('0x3a')](_0x4b848c[_0x1335('0x37')],_0x4b848c[_0x1335('0x39')]);_0xed98a0[_0x1335('0x3b')]=_[_0x1335('0x3a')](_0x4b848c[_0x1335('0x37')],qs['fields'](_0x4159cc[_0x1335('0x39')][_0x1335('0x3c')]));_0xed98a0[_0x1335('0x3b')]=_0xed98a0['attributes'][_0x1335('0x3d')]?_0xed98a0['attributes']:_0x4b848c[_0x1335('0x37')];if(!_0x4159cc['query'][_0x1335('0x3e')](_0x1335('0x3f'))){_0xed98a0['limit']=qs[_0x1335('0x1f')](_0x4159cc[_0x1335('0x39')]['limit']);_0xed98a0[_0x1335('0x1e')]=qs[_0x1335('0x1e')](_0x4159cc[_0x1335('0x39')][_0x1335('0x1e')]);}_0xed98a0['order']=qs[_0x1335('0x40')](_0x4159cc[_0x1335('0x39')][_0x1335('0x40')]);_0xed98a0['where']=qs['filters'](_[_0x1335('0x41')](_0x4159cc[_0x1335('0x39')],_0x4b848c[_0x1335('0x42')]));if(_0x4159cc[_0x1335('0x39')]['filter']){_0xed98a0['where']=_[_0x1335('0x43')](_0xed98a0[_0x1335('0x44')],{'$or':_[_0x1335('0x2b')](_0x530fa1,function(_0xdb5ee4){if(_0xdb5ee4[_0x1335('0x2e')][_0x1335('0x45')]!=='VIRTUAL'){var _0xb6348d={};_0xb6348d[_0xdb5ee4[_0x1335('0x46')]]={'$like':'%'+_0x4159cc[_0x1335('0x39')]['filter']+'%'};return _0xb6348d;}})});}_0xed98a0=_[_0x1335('0x43')]({},_0xed98a0,_0x4159cc[_0x1335('0x47')]);var _0x5e1491={'where':_0xed98a0['where']};return db['VoiceQueue'][_0x1335('0x48')](_0x5e1491)[_0x1335('0x25')](function(_0x281e37){_0x3e7cc5[_0x1335('0x48')]=_0x281e37;if(_0x4159cc[_0x1335('0x39')][_0x1335('0x49')]){_0xed98a0[_0x1335('0x4a')]=[{'all':!![]}];}return db[_0x1335('0x36')][_0x1335('0x4b')](_0xed98a0);})[_0x1335('0x25')](function(_0x5537c0){_0x3e7cc5['rows']=_0x5537c0;return _0x3e7cc5;})[_0x1335('0x25')](respondWithFilteredResult(_0x3bf6c8,_0xed98a0))[_0x1335('0x4c')](handleError(_0x3bf6c8,null));};exports[_0x1335('0x4d')]=function(_0x50c377,_0x586e8b){var _0x58cce7={'raw':![],'where':{'id':_0x50c377[_0x1335('0x4e')]['id']}},_0x4f3217={};_0x4f3217[_0x1335('0x37')]=_[_0x1335('0x38')](db[_0x1335('0x36')][_0x1335('0x4f')]);_0x4f3217[_0x1335('0x39')]=_[_0x1335('0x38')](_0x50c377['query']);_0x4f3217[_0x1335('0x42')]=_[_0x1335('0x3a')](_0x4f3217[_0x1335('0x37')],_0x4f3217[_0x1335('0x39')]);_0x58cce7[_0x1335('0x3b')]=_[_0x1335('0x3a')](_0x4f3217[_0x1335('0x37')],qs[_0x1335('0x3c')](_0x50c377[_0x1335('0x39')][_0x1335('0x3c')]));_0x58cce7[_0x1335('0x3b')]=_0x58cce7[_0x1335('0x3b')]['length']?_0x58cce7[_0x1335('0x3b')]:_0x4f3217[_0x1335('0x37')];if(_0x50c377['query'][_0x1335('0x49')]){_0x58cce7[_0x1335('0x4a')]=[{'all':!![]}];}_0x58cce7=_[_0x1335('0x43')]({},_0x58cce7,_0x50c377[_0x1335('0x47')]);return db['VoiceQueue'][_0x1335('0x2f')](_0x58cce7)[_0x1335('0x25')](handleEntityNotFound(_0x586e8b,null))[_0x1335('0x25')](respondWithResult(_0x586e8b,null))['catch'](handleError(_0x586e8b,null));};exports[_0x1335('0x50')]=function(_0x1a4b63,_0x39e663){return db['VoiceQueue'][_0x1335('0x50')](_0x1a4b63[_0x1335('0x51')],{})[_0x1335('0x25')](function(_0x570ee7){var _0x11163a=_0x1a4b63['user'][_0x1335('0x52')]({'plain':!![]});if(!_0x11163a)throw new Error(_0x1335('0x53'));if(_0x11163a[_0x1335('0x54')]===_0x1335('0x55')){var _0x218a77=_0x570ee7[_0x1335('0x52')]({'plain':!![]});var _0x1fdfe9=[{'name':_0x1335('0x26'),'value':_0x1335('0x27')},{'name':_0x1335('0x28'),'value':_0x1335('0x56')}];var _0xb4def4=_['find'](_0x1fdfe9,[_0x1335('0x2c'),_0x218a77['type']])[_0x1335('0x34')];return db[_0x1335('0x57')][_0x1335('0x2f')]({'where':{'name':_0xb4def4,'userProfileId':_0x11163a[_0x1335('0x58')]},'raw':!![]})[_0x1335('0x25')](function(_0x17341c){if(_0x17341c&&_0x17341c[_0x1335('0x59')]===0x0){return db['UserProfileResource'][_0x1335('0x50')]({'name':_0x218a77['name'],'resourceId':_0x218a77['id'],'type':_0x17341c['name'],'sectionId':_0x17341c['id']},{})[_0x1335('0x25')](function(){return _0x570ee7;});}else{return _0x570ee7;}})[_0x1335('0x4c')](function(_0x53e8ec){logger[_0x1335('0x32')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x53e8ec);throw _0x53e8ec;});}return _0x570ee7;})['then'](respondWithResult(_0x39e663,0xc9))['catch'](handleError(_0x39e663,null));};exports['clone']=function(_0x3426b0,_0x30b202){var _0x42f064={'raw':![],'where':{'id':_0x3426b0[_0x1335('0x4e')]['id']}},_0x2b7752={};_0x2b7752['model']=_[_0x1335('0x38')](db[_0x1335('0x36')][_0x1335('0x4f')]);_0x42f064['attributes']=_[_0x1335('0x3a')](_0x2b7752[_0x1335('0x37')],qs[_0x1335('0x3c')](_0x3426b0['query'][_0x1335('0x3c')]));_0x42f064[_0x1335('0x3b')]=_0x42f064[_0x1335('0x3b')][_0x1335('0x3d')]?_0x42f064['attributes']:_0x2b7752['model'];if(_0x3426b0[_0x1335('0x39')]['includeAll']){_0x42f064['include']=[{'all':!![]}];}_0x42f064=_['merge']({},_0x42f064,_0x3426b0[_0x1335('0x47')]);return db[_0x1335('0x36')][_0x1335('0x2f')](_0x42f064)[_0x1335('0x25')](handleEntityNotFound(_0x30b202,null))[_0x1335('0x25')](function(_0x2b06cd){if(_0x2b06cd){var _0x286b3c=_0x2b06cd[_0x1335('0x52')]({'plain':!![]});_0x286b3c=qs['omit'](_0x286b3c,['id',_0x1335('0x5a'),_0x1335('0x5b')]);_0x3426b0[_0x1335('0x51')]=_['omit'](_0x3426b0['body'],['id',_0x1335('0x5a'),'updatedAt']);return db[_0x1335('0x36')][_0x1335('0x50')](_[_0x1335('0x43')](_0x286b3c,_0x3426b0[_0x1335('0x51')]),{'include':_0x3426b0[_0x1335('0x39')][_0x1335('0x49')]?[{'all':!![]}]:undefined})['then'](function(_0x2bcb9d){var _0x1bed39=_0x3426b0['user']['get']({'plain':!![]});if(!_0x1bed39)throw new Error(_0x1335('0x53'));if(_0x1bed39[_0x1335('0x54')]==='user'){var _0x2f88cf=_0x2bcb9d['get']({'plain':!![]});var _0x245aed=[{'name':_0x1335('0x26'),'value':_0x1335('0x27')},{'name':'QueueCampaigns','value':_0x1335('0x56')}];var _0x414c04=_[_0x1335('0x2f')](_0x245aed,[_0x1335('0x2c'),_0x2f88cf[_0x1335('0x2e')]])[_0x1335('0x34')];return db[_0x1335('0x57')]['find']({'where':{'name':_0x414c04,'userProfileId':_0x1bed39[_0x1335('0x58')]},'raw':!![]})[_0x1335('0x25')](function(_0x29f822){if(_0x29f822&&_0x29f822[_0x1335('0x59')]===0x0){return db['UserProfileResource'][_0x1335('0x50')]({'name':_0x2f88cf[_0x1335('0x34')],'resourceId':_0x2f88cf['id'],'type':_0x29f822['name'],'sectionId':_0x29f822['id']},{})[_0x1335('0x25')](function(){return _0x2bcb9d;});}else{return _0x2bcb9d;}})[_0x1335('0x4c')](function(_0x5ebb43){logger[_0x1335('0x32')](_0x1335('0x5c'),_0x5ebb43);throw _0x5ebb43;});}return _0x2bcb9d;});}})[_0x1335('0x25')](respondWithResult(_0x30b202,0xc9))[_0x1335('0x4c')](handleError(_0x30b202,null));};exports[_0x1335('0x23')]=function(_0x368613,_0x2ec9c4){if(_0x368613['body']['id']){delete _0x368613[_0x1335('0x51')]['id'];}return db[_0x1335('0x36')][_0x1335('0x2f')]({'where':{'id':_0x368613[_0x1335('0x4e')]['id']}})[_0x1335('0x25')](handleEntityNotFound(_0x2ec9c4,null))['then'](saveUpdates(_0x368613[_0x1335('0x51')],null))[_0x1335('0x25')](respondWithResult(_0x2ec9c4,null))[_0x1335('0x4c')](handleError(_0x2ec9c4,null));};exports[_0x1335('0x24')]=function(_0x1627ca,_0x2918fc){return db['VoiceQueue']['find']({'where':{'id':_0x1627ca[_0x1335('0x4e')]['id']}})['then'](handleEntityNotFound(_0x2918fc,null))[_0x1335('0x25')](removeEntity(_0x2918fc,null))['catch'](handleError(_0x2918fc,null));};exports[_0x1335('0x5d')]=function(_0x299a0f,_0x400259,_0x220eb1){var _0x382df2={'raw':![],'where':{}};var _0x29811b={};var _0x364901={'count':0x0,'rows':[]};return db[_0x1335('0x36')]['findOne']({'where':{'id':_0x299a0f[_0x1335('0x4e')]['id']}})[_0x1335('0x25')](handleEntityNotFound(_0x400259,null))[_0x1335('0x25')](function(_0x2ecf22){if(_0x2ecf22){_0x29811b['model']=_[_0x1335('0x38')](db[_0x1335('0x5e')][_0x1335('0x4f')]);_0x29811b[_0x1335('0x39')]=_[_0x1335('0x38')](_0x299a0f[_0x1335('0x39')]);_0x29811b[_0x1335('0x42')]=_[_0x1335('0x3a')](_0x29811b['model'],_0x29811b['query']);_0x382df2[_0x1335('0x3b')]=_[_0x1335('0x3a')](_0x29811b['model'],qs[_0x1335('0x3c')](_0x299a0f[_0x1335('0x39')]['fields']));_0x382df2['attributes']=_0x382df2['attributes'][_0x1335('0x3d')]?_0x382df2[_0x1335('0x3b')]:_0x29811b['model'];if(!_0x299a0f[_0x1335('0x39')][_0x1335('0x3e')](_0x1335('0x3f'))){_0x382df2[_0x1335('0x1f')]=qs['limit'](_0x299a0f['query']['limit']);_0x382df2[_0x1335('0x1e')]=qs[_0x1335('0x1e')](_0x299a0f[_0x1335('0x39')][_0x1335('0x1e')]);}_0x382df2[_0x1335('0x5f')]=qs[_0x1335('0x40')](_0x299a0f[_0x1335('0x39')][_0x1335('0x40')]);_0x382df2[_0x1335('0x44')]=qs[_0x1335('0x42')](_[_0x1335('0x41')](_0x299a0f[_0x1335('0x39')],_0x29811b['filters']));_0x382df2['where'][_0x1335('0x60')]=_0x2ecf22['id'];if(_0x299a0f[_0x1335('0x39')][_0x1335('0x29')]){_0x382df2['where']=_[_0x1335('0x43')](_0x382df2[_0x1335('0x44')],{'$or':_[_0x1335('0x2b')](_0x382df2[_0x1335('0x3b')],function(_0x45c29a){var _0x5ca203={};_0x5ca203[_0x45c29a]={'$like':'%'+_0x299a0f[_0x1335('0x39')][_0x1335('0x29')]+'%'};return _0x5ca203;})});}_0x382df2=_[_0x1335('0x43')]({},_0x382df2,_0x299a0f['options']);return db[_0x1335('0x5e')]['count']({'where':_0x382df2['where']})[_0x1335('0x25')](function(_0x167b80){_0x364901['count']=_0x167b80;if(_0x299a0f['query']['includeAll']){_0x382df2['include']=[{'all':!![]}];}return db['CmHopper']['findAll'](_0x382df2);})[_0x1335('0x25')](function(_0x4771dd){_0x364901[_0x1335('0x61')]=_0x4771dd;return _0x364901;});}})[_0x1335('0x25')](respondWithFilteredResult(_0x400259,_0x382df2))[_0x1335('0x4c')](handleError(_0x400259,null));};exports[_0x1335('0x62')]=function(_0x4fe069,_0x17e7f2,_0x141c3c){var _0x305c95={'raw':!![],'where':{}};var _0x37724a={};var _0x570597={'count':0x0,'rows':[]};return db[_0x1335('0x36')]['findOne']({'where':{'id':_0x4fe069[_0x1335('0x4e')]['id']}})[_0x1335('0x25')](handleEntityNotFound(_0x17e7f2,null))[_0x1335('0x25')](function(_0x2c66b7){if(_0x2c66b7){_0x37724a[_0x1335('0x37')]=_[_0x1335('0x38')](db[_0x1335('0x63')][_0x1335('0x4f')]);_0x37724a[_0x1335('0x39')]=_[_0x1335('0x38')](_0x4fe069[_0x1335('0x39')]);_0x37724a[_0x1335('0x42')]=_[_0x1335('0x3a')](_0x37724a['model'],_0x37724a[_0x1335('0x39')]);_0x305c95[_0x1335('0x3b')]=_[_0x1335('0x3a')](_0x37724a['model'],qs[_0x1335('0x3c')](_0x4fe069[_0x1335('0x39')][_0x1335('0x3c')]));_0x305c95['attributes']=_0x305c95[_0x1335('0x3b')]['length']?_0x305c95[_0x1335('0x3b')]:_0x37724a[_0x1335('0x37')];if(!_0x4fe069[_0x1335('0x39')][_0x1335('0x3e')](_0x1335('0x3f'))){_0x305c95[_0x1335('0x1f')]=qs[_0x1335('0x1f')](_0x4fe069[_0x1335('0x39')]['limit']);_0x305c95['offset']=qs[_0x1335('0x1e')](_0x4fe069[_0x1335('0x39')][_0x1335('0x1e')]);}_0x305c95[_0x1335('0x5f')]=qs[_0x1335('0x40')](_0x4fe069['query'][_0x1335('0x40')]);_0x305c95[_0x1335('0x44')]=qs[_0x1335('0x42')](_['pick'](_0x4fe069[_0x1335('0x39')],_0x37724a['filters']));_0x305c95[_0x1335('0x44')][_0x1335('0x60')]=_0x2c66b7['id'];if(_0x4fe069[_0x1335('0x39')][_0x1335('0x29')]){_0x305c95[_0x1335('0x44')]=_[_0x1335('0x43')](_0x305c95[_0x1335('0x44')],{'$or':_[_0x1335('0x2b')](_0x305c95[_0x1335('0x3b')],function(_0x5345bc){var _0x3de811={};_0x3de811[_0x5345bc]={'$like':'%'+_0x4fe069[_0x1335('0x39')][_0x1335('0x29')]+'%'};return _0x3de811;})});}_0x305c95=_[_0x1335('0x43')]({},_0x305c95,_0x4fe069[_0x1335('0x47')]);return db[_0x1335('0x63')][_0x1335('0x48')]({'where':_0x305c95[_0x1335('0x44')]})[_0x1335('0x25')](function(_0x5a5f13){_0x570597['count']=_0x5a5f13;if(_0x4fe069['query'][_0x1335('0x49')]){_0x305c95['include']=[{'all':!![]}];}return db[_0x1335('0x63')]['findAll'](_0x305c95);})['then'](function(_0x2b92fd){_0x570597['rows']=_0x2b92fd;return _0x570597;});}})[_0x1335('0x25')](respondWithFilteredResult(_0x17e7f2,_0x305c95))[_0x1335('0x4c')](handleError(_0x17e7f2,null));};exports['getHopperFinals']=function(_0x2c0d6f,_0x1711a9,_0x1cb1b){var _0x29b23a={'raw':!![],'where':{}};var _0x560ab2={};var _0x368422={'count':0x0,'rows':[]};return db[_0x1335('0x36')][_0x1335('0x64')]({'where':{'id':_0x2c0d6f[_0x1335('0x4e')]['id']}})[_0x1335('0x25')](handleEntityNotFound(_0x1711a9,null))[_0x1335('0x25')](function(_0x181c09){if(_0x181c09){_0x560ab2['model']=_[_0x1335('0x38')](db[_0x1335('0x65')][_0x1335('0x4f')]);_0x560ab2[_0x1335('0x39')]=_[_0x1335('0x38')](_0x2c0d6f['query']);_0x560ab2[_0x1335('0x42')]=_[_0x1335('0x3a')](_0x560ab2[_0x1335('0x37')],_0x560ab2[_0x1335('0x39')]);_0x29b23a['attributes']=_[_0x1335('0x3a')](_0x560ab2['model'],qs['fields'](_0x2c0d6f[_0x1335('0x39')]['fields']));_0x29b23a[_0x1335('0x3b')]=_0x29b23a['attributes'][_0x1335('0x3d')]?_0x29b23a[_0x1335('0x3b')]:_0x560ab2['model'];if(!_0x2c0d6f[_0x1335('0x39')][_0x1335('0x3e')](_0x1335('0x3f'))){_0x29b23a[_0x1335('0x1f')]=qs[_0x1335('0x1f')](_0x2c0d6f[_0x1335('0x39')][_0x1335('0x1f')]);_0x29b23a['offset']=qs[_0x1335('0x1e')](_0x2c0d6f[_0x1335('0x39')][_0x1335('0x1e')]);}_0x29b23a['order']=qs['sort'](_0x2c0d6f['query']['sort']);_0x29b23a[_0x1335('0x44')]=qs[_0x1335('0x42')](_[_0x1335('0x41')](_0x2c0d6f[_0x1335('0x39')],_0x560ab2[_0x1335('0x42')]));_0x29b23a['where'][_0x1335('0x60')]=_0x181c09['id'];if(_0x2c0d6f[_0x1335('0x39')][_0x1335('0x29')]){_0x29b23a[_0x1335('0x44')]=_[_0x1335('0x43')](_0x29b23a[_0x1335('0x44')],{'$or':_['map'](_0x29b23a[_0x1335('0x3b')],function(_0x29dfa1){var _0x72a6db={};_0x72a6db[_0x29dfa1]={'$like':'%'+_0x2c0d6f['query']['filter']+'%'};return _0x72a6db;})});}_0x29b23a=_['merge']({},_0x29b23a,_0x2c0d6f[_0x1335('0x47')]);return db[_0x1335('0x65')][_0x1335('0x48')]({'where':_0x29b23a['where']})[_0x1335('0x25')](function(_0x1c5dac){_0x368422['count']=_0x1c5dac;if(_0x2c0d6f[_0x1335('0x39')][_0x1335('0x49')]){_0x29b23a[_0x1335('0x4a')]=[{'all':!![]}];}return db[_0x1335('0x65')][_0x1335('0x4b')](_0x29b23a);})[_0x1335('0x25')](function(_0x122a59){_0x368422[_0x1335('0x61')]=_0x122a59;return _0x368422;});}})[_0x1335('0x25')](respondWithFilteredResult(_0x1711a9,_0x29b23a))[_0x1335('0x4c')](handleError(_0x1711a9,null));};exports['getHopperBlacks']=function(_0x404c72,_0x5b946c,_0x537d0f){var _0x4baf65={'raw':!![],'where':{}};var _0x3219ad={};var _0x3d831a={'count':0x0,'rows':[]};return db['VoiceQueue'][_0x1335('0x64')]({'where':{'id':_0x404c72[_0x1335('0x4e')]['id']}})[_0x1335('0x25')](handleEntityNotFound(_0x5b946c,null))[_0x1335('0x25')](function(_0x3a91d8){if(_0x3a91d8){_0x3219ad[_0x1335('0x37')]=_['keys'](db[_0x1335('0x66')][_0x1335('0x4f')]);_0x3219ad[_0x1335('0x39')]=_['keys'](_0x404c72[_0x1335('0x39')]);_0x3219ad[_0x1335('0x42')]=_[_0x1335('0x3a')](_0x3219ad[_0x1335('0x37')],_0x3219ad['query']);_0x4baf65[_0x1335('0x3b')]=_['intersection'](_0x3219ad[_0x1335('0x37')],qs[_0x1335('0x3c')](_0x404c72['query']['fields']));_0x4baf65[_0x1335('0x3b')]=_0x4baf65[_0x1335('0x3b')][_0x1335('0x3d')]?_0x4baf65['attributes']:_0x3219ad[_0x1335('0x37')];if(!_0x404c72[_0x1335('0x39')]['hasOwnProperty'](_0x1335('0x3f'))){_0x4baf65[_0x1335('0x1f')]=qs[_0x1335('0x1f')](_0x404c72[_0x1335('0x39')][_0x1335('0x1f')]);_0x4baf65[_0x1335('0x1e')]=qs[_0x1335('0x1e')](_0x404c72[_0x1335('0x39')]['offset']);}_0x4baf65[_0x1335('0x5f')]=qs[_0x1335('0x40')](_0x404c72[_0x1335('0x39')][_0x1335('0x40')]);_0x4baf65['where']=qs['filters'](_[_0x1335('0x41')](_0x404c72[_0x1335('0x39')],_0x3219ad['filters']));_0x4baf65['where'][_0x1335('0x60')]=_0x3a91d8['id'];if(_0x404c72[_0x1335('0x39')][_0x1335('0x29')]){_0x4baf65['where']=_[_0x1335('0x43')](_0x4baf65['where'],{'$or':_[_0x1335('0x2b')](_0x4baf65[_0x1335('0x3b')],function(_0x9fa3b){var _0x2da727={};_0x2da727[_0x9fa3b]={'$like':'%'+_0x404c72[_0x1335('0x39')][_0x1335('0x29')]+'%'};return _0x2da727;})});}_0x4baf65=_[_0x1335('0x43')]({},_0x4baf65,_0x404c72[_0x1335('0x47')]);return db['CmHopperBlack']['count']({'where':_0x4baf65[_0x1335('0x44')]})[_0x1335('0x25')](function(_0x2ff3f9){_0x3d831a[_0x1335('0x48')]=_0x2ff3f9;if(_0x404c72[_0x1335('0x39')][_0x1335('0x49')]){_0x4baf65[_0x1335('0x4a')]=[{'all':!![]}];}return db[_0x1335('0x66')][_0x1335('0x4b')](_0x4baf65);})[_0x1335('0x25')](function(_0x3b79f4){_0x3d831a[_0x1335('0x61')]=_0x3b79f4;return _0x3d831a;});}})[_0x1335('0x25')](respondWithFilteredResult(_0x5b946c,_0x4baf65))[_0x1335('0x4c')](handleError(_0x5b946c,null));};exports[_0x1335('0x67')]=function(_0xcea2e8,_0x711374,_0x3f2061){var _0x5cef72={};var _0x4888e7={};var _0x499237;var _0x38141b;return db[_0x1335('0x36')][_0x1335('0x64')]({'where':{'id':_0xcea2e8[_0x1335('0x4e')]['id']}})[_0x1335('0x25')](handleEntityNotFound(_0x711374,null))[_0x1335('0x25')](function(_0x2ee290){if(_0x2ee290){_0x499237=_0x2ee290;_0x4888e7[_0x1335('0x37')]=_[_0x1335('0x38')](db[_0x1335('0x68')][_0x1335('0x4f')]);_0x4888e7[_0x1335('0x39')]=_[_0x1335('0x38')](_0xcea2e8[_0x1335('0x39')]);_0x4888e7[_0x1335('0x42')]=_[_0x1335('0x3a')](_0x4888e7[_0x1335('0x37')],_0x4888e7[_0x1335('0x39')]);_0x5cef72[_0x1335('0x3b')]=_[_0x1335('0x3a')](_0x4888e7[_0x1335('0x37')],qs[_0x1335('0x3c')](_0xcea2e8[_0x1335('0x39')][_0x1335('0x3c')]));_0x5cef72[_0x1335('0x3b')]=_0x5cef72[_0x1335('0x3b')]['length']?_0x5cef72[_0x1335('0x3b')]:_0x4888e7[_0x1335('0x37')];_0x5cef72['order']=qs[_0x1335('0x40')](_0xcea2e8[_0x1335('0x39')][_0x1335('0x40')]);_0x5cef72[_0x1335('0x44')]=qs[_0x1335('0x42')](_['pick'](_0xcea2e8['query'],_0x4888e7['filters']));if(_0xcea2e8['query'][_0x1335('0x29')]){_0x5cef72['where']=_[_0x1335('0x43')](_0x5cef72[_0x1335('0x44')],{'$or':_['map'](_0x5cef72[_0x1335('0x3b')],function(_0x1af99b){var _0xf620e2={};_0xf620e2[_0x1af99b]={'$like':'%'+_0xcea2e8[_0x1335('0x39')]['filter']+'%'};return _0xf620e2;})});}_0x5cef72=_[_0x1335('0x43')]({},_0x5cef72,_0xcea2e8['options']);return _0x499237[_0x1335('0x67')](_0x5cef72);}})[_0x1335('0x25')](function(_0x527f0d){if(_0x527f0d){_0x38141b=_0x527f0d[_0x1335('0x3d')];if(!_0xcea2e8['query'][_0x1335('0x3e')](_0x1335('0x3f'))){_0x5cef72[_0x1335('0x1f')]=qs[_0x1335('0x1f')](_0xcea2e8[_0x1335('0x39')][_0x1335('0x1f')]);_0x5cef72[_0x1335('0x1e')]=qs[_0x1335('0x1e')](_0xcea2e8[_0x1335('0x39')][_0x1335('0x1e')]);}return _0x499237[_0x1335('0x67')](_0x5cef72);}})[_0x1335('0x25')](function(_0x4a6489){if(_0x4a6489){return _0x4a6489?{'count':_0x38141b,'rows':_0x4a6489}:null;}})[_0x1335('0x25')](respondWithResult(_0x711374,null))[_0x1335('0x4c')](handleError(_0x711374,null));};exports[_0x1335('0x69')]=function(_0x48e600,_0x15ea9b,_0x1ba40d){var _0x353f25=_0x48e600['body'][_0x1335('0x6a')];var _0x527225=_['map'](_0x353f25,'id');return db[_0x1335('0x68')][_0x1335('0x4b')]({'where':{'id':_0x527225},'attributes':['id'],'include':[{'model':db[_0x1335('0x6b')],'as':_0x1335('0x6c'),'attributes':['id',_0x1335('0x34'),_0x1335('0x6d'),'voicePause',_0x1335('0x6e')],'raw':!![]}]})['then'](function(_0x3915f1){if(_0x3915f1){var _0x3bb3c9=_[_0x1335('0x6f')](_0x3915f1,function(_0x364ea3){var _0x5afc24=_0x364ea3[_0x1335('0x52')]({'plain':!![]});_0x5afc24[_0x1335('0x6c')][_0x1335('0x70')](function(_0x20e04d){_0x20e04d[_0x1335('0x71')]=_[_0x1335('0x2f')](_0x353f25,{'id':_0x5afc24['id']})[_0x1335('0x71')];});return _0x5afc24[_0x1335('0x6c')];});return db[_0x1335('0x36')][_0x1335('0x2f')]({'where':{'id':_0x48e600['params']['id']}})['then'](function(_0x5b5d7e){return db[_0x1335('0x72')]['transaction'](function(_0x178346){return _0x5b5d7e['addTeams'](_0x527225,{'transaction':_0x178346})[_0x1335('0x25')](function(){return BPromise[_0x1335('0x73')](_0x3bb3c9,function(_0x31e70d){return db[_0x1335('0x74')][_0x1335('0x75')]({'where':{'UserId':_0x31e70d['id'],'VoiceQueueId':_0x48e600[_0x1335('0x4e')]['id']},'defaults':{'penalty':_0x31e70d[_0x1335('0x71')]},'transaction':_0x178346});});})[_0x1335('0x25')](function(){return BPromise[_0x1335('0x73')](_[_0x1335('0x29')](_0x3bb3c9,{'online':!![]}),function(_0x981687){return db[_0x1335('0x76')][_0x1335('0x77')]({'membername':_0x981687[_0x1335('0x34')],'UserId':_0x981687['id'],'queue_name':_0x5b5d7e[_0x1335('0x34')],'VoiceQueueId':_0x5b5d7e['id'],'interface':_[_0x1335('0x78')](_0x981687['interface'])?util['format'](_0x1335('0x79'),_0x981687[_0x1335('0x34')]):_0x981687['interface'],'paused':_0x981687['voicePause']||![],'penalty':_0x981687['penalty']},{'transaction':_0x178346});});})[_0x1335('0x25')](function(){_0x3bb3c9['forEach'](function(_0x745249){socket[_0x1335('0x7a')](_0x1335('0x7b'),{'UserId':_0x745249['id'],'VoiceQueueId':_0x5b5d7e['id']});});});});});}})[_0x1335('0x25')](respondWithStatusCode(_0x15ea9b,null))[_0x1335('0x4c')](handleError(_0x15ea9b,null));};exports[_0x1335('0x7c')]=function(_0x34cf15,_0x2161d4,_0x425a2b){return db[_0x1335('0x68')][_0x1335('0x4b')]({'where':{'id':_0x34cf15[_0x1335('0x39')][_0x1335('0x7d')]},'attributes':['id'],'include':[{'model':db[_0x1335('0x6b')],'as':_0x1335('0x6c'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x2161d4,null))['then'](function(_0x15b155){var _0x596663=_[_0x1335('0x2b')](_0x15b155,'id');var _0x492e6e=[];var _0x4a6f4e=[];var _0x594728=squel['select']();_0x594728['field']('tq.TeamId')[_0x1335('0x7e')](_0x1335('0x7f'),'tq')[_0x1335('0x80')](_0x1335('0x81'),'ut',_0x1335('0x82'))[_0x1335('0x44')]('VoiceQueueId\x20=\x20?',_0x34cf15[_0x1335('0x4e')]['id']);for(var _0x4ba12a=0x0;_0x4ba12a<_0x15b155['length'];_0x4ba12a+=0x1){let _0xb27386=_0x15b155[_0x4ba12a];for(var _0x193ce6=0x0;_0x193ce6<_0xb27386['Agents'][_0x1335('0x3d')];_0x193ce6+=0x1){let _0x4f1354=_0xb27386[_0x1335('0x6c')][_0x193ce6];var _0x2ca4a2=_0x594728[_0x1335('0x83')]();_0x2ca4a2[_0x1335('0x44')](_0x1335('0x84'),_0x4f1354['id']);_0x4a6f4e[_0x1335('0x85')](db[_0x1335('0x72')][_0x1335('0x39')](_0x2ca4a2[_0x1335('0x86')](),{'type':db[_0x1335('0x72')][_0x1335('0x87')][_0x1335('0x88')]})[_0x1335('0x25')](function(_0x202cd6){if(_0x202cd6[_0x1335('0x3d')]===0x1){return _0x4f1354['id'];}else{var _0x4b4f6f=_[_0x1335('0x89')](_[_0x1335('0x2b')](_0x202cd6,'TeamId'),function(_0x1905fe){return _[_0x1335('0x2d')](_0x596663,_0x1905fe);});if(_0x4b4f6f){return _0x4f1354['id'];}}}));}}return BPromise[_0x1335('0x8a')](_0x4a6f4e)['then'](function(_0x1cdf94){_0x492e6e=_(_0x492e6e)[_0x1335('0x8b')](_0x1cdf94)[_0x1335('0x8c')]()[_0x1335('0x2c')]();return db[_0x1335('0x36')][_0x1335('0x2f')]({'where':{'id':_0x34cf15['params']['id']}})[_0x1335('0x25')](function(_0x15833d){return db[_0x1335('0x72')]['transaction'](function(_0x26e161){return _0x15833d['removeTeams'](_0x34cf15[_0x1335('0x39')][_0x1335('0x7d')],{'transaction':_0x26e161})['then'](function(){if(!_[_0x1335('0x8d')](_0x492e6e)){return _0x15833d['removeAgents'](_0x492e6e,{'transaction':_0x26e161})[_0x1335('0x25')](function(){return db['UserVoiceQueueRt']['destroy']({'where':{'VoiceQueueId':_0x34cf15[_0x1335('0x4e')]['id'],'UserId':_0x492e6e},'transaction':_0x26e161});});}})[_0x1335('0x25')](function(){_0x492e6e[_0x1335('0x70')](function(_0x1c5e39){socket[_0x1335('0x7a')](_0x1335('0x8e'),{'UserId':_0x1c5e39,'VoiceQueueId':_0x15833d['id']});});});});});});})[_0x1335('0x25')](respondWithStatusCode(_0x2161d4,null))[_0x1335('0x4c')](handleError(_0x2161d4,null));};exports['addAgents']=function(_0x38d2e1,_0x507850,_0x7e95da){var _0x113bb1,_0x4d1f89;return db[_0x1335('0x36')][_0x1335('0x2f')]({'where':{'id':_0x38d2e1[_0x1335('0x4e')]['id']}})[_0x1335('0x25')](handleEntityNotFound(_0x507850,null))[_0x1335('0x25')](function(_0x53a678){if(_0x53a678){_0x4d1f89=_0x53a678;return _0x53a678[_0x1335('0x8f')](_0x38d2e1['body'][_0x1335('0x7d')],_[_0x1335('0x90')](_0x38d2e1[_0x1335('0x51')],[_0x1335('0x7d'),'id'])||{})[_0x1335('0x91')](function(_0x25c814){for(var _0x217595=0x0;_0x217595<_0x38d2e1[_0x1335('0x51')][_0x1335('0x7d')][_0x1335('0x3d')];_0x217595+=0x1){socket['emit'](_0x1335('0x7b'),{'UserId':_0x38d2e1[_0x1335('0x51')]['ids'][_0x217595],'VoiceQueueId':_0x38d2e1['params']['id']});}return _0x25c814;});}})['then'](function(_0x460c9e){_0x113bb1=_0x460c9e||[];if(_0x4d1f89){return db[_0x1335('0x6b')][_0x1335('0x4b')]({'where':{'id':_0x38d2e1['body'][_0x1335('0x7d')]},'attributes':['id',_0x1335('0x34'),_0x1335('0x6d'),_0x1335('0x92'),_0x1335('0x6e')],'raw':!![]});}})[_0x1335('0x25')](function(_0x4ec71c){if(!_['isEmpty'](_0x4ec71c)){var _0x479578=[];for(var _0x29d727=0x0;_0x29d727<_0x4ec71c[_0x1335('0x3d')];_0x29d727++){if(_0x4ec71c[_0x29d727]['online']){_0x479578[_0x1335('0x85')](db[_0x1335('0x76')][_0x1335('0x77')]({'membername':_0x4ec71c[_0x29d727]['name'],'UserId':_0x4ec71c[_0x29d727]['id'],'queue_name':_0x4d1f89['name'],'VoiceQueueId':_0x4d1f89['id'],'interface':_[_0x1335('0x78')](_0x4ec71c[_0x29d727][_0x1335('0x6e')])?util['format']('SIP/%s',_0x4ec71c[_0x29d727][_0x1335('0x34')]):_0x4ec71c[_0x29d727][_0x1335('0x6e')],'paused':_0x4ec71c[_0x29d727]['voicePause']||![],'penalty':_0x38d2e1['body'][_0x1335('0x71')]||0x0}));}}return BPromise[_0x1335('0x8a')](_0x479578);}})['then'](function(){return _0x113bb1;})[_0x1335('0x25')](respondWithResult(_0x507850,null))['catch'](handleError(_0x507850,null));};exports[_0x1335('0x93')]=function(_0x5a31e8,_0x526d69,_0x17c1eb){return db['VoiceQueue']['find']({'where':{'id':_0x5a31e8[_0x1335('0x4e')]['id']}})[_0x1335('0x25')](handleEntityNotFound(_0x526d69,null))[_0x1335('0x25')](function(_0x20fea0){if(_0x20fea0){return _0x20fea0[_0x1335('0x93')](_0x5a31e8['query'][_0x1335('0x7d')])[_0x1335('0x25')](function(){if(_[_0x1335('0x94')](_0x5a31e8['query']['ids'])){for(var _0x1339cf=0x0;_0x1339cf<_0x5a31e8[_0x1335('0x39')]['ids'][_0x1335('0x3d')];_0x1339cf+=0x1){socket[_0x1335('0x7a')](_0x1335('0x8e'),{'UserId':Number(_0x5a31e8['query']['ids'][_0x1339cf]),'VoiceQueueId':Number(_0x5a31e8[_0x1335('0x4e')]['id'])});}}else{socket['emit'](_0x1335('0x8e'),{'UserId':Number(_0x5a31e8[_0x1335('0x39')]['ids']),'VoiceQueueId':Number(_0x5a31e8[_0x1335('0x4e')]['id'])});}});}})[_0x1335('0x25')](function(_0x4bf98a){return db['UserVoiceQueueRt'][_0x1335('0x24')]({'where':{'VoiceQueueId':_0x5a31e8[_0x1335('0x4e')]['id'],'UserId':_0x5a31e8[_0x1335('0x39')][_0x1335('0x7d')]}})[_0x1335('0x25')](function(){return _0x4bf98a;});})[_0x1335('0x25')](respondWithStatusCode(_0x526d69,null))[_0x1335('0x4c')](handleError(_0x526d69,null));};exports[_0x1335('0x95')]=function(_0x4b2011,_0x153d47,_0x4cbd51){var _0x3300c6={};var _0x4c5fd5={};var _0x7db229;var _0x471ea3;return db[_0x1335('0x36')]['findOne']({'where':{'id':_0x4b2011['params']['id']}})[_0x1335('0x25')](handleEntityNotFound(_0x153d47,null))['then'](function(_0x4db131){if(_0x4db131){_0x7db229=_0x4db131;_0x4c5fd5[_0x1335('0x37')]=_['keys'](db['User'][_0x1335('0x4f')]);_0x4c5fd5['query']=_[_0x1335('0x38')](_0x4b2011['query']);_0x4c5fd5[_0x1335('0x42')]=_[_0x1335('0x3a')](_0x4c5fd5[_0x1335('0x37')],_0x4c5fd5[_0x1335('0x39')]);_0x3300c6[_0x1335('0x3b')]=_[_0x1335('0x3a')](_0x4c5fd5[_0x1335('0x37')],qs[_0x1335('0x3c')](_0x4b2011['query'][_0x1335('0x3c')]));_0x3300c6[_0x1335('0x3b')]=_0x3300c6[_0x1335('0x3b')][_0x1335('0x3d')]?_0x3300c6[_0x1335('0x3b')]:_0x4c5fd5[_0x1335('0x37')];_0x3300c6[_0x1335('0x5f')]=qs[_0x1335('0x40')](_0x4b2011[_0x1335('0x39')][_0x1335('0x40')]);_0x3300c6[_0x1335('0x44')]=qs['filters'](_[_0x1335('0x41')](_0x4b2011[_0x1335('0x39')],_0x4c5fd5[_0x1335('0x42')]));if(_0x4b2011[_0x1335('0x39')][_0x1335('0x29')]){_0x3300c6[_0x1335('0x44')]=_[_0x1335('0x43')](_0x3300c6[_0x1335('0x44')],{'$or':_[_0x1335('0x2b')](_0x3300c6[_0x1335('0x3b')],function(_0x2cacad){var _0x3c79d8={};_0x3c79d8[_0x2cacad]={'$like':'%'+_0x4b2011[_0x1335('0x39')][_0x1335('0x29')]+'%'};return _0x3c79d8;})});}_0x3300c6=_['merge']({},_0x3300c6,_0x4b2011['options']);return _0x7db229['getAgents'](_0x3300c6);}})[_0x1335('0x25')](function(_0xea0e6f){if(_0xea0e6f){_0x471ea3=_0xea0e6f['length'];if(!_0x4b2011[_0x1335('0x39')][_0x1335('0x3e')](_0x1335('0x3f'))){_0x3300c6['limit']=qs[_0x1335('0x1f')](_0x4b2011[_0x1335('0x39')][_0x1335('0x1f')]);_0x3300c6['offset']=qs[_0x1335('0x1e')](_0x4b2011[_0x1335('0x39')]['offset']);}return _0x7db229['getAgents'](_0x3300c6);}})[_0x1335('0x25')](function(_0x38c731){if(_0x38c731){return _0x38c731?{'count':_0x471ea3,'rows':_0x38c731}:null;}})[_0x1335('0x25')](respondWithResult(_0x153d47,null))['catch'](handleError(_0x153d47,null));};exports[_0x1335('0x96')]=function(_0x3aa44e,_0xdaf0e2,_0x4e0c87){var _0x363315={};var _0x22bff0={};var _0x230d2d;var _0x11526f;return db[_0x1335('0x36')][_0x1335('0x64')]({'where':{'id':_0x3aa44e[_0x1335('0x4e')]['id']}})[_0x1335('0x25')](handleEntityNotFound(_0xdaf0e2,null))[_0x1335('0x25')](function(_0x5c91cf){if(_0x5c91cf){_0x230d2d=_0x5c91cf;_0x22bff0[_0x1335('0x37')]=_[_0x1335('0x38')](db[_0x1335('0x76')][_0x1335('0x4f')]);_0x22bff0['query']=_[_0x1335('0x38')](_0x3aa44e['query']);_0x22bff0[_0x1335('0x42')]=_[_0x1335('0x3a')](_0x22bff0[_0x1335('0x37')],_0x22bff0['query']);_0x363315['attributes']=_[_0x1335('0x3a')](_0x22bff0['model'],qs[_0x1335('0x3c')](_0x3aa44e[_0x1335('0x39')][_0x1335('0x3c')]));_0x363315[_0x1335('0x3b')]=_0x363315[_0x1335('0x3b')][_0x1335('0x3d')]?_0x363315[_0x1335('0x3b')]:_0x22bff0['model'];_0x363315[_0x1335('0x5f')]=qs[_0x1335('0x40')](_0x3aa44e[_0x1335('0x39')][_0x1335('0x40')]);_0x363315[_0x1335('0x44')]=qs[_0x1335('0x42')](_[_0x1335('0x41')](_0x3aa44e['query'],_0x22bff0[_0x1335('0x42')]));if(_0x3aa44e[_0x1335('0x39')][_0x1335('0x29')]){_0x363315['where']=_[_0x1335('0x43')](_0x363315[_0x1335('0x44')],{'$or':_['map'](_0x363315[_0x1335('0x3b')],function(_0xb07f29){var _0x3bee62={};_0x3bee62[_0xb07f29]={'$like':'%'+_0x3aa44e[_0x1335('0x39')][_0x1335('0x29')]+'%'};return _0x3bee62;})});}_0x363315=_[_0x1335('0x43')]({},_0x363315,_0x3aa44e[_0x1335('0x47')]);return _0x230d2d[_0x1335('0x96')](_0x363315);}})[_0x1335('0x25')](function(_0x51be4d){if(_0x51be4d){_0x11526f=_0x51be4d[_0x1335('0x3d')];if(!_0x3aa44e[_0x1335('0x39')][_0x1335('0x3e')](_0x1335('0x3f'))){_0x363315[_0x1335('0x1f')]=qs[_0x1335('0x1f')](_0x3aa44e[_0x1335('0x39')]['limit']);_0x363315['offset']=qs['offset'](_0x3aa44e['query'][_0x1335('0x1e')]);}return _0x230d2d[_0x1335('0x96')](_0x363315);}})[_0x1335('0x25')](function(_0x3187e2){return _0x3187e2?{'count':_0x11526f,'rows':_0x3187e2}:null;})[_0x1335('0x25')](respondWithResult(_0xdaf0e2,null))[_0x1335('0x4c')](handleError(_0xdaf0e2,null));};exports[_0x1335('0x97')]=function(_0x56cbed,_0x463ed9,_0x3a7aa3){var _0xb3b384={};var _0x5f29bf={};var _0x252ff6;var _0x31464c;return db['VoiceQueue'][_0x1335('0x64')]({'where':{'id':_0x56cbed['params']['id']}})[_0x1335('0x25')](handleEntityNotFound(_0x463ed9,null))[_0x1335('0x25')](function(_0x57526f){if(_0x57526f){_0x252ff6=_0x57526f;_0x5f29bf[_0x1335('0x37')]=_[_0x1335('0x38')](db['CmList'][_0x1335('0x4f')]);_0x5f29bf[_0x1335('0x39')]=_['keys'](_0x56cbed[_0x1335('0x39')]);_0x5f29bf['filters']=_['intersection'](_0x5f29bf[_0x1335('0x37')],_0x5f29bf[_0x1335('0x39')]);_0xb3b384[_0x1335('0x3b')]=_[_0x1335('0x3a')](_0x5f29bf[_0x1335('0x37')],qs['fields'](_0x56cbed[_0x1335('0x39')]['fields']));_0xb3b384[_0x1335('0x3b')]=_0xb3b384[_0x1335('0x3b')][_0x1335('0x3d')]?_0xb3b384['attributes']:_0x5f29bf[_0x1335('0x37')];_0xb3b384[_0x1335('0x5f')]=qs['sort'](_0x56cbed[_0x1335('0x39')][_0x1335('0x40')]);_0xb3b384[_0x1335('0x44')]=qs['filters'](_[_0x1335('0x41')](_0x56cbed[_0x1335('0x39')],_0x5f29bf[_0x1335('0x42')]));if(_0x56cbed['query'][_0x1335('0x29')]){_0xb3b384[_0x1335('0x44')]=_['merge'](_0xb3b384['where'],{'$or':_[_0x1335('0x2b')](_0xb3b384[_0x1335('0x3b')],function(_0x2eb03c){var _0x403351={};_0x403351[_0x2eb03c]={'$like':'%'+_0x56cbed[_0x1335('0x39')][_0x1335('0x29')]+'%'};return _0x403351;})});}_0xb3b384=_[_0x1335('0x43')]({},_0xb3b384,_0x56cbed[_0x1335('0x47')]);return _0x252ff6[_0x1335('0x97')](_0xb3b384);}})[_0x1335('0x25')](function(_0x32819d){if(_0x32819d){_0x31464c=_0x32819d[_0x1335('0x3d')];if(!_0x56cbed['query'][_0x1335('0x3e')](_0x1335('0x3f'))){_0xb3b384[_0x1335('0x1f')]=qs[_0x1335('0x1f')](_0x56cbed['query']['limit']);_0xb3b384[_0x1335('0x1e')]=qs[_0x1335('0x1e')](_0x56cbed[_0x1335('0x39')][_0x1335('0x1e')]);}return _0x252ff6[_0x1335('0x97')](_0xb3b384);}})[_0x1335('0x25')](function(_0x43e116){if(_0x43e116){return _0x43e116?{'count':_0x31464c,'rows':_0x43e116}:null;}})['then'](respondWithResult(_0x463ed9,null))['catch'](handleError(_0x463ed9,null));};exports[_0x1335('0x98')]=function(_0x32ccfe,_0x1473f5,_0x9806d9){var _0x22dd0d,_0x3e86df;return db[_0x1335('0x36')][_0x1335('0x2f')]({'where':{'id':_0x32ccfe[_0x1335('0x4e')]['id']}})[_0x1335('0x25')](handleEntityNotFound(_0x1473f5,null))['then'](function(_0x59b19d){if(_0x59b19d){_0x3e86df=_0x59b19d;return _0x59b19d[_0x1335('0x98')](_0x32ccfe[_0x1335('0x51')][_0x1335('0x7d')],_[_0x1335('0x90')](_0x32ccfe['body'],[_0x1335('0x7d'),'id'])||{});}return null;})[_0x1335('0x91')](function(_0x4dd600){var _0x2f6cbd;_0x22dd0d=_0x4dd600||[];var _0x2f3228=[];if(_0x4dd600){for(var _0x1adf45=0x0;_0x1adf45<_0x4dd600['length'];_0x1adf45+=0x1){var _0x1e0f67=_0x4dd600[_0x1adf45][_0x1335('0x52')]({'plain':!![]});_0x3e86df[_0x1335('0x99')]=_0x32ccfe[_0x1335('0x51')]['dialCheckDuplicateType']?_0x32ccfe['body']['dialCheckDuplicateType']:_0x3e86df[_0x1335('0x99')];switch(_0x3e86df['dialCheckDuplicateType']){case'always':_0x2f6cbd=squel[_0x1335('0x9a')]()[_0x1335('0x9b')](_0x1335('0x9c'))[_0x1335('0x9d')]([_0x1335('0x9e'),_0x1335('0x9f'),_0x1335('0xa0'),'ListId',_0x1335('0x60'),_0x1335('0x5a'),_0x1335('0x5b')],squel[_0x1335('0xa1')]()['field'](_0x1335('0x9e'),'phone')[_0x1335('0x46')](_0x1335('0xa2'),_0x1335('0x9f'))[_0x1335('0x46')]('id','ContactId')[_0x1335('0x46')](_0x1e0f67[_0x1335('0xa3')][_0x1335('0x86')](),'ListId')[_0x1335('0x46')](_0x32ccfe[_0x1335('0x4e')]['id'][_0x1335('0x86')](),'VoiceQueueId')[_0x1335('0x46')](_0x1335('0xa2'),_0x1335('0x5a'))['field']('NOW()','updatedAt')[_0x1335('0x7e')](_0x1335('0xa4'))['where'](_0x1335('0xa5'))[_0x1335('0x44')](_0x1335('0xa6'),_0x1e0f67[_0x1335('0xa3')][_0x1335('0x86')]())[_0x1335('0x44')]('phone\x20IS\x20NOT\x20NULL')['where'](_0x1335('0xa7'),squel[_0x1335('0xa1')]()[_0x1335('0x46')]('COALESCE(calleridnum,\x27\x27)')[_0x1335('0x7e')](_0x1335('0xa8'))[_0x1335('0x44')](_0x1335('0xa9'),_0x32ccfe[_0x1335('0x4e')]['id'][_0x1335('0x86')]()))['where'](_0x1335('0xa7'),squel[_0x1335('0xa1')]()[_0x1335('0x46')]('COALESCE(phone,\x27\x27)')[_0x1335('0x7e')]('cm_hopper')['where']('VoiceQueueId\x20=\x20?',_0x32ccfe['params']['id'][_0x1335('0x86')]())))['toString']();break;case _0x1335('0xaa'):_0x2f6cbd=squel[_0x1335('0x9a')]()[_0x1335('0x9b')](_0x1335('0x9c'))[_0x1335('0x9d')]([_0x1335('0x9e'),_0x1335('0x9f'),'ContactId',_0x1335('0xab'),'VoiceQueueId',_0x1335('0x5a'),_0x1335('0x5b')],squel[_0x1335('0xa1')]()[_0x1335('0x46')](_0x1335('0x9e'),_0x1335('0x9e'))[_0x1335('0x46')](_0x1335('0xa2'),_0x1335('0x9f'))[_0x1335('0x46')]('id',_0x1335('0xa0'))[_0x1335('0x46')](_0x1e0f67[_0x1335('0xa3')][_0x1335('0x86')](),_0x1335('0xab'))[_0x1335('0x46')](_0x32ccfe['params']['id'][_0x1335('0x86')](),_0x1335('0x60'))['field']('NOW()',_0x1335('0x5a'))[_0x1335('0x46')](_0x1335('0xa2'),_0x1335('0x5b'))[_0x1335('0x7e')](_0x1335('0xa4'))[_0x1335('0x44')]('deletedAt\x20IS\x20NULL')[_0x1335('0x44')](_0x1335('0xa6'),_0x1e0f67['CmListId'][_0x1335('0x86')]())['where'](_0x1335('0xac'))[_0x1335('0x44')](_0x1335('0xa7'),squel['select']()[_0x1335('0x46')](_0x1335('0xad'))[_0x1335('0x7e')](_0x1335('0x9c'))['where'](_0x1335('0xa9'),_0x32ccfe[_0x1335('0x4e')]['id']['toString']())))[_0x1335('0x86')]();break;default:_0x2f6cbd=squel[_0x1335('0x9a')]()[_0x1335('0x9b')](_0x1335('0x9c'))[_0x1335('0x9d')]([_0x1335('0x9e'),_0x1335('0x9f'),_0x1335('0xa0'),_0x1335('0xab'),'VoiceQueueId',_0x1335('0x5a'),_0x1335('0x5b')],squel['select']()[_0x1335('0x46')](_0x1335('0x9e'),_0x1335('0x9e'))[_0x1335('0x46')](_0x1335('0xa2'),_0x1335('0x9f'))[_0x1335('0x46')]('id','ContactId')[_0x1335('0x46')](_0x1e0f67[_0x1335('0xa3')][_0x1335('0x86')](),_0x1335('0xab'))[_0x1335('0x46')](_0x32ccfe[_0x1335('0x4e')]['id'][_0x1335('0x86')](),_0x1335('0x60'))[_0x1335('0x46')](_0x1335('0xa2'),'createdAt')[_0x1335('0x46')](_0x1335('0xa2'),'updatedAt')[_0x1335('0x7e')]('cm_contacts')['where'](_0x1335('0xa5'))[_0x1335('0x44')]('ListId\x20=\x20?',_0x1e0f67['CmListId'][_0x1335('0x86')]())[_0x1335('0x44')]('phone\x20IS\x20NOT\x20NULL'))[_0x1335('0x86')]();}_0x2f3228[_0x1335('0x85')](db[_0x1335('0x72')][_0x1335('0x39')](_0x2f6cbd));}return BPromise[_0x1335('0x8a')](_0x2f3228);}})[_0x1335('0x25')](function(){return _0x22dd0d;})[_0x1335('0x25')](respondWithResult(_0x1473f5,null))['catch'](handleError(_0x1473f5,null));};exports[_0x1335('0xae')]=function(_0xf4bea5,_0x47aa98,_0x1c65f1){return db[_0x1335('0x36')]['find']({'where':{'id':_0xf4bea5[_0x1335('0x4e')]['id']}})[_0x1335('0x25')](handleEntityNotFound(_0x47aa98,null))[_0x1335('0x25')](function(_0x2d5860){if(_0x2d5860){return _0x2d5860[_0x1335('0xae')](_0xf4bea5[_0x1335('0x39')][_0x1335('0x7d')]);}})[_0x1335('0x25')](function(_0x574193){if(_0x574193){return db['CmHopper'][_0x1335('0x24')]({'where':{'ListId':_0xf4bea5[_0x1335('0x39')][_0x1335('0x7d')],'VoiceQueueId':_0xf4bea5[_0x1335('0x4e')]['id']}})[_0x1335('0x25')](function(){return _0x574193;});}})['then'](respondWithStatusCode(_0x47aa98,null))[_0x1335('0x4c')](handleError(_0x47aa98,null));};exports[_0x1335('0xaf')]=function(_0x3b8b21,_0x380816,_0x194ed3){var _0x52dbc5={};var _0x3185a4={};var _0x159789;var _0x589909;return db[_0x1335('0x36')]['findOne']({'where':{'id':_0x3b8b21['params']['id']}})[_0x1335('0x25')](handleEntityNotFound(_0x380816,null))[_0x1335('0x25')](function(_0x386582){if(_0x386582){_0x159789=_0x386582;_0x3185a4['model']=_[_0x1335('0x38')](db[_0x1335('0xb0')][_0x1335('0x4f')]);_0x3185a4['query']=_[_0x1335('0x38')](_0x3b8b21['query']);_0x3185a4[_0x1335('0x42')]=_[_0x1335('0x3a')](_0x3185a4['model'],_0x3185a4[_0x1335('0x39')]);_0x52dbc5['attributes']=_['intersection'](_0x3185a4[_0x1335('0x37')],qs[_0x1335('0x3c')](_0x3b8b21['query'][_0x1335('0x3c')]));_0x52dbc5[_0x1335('0x3b')]=_0x52dbc5['attributes']['length']?_0x52dbc5[_0x1335('0x3b')]:_0x3185a4[_0x1335('0x37')];_0x52dbc5[_0x1335('0x5f')]=qs[_0x1335('0x40')](_0x3b8b21[_0x1335('0x39')][_0x1335('0x40')]);_0x52dbc5[_0x1335('0x44')]=qs[_0x1335('0x42')](_[_0x1335('0x41')](_0x3b8b21[_0x1335('0x39')],_0x3185a4[_0x1335('0x42')]));if(_0x3b8b21[_0x1335('0x39')][_0x1335('0x29')]){_0x52dbc5[_0x1335('0x44')]=_[_0x1335('0x43')](_0x52dbc5[_0x1335('0x44')],{'$or':_[_0x1335('0x2b')](_0x52dbc5[_0x1335('0x3b')],function(_0x52cbc7){var _0x2b5edb={};_0x2b5edb[_0x52cbc7]={'$like':'%'+_0x3b8b21[_0x1335('0x39')][_0x1335('0x29')]+'%'};return _0x2b5edb;})});}_0x52dbc5=_['merge']({},_0x52dbc5,_0x3b8b21[_0x1335('0x47')]);return _0x159789[_0x1335('0xaf')](_0x52dbc5);}})[_0x1335('0x25')](function(_0x1ddcab){if(_0x1ddcab){_0x589909=_0x1ddcab[_0x1335('0x3d')];if(!_0x3b8b21[_0x1335('0x39')][_0x1335('0x3e')](_0x1335('0x3f'))){_0x52dbc5[_0x1335('0x1f')]=qs[_0x1335('0x1f')](_0x3b8b21['query'][_0x1335('0x1f')]);_0x52dbc5[_0x1335('0x1e')]=qs[_0x1335('0x1e')](_0x3b8b21['query'][_0x1335('0x1e')]);}return _0x159789[_0x1335('0xaf')](_0x52dbc5);}})[_0x1335('0x25')](function(_0x7042ff){if(_0x7042ff){return _0x7042ff?{'count':_0x589909,'rows':_0x7042ff}:null;}})[_0x1335('0x25')](respondWithResult(_0x380816,null))['catch'](handleError(_0x380816,null));};exports[_0x1335('0xb1')]=function(_0x3bb1cc,_0x256e46,_0x11bd5f){var _0x3c4b80,_0x4acdf8;return db[_0x1335('0x36')][_0x1335('0x2f')]({'where':{'id':_0x3bb1cc['params']['id']}})[_0x1335('0x25')](handleEntityNotFound(_0x256e46,null))[_0x1335('0x25')](function(_0x23c946){if(_0x23c946){_0x4acdf8=_0x23c946;return _0x23c946[_0x1335('0xb1')](_0x3bb1cc['body'][_0x1335('0x7d')],_[_0x1335('0x90')](_0x3bb1cc[_0x1335('0x51')],[_0x1335('0x7d'),'id'])||{});}return null;})[_0x1335('0x91')](function(_0x6dda99){var _0x15093a;_0x3c4b80=_0x6dda99||[];var _0x5427e7=[];if(_0x6dda99){for(var _0x16d816=0x0;_0x16d816<_0x6dda99[_0x1335('0x3d')];_0x16d816+=0x1){var _0x215c5b=_0x6dda99[_0x16d816][_0x1335('0x52')]({'plain':!![]});_0x15093a=squel[_0x1335('0x9a')]()[_0x1335('0x9b')](_0x1335('0xb2'))[_0x1335('0x9d')]([_0x1335('0x9e'),_0x1335('0xa0'),'ListId','VoiceQueueId','createdAt',_0x1335('0x5b')],squel[_0x1335('0xa1')]()['field'](_0x1335('0x9e'),_0x1335('0x9e'))[_0x1335('0x46')]('id','ContactId')['field'](_0x215c5b['CmListId'][_0x1335('0x86')](),_0x1335('0xab'))[_0x1335('0x46')](_0x3bb1cc[_0x1335('0x4e')]['id'][_0x1335('0x86')](),'VoiceQueueId')[_0x1335('0x46')](_0x1335('0xa2'),_0x1335('0x5a'))[_0x1335('0x46')](_0x1335('0xa2'),_0x1335('0x5b'))[_0x1335('0x7e')](_0x1335('0xa4'))['where'](_0x1335('0xa5'))[_0x1335('0x44')](_0x1335('0xa6'),_0x215c5b['CmListId'][_0x1335('0x86')]())[_0x1335('0x44')](_0x1335('0xac')))[_0x1335('0x86')]();_0x5427e7[_0x1335('0x85')](db[_0x1335('0x72')][_0x1335('0x39')](_0x15093a));}return BPromise['all'](_0x5427e7);}})['then'](function(){return _0x3c4b80;})[_0x1335('0x25')](respondWithResult(_0x256e46,null))[_0x1335('0x4c')](handleError(_0x256e46,null));};exports[_0x1335('0xb3')]=function(_0x886cee,_0x58e5d1,_0xf58980){return db[_0x1335('0x36')]['find']({'where':{'id':_0x886cee[_0x1335('0x4e')]['id']}})['then'](handleEntityNotFound(_0x58e5d1,null))['then'](function(_0x189c6f){if(_0x189c6f){return _0x189c6f[_0x1335('0xb3')](_0x886cee['query']['ids']);}})[_0x1335('0x25')](function(_0x2624b4){if(_0x2624b4){return db[_0x1335('0x66')][_0x1335('0x24')]({'where':{'ListId':_0x886cee[_0x1335('0x39')][_0x1335('0x7d')],'VoiceQueueId':_0x886cee[_0x1335('0x4e')]['id']}})[_0x1335('0x25')](function(){return _0x2624b4;});}})['then'](respondWithStatusCode(_0x58e5d1,null))['catch'](handleError(_0x58e5d1,null));}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.events.js b/server/api/voiceQueue/voiceQueue.events.js index 31d75ab..9578cb9 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 _0x55ca=['events','../../mysqldb','update','remove','emit','hasOwnProperty','hook'];(function(_0x4fde08,_0x463a36){var _0x12e725=function(_0x2670c5){while(--_0x2670c5){_0x4fde08['push'](_0x4fde08['shift']());}};_0x12e725(++_0x463a36);}(_0x55ca,0x126));var _0xa55c=function(_0x101cd1,_0x9e28ef){_0x101cd1=_0x101cd1-0x0;var _0x2e50b0=_0x55ca[_0x101cd1];return _0x2e50b0;};'use strict';var EventEmitter=require(_0xa55c('0x0'));var VoiceQueue=require(_0xa55c('0x1'))['db']['VoiceQueue'];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xa55c('0x2'),'afterDestroy':_0xa55c('0x3')};function emitEvent(_0x5dc716){return function(_0x3b478a,_0x2db02a,_0xcb02e3){VoiceQueueEvents[_0xa55c('0x4')](_0x5dc716+':'+_0x3b478a['id'],_0x3b478a);VoiceQueueEvents[_0xa55c('0x4')](_0x5dc716,_0x3b478a);_0xcb02e3(null);};}for(var e in events){if(events[_0xa55c('0x5')](e)){var event=events[e];VoiceQueue[_0xa55c('0x6')](e,emitEvent(event));}}module['exports']=VoiceQueueEvents; \ No newline at end of file +var _0x7217=['emit','hasOwnProperty','hook','exports','events','VoiceQueue','setMaxListeners','save','update','remove'];(function(_0xee4c5f,_0x1bf72d){var _0x5accbc=function(_0x5ca2aa){while(--_0x5ca2aa){_0xee4c5f['push'](_0xee4c5f['shift']());}};_0x5accbc(++_0x1bf72d);}(_0x7217,0x19e));var _0x7721=function(_0x2763f2,_0x416af8){_0x2763f2=_0x2763f2-0x0;var _0x3ef471=_0x7217[_0x2763f2];return _0x3ef471;};'use strict';var EventEmitter=require(_0x7721('0x0'));var VoiceQueue=require('../../mysqldb')['db'][_0x7721('0x1')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x7721('0x2')](0x0);var events={'afterCreate':_0x7721('0x3'),'afterUpdate':_0x7721('0x4'),'afterDestroy':_0x7721('0x5')};function emitEvent(_0x4d6446){return function(_0x5bf160,_0x472a96,_0xce17f9){VoiceQueueEvents[_0x7721('0x6')](_0x4d6446+':'+_0x5bf160['id'],_0x5bf160);VoiceQueueEvents[_0x7721('0x6')](_0x4d6446,_0x5bf160);_0xce17f9(null);};}for(var e in events){if(events[_0x7721('0x7')](e)){var event=events[e];VoiceQueue[_0x7721('0x8')](e,emitEvent(event));}}module[_0x7721('0x9')]=VoiceQueueEvents; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.model.js b/server/api/voiceQueue/voiceQueue.model.js index 34fd490..9b7dd06 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 _0x6a5d=['lodash','util','api','moment','request-promise','rimraf','../../config/environment','./voiceQueue.attributes','define','VoiceQueue','voice_queues'];(function(_0x46e891,_0x5bc0f1){var _0x39ef19=function(_0x513623){while(--_0x513623){_0x46e891['push'](_0x46e891['shift']());}};_0x39ef19(++_0x5bc0f1);}(_0x6a5d,0xc6));var _0xd6a5=function(_0x4c34ae,_0x101c5f){_0x4c34ae=_0x4c34ae-0x0;var _0x3391d9=_0x6a5d[_0x4c34ae];return _0x3391d9;};'use strict';var _=require(_0xd6a5('0x0'));var util=require(_0xd6a5('0x1'));var logger=require('../../config/logger')(_0xd6a5('0x2'));var moment=require(_0xd6a5('0x3'));var BPromise=require('bluebird');var rp=require(_0xd6a5('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd6a5('0x5'));var config=require(_0xd6a5('0x6'));var attributes=require(_0xd6a5('0x7'));module['exports']=function(_0x11dd68,_0x3caa4f){return _0x11dd68[_0xd6a5('0x8')](_0xd6a5('0x9'),attributes,{'tableName':_0xd6a5('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1839=['./voiceQueue.attributes','exports','define','VoiceQueue','voice_queues','util','../../config/logger','api','moment','request-promise','path','../../config/environment'];(function(_0x28304d,_0x2ace45){var _0x164168=function(_0x3bcb05){while(--_0x3bcb05){_0x28304d['push'](_0x28304d['shift']());}};_0x164168(++_0x2ace45);}(_0x1839,0xe9));var _0x9183=function(_0x2dd664,_0x3f440d){_0x2dd664=_0x2dd664-0x0;var _0x1e0ba2=_0x1839[_0x2dd664];return _0x1e0ba2;};'use strict';var _=require('lodash');var util=require(_0x9183('0x0'));var logger=require(_0x9183('0x1'))(_0x9183('0x2'));var moment=require(_0x9183('0x3'));var BPromise=require('bluebird');var rp=require(_0x9183('0x4'));var fs=require('fs');var path=require(_0x9183('0x5'));var rimraf=require('rimraf');var config=require(_0x9183('0x6'));var attributes=require(_0x9183('0x7'));module[_0x9183('0x8')]=function(_0x33d092,_0x5e3125){return _0x33d092[_0x9183('0x9')](_0x9183('0xa'),attributes,{'tableName':_0x9183('0xb'),'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 c0d4255..cfd26d0 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 _0x8bfd=['where','attributes','limit','include','map','model','then','ShowVoiceQueue','find','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./voiceQueue.socket','register','request','info','request\x20sent','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','VoiceQueue,\x20%s,\x20%s','catch','GetVoiceQueue','VoiceQueue','findAll','options','raw'];(function(_0x450076,_0x10983b){var _0x2029cc=function(_0x4a5e76){while(--_0x4a5e76){_0x450076['push'](_0x450076['shift']());}};_0x2029cc(++_0x10983b);}(_0x8bfd,0xdb));var _0xd8bf=function(_0x5f1d5a,_0x1c85a7){_0x5f1d5a=_0x5f1d5a-0x0;var _0x449071=_0x8bfd[_0x5f1d5a];return _0x449071;};'use strict';var _=require('lodash');var util=require(_0xd8bf('0x0'));var moment=require(_0xd8bf('0x1'));var BPromise=require(_0xd8bf('0x2'));var rs=require(_0xd8bf('0x3'));var fs=require('fs');var Redis=require(_0xd8bf('0x4'));var db=require(_0xd8bf('0x5'))['db'];var utils=require(_0xd8bf('0x6'));var logger=require('../../config/logger')(_0xd8bf('0x7'));var config=require(_0xd8bf('0x8'));var jayson=require(_0xd8bf('0x9'));var client=jayson[_0xd8bf('0xa')][_0xd8bf('0xb')]({'port':0x232a});config[_0xd8bf('0xc')]=_[_0xd8bf('0xd')](config[_0xd8bf('0xc')],{'host':_0xd8bf('0xe'),'port':0x18eb});var socket=require(_0xd8bf('0xf'))(new Redis(config[_0xd8bf('0xc')]));require(_0xd8bf('0x10'))[_0xd8bf('0x11')](socket);function respondWithRpcPromise(_0x236838,_0x4af394,_0x1078cc){return new BPromise(function(_0x30659b,_0x2c2c86){return client[_0xd8bf('0x12')](_0x236838,_0x1078cc)['then'](function(_0x119000){logger[_0xd8bf('0x13')]('VoiceQueue,\x20%s,\x20%s',_0x4af394,_0xd8bf('0x14'));logger[_0xd8bf('0x15')](_0xd8bf('0x16'),_0x4af394,'request\x20sent',JSON[_0xd8bf('0x17')](_0x119000));if(_0x119000[_0xd8bf('0x18')]){if(_0x119000[_0xd8bf('0x18')]['code']===0x1f4){logger['error']('VoiceQueue,\x20%s,\x20%s',_0x4af394,_0x119000[_0xd8bf('0x18')][_0xd8bf('0x19')]);return _0x2c2c86(_0x119000[_0xd8bf('0x18')]['message']);}logger['error'](_0xd8bf('0x1a'),_0x4af394,_0x119000[_0xd8bf('0x18')][_0xd8bf('0x19')]);return _0x30659b(_0x119000['error'][_0xd8bf('0x19')]);}else{logger[_0xd8bf('0x13')](_0xd8bf('0x1a'),_0x4af394,'request\x20sent');_0x30659b(_0x119000['result'][_0xd8bf('0x19')]);}})[_0xd8bf('0x1b')](function(_0x188ba9){logger[_0xd8bf('0x18')](_0xd8bf('0x1a'),_0x4af394,_0x188ba9);_0x2c2c86(_0x188ba9);});});}exports[_0xd8bf('0x1c')]=function(_0x51d781){var _0x1ca51c=this;return new Promise(function(_0x39b84f,_0x262e42){return db[_0xd8bf('0x1d')][_0xd8bf('0x1e')]({'raw':_0x51d781['options']?_0x51d781[_0xd8bf('0x1f')][_0xd8bf('0x20')]===undefined?!![]:![]:!![],'where':_0x51d781['options']?_0x51d781['options'][_0xd8bf('0x21')]||null:null,'attributes':_0x51d781[_0xd8bf('0x1f')]?_0x51d781[_0xd8bf('0x1f')][_0xd8bf('0x22')]||null:null,'limit':_0x51d781[_0xd8bf('0x1f')]?_0x51d781[_0xd8bf('0x1f')][_0xd8bf('0x23')]||null:null,'include':_0x51d781['options']?_0x51d781[_0xd8bf('0x1f')][_0xd8bf('0x24')]?_['map'](_0x51d781['options'][_0xd8bf('0x24')],function(_0x45606d){return{'model':db[_0x45606d['model']],'as':_0x45606d['as'],'attributes':_0x45606d['attributes'],'include':_0x45606d[_0xd8bf('0x24')]?_['map'](_0x45606d[_0xd8bf('0x24')],function(_0x11707c){return{'model':db[_0x11707c['model']],'as':_0x11707c['as'],'attributes':_0x11707c[_0xd8bf('0x22')],'include':_0x11707c[_0xd8bf('0x24')]?_[_0xd8bf('0x25')](_0x11707c[_0xd8bf('0x24')],function(_0x52e23b){return{'model':db[_0x52e23b[_0xd8bf('0x26')]],'as':_0x52e23b['as'],'attributes':_0x52e23b[_0xd8bf('0x22')]};}):[]};}):[]};}):[]:[]})[_0xd8bf('0x27')](function(_0x1df685){logger['info']('GetVoiceQueue',_0x51d781);logger[_0xd8bf('0x15')](_0xd8bf('0x1c'),_0x51d781,JSON[_0xd8bf('0x17')](_0x1df685));_0x39b84f(_0x1df685);})[_0xd8bf('0x1b')](function(_0x5f50f1){logger[_0xd8bf('0x18')](_0xd8bf('0x1c'),_0x5f50f1['message'],_0x51d781);_0x262e42(_0x1ca51c[_0xd8bf('0x18')](0x1f4,_0x5f50f1['message']));});});};exports[_0xd8bf('0x28')]=function(_0x4647dc){var _0x2f6065=this;return new Promise(function(_0x560976,_0x465eeb){return db[_0xd8bf('0x1d')][_0xd8bf('0x29')]({'raw':_0x4647dc[_0xd8bf('0x1f')]?_0x4647dc[_0xd8bf('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0x4647dc['options']?_0x4647dc['options']['where']||null:null,'attributes':_0x4647dc['options']?_0x4647dc[_0xd8bf('0x1f')][_0xd8bf('0x22')]||null:null,'include':_0x4647dc[_0xd8bf('0x1f')]?_0x4647dc['options'][_0xd8bf('0x24')]?_[_0xd8bf('0x25')](_0x4647dc[_0xd8bf('0x1f')][_0xd8bf('0x24')],function(_0x41dbe2){return{'model':db[_0x41dbe2[_0xd8bf('0x26')]],'as':_0x41dbe2['as'],'attributes':_0x41dbe2[_0xd8bf('0x22')],'include':_0x41dbe2[_0xd8bf('0x24')]?_['map'](_0x41dbe2[_0xd8bf('0x24')],function(_0x2044b6){return{'model':db[_0x2044b6[_0xd8bf('0x26')]],'as':_0x2044b6['as'],'attributes':_0x2044b6[_0xd8bf('0x22')],'include':_0x2044b6['include']?_[_0xd8bf('0x25')](_0x2044b6[_0xd8bf('0x24')],function(_0x121ba6){return{'model':db[_0x121ba6[_0xd8bf('0x26')]],'as':_0x121ba6['as'],'attributes':_0x121ba6['attributes']};}):[]};}):[]};}):[]:[]})[_0xd8bf('0x27')](function(_0x100b91){logger['info'](_0xd8bf('0x28'),_0x4647dc);logger['debug'](_0xd8bf('0x28'),_0x4647dc,JSON['stringify'](_0x100b91));_0x560976(_0x100b91);})['catch'](function(_0x11884d){logger[_0xd8bf('0x18')]('ShowVoiceQueue',_0x11884d[_0xd8bf('0x19')],_0x4647dc);_0x465eeb(_0x2f6065[_0xd8bf('0x18')](0x1f4,_0x11884d[_0xd8bf('0x19')]));});});}; \ No newline at end of file +var _0x858d=['code','message','result','catch','GetVoiceQueue','VoiceQueue','options','raw','where','limit','map','model','include','attributes','ShowVoiceQueue','find','lodash','util','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./voiceQueue.socket','register','request','then','info','VoiceQueue,\x20%s,\x20%s','request\x20sent','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x57edde,_0x1d45e9){var _0x1fd019=function(_0x2c9737){while(--_0x2c9737){_0x57edde['push'](_0x57edde['shift']());}};_0x1fd019(++_0x1d45e9);}(_0x858d,0xd8));var _0xd858=function(_0xe5016c,_0x40dc12){_0xe5016c=_0xe5016c-0x0;var _0x55a6f7=_0x858d[_0xe5016c];return _0x55a6f7;};'use strict';var _=require(_0xd858('0x0'));var util=require(_0xd858('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd858('0x2'));var db=require(_0xd858('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xd858('0x4'))(_0xd858('0x5'));var config=require(_0xd858('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xd858('0x7')][_0xd858('0x8')]({'port':0x232a});config[_0xd858('0x9')]=_[_0xd858('0xa')](config['redis'],{'host':_0xd858('0xb'),'port':0x18eb});var socket=require(_0xd858('0xc'))(new Redis(config['redis']));require(_0xd858('0xd'))[_0xd858('0xe')](socket);function respondWithRpcPromise(_0x367e53,_0x1ee58f,_0x2252da){return new BPromise(function(_0x28c253,_0x29e50d){return client[_0xd858('0xf')](_0x367e53,_0x2252da)[_0xd858('0x10')](function(_0x4f17f1){logger[_0xd858('0x11')](_0xd858('0x12'),_0x1ee58f,_0xd858('0x13'));logger[_0xd858('0x14')](_0xd858('0x15'),_0x1ee58f,_0xd858('0x13'),JSON[_0xd858('0x16')](_0x4f17f1));if(_0x4f17f1['error']){if(_0x4f17f1[_0xd858('0x17')][_0xd858('0x18')]===0x1f4){logger[_0xd858('0x17')](_0xd858('0x12'),_0x1ee58f,_0x4f17f1['error']['message']);return _0x29e50d(_0x4f17f1[_0xd858('0x17')][_0xd858('0x19')]);}logger[_0xd858('0x17')](_0xd858('0x12'),_0x1ee58f,_0x4f17f1['error'][_0xd858('0x19')]);return _0x28c253(_0x4f17f1[_0xd858('0x17')]['message']);}else{logger[_0xd858('0x11')]('VoiceQueue,\x20%s,\x20%s',_0x1ee58f,'request\x20sent');_0x28c253(_0x4f17f1[_0xd858('0x1a')][_0xd858('0x19')]);}})[_0xd858('0x1b')](function(_0x438a99){logger[_0xd858('0x17')](_0xd858('0x12'),_0x1ee58f,_0x438a99);_0x29e50d(_0x438a99);});});}exports[_0xd858('0x1c')]=function(_0x38639f){var _0x50018c=this;return new Promise(function(_0x5f4ad5,_0x29f17f){return db[_0xd858('0x1d')]['findAll']({'raw':_0x38639f['options']?_0x38639f[_0xd858('0x1e')][_0xd858('0x1f')]===undefined?!![]:![]:!![],'where':_0x38639f[_0xd858('0x1e')]?_0x38639f[_0xd858('0x1e')][_0xd858('0x20')]||null:null,'attributes':_0x38639f[_0xd858('0x1e')]?_0x38639f[_0xd858('0x1e')]['attributes']||null:null,'limit':_0x38639f[_0xd858('0x1e')]?_0x38639f[_0xd858('0x1e')][_0xd858('0x21')]||null:null,'include':_0x38639f['options']?_0x38639f[_0xd858('0x1e')]['include']?_[_0xd858('0x22')](_0x38639f['options']['include'],function(_0x59c4b5){return{'model':db[_0x59c4b5[_0xd858('0x23')]],'as':_0x59c4b5['as'],'attributes':_0x59c4b5['attributes'],'include':_0x59c4b5[_0xd858('0x24')]?_['map'](_0x59c4b5[_0xd858('0x24')],function(_0x3c2c71){return{'model':db[_0x3c2c71[_0xd858('0x23')]],'as':_0x3c2c71['as'],'attributes':_0x3c2c71['attributes'],'include':_0x3c2c71[_0xd858('0x24')]?_[_0xd858('0x22')](_0x3c2c71[_0xd858('0x24')],function(_0x54ffc1){return{'model':db[_0x54ffc1[_0xd858('0x23')]],'as':_0x54ffc1['as'],'attributes':_0x54ffc1[_0xd858('0x25')]};}):[]};}):[]};}):[]:[]})[_0xd858('0x10')](function(_0x37d296){logger[_0xd858('0x11')]('GetVoiceQueue',_0x38639f);logger[_0xd858('0x14')](_0xd858('0x1c'),_0x38639f,JSON['stringify'](_0x37d296));_0x5f4ad5(_0x37d296);})[_0xd858('0x1b')](function(_0x51fa2a){logger['error'](_0xd858('0x1c'),_0x51fa2a['message'],_0x38639f);_0x29f17f(_0x50018c[_0xd858('0x17')](0x1f4,_0x51fa2a['message']));});});};exports[_0xd858('0x26')]=function(_0x353849){var _0x1a0459=this;return new Promise(function(_0x31a51e,_0x397eda){return db[_0xd858('0x1d')][_0xd858('0x27')]({'raw':_0x353849[_0xd858('0x1e')]?_0x353849['options'][_0xd858('0x1f')]===undefined?!![]:![]:!![],'where':_0x353849['options']?_0x353849[_0xd858('0x1e')][_0xd858('0x20')]||null:null,'attributes':_0x353849[_0xd858('0x1e')]?_0x353849['options'][_0xd858('0x25')]||null:null,'include':_0x353849[_0xd858('0x1e')]?_0x353849[_0xd858('0x1e')][_0xd858('0x24')]?_[_0xd858('0x22')](_0x353849[_0xd858('0x1e')][_0xd858('0x24')],function(_0x531811){return{'model':db[_0x531811['model']],'as':_0x531811['as'],'attributes':_0x531811[_0xd858('0x25')],'include':_0x531811['include']?_[_0xd858('0x22')](_0x531811[_0xd858('0x24')],function(_0x1f390a){return{'model':db[_0x1f390a['model']],'as':_0x1f390a['as'],'attributes':_0x1f390a[_0xd858('0x25')],'include':_0x1f390a[_0xd858('0x24')]?_[_0xd858('0x22')](_0x1f390a[_0xd858('0x24')],function(_0x311f9c){return{'model':db[_0x311f9c[_0xd858('0x23')]],'as':_0x311f9c['as'],'attributes':_0x311f9c[_0xd858('0x25')]};}):[]};}):[]};}):[]:[]})[_0xd858('0x10')](function(_0x3abdd6){logger[_0xd858('0x11')](_0xd858('0x26'),_0x353849);logger[_0xd858('0x14')](_0xd858('0x26'),_0x353849,JSON[_0xd858('0x16')](_0x3abdd6));_0x31a51e(_0x3abdd6);})['catch'](function(_0x588de5){logger['error'](_0xd858('0x26'),_0x588de5[_0xd858('0x19')],_0x353849);_0x397eda(_0x1a0459['error'](0x1f4,_0x588de5[_0xd858('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.socket.js b/server/api/voiceQueue/voiceQueue.socket.js index 683da13..482fff4 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 _0xdaf2=['voiceQueue:','save','remove','emit','removeListener','register','length'];(function(_0x50bf71,_0x37e8ef){var _0x4c3904=function(_0x22fdad){while(--_0x22fdad){_0x50bf71['push'](_0x50bf71['shift']());}};_0x4c3904(++_0x37e8ef);}(_0xdaf2,0x1cf));var _0x2daf=function(_0x260f28,_0x4e9b30){_0x260f28=_0x260f28-0x0;var _0x3aefcc=_0xdaf2[_0x260f28];return _0x3aefcc;};'use strict';var VoiceQueueEvents=require('./voiceQueue.events');var events=[_0x2daf('0x0'),_0x2daf('0x1'),'update'];function createListener(_0x1e8147,_0x28abd4){return function(_0x1a711c){_0x28abd4[_0x2daf('0x2')](_0x1e8147,_0x1a711c);};}function removeListener(_0x5b9fa9,_0x1a2ee6){return function(){VoiceQueueEvents[_0x2daf('0x3')](_0x5b9fa9,_0x1a2ee6);};}exports[_0x2daf('0x4')]=function(_0x5d11e7){for(var _0x34366b=0x0,_0x58227c=events[_0x2daf('0x5')];_0x34366b<_0x58227c;_0x34366b++){var _0x3d6157=events[_0x34366b];var _0x3b3a58=createListener(_0x2daf('0x6')+_0x3d6157,_0x5d11e7);VoiceQueueEvents['on'](_0x3d6157,_0x3b3a58);}}; \ No newline at end of file +var _0x4f9d=['emit','register','length','./voiceQueue.events','save','remove'];(function(_0x5333d8,_0x4cbe38){var _0x3e8edb=function(_0x26fc36){while(--_0x26fc36){_0x5333d8['push'](_0x5333d8['shift']());}};_0x3e8edb(++_0x4cbe38);}(_0x4f9d,0x1b3));var _0xd4f9=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x4f9d[_0x14add3];return _0x4a174f;};'use strict';var VoiceQueueEvents=require(_0xd4f9('0x0'));var events=[_0xd4f9('0x1'),_0xd4f9('0x2'),'update'];function createListener(_0x357191,_0x269039){return function(_0x30abe0){_0x269039[_0xd4f9('0x3')](_0x357191,_0x30abe0);};}function removeListener(_0x2d6634,_0x562996){return function(){VoiceQueueEvents['removeListener'](_0x2d6634,_0x562996);};}exports[_0xd4f9('0x4')]=function(_0x39f445){for(var _0x5d4724=0x0,_0x33a055=events[_0xd4f9('0x5')];_0x5d4724<_0x33a055;_0x5d4724++){var _0x1bada0=events[_0x5d4724];var _0x151221=createListener('voiceQueue:'+_0x1bada0,_0x39f445);VoiceQueueEvents['on'](_0x1bada0,_0x151221);}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/index.js b/server/api/voiceQueueReport/index.js index 7050b76..e1f1140 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 _0xb016=['put','update','exports','multer','util','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueueReport.controller','isAuthenticated','index','get','describe','getVoiceQueuesReport','/:id','show','create'];(function(_0x4e298e,_0xbe5c00){var _0x54a98a=function(_0x1bcffb){while(--_0x1bcffb){_0x4e298e['push'](_0x4e298e['shift']());}};_0x54a98a(++_0xbe5c00);}(_0xb016,0x159));var _0x6b01=function(_0x18009e,_0x46deb9){_0x18009e=_0x18009e-0x0;var _0x43b0aa=_0xb016[_0x18009e];return _0x43b0aa;};'use strict';var multer=require(_0x6b01('0x0'));var util=require(_0x6b01('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x6b01('0x2'));var router=express['Router']();var auth=require(_0x6b01('0x3'));var interaction=require(_0x6b01('0x4'));var config=require(_0x6b01('0x5'));var controller=require(_0x6b01('0x6'));router['get']('/',auth[_0x6b01('0x7')](),controller[_0x6b01('0x8')]);router[_0x6b01('0x9')]('/describe',auth['isAuthenticated'](),controller[_0x6b01('0xa')]);router[_0x6b01('0x9')]('/index',auth['isAuthenticated'](),controller[_0x6b01('0xb')]);router[_0x6b01('0x9')](_0x6b01('0xc'),auth[_0x6b01('0x7')](),controller[_0x6b01('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0x6b01('0xe')]);router[_0x6b01('0xf')](_0x6b01('0xc'),auth['isAuthenticated'](),controller[_0x6b01('0x10')]);router['delete']('/:id',auth[_0x6b01('0x7')](),controller['destroy']);module[_0x6b01('0x11')]=router; \ No newline at end of file +var _0x1883=['/describe','describe','/index','show','post','put','/:id','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueueReport.controller','get','isAuthenticated','index'];(function(_0x4cb272,_0x52c0e9){var _0x57b4aa=function(_0x1efefb){while(--_0x1efefb){_0x4cb272['push'](_0x4cb272['shift']());}};_0x57b4aa(++_0x52c0e9);}(_0x1883,0xab));var _0x3188=function(_0x2bc458,_0x10869e){_0x2bc458=_0x2bc458-0x0;var _0x1e46ba=_0x1883[_0x2bc458];return _0x1e46ba;};'use strict';var multer=require(_0x3188('0x0'));var util=require(_0x3188('0x1'));var path=require(_0x3188('0x2'));var timeout=require(_0x3188('0x3'));var express=require(_0x3188('0x4'));var router=express[_0x3188('0x5')]();var auth=require(_0x3188('0x6'));var interaction=require(_0x3188('0x7'));var config=require(_0x3188('0x8'));var controller=require(_0x3188('0x9'));router[_0x3188('0xa')]('/',auth[_0x3188('0xb')](),controller[_0x3188('0xc')]);router[_0x3188('0xa')](_0x3188('0xd'),auth[_0x3188('0xb')](),controller[_0x3188('0xe')]);router['get'](_0x3188('0xf'),auth[_0x3188('0xb')](),controller['getVoiceQueuesReport']);router[_0x3188('0xa')]('/:id',auth[_0x3188('0xb')](),controller[_0x3188('0x10')]);router[_0x3188('0x11')]('/',auth[_0x3188('0xb')](),controller['create']);router[_0x3188('0x12')](_0x3188('0x13'),auth['isAuthenticated'](),controller['update']);router[_0x3188('0x14')](_0x3188('0x13'),auth[_0x3188('0xb')](),controller[_0x3188('0x15')]);module[_0x3188('0x16')]=router; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.attributes.js b/server/api/voiceQueueReport/voiceQueueReport.attributes.js index 4a4fb4d..b952e30 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 _0x74cc=['STRING','DATE','getDataValue','queuecallerjoinAt','format','diff','seconds','setDataValue','queuecallerleaveAt','holdtime','INTEGER','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','moment','exports'];(function(_0x16c9b5,_0x4100fb){var _0xf48d6f=function(_0x44843f){while(--_0x44843f){_0x16c9b5['push'](_0x16c9b5['shift']());}};_0xf48d6f(++_0x4100fb);}(_0x74cc,0x184));var _0xc74c=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x74cc[_0x432682];return _0x463d05;};'use strict';var Sequelize=require(_0xc74c('0x0'));var moment=require(_0xc74c('0x1'));module[_0xc74c('0x2')]={'type':{'type':Sequelize[_0xc74c('0x3')]},'uniqueid':{'type':Sequelize[_0xc74c('0x3')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xc74c('0x3')]},'queue':{'type':Sequelize[_0xc74c('0x3')]},'queuecallerjoinAt':{'type':Sequelize[_0xc74c('0x4')]},'queuecallerleaveAt':{'type':Sequelize['DATE'],'set':function(_0x14cc0e){var _0x4939af=moment(_0x14cc0e);var _0x3ce047=moment(this[_0xc74c('0x5')](_0xc74c('0x6')))[_0xc74c('0x7')]('YYYY-MM-DD\x20HH:mm:ss');var _0x20d7f2=_0x4939af[_0xc74c('0x8')](_0x3ce047,_0xc74c('0x9'));this[_0xc74c('0xa')](_0xc74c('0xb'),_0x14cc0e);this[_0xc74c('0xa')](_0xc74c('0xc'),_0x20d7f2||null);}},'position':{'type':Sequelize[_0xc74c('0xd')]},'count':{'type':Sequelize[_0xc74c('0xd')]},'queuecallerabandon':{'type':Sequelize[_0xc74c('0xe')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0xc74c('0x4')]},'queuecallercomplete':{'type':Sequelize[_0xc74c('0xe')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize['DATE']},'queuecallerexit':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0xc74c('0x4')]},'queuecallerexitreason':{'type':Sequelize[_0xc74c('0x3')],'comment':_0xc74c('0xf')},'originalposition':{'type':Sequelize['INTEGER']},'channel':{'type':Sequelize[_0xc74c('0x3')]},'connectedlinenum':{'type':Sequelize[_0xc74c('0x3')]},'connectedlinename':{'type':Sequelize[_0xc74c('0x3')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0xc74c('0x3')]},'exten':{'type':Sequelize[_0xc74c('0x3')]},'priority':{'type':Sequelize['STRING']},'holdtime':{'type':Sequelize[_0xc74c('0xd')]},'mohtime':{'type':Sequelize[_0xc74c('0xd')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xc74c('0xe')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0xc74c('0x3')]},'transfer':{'type':Sequelize[_0xc74c('0xe')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xc74c('0x3')],'comment':_0xc74c('0x10')},'transferexten':{'type':Sequelize[_0xc74c('0x3')]},'transferuniqueid':{'type':Sequelize[_0xc74c('0x3')]},'disposition':{'type':Sequelize[_0xc74c('0x3')]},'queuecallerenterreason':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x6c5d=['moment','exports','STRING','DATE','getDataValue','diff','seconds','setDataValue','queuecallerleaveAt','holdtime','INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','sequelize'];(function(_0x5aea53,_0x113aef){var _0x3e4538=function(_0x1d40d8){while(--_0x1d40d8){_0x5aea53['push'](_0x5aea53['shift']());}};_0x3e4538(++_0x113aef);}(_0x6c5d,0x1e9));var _0xd6c5=function(_0x2a2e95,_0x5c626e){_0x2a2e95=_0x2a2e95-0x0;var _0x54e62e=_0x6c5d[_0x2a2e95];return _0x54e62e;};'use strict';var Sequelize=require(_0xd6c5('0x0'));var moment=require(_0xd6c5('0x1'));module[_0xd6c5('0x2')]={'type':{'type':Sequelize[_0xd6c5('0x3')]},'uniqueid':{'type':Sequelize[_0xd6c5('0x3')]},'calleridnum':{'type':Sequelize[_0xd6c5('0x3')]},'calleridname':{'type':Sequelize[_0xd6c5('0x3')]},'queue':{'type':Sequelize[_0xd6c5('0x3')]},'queuecallerjoinAt':{'type':Sequelize[_0xd6c5('0x4')]},'queuecallerleaveAt':{'type':Sequelize[_0xd6c5('0x4')],'set':function(_0x4738d1){var _0x463c96=moment(_0x4738d1);var _0x52064f=moment(this[_0xd6c5('0x5')]('queuecallerjoinAt'))['format']('YYYY-MM-DD\x20HH:mm:ss');var _0x3d64ca=_0x463c96[_0xd6c5('0x6')](_0x52064f,_0xd6c5('0x7'));this[_0xd6c5('0x8')](_0xd6c5('0x9'),_0x4738d1);this['setDataValue'](_0xd6c5('0xa'),_0x3d64ca||null);}},'position':{'type':Sequelize['INTEGER']},'count':{'type':Sequelize[_0xd6c5('0xb')]},'queuecallerabandon':{'type':Sequelize[_0xd6c5('0xc')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize['DATE']},'queuecallercomplete':{'type':Sequelize[_0xd6c5('0xc')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize['DATE']},'queuecallerexit':{'type':Sequelize[_0xd6c5('0xc')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0xd6c5('0x4')]},'queuecallerexitreason':{'type':Sequelize[_0xd6c5('0x3')],'comment':'COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT'},'originalposition':{'type':Sequelize[_0xd6c5('0xb')]},'channel':{'type':Sequelize[_0xd6c5('0x3')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0xd6c5('0x3')]},'context':{'type':Sequelize[_0xd6c5('0x3')]},'exten':{'type':Sequelize[_0xd6c5('0x3')]},'priority':{'type':Sequelize['STRING']},'holdtime':{'type':Sequelize[_0xd6c5('0xb')]},'mohtime':{'type':Sequelize[_0xd6c5('0xb')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xd6c5('0xc')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0xd6c5('0x3')]},'transfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xd6c5('0x3')],'comment':_0xd6c5('0xd')},'transferexten':{'type':Sequelize[_0xd6c5('0x3')]},'transferuniqueid':{'type':Sequelize[_0xd6c5('0x3')]},'disposition':{'type':Sequelize[_0xd6c5('0x3')]},'queuecallerenterreason':{'type':Sequelize[_0xd6c5('0xb')],'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 2310a02..f8e221b 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 _0x5358=['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','redis','defaults','localhost','socket.io-emitter','./voiceQueueReport.socket','register','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','destroy','sendStatus','error','stack','name','send','index','VoiceQueueReport','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','field','options','then','includeAll','include','findAll','catch','rawAttributes','find','create','body','update','params','describe','rows','getVoiceQueuesReport','rimraf','fast-json-patch','request-promise'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5358,0x1e3));var _0x8535=function(_0x5aa127,_0x4c7b72){_0x5aa127=_0x5aa127-0x0;var _0x44db91=_0x5358[_0x5aa127];return _0x44db91;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x8535('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8535('0x1'));var rp=require(_0x8535('0x2'));var moment=require('moment');var BPromise=require(_0x8535('0x3'));var Mustache=require(_0x8535('0x4'));var util=require('util');var path=require(_0x8535('0x5'));var sox=require(_0x8535('0x6'));var csv=require(_0x8535('0x7'));var ejs=require(_0x8535('0x8'));var fs=require('fs');var _=require(_0x8535('0x9'));var squel=require('squel');var crypto=require(_0x8535('0xa'));var jsforce=require(_0x8535('0xb'));var deskjs=require(_0x8535('0xc'));var toCsv=require('to-csv');var querystring=require(_0x8535('0xd'));var Papa=require(_0x8535('0xe'));var Redis=require(_0x8535('0xf'));var authService=require(_0x8535('0x10'));var qs=require(_0x8535('0x11'));var as=require(_0x8535('0x12'));var hardwareService=require(_0x8535('0x13'));var logger=require(_0x8535('0x14'))(_0x8535('0x15'));var utils=require(_0x8535('0x16'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0x8535('0x17')]=_[_0x8535('0x18')](config[_0x8535('0x17')],{'host':_0x8535('0x19'),'port':0x18eb});var socket=require(_0x8535('0x1a'))(new Redis(config[_0x8535('0x17')]));require(_0x8535('0x1b'))[_0x8535('0x1c')](socket);function respondWithStatusCode(_0x1187fb,_0x5d2a17){_0x5d2a17=_0x5d2a17||0xcc;return function(_0x2a5d21){if(_0x2a5d21){return _0x1187fb['sendStatus'](_0x5d2a17);}return _0x1187fb[_0x8535('0x1d')](_0x5d2a17)[_0x8535('0x1e')]();};}function respondWithResult(_0x536856,_0x40bd69){_0x40bd69=_0x40bd69||0xc8;return function(_0x4effeb){if(_0x4effeb){return _0x536856['status'](_0x40bd69)[_0x8535('0x1f')](_0x4effeb);}};}function respondWithFilteredResult(_0x2d620a,_0xf587ac){return function(_0x21923a){if(_0x21923a){var _0x4dd4df=_0x21923a[_0x8535('0x20')],_0x211eda=_0xf587ac[_0x8535('0x21')],_0x2b4a50=_0xf587ac['offset']+_0xf587ac[_0x8535('0x22')],_0x14d2b4;if(_0x2b4a50>=_0x4dd4df){_0x2b4a50=_0x4dd4df;_0x14d2b4=0xc8;}else{_0x14d2b4=0xce;}_0x2d620a[_0x8535('0x1d')](_0x14d2b4);return _0x2d620a[_0x8535('0x23')](_0x8535('0x24'),_0x211eda+'-'+_0x2b4a50+'/'+_0x4dd4df)[_0x8535('0x1f')](_0x21923a);}return null;};}function patchUpdates(_0x364960){return function(_0xd7ab3a){try{jsonpatch[_0x8535('0x25')](_0xd7ab3a,_0x364960,!![]);}catch(_0x551acc){return BPromise[_0x8535('0x26')](_0x551acc);}return _0xd7ab3a[_0x8535('0x27')]();};}function saveUpdates(_0x15dcee,_0x124e2c){return function(_0x56e5d3){if(_0x56e5d3){return _0x56e5d3['update'](_0x15dcee)['then'](function(_0x205336){return _0x205336;});}return null;};}function removeEntity(_0x1e1b58,_0x1f938){return function(_0x5f89ef){if(_0x5f89ef){return _0x5f89ef[_0x8535('0x28')]()['then'](function(){_0x1e1b58[_0x8535('0x1d')](0xcc)[_0x8535('0x1e')]();});}};}function handleEntityNotFound(_0x367a95,_0x537205){return function(_0x2e7e09){if(!_0x2e7e09){_0x367a95[_0x8535('0x29')](0x194);}return _0x2e7e09;};}function handleError(_0x1cd800,_0xdc3aae){_0xdc3aae=_0xdc3aae||0x1f4;return function(_0x537551){logger[_0x8535('0x2a')](_0x537551[_0x8535('0x2b')]);if(_0x537551[_0x8535('0x2c')]){delete _0x537551[_0x8535('0x2c')];}_0x1cd800[_0x8535('0x1d')](_0xdc3aae)[_0x8535('0x2d')](_0x537551);};}exports[_0x8535('0x2e')]=function(_0x2d9401,_0x1fc31b){var _0x3a743b={},_0xa5599f={},_0x17d821={'count':0x0,'rows':[]};var _0x5538cf=db[_0x8535('0x2f')]['rawAttributes'];_0xa5599f[_0x8535('0x30')]=_[_0x8535('0x31')](_0x5538cf);_0xa5599f['query']=_[_0x8535('0x31')](_0x2d9401[_0x8535('0x32')]);_0xa5599f[_0x8535('0x33')]=_[_0x8535('0x34')](_0xa5599f[_0x8535('0x30')],_0xa5599f[_0x8535('0x32')]);_0x3a743b[_0x8535('0x35')]=_[_0x8535('0x34')](_0xa5599f[_0x8535('0x30')],qs[_0x8535('0x36')](_0x2d9401[_0x8535('0x32')][_0x8535('0x36')]));_0x3a743b['attributes']=_0x3a743b[_0x8535('0x35')][_0x8535('0x37')]?_0x3a743b[_0x8535('0x35')]:_0xa5599f[_0x8535('0x30')];if(!_0x2d9401['query'][_0x8535('0x38')](_0x8535('0x39'))){_0x3a743b['limit']=qs[_0x8535('0x22')](_0x2d9401[_0x8535('0x32')][_0x8535('0x22')]);_0x3a743b[_0x8535('0x21')]=qs[_0x8535('0x21')](_0x2d9401['query'][_0x8535('0x21')]);}_0x3a743b[_0x8535('0x3a')]=qs['sort'](_0x2d9401[_0x8535('0x32')][_0x8535('0x3b')]);_0x3a743b[_0x8535('0x3c')]=qs[_0x8535('0x33')](_[_0x8535('0x3d')](_0x2d9401[_0x8535('0x32')],_0xa5599f[_0x8535('0x33')]));if(_0x2d9401[_0x8535('0x32')][_0x8535('0x3e')]){_0x3a743b[_0x8535('0x3c')]=_[_0x8535('0x3f')](_0x3a743b['where'],{'$or':_[_0x8535('0x40')](_0x5538cf,function(_0x3f63a9){if(_0x3f63a9['type']['key']!=='VIRTUAL'){var _0x5a6973={};_0x5a6973[_0x3f63a9[_0x8535('0x41')]]={'$like':'%'+_0x2d9401[_0x8535('0x32')][_0x8535('0x3e')]+'%'};return _0x5a6973;}})});}_0x3a743b=_[_0x8535('0x3f')]({},_0x3a743b,_0x2d9401[_0x8535('0x42')]);var _0x35238a={'where':_0x3a743b[_0x8535('0x3c')]};return db[_0x8535('0x2f')][_0x8535('0x20')](_0x35238a)[_0x8535('0x43')](function(_0x2746c6){_0x17d821[_0x8535('0x20')]=_0x2746c6;if(_0x2d9401[_0x8535('0x32')][_0x8535('0x44')]){_0x3a743b[_0x8535('0x45')]=[{'all':!![]}];}return db[_0x8535('0x2f')][_0x8535('0x46')](_0x3a743b);})['then'](function(_0x246751){_0x17d821['rows']=_0x246751;return _0x17d821;})['then'](respondWithFilteredResult(_0x1fc31b,_0x3a743b))[_0x8535('0x47')](handleError(_0x1fc31b,null));};exports['show']=function(_0x15bb2e,_0x2de7d2){var _0x540f69={'raw':![],'where':{'id':_0x15bb2e['params']['id']}},_0x3a32dd={};_0x3a32dd[_0x8535('0x30')]=_['keys'](db[_0x8535('0x2f')][_0x8535('0x48')]);_0x3a32dd[_0x8535('0x32')]=_['keys'](_0x15bb2e[_0x8535('0x32')]);_0x3a32dd[_0x8535('0x33')]=_[_0x8535('0x34')](_0x3a32dd[_0x8535('0x30')],_0x3a32dd[_0x8535('0x32')]);_0x540f69[_0x8535('0x35')]=_[_0x8535('0x34')](_0x3a32dd['model'],qs[_0x8535('0x36')](_0x15bb2e['query'][_0x8535('0x36')]));_0x540f69[_0x8535('0x35')]=_0x540f69[_0x8535('0x35')][_0x8535('0x37')]?_0x540f69['attributes']:_0x3a32dd[_0x8535('0x30')];if(_0x15bb2e['query'][_0x8535('0x44')]){_0x540f69[_0x8535('0x45')]=[{'all':!![]}];}_0x540f69=_['merge']({},_0x540f69,_0x15bb2e[_0x8535('0x42')]);return db[_0x8535('0x2f')][_0x8535('0x49')](_0x540f69)[_0x8535('0x43')](handleEntityNotFound(_0x2de7d2,null))[_0x8535('0x43')](respondWithResult(_0x2de7d2,null))[_0x8535('0x47')](handleError(_0x2de7d2,null));};exports[_0x8535('0x4a')]=function(_0x5c31cf,_0x44aa4f){return db['VoiceQueueReport']['create'](_0x5c31cf[_0x8535('0x4b')],{})[_0x8535('0x43')](respondWithResult(_0x44aa4f,0xc9))[_0x8535('0x47')](handleError(_0x44aa4f,null));};exports[_0x8535('0x4c')]=function(_0x20daea,_0x176b8c){if(_0x20daea[_0x8535('0x4b')]['id']){delete _0x20daea[_0x8535('0x4b')]['id'];}return db[_0x8535('0x2f')]['find']({'where':{'id':_0x20daea[_0x8535('0x4d')]['id']}})[_0x8535('0x43')](handleEntityNotFound(_0x176b8c,null))['then'](saveUpdates(_0x20daea['body'],null))[_0x8535('0x43')](respondWithResult(_0x176b8c,null))[_0x8535('0x47')](handleError(_0x176b8c,null));};exports[_0x8535('0x28')]=function(_0x207cff,_0xe25e8b){return db[_0x8535('0x2f')][_0x8535('0x49')]({'where':{'id':_0x207cff[_0x8535('0x4d')]['id']}})['then'](handleEntityNotFound(_0xe25e8b,null))[_0x8535('0x43')](removeEntity(_0xe25e8b,null))['catch'](handleError(_0xe25e8b,null));};exports[_0x8535('0x4e')]=function(_0x118162,_0xb9bdfc){return db['VoiceQueueReport'][_0x8535('0x4e')]()[_0x8535('0x43')](respondWithResult(_0xb9bdfc,null))[_0x8535('0x47')](handleError(_0xb9bdfc,null));};exports['getVoiceQueuesReport']=function(_0x4e9f3e,_0x24c781){var _0x410ae0={},_0x54475b={},_0x190b45={'count':0x0,'rows':[]};_0x54475b[_0x8535('0x30')]=_['keys'](db['VoiceQueueReport'][_0x8535('0x48')]);_0x54475b[_0x8535('0x32')]=_['keys'](_0x4e9f3e[_0x8535('0x32')]);_0x54475b[_0x8535('0x33')]=_[_0x8535('0x34')](_0x54475b['model'],_0x54475b['query']);_0x410ae0['attributes']=_[_0x8535('0x34')](_0x54475b[_0x8535('0x30')],qs[_0x8535('0x36')](_0x4e9f3e[_0x8535('0x32')][_0x8535('0x36')]));_0x410ae0[_0x8535('0x35')]=_0x410ae0[_0x8535('0x35')]['length']?_0x410ae0[_0x8535('0x35')]:_0x54475b['model'];if(!_0x4e9f3e['query'][_0x8535('0x38')](_0x8535('0x39'))){_0x410ae0[_0x8535('0x22')]=qs[_0x8535('0x22')](_0x4e9f3e[_0x8535('0x32')][_0x8535('0x22')]);_0x410ae0['offset']=qs[_0x8535('0x21')](_0x4e9f3e[_0x8535('0x32')][_0x8535('0x21')]);}_0x410ae0['order']=qs[_0x8535('0x3b')](_0x4e9f3e[_0x8535('0x32')]['sort']);_0x410ae0[_0x8535('0x3c')]=qs[_0x8535('0x33')](_['pick'](_0x4e9f3e[_0x8535('0x32')],_0x54475b['filters']));if(_0x4e9f3e[_0x8535('0x32')][_0x8535('0x3e')]){_0x410ae0[_0x8535('0x3c')]=_[_0x8535('0x3f')](_0x410ae0[_0x8535('0x3c')],{'$or':_[_0x8535('0x40')](_0x410ae0[_0x8535('0x35')],function(_0xf21f39){var _0x2619fc={};_0x2619fc[_0xf21f39]={'$like':'%'+_0x4e9f3e[_0x8535('0x32')][_0x8535('0x3e')]+'%'};return _0x2619fc;})});}_0x410ae0=_[_0x8535('0x3f')]({},_0x410ae0,_0x4e9f3e['options']);var _0x12ab85={'where':_0x410ae0[_0x8535('0x3c')]};return db[_0x8535('0x2f')][_0x8535('0x20')](_0x12ab85)[_0x8535('0x43')](function(_0x4d82ec){_0x190b45['count']=_0x4d82ec;if(_0x4e9f3e[_0x8535('0x32')][_0x8535('0x44')]){_0x410ae0[_0x8535('0x45')]=[{'all':!![]}];}return db[_0x8535('0x2f')][_0x8535('0x46')](_0x410ae0);})[_0x8535('0x43')](function(_0x5626b7){_0x190b45[_0x8535('0x4f')]=_0x5626b7;return _0x190b45;})[_0x8535('0x43')](respondWithFilteredResult(_0x24c781,_0x410ae0,_0x8535('0x50')))[_0x8535('0x47')](handleError(_0x24c781,null,_0x8535('0x50')));}; \ No newline at end of file +var _0x9573=['findAll','catch','params','keys','length','find','create','update','body','describe','rawAttributes','order','rows','getVoiceQueuesReport','html-pdf','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','redis','defaults','./voiceQueueReport.socket','register','sendStatus','end','status','offset','limit','set','Content-Range','json','apply','reject','save','then','destroy','error','name','index','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','map','type','key','VIRTUAL','field','merge','options','VoiceQueueReport','count','includeAll','include'];(function(_0x57b06d,_0x46688f){var _0x400ae4=function(_0x17dace){while(--_0x17dace){_0x57b06d['push'](_0x57b06d['shift']());}};_0x400ae4(++_0x46688f);}(_0x9573,0x156));var _0x3957=function(_0x955d5a,_0x49bb7d){_0x955d5a=_0x955d5a-0x0;var _0x36927c=_0x9573[_0x955d5a];return _0x36927c;};'use strict';var pdf=require(_0x3957('0x0'));var emlformat=require(_0x3957('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x3957('0x2'));var rp=require(_0x3957('0x3'));var moment=require(_0x3957('0x4'));var BPromise=require(_0x3957('0x5'));var Mustache=require(_0x3957('0x6'));var util=require(_0x3957('0x7'));var path=require('path');var sox=require(_0x3957('0x8'));var csv=require(_0x3957('0x9'));var ejs=require(_0x3957('0xa'));var fs=require('fs');var _=require(_0x3957('0xb'));var squel=require(_0x3957('0xc'));var crypto=require(_0x3957('0xd'));var jsforce=require(_0x3957('0xe'));var deskjs=require(_0x3957('0xf'));var toCsv=require(_0x3957('0x9'));var querystring=require(_0x3957('0x10'));var Papa=require(_0x3957('0x11'));var Redis=require('ioredis');var authService=require(_0x3957('0x12'));var qs=require(_0x3957('0x13'));var as=require(_0x3957('0x14'));var hardwareService=require(_0x3957('0x15'));var logger=require('../../config/logger')(_0x3957('0x16'));var utils=require(_0x3957('0x17'));var config=require('../../config/environment');var db=require(_0x3957('0x18'))['db'];config[_0x3957('0x19')]=_[_0x3957('0x1a')](config[_0x3957('0x19')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3957('0x19')]));require(_0x3957('0x1b'))[_0x3957('0x1c')](socket);function respondWithStatusCode(_0x233d4a,_0x295486){_0x295486=_0x295486||0xcc;return function(_0x1f66c5){if(_0x1f66c5){return _0x233d4a[_0x3957('0x1d')](_0x295486);}return _0x233d4a['status'](_0x295486)[_0x3957('0x1e')]();};}function respondWithResult(_0x35a61b,_0x17b24b){_0x17b24b=_0x17b24b||0xc8;return function(_0x27caff){if(_0x27caff){return _0x35a61b[_0x3957('0x1f')](_0x17b24b)['json'](_0x27caff);}};}function respondWithFilteredResult(_0x4a7d2f,_0x4f88f4){return function(_0x452172){if(_0x452172){var _0x3b776c=_0x452172['count'],_0x778216=_0x4f88f4['offset'],_0x3d4d8f=_0x4f88f4[_0x3957('0x20')]+_0x4f88f4[_0x3957('0x21')],_0x3fe786;if(_0x3d4d8f>=_0x3b776c){_0x3d4d8f=_0x3b776c;_0x3fe786=0xc8;}else{_0x3fe786=0xce;}_0x4a7d2f['status'](_0x3fe786);return _0x4a7d2f[_0x3957('0x22')](_0x3957('0x23'),_0x778216+'-'+_0x3d4d8f+'/'+_0x3b776c)[_0x3957('0x24')](_0x452172);}return null;};}function patchUpdates(_0x428cd6){return function(_0x42a08e){try{jsonpatch[_0x3957('0x25')](_0x42a08e,_0x428cd6,!![]);}catch(_0x4e06dc){return BPromise[_0x3957('0x26')](_0x4e06dc);}return _0x42a08e[_0x3957('0x27')]();};}function saveUpdates(_0x487103,_0x3f29fc){return function(_0x6cce94){if(_0x6cce94){return _0x6cce94['update'](_0x487103)[_0x3957('0x28')](function(_0x173164){return _0x173164;});}return null;};}function removeEntity(_0x5f0b51,_0x395c14){return function(_0x3a1ff1){if(_0x3a1ff1){return _0x3a1ff1[_0x3957('0x29')]()['then'](function(){_0x5f0b51[_0x3957('0x1f')](0xcc)[_0x3957('0x1e')]();});}};}function handleEntityNotFound(_0x4378ce,_0x17f46d){return function(_0x5ac66c){if(!_0x5ac66c){_0x4378ce[_0x3957('0x1d')](0x194);}return _0x5ac66c;};}function handleError(_0x3c4f96,_0x38b175){_0x38b175=_0x38b175||0x1f4;return function(_0x420e8b){logger[_0x3957('0x2a')](_0x420e8b['stack']);if(_0x420e8b['name']){delete _0x420e8b[_0x3957('0x2b')];}_0x3c4f96[_0x3957('0x1f')](_0x38b175)['send'](_0x420e8b);};}exports[_0x3957('0x2c')]=function(_0x53f704,_0xe6f0be){var _0x500b94={},_0x5e4ce6={},_0xf0081e={'count':0x0,'rows':[]};var _0x385155=db['VoiceQueueReport']['rawAttributes'];_0x5e4ce6[_0x3957('0x2d')]=_['keys'](_0x385155);_0x5e4ce6['query']=_['keys'](_0x53f704[_0x3957('0x2e')]);_0x5e4ce6[_0x3957('0x2f')]=_[_0x3957('0x30')](_0x5e4ce6[_0x3957('0x2d')],_0x5e4ce6['query']);_0x500b94[_0x3957('0x31')]=_[_0x3957('0x30')](_0x5e4ce6[_0x3957('0x2d')],qs[_0x3957('0x32')](_0x53f704[_0x3957('0x2e')]['fields']));_0x500b94[_0x3957('0x31')]=_0x500b94[_0x3957('0x31')]['length']?_0x500b94[_0x3957('0x31')]:_0x5e4ce6[_0x3957('0x2d')];if(!_0x53f704[_0x3957('0x2e')][_0x3957('0x33')](_0x3957('0x34'))){_0x500b94[_0x3957('0x21')]=qs[_0x3957('0x21')](_0x53f704[_0x3957('0x2e')][_0x3957('0x21')]);_0x500b94[_0x3957('0x20')]=qs[_0x3957('0x20')](_0x53f704[_0x3957('0x2e')][_0x3957('0x20')]);}_0x500b94['order']=qs[_0x3957('0x35')](_0x53f704[_0x3957('0x2e')][_0x3957('0x35')]);_0x500b94[_0x3957('0x36')]=qs[_0x3957('0x2f')](_[_0x3957('0x37')](_0x53f704[_0x3957('0x2e')],_0x5e4ce6[_0x3957('0x2f')]));if(_0x53f704[_0x3957('0x2e')][_0x3957('0x38')]){_0x500b94['where']=_['merge'](_0x500b94['where'],{'$or':_[_0x3957('0x39')](_0x385155,function(_0x36d702){if(_0x36d702[_0x3957('0x3a')][_0x3957('0x3b')]!==_0x3957('0x3c')){var _0x505062={};_0x505062[_0x36d702[_0x3957('0x3d')]]={'$like':'%'+_0x53f704['query'][_0x3957('0x38')]+'%'};return _0x505062;}})});}_0x500b94=_[_0x3957('0x3e')]({},_0x500b94,_0x53f704[_0x3957('0x3f')]);var _0x3610e2={'where':_0x500b94[_0x3957('0x36')]};return db[_0x3957('0x40')]['count'](_0x3610e2)[_0x3957('0x28')](function(_0x47cb33){_0xf0081e[_0x3957('0x41')]=_0x47cb33;if(_0x53f704[_0x3957('0x2e')][_0x3957('0x42')]){_0x500b94[_0x3957('0x43')]=[{'all':!![]}];}return db['VoiceQueueReport'][_0x3957('0x44')](_0x500b94);})[_0x3957('0x28')](function(_0x2187a4){_0xf0081e['rows']=_0x2187a4;return _0xf0081e;})[_0x3957('0x28')](respondWithFilteredResult(_0xe6f0be,_0x500b94))[_0x3957('0x45')](handleError(_0xe6f0be,null));};exports['show']=function(_0xe83e82,_0x16fdb8){var _0x3f94fe={'raw':![],'where':{'id':_0xe83e82[_0x3957('0x46')]['id']}},_0x36afe4={};_0x36afe4[_0x3957('0x2d')]=_[_0x3957('0x47')](db['VoiceQueueReport']['rawAttributes']);_0x36afe4[_0x3957('0x2e')]=_['keys'](_0xe83e82[_0x3957('0x2e')]);_0x36afe4[_0x3957('0x2f')]=_[_0x3957('0x30')](_0x36afe4[_0x3957('0x2d')],_0x36afe4[_0x3957('0x2e')]);_0x3f94fe[_0x3957('0x31')]=_['intersection'](_0x36afe4[_0x3957('0x2d')],qs[_0x3957('0x32')](_0xe83e82['query']['fields']));_0x3f94fe[_0x3957('0x31')]=_0x3f94fe[_0x3957('0x31')][_0x3957('0x48')]?_0x3f94fe['attributes']:_0x36afe4[_0x3957('0x2d')];if(_0xe83e82[_0x3957('0x2e')]['includeAll']){_0x3f94fe[_0x3957('0x43')]=[{'all':!![]}];}_0x3f94fe=_[_0x3957('0x3e')]({},_0x3f94fe,_0xe83e82['options']);return db[_0x3957('0x40')][_0x3957('0x49')](_0x3f94fe)[_0x3957('0x28')](handleEntityNotFound(_0x16fdb8,null))[_0x3957('0x28')](respondWithResult(_0x16fdb8,null))[_0x3957('0x45')](handleError(_0x16fdb8,null));};exports[_0x3957('0x4a')]=function(_0x3bbc5d,_0x11383b){return db[_0x3957('0x40')]['create'](_0x3bbc5d['body'],{})[_0x3957('0x28')](respondWithResult(_0x11383b,0xc9))[_0x3957('0x45')](handleError(_0x11383b,null));};exports[_0x3957('0x4b')]=function(_0x48f8ce,_0x182d2a){if(_0x48f8ce[_0x3957('0x4c')]['id']){delete _0x48f8ce[_0x3957('0x4c')]['id'];}return db[_0x3957('0x40')][_0x3957('0x49')]({'where':{'id':_0x48f8ce['params']['id']}})[_0x3957('0x28')](handleEntityNotFound(_0x182d2a,null))[_0x3957('0x28')](saveUpdates(_0x48f8ce['body'],null))[_0x3957('0x28')](respondWithResult(_0x182d2a,null))[_0x3957('0x45')](handleError(_0x182d2a,null));};exports[_0x3957('0x29')]=function(_0x54020c,_0x47cde8){return db[_0x3957('0x40')][_0x3957('0x49')]({'where':{'id':_0x54020c['params']['id']}})[_0x3957('0x28')](handleEntityNotFound(_0x47cde8,null))[_0x3957('0x28')](removeEntity(_0x47cde8,null))[_0x3957('0x45')](handleError(_0x47cde8,null));};exports[_0x3957('0x4d')]=function(_0x3686aa,_0xd88575){return db[_0x3957('0x40')][_0x3957('0x4d')]()[_0x3957('0x28')](respondWithResult(_0xd88575,null))[_0x3957('0x45')](handleError(_0xd88575,null));};exports['getVoiceQueuesReport']=function(_0x220383,_0x5c9a31){var _0x43e536={},_0x19441a={},_0x1eecf4={'count':0x0,'rows':[]};_0x19441a[_0x3957('0x2d')]=_[_0x3957('0x47')](db[_0x3957('0x40')][_0x3957('0x4e')]);_0x19441a[_0x3957('0x2e')]=_[_0x3957('0x47')](_0x220383[_0x3957('0x2e')]);_0x19441a['filters']=_[_0x3957('0x30')](_0x19441a[_0x3957('0x2d')],_0x19441a['query']);_0x43e536['attributes']=_[_0x3957('0x30')](_0x19441a['model'],qs[_0x3957('0x32')](_0x220383[_0x3957('0x2e')]['fields']));_0x43e536[_0x3957('0x31')]=_0x43e536['attributes'][_0x3957('0x48')]?_0x43e536[_0x3957('0x31')]:_0x19441a[_0x3957('0x2d')];if(!_0x220383['query']['hasOwnProperty']('nolimit')){_0x43e536['limit']=qs[_0x3957('0x21')](_0x220383[_0x3957('0x2e')][_0x3957('0x21')]);_0x43e536[_0x3957('0x20')]=qs[_0x3957('0x20')](_0x220383[_0x3957('0x2e')][_0x3957('0x20')]);}_0x43e536[_0x3957('0x4f')]=qs[_0x3957('0x35')](_0x220383[_0x3957('0x2e')]['sort']);_0x43e536[_0x3957('0x36')]=qs[_0x3957('0x2f')](_[_0x3957('0x37')](_0x220383['query'],_0x19441a[_0x3957('0x2f')]));if(_0x220383[_0x3957('0x2e')][_0x3957('0x38')]){_0x43e536[_0x3957('0x36')]=_['merge'](_0x43e536['where'],{'$or':_[_0x3957('0x39')](_0x43e536[_0x3957('0x31')],function(_0x100081){var _0x4c9026={};_0x4c9026[_0x100081]={'$like':'%'+_0x220383[_0x3957('0x2e')][_0x3957('0x38')]+'%'};return _0x4c9026;})});}_0x43e536=_[_0x3957('0x3e')]({},_0x43e536,_0x220383[_0x3957('0x3f')]);var _0x4fb55b={'where':_0x43e536[_0x3957('0x36')]};return db[_0x3957('0x40')]['count'](_0x4fb55b)[_0x3957('0x28')](function(_0x22ae0d){_0x1eecf4[_0x3957('0x41')]=_0x22ae0d;if(_0x220383[_0x3957('0x2e')][_0x3957('0x42')]){_0x43e536[_0x3957('0x43')]=[{'all':!![]}];}return db['VoiceQueueReport'][_0x3957('0x44')](_0x43e536);})['then'](function(_0x356adc){_0x1eecf4[_0x3957('0x50')]=_0x356adc;return _0x1eecf4;})[_0x3957('0x28')](respondWithFilteredResult(_0x5c9a31,_0x43e536,_0x3957('0x51')))['catch'](handleError(_0x5c9a31,null,_0x3957('0x51')));}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.events.js b/server/api/voiceQueueReport/voiceQueueReport.events.js index 3510c68..ee65dc3 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 _0xf52f=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','VoiceQueueReport','save','update'];(function(_0x558105,_0x4f84af){var _0x39cc0=function(_0x139060){while(--_0x139060){_0x558105['push'](_0x558105['shift']());}};_0x39cc0(++_0x4f84af);}(_0xf52f,0x113));var _0xff52=function(_0x4c1eec,_0x515aa1){_0x4c1eec=_0x4c1eec-0x0;var _0x5d8475=_0xf52f[_0x4c1eec];return _0x5d8475;};'use strict';var EventEmitter=require(_0xff52('0x0'));var VoiceQueueReport=require(_0xff52('0x1'))['db'][_0xff52('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xff52('0x3'),'afterUpdate':_0xff52('0x4'),'afterDestroy':_0xff52('0x5')};function emitEvent(_0x51bc70){return function(_0x23d018,_0x35337d,_0x4d8d79){VoiceQueueReportEvents[_0xff52('0x6')](_0x51bc70+':'+_0x23d018['id'],_0x23d018);VoiceQueueReportEvents[_0xff52('0x6')](_0x51bc70,_0x23d018);_0x4d8d79(null);};}for(var e in events){if(events[_0xff52('0x7')](e)){var event=events[e];VoiceQueueReport[_0xff52('0x8')](e,emitEvent(event));}}module[_0xff52('0x9')]=VoiceQueueReportEvents; \ No newline at end of file +var _0x63f2=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','VoiceQueueReport','setMaxListeners','save','update','remove'];(function(_0x2bba52,_0x18a293){var _0x4edc4e=function(_0x11e1c5){while(--_0x11e1c5){_0x2bba52['push'](_0x2bba52['shift']());}};_0x4edc4e(++_0x18a293);}(_0x63f2,0x19b));var _0x263f=function(_0x4cc93a,_0x69d9bf){_0x4cc93a=_0x4cc93a-0x0;var _0x462d0b=_0x63f2[_0x4cc93a];return _0x462d0b;};'use strict';var EventEmitter=require(_0x263f('0x0'));var VoiceQueueReport=require(_0x263f('0x1'))['db'][_0x263f('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0x263f('0x3')](0x0);var events={'afterCreate':_0x263f('0x4'),'afterUpdate':_0x263f('0x5'),'afterDestroy':_0x263f('0x6')};function emitEvent(_0x4cd09c){return function(_0x3e39a0,_0x5926d1,_0x1a4ead){VoiceQueueReportEvents[_0x263f('0x7')](_0x4cd09c+':'+_0x3e39a0['id'],_0x3e39a0);VoiceQueueReportEvents['emit'](_0x4cd09c,_0x3e39a0);_0x1a4ead(null);};}for(var e in events){if(events[_0x263f('0x8')](e)){var event=events[e];VoiceQueueReport[_0x263f('0x9')](e,emitEvent(event));}}module[_0x263f('0xa')]=VoiceQueueReportEvents; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.model.js b/server/api/voiceQueueReport/voiceQueueReport.model.js index 855068a..30bc32a 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 _0x2032=['./voiceQueueReport.attributes','exports','define','VoiceQueueReport','report_queue','uniqueid','calleridnum','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x2032,0xd9));var _0x2203=function(_0xd13bc2,_0x23e08c){_0xd13bc2=_0xd13bc2-0x0;var _0x5948d7=_0x2032[_0xd13bc2];return _0x5948d7;};'use strict';var _=require('lodash');var util=require(_0x2203('0x0'));var logger=require(_0x2203('0x1'))(_0x2203('0x2'));var moment=require('moment');var BPromise=require(_0x2203('0x3'));var rp=require(_0x2203('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2203('0x5'));var config=require(_0x2203('0x6'));var attributes=require(_0x2203('0x7'));module[_0x2203('0x8')]=function(_0x3f7ba1,_0x13367a){return _0x3f7ba1[_0x2203('0x9')](_0x2203('0xa'),attributes,{'tableName':_0x2203('0xb'),'paranoid':![],'indexes':[{'fields':[_0x2203('0xc')]},{'fields':[_0x2203('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5f66=['request-promise','path','../../config/environment','exports','VoiceQueueReport','report_queue','uniqueid','calleridnum','util','api','moment','bluebird'];(function(_0xefb6ce,_0x1dda4c){var _0x59ade6=function(_0x50dbe3){while(--_0x50dbe3){_0xefb6ce['push'](_0xefb6ce['shift']());}};_0x59ade6(++_0x1dda4c);}(_0x5f66,0x1a0));var _0x65f6=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0x5f66[_0x465028];return _0xb783d4;};'use strict';var _=require('lodash');var util=require(_0x65f6('0x0'));var logger=require('../../config/logger')(_0x65f6('0x1'));var moment=require(_0x65f6('0x2'));var BPromise=require(_0x65f6('0x3'));var rp=require(_0x65f6('0x4'));var fs=require('fs');var path=require(_0x65f6('0x5'));var rimraf=require('rimraf');var config=require(_0x65f6('0x6'));var attributes=require('./voiceQueueReport.attributes');module[_0x65f6('0x7')]=function(_0x22b017,_0x4ec221){return _0x22b017['define'](_0x65f6('0x8'),attributes,{'tableName':_0x65f6('0x9'),'paranoid':![],'indexes':[{'fields':[_0x65f6('0xa')]},{'fields':[_0x65f6('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.rpc.js b/server/api/voiceQueueReport/voiceQueueReport.rpc.js index 845c671..9c6ea84 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 _0x8ad0=['VoiceQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetVoiceQueueReport','VoiceQueueReport','findAll','options','raw','where','include','map','model','attributes','create','body','CreateVoiceQueueReport','UpdateVoiceQueueReport','update','limit','then','lodash','bluebird','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./voiceQueueReport.socket','register','request','info','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x1d2899,_0x34568a){var _0x37a33a=function(_0x180c00){while(--_0x180c00){_0x1d2899['push'](_0x1d2899['shift']());}};_0x37a33a(++_0x34568a);}(_0x8ad0,0xef));var _0x08ad=function(_0x6e4ea,_0x2b1663){_0x6e4ea=_0x6e4ea-0x0;var _0x4f3fdd=_0x8ad0[_0x6e4ea];return _0x4f3fdd;};'use strict';var _=require(_0x08ad('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x08ad('0x1'));var rs=require(_0x08ad('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x08ad('0x3'));var logger=require('../../config/logger')(_0x08ad('0x4'));var config=require(_0x08ad('0x5'));var jayson=require(_0x08ad('0x6'));var client=jayson['client'][_0x08ad('0x7')]({'port':0x232a});config[_0x08ad('0x8')]=_[_0x08ad('0x9')](config[_0x08ad('0x8')],{'host':_0x08ad('0xa'),'port':0x18eb});var socket=require(_0x08ad('0xb'))(new Redis(config[_0x08ad('0x8')]));require(_0x08ad('0xc'))[_0x08ad('0xd')](socket);function respondWithRpcPromise(_0x3591fa,_0xb51f83,_0x21ac8b){return new BPromise(function(_0x47c0df,_0x85b0f3){return client[_0x08ad('0xe')](_0x3591fa,_0x21ac8b)['then'](function(_0x5e095a){logger[_0x08ad('0xf')](_0x08ad('0x10'),_0xb51f83,_0x08ad('0x11'));logger[_0x08ad('0x12')](_0x08ad('0x13'),_0xb51f83,_0x08ad('0x11'),JSON[_0x08ad('0x14')](_0x5e095a));if(_0x5e095a['error']){if(_0x5e095a[_0x08ad('0x15')][_0x08ad('0x16')]===0x1f4){logger[_0x08ad('0x15')]('VoiceQueueReport,\x20%s,\x20%s',_0xb51f83,_0x5e095a[_0x08ad('0x15')][_0x08ad('0x17')]);return _0x85b0f3(_0x5e095a[_0x08ad('0x15')][_0x08ad('0x17')]);}logger[_0x08ad('0x15')](_0x08ad('0x10'),_0xb51f83,_0x5e095a[_0x08ad('0x15')][_0x08ad('0x17')]);return _0x47c0df(_0x5e095a[_0x08ad('0x15')][_0x08ad('0x17')]);}else{logger[_0x08ad('0xf')](_0x08ad('0x10'),_0xb51f83,'request\x20sent');_0x47c0df(_0x5e095a[_0x08ad('0x18')]['message']);}})[_0x08ad('0x19')](function(_0x1fa9d9){logger['error'](_0x08ad('0x10'),_0xb51f83,_0x1fa9d9);_0x85b0f3(_0x1fa9d9);});});}exports[_0x08ad('0x1a')]=function(_0x16770c){var _0x2e156b=this;return new Promise(function(_0x3230b4,_0x2e3e43){return db[_0x08ad('0x1b')][_0x08ad('0x1c')]({'raw':_0x16770c[_0x08ad('0x1d')]?_0x16770c['options'][_0x08ad('0x1e')]===undefined?!![]:![]:!![],'where':_0x16770c[_0x08ad('0x1d')]?_0x16770c[_0x08ad('0x1d')][_0x08ad('0x1f')]||null:null,'attributes':_0x16770c[_0x08ad('0x1d')]?_0x16770c[_0x08ad('0x1d')]['attributes']||null:null,'limit':_0x16770c['options']?_0x16770c['options']['limit']||null:null,'include':_0x16770c['options']?_0x16770c['options'][_0x08ad('0x20')]?_[_0x08ad('0x21')](_0x16770c['options'][_0x08ad('0x20')],function(_0x2f3c03){return{'model':db[_0x2f3c03[_0x08ad('0x22')]],'as':_0x2f3c03['as'],'attributes':_0x2f3c03['attributes'],'include':_0x2f3c03['include']?_[_0x08ad('0x21')](_0x2f3c03['include'],function(_0x39d423){return{'model':db[_0x39d423[_0x08ad('0x22')]],'as':_0x39d423['as'],'attributes':_0x39d423['attributes'],'include':_0x39d423[_0x08ad('0x20')]?_[_0x08ad('0x21')](_0x39d423[_0x08ad('0x20')],function(_0x90e419){return{'model':db[_0x90e419[_0x08ad('0x22')]],'as':_0x90e419['as'],'attributes':_0x90e419[_0x08ad('0x23')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4bfc9c){logger[_0x08ad('0xf')](_0x08ad('0x1a'),_0x16770c);logger[_0x08ad('0x12')]('GetVoiceQueueReport',_0x16770c,JSON[_0x08ad('0x14')](_0x4bfc9c));_0x3230b4(_0x4bfc9c);})[_0x08ad('0x19')](function(_0x5e1d8a){logger[_0x08ad('0x15')]('GetVoiceQueueReport',_0x5e1d8a[_0x08ad('0x17')],_0x16770c);_0x2e3e43(_0x2e156b[_0x08ad('0x15')](0x1f4,_0x5e1d8a[_0x08ad('0x17')]));});});};exports['CreateVoiceQueueReport']=function(_0x2bd11e){var _0x13cbf5=this;return new Promise(function(_0x364a26,_0x13493e){return db[_0x08ad('0x1b')][_0x08ad('0x24')](_0x2bd11e[_0x08ad('0x25')],{'raw':_0x2bd11e[_0x08ad('0x1d')]?_0x2bd11e[_0x08ad('0x1d')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x50223e){logger[_0x08ad('0xf')](_0x08ad('0x26'),_0x2bd11e);logger[_0x08ad('0x12')](_0x08ad('0x26'),_0x2bd11e,JSON[_0x08ad('0x14')](_0x50223e));_0x364a26(_0x50223e);})['catch'](function(_0x4172ee){logger[_0x08ad('0x15')](_0x08ad('0x26'),_0x4172ee[_0x08ad('0x17')],_0x2bd11e);_0x13493e(_0x13cbf5['error'](0x1f4,_0x4172ee['message']));});});};exports[_0x08ad('0x27')]=function(_0x4011df){var _0x9d51b7=this;return new Promise(function(_0xfa048,_0x5f243f){return db[_0x08ad('0x1b')][_0x08ad('0x28')](_0x4011df[_0x08ad('0x25')],{'raw':_0x4011df[_0x08ad('0x1d')]?_0x4011df['options'][_0x08ad('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4011df[_0x08ad('0x1d')]?_0x4011df[_0x08ad('0x1d')]['where']||null:null,'attributes':_0x4011df[_0x08ad('0x1d')]?_0x4011df[_0x08ad('0x1d')][_0x08ad('0x23')]||null:null,'limit':_0x4011df[_0x08ad('0x1d')]?_0x4011df['options'][_0x08ad('0x29')]||null:null})[_0x08ad('0x2a')](function(_0x2b45a2){logger['info'](_0x08ad('0x27'),_0x4011df);logger['debug']('UpdateVoiceQueueReport',_0x4011df,JSON[_0x08ad('0x14')](_0x2b45a2));_0xfa048(_0x2b45a2);})[_0x08ad('0x19')](function(_0x1f2c7a){logger['error']('UpdateVoiceQueueReport',_0x1f2c7a[_0x08ad('0x17')],_0x4011df);_0x5f243f(_0x9d51b7[_0x08ad('0x15')](0x1f4,_0x1f2c7a[_0x08ad('0x17')]));});});}; \ No newline at end of file +var _0xdb8b=['options','raw','attributes','limit','map','model','include','CreateVoiceQueueReport','create','body','update','UpdateVoiceQueueReport','util','moment','ioredis','../../mysqldb','../../config/logger','../../config/environment','client','http','redis','defaults','localhost','./voiceQueueReport.socket','request','then','info','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetVoiceQueueReport','VoiceQueueReport','findAll'];(function(_0x2064e5,_0x4f6fa2){var _0x21a233=function(_0x1b2491){while(--_0x1b2491){_0x2064e5['push'](_0x2064e5['shift']());}};_0x21a233(++_0x4f6fa2);}(_0xdb8b,0xac));var _0xbdb8=function(_0x28aed4,_0x1a4cde){_0x28aed4=_0x28aed4-0x0;var _0x144957=_0xdb8b[_0x28aed4];return _0x144957;};'use strict';var _=require('lodash');var util=require(_0xbdb8('0x0'));var moment=require(_0xbdb8('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbdb8('0x2'));var db=require(_0xbdb8('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xbdb8('0x4'))('rpc');var config=require(_0xbdb8('0x5'));var jayson=require('jayson/promise');var client=jayson[_0xbdb8('0x6')][_0xbdb8('0x7')]({'port':0x232a});config[_0xbdb8('0x8')]=_[_0xbdb8('0x9')](config[_0xbdb8('0x8')],{'host':_0xbdb8('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xbdb8('0x8')]));require(_0xbdb8('0xb'))['register'](socket);function respondWithRpcPromise(_0x4ffc6e,_0x31826d,_0x49af72){return new BPromise(function(_0x503873,_0x2f2c6e){return client[_0xbdb8('0xc')](_0x4ffc6e,_0x49af72)[_0xbdb8('0xd')](function(_0x8267b9){logger[_0xbdb8('0xe')](_0xbdb8('0xf'),_0x31826d,_0xbdb8('0x10'));logger[_0xbdb8('0x11')](_0xbdb8('0x12'),_0x31826d,_0xbdb8('0x10'),JSON[_0xbdb8('0x13')](_0x8267b9));if(_0x8267b9[_0xbdb8('0x14')]){if(_0x8267b9[_0xbdb8('0x14')][_0xbdb8('0x15')]===0x1f4){logger[_0xbdb8('0x14')](_0xbdb8('0xf'),_0x31826d,_0x8267b9[_0xbdb8('0x14')][_0xbdb8('0x16')]);return _0x2f2c6e(_0x8267b9[_0xbdb8('0x14')][_0xbdb8('0x16')]);}logger['error'](_0xbdb8('0xf'),_0x31826d,_0x8267b9[_0xbdb8('0x14')][_0xbdb8('0x16')]);return _0x503873(_0x8267b9['error']['message']);}else{logger['info'](_0xbdb8('0xf'),_0x31826d,_0xbdb8('0x10'));_0x503873(_0x8267b9[_0xbdb8('0x17')][_0xbdb8('0x16')]);}})[_0xbdb8('0x18')](function(_0x532252){logger[_0xbdb8('0x14')](_0xbdb8('0xf'),_0x31826d,_0x532252);_0x2f2c6e(_0x532252);});});}exports[_0xbdb8('0x19')]=function(_0x57e36c){var _0x3f7f46=this;return new Promise(function(_0x2f0e3e,_0x295078){return db[_0xbdb8('0x1a')][_0xbdb8('0x1b')]({'raw':_0x57e36c[_0xbdb8('0x1c')]?_0x57e36c[_0xbdb8('0x1c')][_0xbdb8('0x1d')]===undefined?!![]:![]:!![],'where':_0x57e36c['options']?_0x57e36c[_0xbdb8('0x1c')]['where']||null:null,'attributes':_0x57e36c['options']?_0x57e36c[_0xbdb8('0x1c')][_0xbdb8('0x1e')]||null:null,'limit':_0x57e36c['options']?_0x57e36c['options'][_0xbdb8('0x1f')]||null:null,'include':_0x57e36c['options']?_0x57e36c['options']['include']?_[_0xbdb8('0x20')](_0x57e36c[_0xbdb8('0x1c')]['include'],function(_0x685dcc){return{'model':db[_0x685dcc[_0xbdb8('0x21')]],'as':_0x685dcc['as'],'attributes':_0x685dcc['attributes'],'include':_0x685dcc[_0xbdb8('0x22')]?_[_0xbdb8('0x20')](_0x685dcc['include'],function(_0x1967e){return{'model':db[_0x1967e[_0xbdb8('0x21')]],'as':_0x1967e['as'],'attributes':_0x1967e['attributes'],'include':_0x1967e[_0xbdb8('0x22')]?_[_0xbdb8('0x20')](_0x1967e['include'],function(_0xc71285){return{'model':db[_0xc71285[_0xbdb8('0x21')]],'as':_0xc71285['as'],'attributes':_0xc71285[_0xbdb8('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x135509){logger['info'](_0xbdb8('0x19'),_0x57e36c);logger[_0xbdb8('0x11')](_0xbdb8('0x19'),_0x57e36c,JSON[_0xbdb8('0x13')](_0x135509));_0x2f0e3e(_0x135509);})['catch'](function(_0x4e8217){logger[_0xbdb8('0x14')](_0xbdb8('0x19'),_0x4e8217[_0xbdb8('0x16')],_0x57e36c);_0x295078(_0x3f7f46['error'](0x1f4,_0x4e8217[_0xbdb8('0x16')]));});});};exports[_0xbdb8('0x23')]=function(_0x123426){var _0x478b3b=this;return new Promise(function(_0x5702cc,_0x519625){return db[_0xbdb8('0x1a')][_0xbdb8('0x24')](_0x123426[_0xbdb8('0x25')],{'raw':_0x123426[_0xbdb8('0x1c')]?_0x123426[_0xbdb8('0x1c')][_0xbdb8('0x1d')]===undefined?!![]:![]:!![]})[_0xbdb8('0xd')](function(_0xefa9b){logger[_0xbdb8('0xe')](_0xbdb8('0x23'),_0x123426);logger[_0xbdb8('0x11')](_0xbdb8('0x23'),_0x123426,JSON['stringify'](_0xefa9b));_0x5702cc(_0xefa9b);})[_0xbdb8('0x18')](function(_0x33f0f3){logger[_0xbdb8('0x14')]('CreateVoiceQueueReport',_0x33f0f3[_0xbdb8('0x16')],_0x123426);_0x519625(_0x478b3b[_0xbdb8('0x14')](0x1f4,_0x33f0f3[_0xbdb8('0x16')]));});});};exports['UpdateVoiceQueueReport']=function(_0x397e14){var _0x1bdd9f=this;return new Promise(function(_0x46160d,_0x195f8a){return db[_0xbdb8('0x1a')][_0xbdb8('0x26')](_0x397e14['body'],{'raw':_0x397e14[_0xbdb8('0x1c')]?_0x397e14['options'][_0xbdb8('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x397e14[_0xbdb8('0x1c')]?_0x397e14['options']['where']||null:null,'attributes':_0x397e14['options']?_0x397e14[_0xbdb8('0x1c')]['attributes']||null:null,'limit':_0x397e14['options']?_0x397e14['options'][_0xbdb8('0x1f')]||null:null})[_0xbdb8('0xd')](function(_0x1e859f){logger[_0xbdb8('0xe')](_0xbdb8('0x27'),_0x397e14);logger['debug'](_0xbdb8('0x27'),_0x397e14,JSON[_0xbdb8('0x13')](_0x1e859f));_0x46160d(_0x1e859f);})['catch'](function(_0x3c14c1){logger[_0xbdb8('0x14')](_0xbdb8('0x27'),_0x3c14c1['message'],_0x397e14);_0x195f8a(_0x1bdd9f[_0xbdb8('0x14')](0x1f4,_0x3c14c1[_0xbdb8('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.socket.js b/server/api/voiceQueueReport/voiceQueueReport.socket.js index 2af606a..c6b0e80 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 _0x6a62=['removeListener','register','length','voiceQueueReport:','./voiceQueueReport.events','save','remove','emit'];(function(_0x243b59,_0x3f9495){var _0x3e1676=function(_0x354052){while(--_0x354052){_0x243b59['push'](_0x243b59['shift']());}};_0x3e1676(++_0x3f9495);}(_0x6a62,0xd4));var _0x26a6=function(_0x41436e,_0x4bdac3){_0x41436e=_0x41436e-0x0;var _0x76dc9c=_0x6a62[_0x41436e];return _0x76dc9c;};'use strict';var VoiceQueueReportEvents=require(_0x26a6('0x0'));var events=[_0x26a6('0x1'),_0x26a6('0x2'),'update'];function createListener(_0x4fb48a,_0x554aa6){return function(_0x4d8e45){_0x554aa6[_0x26a6('0x3')](_0x4fb48a,_0x4d8e45);};}function removeListener(_0x402320,_0x314cb9){return function(){VoiceQueueReportEvents[_0x26a6('0x4')](_0x402320,_0x314cb9);};}exports[_0x26a6('0x5')]=function(_0x587512){for(var _0x4a1bf3=0x0,_0x1896c1=events[_0x26a6('0x6')];_0x4a1bf3<_0x1896c1;_0x4a1bf3++){var _0xb4c249=events[_0x4a1bf3];var _0x4deeb8=createListener(_0x26a6('0x7')+_0xb4c249,_0x587512);VoiceQueueReportEvents['on'](_0xb4c249,_0x4deeb8);}}; \ No newline at end of file +var _0x65a7=['emit','removeListener','register','voiceQueueReport:','save','remove','update'];(function(_0x4df337,_0x3bf41d){var _0x4a1c4e=function(_0x248214){while(--_0x248214){_0x4df337['push'](_0x4df337['shift']());}};_0x4a1c4e(++_0x3bf41d);}(_0x65a7,0x170));var _0x765a=function(_0x269e59,_0x5cdccc){_0x269e59=_0x269e59-0x0;var _0x75b106=_0x65a7[_0x269e59];return _0x75b106;};'use strict';var VoiceQueueReportEvents=require('./voiceQueueReport.events');var events=[_0x765a('0x0'),_0x765a('0x1'),_0x765a('0x2')];function createListener(_0x12f1f0,_0x584f5b){return function(_0x26d730){_0x584f5b[_0x765a('0x3')](_0x12f1f0,_0x26d730);};}function removeListener(_0x40980b,_0x13ee95){return function(){VoiceQueueReportEvents[_0x765a('0x4')](_0x40980b,_0x13ee95);};}exports[_0x765a('0x5')]=function(_0x2d99ca){for(var _0x41e6b7=0x0,_0x50cff7=events['length'];_0x41e6b7<_0x50cff7;_0x41e6b7++){var _0x968f3c=events[_0x41e6b7];var _0x3bad6b=createListener(_0x765a('0x6')+_0x968f3c,_0x2d99ca);VoiceQueueReportEvents['on'](_0x968f3c,_0x3bad6b);}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/index.js b/server/api/voiceQueuesLog/index.js index 999046e..d9665da 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 _0xdeed=['./voiceQueuesLog.controller','get','isAuthenticated','index','/:id','show','create','update','delete','destroy','exports','multer','util','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x24259d,_0x64a194){var _0x5a701=function(_0x204516){while(--_0x204516){_0x24259d['push'](_0x24259d['shift']());}};_0x5a701(++_0x64a194);}(_0xdeed,0x1cd));var _0xddee=function(_0xa0a52a,_0x537a6e){_0xa0a52a=_0xa0a52a-0x0;var _0x2efe37=_0xdeed[_0xa0a52a];return _0x2efe37;};'use strict';var multer=require(_0xddee('0x0'));var util=require(_0xddee('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xddee('0x2'));var router=express[_0xddee('0x3')]();var auth=require(_0xddee('0x4'));var interaction=require(_0xddee('0x5'));var config=require(_0xddee('0x6'));var controller=require(_0xddee('0x7'));router[_0xddee('0x8')]('/',auth[_0xddee('0x9')](),controller[_0xddee('0xa')]);router[_0xddee('0x8')](_0xddee('0xb'),auth[_0xddee('0x9')](),controller[_0xddee('0xc')]);router['post']('/',auth[_0xddee('0x9')](),controller[_0xddee('0xd')]);router['put'](_0xddee('0xb'),auth[_0xddee('0x9')](),controller[_0xddee('0xe')]);router[_0xddee('0xf')]('/:id',auth[_0xddee('0x9')](),controller[_0xddee('0x10')]);module[_0xddee('0x11')]=router; \ No newline at end of file +var _0xaf70=['../../components/interaction/service','../../config/environment','./voiceQueuesLog.controller','get','isAuthenticated','/:id','show','update','delete','exports','multer','util','connect-timeout','express','Router','../../components/auth/service'];(function(_0x579b91,_0x1497a3){var _0x172a99=function(_0x4912e6){while(--_0x4912e6){_0x579b91['push'](_0x579b91['shift']());}};_0x172a99(++_0x1497a3);}(_0xaf70,0x17a));var _0x0af7=function(_0x557e66,_0x401ec4){_0x557e66=_0x557e66-0x0;var _0xaba0dc=_0xaf70[_0x557e66];return _0xaba0dc;};'use strict';var multer=require(_0x0af7('0x0'));var util=require(_0x0af7('0x1'));var path=require('path');var timeout=require(_0x0af7('0x2'));var express=require(_0x0af7('0x3'));var router=express[_0x0af7('0x4')]();var auth=require(_0x0af7('0x5'));var interaction=require(_0x0af7('0x6'));var config=require(_0x0af7('0x7'));var controller=require(_0x0af7('0x8'));router[_0x0af7('0x9')]('/',auth[_0x0af7('0xa')](),controller['index']);router[_0x0af7('0x9')](_0x0af7('0xb'),auth[_0x0af7('0xa')](),controller[_0x0af7('0xc')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x0af7('0xb'),auth[_0x0af7('0xa')](),controller[_0x0af7('0xd')]);router[_0x0af7('0xe')](_0x0af7('0xb'),auth[_0x0af7('0xa')](),controller['destroy']);module[_0x0af7('0xf')]=router; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js b/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js index 08df6f9..3964293 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 _0xba40=['DATE','format','YYYY-MM-DD\x20HH:mm:ss','sequelize','exports','STRING'];(function(_0xe96711,_0x3c2895){var _0x311cc5=function(_0xf27035){while(--_0xf27035){_0xe96711['push'](_0xe96711['shift']());}};_0x311cc5(++_0x3c2895);}(_0xba40,0x75));var _0x0ba4=function(_0x58c483,_0x1876ac){_0x58c483=_0x58c483-0x0;var _0x277a6e=_0xba40[_0x58c483];return _0x277a6e;};'use strict';var Sequelize=require(_0x0ba4('0x0'));var moment=require('moment');module[_0x0ba4('0x1')]={'time':{'type':Sequelize[_0x0ba4('0x2')]},'callid':{'type':Sequelize[_0x0ba4('0x2')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0x0ba4('0x2')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0x0ba4('0x2')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0x0ba4('0x2')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0x0ba4('0x2')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0x0ba4('0x2')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0x0ba4('0x2')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0x0ba4('0x2')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0x0ba4('0x3')],'allowNull':![],'defaultValue':moment()[_0x0ba4('0x4')](_0x0ba4('0x5'))}}; \ No newline at end of file +var _0x0ceb=['YYYY-MM-DD\x20HH:mm:ss','exports','STRING','DATE','format'];(function(_0x2e6ae0,_0x685573){var _0x1bf350=function(_0x41126e){while(--_0x41126e){_0x2e6ae0['push'](_0x2e6ae0['shift']());}};_0x1bf350(++_0x685573);}(_0x0ceb,0xe7));var _0xb0ce=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x0ceb[_0x19950b];return _0x3c6b41;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module[_0xb0ce('0x0')]={'time':{'type':Sequelize[_0xb0ce('0x1')]},'callid':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0xb0ce('0x1')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0xb0ce('0x1')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0xb0ce('0x1')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0xb0ce('0x1')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0xb0ce('0x2')],'allowNull':![],'defaultValue':moment()[_0xb0ce('0x3')](_0xb0ce('0x4'))}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.controller.js b/server/api/voiceQueuesLog/voiceQueuesLog.controller.js index 906efde..e910024 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 _0x49c1=['status','set','Content-Range','update','then','destroy','stack','name','index','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','key','VIRTUAL','field','VoiceQueuesLog','includeAll','include','catch','show','rawAttributes','options','find','create','body','html-pdf','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','to-csv','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','json','count','offset','limit'];(function(_0x350a01,_0x5ed763){var _0xc17c6b=function(_0x31aaec){while(--_0x31aaec){_0x350a01['push'](_0x350a01['shift']());}};_0xc17c6b(++_0x5ed763);}(_0x49c1,0xef));var _0x149c=function(_0xae346b,_0x5c3e7c){_0xae346b=_0xae346b-0x0;var _0x46ea1f=_0x49c1[_0xae346b];return _0x46ea1f;};'use strict';var pdf=require(_0x149c('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x149c('0x1'));var zipdir=require(_0x149c('0x2'));var jsonpatch=require(_0x149c('0x3'));var rp=require('request-promise');var moment=require(_0x149c('0x4'));var BPromise=require(_0x149c('0x5'));var Mustache=require('mustache');var util=require(_0x149c('0x6'));var path=require(_0x149c('0x7'));var sox=require('sox');var csv=require(_0x149c('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x149c('0x9'));var squel=require(_0x149c('0xa'));var crypto=require('crypto');var jsforce=require(_0x149c('0xb'));var deskjs=require(_0x149c('0xc'));var toCsv=require('to-csv');var querystring=require(_0x149c('0xd'));var Papa=require(_0x149c('0xe'));var Redis=require('ioredis');var authService=require(_0x149c('0xf'));var qs=require(_0x149c('0x10'));var as=require(_0x149c('0x11'));var hardwareService=require(_0x149c('0x12'));var logger=require('../../config/logger')(_0x149c('0x13'));var utils=require(_0x149c('0x14'));var config=require(_0x149c('0x15'));var db=require(_0x149c('0x16'))['db'];function respondWithStatusCode(_0x32a56c,_0x19e0b1){_0x19e0b1=_0x19e0b1||0xcc;return function(_0x1a0c32){if(_0x1a0c32){return _0x32a56c[_0x149c('0x17')](_0x19e0b1);}return _0x32a56c['status'](_0x19e0b1)[_0x149c('0x18')]();};}function respondWithResult(_0x2125a2,_0x4aee29){_0x4aee29=_0x4aee29||0xc8;return function(_0x3b247e){if(_0x3b247e){return _0x2125a2['status'](_0x4aee29)[_0x149c('0x19')](_0x3b247e);}};}function respondWithFilteredResult(_0x1d2a83,_0x177800){return function(_0x471e93){if(_0x471e93){var _0x3d851a=_0x471e93[_0x149c('0x1a')],_0x30f8c1=_0x177800['offset'],_0x3659eb=_0x177800[_0x149c('0x1b')]+_0x177800[_0x149c('0x1c')],_0x3e966f;if(_0x3659eb>=_0x3d851a){_0x3659eb=_0x3d851a;_0x3e966f=0xc8;}else{_0x3e966f=0xce;}_0x1d2a83[_0x149c('0x1d')](_0x3e966f);return _0x1d2a83[_0x149c('0x1e')](_0x149c('0x1f'),_0x30f8c1+'-'+_0x3659eb+'/'+_0x3d851a)[_0x149c('0x19')](_0x471e93);}return null;};}function patchUpdates(_0x653d6){return function(_0x3290e4){try{jsonpatch['apply'](_0x3290e4,_0x653d6,!![]);}catch(_0x1f4f40){return BPromise['reject'](_0x1f4f40);}return _0x3290e4['save']();};}function saveUpdates(_0x528337,_0x4c9b41){return function(_0x14194d){if(_0x14194d){return _0x14194d[_0x149c('0x20')](_0x528337)[_0x149c('0x21')](function(_0x37bf11){return _0x37bf11;});}return null;};}function removeEntity(_0x4e4053,_0x184924){return function(_0x4e663e){if(_0x4e663e){return _0x4e663e[_0x149c('0x22')]()[_0x149c('0x21')](function(){_0x4e4053[_0x149c('0x1d')](0xcc)[_0x149c('0x18')]();});}};}function handleEntityNotFound(_0x2cdd54,_0xb60e06){return function(_0x238363){if(!_0x238363){_0x2cdd54[_0x149c('0x17')](0x194);}return _0x238363;};}function handleError(_0x48e34c,_0x39bfee){_0x39bfee=_0x39bfee||0x1f4;return function(_0x364059){logger['error'](_0x364059[_0x149c('0x23')]);if(_0x364059[_0x149c('0x24')]){delete _0x364059[_0x149c('0x24')];}_0x48e34c[_0x149c('0x1d')](_0x39bfee)['send'](_0x364059);};}exports[_0x149c('0x25')]=function(_0x106061,_0x3a9090){var _0x1ba032={},_0x149705={},_0x44f3c6={'count':0x0,'rows':[]};var _0x16f5d6=db['VoiceQueuesLog']['rawAttributes'];_0x149705[_0x149c('0x26')]=_[_0x149c('0x27')](_0x16f5d6);_0x149705[_0x149c('0x28')]=_['keys'](_0x106061[_0x149c('0x28')]);_0x149705[_0x149c('0x29')]=_[_0x149c('0x2a')](_0x149705[_0x149c('0x26')],_0x149705['query']);_0x1ba032[_0x149c('0x2b')]=_[_0x149c('0x2a')](_0x149705[_0x149c('0x26')],qs[_0x149c('0x2c')](_0x106061[_0x149c('0x28')]['fields']));_0x1ba032[_0x149c('0x2b')]=_0x1ba032['attributes'][_0x149c('0x2d')]?_0x1ba032[_0x149c('0x2b')]:_0x149705[_0x149c('0x26')];if(!_0x106061[_0x149c('0x28')][_0x149c('0x2e')](_0x149c('0x2f'))){_0x1ba032[_0x149c('0x1c')]=qs['limit'](_0x106061[_0x149c('0x28')]['limit']);_0x1ba032[_0x149c('0x1b')]=qs['offset'](_0x106061[_0x149c('0x28')]['offset']);}_0x1ba032[_0x149c('0x30')]=qs[_0x149c('0x31')](_0x106061['query']['sort']);_0x1ba032[_0x149c('0x32')]=qs[_0x149c('0x29')](_['pick'](_0x106061['query'],_0x149705[_0x149c('0x29')]));if(_0x106061[_0x149c('0x28')][_0x149c('0x33')]){_0x1ba032[_0x149c('0x32')]=_[_0x149c('0x34')](_0x1ba032[_0x149c('0x32')],{'$or':_['map'](_0x16f5d6,function(_0x36f9f9){if(_0x36f9f9[_0x149c('0x35')][_0x149c('0x36')]!==_0x149c('0x37')){var _0x52265d={};_0x52265d[_0x36f9f9[_0x149c('0x38')]]={'$like':'%'+_0x106061[_0x149c('0x28')][_0x149c('0x33')]+'%'};return _0x52265d;}})});}_0x1ba032=_[_0x149c('0x34')]({},_0x1ba032,_0x106061['options']);var _0x4aed72={'where':_0x1ba032[_0x149c('0x32')]};return db[_0x149c('0x39')]['count'](_0x4aed72)[_0x149c('0x21')](function(_0x4e6a3f){_0x44f3c6[_0x149c('0x1a')]=_0x4e6a3f;if(_0x106061[_0x149c('0x28')][_0x149c('0x3a')]){_0x1ba032[_0x149c('0x3b')]=[{'all':!![]}];}return db[_0x149c('0x39')]['findAll'](_0x1ba032);})[_0x149c('0x21')](function(_0x140e0f){_0x44f3c6['rows']=_0x140e0f;return _0x44f3c6;})['then'](respondWithFilteredResult(_0x3a9090,_0x1ba032))[_0x149c('0x3c')](handleError(_0x3a9090,null));};exports[_0x149c('0x3d')]=function(_0x5a3f90,_0x26684c){var _0x1756e5={'raw':!![],'where':{'id':_0x5a3f90['params']['id']}},_0x29f41c={};_0x29f41c['model']=_[_0x149c('0x27')](db[_0x149c('0x39')][_0x149c('0x3e')]);_0x29f41c['query']=_[_0x149c('0x27')](_0x5a3f90['query']);_0x29f41c['filters']=_[_0x149c('0x2a')](_0x29f41c[_0x149c('0x26')],_0x29f41c[_0x149c('0x28')]);_0x1756e5[_0x149c('0x2b')]=_[_0x149c('0x2a')](_0x29f41c[_0x149c('0x26')],qs['fields'](_0x5a3f90[_0x149c('0x28')][_0x149c('0x2c')]));_0x1756e5[_0x149c('0x2b')]=_0x1756e5[_0x149c('0x2b')][_0x149c('0x2d')]?_0x1756e5[_0x149c('0x2b')]:_0x29f41c[_0x149c('0x26')];if(_0x5a3f90[_0x149c('0x28')][_0x149c('0x3a')]){_0x1756e5[_0x149c('0x3b')]=[{'all':!![]}];}_0x1756e5=_['merge']({},_0x1756e5,_0x5a3f90[_0x149c('0x3f')]);return db[_0x149c('0x39')][_0x149c('0x40')](_0x1756e5)[_0x149c('0x21')](handleEntityNotFound(_0x26684c,null))[_0x149c('0x21')](respondWithResult(_0x26684c,null))['catch'](handleError(_0x26684c,null));};exports['create']=function(_0xffbf32,_0x568b5b){return db[_0x149c('0x39')][_0x149c('0x41')](_0xffbf32['body'],{})['then'](respondWithResult(_0x568b5b,0xc9))[_0x149c('0x3c')](handleError(_0x568b5b,null));};exports[_0x149c('0x20')]=function(_0x54ab08,_0x145d2a){if(_0x54ab08['body']['id']){delete _0x54ab08['body']['id'];}return db[_0x149c('0x39')][_0x149c('0x40')]({'where':{'id':_0x54ab08['params']['id']}})['then'](handleEntityNotFound(_0x145d2a,null))['then'](saveUpdates(_0x54ab08[_0x149c('0x42')],null))[_0x149c('0x21')](respondWithResult(_0x145d2a,null))[_0x149c('0x3c')](handleError(_0x145d2a,null));};exports[_0x149c('0x22')]=function(_0x54a99b,_0x583092){return db[_0x149c('0x39')][_0x149c('0x40')]({'where':{'id':_0x54a99b['params']['id']}})[_0x149c('0x21')](handleEntityNotFound(_0x583092,null))[_0x149c('0x21')](removeEntity(_0x583092,null))['catch'](handleError(_0x583092,null));}; \ No newline at end of file +var _0x2d73=['stack','name','send','index','VoiceQueuesLog','rawAttributes','model','keys','query','attributes','intersection','fields','nolimit','limit','order','sort','where','filters','pick','map','type','key','VIRTUAL','field','merge','options','includeAll','findAll','rows','catch','show','length','include','find','create','body','eml-format','zip-dir','fast-json-patch','request-promise','util','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','status','end','json','count','offset','set','Content-Range','apply','reject','save','update','then','sendStatus','error'];(function(_0x19f2bf,_0x102d47){var _0x41de67=function(_0x393c97){while(--_0x393c97){_0x19f2bf['push'](_0x19f2bf['shift']());}};_0x41de67(++_0x102d47);}(_0x2d73,0x191));var _0x32d7=function(_0x20e295,_0x308599){_0x20e295=_0x20e295-0x0;var _0x33ffbe=_0x2d73[_0x20e295];return _0x33ffbe;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x32d7('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x32d7('0x1'));var jsonpatch=require(_0x32d7('0x2'));var rp=require(_0x32d7('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x32d7('0x4'));var path=require(_0x32d7('0x5'));var sox=require('sox');var csv=require(_0x32d7('0x6'));var ejs=require(_0x32d7('0x7'));var fs=require('fs');var _=require('lodash');var squel=require(_0x32d7('0x8'));var crypto=require(_0x32d7('0x9'));var jsforce=require(_0x32d7('0xa'));var deskjs=require(_0x32d7('0xb'));var toCsv=require(_0x32d7('0x6'));var querystring=require(_0x32d7('0xc'));var Papa=require(_0x32d7('0xd'));var Redis=require(_0x32d7('0xe'));var authService=require(_0x32d7('0xf'));var qs=require(_0x32d7('0x10'));var as=require(_0x32d7('0x11'));var hardwareService=require(_0x32d7('0x12'));var logger=require(_0x32d7('0x13'))(_0x32d7('0x14'));var utils=require(_0x32d7('0x15'));var config=require('../../config/environment');var db=require(_0x32d7('0x16'))['db'];function respondWithStatusCode(_0x5e4deb,_0x91a620){_0x91a620=_0x91a620||0xcc;return function(_0x4e0ce1){if(_0x4e0ce1){return _0x5e4deb['sendStatus'](_0x91a620);}return _0x5e4deb[_0x32d7('0x17')](_0x91a620)[_0x32d7('0x18')]();};}function respondWithResult(_0x400fb7,_0x511e51){_0x511e51=_0x511e51||0xc8;return function(_0x48eac0){if(_0x48eac0){return _0x400fb7[_0x32d7('0x17')](_0x511e51)[_0x32d7('0x19')](_0x48eac0);}};}function respondWithFilteredResult(_0x388ee2,_0x53c001){return function(_0x5161fc){if(_0x5161fc){var _0x223661=_0x5161fc[_0x32d7('0x1a')],_0x5cfb53=_0x53c001[_0x32d7('0x1b')],_0x31442a=_0x53c001[_0x32d7('0x1b')]+_0x53c001['limit'],_0xe7967a;if(_0x31442a>=_0x223661){_0x31442a=_0x223661;_0xe7967a=0xc8;}else{_0xe7967a=0xce;}_0x388ee2[_0x32d7('0x17')](_0xe7967a);return _0x388ee2[_0x32d7('0x1c')](_0x32d7('0x1d'),_0x5cfb53+'-'+_0x31442a+'/'+_0x223661)[_0x32d7('0x19')](_0x5161fc);}return null;};}function patchUpdates(_0x38247b){return function(_0x3dda4c){try{jsonpatch[_0x32d7('0x1e')](_0x3dda4c,_0x38247b,!![]);}catch(_0x1f3ef8){return BPromise[_0x32d7('0x1f')](_0x1f3ef8);}return _0x3dda4c[_0x32d7('0x20')]();};}function saveUpdates(_0x54dc4c,_0x3fd9c4){return function(_0x3d5bd6){if(_0x3d5bd6){return _0x3d5bd6[_0x32d7('0x21')](_0x54dc4c)[_0x32d7('0x22')](function(_0x70f507){return _0x70f507;});}return null;};}function removeEntity(_0xe57ddf,_0x4a91a2){return function(_0x362d1b){if(_0x362d1b){return _0x362d1b['destroy']()['then'](function(){_0xe57ddf[_0x32d7('0x17')](0xcc)[_0x32d7('0x18')]();});}};}function handleEntityNotFound(_0x47ee5b,_0x3e4882){return function(_0x5bd1a6){if(!_0x5bd1a6){_0x47ee5b[_0x32d7('0x23')](0x194);}return _0x5bd1a6;};}function handleError(_0x1d62ac,_0x518fb4){_0x518fb4=_0x518fb4||0x1f4;return function(_0x599e64){logger[_0x32d7('0x24')](_0x599e64[_0x32d7('0x25')]);if(_0x599e64['name']){delete _0x599e64[_0x32d7('0x26')];}_0x1d62ac[_0x32d7('0x17')](_0x518fb4)[_0x32d7('0x27')](_0x599e64);};}exports[_0x32d7('0x28')]=function(_0x3ac162,_0x272844){var _0x181042={},_0x11393c={},_0x88718f={'count':0x0,'rows':[]};var _0x434c96=db[_0x32d7('0x29')][_0x32d7('0x2a')];_0x11393c[_0x32d7('0x2b')]=_[_0x32d7('0x2c')](_0x434c96);_0x11393c['query']=_[_0x32d7('0x2c')](_0x3ac162[_0x32d7('0x2d')]);_0x11393c['filters']=_['intersection'](_0x11393c[_0x32d7('0x2b')],_0x11393c['query']);_0x181042[_0x32d7('0x2e')]=_[_0x32d7('0x2f')](_0x11393c['model'],qs[_0x32d7('0x30')](_0x3ac162[_0x32d7('0x2d')]['fields']));_0x181042[_0x32d7('0x2e')]=_0x181042[_0x32d7('0x2e')]['length']?_0x181042[_0x32d7('0x2e')]:_0x11393c[_0x32d7('0x2b')];if(!_0x3ac162[_0x32d7('0x2d')]['hasOwnProperty'](_0x32d7('0x31'))){_0x181042[_0x32d7('0x32')]=qs[_0x32d7('0x32')](_0x3ac162[_0x32d7('0x2d')][_0x32d7('0x32')]);_0x181042[_0x32d7('0x1b')]=qs['offset'](_0x3ac162['query'][_0x32d7('0x1b')]);}_0x181042[_0x32d7('0x33')]=qs['sort'](_0x3ac162['query'][_0x32d7('0x34')]);_0x181042[_0x32d7('0x35')]=qs[_0x32d7('0x36')](_[_0x32d7('0x37')](_0x3ac162['query'],_0x11393c[_0x32d7('0x36')]));if(_0x3ac162['query']['filter']){_0x181042[_0x32d7('0x35')]=_['merge'](_0x181042[_0x32d7('0x35')],{'$or':_[_0x32d7('0x38')](_0x434c96,function(_0x2af0f5){if(_0x2af0f5[_0x32d7('0x39')][_0x32d7('0x3a')]!==_0x32d7('0x3b')){var _0x545267={};_0x545267[_0x2af0f5[_0x32d7('0x3c')]]={'$like':'%'+_0x3ac162[_0x32d7('0x2d')]['filter']+'%'};return _0x545267;}})});}_0x181042=_[_0x32d7('0x3d')]({},_0x181042,_0x3ac162[_0x32d7('0x3e')]);var _0x3a4621={'where':_0x181042['where']};return db[_0x32d7('0x29')][_0x32d7('0x1a')](_0x3a4621)[_0x32d7('0x22')](function(_0x1a97fd){_0x88718f[_0x32d7('0x1a')]=_0x1a97fd;if(_0x3ac162['query'][_0x32d7('0x3f')]){_0x181042['include']=[{'all':!![]}];}return db[_0x32d7('0x29')][_0x32d7('0x40')](_0x181042);})[_0x32d7('0x22')](function(_0x194aa9){_0x88718f[_0x32d7('0x41')]=_0x194aa9;return _0x88718f;})[_0x32d7('0x22')](respondWithFilteredResult(_0x272844,_0x181042))[_0x32d7('0x42')](handleError(_0x272844,null));};exports[_0x32d7('0x43')]=function(_0x44d41a,_0xf92893){var _0x29c4bd={'raw':!![],'where':{'id':_0x44d41a['params']['id']}},_0x514722={};_0x514722[_0x32d7('0x2b')]=_[_0x32d7('0x2c')](db[_0x32d7('0x29')][_0x32d7('0x2a')]);_0x514722[_0x32d7('0x2d')]=_[_0x32d7('0x2c')](_0x44d41a[_0x32d7('0x2d')]);_0x514722['filters']=_[_0x32d7('0x2f')](_0x514722[_0x32d7('0x2b')],_0x514722['query']);_0x29c4bd[_0x32d7('0x2e')]=_[_0x32d7('0x2f')](_0x514722[_0x32d7('0x2b')],qs[_0x32d7('0x30')](_0x44d41a[_0x32d7('0x2d')][_0x32d7('0x30')]));_0x29c4bd[_0x32d7('0x2e')]=_0x29c4bd[_0x32d7('0x2e')][_0x32d7('0x44')]?_0x29c4bd['attributes']:_0x514722[_0x32d7('0x2b')];if(_0x44d41a[_0x32d7('0x2d')][_0x32d7('0x3f')]){_0x29c4bd[_0x32d7('0x45')]=[{'all':!![]}];}_0x29c4bd=_[_0x32d7('0x3d')]({},_0x29c4bd,_0x44d41a[_0x32d7('0x3e')]);return db[_0x32d7('0x29')][_0x32d7('0x46')](_0x29c4bd)['then'](handleEntityNotFound(_0xf92893,null))[_0x32d7('0x22')](respondWithResult(_0xf92893,null))[_0x32d7('0x42')](handleError(_0xf92893,null));};exports[_0x32d7('0x47')]=function(_0x46ef44,_0x1d494a){return db[_0x32d7('0x29')][_0x32d7('0x47')](_0x46ef44[_0x32d7('0x48')],{})[_0x32d7('0x22')](respondWithResult(_0x1d494a,0xc9))['catch'](handleError(_0x1d494a,null));};exports[_0x32d7('0x21')]=function(_0x3c3806,_0x5693a9){if(_0x3c3806[_0x32d7('0x48')]['id']){delete _0x3c3806['body']['id'];}return db[_0x32d7('0x29')][_0x32d7('0x46')]({'where':{'id':_0x3c3806['params']['id']}})[_0x32d7('0x22')](handleEntityNotFound(_0x5693a9,null))[_0x32d7('0x22')](saveUpdates(_0x3c3806['body'],null))[_0x32d7('0x22')](respondWithResult(_0x5693a9,null))[_0x32d7('0x42')](handleError(_0x5693a9,null));};exports['destroy']=function(_0xf7957f,_0x537640){return db[_0x32d7('0x29')]['find']({'where':{'id':_0xf7957f['params']['id']}})[_0x32d7('0x22')](handleEntityNotFound(_0x537640,null))['then'](removeEntity(_0x537640,null))[_0x32d7('0x42')](handleError(_0x537640,null));}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.model.js b/server/api/voiceQueuesLog/voiceQueuesLog.model.js index e781d1c..c10d1d7 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 _0xf6c2=['lodash','util','../../config/logger','api','moment','bluebird','path','../../config/environment','./voiceQueuesLog.attributes','exports','define','VoiceQueuesLog','voice_queues_log','event_dtm'];(function(_0x350ef8,_0x25e237){var _0x402217=function(_0x5cb66c){while(--_0x5cb66c){_0x350ef8['push'](_0x350ef8['shift']());}};_0x402217(++_0x25e237);}(_0xf6c2,0x1ce));var _0x2f6c=function(_0xaa0309,_0x1c8008){_0xaa0309=_0xaa0309-0x0;var _0x5de7ce=_0xf6c2[_0xaa0309];return _0x5de7ce;};'use strict';var _=require(_0x2f6c('0x0'));var util=require(_0x2f6c('0x1'));var logger=require(_0x2f6c('0x2'))(_0x2f6c('0x3'));var moment=require(_0x2f6c('0x4'));var BPromise=require(_0x2f6c('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2f6c('0x6'));var rimraf=require('rimraf');var config=require(_0x2f6c('0x7'));var attributes=require(_0x2f6c('0x8'));module[_0x2f6c('0x9')]=function(_0x5576f0,_0x2d4928){return _0x5576f0[_0x2f6c('0xa')](_0x2f6c('0xb'),attributes,{'tableName':_0x2f6c('0xc'),'paranoid':![],'indexes':[{'name':_0x2f6c('0xd'),'fields':['event','dtm']}],'timestamps':![]});}; \ No newline at end of file +var _0x2efb=['event','dtm','lodash','util','../../config/logger','api','moment','bluebird','rimraf','./voiceQueuesLog.attributes','define','VoiceQueuesLog','voice_queues_log','event_dtm'];(function(_0x47a7d0,_0x4e182d){var _0xb9bd08=function(_0x588ee2){while(--_0x588ee2){_0x47a7d0['push'](_0x47a7d0['shift']());}};_0xb9bd08(++_0x4e182d);}(_0x2efb,0x1de));var _0xb2ef=function(_0x2dfa01,_0x505dbf){_0x2dfa01=_0x2dfa01-0x0;var _0x3aa8eb=_0x2efb[_0x2dfa01];return _0x3aa8eb;};'use strict';var _=require(_0xb2ef('0x0'));var util=require(_0xb2ef('0x1'));var logger=require(_0xb2ef('0x2'))(_0xb2ef('0x3'));var moment=require(_0xb2ef('0x4'));var BPromise=require(_0xb2ef('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xb2ef('0x6'));var config=require('../../config/environment');var attributes=require(_0xb2ef('0x7'));module['exports']=function(_0x800b2a,_0x2a991f){return _0x800b2a[_0xb2ef('0x8')](_0xb2ef('0x9'),attributes,{'tableName':_0xb2ef('0xa'),'paranoid':![],'indexes':[{'name':_0xb2ef('0xb'),'fields':[_0xb2ef('0xc'),_0xb2ef('0xd')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js b/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js index 606b124..0dd974e 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 _0x777d=['stringify','error','message','result','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/environment','client','request','then','info','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s'];(function(_0x17632c,_0x3cbe9d){var _0x57206e=function(_0x14b365){while(--_0x14b365){_0x17632c['push'](_0x17632c['shift']());}};_0x57206e(++_0x3cbe9d);}(_0x777d,0xe9));var _0xd777=function(_0x5ce8b9,_0x5cded8){_0x5ce8b9=_0x5ce8b9-0x0;var _0xe34be0=_0x777d[_0x5ce8b9];return _0xe34be0;};'use strict';var _=require('lodash');var util=require(_0xd777('0x0'));var moment=require(_0xd777('0x1'));var BPromise=require(_0xd777('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd777('0x3'));var db=require(_0xd777('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xd777('0x5'));var jayson=require('jayson/promise');var client=jayson[_0xd777('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0xc7c954,_0x5d1a5f,_0x57d67f){return new BPromise(function(_0x49d55d,_0x197296){return client[_0xd777('0x7')](_0xc7c954,_0x57d67f)[_0xd777('0x8')](function(_0x25450d){logger[_0xd777('0x9')](_0xd777('0xa'),_0x5d1a5f,_0xd777('0xb'));logger[_0xd777('0xc')](_0xd777('0xd'),_0x5d1a5f,_0xd777('0xb'),JSON[_0xd777('0xe')](_0x25450d));if(_0x25450d[_0xd777('0xf')]){if(_0x25450d[_0xd777('0xf')]['code']===0x1f4){logger['error'](_0xd777('0xa'),_0x5d1a5f,_0x25450d['error'][_0xd777('0x10')]);return _0x197296(_0x25450d[_0xd777('0xf')][_0xd777('0x10')]);}logger[_0xd777('0xf')](_0xd777('0xa'),_0x5d1a5f,_0x25450d['error'][_0xd777('0x10')]);return _0x49d55d(_0x25450d['error'][_0xd777('0x10')]);}else{logger[_0xd777('0x9')](_0xd777('0xa'),_0x5d1a5f,_0xd777('0xb'));_0x49d55d(_0x25450d[_0xd777('0x11')]['message']);}})[_0xd777('0x12')](function(_0x4b3d52){logger[_0xd777('0xf')]('VoiceQueuesLog,\x20%s,\x20%s',_0x5d1a5f,_0x4b3d52);_0x197296(_0x4b3d52);});});} \ No newline at end of file +var _0x7fce=['VoiceQueuesLog,\x20%s,\x20%s','message','result','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/logger','rpc','client','then','info','request\x20sent','debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','error'];(function(_0x2e6776,_0x1ea7c7){var _0x3423bf=function(_0x4fe872){while(--_0x4fe872){_0x2e6776['push'](_0x2e6776['shift']());}};_0x3423bf(++_0x1ea7c7);}(_0x7fce,0xdc));var _0xe7fc=function(_0x2f2152,_0x4e0bc7){_0x2f2152=_0x2f2152-0x0;var _0x21d6e4=_0x7fce[_0x2f2152];return _0x21d6e4;};'use strict';var _=require(_0xe7fc('0x0'));var util=require(_0xe7fc('0x1'));var moment=require(_0xe7fc('0x2'));var BPromise=require('bluebird');var rs=require(_0xe7fc('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe7fc('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xe7fc('0x5'))(_0xe7fc('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xe7fc('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4665f6,_0x161dca,_0x296b2e){return new BPromise(function(_0x19eeef,_0x22fabf){return client['request'](_0x4665f6,_0x296b2e)[_0xe7fc('0x8')](function(_0x4a1209){logger[_0xe7fc('0x9')]('VoiceQueuesLog,\x20%s,\x20%s',_0x161dca,_0xe7fc('0xa'));logger[_0xe7fc('0xb')](_0xe7fc('0xc'),_0x161dca,_0xe7fc('0xa'),JSON['stringify'](_0x4a1209));if(_0x4a1209[_0xe7fc('0xd')]){if(_0x4a1209[_0xe7fc('0xd')]['code']===0x1f4){logger['error'](_0xe7fc('0xe'),_0x161dca,_0x4a1209['error'][_0xe7fc('0xf')]);return _0x22fabf(_0x4a1209['error']['message']);}logger[_0xe7fc('0xd')](_0xe7fc('0xe'),_0x161dca,_0x4a1209[_0xe7fc('0xd')][_0xe7fc('0xf')]);return _0x19eeef(_0x4a1209[_0xe7fc('0xd')]['message']);}else{logger[_0xe7fc('0x9')]('VoiceQueuesLog,\x20%s,\x20%s',_0x161dca,'request\x20sent');_0x19eeef(_0x4a1209[_0xe7fc('0x10')][_0xe7fc('0xf')]);}})[_0xe7fc('0x11')](function(_0x3a44a6){logger['error']('VoiceQueuesLog,\x20%s,\x20%s',_0x161dca,_0x3a44a6);_0x22fabf(_0x3a44a6);});});} \ No newline at end of file diff --git a/server/api/voiceRecording/index.js b/server/api/voiceRecording/index.js index ae5701a..b260736 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 _0xd80e=['./voiceRecording.controller','get','describe','/:id','isAuthenticated','show','download','/:id/downloads','post','create','put','update','delete','exports','multer','path','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xd80e,0x80));var _0xed80=function(_0x1ba925,_0x327cab){_0x1ba925=_0x1ba925-0x0;var _0x33a5bf=_0xd80e[_0x1ba925];return _0x33a5bf;};'use strict';var multer=require(_0xed80('0x0'));var util=require('util');var path=require(_0xed80('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var auth=require(_0xed80('0x2'));var interaction=require(_0xed80('0x3'));var config=require(_0xed80('0x4'));var controller=require(_0xed80('0x5'));router[_0xed80('0x6')]('/',auth['isAuthenticated'](),controller['index']);router[_0xed80('0x6')]('/describe',auth['isAuthenticated'](),controller[_0xed80('0x7')]);router['get'](_0xed80('0x8'),auth[_0xed80('0x9')](),controller[_0xed80('0xa')]);router[_0xed80('0x6')]('/:id/download',auth[_0xed80('0x9')](),controller[_0xed80('0xb')]);router['get'](_0xed80('0xc'),controller['downloads']);router[_0xed80('0xd')]('/',auth['isAuthenticated'](),controller[_0xed80('0xe')]);router[_0xed80('0xf')](_0xed80('0x8'),auth[_0xed80('0x9')](),controller[_0xed80('0x10')]);router[_0xed80('0x11')](_0xed80('0x8'),auth[_0xed80('0x9')](),controller['destroy']);module[_0xed80('0x12')]=router; \ No newline at end of file +var _0x5f20=['create','put','delete','destroy','exports','connect-timeout','../../components/interaction/service','./voiceRecording.controller','isAuthenticated','index','/describe','get','/:id','show','/:id/download','download','/:id/downloads','downloads','post'];(function(_0x4c12ec,_0x2e9103){var _0x3ae42c=function(_0x5a728f){while(--_0x5a728f){_0x4c12ec['push'](_0x4c12ec['shift']());}};_0x3ae42c(++_0x2e9103);}(_0x5f20,0xe9));var _0x05f2=function(_0x4a7631,_0x2c85b9){_0x4a7631=_0x4a7631-0x0;var _0x1a5a6f=_0x5f20[_0x4a7631];return _0x1a5a6f;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x05f2('0x0'));var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x05f2('0x1'));var config=require('../../config/environment');var controller=require(_0x05f2('0x2'));router['get']('/',auth[_0x05f2('0x3')](),controller[_0x05f2('0x4')]);router['get'](_0x05f2('0x5'),auth[_0x05f2('0x3')](),controller['describe']);router[_0x05f2('0x6')](_0x05f2('0x7'),auth['isAuthenticated'](),controller[_0x05f2('0x8')]);router[_0x05f2('0x6')](_0x05f2('0x9'),auth[_0x05f2('0x3')](),controller[_0x05f2('0xa')]);router[_0x05f2('0x6')](_0x05f2('0xb'),controller[_0x05f2('0xc')]);router[_0x05f2('0xd')]('/',auth[_0x05f2('0x3')](),controller[_0x05f2('0xe')]);router[_0x05f2('0xf')](_0x05f2('0x7'),auth['isAuthenticated'](),controller['update']);router[_0x05f2('0x10')]('/:id',auth[_0x05f2('0x3')](),controller[_0x05f2('0x11')]);module[_0x05f2('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.attributes.js b/server/api/voiceRecording/voiceRecording.attributes.js index 727776e..9d9f0e9 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 _0x9ead=['STRING','channel','setDataValue','membername','split','DATE','format','MM-DD-YYYY\x20HH:mm','toString','updatedAt','sequelize','moment','exports','VIRTUAL','getDataValue','value','extname'];(function(_0x5ccc38,_0x563d59){var _0xa014a=function(_0x23b439){while(--_0x23b439){_0x5ccc38['push'](_0x5ccc38['shift']());}};_0xa014a(++_0x563d59);}(_0x9ead,0x191));var _0xd9ea=function(_0x997222,_0x5c0bd8){_0x997222=_0x997222-0x0;var _0x4b8869=_0x9ead[_0x997222];return _0x4b8869;};'use strict';var Sequelize=require(_0xd9ea('0x0'));var moment=require(_0xd9ea('0x1'));var path=require('path');module[_0xd9ea('0x2')]={'format':{'type':Sequelize[_0xd9ea('0x3')],'get':function(){return this[_0xd9ea('0x4')](_0xd9ea('0x5'))?path[_0xd9ea('0x6')](this[_0xd9ea('0x4')](_0xd9ea('0x5'))):undefined;}},'uniqueid':{'type':Sequelize[_0xd9ea('0x7')]},'channel':{'type':Sequelize[_0xd9ea('0x7')],'set':function(_0x1f0bc7){if(_0x1f0bc7){this['setDataValue'](_0xd9ea('0x8'),_0x1f0bc7);this[_0xd9ea('0x9')](_0xd9ea('0xa'),_0x1f0bc7[_0xd9ea('0xb')](/\/|-/)[0x1]);}}},'membername':{'type':Sequelize[_0xd9ea('0x7')]},'calleridnum':{'type':Sequelize[_0xd9ea('0x7')]},'calleridname':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0xd9ea('0x7')]},'connectedlinename':{'type':Sequelize[_0xd9ea('0x7')]},'accountcode':{'type':Sequelize[_0xd9ea('0x7')]},'context':{'type':Sequelize[_0xd9ea('0x7')]},'exten':{'type':Sequelize[_0xd9ea('0x7')]},'value':{'type':Sequelize[_0xd9ea('0x7')]},'type':{'type':Sequelize['STRING']},'rating':{'type':Sequelize['INTEGER'],'validate':{'max':0x5,'min':0x0}},'queue':{'type':Sequelize['STRING']},'userDisposition':{'type':Sequelize['STRING']},'createdAt':{'type':Sequelize[_0xd9ea('0xc')],'get':function(){return moment(this[_0xd9ea('0x4')]('createdAt'))[_0xd9ea('0xd')](_0xd9ea('0xe'))[_0xd9ea('0xf')]();}},'updatedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0xd9ea('0x4')](_0xd9ea('0x10')))[_0xd9ea('0xd')]('MM-DD-YYYY\x20HH:mm')['toString']();}}}; \ No newline at end of file +var _0xd04c=['DATE','createdAt','format','MM-DD-YYYY\x20HH:mm','toString','updatedAt','moment','path','exports','VIRTUAL','getDataValue','extname','value','STRING','setDataValue','channel','membername','split'];(function(_0x404ac4,_0x12f63e){var _0x5d3e7b=function(_0x5a57bf){while(--_0x5a57bf){_0x404ac4['push'](_0x404ac4['shift']());}};_0x5d3e7b(++_0x12f63e);}(_0xd04c,0x114));var _0xcd04=function(_0x3c2239,_0x18328a){_0x3c2239=_0x3c2239-0x0;var _0xb6d261=_0xd04c[_0x3c2239];return _0xb6d261;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xcd04('0x0'));var path=require(_0xcd04('0x1'));module[_0xcd04('0x2')]={'format':{'type':Sequelize[_0xcd04('0x3')],'get':function(){return this[_0xcd04('0x4')]('value')?path[_0xcd04('0x5')](this['getDataValue'](_0xcd04('0x6'))):undefined;}},'uniqueid':{'type':Sequelize[_0xcd04('0x7')]},'channel':{'type':Sequelize[_0xcd04('0x7')],'set':function(_0x1333d){if(_0x1333d){this[_0xcd04('0x8')](_0xcd04('0x9'),_0x1333d);this[_0xcd04('0x8')](_0xcd04('0xa'),_0x1333d[_0xcd04('0xb')](/\/|-/)[0x1]);}}},'membername':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xcd04('0x7')]},'calleridname':{'type':Sequelize[_0xcd04('0x7')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0xcd04('0x7')]},'accountcode':{'type':Sequelize[_0xcd04('0x7')]},'context':{'type':Sequelize[_0xcd04('0x7')]},'exten':{'type':Sequelize['STRING']},'value':{'type':Sequelize[_0xcd04('0x7')]},'type':{'type':Sequelize[_0xcd04('0x7')]},'rating':{'type':Sequelize['INTEGER'],'validate':{'max':0x5,'min':0x0}},'queue':{'type':Sequelize['STRING']},'userDisposition':{'type':Sequelize[_0xcd04('0x7')]},'createdAt':{'type':Sequelize[_0xcd04('0xc')],'get':function(){return moment(this[_0xcd04('0x4')](_0xcd04('0xd')))[_0xcd04('0xe')](_0xcd04('0xf'))[_0xcd04('0x10')]();}},'updatedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0xcd04('0x4')](_0xcd04('0x11')))[_0xcd04('0xe')](_0xcd04('0xf'))[_0xcd04('0x10')]();}}}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.controller.js b/server/api/voiceRecording/voiceRecording.controller.js index 7600a16..85fc6db 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 _0x1dce=['key','VIRTUAL','field','options','VoiceRecording','rows','catch','params','includeAll','include','find','create','body','download','../../components/encryptor','uniqueid','value','%s.cypher','existsSync','decryptFile','secrets','recording','Sequelize','ValidationError','VoiceRecording\x20not\x20found','filename','extname','unlink','message','send','Not\x20found','downloads','sequelize','MD5','token','$and','push','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','set','apply','reject','then','destroy','error','stack','name','index','rawAttributes','model','keys','format','query','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filters','filter','merge','map','type'];(function(_0x5ecb31,_0x1b2f70){var _0xb6753b=function(_0x2cdc6d){while(--_0x2cdc6d){_0x5ecb31['push'](_0x5ecb31['shift']());}};_0xb6753b(++_0x1b2f70);}(_0x1dce,0x195));var _0xe1dc=function(_0x334f27,_0x52c047){_0x334f27=_0x334f27-0x0;var _0x27abba=_0x1dce[_0x334f27];return _0x27abba;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xe1dc('0x0'));var rimraf=require(_0xe1dc('0x1'));var zipdir=require(_0xe1dc('0x2'));var jsonpatch=require(_0xe1dc('0x3'));var rp=require('request-promise');var moment=require(_0xe1dc('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xe1dc('0x5'));var util=require(_0xe1dc('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xe1dc('0x7'));var ejs=require(_0xe1dc('0x8'));var fs=require('fs');var _=require(_0xe1dc('0x9'));var squel=require('squel');var crypto=require(_0xe1dc('0xa'));var jsforce=require(_0xe1dc('0xb'));var deskjs=require(_0xe1dc('0xc'));var toCsv=require(_0xe1dc('0x7'));var querystring=require(_0xe1dc('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xe1dc('0xe'));var qs=require(_0xe1dc('0xf'));var as=require(_0xe1dc('0x10'));var hardwareService=require(_0xe1dc('0x11'));var logger=require('../../config/logger')(_0xe1dc('0x12'));var utils=require(_0xe1dc('0x13'));var config=require(_0xe1dc('0x14'));var db=require(_0xe1dc('0x15'))['db'];function respondWithStatusCode(_0x10adc6,_0x505a90){_0x505a90=_0x505a90||0xcc;return function(_0x3f3d1a){if(_0x3f3d1a){return _0x10adc6[_0xe1dc('0x16')](_0x505a90);}return _0x10adc6[_0xe1dc('0x17')](_0x505a90)['end']();};}function respondWithResult(_0x4a78a1,_0x44282c){_0x44282c=_0x44282c||0xc8;return function(_0x50ec4b){if(_0x50ec4b){return _0x4a78a1[_0xe1dc('0x17')](_0x44282c)[_0xe1dc('0x18')](_0x50ec4b);}};}function respondWithFilteredResult(_0x14aa54,_0x50238b){return function(_0x42d201){if(_0x42d201){var _0x3506ad=_0x42d201[_0xe1dc('0x19')],_0x4396f7=_0x50238b[_0xe1dc('0x1a')],_0x59331b=_0x50238b[_0xe1dc('0x1a')]+_0x50238b[_0xe1dc('0x1b')],_0x1137b3;if(_0x59331b>=_0x3506ad){_0x59331b=_0x3506ad;_0x1137b3=0xc8;}else{_0x1137b3=0xce;}_0x14aa54[_0xe1dc('0x17')](_0x1137b3);return _0x14aa54[_0xe1dc('0x1c')]('Content-Range',_0x4396f7+'-'+_0x59331b+'/'+_0x3506ad)['json'](_0x42d201);}return null;};}function patchUpdates(_0x53fd3d){return function(_0x324f34){try{jsonpatch[_0xe1dc('0x1d')](_0x324f34,_0x53fd3d,!![]);}catch(_0x2b9be1){return BPromise[_0xe1dc('0x1e')](_0x2b9be1);}return _0x324f34['save']();};}function saveUpdates(_0x39fd91,_0x2542f0){return function(_0x4949c7){if(_0x4949c7){return _0x4949c7['update'](_0x39fd91)[_0xe1dc('0x1f')](function(_0x44b693){return _0x44b693;});}return null;};}function removeEntity(_0x1ee368,_0x21bc54){return function(_0x267fff){if(_0x267fff){return _0x267fff[_0xe1dc('0x20')]()['then'](function(){_0x1ee368[_0xe1dc('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x53756b,_0x533a74){return function(_0xc2981c){if(!_0xc2981c){_0x53756b[_0xe1dc('0x16')](0x194);}return _0xc2981c;};}function handleError(_0x757431,_0x2daf74){_0x2daf74=_0x2daf74||0x1f4;return function(_0x8863dc){logger[_0xe1dc('0x21')](_0x8863dc[_0xe1dc('0x22')]);if(_0x8863dc['name']){delete _0x8863dc[_0xe1dc('0x23')];}_0x757431[_0xe1dc('0x17')](_0x2daf74)['send'](_0x8863dc);};}exports[_0xe1dc('0x24')]=function(_0x1ac17a,_0x3bbafb){var _0x422d9e={},_0x3a9137={},_0x224fc0={'count':0x0,'rows':[]};var _0x2b5ffe=db['VoiceRecording'][_0xe1dc('0x25')];_0x3a9137[_0xe1dc('0x26')]=_['differenceBy'](_[_0xe1dc('0x27')](_0x2b5ffe),[_0xe1dc('0x28')]);_0x3a9137[_0xe1dc('0x29')]=_[_0xe1dc('0x27')](_0x1ac17a['query']);_0x3a9137['filters']=_[_0xe1dc('0x2a')](_0x3a9137[_0xe1dc('0x26')],_0x3a9137[_0xe1dc('0x29')]);_0x422d9e[_0xe1dc('0x2b')]=_[_0xe1dc('0x2a')](_0x3a9137['model'],qs[_0xe1dc('0x2c')](_0x1ac17a[_0xe1dc('0x29')][_0xe1dc('0x2c')]));_0x422d9e[_0xe1dc('0x2b')]=_0x422d9e[_0xe1dc('0x2b')][_0xe1dc('0x2d')]?_0x422d9e[_0xe1dc('0x2b')]:_0x3a9137[_0xe1dc('0x26')];if(!_0x1ac17a['query'][_0xe1dc('0x2e')]('nolimit')){_0x422d9e['limit']=qs[_0xe1dc('0x1b')](_0x1ac17a['query'][_0xe1dc('0x1b')]);_0x422d9e[_0xe1dc('0x1a')]=qs[_0xe1dc('0x1a')](_0x1ac17a[_0xe1dc('0x29')][_0xe1dc('0x1a')]);}_0x422d9e['order']=qs[_0xe1dc('0x2f')](_0x1ac17a[_0xe1dc('0x29')][_0xe1dc('0x2f')]);_0x422d9e[_0xe1dc('0x30')]=qs['filters'](_[_0xe1dc('0x31')](_0x1ac17a[_0xe1dc('0x29')],_0x3a9137[_0xe1dc('0x32')]));if(_0x1ac17a[_0xe1dc('0x29')][_0xe1dc('0x33')]){_0x422d9e[_0xe1dc('0x30')]=_[_0xe1dc('0x34')](_0x422d9e[_0xe1dc('0x30')],{'$or':_[_0xe1dc('0x35')](_0x2b5ffe,function(_0x1cb2d4){if(_0x1cb2d4[_0xe1dc('0x36')][_0xe1dc('0x37')]!==_0xe1dc('0x38')){var _0x231f46={};_0x231f46[_0x1cb2d4[_0xe1dc('0x39')]]={'$like':'%'+_0x1ac17a[_0xe1dc('0x29')][_0xe1dc('0x33')]+'%'};return _0x231f46;}})});}_0x422d9e=_[_0xe1dc('0x34')]({},_0x422d9e,_0x1ac17a[_0xe1dc('0x3a')]);var _0x5b9815={'where':_0x422d9e[_0xe1dc('0x30')]};return db['VoiceRecording'][_0xe1dc('0x19')](_0x5b9815)[_0xe1dc('0x1f')](function(_0x1cfaf9){_0x224fc0[_0xe1dc('0x19')]=_0x1cfaf9;if(_0x1ac17a[_0xe1dc('0x29')]['includeAll']){_0x422d9e['include']=[{'all':!![]}];}return db[_0xe1dc('0x3b')]['findAll'](_0x422d9e);})[_0xe1dc('0x1f')](function(_0x3c5ab4){_0x224fc0[_0xe1dc('0x3c')]=_0x3c5ab4;return _0x224fc0;})[_0xe1dc('0x1f')](respondWithFilteredResult(_0x3bbafb,_0x422d9e))[_0xe1dc('0x3d')](handleError(_0x3bbafb,null));};exports['show']=function(_0x279842,_0x5b826f){var _0x530694={'raw':![],'where':{'id':_0x279842[_0xe1dc('0x3e')]['id']}},_0x1c5ee9={};_0x1c5ee9[_0xe1dc('0x26')]=_[_0xe1dc('0x27')](db[_0xe1dc('0x3b')][_0xe1dc('0x25')]);_0x1c5ee9['query']=_[_0xe1dc('0x27')](_0x279842['query']);_0x1c5ee9[_0xe1dc('0x32')]=_[_0xe1dc('0x2a')](_0x1c5ee9[_0xe1dc('0x26')],_0x1c5ee9[_0xe1dc('0x29')]);_0x530694[_0xe1dc('0x2b')]=_['intersection'](_0x1c5ee9[_0xe1dc('0x26')],qs[_0xe1dc('0x2c')](_0x279842[_0xe1dc('0x29')][_0xe1dc('0x2c')]));_0x530694[_0xe1dc('0x2b')]=_0x530694['attributes'][_0xe1dc('0x2d')]?_0x530694[_0xe1dc('0x2b')]:_0x1c5ee9['model'];if(_0x279842[_0xe1dc('0x29')][_0xe1dc('0x3f')]){_0x530694[_0xe1dc('0x40')]=[{'all':!![]}];}_0x530694=_['merge']({},_0x530694,_0x279842[_0xe1dc('0x3a')]);return db[_0xe1dc('0x3b')][_0xe1dc('0x41')](_0x530694)[_0xe1dc('0x1f')](handleEntityNotFound(_0x5b826f,null))[_0xe1dc('0x1f')](respondWithResult(_0x5b826f,null))[_0xe1dc('0x3d')](handleError(_0x5b826f,null));};exports[_0xe1dc('0x42')]=function(_0x34686d,_0x1aa9fb){return db[_0xe1dc('0x3b')][_0xe1dc('0x42')](_0x34686d['body'],{})[_0xe1dc('0x1f')](respondWithResult(_0x1aa9fb,0xc9))[_0xe1dc('0x3d')](handleError(_0x1aa9fb,null));};exports['update']=function(_0x3d3a51,_0x224a5f){if(_0x3d3a51['body']['id']){delete _0x3d3a51[_0xe1dc('0x43')]['id'];}return db[_0xe1dc('0x3b')][_0xe1dc('0x41')]({'where':{'id':_0x3d3a51[_0xe1dc('0x3e')]['id']}})['then'](handleEntityNotFound(_0x224a5f,null))['then'](saveUpdates(_0x3d3a51[_0xe1dc('0x43')],null))['then'](respondWithResult(_0x224a5f,null))[_0xe1dc('0x3d')](handleError(_0x224a5f,null));};exports[_0xe1dc('0x20')]=function(_0x2a75ba,_0x3a6cba){return db['VoiceRecording'][_0xe1dc('0x41')]({'where':{'id':_0x2a75ba[_0xe1dc('0x3e')]['id']}})[_0xe1dc('0x1f')](handleEntityNotFound(_0x3a6cba,null))[_0xe1dc('0x1f')](removeEntity(_0x3a6cba,null))[_0xe1dc('0x3d')](handleError(_0x3a6cba,null));};exports['describe']=function(_0x114ee0,_0xf4e323){return db[_0xe1dc('0x3b')]['describe']()['then'](respondWithResult(_0xf4e323,null))[_0xe1dc('0x3d')](handleError(_0xf4e323,null));};exports[_0xe1dc('0x44')]=function(_0x7dcaad,_0x1363e9,_0x2a5487){var _0x3768f7=require(_0xe1dc('0x45'));var _0x23738a=![];var _0x375d88={};if(_0x7dcaad['query'][_0xe1dc('0x36')]&&_0x7dcaad[_0xe1dc('0x29')]['type']===_0xe1dc('0x46')){_0x375d88[_0xe1dc('0x46')]=_0x7dcaad[_0xe1dc('0x3e')]['id'];}else{_0x375d88['id']=_0x7dcaad[_0xe1dc('0x3e')]['id'];}return db[_0xe1dc('0x3b')][_0xe1dc('0x41')]({'where':_0x375d88,'attributes':['id',_0xe1dc('0x47')],'raw':!![]})[_0xe1dc('0x1f')](handleEntityNotFound(_0x1363e9,null))[_0xe1dc('0x1f')](function(_0x92dd28){if(_0x92dd28){var _0x35536a=_0x92dd28[_0xe1dc('0x47')];var _0x512327=util[_0xe1dc('0x28')](_0xe1dc('0x48'),_0x35536a);if(fs[_0xe1dc('0x49')](_0x512327)){_0x23738a=!![];return _0x3768f7[_0xe1dc('0x4a')](_0x512327,_0x35536a,config[_0xe1dc('0x4b')][_0xe1dc('0x4c')])[_0xe1dc('0x1f')](function(){return _0x92dd28;});}return _0x92dd28;}})[_0xe1dc('0x1f')](function(_0x2f0ca7){if(_0x2f0ca7){var _0x5141ab=_0x2f0ca7['value'];if(!fs[_0xe1dc('0x49')](_0x5141ab)){throw new db[(_0xe1dc('0x4d'))][(_0xe1dc('0x4e'))](_0xe1dc('0x4f'));}if(_0x2f0ca7[_0xe1dc('0x50')]){return _0x1363e9[_0xe1dc('0x44')](_0x5141ab,_0x2f0ca7[_0xe1dc('0x50')]+path[_0xe1dc('0x51')](_0x5141ab),function(){if(_0x23738a){fs[_0xe1dc('0x52')](_0x5141ab);}});}else{return _0x1363e9[_0xe1dc('0x44')](_0x5141ab,function(_0x3d61c6){if(_0x23738a){fs['unlink'](_0x5141ab);}});}}})['catch'](function(_0x5258a4){if(_0x5258a4[_0xe1dc('0x53')]===_0xe1dc('0x4f')){_0x1363e9[_0xe1dc('0x17')](0x194)[_0xe1dc('0x54')](_0xe1dc('0x55'));}else{return handleError(_0x1363e9,null);}});};exports[_0xe1dc('0x56')]=function(_0x412eb8,_0x4c4542,_0x35c1ed){var _0x1dec91=require(_0xe1dc('0x45'));var _0x317d19=![];var _0x3e8903={'$and':[db[_0xe1dc('0x57')][_0xe1dc('0x30')](db[_0xe1dc('0x57')]['fn'](_0xe1dc('0x58'),db['sequelize']['col'](_0xe1dc('0x46'))),_0x412eb8['query'][_0xe1dc('0x59')])]};if(_0x412eb8[_0xe1dc('0x29')][_0xe1dc('0x36')]&&_0x412eb8[_0xe1dc('0x29')][_0xe1dc('0x36')]===_0xe1dc('0x46')){_0x3e8903[_0xe1dc('0x5a')]['push']({'uniqueid':_0x412eb8[_0xe1dc('0x3e')]['id']});}else{_0x3e8903[_0xe1dc('0x5a')][_0xe1dc('0x5b')]({'id':_0x412eb8[_0xe1dc('0x3e')]['id']});}return db[_0xe1dc('0x3b')][_0xe1dc('0x41')]({'where':_0x3e8903,'attributes':['id',_0xe1dc('0x47')],'raw':!![]})[_0xe1dc('0x1f')](handleEntityNotFound(_0x4c4542,null))[_0xe1dc('0x1f')](function(_0x132ed8){if(_0x132ed8){var _0x4ab3b7=util[_0xe1dc('0x28')]('%s.cypher',_0x132ed8[_0xe1dc('0x47')]);if(fs[_0xe1dc('0x49')](_0x4ab3b7)){_0x317d19=!![];return _0x1dec91[_0xe1dc('0x4a')](_0x4ab3b7,_0x132ed8[_0xe1dc('0x47')],config[_0xe1dc('0x4b')][_0xe1dc('0x4c')])[_0xe1dc('0x1f')](function(){return _0x132ed8;});}return _0x132ed8;}})['then'](function(_0x18b70e){if(_0x18b70e){if(!fs['existsSync'](_0x18b70e[_0xe1dc('0x47')])){throw new db[(_0xe1dc('0x4d'))][(_0xe1dc('0x4e'))](_0xe1dc('0x4f'));}if(_0x18b70e[_0xe1dc('0x50')]){return _0x4c4542['download'](_0x18b70e['value'],_0x18b70e[_0xe1dc('0x50')]+path[_0xe1dc('0x51')](_0x18b70e[_0xe1dc('0x47')]),function(){if(_0x317d19){fs[_0xe1dc('0x52')](_0x18b70e[_0xe1dc('0x47')]);}});}else{return _0x4c4542[_0xe1dc('0x44')](_0x18b70e[_0xe1dc('0x47')],function(_0x818951){if(_0x317d19){fs[_0xe1dc('0x52')](_0x18b70e[_0xe1dc('0x47')]);}});}}})[_0xe1dc('0x3d')](handleError(_0x4c4542,null));}; \ No newline at end of file +var _0xed4a=['save','update','then','destroy','stack','name','send','index','VoiceRecording','rawAttributes','model','keys','format','intersection','attributes','fields','query','hasOwnProperty','nolimit','limit','order','sort','filters','pick','filter','merge','where','map','key','VIRTUAL','field','options','include','findAll','rows','catch','params','length','includeAll','create','body','find','describe','download','../../components/encryptor','type','uniqueid','value','%s.cypher','existsSync','secrets','Sequelize','ValidationError','VoiceRecording\x20not\x20found','filename','extname','message','Not\x20found','downloads','sequelize','col','token','push','decryptFile','recording','unlink','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','set','apply','reject'];(function(_0x103fc7,_0x429c79){var _0x2a7d54=function(_0x293e69){while(--_0x293e69){_0x103fc7['push'](_0x103fc7['shift']());}};_0x2a7d54(++_0x429c79);}(_0xed4a,0x168));var _0xaed4=function(_0x47e1f7,_0x295566){_0x47e1f7=_0x47e1f7-0x0;var _0x4687b3=_0xed4a[_0x47e1f7];return _0x4687b3;};'use strict';var pdf=require(_0xaed4('0x0'));var emlformat=require(_0xaed4('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xaed4('0x2'));var jsonpatch=require(_0xaed4('0x3'));var rp=require(_0xaed4('0x4'));var moment=require('moment');var BPromise=require(_0xaed4('0x5'));var Mustache=require(_0xaed4('0x6'));var util=require(_0xaed4('0x7'));var path=require('path');var sox=require(_0xaed4('0x8'));var csv=require(_0xaed4('0x9'));var ejs=require(_0xaed4('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0xaed4('0xb'));var crypto=require('crypto');var jsforce=require(_0xaed4('0xc'));var deskjs=require(_0xaed4('0xd'));var toCsv=require(_0xaed4('0x9'));var querystring=require(_0xaed4('0xe'));var Papa=require(_0xaed4('0xf'));var Redis=require('ioredis');var authService=require(_0xaed4('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xaed4('0x11'));var logger=require(_0xaed4('0x12'))(_0xaed4('0x13'));var utils=require(_0xaed4('0x14'));var config=require(_0xaed4('0x15'));var db=require(_0xaed4('0x16'))['db'];function respondWithStatusCode(_0x464731,_0x420730){_0x420730=_0x420730||0xcc;return function(_0x55429d){if(_0x55429d){return _0x464731[_0xaed4('0x17')](_0x420730);}return _0x464731[_0xaed4('0x18')](_0x420730)[_0xaed4('0x19')]();};}function respondWithResult(_0xeace92,_0x345de0){_0x345de0=_0x345de0||0xc8;return function(_0x3c478d){if(_0x3c478d){return _0xeace92[_0xaed4('0x18')](_0x345de0)[_0xaed4('0x1a')](_0x3c478d);}};}function respondWithFilteredResult(_0x363098,_0x29026c){return function(_0x117543){if(_0x117543){var _0x3fd44a=_0x117543[_0xaed4('0x1b')],_0x59aff0=_0x29026c[_0xaed4('0x1c')],_0x45efe5=_0x29026c[_0xaed4('0x1c')]+_0x29026c['limit'],_0xc52efc;if(_0x45efe5>=_0x3fd44a){_0x45efe5=_0x3fd44a;_0xc52efc=0xc8;}else{_0xc52efc=0xce;}_0x363098['status'](_0xc52efc);return _0x363098[_0xaed4('0x1d')]('Content-Range',_0x59aff0+'-'+_0x45efe5+'/'+_0x3fd44a)[_0xaed4('0x1a')](_0x117543);}return null;};}function patchUpdates(_0x4885d3){return function(_0x3aa47c){try{jsonpatch[_0xaed4('0x1e')](_0x3aa47c,_0x4885d3,!![]);}catch(_0x3b1f12){return BPromise[_0xaed4('0x1f')](_0x3b1f12);}return _0x3aa47c[_0xaed4('0x20')]();};}function saveUpdates(_0x34e594,_0x168012){return function(_0x230e1f){if(_0x230e1f){return _0x230e1f[_0xaed4('0x21')](_0x34e594)[_0xaed4('0x22')](function(_0x297791){return _0x297791;});}return null;};}function removeEntity(_0x44e521,_0x6efa85){return function(_0x230d7a){if(_0x230d7a){return _0x230d7a[_0xaed4('0x23')]()[_0xaed4('0x22')](function(){_0x44e521[_0xaed4('0x18')](0xcc)[_0xaed4('0x19')]();});}};}function handleEntityNotFound(_0x2832da,_0x2dfe19){return function(_0x3c0725){if(!_0x3c0725){_0x2832da[_0xaed4('0x17')](0x194);}return _0x3c0725;};}function handleError(_0x4ec4a1,_0x431028){_0x431028=_0x431028||0x1f4;return function(_0x1b0e77){logger['error'](_0x1b0e77[_0xaed4('0x24')]);if(_0x1b0e77[_0xaed4('0x25')]){delete _0x1b0e77[_0xaed4('0x25')];}_0x4ec4a1[_0xaed4('0x18')](_0x431028)[_0xaed4('0x26')](_0x1b0e77);};}exports[_0xaed4('0x27')]=function(_0x4db6c7,_0x36910e){var _0x2898c7={},_0x56a3a3={},_0x4dbcc7={'count':0x0,'rows':[]};var _0xccf3e2=db[_0xaed4('0x28')][_0xaed4('0x29')];_0x56a3a3[_0xaed4('0x2a')]=_['differenceBy'](_[_0xaed4('0x2b')](_0xccf3e2),[_0xaed4('0x2c')]);_0x56a3a3['query']=_[_0xaed4('0x2b')](_0x4db6c7['query']);_0x56a3a3['filters']=_[_0xaed4('0x2d')](_0x56a3a3[_0xaed4('0x2a')],_0x56a3a3['query']);_0x2898c7[_0xaed4('0x2e')]=_[_0xaed4('0x2d')](_0x56a3a3[_0xaed4('0x2a')],qs[_0xaed4('0x2f')](_0x4db6c7[_0xaed4('0x30')]['fields']));_0x2898c7['attributes']=_0x2898c7[_0xaed4('0x2e')]['length']?_0x2898c7['attributes']:_0x56a3a3[_0xaed4('0x2a')];if(!_0x4db6c7[_0xaed4('0x30')][_0xaed4('0x31')](_0xaed4('0x32'))){_0x2898c7['limit']=qs[_0xaed4('0x33')](_0x4db6c7[_0xaed4('0x30')][_0xaed4('0x33')]);_0x2898c7[_0xaed4('0x1c')]=qs[_0xaed4('0x1c')](_0x4db6c7['query'][_0xaed4('0x1c')]);}_0x2898c7[_0xaed4('0x34')]=qs[_0xaed4('0x35')](_0x4db6c7[_0xaed4('0x30')][_0xaed4('0x35')]);_0x2898c7['where']=qs[_0xaed4('0x36')](_[_0xaed4('0x37')](_0x4db6c7['query'],_0x56a3a3[_0xaed4('0x36')]));if(_0x4db6c7[_0xaed4('0x30')][_0xaed4('0x38')]){_0x2898c7['where']=_[_0xaed4('0x39')](_0x2898c7[_0xaed4('0x3a')],{'$or':_[_0xaed4('0x3b')](_0xccf3e2,function(_0x171770){if(_0x171770['type'][_0xaed4('0x3c')]!==_0xaed4('0x3d')){var _0x42bdf6={};_0x42bdf6[_0x171770[_0xaed4('0x3e')]]={'$like':'%'+_0x4db6c7[_0xaed4('0x30')][_0xaed4('0x38')]+'%'};return _0x42bdf6;}})});}_0x2898c7=_[_0xaed4('0x39')]({},_0x2898c7,_0x4db6c7[_0xaed4('0x3f')]);var _0x6c9c98={'where':_0x2898c7[_0xaed4('0x3a')]};return db[_0xaed4('0x28')][_0xaed4('0x1b')](_0x6c9c98)[_0xaed4('0x22')](function(_0x50d3b4){_0x4dbcc7[_0xaed4('0x1b')]=_0x50d3b4;if(_0x4db6c7['query']['includeAll']){_0x2898c7[_0xaed4('0x40')]=[{'all':!![]}];}return db[_0xaed4('0x28')][_0xaed4('0x41')](_0x2898c7);})[_0xaed4('0x22')](function(_0x3fa8d9){_0x4dbcc7[_0xaed4('0x42')]=_0x3fa8d9;return _0x4dbcc7;})['then'](respondWithFilteredResult(_0x36910e,_0x2898c7))[_0xaed4('0x43')](handleError(_0x36910e,null));};exports['show']=function(_0x65bc91,_0xa43ac){var _0x12f113={'raw':![],'where':{'id':_0x65bc91[_0xaed4('0x44')]['id']}},_0x1adc00={};_0x1adc00[_0xaed4('0x2a')]=_[_0xaed4('0x2b')](db[_0xaed4('0x28')][_0xaed4('0x29')]);_0x1adc00[_0xaed4('0x30')]=_[_0xaed4('0x2b')](_0x65bc91[_0xaed4('0x30')]);_0x1adc00[_0xaed4('0x36')]=_[_0xaed4('0x2d')](_0x1adc00[_0xaed4('0x2a')],_0x1adc00[_0xaed4('0x30')]);_0x12f113[_0xaed4('0x2e')]=_[_0xaed4('0x2d')](_0x1adc00[_0xaed4('0x2a')],qs[_0xaed4('0x2f')](_0x65bc91[_0xaed4('0x30')][_0xaed4('0x2f')]));_0x12f113['attributes']=_0x12f113['attributes'][_0xaed4('0x45')]?_0x12f113['attributes']:_0x1adc00['model'];if(_0x65bc91['query'][_0xaed4('0x46')]){_0x12f113[_0xaed4('0x40')]=[{'all':!![]}];}_0x12f113=_[_0xaed4('0x39')]({},_0x12f113,_0x65bc91[_0xaed4('0x3f')]);return db[_0xaed4('0x28')]['find'](_0x12f113)[_0xaed4('0x22')](handleEntityNotFound(_0xa43ac,null))[_0xaed4('0x22')](respondWithResult(_0xa43ac,null))[_0xaed4('0x43')](handleError(_0xa43ac,null));};exports[_0xaed4('0x47')]=function(_0x46511f,_0x423eae){return db[_0xaed4('0x28')][_0xaed4('0x47')](_0x46511f[_0xaed4('0x48')],{})[_0xaed4('0x22')](respondWithResult(_0x423eae,0xc9))[_0xaed4('0x43')](handleError(_0x423eae,null));};exports['update']=function(_0x48870e,_0x80f5b){if(_0x48870e[_0xaed4('0x48')]['id']){delete _0x48870e[_0xaed4('0x48')]['id'];}return db[_0xaed4('0x28')][_0xaed4('0x49')]({'where':{'id':_0x48870e[_0xaed4('0x44')]['id']}})['then'](handleEntityNotFound(_0x80f5b,null))['then'](saveUpdates(_0x48870e[_0xaed4('0x48')],null))[_0xaed4('0x22')](respondWithResult(_0x80f5b,null))['catch'](handleError(_0x80f5b,null));};exports['destroy']=function(_0x5b6c53,_0x6bc7b){return db[_0xaed4('0x28')][_0xaed4('0x49')]({'where':{'id':_0x5b6c53['params']['id']}})[_0xaed4('0x22')](handleEntityNotFound(_0x6bc7b,null))[_0xaed4('0x22')](removeEntity(_0x6bc7b,null))['catch'](handleError(_0x6bc7b,null));};exports[_0xaed4('0x4a')]=function(_0x94b6f,_0x5250b5){return db['VoiceRecording'][_0xaed4('0x4a')]()[_0xaed4('0x22')](respondWithResult(_0x5250b5,null))[_0xaed4('0x43')](handleError(_0x5250b5,null));};exports[_0xaed4('0x4b')]=function(_0x8bd7e,_0xe6f8e3,_0x4106b4){var _0x394e2c=require(_0xaed4('0x4c'));var _0x7607ce=![];var _0x38585b={};if(_0x8bd7e[_0xaed4('0x30')]['type']&&_0x8bd7e['query'][_0xaed4('0x4d')]===_0xaed4('0x4e')){_0x38585b['uniqueid']=_0x8bd7e[_0xaed4('0x44')]['id'];}else{_0x38585b['id']=_0x8bd7e[_0xaed4('0x44')]['id'];}return db[_0xaed4('0x28')]['find']({'where':_0x38585b,'attributes':['id','value'],'raw':!![]})[_0xaed4('0x22')](handleEntityNotFound(_0xe6f8e3,null))[_0xaed4('0x22')](function(_0x47c5be){if(_0x47c5be){var _0x46e855=_0x47c5be[_0xaed4('0x4f')];var _0x1dadbe=util[_0xaed4('0x2c')](_0xaed4('0x50'),_0x46e855);if(fs[_0xaed4('0x51')](_0x1dadbe)){_0x7607ce=!![];return _0x394e2c['decryptFile'](_0x1dadbe,_0x46e855,config[_0xaed4('0x52')]['recording'])[_0xaed4('0x22')](function(){return _0x47c5be;});}return _0x47c5be;}})['then'](function(_0x1855f4){if(_0x1855f4){var _0x8683cc=_0x1855f4[_0xaed4('0x4f')];if(!fs['existsSync'](_0x8683cc)){throw new db[(_0xaed4('0x53'))][(_0xaed4('0x54'))](_0xaed4('0x55'));}if(_0x1855f4[_0xaed4('0x56')]){return _0xe6f8e3[_0xaed4('0x4b')](_0x8683cc,_0x1855f4['filename']+path[_0xaed4('0x57')](_0x8683cc),function(){if(_0x7607ce){fs['unlink'](_0x8683cc);}});}else{return _0xe6f8e3[_0xaed4('0x4b')](_0x8683cc,function(_0x4250aa){if(_0x7607ce){fs['unlink'](_0x8683cc);}});}}})[_0xaed4('0x43')](function(_0x108161){if(_0x108161[_0xaed4('0x58')]===_0xaed4('0x55')){_0xe6f8e3[_0xaed4('0x18')](0x194)[_0xaed4('0x26')](_0xaed4('0x59'));}else{return handleError(_0xe6f8e3,null);}});};exports[_0xaed4('0x5a')]=function(_0x2af904,_0x13fbf7,_0x16df50){var _0x418bda=require(_0xaed4('0x4c'));var _0x63ce02=![];var _0x5eef59={'$and':[db[_0xaed4('0x5b')][_0xaed4('0x3a')](db[_0xaed4('0x5b')]['fn']('MD5',db[_0xaed4('0x5b')][_0xaed4('0x5c')](_0xaed4('0x4e'))),_0x2af904[_0xaed4('0x30')][_0xaed4('0x5d')])]};if(_0x2af904[_0xaed4('0x30')][_0xaed4('0x4d')]&&_0x2af904['query']['type']===_0xaed4('0x4e')){_0x5eef59['$and'][_0xaed4('0x5e')]({'uniqueid':_0x2af904[_0xaed4('0x44')]['id']});}else{_0x5eef59['$and']['push']({'id':_0x2af904['params']['id']});}return db[_0xaed4('0x28')][_0xaed4('0x49')]({'where':_0x5eef59,'attributes':['id',_0xaed4('0x4f')],'raw':!![]})['then'](handleEntityNotFound(_0x13fbf7,null))[_0xaed4('0x22')](function(_0x29abbc){if(_0x29abbc){var _0x33aad7=util['format'](_0xaed4('0x50'),_0x29abbc[_0xaed4('0x4f')]);if(fs[_0xaed4('0x51')](_0x33aad7)){_0x63ce02=!![];return _0x418bda[_0xaed4('0x5f')](_0x33aad7,_0x29abbc[_0xaed4('0x4f')],config['secrets'][_0xaed4('0x60')])['then'](function(){return _0x29abbc;});}return _0x29abbc;}})[_0xaed4('0x22')](function(_0x30367a){if(_0x30367a){if(!fs[_0xaed4('0x51')](_0x30367a['value'])){throw new db[(_0xaed4('0x53'))][(_0xaed4('0x54'))](_0xaed4('0x55'));}if(_0x30367a[_0xaed4('0x56')]){return _0x13fbf7[_0xaed4('0x4b')](_0x30367a[_0xaed4('0x4f')],_0x30367a['filename']+path[_0xaed4('0x57')](_0x30367a[_0xaed4('0x4f')]),function(){if(_0x63ce02){fs[_0xaed4('0x61')](_0x30367a['value']);}});}else{return _0x13fbf7[_0xaed4('0x4b')](_0x30367a[_0xaed4('0x4f')],function(_0x212b83){if(_0x63ce02){fs[_0xaed4('0x61')](_0x30367a[_0xaed4('0x4f')]);}});}}})[_0xaed4('0x43')](handleError(_0x13fbf7,null));}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.model.js b/server/api/voiceRecording/voiceRecording.model.js index 0ee0798..d741809 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 _0xd7c0=['./voiceRecording.attributes','exports','define','VoiceRecording','voice_recordings','uniqueid','lodash','util','../../config/logger','api','request-promise','path','rimraf'];(function(_0x5c1ebd,_0x48c431){var _0x57f6bf=function(_0x568392){while(--_0x568392){_0x5c1ebd['push'](_0x5c1ebd['shift']());}};_0x57f6bf(++_0x48c431);}(_0xd7c0,0x13e));var _0x0d7c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd7c0[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x0d7c('0x0'));var util=require(_0x0d7c('0x1'));var logger=require(_0x0d7c('0x2'))(_0x0d7c('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x0d7c('0x4'));var fs=require('fs');var path=require(_0x0d7c('0x5'));var rimraf=require(_0x0d7c('0x6'));var config=require('../../config/environment');var attributes=require(_0x0d7c('0x7'));module[_0x0d7c('0x8')]=function(_0x1b8cfb,_0x1e8fd7){return _0x1b8cfb[_0x0d7c('0x9')](_0x0d7c('0xa'),attributes,{'tableName':_0x0d7c('0xb'),'paranoid':![],'indexes':[{'name':_0x0d7c('0xc'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x3d33=['moment','bluebird','request-promise','rimraf','define','VoiceRecording','uniqueid','lodash','util','../../config/logger','api'];(function(_0x1c026f,_0x1db033){var _0x4a74ab=function(_0x1ab315){while(--_0x1ab315){_0x1c026f['push'](_0x1c026f['shift']());}};_0x4a74ab(++_0x1db033);}(_0x3d33,0x8b));var _0x33d3=function(_0x47957e,_0xc6c924){_0x47957e=_0x47957e-0x0;var _0x836197=_0x3d33[_0x47957e];return _0x836197;};'use strict';var _=require(_0x33d3('0x0'));var util=require(_0x33d3('0x1'));var logger=require(_0x33d3('0x2'))(_0x33d3('0x3'));var moment=require(_0x33d3('0x4'));var BPromise=require(_0x33d3('0x5'));var rp=require(_0x33d3('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x33d3('0x7'));var config=require('../../config/environment');var attributes=require('./voiceRecording.attributes');module['exports']=function(_0x4f91e9,_0x3d5a2f){return _0x4f91e9[_0x33d3('0x8')](_0x33d3('0x9'),attributes,{'tableName':'voice_recordings','paranoid':![],'indexes':[{'name':_0x33d3('0xa'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.rpc.js b/server/api/voiceRecording/voiceRecording.rpc.js index f9ae577..7a530a9 100644 --- a/server/api/voiceRecording/voiceRecording.rpc.js +++ b/server/api/voiceRecording/voiceRecording.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['findOne','callRecordingEncryption','create','existsSync','value','%s.cypher','encryptFile','secrets','recording','unlink','CreateVoiceRecording\x20file\x20encrypted','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','VoiceRecording,\x20%s,\x20%s','request\x20sent','debug','VoiceRecording,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','VoiceRecording','update','body','options','raw','then','UpdateVoiceRecording','stringify','CreateVoiceRecording'];(function(_0x10b757,_0x3cf7ca){var _0x5fffd2=function(_0xd83dbc){while(--_0xd83dbc){_0x10b757['push'](_0x10b757['shift']());}};_0x5fffd2(++_0x3cf7ca);}(_0xa9e0,0x123));var _0x0a9e=function(_0x49ca18,_0x5e6d05){_0x49ca18=_0x49ca18-0x0;var _0x145d54=_0xa9e0[_0x49ca18];return _0x145d54;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}exports['UpdateVoiceRecording']=function(_0x459eb1){var _0x478723=this;return new Promise(function(_0x106033,_0x205fd6){return db[_0x0a9e('0x14')][_0x0a9e('0x15')](_0x459eb1[_0x0a9e('0x16')],{'raw':_0x459eb1[_0x0a9e('0x17')]?_0x459eb1[_0x0a9e('0x17')][_0x0a9e('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x459eb1[_0x0a9e('0x17')]?_0x459eb1[_0x0a9e('0x17')]['where']||null:null,'attributes':_0x459eb1[_0x0a9e('0x17')]?_0x459eb1[_0x0a9e('0x17')]['attributes']||null:null,'limit':_0x459eb1[_0x0a9e('0x17')]?_0x459eb1['options']['limit']||null:null})[_0x0a9e('0x19')](function(_0x432e56){logger[_0x0a9e('0xa')](_0x0a9e('0x1a'),_0x459eb1);logger['debug'](_0x0a9e('0x1a'),_0x459eb1,JSON[_0x0a9e('0x1b')](_0x432e56));_0x106033(_0x432e56);})[_0x0a9e('0x13')](function(_0x4d00e6){logger[_0x0a9e('0x10')](_0x0a9e('0x1a'),_0x4d00e6[_0x0a9e('0x11')],_0x459eb1);_0x205fd6(_0x478723['error'](0x1f4,_0x4d00e6['message']));});});};exports[_0x0a9e('0x1c')]=function(_0x3a8e58){var _0x40c424=this;return new Promise(function(_0x33161b,_0x526cf3){var _0x384319=require('../../components/encryptor');var _0x45a1e7;return db['Setting'][_0x0a9e('0x1d')]({'attributes':['id',_0x0a9e('0x1e')],'where':{'id':0x1},'raw':!![]})[_0x0a9e('0x19')](function(_0x14433c){_0x45a1e7=_0x14433c;return db[_0x0a9e('0x14')][_0x0a9e('0x1f')](_0x3a8e58[_0x0a9e('0x16')]);})[_0x0a9e('0x19')](function(_0x5a101a){if(_0x45a1e7[_0x0a9e('0x1e')]&&fs[_0x0a9e('0x20')](_0x5a101a[_0x0a9e('0x21')])){var _0x2ec755=util['format'](_0x0a9e('0x22'),_0x5a101a[_0x0a9e('0x21')]);return _0x384319[_0x0a9e('0x23')](_0x5a101a[_0x0a9e('0x21')],_0x2ec755,config[_0x0a9e('0x24')][_0x0a9e('0x25')])[_0x0a9e('0x19')](function(){fs[_0x0a9e('0x26')](_0x5a101a[_0x0a9e('0x21')]);logger['info'](_0x0a9e('0x27'));return _0x5a101a;});}return _0x5a101a;})['then'](function(_0x2407f9){logger[_0x0a9e('0xa')](_0x0a9e('0x1c'),_0x3a8e58);logger[_0x0a9e('0xd')](_0x0a9e('0x1c'),_0x3a8e58,JSON['stringify'](_0x2407f9));_0x33161b(_0x2407f9);})[_0x0a9e('0x13')](function(_0x46f0a5){logger[_0x0a9e('0x10')](_0x0a9e('0x1c'),_0x46f0a5[_0x0a9e('0x11')],_0x3a8e58);_0x526cf3(_0x40c424[_0x0a9e('0x10')](0x1f4,_0x46f0a5[_0x0a9e('0x11')]));});});}; \ No newline at end of file +var _0xa9e0=['findOne','callRecordingEncryption','create','existsSync','value','%s.cypher','encryptFile','secrets','recording','unlink','CreateVoiceRecording\x20file\x20encrypted','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','VoiceRecording,\x20%s,\x20%s','request\x20sent','debug','VoiceRecording,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','VoiceRecording','update','body','options','raw','then','UpdateVoiceRecording','stringify','CreateVoiceRecording'];(function(_0x3c5bf1,_0x30bb33){var _0x2dc4d3=function(_0x16c175){while(--_0x16c175){_0x3c5bf1['push'](_0x3c5bf1['shift']());}};_0x2dc4d3(++_0x30bb33);}(_0xa9e0,0x123));var _0x0a9e=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0xa9e0[_0x24237f];return _0x48298e;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}exports['UpdateVoiceRecording']=function(_0x459eb1){var _0x478723=this;return new Promise(function(_0x106033,_0x205fd6){return db[_0x0a9e('0x14')][_0x0a9e('0x15')](_0x459eb1[_0x0a9e('0x16')],{'raw':_0x459eb1[_0x0a9e('0x17')]?_0x459eb1[_0x0a9e('0x17')][_0x0a9e('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x459eb1[_0x0a9e('0x17')]?_0x459eb1[_0x0a9e('0x17')]['where']||null:null,'attributes':_0x459eb1[_0x0a9e('0x17')]?_0x459eb1[_0x0a9e('0x17')]['attributes']||null:null,'limit':_0x459eb1[_0x0a9e('0x17')]?_0x459eb1['options']['limit']||null:null})[_0x0a9e('0x19')](function(_0x432e56){logger[_0x0a9e('0xa')](_0x0a9e('0x1a'),_0x459eb1);logger['debug'](_0x0a9e('0x1a'),_0x459eb1,JSON[_0x0a9e('0x1b')](_0x432e56));_0x106033(_0x432e56);})[_0x0a9e('0x13')](function(_0x4d00e6){logger[_0x0a9e('0x10')](_0x0a9e('0x1a'),_0x4d00e6[_0x0a9e('0x11')],_0x459eb1);_0x205fd6(_0x478723['error'](0x1f4,_0x4d00e6['message']));});});};exports[_0x0a9e('0x1c')]=function(_0x3a8e58){var _0x40c424=this;return new Promise(function(_0x33161b,_0x526cf3){var _0x384319=require('../../components/encryptor');var _0x45a1e7;return db['Setting'][_0x0a9e('0x1d')]({'attributes':['id',_0x0a9e('0x1e')],'where':{'id':0x1},'raw':!![]})[_0x0a9e('0x19')](function(_0x14433c){_0x45a1e7=_0x14433c;return db[_0x0a9e('0x14')][_0x0a9e('0x1f')](_0x3a8e58[_0x0a9e('0x16')]);})[_0x0a9e('0x19')](function(_0x5a101a){if(_0x45a1e7[_0x0a9e('0x1e')]&&fs[_0x0a9e('0x20')](_0x5a101a[_0x0a9e('0x21')])){var _0x2ec755=util['format'](_0x0a9e('0x22'),_0x5a101a[_0x0a9e('0x21')]);return _0x384319[_0x0a9e('0x23')](_0x5a101a[_0x0a9e('0x21')],_0x2ec755,config[_0x0a9e('0x24')][_0x0a9e('0x25')])[_0x0a9e('0x19')](function(){fs[_0x0a9e('0x26')](_0x5a101a[_0x0a9e('0x21')]);logger['info'](_0x0a9e('0x27'));return _0x5a101a;});}return _0x5a101a;})['then'](function(_0x2407f9){logger[_0x0a9e('0xa')](_0x0a9e('0x1c'),_0x3a8e58);logger[_0x0a9e('0xd')](_0x0a9e('0x1c'),_0x3a8e58,JSON['stringify'](_0x2407f9));_0x33161b(_0x2407f9);})[_0x0a9e('0x13')](function(_0x46f0a5){logger[_0x0a9e('0x10')](_0x0a9e('0x1c'),_0x46f0a5[_0x0a9e('0x11')],_0x3a8e58);_0x526cf3(_0x40c424[_0x0a9e('0x10')](0x1f4,_0x46f0a5[_0x0a9e('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/index.js b/server/api/voiceTransferReport/index.js index c734446..1283da4 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 _0x33af=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','post','put','update','delete','exports','util','connect-timeout','express','Router'];(function(_0x2293f6,_0xda2057){var _0x107ece=function(_0x57514d){while(--_0x57514d){_0x2293f6['push'](_0x2293f6['shift']());}};_0x107ece(++_0xda2057);}(_0x33af,0xec));var _0xf33a=function(_0x25ada9,_0x5f0e07){_0x25ada9=_0x25ada9-0x0;var _0x59e1ab=_0x33af[_0x25ada9];return _0x59e1ab;};'use strict';var multer=require('multer');var util=require(_0xf33a('0x0'));var path=require('path');var timeout=require(_0xf33a('0x1'));var express=require(_0xf33a('0x2'));var router=express[_0xf33a('0x3')]();var auth=require(_0xf33a('0x4'));var interaction=require(_0xf33a('0x5'));var config=require(_0xf33a('0x6'));var controller=require('./voiceTransferReport.controller');router[_0xf33a('0x7')]('/',auth[_0xf33a('0x8')](),controller['index']);router[_0xf33a('0x7')](_0xf33a('0x9'),auth[_0xf33a('0x8')](),controller[_0xf33a('0xa')]);router[_0xf33a('0xb')]('/',auth[_0xf33a('0x8')](),controller['create']);router[_0xf33a('0xc')](_0xf33a('0x9'),auth[_0xf33a('0x8')](),controller[_0xf33a('0xd')]);router[_0xf33a('0xe')](_0xf33a('0x9'),auth['isAuthenticated'](),controller['destroy']);module[_0xf33a('0xf')]=router; \ No newline at end of file +var _0xba34=['get','isAuthenticated','index','/:id','show','post','create','put','update','delete','exports','multer','util','path','connect-timeout','express','../../config/environment','./voiceTransferReport.controller'];(function(_0x5951b5,_0x507600){var _0x263971=function(_0x2eee4b){while(--_0x2eee4b){_0x5951b5['push'](_0x5951b5['shift']());}};_0x263971(++_0x507600);}(_0xba34,0x119));var _0x4ba3=function(_0x10d793,_0xe93d54){_0x10d793=_0x10d793-0x0;var _0x281f65=_0xba34[_0x10d793];return _0x281f65;};'use strict';var multer=require(_0x4ba3('0x0'));var util=require(_0x4ba3('0x1'));var path=require(_0x4ba3('0x2'));var timeout=require(_0x4ba3('0x3'));var express=require(_0x4ba3('0x4'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x4ba3('0x5'));var controller=require(_0x4ba3('0x6'));router[_0x4ba3('0x7')]('/',auth[_0x4ba3('0x8')](),controller[_0x4ba3('0x9')]);router[_0x4ba3('0x7')](_0x4ba3('0xa'),auth['isAuthenticated'](),controller[_0x4ba3('0xb')]);router[_0x4ba3('0xc')]('/',auth[_0x4ba3('0x8')](),controller[_0x4ba3('0xd')]);router[_0x4ba3('0xe')](_0x4ba3('0xa'),auth[_0x4ba3('0x8')](),controller[_0x4ba3('0xf')]);router[_0x4ba3('0x10')](_0x4ba3('0xa'),auth[_0x4ba3('0x8')](),controller['destroy']);module[_0x4ba3('0x11')]=router; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.attributes.js b/server/api/voiceTransferReport/voiceTransferReport.attributes.js index 019015e..593032d 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 _0x1e48=['ENUM','Yes','sequelize','exports','blind','attended','STRING'];(function(_0x2a5030,_0x5416a5){var _0xe7ee51=function(_0x1bdaaf){while(--_0x1bdaaf){_0x2a5030['push'](_0x2a5030['shift']());}};_0xe7ee51(++_0x5416a5);}(_0x1e48,0x1e5));var _0x81e4=function(_0xc144be,_0x385142){_0xc144be=_0xc144be-0x0;var _0x4ffd89=_0x1e48[_0xc144be];return _0x4ffd89;};'use strict';var Sequelize=require(_0x81e4('0x0'));var moment=require('moment');module[_0x81e4('0x1')]={'type':{'type':Sequelize['ENUM'](_0x81e4('0x2'),_0x81e4('0x3'))},'result':{'type':Sequelize[_0x81e4('0x4')]},'transfererchannel':{'type':Sequelize[_0x81e4('0x4')]},'transferercalleridnum':{'type':Sequelize[_0x81e4('0x4')]},'transferercalleridname':{'type':Sequelize['STRING']},'transfererconnectedlinenum':{'type':Sequelize[_0x81e4('0x4')]},'transfererconnectedlinename':{'type':Sequelize[_0x81e4('0x4')]},'transfereraccountcode':{'type':Sequelize[_0x81e4('0x4')]},'transferercontext':{'type':Sequelize['STRING']},'transfererexten':{'type':Sequelize[_0x81e4('0x4')]},'transfererlinkedid':{'type':Sequelize[_0x81e4('0x4')]},'transfereechannel':{'type':Sequelize['STRING']},'transfereecalleridnum':{'type':Sequelize['STRING']},'transfereecalleridname':{'type':Sequelize[_0x81e4('0x4')]},'transfereeconnectedlinenum':{'type':Sequelize[_0x81e4('0x4')]},'transfereeconnectedlinename':{'type':Sequelize[_0x81e4('0x4')]},'transfereeaccountcode':{'type':Sequelize['STRING']},'transfereecontext':{'type':Sequelize[_0x81e4('0x4')]},'transfereeexten':{'type':Sequelize[_0x81e4('0x4')]},'transfereelinkedid':{'type':Sequelize[_0x81e4('0x4')]},'isexternal':{'type':Sequelize[_0x81e4('0x5')](_0x81e4('0x6'),'No')},'context':{'type':Sequelize[_0x81e4('0x4')]},'extension':{'type':Sequelize[_0x81e4('0x4')]}}; \ No newline at end of file +var _0x2865=['moment','ENUM','blind','STRING','Yes'];(function(_0x45bf86,_0x75586e){var _0x1f02b7=function(_0x1ea8a3){while(--_0x1ea8a3){_0x45bf86['push'](_0x45bf86['shift']());}};_0x1f02b7(++_0x75586e);}(_0x2865,0x127));var _0x5286=function(_0x49c76b,_0x42d89c){_0x49c76b=_0x49c76b-0x0;var _0x396b4c=_0x2865[_0x49c76b];return _0x396b4c;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x5286('0x0'));module['exports']={'type':{'type':Sequelize[_0x5286('0x1')](_0x5286('0x2'),'attended')},'result':{'type':Sequelize[_0x5286('0x3')]},'transfererchannel':{'type':Sequelize[_0x5286('0x3')]},'transferercalleridnum':{'type':Sequelize[_0x5286('0x3')]},'transferercalleridname':{'type':Sequelize[_0x5286('0x3')]},'transfererconnectedlinenum':{'type':Sequelize['STRING']},'transfererconnectedlinename':{'type':Sequelize[_0x5286('0x3')]},'transfereraccountcode':{'type':Sequelize[_0x5286('0x3')]},'transferercontext':{'type':Sequelize['STRING']},'transfererexten':{'type':Sequelize['STRING']},'transfererlinkedid':{'type':Sequelize[_0x5286('0x3')]},'transfereechannel':{'type':Sequelize['STRING']},'transfereecalleridnum':{'type':Sequelize[_0x5286('0x3')]},'transfereecalleridname':{'type':Sequelize[_0x5286('0x3')]},'transfereeconnectedlinenum':{'type':Sequelize[_0x5286('0x3')]},'transfereeconnectedlinename':{'type':Sequelize[_0x5286('0x3')]},'transfereeaccountcode':{'type':Sequelize[_0x5286('0x3')]},'transfereecontext':{'type':Sequelize[_0x5286('0x3')]},'transfereeexten':{'type':Sequelize[_0x5286('0x3')]},'transfereelinkedid':{'type':Sequelize[_0x5286('0x3')]},'isexternal':{'type':Sequelize[_0x5286('0x1')](_0x5286('0x4'),'No')},'context':{'type':Sequelize[_0x5286('0x3')]},'extension':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.controller.js b/server/api/voiceTransferReport/voiceTransferReport.controller.js index 759fc6e..c5923ee 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 _0x6fa1=['desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','update','then','destroy','error','stack','name','send','VoiceTransferReport','rawAttributes','keys','query','model','intersection','fields','attributes','hasOwnProperty','sort','where','filters','pick','type','key','VIRTUAL','field','filter','merge','options','includeAll','findAll','rows','catch','show','length','include','create','body','params','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','lodash','squel','jsforce'];(function(_0x46d0c9,_0x526bfa){var _0x174506=function(_0x654bc6){while(--_0x654bc6){_0x46d0c9['push'](_0x46d0c9['shift']());}};_0x174506(++_0x526bfa);}(_0x6fa1,0x1dd));var _0x16fa=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x6fa1[_0x20a584];return _0x4b41a8;};'use strict';var pdf=require(_0x16fa('0x0'));var emlformat=require(_0x16fa('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x16fa('0x2'));var jsonpatch=require(_0x16fa('0x3'));var rp=require(_0x16fa('0x4'));var moment=require(_0x16fa('0x5'));var BPromise=require(_0x16fa('0x6'));var Mustache=require('mustache');var util=require(_0x16fa('0x7'));var path=require('path');var sox=require(_0x16fa('0x8'));var csv=require(_0x16fa('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x16fa('0xa'));var squel=require(_0x16fa('0xb'));var crypto=require('crypto');var jsforce=require(_0x16fa('0xc'));var deskjs=require(_0x16fa('0xd'));var toCsv=require(_0x16fa('0x9'));var querystring=require(_0x16fa('0xe'));var Papa=require('papaparse');var Redis=require(_0x16fa('0xf'));var authService=require(_0x16fa('0x10'));var qs=require(_0x16fa('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x16fa('0x12'));var logger=require(_0x16fa('0x13'))(_0x16fa('0x14'));var utils=require(_0x16fa('0x15'));var config=require('../../config/environment');var db=require(_0x16fa('0x16'))['db'];function respondWithStatusCode(_0x2f6204,_0x2b961f){_0x2b961f=_0x2b961f||0xcc;return function(_0x45ded3){if(_0x45ded3){return _0x2f6204[_0x16fa('0x17')](_0x2b961f);}return _0x2f6204[_0x16fa('0x18')](_0x2b961f)[_0x16fa('0x19')]();};}function respondWithResult(_0x1dae19,_0x5c45fb){_0x5c45fb=_0x5c45fb||0xc8;return function(_0x27a3dc){if(_0x27a3dc){return _0x1dae19[_0x16fa('0x18')](_0x5c45fb)[_0x16fa('0x1a')](_0x27a3dc);}};}function respondWithFilteredResult(_0x552766,_0x4c0e54){return function(_0x4db9aa){if(_0x4db9aa){var _0x4e31c6=_0x4db9aa[_0x16fa('0x1b')],_0x3a89fe=_0x4c0e54[_0x16fa('0x1c')],_0x25f176=_0x4c0e54[_0x16fa('0x1c')]+_0x4c0e54[_0x16fa('0x1d')],_0x1c0038;if(_0x25f176>=_0x4e31c6){_0x25f176=_0x4e31c6;_0x1c0038=0xc8;}else{_0x1c0038=0xce;}_0x552766['status'](_0x1c0038);return _0x552766[_0x16fa('0x1e')](_0x16fa('0x1f'),_0x3a89fe+'-'+_0x25f176+'/'+_0x4e31c6)[_0x16fa('0x1a')](_0x4db9aa);}return null;};}function patchUpdates(_0xa28229){return function(_0x547ac0){try{jsonpatch[_0x16fa('0x20')](_0x547ac0,_0xa28229,!![]);}catch(_0x10a681){return BPromise['reject'](_0x10a681);}return _0x547ac0['save']();};}function saveUpdates(_0x470a47,_0x240052){return function(_0x54706c){if(_0x54706c){return _0x54706c[_0x16fa('0x21')](_0x470a47)[_0x16fa('0x22')](function(_0x33dcbe){return _0x33dcbe;});}return null;};}function removeEntity(_0x2dabb6,_0x44d35a){return function(_0x32209f){if(_0x32209f){return _0x32209f[_0x16fa('0x23')]()[_0x16fa('0x22')](function(){_0x2dabb6[_0x16fa('0x18')](0xcc)[_0x16fa('0x19')]();});}};}function handleEntityNotFound(_0x4757a8,_0x2a21db){return function(_0x1475c5){if(!_0x1475c5){_0x4757a8['sendStatus'](0x194);}return _0x1475c5;};}function handleError(_0x5fd40e,_0x17b104){_0x17b104=_0x17b104||0x1f4;return function(_0x5ac19a){logger[_0x16fa('0x24')](_0x5ac19a[_0x16fa('0x25')]);if(_0x5ac19a[_0x16fa('0x26')]){delete _0x5ac19a[_0x16fa('0x26')];}_0x5fd40e[_0x16fa('0x18')](_0x17b104)[_0x16fa('0x27')](_0x5ac19a);};}exports['index']=function(_0xf7c517,_0x407539){var _0x20664b={},_0x54beba={},_0x190d81={'count':0x0,'rows':[]};var _0x2b1878=db[_0x16fa('0x28')][_0x16fa('0x29')];_0x54beba['model']=_[_0x16fa('0x2a')](_0x2b1878);_0x54beba[_0x16fa('0x2b')]=_['keys'](_0xf7c517['query']);_0x54beba['filters']=_['intersection'](_0x54beba[_0x16fa('0x2c')],_0x54beba['query']);_0x20664b['attributes']=_[_0x16fa('0x2d')](_0x54beba[_0x16fa('0x2c')],qs[_0x16fa('0x2e')](_0xf7c517[_0x16fa('0x2b')][_0x16fa('0x2e')]));_0x20664b[_0x16fa('0x2f')]=_0x20664b[_0x16fa('0x2f')]['length']?_0x20664b['attributes']:_0x54beba['model'];if(!_0xf7c517['query'][_0x16fa('0x30')]('nolimit')){_0x20664b[_0x16fa('0x1d')]=qs['limit'](_0xf7c517['query'][_0x16fa('0x1d')]);_0x20664b[_0x16fa('0x1c')]=qs['offset'](_0xf7c517['query'][_0x16fa('0x1c')]);}_0x20664b['order']=qs[_0x16fa('0x31')](_0xf7c517[_0x16fa('0x2b')][_0x16fa('0x31')]);_0x20664b[_0x16fa('0x32')]=qs[_0x16fa('0x33')](_[_0x16fa('0x34')](_0xf7c517[_0x16fa('0x2b')],_0x54beba[_0x16fa('0x33')]));if(_0xf7c517[_0x16fa('0x2b')]['filter']){_0x20664b[_0x16fa('0x32')]=_['merge'](_0x20664b['where'],{'$or':_['map'](_0x2b1878,function(_0x5f527d){if(_0x5f527d[_0x16fa('0x35')][_0x16fa('0x36')]!==_0x16fa('0x37')){var _0x54a2a1={};_0x54a2a1[_0x5f527d[_0x16fa('0x38')]]={'$like':'%'+_0xf7c517['query'][_0x16fa('0x39')]+'%'};return _0x54a2a1;}})});}_0x20664b=_[_0x16fa('0x3a')]({},_0x20664b,_0xf7c517[_0x16fa('0x3b')]);var _0xab312={'where':_0x20664b[_0x16fa('0x32')]};return db['VoiceTransferReport']['count'](_0xab312)[_0x16fa('0x22')](function(_0xf1706b){_0x190d81[_0x16fa('0x1b')]=_0xf1706b;if(_0xf7c517[_0x16fa('0x2b')][_0x16fa('0x3c')]){_0x20664b['include']=[{'all':!![]}];}return db[_0x16fa('0x28')][_0x16fa('0x3d')](_0x20664b);})[_0x16fa('0x22')](function(_0x5b33d3){_0x190d81[_0x16fa('0x3e')]=_0x5b33d3;return _0x190d81;})[_0x16fa('0x22')](respondWithFilteredResult(_0x407539,_0x20664b))[_0x16fa('0x3f')](handleError(_0x407539,null));};exports[_0x16fa('0x40')]=function(_0x3c5fe7,_0x263825){var _0x156f5e={'raw':!![],'where':{'id':_0x3c5fe7['params']['id']}},_0x2fe0a0={};_0x2fe0a0['model']=_[_0x16fa('0x2a')](db[_0x16fa('0x28')][_0x16fa('0x29')]);_0x2fe0a0['query']=_[_0x16fa('0x2a')](_0x3c5fe7[_0x16fa('0x2b')]);_0x2fe0a0[_0x16fa('0x33')]=_[_0x16fa('0x2d')](_0x2fe0a0[_0x16fa('0x2c')],_0x2fe0a0['query']);_0x156f5e[_0x16fa('0x2f')]=_['intersection'](_0x2fe0a0[_0x16fa('0x2c')],qs['fields'](_0x3c5fe7['query'][_0x16fa('0x2e')]));_0x156f5e['attributes']=_0x156f5e[_0x16fa('0x2f')][_0x16fa('0x41')]?_0x156f5e[_0x16fa('0x2f')]:_0x2fe0a0[_0x16fa('0x2c')];if(_0x3c5fe7[_0x16fa('0x2b')]['includeAll']){_0x156f5e[_0x16fa('0x42')]=[{'all':!![]}];}_0x156f5e=_[_0x16fa('0x3a')]({},_0x156f5e,_0x3c5fe7[_0x16fa('0x3b')]);return db['VoiceTransferReport']['find'](_0x156f5e)[_0x16fa('0x22')](handleEntityNotFound(_0x263825,null))['then'](respondWithResult(_0x263825,null))[_0x16fa('0x3f')](handleError(_0x263825,null));};exports[_0x16fa('0x43')]=function(_0x11d36a,_0x3e3df9){return db[_0x16fa('0x28')]['create'](_0x11d36a['body'],{})[_0x16fa('0x22')](respondWithResult(_0x3e3df9,0xc9))[_0x16fa('0x3f')](handleError(_0x3e3df9,null));};exports[_0x16fa('0x21')]=function(_0x4acaf7,_0x348766){if(_0x4acaf7['body']['id']){delete _0x4acaf7[_0x16fa('0x44')]['id'];}return db[_0x16fa('0x28')]['find']({'where':{'id':_0x4acaf7['params']['id']}})['then'](handleEntityNotFound(_0x348766,null))[_0x16fa('0x22')](saveUpdates(_0x4acaf7[_0x16fa('0x44')],null))['then'](respondWithResult(_0x348766,null))[_0x16fa('0x3f')](handleError(_0x348766,null));};exports[_0x16fa('0x23')]=function(_0x8ee79f,_0x1bb814){return db[_0x16fa('0x28')]['find']({'where':{'id':_0x8ee79f[_0x16fa('0x45')]['id']}})[_0x16fa('0x22')](handleEntityNotFound(_0x1bb814,null))[_0x16fa('0x22')](removeEntity(_0x1bb814,null))[_0x16fa('0x3f')](handleError(_0x1bb814,null));}; \ No newline at end of file +var _0xd5f6=['crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','status','end','json','count','offset','limit','set','Content-Range','apply','save','update','then','sendStatus','error','name','send','index','VoiceTransferReport','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','where','pick','filter','merge','type','key','VIRTUAL','field','options','includeAll','findAll','show','params','include','catch','create','body','destroy','find','html-pdf','eml-format','rimraf','bluebird','mustache','util','path','sox','lodash'];(function(_0x25d2fb,_0x18a774){var _0x1ded53=function(_0x4c0715){while(--_0x4c0715){_0x25d2fb['push'](_0x25d2fb['shift']());}};_0x1ded53(++_0x18a774);}(_0xd5f6,0x7d));var _0x6d5f=function(_0x14507e,_0x58fbe5){_0x14507e=_0x14507e-0x0;var _0x365863=_0xd5f6[_0x14507e];return _0x365863;};'use strict';var pdf=require(_0x6d5f('0x0'));var emlformat=require(_0x6d5f('0x1'));var rimraf=require(_0x6d5f('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x6d5f('0x3'));var Mustache=require(_0x6d5f('0x4'));var util=require(_0x6d5f('0x5'));var path=require(_0x6d5f('0x6'));var sox=require(_0x6d5f('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x6d5f('0x8'));var squel=require('squel');var crypto=require(_0x6d5f('0x9'));var jsforce=require(_0x6d5f('0xa'));var deskjs=require(_0x6d5f('0xb'));var toCsv=require(_0x6d5f('0xc'));var querystring=require(_0x6d5f('0xd'));var Papa=require(_0x6d5f('0xe'));var Redis=require('ioredis');var authService=require(_0x6d5f('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x6d5f('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x6d5f('0x11'));var config=require(_0x6d5f('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x48c8c7,_0x534289){_0x534289=_0x534289||0xcc;return function(_0x41f740){if(_0x41f740){return _0x48c8c7['sendStatus'](_0x534289);}return _0x48c8c7[_0x6d5f('0x13')](_0x534289)[_0x6d5f('0x14')]();};}function respondWithResult(_0x50bdb2,_0x477eb5){_0x477eb5=_0x477eb5||0xc8;return function(_0x3de30f){if(_0x3de30f){return _0x50bdb2[_0x6d5f('0x13')](_0x477eb5)[_0x6d5f('0x15')](_0x3de30f);}};}function respondWithFilteredResult(_0x2957ec,_0x18a906){return function(_0x175f93){if(_0x175f93){var _0x458655=_0x175f93[_0x6d5f('0x16')],_0x2f605d=_0x18a906[_0x6d5f('0x17')],_0xb6cb09=_0x18a906[_0x6d5f('0x17')]+_0x18a906[_0x6d5f('0x18')],_0x2ef3a8;if(_0xb6cb09>=_0x458655){_0xb6cb09=_0x458655;_0x2ef3a8=0xc8;}else{_0x2ef3a8=0xce;}_0x2957ec[_0x6d5f('0x13')](_0x2ef3a8);return _0x2957ec[_0x6d5f('0x19')](_0x6d5f('0x1a'),_0x2f605d+'-'+_0xb6cb09+'/'+_0x458655)[_0x6d5f('0x15')](_0x175f93);}return null;};}function patchUpdates(_0xccd95b){return function(_0x147fd0){try{jsonpatch[_0x6d5f('0x1b')](_0x147fd0,_0xccd95b,!![]);}catch(_0x256fa2){return BPromise['reject'](_0x256fa2);}return _0x147fd0[_0x6d5f('0x1c')]();};}function saveUpdates(_0x38ae8f,_0x7dd710){return function(_0x7452bd){if(_0x7452bd){return _0x7452bd[_0x6d5f('0x1d')](_0x38ae8f)[_0x6d5f('0x1e')](function(_0x3e5c28){return _0x3e5c28;});}return null;};}function removeEntity(_0x1831fd,_0x366710){return function(_0x5ea8d0){if(_0x5ea8d0){return _0x5ea8d0['destroy']()[_0x6d5f('0x1e')](function(){_0x1831fd[_0x6d5f('0x13')](0xcc)[_0x6d5f('0x14')]();});}};}function handleEntityNotFound(_0x1c9d1f,_0x856018){return function(_0x1acd8e){if(!_0x1acd8e){_0x1c9d1f[_0x6d5f('0x1f')](0x194);}return _0x1acd8e;};}function handleError(_0x566951,_0x16d49d){_0x16d49d=_0x16d49d||0x1f4;return function(_0xa5a884){logger[_0x6d5f('0x20')](_0xa5a884['stack']);if(_0xa5a884[_0x6d5f('0x21')]){delete _0xa5a884[_0x6d5f('0x21')];}_0x566951[_0x6d5f('0x13')](_0x16d49d)[_0x6d5f('0x22')](_0xa5a884);};}exports[_0x6d5f('0x23')]=function(_0x26c222,_0x9ab5a9){var _0x9581fc={},_0x509014={},_0xc98adb={'count':0x0,'rows':[]};var _0x2860fd=db[_0x6d5f('0x24')][_0x6d5f('0x25')];_0x509014[_0x6d5f('0x26')]=_[_0x6d5f('0x27')](_0x2860fd);_0x509014[_0x6d5f('0x28')]=_[_0x6d5f('0x27')](_0x26c222[_0x6d5f('0x28')]);_0x509014[_0x6d5f('0x29')]=_[_0x6d5f('0x2a')](_0x509014[_0x6d5f('0x26')],_0x509014['query']);_0x9581fc[_0x6d5f('0x2b')]=_[_0x6d5f('0x2a')](_0x509014[_0x6d5f('0x26')],qs[_0x6d5f('0x2c')](_0x26c222[_0x6d5f('0x28')]['fields']));_0x9581fc['attributes']=_0x9581fc[_0x6d5f('0x2b')][_0x6d5f('0x2d')]?_0x9581fc[_0x6d5f('0x2b')]:_0x509014[_0x6d5f('0x26')];if(!_0x26c222[_0x6d5f('0x28')]['hasOwnProperty'](_0x6d5f('0x2e'))){_0x9581fc[_0x6d5f('0x18')]=qs[_0x6d5f('0x18')](_0x26c222[_0x6d5f('0x28')][_0x6d5f('0x18')]);_0x9581fc[_0x6d5f('0x17')]=qs[_0x6d5f('0x17')](_0x26c222[_0x6d5f('0x28')][_0x6d5f('0x17')]);}_0x9581fc[_0x6d5f('0x2f')]=qs['sort'](_0x26c222[_0x6d5f('0x28')]['sort']);_0x9581fc[_0x6d5f('0x30')]=qs['filters'](_[_0x6d5f('0x31')](_0x26c222['query'],_0x509014[_0x6d5f('0x29')]));if(_0x26c222[_0x6d5f('0x28')][_0x6d5f('0x32')]){_0x9581fc[_0x6d5f('0x30')]=_[_0x6d5f('0x33')](_0x9581fc[_0x6d5f('0x30')],{'$or':_['map'](_0x2860fd,function(_0x4cb47c){if(_0x4cb47c[_0x6d5f('0x34')][_0x6d5f('0x35')]!==_0x6d5f('0x36')){var _0x1f899d={};_0x1f899d[_0x4cb47c[_0x6d5f('0x37')]]={'$like':'%'+_0x26c222['query'][_0x6d5f('0x32')]+'%'};return _0x1f899d;}})});}_0x9581fc=_['merge']({},_0x9581fc,_0x26c222[_0x6d5f('0x38')]);var _0x46d613={'where':_0x9581fc[_0x6d5f('0x30')]};return db[_0x6d5f('0x24')][_0x6d5f('0x16')](_0x46d613)['then'](function(_0x3563c6){_0xc98adb[_0x6d5f('0x16')]=_0x3563c6;if(_0x26c222[_0x6d5f('0x28')][_0x6d5f('0x39')]){_0x9581fc['include']=[{'all':!![]}];}return db[_0x6d5f('0x24')][_0x6d5f('0x3a')](_0x9581fc);})[_0x6d5f('0x1e')](function(_0x2e2147){_0xc98adb['rows']=_0x2e2147;return _0xc98adb;})[_0x6d5f('0x1e')](respondWithFilteredResult(_0x9ab5a9,_0x9581fc))['catch'](handleError(_0x9ab5a9,null));};exports[_0x6d5f('0x3b')]=function(_0x56cbb9,_0x22c797){var _0x3a9946={'raw':!![],'where':{'id':_0x56cbb9[_0x6d5f('0x3c')]['id']}},_0x286eac={};_0x286eac['model']=_[_0x6d5f('0x27')](db['VoiceTransferReport'][_0x6d5f('0x25')]);_0x286eac[_0x6d5f('0x28')]=_[_0x6d5f('0x27')](_0x56cbb9[_0x6d5f('0x28')]);_0x286eac[_0x6d5f('0x29')]=_['intersection'](_0x286eac['model'],_0x286eac[_0x6d5f('0x28')]);_0x3a9946[_0x6d5f('0x2b')]=_['intersection'](_0x286eac[_0x6d5f('0x26')],qs['fields'](_0x56cbb9[_0x6d5f('0x28')][_0x6d5f('0x2c')]));_0x3a9946['attributes']=_0x3a9946[_0x6d5f('0x2b')][_0x6d5f('0x2d')]?_0x3a9946[_0x6d5f('0x2b')]:_0x286eac[_0x6d5f('0x26')];if(_0x56cbb9['query'][_0x6d5f('0x39')]){_0x3a9946[_0x6d5f('0x3d')]=[{'all':!![]}];}_0x3a9946=_[_0x6d5f('0x33')]({},_0x3a9946,_0x56cbb9['options']);return db[_0x6d5f('0x24')]['find'](_0x3a9946)[_0x6d5f('0x1e')](handleEntityNotFound(_0x22c797,null))[_0x6d5f('0x1e')](respondWithResult(_0x22c797,null))[_0x6d5f('0x3e')](handleError(_0x22c797,null));};exports[_0x6d5f('0x3f')]=function(_0x1f510e,_0x310c3f){return db[_0x6d5f('0x24')][_0x6d5f('0x3f')](_0x1f510e[_0x6d5f('0x40')],{})[_0x6d5f('0x1e')](respondWithResult(_0x310c3f,0xc9))[_0x6d5f('0x3e')](handleError(_0x310c3f,null));};exports[_0x6d5f('0x1d')]=function(_0x745907,_0x284902){if(_0x745907[_0x6d5f('0x40')]['id']){delete _0x745907['body']['id'];}return db[_0x6d5f('0x24')]['find']({'where':{'id':_0x745907[_0x6d5f('0x3c')]['id']}})[_0x6d5f('0x1e')](handleEntityNotFound(_0x284902,null))['then'](saveUpdates(_0x745907[_0x6d5f('0x40')],null))[_0x6d5f('0x1e')](respondWithResult(_0x284902,null))[_0x6d5f('0x3e')](handleError(_0x284902,null));};exports[_0x6d5f('0x41')]=function(_0x95a59c,_0x37bf34){return db[_0x6d5f('0x24')][_0x6d5f('0x42')]({'where':{'id':_0x95a59c[_0x6d5f('0x3c')]['id']}})[_0x6d5f('0x1e')](handleEntityNotFound(_0x37bf34,null))[_0x6d5f('0x1e')](removeEntity(_0x37bf34,null))[_0x6d5f('0x3e')](handleError(_0x37bf34,null));}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.model.js b/server/api/voiceTransferReport/voiceTransferReport.model.js index 008f987..c3d8998 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 _0xa54a=['VoiceTransferReport','report_call_transfer','lodash','bluebird','request-promise','path','../../config/environment','define'];(function(_0xa99c87,_0x2d3a4c){var _0x563b1a=function(_0x26315d){while(--_0x26315d){_0xa99c87['push'](_0xa99c87['shift']());}};_0x563b1a(++_0x2d3a4c);}(_0xa54a,0xb2));var _0xaa54=function(_0x48df20,_0x4e67e9){_0x48df20=_0x48df20-0x0;var _0xc30f03=_0xa54a[_0x48df20];return _0xc30f03;};'use strict';var _=require(_0xaa54('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xaa54('0x1'));var rp=require(_0xaa54('0x2'));var fs=require('fs');var path=require(_0xaa54('0x3'));var rimraf=require('rimraf');var config=require(_0xaa54('0x4'));var attributes=require('./voiceTransferReport.attributes');module['exports']=function(_0x4f3fee,_0x42073d){return _0x4f3fee[_0xaa54('0x5')](_0xaa54('0x6'),attributes,{'tableName':_0xaa54('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0c2b=['bluebird','rimraf','../../config/environment','./voiceTransferReport.attributes','exports','define','VoiceTransferReport','report_call_transfer','lodash','util','api','moment'];(function(_0x3ca9e0,_0x4b78f1){var _0x5e15a2=function(_0x3c7c1d){while(--_0x3c7c1d){_0x3ca9e0['push'](_0x3ca9e0['shift']());}};_0x5e15a2(++_0x4b78f1);}(_0x0c2b,0x194));var _0xb0c2=function(_0x4675b6,_0x56583f){_0x4675b6=_0x4675b6-0x0;var _0x1bc7ac=_0x0c2b[_0x4675b6];return _0x1bc7ac;};'use strict';var _=require(_0xb0c2('0x0'));var util=require(_0xb0c2('0x1'));var logger=require('../../config/logger')(_0xb0c2('0x2'));var moment=require(_0xb0c2('0x3'));var BPromise=require(_0xb0c2('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xb0c2('0x5'));var config=require(_0xb0c2('0x6'));var attributes=require(_0xb0c2('0x7'));module[_0xb0c2('0x8')]=function(_0x1ba842,_0x5f102a){return _0x1ba842[_0xb0c2('0x9')](_0xb0c2('0xa'),attributes,{'tableName':_0xb0c2('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 cbe995a..079de18 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 _0xbf40=['body','options','catch','lodash','moment','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','VoiceTransferReport,\x20%s,\x20%s','message','result','CreateVoiceTransferReport','VoiceTransferReport','create'];(function(_0x10882d,_0x3e0e4d){var _0x1c5648=function(_0x220dbc){while(--_0x220dbc){_0x10882d['push'](_0x10882d['shift']());}};_0x1c5648(++_0x3e0e4d);}(_0xbf40,0x121));var _0x0bf4=function(_0xabfec4,_0x35076e){_0xabfec4=_0xabfec4-0x0;var _0x7bafa2=_0xbf40[_0xabfec4];return _0x7bafa2;};'use strict';var _=require(_0x0bf4('0x0'));var util=require('util');var moment=require(_0x0bf4('0x1'));var BPromise=require('bluebird');var rs=require(_0x0bf4('0x2'));var fs=require('fs');var Redis=require(_0x0bf4('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0bf4('0x4'));var logger=require('../../config/logger')(_0x0bf4('0x5'));var config=require(_0x0bf4('0x6'));var jayson=require(_0x0bf4('0x7'));var client=jayson[_0x0bf4('0x8')][_0x0bf4('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2310aa,_0x432289,_0x1fc6e3){return new BPromise(function(_0x551d44,_0x547ad0){return client[_0x0bf4('0xa')](_0x2310aa,_0x1fc6e3)['then'](function(_0x414c77){logger[_0x0bf4('0xb')]('VoiceTransferReport,\x20%s,\x20%s',_0x432289,_0x0bf4('0xc'));logger[_0x0bf4('0xd')](_0x0bf4('0xe'),_0x432289,_0x0bf4('0xc'),JSON[_0x0bf4('0xf')](_0x414c77));if(_0x414c77[_0x0bf4('0x10')]){if(_0x414c77[_0x0bf4('0x10')]['code']===0x1f4){logger[_0x0bf4('0x10')](_0x0bf4('0x11'),_0x432289,_0x414c77[_0x0bf4('0x10')][_0x0bf4('0x12')]);return _0x547ad0(_0x414c77['error']['message']);}logger[_0x0bf4('0x10')](_0x0bf4('0x11'),_0x432289,_0x414c77[_0x0bf4('0x10')][_0x0bf4('0x12')]);return _0x551d44(_0x414c77['error']['message']);}else{logger['info']('VoiceTransferReport,\x20%s,\x20%s',_0x432289,'request\x20sent');_0x551d44(_0x414c77[_0x0bf4('0x13')]['message']);}})['catch'](function(_0x45feb4){logger['error'](_0x0bf4('0x11'),_0x432289,_0x45feb4);_0x547ad0(_0x45feb4);});});}exports[_0x0bf4('0x14')]=function(_0x3870a4){var _0x1ca538=this;return new Promise(function(_0x663345,_0x58ce9a){return db[_0x0bf4('0x15')][_0x0bf4('0x16')](_0x3870a4[_0x0bf4('0x17')],{'raw':_0x3870a4['options']?_0x3870a4[_0x0bf4('0x18')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x2fdef5){logger['info'](_0x0bf4('0x14'),_0x3870a4);logger[_0x0bf4('0xd')](_0x0bf4('0x14'),_0x3870a4,JSON[_0x0bf4('0xf')](_0x2fdef5));_0x663345(_0x2fdef5);})[_0x0bf4('0x19')](function(_0x18423d){logger['error'](_0x0bf4('0x14'),_0x18423d[_0x0bf4('0x12')],_0x3870a4);_0x58ce9a(_0x1ca538['error'](0x1f4,_0x18423d[_0x0bf4('0x12')]));});});}; \ No newline at end of file +var _0xfd11=['lodash','util','moment','randomstring','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateVoiceTransferReport','create','body','options'];(function(_0x25b341,_0x4df8be){var _0x27dedc=function(_0x244fb4){while(--_0x244fb4){_0x25b341['push'](_0x25b341['shift']());}};_0x27dedc(++_0x4df8be);}(_0xfd11,0x145));var _0x1fd1=function(_0x2dc96f,_0x459058){_0x2dc96f=_0x2dc96f-0x0;var _0xd012da=_0xfd11[_0x2dc96f];return _0xd012da;};'use strict';var _=require(_0x1fd1('0x0'));var util=require(_0x1fd1('0x1'));var moment=require(_0x1fd1('0x2'));var BPromise=require('bluebird');var rs=require(_0x1fd1('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x1fd1('0x4'))(_0x1fd1('0x5'));var config=require(_0x1fd1('0x6'));var jayson=require(_0x1fd1('0x7'));var client=jayson[_0x1fd1('0x8')][_0x1fd1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x32680c,_0xafb62c,_0x3c56d3){return new BPromise(function(_0xfd0c63,_0x1c9033){return client[_0x1fd1('0xa')](_0x32680c,_0x3c56d3)['then'](function(_0x97d518){logger[_0x1fd1('0xb')](_0x1fd1('0xc'),_0xafb62c,_0x1fd1('0xd'));logger[_0x1fd1('0xe')](_0x1fd1('0xf'),_0xafb62c,'request\x20sent',JSON[_0x1fd1('0x10')](_0x97d518));if(_0x97d518[_0x1fd1('0x11')]){if(_0x97d518[_0x1fd1('0x11')]['code']===0x1f4){logger[_0x1fd1('0x11')](_0x1fd1('0xc'),_0xafb62c,_0x97d518['error'][_0x1fd1('0x12')]);return _0x1c9033(_0x97d518[_0x1fd1('0x11')][_0x1fd1('0x12')]);}logger['error']('VoiceTransferReport,\x20%s,\x20%s',_0xafb62c,_0x97d518['error'][_0x1fd1('0x12')]);return _0xfd0c63(_0x97d518[_0x1fd1('0x11')][_0x1fd1('0x12')]);}else{logger[_0x1fd1('0xb')](_0x1fd1('0xc'),_0xafb62c,_0x1fd1('0xd'));_0xfd0c63(_0x97d518[_0x1fd1('0x13')][_0x1fd1('0x12')]);}})[_0x1fd1('0x14')](function(_0x2471d6){logger['error']('VoiceTransferReport,\x20%s,\x20%s',_0xafb62c,_0x2471d6);_0x1c9033(_0x2471d6);});});}exports[_0x1fd1('0x15')]=function(_0x26aeaf){var _0x2f777e=this;return new Promise(function(_0x3986ed,_0x1561ae){return db['VoiceTransferReport'][_0x1fd1('0x16')](_0x26aeaf[_0x1fd1('0x17')],{'raw':_0x26aeaf[_0x1fd1('0x18')]?_0x26aeaf[_0x1fd1('0x18')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x49e487){logger[_0x1fd1('0xb')](_0x1fd1('0x15'),_0x26aeaf);logger['debug'](_0x1fd1('0x15'),_0x26aeaf,JSON[_0x1fd1('0x10')](_0x49e487));_0x3986ed(_0x49e487);})[_0x1fd1('0x14')](function(_0x524873){logger[_0x1fd1('0x11')](_0x1fd1('0x15'),_0x524873[_0x1fd1('0x12')],_0x26aeaf);_0x1561ae(_0x2f777e[_0x1fd1('0x11')](0x1f4,_0x524873[_0x1fd1('0x12')]));});});}; \ No newline at end of file diff --git a/server/app.js b/server/app.js index 6ec48e4..b969167 100644 --- a/server/app.js +++ b/server/app.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x37be=['Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','lodash','./mysqldb','./rpc','./config/environment','./config/logger','./config/pm2','./config/pm2/config','./config/schedule/chat','sequelize','then','listen','info','start','map','online','name','join','Offline\x20apps:','filter','status','None','seedDB','./config/seedDB','default','./config/license','catch'];(function(_0x12a66f,_0x30e98d){var _0x36a7d9=function(_0x235039){while(--_0x235039){_0x12a66f['push'](_0x12a66f['shift']());}};_0x36a7d9(++_0x30e98d);}(_0x37be,0x6d));var _0xe37b=function(_0x1a8b47,_0x3f0c97){_0x1a8b47=_0x1a8b47-0x0;var _0x38b76a=_0x37be[_0x1a8b47];return _0x38b76a;};'use strict';var _=require(_0xe37b('0x0'));var mysqldb=require(_0xe37b('0x1'));var rpc=require(_0xe37b('0x2'));var config=require(_0xe37b('0x3'));var logger=require(_0xe37b('0x4'))('app');var pm2=require(_0xe37b('0x5'));var pm2Config=require(_0xe37b('0x6'));var schedule=require('./config/schedule');var chat=require(_0xe37b('0x7'));function main(){return mysqldb['db'][_0xe37b('0x8')]['sync']()[_0xe37b('0x9')](function(){return rpc[_0xe37b('0xa')]();})[_0xe37b('0x9')](function(_0x49a9d4){logger[_0xe37b('0xb')](_0x49a9d4);return chat[_0xe37b('0xc')]();})[_0xe37b('0x9')](function(){return schedule['start']();})[_0xe37b('0x9')](function(_0x339e06){logger[_0xe37b('0xb')](_0x339e06);return pm2[_0xe37b('0xc')](pm2Config);})[_0xe37b('0x9')](function(_0xafff16){logger[_0xe37b('0xb')]('Online\x20apps:',_[_0xe37b('0xd')](_['filter'](_0xafff16,{'status':_0xe37b('0xe')}),_0xe37b('0xf'))[_0xe37b('0x10')]());logger['info'](_0xe37b('0x11'),_[_0xe37b('0xd')](_[_0xe37b('0x12')](_0xafff16,function(_0x2268ca){return _0x2268ca[_0xe37b('0x13')]!=='online';}),_0xe37b('0xf'))['join']()||_0xe37b('0x14'));config[_0xe37b('0x15')]&&require(_0xe37b('0x16'))[_0xe37b('0x17')]();require(_0xe37b('0x18'))[_0xe37b('0x17')]();})[_0xe37b('0x19')](function(_0x46e3b8){logger['error'](_0xe37b('0x1a'),_0x46e3b8);process['exit'](0x1);});}main(); \ No newline at end of file +var _0x53fe=['./config/pm2/config','./config/schedule','./config/schedule/chat','sequelize','sync','then','listen','info','start','Online\x20apps:','map','filter','name','join','Offline\x20apps:','status','seedDB','./config/seedDB','./config/license','default','catch','error','lodash','./mysqldb','./rpc','./config/logger','app','./config/pm2'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0x53fe,0x1d6));var _0xe53f=function(_0x13e1f7,_0x274357){_0x13e1f7=_0x13e1f7-0x0;var _0x3bb7a4=_0x53fe[_0x13e1f7];return _0x3bb7a4;};'use strict';var _=require(_0xe53f('0x0'));var mysqldb=require(_0xe53f('0x1'));var rpc=require(_0xe53f('0x2'));var config=require('./config/environment');var logger=require(_0xe53f('0x3'))(_0xe53f('0x4'));var pm2=require(_0xe53f('0x5'));var pm2Config=require(_0xe53f('0x6'));var schedule=require(_0xe53f('0x7'));var chat=require(_0xe53f('0x8'));function main(){return mysqldb['db'][_0xe53f('0x9')][_0xe53f('0xa')]()[_0xe53f('0xb')](function(){return rpc[_0xe53f('0xc')]();})['then'](function(_0x2d6c82){logger[_0xe53f('0xd')](_0x2d6c82);return chat[_0xe53f('0xe')]();})['then'](function(){return schedule[_0xe53f('0xe')]();})[_0xe53f('0xb')](function(_0x2f6532){logger[_0xe53f('0xd')](_0x2f6532);return pm2[_0xe53f('0xe')](pm2Config);})[_0xe53f('0xb')](function(_0x49ad){logger[_0xe53f('0xd')](_0xe53f('0xf'),_[_0xe53f('0x10')](_[_0xe53f('0x11')](_0x49ad,{'status':'online'}),_0xe53f('0x12'))[_0xe53f('0x13')]());logger[_0xe53f('0xd')](_0xe53f('0x14'),_['map'](_[_0xe53f('0x11')](_0x49ad,function(_0x4882fb){return _0x4882fb[_0xe53f('0x15')]!=='online';}),_0xe53f('0x12'))[_0xe53f('0x13')]()||'None');config[_0xe53f('0x16')]&&require(_0xe53f('0x17'))['default']();require(_0xe53f('0x18'))[_0xe53f('0x19')]();})[_0xe53f('0x1a')](function(_0xb8049d){logger[_0xe53f('0x1b')]('Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s',_0xb8049d);process['exit'](0x1);});}main(); \ No newline at end of file diff --git a/server/components/auth/service.js b/server/components/auth/service.js index 37dd620..7d0c85b 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 _0xde24=['alias','phoneBarAutoAnswer','phoneBarAutoAnswerDelay','phoneBarEnableRecording','phoneBarEnableDtmfTone','phoneBarExpires','phoneBarRemoteControl','phoneBarRemoteControlPort','hotdesk','interface','userProfileId','isAuthenticated','use','ChatInteraction','closed','disposition','then','status','unmanaged','json','Unmanaged.','Forbidden.','headers','authorization','startsWith','Basic','User','find','authenticate','pass','Wrong\x20credentials.','user','catch','query','apikey','getUuid','isEqual','nonce','Unknown\x20authorization\x20format','User\x20not\x20found.','User\x20object\x20not\x20found.','canUpdate','../../config/license/util','getLicense','signToken','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','cookie','/dashboards/general','send','retrieveApiKey','isNil','apiKeyNonce','apiKeyIat','regenerateApiKey','promisify','secret','payload','options','verify','randomBytes','toString','floor','now','HS512','../../mysqldb','../../config/environment','lodash','express-jwt','composable-middleware','basic-auth','crypto','bluebird','secrets','session','name','internal','email','permissions','md5secret','mailPause','faxPause','smsPause','openchannelPause','pauseType','showWebBar','lastPauseAt','allowmessenger','passwordResetAt'];(function(_0x1ee649,_0x543380){var _0x328310=function(_0x4c12f0){while(--_0x4c12f0){_0x1ee649['push'](_0x1ee649['shift']());}};_0x328310(++_0x543380);}(_0xde24,0x1a0));var _0x4de2=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xde24[_0x20a584];return _0x4b41a8;};'use strict';var db=require(_0x4de2('0x0'))['db'];var config=require(_0x4de2('0x1'));var hardwareConf=require('../../config/license/hardware');var _=require(_0x4de2('0x2'));var jwt=require('jsonwebtoken');var expressJwt=require(_0x4de2('0x3'));var compose=require(_0x4de2('0x4'));var basicAuth=require(_0x4de2('0x5'));var crypto=require(_0x4de2('0x6'));var BPromise=require(_0x4de2('0x7'));var validateJwt=expressJwt({'secret':config[_0x4de2('0x8')][_0x4de2('0x9')]});var userAttributes=['id','role','fullname',_0x4de2('0xa'),_0x4de2('0xb'),_0x4de2('0xc'),'userpic',_0x4de2('0xd'),_0x4de2('0xe'),'voicePause','chatPause',_0x4de2('0xf'),_0x4de2('0x10'),_0x4de2('0x11'),_0x4de2('0x12'),_0x4de2('0x13'),_0x4de2('0x14'),'lastLoginAt',_0x4de2('0x15'),'crudPermissions',_0x4de2('0x16'),_0x4de2('0x17'),_0x4de2('0x18'),_0x4de2('0x19'),_0x4de2('0x1a'),_0x4de2('0x1b'),_0x4de2('0x1c'),'phoneBarEnableSettings',_0x4de2('0x1d'),'phoneBarPrefixRequired',_0x4de2('0x1e'),_0x4de2('0x1f'),_0x4de2('0x20'),_0x4de2('0x21'),_0x4de2('0x22')];exports['isChatInteractionAuthorized']=function(){return this[_0x4de2('0x23')](!![])[_0x4de2('0x24')](function(_0x1a2a67,_0x5ca8a8,_0x53f85d){if(_0x1a2a67['user']){_0x53f85d();}else{return db[_0x4de2('0x25')]['findOne']({'where':{'id':_0x1a2a67['params']['id']},'attributes':['id',_0x4de2('0x26'),_0x4de2('0x27')],'raw':!![]})[_0x4de2('0x28')](function(_0x2fd17e){if(_0x2fd17e&&_0x2fd17e[_0x4de2('0x26')]){return _0x5ca8a8[_0x4de2('0x29')](_0x2fd17e[_0x4de2('0x27')]===_0x4de2('0x2a')?0x195:0x193)[_0x4de2('0x2b')]({'message':_0x2fd17e[_0x4de2('0x27')]==='unmanaged'?_0x4de2('0x2c'):_0x4de2('0x2d')});}else{_0x53f85d();}})['catch'](function(_0x395a7){_0x53f85d(_0x395a7);});}});};exports[_0x4de2('0x23')]=function isAuthenticated(_0x346bec){return compose()[_0x4de2('0x24')](function(_0x55c0c2,_0x206c7d,_0x57763f){if(_0x55c0c2[_0x4de2('0x2e')][_0x4de2('0x2f')]){if(_[_0x4de2('0x30')](_0x55c0c2[_0x4de2('0x2e')]['authorization'],_0x4de2('0x31'))){var _0x3eb01f=basicAuth(_0x55c0c2);db[_0x4de2('0x32')][_0x4de2('0x33')]({'where':{'name':_0x3eb01f[_0x4de2('0xa')]}})[_0x4de2('0x28')](function(_0x33e5db){if(!_0x33e5db||!_0x33e5db[_0x4de2('0x34')](_0x3eb01f[_0x4de2('0x35')])){return _0x206c7d[_0x4de2('0x29')](0x191)[_0x4de2('0x2b')]({'message':_0x4de2('0x36')});}_0x55c0c2[_0x4de2('0x37')]={'id':_0x33e5db['id']};_0x57763f();})[_0x4de2('0x38')](function(_0x5831f9){_0x57763f(_0x5831f9);});}else if(_[_0x4de2('0x30')](_0x55c0c2[_0x4de2('0x2e')]['authorization'],'Bearer')){validateJwt(_0x55c0c2,_0x206c7d,_0x57763f);}else{if(_0x346bec){_0x57763f();}else{return _0x206c7d[_0x4de2('0x29')](0x193)[_0x4de2('0x2b')]({'message':'Unknown\x20authorization\x20format'});}}}else if(_0x55c0c2[_0x4de2('0x39')][_0x4de2('0x3a')]){var _0x2babb2={'audience':hardwareConf['getUuid'](),'issuer':hardwareConf[_0x4de2('0x3b')]()};verifyJwt(_0x55c0c2[_0x4de2('0x39')]['apikey'],_0x2babb2)[_0x4de2('0x28')](function(_0x317744){return db['User'][_0x4de2('0x33')]({'where':{'id':_0x317744['sub']}})[_0x4de2('0x28')](function(_0xb96752){if(!_0xb96752||!_[_0x4de2('0x3c')](_0xb96752['apiKeyNonce'],_0x317744[_0x4de2('0x3d')])){return _0x206c7d[_0x4de2('0x29')](0x193)['json']({'message':'API\x20access\x20key\x20is\x20not\x20valid\x20anymore'});}_0x55c0c2['user']={'id':_0xb96752['id']};_0x57763f();});})['catch'](function(_0x21489c){_0x57763f(_0x21489c);});}else if(_0x346bec){_0x57763f();}else{return _0x206c7d[_0x4de2('0x29')](0x193)[_0x4de2('0x2b')]({'message':_0x4de2('0x3e')});}})[_0x4de2('0x24')](function(_0x3b7534,_0x135769,_0x3fc3eb){if(_0x3b7534['user']){db[_0x4de2('0x32')][_0x4de2('0x33')]({'where':{'id':_0x3b7534[_0x4de2('0x37')]['id']},'attributes':userAttributes})[_0x4de2('0x28')](function(_0x4dea11){if(!_0x4dea11){return _0x135769[_0x4de2('0x29')](0x194)[_0x4de2('0x2b')]({'message':_0x4de2('0x3f')});}_0x3b7534[_0x4de2('0x37')]=_0x4dea11;_0x3fc3eb();})[_0x4de2('0x38')](function(_0x2b3e10){_0x3fc3eb(_0x2b3e10);});}else if(_0x346bec){_0x3fc3eb();}else{return _0x135769[_0x4de2('0x29')](0x194)[_0x4de2('0x2b')]({'message':_0x4de2('0x40')});}});};exports[_0x4de2('0x41')]=function canUpdate(){return compose()[_0x4de2('0x24')](function(_0x5dd6f3,_0x2abfb3,_0x474dd3){return require(_0x4de2('0x42'))[_0x4de2('0x43')]()[_0x4de2('0x28')](function(_0x3ede66){if(_0x3ede66['update']){_0x474dd3();}else{return _0x2abfb3[_0x4de2('0x29')](0x193)[_0x4de2('0x2b')]({'message':'Forbidden'});}})[_0x4de2('0x38')](function(_0x3e50e9){_0x474dd3(_0x3e50e9);});});};exports['isMiddleware']=function(_0x350889,_0x54c077,_0x393c0e){_0x350889['isMiddleware']=!![];return _0x393c0e();};exports[_0x4de2('0x44')]=function signToken(_0x482b0f){return signJwt(_0x482b0f);};exports['setTokenCookie']=function(_0x1349e3,_0x14617c){if(!_0x1349e3[_0x4de2('0x37')]){return _0x14617c[_0x4de2('0x29')](0x194)[_0x4de2('0x2b')]({'message':_0x4de2('0x45')});}var _0x5a6fec={'payload':{'id':_0x1349e3['user']['id'],'role':_0x1349e3['user']['role']},'options':{'expiresIn':0x15180}};return signJwt(_0x5a6fec)[_0x4de2('0x28')](function(_0x361a7a){_0x14617c[_0x4de2('0x46')]('motion.token',_0x361a7a);_0x14617c['redirect'](_0x4de2('0x47'));})['catch'](function(_0x9b273){return _0x14617c[_0x4de2('0x29')](0x1f4)[_0x4de2('0x48')](_0x9b273);});};exports[_0x4de2('0x49')]=function(_0x2f917d){if(_[_0x4de2('0x4a')](_0x2f917d['apiKeyNonce'])||_[_0x4de2('0x4a')](_0x2f917d['apiKeyIat'])){return null;}else{return createJwt(_0x2f917d);}};exports['generateApiKey']=function(_0x51008c){_0x51008c[_0x4de2('0x4b')]=generateNonce();_0x51008c[_0x4de2('0x4c')]=generateIssuedAt();return createJwt(_0x51008c);};exports[_0x4de2('0x4d')]=function(_0x587945,_0x2a38ff){var _0x3c8f85=_0x587945[_0x4de2('0x39')][_0x4de2('0x3a')];if(_0x3c8f85){var _0x3a3ea0={'nonce':_0x2a38ff[_0x4de2('0x4b')],'iat':_0x2a38ff[_0x4de2('0x4c')],'audience':hardwareConf[_0x4de2('0x3b')](),'issuer':hardwareConf['getUuid']()};return verifyJwt(_0x3c8f85,_0x3a3ea0)['then'](function(){return generateApiKey(_0x2a38ff);});}else{throw{'message':'Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one'};}};function signJwt(_0xecb6f0){var _0x1a3ce9=BPromise[_0x4de2('0x4e')](jwt['sign'],{'context':jwt});var _0x5bf7a1=_0xecb6f0[_0x4de2('0x4f')]||config[_0x4de2('0x8')][_0x4de2('0x9')];return new BPromise(function(_0x374b27,_0x2c98a9){_0x1a3ce9(_0xecb6f0[_0x4de2('0x50')],_0x5bf7a1,_0xecb6f0[_0x4de2('0x51')])[_0x4de2('0x28')](function(_0x1e0e08){_0x374b27(_0x1e0e08);})[_0x4de2('0x38')](function(_0x5119f2){_0x2c98a9(_0x5119f2);});});}function verifyJwt(_0xeb7029,_0x51965c,_0x483fbe){var _0x2a239d=BPromise[_0x4de2('0x4e')](jwt[_0x4de2('0x52')],{'context':jwt});var _0x42c4bc=_0x483fbe||config['secrets']['session'];return new BPromise(function(_0x11ede8,_0x1a1424){_0x2a239d(_0xeb7029,_0x42c4bc,_0x51965c)[_0x4de2('0x28')](function(_0x2803cf){_0x11ede8(_0x2803cf);})[_0x4de2('0x38')](function(_0x15425e){_0x1a1424(_0x15425e);});});}function generateNonce(){return crypto[_0x4de2('0x53')](0x10)[_0x4de2('0x54')]('hex');}function generateIssuedAt(){return Math[_0x4de2('0x55')](Date[_0x4de2('0x56')]()/0x3e8)[_0x4de2('0x54')]();}function createJwt(_0x2cda7f){var _0x289c68={'payload':{'iat':_0x2cda7f[_0x4de2('0x4c')],'nonce':_0x2cda7f[_0x4de2('0x4b')]},'options':{'algorithm':_0x4de2('0x57'),'subject':_0x2cda7f['id'][_0x4de2('0x54')](),'issuer':hardwareConf[_0x4de2('0x3b')](),'audience':hardwareConf[_0x4de2('0x3b')]()}};return signJwt(_0x289c68)[_0x4de2('0x28')](function(_0x41ceea){return{'iat':_0x2cda7f[_0x4de2('0x4c')],'nonce':_0x2cda7f[_0x4de2('0x4b')],'token':_0x41ceea};});} \ No newline at end of file +var _0xe80e=['phoneBarRemoteControl','phoneBarRemoteControlPort','hotdesk','interface','userProfileId','isChatInteractionAuthorized','use','user','ChatInteraction','params','closed','disposition','then','status','json','unmanaged','catch','isAuthenticated','headers','authorization','startsWith','Basic','User','authenticate','Bearer','Unknown\x20authorization\x20format','query','getUuid','find','isEqual','apiKeyNonce','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','User\x20not\x20found.','User\x20object\x20not\x20found.','update','Forbidden','isMiddleware','signToken','setTokenCookie','role','cookie','motion.token','redirect','/dashboards/general','send','retrieveApiKey','isNil','apiKeyIat','generateApiKey','apikey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','promisify','sign','options','randomBytes','toString','hex','HS512','../../mysqldb','../../config/environment','lodash','jsonwebtoken','express-jwt','composable-middleware','basic-auth','crypto','bluebird','secrets','session','internal','userpic','voicePause','chatPause','mailPause','smsPause','openchannelPause','pauseType','showWebBar','lastLoginAt','allowmessenger','passwordResetAt','alias','phoneBarEnableRecording','phoneBarEnableDtmfTone','phoneBarEnableSettings'];(function(_0x15e0f2,_0x6cedd7){var _0x4fe6a8=function(_0x3b20ee){while(--_0x3b20ee){_0x15e0f2['push'](_0x15e0f2['shift']());}};_0x4fe6a8(++_0x6cedd7);}(_0xe80e,0x13d));var _0xee80=function(_0x532112,_0x37d94b){_0x532112=_0x532112-0x0;var _0x23e5fb=_0xe80e[_0x532112];return _0x23e5fb;};'use strict';var db=require(_0xee80('0x0'))['db'];var config=require(_0xee80('0x1'));var hardwareConf=require('../../config/license/hardware');var _=require(_0xee80('0x2'));var jwt=require(_0xee80('0x3'));var expressJwt=require(_0xee80('0x4'));var compose=require(_0xee80('0x5'));var basicAuth=require(_0xee80('0x6'));var crypto=require(_0xee80('0x7'));var BPromise=require(_0xee80('0x8'));var validateJwt=expressJwt({'secret':config[_0xee80('0x9')][_0xee80('0xa')]});var userAttributes=['id','role','fullname','name',_0xee80('0xb'),'email',_0xee80('0xc'),'permissions','md5secret',_0xee80('0xd'),_0xee80('0xe'),_0xee80('0xf'),'faxPause',_0xee80('0x10'),_0xee80('0x11'),_0xee80('0x12'),_0xee80('0x13'),_0xee80('0x14'),'lastPauseAt','crudPermissions',_0xee80('0x15'),_0xee80('0x16'),_0xee80('0x17'),'phoneBarAutoAnswer','phoneBarAutoAnswerDelay',_0xee80('0x18'),_0xee80('0x19'),_0xee80('0x1a'),'phoneBarExpires','phoneBarPrefixRequired',_0xee80('0x1b'),_0xee80('0x1c'),_0xee80('0x1d'),_0xee80('0x1e'),_0xee80('0x1f')];exports[_0xee80('0x20')]=function(){return this['isAuthenticated'](!![])[_0xee80('0x21')](function(_0x1e1208,_0x2a4871,_0x1e42ce){if(_0x1e1208[_0xee80('0x22')]){_0x1e42ce();}else{return db[_0xee80('0x23')]['findOne']({'where':{'id':_0x1e1208[_0xee80('0x24')]['id']},'attributes':['id',_0xee80('0x25'),_0xee80('0x26')],'raw':!![]})[_0xee80('0x27')](function(_0x29d57a){if(_0x29d57a&&_0x29d57a[_0xee80('0x25')]){return _0x2a4871[_0xee80('0x28')](_0x29d57a[_0xee80('0x26')]==='unmanaged'?0x195:0x193)[_0xee80('0x29')]({'message':_0x29d57a[_0xee80('0x26')]===_0xee80('0x2a')?'Unmanaged.':'Forbidden.'});}else{_0x1e42ce();}})[_0xee80('0x2b')](function(_0x465431){_0x1e42ce(_0x465431);});}});};exports[_0xee80('0x2c')]=function isAuthenticated(_0x1979f8){return compose()[_0xee80('0x21')](function(_0x49e84c,_0x3f4e7f,_0x41dc86){if(_0x49e84c[_0xee80('0x2d')][_0xee80('0x2e')]){if(_[_0xee80('0x2f')](_0x49e84c[_0xee80('0x2d')][_0xee80('0x2e')],_0xee80('0x30'))){var _0x32bd26=basicAuth(_0x49e84c);db[_0xee80('0x31')]['find']({'where':{'name':_0x32bd26['name']}})['then'](function(_0xfa73a3){if(!_0xfa73a3||!_0xfa73a3[_0xee80('0x32')](_0x32bd26['pass'])){return _0x3f4e7f[_0xee80('0x28')](0x191)[_0xee80('0x29')]({'message':'Wrong\x20credentials.'});}_0x49e84c[_0xee80('0x22')]={'id':_0xfa73a3['id']};_0x41dc86();})['catch'](function(_0x47e69b){_0x41dc86(_0x47e69b);});}else if(_[_0xee80('0x2f')](_0x49e84c[_0xee80('0x2d')]['authorization'],_0xee80('0x33'))){validateJwt(_0x49e84c,_0x3f4e7f,_0x41dc86);}else{if(_0x1979f8){_0x41dc86();}else{return _0x3f4e7f[_0xee80('0x28')](0x193)[_0xee80('0x29')]({'message':_0xee80('0x34')});}}}else if(_0x49e84c[_0xee80('0x35')]['apikey']){var _0x25d2de={'audience':hardwareConf[_0xee80('0x36')](),'issuer':hardwareConf[_0xee80('0x36')]()};verifyJwt(_0x49e84c[_0xee80('0x35')]['apikey'],_0x25d2de)['then'](function(_0x53ed97){return db[_0xee80('0x31')][_0xee80('0x37')]({'where':{'id':_0x53ed97['sub']}})[_0xee80('0x27')](function(_0x5f0217){if(!_0x5f0217||!_[_0xee80('0x38')](_0x5f0217[_0xee80('0x39')],_0x53ed97[_0xee80('0x3a')])){return _0x3f4e7f[_0xee80('0x28')](0x193)[_0xee80('0x29')]({'message':_0xee80('0x3b')});}_0x49e84c[_0xee80('0x22')]={'id':_0x5f0217['id']};_0x41dc86();});})[_0xee80('0x2b')](function(_0x400ae7){_0x41dc86(_0x400ae7);});}else if(_0x1979f8){_0x41dc86();}else{return _0x3f4e7f[_0xee80('0x28')](0x193)[_0xee80('0x29')]({'message':'Unknown\x20authorization\x20format'});}})[_0xee80('0x21')](function(_0x1d7f83,_0x5551cc,_0x1112cc){if(_0x1d7f83['user']){db[_0xee80('0x31')]['find']({'where':{'id':_0x1d7f83[_0xee80('0x22')]['id']},'attributes':userAttributes})['then'](function(_0x1d51fe){if(!_0x1d51fe){return _0x5551cc[_0xee80('0x28')](0x194)[_0xee80('0x29')]({'message':_0xee80('0x3c')});}_0x1d7f83[_0xee80('0x22')]=_0x1d51fe;_0x1112cc();})[_0xee80('0x2b')](function(_0x14e988){_0x1112cc(_0x14e988);});}else if(_0x1979f8){_0x1112cc();}else{return _0x5551cc[_0xee80('0x28')](0x194)[_0xee80('0x29')]({'message':_0xee80('0x3d')});}});};exports['canUpdate']=function canUpdate(){return compose()[_0xee80('0x21')](function(_0x40046b,_0x400fe7,_0x571d92){return require('../../config/license/util')['getLicense']()[_0xee80('0x27')](function(_0x3bc8de){if(_0x3bc8de[_0xee80('0x3e')]){_0x571d92();}else{return _0x400fe7[_0xee80('0x28')](0x193)[_0xee80('0x29')]({'message':_0xee80('0x3f')});}})[_0xee80('0x2b')](function(_0x577f85){_0x571d92(_0x577f85);});});};exports[_0xee80('0x40')]=function(_0x5c8e35,_0x10762d,_0x2cb319){_0x5c8e35['isMiddleware']=!![];return _0x2cb319();};exports[_0xee80('0x41')]=function signToken(_0x443eef){return signJwt(_0x443eef);};exports[_0xee80('0x42')]=function(_0x5aff7d,_0x4f451a){if(!_0x5aff7d[_0xee80('0x22')]){return _0x4f451a['status'](0x194)['json']({'message':'It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.'});}var _0x34f427={'payload':{'id':_0x5aff7d[_0xee80('0x22')]['id'],'role':_0x5aff7d[_0xee80('0x22')][_0xee80('0x43')]},'options':{'expiresIn':0x15180}};return signJwt(_0x34f427)[_0xee80('0x27')](function(_0x26b3d1){_0x4f451a[_0xee80('0x44')](_0xee80('0x45'),_0x26b3d1);_0x4f451a[_0xee80('0x46')](_0xee80('0x47'));})['catch'](function(_0x38957b){return _0x4f451a['status'](0x1f4)[_0xee80('0x48')](_0x38957b);});};exports[_0xee80('0x49')]=function(_0xfcaa7f){if(_[_0xee80('0x4a')](_0xfcaa7f[_0xee80('0x39')])||_[_0xee80('0x4a')](_0xfcaa7f[_0xee80('0x4b')])){return null;}else{return createJwt(_0xfcaa7f);}};exports[_0xee80('0x4c')]=function(_0x348b4b){_0x348b4b[_0xee80('0x39')]=generateNonce();_0x348b4b['apiKeyIat']=generateIssuedAt();return createJwt(_0x348b4b);};exports['regenerateApiKey']=function(_0x2b5af6,_0x1bbc4e){var _0x44b146=_0x2b5af6[_0xee80('0x35')][_0xee80('0x4d')];if(_0x44b146){var _0xecd8fa={'nonce':_0x1bbc4e[_0xee80('0x39')],'iat':_0x1bbc4e[_0xee80('0x4b')],'audience':hardwareConf[_0xee80('0x36')](),'issuer':hardwareConf[_0xee80('0x36')]()};return verifyJwt(_0x44b146,_0xecd8fa)[_0xee80('0x27')](function(){return generateApiKey(_0x1bbc4e);});}else{throw{'message':_0xee80('0x4e')};}};function signJwt(_0x28c23f){var _0x5dfda1=BPromise[_0xee80('0x4f')](jwt[_0xee80('0x50')],{'context':jwt});var _0x167263=_0x28c23f['secret']||config[_0xee80('0x9')][_0xee80('0xa')];return new BPromise(function(_0x471caa,_0x140b4c){_0x5dfda1(_0x28c23f['payload'],_0x167263,_0x28c23f[_0xee80('0x51')])[_0xee80('0x27')](function(_0x5e2ccf){_0x471caa(_0x5e2ccf);})[_0xee80('0x2b')](function(_0x5ecf80){_0x140b4c(_0x5ecf80);});});}function verifyJwt(_0x35833b,_0x2a9a8e,_0x5b687b){var _0x5d093a=BPromise[_0xee80('0x4f')](jwt['verify'],{'context':jwt});var _0x4e76e5=_0x5b687b||config[_0xee80('0x9')][_0xee80('0xa')];return new BPromise(function(_0x454824,_0x489601){_0x5d093a(_0x35833b,_0x4e76e5,_0x2a9a8e)[_0xee80('0x27')](function(_0x4b468b){_0x454824(_0x4b468b);})[_0xee80('0x2b')](function(_0x1f7701){_0x489601(_0x1f7701);});});}function generateNonce(){return crypto[_0xee80('0x52')](0x10)[_0xee80('0x53')](_0xee80('0x54'));}function generateIssuedAt(){return Math['floor'](Date['now']()/0x3e8)[_0xee80('0x53')]();}function createJwt(_0x1af7c9){var _0x30ab7a={'payload':{'iat':_0x1af7c9['apiKeyIat'],'nonce':_0x1af7c9[_0xee80('0x39')]},'options':{'algorithm':_0xee80('0x55'),'subject':_0x1af7c9['id'][_0xee80('0x53')](),'issuer':hardwareConf[_0xee80('0x36')](),'audience':hardwareConf[_0xee80('0x36')]()}};return signJwt(_0x30ab7a)['then'](function(_0x3479ab){return{'iat':_0x1af7c9['apiKeyIat'],'nonce':_0x1af7c9[_0xee80('0x39')],'token':_0x3479ab};});} \ No newline at end of file diff --git a/server/components/encryptor/index.js b/server/components/encryptor/index.js index ffd00ed..9cf7ade 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 _0xb7e7=['crypto','aes192','hasOwnProperty','encryptFile','createReadStream','createWriteStream','createCipher','algorithm','update','binary','write','end','final','createDecipher','data','close','unlink'];(function(_0x448789,_0x4109c4){var _0x419233=function(_0x890288){while(--_0x890288){_0x448789['push'](_0x448789['shift']());}};_0x419233(++_0x4109c4);}(_0xb7e7,0x121));var _0x7b7e=function(_0x4b2436,_0x452299){_0x4b2436=_0x4b2436-0x0;var _0x4f5ab2=_0xb7e7[_0x4b2436];return _0x4f5ab2;};'use strict';var crypto=require(_0x7b7e('0x0'));var fs=require('fs');var BPromise=require('bluebird');var defaultOptions={'algorithm':_0x7b7e('0x1')};function combineOptions(_0x518dc6){var _0x1b7cc7={};for(var _0x54a37f in defaultOptions){if(defaultOptions[_0x7b7e('0x2')](_0x54a37f)){_0x1b7cc7[_0x54a37f]=defaultOptions[_0x54a37f];}}if(_0x518dc6){for(var _0x556d68 in _0x518dc6){if(_0x518dc6[_0x7b7e('0x2')](_0x556d68)){_0x1b7cc7[_0x556d68]=_0x518dc6[_0x556d68];}}}return _0x1b7cc7;}exports[_0x7b7e('0x3')]=function(_0x1d9384,_0x52047f,_0x53ed64,_0x333fa4){return new BPromise(function(_0x372bde,_0x7f87e0){_0x333fa4=combineOptions(_0x333fa4);var _0x55ce81=new Buffer(_0x53ed64);var _0x42b871=fs[_0x7b7e('0x4')](_0x1d9384);var _0x2917f9=fs[_0x7b7e('0x5')](_0x52047f);var _0x148964=crypto[_0x7b7e('0x6')](_0x333fa4[_0x7b7e('0x7')],_0x55ce81);_0x42b871['on']('data',function(_0x299519){var _0x1eef0a=new Buffer(_0x148964[_0x7b7e('0x8')](_0x299519),_0x7b7e('0x9'));_0x2917f9[_0x7b7e('0xa')](_0x1eef0a);});_0x42b871['on'](_0x7b7e('0xb'),function(){try{var _0x36d2a3=new Buffer(_0x148964[_0x7b7e('0xc')](_0x7b7e('0x9')),'binary');_0x2917f9[_0x7b7e('0xa')](_0x36d2a3);_0x2917f9[_0x7b7e('0xb')]();_0x2917f9['on']('close',function(){return _0x372bde(_0x52047f);});}catch(_0x422d3a){fs['unlink'](_0x52047f);return _0x7f87e0(_0x422d3a);}});});};exports['decryptFile']=function(_0x2889ed,_0xd304f5,_0xf067da,_0x457ec5){return new BPromise(function(_0x3d2fb2,_0x5703fd){_0x457ec5=combineOptions(_0x457ec5);var _0x51baf6=new Buffer(_0xf067da);var _0xc7f087=fs[_0x7b7e('0x4')](_0x2889ed);var _0x27f999=fs[_0x7b7e('0x5')](_0xd304f5);var _0x2cc400=crypto[_0x7b7e('0xd')](_0x457ec5[_0x7b7e('0x7')],_0x51baf6);_0xc7f087['on'](_0x7b7e('0xe'),function(_0x2acb8c){var _0x429a0e=new Buffer(_0x2cc400[_0x7b7e('0x8')](_0x2acb8c),_0x7b7e('0x9'));_0x27f999[_0x7b7e('0xa')](_0x429a0e);});_0xc7f087['on'](_0x7b7e('0xb'),function(){try{var _0x9776c3=new Buffer(_0x2cc400[_0x7b7e('0xc')](_0x7b7e('0x9')),'binary');_0x27f999[_0x7b7e('0xa')](_0x9776c3);_0x27f999[_0x7b7e('0xb')]();_0x27f999['on'](_0x7b7e('0xf'),function(){return _0x3d2fb2(_0xd304f5);});}catch(_0x4c0647){fs[_0x7b7e('0x10')](_0xd304f5);return _0x5703fd(_0x4c0647);}});});}; \ No newline at end of file +var _0x0713=['aes192','hasOwnProperty','encryptFile','createReadStream','createWriteStream','createCipher','algorithm','data','binary','write','end','final','close','decryptFile','createDecipher','update','unlink'];(function(_0x4d5ec5,_0x271a65){var _0x388cbf=function(_0x30074e){while(--_0x30074e){_0x4d5ec5['push'](_0x4d5ec5['shift']());}};_0x388cbf(++_0x271a65);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var crypto=require('crypto');var fs=require('fs');var BPromise=require('bluebird');var defaultOptions={'algorithm':_0x3071('0x0')};function combineOptions(_0x2afa91){var _0x27405a={};for(var _0x305d85 in defaultOptions){if(defaultOptions[_0x3071('0x1')](_0x305d85)){_0x27405a[_0x305d85]=defaultOptions[_0x305d85];}}if(_0x2afa91){for(var _0x52b5fb in _0x2afa91){if(_0x2afa91[_0x3071('0x1')](_0x52b5fb)){_0x27405a[_0x52b5fb]=_0x2afa91[_0x52b5fb];}}}return _0x27405a;}exports[_0x3071('0x2')]=function(_0x33a70c,_0x3137c8,_0xabd7b6,_0x41cf76){return new BPromise(function(_0x1d3dd6,_0x2f1e87){_0x41cf76=combineOptions(_0x41cf76);var _0xbd737f=new Buffer(_0xabd7b6);var _0x22274c=fs[_0x3071('0x3')](_0x33a70c);var _0x2fce7a=fs[_0x3071('0x4')](_0x3137c8);var _0x4a36ec=crypto[_0x3071('0x5')](_0x41cf76[_0x3071('0x6')],_0xbd737f);_0x22274c['on'](_0x3071('0x7'),function(_0xff9a29){var _0x1ce844=new Buffer(_0x4a36ec['update'](_0xff9a29),_0x3071('0x8'));_0x2fce7a[_0x3071('0x9')](_0x1ce844);});_0x22274c['on'](_0x3071('0xa'),function(){try{var _0x3ed4a0=new Buffer(_0x4a36ec[_0x3071('0xb')]('binary'),'binary');_0x2fce7a[_0x3071('0x9')](_0x3ed4a0);_0x2fce7a['end']();_0x2fce7a['on'](_0x3071('0xc'),function(){return _0x1d3dd6(_0x3137c8);});}catch(_0x44fbae){fs['unlink'](_0x3137c8);return _0x2f1e87(_0x44fbae);}});});};exports[_0x3071('0xd')]=function(_0x4e1219,_0x2fc15d,_0x45c93b,_0x1271d0){return new BPromise(function(_0x1f14e1,_0x1caa5d){_0x1271d0=combineOptions(_0x1271d0);var _0x2a6a4b=new Buffer(_0x45c93b);var _0x157a47=fs[_0x3071('0x3')](_0x4e1219);var _0x21aad3=fs[_0x3071('0x4')](_0x2fc15d);var _0x5f3c22=crypto[_0x3071('0xe')](_0x1271d0[_0x3071('0x6')],_0x2a6a4b);_0x157a47['on'](_0x3071('0x7'),function(_0x108a83){var _0x3acf0e=new Buffer(_0x5f3c22[_0x3071('0xf')](_0x108a83),_0x3071('0x8'));_0x21aad3[_0x3071('0x9')](_0x3acf0e);});_0x157a47['on']('end',function(){try{var _0x359e66=new Buffer(_0x5f3c22[_0x3071('0xb')](_0x3071('0x8')),'binary');_0x21aad3[_0x3071('0x9')](_0x359e66);_0x21aad3['end']();_0x21aad3['on'](_0x3071('0xc'),function(){return _0x1f14e1(_0x2fc15d);});}catch(_0x43128c){fs[_0x3071('0x10')](_0x2fc15d);return _0x1caa5d(_0x43128c);}});});}; \ No newline at end of file diff --git a/server/components/export/csv.js b/server/components/export/csv.js index 8c29f4a..850b105 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 _0x702d=['argv','savename','AnalyticExtractedReport','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','Setting','splitSizeCsv','then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','SELECT','num','length','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','split','join','mkdirSync','each','push','%s%d.%s','csv','%s.%s','zip','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','util','path','lodash','to-csv','bluebird','rimraf','../../mysqldb','dbH','analytics'];(function(_0x576033,_0x3cd525){var _0x123ab0=function(_0xbc7735){while(--_0xbc7735){_0x576033['push'](_0x576033['shift']());}};_0x123ab0(++_0x3cd525);}(_0x702d,0x147));var _0xd702=function(_0x1664f6,_0x52351d){_0x1664f6=_0x1664f6-0x0;var _0x30e493=_0x702d[_0x1664f6];return _0x30e493;};'use strict';var util=require(_0xd702('0x0'));var path=require(_0xd702('0x1'));var _=require(_0xd702('0x2'));var csv=require(_0xd702('0x3'));var fs=require('fs');var BPromise=require(_0xd702('0x4'));var zipdir=require('zip-dir');var rimraf=require(_0xd702('0x5'));var db=require(_0xd702('0x6'))['db'];var dbH=require(_0xd702('0x6'))[_0xd702('0x7')];var logger=require('../../config/logger')(_0xd702('0x8'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0xd702('0x9')][0x3];var PATH=process[_0xd702('0x9')][0x4];function analyticExtractedReport(_0xf4bf4f,_0x5af246){var _0x12bb75={'status':_0xf4bf4f};var _0x53bd02={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x5af246){_0x12bb75[_0xd702('0xa')]=_0x5af246;}return db[_0xd702('0xb')][_0xd702('0xc')](_0x12bb75,_0x53bd02);}function main(){var _0x365a0b=0x1388;var _0x2fe0ba;logger[_0xd702('0xd')](util[_0xd702('0xe')](_0xd702('0xf'),EXTRACTED_REPORT_ID,_0xd702('0x10')));return db[_0xd702('0x11')]['find']({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0xd702('0x12')]})[_0xd702('0x13')](function(_0x273577){if(_0x273577){_0x2fe0ba=_0x273577;_0x365a0b=_0x2fe0ba['splitSizeCsv']||0x1388;}})[_0xd702('0x13')](function(){return dbH[_0xd702('0x14')][_0xd702('0x15')](util[_0xd702('0xe')](_0xd702('0x16'),QUERY),{'type':dbH[_0xd702('0x14')]['QueryTypes'][_0xd702('0x17')]});})[_0xd702('0x13')](function(_0x5d7978){if(!_0x5d7978[0x0][_0xd702('0x18')]){return analyticExtractedReport('Empty');}var _0x268c66=[];var _0x210c32=0x0;var _0x55b93e=!![];if(_0x5d7978&&_0x5d7978[_0xd702('0x19')]){var _0x2f3e1f=_0x5d7978[0x0][_0xd702('0x18')]%(_0x210c32+_0x365a0b);if(_0x2fe0ba['split']){for(;_0x55b93e;_0x210c32+=_0x365a0b,_0x2f3e1f=_0x5d7978[0x0]['num']%(_0x210c32+_0x365a0b)){if(_0x2f3e1f==0x0||_0x2f3e1f==_0x5d7978[0x0][_0xd702('0x18')]){_0x55b93e=![];}_0x268c66['push'](dbH[_0xd702('0x14')][_0xd702('0x15')](util[_0xd702('0xe')](_0xd702('0x1a'),QUERY,_0x365a0b,_0x210c32),{'type':dbH[_0xd702('0x14')][_0xd702('0x1b')][_0xd702('0x17')]}));}}else{_0x268c66['push'](dbH['sequelize']['query'](QUERY,{'type':dbH[_0xd702('0x14')][_0xd702('0x1b')]['SELECT']}));}}var _0x211200=path['dirname'](PATH);var _0xc4c246=path['basename'](PATH,'.csv');var _0x51899c=_0x2fe0ba[_0xd702('0x1c')]&&_0x268c66[_0xd702('0x19')]>0x1;var _0x459184=[];if(!fs['existsSync'](path[_0xd702('0x1d')](_0x211200,_0xc4c246))&&_0x51899c){fs[_0xd702('0x1e')](path[_0xd702('0x1d')](_0x211200,_0xc4c246));}return BPromise[_0xd702('0x1f')](_0x268c66,function(_0x1200ed){_0x459184[_0xd702('0x20')](_0x1200ed);})[_0xd702('0x13')](function(){for(var _0x45ca87=0x0;_0x45ca87<_0x459184[_0xd702('0x19')];_0x45ca87+=0x1){var _0x50d7ad;var _0x116b2f=_0x459184[_0x45ca87];if(_0x51899c){_0x50d7ad=path[_0xd702('0x1d')](_0x211200,_0xc4c246,util[_0xd702('0xe')](_0xd702('0x21'),_0xc4c246,_0x45ca87,_0xd702('0x22')));}else{_0x50d7ad=path[_0xd702('0x1d')](_0x211200,util[_0xd702('0xe')](_0xd702('0x23'),_0xc4c246,'csv'));}fs['writeFileSync'](_0x50d7ad,csv(_0x116b2f));}})[_0xd702('0x13')](function(){if(_0x51899c){zipdir(path[_0xd702('0x1d')](_0x211200,_0xc4c246),{'saveTo':path['join'](_0x211200,util[_0xd702('0xe')](_0xd702('0x23'),_0xc4c246,_0xd702('0x24')))},function(_0x2946ae,_0x56e9cd){});rimraf(path[_0xd702('0x1d')](_0x211200,_0xc4c246),function(){});}})[_0xd702('0x13')](function(){logger[_0xd702('0xd')](util[_0xd702('0xe')](_0xd702('0x25'),EXTRACTED_REPORT_ID,'CSV'));return analyticExtractedReport(_0xd702('0x26'),_0x51899c?util[_0xd702('0xe')](_0xd702('0x23'),_0xc4c246,_0x51899c?'zip':_0xd702('0x22')):null);});})['catch'](function(_0x50867f){logger[_0xd702('0xd')](util[_0xd702('0xe')](_0xd702('0x27'),EXTRACTED_REPORT_ID,'CSV'),util[_0xd702('0x28')](_0x50867f,{'showHidden':![],'depth':null}));return analyticExtractedReport(_0xd702('0x29'));});}main(); \ No newline at end of file +var _0x9a19=['util','path','lodash','bluebird','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Setting','find','split','splitSizeCsv','then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','num','Empty','length','push','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','basename','join','mkdirSync','each','%s%d.%s','csv','%s.%s','zip','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','CSV','Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed'];(function(_0x465f17,_0x4bd683){var _0x38fb72=function(_0xcd6ba){while(--_0xcd6ba){_0x465f17['push'](_0x465f17['shift']());}};_0x38fb72(++_0x4bd683);}(_0x9a19,0x114));var _0x99a1=function(_0x5eaa0b,_0x433b2f){_0x5eaa0b=_0x5eaa0b-0x0;var _0x28b295=_0x9a19[_0x5eaa0b];return _0x28b295;};'use strict';var util=require(_0x99a1('0x0'));var path=require(_0x99a1('0x1'));var _=require(_0x99a1('0x2'));var csv=require('to-csv');var fs=require('fs');var BPromise=require(_0x99a1('0x3'));var zipdir=require(_0x99a1('0x4'));var rimraf=require(_0x99a1('0x5'));var db=require(_0x99a1('0x6'))['db'];var dbH=require(_0x99a1('0x6'))[_0x99a1('0x7')];var logger=require(_0x99a1('0x8'))(_0x99a1('0x9'));var EXTRACTED_REPORT_ID=Number(process[_0x99a1('0xa')][0x2]);var QUERY=process[_0x99a1('0xa')][0x3];var PATH=process[_0x99a1('0xa')][0x4];function analyticExtractedReport(_0x523b9e,_0x4d2a5c){var _0x5aa6c2={'status':_0x523b9e};var _0x56f50={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x4d2a5c){_0x5aa6c2[_0x99a1('0xb')]=_0x4d2a5c;}return db['AnalyticExtractedReport']['update'](_0x5aa6c2,_0x56f50);}function main(){var _0x4696f6=0x1388;var _0xd7b568;logger[_0x99a1('0xc')](util[_0x99a1('0xd')](_0x99a1('0xe'),EXTRACTED_REPORT_ID,'CSV'));return db[_0x99a1('0xf')][_0x99a1('0x10')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x99a1('0x11'),_0x99a1('0x12')]})[_0x99a1('0x13')](function(_0x1bc7aa){if(_0x1bc7aa){_0xd7b568=_0x1bc7aa;_0x4696f6=_0xd7b568[_0x99a1('0x12')]||0x1388;}})[_0x99a1('0x13')](function(){return dbH[_0x99a1('0x14')][_0x99a1('0x15')](util[_0x99a1('0xd')](_0x99a1('0x16'),QUERY),{'type':dbH[_0x99a1('0x14')][_0x99a1('0x17')][_0x99a1('0x18')]});})['then'](function(_0x2d81ed){if(!_0x2d81ed[0x0][_0x99a1('0x19')]){return analyticExtractedReport(_0x99a1('0x1a'));}var _0x3d40cc=[];var _0x384f05=0x0;var _0x33e2c1=!![];if(_0x2d81ed&&_0x2d81ed[_0x99a1('0x1b')]){var _0x4e645b=_0x2d81ed[0x0]['num']%(_0x384f05+_0x4696f6);if(_0xd7b568[_0x99a1('0x11')]){for(;_0x33e2c1;_0x384f05+=_0x4696f6,_0x4e645b=_0x2d81ed[0x0][_0x99a1('0x19')]%(_0x384f05+_0x4696f6)){if(_0x4e645b==0x0||_0x4e645b==_0x2d81ed[0x0][_0x99a1('0x19')]){_0x33e2c1=![];}_0x3d40cc[_0x99a1('0x1c')](dbH[_0x99a1('0x14')][_0x99a1('0x15')](util[_0x99a1('0xd')](_0x99a1('0x1d'),QUERY,_0x4696f6,_0x384f05),{'type':dbH[_0x99a1('0x14')][_0x99a1('0x17')][_0x99a1('0x18')]}));}}else{_0x3d40cc['push'](dbH[_0x99a1('0x14')][_0x99a1('0x15')](QUERY,{'type':dbH['sequelize'][_0x99a1('0x17')]['SELECT']}));}}var _0x458ed3=path[_0x99a1('0x1e')](PATH);var _0x2d6f20=path[_0x99a1('0x1f')](PATH,'.csv');var _0x3eab51=_0xd7b568[_0x99a1('0x11')]&&_0x3d40cc['length']>0x1;var _0x44df2d=[];if(!fs['existsSync'](path[_0x99a1('0x20')](_0x458ed3,_0x2d6f20))&&_0x3eab51){fs[_0x99a1('0x21')](path[_0x99a1('0x20')](_0x458ed3,_0x2d6f20));}return BPromise[_0x99a1('0x22')](_0x3d40cc,function(_0x3c813){_0x44df2d[_0x99a1('0x1c')](_0x3c813);})['then'](function(){for(var _0x114b38=0x0;_0x114b38<_0x44df2d['length'];_0x114b38+=0x1){var _0x5dc733;var _0xafea84=_0x44df2d[_0x114b38];if(_0x3eab51){_0x5dc733=path[_0x99a1('0x20')](_0x458ed3,_0x2d6f20,util[_0x99a1('0xd')](_0x99a1('0x23'),_0x2d6f20,_0x114b38,_0x99a1('0x24')));}else{_0x5dc733=path[_0x99a1('0x20')](_0x458ed3,util[_0x99a1('0xd')]('%s.%s',_0x2d6f20,_0x99a1('0x24')));}fs['writeFileSync'](_0x5dc733,csv(_0xafea84));}})[_0x99a1('0x13')](function(){if(_0x3eab51){zipdir(path[_0x99a1('0x20')](_0x458ed3,_0x2d6f20),{'saveTo':path[_0x99a1('0x20')](_0x458ed3,util['format'](_0x99a1('0x25'),_0x2d6f20,_0x99a1('0x26')))},function(_0x5718b9,_0x37514e){});rimraf(path[_0x99a1('0x20')](_0x458ed3,_0x2d6f20),function(){});}})[_0x99a1('0x13')](function(){logger[_0x99a1('0xc')](util[_0x99a1('0xd')](_0x99a1('0x27'),EXTRACTED_REPORT_ID,_0x99a1('0x28')));return analyticExtractedReport(_0x99a1('0x29'),_0x3eab51?util['format']('%s.%s',_0x2d6f20,_0x3eab51?_0x99a1('0x26'):'csv'):null);});})[_0x99a1('0x2a')](function(_0x400581){logger['info'](util[_0x99a1('0xd')](_0x99a1('0x2b'),EXTRACTED_REPORT_ID,_0x99a1('0x28')),util[_0x99a1('0x2c')](_0x400581,{'showHidden':![],'depth':null}));return analyticExtractedReport(_0x99a1('0x2d'));});}main(); \ No newline at end of file diff --git a/server/components/export/pdf.js b/server/components/export/pdf.js index c485174..ee75582 100644 --- a/server/components/export/pdf.js +++ b/server/components/export/pdf.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['query','format','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','push','SELECT','existsSync','join','mkdirSync','each','name','startDate','endDate','landscape','black','body','content','/fonts/Roboto-Medium.ttf','/fonts/Roboto-Italic.ttf','/fonts/Roboto-MediumItalic.ttf','createPdfKitDocument','pdf','%s.%s','pipe','createWriteStream','finish','log','err','end','zip','info','Completed','PDF','findOne','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Failed','lodash','util','path','moment','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','AnalyticExtractedReport','hasOwnProperty','tableHeader','num','Empty','dirname','basename','.pdf','Setting','find','split','then','splitSizePdf','length','sequelize'];(function(_0xa06616,_0x48d220){var _0x600a4a=function(_0x12269c){while(--_0x12269c){_0xa06616['push'](_0xa06616['shift']());}};_0x600a4a(++_0x48d220);}(_0xb10b,0x12a));var _0xbb10=function(_0x207abf,_0x33cf2e){_0x207abf=_0x207abf-0x0;var _0x481744=_0xb10b[_0x207abf];return _0x481744;};'use strict';var _=require(_0xbb10('0x0'));var fs=require('fs');var BPromise=require('bluebird');var util=require(_0xbb10('0x1'));var path=require(_0xbb10('0x2'));var moment=require(_0xbb10('0x3'));var PdfPrinter=require('pdfmake/src/printer');var zipdir=require(_0xbb10('0x4'));var rimraf=require(_0xbb10('0x5'));var db=require(_0xbb10('0x6'))['db'];var dbH=require(_0xbb10('0x6'))[_0xbb10('0x7')];var logger=require(_0xbb10('0x8'))('analytics');var EXTRACTED_REPORT_ID=Number(process[_0xbb10('0x9')][0x2]);var QUERY=process[_0xbb10('0x9')][0x3];var PATH=process['argv'][0x4];var NAME=process[_0xbb10('0x9')][0x5];var FORMAT=_0xbb10('0xa');var _extractedReport;function analyticExtractedReport(_0x21370f,_0x1c3ee5){var _0x2353ef={'status':_0x21370f};var _0x1ce33e={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x1c3ee5){_0x2353ef[_0xbb10('0xb')]=_0x1c3ee5;}return db[_0xbb10('0xc')]['update'](_0x2353ef,_0x1ce33e);}function getHeader(_0x4e47f8){var _0x20bd61=[];for(var _0x118a74 in _0x4e47f8){if(_0x4e47f8[_0xbb10('0xd')](_0x118a74)){_0x20bd61['push']({'text':_0x118a74,'style':_0xbb10('0xe')});}}return _0x20bd61;}function extractReport(_0x5be7e0){var _0x44fb19=0x1388;var _0x916a32;if(!_0x5be7e0[0x0][_0xbb10('0xf')]){return analyticExtractedReport(_0xbb10('0x10'));}var _0x442548=[];var _0x147230=0x0;var _0x58a612=!![];var _0x26e021=path[_0xbb10('0x11')](PATH);var _0x45b9d6=path[_0xbb10('0x12')](PATH,_0xbb10('0x13'));var _0x2f2ebf=![];var _0x24a57b=[];return db[_0xbb10('0x14')][_0xbb10('0x15')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xbb10('0x16'),'splitSizePdf']})[_0xbb10('0x17')](function(_0x1145f1){if(_0x1145f1){_0x916a32=_0x1145f1;_0x44fb19=_0x916a32[_0xbb10('0x18')]||0x3e8;}})[_0xbb10('0x17')](function(){if(_0x5be7e0&&_0x5be7e0[_0xbb10('0x19')]){var _0x1682a4=_0x5be7e0[0x0][_0xbb10('0xf')]%(_0x147230+_0x44fb19);if(_0x916a32[_0xbb10('0x16')]){for(;_0x58a612;_0x147230+=_0x44fb19,_0x1682a4=_0x5be7e0[0x0][_0xbb10('0xf')]%(_0x147230+_0x44fb19)){if(_0x1682a4==0x0||_0x1682a4==_0x5be7e0[0x0][_0xbb10('0xf')]){_0x58a612=![];}_0x442548['push'](dbH[_0xbb10('0x1a')][_0xbb10('0x1b')](util[_0xbb10('0x1c')](_0xbb10('0x1d'),QUERY,_0x44fb19,_0x147230),{'type':dbH[_0xbb10('0x1a')][_0xbb10('0x1e')]['SELECT']}));}}else{_0x442548[_0xbb10('0x1f')](dbH[_0xbb10('0x1a')]['query'](QUERY,{'type':dbH['sequelize'][_0xbb10('0x1e')][_0xbb10('0x20')]}));}}_0x2f2ebf=_0x916a32[_0xbb10('0x16')]&&_0x442548[_0xbb10('0x19')]>0x1;if(!fs[_0xbb10('0x21')](path[_0xbb10('0x22')](_0x26e021,_0x45b9d6))&&_0x2f2ebf){fs[_0xbb10('0x23')](path[_0xbb10('0x22')](_0x26e021,_0x45b9d6));}return BPromise[_0xbb10('0x24')](_0x442548,function(_0x395404){_0x24a57b[_0xbb10('0x1f')](_0x395404);});})[_0xbb10('0x17')](function(){return BPromise['each'](_0x442548,function(_0x4fedac,_0x4fb5e0){var _0xc93a04;var _0x3c5ae7=util[_0xbb10('0x1c')]('Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s',NAME,_extractedReport[_0xbb10('0x25')],moment(_extractedReport[_0xbb10('0x26')])[_0xbb10('0x1c')](FORMAT),moment(_extractedReport[_0xbb10('0x27')])[_0xbb10('0x1c')](FORMAT));var _0x20d946={'pageSize':'A4','pageOrientation':_0xbb10('0x28'),'content':[{'text':_0x3c5ae7,'style':'header'}],'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0xbb10('0x29')}}};var _0x21ac54={'headerRows':0x1,'body':[]};_0x21ac54[_0xbb10('0x2a')][_0xbb10('0x1f')](getHeader(_0x4fedac[0x0]));var _0x1d30aa;for(var _0x2ff4c1=0x0;_0x2ff4c1<_0x4fedac['length'];_0x2ff4c1+=0x1){_0x1d30aa=[];for(var _0x221624 in _0x4fedac[_0x2ff4c1]){if(_0x4fedac[_0x2ff4c1]['hasOwnProperty'](_0x221624)){_0x1d30aa[_0xbb10('0x1f')](_0x4fedac[_0x2ff4c1][_0x221624]?_['toString'](_0x4fedac[_0x2ff4c1][_0x221624]):'');}}_0x21ac54[_0xbb10('0x2a')][_0xbb10('0x1f')](_0x1d30aa);}_0x20d946[_0xbb10('0x2b')]['push']({'table':_0x21ac54});return new BPromise(function(_0x518d47,_0x4c3744){var _0x34f65e=new PdfPrinter({'Roboto':{'normal':__dirname+'/fonts/Roboto-Regular.ttf','bold':__dirname+_0xbb10('0x2c'),'italics':__dirname+_0xbb10('0x2d'),'bolditalics':__dirname+_0xbb10('0x2e')}});var _0x1c0b57=_0x34f65e[_0xbb10('0x2f')](_0x20d946);if(_0x2f2ebf){_0xc93a04=path[_0xbb10('0x22')](_0x26e021,_0x45b9d6,util[_0xbb10('0x1c')]('%s%d.%s',_0x45b9d6,_0x4fb5e0,_0xbb10('0x30')));}else{_0xc93a04=path[_0xbb10('0x22')](_0x26e021,util[_0xbb10('0x1c')](_0xbb10('0x31'),_0x45b9d6,_0xbb10('0x30')));}var _0x9de708=_0x1c0b57[_0xbb10('0x32')](fs[_0xbb10('0x33')](_0xc93a04));_0x9de708['on'](_0xbb10('0x34'),function(){_0x518d47();});_0x9de708['on']('error',function(_0x2b5352){console[_0xbb10('0x35')](_0xbb10('0x36'),_0x2b5352);_0x4c3744(_0x2b5352);});_0x1c0b57[_0xbb10('0x37')]();});});})['then'](function(){if(_0x2f2ebf){return new BPromise(function(_0x111762,_0x5de37b){zipdir(path['join'](_0x26e021,_0x45b9d6),{'saveTo':path[_0xbb10('0x22')](_0x26e021,util[_0xbb10('0x1c')](_0xbb10('0x31'),_0x45b9d6,_0xbb10('0x38')))},function(_0x15d895){if(_0x15d895){_0x5de37b(_0x15d895);}else{_0x111762();}});});}})[_0xbb10('0x17')](function(){if(_0x2f2ebf){rimraf(path['join'](_0x26e021,_0x45b9d6),function(){});}})[_0xbb10('0x17')](function(){logger[_0xbb10('0x39')](util['format']('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,'CSV'));return analyticExtractedReport(_0xbb10('0x3a'),_0x2f2ebf?util[_0xbb10('0x1c')](_0xbb10('0x31'),_0x45b9d6,_0x2f2ebf?'zip':_0xbb10('0x30')):null);});}function main(){logger[_0xbb10('0x39')](util[_0xbb10('0x1c')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0xbb10('0x3b')));return db[_0xbb10('0xc')][_0xbb10('0x3c')]({'where':{'id':EXTRACTED_REPORT_ID}})[_0xbb10('0x17')](function(_0x4f1cdd){_extractedReport=_0x4f1cdd;return dbH[_0xbb10('0x1a')][_0xbb10('0x1b')](util['format'](_0xbb10('0x3d'),QUERY),{'type':dbH[_0xbb10('0x1a')][_0xbb10('0x1e')][_0xbb10('0x20')]});})[_0xbb10('0x17')](extractReport)[_0xbb10('0x3e')](function(_0x5f3d67){logger[_0xbb10('0x39')](util[_0xbb10('0x1c')](_0xbb10('0x3f'),EXTRACTED_REPORT_ID,_0xbb10('0x3b')),util['inspect'](_0x5f3d67,{'showHidden':![],'depth':null}));return analyticExtractedReport(_0xbb10('0x40'));});}main(); \ No newline at end of file +var _0xb10b=['query','format','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','push','SELECT','existsSync','join','mkdirSync','each','name','startDate','endDate','landscape','black','body','content','/fonts/Roboto-Medium.ttf','/fonts/Roboto-Italic.ttf','/fonts/Roboto-MediumItalic.ttf','createPdfKitDocument','pdf','%s.%s','pipe','createWriteStream','finish','log','err','end','zip','info','Completed','PDF','findOne','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Failed','lodash','util','path','moment','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','AnalyticExtractedReport','hasOwnProperty','tableHeader','num','Empty','dirname','basename','.pdf','Setting','find','split','then','splitSizePdf','length','sequelize'];(function(_0x150d36,_0x104de7){var _0x1b47ce=function(_0x200c12){while(--_0x200c12){_0x150d36['push'](_0x150d36['shift']());}};_0x1b47ce(++_0x104de7);}(_0xb10b,0x12a));var _0xbb10=function(_0x3ec501,_0x1d035a){_0x3ec501=_0x3ec501-0x0;var _0x5a3037=_0xb10b[_0x3ec501];return _0x5a3037;};'use strict';var _=require(_0xbb10('0x0'));var fs=require('fs');var BPromise=require('bluebird');var util=require(_0xbb10('0x1'));var path=require(_0xbb10('0x2'));var moment=require(_0xbb10('0x3'));var PdfPrinter=require('pdfmake/src/printer');var zipdir=require(_0xbb10('0x4'));var rimraf=require(_0xbb10('0x5'));var db=require(_0xbb10('0x6'))['db'];var dbH=require(_0xbb10('0x6'))[_0xbb10('0x7')];var logger=require(_0xbb10('0x8'))('analytics');var EXTRACTED_REPORT_ID=Number(process[_0xbb10('0x9')][0x2]);var QUERY=process[_0xbb10('0x9')][0x3];var PATH=process['argv'][0x4];var NAME=process[_0xbb10('0x9')][0x5];var FORMAT=_0xbb10('0xa');var _extractedReport;function analyticExtractedReport(_0x21370f,_0x1c3ee5){var _0x2353ef={'status':_0x21370f};var _0x1ce33e={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x1c3ee5){_0x2353ef[_0xbb10('0xb')]=_0x1c3ee5;}return db[_0xbb10('0xc')]['update'](_0x2353ef,_0x1ce33e);}function getHeader(_0x4e47f8){var _0x20bd61=[];for(var _0x118a74 in _0x4e47f8){if(_0x4e47f8[_0xbb10('0xd')](_0x118a74)){_0x20bd61['push']({'text':_0x118a74,'style':_0xbb10('0xe')});}}return _0x20bd61;}function extractReport(_0x5be7e0){var _0x44fb19=0x1388;var _0x916a32;if(!_0x5be7e0[0x0][_0xbb10('0xf')]){return analyticExtractedReport(_0xbb10('0x10'));}var _0x442548=[];var _0x147230=0x0;var _0x58a612=!![];var _0x26e021=path[_0xbb10('0x11')](PATH);var _0x45b9d6=path[_0xbb10('0x12')](PATH,_0xbb10('0x13'));var _0x2f2ebf=![];var _0x24a57b=[];return db[_0xbb10('0x14')][_0xbb10('0x15')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xbb10('0x16'),'splitSizePdf']})[_0xbb10('0x17')](function(_0x1145f1){if(_0x1145f1){_0x916a32=_0x1145f1;_0x44fb19=_0x916a32[_0xbb10('0x18')]||0x3e8;}})[_0xbb10('0x17')](function(){if(_0x5be7e0&&_0x5be7e0[_0xbb10('0x19')]){var _0x1682a4=_0x5be7e0[0x0][_0xbb10('0xf')]%(_0x147230+_0x44fb19);if(_0x916a32[_0xbb10('0x16')]){for(;_0x58a612;_0x147230+=_0x44fb19,_0x1682a4=_0x5be7e0[0x0][_0xbb10('0xf')]%(_0x147230+_0x44fb19)){if(_0x1682a4==0x0||_0x1682a4==_0x5be7e0[0x0][_0xbb10('0xf')]){_0x58a612=![];}_0x442548['push'](dbH[_0xbb10('0x1a')][_0xbb10('0x1b')](util[_0xbb10('0x1c')](_0xbb10('0x1d'),QUERY,_0x44fb19,_0x147230),{'type':dbH[_0xbb10('0x1a')][_0xbb10('0x1e')]['SELECT']}));}}else{_0x442548[_0xbb10('0x1f')](dbH[_0xbb10('0x1a')]['query'](QUERY,{'type':dbH['sequelize'][_0xbb10('0x1e')][_0xbb10('0x20')]}));}}_0x2f2ebf=_0x916a32[_0xbb10('0x16')]&&_0x442548[_0xbb10('0x19')]>0x1;if(!fs[_0xbb10('0x21')](path[_0xbb10('0x22')](_0x26e021,_0x45b9d6))&&_0x2f2ebf){fs[_0xbb10('0x23')](path[_0xbb10('0x22')](_0x26e021,_0x45b9d6));}return BPromise[_0xbb10('0x24')](_0x442548,function(_0x395404){_0x24a57b[_0xbb10('0x1f')](_0x395404);});})[_0xbb10('0x17')](function(){return BPromise['each'](_0x442548,function(_0x4fedac,_0x4fb5e0){var _0xc93a04;var _0x3c5ae7=util[_0xbb10('0x1c')]('Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s',NAME,_extractedReport[_0xbb10('0x25')],moment(_extractedReport[_0xbb10('0x26')])[_0xbb10('0x1c')](FORMAT),moment(_extractedReport[_0xbb10('0x27')])[_0xbb10('0x1c')](FORMAT));var _0x20d946={'pageSize':'A4','pageOrientation':_0xbb10('0x28'),'content':[{'text':_0x3c5ae7,'style':'header'}],'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0xbb10('0x29')}}};var _0x21ac54={'headerRows':0x1,'body':[]};_0x21ac54[_0xbb10('0x2a')][_0xbb10('0x1f')](getHeader(_0x4fedac[0x0]));var _0x1d30aa;for(var _0x2ff4c1=0x0;_0x2ff4c1<_0x4fedac['length'];_0x2ff4c1+=0x1){_0x1d30aa=[];for(var _0x221624 in _0x4fedac[_0x2ff4c1]){if(_0x4fedac[_0x2ff4c1]['hasOwnProperty'](_0x221624)){_0x1d30aa[_0xbb10('0x1f')](_0x4fedac[_0x2ff4c1][_0x221624]?_['toString'](_0x4fedac[_0x2ff4c1][_0x221624]):'');}}_0x21ac54[_0xbb10('0x2a')][_0xbb10('0x1f')](_0x1d30aa);}_0x20d946[_0xbb10('0x2b')]['push']({'table':_0x21ac54});return new BPromise(function(_0x518d47,_0x4c3744){var _0x34f65e=new PdfPrinter({'Roboto':{'normal':__dirname+'/fonts/Roboto-Regular.ttf','bold':__dirname+_0xbb10('0x2c'),'italics':__dirname+_0xbb10('0x2d'),'bolditalics':__dirname+_0xbb10('0x2e')}});var _0x1c0b57=_0x34f65e[_0xbb10('0x2f')](_0x20d946);if(_0x2f2ebf){_0xc93a04=path[_0xbb10('0x22')](_0x26e021,_0x45b9d6,util[_0xbb10('0x1c')]('%s%d.%s',_0x45b9d6,_0x4fb5e0,_0xbb10('0x30')));}else{_0xc93a04=path[_0xbb10('0x22')](_0x26e021,util[_0xbb10('0x1c')](_0xbb10('0x31'),_0x45b9d6,_0xbb10('0x30')));}var _0x9de708=_0x1c0b57[_0xbb10('0x32')](fs[_0xbb10('0x33')](_0xc93a04));_0x9de708['on'](_0xbb10('0x34'),function(){_0x518d47();});_0x9de708['on']('error',function(_0x2b5352){console[_0xbb10('0x35')](_0xbb10('0x36'),_0x2b5352);_0x4c3744(_0x2b5352);});_0x1c0b57[_0xbb10('0x37')]();});});})['then'](function(){if(_0x2f2ebf){return new BPromise(function(_0x111762,_0x5de37b){zipdir(path['join'](_0x26e021,_0x45b9d6),{'saveTo':path[_0xbb10('0x22')](_0x26e021,util[_0xbb10('0x1c')](_0xbb10('0x31'),_0x45b9d6,_0xbb10('0x38')))},function(_0x15d895){if(_0x15d895){_0x5de37b(_0x15d895);}else{_0x111762();}});});}})[_0xbb10('0x17')](function(){if(_0x2f2ebf){rimraf(path['join'](_0x26e021,_0x45b9d6),function(){});}})[_0xbb10('0x17')](function(){logger[_0xbb10('0x39')](util['format']('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,'CSV'));return analyticExtractedReport(_0xbb10('0x3a'),_0x2f2ebf?util[_0xbb10('0x1c')](_0xbb10('0x31'),_0x45b9d6,_0x2f2ebf?'zip':_0xbb10('0x30')):null);});}function main(){logger[_0xbb10('0x39')](util[_0xbb10('0x1c')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0xbb10('0x3b')));return db[_0xbb10('0xc')][_0xbb10('0x3c')]({'where':{'id':EXTRACTED_REPORT_ID}})[_0xbb10('0x17')](function(_0x4f1cdd){_extractedReport=_0x4f1cdd;return dbH[_0xbb10('0x1a')][_0xbb10('0x1b')](util['format'](_0xbb10('0x3d'),QUERY),{'type':dbH[_0xbb10('0x1a')][_0xbb10('0x1e')][_0xbb10('0x20')]});})[_0xbb10('0x17')](extractReport)[_0xbb10('0x3e')](function(_0x5f3d67){logger[_0xbb10('0x39')](util[_0xbb10('0x1c')](_0xbb10('0x3f'),EXTRACTED_REPORT_ID,_0xbb10('0x3b')),util['inspect'](_0x5f3d67,{'showHidden':![],'depth':null}));return analyticExtractedReport(_0xbb10('0x40'));});}main(); \ No newline at end of file diff --git a/server/components/export/xlsx.js b/server/components/export/xlsx.js index 8c22a5d..145e374 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 _0xab00=['Failed','util','path','lodash','bluebird','zip-dir','rimraf','../../mysqldb','../../config/logger','analytics','argv','AnalyticExtractedReport','Setting','split','splitSizeXlsx','then','sequelize','query','format','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','push','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','basename','.xlsx','length','existsSync','join','mkdirSync','each','%s%d.%s','%s.%s','xlsx','binary','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','XLSX','inspect'];(function(_0x18738c,_0x5d127d){var _0x4cc13c=function(_0x1fe277){while(--_0x1fe277){_0x18738c['push'](_0x18738c['shift']());}};_0x4cc13c(++_0x5d127d);}(_0xab00,0x1b9));var _0x0ab0=function(_0x11b259,_0x322aa3){_0x11b259=_0x11b259-0x0;var _0x57dba4=_0xab00[_0x11b259];return _0x57dba4;};'use strict';var util=require(_0x0ab0('0x0'));var path=require(_0x0ab0('0x1'));var _=require(_0x0ab0('0x2'));var fs=require('fs');var json2xls=require('json2xls');var BPromise=require(_0x0ab0('0x3'));var zipdir=require(_0x0ab0('0x4'));var rimraf=require(_0x0ab0('0x5'));var db=require('../../mysqldb')['db'];var dbH=require(_0x0ab0('0x6'))['dbH'];var logger=require(_0x0ab0('0x7'))(_0x0ab0('0x8'));var EXTRACTED_REPORT_ID=Number(process[_0x0ab0('0x9')][0x2]);var QUERY=process[_0x0ab0('0x9')][0x3];var PATH=process[_0x0ab0('0x9')][0x4];function analyticExtractedReport(_0x25742b,_0x59fb03){var _0x3e934d={'status':_0x25742b};var _0x2cbb53={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x59fb03){_0x3e934d['savename']=_0x59fb03;}return db[_0x0ab0('0xa')]['update'](_0x3e934d,_0x2cbb53);}function main(){var _0xde9945=0x1388;var _0x23ecaf;logger['info'](util['format']('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,'XLSX'));return db[_0x0ab0('0xb')]['find']({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x0ab0('0xc'),_0x0ab0('0xd')]})['then'](function(_0x2bf478){if(_0x2bf478){_0x23ecaf=_0x2bf478;_0xde9945=_0x23ecaf[_0x0ab0('0xd')]||0x1388;}})[_0x0ab0('0xe')](function(){return dbH[_0x0ab0('0xf')][_0x0ab0('0x10')](util[_0x0ab0('0x11')](_0x0ab0('0x12'),QUERY),{'type':dbH[_0x0ab0('0xf')][_0x0ab0('0x13')][_0x0ab0('0x14')]});})[_0x0ab0('0xe')](function(_0x3c39b6){if(!_0x3c39b6[0x0]['num']){return analyticExtractedReport('Empty');}var _0x5f4a41=[];var _0x197b59=0x0;var _0x32fe14=!![];if(_0x23ecaf[_0x0ab0('0xc')]){if(_0x3c39b6&&_0x3c39b6['length']){var _0x49df08=_0x3c39b6[0x0]['num']%(_0x197b59+_0xde9945);for(;_0x32fe14;_0x197b59+=_0xde9945,_0x49df08=_0x3c39b6[0x0]['num']%(_0x197b59+_0xde9945)){if(_0x49df08==0x0||_0x49df08==_0x3c39b6[0x0]['num']){_0x32fe14=![];}_0x5f4a41[_0x0ab0('0x15')](dbH[_0x0ab0('0xf')][_0x0ab0('0x10')](util[_0x0ab0('0x11')](_0x0ab0('0x16'),QUERY,_0xde9945,_0x197b59),{'type':dbH[_0x0ab0('0xf')][_0x0ab0('0x13')]['SELECT']}));}}}else{_0x5f4a41['push'](dbH[_0x0ab0('0xf')][_0x0ab0('0x10')](QUERY,{'type':dbH[_0x0ab0('0xf')]['QueryTypes'][_0x0ab0('0x14')]}));}var _0x5d4eff=path[_0x0ab0('0x17')](PATH);var _0x2ccb3e=path[_0x0ab0('0x18')](PATH,_0x0ab0('0x19'));var _0x293631=_0x23ecaf[_0x0ab0('0xc')]&&_0x5f4a41[_0x0ab0('0x1a')]>0x1;var _0x5795f0=[];if(!fs[_0x0ab0('0x1b')](path[_0x0ab0('0x1c')](_0x5d4eff,_0x2ccb3e))&&_0x293631){fs[_0x0ab0('0x1d')](path['join'](_0x5d4eff,_0x2ccb3e));}return BPromise[_0x0ab0('0x1e')](_0x5f4a41,function(_0xd7c564){_0x5795f0[_0x0ab0('0x15')](_0xd7c564);})['then'](function(){for(var _0x1f5d10=0x0;_0x1f5d10<_0x5795f0[_0x0ab0('0x1a')];_0x1f5d10+=0x1){var _0x113386;var _0x2a4f7c=_0x5795f0[_0x1f5d10];if(_0x293631){_0x113386=path[_0x0ab0('0x1c')](_0x5d4eff,_0x2ccb3e,util['format'](_0x0ab0('0x1f'),_0x2ccb3e,_0x1f5d10,'xlsx'));}else{_0x113386=path[_0x0ab0('0x1c')](_0x5d4eff,util[_0x0ab0('0x11')](_0x0ab0('0x20'),_0x2ccb3e,_0x0ab0('0x21')));}fs['writeFileSync'](_0x113386,json2xls(_0x2a4f7c),_0x0ab0('0x22'));}})['then'](function(){if(_0x293631){zipdir(path[_0x0ab0('0x1c')](_0x5d4eff,_0x2ccb3e),{'saveTo':path[_0x0ab0('0x1c')](_0x5d4eff,util[_0x0ab0('0x11')](_0x0ab0('0x20'),_0x2ccb3e,_0x0ab0('0x23')))},function(_0xa9cb4f,_0x3306c6){});rimraf(path[_0x0ab0('0x1c')](_0x5d4eff,_0x2ccb3e),function(){});}})[_0x0ab0('0xe')](function(){logger[_0x0ab0('0x24')](util[_0x0ab0('0x11')](_0x0ab0('0x25'),EXTRACTED_REPORT_ID,'XLSX'));return analyticExtractedReport(_0x0ab0('0x26'),_0x293631?util[_0x0ab0('0x11')](_0x0ab0('0x20'),_0x2ccb3e,_0x293631?_0x0ab0('0x23'):_0x0ab0('0x21')):null);});})[_0x0ab0('0x27')](function(_0x59c030){logger['info'](util[_0x0ab0('0x11')](_0x0ab0('0x28'),EXTRACTED_REPORT_ID,_0x0ab0('0x29')),util[_0x0ab0('0x2a')](_0x59c030,{'showHidden':![],'depth':null}));return analyticExtractedReport(_0x0ab0('0x2b'));});}main(); \ No newline at end of file +var _0x0de8=['.xlsx','existsSync','mkdirSync','join','each','%s%d.%s','xlsx','writeFileSync','%s.%s','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','zip','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','util','path','lodash','json2xls','../../mysqldb','dbH','analytics','argv','savename','AnalyticExtractedReport','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','Setting','find','splitSizeXlsx','then','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','sequelize','QueryTypes','num','split','length','push','%s\x20limit\x20%d\x20OFFSET\x20%d','SELECT','dirname','basename'];(function(_0x3ceb54,_0x5bddfd){var _0x26d8a6=function(_0x32e484){while(--_0x32e484){_0x3ceb54['push'](_0x3ceb54['shift']());}};_0x26d8a6(++_0x5bddfd);}(_0x0de8,0x1db));var _0x80de=function(_0x1b69a4,_0x3e9f5f){_0x1b69a4=_0x1b69a4-0x0;var _0x4ab6a6=_0x0de8[_0x1b69a4];return _0x4ab6a6;};'use strict';var util=require(_0x80de('0x0'));var path=require(_0x80de('0x1'));var _=require(_0x80de('0x2'));var fs=require('fs');var json2xls=require(_0x80de('0x3'));var BPromise=require('bluebird');var zipdir=require('zip-dir');var rimraf=require('rimraf');var db=require(_0x80de('0x4'))['db'];var dbH=require(_0x80de('0x4'))[_0x80de('0x5')];var logger=require('../../config/logger')(_0x80de('0x6'));var EXTRACTED_REPORT_ID=Number(process[_0x80de('0x7')][0x2]);var QUERY=process['argv'][0x3];var PATH=process[_0x80de('0x7')][0x4];function analyticExtractedReport(_0x5ed63f,_0x1504bc){var _0x2a0305={'status':_0x5ed63f};var _0x1dcafc={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x1504bc){_0x2a0305[_0x80de('0x8')]=_0x1504bc;}return db[_0x80de('0x9')][_0x80de('0xa')](_0x2a0305,_0x1dcafc);}function main(){var _0x4b05a1=0x1388;var _0x27350b;logger[_0x80de('0xb')](util[_0x80de('0xc')](_0x80de('0xd'),EXTRACTED_REPORT_ID,_0x80de('0xe')));return db[_0x80de('0xf')][_0x80de('0x10')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0x80de('0x11')]})[_0x80de('0x12')](function(_0x4f765a){if(_0x4f765a){_0x27350b=_0x4f765a;_0x4b05a1=_0x27350b[_0x80de('0x11')]||0x1388;}})[_0x80de('0x12')](function(){return dbH['sequelize'][_0x80de('0x13')](util[_0x80de('0xc')](_0x80de('0x14'),QUERY),{'type':dbH[_0x80de('0x15')][_0x80de('0x16')]['SELECT']});})[_0x80de('0x12')](function(_0x14dd0d){if(!_0x14dd0d[0x0][_0x80de('0x17')]){return analyticExtractedReport('Empty');}var _0x5429a1=[];var _0x266c42=0x0;var _0x5d5d89=!![];if(_0x27350b[_0x80de('0x18')]){if(_0x14dd0d&&_0x14dd0d[_0x80de('0x19')]){var _0x193ab2=_0x14dd0d[0x0]['num']%(_0x266c42+_0x4b05a1);for(;_0x5d5d89;_0x266c42+=_0x4b05a1,_0x193ab2=_0x14dd0d[0x0][_0x80de('0x17')]%(_0x266c42+_0x4b05a1)){if(_0x193ab2==0x0||_0x193ab2==_0x14dd0d[0x0]['num']){_0x5d5d89=![];}_0x5429a1[_0x80de('0x1a')](dbH[_0x80de('0x15')][_0x80de('0x13')](util[_0x80de('0xc')](_0x80de('0x1b'),QUERY,_0x4b05a1,_0x266c42),{'type':dbH[_0x80de('0x15')][_0x80de('0x16')][_0x80de('0x1c')]}));}}}else{_0x5429a1[_0x80de('0x1a')](dbH[_0x80de('0x15')][_0x80de('0x13')](QUERY,{'type':dbH['sequelize'][_0x80de('0x16')]['SELECT']}));}var _0x474ea5=path[_0x80de('0x1d')](PATH);var _0x58390c=path[_0x80de('0x1e')](PATH,_0x80de('0x1f'));var _0x2b4fdf=_0x27350b['split']&&_0x5429a1[_0x80de('0x19')]>0x1;var _0xeb9284=[];if(!fs[_0x80de('0x20')](path['join'](_0x474ea5,_0x58390c))&&_0x2b4fdf){fs[_0x80de('0x21')](path[_0x80de('0x22')](_0x474ea5,_0x58390c));}return BPromise[_0x80de('0x23')](_0x5429a1,function(_0x6f10be){_0xeb9284['push'](_0x6f10be);})[_0x80de('0x12')](function(){for(var _0x21793b=0x0;_0x21793b<_0xeb9284[_0x80de('0x19')];_0x21793b+=0x1){var _0x198309;var _0x5499b6=_0xeb9284[_0x21793b];if(_0x2b4fdf){_0x198309=path[_0x80de('0x22')](_0x474ea5,_0x58390c,util[_0x80de('0xc')](_0x80de('0x24'),_0x58390c,_0x21793b,_0x80de('0x25')));}else{_0x198309=path[_0x80de('0x22')](_0x474ea5,util[_0x80de('0xc')]('%s.%s',_0x58390c,_0x80de('0x25')));}fs[_0x80de('0x26')](_0x198309,json2xls(_0x5499b6),'binary');}})[_0x80de('0x12')](function(){if(_0x2b4fdf){zipdir(path[_0x80de('0x22')](_0x474ea5,_0x58390c),{'saveTo':path[_0x80de('0x22')](_0x474ea5,util[_0x80de('0xc')](_0x80de('0x27'),_0x58390c,'zip'))},function(_0x21c4ca,_0x3030f5){});rimraf(path[_0x80de('0x22')](_0x474ea5,_0x58390c),function(){});}})[_0x80de('0x12')](function(){logger['info'](util[_0x80de('0xc')](_0x80de('0x28'),EXTRACTED_REPORT_ID,_0x80de('0xe')));return analyticExtractedReport(_0x80de('0x29'),_0x2b4fdf?util[_0x80de('0xc')](_0x80de('0x27'),_0x58390c,_0x2b4fdf?_0x80de('0x2a'):_0x80de('0x25')):null);});})[_0x80de('0x2b')](function(_0x9f9021){logger['info'](util[_0x80de('0xc')](_0x80de('0x2c'),EXTRACTED_REPORT_ID,'XLSX'),util[_0x80de('0x2d')](_0x9f9021,{'showHidden':![],'depth':null}));return analyticExtractedReport('Failed');});}main(); \ No newline at end of file diff --git a/server/components/extensions/rewrite.js b/server/components/extensions/rewrite.js index a6c123d..1f11052 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 _0x9c02=['hasOwnProperty','priority','extensions','extension','find','push','type','Set','format','CDR(type)=%s','context','VoiceExtensionId','outbound','CDR(destination)=','cutdigits','${EXTEN:','${EXTEN}','CDR(routeid)=','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=noprefix','outboundrouteid=','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','length','createdAt','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','toLowerCase','appType','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress',',${EXTEN},','concat','Hangup','transaction','destroy','bulkCreate','sortBy','error','rewrite','lodash','util','findAll','models','IntervalId','then','VoiceExtension','uniq','map','exten','filter','groupBy','queue','playback'];(function(_0x14477e,_0x44d4da){var _0x5d4a05=function(_0x5e0fa3){while(--_0x5e0fa3){_0x14477e['push'](_0x14477e['shift']());}};_0x5d4a05(++_0x44d4da);}(_0x9c02,0x196));var _0x29c0=function(_0x44e1ed,_0x30a48f){_0x44e1ed=_0x44e1ed-0x0;var _0x2d00dd=_0x9c02[_0x44e1ed];return _0x2d00dd;};'use strict';var _=require(_0x29c0('0x0'));var util=require(_0x29c0('0x1'));function rewrite(_0x1d76c2,_0x4cd0e6){var _0x5cccc6=this;return _0x1d76c2['models']['Interval'][_0x29c0('0x2')]({'raw':!![]})['then'](function(_0x4618c1){_0x5cccc6['intervals']=_0x4618c1;return _0x1d76c2[_0x29c0('0x3')]['VoiceExtension'][_0x29c0('0x2')]({'where':{'IntervalId':_0x4cd0e6[_0x29c0('0x4')]},'raw':!![]});})[_0x29c0('0x5')](function(_0x5beeb6){return _0x1d76c2['models'][_0x29c0('0x6')][_0x29c0('0x2')]({'where':{'exten':{'$in':_[_0x29c0('0x7')](_[_0x29c0('0x8')](_0x5beeb6,_0x29c0('0x9')))}},'order':[{'raw':'CAST(priority\x20AS\x20UNSIGNED)'}],'raw':!![]});})['then'](function(_0x16ba59){var _0x59c44e=_[_0x29c0('0xa')](_0x16ba59,{'priority':'1'});var _0x226fcb=_[_0x29c0('0xa')](_0x16ba59,{'isApp':0x1});var _0x3d1e24=_[_0x29c0('0xb')](_0x226fcb,_0x29c0('0x9'));var _0x5b4ef2=[_0x29c0('0xc'),_0x29c0('0xd')];var _0x7f4922=[];var _0x85aba=[];for(var _0x2b7027 in _0x3d1e24){if(_0x3d1e24[_0x29c0('0xe')](_0x2b7027)){_0x5cccc6[_0x29c0('0xf')]=0x2;_0x5cccc6[_0x29c0('0x10')]=[];_0x5cccc6[_0x29c0('0x11')]=_[_0x29c0('0x12')](_0x59c44e,{'exten':_0x3d1e24[_0x2b7027][0x0][_0x29c0('0x9')]});_0x5cccc6[_0x29c0('0x10')][_0x29c0('0x13')]({'type':_0x3d1e24[_0x2b7027][0x0][_0x29c0('0x14')],'app':_0x29c0('0x15'),'appdata':util[_0x29c0('0x16')](_0x29c0('0x17'),_0x3d1e24[_0x2b7027][0x0][_0x29c0('0x14')]),'context':_0x3d1e24[_0x2b7027][0x0][_0x29c0('0x18')],'exten':_0x3d1e24[_0x2b7027][0x0][_0x29c0('0x9')],'priority':_0x5cccc6[_0x29c0('0xf')]++,'VoiceExtensionId':_0x3d1e24[_0x2b7027][0x0][_0x29c0('0x19')]});if(_0x3d1e24[_0x2b7027][0x0][_0x29c0('0x14')]===_0x29c0('0x1a')){if(_0x5cccc6[_0x29c0('0x11')]){_0x5cccc6[_0x29c0('0x10')][_0x29c0('0x13')]({'type':_0x3d1e24[_0x2b7027][0x0]['type'],'app':_0x29c0('0x15'),'appdata':_0x29c0('0x1b')+(_0x5cccc6[_0x29c0('0x11')][_0x29c0('0x1c')]?_0x29c0('0x1d')+_0x5cccc6[_0x29c0('0x11')]['cutdigits']+'}':_0x29c0('0x1e')),'context':_0x3d1e24[_0x2b7027][0x0][_0x29c0('0x18')],'exten':_0x3d1e24[_0x2b7027][0x0][_0x29c0('0x9')],'priority':_0x5cccc6[_0x29c0('0xf')]++,'VoiceExtensionId':_0x3d1e24[_0x2b7027][0x0][_0x29c0('0x19')]});}_0x5cccc6['extensions'][_0x29c0('0x13')]({'type':_0x3d1e24[_0x2b7027][0x0][_0x29c0('0x14')],'app':'Set','appdata':_0x29c0('0x1f')+_0x3d1e24[_0x2b7027][0x0][_0x29c0('0x19')],'context':_0x3d1e24[_0x2b7027][0x0][_0x29c0('0x18')],'exten':_0x3d1e24[_0x2b7027][0x0]['exten'],'priority':_0x5cccc6[_0x29c0('0xf')]++,'VoiceExtensionId':_0x3d1e24[_0x2b7027][0x0]['VoiceExtensionId']});var _0x161b39=_0x5cccc6[_0x29c0('0xf')]++;_0x5cccc6['extensions'][_0x29c0('0x13')]({'type':_0x3d1e24[_0x2b7027][0x0][_0x29c0('0x14')],'app':_0x29c0('0x20'),'appdata':_0x29c0('0x21')+(_0x161b39+0x2)+_0x29c0('0x22')+(_0x161b39+0x1)+')','context':_0x3d1e24[_0x2b7027][0x0][_0x29c0('0x18')],'exten':_0x3d1e24[_0x2b7027][0x0]['exten'],'priority':_0x161b39,'VoiceExtensionId':_0x3d1e24[_0x2b7027][0x0]['VoiceExtensionId']});if(_0x5cccc6['extension']){_0x5cccc6[_0x29c0('0x10')][_0x29c0('0x13')]({'type':_0x3d1e24[_0x2b7027][0x0]['type'],'app':'Set','appdata':_0x5cccc6[_0x29c0('0x11')][_0x29c0('0x1c')]?'CDR(prefix)=${EXTEN:0:'+_0x5cccc6['extension']['cutdigits']+'}':_0x29c0('0x23'),'context':_0x3d1e24[_0x2b7027][0x0][_0x29c0('0x18')],'exten':_0x3d1e24[_0x2b7027][0x0][_0x29c0('0x9')],'priority':_0x5cccc6['priority']++,'VoiceExtensionId':_0x3d1e24[_0x2b7027][0x0][_0x29c0('0x19')]});}_0x5cccc6[_0x29c0('0x10')]['push']({'type':_0x3d1e24[_0x2b7027][0x0][_0x29c0('0x14')],'app':_0x29c0('0x15'),'appdata':_0x29c0('0x24')+_0x3d1e24[_0x2b7027][0x0][_0x29c0('0x19')],'context':_0x3d1e24[_0x2b7027][0x0][_0x29c0('0x18')],'exten':_0x3d1e24[_0x2b7027][0x0][_0x29c0('0x9')],'priority':_0x5cccc6[_0x29c0('0xf')]++,'VoiceExtensionId':_0x3d1e24[_0x2b7027][0x0]['VoiceExtensionId']});if(_0x5cccc6['extension']&&_0x5cccc6[_0x29c0('0x11')][_0x29c0('0xe')](_0x29c0('0x25'))&&_0x5cccc6['extension'][_0x29c0('0x25')]!==_0x29c0('0x26')){_0x5cccc6['extensions']['push']({'type':_0x3d1e24[_0x2b7027][0x0][_0x29c0('0x14')],'app':_0x29c0('0x15'),'appdata':_0x29c0('0x27'),'context':_0x3d1e24[_0x2b7027][0x0][_0x29c0('0x18')],'exten':_0x3d1e24[_0x2b7027][0x0][_0x29c0('0x9')],'priority':_0x5cccc6[_0x29c0('0xf')]++,'VoiceExtensionId':_0x3d1e24[_0x2b7027][0x0][_0x29c0('0x19')]});_0x5cccc6['extensions'][_0x29c0('0x13')]({'type':_0x3d1e24[_0x2b7027][0x0]['type'],'app':_0x29c0('0x15'),'appdata':_0x29c0('0x28')+_0x5cccc6[_0x29c0('0x11')]['recordingFormat']||_0x29c0('0x29'),'context':_0x3d1e24[_0x2b7027][0x0][_0x29c0('0x18')],'exten':_0x3d1e24[_0x2b7027][0x0]['exten'],'priority':_0x5cccc6[_0x29c0('0xf')]++,'VoiceExtensionId':_0x3d1e24[_0x2b7027][0x0][_0x29c0('0x19')]});}}_0x5cccc6[_0x29c0('0x10')][_0x29c0('0x13')]({'type':_0x3d1e24[_0x2b7027][0x0][_0x29c0('0x14')],'app':_0x29c0('0x15'),'appdata':_0x29c0('0x2a'),'context':_0x3d1e24[_0x2b7027][0x0][_0x29c0('0x18')],'exten':_0x3d1e24[_0x2b7027][0x0][_0x29c0('0x9')],'priority':_0x5cccc6[_0x29c0('0xf')]++,'VoiceExtensionId':_0x3d1e24[_0x2b7027][0x0][_0x29c0('0x19')]});_0x5cccc6[_0x29c0('0x10')][_0x29c0('0x13')]({'type':_0x3d1e24[_0x2b7027][0x0][_0x29c0('0x14')],'app':_0x29c0('0x15'),'appdata':_0x29c0('0x2b'),'context':_0x3d1e24[_0x2b7027][0x0][_0x29c0('0x18')],'exten':_0x3d1e24[_0x2b7027][0x0][_0x29c0('0x9')],'priority':_0x5cccc6[_0x29c0('0xf')]++,'VoiceExtensionId':_0x3d1e24[_0x2b7027][0x0][_0x29c0('0x19')]});_0x5cccc6[_0x29c0('0x10')][_0x29c0('0x13')]({'type':_0x3d1e24[_0x2b7027][0x0][_0x29c0('0x14')],'app':'Set','appdata':_0x29c0('0x2c'),'context':_0x3d1e24[_0x2b7027][0x0][_0x29c0('0x18')],'exten':_0x3d1e24[_0x2b7027][0x0][_0x29c0('0x9')],'priority':_0x5cccc6[_0x29c0('0xf')]++,'VoiceExtensionId':_0x3d1e24[_0x2b7027][0x0][_0x29c0('0x19')]});for(var _0x4f1900=0x0,_0xf4a463=0x0;_0x4f1900<_0x3d1e24[_0x2b7027][_0x29c0('0x2d')];_0x4f1900+=0x1,_0xf4a463=0x0){var _0x325066=_0x3d1e24[_0x2b7027][_0x4f1900];if(_0x325066['type']){_0x325066[_0x29c0('0x14')]=_0x325066[_0x29c0('0x14')]['toLowerCase']();}var _0x298c31=[];var _0x547025=[];delete _0x325066['id'];delete _0x325066[_0x29c0('0x2e')];delete _0x325066['updatedAt'];var _0x21c457=_0x325066[_0x29c0('0x2f')]!==_0x29c0('0x30')?[_0x325066[_0x29c0('0x2f')]]:_0x325066[_0x29c0('0x4')]?_[_0x29c0('0x8')](_['filter'](_0x5cccc6['intervals'],{'IntervalId':_0x325066[_0x29c0('0x4')]}),_0x29c0('0x2f')):[];if(_0x325066['hasOwnProperty'](_0x29c0('0x31'))){if(_0x325066[_0x29c0('0x31')]&&_0x325066[_0x29c0('0x31')]!=='--'){_0x298c31[_0x29c0('0x13')]({'type':_0x325066[_0x29c0('0x14')],'app':_0x29c0('0x15'),'appdata':_0x29c0('0x32')+_0x325066[_0x29c0('0x31')],'context':_0x325066[_0x29c0('0x18')],'exten':_0x325066[_0x29c0('0x9')],'priority':_0x21c457[_0x29c0('0x2d')]+_0x5cccc6[_0x29c0('0xf')]+_0xf4a463++,'VoiceExtensionId':_0x325066[_0x29c0('0x19')]});}}if(_0x325066[_0x29c0('0x14')]===_0x29c0('0x1a')&&_0x325066[_0x29c0('0xe')]('callerID')){if(_0x325066[_0x29c0('0x33')]){_0x298c31[_0x29c0('0x13')]({'type':_0x325066['type'],'app':_0x29c0('0x20'),'appdata':_0x29c0('0x34')+_0x325066['callerID']+')','context':_0x325066[_0x29c0('0x18')],'exten':_0x325066['exten'],'priority':_0x21c457[_0x29c0('0x2d')]+_0x5cccc6['priority']+_0xf4a463++,'VoiceExtensionId':_0x325066[_0x29c0('0x19')]});}else{_0x298c31[_0x29c0('0x13')]({'type':_0x325066[_0x29c0('0x14')],'app':'ExecIf','appdata':_0x29c0('0x35'),'context':_0x325066['context'],'exten':_0x325066[_0x29c0('0x9')],'priority':_0x21c457['length']+_0x5cccc6[_0x29c0('0xf')]+_0xf4a463++,'VoiceExtensionId':_0x325066[_0x29c0('0x19')]});}}if(_0x325066[_0x29c0('0xe')](_0x29c0('0x36'))){if(_0x5b4ef2[_0x29c0('0x37')](_0x325066['app'][_0x29c0('0x38')]())>=0x0&&_0x325066[_0x29c0('0x39')]!=='custom'){if(_0x325066[_0x29c0('0x36')]){_0x298c31[_0x29c0('0x13')]({'type':_0x325066[_0x29c0('0x14')],'app':_0x29c0('0x20'),'appdata':_0x29c0('0x3a'),'context':_0x325066[_0x29c0('0x18')],'exten':_0x325066['exten'],'priority':_0x21c457[_0x29c0('0x2d')]+_0x5cccc6[_0x29c0('0xf')]+_0xf4a463++,'VoiceExtensionId':_0x325066['VoiceExtensionId']});_0x298c31[_0x29c0('0x13')]({'type':_0x325066[_0x29c0('0x14')],'app':'Set','appdata':_0x29c0('0x3b'),'context':_0x325066['context'],'exten':_0x325066['exten'],'priority':_0x21c457[_0x29c0('0x2d')]+_0x5cccc6['priority']+_0xf4a463++,'VoiceExtensionId':_0x325066[_0x29c0('0x19')]});}else{_0x298c31[_0x29c0('0x13')]({'type':_0x325066[_0x29c0('0x14')],'app':_0x29c0('0x20'),'appdata':_0x29c0('0x3c'),'context':_0x325066['context'],'exten':_0x325066['exten'],'priority':_0x21c457[_0x29c0('0x2d')]+_0x5cccc6['priority']+_0xf4a463++,'VoiceExtensionId':_0x325066[_0x29c0('0x19')]});_0x298c31[_0x29c0('0x13')]({'type':_0x325066['type'],'app':_0x29c0('0x15'),'appdata':'XCALLY-MOTION-PROGRESS=1','context':_0x325066[_0x29c0('0x18')],'exten':_0x325066['exten'],'priority':_0x21c457[_0x29c0('0x2d')]+_0x5cccc6[_0x29c0('0xf')]+_0xf4a463++,'VoiceExtensionId':_0x325066['VoiceExtensionId']});}}}for(var _0x54a7dc=0x0;_0x54a7dc<_0x21c457['length'];_0x54a7dc+=0x1){var _0x35d0a5=_0x5cccc6[_0x29c0('0xf')]+_0x21c457['length'];var _0x5b6c2c=_0x54a7dc===_0x21c457[_0x29c0('0x2d')]-0x1?_0x5cccc6[_0x29c0('0xf')]+_0x298c31[_0x29c0('0x2d')]+_0x547025[_0x29c0('0x2d')]+0x2:_0x5cccc6[_0x29c0('0xf')]+_0x54a7dc+0x1;_0x298c31['splice'](_0x54a7dc,0x0,{'type':_0x325066[_0x29c0('0x14')],'app':'GotoIfTime','appdata':_0x21c457[_0x54a7dc]+'?'+_0x325066[_0x29c0('0x18')]+_0x29c0('0x3d')+_0x35d0a5+':'+_0x325066[_0x29c0('0x18')]+_0x29c0('0x3d')+_0x5b6c2c,'exten':_0x325066[_0x29c0('0x9')],'context':_0x325066[_0x29c0('0x18')],'priority':_0x5cccc6[_0x29c0('0xf')]+_0x54a7dc,'VoiceExtensionId':_0x3d1e24[_0x2b7027][0x0][_0x29c0('0x19')]});}_0x325066[_0x29c0('0xf')]=_0x298c31['length']?_['last'](_0x298c31)[_0x29c0('0xf')]+0x1:_0x5cccc6[_0x29c0('0xf')];_0x5cccc6[_0x29c0('0xf')]=(_0x547025[_0x29c0('0x2d')]?_['last'](_0x547025)['priority']:_0x325066[_0x29c0('0xf')])+0x1;_0x5cccc6[_0x29c0('0x10')]=_[_0x29c0('0x3e')](_0x5cccc6['extensions'],_0x298c31,[_0x325066],_0x547025);}_0x5cccc6['extensions'][_0x29c0('0x13')]({'type':_0x3d1e24[_0x2b7027][0x0]['type'],'app':_0x29c0('0x3f'),'exten':_0x3d1e24[_0x2b7027][0x0][_0x29c0('0x9')],'context':_0x3d1e24[_0x2b7027][0x0][_0x29c0('0x18')],'priority':_0x5cccc6[_0x29c0('0xf')],'VoiceExtensionId':_0x3d1e24[_0x2b7027][0x0][_0x29c0('0x19')]});_0x7f4922[_0x29c0('0x13')](_0x3d1e24[_0x2b7027][0x0][_0x29c0('0x19')]);_0x85aba=_[_0x29c0('0x3e')](_0x85aba,_0x5cccc6['extensions']);}}return _0x1d76c2[_0x29c0('0x40')](function(_0x481a02){return _0x1d76c2[_0x29c0('0x3')][_0x29c0('0x6')][_0x29c0('0x41')]({'where':{'VoiceExtensionId':{'$in':_0x7f4922}},'transaction':_0x481a02})[_0x29c0('0x5')](function(_0x69c358){return _0x1d76c2[_0x29c0('0x3')][_0x29c0('0x6')][_0x29c0('0x42')](_[_0x29c0('0x43')](_0x85aba,'priority'),{'transaction':_0x481a02});});});})['catch'](function(_0x33e0e9){console[_0x29c0('0x44')](_0x33e0e9);});}exports[_0x29c0('0x45')]=rewrite; \ No newline at end of file +var _0x830d=['priority','extensions','extension','find','type','Set','format','CDR(type)=%s','context','outbound','push','CDR(destination)=','cutdigits','${EXTEN:','${EXTEN}','VoiceExtensionId','CDR(routeid)=','ExecIf','):Goto(','CDR(prefix)=noprefix','outboundrouteid=','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','length','toLowerCase','createdAt','updatedAt','*,*,*,*','interval','tag','CDR(tag)=','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','answer','indexOf','app','appType','$[${XCALLY-MOTION-ANSWER}=0]?Answer','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','splice','GotoIfTime',',${EXTEN},','last','concat','Hangup','transaction','destroy','sortBy','catch','error','rewrite','lodash','util','models','findAll','then','intervals','VoiceExtension','IntervalId','uniq','map','exten','CAST(priority\x20AS\x20UNSIGNED)','filter','groupBy','playback','hasOwnProperty'];(function(_0x22b37a,_0x3081bc){var _0x47725f=function(_0x2fd9bb){while(--_0x2fd9bb){_0x22b37a['push'](_0x22b37a['shift']());}};_0x47725f(++_0x3081bc);}(_0x830d,0x82));var _0xd830=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x830d[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xd830('0x0'));var util=require(_0xd830('0x1'));function rewrite(_0x5a5550,_0x1435fc){var _0x3b2d1d=this;return _0x5a5550[_0xd830('0x2')]['Interval'][_0xd830('0x3')]({'raw':!![]})[_0xd830('0x4')](function(_0x5307a1){_0x3b2d1d[_0xd830('0x5')]=_0x5307a1;return _0x5a5550[_0xd830('0x2')][_0xd830('0x6')]['findAll']({'where':{'IntervalId':_0x1435fc[_0xd830('0x7')]},'raw':!![]});})[_0xd830('0x4')](function(_0x871b4c){return _0x5a5550['models'][_0xd830('0x6')]['findAll']({'where':{'exten':{'$in':_[_0xd830('0x8')](_[_0xd830('0x9')](_0x871b4c,_0xd830('0xa')))}},'order':[{'raw':_0xd830('0xb')}],'raw':!![]});})['then'](function(_0x3337d5){var _0x4bc799=_[_0xd830('0xc')](_0x3337d5,{'priority':'1'});var _0x168621=_[_0xd830('0xc')](_0x3337d5,{'isApp':0x1});var _0x52ef49=_[_0xd830('0xd')](_0x168621,_0xd830('0xa'));var _0x4adb69=['queue',_0xd830('0xe')];var _0x4e17ed=[];var _0x31442d=[];for(var _0xba0c6d in _0x52ef49){if(_0x52ef49[_0xd830('0xf')](_0xba0c6d)){_0x3b2d1d[_0xd830('0x10')]=0x2;_0x3b2d1d[_0xd830('0x11')]=[];_0x3b2d1d[_0xd830('0x12')]=_[_0xd830('0x13')](_0x4bc799,{'exten':_0x52ef49[_0xba0c6d][0x0][_0xd830('0xa')]});_0x3b2d1d[_0xd830('0x11')]['push']({'type':_0x52ef49[_0xba0c6d][0x0][_0xd830('0x14')],'app':_0xd830('0x15'),'appdata':util[_0xd830('0x16')](_0xd830('0x17'),_0x52ef49[_0xba0c6d][0x0]['type']),'context':_0x52ef49[_0xba0c6d][0x0][_0xd830('0x18')],'exten':_0x52ef49[_0xba0c6d][0x0][_0xd830('0xa')],'priority':_0x3b2d1d[_0xd830('0x10')]++,'VoiceExtensionId':_0x52ef49[_0xba0c6d][0x0]['VoiceExtensionId']});if(_0x52ef49[_0xba0c6d][0x0]['type']===_0xd830('0x19')){if(_0x3b2d1d[_0xd830('0x12')]){_0x3b2d1d[_0xd830('0x11')][_0xd830('0x1a')]({'type':_0x52ef49[_0xba0c6d][0x0][_0xd830('0x14')],'app':_0xd830('0x15'),'appdata':_0xd830('0x1b')+(_0x3b2d1d[_0xd830('0x12')][_0xd830('0x1c')]?_0xd830('0x1d')+_0x3b2d1d[_0xd830('0x12')][_0xd830('0x1c')]+'}':_0xd830('0x1e')),'context':_0x52ef49[_0xba0c6d][0x0]['context'],'exten':_0x52ef49[_0xba0c6d][0x0][_0xd830('0xa')],'priority':_0x3b2d1d[_0xd830('0x10')]++,'VoiceExtensionId':_0x52ef49[_0xba0c6d][0x0][_0xd830('0x1f')]});}_0x3b2d1d[_0xd830('0x11')]['push']({'type':_0x52ef49[_0xba0c6d][0x0]['type'],'app':_0xd830('0x15'),'appdata':_0xd830('0x20')+_0x52ef49[_0xba0c6d][0x0][_0xd830('0x1f')],'context':_0x52ef49[_0xba0c6d][0x0][_0xd830('0x18')],'exten':_0x52ef49[_0xba0c6d][0x0][_0xd830('0xa')],'priority':_0x3b2d1d[_0xd830('0x10')]++,'VoiceExtensionId':_0x52ef49[_0xba0c6d][0x0][_0xd830('0x1f')]});var _0x22587d=_0x3b2d1d[_0xd830('0x10')]++;_0x3b2d1d[_0xd830('0x11')][_0xd830('0x1a')]({'type':_0x52ef49[_0xba0c6d][0x0][_0xd830('0x14')],'app':_0xd830('0x21'),'appdata':'$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto('+(_0x22587d+0x2)+_0xd830('0x22')+(_0x22587d+0x1)+')','context':_0x52ef49[_0xba0c6d][0x0][_0xd830('0x18')],'exten':_0x52ef49[_0xba0c6d][0x0][_0xd830('0xa')],'priority':_0x22587d,'VoiceExtensionId':_0x52ef49[_0xba0c6d][0x0][_0xd830('0x1f')]});if(_0x3b2d1d[_0xd830('0x12')]){_0x3b2d1d['extensions'][_0xd830('0x1a')]({'type':_0x52ef49[_0xba0c6d][0x0][_0xd830('0x14')],'app':_0xd830('0x15'),'appdata':_0x3b2d1d[_0xd830('0x12')][_0xd830('0x1c')]?'CDR(prefix)=${EXTEN:0:'+_0x3b2d1d[_0xd830('0x12')][_0xd830('0x1c')]+'}':_0xd830('0x23'),'context':_0x52ef49[_0xba0c6d][0x0][_0xd830('0x18')],'exten':_0x52ef49[_0xba0c6d][0x0][_0xd830('0xa')],'priority':_0x3b2d1d[_0xd830('0x10')]++,'VoiceExtensionId':_0x52ef49[_0xba0c6d][0x0][_0xd830('0x1f')]});}_0x3b2d1d['extensions'][_0xd830('0x1a')]({'type':_0x52ef49[_0xba0c6d][0x0][_0xd830('0x14')],'app':_0xd830('0x15'),'appdata':_0xd830('0x24')+_0x52ef49[_0xba0c6d][0x0][_0xd830('0x1f')],'context':_0x52ef49[_0xba0c6d][0x0]['context'],'exten':_0x52ef49[_0xba0c6d][0x0][_0xd830('0xa')],'priority':_0x3b2d1d[_0xd830('0x10')]++,'VoiceExtensionId':_0x52ef49[_0xba0c6d][0x0][_0xd830('0x1f')]});if(_0x3b2d1d['extension']&&_0x3b2d1d[_0xd830('0x12')][_0xd830('0xf')]('recordingFormat')&&_0x3b2d1d[_0xd830('0x12')][_0xd830('0x25')]!==_0xd830('0x26')){_0x3b2d1d['extensions'][_0xd830('0x1a')]({'type':_0x52ef49[_0xba0c6d][0x0][_0xd830('0x14')],'app':_0xd830('0x15'),'appdata':_0xd830('0x27'),'context':_0x52ef49[_0xba0c6d][0x0][_0xd830('0x18')],'exten':_0x52ef49[_0xba0c6d][0x0][_0xd830('0xa')],'priority':_0x3b2d1d['priority']++,'VoiceExtensionId':_0x52ef49[_0xba0c6d][0x0][_0xd830('0x1f')]});_0x3b2d1d[_0xd830('0x11')][_0xd830('0x1a')]({'type':_0x52ef49[_0xba0c6d][0x0][_0xd830('0x14')],'app':_0xd830('0x15'),'appdata':_0xd830('0x28')+_0x3b2d1d[_0xd830('0x12')][_0xd830('0x25')]||_0xd830('0x29'),'context':_0x52ef49[_0xba0c6d][0x0]['context'],'exten':_0x52ef49[_0xba0c6d][0x0][_0xd830('0xa')],'priority':_0x3b2d1d[_0xd830('0x10')]++,'VoiceExtensionId':_0x52ef49[_0xba0c6d][0x0][_0xd830('0x1f')]});}}_0x3b2d1d['extensions'][_0xd830('0x1a')]({'type':_0x52ef49[_0xba0c6d][0x0]['type'],'app':'Set','appdata':_0xd830('0x2a'),'context':_0x52ef49[_0xba0c6d][0x0][_0xd830('0x18')],'exten':_0x52ef49[_0xba0c6d][0x0][_0xd830('0xa')],'priority':_0x3b2d1d[_0xd830('0x10')]++,'VoiceExtensionId':_0x52ef49[_0xba0c6d][0x0]['VoiceExtensionId']});_0x3b2d1d[_0xd830('0x11')]['push']({'type':_0x52ef49[_0xba0c6d][0x0][_0xd830('0x14')],'app':_0xd830('0x15'),'appdata':_0xd830('0x2b'),'context':_0x52ef49[_0xba0c6d][0x0][_0xd830('0x18')],'exten':_0x52ef49[_0xba0c6d][0x0]['exten'],'priority':_0x3b2d1d[_0xd830('0x10')]++,'VoiceExtensionId':_0x52ef49[_0xba0c6d][0x0][_0xd830('0x1f')]});_0x3b2d1d['extensions'][_0xd830('0x1a')]({'type':_0x52ef49[_0xba0c6d][0x0][_0xd830('0x14')],'app':_0xd830('0x15'),'appdata':_0xd830('0x2c'),'context':_0x52ef49[_0xba0c6d][0x0][_0xd830('0x18')],'exten':_0x52ef49[_0xba0c6d][0x0][_0xd830('0xa')],'priority':_0x3b2d1d[_0xd830('0x10')]++,'VoiceExtensionId':_0x52ef49[_0xba0c6d][0x0][_0xd830('0x1f')]});for(var _0xf8493b=0x0,_0x5a8672=0x0;_0xf8493b<_0x52ef49[_0xba0c6d][_0xd830('0x2d')];_0xf8493b+=0x1,_0x5a8672=0x0){var _0x4806fa=_0x52ef49[_0xba0c6d][_0xf8493b];if(_0x4806fa[_0xd830('0x14')]){_0x4806fa[_0xd830('0x14')]=_0x4806fa[_0xd830('0x14')][_0xd830('0x2e')]();}var _0x49e163=[];var _0xf2f5e4=[];delete _0x4806fa['id'];delete _0x4806fa[_0xd830('0x2f')];delete _0x4806fa[_0xd830('0x30')];var _0x179303=_0x4806fa['interval']!==_0xd830('0x31')?[_0x4806fa[_0xd830('0x32')]]:_0x4806fa['IntervalId']?_[_0xd830('0x9')](_[_0xd830('0xc')](_0x3b2d1d[_0xd830('0x5')],{'IntervalId':_0x4806fa['IntervalId']}),_0xd830('0x32')):[];if(_0x4806fa[_0xd830('0xf')](_0xd830('0x33'))){if(_0x4806fa[_0xd830('0x33')]&&_0x4806fa[_0xd830('0x33')]!=='--'){_0x49e163[_0xd830('0x1a')]({'type':_0x4806fa[_0xd830('0x14')],'app':'Set','appdata':_0xd830('0x34')+_0x4806fa[_0xd830('0x33')],'context':_0x4806fa[_0xd830('0x18')],'exten':_0x4806fa['exten'],'priority':_0x179303['length']+_0x3b2d1d[_0xd830('0x10')]+_0x5a8672++,'VoiceExtensionId':_0x4806fa[_0xd830('0x1f')]});}}if(_0x4806fa[_0xd830('0x14')]===_0xd830('0x19')&&_0x4806fa[_0xd830('0xf')](_0xd830('0x35'))){if(_0x4806fa[_0xd830('0x35')]){_0x49e163[_0xd830('0x1a')]({'type':_0x4806fa[_0xd830('0x14')],'app':_0xd830('0x21'),'appdata':_0xd830('0x36')+_0x4806fa[_0xd830('0x35')]+')','context':_0x4806fa[_0xd830('0x18')],'exten':_0x4806fa[_0xd830('0xa')],'priority':_0x179303[_0xd830('0x2d')]+_0x3b2d1d[_0xd830('0x10')]+_0x5a8672++,'VoiceExtensionId':_0x4806fa[_0xd830('0x1f')]});}else{_0x49e163[_0xd830('0x1a')]({'type':_0x4806fa[_0xd830('0x14')],'app':_0xd830('0x21'),'appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','context':_0x4806fa[_0xd830('0x18')],'exten':_0x4806fa['exten'],'priority':_0x179303[_0xd830('0x2d')]+_0x3b2d1d[_0xd830('0x10')]+_0x5a8672++,'VoiceExtensionId':_0x4806fa['VoiceExtensionId']});}}if(_0x4806fa[_0xd830('0xf')](_0xd830('0x37'))){if(_0x4adb69[_0xd830('0x38')](_0x4806fa[_0xd830('0x39')][_0xd830('0x2e')]())>=0x0&&_0x4806fa[_0xd830('0x3a')]!=='custom'){if(_0x4806fa[_0xd830('0x37')]){_0x49e163[_0xd830('0x1a')]({'type':_0x4806fa[_0xd830('0x14')],'app':_0xd830('0x21'),'appdata':_0xd830('0x3b'),'context':_0x4806fa[_0xd830('0x18')],'exten':_0x4806fa[_0xd830('0xa')],'priority':_0x179303[_0xd830('0x2d')]+_0x3b2d1d['priority']+_0x5a8672++,'VoiceExtensionId':_0x4806fa[_0xd830('0x1f')]});_0x49e163[_0xd830('0x1a')]({'type':_0x4806fa[_0xd830('0x14')],'app':_0xd830('0x15'),'appdata':'XCALLY-MOTION-ANSWER=1','context':_0x4806fa[_0xd830('0x18')],'exten':_0x4806fa[_0xd830('0xa')],'priority':_0x179303['length']+_0x3b2d1d[_0xd830('0x10')]+_0x5a8672++,'VoiceExtensionId':_0x4806fa[_0xd830('0x1f')]});}else{_0x49e163[_0xd830('0x1a')]({'type':_0x4806fa[_0xd830('0x14')],'app':_0xd830('0x21'),'appdata':_0xd830('0x3c'),'context':_0x4806fa[_0xd830('0x18')],'exten':_0x4806fa['exten'],'priority':_0x179303[_0xd830('0x2d')]+_0x3b2d1d[_0xd830('0x10')]+_0x5a8672++,'VoiceExtensionId':_0x4806fa['VoiceExtensionId']});_0x49e163[_0xd830('0x1a')]({'type':_0x4806fa[_0xd830('0x14')],'app':_0xd830('0x15'),'appdata':'XCALLY-MOTION-PROGRESS=1','context':_0x4806fa[_0xd830('0x18')],'exten':_0x4806fa[_0xd830('0xa')],'priority':_0x179303[_0xd830('0x2d')]+_0x3b2d1d[_0xd830('0x10')]+_0x5a8672++,'VoiceExtensionId':_0x4806fa[_0xd830('0x1f')]});}}}for(var _0x2c9f4f=0x0;_0x2c9f4f<_0x179303['length'];_0x2c9f4f+=0x1){var _0x1646fa=_0x3b2d1d[_0xd830('0x10')]+_0x179303['length'];var _0x48a945=_0x2c9f4f===_0x179303[_0xd830('0x2d')]-0x1?_0x3b2d1d[_0xd830('0x10')]+_0x49e163[_0xd830('0x2d')]+_0xf2f5e4[_0xd830('0x2d')]+0x2:_0x3b2d1d[_0xd830('0x10')]+_0x2c9f4f+0x1;_0x49e163[_0xd830('0x3d')](_0x2c9f4f,0x0,{'type':_0x4806fa[_0xd830('0x14')],'app':_0xd830('0x3e'),'appdata':_0x179303[_0x2c9f4f]+'?'+_0x4806fa[_0xd830('0x18')]+',${EXTEN},'+_0x1646fa+':'+_0x4806fa[_0xd830('0x18')]+_0xd830('0x3f')+_0x48a945,'exten':_0x4806fa[_0xd830('0xa')],'context':_0x4806fa[_0xd830('0x18')],'priority':_0x3b2d1d[_0xd830('0x10')]+_0x2c9f4f,'VoiceExtensionId':_0x52ef49[_0xba0c6d][0x0][_0xd830('0x1f')]});}_0x4806fa[_0xd830('0x10')]=_0x49e163[_0xd830('0x2d')]?_['last'](_0x49e163)[_0xd830('0x10')]+0x1:_0x3b2d1d[_0xd830('0x10')];_0x3b2d1d[_0xd830('0x10')]=(_0xf2f5e4[_0xd830('0x2d')]?_[_0xd830('0x40')](_0xf2f5e4)[_0xd830('0x10')]:_0x4806fa[_0xd830('0x10')])+0x1;_0x3b2d1d[_0xd830('0x11')]=_[_0xd830('0x41')](_0x3b2d1d[_0xd830('0x11')],_0x49e163,[_0x4806fa],_0xf2f5e4);}_0x3b2d1d['extensions'][_0xd830('0x1a')]({'type':_0x52ef49[_0xba0c6d][0x0][_0xd830('0x14')],'app':_0xd830('0x42'),'exten':_0x52ef49[_0xba0c6d][0x0][_0xd830('0xa')],'context':_0x52ef49[_0xba0c6d][0x0][_0xd830('0x18')],'priority':_0x3b2d1d[_0xd830('0x10')],'VoiceExtensionId':_0x52ef49[_0xba0c6d][0x0][_0xd830('0x1f')]});_0x4e17ed[_0xd830('0x1a')](_0x52ef49[_0xba0c6d][0x0]['VoiceExtensionId']);_0x31442d=_[_0xd830('0x41')](_0x31442d,_0x3b2d1d[_0xd830('0x11')]);}}return _0x5a5550[_0xd830('0x43')](function(_0x9ea739){return _0x5a5550['models'][_0xd830('0x6')][_0xd830('0x44')]({'where':{'VoiceExtensionId':{'$in':_0x4e17ed}},'transaction':_0x9ea739})[_0xd830('0x4')](function(_0x3aad59){return _0x5a5550['models'][_0xd830('0x6')]['bulkCreate'](_[_0xd830('0x45')](_0x31442d,'priority'),{'transaction':_0x9ea739});});});})[_0xd830('0x46')](function(_0x37a06a){console[_0xd830('0x47')](_0x37a06a);});}exports[_0xd830('0x48')]=rewrite; \ No newline at end of file diff --git a/server/components/import/cm/csv.js b/server/components/import/cm/csv.js index 36483ca..8c0e125 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 _0xb7e7=['birthDate','YYYY-MM-DD','isValid','email','email\x20format\x20is\x20not\x20valid!','ListId','CompanyId','find','Duplicate\x20Contact','CmContact','create','then','push','pick','catch','Error\x20while\x20creating\x20contact:\x20','message','stringify','cmContact','checkHopper','insert','into','cm_hopper','fromQuery','scheduledAt','createdAt','updatedAt','select','field','toString','NOW()','from','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','\x20=\x20?','ContactId','cm_contacts','where','str','id\x20IN\x20?','cm_hopper_black','VoiceQueue','findAll','outbound','dialCheckDuplicateType','CmList','Lists','get','always','query','VoiceQueueId','onlyIfOpen','sequelize','all','BlackLists','Campaign','CampaignId','cmContact,\x20%s,\x20%s','generalCheckHopper','Error\x20processing\x20rows\x20block:','finally','emit','contact:csv_','resolve','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','SIGINT','createReadStream','parse','duplicate','pause','info','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','bluebird','lodash','papaparse','../../../mysqldb','../../../config/logger','api','redis','localhost','socket.io-emitter','register','argv','undefined','null','Missing\x20filepath\x20parameter!','Missing\x20binding\x20parameters!','zipObject','split','error','contact','index','test','isNil','errors','length','map','join','data','phone','phone\x20not\x20specified!'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xb7e7,0x121));var _0x7b7e=function(_0x5834bc,_0x3d4801){_0x5834bc=_0x5834bc-0x0;var _0x3e183a=_0xb7e7[_0x5834bc];return _0x3e183a;};'use strict';var BPromise=require(_0x7b7e('0x0'));var util=require('util');var _=require(_0x7b7e('0x1'));var fs=require('fs');var squel=require('squel');var Papa=require(_0x7b7e('0x2'));var Redis=require('ioredis');var db=require(_0x7b7e('0x3'))['db'];var config=require('../../../config/environment');var logger=require(_0x7b7e('0x4'))(_0x7b7e('0x5'));config[_0x7b7e('0x6')]=_['defaults'](config['redis'],{'host':_0x7b7e('0x7'),'port':0x18eb});var socket=require(_0x7b7e('0x8'))(new Redis(config[_0x7b7e('0x6')]));require('../../../api/cmContact/cmContact.socket')[_0x7b7e('0x9')](socket);try{if(!process[_0x7b7e('0xa')][0x2]||process[_0x7b7e('0xa')][0x2]===_0x7b7e('0xb')||process[_0x7b7e('0xa')][0x2]===_0x7b7e('0xc')){throw new Error(_0x7b7e('0xd'));}var FILEPATH=process['argv'][0x2];if(!process[_0x7b7e('0xa')][0x3]||process[_0x7b7e('0xa')][0x3]===_0x7b7e('0xb')||process[_0x7b7e('0xa')][0x3]===_0x7b7e('0xc')||!process[_0x7b7e('0xa')][0x4]||process[_0x7b7e('0xa')][0x4]===_0x7b7e('0xb')||process[_0x7b7e('0xa')][0x4]==='null'){throw new Error(_0x7b7e('0xe'));}var FIELDS=_[_0x7b7e('0xf')](process['argv'][0x3][_0x7b7e('0x10')](','),process['argv'][0x4]['split'](','));if(!process[_0x7b7e('0xa')][0x5]||process[_0x7b7e('0xa')][0x5]===_0x7b7e('0xb')||process[_0x7b7e('0xa')][0x5]===_0x7b7e('0xc')){throw new Error('Missing\x20ListId\x20parameter!');}var LISTID=process['argv'][0x5];var COMPANYID=process[_0x7b7e('0xa')][0x6]&&process[_0x7b7e('0xa')][0x6]!==_0x7b7e('0xb')&&process[_0x7b7e('0xa')][0x6]!==_0x7b7e('0xc')?process[_0x7b7e('0xa')][0x6]:null;var DUPLICATES=process[_0x7b7e('0xa')][0x7]&&process[_0x7b7e('0xa')][0x7]!==_0x7b7e('0xb')&&process[_0x7b7e('0xa')][0x7]!==_0x7b7e('0xc')?process[_0x7b7e('0xa')][0x7]:null;if(!process[_0x7b7e('0xa')][0x8]||process[_0x7b7e('0xa')][0x8]===_0x7b7e('0xb')||process[_0x7b7e('0xa')][0x8]===_0x7b7e('0xc')){throw new Error('Missing\x20socket_timestamp\x20parameter!');}var SOCKET_TIMESTAMP=process[_0x7b7e('0xa')][0x8];}catch(_0x43db4f){logger[_0x7b7e('0x11')](_0x43db4f);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(_0x4c0647,_0x313122,_0xbf0cb3,_0x14243b){var _0x200156={'message':_0x313122};_0x200156[_0x4c0647]=!![];if(_0xbf0cb3){_0x200156[_0x7b7e('0x12')]=_0xbf0cb3;}if(_0x14243b){_0x200156[_0x7b7e('0x13')]=_0x14243b;}return _0x200156;}function isEmail(_0x28bf43){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))*$/[_0x7b7e('0x14')](_0x28bf43);}function checkRow(_0x53bbb3,_0x5d6215,_0x4a836a){return new BPromise(function(_0x26ee14,_0x22598e){if(_[_0x7b7e('0x15')](_0x53bbb3)){return _0x22598e(handleCheckRowError('error','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!',null,_0x4a836a));}if(_0x53bbb3['errors']&&_0x53bbb3[_0x7b7e('0x16')][_0x7b7e('0x17')]){var _0x16a3c7=_[_0x7b7e('0x18')](_0x53bbb3[_0x7b7e('0x16')],'message')[_0x7b7e('0x19')](';');return _0x22598e(handleCheckRowError(_0x7b7e('0x11'),_0x16a3c7,null,_0x4a836a));}var _0x4c46b8={};for(var _0x57b9da in FIELDS){if(FIELDS['hasOwnProperty'](_0x57b9da)&&FIELDS[_0x57b9da]){_0x4c46b8[_0x57b9da]=_0x53bbb3[_0x7b7e('0x1a')][0x0][FIELDS[_0x57b9da]]||_0x53bbb3[_0x7b7e('0x1a')][0x0]['\ufeff'+FIELDS[_0x57b9da]];}}if(!_0x4c46b8['firstName']){return _0x22598e(handleCheckRowError(_0x7b7e('0x11'),'firstName\x20not\x20specified!',null,_0x4a836a));}if(!_0x4c46b8[_0x7b7e('0x1b')]){return _0x22598e(handleCheckRowError(_0x7b7e('0x11'),_0x7b7e('0x1c'),null,_0x4a836a));}if(_0x4c46b8['birthDate']){var _0x3960b8=moment(_0x4c46b8[_0x7b7e('0x1d')],_0x7b7e('0x1e'));if(!_0x3960b8[_0x7b7e('0x1f')]()){return _0x22598e(handleCheckRowError(_0x7b7e('0x11'),'birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!',null,_0x4a836a));}}if(_0x4c46b8[_0x7b7e('0x20')]){if(!isEmail(_0x4c46b8['email'])){return _0x22598e(handleCheckRowError(_0x7b7e('0x11'),_0x7b7e('0x21'),null,_0x4a836a));}}_0x4c46b8[_0x7b7e('0x22')]=LISTID;_0x4c46b8[_0x7b7e('0x23')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0x7b7e('0x17')]&&_0x5d6215){var _0x247ea0={};for(var _0x29cb58=0x0,_0x4bfe7f=DUPLICATES['length'];_0x29cb58<_0x4bfe7f;_0x29cb58+=0x1){_0x247ea0[DUPLICATES[_0x29cb58]]=_0x4c46b8[DUPLICATES[_0x29cb58]];}var _0xebcdbc=_[_0x7b7e('0x24')](_0x5d6215,_0x247ea0);if(_0xebcdbc){return _0x22598e(handleCheckRowError('duplicate',_0x7b7e('0x25'),_0xebcdbc,_0x4a836a));}}return db[_0x7b7e('0x26')][_0x7b7e('0x27')](_0x4c46b8,{'raw':!![],'hooks':![],'fields':_['keys'](_0x4c46b8)})[_0x7b7e('0x28')](function(_0x256908){if(DUPLICATES&&DUPLICATES[_0x7b7e('0x17')]&&_0x5d6215){_0x5d6215[_0x7b7e('0x29')](_[_0x7b7e('0x2a')](_0x4c46b8,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x256908['id'];return _0x26ee14();})[_0x7b7e('0x2b')](function(_0x3e8cf4){return _0x22598e(handleCheckRowError(_0x7b7e('0x11'),_0x7b7e('0x2c')+(_0x3e8cf4[_0x7b7e('0x2d')]||JSON[_0x7b7e('0x2e')](_0x3e8cf4)),null,_0x4a836a));});});}function checkHopper(){function _0x2d0620(){return function(_0x442366){logger[_0x7b7e('0x11')](_0x7b7e('0x2f'),_0x7b7e('0x30'),util['inspect'](_0x442366,{'showHidden':![],'depth':null}));};}var _0x8c80d5=function(_0x156dca,_0xb20532){var _0x242609=squel[_0x7b7e('0x31')]()[_0x7b7e('0x32')](_0x7b7e('0x33'))[_0x7b7e('0x34')]([_0x7b7e('0x1b'),_0x7b7e('0x35'),'ContactId',_0x7b7e('0x22'),_0xb20532,_0x7b7e('0x36'),_0x7b7e('0x37')],squel[_0x7b7e('0x38')]()['field'](_0x7b7e('0x1b'),_0x7b7e('0x1b'))[_0x7b7e('0x39')]('NOW()','scheduledAt')[_0x7b7e('0x39')]('id','ContactId')[_0x7b7e('0x39')](LISTID[_0x7b7e('0x3a')](),'ListId')[_0x7b7e('0x39')](_0x156dca['id'][_0x7b7e('0x3a')](),_0xb20532)[_0x7b7e('0x39')](_0x7b7e('0x3b'),_0x7b7e('0x36'))[_0x7b7e('0x39')](_0x7b7e('0x3b'),_0x7b7e('0x37'))[_0x7b7e('0x3c')]('cm_contacts')['where'](_0x7b7e('0x3d'))['where'](_0x7b7e('0x3e'),LISTID['toString']())['where'](_0x7b7e('0x3f'))['where'](_0x7b7e('0x40'),squel['select']()[_0x7b7e('0x39')](_0x7b7e('0x1b'))[_0x7b7e('0x3c')](_0x7b7e('0x33'))['where'](_0xb20532+_0x7b7e('0x41'),_0x156dca['id'][_0x7b7e('0x3a')]())))[_0x7b7e('0x3a')]();return _0x242609;};var _0x37895a=function(_0x3e4f21,_0xccdfc7){var _0x5e8572=squel['insert']()['into'](_0x7b7e('0x33'))[_0x7b7e('0x34')]([_0x7b7e('0x1b'),_0x7b7e('0x35'),_0x7b7e('0x42'),_0x7b7e('0x22'),_0xccdfc7,'createdAt',_0x7b7e('0x37')],squel[_0x7b7e('0x38')]()['field']('phone',_0x7b7e('0x1b'))[_0x7b7e('0x39')](_0x7b7e('0x3b'),_0x7b7e('0x35'))[_0x7b7e('0x39')]('id',_0x7b7e('0x42'))['field'](LISTID[_0x7b7e('0x3a')](),'ListId')[_0x7b7e('0x39')](_0x3e4f21['id'][_0x7b7e('0x3a')](),_0xccdfc7)[_0x7b7e('0x39')](_0x7b7e('0x3b'),'createdAt')[_0x7b7e('0x39')](_0x7b7e('0x3b'),_0x7b7e('0x37'))[_0x7b7e('0x3c')](_0x7b7e('0x43'))['where'](_0x7b7e('0x3d'))[_0x7b7e('0x44')](_0x7b7e('0x3e'),LISTID[_0x7b7e('0x3a')]())[_0x7b7e('0x44')]('id\x20IN\x20?',squel[_0x7b7e('0x45')](hopperContacts))[_0x7b7e('0x44')](_0x7b7e('0x3f'))[_0x7b7e('0x44')](_0x7b7e('0x40'),squel[_0x7b7e('0x38')]()[_0x7b7e('0x39')]('calleridnum')[_0x7b7e('0x3c')]('cm_hopper_final')[_0x7b7e('0x44')](_0xccdfc7+_0x7b7e('0x41'),_0x3e4f21['id']['toString']()))[_0x7b7e('0x44')](_0x7b7e('0x40'),squel[_0x7b7e('0x38')]()[_0x7b7e('0x39')](_0x7b7e('0x1b'))[_0x7b7e('0x3c')](_0x7b7e('0x33'))['where'](_0xccdfc7+_0x7b7e('0x41'),_0x3e4f21['id'][_0x7b7e('0x3a')]())))[_0x7b7e('0x3a')]();return _0x5e8572;};function _0x24481a(_0x5b9ab5,_0x527403){var _0x5bdf1d=squel[_0x7b7e('0x31')]()[_0x7b7e('0x32')](_0x7b7e('0x33'))['fromQuery'](['phone',_0x7b7e('0x35'),_0x7b7e('0x42'),'ListId',_0x527403,_0x7b7e('0x36'),_0x7b7e('0x37')],squel[_0x7b7e('0x38')]()['field'](_0x7b7e('0x1b'),_0x7b7e('0x1b'))['field'](_0x7b7e('0x3b'),_0x7b7e('0x35'))[_0x7b7e('0x39')]('id',_0x7b7e('0x42'))[_0x7b7e('0x39')](LISTID[_0x7b7e('0x3a')](),_0x7b7e('0x22'))[_0x7b7e('0x39')](_0x5b9ab5['id'][_0x7b7e('0x3a')](),_0x527403)['field'](_0x7b7e('0x3b'),_0x7b7e('0x36'))['field'](_0x7b7e('0x3b'),_0x7b7e('0x37'))[_0x7b7e('0x3c')]('cm_contacts')[_0x7b7e('0x44')]('deletedAt\x20IS\x20NULL')[_0x7b7e('0x44')](_0x7b7e('0x3e'),LISTID['toString']())[_0x7b7e('0x44')](_0x7b7e('0x46'),squel['str'](hopperContacts))[_0x7b7e('0x44')](_0x7b7e('0x3f')))[_0x7b7e('0x3a')]();return _0x5bdf1d;}function _0x3b1adb(_0x5eb32c,_0x101896){var _0x73904d=squel[_0x7b7e('0x31')]()[_0x7b7e('0x32')](_0x7b7e('0x47'))[_0x7b7e('0x34')]([_0x7b7e('0x1b'),_0x7b7e('0x42'),_0x7b7e('0x22'),_0x101896,_0x7b7e('0x36'),'updatedAt'],squel[_0x7b7e('0x38')]()['field']('phone',_0x7b7e('0x1b'))[_0x7b7e('0x39')]('id',_0x7b7e('0x42'))[_0x7b7e('0x39')](LISTID['toString'](),_0x7b7e('0x22'))[_0x7b7e('0x39')](_0x5eb32c['id'][_0x7b7e('0x3a')](),_0x101896)[_0x7b7e('0x39')](_0x7b7e('0x3b'),_0x7b7e('0x36'))['field'](_0x7b7e('0x3b'),'updatedAt')['from'](_0x7b7e('0x43'))['where'](_0x7b7e('0x3d'))['where'](_0x7b7e('0x3e'),LISTID[_0x7b7e('0x3a')]())['where'](_0x7b7e('0x46'),squel[_0x7b7e('0x45')](hopperContacts))['where'](_0x7b7e('0x3f')))[_0x7b7e('0x3a')]();return _0x73904d;}return db[_0x7b7e('0x48')][_0x7b7e('0x49')]({'where':{'type':_0x7b7e('0x4a')},'attributes':['id',_0x7b7e('0x4b')],'include':[{'model':db[_0x7b7e('0x4c')],'as':_0x7b7e('0x4d'),'where':{'id':LISTID}}]})[_0x7b7e('0x28')](function(_0x17e5ba){var _0x589b02=[];if(_0x17e5ba){var _0x59ecf9;for(var _0x34e7df=0x0,_0x46ac1f;_0x34e7df<_0x17e5ba[_0x7b7e('0x17')];_0x34e7df+=0x1){_0x46ac1f=_0x17e5ba[_0x34e7df][_0x7b7e('0x4e')]({'plain':!![]});switch(_0x46ac1f[_0x7b7e('0x4b')]){case _0x7b7e('0x4f'):_0x589b02[_0x7b7e('0x29')](db['sequelize'][_0x7b7e('0x50')](_0x37895a(_0x46ac1f,_0x7b7e('0x51')))['then'](function(){})[_0x7b7e('0x2b')](_0x2d0620()));break;case _0x7b7e('0x52'):_0x589b02[_0x7b7e('0x29')](db[_0x7b7e('0x53')][_0x7b7e('0x50')](_0x8c80d5(_0x46ac1f,_0x7b7e('0x51')))[_0x7b7e('0x28')](function(){})[_0x7b7e('0x2b')](_0x2d0620()));break;default:_0x589b02[_0x7b7e('0x29')](db[_0x7b7e('0x53')][_0x7b7e('0x50')](_0x24481a(_0x46ac1f,'VoiceQueueId'))[_0x7b7e('0x28')](function(){})[_0x7b7e('0x2b')](_0x2d0620()));}}}return _0x589b02;})[_0x7b7e('0x54')]()[_0x7b7e('0x28')](function(){return db[_0x7b7e('0x48')][_0x7b7e('0x49')]({'where':{'type':_0x7b7e('0x4a')},'attributes':['id'],'include':[{'model':db['CmList'],'as':_0x7b7e('0x55'),'where':{'id':LISTID}}]})[_0x7b7e('0x28')](function(_0x1eb5ce){var _0x49f0a4=[];if(_0x1eb5ce){var _0x1d6aa4;for(var _0x195ae2=0x0,_0x381ee6;_0x195ae2<_0x1eb5ce[_0x7b7e('0x17')];_0x195ae2+=0x1){_0x381ee6=_0x1eb5ce[_0x195ae2][_0x7b7e('0x4e')]({'plain':!![]});_0x49f0a4['push'](db['sequelize']['query'](_0x3b1adb(_0x381ee6,_0x7b7e('0x51')))[_0x7b7e('0x28')](function(){})[_0x7b7e('0x2b')](_0x2d0620()));}}return _0x49f0a4;})['all']();})[_0x7b7e('0x28')](function(){return db[_0x7b7e('0x56')][_0x7b7e('0x49')]({'attributes':['id','dialCheckDuplicateType'],'include':[{'model':db[_0x7b7e('0x4c')],'as':_0x7b7e('0x4d'),'where':{'id':LISTID}}]})[_0x7b7e('0x28')](function(_0x34a06c){var _0x538c5f=[];if(_0x34a06c){for(var _0x315923=0x0,_0x40b4ae;_0x315923<_0x34a06c[_0x7b7e('0x17')];_0x315923+=0x1){_0x40b4ae=_0x34a06c[_0x315923][_0x7b7e('0x4e')]({'plain':!![]});switch(_0x40b4ae['dialCheckDuplicateType']){case'always':_0x538c5f[_0x7b7e('0x29')](db['sequelize'][_0x7b7e('0x50')](_0x37895a(_0x40b4ae,_0x7b7e('0x57')))[_0x7b7e('0x28')](function(){})[_0x7b7e('0x2b')](_0x2d0620()));break;case'onlyIfOpen':_0x538c5f[_0x7b7e('0x29')](db[_0x7b7e('0x53')][_0x7b7e('0x50')](_0x8c80d5(_0x40b4ae,_0x7b7e('0x57')))[_0x7b7e('0x28')](function(){})[_0x7b7e('0x2b')](_0x2d0620()));break;default:_0x538c5f[_0x7b7e('0x29')](db[_0x7b7e('0x53')][_0x7b7e('0x50')](_0x24481a(_0x40b4ae,_0x7b7e('0x57')))[_0x7b7e('0x28')](function(){})[_0x7b7e('0x2b')](_0x2d0620()));}}}return _0x538c5f;})[_0x7b7e('0x54')]();})[_0x7b7e('0x28')](function(){return db[_0x7b7e('0x56')][_0x7b7e('0x49')]({'attributes':['id'],'include':[{'model':db['CmList'],'as':_0x7b7e('0x55'),'where':{'id':LISTID}}]})[_0x7b7e('0x28')](function(_0x1d9e08){var _0xa03d7a=[];if(_0x1d9e08){for(var _0x10c35e=0x0,_0x302462;_0x10c35e<_0x1d9e08[_0x7b7e('0x17')];_0x10c35e+=0x1){_0x302462=_0x1d9e08[_0x10c35e]['get']({'plain':!![]});_0xa03d7a[_0x7b7e('0x29')](db[_0x7b7e('0x53')][_0x7b7e('0x50')](_0x3b1adb(_0x302462,_0x7b7e('0x57')))[_0x7b7e('0x28')](function(){})['catch'](_0x2d0620()));}}return _0xa03d7a;})['all']();})[_0x7b7e('0x2b')](function(_0x110f2b){logger[_0x7b7e('0x11')](_0x7b7e('0x58'),_0x7b7e('0x59'),_0x110f2b[_0x7b7e('0x2d')]);});}var processPromises=function(_0x2c65b8){return BPromise[_0x7b7e('0x54')](promises)[_0x7b7e('0x28')](function(_0x850d0f){})['catch'](function(_0x27402a){logger[_0x7b7e('0x11')](_0x7b7e('0x5a'),JSON[_0x7b7e('0x2e')](_0x27402a));})[_0x7b7e('0x5b')](function(){socket[_0x7b7e('0x5c')](_0x7b7e('0x5d')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x2c65b8){return _0x2c65b8['resume']();}});};var endCsv=function(){return BPromise[_0x7b7e('0x5e')]()['then'](function(){if(hopperContacts){return checkHopper();}})[_0x7b7e('0x28')](function(){socket[_0x7b7e('0x5c')]('contact:csv_'+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0x7b7e('0x5f')](FILEPATH);}catch(_0x38fd40){logger[_0x7b7e('0x11')](_0x7b7e('0x60'),JSON[_0x7b7e('0x2e')](_0x38fd40));}finally{process['exit'](0x0);}});};process['on'](_0x7b7e('0x61'),function(){logger['info']('CSV\x20import\x20process\x20stopped!');endCsv();});function main(){return BPromise[_0x7b7e('0x5e')]()[_0x7b7e('0x28')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x7b7e('0x10')](',');return db[_0x7b7e('0x26')]['findAll']({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0x7b7e('0x28')](function(_0x5cedd4){var _0x25233a=fs[_0x7b7e('0x62')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0x7b7e('0x63')](_0x25233a,{'header':!![],'skipEmptyLines':!![],'step':function(_0x1e71ab,_0x11d615){total+=0x1;var _0x3afd15=total;promises[_0x7b7e('0x29')](checkRow(_0x1e71ab,_0x5cedd4,_0x3afd15)['then'](function(){success+=0x1;})[_0x7b7e('0x2b')](function(_0x30eeee){if(_0x30eeee['error']){errors+=0x1;delete _0x30eeee[_0x7b7e('0x11')];}else if(_0x30eeee[_0x7b7e('0x64')]){duplicates+=0x1;delete _0x30eeee[_0x7b7e('0x64')];}rows[_0x7b7e('0x29')](_0x30eeee);}));if(total%0xc8===0x0){_0x11d615[_0x7b7e('0x65')]();return processPromises(_0x11d615);}},'complete':function(){return processPromises()[_0x7b7e('0x28')](function(){logger[_0x7b7e('0x66')](_0x7b7e('0x67'));endCsv();});},'error':function(_0x41e2b5,_0x97232d){logger[_0x7b7e('0x66')](_0x7b7e('0x68'),JSON[_0x7b7e('0x2e')](_0x41e2b5));endCsv();}});})[_0x7b7e('0x2b')](function(_0x12d0cb){logger[_0x7b7e('0x11')](_0x7b7e('0x69'),JSON[_0x7b7e('0x2e')](_0x12d0cb));});}main(); \ No newline at end of file +var _0x0713=['papaparse','ioredis','../../../mysqldb','../../../config/logger','api','redis','defaults','localhost','socket.io-emitter','../../../api/cmContact/cmContact.socket','register','argv','undefined','null','Missing\x20filepath\x20parameter!','Missing\x20binding\x20parameters!','split','Missing\x20ListId\x20parameter!','error','contact','index','isNil','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','length','map','message','join','hasOwnProperty','data','firstName','firstName\x20not\x20specified!','phone\x20not\x20specified!','birthDate','YYYY-MM-DD','isValid','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email\x20format\x20is\x20not\x20valid!','ListId','find','duplicate','Duplicate\x20Contact','CmContact','create','keys','then','catch','Error\x20while\x20creating\x20contact:\x20','stringify','checkHopper','inspect','insert','fromQuery','phone','scheduledAt','updatedAt','field','NOW()','ContactId','toString','createdAt','from','ListId\x20=\x20?','where','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','select','cm_hopper','\x20=\x20?','into','deletedAt\x20IS\x20NULL','id\x20IN\x20?','str','calleridnum','cm_hopper_final','cm_hopper_black','cm_contacts','VoiceQueue','findAll','outbound','dialCheckDuplicateType','Lists','get','sequelize','query','VoiceQueueId','onlyIfOpen','push','all','CmList','Campaign','CampaignId','BlackLists','cmContact,\x20%s,\x20%s','Error\x20processing\x20rows\x20block:','emit','contact:csv_','resume','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','exit','SIGINT','info','CSV\x20import\x20process\x20stopped!','resolve','pause','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','lodash','squel'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var BPromise=require('bluebird');var util=require('util');var _=require(_0x3071('0x0'));var fs=require('fs');var squel=require(_0x3071('0x1'));var Papa=require(_0x3071('0x2'));var Redis=require(_0x3071('0x3'));var db=require(_0x3071('0x4'))['db'];var config=require('../../../config/environment');var logger=require(_0x3071('0x5'))(_0x3071('0x6'));config[_0x3071('0x7')]=_[_0x3071('0x8')](config[_0x3071('0x7')],{'host':_0x3071('0x9'),'port':0x18eb});var socket=require(_0x3071('0xa'))(new Redis(config[_0x3071('0x7')]));require(_0x3071('0xb'))[_0x3071('0xc')](socket);try{if(!process[_0x3071('0xd')][0x2]||process[_0x3071('0xd')][0x2]===_0x3071('0xe')||process['argv'][0x2]===_0x3071('0xf')){throw new Error(_0x3071('0x10'));}var FILEPATH=process[_0x3071('0xd')][0x2];if(!process[_0x3071('0xd')][0x3]||process[_0x3071('0xd')][0x3]==='undefined'||process[_0x3071('0xd')][0x3]===_0x3071('0xf')||!process[_0x3071('0xd')][0x4]||process[_0x3071('0xd')][0x4]===_0x3071('0xe')||process['argv'][0x4]==='null'){throw new Error(_0x3071('0x11'));}var FIELDS=_['zipObject'](process[_0x3071('0xd')][0x3][_0x3071('0x12')](','),process['argv'][0x4][_0x3071('0x12')](','));if(!process['argv'][0x5]||process[_0x3071('0xd')][0x5]===_0x3071('0xe')||process[_0x3071('0xd')][0x5]===_0x3071('0xf')){throw new Error(_0x3071('0x13'));}var LISTID=process[_0x3071('0xd')][0x5];var COMPANYID=process[_0x3071('0xd')][0x6]&&process[_0x3071('0xd')][0x6]!==_0x3071('0xe')&&process[_0x3071('0xd')][0x6]!=='null'?process[_0x3071('0xd')][0x6]:null;var DUPLICATES=process[_0x3071('0xd')][0x7]&&process[_0x3071('0xd')][0x7]!==_0x3071('0xe')&&process[_0x3071('0xd')][0x7]!==_0x3071('0xf')?process[_0x3071('0xd')][0x7]:null;if(!process[_0x3071('0xd')][0x8]||process['argv'][0x8]===_0x3071('0xe')||process[_0x3071('0xd')][0x8]===_0x3071('0xf')){throw new Error('Missing\x20socket_timestamp\x20parameter!');}var SOCKET_TIMESTAMP=process[_0x3071('0xd')][0x8];}catch(_0x5cd80d){logger[_0x3071('0x14')](_0x5cd80d);endCsv();}var total=0x0;var pTotal=0x0;var success=0x0;var errors=0x0;var duplicates=0x0;var rows=[];var hopperContacts='';var promises=[];var index=0x0;var alreadyInvalid=![];function handleCheckRowError(_0x43128c,_0x3762d8,_0x457b57,_0x33090c){var _0x34c50e={'message':_0x3762d8};_0x34c50e[_0x43128c]=!![];if(_0x457b57){_0x34c50e[_0x3071('0x15')]=_0x457b57;}if(_0x33090c){_0x34c50e[_0x3071('0x16')]=_0x33090c;}return _0x34c50e;}function isEmail(_0x542646){return/^([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22))*\x40([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d))*$/['test'](_0x542646);}function checkRow(_0x2ce48a,_0xb05b1d,_0x412652){return new BPromise(function(_0x13df9f,_0x2793ef){if(_[_0x3071('0x17')](_0x2ce48a)){return _0x2793ef(handleCheckRowError(_0x3071('0x14'),_0x3071('0x18'),null,_0x412652));}if(_0x2ce48a[_0x3071('0x19')]&&_0x2ce48a['errors'][_0x3071('0x1a')]){var _0x3f1e6e=_[_0x3071('0x1b')](_0x2ce48a['errors'],_0x3071('0x1c'))[_0x3071('0x1d')](';');return _0x2793ef(handleCheckRowError(_0x3071('0x14'),_0x3f1e6e,null,_0x412652));}var _0x950fde={};for(var _0x3fa3b8 in FIELDS){if(FIELDS[_0x3071('0x1e')](_0x3fa3b8)&&FIELDS[_0x3fa3b8]){_0x950fde[_0x3fa3b8]=_0x2ce48a[_0x3071('0x1f')][0x0][FIELDS[_0x3fa3b8]]||_0x2ce48a[_0x3071('0x1f')][0x0]['\ufeff'+FIELDS[_0x3fa3b8]];}}if(!_0x950fde[_0x3071('0x20')]){return _0x2793ef(handleCheckRowError(_0x3071('0x14'),_0x3071('0x21'),null,_0x412652));}if(!_0x950fde['phone']){return _0x2793ef(handleCheckRowError('error',_0x3071('0x22'),null,_0x412652));}if(_0x950fde[_0x3071('0x23')]){var _0x6ddf96=moment(_0x950fde[_0x3071('0x23')],_0x3071('0x24'));if(!_0x6ddf96[_0x3071('0x25')]()){return _0x2793ef(handleCheckRowError(_0x3071('0x14'),_0x3071('0x26'),null,_0x412652));}}if(_0x950fde['email']){if(!isEmail(_0x950fde['email'])){return _0x2793ef(handleCheckRowError('error',_0x3071('0x27'),null,_0x412652));}}_0x950fde[_0x3071('0x28')]=LISTID;_0x950fde['CompanyId']=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0x3071('0x1a')]&&_0xb05b1d){var _0x28747d={};for(var _0x25250e=0x0,_0x13ae2c=DUPLICATES['length'];_0x25250e<_0x13ae2c;_0x25250e+=0x1){_0x28747d[DUPLICATES[_0x25250e]]=_0x950fde[DUPLICATES[_0x25250e]];}var _0x218a82=_[_0x3071('0x29')](_0xb05b1d,_0x28747d);if(_0x218a82){return _0x2793ef(handleCheckRowError(_0x3071('0x2a'),_0x3071('0x2b'),_0x218a82,_0x412652));}}return db[_0x3071('0x2c')][_0x3071('0x2d')](_0x950fde,{'raw':!![],'hooks':![],'fields':_[_0x3071('0x2e')](_0x950fde)})[_0x3071('0x2f')](function(_0x596cc3){if(DUPLICATES&&DUPLICATES[_0x3071('0x1a')]&&_0xb05b1d){_0xb05b1d['push'](_['pick'](_0x950fde,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x596cc3['id'];return _0x13df9f();})[_0x3071('0x30')](function(_0xa3a7ae){return _0x2793ef(handleCheckRowError('error',_0x3071('0x31')+(_0xa3a7ae[_0x3071('0x1c')]||JSON[_0x3071('0x32')](_0xa3a7ae)),null,_0x412652));});});}function checkHopper(){function _0x14ac42(){return function(_0xc60572){logger[_0x3071('0x14')]('cmContact',_0x3071('0x33'),util[_0x3071('0x34')](_0xc60572,{'showHidden':![],'depth':null}));};}var _0x4ce6d4=function(_0x44ad05,_0x5b1392){var _0x28f855=squel[_0x3071('0x35')]()['into']('cm_hopper')[_0x3071('0x36')]([_0x3071('0x37'),_0x3071('0x38'),'ContactId',_0x3071('0x28'),_0x5b1392,'createdAt',_0x3071('0x39')],squel['select']()[_0x3071('0x3a')](_0x3071('0x37'),_0x3071('0x37'))[_0x3071('0x3a')](_0x3071('0x3b'),'scheduledAt')['field']('id',_0x3071('0x3c'))[_0x3071('0x3a')](LISTID[_0x3071('0x3d')](),_0x3071('0x28'))['field'](_0x44ad05['id'][_0x3071('0x3d')](),_0x5b1392)[_0x3071('0x3a')](_0x3071('0x3b'),_0x3071('0x3e'))[_0x3071('0x3a')](_0x3071('0x3b'),'updatedAt')[_0x3071('0x3f')]('cm_contacts')['where']('deletedAt\x20IS\x20NULL')['where'](_0x3071('0x40'),LISTID[_0x3071('0x3d')]())[_0x3071('0x41')](_0x3071('0x42'))[_0x3071('0x41')](_0x3071('0x43'),squel[_0x3071('0x44')]()[_0x3071('0x3a')]('phone')[_0x3071('0x3f')](_0x3071('0x45'))[_0x3071('0x41')](_0x5b1392+_0x3071('0x46'),_0x44ad05['id'][_0x3071('0x3d')]())))['toString']();return _0x28f855;};var _0x5c93c7=function(_0x1721d0,_0x3c2f5e){var _0x1fe5e0=squel[_0x3071('0x35')]()[_0x3071('0x47')]('cm_hopper')[_0x3071('0x36')](['phone',_0x3071('0x38'),'ContactId','ListId',_0x3c2f5e,_0x3071('0x3e'),'updatedAt'],squel[_0x3071('0x44')]()['field'](_0x3071('0x37'),_0x3071('0x37'))[_0x3071('0x3a')](_0x3071('0x3b'),'scheduledAt')[_0x3071('0x3a')]('id','ContactId')[_0x3071('0x3a')](LISTID['toString'](),_0x3071('0x28'))[_0x3071('0x3a')](_0x1721d0['id']['toString'](),_0x3c2f5e)[_0x3071('0x3a')](_0x3071('0x3b'),_0x3071('0x3e'))[_0x3071('0x3a')](_0x3071('0x3b'),_0x3071('0x39'))[_0x3071('0x3f')]('cm_contacts')[_0x3071('0x41')](_0x3071('0x48'))[_0x3071('0x41')](_0x3071('0x40'),LISTID['toString']())[_0x3071('0x41')](_0x3071('0x49'),squel[_0x3071('0x4a')](hopperContacts))[_0x3071('0x41')](_0x3071('0x42'))[_0x3071('0x41')](_0x3071('0x43'),squel[_0x3071('0x44')]()[_0x3071('0x3a')](_0x3071('0x4b'))[_0x3071('0x3f')](_0x3071('0x4c'))[_0x3071('0x41')](_0x3c2f5e+_0x3071('0x46'),_0x1721d0['id'][_0x3071('0x3d')]()))[_0x3071('0x41')]('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0x3071('0x3a')]('phone')[_0x3071('0x3f')](_0x3071('0x45'))[_0x3071('0x41')](_0x3c2f5e+'\x20=\x20?',_0x1721d0['id'][_0x3071('0x3d')]())))[_0x3071('0x3d')]();return _0x1fe5e0;};function _0x5bc69e(_0x4b8ec0,_0x1b89ea){var _0x15abc4=squel[_0x3071('0x35')]()[_0x3071('0x47')]('cm_hopper')[_0x3071('0x36')]([_0x3071('0x37'),_0x3071('0x38'),_0x3071('0x3c'),_0x3071('0x28'),_0x1b89ea,'createdAt',_0x3071('0x39')],squel[_0x3071('0x44')]()[_0x3071('0x3a')](_0x3071('0x37'),_0x3071('0x37'))[_0x3071('0x3a')](_0x3071('0x3b'),'scheduledAt')['field']('id',_0x3071('0x3c'))['field'](LISTID[_0x3071('0x3d')](),_0x3071('0x28'))['field'](_0x4b8ec0['id'][_0x3071('0x3d')](),_0x1b89ea)[_0x3071('0x3a')]('NOW()',_0x3071('0x3e'))[_0x3071('0x3a')](_0x3071('0x3b'),_0x3071('0x39'))[_0x3071('0x3f')]('cm_contacts')[_0x3071('0x41')](_0x3071('0x48'))[_0x3071('0x41')]('ListId\x20=\x20?',LISTID[_0x3071('0x3d')]())[_0x3071('0x41')](_0x3071('0x49'),squel[_0x3071('0x4a')](hopperContacts))[_0x3071('0x41')](_0x3071('0x42')))[_0x3071('0x3d')]();return _0x15abc4;}function _0x2e39ff(_0x3b47e8,_0x5cb3b3){var _0x5d1316=squel[_0x3071('0x35')]()[_0x3071('0x47')](_0x3071('0x4d'))[_0x3071('0x36')]([_0x3071('0x37'),_0x3071('0x3c'),_0x3071('0x28'),_0x5cb3b3,_0x3071('0x3e'),_0x3071('0x39')],squel[_0x3071('0x44')]()['field'](_0x3071('0x37'),_0x3071('0x37'))[_0x3071('0x3a')]('id',_0x3071('0x3c'))[_0x3071('0x3a')](LISTID[_0x3071('0x3d')](),_0x3071('0x28'))[_0x3071('0x3a')](_0x3b47e8['id']['toString'](),_0x5cb3b3)[_0x3071('0x3a')](_0x3071('0x3b'),'createdAt')['field'](_0x3071('0x3b'),_0x3071('0x39'))[_0x3071('0x3f')](_0x3071('0x4e'))['where']('deletedAt\x20IS\x20NULL')[_0x3071('0x41')]('ListId\x20=\x20?',LISTID['toString']())['where']('id\x20IN\x20?',squel[_0x3071('0x4a')](hopperContacts))[_0x3071('0x41')](_0x3071('0x42')))['toString']();return _0x5d1316;}return db[_0x3071('0x4f')][_0x3071('0x50')]({'where':{'type':_0x3071('0x51')},'attributes':['id',_0x3071('0x52')],'include':[{'model':db['CmList'],'as':_0x3071('0x53'),'where':{'id':LISTID}}]})[_0x3071('0x2f')](function(_0x588406){var _0x1b35d3=[];if(_0x588406){var _0x29ee70;for(var _0x388cd1=0x0,_0x40c258;_0x388cd1<_0x588406[_0x3071('0x1a')];_0x388cd1+=0x1){_0x40c258=_0x588406[_0x388cd1][_0x3071('0x54')]({'plain':!![]});switch(_0x40c258[_0x3071('0x52')]){case'always':_0x1b35d3['push'](db[_0x3071('0x55')][_0x3071('0x56')](_0x5c93c7(_0x40c258,_0x3071('0x57')))['then'](function(){})['catch'](_0x14ac42()));break;case _0x3071('0x58'):_0x1b35d3[_0x3071('0x59')](db[_0x3071('0x55')][_0x3071('0x56')](_0x4ce6d4(_0x40c258,_0x3071('0x57')))[_0x3071('0x2f')](function(){})[_0x3071('0x30')](_0x14ac42()));break;default:_0x1b35d3[_0x3071('0x59')](db['sequelize'][_0x3071('0x56')](_0x5bc69e(_0x40c258,'VoiceQueueId'))[_0x3071('0x2f')](function(){})[_0x3071('0x30')](_0x14ac42()));}}}return _0x1b35d3;})[_0x3071('0x5a')]()[_0x3071('0x2f')](function(){return db[_0x3071('0x4f')][_0x3071('0x50')]({'where':{'type':_0x3071('0x51')},'attributes':['id'],'include':[{'model':db[_0x3071('0x5b')],'as':'BlackLists','where':{'id':LISTID}}]})[_0x3071('0x2f')](function(_0x138a94){var _0x1da477=[];if(_0x138a94){var _0x4f06c0;for(var _0x2a2e7a=0x0,_0x22ec7b;_0x2a2e7a<_0x138a94[_0x3071('0x1a')];_0x2a2e7a+=0x1){_0x22ec7b=_0x138a94[_0x2a2e7a]['get']({'plain':!![]});_0x1da477['push'](db[_0x3071('0x55')]['query'](_0x2e39ff(_0x22ec7b,_0x3071('0x57')))[_0x3071('0x2f')](function(){})[_0x3071('0x30')](_0x14ac42()));}}return _0x1da477;})[_0x3071('0x5a')]();})[_0x3071('0x2f')](function(){return db[_0x3071('0x5c')][_0x3071('0x50')]({'attributes':['id','dialCheckDuplicateType'],'include':[{'model':db[_0x3071('0x5b')],'as':_0x3071('0x53'),'where':{'id':LISTID}}]})[_0x3071('0x2f')](function(_0x3cc937){var _0x98d0fb=[];if(_0x3cc937){for(var _0x1fea60=0x0,_0x435dcb;_0x1fea60<_0x3cc937[_0x3071('0x1a')];_0x1fea60+=0x1){_0x435dcb=_0x3cc937[_0x1fea60]['get']({'plain':!![]});switch(_0x435dcb[_0x3071('0x52')]){case'always':_0x98d0fb[_0x3071('0x59')](db[_0x3071('0x55')][_0x3071('0x56')](_0x5c93c7(_0x435dcb,_0x3071('0x5d')))[_0x3071('0x2f')](function(){})[_0x3071('0x30')](_0x14ac42()));break;case _0x3071('0x58'):_0x98d0fb[_0x3071('0x59')](db[_0x3071('0x55')][_0x3071('0x56')](_0x4ce6d4(_0x435dcb,'CampaignId'))[_0x3071('0x2f')](function(){})[_0x3071('0x30')](_0x14ac42()));break;default:_0x98d0fb['push'](db[_0x3071('0x55')][_0x3071('0x56')](_0x5bc69e(_0x435dcb,_0x3071('0x5d')))[_0x3071('0x2f')](function(){})[_0x3071('0x30')](_0x14ac42()));}}}return _0x98d0fb;})['all']();})['then'](function(){return db[_0x3071('0x5c')]['findAll']({'attributes':['id'],'include':[{'model':db[_0x3071('0x5b')],'as':_0x3071('0x5e'),'where':{'id':LISTID}}]})[_0x3071('0x2f')](function(_0x136278){var _0x22783b=[];if(_0x136278){for(var _0x2f31b7=0x0,_0x568386;_0x2f31b7<_0x136278[_0x3071('0x1a')];_0x2f31b7+=0x1){_0x568386=_0x136278[_0x2f31b7][_0x3071('0x54')]({'plain':!![]});_0x22783b[_0x3071('0x59')](db[_0x3071('0x55')]['query'](_0x2e39ff(_0x568386,_0x3071('0x5d')))[_0x3071('0x2f')](function(){})['catch'](_0x14ac42()));}}return _0x22783b;})[_0x3071('0x5a')]();})[_0x3071('0x30')](function(_0x391887){logger[_0x3071('0x14')](_0x3071('0x5f'),'generalCheckHopper',_0x391887[_0x3071('0x1c')]);});}var processPromises=function(_0x479fe7){return BPromise[_0x3071('0x5a')](promises)[_0x3071('0x2f')](function(_0x39060f){})[_0x3071('0x30')](function(_0x1120ec){logger[_0x3071('0x14')](_0x3071('0x60'),JSON[_0x3071('0x32')](_0x1120ec));})['finally'](function(){socket[_0x3071('0x61')](_0x3071('0x62')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x479fe7){return _0x479fe7[_0x3071('0x63')]();}});};var endCsv=function(){return BPromise['resolve']()[_0x3071('0x2f')](function(){if(hopperContacts){return checkHopper();}})['then'](function(){socket[_0x3071('0x61')](_0x3071('0x62')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0x3071('0x64')](FILEPATH);}catch(_0x5e0cbd){logger[_0x3071('0x14')](_0x3071('0x65'),JSON[_0x3071('0x32')](_0x5e0cbd));}finally{process[_0x3071('0x66')](0x0);}});};process['on'](_0x3071('0x67'),function(){logger[_0x3071('0x68')](_0x3071('0x69'));endCsv();});function main(){return BPromise[_0x3071('0x6a')]()[_0x3071('0x2f')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES['split'](',');return db[_0x3071('0x2c')][_0x3071('0x50')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0x3071('0x2f')](function(_0x5b2830){var _0x561030=fs['createReadStream'](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa['parse'](_0x561030,{'header':!![],'skipEmptyLines':!![],'step':function(_0x4eb9e2,_0x8c77b7){total+=0x1;var _0x44b4c9=total;promises['push'](checkRow(_0x4eb9e2,_0x5b2830,_0x44b4c9)[_0x3071('0x2f')](function(){success+=0x1;})[_0x3071('0x30')](function(_0x1f61df){if(_0x1f61df['error']){errors+=0x1;delete _0x1f61df['error'];}else if(_0x1f61df[_0x3071('0x2a')]){duplicates+=0x1;delete _0x1f61df[_0x3071('0x2a')];}rows[_0x3071('0x59')](_0x1f61df);}));if(total%0xc8===0x0){_0x8c77b7[_0x3071('0x6b')]();return processPromises(_0x8c77b7);}},'complete':function(){return processPromises()[_0x3071('0x2f')](function(){logger[_0x3071('0x68')](_0x3071('0x6c'));endCsv();});},'error':function(_0x5eb60d,_0x58b62c){logger[_0x3071('0x68')](_0x3071('0x6d'),JSON[_0x3071('0x32')](_0x5eb60d));endCsv();}});})[_0x3071('0x30')](function(_0x5a3b64){logger[_0x3071('0x14')](_0x3071('0x6e'),JSON[_0x3071('0x32')](_0x5a3b64));});}main(); \ No newline at end of file diff --git a/server/components/import/cm/csv2.js b/server/components/import/cm/csv2.js index 082084a..01e7f50 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 _0xe748=['info','Received\x20SIGINT','error','message','exit','errors','push','code','sequelize','query','spread','catch','main','stringify','send','socket_timestamp','root','server/files/tmp','.csv','keys','header','parse','data','length','rows','trim','replace','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','priority','isNumber','includes','agent\x20not\x20exists','email\x20wrong\x20format','dateOfBirth','YYYY-MM-DD','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','firstName','\x20not\x20specified','SystemRow','appendFileSync','emit','contact:import:','Abort\x20parser','SystemError','step','duplicates','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27',',\x20scheduledAt\x20=\x20NOW()','voice_queues_has_cm_lists','voice_queues','VoiceQueueId','campaigns_has_cm_lists','campaigns','CampaignId','campaigns_has_cm_blacklists','finish','affectedRows','unlink','complete','argv','arguments\x20\x20\x20','existsSync','file\x20doesn\x27t\x20exists','binding','binding\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','No\x20agent\x20available','uncaughtException','path','lodash','papaparse','bluebird','moment','squel','ioredis','../../../config/environment','redis','defaults','localhost','format','YYYY-MM-DD\x20HH:mm:ss','test','select','field','phone','.id\x20=\x20','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','join','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.UserId','insert','into','cm_hopper','fromQuery','scheduledat','ListId','createdAt','updatedAt','UserId','fields','from','cm_contacts.ListId\x20=\x20','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22onlyIfOpen\x22','cm_hopper_black','ContactId','cm_contacts','ListId\x20=\x20?','toString','concat','CompanyId',')\x20NOT\x20IN\x20?','id\x20IN\x20?','MIN(id)','group'];(function(_0x2bb66c,_0x36c6c6){var _0x1e0f98=function(_0x1e3412){while(--_0x1e3412){_0x2bb66c['push'](_0x2bb66c['shift']());}};_0x1e0f98(++_0x36c6c6);}(_0xe748,0x1ca));var _0x8e74=function(_0x23b9ed,_0x4a8470){_0x23b9ed=_0x23b9ed-0x0;var _0x38b421=_0xe748[_0x23b9ed];return _0x38b421;};'use strict';var fs=require('fs');var path=require(_0x8e74('0x0'));var _=require(_0x8e74('0x1'));var Papa=require(_0x8e74('0x2'));var util=require('util');var BPromise=require(_0x8e74('0x3'));var moment=require(_0x8e74('0x4'));var squel=require(_0x8e74('0x5'));var Redis=require(_0x8e74('0x6'));var db=require('../../../mysqldb')['db'];var config=require(_0x8e74('0x7'));var logger=require('../../../config/logger')('import');config[_0x8e74('0x8')]=_[_0x8e74('0x9')](config[_0x8e74('0x8')],{'host':_0x8e74('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8e74('0x8')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var NOW=moment()[_0x8e74('0xb')](_0x8e74('0xc'));function isEmail(_0x475b7a){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))*$/[_0x8e74('0xd')](_0x475b7a);}function selectNotIn(_0x5884c5,_0x26936f,_0x12993b,_0x25eb54,_0x18dfd0){return squel[_0x8e74('0xe')]()[_0x8e74('0xf')](_0x8e74('0x10'))['from'](_0x25eb54)['join'](_0x26936f,null,_0x26936f+_0x8e74('0x11')+_0x25eb54+'.'+_0x12993b)[_0x8e74('0x12')](_0x25eb54+'.'+_0x12993b+_0x8e74('0x13')+_0x5884c5+'.'+_0x12993b)['where'](_0x26936f+_0x8e74('0x14')+_0x18dfd0[_0x8e74('0x15')]()+')');}function insertCmHopper(_0x210937,_0x173523,_0x34205d,_0x7fabb2,_0x43f3b3){var _0x33862f=[_0x8e74('0x16'),_0x8e74('0x17'),'cm_contacts.id','cm_contacts.ListId',_0x173523+'.'+_0x7fabb2,_0x8e74('0x18'),_0x8e74('0x19'),'cm_contacts.priority',_0x8e74('0x1a'),'\x22'+_0x43f3b3+'\x22'];return squel[_0x8e74('0x1b')]()[_0x8e74('0x1c')](_0x8e74('0x1d'))[_0x8e74('0x1e')]([_0x8e74('0x10'),_0x8e74('0x1f'),'ContactId',_0x8e74('0x20'),_0x7fabb2,_0x8e74('0x21'),_0x8e74('0x22'),'priority',_0x8e74('0x23'),'recallme'],squel[_0x8e74('0xe')]()[_0x8e74('0x24')](_0x33862f)[_0x8e74('0x25')](_0x173523)['join']('cm_contacts',null,_0x8e74('0x26')+_0x173523+'.CmListId')[_0x8e74('0x15')](_0x34205d,null,_0x34205d+_0x8e74('0x11')+_0x173523+'.'+_0x7fabb2)[_0x8e74('0x12')](_0x173523+_0x8e74('0x27'),_0x210937)[_0x8e74('0x12')](_0x8e74('0x28'),NOW)[_0x8e74('0x12')](_0x8e74('0x29'),selectNotIn(_0x173523,_0x34205d,_0x7fabb2,_0x8e74('0x1d'),['\x22always\x22',_0x8e74('0x2a')]))[_0x8e74('0x12')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x173523,_0x34205d,_0x7fabb2,_0x8e74('0x1d'),['\x22always\x22'])))['toString']();}function insertCmHopperBlack(_0x2bff12,_0x43100b,_0xc7a4b3,_0x2cf0d4){var _0x376c3d=[_0x8e74('0x16'),'cm_contacts.id','cm_contacts.ListId',_0x43100b+'.'+_0x2cf0d4,_0x8e74('0x18'),_0x8e74('0x19')];return squel['insert']()['into'](_0x8e74('0x2b'))[_0x8e74('0x1e')]([_0x8e74('0x10'),_0x8e74('0x2c'),_0x8e74('0x20'),_0x2cf0d4,_0x8e74('0x21'),_0x8e74('0x22')],squel[_0x8e74('0xe')]()['fields'](_0x376c3d)['from'](_0x43100b)[_0x8e74('0x15')](_0x8e74('0x2d'),null,'cm_contacts.ListId\x20=\x20'+_0x43100b+'.CmListId')[_0x8e74('0x15')](_0xc7a4b3,null,_0xc7a4b3+_0x8e74('0x11')+_0x43100b+'.'+_0x2cf0d4)[_0x8e74('0x12')](_0x43100b+_0x8e74('0x27'),_0x2bff12)[_0x8e74('0x12')](_0x8e74('0x28'),NOW)[_0x8e74('0x12')](_0x8e74('0x29'),squel[_0x8e74('0xe')]()[_0x8e74('0xf')](_0x8e74('0x10'))[_0x8e74('0x25')](_0x8e74('0x2b'))[_0x8e74('0x12')](_0x8e74('0x2e'),_0x2bff12)[_0x8e74('0x12')](_0x2cf0d4+'\x20=\x20?',_0x43100b+'.'+_0x2cf0d4)))[_0x8e74('0x2f')]();}function insertCmContact(_0x250619,_0x2a63a5,_0x4b721f,_0x3428e5){var _0x20f76d=_[_0x8e74('0x30')](_['keys'](_0x3428e5),['ListId',_0x8e74('0x31'),_0x8e74('0x21'),'updatedAt']);return squel[_0x8e74('0x1b')]()[_0x8e74('0x1c')](_0x8e74('0x2d'))[_0x8e74('0x1e')](_0x20f76d,squel['select']()[_0x8e74('0x24')](_0x20f76d)['from'](_0x2a63a5)[_0x8e74('0x12')]('('+_0x4b721f[_0x8e74('0x15')](',')+_0x8e74('0x32'),squel[_0x8e74('0xe')]()[_0x8e74('0x24')](_0x4b721f)[_0x8e74('0x25')]('cm_contacts')['where'](_0x8e74('0x2e'),_0x250619))[_0x8e74('0x12')](_0x8e74('0x33'),squel[_0x8e74('0xe')]()[_0x8e74('0xf')](_0x8e74('0x34'),'min_id')['from'](_0x2a63a5)[_0x8e74('0x35')](_0x4b721f[_0x8e74('0x15')](','))))[_0x8e74('0x2f')]();}function handleStop(){logger[_0x8e74('0x36')](_0x8e74('0x37'));stopped=!![];}function handleUncaughtException(_0x952570){logger[_0x8e74('0x38')](_0x952570[_0x8e74('0x39')]);process[_0x8e74('0x3a')](0x1);}function handleError(_0x1e5f36,_0x2934c0){stats[_0x8e74('0x3b')][_0x8e74('0x3c')]({'name':_0x2934c0[_0x8e74('0x3d')],'message':_0x2934c0[_0x8e74('0x39')],'row':_0x1e5f36});}function handleQuery(_0x44f582){logger[_0x8e74('0x36')](_0x44f582);return db[_0x8e74('0x3e')][_0x8e74('0x3f')](_0x44f582)[_0x8e74('0x40')](function(_0x5d7375){results[_0x8e74('0x3c')](_0x5d7375);})[_0x8e74('0x41')](function(_0x1fae4b){logger['error'](_0x1fae4b[_0x8e74('0x39')]);});}function main(_0x46333b,_0x2dd46e,_0x2bfdf5,_0x2c2d08){logger[_0x8e74('0x36')](_0x8e74('0x42'),_0x46333b,JSON[_0x8e74('0x43')](_0x2dd46e));process[_0x8e74('0x44')]('start');var _0x508902=_0x2dd46e['binding'];var _0x1fb9f5=_0x2dd46e[_0x8e74('0x45')];var _0x29e9d1=path[_0x8e74('0x15')](config[_0x8e74('0x46')],_0x8e74('0x47'),_0x1fb9f5+_0x8e74('0x48'));var _0x38fc85=_[_0x8e74('0x49')](_0x508902)[_0x8e74('0x15')]();logger[_0x8e74('0x36')](_0x8e74('0x4a'),_0x38fc85);fs['writeFileSync'](_0x29e9d1,_0x38fc85+'\x0a');Papa[_0x8e74('0x4b')](fs['createReadStream'](_0x46333b),{'header':!![],'skipEmptyLines':!![],'step':function(_0x3e39b4,_0x4b83c8){try{for(var _0x1015a8=0x0,_0x53bc28=[];_0x1015a8<_0x3e39b4[_0x8e74('0x4c')][_0x8e74('0x4d')];_0x1015a8++){stats[_0x8e74('0x4e')]+=0x1;if(_0x3e39b4[_0x8e74('0x3b')][_0x1015a8]){handleError(_0x3e39b4['data'][_0x1015a8],_0x3e39b4['errors'][_0x1015a8]);}else{var _0x50108b=[];for(var _0x13ddde in _0x508902){if(_0x508902['hasOwnProperty'](_0x13ddde)){if(_0x3e39b4['data'][_0x1015a8][_0x508902[_0x13ddde]]){var _0x53b79f=_[_0x8e74('0x4f')](_0x3e39b4[_0x8e74('0x4c')][_0x1015a8][_0x508902[_0x13ddde]][_0x8e74('0x50')](/"/g,'\x27'));switch(_0x13ddde){case'scheduledat':var _0x3185e9=moment(_0x53b79f,_0x8e74('0xc'),!![]);if(_0x3185e9[_0x8e74('0x51')]()){_0x53bc28['push']('\x22'+_0x53b79f+'\x22');}else{_0x50108b[_0x8e74('0x3c')](_0x8e74('0x52'));}break;case _0x8e74('0x53'):var _0x40e565=parseInt(_0x53b79f);_0x53b79f=_['isNaN'](_0x40e565)||_0x40e565<0x0||_0x40e565>0x4?_0x2c2d08?0x3:0x2:_0x40e565;_0x53bc28[_0x8e74('0x3c')]('\x22'+_0x53b79f+'\x22');break;case _0x8e74('0x23'):var _0x404838=parseInt(_0x53b79f);if(_[_0x8e74('0x54')](_0x404838)&&_[_0x8e74('0x55')](_0x2bfdf5,_0x404838)){_0x53bc28[_0x8e74('0x3c')]('\x22'+_0x404838+'\x22');}else{_0x50108b[_0x8e74('0x3c')](_0x8e74('0x56'));}break;case'email':if(isEmail(_0x53b79f)){_0x53bc28['push']('\x22'+_0x53b79f+'\x22');}else{_0x50108b['push'](_0x8e74('0x57'));}break;case _0x8e74('0x58'):var _0xae8bbc=moment(_0x53b79f,_0x8e74('0x59'),!![]);if(_0xae8bbc[_0x8e74('0x51')]()){_0x53bc28[_0x8e74('0x3c')]('\x22'+_0x53b79f+'\x22');}else{_0x50108b[_0x8e74('0x3c')](_0x8e74('0x5a'));}break;default:_0x53bc28[_0x8e74('0x3c')]('\x22'+_0x53b79f+'\x22');}}else{switch(_0x13ddde){case _0x8e74('0x5b'):case _0x8e74('0x10'):_0x50108b[_0x8e74('0x3c')](_0x13ddde+_0x8e74('0x5c'));break;default:_0x53bc28[_0x8e74('0x3c')]('\x22\x22');}}}}if(_0x50108b[_0x8e74('0x4d')]){handleError(_0x3e39b4['data'][_0x1015a8],{'code':_0x8e74('0x5d'),'message':_0x50108b['join']()});}else{fs[_0x8e74('0x5e')](_0x29e9d1,_0x53bc28['join']()+'\x0a');}_0x53bc28=[];}if(!(stats[_0x8e74('0x4e')]%0xc8)){socket[_0x8e74('0x5f')](_0x8e74('0x60')+_0x1fb9f5,stats);stats[_0x8e74('0x3b')]=[];}}if(stopped){logger[_0x8e74('0x36')](_0x8e74('0x61'));_0x4b83c8['abort']();}}catch(_0x2442c5){handleError(_0x3e39b4[_0x8e74('0x4c')][_0x1015a8],{'code':_0x8e74('0x62'),'message':_0x2442c5[_0x8e74('0x39')]});logger['error'](_0x8e74('0x63'),_0x2442c5[_0x8e74('0x39')]);}},'complete':function(){try{var _0x2876bf=[];var _0x6b28fe='cm_contacts';if(_0x2dd46e[_0x8e74('0x64')]&&_0x2dd46e[_0x8e74('0x64')][_0x8e74('0x4d')]){_0x6b28fe='cm_contacts_'+_0x1fb9f5;_0x2876bf['push'](_0x8e74('0x65')+_0x6b28fe+_0x8e74('0x66'));}var _0x51ff78=util['format'](_0x8e74('0x67'),_0x29e9d1,_0x6b28fe,_0x38fc85,_0x2dd46e[_0x8e74('0x20')],_0x2dd46e[_0x8e74('0x31')]||null,NOW,NOW);if(_['isNil'](_0x508902[_0x8e74('0x1f')])){_0x51ff78+=_0x8e74('0x68');}_0x2876bf['push'](_0x51ff78);if(_0x2dd46e[_0x8e74('0x64')]&&_0x2dd46e['duplicates'][_0x8e74('0x4d')]){_0x2876bf[_0x8e74('0x3c')](insertCmContact(_0x2dd46e['ListId'],_0x6b28fe,_0x2dd46e['duplicates'],_0x508902));_0x2876bf['push']('DROP\x20TABLE\x20'+_0x6b28fe+';');}_0x2876bf['push'](insertCmHopper(_0x2dd46e['ListId'],_0x8e74('0x69'),_0x8e74('0x6a'),_0x8e74('0x6b'),_0x2c2d08));_0x2876bf['push'](insertCmHopperBlack(_0x2dd46e['ListId'],'voice_queues_has_cm_blacklists',_0x8e74('0x6a'),_0x8e74('0x6b')));_0x2876bf[_0x8e74('0x3c')](insertCmHopper(_0x2dd46e['ListId'],_0x8e74('0x6c'),_0x8e74('0x6d'),_0x8e74('0x6e'),_0x2c2d08));_0x2876bf[_0x8e74('0x3c')](insertCmHopperBlack(_0x2dd46e[_0x8e74('0x20')],_0x8e74('0x6f'),_0x8e74('0x6d'),'CampaignId'));BPromise['each'](_0x2876bf,handleQuery)['then'](function(_0x1f4285){stats[_0x8e74('0x70')]=!![];stats['affectedRows']=_0x2dd46e[_0x8e74('0x64')]&&_0x2dd46e[_0x8e74('0x64')][_0x8e74('0x4d')]?results[0x2][_0x8e74('0x71')]:results[0x0][_0x8e74('0x71')];socket[_0x8e74('0x5f')](_0x8e74('0x60')+_0x1fb9f5,stats);fs[_0x8e74('0x72')](_0x46333b);fs[_0x8e74('0x72')](_0x29e9d1);process[_0x8e74('0x3a')](0x0);})[_0x8e74('0x41')](function(_0x142f62){logger['error'](_0x142f62[_0x8e74('0x39')]);process['exit'](0x1);});}catch(_0x21f510){logger[_0x8e74('0x38')](_0x8e74('0x73'),_0x21f510[_0x8e74('0x39')]);process[_0x8e74('0x3a')](0x1);}},'error':function(_0x26f45d,_0x47fce0,_0x19f803,_0x1d215d){throw new Error(_0x1d215d);}});}function validate(){if(process[_0x8e74('0x74')]&&process[_0x8e74('0x74')][_0x8e74('0x4d')]<0x4){throw new Error(_0x8e74('0x75'));}var _0x136637=path[_0x8e74('0x15')](config['root'],_0x8e74('0x47'),process[_0x8e74('0x74')][0x2]);if(!fs[_0x8e74('0x76')](_0x136637)){throw new Error(_0x8e74('0x77'));}var _0x325870={};try{_0x325870=JSON[_0x8e74('0x4b')](process['argv'][0x3]);if(!_0x325870[_0x8e74('0x78')]){throw new Error(_0x8e74('0x79'));}if(!_0x325870[_0x8e74('0x78')][_0x8e74('0x10')]){throw new Error(_0x8e74('0x7a'));}if(!_0x325870[_0x8e74('0x78')][_0x8e74('0x5b')]){throw new Error('firstName\x20is\x20mandatory');}var _0x44924c=0x0;if(_0x325870[_0x8e74('0x78')][_0x8e74('0x23')]){_0x44924c=0x1;}if(!_0x325870['ListId']){throw new Error(_0x8e74('0x7b'));}}catch(_0x27b43e){throw new Error(_0x8e74('0x7c'));}var _0x1b4f3d=[];try{_0x1b4f3d=_[_0x8e74('0x7d')](JSON[_0x8e74('0x4b')](process['argv'][0x4]),'id');}catch(_0x4ca771){logger[_0x8e74('0x36')](_0x8e74('0x7e'));}main(_0x136637,_0x325870,_0x1b4f3d,_0x44924c);}validate();process['on']('SIGINT',handleStop);process['on'](_0x8e74('0x7f'),handleUncaughtException); \ No newline at end of file +var _0x341b=['existsSync','file\x20doesn\x27t\x20exists','binding\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','firstName','firstName\x20is\x20mandatory','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','SIGINT','uncaughtException','path','lodash','papaparse','util','bluebird','moment','squel','../../../mysqldb','../../../config/environment','../../../config/logger','redis','defaults','localhost','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','test','select','field','join','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.priority','insert','into','cm_hopper','fromQuery','scheduledat','priority','UserId','recallme','fields','from','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId','.id\x20=\x20','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','\x22onlyIfOpen\x22','cm_contacts.id','cm_contacts.ListId','cm_hopper_black','phone','ContactId','createdAt','updatedAt','\x20=\x20?','toString','concat','ListId','CompanyId','ListId\x20=\x20?','id\x20IN\x20?','MIN(id)','min_id','group','info','Received\x20SIGINT','error','code','message','sequelize','query','push','catch','main','stringify','send','start','binding','socket_timestamp','root','server/files/tmp','.csv','keys','writeFileSync','parse','rows','data','replace','isNaN','agent\x20not\x20exists','email','email\x20wrong\x20format','dateOfBirth','YYYY-MM-DD','isValid','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','\x20not\x20specified','length','appendFileSync','contact:import:','Abort\x20parser','step','duplicates','CREATE\x20TABLE\x20','LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27','isNil',',\x20scheduledAt\x20=\x20NOW()','DROP\x20TABLE\x20','VoiceQueueId','voice_queues_has_cm_blacklists','campaigns','CampaignId','campaigns_has_cm_blacklists','then','finish','affectedRows','emit','unlink','exit','argv','arguments\x20\x20\x20'];(function(_0x82129b,_0x484ae9){var _0x2ae5dc=function(_0x299e34){while(--_0x299e34){_0x82129b['push'](_0x82129b['shift']());}};_0x2ae5dc(++_0x484ae9);}(_0x341b,0x8f));var _0xb341=function(_0x4f66a2,_0x141b52){_0x4f66a2=_0x4f66a2-0x0;var _0x294b9b=_0x341b[_0x4f66a2];return _0x294b9b;};'use strict';var fs=require('fs');var path=require(_0xb341('0x0'));var _=require(_0xb341('0x1'));var Papa=require(_0xb341('0x2'));var util=require(_0xb341('0x3'));var BPromise=require(_0xb341('0x4'));var moment=require(_0xb341('0x5'));var squel=require(_0xb341('0x6'));var Redis=require('ioredis');var db=require(_0xb341('0x7'))['db'];var config=require(_0xb341('0x8'));var logger=require(_0xb341('0x9'))('import');config[_0xb341('0xa')]=_[_0xb341('0xb')](config[_0xb341('0xa')],{'host':_0xb341('0xc'),'port':0x18eb});var socket=require(_0xb341('0xd'))(new Redis(config[_0xb341('0xa')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var NOW=moment()[_0xb341('0xe')](_0xb341('0xf'));function isEmail(_0x86f3c2){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))*$/[_0xb341('0x10')](_0x86f3c2);}function selectNotIn(_0xcbb36c,_0x44df90,_0x2a9867,_0x1c8995,_0x599319){return squel[_0xb341('0x11')]()[_0xb341('0x12')]('phone')['from'](_0x1c8995)[_0xb341('0x13')](_0x44df90,null,_0x44df90+'.id\x20=\x20'+_0x1c8995+'.'+_0x2a9867)[_0xb341('0x14')](_0x1c8995+'.'+_0x2a9867+_0xb341('0x15')+_0xcbb36c+'.'+_0x2a9867)['where'](_0x44df90+_0xb341('0x16')+_0x599319[_0xb341('0x13')]()+')');}function insertCmHopper(_0x256e8c,_0x357195,_0x3c5fb7,_0x37cc24,_0xdf79b8){var _0x1e8132=[_0xb341('0x17'),_0xb341('0x18'),'cm_contacts.id','cm_contacts.ListId',_0x357195+'.'+_0x37cc24,_0xb341('0x19'),_0xb341('0x1a'),_0xb341('0x1b'),'cm_contacts.UserId','\x22'+_0xdf79b8+'\x22'];return squel[_0xb341('0x1c')]()[_0xb341('0x1d')](_0xb341('0x1e'))[_0xb341('0x1f')](['phone',_0xb341('0x20'),'ContactId','ListId',_0x37cc24,'createdAt','updatedAt',_0xb341('0x21'),_0xb341('0x22'),_0xb341('0x23')],squel['select']()[_0xb341('0x24')](_0x1e8132)[_0xb341('0x25')](_0x357195)[_0xb341('0x13')](_0xb341('0x26'),null,_0xb341('0x27')+_0x357195+_0xb341('0x28'))[_0xb341('0x13')](_0x3c5fb7,null,_0x3c5fb7+_0xb341('0x29')+_0x357195+'.'+_0x37cc24)[_0xb341('0x14')](_0x357195+_0xb341('0x2a'),_0x256e8c)['where'](_0xb341('0x2b'),NOW)[_0xb341('0x14')](_0xb341('0x2c'),selectNotIn(_0x357195,_0x3c5fb7,_0x37cc24,'cm_hopper',[_0xb341('0x2d'),_0xb341('0x2e')]))['where'](_0xb341('0x2c'),selectNotIn(_0x357195,_0x3c5fb7,_0x37cc24,'cm_hopper',[_0xb341('0x2d')])))['toString']();}function insertCmHopperBlack(_0x535b05,_0x3ab3b5,_0x4243af,_0x5d9f0b){var _0x321203=['cm_contacts.phone',_0xb341('0x2f'),_0xb341('0x30'),_0x3ab3b5+'.'+_0x5d9f0b,_0xb341('0x19'),_0xb341('0x1a')];return squel['insert']()[_0xb341('0x1d')](_0xb341('0x31'))[_0xb341('0x1f')]([_0xb341('0x32'),_0xb341('0x33'),'ListId',_0x5d9f0b,_0xb341('0x34'),_0xb341('0x35')],squel[_0xb341('0x11')]()['fields'](_0x321203)['from'](_0x3ab3b5)[_0xb341('0x13')](_0xb341('0x26'),null,'cm_contacts.ListId\x20=\x20'+_0x3ab3b5+_0xb341('0x28'))[_0xb341('0x13')](_0x4243af,null,_0x4243af+_0xb341('0x29')+_0x3ab3b5+'.'+_0x5d9f0b)[_0xb341('0x14')](_0x3ab3b5+_0xb341('0x2a'),_0x535b05)[_0xb341('0x14')](_0xb341('0x2b'),NOW)[_0xb341('0x14')](_0xb341('0x2c'),squel[_0xb341('0x11')]()[_0xb341('0x12')](_0xb341('0x32'))[_0xb341('0x25')](_0xb341('0x31'))[_0xb341('0x14')]('ListId\x20=\x20?',_0x535b05)['where'](_0x5d9f0b+_0xb341('0x36'),_0x3ab3b5+'.'+_0x5d9f0b)))[_0xb341('0x37')]();}function insertCmContact(_0x2934be,_0x4b1b2e,_0x396226,_0x247d38){var _0x10399a=_[_0xb341('0x38')](_['keys'](_0x247d38),[_0xb341('0x39'),_0xb341('0x3a'),_0xb341('0x34'),'updatedAt']);return squel[_0xb341('0x1c')]()[_0xb341('0x1d')](_0xb341('0x26'))[_0xb341('0x1f')](_0x10399a,squel['select']()[_0xb341('0x24')](_0x10399a)[_0xb341('0x25')](_0x4b1b2e)[_0xb341('0x14')]('('+_0x396226['join'](',')+')\x20NOT\x20IN\x20?',squel['select']()[_0xb341('0x24')](_0x396226)[_0xb341('0x25')](_0xb341('0x26'))[_0xb341('0x14')](_0xb341('0x3b'),_0x2934be))[_0xb341('0x14')](_0xb341('0x3c'),squel[_0xb341('0x11')]()['field'](_0xb341('0x3d'),_0xb341('0x3e'))[_0xb341('0x25')](_0x4b1b2e)[_0xb341('0x3f')](_0x396226['join'](','))))[_0xb341('0x37')]();}function handleStop(){logger[_0xb341('0x40')](_0xb341('0x41'));stopped=!![];}function handleUncaughtException(_0x2c2203){logger[_0xb341('0x42')](_0x2c2203['message']);process['exit'](0x1);}function handleError(_0x4128fc,_0x68fe4){stats['errors']['push']({'name':_0x68fe4[_0xb341('0x43')],'message':_0x68fe4[_0xb341('0x44')],'row':_0x4128fc});}function handleQuery(_0x6200f7){logger[_0xb341('0x40')](_0x6200f7);return db[_0xb341('0x45')][_0xb341('0x46')](_0x6200f7)['spread'](function(_0x280070){results[_0xb341('0x47')](_0x280070);})[_0xb341('0x48')](function(_0x439ce9){logger[_0xb341('0x42')](_0x439ce9['message']);});}function main(_0x40a042,_0x38ca82,_0x53112a,_0x5213d8){logger[_0xb341('0x40')](_0xb341('0x49'),_0x40a042,JSON[_0xb341('0x4a')](_0x38ca82));process[_0xb341('0x4b')](_0xb341('0x4c'));var _0xb2176a=_0x38ca82[_0xb341('0x4d')];var _0x51e978=_0x38ca82[_0xb341('0x4e')];var _0x1649ad=path['join'](config[_0xb341('0x4f')],_0xb341('0x50'),_0x51e978+_0xb341('0x51'));var _0x2b841a=_[_0xb341('0x52')](_0xb2176a)[_0xb341('0x13')]();logger['info']('header',_0x2b841a);fs[_0xb341('0x53')](_0x1649ad,_0x2b841a+'\x0a');Papa[_0xb341('0x54')](fs['createReadStream'](_0x40a042),{'header':!![],'skipEmptyLines':!![],'step':function(_0x9a7965,_0x11d6f0){try{for(var _0x4a26f5=0x0,_0x1a2619=[];_0x4a26f5<_0x9a7965['data']['length'];_0x4a26f5++){stats[_0xb341('0x55')]+=0x1;if(_0x9a7965['errors'][_0x4a26f5]){handleError(_0x9a7965[_0xb341('0x56')][_0x4a26f5],_0x9a7965['errors'][_0x4a26f5]);}else{var _0x4e62b9=[];for(var _0xdc17a in _0xb2176a){if(_0xb2176a['hasOwnProperty'](_0xdc17a)){if(_0x9a7965[_0xb341('0x56')][_0x4a26f5][_0xb2176a[_0xdc17a]]){var _0x52bba9=_['trim'](_0x9a7965['data'][_0x4a26f5][_0xb2176a[_0xdc17a]][_0xb341('0x57')](/"/g,'\x27'));switch(_0xdc17a){case _0xb341('0x20'):var _0x50c6b2=moment(_0x52bba9,_0xb341('0xf'),!![]);if(_0x50c6b2['isValid']()){_0x1a2619[_0xb341('0x47')]('\x22'+_0x52bba9+'\x22');}else{_0x4e62b9[_0xb341('0x47')]('scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)');}break;case'priority':var _0x2e4c21=parseInt(_0x52bba9);_0x52bba9=_[_0xb341('0x58')](_0x2e4c21)||_0x2e4c21<0x0||_0x2e4c21>0x4?_0x5213d8?0x3:0x2:_0x2e4c21;_0x1a2619['push']('\x22'+_0x52bba9+'\x22');break;case _0xb341('0x22'):var _0x5eddaa=parseInt(_0x52bba9);if(_['isNumber'](_0x5eddaa)&&_['includes'](_0x53112a,_0x5eddaa)){_0x1a2619['push']('\x22'+_0x5eddaa+'\x22');}else{_0x4e62b9[_0xb341('0x47')](_0xb341('0x59'));}break;case _0xb341('0x5a'):if(isEmail(_0x52bba9)){_0x1a2619['push']('\x22'+_0x52bba9+'\x22');}else{_0x4e62b9[_0xb341('0x47')](_0xb341('0x5b'));}break;case _0xb341('0x5c'):var _0x540bab=moment(_0x52bba9,_0xb341('0x5d'),!![]);if(_0x540bab[_0xb341('0x5e')]()){_0x1a2619[_0xb341('0x47')]('\x22'+_0x52bba9+'\x22');}else{_0x4e62b9[_0xb341('0x47')](_0xb341('0x5f'));}break;default:_0x1a2619[_0xb341('0x47')]('\x22'+_0x52bba9+'\x22');}}else{switch(_0xdc17a){case'firstName':case _0xb341('0x32'):_0x4e62b9[_0xb341('0x47')](_0xdc17a+_0xb341('0x60'));break;default:_0x1a2619[_0xb341('0x47')]('\x22\x22');}}}}if(_0x4e62b9[_0xb341('0x61')]){handleError(_0x9a7965[_0xb341('0x56')][_0x4a26f5],{'code':'SystemRow','message':_0x4e62b9[_0xb341('0x13')]()});}else{fs[_0xb341('0x62')](_0x1649ad,_0x1a2619['join']()+'\x0a');}_0x1a2619=[];}if(!(stats[_0xb341('0x55')]%0xc8)){socket['emit'](_0xb341('0x63')+_0x51e978,stats);stats['errors']=[];}}if(stopped){logger[_0xb341('0x40')](_0xb341('0x64'));_0x11d6f0['abort']();}}catch(_0x5eace1){handleError(_0x9a7965[_0xb341('0x56')][_0x4a26f5],{'code':'SystemError','message':_0x5eace1['message']});logger[_0xb341('0x42')](_0xb341('0x65'),_0x5eace1['message']);}},'complete':function(){try{var _0x4b0776=[];var _0x328baa=_0xb341('0x26');if(_0x38ca82['duplicates']&&_0x38ca82[_0xb341('0x66')][_0xb341('0x61')]){_0x328baa='cm_contacts_'+_0x51e978;_0x4b0776[_0xb341('0x47')](_0xb341('0x67')+_0x328baa+'\x20LIKE\x20cm_contacts;');}var _0xdb6069=util[_0xb341('0xe')](_0xb341('0x68'),_0x1649ad,_0x328baa,_0x2b841a,_0x38ca82['ListId'],_0x38ca82[_0xb341('0x3a')]||null,NOW,NOW);if(_[_0xb341('0x69')](_0xb2176a[_0xb341('0x20')])){_0xdb6069+=_0xb341('0x6a');}_0x4b0776['push'](_0xdb6069);if(_0x38ca82[_0xb341('0x66')]&&_0x38ca82[_0xb341('0x66')][_0xb341('0x61')]){_0x4b0776[_0xb341('0x47')](insertCmContact(_0x38ca82[_0xb341('0x39')],_0x328baa,_0x38ca82[_0xb341('0x66')],_0xb2176a));_0x4b0776[_0xb341('0x47')](_0xb341('0x6b')+_0x328baa+';');}_0x4b0776[_0xb341('0x47')](insertCmHopper(_0x38ca82['ListId'],'voice_queues_has_cm_lists','voice_queues',_0xb341('0x6c'),_0x5213d8));_0x4b0776[_0xb341('0x47')](insertCmHopperBlack(_0x38ca82[_0xb341('0x39')],_0xb341('0x6d'),'voice_queues',_0xb341('0x6c')));_0x4b0776[_0xb341('0x47')](insertCmHopper(_0x38ca82['ListId'],'campaigns_has_cm_lists',_0xb341('0x6e'),_0xb341('0x6f'),_0x5213d8));_0x4b0776[_0xb341('0x47')](insertCmHopperBlack(_0x38ca82['ListId'],_0xb341('0x70'),'campaigns','CampaignId'));BPromise['each'](_0x4b0776,handleQuery)[_0xb341('0x71')](function(_0x5778e5){stats[_0xb341('0x72')]=!![];stats[_0xb341('0x73')]=_0x38ca82[_0xb341('0x66')]&&_0x38ca82['duplicates']['length']?results[0x2][_0xb341('0x73')]:results[0x0][_0xb341('0x73')];socket[_0xb341('0x74')](_0xb341('0x63')+_0x51e978,stats);fs[_0xb341('0x75')](_0x40a042);fs['unlink'](_0x1649ad);process[_0xb341('0x76')](0x0);})[_0xb341('0x48')](function(_0x3b8d7f){logger[_0xb341('0x42')](_0x3b8d7f['message']);process[_0xb341('0x76')](0x1);});}catch(_0x2a75ae){logger[_0xb341('0x42')]('complete',_0x2a75ae[_0xb341('0x44')]);process['exit'](0x1);}},'error':function(_0x53aee7,_0x46b406,_0x2da34d,_0x4674f2){throw new Error(_0x4674f2);}});}function validate(){if(process['argv']&&process[_0xb341('0x77')][_0xb341('0x61')]<0x4){throw new Error(_0xb341('0x78'));}var _0x16f084=path[_0xb341('0x13')](config[_0xb341('0x4f')],'server/files/tmp',process[_0xb341('0x77')][0x2]);if(!fs[_0xb341('0x79')](_0x16f084)){throw new Error(_0xb341('0x7a'));}var _0x1e11a9={};try{_0x1e11a9=JSON[_0xb341('0x54')](process[_0xb341('0x77')][0x3]);if(!_0x1e11a9[_0xb341('0x4d')]){throw new Error(_0xb341('0x7b'));}if(!_0x1e11a9[_0xb341('0x4d')][_0xb341('0x32')]){throw new Error(_0xb341('0x7c'));}if(!_0x1e11a9[_0xb341('0x4d')][_0xb341('0x7d')]){throw new Error(_0xb341('0x7e'));}var _0x136360=0x0;if(_0x1e11a9[_0xb341('0x4d')][_0xb341('0x22')]){_0x136360=0x1;}if(!_0x1e11a9[_0xb341('0x39')]){throw new Error(_0xb341('0x7f'));}}catch(_0x2bde77){throw new Error(_0xb341('0x80'));}var _0x4c5ec6=[];try{_0x4c5ec6=_[_0xb341('0x81')](JSON[_0xb341('0x54')](process[_0xb341('0x77')][0x4]),'id');}catch(_0x1ecd5e){logger[_0xb341('0x40')]('No\x20agent\x20available');}main(_0x16f084,_0x1e11a9,_0x4c5ec6,_0x136360);}validate();process['on'](_0xb341('0x82'),handleStop);process['on'](_0xb341('0x83'),handleUncaughtException); \ No newline at end of file diff --git a/server/components/integrations/configuration.js b/server/components/integrations/configuration.js index b79ae33..1005a63 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 _0xbfcc=['endtime','duration','Billable\x20Time','billableseconds','getSubjects','string','[xCALLY\x20Ticket]','toLowerCase','variable','queue','outbound','push','Outbound\x20Call','destcalleridnum','getDescriptions','voice','inbound','***\x20Call\x20Info\x20***','Caller\x20Number','calleridnum','Caller\x20Name','calleridname','keyValue','Call\x20To','destexten','Queue','UniqueId','uniqueid','agentcalledAt','destcalleridname','Agent\x20Number','***\x20Time\x20Info\x20***','Agent\x20Complete','agentcompleteAt','Talk\x20Time','talktime','Called\x20Number','Member\x20Name','membername','Date','starttime','answertime','Complete\x20Time'];(function(_0x492221,_0x9e2521){var _0x398bf9=function(_0x303c5b){while(--_0x303c5b){_0x492221['push'](_0x492221['shift']());}};_0x398bf9(++_0x9e2521);}(_0xbfcc,0x1dd));var _0xcbfc=function(_0x1bbc08,_0x444008){_0x1bbc08=_0x1bbc08-0x0;var _0x5d825b=_0xbfcc[_0x1bbc08];return _0x5d825b;};'use strict';exports[_0xcbfc('0x0')]=function(_0x5d52c4,_0x5c0fe4){var _0x1a2fe0=[{'type':_0xcbfc('0x1'),'content':_0xcbfc('0x2'),'variableName':null}];switch(_0x5d52c4[_0xcbfc('0x3')]()){case'voice':switch(_0x5c0fe4['toLowerCase']()){case'inbound':_0x1a2fe0['push']({'type':_0xcbfc('0x4'),'content':'','variableName':_0xcbfc('0x5')});_0x1a2fe0['push']({'type':_0xcbfc('0x4'),'content':'','variableName':'calleridnum'});break;case _0xcbfc('0x6'):_0x1a2fe0[_0xcbfc('0x7')]({'type':_0xcbfc('0x1'),'content':_0xcbfc('0x8'),'variableName':null});_0x1a2fe0['push']({'type':_0xcbfc('0x4'),'content':'','variableName':_0xcbfc('0x9')});break;}}return _0x1a2fe0;};exports[_0xcbfc('0xa')]=function(_0x25786f,_0x20c7c6){var _0x3498c7=[];switch(_0x25786f['toLowerCase']()){case _0xcbfc('0xb'):switch(_0x20c7c6[_0xcbfc('0x3')]()){case _0xcbfc('0xc'):_0x3498c7=[{'type':_0xcbfc('0x1'),'content':_0xcbfc('0xd'),'key':null,'keyType':null,'variableName':null},{'type':'keyValue','content':'','key':_0xcbfc('0xe'),'keyType':_0xcbfc('0x4'),'variableName':_0xcbfc('0xf')},{'type':'keyValue','content':'','key':_0xcbfc('0x10'),'keyType':_0xcbfc('0x4'),'variableName':_0xcbfc('0x11')},{'type':_0xcbfc('0x12'),'content':'','key':_0xcbfc('0x13'),'keyType':'variable','variableName':_0xcbfc('0x14')},{'type':_0xcbfc('0x12'),'content':'','key':_0xcbfc('0x15'),'keyType':_0xcbfc('0x4'),'variableName':'queue'},{'type':'keyValue','content':'','key':_0xcbfc('0x16'),'keyType':_0xcbfc('0x4'),'variableName':_0xcbfc('0x17')},{'type':'keyValue','content':'','key':'Date','keyType':_0xcbfc('0x4'),'variableName':_0xcbfc('0x18')},{'type':_0xcbfc('0x1'),'content':'***\x20Agent\x20Info\x20***','key':null,'keyType':null,'variableName':null},{'type':_0xcbfc('0x12'),'content':'','key':'Agent\x20Name','keyType':_0xcbfc('0x4'),'variableName':_0xcbfc('0x19')},{'type':_0xcbfc('0x12'),'content':'','key':_0xcbfc('0x1a'),'keyType':_0xcbfc('0x4'),'variableName':_0xcbfc('0x9')},{'type':'string','content':_0xcbfc('0x1b'),'key':null,'keyType':null,'variableName':null},{'type':_0xcbfc('0x12'),'content':'','key':'Agent\x20Ring','keyType':_0xcbfc('0x4'),'variableName':'agentcalledAt'},{'type':'keyValue','content':'','key':'Agent\x20Connect','keyType':_0xcbfc('0x4'),'variableName':'agentconnectAt'},{'type':'keyValue','content':'','key':_0xcbfc('0x1c'),'keyType':_0xcbfc('0x4'),'variableName':_0xcbfc('0x1d')},{'type':_0xcbfc('0x12'),'content':'','key':'Hold\x20Time','keyType':_0xcbfc('0x4'),'variableName':'holdtime'},{'type':_0xcbfc('0x12'),'content':'','key':_0xcbfc('0x1e'),'keyType':'variable','variableName':_0xcbfc('0x1f')}];break;case _0xcbfc('0x6'):_0x3498c7=[{'type':'string','content':_0xcbfc('0xd'),'variableName':null},{'type':_0xcbfc('0x12'),'content':'','key':_0xcbfc('0x20'),'keyType':_0xcbfc('0x4'),'keyContent':'','variableName':'destcalleridnum'},{'type':_0xcbfc('0x12'),'content':'','key':_0xcbfc('0x21'),'keyType':'variable','keyContent':'','variableName':_0xcbfc('0x22')},{'type':_0xcbfc('0x12'),'content':'','key':_0xcbfc('0x16'),'keyType':_0xcbfc('0x4'),'keyContent':'','variableName':_0xcbfc('0x17')},{'type':_0xcbfc('0x12'),'content':'','key':_0xcbfc('0x23'),'keyType':'variable','keyContent':'','variableName':_0xcbfc('0x24')},{'type':_0xcbfc('0x1'),'content':_0xcbfc('0x1b')},{'type':_0xcbfc('0x12'),'content':'','key':'Answer\x20Time','keyType':_0xcbfc('0x4'),'keyContent':'','variableName':_0xcbfc('0x25')},{'type':_0xcbfc('0x12'),'content':'','key':_0xcbfc('0x26'),'keyType':_0xcbfc('0x4'),'keyContent':'','variableName':_0xcbfc('0x27')},{'type':_0xcbfc('0x12'),'content':'','key':'Duration','keyType':_0xcbfc('0x4'),'keyContent':'','variableName':_0xcbfc('0x28')},{'type':'keyValue','content':'','key':_0xcbfc('0x29'),'keyType':_0xcbfc('0x4'),'keyContent':'','variableName':_0xcbfc('0x2a')}];break;}}return _0x3498c7;}; \ No newline at end of file +var _0x9861=['***\x20Call\x20Info\x20***','keyValue','Caller\x20Number','Caller\x20Name','calleridname','destexten','UniqueId','uniqueid','Date','agentcalledAt','***\x20Agent\x20Info\x20***','Agent\x20Name','destcalleridname','Agent\x20Ring','Agent\x20Connect','Agent\x20Complete','agentcompleteAt','Talk\x20Time','talktime','Called\x20Number','Member\x20Name','membername','starttime','***\x20Time\x20Info\x20***','Answer\x20Time','answertime','Complete\x20Time','endtime','duration','Billable\x20Time','getSubjects','string','[xCALLY\x20Ticket]','toLowerCase','voice','push','variable','queue','calleridnum','outbound','Outbound\x20Call','destcalleridnum','getDescriptions'];(function(_0x452aad,_0x170d79){var _0x12f44f=function(_0x35aa99){while(--_0x35aa99){_0x452aad['push'](_0x452aad['shift']());}};_0x12f44f(++_0x170d79);}(_0x9861,0x176));var _0x1986=function(_0x3f1e85,_0x410ed7){_0x3f1e85=_0x3f1e85-0x0;var _0x4a95ef=_0x9861[_0x3f1e85];return _0x4a95ef;};'use strict';exports[_0x1986('0x0')]=function(_0x5474b4,_0x5071b2){var _0x3989f2=[{'type':_0x1986('0x1'),'content':_0x1986('0x2'),'variableName':null}];switch(_0x5474b4[_0x1986('0x3')]()){case _0x1986('0x4'):switch(_0x5071b2[_0x1986('0x3')]()){case'inbound':_0x3989f2[_0x1986('0x5')]({'type':_0x1986('0x6'),'content':'','variableName':_0x1986('0x7')});_0x3989f2[_0x1986('0x5')]({'type':_0x1986('0x6'),'content':'','variableName':_0x1986('0x8')});break;case _0x1986('0x9'):_0x3989f2[_0x1986('0x5')]({'type':_0x1986('0x1'),'content':_0x1986('0xa'),'variableName':null});_0x3989f2['push']({'type':_0x1986('0x6'),'content':'','variableName':_0x1986('0xb')});break;}}return _0x3989f2;};exports[_0x1986('0xc')]=function(_0xb0e57b,_0x47ab59){var _0x3ef718=[];switch(_0xb0e57b[_0x1986('0x3')]()){case'voice':switch(_0x47ab59[_0x1986('0x3')]()){case'inbound':_0x3ef718=[{'type':'string','content':_0x1986('0xd'),'key':null,'keyType':null,'variableName':null},{'type':_0x1986('0xe'),'content':'','key':_0x1986('0xf'),'keyType':_0x1986('0x6'),'variableName':_0x1986('0x8')},{'type':_0x1986('0xe'),'content':'','key':_0x1986('0x10'),'keyType':_0x1986('0x6'),'variableName':_0x1986('0x11')},{'type':_0x1986('0xe'),'content':'','key':'Call\x20To','keyType':'variable','variableName':_0x1986('0x12')},{'type':_0x1986('0xe'),'content':'','key':'Queue','keyType':_0x1986('0x6'),'variableName':_0x1986('0x7')},{'type':_0x1986('0xe'),'content':'','key':_0x1986('0x13'),'keyType':_0x1986('0x6'),'variableName':_0x1986('0x14')},{'type':_0x1986('0xe'),'content':'','key':_0x1986('0x15'),'keyType':_0x1986('0x6'),'variableName':_0x1986('0x16')},{'type':_0x1986('0x1'),'content':_0x1986('0x17'),'key':null,'keyType':null,'variableName':null},{'type':_0x1986('0xe'),'content':'','key':_0x1986('0x18'),'keyType':'variable','variableName':_0x1986('0x19')},{'type':_0x1986('0xe'),'content':'','key':'Agent\x20Number','keyType':_0x1986('0x6'),'variableName':_0x1986('0xb')},{'type':'string','content':'***\x20Time\x20Info\x20***','key':null,'keyType':null,'variableName':null},{'type':_0x1986('0xe'),'content':'','key':_0x1986('0x1a'),'keyType':_0x1986('0x6'),'variableName':'agentcalledAt'},{'type':_0x1986('0xe'),'content':'','key':_0x1986('0x1b'),'keyType':_0x1986('0x6'),'variableName':'agentconnectAt'},{'type':_0x1986('0xe'),'content':'','key':_0x1986('0x1c'),'keyType':_0x1986('0x6'),'variableName':_0x1986('0x1d')},{'type':_0x1986('0xe'),'content':'','key':'Hold\x20Time','keyType':_0x1986('0x6'),'variableName':'holdtime'},{'type':_0x1986('0xe'),'content':'','key':_0x1986('0x1e'),'keyType':'variable','variableName':_0x1986('0x1f')}];break;case _0x1986('0x9'):_0x3ef718=[{'type':_0x1986('0x1'),'content':'***\x20Call\x20Info\x20***','variableName':null},{'type':'keyValue','content':'','key':_0x1986('0x20'),'keyType':_0x1986('0x6'),'keyContent':'','variableName':'destcalleridnum'},{'type':_0x1986('0xe'),'content':'','key':_0x1986('0x21'),'keyType':_0x1986('0x6'),'keyContent':'','variableName':_0x1986('0x22')},{'type':'keyValue','content':'','key':_0x1986('0x13'),'keyType':_0x1986('0x6'),'keyContent':'','variableName':_0x1986('0x14')},{'type':'keyValue','content':'','key':_0x1986('0x15'),'keyType':_0x1986('0x6'),'keyContent':'','variableName':_0x1986('0x23')},{'type':_0x1986('0x1'),'content':_0x1986('0x24')},{'type':_0x1986('0xe'),'content':'','key':_0x1986('0x25'),'keyType':'variable','keyContent':'','variableName':_0x1986('0x26')},{'type':_0x1986('0xe'),'content':'','key':_0x1986('0x27'),'keyType':'variable','keyContent':'','variableName':_0x1986('0x28')},{'type':_0x1986('0xe'),'content':'','key':'Duration','keyType':'variable','keyContent':'','variableName':_0x1986('0x29')},{'type':_0x1986('0xe'),'content':'','key':_0x1986('0x2a'),'keyType':_0x1986('0x6'),'keyContent':'','variableName':'billableseconds'}];break;}}return _0x3ef718;}; \ No newline at end of file diff --git a/server/components/interaction/service.js b/server/components/interaction/service.js index d84fe91..830eff9 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 _0x06ff=['upperFirst','InteractionId','unknown','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','role','stringify','null','Interaction','findOne','then','update','info','catch','error','query','body','omit','html','phone','fax','mobile','../../config/logger','mail-interactions','sms-interactions','chat-interactions'];(function(_0x57a628,_0x26001a){var _0x22e23f=function(_0x43fc04){while(--_0x43fc04){_0x57a628['push'](_0x57a628['shift']());}};_0x22e23f(++_0x26001a);}(_0x06ff,0xd4));var _0xf06f=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0x06ff[_0x199572];return _0x13cfa3;};'use strict';var _=require('lodash');var db=require('../../mysqldb')['db'];var loggers={'openchannel':require(_0xf06f('0x0'))('openchannel-interactions'),'mail':require(_0xf06f('0x0'))(_0xf06f('0x1')),'fax':require(_0xf06f('0x0'))('fax-interactions'),'sms':require(_0xf06f('0x0'))(_0xf06f('0x2')),'chat':require(_0xf06f('0x0'))(_0xf06f('0x3'))};function getInteractionId(_0x2df017,_0x44616c,_0x488440){if(_0x2df017&&_0x2df017[_[_0xf06f('0x4')](_0x488440)+_0xf06f('0x5')]){return _0x2df017[_[_0xf06f('0x4')](_0x488440)+_0xf06f('0x5')];}else if(_0x2df017&&_0x2df017['id']){return _0x2df017['id'];}else if(_0x44616c&&_0x44616c['id']){return _0x44616c['id'];}else{return _0xf06f('0x6');}}function log(_0x111d64,_0x390c31,_0x3dab8e,_0x323913,_0x17b11a,_0x338b34){loggers[_0x17b11a[_0xf06f('0x7')]()][_0x111d64](_0xf06f('0x8'),_0x338b34[_0xf06f('0x9')](),_0x390c31?_0x390c31['id']:null,_0x390c31?_0x390c31['name']:null,_0x390c31?_0x390c31[_0xf06f('0xa')]:null,getInteractionId(_0x3dab8e,_0x323913,_0x17b11a),_0x3dab8e?JSON[_0xf06f('0xb')](_0x3dab8e):_0xf06f('0xc'));}function updateUser(_0x214f2c,_0x3262f9,_0x4fdd15,_0xc545ac,_0x24914e){db[_[_0xf06f('0x4')](_0xc545ac)+_0xf06f('0xd')][_0xf06f('0xe')]({'where':{'id':getInteractionId(_0x3262f9,_0x4fdd15,_0xc545ac)}})[_0xf06f('0xf')](function(_0x2c07df){if(_0x2c07df){return _0x2c07df[_0xf06f('0x10')]({'UserId':_0x214f2c?_0x214f2c['id']:null});}})[_0xf06f('0xf')](function(_0xa4b688){if(_0xa4b688){log(_0xf06f('0x11'),_0x214f2c,_0x3262f9,_0x4fdd15,_0xc545ac,_0x24914e);}})[_0xf06f('0x12')](function(){log(_0xf06f('0x13'),_0x214f2c,_0x3262f9,_0x4fdd15,_0xc545ac,_0x24914e);});}exports['tracked']=function(_0x4d30c8,_0x4ac30d){return function(_0x421e1a,_0x1aecc6,_0x5b96dd){var _0x4d3e5e=_0x421e1a['user'];var _0x10117a={};var _0x401477=_0x421e1a[_0xf06f('0x14')];if(_0x10117a){_0x10117a=_['clone'](_0x421e1a[_0xf06f('0x15')]);_0x10117a=_[_0xf06f('0x16')](_0x10117a,[_0xf06f('0x15'),_0xf06f('0x17'),_0xf06f('0x18'),_0xf06f('0x19'),_0xf06f('0x1a')]);}updateUser(_0x4d3e5e,_0x10117a,_0x401477,_0x4d30c8,_0x4ac30d);_0x5b96dd(null);};}; \ No newline at end of file +var _0xb40d=['then','info','tracked','user','query','body','omit','html','phone','fax','mobile','lodash','../../mysqldb','../../config/logger','openchannel-interactions','sms-interactions','chat-interactions','upperFirst','InteractionId','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','role','stringify','null','findOne','update'];(function(_0x6d964e,_0x15f3e5){var _0x328012=function(_0x34d9e9){while(--_0x34d9e9){_0x6d964e['push'](_0x6d964e['shift']());}};_0x328012(++_0x15f3e5);}(_0xb40d,0x1ab));var _0xdb40=function(_0x3021c5,_0x1980cc){_0x3021c5=_0x3021c5-0x0;var _0x170536=_0xb40d[_0x3021c5];return _0x170536;};'use strict';var _=require(_0xdb40('0x0'));var db=require(_0xdb40('0x1'))['db'];var loggers={'openchannel':require(_0xdb40('0x2'))(_0xdb40('0x3')),'mail':require(_0xdb40('0x2'))('mail-interactions'),'fax':require(_0xdb40('0x2'))('fax-interactions'),'sms':require(_0xdb40('0x2'))(_0xdb40('0x4')),'chat':require(_0xdb40('0x2'))(_0xdb40('0x5'))};function getInteractionId(_0x46a3ca,_0x3ab5cc,_0x11a518){if(_0x46a3ca&&_0x46a3ca[_[_0xdb40('0x6')](_0x11a518)+'InteractionId']){return _0x46a3ca[_[_0xdb40('0x6')](_0x11a518)+_0xdb40('0x7')];}else if(_0x46a3ca&&_0x46a3ca['id']){return _0x46a3ca['id'];}else if(_0x3ab5cc&&_0x3ab5cc['id']){return _0x3ab5cc['id'];}else{return'unknown';}}function log(_0x5c720f,_0x3db1fd,_0x4c9f9d,_0x58d3dc,_0x41881a,_0x37418d){loggers[_0x41881a['toLowerCase']()][_0x5c720f](_0xdb40('0x8'),_0x37418d[_0xdb40('0x9')](),_0x3db1fd?_0x3db1fd['id']:null,_0x3db1fd?_0x3db1fd['name']:null,_0x3db1fd?_0x3db1fd[_0xdb40('0xa')]:null,getInteractionId(_0x4c9f9d,_0x58d3dc,_0x41881a),_0x4c9f9d?JSON[_0xdb40('0xb')](_0x4c9f9d):_0xdb40('0xc'));}function updateUser(_0x4f547b,_0x2a5b09,_0x562ec6,_0x57c2ee,_0x2eb198){db[_['upperFirst'](_0x57c2ee)+'Interaction'][_0xdb40('0xd')]({'where':{'id':getInteractionId(_0x2a5b09,_0x562ec6,_0x57c2ee)}})['then'](function(_0xd5179d){if(_0xd5179d){return _0xd5179d[_0xdb40('0xe')]({'UserId':_0x4f547b?_0x4f547b['id']:null});}})[_0xdb40('0xf')](function(_0x19a98b){if(_0x19a98b){log(_0xdb40('0x10'),_0x4f547b,_0x2a5b09,_0x562ec6,_0x57c2ee,_0x2eb198);}})['catch'](function(){log('error',_0x4f547b,_0x2a5b09,_0x562ec6,_0x57c2ee,_0x2eb198);});}exports[_0xdb40('0x11')]=function(_0x4addb4,_0x2b66a9){return function(_0x4bd049,_0x1402ad,_0x52d695){var _0x526c1f=_0x4bd049[_0xdb40('0x12')];var _0x5cfd9f={};var _0x1deb87=_0x4bd049[_0xdb40('0x13')];if(_0x5cfd9f){_0x5cfd9f=_['clone'](_0x4bd049[_0xdb40('0x14')]);_0x5cfd9f=_[_0xdb40('0x15')](_0x5cfd9f,[_0xdb40('0x14'),_0xdb40('0x16'),_0xdb40('0x17'),_0xdb40('0x18'),_0xdb40('0x19')]);}updateUser(_0x526c1f,_0x5cfd9f,_0x1deb87,_0x4addb4,_0x2b66a9);_0x52d695(null);};}; \ No newline at end of file diff --git a/server/components/license/service.js b/server/components/license/service.js index d426e23..9e36860 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 _0x9af1=['catch','users','User','admin','isUserLimit','crypto','util','../../mysqldb','../../config/environment','data1','license','split','createDecipher','update','base64','utf8','final','parse','hasOwnProperty','License','findOne','then','status','json','format','Maximum\x20%s\x20limit\x20have\x20been\x20reached'];(function(_0x5bd426,_0x4878e5){var _0x23a7eb=function(_0x594b42){while(--_0x594b42){_0x5bd426['push'](_0x5bd426['shift']());}};_0x23a7eb(++_0x4878e5);}(_0x9af1,0xa1));var _0x19af=function(_0x59d0fa,_0x44deeb){_0x59d0fa=_0x59d0fa-0x0;var _0x3c8b97=_0x9af1[_0x59d0fa];return _0x3c8b97;};'use strict';var crypto=require(_0x19af('0x0'));var util=require(_0x19af('0x1'));var compose=require('composable-middleware');var db=require(_0x19af('0x2'))['db'];var config=require(_0x19af('0x3'));function getValueFromLicense(_0x188e7c,_0x48b3ed){if(_0x188e7c&&_0x48b3ed){if(_0x48b3ed[_0x19af('0x4')]&&_0x48b3ed[_0x19af('0x5')]){var _0x59905b=_0x48b3ed[_0x19af('0x4')];var _0x111701=_0x48b3ed[_0x19af('0x5')];var _0x74fed6=_0x59905b[_0x19af('0x6')]('-')[0x4];var _0x461381=_0x59905b[_0x19af('0x6')]('-')[0x0];var _0x1365c5=crypto[_0x19af('0x7')]('aes-256-ctr',util['format']('%s:%s:%s',_0x74fed6,_0x59905b,_0x461381));var _0x50becd=_0x1365c5[_0x19af('0x8')](_0x111701,_0x19af('0x9'),_0x19af('0xa'));_0x50becd+=_0x1365c5[_0x19af('0xb')](_0x19af('0xa'));var _0x134f08=JSON[_0x19af('0xc')](_0x50becd);return _0x134f08[_0x19af('0xd')](_0x188e7c)?_0x134f08[_0x188e7c]:null;}}return null;}function isLimit(_0x2f9c1d,_0x378dfa,_0xf87d5c,_0x4121a5){var _0x5cc022=_0x378dfa;return compose()['use'](function(_0x12b017,_0x4163cf,_0x3a46d4){return db[_0x19af('0xe')][_0x19af('0xf')]({'where':{'id':0x1},'raw':!![]})['then'](function(_0x25638e){var _0x3e8adc=getValueFromLicense(_0x2f9c1d,_0x25638e);return _0x3e8adc?_0x3e8adc:_0x5cc022;})[_0x19af('0x10')](function(_0x2899fb){_0x5cc022=_0x2899fb;return _0xf87d5c['count'](_0x4121a5);})[_0x19af('0x10')](function(_0x36c1ec){if(_0x36c1ec>=_0x5cc022){return _0x4163cf[_0x19af('0x11')](0x193)[_0x19af('0x12')]({'message':util[_0x19af('0x13')](_0x19af('0x14'),_0x2f9c1d)});}_0x3a46d4();})[_0x19af('0x15')](function(_0x2eb68c){_0x3a46d4(_0x2eb68c);});});}function isUserLimit(){return isLimit(_0x19af('0x16'),0x1,db[_0x19af('0x17')],{'where':{'$or':[{'role':_0x19af('0x18')},{'role':'user'}]}});}exports[_0x19af('0x19')]=isUserLimit; \ No newline at end of file +var _0x7bcb=['composable-middleware','../../mysqldb','../../config/environment','license','split','createDecipher','aes-256-ctr','format','update','base64','final','utf8','parse','hasOwnProperty','use','License','findOne','then','status','json','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','users','User','admin','user','isUserLimit'];(function(_0x49a755,_0x1bdf7d){var _0x264147=function(_0x50e4c5){while(--_0x50e4c5){_0x49a755['push'](_0x49a755['shift']());}};_0x264147(++_0x1bdf7d);}(_0x7bcb,0xd8));var _0xb7bc=function(_0x1dfc5c,_0xb363a5){_0x1dfc5c=_0x1dfc5c-0x0;var _0x5e95a7=_0x7bcb[_0x1dfc5c];return _0x5e95a7;};'use strict';var crypto=require('crypto');var util=require('util');var compose=require(_0xb7bc('0x0'));var db=require(_0xb7bc('0x1'))['db'];var config=require(_0xb7bc('0x2'));function getValueFromLicense(_0xfde5a7,_0x2c99e6){if(_0xfde5a7&&_0x2c99e6){if(_0x2c99e6['data1']&&_0x2c99e6[_0xb7bc('0x3')]){var _0x15d0fc=_0x2c99e6['data1'];var _0x3b3b85=_0x2c99e6[_0xb7bc('0x3')];var _0x14b166=_0x15d0fc['split']('-')[0x4];var _0x44a8f9=_0x15d0fc[_0xb7bc('0x4')]('-')[0x0];var _0x2922d5=crypto[_0xb7bc('0x5')](_0xb7bc('0x6'),util[_0xb7bc('0x7')]('%s:%s:%s',_0x14b166,_0x15d0fc,_0x44a8f9));var _0x4d4470=_0x2922d5[_0xb7bc('0x8')](_0x3b3b85,_0xb7bc('0x9'),'utf8');_0x4d4470+=_0x2922d5[_0xb7bc('0xa')](_0xb7bc('0xb'));var _0x22d2e9=JSON[_0xb7bc('0xc')](_0x4d4470);return _0x22d2e9[_0xb7bc('0xd')](_0xfde5a7)?_0x22d2e9[_0xfde5a7]:null;}}return null;}function isLimit(_0x444a30,_0x4b924d,_0xacfd14,_0x5a3187){var _0x16f9ae=_0x4b924d;return compose()[_0xb7bc('0xe')](function(_0x59d359,_0x379c39,_0x1b53aa){return db[_0xb7bc('0xf')][_0xb7bc('0x10')]({'where':{'id':0x1},'raw':!![]})[_0xb7bc('0x11')](function(_0x37fd05){var _0x158000=getValueFromLicense(_0x444a30,_0x37fd05);return _0x158000?_0x158000:_0x16f9ae;})[_0xb7bc('0x11')](function(_0x5f0b4c){_0x16f9ae=_0x5f0b4c;return _0xacfd14['count'](_0x5a3187);})[_0xb7bc('0x11')](function(_0x330e4b){if(_0x330e4b>=_0x16f9ae){return _0x379c39[_0xb7bc('0x12')](0x193)[_0xb7bc('0x13')]({'message':util[_0xb7bc('0x7')](_0xb7bc('0x14'),_0x444a30)});}_0x1b53aa();})[_0xb7bc('0x15')](function(_0x22a249){_0x1b53aa(_0x22a249);});});}function isUserLimit(){return isLimit(_0xb7bc('0x16'),0x1,db[_0xb7bc('0x17')],{'where':{'$or':[{'role':_0xb7bc('0x18')},{'role':_0xb7bc('0x19')}]}});}exports[_0xb7bc('0x1a')]=isUserLimit; \ No newline at end of file diff --git a/server/components/parsers/advancedSearch.js b/server/components/parsers/advancedSearch.js index f4f912b..552466d 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 _0xbec5=['<\x20?','$gt','$lte','$gte','>=\x20?','$between','getConditionValue','hasMultipleConditions','$and','$or','indexOf','isRangeCondition','hasOwnProperty','lodash','parseOperator','keys','$in','IN\x20?','NOT\x20IN\x20?','$eq','=\x20?','<>\x20?','$substring','$startsWith','$endsWith','LIKE\x20?','$lt'];(function(_0x5160b1,_0x410306){var _0x3410bc=function(_0x15a688){while(--_0x15a688){_0x5160b1['push'](_0x5160b1['shift']());}};_0x3410bc(++_0x410306);}(_0xbec5,0xe5));var _0x5bec=function(_0x5e6ea3,_0x9addd2){_0x5e6ea3=_0x5e6ea3-0x0;var _0x4048b5=_0xbec5[_0x5e6ea3];return _0x4048b5;};'use strict';var _=require(_0x5bec('0x0'));exports[_0x5bec('0x1')]=function(_0x4cfc3b){var _0x1d4842;var _0x38c81a=Object[_0x5bec('0x2')](_0x4cfc3b)[0x0];switch(_0x38c81a){case _0x5bec('0x3'):_0x1d4842=_0x5bec('0x4');break;case'$notIn':_0x1d4842=_0x5bec('0x5');break;case _0x5bec('0x6'):_0x1d4842=_0x5bec('0x7');break;case'$ne':_0x1d4842=_0x5bec('0x8');break;case _0x5bec('0x9'):case _0x5bec('0xa'):case _0x5bec('0xb'):_0x1d4842=_0x5bec('0xc');break;case _0x5bec('0xd'):_0x1d4842=_0x5bec('0xe');break;case _0x5bec('0xf'):_0x1d4842='>\x20?';break;case _0x5bec('0x10'):_0x1d4842='<=\x20?';break;case _0x5bec('0x11'):_0x1d4842=_0x5bec('0x12');break;case _0x5bec('0x13'):_0x1d4842='BETWEEN\x20?\x20AND\x20?';break;}return _0x1d4842;};exports[_0x5bec('0x14')]=function(_0x18fa47){var _0x16226b=Object['keys'](_0x18fa47)[0x0];var _0x6bee21;switch(_0x16226b){case _0x5bec('0x9'):_0x6bee21='%'+_0x18fa47[_0x16226b]+'%';break;case'$startsWith':_0x6bee21=_0x18fa47[_0x16226b]+'%';break;case _0x5bec('0xb'):_0x6bee21='%'+_0x18fa47[_0x16226b];break;case _0x5bec('0x13'):_0x6bee21=_0x18fa47[_0x16226b][0x0];break;default:_0x6bee21=_0x18fa47[_0x16226b];break;}return _0x6bee21;};exports[_0x5bec('0x15')]=function(_0x6888a4){var _0x3198e0=Object[_0x5bec('0x2')](_0x6888a4)[0x0];return[_0x5bec('0x16'),_0x5bec('0x17')][_0x5bec('0x18')](_0x3198e0)>-0x1?!![]:![];};exports[_0x5bec('0x19')]=function(_0x31b9e4){return _0x31b9e4[_0x5bec('0x1a')](_0x5bec('0x13'))?!![]:![];}; \ No newline at end of file +var _0x684c=['LIKE\x20?','$lt','<\x20?','$gt','>\x20?','$lte','<=\x20?','$gte','>=\x20?','BETWEEN\x20?\x20AND\x20?','getConditionValue','$and','$or','indexOf','hasOwnProperty','lodash','parseOperator','keys','$in','IN\x20?','NOT\x20IN\x20?','$eq','=\x20?','$ne','<>\x20?','$substring','$startsWith','$endsWith'];(function(_0x272b37,_0x5a1fa5){var _0x2e2c71=function(_0x5f076b){while(--_0x5f076b){_0x272b37['push'](_0x272b37['shift']());}};_0x2e2c71(++_0x5a1fa5);}(_0x684c,0x1b3));var _0xc684=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x684c[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xc684('0x0'));exports[_0xc684('0x1')]=function(_0x5a7a5a){var _0x1ebbea;var _0x10c3ca=Object[_0xc684('0x2')](_0x5a7a5a)[0x0];switch(_0x10c3ca){case _0xc684('0x3'):_0x1ebbea=_0xc684('0x4');break;case'$notIn':_0x1ebbea=_0xc684('0x5');break;case _0xc684('0x6'):_0x1ebbea=_0xc684('0x7');break;case _0xc684('0x8'):_0x1ebbea=_0xc684('0x9');break;case _0xc684('0xa'):case _0xc684('0xb'):case _0xc684('0xc'):_0x1ebbea=_0xc684('0xd');break;case _0xc684('0xe'):_0x1ebbea=_0xc684('0xf');break;case _0xc684('0x10'):_0x1ebbea=_0xc684('0x11');break;case _0xc684('0x12'):_0x1ebbea=_0xc684('0x13');break;case _0xc684('0x14'):_0x1ebbea=_0xc684('0x15');break;case'$between':_0x1ebbea=_0xc684('0x16');break;}return _0x1ebbea;};exports[_0xc684('0x17')]=function(_0x3ee263){var _0x3cdb8f=Object[_0xc684('0x2')](_0x3ee263)[0x0];var _0x1a1fb4;switch(_0x3cdb8f){case'$substring':_0x1a1fb4='%'+_0x3ee263[_0x3cdb8f]+'%';break;case _0xc684('0xb'):_0x1a1fb4=_0x3ee263[_0x3cdb8f]+'%';break;case _0xc684('0xc'):_0x1a1fb4='%'+_0x3ee263[_0x3cdb8f];break;case'$between':_0x1a1fb4=_0x3ee263[_0x3cdb8f][0x0];break;default:_0x1a1fb4=_0x3ee263[_0x3cdb8f];break;}return _0x1a1fb4;};exports['hasMultipleConditions']=function(_0x24192f){var _0x34cfd7=Object[_0xc684('0x2')](_0x24192f)[0x0];return[_0xc684('0x18'),_0xc684('0x19')][_0xc684('0x1a')](_0x34cfd7)>-0x1?!![]:![];};exports['isRangeCondition']=function(_0x56d76f){return _0x56d76f[_0xc684('0x1b')]('$between')?!![]:![];}; \ No newline at end of file diff --git a/server/components/parsers/qs.js b/server/components/parsers/qs.js index dfc90f0..9ceb359 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 _0x0edf=['cast','col','unsigned','substr','DESC','ASC','omit','length','isObject','isString','isNumeric','match','^[0-9]*$','isEmail','sequelize','fields','isEmpty','isArray','parse','split','offset','sort','priority'];(function(_0x499210,_0x325b29){var _0x2e153d=function(_0x951263){while(--_0x951263){_0x499210['push'](_0x499210['shift']());}};_0x2e153d(++_0x325b29);}(_0x0edf,0xf4));var _0xf0ed=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0edf[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var sequelize=require(_0xf0ed('0x0'));var LIMIT_VALUE=0xfa;exports[_0xf0ed('0x1')]=function(_0x25e2a4){var _0x535946=null;if(_0x25e2a4){_0x535946=_0x25e2a4['split'](',');}return _0x535946;};exports['filters']=function(_0x543005){var _0x546532={};if(!_[_0xf0ed('0x2')](_0x543005)){_0x546532={};_['forOwn'](_0x543005,function(_0x5b7b57,_0x4ffbc0){try{_0x546532[_0x4ffbc0]=_[_0xf0ed('0x3')](_0x5b7b57)?_0x5b7b57:JSON[_0xf0ed('0x4')](_0x5b7b57);}catch(_0x25effd){_0x546532[_0x4ffbc0]=_0x5b7b57[_0xf0ed('0x5')](',');}});}return _0x546532;};exports['limit']=function(_0x3c657d){_0x3c657d=parseInt(_0x3c657d,0xa);if(!_0x3c657d||_0x3c657d<0x0){_0x3c657d=LIMIT_VALUE;}return _0x3c657d;};exports[_0xf0ed('0x6')]=function(_0x1fc670){_0x1fc670=parseInt(_0x1fc670,0xa);if(!_0x1fc670||_0x1fc670<0x0){_0x1fc670=0x0;}return _0x1fc670;};exports[_0xf0ed('0x7')]=function(_0x719c3e){var _0x1135e2,_0x309d4e=null;if(_0x719c3e){_0x1135e2=_0x719c3e[_0xf0ed('0x5')](',');_0x309d4e=_['map'](_0x1135e2,function(_0x3e678d){if(_0x3e678d['indexOf']('-')===0x0){return[_0x3e678d===_0xf0ed('0x8')?sequelize[_0xf0ed('0x9')](sequelize[_0xf0ed('0xa')](_0xf0ed('0x8')),_0xf0ed('0xb')):_0x3e678d[_0xf0ed('0xc')](0x1),_0xf0ed('0xd')];}else{return[_0x3e678d===_0xf0ed('0x8')?sequelize[_0xf0ed('0x9')](sequelize[_0xf0ed('0xa')](_0xf0ed('0x8')),_0xf0ed('0xb')):_0x3e678d,_0xf0ed('0xe')];}});}return _0x309d4e;};exports[_0xf0ed('0xf')]=function(_0x5b5f44,_0x49b318){if(_[_0xf0ed('0x2')](_0x5b5f44)){return _0x5b5f44;}if(_['isArray'](_0x5b5f44)){for(var _0x382874=0x0;_0x382874<_0x5b5f44[_0xf0ed('0x10')];_0x382874+=0x1){_0x5b5f44[_0x382874]=this[_0xf0ed('0xf')](_0x5b5f44[_0x382874],_0x49b318);}return _0x5b5f44;}if(!_[_0xf0ed('0x11')](_0x5b5f44)){return _0x5b5f44;}if(_[_0xf0ed('0x12')](_0x49b318)){_0x49b318=[_0x49b318];}if(!_[_0xf0ed('0x3')](_0x49b318)){return _0x5b5f44;}for(var _0x55f7f7=0x0;_0x55f7f7<_0x49b318['length'];_0x55f7f7+=0x1){_['unset'](_0x5b5f44,_0x49b318[_0x55f7f7]);}for(var _0x25a8c6 in _0x5b5f44){if(_0x5b5f44['hasOwnProperty'](_0x25a8c6)){_0x5b5f44[_0x25a8c6]=this['omit'](_0x5b5f44[_0x25a8c6],_0x49b318);}}return _0x5b5f44;};exports[_0xf0ed('0x13')]=function(_0x319844){return _0x319844[_0xf0ed('0x14')](RegExp(_0xf0ed('0x15')))?!![]:![];};exports[_0xf0ed('0x16')]=function(_0x95579){return _0x95579[_0xf0ed('0x14')](/^\S+@\S+$/)?!![]:![];}; \ No newline at end of file +var _0xd0b2=['map','indexOf','priority','col','unsigned','substr','DESC','cast','ASC','omit','isEmpty','length','isObject','isString','unset','isNumeric','match','isEmail','lodash','sequelize','fields','split','filters','forOwn','isArray','parse','limit','offset','sort'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0xd0b2,0x1e2));var _0x2d0b=function(_0x532e73,_0x3379ce){_0x532e73=_0x532e73-0x0;var _0x3a6934=_0xd0b2[_0x532e73];return _0x3a6934;};'use strict';var _=require(_0x2d0b('0x0'));var sequelize=require(_0x2d0b('0x1'));var LIMIT_VALUE=0xfa;exports[_0x2d0b('0x2')]=function(_0x13258f){var _0x336ddc=null;if(_0x13258f){_0x336ddc=_0x13258f[_0x2d0b('0x3')](',');}return _0x336ddc;};exports[_0x2d0b('0x4')]=function(_0x25dd85){var _0xbd89a4={};if(!_['isEmpty'](_0x25dd85)){_0xbd89a4={};_[_0x2d0b('0x5')](_0x25dd85,function(_0x3b6c57,_0x36caea){try{_0xbd89a4[_0x36caea]=_[_0x2d0b('0x6')](_0x3b6c57)?_0x3b6c57:JSON[_0x2d0b('0x7')](_0x3b6c57);}catch(_0x506e8d){_0xbd89a4[_0x36caea]=_0x3b6c57[_0x2d0b('0x3')](',');}});}return _0xbd89a4;};exports[_0x2d0b('0x8')]=function(_0x1eb96a){_0x1eb96a=parseInt(_0x1eb96a,0xa);if(!_0x1eb96a||_0x1eb96a<0x0){_0x1eb96a=LIMIT_VALUE;}return _0x1eb96a;};exports[_0x2d0b('0x9')]=function(_0x461404){_0x461404=parseInt(_0x461404,0xa);if(!_0x461404||_0x461404<0x0){_0x461404=0x0;}return _0x461404;};exports[_0x2d0b('0xa')]=function(_0x58fe86){var _0x24444b,_0x13704a=null;if(_0x58fe86){_0x24444b=_0x58fe86[_0x2d0b('0x3')](',');_0x13704a=_[_0x2d0b('0xb')](_0x24444b,function(_0x73c8ba){if(_0x73c8ba[_0x2d0b('0xc')]('-')===0x0){return[_0x73c8ba===_0x2d0b('0xd')?sequelize['cast'](sequelize[_0x2d0b('0xe')](_0x2d0b('0xd')),_0x2d0b('0xf')):_0x73c8ba[_0x2d0b('0x10')](0x1),_0x2d0b('0x11')];}else{return[_0x73c8ba===_0x2d0b('0xd')?sequelize[_0x2d0b('0x12')](sequelize['col'](_0x2d0b('0xd')),_0x2d0b('0xf')):_0x73c8ba,_0x2d0b('0x13')];}});}return _0x13704a;};exports[_0x2d0b('0x14')]=function(_0x2339bf,_0xdde733){if(_[_0x2d0b('0x15')](_0x2339bf)){return _0x2339bf;}if(_[_0x2d0b('0x6')](_0x2339bf)){for(var _0x1cf71e=0x0;_0x1cf71e<_0x2339bf[_0x2d0b('0x16')];_0x1cf71e+=0x1){_0x2339bf[_0x1cf71e]=this[_0x2d0b('0x14')](_0x2339bf[_0x1cf71e],_0xdde733);}return _0x2339bf;}if(!_[_0x2d0b('0x17')](_0x2339bf)){return _0x2339bf;}if(_[_0x2d0b('0x18')](_0xdde733)){_0xdde733=[_0xdde733];}if(!_[_0x2d0b('0x6')](_0xdde733)){return _0x2339bf;}for(var _0x256a70=0x0;_0x256a70<_0xdde733['length'];_0x256a70+=0x1){_[_0x2d0b('0x19')](_0x2339bf,_0xdde733[_0x256a70]);}for(var _0x18639e in _0x2339bf){if(_0x2339bf['hasOwnProperty'](_0x18639e)){_0x2339bf[_0x18639e]=this[_0x2d0b('0x14')](_0x2339bf[_0x18639e],_0xdde733);}}return _0x2339bf;};exports[_0x2d0b('0x1a')]=function(_0x592304){return _0x592304[_0x2d0b('0x1b')](RegExp('^[0-9]*$'))?!![]:![];};exports[_0x2d0b('0x1c')]=function(_0x608d33){return _0x608d33[_0x2d0b('0x1b')](/^\S+@\S+$/)?!![]:![];}; \ No newline at end of file diff --git a/server/config/express.js b/server/config/express.js index 5a5f8ff..e4793a9 100644 --- a/server/config/express.js +++ b/server/config/express.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb7e7=['views','/server/views','engine','renderFile','view\x20engine','html','urlencoded','50mb','json','initialize','express','body-parser','cookie-parser','path','cors','moment','./environment','get','production','set','appPath','join','root','public','development','client','use','json\x20replacer','toISOString','split','static'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xb7e7,0x121));var _0x7b7e=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0xb7e7[_0x126558];return _0x1f6d14;};'use strict';var express=require(_0x7b7e('0x0'));var favicon=require('serve-favicon');var bodyParser=require(_0x7b7e('0x1'));var methodOverride=require('method-override');var cookieParser=require(_0x7b7e('0x2'));var errorHandler=require('errorhandler');var path=require(_0x7b7e('0x3'));var passport=require('passport');var cors=require(_0x7b7e('0x4'));var moment=require(_0x7b7e('0x5'));var config=require(_0x7b7e('0x6'));var db=require('../mysqldb')['db'];exports['default']=function(_0x333fa4){var _0x372bde=_0x333fa4[_0x7b7e('0x7')]('env');if(_0x372bde===_0x7b7e('0x8')){_0x333fa4[_0x7b7e('0x9')](_0x7b7e('0xa'),path[_0x7b7e('0xb')](config[_0x7b7e('0xc')],_0x7b7e('0xd')));}if(_0x372bde===_0x7b7e('0xe')||_0x372bde==='test'){_0x333fa4[_0x7b7e('0x9')](_0x7b7e('0xa'),path[_0x7b7e('0xb')](config[_0x7b7e('0xc')],_0x7b7e('0xf')));_0x333fa4[_0x7b7e('0x10')](errorHandler());}_0x333fa4[_0x7b7e('0x9')](_0x7b7e('0x11'),function(_0xaadda,_0x54d8ce){if(this[_0xaadda]instanceof Date){_0x54d8ce=this[_0xaadda][_0x7b7e('0x12')]()[_0x7b7e('0x13')]('.')[0x0]+'Z';}return _0x54d8ce;});_0x333fa4['use'](express[_0x7b7e('0x14')](_0x333fa4['get']('appPath')));_0x333fa4[_0x7b7e('0x9')](_0x7b7e('0x15'),config[_0x7b7e('0xc')]+_0x7b7e('0x16'));_0x333fa4[_0x7b7e('0x17')]('html',require('ejs')[_0x7b7e('0x18')]);_0x333fa4[_0x7b7e('0x9')](_0x7b7e('0x19'),_0x7b7e('0x1a'));_0x333fa4[_0x7b7e('0x10')](bodyParser[_0x7b7e('0x1b')]({'limit':_0x7b7e('0x1c'),'extended':!![]}));_0x333fa4[_0x7b7e('0x10')](bodyParser[_0x7b7e('0x1d')]({'limit':_0x7b7e('0x1c')}));_0x333fa4[_0x7b7e('0x10')](cors());_0x333fa4[_0x7b7e('0x10')](methodOverride());_0x333fa4[_0x7b7e('0x10')](cookieParser());_0x333fa4[_0x7b7e('0x10')](passport[_0x7b7e('0x1e')]());}; \ No newline at end of file +var _0x3c81=['split','engine','html','ejs','renderFile','view\x20engine','urlencoded','50mb','json','initialize','express','serve-favicon','method-override','cookie-parser','moment','./environment','../mysqldb','default','get','production','appPath','join','root','public','development','test','set','client','use','json\x20replacer','toISOString'];(function(_0x273dc7,_0x588dbe){var _0x180aa1=function(_0x3b051a){while(--_0x3b051a){_0x273dc7['push'](_0x273dc7['shift']());}};_0x180aa1(++_0x588dbe);}(_0x3c81,0x102));var _0x13c8=function(_0xee6f99,_0x51f143){_0xee6f99=_0xee6f99-0x0;var _0x3af123=_0x3c81[_0xee6f99];return _0x3af123;};'use strict';var express=require(_0x13c8('0x0'));var favicon=require(_0x13c8('0x1'));var bodyParser=require('body-parser');var methodOverride=require(_0x13c8('0x2'));var cookieParser=require(_0x13c8('0x3'));var errorHandler=require('errorhandler');var path=require('path');var passport=require('passport');var cors=require('cors');var moment=require(_0x13c8('0x4'));var config=require(_0x13c8('0x5'));var db=require(_0x13c8('0x6'))['db'];exports[_0x13c8('0x7')]=function(_0x2a4d66){var _0x3f0bd2=_0x2a4d66[_0x13c8('0x8')]('env');if(_0x3f0bd2===_0x13c8('0x9')){_0x2a4d66['set'](_0x13c8('0xa'),path[_0x13c8('0xb')](config[_0x13c8('0xc')],_0x13c8('0xd')));}if(_0x3f0bd2===_0x13c8('0xe')||_0x3f0bd2===_0x13c8('0xf')){_0x2a4d66[_0x13c8('0x10')](_0x13c8('0xa'),path[_0x13c8('0xb')](config[_0x13c8('0xc')],_0x13c8('0x11')));_0x2a4d66[_0x13c8('0x12')](errorHandler());}_0x2a4d66[_0x13c8('0x10')](_0x13c8('0x13'),function(_0x5ab91d,_0x21442d){if(this[_0x5ab91d]instanceof Date){_0x21442d=this[_0x5ab91d][_0x13c8('0x14')]()[_0x13c8('0x15')]('.')[0x0]+'Z';}return _0x21442d;});_0x2a4d66[_0x13c8('0x12')](express['static'](_0x2a4d66[_0x13c8('0x8')]('appPath')));_0x2a4d66['set']('views',config[_0x13c8('0xc')]+'/server/views');_0x2a4d66[_0x13c8('0x16')](_0x13c8('0x17'),require(_0x13c8('0x18'))[_0x13c8('0x19')]);_0x2a4d66['set'](_0x13c8('0x1a'),_0x13c8('0x17'));_0x2a4d66[_0x13c8('0x12')](bodyParser[_0x13c8('0x1b')]({'limit':_0x13c8('0x1c'),'extended':!![]}));_0x2a4d66[_0x13c8('0x12')](bodyParser[_0x13c8('0x1d')]({'limit':_0x13c8('0x1c')}));_0x2a4d66[_0x13c8('0x12')](cors());_0x2a4d66[_0x13c8('0x12')](methodOverride());_0x2a4d66[_0x13c8('0x12')](cookieParser());_0x2a4d66['use'](passport[_0x13c8('0x1e')]());}; \ No newline at end of file diff --git a/server/config/license/hardware.js b/server/config/license/hardware.js index fd3fccb..97589f6 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 _0x57e1=['concat','head','mac','00:00:00:00:00:00','address','127.0.0.1','getFirstInterface','map','join','md5','update','digest','hex','getUuid','platform','dmidecode\x20--string\x20system-uuid','utf8','replace','hostname','macAddress','ipAddress','createHash','substring','lodash','child_process','execSync','networkInterfaces','orderBy','keys','length','family','IPv4'];(function(_0xd6aea9,_0x487a57){var _0x1c3b5a=function(_0x29628e){while(--_0x29628e){_0xd6aea9['push'](_0xd6aea9['shift']());}};_0x1c3b5a(++_0x487a57);}(_0x57e1,0xf7));var _0x157e=function(_0x15a346,_0x46d825){_0x15a346=_0x15a346-0x0;var _0x275a0f=_0x57e1[_0x15a346];return _0x275a0f;};'use strict';var _=require(_0x157e('0x0'));var os=require('os');var crypto=require('crypto');var machine=require('bimedia-machine-uuid');var exec=require(_0x157e('0x1'))[_0x157e('0x2')];function getInterfaces(){var _0x28d7c0=[];var _0x16d8fb=os[_0x157e('0x3')]();var _0x416c9c=_[_0x157e('0x4')](_[_0x157e('0x5')](_0x16d8fb));for(var _0x17a55a=0x0;_0x17a55a<_0x416c9c[_0x157e('0x6')];_0x17a55a++){var _0x3cdba2=_0x16d8fb[_0x416c9c[_0x17a55a]]['filter'](function(_0x1c907d){return _0x1c907d[_0x157e('0x7')]===_0x157e('0x8')&&_0x1c907d['internal']===![];});_0x28d7c0=_0x28d7c0[_0x157e('0x9')](_0x3cdba2);}return _0x28d7c0;}function getFirstInterface(){var _0x3548ec=_[_0x157e('0xa')](getInterfaces());return{'macAddress':_0x3548ec&&_0x3548ec['mac']?_0x3548ec[_0x157e('0xb')]:_0x157e('0xc'),'ipAddress':_0x3548ec&&_0x3548ec[_0x157e('0xd')]?_0x3548ec[_0x157e('0xd')]:_0x157e('0xe')};}exports[_0x157e('0xf')]=getFirstInterface;function getCPUhash(){var _0x1cb623=_[_0x157e('0x4')](os['cpus']()[_0x157e('0x10')](function(_0x2e8578){return _0x2e8578['model'];}))[_0x157e('0x11')](':');return crypto['createHash'](_0x157e('0x12'))[_0x157e('0x13')](_0x1cb623)[_0x157e('0x14')](_0x157e('0x15'));}exports[_0x157e('0x16')]=function(){switch(os[_0x157e('0x17')]()){case'win32':return exec(_0x157e('0x18'),{'encoding':_0x157e('0x19')})[_0x157e('0x1a')]('\x0d\x0a','');default:var _0x38fde1=getFirstInterface();var _0xda35f2=getCPUhash();var _0x75f87c=_0xda35f2+'|'+os[_0x157e('0x1b')]()+'|'+_0x38fde1[_0x157e('0x1c')]+'|'+_0x38fde1[_0x157e('0x1d')];var _0x3fcff8=crypto[_0x157e('0x1e')]('md5')[_0x157e('0x13')](_0x75f87c)['digest']('hex');return _0x3fcff8[_0x157e('0x1f')](0x0,0x8)+'-'+_0x3fcff8['substring'](0x8,0xc)+'-'+_0x3fcff8['substring'](0xc,0x10)+'-'+_0x3fcff8[_0x157e('0x1f')](0x10,0x14)+'-'+_0x3fcff8[_0x157e('0x1f')](0x14);}}; \ No newline at end of file +var _0x7ae6=['IPv4','internal','concat','head','mac','00:00:00:00:00:00','address','127.0.0.1','getFirstInterface','cpus','map','model','join','md5','update','digest','getUuid','platform','dmidecode\x20--string\x20system-uuid','utf8','replace','macAddress','hex','substring','crypto','bimedia-machine-uuid','execSync','orderBy','keys','length','filter','family'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x7ae6,0x178));var _0x67ae=function(_0xfaf988,_0x306748){_0xfaf988=_0xfaf988-0x0;var _0xf2b3a5=_0x7ae6[_0xfaf988];return _0xf2b3a5;};'use strict';var _=require('lodash');var os=require('os');var crypto=require(_0x67ae('0x0'));var machine=require(_0x67ae('0x1'));var exec=require('child_process')[_0x67ae('0x2')];function getInterfaces(){var _0x5862d3=[];var _0x3bda7f=os['networkInterfaces']();var _0x4133be=_[_0x67ae('0x3')](_[_0x67ae('0x4')](_0x3bda7f));for(var _0x1cfff4=0x0;_0x1cfff4<_0x4133be[_0x67ae('0x5')];_0x1cfff4++){var _0x10eaaf=_0x3bda7f[_0x4133be[_0x1cfff4]][_0x67ae('0x6')](function(_0x2b8f66){return _0x2b8f66[_0x67ae('0x7')]===_0x67ae('0x8')&&_0x2b8f66[_0x67ae('0x9')]===![];});_0x5862d3=_0x5862d3[_0x67ae('0xa')](_0x10eaaf);}return _0x5862d3;}function getFirstInterface(){var _0x128e73=_[_0x67ae('0xb')](getInterfaces());return{'macAddress':_0x128e73&&_0x128e73[_0x67ae('0xc')]?_0x128e73[_0x67ae('0xc')]:_0x67ae('0xd'),'ipAddress':_0x128e73&&_0x128e73[_0x67ae('0xe')]?_0x128e73[_0x67ae('0xe')]:_0x67ae('0xf')};}exports[_0x67ae('0x10')]=getFirstInterface;function getCPUhash(){var _0x2d722d=_[_0x67ae('0x3')](os[_0x67ae('0x11')]()[_0x67ae('0x12')](function(_0x3b4b66){return _0x3b4b66[_0x67ae('0x13')];}))[_0x67ae('0x14')](':');return crypto['createHash'](_0x67ae('0x15'))[_0x67ae('0x16')](_0x2d722d)[_0x67ae('0x17')]('hex');}exports[_0x67ae('0x18')]=function(){switch(os[_0x67ae('0x19')]()){case'win32':return exec(_0x67ae('0x1a'),{'encoding':_0x67ae('0x1b')})[_0x67ae('0x1c')]('\x0d\x0a','');default:var _0xc6e38e=getFirstInterface();var _0x335083=getCPUhash();var _0x12223c=_0x335083+'|'+os['hostname']()+'|'+_0xc6e38e[_0x67ae('0x1d')]+'|'+_0xc6e38e['ipAddress'];var _0x553398=crypto['createHash'](_0x67ae('0x15'))['update'](_0x12223c)[_0x67ae('0x17')](_0x67ae('0x1e'));return _0x553398[_0x67ae('0x1f')](0x0,0x8)+'-'+_0x553398[_0x67ae('0x1f')](0x8,0xc)+'-'+_0x553398[_0x67ae('0x1f')](0xc,0x10)+'-'+_0x553398[_0x67ae('0x1f')](0x10,0x14)+'-'+_0x553398[_0x67ae('0x1f')](0x14);}}; \ No newline at end of file diff --git a/server/config/license/index.js b/server/config/license/index.js index 0f93ad2..cb7f605 100644 --- a/server/config/license/index.js +++ b/server/config/license/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['https://www.xcallymotion.com','format','version','%s/api/servers/%s/check?version=%s&oldtoken=%s','exports','createCipher','aes-256-ctr','secrets','update','utf8','base64','final','session','||FIELD||VALUE||\x0a','User','findOne','admin','fullname','email','|reason|','|machineUuid|','|email|','then','getFirstInterface','ipAddress','openIssue','MOTLICENSE','Motion\x20License\x20Alert','Alert','get','active','data2','info','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','data1','Disabled','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','uuid','toUpperCase','YYYY-MM-DD\x20HH:mm','diff','message','finally','getUuid','License','findOrCreate','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','error','util','crypto','moment','pkginfo','../../mysqldb','../environment','./hardware','../logger','license'];(function(_0x380aa9,_0x39436f){var _0x1477f4=function(_0x2b80b7){while(--_0x2b80b7){_0x380aa9['push'](_0x380aa9['shift']());}};_0x1477f4(++_0x39436f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1da04e,_0x31024b){_0x1da04e=_0x1da04e-0x0;var _0xdd8c41=_0xa9e0[_0x1da04e];return _0xdd8c41;};'use strict';var util=require(_0x0a9e('0x0'));var crypto=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var rp=require('request-promise');var BPromise=require('bluebird');var pkginfo=require(_0x0a9e('0x3'))(module,'version');var db=require(_0x0a9e('0x4'))['db'];var config=require(_0x0a9e('0x5'));var hardware=require(_0x0a9e('0x6'));var logger=require(_0x0a9e('0x7'))(_0x0a9e('0x8'));var jira=require('../../api/jira/jira.controller');var HOST=_0x0a9e('0x9');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var ADMIN;var oldToken;function httpRequest(_0x441e3a){return new BPromise(function(_0x2cc193,_0x5f41ea){var _0x503809=util[_0x0a9e('0xa')]('%s/api/servers/%s/check?version=%s',HOST,_0x441e3a,module['exports'][_0x0a9e('0xb')]);if(oldToken){_0x503809=util[_0x0a9e('0xa')](_0x0a9e('0xc'),HOST,_0x441e3a,module[_0x0a9e('0xd')][_0x0a9e('0xb')],oldToken);}var _0xbd1168={'uri':_0x503809,'method':'GET','timeout':0xea60,'json':!![]};return rp(_0xbd1168)['then'](function(_0x527cdd){_0x2cc193(_0x527cdd);})['catch'](function(_0x273d4d){_0x5f41ea(_0x273d4d);});});}function encryptDate(_0x36471c){var _0xd5b662=crypto[_0x0a9e('0xe')](_0x0a9e('0xf'),config[_0x0a9e('0x10')]['session']);var _0x4283ce=_0xd5b662[_0x0a9e('0x11')](_0x36471c,_0x0a9e('0x12'),_0x0a9e('0x13'));_0x4283ce+=_0xd5b662[_0x0a9e('0x14')](_0x0a9e('0x13'));return _0x4283ce;}function decryptDate(_0x52a03d){var _0x22dccb=crypto['createDecipher'](_0x0a9e('0xf'),config['secrets'][_0x0a9e('0x15')]);var _0x12066b=_0x22dccb['update'](_0x52a03d,_0x0a9e('0x13'),'utf8');_0x12066b+=_0x22dccb[_0x0a9e('0x14')](_0x0a9e('0x12'));return _0x12066b;}function sendJiraAlert(_0x106033,_0x205fd6,_0x31b1ca){var _0x2eb11f=_0x0a9e('0x16');return db[_0x0a9e('0x17')][_0x0a9e('0x18')]({'where':{'role':_0x0a9e('0x19')},'attributes':[_0x0a9e('0x1a'),_0x0a9e('0x1b')],'raw':!![]})['then'](function(_0x2c3407){ADMIN=_0x2c3407;_0x2eb11f+=_0x0a9e('0x1c')+_0x31b1ca+'|\x0a';_0x2eb11f+='|uuid|'+_0x106033+'|\x0a';_0x2eb11f+=_0x0a9e('0x1d')+_0x205fd6+'|\x0a';_0x2eb11f+='|name|'+ADMIN['fullname']+'|\x0a';_0x2eb11f+=_0x0a9e('0x1e')+ADMIN[_0x0a9e('0x1b')]+'|\x0a';return _0x2eb11f;})[_0x0a9e('0x1f')](function(_0x30bae6){var _0x4abc77=hardware[_0x0a9e('0x20')]()[_0x0a9e('0x21')];return jira[_0x0a9e('0x22')]({'key':_0x0a9e('0x23'),'summary':_0x0a9e('0x24'),'description':_0x30bae6,'issuetype':_0x0a9e('0x25'),'oldToken':_0x106033,'newToken':_0x205fd6,'email':ADMIN[_0x0a9e('0x1b')],'name':ADMIN['fullname'],'reason':GRAY_PERIOD_REASON,'ip':_0x4abc77});});}function manageLicense(_0x59181e,_0x197ec0){var _0x3a8e58=_0x197ec0[_0x0a9e('0x26')]({'plain':!![]});httpRequest(_0x59181e)[_0x0a9e('0x1f')](function(_0x526cf3){if(oldToken){oldToken=undefined;}if(_0x526cf3[_0x0a9e('0x27')]){if(!_0x3a8e58['license']&&_0x3a8e58[_0x0a9e('0x8')]!=_0x526cf3['license']||_0x3a8e58[_0x0a9e('0x8')]&&_0x3a8e58[_0x0a9e('0x28')]){logger[_0x0a9e('0x29')](_0x0a9e('0x2a'));}if(_0x3a8e58[_0x0a9e('0x8')]&&!_0x3a8e58[_0x0a9e('0x28')]&&_0x3a8e58[_0x0a9e('0x8')]!=_0x526cf3[_0x0a9e('0x8')]){logger['info'](_0x0a9e('0x2b'));}if(_0x3a8e58[_0x0a9e('0x8')]&&!_0x3a8e58[_0x0a9e('0x28')]&&_0x3a8e58[_0x0a9e('0x8')]==_0x526cf3['license']){return _0x197ec0;}return _0x197ec0[_0x0a9e('0x11')]({'data1':_0x59181e,'data2':null,'license':_0x526cf3[_0x0a9e('0x8')]});}else{if(_0x526cf3[_0x0a9e('0x8')]||_0x3a8e58[_0x0a9e('0x8')]){if(!_0x3a8e58[_0x0a9e('0x28')]){if(_0x3a8e58[_0x0a9e('0x2c')]==_0x59181e){GRAY_PERIOD_REASON=_0x0a9e('0x2d');logger[_0x0a9e('0x29')](_0x0a9e('0x2e'));}else{GRAY_PERIOD_REASON='Changed';oldToken=_0x3a8e58[_0x0a9e('0x2c')];logger['info'](_0x0a9e('0x2f'),_0x3a8e58[_0x0a9e('0x2c')],_0x59181e);}sendJiraAlert(_0x3a8e58[_0x0a9e('0x2c')],_0x526cf3[_0x0a9e('0x30')],GRAY_PERIOD_REASON);logger[_0x0a9e('0x29')]('%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s',GRAY_PERIOD_REASON[_0x0a9e('0x31')](),moment()[_0x0a9e('0xa')](_0x0a9e('0x32')));return _0x197ec0[_0x0a9e('0x11')]({'data2':encryptDate(moment()[_0x0a9e('0xa')](_0x0a9e('0x32')))});}else{if(moment()[_0x0a9e('0x33')](decryptDate(_0x3a8e58[_0x0a9e('0x28')]),'days')>DAYS){logger[_0x0a9e('0x29')]('DEMO\x20START\x20AT\x20%s',moment()[_0x0a9e('0xa')](_0x0a9e('0x32')));return _0x197ec0[_0x0a9e('0x11')]({'data1':_0x59181e,'data2':null,'license':null});}}}else{if(_0x3a8e58[_0x0a9e('0x2c')]!=_0x59181e){logger['info'](_0x0a9e('0x2f'),_0x3a8e58[_0x0a9e('0x2c')],_0x59181e);return _0x197ec0[_0x0a9e('0x11')]({'data1':_0x59181e,'data2':null,'license':null});}}}return _0x197ec0;})[_0x0a9e('0x1f')](function(_0x4853b1){_0x197ec0=_0x4853b1;})['catch'](function(_0x1e8694){logger['error'](_0x1e8694[_0x0a9e('0x34')]);})[_0x0a9e('0x35')](function(){setTimeout(function(){manageLicense(hardware[_0x0a9e('0x36')](),_0x197ec0);},TIME);});}function defaultLicense(){var _0x1ef87a=hardware['getUuid']();if(_0x1ef87a){return db[_0x0a9e('0x37')][_0x0a9e('0x38')]({'where':{'id':0x1},'defaults':{'data1':_0x1ef87a}})[_0x0a9e('0x39')](function(_0x533942,_0x1dbf74){logger[_0x0a9e('0x29')](_0x0a9e('0x3a'),_0x1ef87a);manageLicense(_0x1ef87a,_0x533942);})['catch'](function(_0x546ef8){logger[_0x0a9e('0x3b')](_0x546ef8[_0x0a9e('0x34')]);});}}exports['default']=defaultLicense; \ No newline at end of file +var _0xa9e0=['https://www.xcallymotion.com','format','version','%s/api/servers/%s/check?version=%s&oldtoken=%s','exports','createCipher','aes-256-ctr','secrets','update','utf8','base64','final','session','||FIELD||VALUE||\x0a','User','findOne','admin','fullname','email','|reason|','|machineUuid|','|email|','then','getFirstInterface','ipAddress','openIssue','MOTLICENSE','Motion\x20License\x20Alert','Alert','get','active','data2','info','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','data1','Disabled','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','uuid','toUpperCase','YYYY-MM-DD\x20HH:mm','diff','message','finally','getUuid','License','findOrCreate','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','error','util','crypto','moment','pkginfo','../../mysqldb','../environment','./hardware','../logger','license'];(function(_0x1640d2,_0x4d343d){var _0x1ba99c=function(_0x196218){while(--_0x196218){_0x1640d2['push'](_0x1640d2['shift']());}};_0x1ba99c(++_0x4d343d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x12d033,_0x25fa2f){_0x12d033=_0x12d033-0x0;var _0x3b4e80=_0xa9e0[_0x12d033];return _0x3b4e80;};'use strict';var util=require(_0x0a9e('0x0'));var crypto=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var rp=require('request-promise');var BPromise=require('bluebird');var pkginfo=require(_0x0a9e('0x3'))(module,'version');var db=require(_0x0a9e('0x4'))['db'];var config=require(_0x0a9e('0x5'));var hardware=require(_0x0a9e('0x6'));var logger=require(_0x0a9e('0x7'))(_0x0a9e('0x8'));var jira=require('../../api/jira/jira.controller');var HOST=_0x0a9e('0x9');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var ADMIN;var oldToken;function httpRequest(_0x441e3a){return new BPromise(function(_0x2cc193,_0x5f41ea){var _0x503809=util[_0x0a9e('0xa')]('%s/api/servers/%s/check?version=%s',HOST,_0x441e3a,module['exports'][_0x0a9e('0xb')]);if(oldToken){_0x503809=util[_0x0a9e('0xa')](_0x0a9e('0xc'),HOST,_0x441e3a,module[_0x0a9e('0xd')][_0x0a9e('0xb')],oldToken);}var _0xbd1168={'uri':_0x503809,'method':'GET','timeout':0xea60,'json':!![]};return rp(_0xbd1168)['then'](function(_0x527cdd){_0x2cc193(_0x527cdd);})['catch'](function(_0x273d4d){_0x5f41ea(_0x273d4d);});});}function encryptDate(_0x36471c){var _0xd5b662=crypto[_0x0a9e('0xe')](_0x0a9e('0xf'),config[_0x0a9e('0x10')]['session']);var _0x4283ce=_0xd5b662[_0x0a9e('0x11')](_0x36471c,_0x0a9e('0x12'),_0x0a9e('0x13'));_0x4283ce+=_0xd5b662[_0x0a9e('0x14')](_0x0a9e('0x13'));return _0x4283ce;}function decryptDate(_0x52a03d){var _0x22dccb=crypto['createDecipher'](_0x0a9e('0xf'),config['secrets'][_0x0a9e('0x15')]);var _0x12066b=_0x22dccb['update'](_0x52a03d,_0x0a9e('0x13'),'utf8');_0x12066b+=_0x22dccb[_0x0a9e('0x14')](_0x0a9e('0x12'));return _0x12066b;}function sendJiraAlert(_0x106033,_0x205fd6,_0x31b1ca){var _0x2eb11f=_0x0a9e('0x16');return db[_0x0a9e('0x17')][_0x0a9e('0x18')]({'where':{'role':_0x0a9e('0x19')},'attributes':[_0x0a9e('0x1a'),_0x0a9e('0x1b')],'raw':!![]})['then'](function(_0x2c3407){ADMIN=_0x2c3407;_0x2eb11f+=_0x0a9e('0x1c')+_0x31b1ca+'|\x0a';_0x2eb11f+='|uuid|'+_0x106033+'|\x0a';_0x2eb11f+=_0x0a9e('0x1d')+_0x205fd6+'|\x0a';_0x2eb11f+='|name|'+ADMIN['fullname']+'|\x0a';_0x2eb11f+=_0x0a9e('0x1e')+ADMIN[_0x0a9e('0x1b')]+'|\x0a';return _0x2eb11f;})[_0x0a9e('0x1f')](function(_0x30bae6){var _0x4abc77=hardware[_0x0a9e('0x20')]()[_0x0a9e('0x21')];return jira[_0x0a9e('0x22')]({'key':_0x0a9e('0x23'),'summary':_0x0a9e('0x24'),'description':_0x30bae6,'issuetype':_0x0a9e('0x25'),'oldToken':_0x106033,'newToken':_0x205fd6,'email':ADMIN[_0x0a9e('0x1b')],'name':ADMIN['fullname'],'reason':GRAY_PERIOD_REASON,'ip':_0x4abc77});});}function manageLicense(_0x59181e,_0x197ec0){var _0x3a8e58=_0x197ec0[_0x0a9e('0x26')]({'plain':!![]});httpRequest(_0x59181e)[_0x0a9e('0x1f')](function(_0x526cf3){if(oldToken){oldToken=undefined;}if(_0x526cf3[_0x0a9e('0x27')]){if(!_0x3a8e58['license']&&_0x3a8e58[_0x0a9e('0x8')]!=_0x526cf3['license']||_0x3a8e58[_0x0a9e('0x8')]&&_0x3a8e58[_0x0a9e('0x28')]){logger[_0x0a9e('0x29')](_0x0a9e('0x2a'));}if(_0x3a8e58[_0x0a9e('0x8')]&&!_0x3a8e58[_0x0a9e('0x28')]&&_0x3a8e58[_0x0a9e('0x8')]!=_0x526cf3[_0x0a9e('0x8')]){logger['info'](_0x0a9e('0x2b'));}if(_0x3a8e58[_0x0a9e('0x8')]&&!_0x3a8e58[_0x0a9e('0x28')]&&_0x3a8e58[_0x0a9e('0x8')]==_0x526cf3['license']){return _0x197ec0;}return _0x197ec0[_0x0a9e('0x11')]({'data1':_0x59181e,'data2':null,'license':_0x526cf3[_0x0a9e('0x8')]});}else{if(_0x526cf3[_0x0a9e('0x8')]||_0x3a8e58[_0x0a9e('0x8')]){if(!_0x3a8e58[_0x0a9e('0x28')]){if(_0x3a8e58[_0x0a9e('0x2c')]==_0x59181e){GRAY_PERIOD_REASON=_0x0a9e('0x2d');logger[_0x0a9e('0x29')](_0x0a9e('0x2e'));}else{GRAY_PERIOD_REASON='Changed';oldToken=_0x3a8e58[_0x0a9e('0x2c')];logger['info'](_0x0a9e('0x2f'),_0x3a8e58[_0x0a9e('0x2c')],_0x59181e);}sendJiraAlert(_0x3a8e58[_0x0a9e('0x2c')],_0x526cf3[_0x0a9e('0x30')],GRAY_PERIOD_REASON);logger[_0x0a9e('0x29')]('%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s',GRAY_PERIOD_REASON[_0x0a9e('0x31')](),moment()[_0x0a9e('0xa')](_0x0a9e('0x32')));return _0x197ec0[_0x0a9e('0x11')]({'data2':encryptDate(moment()[_0x0a9e('0xa')](_0x0a9e('0x32')))});}else{if(moment()[_0x0a9e('0x33')](decryptDate(_0x3a8e58[_0x0a9e('0x28')]),'days')>DAYS){logger[_0x0a9e('0x29')]('DEMO\x20START\x20AT\x20%s',moment()[_0x0a9e('0xa')](_0x0a9e('0x32')));return _0x197ec0[_0x0a9e('0x11')]({'data1':_0x59181e,'data2':null,'license':null});}}}else{if(_0x3a8e58[_0x0a9e('0x2c')]!=_0x59181e){logger['info'](_0x0a9e('0x2f'),_0x3a8e58[_0x0a9e('0x2c')],_0x59181e);return _0x197ec0[_0x0a9e('0x11')]({'data1':_0x59181e,'data2':null,'license':null});}}}return _0x197ec0;})[_0x0a9e('0x1f')](function(_0x4853b1){_0x197ec0=_0x4853b1;})['catch'](function(_0x1e8694){logger['error'](_0x1e8694[_0x0a9e('0x34')]);})[_0x0a9e('0x35')](function(){setTimeout(function(){manageLicense(hardware[_0x0a9e('0x36')](),_0x197ec0);},TIME);});}function defaultLicense(){var _0x1ef87a=hardware['getUuid']();if(_0x1ef87a){return db[_0x0a9e('0x37')][_0x0a9e('0x38')]({'where':{'id':0x1},'defaults':{'data1':_0x1ef87a}})[_0x0a9e('0x39')](function(_0x533942,_0x1dbf74){logger[_0x0a9e('0x29')](_0x0a9e('0x3a'),_0x1ef87a);manageLicense(_0x1ef87a,_0x533942);})['catch'](function(_0x546ef8){logger[_0x0a9e('0x3b')](_0x546ef8[_0x0a9e('0x34')]);});}}exports['default']=defaultLicense; \ No newline at end of file diff --git a/server/config/license/util.js b/server/config/license/util.js index 432e9c2..0aab158 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 _0x19ca=['machineUuid','changed','disabled','2027-01-01T00:00:00.000Z','message','getLicense','License','find','defaults','then','checkLicense','crypto','lodash','moment','./hardware','../../mysqldb','license','isEmpty','License\x20key\x20value\x20not\x20found','data1','split','aes-256-ctr','format','%s:%s:%s','update','base64','utf8','uuid','getUuid','createDecipher','secrets','session','gray','deadline','add','grayReason'];(function(_0x2dd145,_0x2b21bd){var _0xb28d3d=function(_0x2d5bb3){while(--_0x2d5bb3){_0x2dd145['push'](_0x2dd145['shift']());}};_0xb28d3d(++_0x2b21bd);}(_0x19ca,0x1bb));var _0xa19c=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x19ca[_0x2f5ac5];return _0x37c9a8;};'use strict';var crypto=require(_0xa19c('0x0'));var util=require('util');var _=require(_0xa19c('0x1'));var moment=require(_0xa19c('0x2'));var hardware=require(_0xa19c('0x3'));var config=require('../environment');var db=require(_0xa19c('0x4'))['db'];function checkLicense(_0x4a0368,_0x3752d8){if(_0x4a0368){try{var _0x5bb7c3=_0x3752d8||_0x4a0368[_0xa19c('0x5')];if(_[_0xa19c('0x6')](_0x5bb7c3)){throw new Error(_0xa19c('0x7'));}var _0x12bcc2=_0x4a0368[_0xa19c('0x8')];var _0xc5b145=_0x4a0368['data2'];var _0x5d7e3e=_0x12bcc2[_0xa19c('0x9')]('-')[0x4];var _0x1949c8=_0x12bcc2[_0xa19c('0x9')]('-')[0x0];var _0x275ed9=crypto['createDecipher'](_0xa19c('0xa'),util[_0xa19c('0xb')](_0xa19c('0xc'),_0x5d7e3e,_0x12bcc2,_0x1949c8));var _0x4edf71=_0x275ed9[_0xa19c('0xd')](_0x5bb7c3,_0xa19c('0xe'),_0xa19c('0xf'));_0x4edf71+=_0x275ed9['final']('utf8');var _0x495447=JSON['parse'](_0x4edf71);_0x495447['demo']=![];_0x495447[_0xa19c('0x10')]=_0x12bcc2;_0x495447['machineUuid']=hardware[_0xa19c('0x11')]();if(_0xc5b145){var _0x4e7c2b=crypto[_0xa19c('0x12')]('aes-256-ctr',config[_0xa19c('0x13')][_0xa19c('0x14')]);var _0x11d4f8=_0x4e7c2b['update'](_0xc5b145,_0xa19c('0xe'),_0xa19c('0xf'));_0x11d4f8+=_0x4e7c2b['final']('utf8');_0x495447[_0xa19c('0x15')]=_0x11d4f8;_0x495447[_0xa19c('0x16')]=moment(_0x11d4f8)[_0xa19c('0x17')](0x7,'days')[_0xa19c('0xb')]();_0x495447[_0xa19c('0x18')]=_0x495447[_0xa19c('0x10')]!=_0x495447[_0xa19c('0x19')]?_0xa19c('0x1a'):_0xa19c('0x1b');}return _0x495447;}catch(_0x29344f){return{'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xa19c('0x1c'),'chat':![],'mail':![],'fax':![],'messaging':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':'Breaking\x20license','uuid':_0x4a0368[_0xa19c('0x8')],'machineUuid':hardware['getUuid'](),'message':_0x29344f[_0xa19c('0x1d')],'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![]};}}return{'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xa19c('0x1c'),'chat':![],'mail':![],'fax':![],'messaging':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':'Demo\x20license','uuid':_0x4a0368[_0xa19c('0x8')],'machineUuid':hardware[_0xa19c('0x11')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![]};}exports[_0xa19c('0x1e')]=function(_0x576431){return db[_0xa19c('0x1f')][_0xa19c('0x20')](_[_0xa19c('0x21')](_0x576431,{'raw':!![],'where':{'id':0x1}}))[_0xa19c('0x22')](function(_0x5de0cc){return checkLicense(_0x5de0cc,null);});};exports[_0xa19c('0x23')]=checkLicense; \ No newline at end of file +var _0x4b7c=['isEmpty','data1','data2','format','%s:%s:%s','update','final','parse','demo','machineUuid','getUuid','createDecipher','aes-256-ctr','secrets','session','base64','utf8','gray','deadline','add','days','grayReason','changed','disabled','message','2027-01-01T00:00:00.000Z','Demo\x20license','getLicense','find','then','checkLicense','crypto','util','lodash','moment','../../mysqldb','license'];(function(_0x4b8244,_0x2787c0){var _0x3a13c3=function(_0x5bc798){while(--_0x5bc798){_0x4b8244['push'](_0x4b8244['shift']());}};_0x3a13c3(++_0x2787c0);}(_0x4b7c,0xd8));var _0xc4b7=function(_0x1e2ea1,_0x5ea58d){_0x1e2ea1=_0x1e2ea1-0x0;var _0x11bf13=_0x4b7c[_0x1e2ea1];return _0x11bf13;};'use strict';var crypto=require(_0xc4b7('0x0'));var util=require(_0xc4b7('0x1'));var _=require(_0xc4b7('0x2'));var moment=require(_0xc4b7('0x3'));var hardware=require('./hardware');var config=require('../environment');var db=require(_0xc4b7('0x4'))['db'];function checkLicense(_0x12a79b,_0x2f4d91){if(_0x12a79b){try{var _0x16042f=_0x2f4d91||_0x12a79b[_0xc4b7('0x5')];if(_[_0xc4b7('0x6')](_0x16042f)){throw new Error('License\x20key\x20value\x20not\x20found');}var _0xa7e7a2=_0x12a79b[_0xc4b7('0x7')];var _0x5ddfc5=_0x12a79b[_0xc4b7('0x8')];var _0x2c3ea3=_0xa7e7a2['split']('-')[0x4];var _0x4a5e1d=_0xa7e7a2['split']('-')[0x0];var _0x225563=crypto['createDecipher']('aes-256-ctr',util[_0xc4b7('0x9')](_0xc4b7('0xa'),_0x2c3ea3,_0xa7e7a2,_0x4a5e1d));var _0x50e7ca=_0x225563[_0xc4b7('0xb')](_0x16042f,'base64','utf8');_0x50e7ca+=_0x225563[_0xc4b7('0xc')]('utf8');var _0x4a0ac5=JSON[_0xc4b7('0xd')](_0x50e7ca);_0x4a0ac5[_0xc4b7('0xe')]=![];_0x4a0ac5['uuid']=_0xa7e7a2;_0x4a0ac5[_0xc4b7('0xf')]=hardware[_0xc4b7('0x10')]();if(_0x5ddfc5){var _0x187b04=crypto[_0xc4b7('0x11')](_0xc4b7('0x12'),config[_0xc4b7('0x13')][_0xc4b7('0x14')]);var _0x149f33=_0x187b04[_0xc4b7('0xb')](_0x5ddfc5,_0xc4b7('0x15'),_0xc4b7('0x16'));_0x149f33+=_0x187b04[_0xc4b7('0xc')](_0xc4b7('0x16'));_0x4a0ac5[_0xc4b7('0x17')]=_0x149f33;_0x4a0ac5[_0xc4b7('0x18')]=moment(_0x149f33)[_0xc4b7('0x19')](0x7,_0xc4b7('0x1a'))[_0xc4b7('0x9')]();_0x4a0ac5[_0xc4b7('0x1b')]=_0x4a0ac5['uuid']!=_0x4a0ac5[_0xc4b7('0xf')]?_0xc4b7('0x1c'):_0xc4b7('0x1d');}return _0x4a0ac5;}catch(_0x1a9528){return{'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':'2027-01-01T00:00:00.000Z','chat':![],'mail':![],'fax':![],'messaging':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':'Breaking\x20license','uuid':_0x12a79b[_0xc4b7('0x7')],'machineUuid':hardware[_0xc4b7('0x10')](),'message':_0x1a9528[_0xc4b7('0x1e')],'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![]};}}return{'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xc4b7('0x1f'),'chat':![],'mail':![],'fax':![],'messaging':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0xc4b7('0x20'),'uuid':_0x12a79b[_0xc4b7('0x7')],'machineUuid':hardware['getUuid'](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![]};}exports[_0xc4b7('0x21')]=function(_0x499bdb){return db['License'][_0xc4b7('0x22')](_['defaults'](_0x499bdb,{'raw':!![],'where':{'id':0x1}}))[_0xc4b7('0x23')](function(_0x2a59ac){return checkLicense(_0x2a59ac,null);});};exports[_0xc4b7('0x24')]=checkLicense; \ No newline at end of file diff --git a/server/config/local.env.js b/server/config/local.env.js index 023553a..1401016 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 _0xcbff=['app-id','secret','http://localhost:9000'];(function(_0x45639d,_0x64f894){var _0x3b2d16=function(_0x2b00ca){while(--_0x2b00ca){_0x45639d['push'](_0x45639d['shift']());}};_0x3b2d16(++_0x64f894);}(_0xcbff,0x188));var _0xfcbf=function(_0x4b6c5d,_0x3cbbdf){_0x4b6c5d=_0x4b6c5d-0x0;var _0x4e4d47=_0xcbff[_0x4b6c5d];return _0x4e4d47;};'use strict';module['exports']={'DOMAIN':_0xfcbf('0x0'),'SESSION_SECRET':'myappanuglar-secret','GOOGLE_ID':_0xfcbf('0x1'),'GOOGLE_SECRET':_0xfcbf('0x2'),'DEBUG':''}; \ No newline at end of file +var _0x110d=['secret','exports','http://localhost:9000','myappanuglar-secret','app-id'];(function(_0x550db9,_0x48bc78){var _0xf90940=function(_0xf4ffeb){while(--_0xf4ffeb){_0x550db9['push'](_0x550db9['shift']());}};_0xf90940(++_0x48bc78);}(_0x110d,0x17d));var _0xd110=function(_0x24d61f,_0x38cebb){_0x24d61f=_0x24d61f-0x0;var _0x29ae79=_0x110d[_0x24d61f];return _0x29ae79;};'use strict';module[_0xd110('0x0')]={'DOMAIN':_0xd110('0x1'),'SESSION_SECRET':_0xd110('0x2'),'GOOGLE_ID':_0xd110('0x3'),'GOOGLE_SECRET':_0xd110('0x4'),'DEBUG':''}; \ No newline at end of file diff --git a/server/config/logger.js b/server/config/logger.js index 0a6895b..c36821e 100644 --- a/server/config/logger.js +++ b/server/config/logger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x14cb=['log','xcally','format','%s-%s.log','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','level','toUpperCase','message','Logger','File','%s-%s','error','transports','info','debugLevel','moment','winston','util','path','INFO','/var'];(function(_0xdb9053,_0x110a32){var _0x214e1c=function(_0x1149e4){while(--_0x1149e4){_0xdb9053['push'](_0xdb9053['shift']());}};_0x214e1c(++_0x110a32);}(_0x14cb,0x15a));var _0xb14c=function(_0x383d72,_0x5295e7){_0x383d72=_0x383d72-0x0;var _0x2dadbb=_0x14cb[_0x383d72];return _0x2dadbb;};'use strict';var moment=require(_0xb14c('0x0'));var winston=require(_0xb14c('0x1'));var util=require(_0xb14c('0x2'));var path=require(_0xb14c('0x3'));var debugLevel=_0xb14c('0x4');function filename(_0x3a8322,_0x2cf0de){return path['join'](_0xb14c('0x5'),_0xb14c('0x6'),_0xb14c('0x7'),util[_0xb14c('0x8')](_0xb14c('0x9'),_0x3a8322,_0x2cf0de));}function formatter(_0x4d8cfa,_0x3e79f2){return util[_0xb14c('0x8')](_0xb14c('0xa'),moment()[_0xb14c('0x8')](_0xb14c('0xb')),_0x3e79f2[_0xb14c('0xc')][_0xb14c('0xd')](),_0x4d8cfa,_0x3e79f2[_0xb14c('0xe')]);}module['exports']=function(_0x3be432){return new winston[(_0xb14c('0xf'))]({'transports':[new winston['transports'][(_0xb14c('0x10'))]({'name':util[_0xb14c('0x8')](_0xb14c('0x11'),_0x3be432,_0xb14c('0x12')),'filename':filename(_0x3be432,_0xb14c('0x12')),'level':_0xb14c('0x12'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x120c7f){return formatter(_0x3be432,_0x120c7f);}}),new winston[(_0xb14c('0x13'))]['File']({'name':util['format'](_0xb14c('0x11'),_0x3be432,_0xb14c('0x14')),'filename':filename(_0x3be432,_0xb14c('0x14')),'level':_0xb14c('0x14'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x2a5afe){return formatter(_0x3be432,_0x2a5afe);}}),new winston[(_0xb14c('0x13'))]['Console']({'level':process['env'][_0xb14c('0x15')]||debugLevel,'json':![],'formatter':function(_0x3b1dd1){return formatter(_0x3be432,_0x3b1dd1);}})]});}; \ No newline at end of file +var _0xb046=['log','format','%s-%s.log','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','level','toUpperCase','message','Logger','transports','File','error','%s-%s','info','Console','debugLevel','moment','winston','util','path','INFO','join'];(function(_0x4e810a,_0x3451cf){var _0x11e8b=function(_0x14bb6f){while(--_0x14bb6f){_0x4e810a['push'](_0x4e810a['shift']());}};_0x11e8b(++_0x3451cf);}(_0xb046,0x7e));var _0x6b04=function(_0x47e549,_0x2e53d6){_0x47e549=_0x47e549-0x0;var _0x251374=_0xb046[_0x47e549];return _0x251374;};'use strict';var moment=require(_0x6b04('0x0'));var winston=require(_0x6b04('0x1'));var util=require(_0x6b04('0x2'));var path=require(_0x6b04('0x3'));var debugLevel=_0x6b04('0x4');function filename(_0x3f0190,_0x454c5d){return path[_0x6b04('0x5')]('/var',_0x6b04('0x6'),'xcally',util[_0x6b04('0x7')](_0x6b04('0x8'),_0x3f0190,_0x454c5d));}function formatter(_0x25bc68,_0x840b3e){return util[_0x6b04('0x7')](_0x6b04('0x9'),moment()['format'](_0x6b04('0xa')),_0x840b3e[_0x6b04('0xb')][_0x6b04('0xc')](),_0x25bc68,_0x840b3e[_0x6b04('0xd')]);}module['exports']=function(_0x5805fd){return new winston[(_0x6b04('0xe'))]({'transports':[new winston[(_0x6b04('0xf'))][(_0x6b04('0x10'))]({'name':util[_0x6b04('0x7')]('%s-%s',_0x5805fd,_0x6b04('0x11')),'filename':filename(_0x5805fd,_0x6b04('0x11')),'level':'error','json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x4cda35){return formatter(_0x5805fd,_0x4cda35);}}),new winston[(_0x6b04('0xf'))][(_0x6b04('0x10'))]({'name':util[_0x6b04('0x7')](_0x6b04('0x12'),_0x5805fd,'info'),'filename':filename(_0x5805fd,_0x6b04('0x13')),'level':_0x6b04('0x13'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x584370){return formatter(_0x5805fd,_0x584370);}}),new winston[(_0x6b04('0xf'))][(_0x6b04('0x14'))]({'level':process['env'][_0x6b04('0x15')]||debugLevel,'json':![],'formatter':function(_0x206ca8){return formatter(_0x5805fd,_0x206ca8);}})]});}; \ No newline at end of file diff --git a/server/config/pm2/config.js b/server/config/pm2/config.js index 4e86b89..51890c0 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 _0x99e9=['express','join','../../services/express/index.js','ami','../../services/ami/index.js','agi','email','../../services/email/index.js','routing','../../services/routing/index.js','../../services/xdr/index.js','exports'];(function(_0x3cbe1c,_0x4bcabd){var _0x5ee08b=function(_0x5c53e6){while(--_0x5c53e6){_0x3cbe1c['push'](_0x3cbe1c['shift']());}};_0x5ee08b(++_0x4bcabd);}(_0x99e9,0xb4));var _0x999e=function(_0x295a92,_0x7d70dc){_0x295a92=_0x295a92-0x0;var _0x3f5dac=_0x99e9[_0x295a92];return _0x3f5dac;};'use strict';var path=require('path');var os=require('os');var config={'apps':[{'name':_0x999e('0x0'),'script':path[_0x999e('0x1')](__dirname,_0x999e('0x2'))},{'name':_0x999e('0x3'),'script':path['join'](__dirname,_0x999e('0x4'))},{'name':_0x999e('0x5'),'script':path[_0x999e('0x1')](__dirname,'../../services/agi/index.js')},{'name':_0x999e('0x6'),'script':path['join'](__dirname,_0x999e('0x7'))},{'name':_0x999e('0x8'),'script':path[_0x999e('0x1')](__dirname,_0x999e('0x9'))},{'name':'xdr','script':path[_0x999e('0x1')](__dirname,_0x999e('0xa'))}]};module[_0x999e('0xb')]=config; \ No newline at end of file +var _0xfd28=['ami','../../services/ami/index.js','agi','email','../../services/email/index.js','routing','../../services/xdr/index.js','exports','express','join'];(function(_0x422905,_0x3bce3a){var _0x33dc6c=function(_0x4852c9){while(--_0x4852c9){_0x422905['push'](_0x422905['shift']());}};_0x33dc6c(++_0x3bce3a);}(_0xfd28,0x148));var _0x8fd2=function(_0x5581ba,_0x268887){_0x5581ba=_0x5581ba-0x0;var _0x1e927f=_0xfd28[_0x5581ba];return _0x1e927f;};'use strict';var path=require('path');var os=require('os');var config={'apps':[{'name':_0x8fd2('0x0'),'script':path[_0x8fd2('0x1')](__dirname,'../../services/express/index.js')},{'name':_0x8fd2('0x2'),'script':path['join'](__dirname,_0x8fd2('0x3'))},{'name':_0x8fd2('0x4'),'script':path[_0x8fd2('0x1')](__dirname,'../../services/agi/index.js')},{'name':_0x8fd2('0x5'),'script':path[_0x8fd2('0x1')](__dirname,_0x8fd2('0x6'))},{'name':_0x8fd2('0x7'),'script':path[_0x8fd2('0x1')](__dirname,'../../services/routing/index.js')},{'name':'xdr','script':path[_0x8fd2('0x1')](__dirname,_0x8fd2('0x8'))}]};module[_0x8fd2('0x9')]=config; \ No newline at end of file diff --git a/server/config/pm2/index.js b/server/config/pm2/index.js index d97f457..db7db37 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 _0x2706=['delete','dump','saved','bluebird','./config','connected','start','then','disconnect','stop','restart','list','describe'];(function(_0x4fbe6b,_0x167fab){var _0x39fba0=function(_0x3fa6a7){while(--_0x3fa6a7){_0x4fbe6b['push'](_0x4fbe6b['shift']());}};_0x39fba0(++_0x167fab);}(_0x2706,0x107));var _0x6270=function(_0x1e163a,_0x5e652a){_0x1e163a=_0x1e163a-0x0;var _0xcd07c4=_0x2706[_0x1e163a];return _0xcd07c4;};'use strict';var pm2=require('pm2');var BPromise=require(_0x6270('0x0'));var config=require(_0x6270('0x1'));function connect(){return new BPromise(function(_0x12cec4,_0x8d3e81){return pm2['connect'](function(_0x35989c){if(_0x35989c){return _0x8d3e81(_0x35989c);}return _0x12cec4(_0x6270('0x2'));});});};exports[_0x6270('0x3')]=function(_0x18fc1b){return connect()[_0x6270('0x4')](function(){return new BPromise(function(_0x2c9030,_0x1e770e){return pm2[_0x6270('0x3')](_0x18fc1b,function(_0x4fac3f,_0x4f700e){if(_0x4fac3f){return _0x1e770e(_0x4fac3f);}pm2[_0x6270('0x5')]();return _0x2c9030(_0x4f700e);});});});};exports['stop']=function(_0x35a6e3){return connect()[_0x6270('0x4')](function(){return new BPromise(function(_0x22b408,_0xea69a0){return pm2[_0x6270('0x6')](_0x35a6e3,function(_0x2764de,_0x5d2e8e){if(_0x2764de){return _0xea69a0(_0x2764de);}pm2[_0x6270('0x5')]();return _0x22b408(_0x5d2e8e);});});});};exports[_0x6270('0x7')]=function(_0x15dc65){return connect()[_0x6270('0x4')](function(){return new BPromise(function(_0x25537b,_0x52bd4c){return pm2['restart'](_0x15dc65,function(_0x229eb4,_0x124980){if(_0x229eb4){return _0x52bd4c(_0x229eb4);}pm2['disconnect']();return _0x25537b(_0x124980);});});});};exports['list']=function(){return connect()['then'](function(){return new BPromise(function(_0x1c466e,_0x4d739d){return pm2[_0x6270('0x8')](function(_0x49a384,_0x5de8e7){if(_0x49a384){return _0x4d739d(_0x49a384);}pm2['disconnect']();return _0x1c466e(_0x5de8e7);});});});};exports[_0x6270('0x9')]=function(_0x2a117f){return connect()[_0x6270('0x4')](function(){return new BPromise(function(_0x5336fd,_0x4b4904){return pm2[_0x6270('0x9')](_0x2a117f,function(_0x59af54,_0x26ceb9){if(_0x59af54){return _0x4b4904(_0x59af54);}pm2[_0x6270('0x5')]();return _0x5336fd(_0x26ceb9);});});});};exports[_0x6270('0xa')]=function(_0xcec42c){return connect()[_0x6270('0x4')](function(){return new BPromise(function(_0x5f1eb4,_0x3ba0f4){return pm2['delete'](_0xcec42c,function(_0x273478,_0x1f5f11){if(_0x273478){return _0x3ba0f4(_0x273478);}pm2[_0x6270('0x5')]();return _0x5f1eb4(_0x1f5f11);});});});};exports[_0x6270('0xb')]=function(){return connect()[_0x6270('0x4')](function(){return new BPromise(function(_0x1991d1,_0x1cb956){return pm2[_0x6270('0xb')](function(_0x1efa0a){if(_0x1efa0a){return _0x1cb956(_0x1efa0a);}return _0x1991d1(_0x6270('0xc'));});});});}; \ No newline at end of file +var _0x7217=['connect','then','start','disconnect','stop','restart','list','describe','delete','dump','saved','pm2','./config'];(function(_0x40febc,_0x3225b0){var _0x4fb35f=function(_0x2464ec){while(--_0x2464ec){_0x40febc['push'](_0x40febc['shift']());}};_0x4fb35f(++_0x3225b0);}(_0x7217,0x19e));var _0x7721=function(_0x45e98e,_0x169b60){_0x45e98e=_0x45e98e-0x0;var _0x374dba=_0x7217[_0x45e98e];return _0x374dba;};'use strict';var pm2=require(_0x7721('0x0'));var BPromise=require('bluebird');var config=require(_0x7721('0x1'));function connect(){return new BPromise(function(_0x4170dd,_0x1de988){return pm2[_0x7721('0x2')](function(_0x115ab3){if(_0x115ab3){return _0x1de988(_0x115ab3);}return _0x4170dd('connected');});});};exports['start']=function(_0x472a96){return connect()[_0x7721('0x3')](function(){return new BPromise(function(_0x46415c,_0x3fe47c){return pm2[_0x7721('0x4')](_0x472a96,function(_0xf7ff37,_0x18ab6b){if(_0xf7ff37){return _0x3fe47c(_0xf7ff37);}pm2[_0x7721('0x5')]();return _0x46415c(_0x18ab6b);});});});};exports[_0x7721('0x6')]=function(_0x2f99ed){return connect()[_0x7721('0x3')](function(){return new BPromise(function(_0x2a66cb,_0xfa8835){return pm2[_0x7721('0x6')](_0x2f99ed,function(_0x2c3986,_0x578d59){if(_0x2c3986){return _0xfa8835(_0x2c3986);}pm2[_0x7721('0x5')]();return _0x2a66cb(_0x578d59);});});});};exports[_0x7721('0x7')]=function(_0x8729a6){return connect()[_0x7721('0x3')](function(){return new BPromise(function(_0xa8977c,_0x409b37){return pm2[_0x7721('0x7')](_0x8729a6,function(_0x27b36b,_0x55b4ca){if(_0x27b36b){return _0x409b37(_0x27b36b);}pm2[_0x7721('0x5')]();return _0xa8977c(_0x55b4ca);});});});};exports[_0x7721('0x8')]=function(){return connect()['then'](function(){return new BPromise(function(_0x109900,_0x30da54){return pm2[_0x7721('0x8')](function(_0x2e9752,_0x5069da){if(_0x2e9752){return _0x30da54(_0x2e9752);}pm2[_0x7721('0x5')]();return _0x109900(_0x5069da);});});});};exports[_0x7721('0x9')]=function(_0x534f1b){return connect()['then'](function(){return new BPromise(function(_0x4b183e,_0x5ed54){return pm2[_0x7721('0x9')](_0x534f1b,function(_0x3cc909,_0x32550d){if(_0x3cc909){return _0x5ed54(_0x3cc909);}pm2['disconnect']();return _0x4b183e(_0x32550d);});});});};exports[_0x7721('0xa')]=function(_0x54a838){return connect()[_0x7721('0x3')](function(){return new BPromise(function(_0x5cb0e6,_0xfec626){return pm2[_0x7721('0xa')](_0x54a838,function(_0x3ab5a5,_0x3e140d){if(_0x3ab5a5){return _0xfec626(_0x3ab5a5);}pm2[_0x7721('0x5')]();return _0x5cb0e6(_0x3e140d);});});});};exports[_0x7721('0xb')]=function(){return connect()[_0x7721('0x3')](function(){return new BPromise(function(_0x413263,_0x3b29ac){return pm2[_0x7721('0xb')](function(_0x4ce1db){if(_0x4ce1db){return _0x3b29ac(_0x4ce1db);}return _0x413263(_0x7721('0xc'));});});});}; \ No newline at end of file diff --git a/server/config/schedule/chat.js b/server/config/schedule/chat.js index d06ef8e..b14c615 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 _0xc3b5=['format','length','chatInteraction:update','catch','error','start','moment','../../mysqldb','../../config/environment','redis','localhost','Setting','chatTimeout','then','ChatInteraction','findAll','lastMsgAt','minutes','update'];(function(_0x54fd7c,_0x28dbac){var _0x4d0cd6=function(_0x44fb7e){while(--_0x44fb7e){_0x54fd7c['push'](_0x54fd7c['shift']());}};_0x4d0cd6(++_0x28dbac);}(_0xc3b5,0xb1));var _0x5c3b=function(_0x7a2464,_0x2c47c2){_0x7a2464=_0x7a2464-0x0;var _0x2a03de=_0xc3b5[_0x7a2464];return _0x2a03de;};'use strict';var _=require('lodash');var moment=require(_0x5c3b('0x0'));var Redis=require('ioredis');var db=require(_0x5c3b('0x1'))['db'];var config=require(_0x5c3b('0x2'));config[_0x5c3b('0x3')]=_['defaults'](config[_0x5c3b('0x3')],{'host':_0x5c3b('0x4'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x5c3b('0x3')]));function closeInteractions(){var _0x4a49f5=0x0;var _0x5d73a0=[];return db[_0x5c3b('0x5')]['find']({'raw':!![],'attributes':['id',_0x5c3b('0x6')],'where':{'id':0x1}})[_0x5c3b('0x7')](function(_0x574a87){_0x4a49f5=_0x574a87['chatTimeout'];if(_0x4a49f5){return db[_0x5c3b('0x8')][_0x5c3b('0x9')]({'raw':!![],'attributes':['id',_0x5c3b('0xa')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()['subtract'](_0x574a87[_0x5c3b('0x6')],_0x5c3b('0xb'))}}});}else{return[];}})[_0x5c3b('0x7')](function(_0x33319a){_0x5d73a0=_0x33319a;if(_0x4a49f5){return db[_0x5c3b('0x8')][_0x5c3b('0xc')]({'closeReason':'system','disposition':'timeout','closed':!![],'closedAt':moment()[_0x5c3b('0xd')]('YYYY-MM-DD\x20HH:mm:ss')},{'where':{'id':_['map'](_0x5d73a0||[],'id')}});}})[_0x5c3b('0x7')](function(_0x3c07b5){for(var _0x59cb0b=0x0;_0x59cb0b<_0x5d73a0[_0x5c3b('0xe')];_0x59cb0b++){io['emit'](_0x5c3b('0xf'),{'id':_0x5d73a0[_0x59cb0b]['id'],'closed':!![]});}})[_0x5c3b('0x10')](function(_0x506ef5){console[_0x5c3b('0x11')](_0x506ef5);});}exports[_0x5c3b('0x12')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0xd23f=['then','ChatInteraction','findAll','lastMsgAt','minutes','system','timeout','YYYY-MM-DD\x20HH:mm:ss','map','length','emit','chatInteraction:update','error','start','lodash','moment','ioredis','../../config/environment','redis','defaults','find','chatTimeout'];(function(_0x47df83,_0x4db94d){var _0x1c4224=function(_0x1f6f4b){while(--_0x1f6f4b){_0x47df83['push'](_0x47df83['shift']());}};_0x1c4224(++_0x4db94d);}(_0xd23f,0x1b0));var _0xfd23=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xd23f[_0x432682];return _0x463d05;};'use strict';var _=require(_0xfd23('0x0'));var moment=require(_0xfd23('0x1'));var Redis=require(_0xfd23('0x2'));var db=require('../../mysqldb')['db'];var config=require(_0xfd23('0x3'));config[_0xfd23('0x4')]=_[_0xfd23('0x5')](config[_0xfd23('0x4')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xfd23('0x4')]));function closeInteractions(){var _0x51891e=0x0;var _0x4dfcd8=[];return db['Setting'][_0xfd23('0x6')]({'raw':!![],'attributes':['id',_0xfd23('0x7')],'where':{'id':0x1}})[_0xfd23('0x8')](function(_0x1f3f0f){_0x51891e=_0x1f3f0f[_0xfd23('0x7')];if(_0x51891e){return db[_0xfd23('0x9')][_0xfd23('0xa')]({'raw':!![],'attributes':['id',_0xfd23('0xb')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()['subtract'](_0x1f3f0f['chatTimeout'],_0xfd23('0xc'))}}});}else{return[];}})['then'](function(_0x1dcffd){_0x4dfcd8=_0x1dcffd;if(_0x51891e){return db[_0xfd23('0x9')]['update']({'closeReason':_0xfd23('0xd'),'disposition':_0xfd23('0xe'),'closed':!![],'closedAt':moment()['format'](_0xfd23('0xf'))},{'where':{'id':_[_0xfd23('0x10')](_0x4dfcd8||[],'id')}});}})[_0xfd23('0x8')](function(_0x34007f){for(var _0x35b899=0x0;_0x35b899<_0x4dfcd8[_0xfd23('0x11')];_0x35b899++){io[_0xfd23('0x12')](_0xfd23('0x13'),{'id':_0x4dfcd8[_0x35b899]['id'],'closed':!![]});}})['catch'](function(_0x3c73bd){console[_0xfd23('0x14')](_0x3c73bd);});}exports[_0xfd23('0x15')]=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 4a3f94f..76f9b56 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 _0xf98d=['add\x20cron','stop\x20cron','startAt','endAt','update','update\x20cron','run','util','path','moment','cron-job-manager','bluebird','../logger','schedule','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','http','info','Try\x20to\x20send\x20a\x20mail\x20to','email','MailAccount','Smtp','service','host','port','secure','auth','user','pass','format','\x22%s\x22\x20<%s>','Report\x20%s\x20last\x20%s\x20%s','join','../../files/reports','savename','%s.%s','zip','existsSync','status','Sent','message','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','attachments','text','sendIfEmpty','empty\x20file,\x20email\x20not\x20sent','SendMail','then','error','error\x20mail','catch','stringify','data','isNil','subtractNumber','subtractNumber\x20null\x20or\x20undefined','subtractUnit','subtractUnit\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','DefaultReportId','exec\x20defaul\x20report\x20id:%s','runReport','CustomReportId','exec\x20custom\x20report\x20id:%s','Schedule','MailServerOut','keys','jobs','map','difference','length','toString','exists','stop','deleteJob','delete\x20cron','toRun','index','resolve','run\x20job','name','cron','isBetween','add','start'];(function(_0x32350e,_0xc721d7){var _0x2bf075=function(_0x308582){while(--_0x308582){_0x32350e['push'](_0x32350e['shift']());}};_0x2bf075(++_0xc721d7);}(_0xf98d,0x1b5));var _0xdf98=function(_0x2fce26,_0x4654a4){_0x2fce26=_0x2fce26-0x0;var _0x105382=_0xf98d[_0x2fce26];return _0x105382;};'use strict';var fs=require('fs');var util=require(_0xdf98('0x0'));var path=require(_0xdf98('0x1'));var _=require('lodash');var moment=require(_0xdf98('0x2'));var CronJobManager=require(_0xdf98('0x3'));var jayson=require('jayson/promise');var BPromise=require(_0xdf98('0x4'));var logger=require(_0xdf98('0x5'))(_0xdf98('0x6'));var db=require('../../mysqldb')['db'];var analyticCustomReportController=require('../../api/analyticCustomReport/analyticCustomReport.controller');var analyticDefaultReportController=require(_0xdf98('0x7'));var client=jayson[_0xdf98('0x8')][_0xdf98('0x9')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x236dbd,_0xb18338){return function(){logger[_0xdf98('0xa')](_0xdf98('0xb'),_0x236dbd[_0xdf98('0xc')]);var _0x39804e=!![];var _0x42beab={'tls':{'rejectUnauthorized':![]}};if(_0x236dbd[_0xdf98('0xd')][_0xdf98('0xe')][_0xdf98('0xf')]){_0x42beab['service']=_0x236dbd[_0xdf98('0xd')][_0xdf98('0xe')]['service'];}else{_0x42beab[_0xdf98('0x10')]=_0x236dbd[_0xdf98('0xd')]['Smtp']['host'];_0x42beab[_0xdf98('0x11')]=_0x236dbd['MailAccount'][_0xdf98('0xe')][_0xdf98('0x11')];_0x42beab[_0xdf98('0x12')]=_0x236dbd[_0xdf98('0xd')][_0xdf98('0xe')][_0xdf98('0x12')];}if(_0x236dbd[_0xdf98('0xd')][_0xdf98('0xe')]['authentication']){_0x42beab[_0xdf98('0x13')]={'user':_0x236dbd[_0xdf98('0xd')]['Smtp'][_0xdf98('0x14')],'pass':_0x236dbd[_0xdf98('0xd')]['Smtp'][_0xdf98('0x15')]};}var _0x5d5c98={'account':_0x42beab,'message':{'from':util[_0xdf98('0x16')](_0xdf98('0x17'),_0x236dbd[_0xdf98('0xd')]['name'],_0x236dbd['MailAccount'][_0xdf98('0xc')]||_0x236dbd[_0xdf98('0xd')][_0xdf98('0xe')][_0xdf98('0x14')]),'to':_0x236dbd[_0xdf98('0xc')],'cc':_0x236dbd['cc'],'bcc':_0x236dbd['bcc'],'subject':util['format'](_0xdf98('0x18'),_0xb18338['name'],_0x236dbd['subtractNumber'],_0x236dbd['subtractUnit'])}};var _0x43845c=path[_0xdf98('0x19')](__dirname,_0xdf98('0x1a'));var _0x2d80c9=_0xb18338[_0xdf98('0x1b')];var _0x21de01=util['format'](_0xdf98('0x1c'),path['basename'](_0xb18338[_0xdf98('0x1b')],path['extname'](_0xb18338[_0xdf98('0x1b')])),_0xdf98('0x1d'));var _0x281c87=path['join'](_0x43845c,_0x2d80c9);var _0x397127=path[_0xdf98('0x19')](_0x43845c,_0x21de01);if(fs[_0xdf98('0x1e')](_0x281c87)){_0xb18338[_0xdf98('0x1f')]=_0xdf98('0x20');_0x5d5c98[_0xdf98('0x21')]['attachments']=[{'filename':_0x2d80c9,'path':_0x281c87}];_0x5d5c98[_0xdf98('0x21')]['text']=util['format'](_0xdf98('0x22'),JSON['stringify'](_0xb18338,null,0x2));}else if(fs[_0xdf98('0x1e')](_0x397127)){_0xb18338['status']=_0xdf98('0x20');_0x5d5c98['message'][_0xdf98('0x23')]=[{'filename':_0x21de01,'path':_0x397127}];}else{_0x5d5c98[_0xdf98('0x21')][_0xdf98('0x24')]='Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a';if(!_0x236dbd[_0xdf98('0x25')]){_0x39804e=![];logger[_0xdf98('0xa')](_0xdf98('0x26'));}}if(_0x39804e){return client['request'](_0xdf98('0x27'),_0x5d5c98)[_0xdf98('0x28')](function(_0x15ffbd){if(_0x15ffbd['error']){return logger[_0xdf98('0x29')](_0xdf98('0x2a'),JSON['stringify'](_0x15ffbd));}return logger['info']('email\x20sent');})[_0xdf98('0x2b')](function(_0x5b60a5){return logger[_0xdf98('0x29')](_0xdf98('0x2a'),JSON['stringify'](_0x5b60a5));});}};}function handleError(){return function(_0x5e9b5d){return logger[_0xdf98('0x29')](JSON[_0xdf98('0x2c')](_0x5e9b5d));};}function handleResult(_0x25874b){return function(_0x136300){logger[_0xdf98('0xa')](_0xdf98('0x2d'),JSON[_0xdf98('0x2c')](_0x136300));if(_0x25874b[_0xdf98('0xd')]&&_0x25874b[_0xdf98('0xd')][_0xdf98('0xe')]&&!_[_0xdf98('0x2e')](_0x25874b['email'])){setTimeout(handleSendEmail(_0x25874b,_0x136300),0x3c*0x3e8);}};}function handleJob(_0x3d4ed5){return function(){try{if(_['isNil'](_0x3d4ed5[_0xdf98('0x2f')])){return logger['info'](_0xdf98('0x30'));}if(_[_0xdf98('0x2e')](_0x3d4ed5[_0xdf98('0x31')])){return logger[_0xdf98('0xa')](_0xdf98('0x32'));}var _0x1e2306={'startDate':moment()[_0xdf98('0x33')](_0x3d4ed5['subtractNumber'],_0x3d4ed5[_0xdf98('0x31')])[_0xdf98('0x16')](_0xdf98('0x34')),'endDate':moment()[_0xdf98('0x16')](_0xdf98('0x34')),'type':'scheduled','output':_0x3d4ed5['output'],'name':_0x3d4ed5['name']};if(!_[_0xdf98('0x2e')](_0x3d4ed5[_0xdf98('0x35')])){logger['info'](_0xdf98('0x36'),_0x3d4ed5[_0xdf98('0x35')]);return analyticDefaultReportController[_0xdf98('0x37')]({'id':_0x3d4ed5[_0xdf98('0x35')]},_0x1e2306)['then'](handleResult(_0x3d4ed5))[_0xdf98('0x2b')](handleError());}if(!_[_0xdf98('0x2e')](_0x3d4ed5[_0xdf98('0x38')])){logger[_0xdf98('0xa')](_0xdf98('0x39'),_0x3d4ed5[_0xdf98('0x38')]);return analyticCustomReportController[_0xdf98('0x37')]({'id':_0x3d4ed5[_0xdf98('0x38')]},_0x1e2306)[_0xdf98('0x28')](handleResult(_0x3d4ed5))[_0xdf98('0x2b')](handleError());}}catch(_0x22620e){logger[_0xdf98('0x29')](JSON[_0xdf98('0x2c')](_0x22620e));}return logger[_0xdf98('0xa')]('no\x20report\x20id');};}function getJobs(_0x9bd4b){var _0x565467={};if(_0x9bd4b){_0x565467['id']=_0x9bd4b;}return db[_0xdf98('0x3a')]['findAll']({'where':_0x565467,'include':[{'model':db['MailAccount'],'attributes':['id','name',_0xdf98('0xc')],'include':[{'model':db[_0xdf98('0x3b')],'as':_0xdf98('0xe')}]}]})[_0xdf98('0x28')](function(_0x1771c5){var _0x506efd=_[_0xdf98('0x3c')](manager[_0xdf98('0x3d')]);var _0x1695ce=_[_0xdf98('0x3e')](_0x1771c5,function(_0x52c290){return _0x52c290['id']['toString']();});var _0x862a9a=_['keyBy'](_0x1771c5,function(_0x1a41c0){return _0x1a41c0['id']['toString']();});var _0xf05989=_0x9bd4b?_0x1695ce:_[_0xdf98('0x3f')](_0x1695ce,_0x506efd);var _0x4c35f4=_['intersection'](_0x1695ce,_0x506efd);var _0x37338a=_[_0xdf98('0x3f')](_0x506efd,_0x1695ce);var _0x11fb01;var _0x1387e1;for(_0x11fb01=0x0;_0x11fb01<_0x37338a[_0xdf98('0x40')]&&!_0x9bd4b;_0x11fb01+=0x1){_0x1387e1=_0x37338a[_0x11fb01][_0xdf98('0x41')]();if(manager[_0xdf98('0x42')](_0x1387e1)){manager[_0xdf98('0x43')](_0x1387e1);manager[_0xdf98('0x44')](_0x1387e1);logger[_0xdf98('0xa')](_0xdf98('0x45'),_0x1387e1);}}logger[_0xdf98('0xa')](_0xdf98('0x46'),JSON[_0xdf98('0x2c')](_0xf05989));for(_0x11fb01=0x0;_0x11fb01<_0xf05989[_0xdf98('0x40')];_0x11fb01+=0x1){_0x1387e1=_0xf05989[_0x11fb01][_0xdf98('0x41')]();logger[_0xdf98('0xa')](_0xdf98('0x47'),_0x1387e1);if(_0x9bd4b){logger[_0xdf98('0xa')]('my\x20id',_0x9bd4b);logger[_0xdf98('0xa')](JSON['stringify'](_0x862a9a[_0x1387e1]));BPromise[_0xdf98('0x48')]()['then'](handleJob(_0x862a9a[_0x1387e1]));logger['info'](_0xdf98('0x49'),_0x862a9a[_0x1387e1][_0xdf98('0x4a')],_0x862a9a[_0x1387e1][_0xdf98('0x4b')]);}else if(_0x862a9a[_0x1387e1][_0xdf98('0x4b')]&&_0x862a9a[_0x1387e1]['active']&&moment()[_0xdf98('0x4c')](_0x862a9a[_0x1387e1]['startAt'],_0x862a9a[_0x1387e1]['endAt'])){manager[_0xdf98('0x4d')](_0x1387e1,_0x862a9a[_0x1387e1][_0xdf98('0x4b')],handleJob(_0x862a9a[_0x1387e1]));manager[_0xdf98('0x4e')](_0x1387e1);logger[_0xdf98('0xa')](_0xdf98('0x4f'),_0x862a9a[_0x1387e1][_0xdf98('0x4a')],_0x862a9a[_0x1387e1][_0xdf98('0x4b')]);}else if(manager[_0xdf98('0x42')](_0x1387e1)){manager[_0xdf98('0x43')](_0x1387e1);manager[_0xdf98('0x44')](_0x1387e1);logger[_0xdf98('0xa')](_0xdf98('0x50'),_0x862a9a[_0x1387e1][_0xdf98('0x4a')],_0x862a9a[_0x1387e1][_0xdf98('0x4b')]);}}for(_0x11fb01=0x0,_0x1387e1;_0x11fb01<_0x4c35f4[_0xdf98('0x40')]&&!_0x9bd4b;_0x11fb01+=0x1){_0x1387e1=_0x4c35f4[_0x11fb01][_0xdf98('0x41')]();if(manager[_0xdf98('0x42')](_0x1387e1)){if(_0x862a9a[_0x1387e1][_0xdf98('0x4b')]&&_0x862a9a[_0x1387e1]['active']&&moment()['isBetween'](_0x862a9a[_0x1387e1][_0xdf98('0x51')],_0x862a9a[_0x1387e1][_0xdf98('0x52')])){manager[_0xdf98('0x53')](_0x1387e1,_0x862a9a[_0x1387e1]['cron'],handleJob(_0x862a9a[_0x1387e1]));logger[_0xdf98('0xa')](_0xdf98('0x54'),_0x862a9a[_0x1387e1][_0xdf98('0x4a')],_0x862a9a[_0x1387e1][_0xdf98('0x4b')]);}else{manager[_0xdf98('0x43')](_0x1387e1);manager[_0xdf98('0x44')](_0x1387e1);logger['info'](_0xdf98('0x50'),_0x862a9a[_0x1387e1]['name'],_0x862a9a[_0x1387e1][_0xdf98('0x4b')]);}}}})['catch'](function(_0x1a8124){logger['error'](JSON['stringify'](_0x1a8124));});}exports[_0xdf98('0x55')]=function(_0x345655){return getJobs(_0x345655);};exports['start']=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file +var _0x1ce2=['../logger','schedule','../../api/analyticCustomReport/analyticCustomReport.controller','http','info','email','MailAccount','Smtp','service','host','port','secure','authentication','auth','user','pass','format','Report\x20%s\x20last\x20%s\x20%s','name','subtractUnit','join','../../files/reports','savename','%s.%s','basename','zip','status','Sent','message','text','stringify','existsSync','attachments','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','sendIfEmpty','empty\x20file,\x20email\x20not\x20sent','request','then','error','error\x20mail','email\x20sent','data','isNil','subtractNumber\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','scheduled','output','DefaultReportId','exec\x20defaul\x20report\x20id:%s','runReport','catch','CustomReportId','exec\x20custom\x20report\x20id:%s','no\x20report\x20id','Schedule','findAll','MailServerOut','keys','jobs','map','keyBy','toString','difference','intersection','length','stop','deleteJob','delete\x20cron','toRun','index','my\x20id','resolve','run\x20job','cron','active','add','start','add\x20cron','exists','stop\x20cron','isBetween','startAt','endAt','update\x20cron','run','path','lodash','moment','cron-job-manager','jayson/promise','bluebird'];(function(_0x269764,_0x58028d){var _0x2c212e=function(_0x539145){while(--_0x539145){_0x269764['push'](_0x269764['shift']());}};_0x2c212e(++_0x58028d);}(_0x1ce2,0xb2));var _0x21ce=function(_0x200b8f,_0x22e0a5){_0x200b8f=_0x200b8f-0x0;var _0x9ce1b3=_0x1ce2[_0x200b8f];return _0x9ce1b3;};'use strict';var fs=require('fs');var util=require('util');var path=require(_0x21ce('0x0'));var _=require(_0x21ce('0x1'));var moment=require(_0x21ce('0x2'));var CronJobManager=require(_0x21ce('0x3'));var jayson=require(_0x21ce('0x4'));var BPromise=require(_0x21ce('0x5'));var logger=require(_0x21ce('0x6'))(_0x21ce('0x7'));var db=require('../../mysqldb')['db'];var analyticCustomReportController=require(_0x21ce('0x8'));var analyticDefaultReportController=require('../../api/analyticDefaultReport/analyticDefaultReport.controller');var client=jayson['client'][_0x21ce('0x9')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0xd2181c,_0x135a44){return function(){logger[_0x21ce('0xa')]('Try\x20to\x20send\x20a\x20mail\x20to',_0xd2181c[_0x21ce('0xb')]);var _0x1389bf=!![];var _0x38d481={'tls':{'rejectUnauthorized':![]}};if(_0xd2181c[_0x21ce('0xc')][_0x21ce('0xd')][_0x21ce('0xe')]){_0x38d481[_0x21ce('0xe')]=_0xd2181c[_0x21ce('0xc')][_0x21ce('0xd')][_0x21ce('0xe')];}else{_0x38d481[_0x21ce('0xf')]=_0xd2181c[_0x21ce('0xc')]['Smtp'][_0x21ce('0xf')];_0x38d481[_0x21ce('0x10')]=_0xd2181c[_0x21ce('0xc')][_0x21ce('0xd')]['port'];_0x38d481[_0x21ce('0x11')]=_0xd2181c[_0x21ce('0xc')][_0x21ce('0xd')]['secure'];}if(_0xd2181c[_0x21ce('0xc')]['Smtp'][_0x21ce('0x12')]){_0x38d481[_0x21ce('0x13')]={'user':_0xd2181c[_0x21ce('0xc')]['Smtp'][_0x21ce('0x14')],'pass':_0xd2181c[_0x21ce('0xc')][_0x21ce('0xd')][_0x21ce('0x15')]};}var _0xf6b918={'account':_0x38d481,'message':{'from':util[_0x21ce('0x16')]('\x22%s\x22\x20<%s>',_0xd2181c[_0x21ce('0xc')]['name'],_0xd2181c[_0x21ce('0xc')][_0x21ce('0xb')]||_0xd2181c[_0x21ce('0xc')][_0x21ce('0xd')][_0x21ce('0x14')]),'to':_0xd2181c[_0x21ce('0xb')],'cc':_0xd2181c['cc'],'bcc':_0xd2181c['bcc'],'subject':util['format'](_0x21ce('0x17'),_0x135a44[_0x21ce('0x18')],_0xd2181c['subtractNumber'],_0xd2181c[_0x21ce('0x19')])}};var _0x3a8547=path[_0x21ce('0x1a')](__dirname,_0x21ce('0x1b'));var _0x4b419d=_0x135a44[_0x21ce('0x1c')];var _0x1e0c14=util[_0x21ce('0x16')](_0x21ce('0x1d'),path[_0x21ce('0x1e')](_0x135a44[_0x21ce('0x1c')],path['extname'](_0x135a44['savename'])),_0x21ce('0x1f'));var _0x1a654e=path[_0x21ce('0x1a')](_0x3a8547,_0x4b419d);var _0x56cfc1=path[_0x21ce('0x1a')](_0x3a8547,_0x1e0c14);if(fs['existsSync'](_0x1a654e)){_0x135a44[_0x21ce('0x20')]=_0x21ce('0x21');_0xf6b918['message']['attachments']=[{'filename':_0x4b419d,'path':_0x1a654e}];_0xf6b918[_0x21ce('0x22')][_0x21ce('0x23')]=util[_0x21ce('0x16')]('Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a',JSON[_0x21ce('0x24')](_0x135a44,null,0x2));}else if(fs[_0x21ce('0x25')](_0x56cfc1)){_0x135a44[_0x21ce('0x20')]=_0x21ce('0x21');_0xf6b918[_0x21ce('0x22')][_0x21ce('0x26')]=[{'filename':_0x1e0c14,'path':_0x56cfc1}];}else{_0xf6b918[_0x21ce('0x22')][_0x21ce('0x23')]=_0x21ce('0x27');if(!_0xd2181c[_0x21ce('0x28')]){_0x1389bf=![];logger[_0x21ce('0xa')](_0x21ce('0x29'));}}if(_0x1389bf){return client[_0x21ce('0x2a')]('SendMail',_0xf6b918)[_0x21ce('0x2b')](function(_0x43bb70){if(_0x43bb70[_0x21ce('0x2c')]){return logger[_0x21ce('0x2c')](_0x21ce('0x2d'),JSON[_0x21ce('0x24')](_0x43bb70));}return logger[_0x21ce('0xa')](_0x21ce('0x2e'));})['catch'](function(_0x66cd8a){return logger[_0x21ce('0x2c')](_0x21ce('0x2d'),JSON['stringify'](_0x66cd8a));});}};}function handleError(){return function(_0x24b6d3){return logger[_0x21ce('0x2c')](JSON[_0x21ce('0x24')](_0x24b6d3));};}function handleResult(_0x18cdcf){return function(_0x234679){logger[_0x21ce('0xa')](_0x21ce('0x2f'),JSON[_0x21ce('0x24')](_0x234679));if(_0x18cdcf[_0x21ce('0xc')]&&_0x18cdcf[_0x21ce('0xc')][_0x21ce('0xd')]&&!_[_0x21ce('0x30')](_0x18cdcf['email'])){setTimeout(handleSendEmail(_0x18cdcf,_0x234679),0x3c*0x3e8);}};}function handleJob(_0x46503e){return function(){try{if(_[_0x21ce('0x30')](_0x46503e['subtractNumber'])){return logger[_0x21ce('0xa')](_0x21ce('0x31'));}if(_[_0x21ce('0x30')](_0x46503e[_0x21ce('0x19')])){return logger[_0x21ce('0xa')]('subtractUnit\x20null\x20or\x20undefined');}var _0x282072={'startDate':moment()[_0x21ce('0x32')](_0x46503e['subtractNumber'],_0x46503e[_0x21ce('0x19')])['format'](_0x21ce('0x33')),'endDate':moment()[_0x21ce('0x16')](_0x21ce('0x33')),'type':_0x21ce('0x34'),'output':_0x46503e[_0x21ce('0x35')],'name':_0x46503e[_0x21ce('0x18')]};if(!_[_0x21ce('0x30')](_0x46503e[_0x21ce('0x36')])){logger[_0x21ce('0xa')](_0x21ce('0x37'),_0x46503e[_0x21ce('0x36')]);return analyticDefaultReportController[_0x21ce('0x38')]({'id':_0x46503e['DefaultReportId']},_0x282072)[_0x21ce('0x2b')](handleResult(_0x46503e))[_0x21ce('0x39')](handleError());}if(!_[_0x21ce('0x30')](_0x46503e[_0x21ce('0x3a')])){logger[_0x21ce('0xa')](_0x21ce('0x3b'),_0x46503e[_0x21ce('0x3a')]);return analyticCustomReportController[_0x21ce('0x38')]({'id':_0x46503e['CustomReportId']},_0x282072)['then'](handleResult(_0x46503e))[_0x21ce('0x39')](handleError());}}catch(_0x3c39da){logger[_0x21ce('0x2c')](JSON[_0x21ce('0x24')](_0x3c39da));}return logger['info'](_0x21ce('0x3c'));};}function getJobs(_0x2c8534){var _0x54c973={};if(_0x2c8534){_0x54c973['id']=_0x2c8534;}return db[_0x21ce('0x3d')][_0x21ce('0x3e')]({'where':_0x54c973,'include':[{'model':db[_0x21ce('0xc')],'attributes':['id','name','email'],'include':[{'model':db[_0x21ce('0x3f')],'as':_0x21ce('0xd')}]}]})['then'](function(_0x2a8b43){var _0x29171f=_[_0x21ce('0x40')](manager[_0x21ce('0x41')]);var _0x4b3f7c=_[_0x21ce('0x42')](_0x2a8b43,function(_0x3425d7){return _0x3425d7['id']['toString']();});var _0x1d5f72=_[_0x21ce('0x43')](_0x2a8b43,function(_0x1b117a){return _0x1b117a['id'][_0x21ce('0x44')]();});var _0x5c11ce=_0x2c8534?_0x4b3f7c:_[_0x21ce('0x45')](_0x4b3f7c,_0x29171f);var _0x47b35b=_[_0x21ce('0x46')](_0x4b3f7c,_0x29171f);var _0x4bc96e=_[_0x21ce('0x45')](_0x29171f,_0x4b3f7c);var _0x4129c1;var _0x107930;for(_0x4129c1=0x0;_0x4129c1<_0x4bc96e[_0x21ce('0x47')]&&!_0x2c8534;_0x4129c1+=0x1){_0x107930=_0x4bc96e[_0x4129c1][_0x21ce('0x44')]();if(manager['exists'](_0x107930)){manager[_0x21ce('0x48')](_0x107930);manager[_0x21ce('0x49')](_0x107930);logger['info'](_0x21ce('0x4a'),_0x107930);}}logger[_0x21ce('0xa')](_0x21ce('0x4b'),JSON[_0x21ce('0x24')](_0x5c11ce));for(_0x4129c1=0x0;_0x4129c1<_0x5c11ce[_0x21ce('0x47')];_0x4129c1+=0x1){_0x107930=_0x5c11ce[_0x4129c1][_0x21ce('0x44')]();logger[_0x21ce('0xa')](_0x21ce('0x4c'),_0x107930);if(_0x2c8534){logger[_0x21ce('0xa')](_0x21ce('0x4d'),_0x2c8534);logger[_0x21ce('0xa')](JSON[_0x21ce('0x24')](_0x1d5f72[_0x107930]));BPromise[_0x21ce('0x4e')]()[_0x21ce('0x2b')](handleJob(_0x1d5f72[_0x107930]));logger['info'](_0x21ce('0x4f'),_0x1d5f72[_0x107930][_0x21ce('0x18')],_0x1d5f72[_0x107930][_0x21ce('0x50')]);}else if(_0x1d5f72[_0x107930][_0x21ce('0x50')]&&_0x1d5f72[_0x107930][_0x21ce('0x51')]&&moment()['isBetween'](_0x1d5f72[_0x107930]['startAt'],_0x1d5f72[_0x107930]['endAt'])){manager[_0x21ce('0x52')](_0x107930,_0x1d5f72[_0x107930][_0x21ce('0x50')],handleJob(_0x1d5f72[_0x107930]));manager[_0x21ce('0x53')](_0x107930);logger['info'](_0x21ce('0x54'),_0x1d5f72[_0x107930][_0x21ce('0x18')],_0x1d5f72[_0x107930]['cron']);}else if(manager[_0x21ce('0x55')](_0x107930)){manager[_0x21ce('0x48')](_0x107930);manager[_0x21ce('0x49')](_0x107930);logger[_0x21ce('0xa')](_0x21ce('0x56'),_0x1d5f72[_0x107930][_0x21ce('0x18')],_0x1d5f72[_0x107930][_0x21ce('0x50')]);}}for(_0x4129c1=0x0,_0x107930;_0x4129c1<_0x47b35b[_0x21ce('0x47')]&&!_0x2c8534;_0x4129c1+=0x1){_0x107930=_0x47b35b[_0x4129c1]['toString']();if(manager[_0x21ce('0x55')](_0x107930)){if(_0x1d5f72[_0x107930][_0x21ce('0x50')]&&_0x1d5f72[_0x107930][_0x21ce('0x51')]&&moment()[_0x21ce('0x57')](_0x1d5f72[_0x107930][_0x21ce('0x58')],_0x1d5f72[_0x107930][_0x21ce('0x59')])){manager['update'](_0x107930,_0x1d5f72[_0x107930][_0x21ce('0x50')],handleJob(_0x1d5f72[_0x107930]));logger[_0x21ce('0xa')](_0x21ce('0x5a'),_0x1d5f72[_0x107930][_0x21ce('0x18')],_0x1d5f72[_0x107930][_0x21ce('0x50')]);}else{manager['stop'](_0x107930);manager['deleteJob'](_0x107930);logger[_0x21ce('0xa')](_0x21ce('0x56'),_0x1d5f72[_0x107930][_0x21ce('0x18')],_0x1d5f72[_0x107930][_0x21ce('0x50')]);}}}})[_0x21ce('0x39')](function(_0x4c338a){logger[_0x21ce('0x2c')](JSON[_0x21ce('0x24')](_0x4c338a));});}exports[_0x21ce('0x5b')]=function(_0x501393){return getJobs(_0x501393);};exports['start']=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file diff --git a/server/config/seedContact.js b/server/config/seedContact.js index 8addedd..2fb949f 100644 --- a/server/config/seedContact.js +++ b/server/config/seedContact.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2fcf=['contacts1','CmHopper','bulkCreate','hopper1','catch','push','Biondo','innocenzo.biondo','@xcally.com','now','Innocenzo','CmContact','destroy','then','log','finished\x20populating'];(function(_0x2657f7,_0x15c229){var _0x6d956=function(_0x2cb0cf){while(--_0x2cb0cf){_0x2657f7['push'](_0x2657f7['shift']());}};_0x6d956(++_0x15c229);}(_0x2fcf,0xd5));var _0xf2fc=function(_0x1cf1c7,_0x1e0f72){_0x1cf1c7=_0x1cf1c7-0x0;var _0x362b0a=_0x2fcf[_0x1cf1c7];return _0x362b0a;};'use strict';var util=require('util');var db=require('../mysqldb')['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0xf2fc('0x0')]({'id':i,'firstName':'Innocenzo'+i,'lastName':_0xf2fc('0x1')+i,'phone':0xf879fb460+i,'email':_0xf2fc('0x2')+i+_0xf2fc('0x3')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper['push']({'id':i,'active':![],'scheduledat':Date['now'](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date['now'](),'updatedAt':Date[_0xf2fc('0x4')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2['push']({'id':i,'firstName':_0xf2fc('0x5')+i,'lastName':_0xf2fc('0x1')+i,'phone':0xf879fb460+i,'email':_0xf2fc('0x2')+i+_0xf2fc('0x3')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2['push']({'id':i,'active':![],'scheduledat':Date[_0xf2fc('0x4')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date['now'](),'updatedAt':Date[_0xf2fc('0x4')]()});}db[_0xf2fc('0x6')][_0xf2fc('0x7')]({'where':{}})[_0xf2fc('0x8')](function(){return db['CmContact']['bulkCreate'](contacts);})['then'](function(){console[_0xf2fc('0x9')](_0xf2fc('0xa'),_0xf2fc('0xb'));return db[_0xf2fc('0xc')]['destroy']({'where':{}});})[_0xf2fc('0x8')](function(){return db[_0xf2fc('0xc')][_0xf2fc('0xd')](hopper);})[_0xf2fc('0x8')](function(){console[_0xf2fc('0x9')]('finished\x20populating',_0xf2fc('0xe'));return db['CmContact'][_0xf2fc('0xd')](contacts2);})[_0xf2fc('0x8')](function(){console[_0xf2fc('0x9')](_0xf2fc('0xa'),'contacts2');return db['CmHopper'][_0xf2fc('0xd')](hopper2);})[_0xf2fc('0x8')](function(){console[_0xf2fc('0x9')](_0xf2fc('0xa'),'hopper2');})[_0xf2fc('0xf')](function(_0x219cb6){console[_0xf2fc('0x9')](_0x219cb6);}); \ No newline at end of file +var _0xa8c4=['log','finished\x20populating','contacts1','CmHopper','hopper2','catch','util','Biondo','@xcally.com','now','push','Innocenzo','innocenzo.biondo','CmContact','destroy','then','bulkCreate'];(function(_0x4f8f52,_0x139a03){var _0x16c1d4=function(_0x333a1a){while(--_0x333a1a){_0x4f8f52['push'](_0x4f8f52['shift']());}};_0x16c1d4(++_0x139a03);}(_0xa8c4,0xe3));var _0x4a8c=function(_0x2bd66c,_0x4c3f5d){_0x2bd66c=_0x2bd66c-0x0;var _0x2cdcf5=_0xa8c4[_0x2bd66c];return _0x2cdcf5;};'use strict';var util=require(_0x4a8c('0x0'));var db=require('../mysqldb')['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts['push']({'id':i,'firstName':'Innocenzo'+i,'lastName':_0x4a8c('0x1')+i,'phone':0xf879fb460+i,'email':'innocenzo.biondo'+i+_0x4a8c('0x2')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper['push']({'id':i,'active':![],'scheduledat':Date['now'](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date['now'](),'updatedAt':Date[_0x4a8c('0x3')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0x4a8c('0x4')]({'id':i,'firstName':_0x4a8c('0x5')+i,'lastName':_0x4a8c('0x1')+i,'phone':0xf879fb460+i,'email':_0x4a8c('0x6')+i+_0x4a8c('0x2')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2['push']({'id':i,'active':![],'scheduledat':Date[_0x4a8c('0x3')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date['now'](),'updatedAt':Date[_0x4a8c('0x3')]()});}db[_0x4a8c('0x7')][_0x4a8c('0x8')]({'where':{}})[_0x4a8c('0x9')](function(){return db[_0x4a8c('0x7')][_0x4a8c('0xa')](contacts);})['then'](function(){console[_0x4a8c('0xb')](_0x4a8c('0xc'),_0x4a8c('0xd'));return db[_0x4a8c('0xe')][_0x4a8c('0x8')]({'where':{}});})['then'](function(){return db[_0x4a8c('0xe')]['bulkCreate'](hopper);})['then'](function(){console[_0x4a8c('0xb')](_0x4a8c('0xc'),'hopper1');return db['CmContact'][_0x4a8c('0xa')](contacts2);})[_0x4a8c('0x9')](function(){console[_0x4a8c('0xb')]('finished\x20populating','contacts2');return db[_0x4a8c('0xe')]['bulkCreate'](hopper2);})[_0x4a8c('0x9')](function(){console[_0x4a8c('0xb')](_0x4a8c('0xc'),_0x4a8c('0xf'));})[_0x4a8c('0x10')](function(_0x200125){console[_0x4a8c('0xb')](_0x200125);}); \ No newline at end of file diff --git a/server/config/seedUsers.js b/server/config/seedUsers.js index 730e7a1..e24ea51 100644 --- a/server/config/seedUsers.js +++ b/server/config/seedUsers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x346c=['yes','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','actpass','\x22%s\x22\x20<%s>','User','then','log','add\x20user','catch','util','../mysqldb','push','agent','format','password','udp','all','ulaw','%s%s'];(function(_0x271dc9,_0x5c1711){var _0x4019de=function(_0x142a25){while(--_0x142a25){_0x271dc9['push'](_0x271dc9['shift']());}};_0x4019de(++_0x5c1711);}(_0x346c,0x96));var _0xc346=function(_0x1e8152,_0x262a14){_0x1e8152=_0x1e8152-0x0;var _0x2c44c7=_0x346c[_0x1e8152];return _0x2c44c7;};'use strict';var util=require(_0xc346('0x0'));var db=require(_0xc346('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0xc346('0x2')]({'name':util['format']('%s%s',_0xc346('0x3'),i),'fullname':util[_0xc346('0x4')]('%s%s',_0xc346('0x3'),i),'email':util['format']('%s%s@xcally.com',_0xc346('0x3'),i),'role':'agent','password':_0xc346('0x5'),'internal':0xfa0+i,'type':'friend','transport':[_0xc346('0x6'),'ws','wss'],'disallow':[_0xc346('0x7')],'allow':[_0xc346('0x8')],'defaultuser':util[_0xc346('0x4')](_0xc346('0x9'),_0xc346('0x3'),i),'encryption':'yes','avpf':_0xc346('0xa'),'force_avp':'yes','icesupport':'yes','dtlsenable':_0xc346('0xa'),'dtlsverify':'no','dtlscertfile':_0xc346('0xb'),'dtlsprivatekey':_0xc346('0xc'),'dtlssetup':_0xc346('0xd'),'callerid':util[_0xc346('0x4')](_0xc346('0xe'),util[_0xc346('0x4')](_0xc346('0x9'),'agent',i),0xfa0+i)});}db[_0xc346('0xf')]['bulkCreate'](users)[_0xc346('0x10')](function(){console[_0xc346('0x11')](_0xc346('0x12'));})[_0xc346('0x13')](function(_0xd79e78){console['log'](_0xd79e78);}); \ No newline at end of file +var _0x1fe3=['password','friend','udp','wss','ulaw','yes','/etc/pki/tls/certs/motion.crt','actpass','\x22%s\x22\x20<%s>','User','bulkCreate','then','log','add\x20user','catch','util','../mysqldb','format','agent','%s%s','%s%s@xcally.com'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1fe3,0xa2));var _0x31fe=function(_0x4b5662,_0x14d54a){_0x4b5662=_0x4b5662-0x0;var _0x1056a9=_0x1fe3[_0x4b5662];return _0x1056a9;};'use strict';var util=require(_0x31fe('0x0'));var db=require(_0x31fe('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users['push']({'name':util[_0x31fe('0x2')]('%s%s',_0x31fe('0x3'),i),'fullname':util[_0x31fe('0x2')](_0x31fe('0x4'),_0x31fe('0x3'),i),'email':util['format'](_0x31fe('0x5'),_0x31fe('0x3'),i),'role':'agent','password':_0x31fe('0x6'),'internal':0xfa0+i,'type':_0x31fe('0x7'),'transport':[_0x31fe('0x8'),'ws',_0x31fe('0x9')],'disallow':['all'],'allow':[_0x31fe('0xa')],'defaultuser':util[_0x31fe('0x2')](_0x31fe('0x4'),_0x31fe('0x3'),i),'encryption':'yes','avpf':_0x31fe('0xb'),'force_avp':_0x31fe('0xb'),'icesupport':'yes','dtlsenable':_0x31fe('0xb'),'dtlsverify':'no','dtlscertfile':_0x31fe('0xc'),'dtlsprivatekey':'/etc/pki/tls/private/motion.key','dtlssetup':_0x31fe('0xd'),'callerid':util[_0x31fe('0x2')](_0x31fe('0xe'),util[_0x31fe('0x2')]('%s%s',_0x31fe('0x3'),i),0xfa0+i)});}db[_0x31fe('0xf')][_0x31fe('0x10')](users)[_0x31fe('0x11')](function(){console[_0x31fe('0x12')](_0x31fe('0x13'));})[_0x31fe('0x14')](function(_0x2a1fe4){console[_0x31fe('0x12')](_0x2a1fe4);}); \ No newline at end of file diff --git a/server/config/socketio.js b/server/config/socketio.js index 10c5717..281b381 100644 --- a/server/config/socketio.js +++ b/server/config/socketio.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6895=['removeOpenchannelInteractions','user_has_openchannel_interactions:remove','catch','log','join','default','setMaxListeners','address','connection','remoteAddress','request','remotePort','connectedAt','SocketIO\x20','nsp','disconnect','util','bluebird','../mysqldb','./environment','Agents','User','name','role','agent','telephone','type','ivr','findOne','then','autoAssociation','ChatQueues','FaxQueues','SmsQueues','MailQueues','OpenchannelQueues','findAll','Trunks','IvrCampaigns','UserProfileResource','resourceId','map','Campaign','where','user:%s','handshake','find','query','ChatInteraction','ChatInteractions','MailInteraction','MailInteractions','FaxInteractions','SmsInteractions','OpenchannelInteractions','format','admin','voice:inbound','hasOwnProperty','ChatQueue','push','FaxQueue','SmsQueue','user','voice:outbound','userProfileId','VoiceQueue','MailQueue','OpenchannelQueue','Telephones','Trunk','getChatQueues','getFaxQueues','getMailQueues','getOpenchannelQueues','length','voice','fax','sms','mail','openchannel','telephone:%s','trunk:%s','campaign:%s:%s','leave','removeChatInteractions','emit','user_has_chat_interactions:remove','user_has_mail_interactions:remove','removeFaxInteractions','user_has_fax_interactions:remove','user_has_sms_interactions:remove'];(function(_0x3ecdf2,_0x53fa6c){var _0x14c867=function(_0x374f6f){while(--_0x374f6f){_0x3ecdf2['push'](_0x3ecdf2['shift']());}};_0x14c867(++_0x53fa6c);}(_0x6895,0x1dc));var _0x5689=function(_0x3c200f,_0x2f2c7a){_0x3c200f=_0x3c200f-0x0;var _0xde2ae2=_0x6895[_0x3c200f];return _0xde2ae2;};'use strict';var _=require('lodash');var util=require(_0x5689('0x0'));var BPromise=require(_0x5689('0x1'));var db=require(_0x5689('0x2'))['db'];var config=require(_0x5689('0x3'));var queryQueues={'attributes':['id','name'],'include':[{'as':_0x5689('0x4'),'model':db[_0x5689('0x5')],'attributes':['id',_0x5689('0x6'),_0x5689('0x7')],'raw':!![],'where':{'role':_0x5689('0x8')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0x5689('0x6')],'where':{'role':_0x5689('0x9')}};var queryTrunks={'raw':!![],'attributes':['id',_0x5689('0x6')]};var queryAgents={'raw':!![],'attributes':['id',_0x5689('0x6')],'where':{'role':_0x5689('0x8')}};var queryCampaigns={'raw':!![],'attributes':['id',_0x5689('0x6'),_0x5689('0xa')],'where':{'type':_0x5689('0xb')}};function getAssociatedResources(_0x53994c,_0x56f2c4,_0x728e29){return db['UserProfileSection'][_0x5689('0xc')]({'where':{'name':_0x53994c,'userProfileId':_0x56f2c4},'raw':!![]})[_0x5689('0xd')](function(_0x2f780d){if(_0x2f780d){if(_0x2f780d[_0x5689('0xe')]){switch(_0x53994c){case'VoiceQueues':case _0x5689('0xf'):case _0x5689('0x10'):case _0x5689('0x11'):case _0x5689('0x12'):case _0x5689('0x13'):return db[_0x728e29]['findAll'](queryQueues);case'Telephones':return db[_0x728e29][_0x5689('0x14')](queryTelephones);case _0x5689('0x15'):return db[_0x728e29][_0x5689('0x14')](queryTrunks);case _0x5689('0x16'):return db[_0x728e29][_0x5689('0x14')](queryCampaigns);}}else{return db[_0x5689('0x17')][_0x5689('0x14')]({'attributes':[_0x5689('0x18')],'where':{'sectionId':_0x2f780d['id']},'raw':!![]})[_0x5689('0xd')](function(_0x34ef3c){if(_0x34ef3c){var _0x4c4730={'where':{'id':_[_0x5689('0x19')](_0x34ef3c,_0x5689('0x18'))},'raw':!![]};switch(_0x728e29){case'User':_0x4c4730['where'][_0x5689('0x7')]=_0x5689('0x9');break;case _0x5689('0x1a'):_0x4c4730[_0x5689('0x1b')]['type']=_0x5689('0xb');break;}return db[_0x728e29][_0x5689('0x14')](_0x4c4730);}else{return[];}});}}else{return[];}})[_0x5689('0xd')](function(_0xd4678f){return _0xd4678f;});}function joinOrLeaveQueues(_0x9c1306,_0x5a0f03,_0x36051c,_0x9ad6ae){_0x9c1306[_0x5a0f03](util['format']('%s:queue:%s',_0x36051c,_0x9ad6ae['name']));if(_0x9ad6ae[_0x5689('0x4')]){for(var _0x8ac342=0x0;_0x8ac342<_0x9ad6ae[_0x5689('0x4')]['length'];_0x8ac342+=0x1){_0x9c1306[_0x5a0f03](util['format'](_0x5689('0x1c'),_0x9ad6ae[_0x5689('0x4')][_0x8ac342]['name']));}}}function joinOrLeave(_0x424aeb,_0x45fdbe,_0x49c3b7){var _0x412931;if(_0x424aeb[_0x5689('0x1d')]['query']['id']){db[_0x5689('0x5')][_0x5689('0x1e')]({'attributes':['id',_0x5689('0x6'),_0x5689('0x7'),'userProfileId'],'where':{'id':_0x424aeb['handshake'][_0x5689('0x1f')]['id']},'include':[{'model':db[_0x5689('0x20')],'as':_0x5689('0x21'),'attributes':['id'],'raw':!![]},{'model':db[_0x5689('0x22')],'as':_0x5689('0x23'),'attributes':['id'],'raw':!![]},{'model':db['FaxInteraction'],'as':_0x5689('0x24'),'attributes':['id'],'raw':!![]},{'model':db['SmsInteraction'],'as':_0x5689('0x25'),'attributes':['id'],'raw':!![]},{'model':db['OpenchannelInteraction'],'as':_0x5689('0x26'),'attributes':['id'],'raw':!![]}]})[_0x5689('0xd')](function(_0x5055aa){if(_0x5055aa){_0x412931=_0x5055aa;_0x424aeb[_0x45fdbe](util[_0x5689('0x27')](_0x5689('0x1c'),_0x5055aa['name']));var _0x2cab08=[];switch(_0x5055aa[_0x5689('0x7')]){case _0x5689('0x28'):_0x424aeb[_0x45fdbe](_0x5689('0x29'));_0x424aeb[_0x45fdbe]('voice:outbound');if(queryQueues[_0x5689('0x2a')]('include')){delete queryQueues['include'];}_0x2cab08['push'](db['VoiceQueue'][_0x5689('0x14')](queryQueues));_0x2cab08['push'](db[_0x5689('0x2b')][_0x5689('0x14')](queryQueues));_0x2cab08[_0x5689('0x2c')](db[_0x5689('0x2d')]['findAll'](queryQueues));_0x2cab08[_0x5689('0x2c')](db[_0x5689('0x2e')][_0x5689('0x14')](queryQueues));_0x2cab08['push'](db['MailQueue'][_0x5689('0x14')](queryQueues));_0x2cab08[_0x5689('0x2c')](db['OpenchannelQueue']['findAll'](queryQueues));_0x2cab08[_0x5689('0x2c')](db[_0x5689('0x5')][_0x5689('0x14')](queryTelephones));_0x2cab08['push'](db['Trunk'][_0x5689('0x14')](queryTrunks));_0x2cab08[_0x5689('0x2c')](db[_0x5689('0x1a')][_0x5689('0x14')](queryCampaigns));_0x2cab08[_0x5689('0x2c')](db[_0x5689('0x5')][_0x5689('0x14')](queryAgents));break;case _0x5689('0x2f'):_0x424aeb[_0x45fdbe](_0x5689('0x29'));_0x424aeb[_0x45fdbe](_0x5689('0x30'));_0x2cab08[_0x5689('0x2c')](getAssociatedResources('VoiceQueues',_0x5055aa[_0x5689('0x31')],_0x5689('0x32')));_0x2cab08[_0x5689('0x2c')](getAssociatedResources(_0x5689('0xf'),_0x5055aa['userProfileId'],_0x5689('0x2b')));_0x2cab08['push'](getAssociatedResources(_0x5689('0x10'),_0x5055aa[_0x5689('0x31')],'FaxQueue'));_0x2cab08['push'](getAssociatedResources('SmsQueues',_0x5055aa[_0x5689('0x31')],_0x5689('0x2e')));_0x2cab08['push'](getAssociatedResources(_0x5689('0x12'),_0x5055aa[_0x5689('0x31')],_0x5689('0x33')));_0x2cab08[_0x5689('0x2c')](getAssociatedResources(_0x5689('0x13'),_0x5055aa['userProfileId'],_0x5689('0x34')));_0x2cab08['push'](getAssociatedResources(_0x5689('0x35'),_0x5055aa[_0x5689('0x31')],_0x5689('0x5')));_0x2cab08['push'](getAssociatedResources(_0x5689('0x15'),_0x5055aa[_0x5689('0x31')],_0x5689('0x36')));_0x2cab08['push'](getAssociatedResources(_0x5689('0x16'),_0x5055aa['userProfileId'],_0x5689('0x1a')));_0x2cab08['push'](db['User'][_0x5689('0x14')](queryAgents));break;case'agent':_0x424aeb[_0x45fdbe](_0x5689('0x29'));_0x424aeb[_0x45fdbe](_0x5689('0x30'));_0x2cab08['push'](_0x5055aa['getVoiceQueues']({'attributes':['id','name']}));_0x2cab08[_0x5689('0x2c')](_0x5055aa[_0x5689('0x37')]({'attributes':['id',_0x5689('0x6')]}));_0x2cab08[_0x5689('0x2c')](_0x5055aa[_0x5689('0x38')]({'attributes':['id',_0x5689('0x6')]}));_0x2cab08[_0x5689('0x2c')](_0x5055aa['getSmsQueues']({'attributes':['id',_0x5689('0x6')]}));_0x2cab08[_0x5689('0x2c')](_0x5055aa[_0x5689('0x39')]({'attributes':['id',_0x5689('0x6')]}));_0x2cab08[_0x5689('0x2c')](_0x5055aa[_0x5689('0x3a')]({'attributes':['id',_0x5689('0x6')]}));break;}return BPromise['all'](_0x2cab08);}})[_0x5689('0xd')](function(_0x5315ce){if(_0x5315ce&&_0x5315ce[_0x5689('0x3b')]){for(var _0x63ee3f=0x0;_0x63ee3f<_0x5315ce[_0x5689('0x3b')];_0x63ee3f+=0x1){for(var _0x5a5778=0x0;_0x5a5778<_0x5315ce[_0x63ee3f][_0x5689('0x3b')];_0x5a5778+=0x1){switch(_0x63ee3f){case 0x0:joinOrLeaveQueues(_0x424aeb,_0x45fdbe,_0x5689('0x3c'),_0x5315ce[_0x63ee3f][_0x5a5778]);break;case 0x1:joinOrLeaveQueues(_0x424aeb,_0x45fdbe,'chat',_0x5315ce[_0x63ee3f][_0x5a5778]);break;case 0x2:joinOrLeaveQueues(_0x424aeb,_0x45fdbe,_0x5689('0x3d'),_0x5315ce[_0x63ee3f][_0x5a5778]);break;case 0x3:joinOrLeaveQueues(_0x424aeb,_0x45fdbe,_0x5689('0x3e'),_0x5315ce[_0x63ee3f][_0x5a5778]);break;case 0x4:joinOrLeaveQueues(_0x424aeb,_0x45fdbe,_0x5689('0x3f'),_0x5315ce[_0x63ee3f][_0x5a5778]);break;case 0x5:joinOrLeaveQueues(_0x424aeb,_0x45fdbe,_0x5689('0x40'),_0x5315ce[_0x63ee3f][_0x5a5778]);break;case 0x6:_0x424aeb[_0x45fdbe](util[_0x5689('0x27')](_0x5689('0x41'),_0x5315ce[_0x63ee3f][_0x5a5778]['name']));break;case 0x7:_0x424aeb[_0x45fdbe](util[_0x5689('0x27')](_0x5689('0x42'),_0x5315ce[_0x63ee3f][_0x5a5778]['name']));break;case 0x8:_0x424aeb[_0x45fdbe](util[_0x5689('0x27')](_0x5689('0x43'),_0x5315ce[_0x63ee3f][_0x5a5778][_0x5689('0xa')],_0x5315ce[_0x63ee3f][_0x5a5778][_0x5689('0x6')]));break;case 0x9:_0x424aeb[_0x45fdbe](util['format'](_0x5689('0x1c'),_0x5315ce[_0x63ee3f][_0x5a5778][_0x5689('0x6')]));break;}}}}})[_0x5689('0xd')](function(){if(_0x45fdbe===_0x5689('0x44')){var _0x4930b2=_[_0x5689('0x19')](_0x412931[_0x5689('0x21')],'id');return _0x412931[_0x5689('0x45')](_0x4930b2)[_0x5689('0xd')](function(){for(var _0x3d0c47=0x0;_0x3d0c47<_0x4930b2['length'];_0x3d0c47+=0x1){_0x49c3b7[_0x5689('0x46')](_0x5689('0x47'),{'ChatInteractionId':Number(_0x4930b2[_0x3d0c47]),'UserId':Number(_0x412931['id'])});}});}})['then'](function(){if(_0x45fdbe===_0x5689('0x44')){var _0x43f831=_[_0x5689('0x19')](_0x412931[_0x5689('0x23')],'id');return _0x412931['removeMailInteractions'](_0x43f831)[_0x5689('0xd')](function(){for(var _0x4262ac=0x0;_0x4262ac<_0x43f831[_0x5689('0x3b')];_0x4262ac+=0x1){_0x49c3b7[_0x5689('0x46')](_0x5689('0x48'),{'MailInteractionId':Number(_0x43f831[_0x4262ac]),'UserId':Number(_0x412931['id'])});}});}})[_0x5689('0xd')](function(){if(_0x45fdbe==='leave'){var _0x17082d=_['map'](_0x412931[_0x5689('0x24')],'id');return _0x412931[_0x5689('0x49')](_0x17082d)[_0x5689('0xd')](function(){for(var _0x2f053f=0x0;_0x2f053f<_0x17082d[_0x5689('0x3b')];_0x2f053f+=0x1){_0x49c3b7[_0x5689('0x46')](_0x5689('0x4a'),{'FaxInteractionId':Number(_0x17082d[_0x2f053f]),'UserId':Number(_0x412931['id'])});}});}})['then'](function(){if(_0x45fdbe==='leave'){var _0x30d551=_[_0x5689('0x19')](_0x412931[_0x5689('0x25')],'id');return _0x412931['removeSmsInteractions'](_0x30d551)[_0x5689('0xd')](function(){for(var _0x3198a8=0x0;_0x3198a8<_0x30d551[_0x5689('0x3b')];_0x3198a8+=0x1){_0x49c3b7[_0x5689('0x46')](_0x5689('0x4b'),{'SmsInteractionId':Number(_0x30d551[_0x3198a8]),'UserId':Number(_0x412931['id'])});}});}})['then'](function(){if(_0x45fdbe==='leave'){var _0x402f68=_[_0x5689('0x19')](_0x412931[_0x5689('0x26')],'id');return _0x412931[_0x5689('0x4c')](_0x402f68)[_0x5689('0xd')](function(){for(var _0xc21611=0x0;_0xc21611<_0x402f68[_0x5689('0x3b')];_0xc21611+=0x1){_0x49c3b7[_0x5689('0x46')](_0x5689('0x4d'),{'OpenchannelInteractionId':Number(_0x402f68[_0xc21611]),'UserId':Number(_0x412931['id'])});}});}})[_0x5689('0x4e')](function(_0xeb3573){_0x424aeb[_0x5689('0x4f')](_0xeb3573);});}}function onDisconnect(_0x42e98d,_0x547321){joinOrLeave(_0x42e98d,_0x5689('0x44'),_0x547321);}function onConnect(_0x4c528a){joinOrLeave(_0x4c528a,_0x5689('0x50'));}exports[_0x5689('0x51')]=function(_0x1aaa72){_0x1aaa72['on']('connection',function(_0x491090){_0x491090[_0x5689('0x52')](0x0);_0x491090[_0x5689('0x53')]=_0x491090['request'][_0x5689('0x54')][_0x5689('0x55')]+':'+_0x491090[_0x5689('0x56')][_0x5689('0x54')][_0x5689('0x57')];_0x491090[_0x5689('0x58')]=new Date();_0x491090[_0x5689('0x4f')]=function(_0x3b7daf){console[_0x5689('0x4f')](_0x5689('0x59')+_0x491090[_0x5689('0x5a')][_0x5689('0x6')]+'['+_0x491090[_0x5689('0x53')]+']',_0x3b7daf);};_0x491090['on'](_0x5689('0x5b'),function(){onDisconnect(_0x491090,_0x1aaa72);_0x491090[_0x5689('0x4f')]('DISCONNECTED');});onConnect(_0x491090);_0x491090[_0x5689('0x4f')]('CONNECTED');});}; \ No newline at end of file +var _0xe427=['name','type','ivr','UserProfileSection','findOne','then','VoiceQueues','MailQueues','OpenchannelQueues','findAll','Telephones','Trunks','IvrCampaigns','UserProfileResource','resourceId','where','Campaign','format','%s:queue:%s','length','user:%s','find','userProfileId','handshake','ChatInteractions','MailInteraction','MailInteractions','FaxInteraction','SmsInteraction','SmsInteractions','OpenchannelInteraction','OpenchannelInteractions','admin','voice:inbound','voice:outbound','hasOwnProperty','include','push','VoiceQueue','ChatQueue','SmsQueue','MailQueue','OpenchannelQueue','Trunk','user','ChatQueues','FaxQueues','getVoiceQueues','getFaxQueues','getSmsQueues','getMailQueues','getOpenchannelQueues','voice','fax','openchannel','telephone:%s','trunk:%s','campaign:%s:%s','leave','map','emit','user_has_chat_interactions:remove','removeMailInteractions','user_has_mail_interactions:remove','FaxInteractions','user_has_fax_interactions:remove','removeSmsInteractions','user_has_sms_interactions:remove','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','catch','log','join','default','request','remoteAddress','connection','connectedAt','SocketIO\x20','nsp','address','disconnect','DISCONNECTED','CONNECTED','lodash','util','bluebird','../mysqldb','Agents','User','role','agent','telephone'];(function(_0x4306f4,_0x15187c){var _0x3380c8=function(_0xc4bcbd){while(--_0xc4bcbd){_0x4306f4['push'](_0x4306f4['shift']());}};_0x3380c8(++_0x15187c);}(_0xe427,0x16b));var _0x7e42=function(_0xe9c061,_0x38ee98){_0xe9c061=_0xe9c061-0x0;var _0x289f96=_0xe427[_0xe9c061];return _0x289f96;};'use strict';var _=require(_0x7e42('0x0'));var util=require(_0x7e42('0x1'));var BPromise=require(_0x7e42('0x2'));var db=require(_0x7e42('0x3'))['db'];var config=require('./environment');var queryQueues={'attributes':['id','name'],'include':[{'as':_0x7e42('0x4'),'model':db[_0x7e42('0x5')],'attributes':['id','name',_0x7e42('0x6')],'raw':!![],'where':{'role':_0x7e42('0x7')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id','name'],'where':{'role':_0x7e42('0x8')}};var queryTrunks={'raw':!![],'attributes':['id',_0x7e42('0x9')]};var queryAgents={'raw':!![],'attributes':['id',_0x7e42('0x9')],'where':{'role':'agent'}};var queryCampaigns={'raw':!![],'attributes':['id',_0x7e42('0x9'),_0x7e42('0xa')],'where':{'type':_0x7e42('0xb')}};function getAssociatedResources(_0x1b7104,_0x2246e3,_0xefc18d){return db[_0x7e42('0xc')][_0x7e42('0xd')]({'where':{'name':_0x1b7104,'userProfileId':_0x2246e3},'raw':!![]})[_0x7e42('0xe')](function(_0x9f4c2e){if(_0x9f4c2e){if(_0x9f4c2e['autoAssociation']){switch(_0x1b7104){case _0x7e42('0xf'):case'ChatQueues':case'FaxQueues':case'SmsQueues':case _0x7e42('0x10'):case _0x7e42('0x11'):return db[_0xefc18d][_0x7e42('0x12')](queryQueues);case _0x7e42('0x13'):return db[_0xefc18d][_0x7e42('0x12')](queryTelephones);case _0x7e42('0x14'):return db[_0xefc18d][_0x7e42('0x12')](queryTrunks);case _0x7e42('0x15'):return db[_0xefc18d][_0x7e42('0x12')](queryCampaigns);}}else{return db[_0x7e42('0x16')][_0x7e42('0x12')]({'attributes':[_0x7e42('0x17')],'where':{'sectionId':_0x9f4c2e['id']},'raw':!![]})[_0x7e42('0xe')](function(_0x14ae55){if(_0x14ae55){var _0x1815d3={'where':{'id':_['map'](_0x14ae55,_0x7e42('0x17'))},'raw':!![]};switch(_0xefc18d){case _0x7e42('0x5'):_0x1815d3[_0x7e42('0x18')][_0x7e42('0x6')]=_0x7e42('0x8');break;case _0x7e42('0x19'):_0x1815d3[_0x7e42('0x18')][_0x7e42('0xa')]=_0x7e42('0xb');break;}return db[_0xefc18d][_0x7e42('0x12')](_0x1815d3);}else{return[];}});}}else{return[];}})[_0x7e42('0xe')](function(_0x1202db){return _0x1202db;});}function joinOrLeaveQueues(_0x5d436a,_0x43b538,_0x8e1a55,_0x51ab81){_0x5d436a[_0x43b538](util[_0x7e42('0x1a')](_0x7e42('0x1b'),_0x8e1a55,_0x51ab81['name']));if(_0x51ab81[_0x7e42('0x4')]){for(var _0x396eb6=0x0;_0x396eb6<_0x51ab81[_0x7e42('0x4')][_0x7e42('0x1c')];_0x396eb6+=0x1){_0x5d436a[_0x43b538](util[_0x7e42('0x1a')](_0x7e42('0x1d'),_0x51ab81[_0x7e42('0x4')][_0x396eb6][_0x7e42('0x9')]));}}}function joinOrLeave(_0x3f899d,_0x196343,_0x3a9743){var _0xb0864a;if(_0x3f899d['handshake']['query']['id']){db[_0x7e42('0x5')][_0x7e42('0x1e')]({'attributes':['id','name',_0x7e42('0x6'),_0x7e42('0x1f')],'where':{'id':_0x3f899d[_0x7e42('0x20')]['query']['id']},'include':[{'model':db['ChatInteraction'],'as':_0x7e42('0x21'),'attributes':['id'],'raw':!![]},{'model':db[_0x7e42('0x22')],'as':_0x7e42('0x23'),'attributes':['id'],'raw':!![]},{'model':db[_0x7e42('0x24')],'as':'FaxInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x7e42('0x25')],'as':_0x7e42('0x26'),'attributes':['id'],'raw':!![]},{'model':db[_0x7e42('0x27')],'as':_0x7e42('0x28'),'attributes':['id'],'raw':!![]}]})[_0x7e42('0xe')](function(_0xa1bdfc){if(_0xa1bdfc){_0xb0864a=_0xa1bdfc;_0x3f899d[_0x196343](util[_0x7e42('0x1a')](_0x7e42('0x1d'),_0xa1bdfc[_0x7e42('0x9')]));var _0x398380=[];switch(_0xa1bdfc[_0x7e42('0x6')]){case _0x7e42('0x29'):_0x3f899d[_0x196343](_0x7e42('0x2a'));_0x3f899d[_0x196343](_0x7e42('0x2b'));if(queryQueues[_0x7e42('0x2c')](_0x7e42('0x2d'))){delete queryQueues[_0x7e42('0x2d')];}_0x398380[_0x7e42('0x2e')](db[_0x7e42('0x2f')][_0x7e42('0x12')](queryQueues));_0x398380[_0x7e42('0x2e')](db[_0x7e42('0x30')]['findAll'](queryQueues));_0x398380[_0x7e42('0x2e')](db['FaxQueue'][_0x7e42('0x12')](queryQueues));_0x398380[_0x7e42('0x2e')](db[_0x7e42('0x31')]['findAll'](queryQueues));_0x398380[_0x7e42('0x2e')](db[_0x7e42('0x32')]['findAll'](queryQueues));_0x398380[_0x7e42('0x2e')](db[_0x7e42('0x33')][_0x7e42('0x12')](queryQueues));_0x398380['push'](db['User'][_0x7e42('0x12')](queryTelephones));_0x398380[_0x7e42('0x2e')](db[_0x7e42('0x34')][_0x7e42('0x12')](queryTrunks));_0x398380['push'](db['Campaign']['findAll'](queryCampaigns));_0x398380[_0x7e42('0x2e')](db[_0x7e42('0x5')][_0x7e42('0x12')](queryAgents));break;case _0x7e42('0x35'):_0x3f899d[_0x196343](_0x7e42('0x2a'));_0x3f899d[_0x196343](_0x7e42('0x2b'));_0x398380['push'](getAssociatedResources(_0x7e42('0xf'),_0xa1bdfc[_0x7e42('0x1f')],'VoiceQueue'));_0x398380[_0x7e42('0x2e')](getAssociatedResources(_0x7e42('0x36'),_0xa1bdfc[_0x7e42('0x1f')],_0x7e42('0x30')));_0x398380[_0x7e42('0x2e')](getAssociatedResources(_0x7e42('0x37'),_0xa1bdfc['userProfileId'],'FaxQueue'));_0x398380[_0x7e42('0x2e')](getAssociatedResources('SmsQueues',_0xa1bdfc['userProfileId'],'SmsQueue'));_0x398380['push'](getAssociatedResources(_0x7e42('0x10'),_0xa1bdfc['userProfileId'],'MailQueue'));_0x398380[_0x7e42('0x2e')](getAssociatedResources(_0x7e42('0x11'),_0xa1bdfc[_0x7e42('0x1f')],_0x7e42('0x33')));_0x398380[_0x7e42('0x2e')](getAssociatedResources(_0x7e42('0x13'),_0xa1bdfc[_0x7e42('0x1f')],'User'));_0x398380[_0x7e42('0x2e')](getAssociatedResources(_0x7e42('0x14'),_0xa1bdfc[_0x7e42('0x1f')],'Trunk'));_0x398380['push'](getAssociatedResources(_0x7e42('0x15'),_0xa1bdfc['userProfileId'],_0x7e42('0x19')));_0x398380['push'](db[_0x7e42('0x5')][_0x7e42('0x12')](queryAgents));break;case _0x7e42('0x7'):_0x3f899d[_0x196343](_0x7e42('0x2a'));_0x3f899d[_0x196343](_0x7e42('0x2b'));_0x398380[_0x7e42('0x2e')](_0xa1bdfc[_0x7e42('0x38')]({'attributes':['id',_0x7e42('0x9')]}));_0x398380['push'](_0xa1bdfc['getChatQueues']({'attributes':['id',_0x7e42('0x9')]}));_0x398380[_0x7e42('0x2e')](_0xa1bdfc[_0x7e42('0x39')]({'attributes':['id','name']}));_0x398380[_0x7e42('0x2e')](_0xa1bdfc[_0x7e42('0x3a')]({'attributes':['id','name']}));_0x398380['push'](_0xa1bdfc[_0x7e42('0x3b')]({'attributes':['id',_0x7e42('0x9')]}));_0x398380['push'](_0xa1bdfc[_0x7e42('0x3c')]({'attributes':['id',_0x7e42('0x9')]}));break;}return BPromise['all'](_0x398380);}})['then'](function(_0x8bdc4a){if(_0x8bdc4a&&_0x8bdc4a['length']){for(var _0x4854d7=0x0;_0x4854d7<_0x8bdc4a[_0x7e42('0x1c')];_0x4854d7+=0x1){for(var _0x2e1727=0x0;_0x2e1727<_0x8bdc4a[_0x4854d7][_0x7e42('0x1c')];_0x2e1727+=0x1){switch(_0x4854d7){case 0x0:joinOrLeaveQueues(_0x3f899d,_0x196343,_0x7e42('0x3d'),_0x8bdc4a[_0x4854d7][_0x2e1727]);break;case 0x1:joinOrLeaveQueues(_0x3f899d,_0x196343,'chat',_0x8bdc4a[_0x4854d7][_0x2e1727]);break;case 0x2:joinOrLeaveQueues(_0x3f899d,_0x196343,_0x7e42('0x3e'),_0x8bdc4a[_0x4854d7][_0x2e1727]);break;case 0x3:joinOrLeaveQueues(_0x3f899d,_0x196343,'sms',_0x8bdc4a[_0x4854d7][_0x2e1727]);break;case 0x4:joinOrLeaveQueues(_0x3f899d,_0x196343,'mail',_0x8bdc4a[_0x4854d7][_0x2e1727]);break;case 0x5:joinOrLeaveQueues(_0x3f899d,_0x196343,_0x7e42('0x3f'),_0x8bdc4a[_0x4854d7][_0x2e1727]);break;case 0x6:_0x3f899d[_0x196343](util[_0x7e42('0x1a')](_0x7e42('0x40'),_0x8bdc4a[_0x4854d7][_0x2e1727][_0x7e42('0x9')]));break;case 0x7:_0x3f899d[_0x196343](util[_0x7e42('0x1a')](_0x7e42('0x41'),_0x8bdc4a[_0x4854d7][_0x2e1727][_0x7e42('0x9')]));break;case 0x8:_0x3f899d[_0x196343](util[_0x7e42('0x1a')](_0x7e42('0x42'),_0x8bdc4a[_0x4854d7][_0x2e1727]['type'],_0x8bdc4a[_0x4854d7][_0x2e1727][_0x7e42('0x9')]));break;case 0x9:_0x3f899d[_0x196343](util[_0x7e42('0x1a')](_0x7e42('0x1d'),_0x8bdc4a[_0x4854d7][_0x2e1727]['name']));break;}}}}})[_0x7e42('0xe')](function(){if(_0x196343===_0x7e42('0x43')){var _0x3b4123=_[_0x7e42('0x44')](_0xb0864a[_0x7e42('0x21')],'id');return _0xb0864a['removeChatInteractions'](_0x3b4123)[_0x7e42('0xe')](function(){for(var _0x5e7adf=0x0;_0x5e7adf<_0x3b4123[_0x7e42('0x1c')];_0x5e7adf+=0x1){_0x3a9743[_0x7e42('0x45')](_0x7e42('0x46'),{'ChatInteractionId':Number(_0x3b4123[_0x5e7adf]),'UserId':Number(_0xb0864a['id'])});}});}})[_0x7e42('0xe')](function(){if(_0x196343===_0x7e42('0x43')){var _0x59aee7=_[_0x7e42('0x44')](_0xb0864a[_0x7e42('0x23')],'id');return _0xb0864a[_0x7e42('0x47')](_0x59aee7)['then'](function(){for(var _0x1bc101=0x0;_0x1bc101<_0x59aee7[_0x7e42('0x1c')];_0x1bc101+=0x1){_0x3a9743['emit'](_0x7e42('0x48'),{'MailInteractionId':Number(_0x59aee7[_0x1bc101]),'UserId':Number(_0xb0864a['id'])});}});}})[_0x7e42('0xe')](function(){if(_0x196343===_0x7e42('0x43')){var _0x42a4fd=_[_0x7e42('0x44')](_0xb0864a[_0x7e42('0x49')],'id');return _0xb0864a['removeFaxInteractions'](_0x42a4fd)[_0x7e42('0xe')](function(){for(var _0x3d4972=0x0;_0x3d4972<_0x42a4fd[_0x7e42('0x1c')];_0x3d4972+=0x1){_0x3a9743['emit'](_0x7e42('0x4a'),{'FaxInteractionId':Number(_0x42a4fd[_0x3d4972]),'UserId':Number(_0xb0864a['id'])});}});}})[_0x7e42('0xe')](function(){if(_0x196343===_0x7e42('0x43')){var _0x30cfe7=_[_0x7e42('0x44')](_0xb0864a[_0x7e42('0x26')],'id');return _0xb0864a[_0x7e42('0x4b')](_0x30cfe7)[_0x7e42('0xe')](function(){for(var _0x438e4d=0x0;_0x438e4d<_0x30cfe7[_0x7e42('0x1c')];_0x438e4d+=0x1){_0x3a9743[_0x7e42('0x45')](_0x7e42('0x4c'),{'SmsInteractionId':Number(_0x30cfe7[_0x438e4d]),'UserId':Number(_0xb0864a['id'])});}});}})[_0x7e42('0xe')](function(){if(_0x196343===_0x7e42('0x43')){var _0x178b03=_[_0x7e42('0x44')](_0xb0864a['OpenchannelInteractions'],'id');return _0xb0864a[_0x7e42('0x4d')](_0x178b03)[_0x7e42('0xe')](function(){for(var _0x3e69ff=0x0;_0x3e69ff<_0x178b03[_0x7e42('0x1c')];_0x3e69ff+=0x1){_0x3a9743[_0x7e42('0x45')](_0x7e42('0x4e'),{'OpenchannelInteractionId':Number(_0x178b03[_0x3e69ff]),'UserId':Number(_0xb0864a['id'])});}});}})[_0x7e42('0x4f')](function(_0x4cdff2){_0x3f899d[_0x7e42('0x50')](_0x4cdff2);});}}function onDisconnect(_0x1f6d39,_0x22fdec){joinOrLeave(_0x1f6d39,_0x7e42('0x43'),_0x22fdec);}function onConnect(_0x102c0f){joinOrLeave(_0x102c0f,_0x7e42('0x51'));}exports[_0x7e42('0x52')]=function(_0x4b1b02){_0x4b1b02['on']('connection',function(_0x548d87){_0x548d87['setMaxListeners'](0x0);_0x548d87['address']=_0x548d87[_0x7e42('0x53')]['connection'][_0x7e42('0x54')]+':'+_0x548d87['request'][_0x7e42('0x55')]['remotePort'];_0x548d87[_0x7e42('0x56')]=new Date();_0x548d87[_0x7e42('0x50')]=function(_0x1fb1e6){console[_0x7e42('0x50')](_0x7e42('0x57')+_0x548d87[_0x7e42('0x58')]['name']+'['+_0x548d87[_0x7e42('0x59')]+']',_0x1fb1e6);};_0x548d87['on'](_0x7e42('0x5a'),function(){onDisconnect(_0x548d87,_0x4b1b02);_0x548d87[_0x7e42('0x50')](_0x7e42('0x5b'));});onConnect(_0x548d87);_0x548d87[_0x7e42('0x50')](_0x7e42('0x5c'));});}; \ No newline at end of file diff --git a/server/config/triggers/index.js b/server/config/triggers/index.js index e186489..69c1b63 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 _0xc87e=['closedinteraction','ChatMessage','newmessage','Sms','SmsInteraction','SmsMessage','Fax','Mail','MailInteraction','Openchannel','OpenchannelInteraction','OpenchannelMessage','request','then','info','Trigger,\x20%s','EventManager','error','code','catch','get','channel','event','direction','UserId','User','find','name','interface','format','incomingmessage','outgoingmessage','opened','changed','closed','SIP/%s','default','hasOwnProperty','hook','util','../../mysqldb','jayson/promise','../logger','triggers','Chat','afterCreate','newinteraction','afterUpdate'];(function(_0x460666,_0x24bfa0){var _0x555cbf=function(_0x3b4743){while(--_0x3b4743){_0x460666['push'](_0x460666['shift']());}};_0x555cbf(++_0x24bfa0);}(_0xc87e,0x117));var _0xec87=function(_0x178b3d,_0x40dc46){_0x178b3d=_0x178b3d-0x0;var _0x1c05c1=_0xc87e[_0x178b3d];return _0x1c05c1;};'use strict';var util=require(_0xec87('0x0'));var db=require(_0xec87('0x1'))['db'];var jayson=require(_0xec87('0x2'));var logger=require(_0xec87('0x3'))(_0xec87('0x4'));var client=jayson['client']['http']({'port':0x232a});var triggers=[{'channel':_0xec87('0x5'),'model':'ChatInteraction','event':_0xec87('0x6'),'condition':_0xec87('0x7'),'callback':afterCreate},{'channel':_0xec87('0x5'),'model':'ChatInteraction','event':_0xec87('0x8'),'condition':_0xec87('0x9'),'callback':afterUpdate},{'channel':'Chat','model':_0xec87('0xa'),'event':_0xec87('0x6'),'condition':_0xec87('0xb'),'callback':afterCreateMessage},{'channel':_0xec87('0xc'),'model':_0xec87('0xd'),'event':_0xec87('0x6'),'condition':_0xec87('0x7'),'callback':afterCreate},{'channel':_0xec87('0xc'),'model':_0xec87('0xd'),'event':_0xec87('0x8'),'condition':'closedinteraction','callback':afterUpdate},{'channel':'Sms','model':_0xec87('0xe'),'event':_0xec87('0x6'),'condition':'newmessage','callback':afterCreateMessage},{'channel':'Fax','model':'FaxInteraction','event':_0xec87('0x6'),'condition':_0xec87('0x7'),'callback':afterCreate},{'channel':_0xec87('0xf'),'model':'FaxInteraction','event':_0xec87('0x8'),'condition':_0xec87('0x9'),'callback':afterUpdate},{'channel':_0xec87('0xf'),'model':'FaxMessage','event':_0xec87('0x6'),'condition':_0xec87('0xb'),'callback':afterCreateMessage},{'channel':_0xec87('0x10'),'model':_0xec87('0x11'),'event':_0xec87('0x6'),'condition':'newinteraction','callback':afterCreate},{'channel':_0xec87('0x10'),'model':'MailInteraction','event':_0xec87('0x8'),'condition':'closedinteraction','callback':afterUpdate},{'channel':'Mail','model':'MailMessage','event':_0xec87('0x6'),'condition':'newmessage','callback':afterCreateMessage},{'channel':_0xec87('0x12'),'model':_0xec87('0x13'),'event':_0xec87('0x6'),'condition':_0xec87('0x7'),'callback':afterCreate},{'channel':_0xec87('0x12'),'model':_0xec87('0x13'),'event':_0xec87('0x8'),'condition':_0xec87('0x9'),'callback':afterUpdate},{'channel':_0xec87('0x12'),'model':_0xec87('0x14'),'event':_0xec87('0x6'),'condition':_0xec87('0xb'),'callback':afterCreateMessage}];function request(_0x3455ef){return client[_0xec87('0x15')]('EventManager',_0x3455ef)[_0xec87('0x16')](function(_0x4425e4){logger[_0xec87('0x17')](_0xec87('0x18'),_0xec87('0x19'),_0x4425e4);if(_0x4425e4[_0xec87('0x1a')]){if(_0x4425e4[_0xec87('0x1a')][_0xec87('0x1b')]===0x1f4){logger['error'](_0xec87('0x18'),'EventManager',_0x4425e4[_0xec87('0x1a')]);}}})[_0xec87('0x1c')](function(_0x1816bd){logger[_0xec87('0x1a')](_0xec87('0x18'),'EventManager',_0x1816bd);});}function afterCreateMessage(_0x2ca5ad,_0x27f8a1){return function(_0x318042,_0x2e894b){_0x318042=_0x318042[_0xec87('0x1d')]({'plain':!![]});_0x318042[_0xec87('0x1e')]=_0x2ca5ad;_0x318042[_0xec87('0x1f')]=_0x318042[_0xec87('0x20')];if(_0x318042[_0xec87('0x21')]){return db[_0xec87('0x22')][_0xec87('0x23')]({'where':{'id':_0x318042[_0xec87('0x21')]},'attributes':['id',_0xec87('0x24')],'raw':!![]})[_0xec87('0x16')](function(_0x179074){_0x318042[_0xec87('0x25')]=util[_0xec87('0x26')]('SIP/%s',_0x179074[_0xec87('0x24')]);_0x318042['channel']=_0x2ca5ad;return request({'event':_0xec87('0x27'),'message':_0x318042});})['catch'](function(_0x2a6043){console[_0xec87('0x1a')](_0x2a6043);});}else{return request({'event':_0xec87('0x28'),'message':_0x318042});}};}function afterCreate(_0x4fae8f,_0x10ceab){return function(_0x331590,_0x1bb6e3){_0x331590=_0x331590[_0xec87('0x1d')]({'plain':!![]});_0x331590[_0xec87('0x1e')]=_0x4fae8f;_0x331590[_0xec87('0x1f')]=_0xec87('0x29');return request({'event':_0x10ceab,'message':_0x331590});};}function afterUpdate(_0x440b36,_0x543fbd){return function(_0x4dca09,_0x4e3692){if(_0x4dca09[_0xec87('0x2a')]('closed')&&_0x4dca09[_0xec87('0x2b')]){_0x4dca09=_0x4dca09['get']({'plain':!![]});_0x4dca09[_0xec87('0x1e')]=_0x440b36;_0x4dca09[_0xec87('0x1f')]=_0xec87('0x2b');if(_0x4dca09[_0xec87('0x21')]){return db[_0xec87('0x22')][_0xec87('0x23')]({'where':{'id':_0x4dca09[_0xec87('0x21')]},'attributes':['id',_0xec87('0x24')],'raw':!![]})[_0xec87('0x16')](function(_0x15affc){_0x4dca09['interface']=util[_0xec87('0x26')](_0xec87('0x2c'),_0x15affc[_0xec87('0x24')]);return request({'event':_0x543fbd,'message':_0x4dca09});})[_0xec87('0x1c')](function(_0x54d30c){console[_0xec87('0x1a')](_0x54d30c);});}else{return request({'event':_0x543fbd,'message':_0x4dca09});}}};}exports[_0xec87('0x2d')]=function(){for(var _0x2f630a=0x0;_0x2f630a=_0x58cf53[_0x5ce3('0x12')]){throw Error(_0x5ce3('0x13'));}_0x1fc756(_0x6ba3e6);})['catch'](function(_0x68f376){_0x224d82(_0x68f376);});});}; \ No newline at end of file +var _0x76cd=['bluebird','../mysqldb','./license/util','voice','mail','chat','fax','sms','openchannel','getChannels','includes','isUndefined','blockedAt','updateAttributes','role','agent','User','then','getLicense','agents','catch','lodash'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x76cd,0x1b7));var _0xd76c=function(_0x1fb61d,_0x3393f3){_0x1fb61d=_0x1fb61d-0x0;var _0x2180f3=_0x76cd[_0x1fb61d];return _0x2180f3;};'use strict';var _=require(_0xd76c('0x0'));var BPromise=require(_0xd76c('0x1'));var db=require(_0xd76c('0x2'))['db'];var util=require(_0xd76c('0x3'));var channels=[_0xd76c('0x4'),_0xd76c('0x5'),_0xd76c('0x6'),_0xd76c('0x7'),_0xd76c('0x8'),_0xd76c('0x9')];exports[_0xd76c('0xa')]=function(){return channels;};exports['isValidChannel']=function(_0x14b81a){_0x14b81a=_0x14b81a['toLowerCase']();return _[_0xd76c('0xb')](channels,_0x14b81a);};exports['clearBlockUser']=function(_0x51fdeb,_0x1d2bf3,_0x5acb38,_0x43c5dc){var _0x4f9db1={'loginAttempts':_0x1d2bf3,'blocked':_0x5acb38};if(!_[_0xd76c('0xc')](_0x43c5dc)){_0x4f9db1[_0xd76c('0xd')]=_0x43c5dc;}return _0x51fdeb[_0xd76c('0xe')](_0x4f9db1);};exports['getLicense']=function(_0x5826e3){return new BPromise(function(_0x1512d0,_0x47308d){var _0x542f52=0x0;if(_0x5826e3[_0xd76c('0xf')]!==_0xd76c('0x10')){_0x1512d0(_0x5826e3);}db[_0xd76c('0x11')]['count']({'where':{'role':'agent','online':!![],'id':{'$ne':_0x5826e3['id']}}})[_0xd76c('0x12')](function(_0x31538c){_0x542f52=_0x31538c;return util[_0xd76c('0x13')]();})[_0xd76c('0x12')](function(_0x340175){if(_0x340175&&_0x340175[_0xd76c('0x14')]&&_0x542f52>=_0x340175[_0xd76c('0x14')]){throw Error('Maximum\x20login\x20has\x20been\x20reached');}_0x1512d0(_0x5826e3);})[_0xd76c('0x15')](function(_0x27424b){_0x47308d(_0x27424b);});});}; \ No newline at end of file diff --git a/server/errors/index.js b/server/errors/index.js index c282349..0d74dd6 100644 --- a/server/errors/index.js +++ b/server/errors/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x75aa=['exports','404','status','render'];(function(_0x402eff,_0x2525f2){var _0x2eb371=function(_0x15e9b3){while(--_0x15e9b3){_0x402eff['push'](_0x402eff['shift']());}};_0x2eb371(++_0x2525f2);}(_0x75aa,0x148));var _0xa75a=function(_0xdf8271,_0x4ed342){_0xdf8271=_0xdf8271-0x0;var _0x27bc87=_0x75aa[_0xdf8271];return _0x27bc87;};'use strict';module[_0xa75a('0x0')][0x194]=function pageNotFound(_0x58e1c4,_0x1e4c9b){var _0x14e830=_0xa75a('0x1');var _0x57459d=0x194;var _0x6ba058={'status':_0x57459d};_0x1e4c9b['status'](_0x6ba058[_0xa75a('0x2')]);_0x1e4c9b[_0xa75a('0x3')](_0x14e830,{},function(_0x3a21e9,_0x5ddad2){if(_0x3a21e9){return _0x1e4c9b[_0xa75a('0x2')](_0x6ba058[_0xa75a('0x2')])['json'](_0x6ba058);}_0x1e4c9b['send'](_0x5ddad2);});}; \ No newline at end of file +var _0x2a62=['404','status','render','json','send'];(function(_0x5b34c0,_0x3ad403){var _0x242bd3=function(_0x51d0ce){while(--_0x51d0ce){_0x5b34c0['push'](_0x5b34c0['shift']());}};_0x242bd3(++_0x3ad403);}(_0x2a62,0x159));var _0x22a6=function(_0x4f9b18,_0x2cb5ca){_0x4f9b18=_0x4f9b18-0x0;var _0x29f20c=_0x2a62[_0x4f9b18];return _0x29f20c;};'use strict';module['exports'][0x194]=function pageNotFound(_0x2f5e61,_0x3ee234){var _0x3f2a37=_0x22a6('0x0');var _0xe49f4d=0x194;var _0x339608={'status':_0xe49f4d};_0x3ee234[_0x22a6('0x1')](_0x339608['status']);_0x3ee234[_0x22a6('0x2')](_0x3f2a37,{},function(_0xeafd05,_0xc06990){if(_0xeafd05){return _0x3ee234['status'](_0x339608['status'])[_0x22a6('0x3')](_0x339608);}_0x3ee234[_0x22a6('0x4')](_0xc06990);});}; \ No newline at end of file diff --git a/server/mysqldb/index.js b/server/mysqldb/index.js index 6dfce34..f7b42ae 100644 --- a/server/mysqldb/index.js +++ b/server/mysqldb/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1270=['../api/mailQueue/mailQueue.model','MailSubstatus','../api/mailSubstatus/mailSubstatus.model','MailInteraction','MailMessage','../api/mailMessage/mailMessage.model','../api/mailApplication/mailApplication.model','MailQueueReport','../api/mailQueueReport/mailQueueReport.model','Dashboard','../api/dashboardItem/dashboardItem.model','FaxAccount','../api/faxAccount/faxAccount.model','FaxApplication','../api/faxApplication/faxApplication.model','FaxInteraction','../api/faxInteraction/faxInteraction.model','FaxMessage','../api/faxMessage/faxMessage.model','../api/faxQueue/faxQueue.model','FaxQueueReport','../api/faxQueueReport/faxQueueReport.model','SmsAccount','../api/smsAccount/smsAccount.model','SmsApplication','../api/smsApplication/smsApplication.model','../api/smsInteraction/smsInteraction.model','SmsMessage','../api/smsMessage/smsMessage.model','SmsQueue','../api/smsQueue/smsQueue.model','OpenchannelAccount','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','../api/openchannelInteraction/openchannelInteraction.model','../api/openchannelMessage/openchannelMessage.model','../api/openchannelQueue/openchannelQueue.model','../api/chatWebsite/chatWebsite.model','ChatApplication','../api/chatInteraction/chatInteraction.model','ChatMessage','ChatOfflineMessage','../api/chatOfflineMessage/chatOfflineMessage.model','ChatQueue','../api/chatQueue/chatQueue.model','ChatGroup','../api/chatGroup/chatGroup.model','ChatProactiveAction','../api/chatProactiveAction/chatProactiveAction.model','CmCompany','CmContact','../api/cmContact/cmContact.model','CmHopper','CmHopperBlack','../api/cmHopperBlack/cmHopperBlack.model','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','../api/cmHopperHistory/cmHopperHistory.model','ReportAgentPreview','../api/reportAgentPreview/reportAgentPreview.model','Automation','../api/automation/automation.model','../api/cannedAnswer/cannedAnswer.model','Disposition','../api/disposition/disposition.model','Condition','../api/condition/condition.model','Interval','../api/interval/interval.model','Pause','../api/pause/pause.model','../api/cdr/cdr.model','VoiceQueuesLog','Schedule','../api/schedule/schedule.model','Sound','../api/sound/sound.model','Tag','../api/tag/tag.model','Template','../api/template/template.model','Trigger','../api/trigger/trigger.model','Variable','Integration','../api/integration/integration.model','../api/integrationReport/integrationReport.model','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticExtractedReport','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticFieldReport','AnalyticTreeReport','../api/analyticTreeReport/analyticTreeReport.model','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','../api/intSalesforceField/intSalesforceField.model','SugarcrmAccount','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','SugarcrmField','../api/intSugarcrmField/intSugarcrmField.model','DeskAccount','../api/intDeskConfiguration/intDeskConfiguration.model','DeskField','../api/intZohoAccount/intZohoAccount.model','ZohoConfiguration','../api/intZohoConfiguration/intZohoConfiguration.model','../api/intZendeskAccount/intZendeskAccount.model','ZendeskConfiguration','../api/intZendeskConfiguration/intZendeskConfiguration.model','ZendeskField','../api/intZendeskField/intZendeskField.model','FreshdeskAccount','FreshdeskConfiguration','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','../api/intFreshdeskField/intFreshdeskField.model','VtigerAccount','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','../api/intVtigerConfiguration/intVtigerConfiguration.model','VtigerField','../api/intVtigerField/intVtigerField.model','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','../api/intServicenowConfiguration/intServicenowConfiguration.model','ServicenowField','../api/intServicenowField/intServicenowField.model','Dynamics365Account','../api/intDynamics365Account/intDynamics365Account.model','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','../api/intDynamics365Field/intDynamics365Field.model','Network','../api/network/network.model','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','../api/chatInternalMessage/chatInternalMessage.model','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','JscriptyQuestionReport','JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','SquareReport','SquareDetailsReport','JscriptyProject','Setting','../api/setting/setting.model','../api/squareOdbc/squareOdbc.model','SquareProject','../api/squareProject/squareProject.model','SquareRecording','../api/squareRecording/squareRecording.model','SquareMessage','../api/squareMessage/squareMessage.model','../api/team/team.model','License','../api/license/license.model','Campaign','../api/campaign/campaign.model','Migration','../api/migration/migration.model','../api/attachment/attachment.model','Plugin','MailTransferReport','../api/mailTransferReport/mailTransferReport.model','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','CmList','VoicePrefix','../api/voicePrefix/voicePrefix.model','UserProfile','../api/userProfile/userProfile.model','UserProfileSection','../api/userProfileSection/userProfileSection.model','UserProfileResource','../api/userProfileResource/userProfileResource.model','hasOne','cascade','UserId','hasMany','Recordings','VoiceQueuesRt','VoiceExtension','Extensions','CmHopperHistory','HopperHistory','OpenchannelInteraction','OpenchannelInteractions','ChatInteraction','ChatInteractions','SmsInteraction','SmsInteractions','FaxInteractions','MailInteractions','belongsTo','userProfileId','belongsToMany','Groups','chat_group_has_users','Lists','cm_user_has_lists','Team','user_has_mail_interactions','user_has_chat_interactions','user_has_fax_interactions','user_has_sms_interactions','user_has_openchannel_interactions','MailQueue','MailQueues','ChatQueues','FaxQueues','UserFaxQueue','SmsQueues','OpenchannelQueue','OpenchannelQueues','UserOpenchannelQueue','user_has_voice_prefixes','ChatWebsite','ChatWebsites','FaxAccounts','user_has_fax_accounts','MailAccounts','user_has_mail_accounts','OpenchannelAccounts','user_has_openchannel_accounts','SmsAccounts','user_has_sms_accounts','Applications','Sounds','moh_has_sounds','Members','Hoppers','VoiceQueueId','HopperFinals','HopperBlacks','JscriptySessions','Trunk','TrunkId','TrunkBackupId','IntervalId','mandatoryDispositionPauseId','Agents','Teams','team_has_voice_queues','BlackLists','voice_queues_has_cm_blacklists','VoiceMailMessage','Messages','mailboxuser','mailbox','uniqueid','AgentReports','Contact','ContactId','MailAccountId','Smtp','Dispositions','Answers','Interactions','MailApplication','TemplateId','team_has_mail_queues','MailInteractionId','Account','mail_interaction_has_tags','Tags','Users','restrict','TagId','List','ListId','DashboardItem','Items','CannedAnswer','FaxAccountId','mandatoryDispositionPause','FaxInteractionId','Owner','fax_interaction_has_tags','ThroughTags','Attachment','AttachmentId','FaxQueue','team_has_fax_queues','SmsAccountId','SmsInteractionId','sms_interaction_has_tags','Interaction','SmsQueueId','team_has_sms_queues','OpenchannelAccountId','OpenchannelMessage','OpenchannelInteractionId','team_has_openchannel_queues','ChatWebsiteId','ProactiveActions','user_has_chat_websites','OpenchannelQueueReport','Agent','Queue','ChatQueueId','Website','ChatInteractionId','chat_interaction_has_tags','team_has_chat_queues','ChatGroupId','Contacts','CompanyId','Company','cm_contact_has_tags','CampaignId','All','AutomationAllId','AutomationAnyId','Action','Actions','MailApplications','ChatApplications','SmsApplications','AnalyticCustomReport','CustomReportId','TriggerAllId','AnyConditions','TriggerAnyId','TriggerId','Fields','DefaultReportId','AnalyticMetric','MetricId','SalesforceAccount','AccountId','SalesforceField','Subjects','SubjectId','Descriptions','DescriptionId','FieldId','Subject','VariableId','Configurations','Description','DeskConfiguration','int_desk_configuration_has_tags','Field','ZohoAccount','ZohoField','ZendeskAccount','int_zendesk_configuration_has_tags','int_freshdesk_configuration_has_tags','ServicenowConfiguration','FromId','ToId','SessionId','ProjectId','user_has_square_projects','user_has_teams','VoiceQueues','HopperHistories','TrunkBackup','campaigns_has_cm_blacklists','FromMailAccountId','FromAccount','FromAgent','ToUserId','ToMailQueueId','ToMailAccountId','ToAccount','ToAgent','ToChatQueueId','FromFaxAccountId','ToQueue','ToFaxAccountId','ToOpenchannelQueueId','FromSmsAccountId','FromUserId','ToSmsQueueId','ToSmsAccountId','CmCustomField','voice_queues_has_cm_lists','UserProfileSections','Resources','sectionId','path','sequelize','jstz','determine','defaultsDeep','motion2','mysql','utf8mb4','name','utf8','utf8_general_ci','sequelizeHistory','xcall','xC@LL1234','database','username','password','options','User','import','VoiceChanSpy','VoiceContext','../api/voiceContext/voiceContext.model','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','../api/voiceQueue/voiceQueue.model','VoiceRecording','../api/voiceRecording/voiceRecording.model','ScreenRecording','../api/screenRecording/screenRecording.model','VoiceMail','../api/voiceMail/voiceMail.model','../api/voiceMailMessage/voiceMailMessage.model','VoiceCallReport','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','VoiceAgentReport','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','../api/memberReport/memberReport.model','../api/trunk/trunk.model','VoiceTransferReport','UserVoiceQueueRt','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','UserChatQueue','../api/userChatQueue/userChatQueue.model','UserMailQueue','../api/userMailQueue/userMailQueue.model','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','../api/userSmsQueue/userSmsQueue.model','../api/userOpenchannelQueue/userOpenchannelQueue.model','MailServerIn','../api/mailServerIn/mailServerIn.model','MailServerOut','../api/mailServerOut/mailServerOut.model','MailAccount'];(function(_0x2bcddb,_0x3eaf37){var _0x12a9e8=function(_0xeeb678){while(--_0xeeb678){_0x2bcddb['push'](_0x2bcddb['shift']());}};_0x12a9e8(++_0x3eaf37);}(_0x1270,0x18a));var _0x0127=function(_0x5028bf,_0x4f2da7){_0x5028bf=_0x5028bf-0x0;var _0x2c7d13=_0x1270[_0x5028bf];return _0x2c7d13;};'use strict';var path=require(_0x0127('0x0'));var config=require('../config/environment');var Sequelize=require(_0x0127('0x1'));var _=require('lodash');var jstz=require(_0x0127('0x2'));var timezone=jstz[_0x0127('0x3')]();config['sequelize']=_[_0x0127('0x4')](config[_0x0127('0x1')],{'database':_0x0127('0x5'),'username':'xcall','password':'xC@LL1234','options':{'host':'127.0.0.1','port':0xcea,'dialect':_0x0127('0x6'),'dialectOptions':{'charset':_0x0127('0x7')},'logging':![],'timezone':timezone[_0x0127('0x8')](),'define':{'charset':_0x0127('0x9'),'collate':_0x0127('0xa')}}});config[_0x0127('0xb')]=_[_0x0127('0x4')](config[_0x0127('0xb')],{'database':_0x0127('0x5'),'username':_0x0127('0xc'),'password':_0x0127('0xd'),'options':{'host':'127.0.0.1','port':0xcea,'dialect':_0x0127('0x6'),'dialectOptions':{'charset':_0x0127('0x7')},'logging':![],'timezone':timezone[_0x0127('0x8')](),'define':{'charset':_0x0127('0x9'),'collate':_0x0127('0xa')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelize'][_0x0127('0xe')],config['sequelize'][_0x0127('0xf')],config['sequelize'][_0x0127('0x10')],config[_0x0127('0x1')][_0x0127('0x11')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x0127('0xb')][_0x0127('0xe')],config[_0x0127('0xb')]['username'],config['sequelizeHistory']['password'],config[_0x0127('0xb')]['options'])};db[_0x0127('0x12')]=db[_0x0127('0x1')][_0x0127('0x13')]('../api/user/user.model');db[_0x0127('0x14')]=db[_0x0127('0x1')][_0x0127('0x13')]('../api/voiceChanSpy/voiceChanSpy.model');db[_0x0127('0x15')]=db[_0x0127('0x1')]['import'](_0x0127('0x16'));db['VoiceExtension']=db[_0x0127('0x1')]['import']('../api/voiceExtension/voiceExtension.model');db[_0x0127('0x17')]=db[_0x0127('0x1')][_0x0127('0x13')](_0x0127('0x18'));db[_0x0127('0x19')]=db[_0x0127('0x1')][_0x0127('0x13')](_0x0127('0x1a'));db[_0x0127('0x1b')]=db['sequelize'][_0x0127('0x13')](_0x0127('0x1c'));db[_0x0127('0x1d')]=db[_0x0127('0x1')][_0x0127('0x13')](_0x0127('0x1e'));db[_0x0127('0x1f')]=db[_0x0127('0x1')][_0x0127('0x13')](_0x0127('0x20'));db['VoiceMailMessage']=db[_0x0127('0x1')][_0x0127('0x13')](_0x0127('0x21'));db[_0x0127('0x22')]=db['sequelize'][_0x0127('0x13')](_0x0127('0x23'));db[_0x0127('0x24')]=db[_0x0127('0x1')][_0x0127('0x13')](_0x0127('0x25'));db[_0x0127('0x26')]=db['sequelize'][_0x0127('0x13')](_0x0127('0x27'));db[_0x0127('0x28')]=db[_0x0127('0x1')][_0x0127('0x13')](_0x0127('0x29'));db[_0x0127('0x2a')]=db[_0x0127('0x1')][_0x0127('0x13')](_0x0127('0x2b'));db['Trunk']=db[_0x0127('0x1')][_0x0127('0x13')](_0x0127('0x2c'));db[_0x0127('0x2d')]=db[_0x0127('0x1')]['import']('../api/voiceTransferReport/voiceTransferReport.model');db[_0x0127('0x2e')]=db[_0x0127('0x1')]['import'](_0x0127('0x2f'));db[_0x0127('0x30')]=db['sequelize'][_0x0127('0x13')]('../api/userVoiceQueue/userVoiceQueue.model');db[_0x0127('0x31')]=db[_0x0127('0x1')]['import'](_0x0127('0x32'));db[_0x0127('0x33')]=db[_0x0127('0x1')][_0x0127('0x13')](_0x0127('0x34'));db['UserFaxQueue']=db[_0x0127('0x1')][_0x0127('0x13')](_0x0127('0x35'));db[_0x0127('0x36')]=db['sequelize'][_0x0127('0x13')](_0x0127('0x37'));db['UserOpenchannelQueue']=db[_0x0127('0x1')]['import'](_0x0127('0x38'));db[_0x0127('0x39')]=db[_0x0127('0x1')][_0x0127('0x13')](_0x0127('0x3a'));db[_0x0127('0x3b')]=db['sequelize'][_0x0127('0x13')](_0x0127('0x3c'));db[_0x0127('0x3d')]=db[_0x0127('0x1')][_0x0127('0x13')]('../api/mailAccount/mailAccount.model');db['MailQueue']=db[_0x0127('0x1')][_0x0127('0x13')](_0x0127('0x3e'));db[_0x0127('0x3f')]=db['sequelize'][_0x0127('0x13')](_0x0127('0x40'));db[_0x0127('0x41')]=db[_0x0127('0x1')][_0x0127('0x13')]('../api/mailInteraction/mailInteraction.model');db[_0x0127('0x42')]=db[_0x0127('0x1')][_0x0127('0x13')](_0x0127('0x43'));db['MailApplication']=db[_0x0127('0x1')][_0x0127('0x13')](_0x0127('0x44'));db[_0x0127('0x45')]=db[_0x0127('0x1')]['import'](_0x0127('0x46'));db[_0x0127('0x47')]=db[_0x0127('0x1')][_0x0127('0x13')]('../api/dashboard/dashboard.model');db['DashboardItem']=db[_0x0127('0x1')]['import'](_0x0127('0x48'));db[_0x0127('0x49')]=db[_0x0127('0x1')]['import'](_0x0127('0x4a'));db[_0x0127('0x4b')]=db[_0x0127('0x1')][_0x0127('0x13')](_0x0127('0x4c'));db[_0x0127('0x4d')]=db['sequelize'][_0x0127('0x13')](_0x0127('0x4e'));db[_0x0127('0x4f')]=db[_0x0127('0x1')]['import'](_0x0127('0x50'));db['FaxQueue']=db[_0x0127('0x1')][_0x0127('0x13')](_0x0127('0x51'));db[_0x0127('0x52')]=db[_0x0127('0x1')][_0x0127('0x13')](_0x0127('0x53'));db[_0x0127('0x54')]=db[_0x0127('0x1')][_0x0127('0x13')](_0x0127('0x55'));db[_0x0127('0x56')]=db['sequelize'][_0x0127('0x13')](_0x0127('0x57'));db['SmsInteraction']=db[_0x0127('0x1')]['import'](_0x0127('0x58'));db[_0x0127('0x59')]=db[_0x0127('0x1')]['import'](_0x0127('0x5a'));db[_0x0127('0x5b')]=db[_0x0127('0x1')][_0x0127('0x13')](_0x0127('0x5c'));db[_0x0127('0x5d')]=db[_0x0127('0x1')][_0x0127('0x13')]('../api/openchannelAccount/openchannelAccount.model');db[_0x0127('0x5e')]=db[_0x0127('0x1')][_0x0127('0x13')](_0x0127('0x5f'));db['OpenchannelInteraction']=db[_0x0127('0x1')][_0x0127('0x13')](_0x0127('0x60'));db['OpenchannelMessage']=db[_0x0127('0x1')]['import'](_0x0127('0x61'));db['OpenchannelQueue']=db[_0x0127('0x1')][_0x0127('0x13')](_0x0127('0x62'));db['ChatWebsite']=db[_0x0127('0x1')]['import'](_0x0127('0x63'));db['OpenchannelQueueReport']=db['sequelize']['import']('../api/openchannelQueueReport/openchannelQueueReport.model');db[_0x0127('0x64')]=db[_0x0127('0x1')][_0x0127('0x13')]('../api/chatApplication/chatApplication.model');db['ChatInteraction']=db[_0x0127('0x1')][_0x0127('0x13')](_0x0127('0x65'));db[_0x0127('0x66')]=db[_0x0127('0x1')]['import']('../api/chatMessage/chatMessage.model');db[_0x0127('0x67')]=db['sequelize'][_0x0127('0x13')](_0x0127('0x68'));db[_0x0127('0x69')]=db['sequelize'][_0x0127('0x13')](_0x0127('0x6a'));db[_0x0127('0x6b')]=db['sequelize'][_0x0127('0x13')](_0x0127('0x6c'));db[_0x0127('0x6d')]=db['sequelize']['import'](_0x0127('0x6e'));db[_0x0127('0x6f')]=db[_0x0127('0x1')][_0x0127('0x13')]('../api/cmCompany/cmCompany.model');db[_0x0127('0x70')]=db[_0x0127('0x1')]['import'](_0x0127('0x71'));db[_0x0127('0x72')]=db[_0x0127('0x1')]['import']('../api/cmHopper/cmHopper.model');db[_0x0127('0x73')]=db['sequelize'][_0x0127('0x13')](_0x0127('0x74'));db[_0x0127('0x75')]=db[_0x0127('0x1')][_0x0127('0x13')](_0x0127('0x76'));db['CmHopperHistory']=db[_0x0127('0x1')][_0x0127('0x13')](_0x0127('0x77'));db[_0x0127('0x78')]=db['sequelize'][_0x0127('0x13')](_0x0127('0x79'));db['CmCustomField']=db['sequelize'][_0x0127('0x13')]('../api/cmCustomField/cmCustomField.model');db['Action']=db['sequelize'][_0x0127('0x13')]('../api/action/action.model');db[_0x0127('0x7a')]=db['sequelize'][_0x0127('0x13')](_0x0127('0x7b'));db['CannedAnswer']=db['sequelize']['import'](_0x0127('0x7c'));db[_0x0127('0x7d')]=db[_0x0127('0x1')][_0x0127('0x13')](_0x0127('0x7e'));db[_0x0127('0x7f')]=db[_0x0127('0x1')][_0x0127('0x13')](_0x0127('0x80'));db[_0x0127('0x81')]=db[_0x0127('0x1')]['import'](_0x0127('0x82'));db[_0x0127('0x83')]=db[_0x0127('0x1')][_0x0127('0x13')](_0x0127('0x84'));db['Cdr']=db[_0x0127('0x1')][_0x0127('0x13')](_0x0127('0x85'));db[_0x0127('0x86')]=db[_0x0127('0x1')][_0x0127('0x13')]('../api/voiceQueuesLog/voiceQueuesLog.model');db[_0x0127('0x87')]=db[_0x0127('0x1')]['import'](_0x0127('0x88'));db[_0x0127('0x89')]=db[_0x0127('0x1')][_0x0127('0x13')](_0x0127('0x8a'));db[_0x0127('0x8b')]=db[_0x0127('0x1')][_0x0127('0x13')](_0x0127('0x8c'));db[_0x0127('0x8d')]=db[_0x0127('0x1')]['import'](_0x0127('0x8e'));db[_0x0127('0x8f')]=db['sequelize'][_0x0127('0x13')](_0x0127('0x90'));db[_0x0127('0x91')]=db[_0x0127('0x1')][_0x0127('0x13')]('../api/variable/variable.model');db[_0x0127('0x92')]=db[_0x0127('0x1')][_0x0127('0x13')](_0x0127('0x93'));db['IntegrationReport']=db[_0x0127('0x1')]['import'](_0x0127('0x94'));db['AnalyticCustomReport']=db[_0x0127('0x1')][_0x0127('0x13')](_0x0127('0x95'));db[_0x0127('0x96')]=db[_0x0127('0x1')]['import'](_0x0127('0x97'));db[_0x0127('0x98')]=db[_0x0127('0x1')][_0x0127('0x13')](_0x0127('0x99'));db['AnalyticMetric']=db['sequelize'][_0x0127('0x13')]('../api/analyticMetric/analyticMetric.model');db[_0x0127('0x9a')]=db[_0x0127('0x1')][_0x0127('0x13')]('../api/analyticFieldReport/analyticFieldReport.model');db[_0x0127('0x9b')]=db['sequelize'][_0x0127('0x13')](_0x0127('0x9c'));db['SalesforceAccount']=db['sequelize'][_0x0127('0x13')]('../api/intSalesforceAccount/intSalesforceAccount.model');db[_0x0127('0x9d')]=db['sequelize'][_0x0127('0x13')](_0x0127('0x9e'));db['SalesforceField']=db['sequelize']['import'](_0x0127('0x9f'));db[_0x0127('0xa0')]=db['sequelize']['import']('../api/intSugarcrmAccount/intSugarcrmAccount.model');db[_0x0127('0xa1')]=db['sequelize'][_0x0127('0x13')](_0x0127('0xa2'));db[_0x0127('0xa3')]=db[_0x0127('0x1')]['import'](_0x0127('0xa4'));db[_0x0127('0xa5')]=db[_0x0127('0x1')]['import']('../api/intDeskAccount/intDeskAccount.model');db['DeskConfiguration']=db[_0x0127('0x1')][_0x0127('0x13')](_0x0127('0xa6'));db[_0x0127('0xa7')]=db[_0x0127('0x1')][_0x0127('0x13')]('../api/intDeskField/intDeskField.model');db['ZohoAccount']=db[_0x0127('0x1')][_0x0127('0x13')](_0x0127('0xa8'));db[_0x0127('0xa9')]=db[_0x0127('0x1')][_0x0127('0x13')](_0x0127('0xaa'));db['ZohoField']=db['sequelize']['import']('../api/intZohoField/intZohoField.model');db['ZendeskAccount']=db[_0x0127('0x1')][_0x0127('0x13')](_0x0127('0xab'));db[_0x0127('0xac')]=db['sequelize'][_0x0127('0x13')](_0x0127('0xad'));db[_0x0127('0xae')]=db['sequelize']['import'](_0x0127('0xaf'));db[_0x0127('0xb0')]=db['sequelize'][_0x0127('0x13')]('../api/intFreshdeskAccount/intFreshdeskAccount.model');db[_0x0127('0xb1')]=db[_0x0127('0x1')][_0x0127('0x13')](_0x0127('0xb2'));db[_0x0127('0xb3')]=db[_0x0127('0x1')][_0x0127('0x13')](_0x0127('0xb4'));db[_0x0127('0xb5')]=db[_0x0127('0x1')][_0x0127('0x13')](_0x0127('0xb6'));db[_0x0127('0xb7')]=db[_0x0127('0x1')][_0x0127('0x13')](_0x0127('0xb8'));db[_0x0127('0xb9')]=db[_0x0127('0x1')][_0x0127('0x13')](_0x0127('0xba'));db[_0x0127('0xbb')]=db[_0x0127('0x1')][_0x0127('0x13')](_0x0127('0xbc'));db['ServicenowConfiguration']=db[_0x0127('0x1')][_0x0127('0x13')](_0x0127('0xbd'));db[_0x0127('0xbe')]=db[_0x0127('0x1')]['import'](_0x0127('0xbf'));db[_0x0127('0xc0')]=db['sequelize'][_0x0127('0x13')](_0x0127('0xc1'));db[_0x0127('0xc2')]=db[_0x0127('0x1')]['import'](_0x0127('0xc3'));db[_0x0127('0xc4')]=db[_0x0127('0x1')][_0x0127('0x13')](_0x0127('0xc5'));db[_0x0127('0x92')]=db['sequelize'][_0x0127('0x13')](_0x0127('0x93'));db[_0x0127('0xc6')]=db['sequelize'][_0x0127('0x13')](_0x0127('0xc7'));db[_0x0127('0xc8')]=db[_0x0127('0x1')][_0x0127('0x13')](_0x0127('0xc9'));db[_0x0127('0xca')]=db[_0x0127('0x1')][_0x0127('0x13')](_0x0127('0xcb'));db[_0x0127('0xcc')]=db[_0x0127('0x1')]['import'](_0x0127('0xcd'));db[_0x0127('0xce')]=db[_0x0127('0x1')][_0x0127('0x13')]('../api/jscriptyQuestionReport/jscriptyQuestionReport.model');db[_0x0127('0xcf')]=db[_0x0127('0x1')]['import'](_0x0127('0xd0'));db[_0x0127('0xd1')]=db[_0x0127('0x1')][_0x0127('0x13')]('../api/smsQueueReport/smsQueueReport.model');db[_0x0127('0xd2')]=db[_0x0127('0x1')]['import']('../api/squareReport/squareReport.model');db[_0x0127('0xd3')]=db[_0x0127('0x1')][_0x0127('0x13')]('../api/squareReportDetail/squareReportDetail.model');db[_0x0127('0xd4')]=db[_0x0127('0x1')][_0x0127('0x13')]('../api/jscriptyProject/jscriptyProject.model');db[_0x0127('0xd5')]=db[_0x0127('0x1')][_0x0127('0x13')](_0x0127('0xd6'));db['SquareOdbc']=db[_0x0127('0x1')][_0x0127('0x13')](_0x0127('0xd7'));db[_0x0127('0xd8')]=db[_0x0127('0x1')][_0x0127('0x13')](_0x0127('0xd9'));db[_0x0127('0xda')]=db[_0x0127('0x1')][_0x0127('0x13')](_0x0127('0xdb'));db[_0x0127('0xdc')]=db[_0x0127('0x1')][_0x0127('0x13')](_0x0127('0xdd'));db['Team']=db[_0x0127('0x1')]['import'](_0x0127('0xde'));db[_0x0127('0xdf')]=db[_0x0127('0x1')][_0x0127('0x13')](_0x0127('0xe0'));db[_0x0127('0xe1')]=db[_0x0127('0x1')]['import'](_0x0127('0xe2'));db[_0x0127('0xe3')]=db[_0x0127('0x1')]['import'](_0x0127('0xe4'));db['Attachment']=db['sequelize']['import'](_0x0127('0xe5'));db[_0x0127('0xe6')]=db[_0x0127('0x1')][_0x0127('0x13')]('../api/plugin/plugin.model');db[_0x0127('0xe7')]=db[_0x0127('0x1')][_0x0127('0x13')](_0x0127('0xe8'));db[_0x0127('0xe9')]=db[_0x0127('0x1')][_0x0127('0x13')](_0x0127('0xea'));db[_0x0127('0xeb')]=db[_0x0127('0x1')][_0x0127('0x13')](_0x0127('0xec'));db[_0x0127('0xed')]=db[_0x0127('0x1')][_0x0127('0x13')](_0x0127('0xee'));db[_0x0127('0xef')]=db[_0x0127('0x1')][_0x0127('0x13')](_0x0127('0xf0'));db[_0x0127('0xf1')]=db[_0x0127('0x1')][_0x0127('0x13')]('../api/cmList/cmList.model');db[_0x0127('0xf2')]=db[_0x0127('0x1')]['import'](_0x0127('0xf3'));db[_0x0127('0xf4')]=db[_0x0127('0x1')][_0x0127('0x13')](_0x0127('0xf5'));db[_0x0127('0xf6')]=db['sequelize']['import'](_0x0127('0xf7'));db[_0x0127('0xf8')]=db[_0x0127('0x1')][_0x0127('0x13')](_0x0127('0xf9'));db[_0x0127('0x12')][_0x0127('0xfa')](db[_0x0127('0x1f')],{'as':_0x0127('0x1f'),'onDelete':_0x0127('0xfb'),'foreignKey':_0x0127('0xfc')});db[_0x0127('0x12')][_0x0127('0xfd')](db[_0x0127('0x1b')],{'as':_0x0127('0xfe'),'foreignKey':_0x0127('0xfc')});db[_0x0127('0x12')]['hasMany'](db['UserVoiceQueueRt'],{'as':_0x0127('0xff'),'foreignKey':'UserId'});db[_0x0127('0x12')][_0x0127('0xfd')](db[_0x0127('0x100')],{'as':_0x0127('0x101'),'onDelete':'cascade','hooks':!![]});db[_0x0127('0x12')][_0x0127('0xfd')](db[_0x0127('0x75')],{'as':'HopperFinals','foreignKey':'UserId'});db['User'][_0x0127('0xfd')](db[_0x0127('0x102')],{'as':_0x0127('0x103'),'foreignKey':'UserId'});db['User'][_0x0127('0xfd')](db[_0x0127('0x78')],{'as':_0x0127('0x78'),'foreignKey':'UserId'});db[_0x0127('0x12')][_0x0127('0xfd')](db[_0x0127('0x104')],{'as':_0x0127('0x105'),'foreignKey':_0x0127('0xfc')});db[_0x0127('0x12')][_0x0127('0xfd')](db[_0x0127('0x106')],{'as':_0x0127('0x107'),'foreignKey':_0x0127('0xfc')});db[_0x0127('0x12')][_0x0127('0xfd')](db[_0x0127('0x108')],{'as':_0x0127('0x109'),'foreignKey':_0x0127('0xfc')});db[_0x0127('0x12')][_0x0127('0xfd')](db['FaxInteraction'],{'as':_0x0127('0x10a'),'foreignKey':_0x0127('0xfc')});db[_0x0127('0x12')][_0x0127('0xfd')](db[_0x0127('0x41')],{'as':_0x0127('0x10b'),'foreignKey':_0x0127('0xfc')});db['User'][_0x0127('0x10c')](db[_0x0127('0xf4')],{'as':'UserProfile','foreignKey':_0x0127('0x10d')});db[_0x0127('0x12')][_0x0127('0x10e')](db[_0x0127('0x6b')],{'as':_0x0127('0x10f'),'through':_0x0127('0x110')});db[_0x0127('0x12')]['belongsToMany'](db['CmContact'],{'as':'Contacts','through':'cm_user_has_contacts'});db['User'][_0x0127('0x10e')](db['CmList'],{'as':_0x0127('0x111'),'through':_0x0127('0x112')});db[_0x0127('0x12')][_0x0127('0x10e')](db[_0x0127('0x113')],{'through':'user_has_teams'});db['User'][_0x0127('0x10e')](db[_0x0127('0x41')],{'as':_0x0127('0x10b'),'through':_0x0127('0x114')});db[_0x0127('0x12')][_0x0127('0x10e')](db[_0x0127('0x106')],{'as':_0x0127('0x107'),'through':_0x0127('0x115')});db[_0x0127('0x12')]['belongsToMany'](db['FaxInteraction'],{'as':'FaxInteractions','through':_0x0127('0x116')});db[_0x0127('0x12')][_0x0127('0x10e')](db['SmsInteraction'],{'as':_0x0127('0x109'),'through':_0x0127('0x117')});db[_0x0127('0x12')][_0x0127('0x10e')](db[_0x0127('0x104')],{'as':_0x0127('0x105'),'through':_0x0127('0x118')});db['User'][_0x0127('0x10e')](db[_0x0127('0x19')],{'as':'VoiceQueues','through':_0x0127('0x30'),'required':![]});db['User'][_0x0127('0x10e')](db[_0x0127('0x119')],{'as':_0x0127('0x11a'),'through':_0x0127('0x33'),'required':![]});db[_0x0127('0x12')][_0x0127('0x10e')](db['ChatQueue'],{'as':_0x0127('0x11b'),'through':_0x0127('0x31'),'required':![],'hooks':!![]});db[_0x0127('0x12')]['belongsToMany'](db['FaxQueue'],{'as':_0x0127('0x11c'),'through':_0x0127('0x11d'),'required':![]});db['User'][_0x0127('0x10e')](db['SmsQueue'],{'as':_0x0127('0x11e'),'through':_0x0127('0x36'),'required':![]});db['User'][_0x0127('0x10e')](db[_0x0127('0x11f')],{'as':_0x0127('0x120'),'through':_0x0127('0x121'),'required':![]});db[_0x0127('0x12')][_0x0127('0x10e')](db[_0x0127('0xf1')],{'through':_0x0127('0x112')});db[_0x0127('0x12')][_0x0127('0x10e')](db[_0x0127('0xf2')],{'as':'VoicePrefixes','through':_0x0127('0x122'),'required':![]});db[_0x0127('0x12')][_0x0127('0x10e')](db[_0x0127('0x123')],{'as':_0x0127('0x124'),'through':'user_has_chat_websites'});db[_0x0127('0x12')]['belongsToMany'](db[_0x0127('0x49')],{'as':_0x0127('0x125'),'through':_0x0127('0x126')});db['User'][_0x0127('0x10e')](db[_0x0127('0x3d')],{'as':_0x0127('0x127'),'through':_0x0127('0x128')});db['User'][_0x0127('0x10e')](db['OpenchannelAccount'],{'as':_0x0127('0x129'),'through':_0x0127('0x12a')});db[_0x0127('0x12')][_0x0127('0x10e')](db[_0x0127('0x54')],{'as':_0x0127('0x12b'),'through':_0x0127('0x12c')});db[_0x0127('0x12')][_0x0127('0x10e')](db[_0x0127('0xd8')],{'as':'SquareProjects','through':'user_has_square_projects'});db[_0x0127('0x14')][_0x0127('0xfd')](db[_0x0127('0x100')],{'as':'SpiedAgents','onDelete':_0x0127('0xfb'),'foreignKey':'ChanSpyId'});db[_0x0127('0x15')][_0x0127('0xfd')](db[_0x0127('0x100')],{'onDelete':_0x0127('0xfb')});db['VoiceExtension'][_0x0127('0xfd')](db[_0x0127('0x100')],{'as':_0x0127('0x12d'),'onDelete':_0x0127('0xfb')});db['VoiceMusicOnHold'][_0x0127('0x10e')](db[_0x0127('0x89')],{'as':_0x0127('0x12e'),'through':_0x0127('0x12f')});db['VoiceQueue'][_0x0127('0xfd')](db[_0x0127('0x2e')],{'as':_0x0127('0x130'),'foreignKey':'VoiceQueueId'});db[_0x0127('0x19')][_0x0127('0xfd')](db[_0x0127('0x72')],{'as':_0x0127('0x131'),'foreignKey':_0x0127('0x132')});db[_0x0127('0x19')][_0x0127('0xfd')](db[_0x0127('0x75')],{'as':_0x0127('0x133'),'foreignKey':_0x0127('0x132')});db['VoiceQueue'][_0x0127('0xfd')](db[_0x0127('0x102')],{'as':'HopperHistories','foreignKey':_0x0127('0x132')});db['VoiceQueue'][_0x0127('0xfd')](db[_0x0127('0x78')],{'as':_0x0127('0x78'),'foreignKey':_0x0127('0x132')});db[_0x0127('0x19')][_0x0127('0xfd')](db[_0x0127('0x73')],{'as':_0x0127('0x134'),'foreignKey':_0x0127('0x132')});db[_0x0127('0x19')][_0x0127('0xfd')](db[_0x0127('0xcf')],{'as':_0x0127('0x135'),'foreignKey':'VoiceQueueId'});db[_0x0127('0x19')][_0x0127('0x10c')](db[_0x0127('0x136')],{'as':_0x0127('0x136'),'foreignKey':_0x0127('0x137')});db['VoiceQueue'][_0x0127('0x10c')](db['Trunk'],{'as':'TrunkBackup','foreignKey':_0x0127('0x138')});db[_0x0127('0x19')][_0x0127('0x10c')](db[_0x0127('0x81')],{'as':'Interval','foreignKey':_0x0127('0x139')});db[_0x0127('0x19')][_0x0127('0x10c')](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':_0x0127('0x13a')});db['VoiceQueue'][_0x0127('0x10e')](db[_0x0127('0xf1')],{'as':_0x0127('0x111'),'through':'voice_queues_has_cm_lists'});db[_0x0127('0x19')]['belongsToMany'](db[_0x0127('0x12')],{'as':_0x0127('0x13b'),'through':_0x0127('0x30')});db['VoiceQueue'][_0x0127('0x10e')](db[_0x0127('0x113')],{'as':_0x0127('0x13c'),'through':_0x0127('0x13d')});db[_0x0127('0x19')][_0x0127('0x10e')](db[_0x0127('0xf1')],{'as':_0x0127('0x13e'),'through':_0x0127('0x13f')});db[_0x0127('0x1b')][_0x0127('0x10c')](db[_0x0127('0x12')],{'as':'User','foreignKey':_0x0127('0xfc')});db[_0x0127('0x1d')][_0x0127('0x10c')](db['User'],{'as':_0x0127('0x12'),'foreignKey':_0x0127('0xfc')});db[_0x0127('0x1f')][_0x0127('0xfd')](db[_0x0127('0x140')],{'as':_0x0127('0x141'),'onDelete':'cascade','foreignKey':_0x0127('0x142'),'sourceKey':_0x0127('0x143')});db[_0x0127('0x140')][_0x0127('0x10c')](db[_0x0127('0x1f')],{'foreignKey':_0x0127('0x142'),'targetKey':_0x0127('0x143')});db[_0x0127('0x22')][_0x0127('0xfd')](db[_0x0127('0x28')],{'as':'QueueCalls','foreignKey':_0x0127('0x144'),'constraints':![]});db[_0x0127('0x22')][_0x0127('0xfd')](db['VoiceAgentReport'],{'as':_0x0127('0x145'),'foreignKey':_0x0127('0x144'),'constraints':![]});db[_0x0127('0x22')]['belongsTo'](db[_0x0127('0x12')],{'as':_0x0127('0x12'),'foreignKey':_0x0127('0xfc')});db[_0x0127('0x22')][_0x0127('0x10c')](db['CmContact'],{'as':_0x0127('0x146'),'foreignKey':_0x0127('0x147')});db[_0x0127('0x39')][_0x0127('0x10c')](db[_0x0127('0x3d')],{'as':_0x0127('0x3d'),'foreignKey':_0x0127('0x148')});db['MailServerOut'][_0x0127('0x10c')](db['MailAccount'],{'as':_0x0127('0x3d'),'foreignKey':_0x0127('0x148')});db[_0x0127('0x3d')][_0x0127('0xfa')](db[_0x0127('0x39')],{'as':'Imap','onDelete':_0x0127('0xfb')});db[_0x0127('0x3d')][_0x0127('0xfa')](db[_0x0127('0x3b')],{'as':_0x0127('0x149'),'onDelete':_0x0127('0xfb')});db[_0x0127('0x3d')]['hasMany'](db[_0x0127('0x7d')],{'as':_0x0127('0x14a'),'foreignKey':'MailAccountId'});db['MailAccount'][_0x0127('0xfd')](db['CannedAnswer'],{'as':_0x0127('0x14b'),'foreignKey':'MailAccountId'});db[_0x0127('0x3d')]['hasMany'](db[_0x0127('0x42')],{'as':_0x0127('0x141'),'foreignKey':'MailAccountId'});db[_0x0127('0x3d')][_0x0127('0xfd')](db[_0x0127('0x41')],{'as':_0x0127('0x14c')});db['MailAccount'][_0x0127('0xfd')](db[_0x0127('0x14d')],{'as':_0x0127('0x12d')});db[_0x0127('0x3d')]['belongsTo'](db[_0x0127('0xf1')],{'as':'List','foreignKey':'ListId'});db[_0x0127('0x3d')][_0x0127('0x10c')](db[_0x0127('0x8d')],{'as':_0x0127('0x8d'),'foreignKey':_0x0127('0x14e')});db[_0x0127('0x3d')][_0x0127('0x10c')](db[_0x0127('0x83')],{'as':'mandatoryDispositionPause','foreignKey':_0x0127('0x13a')});db[_0x0127('0x3d')][_0x0127('0x10e')](db[_0x0127('0x12')],{'as':_0x0127('0x13b'),'through':_0x0127('0x128')});db[_0x0127('0x119')][_0x0127('0x10e')](db[_0x0127('0x12')],{'as':_0x0127('0x13b'),'through':_0x0127('0x33')});db[_0x0127('0x119')][_0x0127('0x10e')](db[_0x0127('0x113')],{'through':_0x0127('0x14f'),'as':_0x0127('0x13c')});db[_0x0127('0x41')][_0x0127('0xfd')](db[_0x0127('0x42')],{'as':_0x0127('0x141'),'onDelete':_0x0127('0xfb'),'foreignKey':_0x0127('0x150')});db[_0x0127('0x41')][_0x0127('0x10c')](db[_0x0127('0x3d')],{'as':_0x0127('0x151'),'foreignKey':_0x0127('0x148')});db[_0x0127('0x41')][_0x0127('0x10c')](db[_0x0127('0x70')],{'as':_0x0127('0x146'),'foreignKey':_0x0127('0x147')});db[_0x0127('0x41')][_0x0127('0x10c')](db[_0x0127('0x12')],{'as':'Owner','foreignKey':_0x0127('0xfc')});db[_0x0127('0x41')][_0x0127('0x10e')](db['Tag'],{'through':_0x0127('0x152'),'as':_0x0127('0x153')});db[_0x0127('0x41')]['belongsToMany'](db[_0x0127('0x8b')],{'through':_0x0127('0x152'),'as':'ThroughTags'});db['MailInteraction'][_0x0127('0x10e')](db['User'],{'as':_0x0127('0x154'),'through':_0x0127('0x114'),'foreignKey':_0x0127('0x150')});db[_0x0127('0x42')][_0x0127('0xfd')](db['Attachment'],{'as':'Attachments','onDelete':_0x0127('0xfb')});db[_0x0127('0x42')][_0x0127('0x10c')](db['User'],{'as':_0x0127('0x12')});db[_0x0127('0x42')][_0x0127('0x10c')](db[_0x0127('0x70')],{'onDelete':_0x0127('0xfb'),'as':'Contact'});db[_0x0127('0x42')][_0x0127('0x10c')](db[_0x0127('0x41')],{'as':'Interaction','foreignKey':_0x0127('0x150')});db[_0x0127('0x42')]['belongsTo'](db['MailAccount'],{'as':_0x0127('0x151'),'foreignKey':_0x0127('0x148')});db[_0x0127('0x14d')][_0x0127('0x10c')](db['User'],{'onDelete':_0x0127('0x155')});db['MailApplication'][_0x0127('0x10c')](db['MailQueue'],{'onDelete':_0x0127('0x155')});db[_0x0127('0x14d')][_0x0127('0x10c')](db[_0x0127('0x3d')],{'onDelete':_0x0127('0x155')});db[_0x0127('0x14d')][_0x0127('0x10c')](db[_0x0127('0x81')],{'onDelete':_0x0127('0x155'),'foreignKey':_0x0127('0x139')});db[_0x0127('0x14d')][_0x0127('0x10c')](db[_0x0127('0x8b')],{'onDelete':_0x0127('0x155'),'foreignKey':_0x0127('0x156')});db[_0x0127('0x45')][_0x0127('0x10c')](db[_0x0127('0x3d')],{});db[_0x0127('0x45')][_0x0127('0x10c')](db['CmList'],{'as':_0x0127('0x157'),'foreignKey':_0x0127('0x158')});db[_0x0127('0x45')]['belongsTo'](db['CmContact'],{'as':_0x0127('0x146'),'foreignKey':_0x0127('0x147')});db[_0x0127('0x45')]['belongsTo'](db[_0x0127('0x41')],{});db['MailQueueReport'][_0x0127('0x10c')](db[_0x0127('0x42')],{});db[_0x0127('0x45')][_0x0127('0x10c')](db[_0x0127('0x12')],{});db[_0x0127('0x45')][_0x0127('0x10c')](db[_0x0127('0x119')],{});db[_0x0127('0x47')][_0x0127('0xfd')](db[_0x0127('0x159')],{'as':_0x0127('0x15a'),'onDelete':_0x0127('0xfb')});db[_0x0127('0x49')][_0x0127('0xfd')](db['Disposition'],{'as':_0x0127('0x14a'),'foreignKey':'FaxAccountId'});db[_0x0127('0x49')][_0x0127('0xfd')](db[_0x0127('0x15b')],{'as':'Answers','foreignKey':_0x0127('0x15c')});db[_0x0127('0x49')][_0x0127('0xfd')](db['FaxInteraction'],{'as':_0x0127('0x14c')});db[_0x0127('0x49')]['hasMany'](db['FaxApplication'],{'as':'Applications'});db[_0x0127('0x49')][_0x0127('0xfd')](db[_0x0127('0x100')],{'as':'Exntensions','onDelete':'cascade'});db[_0x0127('0x49')][_0x0127('0xfd')](db[_0x0127('0x4f')],{'as':_0x0127('0x141')});db['FaxAccount']['belongsTo'](db[_0x0127('0x136')],{'as':_0x0127('0x136')});db['FaxAccount'][_0x0127('0x10c')](db['CmList'],{'as':_0x0127('0x157'),'foreignKey':_0x0127('0x158')});db[_0x0127('0x49')]['belongsTo'](db[_0x0127('0x83')],{'as':_0x0127('0x15d'),'foreignKey':_0x0127('0x13a')});db['FaxAccount'][_0x0127('0x10e')](db[_0x0127('0x12')],{'as':_0x0127('0x13b'),'through':_0x0127('0x126')});db[_0x0127('0x4b')][_0x0127('0x10c')](db[_0x0127('0x12')],{'onDelete':_0x0127('0x155')});db['FaxApplication']['belongsTo'](db['FaxQueue'],{'onDelete':'restrict'});db[_0x0127('0x4b')][_0x0127('0x10c')](db['FaxAccount'],{'onDelete':_0x0127('0x155')});db[_0x0127('0x4b')][_0x0127('0x10c')](db[_0x0127('0x8b')],{'onDelete':_0x0127('0x155'),'foreignKey':_0x0127('0x156')});db[_0x0127('0x4d')][_0x0127('0xfd')](db[_0x0127('0x4f')],{'as':_0x0127('0x141'),'onDelete':_0x0127('0xfb'),'foreignKey':_0x0127('0x15e')});db[_0x0127('0x4d')][_0x0127('0x10c')](db['FaxAccount'],{'as':_0x0127('0x151'),'foreignKey':_0x0127('0x15c')});db[_0x0127('0x4d')]['belongsTo'](db['CmContact'],{'as':_0x0127('0x146'),'foreignKey':_0x0127('0x147')});db['FaxInteraction']['belongsTo'](db[_0x0127('0x12')],{'as':_0x0127('0x15f'),'foreignKey':_0x0127('0xfc')});db['FaxInteraction']['belongsToMany'](db[_0x0127('0x8b')],{'through':_0x0127('0x160'),'as':_0x0127('0x153')});db[_0x0127('0x4d')]['belongsToMany'](db[_0x0127('0x8b')],{'through':'fax_interaction_has_tags','as':_0x0127('0x161')});db[_0x0127('0x4d')][_0x0127('0x10e')](db[_0x0127('0x12')],{'as':'Users','through':_0x0127('0x116'),'foreignKey':_0x0127('0x15e')});db[_0x0127('0x4f')]['belongsTo'](db['User'],{'onDelete':_0x0127('0xfb'),'as':'User'});db[_0x0127('0x4f')]['belongsTo'](db[_0x0127('0x4d')],{'as':'Interaction','foreignKey':_0x0127('0x15e')});db[_0x0127('0x4f')][_0x0127('0x10c')](db['CmContact'],{'onDelete':_0x0127('0xfb'),'as':_0x0127('0x146')});db[_0x0127('0x4f')][_0x0127('0x10c')](db[_0x0127('0x162')],{'as':_0x0127('0x162'),'foreignKey':_0x0127('0x163')});db[_0x0127('0x4f')]['belongsTo'](db['FaxAccount'],{'as':_0x0127('0x151'),'foreignKey':'FaxAccountId'});db[_0x0127('0x164')][_0x0127('0x10e')](db[_0x0127('0x12')],{'as':_0x0127('0x13b'),'through':'UserFaxQueue'});db['FaxQueue']['belongsToMany'](db[_0x0127('0x113')],{'through':_0x0127('0x165'),'as':_0x0127('0x13c')});db['FaxQueueReport'][_0x0127('0x10c')](db['FaxAccount'],{});db[_0x0127('0x52')][_0x0127('0x10c')](db['CmList'],{'as':'List','foreignKey':_0x0127('0x158')});db[_0x0127('0x52')][_0x0127('0x10c')](db[_0x0127('0x70')],{'as':_0x0127('0x146'),'foreignKey':_0x0127('0x147')});db[_0x0127('0x52')][_0x0127('0x10c')](db[_0x0127('0x4d')],{});db['FaxQueueReport'][_0x0127('0x10c')](db['FaxMessage'],{});db[_0x0127('0x52')][_0x0127('0x10c')](db[_0x0127('0x12')],{});db[_0x0127('0x52')][_0x0127('0x10c')](db[_0x0127('0x164')],{});db[_0x0127('0x54')][_0x0127('0xfd')](db[_0x0127('0x7d')],{'as':'Dispositions','foreignKey':'SmsAccountId'});db['SmsAccount'][_0x0127('0xfd')](db[_0x0127('0x15b')],{'as':'Answers','foreignKey':_0x0127('0x166')});db[_0x0127('0x54')][_0x0127('0xfd')](db[_0x0127('0x59')],{'as':_0x0127('0x141'),'foreignKey':_0x0127('0x166')});db['SmsAccount'][_0x0127('0xfd')](db[_0x0127('0x108')],{'as':'Interactions'});db[_0x0127('0x54')][_0x0127('0xfd')](db[_0x0127('0x56')],{'as':_0x0127('0x12d')});db[_0x0127('0x54')][_0x0127('0x10c')](db['CmList'],{'as':_0x0127('0x157'),'foreignKey':_0x0127('0x158')});db[_0x0127('0x54')][_0x0127('0x10c')](db['Pause'],{'as':_0x0127('0x15d'),'foreignKey':_0x0127('0x13a')});db[_0x0127('0x54')]['belongsToMany'](db[_0x0127('0x12')],{'as':_0x0127('0x13b'),'through':_0x0127('0x12c')});db[_0x0127('0x56')][_0x0127('0x10c')](db['User'],{'onDelete':_0x0127('0x155')});db[_0x0127('0x56')]['belongsTo'](db[_0x0127('0x5b')],{'onDelete':'restrict'});db[_0x0127('0x56')][_0x0127('0x10c')](db[_0x0127('0x54')],{'onDelete':_0x0127('0x155')});db[_0x0127('0x56')][_0x0127('0x10c')](db[_0x0127('0x81')],{'onDelete':_0x0127('0x155'),'foreignKey':'IntervalId'});db[_0x0127('0x56')][_0x0127('0x10c')](db['Tag'],{'onDelete':_0x0127('0x155'),'foreignKey':_0x0127('0x156')});db[_0x0127('0x108')][_0x0127('0xfd')](db['SmsMessage'],{'as':_0x0127('0x141'),'onDelete':_0x0127('0xfb'),'foreignKey':_0x0127('0x167')});db[_0x0127('0x108')][_0x0127('0x10c')](db['SmsAccount'],{'as':_0x0127('0x151'),'foreignKey':_0x0127('0x166')});db[_0x0127('0x108')]['belongsTo'](db['CmContact'],{'as':_0x0127('0x146'),'foreignKey':_0x0127('0x147')});db[_0x0127('0x108')][_0x0127('0x10c')](db[_0x0127('0x12')],{'as':_0x0127('0x15f'),'foreignKey':_0x0127('0xfc')});db[_0x0127('0x108')][_0x0127('0x10e')](db[_0x0127('0x8b')],{'through':_0x0127('0x168'),'as':_0x0127('0x153')});db['SmsInteraction'][_0x0127('0x10e')](db[_0x0127('0x8b')],{'through':_0x0127('0x168'),'as':_0x0127('0x161')});db[_0x0127('0x108')]['belongsToMany'](db['User'],{'as':'Users','through':_0x0127('0x117'),'foreignKey':'SmsInteractionId'});db[_0x0127('0x59')][_0x0127('0x10c')](db[_0x0127('0x12')],{'as':'User'});db['SmsMessage'][_0x0127('0x10c')](db[_0x0127('0x70')],{'onDelete':_0x0127('0xfb'),'as':_0x0127('0x146')});db['SmsMessage'][_0x0127('0x10c')](db[_0x0127('0x108')],{'onDelete':_0x0127('0xfb'),'as':_0x0127('0x169'),'foreignKey':_0x0127('0x167')});db[_0x0127('0x59')]['belongsTo'](db['SmsAccount'],{'as':_0x0127('0x151'),'foreignKey':_0x0127('0x166')});db['SmsQueue'][_0x0127('0x10e')](db[_0x0127('0x12')],{'as':_0x0127('0x13b'),'through':_0x0127('0x36'),'foreignKey':_0x0127('0x16a')});db['SmsQueue'][_0x0127('0x10e')](db[_0x0127('0x113')],{'through':_0x0127('0x16b'),'as':_0x0127('0x13c')});db[_0x0127('0x5d')][_0x0127('0xfd')](db['Disposition'],{'as':_0x0127('0x14a'),'foreignKey':_0x0127('0x16c')});db[_0x0127('0x5d')][_0x0127('0xfd')](db['CannedAnswer'],{'as':'Answers','foreignKey':_0x0127('0x16c')});db[_0x0127('0x5d')]['hasMany'](db['OpenchannelInteraction'],{'as':'Interactions','foreignKey':_0x0127('0x16c')});db[_0x0127('0x5d')][_0x0127('0xfd')](db[_0x0127('0x16d')],{'as':_0x0127('0x141'),'foreignKey':_0x0127('0x16c')});db[_0x0127('0x5d')][_0x0127('0xfd')](db['OpenchannelApplication'],{'as':_0x0127('0x12d'),'foreignKey':_0x0127('0x16c')});db[_0x0127('0x5d')][_0x0127('0x10c')](db[_0x0127('0xf1')],{'as':_0x0127('0x157'),'foreignKey':_0x0127('0x158')});db[_0x0127('0x5d')][_0x0127('0x10c')](db[_0x0127('0x83')],{'as':_0x0127('0x15d'),'foreignKey':_0x0127('0x13a')});db[_0x0127('0x5d')][_0x0127('0x10e')](db[_0x0127('0x12')],{'as':_0x0127('0x13b'),'through':'user_has_openchannel_accounts'});db['OpenchannelApplication'][_0x0127('0x10c')](db[_0x0127('0x12')],{'onDelete':_0x0127('0x155')});db[_0x0127('0x5e')][_0x0127('0x10c')](db[_0x0127('0x11f')],{'onDelete':_0x0127('0x155'),'foreignKey':'OpenchannelQueueId'});db[_0x0127('0x5e')][_0x0127('0x10c')](db[_0x0127('0x5d')],{'onDelete':_0x0127('0x155'),'foreignKey':_0x0127('0x16c')});db['OpenchannelApplication'][_0x0127('0x10c')](db[_0x0127('0x81')],{'onDelete':_0x0127('0x155'),'foreignKey':'IntervalId'});db['OpenchannelApplication'][_0x0127('0x10c')](db['Tag'],{'onDelete':'restrict','foreignKey':_0x0127('0x156')});db['OpenchannelInteraction'][_0x0127('0xfd')](db[_0x0127('0x16d')],{'as':'Messages','onDelete':_0x0127('0xfb'),'foreignKey':_0x0127('0x16e')});db[_0x0127('0x104')][_0x0127('0x10c')](db[_0x0127('0x5d')],{'as':'Account','foreignKey':_0x0127('0x16c')});db[_0x0127('0x104')][_0x0127('0x10c')](db[_0x0127('0x70')],{'as':_0x0127('0x146'),'foreignKey':_0x0127('0x147')});db['OpenchannelInteraction'][_0x0127('0x10c')](db[_0x0127('0x12')],{'as':_0x0127('0x15f'),'foreignKey':_0x0127('0xfc')});db['OpenchannelInteraction']['belongsToMany'](db[_0x0127('0x8b')],{'through':'openchannel_interaction_has_tags','as':_0x0127('0x153')});db[_0x0127('0x104')]['belongsToMany'](db[_0x0127('0x8b')],{'through':'openchannel_interaction_has_tags','as':'ThroughTags'});db[_0x0127('0x104')]['belongsToMany'](db[_0x0127('0x12')],{'as':_0x0127('0x154'),'through':'user_has_openchannel_interactions','foreignKey':_0x0127('0x16e')});db[_0x0127('0x16d')]['belongsTo'](db['User'],{'onDelete':_0x0127('0xfb'),'as':_0x0127('0x12')});db['OpenchannelMessage']['belongsTo'](db['CmContact'],{'onDelete':_0x0127('0xfb'),'as':_0x0127('0x146')});db['OpenchannelMessage'][_0x0127('0x10c')](db[_0x0127('0x104')],{'onDelete':'cascade','as':'Interaction','foreignKey':_0x0127('0x16e')});db[_0x0127('0x16d')]['belongsTo'](db[_0x0127('0x162')],{'as':_0x0127('0x162'),'foreignKey':_0x0127('0x163')});db[_0x0127('0x16d')][_0x0127('0x10c')](db[_0x0127('0x5d')],{'as':_0x0127('0x151'),'foreignKey':'OpenchannelAccountId'});db[_0x0127('0x11f')]['belongsToMany'](db['User'],{'as':'Agents','through':_0x0127('0x121'),'foreignKey':'OpenchannelQueueId'});db[_0x0127('0x11f')][_0x0127('0x10e')](db[_0x0127('0x113')],{'through':_0x0127('0x16f'),'as':_0x0127('0x13c')});db['ChatWebsite']['hasMany'](db[_0x0127('0x7d')],{'as':_0x0127('0x14a'),'foreignKey':_0x0127('0x170')});db[_0x0127('0x123')][_0x0127('0xfd')](db[_0x0127('0x15b')],{'as':'Answers','foreignKey':'ChatWebsiteId'});db['ChatWebsite'][_0x0127('0xfd')](db[_0x0127('0x6d')],{'as':_0x0127('0x171')});db[_0x0127('0x123')][_0x0127('0xfd')](db[_0x0127('0x106')],{'as':_0x0127('0x14c')});db[_0x0127('0x123')][_0x0127('0xfd')](db[_0x0127('0x64')],{'as':_0x0127('0x12d')});db['ChatWebsite'][_0x0127('0xfd')](db['ChatMessage'],{'as':_0x0127('0x141')});db[_0x0127('0x123')][_0x0127('0x10c')](db[_0x0127('0xf1')],{'as':_0x0127('0x157'),'foreignKey':_0x0127('0x158')});db['ChatWebsite'][_0x0127('0x10c')](db[_0x0127('0x81')],{'as':_0x0127('0x81'),'foreignKey':_0x0127('0x139')});db[_0x0127('0x123')][_0x0127('0x10c')](db[_0x0127('0x83')],{'as':_0x0127('0x15d'),'foreignKey':_0x0127('0x13a')});db[_0x0127('0x123')]['belongsToMany'](db['User'],{'as':_0x0127('0x13b'),'through':_0x0127('0x172')});db[_0x0127('0x173')]['belongsTo'](db[_0x0127('0x5d')],{});db[_0x0127('0x173')][_0x0127('0x10c')](db['CmList'],{'as':'List','foreignKey':_0x0127('0x158')});db[_0x0127('0x173')][_0x0127('0x10c')](db[_0x0127('0x70')],{'as':_0x0127('0x146'),'foreignKey':'ContactId'});db[_0x0127('0x173')]['belongsTo'](db['OpenchannelInteraction'],{});db[_0x0127('0x173')][_0x0127('0x10c')](db[_0x0127('0x16d')],{});db['OpenchannelQueueReport'][_0x0127('0x10c')](db[_0x0127('0x12')],{});db[_0x0127('0x173')][_0x0127('0x10c')](db[_0x0127('0x11f')],{});db[_0x0127('0x64')]['belongsTo'](db['User'],{'as':_0x0127('0x174'),'foreignKey':_0x0127('0xfc'),'onDelete':'restrict'});db['ChatApplication'][_0x0127('0x10c')](db[_0x0127('0x69')],{'as':_0x0127('0x175'),'foreignKey':_0x0127('0x176'),'onDelete':_0x0127('0x155')});db[_0x0127('0x64')][_0x0127('0x10c')](db[_0x0127('0x123')],{'as':_0x0127('0x177'),'foreignKey':_0x0127('0x170'),'onDelete':_0x0127('0x155')});db[_0x0127('0x64')][_0x0127('0x10c')](db['Tag'],{'onDelete':_0x0127('0x155'),'foreignKey':_0x0127('0x156')});db['ChatInteraction']['hasMany'](db['ChatMessage'],{'as':'Messages','onDelete':_0x0127('0xfb'),'foreignKey':_0x0127('0x178')});db[_0x0127('0x106')][_0x0127('0x10c')](db[_0x0127('0x123')],{'as':_0x0127('0x151'),'foreignKey':_0x0127('0x170')});db[_0x0127('0x106')][_0x0127('0x10c')](db[_0x0127('0x70')],{'as':_0x0127('0x146'),'foreignKey':_0x0127('0x147')});db['ChatInteraction'][_0x0127('0x10c')](db[_0x0127('0x12')],{'as':_0x0127('0x15f'),'foreignKey':_0x0127('0xfc')});db[_0x0127('0x106')][_0x0127('0x10e')](db[_0x0127('0x8b')],{'through':'chat_interaction_has_tags','as':'Tags'});db[_0x0127('0x106')][_0x0127('0x10e')](db['Tag'],{'through':_0x0127('0x179'),'as':_0x0127('0x161')});db[_0x0127('0x106')][_0x0127('0x10e')](db[_0x0127('0x12')],{'as':_0x0127('0x154'),'through':_0x0127('0x115'),'foreignKey':_0x0127('0x178')});db['ChatMessage'][_0x0127('0x10c')](db['User'],{'onDelete':_0x0127('0xfb'),'as':_0x0127('0x12')});db[_0x0127('0x66')][_0x0127('0x10c')](db[_0x0127('0x70')],{'onDelete':'cascade','as':'Contact','foreignKey':_0x0127('0x147')});db[_0x0127('0x66')]['belongsTo'](db[_0x0127('0x106')],{'onDelete':_0x0127('0xfb'),'as':_0x0127('0x169'),'foreignKey':_0x0127('0x178')});db[_0x0127('0x66')][_0x0127('0x10c')](db[_0x0127('0x162')],{'as':_0x0127('0x162'),'foreignKey':'AttachmentId'});db[_0x0127('0x66')][_0x0127('0x10c')](db[_0x0127('0x123')],{'as':_0x0127('0x151'),'foreignKey':_0x0127('0x170')});db[_0x0127('0x67')][_0x0127('0x10c')](db['CmContact'],{'onDelete':_0x0127('0xfb'),'as':_0x0127('0x146'),'foreignKey':_0x0127('0x147')});db['ChatOfflineMessage']['belongsTo'](db[_0x0127('0x123')],{'as':_0x0127('0x151'),'foreignKey':_0x0127('0x170')});db[_0x0127('0x69')][_0x0127('0x10e')](db['User'],{'as':_0x0127('0x13b'),'through':'UserChatQueue','hooks':!![]});db[_0x0127('0x69')][_0x0127('0x10e')](db[_0x0127('0x113')],{'through':_0x0127('0x17a'),'as':_0x0127('0x13c')});db[_0x0127('0x6b')][_0x0127('0xfd')](db[_0x0127('0xca')],{'as':'Messages','foreignKey':_0x0127('0x17b'),'onDelete':_0x0127('0xfb')});db[_0x0127('0x6b')]['belongsToMany'](db[_0x0127('0x12')],{'as':_0x0127('0x130'),'through':_0x0127('0x110')});db[_0x0127('0x6d')][_0x0127('0x10c')](db[_0x0127('0x123')],{'as':_0x0127('0x177'),'foreignKey':'ChatWebsiteId'});db[_0x0127('0x6f')][_0x0127('0xfd')](db[_0x0127('0x70')],{'as':_0x0127('0x17c'),'foreignKey':_0x0127('0x17d')});db[_0x0127('0x70')][_0x0127('0xfd')](db['CmHopper'],{'as':_0x0127('0x131'),'foreignKey':'ContactId'});db[_0x0127('0x70')][_0x0127('0xfd')](db[_0x0127('0x75')],{'as':_0x0127('0x133'),'foreignKey':_0x0127('0x147')});db[_0x0127('0x70')][_0x0127('0xfd')](db[_0x0127('0x102')],{'as':'HopperHistories','foreignKey':'ContactId'});db[_0x0127('0x70')][_0x0127('0xfd')](db[_0x0127('0x78')],{'as':_0x0127('0x78'),'foreignKey':'ContactId'});db[_0x0127('0x70')][_0x0127('0xfd')](db[_0x0127('0xcf')],{'as':_0x0127('0x135'),'foreignKey':_0x0127('0x147')});db[_0x0127('0x70')][_0x0127('0xfd')](db['OpenchannelInteraction'],{'as':_0x0127('0x105'),'foreignKey':'ContactId','onDelete':_0x0127('0x155')});db['CmContact']['hasMany'](db['ChatInteraction'],{'as':_0x0127('0x107'),'foreignKey':_0x0127('0x147'),'onDelete':'restrict'});db[_0x0127('0x70')][_0x0127('0xfd')](db[_0x0127('0x108')],{'as':_0x0127('0x109'),'foreignKey':'ContactId','onDelete':'restrict'});db[_0x0127('0x70')][_0x0127('0xfd')](db['FaxInteraction'],{'as':'FaxInteractions','foreignKey':_0x0127('0x147'),'onDelete':'restrict'});db[_0x0127('0x70')][_0x0127('0xfd')](db[_0x0127('0x41')],{'as':_0x0127('0x10b'),'foreignKey':'ContactId','onDelete':'restrict'});db[_0x0127('0x70')][_0x0127('0x10c')](db[_0x0127('0x6f')],{'as':_0x0127('0x17e'),'foreignKey':_0x0127('0x17d')});db[_0x0127('0x70')][_0x0127('0x10c')](db['CmList'],{'as':_0x0127('0x157'),'foreignKey':_0x0127('0x158'),'onDelete':_0x0127('0xfb')});db[_0x0127('0x70')][_0x0127('0x10e')](db[_0x0127('0x12')],{'as':_0x0127('0x154'),'through':'cm_user_has_contacts'});db['CmContact'][_0x0127('0x10e')](db['Tag'],{'as':_0x0127('0x153'),'through':_0x0127('0x17f')});db['CmContact'][_0x0127('0x10e')](db[_0x0127('0x8b')],{'through':_0x0127('0x17f'),'as':'ThroughTags'});db[_0x0127('0x72')][_0x0127('0x10c')](db[_0x0127('0x70')],{'as':'Contact','foreignKey':_0x0127('0x147'),'onDelete':_0x0127('0xfb')});db[_0x0127('0x72')][_0x0127('0x10c')](db['CmList'],{'as':'List','foreignKey':_0x0127('0x158'),'onDelete':_0x0127('0xfb')});db[_0x0127('0x72')][_0x0127('0x10c')](db[_0x0127('0x12')],{'as':_0x0127('0x174'),'foreignKey':_0x0127('0xfc')});db[_0x0127('0x72')][_0x0127('0x10c')](db[_0x0127('0x19')],{'as':_0x0127('0x175'),'foreignKey':_0x0127('0x132'),'onDelete':_0x0127('0xfb')});db[_0x0127('0x72')][_0x0127('0x10c')](db[_0x0127('0xe1')],{'as':_0x0127('0xe1'),'foreignKey':_0x0127('0x180'),'onDelete':'cascade'});db[_0x0127('0x72')][_0x0127('0x10c')](db[_0x0127('0x12')],{'as':_0x0127('0x15f'),'foreignKey':'OwnerId'});db['CmHopperBlack'][_0x0127('0x10c')](db[_0x0127('0x70')],{'as':_0x0127('0x146'),'foreignKey':'ContactId','onDelete':_0x0127('0xfb')});db[_0x0127('0x73')][_0x0127('0x10c')](db[_0x0127('0xf1')],{'as':_0x0127('0x157'),'foreignKey':_0x0127('0x158'),'onDelete':_0x0127('0xfb')});db[_0x0127('0x73')][_0x0127('0x10c')](db[_0x0127('0x19')],{'as':_0x0127('0x175'),'foreignKey':_0x0127('0x132'),'onDelete':_0x0127('0xfb')});db[_0x0127('0x73')][_0x0127('0x10c')](db[_0x0127('0xe1')],{'as':_0x0127('0xe1'),'foreignKey':_0x0127('0x180'),'onDelete':_0x0127('0xfb')});db[_0x0127('0x7a')][_0x0127('0xfd')](db[_0x0127('0x7f')],{'as':{'plural':_0x0127('0x181'),'singular':'OneAll'},'foreignKey':_0x0127('0x182'),'onDelete':'cascade','hooks':!![]});db[_0x0127('0x7a')]['hasMany'](db[_0x0127('0x7f')],{'as':{'plural':'Any','singular':'OneAny'},'foreignKey':_0x0127('0x183'),'onDelete':_0x0127('0xfb'),'hooks':!![]});db[_0x0127('0x7a')]['hasMany'](db[_0x0127('0x184')],{'as':_0x0127('0x185'),'foreignKey':'AutomationId','onDelete':'cascade','hooks':!![]});db[_0x0127('0x81')][_0x0127('0xfd')](db[_0x0127('0x81')],{'as':'Intervals','foreignKey':_0x0127('0x139'),'onDelete':_0x0127('0xfb'),'hooks':!![],'required':![]});db[_0x0127('0x81')][_0x0127('0xfd')](db[_0x0127('0x100')],{'as':'Extensions','foreignKey':_0x0127('0x139'),'onDelete':_0x0127('0x155')});db[_0x0127('0x81')][_0x0127('0xfd')](db[_0x0127('0x14d')],{'as':_0x0127('0x186'),'foreignKey':_0x0127('0x139')});db[_0x0127('0x81')][_0x0127('0xfd')](db[_0x0127('0x64')],{'as':_0x0127('0x187'),'foreignKey':_0x0127('0x139')});db['Interval'][_0x0127('0xfd')](db[_0x0127('0x4b')],{'as':'FaxApplications','foreignKey':_0x0127('0x139')});db[_0x0127('0x81')]['hasMany'](db[_0x0127('0x56')],{'as':_0x0127('0x188'),'foreignKey':'IntervalId'});db['Schedule']['belongsTo'](db[_0x0127('0x3d')],{});db[_0x0127('0x87')][_0x0127('0x10c')](db[_0x0127('0x96')],{'foreignKey':'DefaultReportId'});db[_0x0127('0x87')]['belongsTo'](db[_0x0127('0x189')],{'foreignKey':_0x0127('0x18a')});db[_0x0127('0x89')][_0x0127('0x10e')](db['VoiceMusicOnHold'],{'as':'Mohs','through':_0x0127('0x12f'),'onDelete':_0x0127('0x155')});db[_0x0127('0x8b')]['belongsToMany'](db[_0x0127('0x70')],{'through':_0x0127('0x17f')});db[_0x0127('0x8b')][_0x0127('0x10e')](db[_0x0127('0x106')],{'through':_0x0127('0x179')});db[_0x0127('0x8b')][_0x0127('0x10e')](db['MailInteraction'],{'through':_0x0127('0x152')});db['Tag']['belongsToMany'](db['SmsInteraction'],{'through':_0x0127('0x168')});db[_0x0127('0x8b')][_0x0127('0x10e')](db[_0x0127('0x4d')],{'through':_0x0127('0x160')});db[_0x0127('0x8b')]['belongsToMany'](db[_0x0127('0x104')],{'through':'openchannel_interaction_has_tags'});db[_0x0127('0x8f')][_0x0127('0xfd')](db[_0x0127('0x7f')],{'as':{'plural':'AllConditions','singular':'AllCondition'},'foreignKey':_0x0127('0x18b'),'onDelete':'cascade','hooks':!![]});db[_0x0127('0x8f')][_0x0127('0xfd')](db[_0x0127('0x7f')],{'as':{'plural':_0x0127('0x18c'),'singular':'AnyCondition'},'foreignKey':_0x0127('0x18d'),'onDelete':'cascade','hooks':!![]});db[_0x0127('0x8f')][_0x0127('0xfd')](db[_0x0127('0x184')],{'as':_0x0127('0x185'),'foreignKey':_0x0127('0x18e'),'onDelete':_0x0127('0xfb'),'hooks':!![]});db[_0x0127('0x189')][_0x0127('0xfd')](db[_0x0127('0x9a')],{'as':_0x0127('0x18f'),'onDelete':_0x0127('0xfb'),'foreignKey':_0x0127('0x18a'),'hooks':!![]});db[_0x0127('0x96')][_0x0127('0xfd')](db[_0x0127('0x9a')],{'as':_0x0127('0x18f'),'onDelete':_0x0127('0xfb'),'foreignKey':_0x0127('0x190')});db[_0x0127('0x191')]['hasMany'](db['AnalyticFieldReport'],{'as':_0x0127('0x18f'),'onDelete':_0x0127('0xfb'),'foreignKey':_0x0127('0x192')});db[_0x0127('0x9a')][_0x0127('0x10c')](db[_0x0127('0x191')],{'foreignKey':_0x0127('0x192')});db[_0x0127('0x193')][_0x0127('0xfd')](db[_0x0127('0x9d')],{'as':'Configurations','onDelete':_0x0127('0xfb'),'foreignKey':_0x0127('0x194')});db['SalesforceConfiguration'][_0x0127('0xfd')](db[_0x0127('0x195')],{'as':_0x0127('0x196'),'onDelete':_0x0127('0xfb'),'foreignKey':_0x0127('0x197')});db['SalesforceConfiguration']['hasMany'](db[_0x0127('0x195')],{'as':_0x0127('0x198'),'onDelete':_0x0127('0xfb'),'foreignKey':_0x0127('0x199')});db[_0x0127('0x9d')]['hasMany'](db['SalesforceField'],{'as':_0x0127('0x18f'),'onDelete':_0x0127('0xfb'),'foreignKey':_0x0127('0x19a')});db[_0x0127('0x9d')]['belongsTo'](db[_0x0127('0x193')],{'as':_0x0127('0x151'),'foreignKey':_0x0127('0x194')});db[_0x0127('0x195')][_0x0127('0xfd')](db[_0x0127('0x195')],{'as':_0x0127('0x19b'),'foreignKey':_0x0127('0x197')});db[_0x0127('0x195')]['hasMany'](db['SalesforceField'],{'as':'Description','foreignKey':_0x0127('0x199')});db[_0x0127('0x195')]['hasMany'](db[_0x0127('0x195')],{'as':'Field','foreignKey':'FieldId'});db[_0x0127('0x195')][_0x0127('0x10c')](db[_0x0127('0x91')],{'as':_0x0127('0x91'),'foreignKey':_0x0127('0x19c')});db['SugarcrmAccount'][_0x0127('0xfd')](db['SugarcrmConfiguration'],{'as':_0x0127('0x19d'),'onDelete':_0x0127('0xfb'),'foreignKey':_0x0127('0x194')});db[_0x0127('0xa1')][_0x0127('0xfd')](db[_0x0127('0xa3')],{'as':_0x0127('0x196'),'onDelete':_0x0127('0xfb'),'foreignKey':'SubjectId'});db[_0x0127('0xa1')][_0x0127('0xfd')](db[_0x0127('0xa3')],{'as':'Descriptions','onDelete':'cascade','foreignKey':_0x0127('0x199')});db[_0x0127('0xa1')][_0x0127('0xfd')](db[_0x0127('0xa3')],{'as':_0x0127('0x18f'),'onDelete':_0x0127('0xfb'),'foreignKey':'FieldId'});db[_0x0127('0xa1')]['belongsTo'](db[_0x0127('0xa0')],{'as':_0x0127('0x151'),'foreignKey':'AccountId'});db[_0x0127('0xa3')][_0x0127('0xfd')](db[_0x0127('0xa3')],{'as':_0x0127('0x19b'),'foreignKey':_0x0127('0x197')});db['SugarcrmField'][_0x0127('0xfd')](db['SugarcrmField'],{'as':_0x0127('0x19e'),'foreignKey':_0x0127('0x199')});db[_0x0127('0xa3')][_0x0127('0xfd')](db[_0x0127('0xa3')],{'as':'Field','foreignKey':_0x0127('0x19a')});db[_0x0127('0xa3')][_0x0127('0x10c')](db['Variable'],{'as':_0x0127('0x91'),'foreignKey':_0x0127('0x19c')});db[_0x0127('0xa5')]['hasMany'](db[_0x0127('0x19f')],{'as':_0x0127('0x19d'),'onDelete':_0x0127('0xfb'),'foreignKey':_0x0127('0x194')});db['DeskConfiguration'][_0x0127('0xfd')](db[_0x0127('0xa7')],{'as':_0x0127('0x196'),'onDelete':_0x0127('0xfb'),'foreignKey':_0x0127('0x197')});db[_0x0127('0x19f')]['hasMany'](db['DeskField'],{'as':_0x0127('0x198'),'onDelete':_0x0127('0xfb'),'foreignKey':_0x0127('0x199')});db['DeskConfiguration'][_0x0127('0xfd')](db[_0x0127('0xa7')],{'as':_0x0127('0x18f'),'onDelete':_0x0127('0xfb'),'foreignKey':_0x0127('0x19a')});db[_0x0127('0x19f')]['belongsTo'](db[_0x0127('0xa5')],{'as':_0x0127('0x151'),'foreignKey':_0x0127('0x194')});db['DeskConfiguration'][_0x0127('0x10e')](db[_0x0127('0x8b')],{'through':_0x0127('0x1a0')});db[_0x0127('0xa7')]['hasMany'](db[_0x0127('0xa7')],{'as':'Subject','foreignKey':_0x0127('0x197')});db[_0x0127('0xa7')]['hasMany'](db[_0x0127('0xa7')],{'as':'Description','foreignKey':'DescriptionId'});db[_0x0127('0xa7')]['hasMany'](db[_0x0127('0xa7')],{'as':_0x0127('0x1a1'),'foreignKey':_0x0127('0x19a')});db[_0x0127('0xa7')][_0x0127('0x10c')](db[_0x0127('0x91')],{'as':'Variable','foreignKey':'VariableId'});db[_0x0127('0x1a2')][_0x0127('0xfd')](db[_0x0127('0xa9')],{'as':_0x0127('0x19d'),'onDelete':_0x0127('0xfb'),'foreignKey':_0x0127('0x194')});db[_0x0127('0xa9')][_0x0127('0xfd')](db[_0x0127('0x1a3')],{'as':_0x0127('0x196'),'onDelete':'cascade','foreignKey':'SubjectId'});db[_0x0127('0xa9')]['hasMany'](db[_0x0127('0x1a3')],{'as':_0x0127('0x198'),'onDelete':_0x0127('0xfb'),'foreignKey':_0x0127('0x199')});db[_0x0127('0xa9')][_0x0127('0xfd')](db[_0x0127('0x1a3')],{'as':'Fields','onDelete':_0x0127('0xfb'),'foreignKey':_0x0127('0x19a')});db[_0x0127('0xa9')][_0x0127('0x10c')](db[_0x0127('0x1a2')],{'as':'Account','foreignKey':_0x0127('0x194')});db[_0x0127('0x1a3')][_0x0127('0xfd')](db[_0x0127('0x1a3')],{'as':_0x0127('0x19b'),'foreignKey':_0x0127('0x197')});db[_0x0127('0x1a3')]['hasMany'](db[_0x0127('0x1a3')],{'as':_0x0127('0x19e'),'foreignKey':_0x0127('0x199')});db[_0x0127('0x1a3')][_0x0127('0xfd')](db[_0x0127('0x1a3')],{'as':'Field','foreignKey':'FieldId'});db[_0x0127('0x1a3')][_0x0127('0x10c')](db['Variable'],{'as':_0x0127('0x91'),'foreignKey':_0x0127('0x19c')});db[_0x0127('0x1a4')]['hasMany'](db[_0x0127('0xac')],{'as':'Configurations','onDelete':_0x0127('0xfb'),'foreignKey':'AccountId'});db[_0x0127('0xac')][_0x0127('0xfd')](db['ZendeskField'],{'as':'Subjects','foreignKey':_0x0127('0x197')});db[_0x0127('0xac')][_0x0127('0xfd')](db[_0x0127('0xae')],{'as':'Descriptions','foreignKey':_0x0127('0x199')});db[_0x0127('0xac')][_0x0127('0xfd')](db[_0x0127('0xae')],{'as':'Fields','foreignKey':'FieldId'});db['ZendeskConfiguration'][_0x0127('0x10c')](db[_0x0127('0x1a4')],{'as':_0x0127('0x151'),'foreignKey':'AccountId'});db[_0x0127('0xac')][_0x0127('0x10e')](db[_0x0127('0x8b')],{'through':_0x0127('0x1a5')});db['ZendeskField'][_0x0127('0xfd')](db[_0x0127('0xae')],{'as':_0x0127('0x19b'),'foreignKey':_0x0127('0x197')});db[_0x0127('0xae')][_0x0127('0xfd')](db[_0x0127('0xae')],{'as':_0x0127('0x19e'),'foreignKey':_0x0127('0x199')});db[_0x0127('0xae')][_0x0127('0xfd')](db[_0x0127('0xae')],{'as':_0x0127('0x1a1'),'foreignKey':'FieldId'});db[_0x0127('0xae')][_0x0127('0x10c')](db['Variable'],{'as':_0x0127('0x91'),'foreignKey':_0x0127('0x19c')});db['FreshdeskAccount'][_0x0127('0xfd')](db[_0x0127('0xb1')],{'as':_0x0127('0x19d'),'onDelete':'cascade','foreignKey':_0x0127('0x194')});db[_0x0127('0xb1')][_0x0127('0xfd')](db[_0x0127('0xb3')],{'as':'Subjects','onDelete':_0x0127('0xfb'),'foreignKey':_0x0127('0x197')});db['FreshdeskConfiguration'][_0x0127('0xfd')](db[_0x0127('0xb3')],{'as':_0x0127('0x198'),'onDelete':_0x0127('0xfb'),'foreignKey':_0x0127('0x199')});db[_0x0127('0xb1')][_0x0127('0xfd')](db['FreshdeskField'],{'as':_0x0127('0x18f'),'onDelete':_0x0127('0xfb'),'foreignKey':'FieldId'});db[_0x0127('0xb1')][_0x0127('0x10c')](db[_0x0127('0xb0')],{'as':_0x0127('0x151'),'foreignKey':_0x0127('0x194')});db[_0x0127('0xb1')]['belongsToMany'](db[_0x0127('0x8b')],{'through':_0x0127('0x1a6')});db['FreshdeskField']['hasMany'](db[_0x0127('0xb3')],{'as':'Subject','foreignKey':_0x0127('0x197')});db[_0x0127('0xb3')][_0x0127('0xfd')](db[_0x0127('0xb3')],{'as':_0x0127('0x19e'),'foreignKey':_0x0127('0x199')});db[_0x0127('0xb3')]['hasMany'](db[_0x0127('0xb3')],{'as':_0x0127('0x1a1'),'foreignKey':_0x0127('0x19a')});db[_0x0127('0xb3')]['belongsTo'](db[_0x0127('0x91')],{'as':_0x0127('0x91'),'foreignKey':_0x0127('0x19c')});db[_0x0127('0xb5')][_0x0127('0xfd')](db['VtigerConfiguration'],{'as':_0x0127('0x19d'),'onDelete':'cascade','foreignKey':_0x0127('0x194')});db[_0x0127('0xb7')][_0x0127('0xfd')](db[_0x0127('0xb9')],{'as':_0x0127('0x196'),'foreignKey':_0x0127('0x197')});db['VtigerConfiguration'][_0x0127('0xfd')](db['VtigerField'],{'as':_0x0127('0x198'),'foreignKey':_0x0127('0x199')});db['VtigerConfiguration']['hasMany'](db[_0x0127('0xb9')],{'as':_0x0127('0x18f'),'foreignKey':'FieldId'});db[_0x0127('0xb7')][_0x0127('0x10c')](db[_0x0127('0xb5')],{'as':_0x0127('0x151'),'foreignKey':'AccountId'});db['VtigerConfiguration'][_0x0127('0x10e')](db[_0x0127('0x8b')],{'through':'int_vtiger_configuration_has_tags'});db[_0x0127('0xb9')]['hasMany'](db[_0x0127('0xb9')],{'as':_0x0127('0x19b'),'foreignKey':'SubjectId'});db[_0x0127('0xb9')][_0x0127('0xfd')](db[_0x0127('0xb9')],{'as':_0x0127('0x19e'),'foreignKey':'DescriptionId'});db[_0x0127('0xb9')][_0x0127('0xfd')](db['VtigerField'],{'as':'Field','foreignKey':_0x0127('0x19a')});db[_0x0127('0xb9')][_0x0127('0x10c')](db[_0x0127('0x91')],{'as':_0x0127('0x91'),'foreignKey':_0x0127('0x19c')});db[_0x0127('0xbb')][_0x0127('0xfd')](db[_0x0127('0x1a7')],{'as':_0x0127('0x19d'),'onDelete':_0x0127('0xfb'),'foreignKey':_0x0127('0x194')});db['ServicenowConfiguration'][_0x0127('0xfd')](db[_0x0127('0xbe')],{'as':_0x0127('0x196'),'foreignKey':_0x0127('0x197')});db[_0x0127('0x1a7')][_0x0127('0xfd')](db[_0x0127('0xbe')],{'as':'Descriptions','foreignKey':_0x0127('0x199')});db['ServicenowConfiguration']['hasMany'](db['ServicenowField'],{'as':_0x0127('0x18f'),'foreignKey':'FieldId'});db[_0x0127('0x1a7')]['belongsTo'](db['ServicenowAccount'],{'as':'Account','foreignKey':_0x0127('0x194')});db[_0x0127('0xbe')]['hasMany'](db[_0x0127('0xbe')],{'as':_0x0127('0x19b'),'foreignKey':_0x0127('0x197')});db[_0x0127('0xbe')][_0x0127('0xfd')](db[_0x0127('0xbe')],{'as':'Description','foreignKey':_0x0127('0x199')});db[_0x0127('0xbe')]['hasMany'](db[_0x0127('0xbe')],{'as':'Field','foreignKey':_0x0127('0x19a')});db[_0x0127('0xbe')][_0x0127('0x10c')](db[_0x0127('0x91')],{'as':_0x0127('0x91'),'foreignKey':_0x0127('0x19c')});db[_0x0127('0xc0')][_0x0127('0xfd')](db[_0x0127('0xc2')],{'as':'Configurations','onDelete':'cascade','foreignKey':_0x0127('0x194')});db[_0x0127('0xc2')][_0x0127('0xfd')](db[_0x0127('0xc4')],{'as':'Subjects','onDelete':_0x0127('0xfb'),'foreignKey':_0x0127('0x197')});db['Dynamics365Configuration'][_0x0127('0xfd')](db[_0x0127('0xc4')],{'as':'Descriptions','onDelete':_0x0127('0xfb'),'foreignKey':_0x0127('0x199')});db[_0x0127('0xc2')][_0x0127('0xfd')](db[_0x0127('0xc4')],{'as':'Fields','onDelete':_0x0127('0xfb'),'foreignKey':'FieldId'});db[_0x0127('0xc2')][_0x0127('0x10c')](db['Dynamics365Account'],{'as':_0x0127('0x151'),'foreignKey':_0x0127('0x194')});db['Dynamics365Field'][_0x0127('0xfd')](db['Dynamics365Field'],{'as':_0x0127('0x19b'),'foreignKey':'SubjectId'});db[_0x0127('0xc4')][_0x0127('0xfd')](db[_0x0127('0xc4')],{'as':_0x0127('0x19e'),'foreignKey':_0x0127('0x199')});db['Dynamics365Field']['hasMany'](db[_0x0127('0xc4')],{'as':_0x0127('0x1a1'),'foreignKey':_0x0127('0x19a')});db[_0x0127('0xc4')][_0x0127('0x10c')](db[_0x0127('0x91')],{'as':_0x0127('0x91'),'foreignKey':_0x0127('0x19c')});db[_0x0127('0xc8')][_0x0127('0x10c')](db[_0x0127('0x123')],{});db[_0x0127('0xc8')][_0x0127('0x10c')](db[_0x0127('0xf1')],{'as':_0x0127('0x157'),'foreignKey':_0x0127('0x158')});db[_0x0127('0xc8')][_0x0127('0x10c')](db[_0x0127('0x70')],{'as':_0x0127('0x146'),'foreignKey':'ContactId'});db['ChatQueueReport'][_0x0127('0x10c')](db[_0x0127('0x106')],{});db[_0x0127('0xc8')][_0x0127('0x10c')](db[_0x0127('0x66')],{});db[_0x0127('0xc8')][_0x0127('0x10c')](db[_0x0127('0x12')],{});db['ChatQueueReport']['belongsTo'](db['ChatQueue'],{});db[_0x0127('0xca')][_0x0127('0x10c')](db[_0x0127('0x12')],{'onDelete':_0x0127('0xfb'),'foreignKey':_0x0127('0x1a8')});db['ChatInternalMessage'][_0x0127('0x10c')](db[_0x0127('0x12')],{'onDelete':'cascade','foreignKey':_0x0127('0x1a9')});db[_0x0127('0xcf')]['hasMany'](db[_0x0127('0xce')],{'foreignKey':_0x0127('0x1aa'),'onDelete':'cascade'});db[_0x0127('0xcf')][_0x0127('0xfd')](db[_0x0127('0xcc')],{'foreignKey':_0x0127('0x1aa'),'onDelete':_0x0127('0xfb')});db[_0x0127('0xd1')][_0x0127('0x10c')](db[_0x0127('0x54')],{});db[_0x0127('0xd1')][_0x0127('0x10c')](db[_0x0127('0xf1')],{'as':_0x0127('0x157'),'foreignKey':_0x0127('0x158')});db['SmsQueueReport'][_0x0127('0x10c')](db[_0x0127('0x70')],{'as':'Contact','foreignKey':_0x0127('0x147')});db['SmsQueueReport'][_0x0127('0x10c')](db['SmsInteraction'],{});db['SmsQueueReport']['belongsTo'](db['SmsMessage'],{});db[_0x0127('0xd1')][_0x0127('0x10c')](db['User'],{});db[_0x0127('0xd1')]['belongsTo'](db[_0x0127('0x5b')],{});db[_0x0127('0xd4')][_0x0127('0xfd')](db['JscriptySessionReport'],{'foreignKey':_0x0127('0x1ab')});db[_0x0127('0xd4')][_0x0127('0xfd')](db[_0x0127('0xce')],{'foreignKey':_0x0127('0x1ab')});db[_0x0127('0xd4')][_0x0127('0xfd')](db[_0x0127('0xcc')],{'foreignKey':'ProjectId'});db['SquareProject'][_0x0127('0x10e')](db[_0x0127('0x12')],{'as':_0x0127('0x154'),'through':_0x0127('0x1ac')});db[_0x0127('0x113')]['belongsToMany'](db[_0x0127('0x12')],{'as':'Agents','through':_0x0127('0x1ad')});db[_0x0127('0x113')]['belongsToMany'](db[_0x0127('0x19')],{'through':_0x0127('0x13d'),'as':_0x0127('0x1ae')});db[_0x0127('0x113')][_0x0127('0x10e')](db[_0x0127('0x119')],{'through':_0x0127('0x14f'),'as':_0x0127('0x11a')});db[_0x0127('0x113')][_0x0127('0x10e')](db[_0x0127('0x69')],{'through':_0x0127('0x17a'),'as':'ChatQueues'});db['Team'][_0x0127('0x10e')](db[_0x0127('0x164')],{'through':'team_has_fax_queues','as':_0x0127('0x11c')});db[_0x0127('0x113')][_0x0127('0x10e')](db[_0x0127('0x5b')],{'through':_0x0127('0x16b'),'as':_0x0127('0x11e')});db[_0x0127('0x113')][_0x0127('0x10e')](db[_0x0127('0x11f')],{'through':'team_has_openchannel_queues','as':_0x0127('0x120')});db[_0x0127('0xe1')][_0x0127('0xfd')](db['CmHopper'],{'as':_0x0127('0x131'),'foreignKey':'CampaignId'});db[_0x0127('0xe1')]['hasMany'](db[_0x0127('0x75')],{'as':'HopperFinals','foreignKey':_0x0127('0x180')});db[_0x0127('0xe1')][_0x0127('0xfd')](db[_0x0127('0x102')],{'as':_0x0127('0x1af'),'foreignKey':_0x0127('0x180')});db['Campaign']['hasMany'](db[_0x0127('0x73')],{'as':_0x0127('0x134'),'foreignKey':_0x0127('0x180')});db[_0x0127('0xe1')]['belongsTo'](db['Trunk'],{'as':_0x0127('0x136'),'foreignKey':'TrunkId'});db['Campaign']['belongsTo'](db['Trunk'],{'as':_0x0127('0x1b0'),'foreignKey':_0x0127('0x138')});db['Campaign'][_0x0127('0x10c')](db[_0x0127('0x81')],{'as':_0x0127('0x81'),'foreignKey':_0x0127('0x139')});db[_0x0127('0xe1')][_0x0127('0x10c')](db[_0x0127('0xd8')],{'as':'SquareProject','foreignKey':'SquareProjectId'});db[_0x0127('0xe1')][_0x0127('0x10e')](db['CmList'],{'as':'Lists','through':'campaigns_has_cm_lists'});db['Campaign'][_0x0127('0x10e')](db[_0x0127('0xf1')],{'as':_0x0127('0x13e'),'through':_0x0127('0x1b1')});db[_0x0127('0xe7')][_0x0127('0x10c')](db[_0x0127('0x42')],{});db[_0x0127('0xe7')][_0x0127('0x10c')](db['MailInteraction'],{});db[_0x0127('0xe7')][_0x0127('0x10c')](db[_0x0127('0x3d')],{'foreignKey':_0x0127('0x1b2'),'as':_0x0127('0x1b3')});db[_0x0127('0xe7')][_0x0127('0x10c')](db['User'],{'foreignKey':'FromUserId','as':_0x0127('0x1b4')});db[_0x0127('0xe7')][_0x0127('0x10c')](db[_0x0127('0x12')],{'foreignKey':_0x0127('0x1b5'),'as':'ToAgent'});db[_0x0127('0xe7')]['belongsTo'](db[_0x0127('0x119')],{'foreignKey':_0x0127('0x1b6'),'as':'ToQueue'});db[_0x0127('0xe7')]['belongsTo'](db[_0x0127('0x3d')],{'foreignKey':_0x0127('0x1b7'),'as':_0x0127('0x1b8')});db['ChatTransferReport'][_0x0127('0x10c')](db[_0x0127('0x66')],{});db[_0x0127('0xe9')][_0x0127('0x10c')](db['ChatInteraction'],{});db['ChatTransferReport'][_0x0127('0x10c')](db['ChatWebsite'],{'foreignKey':'FromChatWebsiteId','as':_0x0127('0x1b3')});db['ChatTransferReport'][_0x0127('0x10c')](db[_0x0127('0x12')],{'foreignKey':'FromUserId','as':_0x0127('0x1b4')});db[_0x0127('0xe9')][_0x0127('0x10c')](db[_0x0127('0x12')],{'foreignKey':'ToUserId','as':_0x0127('0x1b9')});db[_0x0127('0xe9')][_0x0127('0x10c')](db[_0x0127('0x69')],{'foreignKey':_0x0127('0x1ba'),'as':'ToQueue'});db['ChatTransferReport']['belongsTo'](db[_0x0127('0x123')],{'foreignKey':'ToChatWebsiteId','as':_0x0127('0x1b8')});db[_0x0127('0xeb')][_0x0127('0x10c')](db[_0x0127('0x4f')],{});db[_0x0127('0xeb')][_0x0127('0x10c')](db['FaxInteraction'],{});db['FaxTransferReport'][_0x0127('0x10c')](db['FaxAccount'],{'foreignKey':_0x0127('0x1bb'),'as':_0x0127('0x1b3')});db[_0x0127('0xeb')]['belongsTo'](db[_0x0127('0x12')],{'foreignKey':'FromUserId','as':_0x0127('0x1b4')});db['FaxTransferReport'][_0x0127('0x10c')](db['User'],{'foreignKey':_0x0127('0x1b5'),'as':_0x0127('0x1b9')});db['FaxTransferReport']['belongsTo'](db[_0x0127('0x164')],{'foreignKey':'ToFaxQueueId','as':_0x0127('0x1bc')});db[_0x0127('0xeb')][_0x0127('0x10c')](db[_0x0127('0x49')],{'foreignKey':_0x0127('0x1bd'),'as':'ToAccount'});db[_0x0127('0xed')]['belongsTo'](db['OpenchannelMessage'],{});db['OpenchannelTransferReport'][_0x0127('0x10c')](db[_0x0127('0x104')],{});db[_0x0127('0xed')][_0x0127('0x10c')](db[_0x0127('0x5d')],{'foreignKey':'FromOpenchannelAccountId','as':'FromAccount'});db['OpenchannelTransferReport'][_0x0127('0x10c')](db[_0x0127('0x12')],{'foreignKey':'FromUserId','as':_0x0127('0x1b4')});db['OpenchannelTransferReport']['belongsTo'](db[_0x0127('0x12')],{'foreignKey':'ToUserId','as':'ToAgent'});db[_0x0127('0xed')][_0x0127('0x10c')](db[_0x0127('0x11f')],{'foreignKey':_0x0127('0x1be'),'as':_0x0127('0x1bc')});db[_0x0127('0xed')][_0x0127('0x10c')](db[_0x0127('0x5d')],{'foreignKey':'ToOpenchannelAccountId','as':_0x0127('0x1b8')});db[_0x0127('0xef')][_0x0127('0x10c')](db['SmsMessage'],{});db[_0x0127('0xef')]['belongsTo'](db[_0x0127('0x108')],{});db[_0x0127('0xef')][_0x0127('0x10c')](db[_0x0127('0x54')],{'foreignKey':_0x0127('0x1bf'),'as':_0x0127('0x1b3')});db[_0x0127('0xef')][_0x0127('0x10c')](db[_0x0127('0x12')],{'foreignKey':_0x0127('0x1c0'),'as':_0x0127('0x1b4')});db[_0x0127('0xef')][_0x0127('0x10c')](db['User'],{'foreignKey':_0x0127('0x1b5'),'as':'ToAgent'});db['SmsTransferReport']['belongsTo'](db[_0x0127('0x5b')],{'foreignKey':_0x0127('0x1c1'),'as':'ToQueue'});db['SmsTransferReport'][_0x0127('0x10c')](db[_0x0127('0x54')],{'foreignKey':_0x0127('0x1c2'),'as':_0x0127('0x1b8')});db['CmList'][_0x0127('0xfd')](db[_0x0127('0x7d')],{'as':'Dispositions','foreignKey':_0x0127('0x158')});db[_0x0127('0xf1')][_0x0127('0xfd')](db[_0x0127('0x1c3')],{'as':'CustomFields','foreignKey':_0x0127('0x158')});db[_0x0127('0xf1')]['hasMany'](db['CmContact'],{'as':_0x0127('0x17c'),'onDelete':_0x0127('0xfb'),'foreignKey':_0x0127('0x158')});db['CmList'][_0x0127('0xfd')](db[_0x0127('0x75')],{'as':'HopperFinals','foreignKey':_0x0127('0x158')});db['CmList'][_0x0127('0xfd')](db['CmHopperHistory'],{'as':'HopperHistory','foreignKey':_0x0127('0x158')});db[_0x0127('0xf1')]['hasMany'](db[_0x0127('0x78')],{'as':_0x0127('0x78'),'foreignKey':_0x0127('0x158')});db[_0x0127('0xf1')][_0x0127('0x10e')](db['VoiceQueue'],{'as':'Queues','through':_0x0127('0x1c4')});db[_0x0127('0xf1')][_0x0127('0x10e')](db[_0x0127('0x12')],{'as':'Agents','through':_0x0127('0x112')});db[_0x0127('0xf2')]['hasMany'](db[_0x0127('0x100')],{'as':_0x0127('0x101'),'onDelete':_0x0127('0x155')});db[_0x0127('0xf2')][_0x0127('0x10e')](db['User'],{'as':_0x0127('0x13b'),'through':_0x0127('0x122')});db[_0x0127('0xf4')][_0x0127('0xfd')](db['User'],{'as':'Users','foreignKey':_0x0127('0x10d')});db[_0x0127('0xf4')]['hasMany'](db[_0x0127('0xf6')],{'as':_0x0127('0x1c5'),'foreignKey':_0x0127('0x10d'),'onDelete':_0x0127('0xfb')});db[_0x0127('0xf6')][_0x0127('0xfd')](db['UserProfileResource'],{'as':_0x0127('0x1c6'),'foreignKey':_0x0127('0x1c7'),'onDelete':_0x0127('0xfb')});module['exports']={'db':db,'dbH':dbH}; \ No newline at end of file +var _0xbfa0=['utf8_general_ci','defaultsDeep','mysql','database','username','password','options','sequelizeHistory','User','import','VoiceChanSpy','../api/voiceChanSpy/voiceChanSpy.model','VoiceContext','../api/voiceContext/voiceContext.model','VoiceExtension','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','../api/voiceQueue/voiceQueue.model','../api/voiceRecording/voiceRecording.model','../api/screenRecording/screenRecording.model','VoiceMail','VoiceMailMessage','../api/voiceMailMessage/voiceMailMessage.model','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','../api/memberReport/memberReport.model','Trunk','VoiceTransferReport','../api/voiceTransferReport/voiceTransferReport.model','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','UserChatQueue','../api/userChatQueue/userChatQueue.model','UserMailQueue','../api/userMailQueue/userMailQueue.model','UserFaxQueue','UserSmsQueue','../api/userSmsQueue/userSmsQueue.model','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','MailServerIn','MailServerOut','../api/mailServerOut/mailServerOut.model','MailAccount','MailQueue','../api/mailQueue/mailQueue.model','MailSubstatus','MailInteraction','../api/mailInteraction/mailInteraction.model','MailMessage','../api/mailMessage/mailMessage.model','MailApplication','../api/mailApplication/mailApplication.model','MailQueueReport','../api/mailQueueReport/mailQueueReport.model','DashboardItem','../api/dashboardItem/dashboardItem.model','FaxAccount','../api/faxAccount/faxAccount.model','FaxApplication','FaxInteraction','../api/faxInteraction/faxInteraction.model','FaxMessage','../api/faxMessage/faxMessage.model','FaxQueue','../api/faxQueue/faxQueue.model','../api/faxQueueReport/faxQueueReport.model','../api/smsAccount/smsAccount.model','../api/smsInteraction/smsInteraction.model','SmsMessage','../api/smsMessage/smsMessage.model','SmsQueue','../api/smsQueue/smsQueue.model','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','../api/openchannelApplication/openchannelApplication.model','OpenchannelInteraction','../api/openchannelInteraction/openchannelInteraction.model','OpenchannelMessage','../api/openchannelMessage/openchannelMessage.model','../api/openchannelQueue/openchannelQueue.model','ChatWebsite','../api/chatWebsite/chatWebsite.model','OpenchannelQueueReport','../api/openchannelQueueReport/openchannelQueueReport.model','ChatApplication','ChatInteraction','ChatMessage','../api/chatMessage/chatMessage.model','../api/chatOfflineMessage/chatOfflineMessage.model','ChatQueue','ChatGroup','../api/chatGroup/chatGroup.model','ChatProactiveAction','CmCompany','../api/cmCompany/cmCompany.model','CmContact','../api/cmContact/cmContact.model','CmHopper','../api/cmHopper/cmHopper.model','CmHopperHistory','../api/cmHopperHistory/cmHopperHistory.model','ReportAgentPreview','../api/reportAgentPreview/reportAgentPreview.model','CmCustomField','../api/cmCustomField/cmCustomField.model','Action','../api/action/action.model','Automation','../api/automation/automation.model','CannedAnswer','../api/cannedAnswer/cannedAnswer.model','Disposition','../api/disposition/disposition.model','../api/condition/condition.model','Interval','../api/interval/interval.model','../api/pause/pause.model','Cdr','../api/cdr/cdr.model','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','../api/schedule/schedule.model','Sound','../api/sound/sound.model','Tag','../api/tag/tag.model','Template','../api/template/template.model','../api/trigger/trigger.model','../api/variable/variable.model','Integration','../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','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','../api/intSalesforceField/intSalesforceField.model','SugarcrmAccount','../api/intSugarcrmAccount/intSugarcrmAccount.model','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','SugarcrmField','../api/intSugarcrmField/intSugarcrmField.model','DeskAccount','../api/intDeskAccount/intDeskAccount.model','../api/intDeskConfiguration/intDeskConfiguration.model','DeskField','../api/intDeskField/intDeskField.model','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','ZohoConfiguration','../api/intZohoConfiguration/intZohoConfiguration.model','ZohoField','../api/intZohoField/intZohoField.model','../api/intZendeskAccount/intZendeskAccount.model','ZendeskConfiguration','../api/intZendeskConfiguration/intZendeskConfiguration.model','ZendeskField','FreshdeskAccount','../api/intFreshdeskAccount/intFreshdeskAccount.model','FreshdeskConfiguration','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','../api/intFreshdeskField/intFreshdeskField.model','VtigerAccount','../api/intVtigerAccount/intVtigerAccount.model','../api/intVtigerField/intVtigerField.model','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','ServicenowConfiguration','../api/intServicenowConfiguration/intServicenowConfiguration.model','ServicenowField','../api/intServicenowField/intServicenowField.model','Dynamics365Account','../api/intDynamics365Account/intDynamics365Account.model','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','Network','../api/network/network.model','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','../api/chatInternalMessage/chatInternalMessage.model','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','../api/squareReport/squareReport.model','SquareDetailsReport','../api/jscriptyProject/jscriptyProject.model','Setting','SquareOdbc','../api/squareOdbc/squareOdbc.model','SquareProject','../api/squareProject/squareProject.model','SquareRecording','SquareMessage','../api/squareMessage/squareMessage.model','License','../api/license/license.model','Campaign','../api/campaign/campaign.model','Migration','../api/migration/migration.model','Attachment','../api/attachment/attachment.model','Plugin','../api/plugin/plugin.model','MailTransferReport','../api/mailTransferReport/mailTransferReport.model','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','CmList','../api/cmList/cmList.model','VoicePrefix','../api/voicePrefix/voicePrefix.model','UserProfile','../api/userProfileSection/userProfileSection.model','UserProfileResource','../api/userProfileResource/userProfileResource.model','cascade','UserId','hasMany','Recordings','UserVoiceQueueRt','Extensions','CmHopperFinal','OpenchannelInteractions','ChatInteractions','SmsInteraction','SmsInteractions','MailInteractions','belongsTo','userProfileId','belongsToMany','Groups','Contacts','cm_user_has_contacts','Lists','cm_user_has_lists','user_has_teams','user_has_mail_interactions','user_has_chat_interactions','FaxInteractions','user_has_fax_interactions','user_has_sms_interactions','user_has_openchannel_interactions','VoiceQueue','VoiceQueues','FaxQueues','SmsQueues','OpenchannelQueues','VoicePrefixes','user_has_chat_websites','FaxAccounts','user_has_fax_accounts','MailAccounts','user_has_mail_accounts','user_has_openchannel_accounts','SmsAccount','user_has_sms_accounts','SquareProjects','user_has_square_projects','SpiedAgents','ChanSpyId','Applications','Sounds','Members','VoiceQueueId','Hoppers','HopperFinals','HopperHistories','HopperBlacks','JscriptySessionReport','JscriptySessions','TrunkBackupId','IntervalId','Pause','mandatoryDispositionPause','mandatoryDispositionPauseId','Agents','Team','Teams','team_has_voice_queues','BlackLists','voice_queues_has_cm_blacklists','ScreenRecording','mailbox','mailboxuser','VoiceCallReport','QueueCalls','uniqueid','VoiceAgentReport','Contact','ContactId','MailAccountId','hasOne','Imap','Smtp','Dispositions','Answers','Messages','Interactions','team_has_mail_queues','MailInteractionId','Account','Owner','mail_interaction_has_tags','Users','Attachments','Interaction','restrict','TagId','List','ListId','Dashboard','Items','FaxAccountId','Exntensions','fax_interaction_has_tags','ThroughTags','FaxInteractionId','team_has_fax_queues','FaxQueueReport','SmsAccountId','SmsApplication','SmsInteractionId','Tags','SmsQueueId','team_has_sms_queues','OpenchannelAccountId','OpenchannelApplication','OpenchannelQueue','OpenchannelQueueId','openchannel_interaction_has_tags','AttachmentId','team_has_openchannel_queues','ChatWebsiteId','ProactiveActions','Agent','ChatQueueId','ChatInteractionId','chat_interaction_has_tags','ChatOfflineMessage','team_has_chat_queues','chat_group_has_users','Website','CompanyId','Company','cm_contact_has_tags','Queue','OwnerId','CmHopperBlack','CampaignId','Condition','All','OneAll','AutomationAllId','AutomationAnyId','Actions','AutomationId','MailApplications','ChatApplications','SmsApplications','CustomReportId','Mohs','moh_has_sounds','sms_interaction_has_tags','Trigger','AllConditions','AllCondition','TriggerAllId','AnyConditions','TriggerId','Fields','MetricId','Configurations','AccountId','Descriptions','DescriptionId','SalesforceField','FieldId','Subject','Description','Field','Variable','VariableId','Subjects','SubjectId','DeskConfiguration','int_desk_configuration_has_tags','ZendeskAccount','int_zendesk_configuration_has_tags','int_freshdesk_configuration_has_tags','VtigerConfiguration','VtigerField','int_vtiger_configuration_has_tags','Dynamics365Configuration','FromId','JscriptyQuestionReport','SessionId','JscriptyProject','ProjectId','JscriptyAnswerReport','MailQueues','ChatQueues','TrunkId','FromMailAccountId','FromAccount','FromUserId','FromAgent','ToAgent','ToMailQueueId','ToQueue','ToMailAccountId','ToAccount','FromChatWebsiteId','ToChatQueueId','FromFaxAccountId','ToFaxQueueId','ToFaxAccountId','FromOpenchannelAccountId','ToOpenchannelQueueId','ToOpenchannelAccountId','ToUserId','ToSmsQueueId','ToSmsAccountId','CustomFields','HopperHistory','Queues','voice_queues_has_cm_lists','user_has_voice_prefixes','UserProfileSection','UserProfileSections','Resources','sectionId','exports','path','../config/environment','sequelize','lodash','jstz','determine','motion2','xcall','xC@LL1234','127.0.0.1','utf8mb4','name','utf8'];(function(_0x46996b,_0x4b2499){var _0x10e0ee=function(_0x52b70f){while(--_0x52b70f){_0x46996b['push'](_0x46996b['shift']());}};_0x10e0ee(++_0x4b2499);}(_0xbfa0,0x1ce));var _0x0bfa=function(_0x5d53dd,_0x558fb2){_0x5d53dd=_0x5d53dd-0x0;var _0x8a495e=_0xbfa0[_0x5d53dd];return _0x8a495e;};'use strict';var path=require(_0x0bfa('0x0'));var config=require(_0x0bfa('0x1'));var Sequelize=require(_0x0bfa('0x2'));var _=require(_0x0bfa('0x3'));var jstz=require(_0x0bfa('0x4'));var timezone=jstz[_0x0bfa('0x5')]();config[_0x0bfa('0x2')]=_['defaultsDeep'](config[_0x0bfa('0x2')],{'database':_0x0bfa('0x6'),'username':_0x0bfa('0x7'),'password':_0x0bfa('0x8'),'options':{'host':_0x0bfa('0x9'),'port':0xcea,'dialect':'mysql','dialectOptions':{'charset':_0x0bfa('0xa')},'logging':![],'timezone':timezone[_0x0bfa('0xb')](),'define':{'charset':_0x0bfa('0xc'),'collate':_0x0bfa('0xd')}}});config['sequelizeHistory']=_[_0x0bfa('0xe')](config['sequelizeHistory'],{'database':_0x0bfa('0x6'),'username':_0x0bfa('0x7'),'password':_0x0bfa('0x8'),'options':{'host':_0x0bfa('0x9'),'port':0xcea,'dialect':_0x0bfa('0xf'),'dialectOptions':{'charset':'utf8mb4'},'logging':![],'timezone':timezone[_0x0bfa('0xb')](),'define':{'charset':_0x0bfa('0xc'),'collate':'utf8_general_ci'}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelize'][_0x0bfa('0x10')],config['sequelize'][_0x0bfa('0x11')],config[_0x0bfa('0x2')][_0x0bfa('0x12')],config[_0x0bfa('0x2')][_0x0bfa('0x13')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x0bfa('0x14')][_0x0bfa('0x10')],config[_0x0bfa('0x14')][_0x0bfa('0x11')],config['sequelizeHistory'][_0x0bfa('0x12')],config[_0x0bfa('0x14')][_0x0bfa('0x13')])};db[_0x0bfa('0x15')]=db[_0x0bfa('0x2')][_0x0bfa('0x16')]('../api/user/user.model');db[_0x0bfa('0x17')]=db['sequelize']['import'](_0x0bfa('0x18'));db[_0x0bfa('0x19')]=db['sequelize'][_0x0bfa('0x16')](_0x0bfa('0x1a'));db[_0x0bfa('0x1b')]=db[_0x0bfa('0x2')]['import'](_0x0bfa('0x1c'));db[_0x0bfa('0x1d')]=db['sequelize'][_0x0bfa('0x16')](_0x0bfa('0x1e'));db['VoiceQueue']=db[_0x0bfa('0x2')]['import'](_0x0bfa('0x1f'));db['VoiceRecording']=db[_0x0bfa('0x2')][_0x0bfa('0x16')](_0x0bfa('0x20'));db['ScreenRecording']=db['sequelize'][_0x0bfa('0x16')](_0x0bfa('0x21'));db[_0x0bfa('0x22')]=db[_0x0bfa('0x2')][_0x0bfa('0x16')]('../api/voiceMail/voiceMail.model');db[_0x0bfa('0x23')]=db['sequelize'][_0x0bfa('0x16')](_0x0bfa('0x24'));db['VoiceCallReport']=db[_0x0bfa('0x2')][_0x0bfa('0x16')](_0x0bfa('0x25'));db[_0x0bfa('0x26')]=db[_0x0bfa('0x2')]['import'](_0x0bfa('0x27'));db['VoiceAgentReport']=db['sequelize'][_0x0bfa('0x16')]('../api/voiceAgentReport/voiceAgentReport.model');db[_0x0bfa('0x28')]=db[_0x0bfa('0x2')]['import'](_0x0bfa('0x29'));db[_0x0bfa('0x2a')]=db[_0x0bfa('0x2')][_0x0bfa('0x16')](_0x0bfa('0x2b'));db[_0x0bfa('0x2c')]=db['sequelize'][_0x0bfa('0x16')]('../api/trunk/trunk.model');db[_0x0bfa('0x2d')]=db['sequelize'][_0x0bfa('0x16')](_0x0bfa('0x2e'));db['UserVoiceQueueRt']=db['sequelize']['import'](_0x0bfa('0x2f'));db[_0x0bfa('0x30')]=db[_0x0bfa('0x2')][_0x0bfa('0x16')]('../api/userVoiceQueue/userVoiceQueue.model');db[_0x0bfa('0x31')]=db[_0x0bfa('0x2')][_0x0bfa('0x16')](_0x0bfa('0x32'));db[_0x0bfa('0x33')]=db[_0x0bfa('0x2')][_0x0bfa('0x16')](_0x0bfa('0x34'));db[_0x0bfa('0x35')]=db[_0x0bfa('0x2')][_0x0bfa('0x16')]('../api/userFaxQueue/userFaxQueue.model');db[_0x0bfa('0x36')]=db['sequelize']['import'](_0x0bfa('0x37'));db[_0x0bfa('0x38')]=db[_0x0bfa('0x2')][_0x0bfa('0x16')](_0x0bfa('0x39'));db[_0x0bfa('0x3a')]=db[_0x0bfa('0x2')][_0x0bfa('0x16')]('../api/mailServerIn/mailServerIn.model');db[_0x0bfa('0x3b')]=db[_0x0bfa('0x2')][_0x0bfa('0x16')](_0x0bfa('0x3c'));db[_0x0bfa('0x3d')]=db[_0x0bfa('0x2')]['import']('../api/mailAccount/mailAccount.model');db[_0x0bfa('0x3e')]=db[_0x0bfa('0x2')][_0x0bfa('0x16')](_0x0bfa('0x3f'));db[_0x0bfa('0x40')]=db[_0x0bfa('0x2')][_0x0bfa('0x16')]('../api/mailSubstatus/mailSubstatus.model');db[_0x0bfa('0x41')]=db[_0x0bfa('0x2')]['import'](_0x0bfa('0x42'));db[_0x0bfa('0x43')]=db['sequelize'][_0x0bfa('0x16')](_0x0bfa('0x44'));db[_0x0bfa('0x45')]=db[_0x0bfa('0x2')]['import'](_0x0bfa('0x46'));db[_0x0bfa('0x47')]=db[_0x0bfa('0x2')][_0x0bfa('0x16')](_0x0bfa('0x48'));db['Dashboard']=db[_0x0bfa('0x2')][_0x0bfa('0x16')]('../api/dashboard/dashboard.model');db[_0x0bfa('0x49')]=db[_0x0bfa('0x2')][_0x0bfa('0x16')](_0x0bfa('0x4a'));db[_0x0bfa('0x4b')]=db[_0x0bfa('0x2')][_0x0bfa('0x16')](_0x0bfa('0x4c'));db[_0x0bfa('0x4d')]=db[_0x0bfa('0x2')][_0x0bfa('0x16')]('../api/faxApplication/faxApplication.model');db[_0x0bfa('0x4e')]=db[_0x0bfa('0x2')][_0x0bfa('0x16')](_0x0bfa('0x4f'));db[_0x0bfa('0x50')]=db[_0x0bfa('0x2')][_0x0bfa('0x16')](_0x0bfa('0x51'));db[_0x0bfa('0x52')]=db[_0x0bfa('0x2')][_0x0bfa('0x16')](_0x0bfa('0x53'));db['FaxQueueReport']=db['sequelize'][_0x0bfa('0x16')](_0x0bfa('0x54'));db['SmsAccount']=db['sequelize']['import'](_0x0bfa('0x55'));db['SmsApplication']=db[_0x0bfa('0x2')][_0x0bfa('0x16')]('../api/smsApplication/smsApplication.model');db['SmsInteraction']=db[_0x0bfa('0x2')][_0x0bfa('0x16')](_0x0bfa('0x56'));db[_0x0bfa('0x57')]=db[_0x0bfa('0x2')]['import'](_0x0bfa('0x58'));db[_0x0bfa('0x59')]=db[_0x0bfa('0x2')][_0x0bfa('0x16')](_0x0bfa('0x5a'));db[_0x0bfa('0x5b')]=db[_0x0bfa('0x2')][_0x0bfa('0x16')](_0x0bfa('0x5c'));db['OpenchannelApplication']=db[_0x0bfa('0x2')][_0x0bfa('0x16')](_0x0bfa('0x5d'));db[_0x0bfa('0x5e')]=db[_0x0bfa('0x2')][_0x0bfa('0x16')](_0x0bfa('0x5f'));db[_0x0bfa('0x60')]=db['sequelize'][_0x0bfa('0x16')](_0x0bfa('0x61'));db['OpenchannelQueue']=db[_0x0bfa('0x2')][_0x0bfa('0x16')](_0x0bfa('0x62'));db[_0x0bfa('0x63')]=db[_0x0bfa('0x2')][_0x0bfa('0x16')](_0x0bfa('0x64'));db[_0x0bfa('0x65')]=db[_0x0bfa('0x2')][_0x0bfa('0x16')](_0x0bfa('0x66'));db[_0x0bfa('0x67')]=db['sequelize'][_0x0bfa('0x16')]('../api/chatApplication/chatApplication.model');db[_0x0bfa('0x68')]=db[_0x0bfa('0x2')][_0x0bfa('0x16')]('../api/chatInteraction/chatInteraction.model');db[_0x0bfa('0x69')]=db[_0x0bfa('0x2')]['import'](_0x0bfa('0x6a'));db['ChatOfflineMessage']=db[_0x0bfa('0x2')][_0x0bfa('0x16')](_0x0bfa('0x6b'));db[_0x0bfa('0x6c')]=db[_0x0bfa('0x2')]['import']('../api/chatQueue/chatQueue.model');db[_0x0bfa('0x6d')]=db[_0x0bfa('0x2')][_0x0bfa('0x16')](_0x0bfa('0x6e'));db[_0x0bfa('0x6f')]=db[_0x0bfa('0x2')][_0x0bfa('0x16')]('../api/chatProactiveAction/chatProactiveAction.model');db[_0x0bfa('0x70')]=db[_0x0bfa('0x2')]['import'](_0x0bfa('0x71'));db[_0x0bfa('0x72')]=db[_0x0bfa('0x2')][_0x0bfa('0x16')](_0x0bfa('0x73'));db[_0x0bfa('0x74')]=db['sequelize']['import'](_0x0bfa('0x75'));db['CmHopperBlack']=db[_0x0bfa('0x2')]['import']('../api/cmHopperBlack/cmHopperBlack.model');db['CmHopperFinal']=db[_0x0bfa('0x2')][_0x0bfa('0x16')]('../api/cmHopperFinal/cmHopperFinal.model');db[_0x0bfa('0x76')]=db[_0x0bfa('0x2')][_0x0bfa('0x16')](_0x0bfa('0x77'));db[_0x0bfa('0x78')]=db[_0x0bfa('0x2')][_0x0bfa('0x16')](_0x0bfa('0x79'));db[_0x0bfa('0x7a')]=db[_0x0bfa('0x2')]['import'](_0x0bfa('0x7b'));db[_0x0bfa('0x7c')]=db[_0x0bfa('0x2')][_0x0bfa('0x16')](_0x0bfa('0x7d'));db[_0x0bfa('0x7e')]=db[_0x0bfa('0x2')][_0x0bfa('0x16')](_0x0bfa('0x7f'));db[_0x0bfa('0x80')]=db['sequelize'][_0x0bfa('0x16')](_0x0bfa('0x81'));db[_0x0bfa('0x82')]=db[_0x0bfa('0x2')][_0x0bfa('0x16')](_0x0bfa('0x83'));db['Condition']=db[_0x0bfa('0x2')][_0x0bfa('0x16')](_0x0bfa('0x84'));db[_0x0bfa('0x85')]=db[_0x0bfa('0x2')]['import'](_0x0bfa('0x86'));db['Pause']=db[_0x0bfa('0x2')][_0x0bfa('0x16')](_0x0bfa('0x87'));db[_0x0bfa('0x88')]=db[_0x0bfa('0x2')][_0x0bfa('0x16')](_0x0bfa('0x89'));db['VoiceQueuesLog']=db[_0x0bfa('0x2')]['import'](_0x0bfa('0x8a'));db[_0x0bfa('0x8b')]=db[_0x0bfa('0x2')][_0x0bfa('0x16')](_0x0bfa('0x8c'));db[_0x0bfa('0x8d')]=db[_0x0bfa('0x2')][_0x0bfa('0x16')](_0x0bfa('0x8e'));db[_0x0bfa('0x8f')]=db[_0x0bfa('0x2')][_0x0bfa('0x16')](_0x0bfa('0x90'));db[_0x0bfa('0x91')]=db[_0x0bfa('0x2')]['import'](_0x0bfa('0x92'));db['Trigger']=db['sequelize'][_0x0bfa('0x16')](_0x0bfa('0x93'));db['Variable']=db[_0x0bfa('0x2')]['import'](_0x0bfa('0x94'));db[_0x0bfa('0x95')]=db[_0x0bfa('0x2')][_0x0bfa('0x16')](_0x0bfa('0x96'));db[_0x0bfa('0x97')]=db[_0x0bfa('0x2')][_0x0bfa('0x16')](_0x0bfa('0x98'));db[_0x0bfa('0x99')]=db[_0x0bfa('0x2')][_0x0bfa('0x16')](_0x0bfa('0x9a'));db[_0x0bfa('0x9b')]=db[_0x0bfa('0x2')][_0x0bfa('0x16')](_0x0bfa('0x9c'));db[_0x0bfa('0x9d')]=db[_0x0bfa('0x2')]['import']('../api/analyticExtractedReport/analyticExtractedReport.model');db[_0x0bfa('0x9e')]=db[_0x0bfa('0x2')][_0x0bfa('0x16')](_0x0bfa('0x9f'));db[_0x0bfa('0xa0')]=db['sequelize']['import'](_0x0bfa('0xa1'));db[_0x0bfa('0xa2')]=db[_0x0bfa('0x2')]['import'](_0x0bfa('0xa3'));db[_0x0bfa('0xa4')]=db['sequelize'][_0x0bfa('0x16')](_0x0bfa('0xa5'));db[_0x0bfa('0xa6')]=db[_0x0bfa('0x2')][_0x0bfa('0x16')](_0x0bfa('0xa7'));db['SalesforceField']=db['sequelize'][_0x0bfa('0x16')](_0x0bfa('0xa8'));db[_0x0bfa('0xa9')]=db['sequelize']['import'](_0x0bfa('0xaa'));db[_0x0bfa('0xab')]=db[_0x0bfa('0x2')][_0x0bfa('0x16')](_0x0bfa('0xac'));db[_0x0bfa('0xad')]=db[_0x0bfa('0x2')][_0x0bfa('0x16')](_0x0bfa('0xae'));db[_0x0bfa('0xaf')]=db[_0x0bfa('0x2')][_0x0bfa('0x16')](_0x0bfa('0xb0'));db['DeskConfiguration']=db[_0x0bfa('0x2')]['import'](_0x0bfa('0xb1'));db[_0x0bfa('0xb2')]=db[_0x0bfa('0x2')][_0x0bfa('0x16')](_0x0bfa('0xb3'));db[_0x0bfa('0xb4')]=db[_0x0bfa('0x2')][_0x0bfa('0x16')](_0x0bfa('0xb5'));db[_0x0bfa('0xb6')]=db[_0x0bfa('0x2')][_0x0bfa('0x16')](_0x0bfa('0xb7'));db[_0x0bfa('0xb8')]=db['sequelize'][_0x0bfa('0x16')](_0x0bfa('0xb9'));db['ZendeskAccount']=db[_0x0bfa('0x2')][_0x0bfa('0x16')](_0x0bfa('0xba'));db[_0x0bfa('0xbb')]=db[_0x0bfa('0x2')]['import'](_0x0bfa('0xbc'));db[_0x0bfa('0xbd')]=db[_0x0bfa('0x2')][_0x0bfa('0x16')]('../api/intZendeskField/intZendeskField.model');db[_0x0bfa('0xbe')]=db['sequelize']['import'](_0x0bfa('0xbf'));db[_0x0bfa('0xc0')]=db[_0x0bfa('0x2')]['import'](_0x0bfa('0xc1'));db[_0x0bfa('0xc2')]=db[_0x0bfa('0x2')]['import'](_0x0bfa('0xc3'));db[_0x0bfa('0xc4')]=db[_0x0bfa('0x2')][_0x0bfa('0x16')](_0x0bfa('0xc5'));db['VtigerConfiguration']=db[_0x0bfa('0x2')][_0x0bfa('0x16')]('../api/intVtigerConfiguration/intVtigerConfiguration.model');db['VtigerField']=db[_0x0bfa('0x2')][_0x0bfa('0x16')](_0x0bfa('0xc6'));db[_0x0bfa('0xc7')]=db[_0x0bfa('0x2')][_0x0bfa('0x16')](_0x0bfa('0xc8'));db[_0x0bfa('0xc9')]=db[_0x0bfa('0x2')][_0x0bfa('0x16')](_0x0bfa('0xca'));db[_0x0bfa('0xcb')]=db[_0x0bfa('0x2')]['import'](_0x0bfa('0xcc'));db[_0x0bfa('0xcd')]=db[_0x0bfa('0x2')][_0x0bfa('0x16')](_0x0bfa('0xce'));db['Dynamics365Configuration']=db['sequelize'][_0x0bfa('0x16')](_0x0bfa('0xcf'));db[_0x0bfa('0xd0')]=db['sequelize']['import']('../api/intDynamics365Field/intDynamics365Field.model');db[_0x0bfa('0x95')]=db[_0x0bfa('0x2')]['import'](_0x0bfa('0x96'));db[_0x0bfa('0xd1')]=db[_0x0bfa('0x2')][_0x0bfa('0x16')](_0x0bfa('0xd2'));db[_0x0bfa('0xd3')]=db[_0x0bfa('0x2')][_0x0bfa('0x16')](_0x0bfa('0xd4'));db[_0x0bfa('0xd5')]=db[_0x0bfa('0x2')][_0x0bfa('0x16')](_0x0bfa('0xd6'));db['JscriptyAnswerReport']=db[_0x0bfa('0x2')]['import']('../api/jscriptyAnswerReport/jscriptyAnswerReport.model');db['JscriptyQuestionReport']=db[_0x0bfa('0x2')][_0x0bfa('0x16')](_0x0bfa('0xd7'));db['JscriptySessionReport']=db[_0x0bfa('0x2')][_0x0bfa('0x16')](_0x0bfa('0xd8'));db[_0x0bfa('0xd9')]=db[_0x0bfa('0x2')][_0x0bfa('0x16')](_0x0bfa('0xda'));db['SquareReport']=db[_0x0bfa('0x2')][_0x0bfa('0x16')](_0x0bfa('0xdb'));db[_0x0bfa('0xdc')]=db['sequelize']['import']('../api/squareReportDetail/squareReportDetail.model');db['JscriptyProject']=db[_0x0bfa('0x2')]['import'](_0x0bfa('0xdd'));db[_0x0bfa('0xde')]=db['sequelize'][_0x0bfa('0x16')]('../api/setting/setting.model');db[_0x0bfa('0xdf')]=db[_0x0bfa('0x2')]['import'](_0x0bfa('0xe0'));db[_0x0bfa('0xe1')]=db[_0x0bfa('0x2')]['import'](_0x0bfa('0xe2'));db[_0x0bfa('0xe3')]=db[_0x0bfa('0x2')]['import']('../api/squareRecording/squareRecording.model');db[_0x0bfa('0xe4')]=db[_0x0bfa('0x2')][_0x0bfa('0x16')](_0x0bfa('0xe5'));db['Team']=db[_0x0bfa('0x2')][_0x0bfa('0x16')]('../api/team/team.model');db[_0x0bfa('0xe6')]=db[_0x0bfa('0x2')][_0x0bfa('0x16')](_0x0bfa('0xe7'));db[_0x0bfa('0xe8')]=db['sequelize'][_0x0bfa('0x16')](_0x0bfa('0xe9'));db[_0x0bfa('0xea')]=db[_0x0bfa('0x2')][_0x0bfa('0x16')](_0x0bfa('0xeb'));db[_0x0bfa('0xec')]=db[_0x0bfa('0x2')][_0x0bfa('0x16')](_0x0bfa('0xed'));db[_0x0bfa('0xee')]=db[_0x0bfa('0x2')][_0x0bfa('0x16')](_0x0bfa('0xef'));db[_0x0bfa('0xf0')]=db[_0x0bfa('0x2')][_0x0bfa('0x16')](_0x0bfa('0xf1'));db[_0x0bfa('0xf2')]=db[_0x0bfa('0x2')][_0x0bfa('0x16')](_0x0bfa('0xf3'));db[_0x0bfa('0xf4')]=db[_0x0bfa('0x2')][_0x0bfa('0x16')](_0x0bfa('0xf5'));db[_0x0bfa('0xf6')]=db[_0x0bfa('0x2')]['import'](_0x0bfa('0xf7'));db[_0x0bfa('0xf8')]=db[_0x0bfa('0x2')]['import'](_0x0bfa('0xf9'));db[_0x0bfa('0xfa')]=db[_0x0bfa('0x2')][_0x0bfa('0x16')](_0x0bfa('0xfb'));db[_0x0bfa('0xfc')]=db[_0x0bfa('0x2')]['import'](_0x0bfa('0xfd'));db[_0x0bfa('0xfe')]=db['sequelize'][_0x0bfa('0x16')]('../api/userProfile/userProfile.model');db['UserProfileSection']=db['sequelize'][_0x0bfa('0x16')](_0x0bfa('0xff'));db[_0x0bfa('0x100')]=db[_0x0bfa('0x2')]['import'](_0x0bfa('0x101'));db[_0x0bfa('0x15')]['hasOne'](db['VoiceMail'],{'as':_0x0bfa('0x22'),'onDelete':_0x0bfa('0x102'),'foreignKey':_0x0bfa('0x103')});db[_0x0bfa('0x15')][_0x0bfa('0x104')](db['VoiceRecording'],{'as':_0x0bfa('0x105'),'foreignKey':_0x0bfa('0x103')});db[_0x0bfa('0x15')][_0x0bfa('0x104')](db[_0x0bfa('0x106')],{'as':'VoiceQueuesRt','foreignKey':_0x0bfa('0x103')});db[_0x0bfa('0x15')][_0x0bfa('0x104')](db[_0x0bfa('0x1b')],{'as':_0x0bfa('0x107'),'onDelete':'cascade','hooks':!![]});db['User'][_0x0bfa('0x104')](db[_0x0bfa('0x108')],{'as':'HopperFinals','foreignKey':_0x0bfa('0x103')});db[_0x0bfa('0x15')][_0x0bfa('0x104')](db[_0x0bfa('0x76')],{'as':'HopperHistory','foreignKey':_0x0bfa('0x103')});db[_0x0bfa('0x15')][_0x0bfa('0x104')](db[_0x0bfa('0x78')],{'as':_0x0bfa('0x78'),'foreignKey':_0x0bfa('0x103')});db['User'][_0x0bfa('0x104')](db[_0x0bfa('0x5e')],{'as':_0x0bfa('0x109'),'foreignKey':'UserId'});db['User']['hasMany'](db[_0x0bfa('0x68')],{'as':_0x0bfa('0x10a'),'foreignKey':_0x0bfa('0x103')});db[_0x0bfa('0x15')][_0x0bfa('0x104')](db[_0x0bfa('0x10b')],{'as':_0x0bfa('0x10c'),'foreignKey':_0x0bfa('0x103')});db[_0x0bfa('0x15')][_0x0bfa('0x104')](db[_0x0bfa('0x4e')],{'as':'FaxInteractions','foreignKey':_0x0bfa('0x103')});db[_0x0bfa('0x15')][_0x0bfa('0x104')](db[_0x0bfa('0x41')],{'as':_0x0bfa('0x10d'),'foreignKey':_0x0bfa('0x103')});db['User'][_0x0bfa('0x10e')](db['UserProfile'],{'as':'UserProfile','foreignKey':_0x0bfa('0x10f')});db[_0x0bfa('0x15')][_0x0bfa('0x110')](db['ChatGroup'],{'as':_0x0bfa('0x111'),'through':'chat_group_has_users'});db['User'][_0x0bfa('0x110')](db[_0x0bfa('0x72')],{'as':_0x0bfa('0x112'),'through':_0x0bfa('0x113')});db[_0x0bfa('0x15')][_0x0bfa('0x110')](db[_0x0bfa('0xfa')],{'as':_0x0bfa('0x114'),'through':_0x0bfa('0x115')});db[_0x0bfa('0x15')][_0x0bfa('0x110')](db['Team'],{'through':_0x0bfa('0x116')});db[_0x0bfa('0x15')][_0x0bfa('0x110')](db[_0x0bfa('0x41')],{'as':_0x0bfa('0x10d'),'through':_0x0bfa('0x117')});db[_0x0bfa('0x15')][_0x0bfa('0x110')](db[_0x0bfa('0x68')],{'as':'ChatInteractions','through':_0x0bfa('0x118')});db['User'][_0x0bfa('0x110')](db[_0x0bfa('0x4e')],{'as':_0x0bfa('0x119'),'through':_0x0bfa('0x11a')});db[_0x0bfa('0x15')][_0x0bfa('0x110')](db['SmsInteraction'],{'as':_0x0bfa('0x10c'),'through':_0x0bfa('0x11b')});db[_0x0bfa('0x15')]['belongsToMany'](db[_0x0bfa('0x5e')],{'as':_0x0bfa('0x109'),'through':_0x0bfa('0x11c')});db['User'][_0x0bfa('0x110')](db[_0x0bfa('0x11d')],{'as':_0x0bfa('0x11e'),'through':'UserVoiceQueue','required':![]});db[_0x0bfa('0x15')][_0x0bfa('0x110')](db['MailQueue'],{'as':'MailQueues','through':'UserMailQueue','required':![]});db['User']['belongsToMany'](db[_0x0bfa('0x6c')],{'as':'ChatQueues','through':_0x0bfa('0x31'),'required':![],'hooks':!![]});db[_0x0bfa('0x15')][_0x0bfa('0x110')](db[_0x0bfa('0x52')],{'as':_0x0bfa('0x11f'),'through':'UserFaxQueue','required':![]});db['User'][_0x0bfa('0x110')](db['SmsQueue'],{'as':_0x0bfa('0x120'),'through':'UserSmsQueue','required':![]});db[_0x0bfa('0x15')][_0x0bfa('0x110')](db['OpenchannelQueue'],{'as':_0x0bfa('0x121'),'through':_0x0bfa('0x38'),'required':![]});db['User'][_0x0bfa('0x110')](db[_0x0bfa('0xfa')],{'through':'cm_user_has_lists'});db[_0x0bfa('0x15')][_0x0bfa('0x110')](db[_0x0bfa('0xfc')],{'as':_0x0bfa('0x122'),'through':'user_has_voice_prefixes','required':![]});db[_0x0bfa('0x15')][_0x0bfa('0x110')](db[_0x0bfa('0x63')],{'as':'ChatWebsites','through':_0x0bfa('0x123')});db[_0x0bfa('0x15')][_0x0bfa('0x110')](db[_0x0bfa('0x4b')],{'as':_0x0bfa('0x124'),'through':_0x0bfa('0x125')});db[_0x0bfa('0x15')]['belongsToMany'](db[_0x0bfa('0x3d')],{'as':_0x0bfa('0x126'),'through':_0x0bfa('0x127')});db[_0x0bfa('0x15')][_0x0bfa('0x110')](db[_0x0bfa('0x5b')],{'as':'OpenchannelAccounts','through':_0x0bfa('0x128')});db[_0x0bfa('0x15')][_0x0bfa('0x110')](db[_0x0bfa('0x129')],{'as':'SmsAccounts','through':_0x0bfa('0x12a')});db[_0x0bfa('0x15')]['belongsToMany'](db[_0x0bfa('0xe1')],{'as':_0x0bfa('0x12b'),'through':_0x0bfa('0x12c')});db[_0x0bfa('0x17')]['hasMany'](db['VoiceExtension'],{'as':_0x0bfa('0x12d'),'onDelete':_0x0bfa('0x102'),'foreignKey':_0x0bfa('0x12e')});db[_0x0bfa('0x19')]['hasMany'](db[_0x0bfa('0x1b')],{'onDelete':_0x0bfa('0x102')});db[_0x0bfa('0x1b')][_0x0bfa('0x104')](db[_0x0bfa('0x1b')],{'as':_0x0bfa('0x12f'),'onDelete':'cascade'});db[_0x0bfa('0x1d')][_0x0bfa('0x110')](db[_0x0bfa('0x8d')],{'as':_0x0bfa('0x130'),'through':'moh_has_sounds'});db['VoiceQueue']['hasMany'](db[_0x0bfa('0x106')],{'as':_0x0bfa('0x131'),'foreignKey':_0x0bfa('0x132')});db[_0x0bfa('0x11d')][_0x0bfa('0x104')](db[_0x0bfa('0x74')],{'as':_0x0bfa('0x133'),'foreignKey':'VoiceQueueId'});db[_0x0bfa('0x11d')]['hasMany'](db[_0x0bfa('0x108')],{'as':_0x0bfa('0x134'),'foreignKey':_0x0bfa('0x132')});db[_0x0bfa('0x11d')]['hasMany'](db['CmHopperHistory'],{'as':_0x0bfa('0x135'),'foreignKey':'VoiceQueueId'});db[_0x0bfa('0x11d')][_0x0bfa('0x104')](db[_0x0bfa('0x78')],{'as':_0x0bfa('0x78'),'foreignKey':'VoiceQueueId'});db[_0x0bfa('0x11d')][_0x0bfa('0x104')](db['CmHopperBlack'],{'as':_0x0bfa('0x136'),'foreignKey':_0x0bfa('0x132')});db[_0x0bfa('0x11d')][_0x0bfa('0x104')](db[_0x0bfa('0x137')],{'as':_0x0bfa('0x138'),'foreignKey':_0x0bfa('0x132')});db[_0x0bfa('0x11d')][_0x0bfa('0x10e')](db[_0x0bfa('0x2c')],{'as':'Trunk','foreignKey':'TrunkId'});db[_0x0bfa('0x11d')][_0x0bfa('0x10e')](db[_0x0bfa('0x2c')],{'as':'TrunkBackup','foreignKey':_0x0bfa('0x139')});db['VoiceQueue'][_0x0bfa('0x10e')](db[_0x0bfa('0x85')],{'as':_0x0bfa('0x85'),'foreignKey':_0x0bfa('0x13a')});db['VoiceQueue'][_0x0bfa('0x10e')](db[_0x0bfa('0x13b')],{'as':_0x0bfa('0x13c'),'foreignKey':_0x0bfa('0x13d')});db[_0x0bfa('0x11d')]['belongsToMany'](db[_0x0bfa('0xfa')],{'as':_0x0bfa('0x114'),'through':'voice_queues_has_cm_lists'});db['VoiceQueue'][_0x0bfa('0x110')](db[_0x0bfa('0x15')],{'as':_0x0bfa('0x13e'),'through':_0x0bfa('0x30')});db[_0x0bfa('0x11d')][_0x0bfa('0x110')](db[_0x0bfa('0x13f')],{'as':_0x0bfa('0x140'),'through':_0x0bfa('0x141')});db[_0x0bfa('0x11d')][_0x0bfa('0x110')](db[_0x0bfa('0xfa')],{'as':_0x0bfa('0x142'),'through':_0x0bfa('0x143')});db['VoiceRecording'][_0x0bfa('0x10e')](db[_0x0bfa('0x15')],{'as':_0x0bfa('0x15'),'foreignKey':_0x0bfa('0x103')});db[_0x0bfa('0x144')][_0x0bfa('0x10e')](db[_0x0bfa('0x15')],{'as':'User','foreignKey':_0x0bfa('0x103')});db[_0x0bfa('0x22')][_0x0bfa('0x104')](db['VoiceMailMessage'],{'as':'Messages','onDelete':'cascade','foreignKey':'mailboxuser','sourceKey':_0x0bfa('0x145')});db[_0x0bfa('0x23')]['belongsTo'](db[_0x0bfa('0x22')],{'foreignKey':_0x0bfa('0x146'),'targetKey':_0x0bfa('0x145')});db[_0x0bfa('0x147')]['hasMany'](db[_0x0bfa('0x28')],{'as':_0x0bfa('0x148'),'foreignKey':_0x0bfa('0x149'),'constraints':![]});db[_0x0bfa('0x147')][_0x0bfa('0x104')](db[_0x0bfa('0x14a')],{'as':'AgentReports','foreignKey':_0x0bfa('0x149'),'constraints':![]});db[_0x0bfa('0x147')][_0x0bfa('0x10e')](db[_0x0bfa('0x15')],{'as':_0x0bfa('0x15'),'foreignKey':_0x0bfa('0x103')});db[_0x0bfa('0x147')][_0x0bfa('0x10e')](db[_0x0bfa('0x72')],{'as':_0x0bfa('0x14b'),'foreignKey':_0x0bfa('0x14c')});db[_0x0bfa('0x3a')][_0x0bfa('0x10e')](db[_0x0bfa('0x3d')],{'as':_0x0bfa('0x3d'),'foreignKey':_0x0bfa('0x14d')});db[_0x0bfa('0x3b')][_0x0bfa('0x10e')](db[_0x0bfa('0x3d')],{'as':'MailAccount','foreignKey':_0x0bfa('0x14d')});db[_0x0bfa('0x3d')][_0x0bfa('0x14e')](db[_0x0bfa('0x3a')],{'as':_0x0bfa('0x14f'),'onDelete':_0x0bfa('0x102')});db[_0x0bfa('0x3d')]['hasOne'](db[_0x0bfa('0x3b')],{'as':_0x0bfa('0x150'),'onDelete':_0x0bfa('0x102')});db[_0x0bfa('0x3d')][_0x0bfa('0x104')](db['Disposition'],{'as':_0x0bfa('0x151'),'foreignKey':'MailAccountId'});db['MailAccount'][_0x0bfa('0x104')](db[_0x0bfa('0x80')],{'as':_0x0bfa('0x152'),'foreignKey':_0x0bfa('0x14d')});db[_0x0bfa('0x3d')][_0x0bfa('0x104')](db[_0x0bfa('0x43')],{'as':_0x0bfa('0x153'),'foreignKey':_0x0bfa('0x14d')});db[_0x0bfa('0x3d')][_0x0bfa('0x104')](db[_0x0bfa('0x41')],{'as':_0x0bfa('0x154')});db['MailAccount']['hasMany'](db[_0x0bfa('0x45')],{'as':_0x0bfa('0x12f')});db['MailAccount'][_0x0bfa('0x10e')](db[_0x0bfa('0xfa')],{'as':'List','foreignKey':'ListId'});db[_0x0bfa('0x3d')]['belongsTo'](db[_0x0bfa('0x91')],{'as':_0x0bfa('0x91'),'foreignKey':'TemplateId'});db['MailAccount'][_0x0bfa('0x10e')](db[_0x0bfa('0x13b')],{'as':_0x0bfa('0x13c'),'foreignKey':_0x0bfa('0x13d')});db[_0x0bfa('0x3d')][_0x0bfa('0x110')](db[_0x0bfa('0x15')],{'as':_0x0bfa('0x13e'),'through':'user_has_mail_accounts'});db['MailQueue']['belongsToMany'](db[_0x0bfa('0x15')],{'as':_0x0bfa('0x13e'),'through':_0x0bfa('0x33')});db[_0x0bfa('0x3e')][_0x0bfa('0x110')](db[_0x0bfa('0x13f')],{'through':_0x0bfa('0x155'),'as':_0x0bfa('0x140')});db[_0x0bfa('0x41')][_0x0bfa('0x104')](db[_0x0bfa('0x43')],{'as':_0x0bfa('0x153'),'onDelete':_0x0bfa('0x102'),'foreignKey':_0x0bfa('0x156')});db['MailInteraction'][_0x0bfa('0x10e')](db[_0x0bfa('0x3d')],{'as':_0x0bfa('0x157'),'foreignKey':_0x0bfa('0x14d')});db['MailInteraction'][_0x0bfa('0x10e')](db[_0x0bfa('0x72')],{'as':'Contact','foreignKey':_0x0bfa('0x14c')});db[_0x0bfa('0x41')][_0x0bfa('0x10e')](db[_0x0bfa('0x15')],{'as':_0x0bfa('0x158'),'foreignKey':_0x0bfa('0x103')});db[_0x0bfa('0x41')]['belongsToMany'](db[_0x0bfa('0x8f')],{'through':_0x0bfa('0x159'),'as':'Tags'});db[_0x0bfa('0x41')][_0x0bfa('0x110')](db['Tag'],{'through':_0x0bfa('0x159'),'as':'ThroughTags'});db[_0x0bfa('0x41')][_0x0bfa('0x110')](db[_0x0bfa('0x15')],{'as':_0x0bfa('0x15a'),'through':_0x0bfa('0x117'),'foreignKey':_0x0bfa('0x156')});db['MailMessage'][_0x0bfa('0x104')](db[_0x0bfa('0xec')],{'as':_0x0bfa('0x15b'),'onDelete':_0x0bfa('0x102')});db[_0x0bfa('0x43')][_0x0bfa('0x10e')](db[_0x0bfa('0x15')],{'as':'User'});db[_0x0bfa('0x43')][_0x0bfa('0x10e')](db[_0x0bfa('0x72')],{'onDelete':_0x0bfa('0x102'),'as':_0x0bfa('0x14b')});db['MailMessage']['belongsTo'](db[_0x0bfa('0x41')],{'as':_0x0bfa('0x15c'),'foreignKey':'MailInteractionId'});db[_0x0bfa('0x43')]['belongsTo'](db[_0x0bfa('0x3d')],{'as':'Account','foreignKey':'MailAccountId'});db[_0x0bfa('0x45')][_0x0bfa('0x10e')](db[_0x0bfa('0x15')],{'onDelete':_0x0bfa('0x15d')});db[_0x0bfa('0x45')][_0x0bfa('0x10e')](db[_0x0bfa('0x3e')],{'onDelete':_0x0bfa('0x15d')});db[_0x0bfa('0x45')][_0x0bfa('0x10e')](db[_0x0bfa('0x3d')],{'onDelete':_0x0bfa('0x15d')});db[_0x0bfa('0x45')][_0x0bfa('0x10e')](db[_0x0bfa('0x85')],{'onDelete':_0x0bfa('0x15d'),'foreignKey':_0x0bfa('0x13a')});db[_0x0bfa('0x45')][_0x0bfa('0x10e')](db['Tag'],{'onDelete':_0x0bfa('0x15d'),'foreignKey':_0x0bfa('0x15e')});db['MailQueueReport'][_0x0bfa('0x10e')](db[_0x0bfa('0x3d')],{});db[_0x0bfa('0x47')][_0x0bfa('0x10e')](db[_0x0bfa('0xfa')],{'as':_0x0bfa('0x15f'),'foreignKey':_0x0bfa('0x160')});db[_0x0bfa('0x47')][_0x0bfa('0x10e')](db['CmContact'],{'as':_0x0bfa('0x14b'),'foreignKey':_0x0bfa('0x14c')});db[_0x0bfa('0x47')][_0x0bfa('0x10e')](db['MailInteraction'],{});db[_0x0bfa('0x47')][_0x0bfa('0x10e')](db[_0x0bfa('0x43')],{});db[_0x0bfa('0x47')][_0x0bfa('0x10e')](db['User'],{});db[_0x0bfa('0x47')][_0x0bfa('0x10e')](db['MailQueue'],{});db[_0x0bfa('0x161')][_0x0bfa('0x104')](db[_0x0bfa('0x49')],{'as':_0x0bfa('0x162'),'onDelete':_0x0bfa('0x102')});db[_0x0bfa('0x4b')]['hasMany'](db[_0x0bfa('0x82')],{'as':_0x0bfa('0x151'),'foreignKey':'FaxAccountId'});db[_0x0bfa('0x4b')][_0x0bfa('0x104')](db[_0x0bfa('0x80')],{'as':'Answers','foreignKey':_0x0bfa('0x163')});db[_0x0bfa('0x4b')][_0x0bfa('0x104')](db[_0x0bfa('0x4e')],{'as':_0x0bfa('0x154')});db[_0x0bfa('0x4b')][_0x0bfa('0x104')](db[_0x0bfa('0x4d')],{'as':_0x0bfa('0x12f')});db[_0x0bfa('0x4b')][_0x0bfa('0x104')](db[_0x0bfa('0x1b')],{'as':_0x0bfa('0x164'),'onDelete':_0x0bfa('0x102')});db['FaxAccount']['hasMany'](db[_0x0bfa('0x50')],{'as':_0x0bfa('0x153')});db[_0x0bfa('0x4b')][_0x0bfa('0x10e')](db[_0x0bfa('0x2c')],{'as':_0x0bfa('0x2c')});db[_0x0bfa('0x4b')][_0x0bfa('0x10e')](db[_0x0bfa('0xfa')],{'as':'List','foreignKey':_0x0bfa('0x160')});db[_0x0bfa('0x4b')][_0x0bfa('0x10e')](db['Pause'],{'as':_0x0bfa('0x13c'),'foreignKey':_0x0bfa('0x13d')});db[_0x0bfa('0x4b')][_0x0bfa('0x110')](db[_0x0bfa('0x15')],{'as':_0x0bfa('0x13e'),'through':_0x0bfa('0x125')});db[_0x0bfa('0x4d')]['belongsTo'](db['User'],{'onDelete':_0x0bfa('0x15d')});db['FaxApplication'][_0x0bfa('0x10e')](db[_0x0bfa('0x52')],{'onDelete':_0x0bfa('0x15d')});db[_0x0bfa('0x4d')]['belongsTo'](db[_0x0bfa('0x4b')],{'onDelete':_0x0bfa('0x15d')});db[_0x0bfa('0x4d')]['belongsTo'](db[_0x0bfa('0x8f')],{'onDelete':_0x0bfa('0x15d'),'foreignKey':'TagId'});db[_0x0bfa('0x4e')]['hasMany'](db['FaxMessage'],{'as':_0x0bfa('0x153'),'onDelete':_0x0bfa('0x102'),'foreignKey':'FaxInteractionId'});db[_0x0bfa('0x4e')][_0x0bfa('0x10e')](db[_0x0bfa('0x4b')],{'as':_0x0bfa('0x157'),'foreignKey':_0x0bfa('0x163')});db['FaxInteraction'][_0x0bfa('0x10e')](db['CmContact'],{'as':_0x0bfa('0x14b'),'foreignKey':_0x0bfa('0x14c')});db[_0x0bfa('0x4e')][_0x0bfa('0x10e')](db[_0x0bfa('0x15')],{'as':_0x0bfa('0x158'),'foreignKey':_0x0bfa('0x103')});db[_0x0bfa('0x4e')][_0x0bfa('0x110')](db[_0x0bfa('0x8f')],{'through':_0x0bfa('0x165'),'as':'Tags'});db[_0x0bfa('0x4e')][_0x0bfa('0x110')](db[_0x0bfa('0x8f')],{'through':_0x0bfa('0x165'),'as':_0x0bfa('0x166')});db[_0x0bfa('0x4e')]['belongsToMany'](db['User'],{'as':_0x0bfa('0x15a'),'through':_0x0bfa('0x11a'),'foreignKey':_0x0bfa('0x167')});db[_0x0bfa('0x50')][_0x0bfa('0x10e')](db[_0x0bfa('0x15')],{'onDelete':'cascade','as':'User'});db[_0x0bfa('0x50')][_0x0bfa('0x10e')](db[_0x0bfa('0x4e')],{'as':'Interaction','foreignKey':'FaxInteractionId'});db[_0x0bfa('0x50')][_0x0bfa('0x10e')](db['CmContact'],{'onDelete':'cascade','as':_0x0bfa('0x14b')});db[_0x0bfa('0x50')][_0x0bfa('0x10e')](db[_0x0bfa('0xec')],{'as':_0x0bfa('0xec'),'foreignKey':'AttachmentId'});db[_0x0bfa('0x50')][_0x0bfa('0x10e')](db['FaxAccount'],{'as':_0x0bfa('0x157'),'foreignKey':_0x0bfa('0x163')});db[_0x0bfa('0x52')]['belongsToMany'](db[_0x0bfa('0x15')],{'as':'Agents','through':_0x0bfa('0x35')});db[_0x0bfa('0x52')][_0x0bfa('0x110')](db[_0x0bfa('0x13f')],{'through':_0x0bfa('0x168'),'as':_0x0bfa('0x140')});db[_0x0bfa('0x169')][_0x0bfa('0x10e')](db[_0x0bfa('0x4b')],{});db['FaxQueueReport'][_0x0bfa('0x10e')](db[_0x0bfa('0xfa')],{'as':_0x0bfa('0x15f'),'foreignKey':'ListId'});db['FaxQueueReport'][_0x0bfa('0x10e')](db[_0x0bfa('0x72')],{'as':_0x0bfa('0x14b'),'foreignKey':_0x0bfa('0x14c')});db[_0x0bfa('0x169')]['belongsTo'](db['FaxInteraction'],{});db[_0x0bfa('0x169')]['belongsTo'](db[_0x0bfa('0x50')],{});db[_0x0bfa('0x169')][_0x0bfa('0x10e')](db[_0x0bfa('0x15')],{});db[_0x0bfa('0x169')][_0x0bfa('0x10e')](db[_0x0bfa('0x52')],{});db[_0x0bfa('0x129')][_0x0bfa('0x104')](db[_0x0bfa('0x82')],{'as':'Dispositions','foreignKey':_0x0bfa('0x16a')});db['SmsAccount'][_0x0bfa('0x104')](db['CannedAnswer'],{'as':_0x0bfa('0x152'),'foreignKey':_0x0bfa('0x16a')});db[_0x0bfa('0x129')][_0x0bfa('0x104')](db[_0x0bfa('0x57')],{'as':_0x0bfa('0x153'),'foreignKey':_0x0bfa('0x16a')});db[_0x0bfa('0x129')][_0x0bfa('0x104')](db[_0x0bfa('0x10b')],{'as':_0x0bfa('0x154')});db[_0x0bfa('0x129')][_0x0bfa('0x104')](db[_0x0bfa('0x16b')],{'as':_0x0bfa('0x12f')});db[_0x0bfa('0x129')]['belongsTo'](db[_0x0bfa('0xfa')],{'as':_0x0bfa('0x15f'),'foreignKey':_0x0bfa('0x160')});db[_0x0bfa('0x129')][_0x0bfa('0x10e')](db[_0x0bfa('0x13b')],{'as':_0x0bfa('0x13c'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x0bfa('0x129')][_0x0bfa('0x110')](db[_0x0bfa('0x15')],{'as':_0x0bfa('0x13e'),'through':_0x0bfa('0x12a')});db['SmsApplication'][_0x0bfa('0x10e')](db[_0x0bfa('0x15')],{'onDelete':_0x0bfa('0x15d')});db[_0x0bfa('0x16b')][_0x0bfa('0x10e')](db[_0x0bfa('0x59')],{'onDelete':_0x0bfa('0x15d')});db[_0x0bfa('0x16b')][_0x0bfa('0x10e')](db[_0x0bfa('0x129')],{'onDelete':_0x0bfa('0x15d')});db['SmsApplication'][_0x0bfa('0x10e')](db[_0x0bfa('0x85')],{'onDelete':'restrict','foreignKey':_0x0bfa('0x13a')});db[_0x0bfa('0x16b')][_0x0bfa('0x10e')](db[_0x0bfa('0x8f')],{'onDelete':_0x0bfa('0x15d'),'foreignKey':'TagId'});db[_0x0bfa('0x10b')]['hasMany'](db[_0x0bfa('0x57')],{'as':'Messages','onDelete':_0x0bfa('0x102'),'foreignKey':_0x0bfa('0x16c')});db[_0x0bfa('0x10b')][_0x0bfa('0x10e')](db[_0x0bfa('0x129')],{'as':'Account','foreignKey':'SmsAccountId'});db['SmsInteraction'][_0x0bfa('0x10e')](db[_0x0bfa('0x72')],{'as':'Contact','foreignKey':'ContactId'});db[_0x0bfa('0x10b')][_0x0bfa('0x10e')](db[_0x0bfa('0x15')],{'as':_0x0bfa('0x158'),'foreignKey':'UserId'});db[_0x0bfa('0x10b')]['belongsToMany'](db[_0x0bfa('0x8f')],{'through':'sms_interaction_has_tags','as':_0x0bfa('0x16d')});db[_0x0bfa('0x10b')][_0x0bfa('0x110')](db[_0x0bfa('0x8f')],{'through':'sms_interaction_has_tags','as':'ThroughTags'});db['SmsInteraction'][_0x0bfa('0x110')](db[_0x0bfa('0x15')],{'as':_0x0bfa('0x15a'),'through':_0x0bfa('0x11b'),'foreignKey':_0x0bfa('0x16c')});db[_0x0bfa('0x57')][_0x0bfa('0x10e')](db[_0x0bfa('0x15')],{'as':_0x0bfa('0x15')});db[_0x0bfa('0x57')]['belongsTo'](db[_0x0bfa('0x72')],{'onDelete':'cascade','as':_0x0bfa('0x14b')});db[_0x0bfa('0x57')][_0x0bfa('0x10e')](db[_0x0bfa('0x10b')],{'onDelete':_0x0bfa('0x102'),'as':_0x0bfa('0x15c'),'foreignKey':_0x0bfa('0x16c')});db[_0x0bfa('0x57')][_0x0bfa('0x10e')](db[_0x0bfa('0x129')],{'as':'Account','foreignKey':_0x0bfa('0x16a')});db[_0x0bfa('0x59')][_0x0bfa('0x110')](db[_0x0bfa('0x15')],{'as':_0x0bfa('0x13e'),'through':_0x0bfa('0x36'),'foreignKey':_0x0bfa('0x16e')});db['SmsQueue'][_0x0bfa('0x110')](db[_0x0bfa('0x13f')],{'through':_0x0bfa('0x16f'),'as':_0x0bfa('0x140')});db[_0x0bfa('0x5b')][_0x0bfa('0x104')](db[_0x0bfa('0x82')],{'as':_0x0bfa('0x151'),'foreignKey':_0x0bfa('0x170')});db[_0x0bfa('0x5b')][_0x0bfa('0x104')](db[_0x0bfa('0x80')],{'as':_0x0bfa('0x152'),'foreignKey':_0x0bfa('0x170')});db[_0x0bfa('0x5b')][_0x0bfa('0x104')](db[_0x0bfa('0x5e')],{'as':'Interactions','foreignKey':_0x0bfa('0x170')});db[_0x0bfa('0x5b')][_0x0bfa('0x104')](db[_0x0bfa('0x60')],{'as':'Messages','foreignKey':_0x0bfa('0x170')});db[_0x0bfa('0x5b')][_0x0bfa('0x104')](db[_0x0bfa('0x171')],{'as':_0x0bfa('0x12f'),'foreignKey':_0x0bfa('0x170')});db[_0x0bfa('0x5b')][_0x0bfa('0x10e')](db[_0x0bfa('0xfa')],{'as':_0x0bfa('0x15f'),'foreignKey':_0x0bfa('0x160')});db[_0x0bfa('0x5b')][_0x0bfa('0x10e')](db[_0x0bfa('0x13b')],{'as':_0x0bfa('0x13c'),'foreignKey':_0x0bfa('0x13d')});db[_0x0bfa('0x5b')][_0x0bfa('0x110')](db[_0x0bfa('0x15')],{'as':_0x0bfa('0x13e'),'through':_0x0bfa('0x128')});db[_0x0bfa('0x171')][_0x0bfa('0x10e')](db[_0x0bfa('0x15')],{'onDelete':_0x0bfa('0x15d')});db[_0x0bfa('0x171')][_0x0bfa('0x10e')](db[_0x0bfa('0x172')],{'onDelete':_0x0bfa('0x15d'),'foreignKey':_0x0bfa('0x173')});db[_0x0bfa('0x171')][_0x0bfa('0x10e')](db['OpenchannelAccount'],{'onDelete':_0x0bfa('0x15d'),'foreignKey':_0x0bfa('0x170')});db['OpenchannelApplication']['belongsTo'](db['Interval'],{'onDelete':_0x0bfa('0x15d'),'foreignKey':'IntervalId'});db[_0x0bfa('0x171')]['belongsTo'](db['Tag'],{'onDelete':_0x0bfa('0x15d'),'foreignKey':_0x0bfa('0x15e')});db[_0x0bfa('0x5e')][_0x0bfa('0x104')](db[_0x0bfa('0x60')],{'as':'Messages','onDelete':'cascade','foreignKey':'OpenchannelInteractionId'});db[_0x0bfa('0x5e')]['belongsTo'](db['OpenchannelAccount'],{'as':_0x0bfa('0x157'),'foreignKey':_0x0bfa('0x170')});db[_0x0bfa('0x5e')][_0x0bfa('0x10e')](db[_0x0bfa('0x72')],{'as':_0x0bfa('0x14b'),'foreignKey':_0x0bfa('0x14c')});db['OpenchannelInteraction'][_0x0bfa('0x10e')](db['User'],{'as':_0x0bfa('0x158'),'foreignKey':'UserId'});db[_0x0bfa('0x5e')][_0x0bfa('0x110')](db[_0x0bfa('0x8f')],{'through':_0x0bfa('0x174'),'as':_0x0bfa('0x16d')});db[_0x0bfa('0x5e')][_0x0bfa('0x110')](db[_0x0bfa('0x8f')],{'through':_0x0bfa('0x174'),'as':_0x0bfa('0x166')});db[_0x0bfa('0x5e')]['belongsToMany'](db[_0x0bfa('0x15')],{'as':_0x0bfa('0x15a'),'through':_0x0bfa('0x11c'),'foreignKey':'OpenchannelInteractionId'});db[_0x0bfa('0x60')][_0x0bfa('0x10e')](db[_0x0bfa('0x15')],{'onDelete':'cascade','as':_0x0bfa('0x15')});db[_0x0bfa('0x60')]['belongsTo'](db[_0x0bfa('0x72')],{'onDelete':'cascade','as':_0x0bfa('0x14b')});db['OpenchannelMessage'][_0x0bfa('0x10e')](db[_0x0bfa('0x5e')],{'onDelete':_0x0bfa('0x102'),'as':_0x0bfa('0x15c'),'foreignKey':'OpenchannelInteractionId'});db[_0x0bfa('0x60')]['belongsTo'](db['Attachment'],{'as':_0x0bfa('0xec'),'foreignKey':_0x0bfa('0x175')});db['OpenchannelMessage'][_0x0bfa('0x10e')](db[_0x0bfa('0x5b')],{'as':_0x0bfa('0x157'),'foreignKey':_0x0bfa('0x170')});db[_0x0bfa('0x172')][_0x0bfa('0x110')](db[_0x0bfa('0x15')],{'as':'Agents','through':_0x0bfa('0x38'),'foreignKey':_0x0bfa('0x173')});db[_0x0bfa('0x172')][_0x0bfa('0x110')](db[_0x0bfa('0x13f')],{'through':_0x0bfa('0x176'),'as':_0x0bfa('0x140')});db[_0x0bfa('0x63')]['hasMany'](db['Disposition'],{'as':_0x0bfa('0x151'),'foreignKey':_0x0bfa('0x177')});db[_0x0bfa('0x63')]['hasMany'](db[_0x0bfa('0x80')],{'as':_0x0bfa('0x152'),'foreignKey':_0x0bfa('0x177')});db[_0x0bfa('0x63')][_0x0bfa('0x104')](db[_0x0bfa('0x6f')],{'as':_0x0bfa('0x178')});db['ChatWebsite']['hasMany'](db[_0x0bfa('0x68')],{'as':'Interactions'});db[_0x0bfa('0x63')][_0x0bfa('0x104')](db[_0x0bfa('0x67')],{'as':'Applications'});db[_0x0bfa('0x63')][_0x0bfa('0x104')](db[_0x0bfa('0x69')],{'as':_0x0bfa('0x153')});db[_0x0bfa('0x63')][_0x0bfa('0x10e')](db['CmList'],{'as':_0x0bfa('0x15f'),'foreignKey':_0x0bfa('0x160')});db[_0x0bfa('0x63')][_0x0bfa('0x10e')](db[_0x0bfa('0x85')],{'as':'Interval','foreignKey':_0x0bfa('0x13a')});db[_0x0bfa('0x63')][_0x0bfa('0x10e')](db['Pause'],{'as':_0x0bfa('0x13c'),'foreignKey':'mandatoryDispositionPauseId'});db['ChatWebsite'][_0x0bfa('0x110')](db['User'],{'as':_0x0bfa('0x13e'),'through':_0x0bfa('0x123')});db[_0x0bfa('0x65')]['belongsTo'](db[_0x0bfa('0x5b')],{});db[_0x0bfa('0x65')][_0x0bfa('0x10e')](db[_0x0bfa('0xfa')],{'as':_0x0bfa('0x15f'),'foreignKey':_0x0bfa('0x160')});db[_0x0bfa('0x65')][_0x0bfa('0x10e')](db[_0x0bfa('0x72')],{'as':_0x0bfa('0x14b'),'foreignKey':_0x0bfa('0x14c')});db['OpenchannelQueueReport']['belongsTo'](db[_0x0bfa('0x5e')],{});db[_0x0bfa('0x65')][_0x0bfa('0x10e')](db['OpenchannelMessage'],{});db[_0x0bfa('0x65')]['belongsTo'](db[_0x0bfa('0x15')],{});db[_0x0bfa('0x65')]['belongsTo'](db[_0x0bfa('0x172')],{});db[_0x0bfa('0x67')][_0x0bfa('0x10e')](db[_0x0bfa('0x15')],{'as':_0x0bfa('0x179'),'foreignKey':_0x0bfa('0x103'),'onDelete':_0x0bfa('0x15d')});db[_0x0bfa('0x67')][_0x0bfa('0x10e')](db['ChatQueue'],{'as':'Queue','foreignKey':_0x0bfa('0x17a'),'onDelete':'restrict'});db[_0x0bfa('0x67')][_0x0bfa('0x10e')](db['ChatWebsite'],{'as':'Website','foreignKey':_0x0bfa('0x177'),'onDelete':_0x0bfa('0x15d')});db[_0x0bfa('0x67')]['belongsTo'](db[_0x0bfa('0x8f')],{'onDelete':_0x0bfa('0x15d'),'foreignKey':_0x0bfa('0x15e')});db[_0x0bfa('0x68')][_0x0bfa('0x104')](db[_0x0bfa('0x69')],{'as':_0x0bfa('0x153'),'onDelete':_0x0bfa('0x102'),'foreignKey':_0x0bfa('0x17b')});db['ChatInteraction'][_0x0bfa('0x10e')](db[_0x0bfa('0x63')],{'as':_0x0bfa('0x157'),'foreignKey':_0x0bfa('0x177')});db[_0x0bfa('0x68')][_0x0bfa('0x10e')](db[_0x0bfa('0x72')],{'as':_0x0bfa('0x14b'),'foreignKey':'ContactId'});db[_0x0bfa('0x68')][_0x0bfa('0x10e')](db['User'],{'as':_0x0bfa('0x158'),'foreignKey':_0x0bfa('0x103')});db[_0x0bfa('0x68')][_0x0bfa('0x110')](db[_0x0bfa('0x8f')],{'through':_0x0bfa('0x17c'),'as':_0x0bfa('0x16d')});db[_0x0bfa('0x68')][_0x0bfa('0x110')](db[_0x0bfa('0x8f')],{'through':_0x0bfa('0x17c'),'as':'ThroughTags'});db[_0x0bfa('0x68')][_0x0bfa('0x110')](db['User'],{'as':_0x0bfa('0x15a'),'through':_0x0bfa('0x118'),'foreignKey':_0x0bfa('0x17b')});db['ChatMessage'][_0x0bfa('0x10e')](db[_0x0bfa('0x15')],{'onDelete':_0x0bfa('0x102'),'as':_0x0bfa('0x15')});db[_0x0bfa('0x69')][_0x0bfa('0x10e')](db[_0x0bfa('0x72')],{'onDelete':'cascade','as':_0x0bfa('0x14b'),'foreignKey':_0x0bfa('0x14c')});db[_0x0bfa('0x69')][_0x0bfa('0x10e')](db[_0x0bfa('0x68')],{'onDelete':_0x0bfa('0x102'),'as':_0x0bfa('0x15c'),'foreignKey':_0x0bfa('0x17b')});db['ChatMessage'][_0x0bfa('0x10e')](db[_0x0bfa('0xec')],{'as':_0x0bfa('0xec'),'foreignKey':_0x0bfa('0x175')});db[_0x0bfa('0x69')][_0x0bfa('0x10e')](db[_0x0bfa('0x63')],{'as':_0x0bfa('0x157'),'foreignKey':_0x0bfa('0x177')});db[_0x0bfa('0x17d')]['belongsTo'](db[_0x0bfa('0x72')],{'onDelete':_0x0bfa('0x102'),'as':'Contact','foreignKey':_0x0bfa('0x14c')});db['ChatOfflineMessage'][_0x0bfa('0x10e')](db[_0x0bfa('0x63')],{'as':_0x0bfa('0x157'),'foreignKey':'ChatWebsiteId'});db[_0x0bfa('0x6c')][_0x0bfa('0x110')](db[_0x0bfa('0x15')],{'as':_0x0bfa('0x13e'),'through':_0x0bfa('0x31'),'hooks':!![]});db[_0x0bfa('0x6c')]['belongsToMany'](db[_0x0bfa('0x13f')],{'through':_0x0bfa('0x17e'),'as':'Teams'});db[_0x0bfa('0x6d')][_0x0bfa('0x104')](db[_0x0bfa('0xd5')],{'as':_0x0bfa('0x153'),'foreignKey':'ChatGroupId','onDelete':_0x0bfa('0x102')});db[_0x0bfa('0x6d')][_0x0bfa('0x110')](db[_0x0bfa('0x15')],{'as':_0x0bfa('0x131'),'through':_0x0bfa('0x17f')});db[_0x0bfa('0x6f')]['belongsTo'](db[_0x0bfa('0x63')],{'as':_0x0bfa('0x180'),'foreignKey':_0x0bfa('0x177')});db['CmCompany'][_0x0bfa('0x104')](db[_0x0bfa('0x72')],{'as':_0x0bfa('0x112'),'foreignKey':_0x0bfa('0x181')});db['CmContact'][_0x0bfa('0x104')](db[_0x0bfa('0x74')],{'as':'Hoppers','foreignKey':_0x0bfa('0x14c')});db['CmContact'][_0x0bfa('0x104')](db[_0x0bfa('0x108')],{'as':_0x0bfa('0x134'),'foreignKey':_0x0bfa('0x14c')});db[_0x0bfa('0x72')][_0x0bfa('0x104')](db[_0x0bfa('0x76')],{'as':_0x0bfa('0x135'),'foreignKey':_0x0bfa('0x14c')});db[_0x0bfa('0x72')][_0x0bfa('0x104')](db[_0x0bfa('0x78')],{'as':'ReportAgentPreview','foreignKey':_0x0bfa('0x14c')});db['CmContact'][_0x0bfa('0x104')](db[_0x0bfa('0x137')],{'as':_0x0bfa('0x138'),'foreignKey':'ContactId'});db[_0x0bfa('0x72')][_0x0bfa('0x104')](db[_0x0bfa('0x5e')],{'as':'OpenchannelInteractions','foreignKey':_0x0bfa('0x14c'),'onDelete':_0x0bfa('0x15d')});db['CmContact'][_0x0bfa('0x104')](db['ChatInteraction'],{'as':'ChatInteractions','foreignKey':_0x0bfa('0x14c'),'onDelete':'restrict'});db['CmContact'][_0x0bfa('0x104')](db['SmsInteraction'],{'as':_0x0bfa('0x10c'),'foreignKey':_0x0bfa('0x14c'),'onDelete':_0x0bfa('0x15d')});db['CmContact'][_0x0bfa('0x104')](db['FaxInteraction'],{'as':'FaxInteractions','foreignKey':_0x0bfa('0x14c'),'onDelete':'restrict'});db[_0x0bfa('0x72')][_0x0bfa('0x104')](db[_0x0bfa('0x41')],{'as':_0x0bfa('0x10d'),'foreignKey':'ContactId','onDelete':_0x0bfa('0x15d')});db[_0x0bfa('0x72')][_0x0bfa('0x10e')](db[_0x0bfa('0x70')],{'as':_0x0bfa('0x182'),'foreignKey':'CompanyId'});db[_0x0bfa('0x72')][_0x0bfa('0x10e')](db[_0x0bfa('0xfa')],{'as':'List','foreignKey':'ListId','onDelete':_0x0bfa('0x102')});db[_0x0bfa('0x72')]['belongsToMany'](db['User'],{'as':_0x0bfa('0x15a'),'through':_0x0bfa('0x113')});db['CmContact'][_0x0bfa('0x110')](db['Tag'],{'as':_0x0bfa('0x16d'),'through':_0x0bfa('0x183')});db['CmContact']['belongsToMany'](db[_0x0bfa('0x8f')],{'through':_0x0bfa('0x183'),'as':_0x0bfa('0x166')});db[_0x0bfa('0x74')][_0x0bfa('0x10e')](db[_0x0bfa('0x72')],{'as':_0x0bfa('0x14b'),'foreignKey':_0x0bfa('0x14c'),'onDelete':'cascade'});db['CmHopper']['belongsTo'](db['CmList'],{'as':_0x0bfa('0x15f'),'foreignKey':_0x0bfa('0x160'),'onDelete':_0x0bfa('0x102')});db['CmHopper']['belongsTo'](db['User'],{'as':_0x0bfa('0x179'),'foreignKey':_0x0bfa('0x103')});db[_0x0bfa('0x74')]['belongsTo'](db[_0x0bfa('0x11d')],{'as':_0x0bfa('0x184'),'foreignKey':_0x0bfa('0x132'),'onDelete':_0x0bfa('0x102')});db['CmHopper'][_0x0bfa('0x10e')](db[_0x0bfa('0xe8')],{'as':_0x0bfa('0xe8'),'foreignKey':'CampaignId','onDelete':_0x0bfa('0x102')});db[_0x0bfa('0x74')][_0x0bfa('0x10e')](db[_0x0bfa('0x15')],{'as':_0x0bfa('0x158'),'foreignKey':_0x0bfa('0x185')});db[_0x0bfa('0x186')][_0x0bfa('0x10e')](db[_0x0bfa('0x72')],{'as':_0x0bfa('0x14b'),'foreignKey':_0x0bfa('0x14c'),'onDelete':_0x0bfa('0x102')});db[_0x0bfa('0x186')]['belongsTo'](db[_0x0bfa('0xfa')],{'as':_0x0bfa('0x15f'),'foreignKey':_0x0bfa('0x160'),'onDelete':_0x0bfa('0x102')});db[_0x0bfa('0x186')][_0x0bfa('0x10e')](db[_0x0bfa('0x11d')],{'as':_0x0bfa('0x184'),'foreignKey':_0x0bfa('0x132'),'onDelete':'cascade'});db[_0x0bfa('0x186')][_0x0bfa('0x10e')](db[_0x0bfa('0xe8')],{'as':'Campaign','foreignKey':_0x0bfa('0x187'),'onDelete':_0x0bfa('0x102')});db['Automation'][_0x0bfa('0x104')](db[_0x0bfa('0x188')],{'as':{'plural':_0x0bfa('0x189'),'singular':_0x0bfa('0x18a')},'foreignKey':_0x0bfa('0x18b'),'onDelete':_0x0bfa('0x102'),'hooks':!![]});db['Automation'][_0x0bfa('0x104')](db[_0x0bfa('0x188')],{'as':{'plural':'Any','singular':'OneAny'},'foreignKey':_0x0bfa('0x18c'),'onDelete':_0x0bfa('0x102'),'hooks':!![]});db['Automation'][_0x0bfa('0x104')](db[_0x0bfa('0x7c')],{'as':_0x0bfa('0x18d'),'foreignKey':_0x0bfa('0x18e'),'onDelete':_0x0bfa('0x102'),'hooks':!![]});db['Interval'][_0x0bfa('0x104')](db[_0x0bfa('0x85')],{'as':'Intervals','foreignKey':_0x0bfa('0x13a'),'onDelete':_0x0bfa('0x102'),'hooks':!![],'required':![]});db['Interval'][_0x0bfa('0x104')](db[_0x0bfa('0x1b')],{'as':_0x0bfa('0x107'),'foreignKey':'IntervalId','onDelete':_0x0bfa('0x15d')});db[_0x0bfa('0x85')][_0x0bfa('0x104')](db['MailApplication'],{'as':_0x0bfa('0x18f'),'foreignKey':_0x0bfa('0x13a')});db[_0x0bfa('0x85')][_0x0bfa('0x104')](db['ChatApplication'],{'as':_0x0bfa('0x190'),'foreignKey':'IntervalId'});db[_0x0bfa('0x85')][_0x0bfa('0x104')](db[_0x0bfa('0x4d')],{'as':'FaxApplications','foreignKey':_0x0bfa('0x13a')});db[_0x0bfa('0x85')][_0x0bfa('0x104')](db[_0x0bfa('0x16b')],{'as':_0x0bfa('0x191'),'foreignKey':_0x0bfa('0x13a')});db[_0x0bfa('0x8b')]['belongsTo'](db[_0x0bfa('0x3d')],{});db[_0x0bfa('0x8b')]['belongsTo'](db[_0x0bfa('0x9b')],{'foreignKey':'DefaultReportId'});db[_0x0bfa('0x8b')][_0x0bfa('0x10e')](db[_0x0bfa('0x99')],{'foreignKey':_0x0bfa('0x192')});db[_0x0bfa('0x8d')]['belongsToMany'](db[_0x0bfa('0x1d')],{'as':_0x0bfa('0x193'),'through':_0x0bfa('0x194'),'onDelete':_0x0bfa('0x15d')});db[_0x0bfa('0x8f')]['belongsToMany'](db[_0x0bfa('0x72')],{'through':'cm_contact_has_tags'});db[_0x0bfa('0x8f')]['belongsToMany'](db['ChatInteraction'],{'through':'chat_interaction_has_tags'});db[_0x0bfa('0x8f')][_0x0bfa('0x110')](db[_0x0bfa('0x41')],{'through':'mail_interaction_has_tags'});db['Tag']['belongsToMany'](db[_0x0bfa('0x10b')],{'through':_0x0bfa('0x195')});db['Tag'][_0x0bfa('0x110')](db['FaxInteraction'],{'through':_0x0bfa('0x165')});db[_0x0bfa('0x8f')][_0x0bfa('0x110')](db[_0x0bfa('0x5e')],{'through':_0x0bfa('0x174')});db[_0x0bfa('0x196')][_0x0bfa('0x104')](db['Condition'],{'as':{'plural':_0x0bfa('0x197'),'singular':_0x0bfa('0x198')},'foreignKey':_0x0bfa('0x199'),'onDelete':_0x0bfa('0x102'),'hooks':!![]});db['Trigger'][_0x0bfa('0x104')](db[_0x0bfa('0x188')],{'as':{'plural':_0x0bfa('0x19a'),'singular':'AnyCondition'},'foreignKey':'TriggerAnyId','onDelete':'cascade','hooks':!![]});db[_0x0bfa('0x196')]['hasMany'](db[_0x0bfa('0x7c')],{'as':_0x0bfa('0x18d'),'foreignKey':_0x0bfa('0x19b'),'onDelete':_0x0bfa('0x102'),'hooks':!![]});db[_0x0bfa('0x99')][_0x0bfa('0x104')](db[_0x0bfa('0xa0')],{'as':'Fields','onDelete':'cascade','foreignKey':_0x0bfa('0x192'),'hooks':!![]});db[_0x0bfa('0x9b')][_0x0bfa('0x104')](db[_0x0bfa('0xa0')],{'as':_0x0bfa('0x19c'),'onDelete':_0x0bfa('0x102'),'foreignKey':'DefaultReportId'});db[_0x0bfa('0x9e')][_0x0bfa('0x104')](db['AnalyticFieldReport'],{'as':_0x0bfa('0x19c'),'onDelete':_0x0bfa('0x102'),'foreignKey':_0x0bfa('0x19d')});db[_0x0bfa('0xa0')][_0x0bfa('0x10e')](db['AnalyticMetric'],{'foreignKey':_0x0bfa('0x19d')});db[_0x0bfa('0xa4')][_0x0bfa('0x104')](db[_0x0bfa('0xa6')],{'as':_0x0bfa('0x19e'),'onDelete':_0x0bfa('0x102'),'foreignKey':_0x0bfa('0x19f')});db[_0x0bfa('0xa6')]['hasMany'](db['SalesforceField'],{'as':'Subjects','onDelete':'cascade','foreignKey':'SubjectId'});db[_0x0bfa('0xa6')][_0x0bfa('0x104')](db['SalesforceField'],{'as':_0x0bfa('0x1a0'),'onDelete':_0x0bfa('0x102'),'foreignKey':_0x0bfa('0x1a1')});db[_0x0bfa('0xa6')][_0x0bfa('0x104')](db[_0x0bfa('0x1a2')],{'as':_0x0bfa('0x19c'),'onDelete':'cascade','foreignKey':_0x0bfa('0x1a3')});db[_0x0bfa('0xa6')][_0x0bfa('0x10e')](db['SalesforceAccount'],{'as':'Account','foreignKey':_0x0bfa('0x19f')});db[_0x0bfa('0x1a2')][_0x0bfa('0x104')](db[_0x0bfa('0x1a2')],{'as':_0x0bfa('0x1a4'),'foreignKey':'SubjectId'});db[_0x0bfa('0x1a2')][_0x0bfa('0x104')](db[_0x0bfa('0x1a2')],{'as':_0x0bfa('0x1a5'),'foreignKey':_0x0bfa('0x1a1')});db[_0x0bfa('0x1a2')][_0x0bfa('0x104')](db[_0x0bfa('0x1a2')],{'as':_0x0bfa('0x1a6'),'foreignKey':_0x0bfa('0x1a3')});db[_0x0bfa('0x1a2')][_0x0bfa('0x10e')](db[_0x0bfa('0x1a7')],{'as':_0x0bfa('0x1a7'),'foreignKey':_0x0bfa('0x1a8')});db['SugarcrmAccount']['hasMany'](db[_0x0bfa('0xab')],{'as':_0x0bfa('0x19e'),'onDelete':_0x0bfa('0x102'),'foreignKey':'AccountId'});db[_0x0bfa('0xab')][_0x0bfa('0x104')](db[_0x0bfa('0xad')],{'as':_0x0bfa('0x1a9'),'onDelete':'cascade','foreignKey':_0x0bfa('0x1aa')});db[_0x0bfa('0xab')][_0x0bfa('0x104')](db[_0x0bfa('0xad')],{'as':_0x0bfa('0x1a0'),'onDelete':_0x0bfa('0x102'),'foreignKey':'DescriptionId'});db[_0x0bfa('0xab')]['hasMany'](db['SugarcrmField'],{'as':_0x0bfa('0x19c'),'onDelete':_0x0bfa('0x102'),'foreignKey':'FieldId'});db[_0x0bfa('0xab')][_0x0bfa('0x10e')](db[_0x0bfa('0xa9')],{'as':_0x0bfa('0x157'),'foreignKey':_0x0bfa('0x19f')});db['SugarcrmField'][_0x0bfa('0x104')](db[_0x0bfa('0xad')],{'as':_0x0bfa('0x1a4'),'foreignKey':_0x0bfa('0x1aa')});db[_0x0bfa('0xad')][_0x0bfa('0x104')](db[_0x0bfa('0xad')],{'as':'Description','foreignKey':'DescriptionId'});db['SugarcrmField'][_0x0bfa('0x104')](db[_0x0bfa('0xad')],{'as':'Field','foreignKey':_0x0bfa('0x1a3')});db['SugarcrmField'][_0x0bfa('0x10e')](db['Variable'],{'as':_0x0bfa('0x1a7'),'foreignKey':_0x0bfa('0x1a8')});db['DeskAccount'][_0x0bfa('0x104')](db[_0x0bfa('0x1ab')],{'as':_0x0bfa('0x19e'),'onDelete':_0x0bfa('0x102'),'foreignKey':_0x0bfa('0x19f')});db[_0x0bfa('0x1ab')][_0x0bfa('0x104')](db[_0x0bfa('0xb2')],{'as':_0x0bfa('0x1a9'),'onDelete':'cascade','foreignKey':_0x0bfa('0x1aa')});db[_0x0bfa('0x1ab')]['hasMany'](db[_0x0bfa('0xb2')],{'as':_0x0bfa('0x1a0'),'onDelete':_0x0bfa('0x102'),'foreignKey':_0x0bfa('0x1a1')});db['DeskConfiguration'][_0x0bfa('0x104')](db['DeskField'],{'as':_0x0bfa('0x19c'),'onDelete':_0x0bfa('0x102'),'foreignKey':'FieldId'});db[_0x0bfa('0x1ab')][_0x0bfa('0x10e')](db[_0x0bfa('0xaf')],{'as':_0x0bfa('0x157'),'foreignKey':_0x0bfa('0x19f')});db[_0x0bfa('0x1ab')][_0x0bfa('0x110')](db['Tag'],{'through':_0x0bfa('0x1ac')});db[_0x0bfa('0xb2')][_0x0bfa('0x104')](db[_0x0bfa('0xb2')],{'as':'Subject','foreignKey':_0x0bfa('0x1aa')});db['DeskField'][_0x0bfa('0x104')](db['DeskField'],{'as':_0x0bfa('0x1a5'),'foreignKey':'DescriptionId'});db[_0x0bfa('0xb2')][_0x0bfa('0x104')](db[_0x0bfa('0xb2')],{'as':_0x0bfa('0x1a6'),'foreignKey':_0x0bfa('0x1a3')});db[_0x0bfa('0xb2')]['belongsTo'](db[_0x0bfa('0x1a7')],{'as':_0x0bfa('0x1a7'),'foreignKey':_0x0bfa('0x1a8')});db[_0x0bfa('0xb4')][_0x0bfa('0x104')](db['ZohoConfiguration'],{'as':_0x0bfa('0x19e'),'onDelete':'cascade','foreignKey':_0x0bfa('0x19f')});db[_0x0bfa('0xb6')][_0x0bfa('0x104')](db['ZohoField'],{'as':'Subjects','onDelete':_0x0bfa('0x102'),'foreignKey':_0x0bfa('0x1aa')});db[_0x0bfa('0xb6')][_0x0bfa('0x104')](db[_0x0bfa('0xb8')],{'as':_0x0bfa('0x1a0'),'onDelete':_0x0bfa('0x102'),'foreignKey':_0x0bfa('0x1a1')});db[_0x0bfa('0xb6')][_0x0bfa('0x104')](db[_0x0bfa('0xb8')],{'as':_0x0bfa('0x19c'),'onDelete':'cascade','foreignKey':_0x0bfa('0x1a3')});db[_0x0bfa('0xb6')][_0x0bfa('0x10e')](db[_0x0bfa('0xb4')],{'as':_0x0bfa('0x157'),'foreignKey':'AccountId'});db[_0x0bfa('0xb8')][_0x0bfa('0x104')](db[_0x0bfa('0xb8')],{'as':_0x0bfa('0x1a4'),'foreignKey':_0x0bfa('0x1aa')});db[_0x0bfa('0xb8')][_0x0bfa('0x104')](db[_0x0bfa('0xb8')],{'as':_0x0bfa('0x1a5'),'foreignKey':_0x0bfa('0x1a1')});db[_0x0bfa('0xb8')][_0x0bfa('0x104')](db['ZohoField'],{'as':_0x0bfa('0x1a6'),'foreignKey':_0x0bfa('0x1a3')});db['ZohoField'][_0x0bfa('0x10e')](db['Variable'],{'as':_0x0bfa('0x1a7'),'foreignKey':_0x0bfa('0x1a8')});db[_0x0bfa('0x1ad')][_0x0bfa('0x104')](db['ZendeskConfiguration'],{'as':_0x0bfa('0x19e'),'onDelete':_0x0bfa('0x102'),'foreignKey':_0x0bfa('0x19f')});db[_0x0bfa('0xbb')][_0x0bfa('0x104')](db[_0x0bfa('0xbd')],{'as':'Subjects','foreignKey':_0x0bfa('0x1aa')});db[_0x0bfa('0xbb')][_0x0bfa('0x104')](db[_0x0bfa('0xbd')],{'as':_0x0bfa('0x1a0'),'foreignKey':_0x0bfa('0x1a1')});db[_0x0bfa('0xbb')][_0x0bfa('0x104')](db[_0x0bfa('0xbd')],{'as':'Fields','foreignKey':'FieldId'});db[_0x0bfa('0xbb')][_0x0bfa('0x10e')](db['ZendeskAccount'],{'as':'Account','foreignKey':_0x0bfa('0x19f')});db[_0x0bfa('0xbb')][_0x0bfa('0x110')](db[_0x0bfa('0x8f')],{'through':_0x0bfa('0x1ae')});db[_0x0bfa('0xbd')][_0x0bfa('0x104')](db[_0x0bfa('0xbd')],{'as':_0x0bfa('0x1a4'),'foreignKey':_0x0bfa('0x1aa')});db['ZendeskField']['hasMany'](db[_0x0bfa('0xbd')],{'as':'Description','foreignKey':_0x0bfa('0x1a1')});db[_0x0bfa('0xbd')][_0x0bfa('0x104')](db['ZendeskField'],{'as':'Field','foreignKey':'FieldId'});db[_0x0bfa('0xbd')]['belongsTo'](db[_0x0bfa('0x1a7')],{'as':_0x0bfa('0x1a7'),'foreignKey':_0x0bfa('0x1a8')});db[_0x0bfa('0xbe')][_0x0bfa('0x104')](db['FreshdeskConfiguration'],{'as':_0x0bfa('0x19e'),'onDelete':'cascade','foreignKey':_0x0bfa('0x19f')});db[_0x0bfa('0xc0')][_0x0bfa('0x104')](db[_0x0bfa('0xc2')],{'as':_0x0bfa('0x1a9'),'onDelete':'cascade','foreignKey':'SubjectId'});db['FreshdeskConfiguration'][_0x0bfa('0x104')](db[_0x0bfa('0xc2')],{'as':_0x0bfa('0x1a0'),'onDelete':_0x0bfa('0x102'),'foreignKey':_0x0bfa('0x1a1')});db[_0x0bfa('0xc0')][_0x0bfa('0x104')](db[_0x0bfa('0xc2')],{'as':_0x0bfa('0x19c'),'onDelete':_0x0bfa('0x102'),'foreignKey':_0x0bfa('0x1a3')});db[_0x0bfa('0xc0')][_0x0bfa('0x10e')](db['FreshdeskAccount'],{'as':_0x0bfa('0x157'),'foreignKey':_0x0bfa('0x19f')});db[_0x0bfa('0xc0')]['belongsToMany'](db[_0x0bfa('0x8f')],{'through':_0x0bfa('0x1af')});db['FreshdeskField'][_0x0bfa('0x104')](db[_0x0bfa('0xc2')],{'as':'Subject','foreignKey':_0x0bfa('0x1aa')});db['FreshdeskField']['hasMany'](db[_0x0bfa('0xc2')],{'as':_0x0bfa('0x1a5'),'foreignKey':_0x0bfa('0x1a1')});db[_0x0bfa('0xc2')][_0x0bfa('0x104')](db[_0x0bfa('0xc2')],{'as':_0x0bfa('0x1a6'),'foreignKey':_0x0bfa('0x1a3')});db[_0x0bfa('0xc2')][_0x0bfa('0x10e')](db[_0x0bfa('0x1a7')],{'as':'Variable','foreignKey':_0x0bfa('0x1a8')});db[_0x0bfa('0xc4')]['hasMany'](db[_0x0bfa('0x1b0')],{'as':'Configurations','onDelete':_0x0bfa('0x102'),'foreignKey':_0x0bfa('0x19f')});db['VtigerConfiguration'][_0x0bfa('0x104')](db[_0x0bfa('0x1b1')],{'as':_0x0bfa('0x1a9'),'foreignKey':_0x0bfa('0x1aa')});db['VtigerConfiguration'][_0x0bfa('0x104')](db[_0x0bfa('0x1b1')],{'as':_0x0bfa('0x1a0'),'foreignKey':_0x0bfa('0x1a1')});db[_0x0bfa('0x1b0')]['hasMany'](db[_0x0bfa('0x1b1')],{'as':_0x0bfa('0x19c'),'foreignKey':_0x0bfa('0x1a3')});db[_0x0bfa('0x1b0')][_0x0bfa('0x10e')](db[_0x0bfa('0xc4')],{'as':_0x0bfa('0x157'),'foreignKey':_0x0bfa('0x19f')});db[_0x0bfa('0x1b0')][_0x0bfa('0x110')](db[_0x0bfa('0x8f')],{'through':_0x0bfa('0x1b2')});db[_0x0bfa('0x1b1')][_0x0bfa('0x104')](db['VtigerField'],{'as':_0x0bfa('0x1a4'),'foreignKey':_0x0bfa('0x1aa')});db['VtigerField']['hasMany'](db[_0x0bfa('0x1b1')],{'as':_0x0bfa('0x1a5'),'foreignKey':_0x0bfa('0x1a1')});db[_0x0bfa('0x1b1')][_0x0bfa('0x104')](db[_0x0bfa('0x1b1')],{'as':'Field','foreignKey':_0x0bfa('0x1a3')});db[_0x0bfa('0x1b1')]['belongsTo'](db[_0x0bfa('0x1a7')],{'as':'Variable','foreignKey':_0x0bfa('0x1a8')});db[_0x0bfa('0xc7')][_0x0bfa('0x104')](db[_0x0bfa('0xc9')],{'as':_0x0bfa('0x19e'),'onDelete':_0x0bfa('0x102'),'foreignKey':'AccountId'});db[_0x0bfa('0xc9')][_0x0bfa('0x104')](db[_0x0bfa('0xcb')],{'as':'Subjects','foreignKey':_0x0bfa('0x1aa')});db[_0x0bfa('0xc9')][_0x0bfa('0x104')](db['ServicenowField'],{'as':_0x0bfa('0x1a0'),'foreignKey':_0x0bfa('0x1a1')});db[_0x0bfa('0xc9')]['hasMany'](db[_0x0bfa('0xcb')],{'as':_0x0bfa('0x19c'),'foreignKey':_0x0bfa('0x1a3')});db[_0x0bfa('0xc9')][_0x0bfa('0x10e')](db[_0x0bfa('0xc7')],{'as':_0x0bfa('0x157'),'foreignKey':_0x0bfa('0x19f')});db[_0x0bfa('0xcb')][_0x0bfa('0x104')](db[_0x0bfa('0xcb')],{'as':_0x0bfa('0x1a4'),'foreignKey':_0x0bfa('0x1aa')});db['ServicenowField'][_0x0bfa('0x104')](db[_0x0bfa('0xcb')],{'as':_0x0bfa('0x1a5'),'foreignKey':_0x0bfa('0x1a1')});db[_0x0bfa('0xcb')]['hasMany'](db[_0x0bfa('0xcb')],{'as':'Field','foreignKey':_0x0bfa('0x1a3')});db[_0x0bfa('0xcb')][_0x0bfa('0x10e')](db['Variable'],{'as':'Variable','foreignKey':_0x0bfa('0x1a8')});db[_0x0bfa('0xcd')]['hasMany'](db[_0x0bfa('0x1b3')],{'as':_0x0bfa('0x19e'),'onDelete':'cascade','foreignKey':_0x0bfa('0x19f')});db[_0x0bfa('0x1b3')][_0x0bfa('0x104')](db['Dynamics365Field'],{'as':_0x0bfa('0x1a9'),'onDelete':_0x0bfa('0x102'),'foreignKey':_0x0bfa('0x1aa')});db[_0x0bfa('0x1b3')][_0x0bfa('0x104')](db[_0x0bfa('0xd0')],{'as':_0x0bfa('0x1a0'),'onDelete':_0x0bfa('0x102'),'foreignKey':_0x0bfa('0x1a1')});db['Dynamics365Configuration'][_0x0bfa('0x104')](db[_0x0bfa('0xd0')],{'as':_0x0bfa('0x19c'),'onDelete':_0x0bfa('0x102'),'foreignKey':_0x0bfa('0x1a3')});db[_0x0bfa('0x1b3')]['belongsTo'](db[_0x0bfa('0xcd')],{'as':_0x0bfa('0x157'),'foreignKey':'AccountId'});db[_0x0bfa('0xd0')][_0x0bfa('0x104')](db[_0x0bfa('0xd0')],{'as':_0x0bfa('0x1a4'),'foreignKey':_0x0bfa('0x1aa')});db[_0x0bfa('0xd0')][_0x0bfa('0x104')](db['Dynamics365Field'],{'as':_0x0bfa('0x1a5'),'foreignKey':_0x0bfa('0x1a1')});db[_0x0bfa('0xd0')][_0x0bfa('0x104')](db[_0x0bfa('0xd0')],{'as':'Field','foreignKey':_0x0bfa('0x1a3')});db['Dynamics365Field'][_0x0bfa('0x10e')](db[_0x0bfa('0x1a7')],{'as':_0x0bfa('0x1a7'),'foreignKey':_0x0bfa('0x1a8')});db['ChatQueueReport'][_0x0bfa('0x10e')](db['ChatWebsite'],{});db[_0x0bfa('0xd3')][_0x0bfa('0x10e')](db[_0x0bfa('0xfa')],{'as':_0x0bfa('0x15f'),'foreignKey':_0x0bfa('0x160')});db[_0x0bfa('0xd3')]['belongsTo'](db[_0x0bfa('0x72')],{'as':_0x0bfa('0x14b'),'foreignKey':_0x0bfa('0x14c')});db[_0x0bfa('0xd3')][_0x0bfa('0x10e')](db[_0x0bfa('0x68')],{});db[_0x0bfa('0xd3')]['belongsTo'](db[_0x0bfa('0x69')],{});db['ChatQueueReport'][_0x0bfa('0x10e')](db['User'],{});db['ChatQueueReport'][_0x0bfa('0x10e')](db[_0x0bfa('0x6c')],{});db[_0x0bfa('0xd5')][_0x0bfa('0x10e')](db[_0x0bfa('0x15')],{'onDelete':'cascade','foreignKey':_0x0bfa('0x1b4')});db[_0x0bfa('0xd5')]['belongsTo'](db[_0x0bfa('0x15')],{'onDelete':_0x0bfa('0x102'),'foreignKey':'ToId'});db[_0x0bfa('0x137')][_0x0bfa('0x104')](db[_0x0bfa('0x1b5')],{'foreignKey':'SessionId','onDelete':_0x0bfa('0x102')});db[_0x0bfa('0x137')][_0x0bfa('0x104')](db['JscriptyAnswerReport'],{'foreignKey':_0x0bfa('0x1b6'),'onDelete':_0x0bfa('0x102')});db['SmsQueueReport'][_0x0bfa('0x10e')](db[_0x0bfa('0x129')],{});db[_0x0bfa('0xd9')][_0x0bfa('0x10e')](db['CmList'],{'as':'List','foreignKey':_0x0bfa('0x160')});db[_0x0bfa('0xd9')][_0x0bfa('0x10e')](db['CmContact'],{'as':'Contact','foreignKey':'ContactId'});db[_0x0bfa('0xd9')][_0x0bfa('0x10e')](db[_0x0bfa('0x10b')],{});db['SmsQueueReport']['belongsTo'](db[_0x0bfa('0x57')],{});db[_0x0bfa('0xd9')]['belongsTo'](db[_0x0bfa('0x15')],{});db['SmsQueueReport']['belongsTo'](db[_0x0bfa('0x59')],{});db[_0x0bfa('0x1b7')][_0x0bfa('0x104')](db[_0x0bfa('0x137')],{'foreignKey':_0x0bfa('0x1b8')});db[_0x0bfa('0x1b7')]['hasMany'](db['JscriptyQuestionReport'],{'foreignKey':_0x0bfa('0x1b8')});db[_0x0bfa('0x1b7')][_0x0bfa('0x104')](db[_0x0bfa('0x1b9')],{'foreignKey':_0x0bfa('0x1b8')});db['SquareProject']['belongsToMany'](db[_0x0bfa('0x15')],{'as':_0x0bfa('0x15a'),'through':_0x0bfa('0x12c')});db['Team'][_0x0bfa('0x110')](db[_0x0bfa('0x15')],{'as':_0x0bfa('0x13e'),'through':_0x0bfa('0x116')});db[_0x0bfa('0x13f')]['belongsToMany'](db['VoiceQueue'],{'through':_0x0bfa('0x141'),'as':'VoiceQueues'});db[_0x0bfa('0x13f')][_0x0bfa('0x110')](db[_0x0bfa('0x3e')],{'through':_0x0bfa('0x155'),'as':_0x0bfa('0x1ba')});db[_0x0bfa('0x13f')][_0x0bfa('0x110')](db[_0x0bfa('0x6c')],{'through':_0x0bfa('0x17e'),'as':_0x0bfa('0x1bb')});db['Team'][_0x0bfa('0x110')](db[_0x0bfa('0x52')],{'through':_0x0bfa('0x168'),'as':_0x0bfa('0x11f')});db[_0x0bfa('0x13f')][_0x0bfa('0x110')](db[_0x0bfa('0x59')],{'through':_0x0bfa('0x16f'),'as':_0x0bfa('0x120')});db[_0x0bfa('0x13f')][_0x0bfa('0x110')](db['OpenchannelQueue'],{'through':_0x0bfa('0x176'),'as':'OpenchannelQueues'});db[_0x0bfa('0xe8')][_0x0bfa('0x104')](db[_0x0bfa('0x74')],{'as':_0x0bfa('0x133'),'foreignKey':_0x0bfa('0x187')});db[_0x0bfa('0xe8')][_0x0bfa('0x104')](db[_0x0bfa('0x108')],{'as':_0x0bfa('0x134'),'foreignKey':'CampaignId'});db[_0x0bfa('0xe8')][_0x0bfa('0x104')](db['CmHopperHistory'],{'as':_0x0bfa('0x135'),'foreignKey':'CampaignId'});db['Campaign']['hasMany'](db[_0x0bfa('0x186')],{'as':_0x0bfa('0x136'),'foreignKey':_0x0bfa('0x187')});db[_0x0bfa('0xe8')][_0x0bfa('0x10e')](db[_0x0bfa('0x2c')],{'as':_0x0bfa('0x2c'),'foreignKey':_0x0bfa('0x1bc')});db[_0x0bfa('0xe8')][_0x0bfa('0x10e')](db[_0x0bfa('0x2c')],{'as':'TrunkBackup','foreignKey':'TrunkBackupId'});db[_0x0bfa('0xe8')][_0x0bfa('0x10e')](db[_0x0bfa('0x85')],{'as':_0x0bfa('0x85'),'foreignKey':_0x0bfa('0x13a')});db[_0x0bfa('0xe8')][_0x0bfa('0x10e')](db[_0x0bfa('0xe1')],{'as':'SquareProject','foreignKey':'SquareProjectId'});db[_0x0bfa('0xe8')]['belongsToMany'](db['CmList'],{'as':_0x0bfa('0x114'),'through':'campaigns_has_cm_lists'});db[_0x0bfa('0xe8')][_0x0bfa('0x110')](db[_0x0bfa('0xfa')],{'as':_0x0bfa('0x142'),'through':'campaigns_has_cm_blacklists'});db[_0x0bfa('0xf0')][_0x0bfa('0x10e')](db[_0x0bfa('0x43')],{});db['MailTransferReport']['belongsTo'](db[_0x0bfa('0x41')],{});db[_0x0bfa('0xf0')][_0x0bfa('0x10e')](db[_0x0bfa('0x3d')],{'foreignKey':_0x0bfa('0x1bd'),'as':_0x0bfa('0x1be')});db[_0x0bfa('0xf0')][_0x0bfa('0x10e')](db[_0x0bfa('0x15')],{'foreignKey':_0x0bfa('0x1bf'),'as':_0x0bfa('0x1c0')});db[_0x0bfa('0xf0')][_0x0bfa('0x10e')](db[_0x0bfa('0x15')],{'foreignKey':'ToUserId','as':_0x0bfa('0x1c1')});db[_0x0bfa('0xf0')][_0x0bfa('0x10e')](db['MailQueue'],{'foreignKey':_0x0bfa('0x1c2'),'as':_0x0bfa('0x1c3')});db[_0x0bfa('0xf0')][_0x0bfa('0x10e')](db[_0x0bfa('0x3d')],{'foreignKey':_0x0bfa('0x1c4'),'as':_0x0bfa('0x1c5')});db[_0x0bfa('0xf2')]['belongsTo'](db[_0x0bfa('0x69')],{});db[_0x0bfa('0xf2')][_0x0bfa('0x10e')](db['ChatInteraction'],{});db[_0x0bfa('0xf2')][_0x0bfa('0x10e')](db[_0x0bfa('0x63')],{'foreignKey':_0x0bfa('0x1c6'),'as':_0x0bfa('0x1be')});db['ChatTransferReport'][_0x0bfa('0x10e')](db['User'],{'foreignKey':'FromUserId','as':_0x0bfa('0x1c0')});db[_0x0bfa('0xf2')][_0x0bfa('0x10e')](db['User'],{'foreignKey':'ToUserId','as':_0x0bfa('0x1c1')});db[_0x0bfa('0xf2')][_0x0bfa('0x10e')](db['ChatQueue'],{'foreignKey':_0x0bfa('0x1c7'),'as':_0x0bfa('0x1c3')});db[_0x0bfa('0xf2')][_0x0bfa('0x10e')](db[_0x0bfa('0x63')],{'foreignKey':'ToChatWebsiteId','as':_0x0bfa('0x1c5')});db[_0x0bfa('0xf4')][_0x0bfa('0x10e')](db[_0x0bfa('0x50')],{});db[_0x0bfa('0xf4')][_0x0bfa('0x10e')](db[_0x0bfa('0x4e')],{});db[_0x0bfa('0xf4')]['belongsTo'](db[_0x0bfa('0x4b')],{'foreignKey':_0x0bfa('0x1c8'),'as':'FromAccount'});db[_0x0bfa('0xf4')][_0x0bfa('0x10e')](db[_0x0bfa('0x15')],{'foreignKey':_0x0bfa('0x1bf'),'as':_0x0bfa('0x1c0')});db[_0x0bfa('0xf4')][_0x0bfa('0x10e')](db[_0x0bfa('0x15')],{'foreignKey':'ToUserId','as':_0x0bfa('0x1c1')});db[_0x0bfa('0xf4')][_0x0bfa('0x10e')](db[_0x0bfa('0x52')],{'foreignKey':_0x0bfa('0x1c9'),'as':_0x0bfa('0x1c3')});db[_0x0bfa('0xf4')][_0x0bfa('0x10e')](db[_0x0bfa('0x4b')],{'foreignKey':_0x0bfa('0x1ca'),'as':_0x0bfa('0x1c5')});db[_0x0bfa('0xf6')][_0x0bfa('0x10e')](db[_0x0bfa('0x60')],{});db[_0x0bfa('0xf6')][_0x0bfa('0x10e')](db[_0x0bfa('0x5e')],{});db['OpenchannelTransferReport'][_0x0bfa('0x10e')](db[_0x0bfa('0x5b')],{'foreignKey':_0x0bfa('0x1cb'),'as':'FromAccount'});db[_0x0bfa('0xf6')][_0x0bfa('0x10e')](db[_0x0bfa('0x15')],{'foreignKey':_0x0bfa('0x1bf'),'as':_0x0bfa('0x1c0')});db[_0x0bfa('0xf6')][_0x0bfa('0x10e')](db[_0x0bfa('0x15')],{'foreignKey':'ToUserId','as':'ToAgent'});db[_0x0bfa('0xf6')][_0x0bfa('0x10e')](db[_0x0bfa('0x172')],{'foreignKey':_0x0bfa('0x1cc'),'as':'ToQueue'});db[_0x0bfa('0xf6')]['belongsTo'](db[_0x0bfa('0x5b')],{'foreignKey':_0x0bfa('0x1cd'),'as':_0x0bfa('0x1c5')});db[_0x0bfa('0xf8')][_0x0bfa('0x10e')](db['SmsMessage'],{});db[_0x0bfa('0xf8')][_0x0bfa('0x10e')](db[_0x0bfa('0x10b')],{});db[_0x0bfa('0xf8')]['belongsTo'](db[_0x0bfa('0x129')],{'foreignKey':'FromSmsAccountId','as':'FromAccount'});db[_0x0bfa('0xf8')][_0x0bfa('0x10e')](db[_0x0bfa('0x15')],{'foreignKey':'FromUserId','as':_0x0bfa('0x1c0')});db[_0x0bfa('0xf8')][_0x0bfa('0x10e')](db[_0x0bfa('0x15')],{'foreignKey':_0x0bfa('0x1ce'),'as':_0x0bfa('0x1c1')});db[_0x0bfa('0xf8')][_0x0bfa('0x10e')](db['SmsQueue'],{'foreignKey':_0x0bfa('0x1cf'),'as':_0x0bfa('0x1c3')});db[_0x0bfa('0xf8')][_0x0bfa('0x10e')](db[_0x0bfa('0x129')],{'foreignKey':_0x0bfa('0x1d0'),'as':_0x0bfa('0x1c5')});db[_0x0bfa('0xfa')]['hasMany'](db[_0x0bfa('0x82')],{'as':_0x0bfa('0x151'),'foreignKey':_0x0bfa('0x160')});db[_0x0bfa('0xfa')][_0x0bfa('0x104')](db[_0x0bfa('0x7a')],{'as':_0x0bfa('0x1d1'),'foreignKey':_0x0bfa('0x160')});db[_0x0bfa('0xfa')][_0x0bfa('0x104')](db[_0x0bfa('0x72')],{'as':'Contacts','onDelete':'cascade','foreignKey':_0x0bfa('0x160')});db[_0x0bfa('0xfa')][_0x0bfa('0x104')](db['CmHopperFinal'],{'as':'HopperFinals','foreignKey':_0x0bfa('0x160')});db['CmList']['hasMany'](db[_0x0bfa('0x76')],{'as':_0x0bfa('0x1d2'),'foreignKey':_0x0bfa('0x160')});db[_0x0bfa('0xfa')][_0x0bfa('0x104')](db['ReportAgentPreview'],{'as':_0x0bfa('0x78'),'foreignKey':_0x0bfa('0x160')});db[_0x0bfa('0xfa')]['belongsToMany'](db[_0x0bfa('0x11d')],{'as':_0x0bfa('0x1d3'),'through':_0x0bfa('0x1d4')});db[_0x0bfa('0xfa')][_0x0bfa('0x110')](db[_0x0bfa('0x15')],{'as':'Agents','through':_0x0bfa('0x115')});db[_0x0bfa('0xfc')][_0x0bfa('0x104')](db[_0x0bfa('0x1b')],{'as':'Extensions','onDelete':'restrict'});db[_0x0bfa('0xfc')][_0x0bfa('0x110')](db[_0x0bfa('0x15')],{'as':_0x0bfa('0x13e'),'through':_0x0bfa('0x1d5')});db[_0x0bfa('0xfe')][_0x0bfa('0x104')](db[_0x0bfa('0x15')],{'as':_0x0bfa('0x15a'),'foreignKey':'userProfileId'});db[_0x0bfa('0xfe')]['hasMany'](db[_0x0bfa('0x1d6')],{'as':_0x0bfa('0x1d7'),'foreignKey':_0x0bfa('0x10f'),'onDelete':_0x0bfa('0x102')});db[_0x0bfa('0x1d6')]['hasMany'](db['UserProfileResource'],{'as':_0x0bfa('0x1d8'),'foreignKey':_0x0bfa('0x1d9'),'onDelete':_0x0bfa('0x102')});module[_0x0bfa('0x1da')]={'db':db,'dbH':dbH}; \ No newline at end of file diff --git a/server/routes.js b/server/routes.js index 3ca7985..a059a91 100644 --- a/server/routes.js +++ b/server/routes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6901=['./api/voiceQueuesLog','/api/schedules','./api/schedule','/api/sounds','./api/sound','/api/tags','./api/tag','./api/template','/api/triggers','/api/variables','./api/variable','/api/integrations','/api/integrations/reports','./api/integrationReport','/api/analytics/custom_reports','./api/analyticCustomReport','./api/analyticDefaultReport','/api/analytics/extracted_reports','./api/analyticExtractedReport','/api/analytics/metrics','./api/analyticMetric','/api/analytics/field_reports','./api/analyticFieldReport','./api/intSalesforceAccount','/api/integrations/salesforce/configurations','./api/intSalesforceConfiguration','./api/intSalesforceField','/api/integrations/sugarcrm/accounts','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration','/api/integrations/desk/accounts','/api/integrations/desk/configurations','./api/intDeskConfiguration','/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/intFreshdeskAccount','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','./api/intFreshdeskField','/api/integrations/vtiger/accounts','./api/intVtigerAccount','./api/intVtigerConfiguration','/api/integrations/vtiger/fields','./api/intVtigerField','/api/integrations/servicenow/accounts','./api/intServicenowAccount','./api/intServicenowConfiguration','/api/integrations/servicenow/fields','./api/intServicenowField','/api/integrations/dynamics365/configurations','/api/integrations/dynamics365/fields','./api/intDynamics365Field','./api/network','/api/chat/reports/queue','./api/chatQueueReport','/api/chat/internal/messages','/api/jscripty/answers/reports','/api/jscripty/sessions/reports','./api/jscriptySessionReport','/api/sms/reports/queue','./api/smsQueueReport','./api/squareReport','/api/square/details/reports','./api/squareReportDetail','/api/jscripty/projects','./api/jscriptyProject','/api/settings','/api/square/odbc','./api/squareOdbc','/api/square/projects','./api/squareRecording','/api/square/messages','/api/teams','./api/team','/api/license','./api/license','/api/campaigns','./api/campaign','/api/attachments','/api/plugins','./api/plugin','/api/mail/reports/transfer','./api/mailTransferReport','./api/chatTransferReport','./api/faxTransferReport','./api/openchannelTransferReport','/api/sms/reports/transfer','./api/smsTransferReport','/api/cm/lists','./api/cmList','/api/voice/prefixes','./api/voicePrefix','./api/userProfile','/api/userProfile/sections','./api/userProfileResource','/api/auth/local','./api/authLocal','/api/auth/google','/api/jira','./api/jira','/api/rpc','./api/rpc','/api/version','/api/system','/api/pm2','./api/pm2','static','join','root','/apidoc','/www','/demo','/snippet','1.0.15','/plugins','/server/files/plugins','route','/:url(api|auth|components|app|bower_components|assets)/*','get','sendFile','appPath','/index.html','path','express','express-winston','util','./errors','./config/logger','api','auth','default','logger','format','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','method','headers','x-forwarded-for','connection','remoteAddress','url','statusCode','responseTime','user','name','role','use','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','body','device','agent_id','other','agent_name','/api/users','/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/voice/mails','./api/voiceMail','/api/voice/mails/messages','./api/voiceMailMessage','/api/voice/calls/reports','./api/voiceDialReport','/api/voice/agents/reports','./api/voiceAgentReport','/api/voice/queues/reports','./api/voiceQueueReport','/api/members/reports','./api/memberReport','/api/trunks','/api/voice/transfers/reports','./api/voiceTransferReport','/api/mail/out_servers','./api/mailServerOut','/api/mail/queues','./api/mailQueue','./api/mailSubstatus','/api/mail/interactions','./api/mailInteraction','/api/mail/messages','./api/mailMessage','/api/mail/applications','./api/mailApplication','/api/mail/reports/queue','./api/mailQueueReport','/api/dashboards','./api/dashboard','./api/dashboardItem','/api/fax/accounts','/api/fax/applications','./api/faxApplication','/api/fax/interactions','./api/faxInteraction','/api/fax/queues','./api/faxQueue','/api/fax/reports/queue','./api/faxQueueReport','./api/smsAccount','/api/sms/applications','./api/smsApplication','/api/sms/interactions','./api/smsInteraction','/api/sms/messages','./api/smsMessage','/api/sms/queues','/api/openchannel/accounts','./api/openchannelAccount','/api/openchannel/applications','./api/openchannelApplication','/api/openchannel/messages','./api/openchannelMessage','/api/openchannel/queues','./api/chatWebsite','/api/openchannel/reports/queue','./api/openchannelQueueReport','./api/chatApplication','/api/chat/interactions','./api/chatInteraction','/api/chat/messages','./api/chatMessage','/api/chat/offline_messages','/api/chat/queues','./api/chatQueue','./api/chatGroup','/api/chat/proactive_actions','./api/chatProactiveAction','./api/cmCompany','/api/cm/hopper','./api/cmHopper','/api/cm/hopper_black','./api/cmHopperBlack','/api/cm/hopper_final','./api/cmHopperFinal','/api/cm/hopper_history','./api/cmHopperHistory','/api/cm/custom_fields','./api/cmCustomField','/api/actions','./api/automation','/api/canned_answers','./api/cannedAnswer','./api/disposition','./api/condition','./api/interval','./api/pause','/api/cdr','./api/cdr','/api/voiceQueuesLog'];(function(_0x8585fc,_0x3e5308){var _0x5b2d48=function(_0xbb1c87){while(--_0xbb1c87){_0x8585fc['push'](_0x8585fc['shift']());}};_0x5b2d48(++_0x3e5308);}(_0x6901,0x18b));var _0x1690=function(_0x25bea4,_0x51fa46){_0x25bea4=_0x25bea4-0x0;var _0x372bba=_0x6901[_0x25bea4];return _0x372bba;};'use strict';var path=require(_0x1690('0x0'));var express=require(_0x1690('0x1'));var ewinston=require(_0x1690('0x2'));var util=require(_0x1690('0x3'));var errors=require(_0x1690('0x4'));var config=require('./config/environment');var logger=require(_0x1690('0x5'))(_0x1690('0x6'));var authLogger=require(_0x1690('0x5'))(_0x1690('0x7'));exports[_0x1690('0x8')]=function(_0x597f40){_0x597f40['use'](ewinston[_0x1690('0x9')]({'winstonInstance':logger,'meta':![],'statusLevels':!![],'msg':function(_0x3f22ff,_0x2306f0){return util[_0x1690('0xa')](_0x1690('0xb'),_0x3f22ff[_0x1690('0xc')],_0x3f22ff[_0x1690('0xd')][_0x1690('0xe')]?_0x3f22ff['headers'][_0x1690('0xe')]:_0x3f22ff[_0x1690('0xf')][_0x1690('0x10')]||_0x3f22ff['ip'],_0x3f22ff[_0x1690('0x11')],_0x2306f0[_0x1690('0x12')],_0x2306f0[_0x1690('0x13')],_0x3f22ff['user']?_0x3f22ff[_0x1690('0x14')]['id']:null,_0x3f22ff[_0x1690('0x14')]?_0x3f22ff[_0x1690('0x14')][_0x1690('0x15')]:null,_0x3f22ff[_0x1690('0x14')]?_0x3f22ff[_0x1690('0x14')][_0x1690('0x16')]:null);}}));_0x597f40[_0x1690('0x17')](ewinston['logger']({'winstonInstance':authLogger,'meta':![],'statusLevels':!![],'msg':function(_0x11096c,_0x4861c6){var _0x1811c9=_0x1690('0x18');if(_0x11096c[_0x1690('0x19')]&&_0x11096c['body'][_0x1690('0x1a')]&&_0x11096c[_0x1690('0x19')][_0x1690('0x1b')]){_0x1811c9='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)';}return util['format'](_0x1811c9,_0x11096c[_0x1690('0xc')],_0x11096c[_0x1690('0xd')][_0x1690('0xe')]?_0x11096c[_0x1690('0xd')][_0x1690('0xe')]:_0x11096c[_0x1690('0xf')]['remoteAddress']||_0x11096c['ip'],_0x11096c[_0x1690('0x11')],_0x4861c6[_0x1690('0x12')],_0x4861c6[_0x1690('0x13')],_0x11096c[_0x1690('0x14')]?_0x11096c['user']['id']:null,_0x11096c[_0x1690('0x14')]?_0x11096c[_0x1690('0x14')]['name']:null,_0x11096c[_0x1690('0x14')]?_0x11096c[_0x1690('0x14')][_0x1690('0x16')]:null,_0x11096c[_0x1690('0x19')]&&_0x11096c[_0x1690('0x19')][_0x1690('0x1a')]?_0x11096c[_0x1690('0x19')][_0x1690('0x1a')]:_0x1690('0x1c'),_0x11096c[_0x1690('0x19')]&&_0x11096c['body'][_0x1690('0x1b')]?_0x11096c[_0x1690('0x19')]['agent_id']:'',_0x11096c[_0x1690('0x19')]&&_0x11096c['body'][_0x1690('0x1d')]?_0x11096c[_0x1690('0x19')]['agent_name']:'');},'ignoreRoute':function(_0x3f9f8d){var _0x2db54b=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x2db54b['test'](_0x3f9f8d['url']);}}));_0x597f40[_0x1690('0x17')](_0x1690('0x1e'),require('./api/user'));_0x597f40[_0x1690('0x17')](_0x1690('0x1f'),require('./api/voiceChanSpy'));_0x597f40[_0x1690('0x17')](_0x1690('0x20'),require(_0x1690('0x21')));_0x597f40['use'](_0x1690('0x22'),require(_0x1690('0x23')));_0x597f40[_0x1690('0x17')](_0x1690('0x24'),require(_0x1690('0x25')));_0x597f40[_0x1690('0x17')](_0x1690('0x26'),require('./api/voiceQueue'));_0x597f40[_0x1690('0x17')](_0x1690('0x27'),require(_0x1690('0x28')));_0x597f40[_0x1690('0x17')](_0x1690('0x29'),require('./api/screenRecording'));_0x597f40[_0x1690('0x17')](_0x1690('0x2a'),require(_0x1690('0x2b')));_0x597f40[_0x1690('0x17')](_0x1690('0x2c'),require(_0x1690('0x2d')));_0x597f40[_0x1690('0x17')](_0x1690('0x2e'),require('./api/voiceCallReport'));_0x597f40[_0x1690('0x17')]('/api/voice/dials/reports',require(_0x1690('0x2f')));_0x597f40[_0x1690('0x17')](_0x1690('0x30'),require(_0x1690('0x31')));_0x597f40[_0x1690('0x17')](_0x1690('0x32'),require(_0x1690('0x33')));_0x597f40[_0x1690('0x17')](_0x1690('0x34'),require(_0x1690('0x35')));_0x597f40[_0x1690('0x17')](_0x1690('0x36'),require('./api/trunk'));_0x597f40[_0x1690('0x17')](_0x1690('0x37'),require(_0x1690('0x38')));_0x597f40['use'](_0x1690('0x39'),require(_0x1690('0x3a')));_0x597f40[_0x1690('0x17')]('/api/mail/accounts',require('./api/mailAccount'));_0x597f40[_0x1690('0x17')](_0x1690('0x3b'),require(_0x1690('0x3c')));_0x597f40['use']('/api/mail/substatuses',require(_0x1690('0x3d')));_0x597f40[_0x1690('0x17')](_0x1690('0x3e'),require(_0x1690('0x3f')));_0x597f40[_0x1690('0x17')](_0x1690('0x40'),require(_0x1690('0x41')));_0x597f40[_0x1690('0x17')](_0x1690('0x42'),require(_0x1690('0x43')));_0x597f40['use'](_0x1690('0x44'),require(_0x1690('0x45')));_0x597f40[_0x1690('0x17')](_0x1690('0x46'),require(_0x1690('0x47')));_0x597f40['use']('/api/dashboards/items',require(_0x1690('0x48')));_0x597f40[_0x1690('0x17')](_0x1690('0x49'),require('./api/faxAccount'));_0x597f40[_0x1690('0x17')](_0x1690('0x4a'),require(_0x1690('0x4b')));_0x597f40[_0x1690('0x17')](_0x1690('0x4c'),require(_0x1690('0x4d')));_0x597f40[_0x1690('0x17')]('/api/fax/messages',require('./api/faxMessage'));_0x597f40[_0x1690('0x17')](_0x1690('0x4e'),require(_0x1690('0x4f')));_0x597f40[_0x1690('0x17')](_0x1690('0x50'),require(_0x1690('0x51')));_0x597f40[_0x1690('0x17')]('/api/sms/accounts',require(_0x1690('0x52')));_0x597f40['use'](_0x1690('0x53'),require(_0x1690('0x54')));_0x597f40[_0x1690('0x17')](_0x1690('0x55'),require(_0x1690('0x56')));_0x597f40['use'](_0x1690('0x57'),require(_0x1690('0x58')));_0x597f40[_0x1690('0x17')](_0x1690('0x59'),require('./api/smsQueue'));_0x597f40[_0x1690('0x17')](_0x1690('0x5a'),require(_0x1690('0x5b')));_0x597f40[_0x1690('0x17')](_0x1690('0x5c'),require(_0x1690('0x5d')));_0x597f40[_0x1690('0x17')]('/api/openchannel/interactions',require('./api/openchannelInteraction'));_0x597f40[_0x1690('0x17')](_0x1690('0x5e'),require(_0x1690('0x5f')));_0x597f40[_0x1690('0x17')](_0x1690('0x60'),require('./api/openchannelQueue'));_0x597f40[_0x1690('0x17')]('/api/chat/websites',require(_0x1690('0x61')));_0x597f40['use'](_0x1690('0x62'),require(_0x1690('0x63')));_0x597f40[_0x1690('0x17')]('/api/chat/applications',require(_0x1690('0x64')));_0x597f40['use'](_0x1690('0x65'),require(_0x1690('0x66')));_0x597f40[_0x1690('0x17')](_0x1690('0x67'),require(_0x1690('0x68')));_0x597f40[_0x1690('0x17')](_0x1690('0x69'),require('./api/chatOfflineMessage'));_0x597f40['use'](_0x1690('0x6a'),require(_0x1690('0x6b')));_0x597f40[_0x1690('0x17')]('/api/chat/groups',require(_0x1690('0x6c')));_0x597f40[_0x1690('0x17')](_0x1690('0x6d'),require(_0x1690('0x6e')));_0x597f40[_0x1690('0x17')]('/api/cm/companies',require(_0x1690('0x6f')));_0x597f40[_0x1690('0x17')]('/api/cm/contacts',require('./api/cmContact'));_0x597f40[_0x1690('0x17')](_0x1690('0x70'),require(_0x1690('0x71')));_0x597f40[_0x1690('0x17')](_0x1690('0x72'),require(_0x1690('0x73')));_0x597f40[_0x1690('0x17')](_0x1690('0x74'),require(_0x1690('0x75')));_0x597f40[_0x1690('0x17')](_0x1690('0x76'),require(_0x1690('0x77')));_0x597f40[_0x1690('0x17')](_0x1690('0x78'),require(_0x1690('0x79')));_0x597f40[_0x1690('0x17')](_0x1690('0x7a'),require('./api/action'));_0x597f40[_0x1690('0x17')]('/api/automations',require(_0x1690('0x7b')));_0x597f40[_0x1690('0x17')](_0x1690('0x7c'),require(_0x1690('0x7d')));_0x597f40['use']('/api/dispositions',require(_0x1690('0x7e')));_0x597f40[_0x1690('0x17')]('/api/conditions',require(_0x1690('0x7f')));_0x597f40['use']('/api/intervals',require(_0x1690('0x80')));_0x597f40[_0x1690('0x17')]('/api/pauses',require(_0x1690('0x81')));_0x597f40[_0x1690('0x17')](_0x1690('0x82'),require(_0x1690('0x83')));_0x597f40[_0x1690('0x17')](_0x1690('0x84'),require(_0x1690('0x85')));_0x597f40[_0x1690('0x17')](_0x1690('0x86'),require(_0x1690('0x87')));_0x597f40[_0x1690('0x17')](_0x1690('0x88'),require(_0x1690('0x89')));_0x597f40[_0x1690('0x17')](_0x1690('0x8a'),require(_0x1690('0x8b')));_0x597f40[_0x1690('0x17')]('/api/templates',require(_0x1690('0x8c')));_0x597f40[_0x1690('0x17')](_0x1690('0x8d'),require('./api/trigger'));_0x597f40[_0x1690('0x17')](_0x1690('0x8e'),require(_0x1690('0x8f')));_0x597f40[_0x1690('0x17')](_0x1690('0x90'),require('./api/integration'));_0x597f40[_0x1690('0x17')](_0x1690('0x91'),require(_0x1690('0x92')));_0x597f40['use'](_0x1690('0x93'),require(_0x1690('0x94')));_0x597f40[_0x1690('0x17')]('/api/analytics/default_reports',require(_0x1690('0x95')));_0x597f40['use'](_0x1690('0x96'),require(_0x1690('0x97')));_0x597f40[_0x1690('0x17')](_0x1690('0x98'),require(_0x1690('0x99')));_0x597f40[_0x1690('0x17')](_0x1690('0x9a'),require(_0x1690('0x9b')));_0x597f40[_0x1690('0x17')]('/api/analytics/tree_reports',require('./api/analyticTreeReport'));_0x597f40[_0x1690('0x17')]('/api/integrations/salesforce/accounts',require(_0x1690('0x9c')));_0x597f40['use'](_0x1690('0x9d'),require(_0x1690('0x9e')));_0x597f40[_0x1690('0x17')]('/api/integrations/salesforce/fields',require(_0x1690('0x9f')));_0x597f40['use'](_0x1690('0xa0'),require(_0x1690('0xa1')));_0x597f40[_0x1690('0x17')](_0x1690('0xa2'),require(_0x1690('0xa3')));_0x597f40['use']('/api/integrations/sugarcrm/fields',require('./api/intSugarcrmField'));_0x597f40[_0x1690('0x17')](_0x1690('0xa4'),require('./api/intDeskAccount'));_0x597f40[_0x1690('0x17')](_0x1690('0xa5'),require(_0x1690('0xa6')));_0x597f40['use']('/api/integrations/desk/fields',require('./api/intDeskField'));_0x597f40[_0x1690('0x17')](_0x1690('0xa7'),require(_0x1690('0xa8')));_0x597f40[_0x1690('0x17')](_0x1690('0xa9'),require(_0x1690('0xaa')));_0x597f40[_0x1690('0x17')](_0x1690('0xab'),require(_0x1690('0xac')));_0x597f40[_0x1690('0x17')](_0x1690('0xad'),require(_0x1690('0xae')));_0x597f40[_0x1690('0x17')](_0x1690('0xaf'),require('./api/intZendeskConfiguration'));_0x597f40[_0x1690('0x17')]('/api/integrations/zendesk/fields',require('./api/intZendeskField'));_0x597f40[_0x1690('0x17')]('/api/integrations/freshdesk/accounts',require(_0x1690('0xb0')));_0x597f40[_0x1690('0x17')](_0x1690('0xb1'),require(_0x1690('0xb2')));_0x597f40['use'](_0x1690('0xb3'),require(_0x1690('0xb4')));_0x597f40['use'](_0x1690('0xb5'),require(_0x1690('0xb6')));_0x597f40[_0x1690('0x17')]('/api/integrations/vtiger/configurations',require(_0x1690('0xb7')));_0x597f40['use'](_0x1690('0xb8'),require(_0x1690('0xb9')));_0x597f40['use'](_0x1690('0xba'),require(_0x1690('0xbb')));_0x597f40[_0x1690('0x17')]('/api/integrations/servicenow/configurations',require(_0x1690('0xbc')));_0x597f40[_0x1690('0x17')](_0x1690('0xbd'),require(_0x1690('0xbe')));_0x597f40[_0x1690('0x17')]('/api/integrations/dynamics365/accounts',require('./api/intDynamics365Account'));_0x597f40['use'](_0x1690('0xbf'),require('./api/intDynamics365Configuration'));_0x597f40['use'](_0x1690('0xc0'),require(_0x1690('0xc1')));_0x597f40[_0x1690('0x17')]('/api/networks',require(_0x1690('0xc2')));_0x597f40['use'](_0x1690('0xc3'),require(_0x1690('0xc4')));_0x597f40[_0x1690('0x17')](_0x1690('0xc5'),require('./api/chatInternalMessage'));_0x597f40[_0x1690('0x17')](_0x1690('0xc6'),require('./api/jscriptyAnswerReport'));_0x597f40[_0x1690('0x17')]('/api/jscripty/questions/reports',require('./api/jscriptyQuestionReport'));_0x597f40['use'](_0x1690('0xc7'),require(_0x1690('0xc8')));_0x597f40[_0x1690('0x17')](_0x1690('0xc9'),require(_0x1690('0xca')));_0x597f40[_0x1690('0x17')]('/api/square/reports',require(_0x1690('0xcb')));_0x597f40[_0x1690('0x17')](_0x1690('0xcc'),require(_0x1690('0xcd')));_0x597f40['use'](_0x1690('0xce'),require(_0x1690('0xcf')));_0x597f40[_0x1690('0x17')](_0x1690('0xd0'),require('./api/setting'));_0x597f40['use'](_0x1690('0xd1'),require(_0x1690('0xd2')));_0x597f40[_0x1690('0x17')](_0x1690('0xd3'),require('./api/squareProject'));_0x597f40[_0x1690('0x17')]('/api/square/recordings',require(_0x1690('0xd4')));_0x597f40[_0x1690('0x17')](_0x1690('0xd5'),require('./api/squareMessage'));_0x597f40[_0x1690('0x17')](_0x1690('0xd6'),require(_0x1690('0xd7')));_0x597f40[_0x1690('0x17')](_0x1690('0xd8'),require(_0x1690('0xd9')));_0x597f40[_0x1690('0x17')](_0x1690('0xda'),require(_0x1690('0xdb')));_0x597f40[_0x1690('0x17')]('/api/migrations',require('./api/migration'));_0x597f40[_0x1690('0x17')](_0x1690('0xdc'),require('./api/attachment'));_0x597f40[_0x1690('0x17')](_0x1690('0xdd'),require(_0x1690('0xde')));_0x597f40[_0x1690('0x17')](_0x1690('0xdf'),require(_0x1690('0xe0')));_0x597f40[_0x1690('0x17')]('/api/chat/reports/transfer',require(_0x1690('0xe1')));_0x597f40[_0x1690('0x17')]('/api/fax/reports/transfer',require(_0x1690('0xe2')));_0x597f40['use']('/api/openchannel/reports/transfer',require(_0x1690('0xe3')));_0x597f40[_0x1690('0x17')](_0x1690('0xe4'),require(_0x1690('0xe5')));_0x597f40[_0x1690('0x17')](_0x1690('0xe6'),require(_0x1690('0xe7')));_0x597f40[_0x1690('0x17')](_0x1690('0xe8'),require(_0x1690('0xe9')));_0x597f40[_0x1690('0x17')]('/api/userProfiles',require(_0x1690('0xea')));_0x597f40[_0x1690('0x17')](_0x1690('0xeb'),require('./api/userProfileSection'));_0x597f40[_0x1690('0x17')]('/api/userProfile/resources',require(_0x1690('0xec')));_0x597f40[_0x1690('0x17')](_0x1690('0xed'),require(_0x1690('0xee')));_0x597f40[_0x1690('0x17')](_0x1690('0xef'),require('./api/authGoogle'));_0x597f40[_0x1690('0x17')](_0x1690('0xf0'),require(_0x1690('0xf1')));_0x597f40[_0x1690('0x17')](_0x1690('0xf2'),require(_0x1690('0xf3')));_0x597f40['use'](_0x1690('0xf4'),require('./api/version'));_0x597f40['use'](_0x1690('0xf5'),require('./api/system'));_0x597f40[_0x1690('0x17')](_0x1690('0xf6'),require(_0x1690('0xf7')));_0x597f40[_0x1690('0x17')]('/apidoc',express[_0x1690('0xf8')](path[_0x1690('0xf9')](config[_0x1690('0xfa')],_0x1690('0xfb'))));_0x597f40[_0x1690('0x17')](_0x1690('0xfc'),express['static'](path['join'](config[_0x1690('0xfa')],_0x1690('0xfc'))));_0x597f40[_0x1690('0x17')](_0x1690('0xfd'),express[_0x1690('0xf8')](path['join'](config[_0x1690('0xfa')],_0x1690('0xfd'))));_0x597f40[_0x1690('0x17')](_0x1690('0xfe'),express[_0x1690('0xf8')](path[_0x1690('0xf9')](config[_0x1690('0xfa')],'snippet',_0x1690('0xff'))));_0x597f40[_0x1690('0x17')](_0x1690('0x100'),express['static'](path[_0x1690('0xf9')](config[_0x1690('0xfa')],_0x1690('0x101'))));_0x597f40[_0x1690('0x102')](_0x1690('0x103'))[_0x1690('0x104')](errors[0x194]);_0x597f40[_0x1690('0x102')]('/*')['get'](function(_0x488a9b,_0xce574f){_0xce574f[_0x1690('0x105')](path['resolve'](_0x597f40[_0x1690('0x104')](_0x1690('0x106'))+_0x1690('0x107')));});}; \ No newline at end of file +var _0x5a39=['./api/trigger','/api/variables','./api/variable','/api/integrations','/api/integrations/reports','./api/integrationReport','/api/analytics/custom_reports','./api/analyticCustomReport','/api/analytics/default_reports','./api/analyticDefaultReport','/api/analytics/extracted_reports','./api/analyticExtractedReport','./api/analyticMetric','/api/analytics/tree_reports','./api/analyticTreeReport','/api/integrations/salesforce/accounts','/api/integrations/salesforce/configurations','/api/integrations/salesforce/fields','./api/intSalesforceField','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','./api/intDeskAccount','/api/integrations/desk/configurations','./api/intDeskConfiguration','./api/intDeskField','/api/integrations/zoho/accounts','./api/intZohoAccount','/api/integrations/zoho/configurations','./api/intZohoConfiguration','/api/integrations/zendesk/accounts','./api/intZendeskAccount','/api/integrations/zendesk/configurations','./api/intZendeskConfiguration','/api/integrations/zendesk/fields','./api/intZendeskField','/api/integrations/freshdesk/accounts','/api/integrations/freshdesk/configurations','/api/integrations/freshdesk/fields','/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/intServicenowConfiguration','/api/integrations/servicenow/fields','./api/intServicenowField','./api/intDynamics365Account','/api/integrations/dynamics365/configurations','./api/intDynamics365Configuration','/api/integrations/dynamics365/fields','./api/intDynamics365Field','/api/networks','/api/chat/reports/queue','./api/chatInternalMessage','/api/jscripty/answers/reports','/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/setting','/api/square/odbc','./api/squareOdbc','/api/square/projects','./api/squareProject','/api/square/recordings','./api/squareRecording','/api/square/messages','./api/squareMessage','/api/teams','./api/team','/api/license','./api/campaign','./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/sms/reports/transfer','/api/cm/lists','./api/cmList','./api/voicePrefix','/api/userProfiles','/api/userProfile/sections','./api/userProfileSection','/api/userProfile/resources','./api/userProfileResource','/api/auth/local','./api/authLocal','/api/auth/google','./api/authGoogle','/api/jira','./api/jira','/api/rpc','/api/version','/api/system','./api/system','/api/pm2','./api/pm2','/apidoc','join','root','/www','static','/demo','/snippet','snippet','1.0.15','/plugins','route','get','resolve','/index.html','express','util','./errors','./config/environment','api','./config/logger','auth','logger','format','method','headers','x-forwarded-for','connection','statusCode','responseTime','user','name','use','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','body','device','agent_id','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','remoteAddress','url','role','other','agent_name','test','./api/user','./api/voiceChanSpy','/api/voice/contexts','./api/voiceContext','/api/voice/extensions','./api/voiceExtension','/api/voice/queues','./api/voiceQueue','/api/voice/recordings','./api/voiceRecording','/api/screen/recordings','./api/screenRecording','/api/voice/mails','./api/voiceMail','/api/voice/mails/messages','./api/voiceMailMessage','/api/voice/calls/reports','./api/voiceCallReport','./api/voiceDialReport','/api/voice/agents/reports','./api/voiceAgentReport','./api/voiceQueueReport','./api/trunk','/api/voice/transfers/reports','./api/voiceTransferReport','/api/mail/out_servers','./api/mailServerOut','/api/mail/substatuses','./api/mailSubstatus','/api/mail/interactions','/api/mail/messages','/api/mail/applications','./api/mailApplication','./api/mailQueueReport','/api/dashboards','./api/dashboard','./api/dashboardItem','./api/faxAccount','/api/fax/applications','./api/faxApplication','./api/faxMessage','/api/fax/queues','./api/faxQueue','/api/fax/reports/queue','./api/faxQueueReport','/api/sms/accounts','./api/smsAccount','/api/sms/applications','./api/smsApplication','/api/sms/interactions','./api/smsInteraction','/api/sms/messages','./api/smsMessage','/api/sms/queues','./api/smsQueue','/api/openchannel/accounts','./api/openchannelAccount','/api/openchannel/applications','./api/openchannelApplication','/api/openchannel/interactions','./api/openchannelInteraction','/api/openchannel/messages','/api/openchannel/queues','./api/openchannelQueue','/api/chat/websites','./api/chatWebsite','./api/openchannelQueueReport','/api/chat/interactions','./api/chatInteraction','/api/chat/messages','./api/chatOfflineMessage','/api/chat/queues','/api/chat/groups','/api/chat/proactive_actions','./api/chatProactiveAction','/api/cm/companies','./api/cmCompany','/api/cm/contacts','./api/cmContact','/api/cm/hopper','./api/cmHopper','/api/cm/hopper_black','./api/cmHopperBlack','./api/cmHopperFinal','/api/cm/hopper_history','./api/cmHopperHistory','/api/cm/custom_fields','/api/actions','./api/action','/api/automations','./api/automation','/api/canned_answers','./api/cannedAnswer','/api/dispositions','./api/disposition','/api/conditions','./api/condition','/api/intervals','/api/pauses','./api/pause','/api/cdr','./api/cdr','/api/voiceQueuesLog','./api/voiceQueuesLog','/api/schedules','./api/schedule','/api/tags','./api/tag','./api/template'];(function(_0x2f7cc0,_0xa7ddc9){var _0x42ac73=function(_0x4d41d7){while(--_0x4d41d7){_0x2f7cc0['push'](_0x2f7cc0['shift']());}};_0x42ac73(++_0xa7ddc9);}(_0x5a39,0x18e));var _0x95a3=function(_0x2fb579,_0x40be1d){_0x2fb579=_0x2fb579-0x0;var _0x28ff57=_0x5a39[_0x2fb579];return _0x28ff57;};'use strict';var path=require('path');var express=require(_0x95a3('0x0'));var ewinston=require('express-winston');var util=require(_0x95a3('0x1'));var errors=require(_0x95a3('0x2'));var config=require(_0x95a3('0x3'));var logger=require('./config/logger')(_0x95a3('0x4'));var authLogger=require(_0x95a3('0x5'))(_0x95a3('0x6'));exports['default']=function(_0x4ed535){_0x4ed535['use'](ewinston[_0x95a3('0x7')]({'winstonInstance':logger,'meta':![],'statusLevels':!![],'msg':function(_0x3d1d2b,_0x23204c){return util[_0x95a3('0x8')]('%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s',_0x3d1d2b[_0x95a3('0x9')],_0x3d1d2b[_0x95a3('0xa')][_0x95a3('0xb')]?_0x3d1d2b[_0x95a3('0xa')][_0x95a3('0xb')]:_0x3d1d2b[_0x95a3('0xc')]['remoteAddress']||_0x3d1d2b['ip'],_0x3d1d2b['url'],_0x23204c[_0x95a3('0xd')],_0x23204c[_0x95a3('0xe')],_0x3d1d2b[_0x95a3('0xf')]?_0x3d1d2b[_0x95a3('0xf')]['id']:null,_0x3d1d2b[_0x95a3('0xf')]?_0x3d1d2b['user'][_0x95a3('0x10')]:null,_0x3d1d2b[_0x95a3('0xf')]?_0x3d1d2b[_0x95a3('0xf')]['role']:null);}}));_0x4ed535[_0x95a3('0x11')](ewinston[_0x95a3('0x7')]({'winstonInstance':authLogger,'meta':![],'statusLevels':!![],'msg':function(_0xf970ca,_0x4d1399){var _0x5b8a56=_0x95a3('0x12');if(_0xf970ca[_0x95a3('0x13')]&&_0xf970ca['body'][_0x95a3('0x14')]&&_0xf970ca['body'][_0x95a3('0x15')]){_0x5b8a56=_0x95a3('0x16');}return util[_0x95a3('0x8')](_0x5b8a56,_0xf970ca[_0x95a3('0x9')],_0xf970ca[_0x95a3('0xa')][_0x95a3('0xb')]?_0xf970ca[_0x95a3('0xa')][_0x95a3('0xb')]:_0xf970ca['connection'][_0x95a3('0x17')]||_0xf970ca['ip'],_0xf970ca[_0x95a3('0x18')],_0x4d1399['statusCode'],_0x4d1399[_0x95a3('0xe')],_0xf970ca['user']?_0xf970ca[_0x95a3('0xf')]['id']:null,_0xf970ca[_0x95a3('0xf')]?_0xf970ca[_0x95a3('0xf')][_0x95a3('0x10')]:null,_0xf970ca[_0x95a3('0xf')]?_0xf970ca[_0x95a3('0xf')][_0x95a3('0x19')]:null,_0xf970ca[_0x95a3('0x13')]&&_0xf970ca[_0x95a3('0x13')][_0x95a3('0x14')]?_0xf970ca[_0x95a3('0x13')][_0x95a3('0x14')]:_0x95a3('0x1a'),_0xf970ca[_0x95a3('0x13')]&&_0xf970ca[_0x95a3('0x13')][_0x95a3('0x15')]?_0xf970ca[_0x95a3('0x13')][_0x95a3('0x15')]:'',_0xf970ca[_0x95a3('0x13')]&&_0xf970ca[_0x95a3('0x13')]['agent_name']?_0xf970ca[_0x95a3('0x13')][_0x95a3('0x1b')]:'');},'ignoreRoute':function(_0x4195f9){var _0x225d6d=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x225d6d[_0x95a3('0x1c')](_0x4195f9[_0x95a3('0x18')]);}}));_0x4ed535[_0x95a3('0x11')]('/api/users',require(_0x95a3('0x1d')));_0x4ed535[_0x95a3('0x11')]('/api/voice/chanspy',require(_0x95a3('0x1e')));_0x4ed535['use'](_0x95a3('0x1f'),require(_0x95a3('0x20')));_0x4ed535[_0x95a3('0x11')](_0x95a3('0x21'),require(_0x95a3('0x22')));_0x4ed535[_0x95a3('0x11')]('/api/voice/mohs',require('./api/voiceMusicOnHold'));_0x4ed535[_0x95a3('0x11')](_0x95a3('0x23'),require(_0x95a3('0x24')));_0x4ed535[_0x95a3('0x11')](_0x95a3('0x25'),require(_0x95a3('0x26')));_0x4ed535['use'](_0x95a3('0x27'),require(_0x95a3('0x28')));_0x4ed535[_0x95a3('0x11')](_0x95a3('0x29'),require(_0x95a3('0x2a')));_0x4ed535[_0x95a3('0x11')](_0x95a3('0x2b'),require(_0x95a3('0x2c')));_0x4ed535[_0x95a3('0x11')](_0x95a3('0x2d'),require(_0x95a3('0x2e')));_0x4ed535['use']('/api/voice/dials/reports',require(_0x95a3('0x2f')));_0x4ed535[_0x95a3('0x11')](_0x95a3('0x30'),require(_0x95a3('0x31')));_0x4ed535[_0x95a3('0x11')]('/api/voice/queues/reports',require(_0x95a3('0x32')));_0x4ed535[_0x95a3('0x11')]('/api/members/reports',require('./api/memberReport'));_0x4ed535[_0x95a3('0x11')]('/api/trunks',require(_0x95a3('0x33')));_0x4ed535[_0x95a3('0x11')](_0x95a3('0x34'),require(_0x95a3('0x35')));_0x4ed535[_0x95a3('0x11')](_0x95a3('0x36'),require(_0x95a3('0x37')));_0x4ed535['use']('/api/mail/accounts',require('./api/mailAccount'));_0x4ed535['use']('/api/mail/queues',require('./api/mailQueue'));_0x4ed535[_0x95a3('0x11')](_0x95a3('0x38'),require(_0x95a3('0x39')));_0x4ed535[_0x95a3('0x11')](_0x95a3('0x3a'),require('./api/mailInteraction'));_0x4ed535[_0x95a3('0x11')](_0x95a3('0x3b'),require('./api/mailMessage'));_0x4ed535[_0x95a3('0x11')](_0x95a3('0x3c'),require(_0x95a3('0x3d')));_0x4ed535[_0x95a3('0x11')]('/api/mail/reports/queue',require(_0x95a3('0x3e')));_0x4ed535[_0x95a3('0x11')](_0x95a3('0x3f'),require(_0x95a3('0x40')));_0x4ed535[_0x95a3('0x11')]('/api/dashboards/items',require(_0x95a3('0x41')));_0x4ed535[_0x95a3('0x11')]('/api/fax/accounts',require(_0x95a3('0x42')));_0x4ed535[_0x95a3('0x11')](_0x95a3('0x43'),require(_0x95a3('0x44')));_0x4ed535['use']('/api/fax/interactions',require('./api/faxInteraction'));_0x4ed535[_0x95a3('0x11')]('/api/fax/messages',require(_0x95a3('0x45')));_0x4ed535['use'](_0x95a3('0x46'),require(_0x95a3('0x47')));_0x4ed535[_0x95a3('0x11')](_0x95a3('0x48'),require(_0x95a3('0x49')));_0x4ed535[_0x95a3('0x11')](_0x95a3('0x4a'),require(_0x95a3('0x4b')));_0x4ed535[_0x95a3('0x11')](_0x95a3('0x4c'),require(_0x95a3('0x4d')));_0x4ed535[_0x95a3('0x11')](_0x95a3('0x4e'),require(_0x95a3('0x4f')));_0x4ed535[_0x95a3('0x11')](_0x95a3('0x50'),require(_0x95a3('0x51')));_0x4ed535['use'](_0x95a3('0x52'),require(_0x95a3('0x53')));_0x4ed535[_0x95a3('0x11')](_0x95a3('0x54'),require(_0x95a3('0x55')));_0x4ed535[_0x95a3('0x11')](_0x95a3('0x56'),require(_0x95a3('0x57')));_0x4ed535[_0x95a3('0x11')](_0x95a3('0x58'),require(_0x95a3('0x59')));_0x4ed535['use'](_0x95a3('0x5a'),require('./api/openchannelMessage'));_0x4ed535['use'](_0x95a3('0x5b'),require(_0x95a3('0x5c')));_0x4ed535['use'](_0x95a3('0x5d'),require(_0x95a3('0x5e')));_0x4ed535[_0x95a3('0x11')]('/api/openchannel/reports/queue',require(_0x95a3('0x5f')));_0x4ed535[_0x95a3('0x11')]('/api/chat/applications',require('./api/chatApplication'));_0x4ed535[_0x95a3('0x11')](_0x95a3('0x60'),require(_0x95a3('0x61')));_0x4ed535['use'](_0x95a3('0x62'),require('./api/chatMessage'));_0x4ed535[_0x95a3('0x11')]('/api/chat/offline_messages',require(_0x95a3('0x63')));_0x4ed535[_0x95a3('0x11')](_0x95a3('0x64'),require('./api/chatQueue'));_0x4ed535[_0x95a3('0x11')](_0x95a3('0x65'),require('./api/chatGroup'));_0x4ed535[_0x95a3('0x11')](_0x95a3('0x66'),require(_0x95a3('0x67')));_0x4ed535['use'](_0x95a3('0x68'),require(_0x95a3('0x69')));_0x4ed535[_0x95a3('0x11')](_0x95a3('0x6a'),require(_0x95a3('0x6b')));_0x4ed535[_0x95a3('0x11')](_0x95a3('0x6c'),require(_0x95a3('0x6d')));_0x4ed535[_0x95a3('0x11')](_0x95a3('0x6e'),require(_0x95a3('0x6f')));_0x4ed535[_0x95a3('0x11')]('/api/cm/hopper_final',require(_0x95a3('0x70')));_0x4ed535[_0x95a3('0x11')](_0x95a3('0x71'),require(_0x95a3('0x72')));_0x4ed535['use'](_0x95a3('0x73'),require('./api/cmCustomField'));_0x4ed535[_0x95a3('0x11')](_0x95a3('0x74'),require(_0x95a3('0x75')));_0x4ed535[_0x95a3('0x11')](_0x95a3('0x76'),require(_0x95a3('0x77')));_0x4ed535['use'](_0x95a3('0x78'),require(_0x95a3('0x79')));_0x4ed535[_0x95a3('0x11')](_0x95a3('0x7a'),require(_0x95a3('0x7b')));_0x4ed535['use'](_0x95a3('0x7c'),require(_0x95a3('0x7d')));_0x4ed535[_0x95a3('0x11')](_0x95a3('0x7e'),require('./api/interval'));_0x4ed535['use'](_0x95a3('0x7f'),require(_0x95a3('0x80')));_0x4ed535[_0x95a3('0x11')](_0x95a3('0x81'),require(_0x95a3('0x82')));_0x4ed535[_0x95a3('0x11')](_0x95a3('0x83'),require(_0x95a3('0x84')));_0x4ed535[_0x95a3('0x11')](_0x95a3('0x85'),require(_0x95a3('0x86')));_0x4ed535[_0x95a3('0x11')]('/api/sounds',require('./api/sound'));_0x4ed535['use'](_0x95a3('0x87'),require(_0x95a3('0x88')));_0x4ed535['use']('/api/templates',require(_0x95a3('0x89')));_0x4ed535[_0x95a3('0x11')]('/api/triggers',require(_0x95a3('0x8a')));_0x4ed535[_0x95a3('0x11')](_0x95a3('0x8b'),require(_0x95a3('0x8c')));_0x4ed535[_0x95a3('0x11')](_0x95a3('0x8d'),require('./api/integration'));_0x4ed535[_0x95a3('0x11')](_0x95a3('0x8e'),require(_0x95a3('0x8f')));_0x4ed535[_0x95a3('0x11')](_0x95a3('0x90'),require(_0x95a3('0x91')));_0x4ed535['use'](_0x95a3('0x92'),require(_0x95a3('0x93')));_0x4ed535[_0x95a3('0x11')](_0x95a3('0x94'),require(_0x95a3('0x95')));_0x4ed535['use']('/api/analytics/metrics',require(_0x95a3('0x96')));_0x4ed535['use']('/api/analytics/field_reports',require('./api/analyticFieldReport'));_0x4ed535[_0x95a3('0x11')](_0x95a3('0x97'),require(_0x95a3('0x98')));_0x4ed535[_0x95a3('0x11')](_0x95a3('0x99'),require('./api/intSalesforceAccount'));_0x4ed535[_0x95a3('0x11')](_0x95a3('0x9a'),require('./api/intSalesforceConfiguration'));_0x4ed535[_0x95a3('0x11')](_0x95a3('0x9b'),require(_0x95a3('0x9c')));_0x4ed535[_0x95a3('0x11')]('/api/integrations/sugarcrm/accounts',require(_0x95a3('0x9d')));_0x4ed535[_0x95a3('0x11')](_0x95a3('0x9e'),require('./api/intSugarcrmConfiguration'));_0x4ed535[_0x95a3('0x11')]('/api/integrations/sugarcrm/fields',require('./api/intSugarcrmField'));_0x4ed535['use']('/api/integrations/desk/accounts',require(_0x95a3('0x9f')));_0x4ed535[_0x95a3('0x11')](_0x95a3('0xa0'),require(_0x95a3('0xa1')));_0x4ed535['use']('/api/integrations/desk/fields',require(_0x95a3('0xa2')));_0x4ed535[_0x95a3('0x11')](_0x95a3('0xa3'),require(_0x95a3('0xa4')));_0x4ed535[_0x95a3('0x11')](_0x95a3('0xa5'),require(_0x95a3('0xa6')));_0x4ed535[_0x95a3('0x11')]('/api/integrations/zoho/fields',require('./api/intZohoField'));_0x4ed535[_0x95a3('0x11')](_0x95a3('0xa7'),require(_0x95a3('0xa8')));_0x4ed535[_0x95a3('0x11')](_0x95a3('0xa9'),require(_0x95a3('0xaa')));_0x4ed535['use'](_0x95a3('0xab'),require(_0x95a3('0xac')));_0x4ed535[_0x95a3('0x11')](_0x95a3('0xad'),require('./api/intFreshdeskAccount'));_0x4ed535['use'](_0x95a3('0xae'),require('./api/intFreshdeskConfiguration'));_0x4ed535[_0x95a3('0x11')](_0x95a3('0xaf'),require('./api/intFreshdeskField'));_0x4ed535[_0x95a3('0x11')](_0x95a3('0xb0'),require(_0x95a3('0xb1')));_0x4ed535[_0x95a3('0x11')](_0x95a3('0xb2'),require(_0x95a3('0xb3')));_0x4ed535[_0x95a3('0x11')](_0x95a3('0xb4'),require(_0x95a3('0xb5')));_0x4ed535[_0x95a3('0x11')](_0x95a3('0xb6'),require(_0x95a3('0xb7')));_0x4ed535['use']('/api/integrations/servicenow/configurations',require(_0x95a3('0xb8')));_0x4ed535['use'](_0x95a3('0xb9'),require(_0x95a3('0xba')));_0x4ed535[_0x95a3('0x11')]('/api/integrations/dynamics365/accounts',require(_0x95a3('0xbb')));_0x4ed535[_0x95a3('0x11')](_0x95a3('0xbc'),require(_0x95a3('0xbd')));_0x4ed535['use'](_0x95a3('0xbe'),require(_0x95a3('0xbf')));_0x4ed535[_0x95a3('0x11')](_0x95a3('0xc0'),require('./api/network'));_0x4ed535['use'](_0x95a3('0xc1'),require('./api/chatQueueReport'));_0x4ed535[_0x95a3('0x11')]('/api/chat/internal/messages',require(_0x95a3('0xc2')));_0x4ed535[_0x95a3('0x11')](_0x95a3('0xc3'),require('./api/jscriptyAnswerReport'));_0x4ed535[_0x95a3('0x11')](_0x95a3('0xc4'),require(_0x95a3('0xc5')));_0x4ed535[_0x95a3('0x11')](_0x95a3('0xc6'),require(_0x95a3('0xc7')));_0x4ed535[_0x95a3('0x11')](_0x95a3('0xc8'),require('./api/smsQueueReport'));_0x4ed535[_0x95a3('0x11')](_0x95a3('0xc9'),require(_0x95a3('0xca')));_0x4ed535['use'](_0x95a3('0xcb'),require(_0x95a3('0xcc')));_0x4ed535[_0x95a3('0x11')](_0x95a3('0xcd'),require(_0x95a3('0xce')));_0x4ed535[_0x95a3('0x11')](_0x95a3('0xcf'),require(_0x95a3('0xd0')));_0x4ed535[_0x95a3('0x11')](_0x95a3('0xd1'),require(_0x95a3('0xd2')));_0x4ed535[_0x95a3('0x11')](_0x95a3('0xd3'),require(_0x95a3('0xd4')));_0x4ed535['use'](_0x95a3('0xd5'),require(_0x95a3('0xd6')));_0x4ed535[_0x95a3('0x11')](_0x95a3('0xd7'),require(_0x95a3('0xd8')));_0x4ed535['use'](_0x95a3('0xd9'),require(_0x95a3('0xda')));_0x4ed535[_0x95a3('0x11')](_0x95a3('0xdb'),require('./api/license'));_0x4ed535['use']('/api/campaigns',require(_0x95a3('0xdc')));_0x4ed535[_0x95a3('0x11')]('/api/migrations',require(_0x95a3('0xdd')));_0x4ed535[_0x95a3('0x11')](_0x95a3('0xde'),require(_0x95a3('0xdf')));_0x4ed535['use'](_0x95a3('0xe0'),require('./api/plugin'));_0x4ed535[_0x95a3('0x11')](_0x95a3('0xe1'),require(_0x95a3('0xe2')));_0x4ed535[_0x95a3('0x11')](_0x95a3('0xe3'),require(_0x95a3('0xe4')));_0x4ed535[_0x95a3('0x11')](_0x95a3('0xe5'),require(_0x95a3('0xe6')));_0x4ed535['use'](_0x95a3('0xe7'),require(_0x95a3('0xe8')));_0x4ed535[_0x95a3('0x11')](_0x95a3('0xe9'),require('./api/smsTransferReport'));_0x4ed535[_0x95a3('0x11')](_0x95a3('0xea'),require(_0x95a3('0xeb')));_0x4ed535[_0x95a3('0x11')]('/api/voice/prefixes',require(_0x95a3('0xec')));_0x4ed535[_0x95a3('0x11')](_0x95a3('0xed'),require('./api/userProfile'));_0x4ed535['use'](_0x95a3('0xee'),require(_0x95a3('0xef')));_0x4ed535[_0x95a3('0x11')](_0x95a3('0xf0'),require(_0x95a3('0xf1')));_0x4ed535[_0x95a3('0x11')](_0x95a3('0xf2'),require(_0x95a3('0xf3')));_0x4ed535[_0x95a3('0x11')](_0x95a3('0xf4'),require(_0x95a3('0xf5')));_0x4ed535[_0x95a3('0x11')](_0x95a3('0xf6'),require(_0x95a3('0xf7')));_0x4ed535[_0x95a3('0x11')](_0x95a3('0xf8'),require('./api/rpc'));_0x4ed535[_0x95a3('0x11')](_0x95a3('0xf9'),require('./api/version'));_0x4ed535[_0x95a3('0x11')](_0x95a3('0xfa'),require(_0x95a3('0xfb')));_0x4ed535['use'](_0x95a3('0xfc'),require(_0x95a3('0xfd')));_0x4ed535[_0x95a3('0x11')](_0x95a3('0xfe'),express['static'](path[_0x95a3('0xff')](config[_0x95a3('0x100')],_0x95a3('0xfe'))));_0x4ed535[_0x95a3('0x11')](_0x95a3('0x101'),express[_0x95a3('0x102')](path[_0x95a3('0xff')](config[_0x95a3('0x100')],'/www')));_0x4ed535[_0x95a3('0x11')](_0x95a3('0x103'),express[_0x95a3('0x102')](path[_0x95a3('0xff')](config[_0x95a3('0x100')],_0x95a3('0x103'))));_0x4ed535['use'](_0x95a3('0x104'),express[_0x95a3('0x102')](path[_0x95a3('0xff')](config['root'],_0x95a3('0x105'),_0x95a3('0x106'))));_0x4ed535[_0x95a3('0x11')](_0x95a3('0x107'),express['static'](path[_0x95a3('0xff')](config[_0x95a3('0x100')],'/server/files/plugins')));_0x4ed535[_0x95a3('0x108')]('/:url(api|auth|components|app|bower_components|assets)/*')['get'](errors[0x194]);_0x4ed535[_0x95a3('0x108')]('/*')[_0x95a3('0x109')](function(_0x149095,_0xcb08e3){_0xcb08e3['sendFile'](path[_0x95a3('0x10a')](_0x4ed535[_0x95a3('0x109')]('appPath')+_0x95a3('0x10b')));});}; \ No newline at end of file diff --git a/server/rpc/index.js b/server/rpc/index.js index 8deedcf..cd5c79c 100644 --- a/server/rpc/index.js +++ b/server/rpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2077=['../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/chatMessage/chatMessage.rpc','../api/chatQueue/chatQueue.rpc','../api/cmContact/cmContact.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/interval/interval.rpc','../api/pause/pause.rpc','../api/template/template.rpc','../api/trigger/trigger.rpc','../api/variable/variable.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareRecording/squareRecording.rpc','../api/squareMessage/squareMessage.rpc','../api/campaign/campaign.rpc','../api/attachment/attachment.rpc','../api/plugin/plugin.rpc','server','rpc','port','localhost','error','listen','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','default','bluebird','../config/environment','merge','../api/user/user.rpc','../api/voiceExtension/voiceExtension.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/memberReport/memberReport.rpc','../api/trunk/trunk.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailAccount/mailAccount.rpc','../api/mailMessage/mailMessage.rpc','../api/mailApplication/mailApplication.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxAccount/faxAccount.rpc','../api/faxApplication/faxApplication.rpc','../api/faxQueue/faxQueue.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsAccount/smsAccount.rpc'];(function(_0x242539,_0x129d10){var _0x17ff7a=function(_0x11206f){while(--_0x11206f){_0x242539['push'](_0x242539['shift']());}};_0x17ff7a(++_0x129d10);}(_0x2077,0xf1));var _0x7207=function(_0x2aeaf6,_0x3374d8){_0x2aeaf6=_0x2aeaf6-0x0;var _0x5b44d4=_0x2077[_0x2aeaf6];return _0x5b44d4;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0x7207('0x0'));var _=require('lodash');var config=require(_0x7207('0x1'));exports['listen']=function(){return new BPromise(function(_0x361e58,_0xb2093e){var _0x5529fe={};_0x5529fe=_[_0x7207('0x2')](_0x5529fe,require(_0x7207('0x3')));_0x5529fe=_['merge'](_0x5529fe,require(_0x7207('0x4')));_0x5529fe=_['merge'](_0x5529fe,require(_0x7207('0x5')));_0x5529fe=_['merge'](_0x5529fe,require('../api/voiceRecording/voiceRecording.rpc'));_0x5529fe=_['merge'](_0x5529fe,require(_0x7207('0x6')));_0x5529fe=_[_0x7207('0x2')](_0x5529fe,require(_0x7207('0x7')));_0x5529fe=_[_0x7207('0x2')](_0x5529fe,require(_0x7207('0x8')));_0x5529fe=_[_0x7207('0x2')](_0x5529fe,require(_0x7207('0x9')));_0x5529fe=_[_0x7207('0x2')](_0x5529fe,require(_0x7207('0xa')));_0x5529fe=_[_0x7207('0x2')](_0x5529fe,require(_0x7207('0xb')));_0x5529fe=_[_0x7207('0x2')](_0x5529fe,require('../api/voiceTransferReport/voiceTransferReport.rpc'));_0x5529fe=_[_0x7207('0x2')](_0x5529fe,require(_0x7207('0xc')));_0x5529fe=_['merge'](_0x5529fe,require(_0x7207('0xd')));_0x5529fe=_[_0x7207('0x2')](_0x5529fe,require(_0x7207('0xe')));_0x5529fe=_[_0x7207('0x2')](_0x5529fe,require('../api/mailQueue/mailQueue.rpc'));_0x5529fe=_[_0x7207('0x2')](_0x5529fe,require('../api/mailInteraction/mailInteraction.rpc'));_0x5529fe=_['merge'](_0x5529fe,require(_0x7207('0xf')));_0x5529fe=_[_0x7207('0x2')](_0x5529fe,require(_0x7207('0x10')));_0x5529fe=_[_0x7207('0x2')](_0x5529fe,require(_0x7207('0x11')));_0x5529fe=_['merge'](_0x5529fe,require(_0x7207('0x12')));_0x5529fe=_[_0x7207('0x2')](_0x5529fe,require(_0x7207('0x13')));_0x5529fe=_['merge'](_0x5529fe,require('../api/faxInteraction/faxInteraction.rpc'));_0x5529fe=_['merge'](_0x5529fe,require('../api/faxMessage/faxMessage.rpc'));_0x5529fe=_[_0x7207('0x2')](_0x5529fe,require(_0x7207('0x14')));_0x5529fe=_[_0x7207('0x2')](_0x5529fe,require(_0x7207('0x15')));_0x5529fe=_[_0x7207('0x2')](_0x5529fe,require(_0x7207('0x16')));_0x5529fe=_[_0x7207('0x2')](_0x5529fe,require('../api/smsInteraction/smsInteraction.rpc'));_0x5529fe=_[_0x7207('0x2')](_0x5529fe,require(_0x7207('0x17')));_0x5529fe=_['merge'](_0x5529fe,require(_0x7207('0x18')));_0x5529fe=_[_0x7207('0x2')](_0x5529fe,require(_0x7207('0x19')));_0x5529fe=_[_0x7207('0x2')](_0x5529fe,require(_0x7207('0x1a')));_0x5529fe=_[_0x7207('0x2')](_0x5529fe,require(_0x7207('0x1b')));_0x5529fe=_[_0x7207('0x2')](_0x5529fe,require(_0x7207('0x1c')));_0x5529fe=_['merge'](_0x5529fe,require(_0x7207('0x1d')));_0x5529fe=_[_0x7207('0x2')](_0x5529fe,require(_0x7207('0x1e')));_0x5529fe=_['merge'](_0x5529fe,require(_0x7207('0x1f')));_0x5529fe=_['merge'](_0x5529fe,require(_0x7207('0x20')));_0x5529fe=_[_0x7207('0x2')](_0x5529fe,require(_0x7207('0x21')));_0x5529fe=_[_0x7207('0x2')](_0x5529fe,require(_0x7207('0x22')));_0x5529fe=_[_0x7207('0x2')](_0x5529fe,require(_0x7207('0x23')));_0x5529fe=_[_0x7207('0x2')](_0x5529fe,require(_0x7207('0x24')));_0x5529fe=_[_0x7207('0x2')](_0x5529fe,require(_0x7207('0x25')));_0x5529fe=_['merge'](_0x5529fe,require(_0x7207('0x26')));_0x5529fe=_[_0x7207('0x2')](_0x5529fe,require(_0x7207('0x27')));_0x5529fe=_['merge'](_0x5529fe,require(_0x7207('0x28')));_0x5529fe=_[_0x7207('0x2')](_0x5529fe,require('../api/sound/sound.rpc'));_0x5529fe=_[_0x7207('0x2')](_0x5529fe,require(_0x7207('0x29')));_0x5529fe=_[_0x7207('0x2')](_0x5529fe,require(_0x7207('0x2a')));_0x5529fe=_[_0x7207('0x2')](_0x5529fe,require(_0x7207('0x2b')));_0x5529fe=_[_0x7207('0x2')](_0x5529fe,require(_0x7207('0x2c')));_0x5529fe=_[_0x7207('0x2')](_0x5529fe,require(_0x7207('0x2d')));_0x5529fe=_[_0x7207('0x2')](_0x5529fe,require('../api/intDeskAccount/intDeskAccount.rpc'));_0x5529fe=_[_0x7207('0x2')](_0x5529fe,require(_0x7207('0x2e')));_0x5529fe=_['merge'](_0x5529fe,require(_0x7207('0x2f')));_0x5529fe=_[_0x7207('0x2')](_0x5529fe,require('../api/intFreshdeskAccount/intFreshdeskAccount.rpc'));_0x5529fe=_[_0x7207('0x2')](_0x5529fe,require('../api/intVtigerAccount/intVtigerAccount.rpc'));_0x5529fe=_[_0x7207('0x2')](_0x5529fe,require('../api/intServicenowAccount/intServicenowAccount.rpc'));_0x5529fe=_['merge'](_0x5529fe,require(_0x7207('0x30')));_0x5529fe=_[_0x7207('0x2')](_0x5529fe,require('../api/chatQueueReport/chatQueueReport.rpc'));_0x5529fe=_[_0x7207('0x2')](_0x5529fe,require(_0x7207('0x31')));_0x5529fe=_[_0x7207('0x2')](_0x5529fe,require(_0x7207('0x32')));_0x5529fe=_['merge'](_0x5529fe,require(_0x7207('0x33')));_0x5529fe=_[_0x7207('0x2')](_0x5529fe,require(_0x7207('0x34')));_0x5529fe=_[_0x7207('0x2')](_0x5529fe,require('../api/squareProject/squareProject.rpc'));_0x5529fe=_[_0x7207('0x2')](_0x5529fe,require(_0x7207('0x35')));_0x5529fe=_[_0x7207('0x2')](_0x5529fe,require(_0x7207('0x36')));_0x5529fe=_[_0x7207('0x2')](_0x5529fe,require(_0x7207('0x37')));_0x5529fe=_[_0x7207('0x2')](_0x5529fe,require(_0x7207('0x38')));_0x5529fe=_[_0x7207('0x2')](_0x5529fe,require(_0x7207('0x39')));var _0x1e7858=jayson[_0x7207('0x3a')](_0x5529fe)['http']();var _0x3f687c=config[_0x7207('0x3b')][_0x7207('0x3c')]||config[_0x7207('0x3c')]+0x1;var _0x11a4ae=config[_0x7207('0x3b')]['ip']||_0x7207('0x3d');_0x1e7858['on'](_0x7207('0x3e'),function(_0x123994){return _0xb2093e(_0x123994);});_0x1e7858[_0x7207('0x3f')](_0x3f687c,_0x11a4ae,function(){console['log'](_0x7207('0x40'),_0x11a4ae,_0x3f687c);require('../config/triggers')[_0x7207('0x41')]();return _0x361e58('RPC\x20listening\x20on\x20'+_0x11a4ae+':'+_0x3f687c);});});}; \ No newline at end of file +var _0x1a72=['../api/smsQueue/smsQueue.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatMessage/chatMessage.rpc','../api/cmContact/cmContact.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/interval/interval.rpc','../api/pause/pause.rpc','../api/sound/sound.rpc','../api/template/template.rpc','../api/trigger/trigger.rpc','../api/variable/variable.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareRecording/squareRecording.rpc','../api/squareMessage/squareMessage.rpc','../api/campaign/campaign.rpc','../api/attachment/attachment.rpc','../api/plugin/plugin.rpc','server','http','rpc','port','localhost','listen','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','default','jayson/promise','bluebird','../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/mailAccount/mailAccount.rpc','../api/mailQueue/mailQueue.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailMessage/mailMessage.rpc','../api/mailApplication/mailApplication.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxAccount/faxAccount.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsAccount/smsAccount.rpc','../api/smsInteraction/smsInteraction.rpc'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1a72,0x13f));var _0x21a7=function(_0x3d9b30,_0xd7bd79){_0x3d9b30=_0x3d9b30-0x0;var _0x175649=_0x1a72[_0x3d9b30];return _0x175649;};'use strict';var jayson=require(_0x21a7('0x0'));var BPromise=require(_0x21a7('0x1'));var _=require('lodash');var config=require(_0x21a7('0x2'));exports['listen']=function(){return new BPromise(function(_0x53011f,_0x359820){var _0x260bb0={};_0x260bb0=_[_0x21a7('0x3')](_0x260bb0,require(_0x21a7('0x4')));_0x260bb0=_[_0x21a7('0x3')](_0x260bb0,require(_0x21a7('0x5')));_0x260bb0=_[_0x21a7('0x3')](_0x260bb0,require(_0x21a7('0x6')));_0x260bb0=_[_0x21a7('0x3')](_0x260bb0,require(_0x21a7('0x7')));_0x260bb0=_[_0x21a7('0x3')](_0x260bb0,require(_0x21a7('0x8')));_0x260bb0=_[_0x21a7('0x3')](_0x260bb0,require('../api/voiceDialReport/voiceDialReport.rpc'));_0x260bb0=_[_0x21a7('0x3')](_0x260bb0,require(_0x21a7('0x9')));_0x260bb0=_[_0x21a7('0x3')](_0x260bb0,require(_0x21a7('0xa')));_0x260bb0=_['merge'](_0x260bb0,require(_0x21a7('0xb')));_0x260bb0=_[_0x21a7('0x3')](_0x260bb0,require(_0x21a7('0xc')));_0x260bb0=_['merge'](_0x260bb0,require(_0x21a7('0xd')));_0x260bb0=_[_0x21a7('0x3')](_0x260bb0,require(_0x21a7('0xe')));_0x260bb0=_[_0x21a7('0x3')](_0x260bb0,require('../api/mailServerIn/mailServerIn.rpc'));_0x260bb0=_[_0x21a7('0x3')](_0x260bb0,require(_0x21a7('0xf')));_0x260bb0=_[_0x21a7('0x3')](_0x260bb0,require(_0x21a7('0x10')));_0x260bb0=_[_0x21a7('0x3')](_0x260bb0,require(_0x21a7('0x11')));_0x260bb0=_[_0x21a7('0x3')](_0x260bb0,require(_0x21a7('0x12')));_0x260bb0=_[_0x21a7('0x3')](_0x260bb0,require(_0x21a7('0x13')));_0x260bb0=_[_0x21a7('0x3')](_0x260bb0,require(_0x21a7('0x14')));_0x260bb0=_[_0x21a7('0x3')](_0x260bb0,require(_0x21a7('0x15')));_0x260bb0=_[_0x21a7('0x3')](_0x260bb0,require('../api/faxApplication/faxApplication.rpc'));_0x260bb0=_[_0x21a7('0x3')](_0x260bb0,require('../api/faxInteraction/faxInteraction.rpc'));_0x260bb0=_[_0x21a7('0x3')](_0x260bb0,require(_0x21a7('0x16')));_0x260bb0=_[_0x21a7('0x3')](_0x260bb0,require('../api/faxQueue/faxQueue.rpc'));_0x260bb0=_[_0x21a7('0x3')](_0x260bb0,require(_0x21a7('0x17')));_0x260bb0=_[_0x21a7('0x3')](_0x260bb0,require(_0x21a7('0x18')));_0x260bb0=_['merge'](_0x260bb0,require(_0x21a7('0x19')));_0x260bb0=_['merge'](_0x260bb0,require('../api/smsMessage/smsMessage.rpc'));_0x260bb0=_[_0x21a7('0x3')](_0x260bb0,require(_0x21a7('0x1a')));_0x260bb0=_['merge'](_0x260bb0,require('../api/openchannelApplication/openchannelApplication.rpc'));_0x260bb0=_['merge'](_0x260bb0,require(_0x21a7('0x1b')));_0x260bb0=_['merge'](_0x260bb0,require(_0x21a7('0x1c')));_0x260bb0=_[_0x21a7('0x3')](_0x260bb0,require(_0x21a7('0x1d')));_0x260bb0=_[_0x21a7('0x3')](_0x260bb0,require(_0x21a7('0x1e')));_0x260bb0=_[_0x21a7('0x3')](_0x260bb0,require('../api/chatInteraction/chatInteraction.rpc'));_0x260bb0=_[_0x21a7('0x3')](_0x260bb0,require(_0x21a7('0x1f')));_0x260bb0=_['merge'](_0x260bb0,require('../api/chatQueue/chatQueue.rpc'));_0x260bb0=_['merge'](_0x260bb0,require(_0x21a7('0x20')));_0x260bb0=_[_0x21a7('0x3')](_0x260bb0,require(_0x21a7('0x21')));_0x260bb0=_['merge'](_0x260bb0,require('../api/cmHopperBlack/cmHopperBlack.rpc'));_0x260bb0=_[_0x21a7('0x3')](_0x260bb0,require(_0x21a7('0x22')));_0x260bb0=_[_0x21a7('0x3')](_0x260bb0,require('../api/cmHopperHistory/cmHopperHistory.rpc'));_0x260bb0=_[_0x21a7('0x3')](_0x260bb0,require('../api/reportAgentPreview/reportAgentPreview.rpc'));_0x260bb0=_['merge'](_0x260bb0,require(_0x21a7('0x23')));_0x260bb0=_[_0x21a7('0x3')](_0x260bb0,require(_0x21a7('0x24')));_0x260bb0=_[_0x21a7('0x3')](_0x260bb0,require(_0x21a7('0x25')));_0x260bb0=_[_0x21a7('0x3')](_0x260bb0,require(_0x21a7('0x26')));_0x260bb0=_[_0x21a7('0x3')](_0x260bb0,require(_0x21a7('0x27')));_0x260bb0=_[_0x21a7('0x3')](_0x260bb0,require(_0x21a7('0x28')));_0x260bb0=_[_0x21a7('0x3')](_0x260bb0,require(_0x21a7('0x29')));_0x260bb0=_[_0x21a7('0x3')](_0x260bb0,require(_0x21a7('0x2a')));_0x260bb0=_[_0x21a7('0x3')](_0x260bb0,require(_0x21a7('0x2b')));_0x260bb0=_[_0x21a7('0x3')](_0x260bb0,require(_0x21a7('0x2c')));_0x260bb0=_[_0x21a7('0x3')](_0x260bb0,require(_0x21a7('0x2d')));_0x260bb0=_[_0x21a7('0x3')](_0x260bb0,require(_0x21a7('0x2e')));_0x260bb0=_['merge'](_0x260bb0,require(_0x21a7('0x2f')));_0x260bb0=_['merge'](_0x260bb0,require(_0x21a7('0x30')));_0x260bb0=_[_0x21a7('0x3')](_0x260bb0,require(_0x21a7('0x31')));_0x260bb0=_[_0x21a7('0x3')](_0x260bb0,require(_0x21a7('0x32')));_0x260bb0=_['merge'](_0x260bb0,require(_0x21a7('0x33')));_0x260bb0=_['merge'](_0x260bb0,require(_0x21a7('0x34')));_0x260bb0=_['merge'](_0x260bb0,require(_0x21a7('0x35')));_0x260bb0=_[_0x21a7('0x3')](_0x260bb0,require(_0x21a7('0x36')));_0x260bb0=_[_0x21a7('0x3')](_0x260bb0,require('../api/squareProject/squareProject.rpc'));_0x260bb0=_['merge'](_0x260bb0,require(_0x21a7('0x37')));_0x260bb0=_['merge'](_0x260bb0,require(_0x21a7('0x38')));_0x260bb0=_[_0x21a7('0x3')](_0x260bb0,require(_0x21a7('0x39')));_0x260bb0=_[_0x21a7('0x3')](_0x260bb0,require(_0x21a7('0x3a')));_0x260bb0=_[_0x21a7('0x3')](_0x260bb0,require(_0x21a7('0x3b')));var _0x3e8c10=jayson[_0x21a7('0x3c')](_0x260bb0)[_0x21a7('0x3d')]();var _0x24b4b6=config[_0x21a7('0x3e')][_0x21a7('0x3f')]||config[_0x21a7('0x3f')]+0x1;var _0x552746=config['rpc']['ip']||_0x21a7('0x40');_0x3e8c10['on']('error',function(_0x5502a5){return _0x359820(_0x5502a5);});_0x3e8c10[_0x21a7('0x41')](_0x24b4b6,_0x552746,function(){console['log'](_0x21a7('0x42'),_0x552746,_0x24b4b6);require(_0x21a7('0x43'))[_0x21a7('0x44')]();return _0x53011f('RPC\x20listening\x20on\x20'+_0x552746+':'+_0x24b4b6);});});}; \ No newline at end of file diff --git a/server/services/agi/channel.js b/server/services/agi/channel.js index ec5a5e6..02ef127 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 _0x1623=['function','no\x20code','replace','result=','substr','indexOf','startsWith','split','length','error','E_AGI_SOCKET_ERROR','code','close','E_AGI_SOCKET_CLOSE','timeout','E_AGI_SOCKET_TIMEOUT','destroy','pipe','command','write','inherits','prototype','answer','sendRequest','beep','format','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','noop','VERBOSE\x20\x22%s\x22','exec','isArray','EXEC\x20%s\x20%s','join','SET\x20CONTEXT\x20%s','setExtension','SET\x20EXTENSION\x20%s','setPriority','SET\x20PRIORITY\x20%s','HANGUP','setVariable','toString','sayDigits','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','recordFile','wav','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','streamFile','agi','AGI','WAIT','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','exports','util','events','./reply','./error','call','setEncoding','utf8','headers','emit','hangup','substring'];(function(_0x82fc2d,_0x9831da){var _0x2f8001=function(_0x4363b1){while(--_0x4363b1){_0x82fc2d['push'](_0x82fc2d['shift']());}};_0x2f8001(++_0x9831da);}(_0x1623,0x158));var _0x3162=function(_0x17bd3c,_0x4a020a){_0x17bd3c=_0x17bd3c-0x0;var _0x33cbdf=_0x1623[_0x17bd3c];return _0x33cbdf;};'use strict';var util=require(_0x3162('0x0'));var _=require('lodash');var EventEmitter=require(_0x3162('0x1'))['EventEmitter'];var AGIReply=require(_0x3162('0x2'));var AGIError=require(_0x3162('0x3'));function AGIChannel(_0x2a355f){var _0x2ac5c8=this,_0x372452=new AGIReply(),_0xc2b969=![],_0x864988={};EventEmitter[_0x3162('0x4')](_0x2ac5c8);_0x2a355f[_0x3162('0x5')](_0x3162('0x6'));_0x2a355f['setTimeout'](0x8*0x3c*0x3c*0x3e8);_0x372452[_0x3162('0x5')](_0x3162('0x6'));_0x372452['on'](_0x3162('0x7'),function(_0x432f73){for(var _0x4823b8 in _0x432f73){_0x2ac5c8[_0x4823b8]=_0x432f73[_0x4823b8];}_0x2ac5c8[_0x3162('0x8')]('ready');});_0x372452['on']('line',function(_0x41ffef){if(_0x41ffef['toLowerCase']()==_0x3162('0x9')){_0x2ac5c8[_0x3162('0x8')]('hangup');return;}if(_0x41ffef[_0x3162('0xa')](0x0,0xb)=='520-Invalid'){_0xc2b969=!![];}if(_0xc2b969){_0x864988['rx']+=_0x41ffef+'\x0a';if(_0x41ffef['search']('520\x20End\x20of\x20proper')!=-0x1){_0xc2b969=![];}}else{_0x864988['rx']=_0x41ffef;}if(_0xc2b969){return;}if(typeof _0x864988['cb']==_0x3162('0xb')){var _0x3e449c=_0x864988['rx'][_0x3162('0xa')](0x0,0x3),_0x1fb1bd=null,_0x50d680=null;_0x3e449c=parseInt(_0x3e449c);if(isNaN(_0x3e449c)){_0x864988['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0x3162('0xc')});return;}if(_0x3e449c!=0xc8){_0x864988['cb'](null,{'code':_0x3e449c,'result':-0x1,'extra':'KO'});return;}_0x1fb1bd=_0x864988['rx'][_0x3162('0xa')](0x4)[_0x3162('0xd')](_0x3162('0xe'),'');if(_0x1fb1bd['indexOf']('\x20')!=-0x1){_0x1fb1bd=_0x1fb1bd[_0x3162('0xf')](0x0,_0x1fb1bd[_0x3162('0x10')]('\x20'));}if(_[_0x3162('0x11')](_0x1fb1bd,'-1')){_0x1fb1bd=parseInt(_0x1fb1bd);}_0x50d680=_0x864988['rx'][_0x3162('0x12')]('\x20');if(_0x50d680['length']==0x3){_0x50d680=_0x50d680[0x2][_0x3162('0xa')](0x1,_0x50d680[0x2]['length']-0x1);}else if(_0x50d680[_0x3162('0x13')]>0x3){var _0x1e38a1=/\((.+)\)/;var _0x3448b5=_0x864988['rx']['match'](_0x1e38a1);if(_0x3448b5){_0x50d680=_0x3448b5[0x1];}else{_0x50d680=null;}}else{_0x50d680=null;}_0x864988['cb'](null,{'code':_0x3e449c,'result':_0x1fb1bd,'extra':_0x50d680});}});_0x2a355f['on'](_0x3162('0x14'),function(_0x3b77fd){_0x2ac5c8['emit'](_0x3162('0x14'),new AGIError(_0x3162('0x15'),_0x3b77fd[_0x3162('0x16')]));});_0x2a355f['on']('close',function(){_0x2ac5c8[_0x3162('0x8')](_0x3162('0x17'),new AGIError(_0x3162('0x18')));});_0x2a355f['on'](_0x3162('0x19'),function(){_0x2ac5c8[_0x3162('0x8')]('timeout',new AGIError(_0x3162('0x1a')));_0x2a355f[_0x3162('0x1b')]();});_0x2a355f[_0x3162('0x1c')](_0x372452);this[_0x3162('0x1d')]=function(_0x1cf774,_0x261a3a){var _0x1cf774=_0x1cf774||'',_0x261a3a=typeof _0x261a3a==_0x3162('0xb')?_0x261a3a:new Function();_0x864988={'tx':_0x1cf774,'rx':'','cb':_0x261a3a};_0x2a355f[_0x3162('0x1e')](_0x1cf774+'\x0a');},this[_0x3162('0x17')]=function(){_0x2a355f[_0x3162('0x1b')]();};}util[_0x3162('0x1f')](AGIChannel,EventEmitter);AGIChannel[_0x3162('0x20')]['sendRequest']=function(_0x5a9d74){return this[_0x3162('0x1d')]['sync'](this,_0x5a9d74);};AGIChannel['prototype'][_0x3162('0x21')]=function(){return this[_0x3162('0x22')]('ANSWER');};AGIChannel[_0x3162('0x20')]['getData']=function(_0x472112,_0x129d20,_0x3d03cb){_0x472112=_0x472112===undefined?_0x3162('0x23'):_0x472112;_0x129d20=_0x129d20===undefined?'5':_0x129d20;_0x3d03cb=_0x3d03cb===undefined?'1':_0x3d03cb;return this[_0x3162('0x22')](util[_0x3162('0x24')](_0x3162('0x25'),_0x472112,_0x129d20*0x3e8,_0x3d03cb));};AGIChannel[_0x3162('0x20')][_0x3162('0x26')]=function(_0x39889d){_0x39889d=_0x39889d||'NO\x20MESSAGE';return this[_0x3162('0x22')](util['format'](_0x3162('0x27'),_0x39889d));};AGIChannel[_0x3162('0x20')][_0x3162('0x28')]=function(_0x150024,_0xac1bc1){if(_[_0x3162('0x29')](_0xac1bc1)){return this[_0x3162('0x22')](util[_0x3162('0x24')](_0x3162('0x2a'),_0x150024,_0xac1bc1[_0x3162('0x2b')](',')));}return this[_0x3162('0x22')](util['format'](_0x3162('0x2a'),_0x150024,_0xac1bc1));};AGIChannel[_0x3162('0x20')]['setContext']=function(_0x3cc4f2){return this[_0x3162('0x22')](util[_0x3162('0x24')](_0x3162('0x2c'),_0x3cc4f2));};AGIChannel[_0x3162('0x20')][_0x3162('0x2d')]=function(_0x12f6c0){return this[_0x3162('0x22')](util[_0x3162('0x24')](_0x3162('0x2e'),_0x12f6c0));};AGIChannel['prototype'][_0x3162('0x2f')]=function(_0x1c2d51){return this['sendRequest'](util[_0x3162('0x24')](_0x3162('0x30'),_0x1c2d51));};AGIChannel[_0x3162('0x20')][_0x3162('0x9')]=function(){return this[_0x3162('0x22')](_0x3162('0x31'));};AGIChannel[_0x3162('0x20')][_0x3162('0x32')]=function(_0x93d0ea,_0x528a60){return this[_0x3162('0x22')](util[_0x3162('0x24')]('SET\x20VARIABLE\x20%s\x20\x22%s\x22',_0x93d0ea,_0x528a60?_0x528a60[_0x3162('0x33')]()[_0x3162('0xd')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0x3162('0x20')]['sayNumber']=function(_0x55f6a2,_0x4517e4){return this[_0x3162('0x22')](util['format']('SAY\x20NUMBER\x20%s\x20%s',_0x55f6a2,_0x4517e4));};AGIChannel[_0x3162('0x20')][_0x3162('0x34')]=function(_0x5aaec6,_0x4e0e42){return this['sendRequest'](util[_0x3162('0x24')](_0x3162('0x35'),_0x5aaec6,_0x4e0e42));};AGIChannel[_0x3162('0x20')][_0x3162('0x36')]=function(_0x23292e,_0x2aa85c){return this[_0x3162('0x22')](util[_0x3162('0x24')](_0x3162('0x37'),_0x23292e,_0x2aa85c));};AGIChannel[_0x3162('0x20')][_0x3162('0x38')]=function(_0x4a083a,_0x43939c,_0xdae84c){_0x43939c=_0x43939c||this[_0x3162('0x39')];_0xdae84c=_0xdae84c||0x1;this['setContext'](_0x4a083a);this[_0x3162('0x2d')](_0x43939c);this['setPriority'](_0xdae84c);return this['noop'](util[_0x3162('0x24')](_0x3162('0x3a'),_0x4a083a,_0x43939c,_0xdae84c));};AGIChannel[_0x3162('0x20')][_0x3162('0x3b')]=function(_0x484b0c){return this[_0x3162('0x22')](util['format'](_0x3162('0x3c'),_0x484b0c));};AGIChannel[_0x3162('0x20')][_0x3162('0x3d')]=function(_0x268f5f,_0x554cd5,_0x49e405,_0x318e94,_0x2abbfa,_0x23bfaa){_0x554cd5=_0x554cd5||_0x3162('0x3e');_0x49e405=_0x49e405||'';_0x318e94=_0x318e94===undefined?-0x1:_0x318e94==='-1'?-0x1:_0x318e94*0x3e8;_0x2abbfa=_0x2abbfa===undefined?'':'s='+_0x2abbfa;_0x23bfaa=_0x23bfaa?'BEEP':'';return this[_0x3162('0x22')](util[_0x3162('0x24')](_0x3162('0x3f'),_0x268f5f,_0x554cd5,_0x49e405,_0x318e94,_0x23bfaa,_0x2abbfa));};AGIChannel[_0x3162('0x20')][_0x3162('0x40')]=function(_0x8c22ef,_0x3116f2){_0x3116f2=_0x3116f2||'';return this[_0x3162('0x22')](util[_0x3162('0x24')]('STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22',_0x8c22ef,_0x3116f2));};AGIChannel[_0x3162('0x20')][_0x3162('0x41')]=function(_0x590bb7){return this[_0x3162('0x28')](_0x3162('0x42'),_0x590bb7);};AGIChannel[_0x3162('0x20')]['wait']=function(_0x2366e4){return this['exec'](_0x3162('0x43'),_0x2366e4);};AGIChannel[_0x3162('0x20')][_0x3162('0x14')]=function(_0x4cda40,_0x512732){this[_0x3162('0x26')](util[_0x3162('0x24')](_0x3162('0x44'),_0x4cda40['id'],_0x4cda40[_0x3162('0x45')],_0x512732));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x3162('0x46')]=AGIChannel; \ No newline at end of file +var _0x60c8=['no\x20code','indexOf','substr','startsWith','split','length','match','error','code','E_AGI_SOCKET_CLOSE','timeout','pipe','command','close','destroy','inherits','sendRequest','prototype','answer','ANSWER','beep','format','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','noop','NO\x20MESSAGE','exec','isArray','join','EXEC\x20%s\x20%s','setContext','SET\x20CONTEXT\x20%s','setExtension','SET\x20EXTENSION\x20%s','setPriority','SET\x20PRIORITY\x20%s','HANGUP','setVariable','SET\x20VARIABLE\x20%s\x20\x22%s\x22','toString','replace','SAY\x20NUMBER\x20%s\x20%s','sayDigits','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','continueAt','extension','GOTO\x20%s\x20%s\x20%s','getVariable','wav','BEEP','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','streamFile','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','agi','wait','WAIT','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','exports','util','lodash','EventEmitter','./reply','./error','call','setTimeout','setEncoding','headers','emit','ready','line','toLowerCase','hangup','substring','search','520\x20End\x20of\x20proper','function'];(function(_0xc8c51b,_0x3d524d){var _0x34c29=function(_0x1a9f76){while(--_0x1a9f76){_0xc8c51b['push'](_0xc8c51b['shift']());}};_0x34c29(++_0x3d524d);}(_0x60c8,0xd5));var _0x860c=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x60c8[_0x20a584];return _0x4b41a8;};'use strict';var util=require(_0x860c('0x0'));var _=require(_0x860c('0x1'));var EventEmitter=require('events')[_0x860c('0x2')];var AGIReply=require(_0x860c('0x3'));var AGIError=require(_0x860c('0x4'));function AGIChannel(_0x575a7a){var _0x89179d=this,_0x1f8c0a=new AGIReply(),_0x16c8af=![],_0x10f5a9={};EventEmitter[_0x860c('0x5')](_0x89179d);_0x575a7a['setEncoding']('utf8');_0x575a7a[_0x860c('0x6')](0x8*0x3c*0x3c*0x3e8);_0x1f8c0a[_0x860c('0x7')]('utf8');_0x1f8c0a['on'](_0x860c('0x8'),function(_0xcc2ebd){for(var _0x2f3d4e in _0xcc2ebd){_0x89179d[_0x2f3d4e]=_0xcc2ebd[_0x2f3d4e];}_0x89179d[_0x860c('0x9')](_0x860c('0xa'));});_0x1f8c0a['on'](_0x860c('0xb'),function(_0x44a39f){if(_0x44a39f[_0x860c('0xc')]()==_0x860c('0xd')){_0x89179d[_0x860c('0x9')](_0x860c('0xd'));return;}if(_0x44a39f[_0x860c('0xe')](0x0,0xb)=='520-Invalid'){_0x16c8af=!![];}if(_0x16c8af){_0x10f5a9['rx']+=_0x44a39f+'\x0a';if(_0x44a39f[_0x860c('0xf')](_0x860c('0x10'))!=-0x1){_0x16c8af=![];}}else{_0x10f5a9['rx']=_0x44a39f;}if(_0x16c8af){return;}if(typeof _0x10f5a9['cb']==_0x860c('0x11')){var _0x22834f=_0x10f5a9['rx']['substring'](0x0,0x3),_0x8d7926=null,_0x72ecb4=null;_0x22834f=parseInt(_0x22834f);if(isNaN(_0x22834f)){_0x10f5a9['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0x860c('0x12')});return;}if(_0x22834f!=0xc8){_0x10f5a9['cb'](null,{'code':_0x22834f,'result':-0x1,'extra':'KO'});return;}_0x8d7926=_0x10f5a9['rx'][_0x860c('0xe')](0x4)['replace']('result=','');if(_0x8d7926[_0x860c('0x13')]('\x20')!=-0x1){_0x8d7926=_0x8d7926[_0x860c('0x14')](0x0,_0x8d7926['indexOf']('\x20'));}if(_[_0x860c('0x15')](_0x8d7926,'-1')){_0x8d7926=parseInt(_0x8d7926);}_0x72ecb4=_0x10f5a9['rx'][_0x860c('0x16')]('\x20');if(_0x72ecb4[_0x860c('0x17')]==0x3){_0x72ecb4=_0x72ecb4[0x2][_0x860c('0xe')](0x1,_0x72ecb4[0x2][_0x860c('0x17')]-0x1);}else if(_0x72ecb4[_0x860c('0x17')]>0x3){var _0x465580=/\((.+)\)/;var _0x407378=_0x10f5a9['rx'][_0x860c('0x18')](_0x465580);if(_0x407378){_0x72ecb4=_0x407378[0x1];}else{_0x72ecb4=null;}}else{_0x72ecb4=null;}_0x10f5a9['cb'](null,{'code':_0x22834f,'result':_0x8d7926,'extra':_0x72ecb4});}});_0x575a7a['on'](_0x860c('0x19'),function(_0x58f46c){_0x89179d[_0x860c('0x9')](_0x860c('0x19'),new AGIError('E_AGI_SOCKET_ERROR',_0x58f46c[_0x860c('0x1a')]));});_0x575a7a['on']('close',function(){_0x89179d[_0x860c('0x9')]('close',new AGIError(_0x860c('0x1b')));});_0x575a7a['on']('timeout',function(){_0x89179d[_0x860c('0x9')](_0x860c('0x1c'),new AGIError('E_AGI_SOCKET_TIMEOUT'));_0x575a7a['destroy']();});_0x575a7a[_0x860c('0x1d')](_0x1f8c0a);this[_0x860c('0x1e')]=function(_0x3670bc,_0x29c64f){var _0x3670bc=_0x3670bc||'',_0x29c64f=typeof _0x29c64f==_0x860c('0x11')?_0x29c64f:new Function();_0x10f5a9={'tx':_0x3670bc,'rx':'','cb':_0x29c64f};_0x575a7a['write'](_0x3670bc+'\x0a');},this[_0x860c('0x1f')]=function(){_0x575a7a[_0x860c('0x20')]();};}util[_0x860c('0x21')](AGIChannel,EventEmitter);AGIChannel['prototype'][_0x860c('0x22')]=function(_0x6519d5){return this[_0x860c('0x1e')]['sync'](this,_0x6519d5);};AGIChannel[_0x860c('0x23')][_0x860c('0x24')]=function(){return this[_0x860c('0x22')](_0x860c('0x25'));};AGIChannel[_0x860c('0x23')]['getData']=function(_0xc2d37f,_0x29da3d,_0x474273){_0xc2d37f=_0xc2d37f===undefined?_0x860c('0x26'):_0xc2d37f;_0x29da3d=_0x29da3d===undefined?'5':_0x29da3d;_0x474273=_0x474273===undefined?'1':_0x474273;return this[_0x860c('0x22')](util[_0x860c('0x27')](_0x860c('0x28'),_0xc2d37f,_0x29da3d*0x3e8,_0x474273));};AGIChannel[_0x860c('0x23')][_0x860c('0x29')]=function(_0x577197){_0x577197=_0x577197||_0x860c('0x2a');return this['sendRequest'](util[_0x860c('0x27')]('VERBOSE\x20\x22%s\x22',_0x577197));};AGIChannel[_0x860c('0x23')][_0x860c('0x2b')]=function(_0x4ade8c,_0x19a78c){if(_[_0x860c('0x2c')](_0x19a78c)){return this['sendRequest'](util[_0x860c('0x27')]('EXEC\x20%s\x20%s',_0x4ade8c,_0x19a78c[_0x860c('0x2d')](',')));}return this['sendRequest'](util[_0x860c('0x27')](_0x860c('0x2e'),_0x4ade8c,_0x19a78c));};AGIChannel[_0x860c('0x23')][_0x860c('0x2f')]=function(_0xb8f7ed){return this[_0x860c('0x22')](util['format'](_0x860c('0x30'),_0xb8f7ed));};AGIChannel['prototype'][_0x860c('0x31')]=function(_0x5642af){return this[_0x860c('0x22')](util[_0x860c('0x27')](_0x860c('0x32'),_0x5642af));};AGIChannel[_0x860c('0x23')][_0x860c('0x33')]=function(_0x592a74){return this[_0x860c('0x22')](util['format'](_0x860c('0x34'),_0x592a74));};AGIChannel[_0x860c('0x23')][_0x860c('0xd')]=function(){return this[_0x860c('0x22')](_0x860c('0x35'));};AGIChannel[_0x860c('0x23')][_0x860c('0x36')]=function(_0x1ce17f,_0x5970a8){return this[_0x860c('0x22')](util[_0x860c('0x27')](_0x860c('0x37'),_0x1ce17f,_0x5970a8?_0x5970a8[_0x860c('0x38')]()[_0x860c('0x39')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0x860c('0x23')]['sayNumber']=function(_0x31b2cc,_0xb30a6a){return this[_0x860c('0x22')](util[_0x860c('0x27')](_0x860c('0x3a'),_0x31b2cc,_0xb30a6a));};AGIChannel[_0x860c('0x23')][_0x860c('0x3b')]=function(_0x4906d9,_0x557821){return this['sendRequest'](util[_0x860c('0x27')]('SAY\x20DIGITS\x20%s\x20%s',_0x4906d9,_0x557821));};AGIChannel[_0x860c('0x23')][_0x860c('0x3c')]=function(_0x5cbbd1,_0x45bf12){return this['sendRequest'](util[_0x860c('0x27')](_0x860c('0x3d'),_0x5cbbd1,_0x45bf12));};AGIChannel[_0x860c('0x23')][_0x860c('0x3e')]=function(_0x3f30f8,_0x419dd0,_0x344c9d){_0x419dd0=_0x419dd0||this[_0x860c('0x3f')];_0x344c9d=_0x344c9d||0x1;this[_0x860c('0x2f')](_0x3f30f8);this[_0x860c('0x31')](_0x419dd0);this[_0x860c('0x33')](_0x344c9d);return this['noop'](util[_0x860c('0x27')](_0x860c('0x40'),_0x3f30f8,_0x419dd0,_0x344c9d));};AGIChannel[_0x860c('0x23')][_0x860c('0x41')]=function(_0xae4771){return this[_0x860c('0x22')](util[_0x860c('0x27')]('GET\x20VARIABLE\x20\x22%s\x22',_0xae4771));};AGIChannel[_0x860c('0x23')]['recordFile']=function(_0x2358ea,_0x53996f,_0x2b19e4,_0x19d183,_0xfdb5a2,_0x573b2b){_0x53996f=_0x53996f||_0x860c('0x42');_0x2b19e4=_0x2b19e4||'';_0x19d183=_0x19d183===undefined?-0x1:_0x19d183==='-1'?-0x1:_0x19d183*0x3e8;_0xfdb5a2=_0xfdb5a2===undefined?'':'s='+_0xfdb5a2;_0x573b2b=_0x573b2b?_0x860c('0x43'):'';return this['sendRequest'](util[_0x860c('0x27')](_0x860c('0x44'),_0x2358ea,_0x53996f,_0x2b19e4,_0x19d183,_0x573b2b,_0xfdb5a2));};AGIChannel[_0x860c('0x23')][_0x860c('0x45')]=function(_0x4a589,_0x569c68){_0x569c68=_0x569c68||'';return this[_0x860c('0x22')](util[_0x860c('0x27')](_0x860c('0x46'),_0x4a589,_0x569c68));};AGIChannel[_0x860c('0x23')][_0x860c('0x47')]=function(_0x42c32a){return this[_0x860c('0x2b')]('AGI',_0x42c32a);};AGIChannel[_0x860c('0x23')][_0x860c('0x48')]=function(_0x508de6){return this['exec'](_0x860c('0x49'),_0x508de6);};AGIChannel['prototype'][_0x860c('0x19')]=function(_0x3bdad8,_0x483744){this[_0x860c('0x29')](util[_0x860c('0x27')](_0x860c('0x4a'),_0x3bdad8['id'],_0x3bdad8[_0x860c('0x4b')],_0x483744));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x860c('0x4c')]=AGIChannel; \ No newline at end of file diff --git a/server/services/agi/error.js b/server/services/agi/error.js index ca647fd..33e7270 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 _0x946e=['Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.','push','name','util','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20closed.','Socket\x20error.\x20Code:\x20%s.','Socket\x20closed.','Socket\x20timeout.'];(function(_0x3a054f,_0x313acd){var _0x3e3b6f=function(_0x19efda){while(--_0x19efda){_0x3a054f['push'](_0x3a054f['shift']());}};_0x3e3b6f(++_0x313acd);}(_0x946e,0x1d0));var _0xe946=function(_0x19201b,_0x216e48){_0x19201b=_0x19201b-0x0;var _0x2a13e2=_0x946e[_0x19201b];return _0x2a13e2;};'use strict';var util=require(_0xe946('0x0'));var error={'E_AGI_UNDEFINED':'Undefined\x20error.','E_AGI_ARGUMENT_PORT':_0xe946('0x1'),'E_AGI_SERVER_ERROR':'Server\x20error.\x20Code:\x20%s.','E_AGI_SERVER_CLOSE':_0xe946('0x2'),'E_AGI_SERVER_MAXCONNECTION':'[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','E_AGI_SERVER_VOICE_DISABLED':'[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','E_AGI_SOCKET_ERROR':_0xe946('0x3'),'E_AGI_SOCKET_CLOSE':_0xe946('0x4'),'E_AGI_SOCKET_TIMEOUT':_0xe946('0x5'),'E_AGI_COMMAND_EMPTY':_0xe946('0x6'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0xe946('0x7'),'E_AGI_IVR_ENTRY':'Missing\x20\x27ivr.entry\x27\x20menu.'};function AGIError(_0x123d0c){var _0x123d0c=_0x123d0c||null,_0x202126=_0x202126||[],_0x4e9ca6=0x1,_0x39bd38='';if(!error[_0x123d0c]){_0x123d0c='E_AGI_UNDEFINED';}_0x202126[_0xe946('0x8')](error[_0x123d0c]);while(arguments[_0x4e9ca6]){_0x202126[_0xe946('0x8')](arguments[_0x4e9ca6]);_0x4e9ca6++;}_0x39bd38=util['format']['apply'](util,_0x202126);this['message']=_0x39bd38;this[_0xe946('0x9')]=_0x123d0c;}module['exports']=AGIError; \ No newline at end of file +var _0x48fb=['format','apply','message','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.','Missing\x20\x27ivr.agi_network_script\x27.','Missing\x20\x27ivr.entry\x27\x20menu.','E_AGI_UNDEFINED','push'];(function(_0x35af23,_0x9190f6){var _0x340506=function(_0xd4c26b){while(--_0xd4c26b){_0x35af23['push'](_0x35af23['shift']());}};_0x340506(++_0x9190f6);}(_0x48fb,0x114));var _0xb48f=function(_0x468c76,_0x32065b){_0x468c76=_0x468c76-0x0;var _0x4d991d=_0x48fb[_0x468c76];return _0x4d991d;};'use strict';var util=require(_0xb48f('0x0'));var error={'E_AGI_UNDEFINED':_0xb48f('0x1'),'E_AGI_ARGUMENT_PORT':_0xb48f('0x2'),'E_AGI_SERVER_ERROR':_0xb48f('0x3'),'E_AGI_SERVER_CLOSE':_0xb48f('0x4'),'E_AGI_SERVER_MAXCONNECTION':_0xb48f('0x5'),'E_AGI_SERVER_VOICE_DISABLED':_0xb48f('0x6'),'E_AGI_SOCKET_ERROR':_0xb48f('0x7'),'E_AGI_SOCKET_CLOSE':'Socket\x20closed.','E_AGI_SOCKET_TIMEOUT':_0xb48f('0x8'),'E_AGI_COMMAND_EMPTY':'Empty\x20command.','E_AGI_IVR_AGI_NETWORK_SCRIPT':_0xb48f('0x9'),'E_AGI_IVR_ENTRY':_0xb48f('0xa')};function AGIError(_0x8f8fe3){var _0x8f8fe3=_0x8f8fe3||null,_0x30514a=_0x30514a||[],_0x253317=0x1,_0x1cc3bc='';if(!error[_0x8f8fe3]){_0x8f8fe3=_0xb48f('0xb');}_0x30514a[_0xb48f('0xc')](error[_0x8f8fe3]);while(arguments[_0x253317]){_0x30514a[_0xb48f('0xc')](arguments[_0x253317]);_0x253317++;}_0x1cc3bc=util[_0xb48f('0xd')][_0xb48f('0xe')](util,_0x30514a);this[_0xb48f('0xf')]=_0x1cc3bc;this['name']=_0x8f8fe3;}module[_0xb48f('0x10')]=AGIError; \ No newline at end of file diff --git a/server/services/agi/graph/index.js b/server/services/agi/graph/index.js index 24e50bc..ef9e8d8 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 _0x8580=['prototype','addVertex','addEdge','size','relations','numberOfEdges','getVertex','traverseBFS','info','no\x20vertex\x20found','stop\x20traverse','length','no\x20edge/s\x20available','condition','split','vswitch','target','agicommand','default\x20on\x20switch\x20not\x20found','includes','max\x20retry\x20reach','condition\x20not\x20found','exports','../../../config/logger','menu','vertices','edges'];(function(_0x1f129c,_0x449e16){var _0x4781f9=function(_0x56ceb2){while(--_0x56ceb2){_0x1f129c['push'](_0x1f129c['shift']());}};_0x4781f9(++_0x449e16);}(_0x8580,0x1c7));var _0x0858=function(_0x3662d4,_0x35ec77){_0x3662d4=_0x3662d4-0x0;var _0x985345=_0x8580[_0x3662d4];return _0x985345;};'use strict';var _=require('lodash');var logger=require(_0x0858('0x0'))('agi');var verticesWithRetry=[_0x0858('0x1'),'getdigits','getsecretdigits'];var Graph=function(){this[_0x0858('0x2')]={};this[_0x0858('0x3')]={};this['numberOfEdges']=0x0;};Graph[_0x0858('0x4')][_0x0858('0x5')]=function(_0x47be72){this[_0x0858('0x2')][_0x47be72['id']]=_0x47be72;this[_0x0858('0x3')][_0x47be72['id']]=[];};Graph[_0x0858('0x4')][_0x0858('0x6')]=function(_0x4981a7,_0x9c611c,_0x3ae92b){this[_0x0858('0x3')][_0x4981a7]['push']({'target':_0x9c611c,'condition':_0x3ae92b});this['numberOfEdges']+=0x1;};Graph[_0x0858('0x4')]['size']=function(){return _[_0x0858('0x7')](this[_0x0858('0x2')]);};Graph[_0x0858('0x4')][_0x0858('0x8')]=function(){return this[_0x0858('0x9')];};Graph[_0x0858('0x4')][_0x0858('0xa')]=function(_0x55d54e){return this['vertices'][_0x55d54e];};Graph['prototype'][_0x0858('0xb')]=function(_0x4dec96,_0x514b21){if(!this['vertices'][_0x4dec96]){return logger[_0x0858('0xc')](_0x0858('0xd'));}var _0x4a869f=_0x514b21(this[_0x0858('0x2')][_0x4dec96]);if(!_0x4a869f){return logger[_0x0858('0xc')](_0x0858('0xe'));}if(this[_0x0858('0x3')][_0x4dec96][_0x0858('0xf')]===0x0){return logger[_0x0858('0xc')](_0x0858('0x10'));}for(var _0x2ed26b=0x0,_0xff802e=[],_0x39e967=![];_0x2ed26b\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','traverseBFS','clear','gotoc','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','response','code','isUndefined','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','vertex','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','continueAt','Project\x20%s\x20not\x20published','Project\x20%s\x20not\x20found','getLicense','voice','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]\x20VOICE\x20IS\x20DISABLED','[LICENSE]','./server','listening','connection','xml2json','lodash','syncho','util','moment','../../config/logger','agi','./rpc','./graph','defaults','127.0.0.1','nextTick','error','stack','log','info','format','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','port','name','message','[%s]\x20%s','[ERROR]\x20%s','[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','callerid','uniqueid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','dnid','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','evtHangup','toJson','mxGraphModel','root','agicommand','hasOwnProperty','retry','maxRetry','addVertex','omit','isArray','length','source','target','value','getSquareProject','then','catch','createSquareReport','agi_','variables','stringify','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','close','production','start','debug','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x4b73a2,_0x40b5fe){var _0x383c66=function(_0x3917ae){while(--_0x3917ae){_0x4b73a2['push'](_0x4b73a2['shift']());}};_0x383c66(++_0x40b5fe);}(_0xf0ba,0x1ed));var _0xaf0b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xf0ba[_0x20a584];return _0x4b41a8;};'use strict';var parser=require(_0xaf0b('0x0'));var _=require(_0xaf0b('0x1'));var syncho=require(_0xaf0b('0x2'));var util=require(_0xaf0b('0x3'));var moment=require(_0xaf0b('0x4'));var config=require('../../config/environment');var logger=require(_0xaf0b('0x5'))(_0xaf0b('0x6'));var utilLicense=require('../../config/license/util');var rpc=require(_0xaf0b('0x7'));var mailRpc=require('./mailRpc');var Graph=require(_0xaf0b('0x8'));var Vertices=require('./vertices');var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config['agi']=_[_0xaf0b('0x9')](config[_0xaf0b('0x6')],{'ip':_0xaf0b('0xa'),'port':0x11dd});function connectionHandler(_0x3439d5){process[_0xaf0b('0xb')](function(){syncho(function(){try{setChannelVariables(_0x3439d5);agiHandler(_0x3439d5);}catch(_0x5b7f0c){logger[_0xaf0b('0xc')](_0x5b7f0c[_0xaf0b('0xd')]);}});});}function listeningHandler(){console[_0xaf0b('0xe')]('Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!',config[_0xaf0b('0x6')]['port']);logger[_0xaf0b('0xf')](util[_0xaf0b('0x10')](_0xaf0b('0x11'),config['agi']['ip'],config[_0xaf0b('0x6')][_0xaf0b('0x12')]));}function errorHandler(_0x166394){if(_0x166394&&_0x166394[_0xaf0b('0x13')]&&_0x166394[_0xaf0b('0x14')]){logger[_0xaf0b('0xc')](util['format'](_0xaf0b('0x15'),_0x166394[_0xaf0b('0x13')],_0x166394[_0xaf0b('0x14')]));}else{logger[_0xaf0b('0xc')](util['format'](_0xaf0b('0x16'),_0x166394[_0xaf0b('0xd')]));}}function closeHandler(){logger[_0xaf0b('0xf')](util[_0xaf0b('0x10')](_0xaf0b('0x17'),this[_0xaf0b('0x18')],this[_0xaf0b('0x19')],this[_0xaf0b('0x1a')],this['dnid'],this[_0xaf0b('0x1b')]));try{createSquareReport(this);}catch(_0x535612){logger[_0xaf0b('0xc')](_0x535612[_0xaf0b('0xd')]);}}function timeoutHandler(){logger[_0xaf0b('0xf')](util[_0xaf0b('0x10')](_0xaf0b('0x1c'),this[_0xaf0b('0x18')],this[_0xaf0b('0x19')],this[_0xaf0b('0x1a')],this[_0xaf0b('0x1d')],this[_0xaf0b('0x1b')]));}function hangupHandler(){logger['info'](util[_0xaf0b('0x10')](_0xaf0b('0x1e'),this[_0xaf0b('0x18')],this['calleridname'],this[_0xaf0b('0x1a')],this[_0xaf0b('0x1d')],this['uniqueid']));this[_0xaf0b('0x1f')]=!![];}function getRoot(_0x47130e){return parser[_0xaf0b('0x20')](_0x47130e,{'object':!![]})[_0xaf0b('0x21')][_0xaf0b('0x22')];}function addVertex(_0x4fe7dc,_0x5f1f70,_0x4541c5){_0x5f1f70[_0xaf0b('0x23')]=_0x4541c5;if(_0x5f1f70[_0xaf0b('0x24')](_0xaf0b('0x25'))){_0x5f1f70[_0xaf0b('0x26')]=parseInt(_0x5f1f70[_0xaf0b('0x25')],0xa);}_0x4fe7dc[_0xaf0b('0x27')](_[_0xaf0b('0x28')](_0x5f1f70,'mxCell'));}function initGraph(_0x1ffa30,_0x21e0e6){var _0x3a4820=new Graph();for(var _0x51cb2f in _0x1ffa30){if(_0x1ffa30[_0xaf0b('0x24')](_0x51cb2f)){if(_[_0xaf0b('0x29')](_0x1ffa30[_0x51cb2f])){for(var _0x54c3be=0x0;_0x54c3be<_0x1ffa30[_0x51cb2f]['length'];_0x54c3be+=0x1){addVertex(_0x3a4820,_0x1ffa30[_0x51cb2f][_0x54c3be],_0x51cb2f);}}else{addVertex(_0x3a4820,_0x1ffa30[_0x51cb2f],_0x51cb2f);}}}for(var _0x4bae53=0x0;_0x4bae53<_0x21e0e6[_0xaf0b('0x2a')];_0x4bae53+=0x1){if(_0x21e0e6[_0x4bae53][_0xaf0b('0x2b')]&&_0x21e0e6[_0x4bae53][_0xaf0b('0x2c')]){_0x3a4820['addEdge'](_0x21e0e6[_0x4bae53][_0xaf0b('0x2b')],_0x21e0e6[_0x4bae53][_0xaf0b('0x2c')],_0x21e0e6[_0x4bae53][_0xaf0b('0x2d')]);}}return _0x3a4820;}function getSquareProject(_0x3fb9ce,_0x2f0b81){rpc[_0xaf0b('0x2e')](_0x3fb9ce)[_0xaf0b('0x2f')](function(_0x5c720b){_0x2f0b81(null,_0x5c720b);})[_0xaf0b('0x30')](function(_0x40f45d){_0x2f0b81(null,_0x40f45d);});}function createSquareReport(_0x4beee6,_0x26af15){rpc[_0xaf0b('0x31')](_0x4beee6)[_0xaf0b('0x2f')](function(_0x3fbfab){if(_0x26af15){_0x26af15(null,_0x3fbfab);}})[_0xaf0b('0x30')](function(_0x28d0a3){if(_0x26af15){_0x26af15(null,_0x28d0a3);}});}function setChannelVariables(_0x3d6112){for(var _0x4031d4 in _0x3d6112){if(_0x3d6112[_0xaf0b('0x24')](_0x4031d4)){if(_0x4031d4['indexOf'](_0xaf0b('0x32'))===0x0){_0x3d6112[_0x4031d4['substring'](0x4)]=_0x3d6112[_0x4031d4];delete _0x3d6112[_0x4031d4];}}}}function getLogFromObject(_0x49b691){return util['inspect'](_0x49b691,{'showHidden':![],'depth':null});}function agiHandler(_0x1d6771){var _0x3b0f51,_0x270195,_0x472301,_0x18da8d,_0x460e37;logger['debug'](_0xaf0b('0x33'),JSON[_0xaf0b('0x34')](_0x1d6771,null,0x2));logger[_0xaf0b('0xf')](util[_0xaf0b('0x10')](_0xaf0b('0x35'),_0x1d6771[_0xaf0b('0x18')],_0x1d6771[_0xaf0b('0x19')],_0x1d6771[_0xaf0b('0x1a')],_0x1d6771[_0xaf0b('0x1d')],_0x1d6771[_0xaf0b('0x1b')]));_0x1d6771['on']('error',errorHandler);_0x1d6771['on'](_0xaf0b('0x36'),closeHandler);_0x1d6771['on']('timeout',timeoutHandler);_0x1d6771[_0xaf0b('0x1f')]=![];_0x1d6771['on']('hangup',hangupHandler);var _0x1f429d=getSquareProject['sync'](null,_0x1d6771[_0xaf0b('0x18')]);if(_0x1f429d){if(_0x1f429d[_0xaf0b('0x37')]){_0x3b0f51=getRoot(_0x1f429d[_0xaf0b('0x37')]);if(_0x3b0f51&&_0x3b0f51[_0xaf0b('0x38')]){logger[_0xaf0b('0x39')](_0xaf0b('0x22'),JSON[_0xaf0b('0x34')](_0x3b0f51,null,0x2));_0x1d6771['joinAt']=moment()[_0xaf0b('0x10')](_0xaf0b('0x3a'));_0x270195=initGraph(_[_0xaf0b('0x28')](_0x3b0f51,_0xaf0b('0x3b')),_0x3b0f51['mxCell']);_0x472301=new Vertices(_0x1d6771,rpc,mailRpc);logger[_0xaf0b('0xf')](util[_0xaf0b('0x10')](_0xaf0b('0x3c'),_0x1d6771[_0xaf0b('0x18')],_0x1d6771[_0xaf0b('0x19')],_0x1d6771['callerid'],_0x1d6771[_0xaf0b('0x1d')],_0x1d6771[_0xaf0b('0x1b')]));_0x270195[_0xaf0b('0x3d')](_0x3b0f51[_0xaf0b('0x38')]['id'],function(_0x185d64){try{_0x185d64=_0x472301[_0xaf0b('0x3e')](_0x185d64);logger[_0xaf0b('0x39')]('vertex',JSON[_0xaf0b('0x34')](_0x185d64,null,0x2));if(_0x185d64['agicommand']===_0xaf0b('0x3f')){logger[_0xaf0b('0xf')](_0xaf0b('0x40'));_0x1d6771[_0xaf0b('0x41')]=_0x185d64[_0xaf0b('0x41')]||_0x1d6771[_0xaf0b('0x41')];_0x1d6771[_0xaf0b('0x42')]=_0x185d64[_0xaf0b('0x42')];_0x1d6771[_0xaf0b('0x43')]=_0x185d64['priority']?_0x185d64[_0xaf0b('0x43')]-0x1:0x1;return null;}else if(_0x185d64&&_0x472301[_0x185d64[_0xaf0b('0x23')]]){_0x460e37=_0x472301[_0x185d64[_0xaf0b('0x23')]](_0x185d64);logger[_0xaf0b('0xf')](_0xaf0b('0x44'),JSON['stringify'](_0x460e37,null,0x2));if(_0x460e37&&_0x460e37[_0xaf0b('0x45')]===AGI_CODE_SUCCESS&&_0x460e37['result']!==AGI_RESULT_ERROR&&!_0x1d6771[_0xaf0b('0x1f')]){logger[_0xaf0b('0x39')](_0xaf0b('0x44'),getLogFromObject(_0x460e37));return _[_0xaf0b('0x46')](_0x460e37[_0xaf0b('0x47')])?null:_0x460e37[_0xaf0b('0x47')][_0xaf0b('0x48')]();}else{logger[_0xaf0b('0xc')](_0xaf0b('0x44'),getLogFromObject(_0x460e37));return null;}}else{logger['error'](_0xaf0b('0x49'));return null;}}catch(_0x3fa620){logger['error'](_0x3fa620[_0xaf0b('0xd')]);return null;}});if(_0x3b0f51[_0xaf0b('0x4a')]){logger[_0xaf0b('0xf')](util[_0xaf0b('0x10')](_0xaf0b('0x4b'),_0x1d6771[_0xaf0b('0x18')],_0x1d6771[_0xaf0b('0x19')],_0x1d6771[_0xaf0b('0x1a')],_0x1d6771[_0xaf0b('0x1d')],_0x1d6771[_0xaf0b('0x1b')]));_0x270195[_0xaf0b('0x3d')](_0x3b0f51['finally']['id'],function(_0x1ecb67){try{_0x1ecb67=_0x472301[_0xaf0b('0x3e')](_0x1ecb67);logger[_0xaf0b('0x39')](_0xaf0b('0x4c'),JSON[_0xaf0b('0x34')](_0x1ecb67,null,0x2));if(_0x1ecb67&&_0x472301[_0x1ecb67[_0xaf0b('0x23')]]){_0x460e37=_0x472301[_0x1ecb67[_0xaf0b('0x23')]](_0x1ecb67);if(_0x460e37){logger[_0xaf0b('0x39')](_0xaf0b('0x44'),getLogFromObject(_0x460e37));return _['isUndefined'](_0x460e37[_0xaf0b('0x47')])?null:_0x460e37['result'][_0xaf0b('0x48')]();}else{logger[_0xaf0b('0xc')](_0xaf0b('0x44'),getLogFromObject(_0x460e37));return null;}}else{logger[_0xaf0b('0xc')](_0xaf0b('0x49'));return null;}}catch(_0x2d865f){logger['error'](_0x2d865f[_0xaf0b('0xd')]);return null;}});}logger[_0xaf0b('0xf')](util[_0xaf0b('0x10')](_0xaf0b('0x4d'),_0x1d6771[_0xaf0b('0x18')],_0x1d6771[_0xaf0b('0x19')],_0x1d6771['callerid'],_0x1d6771[_0xaf0b('0x1d')],_0x1d6771[_0xaf0b('0x1b')]));logger[_0xaf0b('0xf')](util[_0xaf0b('0x10')](_0xaf0b('0x4e'),_0x1d6771[_0xaf0b('0x41')],_0x1d6771[_0xaf0b('0x42')],parseInt(_0x1d6771['priority'],0xa)+0x1));_0x1d6771[_0xaf0b('0x4f')](_0x1d6771[_0xaf0b('0x41')],_0x1d6771[_0xaf0b('0x42')],parseInt(_0x1d6771['priority'],0xa)+0x1);_0x1d6771[_0xaf0b('0x36')]();}}else{logger['error'](util[_0xaf0b('0x10')](_0xaf0b('0x50'),_0x1d6771[_0xaf0b('0x18')]));_0x1d6771[_0xaf0b('0x4f')](_0x1d6771['context'],_0x1d6771[_0xaf0b('0x42')],parseInt(_0x1d6771[_0xaf0b('0x43')],0xa)+0x1);_0x1d6771[_0xaf0b('0x36')]();}}else{logger[_0xaf0b('0xc')](util[_0xaf0b('0x10')](_0xaf0b('0x51'),_0x1d6771[_0xaf0b('0x18')]));_0x1d6771[_0xaf0b('0x4f')](_0x1d6771[_0xaf0b('0x41')],_0x1d6771['extension'],parseInt(_0x1d6771[_0xaf0b('0x43')],0xa)+0x1);_0x1d6771['close']();}}function main(){var _0x23ecfb;return utilLicense[_0xaf0b('0x52')]()['then'](function(_0x5e6d85){if(_0x5e6d85){if(_0x5e6d85[_0xaf0b('0x53')]){if(_0x5e6d85[_0xaf0b('0x54')]&&_0x5e6d85['callysquare']>0x0){logger[_0xaf0b('0xf')](util['format'](_0xaf0b('0x55'),_0x5e6d85[_0xaf0b('0x54')]));_0x23ecfb=_0x5e6d85[_0xaf0b('0x54')];}else{logger['info'](_0xaf0b('0x56'));}}else{logger[_0xaf0b('0xf')](_0xaf0b('0x57'));_0x23ecfb=-0x1;}}})[_0xaf0b('0x30')](function(_0x29ea6b){logger['error'](_0xaf0b('0x58'),_0x29ea6b[_0xaf0b('0xd')]);})['finally'](function(){var _0x31b0b7=require(_0xaf0b('0x59'))(config[_0xaf0b('0x6')][_0xaf0b('0x12')],config[_0xaf0b('0x6')]['ip'],_0x23ecfb);_0x31b0b7['on'](_0xaf0b('0xc'),errorHandler);_0x31b0b7['on'](_0xaf0b('0x5a'),listeningHandler);_0x31b0b7['on'](_0xaf0b('0x5b'),connectionHandler);_0x31b0b7['on'](_0xaf0b('0x36'),closeHandler);});}main(); \ No newline at end of file +var _0x6921=['isUndefined','toString','agicommand\x20not\x20found','finally','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','clear','[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','close','Project\x20%s\x20not\x20found','getLicense','voice','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]\x20VOICE\x20IS\x20DISABLED','[LICENSE]','./server','listening','lodash','util','../../config/environment','../../config/logger','../../config/license/util','./mailRpc','./graph','./vertices','agi','defaults','127.0.0.1','nextTick','error','log','port','info','format','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','name','message','[ERROR]\x20%s','stack','arg_1','callerid','uniqueid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','calleridname','dnid','evtHangup','toJson','mxGraphModel','root','agicommand','addVertex','mxCell','hasOwnProperty','length','addEdge','source','target','value','then','catch','createSquareReport','indexOf','substring','inspect','debug','variables','stringify','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','timeout','hangup','sync','production','joinAt','YYYY-MM-DD\x20HH:mm:ss','omit','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','start','vertex','gotoc','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','response','code','result'];(function(_0x4af4db,_0x55e703){var _0x370f71=function(_0x4dab6d){while(--_0x4dab6d){_0x4af4db['push'](_0x4af4db['shift']());}};_0x370f71(++_0x55e703);}(_0x6921,0x1d1));var _0x1692=function(_0xceb788,_0x258655){_0xceb788=_0xceb788-0x0;var _0x1e81fc=_0x6921[_0xceb788];return _0x1e81fc;};'use strict';var parser=require('xml2json');var _=require(_0x1692('0x0'));var syncho=require('syncho');var util=require(_0x1692('0x1'));var moment=require('moment');var config=require(_0x1692('0x2'));var logger=require(_0x1692('0x3'))('agi');var utilLicense=require(_0x1692('0x4'));var rpc=require('./rpc');var mailRpc=require(_0x1692('0x5'));var Graph=require(_0x1692('0x6'));var Vertices=require(_0x1692('0x7'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config[_0x1692('0x8')]=_[_0x1692('0x9')](config[_0x1692('0x8')],{'ip':_0x1692('0xa'),'port':0x11dd});function connectionHandler(_0x3ffe29){process[_0x1692('0xb')](function(){syncho(function(){try{setChannelVariables(_0x3ffe29);agiHandler(_0x3ffe29);}catch(_0x38159b){logger[_0x1692('0xc')](_0x38159b['stack']);}});});}function listeningHandler(){console[_0x1692('0xd')]('Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!',config[_0x1692('0x8')][_0x1692('0xe')]);logger[_0x1692('0xf')](util[_0x1692('0x10')](_0x1692('0x11'),config[_0x1692('0x8')]['ip'],config['agi'][_0x1692('0xe')]));}function errorHandler(_0x3b6fba){if(_0x3b6fba&&_0x3b6fba[_0x1692('0x12')]&&_0x3b6fba[_0x1692('0x13')]){logger[_0x1692('0xc')](util[_0x1692('0x10')]('[%s]\x20%s',_0x3b6fba[_0x1692('0x12')],_0x3b6fba[_0x1692('0x13')]));}else{logger[_0x1692('0xc')](util[_0x1692('0x10')](_0x1692('0x14'),_0x3b6fba[_0x1692('0x15')]));}}function closeHandler(){logger[_0x1692('0xf')](util[_0x1692('0x10')]('[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0x1692('0x16')],this['calleridname'],this[_0x1692('0x17')],this['dnid'],this[_0x1692('0x18')]));try{createSquareReport(this);}catch(_0x28db17){logger[_0x1692('0xc')](_0x28db17['stack']);}}function timeoutHandler(){logger['info'](util[_0x1692('0x10')](_0x1692('0x19'),this['arg_1'],this[_0x1692('0x1a')],this['callerid'],this[_0x1692('0x1b')],this['uniqueid']));}function hangupHandler(){logger['info'](util[_0x1692('0x10')]('[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0x1692('0x16')],this[_0x1692('0x1a')],this[_0x1692('0x17')],this['dnid'],this[_0x1692('0x18')]));this[_0x1692('0x1c')]=!![];}function getRoot(_0x477e9d){return parser[_0x1692('0x1d')](_0x477e9d,{'object':!![]})[_0x1692('0x1e')][_0x1692('0x1f')];}function addVertex(_0x4146af,_0x4e76ff,_0x35ecc8){_0x4e76ff[_0x1692('0x20')]=_0x35ecc8;if(_0x4e76ff['hasOwnProperty']('retry')){_0x4e76ff['maxRetry']=parseInt(_0x4e76ff['retry'],0xa);}_0x4146af[_0x1692('0x21')](_['omit'](_0x4e76ff,_0x1692('0x22')));}function initGraph(_0xf78abe,_0x101c9e){var _0x1d6dac=new Graph();for(var _0xcf9e1f in _0xf78abe){if(_0xf78abe[_0x1692('0x23')](_0xcf9e1f)){if(_['isArray'](_0xf78abe[_0xcf9e1f])){for(var _0x1a6708=0x0;_0x1a6708<_0xf78abe[_0xcf9e1f][_0x1692('0x24')];_0x1a6708+=0x1){addVertex(_0x1d6dac,_0xf78abe[_0xcf9e1f][_0x1a6708],_0xcf9e1f);}}else{addVertex(_0x1d6dac,_0xf78abe[_0xcf9e1f],_0xcf9e1f);}}}for(var _0x429687=0x0;_0x429687<_0x101c9e[_0x1692('0x24')];_0x429687+=0x1){if(_0x101c9e[_0x429687]['source']&&_0x101c9e[_0x429687]['target']){_0x1d6dac[_0x1692('0x25')](_0x101c9e[_0x429687][_0x1692('0x26')],_0x101c9e[_0x429687][_0x1692('0x27')],_0x101c9e[_0x429687][_0x1692('0x28')]);}}return _0x1d6dac;}function getSquareProject(_0x4a2dba,_0x5341c8){rpc['getSquareProject'](_0x4a2dba)[_0x1692('0x29')](function(_0x274dba){_0x5341c8(null,_0x274dba);})[_0x1692('0x2a')](function(_0x3fd03f){_0x5341c8(null,_0x3fd03f);});}function createSquareReport(_0x1442d6,_0x44499f){rpc[_0x1692('0x2b')](_0x1442d6)[_0x1692('0x29')](function(_0x5eb05b){if(_0x44499f){_0x44499f(null,_0x5eb05b);}})[_0x1692('0x2a')](function(_0x56a6c5){if(_0x44499f){_0x44499f(null,_0x56a6c5);}});}function setChannelVariables(_0x164753){for(var _0x1f0739 in _0x164753){if(_0x164753[_0x1692('0x23')](_0x1f0739)){if(_0x1f0739[_0x1692('0x2c')]('agi_')===0x0){_0x164753[_0x1f0739[_0x1692('0x2d')](0x4)]=_0x164753[_0x1f0739];delete _0x164753[_0x1f0739];}}}}function getLogFromObject(_0x104874){return util[_0x1692('0x2e')](_0x104874,{'showHidden':![],'depth':null});}function agiHandler(_0x2cc16f){var _0x14c25f,_0x426253,_0x5d466e,_0xcb0709,_0x728e37;logger[_0x1692('0x2f')](_0x1692('0x30'),JSON[_0x1692('0x31')](_0x2cc16f,null,0x2));logger[_0x1692('0xf')](util[_0x1692('0x10')](_0x1692('0x32'),_0x2cc16f[_0x1692('0x16')],_0x2cc16f[_0x1692('0x1a')],_0x2cc16f[_0x1692('0x17')],_0x2cc16f[_0x1692('0x1b')],_0x2cc16f[_0x1692('0x18')]));_0x2cc16f['on'](_0x1692('0xc'),errorHandler);_0x2cc16f['on']('close',closeHandler);_0x2cc16f['on'](_0x1692('0x33'),timeoutHandler);_0x2cc16f[_0x1692('0x1c')]=![];_0x2cc16f['on'](_0x1692('0x34'),hangupHandler);var _0x4b9968=getSquareProject[_0x1692('0x35')](null,_0x2cc16f[_0x1692('0x16')]);if(_0x4b9968){if(_0x4b9968[_0x1692('0x36')]){_0x14c25f=getRoot(_0x4b9968['production']);if(_0x14c25f&&_0x14c25f['start']){logger['debug'](_0x1692('0x1f'),JSON[_0x1692('0x31')](_0x14c25f,null,0x2));_0x2cc16f[_0x1692('0x37')]=moment()[_0x1692('0x10')](_0x1692('0x38'));_0x426253=initGraph(_[_0x1692('0x39')](_0x14c25f,_0x1692('0x22')),_0x14c25f[_0x1692('0x22')]);_0x5d466e=new Vertices(_0x2cc16f,rpc,mailRpc);logger[_0x1692('0xf')](util[_0x1692('0x10')](_0x1692('0x3a'),_0x2cc16f[_0x1692('0x16')],_0x2cc16f['calleridname'],_0x2cc16f[_0x1692('0x17')],_0x2cc16f[_0x1692('0x1b')],_0x2cc16f[_0x1692('0x18')]));_0x426253['traverseBFS'](_0x14c25f[_0x1692('0x3b')]['id'],function(_0x2e0771){try{_0x2e0771=_0x5d466e['clear'](_0x2e0771);logger[_0x1692('0x2f')](_0x1692('0x3c'),JSON[_0x1692('0x31')](_0x2e0771,null,0x2));if(_0x2e0771['agicommand']===_0x1692('0x3d')){logger[_0x1692('0xf')](_0x1692('0x3e'));_0x2cc16f[_0x1692('0x3f')]=_0x2e0771[_0x1692('0x3f')]||_0x2cc16f[_0x1692('0x3f')];_0x2cc16f[_0x1692('0x40')]=_0x2e0771[_0x1692('0x40')];_0x2cc16f[_0x1692('0x41')]=_0x2e0771[_0x1692('0x41')]?_0x2e0771[_0x1692('0x41')]-0x1:0x1;return null;}else if(_0x2e0771&&_0x5d466e[_0x2e0771[_0x1692('0x20')]]){_0x728e37=_0x5d466e[_0x2e0771[_0x1692('0x20')]](_0x2e0771);logger[_0x1692('0xf')](_0x1692('0x42'),JSON[_0x1692('0x31')](_0x728e37,null,0x2));if(_0x728e37&&_0x728e37[_0x1692('0x43')]===AGI_CODE_SUCCESS&&_0x728e37[_0x1692('0x44')]!==AGI_RESULT_ERROR&&!_0x2cc16f[_0x1692('0x1c')]){logger[_0x1692('0x2f')](_0x1692('0x42'),getLogFromObject(_0x728e37));return _[_0x1692('0x45')](_0x728e37[_0x1692('0x44')])?null:_0x728e37['result'][_0x1692('0x46')]();}else{logger['error'](_0x1692('0x42'),getLogFromObject(_0x728e37));return null;}}else{logger[_0x1692('0xc')](_0x1692('0x47'));return null;}}catch(_0x2004ff){logger['error'](_0x2004ff[_0x1692('0x15')]);return null;}});if(_0x14c25f[_0x1692('0x48')]){logger[_0x1692('0xf')](util[_0x1692('0x10')](_0x1692('0x49'),_0x2cc16f[_0x1692('0x16')],_0x2cc16f[_0x1692('0x1a')],_0x2cc16f[_0x1692('0x17')],_0x2cc16f[_0x1692('0x1b')],_0x2cc16f[_0x1692('0x18')]));_0x426253['traverseBFS'](_0x14c25f['finally']['id'],function(_0x258419){try{_0x258419=_0x5d466e[_0x1692('0x4a')](_0x258419);logger[_0x1692('0x2f')](_0x1692('0x3c'),JSON[_0x1692('0x31')](_0x258419,null,0x2));if(_0x258419&&_0x5d466e[_0x258419[_0x1692('0x20')]]){_0x728e37=_0x5d466e[_0x258419['agicommand']](_0x258419);if(_0x728e37){logger['debug']('response',getLogFromObject(_0x728e37));return _[_0x1692('0x45')](_0x728e37[_0x1692('0x44')])?null:_0x728e37[_0x1692('0x44')][_0x1692('0x46')]();}else{logger[_0x1692('0xc')]('response',getLogFromObject(_0x728e37));return null;}}else{logger['error'](_0x1692('0x47'));return null;}}catch(_0x52cf9d){logger[_0x1692('0xc')](_0x52cf9d[_0x1692('0x15')]);return null;}});}logger['info'](util[_0x1692('0x10')](_0x1692('0x4b'),_0x2cc16f[_0x1692('0x16')],_0x2cc16f[_0x1692('0x1a')],_0x2cc16f[_0x1692('0x17')],_0x2cc16f[_0x1692('0x1b')],_0x2cc16f[_0x1692('0x18')]));logger[_0x1692('0xf')](util[_0x1692('0x10')](_0x1692('0x4c'),_0x2cc16f[_0x1692('0x3f')],_0x2cc16f[_0x1692('0x40')],parseInt(_0x2cc16f['priority'],0xa)+0x1));_0x2cc16f[_0x1692('0x4d')](_0x2cc16f[_0x1692('0x3f')],_0x2cc16f[_0x1692('0x40')],parseInt(_0x2cc16f[_0x1692('0x41')],0xa)+0x1);_0x2cc16f[_0x1692('0x4e')]();}}else{logger[_0x1692('0xc')](util['format']('Project\x20%s\x20not\x20published',_0x2cc16f[_0x1692('0x16')]));_0x2cc16f[_0x1692('0x4d')](_0x2cc16f['context'],_0x2cc16f[_0x1692('0x40')],parseInt(_0x2cc16f[_0x1692('0x41')],0xa)+0x1);_0x2cc16f['close']();}}else{logger[_0x1692('0xc')](util[_0x1692('0x10')](_0x1692('0x4f'),_0x2cc16f[_0x1692('0x16')]));_0x2cc16f['continueAt'](_0x2cc16f[_0x1692('0x3f')],_0x2cc16f[_0x1692('0x40')],parseInt(_0x2cc16f[_0x1692('0x41')],0xa)+0x1);_0x2cc16f[_0x1692('0x4e')]();}}function main(){var _0x1cb4e3;return utilLicense[_0x1692('0x50')]()['then'](function(_0x314e02){if(_0x314e02){if(_0x314e02[_0x1692('0x51')]){if(_0x314e02['callysquare']&&_0x314e02[_0x1692('0x52')]>0x0){logger['info'](util[_0x1692('0x10')](_0x1692('0x53'),_0x314e02[_0x1692('0x52')]));_0x1cb4e3=_0x314e02['callysquare'];}else{logger[_0x1692('0xf')](_0x1692('0x54'));}}else{logger[_0x1692('0xf')](_0x1692('0x55'));_0x1cb4e3=-0x1;}}})['catch'](function(_0xae2489){logger['error'](_0x1692('0x56'),_0xae2489[_0x1692('0x15')]);})['finally'](function(){var _0x5b3013=require(_0x1692('0x57'))(config[_0x1692('0x8')][_0x1692('0xe')],config['agi']['ip'],_0x1cb4e3);_0x5b3013['on'](_0x1692('0xc'),errorHandler);_0x5b3013['on'](_0x1692('0x58'),listeningHandler);_0x5b3013['on']('connection',connectionHandler);_0x5b3013['on'](_0x1692('0x4e'),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 1163e1a..5a3ccde 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 _0x814b=['bluebird','jayson/promise','client','http','request','then','error','result','catch','sendMailMessage','SendMail'];(function(_0x55f0f8,_0x38753b){var _0x2df22b=function(_0x1ccf50){while(--_0x1ccf50){_0x55f0f8['push'](_0x55f0f8['shift']());}};_0x2df22b(++_0x38753b);}(_0x814b,0x1a2));var _0xb814=function(_0x12012d,_0x46e1f6){_0x12012d=_0x12012d-0x0;var _0x2ccaf1=_0x814b[_0x12012d];return _0x2ccaf1;};'use strict';var BPromise=require(_0xb814('0x0'));var jayson=require(_0xb814('0x1'));var client=jayson[_0xb814('0x2')][_0xb814('0x3')]({'port':0x232b});function request(_0xfbb64b,_0x477725){return new BPromise(function(_0x4a98af,_0x38c21a){return client[_0xb814('0x4')](_0xfbb64b,_0x477725)[_0xb814('0x5')](function(_0x4237bc){if(_0x4237bc[_0xb814('0x6')]){return _0x38c21a(_0x4237bc[_0xb814('0x6')]['message']);}else{return _0x4a98af(_0x4237bc[_0xb814('0x7')]);}})[_0xb814('0x8')](function(_0x5c8539){return _0x38c21a(_0x5c8539);});});}exports[_0xb814('0x9')]=function(_0x2913a6,_0x186d5a){return request(_0xb814('0xa'),{'account':_0x2913a6,'message':_0x186d5a});}; \ No newline at end of file +var _0x34e8=['catch','sendMailMessage','SendMail','bluebird','jayson/promise','client','http','request','then','error','message'];(function(_0x2816e,_0x4bb5f0){var _0x664a3e=function(_0x3215a6){while(--_0x3215a6){_0x2816e['push'](_0x2816e['shift']());}};_0x664a3e(++_0x4bb5f0);}(_0x34e8,0x12c));var _0x834e=function(_0x42872b,_0x1a0ec2){_0x42872b=_0x42872b-0x0;var _0x24e821=_0x34e8[_0x42872b];return _0x24e821;};'use strict';var BPromise=require(_0x834e('0x0'));var jayson=require(_0x834e('0x1'));var client=jayson[_0x834e('0x2')][_0x834e('0x3')]({'port':0x232b});function request(_0x530939,_0x832422){return new BPromise(function(_0x21e2e0,_0x472111){return client[_0x834e('0x4')](_0x530939,_0x832422)[_0x834e('0x5')](function(_0x19a3e0){if(_0x19a3e0[_0x834e('0x6')]){return _0x472111(_0x19a3e0['error'][_0x834e('0x7')]);}else{return _0x21e2e0(_0x19a3e0['result']);}})[_0x834e('0x8')](function(_0x3cc2e3){return _0x472111(_0x3cc2e3);});});}exports[_0x834e('0x9')]=function(_0x2e69e2,_0x33ea05){return request(_0x834e('0xa'),{'account':_0x2e69e2,'message':_0x33ea05});}; \ No newline at end of file diff --git a/server/services/agi/reply.js b/server/services/agi/reply.js index 1c2cbff..d2618b4 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 _0x7a54=['substring','length','split','indexOf','slice','trim','emit','util','stream','Transform','call','_localBuffer','inherits','prototype','_transform','toString','_inBody'];(function(_0x509b2d,_0x47cee9){var _0x28b1bf=function(_0x5870bf){while(--_0x5870bf){_0x509b2d['push'](_0x509b2d['shift']());}};_0x28b1bf(++_0x47cee9);}(_0x7a54,0x106));var _0x47a5=function(_0x5ac4cc,_0x3a2a95){_0x5ac4cc=_0x5ac4cc-0x0;var _0x13c7ac=_0x7a54[_0x5ac4cc];return _0x13c7ac;};'use strict';var util=require(_0x47a5('0x0'));var Transform=require(_0x47a5('0x1'))[_0x47a5('0x2')];function AGIReply(_0x58157c){Transform[_0x47a5('0x3')](this,_0x58157c);this[_0x47a5('0x4')]='';this['_inBody']=![];}util[_0x47a5('0x5')](AGIReply,Transform);AGIReply[_0x47a5('0x6')][_0x47a5('0x7')]=function(_0x3717e1,_0xfdf934,_0x545a97){var _0x3d5629='\x0a',_0x59199c=['\x0a\x0a','\x0d\x0a\x0d\x0a'],_0x343372=-0x1,_0x30e405=-0x1,_0x506eda='',_0x194fb0=0x0,_0x5077f3='',_0x5d90b3='';this[_0x47a5('0x4')]+=_0x3717e1[_0x47a5('0x8')]();_0x5077f3=this['_localBuffer'];if(!this[_0x47a5('0x9')]){_0x194fb0=0x0;while(_0x59199c[_0x194fb0]){while((_0x30e405=_0x5077f3['indexOf'](_0x59199c[_0x194fb0]))!=-0x1){_0x506eda=_0x59199c[_0x194fb0];_0x5d90b3=_0x5077f3['substring'](0x0,_0x30e405);_0x5077f3=_0x5077f3[_0x47a5('0xa')](_0x30e405+_0x506eda[_0x47a5('0xb')]);var _0x2f399b=_0x5d90b3[_0x47a5('0xc')](_0x3d5629),_0x250fad=0x0,_0xd612dd={},_0xd308b8='',_0x1eae59='',_0x5beb89=-0x1;while(_0x2f399b[_0x250fad]){_0x5beb89=_0x2f399b[_0x250fad][_0x47a5('0xd')](':');if(_0x5beb89!=-0x1){_0xd308b8=_0x2f399b[_0x250fad][_0x47a5('0xe')](0x0,_0x5beb89)[_0x47a5('0xf')]();_0x1eae59=_0x2f399b[_0x250fad][_0x47a5('0xe')](_0x5beb89+0x1)[_0x47a5('0xf')]();if(_0xd308b8[_0x47a5('0xb')]>0x0){_0xd612dd[_0xd308b8]=_0x1eae59;}}else{}_0x250fad++;}this[_0x47a5('0x10')]('headers',_0xd612dd);this[_0x47a5('0x9')]=!![];}_0x194fb0++;}this[_0x47a5('0x4')]=_0x5077f3;}else{while((_0x343372=_0x5077f3[_0x47a5('0xd')](_0x3d5629))!=-0x1){_0x5d90b3=_0x5077f3[_0x47a5('0xa')](0x0,_0x343372);this[_0x47a5('0x10')]('line',_0x5d90b3);_0x5077f3=_0x5077f3['substring'](_0x343372+_0x3d5629[_0x47a5('0xb')]);}this['_localBuffer']=_0x5077f3;}_0x545a97();};module['exports']=AGIReply; \ No newline at end of file +var _0x7a54=['substring','length','split','indexOf','slice','trim','emit','util','stream','Transform','call','_localBuffer','inherits','prototype','_transform','toString','_inBody'];(function(_0xd47a72,_0x42387c){var _0x24f993=function(_0x30e52f){while(--_0x30e52f){_0xd47a72['push'](_0xd47a72['shift']());}};_0x24f993(++_0x42387c);}(_0x7a54,0x106));var _0x47a5=function(_0x4b3748,_0x4d7d09){_0x4b3748=_0x4b3748-0x0;var _0x2f4be0=_0x7a54[_0x4b3748];return _0x2f4be0;};'use strict';var util=require(_0x47a5('0x0'));var Transform=require(_0x47a5('0x1'))[_0x47a5('0x2')];function AGIReply(_0x58157c){Transform[_0x47a5('0x3')](this,_0x58157c);this[_0x47a5('0x4')]='';this['_inBody']=![];}util[_0x47a5('0x5')](AGIReply,Transform);AGIReply[_0x47a5('0x6')][_0x47a5('0x7')]=function(_0x3717e1,_0xfdf934,_0x545a97){var _0x3d5629='\x0a',_0x59199c=['\x0a\x0a','\x0d\x0a\x0d\x0a'],_0x343372=-0x1,_0x30e405=-0x1,_0x506eda='',_0x194fb0=0x0,_0x5077f3='',_0x5d90b3='';this[_0x47a5('0x4')]+=_0x3717e1[_0x47a5('0x8')]();_0x5077f3=this['_localBuffer'];if(!this[_0x47a5('0x9')]){_0x194fb0=0x0;while(_0x59199c[_0x194fb0]){while((_0x30e405=_0x5077f3['indexOf'](_0x59199c[_0x194fb0]))!=-0x1){_0x506eda=_0x59199c[_0x194fb0];_0x5d90b3=_0x5077f3['substring'](0x0,_0x30e405);_0x5077f3=_0x5077f3[_0x47a5('0xa')](_0x30e405+_0x506eda[_0x47a5('0xb')]);var _0x2f399b=_0x5d90b3[_0x47a5('0xc')](_0x3d5629),_0x250fad=0x0,_0xd612dd={},_0xd308b8='',_0x1eae59='',_0x5beb89=-0x1;while(_0x2f399b[_0x250fad]){_0x5beb89=_0x2f399b[_0x250fad][_0x47a5('0xd')](':');if(_0x5beb89!=-0x1){_0xd308b8=_0x2f399b[_0x250fad][_0x47a5('0xe')](0x0,_0x5beb89)[_0x47a5('0xf')]();_0x1eae59=_0x2f399b[_0x250fad][_0x47a5('0xe')](_0x5beb89+0x1)[_0x47a5('0xf')]();if(_0xd308b8[_0x47a5('0xb')]>0x0){_0xd612dd[_0xd308b8]=_0x1eae59;}}else{}_0x250fad++;}this[_0x47a5('0x10')]('headers',_0xd612dd);this[_0x47a5('0x9')]=!![];}_0x194fb0++;}this[_0x47a5('0x4')]=_0x5077f3;}else{while((_0x343372=_0x5077f3[_0x47a5('0xd')](_0x3d5629))!=-0x1){_0x5d90b3=_0x5077f3[_0x47a5('0xa')](0x0,_0x343372);this[_0x47a5('0x10')]('line',_0x5d90b3);_0x5077f3=_0x5077f3['substring'](_0x343372+_0x3d5629[_0x47a5('0xb')]);}this['_localBuffer']=_0x5077f3;}_0x545a97();};module['exports']=AGIReply; \ No newline at end of file diff --git a/server/services/agi/rpc/index.js b/server/services/agi/rpc/index.js index 8a8e7d2..68beb61 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 _0x05c8=['createSquareMessage','phone','ListId','CreateCmContact','getPauseById','ShowPause','LoginUser','agentPause','PauseUser','agentUnpause','UnpauseUser','agentLogout','LogoutUser','bluebird','util','client','request','then','error','message','result','catch','getSquareProject','ShowSquareProject','production','getMailAccountById','ShowMailAccount','MailServerOut','Smtp','name','getSquareProjectById','ShowVoiceQueue','getVariableById','ShowVariable','getSquareOdbcById','dsn','ShowUser','ShowTrunk','getSoundById','save_name','getIntervalById','ShowInterval','Intervals','createSmsMessage','CreateSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','createSquareReport','CreateSquareReport','arg_1','arg_2','format','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','CreateSquareRecording'];(function(_0x245b74,_0x2280f7){var _0x355481=function(_0x555ccb){while(--_0x555ccb){_0x245b74['push'](_0x245b74['shift']());}};_0x355481(++_0x2280f7);}(_0x05c8,0x7b));var _0x805c=function(_0x3ab772,_0x1af6e5){_0x3ab772=_0x3ab772-0x0;var _0x19cd95=_0x05c8[_0x3ab772];return _0x19cd95;};'use strict';var BPromise=require(_0x805c('0x0'));var moment=require('moment');var _=require('lodash');var util=require(_0x805c('0x1'));var jayson=require('jayson/promise');var client=jayson[_0x805c('0x2')]['http']({'port':0x2329});function request(_0x17bde8,_0x122cca){return new BPromise(function(_0x45b353,_0x3671a5){return client[_0x805c('0x3')](_0x17bde8,_0x122cca)[_0x805c('0x4')](function(_0x3c828b){if(_0x3c828b[_0x805c('0x5')]){return _0x3671a5(_0x3c828b['error'][_0x805c('0x6')]);}else{return _0x45b353(_0x3c828b[_0x805c('0x7')]);}})[_0x805c('0x8')](function(_0x11f255){return _0x3671a5(_0x11f255);});});}exports[_0x805c('0x9')]=function(_0x511074){return request(_0x805c('0xa'),{'options':{'raw':![],'where':{'name':_0x511074},'attributes':[_0x805c('0xb')]}});};exports[_0x805c('0xc')]=function(_0x380ba4){return request(_0x805c('0xd'),{'options':{'raw':![],'where':{'id':_0x380ba4},'include':[{'model':_0x805c('0xe'),'as':_0x805c('0xf')}],'attributes':['id',_0x805c('0x10'),'email']}});};exports[_0x805c('0x11')]=function(_0x574d25){return request(_0x805c('0xa'),{'options':{'where':{'id':_0x574d25},'attributes':[_0x805c('0x10')]}});};exports['getVoiceQueueById']=function(_0x25e729){return request(_0x805c('0x12'),{'options':{'where':{'id':_0x25e729},'attributes':['name']}});};exports[_0x805c('0x13')]=function(_0x129f62){return request(_0x805c('0x14'),{'options':{'where':{'id':_0x129f62},'attributes':[_0x805c('0x10')]}});};exports[_0x805c('0x15')]=function(_0x307e3c){return request('ShowSquareOdbc',{'options':{'where':{'id':_0x307e3c},'attributes':[_0x805c('0x16')]}});};exports['getUserById']=function(_0x210a49){return request(_0x805c('0x17'),{'options':{'where':{'id':_0x210a49},'attributes':[_0x805c('0x10')]}});};exports['getTrunkById']=function(_0x2b9642){return request(_0x805c('0x18'),{'options':{'where':{'id':_0x2b9642},'attributes':[_0x805c('0x10')]}});};exports[_0x805c('0x19')]=function(_0x5f9c09){return request('ShowSound',{'options':{'where':{'id':_0x5f9c09},'attributes':[_0x805c('0x1a')]}});};exports[_0x805c('0x1b')]=function(_0xa2fa91){return request(_0x805c('0x1c'),{'options':{'raw':![],'where':{'id':_0xa2fa91},'include':[{'model':'Interval','as':_0x805c('0x1d')}]}});};exports['getSmsAccountById']=function(_0x28ddc9){return request('ShowSmsAccount',{'options':{'where':{'id':_0x28ddc9},'attributes':['id','name']}});};exports[_0x805c('0x1e')]=function(_0x467010){return request(_0x805c('0x1f'),{'body':_0x467010});};exports[_0x805c('0x20')]=function(_0x4caa09){return request(_0x805c('0x21'),{'body':_0x4caa09});};exports[_0x805c('0x22')]=function(_0x37d16e){return request(_0x805c('0x23'),{'body':_['merge'](_0x37d16e,{'project_name':_0x37d16e[_0x805c('0x24')],'prev_project_name':_0x37d16e['arg_2']||'','is_subproject':_0x37d16e[_0x805c('0x25')]?!![]:![],'leaveAt':moment()[_0x805c('0x26')](_0x805c('0x27'))})});};exports[_0x805c('0x28')]=function(_0x53d0f3){return request(_0x805c('0x29'),{'body':_0x53d0f3});};exports[_0x805c('0x2a')]=function(_0x2ea382){return request('CreateSquareMessage',{'body':_0x2ea382});};exports['createCmContact']=function(_0x3ba180){return request('ShowCmHopper',{'options':{'raw':![],'where':{'phone':_0x3ba180[_0x805c('0x2b')],'ListId':_0x3ba180[_0x805c('0x2c')]}}})[_0x805c('0x4')](function(_0xe571dd){if(_0xe571dd){return _0xe571dd;}return request(_0x805c('0x2d'),{'body':_0x3ba180});});};exports[_0x805c('0x2e')]=function(_0x260a61){return request(_0x805c('0x2f'),{'options':{'where':{'id':_0x260a61},'attributes':[_0x805c('0x10')]}});};exports['agentLogin']=function(_0x2fc251,_0x4ec1cd){return request(_0x805c('0x30'),{'body':{'interface':_0x4ec1cd},'options':{'where':_0x2fc251}});};exports[_0x805c('0x31')]=function(_0x5b28d7,_0x201cda,_0x48e7d5){return request(_0x805c('0x32'),{'body':{'type':_0x201cda,'uniqueid':_0x48e7d5},'options':{'where':_0x5b28d7}});};exports[_0x805c('0x33')]=function(_0x2c7e58){return request(_0x805c('0x34'),{'body':{},'options':{'where':_0x2c7e58}});};exports[_0x805c('0x35')]=function(_0x4eea3c){return request(_0x805c('0x36'),{'body':{},'options':{'where':_0x4eea3c}});}; \ No newline at end of file +var _0x32d5=['ShowMailAccount','MailServerOut','Smtp','name','email','getSquareProjectById','getVoiceQueueById','ShowVoiceQueue','getVariableById','ShowVariable','getSquareOdbcById','ShowSquareOdbc','dsn','getUserById','ShowUser','getTrunkById','ShowTrunk','getSoundById','ShowSound','save_name','getIntervalById','ShowInterval','Interval','Intervals','getSmsAccountById','createSmsMessage','CreateSmsMessage','createSquareDetailsReport','createSquareReport','CreateSquareReport','arg_2','format','CreateSquareRecording','createSquareMessage','CreateSquareMessage','createCmContact','ShowCmHopper','phone','ListId','CreateCmContact','getPauseById','ShowPause','agentPause','PauseUser','agentUnpause','UnpauseUser','agentLogout','LogoutUser','bluebird','moment','lodash','util','jayson/promise','client','http','request','then','error','catch','getSquareProject','ShowSquareProject','production','getMailAccountById'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0x32d5,0x1aa));var _0x532d=function(_0x1058f,_0x46e6ac){_0x1058f=_0x1058f-0x0;var _0x490a4a=_0x32d5[_0x1058f];return _0x490a4a;};'use strict';var BPromise=require(_0x532d('0x0'));var moment=require(_0x532d('0x1'));var _=require(_0x532d('0x2'));var util=require(_0x532d('0x3'));var jayson=require(_0x532d('0x4'));var client=jayson[_0x532d('0x5')][_0x532d('0x6')]({'port':0x2329});function request(_0x5efaea,_0x2f0e4c){return new BPromise(function(_0x309316,_0x4f87d1){return client[_0x532d('0x7')](_0x5efaea,_0x2f0e4c)[_0x532d('0x8')](function(_0x2995e2){if(_0x2995e2[_0x532d('0x9')]){return _0x4f87d1(_0x2995e2[_0x532d('0x9')]['message']);}else{return _0x309316(_0x2995e2['result']);}})[_0x532d('0xa')](function(_0x54ccf5){return _0x4f87d1(_0x54ccf5);});});}exports[_0x532d('0xb')]=function(_0x23ee37){return request(_0x532d('0xc'),{'options':{'raw':![],'where':{'name':_0x23ee37},'attributes':[_0x532d('0xd')]}});};exports[_0x532d('0xe')]=function(_0x414ac1){return request(_0x532d('0xf'),{'options':{'raw':![],'where':{'id':_0x414ac1},'include':[{'model':_0x532d('0x10'),'as':_0x532d('0x11')}],'attributes':['id',_0x532d('0x12'),_0x532d('0x13')]}});};exports[_0x532d('0x14')]=function(_0x5917be){return request(_0x532d('0xc'),{'options':{'where':{'id':_0x5917be},'attributes':[_0x532d('0x12')]}});};exports[_0x532d('0x15')]=function(_0x255ba7){return request(_0x532d('0x16'),{'options':{'where':{'id':_0x255ba7},'attributes':['name']}});};exports[_0x532d('0x17')]=function(_0x581210){return request(_0x532d('0x18'),{'options':{'where':{'id':_0x581210},'attributes':[_0x532d('0x12')]}});};exports[_0x532d('0x19')]=function(_0x46a0d4){return request(_0x532d('0x1a'),{'options':{'where':{'id':_0x46a0d4},'attributes':[_0x532d('0x1b')]}});};exports[_0x532d('0x1c')]=function(_0x176595){return request(_0x532d('0x1d'),{'options':{'where':{'id':_0x176595},'attributes':['name']}});};exports[_0x532d('0x1e')]=function(_0x20c080){return request(_0x532d('0x1f'),{'options':{'where':{'id':_0x20c080},'attributes':[_0x532d('0x12')]}});};exports[_0x532d('0x20')]=function(_0x2fa662){return request(_0x532d('0x21'),{'options':{'where':{'id':_0x2fa662},'attributes':[_0x532d('0x22')]}});};exports[_0x532d('0x23')]=function(_0x4a3e60){return request(_0x532d('0x24'),{'options':{'raw':![],'where':{'id':_0x4a3e60},'include':[{'model':_0x532d('0x25'),'as':_0x532d('0x26')}]}});};exports[_0x532d('0x27')]=function(_0x2875fb){return request('ShowSmsAccount',{'options':{'where':{'id':_0x2875fb},'attributes':['id',_0x532d('0x12')]}});};exports[_0x532d('0x28')]=function(_0x1227df){return request(_0x532d('0x29'),{'body':_0x1227df});};exports[_0x532d('0x2a')]=function(_0x53281d){return request('CreateSquareDetailsReport',{'body':_0x53281d});};exports[_0x532d('0x2b')]=function(_0x3f57f1){return request(_0x532d('0x2c'),{'body':_['merge'](_0x3f57f1,{'project_name':_0x3f57f1['arg_1'],'prev_project_name':_0x3f57f1[_0x532d('0x2d')]||'','is_subproject':_0x3f57f1[_0x532d('0x2d')]?!![]:![],'leaveAt':moment()[_0x532d('0x2e')]('YYYY-MM-DD\x20HH:mm:ss')})});};exports['createSquareRecording']=function(_0x5751ff){return request(_0x532d('0x2f'),{'body':_0x5751ff});};exports[_0x532d('0x30')]=function(_0x4eecab){return request(_0x532d('0x31'),{'body':_0x4eecab});};exports[_0x532d('0x32')]=function(_0xdf4514){return request(_0x532d('0x33'),{'options':{'raw':![],'where':{'phone':_0xdf4514[_0x532d('0x34')],'ListId':_0xdf4514[_0x532d('0x35')]}}})['then'](function(_0xbf606b){if(_0xbf606b){return _0xbf606b;}return request(_0x532d('0x36'),{'body':_0xdf4514});});};exports[_0x532d('0x37')]=function(_0x3ca076){return request(_0x532d('0x38'),{'options':{'where':{'id':_0x3ca076},'attributes':['name']}});};exports['agentLogin']=function(_0x59e220,_0x39aede){return request('LoginUser',{'body':{'interface':_0x39aede},'options':{'where':_0x59e220}});};exports[_0x532d('0x39')]=function(_0x25bfd3,_0x2bd64f,_0x2d196a){return request(_0x532d('0x3a'),{'body':{'type':_0x2bd64f,'uniqueid':_0x2d196a},'options':{'where':_0x25bfd3}});};exports[_0x532d('0x3b')]=function(_0x56d7c2){return request(_0x532d('0x3c'),{'body':{},'options':{'where':_0x56d7c2}});};exports[_0x532d('0x3d')]=function(_0x44c59f){return request(_0x532d('0x3e'),{'body':{},'options':{'where':_0x44c59f}});}; \ 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 5606f41..075a51b 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 _0x524a=['./lex','exports','./polly'];(function(_0x2330fd,_0x56e9c7){var _0x5c1eba=function(_0x517719){while(--_0x517719){_0x2330fd['push'](_0x2330fd['shift']());}};_0x5c1eba(++_0x56e9c7);}(_0x524a,0xf5));var _0xa524=function(_0x7962eb,_0x16e5ca){_0x7962eb=_0x7962eb-0x0;var _0x5adae1=_0x524a[_0x7962eb];return _0x5adae1;};var polly=require(_0xa524('0x0'));var lex=require(_0xa524('0x1'));module[_0xa524('0x2')]={'polly':polly,'lex':lex}; \ No newline at end of file +var _0xe13a=['./lex','exports'];(function(_0x24e11e,_0x198fb8){var _0x29899e=function(_0xf3630a){while(--_0xf3630a){_0x24e11e['push'](_0x24e11e['shift']());}};_0x29899e(++_0x198fb8);}(_0xe13a,0x178));var _0xae13=function(_0x1203c5,_0x19088f){_0x1203c5=_0x1203c5-0x0;var _0x218242=_0xe13a[_0x1203c5];return _0x218242;};var polly=require('./polly');var lex=require(_0xae13('0x0'));module[_0xae13('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 0038cba..cc1eec9 100644 --- a/server/services/agi/scripts/aws/lex/index.js +++ b/server/services/agi/scripts/aws/lex/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa4fb=['./lib/api','exports'];(function(_0x3bf43e,_0x17b78c){var _0x335865=function(_0x4a9507){while(--_0x4a9507){_0x3bf43e['push'](_0x3bf43e['shift']());}};_0x335865(++_0x17b78c);}(_0xa4fb,0x150));var _0xba4f=function(_0x16d10f,_0x2ba2d5){_0x16d10f=_0x16d10f-0x0;var _0x50c823=_0xa4fb[_0x16d10f];return _0x50c823;};'use strict';var lex=require(_0xba4f('0x0'));module[_0xba4f('0x1')]=function(_0x45a5dc,_0x473226,_0x569bf7,_0x5d2269,_0x4131a6,_0x196e5b){return lex(_0x45a5dc,_0x473226,_0x569bf7,_0x5d2269,_0x4131a6,_0x196e5b);}; \ No newline at end of file +var _0xa8eb=['./lib/api'];(function(_0x3ed40b,_0x36602a){var _0xd98cd=function(_0x2b3d6a){while(--_0x2b3d6a){_0x3ed40b['push'](_0x3ed40b['shift']());}};_0xd98cd(++_0x36602a);}(_0xa8eb,0x179));var _0xba8e=function(_0x4c1628,_0xd49f36){_0x4c1628=_0x4c1628-0x0;var _0x3d8008=_0xa8eb[_0x4c1628];return _0x3d8008;};'use strict';var lex=require(_0xba8e('0x0'));module['exports']=function(_0x26595f,_0x5757ad,_0xd7f19f,_0x35f485,_0x3b8fee,_0x5c94e6){return lex(_0x26595f,_0x5757ad,_0xd7f19f,_0x35f485,_0x3b8fee,_0x5c94e6);}; \ 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 a42c8e4..934d4c8 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 _0xfc3f=['exports','LexRuntime','$LATEST','bluebird','aws-sdk','postText','slots'];(function(_0x3c560a,_0x1c46d4){var _0x22e9be=function(_0xd72419){while(--_0xd72419){_0x3c560a['push'](_0x3c560a['shift']());}};_0x22e9be(++_0x1c46d4);}(_0xfc3f,0x65));var _0xffc3=function(_0x5b78e8,_0x55096b){_0x5b78e8=_0x5b78e8-0x0;var _0xf2c321=_0xfc3f[_0x5b78e8];return _0xf2c321;};'use strict';var BPromise=require(_0xffc3('0x0'));var AWS=require(_0xffc3('0x1'));function lexResult(_0x1e932b,_0x5b67de){return new BPromise(function(_0x221285,_0x15b4ec){_0x1e932b[_0xffc3('0x2')](_0x5b67de,function(_0x44793e,_0x312951){if(_0x44793e){_0x15b4ec(_0x44793e);}if(_0x312951['slots']){for(const _0x51bc92 in _0x312951['slots']){if(_0x312951[_0xffc3('0x3')]['hasOwnProperty'](_0x51bc92)){var _0x16b3f5=_0x312951['slots'][_0x51bc92];_0x312951['slot_'+_0x51bc92]=_0x16b3f5;}}}_0x221285(_0x312951);});});}module[_0xffc3('0x4')]=function(_0x3245e7,_0x5087b9,_0x196f17,_0xf86118,_0x59307c,_0x27dcf9){var _0x4bbb0e=new AWS[(_0xffc3('0x5'))]({'accessKeyId':_0x5087b9,'secretAccessKey':_0x196f17,'region':_0xf86118});var _0x11f75a={'botAlias':_0xffc3('0x6'),'botName':_0x27dcf9,'inputText':_0x59307c,'userId':_0x3245e7};return lexResult(_0x4bbb0e,_0x11f75a);}; \ No newline at end of file +var _0x0e45=['hasOwnProperty','LexRuntime','bluebird','aws-sdk','postText','slots'];(function(_0x4ba94c,_0x4b7e77){var _0x205a9d=function(_0x327aa7){while(--_0x327aa7){_0x4ba94c['push'](_0x4ba94c['shift']());}};_0x205a9d(++_0x4b7e77);}(_0x0e45,0xa4));var _0x50e4=function(_0x1c7963,_0x23123d){_0x1c7963=_0x1c7963-0x0;var _0x1fbf28=_0x0e45[_0x1c7963];return _0x1fbf28;};'use strict';var BPromise=require(_0x50e4('0x0'));var AWS=require(_0x50e4('0x1'));function lexResult(_0x524c82,_0x5cbd9c){return new BPromise(function(_0x2f3122,_0x44a0e7){_0x524c82[_0x50e4('0x2')](_0x5cbd9c,function(_0x56d057,_0x4adcc5){if(_0x56d057){_0x44a0e7(_0x56d057);}if(_0x4adcc5[_0x50e4('0x3')]){for(const _0x4da5ef in _0x4adcc5[_0x50e4('0x3')]){if(_0x4adcc5['slots'][_0x50e4('0x4')](_0x4da5ef)){var _0x4d6a4c=_0x4adcc5['slots'][_0x4da5ef];_0x4adcc5['slot_'+_0x4da5ef]=_0x4d6a4c;}}}_0x2f3122(_0x4adcc5);});});}module['exports']=function(_0x19d8d3,_0x14728c,_0x55088a,_0x3c2f7f,_0xb623f9,_0x4663c0){var _0x5de1dc=new AWS[(_0x50e4('0x5'))]({'accessKeyId':_0x14728c,'secretAccessKey':_0x55088a,'region':_0x3c2f7f});var _0x5efa1a={'botAlias':'$LATEST','botName':_0x4663c0,'inputText':_0xb623f9,'userId':_0x19d8d3};return lexResult(_0x5de1dc,_0x5efa1a);}; \ 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 67b1f6f..46e0dec 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 _0xe2f0=['exports'];(function(_0x40b9d0,_0x3537da){var _0x144b8d=function(_0x3071b5){while(--_0x3071b5){_0x40b9d0['push'](_0x40b9d0['shift']());}};_0x144b8d(++_0x3537da);}(_0xe2f0,0xec));var _0x0e2f=function(_0x483889,_0x4c80ad){_0x483889=_0x483889-0x0;var _0x477f7a=_0xe2f0[_0x483889];return _0x477f7a;};'use strict';var polly=require('./lib/api');module[_0x0e2f('0x0')]=function(_0x357c88,_0x24e23c,_0x274cc0,_0x12b8c8,_0x9f6443,_0x1a7d8f,_0x214844){return polly(_0x357c88,_0x24e23c,_0x274cc0,_0x12b8c8,_0x9f6443,_0x1a7d8f,_0x214844);}; \ No newline at end of file +var _0x6300=['./lib/api','exports'];(function(_0x11155f,_0x57b687){var _0xd07e48=function(_0x592615){while(--_0x592615){_0x11155f['push'](_0x11155f['shift']());}};_0xd07e48(++_0x57b687);}(_0x6300,0x146));var _0x0630=function(_0x5d89b9,_0x4a389d){_0x5d89b9=_0x5d89b9-0x0;var _0x256b7a=_0x6300[_0x5d89b9];return _0x256b7a;};'use strict';var polly=require(_0x0630('0x0'));module[_0x0630('0x1')]=function(_0x2d3904,_0x145044,_0x555cc3,_0x4006fa,_0x2f796e,_0x1941ef,_0x309122){return polly(_0x2d3904,_0x145044,_0x555cc3,_0x4006fa,_0x2f796e,_0x1941ef,_0x309122);}; \ 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 3833d0b..6b678ba 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 _0x6525=['AudioStream','writeFile','No\x20data\x20response\x20from\x20aws\x20Polly!','exports','Polly','text','mp3','path','randomstring','aws-sdk','synthesizeSpeech'];(function(_0x6f4391,_0x162e98){var _0x403810=function(_0x22cb40){while(--_0x22cb40){_0x6f4391['push'](_0x6f4391['shift']());}};_0x403810(++_0x162e98);}(_0x6525,0xc2));var _0x5652=function(_0x3f8759,_0x3fe6fb){_0x3f8759=_0x3f8759-0x0;var _0x2d33ca=_0x6525[_0x3f8759];return _0x2d33ca;};'use strict';var fs=require('fs');var path=require(_0x5652('0x0'));var BPromise=require('bluebird');var rs=require(_0x5652('0x1'));var AWS=require(_0x5652('0x2'));function pollyResult(_0x9a6c59,_0x5aed59,_0x4f2ff4){return new BPromise(function(_0x179fc3,_0x2de099){_0x9a6c59[_0x5652('0x3')](_0x5aed59,function(_0x31eec0,_0x1fdea6){if(_0x31eec0){_0x2de099(_0x31eec0);}else if(_0x1fdea6){if(_0x1fdea6[_0x5652('0x4')]instanceof Buffer){fs[_0x5652('0x5')](_0x4f2ff4,_0x1fdea6[_0x5652('0x4')],function(_0x537e76){if(_0x537e76){_0x2de099(_0x537e76);}else{_0x179fc3();}});}else{_0x2de099(new Error('Invalid\x20data\x20response\x20from\x20aws\x20Polly!'));}}else{_0x2de099(new Error(_0x5652('0x6')));}});});}module[_0x5652('0x7')]=function(_0x35200b,_0xdb0013,_0x4a3c54,_0x212add,_0xb1a0d0,_0x5cdc75,_0x3c963b){var _0x397e56=new AWS[(_0x5652('0x8'))]({'accessKeyId':_0x35200b,'secretAccessKey':_0xdb0013,'region':_0x4a3c54});var _0x1768e4={'Text':_0xb1a0d0,'TextType':_0x5cdc75||_0x5652('0x9'),'OutputFormat':_0x5652('0xa'),'VoiceId':_0x212add};return pollyResult(_0x397e56,_0x1768e4,_0x3c963b);}; \ No newline at end of file +var _0xc6d3=['synthesizeSpeech','AudioStream','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','exports','Polly','mp3','path','randomstring','aws-sdk'];(function(_0x5343dc,_0x2de7d7){var _0x1a4cee=function(_0x45603b){while(--_0x45603b){_0x5343dc['push'](_0x5343dc['shift']());}};_0x1a4cee(++_0x2de7d7);}(_0xc6d3,0x84));var _0x3c6d=function(_0x265cd3,_0x1fa76c){_0x265cd3=_0x265cd3-0x0;var _0x1284fd=_0xc6d3[_0x265cd3];return _0x1284fd;};'use strict';var fs=require('fs');var path=require(_0x3c6d('0x0'));var BPromise=require('bluebird');var rs=require(_0x3c6d('0x1'));var AWS=require(_0x3c6d('0x2'));function pollyResult(_0x4e4d73,_0x39b0c1,_0xfe9c21){return new BPromise(function(_0x3d01e7,_0x279c0b){_0x4e4d73[_0x3c6d('0x3')](_0x39b0c1,function(_0x382a64,_0x385afc){if(_0x382a64){_0x279c0b(_0x382a64);}else if(_0x385afc){if(_0x385afc[_0x3c6d('0x4')]instanceof Buffer){fs['writeFile'](_0xfe9c21,_0x385afc[_0x3c6d('0x4')],function(_0x46295e){if(_0x46295e){_0x279c0b(_0x46295e);}else{_0x3d01e7();}});}else{_0x279c0b(new Error(_0x3c6d('0x5')));}}else{_0x279c0b(new Error('No\x20data\x20response\x20from\x20aws\x20Polly!'));}});});}module[_0x3c6d('0x6')]=function(_0x1536fa,_0x24cd6a,_0xd26f7c,_0x572de1,_0x45908e,_0x5c375a,_0x426f7f){var _0x78bb17=new AWS[(_0x3c6d('0x7'))]({'accessKeyId':_0x1536fa,'secretAccessKey':_0x24cd6a,'region':_0xd26f7c});var _0x282dcb={'Text':_0x45908e,'TextType':_0x5c375a||'text','OutputFormat':_0x3c6d('0x8'),'VoiceId':_0x572de1};return pollyResult(_0x78bb17,_0x282dcb,_0x426f7f);}; \ 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 16cd576..dd9ffe4 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 _0x7b23=['./lib/api'];(function(_0x4bcf66,_0x35bbab){var _0x8eb0e7=function(_0x9bbdc8){while(--_0x9bbdc8){_0x4bcf66['push'](_0x4bcf66['shift']());}};_0x8eb0e7(++_0x35bbab);}(_0x7b23,0x1d7));var _0x37b2=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x7b23[_0xa464c9];return _0x3d73c4;};'use strict';var asr=require(_0x37b2('0x0'));module['exports']=function(_0x212fd0,_0x88061c,_0x92fd6a,_0x4e6587){return asr(_0x212fd0,_0x88061c,_0x92fd6a);}; \ No newline at end of file +var _0x165c=['exports','./lib/api'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x165c,0x13d));var _0xc165=function(_0x4f7eb0,_0x40e8c1){_0x4f7eb0=_0x4f7eb0-0x0;var _0x1550f2=_0x165c[_0x4f7eb0];return _0x1550f2;};'use strict';var asr=require(_0xc165('0x0'));module[_0xc165('0x1')]=function(_0x90809c,_0x542a4e,_0x45fcff,_0x4be7d1){return asr(_0x90809c,_0x542a4e,_0x45fcff);}; \ 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 afb40c0..22609d0 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 _0x2c45=['filepath\x20should\x20be\x20a\x20string','key\x20should\x20be\x20a\x20string','lang\x20should\x20be\x20a\x20string','toString','POST','/v1/speech:recognize?key=','LINEAR16','url','bluebird','exports','string','length'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0x2c45,0x193));var _0x52c4=function(_0x3fca94,_0x2cb98a){_0x3fca94=_0x3fca94-0x0;var _0x5dfcb2=_0x2c45[_0x3fca94];return _0x5dfcb2;};'use strict';var url=require(_0x52c4('0x0'));var BPromise=require(_0x52c4('0x1'));var fs=require('fs');var host='https://speech.googleapis.com';module[_0x52c4('0x2')]=function(_0x1604df,_0x5a4944,_0x40a141){return new BPromise(function(_0x6374fa,_0x53b1c4){var _0x4ded0;if(typeof _0x1604df!==_0x52c4('0x3')||_0x1604df[_0x52c4('0x4')]===0x0){return _0x53b1c4(_0x52c4('0x5'));}if(typeof _0x5a4944!==_0x52c4('0x3')||_0x5a4944[_0x52c4('0x4')]===0x0){return _0x53b1c4(_0x52c4('0x6'));}if(typeof _0x40a141!=='undefined'&&(typeof _0x40a141!==_0x52c4('0x3')||_0x40a141[_0x52c4('0x4')]===0x0)){return _0x53b1c4(_0x52c4('0x7'));}try{_0x4ded0=fs['readFileSync'](_0x1604df)[_0x52c4('0x8')]('base64');}catch(_0x514005){return _0x53b1c4(_0x514005);}return _0x6374fa({'method':_0x52c4('0x9'),'uri':host+_0x52c4('0xa')+_0x5a4944,'body':{'config':{'encoding':_0x52c4('0xb'),'sampleRateHertz':'8000','languageCode':_0x40a141},'audio':{'content':_0x4ded0}},'json':!![]});});}; \ No newline at end of file +var _0x13fb=['LINEAR16','bluebird','https://speech.googleapis.com','string','length','undefined','lang\x20should\x20be\x20a\x20string','readFileSync','toString','base64','POST','/v1/speech:recognize?key='];(function(_0x38a82e,_0x34fe30){var _0x654f63=function(_0x345f4e){while(--_0x345f4e){_0x38a82e['push'](_0x38a82e['shift']());}};_0x654f63(++_0x34fe30);}(_0x13fb,0x109));var _0xb13f=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x13fb[_0x4565bf];return _0x5610ba;};'use strict';var url=require('url');var BPromise=require(_0xb13f('0x0'));var fs=require('fs');var host=_0xb13f('0x1');module['exports']=function(_0x1b73cd,_0x32ef18,_0x37b0d4){return new BPromise(function(_0x3e3a24,_0x1e10a3){var _0x336076;if(typeof _0x1b73cd!==_0xb13f('0x2')||_0x1b73cd[_0xb13f('0x3')]===0x0){return _0x1e10a3('filepath\x20should\x20be\x20a\x20string');}if(typeof _0x32ef18!==_0xb13f('0x2')||_0x32ef18['length']===0x0){return _0x1e10a3('key\x20should\x20be\x20a\x20string');}if(typeof _0x37b0d4!==_0xb13f('0x4')&&(typeof _0x37b0d4!==_0xb13f('0x2')||_0x37b0d4[_0xb13f('0x3')]===0x0)){return _0x1e10a3(_0xb13f('0x5'));}try{_0x336076=fs[_0xb13f('0x6')](_0x1b73cd)[_0xb13f('0x7')](_0xb13f('0x8'));}catch(_0xc26d54){return _0x1e10a3(_0xc26d54);}return _0x3e3a24({'method':_0xb13f('0x9'),'uri':host+_0xb13f('0xa')+_0x32ef18,'body':{'config':{'encoding':_0xb13f('0xb'),'sampleRateHertz':'8000','languageCode':_0x37b0d4},'audio':{'content':_0x336076}},'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 cb5c1b6..a167c19 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 _0x199c=['exports','./asr'];(function(_0x452602,_0x12a16c){var _0x5aa7d8=function(_0x1f9c1a){while(--_0x1f9c1a){_0x452602['push'](_0x452602['shift']());}};_0x5aa7d8(++_0x12a16c);}(_0x199c,0x7b));var _0xc199=function(_0x1d078b,_0x46dc86){_0x1d078b=_0x1d078b-0x0;var _0x462afc=_0x199c[_0x1d078b];return _0x462afc;};var asr=require(_0xc199('0x0'));module[_0xc199('0x1')]={'asr':asr}; \ No newline at end of file +var _0x93ab=['./asr','exports'];(function(_0x22cc01,_0x338d34){var _0x35b679=function(_0x2e353f){while(--_0x2e353f){_0x22cc01['push'](_0x22cc01['shift']());}};_0x35b679(++_0x338d34);}(_0x93ab,0x1e2));var _0xb93a=function(_0x5c619e,_0x1bccdf){_0x5c619e=_0x5c619e-0x0;var _0x445cf8=_0x93ab[_0x5c619e];return _0x445cf8;};var asr=require(_0xb93a('0x0'));module[_0xb93a('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 ee0c564..4088752 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 _0x6c59=['finish\x20download\x20file','close','unlink','download\x20error','pipe','get','data','end','transcode','wav','error\x20convert','finish\x20to\x20convert','start','resolve','tmp','generate','.wav','writeFileSync','split','readFileSync','toString','https://texttospeech.googleapis.com/v1/','?key=','ssml','voice','audioConfig','MP3','text:synthesize','then','.mp3','audioContent','base64','chmodSync','info','googleCloudTTS\x20path','googleTTS','777','googleASR','asr','uri','results','map','alternatives','transcript','join','confidence','googleASR\x20transcription','catch','[%s]\x20%s:%s','name','googleDialogflow','textRequest','result','source','resolvedQuery','action','actionIncomplete','fulfillment','speech','score','status','metadata','endConversation','isFallbackIntent','tildeASR','Tilde\x20ASR\x20transcription','awsPolly','polly','awsLex','lex','stringify','format','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','ispeechASR','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','model=%s','freeform=3','sestekNDA','text','channelData','CustomAction','CustomActionData','AudioFromTts','audiofile','path','http','url','parse','bluebird','randomstring','request-promise','moment','apiai-promise','md5','./google','./tilde','../../../config/logger','https://api.ispeech.org/api/rest','protocol','host','WHAT_EVER','error','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusMessage','statusCode','createWriteStream'];(function(_0x4a4475,_0x482cbc){var _0x1d8af4=function(_0x413130){while(--_0x413130){_0x4a4475['push'](_0x4a4475['shift']());}};_0x1d8af4(++_0x482cbc);}(_0x6c59,0x195));var _0x96c5=function(_0x1b354c,_0x597221){_0x1b354c=_0x1b354c-0x0;var _0x5cc022=_0x6c59[_0x1b354c];return _0x5cc022;};'use strict';var fs=require('fs');var path=require(_0x96c5('0x0'));var http=require(_0x96c5('0x1'));var https=require('https');var urlParse=require(_0x96c5('0x2'))[_0x96c5('0x3')];var BPromise=require(_0x96c5('0x4'));var rs=require(_0x96c5('0x5'));var sox=require('sox');var rp=require(_0x96c5('0x6'));var util=require('util');var querystring=require('querystring');var moment=require(_0x96c5('0x7'));var tts=require('google-tts-api');var apiai=require(_0x96c5('0x8'));var md5=require(_0x96c5('0x9'));var google=require(_0x96c5('0xa'));var aws=require('./aws');var tilde=require(_0x96c5('0xb'));var sestek=require('./sestek');var logger=require(_0x96c5('0xc'))('agi');var ISPEECH_API=_0x96c5('0xd');function downloadFile(_0x1ac5b2,_0x1051ce){return new BPromise(function(_0x49c286,_0x26d152){var _0x49cf04=urlParse(_0x1ac5b2);var _0x4f847e=_0x49cf04[_0x96c5('0xe')]==='https:'?https:http;var _0x58ecb9={'host':_0x49cf04[_0x96c5('0xf')],'path':_0x49cf04['path'],'headers':{'user-agent':_0x96c5('0x10')}};_0x4f847e['get'](_0x58ecb9,function(_0xb5427b){if(_0xb5427b['statusCode']!==0xc8){logger[_0x96c5('0x11')](_0x96c5('0x12')+_0x1ac5b2+_0x96c5('0x13')+_0xb5427b['statusCode']+'\x20('+_0xb5427b[_0x96c5('0x14')]+')');_0x26d152(new Error(_0x96c5('0x12')+_0x1ac5b2+_0x96c5('0x13')+_0xb5427b[_0x96c5('0x15')]+'\x20('+_0xb5427b['statusMessage']+')'));return;}var _0x42e24f=fs[_0x96c5('0x16')](_0x1051ce);_0x42e24f['on']('finish',function(){logger['info'](_0x96c5('0x17'));_0x42e24f[_0x96c5('0x18')](_0x49c286);});_0x42e24f['on'](_0x96c5('0x11'),function(_0x5a0575){fs[_0x96c5('0x19')](_0x1051ce);logger[_0x96c5('0x11')](_0x96c5('0x1a'),_0x5a0575);_0x26d152(_0x5a0575);});_0xb5427b[_0x96c5('0x1b')](_0x42e24f);})['on'](_0x96c5('0x11'),function(_0x293f85){logger[_0x96c5('0x11')](_0x293f85);_0x26d152(_0x293f85);})['end']();});}function uploadFile(_0x12bfff){return new BPromise(function(_0x648f60,_0x2db1e4){var _0x374cdb=urlParse(_0x12bfff);var _0x2ae4e1=_0x374cdb['protocol']==='https:'?https:http;var _0x25be12={'host':_0x374cdb[_0x96c5('0xf')],'path':_0x374cdb[_0x96c5('0x0')],'headers':{'user-agent':'WHAT_EVER'}};_0x2ae4e1[_0x96c5('0x1c')](_0x25be12,function(_0x3bf143){if(_0x3bf143['statusCode']!==0xc8){_0x2db1e4(new Error(_0x96c5('0x12')+_0x12bfff+_0x96c5('0x13')+_0x3bf143['statusCode']+'\x20('+_0x3bf143['statusMessage']+')'));return;}var _0x60b07='';_0x3bf143['on'](_0x96c5('0x1d'),function(_0x3a2759){_0x60b07+=_0x3a2759;});_0x3bf143['on'](_0x96c5('0x1e'),function(){_0x648f60(_0x60b07);});})['on'](_0x96c5('0x11'),function(_0x29427e){_0x2db1e4(_0x29427e);})['end']();});}function convertFile(_0x69915c,_0x12d1ab){return new BPromise(function(_0x3b180d,_0x2e8db4){var _0x5215c6=sox[_0x96c5('0x1f')](_0x69915c,_0x12d1ab,{'sampleRate':0x1f40,'format':_0x96c5('0x20'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x5215c6['on'](_0x96c5('0x11'),function(_0x10efb4){logger[_0x96c5('0x11')](_0x96c5('0x21'),_0x10efb4);_0x2e8db4(_0x10efb4);});_0x5215c6['on'](_0x96c5('0x1e'),function(){logger['info'](_0x96c5('0x22'));_0x3b180d();});_0x5215c6[_0x96c5('0x23')]();});}function base64Decode(_0x3aadd3,_0x168811){var _0xcf977b=path[_0x96c5('0x24')](__dirname,_0x96c5('0x25'),rs[_0x96c5('0x26')](0x4)+_0x96c5('0x27'));fs[_0x96c5('0x28')](_0xcf977b,_0x3aadd3,'base64');return convertFile(_0xcf977b,_0x168811)['then'](function(){try{fs[_0x96c5('0x19')](_0xcf977b);fs['chmodSync'](_0x168811,'777');}catch(_0x2708b7){logger[_0x96c5('0x11')](_0x2708b7);}return _0x168811[_0x96c5('0x29')]('.')[0x0];});}function base64Encode(_0xcc8739){var _0x2a21e6=fs[_0x96c5('0x2a')](_0xcc8739);return new Buffer(_0x2a21e6)[_0x96c5('0x2b')]('base64');}exports['googleCloudTTS']=function(_0x440ad7,_0x3dace9,_0x5b72df,_0x1be890,_0x19d656,_0x412e45){var _0x11e38f,_0x31e8cd;var _0x1d2656=_0x96c5('0x2c');var _0x433d39=_0x96c5('0x2d')+_0x440ad7;var _0x43f5f1={};if(_0x3dace9===_0x96c5('0x2e')){_0x43f5f1['input']={'ssml':_0x5b72df};}else{_0x43f5f1['input']={'text':_0x5b72df};};_0x43f5f1[_0x96c5('0x2f')]={'languageCode':_0x1be890,'ssmlGender':_0x19d656};_0x43f5f1[_0x96c5('0x30')]={'audioEncoding':_0x96c5('0x31'),'sampleRateHertz':0x1f40};var _0x113480={'url':_0x1d2656+_0x96c5('0x32')+_0x433d39,'method':'POST','json':!![],'body':_0x43f5f1};return rp(_0x113480)[_0x96c5('0x33')](function(_0x58dfc5){return new BPromise(function(_0x5e45a2,_0x468b61){_0x11e38f=path[_0x96c5('0x24')](__dirname,_0x96c5('0x25'),rs['generate'](0x4)+_0x96c5('0x34'));var _0x42ff45=Buffer['from'](_0x58dfc5[_0x96c5('0x35')],_0x96c5('0x36'));return fs['writeFile'](_0x11e38f,_0x42ff45,function(_0x4fc1a4){_0x468b61(_0x4fc1a4);},function(_0x2c11e3){fs[_0x96c5('0x37')](_0x11e38f,'777');_0x5e45a2(_0x2c11e3);});});})[_0x96c5('0x33')](function(_0x4dc274){_0x31e8cd=path[_0x96c5('0x24')](__dirname,_0x96c5('0x25'),rs[_0x96c5('0x26')](0x4)+_0x96c5('0x27'));return convertFile(_0x11e38f,_0x31e8cd);})['then'](function(){try{fs['unlink'](_0x11e38f);fs[_0x96c5('0x37')](_0x31e8cd,'777');}catch(_0x346efd){logger[_0x96c5('0x11')](_0x346efd);}logger[_0x96c5('0x38')](_0x96c5('0x39'),_0x31e8cd['split']('.')[0x0]);return _0x31e8cd[_0x96c5('0x29')]('.')[0x0];});};exports[_0x96c5('0x3a')]=function(_0x33294e,_0x313d27){var _0x1e5047,_0x322afe;return tts(_0x33294e,_0x313d27||'en',0x1)[_0x96c5('0x33')](function(_0x2b6063){logger[_0x96c5('0x38')](_0x2b6063);_0x1e5047=path[_0x96c5('0x24')](__dirname,'tmp',rs[_0x96c5('0x26')](0x4)+'.mp3');return downloadFile(_0x2b6063,_0x1e5047);})[_0x96c5('0x33')](function(){_0x322afe=path[_0x96c5('0x24')](__dirname,_0x96c5('0x25'),rs[_0x96c5('0x26')](0x4)+_0x96c5('0x27'));return convertFile(_0x1e5047,_0x322afe);})[_0x96c5('0x33')](function(){try{fs[_0x96c5('0x19')](_0x1e5047);fs[_0x96c5('0x37')](_0x322afe,_0x96c5('0x3b'));}catch(_0xb51303){logger[_0x96c5('0x11')](_0xb51303);}logger[_0x96c5('0x38')]('goggleTTS\x20path',_0x322afe[_0x96c5('0x29')]('.')[0x0]);return _0x322afe['split']('.')[0x0];});};exports[_0x96c5('0x3c')]=function(_0x45134b,_0x3cc819,_0xf9f73){return google[_0x96c5('0x3d')](_0x45134b,_0x3cc819,_0xf9f73)[_0x96c5('0x33')](function(_0x57ea4d){logger[_0x96c5('0x38')](_0x57ea4d[_0x96c5('0x3e')]);return rp(_0x57ea4d);})[_0x96c5('0x33')](function(_0x4240e6){var _0x223cb2='';var _0x3e41f7=0x0;try{fs[_0x96c5('0x19')](_0x45134b);}catch(_0x10f1c1){logger[_0x96c5('0x11')](_0x10f1c1);}if(_0x4240e6&&_0x4240e6[_0x96c5('0x3f')]){_0x223cb2=_0x4240e6['results'][_0x96c5('0x40')](function(_0x23b90c){return _0x23b90c&&_0x23b90c[_0x96c5('0x41')][0x0]&&_0x23b90c[_0x96c5('0x41')][0x0]['transcript']?_0x23b90c[_0x96c5('0x41')][0x0][_0x96c5('0x42')]:'';})[_0x96c5('0x43')]('\x0a');_0x3e41f7=_0x4240e6['results'][_0x96c5('0x40')](function(_0xc7f191){return _0xc7f191&&_0xc7f191[_0x96c5('0x41')][0x0]&&_0xc7f191[_0x96c5('0x41')][0x0]['confidence']?_0xc7f191[_0x96c5('0x41')][0x0][_0x96c5('0x44')]:0x0;})['join']('\x0a');}logger[_0x96c5('0x38')](_0x96c5('0x45'),_0x223cb2);logger[_0x96c5('0x38')]('googleASR\x20confidence',_0x3e41f7);return{'transcript':_0x223cb2,'confidence':_0x3e41f7};})[_0x96c5('0x46')](function(_0x96e485){logger[_0x96c5('0x11')](_0x96c5('0x47'),_0x96e485[_0x96c5('0x15')],_0x96e485[_0x96c5('0x48')],_0x96e485['message']);});};exports[_0x96c5('0x49')]=function(_0x36ea82,_0x303aed,_0x566e52,_0x29c303){var _0x37bdc3=apiai(_0x303aed,{'language':_0x29c303||'en'});return _0x37bdc3[_0x96c5('0x4a')](_0x566e52,{'sessionId':md5(_0x36ea82)})[_0x96c5('0x33')](function(_0x3954c6){logger[_0x96c5('0x38')](JSON['stringify'](_0x3954c6));return{'source':_0x3954c6[_0x96c5('0x4b')][_0x96c5('0x4c')],'resolvedQuery':_0x3954c6[_0x96c5('0x4b')][_0x96c5('0x4d')],'action':_0x3954c6['result'][_0x96c5('0x4e')],'actionIncomplete':_0x3954c6[_0x96c5('0x4b')][_0x96c5('0x4f')],'speech':_0x3954c6[_0x96c5('0x4b')][_0x96c5('0x50')][_0x96c5('0x51')],'score':_0x3954c6[_0x96c5('0x4b')][_0x96c5('0x52')],'statusCode':_0x3954c6[_0x96c5('0x53')]['code'],'endConversation':_0x3954c6['result'][_0x96c5('0x54')][_0x96c5('0x55')]||![],'isFallbackIntent':_0x3954c6[_0x96c5('0x4b')][_0x96c5('0x54')][_0x96c5('0x56')]};});};exports[_0x96c5('0x57')]=function(_0x269075,_0x45cab0,_0x1cac62,_0x40746f){return tilde[_0x96c5('0x3d')](_0x269075,_0x45cab0,_0x1cac62,_0x40746f)[_0x96c5('0x33')](function(_0x48dfea){try{fs[_0x96c5('0x19')](_0x269075);}catch(_0x1d970c){logger[_0x96c5('0x11')](_0x1d970c);}logger[_0x96c5('0x38')](_0x96c5('0x58'),_0x48dfea[_0x96c5('0x42')]);logger[_0x96c5('0x38')]('Tilde\x20ASR\x20confidence',_0x48dfea['confidence']);return _0x48dfea;});};exports[_0x96c5('0x59')]=function(_0x3f0ee0,_0x24b5b3,_0x61afac,_0x1c01c9,_0x14aaad,_0x561856){var _0x37c538=path[_0x96c5('0x24')](__dirname,_0x96c5('0x25'),rs[_0x96c5('0x26')](0x4)+'.mp3');var _0x119063;return aws[_0x96c5('0x5a')](_0x3f0ee0,_0x24b5b3,_0x61afac,_0x1c01c9,_0x14aaad,_0x561856,_0x37c538)[_0x96c5('0x33')](function(){_0x119063=path[_0x96c5('0x24')](__dirname,'tmp',rs[_0x96c5('0x26')](0x4)+_0x96c5('0x27'));return convertFile(_0x37c538,_0x119063);})['then'](function(){try{fs[_0x96c5('0x19')](_0x37c538);fs[_0x96c5('0x37')](_0x119063,'777');}catch(_0xba986f){logger[_0x96c5('0x11')](_0xba986f);}return _0x119063[_0x96c5('0x29')]('.')[0x0];});};exports[_0x96c5('0x5b')]=function(_0x5ab9c7,_0xa8665b,_0x57d8c3,_0x457aeb,_0x5928f0,_0x39c481){return aws[_0x96c5('0x5c')](_0x5ab9c7,_0xa8665b,_0x57d8c3,_0x457aeb,_0x5928f0,_0x39c481)[_0x96c5('0x33')](function(_0x330be8){logger[_0x96c5('0x38')](JSON[_0x96c5('0x5d')](_0x330be8));return _0x330be8;});};exports['ispeechTTS']=function(_0x45f945,_0x24727a,_0x205f77,_0x10afbd){var _0x2dbce7=util[_0x96c5('0x5e')](_0x96c5('0x5f'),ISPEECH_API,_0x45f945,encodeURIComponent(_0x24727a),_0x205f77,_0x10afbd);var _0x30282e=path[_0x96c5('0x24')](__dirname,_0x96c5('0x25'),rs[_0x96c5('0x26')](0x4)+_0x96c5('0x34'));var _0xc86396;return downloadFile(_0x2dbce7,_0x30282e)[_0x96c5('0x33')](function(){_0xc86396=path[_0x96c5('0x24')](__dirname,_0x96c5('0x25'),rs[_0x96c5('0x26')](0x4)+_0x96c5('0x27'));return convertFile(_0x30282e,_0xc86396);})[_0x96c5('0x33')](function(){try{fs[_0x96c5('0x19')](_0x30282e);fs['chmodSync'](_0xc86396,_0x96c5('0x3b'));}catch(_0x6f0ace){logger['error'](_0x6f0ace);}return _0xc86396[_0x96c5('0x29')]('.')[0x0];});};exports[_0x96c5('0x60')]=function(_0x2e96f0,_0x17c8da,_0x1985d7,_0x59b163){var _0x325fa2=util[_0x96c5('0x5e')](_0x96c5('0x61'),ISPEECH_API,_0x17c8da,_0x1985d7,base64Encode(_0x2e96f0),_0x59b163?util[_0x96c5('0x5e')](_0x96c5('0x62'),encodeURIComponent(_0x59b163)):_0x96c5('0x63'));return uploadFile(_0x325fa2)[_0x96c5('0x33')](function(_0x472773){return querystring[_0x96c5('0x3')](_0x472773);});};exports[_0x96c5('0x64')]=function(_0x1973a5,_0x391a8b){return sestek['nda'](_0x1973a5,_0x391a8b)[_0x96c5('0x33')](function(_0x3e6cb1){logger[_0x96c5('0x38')](JSON[_0x96c5('0x5d')](_0x3e6cb1));var _0x36e196={'speech':_0x3e6cb1[_0x96c5('0x65')],'action':_0x3e6cb1[_0x96c5('0x66')]?_0x3e6cb1[_0x96c5('0x66')][_0x96c5('0x67')]:undefined,'actiondata':_0x3e6cb1['channelData']?_0x3e6cb1['channelData'][_0x96c5('0x68')]:undefined};if(_0x3e6cb1['channelData']&&_0x3e6cb1[_0x96c5('0x66')][_0x96c5('0x69')]){return base64Decode(_0x3e6cb1[_0x96c5('0x66')][_0x96c5('0x69')]['Data'],path[_0x96c5('0x24')](__dirname,_0x96c5('0x25'),rs[_0x96c5('0x26')](0x4)+_0x96c5('0x27')))['then'](function(_0xf2828f){_0x36e196[_0x96c5('0x6a')]=_0xf2828f;return _0x36e196;});}return _0x36e196;});};exports['dirName']=function(){return __dirname;}; \ No newline at end of file +var _0x8ee5=['./google','./aws','./tilde','./sestek','../../../config/logger','https://api.ispeech.org/api/rest','protocol','https:','host','WHAT_EVER','get','error','\x20failed,\x20status\x20code\x20=\x20','statusCode','statusMessage','request\x20to\x20','createWriteStream','finish\x20download\x20file','close','unlink','download\x20error','pipe','end','data','transcode','wav','error\x20convert','resolve','generate','.wav','writeFileSync','then','chmodSync','777','split','readFileSync','toString','base64','googleCloudTTS','https://texttospeech.googleapis.com/v1/','?key=','ssml','input','voice','audioConfig','tmp','from','audioContent','writeFile','info','googleTTS','.mp3','goggleTTS\x20path','googleASR','asr','results','map','alternatives','transcript','join','confidence','googleASR\x20transcription','googleASR\x20confidence','name','message','googleDialogflow','textRequest','stringify','result','source','resolvedQuery','action','status','code','metadata','endConversation','isFallbackIntent','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','awsPolly','awsLex','lex','ispeechTTS','format','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','model=%s','freeform=3','parse','sestekNDA','nda','text','channelData','CustomActionData','AudioFromTts','audiofile','dirName','path','http','randomstring','sox','util','querystring','google-tts-api','apiai-promise','md5'];(function(_0x2ca8cd,_0x2b9279){var _0x34faf2=function(_0x366cfd){while(--_0x366cfd){_0x2ca8cd['push'](_0x2ca8cd['shift']());}};_0x34faf2(++_0x2b9279);}(_0x8ee5,0xc9));var _0x58ee=function(_0x48eda9,_0x2f3b56){_0x48eda9=_0x48eda9-0x0;var _0x482289=_0x8ee5[_0x48eda9];return _0x482289;};'use strict';var fs=require('fs');var path=require(_0x58ee('0x0'));var http=require(_0x58ee('0x1'));var https=require('https');var urlParse=require('url')['parse'];var BPromise=require('bluebird');var rs=require(_0x58ee('0x2'));var sox=require(_0x58ee('0x3'));var rp=require('request-promise');var util=require(_0x58ee('0x4'));var querystring=require(_0x58ee('0x5'));var moment=require('moment');var tts=require(_0x58ee('0x6'));var apiai=require(_0x58ee('0x7'));var md5=require(_0x58ee('0x8'));var google=require(_0x58ee('0x9'));var aws=require(_0x58ee('0xa'));var tilde=require(_0x58ee('0xb'));var sestek=require(_0x58ee('0xc'));var logger=require(_0x58ee('0xd'))('agi');var ISPEECH_API=_0x58ee('0xe');function downloadFile(_0x463eab,_0x13f197){return new BPromise(function(_0x3e81f3,_0x54ed51){var _0x4abb45=urlParse(_0x463eab);var _0x1bf56a=_0x4abb45[_0x58ee('0xf')]===_0x58ee('0x10')?https:http;var _0x34c690={'host':_0x4abb45[_0x58ee('0x11')],'path':_0x4abb45[_0x58ee('0x0')],'headers':{'user-agent':_0x58ee('0x12')}};_0x1bf56a[_0x58ee('0x13')](_0x34c690,function(_0x432b84){if(_0x432b84['statusCode']!==0xc8){logger[_0x58ee('0x14')]('request\x20to\x20'+_0x463eab+_0x58ee('0x15')+_0x432b84[_0x58ee('0x16')]+'\x20('+_0x432b84[_0x58ee('0x17')]+')');_0x54ed51(new Error(_0x58ee('0x18')+_0x463eab+_0x58ee('0x15')+_0x432b84[_0x58ee('0x16')]+'\x20('+_0x432b84[_0x58ee('0x17')]+')'));return;}var _0x31c9f7=fs[_0x58ee('0x19')](_0x13f197);_0x31c9f7['on']('finish',function(){logger['info'](_0x58ee('0x1a'));_0x31c9f7[_0x58ee('0x1b')](_0x3e81f3);});_0x31c9f7['on'](_0x58ee('0x14'),function(_0xab79aa){fs[_0x58ee('0x1c')](_0x13f197);logger['error'](_0x58ee('0x1d'),_0xab79aa);_0x54ed51(_0xab79aa);});_0x432b84[_0x58ee('0x1e')](_0x31c9f7);})['on'](_0x58ee('0x14'),function(_0x52da9e){logger['error'](_0x52da9e);_0x54ed51(_0x52da9e);})[_0x58ee('0x1f')]();});}function uploadFile(_0x16d7ee){return new BPromise(function(_0xad17d,_0x23573e){var _0x50ea69=urlParse(_0x16d7ee);var _0x19b1fd=_0x50ea69[_0x58ee('0xf')]===_0x58ee('0x10')?https:http;var _0x456c1f={'host':_0x50ea69[_0x58ee('0x11')],'path':_0x50ea69[_0x58ee('0x0')],'headers':{'user-agent':_0x58ee('0x12')}};_0x19b1fd[_0x58ee('0x13')](_0x456c1f,function(_0x15d827){if(_0x15d827['statusCode']!==0xc8){_0x23573e(new Error(_0x58ee('0x18')+_0x16d7ee+'\x20failed,\x20status\x20code\x20=\x20'+_0x15d827[_0x58ee('0x16')]+'\x20('+_0x15d827['statusMessage']+')'));return;}var _0x112975='';_0x15d827['on'](_0x58ee('0x20'),function(_0x4ab7f1){_0x112975+=_0x4ab7f1;});_0x15d827['on']('end',function(){_0xad17d(_0x112975);});})['on'](_0x58ee('0x14'),function(_0x43e635){_0x23573e(_0x43e635);})[_0x58ee('0x1f')]();});}function convertFile(_0x180b9e,_0x3e1695){return new BPromise(function(_0x54a99c,_0x1a0002){var _0x4b9d77=sox[_0x58ee('0x21')](_0x180b9e,_0x3e1695,{'sampleRate':0x1f40,'format':_0x58ee('0x22'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x4b9d77['on']('error',function(_0xfb06a3){logger[_0x58ee('0x14')](_0x58ee('0x23'),_0xfb06a3);_0x1a0002(_0xfb06a3);});_0x4b9d77['on']('end',function(){logger['info']('finish\x20to\x20convert');_0x54a99c();});_0x4b9d77['start']();});}function base64Decode(_0x227e14,_0xedc24b){var _0x3784f6=path[_0x58ee('0x24')](__dirname,'tmp',rs[_0x58ee('0x25')](0x4)+_0x58ee('0x26'));fs[_0x58ee('0x27')](_0x3784f6,_0x227e14,'base64');return convertFile(_0x3784f6,_0xedc24b)[_0x58ee('0x28')](function(){try{fs['unlink'](_0x3784f6);fs[_0x58ee('0x29')](_0xedc24b,_0x58ee('0x2a'));}catch(_0x1335c8){logger['error'](_0x1335c8);}return _0xedc24b[_0x58ee('0x2b')]('.')[0x0];});}function base64Encode(_0x4a114c){var _0x25f10b=fs[_0x58ee('0x2c')](_0x4a114c);return new Buffer(_0x25f10b)[_0x58ee('0x2d')](_0x58ee('0x2e'));}exports[_0x58ee('0x2f')]=function(_0x44e150,_0x1cb0fc,_0x44f59c,_0x5184fb,_0x2e21f7,_0x497ac8){var _0x8062b8,_0x51c3bb;var _0x2e1aa6=_0x58ee('0x30');var _0x2884a3=_0x58ee('0x31')+_0x44e150;var _0x181a7a={};if(_0x1cb0fc===_0x58ee('0x32')){_0x181a7a['input']={'ssml':_0x44f59c};}else{_0x181a7a[_0x58ee('0x33')]={'text':_0x44f59c};};_0x181a7a[_0x58ee('0x34')]={'languageCode':_0x5184fb,'ssmlGender':_0x2e21f7};_0x181a7a[_0x58ee('0x35')]={'audioEncoding':'MP3','sampleRateHertz':0x1f40};var _0x3b2cda={'url':_0x2e1aa6+'text:synthesize'+_0x2884a3,'method':'POST','json':!![],'body':_0x181a7a};return rp(_0x3b2cda)[_0x58ee('0x28')](function(_0x1c4039){return new BPromise(function(_0x19786c,_0x38609a){_0x8062b8=path[_0x58ee('0x24')](__dirname,_0x58ee('0x36'),rs[_0x58ee('0x25')](0x4)+'.mp3');var _0x4c1fb1=Buffer[_0x58ee('0x37')](_0x1c4039[_0x58ee('0x38')],_0x58ee('0x2e'));return fs[_0x58ee('0x39')](_0x8062b8,_0x4c1fb1,function(_0x4dcd6d){_0x38609a(_0x4dcd6d);},function(_0x5c976c){fs[_0x58ee('0x29')](_0x8062b8,_0x58ee('0x2a'));_0x19786c(_0x5c976c);});});})[_0x58ee('0x28')](function(_0x599916){_0x51c3bb=path[_0x58ee('0x24')](__dirname,_0x58ee('0x36'),rs[_0x58ee('0x25')](0x4)+_0x58ee('0x26'));return convertFile(_0x8062b8,_0x51c3bb);})['then'](function(){try{fs['unlink'](_0x8062b8);fs[_0x58ee('0x29')](_0x51c3bb,_0x58ee('0x2a'));}catch(_0x1a9033){logger[_0x58ee('0x14')](_0x1a9033);}logger[_0x58ee('0x3a')]('googleCloudTTS\x20path',_0x51c3bb[_0x58ee('0x2b')]('.')[0x0]);return _0x51c3bb[_0x58ee('0x2b')]('.')[0x0];});};exports[_0x58ee('0x3b')]=function(_0x37cdca,_0x52fc5a){var _0x215be9,_0x2f289f;return tts(_0x37cdca,_0x52fc5a||'en',0x1)[_0x58ee('0x28')](function(_0x16a74b){logger['info'](_0x16a74b);_0x215be9=path[_0x58ee('0x24')](__dirname,_0x58ee('0x36'),rs[_0x58ee('0x25')](0x4)+_0x58ee('0x3c'));return downloadFile(_0x16a74b,_0x215be9);})[_0x58ee('0x28')](function(){_0x2f289f=path[_0x58ee('0x24')](__dirname,_0x58ee('0x36'),rs[_0x58ee('0x25')](0x4)+_0x58ee('0x26'));return convertFile(_0x215be9,_0x2f289f);})[_0x58ee('0x28')](function(){try{fs[_0x58ee('0x1c')](_0x215be9);fs['chmodSync'](_0x2f289f,'777');}catch(_0x4a0b00){logger['error'](_0x4a0b00);}logger[_0x58ee('0x3a')](_0x58ee('0x3d'),_0x2f289f[_0x58ee('0x2b')]('.')[0x0]);return _0x2f289f[_0x58ee('0x2b')]('.')[0x0];});};exports[_0x58ee('0x3e')]=function(_0x3b6c6f,_0x4cb524,_0x28cd7a){return google[_0x58ee('0x3f')](_0x3b6c6f,_0x4cb524,_0x28cd7a)[_0x58ee('0x28')](function(_0x5e8ec2){logger[_0x58ee('0x3a')](_0x5e8ec2['uri']);return rp(_0x5e8ec2);})[_0x58ee('0x28')](function(_0x3c7ed8){var _0x2ba3a3='';var _0x2f470d=0x0;try{fs['unlink'](_0x3b6c6f);}catch(_0x1fd2c3){logger[_0x58ee('0x14')](_0x1fd2c3);}if(_0x3c7ed8&&_0x3c7ed8[_0x58ee('0x40')]){_0x2ba3a3=_0x3c7ed8['results'][_0x58ee('0x41')](function(_0x422ec8){return _0x422ec8&&_0x422ec8[_0x58ee('0x42')][0x0]&&_0x422ec8[_0x58ee('0x42')][0x0][_0x58ee('0x43')]?_0x422ec8['alternatives'][0x0][_0x58ee('0x43')]:'';})[_0x58ee('0x44')]('\x0a');_0x2f470d=_0x3c7ed8[_0x58ee('0x40')][_0x58ee('0x41')](function(_0x70a945){return _0x70a945&&_0x70a945[_0x58ee('0x42')][0x0]&&_0x70a945['alternatives'][0x0][_0x58ee('0x45')]?_0x70a945[_0x58ee('0x42')][0x0][_0x58ee('0x45')]:0x0;})['join']('\x0a');}logger[_0x58ee('0x3a')](_0x58ee('0x46'),_0x2ba3a3);logger['info'](_0x58ee('0x47'),_0x2f470d);return{'transcript':_0x2ba3a3,'confidence':_0x2f470d};})['catch'](function(_0x19e3f1){logger[_0x58ee('0x14')]('[%s]\x20%s:%s',_0x19e3f1['statusCode'],_0x19e3f1[_0x58ee('0x48')],_0x19e3f1[_0x58ee('0x49')]);});};exports[_0x58ee('0x4a')]=function(_0x46b152,_0x2bf0dc,_0x148187,_0x7031c9){var _0x1f3dba=apiai(_0x2bf0dc,{'language':_0x7031c9||'en'});return _0x1f3dba[_0x58ee('0x4b')](_0x148187,{'sessionId':md5(_0x46b152)})[_0x58ee('0x28')](function(_0x10cb57){logger[_0x58ee('0x3a')](JSON[_0x58ee('0x4c')](_0x10cb57));return{'source':_0x10cb57[_0x58ee('0x4d')][_0x58ee('0x4e')],'resolvedQuery':_0x10cb57[_0x58ee('0x4d')][_0x58ee('0x4f')],'action':_0x10cb57[_0x58ee('0x4d')][_0x58ee('0x50')],'actionIncomplete':_0x10cb57[_0x58ee('0x4d')]['actionIncomplete'],'speech':_0x10cb57[_0x58ee('0x4d')]['fulfillment']['speech'],'score':_0x10cb57[_0x58ee('0x4d')]['score'],'statusCode':_0x10cb57[_0x58ee('0x51')][_0x58ee('0x52')],'endConversation':_0x10cb57[_0x58ee('0x4d')][_0x58ee('0x53')][_0x58ee('0x54')]||![],'isFallbackIntent':_0x10cb57[_0x58ee('0x4d')][_0x58ee('0x53')][_0x58ee('0x55')]};});};exports['tildeASR']=function(_0x21ef1f,_0xe7153c,_0x31441b,_0x4a4600){return tilde[_0x58ee('0x3f')](_0x21ef1f,_0xe7153c,_0x31441b,_0x4a4600)[_0x58ee('0x28')](function(_0x2bf465){try{fs['unlink'](_0x21ef1f);}catch(_0x452b8f){logger[_0x58ee('0x14')](_0x452b8f);}logger['info'](_0x58ee('0x56'),_0x2bf465[_0x58ee('0x43')]);logger[_0x58ee('0x3a')](_0x58ee('0x57'),_0x2bf465[_0x58ee('0x45')]);return _0x2bf465;});};exports[_0x58ee('0x58')]=function(_0x3f57be,_0x4fdb80,_0x3c66dd,_0x3ebd8f,_0x227bd7,_0x4a3c01){var _0x5adf34=path[_0x58ee('0x24')](__dirname,'tmp',rs['generate'](0x4)+_0x58ee('0x3c'));var _0x5a0430;return aws['polly'](_0x3f57be,_0x4fdb80,_0x3c66dd,_0x3ebd8f,_0x227bd7,_0x4a3c01,_0x5adf34)[_0x58ee('0x28')](function(){_0x5a0430=path[_0x58ee('0x24')](__dirname,_0x58ee('0x36'),rs[_0x58ee('0x25')](0x4)+_0x58ee('0x26'));return convertFile(_0x5adf34,_0x5a0430);})[_0x58ee('0x28')](function(){try{fs[_0x58ee('0x1c')](_0x5adf34);fs[_0x58ee('0x29')](_0x5a0430,_0x58ee('0x2a'));}catch(_0x50d8ac){logger[_0x58ee('0x14')](_0x50d8ac);}return _0x5a0430[_0x58ee('0x2b')]('.')[0x0];});};exports[_0x58ee('0x59')]=function(_0x449cc8,_0x4fda3e,_0x53f344,_0x107ba2,_0x1d6bfe,_0x439dc4){return aws[_0x58ee('0x5a')](_0x449cc8,_0x4fda3e,_0x53f344,_0x107ba2,_0x1d6bfe,_0x439dc4)[_0x58ee('0x28')](function(_0x9038e0){logger['info'](JSON[_0x58ee('0x4c')](_0x9038e0));return _0x9038e0;});};exports[_0x58ee('0x5b')]=function(_0x3f4d50,_0x17d369,_0x11d743,_0x1d128b){var _0x331e2f=util[_0x58ee('0x5c')](_0x58ee('0x5d'),ISPEECH_API,_0x3f4d50,encodeURIComponent(_0x17d369),_0x11d743,_0x1d128b);var _0x307f17=path[_0x58ee('0x24')](__dirname,'tmp',rs[_0x58ee('0x25')](0x4)+_0x58ee('0x3c'));var _0xc8c2d4;return downloadFile(_0x331e2f,_0x307f17)[_0x58ee('0x28')](function(){_0xc8c2d4=path['resolve'](__dirname,_0x58ee('0x36'),rs['generate'](0x4)+_0x58ee('0x26'));return convertFile(_0x307f17,_0xc8c2d4);})[_0x58ee('0x28')](function(){try{fs[_0x58ee('0x1c')](_0x307f17);fs[_0x58ee('0x29')](_0xc8c2d4,_0x58ee('0x2a'));}catch(_0x29022c){logger[_0x58ee('0x14')](_0x29022c);}return _0xc8c2d4['split']('.')[0x0];});};exports['ispeechASR']=function(_0x2927a1,_0x184784,_0x3cabc9,_0x20452e){var _0x2da15f=util[_0x58ee('0x5c')]('%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s',ISPEECH_API,_0x184784,_0x3cabc9,base64Encode(_0x2927a1),_0x20452e?util['format'](_0x58ee('0x5e'),encodeURIComponent(_0x20452e)):_0x58ee('0x5f'));return uploadFile(_0x2da15f)['then'](function(_0x143987){return querystring[_0x58ee('0x60')](_0x143987);});};exports[_0x58ee('0x61')]=function(_0x467e5f,_0x518f4b){return sestek[_0x58ee('0x62')](_0x467e5f,_0x518f4b)['then'](function(_0x83eef9){logger['info'](JSON[_0x58ee('0x4c')](_0x83eef9));var _0xbd2991={'speech':_0x83eef9[_0x58ee('0x63')],'action':_0x83eef9['channelData']?_0x83eef9[_0x58ee('0x64')]['CustomAction']:undefined,'actiondata':_0x83eef9[_0x58ee('0x64')]?_0x83eef9[_0x58ee('0x64')][_0x58ee('0x65')]:undefined};if(_0x83eef9['channelData']&&_0x83eef9[_0x58ee('0x64')][_0x58ee('0x66')]){return base64Decode(_0x83eef9[_0x58ee('0x64')][_0x58ee('0x66')]['Data'],path[_0x58ee('0x24')](__dirname,_0x58ee('0x36'),rs[_0x58ee('0x25')](0x4)+_0x58ee('0x26')))[_0x58ee('0x28')](function(_0x3a08cb){_0xbd2991[_0x58ee('0x67')]=_0x3a08cb;return _0xbd2991;});}return _0xbd2991;});};exports[_0x58ee('0x68')]=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 d66a42c..5726658 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 _0x5f1c=['exports','./nda'];(function(_0x322c28,_0x22f529){var _0x5b5b26=function(_0xfcc103){while(--_0xfcc103){_0x322c28['push'](_0x322c28['shift']());}};_0x5b5b26(++_0x22f529);}(_0x5f1c,0x9b));var _0xc5f1=function(_0x20a978,_0x93a2b6){_0x20a978=_0x20a978-0x0;var _0x393ad7=_0x5f1c[_0x20a978];return _0x393ad7;};var nda=require(_0xc5f1('0x0'));module[_0xc5f1('0x1')]={'nda':nda}; \ No newline at end of file +var _0x1e0b=['exports','./nda'];(function(_0x3fd1b9,_0x12fb18){var _0x31ccdf=function(_0xb15af8){while(--_0xb15af8){_0x3fd1b9['push'](_0x3fd1b9['shift']());}};_0x31ccdf(++_0x12fb18);}(_0x1e0b,0xc3));var _0xb1e0=function(_0x595013,_0x65a215){_0x595013=_0x595013-0x0;var _0x2a29e3=_0x1e0b[_0x595013];return _0x2a29e3;};var nda=require(_0xb1e0('0x0'));module[_0xb1e0('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 1fdd159..0ab4075 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 _0x8009=['ndaactivity_type','message','Nda','uniqueid','callerid','calleridname','dnid','text','Bearer\x20','access_token','project','body','channelData','ProjectName','ndagenerate_audio','AudioOutputSettings','custom_action','CustomAction','custom_action_data','CustomActionData','info','stringify','request-promise','url','../../../../../config/logger','agi','exports','POST','resolve','ndauth_url','/token','password','username','then','ndassistant_url'];(function(_0x492365,_0x25777d){var _0x5948df=function(_0x3b0db0){while(--_0x3b0db0){_0x492365['push'](_0x492365['shift']());}};_0x5948df(++_0x25777d);}(_0x8009,0xa2));var _0x9800=function(_0x375a42,_0x471294){_0x375a42=_0x375a42-0x0;var _0x3d586a=_0x8009[_0x375a42];return _0x3d586a;};'use strict';var rp=require(_0x9800('0x0'));var url=require(_0x9800('0x1'));var logger=require(_0x9800('0x2'))(_0x9800('0x3'));module[_0x9800('0x4')]=function(_0x45dfa4,_0x11b04b){var _0x325c30={'method':_0x9800('0x5'),'uri':url[_0x9800('0x6')](_0x11b04b[_0x9800('0x7')],_0x9800('0x8')),'form':{'grant_type':_0x9800('0x9'),'username':_0x11b04b[_0x9800('0xa')],'password':_0x11b04b[_0x9800('0x9')]},'json':!![]};return rp(_0x325c30)[_0x9800('0xb')](function(_0x3a1de9){var _0x281a8f={'method':_0x9800('0x5'),'uri':url['resolve'](_0x11b04b[_0x9800('0xc')],'/api/NaturalDialogAssistant/v1/Run'),'body':{'type':_0x11b04b[_0x9800('0xd')]||_0x9800('0xe'),'channelId':_0x9800('0xf'),'conversation':{'id':_0x45dfa4[_0x9800('0x10')]},'from':{'id':_0x45dfa4[_0x9800('0x11')],'name':_0x45dfa4[_0x9800('0x12')]},'recipient':{'id':_0x45dfa4[_0x9800('0x13')],'name':_0x45dfa4['extension']},'text':_0x11b04b[_0x9800('0x14')],'channelData':{}},'headers':{'Authorization':_0x9800('0x15')+_0x3a1de9[_0x9800('0x16')]},'json':!![]};if(_0x11b04b[_0x9800('0x17')]){_0x281a8f[_0x9800('0x18')][_0x9800('0x19')][_0x9800('0x1a')]=_0x11b04b['project'];}if(_0x11b04b[_0x9800('0x1b')]=='1'){_0x281a8f['body'][_0x9800('0x19')][_0x9800('0x1c')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':'audio/wav'};}if(_0x11b04b[_0x9800('0x1d')]){_0x281a8f['body']['channelData'][_0x9800('0x1e')]=_0x11b04b[_0x9800('0x1d')];if(_0x11b04b[_0x9800('0x1f')]){_0x281a8f[_0x9800('0x18')][_0x9800('0x19')][_0x9800('0x20')]=_0x11b04b[_0x9800('0x1f')];}}logger[_0x9800('0x21')](JSON[_0x9800('0x22')](_0x281a8f));return rp(_0x281a8f);});}; \ No newline at end of file +var _0xa7ef=['uniqueid','callerid','calleridname','dnid','extension','text','access_token','project','body','channelData','ProjectName','ndagenerate_audio','AudioOutputSettings','audio/wav','custom_action','custom_action_data','CustomActionData','info','stringify','request-promise','agi','exports','POST','resolve','ndauth_url','username','password','then','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','message'];(function(_0x1ab356,_0x2120d1){var _0x4456af=function(_0x44bf4){while(--_0x44bf4){_0x1ab356['push'](_0x1ab356['shift']());}};_0x4456af(++_0x2120d1);}(_0xa7ef,0x70));var _0xfa7e=function(_0x890369,_0x1124b0){_0x890369=_0x890369-0x0;var _0x59478a=_0xa7ef[_0x890369];return _0x59478a;};'use strict';var rp=require(_0xfa7e('0x0'));var url=require('url');var logger=require('../../../../../config/logger')(_0xfa7e('0x1'));module[_0xfa7e('0x2')]=function(_0x455fe6,_0x3a1fe5){var _0x2e033a={'method':_0xfa7e('0x3'),'uri':url[_0xfa7e('0x4')](_0x3a1fe5[_0xfa7e('0x5')],'/token'),'form':{'grant_type':'password','username':_0x3a1fe5[_0xfa7e('0x6')],'password':_0x3a1fe5[_0xfa7e('0x7')]},'json':!![]};return rp(_0x2e033a)[_0xfa7e('0x8')](function(_0x2265a9){var _0x5a1e72={'method':_0xfa7e('0x3'),'uri':url[_0xfa7e('0x4')](_0x3a1fe5['ndassistant_url'],_0xfa7e('0x9')),'body':{'type':_0x3a1fe5[_0xfa7e('0xa')]||_0xfa7e('0xb'),'channelId':'Nda','conversation':{'id':_0x455fe6[_0xfa7e('0xc')]},'from':{'id':_0x455fe6[_0xfa7e('0xd')],'name':_0x455fe6[_0xfa7e('0xe')]},'recipient':{'id':_0x455fe6[_0xfa7e('0xf')],'name':_0x455fe6[_0xfa7e('0x10')]},'text':_0x3a1fe5[_0xfa7e('0x11')],'channelData':{}},'headers':{'Authorization':'Bearer\x20'+_0x2265a9[_0xfa7e('0x12')]},'json':!![]};if(_0x3a1fe5[_0xfa7e('0x13')]){_0x5a1e72[_0xfa7e('0x14')][_0xfa7e('0x15')][_0xfa7e('0x16')]=_0x3a1fe5[_0xfa7e('0x13')];}if(_0x3a1fe5[_0xfa7e('0x17')]=='1'){_0x5a1e72[_0xfa7e('0x14')][_0xfa7e('0x15')][_0xfa7e('0x18')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0xfa7e('0x19')};}if(_0x3a1fe5[_0xfa7e('0x1a')]){_0x5a1e72['body'][_0xfa7e('0x15')]['CustomAction']=_0x3a1fe5[_0xfa7e('0x1a')];if(_0x3a1fe5[_0xfa7e('0x1b')]){_0x5a1e72['body'][_0xfa7e('0x15')][_0xfa7e('0x1c')]=_0x3a1fe5[_0xfa7e('0x1b')];}}logger[_0xfa7e('0x1d')](JSON[_0xfa7e('0x1e')](_0x5a1e72));return rp(_0x5a1e72);});}; \ 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 65d6e20..61bde68 100644 --- a/server/services/agi/scripts/tilde/asr/index.js +++ b/server/services/agi/scripts/tilde/asr/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x84ca=['./lib/api'];(function(_0x12e898,_0x1ef073){var _0x190631=function(_0x1f193d){while(--_0x1f193d){_0x12e898['push'](_0x12e898['shift']());}};_0x190631(++_0x1ef073);}(_0x84ca,0xf6));var _0xa84c=function(_0x17a63c,_0x130b12){_0x17a63c=_0x17a63c-0x0;var _0x213a94=_0x84ca[_0x17a63c];return _0x213a94;};'use strict';var asr=require(_0xa84c('0x0'));module['exports']=function(_0x2772ac,_0x22a5fa,_0x4fd816,_0x4c0626){return asr(_0x2772ac,_0x22a5fa,_0x4fd816,_0x4c0626);}; \ No newline at end of file +var _0x9247=['exports'];(function(_0x590b61,_0x4c4335){var _0x1a14dc=function(_0x2ff4f6){while(--_0x2ff4f6){_0x590b61['push'](_0x590b61['shift']());}};_0x1a14dc(++_0x4c4335);}(_0x9247,0x1ba));var _0x7924=function(_0x596883,_0x9e1340){_0x596883=_0x596883-0x0;var _0x4f3664=_0x9247[_0x596883];return _0x4f3664;};'use strict';var asr=require('./lib/api');module[_0x7924('0x0')]=function(_0x4b89f9,_0x2d6b9d,_0x2f9aa8,_0x588f8a){return asr(_0x4b89f9,_0x2d6b9d,_0x2f9aa8,_0x588f8a);}; \ 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 0855456..f872222 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 _0x5d8e=['wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','sha1','digest','hex','unix','stringify','createReadStream','send','close','EOS','error','Tilde\x20ASR\x20send\x20error','result','final','hypotheses','likelihood','Success.','terminate','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','Tilde\x20ASR\x20parse\x20error','Close\x20Tilde\x20ASR\x20socket','Error\x20Tilde\x20ASR\x20socket','open','bluebird','lodash','moment','crypto','agi','exports','info','Tilde\x20URI'];(function(_0x43001d,_0x538c2b){var _0x513ed6=function(_0x3ec1ba){while(--_0x3ec1ba){_0x43001d['push'](_0x43001d['shift']());}};_0x513ed6(++_0x538c2b);}(_0x5d8e,0x12a));var _0xe5d8=function(_0x20a697,_0x7bac90){_0x20a697=_0x20a697-0x0;var _0x5340d9=_0x5d8e[_0x20a697];return _0x5340d9;};'use strict';var BPromise=require(_0xe5d8('0x0'));var _=require(_0xe5d8('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0xe5d8('0x2'));var crypto=require(_0xe5d8('0x3'));var logger=require('../../../../../../config/logger')(_0xe5d8('0x4'));module[_0xe5d8('0x5')]=function(_0x2e7913,_0x455d11,_0x43bbd2,_0x3210b0){return new BPromise(function(_0x5b4999,_0x49787d){logger[_0xe5d8('0x6')](_0xe5d8('0x7'),_0x3210b0||_0xe5d8('0x8'));var _0x179594=new WebSocket(_0x3210b0||_0xe5d8('0x8'),{'perMessageDeflate':![]});var _0x25cb3f='';var _0x53a5cb='0';var _0x5ee8dc='1';var _0x211b02=_0xe5d8('0x9');function _0x7fd5bd(_0x2b339b){var _0xf3c4ef=crypto['createHash'](_0xe5d8('0xa'));_0xf3c4ef['update'](_0x2b339b);return _0xf3c4ef[_0xe5d8('0xb')](_0xe5d8('0xc'));}function _0x1392dc(){try{logger['info']('Open\x20Tilde\x20ASR\x20socket');var _0x278d83=moment()[_0xe5d8('0xd')]();var _0x27b294=_0x7fd5bd(_0x278d83+_0x455d11+_0x43bbd2);_0x179594['send'](JSON[_0xe5d8('0xe')]({'appID':_0x455d11,'timestamp':_0x278d83,'appKey':_0x27b294}));var _0x41583d=fs[_0xe5d8('0xf')](_0x2e7913);_0x41583d['on']('data',function(_0x3fd6eb){_0x179594[_0xe5d8('0x10')](_0x3fd6eb);});_0x41583d['on'](_0xe5d8('0x11'),function(){_0x179594[_0xe5d8('0x10')](_0xe5d8('0x12'));});}catch(_0x310323){logger[_0xe5d8('0x13')](_0xe5d8('0x14'),JSON[_0xe5d8('0xe')](_0x310323));_0x179594['terminate']();}}function _0x755631(_0x399e8e){try{if(_0x399e8e){var _0x1bf3dc=JSON['parse'](_0x399e8e);switch(_0x1bf3dc['status']){case 0x0:if(_0x1bf3dc[_0xe5d8('0x15')]){if(_0x1bf3dc[_0xe5d8('0x15')][_0xe5d8('0x16')]){logger[_0xe5d8('0x6')]('Tilde\x20ASR\x20hypoteses',JSON[_0xe5d8('0xe')](_0x1bf3dc[_0xe5d8('0x15')][_0xe5d8('0x17')]));_0x25cb3f=_0x1bf3dc[_0xe5d8('0x15')][_0xe5d8('0x17')][0x0]['transcript'];_0x53a5cb=_0x1bf3dc[_0xe5d8('0x15')]['hypotheses'][0x0][_0xe5d8('0x18')];_0x5ee8dc='0';_0x211b02=_0xe5d8('0x19');_0x179594[_0xe5d8('0x1a')]();}}break;case 0x1:logger['info']('No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech');_0x5ee8dc='1';_0x211b02=_0xe5d8('0x9');break;case 0x2:logger[_0xe5d8('0x6')](_0xe5d8('0x1b'));_0x5ee8dc='2';_0x211b02=_0xe5d8('0x1b');break;case 0x9:logger[_0xe5d8('0x6')](_0xe5d8('0x1c'));_0x5ee8dc='9';_0x211b02=_0xe5d8('0x1c');break;case 0xa:logger[_0xe5d8('0x6')]('Authentication\x20failed.');_0x5ee8dc='10';_0x211b02=_0xe5d8('0x1d');break;case 0xb:logger['info']('All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.');_0x5ee8dc='11';_0x211b02='All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.';}}}catch(_0x50f92a){logger[_0xe5d8('0x13')](_0xe5d8('0x1e'),JSON['stringify'](_0x50f92a));_0x179594[_0xe5d8('0x1a')]();}}function _0x2a23f1(){logger['info'](_0xe5d8('0x1f'));_0x5b4999({'transcript':_0x25cb3f,'confidence':_0x53a5cb,'status':_0x5ee8dc,'status_message':_0x211b02});}function _0x146e82(_0x806034){logger[_0xe5d8('0x13')](_0xe5d8('0x20'));if(!_['isNil'](_0x806034)){logger[_0xe5d8('0x13')](_['isObject'](_0x806034)?JSON[_0xe5d8('0xe')](_0x806034):_0x806034);}}_0x179594['on'](_0xe5d8('0x21'),_0x1392dc);_0x179594['on']('message',_0x755631);_0x179594['on'](_0xe5d8('0x11'),_0x2a23f1);_0x179594['on'](_0xe5d8('0x13'),_0x146e82);});}; \ No newline at end of file +var _0x8ee0=['createReadStream','data','close','EOS','error','Tilde\x20ASR\x20send\x20error','terminate','parse','status','result','final','Tilde\x20ASR\x20hypoteses','hypotheses','transcript','likelihood','Success.','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Tilde\x20ASR\x20parse\x20error','Close\x20Tilde\x20ASR\x20socket','isNil','open','bluebird','lodash','moment','agi','info','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','createHash','sha1','digest','hex','Open\x20Tilde\x20ASR\x20socket','unix','send','stringify'];(function(_0x1612ac,_0x30a9d6){var _0x5de118=function(_0x528594){while(--_0x528594){_0x1612ac['push'](_0x1612ac['shift']());}};_0x5de118(++_0x30a9d6);}(_0x8ee0,0x19e));var _0x08ee=function(_0x4d6bfd,_0x8d79ff){_0x4d6bfd=_0x4d6bfd-0x0;var _0x243a46=_0x8ee0[_0x4d6bfd];return _0x243a46;};'use strict';var BPromise=require(_0x08ee('0x0'));var _=require(_0x08ee('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0x08ee('0x2'));var crypto=require('crypto');var logger=require('../../../../../../config/logger')(_0x08ee('0x3'));module['exports']=function(_0x12ee51,_0x5137f8,_0x3d6c6a,_0xb276f8){return new BPromise(function(_0x42fa46,_0x329d0c){logger[_0x08ee('0x4')]('Tilde\x20URI',_0xb276f8||_0x08ee('0x5'));var _0x2d163c=new WebSocket(_0xb276f8||_0x08ee('0x5'),{'perMessageDeflate':![]});var _0x54711b='';var _0x47c961='0';var _0x4c9d04='1';var _0x52105b=_0x08ee('0x6');function _0x1fdbc1(_0x2bcd05){var _0x39cd5b=crypto[_0x08ee('0x7')](_0x08ee('0x8'));_0x39cd5b['update'](_0x2bcd05);return _0x39cd5b[_0x08ee('0x9')](_0x08ee('0xa'));}function _0x567008(){try{logger['info'](_0x08ee('0xb'));var _0xfbd7a7=moment()[_0x08ee('0xc')]();var _0x4b46f6=_0x1fdbc1(_0xfbd7a7+_0x5137f8+_0x3d6c6a);_0x2d163c[_0x08ee('0xd')](JSON[_0x08ee('0xe')]({'appID':_0x5137f8,'timestamp':_0xfbd7a7,'appKey':_0x4b46f6}));var _0xb78d89=fs[_0x08ee('0xf')](_0x12ee51);_0xb78d89['on'](_0x08ee('0x10'),function(_0x49fbd7){_0x2d163c[_0x08ee('0xd')](_0x49fbd7);});_0xb78d89['on'](_0x08ee('0x11'),function(){_0x2d163c[_0x08ee('0xd')](_0x08ee('0x12'));});}catch(_0x1d02cc){logger[_0x08ee('0x13')](_0x08ee('0x14'),JSON['stringify'](_0x1d02cc));_0x2d163c[_0x08ee('0x15')]();}}function _0x3ecfca(_0xea539e){try{if(_0xea539e){var _0x5edd38=JSON[_0x08ee('0x16')](_0xea539e);switch(_0x5edd38[_0x08ee('0x17')]){case 0x0:if(_0x5edd38['result']){if(_0x5edd38[_0x08ee('0x18')][_0x08ee('0x19')]){logger[_0x08ee('0x4')](_0x08ee('0x1a'),JSON[_0x08ee('0xe')](_0x5edd38[_0x08ee('0x18')]['hypotheses']));_0x54711b=_0x5edd38[_0x08ee('0x18')][_0x08ee('0x1b')][0x0][_0x08ee('0x1c')];_0x47c961=_0x5edd38[_0x08ee('0x18')][_0x08ee('0x1b')][0x0][_0x08ee('0x1d')];_0x4c9d04='0';_0x52105b=_0x08ee('0x1e');_0x2d163c[_0x08ee('0x15')]();}}break;case 0x1:logger[_0x08ee('0x4')](_0x08ee('0x6'));_0x4c9d04='1';_0x52105b=_0x08ee('0x6');break;case 0x2:logger[_0x08ee('0x4')](_0x08ee('0x1f'));_0x4c9d04='2';_0x52105b='Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.';break;case 0x9:logger[_0x08ee('0x4')](_0x08ee('0x20'));_0x4c9d04='9';_0x52105b=_0x08ee('0x20');break;case 0xa:logger['info'](_0x08ee('0x21'));_0x4c9d04='10';_0x52105b=_0x08ee('0x21');break;case 0xb:logger[_0x08ee('0x4')](_0x08ee('0x22'));_0x4c9d04='11';_0x52105b='All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.';}}}catch(_0x8f5e30){logger[_0x08ee('0x13')](_0x08ee('0x23'),JSON['stringify'](_0x8f5e30));_0x2d163c[_0x08ee('0x15')]();}}function _0x3501ba(){logger[_0x08ee('0x4')](_0x08ee('0x24'));_0x42fa46({'transcript':_0x54711b,'confidence':_0x47c961,'status':_0x4c9d04,'status_message':_0x52105b});}function _0x4c8629(_0x275452){logger[_0x08ee('0x13')]('Error\x20Tilde\x20ASR\x20socket');if(!_[_0x08ee('0x25')](_0x275452)){logger['error'](_['isObject'](_0x275452)?JSON[_0x08ee('0xe')](_0x275452):_0x275452);}}_0x2d163c['on'](_0x08ee('0x26'),_0x567008);_0x2d163c['on']('message',_0x3ecfca);_0x2d163c['on'](_0x08ee('0x11'),_0x3501ba);_0x2d163c['on'](_0x08ee('0x13'),_0x4c8629);});}; \ 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 33c4a9d..e7ee153 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 _0x8276=['exports','./asr'];(function(_0x8cd5d9,_0x4d2ea8){var _0x34ff3b=function(_0x5d8b88){while(--_0x5d8b88){_0x8cd5d9['push'](_0x8cd5d9['shift']());}};_0x34ff3b(++_0x4d2ea8);}(_0x8276,0xa7));var _0x6827=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x8276[_0x20a584];return _0x4b41a8;};var asr=require(_0x6827('0x0'));module[_0x6827('0x1')]={'asr':asr}; \ No newline at end of file +var _0xf374=['./asr','exports'];(function(_0x27c4ca,_0x4f70a6){var _0x138c8c=function(_0x463ac4){while(--_0x463ac4){_0x27c4ca['push'](_0x27c4ca['shift']());}};_0x138c8c(++_0x4f70a6);}(_0xf374,0x118));var _0x4f37=function(_0x5e9a14,_0x1f3aaa){_0x5e9a14=_0x5e9a14-0x0;var _0x1bfd53=_0xf374[_0x5e9a14];return _0x1bfd53;};var asr=require(_0x4f37('0x0'));module[_0x4f37('0x1')]={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/server.js b/server/services/agi/server.js index e0abece..e83c07f 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 _0x03ce=['close','nextTick','inherits','util','net','events','EventEmitter','./channel','127.0.0.1','call','error','E_AGI_ARGUMENT_PORT','createServer','listen','listening','emit','connection','getConnections','E_AGI_SERVER_ERROR','E_AGI_SERVER_VOICE_DISABLED','E_AGI_SERVER_MAXCONNECTION','ready','code'];(function(_0x30a2fe,_0x5a2a4c){var _0x2263f0=function(_0x2c8ccd){while(--_0x2c8ccd){_0x30a2fe['push'](_0x30a2fe['shift']());}};_0x2263f0(++_0x5a2a4c);}(_0x03ce,0x1a1));var _0xe03c=function(_0x105aaa,_0x358e95){_0x105aaa=_0x105aaa-0x0;var _0xe4b1fa=_0x03ce[_0x105aaa];return _0xe4b1fa;};'use strict';var util=require(_0xe03c('0x0'));var net=require(_0xe03c('0x1'));var EventEmitter=require(_0xe03c('0x2'))[_0xe03c('0x3')];var AGIError=require('./error');var AGIChannel=require(_0xe03c('0x4'));var AGIServer=function(_0x2e9f29,_0x326c04,_0x527a32){var _0x317708=this,_0x2e9f29=_0x2e9f29||0x11dd,_0x326c04=_0x326c04||_0xe03c('0x5'),_0x2c0e4b=null,_0x4340f0=0x0;EventEmitter[_0xe03c('0x6')](_0x317708);function _0x52dda4(){if(!_0x2e9f29){_0x317708['emit'](_0xe03c('0x7'),new AGIError(_0xe03c('0x8')));return![];}_0x2c0e4b=net[_0xe03c('0x9')]();_0x2c0e4b[_0xe03c('0xa')](_0x2e9f29,_0x326c04);_0x2c0e4b['on'](_0xe03c('0xb'),function(){_0x317708[_0xe03c('0xc')](_0xe03c('0xb'));});_0x2c0e4b['on'](_0xe03c('0xd'),function(_0x4eab47){_0x2c0e4b[_0xe03c('0xe')](function(_0x3f93c0,_0x116e4f){if(_0x3f93c0){_0x317708['emit'](_0xe03c('0x7'),new AGIError(_0xe03c('0xf'),_0x3f93c0));}else if(_0x527a32&&_0x527a32<0x0){_0x317708[_0xe03c('0xc')](_0xe03c('0x7'),new AGIError(_0xe03c('0x10')));_0x4eab47['destroy']();}else if(_0x527a32&&_0x527a32>0x0&&_0x527a32<_0x116e4f){_0x4340f0+=0x1;_0x317708[_0xe03c('0xc')](_0xe03c('0x7'),new AGIError(_0xe03c('0x11'),_0x4340f0));_0x4eab47['destroy']();}else{var _0x2ffd1f=new AGIChannel(_0x4eab47);_0x2ffd1f['on'](_0xe03c('0x12'),function(){_0x317708[_0xe03c('0xc')](_0xe03c('0xd'),_0x2ffd1f);});}});});_0x2c0e4b['on'](_0xe03c('0x7'),function(_0x54b705){_0x317708[_0xe03c('0xc')](_0xe03c('0x7'),new AGIError('E_AGI_SERVER_ERROR',_0x54b705[_0xe03c('0x13')]));});_0x2c0e4b['on'](_0xe03c('0x14'),function(){_0x317708[_0xe03c('0xc')]('close',new AGIError('E_AGI_SERVER_CLOSE'));});}process[_0xe03c('0x15')](function(){_0x52dda4();});};util[_0xe03c('0x16')](AGIServer,EventEmitter);module['exports']=function(_0x2b33b3,_0x1ac79b,_0x157882){return new AGIServer(_0x2b33b3,_0x1ac79b,_0x157882);}; \ No newline at end of file +var _0x3ae9=['code','nextTick','exports','events','EventEmitter','./error','127.0.0.1','call','emit','error','createServer','listening','connection','getConnections','E_AGI_SERVER_ERROR','destroy','E_AGI_SERVER_MAXCONNECTION','ready'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x3ae9,0xdb));var _0x93ae=function(_0x2763f2,_0x416af8){_0x2763f2=_0x2763f2-0x0;var _0x3ef471=_0x3ae9[_0x2763f2];return _0x3ef471;};'use strict';var util=require('util');var net=require('net');var EventEmitter=require(_0x93ae('0x0'))[_0x93ae('0x1')];var AGIError=require(_0x93ae('0x2'));var AGIChannel=require('./channel');var AGIServer=function(_0x946abf,_0x228854,_0x2dc540){var _0x2af5aa=this,_0x946abf=_0x946abf||0x11dd,_0x228854=_0x228854||_0x93ae('0x3'),_0x51e450=null,_0x3a9a9c=0x0;EventEmitter[_0x93ae('0x4')](_0x2af5aa);function _0x36e141(){if(!_0x946abf){_0x2af5aa[_0x93ae('0x5')](_0x93ae('0x6'),new AGIError('E_AGI_ARGUMENT_PORT'));return![];}_0x51e450=net[_0x93ae('0x7')]();_0x51e450['listen'](_0x946abf,_0x228854);_0x51e450['on']('listening',function(){_0x2af5aa['emit'](_0x93ae('0x8'));});_0x51e450['on'](_0x93ae('0x9'),function(_0x2d0afa){_0x51e450[_0x93ae('0xa')](function(_0x2d9be2,_0x3a5011){if(_0x2d9be2){_0x2af5aa['emit']('error',new AGIError(_0x93ae('0xb'),_0x2d9be2));}else if(_0x2dc540&&_0x2dc540<0x0){_0x2af5aa[_0x93ae('0x5')]('error',new AGIError('E_AGI_SERVER_VOICE_DISABLED'));_0x2d0afa[_0x93ae('0xc')]();}else if(_0x2dc540&&_0x2dc540>0x0&&_0x2dc540<_0x3a5011){_0x3a9a9c+=0x1;_0x2af5aa['emit'](_0x93ae('0x6'),new AGIError(_0x93ae('0xd'),_0x3a9a9c));_0x2d0afa['destroy']();}else{var _0x392a55=new AGIChannel(_0x2d0afa);_0x392a55['on'](_0x93ae('0xe'),function(){_0x2af5aa[_0x93ae('0x5')](_0x93ae('0x9'),_0x392a55);});}});});_0x51e450['on'](_0x93ae('0x6'),function(_0x2d1df5){_0x2af5aa['emit'](_0x93ae('0x6'),new AGIError(_0x93ae('0xb'),_0x2d1df5[_0x93ae('0xf')]));});_0x51e450['on']('close',function(){_0x2af5aa[_0x93ae('0x5')]('close',new AGIError('E_AGI_SERVER_CLOSE'));});}process[_0x93ae('0x10')](function(){_0x36e141();});};util['inherits'](AGIServer,EventEmitter);module[_0x93ae('0x11')]=function(_0x46b704,_0x508d42,_0x2dd19a){return new AGIServer(_0x46b704,_0x508d42,_0x2dd19a);}; \ No newline at end of file diff --git a/server/services/agi/vertices.js b/server/services/agi/vertices.js index 20b99ff..2cabaab 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 _0xc4e1=['getQueryOdbc','open','error','Error\x20getting\x20ODBC\x20connection\x20%s','info','ODBC\x20connection\x20successfully','Error\x20executing\x20query\x20%s','close','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','getSmsAccountById','createSmsMessage','createSquareDetailsReport','uniqueid','label','channel','arg_1','callerid','createSquareRecording','context','priority','accountcode','dnid','file','createSquareMessage','createCmContact','isEmpty','callback_','random','lastName','isNil','list_id','scheduledAt','callback','Callback\x20scheduled\x20at\x20','toString','callback_priority','getPauseById','agent','agentPause','agentUnpause','agentLogout','agentLogin','internal','%s/%s@from-sip/n','shellCommand','exec','googleCloudTTS','apiKey','text','languageCode','en-US','ssmlGender','audioEncoding','MP3','googleTTS','google_tts_language','googleDialogflow','key','dialogflow_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','aws_text_type','awsLex','aws_lex_region','googleASR','google_asr_language','tildeASR','appid','appsecret','uri','agicommand','hasOwnProperty','replaceAllVariables','split','length','getVariable','extra','getAndSetVariable','result','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','isConfigured','maxRetry','sync','retry','Enter\x20in\x20AGI\x20(%s)\x20block','command','args','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','timeout','Wait\x20%s\x20seconds\x20before\x20answer','wait','add','delay','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','custom_app','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','application','options','noop','Executed\x20command\x20%s\x20%s','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','no\x20text\x20configured','Executed\x20command\x20MRCPSynth\x20%s','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','MRCPSynth','lumenvoxasr','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','grammar','no\x20grammar\x20configured','MRCPRecog','LUMENVOX_ASR_CONFIDENCE','RECOG_INPUT()','LUMENVOX_ASR_TRANSCRIPT','LUMENVOX_ASR_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','sestekasr','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','RECOG_CONFIDENCE()','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_TRANSCRIPT','RECOG_INSTANCE()','database','odbc_id','no\x20odbc\x20database\x20found','no\x20query\x20configured','replace','query:\x20%s','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','no\x20variable\x20found','forEach','keys','setVariable','%s[%s][%s]','variable\x20%s\x20set','dial','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','no\x20user\x20selected','no\x20user\x20found','DIAL','SIP/%s','opts','url','Executed\x20command\x20%s','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','no\x20key\x20configured','bot','Trying\x20Dialogflow:\x20%s','DIALOGFLOW_%s','toUpperCase','speech','Dialogflow\x20Result\x20%s','Dialogflow\x20is\x20unreachable','sesteknda','no\x20ndauth\x20url\x20configured','username','no\x20username\x20configured','password','no\x20password\x20configured','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','ext_dial','trunk_id','no\x20trunk\x20selected','no\x20trunk\x20found','trunk_name','SIP/%s/%s','phone','finally','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','file_id','no\x20file\x20audio\x20selected','getData','maxdigit','test','stringify','hiddendigitsnum','hiddendigitspos','substr','generate','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','GOAL\x20%s','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20%s\x20file\x20created','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','aws_bot_name','no\x20bot\x20name\x20configured','isString','AWS_LEX_%s','Amazon\x20Lex\x20ready\x20for\x20fulfillment','message','Amazon\x20Lex\x20Result\x20%s','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','wav','%s/recordings/%s','%s.%s','beep','recordFile','intKey','GOOGLE_ASR_%s','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appid\x20configured','no\x20appsecret\x20configured','NOBEEP','TILDE_ASR_%s','TildeASR\x20Result\x20%s','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','continueAt','extension','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','no\x20condition\x20configured','condition','true','false','EVAL\x20CONDITION\x20%s\x20%s','gotoiftime','interval_id','no\x20interval\x20configured','no\x20intervals\x20found','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','hangup','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','ispeech\x20%s\x20file\x20created','ISPEECH_ASR_%s','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s','ispeech\x20TTS\x20is\x20unreachable','login','Enter\x20in\x20LOGIN\x20(%s)\x20block','findBy','FIND\x20AGENT\x20%s\x20BY\x20%s','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','logout','no\x20find\x20by\x20configured','AGENT\x20%s\x20FOUND\x20BY','math','operation','math\x20%s','%s[%s]','Enter\x20in\x20MENU\x20(%s)\x20block','no\x20file\x20audio\x20found','response','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','output','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','getPause','PLAYBACK','Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','no\x20queue\x20selected','no\x20queue\x20found','indexOf','XMCS-QUEUE','toLowerCase','QUEUE','macro','gosub','record','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','%s_%s','%s/recordings/%s.%s','RECORDING_SAVENAME','escape_digits','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','digits','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayNumber','number','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','sendMail','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','no\x20mail\x20account\x20configured','Smtp','\x22%s\x22\x20<%s>','email','user','bcc','service','host','port','secure','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','sms_account_id','sendSMS\x20message','Trying\x20SendSMS\x20with\x20account\x20%s','set','Enter\x20in\x20SET\x20(%s)\x20block','no\x20variable\x20selected','variable_value','start','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','Answer','Skipped\x20Answer','subproject','project_id','no\x20subproject\x20found\x20with\x20id\x20%d','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','AGI','agi://%s/square,\x22%s\x22,\x22%s\x22','127.0.0.1','Enter\x20in\x20SYSTEM\x20(%s)\x20block','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','sh\x20command:\x20%s\x20result\x20no\x20stored','google_cloud_tts','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20is\x20unreachable','tts','Trying\x20Google\x20TTS\x20%s','unpause','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','VOICEMAIL','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','replaceAll','join','exports','path','util','lodash','shelljs','randomstring','mustache','agi','./scripts','/var/opt/motion2/server/files','getdigits','getsecretdigits','rpc','prototype','name','catch','getVoiceQueue','then','getSquareProject','getSquareProjectById','getSquareOdbcById','dsn','getUser','getUserById','getTrunk','getTrunkById','getSound','getSoundById','getSoundPath','save_name','getMailAccount','getMailAccountById','sendMailMessage','mailRpc','getIntervals','getIntervalById','IntervalId','map','interval','format','%s/sounds/converted/%s'];(function(_0xd90b4e,_0x4dc84a){var _0x254165=function(_0x197579){while(--_0x197579){_0xd90b4e['push'](_0xd90b4e['shift']());}};_0x254165(++_0x4dc84a);}(_0xc4e1,0x172));var _0x1c4e=function(_0x6986bb,_0x4ef168){_0x6986bb=_0x6986bb-0x0;var _0x4123bd=_0xc4e1[_0x6986bb];return _0x4123bd;};'use strict';var fs=require('fs');var path=require(_0x1c4e('0x0'));var util=require(_0x1c4e('0x1'));var _=require(_0x1c4e('0x2'));var sh=require(_0x1c4e('0x3'));var odbc=require('odbc')();var rs=require(_0x1c4e('0x4'));var moment=require('moment');var Mustache=require(_0x1c4e('0x5'));var logger=require('../../config/logger')(_0x1c4e('0x6'));var config=require('../../config/environment');var scripts=require(_0x1c4e('0x7'));var FILES_PATH=_0x1c4e('0x8');var verticesWithRetry=['menu',_0x1c4e('0x9'),_0x1c4e('0xa')];var AGIVertices=function(_0x523405,_0xa423ce,_0x4b6c34){this['channel']=_0x523405;this[_0x1c4e('0xb')]=_0xa423ce;this['mailRpc']=_0x4b6c34;};AGIVertices[_0x1c4e('0xc')]['getVariable']=function(_0x1aa3d7,_0x4b61e5){this[_0x1c4e('0xb')]['getVariableById'](_0x1aa3d7)['then'](function(_0x5b75a3){_0x4b61e5(null,_0x5b75a3?_0x5b75a3[_0x1c4e('0xd')]:![]);})[_0x1c4e('0xe')](function(_0x25aa73){_0x4b61e5(_0x25aa73);});};AGIVertices['prototype'][_0x1c4e('0xf')]=function(_0x2eb80a,_0x4e6061){this['rpc']['getVoiceQueueById'](_0x2eb80a)[_0x1c4e('0x10')](function(_0x2b6459){_0x4e6061(null,_0x2b6459?_0x2b6459['name']:![]);})[_0x1c4e('0xe')](function(_0x39d06e){_0x4e6061(_0x39d06e);});};AGIVertices[_0x1c4e('0xc')][_0x1c4e('0x11')]=function(_0x2d55bb,_0x4b12b3){this[_0x1c4e('0xb')][_0x1c4e('0x12')](_0x2d55bb)['then'](function(_0x4a5786){_0x4b12b3(null,_0x4a5786?_0x4a5786['name']:![]);})['catch'](function(_0x285d65){_0x4b12b3(_0x285d65);});};AGIVertices[_0x1c4e('0xc')]['getSquareOdbc']=function(_0x17cb13,_0x366529){this[_0x1c4e('0xb')][_0x1c4e('0x13')](_0x17cb13)[_0x1c4e('0x10')](function(_0x152ddf){_0x366529(null,_0x152ddf?_0x152ddf[_0x1c4e('0x14')]:![]);})[_0x1c4e('0xe')](function(_0x24a1c7){_0x366529(_0x24a1c7);});};AGIVertices['prototype'][_0x1c4e('0x15')]=function(_0x4bfc35,_0x29b574){this[_0x1c4e('0xb')][_0x1c4e('0x16')](_0x4bfc35)[_0x1c4e('0x10')](function(_0xb79c5){_0x29b574(null,_0xb79c5?_0xb79c5['name']:![]);})[_0x1c4e('0xe')](function(_0xa9714b){_0x29b574(_0xa9714b);});};AGIVertices[_0x1c4e('0xc')][_0x1c4e('0x17')]=function(_0x18ee91,_0x179a2b){this['rpc'][_0x1c4e('0x18')](_0x18ee91)[_0x1c4e('0x10')](function(_0x1b235d){_0x179a2b(null,_0x1b235d?_0x1b235d[_0x1c4e('0xd')]:![]);})[_0x1c4e('0xe')](function(_0x3a2c40){_0x179a2b(_0x3a2c40);});};AGIVertices['prototype'][_0x1c4e('0x19')]=function(_0x2e2d32,_0x5925aa){var _0x256e72=this;this[_0x1c4e('0xb')][_0x1c4e('0x1a')](_0x2e2d32)[_0x1c4e('0x10')](function(_0x5ea146){_0x5925aa(null,_0x5ea146?_0x256e72[_0x1c4e('0x1b')](_0x5ea146[_0x1c4e('0x1c')]):![]);})[_0x1c4e('0xe')](function(_0x536e52){_0x5925aa(_0x536e52);});};AGIVertices[_0x1c4e('0xc')][_0x1c4e('0x1d')]=function(_0x160afa,_0x1b354c){this['rpc'][_0x1c4e('0x1e')](_0x160afa)[_0x1c4e('0x10')](function(_0x32eb93){_0x1b354c(null,_0x32eb93?_0x32eb93:![]);})[_0x1c4e('0xe')](function(_0x5005a6){_0x1b354c(_0x5005a6);});};AGIVertices['prototype'][_0x1c4e('0x1f')]=function(_0x287dcd,_0x1f99c9,_0x4d4654){this[_0x1c4e('0x20')][_0x1c4e('0x1f')](_0x287dcd,_0x1f99c9)['then'](function(){_0x4d4654(null);})[_0x1c4e('0xe')](function(_0x404057){_0x4d4654(_0x404057);});};AGIVertices[_0x1c4e('0xc')][_0x1c4e('0x21')]=function(_0x216cf4,_0x53da71){this[_0x1c4e('0xb')][_0x1c4e('0x22')](_0x216cf4)[_0x1c4e('0x10')](function(_0x39d805){if(_0x39d805){if(_0x39d805[_0x1c4e('0x23')]){_0x53da71(null,[_0x39d805['interval']]);}else{_0x53da71(null,_[_0x1c4e('0x24')](_0x39d805['Intervals'],_0x1c4e('0x25')));}}else{_0x53da71(null,![]);}})[_0x1c4e('0xe')](function(_0x165fbb){_0x53da71(_0x165fbb);});};AGIVertices[_0x1c4e('0xc')][_0x1c4e('0x1b')]=function(_0x4bc375){return util[_0x1c4e('0x26')](_0x1c4e('0x27'),FILES_PATH,_0x4bc375);};AGIVertices[_0x1c4e('0xc')][_0x1c4e('0x28')]=function(_0x3f08af,_0x21604d,_0x1c4672){odbc[_0x1c4e('0x29')](_0x3f08af,function(_0x37b24f){if(_0x37b24f){logger[_0x1c4e('0x2a')](_0x1c4e('0x2b'),_0x37b24f);_0x1c4672(_0x37b24f);}else{logger[_0x1c4e('0x2c')](_0x1c4e('0x2d'));odbc['query'](_0x21604d,function(_0x21f017,_0x333cf2){if(_0x21f017){logger[_0x1c4e('0x2c')](_0x1c4e('0x2e'),_0x21604d);_0x1c4672(_0x21f017);}else{logger[_0x1c4e('0x2c')]('Query\x20executed\x20correctly\x20%s',_0x21604d);odbc[_0x1c4e('0x2f')](function(_0x4e4e55){if(_0x4e4e55){logger['error'](_0x1c4e('0x30'),_0x4e4e55);}_0x1c4672(null,_0x333cf2);});}});}});};AGIVertices['prototype'][_0x1c4e('0x31')]=function(_0x470cf9,_0x5ee846){this['rpc'][_0x1c4e('0x32')](_0x470cf9)[_0x1c4e('0x10')](function(_0x6206db){_0x5ee846(null,_0x6206db?_0x6206db:![]);})[_0x1c4e('0xe')](function(_0x536836){_0x5ee846(_0x536836);});};AGIVertices['prototype']['createSmsMessage']=function(_0x595e42,_0x71de86){this[_0x1c4e('0xb')][_0x1c4e('0x33')](_0x595e42)[_0x1c4e('0x10')](function(_0x3c19af){_0x71de86(null,_0x3c19af);})['catch'](function(_0x5b987c){_0x71de86(_0x5b987c);});};AGIVertices[_0x1c4e('0xc')][_0x1c4e('0x34')]=function(_0x1b5314,_0x1036e0,_0x5179d9){this[_0x1c4e('0xb')]['createSquareDetailsReport']({'uniqueid':this['channel'][_0x1c4e('0x35')],'node':_0x1b5314[_0x1c4e('0x36')],'application':_0x1b5314['agicommand'],'data':_0x1036e0||null,'project_name':this[_0x1c4e('0x37')][_0x1c4e('0x38')],'callerid':this[_0x1c4e('0x37')][_0x1c4e('0x39')]})[_0x1c4e('0x10')](function(_0x5a99aa){if(_0x5179d9){_0x5179d9(null,_0x5a99aa);}})[_0x1c4e('0xe')](function(_0x47d9d9){if(_0x5179d9){_0x5179d9(_0x47d9d9);}});};AGIVertices[_0x1c4e('0xc')]['createSquareRecording']=function(_0x25c580,_0x46a56b,_0x5d6ace,_0x417b83){this[_0x1c4e('0xb')][_0x1c4e('0x3a')]({'uniqueid':this[_0x1c4e('0x37')][_0x1c4e('0x35')],'callerid':this[_0x1c4e('0x37')][_0x1c4e('0x39')],'calleridname':this[_0x1c4e('0x37')]['calleridname'],'context':this['channel'][_0x1c4e('0x3b')],'extension':this['channel']['extension'],'priority':this[_0x1c4e('0x37')][_0x1c4e('0x3c')],'accountcode':this[_0x1c4e('0x37')][_0x1c4e('0x3d')],'dnid':this[_0x1c4e('0x37')][_0x1c4e('0x3e')],'projectName':this[_0x1c4e('0x37')][_0x1c4e('0x38')],'saveName':_0x46a56b,'filename':_0x25c580[_0x1c4e('0x3f')]||_0x46a56b,'savePath':_0x5d6ace})[_0x1c4e('0x10')](function(_0x134f27){_0x417b83(null,_0x134f27);})['catch'](function(_0x219b6b){_0x417b83(_0x219b6b);});};AGIVertices[_0x1c4e('0xc')][_0x1c4e('0x40')]=function(_0x3cc44f,_0x23ac97,_0x4169b7){this[_0x1c4e('0xb')][_0x1c4e('0x40')]({'uniqueid':this['channel'][_0x1c4e('0x35')],'body':_0x3cc44f,'direction':_0x23ac97})[_0x1c4e('0x10')](function(_0x5a7d19){if(_0x4169b7){_0x4169b7(null,_0x5a7d19);}})[_0x1c4e('0xe')](function(_0x36ad9d){if(_0x4169b7){_0x4169b7(_0x36ad9d);}});};AGIVertices[_0x1c4e('0xc')]['createCmContact']=function(_0x5196aa,_0x4a6ac9){this[_0x1c4e('0xb')][_0x1c4e('0x41')]({'firstName':_[_0x1c4e('0x42')](_0x5196aa[_0x1c4e('0xd')])||_['isNil'](_0x5196aa['name'])?_0x1c4e('0x43')+Math[_0x1c4e('0x44')]():_0x5196aa[_0x1c4e('0xd')],'lastName':_['isEmpty'](_0x5196aa[_0x1c4e('0x45')])||_[_0x1c4e('0x46')](_0x5196aa[_0x1c4e('0x45')])?null:_0x5196aa[_0x1c4e('0x45')],'phone':_0x5196aa['phone'],'ListId':_0x5196aa[_0x1c4e('0x47')],'scheduledAt':_0x5196aa[_0x1c4e('0x48')],'callbackUniqueid':this[_0x1c4e('0x37')][_0x1c4e('0x35')],'tags':_0x1c4e('0x49'),'description':_0x1c4e('0x4a')+_0x5196aa[_0x1c4e('0x48')][_0x1c4e('0x4b')](),'priority':_0x5196aa[_0x1c4e('0x4c')]})[_0x1c4e('0x10')](function(_0x430625){_0x4a6ac9(null,_0x430625);})[_0x1c4e('0xe')](function(_0x5d3ab3){_0x4a6ac9(_0x5d3ab3);});};AGIVertices[_0x1c4e('0xc')]['getPause']=function(_0x1aa1d8,_0x5cb617){this[_0x1c4e('0xb')][_0x1c4e('0x4d')](_0x1aa1d8)[_0x1c4e('0x10')](function(_0x27268c){_0x5cb617(null,_0x27268c?_0x27268c[_0x1c4e('0xd')]:![]);})[_0x1c4e('0xe')](function(_0x294586){_0x5cb617(_0x294586);});};AGIVertices[_0x1c4e('0xc')]['agentPause']=function(_0x480178,_0x34b8db,_0x4e81a2){var _0x5da1f3={'role':_0x1c4e('0x4e')};_0x5da1f3[_0x480178]=this[_0x1c4e('0x37')][_0x1c4e('0x39')];this[_0x1c4e('0xb')][_0x1c4e('0x4f')](_0x5da1f3,_0x34b8db,this[_0x1c4e('0x37')][_0x1c4e('0x35')])[_0x1c4e('0x10')](function(_0x45faf6){_0x4e81a2(null,_[_0x1c4e('0x46')](_0x45faf6)?![]:!![]);})[_0x1c4e('0xe')](function(_0x194fc8){logger[_0x1c4e('0x2a')](_0x194fc8);_0x4e81a2(null,![]);});};AGIVertices[_0x1c4e('0xc')][_0x1c4e('0x50')]=function(_0x5ded3b,_0x239127){var _0xccc499={'role':_0x1c4e('0x4e')};_0xccc499[_0x5ded3b]=this[_0x1c4e('0x37')]['callerid'];this[_0x1c4e('0xb')][_0x1c4e('0x50')](_0xccc499)['then'](function(_0xbf2cd3){_0x239127(null,_['isNil'](_0xbf2cd3)?![]:!![]);})[_0x1c4e('0xe')](function(_0x478384){logger[_0x1c4e('0x2a')](_0x478384);_0x239127(null,![]);});};AGIVertices['prototype'][_0x1c4e('0x51')]=function(_0x36fa15,_0xebd1ae){var _0x287f9c={'role':_0x1c4e('0x4e')};_0x287f9c[_0x36fa15]=this[_0x1c4e('0x37')][_0x1c4e('0x39')];this[_0x1c4e('0xb')][_0x1c4e('0x51')](_0x287f9c)[_0x1c4e('0x10')](function(_0x4dc57e){_0xebd1ae(null,_['isNil'](_0x4dc57e)?![]:!![]);})[_0x1c4e('0xe')](function(_0x4dbacb){logger[_0x1c4e('0x2a')](_0x4dbacb);_0xebd1ae(null,![]);});};AGIVertices[_0x1c4e('0xc')][_0x1c4e('0x52')]=function(_0x19380e,_0x452226){var _0x10147d={'role':_0x1c4e('0x4e')};_0x10147d[_0x19380e]=this[_0x1c4e('0x37')][_0x1c4e('0x39')];var _0x5a1e4d=_0x19380e!=_0x1c4e('0x53')?util[_0x1c4e('0x26')](_0x1c4e('0x54'),'LOCAL',this[_0x1c4e('0x37')][_0x1c4e('0x39')]):undefined;this[_0x1c4e('0xb')][_0x1c4e('0x52')](_0x10147d,_0x5a1e4d)['then'](function(_0x57796a){_0x452226(null,_[_0x1c4e('0x46')](_0x57796a)?![]:!![]);})['catch'](function(_0x742fb9){logger[_0x1c4e('0x2a')](_0x742fb9);_0x452226(null,![]);});};AGIVertices[_0x1c4e('0xc')][_0x1c4e('0x55')]=function(_0x489daf,_0x5bfed8){sh[_0x1c4e('0x56')](_['trim'](_0x489daf),function(_0x411129,_0x595ca7){var _0x1ebd98=_0x595ca7['replace'](/(\r\n|\n|\r)/gm,'');_0x5bfed8(null,_0x1ebd98);});};AGIVertices[_0x1c4e('0xc')][_0x1c4e('0x57')]=function(_0x35cc6b,_0x264659){scripts[_0x1c4e('0x57')](_0x35cc6b[_0x1c4e('0x58')],_0x35cc6b['google_cloud_tts_text_type']||_0x1c4e('0x59'),_0x35cc6b[_0x1c4e('0x59')],_0x35cc6b[_0x1c4e('0x5a')]||_0x1c4e('0x5b'),_0x35cc6b[_0x1c4e('0x5c')]||'MALE',_0x35cc6b[_0x1c4e('0x5d')]||_0x1c4e('0x5e'))[_0x1c4e('0x10')](function(_0x225da1){_0x264659(null,_0x225da1);})['catch'](function(_0x258bcd){_0x264659(_0x258bcd);});};AGIVertices['prototype'][_0x1c4e('0x5f')]=function(_0x3dcf2b,_0x4d6fc8){scripts[_0x1c4e('0x5f')](_0x3dcf2b[_0x1c4e('0x59')],_0x3dcf2b[_0x1c4e('0x60')]||'en',0x1)[_0x1c4e('0x10')](function(_0x56274a){_0x4d6fc8(null,_0x56274a);})[_0x1c4e('0xe')](function(_0x14efa1){_0x4d6fc8(_0x14efa1);});};AGIVertices[_0x1c4e('0xc')][_0x1c4e('0x61')]=function(_0x34c717,_0x271cfa){scripts[_0x1c4e('0x61')](this[_0x1c4e('0x37')][_0x1c4e('0x35')],_0x34c717[_0x1c4e('0x62')],_0x34c717['text'],_0x34c717[_0x1c4e('0x63')]||'en')[_0x1c4e('0x10')](function(_0x49f6b4){_0x271cfa(null,_0x49f6b4);})[_0x1c4e('0xe')](function(_0x2131d5){_0x271cfa(_0x2131d5);});};AGIVertices[_0x1c4e('0xc')][_0x1c4e('0x64')]=function(_0x306816,_0x46c5cd){scripts[_0x1c4e('0x64')](this[_0x1c4e('0x37')],_0x306816)[_0x1c4e('0x10')](function(_0x5e17a5){_0x46c5cd(null,_0x5e17a5);})[_0x1c4e('0xe')](function(_0x38a03c){_0x46c5cd(_0x38a03c);});};AGIVertices[_0x1c4e('0xc')][_0x1c4e('0x65')]=function(_0x4e4c23,_0x4590f7){scripts[_0x1c4e('0x65')](_0x4e4c23[_0x1c4e('0x62')],_0x4e4c23[_0x1c4e('0x59')],_0x4e4c23[_0x1c4e('0x66')]||_0x1c4e('0x5b'),_0x4e4c23['speed'])['then'](function(_0x5cebac){_0x4590f7(null,_0x5cebac);})[_0x1c4e('0xe')](function(_0x24ba21){_0x4590f7(_0x24ba21);});};AGIVertices[_0x1c4e('0xc')][_0x1c4e('0x67')]=function(_0xcce9f1,_0x32c6e6,_0x471de5){scripts[_0x1c4e('0x67')](_0x32c6e6,_0xcce9f1[_0x1c4e('0x62')],_0xcce9f1[_0x1c4e('0x68')]||_0x1c4e('0x5b'),this['isConfigured'](_0xcce9f1[_0x1c4e('0x69')])?_0xcce9f1[_0x1c4e('0x69')]:undefined)['then'](function(_0x5bd798){_0x471de5(null,_0x5bd798);})['catch'](function(_0x2031a8){_0x471de5(_0x2031a8);});};AGIVertices[_0x1c4e('0xc')][_0x1c4e('0x6a')]=function(_0xf23e50,_0x266c4f){scripts['awsPolly'](_0xf23e50[_0x1c4e('0x6b')],_0xf23e50[_0x1c4e('0x6c')],_0xf23e50[_0x1c4e('0x6d')],_0xf23e50[_0x1c4e('0x6e')]||'Amy',_0xf23e50[_0x1c4e('0x59')],_0xf23e50[_0x1c4e('0x6f')]||_0x1c4e('0x59'))[_0x1c4e('0x10')](function(_0x5d2dcf){_0x266c4f(null,_0x5d2dcf);})[_0x1c4e('0xe')](function(_0x129cb1){_0x266c4f(_0x129cb1);});};AGIVertices['prototype']['awsLex']=function(_0x763b1,_0x267098){scripts[_0x1c4e('0x70')](this[_0x1c4e('0x37')][_0x1c4e('0x35')],_0x763b1[_0x1c4e('0x6b')],_0x763b1['aws_secret_access_key'],_0x763b1[_0x1c4e('0x71')],_0x763b1['text'],_0x763b1['aws_bot_name'])['then'](function(_0x3f7135){_0x267098(null,_0x3f7135);})['catch'](function(_0x836710){_0x267098(_0x836710);});};AGIVertices['prototype'][_0x1c4e('0x72')]=function(_0x1f44db,_0x2eebc4,_0x5c1cc4){scripts[_0x1c4e('0x72')](_0x2eebc4,_0x1f44db[_0x1c4e('0x62')],_0x1f44db[_0x1c4e('0x73')]||'en-US')[_0x1c4e('0x10')](function(_0xed3f99){_0x5c1cc4(null,_0xed3f99);})[_0x1c4e('0xe')](function(_0x119322){_0x5c1cc4(_0x119322);});};AGIVertices[_0x1c4e('0xc')][_0x1c4e('0x74')]=function(_0x72caf7,_0x36dac7,_0x29bcab){scripts[_0x1c4e('0x74')](_0x36dac7,_0x72caf7[_0x1c4e('0x75')],_0x72caf7[_0x1c4e('0x76')],_0x72caf7[_0x1c4e('0x77')])[_0x1c4e('0x10')](function(_0x3b4153){_0x29bcab(null,_0x3b4153);})[_0x1c4e('0xe')](function(_0xd4d4ee){_0x29bcab(_0xd4d4ee);});};AGIVertices[_0x1c4e('0xc')]['clear']=function(_0x113e25){var _0x5b8602=_['includes'](verticesWithRetry,_0x113e25[_0x1c4e('0x78')])?_0x113e25:_['clone'](_0x113e25);for(var _0x7f3a15 in _0x5b8602){if(_0x5b8602[_0x1c4e('0x79')](_0x7f3a15)){if(_0x5b8602[_0x7f3a15]&&_['isString'](_0x5b8602[_0x7f3a15])){_0x5b8602[_0x7f3a15]=this[_0x1c4e('0x7a')](_0x5b8602[_0x7f3a15]);}}}return _0x5b8602;};AGIVertices['prototype'][_0x1c4e('0x7a')]=function(_0x2aac85){var _0x2e869d=_0x2aac85[_0x1c4e('0x7b')]('{');for(var _0x7864f=0x1;_0x7864f<_0x2e869d[_0x1c4e('0x7c')];_0x7864f+=0x1){var _0x5f21a8=_0x2e869d[_0x7864f]['split']('}');if(_0x5f21a8[_0x1c4e('0x7c')]>0x1){_0x2aac85=_0x2aac85['replaceAll']('{'+_0x5f21a8[0x0]+'}',this[_0x1c4e('0x37')][_0x1c4e('0x7d')](_0x5f21a8[0x0])[_0x1c4e('0x7e')]||_0x5f21a8[0x0]);}}if(_0x2e869d[_0x1c4e('0x7c')]===0x1){return _0x2aac85[_0x1c4e('0x4b')]();}return this[_0x1c4e('0x7a')](_0x2aac85);};AGIVertices[_0x1c4e('0xc')][_0x1c4e('0x7f')]=function(_0x6746f9,_0x6e0a3a){var _0x1fc23e=this[_0x1c4e('0x37')]['getVariable'](_0x6746f9);if(_0x1fc23e[_0x1c4e('0x80')]===-0x1){return _0x1fc23e;}logger[_0x1c4e('0x2c')](util['format'](_0x1c4e('0x81'),_0x6e0a3a,_0x1fc23e[_0x1c4e('0x7e')]));return this[_0x1c4e('0x37')]['setVariable'](_0x6e0a3a,_0x1fc23e[_0x1c4e('0x7e')]);};AGIVertices[_0x1c4e('0xc')][_0x1c4e('0x82')]=function(_0xf5f54c){return _0xf5f54c&&_0xf5f54c!=='0'&&_0xf5f54c!=='-1'&&_0xf5f54c!=='';};AGIVertices['prototype'][_0x1c4e('0x83')]=function(_0x14d483){this[_0x1c4e('0x34')][_0x1c4e('0x84')](this,_0x14d483,'-');_0x14d483[_0x1c4e('0x85')]=_0x14d483[_0x1c4e('0x83')];return{'code':0xc8,'result':'-'};};AGIVertices[_0x1c4e('0xc')][_0x1c4e('0x6')]=function(_0x4ff8c8){logger[_0x1c4e('0x2c')](util[_0x1c4e('0x26')](_0x1c4e('0x86'),_0x4ff8c8[_0x1c4e('0x36')]));return this['channel']['agi']([_0x4ff8c8[_0x1c4e('0x87')],_0x4ff8c8[_0x1c4e('0x88')]]);};AGIVertices[_0x1c4e('0xc')][_0x1c4e('0x89')]=function(_0xb279ce){logger[_0x1c4e('0x2c')](util[_0x1c4e('0x26')](_0x1c4e('0x8a'),_0xb279ce[_0x1c4e('0x36')]));if(this[_0x1c4e('0x82')](_0xb279ce[_0x1c4e('0x8b')])){logger[_0x1c4e('0x2c')](util[_0x1c4e('0x26')](_0x1c4e('0x8c'),_0xb279ce[_0x1c4e('0x8b')]));var _0x5e12eb=this['channel'][_0x1c4e('0x8d')](_0xb279ce[_0x1c4e('0x8b')]);if(_0x5e12eb[_0x1c4e('0x80')]===-0x1){return _0x5e12eb;}}return this[_0x1c4e('0x37')][_0x1c4e('0x89')]();};AGIVertices[_0x1c4e('0xc')][_0x1c4e('0x49')]=function(_0x18d8d2){logger[_0x1c4e('0x2c')](util[_0x1c4e('0x26')]('Enter\x20in\x20CALLBACK\x20(%s)\x20block',_0x18d8d2[_0x1c4e('0x36')]));if(!this[_0x1c4e('0x82')](_0x18d8d2[_0x1c4e('0x47')])){return this[_0x1c4e('0x37')][_0x1c4e('0x2a')](_0x18d8d2,'no\x20list\x20selected');}_0x18d8d2[_0x1c4e('0x48')]=moment();if(this[_0x1c4e('0x82')](_0x18d8d2['delay'])){_0x18d8d2[_0x1c4e('0x48')]=moment()[_0x1c4e('0x8e')](_0x18d8d2[_0x1c4e('0x8f')],'minutes');}if(!this[_0x1c4e('0x82')](_0x18d8d2[_0x1c4e('0x4c')])){_0x18d8d2[_0x1c4e('0x4c')]=0x2;}this[_0x1c4e('0x41')][_0x1c4e('0x84')](this,_0x18d8d2);return this['channel']['noop'](util[_0x1c4e('0x26')](_0x1c4e('0x90'),_0x18d8d2['phone'],_0x18d8d2['list_id'],_0x18d8d2['scheduledAt']));};AGIVertices[_0x1c4e('0xc')][_0x1c4e('0x91')]=function(_0x2c680f){logger[_0x1c4e('0x2c')](util[_0x1c4e('0x26')](_0x1c4e('0x92'),_0x2c680f[_0x1c4e('0x36')]));var _0x5055db=this[_0x1c4e('0x37')][_0x1c4e('0x56')](_0x2c680f[_0x1c4e('0x93')],_0x2c680f[_0x1c4e('0x94')]);if(_0x5055db[_0x1c4e('0x80')]===-0x1){return _0x5055db;}return this[_0x1c4e('0x37')][_0x1c4e('0x95')](util[_0x1c4e('0x26')](_0x1c4e('0x96'),_0x2c680f[_0x1c4e('0x93')],_0x2c680f[_0x1c4e('0x94')]));};AGIVertices[_0x1c4e('0xc')][_0x1c4e('0x97')]=function(_0x157bc3){logger[_0x1c4e('0x2c')](util[_0x1c4e('0x26')](_0x1c4e('0x98'),_0x157bc3[_0x1c4e('0x36')]));if(!this['isConfigured'](_0x157bc3[_0x1c4e('0x59')])){return this['channel'][_0x1c4e('0x95')](_0x1c4e('0x99'));}var _0x23b313='\x22'+_0x157bc3[_0x1c4e('0x59')]+'\x22';if(this[_0x1c4e('0x82')](_0x157bc3[_0x1c4e('0x94')])){_0x23b313+=','+_0x157bc3['options'];}var _0x15afa0=this['channel'][_0x1c4e('0x56')]('MRCPSynth',_0x23b313);if(_0x15afa0[_0x1c4e('0x80')]===-0x1){return _0x15afa0;}return this['channel'][_0x1c4e('0x95')](util[_0x1c4e('0x26')](_0x1c4e('0x9a'),_0x23b313));};AGIVertices[_0x1c4e('0xc')]['sestektts']=function(_0x57d55e){logger[_0x1c4e('0x2c')](util[_0x1c4e('0x26')](_0x1c4e('0x9b'),_0x57d55e[_0x1c4e('0x36')]));if(!this[_0x1c4e('0x82')](_0x57d55e[_0x1c4e('0x59')])){return this[_0x1c4e('0x37')][_0x1c4e('0x95')](_0x1c4e('0x99'));}var _0x35392d='\x22'+_0x57d55e['text']+'\x22';if(this[_0x1c4e('0x82')](_0x57d55e['options'])){_0x35392d+=','+_0x57d55e[_0x1c4e('0x94')];}var _0x536b1f=this[_0x1c4e('0x37')][_0x1c4e('0x56')](_0x1c4e('0x9c'),_0x35392d);if(_0x536b1f[_0x1c4e('0x80')]===-0x1){return _0x536b1f;}return this[_0x1c4e('0x37')][_0x1c4e('0x95')](util['format'](_0x1c4e('0x9a'),_0x35392d));};AGIVertices[_0x1c4e('0xc')][_0x1c4e('0x9d')]=function(_0x386e92){logger[_0x1c4e('0x2c')](util[_0x1c4e('0x26')](_0x1c4e('0x9e'),_0x386e92[_0x1c4e('0x36')]));if(!this[_0x1c4e('0x82')](_0x386e92[_0x1c4e('0x9f')])){return this[_0x1c4e('0x37')][_0x1c4e('0x95')](_0x1c4e('0xa0'));}var _0x5107ae=_0x386e92[_0x1c4e('0x9f')];if(this[_0x1c4e('0x82')](_0x386e92['options'])){_0x5107ae+=','+_0x386e92[_0x1c4e('0x94')];}var _0x15c628=this['channel'][_0x1c4e('0x56')](_0x1c4e('0xa1'),_0x5107ae);if(_0x15c628[_0x1c4e('0x80')]===-0x1){return _0x15c628;}var _0xbe6af4=this['getAndSetVariable']('RECOG_CONFIDENCE()',_0x1c4e('0xa2'));if(_0xbe6af4['result']===-0x1){return _0xbe6af4;}var _0x329c5c=this['getAndSetVariable'](_0x1c4e('0xa3'),_0x1c4e('0xa4'));if(_0x329c5c[_0x1c4e('0x80')]===-0x1){return _0x329c5c;}var _0x4b2482=this[_0x1c4e('0x7f')]('RECOG_INSTANCE()',_0x1c4e('0xa5'));if(_0x4b2482[_0x1c4e('0x80')]===-0x1){return _0x4b2482;}return this['channel'][_0x1c4e('0x95')](util[_0x1c4e('0x26')](_0x1c4e('0xa6'),_0x5107ae));};AGIVertices[_0x1c4e('0xc')][_0x1c4e('0xa7')]=function(_0x2c4390){logger[_0x1c4e('0x2c')](util[_0x1c4e('0x26')](_0x1c4e('0xa8'),_0x2c4390[_0x1c4e('0x36')]));if(!this['isConfigured'](_0x2c4390[_0x1c4e('0x9f')])){return this[_0x1c4e('0x37')][_0x1c4e('0x95')]('no\x20grammar\x20configured');}var _0x376801=_0x2c4390[_0x1c4e('0x9f')];if(this[_0x1c4e('0x82')](_0x2c4390[_0x1c4e('0x94')])){_0x376801+=','+_0x2c4390[_0x1c4e('0x94')];}var _0x3ac5fd=this['channel'][_0x1c4e('0x56')](_0x1c4e('0xa1'),_0x376801);if(_0x3ac5fd['result']===-0x1){return _0x3ac5fd;}var _0x312ce9=this['getAndSetVariable'](_0x1c4e('0xa9'),_0x1c4e('0xaa'));if(_0x312ce9[_0x1c4e('0x80')]===-0x1){return _0x312ce9;}var _0x2eafae=this['getAndSetVariable'](_0x1c4e('0xa3'),_0x1c4e('0xab'));if(_0x2eafae[_0x1c4e('0x80')]===-0x1){return _0x2eafae;}var _0x28a52f=this[_0x1c4e('0x7f')](_0x1c4e('0xac'),'SESTEK_ASR_INSTANCE');if(_0x28a52f[_0x1c4e('0x80')]===-0x1){return _0x28a52f;}return this['channel'][_0x1c4e('0x95')](util['format'](_0x1c4e('0xa6'),_0x376801));};AGIVertices['prototype'][_0x1c4e('0xad')]=function(_0x2724a2){logger['info'](util[_0x1c4e('0x26')]('Enter\x20in\x20DATABASE\x20(%s)\x20block',_0x2724a2[_0x1c4e('0x36')]));if(!this['isConfigured'](_0x2724a2[_0x1c4e('0xae')])){return this[_0x1c4e('0x37')][_0x1c4e('0x2a')](_0x2724a2,'no\x20database\x20selected');}var _0x4407ea=this['getSquareOdbc'][_0x1c4e('0x84')](this,_0x2724a2['odbc_id']);if(!_0x4407ea){return this[_0x1c4e('0x37')][_0x1c4e('0x2a')](_0x2724a2,_0x1c4e('0xaf'));}if(!this[_0x1c4e('0x82')](_0x2724a2['query'])){return this[_0x1c4e('0x37')][_0x1c4e('0x2a')](_0x2724a2,_0x1c4e('0xb0'));}var _0x64e8e9=_0x2724a2['query'][_0x1c4e('0xb1')](/(\r\n|\n|\r)/gm,'\x20');this[_0x1c4e('0x37')]['noop'](util[_0x1c4e('0x26')](_0x1c4e('0xb2'),_0x64e8e9));var _0x26f8ca=this[_0x1c4e('0x28')][_0x1c4e('0x84')](this,_0x4407ea,_0x64e8e9);this[_0x1c4e('0x34')][_0x1c4e('0x84')](this,_0x2724a2,_0x64e8e9);if(!this[_0x1c4e('0x82')](_0x2724a2[_0x1c4e('0xb3')])){return this[_0x1c4e('0x37')]['noop'](_0x1c4e('0xb4'));}var _0x228aef=this[_0x1c4e('0x7d')][_0x1c4e('0x84')](this,_0x2724a2[_0x1c4e('0xb3')]);if(!_0x228aef){return this[_0x1c4e('0x37')][_0x1c4e('0x2a')](_0x2724a2,_0x1c4e('0xb5'));}var _0x3c5126=this;_0x26f8ca[_0x1c4e('0xb6')](function(_0x5e00fd,_0x12da1d){Object[_0x1c4e('0xb7')](_0x5e00fd)[_0x1c4e('0xb6')](function(_0x309e8e){_0x3c5126[_0x1c4e('0x37')][_0x1c4e('0xb8')](util['format'](_0x1c4e('0xb9'),_0x228aef,_0x12da1d,_0x309e8e),_0x5e00fd[_0x309e8e]);});});this[_0x1c4e('0x37')]['setVariable'](util[_0x1c4e('0x26')]('%s_ROWS_COUNT',_0x228aef),_0x26f8ca[_0x1c4e('0x7c')]);return this[_0x1c4e('0x37')][_0x1c4e('0x95')](util[_0x1c4e('0x26')](_0x1c4e('0xba'),_0x228aef));};AGIVertices[_0x1c4e('0xc')][_0x1c4e('0xbb')]=function(_0xff090){logger[_0x1c4e('0xbc')](util[_0x1c4e('0x26')](_0x1c4e('0xbd'),_0xff090['label']));if(!this[_0x1c4e('0x82')](_0xff090[_0x1c4e('0xbe')])){return this[_0x1c4e('0x37')]['error'](_0xff090,_0x1c4e('0xbf'));}var _0x278c95=this[_0x1c4e('0x15')][_0x1c4e('0x84')](this,_0xff090['sip_id']);if(!_0x278c95){return this[_0x1c4e('0x37')][_0x1c4e('0x2a')](_0xff090,_0x1c4e('0xc0'));}var _0x4c4b51=this[_0x1c4e('0x37')][_0x1c4e('0x56')](_0x1c4e('0xc1'),[util[_0x1c4e('0x26')](_0x1c4e('0xc2'),_0x278c95),_0xff090['timeout'],_0xff090[_0x1c4e('0xc3')],_0xff090[_0x1c4e('0xc4')]]);if(_0x4c4b51[_0x1c4e('0x80')]===-0x1){return _0x4c4b51;}return this[_0x1c4e('0x37')][_0x1c4e('0x95')](util['format'](_0x1c4e('0xc5'),_0x1c4e('0xc1')));};AGIVertices[_0x1c4e('0xc')][_0x1c4e('0xc6')]=function(_0x11bd92){logger[_0x1c4e('0x2c')](util[_0x1c4e('0x26')](_0x1c4e('0xc7'),_0x11bd92[_0x1c4e('0x36')]));if(!this[_0x1c4e('0x82')](_0x11bd92[_0x1c4e('0x62')])){return this[_0x1c4e('0x37')]['noop'](_0x1c4e('0xc8'));}if(!this['isConfigured'](_0x11bd92[_0x1c4e('0x59')])){return this[_0x1c4e('0x37')]['noop'](_0x1c4e('0x99'));}this['channel'][_0x1c4e('0xc9')]=!![];this[_0x1c4e('0x34')](_0x11bd92);this['createSquareMessage'](_0x11bd92[_0x1c4e('0x59')],'in');this[_0x1c4e('0x37')][_0x1c4e('0x95')](util[_0x1c4e('0x26')](_0x1c4e('0xca'),_0x11bd92[_0x1c4e('0x59')]));var _0xb0106a=this[_0x1c4e('0x61')]['sync'](this,_0x11bd92);if(_0xb0106a){for(var _0x7ebd77 in _0xb0106a){if(_0xb0106a[_0x1c4e('0x79')](_0x7ebd77)){this[_0x1c4e('0x37')][_0x1c4e('0xb8')](util['format'](_0x1c4e('0xcb'),_0x7ebd77[_0x1c4e('0xcc')]()),_0xb0106a[_0x7ebd77]);}}this[_0x1c4e('0x40')](_0xb0106a[_0x1c4e('0xcd')],'out');return this[_0x1c4e('0x37')][_0x1c4e('0x95')](util[_0x1c4e('0x26')](_0x1c4e('0xce'),_0xb0106a['speech']));}return this[_0x1c4e('0x37')][_0x1c4e('0x2a')](_0x11bd92,_0x1c4e('0xcf'));};AGIVertices[_0x1c4e('0xc')][_0x1c4e('0xd0')]=function(_0x68390a){logger[_0x1c4e('0x2c')](util[_0x1c4e('0x26')]('Enter\x20in\x20SESTEKNDA\x20(%s)\x20block',_0x68390a[_0x1c4e('0x36')]));if(!this['isConfigured'](_0x68390a['ndauth_url'])){return this[_0x1c4e('0x37')][_0x1c4e('0x95')](_0x1c4e('0xd1'));}if(!this[_0x1c4e('0x82')](_0x68390a[_0x1c4e('0xd2')])){return this[_0x1c4e('0x37')][_0x1c4e('0x95')](_0x1c4e('0xd3'));}if(!this['isConfigured'](_0x68390a[_0x1c4e('0xd4')])){return this['channel'][_0x1c4e('0x95')](_0x1c4e('0xd5'));}if(!this['isConfigured'](_0x68390a['ndassistant_url'])){return this[_0x1c4e('0x37')][_0x1c4e('0x95')]('no\x20text\x20configured');}this[_0x1c4e('0x37')][_0x1c4e('0xc9')]=!![];this['createSquareDetailsReport'](_0x68390a);this['createSquareMessage'](_0x68390a[_0x1c4e('0x59')],'in');this['channel'][_0x1c4e('0x95')](util['format'](_0x1c4e('0xd6'),_0x68390a[_0x1c4e('0x59')]));var _0x4c6101=this[_0x1c4e('0x64')][_0x1c4e('0x84')](this,_0x68390a);if(_0x4c6101){for(var _0x44a6b3 in _0x4c6101){if(_0x4c6101['hasOwnProperty'](_0x44a6b3)){this[_0x1c4e('0x37')][_0x1c4e('0xb8')](util['format'](_0x1c4e('0xd7'),_0x44a6b3[_0x1c4e('0xcc')]()),_0x4c6101[_0x44a6b3]);}}this[_0x1c4e('0x40')](_0x4c6101[_0x1c4e('0xcd')],'out');if(_0x4c6101[_0x1c4e('0xd8')]){this[_0x1c4e('0x37')][_0x1c4e('0x95')](util[_0x1c4e('0x26')](_0x1c4e('0xd9'),_0x4c6101['audiofile']));var _0x49bc38=this[_0x1c4e('0x37')][_0x1c4e('0xda')](_0x4c6101[_0x1c4e('0xd8')]);try{fs[_0x1c4e('0xdb')](_0x4c6101[_0x1c4e('0xd8')]+_0x1c4e('0xdc'));}catch(_0x242b72){logger[_0x1c4e('0x2a')](_0x242b72);}return _0x49bc38;}else{return this['channel'][_0x1c4e('0x95')](util[_0x1c4e('0x26')](_0x1c4e('0xdd'),_0x4c6101['speech']));}}return this[_0x1c4e('0x37')][_0x1c4e('0x2a')](_0x68390a,_0x1c4e('0xde'));};AGIVertices[_0x1c4e('0xc')][_0x1c4e('0xdf')]=function(_0x38ea18){logger['info'](util[_0x1c4e('0x26')]('Enter\x20in\x20END\x20(%s)\x20block',_0x38ea18[_0x1c4e('0x36')]));return this['channel'][_0x1c4e('0x95')](_0x1c4e('0xdf'));};AGIVertices['prototype'][_0x1c4e('0xe0')]=function(_0xc700d6){logger['info'](util[_0x1c4e('0x26')]('Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block',_0xc700d6[_0x1c4e('0x36')]));var _0x5adc56='';if(_0xc700d6[_0x1c4e('0xe1')]){if(!this['isConfigured'](_0xc700d6[_0x1c4e('0xe1')])){return this[_0x1c4e('0x37')][_0x1c4e('0x2a')](_0xc700d6,_0x1c4e('0xe2'));}else{var _0x37d9f9=parseInt(_0xc700d6[_0x1c4e('0xe1')],0xa);if(isNaN(_0x37d9f9)){_0x5adc56=_0xc700d6[_0x1c4e('0xe1')];}else{_0x5adc56=this[_0x1c4e('0x17')][_0x1c4e('0x84')](this,_0xc700d6[_0x1c4e('0xe1')]);if(!_0x5adc56){return this['channel'][_0x1c4e('0x2a')](_0xc700d6,_0x1c4e('0xe3'));}}}}else if(_0xc700d6['trunk_name']){_0x5adc56=_0xc700d6[_0x1c4e('0xe4')];}else{return this['channel'][_0x1c4e('0x2a')](_0xc700d6,_0x1c4e('0xe2'));}var _0xd5376f=this['channel']['exec']('DIAL',[util[_0x1c4e('0x26')](_0x1c4e('0xe5'),_0x5adc56,_0xc700d6[_0x1c4e('0xe6')]),_0xc700d6[_0x1c4e('0x8b')],_0xc700d6[_0x1c4e('0xc3')],_0xc700d6['url']]);if(_0xd5376f[_0x1c4e('0x80')]===-0x1){return _0xd5376f;}return this[_0x1c4e('0x37')]['noop'](util['format'](_0x1c4e('0xc5'),_0x1c4e('0xc1')));};AGIVertices['prototype']['finally']=function(_0x10fc25){logger[_0x1c4e('0x2c')](util[_0x1c4e('0x26')]('Enter\x20in\x20FINALLY\x20(%s)\x20block',_0x10fc25[_0x1c4e('0x36')]));return this['channel'][_0x1c4e('0x95')](_0x1c4e('0xe7'));};AGIVertices['prototype'][_0x1c4e('0x9')]=function(_0x481d0d){logger['info'](util[_0x1c4e('0x26')](_0x1c4e('0xe8'),_0x481d0d[_0x1c4e('0x36')]));if(_0x481d0d[_0x1c4e('0x85')]===0x0){return this[_0x1c4e('0x83')](_0x481d0d);}_0x481d0d[_0x1c4e('0x85')]-=0x1;if(!this[_0x1c4e('0x82')](_0x481d0d[_0x1c4e('0xe9')])){return this[_0x1c4e('0x37')][_0x1c4e('0x2a')](_0x481d0d,_0x1c4e('0xea'));}var _0x422528=this[_0x1c4e('0x19')][_0x1c4e('0x84')](this,_0x481d0d[_0x1c4e('0xe9')]);if(!_0x422528){return this[_0x1c4e('0x37')][_0x1c4e('0x2a')](_0x481d0d,'no\x20file\x20audio\x20found');}if(!this[_0x1c4e('0x82')](_0x481d0d['variable_id'])){return this[_0x1c4e('0x37')][_0x1c4e('0x2a')](_0x1c4e('0xb4'));}var _0x33860b=this[_0x1c4e('0x37')][_0x1c4e('0xeb')](_0x422528,_0x481d0d['response'],_0x481d0d[_0x1c4e('0xec')]);var _0x35e2d2=_0x33860b[_0x1c4e('0x80')]?_0x33860b[_0x1c4e('0x80')][_0x1c4e('0x4b')]():'';logger['info'](_0x1c4e('0xed'),JSON[_0x1c4e('0xee')](_0x33860b));if(_0x33860b[_0x1c4e('0x80')]===-0x1){this[_0x1c4e('0x34')][_0x1c4e('0x84')](this,_0x481d0d,_0x35e2d2);return _0x33860b;}else if(_0x33860b[_0x1c4e('0x7e')]===_0x1c4e('0x8b')){_0x33860b[_0x1c4e('0x80')]=_0x35e2d2[_0x1c4e('0x7c')]>=parseInt(_0x481d0d['mindigit'])?'x':'i';}else{_0x33860b[_0x1c4e('0x80')]=_0x35e2d2[_0x1c4e('0x7c')]>=parseInt(_0x481d0d['mindigit'])&&_0x35e2d2[_0x1c4e('0x7c')]<=parseInt(_0x481d0d[_0x1c4e('0xec')])?'x':'i';}var _0x11b431=this[_0x1c4e('0x7d')][_0x1c4e('0x84')](this,_0x481d0d[_0x1c4e('0xb3')]);if(!_0x11b431){return this['channel'][_0x1c4e('0x2a')](_0x481d0d,_0x1c4e('0xb5'));}this[_0x1c4e('0x37')][_0x1c4e('0xb8')](_0x11b431,_0x35e2d2);if(this[_0x1c4e('0x82')](_0x481d0d[_0x1c4e('0xef')])){var _0x21065c=parseInt(_0x481d0d[_0x1c4e('0xef')],0xa);var _0xa2ada1=rs['generate']({'charset':'*','length':_0x21065c});var _0x55997e=_0x35e2d2[_0x1c4e('0x7c')];if(_0x55997e>0x0){if(_0x55997e>_0x21065c){this[_0x1c4e('0x34')]['sync'](this,_0x481d0d,_0x481d0d[_0x1c4e('0xf0')]==='first'?_0xa2ada1+_0x35e2d2[_0x1c4e('0xf1')](_0x21065c):_0x35e2d2[_0x1c4e('0xf1')](0x0,_0x55997e-_0x21065c)+_0xa2ada1);}else{this[_0x1c4e('0x34')][_0x1c4e('0x84')](this,_0x481d0d,rs[_0x1c4e('0xf2')]({'charset':'*','length':_0x55997e}));}}else{this['createSquareDetailsReport']['sync'](this,_0x481d0d,'');}}else{this[_0x1c4e('0x34')]['sync'](this,_0x481d0d,_0x35e2d2);}return _0x33860b;};AGIVertices['prototype'][_0x1c4e('0xa')]=function(_0x3b621a){logger[_0x1c4e('0x2c')](util['format'](_0x1c4e('0xf3'),_0x3b621a['label']));return this[_0x1c4e('0x9')](_0x3b621a);};AGIVertices[_0x1c4e('0xc')]['goal']=function(_0x337871){logger[_0x1c4e('0x2c')](util['format'](_0x1c4e('0xf4'),_0x337871['label']));this[_0x1c4e('0x34')]['sync'](this,_0x337871,_0x337871[_0x1c4e('0xf5')]);return this['channel']['noop'](util['format'](_0x1c4e('0xf6'),_0x337871['goalname']));};AGIVertices['prototype']['awspolly']=function(_0x3d9255){logger[_0x1c4e('0x2c')](util['format'](_0x1c4e('0xf7'),_0x3d9255['label']));if(!this[_0x1c4e('0x82')](_0x3d9255[_0x1c4e('0x6b')])||!this[_0x1c4e('0x82')](_0x3d9255['aws_secret_access_key'])){return this[_0x1c4e('0x37')][_0x1c4e('0x95')](_0x1c4e('0xf8'));}if(!this[_0x1c4e('0x82')](_0x3d9255[_0x1c4e('0x59')])){return this[_0x1c4e('0x37')][_0x1c4e('0x95')](_0x1c4e('0x99'));}this[_0x1c4e('0x37')][_0x1c4e('0x95')](util[_0x1c4e('0x26')](_0x1c4e('0xf9'),_0x3d9255['text']));var _0x5a6f33=this[_0x1c4e('0x6a')][_0x1c4e('0x84')](this,_0x3d9255);if(_0x5a6f33){this[_0x1c4e('0x37')][_0x1c4e('0x95')](util[_0x1c4e('0x26')](_0x1c4e('0xfa'),_0x5a6f33));var _0xf44b89=this[_0x1c4e('0x37')]['streamFile'](_0x5a6f33);try{fs[_0x1c4e('0xdb')](_0x5a6f33+_0x1c4e('0xdc'));}catch(_0x451a21){logger[_0x1c4e('0x2a')](_0x451a21);}return _0xf44b89;}return this[_0x1c4e('0x37')]['error'](_0x3d9255,'aws\x20Polly\x20is\x20unreachable');};AGIVertices[_0x1c4e('0xc')][_0x1c4e('0xfb')]=function(_0x58abe1){logger[_0x1c4e('0x2c')](util[_0x1c4e('0x26')](_0x1c4e('0xfc'),_0x58abe1[_0x1c4e('0x36')]));if(!this[_0x1c4e('0x82')](_0x58abe1[_0x1c4e('0x6b')])||!this[_0x1c4e('0x82')](_0x58abe1['aws_secret_access_key'])){return this[_0x1c4e('0x37')][_0x1c4e('0x95')](_0x1c4e('0xf8'));}if(!this['isConfigured'](_0x58abe1[_0x1c4e('0xfd')])){return this[_0x1c4e('0x37')][_0x1c4e('0x95')](_0x1c4e('0xfe'));}if(!this[_0x1c4e('0x82')](_0x58abe1['text'])){return this[_0x1c4e('0x37')]['noop'](_0x1c4e('0x99'));}this[_0x1c4e('0x37')][_0x1c4e('0xc9')]=!![];this[_0x1c4e('0x34')](_0x58abe1);this[_0x1c4e('0x40')](_0x58abe1[_0x1c4e('0x59')],'in');this[_0x1c4e('0x37')][_0x1c4e('0x95')](util[_0x1c4e('0x26')]('Trying\x20Amazon\x20Lex:\x20%s',_0x58abe1[_0x1c4e('0x59')]));var _0x1c9af9=this[_0x1c4e('0x70')]['sync'](this,_0x58abe1);if(_0x1c9af9){for(var _0x1ed51d in _0x1c9af9){if(_0x1c9af9[_0x1c4e('0x79')](_0x1ed51d)&&_[_0x1c4e('0xff')](_0x1c9af9[_0x1ed51d])){this[_0x1c4e('0x37')]['setVariable'](util[_0x1c4e('0x26')](_0x1c4e('0x100'),_0x1ed51d[_0x1c4e('0xcc')]()),_0x1c9af9[_0x1ed51d]);}}if(_[_0x1c4e('0x46')](_0x1c9af9['message'])){return this['channel'][_0x1c4e('0x95')](_0x1c4e('0x101'));}else{this['createSquareMessage'](_0x1c9af9[_0x1c4e('0x102')],'out');return this[_0x1c4e('0x37')][_0x1c4e('0x95')](util[_0x1c4e('0x26')](_0x1c4e('0x103'),_0x1c9af9['message']));}}return this[_0x1c4e('0x37')][_0x1c4e('0x2a')](_0x58abe1,'Amazon\x20Lex\x20is\x20unreachable');};AGIVertices[_0x1c4e('0xc')]['googleasr']=function(_0x2d2264){logger['info'](util[_0x1c4e('0x26')](_0x1c4e('0x104'),_0x2d2264[_0x1c4e('0x36')],_0x2d2264[_0x1c4e('0x8b')]));if(!this['isConfigured'](_0x2d2264[_0x1c4e('0x62')])){return this[_0x1c4e('0x37')][_0x1c4e('0x95')](_0x1c4e('0xc8'));}var _0x106c7d=_0x1c4e('0x105');var _0x2ec4f3=util['format'](_0x1c4e('0x106'),FILES_PATH,rs['generate'](0x4));var _0x317f7e=util[_0x1c4e('0x26')](_0x1c4e('0x107'),_0x2ec4f3,_0x106c7d);var _0x352bc4=!![];if(_0x2d2264[_0x1c4e('0x108')]==='NOBEEP'){_0x352bc4=![];}var _0x48066b=this[_0x1c4e('0x37')][_0x1c4e('0x109')](_0x2ec4f3,_0x106c7d,_0x2d2264[_0x1c4e('0x10a')],_0x2d2264['timeout'],undefined,_0x352bc4);if(_0x48066b[_0x1c4e('0x80')]!==-0x1){this['channel'][_0x1c4e('0x95')](util[_0x1c4e('0x26')]('google\x20%s\x20file\x20created',_0x317f7e));var _0x2a3598=this['googleASR'][_0x1c4e('0x84')](this,_0x2d2264,_0x317f7e);if(_0x2a3598){for(var _0x458cf5 in _0x2a3598){if(_0x2a3598[_0x1c4e('0x79')](_0x458cf5)){this[_0x1c4e('0x37')][_0x1c4e('0xb8')](util[_0x1c4e('0x26')](_0x1c4e('0x10b'),_0x458cf5[_0x1c4e('0xcc')]()),_0x2a3598[_0x458cf5]);}}return this[_0x1c4e('0x37')][_0x1c4e('0x95')](util[_0x1c4e('0x26')]('GoogleASR\x20Result\x20%s',JSON['stringify'](_0x2a3598)));}}return _0x48066b;};AGIVertices['prototype'][_0x1c4e('0x10c')]=function(_0x5eb8e8){logger[_0x1c4e('0x2c')](util[_0x1c4e('0x26')](_0x1c4e('0x10d'),_0x5eb8e8[_0x1c4e('0x36')]));if(!this[_0x1c4e('0x82')](_0x5eb8e8['appid'])){return this[_0x1c4e('0x37')][_0x1c4e('0x95')](_0x1c4e('0x10e'));}if(!this[_0x1c4e('0x82')](_0x5eb8e8[_0x1c4e('0x76')])){return this[_0x1c4e('0x37')][_0x1c4e('0x95')](_0x1c4e('0x10f'));}var _0x4b8fa5=_0x1c4e('0x105');var _0x2362d1=util['format'](_0x1c4e('0x106'),FILES_PATH,rs[_0x1c4e('0xf2')](0x4));var _0x16b1af=util[_0x1c4e('0x26')]('%s.%s',_0x2362d1,_0x4b8fa5);var _0x446234=!![];if(_0x5eb8e8[_0x1c4e('0x108')]===_0x1c4e('0x110')){_0x446234=![];}var _0x4d91bb=this['channel'][_0x1c4e('0x109')](_0x2362d1,_0x4b8fa5,_0x5eb8e8[_0x1c4e('0x10a')],_0x5eb8e8['timeout'],undefined,_0x446234);if(_0x4d91bb[_0x1c4e('0x80')]!==-0x1){this[_0x1c4e('0x37')][_0x1c4e('0x95')](util['format']('tilde\x20%s\x20file\x20created',_0x16b1af));var _0x802dc0=this['tildeASR'][_0x1c4e('0x84')](this,_0x5eb8e8,_0x16b1af);if(_0x802dc0){for(var _0x27ca1c in _0x802dc0){if(_0x802dc0[_0x1c4e('0x79')](_0x27ca1c)){this['channel'][_0x1c4e('0xb8')](util[_0x1c4e('0x26')](_0x1c4e('0x111'),_0x27ca1c[_0x1c4e('0xcc')]()),_0x802dc0[_0x27ca1c]);}}return this[_0x1c4e('0x37')][_0x1c4e('0x95')](util[_0x1c4e('0x26')](_0x1c4e('0x112'),JSON['stringify'](_0x802dc0)));}}return _0x4d91bb;};AGIVertices[_0x1c4e('0xc')][_0x1c4e('0x113')]=function(_0x46897e){logger[_0x1c4e('0x2c')](util[_0x1c4e('0x26')](_0x1c4e('0x114'),_0x46897e[_0x1c4e('0x36')]));return this['channel'][_0x1c4e('0x115')](_0x46897e['context'],_0x46897e[_0x1c4e('0x116')],_0x46897e[_0x1c4e('0x3c')]);};AGIVertices[_0x1c4e('0xc')][_0x1c4e('0x117')]=function(_0x3c14c8){logger['info'](util[_0x1c4e('0x26')](_0x1c4e('0x118'),_0x3c14c8[_0x1c4e('0x36')]));if(!this[_0x1c4e('0x82')](_0x3c14c8['condition'])){return this[_0x1c4e('0x37')][_0x1c4e('0x2a')](_0x3c14c8,_0x1c4e('0x119'));}try{var _0x37635a=eval(_0x3c14c8[_0x1c4e('0x11a')])?_0x1c4e('0x11b'):_0x1c4e('0x11c');this[_0x1c4e('0x37')][_0x1c4e('0x95')](util[_0x1c4e('0x26')](_0x1c4e('0x11d'),_0x3c14c8['condition'],_0x37635a));return{'code':0xc8,'result':_0x37635a};}catch(_0x2b7d01){return{'code':0xc8,'result':_0x1c4e('0x11c')};}};AGIVertices[_0x1c4e('0xc')][_0x1c4e('0x11e')]=function(_0x3bced4){logger[_0x1c4e('0x2c')](util['format']('Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block',_0x3bced4[_0x1c4e('0x36')]));if(!this[_0x1c4e('0x82')](_0x3bced4[_0x1c4e('0x11f')])){return this[_0x1c4e('0x37')][_0x1c4e('0x2a')](_0x3bced4,_0x1c4e('0x120'));}var _0x108d73=this['getIntervals'][_0x1c4e('0x84')](this,_0x3bced4['interval_id']);if(!_0x108d73){return this[_0x1c4e('0x37')]['error'](_0x3bced4,_0x1c4e('0x121'));}for(var _0x19edb9=0x0;_0x19edb9<_0x108d73['length'];_0x19edb9+=0x1){var _0x4b0575=this[_0x1c4e('0x37')][_0x1c4e('0x7d')](util[_0x1c4e('0x26')](_0x1c4e('0x122'),_0x108d73[_0x19edb9]));if(_0x4b0575[_0x1c4e('0x80')]===-0x1){return _0x4b0575;}logger[_0x1c4e('0x2c')](util[_0x1c4e('0x26')](_0x1c4e('0x123'),_0x108d73[_0x19edb9],_0x4b0575['extra']));if(_0x4b0575[_0x1c4e('0x7e')]===_0x1c4e('0x11b')){logger[_0x1c4e('0x2c')](util[_0x1c4e('0x26')]('IFTIME\x20%s\x20%s',_0x108d73[_0x19edb9],'true'));this[_0x1c4e('0x37')][_0x1c4e('0x95')](util[_0x1c4e('0x26')](_0x1c4e('0x123'),_0x108d73[_0x19edb9],_0x1c4e('0x11b')));return{'code':0xc8,'result':_0x1c4e('0x11b')};}else{logger['info'](util[_0x1c4e('0x26')](_0x1c4e('0x123'),_0x108d73[_0x19edb9],'false'));this[_0x1c4e('0x37')][_0x1c4e('0x95')](util[_0x1c4e('0x26')](_0x1c4e('0x123'),_0x108d73[_0x19edb9],_0x1c4e('0x11c')));}}return{'code':0xc8,'result':_0x1c4e('0x11c')};};AGIVertices[_0x1c4e('0xc')]['hangup']=function(_0x4d62c8){logger['info'](util[_0x1c4e('0x26')]('Enter\x20in\x20HANGUP\x20(%s)\x20block',_0x4d62c8[_0x1c4e('0x36')]));return this[_0x1c4e('0x37')][_0x1c4e('0x124')]();};AGIVertices['prototype']['ispeechasr']=function(_0x581581){logger[_0x1c4e('0x2c')](util['format'](_0x1c4e('0x125'),_0x581581[_0x1c4e('0x36')]));if(!this['isConfigured'](_0x581581[_0x1c4e('0x62')])){return this['channel']['noop'](_0x1c4e('0xc8'));}var _0x19af6f=_0x1c4e('0x105');var _0x4fa661=util[_0x1c4e('0x26')](_0x1c4e('0x106'),FILES_PATH,rs[_0x1c4e('0xf2')](0x4));var _0x5d6851=util[_0x1c4e('0x26')](_0x1c4e('0x107'),_0x4fa661,_0x19af6f);var _0x5cd150=!![];if(_0x581581[_0x1c4e('0x108')]===_0x1c4e('0x110')){_0x5cd150=![];}var _0x9afb27=this[_0x1c4e('0x37')][_0x1c4e('0x109')](_0x4fa661,_0x19af6f,_0x581581['intKey'],_0x581581[_0x1c4e('0x8b')],undefined,_0x5cd150);if(_0x9afb27['result']!==-0x1){this[_0x1c4e('0x37')]['noop'](util[_0x1c4e('0x26')](_0x1c4e('0x126'),_0x5d6851));var _0x37b1b8=this[_0x1c4e('0x67')]['sync'](this,_0x581581,_0x5d6851);if(_0x37b1b8){for(var _0x5af0c8 in _0x37b1b8){if(_0x37b1b8['hasOwnProperty'](_0x5af0c8)){this[_0x1c4e('0x37')][_0x1c4e('0xb8')](util[_0x1c4e('0x26')](_0x1c4e('0x127'),_0x5af0c8[_0x1c4e('0xcc')]()),_0x37b1b8[_0x5af0c8]);}}return this[_0x1c4e('0x37')][_0x1c4e('0x95')](util[_0x1c4e('0x26')]('IspeechASR\x20Result\x20%s',JSON[_0x1c4e('0xee')](_0x37b1b8)));}}return _0x9afb27;};AGIVertices[_0x1c4e('0xc')]['ispeechtts']=function(_0x4658da){logger[_0x1c4e('0x2c')](util[_0x1c4e('0x26')](_0x1c4e('0x128'),_0x4658da[_0x1c4e('0x36')]));if(!this[_0x1c4e('0x82')](_0x4658da[_0x1c4e('0x62')])){return this[_0x1c4e('0x37')]['noop'](_0x1c4e('0xc8'));}if(!this['isConfigured'](_0x4658da[_0x1c4e('0x59')])){return this['channel']['noop']('no\x20text\x20configured');}this[_0x1c4e('0x37')]['noop'](util[_0x1c4e('0x26')](_0x1c4e('0x129'),_0x4658da[_0x1c4e('0x59')]));var _0x212b86=this[_0x1c4e('0x65')][_0x1c4e('0x84')](this,_0x4658da);if(_0x212b86){this[_0x1c4e('0x37')][_0x1c4e('0x95')](util['format']('ispeech\x20%s\x20file\x20created',_0x212b86));var _0x5018c8=this[_0x1c4e('0x37')]['streamFile'](_0x212b86,_0x4658da[_0x1c4e('0x10a')]);try{fs['unlink'](_0x212b86+_0x1c4e('0xdc'));}catch(_0x69bbda){logger['error'](_0x69bbda);}return _0x5018c8;}return this[_0x1c4e('0x37')][_0x1c4e('0x2a')](_0x4658da,_0x1c4e('0x12a'));};AGIVertices['prototype'][_0x1c4e('0x12b')]=function(_0x411d2e){logger['info'](util[_0x1c4e('0x26')](_0x1c4e('0x12c'),_0x411d2e['label']));if(!this['isConfigured'](_0x411d2e[_0x1c4e('0x12d')])){return this[_0x1c4e('0x37')][_0x1c4e('0x2a')](_0x411d2e,'no\x20find\x20by\x20configured');}logger[_0x1c4e('0x2c')](util[_0x1c4e('0x26')](_0x1c4e('0x12e'),this[_0x1c4e('0x37')]['callerid'],_0x411d2e[_0x1c4e('0x12d')]));var _0x1701ce=this['agentLogin'][_0x1c4e('0x84')](this,_0x411d2e[_0x1c4e('0x12d')]);if(_0x1701ce){logger[_0x1c4e('0x2c')](util[_0x1c4e('0x26')]('AGENT\x20%s\x20FOUND\x20BY',this['channel'][_0x1c4e('0x39')],_0x411d2e[_0x1c4e('0x12d')]));this[_0x1c4e('0x37')][_0x1c4e('0x95')](util['format']('AGENT\x20%s\x20FOUND\x20BY',this['channel'][_0x1c4e('0x39')],_0x411d2e[_0x1c4e('0x12d')]));return{'code':0xc8,'result':_0x1c4e('0x12f')};}else{logger[_0x1c4e('0x2c')](util[_0x1c4e('0x26')](_0x1c4e('0x130'),this[_0x1c4e('0x37')]['callerid'],_0x411d2e['findBy']));this['channel'][_0x1c4e('0x95')](util[_0x1c4e('0x26')](_0x1c4e('0x130'),this[_0x1c4e('0x37')][_0x1c4e('0x39')],_0x411d2e['findBy']));return{'code':0xc8,'result':_0x1c4e('0x131')};}};AGIVertices['prototype'][_0x1c4e('0x132')]=function(_0x296e04){logger['info'](util[_0x1c4e('0x26')]('Enter\x20in\x20LOGOUT\x20(%s)\x20block',_0x296e04[_0x1c4e('0x36')]));if(!this[_0x1c4e('0x82')](_0x296e04[_0x1c4e('0x12d')])){return this[_0x1c4e('0x37')][_0x1c4e('0x2a')](_0x296e04,_0x1c4e('0x133'));}logger[_0x1c4e('0x2c')](util[_0x1c4e('0x26')](_0x1c4e('0x12e'),this[_0x1c4e('0x37')][_0x1c4e('0x39')],_0x296e04[_0x1c4e('0x12d')]));var _0x4a5d9d=this[_0x1c4e('0x51')][_0x1c4e('0x84')](this,_0x296e04[_0x1c4e('0x12d')]);if(_0x4a5d9d){logger[_0x1c4e('0x2c')](util['format'](_0x1c4e('0x134'),this['channel'][_0x1c4e('0x39')],_0x296e04[_0x1c4e('0x12d')]));this['channel'][_0x1c4e('0x95')](util[_0x1c4e('0x26')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x1c4e('0x37')]['callerid'],_0x296e04['findBy']));return{'code':0xc8,'result':'success'};}else{logger[_0x1c4e('0x2c')](util['format'](_0x1c4e('0x130'),this['channel'][_0x1c4e('0x39')],_0x296e04['findBy']));this[_0x1c4e('0x37')][_0x1c4e('0x95')](util['format']('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x1c4e('0x37')][_0x1c4e('0x39')],_0x296e04[_0x1c4e('0x12d')]));return{'code':0xc8,'result':_0x1c4e('0x131')};}};AGIVertices[_0x1c4e('0xc')][_0x1c4e('0x135')]=function(_0x26722c){logger[_0x1c4e('0x2c')](util[_0x1c4e('0x26')]('Enter\x20in\x20MATH\x20(%s)\x20block',_0x26722c[_0x1c4e('0x36')]));if(!this[_0x1c4e('0x82')](_0x26722c[_0x1c4e('0x136')])){return this[_0x1c4e('0x37')][_0x1c4e('0x2a')](_0x26722c,'no\x20operation\x20configured');}this[_0x1c4e('0x37')][_0x1c4e('0x95')](util[_0x1c4e('0x26')](_0x1c4e('0x137'),_0x26722c[_0x1c4e('0x136')]));var _0x20c6cb=eval(_0x26722c[_0x1c4e('0x136')]);if(!this[_0x1c4e('0x82')](_0x26722c[_0x1c4e('0xb3')])){return this[_0x1c4e('0x37')][_0x1c4e('0x95')](_0x1c4e('0xb4'));}var _0x513d18=this[_0x1c4e('0x7d')][_0x1c4e('0x84')](this,_0x26722c[_0x1c4e('0xb3')]);if(!_0x513d18){return this[_0x1c4e('0x37')][_0x1c4e('0x2a')](_0x26722c,_0x1c4e('0xb5'));}if(_['isArray'](_0x20c6cb)){var _0x3a0e75=this;_0x20c6cb[_0x1c4e('0xb6')](function(_0x540c76,_0x53b871){_0x3a0e75['channel']['setVariable'](util[_0x1c4e('0x26')](_0x1c4e('0x138'),_0x513d18,_0x53b871),_0x540c76);});return this[_0x1c4e('0x37')][_0x1c4e('0x95')](util[_0x1c4e('0x26')]('variable\x20%s[key]\x20set',_0x513d18));}else{return this['channel']['setVariable'](_0x513d18,_0x20c6cb);}};AGIVertices[_0x1c4e('0xc')]['menu']=function(_0x4a1990){logger['info'](util[_0x1c4e('0x26')](_0x1c4e('0x139'),_0x4a1990['label']));if(_0x4a1990[_0x1c4e('0x85')]===0x0){return this[_0x1c4e('0x83')](_0x4a1990);}_0x4a1990['retry']-=0x1;if(!this[_0x1c4e('0x82')](_0x4a1990[_0x1c4e('0xe9')])){return this[_0x1c4e('0x37')][_0x1c4e('0x2a')](_0x4a1990,_0x1c4e('0xea'));}var _0x53c63a=this[_0x1c4e('0x19')][_0x1c4e('0x84')](this,_0x4a1990[_0x1c4e('0xe9')]);if(!_0x53c63a){return this[_0x1c4e('0x37')][_0x1c4e('0x2a')](_0x4a1990,_0x1c4e('0x13a'));}var _0x1ad6db=this[_0x1c4e('0x37')][_0x1c4e('0xeb')](_0x53c63a,_0x4a1990[_0x1c4e('0x13b')],_0x4a1990[_0x1c4e('0x13c')]);var _0x566f57=_0x1ad6db[_0x1c4e('0x80')];if(_0x1ad6db[_0x1c4e('0x80')]===-0x1){this[_0x1c4e('0x34')][_0x1c4e('0x84')](this,_0x4a1990,'-1');return _0x1ad6db;}else if(_0x1ad6db[_0x1c4e('0x7e')]===_0x1c4e('0x8b')){_0x1ad6db[_0x1c4e('0x80')]=_0x1ad6db[_0x1c4e('0x80')][_0x1c4e('0x7c')]>0x0?_0x1ad6db['result']:'t';}else if(_[_0x1c4e('0x42')](_0x1ad6db[_0x1c4e('0x80')])){_0x1ad6db[_0x1c4e('0x80')]='#';_0x566f57='#';}if(!this[_0x1c4e('0x82')](_0x4a1990[_0x1c4e('0xb3')])){this[_0x1c4e('0x37')][_0x1c4e('0x95')](_0x1c4e('0xb4'));}else{var _0x2385c0=this[_0x1c4e('0x7d')][_0x1c4e('0x84')](this,_0x4a1990['variable_id']);if(!_0x2385c0){return this[_0x1c4e('0x37')]['error'](_0x4a1990,_0x1c4e('0xb5'));}this[_0x1c4e('0x37')][_0x1c4e('0xb8')](_0x2385c0,_0x566f57);}this['createSquareDetailsReport'][_0x1c4e('0x84')](this,_0x4a1990,_0x566f57);return _0x1ad6db;};AGIVertices[_0x1c4e('0xc')][_0x1c4e('0x95')]=function(_0x58c064){logger[_0x1c4e('0x2c')](util[_0x1c4e('0x26')](_0x1c4e('0x13d'),_0x58c064[_0x1c4e('0x36')]));return this[_0x1c4e('0x37')][_0x1c4e('0x95')](_0x58c064[_0x1c4e('0x13e')]||_0x58c064[_0x1c4e('0x36')]);};AGIVertices[_0x1c4e('0xc')][_0x1c4e('0x13f')]=function(_0x5f54b8){logger[_0x1c4e('0x2c')](util[_0x1c4e('0x26')](_0x1c4e('0x140'),_0x5f54b8[_0x1c4e('0x36')]));if(!this[_0x1c4e('0x82')](_0x5f54b8[_0x1c4e('0x12d')])){return this[_0x1c4e('0x37')][_0x1c4e('0x2a')](_0x5f54b8,'no\x20find\x20by\x20configured');}logger[_0x1c4e('0x2c')](util[_0x1c4e('0x26')](_0x1c4e('0x12e'),this[_0x1c4e('0x37')]['callerid'],_0x5f54b8[_0x1c4e('0x12d')]));var _0x56642a=this[_0x1c4e('0x141')][_0x1c4e('0x84')](this,_0x5f54b8['pause_id']);var _0x527cd0=this[_0x1c4e('0x4f')]['sync'](this,_0x5f54b8['findBy'],_0x56642a);if(_0x527cd0){logger[_0x1c4e('0x2c')](util[_0x1c4e('0x26')](_0x1c4e('0x134'),this[_0x1c4e('0x37')][_0x1c4e('0x39')],_0x5f54b8[_0x1c4e('0x12d')]));this[_0x1c4e('0x37')][_0x1c4e('0x95')](util[_0x1c4e('0x26')](_0x1c4e('0x134'),this[_0x1c4e('0x37')][_0x1c4e('0x39')],_0x5f54b8[_0x1c4e('0x12d')]));return{'code':0xc8,'result':_0x1c4e('0x12f')};}else{logger[_0x1c4e('0x2c')](util[_0x1c4e('0x26')](_0x1c4e('0x130'),this[_0x1c4e('0x37')]['callerid'],_0x5f54b8[_0x1c4e('0x12d')]));this[_0x1c4e('0x37')][_0x1c4e('0x95')](util['format']('AGENT\x20%s\x20FOUND\x20BY',this['channel'][_0x1c4e('0x39')],_0x5f54b8[_0x1c4e('0x12d')]));return{'code':0xc8,'result':_0x1c4e('0x131')};}};AGIVertices[_0x1c4e('0xc')]['playback']=function(_0x1e8650){logger['info'](util['format']('Enter\x20in\x20PLAYBACK\x20(%s)\x20block',_0x1e8650[_0x1c4e('0x36')]));if(!this[_0x1c4e('0x82')](_0x1e8650[_0x1c4e('0xe9')])){return this[_0x1c4e('0x37')][_0x1c4e('0x2a')](_0x1e8650,'no\x20file\x20audio\x20selected');}var _0x5374db=this[_0x1c4e('0x19')][_0x1c4e('0x84')](this,_0x1e8650[_0x1c4e('0xe9')]);if(!_0x5374db){return this[_0x1c4e('0x37')][_0x1c4e('0x2a')](_0x1e8650,_0x1c4e('0x13a'));}var _0x358fb8=this[_0x1c4e('0x37')][_0x1c4e('0x56')](_0x1c4e('0x142'),[_0x5374db,_0x1e8650[_0x1c4e('0xc3')]]);if(_0x358fb8[_0x1c4e('0x80')]===-0x1){return _0x358fb8;}return this[_0x1c4e('0x37')][_0x1c4e('0x95')](util[_0x1c4e('0x26')](_0x1c4e('0x96'),_0x1c4e('0x142'),_0x5374db));};AGIVertices[_0x1c4e('0xc')]['queue']=function(_0x285f5d){logger['info'](util[_0x1c4e('0x26')](_0x1c4e('0x143'),_0x285f5d['label']));if(!this['isConfigured'](_0x285f5d[_0x1c4e('0x144')])){return this[_0x1c4e('0x37')][_0x1c4e('0x2a')](_0x285f5d,_0x1c4e('0x145'));}var _0x461de3='';var _0x5467bb=parseInt(_0x285f5d['queue_id'],0xa);if(isNaN(_0x5467bb)){_0x461de3=_0x285f5d[_0x1c4e('0x144')];}else{_0x461de3=this[_0x1c4e('0xf')]['sync'](this,_0x285f5d[_0x1c4e('0x144')]);if(!_0x461de3){return this[_0x1c4e('0x37')][_0x1c4e('0x2a')](_0x285f5d,_0x1c4e('0x146'));}}var _0x3c1dc3='';if(this[_0x1c4e('0x82')](_0x285f5d[_0x1c4e('0xe9')])){var _0x3f6cf0=this['getSound']['sync'](this,_0x285f5d[_0x1c4e('0xe9')]);if(_0x3f6cf0){_0x3c1dc3=_0x3f6cf0;}}this[_0x1c4e('0x34')]['sync'](this,_0x285f5d,_0x461de3);if(_0x285f5d[_0x1c4e('0xc3')][_0x1c4e('0x147')]('x')<0x0){_0x285f5d[_0x1c4e('0xc3')]+='x';}if(_0x285f5d[_0x1c4e('0xc3')]['indexOf']('X')<0x0){_0x285f5d[_0x1c4e('0xc3')]+='X';}this[_0x1c4e('0x37')][_0x1c4e('0xb8')](_0x1c4e('0x148'),_0x461de3?_0x461de3[_0x1c4e('0x149')]():'');var _0x581651=this['channel']['exec'](_0x1c4e('0x14a'),[_0x461de3,_0x285f5d[_0x1c4e('0xc3')],_0x285f5d[_0x1c4e('0xc4')],_0x3c1dc3,_0x285f5d[_0x1c4e('0x8b')],_0x285f5d[_0x1c4e('0x6')],_0x285f5d[_0x1c4e('0x14b')],_0x285f5d[_0x1c4e('0x14c')],'',_0x285f5d['position']]);if(_0x581651[_0x1c4e('0x80')]===-0x1){return _0x581651;}return this[_0x1c4e('0x37')][_0x1c4e('0x95')](util[_0x1c4e('0x26')](_0x1c4e('0x96'),_0x1c4e('0x14a'),_0x461de3));};AGIVertices['prototype'][_0x1c4e('0x14d')]=function(_0x2608ac){logger[_0x1c4e('0x2c')](util[_0x1c4e('0x26')](_0x1c4e('0x14e'),_0x2608ac[_0x1c4e('0x36')]));var _0x2de14f=_0x2608ac[_0x1c4e('0x14f')]||'wav';var _0x1701f3=util['format'](_0x1c4e('0x150'),this[_0x1c4e('0x37')][_0x1c4e('0x35')],rs[_0x1c4e('0xf2')](0x5));var _0x1dbebf=util[_0x1c4e('0x26')](_0x1c4e('0x151'),FILES_PATH,_0x1701f3,_0x2de14f);var _0x46a969=util[_0x1c4e('0x26')](_0x1c4e('0x106'),FILES_PATH,_0x1701f3);this[_0x1c4e('0x3a')]['sync'](this,_0x2608ac,_0x1701f3,_0x1dbebf);this['channel']['setVariable'](_0x1c4e('0x152'),_0x1701f3);logger[_0x1c4e('0x2c')]('Recording\x20%s\x20%s\x20%s\x20%s',_0x46a969,_0x2de14f,_0x2608ac[_0x1c4e('0x153')],_0x2608ac[_0x1c4e('0x8b')]);return this[_0x1c4e('0x37')][_0x1c4e('0x109')](_0x46a969,_0x2de14f,_0x2608ac['escape_digits'],_0x2608ac[_0x1c4e('0x8b')],undefined,!![]);};AGIVertices[_0x1c4e('0xc')][_0x1c4e('0x154')]=function(_0x5b6722){logger[_0x1c4e('0x2c')](util[_0x1c4e('0x26')](_0x1c4e('0x155'),_0x5b6722[_0x1c4e('0x36')]));return this[_0x1c4e('0x37')][_0x1c4e('0x156')](_0x5b6722[_0x1c4e('0x157')][_0x1c4e('0xb1')](/\s+/g,''),_0x5b6722['escape_digits']);};AGIVertices['prototype'][_0x1c4e('0x158')]=function(_0x3dd948){logger[_0x1c4e('0x2c')](util[_0x1c4e('0x26')](_0x1c4e('0x159'),_0x3dd948[_0x1c4e('0x36')]));return this[_0x1c4e('0x37')][_0x1c4e('0x15a')](_0x3dd948[_0x1c4e('0x15b')]['replace'](/\s+/g,''),_0x3dd948['escape_digits']);};AGIVertices[_0x1c4e('0xc')][_0x1c4e('0x15c')]=function(_0x25d853){logger['info'](util[_0x1c4e('0x26')](_0x1c4e('0x15d'),_0x25d853[_0x1c4e('0x36')]));return this[_0x1c4e('0x37')][_0x1c4e('0x15e')](_0x25d853[_0x1c4e('0x59')],_0x25d853[_0x1c4e('0x153')]);};AGIVertices[_0x1c4e('0xc')][_0x1c4e('0x15f')]=function(_0x493c61){logger[_0x1c4e('0x2c')](util[_0x1c4e('0x26')](_0x1c4e('0x160'),_0x493c61[_0x1c4e('0x36')]));if(!this[_0x1c4e('0x82')](_0x493c61[_0x1c4e('0x161')])){return this[_0x1c4e('0x37')][_0x1c4e('0x95')](_0x1c4e('0x162'));}var _0x4f9d8c=this['getMailAccount'][_0x1c4e('0x84')](this,_0x493c61[_0x1c4e('0x161')]);if(!_0x4f9d8c||!_0x4f9d8c[_0x1c4e('0x163')]){return this['channel'][_0x1c4e('0x2a')](_0x493c61,'no\x20mail\x20account\x20found');}var _0x4be681={'from':util[_0x1c4e('0x26')](_0x1c4e('0x164'),_0x4f9d8c[_0x1c4e('0xd')],_0x4f9d8c[_0x1c4e('0x165')]||_0x4f9d8c[_0x1c4e('0x163')][_0x1c4e('0x166')]),'to':_0x493c61['to']||'','cc':_0x493c61['cc']||'','bcc':_0x493c61[_0x1c4e('0x167')]||'','subject':_0x493c61['subject'],'html':_0x493c61[_0x1c4e('0x59')],'text':_0x493c61['text']};var _0x2169ca={'tls':{'rejectUnauthorized':![]}};if(_0x4f9d8c['Smtp'][_0x1c4e('0x168')]){_0x2169ca['service']=_0x4f9d8c[_0x1c4e('0x163')][_0x1c4e('0x168')];}else{_0x2169ca[_0x1c4e('0x169')]=_0x4f9d8c['Smtp']['host'];_0x2169ca[_0x1c4e('0x16a')]=_0x4f9d8c['Smtp']['port'];_0x2169ca[_0x1c4e('0x16b')]=_0x4f9d8c['Smtp'][_0x1c4e('0x16b')];}if(_0x4f9d8c[_0x1c4e('0x163')][_0x1c4e('0x16c')]){_0x2169ca[_0x1c4e('0x16d')]={'user':_0x4f9d8c['Smtp']['user'],'pass':_0x4f9d8c['Smtp'][_0x1c4e('0x16e')]};}if(this[_0x1c4e('0x82')](_0x493c61[_0x1c4e('0x16f')])){}logger[_0x1c4e('0xbc')](_0x1c4e('0x170'),JSON['stringify'](_0x4be681));this['createSquareDetailsReport'][_0x1c4e('0x84')](this,_0x493c61,_0x493c61[_0x1c4e('0x161')]);this[_0x1c4e('0x37')][_0x1c4e('0x95')](util[_0x1c4e('0x26')](_0x1c4e('0x171'),_0x4f9d8c['name']));this[_0x1c4e('0x1f')][_0x1c4e('0x84')](this,_0x2169ca,_0x4be681);return this[_0x1c4e('0x37')]['noop'](_0x1c4e('0x172'));};AGIVertices[_0x1c4e('0xc')][_0x1c4e('0x173')]=function(_0x8f1988){logger[_0x1c4e('0x2c')](util['format'](_0x1c4e('0x174'),_0x8f1988['label']));return this[_0x1c4e('0x37')][_0x1c4e('0x95')]('SENDFAX\x20block\x20not\x20implemented');};AGIVertices['prototype']['sendSMS']=function(_0x18d8c0){logger['info'](util['format']('Enter\x20in\x20SENDSMS\x20(%s)\x20block',_0x18d8c0[_0x1c4e('0x36')]));if(!this['isConfigured'](_0x18d8c0[_0x1c4e('0x175')])){return this['channel']['noop']('no\x20sms\x20account\x20configured');}var _0x1341a6=this[_0x1c4e('0x31')][_0x1c4e('0x84')](this,_0x18d8c0[_0x1c4e('0x175')]);if(!_0x1341a6){return this['channel'][_0x1c4e('0x2a')](_0x18d8c0,'no\x20sms\x20account\x20found');}var _0x29682e={'body':_0x18d8c0['sms_text'],'phone':_0x18d8c0['to']||'','SmsAccountId':_0x1341a6['id']};logger['debug'](_0x1c4e('0x176'),JSON[_0x1c4e('0xee')](_0x29682e));this[_0x1c4e('0x34')][_0x1c4e('0x84')](this,_0x18d8c0,_0x18d8c0[_0x1c4e('0x175')]);this[_0x1c4e('0x37')][_0x1c4e('0x95')](util['format'](_0x1c4e('0x177'),_0x1341a6['name']));this[_0x1c4e('0x33')][_0x1c4e('0x84')](this,_0x29682e);return this[_0x1c4e('0x37')][_0x1c4e('0x95')]('Sms\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices['prototype'][_0x1c4e('0x178')]=function(_0x1762fb){logger[_0x1c4e('0x2c')](util[_0x1c4e('0x26')](_0x1c4e('0x179'),_0x1762fb[_0x1c4e('0x36')]));if(!this[_0x1c4e('0x82')](_0x1762fb[_0x1c4e('0xb3')])){return this[_0x1c4e('0x37')][_0x1c4e('0x2a')](_0x1762fb,_0x1c4e('0x17a'));}var _0x41aa49=this[_0x1c4e('0x7d')][_0x1c4e('0x84')](this,_0x1762fb[_0x1c4e('0xb3')]);if(!_0x41aa49){return this[_0x1c4e('0x37')][_0x1c4e('0x2a')](_0x1762fb,_0x1c4e('0xb5'));}return this['channel']['setVariable'](_0x41aa49,_0x1762fb[_0x1c4e('0x17b')]);};AGIVertices['prototype'][_0x1c4e('0x17c')]=function(_0x2abcf0){logger['info'](util['format'](_0x1c4e('0x17d'),_0x2abcf0[_0x1c4e('0x36')]));this[_0x1c4e('0x37')]['noop'](_0x1c4e('0x17e'));if(_0x2abcf0[_0x1c4e('0x89')]==='yes'){this[_0x1c4e('0x37')][_0x1c4e('0x95')](_0x1c4e('0x17f'));return this[_0x1c4e('0x37')][_0x1c4e('0x89')]();}return this['channel']['noop'](_0x1c4e('0x180'));};AGIVertices[_0x1c4e('0xc')][_0x1c4e('0x181')]=function(_0x226b56){logger['info'](util[_0x1c4e('0x26')]('Enter\x20in\x20SUBPROJECT\x20(%s)\x20block',_0x226b56[_0x1c4e('0x36')]));if(!this[_0x1c4e('0x82')](_0x226b56[_0x1c4e('0x182')])){return this['channel']['error'](_0x226b56,'no\x20subproject\x20selected');}var _0x5ea3b6=this['getSquareProject'][_0x1c4e('0x84')](this,_0x226b56[_0x1c4e('0x182')]);if(!this[_0x1c4e('0x82')](_0x5ea3b6)){return this['channel'][_0x1c4e('0x2a')](_0x226b56,util[_0x1c4e('0x26')](_0x1c4e('0x183'),_0x226b56[_0x1c4e('0x182')]));}if(_0x5ea3b6===this[_0x1c4e('0x37')][_0x1c4e('0x38')]){return this[_0x1c4e('0x37')][_0x1c4e('0x2a')](_0x226b56,_0x1c4e('0x184'));}this[_0x1c4e('0x34')][_0x1c4e('0x84')](this,_0x226b56,_0x5ea3b6);var _0x2c9a57=this[_0x1c4e('0x37')][_0x1c4e('0x56')](_0x1c4e('0x185'),util['format'](_0x1c4e('0x186'),config[_0x1c4e('0x6')]['host']||_0x1c4e('0x187'),_0x5ea3b6,this[_0x1c4e('0x37')][_0x1c4e('0x38')]));if(_0x2c9a57[_0x1c4e('0x80')]===-0x1){return _0x2c9a57;}return this[_0x1c4e('0x37')][_0x1c4e('0x95')](util[_0x1c4e('0x26')](_0x1c4e('0x96'),'AGI',_0x5ea3b6));};AGIVertices[_0x1c4e('0xc')]['system']=function(_0x3a8b2e){logger[_0x1c4e('0x2c')](util['format'](_0x1c4e('0x188'),_0x3a8b2e['label']));var _0x2c7bdb=this[_0x1c4e('0x55')]['sync'](this,_0x3a8b2e[_0x1c4e('0x87')]);this[_0x1c4e('0x34')][_0x1c4e('0x84')](this,_0x3a8b2e,_0x3a8b2e[_0x1c4e('0x87')]);if(this[_0x1c4e('0x82')](_0x3a8b2e[_0x1c4e('0xb3')])){var _0x3a5bcf=this[_0x1c4e('0x7d')][_0x1c4e('0x84')](this,_0x3a8b2e[_0x1c4e('0xb3')]);if(_0x3a5bcf){this[_0x1c4e('0x37')][_0x1c4e('0xb8')](_0x3a5bcf,_0x2c7bdb);return this[_0x1c4e('0x37')]['noop'](util[_0x1c4e('0x26')](_0x1c4e('0x189'),_0x3a8b2e[_0x1c4e('0x87')],_0x3a5bcf));}}return this[_0x1c4e('0x37')][_0x1c4e('0x95')](util[_0x1c4e('0x26')](_0x1c4e('0x18a'),_0x3a8b2e[_0x1c4e('0x87')]));};AGIVertices[_0x1c4e('0xc')][_0x1c4e('0x18b')]=function(_0x1e8d5d){logger['info'](util[_0x1c4e('0x26')](_0x1c4e('0x18c'),_0x1e8d5d[_0x1c4e('0x36')]));if(!this['isConfigured'](_0x1e8d5d[_0x1c4e('0x58')])){return this[_0x1c4e('0x37')][_0x1c4e('0x95')]('no\x20apiKey\x20configured');}if(!this[_0x1c4e('0x82')](_0x1e8d5d[_0x1c4e('0x59')])){return this['channel'][_0x1c4e('0x95')]('no\x20text\x20configured');}this[_0x1c4e('0x37')][_0x1c4e('0x95')](util[_0x1c4e('0x26')](_0x1c4e('0x18d'),_0x1e8d5d[_0x1c4e('0x59')]));var _0x1715cb=this[_0x1c4e('0x57')][_0x1c4e('0x84')](this,_0x1e8d5d);if(_0x1715cb){this[_0x1c4e('0x37')]['noop'](util[_0x1c4e('0x26')]('Google\x20Cloud\x20TTS\x20%s\x20file\x20created',_0x1715cb));var _0x1a6a84=this[_0x1c4e('0x37')][_0x1c4e('0xda')](_0x1715cb);try{fs[_0x1c4e('0xdb')](_0x1715cb+_0x1c4e('0xdc'));}catch(_0x5792e2){logger[_0x1c4e('0x2a')](_0x5792e2);}return _0x1a6a84;}return this[_0x1c4e('0x37')]['error'](_0x1e8d5d,_0x1c4e('0x18e'));};AGIVertices[_0x1c4e('0xc')][_0x1c4e('0x18f')]=function(_0x550466){logger[_0x1c4e('0x2c')](util[_0x1c4e('0x26')]('Enter\x20in\x20GOOGLETTS\x20(%s)\x20block',_0x550466[_0x1c4e('0x36')]));if(!this['isConfigured'](_0x550466[_0x1c4e('0x59')])){return this[_0x1c4e('0x37')]['noop'](_0x1c4e('0x99'));}this['channel'][_0x1c4e('0x95')](util[_0x1c4e('0x26')](_0x1c4e('0x190'),_0x550466[_0x1c4e('0x59')]));var _0x58b58f=this[_0x1c4e('0x5f')][_0x1c4e('0x84')](this,_0x550466);if(_0x58b58f){this[_0x1c4e('0x37')][_0x1c4e('0x95')](util[_0x1c4e('0x26')]('Google\x20TTS\x20%s\x20file\x20created',_0x58b58f));var _0x3b7e95=this[_0x1c4e('0x37')][_0x1c4e('0xda')](_0x58b58f);try{fs[_0x1c4e('0xdb')](_0x58b58f+'.wav');}catch(_0x1abf15){logger[_0x1c4e('0x2a')](_0x1abf15);}return _0x3b7e95;}return this[_0x1c4e('0x37')][_0x1c4e('0x2a')](_0x550466,'Google\x20TTS\x20is\x20unreachable');};AGIVertices[_0x1c4e('0xc')][_0x1c4e('0x191')]=function(_0x1a47e8){logger['info'](util['format'](_0x1c4e('0x192'),_0x1a47e8[_0x1c4e('0x36')]));if(!this[_0x1c4e('0x82')](_0x1a47e8[_0x1c4e('0x12d')])){return this['channel'][_0x1c4e('0x2a')](_0x1a47e8,_0x1c4e('0x133'));}logger[_0x1c4e('0x2c')](util['format'](_0x1c4e('0x12e'),this['channel'][_0x1c4e('0x39')],_0x1a47e8[_0x1c4e('0x12d')]));var _0x252767=this[_0x1c4e('0x50')][_0x1c4e('0x84')](this,_0x1a47e8[_0x1c4e('0x12d')]);if(_0x252767){logger[_0x1c4e('0x2c')](util['format']('AGENT\x20%s\x20FOUND\x20BY',this[_0x1c4e('0x37')][_0x1c4e('0x39')],_0x1a47e8[_0x1c4e('0x12d')]));this[_0x1c4e('0x37')]['noop'](util['format']('AGENT\x20%s\x20FOUND\x20BY',this['channel'][_0x1c4e('0x39')],_0x1a47e8[_0x1c4e('0x12d')]));return{'code':0xc8,'result':_0x1c4e('0x12f')};}else{logger[_0x1c4e('0x2c')](util[_0x1c4e('0x26')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x1c4e('0x37')][_0x1c4e('0x39')],_0x1a47e8['findBy']));this['channel']['noop'](util['format']('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this['channel'][_0x1c4e('0x39')],_0x1a47e8['findBy']));return{'code':0xc8,'result':_0x1c4e('0x131')};}};AGIVertices[_0x1c4e('0xc')]['voicemail']=function(_0x2f054f){logger[_0x1c4e('0x2c')](util[_0x1c4e('0x26')](_0x1c4e('0x193'),_0x2f054f['label']));var _0x96e8d0=this[_0x1c4e('0x37')]['exec'](_0x1c4e('0x194'),[_0x2f054f['mailbox'],_0x2f054f[_0x1c4e('0x94')]]);if(_0x96e8d0['result']===-0x1){return _0x96e8d0;}return this[_0x1c4e('0x37')]['noop'](util[_0x1c4e('0x26')](_0x1c4e('0x96'),_0x1c4e('0x194'),_0x2f054f['mailbox']));};AGIVertices[_0x1c4e('0xc')][_0x1c4e('0x195')]=function(_0x22c4df){logger['info'](util[_0x1c4e('0x26')](_0x1c4e('0x196'),_0x22c4df[_0x1c4e('0x36')]));if(!this[_0x1c4e('0x82')](_0x22c4df['variable_id'])){return this[_0x1c4e('0x37')]['error'](_0x22c4df,_0x1c4e('0x17a'));}var _0x285801=this['getVariable']['sync'](this,_0x22c4df[_0x1c4e('0xb3')]);if(!_0x285801){return this[_0x1c4e('0x37')]['error'](_0x22c4df,_0x1c4e('0xb5'));}var _0x44b89f=this[_0x1c4e('0x37')][_0x1c4e('0x7d')](_0x285801);return{'code':0xc8,'result':_0x44b89f['extra']?_0x44b89f['extra']:'-'};};String[_0x1c4e('0xc')][_0x1c4e('0x197')]=function(_0xf4765c,_0x508049){return this[_0x1c4e('0x7b')](_0xf4765c)[_0x1c4e('0x198')](_0x508049);};module[_0x1c4e('0x199')]=AGIVertices; \ No newline at end of file +var _0xb8c1=['Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appid\x20configured','no\x20appsecret\x20configured','tilde\x20%s\x20file\x20created','TildeASR\x20Result\x20%s','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','continueAt','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','no\x20condition\x20configured','true','gotoiftime','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','no\x20interval\x20configured','no\x20intervals\x20found','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','false','hangup','ispeechasr','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','beep','ispeech\x20%s\x20file\x20created','ISPEECH_ASR_%s','IspeechASR\x20Result\x20%s','ispeechtts','Trying\x20ispeech\x20TTS\x20%s','ispeech\x20TTS\x20is\x20unreachable','Enter\x20in\x20LOGIN\x20(%s)\x20block','findBy','FIND\x20AGENT\x20%s\x20BY\x20%s','AGENT\x20%s\x20FOUND\x20BY','AGENT\x20%s\x20NOT\x20FOUND\x20BY','logout','Enter\x20in\x20LOGOUT\x20(%s)\x20block','no\x20find\x20by\x20configured','success','failure','Enter\x20in\x20MATH\x20(%s)\x20block','operation','%s[%s]','variable\x20%s[key]\x20set','Enter\x20in\x20MENU\x20(%s)\x20block','getData','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','output','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','pause_id','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','no\x20file\x20audio\x20found','PLAYBACK','queue','no\x20queue\x20selected','queue_id','getVoiceQueue','no\x20queue\x20found','indexOf','XMCS-QUEUE','toLowerCase','QUEUE','gosub','position','recordingFormat','%s_%s','%s/recordings/%s.%s','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','digits','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','number','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sendMail','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','no\x20mail\x20account\x20configured','account_id','Smtp','no\x20mail\x20account\x20found','\x22%s\x22\x20<%s>','user','bcc','subject','service','host','port','secure','authentication','auth','pass','template_id','sendMail\x20message','Trying\x20SendMail\x20with\x20account\x20%s','Mail\x20message\x20added\x20to\x20outgoing\x20process','Enter\x20in\x20SENDFAX\x20(%s)\x20block','Enter\x20in\x20SENDSMS\x20(%s)\x20block','no\x20sms\x20account\x20configured','sms_account_id','no\x20sms\x20account\x20found','sms_text','Trying\x20SendSMS\x20with\x20account\x20%s','Sms\x20message\x20added\x20to\x20outgoing\x20process','set','Enter\x20in\x20SET\x20(%s)\x20block','no\x20variable\x20selected','variable_value','start','START\x20CALLY\x20SQUARE','yes','Answer','Skipped\x20Answer','project_id','no\x20subproject\x20selected','no\x20subproject\x20found\x20with\x20id\x20%d','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','AGI','agi://%s/square,\x22%s\x22,\x22%s\x22','system','Enter\x20in\x20SYSTEM\x20(%s)\x20block','shellCommand','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','sh\x20command:\x20%s\x20result\x20no\x20stored','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','Google\x20Cloud\x20TTS\x20is\x20unreachable','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Trying\x20Google\x20TTS\x20%s','googleTTS','Google\x20TTS\x20%s\x20file\x20created','Google\x20TTS\x20is\x20unreachable','unpause','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','voicemail','VOICEMAIL','mailbox','vswitch','join','util','lodash','shelljs','odbc','randomstring','moment','../../config/environment','./scripts','/var/opt/motion2/server/files','menu','getdigits','getsecretdigits','channel','rpc','prototype','getVariable','getVariableById','then','catch','getSquareProject','getSquareProjectById','name','getSquareOdbcById','dsn','getUser','getUserById','getTrunk','getSound','getMailAccount','sendMailMessage','mailRpc','getIntervals','getIntervalById','IntervalId','interval','Intervals','getSoundPath','format','%s/sounds/converted/%s','error','info','ODBC\x20connection\x20successfully','Error\x20executing\x20query\x20%s','Query\x20executed\x20correctly\x20%s','close','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','createSmsMessage','createSquareDetailsReport','uniqueid','label','arg_1','callerid','createSquareRecording','context','extension','priority','accountcode','dnid','file','createSquareMessage','createCmContact','isNil','callback_','isEmpty','lastName','phone','list_id','scheduledAt','callback','Callback\x20scheduled\x20at\x20','callback_priority','getPauseById','agentUnpause','agent','agentLogout','agentLogin','internal','%s/%s@from-sip/n','exec','replace','googleCloudTTS','apiKey','google_cloud_tts_text_type','text','languageCode','en-US','ssmlGender','MALE','audioEncoding','MP3','google_tts_language','key','dialogflow_language','sestekNDA','ispeechTTS','ispeech_tts_language','isConfigured','model','aws_access_key_id','aws_secret_access_key','aws_polly_voice','Amy','awsLex','aws_bot_name','tildeASR','appid','appsecret','uri','clear','includes','agicommand','clone','hasOwnProperty','replaceAllVariables','length','split','replaceAll','extra','toString','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','setVariable','maxRetry','sync','retry','agi','command','args','Wait\x20%s\x20seconds\x20before\x20answer','timeout','wait','answer','Enter\x20in\x20CALLBACK\x20(%s)\x20block','no\x20list\x20selected','add','delay','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','custom_app','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','options','noop','Executed\x20command\x20%s\x20%s','application','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','MRCPSynth','Executed\x20command\x20MRCPSynth\x20%s','sestektts','lumenvoxasr','grammar','no\x20grammar\x20configured','MRCPRecog','result','LUMENVOX_ASR_CONFIDENCE','getAndSetVariable','LUMENVOX_ASR_TRANSCRIPT','RECOG_INSTANCE()','Executed\x20command\x20MRCPRecog\x20%s','sestekasr','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','RECOG_CONFIDENCE()','SESTEK_ASR_CONFIDENCE','RECOG_INPUT()','SESTEK_ASR_INSTANCE','odbc_id','no\x20database\x20selected','query','query:\x20%s','no\x20variable\x20selected\x20for\x20the\x20result','variable_id','no\x20variable\x20found','keys','forEach','%s_ROWS_COUNT','dial','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','no\x20user\x20selected','sip_id','no\x20user\x20found','DIAL','SIP/%s','opts','Executed\x20command\x20%s','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','no\x20key\x20configured','no\x20text\x20configured','Trying\x20Dialogflow:\x20%s','googleDialogflow','DIALOGFLOW_%s','speech','out','Dialogflow\x20Result\x20%s','ndauth_url','no\x20ndauth\x20url\x20configured','username','password','no\x20password\x20configured','ndassistant_url','bot','Trying\x20SestekNDA:\x20%s','SESTEK_NDA_%s','toUpperCase','audiofile','streamFile','unlink','SestekNDA\x20Result\x20%s','SestekNDA\x20is\x20unreachable','end','Enter\x20in\x20END\x20(%s)\x20block','ext_dial','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20selected','trunk_name','SIP/%s/%s','url','finally','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','file_id','no\x20file\x20audio\x20selected','response','maxdigit','test','stringify','hiddendigitsnum','generate','first','substr','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','GOAL\x20%s','awspolly','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','Trying\x20aws\x20Polly\x20%s','awsPolly','aws\x20Polly\x20%s\x20file\x20created','.wav','aws\x20Polly\x20is\x20unreachable','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','Trying\x20Amazon\x20Lex:\x20%s','AWS_LEX_%s','message','Amazon\x20Lex\x20ready\x20for\x20fulfillment','Amazon\x20Lex\x20Result\x20%s','googleasr','wav','%s/recordings/%s','%s.%s','NOBEEP','recordFile','intKey','google\x20%s\x20file\x20created','googleASR','GoogleASR\x20Result\x20%s'];(function(_0x1344ad,_0x1c2ee){var _0x4240a9=function(_0x5b0ee2){while(--_0x5b0ee2){_0x1344ad['push'](_0x1344ad['shift']());}};_0x4240a9(++_0x1c2ee);}(_0xb8c1,0x91));var _0x1b8c=function(_0x17f253,_0x1fec45){_0x17f253=_0x17f253-0x0;var _0x46cddc=_0xb8c1[_0x17f253];return _0x46cddc;};'use strict';var fs=require('fs');var path=require('path');var util=require(_0x1b8c('0x0'));var _=require(_0x1b8c('0x1'));var sh=require(_0x1b8c('0x2'));var odbc=require(_0x1b8c('0x3'))();var rs=require(_0x1b8c('0x4'));var moment=require(_0x1b8c('0x5'));var Mustache=require('mustache');var logger=require('../../config/logger')('agi');var config=require(_0x1b8c('0x6'));var scripts=require(_0x1b8c('0x7'));var FILES_PATH=_0x1b8c('0x8');var verticesWithRetry=[_0x1b8c('0x9'),_0x1b8c('0xa'),_0x1b8c('0xb')];var AGIVertices=function(_0x23191c,_0xd96ed1,_0x4e0510){this[_0x1b8c('0xc')]=_0x23191c;this[_0x1b8c('0xd')]=_0xd96ed1;this['mailRpc']=_0x4e0510;};AGIVertices[_0x1b8c('0xe')][_0x1b8c('0xf')]=function(_0xab5191,_0x2388cc){this[_0x1b8c('0xd')][_0x1b8c('0x10')](_0xab5191)[_0x1b8c('0x11')](function(_0xf297e7){_0x2388cc(null,_0xf297e7?_0xf297e7['name']:![]);})[_0x1b8c('0x12')](function(_0x522ef8){_0x2388cc(_0x522ef8);});};AGIVertices[_0x1b8c('0xe')]['getVoiceQueue']=function(_0x3aeeae,_0x9e9efb){this[_0x1b8c('0xd')]['getVoiceQueueById'](_0x3aeeae)[_0x1b8c('0x11')](function(_0x401dbe){_0x9e9efb(null,_0x401dbe?_0x401dbe['name']:![]);})['catch'](function(_0x1e7342){_0x9e9efb(_0x1e7342);});};AGIVertices[_0x1b8c('0xe')][_0x1b8c('0x13')]=function(_0x21b364,_0x3c1156){this[_0x1b8c('0xd')][_0x1b8c('0x14')](_0x21b364)[_0x1b8c('0x11')](function(_0x14e3c9){_0x3c1156(null,_0x14e3c9?_0x14e3c9[_0x1b8c('0x15')]:![]);})[_0x1b8c('0x12')](function(_0x1088db){_0x3c1156(_0x1088db);});};AGIVertices[_0x1b8c('0xe')]['getSquareOdbc']=function(_0x37ec80,_0x4ee957){this[_0x1b8c('0xd')][_0x1b8c('0x16')](_0x37ec80)[_0x1b8c('0x11')](function(_0x51d02b){_0x4ee957(null,_0x51d02b?_0x51d02b[_0x1b8c('0x17')]:![]);})[_0x1b8c('0x12')](function(_0x2e99ce){_0x4ee957(_0x2e99ce);});};AGIVertices[_0x1b8c('0xe')][_0x1b8c('0x18')]=function(_0x423840,_0x3e0c32){this['rpc'][_0x1b8c('0x19')](_0x423840)[_0x1b8c('0x11')](function(_0x310780){_0x3e0c32(null,_0x310780?_0x310780[_0x1b8c('0x15')]:![]);})[_0x1b8c('0x12')](function(_0x4a3124){_0x3e0c32(_0x4a3124);});};AGIVertices[_0x1b8c('0xe')][_0x1b8c('0x1a')]=function(_0x15ad27,_0x1b62b6){this[_0x1b8c('0xd')]['getTrunkById'](_0x15ad27)[_0x1b8c('0x11')](function(_0x55bb50){_0x1b62b6(null,_0x55bb50?_0x55bb50[_0x1b8c('0x15')]:![]);})[_0x1b8c('0x12')](function(_0x34cf0b){_0x1b62b6(_0x34cf0b);});};AGIVertices[_0x1b8c('0xe')][_0x1b8c('0x1b')]=function(_0x460208,_0x3a84cb){var _0x541877=this;this['rpc']['getSoundById'](_0x460208)['then'](function(_0x8c8eb0){_0x3a84cb(null,_0x8c8eb0?_0x541877['getSoundPath'](_0x8c8eb0['save_name']):![]);})[_0x1b8c('0x12')](function(_0x3976e8){_0x3a84cb(_0x3976e8);});};AGIVertices['prototype'][_0x1b8c('0x1c')]=function(_0x5cdbfa,_0x35c67d){this[_0x1b8c('0xd')]['getMailAccountById'](_0x5cdbfa)[_0x1b8c('0x11')](function(_0x9061f6){_0x35c67d(null,_0x9061f6?_0x9061f6:![]);})[_0x1b8c('0x12')](function(_0x3c945e){_0x35c67d(_0x3c945e);});};AGIVertices[_0x1b8c('0xe')][_0x1b8c('0x1d')]=function(_0x42f520,_0x1cd705,_0x2d7b1a){this[_0x1b8c('0x1e')]['sendMailMessage'](_0x42f520,_0x1cd705)[_0x1b8c('0x11')](function(){_0x2d7b1a(null);})[_0x1b8c('0x12')](function(_0x27561a){_0x2d7b1a(_0x27561a);});};AGIVertices['prototype'][_0x1b8c('0x1f')]=function(_0x4341e9,_0x1b3239){this[_0x1b8c('0xd')][_0x1b8c('0x20')](_0x4341e9)[_0x1b8c('0x11')](function(_0x42265a){if(_0x42265a){if(_0x42265a[_0x1b8c('0x21')]){_0x1b3239(null,[_0x42265a[_0x1b8c('0x22')]]);}else{_0x1b3239(null,_['map'](_0x42265a[_0x1b8c('0x23')],_0x1b8c('0x22')));}}else{_0x1b3239(null,![]);}})[_0x1b8c('0x12')](function(_0x113c97){_0x1b3239(_0x113c97);});};AGIVertices['prototype'][_0x1b8c('0x24')]=function(_0x56a27c){return util[_0x1b8c('0x25')](_0x1b8c('0x26'),FILES_PATH,_0x56a27c);};AGIVertices[_0x1b8c('0xe')]['getQueryOdbc']=function(_0x392bae,_0x4af61a,_0x465428){odbc['open'](_0x392bae,function(_0x55f59c){if(_0x55f59c){logger[_0x1b8c('0x27')]('Error\x20getting\x20ODBC\x20connection\x20%s',_0x55f59c);_0x465428(_0x55f59c);}else{logger[_0x1b8c('0x28')](_0x1b8c('0x29'));odbc['query'](_0x4af61a,function(_0x296e04,_0x154dbb){if(_0x296e04){logger['info'](_0x1b8c('0x2a'),_0x4af61a);_0x465428(_0x296e04);}else{logger['info'](_0x1b8c('0x2b'),_0x4af61a);odbc[_0x1b8c('0x2c')](function(_0x848a8b){if(_0x848a8b){logger[_0x1b8c('0x27')](_0x1b8c('0x2d'),_0x848a8b);}_0x465428(null,_0x154dbb);});}});}});};AGIVertices['prototype'][_0x1b8c('0x2e')]=function(_0x3f341f,_0x50503a){this[_0x1b8c('0xd')]['getSmsAccountById'](_0x3f341f)['then'](function(_0x18eae5){_0x50503a(null,_0x18eae5?_0x18eae5:![]);})[_0x1b8c('0x12')](function(_0xd94e78){_0x50503a(_0xd94e78);});};AGIVertices[_0x1b8c('0xe')][_0x1b8c('0x2f')]=function(_0xc2f40e,_0x4153df){this[_0x1b8c('0xd')][_0x1b8c('0x2f')](_0xc2f40e)[_0x1b8c('0x11')](function(_0x5048a5){_0x4153df(null,_0x5048a5);})[_0x1b8c('0x12')](function(_0x1c7a73){_0x4153df(_0x1c7a73);});};AGIVertices[_0x1b8c('0xe')][_0x1b8c('0x30')]=function(_0x5ef801,_0x4d8e48,_0x54daea){this[_0x1b8c('0xd')][_0x1b8c('0x30')]({'uniqueid':this[_0x1b8c('0xc')][_0x1b8c('0x31')],'node':_0x5ef801[_0x1b8c('0x32')],'application':_0x5ef801['agicommand'],'data':_0x4d8e48||null,'project_name':this[_0x1b8c('0xc')][_0x1b8c('0x33')],'callerid':this['channel'][_0x1b8c('0x34')]})[_0x1b8c('0x11')](function(_0x541103){if(_0x54daea){_0x54daea(null,_0x541103);}})[_0x1b8c('0x12')](function(_0x88d603){if(_0x54daea){_0x54daea(_0x88d603);}});};AGIVertices[_0x1b8c('0xe')]['createSquareRecording']=function(_0x1fca5a,_0x3ba7b1,_0x244f28,_0x373108){this[_0x1b8c('0xd')][_0x1b8c('0x35')]({'uniqueid':this[_0x1b8c('0xc')][_0x1b8c('0x31')],'callerid':this[_0x1b8c('0xc')][_0x1b8c('0x34')],'calleridname':this[_0x1b8c('0xc')]['calleridname'],'context':this['channel'][_0x1b8c('0x36')],'extension':this[_0x1b8c('0xc')][_0x1b8c('0x37')],'priority':this['channel'][_0x1b8c('0x38')],'accountcode':this[_0x1b8c('0xc')][_0x1b8c('0x39')],'dnid':this[_0x1b8c('0xc')][_0x1b8c('0x3a')],'projectName':this[_0x1b8c('0xc')][_0x1b8c('0x33')],'saveName':_0x3ba7b1,'filename':_0x1fca5a[_0x1b8c('0x3b')]||_0x3ba7b1,'savePath':_0x244f28})[_0x1b8c('0x11')](function(_0x785750){_0x373108(null,_0x785750);})[_0x1b8c('0x12')](function(_0x549e88){_0x373108(_0x549e88);});};AGIVertices[_0x1b8c('0xe')][_0x1b8c('0x3c')]=function(_0x586048,_0x3cb911,_0x19a182){this[_0x1b8c('0xd')]['createSquareMessage']({'uniqueid':this[_0x1b8c('0xc')][_0x1b8c('0x31')],'body':_0x586048,'direction':_0x3cb911})[_0x1b8c('0x11')](function(_0x3f0c5f){if(_0x19a182){_0x19a182(null,_0x3f0c5f);}})[_0x1b8c('0x12')](function(_0x498235){if(_0x19a182){_0x19a182(_0x498235);}});};AGIVertices[_0x1b8c('0xe')]['createCmContact']=function(_0x167e34,_0xc755aa){this[_0x1b8c('0xd')][_0x1b8c('0x3d')]({'firstName':_['isEmpty'](_0x167e34['name'])||_[_0x1b8c('0x3e')](_0x167e34[_0x1b8c('0x15')])?_0x1b8c('0x3f')+Math['random']():_0x167e34[_0x1b8c('0x15')],'lastName':_[_0x1b8c('0x40')](_0x167e34[_0x1b8c('0x41')])||_[_0x1b8c('0x3e')](_0x167e34['lastName'])?null:_0x167e34[_0x1b8c('0x41')],'phone':_0x167e34[_0x1b8c('0x42')],'ListId':_0x167e34[_0x1b8c('0x43')],'scheduledAt':_0x167e34[_0x1b8c('0x44')],'callbackUniqueid':this[_0x1b8c('0xc')][_0x1b8c('0x31')],'tags':_0x1b8c('0x45'),'description':_0x1b8c('0x46')+_0x167e34['scheduledAt']['toString'](),'priority':_0x167e34[_0x1b8c('0x47')]})['then'](function(_0x26cb72){_0xc755aa(null,_0x26cb72);})['catch'](function(_0x4f288a){_0xc755aa(_0x4f288a);});};AGIVertices[_0x1b8c('0xe')]['getPause']=function(_0x153995,_0x295058){this[_0x1b8c('0xd')][_0x1b8c('0x48')](_0x153995)[_0x1b8c('0x11')](function(_0x1a9af8){_0x295058(null,_0x1a9af8?_0x1a9af8[_0x1b8c('0x15')]:![]);})['catch'](function(_0x169b01){_0x295058(_0x169b01);});};AGIVertices[_0x1b8c('0xe')]['agentPause']=function(_0x29ba9d,_0x248a3e,_0x1422c1){var _0x402276={'role':'agent'};_0x402276[_0x29ba9d]=this['channel']['callerid'];this['rpc']['agentPause'](_0x402276,_0x248a3e,this['channel'][_0x1b8c('0x31')])['then'](function(_0x1fa649){_0x1422c1(null,_[_0x1b8c('0x3e')](_0x1fa649)?![]:!![]);})[_0x1b8c('0x12')](function(_0x257621){logger[_0x1b8c('0x27')](_0x257621);_0x1422c1(null,![]);});};AGIVertices[_0x1b8c('0xe')][_0x1b8c('0x49')]=function(_0x26ec1f,_0x54aef6){var _0x59721e={'role':_0x1b8c('0x4a')};_0x59721e[_0x26ec1f]=this[_0x1b8c('0xc')][_0x1b8c('0x34')];this['rpc'][_0x1b8c('0x49')](_0x59721e)['then'](function(_0x2e3421){_0x54aef6(null,_[_0x1b8c('0x3e')](_0x2e3421)?![]:!![]);})['catch'](function(_0x412491){logger[_0x1b8c('0x27')](_0x412491);_0x54aef6(null,![]);});};AGIVertices[_0x1b8c('0xe')][_0x1b8c('0x4b')]=function(_0x4c52f7,_0x10184f){var _0x6f7ca7={'role':_0x1b8c('0x4a')};_0x6f7ca7[_0x4c52f7]=this['channel']['callerid'];this[_0x1b8c('0xd')][_0x1b8c('0x4b')](_0x6f7ca7)[_0x1b8c('0x11')](function(_0x264b9a){_0x10184f(null,_['isNil'](_0x264b9a)?![]:!![]);})['catch'](function(_0x249779){logger[_0x1b8c('0x27')](_0x249779);_0x10184f(null,![]);});};AGIVertices[_0x1b8c('0xe')][_0x1b8c('0x4c')]=function(_0x141a9d,_0x20e182){var _0x2d3c4e={'role':_0x1b8c('0x4a')};_0x2d3c4e[_0x141a9d]=this[_0x1b8c('0xc')]['callerid'];var _0x313b95=_0x141a9d!=_0x1b8c('0x4d')?util[_0x1b8c('0x25')](_0x1b8c('0x4e'),'LOCAL',this['channel'][_0x1b8c('0x34')]):undefined;this[_0x1b8c('0xd')][_0x1b8c('0x4c')](_0x2d3c4e,_0x313b95)[_0x1b8c('0x11')](function(_0x52dc90){_0x20e182(null,_[_0x1b8c('0x3e')](_0x52dc90)?![]:!![]);})[_0x1b8c('0x12')](function(_0x55319f){logger[_0x1b8c('0x27')](_0x55319f);_0x20e182(null,![]);});};AGIVertices[_0x1b8c('0xe')]['shellCommand']=function(_0x39e69b,_0xe1a9d8){sh[_0x1b8c('0x4f')](_['trim'](_0x39e69b),function(_0x3c873e,_0x4f7d19){var _0x58dcb5=_0x4f7d19[_0x1b8c('0x50')](/(\r\n|\n|\r)/gm,'');_0xe1a9d8(null,_0x58dcb5);});};AGIVertices['prototype'][_0x1b8c('0x51')]=function(_0xb6a166,_0x8a2738){scripts[_0x1b8c('0x51')](_0xb6a166[_0x1b8c('0x52')],_0xb6a166[_0x1b8c('0x53')]||_0x1b8c('0x54'),_0xb6a166['text'],_0xb6a166[_0x1b8c('0x55')]||_0x1b8c('0x56'),_0xb6a166[_0x1b8c('0x57')]||_0x1b8c('0x58'),_0xb6a166[_0x1b8c('0x59')]||_0x1b8c('0x5a'))[_0x1b8c('0x11')](function(_0x4581d9){_0x8a2738(null,_0x4581d9);})['catch'](function(_0x1570bb){_0x8a2738(_0x1570bb);});};AGIVertices[_0x1b8c('0xe')]['googleTTS']=function(_0x3d2f21,_0x327667){scripts['googleTTS'](_0x3d2f21[_0x1b8c('0x54')],_0x3d2f21[_0x1b8c('0x5b')]||'en',0x1)[_0x1b8c('0x11')](function(_0x4dd954){_0x327667(null,_0x4dd954);})[_0x1b8c('0x12')](function(_0x350fd3){_0x327667(_0x350fd3);});};AGIVertices[_0x1b8c('0xe')]['googleDialogflow']=function(_0x240a5e,_0x589e65){scripts['googleDialogflow'](this[_0x1b8c('0xc')]['uniqueid'],_0x240a5e[_0x1b8c('0x5c')],_0x240a5e['text'],_0x240a5e[_0x1b8c('0x5d')]||'en')[_0x1b8c('0x11')](function(_0x5c2141){_0x589e65(null,_0x5c2141);})['catch'](function(_0x16ca60){_0x589e65(_0x16ca60);});};AGIVertices['prototype'][_0x1b8c('0x5e')]=function(_0x29dac3,_0x5b1176){scripts['sestekNDA'](this[_0x1b8c('0xc')],_0x29dac3)['then'](function(_0x493650){_0x5b1176(null,_0x493650);})[_0x1b8c('0x12')](function(_0x468fe2){_0x5b1176(_0x468fe2);});};AGIVertices['prototype'][_0x1b8c('0x5f')]=function(_0x445d9a,_0x3e1c6c){scripts[_0x1b8c('0x5f')](_0x445d9a[_0x1b8c('0x5c')],_0x445d9a[_0x1b8c('0x54')],_0x445d9a[_0x1b8c('0x60')]||_0x1b8c('0x56'),_0x445d9a['speed'])['then'](function(_0x542622){_0x3e1c6c(null,_0x542622);})['catch'](function(_0x6d8664){_0x3e1c6c(_0x6d8664);});};AGIVertices[_0x1b8c('0xe')]['ispeechASR']=function(_0x15846f,_0x36a9de,_0x3449ad){scripts['ispeechASR'](_0x36a9de,_0x15846f[_0x1b8c('0x5c')],_0x15846f['ispeech_asr_language']||_0x1b8c('0x56'),this[_0x1b8c('0x61')](_0x15846f[_0x1b8c('0x62')])?_0x15846f[_0x1b8c('0x62')]:undefined)[_0x1b8c('0x11')](function(_0x294f89){_0x3449ad(null,_0x294f89);})[_0x1b8c('0x12')](function(_0x3876de){_0x3449ad(_0x3876de);});};AGIVertices[_0x1b8c('0xe')]['awsPolly']=function(_0x34ce87,_0x3bb3f2){scripts['awsPolly'](_0x34ce87[_0x1b8c('0x63')],_0x34ce87[_0x1b8c('0x64')],_0x34ce87['aws_polly_region'],_0x34ce87[_0x1b8c('0x65')]||_0x1b8c('0x66'),_0x34ce87['text'],_0x34ce87['aws_text_type']||'text')[_0x1b8c('0x11')](function(_0x3c5346){_0x3bb3f2(null,_0x3c5346);})[_0x1b8c('0x12')](function(_0x30fbba){_0x3bb3f2(_0x30fbba);});};AGIVertices['prototype'][_0x1b8c('0x67')]=function(_0x42f0f5,_0x4fba53){scripts[_0x1b8c('0x67')](this['channel']['uniqueid'],_0x42f0f5[_0x1b8c('0x63')],_0x42f0f5[_0x1b8c('0x64')],_0x42f0f5['aws_lex_region'],_0x42f0f5[_0x1b8c('0x54')],_0x42f0f5[_0x1b8c('0x68')])[_0x1b8c('0x11')](function(_0x42bda8){_0x4fba53(null,_0x42bda8);})[_0x1b8c('0x12')](function(_0x12c801){_0x4fba53(_0x12c801);});};AGIVertices[_0x1b8c('0xe')]['googleASR']=function(_0x22c26f,_0xe40386,_0x164ecc){scripts['googleASR'](_0xe40386,_0x22c26f[_0x1b8c('0x5c')],_0x22c26f['google_asr_language']||'en-US')[_0x1b8c('0x11')](function(_0x3a0fc5){_0x164ecc(null,_0x3a0fc5);})[_0x1b8c('0x12')](function(_0x2dac7a){_0x164ecc(_0x2dac7a);});};AGIVertices['prototype'][_0x1b8c('0x69')]=function(_0x52c81c,_0x16b147,_0x1e91cc){scripts['tildeASR'](_0x16b147,_0x52c81c[_0x1b8c('0x6a')],_0x52c81c[_0x1b8c('0x6b')],_0x52c81c[_0x1b8c('0x6c')])['then'](function(_0x4118f0){_0x1e91cc(null,_0x4118f0);})[_0x1b8c('0x12')](function(_0xaa158a){_0x1e91cc(_0xaa158a);});};AGIVertices[_0x1b8c('0xe')][_0x1b8c('0x6d')]=function(_0x542071){var _0x211974=_[_0x1b8c('0x6e')](verticesWithRetry,_0x542071[_0x1b8c('0x6f')])?_0x542071:_[_0x1b8c('0x70')](_0x542071);for(var _0x3bef02 in _0x211974){if(_0x211974[_0x1b8c('0x71')](_0x3bef02)){if(_0x211974[_0x3bef02]&&_['isString'](_0x211974[_0x3bef02])){_0x211974[_0x3bef02]=this[_0x1b8c('0x72')](_0x211974[_0x3bef02]);}}}return _0x211974;};AGIVertices[_0x1b8c('0xe')][_0x1b8c('0x72')]=function(_0x4a8506){var _0x488ae0=_0x4a8506['split']('{');for(var _0x38bd41=0x1;_0x38bd41<_0x488ae0[_0x1b8c('0x73')];_0x38bd41+=0x1){var _0x31821b=_0x488ae0[_0x38bd41][_0x1b8c('0x74')]('}');if(_0x31821b[_0x1b8c('0x73')]>0x1){_0x4a8506=_0x4a8506[_0x1b8c('0x75')]('{'+_0x31821b[0x0]+'}',this[_0x1b8c('0xc')][_0x1b8c('0xf')](_0x31821b[0x0])[_0x1b8c('0x76')]||_0x31821b[0x0]);}}if(_0x488ae0[_0x1b8c('0x73')]===0x1){return _0x4a8506[_0x1b8c('0x77')]();}return this[_0x1b8c('0x72')](_0x4a8506);};AGIVertices[_0x1b8c('0xe')]['getAndSetVariable']=function(_0x44137a,_0x1f29ed){var _0x49f992=this[_0x1b8c('0xc')][_0x1b8c('0xf')](_0x44137a);if(_0x49f992['result']===-0x1){return _0x49f992;}logger[_0x1b8c('0x28')](util[_0x1b8c('0x25')](_0x1b8c('0x78'),_0x1f29ed,_0x49f992['extra']));return this['channel'][_0x1b8c('0x79')](_0x1f29ed,_0x49f992[_0x1b8c('0x76')]);};AGIVertices[_0x1b8c('0xe')][_0x1b8c('0x61')]=function(_0x30aa04){return _0x30aa04&&_0x30aa04!=='0'&&_0x30aa04!=='-1'&&_0x30aa04!=='';};AGIVertices[_0x1b8c('0xe')][_0x1b8c('0x7a')]=function(_0x272e2f){this['createSquareDetailsReport'][_0x1b8c('0x7b')](this,_0x272e2f,'-');_0x272e2f[_0x1b8c('0x7c')]=_0x272e2f[_0x1b8c('0x7a')];return{'code':0xc8,'result':'-'};};AGIVertices[_0x1b8c('0xe')][_0x1b8c('0x7d')]=function(_0x8d12a8){logger[_0x1b8c('0x28')](util[_0x1b8c('0x25')]('Enter\x20in\x20AGI\x20(%s)\x20block',_0x8d12a8[_0x1b8c('0x32')]));return this[_0x1b8c('0xc')][_0x1b8c('0x7d')]([_0x8d12a8[_0x1b8c('0x7e')],_0x8d12a8[_0x1b8c('0x7f')]]);};AGIVertices[_0x1b8c('0xe')]['answer']=function(_0x6e0173){logger[_0x1b8c('0x28')](util[_0x1b8c('0x25')]('Enter\x20in\x20ANSWER\x20(%s)\x20block',_0x6e0173['label']));if(this[_0x1b8c('0x61')](_0x6e0173['timeout'])){logger[_0x1b8c('0x28')](util[_0x1b8c('0x25')](_0x1b8c('0x80'),_0x6e0173[_0x1b8c('0x81')]));var _0x4e4b0c=this[_0x1b8c('0xc')][_0x1b8c('0x82')](_0x6e0173['timeout']);if(_0x4e4b0c['result']===-0x1){return _0x4e4b0c;}}return this[_0x1b8c('0xc')][_0x1b8c('0x83')]();};AGIVertices[_0x1b8c('0xe')][_0x1b8c('0x45')]=function(_0x470f02){logger[_0x1b8c('0x28')](util[_0x1b8c('0x25')](_0x1b8c('0x84'),_0x470f02[_0x1b8c('0x32')]));if(!this[_0x1b8c('0x61')](_0x470f02['list_id'])){return this[_0x1b8c('0xc')][_0x1b8c('0x27')](_0x470f02,_0x1b8c('0x85'));}_0x470f02['scheduledAt']=moment();if(this[_0x1b8c('0x61')](_0x470f02['delay'])){_0x470f02[_0x1b8c('0x44')]=moment()[_0x1b8c('0x86')](_0x470f02[_0x1b8c('0x87')],'minutes');}if(!this[_0x1b8c('0x61')](_0x470f02['callback_priority'])){_0x470f02[_0x1b8c('0x47')]=0x2;}this['createCmContact']['sync'](this,_0x470f02);return this[_0x1b8c('0xc')]['noop'](util[_0x1b8c('0x25')](_0x1b8c('0x88'),_0x470f02[_0x1b8c('0x42')],_0x470f02['list_id'],_0x470f02[_0x1b8c('0x44')]));};AGIVertices['prototype'][_0x1b8c('0x89')]=function(_0x2ec224){logger[_0x1b8c('0x28')](util['format'](_0x1b8c('0x8a'),_0x2ec224[_0x1b8c('0x32')]));var _0x4033a0=this['channel'][_0x1b8c('0x4f')](_0x2ec224['application'],_0x2ec224[_0x1b8c('0x8b')]);if(_0x4033a0['result']===-0x1){return _0x4033a0;}return this[_0x1b8c('0xc')][_0x1b8c('0x8c')](util['format'](_0x1b8c('0x8d'),_0x2ec224[_0x1b8c('0x8e')],_0x2ec224[_0x1b8c('0x8b')]));};AGIVertices[_0x1b8c('0xe')][_0x1b8c('0x8f')]=function(_0x5c329c){logger[_0x1b8c('0x28')](util[_0x1b8c('0x25')](_0x1b8c('0x90'),_0x5c329c['label']));if(!this[_0x1b8c('0x61')](_0x5c329c[_0x1b8c('0x54')])){return this[_0x1b8c('0xc')][_0x1b8c('0x8c')]('no\x20text\x20configured');}var _0x1bf98f='\x22'+_0x5c329c[_0x1b8c('0x54')]+'\x22';if(this['isConfigured'](_0x5c329c[_0x1b8c('0x8b')])){_0x1bf98f+=','+_0x5c329c[_0x1b8c('0x8b')];}var _0x233861=this[_0x1b8c('0xc')][_0x1b8c('0x4f')](_0x1b8c('0x91'),_0x1bf98f);if(_0x233861['result']===-0x1){return _0x233861;}return this[_0x1b8c('0xc')][_0x1b8c('0x8c')](util[_0x1b8c('0x25')](_0x1b8c('0x92'),_0x1bf98f));};AGIVertices['prototype'][_0x1b8c('0x93')]=function(_0xcfe48c){logger[_0x1b8c('0x28')](util['format']('Enter\x20in\x20SESTEKTTS\x20(%s)\x20block',_0xcfe48c[_0x1b8c('0x32')]));if(!this[_0x1b8c('0x61')](_0xcfe48c['text'])){return this['channel'][_0x1b8c('0x8c')]('no\x20text\x20configured');}var _0xcb8dc5='\x22'+_0xcfe48c[_0x1b8c('0x54')]+'\x22';if(this['isConfigured'](_0xcfe48c[_0x1b8c('0x8b')])){_0xcb8dc5+=','+_0xcfe48c[_0x1b8c('0x8b')];}var _0x2640a4=this['channel'][_0x1b8c('0x4f')]('MRCPSynth',_0xcb8dc5);if(_0x2640a4['result']===-0x1){return _0x2640a4;}return this[_0x1b8c('0xc')][_0x1b8c('0x8c')](util['format'](_0x1b8c('0x92'),_0xcb8dc5));};AGIVertices[_0x1b8c('0xe')][_0x1b8c('0x94')]=function(_0x5065be){logger[_0x1b8c('0x28')](util[_0x1b8c('0x25')]('Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block',_0x5065be[_0x1b8c('0x32')]));if(!this['isConfigured'](_0x5065be[_0x1b8c('0x95')])){return this[_0x1b8c('0xc')][_0x1b8c('0x8c')](_0x1b8c('0x96'));}var _0x354d5a=_0x5065be['grammar'];if(this[_0x1b8c('0x61')](_0x5065be[_0x1b8c('0x8b')])){_0x354d5a+=','+_0x5065be[_0x1b8c('0x8b')];}var _0x2417d7=this['channel']['exec'](_0x1b8c('0x97'),_0x354d5a);if(_0x2417d7[_0x1b8c('0x98')]===-0x1){return _0x2417d7;}var _0x30d32e=this['getAndSetVariable']('RECOG_CONFIDENCE()',_0x1b8c('0x99'));if(_0x30d32e['result']===-0x1){return _0x30d32e;}var _0x342e33=this[_0x1b8c('0x9a')]('RECOG_INPUT()',_0x1b8c('0x9b'));if(_0x342e33[_0x1b8c('0x98')]===-0x1){return _0x342e33;}var _0x302560=this[_0x1b8c('0x9a')](_0x1b8c('0x9c'),'LUMENVOX_ASR_INSTANCE');if(_0x302560[_0x1b8c('0x98')]===-0x1){return _0x302560;}return this['channel'][_0x1b8c('0x8c')](util[_0x1b8c('0x25')](_0x1b8c('0x9d'),_0x354d5a));};AGIVertices[_0x1b8c('0xe')][_0x1b8c('0x9e')]=function(_0x4db9aa){logger[_0x1b8c('0x28')](util['format'](_0x1b8c('0x9f'),_0x4db9aa['label']));if(!this[_0x1b8c('0x61')](_0x4db9aa['grammar'])){return this[_0x1b8c('0xc')]['noop']('no\x20grammar\x20configured');}var _0x38e741=_0x4db9aa[_0x1b8c('0x95')];if(this[_0x1b8c('0x61')](_0x4db9aa[_0x1b8c('0x8b')])){_0x38e741+=','+_0x4db9aa[_0x1b8c('0x8b')];}var _0x4d68a3=this['channel'][_0x1b8c('0x4f')](_0x1b8c('0x97'),_0x38e741);if(_0x4d68a3['result']===-0x1){return _0x4d68a3;}var _0xc24e46=this[_0x1b8c('0x9a')](_0x1b8c('0xa0'),_0x1b8c('0xa1'));if(_0xc24e46['result']===-0x1){return _0xc24e46;}var _0x3c4e67=this[_0x1b8c('0x9a')](_0x1b8c('0xa2'),'SESTEK_ASR_TRANSCRIPT');if(_0x3c4e67[_0x1b8c('0x98')]===-0x1){return _0x3c4e67;}var _0x3a3067=this['getAndSetVariable'](_0x1b8c('0x9c'),_0x1b8c('0xa3'));if(_0x3a3067[_0x1b8c('0x98')]===-0x1){return _0x3a3067;}return this[_0x1b8c('0xc')][_0x1b8c('0x8c')](util['format'](_0x1b8c('0x9d'),_0x38e741));};AGIVertices[_0x1b8c('0xe')]['database']=function(_0x41827f){logger[_0x1b8c('0x28')](util['format']('Enter\x20in\x20DATABASE\x20(%s)\x20block',_0x41827f[_0x1b8c('0x32')]));if(!this[_0x1b8c('0x61')](_0x41827f[_0x1b8c('0xa4')])){return this[_0x1b8c('0xc')]['error'](_0x41827f,_0x1b8c('0xa5'));}var _0x5f52b8=this['getSquareOdbc'][_0x1b8c('0x7b')](this,_0x41827f[_0x1b8c('0xa4')]);if(!_0x5f52b8){return this[_0x1b8c('0xc')]['error'](_0x41827f,'no\x20odbc\x20database\x20found');}if(!this[_0x1b8c('0x61')](_0x41827f[_0x1b8c('0xa6')])){return this[_0x1b8c('0xc')]['error'](_0x41827f,'no\x20query\x20configured');}var _0x3ed194=_0x41827f[_0x1b8c('0xa6')][_0x1b8c('0x50')](/(\r\n|\n|\r)/gm,'\x20');this['channel']['noop'](util[_0x1b8c('0x25')](_0x1b8c('0xa7'),_0x3ed194));var _0x1fec4b=this['getQueryOdbc'][_0x1b8c('0x7b')](this,_0x5f52b8,_0x3ed194);this[_0x1b8c('0x30')]['sync'](this,_0x41827f,_0x3ed194);if(!this[_0x1b8c('0x61')](_0x41827f['variable_id'])){return this['channel'][_0x1b8c('0x8c')](_0x1b8c('0xa8'));}var _0x24bdb5=this[_0x1b8c('0xf')][_0x1b8c('0x7b')](this,_0x41827f[_0x1b8c('0xa9')]);if(!_0x24bdb5){return this['channel'][_0x1b8c('0x27')](_0x41827f,_0x1b8c('0xaa'));}var _0x2cfc1a=this;_0x1fec4b['forEach'](function(_0x545b75,_0x18b516){Object[_0x1b8c('0xab')](_0x545b75)[_0x1b8c('0xac')](function(_0x16a275){_0x2cfc1a[_0x1b8c('0xc')][_0x1b8c('0x79')](util[_0x1b8c('0x25')]('%s[%s][%s]',_0x24bdb5,_0x18b516,_0x16a275),_0x545b75[_0x16a275]);});});this[_0x1b8c('0xc')][_0x1b8c('0x79')](util[_0x1b8c('0x25')](_0x1b8c('0xad'),_0x24bdb5),_0x1fec4b['length']);return this[_0x1b8c('0xc')]['noop'](util['format']('variable\x20%s\x20set',_0x24bdb5));};AGIVertices['prototype'][_0x1b8c('0xae')]=function(_0x107c25){logger[_0x1b8c('0xaf')](util[_0x1b8c('0x25')](_0x1b8c('0xb0'),_0x107c25[_0x1b8c('0x32')]));if(!this[_0x1b8c('0x61')](_0x107c25['sip_id'])){return this[_0x1b8c('0xc')]['error'](_0x107c25,_0x1b8c('0xb1'));}var _0x55e10f=this['getUser'][_0x1b8c('0x7b')](this,_0x107c25[_0x1b8c('0xb2')]);if(!_0x55e10f){return this[_0x1b8c('0xc')][_0x1b8c('0x27')](_0x107c25,_0x1b8c('0xb3'));}var _0x5ed812=this[_0x1b8c('0xc')][_0x1b8c('0x4f')](_0x1b8c('0xb4'),[util[_0x1b8c('0x25')](_0x1b8c('0xb5'),_0x55e10f),_0x107c25[_0x1b8c('0x81')],_0x107c25[_0x1b8c('0xb6')],_0x107c25['url']]);if(_0x5ed812[_0x1b8c('0x98')]===-0x1){return _0x5ed812;}return this[_0x1b8c('0xc')][_0x1b8c('0x8c')](util[_0x1b8c('0x25')](_0x1b8c('0xb7'),'DIAL'));};AGIVertices[_0x1b8c('0xe')][_0x1b8c('0xb8')]=function(_0x106a53){logger[_0x1b8c('0x28')](util[_0x1b8c('0x25')](_0x1b8c('0xb9'),_0x106a53[_0x1b8c('0x32')]));if(!this[_0x1b8c('0x61')](_0x106a53[_0x1b8c('0x5c')])){return this[_0x1b8c('0xc')][_0x1b8c('0x8c')](_0x1b8c('0xba'));}if(!this[_0x1b8c('0x61')](_0x106a53['text'])){return this[_0x1b8c('0xc')]['noop'](_0x1b8c('0xbb'));}this['channel']['bot']=!![];this[_0x1b8c('0x30')](_0x106a53);this[_0x1b8c('0x3c')](_0x106a53[_0x1b8c('0x54')],'in');this['channel'][_0x1b8c('0x8c')](util['format'](_0x1b8c('0xbc'),_0x106a53[_0x1b8c('0x54')]));var _0x5b17c1=this[_0x1b8c('0xbd')][_0x1b8c('0x7b')](this,_0x106a53);if(_0x5b17c1){for(var _0x2e0ff6 in _0x5b17c1){if(_0x5b17c1[_0x1b8c('0x71')](_0x2e0ff6)){this[_0x1b8c('0xc')][_0x1b8c('0x79')](util[_0x1b8c('0x25')](_0x1b8c('0xbe'),_0x2e0ff6['toUpperCase']()),_0x5b17c1[_0x2e0ff6]);}}this[_0x1b8c('0x3c')](_0x5b17c1[_0x1b8c('0xbf')],_0x1b8c('0xc0'));return this[_0x1b8c('0xc')][_0x1b8c('0x8c')](util[_0x1b8c('0x25')](_0x1b8c('0xc1'),_0x5b17c1[_0x1b8c('0xbf')]));}return this[_0x1b8c('0xc')][_0x1b8c('0x27')](_0x106a53,'Dialogflow\x20is\x20unreachable');};AGIVertices[_0x1b8c('0xe')]['sesteknda']=function(_0x5c3746){logger['info'](util[_0x1b8c('0x25')]('Enter\x20in\x20SESTEKNDA\x20(%s)\x20block',_0x5c3746['label']));if(!this[_0x1b8c('0x61')](_0x5c3746[_0x1b8c('0xc2')])){return this[_0x1b8c('0xc')][_0x1b8c('0x8c')](_0x1b8c('0xc3'));}if(!this[_0x1b8c('0x61')](_0x5c3746[_0x1b8c('0xc4')])){return this[_0x1b8c('0xc')][_0x1b8c('0x8c')]('no\x20username\x20configured');}if(!this[_0x1b8c('0x61')](_0x5c3746[_0x1b8c('0xc5')])){return this[_0x1b8c('0xc')]['noop'](_0x1b8c('0xc6'));}if(!this[_0x1b8c('0x61')](_0x5c3746[_0x1b8c('0xc7')])){return this[_0x1b8c('0xc')]['noop']('no\x20text\x20configured');}this[_0x1b8c('0xc')][_0x1b8c('0xc8')]=!![];this[_0x1b8c('0x30')](_0x5c3746);this[_0x1b8c('0x3c')](_0x5c3746['text'],'in');this[_0x1b8c('0xc')][_0x1b8c('0x8c')](util[_0x1b8c('0x25')](_0x1b8c('0xc9'),_0x5c3746[_0x1b8c('0x54')]));var _0x1bb03f=this['sestekNDA'][_0x1b8c('0x7b')](this,_0x5c3746);if(_0x1bb03f){for(var _0x52f2bd in _0x1bb03f){if(_0x1bb03f[_0x1b8c('0x71')](_0x52f2bd)){this[_0x1b8c('0xc')][_0x1b8c('0x79')](util[_0x1b8c('0x25')](_0x1b8c('0xca'),_0x52f2bd[_0x1b8c('0xcb')]()),_0x1bb03f[_0x52f2bd]);}}this[_0x1b8c('0x3c')](_0x1bb03f[_0x1b8c('0xbf')],_0x1b8c('0xc0'));if(_0x1bb03f[_0x1b8c('0xcc')]){this[_0x1b8c('0xc')]['noop'](util[_0x1b8c('0x25')]('Sestek\x20NDA\x20%s\x20file\x20created',_0x1bb03f['audiofile']));var _0x5ae7f4=this[_0x1b8c('0xc')][_0x1b8c('0xcd')](_0x1bb03f[_0x1b8c('0xcc')]);try{fs[_0x1b8c('0xce')](_0x1bb03f[_0x1b8c('0xcc')]+'.wav');}catch(_0x4107d3){logger['error'](_0x4107d3);}return _0x5ae7f4;}else{return this['channel'][_0x1b8c('0x8c')](util['format'](_0x1b8c('0xcf'),_0x1bb03f[_0x1b8c('0xbf')]));}}return this['channel'][_0x1b8c('0x27')](_0x5c3746,_0x1b8c('0xd0'));};AGIVertices[_0x1b8c('0xe')][_0x1b8c('0xd1')]=function(_0xb384d1){logger['info'](util[_0x1b8c('0x25')](_0x1b8c('0xd2'),_0xb384d1[_0x1b8c('0x32')]));return this[_0x1b8c('0xc')][_0x1b8c('0x8c')](_0x1b8c('0xd1'));};AGIVertices[_0x1b8c('0xe')][_0x1b8c('0xd3')]=function(_0x348cdb){logger[_0x1b8c('0x28')](util['format'](_0x1b8c('0xd4'),_0x348cdb['label']));var _0x1bdd23='';if(_0x348cdb['trunk_id']){if(!this[_0x1b8c('0x61')](_0x348cdb[_0x1b8c('0xd5')])){return this[_0x1b8c('0xc')][_0x1b8c('0x27')](_0x348cdb,_0x1b8c('0xd6'));}else{var _0x4cfb46=parseInt(_0x348cdb[_0x1b8c('0xd5')],0xa);if(isNaN(_0x4cfb46)){_0x1bdd23=_0x348cdb['trunk_id'];}else{_0x1bdd23=this['getTrunk'][_0x1b8c('0x7b')](this,_0x348cdb[_0x1b8c('0xd5')]);if(!_0x1bdd23){return this[_0x1b8c('0xc')][_0x1b8c('0x27')](_0x348cdb,'no\x20trunk\x20found');}}}}else if(_0x348cdb[_0x1b8c('0xd7')]){_0x1bdd23=_0x348cdb[_0x1b8c('0xd7')];}else{return this[_0x1b8c('0xc')][_0x1b8c('0x27')](_0x348cdb,_0x1b8c('0xd6'));}var _0x3f751b=this['channel']['exec'](_0x1b8c('0xb4'),[util[_0x1b8c('0x25')](_0x1b8c('0xd8'),_0x1bdd23,_0x348cdb[_0x1b8c('0x42')]),_0x348cdb[_0x1b8c('0x81')],_0x348cdb[_0x1b8c('0xb6')],_0x348cdb[_0x1b8c('0xd9')]]);if(_0x3f751b[_0x1b8c('0x98')]===-0x1){return _0x3f751b;}return this['channel'][_0x1b8c('0x8c')](util[_0x1b8c('0x25')](_0x1b8c('0xb7'),_0x1b8c('0xb4')));};AGIVertices[_0x1b8c('0xe')][_0x1b8c('0xda')]=function(_0x25a735){logger['info'](util[_0x1b8c('0x25')]('Enter\x20in\x20FINALLY\x20(%s)\x20block',_0x25a735[_0x1b8c('0x32')]));return this[_0x1b8c('0xc')]['noop'](_0x1b8c('0xda'));};AGIVertices[_0x1b8c('0xe')]['getdigits']=function(_0x411e93){logger[_0x1b8c('0x28')](util['format'](_0x1b8c('0xdb'),_0x411e93[_0x1b8c('0x32')]));if(_0x411e93[_0x1b8c('0x7c')]===0x0){return this['maxRetry'](_0x411e93);}_0x411e93[_0x1b8c('0x7c')]-=0x1;if(!this[_0x1b8c('0x61')](_0x411e93[_0x1b8c('0xdc')])){return this[_0x1b8c('0xc')]['error'](_0x411e93,_0x1b8c('0xdd'));}var _0x16e987=this[_0x1b8c('0x1b')]['sync'](this,_0x411e93[_0x1b8c('0xdc')]);if(!_0x16e987){return this[_0x1b8c('0xc')][_0x1b8c('0x27')](_0x411e93,'no\x20file\x20audio\x20found');}if(!this[_0x1b8c('0x61')](_0x411e93[_0x1b8c('0xa9')])){return this[_0x1b8c('0xc')][_0x1b8c('0x27')](_0x1b8c('0xa8'));}var _0x3a3fb3=this[_0x1b8c('0xc')]['getData'](_0x16e987,_0x411e93[_0x1b8c('0xde')],_0x411e93[_0x1b8c('0xdf')]);var _0x18abec=_0x3a3fb3['result']?_0x3a3fb3[_0x1b8c('0x98')][_0x1b8c('0x77')]():'';logger[_0x1b8c('0x28')](_0x1b8c('0xe0'),JSON[_0x1b8c('0xe1')](_0x3a3fb3));if(_0x3a3fb3['result']===-0x1){this['createSquareDetailsReport']['sync'](this,_0x411e93,_0x18abec);return _0x3a3fb3;}else if(_0x3a3fb3[_0x1b8c('0x76')]==='timeout'){_0x3a3fb3[_0x1b8c('0x98')]=_0x18abec[_0x1b8c('0x73')]>=parseInt(_0x411e93['mindigit'])?'x':'i';}else{_0x3a3fb3['result']=_0x18abec[_0x1b8c('0x73')]>=parseInt(_0x411e93['mindigit'])&&_0x18abec[_0x1b8c('0x73')]<=parseInt(_0x411e93['maxdigit'])?'x':'i';}var _0x2377a2=this[_0x1b8c('0xf')][_0x1b8c('0x7b')](this,_0x411e93[_0x1b8c('0xa9')]);if(!_0x2377a2){return this['channel'][_0x1b8c('0x27')](_0x411e93,_0x1b8c('0xaa'));}this[_0x1b8c('0xc')][_0x1b8c('0x79')](_0x2377a2,_0x18abec);if(this[_0x1b8c('0x61')](_0x411e93[_0x1b8c('0xe2')])){var _0x3c1afc=parseInt(_0x411e93[_0x1b8c('0xe2')],0xa);var _0x52d4fc=rs[_0x1b8c('0xe3')]({'charset':'*','length':_0x3c1afc});var _0x409879=_0x18abec[_0x1b8c('0x73')];if(_0x409879>0x0){if(_0x409879>_0x3c1afc){this['createSquareDetailsReport']['sync'](this,_0x411e93,_0x411e93['hiddendigitspos']===_0x1b8c('0xe4')?_0x52d4fc+_0x18abec[_0x1b8c('0xe5')](_0x3c1afc):_0x18abec['substr'](0x0,_0x409879-_0x3c1afc)+_0x52d4fc);}else{this['createSquareDetailsReport'][_0x1b8c('0x7b')](this,_0x411e93,rs[_0x1b8c('0xe3')]({'charset':'*','length':_0x409879}));}}else{this[_0x1b8c('0x30')][_0x1b8c('0x7b')](this,_0x411e93,'');}}else{this['createSquareDetailsReport'][_0x1b8c('0x7b')](this,_0x411e93,_0x18abec);}return _0x3a3fb3;};AGIVertices[_0x1b8c('0xe')][_0x1b8c('0xb')]=function(_0x5e1534){logger['info'](util[_0x1b8c('0x25')](_0x1b8c('0xe6'),_0x5e1534[_0x1b8c('0x32')]));return this[_0x1b8c('0xa')](_0x5e1534);};AGIVertices[_0x1b8c('0xe')][_0x1b8c('0xe7')]=function(_0xb76ed4){logger['info'](util['format'](_0x1b8c('0xe8'),_0xb76ed4[_0x1b8c('0x32')]));this[_0x1b8c('0x30')][_0x1b8c('0x7b')](this,_0xb76ed4,_0xb76ed4[_0x1b8c('0xe9')]);return this[_0x1b8c('0xc')]['noop'](util[_0x1b8c('0x25')](_0x1b8c('0xea'),_0xb76ed4[_0x1b8c('0xe9')]));};AGIVertices[_0x1b8c('0xe')][_0x1b8c('0xeb')]=function(_0x31a7d1){logger[_0x1b8c('0x28')](util[_0x1b8c('0x25')](_0x1b8c('0xec'),_0x31a7d1[_0x1b8c('0x32')]));if(!this[_0x1b8c('0x61')](_0x31a7d1['aws_access_key_id'])||!this[_0x1b8c('0x61')](_0x31a7d1[_0x1b8c('0x64')])){return this[_0x1b8c('0xc')]['noop']('no\x20valid\x20credentials\x20configured');}if(!this[_0x1b8c('0x61')](_0x31a7d1[_0x1b8c('0x54')])){return this[_0x1b8c('0xc')][_0x1b8c('0x8c')](_0x1b8c('0xbb'));}this[_0x1b8c('0xc')]['noop'](util['format'](_0x1b8c('0xed'),_0x31a7d1[_0x1b8c('0x54')]));var _0x554a7f=this[_0x1b8c('0xee')][_0x1b8c('0x7b')](this,_0x31a7d1);if(_0x554a7f){this['channel'][_0x1b8c('0x8c')](util['format'](_0x1b8c('0xef'),_0x554a7f));var _0x1d3bd6=this['channel'][_0x1b8c('0xcd')](_0x554a7f);try{fs['unlink'](_0x554a7f+_0x1b8c('0xf0'));}catch(_0xf11b8a){logger['error'](_0xf11b8a);}return _0x1d3bd6;}return this[_0x1b8c('0xc')][_0x1b8c('0x27')](_0x31a7d1,_0x1b8c('0xf1'));};AGIVertices['prototype'][_0x1b8c('0xf2')]=function(_0x4bb954){logger[_0x1b8c('0x28')](util[_0x1b8c('0x25')](_0x1b8c('0xf3'),_0x4bb954[_0x1b8c('0x32')]));if(!this[_0x1b8c('0x61')](_0x4bb954[_0x1b8c('0x63')])||!this['isConfigured'](_0x4bb954[_0x1b8c('0x64')])){return this['channel']['noop'](_0x1b8c('0xf4'));}if(!this[_0x1b8c('0x61')](_0x4bb954[_0x1b8c('0x68')])){return this['channel']['noop']('no\x20bot\x20name\x20configured');}if(!this[_0x1b8c('0x61')](_0x4bb954[_0x1b8c('0x54')])){return this['channel']['noop'](_0x1b8c('0xbb'));}this[_0x1b8c('0xc')][_0x1b8c('0xc8')]=!![];this[_0x1b8c('0x30')](_0x4bb954);this['createSquareMessage'](_0x4bb954[_0x1b8c('0x54')],'in');this['channel'][_0x1b8c('0x8c')](util[_0x1b8c('0x25')](_0x1b8c('0xf5'),_0x4bb954[_0x1b8c('0x54')]));var _0x336b64=this[_0x1b8c('0x67')][_0x1b8c('0x7b')](this,_0x4bb954);if(_0x336b64){for(var _0x3b92ec in _0x336b64){if(_0x336b64[_0x1b8c('0x71')](_0x3b92ec)&&_['isString'](_0x336b64[_0x3b92ec])){this['channel'][_0x1b8c('0x79')](util[_0x1b8c('0x25')](_0x1b8c('0xf6'),_0x3b92ec[_0x1b8c('0xcb')]()),_0x336b64[_0x3b92ec]);}}if(_['isNil'](_0x336b64[_0x1b8c('0xf7')])){return this[_0x1b8c('0xc')]['noop'](_0x1b8c('0xf8'));}else{this[_0x1b8c('0x3c')](_0x336b64[_0x1b8c('0xf7')],_0x1b8c('0xc0'));return this['channel'][_0x1b8c('0x8c')](util['format'](_0x1b8c('0xf9'),_0x336b64[_0x1b8c('0xf7')]));}}return this['channel'][_0x1b8c('0x27')](_0x4bb954,'Amazon\x20Lex\x20is\x20unreachable');};AGIVertices[_0x1b8c('0xe')][_0x1b8c('0xfa')]=function(_0x49f132){logger[_0x1b8c('0x28')](util[_0x1b8c('0x25')]('Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s',_0x49f132[_0x1b8c('0x32')],_0x49f132['timeout']));if(!this['isConfigured'](_0x49f132[_0x1b8c('0x5c')])){return this[_0x1b8c('0xc')]['noop'](_0x1b8c('0xba'));}var _0x54ab5f=_0x1b8c('0xfb');var _0x1d2c03=util[_0x1b8c('0x25')](_0x1b8c('0xfc'),FILES_PATH,rs['generate'](0x4));var _0x5c147c=util[_0x1b8c('0x25')](_0x1b8c('0xfd'),_0x1d2c03,_0x54ab5f);var _0x536efe=!![];if(_0x49f132['beep']===_0x1b8c('0xfe')){_0x536efe=![];}var _0x51cb7a=this[_0x1b8c('0xc')][_0x1b8c('0xff')](_0x1d2c03,_0x54ab5f,_0x49f132[_0x1b8c('0x100')],_0x49f132[_0x1b8c('0x81')],undefined,_0x536efe);if(_0x51cb7a[_0x1b8c('0x98')]!==-0x1){this[_0x1b8c('0xc')][_0x1b8c('0x8c')](util[_0x1b8c('0x25')](_0x1b8c('0x101'),_0x5c147c));var _0x1f17de=this[_0x1b8c('0x102')][_0x1b8c('0x7b')](this,_0x49f132,_0x5c147c);if(_0x1f17de){for(var _0x35c79b in _0x1f17de){if(_0x1f17de[_0x1b8c('0x71')](_0x35c79b)){this[_0x1b8c('0xc')][_0x1b8c('0x79')](util['format']('GOOGLE_ASR_%s',_0x35c79b[_0x1b8c('0xcb')]()),_0x1f17de[_0x35c79b]);}}return this[_0x1b8c('0xc')][_0x1b8c('0x8c')](util[_0x1b8c('0x25')](_0x1b8c('0x103'),JSON[_0x1b8c('0xe1')](_0x1f17de)));}}return _0x51cb7a;};AGIVertices['prototype']['tildeasr']=function(_0x169376){logger[_0x1b8c('0x28')](util[_0x1b8c('0x25')](_0x1b8c('0x104'),_0x169376[_0x1b8c('0x32')]));if(!this['isConfigured'](_0x169376[_0x1b8c('0x6a')])){return this[_0x1b8c('0xc')]['noop'](_0x1b8c('0x105'));}if(!this[_0x1b8c('0x61')](_0x169376[_0x1b8c('0x6b')])){return this[_0x1b8c('0xc')][_0x1b8c('0x8c')](_0x1b8c('0x106'));}var _0x13a4c8=_0x1b8c('0xfb');var _0x107346=util['format'](_0x1b8c('0xfc'),FILES_PATH,rs[_0x1b8c('0xe3')](0x4));var _0x481cee=util[_0x1b8c('0x25')](_0x1b8c('0xfd'),_0x107346,_0x13a4c8);var _0x1c504a=!![];if(_0x169376['beep']===_0x1b8c('0xfe')){_0x1c504a=![];}var _0x56e025=this['channel'][_0x1b8c('0xff')](_0x107346,_0x13a4c8,_0x169376[_0x1b8c('0x100')],_0x169376[_0x1b8c('0x81')],undefined,_0x1c504a);if(_0x56e025[_0x1b8c('0x98')]!==-0x1){this[_0x1b8c('0xc')][_0x1b8c('0x8c')](util[_0x1b8c('0x25')](_0x1b8c('0x107'),_0x481cee));var _0x3318df=this[_0x1b8c('0x69')][_0x1b8c('0x7b')](this,_0x169376,_0x481cee);if(_0x3318df){for(var _0x433a31 in _0x3318df){if(_0x3318df[_0x1b8c('0x71')](_0x433a31)){this[_0x1b8c('0xc')][_0x1b8c('0x79')](util[_0x1b8c('0x25')]('TILDE_ASR_%s',_0x433a31[_0x1b8c('0xcb')]()),_0x3318df[_0x433a31]);}}return this[_0x1b8c('0xc')]['noop'](util[_0x1b8c('0x25')](_0x1b8c('0x108'),JSON[_0x1b8c('0xe1')](_0x3318df)));}}return _0x56e025;};AGIVertices[_0x1b8c('0xe')][_0x1b8c('0x109')]=function(_0x2c513b){logger[_0x1b8c('0x28')](util[_0x1b8c('0x25')](_0x1b8c('0x10a'),_0x2c513b[_0x1b8c('0x32')]));return this[_0x1b8c('0xc')][_0x1b8c('0x10b')](_0x2c513b['context'],_0x2c513b['extension'],_0x2c513b[_0x1b8c('0x38')]);};AGIVertices[_0x1b8c('0xe')][_0x1b8c('0x10c')]=function(_0xa74ddf){logger[_0x1b8c('0x28')](util[_0x1b8c('0x25')](_0x1b8c('0x10d'),_0xa74ddf[_0x1b8c('0x32')]));if(!this[_0x1b8c('0x61')](_0xa74ddf[_0x1b8c('0x10e')])){return this[_0x1b8c('0xc')][_0x1b8c('0x27')](_0xa74ddf,_0x1b8c('0x10f'));}try{var _0x3eb5d8=eval(_0xa74ddf[_0x1b8c('0x10e')])?_0x1b8c('0x110'):'false';this[_0x1b8c('0xc')]['noop'](util[_0x1b8c('0x25')]('EVAL\x20CONDITION\x20%s\x20%s',_0xa74ddf[_0x1b8c('0x10e')],_0x3eb5d8));return{'code':0xc8,'result':_0x3eb5d8};}catch(_0x39fdbf){return{'code':0xc8,'result':'false'};}};AGIVertices[_0x1b8c('0xe')][_0x1b8c('0x111')]=function(_0x5a60f4){logger[_0x1b8c('0x28')](util['format'](_0x1b8c('0x112'),_0x5a60f4[_0x1b8c('0x32')]));if(!this[_0x1b8c('0x61')](_0x5a60f4[_0x1b8c('0x113')])){return this['channel'][_0x1b8c('0x27')](_0x5a60f4,_0x1b8c('0x114'));}var _0x5584e0=this[_0x1b8c('0x1f')][_0x1b8c('0x7b')](this,_0x5a60f4[_0x1b8c('0x113')]);if(!_0x5584e0){return this[_0x1b8c('0xc')][_0x1b8c('0x27')](_0x5a60f4,_0x1b8c('0x115'));}for(var _0x43bfe6=0x0;_0x43bfe6<_0x5584e0['length'];_0x43bfe6+=0x1){var _0x9d8ae7=this[_0x1b8c('0xc')]['getVariable'](util['format'](_0x1b8c('0x116'),_0x5584e0[_0x43bfe6]));if(_0x9d8ae7[_0x1b8c('0x98')]===-0x1){return _0x9d8ae7;}logger['info'](util[_0x1b8c('0x25')](_0x1b8c('0x117'),_0x5584e0[_0x43bfe6],_0x9d8ae7[_0x1b8c('0x76')]));if(_0x9d8ae7[_0x1b8c('0x76')]===_0x1b8c('0x110')){logger[_0x1b8c('0x28')](util[_0x1b8c('0x25')]('IFTIME\x20%s\x20%s',_0x5584e0[_0x43bfe6],'true'));this[_0x1b8c('0xc')][_0x1b8c('0x8c')](util[_0x1b8c('0x25')](_0x1b8c('0x117'),_0x5584e0[_0x43bfe6],_0x1b8c('0x110')));return{'code':0xc8,'result':'true'};}else{logger[_0x1b8c('0x28')](util['format']('IFTIME\x20%s\x20%s',_0x5584e0[_0x43bfe6],_0x1b8c('0x118')));this[_0x1b8c('0xc')][_0x1b8c('0x8c')](util[_0x1b8c('0x25')](_0x1b8c('0x117'),_0x5584e0[_0x43bfe6],_0x1b8c('0x118')));}}return{'code':0xc8,'result':'false'};};AGIVertices[_0x1b8c('0xe')][_0x1b8c('0x119')]=function(_0x210544){logger[_0x1b8c('0x28')](util[_0x1b8c('0x25')]('Enter\x20in\x20HANGUP\x20(%s)\x20block',_0x210544['label']));return this['channel'][_0x1b8c('0x119')]();};AGIVertices[_0x1b8c('0xe')][_0x1b8c('0x11a')]=function(_0x18c2c3){logger[_0x1b8c('0x28')](util[_0x1b8c('0x25')](_0x1b8c('0x11b'),_0x18c2c3[_0x1b8c('0x32')]));if(!this[_0x1b8c('0x61')](_0x18c2c3[_0x1b8c('0x5c')])){return this['channel'][_0x1b8c('0x8c')](_0x1b8c('0xba'));}var _0x5d581b=_0x1b8c('0xfb');var _0x157626=util['format'](_0x1b8c('0xfc'),FILES_PATH,rs[_0x1b8c('0xe3')](0x4));var _0x297c93=util[_0x1b8c('0x25')](_0x1b8c('0xfd'),_0x157626,_0x5d581b);var _0x6b2b90=!![];if(_0x18c2c3[_0x1b8c('0x11c')]==='NOBEEP'){_0x6b2b90=![];}var _0x1736bf=this[_0x1b8c('0xc')]['recordFile'](_0x157626,_0x5d581b,_0x18c2c3[_0x1b8c('0x100')],_0x18c2c3[_0x1b8c('0x81')],undefined,_0x6b2b90);if(_0x1736bf[_0x1b8c('0x98')]!==-0x1){this[_0x1b8c('0xc')]['noop'](util[_0x1b8c('0x25')](_0x1b8c('0x11d'),_0x297c93));var _0x4906a7=this['ispeechASR'][_0x1b8c('0x7b')](this,_0x18c2c3,_0x297c93);if(_0x4906a7){for(var _0x403bf0 in _0x4906a7){if(_0x4906a7[_0x1b8c('0x71')](_0x403bf0)){this[_0x1b8c('0xc')][_0x1b8c('0x79')](util[_0x1b8c('0x25')](_0x1b8c('0x11e'),_0x403bf0[_0x1b8c('0xcb')]()),_0x4906a7[_0x403bf0]);}}return this[_0x1b8c('0xc')]['noop'](util[_0x1b8c('0x25')](_0x1b8c('0x11f'),JSON[_0x1b8c('0xe1')](_0x4906a7)));}}return _0x1736bf;};AGIVertices[_0x1b8c('0xe')][_0x1b8c('0x120')]=function(_0x2947d9){logger[_0x1b8c('0x28')](util['format']('Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block',_0x2947d9[_0x1b8c('0x32')]));if(!this[_0x1b8c('0x61')](_0x2947d9[_0x1b8c('0x5c')])){return this[_0x1b8c('0xc')][_0x1b8c('0x8c')](_0x1b8c('0xba'));}if(!this[_0x1b8c('0x61')](_0x2947d9[_0x1b8c('0x54')])){return this[_0x1b8c('0xc')][_0x1b8c('0x8c')]('no\x20text\x20configured');}this[_0x1b8c('0xc')]['noop'](util[_0x1b8c('0x25')](_0x1b8c('0x121'),_0x2947d9[_0x1b8c('0x54')]));var _0x30c434=this[_0x1b8c('0x5f')][_0x1b8c('0x7b')](this,_0x2947d9);if(_0x30c434){this['channel'][_0x1b8c('0x8c')](util[_0x1b8c('0x25')](_0x1b8c('0x11d'),_0x30c434));var _0x1824d7=this[_0x1b8c('0xc')]['streamFile'](_0x30c434,_0x2947d9[_0x1b8c('0x100')]);try{fs[_0x1b8c('0xce')](_0x30c434+_0x1b8c('0xf0'));}catch(_0x34f275){logger[_0x1b8c('0x27')](_0x34f275);}return _0x1824d7;}return this[_0x1b8c('0xc')][_0x1b8c('0x27')](_0x2947d9,_0x1b8c('0x122'));};AGIVertices[_0x1b8c('0xe')]['login']=function(_0x5a39b3){logger[_0x1b8c('0x28')](util[_0x1b8c('0x25')](_0x1b8c('0x123'),_0x5a39b3[_0x1b8c('0x32')]));if(!this[_0x1b8c('0x61')](_0x5a39b3[_0x1b8c('0x124')])){return this['channel'][_0x1b8c('0x27')](_0x5a39b3,'no\x20find\x20by\x20configured');}logger[_0x1b8c('0x28')](util[_0x1b8c('0x25')](_0x1b8c('0x125'),this[_0x1b8c('0xc')]['callerid'],_0x5a39b3[_0x1b8c('0x124')]));var _0x1a8c93=this[_0x1b8c('0x4c')][_0x1b8c('0x7b')](this,_0x5a39b3[_0x1b8c('0x124')]);if(_0x1a8c93){logger['info'](util[_0x1b8c('0x25')](_0x1b8c('0x126'),this['channel']['callerid'],_0x5a39b3['findBy']));this['channel'][_0x1b8c('0x8c')](util['format']('AGENT\x20%s\x20FOUND\x20BY',this[_0x1b8c('0xc')][_0x1b8c('0x34')],_0x5a39b3[_0x1b8c('0x124')]));return{'code':0xc8,'result':'success'};}else{logger['info'](util[_0x1b8c('0x25')](_0x1b8c('0x127'),this[_0x1b8c('0xc')][_0x1b8c('0x34')],_0x5a39b3[_0x1b8c('0x124')]));this[_0x1b8c('0xc')][_0x1b8c('0x8c')](util['format']('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this['channel'][_0x1b8c('0x34')],_0x5a39b3['findBy']));return{'code':0xc8,'result':'failure'};}};AGIVertices['prototype'][_0x1b8c('0x128')]=function(_0x611c89){logger[_0x1b8c('0x28')](util[_0x1b8c('0x25')](_0x1b8c('0x129'),_0x611c89[_0x1b8c('0x32')]));if(!this[_0x1b8c('0x61')](_0x611c89[_0x1b8c('0x124')])){return this[_0x1b8c('0xc')][_0x1b8c('0x27')](_0x611c89,_0x1b8c('0x12a'));}logger[_0x1b8c('0x28')](util[_0x1b8c('0x25')](_0x1b8c('0x125'),this['channel'][_0x1b8c('0x34')],_0x611c89[_0x1b8c('0x124')]));var _0x1226bd=this[_0x1b8c('0x4b')][_0x1b8c('0x7b')](this,_0x611c89[_0x1b8c('0x124')]);if(_0x1226bd){logger[_0x1b8c('0x28')](util[_0x1b8c('0x25')](_0x1b8c('0x126'),this['channel'][_0x1b8c('0x34')],_0x611c89['findBy']));this[_0x1b8c('0xc')]['noop'](util[_0x1b8c('0x25')](_0x1b8c('0x126'),this[_0x1b8c('0xc')][_0x1b8c('0x34')],_0x611c89[_0x1b8c('0x124')]));return{'code':0xc8,'result':_0x1b8c('0x12b')};}else{logger[_0x1b8c('0x28')](util[_0x1b8c('0x25')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x1b8c('0xc')][_0x1b8c('0x34')],_0x611c89[_0x1b8c('0x124')]));this['channel'][_0x1b8c('0x8c')](util[_0x1b8c('0x25')](_0x1b8c('0x127'),this[_0x1b8c('0xc')][_0x1b8c('0x34')],_0x611c89[_0x1b8c('0x124')]));return{'code':0xc8,'result':_0x1b8c('0x12c')};}};AGIVertices[_0x1b8c('0xe')]['math']=function(_0xf22cdc){logger[_0x1b8c('0x28')](util[_0x1b8c('0x25')](_0x1b8c('0x12d'),_0xf22cdc[_0x1b8c('0x32')]));if(!this[_0x1b8c('0x61')](_0xf22cdc[_0x1b8c('0x12e')])){return this[_0x1b8c('0xc')][_0x1b8c('0x27')](_0xf22cdc,'no\x20operation\x20configured');}this['channel']['noop'](util['format']('math\x20%s',_0xf22cdc[_0x1b8c('0x12e')]));var _0x54df9a=eval(_0xf22cdc['operation']);if(!this[_0x1b8c('0x61')](_0xf22cdc[_0x1b8c('0xa9')])){return this[_0x1b8c('0xc')][_0x1b8c('0x8c')](_0x1b8c('0xa8'));}var _0x238d8b=this[_0x1b8c('0xf')]['sync'](this,_0xf22cdc['variable_id']);if(!_0x238d8b){return this[_0x1b8c('0xc')][_0x1b8c('0x27')](_0xf22cdc,_0x1b8c('0xaa'));}if(_['isArray'](_0x54df9a)){var _0x45f693=this;_0x54df9a[_0x1b8c('0xac')](function(_0x289aff,_0x670555){_0x45f693['channel'][_0x1b8c('0x79')](util[_0x1b8c('0x25')](_0x1b8c('0x12f'),_0x238d8b,_0x670555),_0x289aff);});return this[_0x1b8c('0xc')][_0x1b8c('0x8c')](util['format'](_0x1b8c('0x130'),_0x238d8b));}else{return this[_0x1b8c('0xc')][_0x1b8c('0x79')](_0x238d8b,_0x54df9a);}};AGIVertices[_0x1b8c('0xe')][_0x1b8c('0x9')]=function(_0x511e0b){logger[_0x1b8c('0x28')](util[_0x1b8c('0x25')](_0x1b8c('0x131'),_0x511e0b[_0x1b8c('0x32')]));if(_0x511e0b['retry']===0x0){return this[_0x1b8c('0x7a')](_0x511e0b);}_0x511e0b[_0x1b8c('0x7c')]-=0x1;if(!this['isConfigured'](_0x511e0b[_0x1b8c('0xdc')])){return this[_0x1b8c('0xc')][_0x1b8c('0x27')](_0x511e0b,'no\x20file\x20audio\x20selected');}var _0x5ea89e=this[_0x1b8c('0x1b')]['sync'](this,_0x511e0b[_0x1b8c('0xdc')]);if(!_0x5ea89e){return this[_0x1b8c('0xc')][_0x1b8c('0x27')](_0x511e0b,'no\x20file\x20audio\x20found');}var _0x54c0d2=this[_0x1b8c('0xc')][_0x1b8c('0x132')](_0x5ea89e,_0x511e0b[_0x1b8c('0xde')],_0x511e0b[_0x1b8c('0x133')]);var _0x24637c=_0x54c0d2['result'];if(_0x54c0d2[_0x1b8c('0x98')]===-0x1){this[_0x1b8c('0x30')][_0x1b8c('0x7b')](this,_0x511e0b,'-1');return _0x54c0d2;}else if(_0x54c0d2['extra']===_0x1b8c('0x81')){_0x54c0d2['result']=_0x54c0d2[_0x1b8c('0x98')][_0x1b8c('0x73')]>0x0?_0x54c0d2['result']:'t';}else if(_[_0x1b8c('0x40')](_0x54c0d2[_0x1b8c('0x98')])){_0x54c0d2['result']='#';_0x24637c='#';}if(!this[_0x1b8c('0x61')](_0x511e0b[_0x1b8c('0xa9')])){this[_0x1b8c('0xc')][_0x1b8c('0x8c')](_0x1b8c('0xa8'));}else{var _0x37976d=this[_0x1b8c('0xf')][_0x1b8c('0x7b')](this,_0x511e0b['variable_id']);if(!_0x37976d){return this['channel'][_0x1b8c('0x27')](_0x511e0b,_0x1b8c('0xaa'));}this[_0x1b8c('0xc')][_0x1b8c('0x79')](_0x37976d,_0x24637c);}this[_0x1b8c('0x30')][_0x1b8c('0x7b')](this,_0x511e0b,_0x24637c);return _0x54c0d2;};AGIVertices[_0x1b8c('0xe')][_0x1b8c('0x8c')]=function(_0x4fce34){logger[_0x1b8c('0x28')](util['format'](_0x1b8c('0x134'),_0x4fce34[_0x1b8c('0x32')]));return this[_0x1b8c('0xc')][_0x1b8c('0x8c')](_0x4fce34[_0x1b8c('0x135')]||_0x4fce34[_0x1b8c('0x32')]);};AGIVertices[_0x1b8c('0xe')][_0x1b8c('0x136')]=function(_0x4a4c43){logger[_0x1b8c('0x28')](util[_0x1b8c('0x25')](_0x1b8c('0x137'),_0x4a4c43['label']));if(!this[_0x1b8c('0x61')](_0x4a4c43[_0x1b8c('0x124')])){return this[_0x1b8c('0xc')][_0x1b8c('0x27')](_0x4a4c43,'no\x20find\x20by\x20configured');}logger[_0x1b8c('0x28')](util[_0x1b8c('0x25')](_0x1b8c('0x125'),this['channel'][_0x1b8c('0x34')],_0x4a4c43[_0x1b8c('0x124')]));var _0x11868a=this['getPause'][_0x1b8c('0x7b')](this,_0x4a4c43[_0x1b8c('0x138')]);var _0xf8cf2=this['agentPause'][_0x1b8c('0x7b')](this,_0x4a4c43['findBy'],_0x11868a);if(_0xf8cf2){logger['info'](util['format'](_0x1b8c('0x126'),this[_0x1b8c('0xc')][_0x1b8c('0x34')],_0x4a4c43[_0x1b8c('0x124')]));this[_0x1b8c('0xc')][_0x1b8c('0x8c')](util[_0x1b8c('0x25')](_0x1b8c('0x126'),this[_0x1b8c('0xc')][_0x1b8c('0x34')],_0x4a4c43[_0x1b8c('0x124')]));return{'code':0xc8,'result':_0x1b8c('0x12b')};}else{logger[_0x1b8c('0x28')](util[_0x1b8c('0x25')](_0x1b8c('0x127'),this['channel']['callerid'],_0x4a4c43[_0x1b8c('0x124')]));this[_0x1b8c('0xc')][_0x1b8c('0x8c')](util[_0x1b8c('0x25')](_0x1b8c('0x126'),this[_0x1b8c('0xc')][_0x1b8c('0x34')],_0x4a4c43[_0x1b8c('0x124')]));return{'code':0xc8,'result':_0x1b8c('0x12c')};}};AGIVertices['prototype']['playback']=function(_0xd5a038){logger['info'](util[_0x1b8c('0x25')](_0x1b8c('0x139'),_0xd5a038['label']));if(!this[_0x1b8c('0x61')](_0xd5a038[_0x1b8c('0xdc')])){return this[_0x1b8c('0xc')]['error'](_0xd5a038,'no\x20file\x20audio\x20selected');}var _0x2fbeb4=this[_0x1b8c('0x1b')][_0x1b8c('0x7b')](this,_0xd5a038[_0x1b8c('0xdc')]);if(!_0x2fbeb4){return this[_0x1b8c('0xc')]['error'](_0xd5a038,_0x1b8c('0x13a'));}var _0x34dd63=this[_0x1b8c('0xc')][_0x1b8c('0x4f')]('PLAYBACK',[_0x2fbeb4,_0xd5a038[_0x1b8c('0xb6')]]);if(_0x34dd63['result']===-0x1){return _0x34dd63;}return this[_0x1b8c('0xc')]['noop'](util[_0x1b8c('0x25')]('Executed\x20command\x20%s\x20%s',_0x1b8c('0x13b'),_0x2fbeb4));};AGIVertices[_0x1b8c('0xe')][_0x1b8c('0x13c')]=function(_0x336e88){logger[_0x1b8c('0x28')](util[_0x1b8c('0x25')]('Enter\x20in\x20QUEUE\x20(%s)\x20block',_0x336e88[_0x1b8c('0x32')]));if(!this[_0x1b8c('0x61')](_0x336e88['queue_id'])){return this[_0x1b8c('0xc')][_0x1b8c('0x27')](_0x336e88,_0x1b8c('0x13d'));}var _0x426522='';var _0x1781ba=parseInt(_0x336e88[_0x1b8c('0x13e')],0xa);if(isNaN(_0x1781ba)){_0x426522=_0x336e88[_0x1b8c('0x13e')];}else{_0x426522=this[_0x1b8c('0x13f')][_0x1b8c('0x7b')](this,_0x336e88[_0x1b8c('0x13e')]);if(!_0x426522){return this[_0x1b8c('0xc')][_0x1b8c('0x27')](_0x336e88,_0x1b8c('0x140'));}}var _0x2ea562='';if(this[_0x1b8c('0x61')](_0x336e88[_0x1b8c('0xdc')])){var _0x27fc88=this[_0x1b8c('0x1b')][_0x1b8c('0x7b')](this,_0x336e88[_0x1b8c('0xdc')]);if(_0x27fc88){_0x2ea562=_0x27fc88;}}this[_0x1b8c('0x30')][_0x1b8c('0x7b')](this,_0x336e88,_0x426522);if(_0x336e88[_0x1b8c('0xb6')]['indexOf']('x')<0x0){_0x336e88[_0x1b8c('0xb6')]+='x';}if(_0x336e88['opts'][_0x1b8c('0x141')]('X')<0x0){_0x336e88[_0x1b8c('0xb6')]+='X';}this['channel'][_0x1b8c('0x79')](_0x1b8c('0x142'),_0x426522?_0x426522[_0x1b8c('0x143')]():'');var _0x435345=this[_0x1b8c('0xc')][_0x1b8c('0x4f')](_0x1b8c('0x144'),[_0x426522,_0x336e88[_0x1b8c('0xb6')],_0x336e88['url'],_0x2ea562,_0x336e88[_0x1b8c('0x81')],_0x336e88['agi'],_0x336e88['macro'],_0x336e88[_0x1b8c('0x145')],'',_0x336e88[_0x1b8c('0x146')]]);if(_0x435345[_0x1b8c('0x98')]===-0x1){return _0x435345;}return this['channel'][_0x1b8c('0x8c')](util[_0x1b8c('0x25')](_0x1b8c('0x8d'),_0x1b8c('0x144'),_0x426522));};AGIVertices[_0x1b8c('0xe')]['record']=function(_0x529453){logger[_0x1b8c('0x28')](util[_0x1b8c('0x25')]('Enter\x20in\x20RECORD\x20(%s)\x20block',_0x529453[_0x1b8c('0x32')]));var _0x2a0231=_0x529453[_0x1b8c('0x147')]||_0x1b8c('0xfb');var _0x463aff=util[_0x1b8c('0x25')](_0x1b8c('0x148'),this['channel'][_0x1b8c('0x31')],rs[_0x1b8c('0xe3')](0x5));var _0x4e7f42=util[_0x1b8c('0x25')](_0x1b8c('0x149'),FILES_PATH,_0x463aff,_0x2a0231);var _0x52a288=util[_0x1b8c('0x25')]('%s/recordings/%s',FILES_PATH,_0x463aff);this[_0x1b8c('0x35')]['sync'](this,_0x529453,_0x463aff,_0x4e7f42);this['channel'][_0x1b8c('0x79')]('RECORDING_SAVENAME',_0x463aff);logger[_0x1b8c('0x28')](_0x1b8c('0x14a'),_0x52a288,_0x2a0231,_0x529453[_0x1b8c('0x14b')],_0x529453['timeout']);return this['channel']['recordFile'](_0x52a288,_0x2a0231,_0x529453['escape_digits'],_0x529453[_0x1b8c('0x81')],undefined,!![]);};AGIVertices[_0x1b8c('0xe')][_0x1b8c('0x14c')]=function(_0x1c6108){logger[_0x1b8c('0x28')](util['format'](_0x1b8c('0x14d'),_0x1c6108[_0x1b8c('0x32')]));return this[_0x1b8c('0xc')][_0x1b8c('0x14e')](_0x1c6108[_0x1b8c('0x14f')][_0x1b8c('0x50')](/\s+/g,''),_0x1c6108[_0x1b8c('0x14b')]);};AGIVertices['prototype'][_0x1b8c('0x150')]=function(_0x2db7eb){logger[_0x1b8c('0x28')](util[_0x1b8c('0x25')](_0x1b8c('0x151'),_0x2db7eb[_0x1b8c('0x32')]));return this[_0x1b8c('0xc')]['sayNumber'](_0x2db7eb[_0x1b8c('0x152')]['replace'](/\s+/g,''),_0x2db7eb[_0x1b8c('0x14b')]);};AGIVertices[_0x1b8c('0xe')][_0x1b8c('0x153')]=function(_0x5d06d1){logger[_0x1b8c('0x28')](util[_0x1b8c('0x25')](_0x1b8c('0x154'),_0x5d06d1[_0x1b8c('0x32')]));return this['channel']['sayPhonetic'](_0x5d06d1[_0x1b8c('0x54')],_0x5d06d1['escape_digits']);};AGIVertices[_0x1b8c('0xe')][_0x1b8c('0x155')]=function(_0x50cc3c){logger[_0x1b8c('0x28')](util[_0x1b8c('0x25')](_0x1b8c('0x156'),_0x50cc3c[_0x1b8c('0x32')]));if(!this[_0x1b8c('0x61')](_0x50cc3c['account_id'])){return this[_0x1b8c('0xc')][_0x1b8c('0x8c')](_0x1b8c('0x157'));}var _0x1cdd9c=this['getMailAccount'][_0x1b8c('0x7b')](this,_0x50cc3c[_0x1b8c('0x158')]);if(!_0x1cdd9c||!_0x1cdd9c[_0x1b8c('0x159')]){return this[_0x1b8c('0xc')][_0x1b8c('0x27')](_0x50cc3c,_0x1b8c('0x15a'));}var _0x26f390={'from':util[_0x1b8c('0x25')](_0x1b8c('0x15b'),_0x1cdd9c[_0x1b8c('0x15')],_0x1cdd9c['email']||_0x1cdd9c['Smtp'][_0x1b8c('0x15c')]),'to':_0x50cc3c['to']||'','cc':_0x50cc3c['cc']||'','bcc':_0x50cc3c[_0x1b8c('0x15d')]||'','subject':_0x50cc3c[_0x1b8c('0x15e')],'html':_0x50cc3c[_0x1b8c('0x54')],'text':_0x50cc3c[_0x1b8c('0x54')]};var _0x111334={'tls':{'rejectUnauthorized':![]}};if(_0x1cdd9c[_0x1b8c('0x159')][_0x1b8c('0x15f')]){_0x111334[_0x1b8c('0x15f')]=_0x1cdd9c[_0x1b8c('0x159')][_0x1b8c('0x15f')];}else{_0x111334[_0x1b8c('0x160')]=_0x1cdd9c['Smtp']['host'];_0x111334['port']=_0x1cdd9c[_0x1b8c('0x159')][_0x1b8c('0x161')];_0x111334[_0x1b8c('0x162')]=_0x1cdd9c['Smtp'][_0x1b8c('0x162')];}if(_0x1cdd9c[_0x1b8c('0x159')][_0x1b8c('0x163')]){_0x111334[_0x1b8c('0x164')]={'user':_0x1cdd9c['Smtp'][_0x1b8c('0x15c')],'pass':_0x1cdd9c[_0x1b8c('0x159')][_0x1b8c('0x165')]};}if(this[_0x1b8c('0x61')](_0x50cc3c[_0x1b8c('0x166')])){}logger[_0x1b8c('0xaf')](_0x1b8c('0x167'),JSON['stringify'](_0x26f390));this[_0x1b8c('0x30')][_0x1b8c('0x7b')](this,_0x50cc3c,_0x50cc3c[_0x1b8c('0x158')]);this[_0x1b8c('0xc')][_0x1b8c('0x8c')](util[_0x1b8c('0x25')](_0x1b8c('0x168'),_0x1cdd9c[_0x1b8c('0x15')]));this['sendMailMessage'][_0x1b8c('0x7b')](this,_0x111334,_0x26f390);return this[_0x1b8c('0xc')][_0x1b8c('0x8c')](_0x1b8c('0x169'));};AGIVertices['prototype']['sendFax']=function(_0x22b921){logger['info'](util[_0x1b8c('0x25')](_0x1b8c('0x16a'),_0x22b921[_0x1b8c('0x32')]));return this[_0x1b8c('0xc')]['noop']('SENDFAX\x20block\x20not\x20implemented');};AGIVertices[_0x1b8c('0xe')]['sendSMS']=function(_0x1a6c69){logger[_0x1b8c('0x28')](util[_0x1b8c('0x25')](_0x1b8c('0x16b'),_0x1a6c69[_0x1b8c('0x32')]));if(!this['isConfigured'](_0x1a6c69['sms_account_id'])){return this[_0x1b8c('0xc')][_0x1b8c('0x8c')](_0x1b8c('0x16c'));}var _0x5788fb=this[_0x1b8c('0x2e')][_0x1b8c('0x7b')](this,_0x1a6c69[_0x1b8c('0x16d')]);if(!_0x5788fb){return this[_0x1b8c('0xc')][_0x1b8c('0x27')](_0x1a6c69,_0x1b8c('0x16e'));}var _0x45d6df={'body':_0x1a6c69[_0x1b8c('0x16f')],'phone':_0x1a6c69['to']||'','SmsAccountId':_0x5788fb['id']};logger[_0x1b8c('0xaf')]('sendSMS\x20message',JSON['stringify'](_0x45d6df));this[_0x1b8c('0x30')][_0x1b8c('0x7b')](this,_0x1a6c69,_0x1a6c69[_0x1b8c('0x16d')]);this[_0x1b8c('0xc')]['noop'](util['format'](_0x1b8c('0x170'),_0x5788fb[_0x1b8c('0x15')]));this[_0x1b8c('0x2f')][_0x1b8c('0x7b')](this,_0x45d6df);return this[_0x1b8c('0xc')][_0x1b8c('0x8c')](_0x1b8c('0x171'));};AGIVertices['prototype'][_0x1b8c('0x172')]=function(_0x5ab9e4){logger[_0x1b8c('0x28')](util[_0x1b8c('0x25')](_0x1b8c('0x173'),_0x5ab9e4[_0x1b8c('0x32')]));if(!this[_0x1b8c('0x61')](_0x5ab9e4[_0x1b8c('0xa9')])){return this['channel'][_0x1b8c('0x27')](_0x5ab9e4,_0x1b8c('0x174'));}var _0x422c55=this[_0x1b8c('0xf')]['sync'](this,_0x5ab9e4['variable_id']);if(!_0x422c55){return this[_0x1b8c('0xc')][_0x1b8c('0x27')](_0x5ab9e4,_0x1b8c('0xaa'));}return this[_0x1b8c('0xc')][_0x1b8c('0x79')](_0x422c55,_0x5ab9e4[_0x1b8c('0x175')]);};AGIVertices[_0x1b8c('0xe')][_0x1b8c('0x176')]=function(_0x143cc7){logger[_0x1b8c('0x28')](util[_0x1b8c('0x25')]('Enter\x20in\x20START\x20(%s)\x20block',_0x143cc7[_0x1b8c('0x32')]));this[_0x1b8c('0xc')]['noop'](_0x1b8c('0x177'));if(_0x143cc7[_0x1b8c('0x83')]===_0x1b8c('0x178')){this[_0x1b8c('0xc')][_0x1b8c('0x8c')](_0x1b8c('0x179'));return this[_0x1b8c('0xc')][_0x1b8c('0x83')]();}return this['channel']['noop'](_0x1b8c('0x17a'));};AGIVertices['prototype']['subproject']=function(_0xcc9ab8){logger[_0x1b8c('0x28')](util[_0x1b8c('0x25')]('Enter\x20in\x20SUBPROJECT\x20(%s)\x20block',_0xcc9ab8[_0x1b8c('0x32')]));if(!this[_0x1b8c('0x61')](_0xcc9ab8[_0x1b8c('0x17b')])){return this[_0x1b8c('0xc')][_0x1b8c('0x27')](_0xcc9ab8,_0x1b8c('0x17c'));}var _0x3b9662=this[_0x1b8c('0x13')][_0x1b8c('0x7b')](this,_0xcc9ab8[_0x1b8c('0x17b')]);if(!this[_0x1b8c('0x61')](_0x3b9662)){return this[_0x1b8c('0xc')][_0x1b8c('0x27')](_0xcc9ab8,util['format'](_0x1b8c('0x17d'),_0xcc9ab8[_0x1b8c('0x17b')]));}if(_0x3b9662===this[_0x1b8c('0xc')]['arg_1']){return this['channel'][_0x1b8c('0x27')](_0xcc9ab8,_0x1b8c('0x17e'));}this[_0x1b8c('0x30')][_0x1b8c('0x7b')](this,_0xcc9ab8,_0x3b9662);var _0x582909=this[_0x1b8c('0xc')][_0x1b8c('0x4f')](_0x1b8c('0x17f'),util['format'](_0x1b8c('0x180'),config[_0x1b8c('0x7d')]['host']||'127.0.0.1',_0x3b9662,this[_0x1b8c('0xc')]['arg_1']));if(_0x582909[_0x1b8c('0x98')]===-0x1){return _0x582909;}return this[_0x1b8c('0xc')][_0x1b8c('0x8c')](util[_0x1b8c('0x25')](_0x1b8c('0x8d'),_0x1b8c('0x17f'),_0x3b9662));};AGIVertices[_0x1b8c('0xe')][_0x1b8c('0x181')]=function(_0x216c74){logger[_0x1b8c('0x28')](util[_0x1b8c('0x25')](_0x1b8c('0x182'),_0x216c74[_0x1b8c('0x32')]));var _0x59eff9=this[_0x1b8c('0x183')][_0x1b8c('0x7b')](this,_0x216c74[_0x1b8c('0x7e')]);this[_0x1b8c('0x30')]['sync'](this,_0x216c74,_0x216c74['command']);if(this['isConfigured'](_0x216c74[_0x1b8c('0xa9')])){var _0x2aafa8=this[_0x1b8c('0xf')]['sync'](this,_0x216c74[_0x1b8c('0xa9')]);if(_0x2aafa8){this['channel']['setVariable'](_0x2aafa8,_0x59eff9);return this[_0x1b8c('0xc')][_0x1b8c('0x8c')](util[_0x1b8c('0x25')](_0x1b8c('0x184'),_0x216c74[_0x1b8c('0x7e')],_0x2aafa8));}}return this['channel'][_0x1b8c('0x8c')](util[_0x1b8c('0x25')](_0x1b8c('0x185'),_0x216c74[_0x1b8c('0x7e')]));};AGIVertices[_0x1b8c('0xe')]['google_cloud_tts']=function(_0x509057){logger[_0x1b8c('0x28')](util['format']('Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block',_0x509057[_0x1b8c('0x32')]));if(!this[_0x1b8c('0x61')](_0x509057[_0x1b8c('0x52')])){return this[_0x1b8c('0xc')]['noop']('no\x20apiKey\x20configured');}if(!this[_0x1b8c('0x61')](_0x509057['text'])){return this['channel'][_0x1b8c('0x8c')](_0x1b8c('0xbb'));}this['channel']['noop'](util[_0x1b8c('0x25')](_0x1b8c('0x186'),_0x509057[_0x1b8c('0x54')]));var _0x2130ea=this[_0x1b8c('0x51')][_0x1b8c('0x7b')](this,_0x509057);if(_0x2130ea){this['channel'][_0x1b8c('0x8c')](util[_0x1b8c('0x25')](_0x1b8c('0x187'),_0x2130ea));var _0x985732=this[_0x1b8c('0xc')][_0x1b8c('0xcd')](_0x2130ea);try{fs['unlink'](_0x2130ea+'.wav');}catch(_0x3ca26a){logger[_0x1b8c('0x27')](_0x3ca26a);}return _0x985732;}return this[_0x1b8c('0xc')]['error'](_0x509057,_0x1b8c('0x188'));};AGIVertices[_0x1b8c('0xe')]['tts']=function(_0x20ac4d){logger[_0x1b8c('0x28')](util[_0x1b8c('0x25')](_0x1b8c('0x189'),_0x20ac4d['label']));if(!this['isConfigured'](_0x20ac4d[_0x1b8c('0x54')])){return this[_0x1b8c('0xc')][_0x1b8c('0x8c')](_0x1b8c('0xbb'));}this[_0x1b8c('0xc')][_0x1b8c('0x8c')](util['format'](_0x1b8c('0x18a'),_0x20ac4d[_0x1b8c('0x54')]));var _0x288bc8=this[_0x1b8c('0x18b')]['sync'](this,_0x20ac4d);if(_0x288bc8){this['channel']['noop'](util['format'](_0x1b8c('0x18c'),_0x288bc8));var _0x65c8a8=this[_0x1b8c('0xc')][_0x1b8c('0xcd')](_0x288bc8);try{fs['unlink'](_0x288bc8+_0x1b8c('0xf0'));}catch(_0xa8908a){logger[_0x1b8c('0x27')](_0xa8908a);}return _0x65c8a8;}return this[_0x1b8c('0xc')][_0x1b8c('0x27')](_0x20ac4d,_0x1b8c('0x18d'));};AGIVertices['prototype'][_0x1b8c('0x18e')]=function(_0x1ce238){logger[_0x1b8c('0x28')](util[_0x1b8c('0x25')](_0x1b8c('0x18f'),_0x1ce238['label']));if(!this[_0x1b8c('0x61')](_0x1ce238[_0x1b8c('0x124')])){return this['channel'][_0x1b8c('0x27')](_0x1ce238,_0x1b8c('0x12a'));}logger[_0x1b8c('0x28')](util[_0x1b8c('0x25')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0x1b8c('0xc')][_0x1b8c('0x34')],_0x1ce238['findBy']));var _0x5708b3=this[_0x1b8c('0x49')][_0x1b8c('0x7b')](this,_0x1ce238[_0x1b8c('0x124')]);if(_0x5708b3){logger[_0x1b8c('0x28')](util['format'](_0x1b8c('0x126'),this['channel'][_0x1b8c('0x34')],_0x1ce238[_0x1b8c('0x124')]));this[_0x1b8c('0xc')][_0x1b8c('0x8c')](util[_0x1b8c('0x25')]('AGENT\x20%s\x20FOUND\x20BY',this['channel']['callerid'],_0x1ce238[_0x1b8c('0x124')]));return{'code':0xc8,'result':'success'};}else{logger[_0x1b8c('0x28')](util['format'](_0x1b8c('0x127'),this[_0x1b8c('0xc')]['callerid'],_0x1ce238[_0x1b8c('0x124')]));this[_0x1b8c('0xc')][_0x1b8c('0x8c')](util[_0x1b8c('0x25')](_0x1b8c('0x127'),this[_0x1b8c('0xc')][_0x1b8c('0x34')],_0x1ce238[_0x1b8c('0x124')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0x1b8c('0xe')][_0x1b8c('0x190')]=function(_0x48af68){logger['info'](util[_0x1b8c('0x25')]('Enter\x20in\x20VOICEMAIL\x20(%s)\x20block',_0x48af68['label']));var _0x826bb7=this['channel']['exec'](_0x1b8c('0x191'),[_0x48af68['mailbox'],_0x48af68['options']]);if(_0x826bb7[_0x1b8c('0x98')]===-0x1){return _0x826bb7;}return this[_0x1b8c('0xc')][_0x1b8c('0x8c')](util[_0x1b8c('0x25')]('Executed\x20command\x20%s\x20%s','VOICEMAIL',_0x48af68[_0x1b8c('0x192')]));};AGIVertices[_0x1b8c('0xe')][_0x1b8c('0x193')]=function(_0x155792){logger[_0x1b8c('0x28')](util[_0x1b8c('0x25')]('Enter\x20in\x20SWITCH\x20(%s)\x20block',_0x155792['label']));if(!this[_0x1b8c('0x61')](_0x155792['variable_id'])){return this[_0x1b8c('0xc')]['error'](_0x155792,_0x1b8c('0x174'));}var _0x3f5c30=this['getVariable'][_0x1b8c('0x7b')](this,_0x155792[_0x1b8c('0xa9')]);if(!_0x3f5c30){return this['channel'][_0x1b8c('0x27')](_0x155792,_0x1b8c('0xaa'));}var _0x21b9b5=this[_0x1b8c('0xc')][_0x1b8c('0xf')](_0x3f5c30);return{'code':0xc8,'result':_0x21b9b5['extra']?_0x21b9b5[_0x1b8c('0x76')]:'-'};};String[_0x1b8c('0xe')][_0x1b8c('0x75')]=function(_0x9bb678,_0x232a14){return this[_0x1b8c('0x74')](_0x9bb678)[_0x1b8c('0x194')](_0x232a14);};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 7d55b9c..2525c9d 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 _0x54ef=['isUndefined','attended','[%s][HANGUP:UNIQUEID]','linkedid','[%s][HANGUP:LINKEDID]','[ACW][syncHangupRequest]\x20%s','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','[ACW][syncHangup]\x20%s','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','stringify','[%s][BLINDTRANSFER:LINKEDID]','[ACW][syncBlindTransfer]\x20%s','syncAgentRingNoAnswer','autopause','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','[ACW][syncAgentRingNoAnswer]\x20%s','util','lodash','moment','../../../config/logger','acw','../rpc/user','../rpc/voiceAgentReport','voiceQueues','timers','channels','syncAgentConnect','hanguprequest','syncHangupRequest','hangup','syncHangup','bind','agentringnoanswer','attendedtransfer','syncAttendedTransfer','syncBlindTransfer','syncAgentConnectPreview','milliseconds','diff','seconds','startAcw','interface','queue','ACW','mandatoryDisposition','mandatoryDispositionPause','name','QueuePause','then','agents','getAgent','voicePause','info','[%s][START][AGENT:%s][QUEUE:%s]','destlinkedid','savePause','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','timer','lastPauseAt','format','YYYY-MM-DD\x20HH:mm:ss','uniqueid','updateAcw','update','[%s][UPDATE][ACWTIME:%s]','catch','error','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','prototype','stopAcw','[TIMER][STOP][AGENT:%s]','[%s][UPDATE][ERRORS:%s]','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','[ACW][STOP]\x20%s','message','[ACW][syncAgentConnectPreview]\x20%s'];(function(_0x497cbe,_0x1825b0){var _0x5ddcd7=function(_0x9670){while(--_0x9670){_0x497cbe['push'](_0x497cbe['shift']());}};_0x5ddcd7(++_0x1825b0);}(_0x54ef,0x112));var _0xf54e=function(_0x3929a9,_0x432282){_0x3929a9=_0x3929a9-0x0;var _0x5295af=_0x54ef[_0x3929a9];return _0x5295af;};'use strict';var util=require(_0xf54e('0x0'));var _=require(_0xf54e('0x1'));var moment=require(_0xf54e('0x2'));var ami=require('../ami');var logger=require(_0xf54e('0x3'))(_0xf54e('0x4'));var RpcUser=require(_0xf54e('0x5'));var RpcVoiceAgentReport=require(_0xf54e('0x6'));function Acw(_0x8b6bb6){this[_0xf54e('0x7')]=_0x8b6bb6[_0xf54e('0x7')];this['agents']=_0x8b6bb6['agents'];this[_0xf54e('0x8')]=_0x8b6bb6[_0xf54e('0x8')];this[_0xf54e('0x9')]={};ami['on']('agentconnect',this[_0xf54e('0xa')]['bind'](this));ami['on'](_0xf54e('0xb'),this[_0xf54e('0xc')]['bind'](this));ami['on'](_0xf54e('0xd'),this[_0xf54e('0xe')][_0xf54e('0xf')](this));ami['on'](_0xf54e('0x10'),this['syncAgentRingNoAnswer'][_0xf54e('0xf')](this));ami['on'](_0xf54e('0x11'),this[_0xf54e('0x12')][_0xf54e('0xf')](this));ami['on']('blindtransfer',this[_0xf54e('0x13')]['bind'](this));ami['on']('custom:agentConnectPreview',this[_0xf54e('0x14')][_0xf54e('0xf')](this));}function getDiff(_0x28f776){var _0x380f26=moment()['milliseconds'](0x0);var _0x331732=moment(_0x28f776)[_0xf54e('0x15')](0x0);return _0x380f26[_0xf54e('0x16')](_0x331732,_0xf54e('0x17'));}Acw['prototype'][_0xf54e('0x18')]=function(_0x389abc){try{var _0x3eb415=this;var _0x5c5d00=this['channels'][_0x389abc][_0xf54e('0x19')];var _0x41fb35=this[_0xf54e('0x9')][_0x389abc][_0xf54e('0x1a')];var _0x15cc48=this[_0xf54e('0x7')][_0x41fb35];var _0x2e27b6=![];var _0x1ef06e=_0xf54e('0x1b');if(_0x15cc48[_0xf54e('0x1c')]){if(_0x15cc48[_0xf54e('0x1d')]['name']){_0x2e27b6=!![];_0x1ef06e=_0x15cc48['mandatoryDispositionPause'][_0xf54e('0x1e')];}}ami['Action']({'action':_0xf54e('0x1f'),'interface':_0x5c5d00,'paused':!![],'reason':_0x1ef06e})[_0xf54e('0x20')](function(_0x106362){if(_0x3eb415[_0xf54e('0x21')][_0x5c5d00]){return RpcUser[_0xf54e('0x22')](_0x3eb415[_0xf54e('0x21')][_0x5c5d00]['id'])[_0xf54e('0x20')](function(_0x11985e){if(_0x11985e&&!_0x11985e[_0xf54e('0x23')]){logger[_0xf54e('0x24')](_0xf54e('0x25'),_0x389abc,_0x5c5d00,_0x41fb35);var _0x5b83df=_0x3eb415[_0xf54e('0x9')][_0x389abc]['attended']&&_0x3eb415[_0xf54e('0x9')][_0x389abc][_0xf54e('0x26')]?_0x3eb415[_0xf54e('0x9')][_0x389abc][_0xf54e('0x26')]:_0x389abc;return RpcUser[_0xf54e('0x27')](_0x3eb415[_0xf54e('0x21')][_0x5c5d00],_0x1ef06e,_0x5b83df)[_0xf54e('0x20')](function(_0x43488d){if(!_0x2e27b6){_0x3eb415[_0xf54e('0x8')][_0x5c5d00]={};logger[_0xf54e('0x24')](_0xf54e('0x28'),_0x389abc,_0x3eb415[_0xf54e('0x7')][_0x41fb35][_0xf54e('0x29')],_0x5c5d00,_0x41fb35);_0x3eb415['timers'][_0x5c5d00][_0xf54e('0x2a')]=setTimeout(_0x3eb415['stopAcw'][_0xf54e('0xf')](_0x3eb415,_0x5c5d00),_0x3eb415['voiceQueues'][_0x41fb35][_0xf54e('0x29')]*0x3e8);_0x3eb415[_0xf54e('0x8')][_0x5c5d00][_0xf54e('0x2b')]=moment()[_0xf54e('0x2c')](_0xf54e('0x2d'));_0x3eb415[_0xf54e('0x8')][_0x5c5d00][_0xf54e('0x2e')]=_0x389abc;_0x3eb415['timers'][_0x5c5d00]['queue']=_0x41fb35;_0x3eb415[_0xf54e('0x8')][_0x5c5d00][_0xf54e('0x2f')]=function(){var _0x2ec92e=getDiff(_0x3eb415[_0xf54e('0x8')][_0x5c5d00][_0xf54e('0x2b')]);clearTimeout(_0x3eb415[_0xf54e('0x8')][_0x5c5d00][_0xf54e('0x2a')]);_0x3eb415[_0xf54e('0x8')][_0x5c5d00][_0xf54e('0x2a')]=![];RpcVoiceAgentReport[_0xf54e('0x30')]({'acwtime':_0x2ec92e},_0x3eb415['timers'][_0x5c5d00]['uniqueid'],_0x5c5d00)[_0xf54e('0x20')](function(_0x3169dd){logger['info'](_0xf54e('0x31'),_0x389abc,_0x2ec92e,_0x3169dd);})[_0xf54e('0x32')](function(_0x379110){logger[_0xf54e('0x33')]('[%s][UPDATE][ERRORS:%s]',_0x389abc,_0x379110);});delete _0x3eb415['timers'][_0x5c5d00];};}});}else{logger['info'](_0xf54e('0x34'),_0x389abc,_0x5c5d00,_0x41fb35);}});}})[_0xf54e('0x32')](function(_0x210d6d){logger[_0xf54e('0x33')](_0xf54e('0x28'),_0x389abc,_0x3eb415[_0xf54e('0x7')][_0x41fb35]['acwTimeout'],_0x5c5d00,_0x41fb35);})['finally'](function(){delete _0x3eb415['channels'][_0x389abc];});}catch(_0xc04e04){logger[_0xf54e('0x33')]('[ACW][START]\x20%s',_0xc04e04['message']);}};Acw[_0xf54e('0x35')][_0xf54e('0x36')]=function(_0x173e6c){try{var _0x4a347a=this;if(_0x4a347a[_0xf54e('0x8')][_0x173e6c]){_0x4a347a[_0xf54e('0x8')][_0x173e6c]['timer']=![];var _0x38d7a0=_0x4a347a[_0xf54e('0x8')][_0x173e6c][_0xf54e('0x2e')];var _0x1eeeb4=_0x4a347a[_0xf54e('0x8')][_0x173e6c][_0xf54e('0x1a')];var _0x4e00b7=_0x4a347a['voiceQueues'][_0x1eeeb4][_0xf54e('0x29')];logger[_0xf54e('0x24')](_0xf54e('0x37'),_0x173e6c);RpcUser['saveUnpause'](this[_0xf54e('0x21')][_0x173e6c]);RpcVoiceAgentReport[_0xf54e('0x30')]({'acwtime':_0x4e00b7,'agentacw':!![]},_0x38d7a0,_0x173e6c)[_0xf54e('0x20')](function(_0x1ee884){logger[_0xf54e('0x24')](_0xf54e('0x31'),_0x38d7a0,_0x4e00b7,_0x1ee884);})[_0xf54e('0x32')](function(_0x1345b0){logger[_0xf54e('0x33')](_0xf54e('0x38'),_0x38d7a0,_0x1345b0);});}else{logger[_0xf54e('0x33')](_0xf54e('0x39'),_0x173e6c);if(_0x4a347a[_0xf54e('0x8')]){logger[_0xf54e('0x24')](_0xf54e('0x3a'),JSON['stringify'](_0x4a347a['timers']));}}}catch(_0x533423){logger[_0xf54e('0x33')](_0xf54e('0x3b'),_0x533423['message']);}};Acw[_0xf54e('0x35')][_0xf54e('0xa')]=function(_0x381c03){try{if(this['voiceQueues'][_0x381c03[_0xf54e('0x1a')]]&&(this[_0xf54e('0x7')][_0x381c03[_0xf54e('0x1a')]][_0xf54e('0x4')]||this[_0xf54e('0x7')][_0x381c03[_0xf54e('0x1a')]][_0xf54e('0x1c')])){if(this[_0xf54e('0x21')][_0x381c03[_0xf54e('0x19')]]){this['channels'][_0x381c03[_0xf54e('0x2e')]]={'queue':_0x381c03[_0xf54e('0x1a')],'interface':_0x381c03[_0xf54e('0x19')],'destlinkedid':_0x381c03[_0xf54e('0x26')]};}}}catch(_0x2aac11){logger[_0xf54e('0x33')]('[ACW][syncAgentConnect]\x20%s',_0x2aac11[_0xf54e('0x3c')]);}};Acw['prototype'][_0xf54e('0x14')]=function(_0x4a7e3b){try{if(this[_0xf54e('0x7')][_0x4a7e3b[_0xf54e('0x1a')]]&&(this[_0xf54e('0x7')][_0x4a7e3b['queue']][_0xf54e('0x4')]||this[_0xf54e('0x7')][_0x4a7e3b[_0xf54e('0x1a')]][_0xf54e('0x1c')])){if(this[_0xf54e('0x21')][_0x4a7e3b['interface']]){this[_0xf54e('0x9')][_0x4a7e3b[_0xf54e('0x2e')]]={'queue':_0x4a7e3b[_0xf54e('0x1a')],'interface':_0x4a7e3b[_0xf54e('0x19')]};}}}catch(_0x5f3438){logger[_0xf54e('0x33')](_0xf54e('0x3d'),_0x5f3438['message']);}};Acw[_0xf54e('0x35')][_0xf54e('0xc')]=function(_0x3d24c7){try{if(this[_0xf54e('0x9')][_0x3d24c7['uniqueid']]&&_[_0xf54e('0x3e')](this[_0xf54e('0x9')][_0x3d24c7[_0xf54e('0x2e')]][_0xf54e('0x3f')])){logger[_0xf54e('0x24')](_0xf54e('0x40'),_0x3d24c7[_0xf54e('0x2e')]);this[_0xf54e('0x18')](_0x3d24c7[_0xf54e('0x2e')]);}else if(this[_0xf54e('0x9')][_0x3d24c7[_0xf54e('0x41')]]&&_[_0xf54e('0x3e')](this[_0xf54e('0x9')][_0x3d24c7[_0xf54e('0x41')]][_0xf54e('0x3f')])){logger[_0xf54e('0x24')](_0xf54e('0x42'),_0x3d24c7[_0xf54e('0x41')]);this[_0xf54e('0x18')](_0x3d24c7[_0xf54e('0x41')]);}}catch(_0x4e25e4){logger['error'](_0xf54e('0x43'),_0x4e25e4[_0xf54e('0x3c')]);}};Acw[_0xf54e('0x35')][_0xf54e('0xe')]=function(_0xba297c){try{if(this[_0xf54e('0x9')][_0xba297c[_0xf54e('0x2e')]]&&this[_0xf54e('0x9')][_0xba297c[_0xf54e('0x2e')]][_0xf54e('0x3f')]){logger[_0xf54e('0x24')]('[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]',_0xba297c[_0xf54e('0x2e')]);this[_0xf54e('0x18')](_0xba297c[_0xf54e('0x2e')]);}else if(this[_0xf54e('0x9')][_0xba297c[_0xf54e('0x41')]]&&this[_0xf54e('0x9')][_0xba297c[_0xf54e('0x41')]]['attended']){logger[_0xf54e('0x24')](_0xf54e('0x44'),_0xba297c[_0xf54e('0x41')]);this['startAcw'](_0xba297c[_0xf54e('0x41')]);}}catch(_0x54ac1a){logger[_0xf54e('0x33')](_0xf54e('0x45'),_0x54ac1a[_0xf54e('0x3c')]);}};Acw['prototype'][_0xf54e('0x12')]=function(_0x30d10d){try{if(!_[_0xf54e('0x46')](this[_0xf54e('0x9')][_0x30d10d[_0xf54e('0x47')]])){this[_0xf54e('0x18')](_0x30d10d[_0xf54e('0x47')]);if(this['channels'][_0x30d10d['secondtransfereruniqueid']]){this[_0xf54e('0x9')][_0x30d10d[_0xf54e('0x48')]]['attended']=!![];this[_0xf54e('0x9')][_0x30d10d['transfertargetuniqueid']]=this[_0xf54e('0x9')][_0x30d10d['secondtransfereruniqueid']];delete this[_0xf54e('0x9')][_0x30d10d[_0xf54e('0x48')]];}}else if(!_[_0xf54e('0x46')](this[_0xf54e('0x9')][_0x30d10d[_0xf54e('0x49')]])){this[_0xf54e('0x18')](_0x30d10d['transfertargetuniqueid']);if(this['channels'][_0x30d10d[_0xf54e('0x4a')]]){this[_0xf54e('0x9')][_0x30d10d['origtransfereruniqueid']]['attended']=!![];this[_0xf54e('0x9')][_0x30d10d['transfereeuniqueid']]=this[_0xf54e('0x9')][_0x30d10d[_0xf54e('0x4a')]];delete this[_0xf54e('0x9')][_0x30d10d[_0xf54e('0x4a')]];}}}catch(_0x1d7c52){logger[_0xf54e('0x33')](_0xf54e('0x4b'),_0x1d7c52[_0xf54e('0x3c')]);}};Acw[_0xf54e('0x35')][_0xf54e('0x13')]=function(_0x1f9dad){try{if(this[_0xf54e('0x9')][_0x1f9dad[_0xf54e('0x4c')]]){logger[_0xf54e('0x24')]('[%s][BLINDTRANSFER:UNIQUEID]',JSON[_0xf54e('0x4d')](_0x1f9dad[_0xf54e('0x4c')]));this[_0xf54e('0x18')](_0x1f9dad[_0xf54e('0x4c')]);}else if(this[_0xf54e('0x9')][_0x1f9dad['transfererlinkedid']]){logger[_0xf54e('0x24')](_0xf54e('0x4e'),JSON['stringify'](_0x1f9dad['transfererlinkedid']));this[_0xf54e('0x18')](_0x1f9dad['transfererlinkedid']);}}catch(_0x26322a){logger[_0xf54e('0x33')](_0xf54e('0x4f'),_0x26322a[_0xf54e('0x3c')]);}};Acw['prototype'][_0xf54e('0x50')]=function(_0x5cdb8c){try{if(this[_0xf54e('0x7')][_0x5cdb8c[_0xf54e('0x1a')]]&&this[_0xf54e('0x7')][_0x5cdb8c['queue']][_0xf54e('0x51')]==='all'){if(this[_0xf54e('0x21')][_0x5cdb8c[_0xf54e('0x19')]]){logger['info'](_0xf54e('0x52'),_0x5cdb8c['uniqueid'],_0x5cdb8c[_0xf54e('0x19')],_0x5cdb8c[_0xf54e('0x1a')]);return RpcUser[_0xf54e('0x27')](this[_0xf54e('0x21')][_0x5cdb8c[_0xf54e('0x19')]],'Auto-Pause',_0x5cdb8c[_0xf54e('0x2e')]);}}}catch(_0x1d18d3){logger['error'](_0xf54e('0x53'),_0x1d18d3[_0xf54e('0x3c')]);}};module['exports']=Acw; \ No newline at end of file +var _0x8d0e=['prototype','startAcw','interface','ACW','mandatoryDisposition','name','mandatoryDispositionPause','then','agents','getAgent','voicePause','info','destlinkedid','savePause','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','timer','lastPauseAt','format','YYYY-MM-DD\x20HH:mm:ss','update','uniqueid','[%s][UPDATE][ACWTIME:%s]','catch','error','finally','message','stopAcw','queue','[%s][UPDATE][ERRORS:%s]','[ACW][TIMERS]','stringify','[ACW][syncAgentConnect]\x20%s','[ACW][syncAgentConnectPreview]\x20%s','isUndefined','attended','[%s][HANGUP:UNIQUEID]','linkedid','[%s][HANGUP:LINKEDID]','[ACW][syncHangupRequest]\x20%s','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','[ACW][syncBlindTransfer]\x20%s','syncAgentRingNoAnswer','autopause','all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','Auto-Pause','util','lodash','moment','../ami','../../../config/logger','acw','../rpc/user','../rpc/voiceAgentReport','voiceQueues','timers','channels','agentconnect','syncAgentConnect','bind','hanguprequest','syncHangupRequest','hangup','syncHangup','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','custom:agentConnectPreview','syncAgentConnectPreview','milliseconds','diff','seconds'];(function(_0x508a75,_0x219a2a){var _0x766b98=function(_0x16461e){while(--_0x16461e){_0x508a75['push'](_0x508a75['shift']());}};_0x766b98(++_0x219a2a);}(_0x8d0e,0x1d7));var _0xe8d0=function(_0x556f0c,_0x362372){_0x556f0c=_0x556f0c-0x0;var _0x1c199d=_0x8d0e[_0x556f0c];return _0x1c199d;};'use strict';var util=require(_0xe8d0('0x0'));var _=require(_0xe8d0('0x1'));var moment=require(_0xe8d0('0x2'));var ami=require(_0xe8d0('0x3'));var logger=require(_0xe8d0('0x4'))(_0xe8d0('0x5'));var RpcUser=require(_0xe8d0('0x6'));var RpcVoiceAgentReport=require(_0xe8d0('0x7'));function Acw(_0x32cee9){this['voiceQueues']=_0x32cee9[_0xe8d0('0x8')];this['agents']=_0x32cee9['agents'];this[_0xe8d0('0x9')]=_0x32cee9[_0xe8d0('0x9')];this[_0xe8d0('0xa')]={};ami['on'](_0xe8d0('0xb'),this[_0xe8d0('0xc')][_0xe8d0('0xd')](this));ami['on'](_0xe8d0('0xe'),this[_0xe8d0('0xf')]['bind'](this));ami['on'](_0xe8d0('0x10'),this[_0xe8d0('0x11')][_0xe8d0('0xd')](this));ami['on']('agentringnoanswer',this['syncAgentRingNoAnswer'][_0xe8d0('0xd')](this));ami['on'](_0xe8d0('0x12'),this[_0xe8d0('0x13')][_0xe8d0('0xd')](this));ami['on'](_0xe8d0('0x14'),this[_0xe8d0('0x15')]['bind'](this));ami['on'](_0xe8d0('0x16'),this[_0xe8d0('0x17')]['bind'](this));}function getDiff(_0x2b640d){var _0x4cbd26=moment()['milliseconds'](0x0);var _0x90a1ea=moment(_0x2b640d)[_0xe8d0('0x18')](0x0);return _0x4cbd26[_0xe8d0('0x19')](_0x90a1ea,_0xe8d0('0x1a'));}Acw[_0xe8d0('0x1b')][_0xe8d0('0x1c')]=function(_0x52818a){try{var _0x6ccffa=this;var _0x49554d=this[_0xe8d0('0xa')][_0x52818a][_0xe8d0('0x1d')];var _0xfe8a4=this['channels'][_0x52818a]['queue'];var _0x47c67a=this[_0xe8d0('0x8')][_0xfe8a4];var _0x384854=![];var _0x27b910=_0xe8d0('0x1e');if(_0x47c67a[_0xe8d0('0x1f')]){if(_0x47c67a['mandatoryDispositionPause'][_0xe8d0('0x20')]){_0x384854=!![];_0x27b910=_0x47c67a[_0xe8d0('0x21')]['name'];}}ami['Action']({'action':'QueuePause','interface':_0x49554d,'paused':!![],'reason':_0x27b910})[_0xe8d0('0x22')](function(_0x35d131){if(_0x6ccffa[_0xe8d0('0x23')][_0x49554d]){return RpcUser[_0xe8d0('0x24')](_0x6ccffa[_0xe8d0('0x23')][_0x49554d]['id'])[_0xe8d0('0x22')](function(_0x1bd25c){if(_0x1bd25c&&!_0x1bd25c[_0xe8d0('0x25')]){logger[_0xe8d0('0x26')]('[%s][START][AGENT:%s][QUEUE:%s]',_0x52818a,_0x49554d,_0xfe8a4);var _0xed8f2e=_0x6ccffa[_0xe8d0('0xa')][_0x52818a]['attended']&&_0x6ccffa[_0xe8d0('0xa')][_0x52818a][_0xe8d0('0x27')]?_0x6ccffa[_0xe8d0('0xa')][_0x52818a][_0xe8d0('0x27')]:_0x52818a;return RpcUser[_0xe8d0('0x28')](_0x6ccffa[_0xe8d0('0x23')][_0x49554d],_0x27b910,_0xed8f2e)[_0xe8d0('0x22')](function(_0x32f0c1){if(!_0x384854){_0x6ccffa[_0xe8d0('0x9')][_0x49554d]={};logger[_0xe8d0('0x26')](_0xe8d0('0x29'),_0x52818a,_0x6ccffa['voiceQueues'][_0xfe8a4][_0xe8d0('0x2a')],_0x49554d,_0xfe8a4);_0x6ccffa[_0xe8d0('0x9')][_0x49554d][_0xe8d0('0x2b')]=setTimeout(_0x6ccffa['stopAcw'][_0xe8d0('0xd')](_0x6ccffa,_0x49554d),_0x6ccffa[_0xe8d0('0x8')][_0xfe8a4]['acwTimeout']*0x3e8);_0x6ccffa[_0xe8d0('0x9')][_0x49554d][_0xe8d0('0x2c')]=moment()[_0xe8d0('0x2d')](_0xe8d0('0x2e'));_0x6ccffa[_0xe8d0('0x9')][_0x49554d]['uniqueid']=_0x52818a;_0x6ccffa[_0xe8d0('0x9')][_0x49554d]['queue']=_0xfe8a4;_0x6ccffa['timers'][_0x49554d]['updateAcw']=function(){var _0x547a2b=getDiff(_0x6ccffa[_0xe8d0('0x9')][_0x49554d][_0xe8d0('0x2c')]);clearTimeout(_0x6ccffa['timers'][_0x49554d]['timer']);_0x6ccffa[_0xe8d0('0x9')][_0x49554d]['timer']=![];RpcVoiceAgentReport[_0xe8d0('0x2f')]({'acwtime':_0x547a2b},_0x6ccffa[_0xe8d0('0x9')][_0x49554d][_0xe8d0('0x30')],_0x49554d)[_0xe8d0('0x22')](function(_0x2277cf){logger['info'](_0xe8d0('0x31'),_0x52818a,_0x547a2b,_0x2277cf);})[_0xe8d0('0x32')](function(_0x402e90){logger[_0xe8d0('0x33')]('[%s][UPDATE][ERRORS:%s]',_0x52818a,_0x402e90);});delete _0x6ccffa[_0xe8d0('0x9')][_0x49554d];};}});}else{logger[_0xe8d0('0x26')]('[%s][INPAUSE][AGENT:%s][QUEUE:%s]',_0x52818a,_0x49554d,_0xfe8a4);}});}})[_0xe8d0('0x32')](function(_0x51be84){logger[_0xe8d0('0x33')]('[%s][TIMER:%s][AGENT:%s][QUEUE:%s]',_0x52818a,_0x6ccffa[_0xe8d0('0x8')][_0xfe8a4]['acwTimeout'],_0x49554d,_0xfe8a4);})[_0xe8d0('0x34')](function(){delete _0x6ccffa[_0xe8d0('0xa')][_0x52818a];});}catch(_0x1e2430){logger[_0xe8d0('0x33')]('[ACW][START]\x20%s',_0x1e2430[_0xe8d0('0x35')]);}};Acw[_0xe8d0('0x1b')][_0xe8d0('0x36')]=function(_0x516243){try{var _0x2a66f8=this;if(_0x2a66f8[_0xe8d0('0x9')][_0x516243]){_0x2a66f8[_0xe8d0('0x9')][_0x516243][_0xe8d0('0x2b')]=![];var _0x1ecd41=_0x2a66f8['timers'][_0x516243][_0xe8d0('0x30')];var _0x1828c5=_0x2a66f8[_0xe8d0('0x9')][_0x516243][_0xe8d0('0x37')];var _0x318106=_0x2a66f8[_0xe8d0('0x8')][_0x1828c5][_0xe8d0('0x2a')];logger[_0xe8d0('0x26')]('[TIMER][STOP][AGENT:%s]',_0x516243);RpcUser['saveUnpause'](this[_0xe8d0('0x23')][_0x516243]);RpcVoiceAgentReport[_0xe8d0('0x2f')]({'acwtime':_0x318106,'agentacw':!![]},_0x1ecd41,_0x516243)[_0xe8d0('0x22')](function(_0x377dc1){logger[_0xe8d0('0x26')]('[%s][UPDATE][ACWTIME:%s]',_0x1ecd41,_0x318106,_0x377dc1);})[_0xe8d0('0x32')](function(_0x4bd7a2){logger[_0xe8d0('0x33')](_0xe8d0('0x38'),_0x1ecd41,_0x4bd7a2);});}else{logger[_0xe8d0('0x33')]('[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer',_0x516243);if(_0x2a66f8[_0xe8d0('0x9')]){logger[_0xe8d0('0x26')](_0xe8d0('0x39'),JSON[_0xe8d0('0x3a')](_0x2a66f8[_0xe8d0('0x9')]));}}}catch(_0x484e27){logger['error']('[ACW][STOP]\x20%s',_0x484e27['message']);}};Acw[_0xe8d0('0x1b')]['syncAgentConnect']=function(_0x1e6e8f){try{if(this[_0xe8d0('0x8')][_0x1e6e8f[_0xe8d0('0x37')]]&&(this[_0xe8d0('0x8')][_0x1e6e8f[_0xe8d0('0x37')]][_0xe8d0('0x5')]||this[_0xe8d0('0x8')][_0x1e6e8f[_0xe8d0('0x37')]]['mandatoryDisposition'])){if(this[_0xe8d0('0x23')][_0x1e6e8f[_0xe8d0('0x1d')]]){this['channels'][_0x1e6e8f['uniqueid']]={'queue':_0x1e6e8f[_0xe8d0('0x37')],'interface':_0x1e6e8f[_0xe8d0('0x1d')],'destlinkedid':_0x1e6e8f[_0xe8d0('0x27')]};}}}catch(_0x481e99){logger[_0xe8d0('0x33')](_0xe8d0('0x3b'),_0x481e99['message']);}};Acw[_0xe8d0('0x1b')][_0xe8d0('0x17')]=function(_0x5370c9){try{if(this[_0xe8d0('0x8')][_0x5370c9[_0xe8d0('0x37')]]&&(this[_0xe8d0('0x8')][_0x5370c9[_0xe8d0('0x37')]][_0xe8d0('0x5')]||this[_0xe8d0('0x8')][_0x5370c9[_0xe8d0('0x37')]][_0xe8d0('0x1f')])){if(this['agents'][_0x5370c9[_0xe8d0('0x1d')]]){this[_0xe8d0('0xa')][_0x5370c9[_0xe8d0('0x30')]]={'queue':_0x5370c9[_0xe8d0('0x37')],'interface':_0x5370c9[_0xe8d0('0x1d')]};}}}catch(_0x330688){logger[_0xe8d0('0x33')](_0xe8d0('0x3c'),_0x330688[_0xe8d0('0x35')]);}};Acw[_0xe8d0('0x1b')][_0xe8d0('0xf')]=function(_0x3a5987){try{if(this['channels'][_0x3a5987[_0xe8d0('0x30')]]&&_[_0xe8d0('0x3d')](this[_0xe8d0('0xa')][_0x3a5987[_0xe8d0('0x30')]][_0xe8d0('0x3e')])){logger[_0xe8d0('0x26')](_0xe8d0('0x3f'),_0x3a5987['uniqueid']);this[_0xe8d0('0x1c')](_0x3a5987[_0xe8d0('0x30')]);}else if(this[_0xe8d0('0xa')][_0x3a5987[_0xe8d0('0x40')]]&&_['isUndefined'](this[_0xe8d0('0xa')][_0x3a5987['linkedid']][_0xe8d0('0x3e')])){logger[_0xe8d0('0x26')](_0xe8d0('0x41'),_0x3a5987[_0xe8d0('0x40')]);this[_0xe8d0('0x1c')](_0x3a5987[_0xe8d0('0x40')]);}}catch(_0x1646fb){logger['error'](_0xe8d0('0x42'),_0x1646fb['message']);}};Acw['prototype'][_0xe8d0('0x11')]=function(_0x5516ad){try{if(this[_0xe8d0('0xa')][_0x5516ad['uniqueid']]&&this[_0xe8d0('0xa')][_0x5516ad[_0xe8d0('0x30')]][_0xe8d0('0x3e')]){logger[_0xe8d0('0x26')]('[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]',_0x5516ad[_0xe8d0('0x30')]);this[_0xe8d0('0x1c')](_0x5516ad[_0xe8d0('0x30')]);}else if(this[_0xe8d0('0xa')][_0x5516ad[_0xe8d0('0x40')]]&&this['channels'][_0x5516ad[_0xe8d0('0x40')]][_0xe8d0('0x3e')]){logger[_0xe8d0('0x26')]('[%s][HANGUPATTENDEDTRANSFER:LINKEDID]',_0x5516ad[_0xe8d0('0x40')]);this['startAcw'](_0x5516ad['linkedid']);}}catch(_0x1bd329){logger[_0xe8d0('0x33')]('[ACW][syncHangup]\x20%s',_0x1bd329[_0xe8d0('0x35')]);}};Acw[_0xe8d0('0x1b')]['syncAttendedTransfer']=function(_0x2a54c1){try{if(!_[_0xe8d0('0x43')](this[_0xe8d0('0xa')][_0x2a54c1[_0xe8d0('0x44')]])){this['startAcw'](_0x2a54c1[_0xe8d0('0x44')]);if(this[_0xe8d0('0xa')][_0x2a54c1[_0xe8d0('0x45')]]){this[_0xe8d0('0xa')][_0x2a54c1['secondtransfereruniqueid']][_0xe8d0('0x3e')]=!![];this[_0xe8d0('0xa')][_0x2a54c1[_0xe8d0('0x46')]]=this[_0xe8d0('0xa')][_0x2a54c1[_0xe8d0('0x45')]];delete this[_0xe8d0('0xa')][_0x2a54c1['secondtransfereruniqueid']];}}else if(!_['isNil'](this[_0xe8d0('0xa')][_0x2a54c1['transfertargetuniqueid']])){this[_0xe8d0('0x1c')](_0x2a54c1[_0xe8d0('0x46')]);if(this['channels'][_0x2a54c1['origtransfereruniqueid']]){this[_0xe8d0('0xa')][_0x2a54c1['origtransfereruniqueid']][_0xe8d0('0x3e')]=!![];this['channels'][_0x2a54c1[_0xe8d0('0x44')]]=this[_0xe8d0('0xa')][_0x2a54c1[_0xe8d0('0x47')]];delete this['channels'][_0x2a54c1[_0xe8d0('0x47')]];}}}catch(_0x3cbc9f){logger['error'](_0xe8d0('0x48'),_0x3cbc9f['message']);}};Acw[_0xe8d0('0x1b')]['syncBlindTransfer']=function(_0x1a6de5){try{if(this[_0xe8d0('0xa')][_0x1a6de5[_0xe8d0('0x49')]]){logger[_0xe8d0('0x26')](_0xe8d0('0x4a'),JSON['stringify'](_0x1a6de5['transfereruniqueid']));this[_0xe8d0('0x1c')](_0x1a6de5['transfereruniqueid']);}else if(this[_0xe8d0('0xa')][_0x1a6de5[_0xe8d0('0x4b')]]){logger[_0xe8d0('0x26')](_0xe8d0('0x4c'),JSON[_0xe8d0('0x3a')](_0x1a6de5[_0xe8d0('0x4b')]));this[_0xe8d0('0x1c')](_0x1a6de5[_0xe8d0('0x4b')]);}}catch(_0x7557d9){logger[_0xe8d0('0x33')](_0xe8d0('0x4d'),_0x7557d9[_0xe8d0('0x35')]);}};Acw[_0xe8d0('0x1b')][_0xe8d0('0x4e')]=function(_0x22992f){try{if(this['voiceQueues'][_0x22992f[_0xe8d0('0x37')]]&&this[_0xe8d0('0x8')][_0x22992f[_0xe8d0('0x37')]][_0xe8d0('0x4f')]===_0xe8d0('0x50')){if(this['agents'][_0x22992f[_0xe8d0('0x1d')]]){logger[_0xe8d0('0x26')](_0xe8d0('0x51'),_0x22992f[_0xe8d0('0x30')],_0x22992f[_0xe8d0('0x1d')],_0x22992f[_0xe8d0('0x37')]);return RpcUser[_0xe8d0('0x28')](this[_0xe8d0('0x23')][_0x22992f[_0xe8d0('0x1d')]],_0xe8d0('0x52'),_0x22992f[_0xe8d0('0x30')]);}}}catch(_0xdb3e53){logger['error']('[ACW][syncAgentRingNoAnswer]\x20%s',_0xdb3e53[_0xe8d0('0x35')]);}};module['exports']=Acw; \ No newline at end of file diff --git a/server/services/ami/ami.js b/server/services/ami/ami.js index ca24793..0428792 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 _0x6c71=['Action','sippeerstatus','actionQueueSummary','queuesummary','actionCoreShowChannels','coreshowchannels','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','connect','shutdown','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','fullybooted','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','then','catch','close','exports','asterisk-manager','bluebird','moment','util','ami','../../config/environment','asterisk','port','username','password','keepConnected','promisify','action','error','format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','inspect','actionSipShowRegistry','sipshowregistry','actionDeviceStateList','devicestatelist','actionSipPeerStatus'];(function(_0x2eab6d,_0x1af423){var _0x493f2b=function(_0x3f9c79){while(--_0x3f9c79){_0x2eab6d['push'](_0x2eab6d['shift']());}};_0x493f2b(++_0x1af423);}(_0x6c71,0x132));var _0x16c7=function(_0x7299d0,_0x19edbf){_0x7299d0=_0x7299d0-0x0;var _0xc2fddb=_0x6c71[_0x7299d0];return _0xc2fddb;};'use strict';var Manager=require(_0x16c7('0x0'));var BPromise=require(_0x16c7('0x1'));var moment=require(_0x16c7('0x2'));var util=require(_0x16c7('0x3'));var _=require('lodash');var logger=require('../../config/logger')(_0x16c7('0x4'));var config=require(_0x16c7('0x5'));var ami=new Manager(config[_0x16c7('0x6')][_0x16c7('0x7')],config[_0x16c7('0x6')]['ip'],config[_0x16c7('0x6')][_0x16c7('0x8')],config[_0x16c7('0x6')][_0x16c7('0x9')],!![]);ami[_0x16c7('0xa')]();ami['Action']=BPromise[_0x16c7('0xb')](ami[_0x16c7('0xc')]);function error(_0x310ea5){logger[_0x16c7('0xd')](util[_0x16c7('0xe')](_0x16c7('0xf'),config[_0x16c7('0x6')]['username'],config[_0x16c7('0x6')]['ip'],config['asterisk'][_0x16c7('0x7')],util[_0x16c7('0x10')](_0x310ea5,![],null)));}function close(){logger[_0x16c7('0xd')](util[_0x16c7('0xe')]('Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s',config[_0x16c7('0x6')][_0x16c7('0x8')],config[_0x16c7('0x6')]['ip'],config[_0x16c7('0x6')][_0x16c7('0x7')]));}ami[_0x16c7('0x11')]=function(){return function(){return ami['Action']({'action':_0x16c7('0x12')});};};ami[_0x16c7('0x13')]=function(){return function(){return ami['Action']({'action':_0x16c7('0x14')});};};ami[_0x16c7('0x15')]=function(){return function(){return ami[_0x16c7('0x16')]({'action':_0x16c7('0x17')});};};ami[_0x16c7('0x18')]=function(){return function(){return ami[_0x16c7('0x16')]({'action':_0x16c7('0x19')});};};ami[_0x16c7('0x1a')]=function(){return function(){return ami['Action']({'action':_0x16c7('0x1b')});};};function connect(_0x23b90d){logger[_0x16c7('0x1c')](util[_0x16c7('0xe')](_0x16c7('0x1d'),config[_0x16c7('0x6')][_0x16c7('0x8')],config['asterisk']['ip'],config[_0x16c7('0x6')][_0x16c7('0x7')]));ami['once'](_0x16c7('0xd'),error);ami[_0x16c7('0x1e')]('close',close);}ami['on'](_0x16c7('0x1f'),connect);ami['on'](_0x16c7('0x20'),function(_0x157f0e){logger[_0x16c7('0x1c')](util['format'](_0x16c7('0x21'),config[_0x16c7('0x6')]['username'],config[_0x16c7('0x6')]['ip'],config[_0x16c7('0x6')][_0x16c7('0x7')],util[_0x16c7('0x10')](_0x157f0e,![],null)));});ami['on'](_0x16c7('0x22'),function(_0x3bd5e2){logger[_0x16c7('0x1c')](util[_0x16c7('0xe')](_0x16c7('0x23'),config[_0x16c7('0x6')][_0x16c7('0x8')],config[_0x16c7('0x6')]['ip'],config[_0x16c7('0x6')]['port']));return BPromise[_0x16c7('0x24')]()[_0x16c7('0x25')](ami[_0x16c7('0x11')]())[_0x16c7('0x25')](ami[_0x16c7('0x13')]())[_0x16c7('0x25')](ami[_0x16c7('0x15')]())[_0x16c7('0x25')](ami[_0x16c7('0x18')]())[_0x16c7('0x25')](ami[_0x16c7('0x1a')]())[_0x16c7('0x26')](function(_0x4074a7){console['log'](_0x4074a7);});});ami['once'](_0x16c7('0xd'),error);ami[_0x16c7('0x1e')](_0x16c7('0x27'),close);module[_0x16c7('0x28')]=ami; \ No newline at end of file +var _0xa261=['log','exports','asterisk-manager','util','lodash','../../config/environment','asterisk','port','username','promisify','action','error','format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','inspect','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','actionSipShowRegistry','Action','actionDeviceStateList','devicestatelist','actionSipPeerStatus','actionQueueSummary','queuesummary','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','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','then','catch'];(function(_0x23e7c1,_0x35110c){var _0x1add43=function(_0x238918){while(--_0x238918){_0x23e7c1['push'](_0x23e7c1['shift']());}};_0x1add43(++_0x35110c);}(_0xa261,0x146));var _0x1a26=function(_0x53769f,_0x370fa7){_0x53769f=_0x53769f-0x0;var _0xad5eed=_0xa261[_0x53769f];return _0xad5eed;};'use strict';var Manager=require(_0x1a26('0x0'));var BPromise=require('bluebird');var moment=require('moment');var util=require(_0x1a26('0x1'));var _=require(_0x1a26('0x2'));var logger=require('../../config/logger')('ami');var config=require(_0x1a26('0x3'));var ami=new Manager(config[_0x1a26('0x4')][_0x1a26('0x5')],config['asterisk']['ip'],config[_0x1a26('0x4')][_0x1a26('0x6')],config[_0x1a26('0x4')]['password'],!![]);ami['keepConnected']();ami['Action']=BPromise[_0x1a26('0x7')](ami[_0x1a26('0x8')]);function error(_0x28523f){logger[_0x1a26('0x9')](util[_0x1a26('0xa')](_0x1a26('0xb'),config[_0x1a26('0x4')][_0x1a26('0x6')],config[_0x1a26('0x4')]['ip'],config[_0x1a26('0x4')]['port'],util[_0x1a26('0xc')](_0x28523f,![],null)));}function close(){logger[_0x1a26('0x9')](util[_0x1a26('0xa')](_0x1a26('0xd'),config[_0x1a26('0x4')][_0x1a26('0x6')],config[_0x1a26('0x4')]['ip'],config[_0x1a26('0x4')][_0x1a26('0x5')]));}ami[_0x1a26('0xe')]=function(){return function(){return ami[_0x1a26('0xf')]({'action':'sipshowregistry'});};};ami[_0x1a26('0x10')]=function(){return function(){return ami['Action']({'action':_0x1a26('0x11')});};};ami[_0x1a26('0x12')]=function(){return function(){return ami[_0x1a26('0xf')]({'action':'sippeerstatus'});};};ami[_0x1a26('0x13')]=function(){return function(){return ami[_0x1a26('0xf')]({'action':_0x1a26('0x14')});};};ami[_0x1a26('0x15')]=function(){return function(){return ami[_0x1a26('0xf')]({'action':'coreshowchannels'});};};function connect(_0x4c7a59){logger[_0x1a26('0x16')](util['format'](_0x1a26('0x17'),config[_0x1a26('0x4')][_0x1a26('0x6')],config[_0x1a26('0x4')]['ip'],config[_0x1a26('0x4')][_0x1a26('0x5')]));ami[_0x1a26('0x18')]('error',error);ami[_0x1a26('0x18')](_0x1a26('0x19'),close);}ami['on'](_0x1a26('0x1a'),connect);ami['on'](_0x1a26('0x1b'),function(_0x3f1630){logger[_0x1a26('0x16')](util[_0x1a26('0xa')](_0x1a26('0x1c'),config[_0x1a26('0x4')][_0x1a26('0x6')],config[_0x1a26('0x4')]['ip'],config[_0x1a26('0x4')][_0x1a26('0x5')],util[_0x1a26('0xc')](_0x3f1630,![],null)));});ami['on'](_0x1a26('0x1d'),function(_0x5b8177){logger[_0x1a26('0x16')](util[_0x1a26('0xa')](_0x1a26('0x1e'),config['asterisk'][_0x1a26('0x6')],config['asterisk']['ip'],config['asterisk'][_0x1a26('0x5')]));return BPromise[_0x1a26('0x1f')]()[_0x1a26('0x20')](ami['actionSipShowRegistry']())[_0x1a26('0x20')](ami[_0x1a26('0x10')]())['then'](ami[_0x1a26('0x12')]())[_0x1a26('0x20')](ami[_0x1a26('0x13')]())[_0x1a26('0x20')](ami[_0x1a26('0x15')]())[_0x1a26('0x21')](function(_0x46033e){console[_0x1a26('0x22')](_0x46033e);});});ami['once'](_0x1a26('0x9'),error);ami[_0x1a26('0x18')](_0x1a26('0x19'),close);module[_0x1a26('0x23')]=ami; \ No newline at end of file diff --git a/server/services/ami/client.js b/server/services/ami/client.js index 04fc76b..3d7f4e7 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 _0x3f49=['rpc','memberReport','error','message','catch','exports','jayson/promise','bluebird','ami','client','Request','request'];(function(_0x5c7b85,_0x472d60){var _0x5baaf2=function(_0x1bf28a){while(--_0x1bf28a){_0x5c7b85['push'](_0x5c7b85['shift']());}};_0x5baaf2(++_0x472d60);}(_0x3f49,0x1ce));var _0x93f4=function(_0x3734c6,_0x14b5cb){_0x3734c6=_0x3734c6-0x0;var _0x2af15e=_0x3f49[_0x3734c6];return _0x2af15e;};'use strict';var jayson=require(_0x93f4('0x0'));var BPromise=require(_0x93f4('0x1'));var logger=require('../../config/logger')(_0x93f4('0x2'));var client=jayson[_0x93f4('0x3')]['http']({'port':0x2329});client[_0x93f4('0x4')]=function(_0x4cd0e0,_0x55ac63){return new BPromise(function(_0x3340ae,_0x5eadbe){return client[_0x93f4('0x5')](_0x4cd0e0,_0x55ac63)['then'](function(_0x442bef){logger['debug'](_0x93f4('0x6'),_0x93f4('0x7'),_0x4cd0e0,_0x55ac63,_0x442bef);if(_0x442bef[_0x93f4('0x8')]){logger[_0x93f4('0x8')]('rpc',_0x93f4('0x7'),_0x4cd0e0,_0x442bef[_0x93f4('0x8')][_0x93f4('0x9')],_0x55ac63);return _0x5eadbe(_0x442bef[_0x93f4('0x8')]['message']);}else{return _0x3340ae(_0x442bef['result']);}})[_0x93f4('0xa')](function(_0x13742d){logger[_0x93f4('0x8')](_0x93f4('0x6'),'memberReport',_0x4cd0e0,_0x13742d,_0x55ac63);return _0x5eadbe(_0x13742d);});});};module[_0x93f4('0xb')]=client; \ No newline at end of file +var _0x4392=['message','result','exports','jayson/promise','../../config/logger','ami','client','http','Request','request','then','debug','rpc','memberReport','error'];(function(_0x28e62e,_0x2a9bc9){var _0x4f33d6=function(_0x1ed914){while(--_0x1ed914){_0x28e62e['push'](_0x28e62e['shift']());}};_0x4f33d6(++_0x2a9bc9);}(_0x4392,0x1a7));var _0x2439=function(_0x287b93,_0x65d733){_0x287b93=_0x287b93-0x0;var _0x13ca78=_0x4392[_0x287b93];return _0x13ca78;};'use strict';var jayson=require(_0x2439('0x0'));var BPromise=require('bluebird');var logger=require(_0x2439('0x1'))(_0x2439('0x2'));var client=jayson[_0x2439('0x3')][_0x2439('0x4')]({'port':0x2329});client[_0x2439('0x5')]=function(_0x4f2c69,_0x5357e3){return new BPromise(function(_0x7afe3b,_0x3a743c){return client[_0x2439('0x6')](_0x4f2c69,_0x5357e3)[_0x2439('0x7')](function(_0x1ac8fa){logger[_0x2439('0x8')](_0x2439('0x9'),_0x2439('0xa'),_0x4f2c69,_0x5357e3,_0x1ac8fa);if(_0x1ac8fa[_0x2439('0xb')]){logger[_0x2439('0xb')]('rpc','memberReport',_0x4f2c69,_0x1ac8fa['error'][_0x2439('0xc')],_0x5357e3);return _0x3a743c(_0x1ac8fa[_0x2439('0xb')][_0x2439('0xc')]);}else{return _0x7afe3b(_0x1ac8fa[_0x2439('0xd')]);}})['catch'](function(_0x9585ca){logger[_0x2439('0xb')](_0x2439('0x9'),'memberReport',_0x4f2c69,_0x9585ca,_0x5357e3);return _0x3a743c(_0x9585ca);});});};module[_0x2439('0xe')]=client; \ No newline at end of file diff --git a/server/services/ami/dialer/action.js b/server/services/ami/dialer/action.js index 659829f..ff9b81a 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 _0xccc9=['dialCutDigit','number','substring','getQueue','util','lodash','moment','isNil','voiceQueue','uniqueid','name','Contact','phone','firstName','lastName','queue','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper','ContactFirstName','starttime','format','callback','callbackuniqueid','callbackat','originatecalleridnum','originatecalleridname','prototype','getCaller','\x22%s\x22\x20<%s>'];(function(_0x2bf5bd,_0x120787){var _0xc810c0=function(_0xba9dd3){while(--_0xba9dd3){_0x2bf5bd['push'](_0x2bf5bd['shift']());}};_0xc810c0(++_0x120787);}(_0xccc9,0xf4));var _0x9ccc=function(_0x254bd5,_0x5d1c69){_0x254bd5=_0x254bd5-0x0;var _0x4f5bfe=_0xccc9[_0x254bd5];return _0x4f5bfe;};'use strict';var util=require(_0x9ccc('0x0'));var _=require(_0x9ccc('0x1'));var moment=require(_0x9ccc('0x2'));function checkNameSurname(_0x509cee,_0x4f46be,_0xf888fd){var _0x4f341a='';if(!_[_0x9ccc('0x3')](_0x4f46be)&&'string'===typeof _0x4f46be){_0x4f341a+=_0x4f46be;}if(!_[_0x9ccc('0x3')](_0xf888fd)&&'string'===typeof _0xf888fd){_0x4f341a+='\x20'+_0xf888fd;}if(_0x4f341a!==''){return _0x4f341a;}return _0x509cee;}function Action(_0x32ce78,_0x1cefc9,_0x3c9d3c){this[_0x9ccc('0x4')]=_0x32ce78;this[_0x9ccc('0x5')]=_0x3c9d3c||undefined;this[_0x9ccc('0x6')]=checkNameSurname(_0x1cefc9[_0x9ccc('0x7')][_0x9ccc('0x8')],_0x1cefc9[_0x9ccc('0x7')][_0x9ccc('0x9')],_0x1cefc9[_0x9ccc('0x7')][_0x9ccc('0xa')]);this['number']=_0x1cefc9[_0x9ccc('0x7')][_0x9ccc('0x8')];this[_0x9ccc('0xb')]=_0x32ce78[_0x9ccc('0x6')];this[_0x9ccc('0xc')]=_0x1cefc9[_0x9ccc('0xc')]||![];this[_0x9ccc('0xd')]=_0x32ce78['type'];this['dialQueueTimeout']=_0x32ce78[_0x9ccc('0xe')]||0x3;this[_0x9ccc('0xf')]=_0x1cefc9[_0x9ccc('0xf')];this[_0x9ccc('0x10')]=_0x1cefc9[_0x9ccc('0x10')];this[_0x9ccc('0x11')]=_0x1cefc9[_0x9ccc('0x11')];this[_0x9ccc('0x12')]=_0x1cefc9[_0x9ccc('0x12')];this[_0x9ccc('0x13')]=_0x1cefc9[_0x9ccc('0x13')];this[_0x9ccc('0x14')]=_0x1cefc9['ListId'];this[_0x9ccc('0x15')]=_0x1cefc9[_0x9ccc('0x15')];this[_0x9ccc('0x16')]=_0x1cefc9[_0x9ccc('0x16')];this[_0x9ccc('0x17')]=_0x1cefc9['CampaignId'];this[_0x9ccc('0x18')]=_0x1cefc9['id'];this[_0x9ccc('0x19')]=_0x1cefc9[_0x9ccc('0x7')][_0x9ccc('0x9')]||'';this[_0x9ccc('0x1a')]=moment()[_0x9ccc('0x1b')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x9ccc('0x1c')]=_0x1cefc9[_0x9ccc('0x1c')];this['callbackuniqueid']=_0x1cefc9[_0x9ccc('0x1d')];this[_0x9ccc('0x1e')]=_0x1cefc9[_0x9ccc('0x1e')];this['recallme']=_0x1cefc9['recallme'];this[_0x9ccc('0x1f')]='';this[_0x9ccc('0x20')]='';}Action[_0x9ccc('0x21')][_0x9ccc('0x22')]=function(){return util['format'](_0x9ccc('0x23'),this[_0x9ccc('0x6')],this[_0x9ccc('0x4')][_0x9ccc('0x24')]>0x0?this[_0x9ccc('0x25')][_0x9ccc('0x26')](this['voiceQueue']['dialCutDigit']):this[_0x9ccc('0x25')]);};Action[_0x9ccc('0x21')][_0x9ccc('0x27')]=function(){return this[_0x9ccc('0xb')];};module['exports']=Action; \ No newline at end of file +var _0xf670=['ContactId','ListId','UserId','VoiceQueueId','ContactFirstName','starttime','format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','originatecalleridname','prototype','getCaller','\x22%s\x22\x20<%s>','dialCutDigit','getQueue','queue','exports','lodash','moment','string','isNil','voiceQueue','uniqueid','phone','Contact','firstName','lastName','number','name','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry'];(function(_0x208d75,_0x92d742){var _0x382d27=function(_0x3aaba3){while(--_0x3aaba3){_0x208d75['push'](_0x208d75['shift']());}};_0x382d27(++_0x92d742);}(_0xf670,0x8d));var _0x0f67=function(_0x1c510a,_0x1413a9){_0x1c510a=_0x1c510a-0x0;var _0x23cedd=_0xf670[_0x1c510a];return _0x23cedd;};'use strict';var util=require('util');var _=require(_0x0f67('0x0'));var moment=require(_0x0f67('0x1'));function checkNameSurname(_0x2c46c2,_0x125c60,_0x1a391c){var _0x3ee41b='';if(!_['isNil'](_0x125c60)&&_0x0f67('0x2')===typeof _0x125c60){_0x3ee41b+=_0x125c60;}if(!_[_0x0f67('0x3')](_0x1a391c)&&'string'===typeof _0x1a391c){_0x3ee41b+='\x20'+_0x1a391c;}if(_0x3ee41b!==''){return _0x3ee41b;}return _0x2c46c2;}function Action(_0x5d88c5,_0x444573,_0x20dc4e){this[_0x0f67('0x4')]=_0x5d88c5;this[_0x0f67('0x5')]=_0x20dc4e||undefined;this['name']=checkNameSurname(_0x444573['Contact'][_0x0f67('0x6')],_0x444573[_0x0f67('0x7')][_0x0f67('0x8')],_0x444573[_0x0f67('0x7')][_0x0f67('0x9')]);this[_0x0f67('0xa')]=_0x444573[_0x0f67('0x7')]['phone'];this['queue']=_0x5d88c5[_0x0f67('0xb')];this['active']=_0x444573[_0x0f67('0xc')]||![];this['type']=_0x5d88c5[_0x0f67('0xd')];this['dialQueueTimeout']=_0x5d88c5[_0x0f67('0xe')]||0x3;this[_0x0f67('0xf')]=_0x444573[_0x0f67('0xf')];this['countbusyretry']=_0x444573[_0x0f67('0x10')];this[_0x0f67('0x11')]=_0x444573[_0x0f67('0x11')];this[_0x0f67('0x12')]=_0x444573[_0x0f67('0x12')];this[_0x0f67('0x13')]=_0x444573[_0x0f67('0x13')];this[_0x0f67('0x14')]=_0x444573['ListId'];this[_0x0f67('0x15')]=_0x444573[_0x0f67('0x15')];this[_0x0f67('0x16')]=_0x444573[_0x0f67('0x16')];this['CampaignId']=_0x444573['CampaignId'];this['idHopper']=_0x444573['id'];this[_0x0f67('0x17')]=_0x444573['Contact'][_0x0f67('0x8')]||'';this[_0x0f67('0x18')]=moment()[_0x0f67('0x19')](_0x0f67('0x1a'));this[_0x0f67('0x1b')]=_0x444573[_0x0f67('0x1b')];this['callbackuniqueid']=_0x444573[_0x0f67('0x1c')];this[_0x0f67('0x1d')]=_0x444573[_0x0f67('0x1d')];this[_0x0f67('0x1e')]=_0x444573[_0x0f67('0x1e')];this[_0x0f67('0x1f')]='';this[_0x0f67('0x20')]='';}Action[_0x0f67('0x21')][_0x0f67('0x22')]=function(){return util[_0x0f67('0x19')](_0x0f67('0x23'),this['name'],this[_0x0f67('0x4')][_0x0f67('0x24')]>0x0?this[_0x0f67('0xa')]['substring'](this[_0x0f67('0x4')][_0x0f67('0x24')]):this[_0x0f67('0xa')]);};Action[_0x0f67('0x21')][_0x0f67('0x25')]=function(){return this[_0x0f67('0x26')];};module[_0x0f67('0x27')]=Action; \ No newline at end of file diff --git a/server/services/ami/dialer/agentComplete.js b/server/services/ami/dialer/agentComplete.js index a04f147..0927188 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 _0x363f=['answertime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','membername','reason','callback','callbackuniqueid','recallme','ContactId','ListId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','seconds','state','Answer','scheduledat','type','outbound','queue','countcongestionretry','countnoanswerretry','uniqueid','calleridname','name','calleridnum','starttime','responsetime'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x363f,0xc5));var _0xf363=function(_0x2e91c6,_0x319a42){_0x2e91c6=_0x2e91c6-0x0;var _0x35a25b=_0x363f[_0x2e91c6];return _0x35a25b;};'use strict';var util=require(_0xf363('0x0'));var _=require(_0xf363('0x1'));var moment=require(_0xf363('0x2'));function getSeconds(_0x3fb706,_0x174d39){var _0x39cb87=moment(_0x3fb706)['milliseconds'](0x0);var _0x5117fa=moment(_0x174d39)[_0xf363('0x3')](0x0);return _0x39cb87['diff'](_0x5117fa,_0xf363('0x4'));}function AgentComplete(_0x45d6fa,_0x373cbf){this[_0xf363('0x5')]=0x4;this['statedesc']=_0xf363('0x6');this[_0xf363('0x7')]=_0x45d6fa[_0xf363('0x7')];this['type']=_0x45d6fa[_0xf363('0x8')];this['campaigntype']=_0x45d6fa[_0xf363('0x8')]===_0xf363('0x9')?_0xf363('0xa'):_0x45d6fa['type'];this['countbusyretry']=_0x45d6fa['countbusyretry'];this[_0xf363('0xb')]=_0x45d6fa[_0xf363('0xb')];this[_0xf363('0xc')]=_0x45d6fa['countnoanswerretry'];this['countglobal']=_0x45d6fa['countbusyretry']+_0x45d6fa[_0xf363('0xb')]+_0x45d6fa['countnoanswerretry'];this[_0xf363('0xd')]=_0x373cbf[_0xf363('0xd')];this[_0xf363('0xe')]=_0x45d6fa[_0xf363('0xf')];this[_0xf363('0x10')]=_0x45d6fa['number'];this[_0xf363('0x11')]=_0x45d6fa['starttime'];this[_0xf363('0x12')]=_0x45d6fa[_0xf363('0x12')];this['answertime']=_0x45d6fa[_0xf363('0x13')];this[_0xf363('0x14')]=moment()[_0xf363('0x15')](_0xf363('0x16'));this[_0xf363('0x17')]=getSeconds(_0x45d6fa[_0xf363('0x12')],_0x45d6fa[_0xf363('0x11')]);this['holdtime']=getSeconds(_0x45d6fa[_0xf363('0x13')],_0x45d6fa[_0xf363('0x12')]);this['talktime']=getSeconds(this['endtime'],_0x45d6fa[_0xf363('0x13')]);this[_0xf363('0xa')]=_0x373cbf[_0xf363('0xa')];this[_0xf363('0x18')]=_0x373cbf[_0xf363('0x18')];this['reason']=_0x373cbf[_0xf363('0x19')];this[_0xf363('0x1a')]=_0x45d6fa[_0xf363('0x1a')];this[_0xf363('0x1b')]=_0x45d6fa[_0xf363('0x1b')];this['callbackat']=_0x45d6fa['callbackat'];this[_0xf363('0x1c')]=_0x45d6fa[_0xf363('0x1c')];this['ContactId']=_0x45d6fa[_0xf363('0x1d')];this['ListId']=_0x45d6fa[_0xf363('0x1e')];this['UserId']=_0x45d6fa['UserId'];this[_0xf363('0x1f')]=_0x45d6fa[_0xf363('0x1f')];this['CampaignId']=_0x45d6fa[_0xf363('0x20')];this[_0xf363('0x21')]=_0x45d6fa['originatecalleridnum']||'';this[_0xf363('0x22')]=_0x45d6fa[_0xf363('0x22')]||'';}module[_0xf363('0x23')]=AgentComplete; \ No newline at end of file +var _0x107a=['seconds','state','statedesc','Answer','type','campaigntype','outbound','queue','countcongestionretry','countnoanswerretry','countglobal','uniqueid','calleridname','name','calleridnum','starttime','responsetime','answertime','endtime','YYYY-MM-DD\x20HH:mm:ss','ringtime','talktime','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','milliseconds','diff'];(function(_0x1e4513,_0x4b67b7){var _0x4eebe9=function(_0xcc5cf7){while(--_0xcc5cf7){_0x1e4513['push'](_0x1e4513['shift']());}};_0x4eebe9(++_0x4b67b7);}(_0x107a,0x74));var _0xa107=function(_0x1718a0,_0x5744ed){_0x1718a0=_0x1718a0-0x0;var _0x2cc95=_0x107a[_0x1718a0];return _0x2cc95;};'use strict';var util=require(_0xa107('0x0'));var _=require(_0xa107('0x1'));var moment=require('moment');function getSeconds(_0x35fb96,_0x495550){var _0x5a163a=moment(_0x35fb96)[_0xa107('0x2')](0x0);var _0x335097=moment(_0x495550)[_0xa107('0x2')](0x0);return _0x5a163a[_0xa107('0x3')](_0x335097,_0xa107('0x4'));}function AgentComplete(_0x26a1f4,_0x312e04){this[_0xa107('0x5')]=0x4;this[_0xa107('0x6')]=_0xa107('0x7');this['scheduledat']=_0x26a1f4['scheduledat'];this[_0xa107('0x8')]=_0x26a1f4[_0xa107('0x8')];this[_0xa107('0x9')]=_0x26a1f4[_0xa107('0x8')]===_0xa107('0xa')?_0xa107('0xb'):_0x26a1f4[_0xa107('0x8')];this['countbusyretry']=_0x26a1f4['countbusyretry'];this[_0xa107('0xc')]=_0x26a1f4[_0xa107('0xc')];this[_0xa107('0xd')]=_0x26a1f4['countnoanswerretry'];this[_0xa107('0xe')]=_0x26a1f4['countbusyretry']+_0x26a1f4[_0xa107('0xc')]+_0x26a1f4[_0xa107('0xd')];this[_0xa107('0xf')]=_0x312e04[_0xa107('0xf')];this[_0xa107('0x10')]=_0x26a1f4[_0xa107('0x11')];this[_0xa107('0x12')]=_0x26a1f4['number'];this['starttime']=_0x26a1f4[_0xa107('0x13')];this['responsetime']=_0x26a1f4[_0xa107('0x14')];this[_0xa107('0x15')]=_0x26a1f4[_0xa107('0x15')];this[_0xa107('0x16')]=moment()['format'](_0xa107('0x17'));this[_0xa107('0x18')]=getSeconds(_0x26a1f4['responsetime'],_0x26a1f4[_0xa107('0x13')]);this['holdtime']=getSeconds(_0x26a1f4[_0xa107('0x15')],_0x26a1f4['responsetime']);this[_0xa107('0x19')]=getSeconds(this[_0xa107('0x16')],_0x26a1f4[_0xa107('0x15')]);this[_0xa107('0xb')]=_0x312e04['queue'];this[_0xa107('0x1a')]=_0x312e04[_0xa107('0x1a')];this['reason']=_0x312e04[_0xa107('0x1b')];this['callback']=_0x26a1f4[_0xa107('0x1c')];this[_0xa107('0x1d')]=_0x26a1f4[_0xa107('0x1d')];this[_0xa107('0x1e')]=_0x26a1f4[_0xa107('0x1e')];this[_0xa107('0x1f')]=_0x26a1f4[_0xa107('0x1f')];this['ContactId']=_0x26a1f4[_0xa107('0x20')];this[_0xa107('0x21')]=_0x26a1f4['ListId'];this[_0xa107('0x22')]=_0x26a1f4[_0xa107('0x22')];this[_0xa107('0x23')]=_0x26a1f4[_0xa107('0x23')];this['CampaignId']=_0x26a1f4[_0xa107('0x24')];this[_0xa107('0x25')]=_0x26a1f4[_0xa107('0x25')]||'';this[_0xa107('0x26')]=_0x26a1f4[_0xa107('0x26')]||'';}module[_0xa107('0x27')]=AgentComplete; \ No newline at end of file diff --git a/server/services/ami/dialer/final.js b/server/services/ami/dialer/final.js index ebd8a05..94a1a6b 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 _0xb89c=['talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','seconds','uniqueid','scheduledat','type','campaigntype','queue','countbusyretry','countcongestionretry','countnoanswerretry','calleridname','calleridnum','starttime','responsetime','endtime','ringtime','holdtime'];(function(_0x434c52,_0x260c4e){var _0x2da81f=function(_0x260b89){while(--_0x260b89){_0x434c52['push'](_0x434c52['shift']());}};_0x2da81f(++_0x260c4e);}(_0xb89c,0x198));var _0xcb89=function(_0x508309,_0x3caa5a){_0x508309=_0x508309-0x0;var _0x427024=_0xb89c[_0x508309];return _0x427024;};'use strict';var util=require(_0xcb89('0x0'));var _=require(_0xcb89('0x1'));var moment=require(_0xcb89('0x2'));function getSeconds(_0x2b561d,_0x524d2e){var _0x1fcb75=moment(_0x2b561d)[_0xcb89('0x3')](0x0);var _0x57c08c=moment(_0x524d2e)[_0xcb89('0x3')](0x0);return _0x1fcb75[_0xcb89('0x4')](_0x57c08c,_0xcb89('0x5'));}function Final(_0x50226a){this['uniqueid']=_0x50226a[_0xcb89('0x6')];this[_0xcb89('0x7')]=_0x50226a[_0xcb89('0x7')];this['type']=_0x50226a[_0xcb89('0x8')];this[_0xcb89('0x9')]=_0x50226a['type']==='outbound'?_0xcb89('0xa'):_0x50226a['type'];this[_0xcb89('0xb')]=_0x50226a[_0xcb89('0xb')];this[_0xcb89('0xc')]=_0x50226a[_0xcb89('0xc')];this[_0xcb89('0xd')]=_0x50226a[_0xcb89('0xd')];this['countglobal']=_0x50226a[_0xcb89('0xb')]+_0x50226a['countcongestionretry']+_0x50226a[_0xcb89('0xd')];this[_0xcb89('0xa')]=_0x50226a[_0xcb89('0xa')];this[_0xcb89('0xe')]=_0x50226a[_0xcb89('0xe')];this[_0xcb89('0xf')]=_0x50226a[_0xcb89('0xf')];this['starttime']=_0x50226a[_0xcb89('0x10')];this[_0xcb89('0x11')]=_0x50226a['responsetime'];this[_0xcb89('0x12')]=_0x50226a[_0xcb89('0x11')];this[_0xcb89('0x13')]=_0x50226a['ringtime']||0x0;this[_0xcb89('0x14')]=_0x50226a['holdtime']||0x0;this['talktime']=_0x50226a[_0xcb89('0x15')]||0x0;this[_0xcb89('0x16')]=_0x50226a[_0xcb89('0x16')];this[_0xcb89('0x17')]=_0x50226a[_0xcb89('0x17')];this[_0xcb89('0x18')]=_0x50226a[_0xcb89('0x18')];this[_0xcb89('0x19')]=_0x50226a['recallme'];this[_0xcb89('0x1a')]=_0x50226a[_0xcb89('0x1a')];this['ListId']=_0x50226a['ListId'];this[_0xcb89('0x1b')]=_0x50226a[_0xcb89('0x1b')];this[_0xcb89('0x1c')]=_0x50226a[_0xcb89('0x1c')];this[_0xcb89('0x1d')]=_0x50226a[_0xcb89('0x1d')];this[_0xcb89('0x1e')]=_0x50226a[_0xcb89('0x1e')]||'';this['originatecalleridname']=_0x50226a[_0xcb89('0x1f')]||'';}module[_0xcb89('0x20')]=Final; \ No newline at end of file +var _0xf446=['talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','moment','milliseconds','seconds','scheduledat','type','queue','countbusyretry','countcongestionretry','countnoanswerretry','calleridname','calleridnum','starttime','responsetime','ringtime','holdtime'];(function(_0x365d20,_0x5be188){var _0x5cd82a=function(_0x2bf1bf){while(--_0x2bf1bf){_0x365d20['push'](_0x365d20['shift']());}};_0x5cd82a(++_0x5be188);}(_0xf446,0x1c0));var _0x6f44=function(_0x1e4045,_0x464732){_0x1e4045=_0x1e4045-0x0;var _0x13bff3=_0xf446[_0x1e4045];return _0x13bff3;};'use strict';var util=require(_0x6f44('0x0'));var _=require('lodash');var moment=require(_0x6f44('0x1'));function getSeconds(_0x472aed,_0x520603){var _0x4b185d=moment(_0x472aed)['milliseconds'](0x0);var _0x13b43d=moment(_0x520603)[_0x6f44('0x2')](0x0);return _0x4b185d['diff'](_0x13b43d,_0x6f44('0x3'));}function Final(_0x5e6baf){this['uniqueid']=_0x5e6baf['uniqueid'];this[_0x6f44('0x4')]=_0x5e6baf['scheduledat'];this[_0x6f44('0x5')]=_0x5e6baf['type'];this['campaigntype']=_0x5e6baf[_0x6f44('0x5')]==='outbound'?_0x6f44('0x6'):_0x5e6baf[_0x6f44('0x5')];this[_0x6f44('0x7')]=_0x5e6baf[_0x6f44('0x7')];this[_0x6f44('0x8')]=_0x5e6baf[_0x6f44('0x8')];this[_0x6f44('0x9')]=_0x5e6baf[_0x6f44('0x9')];this['countglobal']=_0x5e6baf[_0x6f44('0x7')]+_0x5e6baf[_0x6f44('0x8')]+_0x5e6baf[_0x6f44('0x9')];this['queue']=_0x5e6baf[_0x6f44('0x6')];this[_0x6f44('0xa')]=_0x5e6baf[_0x6f44('0xa')];this[_0x6f44('0xb')]=_0x5e6baf['calleridnum'];this[_0x6f44('0xc')]=_0x5e6baf['starttime'];this[_0x6f44('0xd')]=_0x5e6baf['responsetime'];this['endtime']=_0x5e6baf[_0x6f44('0xd')];this[_0x6f44('0xe')]=_0x5e6baf[_0x6f44('0xe')]||0x0;this[_0x6f44('0xf')]=_0x5e6baf[_0x6f44('0xf')]||0x0;this[_0x6f44('0x10')]=_0x5e6baf[_0x6f44('0x10')]||0x0;this[_0x6f44('0x11')]=_0x5e6baf[_0x6f44('0x11')];this[_0x6f44('0x12')]=_0x5e6baf[_0x6f44('0x12')];this['callbackat']=_0x5e6baf[_0x6f44('0x13')];this[_0x6f44('0x14')]=_0x5e6baf[_0x6f44('0x14')];this[_0x6f44('0x15')]=_0x5e6baf[_0x6f44('0x15')];this['ListId']=_0x5e6baf[_0x6f44('0x16')];this['UserId']=_0x5e6baf[_0x6f44('0x17')];this['VoiceQueueId']=_0x5e6baf[_0x6f44('0x18')];this['CampaignId']=_0x5e6baf[_0x6f44('0x19')];this[_0x6f44('0x1a')]=_0x5e6baf[_0x6f44('0x1a')]||'';this[_0x6f44('0x1b')]=_0x5e6baf[_0x6f44('0x1b')]||'';}module[_0x6f44('0x1c')]=Final; \ No newline at end of file diff --git a/server/services/ami/dialer/hangup.js b/server/services/ami/dialer/hangup.js index aa71eb2..97b2ba0 100644 --- a/server/services/ami/dialer/hangup.js +++ b/server/services/ami/dialer/hangup.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['countglobal','countcongestionretry','countnoanswerretry','uniqueid','name','calleridnum','number','starttime','responsetime','endtime','YYYY-MM-DD\x20HH:mm:ss','talktime','membername','IVR','reason','cause-txt','callback','callbackuniqueid','callbackat','recallme','ContactId','UserId','VoiceQueueId','CampaignId','exports','util','lodash','moment','milliseconds','diff','seconds','state','statedesc','Answer','type','outbound','queue','countbusyretry'];(function(_0x16e5d1,_0x9cf085){var _0x3f72e6=function(_0x26c06a){while(--_0x26c06a){_0x16e5d1['push'](_0x16e5d1['shift']());}};_0x3f72e6(++_0x9cf085);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1c546c,_0x5c57cb){_0x1c546c=_0x1c546c-0x0;var _0x2cc384=_0xa9e0[_0x1c546c];return _0x2cc384;};'use strict';var util=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));function getSeconds(_0x5dd881,_0x550fbc){var _0x18d5c9=moment(_0x5dd881)['milliseconds'](0x0);var _0x333808=moment(_0x550fbc)[_0x0a9e('0x3')](0x0);return _0x18d5c9[_0x0a9e('0x4')](_0x333808,_0x0a9e('0x5'));}function Hangup(_0x981158,_0x57b080){this[_0x0a9e('0x6')]=0x4;this[_0x0a9e('0x7')]=_0x0a9e('0x8');this['scheduledat']=_0x981158['scheduledat'];this[_0x0a9e('0x9')]=_0x981158['type'];this['campaigntype']=_0x981158[_0x0a9e('0x9')]===_0x0a9e('0xa')?_0x0a9e('0xb'):_0x981158[_0x0a9e('0x9')];this[_0x0a9e('0xc')]=_0x981158[_0x0a9e('0xc')];this['countcongestionretry']=_0x981158['countcongestionretry'];this['countnoanswerretry']=_0x981158['countnoanswerretry'];this[_0x0a9e('0xd')]=_0x981158[_0x0a9e('0xc')]+_0x981158[_0x0a9e('0xe')]+_0x981158[_0x0a9e('0xf')];this[_0x0a9e('0x10')]=_0x57b080[_0x0a9e('0x10')];this['calleridname']=_0x981158[_0x0a9e('0x11')];this[_0x0a9e('0x12')]=_0x981158[_0x0a9e('0x13')];this[_0x0a9e('0x14')]=_0x981158[_0x0a9e('0x14')];this[_0x0a9e('0x15')]=_0x981158['responsetime'];this[_0x0a9e('0x16')]=moment()['format'](_0x0a9e('0x17'));this['ringtime']=getSeconds(_0x981158[_0x0a9e('0x15')],_0x981158[_0x0a9e('0x14')]);this['holdtime']=0x0;this[_0x0a9e('0x18')]=getSeconds(this['endtime'],_0x981158[_0x0a9e('0x15')]);this[_0x0a9e('0xb')]=_0x981158[_0x0a9e('0xb')];this[_0x0a9e('0x19')]=_0x0a9e('0x1a');this[_0x0a9e('0x1b')]=_0x57b080[_0x0a9e('0x1c')];this[_0x0a9e('0x1d')]=_0x981158[_0x0a9e('0x1d')];this[_0x0a9e('0x1e')]=_0x981158[_0x0a9e('0x1e')];this[_0x0a9e('0x1f')]=_0x981158['callbackat'];this[_0x0a9e('0x20')]=_0x981158[_0x0a9e('0x20')];this['ContactId']=_0x981158[_0x0a9e('0x21')];this['ListId']=_0x981158['ListId'];this[_0x0a9e('0x22')]=_0x981158[_0x0a9e('0x22')];this[_0x0a9e('0x23')]=_0x981158[_0x0a9e('0x23')];this['CampaignId']=_0x981158[_0x0a9e('0x24')];}module[_0x0a9e('0x25')]=Hangup; \ No newline at end of file +var _0xa9e0=['countglobal','countcongestionretry','countnoanswerretry','uniqueid','name','calleridnum','number','starttime','responsetime','endtime','YYYY-MM-DD\x20HH:mm:ss','talktime','membername','IVR','reason','cause-txt','callback','callbackuniqueid','callbackat','recallme','ContactId','UserId','VoiceQueueId','CampaignId','exports','util','lodash','moment','milliseconds','diff','seconds','state','statedesc','Answer','type','outbound','queue','countbusyretry'];(function(_0x4ed1d4,_0x512d9a){var _0x28e363=function(_0x2bdfb7){while(--_0x2bdfb7){_0x4ed1d4['push'](_0x4ed1d4['shift']());}};_0x28e363(++_0x512d9a);}(_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 getSeconds(_0x5dd881,_0x550fbc){var _0x18d5c9=moment(_0x5dd881)['milliseconds'](0x0);var _0x333808=moment(_0x550fbc)[_0x0a9e('0x3')](0x0);return _0x18d5c9[_0x0a9e('0x4')](_0x333808,_0x0a9e('0x5'));}function Hangup(_0x981158,_0x57b080){this[_0x0a9e('0x6')]=0x4;this[_0x0a9e('0x7')]=_0x0a9e('0x8');this['scheduledat']=_0x981158['scheduledat'];this[_0x0a9e('0x9')]=_0x981158['type'];this['campaigntype']=_0x981158[_0x0a9e('0x9')]===_0x0a9e('0xa')?_0x0a9e('0xb'):_0x981158[_0x0a9e('0x9')];this[_0x0a9e('0xc')]=_0x981158[_0x0a9e('0xc')];this['countcongestionretry']=_0x981158['countcongestionretry'];this['countnoanswerretry']=_0x981158['countnoanswerretry'];this[_0x0a9e('0xd')]=_0x981158[_0x0a9e('0xc')]+_0x981158[_0x0a9e('0xe')]+_0x981158[_0x0a9e('0xf')];this[_0x0a9e('0x10')]=_0x57b080[_0x0a9e('0x10')];this['calleridname']=_0x981158[_0x0a9e('0x11')];this[_0x0a9e('0x12')]=_0x981158[_0x0a9e('0x13')];this[_0x0a9e('0x14')]=_0x981158[_0x0a9e('0x14')];this[_0x0a9e('0x15')]=_0x981158['responsetime'];this[_0x0a9e('0x16')]=moment()['format'](_0x0a9e('0x17'));this['ringtime']=getSeconds(_0x981158[_0x0a9e('0x15')],_0x981158[_0x0a9e('0x14')]);this['holdtime']=0x0;this[_0x0a9e('0x18')]=getSeconds(this['endtime'],_0x981158[_0x0a9e('0x15')]);this[_0x0a9e('0xb')]=_0x981158[_0x0a9e('0xb')];this[_0x0a9e('0x19')]=_0x0a9e('0x1a');this[_0x0a9e('0x1b')]=_0x57b080[_0x0a9e('0x1c')];this[_0x0a9e('0x1d')]=_0x981158[_0x0a9e('0x1d')];this[_0x0a9e('0x1e')]=_0x981158[_0x0a9e('0x1e')];this[_0x0a9e('0x1f')]=_0x981158['callbackat'];this[_0x0a9e('0x20')]=_0x981158[_0x0a9e('0x20')];this['ContactId']=_0x981158[_0x0a9e('0x21')];this['ListId']=_0x981158['ListId'];this[_0x0a9e('0x22')]=_0x981158[_0x0a9e('0x22')];this[_0x0a9e('0x23')]=_0x981158[_0x0a9e('0x23')];this['CampaignId']=_0x981158[_0x0a9e('0x24')];}module[_0x0a9e('0x25')]=Hangup; \ No newline at end of file diff --git a/server/services/ami/dialer/history.js b/server/services/ami/dialer/history.js index 56492e9..53684ff 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 _0x1071=['lodash','milliseconds','seconds','uniqueid','scheduledat','type','queue','countbusyretry','countcongestionretry','countnoanswerretry','calleridname','name','calleridnum','number','starttime','responsetime','endtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util'];(function(_0x2bc400,_0x27208f){var _0x36ab53=function(_0x257660){while(--_0x257660){_0x2bc400['push'](_0x2bc400['shift']());}};_0x36ab53(++_0x27208f);}(_0x1071,0x173));var _0x1107=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x1071[_0x19e35c];return _0x3e1fe8;};'use strict';var util=require(_0x1107('0x0'));var _=require(_0x1107('0x1'));var moment=require('moment');function getSeconds(_0x194fcc,_0x467114){var _0x396455=moment(_0x194fcc)['milliseconds'](0x0);var _0x3f9eb4=moment(_0x467114)[_0x1107('0x2')](0x0);return _0x396455['diff'](_0x3f9eb4,_0x1107('0x3'));}function History(_0x4a4ef3){this[_0x1107('0x4')]=_0x4a4ef3[_0x1107('0x4')];this[_0x1107('0x5')]=_0x4a4ef3[_0x1107('0x5')]||undefined;this[_0x1107('0x6')]=_0x4a4ef3[_0x1107('0x6')];this['campaigntype']=_0x4a4ef3['type']==='outbound'?_0x1107('0x7'):_0x4a4ef3['type'];this['countbusyretry']=_0x4a4ef3[_0x1107('0x8')];this[_0x1107('0x9')]=_0x4a4ef3[_0x1107('0x9')];this[_0x1107('0xa')]=_0x4a4ef3[_0x1107('0xa')];this['countglobal']=_0x4a4ef3[_0x1107('0x8')]+_0x4a4ef3[_0x1107('0x9')]+_0x4a4ef3[_0x1107('0xa')];this[_0x1107('0x7')]=_0x4a4ef3[_0x1107('0x7')];this[_0x1107('0xb')]=_0x4a4ef3[_0x1107('0xc')];this[_0x1107('0xd')]=_0x4a4ef3[_0x1107('0xe')];this[_0x1107('0xf')]=_0x4a4ef3['starttime'];this['responsetime']=_0x4a4ef3[_0x1107('0x10')];this[_0x1107('0x11')]=_0x4a4ef3['responsetime'];this['ringtime']=getSeconds(_0x4a4ef3['responsetime'],_0x4a4ef3[_0x1107('0xf')]);this['holdtime']=0x0;this[_0x1107('0x12')]=0x0;this[_0x1107('0x13')]=_0x4a4ef3[_0x1107('0x13')];this[_0x1107('0x14')]=_0x4a4ef3['callbackuniqueid'];this[_0x1107('0x15')]=_0x4a4ef3['callbackat'];this['recallme']=_0x4a4ef3[_0x1107('0x16')];this[_0x1107('0x17')]=_0x4a4ef3[_0x1107('0x17')];this['ListId']=_0x4a4ef3[_0x1107('0x18')];this[_0x1107('0x19')]=_0x4a4ef3[_0x1107('0x19')];this['VoiceQueueId']=_0x4a4ef3[_0x1107('0x1a')];this['CampaignId']=_0x4a4ef3[_0x1107('0x1b')];this['originatecalleridnum']=_0x4a4ef3[_0x1107('0x1c')]||'';this[_0x1107('0x1d')]=_0x4a4ef3[_0x1107('0x1d')]||'';}module[_0x1107('0x1e')]=History; \ No newline at end of file +var _0xff0c=['ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','milliseconds','diff','seconds','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','calleridnum','starttime','responsetime','endtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xff0c,0xf7));var _0xcff0=function(_0xd2e2ab,_0x2440cf){_0xd2e2ab=_0xd2e2ab-0x0;var _0x1703a2=_0xff0c[_0xd2e2ab];return _0x1703a2;};'use strict';var util=require('util');var _=require('lodash');var moment=require('moment');function getSeconds(_0x28e820,_0x5a7063){var _0x3a1a1c=moment(_0x28e820)[_0xcff0('0x0')](0x0);var _0x109bce=moment(_0x5a7063)[_0xcff0('0x0')](0x0);return _0x3a1a1c[_0xcff0('0x1')](_0x109bce,_0xcff0('0x2'));}function History(_0x5793a5){this[_0xcff0('0x3')]=_0x5793a5['uniqueid'];this[_0xcff0('0x4')]=_0x5793a5['scheduledat']||undefined;this[_0xcff0('0x5')]=_0x5793a5[_0xcff0('0x5')];this[_0xcff0('0x6')]=_0x5793a5[_0xcff0('0x5')]===_0xcff0('0x7')?_0xcff0('0x8'):_0x5793a5[_0xcff0('0x5')];this[_0xcff0('0x9')]=_0x5793a5[_0xcff0('0x9')];this[_0xcff0('0xa')]=_0x5793a5[_0xcff0('0xa')];this[_0xcff0('0xb')]=_0x5793a5[_0xcff0('0xb')];this[_0xcff0('0xc')]=_0x5793a5[_0xcff0('0x9')]+_0x5793a5['countcongestionretry']+_0x5793a5['countnoanswerretry'];this[_0xcff0('0x8')]=_0x5793a5[_0xcff0('0x8')];this['calleridname']=_0x5793a5['name'];this[_0xcff0('0xd')]=_0x5793a5['number'];this['starttime']=_0x5793a5[_0xcff0('0xe')];this[_0xcff0('0xf')]=_0x5793a5[_0xcff0('0xf')];this[_0xcff0('0x10')]=_0x5793a5[_0xcff0('0xf')];this['ringtime']=getSeconds(_0x5793a5[_0xcff0('0xf')],_0x5793a5['starttime']);this[_0xcff0('0x11')]=0x0;this[_0xcff0('0x12')]=0x0;this[_0xcff0('0x13')]=_0x5793a5[_0xcff0('0x13')];this['callbackuniqueid']=_0x5793a5[_0xcff0('0x14')];this[_0xcff0('0x15')]=_0x5793a5[_0xcff0('0x15')];this[_0xcff0('0x16')]=_0x5793a5[_0xcff0('0x16')];this[_0xcff0('0x17')]=_0x5793a5[_0xcff0('0x17')];this[_0xcff0('0x18')]=_0x5793a5[_0xcff0('0x18')];this['UserId']=_0x5793a5[_0xcff0('0x19')];this[_0xcff0('0x1a')]=_0x5793a5[_0xcff0('0x1a')];this[_0xcff0('0x1b')]=_0x5793a5[_0xcff0('0x1b')];this[_0xcff0('0x1c')]=_0x5793a5[_0xcff0('0x1c')]||'';this[_0xcff0('0x1d')]=_0x5793a5['originatecalleridname']||'';}module['exports']=History; \ No newline at end of file diff --git a/server/services/ami/dialer/index.js b/server/services/ami/dialer/index.js index ae0dd2e..b6dab93 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 _0x62ea=['[rescheduleContact][NoAnswer]','dialBusyMaxRetry','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','countcongestionretry','dialCongestionMaxRetry','[rescheduleContact]\x20[Congestion]','[callProgressDetecting]','entity\x20is\x20undefine','evt\x20is\x20undefine','[syncAgentComplete][createHistory][0]','countnoanswerretry','stateGlobal','createStateFinal','reason\x200\x20no\x20such\x20number....','NoAnswer','countglobal','reason\x203\x20ringing\x20no\x20answer','reason\x205\x20busy','Congestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','[syncAgentComplete][createHistory][?]','Global','dialPredictiveOptimizationPercentage','round','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','floor','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','check\x20handlePredictive\x20is\x20not\x20undefine','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','dropRate','Dropped\x20calls\x20day','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','started\x20in\x20predictive\x20at','startMethodPredictive','recalculate\x20predictive\x20at','getDataPredictive','Predictive\x20for\x20every\x20interval',')\x20are\x20less\x20than\x20threshold\x20(','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20more\x20than\x20threshold\x20(','abandonmentRate','agentBusyFactor','busyFactor','[getDataPredictive]','check\x20failure','getDataPredictiveOld','outboundQueuePauses','[CatchErlangB]','one\x20call\x20every:','[handlePredictive]','fail\x20to\x20scheduled\x20calls','checkContactBlack','recallme','[booked][checkContactBlack]','queueStatusComplete:\x20','Queue:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','scheduledat','dialRecallInQueue','RECALLINQUEUE','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALLFAILEDTIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose]','BLACKLIST','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','inBlackList','handleIvr','limitCalls','temp','dialOrderByScheduledAt','AVAILABLE_CONTACTS_FINISHED','[getContactCampaign2][Empty]','RUNNING','ivrTotalCallsDays','[actionOriginate]\x20','Contact.phone','loggerHandler','[getContactCampaign2]','dialLimitQueue','ACTIVE','[getContactDialer2]','[handlePredictive][limitChannel]','not_inuse','[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','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','m\x20=\x20','Ts\x20=\x20','p\x20=\x20','Amax\x20=\x20','----\x20Agent\x20Busy\x20Factor\x20----','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','interval\x20=\x20','Umin\x20=\x20','exports','util','lodash','uuid','md5','ioredis','../../../config/logger','dialer','predictive','predictiveCalls','../ami','redis','localhost','socket.io-emitter','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/cmHopperBlack','./action','./history','./final','env','XCALLY_IP_AGI','127.0.0.1','rrmemory','roundrobin','prototype','enqueue','tail','finally','sequence','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','actions','contactsId','uniqueId','startPredictive','startProgressive','ivrOriginated','queueBooked','queueBookedRR','agentconnect','syncAgentConnect','bind','queuecallerabandon','syncOriginateResponse','agentcomplete','syncAgentComplete','custom:queuesummary','syncQueueSummary','hangup','syncHangup','newexten','syncNewExten','syncVarSet','queuemember','syncQueueMember','queuestatuscomplete','syncQueueStatusComplete','loopClearZombieChannels','isUndefined','message','NOT_ACTIVE','name','INTERVAL_IS_NULL','\x20INTERVAL_IS_NULL','Interval','isEmpty','[ifTime][Action]','stringify','milliseconds','diff','seconds','emit','type','strategy','answered','available','loggedIn','pTalking','sumDuration','total','unmanaged','abandoned','waiting','dialActive','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangBusyFactor','Trunk','callerid','format','voice:queue:%s','campaign:ivr:%s','campaign:save','-----\x20Stats\x20Predictive\x20---','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\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','---------------------------','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','---------\x20ErlangB\x20---------','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangAbandonmentRate','merge','clearing\x20variable\x20start\x20progressive','clearing\x20variable\x20start\x20predictive','handlePredictive','clearing\x20variable\x20handle\x20predictive','outbound','preview','string','\x22%s\x22\x20<%s>','\x22\x22\x20<>','error','inspect','length','hasOwnProperty','[decremetOriginate]\x20object\x20originated\x20is\x20negative','[decremetOriginate]\x20is\x20null\x20or\x20undefined','contactsRescheduled','RESCHEDULED_CONTACTS','[getContactDialer2][ReScheduled]','contacts','talking','sendMessageOneNotActive','is\x20not\x20active','IS_DISACTIVED','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20disactive','state','statedesc','starttime','clearZombieChannels','[uniqueid]','[actions]','isNil','Action','status','catch','No\x20such\x20channel','ivr','updateOriginated','queue','[Dialer][checkChannel]','[Dialer][checkChannel][ivr]','countReScheduled','resolve','then','[countReScheduled]\x20','checkIsBlackList','[checkIsBlackList]\x20','checkIsBlackListIvr','averageHandleTime','avgHandleTime','rescheduleContact','[rescheduleContact]\x20','getContactDialer','[getContactDialer]\x20','getContactDialerIvr','getVoiceQueueRtPauses','moveContactManagedDialer','[moveContactManagedDialer]\x20','createHistory','[createHistory]\x20','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','emptyContact','saveInDb','pick','ContactId','UserId','CampaignId','[emptyContact][createHistory]','isSuccess','Success','active','SIP/%s','reachable','unmonitored','uniqueid','amdstatus','xcally-motion-dialer','value','HANGUP','HangupInAMD','membername','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','dialAMDActive','MACHINE','outboundAnswerCallsDay','AMD','amd','[syncMachine][createHistory]','[syncMachine]','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','Machine','[syncMachineIvr][createHistory]','ivrAnswerCallsDay','[syncHangupIvr]','AnswerAGI','AGI','[syncHangupIvr][createHistory]','cause-txt','Unknow','reason','agent','dialQueueProject2','dialAgiAfterHangupAgent','YYYY-MM-DD\x20HH:mm:ss','[syncAgentComplete]','answertime','[syncAgentComplete][createHistory]','[syncQueueCallerAbandon]\x20[Drop]','syncQueueCallerAbandon','droptime','responsetime','dialQueueTimeout','outboundDropCallsDayTimeout','Drop','dropreason','agiafterat','queueCallerAbandonCreateState','Abandoned','CALLEREXIT','channel','actionid','locked','paused','stateinterface','idHopper','queueStatusComplete','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','run','[Catch][Preview][syncQueueStatusComplete]','ListId','VoiceQueueId','[unlock][syncQueueStatusComplete]','_rr','unlockRR','[booked][RR]','contactAgent-idHopper:\x20','[booked][RR][finaly]','Agent:\x20','[booked][unlock]','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','loopCampaigns','syncCampaigns','isTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','checkIfTime','ifTime','checkIfTimeIntervals','Failure','\x20Intervals\x20is\x20null\x20','INTERVAL_IS_EMPTY','timezones','TIMEZONE_UNKNOW','\x20Timezone\x20unknow\x20','isArray','push','command','iftime\x20%s,%s','interval','true','content','indexOf','all','some','GLOBAL_INTERVAL_IS_OVERTIME','INTERVAL_IS_OVERTIME','[ifTime][promiseAll]','\x20Interval\x20is\x20overtime:\x20','checkDialMethod','dialMethod','progressive','power','handlePower','dialPowerLevel','booked','Queue','launchHandleIvr','checkIsTrunkReachable','dialGlobalInterval','dialTimezone','pow','replace','random','match','actionOriginate','object','voiceQueue\x20is\x20undefine','phone','originate','getCaller','\x22agi://%s/square,%s\x22','dialQueueProject','NONE','\x22%s,%s%s,,,%s\x22','dialQueueOptions','dialAMDInitialSilence','XMD-AMDGREETING','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','Contact','createdAt','updatedAt','XMD-','toUpper','dialRandomLastDigitCallerIdNumber','XMD-ORIGINATECALLERIDNAME','originatecalleridname','XMD-ORIGINATECALLERIDNUM','originatecalleridnum','SIP/%s/%s%s','dialCutDigit','substring','from-sip','[originateError]:\x20%s','OriginateError','endtime','[originate][error]','Error','getQueue','response','callProgressDetecting','[callProgressDetecting]\x20','checkRetriveMax','countbusyretry','dialGlobalMaxRetry','dialNoAnswerMaxRetry','add','dialNoAnswerRetryFrequency','minutes'];(function(_0x4ff4a0,_0x3c53ce){var _0x5f1946=function(_0x15565c){while(--_0x15565c){_0x4ff4a0['push'](_0x4ff4a0['shift']());}};_0x5f1946(++_0x3c53ce);}(_0x62ea,0x71));var _0xa62e=function(_0x401609,_0x5eb61d){_0x401609=_0x401609-0x0;var _0x35fd57=_0x62ea[_0x401609];return _0x35fd57;};'use strict';var util=require(_0xa62e('0x0'));var _=require(_0xa62e('0x1'));var BPromise=require('bluebird');var uuid=require(_0xa62e('0x2'));var moment=require('moment');var rr=require('rr');var md5=require(_0xa62e('0x3'));var Redis=require(_0xa62e('0x4'));var config=require('../../../config/environment/');var logger=require(_0xa62e('0x5'))(_0xa62e('0x6'));var loggerBooked=require(_0xa62e('0x5'))('booked');var loggerPredictive=require('../../../config/logger')(_0xa62e('0x7'));var loggerPredictiveCalls=require(_0xa62e('0x5'))(_0xa62e('0x8'));var loggerSyncQueueSummary=require(_0xa62e('0x5'))('syncQueueSummary');var ami=require(_0xa62e('0x9'));config[_0xa62e('0xa')]=_['defaults'](config['redis'],{'host':_0xa62e('0xb'),'port':0x18eb});var io=require(_0xa62e('0xc'))(new Redis(config[_0xa62e('0xa')]));var cmHopper=require(_0xa62e('0xd'));var cmHopperFinal=require('../rpc/cmHopperFinal');var cmHopperHistory=require(_0xa62e('0xe'));var cmHopperBlack=require(_0xa62e('0xf'));var voiceQueueRt=require('../rpc/voiceQueueRt');var Action=require(_0xa62e('0x10'));var History=require(_0xa62e('0x11'));var Final=require(_0xa62e('0x12'));var AgentComplete=require('./agentComplete');var QueueCallerAbandon=require('./queueCallerAbandon');var Hangup=require('./hangup');var ipAgi=process[_0xa62e('0x13')][_0xa62e('0x14')]||_0xa62e('0x15');var strategy={'rrmemory':_0xa62e('0x16'),'roundrobin':_0xa62e('0x17')};var Sequence=function(){};Sequence[_0xa62e('0x18')][_0xa62e('0x19')]=function(_0x3bb087){this[_0xa62e('0x1a')]=this[_0xa62e('0x1a')]?this[_0xa62e('0x1a')][_0xa62e('0x1b')](_0x3bb087):_0x3bb087();};function Dialer(_0x5b3820,_0x3804f2){this[_0xa62e('0x1c')]=new Sequence();this['preview']=_0x3804f2;this[_0xa62e('0x1d')]=_0x5b3820[_0xa62e('0x1d')];this[_0xa62e('0x1e')]=_0x5b3820[_0xa62e('0x1e')];this[_0xa62e('0x1f')]=_0x5b3820[_0xa62e('0x1f')];this['trunks']=_0x5b3820[_0xa62e('0x20')];this[_0xa62e('0x21')]=config[_0xa62e('0x21')]||0x2;this[_0xa62e('0x22')]={};this[_0xa62e('0x23')]={};this[_0xa62e('0x24')]={};this[_0xa62e('0x25')]={};this['optionPredictive']={};this[_0xa62e('0x26')]={};this[_0xa62e('0x27')]={};this[_0xa62e('0x28')]={};this[_0xa62e('0x29')]={};this[_0xa62e('0x2a')]={};ami['on'](_0xa62e('0x2b'),this[_0xa62e('0x2c')][_0xa62e('0x2d')](this));ami['on'](_0xa62e('0x2e'),this['syncQueueCallerAbandon'][_0xa62e('0x2d')](this));ami['on']('originateresponse',this[_0xa62e('0x2f')][_0xa62e('0x2d')](this));ami['on'](_0xa62e('0x30'),this[_0xa62e('0x31')][_0xa62e('0x2d')](this));ami['on'](_0xa62e('0x32'),this[_0xa62e('0x33')]['bind'](this));ami['on'](_0xa62e('0x34'),this[_0xa62e('0x35')][_0xa62e('0x2d')](this));ami['on'](_0xa62e('0x36'),this[_0xa62e('0x37')][_0xa62e('0x2d')](this));ami['on']('varset',this[_0xa62e('0x38')][_0xa62e('0x2d')](this));ami['on'](_0xa62e('0x39'),this[_0xa62e('0x3a')][_0xa62e('0x2d')](this));ami['on'](_0xa62e('0x3b'),this[_0xa62e('0x3c')][_0xa62e('0x2d')](this));this['loopCampaigns']();this[_0xa62e('0x3d')]();}function isNotNull(_0xd9fcc4){return _0xd9fcc4!==null&&!_[_0xa62e('0x3e')](_0xd9fcc4);}function checkIsLoggedIn(_0x44eb4d,_0x571474){return function(){if(_0x571474<=0x0){_0x44eb4d[_0xa62e('0x3f')]='AGENTS_NOT_LOGGED';throw _0x44eb4d['name']+'\x20AGENTS\x20NOT\x20LOGGED';}};}function isActive(_0x3a168b){return _0x3a168b;}function checkIsActive(_0x4ed9ee,_0x4a8706){return function(){if(!isActive(_0x4a8706)){_0x4ed9ee['message']=_0xa62e('0x40');throw _0x4ed9ee[_0xa62e('0x41')]+'\x20NOT\x20Active';}};}function checkInterval(_0x703338){return function(){if(!isNotNull(_0x703338['Interval'])){_0x703338[_0xa62e('0x3f')]=_0xa62e('0x42');throw _0x703338[_0xa62e('0x41')]+_0xa62e('0x43');}if(!isNotNull(_0x703338[_0xa62e('0x44')]['Intervals'])){_0x703338[_0xa62e('0x3f')]=_0xa62e('0x42');throw _0x703338[_0xa62e('0x41')]+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_[_0xa62e('0x45')](_0x703338[_0xa62e('0x44')]['Intervals']))){_0x703338[_0xa62e('0x3f')]='INTERVAL_IS_NULL';throw _0x703338[_0xa62e('0x41')]+_0xa62e('0x43');}};}function msgResponse(_0x514fc3,_0x2cffa4,_0x2f078e){return{'action':_0x514fc3,'response':_0x2cffa4,'message':_0x2f078e,'stack':_0x2f078e};}function myreject(_0x1c0316){return function(_0x255824){return _0x1c0316(msgResponse(_0xa62e('0x46'),'Error',JSON[_0xa62e('0x47')](_0x255824)));};}function getSeconds(_0x402460,_0x224cdf){var _0x3b37dd=moment(_0x402460)[_0xa62e('0x48')](0x0);var _0x38ccb9=moment(_0x224cdf)[_0xa62e('0x48')](0x0);return _0x3b37dd[_0xa62e('0x49')](_0x38ccb9,_0xa62e('0x4a'));}function emit(_0x447496,_0x12bb3a,_0x3c15f3){io['to'](_0x447496)[_0xa62e('0x4b')](_0x12bb3a,_0x3c15f3);}function emitVoiceQueueSummary(_0xfc6865){if(_0xfc6865[_0xa62e('0x4c')]==='outbound'){var _0x1b61ce={'id':_0xfc6865['id'],'name':_0xfc6865['name'],'strategy':_0xfc6865[_0xa62e('0x4d')],'answered':_0xfc6865[_0xa62e('0x4e')],'available':_0xfc6865[_0xa62e('0x4f')],'loggedIn':_0xfc6865[_0xa62e('0x50')],'pTalking':_0xfc6865[_0xa62e('0x51')],'sumBillable':_0xfc6865['sumBillable'],'sumDuration':_0xfc6865[_0xa62e('0x52')],'sumHoldTime':_0xfc6865['sumHoldTime']||0x0,'talking':_0xfc6865['talking'],'total':_0xfc6865[_0xa62e('0x53')],'type':_0xfc6865['type'],'unmanaged':_0xfc6865[_0xa62e('0x54')],'abandoned':_0xfc6865[_0xa62e('0x55')],'waiting':_0xfc6865[_0xa62e('0x56')],'loggedInDb':_0xfc6865['loggedInDb'],'dialActive':_0xfc6865[_0xa62e('0x57')],'dialMethod':_0xfc6865['dialMethod'],'dialOriginateCallerIdName':_0xfc6865[_0xa62e('0x58')],'dialOriginateCallerIdNumber':_0xfc6865[_0xa62e('0x59')],'dialOriginateTimeout':_0xfc6865[_0xa62e('0x5a')],'dialPrefix':_0xfc6865[_0xa62e('0x5b')],'outboundAnswerAgiCallsDay':_0xfc6865[_0xa62e('0x5c')],'outboundAnswerCallsDay':_0xfc6865['outboundAnswerCallsDay'],'outboundBlacklistCallsDay':_0xfc6865[_0xa62e('0x5d')],'outboundBusyCallsDay':_0xfc6865[_0xa62e('0x5e')],'outboundCongestionCallsDay':_0xfc6865[_0xa62e('0x5f')],'outboundDropCallsDayACS':_0xfc6865[_0xa62e('0x60')],'outboundDropCallsDayCallersExit':_0xfc6865[_0xa62e('0x61')],'outboundDropCallsDayTimeout':_0xfc6865['outboundDropCallsDayTimeout'],'outboundNoAnswerCallsDay':_0xfc6865[_0xa62e('0x62')],'outboundNoSuchCallsDay':_0xfc6865[_0xa62e('0x63')],'outboundOriginateFailureCallsDay':_0xfc6865[_0xa62e('0x64')],'outboundReCallsDay':_0xfc6865[_0xa62e('0x65')],'outboundRejectCallsDay':_0xfc6865['outboundRejectCallsDay'],'outboundUnknownCallsDay':_0xfc6865[_0xa62e('0x66')],'predictiveIntervalAnsweredCalls':_0xfc6865[_0xa62e('0x67')],'predictiveIntervalAvgHoldtime':_0xfc6865[_0xa62e('0x68')],'predictiveIntervalAvgTalktime':_0xfc6865[_0xa62e('0x69')],'predictiveIntervalDroppedCallsCallersExit':_0xfc6865[_0xa62e('0x6a')],'predictiveIntervalDroppedCallsTimeout':_0xfc6865[_0xa62e('0x6b')],'predictiveIntervalErlangCalls':_0xfc6865['predictiveIntervalErlangCalls'],'predictiveIntervalErlangCallsDroppedCalls':_0xfc6865[_0xa62e('0x6c')],'predictiveIntervalHitRate':_0xfc6865[_0xa62e('0x6d')],'predictiveIntervalMultiplicativeFactor':_0xfc6865[_0xa62e('0x6e')],'predictiveIntervalPauses':_0xfc6865[_0xa62e('0x6f')],'predictiveIntervalAvailable':_0xfc6865[_0xa62e('0x70')],'predictiveIntervalTotalCalls':_0xfc6865[_0xa62e('0x71')],'message':_0xfc6865[_0xa62e('0x3f')],'originated':_0xfc6865[_0xa62e('0x72')],'erlangCalls':_0xfc6865[_0xa62e('0x73')],'erlangCallToSecond':_0xfc6865[_0xa62e('0x74')],'erlangAbandonmentRate':_0xfc6865['erlangAbandonmentRate'],'erlangBusyFactor':_0xfc6865[_0xa62e('0x75')],'startPredictive':_0xfc6865['startPredictive'],'startProgressive':_0xfc6865[_0xa62e('0x27')]};if(_0xfc6865[_0xa62e('0x76')]){_0x1b61ce[_0xa62e('0x76')]={'id':_0xfc6865[_0xa62e('0x76')]['id'],'name':_0xfc6865[_0xa62e('0x76')][_0xa62e('0x41')],'active':_0xfc6865[_0xa62e('0x76')]['active'],'callerid':_0xfc6865[_0xa62e('0x76')][_0xa62e('0x77')]};}if(_0xfc6865['Interval']){_0x1b61ce[_0xa62e('0x44')]={'id':_0xfc6865[_0xa62e('0x44')]['id'],'name':_0xfc6865[_0xa62e('0x44')]['name']};}var _0x6f0a24=md5(JSON['stringify'](_0x1b61ce));if(_0xfc6865[_0xa62e('0x3')]!==_0x6f0a24){_0xfc6865['md5']=_0x6f0a24;emit(util[_0xa62e('0x78')](_0xa62e('0x79'),_0x1b61ce[_0xa62e('0x41')]),'voice_queue:save',_0x1b61ce);}}}function emitCampaignSummary(_0x2b7fc3){if(_0x2b7fc3[_0xa62e('0x4c')]==='ivr'){emit(util[_0xa62e('0x78')](_0xa62e('0x7a'),_0x2b7fc3['name']),_0xa62e('0x7b'),_0x2b7fc3);}}function checkGetDataPredictive(_0x54b7b3){if(isNotNull(_0x54b7b3)){if(!_['isEmpty'](_0x54b7b3)){loggerPredictive['info'](_0xa62e('0x7c'));loggerPredictive[_0xa62e('0x7d')](_0xa62e('0x7e'),_0x54b7b3['predictiveIntervalTotalCalls']);loggerPredictive[_0xa62e('0x7d')](_0xa62e('0x7f'),_0x54b7b3[_0xa62e('0x67')]);loggerPredictive[_0xa62e('0x7d')](_0xa62e('0x80'),_0x54b7b3[_0xa62e('0x6b')]);loggerPredictive['info'](_0xa62e('0x81'),_0x54b7b3[_0xa62e('0x6a')]);loggerPredictive[_0xa62e('0x7d')]('AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x54b7b3[_0xa62e('0x68')]);loggerPredictive[_0xa62e('0x7d')](_0xa62e('0x82'),_0x54b7b3['predictiveIntervalAvgTalktime']);loggerPredictive[_0xa62e('0x7d')](_0xa62e('0x83'));if(_0x54b7b3['predictiveIntervalTotalCalls']>0x0){if(!_['isUndefined'](_0x54b7b3[_0xa62e('0x69')])&&_0x54b7b3[_0xa62e('0x69')]>0x0){return!![];}else{loggerPredictive[_0xa62e('0x7d')](_0xa62e('0x84'));}if(!_['isUndefined'](_0x54b7b3[_0xa62e('0x68')])&&_0x54b7b3[_0xa62e('0x68')]>0x0){return!![];}else{loggerPredictive[_0xa62e('0x7d')](_0xa62e('0x85'));}}else{loggerPredictive['info']('Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive');}}else{loggerPredictive[_0xa62e('0x7d')](_0xa62e('0x86'));}}else{loggerPredictive['info'](_0xa62e('0x86'));}return![];}function mergeDataErlangB(_0x3b9a7b){return function(_0x18c015){loggerPredictive[_0xa62e('0x7d')](_0xa62e('0x87'));loggerPredictive[_0xa62e('0x7d')]('Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x18c015[_0xa62e('0x73')]);loggerPredictive[_0xa62e('0x7d')](_0xa62e('0x88'),_0x18c015['erlangCallToSecond']);loggerPredictive['info'](_0xa62e('0x89'),_0x18c015['erlangAbandonmentRate']);loggerPredictive[_0xa62e('0x7d')](_0xa62e('0x8a'),_0x18c015[_0xa62e('0x75')]);loggerPredictive[_0xa62e('0x7d')](_0xa62e('0x89'),_0x18c015[_0xa62e('0x8b')]);loggerPredictive['info'](_0xa62e('0x83'));_[_0xa62e('0x8c')](_0x3b9a7b,_0x18c015);};}function getDiff(_0x412076){var _0x4804c6=moment()['milliseconds'](0x0);var _0xea3eec=moment(_0x412076)['milliseconds'](0x0);return _0x4804c6[_0xa62e('0x49')](_0xea3eec,'seconds');}function ifInterval(_0xa849cf,_0x3809d9){if(_[_0xa62e('0x3e')](_0x3809d9)){return![];}if(getDiff(_0x3809d9)<_0xa849cf*0x3c){return!![];}else{return![];}}function freeVariablesPredictive(_0x1c5603){if(isNotNull(_0x1c5603)){if(!_[_0xa62e('0x3e')](_0x1c5603['startProgressive'])){_0x1c5603['startProgressive']=undefined;loggerPredictive[_0xa62e('0x7d')](_0x1c5603[_0xa62e('0x41')],_0xa62e('0x8d'));}if(!_[_0xa62e('0x3e')](_0x1c5603['startPredictive'])){_0x1c5603['startPredictive']=undefined;loggerPredictive[_0xa62e('0x7d')](_0x1c5603[_0xa62e('0x41')],_0xa62e('0x8e'));}if(!_['isUndefined'](_0x1c5603[_0xa62e('0x8f')])){clearInterval(_0x1c5603[_0xa62e('0x8f')]);_0x1c5603['handlePredictive']=undefined;loggerPredictive[_0xa62e('0x7d')](_0x1c5603[_0xa62e('0x41')],_0xa62e('0x90'));}}}function erlangb(_0x183450,_0x472605){if(_0x472605===0x0){return 0x0;}var _0x27702b=0x1;for(var _0x162766=0x1;_0x162766<=_0x472605;_0x162766+=0x1){_0x27702b=0x1+_0x27702b*_0x162766/_0x183450;}return 0x1/_0x27702b;}function isVoiceQueueOutbound(_0x2ae96b){return _0x2ae96b===_0xa62e('0x91');}function isNotPreview(_0x2f5b29){return _0x2f5b29!==_0xa62e('0x92');}function isCampaignIvr(_0x1547c3){return _0x1547c3==='ivr';}function getCallerId(_0xa3b853,_0x4e77ea,_0x4a00cd){if(!_[_0xa62e('0x3e')](_0x4a00cd)&&_0xa62e('0x93')===typeof _0x4a00cd&&!_[_0xa62e('0x45')](_0x4a00cd)){if(!_[_0xa62e('0x3e')](_0x4e77ea)&&_0xa62e('0x93')===typeof _0x4e77ea&&!_['isEmpty'](_0x4e77ea)){return util[_0xa62e('0x78')]('\x22%s\x22\x20<%s>',_0x4e77ea,_0x4a00cd);}return util[_0xa62e('0x78')](_0xa62e('0x94'),_0x4a00cd,_0x4a00cd);}if(!_['isUndefined'](_0xa3b853)&&'string'===typeof _0xa3b853&&!_['isEmpty'](_0xa3b853)){return _0xa3b853;}return _0xa62e('0x95');}function loggerCatchQueueSummary(_0x370b84,_0x190e9d){return function(_0x21b810){freeVariablesPredictive(_0x190e9d);emitVoiceQueueSummary(_0x190e9d);emitCampaignSummary(_0x190e9d);loggerSyncQueueSummary[_0xa62e('0x96')](_0x370b84,util[_0xa62e('0x97')](_0x21b810,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x1b2a84,_0x1a2c7d){return function(_0xffd6cb){loggerPredictive[_0xa62e('0x96')](_0x1a2c7d[_0xa62e('0x41')],_0x1b2a84);loggerPredictive[_0xa62e('0x96')](_0xffd6cb['stack']);freeVariablesPredictive(_0x1a2c7d);};}function loggerCatch(_0x477313){return function(_0x380df2){logger[_0xa62e('0x96')](_0x477313,util[_0xa62e('0x97')](_0x380df2,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x5bfd64){return _0x5bfd64&&!_['isUndefined'](_0x5bfd64)&&_0x5bfd64[_0xa62e('0x98')]>0x0;}function decremetOriginate(_0x56b1b4){if(!_['isUndefined'](_0x56b1b4)&&_0x56b1b4!==null){if(_0x56b1b4[_0xa62e('0x99')]('originated')){if(_0x56b1b4[_0xa62e('0x72')]>0x0){_0x56b1b4[_0xa62e('0x72')]-=0x1;}else{logger[_0xa62e('0x96')](_0xa62e('0x9a'));}}}else{logger[_0xa62e('0x96')](_0xa62e('0x9b'));}}function checkContactLowerLimitOriginate(_0x2ae6e3,_0x11b8fc,_0x11d225){if(_0x11b8fc>_0x11d225){for(var _0x4cea78=0x0;_0x4cea78<_0x11b8fc-_0x11d225;_0x4cea78+=0x1){decremetOriginate(_0x2ae6e3);}}}function loggerGetContactDialer(_0x511af2,_0x1bba30,_0x2f231b){return function(_0x349479){checkContactLowerLimitOriginate(_0x1bba30,_0x2f231b,0x0);logger[_0xa62e('0x96')](_0x511af2,util[_0xa62e('0x97')](_0x349479,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x4b4228){return function(_0x274023){if(isNotNull(_0x274023)&&isNotNull(_0x274023[0x0])){if(_0x274023[0x0][_0xa62e('0x9c')]>0x0){_0x4b4228['message']=_0xa62e('0x9d');logger[_0xa62e('0x7d')](_0xa62e('0x9e')+_0x4b4228[_0xa62e('0x41')],_0x274023[0x0][_0xa62e('0x9c')],_0xa62e('0x9f'));}else{_0x4b4228[_0xa62e('0x3f')]='AVAILABLE_CONTACTS_FINISHED';logger[_0xa62e('0x7d')]('[getContactDialer2][Empty]'+_0x4b4228[_0xa62e('0x41')]);}}};}function notSendMessagesQueue(_0x131bde){if(_0x131bde['sendMessageOneNotActive']){freeVariablesPredictive(_0x131bde);if(_0x131bde[_0xa62e('0x72')]===0x0&&_0x131bde[_0xa62e('0xa0')]===0x0&&_0x131bde[_0xa62e('0x56')]===0x0&&(_0x131bde[_0xa62e('0x51')]||0x0)===0x0){_0x131bde[_0xa62e('0xa1')]=![];_0x131bde['available']=0x0;_0x131bde[_0xa62e('0x3f')]=_0xa62e('0x40');loggerSyncQueueSummary[_0xa62e('0x96')]('[syncQueueSummary]\x20Campaign\x20Queue:\x20',_0x131bde[_0xa62e('0x41')],_0xa62e('0xa2'));}else{_0x131bde['message']=_0xa62e('0xa3');loggerSyncQueueSummary[_0xa62e('0x96')](_0xa62e('0xa4'),_0x131bde[_0xa62e('0x41')],_0xa62e('0xa5'));}emitVoiceQueueSummary(_0x131bde);}}function notSendMessagesCampaign(_0x43bc8e){if(_0x43bc8e[_0xa62e('0xa1')]){if(_0x43bc8e[_0xa62e('0x72')]===0x0){_0x43bc8e[_0xa62e('0xa1')]=![];_0x43bc8e[_0xa62e('0x3f')]=_0xa62e('0x40');loggerSyncQueueSummary[_0xa62e('0x96')]('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x43bc8e['name'],_0xa62e('0xa2'));}else{_0x43bc8e['message']=_0xa62e('0xa3');loggerSyncQueueSummary[_0xa62e('0x96')]('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x43bc8e[_0xa62e('0x41')],_0xa62e('0xa5'));}emitCampaignSummary(_0x43bc8e);}}function createObjHistory(_0x321e6d,_0x381860,_0x35ab0f,_0x27ef42,_0x4a2954){_0x321e6d['message']=_0x35ab0f;var _0x588d60=new Action(_0x321e6d,_0x381860);var _0x367d4e=new History(_0x588d60);_0x367d4e[_0xa62e('0xa6')]=_0x27ef42;_0x367d4e[_0xa62e('0xa7')]=_0x4a2954;_0x367d4e['endtime']=_0x588d60[_0xa62e('0xa8')];return _0x367d4e;}Dialer[_0xa62e('0x18')][_0xa62e('0x3d')]=function(){var _0x49929d=this;setInterval(function(){_0x49929d[_0xa62e('0xa9')](_0x49929d[_0xa62e('0x25')],_0xa62e('0xaa'));_0x49929d[_0xa62e('0xa9')](_0x49929d[_0xa62e('0x23')],_0xa62e('0xab'));},0x32c8);};Dialer[_0xa62e('0x18')][_0xa62e('0xa9')]=function(_0x2939ac,_0x1806c5){var _0x2360ac=this;for(var _0x14a2b in _0x2939ac){if(_0x2939ac[_0xa62e('0x99')](_0x14a2b)){this['sequence'][_0xa62e('0x19')](function(){if(!_[_0xa62e('0xac')](_0x2939ac[_0x14a2b])){return ami[_0xa62e('0xad')]({'action':_0xa62e('0xae'),'channel':_0x2939ac[_0x14a2b]['channel']})[_0xa62e('0xaf')](function(_0x3fd22a){if(_0x3fd22a[_0xa62e('0x3f')]===_0xa62e('0xb0')){setTimeout(function(){if(_0x2939ac[_0x14a2b]&&_0x2939ac[_0x14a2b][_0xa62e('0x4c')]!==_0xa62e('0xb1')){_0x2360ac[_0xa62e('0xb2')](_0x2360ac[_0xa62e('0x1d')][_0x2939ac[_0x14a2b][_0xa62e('0xb3')]]);logger[_0xa62e('0x96')](_0xa62e('0xb4'),_0x1806c5,_0x14a2b,_0x2939ac[_0x14a2b][_0xa62e('0xb3')]);delete _0x2939ac[_0x14a2b];}if(_0x2939ac[_0x14a2b]&&_0x2939ac[_0x14a2b][_0xa62e('0x4c')]===_0xa62e('0xb1')){_0x2360ac['updateOriginated'](_0x2360ac[_0xa62e('0x1e')][_0x2939ac[_0x14a2b][_0xa62e('0xb3')]]);logger['error'](_0xa62e('0xb5'),_0x1806c5,_0x14a2b,_0x2939ac[_0x14a2b][_0xa62e('0xb3')]);delete _0x2939ac[_0x14a2b];}},0x2328);}});}});}}};Dialer['prototype'][_0xa62e('0xb6')]=function(_0x96c09){return BPromise[_0xa62e('0xb7')]()[_0xa62e('0xb8')](cmHopper['countReScheduled'](_0x96c09))[_0xa62e('0xaf')](loggerCatch(_0xa62e('0xb9')));};Dialer['prototype'][_0xa62e('0xba')]=function(_0x51e1db){return BPromise['resolve']()[_0xa62e('0xb8')](cmHopperBlack[_0xa62e('0xba')](_0x51e1db))[_0xa62e('0xaf')](loggerCatch(_0xa62e('0xbb')));};Dialer[_0xa62e('0x18')]['checkIsBlackListIvr']=function(_0x4a5217){return BPromise[_0xa62e('0xb7')]()[_0xa62e('0xb8')](cmHopperBlack[_0xa62e('0xbc')](_0x4a5217))[_0xa62e('0xaf')](loggerCatch('[checkIsBlackListIvr]\x20'));};Dialer[_0xa62e('0x18')][_0xa62e('0xbd')]=function(_0x590815){return BPromise[_0xa62e('0xb7')]()[_0xa62e('0xb8')](cmHopperHistory[_0xa62e('0xbe')](_0x590815))[_0xa62e('0xaf')](loggerCatch('[averageHandleTime]\x20'));};Dialer['prototype'][_0xa62e('0xbf')]=function(_0x244df2){return BPromise['resolve']()[_0xa62e('0xb8')](cmHopper['rescheduleContact'](_0x244df2))[_0xa62e('0xaf')](loggerCatch(_0xa62e('0xc0')));};Dialer[_0xa62e('0x18')][_0xa62e('0xc1')]=function(_0x5c3f93,_0x11c7f0,_0x579f37,_0x5ad7a9){return BPromise[_0xa62e('0xb7')]()['then'](cmHopper[_0xa62e('0xc1')](_0x5c3f93,_0x11c7f0,_0x579f37,_0x5ad7a9))[_0xa62e('0xaf')](loggerCatch(_0xa62e('0xc2')));};Dialer[_0xa62e('0x18')][_0xa62e('0xc3')]=function(_0x25e682,_0x58b745,_0x31d7b6){return BPromise[_0xa62e('0xb7')]()['then'](cmHopper[_0xa62e('0xc3')](_0x25e682,_0x58b745,_0x31d7b6))[_0xa62e('0xaf')](loggerCatch(_0xa62e('0xc2')));};Dialer[_0xa62e('0x18')][_0xa62e('0xc4')]=function(_0x27cab1){return BPromise[_0xa62e('0xb7')]()['then'](voiceQueueRt['getVoiceQueueRtPauses'](_0x27cab1))[_0xa62e('0xaf')](loggerCatch('[getVoiceQueueRtPauses]\x20'));};Dialer[_0xa62e('0x18')]['moveContactManagedDialer']=function(_0x1f1b8c){return BPromise[_0xa62e('0xb7')]()[_0xa62e('0xb8')](cmHopper[_0xa62e('0xc5')](_0x1f1b8c))[_0xa62e('0xaf')](loggerCatch(_0xa62e('0xc6')));};Dialer[_0xa62e('0x18')][_0xa62e('0xc7')]=function(_0x1d5adc){return BPromise[_0xa62e('0xb7')]()[_0xa62e('0xb8')](cmHopperHistory[_0xa62e('0xc7')](_0x1d5adc))[_0xa62e('0xaf')](loggerCatch(_0xa62e('0xc8')));};Dialer[_0xa62e('0x18')][_0xa62e('0xb2')]=function(_0x23765f){if(!_[_0xa62e('0x3e')](_0x23765f)&&_0x23765f!==null){if(_0x23765f['hasOwnProperty'](_0xa62e('0x72'))){if(_0x23765f['originated']>0x0){_0x23765f['originated']-=0x1;}else{logger[_0xa62e('0x96')](_0xa62e('0xc9'));}}}else{logger['error'](_0xa62e('0xca'));}};Dialer[_0xa62e('0x18')]['loggerHandler']=function(_0x3b89f1,_0x4b91a3){var _0x8bc5d4=this;return function(_0x5885c3){_0x8bc5d4[_0xa62e('0xb2')](_0x4b91a3);logger['error'](_0x3b89f1,util[_0xa62e('0x97')](_0x5885c3,{'showHidden':![],'depth':null}));};};Dialer['prototype'][_0xa62e('0xcb')]=function(_0x4f6e77,_0x13dc8b,_0x3b9ea1){var _0x4072d8={'state':0x19,'statedesc':'notFound'};this[_0xa62e('0xb2')](_0x13dc8b);this[_0xa62e('0xcc')](_[_0xa62e('0x8c')](_0x4072d8,_[_0xa62e('0xcd')](_0x3b9ea1,[_0xa62e('0xce'),'ListId',_0xa62e('0xcf'),'VoiceQueueId',_0xa62e('0xd0')])),_0xa62e('0xd1'),'[emptyContact]');logger['error'](_0x4f6e77);};Dialer[_0xa62e('0x18')][_0xa62e('0xd2')]=function(_0x555efa){return _0x555efa===_0xa62e('0xd3');};Dialer[_0xa62e('0x18')]['isTrunkReachable']=function(_0x489300){return!_[_0xa62e('0x3e')](_0x489300)&&_0x489300&&!_[_0xa62e('0x3e')](_0x489300['name'])&&!_[_0xa62e('0x3e')](_0x489300[_0xa62e('0xd4')])&&_0x489300[_0xa62e('0xd4')]&&(this[_0xa62e('0x20')][util['format'](_0xa62e('0xd5'),_0x489300[_0xa62e('0x41')])][_0xa62e('0xae')]===_0xa62e('0xd6')||this['trunks'][util[_0xa62e('0x78')](_0xa62e('0xd5'),_0x489300[_0xa62e('0x41')])]['status']===_0xa62e('0xd7'));};Dialer[_0xa62e('0x18')]['saveInDb']=function(_0x43125f,_0xbfc974,_0x1bfd1b){this[_0xa62e('0xc7')](_0x43125f)[_0xa62e('0xaf')](loggerCatch(_0xbfc974));this[_0xa62e('0xc5')](_0x43125f)['catch'](loggerCatch(_0x1bfd1b));};Dialer[_0xa62e('0x18')]['syncVarSet']=function(_0x1ec07a){var _0x23ed30=this[_0xa62e('0x25')][_0x1ec07a[_0xa62e('0xd8')]];var _0x1183db;if(!_['isNil'](_0x1ec07a)&&!_[_0xa62e('0xac')](_0x1ec07a['variable'])&&!_[_0xa62e('0xac')](_0x1ec07a['variable'][_0xa62e('0xd9')])&&_0x1ec07a['exten']===_0xa62e('0xda')&&_0x23ed30){if(_0x23ed30[_0xa62e('0x4c')]!=='ivr'&&this[_0xa62e('0x1d')][_0x23ed30['queue']]['dialAMDActive']&&_0x1ec07a[_0xa62e('0xdb')]===_0xa62e('0xdc')){delete this[_0xa62e('0x25')][_0x1ec07a[_0xa62e('0xd8')]];this['updateOriginated'](this[_0xa62e('0x1d')][_0x23ed30[_0xa62e('0xb3')]]);this[_0xa62e('0x1d')][_0x23ed30['queue']]['outboundAnswerCallsDay']+=0x1;this['voiceQueues'][_0x23ed30[_0xa62e('0xb3')]]['outboundAnswerAgiCallsDay']+=0x1;_0x1183db=new Hangup(_0x23ed30,_0x1ec07a);_0x1183db[_0xa62e('0xa6')]=0x12;_0x1183db[_0xa62e('0xa7')]=_0xa62e('0xdd');_0x1183db[_0xa62e('0xde')]='AMD';this[_0xa62e('0xcc')](_0x1183db,_0xa62e('0xdf'),_0xa62e('0xe0'));}if(_0x23ed30[_0xa62e('0x4c')]!==_0xa62e('0xb1')&&this[_0xa62e('0x1d')][_0x23ed30['queue']][_0xa62e('0xe1')]&&_0x1ec07a['value']===_0xa62e('0xe2')){delete this[_0xa62e('0x25')][_0x1ec07a[_0xa62e('0xd8')]];this['updateOriginated'](this['voiceQueues'][_0x23ed30[_0xa62e('0xb3')]]);this[_0xa62e('0x1d')][_0x23ed30[_0xa62e('0xb3')]][_0xa62e('0xe3')]+=0x1;this[_0xa62e('0x1d')][_0x23ed30['queue']][_0xa62e('0x5c')]+=0x1;_0x1183db=new Hangup(_0x23ed30,_0x1ec07a);_0x1183db[_0xa62e('0xa6')]=0x13;_0x1183db[_0xa62e('0xa7')]='Machine';_0x1183db['membername']=_0xa62e('0xe4');_0x1183db[_0xa62e('0xe5')]=!![];this[_0xa62e('0xcc')](_0x1183db,_0xa62e('0xe6'),_0xa62e('0xe7'));}if(_0x23ed30[_0xa62e('0x4c')]===_0xa62e('0xb1')&&this[_0xa62e('0x1e')][_0x23ed30[_0xa62e('0xb3')]][_0xa62e('0xe1')]&&_0x1ec07a['value']===_0xa62e('0xdc')){delete this[_0xa62e('0x25')][_0x1ec07a[_0xa62e('0xd8')]];this[_0xa62e('0xb2')](this[_0xa62e('0x1e')][_0x23ed30[_0xa62e('0xb3')]]);_0x1183db=new Hangup(_0x23ed30,_0x1ec07a);_0x1183db[_0xa62e('0xa6')]=0x12;_0x1183db[_0xa62e('0xa7')]='HangupInAMD';_0x1183db['membername']=_0xa62e('0xe4');this[_0xa62e('0xcc')](_0x1183db,_0xa62e('0xe8'),_0xa62e('0xe9'));}if(_0x23ed30['type']===_0xa62e('0xb1')&&this[_0xa62e('0x1e')][_0x23ed30[_0xa62e('0xb3')]][_0xa62e('0xe1')]&&_0x1ec07a[_0xa62e('0xdb')]===_0xa62e('0xe2')){delete this[_0xa62e('0x25')][_0x1ec07a[_0xa62e('0xd8')]];this['updateOriginated'](this[_0xa62e('0x1e')][_0x23ed30[_0xa62e('0xb3')]]);_0x1183db=new Hangup(_0x23ed30,_0x1ec07a);_0x1183db[_0xa62e('0xa6')]=0x13;_0x1183db['statedesc']=_0xa62e('0xea');_0x1183db[_0xa62e('0xde')]=_0xa62e('0xe4');_0x1183db['amd']=!![];this['saveInDb'](_0x1183db,_0xa62e('0xeb'),'[syncMachineIvr]');}}};Dialer[_0xa62e('0x18')][_0xa62e('0x35')]=function(_0x5c09d6){var _0x1b3a5d=this[_0xa62e('0x25')][_0x5c09d6[_0xa62e('0xd8')]];var _0x1c2fd8=this;var _0x36d131;if(_0x1b3a5d&&_0x1b3a5d[_0xa62e('0x4c')]==='ivr'){delete this['uniqueId'][_0x5c09d6[_0xa62e('0xd8')]];this[_0xa62e('0xb2')](this[_0xa62e('0x1e')][_0x1b3a5d[_0xa62e('0xb3')]]);this[_0xa62e('0x1e')][_0x1b3a5d[_0xa62e('0xb3')]][_0xa62e('0xec')]+=0x1;_0x36d131=new Hangup(_0x1b3a5d,_0x5c09d6);this[_0xa62e('0xc7')](_0x36d131)[_0xa62e('0xaf')](loggerCatch('[syncHangupIvr][createHistory]'));this[_0xa62e('0xc5')](_0x36d131)[_0xa62e('0xaf')](loggerCatch(_0xa62e('0xed')));}if(_0x1b3a5d&&_0x1b3a5d[_0xa62e('0x4c')]!==_0xa62e('0xb1')&&isNotNull(this[_0xa62e('0x1d')][_0x1b3a5d[_0xa62e('0xb3')]]['dialQueueProject'])){delete this[_0xa62e('0x25')][_0x5c09d6[_0xa62e('0xd8')]];this[_0xa62e('0xb2')](this[_0xa62e('0x1d')][_0x1b3a5d['queue']]);this[_0xa62e('0x1d')][_0x1b3a5d[_0xa62e('0xb3')]][_0xa62e('0xe3')]+=0x1;this[_0xa62e('0x1d')][_0x1b3a5d['queue']][_0xa62e('0x5c')]+=0x1;_0x36d131=new Hangup(_0x1b3a5d,_0x5c09d6);_0x36d131[_0xa62e('0xa6')]=0x10;_0x36d131[_0xa62e('0xa7')]=_0xa62e('0xee');_0x36d131[_0xa62e('0xde')]=_0xa62e('0xef');this['createHistory'](_0x36d131)[_0xa62e('0xaf')](loggerCatch(_0xa62e('0xf0')));this[_0xa62e('0xc5')](_0x36d131)['catch'](loggerCatch(_0xa62e('0xed')));}if(_0x1b3a5d&&_0x1b3a5d[_0xa62e('0x4c')]!==_0xa62e('0xb1')&&!isNotNull(this[_0xa62e('0x1d')][_0x1b3a5d[_0xa62e('0xb3')]]['dialQueueProject'])){delete this['uniqueId'][_0x5c09d6['uniqueid']];this[_0xa62e('0xb2')](this[_0xa62e('0x1d')][_0x1b3a5d[_0xa62e('0xb3')]]);this[_0xa62e('0x1d')][_0x1b3a5d[_0xa62e('0xb3')]][_0xa62e('0x66')]+=0x1;_0x36d131=new Hangup(_0x1b3a5d,_0x5c09d6);_0x36d131[_0xa62e('0xa6')]=0xc;_0x36d131[_0xa62e('0xa7')]=_0x5c09d6[_0xa62e('0xf1')];_0x36d131[_0xa62e('0xde')]=_0xa62e('0xf2');this[_0xa62e('0xc7')](_0x36d131)[_0xa62e('0xaf')](loggerCatch(_0xa62e('0xf0')));this[_0xa62e('0xc5')](_0x36d131)[_0xa62e('0xaf')](loggerCatch(_0xa62e('0xed')));}};Dialer['prototype'][_0xa62e('0x31')]=function(_0x42fb03){var _0x473329=this[_0xa62e('0x25')][_0x42fb03[_0xa62e('0xd8')]];var _0x1b1e46=this;if(this['voiceQueues'][_0x42fb03[_0xa62e('0xb3')]]){if(_0x473329&&_0x473329[_0xa62e('0x4c')]!==_0xa62e('0xb1')){delete this[_0xa62e('0x25')][_0x42fb03['uniqueid']];this[_0xa62e('0x1d')][_0x42fb03['queue']][_0xa62e('0xe3')]+=0x1;var _0x47fea6=new AgentComplete(_0x473329,_0x42fb03);if(_0x42fb03[_0xa62e('0xf3')]===_0xa62e('0xf4')){_0x47fea6['agiafterat']=this[_0xa62e('0x1d')][_0x42fb03[_0xa62e('0xb3')]][_0xa62e('0xf5')]&&this[_0xa62e('0x1d')][_0x42fb03[_0xa62e('0xb3')]][_0xa62e('0xf6')]?moment()['format'](_0xa62e('0xf7')):undefined;}this[_0xa62e('0xc7')](_0x47fea6)[_0xa62e('0xaf')](loggerCatch('[syncAgentComplete][createHistory]'));this[_0xa62e('0xc5')](_0x47fea6)['catch'](loggerCatch(_0xa62e('0xf8')));}}};Dialer[_0xa62e('0x18')][_0xa62e('0x2c')]=function(_0x58041e){if(this[_0xa62e('0x1d')][_0x58041e[_0xa62e('0xb3')]]){if(this[_0xa62e('0x25')][_0x58041e[_0xa62e('0xd8')]]&&this['uniqueId'][_0x58041e[_0xa62e('0xd8')]][_0xa62e('0x4c')]!=='ivr'){this['updateOriginated'](this[_0xa62e('0x1d')][_0x58041e['queue']]);this['uniqueId'][_0x58041e[_0xa62e('0xd8')]][_0xa62e('0xf9')]=moment()['format'](_0xa62e('0xf7'));}}};Dialer[_0xa62e('0x18')]['queueCallerAbandonCreateState']=function(_0x5408e8){this[_0xa62e('0xc7')](_0x5408e8)[_0xa62e('0xaf')](loggerCatch(_0xa62e('0xfa')));this[_0xa62e('0xc5')](_0x5408e8)['catch'](loggerCatch(_0xa62e('0xfb')));};Dialer['prototype'][_0xa62e('0xfc')]=function(_0x2ae4ee){var _0x2f4a12=this['uniqueId'][_0x2ae4ee[_0xa62e('0xd8')]];var _0x5e05c7=this;if(this[_0xa62e('0x1d')][_0x2ae4ee['queue']]){if(_0x2f4a12&&_0x2f4a12[_0xa62e('0x4c')]!==_0xa62e('0xb1')){delete this['uniqueId'][_0x2ae4ee['uniqueid']];this['updateOriginated'](this[_0xa62e('0x1d')][_0x2ae4ee[_0xa62e('0xb3')]]);_0x2f4a12[_0xa62e('0xfd')]=moment()[_0xa62e('0x78')](_0xa62e('0xf7'));var _0x597278=new QueueCallerAbandon(_0x2f4a12,_0x2ae4ee);if(getSeconds(_0x2f4a12['droptime'],_0x2f4a12[_0xa62e('0xfe')])>=_0x2f4a12[_0xa62e('0xff')]){this[_0xa62e('0x1d')][_0x2ae4ee[_0xa62e('0xb3')]]['predictiveIntervalDroppedCallsTimeout']+=0x1;this[_0xa62e('0x1d')][_0x2ae4ee[_0xa62e('0xb3')]][_0xa62e('0x100')]+=0x1;this[_0xa62e('0x1d')][_0x2ae4ee[_0xa62e('0xb3')]]['predictiveIntervalErlangCallsDroppedCalls']+=0x1;_0x597278['state']=0xa;_0x597278[_0xa62e('0xa7')]=_0xa62e('0x101');_0x597278[_0xa62e('0x102')]='TIMEOUT';_0x597278[_0xa62e('0x103')]=this[_0xa62e('0x1d')][_0x2ae4ee[_0xa62e('0xb3')]][_0xa62e('0xf5')]?moment()['format'](_0xa62e('0xf7')):undefined;this[_0xa62e('0x104')](_0x597278);}else{this['voiceQueues'][_0x2ae4ee[_0xa62e('0xb3')]][_0xa62e('0x6a')]+=0x1;this[_0xa62e('0x1d')][_0x2ae4ee[_0xa62e('0xb3')]][_0xa62e('0x61')]+=0x1;_0x597278['state']=0xb;_0x597278['statedesc']=_0xa62e('0x105');_0x597278[_0xa62e('0x102')]=_0xa62e('0x106');this[_0xa62e('0x104')](_0x597278);}}}};Dialer[_0xa62e('0x18')][_0xa62e('0x37')]=function(_0x2410fe){if(this[_0xa62e('0x23')][_0x2410fe['uniqueid']]){this['actions'][_0x2410fe[_0xa62e('0xd8')]][_0xa62e('0x107')]=_0x2410fe[_0xa62e('0x107')];}if(this[_0xa62e('0x25')][_0x2410fe['uniqueid']]){this[_0xa62e('0x25')][_0x2410fe['uniqueid']]['channel']=_0x2410fe[_0xa62e('0x107')];}};Dialer['prototype'][_0xa62e('0x3a')]=function(_0x148a61){if(strategy[this[_0xa62e('0x1d')][this[_0xa62e('0x23')][_0x148a61['actionid']][_0xa62e('0xb3')]]['strategy']]===_0xa62e('0x17')){if(this[_0xa62e('0x23')][_0x148a61[_0xa62e('0x108')]]&&_['isNil'](this['actions'][_0x148a61[_0xa62e('0x108')]][_0xa62e('0x109')])&&_0x148a61['status']==='1'&&_0x148a61[_0xa62e('0x10a')]==='0'){if(this['agents'][_0x148a61[_0xa62e('0x10b')]]){if(!this['agents'][_0x148a61[_0xa62e('0x10b')]][_0xa62e('0x109')]){this[_0xa62e('0x1f')][_0x148a61[_0xa62e('0x10b')]][_0xa62e('0x109')]=!![];this['actions'][_0x148a61[_0xa62e('0x108')]][_0xa62e('0x109')]=!![];this[_0xa62e('0x23')][_0x148a61[_0xa62e('0x108')]][_0xa62e('0x10b')]=_0x148a61[_0xa62e('0x10b')];}}}}else if((strategy[this['voiceQueues'][this[_0xa62e('0x23')][_0x148a61[_0xa62e('0x108')]][_0xa62e('0xb3')]]['strategy']]||'rrmemory')===_0xa62e('0x16')){if(this[_0xa62e('0x23')][_0x148a61['actionid']]){if(this['agents'][_0x148a61[_0xa62e('0x10b')]]){this[_0xa62e('0x23')][_0x148a61[_0xa62e('0x108')]][_0xa62e('0x10b')]=_0x148a61[_0xa62e('0x10b')];if(_[_0xa62e('0xac')](this[_0xa62e('0x29')][this[_0xa62e('0x23')][_0x148a61[_0xa62e('0x108')]][_0xa62e('0xb3')]])){this[_0xa62e('0x29')][this['actions'][_0x148a61[_0xa62e('0x108')]][_0xa62e('0xb3')]]=[];}this[_0xa62e('0x29')][this[_0xa62e('0x23')][_0x148a61[_0xa62e('0x108')]][_0xa62e('0xb3')]]['push'](_['merge'](_[_0xa62e('0xcd')](this[_0xa62e('0x23')][_0x148a61[_0xa62e('0x108')]],[_0xa62e('0x10c'),_0xa62e('0x10b')]),{'status':_0x148a61[_0xa62e('0xae')],'paused':_0x148a61[_0xa62e('0x10a')]}));}}}};function unlockQueueStatus(_0x2bc5dc,_0x550eb8){setTimeout(function(){if(_[_0xa62e('0x3e')](_0x2bc5dc[_0xa62e('0x10d')])){loggerBooked[_0xa62e('0x96')](_0xa62e('0x10e'),_0x550eb8);}_0x2bc5dc[_0xa62e('0x10d')]=!![];loggerBooked['info'](_0xa62e('0x10f'),_0x550eb8,JSON['stringify'](_[_0xa62e('0xcd')](_0x2bc5dc,['name',_0xa62e('0x10d')])));},0x1f3);}Dialer[_0xa62e('0x18')][_0xa62e('0x3c')]=function(_0x1147a5){var _0x7c4cb1=this;var _0x40b6ba=_0x7c4cb1[_0xa62e('0x1d')][_0x7c4cb1[_0xa62e('0x23')][_0x1147a5[_0xa62e('0x108')]][_0xa62e('0xb3')]];if(strategy[this[_0xa62e('0x1d')][this[_0xa62e('0x23')][_0x1147a5[_0xa62e('0x108')]]['queue']][_0xa62e('0x4d')]]===_0xa62e('0x17')){if(this['actions'][_0x1147a5[_0xa62e('0x108')]]&&this['actions'][_0x1147a5['actionid']]['stateinterface']){this[_0xa62e('0x92')][_0xa62e('0x110')](this['actions'][_0x1147a5[_0xa62e('0x108')]][_0xa62e('0x10c')],this[_0xa62e('0x23')][_0x1147a5[_0xa62e('0x108')]][_0xa62e('0x10b')])['catch'](function(_0x15f9f4){logger['error'](_0xa62e('0x111'),util['inspect'](_0x15f9f4,{'showHidden':![],'depth':null}));})[_0xa62e('0x1b')](function(){_0x7c4cb1[_0xa62e('0xb2')](_0x7c4cb1[_0xa62e('0x1d')][_0x7c4cb1[_0xa62e('0x23')][_0x1147a5[_0xa62e('0x108')]][_0xa62e('0xb3')]]);_0x7c4cb1[_0xa62e('0x1f')][_0x7c4cb1[_0xa62e('0x23')][_0x1147a5[_0xa62e('0x108')]][_0xa62e('0x10b')]][_0xa62e('0x109')]=![];delete _0x7c4cb1[_0xa62e('0x23')][_0x1147a5['actionid']];unlockQueueStatus(_0x40b6ba);});}else{this['updateOriginated'](this['voiceQueues'][this[_0xa62e('0x23')][_0x1147a5[_0xa62e('0x108')]][_0xa62e('0xb3')]]);this[_0xa62e('0xbf')]({'active':![],'ContactId':this['actions'][_0x1147a5[_0xa62e('0x108')]][_0xa62e('0xce')],'ListId':this[_0xa62e('0x23')][_0x1147a5[_0xa62e('0x108')]][_0xa62e('0x112')],'VoiceQueueId':this[_0xa62e('0x23')][_0x1147a5[_0xa62e('0x108')]][_0xa62e('0x113')]||undefined,'CampaignId':this[_0xa62e('0x23')][_0x1147a5['actionid']][_0xa62e('0xd0')]||undefined})[_0xa62e('0xaf')](loggerCatch(_0xa62e('0x114')));delete this['actions'][_0x1147a5[_0xa62e('0x108')]];unlockQueueStatus(_0x40b6ba);}}else if((strategy[this['voiceQueues'][this[_0xa62e('0x23')][_0x1147a5['actionid']]['queue']][_0xa62e('0x4d')]]||_0xa62e('0x16'))==='rrmemory'){var _0x5b08f0;if(this[_0xa62e('0x23')][_0x1147a5[_0xa62e('0x108')]]&&!_['isEmpty'](this[_0xa62e('0x29')][this[_0xa62e('0x23')][_0x1147a5[_0xa62e('0x108')]][_0xa62e('0xb3')]])){if(this[_0xa62e('0x2a')][_0x7c4cb1[_0xa62e('0x23')][_0x1147a5['actionid']]['queue']]){this[_0xa62e('0x2a')][_0x7c4cb1[_0xa62e('0x23')][_0x1147a5[_0xa62e('0x108')]][_0xa62e('0xb3')]]=this['queueBookedRR'][this[_0xa62e('0x23')][_0x1147a5[_0xa62e('0x108')]][_0xa62e('0xb3')]]?this['queueBookedRR'][this[_0xa62e('0x23')][_0x1147a5[_0xa62e('0x108')]][_0xa62e('0xb3')]]:this[_0xa62e('0x29')][this[_0xa62e('0x23')][_0x1147a5[_0xa62e('0x108')]][_0xa62e('0xb3')]]?this[_0xa62e('0x29')][this['actions'][_0x1147a5[_0xa62e('0x108')]][_0xa62e('0xb3')]][_0xa62e('0x115')]||0x0:0x0;}this[_0xa62e('0x29')][this['actions'][_0x1147a5[_0xa62e('0x108')]]['queue']][_0xa62e('0x115')]=this[_0xa62e('0x2a')][this[_0xa62e('0x23')][_0x1147a5['actionid']]['queue']];for(var _0x5238de=0x0;_0x5238de=0x0?!![]:![];})[_0xa62e('0xaf')](myreject(_0x41a5c6)));}}else{_0x10d28b['push'](ami['Action']({'action':_0xa62e('0x131'),'command':util[_0xa62e('0x78')]('iftime\x20%s,%s',_0x2a97e6,!_[_0xa62e('0x3e')](config['timezones'][_0x4f4580])?_0x4f4580:'')})[_0xa62e('0xb8')](function(_0x445cfe){return _0x445cfe[_0xa62e('0x135')][_0xa62e('0x136')](_0xa62e('0x134'))>=0x0?!![]:![];})[_0xa62e('0xaf')](myreject(_0x41a5c6)));}BPromise[_0xa62e('0x137')](_0x10d28b)[_0xa62e('0xb8')](function(_0x29ea0d){var _0x198b70=_[_0xa62e('0x138')](_0x29ea0d);if(_0x198b70){return _0x1a5150(_0x198b70);}else{_0x36f815['message']=_0x51e0fe?_0xa62e('0x139'):_0xa62e('0x13a');return _0x41a5c6(msgResponse(_0xa62e('0x13b'),_0xa62e('0x129'),'Global:\x20'+_0x51e0fe+'\x20'+_0x3ee46e+_0xa62e('0x13c')+util['inspect'](_0x2a97e6,{'showHidden':![],'depth':null})+'Timezone:\x20'+_0x4f4580));}})['catch'](function(_0x1a042c){return _0x41a5c6(msgResponse('ifTime','Failure',JSON[_0xa62e('0x47')](_0x1a042c)));});});};Dialer[_0xa62e('0x18')][_0xa62e('0x13d')]=function(_0x3933d6){var _0x15e4ad=this;return function(){switch(_0x3933d6[_0xa62e('0x13e')]){case _0xa62e('0x13f'):freeVariablesPredictive(_0x3933d6);_0x15e4ad['handlePower'](_0x3933d6,0x1);break;case _0xa62e('0x140'):freeVariablesPredictive(_0x3933d6);_0x15e4ad[_0xa62e('0x141')](_0x3933d6,_0x3933d6[_0xa62e('0x142')]);break;case _0xa62e('0x7'):_0x15e4ad[_0xa62e('0x7')](_0x3933d6);break;case _0xa62e('0x143'):freeVariablesPredictive(_0x3933d6);_0x15e4ad[_0xa62e('0x141')](_0x3933d6,0x1);break;default:freeVariablesPredictive(_0x3933d6);logger[_0xa62e('0x96')](_0xa62e('0x144'),_0x3933d6[_0xa62e('0x41')],'method\x20not\x20recognized');}};};Dialer[_0xa62e('0x18')][_0xa62e('0x145')]=function(_0x7c1d50){var _0x4a199f=this;return function(){_0x4a199f['handleIvr'](_0x7c1d50);};};Dialer[_0xa62e('0x18')][_0xa62e('0x33')]=function(_0xe0e7ef){var _0x3534b8=this;if(isNotPreview(_0xe0e7ef[_0xa62e('0x13e')])){if(isVoiceQueueOutbound(_0xe0e7ef[_0xa62e('0x4c')])&&isActive(_0xe0e7ef[_0xa62e('0x57')])){_0xe0e7ef[_0xa62e('0xa1')]=!![];BPromise['resolve']()[_0xa62e('0xb8')](checkIsLoggedIn(_0xe0e7ef,_0xe0e7ef[_0xa62e('0x50')]))[_0xa62e('0xb8')](checkIsActive(_0xe0e7ef,_0xe0e7ef[_0xa62e('0x57')]))[_0xa62e('0xb8')](checkInterval(_0xe0e7ef))['then'](_0x3534b8[_0xa62e('0x146')](_0xe0e7ef))[_0xa62e('0xb8')](_0x3534b8[_0xa62e('0x126')](_0xe0e7ef[_0xa62e('0x147')],_0xe0e7ef[_0xa62e('0x148')],_0xe0e7ef[_0xa62e('0x41')],_0xe0e7ef))['then'](_0x3534b8[_0xa62e('0x128')](_0xe0e7ef[_0xa62e('0x44')],_0xe0e7ef[_0xa62e('0x148')],_0xe0e7ef[_0xa62e('0x41')],_0xe0e7ef))[_0xa62e('0xb8')](_0x3534b8[_0xa62e('0x13d')](_0xe0e7ef))[_0xa62e('0xaf')](loggerCatchQueueSummary('[syncQueueSummary]',_0xe0e7ef));}else{notSendMessagesQueue(_0xe0e7ef);}}else{freeVariablesPredictive(_0xe0e7ef);}};Dialer[_0xa62e('0x18')][_0xa62e('0x121')]=function(){var _0x290972=this;var _0x474df7;for(var _0x5e7088 in this['campaigns']){if(this[_0xa62e('0x1e')]['hasOwnProperty'](_0x5e7088)){_0x474df7=this[_0xa62e('0x1e')][_0x5e7088];if(isCampaignIvr(_0x474df7[_0xa62e('0x4c')])&&isActive(_0x474df7[_0xa62e('0xd4')])){_0x474df7[_0xa62e('0xa1')]=!![];BPromise[_0xa62e('0xb7')]()[_0xa62e('0xb8')](checkIsActive(_0x474df7,_0x474df7['active']))['then'](checkInterval(_0x474df7))[_0xa62e('0xb8')](_0x290972[_0xa62e('0x146')](_0x474df7))[_0xa62e('0xb8')](_0x290972[_0xa62e('0x126')](_0x474df7['dialGlobalInterval'],_0x474df7['dialTimezone'],_0x474df7[_0xa62e('0x41')],_0x474df7))['then'](_0x290972[_0xa62e('0x128')](_0x474df7['Interval'],_0x474df7[_0xa62e('0x148')],_0x474df7[_0xa62e('0x41')],_0x474df7))['then'](_0x290972[_0xa62e('0x145')](_0x474df7))[_0xa62e('0xaf')](loggerCatchQueueSummary('[syncCampaigns]',_0x474df7));}else{notSendMessagesCampaign(_0x474df7);}}}};function getCallerIdRandom(_0x11e87f,_0x406158){var _0x1383dc,_0x564119,_0x3103e0;if(_0x406158<=0x0){_0x406158=0x1;}_0x1383dc=new RegExp('\x5cw{0,'+_0x406158+'}$');_0x564119=Math[_0xa62e('0x149')](0xa,_0x406158-0x1);_0x3103e0=Math[_0xa62e('0x149')](0xa,_0x406158)-0x1;return util[_0xa62e('0x78')]('%s',_[_0xa62e('0x14a')](_0x11e87f,_0x1383dc,_[_0xa62e('0x14b')](_0x564119,_0x3103e0)));}function extractCalleridName(_0x37f8c1){var _0x403e0b=_0x37f8c1[_0xa62e('0x14c')](/"(.*?)"/);return _0x403e0b?_0x403e0b[0x1]:_0x37f8c1;}function extractCalleridNumber(_0x20d1a3){var _0x43d975=_0x20d1a3[_0xa62e('0x14c')](/<(.*?)>/);return _0x43d975?_0x43d975[0x1]:_0x20d1a3;}Dialer[_0xa62e('0x18')][_0xa62e('0x14d')]=function(_0x33e770,_0x44f11c){var _0x403937=this;var _0x221d67=uuid['v4']();this[_0xa62e('0x23')][_0x221d67]=new Action(_0x33e770,_0x44f11c,_0x221d67);return new BPromise(function(_0x1cdb87,_0x43d104){if(_[_0xa62e('0x3e')](_0x33e770)&&_0xa62e('0x14e')!==typeof _0x33e770){return _0x43d104(msgResponse('originate','Failure',_0xa62e('0x14f')));}if(_[_0xa62e('0x3e')](_0x44f11c['Contact'][_0xa62e('0x150')])||_0x44f11c['Contact']['phone']===null){return _0x43d104(msgResponse(_0xa62e('0x151'),_0xa62e('0x129'),'contact\x20is\x20undefine'));}var _0x1475f2={'XMD-CALLERID':_0x403937['actions'][_0x221d67][_0xa62e('0x152')](),'XMD-AGI':_0x33e770['dialQueueProject']?util[_0xa62e('0x78')](_0xa62e('0x153'),ipAgi,_0x33e770[_0xa62e('0x154')]):'NONE','XMD-AGIAFTER':_0x33e770[_0xa62e('0xf5')]?util['format']('\x22agi://%s/square,%s\x22',ipAgi,_0x33e770[_0xa62e('0xf5')]):_0xa62e('0x155'),'XMD-QUEUE':_0x33e770[_0xa62e('0x4c')]===_0xa62e('0x91')?util[_0xa62e('0x78')](_0xa62e('0x156'),_0x33e770[_0xa62e('0x41')],_0x33e770[_0xa62e('0x157')]||'',_0x33e770[_0xa62e('0xf6')]?'c':'',_0x33e770[_0xa62e('0xff')]||0x3):_0xa62e('0x155'),'XMD-CONTACTID':_0x44f11c[_0xa62e('0xce')],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x403937[_0xa62e('0x23')][_0x221d67][_0xa62e('0x152')](),'XMD-AMD':_0x33e770['dialAMDActive']?'ACTIVE':'NONE','XMD-DESTINATION':_0xa62e('0xda')};if(_0x33e770[_0xa62e('0xe1')]){_0x1475f2['XMD-AMDINITIALSILENCE']=_0x33e770[_0xa62e('0x158')]||0x9c4;_0x1475f2[_0xa62e('0x159')]=_0x33e770[_0xa62e('0x15a')]||0x5dc;_0x1475f2[_0xa62e('0x15b')]=_0x33e770[_0xa62e('0x15c')]||0x320;_0x1475f2[_0xa62e('0x15d')]=_0x33e770[_0xa62e('0x15e')]||0x1388;_0x1475f2[_0xa62e('0x15f')]=_0x33e770[_0xa62e('0x160')]||0x64;_0x1475f2['XMD-AMDBETWEENWORDSSILENCE']=_0x33e770[_0xa62e('0x161')]||0x32;_0x1475f2[_0xa62e('0x162')]=_0x33e770[_0xa62e('0x163')]||0x3;_0x1475f2[_0xa62e('0x164')]=_0x33e770[_0xa62e('0x165')]||0x100;_0x1475f2[_0xa62e('0x166')]=_0x33e770[_0xa62e('0x167')]||0x1388;}if(_0x33e770[_0xa62e('0x4c')]==='outbound'){_0x1475f2[_0xa62e('0x168')]=_0x44f11c[_0xa62e('0x113')];}else{_0x1475f2['XMD-CAMPAIGNID']=_0x44f11c['CampaignId'];}for(var _0x22b504 in _0x44f11c[_0xa62e('0x169')]){if(_0x44f11c[_0xa62e('0x169')][_0xa62e('0x99')](_0x22b504)){if(isNotNull(_0x44f11c['Contact'][_0x22b504])&&_0x22b504!=='id'&&_0x22b504!=='tags'&&_0x22b504!==_0xa62e('0x16a')&&_0x22b504!==_0xa62e('0x16b')){_0x1475f2[util[_0xa62e('0x78')]('%s%s',_0xa62e('0x16c'),_[_0xa62e('0x16d')](_0x22b504))]=_0x44f11c['Contact'][_0x22b504];}}}var _0x15e57e=_0x403937[_0xa62e('0x122')](_0x33e770['Trunk'])?getCallerId(_0x33e770['Trunk'][_0xa62e('0x77')],_0x33e770[_0xa62e('0x58')],_0x33e770[_0xa62e('0x16e')]>0x0?getCallerIdRandom(_0x33e770['dialOriginateCallerIdNumber'],_0x33e770['dialRandomLastDigitCallerIdNumber']):_0x33e770[_0xa62e('0x59')]):getCallerId(_[_0xa62e('0xac')](_0x33e770[_0xa62e('0x123')])?_0x33e770[_0xa62e('0x76')][_0xa62e('0x77')]:_0x33e770[_0xa62e('0x123')][_0xa62e('0x77')],_0x33e770[_0xa62e('0x58')],_0x33e770[_0xa62e('0x16e')]>0x0?getCallerIdRandom(_0x33e770[_0xa62e('0x59')],_0x33e770[_0xa62e('0x16e')]):_0x33e770[_0xa62e('0x59')]);if(_0x15e57e){_0x1475f2[_0xa62e('0x16f')]=_0x403937[_0xa62e('0x23')][_0x221d67][_0xa62e('0x170')]=extractCalleridName(_0x15e57e);_0x1475f2[_0xa62e('0x171')]=_0x403937[_0xa62e('0x23')][_0x221d67][_0xa62e('0x172')]=extractCalleridNumber(_0x15e57e);}return ami[_0xa62e('0xad')]({'actionid':_0x221d67,'action':_0xa62e('0x151'),'channel':_0x403937[_0xa62e('0x122')](_0x33e770[_0xa62e('0x76')])?util[_0xa62e('0x78')](_0xa62e('0x173'),_0x33e770[_0xa62e('0x76')]['name'],isNotNull(_0x33e770[_0xa62e('0x5b')])?_0x33e770['dialPrefix']['trim']()||'':'',_0x33e770[_0xa62e('0x174')]>0x0?_0x44f11c[_0xa62e('0x169')]['phone'][_0xa62e('0x175')](_0x33e770[_0xa62e('0x174')]):_0x44f11c[_0xa62e('0x169')]['phone']):util[_0xa62e('0x78')](_0xa62e('0x173'),_['isNil'](_0x33e770[_0xa62e('0x123')])?_0x33e770[_0xa62e('0x76')]['name']:_0x33e770[_0xa62e('0x123')][_0xa62e('0x41')],isNotNull(_0x33e770[_0xa62e('0x5b')])?_0x33e770['dialPrefix']['trim']()||'':'',_0x33e770['dialCutDigit']>0x0?_0x44f11c[_0xa62e('0x169')][_0xa62e('0x150')][_0xa62e('0x175')](_0x33e770['dialCutDigit']):_0x44f11c['Contact'][_0xa62e('0x150')]),'callerid':_0x15e57e,'Exten':_0xa62e('0xda'),'Context':_0xa62e('0x176'),'Priority':'1','variable':_0x1475f2,'timeout':(_0x33e770[_0xa62e('0x5a')]||0x1e)*0x3e8,'async':!![],'channelid':_0x221d67})[_0xa62e('0xb8')](function(_0x1df1d3){return _0x1cdb87(_0x1df1d3);})['catch'](function(_0x12b07a){_0x33e770[_0xa62e('0x64')]+=0x1;var _0x5d6d7a=new History(_0x403937['actions'][_0x221d67]);logger[_0xa62e('0x96')](util[_0xa62e('0x78')](_0xa62e('0x177'),JSON[_0xa62e('0x47')](_0x12b07a)));_0x5d6d7a[_0xa62e('0xa6')]=0xe;_0x5d6d7a[_0xa62e('0xa7')]=_0xa62e('0x178');_0x5d6d7a[_0xa62e('0xa8')]=moment()[_0xa62e('0x78')](_0xa62e('0xf7'));_0x5d6d7a[_0xa62e('0x179')]=_0x5d6d7a[_0xa62e('0xa8')];_0x403937[_0xa62e('0xc7')](_0x5d6d7a)['catch'](loggerCatch(_0xa62e('0x17a')));_0x403937[_0xa62e('0xc5')](_0x5d6d7a)[_0xa62e('0xaf')](loggerCatch(_0xa62e('0x17a')))[_0xa62e('0x1b')](function(){delete _0x403937[_0xa62e('0x23')][_0x221d67];return _0x43d104(msgResponse(_0xa62e('0x151'),_0xa62e('0x17b'),'originate\x20action\x20Error'));});});});};Dialer[_0xa62e('0x18')]['syncOriginateResponse']=function(_0x5653a7){var _0x3a9a1f=this['actions'][_0x5653a7['actionid']];var _0x141abe=this;if(_0x3a9a1f){delete this[_0xa62e('0x23')][_0x5653a7['actionid']];_0x3a9a1f['responsetime']=moment()[_0xa62e('0x78')](_0xa62e('0xf7'));var _0x6bcff=_0x3a9a1f['type']===_0xa62e('0xb1')?this[_0xa62e('0x1e')][_0x3a9a1f[_0xa62e('0xb3')]]:this[_0xa62e('0x1d')][_0x3a9a1f[_0xa62e('0x17c')]()];if(!this[_0xa62e('0xd2')](_0x5653a7[_0xa62e('0x17d')])){this[_0xa62e('0xb2')](_0x6bcff);return this[_0xa62e('0x17e')](_0x3a9a1f,_0x6bcff,_0x5653a7)[_0xa62e('0xb8')](function(_0x6e131){})[_0xa62e('0xaf')](loggerCatch(_0xa62e('0x17f')));}else{this[_0xa62e('0x25')][_0x5653a7[_0xa62e('0xd8')]]=_0x3a9a1f;}}};Dialer['prototype'][_0xa62e('0x180')]=function(_0x261505,_0x1f39b2,_0x3146a5){var _0x277b37=new History(_0x1f39b2);if(_0x277b37[_0xa62e('0x181')]+_0x277b37['countcongestionretry']+_0x277b37['countnoanswerretry']>=_0x3146a5[_0xa62e('0x182')]-0x1){return!![];}switch(_0x261505){case 0x3:if(_0x277b37['countnoanswerretry']>=_0x3146a5[_0xa62e('0x183')]-0x1){return!![];}else{this['rescheduleContact']({'active':![],'countnoanswerretry':_0x277b37['countnoanswerretry']+=0x1,'scheduledat':moment()[_0xa62e('0x184')](_0x3146a5[_0xa62e('0x185')],_0xa62e('0x186'))[_0xa62e('0x78')](_0xa62e('0xf7')),'ContactId':_0x277b37[_0xa62e('0xce')],'ListId':_0x277b37[_0xa62e('0x112')],'VoiceQueueId':_0x277b37[_0xa62e('0x113')]||undefined,'CampaignId':_0x277b37[_0xa62e('0xd0')]||undefined})[_0xa62e('0xaf')](loggerCatch(_0xa62e('0x187')));}break;case 0x5:if(_0x277b37[_0xa62e('0x181')]>=_0x3146a5[_0xa62e('0x188')]-0x1){return!![];}else{this[_0xa62e('0xbf')]({'active':![],'countbusyretry':_0x277b37['countbusyretry']+=0x1,'scheduledat':moment()[_0xa62e('0x184')](_0x3146a5[_0xa62e('0x189')],_0xa62e('0x186'))[_0xa62e('0x78')](_0xa62e('0xf7')),'ContactId':_0x277b37[_0xa62e('0xce')],'ListId':_0x277b37[_0xa62e('0x112')],'VoiceQueueId':_0x277b37[_0xa62e('0x113')]||undefined,'CampaignId':_0x277b37[_0xa62e('0xd0')]||undefined})[_0xa62e('0xaf')](loggerCatch(_0xa62e('0x18a')));}break;case 0x8:if(_0x277b37[_0xa62e('0x18b')]>=_0x3146a5[_0xa62e('0x18c')]-0x1){return!![];}else{this[_0xa62e('0xbf')]({'active':![],'countcongestionretry':_0x277b37[_0xa62e('0x18b')]+=0x1,'scheduledat':moment()[_0xa62e('0x184')](_0x3146a5['dialCongestionRetryFrequency'],'minutes')[_0xa62e('0x78')](_0xa62e('0xf7')),'ContactId':_0x277b37[_0xa62e('0xce')],'ListId':_0x277b37[_0xa62e('0x112')],'VoiceQueueId':_0x277b37[_0xa62e('0x113')]||undefined,'CampaignId':_0x277b37[_0xa62e('0xd0')]||undefined})[_0xa62e('0xaf')](loggerCatch(_0xa62e('0x18d')));}break;default:return!![];}};Dialer[_0xa62e('0x18')][_0xa62e('0x17e')]=function(_0x471f0c,_0x5e0b49,_0x40888f){var _0x11e4fe=this;var _0x344df4=new History(_0x471f0c);return new BPromise(function(_0x9de3ec,_0x38a105){if(_[_0xa62e('0x3e')](_0x5e0b49)&&'object'!==typeof _0x5e0b49){return _0x38a105(msgResponse(_0xa62e('0x18e'),_0xa62e('0x129'),_0xa62e('0x18f')));}if(_['isUndefined'](_0x40888f)&&'object'!==typeof _0x40888f){return _0x38a105(msgResponse(_0xa62e('0x18e'),'Failure',_0xa62e('0x190')));}switch(_0x40888f[_0xa62e('0xf3')]){case'0':_0x5e0b49['outboundNoSuchCallsDay']+=0x1;_0x344df4['state']=0x0;_0x344df4[_0xa62e('0xa7')]='NoSuchNumber';_0x11e4fe[_0xa62e('0xc7')](_0x344df4)[_0xa62e('0xaf')](loggerCatch(_0xa62e('0x191')));if(_0x11e4fe[_0xa62e('0x180')](0x0,_0x471f0c,_0x5e0b49)){if(_0x344df4[_0xa62e('0x181')]+_0x344df4[_0xa62e('0x18b')]+_0x344df4[_0xa62e('0x192')]>=_0x5e0b49[_0xa62e('0x182')]){_0x11e4fe[_0xa62e('0x193')](_0x344df4,_0x9de3ec,_0x38a105,'reason\x200\x20no\x20such\x20number....');}else{_0x11e4fe[_0xa62e('0x194')](_0x344df4,_0x9de3ec,_0x38a105,_0xa62e('0x195'));}}break;case'3':_0x5e0b49[_0xa62e('0x62')]+=0x1;_0x344df4[_0xa62e('0xa6')]=0x3;_0x344df4[_0xa62e('0xa7')]=_0xa62e('0x196');_0x344df4[_0xa62e('0x192')]+=0x1;_0x344df4[_0xa62e('0x197')]+=0x1;_0x11e4fe[_0xa62e('0xc7')](_0x344df4)['catch'](loggerCatch('[syncAgentComplete][createHistory][3]'));if(_0x11e4fe[_0xa62e('0x180')](0x3,_0x471f0c,_0x5e0b49)){if(_0x344df4[_0xa62e('0x192')]>=_0x5e0b49[_0xa62e('0x183')]){_0x11e4fe[_0xa62e('0x194')](_0x344df4,_0x9de3ec,_0x38a105,_0xa62e('0x198'));}else{_0x11e4fe['stateGlobal'](_0x344df4,_0x9de3ec,_0x38a105,_0xa62e('0x198'));}}break;case'5':_0x5e0b49[_0xa62e('0x5e')]+=0x1;_0x344df4[_0xa62e('0xa6')]=0x5;_0x344df4[_0xa62e('0xa7')]='Busy';_0x344df4['countbusyretry']+=0x1;_0x344df4[_0xa62e('0x197')]+=0x1;_0x11e4fe[_0xa62e('0xc7')](_0x344df4)['catch'](loggerCatch('[syncAgentComplete][createHistory][5]'));if(_0x11e4fe[_0xa62e('0x180')](0x5,_0x471f0c,_0x5e0b49)){if(_0x344df4[_0xa62e('0x181')]>=_0x5e0b49[_0xa62e('0x188')]){_0x11e4fe[_0xa62e('0x194')](_0x344df4,_0x9de3ec,_0x38a105,_0xa62e('0x199'));}else{_0x11e4fe[_0xa62e('0x193')](_0x344df4,_0x9de3ec,_0x38a105,'reason\x205\x20busy');}}break;case'8':_0x5e0b49[_0xa62e('0x5f')]+=0x1;_0x344df4['state']=0x8;_0x344df4[_0xa62e('0xa7')]=_0xa62e('0x19a');_0x344df4['countcongestionretry']+=0x1;_0x344df4[_0xa62e('0x197')]+=0x1;_0x11e4fe[_0xa62e('0xc7')](_0x344df4)[_0xa62e('0xaf')](loggerCatch(_0xa62e('0x19b')));if(_0x11e4fe[_0xa62e('0x180')](0x8,_0x471f0c,_0x5e0b49)){if(_0x344df4['countcongestionretry']>=_0x5e0b49[_0xa62e('0x18c')]){_0x11e4fe[_0xa62e('0x194')](_0x344df4,_0x9de3ec,_0x38a105,_0xa62e('0x19c'));}else{_0x11e4fe[_0xa62e('0x193')](_0x344df4,_0x9de3ec,_0x38a105,_0xa62e('0x19c'));}}break;default:_0x5e0b49['outboundUnknownCallsDay']+=0x1;_0x344df4['state']=0xc;_0x344df4[_0xa62e('0xa7')]=_0x40888f['reason'];_0x11e4fe[_0xa62e('0xc7')](_0x344df4)[_0xa62e('0xaf')](loggerCatch(_0xa62e('0x19d')));if(_0x11e4fe[_0xa62e('0x180')](_0x40888f[_0xa62e('0xf3')],_0x471f0c,_0x5e0b49)){if(_0x344df4[_0xa62e('0x181')]+_0x344df4[_0xa62e('0x18b')]+_0x344df4[_0xa62e('0x192')]>=_0x5e0b49[_0xa62e('0x182')]){_0x11e4fe[_0xa62e('0x193')](_0x344df4,_0x9de3ec,_0x38a105,_0x40888f[_0xa62e('0xf3')]);}else{_0x11e4fe[_0xa62e('0x194')](_0x344df4,_0x9de3ec,_0x38a105,_0x40888f['reason']);}}}});};Dialer[_0xa62e('0x18')][_0xa62e('0x193')]=function(_0x4c2594,_0x58da5c,_0x1f6456,_0x5cb914){var _0x5faf62=new Final(_0x4c2594);_0x5faf62['state']=0xf;_0x5faf62[_0xa62e('0xa7')]=_0xa62e('0x19e');this['createStateFinal'](_0x5faf62,_0x58da5c,_0x1f6456,_0x5cb914);};Dialer[_0xa62e('0x18')][_0xa62e('0x194')]=function(_0x35c5da,_0x7d79df,_0x13bac9,_0x3aef53){this[_0xa62e('0xc5')](_0x35c5da)['then'](function(_0x17ede4){return _0x7d79df(msgResponse(_0xa62e('0x18e'),_0xa62e('0xd3'),_0x3aef53));})[_0xa62e('0xaf')](function(_0x390144){return _0x13bac9(msgResponse('[moveContactManagedDialer][0]',_0xa62e('0x129'),'contact\x20not\x20moved'));});};Dialer[_0xa62e('0x18')][_0xa62e('0x7')]=function(_0xeb6af6){var _0x199022=this;var _0x2b5b0c=_0xeb6af6[_0xa62e('0x19f')]/0x64;var _0x31b7e5=_0xeb6af6[_0xa62e('0x100')]/(_0xeb6af6[_0xa62e('0x100')]+_0xeb6af6[_0xa62e('0xe3')]);var _0x10c4ad=Math[_0xa62e('0x1a0')](_0xeb6af6[_0xa62e('0x70')]*(_0xeb6af6[_0xa62e('0x1a1')]/0x64));var _0x4722c5=Math[_0xa62e('0x1a0')](_0xeb6af6[_0xa62e('0x70')]*(_0xeb6af6[_0xa62e('0x1a2')]/0x64));var _0x3f2b26=_0xeb6af6[_0xa62e('0x4f')]+_0xeb6af6[_0xa62e('0xa0')];var _0x50674d=Math[_0xa62e('0x1a3')](_0xeb6af6[_0xa62e('0x73')]*_0xeb6af6[_0xa62e('0x8b')]*_0xeb6af6[_0xa62e('0x6d')]*_0xeb6af6[_0xa62e('0x6e')]);if(_['isUndefined'](_0xeb6af6[_0xa62e('0x27')])){if(!_[_0xa62e('0x3e')](_0xeb6af6[_0xa62e('0x26')])){_0xeb6af6[_0xa62e('0x26')]=undefined;loggerPredictive[_0xa62e('0x96')](_0xa62e('0x1a4'),_0xa62e('0x1a5'));}if(!_['isUndefined'](_0xeb6af6['handlePredictive'])){loggerPredictive[_0xa62e('0x96')](_0xa62e('0x1a4'),_0xa62e('0x1a6'));clearInterval(_0xeb6af6[_0xa62e('0x8f')]);_0xeb6af6['handlePredictive']=undefined;}_0xeb6af6[_0xa62e('0x27')]=moment()[_0xa62e('0x78')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0xa62e('0x7d')](_0xeb6af6['name'],'collection\x20data\x20in\x20progressive\x20at',_0xeb6af6['startProgressive']);this[_0xa62e('0x141')](_0xeb6af6,0x1);}else if(ifInterval(_0xeb6af6[_0xa62e('0x1a7')],_0xeb6af6[_0xa62e('0x27')])){this[_0xa62e('0x141')](_0xeb6af6,0x1);loggerPredictiveCalls[_0xa62e('0x7d')](_0xa62e('0x1a8'),_0xeb6af6['startProgressive'],_0xeb6af6[_0xa62e('0x41')]);_0xeb6af6['erlangCalls']=0x0;_0xeb6af6['predictiveIntervalErlangCallsDroppedCalls']=0x0;}else if(_0x2b5b0c<_0x31b7e5&&_0xeb6af6[_0xa62e('0x1a9')]===_0xa62e('0x1aa')){freeVariablesPredictive(_0xeb6af6);loggerPredictive[_0xa62e('0x7d')]('[stopMethodPredictive][ReStartProgressive][ExceededDropDay]',_0xa62e('0x1ab'),_0x31b7e5,'startProgressive',_0xeb6af6[_0xa62e('0x41')]);}else if(_0x50674d<_0xeb6af6[_0xa62e('0x6c')]&&_0xeb6af6[_0xa62e('0x1a9')]===_0xa62e('0x1aa')){freeVariablesPredictive(_0xeb6af6);loggerPredictive['info'](_0xa62e('0x1ac'),_0xa62e('0x1ad'),_0x50674d,_0xa62e('0x1ae'),_0xeb6af6['predictiveIntervalErlangCallsDroppedCalls'],_0xa62e('0x27'),_0xeb6af6[_0xa62e('0x41')]);}else if(!ifInterval(_0xeb6af6[_0xa62e('0x1a7')],_0xeb6af6['startProgressive'])&&_[_0xa62e('0x3e')](_0xeb6af6[_0xa62e('0x26')])&&!_['isUndefined'](_0xeb6af6['startProgressive'])){_0xeb6af6[_0xa62e('0x26')]=moment()[_0xa62e('0x78')](_0xa62e('0xf7'));loggerPredictive[_0xa62e('0x7d')](_0xeb6af6[_0xa62e('0x41')],_0xa62e('0x1af'),_0xeb6af6[_0xa62e('0x26')]);this[_0xa62e('0xbd')](_0xeb6af6[_0xa62e('0x1a7')])[_0xa62e('0xb8')](this['getDataPredictive'](_0xeb6af6))['then'](mergeDataErlangB(_0xeb6af6))['then'](this[_0xa62e('0x1b0')](_0xeb6af6))['catch'](loggerCatchPredictive('Predictive\x20after\x20first\x20interval',_0xeb6af6));}else if(!ifInterval(_0xeb6af6[_0xa62e('0x1a7')],_0xeb6af6[_0xa62e('0x26')])){_0xeb6af6[_0xa62e('0x6c')]=0x0;_0xeb6af6[_0xa62e('0x26')]=moment()[_0xa62e('0x78')](_0xa62e('0xf7'));loggerPredictive[_0xa62e('0x7d')](_0xeb6af6[_0xa62e('0x41')],_0xa62e('0x1b1'),_0xeb6af6[_0xa62e('0x26')]);clearInterval(_0xeb6af6[_0xa62e('0x8f')]);_0xeb6af6['handlePredictive']=undefined;this[_0xa62e('0xbd')](_0xeb6af6[_0xa62e('0x1a7')])['then'](this[_0xa62e('0x1b2')](_0xeb6af6))[_0xa62e('0xb8')](mergeDataErlangB(_0xeb6af6))[_0xa62e('0xb8')](this[_0xa62e('0x1b0')](_0xeb6af6))[_0xa62e('0xaf')](loggerCatchPredictive(_0xa62e('0x1b3'),_0xeb6af6));}else if(_0xeb6af6[_0xa62e('0x70')]&&_0x3f2b26<_0xeb6af6['predictiveIntervalAvailable']-_0x4722c5){freeVariablesPredictive(_0xeb6af6);loggerPredictive[_0xa62e('0x7d')](_0xeb6af6[_0xa62e('0x41')],'switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',_0x3f2b26,_0xa62e('0x1b4'),_0xeb6af6['predictiveIntervalAvailable'],'-',_0x4722c5,'=',_0xeb6af6[_0xa62e('0x70')]-_0x4722c5,')');}else if(_0xeb6af6[_0xa62e('0x70')]&&_0x3f2b26>_0xeb6af6['predictiveIntervalAvailable']+_0x10c4ad){freeVariablesPredictive(_0xeb6af6);loggerPredictive[_0xa62e('0x7d')](_0xeb6af6['name'],_0xa62e('0x1b5'),_0x3f2b26,_0xa62e('0x1b6'),_0xeb6af6[_0xa62e('0x70')],'+',_0x10c4ad,'=',_0xeb6af6[_0xa62e('0x70')]+_0x10c4ad,')');}};Dialer['prototype'][_0xa62e('0x1b2')]=function(_0xe1d6fe){var _0x37f52a=this;return function(_0x476341){return new BPromise(function(_0x2d9aa0,_0x18658c){_[_0xa62e('0x8c')](_0xe1d6fe,_0x476341[0x0]);if(checkGetDataPredictive(_0x476341[0x0])){var _0x122f8b=_0xe1d6fe[_0xa62e('0x70')]=_0xe1d6fe[_0xa62e('0xa0')]+_0xe1d6fe[_0xa62e('0x4f')];var _0x53cdf6=_0xe1d6fe['dialPredictiveInterval']*0x3c;var _0x54f6a2=_0x476341[0x0]['predictiveIntervalAvgTalktime']+_0x476341[0x0][_0xa62e('0x68')];var _0x132fba=(_0x476341[0x0][_0xa62e('0x67')]+_0x476341[0x0][_0xa62e('0x6b')]+_0x476341[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x476341[0x0][_0xa62e('0x71')];_0xe1d6fe[_0xa62e('0x6d')]=_0x132fba>0x0?_0x132fba:0x1;switch(_0xe1d6fe['dialPredictiveOptimization']){case'dropRate':var _0x23d335=_0xe1d6fe['dialPredictiveOptimizationPercentage']/0x64;return _0x37f52a[_0xa62e('0x1b7')](_0x122f8b,_0x53cdf6,_0x54f6a2,_0x132fba,_0x23d335)[_0xa62e('0xb8')](function(_0x28deeb){return _0x2d9aa0(_0x28deeb);});case _0xa62e('0x1b8'):var _0x429c25=_0xe1d6fe[_0xa62e('0x19f')]/0x64;return _0x37f52a[_0xa62e('0x1b9')](_0x122f8b,_0x53cdf6,_0x54f6a2,_0x132fba,_0x429c25)[_0xa62e('0xb8')](function(_0x2269ab){return _0x2d9aa0(_0x2269ab);});default:return _0x18658c(msgResponse(_0xa62e('0x1ba'),_0xa62e('0x129'),'Unknown\x20Predictive'));}}else{return _0x18658c(msgResponse(_0xa62e('0x1ba'),'Failure',_0xa62e('0x1bb')));}});};};Dialer[_0xa62e('0x18')][_0xa62e('0x1bc')]=function(_0x250a5d){var _0x50d6cf=this;return function(_0x13b0f3){return new BPromise(function(_0x39a7ad,_0x4c9cc4){_[_0xa62e('0x8c')](_0x250a5d,_0x13b0f3[0x0]);if(checkGetDataPredictive(_0x13b0f3[0x0])){loggerPredictive['info'](JSON[_0xa62e('0x47')](_0x13b0f3[0x0]));if(_0x250a5d[_0xa62e('0x1a9')]===_0xa62e('0x1aa')){return _0x50d6cf[_0xa62e('0xc4')](_0x250a5d['id'])['then'](function(_0xf7b031){var _0x20cb0b=_0x250a5d[_0xa62e('0x50')]-_0xf7b031[0x0]['outboundQueuePauses'];var _0x51b8aa=_0x250a5d['dialPredictiveInterval']*0x3c;var _0x12b70a=_0x13b0f3[0x0][_0xa62e('0x69')]+_0x13b0f3[0x0][_0xa62e('0x68')];var _0x324270=(_0x13b0f3[0x0]['predictiveIntervalAnsweredCalls']+_0x13b0f3[0x0][_0xa62e('0x6b')]+_0x13b0f3[0x0][_0xa62e('0x6a')])/_0x13b0f3[0x0][_0xa62e('0x71')];var _0xbe710e=_0x250a5d[_0xa62e('0x19f')]/0x64;_0x250a5d[_0xa62e('0x6f')]=_0xf7b031[0x0][_0xa62e('0x1bd')]||0x0;_0x250a5d[_0xa62e('0x6d')]=_0x324270>0x0?_0x324270:0x1;return _0x50d6cf['abandonmentRate'](_0x20cb0b,_0x51b8aa,_0x12b70a,_0x324270,_0xbe710e);})[_0xa62e('0xb8')](function(_0xab1e11){return _0x39a7ad(_0xab1e11);})[_0xa62e('0xaf')](function(_0x39a60f){return _0x4c9cc4(msgResponse(_0xa62e('0x1be'),_0xa62e('0x129'),JSON[_0xa62e('0x47')](_0x39a60f)));});}if(_0x250a5d[_0xa62e('0x1a9')]==='agentBusyFactor'){return _0x50d6cf[_0xa62e('0xc4')](_0x250a5d['id'])[_0xa62e('0xb8')](function(_0x103f10){var _0x30aec6=_0x250a5d['loggedIn']-_0x103f10[0x0][_0xa62e('0x1bd')];var _0x1daf93=_0x250a5d['dialPredictiveInterval']*0x3c;var _0x38da4e=_0x13b0f3[0x0][_0xa62e('0x69')]+_0x13b0f3[0x0]['predictiveIntervalAvgHoldtime'];var _0x37a272=(_0x13b0f3[0x0][_0xa62e('0x67')]+_0x13b0f3[0x0][_0xa62e('0x6b')]+_0x13b0f3[0x0][_0xa62e('0x6a')])/_0x13b0f3[0x0][_0xa62e('0x71')];var _0x48919a=_0x250a5d[_0xa62e('0x19f')]/0x64;_0x250a5d[_0xa62e('0x6f')]=_0x103f10[0x0][_0xa62e('0x1bd')]||0x0;_0x250a5d[_0xa62e('0x6d')]=_0x37a272>0x0?_0x37a272:0x1;return _0x50d6cf[_0xa62e('0x1b9')](_0x30aec6,_0x1daf93,_0x38da4e,_0x37a272,_0x48919a);})[_0xa62e('0xb8')](function(_0x2786a9){return _0x39a7ad(_0x2786a9);})[_0xa62e('0xaf')](function(_0x3b1d34){return _0x4c9cc4(msgResponse(_0xa62e('0x1be'),_0xa62e('0x129'),JSON[_0xa62e('0x47')](_0x3b1d34)));});}}else{return _0x4c9cc4(msgResponse(_0xa62e('0x1ba'),'Failure',_0xa62e('0x1bb')));}});};};Dialer['prototype'][_0xa62e('0x1b0')]=function(_0x15e8f3){var _0x273be0=this;return function(){var _0x2590ee=0x0;var _0x3dd021=Math['floor'](_0x15e8f3[_0xa62e('0x74')]*0x3e8);if(_0x3dd021>0x0){_0x3dd021=_0x3dd021<0x64?0x64:_0x3dd021;loggerPredictive['info'](_0x15e8f3[_0xa62e('0x41')],_0xa62e('0x1bf'),_0x3dd021,_0xa62e('0x48'));_0x15e8f3['handlePredictive']=setInterval(function(){_0x273be0[_0xa62e('0x8f')](_0x15e8f3);loggerPredictiveCalls['info'](_0xa62e('0x1c0'),_0x2590ee+=0x1);},_0x3dd021);}else{loggerPredictive[_0xa62e('0x7d')](_0x15e8f3[_0xa62e('0x41')],_0xa62e('0x1c1'));}};};Dialer[_0xa62e('0x18')][_0xa62e('0x1c2')]=function(_0x413d8b,_0x33db3f){var _0x345589=this;return function(_0x165ac5){if(_['isEmpty'](_0x165ac5)){if(_['isNil'](_0x33db3f[_0xa62e('0xcf')])||!_0x33db3f[_0xa62e('0x1c3')]){if(_0x413d8b['dialMethod']===_0xa62e('0x143')){_0x413d8b[_0xa62e('0x10d')]=_[_0xa62e('0x3e')](_0x413d8b[_0xa62e('0x10d')])?!![]:_0x413d8b['queueStatusComplete'];var _0x13a5c4=uuid['v4']();_0x345589[_0xa62e('0x23')][_0x13a5c4]=new Action(_0x413d8b,_0x33db3f,_0x13a5c4);loggerBooked[_0xa62e('0x7d')](_0xa62e('0x1c4'),_0x13a5c4,_0xa62e('0x1c5'),JSON[_0xa62e('0x47')](_0x413d8b[_0xa62e('0x10d')]),_0xa62e('0x1c6'),_0x413d8b[_0xa62e('0x41')]);if(_0x413d8b[_0xa62e('0x10d')]){_0x413d8b['queueStatusComplete']=![];_0x345589[_0xa62e('0x29')][_0x345589[_0xa62e('0x23')][_0x13a5c4]['queue']]=[];ami['Action']({'actionid':_0x13a5c4,'action':_0xa62e('0x1c7'),'queue':_0x413d8b['name']})['catch'](function(_0x48c4e5){_0x345589[_0xa62e('0xb2')](_0x413d8b);_0x345589[_0xa62e('0xbf')]({'active':![],'ContactId':_0x345589['actions'][_0x13a5c4][_0xa62e('0xce')],'ListId':_0x345589[_0xa62e('0x23')][_0x13a5c4][_0xa62e('0x112')],'VoiceQueueId':_0x345589[_0xa62e('0x23')][_0x13a5c4][_0xa62e('0x113')]||undefined,'CampaignId':_0x345589[_0xa62e('0x23')][_0x13a5c4][_0xa62e('0xd0')]||undefined})[_0xa62e('0xaf')](loggerCatch(_0xa62e('0x1c8')));delete _0x345589[_0xa62e('0x23')][_0x13a5c4];});}else{loggerBooked[_0xa62e('0x7d')](_0xa62e('0x1c9'),JSON[_0xa62e('0x47')](_0x413d8b[_0xa62e('0x10d')]),_0xa62e('0x1c6'),_0x413d8b[_0xa62e('0x41')]);_0x345589[_0xa62e('0xb2')](_0x413d8b);_0x345589[_0xa62e('0xbf')]({'active':![],'ContactId':_0x345589[_0xa62e('0x23')][_0x13a5c4][_0xa62e('0xce')],'ListId':_0x345589[_0xa62e('0x23')][_0x13a5c4][_0xa62e('0x112')],'VoiceQueueId':_0x345589[_0xa62e('0x23')][_0x13a5c4][_0xa62e('0x113')]||undefined,'CampaignId':_0x345589[_0xa62e('0x23')][_0x13a5c4]['CampaignId']||undefined})[_0xa62e('0xaf')](loggerCatch(_0xa62e('0x1c8')));delete _0x345589[_0xa62e('0x23')][_0x13a5c4];}}else{return _0x345589[_0xa62e('0x14d')](_0x413d8b,_0x33db3f);}}else{if(getDiff(_0x33db3f[_0xa62e('0x1ca')])<_0x413d8b['dialRecallMeTimeout']*0x3c){_0x345589['preview'][_0xa62e('0x110')](_0x33db3f['id'])[_0xa62e('0x1b')](function(){_0x345589[_0xa62e('0xb2')](_0x413d8b);});}else{_0x413d8b[_0xa62e('0x65')]+=0x1;_0x345589[_0xa62e('0xb2')](_0x413d8b);if(_0x413d8b[_0xa62e('0x1cb')]){_0x345589[_0xa62e('0xbf')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x33db3f[_0xa62e('0xce')],'ListId':_0x33db3f[_0xa62e('0x112')],'VoiceQueueId':_0x33db3f[_0xa62e('0x113')]||undefined,'CampaignId':_0x33db3f[_0xa62e('0xd0')]||undefined})['catch'](loggerCatch('[rescheduleContact][dialRecallInQueue]'));_0x345589[_0xa62e('0xc7')](createObjHistory(_0x413d8b,_0x33db3f,_0xa62e('0x1cc'),0x17,'RecallInQueue'))[_0xa62e('0xaf')](loggerCatch(_0xa62e('0x1cd')));}else{_0x345589['saveInDb'](createObjHistory(_0x413d8b,_0x33db3f,_0xa62e('0x1ce'),0x16,_0xa62e('0x1cf')),'[Originate][HistoryRecallClose][historyCatch]',_0xa62e('0x1d0'));}}}}else{_0x413d8b['outboundBlacklistCallsDay']+=0x1;_0x345589[_0xa62e('0xcc')](createObjHistory(_0x413d8b,_0x33db3f,_0xa62e('0x1d1'),0xd,'Blacklist'),_0xa62e('0x1d2'),_0xa62e('0x1d3'));throw _0xa62e('0x1d4');}};};Dialer[_0xa62e('0x18')][_0xa62e('0x1d5')]=function(_0x469512){var _0x3242bd=this;var _0x59e1c3=[];var _0xb24db5=_0x469512[_0xa62e('0x1d6')]-_0x469512['originated']-_0x469512[_0xa62e('0x1d7')];emitCampaignSummary(_0x469512);if(_0xb24db5>0x0){if(_0xb24db5>this[_0xa62e('0x21')]){_0xb24db5=this[_0xa62e('0x21')];}_0x469512[_0xa62e('0x1d7')]+=_0xb24db5;this[_0xa62e('0xc3')](_0x469512['id'],_0xb24db5,_0x469512[_0xa62e('0x1d8')])[_0xa62e('0xb8')](function(_0x5d4d64){_0x469512['temp']-=_0xb24db5;_0x469512[_0xa62e('0x1d7')]=_0x469512[_0xa62e('0x1d7')]>0x0?_0x469512['temp']:0x0;if(!checkContactEmpty(_0x5d4d64)){_0x469512['message']=_0xa62e('0x1d9');logger[_0xa62e('0x7d')](_0xa62e('0x1da')+_0x469512['name']);}else{_0x469512[_0xa62e('0x72')]+=_0x5d4d64[_0xa62e('0x98')];_0x469512[_0xa62e('0x3f')]=_0xa62e('0x1db');for(var _0x3c93a2=0x0;_0x3c93a2<_0x5d4d64['length'];_0x3c93a2+=0x1){_0x469512[_0xa62e('0x1dc')]+=0x1;if(_[_0xa62e('0xac')](_0x5d4d64[_0x3c93a2])||_[_0xa62e('0xac')](_0x5d4d64[_0x3c93a2][_0xa62e('0x169')])||_[_0xa62e('0xac')](_0x5d4d64[_0x3c93a2]['Contact'][_0xa62e('0x150')])){_0x3242bd['emptyContact'](_0xa62e('0x1dd'),_0x469512,_0x5d4d64[_0x3c93a2]);}else{_0x3242bd[_0xa62e('0xbc')](_[_0xa62e('0xcd')](_0x5d4d64[_0x3c93a2],['CampaignId',_0xa62e('0x1de')]))[_0xa62e('0xb8')](_0x3242bd[_0xa62e('0x1c2')](_0x469512,_0x5d4d64[_0x3c93a2]))[_0xa62e('0xaf')](_0x3242bd[_0xa62e('0x1df')]('[actionOriginateIvr]\x20',_0x469512));}}}})[_0xa62e('0xaf')](loggerGetContactDialer(_0xa62e('0x1e0'),_0x469512,_0xb24db5));}};Dialer[_0xa62e('0x18')][_0xa62e('0x141')]=function(_0x469b58,_0x42b939){var _0x26e694=this;var _0x2f8570=[];var _0x2f2ec8=_0x42b939>=0x1?_0x42b939:0x1;var _0xcbd47b=[];if(_0x469b58[_0xa62e('0x13e')]===_0xa62e('0x143')){_0x2f2ec8=0x1;}var _0x5a4388=Math[_0xa62e('0x1a3')](_0x469b58[_0xa62e('0x4f')]*_0x2f2ec8)-_0x469b58['originated']-_0x469b58[_0xa62e('0x1d7')];emitVoiceQueueSummary(_0x469b58);if(_0x469b58[_0xa62e('0x1e1')]>0x0){var _0x4c6d70=_0x469b58[_0xa62e('0x1e1')]-_0x469b58[_0xa62e('0x72')]-_0x469b58[_0xa62e('0xa0')]-_0x469b58['temp']-_0x469b58[_0xa62e('0x51')];if(_0x5a4388>_0x4c6d70){_0x5a4388=_0x4c6d70;}}if(_0x5a4388>0x0){if(_0x469b58[_0xa62e('0x13e')]==='booked'){_0x5a4388=0x1;}if(_0x5a4388>this[_0xa62e('0x21')]){_0x5a4388=this['maxNumberOriginate'];}_0x469b58[_0xa62e('0x1d7')]+=_0x5a4388;for(var _0x15cda7 in this['agents']){if(this[_0xa62e('0x1f')][_0xa62e('0x99')](_0x15cda7)){if(this[_0xa62e('0x1f')][_0x15cda7][_0xa62e('0xa6')]==='not_inuse'&&this[_0xa62e('0x1f')][_0x15cda7][_0xa62e('0xae')]==='reachable'){_0x2f8570[_0xa62e('0x130')](this[_0xa62e('0x1f')][_0x15cda7]['id']);}}}this[_0xa62e('0xc1')](_0x469b58['id'],_0x2f8570,_0x5a4388,_0x469b58['dialOrderByScheduledAt'])['then'](function(_0x39f3c0){_0x469b58[_0xa62e('0x1d7')]-=_0x5a4388;_0x469b58[_0xa62e('0x1d7')]=_0x469b58[_0xa62e('0x1d7')]>0x0?_0x469b58['temp']:0x0;if(!checkContactEmpty(_0x39f3c0)){_0x26e694[_0xa62e('0xb6')](_0x469b58)['then'](sendMessageReschedule(_0x469b58))[_0xa62e('0xaf')](loggerCatch(_0xa62e('0xb9')));}else{_0x469b58[_0xa62e('0x72')]+=_0x39f3c0[_0xa62e('0x98')];_0x469b58[_0xa62e('0x3f')]=_0x469b58[_0xa62e('0x13e')]==='booked'?_0xa62e('0x1e2'):_0xa62e('0x1db');for(var _0x5d6d8a=0x0;_0x5d6d8a<_0x39f3c0[_0xa62e('0x98')];_0x5d6d8a+=0x1){if(_['isNil'](_0x39f3c0[_0x5d6d8a])||_[_0xa62e('0xac')](_0x39f3c0[_0x5d6d8a][_0xa62e('0x169')])||_[_0xa62e('0xac')](_0x39f3c0[_0x5d6d8a]['Contact'][_0xa62e('0x150')])){_0x26e694[_0xa62e('0xcb')]('[actionOriginate]\x20',_0x469b58,_0x39f3c0[_0x5d6d8a]);}else{_0x26e694[_0xa62e('0xba')](_[_0xa62e('0xcd')](_0x39f3c0[_0x5d6d8a],[_0xa62e('0x113'),'Contact.phone']))['then'](_0x26e694[_0xa62e('0x1c2')](_0x469b58,_0x39f3c0[_0x5d6d8a]))['catch'](_0x26e694['loggerHandler'](_0xa62e('0x1dd'),_0x469b58));}}}})[_0xa62e('0xaf')](loggerGetContactDialer(_0xa62e('0x1e3'),_0x469b58,_0x5a4388));}};Dialer['prototype']['handlePredictive']=function(_0xb356a5){var _0xbfa000=this;if(_0xb356a5['dialLimitQueue']>0x0){var _0x12402e=_0xb356a5['dialLimitQueue']-_0xb356a5['originated']-_0xb356a5['talking'];if(_0x12402e>0x0){this['tryOriginatePredictive'](_0xb356a5);}else{loggerPredictiveCalls['info'](_0xa62e('0x1e4'));}}else{this['tryOriginatePredictive'](_0xb356a5);}};Dialer[_0xa62e('0x18')]['tryOriginatePredictive']=function(_0x5b242f){var _0x28f34c=this;var _0x49fb94=[];_0x5b242f[_0xa62e('0x72')]+=0x1;for(var _0x1810e1 in this[_0xa62e('0x1f')]){if(this[_0xa62e('0x1f')][_0xa62e('0x99')](_0x1810e1)){if(this[_0xa62e('0x1f')][_0x1810e1]['state']===_0xa62e('0x1e5')&&this[_0xa62e('0x1f')][_0x1810e1][_0xa62e('0xae')]===_0xa62e('0xd6')){_0x49fb94[_0xa62e('0x130')](this[_0xa62e('0x1f')][_0x1810e1]['id']);}}}this[_0xa62e('0xc1')](_0x5b242f['id'],_0x49fb94,0x1,_0x5b242f['dialOrderByScheduledAt'])['then'](function(_0x240b8f){if(!checkContactEmpty(_0x240b8f)){checkContactLowerLimitOriginate(_0x5b242f,0x1,0x0);_0x28f34c[_0xa62e('0xb6')](_0x5b242f)[_0xa62e('0xb8')](sendMessageReschedule(_0x5b242f))[_0xa62e('0xaf')](loggerCatch(_0xa62e('0xb9')));}else{_0x5b242f[_0xa62e('0x3f')]=_0xa62e('0x1db');if(_['isNil'](_0x240b8f[0x0])||_[_0xa62e('0xac')](_0x240b8f[0x0][_0xa62e('0x169')])||_['isNil'](_0x240b8f[0x0]['Contact'][_0xa62e('0x150')])){_0x28f34c[_0xa62e('0xcb')](_0xa62e('0x1dd'),_0x5b242f,_0x240b8f[0x0]);}else{_0x28f34c[_0xa62e('0xba')](_[_0xa62e('0xcd')](_0x240b8f[0x0],[_0xa62e('0x113'),_0xa62e('0x1de')]))['then'](_0x28f34c[_0xa62e('0x1c2')](_0x5b242f,_0x240b8f[0x0]))[_0xa62e('0xaf')](_0x28f34c[_0xa62e('0x1df')](_0xa62e('0x1e6'),_0x5b242f));}}})['catch'](loggerGetContactDialer(_0xa62e('0x1e7'),_0x5b242f,0x1));emitVoiceQueueSummary(_0x5b242f);};Dialer[_0xa62e('0x18')][_0xa62e('0x1b7')]=function(_0x34b357,_0x399e7f,_0x591d56,_0x5d7f0f,_0x5b57b8,_0x5ef4d0){loggerPredictive[_0xa62e('0x7d')]('--------\x20Drop\x20Rate\x20--------');loggerPredictive[_0xa62e('0x7d')](_0xa62e('0x1e8'),_0x34b357);loggerPredictive['info']('Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x399e7f);loggerPredictive['info'](_0xa62e('0x1e9'),_0x591d56);loggerPredictive[_0xa62e('0x7d')](_0xa62e('0x1ea'),_0x5d7f0f);loggerPredictive['info'](_0xa62e('0x1eb'),_0x5b57b8);loggerPredictive[_0xa62e('0x7d')](_0xa62e('0x83'));return new BPromise(function(_0x59df0b,_0x495141){if(_0x34b357<=0x0||isNaN(_0x34b357)){return _0x495141(msgResponse(_0xa62e('0x1ec'),_0xa62e('0x17b'),_0xa62e('0x1ed')+_0x34b357));}if(_0x591d56<=0x0||isNaN(_0x591d56)){return _0x495141(msgResponse(_0xa62e('0x1ec'),_0xa62e('0x17b'),_0xa62e('0x1ee')+_0x591d56));}if(_0x5d7f0f<=0x0||isNaN(_0x5d7f0f)){return _0x495141(msgResponse(_0xa62e('0x1ec'),_0xa62e('0x17b'),_0xa62e('0x1ef')+_0x5d7f0f));}if(_0x399e7f<=0x0||isNaN(_0x399e7f)){return _0x495141(msgResponse(_0xa62e('0x1ec'),_0xa62e('0x17b'),'interval\x20=\x20'+_0x399e7f));}if(_0x5b57b8<=0x0||isNaN(_0x5b57b8)){return _0x495141(msgResponse(_0xa62e('0x1ec'),_0xa62e('0x17b'),_0xa62e('0x1f0')+_0x5b57b8));}_0x5ef4d0=_0x5ef4d0||0x0;var _0x4a8e41=0x1/_0x591d56;var _0x5b292b=0x0;var _0x158ddb=0x0;var _0x2f72f3=0x0;var _0x35f924=0x0;for(var _0x88961d=0x0;_0x2f72f3<_0x5b57b8;_0x88961d+=0x1){_0x158ddb=_0x88961d/_0x399e7f;_0x5b292b=(_0x5d7f0f*_0x158ddb+_0x5ef4d0)/_0x4a8e41;_0x2f72f3=erlangb(_0x5b292b,_0x34b357);_0x35f924=_0x5b292b/_0x34b357*(0x1-erlangb(_0x5b292b,_0x34b357));}return _0x59df0b({'erlangCalls':_0x88961d,'erlangCallToSecond':_0x399e7f/_0x88961d,'erlangAbandonmentRate':_0x2f72f3,'erlangBusyFactor':_0x35f924});});};Dialer[_0xa62e('0x18')][_0xa62e('0x1b9')]=function(_0x386099,_0x30bfe1,_0x42de3a,_0x4dab22,_0x55f06b,_0x11295b){loggerPredictive[_0xa62e('0x7d')](_0xa62e('0x1f1'));loggerPredictive[_0xa62e('0x7d')](_0xa62e('0x1e8'),_0x386099);loggerPredictive['info'](_0xa62e('0x1f2'),_0x30bfe1);loggerPredictive[_0xa62e('0x7d')](_0xa62e('0x1e9'),_0x42de3a);loggerPredictive[_0xa62e('0x7d')](_0xa62e('0x1ea'),_0x4dab22);loggerPredictive[_0xa62e('0x7d')](_0xa62e('0x1f3'),_0x55f06b);loggerPredictive[_0xa62e('0x7d')]('---------------------------');return new BPromise(function(_0x77a33f,_0x33457e){if(_0x386099<=0x0||isNaN(_0x386099)){return _0x33457e(msgResponse(_0xa62e('0x1f4'),'Error',_0xa62e('0x1ed')+_0x386099));}if(_0x42de3a<=0x0||isNaN(_0x42de3a)){return _0x33457e(msgResponse(_0xa62e('0x1f4'),_0xa62e('0x17b'),'Ts\x20=\x20'+_0x42de3a));}if(_0x4dab22<=0x0||isNaN(_0x4dab22)){return _0x33457e(msgResponse(_0xa62e('0x1f4'),'Error',_0xa62e('0x1ef')+_0x4dab22));}if(_0x30bfe1<=0x0||isNaN(_0x30bfe1)){return _0x33457e(msgResponse(_0xa62e('0x1f4'),_0xa62e('0x17b'),_0xa62e('0x1f5')+_0x30bfe1));}if(_0x55f06b<=0x0||isNaN(_0x55f06b)){return _0x33457e(msgResponse(_0xa62e('0x1f4'),'Error',_0xa62e('0x1f6')+_0x55f06b));}_0x11295b=_0x11295b||0x0;var _0x226f09=0x1/_0x42de3a;var _0x16be7a=0x0;var _0xec8a79=0x0;var _0x10a9f1=0x0;var _0x325485=0x0;for(var _0x54d16d=0x0;_0x325485<_0x55f06b;_0x54d16d+=0x1){_0xec8a79=_0x54d16d/_0x30bfe1;_0x16be7a=(_0x4dab22*_0xec8a79+_0x11295b)/_0x226f09;_0x10a9f1=erlangb(_0x16be7a,_0x386099);_0x325485=_0x16be7a/_0x386099*(0x1-erlangb(_0x16be7a,_0x386099));}return _0x77a33f({'erlangCalls':_0x54d16d,'erlangCallToSecond':_0x30bfe1/_0x54d16d,'erlangAbandonmentRate':_0x10a9f1,'erlangBusyFactor':_0x325485});});};module[_0xa62e('0x1f7')]=Dialer; \ No newline at end of file +var _0xe91c=['agent','agiafterat','dialAgiAfterHangupAgent','YYYY-MM-DD\x20HH:mm:ss','[syncAgentComplete][createHistory]','[syncAgentComplete]','syncAgentConnect','answertime','queueCallerAbandonCreateState','[syncQueueCallerAbandon]\x20[Drop]','syncQueueCallerAbandon','droptime','responsetime','dialQueueTimeout','dropreason','dialQueueProject2','syncQueueMember','actionid','strategy','roundrobin','paused','stateinterface','locked','push','merge','idHopper','queueStatusComplete','[Catch][Preview][syncQueueStatusComplete]','finally','[unlock][syncQueueStatusComplete]','_rr','length','unlockRR','[booked][RR]','Agent:\x20','contactAgent-idHopper:\x20','run','[booked][RR][finaly]','[booked][unlock]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','syncCampaigns','checkIsTrunkReachable','TRUNK_IS_NOT_REACHABLE','checkIfTime','ifTime','checkIfTimeIntervals','Failure','INTERVAL_IS_EMPTY','timezones','\x20Timezone\x20unknow\x20','isArray','command','iftime\x20%s,%s','interval','content','indexOf','true','all','some','INTERVAL_IS_OVERTIME','[ifTime][promiseAll]','Global:\x20','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','checkDialMethod','progressive','handlePower','dialPowerLevel','Queue','method\x20not\x20recognized','launchHandleIvr','handleIvr','dialGlobalInterval','dialTimezone','[syncQueueSummary]','[syncCampaigns]','\x5cw{0,','pow','replace','random','match','voiceQueue\x20is\x20undefine','Contact','phone','originate','contact\x20is\x20undefine','getCaller','\x22agi://%s/square,%s\x22','NONE','\x22%s,%s%s,,,%s\x22','xcally-motion-dialer','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','XMD-AMDGREETING','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','tags','createdAt','%s%s','XMD-','toUpper','callerid','dialRandomLastDigitCallerIdNumber','TrunkBackup','XMD-ORIGINATECALLERIDNAME','originatecalleridname','XMD-ORIGINATECALLERIDNUM','originatecalleridnum','dialPrefix','trim','dialCutDigit','substring','from-sip','dialOriginateTimeout','OriginateError','[originate][error]','syncOriginateResponse','getQueue','response','callProgressDetecting','checkRetriveMax','countbusyretry','countcongestionretry','countnoanswerretry','dialGlobalMaxRetry','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','add','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','dialCongestionRetryFrequency','minutes','[rescheduleContact]\x20[Congestion]','object','[callProgressDetecting]','evt\x20is\x20undefine','NoSuchNumber','[syncAgentComplete][createHistory][0]','stateGlobal','NoAnswer','countglobal','[syncAgentComplete][createHistory][3]','createStateFinal','reason\x203\x20ringing\x20no\x20answer','Busy','[syncAgentComplete][createHistory][5]','dialBusyMaxRetry','reason\x205\x20busy','Congestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','[syncAgentComplete][createHistory][?]','Global','Success','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','round','predictiveIntervalMinThreshold','talking','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','dialPredictiveOptimization','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','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','busyFactor','[getDataPredictive]','check\x20failure','getDataPredictiveOld','outboundQueuePauses','[CatchErlangB]','agentBusyFactor','floor','one\x20call\x20every:','[handlePredictive]','fail\x20to\x20scheduled\x20calls','checkContactBlack','[booked][checkContactBlack]','queueStatusComplete:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','Queue:\x20','actionOriginate','scheduledat','dialRecallMeTimeout','outboundReCallsDay','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','RECALLINQUEUE','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','BLACKLIST','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','inBlackList','temp','dialOrderByScheduledAt','[getContactCampaign2][Empty]','RUNNING','[actionOriginate]\x20','Contact.phone','loggerHandler','[actionOriginateIvr]\x20','dialLimitQueue','not_inuse','reachable','ACTIVE','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','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','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]','p\x20=\x20','Umin\x20=\x20','util','lodash','bluebird','uuid','md5','ioredis','../../../config/environment/','../../../config/logger','dialer','booked','predictive','predictiveCalls','syncQueueSummary','redis','defaults','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','./action','./history','./final','./queueCallerAbandon','./hangup','env','XCALLY_IP_AGI','127.0.0.1','rrmemory','prototype','tail','sequence','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','actions','contactsId','uniqueId','startPredictive','startProgressive','ivrOriginated','queueBooked','queueBookedRR','agentconnect','bind','queuecallerabandon','originateresponse','agentcomplete','syncAgentComplete','custom:queuesummary','hangup','syncHangup','newexten','syncNewExten','varset','syncVarSet','queuemember','syncQueueStatusComplete','loopCampaigns','loopClearZombieChannels','message','name','\x20AGENTS\x20NOT\x20LOGGED','NOT_ACTIVE','\x20NOT\x20Active','INTERVAL_IS_NULL','Interval','\x20INTERVAL_IS_NULL','isEmpty','Intervals','[ifTime][Action]','Error','stringify','milliseconds','diff','seconds','answered','available','loggedIn','pTalking','sumDuration','sumHoldTime','type','unmanaged','waiting','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','originated','erlangCallToSecond','erlangAbandonmentRate','Trunk','active','format','voice:queue:%s','voice_queue:save','ivr','campaign:save','info','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalTotalCalls','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','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','predictiveIntervalAvgTalktime','---------------------------','isUndefined','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangCalls','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','clearing\x20variable\x20start\x20predictive','handlePredictive','clearing\x20variable\x20handle\x20predictive','outbound','preview','string','\x22%s\x22\x20<%s>','\x22\x22\x20<>','error','stack','inspect','hasOwnProperty','[decremetOriginate]\x20object\x20originated\x20is\x20negative','contactsRescheduled','RESCHEDULED_CONTACTS','[getContactDialer2][ReScheduled]','contacts','AVAILABLE_CONTACTS_FINISHED','[getContactDialer2][Empty]','sendMessageOneNotActive','is\x20not\x20active','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20disactive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','IS_DISACTIVED','state','statedesc','endtime','starttime','clearZombieChannels','[uniqueid]','[actions]','enqueue','Action','status','channel','catch','No\x20such\x20channel','updateOriginated','queue','[Dialer][checkChannel]','[Dialer][checkChannel][ivr]','countReScheduled','resolve','then','[countReScheduled]\x20','checkIsBlackList','[checkIsBlackList]\x20','checkIsBlackListIvr','averageHandleTime','avgHandleTime','[averageHandleTime]\x20','rescheduleContact','[rescheduleContact]\x20','getContactDialer','getContactDialerIvr','[getContactDialer]\x20','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','createHistory','[createHistory]\x20','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','emptyContact','notFound','saveInDb','pick','ContactId','ListId','UserId','VoiceQueueId','CampaignId','[emptyContact][createHistory]','[emptyContact]','isSuccess','isTrunkReachable','SIP/%s','isNil','amdstatus','exten','dialAMDActive','uniqueid','HangupInAMD','membername','AMD','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','value','MACHINE','amd','[syncMachine][createHistory]','[syncMachine]','HANGUP','[syncHangupInAMDIvr]','Machine','[syncMachineIvr]','ivrAnswerCallsDay','[syncHangupIvr]','dialQueueProject','AnswerAGI','outboundUnknownCallsDay','Unknow','[syncHangupIvr][createHistory]','reason'];(function(_0x125ff8,_0x41925f){var _0x2d9ef=function(_0x4ef34c){while(--_0x4ef34c){_0x125ff8['push'](_0x125ff8['shift']());}};_0x2d9ef(++_0x41925f);}(_0xe91c,0xfe));var _0xce91=function(_0x43cc86,_0x3fc33f){_0x43cc86=_0x43cc86-0x0;var _0x2d6abc=_0xe91c[_0x43cc86];return _0x2d6abc;};'use strict';var util=require(_0xce91('0x0'));var _=require(_0xce91('0x1'));var BPromise=require(_0xce91('0x2'));var uuid=require(_0xce91('0x3'));var moment=require('moment');var rr=require('rr');var md5=require(_0xce91('0x4'));var Redis=require(_0xce91('0x5'));var config=require(_0xce91('0x6'));var logger=require(_0xce91('0x7'))(_0xce91('0x8'));var loggerBooked=require(_0xce91('0x7'))(_0xce91('0x9'));var loggerPredictive=require(_0xce91('0x7'))(_0xce91('0xa'));var loggerPredictiveCalls=require(_0xce91('0x7'))(_0xce91('0xb'));var loggerSyncQueueSummary=require(_0xce91('0x7'))(_0xce91('0xc'));var ami=require('../ami');config[_0xce91('0xd')]=_[_0xce91('0xe')](config[_0xce91('0xd')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var cmHopper=require(_0xce91('0xf'));var cmHopperFinal=require('../rpc/cmHopperFinal');var cmHopperHistory=require(_0xce91('0x10'));var cmHopperBlack=require(_0xce91('0x11'));var voiceQueueRt=require(_0xce91('0x12'));var Action=require(_0xce91('0x13'));var History=require(_0xce91('0x14'));var Final=require(_0xce91('0x15'));var AgentComplete=require('./agentComplete');var QueueCallerAbandon=require(_0xce91('0x16'));var Hangup=require(_0xce91('0x17'));var ipAgi=process[_0xce91('0x18')][_0xce91('0x19')]||_0xce91('0x1a');var strategy={'rrmemory':_0xce91('0x1b'),'roundrobin':'roundrobin'};var Sequence=function(){};Sequence[_0xce91('0x1c')]['enqueue']=function(_0x389412){this[_0xce91('0x1d')]=this[_0xce91('0x1d')]?this[_0xce91('0x1d')]['finally'](_0x389412):_0x389412();};function Dialer(_0x3e46b3,_0x2e39ce){this[_0xce91('0x1e')]=new Sequence();this['preview']=_0x2e39ce;this[_0xce91('0x1f')]=_0x3e46b3[_0xce91('0x1f')];this[_0xce91('0x20')]=_0x3e46b3[_0xce91('0x20')];this['agents']=_0x3e46b3[_0xce91('0x21')];this[_0xce91('0x22')]=_0x3e46b3['trunks'];this[_0xce91('0x23')]=config[_0xce91('0x23')]||0x2;this['channels']={};this[_0xce91('0x24')]={};this[_0xce91('0x25')]={};this[_0xce91('0x26')]={};this['optionPredictive']={};this[_0xce91('0x27')]={};this[_0xce91('0x28')]={};this[_0xce91('0x29')]={};this[_0xce91('0x2a')]={};this[_0xce91('0x2b')]={};ami['on'](_0xce91('0x2c'),this['syncAgentConnect'][_0xce91('0x2d')](this));ami['on'](_0xce91('0x2e'),this['syncQueueCallerAbandon'][_0xce91('0x2d')](this));ami['on'](_0xce91('0x2f'),this['syncOriginateResponse'][_0xce91('0x2d')](this));ami['on'](_0xce91('0x30'),this[_0xce91('0x31')][_0xce91('0x2d')](this));ami['on'](_0xce91('0x32'),this[_0xce91('0xc')]['bind'](this));ami['on'](_0xce91('0x33'),this[_0xce91('0x34')][_0xce91('0x2d')](this));ami['on'](_0xce91('0x35'),this[_0xce91('0x36')]['bind'](this));ami['on'](_0xce91('0x37'),this[_0xce91('0x38')][_0xce91('0x2d')](this));ami['on'](_0xce91('0x39'),this['syncQueueMember'][_0xce91('0x2d')](this));ami['on']('queuestatuscomplete',this[_0xce91('0x3a')]['bind'](this));this[_0xce91('0x3b')]();this[_0xce91('0x3c')]();}function isNotNull(_0x463a9e){return _0x463a9e!==null&&!_['isUndefined'](_0x463a9e);}function checkIsLoggedIn(_0x5e313e,_0x5c786d){return function(){if(_0x5c786d<=0x0){_0x5e313e[_0xce91('0x3d')]='AGENTS_NOT_LOGGED';throw _0x5e313e[_0xce91('0x3e')]+_0xce91('0x3f');}};}function isActive(_0x3ec131){return _0x3ec131;}function checkIsActive(_0x57518d,_0x57e471){return function(){if(!isActive(_0x57e471)){_0x57518d[_0xce91('0x3d')]=_0xce91('0x40');throw _0x57518d[_0xce91('0x3e')]+_0xce91('0x41');}};}function checkInterval(_0x387fae){return function(){if(!isNotNull(_0x387fae['Interval'])){_0x387fae[_0xce91('0x3d')]=_0xce91('0x42');throw _0x387fae[_0xce91('0x3e')]+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_0x387fae[_0xce91('0x43')]['Intervals'])){_0x387fae[_0xce91('0x3d')]='INTERVAL_IS_NULL';throw _0x387fae[_0xce91('0x3e')]+_0xce91('0x44');}if(!isNotNull(_[_0xce91('0x45')](_0x387fae[_0xce91('0x43')][_0xce91('0x46')]))){_0x387fae[_0xce91('0x3d')]='INTERVAL_IS_NULL';throw _0x387fae[_0xce91('0x3e')]+_0xce91('0x44');}};}function msgResponse(_0x5688c8,_0x24e72a,_0x5f3fcd){return{'action':_0x5688c8,'response':_0x24e72a,'message':_0x5f3fcd,'stack':_0x5f3fcd};}function myreject(_0x54ed52){return function(_0x3ce0f4){return _0x54ed52(msgResponse(_0xce91('0x47'),_0xce91('0x48'),JSON[_0xce91('0x49')](_0x3ce0f4)));};}function getSeconds(_0x150e60,_0xbfdde1){var _0x1045eb=moment(_0x150e60)[_0xce91('0x4a')](0x0);var _0x370768=moment(_0xbfdde1)[_0xce91('0x4a')](0x0);return _0x1045eb[_0xce91('0x4b')](_0x370768,_0xce91('0x4c'));}function emit(_0x14e06e,_0xa722ab,_0x456068){io['to'](_0x14e06e)['emit'](_0xa722ab,_0x456068);}function emitVoiceQueueSummary(_0x521f9f){if(_0x521f9f['type']==='outbound'){var _0x46cc22={'id':_0x521f9f['id'],'name':_0x521f9f[_0xce91('0x3e')],'strategy':_0x521f9f['strategy'],'answered':_0x521f9f[_0xce91('0x4d')],'available':_0x521f9f[_0xce91('0x4e')],'loggedIn':_0x521f9f[_0xce91('0x4f')],'pTalking':_0x521f9f[_0xce91('0x50')],'sumBillable':_0x521f9f['sumBillable'],'sumDuration':_0x521f9f[_0xce91('0x51')],'sumHoldTime':_0x521f9f[_0xce91('0x52')]||0x0,'talking':_0x521f9f['talking'],'total':_0x521f9f['total'],'type':_0x521f9f[_0xce91('0x53')],'unmanaged':_0x521f9f[_0xce91('0x54')],'abandoned':_0x521f9f['abandoned'],'waiting':_0x521f9f[_0xce91('0x55')],'loggedInDb':_0x521f9f[_0xce91('0x56')],'dialActive':_0x521f9f[_0xce91('0x57')],'dialMethod':_0x521f9f[_0xce91('0x58')],'dialOriginateCallerIdName':_0x521f9f[_0xce91('0x59')],'dialOriginateCallerIdNumber':_0x521f9f[_0xce91('0x5a')],'dialOriginateTimeout':_0x521f9f['dialOriginateTimeout'],'dialPrefix':_0x521f9f['dialPrefix'],'outboundAnswerAgiCallsDay':_0x521f9f[_0xce91('0x5b')],'outboundAnswerCallsDay':_0x521f9f[_0xce91('0x5c')],'outboundBlacklistCallsDay':_0x521f9f[_0xce91('0x5d')],'outboundBusyCallsDay':_0x521f9f[_0xce91('0x5e')],'outboundCongestionCallsDay':_0x521f9f[_0xce91('0x5f')],'outboundDropCallsDayACS':_0x521f9f['outboundDropCallsDayACS'],'outboundDropCallsDayCallersExit':_0x521f9f[_0xce91('0x60')],'outboundDropCallsDayTimeout':_0x521f9f[_0xce91('0x61')],'outboundNoAnswerCallsDay':_0x521f9f[_0xce91('0x62')],'outboundNoSuchCallsDay':_0x521f9f[_0xce91('0x63')],'outboundOriginateFailureCallsDay':_0x521f9f[_0xce91('0x64')],'outboundReCallsDay':_0x521f9f['outboundReCallsDay'],'outboundRejectCallsDay':_0x521f9f[_0xce91('0x65')],'outboundUnknownCallsDay':_0x521f9f['outboundUnknownCallsDay'],'predictiveIntervalAnsweredCalls':_0x521f9f[_0xce91('0x66')],'predictiveIntervalAvgHoldtime':_0x521f9f[_0xce91('0x67')],'predictiveIntervalAvgTalktime':_0x521f9f['predictiveIntervalAvgTalktime'],'predictiveIntervalDroppedCallsCallersExit':_0x521f9f[_0xce91('0x68')],'predictiveIntervalDroppedCallsTimeout':_0x521f9f[_0xce91('0x69')],'predictiveIntervalErlangCalls':_0x521f9f['predictiveIntervalErlangCalls'],'predictiveIntervalErlangCallsDroppedCalls':_0x521f9f[_0xce91('0x6a')],'predictiveIntervalHitRate':_0x521f9f[_0xce91('0x6b')],'predictiveIntervalMultiplicativeFactor':_0x521f9f[_0xce91('0x6c')],'predictiveIntervalPauses':_0x521f9f[_0xce91('0x6d')],'predictiveIntervalAvailable':_0x521f9f[_0xce91('0x6e')],'predictiveIntervalTotalCalls':_0x521f9f['predictiveIntervalTotalCalls'],'message':_0x521f9f[_0xce91('0x3d')],'originated':_0x521f9f[_0xce91('0x6f')],'erlangCalls':_0x521f9f['erlangCalls'],'erlangCallToSecond':_0x521f9f[_0xce91('0x70')],'erlangAbandonmentRate':_0x521f9f[_0xce91('0x71')],'erlangBusyFactor':_0x521f9f['erlangBusyFactor'],'startPredictive':_0x521f9f[_0xce91('0x27')],'startProgressive':_0x521f9f['startProgressive']};if(_0x521f9f[_0xce91('0x72')]){_0x46cc22[_0xce91('0x72')]={'id':_0x521f9f[_0xce91('0x72')]['id'],'name':_0x521f9f[_0xce91('0x72')][_0xce91('0x3e')],'active':_0x521f9f['Trunk'][_0xce91('0x73')],'callerid':_0x521f9f[_0xce91('0x72')]['callerid']};}if(_0x521f9f[_0xce91('0x43')]){_0x46cc22[_0xce91('0x43')]={'id':_0x521f9f['Interval']['id'],'name':_0x521f9f[_0xce91('0x43')]['name']};}var _0x941606=md5(JSON[_0xce91('0x49')](_0x46cc22));if(_0x521f9f[_0xce91('0x4')]!==_0x941606){_0x521f9f[_0xce91('0x4')]=_0x941606;emit(util[_0xce91('0x74')](_0xce91('0x75'),_0x46cc22['name']),_0xce91('0x76'),_0x46cc22);}}}function emitCampaignSummary(_0x516529){if(_0x516529[_0xce91('0x53')]===_0xce91('0x77')){emit(util['format']('campaign:ivr:%s',_0x516529[_0xce91('0x3e')]),_0xce91('0x78'),_0x516529);}}function checkGetDataPredictive(_0x16a335){if(isNotNull(_0x16a335)){if(!_['isEmpty'](_0x16a335)){loggerPredictive['info']('-----\x20Stats\x20Predictive\x20---');loggerPredictive[_0xce91('0x79')](_0xce91('0x7a'),_0x16a335[_0xce91('0x7b')]);loggerPredictive['info']('Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x16a335[_0xce91('0x66')]);loggerPredictive[_0xce91('0x79')](_0xce91('0x7c'),_0x16a335[_0xce91('0x69')]);loggerPredictive['info'](_0xce91('0x7d'),_0x16a335['predictiveIntervalDroppedCallsCallersExit']);loggerPredictive[_0xce91('0x79')](_0xce91('0x7e'),_0x16a335[_0xce91('0x67')]);loggerPredictive['info']('AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x16a335[_0xce91('0x7f')]);loggerPredictive[_0xce91('0x79')](_0xce91('0x80'));if(_0x16a335[_0xce91('0x7b')]>0x0){if(!_[_0xce91('0x81')](_0x16a335['predictiveIntervalAvgTalktime'])&&_0x16a335[_0xce91('0x7f')]>0x0){return!![];}else{loggerPredictive[_0xce91('0x79')]('Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive');}if(!_[_0xce91('0x81')](_0x16a335[_0xce91('0x67')])&&_0x16a335[_0xce91('0x67')]>0x0){return!![];}else{loggerPredictive[_0xce91('0x79')](_0xce91('0x82'));}}else{loggerPredictive[_0xce91('0x79')](_0xce91('0x83'));}}else{loggerPredictive[_0xce91('0x79')](_0xce91('0x84'));}}else{loggerPredictive[_0xce91('0x79')](_0xce91('0x84'));}return![];}function mergeDataErlangB(_0x465c93){return function(_0x3babce){loggerPredictive[_0xce91('0x79')]('---------\x20ErlangB\x20---------');loggerPredictive[_0xce91('0x79')](_0xce91('0x85'),_0x3babce[_0xce91('0x86')]);loggerPredictive[_0xce91('0x79')](_0xce91('0x87'),_0x3babce[_0xce91('0x70')]);loggerPredictive[_0xce91('0x79')](_0xce91('0x88'),_0x3babce['erlangAbandonmentRate']);loggerPredictive[_0xce91('0x79')](_0xce91('0x89'),_0x3babce['erlangBusyFactor']);loggerPredictive['info'](_0xce91('0x88'),_0x3babce[_0xce91('0x71')]);loggerPredictive[_0xce91('0x79')](_0xce91('0x80'));_['merge'](_0x465c93,_0x3babce);};}function getDiff(_0x23efb7){var _0xbcb48=moment()[_0xce91('0x4a')](0x0);var _0x114f21=moment(_0x23efb7)[_0xce91('0x4a')](0x0);return _0xbcb48[_0xce91('0x4b')](_0x114f21,_0xce91('0x4c'));}function ifInterval(_0x26b90d,_0x31415c){if(_['isUndefined'](_0x31415c)){return![];}if(getDiff(_0x31415c)<_0x26b90d*0x3c){return!![];}else{return![];}}function freeVariablesPredictive(_0x1550e4){if(isNotNull(_0x1550e4)){if(!_[_0xce91('0x81')](_0x1550e4[_0xce91('0x28')])){_0x1550e4[_0xce91('0x28')]=undefined;loggerPredictive['info'](_0x1550e4[_0xce91('0x3e')],'clearing\x20variable\x20start\x20progressive');}if(!_[_0xce91('0x81')](_0x1550e4[_0xce91('0x27')])){_0x1550e4[_0xce91('0x27')]=undefined;loggerPredictive['info'](_0x1550e4['name'],_0xce91('0x8a'));}if(!_[_0xce91('0x81')](_0x1550e4[_0xce91('0x8b')])){clearInterval(_0x1550e4[_0xce91('0x8b')]);_0x1550e4[_0xce91('0x8b')]=undefined;loggerPredictive[_0xce91('0x79')](_0x1550e4['name'],_0xce91('0x8c'));}}}function erlangb(_0xf176ad,_0x2db69c){if(_0x2db69c===0x0){return 0x0;}var _0x5b2456=0x1;for(var _0x4bc4f2=0x1;_0x4bc4f2<=_0x2db69c;_0x4bc4f2+=0x1){_0x5b2456=0x1+_0x5b2456*_0x4bc4f2/_0xf176ad;}return 0x1/_0x5b2456;}function isVoiceQueueOutbound(_0x3176e3){return _0x3176e3===_0xce91('0x8d');}function isNotPreview(_0x48e797){return _0x48e797!==_0xce91('0x8e');}function isCampaignIvr(_0x1a187c){return _0x1a187c===_0xce91('0x77');}function getCallerId(_0x35e556,_0x519d47,_0x107c78){if(!_[_0xce91('0x81')](_0x107c78)&&_0xce91('0x8f')===typeof _0x107c78&&!_['isEmpty'](_0x107c78)){if(!_[_0xce91('0x81')](_0x519d47)&&_0xce91('0x8f')===typeof _0x519d47&&!_['isEmpty'](_0x519d47)){return util[_0xce91('0x74')](_0xce91('0x90'),_0x519d47,_0x107c78);}return util[_0xce91('0x74')](_0xce91('0x90'),_0x107c78,_0x107c78);}if(!_[_0xce91('0x81')](_0x35e556)&&_0xce91('0x8f')===typeof _0x35e556&&!_[_0xce91('0x45')](_0x35e556)){return _0x35e556;}return _0xce91('0x91');}function loggerCatchQueueSummary(_0x57a786,_0x378d1a){return function(_0x67cf67){freeVariablesPredictive(_0x378d1a);emitVoiceQueueSummary(_0x378d1a);emitCampaignSummary(_0x378d1a);loggerSyncQueueSummary[_0xce91('0x92')](_0x57a786,util['inspect'](_0x67cf67,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x483ef2,_0x41fda4){return function(_0x5e4463){loggerPredictive[_0xce91('0x92')](_0x41fda4[_0xce91('0x3e')],_0x483ef2);loggerPredictive[_0xce91('0x92')](_0x5e4463[_0xce91('0x93')]);freeVariablesPredictive(_0x41fda4);};}function loggerCatch(_0x4557ec){return function(_0x1198db){logger['error'](_0x4557ec,util[_0xce91('0x94')](_0x1198db,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0xdf2e5b){return _0xdf2e5b&&!_[_0xce91('0x81')](_0xdf2e5b)&&_0xdf2e5b['length']>0x0;}function decremetOriginate(_0x93eb41){if(!_[_0xce91('0x81')](_0x93eb41)&&_0x93eb41!==null){if(_0x93eb41[_0xce91('0x95')](_0xce91('0x6f'))){if(_0x93eb41[_0xce91('0x6f')]>0x0){_0x93eb41[_0xce91('0x6f')]-=0x1;}else{logger[_0xce91('0x92')](_0xce91('0x96'));}}}else{logger[_0xce91('0x92')]('[decremetOriginate]\x20is\x20null\x20or\x20undefined');}}function checkContactLowerLimitOriginate(_0x36acf9,_0x2f92cd,_0x24e313){if(_0x2f92cd>_0x24e313){for(var _0x554ba9=0x0;_0x554ba9<_0x2f92cd-_0x24e313;_0x554ba9+=0x1){decremetOriginate(_0x36acf9);}}}function loggerGetContactDialer(_0x442297,_0x1a0733,_0x5682f6){return function(_0x9330e2){checkContactLowerLimitOriginate(_0x1a0733,_0x5682f6,0x0);logger[_0xce91('0x92')](_0x442297,util['inspect'](_0x9330e2,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x50a7cc){return function(_0x337f57){if(isNotNull(_0x337f57)&&isNotNull(_0x337f57[0x0])){if(_0x337f57[0x0][_0xce91('0x97')]>0x0){_0x50a7cc[_0xce91('0x3d')]=_0xce91('0x98');logger['info'](_0xce91('0x99')+_0x50a7cc['name'],_0x337f57[0x0][_0xce91('0x97')],_0xce91('0x9a'));}else{_0x50a7cc[_0xce91('0x3d')]=_0xce91('0x9b');logger[_0xce91('0x79')](_0xce91('0x9c')+_0x50a7cc['name']);}}};}function notSendMessagesQueue(_0x4954cd){if(_0x4954cd[_0xce91('0x9d')]){freeVariablesPredictive(_0x4954cd);if(_0x4954cd['originated']===0x0&&_0x4954cd['talking']===0x0&&_0x4954cd[_0xce91('0x55')]===0x0&&(_0x4954cd[_0xce91('0x50')]||0x0)===0x0){_0x4954cd[_0xce91('0x9d')]=![];_0x4954cd[_0xce91('0x4e')]=0x0;_0x4954cd['message']=_0xce91('0x40');loggerSyncQueueSummary[_0xce91('0x92')]('[syncQueueSummary]\x20Campaign\x20Queue:\x20',_0x4954cd[_0xce91('0x3e')],_0xce91('0x9e'));}else{_0x4954cd[_0xce91('0x3d')]='IS_DISACTIVED';loggerSyncQueueSummary[_0xce91('0x92')](_0xce91('0x9f'),_0x4954cd[_0xce91('0x3e')],_0xce91('0xa0'));}emitVoiceQueueSummary(_0x4954cd);}}function notSendMessagesCampaign(_0xc9b737){if(_0xc9b737[_0xce91('0x9d')]){if(_0xc9b737[_0xce91('0x6f')]===0x0){_0xc9b737[_0xce91('0x9d')]=![];_0xc9b737['message']='NOT_ACTIVE';loggerSyncQueueSummary[_0xce91('0x92')](_0xce91('0xa1'),_0xc9b737[_0xce91('0x3e')],_0xce91('0x9e'));}else{_0xc9b737[_0xce91('0x3d')]=_0xce91('0xa2');loggerSyncQueueSummary[_0xce91('0x92')](_0xce91('0xa1'),_0xc9b737[_0xce91('0x3e')],_0xce91('0xa0'));}emitCampaignSummary(_0xc9b737);}}function createObjHistory(_0x5f3a7c,_0x2e8e4b,_0x1fc6d3,_0x44c892,_0x26818b){_0x5f3a7c['message']=_0x1fc6d3;var _0x394680=new Action(_0x5f3a7c,_0x2e8e4b);var _0x5192fa=new History(_0x394680);_0x5192fa[_0xce91('0xa3')]=_0x44c892;_0x5192fa[_0xce91('0xa4')]=_0x26818b;_0x5192fa[_0xce91('0xa5')]=_0x394680[_0xce91('0xa6')];return _0x5192fa;}Dialer[_0xce91('0x1c')][_0xce91('0x3c')]=function(){var _0xeb22e9=this;setInterval(function(){_0xeb22e9[_0xce91('0xa7')](_0xeb22e9[_0xce91('0x26')],_0xce91('0xa8'));_0xeb22e9[_0xce91('0xa7')](_0xeb22e9[_0xce91('0x24')],_0xce91('0xa9'));},0x32c8);};Dialer[_0xce91('0x1c')][_0xce91('0xa7')]=function(_0x4ff9c5,_0x129fc){var _0x59f732=this;for(var _0x2d3fea in _0x4ff9c5){if(_0x4ff9c5[_0xce91('0x95')](_0x2d3fea)){this[_0xce91('0x1e')][_0xce91('0xaa')](function(){if(!_['isNil'](_0x4ff9c5[_0x2d3fea])){return ami[_0xce91('0xab')]({'action':_0xce91('0xac'),'channel':_0x4ff9c5[_0x2d3fea][_0xce91('0xad')]})[_0xce91('0xae')](function(_0x5e7b57){if(_0x5e7b57[_0xce91('0x3d')]===_0xce91('0xaf')){setTimeout(function(){if(_0x4ff9c5[_0x2d3fea]&&_0x4ff9c5[_0x2d3fea][_0xce91('0x53')]!==_0xce91('0x77')){_0x59f732[_0xce91('0xb0')](_0x59f732[_0xce91('0x1f')][_0x4ff9c5[_0x2d3fea][_0xce91('0xb1')]]);logger[_0xce91('0x92')](_0xce91('0xb2'),_0x129fc,_0x2d3fea,_0x4ff9c5[_0x2d3fea][_0xce91('0xb1')]);delete _0x4ff9c5[_0x2d3fea];}if(_0x4ff9c5[_0x2d3fea]&&_0x4ff9c5[_0x2d3fea]['type']===_0xce91('0x77')){_0x59f732[_0xce91('0xb0')](_0x59f732['campaigns'][_0x4ff9c5[_0x2d3fea]['queue']]);logger[_0xce91('0x92')](_0xce91('0xb3'),_0x129fc,_0x2d3fea,_0x4ff9c5[_0x2d3fea]['queue']);delete _0x4ff9c5[_0x2d3fea];}},0x2328);}});}});}}};Dialer[_0xce91('0x1c')][_0xce91('0xb4')]=function(_0xc9904e){return BPromise[_0xce91('0xb5')]()[_0xce91('0xb6')](cmHopper[_0xce91('0xb4')](_0xc9904e))[_0xce91('0xae')](loggerCatch(_0xce91('0xb7')));};Dialer['prototype'][_0xce91('0xb8')]=function(_0x55dfea){return BPromise[_0xce91('0xb5')]()['then'](cmHopperBlack[_0xce91('0xb8')](_0x55dfea))[_0xce91('0xae')](loggerCatch(_0xce91('0xb9')));};Dialer[_0xce91('0x1c')][_0xce91('0xba')]=function(_0x2fb633){return BPromise[_0xce91('0xb5')]()[_0xce91('0xb6')](cmHopperBlack[_0xce91('0xba')](_0x2fb633))[_0xce91('0xae')](loggerCatch('[checkIsBlackListIvr]\x20'));};Dialer['prototype'][_0xce91('0xbb')]=function(_0x52e419){return BPromise[_0xce91('0xb5')]()[_0xce91('0xb6')](cmHopperHistory[_0xce91('0xbc')](_0x52e419))[_0xce91('0xae')](loggerCatch(_0xce91('0xbd')));};Dialer[_0xce91('0x1c')]['rescheduleContact']=function(_0x274cdf){return BPromise[_0xce91('0xb5')]()[_0xce91('0xb6')](cmHopper[_0xce91('0xbe')](_0x274cdf))['catch'](loggerCatch(_0xce91('0xbf')));};Dialer[_0xce91('0x1c')][_0xce91('0xc0')]=function(_0x2fd8c7,_0x36ce8f,_0x1ae02c,_0x1dbf94){return BPromise['resolve']()['then'](cmHopper[_0xce91('0xc0')](_0x2fd8c7,_0x36ce8f,_0x1ae02c,_0x1dbf94))['catch'](loggerCatch('[getContactDialer]\x20'));};Dialer['prototype'][_0xce91('0xc1')]=function(_0x5453f4,_0x4367aa,_0x395d8d){return BPromise[_0xce91('0xb5')]()[_0xce91('0xb6')](cmHopper[_0xce91('0xc1')](_0x5453f4,_0x4367aa,_0x395d8d))[_0xce91('0xae')](loggerCatch(_0xce91('0xc2')));};Dialer[_0xce91('0x1c')][_0xce91('0xc3')]=function(_0x4a97fb){return BPromise[_0xce91('0xb5')]()['then'](voiceQueueRt[_0xce91('0xc3')](_0x4a97fb))[_0xce91('0xae')](loggerCatch(_0xce91('0xc4')));};Dialer[_0xce91('0x1c')][_0xce91('0xc5')]=function(_0x364bf8){return BPromise[_0xce91('0xb5')]()[_0xce91('0xb6')](cmHopper['moveContactManagedDialer'](_0x364bf8))[_0xce91('0xae')](loggerCatch(_0xce91('0xc6')));};Dialer['prototype'][_0xce91('0xc7')]=function(_0x59f29f){return BPromise['resolve']()[_0xce91('0xb6')](cmHopperHistory['createHistory'](_0x59f29f))[_0xce91('0xae')](loggerCatch(_0xce91('0xc8')));};Dialer[_0xce91('0x1c')]['updateOriginated']=function(_0x335861){if(!_['isUndefined'](_0x335861)&&_0x335861!==null){if(_0x335861[_0xce91('0x95')]('originated')){if(_0x335861['originated']>0x0){_0x335861['originated']-=0x1;}else{logger[_0xce91('0x92')](_0xce91('0xc9'));}}}else{logger['error'](_0xce91('0xca'));}};Dialer[_0xce91('0x1c')]['loggerHandler']=function(_0xfef96d,_0x56ef24){var _0xa81326=this;return function(_0x2d6711){_0xa81326[_0xce91('0xb0')](_0x56ef24);logger['error'](_0xfef96d,util['inspect'](_0x2d6711,{'showHidden':![],'depth':null}));};};Dialer['prototype'][_0xce91('0xcb')]=function(_0xbe766c,_0x1efbf7,_0x8cb084){var _0x2abbed={'state':0x19,'statedesc':_0xce91('0xcc')};this[_0xce91('0xb0')](_0x1efbf7);this[_0xce91('0xcd')](_['merge'](_0x2abbed,_[_0xce91('0xce')](_0x8cb084,[_0xce91('0xcf'),_0xce91('0xd0'),_0xce91('0xd1'),_0xce91('0xd2'),_0xce91('0xd3')])),_0xce91('0xd4'),_0xce91('0xd5'));logger[_0xce91('0x92')](_0xbe766c);};Dialer[_0xce91('0x1c')][_0xce91('0xd6')]=function(_0x35a537){return _0x35a537==='Success';};Dialer[_0xce91('0x1c')][_0xce91('0xd7')]=function(_0x48d5aa){return!_['isUndefined'](_0x48d5aa)&&_0x48d5aa&&!_[_0xce91('0x81')](_0x48d5aa['name'])&&!_['isUndefined'](_0x48d5aa['active'])&&_0x48d5aa[_0xce91('0x73')]&&(this[_0xce91('0x22')][util[_0xce91('0x74')](_0xce91('0xd8'),_0x48d5aa[_0xce91('0x3e')])][_0xce91('0xac')]==='reachable'||this[_0xce91('0x22')][util[_0xce91('0x74')]('SIP/%s',_0x48d5aa['name'])][_0xce91('0xac')]==='unmonitored');};Dialer[_0xce91('0x1c')][_0xce91('0xcd')]=function(_0x4e12af,_0x30b7d0,_0x141d32){this[_0xce91('0xc7')](_0x4e12af)[_0xce91('0xae')](loggerCatch(_0x30b7d0));this['moveContactManagedDialer'](_0x4e12af)[_0xce91('0xae')](loggerCatch(_0x141d32));};Dialer[_0xce91('0x1c')][_0xce91('0x38')]=function(_0x5826db){var _0x4b27fa=this[_0xce91('0x26')][_0x5826db['uniqueid']];var _0x18822e;if(!_[_0xce91('0xd9')](_0x5826db)&&!_[_0xce91('0xd9')](_0x5826db['variable'])&&!_[_0xce91('0xd9')](_0x5826db['variable'][_0xce91('0xda')])&&_0x5826db[_0xce91('0xdb')]==='xcally-motion-dialer'&&_0x4b27fa){if(_0x4b27fa[_0xce91('0x53')]!==_0xce91('0x77')&&this[_0xce91('0x1f')][_0x4b27fa[_0xce91('0xb1')]][_0xce91('0xdc')]&&_0x5826db['value']==='HANGUP'){delete this[_0xce91('0x26')][_0x5826db[_0xce91('0xdd')]];this['updateOriginated'](this['voiceQueues'][_0x4b27fa[_0xce91('0xb1')]]);this[_0xce91('0x1f')][_0x4b27fa[_0xce91('0xb1')]][_0xce91('0x5c')]+=0x1;this[_0xce91('0x1f')][_0x4b27fa[_0xce91('0xb1')]][_0xce91('0x5b')]+=0x1;_0x18822e=new Hangup(_0x4b27fa,_0x5826db);_0x18822e[_0xce91('0xa3')]=0x12;_0x18822e[_0xce91('0xa4')]=_0xce91('0xde');_0x18822e[_0xce91('0xdf')]=_0xce91('0xe0');this[_0xce91('0xcd')](_0x18822e,_0xce91('0xe1'),_0xce91('0xe2'));}if(_0x4b27fa[_0xce91('0x53')]!==_0xce91('0x77')&&this[_0xce91('0x1f')][_0x4b27fa[_0xce91('0xb1')]]['dialAMDActive']&&_0x5826db[_0xce91('0xe3')]===_0xce91('0xe4')){delete this[_0xce91('0x26')][_0x5826db[_0xce91('0xdd')]];this['updateOriginated'](this[_0xce91('0x1f')][_0x4b27fa[_0xce91('0xb1')]]);this['voiceQueues'][_0x4b27fa['queue']][_0xce91('0x5c')]+=0x1;this[_0xce91('0x1f')][_0x4b27fa['queue']]['outboundAnswerAgiCallsDay']+=0x1;_0x18822e=new Hangup(_0x4b27fa,_0x5826db);_0x18822e[_0xce91('0xa3')]=0x13;_0x18822e[_0xce91('0xa4')]='Machine';_0x18822e[_0xce91('0xdf')]=_0xce91('0xe0');_0x18822e[_0xce91('0xe5')]=!![];this[_0xce91('0xcd')](_0x18822e,_0xce91('0xe6'),_0xce91('0xe7'));}if(_0x4b27fa[_0xce91('0x53')]===_0xce91('0x77')&&this[_0xce91('0x20')][_0x4b27fa[_0xce91('0xb1')]][_0xce91('0xdc')]&&_0x5826db[_0xce91('0xe3')]===_0xce91('0xe8')){delete this[_0xce91('0x26')][_0x5826db['uniqueid']];this[_0xce91('0xb0')](this[_0xce91('0x20')][_0x4b27fa[_0xce91('0xb1')]]);_0x18822e=new Hangup(_0x4b27fa,_0x5826db);_0x18822e[_0xce91('0xa3')]=0x12;_0x18822e[_0xce91('0xa4')]=_0xce91('0xde');_0x18822e[_0xce91('0xdf')]='AMD';this[_0xce91('0xcd')](_0x18822e,'[syncHangupInAMDIvr][createHistory]',_0xce91('0xe9'));}if(_0x4b27fa[_0xce91('0x53')]===_0xce91('0x77')&&this[_0xce91('0x20')][_0x4b27fa[_0xce91('0xb1')]][_0xce91('0xdc')]&&_0x5826db[_0xce91('0xe3')]==='MACHINE'){delete this[_0xce91('0x26')][_0x5826db[_0xce91('0xdd')]];this[_0xce91('0xb0')](this[_0xce91('0x20')][_0x4b27fa[_0xce91('0xb1')]]);_0x18822e=new Hangup(_0x4b27fa,_0x5826db);_0x18822e[_0xce91('0xa3')]=0x13;_0x18822e[_0xce91('0xa4')]=_0xce91('0xea');_0x18822e[_0xce91('0xdf')]='AMD';_0x18822e['amd']=!![];this[_0xce91('0xcd')](_0x18822e,'[syncMachineIvr][createHistory]',_0xce91('0xeb'));}}};Dialer[_0xce91('0x1c')]['syncHangup']=function(_0x4a9304){var _0x14ad70=this[_0xce91('0x26')][_0x4a9304[_0xce91('0xdd')]];var _0x2cade2=this;var _0x3c7084;if(_0x14ad70&&_0x14ad70[_0xce91('0x53')]===_0xce91('0x77')){delete this[_0xce91('0x26')][_0x4a9304[_0xce91('0xdd')]];this['updateOriginated'](this[_0xce91('0x20')][_0x14ad70[_0xce91('0xb1')]]);this[_0xce91('0x20')][_0x14ad70[_0xce91('0xb1')]][_0xce91('0xec')]+=0x1;_0x3c7084=new Hangup(_0x14ad70,_0x4a9304);this['createHistory'](_0x3c7084)[_0xce91('0xae')](loggerCatch('[syncHangupIvr][createHistory]'));this[_0xce91('0xc5')](_0x3c7084)[_0xce91('0xae')](loggerCatch(_0xce91('0xed')));}if(_0x14ad70&&_0x14ad70[_0xce91('0x53')]!==_0xce91('0x77')&&isNotNull(this[_0xce91('0x1f')][_0x14ad70[_0xce91('0xb1')]][_0xce91('0xee')])){delete this['uniqueId'][_0x4a9304[_0xce91('0xdd')]];this['updateOriginated'](this[_0xce91('0x1f')][_0x14ad70[_0xce91('0xb1')]]);this[_0xce91('0x1f')][_0x14ad70[_0xce91('0xb1')]][_0xce91('0x5c')]+=0x1;this[_0xce91('0x1f')][_0x14ad70[_0xce91('0xb1')]][_0xce91('0x5b')]+=0x1;_0x3c7084=new Hangup(_0x14ad70,_0x4a9304);_0x3c7084[_0xce91('0xa3')]=0x10;_0x3c7084['statedesc']=_0xce91('0xef');_0x3c7084[_0xce91('0xdf')]='AGI';this[_0xce91('0xc7')](_0x3c7084)[_0xce91('0xae')](loggerCatch('[syncHangupIvr][createHistory]'));this[_0xce91('0xc5')](_0x3c7084)['catch'](loggerCatch(_0xce91('0xed')));}if(_0x14ad70&&_0x14ad70[_0xce91('0x53')]!==_0xce91('0x77')&&!isNotNull(this[_0xce91('0x1f')][_0x14ad70['queue']][_0xce91('0xee')])){delete this[_0xce91('0x26')][_0x4a9304[_0xce91('0xdd')]];this[_0xce91('0xb0')](this[_0xce91('0x1f')][_0x14ad70[_0xce91('0xb1')]]);this[_0xce91('0x1f')][_0x14ad70[_0xce91('0xb1')]][_0xce91('0xf0')]+=0x1;_0x3c7084=new Hangup(_0x14ad70,_0x4a9304);_0x3c7084[_0xce91('0xa3')]=0xc;_0x3c7084['statedesc']=_0x4a9304['cause-txt'];_0x3c7084['membername']=_0xce91('0xf1');this[_0xce91('0xc7')](_0x3c7084)[_0xce91('0xae')](loggerCatch(_0xce91('0xf2')));this['moveContactManagedDialer'](_0x3c7084)[_0xce91('0xae')](loggerCatch(_0xce91('0xed')));}};Dialer['prototype']['syncAgentComplete']=function(_0x4d8c3f){var _0x2b98d2=this[_0xce91('0x26')][_0x4d8c3f[_0xce91('0xdd')]];var _0xfde411=this;if(this[_0xce91('0x1f')][_0x4d8c3f['queue']]){if(_0x2b98d2&&_0x2b98d2['type']!=='ivr'){delete this[_0xce91('0x26')][_0x4d8c3f[_0xce91('0xdd')]];this[_0xce91('0x1f')][_0x4d8c3f[_0xce91('0xb1')]][_0xce91('0x5c')]+=0x1;var _0x2fab9e=new AgentComplete(_0x2b98d2,_0x4d8c3f);if(_0x4d8c3f[_0xce91('0xf3')]===_0xce91('0xf4')){_0x2fab9e[_0xce91('0xf5')]=this[_0xce91('0x1f')][_0x4d8c3f[_0xce91('0xb1')]]['dialQueueProject2']&&this[_0xce91('0x1f')][_0x4d8c3f[_0xce91('0xb1')]][_0xce91('0xf6')]?moment()[_0xce91('0x74')](_0xce91('0xf7')):undefined;}this[_0xce91('0xc7')](_0x2fab9e)[_0xce91('0xae')](loggerCatch(_0xce91('0xf8')));this[_0xce91('0xc5')](_0x2fab9e)['catch'](loggerCatch(_0xce91('0xf9')));}}};Dialer[_0xce91('0x1c')][_0xce91('0xfa')]=function(_0x5e506f){if(this[_0xce91('0x1f')][_0x5e506f['queue']]){if(this[_0xce91('0x26')][_0x5e506f[_0xce91('0xdd')]]&&this[_0xce91('0x26')][_0x5e506f[_0xce91('0xdd')]][_0xce91('0x53')]!==_0xce91('0x77')){this[_0xce91('0xb0')](this[_0xce91('0x1f')][_0x5e506f[_0xce91('0xb1')]]);this['uniqueId'][_0x5e506f[_0xce91('0xdd')]][_0xce91('0xfb')]=moment()[_0xce91('0x74')](_0xce91('0xf7'));}}};Dialer[_0xce91('0x1c')][_0xce91('0xfc')]=function(_0x454da3){this[_0xce91('0xc7')](_0x454da3)['catch'](loggerCatch('[syncAgentComplete][createHistory]'));this[_0xce91('0xc5')](_0x454da3)[_0xce91('0xae')](loggerCatch(_0xce91('0xfd')));};Dialer[_0xce91('0x1c')][_0xce91('0xfe')]=function(_0x57df3c){var _0x5d96a5=this[_0xce91('0x26')][_0x57df3c[_0xce91('0xdd')]];var _0x531bee=this;if(this[_0xce91('0x1f')][_0x57df3c[_0xce91('0xb1')]]){if(_0x5d96a5&&_0x5d96a5['type']!==_0xce91('0x77')){delete this[_0xce91('0x26')][_0x57df3c[_0xce91('0xdd')]];this[_0xce91('0xb0')](this['voiceQueues'][_0x57df3c[_0xce91('0xb1')]]);_0x5d96a5[_0xce91('0xff')]=moment()[_0xce91('0x74')](_0xce91('0xf7'));var _0x24e1e8=new QueueCallerAbandon(_0x5d96a5,_0x57df3c);if(getSeconds(_0x5d96a5[_0xce91('0xff')],_0x5d96a5[_0xce91('0x100')])>=_0x5d96a5[_0xce91('0x101')]){this['voiceQueues'][_0x57df3c[_0xce91('0xb1')]]['predictiveIntervalDroppedCallsTimeout']+=0x1;this[_0xce91('0x1f')][_0x57df3c['queue']][_0xce91('0x61')]+=0x1;this[_0xce91('0x1f')][_0x57df3c[_0xce91('0xb1')]][_0xce91('0x6a')]+=0x1;_0x24e1e8[_0xce91('0xa3')]=0xa;_0x24e1e8[_0xce91('0xa4')]='Drop';_0x24e1e8[_0xce91('0x102')]='TIMEOUT';_0x24e1e8[_0xce91('0xf5')]=this[_0xce91('0x1f')][_0x57df3c[_0xce91('0xb1')]][_0xce91('0x103')]?moment()[_0xce91('0x74')](_0xce91('0xf7')):undefined;this['queueCallerAbandonCreateState'](_0x24e1e8);}else{this[_0xce91('0x1f')][_0x57df3c['queue']][_0xce91('0x68')]+=0x1;this[_0xce91('0x1f')][_0x57df3c[_0xce91('0xb1')]][_0xce91('0x60')]+=0x1;_0x24e1e8[_0xce91('0xa3')]=0xb;_0x24e1e8[_0xce91('0xa4')]='Abandoned';_0x24e1e8[_0xce91('0x102')]='CALLEREXIT';this[_0xce91('0xfc')](_0x24e1e8);}}}};Dialer['prototype']['syncNewExten']=function(_0xa3512f){if(this[_0xce91('0x24')][_0xa3512f[_0xce91('0xdd')]]){this[_0xce91('0x24')][_0xa3512f[_0xce91('0xdd')]][_0xce91('0xad')]=_0xa3512f['channel'];}if(this['uniqueId'][_0xa3512f[_0xce91('0xdd')]]){this['uniqueId'][_0xa3512f['uniqueid']][_0xce91('0xad')]=_0xa3512f[_0xce91('0xad')];}};Dialer[_0xce91('0x1c')][_0xce91('0x104')]=function(_0x27dcb2){if(strategy[this[_0xce91('0x1f')][this['actions'][_0x27dcb2[_0xce91('0x105')]]['queue']][_0xce91('0x106')]]===_0xce91('0x107')){if(this[_0xce91('0x24')][_0x27dcb2[_0xce91('0x105')]]&&_[_0xce91('0xd9')](this[_0xce91('0x24')][_0x27dcb2[_0xce91('0x105')]]['locked'])&&_0x27dcb2['status']==='1'&&_0x27dcb2[_0xce91('0x108')]==='0'){if(this[_0xce91('0x21')][_0x27dcb2[_0xce91('0x109')]]){if(!this[_0xce91('0x21')][_0x27dcb2['stateinterface']][_0xce91('0x10a')]){this[_0xce91('0x21')][_0x27dcb2[_0xce91('0x109')]]['locked']=!![];this[_0xce91('0x24')][_0x27dcb2[_0xce91('0x105')]][_0xce91('0x10a')]=!![];this[_0xce91('0x24')][_0x27dcb2[_0xce91('0x105')]][_0xce91('0x109')]=_0x27dcb2[_0xce91('0x109')];}}}}else if((strategy[this[_0xce91('0x1f')][this['actions'][_0x27dcb2['actionid']]['queue']][_0xce91('0x106')]]||_0xce91('0x1b'))===_0xce91('0x1b')){if(this[_0xce91('0x24')][_0x27dcb2[_0xce91('0x105')]]){if(this['agents'][_0x27dcb2[_0xce91('0x109')]]){this['actions'][_0x27dcb2[_0xce91('0x105')]][_0xce91('0x109')]=_0x27dcb2[_0xce91('0x109')];if(_[_0xce91('0xd9')](this[_0xce91('0x2a')][this[_0xce91('0x24')][_0x27dcb2[_0xce91('0x105')]]['queue']])){this['queueBooked'][this[_0xce91('0x24')][_0x27dcb2[_0xce91('0x105')]][_0xce91('0xb1')]]=[];}this[_0xce91('0x2a')][this['actions'][_0x27dcb2[_0xce91('0x105')]][_0xce91('0xb1')]][_0xce91('0x10b')](_[_0xce91('0x10c')](_[_0xce91('0xce')](this['actions'][_0x27dcb2[_0xce91('0x105')]],[_0xce91('0x10d'),'stateinterface']),{'status':_0x27dcb2[_0xce91('0xac')],'paused':_0x27dcb2['paused']}));}}}};function unlockQueueStatus(_0x567c36,_0x185787){setTimeout(function(){if(_[_0xce91('0x81')](_0x567c36['queueStatusComplete'])){loggerBooked[_0xce91('0x92')]('[unlockQueueStatus][undefined]',_0x185787);}_0x567c36['queueStatusComplete']=!![];loggerBooked[_0xce91('0x79')]('[booked][unlockQueueStatus]',_0x185787,JSON['stringify'](_[_0xce91('0xce')](_0x567c36,[_0xce91('0x3e'),_0xce91('0x10e')])));},0x1f3);}Dialer[_0xce91('0x1c')][_0xce91('0x3a')]=function(_0x4d5113){var _0x239258=this;var _0x399adf=_0x239258[_0xce91('0x1f')][_0x239258['actions'][_0x4d5113['actionid']][_0xce91('0xb1')]];if(strategy[this[_0xce91('0x1f')][this['actions'][_0x4d5113[_0xce91('0x105')]][_0xce91('0xb1')]]['strategy']]==='roundrobin'){if(this['actions'][_0x4d5113[_0xce91('0x105')]]&&this['actions'][_0x4d5113['actionid']][_0xce91('0x109')]){this['preview']['run'](this['actions'][_0x4d5113[_0xce91('0x105')]]['idHopper'],this[_0xce91('0x24')][_0x4d5113[_0xce91('0x105')]][_0xce91('0x109')])['catch'](function(_0x39321f){logger['error'](_0xce91('0x10f'),util[_0xce91('0x94')](_0x39321f,{'showHidden':![],'depth':null}));})[_0xce91('0x110')](function(){_0x239258[_0xce91('0xb0')](_0x239258[_0xce91('0x1f')][_0x239258[_0xce91('0x24')][_0x4d5113[_0xce91('0x105')]][_0xce91('0xb1')]]);_0x239258[_0xce91('0x21')][_0x239258[_0xce91('0x24')][_0x4d5113['actionid']][_0xce91('0x109')]][_0xce91('0x10a')]=![];delete _0x239258[_0xce91('0x24')][_0x4d5113[_0xce91('0x105')]];unlockQueueStatus(_0x399adf);});}else{this[_0xce91('0xb0')](this[_0xce91('0x1f')][this[_0xce91('0x24')][_0x4d5113[_0xce91('0x105')]][_0xce91('0xb1')]]);this[_0xce91('0xbe')]({'active':![],'ContactId':this[_0xce91('0x24')][_0x4d5113[_0xce91('0x105')]][_0xce91('0xcf')],'ListId':this[_0xce91('0x24')][_0x4d5113[_0xce91('0x105')]][_0xce91('0xd0')],'VoiceQueueId':this['actions'][_0x4d5113[_0xce91('0x105')]][_0xce91('0xd2')]||undefined,'CampaignId':this[_0xce91('0x24')][_0x4d5113[_0xce91('0x105')]][_0xce91('0xd3')]||undefined})[_0xce91('0xae')](loggerCatch(_0xce91('0x111')));delete this[_0xce91('0x24')][_0x4d5113['actionid']];unlockQueueStatus(_0x399adf);}}else if((strategy[this[_0xce91('0x1f')][this[_0xce91('0x24')][_0x4d5113[_0xce91('0x105')]][_0xce91('0xb1')]]['strategy']]||_0xce91('0x1b'))===_0xce91('0x1b')){var _0x13c2b9;if(this[_0xce91('0x24')][_0x4d5113['actionid']]&&!_[_0xce91('0x45')](this[_0xce91('0x2a')][this[_0xce91('0x24')][_0x4d5113[_0xce91('0x105')]][_0xce91('0xb1')]])){if(this[_0xce91('0x2b')][_0x239258[_0xce91('0x24')][_0x4d5113[_0xce91('0x105')]][_0xce91('0xb1')]]){this['queueBookedRR'][_0x239258[_0xce91('0x24')][_0x4d5113[_0xce91('0x105')]]['queue']]=this[_0xce91('0x2b')][this[_0xce91('0x24')][_0x4d5113[_0xce91('0x105')]][_0xce91('0xb1')]]?this[_0xce91('0x2b')][this[_0xce91('0x24')][_0x4d5113[_0xce91('0x105')]]['queue']]:this[_0xce91('0x2a')][this[_0xce91('0x24')][_0x4d5113[_0xce91('0x105')]][_0xce91('0xb1')]]?this['queueBooked'][this[_0xce91('0x24')][_0x4d5113[_0xce91('0x105')]][_0xce91('0xb1')]][_0xce91('0x112')]||0x0:0x0;}this[_0xce91('0x2a')][this[_0xce91('0x24')][_0x4d5113['actionid']]['queue']][_0xce91('0x112')]=this['queueBookedRR'][this['actions'][_0x4d5113[_0xce91('0x105')]]['queue']];for(var _0x121413=0x0;_0x121413=0x0?!![]:![];})[_0xce91('0xae')](myreject(_0x4333c8)));}}else{_0x59e593[_0xce91('0x10b')](ami['Action']({'action':_0xce91('0x129'),'command':util['format']('iftime\x20%s,%s',_0x14e7b4,!_[_0xce91('0x81')](config[_0xce91('0x126')][_0x195b98])?_0x195b98:'')})[_0xce91('0xb6')](function(_0x595c5e){return _0x595c5e['content'][_0xce91('0x12d')]('true')>=0x0?!![]:![];})[_0xce91('0xae')](myreject(_0x4333c8)));}BPromise[_0xce91('0x12f')](_0x59e593)[_0xce91('0xb6')](function(_0x476622){var _0x2f13d5=_[_0xce91('0x130')](_0x476622);if(_0x2f13d5){return _0x4db42d(_0x2f13d5);}else{_0x5efa23[_0xce91('0x3d')]=_0x8292bb?'GLOBAL_INTERVAL_IS_OVERTIME':_0xce91('0x131');return _0x4333c8(msgResponse(_0xce91('0x132'),_0xce91('0x124'),_0xce91('0x133')+_0x8292bb+'\x20'+_0x47a2a3+_0xce91('0x134')+util['inspect'](_0x14e7b4,{'showHidden':![],'depth':null})+_0xce91('0x135')+_0x195b98));}})['catch'](function(_0x4a2e51){return _0x4333c8(msgResponse('ifTime',_0xce91('0x124'),JSON[_0xce91('0x49')](_0x4a2e51)));});});};Dialer[_0xce91('0x1c')][_0xce91('0x136')]=function(_0x265968){var _0x591ef9=this;return function(){switch(_0x265968[_0xce91('0x58')]){case _0xce91('0x137'):freeVariablesPredictive(_0x265968);_0x591ef9[_0xce91('0x138')](_0x265968,0x1);break;case'power':freeVariablesPredictive(_0x265968);_0x591ef9['handlePower'](_0x265968,_0x265968[_0xce91('0x139')]);break;case'predictive':_0x591ef9[_0xce91('0xa')](_0x265968);break;case _0xce91('0x9'):freeVariablesPredictive(_0x265968);_0x591ef9[_0xce91('0x138')](_0x265968,0x1);break;default:freeVariablesPredictive(_0x265968);logger[_0xce91('0x92')](_0xce91('0x13a'),_0x265968[_0xce91('0x3e')],_0xce91('0x13b'));}};};Dialer[_0xce91('0x1c')][_0xce91('0x13c')]=function(_0xe006c7){var _0xf218c8=this;return function(){_0xf218c8[_0xce91('0x13d')](_0xe006c7);};};Dialer[_0xce91('0x1c')][_0xce91('0xc')]=function(_0x5c3c68){var _0x44eb71=this;if(isNotPreview(_0x5c3c68[_0xce91('0x58')])){if(isVoiceQueueOutbound(_0x5c3c68['type'])&&isActive(_0x5c3c68[_0xce91('0x57')])){_0x5c3c68[_0xce91('0x9d')]=!![];BPromise[_0xce91('0xb5')]()['then'](checkIsLoggedIn(_0x5c3c68,_0x5c3c68[_0xce91('0x4f')]))['then'](checkIsActive(_0x5c3c68,_0x5c3c68[_0xce91('0x57')]))[_0xce91('0xb6')](checkInterval(_0x5c3c68))[_0xce91('0xb6')](_0x44eb71['checkIsTrunkReachable'](_0x5c3c68))['then'](_0x44eb71[_0xce91('0x121')](_0x5c3c68[_0xce91('0x13e')],_0x5c3c68[_0xce91('0x13f')],_0x5c3c68[_0xce91('0x3e')],_0x5c3c68))[_0xce91('0xb6')](_0x44eb71[_0xce91('0x123')](_0x5c3c68[_0xce91('0x43')],_0x5c3c68['dialTimezone'],_0x5c3c68[_0xce91('0x3e')],_0x5c3c68))[_0xce91('0xb6')](_0x44eb71[_0xce91('0x136')](_0x5c3c68))[_0xce91('0xae')](loggerCatchQueueSummary(_0xce91('0x140'),_0x5c3c68));}else{notSendMessagesQueue(_0x5c3c68);}}else{freeVariablesPredictive(_0x5c3c68);}};Dialer[_0xce91('0x1c')][_0xce91('0x11e')]=function(){var _0x27ad03=this;var _0x72c530;for(var _0x462974 in this[_0xce91('0x20')]){if(this[_0xce91('0x20')][_0xce91('0x95')](_0x462974)){_0x72c530=this[_0xce91('0x20')][_0x462974];if(isCampaignIvr(_0x72c530[_0xce91('0x53')])&&isActive(_0x72c530[_0xce91('0x73')])){_0x72c530[_0xce91('0x9d')]=!![];BPromise[_0xce91('0xb5')]()[_0xce91('0xb6')](checkIsActive(_0x72c530,_0x72c530[_0xce91('0x73')]))[_0xce91('0xb6')](checkInterval(_0x72c530))[_0xce91('0xb6')](_0x27ad03[_0xce91('0x11f')](_0x72c530))[_0xce91('0xb6')](_0x27ad03[_0xce91('0x121')](_0x72c530['dialGlobalInterval'],_0x72c530['dialTimezone'],_0x72c530['name'],_0x72c530))[_0xce91('0xb6')](_0x27ad03[_0xce91('0x123')](_0x72c530[_0xce91('0x43')],_0x72c530[_0xce91('0x13f')],_0x72c530[_0xce91('0x3e')],_0x72c530))['then'](_0x27ad03[_0xce91('0x13c')](_0x72c530))['catch'](loggerCatchQueueSummary(_0xce91('0x141'),_0x72c530));}else{notSendMessagesCampaign(_0x72c530);}}}};function getCallerIdRandom(_0x7bee06,_0x5ec113){var _0x2a9c80,_0x454b9b,_0x258631;if(_0x5ec113<=0x0){_0x5ec113=0x1;}_0x2a9c80=new RegExp(_0xce91('0x142')+_0x5ec113+'}$');_0x454b9b=Math['pow'](0xa,_0x5ec113-0x1);_0x258631=Math[_0xce91('0x143')](0xa,_0x5ec113)-0x1;return util['format']('%s',_[_0xce91('0x144')](_0x7bee06,_0x2a9c80,_[_0xce91('0x145')](_0x454b9b,_0x258631)));}function extractCalleridName(_0x34d210){var _0x3b93f0=_0x34d210[_0xce91('0x146')](/"(.*?)"/);return _0x3b93f0?_0x3b93f0[0x1]:_0x34d210;}function extractCalleridNumber(_0x10941b){var _0x5284f5=_0x10941b[_0xce91('0x146')](/<(.*?)>/);return _0x5284f5?_0x5284f5[0x1]:_0x10941b;}Dialer[_0xce91('0x1c')]['actionOriginate']=function(_0x5f0482,_0xf2e450){var _0x3d6cc8=this;var _0x3e8b4e=uuid['v4']();this['actions'][_0x3e8b4e]=new Action(_0x5f0482,_0xf2e450,_0x3e8b4e);return new BPromise(function(_0x798cae,_0x37a7cc){if(_['isUndefined'](_0x5f0482)&&'object'!==typeof _0x5f0482){return _0x37a7cc(msgResponse('originate',_0xce91('0x124'),_0xce91('0x147')));}if(_[_0xce91('0x81')](_0xf2e450[_0xce91('0x148')][_0xce91('0x149')])||_0xf2e450[_0xce91('0x148')][_0xce91('0x149')]===null){return _0x37a7cc(msgResponse(_0xce91('0x14a'),_0xce91('0x124'),_0xce91('0x14b')));}var _0x25970e={'XMD-CALLERID':_0x3d6cc8[_0xce91('0x24')][_0x3e8b4e][_0xce91('0x14c')](),'XMD-AGI':_0x5f0482['dialQueueProject']?util[_0xce91('0x74')](_0xce91('0x14d'),ipAgi,_0x5f0482[_0xce91('0xee')]):'NONE','XMD-AGIAFTER':_0x5f0482['dialQueueProject2']?util[_0xce91('0x74')]('\x22agi://%s/square,%s\x22',ipAgi,_0x5f0482['dialQueueProject2']):_0xce91('0x14e'),'XMD-QUEUE':_0x5f0482['type']===_0xce91('0x8d')?util[_0xce91('0x74')](_0xce91('0x14f'),_0x5f0482[_0xce91('0x3e')],_0x5f0482['dialQueueOptions']||'',_0x5f0482[_0xce91('0xf6')]?'c':'',_0x5f0482[_0xce91('0x101')]||0x3):_0xce91('0x14e'),'XMD-CONTACTID':_0xf2e450[_0xce91('0xcf')],'XMD-CDRTYPE':_0xce91('0x8'),'CALLERID(all)':_0x3d6cc8[_0xce91('0x24')][_0x3e8b4e][_0xce91('0x14c')](),'XMD-AMD':_0x5f0482[_0xce91('0xdc')]?'ACTIVE':_0xce91('0x14e'),'XMD-DESTINATION':_0xce91('0x150')};if(_0x5f0482['dialAMDActive']){_0x25970e[_0xce91('0x151')]=_0x5f0482[_0xce91('0x152')]||0x9c4;_0x25970e[_0xce91('0x153')]=_0x5f0482[_0xce91('0x154')]||0x5dc;_0x25970e[_0xce91('0x155')]=_0x5f0482['dialAMDAfterGreetingSilence']||0x320;_0x25970e[_0xce91('0x156')]=_0x5f0482[_0xce91('0x157')]||0x1388;_0x25970e[_0xce91('0x158')]=_0x5f0482['dialAMDMinWordLength']||0x64;_0x25970e[_0xce91('0x159')]=_0x5f0482[_0xce91('0x15a')]||0x32;_0x25970e[_0xce91('0x15b')]=_0x5f0482['dialAMDMaximumNumberOfWords']||0x3;_0x25970e['XMD-AMDSILENCETHRESHOLD']=_0x5f0482[_0xce91('0x15c')]||0x100;_0x25970e[_0xce91('0x15d')]=_0x5f0482[_0xce91('0x15e')]||0x1388;}if(_0x5f0482[_0xce91('0x53')]==='outbound'){_0x25970e['XMD-VOICEQUEUEID']=_0xf2e450[_0xce91('0xd2')];}else{_0x25970e['XMD-CAMPAIGNID']=_0xf2e450[_0xce91('0xd3')];}for(var _0x58b067 in _0xf2e450[_0xce91('0x148')]){if(_0xf2e450[_0xce91('0x148')][_0xce91('0x95')](_0x58b067)){if(isNotNull(_0xf2e450['Contact'][_0x58b067])&&_0x58b067!=='id'&&_0x58b067!==_0xce91('0x15f')&&_0x58b067!==_0xce91('0x160')&&_0x58b067!=='updatedAt'){_0x25970e[util[_0xce91('0x74')](_0xce91('0x161'),_0xce91('0x162'),_[_0xce91('0x163')](_0x58b067))]=_0xf2e450[_0xce91('0x148')][_0x58b067];}}}var _0x5937b9=_0x3d6cc8[_0xce91('0xd7')](_0x5f0482[_0xce91('0x72')])?getCallerId(_0x5f0482[_0xce91('0x72')][_0xce91('0x164')],_0x5f0482[_0xce91('0x59')],_0x5f0482[_0xce91('0x165')]>0x0?getCallerIdRandom(_0x5f0482[_0xce91('0x5a')],_0x5f0482[_0xce91('0x165')]):_0x5f0482[_0xce91('0x5a')]):getCallerId(_[_0xce91('0xd9')](_0x5f0482[_0xce91('0x166')])?_0x5f0482[_0xce91('0x72')]['callerid']:_0x5f0482[_0xce91('0x166')][_0xce91('0x164')],_0x5f0482[_0xce91('0x59')],_0x5f0482[_0xce91('0x165')]>0x0?getCallerIdRandom(_0x5f0482[_0xce91('0x5a')],_0x5f0482[_0xce91('0x165')]):_0x5f0482[_0xce91('0x5a')]);if(_0x5937b9){_0x25970e[_0xce91('0x167')]=_0x3d6cc8[_0xce91('0x24')][_0x3e8b4e][_0xce91('0x168')]=extractCalleridName(_0x5937b9);_0x25970e[_0xce91('0x169')]=_0x3d6cc8[_0xce91('0x24')][_0x3e8b4e][_0xce91('0x16a')]=extractCalleridNumber(_0x5937b9);}return ami[_0xce91('0xab')]({'actionid':_0x3e8b4e,'action':_0xce91('0x14a'),'channel':_0x3d6cc8[_0xce91('0xd7')](_0x5f0482['Trunk'])?util[_0xce91('0x74')]('SIP/%s/%s%s',_0x5f0482[_0xce91('0x72')][_0xce91('0x3e')],isNotNull(_0x5f0482[_0xce91('0x16b')])?_0x5f0482['dialPrefix'][_0xce91('0x16c')]()||'':'',_0x5f0482[_0xce91('0x16d')]>0x0?_0xf2e450[_0xce91('0x148')]['phone']['substring'](_0x5f0482[_0xce91('0x16d')]):_0xf2e450[_0xce91('0x148')][_0xce91('0x149')]):util[_0xce91('0x74')]('SIP/%s/%s%s',_[_0xce91('0xd9')](_0x5f0482[_0xce91('0x166')])?_0x5f0482[_0xce91('0x72')][_0xce91('0x3e')]:_0x5f0482['TrunkBackup'][_0xce91('0x3e')],isNotNull(_0x5f0482['dialPrefix'])?_0x5f0482['dialPrefix']['trim']()||'':'',_0x5f0482[_0xce91('0x16d')]>0x0?_0xf2e450[_0xce91('0x148')]['phone'][_0xce91('0x16e')](_0x5f0482[_0xce91('0x16d')]):_0xf2e450['Contact']['phone']),'callerid':_0x5937b9,'Exten':_0xce91('0x150'),'Context':_0xce91('0x16f'),'Priority':'1','variable':_0x25970e,'timeout':(_0x5f0482[_0xce91('0x170')]||0x1e)*0x3e8,'async':!![],'channelid':_0x3e8b4e})[_0xce91('0xb6')](function(_0x2ccbd8){return _0x798cae(_0x2ccbd8);})[_0xce91('0xae')](function(_0x4cfd45){_0x5f0482['outboundOriginateFailureCallsDay']+=0x1;var _0xa307bb=new History(_0x3d6cc8['actions'][_0x3e8b4e]);logger[_0xce91('0x92')](util['format']('[originateError]:\x20%s',JSON['stringify'](_0x4cfd45)));_0xa307bb['state']=0xe;_0xa307bb[_0xce91('0xa4')]=_0xce91('0x171');_0xa307bb['starttime']=moment()[_0xce91('0x74')]('YYYY-MM-DD\x20HH:mm:ss');_0xa307bb['endtime']=_0xa307bb['starttime'];_0x3d6cc8[_0xce91('0xc7')](_0xa307bb)['catch'](loggerCatch(_0xce91('0x172')));_0x3d6cc8[_0xce91('0xc5')](_0xa307bb)['catch'](loggerCatch(_0xce91('0x172')))[_0xce91('0x110')](function(){delete _0x3d6cc8['actions'][_0x3e8b4e];return _0x37a7cc(msgResponse(_0xce91('0x14a'),_0xce91('0x48'),'originate\x20action\x20Error'));});});});};Dialer['prototype'][_0xce91('0x173')]=function(_0x5c6d25){var _0x1ee5da=this[_0xce91('0x24')][_0x5c6d25[_0xce91('0x105')]];var _0x525c4e=this;if(_0x1ee5da){delete this[_0xce91('0x24')][_0x5c6d25[_0xce91('0x105')]];_0x1ee5da[_0xce91('0x100')]=moment()[_0xce91('0x74')](_0xce91('0xf7'));var _0x27a7f8=_0x1ee5da['type']===_0xce91('0x77')?this[_0xce91('0x20')][_0x1ee5da[_0xce91('0xb1')]]:this[_0xce91('0x1f')][_0x1ee5da[_0xce91('0x174')]()];if(!this['isSuccess'](_0x5c6d25[_0xce91('0x175')])){this[_0xce91('0xb0')](_0x27a7f8);return this[_0xce91('0x176')](_0x1ee5da,_0x27a7f8,_0x5c6d25)[_0xce91('0xb6')](function(_0xdb6ab7){})[_0xce91('0xae')](loggerCatch('[callProgressDetecting]\x20'));}else{this[_0xce91('0x26')][_0x5c6d25[_0xce91('0xdd')]]=_0x1ee5da;}}};Dialer[_0xce91('0x1c')][_0xce91('0x177')]=function(_0x42fa4d,_0x49411d,_0x5cddf7){var _0x425299=new History(_0x49411d);if(_0x425299[_0xce91('0x178')]+_0x425299[_0xce91('0x179')]+_0x425299[_0xce91('0x17a')]>=_0x5cddf7[_0xce91('0x17b')]-0x1){return!![];}switch(_0x42fa4d){case 0x3:if(_0x425299[_0xce91('0x17a')]>=_0x5cddf7[_0xce91('0x17c')]-0x1){return!![];}else{this['rescheduleContact']({'active':![],'countnoanswerretry':_0x425299[_0xce91('0x17a')]+=0x1,'scheduledat':moment()['add'](_0x5cddf7[_0xce91('0x17d')],'minutes')[_0xce91('0x74')](_0xce91('0xf7')),'ContactId':_0x425299[_0xce91('0xcf')],'ListId':_0x425299[_0xce91('0xd0')],'VoiceQueueId':_0x425299[_0xce91('0xd2')]||undefined,'CampaignId':_0x425299[_0xce91('0xd3')]||undefined})[_0xce91('0xae')](loggerCatch('[rescheduleContact][NoAnswer]'));}break;case 0x5:if(_0x425299[_0xce91('0x178')]>=_0x5cddf7['dialBusyMaxRetry']-0x1){return!![];}else{this[_0xce91('0xbe')]({'active':![],'countbusyretry':_0x425299[_0xce91('0x178')]+=0x1,'scheduledat':moment()[_0xce91('0x17e')](_0x5cddf7[_0xce91('0x17f')],'minutes')[_0xce91('0x74')](_0xce91('0xf7')),'ContactId':_0x425299[_0xce91('0xcf')],'ListId':_0x425299[_0xce91('0xd0')],'VoiceQueueId':_0x425299[_0xce91('0xd2')]||undefined,'CampaignId':_0x425299['CampaignId']||undefined})['catch'](loggerCatch(_0xce91('0x180')));}break;case 0x8:if(_0x425299[_0xce91('0x179')]>=_0x5cddf7[_0xce91('0x181')]-0x1){return!![];}else{this[_0xce91('0xbe')]({'active':![],'countcongestionretry':_0x425299['countcongestionretry']+=0x1,'scheduledat':moment()[_0xce91('0x17e')](_0x5cddf7[_0xce91('0x182')],_0xce91('0x183'))[_0xce91('0x74')](_0xce91('0xf7')),'ContactId':_0x425299['ContactId'],'ListId':_0x425299['ListId'],'VoiceQueueId':_0x425299[_0xce91('0xd2')]||undefined,'CampaignId':_0x425299[_0xce91('0xd3')]||undefined})['catch'](loggerCatch(_0xce91('0x184')));}break;default:return!![];}};Dialer['prototype'][_0xce91('0x176')]=function(_0x2bc35d,_0x1dd689,_0x2226ed){var _0x2a4951=this;var _0x342d97=new History(_0x2bc35d);return new BPromise(function(_0x4617b0,_0x191e64){if(_[_0xce91('0x81')](_0x1dd689)&&_0xce91('0x185')!==typeof _0x1dd689){return _0x191e64(msgResponse(_0xce91('0x186'),_0xce91('0x124'),'entity\x20is\x20undefine'));}if(_[_0xce91('0x81')](_0x2226ed)&&_0xce91('0x185')!==typeof _0x2226ed){return _0x191e64(msgResponse(_0xce91('0x186'),_0xce91('0x124'),_0xce91('0x187')));}switch(_0x2226ed[_0xce91('0xf3')]){case'0':_0x1dd689[_0xce91('0x63')]+=0x1;_0x342d97['state']=0x0;_0x342d97[_0xce91('0xa4')]=_0xce91('0x188');_0x2a4951[_0xce91('0xc7')](_0x342d97)[_0xce91('0xae')](loggerCatch(_0xce91('0x189')));if(_0x2a4951[_0xce91('0x177')](0x0,_0x2bc35d,_0x1dd689)){if(_0x342d97[_0xce91('0x178')]+_0x342d97[_0xce91('0x179')]+_0x342d97['countnoanswerretry']>=_0x1dd689[_0xce91('0x17b')]){_0x2a4951[_0xce91('0x18a')](_0x342d97,_0x4617b0,_0x191e64,'reason\x200\x20no\x20such\x20number....');}else{_0x2a4951['createStateFinal'](_0x342d97,_0x4617b0,_0x191e64,'reason\x200\x20no\x20such\x20number....');}}break;case'3':_0x1dd689[_0xce91('0x62')]+=0x1;_0x342d97[_0xce91('0xa3')]=0x3;_0x342d97[_0xce91('0xa4')]=_0xce91('0x18b');_0x342d97[_0xce91('0x17a')]+=0x1;_0x342d97[_0xce91('0x18c')]+=0x1;_0x2a4951['createHistory'](_0x342d97)[_0xce91('0xae')](loggerCatch(_0xce91('0x18d')));if(_0x2a4951[_0xce91('0x177')](0x3,_0x2bc35d,_0x1dd689)){if(_0x342d97['countnoanswerretry']>=_0x1dd689['dialNoAnswerMaxRetry']){_0x2a4951[_0xce91('0x18e')](_0x342d97,_0x4617b0,_0x191e64,_0xce91('0x18f'));}else{_0x2a4951[_0xce91('0x18a')](_0x342d97,_0x4617b0,_0x191e64,'reason\x203\x20ringing\x20no\x20answer');}}break;case'5':_0x1dd689[_0xce91('0x5e')]+=0x1;_0x342d97['state']=0x5;_0x342d97['statedesc']=_0xce91('0x190');_0x342d97[_0xce91('0x178')]+=0x1;_0x342d97[_0xce91('0x18c')]+=0x1;_0x2a4951[_0xce91('0xc7')](_0x342d97)['catch'](loggerCatch(_0xce91('0x191')));if(_0x2a4951[_0xce91('0x177')](0x5,_0x2bc35d,_0x1dd689)){if(_0x342d97['countbusyretry']>=_0x1dd689[_0xce91('0x192')]){_0x2a4951['createStateFinal'](_0x342d97,_0x4617b0,_0x191e64,_0xce91('0x193'));}else{_0x2a4951[_0xce91('0x18a')](_0x342d97,_0x4617b0,_0x191e64,_0xce91('0x193'));}}break;case'8':_0x1dd689[_0xce91('0x5f')]+=0x1;_0x342d97['state']=0x8;_0x342d97[_0xce91('0xa4')]=_0xce91('0x194');_0x342d97['countcongestionretry']+=0x1;_0x342d97['countglobal']+=0x1;_0x2a4951['createHistory'](_0x342d97)[_0xce91('0xae')](loggerCatch(_0xce91('0x195')));if(_0x2a4951['checkRetriveMax'](0x8,_0x2bc35d,_0x1dd689)){if(_0x342d97['countcongestionretry']>=_0x1dd689[_0xce91('0x181')]){_0x2a4951[_0xce91('0x18e')](_0x342d97,_0x4617b0,_0x191e64,_0xce91('0x196'));}else{_0x2a4951[_0xce91('0x18a')](_0x342d97,_0x4617b0,_0x191e64,'reason\x208\x20congestion');}}break;default:_0x1dd689['outboundUnknownCallsDay']+=0x1;_0x342d97[_0xce91('0xa3')]=0xc;_0x342d97['statedesc']=_0x2226ed['reason'];_0x2a4951[_0xce91('0xc7')](_0x342d97)['catch'](loggerCatch(_0xce91('0x197')));if(_0x2a4951[_0xce91('0x177')](_0x2226ed['reason'],_0x2bc35d,_0x1dd689)){if(_0x342d97[_0xce91('0x178')]+_0x342d97[_0xce91('0x179')]+_0x342d97['countnoanswerretry']>=_0x1dd689[_0xce91('0x17b')]){_0x2a4951[_0xce91('0x18a')](_0x342d97,_0x4617b0,_0x191e64,_0x2226ed[_0xce91('0xf3')]);}else{_0x2a4951['createStateFinal'](_0x342d97,_0x4617b0,_0x191e64,_0x2226ed['reason']);}}}});};Dialer[_0xce91('0x1c')][_0xce91('0x18a')]=function(_0x4b636c,_0x52c4a0,_0x19d0b3,_0x279f79){var _0x284564=new Final(_0x4b636c);_0x284564[_0xce91('0xa3')]=0xf;_0x284564['statedesc']=_0xce91('0x198');this[_0xce91('0x18e')](_0x284564,_0x52c4a0,_0x19d0b3,_0x279f79);};Dialer[_0xce91('0x1c')][_0xce91('0x18e')]=function(_0x2ffdf2,_0x4f7501,_0x7c9da2,_0x2f2aaa){this[_0xce91('0xc5')](_0x2ffdf2)['then'](function(_0x35d107){return _0x4f7501(msgResponse(_0xce91('0x186'),_0xce91('0x199'),_0x2f2aaa));})[_0xce91('0xae')](function(_0x124f3e){return _0x7c9da2(msgResponse('[moveContactManagedDialer][0]',_0xce91('0x124'),_0xce91('0x19a')));});};Dialer['prototype'][_0xce91('0xa')]=function(_0x47005e){var _0x317876=this;var _0x10f19d=_0x47005e[_0xce91('0x19b')]/0x64;var _0x567aa8=_0x47005e[_0xce91('0x61')]/(_0x47005e[_0xce91('0x61')]+_0x47005e['outboundAnswerCallsDay']);var _0x5a38c6=Math[_0xce91('0x19c')](_0x47005e[_0xce91('0x6e')]*(_0x47005e['predictiveIntervalMaxThreshold']/0x64));var _0x4951c8=Math['round'](_0x47005e[_0xce91('0x6e')]*(_0x47005e[_0xce91('0x19d')]/0x64));var _0x22273d=_0x47005e[_0xce91('0x4e')]+_0x47005e[_0xce91('0x19e')];var _0x14bfa3=Math['floor'](_0x47005e[_0xce91('0x86')]*_0x47005e[_0xce91('0x71')]*_0x47005e['predictiveIntervalHitRate']*_0x47005e[_0xce91('0x6c')]);if(_[_0xce91('0x81')](_0x47005e[_0xce91('0x28')])){if(!_[_0xce91('0x81')](_0x47005e[_0xce91('0x27')])){_0x47005e[_0xce91('0x27')]=undefined;loggerPredictive[_0xce91('0x92')](_0xce91('0x19f'),_0xce91('0x1a0'));}if(!_['isUndefined'](_0x47005e['handlePredictive'])){loggerPredictive[_0xce91('0x92')]('[startMethodPredictive][StartProgressive]',_0xce91('0x1a1'));clearInterval(_0x47005e[_0xce91('0x8b')]);_0x47005e[_0xce91('0x8b')]=undefined;}_0x47005e[_0xce91('0x28')]=moment()[_0xce91('0x74')](_0xce91('0xf7'));loggerPredictive[_0xce91('0x79')](_0x47005e[_0xce91('0x3e')],_0xce91('0x1a2'),_0x47005e['startProgressive']);this[_0xce91('0x138')](_0x47005e,0x1);}else if(ifInterval(_0x47005e[_0xce91('0x1a3')],_0x47005e[_0xce91('0x28')])){this[_0xce91('0x138')](_0x47005e,0x1);loggerPredictiveCalls[_0xce91('0x79')]('[startMethodPredictive][StartProgressive][Loop]',_0x47005e[_0xce91('0x28')],_0x47005e['name']);_0x47005e[_0xce91('0x86')]=0x0;_0x47005e[_0xce91('0x6a')]=0x0;}else if(_0x10f19d<_0x567aa8&&_0x47005e[_0xce91('0x1a4')]===_0xce91('0x1a5')){freeVariablesPredictive(_0x47005e);loggerPredictive['info'](_0xce91('0x1a6'),_0xce91('0x1a7'),_0x567aa8,'startProgressive',_0x47005e[_0xce91('0x3e')]);}else if(_0x14bfa3<_0x47005e['predictiveIntervalErlangCallsDroppedCalls']&&_0x47005e[_0xce91('0x1a4')]===_0xce91('0x1a5')){freeVariablesPredictive(_0x47005e);loggerPredictive[_0xce91('0x79')](_0xce91('0x1a8'),_0xce91('0x1a9'),_0x14bfa3,'Drop\x20in\x20this\x20interval',_0x47005e['predictiveIntervalErlangCallsDroppedCalls'],'startProgressive',_0x47005e[_0xce91('0x3e')]);}else if(!ifInterval(_0x47005e['dialPredictiveInterval'],_0x47005e['startProgressive'])&&_['isUndefined'](_0x47005e[_0xce91('0x27')])&&!_[_0xce91('0x81')](_0x47005e[_0xce91('0x28')])){_0x47005e[_0xce91('0x27')]=moment()['format'](_0xce91('0xf7'));loggerPredictive[_0xce91('0x79')](_0x47005e['name'],_0xce91('0x1aa'),_0x47005e[_0xce91('0x27')]);this[_0xce91('0xbb')](_0x47005e[_0xce91('0x1a3')])[_0xce91('0xb6')](this[_0xce91('0x1ab')](_0x47005e))[_0xce91('0xb6')](mergeDataErlangB(_0x47005e))[_0xce91('0xb6')](this[_0xce91('0x1ac')](_0x47005e))[_0xce91('0xae')](loggerCatchPredictive(_0xce91('0x1ad'),_0x47005e));}else if(!ifInterval(_0x47005e[_0xce91('0x1a3')],_0x47005e[_0xce91('0x27')])){_0x47005e[_0xce91('0x6a')]=0x0;_0x47005e[_0xce91('0x27')]=moment()[_0xce91('0x74')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0xce91('0x79')](_0x47005e[_0xce91('0x3e')],_0xce91('0x1ae'),_0x47005e[_0xce91('0x27')]);clearInterval(_0x47005e['handlePredictive']);_0x47005e[_0xce91('0x8b')]=undefined;this[_0xce91('0xbb')](_0x47005e['dialPredictiveInterval'])[_0xce91('0xb6')](this[_0xce91('0x1ab')](_0x47005e))[_0xce91('0xb6')](mergeDataErlangB(_0x47005e))[_0xce91('0xb6')](this[_0xce91('0x1ac')](_0x47005e))['catch'](loggerCatchPredictive(_0xce91('0x1af'),_0x47005e));}else if(_0x47005e[_0xce91('0x6e')]&&_0x22273d<_0x47005e[_0xce91('0x6e')]-_0x4951c8){freeVariablesPredictive(_0x47005e);loggerPredictive['info'](_0x47005e[_0xce91('0x3e')],_0xce91('0x1b0'),_0x22273d,')\x20are\x20less\x20than\x20threshold\x20(',_0x47005e[_0xce91('0x6e')],'-',_0x4951c8,'=',_0x47005e[_0xce91('0x6e')]-_0x4951c8,')');}else if(_0x47005e[_0xce91('0x6e')]&&_0x22273d>_0x47005e[_0xce91('0x6e')]+_0x5a38c6){freeVariablesPredictive(_0x47005e);loggerPredictive['info'](_0x47005e['name'],_0xce91('0x1b0'),_0x22273d,_0xce91('0x1b1'),_0x47005e[_0xce91('0x6e')],'+',_0x5a38c6,'=',_0x47005e[_0xce91('0x6e')]+_0x5a38c6,')');}};Dialer[_0xce91('0x1c')]['getDataPredictive']=function(_0x5d503b){var _0x4b23db=this;return function(_0x1ff7ea){return new BPromise(function(_0x2a180d,_0x270d43){_[_0xce91('0x10c')](_0x5d503b,_0x1ff7ea[0x0]);if(checkGetDataPredictive(_0x1ff7ea[0x0])){var _0x2bfca6=_0x5d503b[_0xce91('0x6e')]=_0x5d503b['talking']+_0x5d503b['available'];var _0x40e845=_0x5d503b[_0xce91('0x1a3')]*0x3c;var _0x1db359=_0x1ff7ea[0x0]['predictiveIntervalAvgTalktime']+_0x1ff7ea[0x0]['predictiveIntervalAvgHoldtime'];var _0x360b12=(_0x1ff7ea[0x0][_0xce91('0x66')]+_0x1ff7ea[0x0][_0xce91('0x69')]+_0x1ff7ea[0x0][_0xce91('0x68')])/_0x1ff7ea[0x0][_0xce91('0x7b')];_0x5d503b[_0xce91('0x6b')]=_0x360b12>0x0?_0x360b12:0x1;switch(_0x5d503b[_0xce91('0x1a4')]){case'dropRate':var _0x2593b=_0x5d503b[_0xce91('0x19b')]/0x64;return _0x4b23db[_0xce91('0x1b2')](_0x2bfca6,_0x40e845,_0x1db359,_0x360b12,_0x2593b)[_0xce91('0xb6')](function(_0x50c9b8){return _0x2a180d(_0x50c9b8);});case'agentBusyFactor':var _0x1ea59d=_0x5d503b[_0xce91('0x19b')]/0x64;return _0x4b23db[_0xce91('0x1b3')](_0x2bfca6,_0x40e845,_0x1db359,_0x360b12,_0x1ea59d)[_0xce91('0xb6')](function(_0xaa625c){return _0x2a180d(_0xaa625c);});default:return _0x270d43(msgResponse(_0xce91('0x1b4'),_0xce91('0x124'),'Unknown\x20Predictive'));}}else{return _0x270d43(msgResponse('[getDataPredictive]',_0xce91('0x124'),_0xce91('0x1b5')));}});};};Dialer[_0xce91('0x1c')][_0xce91('0x1b6')]=function(_0x5d4730){var _0x4742ed=this;return function(_0x546d86){return new BPromise(function(_0x96dc6f,_0x1ff667){_['merge'](_0x5d4730,_0x546d86[0x0]);if(checkGetDataPredictive(_0x546d86[0x0])){loggerPredictive['info'](JSON[_0xce91('0x49')](_0x546d86[0x0]));if(_0x5d4730['dialPredictiveOptimization']===_0xce91('0x1a5')){return _0x4742ed['getVoiceQueueRtPauses'](_0x5d4730['id'])['then'](function(_0x2cbb99){var _0x106355=_0x5d4730[_0xce91('0x4f')]-_0x2cbb99[0x0][_0xce91('0x1b7')];var _0xa9660b=_0x5d4730[_0xce91('0x1a3')]*0x3c;var _0xd4a8a4=_0x546d86[0x0]['predictiveIntervalAvgTalktime']+_0x546d86[0x0]['predictiveIntervalAvgHoldtime'];var _0x21fed0=(_0x546d86[0x0][_0xce91('0x66')]+_0x546d86[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x546d86[0x0][_0xce91('0x68')])/_0x546d86[0x0][_0xce91('0x7b')];var _0x2a0cc2=_0x5d4730[_0xce91('0x19b')]/0x64;_0x5d4730[_0xce91('0x6d')]=_0x2cbb99[0x0]['outboundQueuePauses']||0x0;_0x5d4730[_0xce91('0x6b')]=_0x21fed0>0x0?_0x21fed0:0x1;return _0x4742ed['abandonmentRate'](_0x106355,_0xa9660b,_0xd4a8a4,_0x21fed0,_0x2a0cc2);})[_0xce91('0xb6')](function(_0x56a4a1){return _0x96dc6f(_0x56a4a1);})[_0xce91('0xae')](function(_0x1817f2){return _0x1ff667(msgResponse(_0xce91('0x1b8'),'Failure',JSON[_0xce91('0x49')](_0x1817f2)));});}if(_0x5d4730[_0xce91('0x1a4')]===_0xce91('0x1b9')){return _0x4742ed[_0xce91('0xc3')](_0x5d4730['id'])[_0xce91('0xb6')](function(_0x5bbbc1){var _0x2346fd=_0x5d4730[_0xce91('0x4f')]-_0x5bbbc1[0x0][_0xce91('0x1b7')];var _0x42522f=_0x5d4730[_0xce91('0x1a3')]*0x3c;var _0x56f6dc=_0x546d86[0x0]['predictiveIntervalAvgTalktime']+_0x546d86[0x0]['predictiveIntervalAvgHoldtime'];var _0x9c9b10=(_0x546d86[0x0][_0xce91('0x66')]+_0x546d86[0x0][_0xce91('0x69')]+_0x546d86[0x0][_0xce91('0x68')])/_0x546d86[0x0][_0xce91('0x7b')];var _0x2660d4=_0x5d4730[_0xce91('0x19b')]/0x64;_0x5d4730[_0xce91('0x6d')]=_0x5bbbc1[0x0][_0xce91('0x1b7')]||0x0;_0x5d4730['predictiveIntervalHitRate']=_0x9c9b10>0x0?_0x9c9b10:0x1;return _0x4742ed['busyFactor'](_0x2346fd,_0x42522f,_0x56f6dc,_0x9c9b10,_0x2660d4);})[_0xce91('0xb6')](function(_0x29c275){return _0x96dc6f(_0x29c275);})['catch'](function(_0x893ae0){return _0x1ff667(msgResponse('[CatchErlangB]','Failure',JSON['stringify'](_0x893ae0)));});}}else{return _0x1ff667(msgResponse(_0xce91('0x1b4'),_0xce91('0x124'),_0xce91('0x1b5')));}});};};Dialer[_0xce91('0x1c')][_0xce91('0x1ac')]=function(_0x331a43){var _0xcd90a=this;return function(){var _0x16e4de=0x0;var _0x5b3ed3=Math[_0xce91('0x1ba')](_0x331a43[_0xce91('0x70')]*0x3e8);if(_0x5b3ed3>0x0){_0x5b3ed3=_0x5b3ed3<0x64?0x64:_0x5b3ed3;loggerPredictive[_0xce91('0x79')](_0x331a43[_0xce91('0x3e')],_0xce91('0x1bb'),_0x5b3ed3,_0xce91('0x4a'));_0x331a43['handlePredictive']=setInterval(function(){_0xcd90a[_0xce91('0x8b')](_0x331a43);loggerPredictiveCalls[_0xce91('0x79')](_0xce91('0x1bc'),_0x16e4de+=0x1);},_0x5b3ed3);}else{loggerPredictive['info'](_0x331a43['name'],_0xce91('0x1bd'));}};};Dialer[_0xce91('0x1c')][_0xce91('0x1be')]=function(_0x2e438a,_0x30d54e){var _0x44618c=this;return function(_0x103b50){if(_[_0xce91('0x45')](_0x103b50)){if(_[_0xce91('0xd9')](_0x30d54e[_0xce91('0xd1')])||!_0x30d54e['recallme']){if(_0x2e438a[_0xce91('0x58')]==='booked'){_0x2e438a[_0xce91('0x10e')]=_[_0xce91('0x81')](_0x2e438a[_0xce91('0x10e')])?!![]:_0x2e438a[_0xce91('0x10e')];var _0x5aa94a=uuid['v4']();_0x44618c[_0xce91('0x24')][_0x5aa94a]=new Action(_0x2e438a,_0x30d54e,_0x5aa94a);loggerBooked[_0xce91('0x79')](_0xce91('0x1bf'),_0x5aa94a,_0xce91('0x1c0'),JSON[_0xce91('0x49')](_0x2e438a[_0xce91('0x10e')]),'Queue:\x20',_0x2e438a[_0xce91('0x3e')]);if(_0x2e438a['queueStatusComplete']){_0x2e438a['queueStatusComplete']=![];_0x44618c[_0xce91('0x2a')][_0x44618c[_0xce91('0x24')][_0x5aa94a][_0xce91('0xb1')]]=[];ami['Action']({'actionid':_0x5aa94a,'action':_0xce91('0x1c1'),'queue':_0x2e438a[_0xce91('0x3e')]})[_0xce91('0xae')](function(_0x46e293){_0x44618c[_0xce91('0xb0')](_0x2e438a);_0x44618c[_0xce91('0xbe')]({'active':![],'ContactId':_0x44618c[_0xce91('0x24')][_0x5aa94a][_0xce91('0xcf')],'ListId':_0x44618c[_0xce91('0x24')][_0x5aa94a]['ListId'],'VoiceQueueId':_0x44618c[_0xce91('0x24')][_0x5aa94a][_0xce91('0xd2')]||undefined,'CampaignId':_0x44618c[_0xce91('0x24')][_0x5aa94a][_0xce91('0xd3')]||undefined})['catch'](loggerCatch(_0xce91('0x1c2')));delete _0x44618c[_0xce91('0x24')][_0x5aa94a];});}else{loggerBooked[_0xce91('0x79')](_0xce91('0x1c3'),JSON[_0xce91('0x49')](_0x2e438a[_0xce91('0x10e')]),_0xce91('0x1c4'),_0x2e438a[_0xce91('0x3e')]);_0x44618c[_0xce91('0xb0')](_0x2e438a);_0x44618c[_0xce91('0xbe')]({'active':![],'ContactId':_0x44618c[_0xce91('0x24')][_0x5aa94a]['ContactId'],'ListId':_0x44618c['actions'][_0x5aa94a][_0xce91('0xd0')],'VoiceQueueId':_0x44618c[_0xce91('0x24')][_0x5aa94a][_0xce91('0xd2')]||undefined,'CampaignId':_0x44618c[_0xce91('0x24')][_0x5aa94a][_0xce91('0xd3')]||undefined})[_0xce91('0xae')](loggerCatch('[unlockOriginate][syncQueueStatusComplete]'));delete _0x44618c['actions'][_0x5aa94a];}}else{return _0x44618c[_0xce91('0x1c5')](_0x2e438a,_0x30d54e);}}else{if(getDiff(_0x30d54e[_0xce91('0x1c6')])<_0x2e438a[_0xce91('0x1c7')]*0x3c){_0x44618c[_0xce91('0x8e')][_0xce91('0x118')](_0x30d54e['id'])[_0xce91('0x110')](function(){_0x44618c[_0xce91('0xb0')](_0x2e438a);});}else{_0x2e438a[_0xce91('0x1c8')]+=0x1;_0x44618c['updateOriginated'](_0x2e438a);if(_0x2e438a[_0xce91('0x1c9')]){_0x44618c[_0xce91('0xbe')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x30d54e['ContactId'],'ListId':_0x30d54e[_0xce91('0xd0')],'VoiceQueueId':_0x30d54e[_0xce91('0xd2')]||undefined,'CampaignId':_0x30d54e[_0xce91('0xd3')]||undefined})[_0xce91('0xae')](loggerCatch(_0xce91('0x1ca')));_0x44618c['createHistory'](createObjHistory(_0x2e438a,_0x30d54e,_0xce91('0x1cb'),0x17,_0xce91('0x1cc')))[_0xce91('0xae')](loggerCatch(_0xce91('0x1cd')));}else{_0x44618c['saveInDb'](createObjHistory(_0x2e438a,_0x30d54e,'RECALLFAILEDTIMEOUT',0x16,'RecallFailedTimeout'),_0xce91('0x1ce'),_0xce91('0x1cf'));}}}}else{_0x2e438a['outboundBlacklistCallsDay']+=0x1;_0x44618c[_0xce91('0xcd')](createObjHistory(_0x2e438a,_0x30d54e,_0xce91('0x1d0'),0xd,'Blacklist'),_0xce91('0x1d1'),_0xce91('0x1d2'));throw _0xce91('0x1d3');}};};Dialer[_0xce91('0x1c')][_0xce91('0x13d')]=function(_0x15e533){var _0x32ed90=this;var _0x49cb42=[];var _0x40c587=_0x15e533['limitCalls']-_0x15e533['originated']-_0x15e533[_0xce91('0x1d4')];emitCampaignSummary(_0x15e533);if(_0x40c587>0x0){if(_0x40c587>this[_0xce91('0x23')]){_0x40c587=this['maxNumberOriginate'];}_0x15e533['temp']+=_0x40c587;this[_0xce91('0xc1')](_0x15e533['id'],_0x40c587,_0x15e533[_0xce91('0x1d5')])[_0xce91('0xb6')](function(_0x1c2e4b){_0x15e533['temp']-=_0x40c587;_0x15e533[_0xce91('0x1d4')]=_0x15e533['temp']>0x0?_0x15e533['temp']:0x0;if(!checkContactEmpty(_0x1c2e4b)){_0x15e533[_0xce91('0x3d')]=_0xce91('0x9b');logger['info'](_0xce91('0x1d6')+_0x15e533[_0xce91('0x3e')]);}else{_0x15e533['originated']+=_0x1c2e4b[_0xce91('0x113')];_0x15e533[_0xce91('0x3d')]=_0xce91('0x1d7');for(var _0xfd7245=0x0;_0xfd7245<_0x1c2e4b[_0xce91('0x113')];_0xfd7245+=0x1){_0x15e533['ivrTotalCallsDays']+=0x1;if(_[_0xce91('0xd9')](_0x1c2e4b[_0xfd7245])||_['isNil'](_0x1c2e4b[_0xfd7245][_0xce91('0x148')])||_['isNil'](_0x1c2e4b[_0xfd7245][_0xce91('0x148')][_0xce91('0x149')])){_0x32ed90['emptyContact'](_0xce91('0x1d8'),_0x15e533,_0x1c2e4b[_0xfd7245]);}else{_0x32ed90['checkIsBlackListIvr'](_[_0xce91('0xce')](_0x1c2e4b[_0xfd7245],[_0xce91('0xd3'),_0xce91('0x1d9')]))['then'](_0x32ed90[_0xce91('0x1be')](_0x15e533,_0x1c2e4b[_0xfd7245]))[_0xce91('0xae')](_0x32ed90[_0xce91('0x1da')](_0xce91('0x1db'),_0x15e533));}}}})['catch'](loggerGetContactDialer('[getContactCampaign2]',_0x15e533,_0x40c587));}};Dialer['prototype'][_0xce91('0x138')]=function(_0xed99e6,_0x585f17){var _0x1a5f23=this;var _0x510380=[];var _0x486e30=_0x585f17>=0x1?_0x585f17:0x1;var _0x2ec6b2=[];if(_0xed99e6[_0xce91('0x58')]===_0xce91('0x9')){_0x486e30=0x1;}var _0x8ccdce=Math['floor'](_0xed99e6[_0xce91('0x4e')]*_0x486e30)-_0xed99e6[_0xce91('0x6f')]-_0xed99e6['temp'];emitVoiceQueueSummary(_0xed99e6);if(_0xed99e6[_0xce91('0x1dc')]>0x0){var _0x3e9f2b=_0xed99e6[_0xce91('0x1dc')]-_0xed99e6[_0xce91('0x6f')]-_0xed99e6[_0xce91('0x19e')]-_0xed99e6[_0xce91('0x1d4')]-_0xed99e6[_0xce91('0x50')];if(_0x8ccdce>_0x3e9f2b){_0x8ccdce=_0x3e9f2b;}}if(_0x8ccdce>0x0){if(_0xed99e6[_0xce91('0x58')]===_0xce91('0x9')){_0x8ccdce=0x1;}if(_0x8ccdce>this[_0xce91('0x23')]){_0x8ccdce=this[_0xce91('0x23')];}_0xed99e6[_0xce91('0x1d4')]+=_0x8ccdce;for(var _0x27a755 in this[_0xce91('0x21')]){if(this[_0xce91('0x21')]['hasOwnProperty'](_0x27a755)){if(this[_0xce91('0x21')][_0x27a755]['state']===_0xce91('0x1dd')&&this[_0xce91('0x21')][_0x27a755][_0xce91('0xac')]===_0xce91('0x1de')){_0x510380[_0xce91('0x10b')](this[_0xce91('0x21')][_0x27a755]['id']);}}}this[_0xce91('0xc0')](_0xed99e6['id'],_0x510380,_0x8ccdce,_0xed99e6[_0xce91('0x1d5')])['then'](function(_0x45628b){_0xed99e6[_0xce91('0x1d4')]-=_0x8ccdce;_0xed99e6[_0xce91('0x1d4')]=_0xed99e6['temp']>0x0?_0xed99e6[_0xce91('0x1d4')]:0x0;if(!checkContactEmpty(_0x45628b)){_0x1a5f23[_0xce91('0xb4')](_0xed99e6)[_0xce91('0xb6')](sendMessageReschedule(_0xed99e6))[_0xce91('0xae')](loggerCatch(_0xce91('0xb7')));}else{_0xed99e6[_0xce91('0x6f')]+=_0x45628b[_0xce91('0x113')];_0xed99e6['message']=_0xed99e6[_0xce91('0x58')]===_0xce91('0x9')?_0xce91('0x1df'):_0xce91('0x1d7');for(var _0x15d282=0x0;_0x15d282<_0x45628b[_0xce91('0x113')];_0x15d282+=0x1){if(_[_0xce91('0xd9')](_0x45628b[_0x15d282])||_[_0xce91('0xd9')](_0x45628b[_0x15d282][_0xce91('0x148')])||_['isNil'](_0x45628b[_0x15d282]['Contact'][_0xce91('0x149')])){_0x1a5f23['emptyContact']('[actionOriginate]\x20',_0xed99e6,_0x45628b[_0x15d282]);}else{_0x1a5f23[_0xce91('0xb8')](_[_0xce91('0xce')](_0x45628b[_0x15d282],[_0xce91('0xd2'),_0xce91('0x1d9')]))[_0xce91('0xb6')](_0x1a5f23['checkContactBlack'](_0xed99e6,_0x45628b[_0x15d282]))[_0xce91('0xae')](_0x1a5f23[_0xce91('0x1da')](_0xce91('0x1d8'),_0xed99e6));}}}})[_0xce91('0xae')](loggerGetContactDialer('[getContactDialer2]',_0xed99e6,_0x8ccdce));}};Dialer[_0xce91('0x1c')][_0xce91('0x8b')]=function(_0xa619a2){var _0x41a8a0=this;if(_0xa619a2[_0xce91('0x1dc')]>0x0){var _0x31931f=_0xa619a2[_0xce91('0x1dc')]-_0xa619a2[_0xce91('0x6f')]-_0xa619a2[_0xce91('0x19e')];if(_0x31931f>0x0){this[_0xce91('0x1e0')](_0xa619a2);}else{loggerPredictiveCalls[_0xce91('0x79')](_0xce91('0x1e1'));}}else{this[_0xce91('0x1e0')](_0xa619a2);}};Dialer[_0xce91('0x1c')][_0xce91('0x1e0')]=function(_0x9c66f8){var _0x51113c=this;var _0x18ae42=[];_0x9c66f8[_0xce91('0x6f')]+=0x1;for(var _0x11c330 in this[_0xce91('0x21')]){if(this[_0xce91('0x21')]['hasOwnProperty'](_0x11c330)){if(this[_0xce91('0x21')][_0x11c330][_0xce91('0xa3')]===_0xce91('0x1dd')&&this[_0xce91('0x21')][_0x11c330][_0xce91('0xac')]===_0xce91('0x1de')){_0x18ae42[_0xce91('0x10b')](this[_0xce91('0x21')][_0x11c330]['id']);}}}this[_0xce91('0xc0')](_0x9c66f8['id'],_0x18ae42,0x1,_0x9c66f8['dialOrderByScheduledAt'])['then'](function(_0x4942a0){if(!checkContactEmpty(_0x4942a0)){checkContactLowerLimitOriginate(_0x9c66f8,0x1,0x0);_0x51113c[_0xce91('0xb4')](_0x9c66f8)[_0xce91('0xb6')](sendMessageReschedule(_0x9c66f8))[_0xce91('0xae')](loggerCatch(_0xce91('0xb7')));}else{_0x9c66f8['message']=_0xce91('0x1d7');if(_[_0xce91('0xd9')](_0x4942a0[0x0])||_[_0xce91('0xd9')](_0x4942a0[0x0]['Contact'])||_[_0xce91('0xd9')](_0x4942a0[0x0][_0xce91('0x148')]['phone'])){_0x51113c[_0xce91('0xcb')](_0xce91('0x1d8'),_0x9c66f8,_0x4942a0[0x0]);}else{_0x51113c[_0xce91('0xb8')](_[_0xce91('0xce')](_0x4942a0[0x0],[_0xce91('0xd2'),_0xce91('0x1d9')]))[_0xce91('0xb6')](_0x51113c[_0xce91('0x1be')](_0x9c66f8,_0x4942a0[0x0]))[_0xce91('0xae')](_0x51113c[_0xce91('0x1da')]('[actionOriginatePredictive]\x20',_0x9c66f8));}}})['catch'](loggerGetContactDialer(_0xce91('0x1e2'),_0x9c66f8,0x1));emitVoiceQueueSummary(_0x9c66f8);};Dialer[_0xce91('0x1c')][_0xce91('0x1b2')]=function(_0x3541d5,_0x58735f,_0xe56826,_0xf90a02,_0x1a331d,_0x1d8d49){loggerPredictive[_0xce91('0x79')](_0xce91('0x1e3'));loggerPredictive[_0xce91('0x79')](_0xce91('0x1e4'),_0x3541d5);loggerPredictive['info']('Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x58735f);loggerPredictive[_0xce91('0x79')](_0xce91('0x1e5'),_0xe56826);loggerPredictive[_0xce91('0x79')](_0xce91('0x1e6'),_0xf90a02);loggerPredictive[_0xce91('0x79')](_0xce91('0x1e7'),_0x1a331d);loggerPredictive[_0xce91('0x79')](_0xce91('0x80'));return new BPromise(function(_0x2a2e8b,_0x26f415){if(_0x3541d5<=0x0||isNaN(_0x3541d5)){return _0x26f415(msgResponse(_0xce91('0x1e8'),'Error',_0xce91('0x1e9')+_0x3541d5));}if(_0xe56826<=0x0||isNaN(_0xe56826)){return _0x26f415(msgResponse('[abandonmentRate]','Error',_0xce91('0x1ea')+_0xe56826));}if(_0xf90a02<=0x0||isNaN(_0xf90a02)){return _0x26f415(msgResponse(_0xce91('0x1e8'),_0xce91('0x48'),'p\x20=\x20'+_0xf90a02));}if(_0x58735f<=0x0||isNaN(_0x58735f)){return _0x26f415(msgResponse(_0xce91('0x1e8'),_0xce91('0x48'),_0xce91('0x1eb')+_0x58735f));}if(_0x1a331d<=0x0||isNaN(_0x1a331d)){return _0x26f415(msgResponse('[abandonmentRate]',_0xce91('0x48'),_0xce91('0x1ec')+_0x1a331d));}_0x1d8d49=_0x1d8d49||0x0;var _0x3f7d70=0x1/_0xe56826;var _0x208921=0x0;var _0x423051=0x0;var _0x23359c=0x0;var _0x209c3f=0x0;for(var _0xa9fde6=0x0;_0x23359c<_0x1a331d;_0xa9fde6+=0x1){_0x423051=_0xa9fde6/_0x58735f;_0x208921=(_0xf90a02*_0x423051+_0x1d8d49)/_0x3f7d70;_0x23359c=erlangb(_0x208921,_0x3541d5);_0x209c3f=_0x208921/_0x3541d5*(0x1-erlangb(_0x208921,_0x3541d5));}return _0x2a2e8b({'erlangCalls':_0xa9fde6,'erlangCallToSecond':_0x58735f/_0xa9fde6,'erlangAbandonmentRate':_0x23359c,'erlangBusyFactor':_0x209c3f});});};Dialer[_0xce91('0x1c')][_0xce91('0x1b3')]=function(_0x2fc2a1,_0x58a85d,_0x40fbcb,_0x2142ac,_0x4f247b,_0x163710){loggerPredictive[_0xce91('0x79')](_0xce91('0x1ed'));loggerPredictive['info']('M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x2fc2a1);loggerPredictive[_0xce91('0x79')]('Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x58a85d);loggerPredictive['info']('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',_0x40fbcb);loggerPredictive[_0xce91('0x79')](_0xce91('0x1e6'),_0x2142ac);loggerPredictive['info'](_0xce91('0x1ee'),_0x4f247b);loggerPredictive[_0xce91('0x79')](_0xce91('0x80'));return new BPromise(function(_0x1626b0,_0x428f50){if(_0x2fc2a1<=0x0||isNaN(_0x2fc2a1)){return _0x428f50(msgResponse(_0xce91('0x1ef'),_0xce91('0x48'),_0xce91('0x1e9')+_0x2fc2a1));}if(_0x40fbcb<=0x0||isNaN(_0x40fbcb)){return _0x428f50(msgResponse(_0xce91('0x1ef'),_0xce91('0x48'),_0xce91('0x1ea')+_0x40fbcb));}if(_0x2142ac<=0x0||isNaN(_0x2142ac)){return _0x428f50(msgResponse(_0xce91('0x1ef'),'Error',_0xce91('0x1f0')+_0x2142ac));}if(_0x58a85d<=0x0||isNaN(_0x58a85d)){return _0x428f50(msgResponse(_0xce91('0x1ef'),'Error',_0xce91('0x1eb')+_0x58a85d));}if(_0x4f247b<=0x0||isNaN(_0x4f247b)){return _0x428f50(msgResponse('[busyFactor]',_0xce91('0x48'),_0xce91('0x1f1')+_0x4f247b));}_0x163710=_0x163710||0x0;var _0x10b536=0x1/_0x40fbcb;var _0x1cf41b=0x0;var _0x4e8678=0x0;var _0x48345d=0x0;var _0x230cec=0x0;for(var _0x4cc9a2=0x0;_0x230cec<_0x4f247b;_0x4cc9a2+=0x1){_0x4e8678=_0x4cc9a2/_0x58a85d;_0x1cf41b=(_0x2142ac*_0x4e8678+_0x163710)/_0x10b536;_0x48345d=erlangb(_0x1cf41b,_0x2fc2a1);_0x230cec=_0x1cf41b/_0x2fc2a1*(0x1-erlangb(_0x1cf41b,_0x2fc2a1));}return _0x1626b0({'erlangCalls':_0x4cc9a2,'erlangCallToSecond':_0x58a85d/_0x4cc9a2,'erlangAbandonmentRate':_0x48345d,'erlangBusyFactor':_0x230cec});});};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 49e00b5..fe1f220 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 _0xff1f=['callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','lodash','moment','milliseconds','diff','seconds','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','uniqueid','calleridname','name','calleridnum','starttime','responsetime','droptime','endtime','holdtime','talktime','reason','callback'];(function(_0x5cafaa,_0x3a05c9){var _0x2cd41f=function(_0x4f3337){while(--_0x4f3337){_0x5cafaa['push'](_0x5cafaa['shift']());}};_0x2cd41f(++_0x3a05c9);}(_0xff1f,0x133));var _0xfff1=function(_0xce6f11,_0x3c3137){_0xce6f11=_0xce6f11-0x0;var _0x35b709=_0xff1f[_0xce6f11];return _0x35b709;};'use strict';var util=require('util');var _=require(_0xfff1('0x0'));var moment=require(_0xfff1('0x1'));function getSeconds(_0x7a992d,_0x30b876){var _0x5218b4=moment(_0x7a992d)[_0xfff1('0x2')](0x0);var _0x142712=moment(_0x30b876)['milliseconds'](0x0);return _0x5218b4[_0xfff1('0x3')](_0x142712,_0xfff1('0x4'));}function QueueCallerAbandon(_0x2c7141,_0x55a343){this[_0xfff1('0x5')]=_0x2c7141[_0xfff1('0x5')];this[_0xfff1('0x6')]=_0x2c7141[_0xfff1('0x6')];this[_0xfff1('0x7')]=_0x2c7141[_0xfff1('0x6')]===_0xfff1('0x8')?_0xfff1('0x9'):_0x2c7141['type'];this[_0xfff1('0xa')]=_0x2c7141[_0xfff1('0xa')];this['countcongestionretry']=_0x2c7141[_0xfff1('0xb')];this[_0xfff1('0xc')]=_0x2c7141[_0xfff1('0xc')];this[_0xfff1('0xd')]=_0x2c7141['countbusyretry']+_0x2c7141['countcongestionretry']+_0x2c7141[_0xfff1('0xc')];this['uniqueid']=_0x55a343[_0xfff1('0xe')];this[_0xfff1('0xf')]=_0x2c7141[_0xfff1('0x10')];this[_0xfff1('0x11')]=_0x2c7141['number'];this[_0xfff1('0x12')]=_0x2c7141[_0xfff1('0x12')];this['responsetime']=_0x2c7141[_0xfff1('0x13')];this['droptime']=_0x2c7141[_0xfff1('0x14')];this[_0xfff1('0x15')]=this[_0xfff1('0x14')];this['ringtime']=getSeconds(_0x2c7141[_0xfff1('0x13')],_0x2c7141['starttime']);this[_0xfff1('0x16')]=getSeconds(this[_0xfff1('0x14')],_0x2c7141[_0xfff1('0x13')]);this[_0xfff1('0x17')]=0x0;this[_0xfff1('0x9')]=_0x55a343[_0xfff1('0x9')];this['membername']=_0x55a343['connectedlinename'];this[_0xfff1('0x18')]=_0x55a343[_0xfff1('0x18')];this[_0xfff1('0x19')]=_0x2c7141['callback'];this['callbackuniqueid']=_0x2c7141[_0xfff1('0x1a')];this[_0xfff1('0x1b')]=_0x2c7141[_0xfff1('0x1b')];this['recallme']=_0x2c7141[_0xfff1('0x1c')];this[_0xfff1('0x1d')]=_0x2c7141[_0xfff1('0x1d')];this[_0xfff1('0x1e')]=_0x2c7141[_0xfff1('0x1e')];this[_0xfff1('0x1f')]=_0x2c7141[_0xfff1('0x1f')];this[_0xfff1('0x20')]=_0x2c7141[_0xfff1('0x20')];this['CampaignId']=_0x2c7141[_0xfff1('0x21')];this[_0xfff1('0x22')]=_0x2c7141[_0xfff1('0x22')]||'';this[_0xfff1('0x23')]=_0x2c7141['originatecalleridname']||'';}module[_0xfff1('0x24')]=QueueCallerAbandon; \ No newline at end of file +var _0x1e83=['recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','milliseconds','diff','seconds','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','droptime','ringtime','holdtime','talktime','membername','reason','callback','callbackuniqueid','callbackat'];(function(_0x2718c7,_0x5a1636){var _0x59d89c=function(_0x4d4f49){while(--_0x4d4f49){_0x2718c7['push'](_0x2718c7['shift']());}};_0x59d89c(++_0x5a1636);}(_0x1e83,0xa1));var _0x31e8=function(_0x2964f2,_0x1d6902){_0x2964f2=_0x2964f2-0x0;var _0x242480=_0x1e83[_0x2964f2];return _0x242480;};'use strict';var util=require(_0x31e8('0x0'));var _=require('lodash');var moment=require('moment');function getSeconds(_0x3e9a95,_0x14dfa5){var _0x4b389d=moment(_0x3e9a95)[_0x31e8('0x1')](0x0);var _0x4d182f=moment(_0x14dfa5)[_0x31e8('0x1')](0x0);return _0x4b389d[_0x31e8('0x2')](_0x4d182f,_0x31e8('0x3'));}function QueueCallerAbandon(_0x5b8f24,_0xc3803){this[_0x31e8('0x4')]=_0x5b8f24[_0x31e8('0x4')];this[_0x31e8('0x5')]=_0x5b8f24['type'];this[_0x31e8('0x6')]=_0x5b8f24['type']===_0x31e8('0x7')?_0x31e8('0x8'):_0x5b8f24[_0x31e8('0x5')];this['countbusyretry']=_0x5b8f24[_0x31e8('0x9')];this[_0x31e8('0xa')]=_0x5b8f24[_0x31e8('0xa')];this[_0x31e8('0xb')]=_0x5b8f24[_0x31e8('0xb')];this[_0x31e8('0xc')]=_0x5b8f24[_0x31e8('0x9')]+_0x5b8f24['countcongestionretry']+_0x5b8f24[_0x31e8('0xb')];this[_0x31e8('0xd')]=_0xc3803[_0x31e8('0xd')];this[_0x31e8('0xe')]=_0x5b8f24[_0x31e8('0xf')];this[_0x31e8('0x10')]=_0x5b8f24[_0x31e8('0x11')];this[_0x31e8('0x12')]=_0x5b8f24['starttime'];this[_0x31e8('0x13')]=_0x5b8f24[_0x31e8('0x13')];this[_0x31e8('0x14')]=_0x5b8f24[_0x31e8('0x14')];this['endtime']=this[_0x31e8('0x14')];this[_0x31e8('0x15')]=getSeconds(_0x5b8f24['responsetime'],_0x5b8f24[_0x31e8('0x12')]);this[_0x31e8('0x16')]=getSeconds(this[_0x31e8('0x14')],_0x5b8f24['responsetime']);this[_0x31e8('0x17')]=0x0;this[_0x31e8('0x8')]=_0xc3803[_0x31e8('0x8')];this[_0x31e8('0x18')]=_0xc3803['connectedlinename'];this[_0x31e8('0x19')]=_0xc3803[_0x31e8('0x19')];this[_0x31e8('0x1a')]=_0x5b8f24[_0x31e8('0x1a')];this['callbackuniqueid']=_0x5b8f24[_0x31e8('0x1b')];this[_0x31e8('0x1c')]=_0x5b8f24[_0x31e8('0x1c')];this[_0x31e8('0x1d')]=_0x5b8f24['recallme'];this['ContactId']=_0x5b8f24[_0x31e8('0x1e')];this[_0x31e8('0x1f')]=_0x5b8f24[_0x31e8('0x1f')];this[_0x31e8('0x20')]=_0x5b8f24[_0x31e8('0x20')];this[_0x31e8('0x21')]=_0x5b8f24[_0x31e8('0x21')];this[_0x31e8('0x22')]=_0x5b8f24[_0x31e8('0x22')];this[_0x31e8('0x23')]=_0x5b8f24['originatecalleridnum']||'';this[_0x31e8('0x24')]=_0x5b8f24[_0x31e8('0x24')]||'';}module[_0x31e8('0x25')]=QueueCallerAbandon; \ No newline at end of file diff --git a/server/services/ami/fax/action.js b/server/services/ami/fax/action.js index b99d908..089cca4 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 _0xc9c7=['path','AttachmentId','exports','util','lodash','moment','format','tech','Trunk','name','fax','localstationid','headerinfo'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xc9c7,0x6b));var _0x7c9c=function(_0x44d440,_0x92b5c8){_0x44d440=_0x44d440-0x0;var _0xe6cb51=_0xc9c7[_0x44d440];return _0xe6cb51;};'use strict';var util=require(_0x7c9c('0x0'));var _=require(_0x7c9c('0x1'));var moment=require(_0x7c9c('0x2'));function Action(_0xa43da1,_0x599b01,_0xb9e732){this['uniqueid']=_0xa43da1||undefined;this['channel']=util[_0x7c9c('0x3')]('%s/%s/%s',_0x599b01[_0x7c9c('0x4')],_0x599b01[_0x7c9c('0x5')][_0x7c9c('0x6')],_0xb9e732[_0x7c9c('0x7')]);this[_0x7c9c('0x8')]=_0x599b01[_0x7c9c('0x8')];this[_0x7c9c('0x9')]=_0x599b01['headerinfo'];this[_0x7c9c('0xa')]=_0xb9e732[_0x7c9c('0xa')];this[_0x7c9c('0xb')]=_0xb9e732['AttachmentId'];}module[_0x7c9c('0xc')]=Action; \ No newline at end of file +var _0x9eff=['channel','format','%s/%s/%s','tech','Trunk','name','localstationid','headerinfo','path','AttachmentId','exports','util','lodash','moment'];(function(_0x59b2a1,_0x1f631f){var _0x4908d1=function(_0x14c9b8){while(--_0x14c9b8){_0x59b2a1['push'](_0x59b2a1['shift']());}};_0x4908d1(++_0x1f631f);}(_0x9eff,0x1af));var _0xf9ef=function(_0x26462c,_0xd20a35){_0x26462c=_0x26462c-0x0;var _0x509a42=_0x9eff[_0x26462c];return _0x509a42;};'use strict';var util=require(_0xf9ef('0x0'));var _=require(_0xf9ef('0x1'));var moment=require(_0xf9ef('0x2'));function Action(_0x23e81e,_0x15ac1b,_0x2cfc78){this['uniqueid']=_0x23e81e||undefined;this[_0xf9ef('0x3')]=util[_0xf9ef('0x4')](_0xf9ef('0x5'),_0x15ac1b[_0xf9ef('0x6')],_0x15ac1b[_0xf9ef('0x7')][_0xf9ef('0x8')],_0x2cfc78['fax']);this[_0xf9ef('0x9')]=_0x15ac1b[_0xf9ef('0x9')];this[_0xf9ef('0xa')]=_0x15ac1b[_0xf9ef('0xa')];this['path']=_0x2cfc78[_0xf9ef('0xb')];this[_0xf9ef('0xc')]=_0x2cfc78[_0xf9ef('0xc')];}module[_0xf9ef('0xd')]=Action; \ No newline at end of file diff --git a/server/services/ami/fax/index.js b/server/services/ami/fax/index.js index 49c0930..3194dac 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 _0x8a91=['unmonitored','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','Is\x20Valid','exports','lodash','bluebird','moment','path','../../../config/logger','../ami','./rpcDb','./channel','./action','channels','faxAccounts','trunks','actions','newchannel','syncVarSet','syncNewState','bind','syncNewExten','faxstatus','syncFaxStatus','receivefax','syncReceiveFax','hangup','syncOriginateResponse','syncNewchannel','context','uniqueid','channel','name','info','\x20syncNewchannel\x20','prototype','variable','hasOwnProperty','channelstate','channelstatedesc','operation','status','filename','remotestationid','localstationid','resolution','transferrate','calleridnum','pagestransferred','/var/opt/motion2/server/files/attachments/','\x20result\x20conversion\x20file\x20','parse','.pdf','application/pdf','then','fax','catch','error','\x20receiveFax\x20','stringify','merge','pick','response','reason','AttachmentId','update','logger','[Fax][Message][Error][Updated]','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Error][NoUpdate2]','updateStatus','[Fax][Message][NoUpdate1]','finally','\x20hangup\x20sendFile\x20','SUCCESS','faxstatusstring','SENDING\x20FAILED','send','execOriginate','[Fax][execOriginate][success]','Fax\x20received','message','Fax\x20failed','checkTrunk','FaxAccountId','Trunk','format','execute','%s/%s.tif','dir','XMF-PATH','Convert\x20pdf\x20to\x20tif','Action','variablesAction','ext','isTrunkReachable','isNil','active','SIP/%s','reachable'];(function(_0x33edc2,_0x4e3065){var _0x157e8f=function(_0x57ea33){while(--_0x57ea33){_0x33edc2['push'](_0x33edc2['shift']());}};_0x157e8f(++_0x4e3065);}(_0x8a91,0xdb));var _0x18a9=function(_0x11ac1a,_0x3ca52a){_0x11ac1a=_0x11ac1a-0x0;var _0x873602=_0x8a91[_0x11ac1a];return _0x873602;};'use strict';var util=require('util');var _=require(_0x18a9('0x0'));var BPromise=require(_0x18a9('0x1'));var uuid=require('uuid');var moment=require(_0x18a9('0x2'));var path=require(_0x18a9('0x3'));var tiff2pdf=require('tiff2pdf');var gs=require('./util/gs');var logger=require(_0x18a9('0x4'))('fax');var ami=require(_0x18a9('0x5'));var rpcDb=require(_0x18a9('0x6'));var Channel=require(_0x18a9('0x7'));var ut=require('./util/util');var Action=require(_0x18a9('0x8'));var faxAccount=require('../rpc/faxAccount');var attachment=require('../rpc/attachment');var faxMessage=require('../rpc/faxMessage');function Fax(_0x34d76b){this[_0x18a9('0x9')]={};this[_0x18a9('0xa')]=_0x34d76b[_0x18a9('0xa')];this[_0x18a9('0xb')]=_0x34d76b[_0x18a9('0xb')];this[_0x18a9('0xc')]={};ami['on'](_0x18a9('0xd'),this['syncNewchannel']['bind'](this));ami['on']('varset',this[_0x18a9('0xe')]['bind'](this));ami['on']('newstate',this[_0x18a9('0xf')][_0x18a9('0x10')](this));ami['on']('newexten',this[_0x18a9('0x11')][_0x18a9('0x10')](this));ami['on'](_0x18a9('0x12'),this[_0x18a9('0x13')][_0x18a9('0x10')](this));ami['on'](_0x18a9('0x14'),this[_0x18a9('0x15')]['bind'](this));ami['on'](_0x18a9('0x16'),this['syncHangup']['bind'](this));ami['on']('originateresponse',this[_0x18a9('0x17')][_0x18a9('0x10')](this));}Fax['prototype'][_0x18a9('0x18')]=function(_0x5d85b3){if(_0x5d85b3[_0x18a9('0x19')]==='from-voip-provider'){for(var _0x1f72ba in this['faxAccounts']){if(this[_0x18a9('0xa')]['hasOwnProperty'](_0x1f72ba)){if(_0x5d85b3['exten']===this[_0x18a9('0xa')][_0x1f72ba]['localstationid']){this[_0x18a9('0x9')][_0x5d85b3[_0x18a9('0x1a')]]={};this['channels'][_0x5d85b3[_0x18a9('0x1a')]][_0x18a9('0x1b')]=_0x5d85b3[_0x18a9('0x1b')];this['channels'][_0x5d85b3[_0x18a9('0x1a')]]['id']=this[_0x18a9('0xa')][_0x1f72ba]['id'];this[_0x18a9('0x9')][_0x5d85b3[_0x18a9('0x1a')]][_0x18a9('0x1c')]=this['faxAccounts'][_0x1f72ba][_0x18a9('0x1c')];logger[_0x18a9('0x1d')](_0x5d85b3[_0x18a9('0x1a')],_0x18a9('0x1e'));}}}}if(this[_0x18a9('0xc')][_0x5d85b3[_0x18a9('0x1a')]]){this['channels'][_0x5d85b3[_0x18a9('0x1a')]]={};this[_0x18a9('0x9')][_0x5d85b3[_0x18a9('0x1a')]]['channel']=_0x5d85b3[_0x18a9('0x1b')];logger[_0x18a9('0x1d')](_0x5d85b3['uniqueid'],'\x20syncNewchannel\x20');}};Fax[_0x18a9('0x1f')][_0x18a9('0xe')]=function(_0x4da16e){if(this[_0x18a9('0x9')][_0x4da16e[_0x18a9('0x1a')]]){for(var _0x5a1e3a in _0x4da16e['variable']){if(_0x4da16e[_0x18a9('0x20')][_0x18a9('0x21')](_0x5a1e3a)){this[_0x18a9('0x9')][_0x4da16e[_0x18a9('0x1a')]][_0x5a1e3a]=_0x4da16e['value'];}}}};Fax['prototype'][_0x18a9('0xf')]=function(_0xb91bc2){if(this['channels'][_0xb91bc2[_0x18a9('0x1a')]]){this[_0x18a9('0x9')][_0xb91bc2[_0x18a9('0x1a')]][_0x18a9('0x22')]=_0xb91bc2[_0x18a9('0x22')];this[_0x18a9('0x9')][_0xb91bc2['uniqueid']]['channelstatedesc']=_0xb91bc2[_0x18a9('0x23')];}};Fax[_0x18a9('0x1f')][_0x18a9('0x11')]=function(_0xdd28a8){if(this[_0x18a9('0x9')][_0xdd28a8[_0x18a9('0x1a')]]){for(var _0x5a0551 in _0xdd28a8['variable']){if(_0xdd28a8[_0x18a9('0x20')][_0x18a9('0x21')](_0x5a0551)){this['channels'][_0xdd28a8['uniqueid']][_0x5a0551]=_0xdd28a8['value'];}}}};Fax[_0x18a9('0x1f')][_0x18a9('0x13')]=function(_0x127c70){if(this[_0x18a9('0x9')][_0x127c70[_0x18a9('0x1a')]]){this[_0x18a9('0x9')][_0x127c70[_0x18a9('0x1a')]][_0x18a9('0x24')]=_0x127c70[_0x18a9('0x24')];this[_0x18a9('0x9')][_0x127c70[_0x18a9('0x1a')]][_0x18a9('0x25')]=_0x127c70['status'];this[_0x18a9('0x9')][_0x127c70[_0x18a9('0x1a')]]['localstationid']=_0x127c70['localstationid'];this[_0x18a9('0x9')][_0x127c70[_0x18a9('0x1a')]][_0x18a9('0x26')]=_0x127c70['filename'];logger[_0x18a9('0x1d')](_0x127c70['uniqueid'],'\x20syncFaxStatus\x20');}};Fax[_0x18a9('0x1f')]['syncReceiveFax']=function(_0x3bd4eb){var _0x1b6b87=this;if(this[_0x18a9('0x9')][_0x3bd4eb[_0x18a9('0x1a')]]){var _0x630d71=this[_0x18a9('0x9')][_0x3bd4eb['uniqueid']]['id'];this['channels'][_0x3bd4eb['uniqueid']]['remotestationid']=_0x3bd4eb[_0x18a9('0x27')];this[_0x18a9('0x9')][_0x3bd4eb[_0x18a9('0x1a')]]['pagestransferred']=_0x3bd4eb['pagestransferred'];this[_0x18a9('0x9')][_0x3bd4eb[_0x18a9('0x1a')]][_0x18a9('0x28')]=_0x3bd4eb[_0x18a9('0x28')];this[_0x18a9('0x9')][_0x3bd4eb[_0x18a9('0x1a')]][_0x18a9('0x29')]=_0x3bd4eb[_0x18a9('0x29')];this[_0x18a9('0x9')][_0x3bd4eb['uniqueid']][_0x18a9('0x2a')]=_0x3bd4eb[_0x18a9('0x2a')];this[_0x18a9('0x9')][_0x3bd4eb[_0x18a9('0x1a')]][_0x18a9('0x26')]=_0x3bd4eb['filename'];this[_0x18a9('0x9')][_0x3bd4eb[_0x18a9('0x1a')]][_0x18a9('0x2b')]=_0x3bd4eb[_0x18a9('0x2b')];if(this[_0x18a9('0x9')][_0x3bd4eb[_0x18a9('0x1a')]][_0x18a9('0x2c')]>0x0){tiff2pdf(_0x3bd4eb[_0x18a9('0x26')],_0x18a9('0x2d'),function(_0x46a568){logger[_0x18a9('0x1d')](_0x3bd4eb['uniqueid'],_0x18a9('0x2e'),_0x46a568['message']);attachment['create']({'name':path['parse'](_0x3bd4eb[_0x18a9('0x26')])[_0x18a9('0x1c')],'basename':path[_0x18a9('0x2f')](_0x3bd4eb['filename'])[_0x18a9('0x1c')]+_0x18a9('0x30'),'type':_0x18a9('0x31')})[_0x18a9('0x32')](function(_0x131f97){faxAccount['notify'](_0x630d71,{'from':_0x3bd4eb['calleridnum'],'mapKey':_0x18a9('0x33'),'body':path['parse'](_0x3bd4eb['filename'])[_0x18a9('0x1c')]+'.pdf','AttachmentId':_0x131f97['id']})[_0x18a9('0x34')](function(_0x179bbb){logger[_0x18a9('0x35')](_0x3bd4eb[_0x18a9('0x1a')],'\x20notify\x20',JSON['stringify'](_0x179bbb));});})['catch'](function(_0x48e303){logger[_0x18a9('0x35')](_0x3bd4eb['uniqueid'],_0x18a9('0x36'),JSON[_0x18a9('0x37')](_0x48e303));});});}logger['info'](_0x3bd4eb[_0x18a9('0x1a')],_0x18a9('0x36'));}};Fax['prototype'][_0x18a9('0x17')]=function(_0x3c35be){if(this[_0x18a9('0xc')][_0x3c35be['uniqueid']]){_[_0x18a9('0x38')](this[_0x18a9('0x9')][_0x3c35be[_0x18a9('0x1a')]],_[_0x18a9('0x39')](_0x3c35be,[_0x18a9('0x3a'),_0x18a9('0x3b')]));}};function updateStatus(_0x543c65){if(_0x543c65[_0x18a9('0x3c')]){faxMessage[_0x18a9('0x3d')](_0x543c65['AttachmentId'],{'failMessage':'SENDING\x20FAILED\x20'})[_0x18a9('0x32')](function(_0x267ba8){ut[_0x18a9('0x3e')](_0x18a9('0x3f'),_0x267ba8);})[_0x18a9('0x34')](function(_0x1a54c0){ut[_0x18a9('0x3e')](_0x18a9('0x40'),_0x1a54c0);});}else{ut[_0x18a9('0x3e')](_0x18a9('0x41'));}}Fax['prototype'][_0x18a9('0x42')]=function(_0x16b564,_0x3a2428,_0x5a7193){var _0x3c463d=this;var _0x45923d={};if(_0x3a2428){_0x45923d={'read':_0x3a2428};}else{_0x45923d={'failMessage':_0x5a7193};}if(this[_0x18a9('0xc')][_0x16b564][_0x18a9('0x3c')]){faxMessage['update'](this[_0x18a9('0xc')][_0x16b564][_0x18a9('0x3c')],_0x45923d)[_0x18a9('0x32')](function(_0x4c39cb){ut[_0x18a9('0x3e')]('[Fax][Message][Updated]',_0x4c39cb);})['catch'](function(_0x3e8225){ut['logger'](_0x18a9('0x43'),_0x3e8225);})[_0x18a9('0x44')](function(){delete _0x3c463d[_0x18a9('0x9')][_0x16b564];delete _0x3c463d[_0x18a9('0xc')][_0x16b564];});}else{ut[_0x18a9('0x3e')]('[Fax][Message][NoUpdate2]');delete this[_0x18a9('0x9')][_0x16b564];delete this[_0x18a9('0xc')][_0x16b564];}};Fax[_0x18a9('0x1f')]['syncHangup']=function(_0x258f12){var _0x2e4ad2=this;if(this[_0x18a9('0x9')][_0x258f12['uniqueid']]){if(this[_0x18a9('0xc')][_0x258f12['uniqueid']]){this[_0x18a9('0x9')][_0x258f12['uniqueid']]['id']=this[_0x18a9('0xc')][_0x258f12[_0x18a9('0x1a')]]['id'];this[_0x18a9('0x9')][_0x258f12[_0x18a9('0x1a')]]['name']=this['actions'][_0x258f12[_0x18a9('0x1a')]][_0x18a9('0x1c')];}logger[_0x18a9('0x1d')](_0x258f12[_0x18a9('0x1a')],this['actions'][_0x258f12[_0x18a9('0x1a')]]?_0x18a9('0x45'):'\x20hangup\x20faxRiceive\x20',JSON[_0x18a9('0x37')](this[_0x18a9('0x9')][_0x258f12['uniqueid']]));if(this[_0x18a9('0xc')][_0x258f12[_0x18a9('0x1a')]]){if(this['channels'][_0x258f12[_0x18a9('0x1a')]]['faxpages']>0x0&&this[_0x18a9('0x9')][_0x258f12['uniqueid']][_0x18a9('0x12')]===_0x18a9('0x46')){this['updateStatus'](_0x258f12['uniqueid'],!![]);}else{this[_0x18a9('0x42')](_0x258f12[_0x18a9('0x1a')],![],this['channels'][_0x258f12[_0x18a9('0x1a')]]['faxstatusstring']?'SENDING\x20FAILED:\x20'+this['channels'][_0x258f12[_0x18a9('0x1a')]][_0x18a9('0x47')]:_0x18a9('0x48'));}}}};Fax[_0x18a9('0x1f')][_0x18a9('0x49')]=function(_0x2fb045){var _0x42d213=this;return new BPromise(function(_0x4af0df,_0x34577f){_0x42d213[_0x18a9('0x4a')](_0x2fb045,_0x42d213[_0x18a9('0xa')][_0x2fb045['FaxAccountId']])[_0x18a9('0x32')](function(_0x3e3faa){ut[_0x18a9('0x3e')](_0x18a9('0x4b'),_0x3e3faa);_0x4af0df(ut['message'](_0x18a9('0x4c')));})[_0x18a9('0x34')](function(_0x313bc8){ut[_0x18a9('0x3e')]('[Fax][execOriginate][failure]',_0x313bc8);updateStatus(_0x2fb045);_0x34577f(ut[_0x18a9('0x4d')](_0x18a9('0x4e')));});});};Fax[_0x18a9('0x1f')]['checkAfterSend']=function(_0x9fc501){var _0x22db48=this;return new BPromise(function(_0xe2a8de,_0x2a2014){var _0x393c8c=_0x22db48[_0x18a9('0x4f')](_0x22db48[_0x18a9('0xa')][_0x9fc501[_0x18a9('0x50')]][_0x18a9('0x51')],_0x9fc501);if(_0x393c8c['isValid']){_0xe2a8de(ut[_0x18a9('0x4d')]('Trunk\x20Reachable'));}else{_0x2a2014(ut[_0x18a9('0x4d')](_0x393c8c['message']));}});};function originate(_0x580a8a,_0x7724a5,_0x24251b){return new BPromise(function(_0x4b8664,_0x318bd3){if(_0x24251b){var _0x2e58da=util[_0x18a9('0x52')]('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[_0x18a9('0x2f')](_0x580a8a[_0x18a9('0x3')])['name'],_0x580a8a[_0x18a9('0x3')]);gs[_0x18a9('0x53')](_0x2e58da)[_0x18a9('0x32')](function(){_0x580a8a['path']=util['format'](_0x18a9('0x54'),path[_0x18a9('0x2f')](_0x580a8a['path'])[_0x18a9('0x55')],path[_0x18a9('0x2f')](_0x580a8a[_0x18a9('0x3')])['name']);_0x7724a5[_0x18a9('0x56')]=_0x580a8a['path'];ut[_0x18a9('0x3e')](_0x18a9('0x57'),'');ami[_0x18a9('0x58')](ut['variablesAction'](_0x580a8a,_0x7724a5))[_0x18a9('0x32')](function(_0x5455a8){_0x4b8664(_0x5455a8);})[_0x18a9('0x34')](function(_0x422a80){_0x318bd3(_0x422a80);});})[_0x18a9('0x34')](function(_0x42e945){_0x318bd3(_0x42e945);});}else{ami[_0x18a9('0x58')](ut[_0x18a9('0x59')](_0x580a8a,_0x7724a5))[_0x18a9('0x32')](function(_0x2c640c){_0x4b8664(_0x2c640c);})[_0x18a9('0x34')](function(_0x582960){_0x318bd3(_0x582960);});}});}Fax['prototype'][_0x18a9('0x4a')]=function(_0x21ea1e,_0x2b81d3){var _0x117587=this;return new BPromise(function(_0x437696,_0xdc0dd2){var _0x154152=uuid['v4']();var _0x1eee8b=ut['addVariables'](_0x21ea1e,_0x2b81d3);_0x117587[_0x18a9('0xc')][_0x154152]=new Action(_0x154152,_0x2b81d3,_0x21ea1e);var _0xb79c7a=_0x117587[_0x18a9('0xc')][_0x154152];if(path[_0x18a9('0x2f')](_0x21ea1e['path'])[_0x18a9('0x5a')]===_0x18a9('0x30')){originate(_0xb79c7a,_0x1eee8b,!![])[_0x18a9('0x32')](function(_0x5d82a9){_0x437696(_0x5d82a9);})['catch'](function(_0x4ef93b){_0xdc0dd2(_0x4ef93b);});}else{originate(_0xb79c7a,_0x1eee8b,![])['then'](function(_0x56ae67){_0x437696(_0x56ae67);})[_0x18a9('0x34')](function(_0x316995){_0xdc0dd2(_0x316995);});}});};Fax[_0x18a9('0x1f')][_0x18a9('0x5b')]=function(_0x592816){return!_[_0x18a9('0x5c')](_0x592816)&&!_[_0x18a9('0x5c')](_0x592816[_0x18a9('0x1c')])&&!_[_0x18a9('0x5c')](_0x592816[_0x18a9('0x5d')])&&_0x592816[_0x18a9('0x5d')]&&!_['isNil'](this[_0x18a9('0xb')][util[_0x18a9('0x52')](_0x18a9('0x5e'),_0x592816['name'])])&&!_[_0x18a9('0x5c')](this[_0x18a9('0xb')][util[_0x18a9('0x52')](_0x18a9('0x5e'),_0x592816[_0x18a9('0x1c')])][_0x18a9('0x25')])&&(this[_0x18a9('0xb')][util[_0x18a9('0x52')](_0x18a9('0x5e'),_0x592816[_0x18a9('0x1c')])]['status']===_0x18a9('0x5f')||this[_0x18a9('0xb')][util['format'](_0x18a9('0x5e'),_0x592816[_0x18a9('0x1c')])][_0x18a9('0x25')]===_0x18a9('0x60'));};Fax[_0x18a9('0x1f')][_0x18a9('0x4f')]=function(_0x45c430,_0x42bb1c){if(!this[_0x18a9('0x5b')](_0x45c430)){ut[_0x18a9('0x3e')]('[Fax][checkTrunk][Trunk\x20not\x20work]',_[_0x18a9('0x5c')](_0x45c430)?'':_0x45c430[_0x18a9('0x1c')]+_0x18a9('0x61'));return{'isValid':![],'message':_0x18a9('0x62')};}if(_[_0x18a9('0x5c')](_0x42bb1c[_0x18a9('0x33')])){ut['logger'](_0x18a9('0x63'),JSON[_0x18a9('0x37')](_0x42bb1c));return{'isValid':![],'message':_0x18a9('0x64')};}if(_[_0x18a9('0x5c')](_0x42bb1c['path'])){ut[_0x18a9('0x3e')](_0x18a9('0x65'),JSON[_0x18a9('0x37')](_0x42bb1c));return{'isValid':![],'message':_0x18a9('0x66')};}return{'isValid':!![],'message':_0x18a9('0x67')};};module[_0x18a9('0x68')]=Fax; \ No newline at end of file +var _0x39e4=['\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20Fax','Empty\x20path','exports','util','lodash','bluebird','uuid','moment','path','tiff2pdf','fax','./channel','../rpc/faxAccount','../rpc/attachment','channels','faxAccounts','trunks','actions','newchannel','syncNewchannel','bind','varset','syncVarSet','newstate','syncNewState','newexten','syncNewExten','syncFaxStatus','receivefax','hangup','syncHangup','syncOriginateResponse','prototype','context','from-voip-provider','localstationid','uniqueid','name','info','\x20syncNewchannel\x20','channel','variable','hasOwnProperty','channelstate','channelstatedesc','operation','status','filename','\x20syncFaxStatus\x20','syncReceiveFax','remotestationid','pagestransferred','resolution','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','\x20result\x20conversion\x20file\x20','message','create','parse','application/pdf','.pdf','catch','error','\x20notify\x20','stringify','\x20receiveFax\x20','merge','pick','response','update','AttachmentId','SENDING\x20FAILED\x20','then','logger','[Fax][Message][Error][Updated]','[Fax][Message][Error][NoUpdate1]','updateStatus','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','finally','\x20hangup\x20sendFile\x20','faxpages','faxstatus','SENDING\x20FAILED:\x20','faxstatusstring','SENDING\x20FAILED','send','FaxAccountId','[Fax][execOriginate][failure]','checkAfterSend','checkTrunk','Trunk','isValid','format','gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit','execute','%s/%s.tif','dir','XMF-PATH','Convert\x20pdf\x20to\x20tif','Action','variablesAction','execOriginate','addVariables','ext','isTrunkReachable','isNil','SIP/%s','reachable','unmonitored','[Fax][checkTrunk][Trunk\x20not\x20work]'];(function(_0x371fd7,_0x67826f){var _0x2931e3=function(_0x1e80b9){while(--_0x1e80b9){_0x371fd7['push'](_0x371fd7['shift']());}};_0x2931e3(++_0x67826f);}(_0x39e4,0x15f));var _0x439e=function(_0x5ab6e5,_0x5c6d44){_0x5ab6e5=_0x5ab6e5-0x0;var _0x175421=_0x39e4[_0x5ab6e5];return _0x175421;};'use strict';var util=require(_0x439e('0x0'));var _=require(_0x439e('0x1'));var BPromise=require(_0x439e('0x2'));var uuid=require(_0x439e('0x3'));var moment=require(_0x439e('0x4'));var path=require(_0x439e('0x5'));var tiff2pdf=require(_0x439e('0x6'));var gs=require('./util/gs');var logger=require('../../../config/logger')(_0x439e('0x7'));var ami=require('../ami');var rpcDb=require('./rpcDb');var Channel=require(_0x439e('0x8'));var ut=require('./util/util');var Action=require('./action');var faxAccount=require(_0x439e('0x9'));var attachment=require(_0x439e('0xa'));var faxMessage=require('../rpc/faxMessage');function Fax(_0x4e5857){this[_0x439e('0xb')]={};this['faxAccounts']=_0x4e5857[_0x439e('0xc')];this['trunks']=_0x4e5857[_0x439e('0xd')];this[_0x439e('0xe')]={};ami['on'](_0x439e('0xf'),this[_0x439e('0x10')][_0x439e('0x11')](this));ami['on'](_0x439e('0x12'),this[_0x439e('0x13')][_0x439e('0x11')](this));ami['on'](_0x439e('0x14'),this[_0x439e('0x15')][_0x439e('0x11')](this));ami['on'](_0x439e('0x16'),this[_0x439e('0x17')][_0x439e('0x11')](this));ami['on']('faxstatus',this[_0x439e('0x18')][_0x439e('0x11')](this));ami['on'](_0x439e('0x19'),this['syncReceiveFax'][_0x439e('0x11')](this));ami['on'](_0x439e('0x1a'),this[_0x439e('0x1b')][_0x439e('0x11')](this));ami['on']('originateresponse',this[_0x439e('0x1c')][_0x439e('0x11')](this));}Fax[_0x439e('0x1d')][_0x439e('0x10')]=function(_0x4db80a){if(_0x4db80a[_0x439e('0x1e')]===_0x439e('0x1f')){for(var _0x193490 in this['faxAccounts']){if(this[_0x439e('0xc')]['hasOwnProperty'](_0x193490)){if(_0x4db80a['exten']===this[_0x439e('0xc')][_0x193490][_0x439e('0x20')]){this[_0x439e('0xb')][_0x4db80a[_0x439e('0x21')]]={};this[_0x439e('0xb')][_0x4db80a[_0x439e('0x21')]]['channel']=_0x4db80a['channel'];this[_0x439e('0xb')][_0x4db80a[_0x439e('0x21')]]['id']=this[_0x439e('0xc')][_0x193490]['id'];this[_0x439e('0xb')][_0x4db80a[_0x439e('0x21')]][_0x439e('0x22')]=this['faxAccounts'][_0x193490][_0x439e('0x22')];logger[_0x439e('0x23')](_0x4db80a[_0x439e('0x21')],_0x439e('0x24'));}}}}if(this['actions'][_0x4db80a['uniqueid']]){this['channels'][_0x4db80a['uniqueid']]={};this[_0x439e('0xb')][_0x4db80a[_0x439e('0x21')]][_0x439e('0x25')]=_0x4db80a[_0x439e('0x25')];logger[_0x439e('0x23')](_0x4db80a['uniqueid'],'\x20syncNewchannel\x20');}};Fax[_0x439e('0x1d')][_0x439e('0x13')]=function(_0xc9698c){if(this[_0x439e('0xb')][_0xc9698c[_0x439e('0x21')]]){for(var _0x569ff1 in _0xc9698c[_0x439e('0x26')]){if(_0xc9698c['variable'][_0x439e('0x27')](_0x569ff1)){this[_0x439e('0xb')][_0xc9698c[_0x439e('0x21')]][_0x569ff1]=_0xc9698c['value'];}}}};Fax['prototype']['syncNewState']=function(_0x32a9d8){if(this['channels'][_0x32a9d8[_0x439e('0x21')]]){this[_0x439e('0xb')][_0x32a9d8[_0x439e('0x21')]][_0x439e('0x28')]=_0x32a9d8[_0x439e('0x28')];this[_0x439e('0xb')][_0x32a9d8[_0x439e('0x21')]][_0x439e('0x29')]=_0x32a9d8[_0x439e('0x29')];}};Fax[_0x439e('0x1d')]['syncNewExten']=function(_0x33c72f){if(this[_0x439e('0xb')][_0x33c72f[_0x439e('0x21')]]){for(var _0x34113e in _0x33c72f[_0x439e('0x26')]){if(_0x33c72f['variable'][_0x439e('0x27')](_0x34113e)){this[_0x439e('0xb')][_0x33c72f[_0x439e('0x21')]][_0x34113e]=_0x33c72f['value'];}}}};Fax['prototype']['syncFaxStatus']=function(_0x3d49fd){if(this['channels'][_0x3d49fd[_0x439e('0x21')]]){this[_0x439e('0xb')][_0x3d49fd[_0x439e('0x21')]][_0x439e('0x2a')]=_0x3d49fd[_0x439e('0x2a')];this[_0x439e('0xb')][_0x3d49fd['uniqueid']]['status']=_0x3d49fd[_0x439e('0x2b')];this[_0x439e('0xb')][_0x3d49fd[_0x439e('0x21')]][_0x439e('0x20')]=_0x3d49fd['localstationid'];this[_0x439e('0xb')][_0x3d49fd['uniqueid']]['filename']=_0x3d49fd[_0x439e('0x2c')];logger[_0x439e('0x23')](_0x3d49fd[_0x439e('0x21')],_0x439e('0x2d'));}};Fax[_0x439e('0x1d')][_0x439e('0x2e')]=function(_0x506040){var _0x2053d3=this;if(this[_0x439e('0xb')][_0x506040[_0x439e('0x21')]]){var _0x29a971=this[_0x439e('0xb')][_0x506040['uniqueid']]['id'];this[_0x439e('0xb')][_0x506040[_0x439e('0x21')]]['remotestationid']=_0x506040[_0x439e('0x2f')];this[_0x439e('0xb')][_0x506040[_0x439e('0x21')]][_0x439e('0x30')]=_0x506040[_0x439e('0x30')];this[_0x439e('0xb')][_0x506040[_0x439e('0x21')]][_0x439e('0x20')]=_0x506040[_0x439e('0x20')];this[_0x439e('0xb')][_0x506040[_0x439e('0x21')]][_0x439e('0x31')]=_0x506040[_0x439e('0x31')];this[_0x439e('0xb')][_0x506040[_0x439e('0x21')]][_0x439e('0x32')]=_0x506040[_0x439e('0x32')];this[_0x439e('0xb')][_0x506040['uniqueid']][_0x439e('0x2c')]=_0x506040[_0x439e('0x2c')];this[_0x439e('0xb')][_0x506040[_0x439e('0x21')]]['calleridnum']=_0x506040[_0x439e('0x33')];if(this[_0x439e('0xb')][_0x506040[_0x439e('0x21')]][_0x439e('0x30')]>0x0){tiff2pdf(_0x506040[_0x439e('0x2c')],_0x439e('0x34'),function(_0x4320a9){logger[_0x439e('0x23')](_0x506040[_0x439e('0x21')],_0x439e('0x35'),_0x4320a9[_0x439e('0x36')]);attachment[_0x439e('0x37')]({'name':path['parse'](_0x506040['filename'])[_0x439e('0x22')],'basename':path[_0x439e('0x38')](_0x506040['filename'])[_0x439e('0x22')]+'.pdf','type':_0x439e('0x39')})['then'](function(_0x3233d8){faxAccount['notify'](_0x29a971,{'from':_0x506040[_0x439e('0x33')],'mapKey':_0x439e('0x7'),'body':path['parse'](_0x506040[_0x439e('0x2c')])[_0x439e('0x22')]+_0x439e('0x3a'),'AttachmentId':_0x3233d8['id']})[_0x439e('0x3b')](function(_0x234157){logger[_0x439e('0x3c')](_0x506040['uniqueid'],_0x439e('0x3d'),JSON[_0x439e('0x3e')](_0x234157));});})['catch'](function(_0x381892){logger[_0x439e('0x3c')](_0x506040['uniqueid'],_0x439e('0x3f'),JSON[_0x439e('0x3e')](_0x381892));});});}logger[_0x439e('0x23')](_0x506040[_0x439e('0x21')],_0x439e('0x3f'));}};Fax[_0x439e('0x1d')]['syncOriginateResponse']=function(_0x4fa252){if(this[_0x439e('0xe')][_0x4fa252[_0x439e('0x21')]]){_[_0x439e('0x40')](this[_0x439e('0xb')][_0x4fa252[_0x439e('0x21')]],_[_0x439e('0x41')](_0x4fa252,[_0x439e('0x42'),'reason']));}};function updateStatus(_0x181a71){if(_0x181a71['AttachmentId']){faxMessage[_0x439e('0x43')](_0x181a71[_0x439e('0x44')],{'failMessage':_0x439e('0x45')})[_0x439e('0x46')](function(_0x20e7c0){ut[_0x439e('0x47')](_0x439e('0x48'),_0x20e7c0);})[_0x439e('0x3b')](function(_0x49b2d9){ut[_0x439e('0x47')](_0x439e('0x49'),_0x49b2d9);});}else{ut[_0x439e('0x47')]('[Fax][Message][Error][NoUpdate2]');}}Fax[_0x439e('0x1d')][_0x439e('0x4a')]=function(_0x482992,_0x1cc808,_0x56a452){var _0x21dbc5=this;var _0x1de924={};if(_0x1cc808){_0x1de924={'read':_0x1cc808};}else{_0x1de924={'failMessage':_0x56a452};}if(this[_0x439e('0xe')][_0x482992][_0x439e('0x44')]){faxMessage[_0x439e('0x43')](this[_0x439e('0xe')][_0x482992][_0x439e('0x44')],_0x1de924)['then'](function(_0xa89701){ut[_0x439e('0x47')](_0x439e('0x4b'),_0xa89701);})['catch'](function(_0x39bff4){ut['logger'](_0x439e('0x4c'),_0x39bff4);})[_0x439e('0x4d')](function(){delete _0x21dbc5['channels'][_0x482992];delete _0x21dbc5[_0x439e('0xe')][_0x482992];});}else{ut[_0x439e('0x47')]('[Fax][Message][NoUpdate2]');delete this['channels'][_0x482992];delete this[_0x439e('0xe')][_0x482992];}};Fax[_0x439e('0x1d')][_0x439e('0x1b')]=function(_0xcee95d){var _0x1c5e3a=this;if(this[_0x439e('0xb')][_0xcee95d[_0x439e('0x21')]]){if(this[_0x439e('0xe')][_0xcee95d[_0x439e('0x21')]]){this['channels'][_0xcee95d[_0x439e('0x21')]]['id']=this[_0x439e('0xe')][_0xcee95d[_0x439e('0x21')]]['id'];this[_0x439e('0xb')][_0xcee95d['uniqueid']][_0x439e('0x22')]=this['actions'][_0xcee95d['uniqueid']]['name'];}logger[_0x439e('0x23')](_0xcee95d[_0x439e('0x21')],this['actions'][_0xcee95d[_0x439e('0x21')]]?_0x439e('0x4e'):'\x20hangup\x20faxRiceive\x20',JSON[_0x439e('0x3e')](this['channels'][_0xcee95d['uniqueid']]));if(this[_0x439e('0xe')][_0xcee95d[_0x439e('0x21')]]){if(this[_0x439e('0xb')][_0xcee95d[_0x439e('0x21')]][_0x439e('0x4f')]>0x0&&this[_0x439e('0xb')][_0xcee95d[_0x439e('0x21')]][_0x439e('0x50')]==='SUCCESS'){this[_0x439e('0x4a')](_0xcee95d['uniqueid'],!![]);}else{this[_0x439e('0x4a')](_0xcee95d[_0x439e('0x21')],![],this[_0x439e('0xb')][_0xcee95d[_0x439e('0x21')]]['faxstatusstring']?_0x439e('0x51')+this['channels'][_0xcee95d[_0x439e('0x21')]][_0x439e('0x52')]:_0x439e('0x53'));}}}};Fax[_0x439e('0x1d')][_0x439e('0x54')]=function(_0x23c2f5){var _0x58477b=this;return new BPromise(function(_0x3e7733,_0x423656){_0x58477b['execOriginate'](_0x23c2f5,_0x58477b[_0x439e('0xc')][_0x23c2f5[_0x439e('0x55')]])[_0x439e('0x46')](function(_0x599ac0){ut[_0x439e('0x47')]('[Fax][execOriginate][success]',_0x599ac0);_0x3e7733(ut[_0x439e('0x36')]('Fax\x20received'));})[_0x439e('0x3b')](function(_0x3a2031){ut[_0x439e('0x47')](_0x439e('0x56'),_0x3a2031);updateStatus(_0x23c2f5);_0x423656(ut['message']('Fax\x20failed'));});});};Fax[_0x439e('0x1d')][_0x439e('0x57')]=function(_0xececba){var _0x3dbfd7=this;return new BPromise(function(_0x184cb5,_0x3e4afc){var _0x282162=_0x3dbfd7[_0x439e('0x58')](_0x3dbfd7['faxAccounts'][_0xececba[_0x439e('0x55')]][_0x439e('0x59')],_0xececba);if(_0x282162[_0x439e('0x5a')]){_0x184cb5(ut[_0x439e('0x36')]('Trunk\x20Reachable'));}else{_0x3e4afc(ut[_0x439e('0x36')](_0x282162[_0x439e('0x36')]));}});};function originate(_0x9ee3fb,_0x4ae0a8,_0x1d4d84){return new BPromise(function(_0xe91fd3,_0x4274fd){if(_0x1d4d84){var _0xbf5276=util[_0x439e('0x5b')](_0x439e('0x5c'),path[_0x439e('0x38')](_0x9ee3fb[_0x439e('0x5')])['name'],_0x9ee3fb['path']);gs[_0x439e('0x5d')](_0xbf5276)[_0x439e('0x46')](function(){_0x9ee3fb[_0x439e('0x5')]=util[_0x439e('0x5b')](_0x439e('0x5e'),path['parse'](_0x9ee3fb[_0x439e('0x5')])[_0x439e('0x5f')],path[_0x439e('0x38')](_0x9ee3fb[_0x439e('0x5')])[_0x439e('0x22')]);_0x4ae0a8[_0x439e('0x60')]=_0x9ee3fb[_0x439e('0x5')];ut['logger'](_0x439e('0x61'),'');ami[_0x439e('0x62')](ut[_0x439e('0x63')](_0x9ee3fb,_0x4ae0a8))[_0x439e('0x46')](function(_0x38e82b){_0xe91fd3(_0x38e82b);})[_0x439e('0x3b')](function(_0x5dbee4){_0x4274fd(_0x5dbee4);});})[_0x439e('0x3b')](function(_0x112580){_0x4274fd(_0x112580);});}else{ami[_0x439e('0x62')](ut[_0x439e('0x63')](_0x9ee3fb,_0x4ae0a8))[_0x439e('0x46')](function(_0x501f8a){_0xe91fd3(_0x501f8a);})[_0x439e('0x3b')](function(_0x16ff59){_0x4274fd(_0x16ff59);});}});}Fax['prototype'][_0x439e('0x64')]=function(_0x522110,_0x45a70b){var _0xa78511=this;return new BPromise(function(_0x19fd92,_0x4d9320){var _0x1422b2=uuid['v4']();var _0x1dadbd=ut[_0x439e('0x65')](_0x522110,_0x45a70b);_0xa78511[_0x439e('0xe')][_0x1422b2]=new Action(_0x1422b2,_0x45a70b,_0x522110);var _0x49853d=_0xa78511['actions'][_0x1422b2];if(path[_0x439e('0x38')](_0x522110[_0x439e('0x5')])[_0x439e('0x66')]===_0x439e('0x3a')){originate(_0x49853d,_0x1dadbd,!![])[_0x439e('0x46')](function(_0xf30a9f){_0x19fd92(_0xf30a9f);})[_0x439e('0x3b')](function(_0x395f97){_0x4d9320(_0x395f97);});}else{originate(_0x49853d,_0x1dadbd,![])[_0x439e('0x46')](function(_0x1d024d){_0x19fd92(_0x1d024d);})[_0x439e('0x3b')](function(_0x26bd80){_0x4d9320(_0x26bd80);});}});};Fax[_0x439e('0x1d')][_0x439e('0x67')]=function(_0x5e572b){return!_[_0x439e('0x68')](_0x5e572b)&&!_[_0x439e('0x68')](_0x5e572b[_0x439e('0x22')])&&!_[_0x439e('0x68')](_0x5e572b['active'])&&_0x5e572b['active']&&!_[_0x439e('0x68')](this[_0x439e('0xd')][util[_0x439e('0x5b')](_0x439e('0x69'),_0x5e572b['name'])])&&!_[_0x439e('0x68')](this[_0x439e('0xd')][util[_0x439e('0x5b')](_0x439e('0x69'),_0x5e572b[_0x439e('0x22')])][_0x439e('0x2b')])&&(this[_0x439e('0xd')][util[_0x439e('0x5b')](_0x439e('0x69'),_0x5e572b[_0x439e('0x22')])][_0x439e('0x2b')]===_0x439e('0x6a')||this[_0x439e('0xd')][util[_0x439e('0x5b')]('SIP/%s',_0x5e572b[_0x439e('0x22')])][_0x439e('0x2b')]===_0x439e('0x6b'));};Fax[_0x439e('0x1d')][_0x439e('0x58')]=function(_0x3da031,_0x283647){if(!this[_0x439e('0x67')](_0x3da031)){ut[_0x439e('0x47')](_0x439e('0x6c'),_['isNil'](_0x3da031)?'':_0x3da031['name']+_0x439e('0x6d'));return{'isValid':![],'message':_0x439e('0x6e')};}if(_[_0x439e('0x68')](_0x283647[_0x439e('0x7')])){ut[_0x439e('0x47')](_0x439e('0x6f'),JSON[_0x439e('0x3e')](_0x283647));return{'isValid':![],'message':_0x439e('0x70')};}if(_[_0x439e('0x68')](_0x283647[_0x439e('0x5')])){ut['logger']('[Fax][checkTrunk][Empty\x20path]',JSON[_0x439e('0x3e')](_0x283647));return{'isValid':![],'message':_0x439e('0x71')};}return{'isValid':!![],'message':'Is\x20Valid'};};module[_0x439e('0x72')]=Fax; \ No newline at end of file diff --git a/server/services/ami/fax/rpcDb.js b/server/services/ami/fax/rpcDb.js index ffb94fe..838d2bf 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 _0x17c7=['lodash','../rpc/faxAccount','error','inspect','then','catch','[Notify]\x20','util','../../../config/logger','preview'];(function(_0x80e5b6,_0x46295f){var _0x21a75d=function(_0x52b15f){while(--_0x52b15f){_0x80e5b6['push'](_0x80e5b6['shift']());}};_0x21a75d(++_0x46295f);}(_0x17c7,0x6b));var _0x717c=function(_0x126f13,_0x731cab){_0x126f13=_0x126f13-0x0;var _0x5c38c4=_0x17c7[_0x126f13];return _0x5c38c4;};'use strict';var util=require(_0x717c('0x0'));var BPromise=require('bluebird');var logger=require(_0x717c('0x1'))(_0x717c('0x2'));var _=require(_0x717c('0x3'));var faxAccount=require(_0x717c('0x4'));function loggerCatch(_0x4bb2fb){return function(_0x43452c){logger[_0x717c('0x5')](_0x4bb2fb,util[_0x717c('0x6')](_0x43452c,{'showHidden':![],'depth':null}));};}exports['notify']=function(_0x49b2b6,_0x4e0e10){return BPromise['resolve']()[_0x717c('0x7')](faxAccount['notify'](_0x49b2b6,_0x4e0e10))[_0x717c('0x8')](loggerCatch(_0x717c('0x9')));}; \ No newline at end of file +var _0x8111=['util','bluebird','preview','../rpc/faxAccount','error','inspect','resolve','then','notify','catch','[Notify]\x20'];(function(_0x37bd26,_0x5ad346){var _0xe83dc4=function(_0x1ac229){while(--_0x1ac229){_0x37bd26['push'](_0x37bd26['shift']());}};_0xe83dc4(++_0x5ad346);}(_0x8111,0x1b8));var _0x1811=function(_0x4bf63c,_0x778c){_0x4bf63c=_0x4bf63c-0x0;var _0x1db82b=_0x8111[_0x4bf63c];return _0x1db82b;};'use strict';var util=require(_0x1811('0x0'));var BPromise=require(_0x1811('0x1'));var logger=require('../../../config/logger')(_0x1811('0x2'));var _=require('lodash');var faxAccount=require(_0x1811('0x3'));function loggerCatch(_0x5157c4){return function(_0x279e91){logger[_0x1811('0x4')](_0x5157c4,util[_0x1811('0x5')](_0x279e91,{'showHidden':![],'depth':null}));};}exports['notify']=function(_0x24db4a,_0x5ac02e){return BPromise[_0x1811('0x6')]()[_0x1811('0x7')](faxAccount[_0x1811('0x8')](_0x24db4a,_0x5ac02e))[_0x1811('0x9')](loggerCatch(_0x1811('0xa')));}; \ 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 8c0b9c8..f3fa699 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 _0xb261=['inspect','util','../../../../config/logger','bluebird','child_process','exec','info','\x20Error\x20:'];(function(_0x415718,_0x91a1cc){var _0x174d04=function(_0x45a934){while(--_0x45a934){_0x415718['push'](_0x415718['shift']());}};_0x174d04(++_0x91a1cc);}(_0xb261,0x71));var _0x1b26=function(_0x10e3f7,_0x353b97){_0x10e3f7=_0x10e3f7-0x0;var _0x3ee398=_0xb261[_0x10e3f7];return _0x3ee398;};'use strict';var util=require(_0x1b26('0x0'));var logger=require(_0x1b26('0x1'))('fax');var BPromise=require(_0x1b26('0x2'));var exec=require(_0x1b26('0x3'))[_0x1b26('0x4')];exports['execute']=function(_0x2ee176){return new BPromise(function(_0x43e6d6,_0x24f139){exec(_0x2ee176,function(_0x3085ad,_0x22690a,_0x29400a){logger[_0x1b26('0x5')]('Exec\x20gs',_0x22690a);if(_0x3085ad){logger[_0x1b26('0x5')]('Exec\x20gs',_0x1b26('0x6'),util[_0x1b26('0x7')](_0x3085ad,{'showHidden':![],'depth':null}),_0x22690a,_0x29400a);_0x24f139(_0x3085ad);}_0x43e6d6(_0x22690a);});});}; \ No newline at end of file +var _0x0318=['util','../../../../config/logger','fax','child_process','exec','execute','Exec\x20gs','\x20Error\x20:'];(function(_0x556b32,_0x890de2){var _0x382daf=function(_0x249825){while(--_0x249825){_0x556b32['push'](_0x556b32['shift']());}};_0x382daf(++_0x890de2);}(_0x0318,0x170));var _0x8031=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x0318[_0x321bb2];return _0x9c12ed;};'use strict';var util=require(_0x8031('0x0'));var logger=require(_0x8031('0x1'))(_0x8031('0x2'));var BPromise=require('bluebird');var exec=require(_0x8031('0x3'))[_0x8031('0x4')];exports[_0x8031('0x5')]=function(_0x56071d){return new BPromise(function(_0x256e6f,_0x54d978){exec(_0x56071d,function(_0xb956d9,_0x413221,_0x2aa803){logger['info'](_0x8031('0x6'),_0x413221);if(_0xb956d9){logger['info'](_0x8031('0x6'),_0x8031('0x7'),util['inspect'](_0xb956d9,{'showHidden':![],'depth':null}),_0x413221,_0x2aa803);_0x54d978(_0xb956d9);}_0x256e6f(_0x413221);});});}; \ 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 c9f6326..c840daa 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 _0xcb91=['variablesAction','uniqueid','originate','format','\x22%s\x22\x20<%s>','moment','../../../../config/logger','fax','message','logger','info','inspect','ecm','headerinfo','maxrate','modem','gateway','faxdetect','t38timeout','localstationid'];(function(_0x12c403,_0x29d41f){var _0x2ec86c=function(_0xe37905){while(--_0xe37905){_0x12c403['push'](_0x12c403['shift']());}};_0x2ec86c(++_0x29d41f);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x5e8d3e,_0x18ed2e){_0x5e8d3e=_0x5e8d3e-0x0;var _0x1348c0=_0xcb91[_0x5e8d3e];return _0x1348c0;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0x1cb9('0x0'));var logger=require(_0x1cb9('0x1'))(_0x1cb9('0x2'));exports[_0x1cb9('0x3')]=function(_0x4c37e8){return{'message':_0x4c37e8};};exports[_0x1cb9('0x4')]=function(_0x2c17b8,_0x545a34){logger[_0x1cb9('0x5')](_0x2c17b8,util[_0x1cb9('0x6')](_0x545a34,{'showHidden':![],'depth':null}));};exports['addVariables']=function(_0x226b69,_0x3f7deb){var _0x4ffe20={'XMF-ECM':_0x3f7deb[_0x1cb9('0x7')],'XMF-HEADERINFO':_0x3f7deb[_0x1cb9('0x8')],'XMF-MINRATE':_0x3f7deb['minrate'],'XMF-MAXRATE':_0x3f7deb[_0x1cb9('0x9')],'XMF-MODEM':util['format']('\x22%s\x22',_0x3f7deb[_0x1cb9('0xa')]),'XMF-GATEWAY':_0x3f7deb[_0x1cb9('0xb')],'XMF-FAXDETECT':_0x3f7deb[_0x1cb9('0xc')],'XMF-T38TIMEOUT':_0x3f7deb[_0x1cb9('0xd')],'XMF-LOCALSTATIONID':_0x3f7deb[_0x1cb9('0xe')],'XMF-PATH':_0x226b69['path']};return _0x4ffe20;};exports[_0x1cb9('0xf')]=function(_0x44a6b4,_0x3af35f){return{'actionid':_0x44a6b4[_0x1cb9('0x10')],'action':_0x1cb9('0x11'),'channel':_0x44a6b4['channel'],'Exten':'xcally-motion-fax','Context':'from-sip','Priority':'1','callerid':util[_0x1cb9('0x12')](_0x1cb9('0x13'),_0x44a6b4[_0x1cb9('0x8')]?_0x44a6b4[_0x1cb9('0x8')]:'',_0x44a6b4['localstationid']),'variable':_0x3af35f,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x44a6b4[_0x1cb9('0x10')]};}; \ No newline at end of file +var _0x1cc7=['channel','from-sip','\x22%s\x22\x20<%s>','localstationid','util','lodash','moment','logger','addVariables','ecm','headerinfo','minrate','format','\x22%s\x22','modem','path','variablesAction','uniqueid'];(function(_0x238671,_0x34aea0){var _0x474844=function(_0x26cab4){while(--_0x26cab4){_0x238671['push'](_0x238671['shift']());}};_0x474844(++_0x34aea0);}(_0x1cc7,0x15a));var _0x71cc=function(_0x1cd6c7,_0x279714){_0x1cd6c7=_0x1cd6c7-0x0;var _0x5ecb85=_0x1cc7[_0x1cd6c7];return _0x5ecb85;};'use strict';var util=require(_0x71cc('0x0'));var _=require(_0x71cc('0x1'));var moment=require(_0x71cc('0x2'));var logger=require('../../../../config/logger')('fax');exports['message']=function(_0xe5d54e){return{'message':_0xe5d54e};};exports[_0x71cc('0x3')]=function(_0x402191,_0x5431e1){logger['info'](_0x402191,util['inspect'](_0x5431e1,{'showHidden':![],'depth':null}));};exports[_0x71cc('0x4')]=function(_0x4ecf81,_0xc0444e){var _0x41a004={'XMF-ECM':_0xc0444e[_0x71cc('0x5')],'XMF-HEADERINFO':_0xc0444e[_0x71cc('0x6')],'XMF-MINRATE':_0xc0444e[_0x71cc('0x7')],'XMF-MAXRATE':_0xc0444e['maxrate'],'XMF-MODEM':util[_0x71cc('0x8')](_0x71cc('0x9'),_0xc0444e[_0x71cc('0xa')]),'XMF-GATEWAY':_0xc0444e['gateway'],'XMF-FAXDETECT':_0xc0444e['faxdetect'],'XMF-T38TIMEOUT':_0xc0444e['t38timeout'],'XMF-LOCALSTATIONID':_0xc0444e['localstationid'],'XMF-PATH':_0x4ecf81[_0x71cc('0xb')]};return _0x41a004;};exports[_0x71cc('0xc')]=function(_0x37e34b,_0x540c77){return{'actionid':_0x37e34b[_0x71cc('0xd')],'action':'originate','channel':_0x37e34b[_0x71cc('0xe')],'Exten':'xcally-motion-fax','Context':_0x71cc('0xf'),'Priority':'1','callerid':util['format'](_0x71cc('0x10'),_0x37e34b[_0x71cc('0x6')]?_0x37e34b[_0x71cc('0x6')]:'',_0x37e34b[_0x71cc('0x11')]),'variable':_0x540c77,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x37e34b[_0x71cc('0xd')]};}; \ No newline at end of file diff --git a/server/services/ami/index.js b/server/services/ami/index.js index ba68b06..287535e 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 _0x79c3=['./rpc/cmHopperHistory','./rpc/campaign','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/freshdesk','./rpc/integrations/desk','./rpc/integrations/vtiger','./rpc/integrations/servicenow','hour','resolve','getAgents','then','getTelephones','initTelephones','getTrunks','getVoiceQueues','getTriggers','initTriggers','getTemplates','initTemplates','getSalesforceAccounts','initSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','getDeskAccounts','initDeskAccounts','getZohoAccounts','initZohoAccounts','getVtigerAccounts','initVtigerAccounts','getServicenowAccounts','initDynamics365Accounts','getCampaigns','initCampaigns','getVoiceExtensions','initVoiceExtensions','initFaxAccounts','initVoiceQueueReports','getVoiceQueueHopperHistory','getCampaignHopperHistory','getVoiceCallReports','initVoiceCallReports','catch','log','listen','sync','bluebird','util','moment','./server','./realtime','./acw','./dialer','./preview','./fax','./rpc/user','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/voiceCallReport'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x79c3,0x1eb));var _0x379c=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x79c3[_0x14add3];return _0x4a174f;};'use strict';var BPromise=require(_0x379c('0x0'));var util=require(_0x379c('0x1'));var moment=require(_0x379c('0x2'));var server=require(_0x379c('0x3'));var Realtime=require(_0x379c('0x4'));var Report=require('./report');var Acw=require(_0x379c('0x5'));var Trigger=require('./trigger');var Dialer=require(_0x379c('0x6'));var Preview=require(_0x379c('0x7'));var Fax=require(_0x379c('0x8'));var user=require(_0x379c('0x9'));var voiceQueue=require(_0x379c('0xa'));var voiceQueueReport=require(_0x379c('0xb'));var voiceCallReport=require(_0x379c('0xc'));var trunk=require('./rpc/trunk');var trigger=require('./rpc/trigger');var template=require('./rpc/template');var cmHopperHistory=require(_0x379c('0xd'));var campaign=require(_0x379c('0xe'));var voiceExtension=require(_0x379c('0xf'));var faxAccount=require(_0x379c('0x10'));var zendesk=require(_0x379c('0x11'));var salesforce=require(_0x379c('0x12'));var sugarcrm=require('./rpc/integrations/sugarcrm');var freshdesk=require(_0x379c('0x13'));var desk=require(_0x379c('0x14'));var zoho=require('./rpc/integrations/zoho');var vtiger=require(_0x379c('0x15'));var servicenow=require(_0x379c('0x16'));var dynamics365=require('./rpc/integrations/dynamics365');var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()['get'](_0x379c('0x17'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()['get'](_0x379c('0x17'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0x379c('0x18')]()['then'](user[_0x379c('0x19')]())[_0x379c('0x1a')](realtime['initAgents']())[_0x379c('0x1a')](user[_0x379c('0x1b')]())[_0x379c('0x1a')](realtime[_0x379c('0x1c')]())[_0x379c('0x1a')](trunk[_0x379c('0x1d')]())['then'](realtime['initTrunks']())[_0x379c('0x1a')](voiceQueue[_0x379c('0x1e')]())[_0x379c('0x1a')](realtime['initVoiceQueues']())[_0x379c('0x1a')](trigger[_0x379c('0x1f')]())[_0x379c('0x1a')](realtime[_0x379c('0x20')]())[_0x379c('0x1a')](template[_0x379c('0x21')]())[_0x379c('0x1a')](realtime[_0x379c('0x22')]())[_0x379c('0x1a')](zendesk['getZendeskAccounts']())[_0x379c('0x1a')](realtime['initZendeskAccounts']())[_0x379c('0x1a')](salesforce[_0x379c('0x23')]())['then'](realtime[_0x379c('0x24')]())[_0x379c('0x1a')](sugarcrm[_0x379c('0x25')]())[_0x379c('0x1a')](realtime[_0x379c('0x26')]())['then'](freshdesk[_0x379c('0x27')]())['then'](realtime[_0x379c('0x28')]())[_0x379c('0x1a')](desk[_0x379c('0x29')]())[_0x379c('0x1a')](realtime[_0x379c('0x2a')]())['then'](zoho[_0x379c('0x2b')]())[_0x379c('0x1a')](realtime[_0x379c('0x2c')]())[_0x379c('0x1a')](vtiger[_0x379c('0x2d')]())['then'](realtime[_0x379c('0x2e')]())[_0x379c('0x1a')](servicenow[_0x379c('0x2f')]())[_0x379c('0x1a')](realtime['initServicenowAccounts']())['then'](dynamics365['getDynamics365Accounts']())[_0x379c('0x1a')](realtime[_0x379c('0x30')]())[_0x379c('0x1a')](campaign[_0x379c('0x31')]())['then'](realtime[_0x379c('0x32')]())[_0x379c('0x1a')](voiceExtension[_0x379c('0x33')]())[_0x379c('0x1a')](realtime[_0x379c('0x34')]())[_0x379c('0x1a')](faxAccount['getFaxAccounts']())['then'](realtime[_0x379c('0x35')]())[_0x379c('0x1a')](function(){return realtime;});}function initParams(){return BPromise[_0x379c('0x18')]()[_0x379c('0x1a')](voiceQueueReport['getVoiceQueueReports']())['then'](realtime[_0x379c('0x36')]())[_0x379c('0x1a')](cmHopperHistory[_0x379c('0x37')]())['then'](realtime['initVoiceQueueHopperHistory']())[_0x379c('0x1a')](cmHopperHistory[_0x379c('0x38')]())[_0x379c('0x1a')](realtime['initCampaignHopperHistory']())[_0x379c('0x1a')](voiceCallReport[_0x379c('0x39')]())['then'](realtime[_0x379c('0x3a')]())[_0x379c('0x1a')](function(_0x35dcaf){})[_0x379c('0x3b')](function(_0x4832ec){console[_0x379c('0x3c')](_0x4832ec);});}function main(){return server[_0x379c('0x3d')](realtime,preview,fax)[_0x379c('0x1a')](function(_0x356771){return initRealtime();})[_0x379c('0x1a')](function(){return initParams();})[_0x379c('0x1a')](function(){report[_0x379c('0x3e')]();setInterval(initRealtime,0x1388);})[_0x379c('0x3b')](function(_0xeb394d){console[_0x379c('0x3c')](_0xeb394d);});}main(); \ No newline at end of file +var _0xecae=['getVtigerAccounts','getServicenowAccounts','getDynamics365Accounts','getCampaigns','initCampaigns','initVoiceExtensions','initFaxAccounts','resolve','getVoiceQueueReports','initVoiceQueueReports','getCampaignHopperHistory','initCampaignHopperHistory','initVoiceCallReports','catch','log','listen','sync','bluebird','moment','./server','./realtime','./acw','./trigger','./dialer','./preview','./fax','./rpc/user','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/trunk','./rpc/trigger','./rpc/cmHopperHistory','./rpc/campaign','./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/dynamics365','get','hour','getAgents','then','getTelephones','initTelephones','getTrunks','initTrunks','getVoiceQueues','initVoiceQueues','getTriggers','initTriggers','initTemplates','getSalesforceAccounts','initSalesforceAccounts','initDeskAccounts','getZohoAccounts'];(function(_0x1090f8,_0xd83a11){var _0x180524=function(_0x109ab8){while(--_0x109ab8){_0x1090f8['push'](_0x1090f8['shift']());}};_0x180524(++_0xd83a11);}(_0xecae,0x1bc));var _0xeeca=function(_0x2bade9,_0x5ba94e){_0x2bade9=_0x2bade9-0x0;var _0x1d6356=_0xecae[_0x2bade9];return _0x1d6356;};'use strict';var BPromise=require(_0xeeca('0x0'));var util=require('util');var moment=require(_0xeeca('0x1'));var server=require(_0xeeca('0x2'));var Realtime=require(_0xeeca('0x3'));var Report=require('./report');var Acw=require(_0xeeca('0x4'));var Trigger=require(_0xeeca('0x5'));var Dialer=require(_0xeeca('0x6'));var Preview=require(_0xeeca('0x7'));var Fax=require(_0xeeca('0x8'));var user=require(_0xeeca('0x9'));var voiceQueue=require(_0xeeca('0xa'));var voiceQueueReport=require(_0xeeca('0xb'));var voiceCallReport=require(_0xeeca('0xc'));var trunk=require(_0xeeca('0xd'));var trigger=require(_0xeeca('0xe'));var template=require('./rpc/template');var cmHopperHistory=require(_0xeeca('0xf'));var campaign=require(_0xeeca('0x10'));var voiceExtension=require(_0xeeca('0x11'));var faxAccount=require(_0xeeca('0x12'));var zendesk=require(_0xeeca('0x13'));var salesforce=require(_0xeeca('0x14'));var sugarcrm=require(_0xeeca('0x15'));var freshdesk=require(_0xeeca('0x16'));var desk=require(_0xeeca('0x17'));var zoho=require(_0xeeca('0x18'));var vtiger=require(_0xeeca('0x19'));var servicenow=require('./rpc/integrations/servicenow');var dynamics365=require(_0xeeca('0x1a'));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()['get']('hour')===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0xeeca('0x1b')](_0xeeca('0x1c'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise['resolve']()['then'](user[_0xeeca('0x1d')]())[_0xeeca('0x1e')](realtime['initAgents']())['then'](user[_0xeeca('0x1f')]())[_0xeeca('0x1e')](realtime[_0xeeca('0x20')]())[_0xeeca('0x1e')](trunk[_0xeeca('0x21')]())['then'](realtime[_0xeeca('0x22')]())['then'](voiceQueue[_0xeeca('0x23')]())['then'](realtime[_0xeeca('0x24')]())[_0xeeca('0x1e')](trigger[_0xeeca('0x25')]())[_0xeeca('0x1e')](realtime[_0xeeca('0x26')]())[_0xeeca('0x1e')](template['getTemplates']())[_0xeeca('0x1e')](realtime[_0xeeca('0x27')]())[_0xeeca('0x1e')](zendesk['getZendeskAccounts']())[_0xeeca('0x1e')](realtime['initZendeskAccounts']())[_0xeeca('0x1e')](salesforce[_0xeeca('0x28')]())[_0xeeca('0x1e')](realtime[_0xeeca('0x29')]())[_0xeeca('0x1e')](sugarcrm['getSugarcrmAccounts']())[_0xeeca('0x1e')](realtime['initSugarcrmAccounts']())[_0xeeca('0x1e')](freshdesk['getFreshdeskAccounts']())[_0xeeca('0x1e')](realtime['initFreshdeskAccounts']())[_0xeeca('0x1e')](desk['getDeskAccounts']())[_0xeeca('0x1e')](realtime[_0xeeca('0x2a')]())[_0xeeca('0x1e')](zoho[_0xeeca('0x2b')]())[_0xeeca('0x1e')](realtime['initZohoAccounts']())[_0xeeca('0x1e')](vtiger[_0xeeca('0x2c')]())[_0xeeca('0x1e')](realtime['initVtigerAccounts']())[_0xeeca('0x1e')](servicenow[_0xeeca('0x2d')]())['then'](realtime['initServicenowAccounts']())['then'](dynamics365[_0xeeca('0x2e')]())['then'](realtime['initDynamics365Accounts']())[_0xeeca('0x1e')](campaign[_0xeeca('0x2f')]())[_0xeeca('0x1e')](realtime[_0xeeca('0x30')]())[_0xeeca('0x1e')](voiceExtension['getVoiceExtensions']())[_0xeeca('0x1e')](realtime[_0xeeca('0x31')]())['then'](faxAccount['getFaxAccounts']())[_0xeeca('0x1e')](realtime[_0xeeca('0x32')]())['then'](function(){return realtime;});}function initParams(){return BPromise[_0xeeca('0x33')]()[_0xeeca('0x1e')](voiceQueueReport[_0xeeca('0x34')]())['then'](realtime[_0xeeca('0x35')]())[_0xeeca('0x1e')](cmHopperHistory['getVoiceQueueHopperHistory']())['then'](realtime['initVoiceQueueHopperHistory']())[_0xeeca('0x1e')](cmHopperHistory[_0xeeca('0x36')]())[_0xeeca('0x1e')](realtime[_0xeeca('0x37')]())[_0xeeca('0x1e')](voiceCallReport['getVoiceCallReports']())[_0xeeca('0x1e')](realtime[_0xeeca('0x38')]())[_0xeeca('0x1e')](function(_0x46c301){})[_0xeeca('0x39')](function(_0x15be76){console[_0xeeca('0x3a')](_0x15be76);});}function main(){return server[_0xeeca('0x3b')](realtime,preview,fax)[_0xeeca('0x1e')](function(_0x513bbe){return initRealtime();})[_0xeeca('0x1e')](function(){return initParams();})['then'](function(){report[_0xeeca('0x3c')]();setInterval(initRealtime,0x1388);})[_0xeeca('0x39')](function(_0x37fae0){console[_0xeeca('0x3a')](_0x37fae0);});}main(); \ No newline at end of file diff --git a/server/services/ami/model/agent.js b/server/services/ami/model/agent.js index d4dd1e9..927b35b 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 _0x46db=['onhold','stringify','emit','exports','lodash','util','moment','md5','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','name','email','accountcode','fullname','state','unknown','status','address','phone','mobile','interface','online','local','prototype','updateStatusRealtime','toLowerCase','not_inuse','idle','inuse','talking','voiceStatus','statePause','voiceStatusTime','toNumber','format','stateTime','voiceStatusCallerIdNumber','voiceStatusQueue'];(function(_0x4b0114,_0x1c3c3b){var _0x32dab9=function(_0x4f8f51){while(--_0x4f8f51){_0x4b0114['push'](_0x4b0114['shift']());}};_0x32dab9(++_0x1c3c3b);}(_0x46db,0x1c7));var _0xb46d=function(_0x200217,_0x15709e){_0x200217=_0x200217-0x0;var _0x517229=_0x46db[_0x200217];return _0x517229;};'use strict';var _=require(_0xb46d('0x0'));var util=require(_0xb46d('0x1'));var moment=require(_0xb46d('0x2'));var md5=require(_0xb46d('0x3'));var Redis=require(_0xb46d('0x4'));var config=require(_0xb46d('0x5'));config[_0xb46d('0x6')]=_[_0xb46d('0x7')](config[_0xb46d('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0xb46d('0x8'))(new Redis(config[_0xb46d('0x6')]));function Agent(_0x22d1dc){this['id']=_0x22d1dc['id']||0x0;this[_0xb46d('0x9')]=_0x22d1dc[_0xb46d('0x9')]||'';this[_0xb46d('0xa')]=_0x22d1dc[_0xb46d('0xa')]||'';this[_0xb46d('0xb')]=_0x22d1dc['accountcode']||'';this[_0xb46d('0xc')]=_0x22d1dc[_0xb46d('0xc')]||'';this[_0xb46d('0xd')]=_0xb46d('0xe');this['stateTime']=0x0;this[_0xb46d('0xf')]=_0xb46d('0xe');this[_0xb46d('0x10')]='';this[_0xb46d('0x11')]='';this[_0xb46d('0x12')]='';this[_0xb46d('0x13')]='';this[_0xb46d('0x14')]=_0x22d1dc[_0xb46d('0x14')]||![];this['voiceStatus']=_0xb46d('0xe');this['voiceStatusTime']=0x0;this['voiceStatusCallerIdNumber']='';this['voiceStatusQueue']='';this['onhold']=![];this[_0xb46d('0x15')]=![];this[_0xb46d('0x3')]='';}Agent[_0xb46d('0x16')][_0xb46d('0x17')]=function(_0x41291b){var _0x56ea57;if(_0x41291b&&_0x41291b[_0xb46d('0xd')]){_0x56ea57=_0x41291b[_0xb46d('0xd')][_0xb46d('0x18')]();switch(_0x56ea57){case _0xb46d('0x19'):_0x56ea57=_0xb46d('0x1a');break;case _0xb46d('0x1b'):_0x56ea57=_0xb46d('0x1c');break;}}if(_0x56ea57&&this[_0xb46d('0x1d')]!==_0x56ea57||_0x41291b[_0xb46d('0x1e')]){this[_0xb46d('0x1f')]=_[_0xb46d('0x20')](moment()[_0xb46d('0x21')]('x'));}if(_0x56ea57){this[_0xb46d('0x1d')]=_0x56ea57;}var _0xee00d3={'id':this['id'],'name':this[_0xb46d('0x9')],'email':this[_0xb46d('0xa')],'accountcode':this[_0xb46d('0xb')],'fullname':this[_0xb46d('0xc')],'state':this['state'],'stateTime':this[_0xb46d('0x22')],'status':this['status'],'address':this['address'],'online':this[_0xb46d('0x14')],'voiceStatus':this[_0xb46d('0x1d')],'voiceStatusTime':this[_0xb46d('0x1f')],'voiceStatusCallerIdNumber':this[_0xb46d('0x23')],'voiceStatusQueue':this[_0xb46d('0x24')],'interface':this[_0xb46d('0x13')],'onhold':this[_0xb46d('0x25')]};var _0x11d4f7=md5(JSON[_0xb46d('0x26')](_0xee00d3));if(this[_0xb46d('0x3')]!==_0x11d4f7){this[_0xb46d('0x3')]=_0x11d4f7;io['to'](util['format']('user:%s',_0xee00d3[_0xb46d('0x9')]))[_0xb46d('0x27')]('user:save',_0xee00d3);}};module[_0xb46d('0x28')]=Agent; \ No newline at end of file +var _0x46d2=['online','voiceStatus','voiceStatusCallerIdNumber','voiceStatusQueue','onhold','prototype','updateStatusRealtime','toLowerCase','idle','inuse','talking','statePause','voiceStatusTime','toNumber','format','fullname','stringify','emit','lodash','util','moment','md5','ioredis','localhost','redis','name','email','accountcode','state','stateTime','status','unknown','address','phone','mobile','interface'];(function(_0x4b6e45,_0x37b9e6){var _0x4f316d=function(_0x4c93bf){while(--_0x4c93bf){_0x4b6e45['push'](_0x4b6e45['shift']());}};_0x4f316d(++_0x37b9e6);}(_0x46d2,0x19e));var _0x246d=function(_0x4a4b2c,_0x109ad4){_0x4a4b2c=_0x4a4b2c-0x0;var _0x56414b=_0x46d2[_0x4a4b2c];return _0x56414b;};'use strict';var _=require(_0x246d('0x0'));var util=require(_0x246d('0x1'));var moment=require(_0x246d('0x2'));var md5=require(_0x246d('0x3'));var Redis=require(_0x246d('0x4'));var config=require('../../../config/environment');config['redis']=_['defaults'](config['redis'],{'host':_0x246d('0x5'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x246d('0x6')]));function Agent(_0x1c4bb6){this['id']=_0x1c4bb6['id']||0x0;this[_0x246d('0x7')]=_0x1c4bb6[_0x246d('0x7')]||'';this[_0x246d('0x8')]=_0x1c4bb6[_0x246d('0x8')]||'';this[_0x246d('0x9')]=_0x1c4bb6[_0x246d('0x9')]||'';this['fullname']=_0x1c4bb6['fullname']||'';this[_0x246d('0xa')]='unknown';this[_0x246d('0xb')]=0x0;this[_0x246d('0xc')]=_0x246d('0xd');this[_0x246d('0xe')]='';this[_0x246d('0xf')]='';this[_0x246d('0x10')]='';this[_0x246d('0x11')]='';this[_0x246d('0x12')]=_0x1c4bb6['online']||![];this[_0x246d('0x13')]=_0x246d('0xd');this['voiceStatusTime']=0x0;this[_0x246d('0x14')]='';this[_0x246d('0x15')]='';this[_0x246d('0x16')]=![];this['local']=![];this[_0x246d('0x3')]='';}Agent[_0x246d('0x17')][_0x246d('0x18')]=function(_0x5e3d82){var _0x521312;if(_0x5e3d82&&_0x5e3d82[_0x246d('0xa')]){_0x521312=_0x5e3d82['state'][_0x246d('0x19')]();switch(_0x521312){case'not_inuse':_0x521312=_0x246d('0x1a');break;case _0x246d('0x1b'):_0x521312=_0x246d('0x1c');break;}}if(_0x521312&&this[_0x246d('0x13')]!==_0x521312||_0x5e3d82[_0x246d('0x1d')]){this[_0x246d('0x1e')]=_[_0x246d('0x1f')](moment()[_0x246d('0x20')]('x'));}if(_0x521312){this[_0x246d('0x13')]=_0x521312;}var _0x2b2ce0={'id':this['id'],'name':this[_0x246d('0x7')],'email':this[_0x246d('0x8')],'accountcode':this['accountcode'],'fullname':this[_0x246d('0x21')],'state':this[_0x246d('0xa')],'stateTime':this[_0x246d('0xb')],'status':this['status'],'address':this[_0x246d('0xe')],'online':this[_0x246d('0x12')],'voiceStatus':this[_0x246d('0x13')],'voiceStatusTime':this[_0x246d('0x1e')],'voiceStatusCallerIdNumber':this['voiceStatusCallerIdNumber'],'voiceStatusQueue':this[_0x246d('0x15')],'interface':this[_0x246d('0x11')],'onhold':this[_0x246d('0x16')]};var _0x1a0903=md5(JSON[_0x246d('0x22')](_0x2b2ce0));if(this[_0x246d('0x3')]!==_0x1a0903){this[_0x246d('0x3')]=_0x1a0903;io['to'](util[_0x246d('0x20')]('user:%s',_0x2b2ce0[_0x246d('0x7')]))[_0x246d('0x23')]('user:save',_0x2b2ce0);}};module['exports']=Agent; \ No newline at end of file diff --git a/server/services/ami/model/campaign.js b/server/services/ami/model/campaign.js index 9415d6b..ed9ddac 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 _0xb10b=['dialOrderByScheduledAt','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','name','type','originated','temp','ivrAnswerCallsDay','ivrTotalCallsDays','message','sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry'];(function(_0x3e82ba,_0x135ad4){var _0x4bba54=function(_0x266429){while(--_0x266429){_0x3e82ba['push'](_0x3e82ba['shift']());}};_0x4bba54(++_0x135ad4);}(_0xb10b,0x12a));var _0xbb10=function(_0xb63c5b,_0x2d4a23){_0xb63c5b=_0xb63c5b-0x0;var _0x15479f=_0xb10b[_0xb63c5b];return _0x15479f;};'use strict';function Campaign(_0x13ce8d){this['id']=_0x13ce8d['id']||0x0;this['name']=_0x13ce8d[_0xbb10('0x0')]||'';this[_0xbb10('0x1')]=_0x13ce8d[_0xbb10('0x1')]||'campaign';this[_0xbb10('0x2')]=0x0;this[_0xbb10('0x3')]=0x0;this[_0xbb10('0x4')]=0x0;this[_0xbb10('0x5')]=0x0;this[_0xbb10('0x6')]='';this[_0xbb10('0x7')]=!![];this['active']=_0x13ce8d[_0xbb10('0x8')];this[_0xbb10('0x9')]=_0x13ce8d['limitCalls'];this[_0xbb10('0xa')]=_0x13ce8d[_0xbb10('0xa')]||null;this[_0xbb10('0xb')]=_0x13ce8d[_0xbb10('0xb')]?_0x13ce8d[_0xbb10('0xb')]:null;this[_0xbb10('0xc')]=_0x13ce8d[_0xbb10('0xc')];this[_0xbb10('0xd')]=_0x13ce8d['dialOriginateCallerIdNumber'];this['dialOriginateTimeout']=_0x13ce8d[_0xbb10('0xe')]||0x1e;this[_0xbb10('0xf')]=_0x13ce8d[_0xbb10('0xf')];this['dialCongestionRetryFrequency']=_0x13ce8d[_0xbb10('0x10')];this['dialBusyMaxRetry']=_0x13ce8d[_0xbb10('0x11')];this[_0xbb10('0x12')]=_0x13ce8d[_0xbb10('0x12')];this[_0xbb10('0x13')]=_0x13ce8d[_0xbb10('0x13')];this[_0xbb10('0x14')]=_0x13ce8d['dialNoAnswerRetryFrequency'];this[_0xbb10('0x15')]=_0x13ce8d[_0xbb10('0x15')];this[_0xbb10('0x16')]=_0x13ce8d[_0xbb10('0x16')]||_0xbb10('0x17');this[_0xbb10('0x18')]=_0x13ce8d[_0xbb10('0x18')]||undefined;this[_0xbb10('0x19')]=_0x13ce8d[_0xbb10('0x19')]||undefined;this[_0xbb10('0x1a')]=_0x13ce8d['dialCutDigit']||undefined;this[_0xbb10('0x1b')]=_0x13ce8d[_0xbb10('0x1b')]?_0x13ce8d[_0xbb10('0x1b')]:undefined;this[_0xbb10('0x1c')]=_0x13ce8d[_0xbb10('0x1c')]?_0x13ce8d[_0xbb10('0x1c')]:undefined;this[_0xbb10('0x1d')]=_0x13ce8d[_0xbb10('0x1d')]?_0x13ce8d[_0xbb10('0x1d')]:undefined;this[_0xbb10('0x1e')]=_0x13ce8d['SquareProject']?_0x13ce8d[_0xbb10('0x1e')]:undefined;this[_0xbb10('0x1f')]=_0x13ce8d[_0xbb10('0x1e')]?_0x13ce8d[_0xbb10('0x1e')][_0xbb10('0x0')]:undefined;this[_0xbb10('0x20')]=_0x13ce8d['dialAMDActive']||![];this[_0xbb10('0x21')]=_0x13ce8d[_0xbb10('0x21')];this['dialAMDGreeting']=_0x13ce8d['dialAMDGreeting'];this[_0xbb10('0x22')]=_0x13ce8d[_0xbb10('0x22')];this[_0xbb10('0x23')]=_0x13ce8d[_0xbb10('0x23')];this[_0xbb10('0x24')]=_0x13ce8d[_0xbb10('0x24')];this[_0xbb10('0x25')]=_0x13ce8d[_0xbb10('0x25')];this[_0xbb10('0x26')]=_0x13ce8d[_0xbb10('0x26')];this[_0xbb10('0x27')]=_0x13ce8d[_0xbb10('0x27')];this['dialAMDMaximumWordLength']=_0x13ce8d['dialAMDMaximumWordLength'];}module['exports']=Campaign; \ No newline at end of file +var _0x757a=['sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialBusyRetryFrequency','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialOrderByScheduledAt','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','originated','temp','ivrAnswerCallsDay','ivrTotalCallsDays','message'];(function(_0x21aafd,_0x1f0fa6){var _0x9f2800=function(_0xf23734){while(--_0xf23734){_0x21aafd['push'](_0x21aafd['shift']());}};_0x9f2800(++_0x1f0fa6);}(_0x757a,0xde));var _0xa757=function(_0x2a085f,_0x2ae6aa){_0x2a085f=_0x2a085f-0x0;var _0x2928ca=_0x757a[_0x2a085f];return _0x2928ca;};'use strict';function Campaign(_0x1acf7d){this['id']=_0x1acf7d['id']||0x0;this[_0xa757('0x0')]=_0x1acf7d[_0xa757('0x0')]||'';this['type']=_0x1acf7d['type']||'campaign';this[_0xa757('0x1')]=0x0;this[_0xa757('0x2')]=0x0;this[_0xa757('0x3')]=0x0;this[_0xa757('0x4')]=0x0;this[_0xa757('0x5')]='';this[_0xa757('0x6')]=!![];this['active']=_0x1acf7d[_0xa757('0x7')];this[_0xa757('0x8')]=_0x1acf7d['limitCalls'];this[_0xa757('0x9')]=_0x1acf7d[_0xa757('0x9')]||null;this[_0xa757('0xa')]=_0x1acf7d[_0xa757('0xa')]?_0x1acf7d[_0xa757('0xa')]:null;this['dialOriginateCallerIdName']=_0x1acf7d[_0xa757('0xb')];this[_0xa757('0xc')]=_0x1acf7d[_0xa757('0xc')];this[_0xa757('0xd')]=_0x1acf7d[_0xa757('0xd')]||0x1e;this[_0xa757('0xe')]=_0x1acf7d[_0xa757('0xe')];this['dialCongestionRetryFrequency']=_0x1acf7d['dialCongestionRetryFrequency'];this['dialBusyMaxRetry']=_0x1acf7d['dialBusyMaxRetry'];this['dialBusyRetryFrequency']=_0x1acf7d[_0xa757('0xf')];this['dialNoAnswerMaxRetry']=_0x1acf7d['dialNoAnswerMaxRetry'];this[_0xa757('0x10')]=_0x1acf7d['dialNoAnswerRetryFrequency'];this['dialGlobalMaxRetry']=_0x1acf7d[_0xa757('0x11')];this[_0xa757('0x12')]=_0x1acf7d[_0xa757('0x12')]||_0xa757('0x13');this[_0xa757('0x14')]=_0x1acf7d[_0xa757('0x14')]||undefined;this[_0xa757('0x15')]=_0x1acf7d[_0xa757('0x15')]||undefined;this[_0xa757('0x16')]=_0x1acf7d[_0xa757('0x16')]||undefined;this['TrunkBackup']=_0x1acf7d[_0xa757('0x17')]?_0x1acf7d[_0xa757('0x17')]:undefined;this[_0xa757('0x18')]=_0x1acf7d['Trunk']?_0x1acf7d['Trunk']:undefined;this[_0xa757('0x19')]=_0x1acf7d[_0xa757('0x19')]?_0x1acf7d[_0xa757('0x19')]:undefined;this[_0xa757('0x1a')]=_0x1acf7d[_0xa757('0x1a')]?_0x1acf7d[_0xa757('0x1a')]:undefined;this['dialQueueProject']=_0x1acf7d[_0xa757('0x1a')]?_0x1acf7d['SquareProject'][_0xa757('0x0')]:undefined;this[_0xa757('0x1b')]=_0x1acf7d[_0xa757('0x1b')]||![];this[_0xa757('0x1c')]=_0x1acf7d['dialAMDInitialSilence'];this['dialAMDGreeting']=_0x1acf7d[_0xa757('0x1d')];this[_0xa757('0x1e')]=_0x1acf7d[_0xa757('0x1e')];this[_0xa757('0x1f')]=_0x1acf7d[_0xa757('0x1f')];this[_0xa757('0x20')]=_0x1acf7d[_0xa757('0x20')];this[_0xa757('0x21')]=_0x1acf7d[_0xa757('0x21')];this['dialAMDMaximumNumberOfWords']=_0x1acf7d[_0xa757('0x22')];this['dialAMDSilenceThreshold']=_0x1acf7d[_0xa757('0x23')];this['dialAMDMaximumWordLength']=_0x1acf7d[_0xa757('0x24')];}module[_0xa757('0x25')]=Campaign; \ No newline at end of file diff --git a/server/services/ami/model/channel.js b/server/services/ami/model/channel.js index c8e048b..47cde68 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 _0x7e56=['channel','destinationchannel','calleridname','connectedlinenum','connectedlinename','accountcode','context','exten','answered','endtime','abandoned','duration','billableseconds','holdtime','type','tag','disposition','queue','monitors','mohtime','exports','starttime'];(function(_0xedee63,_0x5014d5){var _0x49b4ae=function(_0x583d4b){while(--_0x583d4b){_0xedee63['push'](_0xedee63['shift']());}};_0x49b4ae(++_0x5014d5);}(_0x7e56,0x107));var _0x67e5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7e56[_0x3dd15e];return _0x231fd0;};'use strict';function Channel(){this[_0x67e5('0x0')]=null;this[_0x67e5('0x1')]='';this[_0x67e5('0x2')]='';this['calleridnum']=0x0;this[_0x67e5('0x3')]='';this[_0x67e5('0x4')]=undefined;this[_0x67e5('0x5')]=undefined;this[_0x67e5('0x6')]=0x0;this[_0x67e5('0x7')]='';this['uniqueid']=0x0;this['linkedid']=0x0;this[_0x67e5('0x8')]=0x0;this[_0x67e5('0x9')]=![];this['answertime']=null;this[_0x67e5('0xa')]=null;this['unmanaged']=![];this[_0x67e5('0xb')]=![];this['lastapplication']='';this['lastdata']='';this[_0x67e5('0xc')]=0x0;this[_0x67e5('0xd')]=0x0;this[_0x67e5('0xe')]=0x0;this[_0x67e5('0xf')]=null;this[_0x67e5('0x10')]=null;this[_0x67e5('0x11')]=null;this['monitor']=![];this['monitorFilename']=null;this[_0x67e5('0x12')]=null;this[_0x67e5('0x13')]=[];this['transfercalleridnum']=undefined;this['transferconnectedlinenum']=undefined;this[_0x67e5('0x14')]=0x0;}module[_0x67e5('0x15')]=Channel; \ No newline at end of file +var _0xef6a=['queue','transfercalleridnum','transferconnectedlinenum','mohtime','exports','starttime','channel','destinationchannel','connectedlinenum','accountcode','context','answered','answertime','endtime','unmanaged','abandoned','lastapplication','lastdata','duration','holdtime','disposition','monitor'];(function(_0x28d2d2,_0x5723e5){var _0x41a8db=function(_0x54bf80){while(--_0x54bf80){_0x28d2d2['push'](_0x28d2d2['shift']());}};_0x41a8db(++_0x5723e5);}(_0xef6a,0x1e9));var _0xaef6=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0xef6a[_0x46698a];return _0x356db0;};'use strict';function Channel(){this[_0xaef6('0x0')]=null;this[_0xaef6('0x1')]='';this[_0xaef6('0x2')]='';this['calleridnum']=0x0;this['calleridname']='';this[_0xaef6('0x3')]=undefined;this['connectedlinename']=undefined;this[_0xaef6('0x4')]=0x0;this[_0xaef6('0x5')]='';this['uniqueid']=0x0;this['linkedid']=0x0;this['exten']=0x0;this[_0xaef6('0x6')]=![];this[_0xaef6('0x7')]=null;this[_0xaef6('0x8')]=null;this[_0xaef6('0x9')]=![];this[_0xaef6('0xa')]=![];this[_0xaef6('0xb')]='';this[_0xaef6('0xc')]='';this[_0xaef6('0xd')]=0x0;this['billableseconds']=0x0;this[_0xaef6('0xe')]=0x0;this['type']=null;this['tag']=null;this[_0xaef6('0xf')]=null;this[_0xaef6('0x10')]=![];this['monitorFilename']=null;this[_0xaef6('0x11')]=null;this['monitors']=[];this[_0xaef6('0x12')]=undefined;this[_0xaef6('0x13')]=undefined;this[_0xaef6('0x14')]=0x0;}module[_0xaef6('0x15')]=Channel; \ No newline at end of file diff --git a/server/services/ami/model/deskAccount.js b/server/services/ami/model/deskAccount.js index 5820f06..6542417 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 _0xbeff=['username','remoteUri','authType','password','consumerKey','consumerSecret','token','tokenSecret','type','serverUrl','Configurations','exports','name'];(function(_0x5c2e49,_0x5e2c06){var _0x3ff358=function(_0xf5d072){while(--_0xf5d072){_0x5c2e49['push'](_0x5c2e49['shift']());}};_0x3ff358(++_0x5e2c06);}(_0xbeff,0x8e));var _0xfbef=function(_0x52b016,_0x33ec6e){_0x52b016=_0x52b016-0x0;var _0x13e797=_0xbeff[_0x52b016];return _0x13e797;};'use strict';function DeskAccount(_0x4c3934){this['id']=_0x4c3934['id']||0x0;this[_0xfbef('0x0')]=_0x4c3934[_0xfbef('0x0')]||'';this[_0xfbef('0x1')]=_0x4c3934[_0xfbef('0x1')]||'';this[_0xfbef('0x2')]=_0x4c3934['remoteUri']||'';this['authType']=_0x4c3934[_0xfbef('0x3')]||'';this[_0xfbef('0x4')]=_0x4c3934[_0xfbef('0x4')]||'';this[_0xfbef('0x5')]=_0x4c3934['consumerKey']||'';this[_0xfbef('0x6')]=_0x4c3934[_0xfbef('0x6')]||'';this['token']=_0x4c3934[_0xfbef('0x7')]||'';this[_0xfbef('0x8')]=_0x4c3934['tokenSecret']||'';this[_0xfbef('0x9')]=_0x4c3934['type']||'';this[_0xfbef('0xa')]=_0x4c3934['serverUrl']||'';this[_0xfbef('0xb')]=_0x4c3934[_0xfbef('0xb')]||{};}module[_0xfbef('0xc')]=DeskAccount; \ No newline at end of file +var _0x61a5=['token','tokenSecret','type','serverUrl','Configurations','exports','name','username','remoteUri','authType','password','consumerKey','consumerSecret'];(function(_0x2b0b61,_0x170827){var _0x2ae144=function(_0x4f0459){while(--_0x4f0459){_0x2b0b61['push'](_0x2b0b61['shift']());}};_0x2ae144(++_0x170827);}(_0x61a5,0xf0));var _0x561a=function(_0x4dd479,_0x26d87a){_0x4dd479=_0x4dd479-0x0;var _0x1b6807=_0x61a5[_0x4dd479];return _0x1b6807;};'use strict';function DeskAccount(_0x4768c0){this['id']=_0x4768c0['id']||0x0;this['name']=_0x4768c0[_0x561a('0x0')]||'';this[_0x561a('0x1')]=_0x4768c0[_0x561a('0x1')]||'';this[_0x561a('0x2')]=_0x4768c0[_0x561a('0x2')]||'';this['authType']=_0x4768c0[_0x561a('0x3')]||'';this[_0x561a('0x4')]=_0x4768c0['password']||'';this[_0x561a('0x5')]=_0x4768c0[_0x561a('0x5')]||'';this[_0x561a('0x6')]=_0x4768c0[_0x561a('0x6')]||'';this[_0x561a('0x7')]=_0x4768c0[_0x561a('0x7')]||'';this[_0x561a('0x8')]=_0x4768c0['tokenSecret']||'';this[_0x561a('0x9')]=_0x4768c0['type']||'';this[_0x561a('0xa')]=_0x4768c0[_0x561a('0xa')]||'';this['Configurations']=_0x4768c0[_0x561a('0xb')]||{};}module[_0x561a('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 4f82d3a..1cbf4aa 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 _0x83d7=['username','password','remoteUri','tenantId','clientId','clientSecret','serverUrl','Configurations','name'];(function(_0x5886b1,_0x8c78aa){var _0x2713f9=function(_0x651149){while(--_0x651149){_0x5886b1['push'](_0x5886b1['shift']());}};_0x2713f9(++_0x8c78aa);}(_0x83d7,0x98));var _0x783d=function(_0x2f54b6,_0x3cc6cb){_0x2f54b6=_0x2f54b6-0x0;var _0x169f21=_0x83d7[_0x2f54b6];return _0x169f21;};'use strict';function Dynamics365Account(_0x5d5c94){this['id']=_0x5d5c94['id']||0x0;this[_0x783d('0x0')]=_0x5d5c94['name']||'';this[_0x783d('0x1')]=_0x5d5c94[_0x783d('0x1')]||'';this[_0x783d('0x2')]=_0x5d5c94[_0x783d('0x2')]||'';this[_0x783d('0x3')]=_0x5d5c94[_0x783d('0x3')]||'';this[_0x783d('0x4')]=_0x5d5c94['tenantId']||'';this[_0x783d('0x5')]=_0x5d5c94[_0x783d('0x5')]||'';this[_0x783d('0x6')]=_0x5d5c94[_0x783d('0x6')]||{};this[_0x783d('0x7')]=_0x5d5c94['serverUrl']||'';this[_0x783d('0x8')]=_0x5d5c94[_0x783d('0x8')]||{};}module['exports']=Dynamics365Account; \ No newline at end of file +var _0x2228=['username','password','remoteUri','tenantId','clientId','clientSecret','serverUrl','Configurations','exports','name'];(function(_0x977c76,_0x3f2034){var _0x4682d1=function(_0x2ea0cf){while(--_0x2ea0cf){_0x977c76['push'](_0x977c76['shift']());}};_0x4682d1(++_0x3f2034);}(_0x2228,0x167));var _0x8222=function(_0x31d889,_0x459b75){_0x31d889=_0x31d889-0x0;var _0x36af20=_0x2228[_0x31d889];return _0x36af20;};'use strict';function Dynamics365Account(_0x1e23c0){this['id']=_0x1e23c0['id']||0x0;this[_0x8222('0x0')]=_0x1e23c0['name']||'';this[_0x8222('0x1')]=_0x1e23c0[_0x8222('0x1')]||'';this['password']=_0x1e23c0[_0x8222('0x2')]||'';this[_0x8222('0x3')]=_0x1e23c0[_0x8222('0x3')]||'';this[_0x8222('0x4')]=_0x1e23c0[_0x8222('0x4')]||'';this[_0x8222('0x5')]=_0x1e23c0[_0x8222('0x5')]||'';this[_0x8222('0x6')]=_0x1e23c0[_0x8222('0x6')]||{};this[_0x8222('0x7')]=_0x1e23c0[_0x8222('0x7')]||'';this[_0x8222('0x8')]=_0x1e23c0['Configurations']||{};}module[_0x8222('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 c90eba3..97127a9 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 _0x24db=['modem','v17,v27,v29','gateway','faxdetect','t38timeout','tech','Trunk','ListId','key','exports','name','description','ecm','headerinfo','localstationid','maxrate'];(function(_0x1850e2,_0x7dab61){var _0x1f5de4=function(_0x2cfb85){while(--_0x2cfb85){_0x1850e2['push'](_0x1850e2['shift']());}};_0x1f5de4(++_0x7dab61);}(_0x24db,0xaa));var _0xb24d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x24db[_0x3dd15e];return _0x231fd0;};'use strict';function FaxAccount(_0x2f91e8){this['id']=_0x2f91e8['id']||0x0;this[_0xb24d('0x0')]=_0x2f91e8[_0xb24d('0x0')]||'';this[_0xb24d('0x1')]=_0x2f91e8[_0xb24d('0x1')];this['ecm']=_0x2f91e8[_0xb24d('0x2')];this['headerinfo']=_0x2f91e8[_0xb24d('0x3')];this[_0xb24d('0x4')]=_0x2f91e8['localstationid'];this['minrate']=_0x2f91e8['minrate']||0x960;this[_0xb24d('0x5')]=_0x2f91e8[_0xb24d('0x5')]||0x3840;this[_0xb24d('0x6')]=_0x2f91e8[_0xb24d('0x6')]||_0xb24d('0x7');this['gateway']=_0x2f91e8[_0xb24d('0x8')]||'no';this[_0xb24d('0x9')]=_0x2f91e8[_0xb24d('0x9')]||'no';this['t38timeout']=_0x2f91e8[_0xb24d('0xa')]||0x1388;this[_0xb24d('0xb')]=_0x2f91e8[_0xb24d('0xb')]||'SIP';this[_0xb24d('0xc')]=_0x2f91e8['Trunk']?_0x2f91e8[_0xb24d('0xc')]:undefined;this['ListId']=_0x2f91e8[_0xb24d('0xd')];this[_0xb24d('0xe')]=_0x2f91e8[_0xb24d('0xe')];}module[_0xb24d('0xf')]=FaxAccount; \ No newline at end of file +var _0x4ca5=['tech','SIP','Trunk','ListId','key','name','description','ecm','headerinfo','localstationid','minrate','maxrate','modem','v17,v27,v29','gateway','faxdetect','t38timeout'];(function(_0xdc3057,_0x697d69){var _0x12bdc6=function(_0x21979c){while(--_0x21979c){_0xdc3057['push'](_0xdc3057['shift']());}};_0x12bdc6(++_0x697d69);}(_0x4ca5,0x1ae));var _0x54ca=function(_0x1b3aec,_0x1862eb){_0x1b3aec=_0x1b3aec-0x0;var _0x60e2b=_0x4ca5[_0x1b3aec];return _0x60e2b;};'use strict';function FaxAccount(_0xed8b12){this['id']=_0xed8b12['id']||0x0;this[_0x54ca('0x0')]=_0xed8b12[_0x54ca('0x0')]||'';this['description']=_0xed8b12[_0x54ca('0x1')];this[_0x54ca('0x2')]=_0xed8b12[_0x54ca('0x2')];this[_0x54ca('0x3')]=_0xed8b12[_0x54ca('0x3')];this[_0x54ca('0x4')]=_0xed8b12[_0x54ca('0x4')];this[_0x54ca('0x5')]=_0xed8b12[_0x54ca('0x5')]||0x960;this[_0x54ca('0x6')]=_0xed8b12['maxrate']||0x3840;this[_0x54ca('0x7')]=_0xed8b12[_0x54ca('0x7')]||_0x54ca('0x8');this[_0x54ca('0x9')]=_0xed8b12['gateway']||'no';this[_0x54ca('0xa')]=_0xed8b12[_0x54ca('0xa')]||'no';this[_0x54ca('0xb')]=_0xed8b12[_0x54ca('0xb')]||0x1388;this[_0x54ca('0xc')]=_0xed8b12[_0x54ca('0xc')]||_0x54ca('0xd');this[_0x54ca('0xe')]=_0xed8b12['Trunk']?_0xed8b12[_0x54ca('0xe')]:undefined;this[_0x54ca('0xf')]=_0xed8b12['ListId'];this['key']=_0xed8b12[_0x54ca('0x10')];}module['exports']=FaxAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshdeskAccount.js b/server/services/ami/model/freshdeskAccount.js index c15cf34..e70b251 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 _0xec9e=['serverUrl','exports','name','username','apiKey','token','remoteUri'];(function(_0x138836,_0x229129){var _0x322688=function(_0x54b101){while(--_0x54b101){_0x138836['push'](_0x138836['shift']());}};_0x322688(++_0x229129);}(_0xec9e,0x1d7));var _0xeec9=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xec9e[_0x20a584];return _0x4b41a8;};'use strict';function FreshdeskAccount(_0x4de34c){this['id']=_0x4de34c['id']||0x0;this[_0xeec9('0x0')]=_0x4de34c[_0xeec9('0x0')]||'';this['username']=_0x4de34c[_0xeec9('0x1')]||'';this[_0xeec9('0x2')]=_0x4de34c[_0xeec9('0x3')]||'';this[_0xeec9('0x4')]=_0x4de34c[_0xeec9('0x4')]||'';this[_0xeec9('0x5')]=_0x4de34c[_0xeec9('0x5')]||'';this['Configurations']=_0x4de34c['Configurations']||{};}module[_0xeec9('0x6')]=FreshdeskAccount; \ No newline at end of file +var _0xf1a5=['username','token','remoteUri','serverUrl','exports','name'];(function(_0x4c2524,_0x295209){var _0x5b5824=function(_0x3b05a9){while(--_0x3b05a9){_0x4c2524['push'](_0x4c2524['shift']());}};_0x5b5824(++_0x295209);}(_0xf1a5,0x119));var _0x5f1a=function(_0x4d8ffa,_0xc4516){_0x4d8ffa=_0x4d8ffa-0x0;var _0xed34c6=_0xf1a5[_0x4d8ffa];return _0xed34c6;};'use strict';function FreshdeskAccount(_0x5965db){this['id']=_0x5965db['id']||0x0;this[_0x5f1a('0x0')]=_0x5965db[_0x5f1a('0x0')]||'';this[_0x5f1a('0x1')]=_0x5965db[_0x5f1a('0x1')]||'';this['apiKey']=_0x5965db[_0x5f1a('0x2')]||'';this['remoteUri']=_0x5965db[_0x5f1a('0x3')]||'';this['serverUrl']=_0x5965db[_0x5f1a('0x4')]||'';this['Configurations']=_0x5965db['Configurations']||{};}module[_0x5f1a('0x5')]=FreshdeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/queueReport.js b/server/services/ami/model/queueReport.js index f8a40e5..f45f9cc 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 _0x305b=['calleridname','queue','queuecallerjoinAt','queuecallerleaveAt','position','count','queuecallerabandon','queuecallerabandonAt','queuecallercomplete','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','connectedlinenum','accountcode','context','exten','priority','holdtime','exports','type','inbound','uniqueid'];(function(_0x279d37,_0x14de3f){var _0x530173=function(_0x37fc79){while(--_0x37fc79){_0x279d37['push'](_0x279d37['shift']());}};_0x530173(++_0x14de3f);}(_0x305b,0x81));var _0xb305=function(_0x3a9635,_0x1ab817){_0x3a9635=_0x3a9635-0x0;var _0x10d08c=_0x305b[_0x3a9635];return _0x10d08c;};'use strict';function QueueReport(){this[_0xb305('0x0')]=_0xb305('0x1');this[_0xb305('0x2')]='';this['calleridnum']='';this[_0xb305('0x3')]='';this[_0xb305('0x4')]='';this[_0xb305('0x5')]=null;this[_0xb305('0x6')]=null;this[_0xb305('0x7')]=0x1;this[_0xb305('0x8')]=0x1;this[_0xb305('0x9')]=![];this[_0xb305('0xa')]=null;this[_0xb305('0xb')]=![];this[_0xb305('0xc')]=null;this[_0xb305('0xd')]=![];this[_0xb305('0xe')]=null;this['originalposition']=0x1;this['channel']='';this[_0xb305('0xf')]='';this['connectedlinename']='';this[_0xb305('0x10')]='';this[_0xb305('0x11')]='';this[_0xb305('0x12')]='';this[_0xb305('0x13')]='';this[_0xb305('0x14')]=0x0;this['assigned']=![];this['lastAssignedTo']='';this['mohtime']=0x0;this['variables']={};}module[_0xb305('0x15')]=QueueReport; \ No newline at end of file +var _0xf4a5=['context','exten','priority','holdtime','lastAssignedTo','mohtime','variables','inbound','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','position','count','queuecallercomplete','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','originalposition','channel','connectedlinenum','connectedlinename','accountcode'];(function(_0x5446a8,_0x5b27f7){var _0x57ec1f=function(_0x581a6f){while(--_0x581a6f){_0x5446a8['push'](_0x5446a8['shift']());}};_0x57ec1f(++_0x5b27f7);}(_0xf4a5,0x1cf));var _0x5f4a=function(_0x4978de,_0x5912e4){_0x4978de=_0x4978de-0x0;var _0x675221=_0xf4a5[_0x4978de];return _0x675221;};'use strict';function QueueReport(){this['type']=_0x5f4a('0x0');this[_0x5f4a('0x1')]='';this[_0x5f4a('0x2')]='';this[_0x5f4a('0x3')]='';this[_0x5f4a('0x4')]='';this[_0x5f4a('0x5')]=null;this['queuecallerleaveAt']=null;this[_0x5f4a('0x6')]=0x1;this[_0x5f4a('0x7')]=0x1;this['queuecallerabandon']=![];this['queuecallerabandonAt']=null;this[_0x5f4a('0x8')]=![];this[_0x5f4a('0x9')]=null;this[_0x5f4a('0xa')]=![];this[_0x5f4a('0xb')]=null;this[_0x5f4a('0xc')]=0x1;this[_0x5f4a('0xd')]='';this[_0x5f4a('0xe')]='';this[_0x5f4a('0xf')]='';this[_0x5f4a('0x10')]='';this[_0x5f4a('0x11')]='';this[_0x5f4a('0x12')]='';this[_0x5f4a('0x13')]='';this[_0x5f4a('0x14')]=0x0;this['assigned']=![];this[_0x5f4a('0x15')]='';this[_0x5f4a('0x16')]=0x0;this[_0x5f4a('0x17')]={};}module['exports']=QueueReport; \ No newline at end of file diff --git a/server/services/ami/model/salesforceAccount.js b/server/services/ami/model/salesforceAccount.js index 98c9966..a960163 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 _0x6778=['name','username','remoteUri','password','clientId','clientSecret','securityToken','type','integrationTab','serverUrl','Configurations','exports'];(function(_0x3de146,_0x30cd50){var _0x49ccab=function(_0x8ce29e){while(--_0x8ce29e){_0x3de146['push'](_0x3de146['shift']());}};_0x49ccab(++_0x30cd50);}(_0x6778,0x1e0));var _0x8677=function(_0x3ce3c,_0x319337){_0x3ce3c=_0x3ce3c-0x0;var _0x55a2c9=_0x6778[_0x3ce3c];return _0x55a2c9;};'use strict';function SalesforceAccount(_0x41078a){this['id']=_0x41078a['id']||0x0;this[_0x8677('0x0')]=_0x41078a['name']||'';this['username']=_0x41078a[_0x8677('0x1')]||'';this[_0x8677('0x2')]=_0x41078a[_0x8677('0x2')]||'';this['password']=_0x41078a[_0x8677('0x3')]||'';this[_0x8677('0x4')]=_0x41078a[_0x8677('0x4')]||'';this[_0x8677('0x5')]=_0x41078a['clientSecret']||'';this[_0x8677('0x6')]=_0x41078a['securityToken']||'';this[_0x8677('0x7')]=_0x41078a[_0x8677('0x7')]||_0x8677('0x8');this[_0x8677('0x9')]=_0x41078a[_0x8677('0x9')]||'';this[_0x8677('0xa')]=_0x41078a['Configurations']||{};}module[_0x8677('0xb')]=SalesforceAccount; \ No newline at end of file +var _0x8234=['serverUrl','Configurations','exports','name','username','remoteUri','password','clientId','clientSecret','securityToken','type','integrationTab'];(function(_0x3799bf,_0x937a88){var _0x633b0a=function(_0x192fc7){while(--_0x192fc7){_0x3799bf['push'](_0x3799bf['shift']());}};_0x633b0a(++_0x937a88);}(_0x8234,0x1cb));var _0x4823=function(_0x234995,_0x94ca50){_0x234995=_0x234995-0x0;var _0x2e106e=_0x8234[_0x234995];return _0x2e106e;};'use strict';function SalesforceAccount(_0x1c1c67){this['id']=_0x1c1c67['id']||0x0;this[_0x4823('0x0')]=_0x1c1c67[_0x4823('0x0')]||'';this[_0x4823('0x1')]=_0x1c1c67[_0x4823('0x1')]||'';this[_0x4823('0x2')]=_0x1c1c67[_0x4823('0x2')]||'';this['password']=_0x1c1c67[_0x4823('0x3')]||'';this[_0x4823('0x4')]=_0x1c1c67[_0x4823('0x4')]||'';this['clientSecret']=_0x1c1c67[_0x4823('0x5')]||'';this['securityToken']=_0x1c1c67[_0x4823('0x6')]||'';this[_0x4823('0x7')]=_0x1c1c67['type']||_0x4823('0x8');this['serverUrl']=_0x1c1c67[_0x4823('0x9')]||'';this[_0x4823('0xa')]=_0x1c1c67[_0x4823('0xa')]||{};}module[_0x4823('0xb')]=SalesforceAccount; \ No newline at end of file diff --git a/server/services/ami/model/servicenowAccount.js b/server/services/ami/model/servicenowAccount.js index 101ecda..8bbac64 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 _0xc109=['remoteUri','serverUrl','Configurations','name','username','password'];(function(_0x31db67,_0x4ed625){var _0x5371d4=function(_0x3f6c69){while(--_0x3f6c69){_0x31db67['push'](_0x31db67['shift']());}};_0x5371d4(++_0x4ed625);}(_0xc109,0x1dd));var _0x9c10=function(_0x4b2436,_0x452299){_0x4b2436=_0x4b2436-0x0;var _0x4f5ab2=_0xc109[_0x4b2436];return _0x4f5ab2;};'use strict';function ServicenowAccount(_0xbb639){this['id']=_0xbb639['id']||0x0;this[_0x9c10('0x0')]=_0xbb639[_0x9c10('0x0')]||'';this[_0x9c10('0x1')]=_0xbb639[_0x9c10('0x1')]||'';this[_0x9c10('0x2')]=_0xbb639[_0x9c10('0x2')]||'';this[_0x9c10('0x3')]=_0xbb639['remoteUri']||'';this[_0x9c10('0x4')]=_0xbb639[_0x9c10('0x4')]||'';this[_0x9c10('0x5')]=_0xbb639[_0x9c10('0x5')]||{};}module['exports']=ServicenowAccount; \ No newline at end of file +var _0x0fd6=['remoteUri','serverUrl','Configurations','exports','name','password'];(function(_0x45d55e,_0x2fede3){var _0x29812a=function(_0x3c6830){while(--_0x3c6830){_0x45d55e['push'](_0x45d55e['shift']());}};_0x29812a(++_0x2fede3);}(_0x0fd6,0x6a));var _0x60fd=function(_0x387d19,_0x3f290e){_0x387d19=_0x387d19-0x0;var _0x27fd4b=_0x0fd6[_0x387d19];return _0x27fd4b;};'use strict';function ServicenowAccount(_0x573c15){this['id']=_0x573c15['id']||0x0;this[_0x60fd('0x0')]=_0x573c15[_0x60fd('0x0')]||'';this['username']=_0x573c15['username']||'';this['password']=_0x573c15[_0x60fd('0x1')]||'';this[_0x60fd('0x2')]=_0x573c15[_0x60fd('0x2')]||'';this[_0x60fd('0x3')]=_0x573c15[_0x60fd('0x3')]||'';this[_0x60fd('0x4')]=_0x573c15[_0x60fd('0x4')]||{};}module[_0x60fd('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 301039e..c6b4308 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 _0x3550=['remoteUri','serverUrl','Configurations','exports','name','password'];(function(_0x354f69,_0x78b6c8){var _0x5b8501=function(_0x463e9b){while(--_0x463e9b){_0x354f69['push'](_0x354f69['shift']());}};_0x5b8501(++_0x78b6c8);}(_0x3550,0x154));var _0x0355=function(_0x19648c,_0x2a6d63){_0x19648c=_0x19648c-0x0;var _0x4250f9=_0x3550[_0x19648c];return _0x4250f9;};'use strict';function SugarcrmAccount(_0x41f0fa){this['id']=_0x41f0fa['id']||0x0;this[_0x0355('0x0')]=_0x41f0fa[_0x0355('0x0')]||'';this['username']=_0x41f0fa['username']||'';this[_0x0355('0x1')]=_0x41f0fa[_0x0355('0x1')]||'';this[_0x0355('0x2')]=_0x41f0fa[_0x0355('0x2')]||'';this[_0x0355('0x3')]=_0x41f0fa[_0x0355('0x3')]||'';this[_0x0355('0x4')]=_0x41f0fa[_0x0355('0x4')]||{};}module[_0x0355('0x5')]=SugarcrmAccount; \ No newline at end of file +var _0x341d=['remoteUri','serverUrl','Configurations','name','username','password'];(function(_0x4b016e,_0x58aed2){var _0x10c5a9=function(_0x57a0c5){while(--_0x57a0c5){_0x4b016e['push'](_0x4b016e['shift']());}};_0x10c5a9(++_0x58aed2);}(_0x341d,0x1a1));var _0xd341=function(_0xe06c8c,_0x23e7e1){_0xe06c8c=_0xe06c8c-0x0;var _0x3d8722=_0x341d[_0xe06c8c];return _0x3d8722;};'use strict';function SugarcrmAccount(_0x588aa4){this['id']=_0x588aa4['id']||0x0;this['name']=_0x588aa4[_0xd341('0x0')]||'';this[_0xd341('0x1')]=_0x588aa4['username']||'';this[_0xd341('0x2')]=_0x588aa4['password']||'';this[_0xd341('0x3')]=_0x588aa4[_0xd341('0x3')]||'';this[_0xd341('0x4')]=_0x588aa4[_0xd341('0x4')]||'';this[_0xd341('0x5')]=_0x588aa4[_0xd341('0x5')]||{};}module['exports']=SugarcrmAccount; \ No newline at end of file diff --git a/server/services/ami/model/telephone.js b/server/services/ami/model/telephone.js index c6b5e09..eda1f23 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 _0x0ef0=['state','unknown','stateTime','status','address','exports','name','accountcode'];(function(_0x33b1ad,_0x17eb10){var _0x58a88d=function(_0x25f66d){while(--_0x25f66d){_0x33b1ad['push'](_0x33b1ad['shift']());}};_0x58a88d(++_0x17eb10);}(_0x0ef0,0x7e));var _0x00ef=function(_0x5ce34a,_0x57887e){_0x5ce34a=_0x5ce34a-0x0;var _0x309350=_0x0ef0[_0x5ce34a];return _0x309350;};'use strict';function Telephone(_0x16722b){this['id']=_0x16722b['id']||0x0;this[_0x00ef('0x0')]=_0x16722b[_0x00ef('0x0')]||'';this['accountcode']=_0x16722b[_0x00ef('0x1')]||'';this[_0x00ef('0x2')]=_0x00ef('0x3');this[_0x00ef('0x4')]=0x0;this[_0x00ef('0x5')]='unknown';this[_0x00ef('0x6')]='';}module[_0x00ef('0x7')]=Telephone; \ No newline at end of file +var _0x45c9=['name','accountcode','unknown','address','exports'];(function(_0x146382,_0x3d79d7){var _0x161fc8=function(_0x7524c9){while(--_0x7524c9){_0x146382['push'](_0x146382['shift']());}};_0x161fc8(++_0x3d79d7);}(_0x45c9,0xd7));var _0x945c=function(_0x167f1c,_0x50aa96){_0x167f1c=_0x167f1c-0x0;var _0x2cb184=_0x45c9[_0x167f1c];return _0x2cb184;};'use strict';function Telephone(_0x262749){this['id']=_0x262749['id']||0x0;this[_0x945c('0x0')]=_0x262749[_0x945c('0x0')]||'';this[_0x945c('0x1')]=_0x262749[_0x945c('0x1')]||'';this['state']=_0x945c('0x2');this['stateTime']=0x0;this['status']=_0x945c('0x2');this[_0x945c('0x3')]='';}module[_0x945c('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 0741273..6a6bf81 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 _0xe21d=['name','html','exports'];(function(_0x2ae555,_0x4c0c12){var _0x49c95a=function(_0x430e0e){while(--_0x430e0e){_0x2ae555['push'](_0x2ae555['shift']());}};_0x49c95a(++_0x4c0c12);}(_0xe21d,0x159));var _0xde21=function(_0x77acff,_0x252354){_0x77acff=_0x77acff-0x0;var _0x5ad5e5=_0xe21d[_0x77acff];return _0x5ad5e5;};'use strict';function template(_0x3530be){this['id']=_0x3530be['id']||0x0;this[_0xde21('0x0')]=_0x3530be[_0xde21('0x0')]||'';this['html']=_0x3530be[_0xde21('0x1')]||'';}module[_0xde21('0x2')]=template; \ No newline at end of file +var _0x8efc=['html','name'];(function(_0x2a7c5d,_0x4fd5e3){var _0x47bdd6=function(_0x3406de){while(--_0x3406de){_0x2a7c5d['push'](_0x2a7c5d['shift']());}};_0x47bdd6(++_0x4fd5e3);}(_0x8efc,0x8f));var _0xc8ef=function(_0x51eb91,_0x4799d5){_0x51eb91=_0x51eb91-0x0;var _0x1c4fc4=_0x8efc[_0x51eb91];return _0x1c4fc4;};'use strict';function template(_0x2440cf){this['id']=_0x2440cf['id']||0x0;this['name']=_0x2440cf[_0xc8ef('0x0')]||'';this['html']=_0x2440cf[_0xc8ef('0x1')]||'';}module['exports']=template; \ No newline at end of file diff --git a/server/services/ami/model/trigger.js b/server/services/ami/model/trigger.js index b9529c3..711ff78 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 _0x008c=['name','channel','status','AllConditions','AnyConditions','Actions','exports'];(function(_0x58fe86,_0x19655f){var _0x3f0732=function(_0x1d0b4a){while(--_0x1d0b4a){_0x58fe86['push'](_0x58fe86['shift']());}};_0x3f0732(++_0x19655f);}(_0x008c,0x188));var _0xc008=function(_0x2cc017,_0x25b198){_0x2cc017=_0x2cc017-0x0;var _0x509276=_0x008c[_0x2cc017];return _0x509276;};'use strict';function Trigger(_0x2be4ba){this['id']=_0x2be4ba['id']||0x0;this[_0xc008('0x0')]=_0x2be4ba[_0xc008('0x0')]||'';this[_0xc008('0x1')]=_0x2be4ba[_0xc008('0x1')]||'voice';this[_0xc008('0x2')]=_0x2be4ba[_0xc008('0x2')]||![];this[_0xc008('0x3')]=_0x2be4ba[_0xc008('0x3')]||[];this[_0xc008('0x4')]=_0x2be4ba[_0xc008('0x4')]||[];this[_0xc008('0x5')]=_0x2be4ba[_0xc008('0x5')]||[];}module[_0xc008('0x6')]=Trigger; \ No newline at end of file +var _0x9c44=['voice','status','AnyConditions','Actions','exports','name','channel'];(function(_0x1f4271,_0x149336){var _0x367b53=function(_0x30abed){while(--_0x30abed){_0x1f4271['push'](_0x1f4271['shift']());}};_0x367b53(++_0x149336);}(_0x9c44,0x178));var _0x49c4=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x9c44[_0x2641f9];return _0x585741;};'use strict';function Trigger(_0x2fa01d){this['id']=_0x2fa01d['id']||0x0;this['name']=_0x2fa01d[_0x49c4('0x0')]||'';this[_0x49c4('0x1')]=_0x2fa01d[_0x49c4('0x1')]||_0x49c4('0x2');this[_0x49c4('0x3')]=_0x2fa01d[_0x49c4('0x3')]||![];this['AllConditions']=_0x2fa01d['AllConditions']||[];this[_0x49c4('0x4')]=_0x2fa01d['AnyConditions']||[];this[_0x49c4('0x5')]=_0x2fa01d[_0x49c4('0x5')]||[];}module[_0x49c4('0x6')]=Trigger; \ No newline at end of file diff --git a/server/services/ami/model/trunk.js b/server/services/ami/model/trunk.js index c53eee5..c9abd77 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 _0x57a0=['unknown','stateTime','status','registry','indexOf','split','host','port','domain','domainport','refresh','stateRegistry','registrationtime','address','exports','active','name','state'];(function(_0x4236d7,_0x155ab4){var _0x19581a=function(_0x40e515){while(--_0x40e515){_0x4236d7['push'](_0x4236d7['shift']());}};_0x19581a(++_0x155ab4);}(_0x57a0,0x7b));var _0x057a=function(_0x2da85b,_0x502a26){_0x2da85b=_0x2da85b-0x0;var _0x3a087c=_0x57a0[_0x2da85b];return _0x3a087c;};'use strict';function Trunk(_0x1e40c3){this['id']=_0x1e40c3['id']||0x0;this['active']=_0x1e40c3[_0x057a('0x0')]||![];this[_0x057a('0x1')]=_0x1e40c3['name']||'';this[_0x057a('0x2')]=_0x057a('0x3');this[_0x057a('0x4')]=0x0;this[_0x057a('0x5')]='unknown';this[_0x057a('0x6')]=_0x1e40c3[_0x057a('0x6')]&&_0x1e40c3['registry'][_0x057a('0x7')](':')?_0x1e40c3[_0x057a('0x6')][_0x057a('0x8')](':')[0x0]:'';this[_0x057a('0x9')]='';this[_0x057a('0xa')]='';this[_0x057a('0xb')]='';this[_0x057a('0xc')]='';this[_0x057a('0xd')]='';this[_0x057a('0xe')]='unknown';this[_0x057a('0xf')]='';this[_0x057a('0x10')]='';}module[_0x057a('0x11')]=Trunk; \ No newline at end of file +var _0xe13a=['address','active','name','unknown','stateTime','status','registry','indexOf','host','port','domain','domainport','refresh','stateRegistry','registrationtime'];(function(_0x39cbbd,_0x1ff485){var _0x53641b=function(_0x331f93){while(--_0x331f93){_0x39cbbd['push'](_0x39cbbd['shift']());}};_0x53641b(++_0x1ff485);}(_0xe13a,0x178));var _0xae13=function(_0xad0b9a,_0x1ccc2f){_0xad0b9a=_0xad0b9a-0x0;var _0x9762d9=_0xe13a[_0xad0b9a];return _0x9762d9;};'use strict';function Trunk(_0x15d8ff){this['id']=_0x15d8ff['id']||0x0;this[_0xae13('0x0')]=_0x15d8ff[_0xae13('0x0')]||![];this[_0xae13('0x1')]=_0x15d8ff[_0xae13('0x1')]||'';this['state']=_0xae13('0x2');this[_0xae13('0x3')]=0x0;this[_0xae13('0x4')]=_0xae13('0x2');this[_0xae13('0x5')]=_0x15d8ff[_0xae13('0x5')]&&_0x15d8ff[_0xae13('0x5')][_0xae13('0x6')](':')?_0x15d8ff[_0xae13('0x5')]['split'](':')[0x0]:'';this[_0xae13('0x7')]='';this[_0xae13('0x8')]='';this[_0xae13('0x9')]='';this[_0xae13('0xa')]='';this[_0xae13('0xb')]='';this[_0xae13('0xc')]=_0xae13('0x2');this[_0xae13('0xd')]='';this[_0xae13('0xe')]='';}module['exports']=Trunk; \ No newline at end of file diff --git a/server/services/ami/model/voiceExtension.js b/server/services/ami/model/voiceExtension.js index 63d51c7..5038446 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 _0xc698=['none','mandatoryDisposition','exports','exten','recordingFormat'];(function(_0x48db14,_0x193828){var _0x372525=function(_0x2210e9){while(--_0x2210e9){_0x48db14['push'](_0x48db14['shift']());}};_0x372525(++_0x193828);}(_0xc698,0xd0));var _0x8c69=function(_0x43d11d,_0xccff91){_0x43d11d=_0x43d11d-0x0;var _0x38cd08=_0xc698[_0x43d11d];return _0x38cd08;};'use strict';function voiceExtension(_0x4a94cb){this['id']=_0x4a94cb['id']||0x0;this[_0x8c69('0x0')]=_0x4a94cb[_0x8c69('0x0')]||'';this[_0x8c69('0x1')]=_0x4a94cb['recordingFormat']||_0x8c69('0x2');this['mandatoryDisposition']=_0x4a94cb[_0x8c69('0x3')]||![];}module[_0x8c69('0x4')]=voiceExtension; \ No newline at end of file +var _0x0794=['recordingFormat','none','mandatoryDisposition','exten'];(function(_0x56482c,_0x16118d){var _0x5aae7a=function(_0x52512f){while(--_0x52512f){_0x56482c['push'](_0x56482c['shift']());}};_0x5aae7a(++_0x16118d);}(_0x0794,0x11b));var _0x4079=function(_0x1b1390,_0x127af7){_0x1b1390=_0x1b1390-0x0;var _0x541615=_0x0794[_0x1b1390];return _0x541615;};'use strict';function voiceExtension(_0x493511){this['id']=_0x493511['id']||0x0;this[_0x4079('0x0')]=_0x493511[_0x4079('0x0')]||'';this['recordingFormat']=_0x493511[_0x4079('0x1')]||_0x4079('0x2');this['mandatoryDisposition']=_0x493511[_0x4079('0x3')]||![];}module['exports']=voiceExtension; \ No newline at end of file diff --git a/server/services/ami/model/voiceQueue.js b/server/services/ami/model/voiceQueue.js index e6a947f..09609d3 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 _0xd887=['dialAMDMaximumWordLength','outboundRejectCallsDay','pTalking','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundReCallsDay','startProgressive','startPredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDispositionPause','unknown','not_inuse','inuse','unavailable','ringing','onhold','wav','wav49','gsm','rrmemory','name','monitor_format','type','inbound','talking','total','answered','sumDuration','sumHoldTime','sumBillable','unmanaged','abandoned','loggedIn','acw','acwTimeout','autopause','originated','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','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold'];(function(_0x300ea5,_0x16728f){var _0x4ca678=function(_0x57b855){while(--_0x57b855){_0x300ea5['push'](_0x300ea5['shift']());}};_0x4ca678(++_0x16728f);}(_0xd887,0x170));var _0x7d88=function(_0x108831,_0x5e4f70){_0x108831=_0x108831-0x0;var _0x4da77a=_0xd887[_0x108831];return _0x4da77a;};'use strict';var statusDesc=[_0x7d88('0x0'),_0x7d88('0x1'),_0x7d88('0x2'),'busy','invalid',_0x7d88('0x3'),_0x7d88('0x4'),'ringinuse',_0x7d88('0x5')];var monitorFormat={'wav':_0x7d88('0x6'),'wav49':_0x7d88('0x7'),'gsm':_0x7d88('0x8')};var strategy={'rrmemory':_0x7d88('0x9'),'roundrobin':'roundrobin'};function VoiceQueue(_0x4533f9){this['id']=_0x4533f9['id']||0x0;this[_0x7d88('0xa')]=_0x4533f9['name']||'';this[_0x7d88('0xb')]=_0x4533f9[_0x7d88('0xb')]||'';this[_0x7d88('0xc')]=_0x4533f9[_0x7d88('0xc')]||_0x7d88('0xd');this['waiting']=0x0;this[_0x7d88('0xe')]=0x0;this[_0x7d88('0xf')]=0x0;this[_0x7d88('0x10')]=0x0;this[_0x7d88('0x11')]=0x0;this[_0x7d88('0x12')]=0x0;this[_0x7d88('0x13')]=0x0;this[_0x7d88('0x14')]=0x0;this[_0x7d88('0x15')]=0x0;this[_0x7d88('0x16')]=0x0;this['available']=0x0;this['acw']=_0x4533f9[_0x7d88('0x17')]||![];this[_0x7d88('0x18')]=_0x4533f9['acwTimeout']||0xa;this[_0x7d88('0x19')]=_0x4533f9[_0x7d88('0x19')]||'no';this['sendMessageOneNotActive']=!![];this['message']='';this[_0x7d88('0x1a')]=0x0;this[_0x7d88('0x1b')]=0x0;this[_0x7d88('0x1c')]=_0x4533f9['dialTimezone']||null;this[_0x7d88('0x1d')]=_0x4533f9[_0x7d88('0x1d')]?_0x4533f9[_0x7d88('0x1d')]:null;this[_0x7d88('0x1e')]=_0x4533f9['dialActive'];this[_0x7d88('0x1f')]=_0x4533f9[_0x7d88('0x1f')]||_0x7d88('0x20');this[_0x7d88('0x21')]=_0x4533f9[_0x7d88('0x21')]||0x0;this[_0x7d88('0x22')]=_0x4533f9['dialLimitQueue']||0x0;this['dialPowerLevel']=_0x4533f9[_0x7d88('0x23')]||0x1;this['dialPredictiveOptimization']=_0x4533f9[_0x7d88('0x24')]||_0x7d88('0x25');this[_0x7d88('0x26')]=_0x4533f9[_0x7d88('0x26')]||0.03;this['dialPredictiveInterval']=_0x4533f9[_0x7d88('0x27')]||0x258;this[_0x7d88('0x28')]=_0x4533f9['dialOriginateCallerIdName']||_0x7d88('0x29');this[_0x7d88('0x2a')]=_0x4533f9['dialOriginateCallerIdNumber']||_0x7d88('0x29');this[_0x7d88('0x2b')]=_0x4533f9[_0x7d88('0x2b')]||0x1e;this[_0x7d88('0x2c')]=_0x4533f9[_0x7d88('0x2c')]||'tTxX';this['dialQueueTimeout']=_0x4533f9[_0x7d88('0x2d')]||0x3;this[_0x7d88('0x2e')]=_0x4533f9['dialQueueProject']||undefined;this[_0x7d88('0x2f')]=_0x4533f9[_0x7d88('0x2f')]||0x3;this[_0x7d88('0x30')]=_0x4533f9[_0x7d88('0x30')]||0x96;this[_0x7d88('0x31')]=_0x4533f9[_0x7d88('0x31')]||0x3;this[_0x7d88('0x32')]=_0x4533f9['dialBusyRetryFrequency']||0x96;this[_0x7d88('0x33')]=_0x4533f9[_0x7d88('0x33')]||0x3;this['dialNoAnswerRetryFrequency']=_0x4533f9[_0x7d88('0x34')]||0x96;this[_0x7d88('0x35')]=_0x4533f9['dialGlobalMaxRetry']||0x4;this['Trunk']=_0x4533f9[_0x7d88('0x36')]?_0x4533f9['Trunk']:undefined;this['TrunkBackup']=_0x4533f9[_0x7d88('0x37')]?_0x4533f9[_0x7d88('0x37')]:undefined;this[_0x7d88('0x38')]=_0x4533f9[_0x7d88('0x38')]||undefined;this[_0x7d88('0x39')]=_0x4533f9[_0x7d88('0x39')]?_0x4533f9[_0x7d88('0x39')]:undefined;this[_0x7d88('0x3a')]=_0x4533f9[_0x7d88('0x3a')]||_0x7d88('0x3b');this[_0x7d88('0x3c')]=_0x4533f9[_0x7d88('0x3c')]||undefined;this['dialCutDigit']=_0x4533f9[_0x7d88('0x3d')]||undefined;this[_0x7d88('0x3e')]=strategy[_0x4533f9[_0x7d88('0x3e')]]||_0x7d88('0x9');this[_0x7d88('0x3f')]=!![];this[_0x7d88('0x40')]=_0x4533f9[_0x7d88('0x40')]||![];this[_0x7d88('0x41')]=_0x4533f9[_0x7d88('0x41')];this[_0x7d88('0x42')]=_0x4533f9[_0x7d88('0x42')];this[_0x7d88('0x43')]=_0x4533f9[_0x7d88('0x43')];this['dialAMDTotalAnalysisTime']=_0x4533f9[_0x7d88('0x44')];this['dialAMDMinWordLength']=_0x4533f9['dialAMDMinWordLength'];this[_0x7d88('0x45')]=_0x4533f9[_0x7d88('0x45')];this[_0x7d88('0x46')]=_0x4533f9['dialAMDMaximumNumberOfWords'];this[_0x7d88('0x47')]=_0x4533f9['dialAMDSilenceThreshold'];this[_0x7d88('0x48')]=_0x4533f9['dialAMDMaximumWordLength'];this[_0x7d88('0x49')]=0x0;this[_0x7d88('0x4a')]=0x0;this[_0x7d88('0x4b')]=_0x4533f9[_0x7d88('0x4b')];this[_0x7d88('0x4c')]=0x0;this[_0x7d88('0x4d')]=0x0;this[_0x7d88('0x4e')]=0x0;this[_0x7d88('0x4f')]=0x0;this['outboundCongestionCallsDay']=0x0;this[_0x7d88('0x50')]=0x0;this[_0x7d88('0x51')]=0x0;this['outboundBlacklistCallsDay']=0x0;this['outboundOriginateFailureCallsDay']=0x0;this['outboundDropCallsDayCallersExit']=0x0;this[_0x7d88('0x52')]=0x0;this[_0x7d88('0x53')]=0x0;this[_0x7d88('0x54')]=0x0;this[_0x7d88('0x55')]=undefined;this[_0x7d88('0x56')]=undefined;this['handlePredictive']=undefined;this[_0x7d88('0x57')]=1.05;this[_0x7d88('0x58')]=0x0;this['predictiveIntervalAnsweredCalls']=0x0;this[_0x7d88('0x59')]=0x0;this[_0x7d88('0x5a')]=0x0;this[_0x7d88('0x5b')]=0x0;this['predictiveIntervalAvgTalktime']=0x0;this[_0x7d88('0x5c')]=0x0;this[_0x7d88('0x5d')]=0x0;this[_0x7d88('0x5e')]=_0x4533f9[_0x7d88('0x5f')]||0x14;this[_0x7d88('0x60')]=_0x4533f9[_0x7d88('0x5f')]||0xa;this[_0x7d88('0x61')]=0x0;this[_0x7d88('0x62')]=0x0;this[_0x7d88('0x63')]=0x1;this[_0x7d88('0x64')]=0x0;this[_0x7d88('0x65')]=0x0;this[_0x7d88('0x66')]=0x0;this[_0x7d88('0x67')]=0x0;this[_0x7d88('0x68')]=_0x4533f9[_0x7d88('0x68')]||0x1e;this[_0x7d88('0x69')]=_0x4533f9[_0x7d88('0x69')]||![];this['dialQueueProject2']=_0x4533f9[_0x7d88('0x6a')]||undefined;this[_0x7d88('0x6b')]=_0x4533f9['dialAgiAfterHangupClient']||![];this[_0x7d88('0x6c')]=_0x4533f9[_0x7d88('0x6c')]||![];this[_0x7d88('0xb')]=monitorFormat[_0x4533f9['monitor_format']]?monitorFormat[_0x4533f9[_0x7d88('0xb')]]:undefined;this['mandatoryDisposition']=_0x4533f9['mandatoryDisposition']||![];this[_0x7d88('0x6d')]=_0x4533f9['mandatoryDispositionPause']?_0x4533f9[_0x7d88('0x6d')]:undefined;}module['exports']=VoiceQueue; \ No newline at end of file +var _0x7754=['outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','startProgressive','startPredictive','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCalls','erlangCallToSecond','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','exports','ringinuse','onhold','wav','wav49','gsm','rrmemory','roundrobin','name','monitor_format','type','inbound','waiting','answered','sumDuration','sumHoldTime','sumBillable','unmanaged','abandoned','loggedIn','acwTimeout','autopause','sendMessageOneNotActive','message','originated','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','anonymous','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','pTalking','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay'];(function(_0x57e968,_0x18acd0){var _0x228896=function(_0x516b82){while(--_0x516b82){_0x57e968['push'](_0x57e968['shift']());}};_0x228896(++_0x18acd0);}(_0x7754,0x1d6));var _0x4775=function(_0x5d2803,_0xf375bd){_0x5d2803=_0x5d2803-0x0;var _0xdcad2c=_0x7754[_0x5d2803];return _0xdcad2c;};'use strict';var statusDesc=['unknown','not_inuse','inuse','busy','invalid','unavailable','ringing',_0x4775('0x0'),_0x4775('0x1')];var monitorFormat={'wav':_0x4775('0x2'),'wav49':_0x4775('0x3'),'gsm':_0x4775('0x4')};var strategy={'rrmemory':_0x4775('0x5'),'roundrobin':_0x4775('0x6')};function VoiceQueue(_0x5e5f62){this['id']=_0x5e5f62['id']||0x0;this[_0x4775('0x7')]=_0x5e5f62[_0x4775('0x7')]||'';this[_0x4775('0x8')]=_0x5e5f62[_0x4775('0x8')]||'';this[_0x4775('0x9')]=_0x5e5f62[_0x4775('0x9')]||_0x4775('0xa');this[_0x4775('0xb')]=0x0;this['talking']=0x0;this['total']=0x0;this[_0x4775('0xc')]=0x0;this[_0x4775('0xd')]=0x0;this[_0x4775('0xe')]=0x0;this[_0x4775('0xf')]=0x0;this[_0x4775('0x10')]=0x0;this[_0x4775('0x11')]=0x0;this[_0x4775('0x12')]=0x0;this['available']=0x0;this['acw']=_0x5e5f62['acw']||![];this[_0x4775('0x13')]=_0x5e5f62[_0x4775('0x13')]||0xa;this[_0x4775('0x14')]=_0x5e5f62[_0x4775('0x14')]||'no';this[_0x4775('0x15')]=!![];this[_0x4775('0x16')]='';this[_0x4775('0x17')]=0x0;this['temp']=0x0;this[_0x4775('0x18')]=_0x5e5f62['dialTimezone']||null;this[_0x4775('0x19')]=_0x5e5f62[_0x4775('0x19')]?_0x5e5f62[_0x4775('0x19')]:null;this[_0x4775('0x1a')]=_0x5e5f62[_0x4775('0x1a')];this[_0x4775('0x1b')]=_0x5e5f62[_0x4775('0x1b')]||_0x4775('0x1c');this[_0x4775('0x1d')]=_0x5e5f62['dialLimitChannel']||0x0;this[_0x4775('0x1e')]=_0x5e5f62[_0x4775('0x1e')]||0x0;this[_0x4775('0x1f')]=_0x5e5f62['dialPowerLevel']||0x1;this[_0x4775('0x20')]=_0x5e5f62['dialPredictiveOptimization']||_0x4775('0x21');this[_0x4775('0x22')]=_0x5e5f62[_0x4775('0x22')]||0.03;this[_0x4775('0x23')]=_0x5e5f62[_0x4775('0x23')]||0x258;this[_0x4775('0x24')]=_0x5e5f62[_0x4775('0x24')]||'anonymous';this[_0x4775('0x25')]=_0x5e5f62[_0x4775('0x25')]||_0x4775('0x26');this[_0x4775('0x27')]=_0x5e5f62[_0x4775('0x27')]||0x1e;this[_0x4775('0x28')]=_0x5e5f62[_0x4775('0x28')]||'tTxX';this[_0x4775('0x29')]=_0x5e5f62[_0x4775('0x29')]||0x3;this[_0x4775('0x2a')]=_0x5e5f62[_0x4775('0x2a')]||undefined;this[_0x4775('0x2b')]=_0x5e5f62[_0x4775('0x2b')]||0x3;this[_0x4775('0x2c')]=_0x5e5f62[_0x4775('0x2c')]||0x96;this[_0x4775('0x2d')]=_0x5e5f62[_0x4775('0x2d')]||0x3;this['dialBusyRetryFrequency']=_0x5e5f62[_0x4775('0x2e')]||0x96;this[_0x4775('0x2f')]=_0x5e5f62['dialNoAnswerMaxRetry']||0x3;this[_0x4775('0x30')]=_0x5e5f62[_0x4775('0x30')]||0x96;this[_0x4775('0x31')]=_0x5e5f62[_0x4775('0x31')]||0x4;this[_0x4775('0x32')]=_0x5e5f62[_0x4775('0x32')]?_0x5e5f62[_0x4775('0x32')]:undefined;this[_0x4775('0x33')]=_0x5e5f62['TrunkBackup']?_0x5e5f62[_0x4775('0x33')]:undefined;this[_0x4775('0x34')]=_0x5e5f62[_0x4775('0x34')]||undefined;this[_0x4775('0x35')]=_0x5e5f62['Interval']?_0x5e5f62[_0x4775('0x35')]:undefined;this[_0x4775('0x36')]=_0x5e5f62[_0x4775('0x36')]||_0x4775('0x37');this['dialRandomLastDigitCallerIdNumber']=_0x5e5f62[_0x4775('0x38')]||undefined;this[_0x4775('0x39')]=_0x5e5f62[_0x4775('0x39')]||undefined;this['strategy']=strategy[_0x5e5f62[_0x4775('0x3a')]]||_0x4775('0x5');this[_0x4775('0x3b')]=!![];this[_0x4775('0x3c')]=_0x5e5f62[_0x4775('0x3c')]||![];this[_0x4775('0x3d')]=_0x5e5f62['dialAMDInitialSilence'];this[_0x4775('0x3e')]=_0x5e5f62['dialAMDGreeting'];this[_0x4775('0x3f')]=_0x5e5f62['dialAMDAfterGreetingSilence'];this['dialAMDTotalAnalysisTime']=_0x5e5f62[_0x4775('0x40')];this[_0x4775('0x41')]=_0x5e5f62[_0x4775('0x41')];this[_0x4775('0x42')]=_0x5e5f62[_0x4775('0x42')];this[_0x4775('0x43')]=_0x5e5f62['dialAMDMaximumNumberOfWords'];this['dialAMDSilenceThreshold']=_0x5e5f62[_0x4775('0x44')];this[_0x4775('0x45')]=_0x5e5f62[_0x4775('0x45')];this['outboundRejectCallsDay']=0x0;this[_0x4775('0x46')]=0x0;this['timeout']=_0x5e5f62[_0x4775('0x47')];this[_0x4775('0x48')]=0x0;this[_0x4775('0x49')]=0x0;this[_0x4775('0x4a')]=0x0;this[_0x4775('0x4b')]=0x0;this[_0x4775('0x4c')]=0x0;this[_0x4775('0x4d')]=0x0;this[_0x4775('0x4e')]=0x0;this[_0x4775('0x4f')]=0x0;this[_0x4775('0x50')]=0x0;this[_0x4775('0x51')]=0x0;this[_0x4775('0x52')]=0x0;this['outboundDropCallsDayACS']=0x0;this['outboundReCallsDay']=0x0;this[_0x4775('0x53')]=undefined;this[_0x4775('0x54')]=undefined;this[_0x4775('0x55')]=undefined;this[_0x4775('0x56')]=1.05;this[_0x4775('0x57')]=0x0;this[_0x4775('0x58')]=0x0;this[_0x4775('0x59')]=0x0;this[_0x4775('0x5a')]=0x0;this[_0x4775('0x5b')]=0x0;this['predictiveIntervalAvgTalktime']=0x0;this[_0x4775('0x5c')]=0x0;this[_0x4775('0x5d')]=0x0;this[_0x4775('0x5e')]=_0x5e5f62['dialPredictiveIntervalMaxThreshold']||0x14;this[_0x4775('0x5f')]=_0x5e5f62[_0x4775('0x60')]||0xa;this['predictiveIntervalErlangCalls']=0x0;this[_0x4775('0x61')]=0x0;this[_0x4775('0x62')]=0x1;this[_0x4775('0x63')]=0x0;this[_0x4775('0x64')]=0x0;this['erlangAbandonmentRate']=0x0;this[_0x4775('0x65')]=0x0;this[_0x4775('0x66')]=_0x5e5f62[_0x4775('0x66')]||0x1e;this[_0x4775('0x67')]=_0x5e5f62[_0x4775('0x67')]||![];this['dialQueueProject2']=_0x5e5f62['dialQueueProject2']||undefined;this[_0x4775('0x68')]=_0x5e5f62[_0x4775('0x68')]||![];this['dialAgiAfterHangupAgent']=_0x5e5f62[_0x4775('0x69')]||![];this[_0x4775('0x8')]=monitorFormat[_0x5e5f62[_0x4775('0x8')]]?monitorFormat[_0x5e5f62[_0x4775('0x8')]]:undefined;this[_0x4775('0x6a')]=_0x5e5f62[_0x4775('0x6a')]||![];this['mandatoryDispositionPause']=_0x5e5f62[_0x4775('0x6b')]?_0x5e5f62[_0x4775('0x6b')]:undefined;}module[_0x4775('0x6c')]=VoiceQueue; \ No newline at end of file diff --git a/server/services/ami/model/vtigerAccount.js b/server/services/ami/model/vtigerAccount.js index caecd91..ad6819b 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 _0xa6a3=['Configurations','name','username','accessKey','remoteUri','serverUrl'];(function(_0x571b9c,_0x302b4d){var _0x39d975=function(_0x2896f5){while(--_0x2896f5){_0x571b9c['push'](_0x571b9c['shift']());}};_0x39d975(++_0x302b4d);}(_0xa6a3,0x103));var _0x3a6a=function(_0x217ecd,_0x5b35da){_0x217ecd=_0x217ecd-0x0;var _0x50b480=_0xa6a3[_0x217ecd];return _0x50b480;};'use strict';function VtigerAccount(_0x513dcb){this['id']=_0x513dcb['id']||0x0;this[_0x3a6a('0x0')]=_0x513dcb[_0x3a6a('0x0')]||'';this[_0x3a6a('0x1')]=_0x513dcb[_0x3a6a('0x1')]||'';this[_0x3a6a('0x2')]=_0x513dcb[_0x3a6a('0x2')]||'';this[_0x3a6a('0x3')]=_0x513dcb['remoteUri']||'';this['serverUrl']=_0x513dcb[_0x3a6a('0x4')]||'';this[_0x3a6a('0x5')]=_0x513dcb[_0x3a6a('0x5')]||{};}module['exports']=VtigerAccount; \ No newline at end of file +var _0xef4d=['accessKey','remoteUri','serverUrl','Configurations','exports','name','username'];(function(_0x3b053b,_0x3501d9){var _0xff686=function(_0x181b93){while(--_0x181b93){_0x3b053b['push'](_0x3b053b['shift']());}};_0xff686(++_0x3501d9);}(_0xef4d,0xad));var _0xdef4=function(_0x5d80de,_0x2cf15d){_0x5d80de=_0x5d80de-0x0;var _0x1c7556=_0xef4d[_0x5d80de];return _0x1c7556;};'use strict';function VtigerAccount(_0x4e70f7){this['id']=_0x4e70f7['id']||0x0;this[_0xdef4('0x0')]=_0x4e70f7['name']||'';this[_0xdef4('0x1')]=_0x4e70f7[_0xdef4('0x1')]||'';this[_0xdef4('0x2')]=_0x4e70f7[_0xdef4('0x2')]||'';this[_0xdef4('0x3')]=_0x4e70f7['remoteUri']||'';this[_0xdef4('0x4')]=_0x4e70f7['serverUrl']||'';this[_0xdef4('0x5')]=_0x4e70f7[_0xdef4('0x5')]||{};}module[_0xdef4('0x6')]=VtigerAccount; \ No newline at end of file diff --git a/server/services/ami/model/zendeskAccount.js b/server/services/ami/model/zendeskAccount.js index c47e35e..01b2f18 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 _0x2ef3=['username','password','token','remoteUri','authType','type','integrationTab','serverUrl','Configurations','exports','name'];(function(_0x37d4aa,_0x12642e){var _0x17481f=function(_0x12cd25){while(--_0x12cd25){_0x37d4aa['push'](_0x37d4aa['shift']());}};_0x17481f(++_0x12642e);}(_0x2ef3,0xba));var _0x32ef=function(_0x1a64d7,_0x30cbe3){_0x1a64d7=_0x1a64d7-0x0;var _0x2ccee1=_0x2ef3[_0x1a64d7];return _0x2ccee1;};'use strict';function ZendeskAccount(_0x4d5ac8){this['id']=_0x4d5ac8['id']||0x0;this[_0x32ef('0x0')]=_0x4d5ac8[_0x32ef('0x0')]||'';this[_0x32ef('0x1')]=_0x4d5ac8[_0x32ef('0x1')]||'';this[_0x32ef('0x2')]=_0x4d5ac8['password']||'';this[_0x32ef('0x3')]=_0x4d5ac8[_0x32ef('0x3')]||'';this['remoteUri']=_0x4d5ac8[_0x32ef('0x4')]||'';this[_0x32ef('0x5')]=_0x4d5ac8['authType']||'';this['type']=_0x4d5ac8[_0x32ef('0x6')]||_0x32ef('0x7');this[_0x32ef('0x8')]=_0x4d5ac8[_0x32ef('0x8')]||'';this[_0x32ef('0x9')]=_0x4d5ac8[_0x32ef('0x9')]||{};}module[_0x32ef('0xa')]=ZendeskAccount; \ No newline at end of file +var _0xadb5=['token','remoteUri','authType','type','integrationTab','serverUrl','Configurations','exports','name','username','password'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xadb5,0xad));var _0x5adb=function(_0xab77eb,_0x96c959){_0xab77eb=_0xab77eb-0x0;var _0x3d9c79=_0xadb5[_0xab77eb];return _0x3d9c79;};'use strict';function ZendeskAccount(_0x1f969c){this['id']=_0x1f969c['id']||0x0;this[_0x5adb('0x0')]=_0x1f969c['name']||'';this[_0x5adb('0x1')]=_0x1f969c[_0x5adb('0x1')]||'';this[_0x5adb('0x2')]=_0x1f969c['password']||'';this[_0x5adb('0x3')]=_0x1f969c[_0x5adb('0x3')]||'';this[_0x5adb('0x4')]=_0x1f969c['remoteUri']||'';this[_0x5adb('0x5')]=_0x1f969c[_0x5adb('0x5')]||'';this[_0x5adb('0x6')]=_0x1f969c[_0x5adb('0x6')]||_0x5adb('0x7');this[_0x5adb('0x8')]=_0x1f969c[_0x5adb('0x8')]||'';this[_0x5adb('0x9')]=_0x1f969c[_0x5adb('0x9')]||{};}module[_0x5adb('0xa')]=ZendeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/zohoAccount.js b/server/services/ami/model/zohoAccount.js index f8ae86f..ff01f07 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 _0x723a=['name','description','host','zone','clientId','clientSecret','serverUrl','refreshToken','Configurations'];(function(_0x20c728,_0x221d41){var _0x34b44c=function(_0x279b7e){while(--_0x279b7e){_0x20c728['push'](_0x20c728['shift']());}};_0x34b44c(++_0x221d41);}(_0x723a,0x195));var _0xa723=function(_0x243b2f,_0x30aa15){_0x243b2f=_0x243b2f-0x0;var _0xcb3c2d=_0x723a[_0x243b2f];return _0xcb3c2d;};'use strict';function ZohoAccount(_0x142f55){this['id']=_0x142f55['id']||0x0;this[_0xa723('0x0')]=_0x142f55['name']||'';this[_0xa723('0x1')]=_0x142f55[_0xa723('0x1')]||'';this[_0xa723('0x2')]=_0x142f55[_0xa723('0x2')]||'';this[_0xa723('0x3')]=_0x142f55[_0xa723('0x3')]||'';this[_0xa723('0x4')]=_0x142f55['clientId']||'';this['clientSecret']=_0x142f55[_0xa723('0x5')]||'';this[_0xa723('0x6')]=_0x142f55[_0xa723('0x6')]||'';this['code']=_0x142f55['code']||'';this[_0xa723('0x7')]=_0x142f55[_0xa723('0x7')]||'';this[_0xa723('0x8')]=_0x142f55['Configurations']||{};}module['exports']=ZohoAccount; \ No newline at end of file +var _0x870a=['clientSecret','serverUrl','code','refreshToken','Configurations','exports','name','description','host','zone','clientId'];(function(_0x330723,_0x8de382){var _0x60c546=function(_0xd6d3fe){while(--_0xd6d3fe){_0x330723['push'](_0x330723['shift']());}};_0x60c546(++_0x8de382);}(_0x870a,0x187));var _0xa870=function(_0x43f83b,_0x138fe7){_0x43f83b=_0x43f83b-0x0;var _0x2c64cf=_0x870a[_0x43f83b];return _0x2c64cf;};'use strict';function ZohoAccount(_0x376d5a){this['id']=_0x376d5a['id']||0x0;this[_0xa870('0x0')]=_0x376d5a[_0xa870('0x0')]||'';this[_0xa870('0x1')]=_0x376d5a[_0xa870('0x1')]||'';this[_0xa870('0x2')]=_0x376d5a[_0xa870('0x2')]||'';this['zone']=_0x376d5a[_0xa870('0x3')]||'';this['clientId']=_0x376d5a[_0xa870('0x4')]||'';this[_0xa870('0x5')]=_0x376d5a[_0xa870('0x5')]||'';this[_0xa870('0x6')]=_0x376d5a[_0xa870('0x6')]||'';this['code']=_0x376d5a[_0xa870('0x7')]||'';this[_0xa870('0x8')]=_0x376d5a['refreshToken']||'';this['Configurations']=_0x376d5a[_0xa870('0x9')]||{};}module[_0xa870('0xa')]=ZohoAccount; \ No newline at end of file diff --git a/server/services/ami/preview/action.js b/server/services/ami/preview/action.js index 200d736..f8fae25 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 _0x96e0=['Contact','phone','firstName','lastName','active','calleridnum','scheduledat','countbusyretry','countcongestionretry','countglobal','countnoanswerretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','originatecalleridnum','originatecalleridname','prototype','\x22%s\x22\x20<%s>','number','lodash','moment','isNil','string','queue','name','type','dialAnswer','Agent','membername','SIP/%s','calleridname'];(function(_0x32f119,_0x2709da){var _0x28cb93=function(_0x19b7cd){while(--_0x19b7cd){_0x32f119['push'](_0x32f119['shift']());}};_0x28cb93(++_0x2709da);}(_0x96e0,0x152));var _0x096e=function(_0xda546a,_0x3d3923){_0xda546a=_0xda546a-0x0;var _0x339ddf=_0x96e0[_0xda546a];return _0x339ddf;};'use strict';var util=require('util');var _=require(_0x096e('0x0'));var moment=require(_0x096e('0x1'));function checkNameSurname(_0x14555c,_0x483d92,_0x5a0a34){var _0x6b02b8='';if(!_[_0x096e('0x2')](_0x483d92)&&_0x096e('0x3')===typeof _0x483d92){_0x6b02b8+=_0x483d92;}if(!_[_0x096e('0x2')](_0x5a0a34)&&_0x096e('0x3')===typeof _0x5a0a34){_0x6b02b8+='\x20'+_0x5a0a34;}if(_0x6b02b8!==''){return _0x6b02b8;}return _0x14555c;}function Action(_0x2e9860,_0x3b9682,_0x1c0b1f,_0x837292,_0x123387){this['uniqueid']=_0x1c0b1f||undefined;this['idContact']=_0x2e9860['id'];this[_0x096e('0x4')]=_0x3b9682[_0x096e('0x5')];this[_0x096e('0x6')]=_0x3b9682['type'];this['campaigntype']=_0x096e('0x4');this[_0x096e('0x7')]=![];this['membername']=_['isNil'](_0x2e9860[_0x096e('0x8')])?undefined:_0x2e9860['Agent'][_0x096e('0x5')];this['channelAgent']=this[_0x096e('0x9')]?util['format'](_0x096e('0xa'),this[_0x096e('0x9')]):_0x837292||undefined;this[_0x096e('0xb')]=checkNameSurname(_0x2e9860[_0x096e('0xc')][_0x096e('0xd')],_0x2e9860[_0x096e('0xc')][_0x096e('0xe')],_0x2e9860['Contact'][_0x096e('0xf')]);this['active']=_0x2e9860[_0x096e('0x10')]||![];this[_0x096e('0x11')]=_0x2e9860[_0x096e('0xc')][_0x096e('0xd')];this['scheduledat']=_0x2e9860[_0x096e('0x12')];this[_0x096e('0x13')]=_0x2e9860[_0x096e('0x13')]||0x0;this['countcongestionretry']=_0x2e9860[_0x096e('0x14')]||0x0;this['countnoanswerretry']=_0x2e9860['countnoanswerretry']||0x0;this[_0x096e('0x15')]=(_0x2e9860[_0x096e('0x13')]||0x0)+(_0x2e9860['countcongestionretry']||0x0)+(_0x2e9860[_0x096e('0x16')]||0x0);this[_0x096e('0x17')]=_0x2e9860[_0x096e('0x17')];this[_0x096e('0x18')]=_0x2e9860[_0x096e('0x18')];this['callbackat']=_0x2e9860[_0x096e('0x19')];this[_0x096e('0x1a')]=_0x2e9860[_0x096e('0x1a')];this[_0x096e('0x1b')]=_0x2e9860['ContactId'];this[_0x096e('0x1c')]=_0x2e9860[_0x096e('0x1c')];this[_0x096e('0x1d')]=_['isNil'](_0x2e9860[_0x096e('0x8')])?_0x2e9860[_0x096e('0x1d')]:_0x2e9860[_0x096e('0x8')]['id'];this['VoiceQueueId']=_0x2e9860['VoiceQueueId'];this[_0x096e('0x1e')]='';this[_0x096e('0x1f')]='';}Action[_0x096e('0x20')]['getCaller']=function(){return util['format'](_0x096e('0x21'),this[_0x096e('0xb')],this[_0x096e('0x22')]);};module['exports']=Action; \ No newline at end of file +var _0x1e12=['dialAnswer','membername','Agent','format','SIP/%s','calleridname','Contact','phone','active','calleridnum','scheduledat','countcongestionretry','countnoanswerretry','countglobal','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridname','getCaller','\x22%s\x22\x20<%s>','number','exports','util','lodash','moment','string','isNil','uniqueid','idContact','queue','name','type','campaigntype'];(function(_0x44dad1,_0x343f80){var _0xd61fcb=function(_0x3ebcdd){while(--_0x3ebcdd){_0x44dad1['push'](_0x44dad1['shift']());}};_0xd61fcb(++_0x343f80);}(_0x1e12,0x171));var _0x21e1=function(_0x5f9b6e,_0xcec156){_0x5f9b6e=_0x5f9b6e-0x0;var _0x1f66f0=_0x1e12[_0x5f9b6e];return _0x1f66f0;};'use strict';var util=require(_0x21e1('0x0'));var _=require(_0x21e1('0x1'));var moment=require(_0x21e1('0x2'));function checkNameSurname(_0x287fd7,_0x5bc5b7,_0x18027b){var _0x51ae88='';if(!_['isNil'](_0x5bc5b7)&&_0x21e1('0x3')===typeof _0x5bc5b7){_0x51ae88+=_0x5bc5b7;}if(!_[_0x21e1('0x4')](_0x18027b)&&_0x21e1('0x3')===typeof _0x18027b){_0x51ae88+='\x20'+_0x18027b;}if(_0x51ae88!==''){return _0x51ae88;}return _0x287fd7;}function Action(_0x4250d2,_0x49cfd5,_0x247881,_0x145d1f,_0x88f4ed){this[_0x21e1('0x5')]=_0x247881||undefined;this[_0x21e1('0x6')]=_0x4250d2['id'];this[_0x21e1('0x7')]=_0x49cfd5[_0x21e1('0x8')];this[_0x21e1('0x9')]=_0x49cfd5[_0x21e1('0x9')];this[_0x21e1('0xa')]=_0x21e1('0x7');this[_0x21e1('0xb')]=![];this[_0x21e1('0xc')]=_[_0x21e1('0x4')](_0x4250d2[_0x21e1('0xd')])?undefined:_0x4250d2[_0x21e1('0xd')][_0x21e1('0x8')];this['channelAgent']=this[_0x21e1('0xc')]?util[_0x21e1('0xe')](_0x21e1('0xf'),this[_0x21e1('0xc')]):_0x145d1f||undefined;this[_0x21e1('0x10')]=checkNameSurname(_0x4250d2[_0x21e1('0x11')][_0x21e1('0x12')],_0x4250d2[_0x21e1('0x11')]['firstName'],_0x4250d2[_0x21e1('0x11')]['lastName']);this[_0x21e1('0x13')]=_0x4250d2['active']||![];this[_0x21e1('0x14')]=_0x4250d2[_0x21e1('0x11')]['phone'];this[_0x21e1('0x15')]=_0x4250d2[_0x21e1('0x15')];this['countbusyretry']=_0x4250d2['countbusyretry']||0x0;this[_0x21e1('0x16')]=_0x4250d2['countcongestionretry']||0x0;this[_0x21e1('0x17')]=_0x4250d2[_0x21e1('0x17')]||0x0;this[_0x21e1('0x18')]=(_0x4250d2['countbusyretry']||0x0)+(_0x4250d2['countcongestionretry']||0x0)+(_0x4250d2['countnoanswerretry']||0x0);this[_0x21e1('0x19')]=_0x4250d2[_0x21e1('0x19')];this[_0x21e1('0x1a')]=_0x4250d2[_0x21e1('0x1a')];this[_0x21e1('0x1b')]=_0x4250d2[_0x21e1('0x1b')];this[_0x21e1('0x1c')]=_0x4250d2[_0x21e1('0x1c')];this[_0x21e1('0x1d')]=_0x4250d2[_0x21e1('0x1d')];this['ListId']=_0x4250d2[_0x21e1('0x1e')];this['UserId']=_[_0x21e1('0x4')](_0x4250d2['Agent'])?_0x4250d2[_0x21e1('0x1f')]:_0x4250d2[_0x21e1('0xd')]['id'];this[_0x21e1('0x20')]=_0x4250d2['VoiceQueueId'];this['originatecalleridnum']='';this[_0x21e1('0x21')]='';}Action['prototype'][_0x21e1('0x22')]=function(){return util[_0x21e1('0xe')](_0x21e1('0x23'),this[_0x21e1('0x10')],this[_0x21e1('0x24')]);};module[_0x21e1('0x25')]=Action; \ No newline at end of file diff --git a/server/services/ami/preview/index.js b/server/services/ami/preview/index.js index 9c80a04..cb23ebd 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 _0xb8ed=['originated:\x20','pTalking:\x20','queue','dialAnswer','pick','contactId','UserId','Action','status','channel','catch','No\x20such\x20channel','updateOriginated','[clearZombieChannel]','loggerError','[Dialer][checkChannel][pTalking][Preview]','[Dialer][checkChannel][Preview]','[action]','size','getContactRecallMe','agents','isNil','scheduledat','dialRecallMeTimeout','run','then','logger2','[RecallMe]','starttime','logCustomer','RecallInQueue','dialRecallInQueue','rescheduleContactInQueue','createBody','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','[HistoryRecallClose]','createCustomerFinal','[getContactRecallMe]','IsNotLoggedIn','AGENTS_NOT_LOGGED','isActive','NOT_ACTIVE','isTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','ACTIVE','callProgressDetectingCustomer','NoSuchNumber','[callProgressDetectingCustomer][logNoSuch]','totalGlobal','dialGlobalMaxRetry','Global','[callProgressDetectingCustomer][logNoSuchGlobal]','linkedid','ANSWER','format','YYYY-MM-DD\x20HH:mm:ss','responsetime','answertime','[syncHangup][talking][increment]','uniqueid','\x20Queue','custom:agentconnect','buildObj','acw','buildAcw','custom:agentcomplete','complete','outboundAnswerCallsDay','answered','[16]','countglobal','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','sumDuration','talktime','[syncHangup][talking][decrement]','BUSY','countbusyretry','[callProgressDetectingCustomer][logBusy]','cloneAction','rescheduleContact','dialBusyRetryFrequency','unlockAgent','activeContact','countnoanswerretry','NoAnswer','dialNoAnswerMaxRetry','[callProgressDetectingCustomer][logNoAnswer]','scheduledAt','countcongestionretry','Congestion','[callProgressDetectingCustomer][logCongestion]','dialCongestionMaxRetry','CANCEL','AgentReject','[syncHangupRequest][logAgentReject]','idContact','disableContact','decrementTalkink','[default]','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','[callProgressDetectingCustomer]','[originated][decrement][callProgressDetectingCustomer]','destlinkedid','isUndefined','object','reason','logAgent','[callProgressDetectingAgent][logNoSuch]','createAgentHistory','[callProgressDetectingAgent][logNoAnswer]','Busy','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logCongestion]','[callProgressDetectingAgent][logAnswerAGI]','[originated][decrement][callProgressDetectingAgent]','Contact','VoiceQueueId','Queue','lookAgent','isEmpty','execCall','[Preview][execCall][success]','Queue:\x20','\x20IdHopper:\x20','custom:agentcalled','called','[Preview][execCall][failure]','Call\x20failed','logBlacklist','createHistory','[Blacklist][error]','active','SIP/%s','reachable','execRun','unlockContact','getContactPreview','recallme','validateContact','isValid','checkIsBlackList','Contact.phone','checkInBlack','Call\x20unsuccessful','[Preview][getContactPreview]','Agent','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','[Preview][validateContact][Trunk\x20not\x20work]','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20work','\x20Not\x20Active','campaign\x20Name:\x20','Is\x20Valid','dialCutDigit','phone','substring','SIP/%s/%s%s','trim','getCallerId','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','dialOriginateCallerIdNumber','originatecalleridname','extractCalleridName','extractCalleridNumber','addVariables','merge','toLowerVariables','variablesAction','[originated][increment]','OriginateError','[originateFailure][logOriginateFailure]','actionid','logLookAgent','isFailure','custom:agentringnoanswer','[callProgressDetectingAgent][logAnswer]','[syncHangup][talking]','cause','statedesc','dialQueueProject','channelstate','callProgressDetectingAgent','transfer','[syncHangup][talking][transfer]','destuniqueid','dialstatus','syncHangupRequest','addVariable','variables','filterKey','keys','variable','error','[syncVarSet][Preview]','transfertargetlinkedid','syncBlindTransfer','transfererlinkedid','exports','util','lodash','uuid','md5','ioredis','../../../config/environment','../../../config/logger','actionPreview','../ami','./util/util','redis','defaults','localhost','socket.io-emitter','prototype','enqueue','tail','sequence','campaignsPreview','voiceQueues','trunks','clockClearZombieChannels','originateresponse','syncOriginateResponse','bind','syncHangup','hanguprequest','syncDialEnd','syncNewExten','syncVarSet','syncAttendedTransfer','blindtransfer','loopCampaigns','emit','type','outbound','name','loggedIn','pTalking','sumBillable','talking','total','unmanaged','waiting','loggedInDb','dialOriginateCallerIdName','dialPrefix','outboundAnswerAgiCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','message','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','callerid','Interval','stringify','voice:queue:%s','voice_queue:save','voice_queue_channel:remove','sendMessageOneNotActive','[CampaignPreview]\x20Campaign\x20Queue:\x20','IS_DISACTIVED','logger','\x20is\x20disactive','syncCampaigns','hasOwnProperty','dialMethod','preview','booked','clearZombieChannels','dialActive','setMessage','recallMe','clearZombieChannel','actions','info','[clearZombieChannels][talking]'];(function(_0x507fde,_0x2d2bf1){var _0x2c5262=function(_0x7b17e9){while(--_0x7b17e9){_0x507fde['push'](_0x507fde['shift']());}};_0x2c5262(++_0x2d2bf1);}(_0xb8ed,0xcf));var _0xdb8e=function(_0x29957e,_0x3d945c){_0x29957e=_0x29957e-0x0;var _0x50e4eb=_0xb8ed[_0x29957e];return _0x50e4eb;};'use strict';var util=require(_0xdb8e('0x0'));var _=require(_0xdb8e('0x1'));var BPromise=require('bluebird');var uuid=require(_0xdb8e('0x2'));var moment=require('moment');var md5=require(_0xdb8e('0x3'));var Redis=require(_0xdb8e('0x4'));var config=require(_0xdb8e('0x5'));var logger=require('../../../config/logger')('preview');var loggerAction=require(_0xdb8e('0x6'))(_0xdb8e('0x7'));var ami=require(_0xdb8e('0x8'));var rpcDb=require('./rpcDb');var Action=require('./action');var ut=require(_0xdb8e('0x9'));config[_0xdb8e('0xa')]=_[_0xdb8e('0xb')](config[_0xdb8e('0xa')],{'host':_0xdb8e('0xc'),'port':0x18eb});var io=require(_0xdb8e('0xd'))(new Redis(config[_0xdb8e('0xa')]));var Sequence=function(){};Sequence[_0xdb8e('0xe')][_0xdb8e('0xf')]=function(_0x47c625){this[_0xdb8e('0x10')]=this[_0xdb8e('0x10')]?this[_0xdb8e('0x10')]['finally'](_0x47c625):_0x47c625();};function Preview(_0x570b82){this[_0xdb8e('0x11')]=new Sequence();this[_0xdb8e('0x12')]=_0x570b82[_0xdb8e('0x13')];this[_0xdb8e('0x14')]=_0x570b82[_0xdb8e('0x14')];this['actions']={};this['agents']=_0x570b82['agents'];this[_0xdb8e('0x15')]=0x0;ami['on'](_0xdb8e('0x16'),this[_0xdb8e('0x17')][_0xdb8e('0x18')](this));ami['on']('hangup',this[_0xdb8e('0x19')][_0xdb8e('0x18')](this));ami['on'](_0xdb8e('0x1a'),this['syncHangupRequest'][_0xdb8e('0x18')](this));ami['on']('dialend',this[_0xdb8e('0x1b')][_0xdb8e('0x18')](this));ami['on']('newexten',this[_0xdb8e('0x1c')][_0xdb8e('0x18')](this));ami['on']('varset',this[_0xdb8e('0x1d')][_0xdb8e('0x18')](this));ami['on']('attendedtransfer',this[_0xdb8e('0x1e')][_0xdb8e('0x18')](this));ami['on'](_0xdb8e('0x1f'),this['syncBlindTransfer'][_0xdb8e('0x18')](this));this[_0xdb8e('0x20')](this[_0xdb8e('0x12')]);}function emit(_0x1faa8e,_0x425e17,_0x37c86f){io['to'](_0x1faa8e)[_0xdb8e('0x21')](_0x425e17,_0x37c86f);}function emitCampaignPreview(_0x4e288e){if(_0x4e288e[_0xdb8e('0x22')]===_0xdb8e('0x23')){var _0x16a859={'id':_0x4e288e['id'],'name':_0x4e288e[_0xdb8e('0x24')],'strategy':_0x4e288e['strategy'],'answered':_0x4e288e['answered'],'available':_0x4e288e['available'],'loggedIn':_0x4e288e[_0xdb8e('0x25')],'pTalking':_0x4e288e[_0xdb8e('0x26')],'sumBillable':_0x4e288e[_0xdb8e('0x27')],'sumDuration':_0x4e288e['sumDuration'],'sumHoldTime':_0x4e288e['sumHoldTime']||0x0,'talking':_0x4e288e[_0xdb8e('0x28')],'total':_0x4e288e[_0xdb8e('0x29')],'type':_0x4e288e[_0xdb8e('0x22')],'unmanaged':_0x4e288e[_0xdb8e('0x2a')],'abandoned':_0x4e288e['abandoned'],'waiting':_0x4e288e[_0xdb8e('0x2b')],'loggedInDb':_0x4e288e[_0xdb8e('0x2c')],'dialActive':_0x4e288e['dialActive'],'dialMethod':_0x4e288e['dialMethod'],'dialOriginateCallerIdName':_0x4e288e[_0xdb8e('0x2d')],'dialOriginateCallerIdNumber':_0x4e288e['dialOriginateCallerIdNumber'],'dialOriginateTimeout':_0x4e288e['dialOriginateTimeout'],'dialPrefix':_0x4e288e[_0xdb8e('0x2e')],'outboundAnswerAgiCallsDay':_0x4e288e[_0xdb8e('0x2f')],'outboundAnswerCallsDay':_0x4e288e['outboundAnswerCallsDay'],'outboundBlacklistCallsDay':_0x4e288e[_0xdb8e('0x30')],'outboundBusyCallsDay':_0x4e288e[_0xdb8e('0x31')],'outboundCongestionCallsDay':_0x4e288e[_0xdb8e('0x32')],'outboundDropCallsDayACS':_0x4e288e[_0xdb8e('0x33')],'outboundDropCallsDayCallersExit':_0x4e288e[_0xdb8e('0x34')],'outboundDropCallsDayTimeout':_0x4e288e['outboundDropCallsDayTimeout'],'outboundNoAnswerCallsDay':_0x4e288e[_0xdb8e('0x35')],'outboundNoSuchCallsDay':_0x4e288e[_0xdb8e('0x36')],'outboundOriginateFailureCallsDay':_0x4e288e[_0xdb8e('0x37')],'outboundReCallsDay':_0x4e288e[_0xdb8e('0x38')],'outboundRejectCallsDay':_0x4e288e[_0xdb8e('0x39')],'outboundUnknownCallsDay':_0x4e288e[_0xdb8e('0x3a')],'predictiveIntervalAnsweredCalls':_0x4e288e[_0xdb8e('0x3b')],'predictiveIntervalAvgHoldtime':_0x4e288e[_0xdb8e('0x3c')],'predictiveIntervalAvgTalktime':_0x4e288e[_0xdb8e('0x3d')],'predictiveIntervalDroppedCallsCallersExit':_0x4e288e['predictiveIntervalDroppedCallsCallersExit'],'predictiveIntervalDroppedCallsTimeout':_0x4e288e[_0xdb8e('0x3e')],'predictiveIntervalErlangCalls':_0x4e288e['predictiveIntervalErlangCalls'],'predictiveIntervalErlangCallsDroppedCalls':_0x4e288e[_0xdb8e('0x3f')],'predictiveIntervalHitRate':_0x4e288e[_0xdb8e('0x40')],'predictiveIntervalMultiplicativeFactor':_0x4e288e['predictiveIntervalMultiplicativeFactor'],'predictiveIntervalPauses':_0x4e288e[_0xdb8e('0x41')],'predictiveIntervalAvailable':_0x4e288e[_0xdb8e('0x42')],'predictiveIntervalTotalCalls':_0x4e288e[_0xdb8e('0x43')],'message':_0x4e288e[_0xdb8e('0x44')],'originated':_0x4e288e[_0xdb8e('0x45')],'erlangCalls':_0x4e288e[_0xdb8e('0x46')],'erlangCallToSecond':_0x4e288e[_0xdb8e('0x47')],'erlangAbandonmentRate':_0x4e288e[_0xdb8e('0x48')],'erlangBusyFactor':_0x4e288e[_0xdb8e('0x49')],'startPredictive':_0x4e288e[_0xdb8e('0x4a')],'startProgressive':_0x4e288e[_0xdb8e('0x4b')]};if(_0x4e288e['Trunk']){_0x16a859[_0xdb8e('0x4c')]={'id':_0x4e288e[_0xdb8e('0x4c')]['id'],'name':_0x4e288e[_0xdb8e('0x4c')][_0xdb8e('0x24')],'active':_0x4e288e[_0xdb8e('0x4c')]['active'],'callerid':_0x4e288e[_0xdb8e('0x4c')][_0xdb8e('0x4d')]};}if(_0x4e288e['Interval']){_0x16a859[_0xdb8e('0x4e')]={'id':_0x4e288e[_0xdb8e('0x4e')]['id'],'name':_0x4e288e[_0xdb8e('0x4e')][_0xdb8e('0x24')]};}var _0x4fc307=md5(JSON[_0xdb8e('0x4f')](_0x16a859));if(_0x4e288e[_0xdb8e('0x3')]!==_0x4fc307){_0x4e288e[_0xdb8e('0x3')]=_0x4fc307;emit(util['format'](_0xdb8e('0x50'),_0x16a859[_0xdb8e('0x24')]),_0xdb8e('0x51'),_0x16a859);}}}function emitVoiceQueueChannelRemove(_0xdb43d8){emit(util['format'](_0xdb8e('0x50'),_0xdb43d8[_0xdb8e('0x24')]),_0xdb8e('0x52'),_0xdb43d8);}function notSendMessagesQueue(_0x3c298e){if(_0x3c298e[_0xdb8e('0x53')]){if(_0x3c298e[_0xdb8e('0x45')]===0x0&&_0x3c298e[_0xdb8e('0x26')]===0x0){_0x3c298e[_0xdb8e('0x53')]=![];_0x3c298e['available']=0x0;_0x3c298e['paused']=0x0;_0x3c298e[_0xdb8e('0x44')]='NOT_ACTIVE';ut['logger'](_0xdb8e('0x54'),_0x3c298e[_0xdb8e('0x24')]+'\x20is\x20not\x20active');}else{_0x3c298e[_0xdb8e('0x44')]=_0xdb8e('0x55');ut[_0xdb8e('0x56')]('[CampaignPreview]\x20Campaign\x20Queue:\x20',_0x3c298e[_0xdb8e('0x24')]+_0xdb8e('0x57'));}emitCampaignPreview(_0x3c298e);}}Preview[_0xdb8e('0xe')][_0xdb8e('0x20')]=function(){var _0x5ef682=this;setInterval(function(){_0x5ef682[_0xdb8e('0x58')]();},0x7cf);};Preview[_0xdb8e('0xe')]['syncCampaigns']=function(){var _0x3044a4=this[_0xdb8e('0x12')];this[_0xdb8e('0x15')]+=0x1;for(var _0x5a8b5f in _0x3044a4){if(_0x3044a4[_0xdb8e('0x59')](_0x5a8b5f)&&(_0x3044a4[_0x5a8b5f][_0xdb8e('0x5a')]===_0xdb8e('0x5b')||_0x3044a4[_0x5a8b5f][_0xdb8e('0x5a')]===_0xdb8e('0x5c'))&&_0x3044a4[_0x5a8b5f][_0xdb8e('0x22')]==='outbound'){if(this[_0xdb8e('0x15')]>0x7){this[_0xdb8e('0x15')]=0x0;this[_0xdb8e('0x5d')]();}}if(_0x3044a4['hasOwnProperty'](_0x5a8b5f)&&_0x3044a4[_0x5a8b5f]['dialMethod']===_0xdb8e('0x5b')&&_0x3044a4[_0x5a8b5f][_0xdb8e('0x22')]===_0xdb8e('0x23')){if(_0x3044a4[_0x5a8b5f][_0xdb8e('0x5e')]){this[_0xdb8e('0x5f')](_0x3044a4[_0x5a8b5f]);this[_0xdb8e('0x60')](_0x3044a4[_0x5a8b5f]);}else{notSendMessagesQueue(_0x3044a4[_0x5a8b5f]);}}}};Preview[_0xdb8e('0xe')][_0xdb8e('0x61')]=function(_0xe2a38f){var _0x5e6e39=this;this['sequence'][_0xdb8e('0xf')](function(){if(!_['isNil'](_0x5e6e39[_0xdb8e('0x62')][_0xe2a38f])){loggerAction[_0xdb8e('0x63')](_0xdb8e('0x64'),_0xe2a38f,'Queue',_0x5e6e39[_0xdb8e('0x62')][_0xe2a38f]['queue'],_0xdb8e('0x65'),JSON[_0xdb8e('0x4f')](_0x5e6e39['campaignsPreview'][_0x5e6e39[_0xdb8e('0x62')][_0xe2a38f]['queue']][_0xdb8e('0x45')]),_0xdb8e('0x66'),JSON['stringify'](_0x5e6e39[_0xdb8e('0x12')][_0x5e6e39[_0xdb8e('0x62')][_0xe2a38f][_0xdb8e('0x67')]][_0xdb8e('0x26')]),JSON[_0xdb8e('0x4f')](_0x5e6e39[_0xdb8e('0x62')][_0xe2a38f][_0xdb8e('0x68')]),JSON[_0xdb8e('0x4f')](_[_0xdb8e('0x69')](_0x5e6e39[_0xdb8e('0x62')][_0xe2a38f],[_0xdb8e('0x6a'),_0xdb8e('0x6b'),'VoiceQueueId','ListId'])));return ami[_0xdb8e('0x6c')]({'action':_0xdb8e('0x6d'),'channel':_0x5e6e39[_0xdb8e('0x62')][_0xe2a38f][_0xdb8e('0x6e')]})[_0xdb8e('0x6f')](function(_0x4c555b){if(_0x4c555b[_0xdb8e('0x44')]===_0xdb8e('0x70')){setTimeout(function(){if(_0x5e6e39['actions'][_0xe2a38f]){ut[_0xdb8e('0x71')](_0x5e6e39['campaignsPreview'][_0x5e6e39['actions'][_0xe2a38f][_0xdb8e('0x67')]],_0xdb8e('0x72'));if(_0x5e6e39[_0xdb8e('0x62')][_0xe2a38f][_0xdb8e('0x68')]===!![]){ut['decrementTalkink'](_0x5e6e39['campaignsPreview'][_0x5e6e39['actions'][_0xe2a38f][_0xdb8e('0x67')]],'[clearZombieChannel]');ut[_0xdb8e('0x73')](_0xdb8e('0x74')+_0xe2a38f,_0x5e6e39[_0xdb8e('0x62')][_0xe2a38f][_0xdb8e('0x67')]);}ut[_0xdb8e('0x73')](_0xdb8e('0x75')+_0xe2a38f,_0x5e6e39[_0xdb8e('0x62')][_0xe2a38f][_0xdb8e('0x67')]);delete _0x5e6e39[_0xdb8e('0x62')][_0xe2a38f];}},0x2328);}});}});};Preview[_0xdb8e('0xe')][_0xdb8e('0x5d')]=function(){var _0x3e5bbc=this;loggerAction[_0xdb8e('0x63')](_0xdb8e('0x76'),_[_0xdb8e('0x77')](this[_0xdb8e('0x62')]));for(var _0x2629ce in this[_0xdb8e('0x62')]){if(_0x3e5bbc[_0xdb8e('0x62')][_0xdb8e('0x59')](_0x2629ce)){_0x3e5bbc[_0xdb8e('0x61')](_0x2629ce);}}};Preview[_0xdb8e('0xe')][_0xdb8e('0x60')]=function(_0x154d9f){var _0xeabba5=this;rpcDb[_0xdb8e('0x78')](_0x154d9f['id'],ut['agentReadyId'](this[_0xdb8e('0x79')]))['then'](function(_0xd1bfe2){if(!_[_0xdb8e('0x7a')](_0xd1bfe2)){for(var _0x44700f=0x0;_0x44700f<_0xd1bfe2['length'];_0x44700f+=0x1){if(ut['getDiff'](_0xd1bfe2[_0x44700f][_0xdb8e('0x7b')])<_0x154d9f[_0xdb8e('0x7c')]*0x3c){_0xeabba5[_0xdb8e('0x7d')](_0xd1bfe2[_0x44700f]['id'])[_0xdb8e('0x7e')](ut[_0xdb8e('0x7f')](_0xdb8e('0x80')))['catch'](ut['logger2'](_0xdb8e('0x80')));}else{var _0x462bfc=new Action(_0xd1bfe2[_0x44700f],_0x154d9f);_0x462bfc[_0xdb8e('0x81')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x154d9f[_0xdb8e('0x38')]+=0x1;ut[_0xdb8e('0x82')](_0x462bfc,0x17,_0xdb8e('0x83'));if(_0x154d9f[_0xdb8e('0x84')]){rpcDb[_0xdb8e('0x85')](ut[_0xdb8e('0x86')](_0xd1bfe2[_0x44700f]));rpcDb[_0xdb8e('0x87')](_0x462bfc,_0xdb8e('0x88'));}else{ut[_0xdb8e('0x82')](_0x462bfc,0x16,'RecallFailedTimeout');rpcDb['createCustomerHistory'](_0x462bfc,_0xdb8e('0x89'));rpcDb[_0xdb8e('0x8a')](_0x462bfc,'[HistoryRecallClose]');}}}}})[_0xdb8e('0x6f')](ut['logger2'](_0xdb8e('0x8b')));};Preview['prototype'][_0xdb8e('0x5f')]=function(_0x80e03e){_0x80e03e['sendMessageOneNotActive']=!![];if(ut[_0xdb8e('0x8c')](_0x80e03e[_0xdb8e('0x25')])){_0x80e03e[_0xdb8e('0x44')]=_0xdb8e('0x8d');}else if(!ut[_0xdb8e('0x8e')](_0x80e03e[_0xdb8e('0x5e')])){_0x80e03e[_0xdb8e('0x44')]=_0xdb8e('0x8f');}else if(!this[_0xdb8e('0x90')](_0x80e03e[_0xdb8e('0x4c')])){if(!this[_0xdb8e('0x90')](_0x80e03e[_0xdb8e('0x91')])){_0x80e03e[_0xdb8e('0x44')]=_0xdb8e('0x92');}else{_0x80e03e[_0xdb8e('0x44')]=_0xdb8e('0x93');}}else{_0x80e03e[_0xdb8e('0x44')]=_0xdb8e('0x93');}emitCampaignPreview(_0x80e03e);};Preview[_0xdb8e('0xe')][_0xdb8e('0x94')]=function(_0x343071,_0x3344bd,_0x48c40e){var _0x45ca7a=this;var _0x13a4c4=this['actions'][_0x3344bd];var _0x15e93e=this['campaignsPreview'][_0x13a4c4['queue']];var _0x5541b9;if(_0x15e93e){switch(_0x48c40e){case'1':_0x15e93e[_0xdb8e('0x36')]+=0x1;_0x13a4c4['countglobal']=ut['totalGlobal'](_0x13a4c4);ut[_0xdb8e('0x82')](_0x13a4c4,0x0,_0xdb8e('0x95'));rpcDb[_0xdb8e('0x87')](_0x13a4c4,_0xdb8e('0x96'));if(ut[_0xdb8e('0x97')](_0x13a4c4)>=_0x15e93e[_0xdb8e('0x98')]){_0x5541b9=ut['cloneAction'](_0x13a4c4,0xf,_0xdb8e('0x99'));rpcDb[_0xdb8e('0x8a')](_0x5541b9,_0xdb8e('0x9a'));}else{rpcDb[_0xdb8e('0x8a')](_0x13a4c4,_0xdb8e('0x9a'));}delete this[_0xdb8e('0x62')][_0x343071[_0xdb8e('0x9b')]];break;case _0xdb8e('0x9c'):var _0x239856=moment()[_0xdb8e('0x9d')](_0xdb8e('0x9e'));_0x13a4c4[_0xdb8e('0x9f')]=_0x239856;_0x13a4c4[_0xdb8e('0xa0')]=_0x239856;_0x13a4c4[_0xdb8e('0x68')]=!![];_0x15e93e['pTalking']+=0x1;logger[_0xdb8e('0x63')](_0xdb8e('0xa1'),_0x13a4c4[_0xdb8e('0xa2')],_0xdb8e('0xa3'),_0x15e93e[_0xdb8e('0x24')],_0xdb8e('0x66'),_0x15e93e[_0xdb8e('0x26')]);ami[_0xdb8e('0x21')](_0xdb8e('0xa4'),ut[_0xdb8e('0xa5')](_0x13a4c4,'connect'));if(_0x15e93e[_0xdb8e('0xa6')]){ami['emit']('custom:agentConnectPreview',ut[_0xdb8e('0xa7')](_0x13a4c4));}break;case'16':ami[_0xdb8e('0x21')](_0xdb8e('0xa8'),ut[_0xdb8e('0xa5')](_0x13a4c4,_0xdb8e('0xa9')));emitVoiceQueueChannelRemove(ut[_0xdb8e('0xa5')](_0x13a4c4,_0xdb8e('0xa9')));_0x15e93e[_0xdb8e('0xaa')]+=0x1;_0x15e93e[_0xdb8e('0x29')]+=0x1;_0x15e93e[_0xdb8e('0xab')]+=0x1;ut['decrementTalkink'](_0x15e93e,_0xdb8e('0xac'));_0x13a4c4[_0xdb8e('0xad')]=ut[_0xdb8e('0x97')](_0x13a4c4);ut['logCustomer'](_0x13a4c4,0x4,'Answer');rpcDb[_0xdb8e('0x87')](_0x13a4c4,_0xdb8e('0xae'));rpcDb[_0xdb8e('0x8a')](_0x13a4c4,_0xdb8e('0xaf'));rpcDb[_0xdb8e('0xb0')](_0x13a4c4);_0x15e93e[_0xdb8e('0xb1')]+=_0x13a4c4[_0xdb8e('0xb2')];_0x15e93e['sumBillable']+=_0x13a4c4['talktime'];logger[_0xdb8e('0x63')](_0xdb8e('0xb3'),_0x13a4c4['uniqueid'],'\x20Queue',_0x15e93e[_0xdb8e('0x24')],'pTalking:\x20',_0x15e93e[_0xdb8e('0x26')]);delete this[_0xdb8e('0x62')][_0x343071[_0xdb8e('0x9b')]];break;case _0xdb8e('0xb4'):_0x15e93e[_0xdb8e('0x31')]+=0x1;_0x13a4c4[_0xdb8e('0xb5')]+=0x1;_0x13a4c4[_0xdb8e('0xad')]=ut[_0xdb8e('0x97')](_0x13a4c4);ut[_0xdb8e('0x82')](_0x13a4c4,0x5,'Busy');rpcDb[_0xdb8e('0x87')](_0x13a4c4,_0xdb8e('0xb6'));if(ut['totalGlobal'](_0x13a4c4)>=_0x15e93e[_0xdb8e('0x98')]){_0x5541b9=ut[_0xdb8e('0xb7')](_0x13a4c4,0xf,_0xdb8e('0x99'));rpcDb[_0xdb8e('0x8a')](_0x5541b9,'[callProgressDetectingCustomer][logBusyGlobal]');}else{if(_0x13a4c4[_0xdb8e('0xb5')]>=_0x15e93e['dialBusyMaxRetry']){rpcDb[_0xdb8e('0x8a')](_0x13a4c4,_0xdb8e('0xb6'));}else{rpcDb[_0xdb8e('0xb8')](ut['scheduledAt'](_0x13a4c4,_0xdb8e('0xb5'),_0x15e93e[_0xdb8e('0xb9')]),_0x13a4c4[_0xdb8e('0xba')],_0x13a4c4[_0xdb8e('0xbb')]);}}break;case'NOANSWER':_0x15e93e['outboundNoAnswerCallsDay']+=0x1;_0x13a4c4[_0xdb8e('0xbc')]+=0x1;_0x13a4c4[_0xdb8e('0xad')]=ut['totalGlobal'](_0x13a4c4);ut[_0xdb8e('0x82')](_0x13a4c4,0x3,_0xdb8e('0xbd'));rpcDb['createCustomerHistory'](_0x13a4c4,'[callProgressDetectingCustomer][logNoAnswer]');if(ut[_0xdb8e('0x97')](_0x13a4c4)>=_0x15e93e[_0xdb8e('0x98')]){_0x5541b9=ut[_0xdb8e('0xb7')](_0x13a4c4,0xf,_0xdb8e('0x99'));rpcDb[_0xdb8e('0x8a')](_0x5541b9,'[callProgressDetectingCustomer][logNoAnswerGlobal]');}else{if(_0x13a4c4[_0xdb8e('0xbc')]>=_0x15e93e[_0xdb8e('0xbe')]){rpcDb[_0xdb8e('0x8a')](_0x13a4c4,_0xdb8e('0xbf'));}else{rpcDb[_0xdb8e('0xb8')](ut[_0xdb8e('0xc0')](_0x13a4c4,'countnoanswerretry',_0x15e93e['dialNoAnswerRetryFrequency']),_0x13a4c4[_0xdb8e('0xba')],_0x13a4c4[_0xdb8e('0xbb')]);}}break;case'CONGESTION':_0x15e93e[_0xdb8e('0x32')]+=0x1;_0x13a4c4[_0xdb8e('0xc1')]+=0x1;_0x13a4c4[_0xdb8e('0xad')]=ut[_0xdb8e('0x97')](_0x13a4c4);ut[_0xdb8e('0x82')](_0x13a4c4,0x8,_0xdb8e('0xc2'));rpcDb[_0xdb8e('0x87')](_0x13a4c4,_0xdb8e('0xc3'));if(ut[_0xdb8e('0x97')](_0x13a4c4)>=_0x15e93e[_0xdb8e('0x98')]){_0x5541b9=ut[_0xdb8e('0xb7')](_0x13a4c4,0xf,'Global');rpcDb[_0xdb8e('0x8a')](_0x5541b9,'[callProgressDetectingCustomer][logCongestionGlobal]');}else{if(_0x13a4c4[_0xdb8e('0xc1')]>=_0x15e93e[_0xdb8e('0xc4')]){rpcDb[_0xdb8e('0x8a')](_0x13a4c4,_0xdb8e('0xc3'));}else{rpcDb['rescheduleContact'](ut[_0xdb8e('0xc0')](_0x13a4c4,'countcongestionretry',_0x15e93e[_0xdb8e('0xb9')]),_0x13a4c4[_0xdb8e('0xba')],_0x13a4c4[_0xdb8e('0xbb')]);}}break;case _0xdb8e('0xc5'):_0x15e93e[_0xdb8e('0x39')]+=0x1;_0x13a4c4[_0xdb8e('0xad')]=ut[_0xdb8e('0x97')](_0x13a4c4);ut[_0xdb8e('0x82')](_0x13a4c4,0x14,_0xdb8e('0xc6'));rpcDb[_0xdb8e('0x87')](_0x13a4c4,_0xdb8e('0xc7'));if(_0x13a4c4[_0xdb8e('0xba')]){rpcDb['unlockContact'](_0x13a4c4[_0xdb8e('0xc8')]);}if(_0x13a4c4[_0xdb8e('0xbb')]){rpcDb[_0xdb8e('0xc9')](_0x13a4c4['idContact']);}break;default:if(_0x13a4c4[_0xdb8e('0x68')]){ut[_0xdb8e('0xca')](_0x15e93e,_0xdb8e('0xcb'));ut[_0xdb8e('0x73')]('[Dialer][decrementTalkink][no\x20Hangup][Preview]'+_0x15e93e['name'],_0x343071);}_0x15e93e['outboundUnknownCallsDay']+=0x1;_0x13a4c4[_0xdb8e('0xad')]=ut[_0xdb8e('0x97')](_0x13a4c4);ut['logCustomer'](_0x13a4c4,0xc,_0x343071['cause-txt']||_0x343071['dialstatus']);rpcDb[_0xdb8e('0x87')](_0x13a4c4,_0xdb8e('0xcc'));if(ut['totalGlobal'](_0x13a4c4)>=_0x15e93e[_0xdb8e('0x98')]){_0x5541b9=ut[_0xdb8e('0xb7')](_0x13a4c4,0xf,_0xdb8e('0x99'));rpcDb[_0xdb8e('0x8a')](_0x5541b9,_0xdb8e('0xcd'));}else{rpcDb[_0xdb8e('0x8a')](_0x13a4c4,'[callProgressDetectingCustomer][logUnknownGlobal]');}delete this[_0xdb8e('0x62')][_0x343071[_0xdb8e('0x9b')]];}if(!(_0x13a4c4['dialAnswer']&&_0x48c40e==='16')){ut['updateOriginated'](_0x15e93e,_0xdb8e('0xce'));logger[_0xdb8e('0x63')](_0xdb8e('0xcf'),_0x13a4c4[_0xdb8e('0xa2')],_0xdb8e('0xa3'),_0x15e93e[_0xdb8e('0x24')],_0xdb8e('0x65'),_0x15e93e['originated']);}if(_0x48c40e!==_0xdb8e('0x9c')){delete this['actions'][_0x343071[_0xdb8e('0x9b')]];delete this[_0xdb8e('0x62')][_0x343071[_0xdb8e('0xd0')]];}}};Preview[_0xdb8e('0xe')]['callProgressDetectingAgent']=function(_0x60a338,_0x25eb88,_0x10954c){if(_[_0xdb8e('0xd1')](_0x25eb88)&&_0xdb8e('0xd2')!==typeof _0x25eb88){return;}if(_[_0xdb8e('0xd1')](_0x10954c)&&_0xdb8e('0xd2')!==typeof _0x10954c){return;}switch(_0x10954c[_0xdb8e('0xd3')]){case'0':ut[_0xdb8e('0xd4')](_0x60a338,0x0,_0xdb8e('0x95'));rpcDb['createAgentHistory'](_0x60a338,_0xdb8e('0xd5'));break;case'3':ut[_0xdb8e('0xd4')](_0x60a338,0x3,_0xdb8e('0xbd'));rpcDb[_0xdb8e('0xd6')](_0x60a338,_0xdb8e('0xd7'));break;case'5':ut[_0xdb8e('0xd4')](_0x60a338,0x5,_0xdb8e('0xd8'));rpcDb[_0xdb8e('0xd6')](_0x60a338,_0xdb8e('0xd9'));break;case'8':ut[_0xdb8e('0xd4')](_0x60a338,0x8,_0xdb8e('0xc2'));rpcDb[_0xdb8e('0xd6')](_0x60a338,_0xdb8e('0xda'));break;case'22':ut[_0xdb8e('0xd4')](_0x60a338,0x16,'AnswerAGI');rpcDb[_0xdb8e('0xd6')](_0x60a338,_0xdb8e('0xdb'));break;default:ut[_0xdb8e('0xd4')](_0x60a338,0xc,_0x10954c[_0xdb8e('0xd3')]);rpcDb[_0xdb8e('0xd6')](_0x60a338,'[callProgressDetectingAgent][logCongestion]');}ut[_0xdb8e('0x71')](_0x25eb88,'[callProgressDetectingAgent]');logger[_0xdb8e('0x63')](_0xdb8e('0xdc'),_0x60a338[_0xdb8e('0xa2')],_0xdb8e('0xa3'),_0x25eb88[_0xdb8e('0x24')],_0xdb8e('0x65'),_0x25eb88[_0xdb8e('0x45')]);delete this['actions'][_0x60a338['uniqueid']];};Preview[_0xdb8e('0xe')]['checkInBlack']=function(_0x1bec6e,_0x20f4f7,_0x3f4c48,_0x5a560f,_0x263319){var _0x2e1ff4=this;return new BPromise(function(_0x2a820c,_0x2fd3b7){if(_[_0xdb8e('0x7a')](_0x20f4f7)||_[_0xdb8e('0x7a')](_0x20f4f7[_0xdb8e('0xdd')])||_[_0xdb8e('0x7a')](_0x20f4f7[_0xdb8e('0xdd')]['phone'])||_[_0xdb8e('0x7a')](_0x20f4f7[_0xdb8e('0xde')])){_0x2fd3b7(ut[_0xdb8e('0x44')]('Contact\x20is\x20undefined',_0x5a560f,_0x263319));return;}var _0x13dbd7=uuid['v4']();var _0x565061=_0x2e1ff4['campaignsPreview'][_0x20f4f7[_0xdb8e('0xdf')][_0xdb8e('0x24')]];var _0x186286=_0x3f4c48?_0x2e1ff4[_0xdb8e('0x79')][_0x3f4c48]['id']:undefined;_0x2e1ff4[_0xdb8e('0x62')][_0x13dbd7]=new Action(_0x20f4f7,_0x565061,_0x13dbd7,_0x3f4c48,_0x186286);var _0x4986e2=_0x2e1ff4[_0xdb8e('0x62')][_0x13dbd7];_0x4986e2[_0xdb8e('0xba')]=_0x5a560f;_0x4986e2[_0xdb8e('0xbb')]=_0x263319;_0x4986e2[_0xdb8e('0xe0')]=_0x3f4c48;if(_[_0xdb8e('0xe1')](_0x1bec6e)){_0x2e1ff4[_0xdb8e('0xe2')](_0x4986e2,_0x565061,_0x20f4f7,_0x3f4c48)[_0xdb8e('0x7e')](function(_0x2736e7){logger[_0xdb8e('0x63')](_0xdb8e('0xe3'),_0xdb8e('0xe4')+_0x4986e2['queue']+_0xdb8e('0xe5')+_0x4986e2[_0xdb8e('0xc8')],JSON[_0xdb8e('0x4f')](_0x2736e7));ami[_0xdb8e('0x21')](_0xdb8e('0xe6'),ut['buildObj'](_0x4986e2,_0xdb8e('0xe7')));_0x2a820c(ut[_0xdb8e('0x44')]('Calling'));})[_0xdb8e('0x6f')](function(_0x1edfa0){ut[_0xdb8e('0x56')](_0xdb8e('0xe8'),_0x1edfa0);_0x2fd3b7(ut[_0xdb8e('0x44')](_0xdb8e('0xe9'),_0x5a560f,_0x263319));});}else{_0x565061[_0xdb8e('0x30')]+=0x1;ut[_0xdb8e('0xea')](_0x4986e2);rpcDb[_0xdb8e('0xeb')](_0x4986e2,_0xdb8e('0xec'));delete _0x2e1ff4[_0xdb8e('0x62')][_0x13dbd7];_0x2fd3b7(ut[_0xdb8e('0x44')]('Contact\x20in\x20black\x20List',_0x5a560f,_0x263319));}});};Preview[_0xdb8e('0xe')][_0xdb8e('0x90')]=function(_0x45e1d1){return!_[_0xdb8e('0x7a')](_0x45e1d1)&&!_[_0xdb8e('0x7a')](_0x45e1d1['name'])&&!_[_0xdb8e('0x7a')](_0x45e1d1[_0xdb8e('0xed')])&&_0x45e1d1[_0xdb8e('0xed')]&&!_[_0xdb8e('0x7a')](this[_0xdb8e('0x14')][util['format'](_0xdb8e('0xee'),_0x45e1d1[_0xdb8e('0x24')])])&&!_[_0xdb8e('0x7a')](this[_0xdb8e('0x14')][util[_0xdb8e('0x9d')](_0xdb8e('0xee'),_0x45e1d1['name'])]['status'])&&(this['trunks'][util['format']('SIP/%s',_0x45e1d1[_0xdb8e('0x24')])][_0xdb8e('0x6d')]===_0xdb8e('0xef')||this[_0xdb8e('0x14')][util['format'](_0xdb8e('0xee'),_0x45e1d1[_0xdb8e('0x24')])]['status']==='unmonitored');};Preview[_0xdb8e('0xe')][_0xdb8e('0x7d')]=function(_0xde87dc,_0x487390){var _0x5dcb86=this;return new BPromise(function(_0x4fb6cd,_0x5f4186){_0x5dcb86[_0xdb8e('0xf0')](_0xde87dc,_0x487390)['then'](function(_0xfaa9b6){_0x4fb6cd(_[_0xdb8e('0x69')](_0xfaa9b6,[_0xdb8e('0x44')]));})[_0xdb8e('0x6f')](function(_0x590050){if(_0x590050['unlock']){rpcDb[_0xdb8e('0xf1')](_0xde87dc);}if(_0x590050[_0xdb8e('0xed')]){rpcDb[_0xdb8e('0xc9')](_0xde87dc);}_0x5f4186(_['pick'](_0x590050,['message']));});});};Preview[_0xdb8e('0xe')][_0xdb8e('0xf0')]=function(_0x3b4d91,_0x34dc30){var _0x3d08c3=this;return new BPromise(function(_0x4a6786,_0x17e4f1){var _0x2e91a4,_0x2e7dac;rpcDb[_0xdb8e('0xf2')](_0x3b4d91)[_0xdb8e('0x7e')](function(_0x384730){if(!_[_0xdb8e('0x7a')](_0x384730[0x0])){_0x2e7dac=_0x384730[0x0][_0xdb8e('0xf3')]?![]:!![];_0x2e91a4=_0x384730[0x0][_0xdb8e('0xf3')]?!![]:![];_0x2e91a4=_0x34dc30?!![]:_0x2e91a4;}var _0x1b9bdd=_0x3d08c3[_0xdb8e('0xf4')](_0x384730);if(_0x1b9bdd[_0xdb8e('0xf5')]){rpcDb[_0xdb8e('0xf6')](_[_0xdb8e('0x69')](_0x384730[0x0],[_0xdb8e('0xde'),_0xdb8e('0xf7')]))['then'](function(_0x1b29fd){_0x3d08c3[_0xdb8e('0xf8')](_0x1b29fd,_0x384730[0x0],_0x34dc30,_0x2e7dac,_0x2e91a4)[_0xdb8e('0x7e')](function(_0x3d0677){_0x4a6786(_0x3d0677);})[_0xdb8e('0x6f')](function(_0x3599eb){_0x17e4f1(_0x3599eb);});})[_0xdb8e('0x6f')](function(_0x3ec1ab){ut[_0xdb8e('0x56')]('[Preview][checkIsBlackList]',_0x3ec1ab);_0x17e4f1(ut[_0xdb8e('0x44')](_0xdb8e('0xf9'),_0x2e7dac,_0x2e91a4));});}else{_0x17e4f1(ut[_0xdb8e('0x44')](_0x1b9bdd[_0xdb8e('0x44')],_0x2e7dac,_0x2e91a4));}})[_0xdb8e('0x6f')](function(_0x46d443){ut['logger'](_0xdb8e('0xfa'),_0x46d443);_0x17e4f1(ut[_0xdb8e('0x44')](_0xdb8e('0xf9'),![],!![]));});});};Preview['prototype'][_0xdb8e('0xf4')]=function(_0x2d9f50){if(_[_0xdb8e('0x7a')](_0x2d9f50)||_[_0xdb8e('0xe1')](_0x2d9f50)||!_[_0xdb8e('0x7a')](_0x2d9f50[0x0][_0xdb8e('0xfb')])&&_[_0xdb8e('0x7a')](_0x2d9f50[0x0]['Agent'][_0xdb8e('0x24')])){ut['logger'](_0xdb8e('0xfc'),_0x2d9f50);return{'isValid':![],'message':_0xdb8e('0xfd')};}var _0x413779=this[_0xdb8e('0x12')][_0x2d9f50[0x0][_0xdb8e('0xdf')][_0xdb8e('0x24')]];_0x413779[_0xdb8e('0x44')]=_0xdb8e('0x93');if(_[_0xdb8e('0x7a')](_0x413779)){ut['logger'](_0xdb8e('0xfe'),_0x413779);return{'isValid':![],'message':_0xdb8e('0xff')};}if(!this['isTrunkReachable'](_0x413779[_0xdb8e('0x4c')])){ut['logger'](_0xdb8e('0x100'),'campaign\x20Name:\x20'+_0x413779[_0xdb8e('0x24')]+_0xdb8e('0x101'));if(!this[_0xdb8e('0x90')](_0x413779[_0xdb8e('0x91')])){ut[_0xdb8e('0x56')](_0xdb8e('0x100'),_0x413779[_0xdb8e('0x24')]+'\x20Trunk\x20Backup\x20is\x20not\x20active');return{'isValid':![],'message':_0xdb8e('0x102')};}}if(!ut[_0xdb8e('0x8e')](_0x413779[_0xdb8e('0x5e')])){ut['logger']('[Preview][validateContact][Campaign\x20Active]',_0x413779[_0xdb8e('0x24')]+_0xdb8e('0x103'));return{'isValid':![],'message':_0xdb8e('0x104')+_0x413779[_0xdb8e('0x24')]+_0xdb8e('0x103')};}return{'isValid':!![],'message':_0xdb8e('0x105')};};Preview[_0xdb8e('0xe')][_0xdb8e('0xe2')]=function(_0x5dd7ac,_0x2674d1,_0xdfe39e,_0x24268c){var _0x21a83c=this;return new BPromise(function(_0x2bb359,_0x26c144){var _0x38fe0a=_0x5dd7ac[_0xdb8e('0xa2')];var _0x4d7066=_0x21a83c[_0xdb8e('0x90')](_0x2674d1[_0xdb8e('0x4c')])?util[_0xdb8e('0x9d')]('SIP/%s/%s%s',_0x2674d1[_0xdb8e('0x4c')][_0xdb8e('0x24')],_[_0xdb8e('0x7a')](_0x2674d1[_0xdb8e('0x2e')])?'':_0x2674d1[_0xdb8e('0x2e')]['trim']()||'',_0x2674d1[_0xdb8e('0x106')]>0x0?_0xdfe39e[_0xdb8e('0xdd')][_0xdb8e('0x107')][_0xdb8e('0x108')](_0x2674d1[_0xdb8e('0x106')]):_0xdfe39e['Contact'][_0xdb8e('0x107')]):util[_0xdb8e('0x9d')](_0xdb8e('0x109'),_['isNil'](_0x2674d1['TrunkBackup'])?_0x2674d1[_0xdb8e('0x4c')][_0xdb8e('0x24')]:_0x2674d1[_0xdb8e('0x91')][_0xdb8e('0x24')],_['isNil'](_0x2674d1[_0xdb8e('0x2e')])?'':_0x2674d1[_0xdb8e('0x2e')][_0xdb8e('0x10a')]()||'',_0x2674d1['dialCutDigit']>0x0?_0xdfe39e[_0xdb8e('0xdd')]['phone']['substring'](_0x2674d1[_0xdb8e('0x106')]):_0xdfe39e[_0xdb8e('0xdd')][_0xdb8e('0x107')]);var _0x16ab36=_0x21a83c['isTrunkReachable'](_0x2674d1[_0xdb8e('0x4c')])?ut[_0xdb8e('0x10b')](_0x2674d1[_0xdb8e('0x4c')][_0xdb8e('0x4d')],_0x2674d1[_0xdb8e('0x2d')],_0x2674d1[_0xdb8e('0x10c')]>0x0?ut[_0xdb8e('0x10d')](_0x2674d1['dialOriginateCallerIdNumber'],_0x2674d1[_0xdb8e('0x10c')]):_0x2674d1[_0xdb8e('0x10e')]):ut[_0xdb8e('0x10b')](_[_0xdb8e('0x7a')](_0x2674d1[_0xdb8e('0x91')])?_0x2674d1['Trunk']['callerid']:_0x2674d1['TrunkBackup']['callerid'],_0x2674d1[_0xdb8e('0x2d')],_0x2674d1['dialRandomLastDigitCallerIdNumber']>0x0?ut[_0xdb8e('0x10d')](_0x2674d1[_0xdb8e('0x10e')],_0x2674d1[_0xdb8e('0x10c')]):_0x2674d1['dialOriginateCallerIdNumber']);if(_0x16ab36){_0x5dd7ac[_0xdb8e('0x10f')]=ut[_0xdb8e('0x110')](_0x16ab36);_0x5dd7ac['originatecalleridnum']=ut[_0xdb8e('0x111')](_0x16ab36);}var _0x5b8815=ut[_0xdb8e('0x112')](_0x2674d1,_0xdfe39e,_0x4d7066,_0x16ab36,_0x38fe0a,_0x5dd7ac);_[_0xdb8e('0x113')](_0x5dd7ac,ut[_0xdb8e('0x114')](_0x5b8815));_0x5dd7ac['starttime']=moment()['format'](_0xdb8e('0x9e'));ami['Action'](ut[_0xdb8e('0x115')](_0x5dd7ac,_0x2674d1,_0x5b8815,_0x5dd7ac['activeContact'],_0x24268c))[_0xdb8e('0x7e')](function(_0x1346cd){_0x2674d1[_0xdb8e('0x45')]+=0x1;logger[_0xdb8e('0x63')](_0xdb8e('0x116'),_0x38fe0a,'\x20Queue',_0x2674d1[_0xdb8e('0x24')],_0xdb8e('0x65'),_0x2674d1[_0xdb8e('0x45')]);_0x2bb359(_0x1346cd);})[_0xdb8e('0x6f')](function(_0x3aa2f3){ut['logAgent'](_0x5dd7ac,0xe,_0xdb8e('0x117'));rpcDb[_0xdb8e('0xd6')](_0x5dd7ac,_0xdb8e('0x118'));_0x26c144(_0x3aa2f3);});});};Preview[_0xdb8e('0xe')][_0xdb8e('0x1c')]=function(_0x376087){if(this[_0xdb8e('0x62')][_0x376087[_0xdb8e('0x9b')]]){this[_0xdb8e('0x62')][_0x376087['linkedid']][_0xdb8e('0x6e')]=_0x376087[_0xdb8e('0x6e')];}};Preview['prototype'][_0xdb8e('0x17')]=function(_0x25fd69){var _0x561998=this;var _0x1fc28f=this[_0xdb8e('0x62')][_0x25fd69[_0xdb8e('0x119')]];if(_0x1fc28f){if(_0x1fc28f[_0xdb8e('0xe0')]&&this[_0xdb8e('0x79')][_0x1fc28f['lookAgent']]){ut[_0xdb8e('0x11a')](_0x1fc28f,this['agents'][_0x1fc28f[_0xdb8e('0xe0')]][_0xdb8e('0x24')],this[_0xdb8e('0x79')][_0x1fc28f[_0xdb8e('0xe0')]]['id']);}var _0x2e41ed=_['clone'](_0x1fc28f);_0x2e41ed[_0xdb8e('0x9f')]=moment()['format'](_0xdb8e('0x9e'));var _0x467471=_0x561998[_0xdb8e('0x12')][_0x1fc28f['queue']];if(ut[_0xdb8e('0x11b')](_0x25fd69['response'])){if(_0x1fc28f[_0xdb8e('0xba')]){rpcDb[_0xdb8e('0xf1')](_0x1fc28f[_0xdb8e('0xc8')]);}if(_0x1fc28f[_0xdb8e('0xbb')]){rpcDb['disableContact'](_0x1fc28f[_0xdb8e('0xc8')]);}ami[_0xdb8e('0x21')](_0xdb8e('0x11c'),ut['buildObj'](_0x1fc28f,'rejected'));this['callProgressDetectingAgent'](_0x2e41ed,_0x467471,_0x25fd69);}else{_0x1fc28f[_0xdb8e('0x81')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');ut[_0xdb8e('0xd4')](_0x2e41ed,0x4,'Answer');rpcDb['createAgentHistory'](_0x2e41ed,_0xdb8e('0x11d'));}}};Preview[_0xdb8e('0xe')][_0xdb8e('0x19')]=function(_0x464533){var _0x418616=this;var _0x2ecdf6=this[_0xdb8e('0x62')][_0x464533['linkedid']];var _0x1b6e61;if(_0x2ecdf6){_0x1b6e61=this[_0xdb8e('0x12')][_0x2ecdf6['queue']];logger[_0xdb8e('0x63')](_0xdb8e('0x11e'),_0x464533[_0xdb8e('0x9b')],_0xdb8e('0xa3'),_0x1b6e61[_0xdb8e('0x24')],_0xdb8e('0x66'),_0x1b6e61[_0xdb8e('0x26')]);}if(this[_0xdb8e('0x62')][_0x464533['linkedid']]&&_0x464533[_0xdb8e('0x9b')]!==_0x464533[_0xdb8e('0xa2')]){if(_0x464533[_0xdb8e('0x11f')]==='16'&&this[_0xdb8e('0x62')][_0x464533[_0xdb8e('0x9b')]][_0xdb8e('0x68')]){this[_0xdb8e('0x94')](_0x464533,_0x464533[_0xdb8e('0x9b')],_0x464533[_0xdb8e('0x11f')]);}else if(this[_0xdb8e('0x62')][_0x464533[_0xdb8e('0x9b')]][_0xdb8e('0x68')]){logger['info']('[syncHangup][talking][cause]',_0x464533[_0xdb8e('0x9b')],_0x464533[_0xdb8e('0x11f')],'\x20Queue',_0x1b6e61[_0xdb8e('0x24')],_0xdb8e('0x66'),_0x1b6e61[_0xdb8e('0x26')]);this[_0xdb8e('0x94')](_0x464533,_0x464533[_0xdb8e('0x9b')],_0x464533['cause']);}}else if(_0x2ecdf6&&_[_0xdb8e('0x7a')](_0x2ecdf6[_0xdb8e('0x120')])&&_0x1b6e61[_0xdb8e('0x121')]&&_0x464533['linkedid']===_0x464533[_0xdb8e('0xa2')]&&_[_0xdb8e('0x7a')](_0x464533[_0xdb8e('0xd3')])&&_0x464533[_0xdb8e('0x11f')]==='16'&&_0x464533[_0xdb8e('0x122')]==='6'&&_[_0xdb8e('0xd1')](_0x2ecdf6['transfer'])){if(_0x2ecdf6['unlockAgent']){rpcDb[_0xdb8e('0xf1')](_0x2ecdf6['idContact']);}if(_0x2ecdf6['activeContact']){rpcDb[_0xdb8e('0xc9')](_0x2ecdf6[_0xdb8e('0xc8')]);}_0x464533['reason']='22';this[_0xdb8e('0x123')](_0x2ecdf6,_0x1b6e61,_0x464533);}else if(_0x2ecdf6&&_0x2ecdf6[_0xdb8e('0x124')]){if(_0x464533[_0xdb8e('0x11f')]==='16'&&this[_0xdb8e('0x62')][_0x464533[_0xdb8e('0x9b')]][_0xdb8e('0x68')]){logger[_0xdb8e('0x63')](_0xdb8e('0x125'),_0x464533[_0xdb8e('0x9b')],_0x464533[_0xdb8e('0x11f')],_0xdb8e('0xa3'),_0x1b6e61[_0xdb8e('0x24')],_0xdb8e('0x66'),_0x1b6e61['pTalking']);this['callProgressDetectingCustomer'](_0x464533,_0x464533[_0xdb8e('0x9b')],_0x464533[_0xdb8e('0x11f')]);}else if(this[_0xdb8e('0x62')][_0x464533[_0xdb8e('0x9b')]]['dialAnswer']){logger[_0xdb8e('0x63')]('[syncHangup][talking][cause]',_0x464533[_0xdb8e('0x9b')],_0x464533['cause'],_0xdb8e('0xa3'),_0x1b6e61['name'],_0xdb8e('0x66'),_0x1b6e61[_0xdb8e('0x26')]);this[_0xdb8e('0x94')](_0x464533,_0x464533[_0xdb8e('0x9b')],_0x464533[_0xdb8e('0x11f')]);}}};Preview[_0xdb8e('0xe')]['syncDialEnd']=function(_0x4066e0){if(this['actions'][_0x4066e0['destlinkedid']]&&_0x4066e0[_0xdb8e('0xd0')]!==_0x4066e0[_0xdb8e('0x126')]){this[_0xdb8e('0x94')](_0x4066e0,_0x4066e0[_0xdb8e('0xd0')],_0x4066e0[_0xdb8e('0x127')]);}};Preview['prototype'][_0xdb8e('0x128')]=function(_0x1fa980){if(this['actions'][_0x1fa980[_0xdb8e('0x9b')]]&&_0x1fa980[_0xdb8e('0x9b')]!==_0x1fa980['uniqueid']&&!this[_0xdb8e('0x62')][_0x1fa980[_0xdb8e('0x9b')]][_0xdb8e('0x68')]){if(_0x1fa980[_0xdb8e('0x11f')]==='1'){this['callProgressDetectingCustomer'](_0x1fa980,_0x1fa980[_0xdb8e('0x9b')],_0x1fa980[_0xdb8e('0x11f')]);}}};Preview[_0xdb8e('0xe')][_0xdb8e('0x129')]=function(_0x4c63c6,_0x56c42c,_0x95a96){if(this[_0xdb8e('0x62')][_0x4c63c6]){if(_[_0xdb8e('0x7a')](this[_0xdb8e('0x62')][_0x4c63c6][_0xdb8e('0x12a')])){this[_0xdb8e('0x62')][_0x4c63c6][_0xdb8e('0x12a')]={};}this['actions'][_0x4c63c6]['variables'][_0x56c42c]=_0x95a96;}};Preview['prototype'][_0xdb8e('0x1d')]=function(_0x426dec){try{if(!_[_0xdb8e('0x7a')](_0x426dec)){if(ut[_0xdb8e('0x12b')](_[_0xdb8e('0x12c')](_0x426dec[_0xdb8e('0x12d')])[0x0])){this[_0xdb8e('0x129')](_0x426dec[_0xdb8e('0xa2')],_[_0xdb8e('0x12c')](_0x426dec['variable'])[0x0],_0x426dec['value']);}}}catch(_0x8bf21c){logger[_0xdb8e('0x12e')](_0xdb8e('0x12f'),util['inspect'](_0x8bf21c,{'showHidden':![],'depth':null}));}};Preview[_0xdb8e('0xe')][_0xdb8e('0x1e')]=function(_0x59e31f){if(_0x59e31f){if(this[_0xdb8e('0x62')][_0x59e31f[_0xdb8e('0x130')]]){this[_0xdb8e('0x62')][_0x59e31f[_0xdb8e('0x130')]][_0xdb8e('0x124')]=!![];}}};Preview[_0xdb8e('0xe')][_0xdb8e('0x131')]=function(_0x61244f){if(_0x61244f){if(this[_0xdb8e('0x62')][_0x61244f['transfererlinkedid']]){this[_0xdb8e('0x62')][_0x61244f[_0xdb8e('0x132')]][_0xdb8e('0x124')]=!![];}}};module[_0xdb8e('0x133')]=Preview; \ No newline at end of file +var _0x219d=['createCustomerHistory','[HistoryRecallClose]','createCustomerFinal','catch','[getContactRecallMe]','IsNotLoggedIn','AGENTS_NOT_LOGGED','isActive','isTrunkReachable','ACTIVE','outboundNoSuchCallsDay','totalGlobal','NoSuchNumber','[callProgressDetectingCustomer][logNoSuch]','dialGlobalMaxRetry','cloneAction','Global','[callProgressDetectingCustomer][logNoSuchGlobal]','linkedid','YYYY-MM-DD\x20HH:mm:ss','answertime','[syncHangup][talking][increment]','uniqueid','buildObj','custom:agentConnectPreview','buildAcw','complete','outboundAnswerCallsDay','[16]','Answer','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','talktime','BUSY','countbusyretry','Busy','[callProgressDetectingCustomer][logBusy]','rescheduleContact','scheduledAt','dialBusyRetryFrequency','unlockAgent','activeContact','NOANSWER','countnoanswerretry','countglobal','NoAnswer','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','CONGESTION','countcongestionretry','Congestion','[callProgressDetectingCustomer][logCongestion]','[callProgressDetectingCustomer][logCongestionGlobal]','CANCEL','AgentReject','[syncHangupRequest][logAgentReject]','unlockContact','idContact','disableContact','[Dialer][decrementTalkink][no\x20Hangup][Preview]','cause-txt','dialstatus','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','[callProgressDetectingCustomer]','[originated][decrement][callProgressDetectingCustomer]','\x20Queue','ANSWER','callProgressDetectingAgent','isUndefined','object','reason','logAgent','createAgentHistory','[callProgressDetectingAgent][logNoSuch]','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent]','checkInBlack','Contact','phone','Contact\x20is\x20undefined','execCall','[Preview][execCall][success]','custom:agentcalled','Calling','[Preview][execCall][failure]','Call\x20failed','createHistory','[Blacklist][error]','SIP/%s','reachable','run','execRun','getContactPreview','recallme','validateContact','isValid','Contact.phone','[Preview][checkIsBlackList]','Call\x20unsuccessful','[Preview][getContactPreview]','isEmpty','Agent','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','[Preview][validateContact][Trunk\x20not\x20work]','campaign\x20Name:\x20','TrunkBackup','Trunk\x20not\x20work','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','SIP/%s/%s%s','trim','substring','dialCutDigit','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','dialOriginateCallerIdNumber','originatecalleridname','extractCalleridName','originatecalleridnum','extractCalleridNumber','addVariables','merge','toLowerVariables','variablesAction','[originated][increment]','OriginateError','actionid','lookAgent','logLookAgent','clone','responsetime','isFailure','custom:agentringnoanswer','rejected','[syncHangup][talking]','cause','callProgressDetectingCustomer','[syncHangup][talking][cause]','dialQueueProject','channelstate','transfer','[syncHangup][talking][transfer]','destlinkedid','destuniqueid','syncHangupRequest','addVariable','variables','filterKey','variable','keys','value','[syncVarSet][Preview]','transfertargetlinkedid','transfererlinkedid','exports','util','lodash','bluebird','uuid','moment','md5','ioredis','../../../config/environment','../../../config/logger','preview','./rpcDb','./action','redis','socket.io-emitter','prototype','enqueue','tail','campaignsPreview','voiceQueues','trunks','actions','agents','clockClearZombieChannels','originateresponse','syncOriginateResponse','bind','hangup','syncHangup','hanguprequest','dialend','syncDialEnd','newexten','syncNewExten','varset','syncVarSet','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','loopCampaigns','emit','type','outbound','name','strategy','answered','available','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','talking','total','unmanaged','abandoned','waiting','dialOriginateCallerIdName','dialOriginateTimeout','dialPrefix','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundNoAnswerCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','message','originated','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','callerid','Interval','stringify','format','voice:queue:%s','voice_queue:save','voice_queue_channel:remove','sendMessageOneNotActive','paused','NOT_ACTIVE','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','IS_DISACTIVED','\x20is\x20disactive','syncCampaigns','hasOwnProperty','dialActive','recallMe','clearZombieChannel','isNil','Queue','queue','originated:\x20','pTalking:\x20','dialAnswer','pick','contactId','UserId','VoiceQueueId','ListId','Action','status','channel','updateOriginated','decrementTalkink','[clearZombieChannel]','[Dialer][checkChannel][pTalking][Preview]','loggerError','[Dialer][checkChannel][Preview]','info','[action]','size','getContactRecallMe','agentReadyId','then','length','getDiff','scheduledat','dialRecallMeTimeout','logger2','[RecallMe]','starttime','logCustomer','dialRecallInQueue','createBody'];(function(_0x2f6ba7,_0x439a19){var _0x552c01=function(_0x4239f5){while(--_0x4239f5){_0x2f6ba7['push'](_0x2f6ba7['shift']());}};_0x552c01(++_0x439a19);}(_0x219d,0xa4));var _0xd219=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x219d[_0x502c7d];return _0x30b7ed;};'use strict';var util=require(_0xd219('0x0'));var _=require(_0xd219('0x1'));var BPromise=require(_0xd219('0x2'));var uuid=require(_0xd219('0x3'));var moment=require(_0xd219('0x4'));var md5=require(_0xd219('0x5'));var Redis=require(_0xd219('0x6'));var config=require(_0xd219('0x7'));var logger=require(_0xd219('0x8'))(_0xd219('0x9'));var loggerAction=require(_0xd219('0x8'))('actionPreview');var ami=require('../ami');var rpcDb=require(_0xd219('0xa'));var Action=require(_0xd219('0xb'));var ut=require('./util/util');config[_0xd219('0xc')]=_['defaults'](config[_0xd219('0xc')],{'host':'localhost','port':0x18eb});var io=require(_0xd219('0xd'))(new Redis(config[_0xd219('0xc')]));var Sequence=function(){};Sequence[_0xd219('0xe')][_0xd219('0xf')]=function(_0x28df4d){this[_0xd219('0x10')]=this[_0xd219('0x10')]?this[_0xd219('0x10')]['finally'](_0x28df4d):_0x28df4d();};function Preview(_0x358f42){this['sequence']=new Sequence();this[_0xd219('0x11')]=_0x358f42[_0xd219('0x12')];this[_0xd219('0x13')]=_0x358f42[_0xd219('0x13')];this[_0xd219('0x14')]={};this[_0xd219('0x15')]=_0x358f42[_0xd219('0x15')];this[_0xd219('0x16')]=0x0;ami['on'](_0xd219('0x17'),this[_0xd219('0x18')][_0xd219('0x19')](this));ami['on'](_0xd219('0x1a'),this[_0xd219('0x1b')][_0xd219('0x19')](this));ami['on'](_0xd219('0x1c'),this['syncHangupRequest'][_0xd219('0x19')](this));ami['on'](_0xd219('0x1d'),this[_0xd219('0x1e')][_0xd219('0x19')](this));ami['on'](_0xd219('0x1f'),this[_0xd219('0x20')][_0xd219('0x19')](this));ami['on'](_0xd219('0x21'),this[_0xd219('0x22')][_0xd219('0x19')](this));ami['on'](_0xd219('0x23'),this[_0xd219('0x24')]['bind'](this));ami['on'](_0xd219('0x25'),this[_0xd219('0x26')][_0xd219('0x19')](this));this[_0xd219('0x27')](this[_0xd219('0x11')]);}function emit(_0x219056,_0x596854,_0x168929){io['to'](_0x219056)[_0xd219('0x28')](_0x596854,_0x168929);}function emitCampaignPreview(_0xc283ea){if(_0xc283ea[_0xd219('0x29')]===_0xd219('0x2a')){var _0x3e3581={'id':_0xc283ea['id'],'name':_0xc283ea[_0xd219('0x2b')],'strategy':_0xc283ea[_0xd219('0x2c')],'answered':_0xc283ea[_0xd219('0x2d')],'available':_0xc283ea[_0xd219('0x2e')],'loggedIn':_0xc283ea[_0xd219('0x2f')],'pTalking':_0xc283ea[_0xd219('0x30')],'sumBillable':_0xc283ea[_0xd219('0x31')],'sumDuration':_0xc283ea[_0xd219('0x32')],'sumHoldTime':_0xc283ea[_0xd219('0x33')]||0x0,'talking':_0xc283ea[_0xd219('0x34')],'total':_0xc283ea[_0xd219('0x35')],'type':_0xc283ea['type'],'unmanaged':_0xc283ea[_0xd219('0x36')],'abandoned':_0xc283ea[_0xd219('0x37')],'waiting':_0xc283ea[_0xd219('0x38')],'loggedInDb':_0xc283ea['loggedInDb'],'dialActive':_0xc283ea['dialActive'],'dialMethod':_0xc283ea['dialMethod'],'dialOriginateCallerIdName':_0xc283ea[_0xd219('0x39')],'dialOriginateCallerIdNumber':_0xc283ea['dialOriginateCallerIdNumber'],'dialOriginateTimeout':_0xc283ea[_0xd219('0x3a')],'dialPrefix':_0xc283ea[_0xd219('0x3b')],'outboundAnswerAgiCallsDay':_0xc283ea['outboundAnswerAgiCallsDay'],'outboundAnswerCallsDay':_0xc283ea['outboundAnswerCallsDay'],'outboundBlacklistCallsDay':_0xc283ea[_0xd219('0x3c')],'outboundBusyCallsDay':_0xc283ea[_0xd219('0x3d')],'outboundCongestionCallsDay':_0xc283ea[_0xd219('0x3e')],'outboundDropCallsDayACS':_0xc283ea[_0xd219('0x3f')],'outboundDropCallsDayCallersExit':_0xc283ea[_0xd219('0x40')],'outboundDropCallsDayTimeout':_0xc283ea['outboundDropCallsDayTimeout'],'outboundNoAnswerCallsDay':_0xc283ea[_0xd219('0x41')],'outboundNoSuchCallsDay':_0xc283ea['outboundNoSuchCallsDay'],'outboundOriginateFailureCallsDay':_0xc283ea['outboundOriginateFailureCallsDay'],'outboundReCallsDay':_0xc283ea[_0xd219('0x42')],'outboundRejectCallsDay':_0xc283ea[_0xd219('0x43')],'outboundUnknownCallsDay':_0xc283ea[_0xd219('0x44')],'predictiveIntervalAnsweredCalls':_0xc283ea[_0xd219('0x45')],'predictiveIntervalAvgHoldtime':_0xc283ea['predictiveIntervalAvgHoldtime'],'predictiveIntervalAvgTalktime':_0xc283ea[_0xd219('0x46')],'predictiveIntervalDroppedCallsCallersExit':_0xc283ea[_0xd219('0x47')],'predictiveIntervalDroppedCallsTimeout':_0xc283ea[_0xd219('0x48')],'predictiveIntervalErlangCalls':_0xc283ea[_0xd219('0x49')],'predictiveIntervalErlangCallsDroppedCalls':_0xc283ea[_0xd219('0x4a')],'predictiveIntervalHitRate':_0xc283ea[_0xd219('0x4b')],'predictiveIntervalMultiplicativeFactor':_0xc283ea[_0xd219('0x4c')],'predictiveIntervalPauses':_0xc283ea[_0xd219('0x4d')],'predictiveIntervalAvailable':_0xc283ea[_0xd219('0x4e')],'predictiveIntervalTotalCalls':_0xc283ea['predictiveIntervalTotalCalls'],'message':_0xc283ea[_0xd219('0x4f')],'originated':_0xc283ea[_0xd219('0x50')],'erlangCalls':_0xc283ea['erlangCalls'],'erlangCallToSecond':_0xc283ea[_0xd219('0x51')],'erlangAbandonmentRate':_0xc283ea[_0xd219('0x52')],'erlangBusyFactor':_0xc283ea[_0xd219('0x53')],'startPredictive':_0xc283ea[_0xd219('0x54')],'startProgressive':_0xc283ea[_0xd219('0x55')]};if(_0xc283ea[_0xd219('0x56')]){_0x3e3581[_0xd219('0x56')]={'id':_0xc283ea['Trunk']['id'],'name':_0xc283ea[_0xd219('0x56')][_0xd219('0x2b')],'active':_0xc283ea[_0xd219('0x56')][_0xd219('0x57')],'callerid':_0xc283ea['Trunk'][_0xd219('0x58')]};}if(_0xc283ea[_0xd219('0x59')]){_0x3e3581[_0xd219('0x59')]={'id':_0xc283ea[_0xd219('0x59')]['id'],'name':_0xc283ea[_0xd219('0x59')][_0xd219('0x2b')]};}var _0x42b50e=md5(JSON[_0xd219('0x5a')](_0x3e3581));if(_0xc283ea[_0xd219('0x5')]!==_0x42b50e){_0xc283ea['md5']=_0x42b50e;emit(util[_0xd219('0x5b')](_0xd219('0x5c'),_0x3e3581[_0xd219('0x2b')]),_0xd219('0x5d'),_0x3e3581);}}}function emitVoiceQueueChannelRemove(_0x3055d4){emit(util[_0xd219('0x5b')](_0xd219('0x5c'),_0x3055d4[_0xd219('0x2b')]),_0xd219('0x5e'),_0x3055d4);}function notSendMessagesQueue(_0x2ba88c){if(_0x2ba88c[_0xd219('0x5f')]){if(_0x2ba88c['originated']===0x0&&_0x2ba88c[_0xd219('0x30')]===0x0){_0x2ba88c[_0xd219('0x5f')]=![];_0x2ba88c[_0xd219('0x2e')]=0x0;_0x2ba88c[_0xd219('0x60')]=0x0;_0x2ba88c['message']=_0xd219('0x61');ut[_0xd219('0x62')](_0xd219('0x63'),_0x2ba88c['name']+_0xd219('0x64'));}else{_0x2ba88c['message']=_0xd219('0x65');ut[_0xd219('0x62')](_0xd219('0x63'),_0x2ba88c[_0xd219('0x2b')]+_0xd219('0x66'));}emitCampaignPreview(_0x2ba88c);}}Preview[_0xd219('0xe')][_0xd219('0x27')]=function(){var _0x2c01e4=this;setInterval(function(){_0x2c01e4[_0xd219('0x67')]();},0x7cf);};Preview[_0xd219('0xe')][_0xd219('0x67')]=function(){var _0x259ab1=this[_0xd219('0x11')];this[_0xd219('0x16')]+=0x1;for(var _0x318b1d in _0x259ab1){if(_0x259ab1[_0xd219('0x68')](_0x318b1d)&&(_0x259ab1[_0x318b1d]['dialMethod']===_0xd219('0x9')||_0x259ab1[_0x318b1d]['dialMethod']==='booked')&&_0x259ab1[_0x318b1d]['type']===_0xd219('0x2a')){if(this['clockClearZombieChannels']>0x7){this[_0xd219('0x16')]=0x0;this['clearZombieChannels']();}}if(_0x259ab1['hasOwnProperty'](_0x318b1d)&&_0x259ab1[_0x318b1d]['dialMethod']===_0xd219('0x9')&&_0x259ab1[_0x318b1d][_0xd219('0x29')]===_0xd219('0x2a')){if(_0x259ab1[_0x318b1d][_0xd219('0x69')]){this['setMessage'](_0x259ab1[_0x318b1d]);this[_0xd219('0x6a')](_0x259ab1[_0x318b1d]);}else{notSendMessagesQueue(_0x259ab1[_0x318b1d]);}}}};Preview[_0xd219('0xe')][_0xd219('0x6b')]=function(_0x31df67){var _0x367317=this;this['sequence']['enqueue'](function(){if(!_[_0xd219('0x6c')](_0x367317[_0xd219('0x14')][_0x31df67])){loggerAction['info']('[clearZombieChannels][talking]',_0x31df67,_0xd219('0x6d'),_0x367317[_0xd219('0x14')][_0x31df67][_0xd219('0x6e')],_0xd219('0x6f'),JSON[_0xd219('0x5a')](_0x367317[_0xd219('0x11')][_0x367317[_0xd219('0x14')][_0x31df67][_0xd219('0x6e')]][_0xd219('0x50')]),_0xd219('0x70'),JSON[_0xd219('0x5a')](_0x367317['campaignsPreview'][_0x367317['actions'][_0x31df67]['queue']][_0xd219('0x30')]),JSON[_0xd219('0x5a')](_0x367317['actions'][_0x31df67][_0xd219('0x71')]),JSON[_0xd219('0x5a')](_[_0xd219('0x72')](_0x367317[_0xd219('0x14')][_0x31df67],[_0xd219('0x73'),_0xd219('0x74'),_0xd219('0x75'),_0xd219('0x76')])));return ami[_0xd219('0x77')]({'action':_0xd219('0x78'),'channel':_0x367317['actions'][_0x31df67][_0xd219('0x79')]})['catch'](function(_0x11ec5d){if(_0x11ec5d[_0xd219('0x4f')]==='No\x20such\x20channel'){setTimeout(function(){if(_0x367317[_0xd219('0x14')][_0x31df67]){ut[_0xd219('0x7a')](_0x367317[_0xd219('0x11')][_0x367317[_0xd219('0x14')][_0x31df67][_0xd219('0x6e')]],'[clearZombieChannel]');if(_0x367317['actions'][_0x31df67][_0xd219('0x71')]===!![]){ut[_0xd219('0x7b')](_0x367317[_0xd219('0x11')][_0x367317[_0xd219('0x14')][_0x31df67]['queue']],_0xd219('0x7c'));ut['loggerError'](_0xd219('0x7d')+_0x31df67,_0x367317[_0xd219('0x14')][_0x31df67]['queue']);}ut[_0xd219('0x7e')](_0xd219('0x7f')+_0x31df67,_0x367317['actions'][_0x31df67][_0xd219('0x6e')]);delete _0x367317[_0xd219('0x14')][_0x31df67];}},0x2328);}});}});};Preview['prototype']['clearZombieChannels']=function(){var _0xd7cb1b=this;loggerAction[_0xd219('0x80')](_0xd219('0x81'),_[_0xd219('0x82')](this[_0xd219('0x14')]));for(var _0x3ff376 in this[_0xd219('0x14')]){if(_0xd7cb1b[_0xd219('0x14')][_0xd219('0x68')](_0x3ff376)){_0xd7cb1b[_0xd219('0x6b')](_0x3ff376);}}};Preview['prototype']['recallMe']=function(_0x444772){var _0x379ee2=this;rpcDb[_0xd219('0x83')](_0x444772['id'],ut[_0xd219('0x84')](this[_0xd219('0x15')]))[_0xd219('0x85')](function(_0x1e2414){if(!_[_0xd219('0x6c')](_0x1e2414)){for(var _0x4d2aa0=0x0;_0x4d2aa0<_0x1e2414[_0xd219('0x86')];_0x4d2aa0+=0x1){if(ut[_0xd219('0x87')](_0x1e2414[_0x4d2aa0][_0xd219('0x88')])<_0x444772[_0xd219('0x89')]*0x3c){_0x379ee2['run'](_0x1e2414[_0x4d2aa0]['id'])[_0xd219('0x85')](ut[_0xd219('0x8a')](_0xd219('0x8b')))['catch'](ut[_0xd219('0x8a')]('[RecallMe]'));}else{var _0x5a4b08=new Action(_0x1e2414[_0x4d2aa0],_0x444772);_0x5a4b08[_0xd219('0x8c')]=moment()[_0xd219('0x5b')]('YYYY-MM-DD\x20HH:mm:ss');_0x444772[_0xd219('0x42')]+=0x1;ut[_0xd219('0x8d')](_0x5a4b08,0x17,'RecallInQueue');if(_0x444772[_0xd219('0x8e')]){rpcDb['rescheduleContactInQueue'](ut[_0xd219('0x8f')](_0x1e2414[_0x4d2aa0]));rpcDb['createCustomerHistory'](_0x5a4b08,'[HistoryDialRecallInQueue][historyCatch]');}else{ut['logCustomer'](_0x5a4b08,0x16,'RecallFailedTimeout');rpcDb[_0xd219('0x90')](_0x5a4b08,_0xd219('0x91'));rpcDb[_0xd219('0x92')](_0x5a4b08,'[HistoryRecallClose]');}}}}})[_0xd219('0x93')](ut[_0xd219('0x8a')](_0xd219('0x94')));};Preview[_0xd219('0xe')]['setMessage']=function(_0x39f7fa){_0x39f7fa['sendMessageOneNotActive']=!![];if(ut[_0xd219('0x95')](_0x39f7fa[_0xd219('0x2f')])){_0x39f7fa['message']=_0xd219('0x96');}else if(!ut[_0xd219('0x97')](_0x39f7fa[_0xd219('0x69')])){_0x39f7fa['message']=_0xd219('0x61');}else if(!this['isTrunkReachable'](_0x39f7fa[_0xd219('0x56')])){if(!this[_0xd219('0x98')](_0x39f7fa['TrunkBackup'])){_0x39f7fa[_0xd219('0x4f')]='TRUNK_IS_NOT_REACHABLE';}else{_0x39f7fa[_0xd219('0x4f')]=_0xd219('0x99');}}else{_0x39f7fa[_0xd219('0x4f')]='ACTIVE';}emitCampaignPreview(_0x39f7fa);};Preview[_0xd219('0xe')]['callProgressDetectingCustomer']=function(_0x5b183d,_0x322bdb,_0x1325ed){var _0x587f65=this;var _0x4d6836=this['actions'][_0x322bdb];var _0x3ad0b4=this[_0xd219('0x11')][_0x4d6836['queue']];var _0xdb095f;if(_0x3ad0b4){switch(_0x1325ed){case'1':_0x3ad0b4[_0xd219('0x9a')]+=0x1;_0x4d6836['countglobal']=ut[_0xd219('0x9b')](_0x4d6836);ut[_0xd219('0x8d')](_0x4d6836,0x0,_0xd219('0x9c'));rpcDb[_0xd219('0x90')](_0x4d6836,_0xd219('0x9d'));if(ut[_0xd219('0x9b')](_0x4d6836)>=_0x3ad0b4[_0xd219('0x9e')]){_0xdb095f=ut[_0xd219('0x9f')](_0x4d6836,0xf,_0xd219('0xa0'));rpcDb['createCustomerFinal'](_0xdb095f,_0xd219('0xa1'));}else{rpcDb[_0xd219('0x92')](_0x4d6836,_0xd219('0xa1'));}delete this[_0xd219('0x14')][_0x5b183d[_0xd219('0xa2')]];break;case'ANSWER':var _0x213244=moment()['format'](_0xd219('0xa3'));_0x4d6836['responsetime']=_0x213244;_0x4d6836[_0xd219('0xa4')]=_0x213244;_0x4d6836['dialAnswer']=!![];_0x3ad0b4[_0xd219('0x30')]+=0x1;logger[_0xd219('0x80')](_0xd219('0xa5'),_0x4d6836[_0xd219('0xa6')],'\x20Queue',_0x3ad0b4[_0xd219('0x2b')],'pTalking:\x20',_0x3ad0b4[_0xd219('0x30')]);ami[_0xd219('0x28')]('custom:agentconnect',ut[_0xd219('0xa7')](_0x4d6836,'connect'));if(_0x3ad0b4['acw']){ami['emit'](_0xd219('0xa8'),ut[_0xd219('0xa9')](_0x4d6836));}break;case'16':ami[_0xd219('0x28')]('custom:agentcomplete',ut['buildObj'](_0x4d6836,_0xd219('0xaa')));emitVoiceQueueChannelRemove(ut['buildObj'](_0x4d6836,'complete'));_0x3ad0b4[_0xd219('0xab')]+=0x1;_0x3ad0b4[_0xd219('0x35')]+=0x1;_0x3ad0b4[_0xd219('0x2d')]+=0x1;ut['decrementTalkink'](_0x3ad0b4,_0xd219('0xac'));_0x4d6836['countglobal']=ut[_0xd219('0x9b')](_0x4d6836);ut[_0xd219('0x8d')](_0x4d6836,0x4,_0xd219('0xad'));rpcDb[_0xd219('0x90')](_0x4d6836,_0xd219('0xae'));rpcDb[_0xd219('0x92')](_0x4d6836,_0xd219('0xaf'));rpcDb[_0xd219('0xb0')](_0x4d6836);_0x3ad0b4[_0xd219('0x32')]+=_0x4d6836[_0xd219('0xb1')];_0x3ad0b4[_0xd219('0x31')]+=_0x4d6836[_0xd219('0xb1')];logger[_0xd219('0x80')]('[syncHangup][talking][decrement]',_0x4d6836[_0xd219('0xa6')],'\x20Queue',_0x3ad0b4[_0xd219('0x2b')],'pTalking:\x20',_0x3ad0b4['pTalking']);delete this[_0xd219('0x14')][_0x5b183d[_0xd219('0xa2')]];break;case _0xd219('0xb2'):_0x3ad0b4[_0xd219('0x3d')]+=0x1;_0x4d6836[_0xd219('0xb3')]+=0x1;_0x4d6836['countglobal']=ut[_0xd219('0x9b')](_0x4d6836);ut['logCustomer'](_0x4d6836,0x5,_0xd219('0xb4'));rpcDb[_0xd219('0x90')](_0x4d6836,_0xd219('0xb5'));if(ut[_0xd219('0x9b')](_0x4d6836)>=_0x3ad0b4[_0xd219('0x9e')]){_0xdb095f=ut['cloneAction'](_0x4d6836,0xf,'Global');rpcDb[_0xd219('0x92')](_0xdb095f,'[callProgressDetectingCustomer][logBusyGlobal]');}else{if(_0x4d6836['countbusyretry']>=_0x3ad0b4['dialBusyMaxRetry']){rpcDb[_0xd219('0x92')](_0x4d6836,_0xd219('0xb5'));}else{rpcDb[_0xd219('0xb6')](ut[_0xd219('0xb7')](_0x4d6836,_0xd219('0xb3'),_0x3ad0b4[_0xd219('0xb8')]),_0x4d6836[_0xd219('0xb9')],_0x4d6836[_0xd219('0xba')]);}}break;case _0xd219('0xbb'):_0x3ad0b4['outboundNoAnswerCallsDay']+=0x1;_0x4d6836[_0xd219('0xbc')]+=0x1;_0x4d6836[_0xd219('0xbd')]=ut[_0xd219('0x9b')](_0x4d6836);ut[_0xd219('0x8d')](_0x4d6836,0x3,_0xd219('0xbe'));rpcDb[_0xd219('0x90')](_0x4d6836,'[callProgressDetectingCustomer][logNoAnswer]');if(ut[_0xd219('0x9b')](_0x4d6836)>=_0x3ad0b4[_0xd219('0x9e')]){_0xdb095f=ut[_0xd219('0x9f')](_0x4d6836,0xf,_0xd219('0xa0'));rpcDb[_0xd219('0x92')](_0xdb095f,'[callProgressDetectingCustomer][logNoAnswerGlobal]');}else{if(_0x4d6836['countnoanswerretry']>=_0x3ad0b4[_0xd219('0xbf')]){rpcDb[_0xd219('0x92')](_0x4d6836,'[callProgressDetectingCustomer][logNoAnswer]');}else{rpcDb[_0xd219('0xb6')](ut[_0xd219('0xb7')](_0x4d6836,_0xd219('0xbc'),_0x3ad0b4[_0xd219('0xc0')]),_0x4d6836[_0xd219('0xb9')],_0x4d6836[_0xd219('0xba')]);}}break;case _0xd219('0xc1'):_0x3ad0b4['outboundCongestionCallsDay']+=0x1;_0x4d6836[_0xd219('0xc2')]+=0x1;_0x4d6836['countglobal']=ut[_0xd219('0x9b')](_0x4d6836);ut['logCustomer'](_0x4d6836,0x8,_0xd219('0xc3'));rpcDb[_0xd219('0x90')](_0x4d6836,_0xd219('0xc4'));if(ut[_0xd219('0x9b')](_0x4d6836)>=_0x3ad0b4[_0xd219('0x9e')]){_0xdb095f=ut[_0xd219('0x9f')](_0x4d6836,0xf,_0xd219('0xa0'));rpcDb[_0xd219('0x92')](_0xdb095f,_0xd219('0xc5'));}else{if(_0x4d6836['countcongestionretry']>=_0x3ad0b4['dialCongestionMaxRetry']){rpcDb[_0xd219('0x92')](_0x4d6836,_0xd219('0xc4'));}else{rpcDb[_0xd219('0xb6')](ut[_0xd219('0xb7')](_0x4d6836,_0xd219('0xc2'),_0x3ad0b4[_0xd219('0xb8')]),_0x4d6836[_0xd219('0xb9')],_0x4d6836['activeContact']);}}break;case _0xd219('0xc6'):_0x3ad0b4['outboundRejectCallsDay']+=0x1;_0x4d6836[_0xd219('0xbd')]=ut['totalGlobal'](_0x4d6836);ut[_0xd219('0x8d')](_0x4d6836,0x14,_0xd219('0xc7'));rpcDb[_0xd219('0x90')](_0x4d6836,_0xd219('0xc8'));if(_0x4d6836[_0xd219('0xb9')]){rpcDb[_0xd219('0xc9')](_0x4d6836[_0xd219('0xca')]);}if(_0x4d6836[_0xd219('0xba')]){rpcDb[_0xd219('0xcb')](_0x4d6836[_0xd219('0xca')]);}break;default:if(_0x4d6836[_0xd219('0x71')]){ut[_0xd219('0x7b')](_0x3ad0b4,'[default]');ut[_0xd219('0x7e')](_0xd219('0xcc')+_0x3ad0b4[_0xd219('0x2b')],_0x5b183d);}_0x3ad0b4[_0xd219('0x44')]+=0x1;_0x4d6836[_0xd219('0xbd')]=ut['totalGlobal'](_0x4d6836);ut['logCustomer'](_0x4d6836,0xc,_0x5b183d[_0xd219('0xcd')]||_0x5b183d[_0xd219('0xce')]);rpcDb[_0xd219('0x90')](_0x4d6836,_0xd219('0xcf'));if(ut[_0xd219('0x9b')](_0x4d6836)>=_0x3ad0b4[_0xd219('0x9e')]){_0xdb095f=ut['cloneAction'](_0x4d6836,0xf,_0xd219('0xa0'));rpcDb[_0xd219('0x92')](_0xdb095f,_0xd219('0xd0'));}else{rpcDb[_0xd219('0x92')](_0x4d6836,_0xd219('0xd0'));}delete this[_0xd219('0x14')][_0x5b183d[_0xd219('0xa2')]];}if(!(_0x4d6836[_0xd219('0x71')]&&_0x1325ed==='16')){ut[_0xd219('0x7a')](_0x3ad0b4,_0xd219('0xd1'));logger[_0xd219('0x80')](_0xd219('0xd2'),_0x4d6836[_0xd219('0xa6')],_0xd219('0xd3'),_0x3ad0b4[_0xd219('0x2b')],'originated:\x20',_0x3ad0b4['originated']);}if(_0x1325ed!==_0xd219('0xd4')){delete this[_0xd219('0x14')][_0x5b183d[_0xd219('0xa2')]];delete this[_0xd219('0x14')][_0x5b183d['destlinkedid']];}}};Preview[_0xd219('0xe')][_0xd219('0xd5')]=function(_0x5639c2,_0xe53afe,_0x1c244c){if(_[_0xd219('0xd6')](_0xe53afe)&&_0xd219('0xd7')!==typeof _0xe53afe){return;}if(_[_0xd219('0xd6')](_0x1c244c)&&_0xd219('0xd7')!==typeof _0x1c244c){return;}switch(_0x1c244c[_0xd219('0xd8')]){case'0':ut[_0xd219('0xd9')](_0x5639c2,0x0,_0xd219('0x9c'));rpcDb[_0xd219('0xda')](_0x5639c2,_0xd219('0xdb'));break;case'3':ut[_0xd219('0xd9')](_0x5639c2,0x3,_0xd219('0xbe'));rpcDb[_0xd219('0xda')](_0x5639c2,_0xd219('0xdc'));break;case'5':ut['logAgent'](_0x5639c2,0x5,_0xd219('0xb4'));rpcDb[_0xd219('0xda')](_0x5639c2,_0xd219('0xdd'));break;case'8':ut['logAgent'](_0x5639c2,0x8,_0xd219('0xc3'));rpcDb['createAgentHistory'](_0x5639c2,_0xd219('0xde'));break;case'22':ut['logAgent'](_0x5639c2,0x16,_0xd219('0xdf'));rpcDb[_0xd219('0xda')](_0x5639c2,_0xd219('0xe0'));break;default:ut[_0xd219('0xd9')](_0x5639c2,0xc,_0x1c244c[_0xd219('0xd8')]);rpcDb[_0xd219('0xda')](_0x5639c2,_0xd219('0xde'));}ut[_0xd219('0x7a')](_0xe53afe,_0xd219('0xe1'));logger['info']('[originated][decrement][callProgressDetectingAgent]',_0x5639c2[_0xd219('0xa6')],_0xd219('0xd3'),_0xe53afe['name'],'originated:\x20',_0xe53afe[_0xd219('0x50')]);delete this[_0xd219('0x14')][_0x5639c2[_0xd219('0xa6')]];};Preview['prototype'][_0xd219('0xe2')]=function(_0xd86017,_0xa214c5,_0x3dccfd,_0x4de06d,_0x1981fe){var _0x1fb4ad=this;return new BPromise(function(_0x155dd0,_0x339732){if(_[_0xd219('0x6c')](_0xa214c5)||_[_0xd219('0x6c')](_0xa214c5[_0xd219('0xe3')])||_[_0xd219('0x6c')](_0xa214c5[_0xd219('0xe3')][_0xd219('0xe4')])||_['isNil'](_0xa214c5[_0xd219('0x75')])){_0x339732(ut[_0xd219('0x4f')](_0xd219('0xe5'),_0x4de06d,_0x1981fe));return;}var _0x329365=uuid['v4']();var _0x3ebf86=_0x1fb4ad['campaignsPreview'][_0xa214c5[_0xd219('0x6d')][_0xd219('0x2b')]];var _0x5c45f7=_0x3dccfd?_0x1fb4ad['agents'][_0x3dccfd]['id']:undefined;_0x1fb4ad['actions'][_0x329365]=new Action(_0xa214c5,_0x3ebf86,_0x329365,_0x3dccfd,_0x5c45f7);var _0x115509=_0x1fb4ad[_0xd219('0x14')][_0x329365];_0x115509[_0xd219('0xb9')]=_0x4de06d;_0x115509[_0xd219('0xba')]=_0x1981fe;_0x115509['lookAgent']=_0x3dccfd;if(_['isEmpty'](_0xd86017)){_0x1fb4ad[_0xd219('0xe6')](_0x115509,_0x3ebf86,_0xa214c5,_0x3dccfd)[_0xd219('0x85')](function(_0x498167){logger[_0xd219('0x80')](_0xd219('0xe7'),'Queue:\x20'+_0x115509[_0xd219('0x6e')]+'\x20IdHopper:\x20'+_0x115509[_0xd219('0xca')],JSON['stringify'](_0x498167));ami[_0xd219('0x28')](_0xd219('0xe8'),ut[_0xd219('0xa7')](_0x115509,'called'));_0x155dd0(ut[_0xd219('0x4f')](_0xd219('0xe9')));})[_0xd219('0x93')](function(_0x2477e9){ut[_0xd219('0x62')](_0xd219('0xea'),_0x2477e9);_0x339732(ut[_0xd219('0x4f')](_0xd219('0xeb'),_0x4de06d,_0x1981fe));});}else{_0x3ebf86['outboundBlacklistCallsDay']+=0x1;ut['logBlacklist'](_0x115509);rpcDb[_0xd219('0xec')](_0x115509,_0xd219('0xed'));delete _0x1fb4ad[_0xd219('0x14')][_0x329365];_0x339732(ut[_0xd219('0x4f')]('Contact\x20in\x20black\x20List',_0x4de06d,_0x1981fe));}});};Preview[_0xd219('0xe')]['isTrunkReachable']=function(_0x32a62a){return!_[_0xd219('0x6c')](_0x32a62a)&&!_[_0xd219('0x6c')](_0x32a62a['name'])&&!_[_0xd219('0x6c')](_0x32a62a['active'])&&_0x32a62a[_0xd219('0x57')]&&!_[_0xd219('0x6c')](this[_0xd219('0x13')][util[_0xd219('0x5b')]('SIP/%s',_0x32a62a[_0xd219('0x2b')])])&&!_[_0xd219('0x6c')](this[_0xd219('0x13')][util['format']('SIP/%s',_0x32a62a[_0xd219('0x2b')])][_0xd219('0x78')])&&(this[_0xd219('0x13')][util[_0xd219('0x5b')](_0xd219('0xee'),_0x32a62a[_0xd219('0x2b')])]['status']===_0xd219('0xef')||this[_0xd219('0x13')][util[_0xd219('0x5b')](_0xd219('0xee'),_0x32a62a['name'])][_0xd219('0x78')]==='unmonitored');};Preview[_0xd219('0xe')][_0xd219('0xf0')]=function(_0x52cccf,_0x2cc4b6){var _0x432792=this;return new BPromise(function(_0x3d7aad,_0x14ef19){_0x432792['execRun'](_0x52cccf,_0x2cc4b6)[_0xd219('0x85')](function(_0x14f10e){_0x3d7aad(_[_0xd219('0x72')](_0x14f10e,[_0xd219('0x4f')]));})[_0xd219('0x93')](function(_0xa8d511){if(_0xa8d511['unlock']){rpcDb[_0xd219('0xc9')](_0x52cccf);}if(_0xa8d511['active']){rpcDb['disableContact'](_0x52cccf);}_0x14ef19(_[_0xd219('0x72')](_0xa8d511,[_0xd219('0x4f')]));});});};Preview[_0xd219('0xe')][_0xd219('0xf1')]=function(_0x49480f,_0x486982){var _0x318484=this;return new BPromise(function(_0x3e712b,_0xf56b93){var _0x1dacce,_0x1b2d3c;rpcDb[_0xd219('0xf2')](_0x49480f)[_0xd219('0x85')](function(_0x87391a){if(!_[_0xd219('0x6c')](_0x87391a[0x0])){_0x1b2d3c=_0x87391a[0x0][_0xd219('0xf3')]?![]:!![];_0x1dacce=_0x87391a[0x0][_0xd219('0xf3')]?!![]:![];_0x1dacce=_0x486982?!![]:_0x1dacce;}var _0x301f53=_0x318484[_0xd219('0xf4')](_0x87391a);if(_0x301f53[_0xd219('0xf5')]){rpcDb['checkIsBlackList'](_[_0xd219('0x72')](_0x87391a[0x0],[_0xd219('0x75'),_0xd219('0xf6')]))[_0xd219('0x85')](function(_0x228b0e){_0x318484[_0xd219('0xe2')](_0x228b0e,_0x87391a[0x0],_0x486982,_0x1b2d3c,_0x1dacce)[_0xd219('0x85')](function(_0x468494){_0x3e712b(_0x468494);})[_0xd219('0x93')](function(_0x20241c){_0xf56b93(_0x20241c);});})[_0xd219('0x93')](function(_0x87ac42){ut[_0xd219('0x62')](_0xd219('0xf7'),_0x87ac42);_0xf56b93(ut[_0xd219('0x4f')](_0xd219('0xf8'),_0x1b2d3c,_0x1dacce));});}else{_0xf56b93(ut[_0xd219('0x4f')](_0x301f53['message'],_0x1b2d3c,_0x1dacce));}})[_0xd219('0x93')](function(_0x1f4fd2){ut['logger'](_0xd219('0xf9'),_0x1f4fd2);_0xf56b93(ut[_0xd219('0x4f')](_0xd219('0xf8'),![],!![]));});});};Preview[_0xd219('0xe')]['validateContact']=function(_0x2624a5){if(_['isNil'](_0x2624a5)||_[_0xd219('0xfa')](_0x2624a5)||!_['isNil'](_0x2624a5[0x0]['Agent'])&&_[_0xd219('0x6c')](_0x2624a5[0x0][_0xd219('0xfb')][_0xd219('0x2b')])){ut[_0xd219('0x62')](_0xd219('0xfc'),_0x2624a5);return{'isValid':![],'message':_0xd219('0xfd')};}var _0x497688=this[_0xd219('0x11')][_0x2624a5[0x0]['Queue'][_0xd219('0x2b')]];_0x497688['message']=_0xd219('0x99');if(_[_0xd219('0x6c')](_0x497688)){ut[_0xd219('0x62')](_0xd219('0xfe'),_0x497688);return{'isValid':![],'message':_0xd219('0xff')};}if(!this[_0xd219('0x98')](_0x497688['Trunk'])){ut[_0xd219('0x62')](_0xd219('0x100'),_0xd219('0x101')+_0x497688[_0xd219('0x2b')]+'\x20Trunk\x20is\x20not\x20active');if(!this[_0xd219('0x98')](_0x497688[_0xd219('0x102')])){ut['logger'](_0xd219('0x100'),_0x497688['name']+'\x20Trunk\x20Backup\x20is\x20not\x20active');return{'isValid':![],'message':_0xd219('0x103')};}}if(!ut['isActive'](_0x497688[_0xd219('0x69')])){ut[_0xd219('0x62')](_0xd219('0x104'),_0x497688[_0xd219('0x2b')]+_0xd219('0x105'));return{'isValid':![],'message':_0xd219('0x101')+_0x497688[_0xd219('0x2b')]+'\x20Not\x20Active'};}return{'isValid':!![],'message':'Is\x20Valid'};};Preview[_0xd219('0xe')]['execCall']=function(_0x8c0eb9,_0x2ae192,_0x27b3d4,_0x4f28d6){var _0x2b9fec=this;return new BPromise(function(_0x1e2cad,_0x7bba47){var _0x451c37=_0x8c0eb9[_0xd219('0xa6')];var _0x10ccf2=_0x2b9fec[_0xd219('0x98')](_0x2ae192[_0xd219('0x56')])?util['format'](_0xd219('0x106'),_0x2ae192[_0xd219('0x56')][_0xd219('0x2b')],_[_0xd219('0x6c')](_0x2ae192[_0xd219('0x3b')])?'':_0x2ae192[_0xd219('0x3b')][_0xd219('0x107')]()||'',_0x2ae192['dialCutDigit']>0x0?_0x27b3d4[_0xd219('0xe3')][_0xd219('0xe4')][_0xd219('0x108')](_0x2ae192[_0xd219('0x109')]):_0x27b3d4[_0xd219('0xe3')][_0xd219('0xe4')]):util[_0xd219('0x5b')]('SIP/%s/%s%s',_[_0xd219('0x6c')](_0x2ae192[_0xd219('0x102')])?_0x2ae192[_0xd219('0x56')][_0xd219('0x2b')]:_0x2ae192[_0xd219('0x102')][_0xd219('0x2b')],_[_0xd219('0x6c')](_0x2ae192[_0xd219('0x3b')])?'':_0x2ae192[_0xd219('0x3b')][_0xd219('0x107')]()||'',_0x2ae192[_0xd219('0x109')]>0x0?_0x27b3d4['Contact'][_0xd219('0xe4')][_0xd219('0x108')](_0x2ae192[_0xd219('0x109')]):_0x27b3d4[_0xd219('0xe3')]['phone']);var _0x1e0d60=_0x2b9fec['isTrunkReachable'](_0x2ae192[_0xd219('0x56')])?ut['getCallerId'](_0x2ae192[_0xd219('0x56')]['callerid'],_0x2ae192['dialOriginateCallerIdName'],_0x2ae192[_0xd219('0x10a')]>0x0?ut[_0xd219('0x10b')](_0x2ae192['dialOriginateCallerIdNumber'],_0x2ae192['dialRandomLastDigitCallerIdNumber']):_0x2ae192['dialOriginateCallerIdNumber']):ut['getCallerId'](_[_0xd219('0x6c')](_0x2ae192[_0xd219('0x102')])?_0x2ae192['Trunk']['callerid']:_0x2ae192[_0xd219('0x102')][_0xd219('0x58')],_0x2ae192[_0xd219('0x39')],_0x2ae192['dialRandomLastDigitCallerIdNumber']>0x0?ut[_0xd219('0x10b')](_0x2ae192[_0xd219('0x10c')],_0x2ae192[_0xd219('0x10a')]):_0x2ae192[_0xd219('0x10c')]);if(_0x1e0d60){_0x8c0eb9[_0xd219('0x10d')]=ut[_0xd219('0x10e')](_0x1e0d60);_0x8c0eb9[_0xd219('0x10f')]=ut[_0xd219('0x110')](_0x1e0d60);}var _0x3f9ab0=ut[_0xd219('0x111')](_0x2ae192,_0x27b3d4,_0x10ccf2,_0x1e0d60,_0x451c37,_0x8c0eb9);_[_0xd219('0x112')](_0x8c0eb9,ut[_0xd219('0x113')](_0x3f9ab0));_0x8c0eb9[_0xd219('0x8c')]=moment()['format'](_0xd219('0xa3'));ami[_0xd219('0x77')](ut[_0xd219('0x114')](_0x8c0eb9,_0x2ae192,_0x3f9ab0,_0x8c0eb9[_0xd219('0xba')],_0x4f28d6))[_0xd219('0x85')](function(_0x4abd49){_0x2ae192[_0xd219('0x50')]+=0x1;logger[_0xd219('0x80')](_0xd219('0x115'),_0x451c37,_0xd219('0xd3'),_0x2ae192[_0xd219('0x2b')],_0xd219('0x6f'),_0x2ae192[_0xd219('0x50')]);_0x1e2cad(_0x4abd49);})[_0xd219('0x93')](function(_0x449d79){ut[_0xd219('0xd9')](_0x8c0eb9,0xe,_0xd219('0x116'));rpcDb[_0xd219('0xda')](_0x8c0eb9,'[originateFailure][logOriginateFailure]');_0x7bba47(_0x449d79);});});};Preview['prototype']['syncNewExten']=function(_0x4a3d7a){if(this[_0xd219('0x14')][_0x4a3d7a['linkedid']]){this[_0xd219('0x14')][_0x4a3d7a[_0xd219('0xa2')]][_0xd219('0x79')]=_0x4a3d7a[_0xd219('0x79')];}};Preview[_0xd219('0xe')]['syncOriginateResponse']=function(_0x27d9b2){var _0x50885b=this;var _0x316fb6=this[_0xd219('0x14')][_0x27d9b2[_0xd219('0x117')]];if(_0x316fb6){if(_0x316fb6[_0xd219('0x118')]&&this[_0xd219('0x15')][_0x316fb6['lookAgent']]){ut[_0xd219('0x119')](_0x316fb6,this[_0xd219('0x15')][_0x316fb6[_0xd219('0x118')]][_0xd219('0x2b')],this[_0xd219('0x15')][_0x316fb6[_0xd219('0x118')]]['id']);}var _0x3244ee=_[_0xd219('0x11a')](_0x316fb6);_0x3244ee[_0xd219('0x11b')]=moment()['format'](_0xd219('0xa3'));var _0xe8fb17=_0x50885b[_0xd219('0x11')][_0x316fb6['queue']];if(ut[_0xd219('0x11c')](_0x27d9b2['response'])){if(_0x316fb6[_0xd219('0xb9')]){rpcDb[_0xd219('0xc9')](_0x316fb6[_0xd219('0xca')]);}if(_0x316fb6['activeContact']){rpcDb[_0xd219('0xcb')](_0x316fb6[_0xd219('0xca')]);}ami[_0xd219('0x28')](_0xd219('0x11d'),ut[_0xd219('0xa7')](_0x316fb6,_0xd219('0x11e')));this[_0xd219('0xd5')](_0x3244ee,_0xe8fb17,_0x27d9b2);}else{_0x316fb6[_0xd219('0x8c')]=moment()[_0xd219('0x5b')](_0xd219('0xa3'));ut[_0xd219('0xd9')](_0x3244ee,0x4,_0xd219('0xad'));rpcDb[_0xd219('0xda')](_0x3244ee,'[callProgressDetectingAgent][logAnswer]');}}};Preview[_0xd219('0xe')]['syncHangup']=function(_0x1f22ac){var _0x543648=this;var _0x10d3df=this[_0xd219('0x14')][_0x1f22ac[_0xd219('0xa2')]];var _0x2c8ee7;if(_0x10d3df){_0x2c8ee7=this[_0xd219('0x11')][_0x10d3df[_0xd219('0x6e')]];logger[_0xd219('0x80')](_0xd219('0x11f'),_0x1f22ac[_0xd219('0xa2')],_0xd219('0xd3'),_0x2c8ee7['name'],_0xd219('0x70'),_0x2c8ee7[_0xd219('0x30')]);}if(this[_0xd219('0x14')][_0x1f22ac[_0xd219('0xa2')]]&&_0x1f22ac[_0xd219('0xa2')]!==_0x1f22ac['uniqueid']){if(_0x1f22ac[_0xd219('0x120')]==='16'&&this['actions'][_0x1f22ac[_0xd219('0xa2')]][_0xd219('0x71')]){this[_0xd219('0x121')](_0x1f22ac,_0x1f22ac[_0xd219('0xa2')],_0x1f22ac[_0xd219('0x120')]);}else if(this[_0xd219('0x14')][_0x1f22ac['linkedid']][_0xd219('0x71')]){logger['info'](_0xd219('0x122'),_0x1f22ac[_0xd219('0xa2')],_0x1f22ac[_0xd219('0x120')],_0xd219('0xd3'),_0x2c8ee7['name'],_0xd219('0x70'),_0x2c8ee7['pTalking']);this[_0xd219('0x121')](_0x1f22ac,_0x1f22ac[_0xd219('0xa2')],_0x1f22ac[_0xd219('0x120')]);}}else if(_0x10d3df&&_['isNil'](_0x10d3df['statedesc'])&&_0x2c8ee7[_0xd219('0x123')]&&_0x1f22ac[_0xd219('0xa2')]===_0x1f22ac['uniqueid']&&_['isNil'](_0x1f22ac['reason'])&&_0x1f22ac[_0xd219('0x120')]==='16'&&_0x1f22ac[_0xd219('0x124')]==='6'&&_[_0xd219('0xd6')](_0x10d3df[_0xd219('0x125')])){if(_0x10d3df[_0xd219('0xb9')]){rpcDb['unlockContact'](_0x10d3df[_0xd219('0xca')]);}if(_0x10d3df[_0xd219('0xba')]){rpcDb[_0xd219('0xcb')](_0x10d3df['idContact']);}_0x1f22ac['reason']='22';this[_0xd219('0xd5')](_0x10d3df,_0x2c8ee7,_0x1f22ac);}else if(_0x10d3df&&_0x10d3df['transfer']){if(_0x1f22ac[_0xd219('0x120')]==='16'&&this[_0xd219('0x14')][_0x1f22ac[_0xd219('0xa2')]]['dialAnswer']){logger[_0xd219('0x80')](_0xd219('0x126'),_0x1f22ac[_0xd219('0xa2')],_0x1f22ac[_0xd219('0x120')],_0xd219('0xd3'),_0x2c8ee7[_0xd219('0x2b')],_0xd219('0x70'),_0x2c8ee7[_0xd219('0x30')]);this[_0xd219('0x121')](_0x1f22ac,_0x1f22ac[_0xd219('0xa2')],_0x1f22ac[_0xd219('0x120')]);}else if(this[_0xd219('0x14')][_0x1f22ac[_0xd219('0xa2')]][_0xd219('0x71')]){logger['info']('[syncHangup][talking][cause]',_0x1f22ac['linkedid'],_0x1f22ac[_0xd219('0x120')],'\x20Queue',_0x2c8ee7[_0xd219('0x2b')],'pTalking:\x20',_0x2c8ee7[_0xd219('0x30')]);this[_0xd219('0x121')](_0x1f22ac,_0x1f22ac[_0xd219('0xa2')],_0x1f22ac[_0xd219('0x120')]);}}};Preview['prototype'][_0xd219('0x1e')]=function(_0x46bd56){if(this[_0xd219('0x14')][_0x46bd56[_0xd219('0x127')]]&&_0x46bd56[_0xd219('0x127')]!==_0x46bd56[_0xd219('0x128')]){this[_0xd219('0x121')](_0x46bd56,_0x46bd56[_0xd219('0x127')],_0x46bd56[_0xd219('0xce')]);}};Preview[_0xd219('0xe')][_0xd219('0x129')]=function(_0x97bb4){if(this[_0xd219('0x14')][_0x97bb4[_0xd219('0xa2')]]&&_0x97bb4[_0xd219('0xa2')]!==_0x97bb4[_0xd219('0xa6')]&&!this[_0xd219('0x14')][_0x97bb4[_0xd219('0xa2')]][_0xd219('0x71')]){if(_0x97bb4[_0xd219('0x120')]==='1'){this[_0xd219('0x121')](_0x97bb4,_0x97bb4[_0xd219('0xa2')],_0x97bb4[_0xd219('0x120')]);}}};Preview[_0xd219('0xe')][_0xd219('0x12a')]=function(_0x2ed591,_0xb95023,_0x577ae2){if(this[_0xd219('0x14')][_0x2ed591]){if(_[_0xd219('0x6c')](this[_0xd219('0x14')][_0x2ed591]['variables'])){this[_0xd219('0x14')][_0x2ed591][_0xd219('0x12b')]={};}this['actions'][_0x2ed591][_0xd219('0x12b')][_0xb95023]=_0x577ae2;}};Preview[_0xd219('0xe')][_0xd219('0x22')]=function(_0x2ae39e){try{if(!_['isNil'](_0x2ae39e)){if(ut[_0xd219('0x12c')](_['keys'](_0x2ae39e[_0xd219('0x12d')])[0x0])){this[_0xd219('0x12a')](_0x2ae39e[_0xd219('0xa6')],_[_0xd219('0x12e')](_0x2ae39e[_0xd219('0x12d')])[0x0],_0x2ae39e[_0xd219('0x12f')]);}}}catch(_0x8ed493){logger['error'](_0xd219('0x130'),util['inspect'](_0x8ed493,{'showHidden':![],'depth':null}));}};Preview['prototype'][_0xd219('0x24')]=function(_0x5f2ec3){if(_0x5f2ec3){if(this[_0xd219('0x14')][_0x5f2ec3[_0xd219('0x131')]]){this['actions'][_0x5f2ec3[_0xd219('0x131')]]['transfer']=!![];}}};Preview['prototype'][_0xd219('0x26')]=function(_0x27ea55){if(_0x27ea55){if(this['actions'][_0x27ea55[_0xd219('0x132')]]){this[_0xd219('0x14')][_0x27ea55['transfererlinkedid']]['transfer']=!![];}}};module[_0xd219('0x133')]=Preview; \ No newline at end of file diff --git a/server/services/ami/preview/rpcDb.js b/server/services/ami/preview/rpcDb.js index bb81889..782a088 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 _0x2bd8=['preview','lodash','../rpc/cmHopper','../rpc/cmHopperFinal','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/agentReportPreview','../rpc/voiceQueueReport','error','inspect','resolve','createHistory','catch','then','checkIsBlackList','getContactPreview','[getContactPreview]\x20','createAgentHistory','createCustomerHistory','rescheduleContact','UserId','active','[rescheduleContact]\x20','countReScheduled','unlockContact','[unlockContact]\x20','disableContact','crateCustomerReportQueue','type','calleridnum','calleridname','queue','answertime','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt','endtime','membername','context','from-sip','xcally-motion-preview','lastAssignedTo','queuecallerexitreason','COMPLETED','create','[voiceQueueReport]\x20','getContactRecallMe','[GetContactRecallMe]\x20','[rescheduleContactInQueue]\x20','util','../../../config/logger'];(function(_0x1dc5d9,_0x4b104b){var _0x345798=function(_0x35c825){while(--_0x35c825){_0x1dc5d9['push'](_0x1dc5d9['shift']());}};_0x345798(++_0x4b104b);}(_0x2bd8,0x130));var _0x82bd=function(_0x27d419,_0x51427d){_0x27d419=_0x27d419-0x0;var _0x2bec46=_0x2bd8[_0x27d419];return _0x2bec46;};'use strict';var util=require(_0x82bd('0x0'));var BPromise=require('bluebird');var logger=require(_0x82bd('0x1'))(_0x82bd('0x2'));var _=require(_0x82bd('0x3'));var cmHopper=require(_0x82bd('0x4'));var cmHopperFinal=require(_0x82bd('0x5'));var cmHopperHistory=require(_0x82bd('0x6'));var cmHopperBlack=require(_0x82bd('0x7'));var voiceQueueRt=require('../rpc/voiceQueueRt');var agentReportPreview=require(_0x82bd('0x8'));var voiceQueueReport=require(_0x82bd('0x9'));function loggerCatch(_0x3bf810){return function(_0x5ceb60){logger[_0x82bd('0xa')](_0x3bf810,util[_0x82bd('0xb')](_0x5ceb60,{'showHidden':![],'depth':null}));};}function create(_0x226f60){return BPromise[_0x82bd('0xc')]()['then'](cmHopperHistory[_0x82bd('0xd')](_0x226f60))['catch'](loggerCatch('[createHistory]\x20'));}function createAgent(_0x51c6ea){return BPromise[_0x82bd('0xc')]()['then'](agentReportPreview['createHistory'](_0x51c6ea))[_0x82bd('0xe')](loggerCatch('[createHistory]\x20'));}function moveContact(_0x4e50da){return BPromise[_0x82bd('0xc')]()[_0x82bd('0xf')](cmHopper['moveContactManagedDialer'](_0x4e50da,!![]))[_0x82bd('0xe')](loggerCatch('[moveContactManagedDialer]\x20'));}exports[_0x82bd('0x10')]=function(_0x51e17e){return BPromise[_0x82bd('0xc')]()[_0x82bd('0xf')](cmHopperBlack[_0x82bd('0x10')](_0x51e17e))[_0x82bd('0xe')](loggerCatch('[checkIsBlackList]\x20'));};exports[_0x82bd('0x11')]=function(_0xd43e79){return BPromise['resolve']()[_0x82bd('0xf')](cmHopper['getContactPreview'](_0xd43e79))[_0x82bd('0xe')](loggerCatch(_0x82bd('0x12')));};exports[_0x82bd('0xd')]=function(_0x300982,_0x209081){create(_0x300982)[_0x82bd('0xe')](loggerCatch(_0x209081));moveContact(_0x300982)[_0x82bd('0xe')](loggerCatch(_0x209081));};exports[_0x82bd('0x13')]=function(_0x31a350,_0xf180aa){createAgent(_0x31a350)[_0x82bd('0xe')](loggerCatch(_0xf180aa));};exports[_0x82bd('0x14')]=function(_0x1c3779,_0x253741){create(_0x1c3779)['catch'](loggerCatch(_0x253741));};exports['createCustomerFinal']=function(_0x283ce7,_0x3eb844){moveContact(_0x283ce7)[_0x82bd('0xe')](loggerCatch(_0x3eb844));};exports[_0x82bd('0x15')]=function(_0x34899b,_0x28a706,_0x2c1810){if(_0x28a706){_0x34899b[_0x82bd('0x16')]=null;}if(_0x2c1810){_0x34899b[_0x82bd('0x17')]=![];}return BPromise[_0x82bd('0xc')]()[_0x82bd('0xf')](cmHopper[_0x82bd('0x15')](_0x34899b))[_0x82bd('0xe')](loggerCatch(_0x82bd('0x18')));};exports[_0x82bd('0x19')]=function(_0x2d9d95){return BPromise[_0x82bd('0xc')]()[_0x82bd('0xf')](cmHopper[_0x82bd('0x19')](_0x2d9d95))['catch'](loggerCatch('[countReScheduled]\x20'));};exports[_0x82bd('0x1a')]=function(_0x436ecd){return BPromise[_0x82bd('0xc')]()[_0x82bd('0xf')](cmHopper[_0x82bd('0x1a')]({'UserId':null},_0x436ecd,0x1))[_0x82bd('0xe')](loggerCatch(_0x82bd('0x1b')));};exports[_0x82bd('0x1c')]=function(_0x2f0bb6){return BPromise[_0x82bd('0xc')]()['then'](cmHopper['unlockContact']({'active':![]},_0x2f0bb6,0x1))['catch'](loggerCatch('[activeContact]\x20'));};exports[_0x82bd('0x1d')]=function(_0x52bcd8){var _0x351d3d={};_0x351d3d[_0x82bd('0x1e')]=_0x52bcd8[_0x82bd('0x1e')];_0x351d3d['uniqueid']=_0x52bcd8['uniqueid'];_0x351d3d['calleridnum']=_0x52bcd8[_0x82bd('0x1f')];_0x351d3d[_0x82bd('0x20')]=_0x52bcd8[_0x82bd('0x20')];_0x351d3d['queue']=_0x52bcd8[_0x82bd('0x21')];_0x351d3d['queuecallerjoinAt']=_0x52bcd8[_0x82bd('0x22')];_0x351d3d[_0x82bd('0x23')]=_0x52bcd8[_0x82bd('0x22')];_0x351d3d[_0x82bd('0x24')]=0x1;_0x351d3d[_0x82bd('0x25')]=_0x52bcd8[_0x82bd('0x26')];_0x351d3d['connectedlinename']=_0x52bcd8[_0x82bd('0x27')];_0x351d3d[_0x82bd('0x28')]=_0x82bd('0x29');_0x351d3d['exten']=_0x82bd('0x2a');_0x351d3d['holdtime']=0x0;_0x351d3d['assigned']=0x1;_0x351d3d[_0x82bd('0x2b')]=_0x52bcd8[_0x82bd('0x27')];_0x351d3d[_0x82bd('0x2c')]=_0x82bd('0x2d');return BPromise[_0x82bd('0xc')]()[_0x82bd('0xf')](voiceQueueReport[_0x82bd('0x2e')](_0x351d3d))[_0x82bd('0xe')](loggerCatch(_0x82bd('0x2f')));};exports[_0x82bd('0x30')]=function(_0x1ebf6f,_0xe666bd){return BPromise[_0x82bd('0xc')]()[_0x82bd('0xf')](cmHopper[_0x82bd('0x30')](_0x1ebf6f,_0xe666bd))[_0x82bd('0xe')](loggerCatch(_0x82bd('0x31')));};exports['rescheduleContactInQueue']=function(_0x59b7ca){return BPromise['resolve']()[_0x82bd('0xf')](cmHopper[_0x82bd('0x15')](_0x59b7ca,!![],!![]))['catch'](loggerCatch(_0x82bd('0x32')));}; \ No newline at end of file +var _0x3937=['queuecallerjoinAt','answertime','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt','endtime','context','exten','holdtime','lastAssignedTo','membername','queuecallerexitreason','COMPLETED','create','[voiceQueueReport]\x20','getContactRecallMe','[GetContactRecallMe]\x20','rescheduleContactInQueue','rescheduleContact','[rescheduleContactInQueue]\x20','util','../../../config/logger','preview','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/voiceQueueRt','../rpc/agentReportPreview','../rpc/voiceQueueReport','error','inspect','resolve','catch','[createHistory]\x20','then','moveContactManagedDialer','[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','createHistory','createAgentHistory','createCustomerHistory','createCustomerFinal','UserId','active','countReScheduled','[countReScheduled]\x20','unlockContact','[unlockContact]\x20','disableContact','[activeContact]\x20','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname','queue'];(function(_0x45506b,_0x5a8e26){var _0x20dd13=function(_0x54cdf2){while(--_0x54cdf2){_0x45506b['push'](_0x45506b['shift']());}};_0x20dd13(++_0x5a8e26);}(_0x3937,0xbf));var _0x7393=function(_0x47494d,_0x1859fe){_0x47494d=_0x47494d-0x0;var _0x573eec=_0x3937[_0x47494d];return _0x573eec;};'use strict';var util=require(_0x7393('0x0'));var BPromise=require('bluebird');var logger=require(_0x7393('0x1'))(_0x7393('0x2'));var _=require('lodash');var cmHopper=require(_0x7393('0x3'));var cmHopperFinal=require('../rpc/cmHopperFinal');var cmHopperHistory=require(_0x7393('0x4'));var cmHopperBlack=require('../rpc/cmHopperBlack');var voiceQueueRt=require(_0x7393('0x5'));var agentReportPreview=require(_0x7393('0x6'));var voiceQueueReport=require(_0x7393('0x7'));function loggerCatch(_0x1f538f){return function(_0x15eabd){logger[_0x7393('0x8')](_0x1f538f,util[_0x7393('0x9')](_0x15eabd,{'showHidden':![],'depth':null}));};}function create(_0x26668a){return BPromise[_0x7393('0xa')]()['then'](cmHopperHistory['createHistory'](_0x26668a))[_0x7393('0xb')](loggerCatch(_0x7393('0xc')));}function createAgent(_0x1cc3fd){return BPromise['resolve']()[_0x7393('0xd')](agentReportPreview['createHistory'](_0x1cc3fd))['catch'](loggerCatch('[createHistory]\x20'));}function moveContact(_0x497b6b){return BPromise[_0x7393('0xa')]()[_0x7393('0xd')](cmHopper[_0x7393('0xe')](_0x497b6b,!![]))['catch'](loggerCatch(_0x7393('0xf')));}exports[_0x7393('0x10')]=function(_0x20fb41){return BPromise[_0x7393('0xa')]()[_0x7393('0xd')](cmHopperBlack[_0x7393('0x10')](_0x20fb41))[_0x7393('0xb')](loggerCatch(_0x7393('0x11')));};exports[_0x7393('0x12')]=function(_0x4e521c){return BPromise['resolve']()[_0x7393('0xd')](cmHopper['getContactPreview'](_0x4e521c))['catch'](loggerCatch('[getContactPreview]\x20'));};exports[_0x7393('0x13')]=function(_0x54dc47,_0x2a1180){create(_0x54dc47)[_0x7393('0xb')](loggerCatch(_0x2a1180));moveContact(_0x54dc47)['catch'](loggerCatch(_0x2a1180));};exports[_0x7393('0x14')]=function(_0x5745cb,_0x5694b6){createAgent(_0x5745cb)[_0x7393('0xb')](loggerCatch(_0x5694b6));};exports[_0x7393('0x15')]=function(_0x1b032c,_0x1dc3e3){create(_0x1b032c)[_0x7393('0xb')](loggerCatch(_0x1dc3e3));};exports[_0x7393('0x16')]=function(_0x21f712,_0x208b9a){moveContact(_0x21f712)['catch'](loggerCatch(_0x208b9a));};exports['rescheduleContact']=function(_0x30eae3,_0x16f617,_0x3979b7){if(_0x16f617){_0x30eae3[_0x7393('0x17')]=null;}if(_0x3979b7){_0x30eae3[_0x7393('0x18')]=![];}return BPromise['resolve']()['then'](cmHopper['rescheduleContact'](_0x30eae3))[_0x7393('0xb')](loggerCatch('[rescheduleContact]\x20'));};exports['countReScheduled']=function(_0x2bf7a9){return BPromise[_0x7393('0xa')]()['then'](cmHopper[_0x7393('0x19')](_0x2bf7a9))[_0x7393('0xb')](loggerCatch(_0x7393('0x1a')));};exports[_0x7393('0x1b')]=function(_0x3fe456){return BPromise[_0x7393('0xa')]()[_0x7393('0xd')](cmHopper[_0x7393('0x1b')]({'UserId':null},_0x3fe456,0x1))[_0x7393('0xb')](loggerCatch(_0x7393('0x1c')));};exports[_0x7393('0x1d')]=function(_0x123ab4){return BPromise[_0x7393('0xa')]()['then'](cmHopper[_0x7393('0x1b')]({'active':![]},_0x123ab4,0x1))[_0x7393('0xb')](loggerCatch(_0x7393('0x1e')));};exports[_0x7393('0x1f')]=function(_0x1013aa){var _0xd8dfae={};_0xd8dfae['type']=_0x1013aa[_0x7393('0x20')];_0xd8dfae['uniqueid']=_0x1013aa[_0x7393('0x21')];_0xd8dfae['calleridnum']=_0x1013aa[_0x7393('0x22')];_0xd8dfae[_0x7393('0x23')]=_0x1013aa[_0x7393('0x23')];_0xd8dfae[_0x7393('0x24')]=_0x1013aa[_0x7393('0x24')];_0xd8dfae[_0x7393('0x25')]=_0x1013aa[_0x7393('0x26')];_0xd8dfae[_0x7393('0x27')]=_0x1013aa[_0x7393('0x26')];_0xd8dfae[_0x7393('0x28')]=0x1;_0xd8dfae[_0x7393('0x29')]=_0x1013aa[_0x7393('0x2a')];_0xd8dfae['connectedlinename']=_0x1013aa['membername'];_0xd8dfae[_0x7393('0x2b')]='from-sip';_0xd8dfae[_0x7393('0x2c')]='xcally-motion-preview';_0xd8dfae[_0x7393('0x2d')]=0x0;_0xd8dfae['assigned']=0x1;_0xd8dfae[_0x7393('0x2e')]=_0x1013aa[_0x7393('0x2f')];_0xd8dfae[_0x7393('0x30')]=_0x7393('0x31');return BPromise[_0x7393('0xa')]()[_0x7393('0xd')](voiceQueueReport[_0x7393('0x32')](_0xd8dfae))[_0x7393('0xb')](loggerCatch(_0x7393('0x33')));};exports[_0x7393('0x34')]=function(_0x585d47,_0x17e110){return BPromise['resolve']()[_0x7393('0xd')](cmHopper['getContactRecallMe'](_0x585d47,_0x17e110))[_0x7393('0xb')](loggerCatch(_0x7393('0x35')));};exports[_0x7393('0x36')]=function(_0x308cfb){return BPromise[_0x7393('0xa')]()['then'](cmHopper[_0x7393('0x37')](_0x308cfb,!![],!![]))['catch'](loggerCatch(_0x7393('0x38')));}; \ No newline at end of file diff --git a/server/services/ami/preview/util/util.js b/server/services/ami/preview/util/util.js index ed7e4ba..7c01ddd 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 _0xa181=['rtpaudioqosloss','rtpaudioqosrtt','\x5cw{0,','pow','replace','random','match','extractCalleridNumber','util','lodash','moment','preview','env','XCALLY_IP_AGI','127.0.0.1','milliseconds','diff','seconds','loggerCatch','error','inspect','loggerError','logger2','info','message','string','isUndefined','isEmpty','\x22%s\x22\x20<%s>','isNil','addVariables','Queue','name','format','calleridname','calleridnum','ContactId','dialer','VoiceQueueId','dialOriginateTimeout','\x22rtTxX%s%s\x22','dialQueueProject2','U(xcally-mixmonitor-context)','dialPreviewUrl','dialQueueProject','\x22agi://%s/square,%s\x22','originatecalleridnum','originatecalleridname','xcally-motion-preview','monitor_format','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','Contact','hasOwnProperty','createdAt','updatedAt','toUpper','toLowerVariables','toLower','updateOriginated','originated','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','statedesc','starttime','responsetime','endtime','logAgent','state','ringtime','logCustomer','talktime','answertime','isFailure','Failure','RECALL','BOOKED','uniqueid','originate','countbusyretry','countcongestionretry','countnoanswerretry','cloneAction','clone','Global','scheduledAt','active','scheduledat','add','ListId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','IsNotLoggedIn','buildObj','lastevent','queue','interface','buildAcw','channelAgent','status','reachable','push','filterKey','type','dialAnswer','callback','callbackuniqueid','callbackat','recallme','sipcallid','xmd-queue','xmd-phone','xmd-listid','xmd-dialurl','xmd-dialtimeout','xmd-dialoptions','xmd-dialid','xmd-dialchannel','xmd-contactid','xmd-callerid','xmd-agiafter','rtpaudioqos','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqoslossbridged','rtpaudioqosrttbridged','rtpaudioqosbridged'];(function(_0x28eab5,_0x3f6403){var _0x1be3c0=function(_0x347bea){while(--_0x347bea){_0x28eab5['push'](_0x28eab5['shift']());}};_0x1be3c0(++_0x3f6403);}(_0xa181,0x10a));var _0x1a18=function(_0xb506a8,_0x22cdd1){_0xb506a8=_0xb506a8-0x0;var _0x51eeec=_0xa181[_0xb506a8];return _0x51eeec;};'use strict';var util=require(_0x1a18('0x0'));var _=require(_0x1a18('0x1'));var moment=require(_0x1a18('0x2'));var logger=require('../../../../config/logger')(_0x1a18('0x3'));var ipAgi=process[_0x1a18('0x4')][_0x1a18('0x5')]||_0x1a18('0x6');function getSeconds(_0x3dd01c,_0x43c009){var _0x4f798d=moment(_0x3dd01c)[_0x1a18('0x7')](0x0);var _0x501ea2=moment(_0x43c009)[_0x1a18('0x7')](0x0);return _0x4f798d[_0x1a18('0x8')](_0x501ea2,_0x1a18('0x9'));}exports[_0x1a18('0xa')]=function(_0x49e0ab){return function(_0x394289){logger[_0x1a18('0xb')](_0x49e0ab,util[_0x1a18('0xc')](_0x394289,{'showHidden':![],'depth':null}));};};exports['logger']=function(_0x256fb5,_0x3e61f4){logger['info'](_0x256fb5,util[_0x1a18('0xc')](_0x3e61f4,{'showHidden':![],'depth':null}));};exports[_0x1a18('0xd')]=function(_0x425850,_0x3e5a90){logger[_0x1a18('0xb')](_0x425850,util['inspect'](_0x3e5a90,{'showHidden':![],'depth':null}));};exports[_0x1a18('0xe')]=function(_0x4affa6){return function(_0x17ae6a){logger[_0x1a18('0xf')](_0x4affa6,util['inspect'](_0x17ae6a,{'showHidden':![],'depth':null}));};};exports[_0x1a18('0x10')]=function(_0x4ea0eb,_0x1b3de2,_0x15f465){return{'message':_0x4ea0eb,'unlock':_0x1b3de2,'active':_0x15f465};};exports['getCallerId']=function(_0x1ad393,_0x3b1b44,_0x2e684e){if(!_['isUndefined'](_0x2e684e)&&_0x1a18('0x11')===typeof _0x2e684e&&!_['isEmpty'](_0x2e684e)){if(!_[_0x1a18('0x12')](_0x3b1b44)&&'string'===typeof _0x3b1b44&&!_[_0x1a18('0x13')](_0x3b1b44)){return util['format'](_0x1a18('0x14'),_0x3b1b44,_0x2e684e);}return util['format'](_0x1a18('0x14'),_0x2e684e,_0x2e684e);}if(!_[_0x1a18('0x12')](_0x1ad393)&&_0x1a18('0x11')===typeof _0x1ad393&&!_[_0x1a18('0x13')](_0x1ad393)){return _0x1ad393;}return'\x22\x22\x20<>';};exports['isActive']=function(_0x5bc259){if(_[_0x1a18('0x15')](_0x5bc259)){return![];}return _0x5bc259;};exports[_0x1a18('0x16')]=function(_0xc191f2,_0x330ad9,_0x812a7f,_0x93a0a7,_0x520018,_0x4234f8){var _0x3d86c6={'XMD-QUEUE':_0x330ad9[_0x1a18('0x17')]?_0x330ad9[_0x1a18('0x17')][_0x1a18('0x18')]:'','XMD-CALLERID':_0x93a0a7,'XMD-CALLERID-PREVIEW':_0x4234f8?util[_0x1a18('0x19')](_0x1a18('0x14'),_0x4234f8[_0x1a18('0x1a')],_0x4234f8[_0x1a18('0x1b')]):_0x93a0a7,'XMD-DIALID':_0x520018,'XMD-CONTACTID':_0x330ad9[_0x1a18('0x1c')],'XMD-CDRTYPE':_0x1a18('0x1d'),'CALLERID(all)':_0x93a0a7,'XMD-VOICEQUEUEID':_0x330ad9[_0x1a18('0x1e')],'XMD-DIALCHANNEL':_0x812a7f,'XMD-DIALTIMEOUT':_0xc191f2[_0x1a18('0x1f')]||0x1e,'XMD-DIALOPTIONS':util[_0x1a18('0x19')](_0x1a18('0x20'),_0xc191f2[_0x1a18('0x21')]?'g':'',_[_0x1a18('0x13')](_0xc191f2['monitor_format'])?'':_0x1a18('0x22')),'XMD-DIALURL':_0xc191f2[_0x1a18('0x23')]||'','XMD-AGI':_0xc191f2[_0x1a18('0x24')]?util[_0x1a18('0x19')](_0x1a18('0x25'),ipAgi,_0xc191f2[_0x1a18('0x24')]):'NONE','XMD-AGIAFTER':_0xc191f2[_0x1a18('0x21')]?util[_0x1a18('0x19')](_0x1a18('0x25'),ipAgi,_0xc191f2[_0x1a18('0x21')]):'NONE','XMD-ORIGINATECALLERIDNUM':_0x4234f8?_0x4234f8[_0x1a18('0x26')]:'','XMD-ORIGINATECALLERIDNAME':_0x4234f8?_0x4234f8[_0x1a18('0x27')]:'','XMD-DESTINATION':_0x1a18('0x28')};if(!_[_0x1a18('0x13')](_0xc191f2[_0x1a18('0x29')])){_0x3d86c6[util[_0x1a18('0x19')]('%s',_0x1a18('0x2a'))]=_0xc191f2[_0x1a18('0x29')];_0x3d86c6[util[_0x1a18('0x19')]('%s',_0x1a18('0x2b'))]=_0x520018;}if(_0x330ad9&&_0x330ad9[_0x1a18('0x2c')]){for(var _0x3ade60 in _0x330ad9[_0x1a18('0x2c')]){if(_0x330ad9[_0x1a18('0x2c')][_0x1a18('0x2d')](_0x3ade60)){if(!_['isNil'](_0x330ad9[_0x1a18('0x2c')][_0x3ade60])&&_0x3ade60!=='id'&&_0x3ade60!=='tags'&&_0x3ade60!==_0x1a18('0x2e')&&_0x3ade60!==_0x1a18('0x2f')){_0x3d86c6[util['format']('%s%s','XMD-',_[_0x1a18('0x30')](_0x3ade60))]=_0x330ad9[_0x1a18('0x2c')][_0x3ade60];}}}}return _0x3d86c6;};exports[_0x1a18('0x31')]=function(_0x24b537){var _0x34674c={};for(var _0x2b0636 in _0x24b537){if(_0x24b537[_0x1a18('0x2d')](_0x2b0636)){_0x34674c[util[_0x1a18('0x19')]('%s',_[_0x1a18('0x32')](_0x2b0636))]=_0x24b537[_0x2b0636];}}return{'variables':_0x34674c};};exports[_0x1a18('0x33')]=function(_0x51b7c9,_0x4d5ba3){if(!_[_0x1a18('0x15')](_0x51b7c9)){if(_0x51b7c9[_0x1a18('0x2d')](_0x1a18('0x34'))){if(_0x51b7c9[_0x1a18('0x34')]>0x0){_0x51b7c9[_0x1a18('0x34')]-=0x1;}else{logger['error']('[updateOriginated]\x20object\x20originated\x20is\x20negative',_0x4d5ba3);}}}else{logger[_0x1a18('0xb')](_0x1a18('0x35'),_0x4d5ba3);}};exports[_0x1a18('0x36')]=function(_0x32742c){var _0x53f4aa=moment()[_0x1a18('0x19')](_0x1a18('0x37'));_0x32742c['state']=0xd;_0x32742c[_0x1a18('0x38')]='Blacklist';_0x32742c[_0x1a18('0x39')]=_0x53f4aa;_0x32742c[_0x1a18('0x3a')]=_0x53f4aa;_0x32742c[_0x1a18('0x3b')]=_0x53f4aa;};exports[_0x1a18('0x3c')]=function(_0x2a6f05,_0x20fe6a,_0x388f4d){var _0x39ee2d=moment()[_0x1a18('0x19')](_0x1a18('0x37'));_0x2a6f05[_0x1a18('0x3d')]=_0x20fe6a;_0x2a6f05[_0x1a18('0x38')]=_0x388f4d;_0x2a6f05[_0x1a18('0x3a')]=_0x39ee2d;_0x2a6f05[_0x1a18('0x3e')]=getSeconds(_0x2a6f05[_0x1a18('0x3a')],_0x2a6f05['starttime']);};exports['logLookAgent']=function(_0x4d92dc,_0x85acf0,_0x9e3b54){_0x4d92dc['membername']=_0x85acf0;_0x4d92dc['UserId']=_0x9e3b54;};exports[_0x1a18('0x3f')]=function(_0xf015b4,_0x263e43,_0x5232f9){var _0x6a6f51=moment()[_0x1a18('0x19')]('YYYY-MM-DD\x20HH:mm:ss');_0xf015b4[_0x1a18('0x3d')]=_0x263e43;_0xf015b4['statedesc']=_0x5232f9;_0xf015b4[_0x1a18('0x3a')]=_0xf015b4[_0x1a18('0x3a')]?_0xf015b4[_0x1a18('0x3a')]:_0x6a6f51;_0xf015b4[_0x1a18('0x3b')]=_0xf015b4[_0x1a18('0x3b')]?_0xf015b4[_0x1a18('0x3b')]:_0x6a6f51;_0xf015b4[_0x1a18('0x3e')]=getSeconds(_0xf015b4['responsetime']||0x0,_0xf015b4[_0x1a18('0x39')]||0x0);_0xf015b4[_0x1a18('0x40')]=_0xf015b4[_0x1a18('0x41')]?getSeconds(_0xf015b4[_0x1a18('0x3b')],_0xf015b4[_0x1a18('0x41')]):0x0;};exports[_0x1a18('0x42')]=function(_0x5b7ee6){return _0x5b7ee6===_0x1a18('0x43');};exports['variablesAction']=function(_0x2af01c,_0x4a971d,_0x46d146,_0x42a8c2,_0x27b5af){var _0x438049=_0x42a8c2?_0x1a18('0x44'):_0x2af01c['calleridname'];_0x438049=_0x27b5af?_0x1a18('0x45'):_0x438049;return{'actionid':_0x2af01c[_0x1a18('0x46')],'action':_0x1a18('0x47'),'channel':_0x2af01c['channelAgent'],'callerid':util[_0x1a18('0x19')](_0x1a18('0x14'),_0x438049,_0x2af01c[_0x1a18('0x1b')]),'Exten':_0x1a18('0x28'),'Context':'from-sip','Priority':'1','variable':_0x46d146,'timeout':(_0x4a971d['timeout']||0x1e)*0x3e8,'async':!![],'channelid':_0x2af01c['uniqueid']};};exports['totalGlobal']=function(_0xbc447c){return _0xbc447c[_0x1a18('0x48')]+_0xbc447c[_0x1a18('0x49')]+_0xbc447c[_0x1a18('0x4a')];};exports[_0x1a18('0x4b')]=function(_0x992fdb){var _0x377711=_[_0x1a18('0x4c')](_0x992fdb);_0x377711[_0x1a18('0x3d')]=0xf;_0x377711[_0x1a18('0x38')]=_0x1a18('0x4d');return _0x377711;};exports[_0x1a18('0x4e')]=function(_0x2832bb,_0x1a0859,_0x340660){var _0x5434e8={};_0x5434e8[_0x1a0859]=_0x2832bb[_0x1a0859];_0x5434e8[_0x1a18('0x4f')]=![];_0x5434e8[_0x1a18('0x50')]=moment()[_0x1a18('0x51')](_0x340660,'minutes')[_0x1a18('0x19')]('YYYY-MM-DD\x20HH:mm:ss');_0x5434e8[_0x1a18('0x1c')]=_0x2832bb[_0x1a18('0x1c')];_0x5434e8[_0x1a18('0x52')]=_0x2832bb[_0x1a18('0x52')];_0x5434e8[_0x1a18('0x1e')]=_0x2832bb[_0x1a18('0x1e')]||undefined;return _0x5434e8;};exports[_0x1a18('0x53')]=function(_0x5af91a,_0x387c08){if(!_[_0x1a18('0x15')](_0x5af91a)){if(_0x5af91a[_0x1a18('0x54')]>0x0){_0x5af91a['pTalking']-=0x1;}else{logger[_0x1a18('0xb')](_0x387c08,_0x1a18('0x55'));}}else{logger[_0x1a18('0xb')](_0x387c08,'[decrementTalkink]\x20is\x20null\x20or\x20undefined');}};exports[_0x1a18('0x56')]=function(_0x163850){if(_0x163850<=0x0){return!![];}return![];};exports[_0x1a18('0x57')]=function(_0x35804f,_0x5f1730){_0x35804f[_0x1a18('0x58')]=_0x5f1730;_0x35804f[_0x1a18('0x18')]=_0x35804f[_0x1a18('0x59')];_0x35804f[_0x1a18('0x5a')]=_0x35804f['channelAgent'];return _0x35804f;};exports[_0x1a18('0x5b')]=function(_0x28dd6e){var _0x4a4db1={};_0x4a4db1[_0x1a18('0x59')]=_0x28dd6e['queue'];_0x4a4db1['interface']=_0x28dd6e[_0x1a18('0x5c')];_0x4a4db1[_0x1a18('0x46')]=_0x28dd6e[_0x1a18('0x46')];return _0x4a4db1;};exports['agentReadyId']=function(_0x118697){var _0x5c8e19=[];for(var _0x5781f0 in _0x118697){if(_0x118697[_0x1a18('0x2d')](_0x5781f0)){if(!_[_0x1a18('0x15')](_0x118697[_0x5781f0])&&_0x118697[_0x5781f0][_0x1a18('0x3d')]==='not_inuse'&&_0x118697[_0x5781f0][_0x1a18('0x5d')]===_0x1a18('0x5e')){_0x5c8e19[_0x1a18('0x5f')](_0x118697[_0x5781f0]['id']);}}}return _0x5c8e19;};exports['getDiff']=function(_0x323716){var _0x4303cf=moment()[_0x1a18('0x7')](0x0);var _0x217715=moment(_0x323716)[_0x1a18('0x7')](0x0);return _0x4303cf[_0x1a18('0x8')](_0x217715,'seconds');};exports['createBody']=function(_0x4d99cc){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x4d99cc[_0x1a18('0x1c')],'ListId':_0x4d99cc['ListId'],'VoiceQueueId':_0x4d99cc[_0x1a18('0x1e')]||undefined,'CampaignId':_0x4d99cc['CampaignId']||undefined};};exports[_0x1a18('0x60')]=function(_0x6df303){if(_0x6df303===_0x1a18('0x46')||_0x6df303==='idContact'||_0x6df303===_0x1a18('0x59')||_0x6df303===_0x1a18('0x61')||_0x6df303==='campaigntype'||_0x6df303===_0x1a18('0x62')||_0x6df303==='membername'||_0x6df303===_0x1a18('0x5c')||_0x6df303===_0x1a18('0x1a')||_0x6df303===_0x1a18('0x4f')||_0x6df303===_0x1a18('0x1b')||_0x6df303===_0x1a18('0x50')||_0x6df303===_0x1a18('0x48')||_0x6df303===_0x1a18('0x49')||_0x6df303==='countnoanswerretry'||_0x6df303==='countglobal'||_0x6df303===_0x1a18('0x63')||_0x6df303===_0x1a18('0x64')||_0x6df303===_0x1a18('0x65')||_0x6df303===_0x1a18('0x66')||_0x6df303==='ContactId'||_0x6df303===_0x1a18('0x52')||_0x6df303==='UserId'||_0x6df303===_0x1a18('0x1e')||_0x6df303===_0x1a18('0x67')||_0x6df303==='xmd-voicequeueid'||_0x6df303===_0x1a18('0x68')||_0x6df303===_0x1a18('0x69')||_0x6df303===_0x1a18('0x6a')||_0x6df303===_0x1a18('0x6b')||_0x6df303===_0x1a18('0x6c')||_0x6df303===_0x1a18('0x6d')||_0x6df303===_0x1a18('0x6e')||_0x6df303===_0x1a18('0x6f')||_0x6df303===_0x1a18('0x70')||_0x6df303==='xmd-cdrtype'||_0x6df303===_0x1a18('0x71')||_0x6df303===_0x1a18('0x72')||_0x6df303==='xmd-agi'||_0x6df303===_0x1a18('0x73')||_0x6df303==='rtpaudioqosbridged'||_0x6df303===_0x1a18('0x74')||_0x6df303===_0x1a18('0x75')||_0x6df303==='rtpaudioqosloss'||_0x6df303===_0x1a18('0x76')||_0x6df303==='rtpaudioqosrtt'||_0x6df303===_0x1a18('0x77')||_0x6df303===_0x1a18('0x73')||_0x6df303===_0x1a18('0x78')||_0x6df303==='rtpaudioqosjitter'||_0x6df303===_0x1a18('0x75')||_0x6df303===_0x1a18('0x79')||_0x6df303===_0x1a18('0x76')||_0x6df303===_0x1a18('0x7a')||_0x6df303===_0x1a18('0x77')||_0x6df303==='bridgepeer'||_0x6df303==='bridgepvtcallid'||_0x6df303===_0x1a18('0x3d')||_0x6df303===_0x1a18('0x38')){return![];}return!![];};exports['getCallerIdRandom']=function(_0x46821c,_0x587c14){var _0x2990bd,_0x4b2e17,_0x26f59d;if(_0x587c14<=0x0){_0x587c14=0x1;}_0x2990bd=new RegExp(_0x1a18('0x7b')+_0x587c14+'}$');_0x4b2e17=Math['pow'](0xa,_0x587c14-0x1);_0x26f59d=Math[_0x1a18('0x7c')](0xa,_0x587c14)-0x1;return util[_0x1a18('0x19')]('%s',_[_0x1a18('0x7d')](_0x46821c,_0x2990bd,_[_0x1a18('0x7e')](_0x4b2e17,_0x26f59d)));};exports['extractCalleridName']=function(_0x482096){var _0x4bdf60=_0x482096[_0x1a18('0x7f')](/"(.*?)"/);return _0x4bdf60?_0x4bdf60[0x1]:_0x482096;};exports[_0x1a18('0x80')]=function(_0x3c0eec){var _0x3ff56e=_0x3c0eec[_0x1a18('0x7f')](/<(.*?)>/);return _0x3ff56e?_0x3ff56e[0x1]:_0x3c0eec;}; \ No newline at end of file +var _0xf698=['responsetime','endtime','logAgent','state','membername','UserId','logCustomer','YYYY-MM-DD\x20HH:mm:ss','ringtime','talktime','answertime','isFailure','Failure','RECALL','BOOKED','uniqueid','originate','channelAgent','from-sip','timeout','countbusyretry','countcongestionretry','countnoanswerretry','cloneAction','clone','Global','scheduledAt','active','scheduledat','add','minutes','ContactId','ListId','VoiceQueueId','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','lastevent','queue','interface','buildAcw','status','reachable','push','getDiff','diff','createBody','filterKey','idContact','type','campaigntype','countglobal','callback','sipcallid','xmd-voicequeueid','xmd-queue','xmd-listid','xmd-dialurl','xmd-dialoptions','xmd-dialchannel','xmd-contactid','xmd-cdrtype','xmd-agiafter','xmd-agi','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','bridgepeer','bridgepvtcallid','getCallerIdRandom','pow','replace','random','extractCalleridNumber','match','util','lodash','../../../../config/logger','preview','XCALLY_IP_AGI','127.0.0.1','milliseconds','seconds','loggerCatch','error','inspect','logger','info','loggerError','message','getCallerId','isUndefined','isEmpty','string','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','isActive','isNil','Queue','name','calleridnum','dialOriginateTimeout','dialQueueProject2','monitor_format','U(xcally-mixmonitor-context)','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','originatecalleridnum','xcally-motion-preview','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','Contact','tags','createdAt','%s%s','XMD-','toUpper','hasOwnProperty','toLower','updateOriginated','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','statedesc','Blacklist','starttime'];(function(_0x1cfa0d,_0x4391f2){var _0xe33279=function(_0x3ce7c1){while(--_0x3ce7c1){_0x1cfa0d['push'](_0x1cfa0d['shift']());}};_0xe33279(++_0x4391f2);}(_0xf698,0x1de));var _0x8f69=function(_0x9aada2,_0xd2d349){_0x9aada2=_0x9aada2-0x0;var _0x196dff=_0xf698[_0x9aada2];return _0x196dff;};'use strict';var util=require(_0x8f69('0x0'));var _=require(_0x8f69('0x1'));var moment=require('moment');var logger=require(_0x8f69('0x2'))(_0x8f69('0x3'));var ipAgi=process['env'][_0x8f69('0x4')]||_0x8f69('0x5');function getSeconds(_0x83c2db,_0x355676){var _0x51d187=moment(_0x83c2db)[_0x8f69('0x6')](0x0);var _0x57876d=moment(_0x355676)['milliseconds'](0x0);return _0x51d187['diff'](_0x57876d,_0x8f69('0x7'));}exports[_0x8f69('0x8')]=function(_0x29202e){return function(_0x2f6f5c){logger[_0x8f69('0x9')](_0x29202e,util[_0x8f69('0xa')](_0x2f6f5c,{'showHidden':![],'depth':null}));};};exports[_0x8f69('0xb')]=function(_0x3d86d7,_0xd8d4c0){logger[_0x8f69('0xc')](_0x3d86d7,util[_0x8f69('0xa')](_0xd8d4c0,{'showHidden':![],'depth':null}));};exports[_0x8f69('0xd')]=function(_0x5ba793,_0x6732ea){logger['error'](_0x5ba793,util[_0x8f69('0xa')](_0x6732ea,{'showHidden':![],'depth':null}));};exports['logger2']=function(_0x1a036d){return function(_0x575c97){logger[_0x8f69('0xc')](_0x1a036d,util[_0x8f69('0xa')](_0x575c97,{'showHidden':![],'depth':null}));};};exports[_0x8f69('0xe')]=function(_0x4f3145,_0x527b35,_0x22157a){return{'message':_0x4f3145,'unlock':_0x527b35,'active':_0x22157a};};exports[_0x8f69('0xf')]=function(_0x4cef9f,_0x43af9c,_0x3561d6){if(!_[_0x8f69('0x10')](_0x3561d6)&&'string'===typeof _0x3561d6&&!_[_0x8f69('0x11')](_0x3561d6)){if(!_[_0x8f69('0x10')](_0x43af9c)&&_0x8f69('0x12')===typeof _0x43af9c&&!_['isEmpty'](_0x43af9c)){return util[_0x8f69('0x13')](_0x8f69('0x14'),_0x43af9c,_0x3561d6);}return util[_0x8f69('0x13')](_0x8f69('0x14'),_0x3561d6,_0x3561d6);}if(!_[_0x8f69('0x10')](_0x4cef9f)&&_0x8f69('0x12')===typeof _0x4cef9f&&!_['isEmpty'](_0x4cef9f)){return _0x4cef9f;}return _0x8f69('0x15');};exports[_0x8f69('0x16')]=function(_0x2c9cee){if(_[_0x8f69('0x17')](_0x2c9cee)){return![];}return _0x2c9cee;};exports['addVariables']=function(_0x445619,_0x362e7a,_0x4dd67c,_0x2b2978,_0x3d2526,_0x4fadeb){var _0x49880b={'XMD-QUEUE':_0x362e7a[_0x8f69('0x18')]?_0x362e7a[_0x8f69('0x18')][_0x8f69('0x19')]:'','XMD-CALLERID':_0x2b2978,'XMD-CALLERID-PREVIEW':_0x4fadeb?util[_0x8f69('0x13')](_0x8f69('0x14'),_0x4fadeb['calleridname'],_0x4fadeb[_0x8f69('0x1a')]):_0x2b2978,'XMD-DIALID':_0x3d2526,'XMD-CONTACTID':_0x362e7a['ContactId'],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x2b2978,'XMD-VOICEQUEUEID':_0x362e7a['VoiceQueueId'],'XMD-DIALCHANNEL':_0x4dd67c,'XMD-DIALTIMEOUT':_0x445619[_0x8f69('0x1b')]||0x1e,'XMD-DIALOPTIONS':util['format']('\x22rtTxX%s%s\x22',_0x445619[_0x8f69('0x1c')]?'g':'',_[_0x8f69('0x11')](_0x445619[_0x8f69('0x1d')])?'':_0x8f69('0x1e')),'XMD-DIALURL':_0x445619['dialPreviewUrl']||'','XMD-AGI':_0x445619[_0x8f69('0x1f')]?util[_0x8f69('0x13')](_0x8f69('0x20'),ipAgi,_0x445619[_0x8f69('0x1f')]):'NONE','XMD-AGIAFTER':_0x445619['dialQueueProject2']?util[_0x8f69('0x13')](_0x8f69('0x20'),ipAgi,_0x445619[_0x8f69('0x1c')]):_0x8f69('0x21'),'XMD-ORIGINATECALLERIDNUM':_0x4fadeb?_0x4fadeb[_0x8f69('0x22')]:'','XMD-ORIGINATECALLERIDNAME':_0x4fadeb?_0x4fadeb['originatecalleridname']:'','XMD-DESTINATION':_0x8f69('0x23')};if(!_[_0x8f69('0x11')](_0x445619[_0x8f69('0x1d')])){_0x49880b[util[_0x8f69('0x13')]('%s',_0x8f69('0x24'))]=_0x445619['monitor_format'];_0x49880b[util[_0x8f69('0x13')]('%s',_0x8f69('0x25'))]=_0x3d2526;}if(_0x362e7a&&_0x362e7a[_0x8f69('0x26')]){for(var _0x3515c2 in _0x362e7a[_0x8f69('0x26')]){if(_0x362e7a['Contact']['hasOwnProperty'](_0x3515c2)){if(!_[_0x8f69('0x17')](_0x362e7a[_0x8f69('0x26')][_0x3515c2])&&_0x3515c2!=='id'&&_0x3515c2!==_0x8f69('0x27')&&_0x3515c2!==_0x8f69('0x28')&&_0x3515c2!=='updatedAt'){_0x49880b[util[_0x8f69('0x13')](_0x8f69('0x29'),_0x8f69('0x2a'),_[_0x8f69('0x2b')](_0x3515c2))]=_0x362e7a[_0x8f69('0x26')][_0x3515c2];}}}}return _0x49880b;};exports['toLowerVariables']=function(_0x349427){var _0x39bfe1={};for(var _0x2cec11 in _0x349427){if(_0x349427[_0x8f69('0x2c')](_0x2cec11)){_0x39bfe1[util['format']('%s',_[_0x8f69('0x2d')](_0x2cec11))]=_0x349427[_0x2cec11];}}return{'variables':_0x39bfe1};};exports[_0x8f69('0x2e')]=function(_0x3e25f0,_0x262abb){if(!_[_0x8f69('0x17')](_0x3e25f0)){if(_0x3e25f0[_0x8f69('0x2c')]('originated')){if(_0x3e25f0[_0x8f69('0x2f')]>0x0){_0x3e25f0['originated']-=0x1;}else{logger[_0x8f69('0x9')](_0x8f69('0x30'),_0x262abb);}}}else{logger[_0x8f69('0x9')](_0x8f69('0x31'),_0x262abb);}};exports[_0x8f69('0x32')]=function(_0x53f7f0){var _0x50c29c=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x53f7f0['state']=0xd;_0x53f7f0[_0x8f69('0x33')]=_0x8f69('0x34');_0x53f7f0[_0x8f69('0x35')]=_0x50c29c;_0x53f7f0[_0x8f69('0x36')]=_0x50c29c;_0x53f7f0[_0x8f69('0x37')]=_0x50c29c;};exports[_0x8f69('0x38')]=function(_0x519a5d,_0x430252,_0x392ce5){var _0xfe01c=moment()[_0x8f69('0x13')]('YYYY-MM-DD\x20HH:mm:ss');_0x519a5d[_0x8f69('0x39')]=_0x430252;_0x519a5d[_0x8f69('0x33')]=_0x392ce5;_0x519a5d[_0x8f69('0x36')]=_0xfe01c;_0x519a5d['ringtime']=getSeconds(_0x519a5d[_0x8f69('0x36')],_0x519a5d['starttime']);};exports['logLookAgent']=function(_0x59a128,_0x154171,_0x9aa32b){_0x59a128[_0x8f69('0x3a')]=_0x154171;_0x59a128[_0x8f69('0x3b')]=_0x9aa32b;};exports[_0x8f69('0x3c')]=function(_0xda9bd,_0x23b23c,_0xd9b0a4){var _0x52f47c=moment()[_0x8f69('0x13')](_0x8f69('0x3d'));_0xda9bd[_0x8f69('0x39')]=_0x23b23c;_0xda9bd['statedesc']=_0xd9b0a4;_0xda9bd[_0x8f69('0x36')]=_0xda9bd[_0x8f69('0x36')]?_0xda9bd[_0x8f69('0x36')]:_0x52f47c;_0xda9bd['endtime']=_0xda9bd['endtime']?_0xda9bd[_0x8f69('0x37')]:_0x52f47c;_0xda9bd[_0x8f69('0x3e')]=getSeconds(_0xda9bd[_0x8f69('0x36')]||0x0,_0xda9bd[_0x8f69('0x35')]||0x0);_0xda9bd[_0x8f69('0x3f')]=_0xda9bd[_0x8f69('0x40')]?getSeconds(_0xda9bd['endtime'],_0xda9bd[_0x8f69('0x40')]):0x0;};exports[_0x8f69('0x41')]=function(_0x577e41){return _0x577e41===_0x8f69('0x42');};exports['variablesAction']=function(_0x3bc5a3,_0xbdb23c,_0x26744f,_0x980898,_0x1a73ad){var _0x40519c=_0x980898?_0x8f69('0x43'):_0x3bc5a3['calleridname'];_0x40519c=_0x1a73ad?_0x8f69('0x44'):_0x40519c;return{'actionid':_0x3bc5a3[_0x8f69('0x45')],'action':_0x8f69('0x46'),'channel':_0x3bc5a3[_0x8f69('0x47')],'callerid':util[_0x8f69('0x13')]('\x22%s\x22\x20<%s>',_0x40519c,_0x3bc5a3[_0x8f69('0x1a')]),'Exten':_0x8f69('0x23'),'Context':_0x8f69('0x48'),'Priority':'1','variable':_0x26744f,'timeout':(_0xbdb23c[_0x8f69('0x49')]||0x1e)*0x3e8,'async':!![],'channelid':_0x3bc5a3[_0x8f69('0x45')]};};exports['totalGlobal']=function(_0x41fdb0){return _0x41fdb0[_0x8f69('0x4a')]+_0x41fdb0[_0x8f69('0x4b')]+_0x41fdb0[_0x8f69('0x4c')];};exports[_0x8f69('0x4d')]=function(_0x272955){var _0x459583=_[_0x8f69('0x4e')](_0x272955);_0x459583[_0x8f69('0x39')]=0xf;_0x459583[_0x8f69('0x33')]=_0x8f69('0x4f');return _0x459583;};exports[_0x8f69('0x50')]=function(_0x1de5e5,_0x4ad11e,_0x1f4244){var _0x56cb34={};_0x56cb34[_0x4ad11e]=_0x1de5e5[_0x4ad11e];_0x56cb34[_0x8f69('0x51')]=![];_0x56cb34[_0x8f69('0x52')]=moment()[_0x8f69('0x53')](_0x1f4244,_0x8f69('0x54'))[_0x8f69('0x13')]('YYYY-MM-DD\x20HH:mm:ss');_0x56cb34[_0x8f69('0x55')]=_0x1de5e5[_0x8f69('0x55')];_0x56cb34['ListId']=_0x1de5e5[_0x8f69('0x56')];_0x56cb34[_0x8f69('0x57')]=_0x1de5e5[_0x8f69('0x57')]||undefined;return _0x56cb34;};exports['decrementTalkink']=function(_0x353caf,_0x528e85){if(!_[_0x8f69('0x17')](_0x353caf)){if(_0x353caf[_0x8f69('0x58')]>0x0){_0x353caf[_0x8f69('0x58')]-=0x1;}else{logger[_0x8f69('0x9')](_0x528e85,_0x8f69('0x59'));}}else{logger['error'](_0x528e85,_0x8f69('0x5a'));}};exports['IsNotLoggedIn']=function(_0x2914c1){if(_0x2914c1<=0x0){return!![];}return![];};exports['buildObj']=function(_0x3ef911,_0x3b7969){_0x3ef911[_0x8f69('0x5b')]=_0x3b7969;_0x3ef911[_0x8f69('0x19')]=_0x3ef911[_0x8f69('0x5c')];_0x3ef911[_0x8f69('0x5d')]=_0x3ef911[_0x8f69('0x47')];return _0x3ef911;};exports[_0x8f69('0x5e')]=function(_0x34b31d){var _0x46acc5={};_0x46acc5[_0x8f69('0x5c')]=_0x34b31d['queue'];_0x46acc5['interface']=_0x34b31d[_0x8f69('0x47')];_0x46acc5['uniqueid']=_0x34b31d[_0x8f69('0x45')];return _0x46acc5;};exports['agentReadyId']=function(_0x29eadf){var _0x29b30d=[];for(var _0x1573c3 in _0x29eadf){if(_0x29eadf[_0x8f69('0x2c')](_0x1573c3)){if(!_[_0x8f69('0x17')](_0x29eadf[_0x1573c3])&&_0x29eadf[_0x1573c3]['state']==='not_inuse'&&_0x29eadf[_0x1573c3][_0x8f69('0x5f')]===_0x8f69('0x60')){_0x29b30d[_0x8f69('0x61')](_0x29eadf[_0x1573c3]['id']);}}}return _0x29b30d;};exports[_0x8f69('0x62')]=function(_0x5ae53d){var _0x3e4051=moment()[_0x8f69('0x6')](0x0);var _0x1b2b10=moment(_0x5ae53d)[_0x8f69('0x6')](0x0);return _0x3e4051[_0x8f69('0x63')](_0x1b2b10,'seconds');};exports[_0x8f69('0x64')]=function(_0x22af73){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x22af73[_0x8f69('0x55')],'ListId':_0x22af73[_0x8f69('0x56')],'VoiceQueueId':_0x22af73[_0x8f69('0x57')]||undefined,'CampaignId':_0x22af73['CampaignId']||undefined};};exports[_0x8f69('0x65')]=function(_0x51b0fb){if(_0x51b0fb==='uniqueid'||_0x51b0fb===_0x8f69('0x66')||_0x51b0fb===_0x8f69('0x5c')||_0x51b0fb===_0x8f69('0x67')||_0x51b0fb===_0x8f69('0x68')||_0x51b0fb==='dialAnswer'||_0x51b0fb===_0x8f69('0x3a')||_0x51b0fb===_0x8f69('0x47')||_0x51b0fb==='calleridname'||_0x51b0fb===_0x8f69('0x51')||_0x51b0fb===_0x8f69('0x1a')||_0x51b0fb==='scheduledat'||_0x51b0fb==='countbusyretry'||_0x51b0fb==='countcongestionretry'||_0x51b0fb===_0x8f69('0x4c')||_0x51b0fb===_0x8f69('0x69')||_0x51b0fb===_0x8f69('0x6a')||_0x51b0fb==='callbackuniqueid'||_0x51b0fb==='callbackat'||_0x51b0fb==='recallme'||_0x51b0fb===_0x8f69('0x55')||_0x51b0fb===_0x8f69('0x56')||_0x51b0fb===_0x8f69('0x3b')||_0x51b0fb===_0x8f69('0x57')||_0x51b0fb===_0x8f69('0x6b')||_0x51b0fb===_0x8f69('0x6c')||_0x51b0fb===_0x8f69('0x6d')||_0x51b0fb==='xmd-phone'||_0x51b0fb===_0x8f69('0x6e')||_0x51b0fb===_0x8f69('0x6f')||_0x51b0fb==='xmd-dialtimeout'||_0x51b0fb===_0x8f69('0x70')||_0x51b0fb==='xmd-dialid'||_0x51b0fb===_0x8f69('0x71')||_0x51b0fb===_0x8f69('0x72')||_0x51b0fb===_0x8f69('0x73')||_0x51b0fb==='xmd-callerid'||_0x51b0fb===_0x8f69('0x74')||_0x51b0fb===_0x8f69('0x75')||_0x51b0fb===_0x8f69('0x76')||_0x51b0fb===_0x8f69('0x77')||_0x51b0fb===_0x8f69('0x78')||_0x51b0fb==='rtpaudioqosjitterbridged'||_0x51b0fb===_0x8f69('0x79')||_0x51b0fb===_0x8f69('0x7a')||_0x51b0fb===_0x8f69('0x7b')||_0x51b0fb==='rtpaudioqosrttbridged'||_0x51b0fb===_0x8f69('0x76')||_0x51b0fb===_0x8f69('0x77')||_0x51b0fb===_0x8f69('0x78')||_0x51b0fb==='rtpaudioqosjitterbridged'||_0x51b0fb===_0x8f69('0x79')||_0x51b0fb===_0x8f69('0x7a')||_0x51b0fb==='rtpaudioqosrtt'||_0x51b0fb===_0x8f69('0x7c')||_0x51b0fb===_0x8f69('0x7d')||_0x51b0fb===_0x8f69('0x7e')||_0x51b0fb===_0x8f69('0x39')||_0x51b0fb===_0x8f69('0x33')){return![];}return!![];};exports[_0x8f69('0x7f')]=function(_0x2a1639,_0x2a91e9){var _0x5f2a13,_0x5bbcfd,_0x33390d;if(_0x2a91e9<=0x0){_0x2a91e9=0x1;}_0x5f2a13=new RegExp('\x5cw{0,'+_0x2a91e9+'}$');_0x5bbcfd=Math[_0x8f69('0x80')](0xa,_0x2a91e9-0x1);_0x33390d=Math[_0x8f69('0x80')](0xa,_0x2a91e9)-0x1;return util[_0x8f69('0x13')]('%s',_[_0x8f69('0x81')](_0x2a1639,_0x5f2a13,_[_0x8f69('0x82')](_0x5bbcfd,_0x33390d)));};exports['extractCalleridName']=function(_0x351f6f){var _0x5b83ff=_0x351f6f['match'](/"(.*?)"/);return _0x5b83ff?_0x5b83ff[0x1]:_0x351f6f;};exports[_0x8f69('0x83')]=function(_0x37b0cf){var _0x32ebf5=_0x37b0cf[_0x8f69('0x84')](/<(.*?)>/);return _0x32ebf5?_0x32ebf5[0x1]:_0x37b0cf;}; \ No newline at end of file diff --git a/server/services/ami/properties.js b/server/services/ami/properties.js index 57e9160..674f192 100644 --- a/server/services/ami/properties.js +++ b/server/services/ami/properties.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5f2f=['number','boolean','queueremove','reload','voicequeuechannel','voicechannel','voicequeuechannelhangup','queueadd','string'];(function(_0x47f0b6,_0x3daf1a){var _0x53c469=function(_0x3aa790){while(--_0x3aa790){_0x47f0b6['push'](_0x47f0b6['shift']());}};_0x53c469(++_0x3daf1a);}(_0x5f2f,0x73));var _0xf5f2=function(_0x14d391,_0x2be67d){_0x14d391=_0x14d391-0x0;var _0x375545=_0x5f2f[_0x14d391];return _0x375545;};'use strict';exports[_0xf5f2('0x0')]={'queue':{'type':_0xf5f2('0x1'),'required':!![]},'interface':{'type':_0xf5f2('0x1'),'required':!![]},'membername':{'type':_0xf5f2('0x1'),'required':!![]},'penalty':{'type':_0xf5f2('0x2'),'required':![]},'paused':{'type':_0xf5f2('0x3'),'required':![]}};exports[_0xf5f2('0x4')]={'queue':{'type':_0xf5f2('0x1'),'required':!![]},'interface':{'type':'string','required':!![]}};exports['queuepause']={'interface':{'type':_0xf5f2('0x1'),'required':!![]},'paused':{'type':_0xf5f2('0x3')},'reason':{'type':_0xf5f2('0x1'),'required':![]}};exports[_0xf5f2('0x5')]={'module':{'type':_0xf5f2('0x1'),'required':![]}};exports[_0xf5f2('0x6')]={'uniqueid':{'type':'string','required':!![]}};exports[_0xf5f2('0x7')]={'uniqueid':{'type':_0xf5f2('0x1'),'required':!![]},'filename':{'type':_0xf5f2('0x1')},'format':{'type':'string'},'mixmonitorid':{'type':_0xf5f2('0x1')}};exports[_0xf5f2('0x8')]={'uniqueid':{'type':_0xf5f2('0x1'),'required':!![]}};exports['voicequeuechannelredirect']={'uniqueid':{'type':_0xf5f2('0x1'),'required':!![]},'exten':{'type':'string','required':!![]},'context':{'type':'string'}}; \ No newline at end of file +var _0x5f2f=['number','boolean','queueremove','reload','voicequeuechannel','voicechannel','voicequeuechannelhangup','queueadd','string'];(function(_0x344a7b,_0x165174){var _0x30df3e=function(_0x4fccdd){while(--_0x4fccdd){_0x344a7b['push'](_0x344a7b['shift']());}};_0x30df3e(++_0x165174);}(_0x5f2f,0x73));var _0xf5f2=function(_0x4771b0,_0xfbeaed){_0x4771b0=_0x4771b0-0x0;var _0x2b8e4e=_0x5f2f[_0x4771b0];return _0x2b8e4e;};'use strict';exports[_0xf5f2('0x0')]={'queue':{'type':_0xf5f2('0x1'),'required':!![]},'interface':{'type':_0xf5f2('0x1'),'required':!![]},'membername':{'type':_0xf5f2('0x1'),'required':!![]},'penalty':{'type':_0xf5f2('0x2'),'required':![]},'paused':{'type':_0xf5f2('0x3'),'required':![]}};exports[_0xf5f2('0x4')]={'queue':{'type':_0xf5f2('0x1'),'required':!![]},'interface':{'type':'string','required':!![]}};exports['queuepause']={'interface':{'type':_0xf5f2('0x1'),'required':!![]},'paused':{'type':_0xf5f2('0x3')},'reason':{'type':_0xf5f2('0x1'),'required':![]}};exports[_0xf5f2('0x5')]={'module':{'type':_0xf5f2('0x1'),'required':![]}};exports[_0xf5f2('0x6')]={'uniqueid':{'type':'string','required':!![]}};exports[_0xf5f2('0x7')]={'uniqueid':{'type':_0xf5f2('0x1'),'required':!![]},'filename':{'type':_0xf5f2('0x1')},'format':{'type':'string'},'mixmonitorid':{'type':_0xf5f2('0x1')}};exports[_0xf5f2('0x8')]={'uniqueid':{'type':_0xf5f2('0x1'),'required':!![]}};exports['voicequeuechannelredirect']={'uniqueid':{'type':_0xf5f2('0x1'),'required':!![]},'exten':{'type':'string','required':!![]},'context':{'type':'string'}}; \ No newline at end of file diff --git a/server/services/ami/realtime/index.js b/server/services/ami/realtime/index.js index f61c4b8..6bdbc08 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 _0xc034=['initServicenowAccounts','initDynamics365Accounts','merge','initVoiceQueueReports','groupBy','uniqueid','queue','queuecallerexit','queuecallerabandon','queuecallerleaveAt','diff','queuecallerjoinAt','seconds','queuecallercompleteAt','queuecallerexitAt','queuecallercomplete','initVoiceCallReports','duration','ANSWERED','billableseconds','voiceExtensions','initCampaignHopperHistory','initFaxAccounts','exports','bluebird','lodash','../model/agent','../model/telephone','../model/voiceQueue','../model/trigger','../model/template','../model/campaign','../model/voiceExtension','../model/salesforceAccount','../model/sugarcrmAccount','../model/zohoAccount','../model/deskAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','../model/faxAccount','agents','telephones','trunks','voiceQueues','campaigns','templates','outbound','channels','queueChannels','timers','zendeskAccounts','salesforceAccounts','sugarcrmAccounts','freshdeskAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','faxAccounts','hasOwnProperty','mapKeys','format','SIP/%s','name','interface','total','answered','sumHoldTime','sumDuration','sumBillable','isEmpty','unmanaged','abandoned','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','prototype','mergeFromDatabase','length','isNil','initTrunks','isUndefined','initVoiceQueues','initTriggers','triggers','initTemplates','initZendeskAccounts','initSalesforceAccounts','initZohoAccounts','initDeskAccounts','initSugarcrmAccounts','initVtigerAccounts'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xc034,0xe0));var _0x4c03=function(_0x3d3c44,_0x4a0bd8){_0x3d3c44=_0x3d3c44-0x0;var _0x2f6e04=_0xc034[_0x3d3c44];return _0x2f6e04;};'use strict';var BPromise=require(_0x4c03('0x0'));var util=require('util');var _=require(_0x4c03('0x1'));var moment=require('moment');var Agent=require(_0x4c03('0x2'));var Telephone=require(_0x4c03('0x3'));var Trunk=require('../model/trunk');var VoiceQueue=require(_0x4c03('0x4'));var Trigger=require(_0x4c03('0x5'));var Template=require(_0x4c03('0x6'));var Campaign=require(_0x4c03('0x7'));var VoiceExtension=require(_0x4c03('0x8'));var ZendeskAccount=require('../model/zendeskAccount');var SalesforceAccount=require(_0x4c03('0x9'));var FreshdeskAccount=require('../model/freshdeskAccount');var SugarcrmAccount=require(_0x4c03('0xa'));var ZohoAccount=require(_0x4c03('0xb'));var DeskAccount=require(_0x4c03('0xc'));var VtigerAccount=require(_0x4c03('0xd'));var ServicenowAccount=require(_0x4c03('0xe'));var Dynamics365Account=require(_0x4c03('0xf'));var FaxAccount=require(_0x4c03('0x10'));var Realtime=function(){this[_0x4c03('0x11')]={};this[_0x4c03('0x12')]={};this[_0x4c03('0x13')]={};this[_0x4c03('0x14')]={};this['triggers']={};this[_0x4c03('0x15')]={};this[_0x4c03('0x16')]={};this[_0x4c03('0x17')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this['voiceExtensions']={};this[_0x4c03('0x18')]={};this[_0x4c03('0x19')]={};this['outboundChannels']={};this[_0x4c03('0x1a')]={};this[_0x4c03('0x1b')]={};this[_0x4c03('0x1c')]={};this[_0x4c03('0x1d')]={};this[_0x4c03('0x1e')]={};this[_0x4c03('0x1f')]={};this[_0x4c03('0x20')]={};this[_0x4c03('0x21')]={};this[_0x4c03('0x22')]={};this[_0x4c03('0x23')]={};this[_0x4c03('0x24')]={};};function freeIsNotKey(_0x3d9877,_0x594c6d,_0x39aba8){var _0x4ff9ea=_['mapKeys'](_0x3d9877,function(_0xf87bb2,_0x34df7b){return _0xf87bb2[_0x39aba8];});for(var _0x2e21f1 in _0x594c6d){if(_0x594c6d[_0x4c03('0x25')](_0x2e21f1)){if(!_0x4ff9ea[_0x2e21f1]){delete _0x594c6d[_0x2e21f1];}}}}function freeIsNotKeySip(_0x1edd72,_0x4ab0ca){var _0xa26238=_[_0x4c03('0x26')](_0x1edd72,function(_0x1eec00,_0x64b793){return util[_0x4c03('0x27')](_0x4c03('0x28'),_0x1eec00[_0x4c03('0x29')]);});for(var _0x45f004 in _0x4ab0ca){if(_0x4ab0ca[_0x4c03('0x25')](_0x45f004)){if(!_0xa26238[_0x45f004]){delete _0x4ab0ca[_0x45f004];}}}}function freeIsNotKeyAgent(_0x28bf09,_0x835808){var _0x13fe86=_[_0x4c03('0x26')](_0x28bf09,function(_0x3d0bda,_0x133099){var _0x4d7406=_['isNil'](_0x3d0bda[_0x4c03('0x2a')])?util[_0x4c03('0x27')](_0x4c03('0x28'),_0x3d0bda[_0x4c03('0x29')]):_0x3d0bda[_0x4c03('0x2a')];return _0x4d7406;});for(var _0x55ca50 in _0x835808){if(_0x835808[_0x4c03('0x25')](_0x55ca50)){if(!_0x13fe86[_0x55ca50]){delete _0x835808[_0x55ca50];}}}}function clearVoiceCallReports(_0x442d8b){_0x442d8b[_0x4c03('0x2b')]=0x0;_0x442d8b[_0x4c03('0x2c')]=0x0;_0x442d8b[_0x4c03('0x2d')]=0x0;_0x442d8b[_0x4c03('0x2e')]=0x0;_0x442d8b[_0x4c03('0x2f')]=0x0;}function clearCampaigns(_0x21f30f){if(!_[_0x4c03('0x30')](_0x21f30f)){for(var _0xb33b23 in _0x21f30f){if(_0x21f30f['hasOwnProperty'](_0xb33b23)){_0x21f30f[_0xb33b23]['ivrTotalCallsDays']=0x0;_0x21f30f[_0xb33b23]['ivrAnswerCallsDay']=0x0;}}}}function clearVoiceQueues(_0x5f1b04){if(!_[_0x4c03('0x30')](_0x5f1b04)){for(var _0x54130f in _0x5f1b04){if(_0x5f1b04[_0x4c03('0x25')](_0x54130f)){_0x5f1b04[_0x54130f]['total']=0x0;_0x5f1b04[_0x54130f]['answered']=0x0;_0x5f1b04[_0x54130f][_0x4c03('0x31')]=0x0;_0x5f1b04[_0x54130f][_0x4c03('0x32')]=0x0;_0x5f1b04[_0x54130f][_0x4c03('0x2d')]=0x0;_0x5f1b04[_0x54130f][_0x4c03('0x2e')]=0x0;_0x5f1b04[_0x54130f][_0x4c03('0x2f')]=0x0;_0x5f1b04[_0x54130f]['outboundAnswerAgiCallsDay']=0x0;_0x5f1b04[_0x54130f]['outboundNoAnswerCallsDay']=0x0;_0x5f1b04[_0x54130f]['outboundBusyCallsDay']=0x0;_0x5f1b04[_0x54130f]['outboundCongestionCallsDay']=0x0;_0x5f1b04[_0x54130f][_0x4c03('0x33')]=0x0;_0x5f1b04[_0x54130f][_0x4c03('0x34')]=0x0;_0x5f1b04[_0x54130f][_0x4c03('0x35')]=0x0;_0x5f1b04[_0x54130f][_0x4c03('0x36')]=0x0;_0x5f1b04[_0x54130f][_0x4c03('0x37')]=0x0;_0x5f1b04[_0x54130f][_0x4c03('0x38')]=0x0;_0x5f1b04[_0x54130f][_0x4c03('0x39')]=0x0;_0x5f1b04[_0x54130f]['outboundReCallsDay']=0x0;_0x5f1b04[_0x54130f][_0x4c03('0x3a')]=0x0;_0x5f1b04[_0x54130f][_0x4c03('0x3b')]=0x0;_0x5f1b04[_0x54130f]['queueStatusComplete']=!![];}}}}Realtime[_0x4c03('0x3c')][_0x4c03('0x3d')]=function(_0x219e34,_0x3ab6bd){for(var _0x4be037 in _0x3ab6bd){if(_0x219e34['hasOwnProperty'](_0x4be037)){_0x219e34[_0x4be037]=_0x3ab6bd[_0x4be037];}}};Realtime[_0x4c03('0x3c')]['initAgents']=function(){var _0x2db996=this;return function(_0x4202b4){if(_0x4202b4){freeIsNotKeyAgent(_0x4202b4,_0x2db996[_0x4c03('0x11')]);for(var _0x35b772=0x0,_0x5d3bb8={},_0x5c9a75={};_0x35b772<_0x4202b4[_0x4c03('0x3e')];_0x35b772+=0x1){_0x5d3bb8=_0x4202b4[_0x35b772];var _0x313910=_[_0x4c03('0x3f')](_0x5d3bb8['interface'])?util[_0x4c03('0x27')](_0x4c03('0x28'),_0x5d3bb8[_0x4c03('0x29')]):_0x5d3bb8[_0x4c03('0x2a')];if(_['isUndefined'](_0x2db996[_0x4c03('0x11')][_0x313910])){_0x2db996[_0x4c03('0x11')][_0x313910]=new Agent(_0x5d3bb8);}else{_0x2db996[_0x4c03('0x3d')](_0x2db996[_0x4c03('0x11')][_0x313910],_0x5d3bb8);}}}return _0x2db996[_0x4c03('0x11')];};};Realtime[_0x4c03('0x3c')]['initTelephones']=function(){var _0x117d83=this;return function(_0x1cb5a7){if(_0x1cb5a7){freeIsNotKeySip(_0x1cb5a7,_0x117d83[_0x4c03('0x12')]);for(var _0x51cae1=0x0,_0x51c91c={},_0x4b59f6={};_0x51cae1<_0x1cb5a7[_0x4c03('0x3e')];_0x51cae1+=0x1){_0x51c91c=_0x1cb5a7[_0x51cae1];if(_['isUndefined'](_0x117d83[_0x4c03('0x12')][util[_0x4c03('0x27')]('SIP/%s',_0x51c91c[_0x4c03('0x29')])])){_0x117d83[_0x4c03('0x12')][util[_0x4c03('0x27')](_0x4c03('0x28'),_0x51c91c[_0x4c03('0x29')])]=new Telephone(_0x51c91c);}else{_0x117d83[_0x4c03('0x3d')](_0x117d83['telephones'][util[_0x4c03('0x27')](_0x4c03('0x28'),_0x51c91c[_0x4c03('0x29')])],_0x51c91c);}}}return _0x117d83[_0x4c03('0x12')];};};Realtime['prototype'][_0x4c03('0x40')]=function(){var _0xd1764c=this;return function(_0x2de7b5){if(_0x2de7b5){freeIsNotKeySip(_0x2de7b5,_0xd1764c['trunks']);for(var _0x52e918=0x0,_0x378d22={},_0x55e6d4={};_0x52e918<_0x2de7b5['length'];_0x52e918+=0x1){_0x378d22=_0x2de7b5[_0x52e918];if(_[_0x4c03('0x41')](_0xd1764c[_0x4c03('0x13')][util['format']('SIP/%s',_0x378d22[_0x4c03('0x29')])])){_0xd1764c[_0x4c03('0x13')][util['format'](_0x4c03('0x28'),_0x378d22['name'])]=new Trunk(_0x378d22);}else{_0xd1764c['mergeFromDatabase'](_0xd1764c[_0x4c03('0x13')][util['format']('SIP/%s',_0x378d22[_0x4c03('0x29')])],_0x378d22);}}}return _0xd1764c[_0x4c03('0x13')];};};Realtime['prototype'][_0x4c03('0x42')]=function(){var _0xc27944=this;return function(_0x15c12b){if(_0x15c12b){freeIsNotKey(_0x15c12b,_0xc27944['voiceQueues'],'name');for(var _0x27b70b=0x0,_0x198d43={},_0x55a073={};_0x27b70b<_0x15c12b[_0x4c03('0x3e')];_0x27b70b+=0x1){_0x198d43=_0x15c12b[_0x27b70b];if(_[_0x4c03('0x41')](_0xc27944[_0x4c03('0x14')][_0x198d43[_0x4c03('0x29')]])){_0xc27944[_0x4c03('0x14')][_0x198d43[_0x4c03('0x29')]]=new VoiceQueue(_0x198d43);}else{_0xc27944[_0x4c03('0x3d')](_0xc27944[_0x4c03('0x14')][_0x198d43[_0x4c03('0x29')]],_0x198d43);}}}return _0xc27944['voiceQueues'];};};Realtime[_0x4c03('0x3c')][_0x4c03('0x43')]=function(){var _0x16d661=this;return function(_0x56ab00){if(_0x56ab00){freeIsNotKey(_0x56ab00,_0x16d661[_0x4c03('0x44')],'id');for(var _0x17484f=0x0,_0x50f8e7={},_0x58fbe0={};_0x17484f<_0x56ab00[_0x4c03('0x3e')];_0x17484f+=0x1){_0x50f8e7=_0x56ab00[_0x17484f];if(_[_0x4c03('0x41')](_0x16d661['triggers'][_0x50f8e7['id']])){_0x16d661[_0x4c03('0x44')][_0x50f8e7['id']]=new Trigger(_0x50f8e7);}else{_0x16d661[_0x4c03('0x3d')](_0x16d661['triggers'][_0x50f8e7['id']],_0x50f8e7);}}}return _0x16d661[_0x4c03('0x44')];};};Realtime['prototype'][_0x4c03('0x45')]=function(){var _0x420a95=this;return function(_0x1f9429){if(_0x1f9429){freeIsNotKey(_0x1f9429,_0x420a95['templates'],'id');for(var _0xdb2f81=0x0,_0x4dd57a={},_0x1384ea={};_0xdb2f81<_0x1f9429[_0x4c03('0x3e')];_0xdb2f81+=0x1){_0x4dd57a=_0x1f9429[_0xdb2f81];if(_[_0x4c03('0x41')](_0x420a95[_0x4c03('0x16')][_0x4dd57a['id']])){_0x420a95[_0x4c03('0x16')][_0x4dd57a['id']]=new Template(_0x4dd57a);}else{_0x420a95[_0x4c03('0x3d')](_0x420a95['templates'][_0x4dd57a['id']],_0x4dd57a);}}}return _0x420a95[_0x4c03('0x16')];};};Realtime[_0x4c03('0x3c')][_0x4c03('0x46')]=function(){var _0x2d0b40=this;return function(_0xa6d201){if(_0xa6d201){freeIsNotKey(_0xa6d201,_0x2d0b40['zendeskAccounts'],'id');for(var _0x561d6f=0x0,_0x52c5db={},_0x3bb820={};_0x561d6f<_0xa6d201[_0x4c03('0x3e')];_0x561d6f+=0x1){_0x52c5db=_0xa6d201[_0x561d6f];if(_[_0x4c03('0x41')](_0x2d0b40[_0x4c03('0x1b')][_0x52c5db['id']])){_0x2d0b40['zendeskAccounts'][_0x52c5db['id']]=new ZendeskAccount(_0x52c5db);}else{_0x2d0b40[_0x4c03('0x3d')](_0x2d0b40['zendeskAccounts'][_0x52c5db['id']],_0x52c5db);}}}return _0x2d0b40['zendeskAccounts'];};};Realtime['prototype'][_0x4c03('0x47')]=function(){var _0x18eb7=this;return function(_0xc35acf){if(_0xc35acf){freeIsNotKey(_0xc35acf,_0x18eb7[_0x4c03('0x1c')],'id');for(var _0x1bd3da=0x0,_0x2e9d04={},_0x3b6ff2={};_0x1bd3da<_0xc35acf[_0x4c03('0x3e')];_0x1bd3da+=0x1){_0x2e9d04=_0xc35acf[_0x1bd3da];if(_['isUndefined'](_0x18eb7[_0x4c03('0x1c')][_0x2e9d04['id']])){_0x18eb7[_0x4c03('0x1c')][_0x2e9d04['id']]=new SalesforceAccount(_0x2e9d04);}else{_0x18eb7[_0x4c03('0x3d')](_0x18eb7[_0x4c03('0x1c')][_0x2e9d04['id']],_0x2e9d04);}}}return _0x18eb7[_0x4c03('0x1c')];};};Realtime[_0x4c03('0x3c')]['initFreshdeskAccounts']=function(){var _0x49b0cd=this;return function(_0x16e2fe){if(_0x16e2fe){freeIsNotKey(_0x16e2fe,_0x49b0cd[_0x4c03('0x1e')],'id');for(var _0xec7589=0x0,_0x4b2d62={},_0x49ec75={};_0xec7589<_0x16e2fe['length'];_0xec7589+=0x1){_0x4b2d62=_0x16e2fe[_0xec7589];if(_[_0x4c03('0x41')](_0x49b0cd[_0x4c03('0x1e')][_0x4b2d62['id']])){_0x49b0cd[_0x4c03('0x1e')][_0x4b2d62['id']]=new FreshdeskAccount(_0x4b2d62);}else{_0x49b0cd[_0x4c03('0x3d')](_0x49b0cd[_0x4c03('0x1e')][_0x4b2d62['id']],_0x4b2d62);}}}return _0x49b0cd[_0x4c03('0x1e')];};};Realtime[_0x4c03('0x3c')][_0x4c03('0x48')]=function(){var _0x5b3a65=this;return function(_0x393c11){if(_0x393c11){freeIsNotKey(_0x393c11,_0x5b3a65[_0x4c03('0x1f')],'id');for(var _0x2d9366=0x0,_0x50f69f={},_0x3890c8={};_0x2d9366<_0x393c11[_0x4c03('0x3e')];_0x2d9366+=0x1){_0x50f69f=_0x393c11[_0x2d9366];if(_[_0x4c03('0x41')](_0x5b3a65[_0x4c03('0x1f')][_0x50f69f['id']])){_0x5b3a65[_0x4c03('0x1f')][_0x50f69f['id']]=new ZohoAccount(_0x50f69f);}else{_0x5b3a65[_0x4c03('0x3d')](_0x5b3a65[_0x4c03('0x1f')][_0x50f69f['id']],_0x50f69f);}}}return _0x5b3a65[_0x4c03('0x1f')];};};Realtime[_0x4c03('0x3c')][_0x4c03('0x49')]=function(){var _0x218088=this;return function(_0x3fb4ed){if(_0x3fb4ed){freeIsNotKey(_0x3fb4ed,_0x218088['deskAccounts'],'id');for(var _0x2b58fb=0x0,_0x37b28e={},_0x35ac66={};_0x2b58fb<_0x3fb4ed[_0x4c03('0x3e')];_0x2b58fb+=0x1){_0x37b28e=_0x3fb4ed[_0x2b58fb];if(_[_0x4c03('0x41')](_0x218088['deskAccounts'][_0x37b28e['id']])){_0x218088[_0x4c03('0x20')][_0x37b28e['id']]=new DeskAccount(_0x37b28e);}else{_0x218088[_0x4c03('0x3d')](_0x218088[_0x4c03('0x20')][_0x37b28e['id']],_0x37b28e);}}}return _0x218088[_0x4c03('0x20')];};};Realtime[_0x4c03('0x3c')][_0x4c03('0x4a')]=function(){var _0x58b397=this;return function(_0x4fa318){if(_0x4fa318){freeIsNotKey(_0x4fa318,_0x58b397[_0x4c03('0x1d')],'id');for(var _0x46fb97=0x0,_0x584d37={},_0x3fb083={};_0x46fb97<_0x4fa318[_0x4c03('0x3e')];_0x46fb97+=0x1){_0x584d37=_0x4fa318[_0x46fb97];if(_[_0x4c03('0x41')](_0x58b397[_0x4c03('0x1d')][_0x584d37['id']])){_0x58b397[_0x4c03('0x1d')][_0x584d37['id']]=new SugarcrmAccount(_0x584d37);}else{_0x58b397[_0x4c03('0x3d')](_0x58b397[_0x4c03('0x1d')][_0x584d37['id']],_0x584d37);}}}return _0x58b397[_0x4c03('0x1d')];};};Realtime[_0x4c03('0x3c')][_0x4c03('0x4b')]=function(){var _0x4dfd92=this;return function(_0x4320b0){if(_0x4320b0){freeIsNotKey(_0x4320b0,_0x4dfd92['vtigerAccounts'],'id');for(var _0xe83b5d=0x0,_0x2142df={},_0x4765fb={};_0xe83b5d<_0x4320b0[_0x4c03('0x3e')];_0xe83b5d+=0x1){_0x2142df=_0x4320b0[_0xe83b5d];if(_[_0x4c03('0x41')](_0x4dfd92['vtigerAccounts'][_0x2142df['id']])){_0x4dfd92[_0x4c03('0x21')][_0x2142df['id']]=new VtigerAccount(_0x2142df);}else{_0x4dfd92[_0x4c03('0x3d')](_0x4dfd92[_0x4c03('0x21')][_0x2142df['id']],_0x2142df);}}}return _0x4dfd92[_0x4c03('0x21')];};};Realtime[_0x4c03('0x3c')][_0x4c03('0x4c')]=function(){var _0x363a65=this;return function(_0x322ab7){if(_0x322ab7){freeIsNotKey(_0x322ab7,_0x363a65['servicenowAccounts'],'id');for(var _0x429da3=0x0,_0x594a4d={},_0x3cfc68={};_0x429da3<_0x322ab7['length'];_0x429da3+=0x1){_0x594a4d=_0x322ab7[_0x429da3];if(_[_0x4c03('0x41')](_0x363a65[_0x4c03('0x22')][_0x594a4d['id']])){_0x363a65[_0x4c03('0x22')][_0x594a4d['id']]=new ServicenowAccount(_0x594a4d);}else{_0x363a65[_0x4c03('0x3d')](_0x363a65[_0x4c03('0x22')][_0x594a4d['id']],_0x594a4d);}}}return _0x363a65['servicenowAccounts'];};};Realtime[_0x4c03('0x3c')][_0x4c03('0x4d')]=function(){var _0x3d81ec=this;return function(_0x225dab){if(_0x225dab){freeIsNotKey(_0x225dab,_0x3d81ec[_0x4c03('0x23')],'id');for(var _0x2f09fc=0x0,_0x12ace7={},_0x14f13a={};_0x2f09fc<_0x225dab[_0x4c03('0x3e')];_0x2f09fc+=0x1){_0x12ace7=_0x225dab[_0x2f09fc];if(_['isUndefined'](_0x3d81ec[_0x4c03('0x23')][_0x12ace7['id']])){_0x3d81ec['dynamics365Accounts'][_0x12ace7['id']]=new Dynamics365Account(_0x12ace7);}else{_0x3d81ec['mergeFromDatabase'](_0x3d81ec[_0x4c03('0x23')][_0x12ace7['id']],_0x12ace7);}}}return _0x3d81ec[_0x4c03('0x23')];};};Realtime[_0x4c03('0x3c')]['initVoiceQueueHopperHistory']=function(){var _0xf37cdc=this;return function(_0x4607c9){for(var _0x197207=0x0;_0x197207<_0x4607c9['length'];_0x197207+=0x1){_[_0x4c03('0x4e')](_0xf37cdc['voiceQueues'][_0x4607c9[_0x197207][_0x4c03('0x29')]],_0x4607c9[_0x197207]);}return _0xf37cdc[_0x4c03('0x14')];};};Realtime[_0x4c03('0x3c')][_0x4c03('0x4f')]=function(){var _0x363b18=this;return function(_0x5172ee){clearVoiceQueues(_0x363b18[_0x4c03('0x14')]);if(_0x5172ee){_0x5172ee=_[_0x4c03('0x50')](_0x5172ee,_0x4c03('0x51'));for(var _0x3b857d in _0x5172ee){if(_0x5172ee[_0x4c03('0x25')](_0x3b857d)){var _0x3e8c95={};for(var _0x105bf0=0x0;_0x105bf0<_0x5172ee[_0x3b857d]['length'];_0x105bf0+=0x1){var _0x1ccc69=_0x5172ee[_0x3b857d][_0x105bf0][_0x4c03('0x52')];if(_0x363b18[_0x4c03('0x14')][_0x1ccc69]){if(_0x5172ee[_0x3b857d][_0x105bf0][_0x4c03('0x53')]){_0x363b18[_0x4c03('0x14')][_0x1ccc69][_0x4c03('0x31')]+=0x1;}if(_0x5172ee[_0x3b857d][_0x105bf0][_0x4c03('0x54')]){_0x363b18['voiceQueues'][_0x1ccc69][_0x4c03('0x32')]+=0x1;}_0x363b18['voiceQueues'][_0x1ccc69]['sumHoldTime']+=moment(_0x5172ee[_0x3b857d][_0x105bf0][_0x4c03('0x55')])[_0x4c03('0x56')](moment(_0x5172ee[_0x3b857d][_0x105bf0][_0x4c03('0x57')]),_0x4c03('0x58'))||0x0;if(_0x105bf0===_0x5172ee[_0x3b857d][_0x4c03('0x3e')]-0x1){_0x363b18[_0x4c03('0x14')][_0x1ccc69]['sumDuration']+=moment(_0x5172ee[_0x3b857d][_0x105bf0][_0x4c03('0x59')]||_0x5172ee[_0x3b857d][_0x105bf0]['queuecallerabandonAt']||_0x5172ee[_0x3b857d][_0x105bf0][_0x4c03('0x5a')])[_0x4c03('0x56')](moment(_0x5172ee[_0x3b857d][_0x105bf0][_0x4c03('0x57')]),_0x4c03('0x58'))||0x0;_0x363b18[_0x4c03('0x14')][_0x1ccc69][_0x4c03('0x2b')]+=0x1;if(_0x5172ee[_0x3b857d][_0x105bf0][_0x4c03('0x5b')]){_0x363b18[_0x4c03('0x14')][_0x1ccc69][_0x4c03('0x2c')]+=0x1;_0x363b18['voiceQueues'][_0x1ccc69][_0x4c03('0x2f')]+=moment(_0x5172ee[_0x3b857d][_0x105bf0][_0x4c03('0x59')])['diff'](moment(_0x5172ee[_0x3b857d][_0x105bf0]['queuecallerleaveAt']),'seconds')||0x0;}}else{_0x363b18[_0x4c03('0x14')][_0x1ccc69]['sumDuration']+=_0x363b18[_0x4c03('0x14')][_0x1ccc69][_0x4c03('0x2d')]||0x0;}}}}}}return _0x363b18[_0x4c03('0x14')];};};Realtime['prototype'][_0x4c03('0x5c')]=function(){var _0x12cb05=this;return function(_0x332352){clearVoiceCallReports(_0x12cb05[_0x4c03('0x17')]);if(_0x332352){for(var _0x18ba66=0x0;_0x18ba66<_0x332352[_0x4c03('0x3e')];_0x18ba66+=0x1){_0x12cb05[_0x4c03('0x17')][_0x4c03('0x2b')]+=0x1;_0x12cb05[_0x4c03('0x17')]['sumDuration']+=_0x332352[_0x18ba66][_0x4c03('0x5d')];if(_0x332352[_0x18ba66]['disposition']===_0x4c03('0x5e')){_0x12cb05[_0x4c03('0x17')]['answered']+=0x1;_0x12cb05['outbound'][_0x4c03('0x2d')]+=_0x332352[_0x18ba66][_0x4c03('0x5d')]-_0x332352[_0x18ba66][_0x4c03('0x5f')]||0x0;_0x12cb05[_0x4c03('0x17')][_0x4c03('0x2f')]+=_0x332352[_0x18ba66][_0x4c03('0x5f')];}}}return _0x12cb05['outbound'];};};Realtime[_0x4c03('0x3c')]['initCampaigns']=function(){var _0x3b5ca2=this;return function(_0x13fb5c){if(_0x13fb5c){freeIsNotKey(_0x13fb5c,_0x3b5ca2[_0x4c03('0x15')],'name');for(var _0x1b1cf2=0x0,_0x1698e7={};_0x1b1cf2<_0x13fb5c['length'];_0x1b1cf2+=0x1){_0x1698e7=_0x13fb5c[_0x1b1cf2];if(_[_0x4c03('0x41')](_0x3b5ca2[_0x4c03('0x15')][_0x1698e7[_0x4c03('0x29')]])){_0x3b5ca2[_0x4c03('0x15')][_0x1698e7[_0x4c03('0x29')]]=new Campaign(_0x1698e7);}else{_0x3b5ca2['mergeFromDatabase'](_0x3b5ca2[_0x4c03('0x15')][_0x1698e7['name']],_0x1698e7);}}}return _0x3b5ca2[_0x4c03('0x15')];};};Realtime['prototype']['initVoiceExtensions']=function(){var _0x5470d9=this;return function(_0x35cd1f){if(_0x35cd1f){freeIsNotKey(_0x35cd1f,_0x5470d9[_0x4c03('0x60')],'id');for(var _0x2a6883=0x0,_0x2e3104={};_0x2a6883<_0x35cd1f['length'];_0x2a6883+=0x1){_0x2e3104=_0x35cd1f[_0x2a6883];if(_[_0x4c03('0x41')](_0x5470d9[_0x4c03('0x60')][_0x2e3104['id']])){_0x5470d9[_0x4c03('0x60')][_0x2e3104['id']]=new VoiceExtension(_0x2e3104);}else{_0x5470d9[_0x4c03('0x3d')](_0x5470d9[_0x4c03('0x60')][_0x2e3104['id']],_0x2e3104);}}}return _0x5470d9['voiceExtensions'];};};Realtime['prototype'][_0x4c03('0x61')]=function(){var _0x5537b6=this;return function(_0x1b6655){clearCampaigns(_0x5537b6['campaigns']);for(var _0x48c73d=0x0;_0x48c73d<_0x1b6655['length'];_0x48c73d+=0x1){_['merge'](_0x5537b6[_0x4c03('0x15')][_0x1b6655[_0x48c73d][_0x4c03('0x29')]],_0x1b6655[_0x48c73d]);}return _0x5537b6[_0x4c03('0x15')];};};Realtime[_0x4c03('0x3c')][_0x4c03('0x62')]=function(){var _0x4f1932=this;return function(_0x3efbf9){if(_0x3efbf9){freeIsNotKey(_0x3efbf9,_0x4f1932['faxAccounts'],'id');for(var _0x3609d9=0x0,_0x399863={},_0x5f275b={};_0x3609d9<_0x3efbf9[_0x4c03('0x3e')];_0x3609d9+=0x1){_0x399863=_0x3efbf9[_0x3609d9];if(_[_0x4c03('0x41')](_0x4f1932[_0x4c03('0x24')][_0x399863['id']])){_0x4f1932[_0x4c03('0x24')][_0x399863['id']]=new FaxAccount(_0x399863);}else{_0x4f1932['mergeFromDatabase'](_0x4f1932[_0x4c03('0x24')][_0x399863['id']],_0x399863);}}}return _0x4f1932[_0x4c03('0x24')];};};module[_0x4c03('0x63')]=Realtime; \ No newline at end of file +var _0x45a5=['initCampaignHopperHistory','initFaxAccounts','faxAccounts','exports','bluebird','util','lodash','../model/agent','../model/telephone','../model/trigger','../model/template','../model/campaign','../model/voiceExtension','../model/zendeskAccount','../model/salesforceAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/zohoAccount','../model/deskAccount','../model/vtigerAccount','../model/dynamics365Account','../model/faxAccount','agents','telephones','trunks','triggers','outbound','voiceExtensions','channels','queueChannels','outboundChannels','timers','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','mapKeys','hasOwnProperty','format','SIP/%s','name','isNil','interface','total','answered','sumHoldTime','sumDuration','sumBillable','isEmpty','ivrTotalCallsDays','ivrAnswerCallsDay','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundReCallsDay','outboundAnswerCallsDay','queueStatusComplete','mergeFromDatabase','prototype','initAgents','length','isUndefined','initTelephones','initTrunks','voiceQueues','initTriggers','templates','initZendeskAccounts','zendeskAccounts','initSalesforceAccounts','initFreshdeskAccounts','freshdeskAccounts','initZohoAccounts','initDeskAccounts','initVtigerAccounts','initServicenowAccounts','initDynamics365Accounts','initVoiceQueueHopperHistory','merge','initVoiceQueueReports','groupBy','uniqueid','queue','queuecallerabandon','abandoned','queuecallerleaveAt','diff','queuecallerjoinAt','seconds','queuecallercompleteAt','queuecallerabandonAt','queuecallerexitAt','queuecallercomplete','duration','disposition','ANSWERED','billableseconds','initCampaigns','campaigns','initVoiceExtensions'];(function(_0xecd772,_0x4abe0f){var _0xe3ce55=function(_0xafc90c){while(--_0xafc90c){_0xecd772['push'](_0xecd772['shift']());}};_0xe3ce55(++_0x4abe0f);}(_0x45a5,0x72));var _0x545a=function(_0x40adaf,_0x3ea747){_0x40adaf=_0x40adaf-0x0;var _0x11913d=_0x45a5[_0x40adaf];return _0x11913d;};'use strict';var BPromise=require(_0x545a('0x0'));var util=require(_0x545a('0x1'));var _=require(_0x545a('0x2'));var moment=require('moment');var Agent=require(_0x545a('0x3'));var Telephone=require(_0x545a('0x4'));var Trunk=require('../model/trunk');var VoiceQueue=require('../model/voiceQueue');var Trigger=require(_0x545a('0x5'));var Template=require(_0x545a('0x6'));var Campaign=require(_0x545a('0x7'));var VoiceExtension=require(_0x545a('0x8'));var ZendeskAccount=require(_0x545a('0x9'));var SalesforceAccount=require(_0x545a('0xa'));var FreshdeskAccount=require(_0x545a('0xb'));var SugarcrmAccount=require(_0x545a('0xc'));var ZohoAccount=require(_0x545a('0xd'));var DeskAccount=require(_0x545a('0xe'));var VtigerAccount=require(_0x545a('0xf'));var ServicenowAccount=require('../model/servicenowAccount');var Dynamics365Account=require(_0x545a('0x10'));var FaxAccount=require(_0x545a('0x11'));var Realtime=function(){this[_0x545a('0x12')]={};this[_0x545a('0x13')]={};this[_0x545a('0x14')]={};this['voiceQueues']={};this[_0x545a('0x15')]={};this['campaigns']={};this['templates']={};this[_0x545a('0x16')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0x545a('0x17')]={};this[_0x545a('0x18')]={};this[_0x545a('0x19')]={};this[_0x545a('0x1a')]={};this[_0x545a('0x1b')]={};this['zendeskAccounts']={};this[_0x545a('0x1c')]={};this[_0x545a('0x1d')]={};this['freshdeskAccounts']={};this[_0x545a('0x1e')]={};this[_0x545a('0x1f')]={};this[_0x545a('0x20')]={};this[_0x545a('0x21')]={};this[_0x545a('0x22')]={};this['faxAccounts']={};};function freeIsNotKey(_0x221b69,_0x43de66,_0x4c2afd){var _0x5f0398=_[_0x545a('0x23')](_0x221b69,function(_0x196c06,_0x5041f2){return _0x196c06[_0x4c2afd];});for(var _0x5575af in _0x43de66){if(_0x43de66[_0x545a('0x24')](_0x5575af)){if(!_0x5f0398[_0x5575af]){delete _0x43de66[_0x5575af];}}}}function freeIsNotKeySip(_0x333005,_0x76a083){var _0x5c1b23=_['mapKeys'](_0x333005,function(_0x300896,_0x111b04){return util[_0x545a('0x25')](_0x545a('0x26'),_0x300896[_0x545a('0x27')]);});for(var _0x3fb1b5 in _0x76a083){if(_0x76a083['hasOwnProperty'](_0x3fb1b5)){if(!_0x5c1b23[_0x3fb1b5]){delete _0x76a083[_0x3fb1b5];}}}}function freeIsNotKeyAgent(_0x26789d,_0x3a649c){var _0x2d6d06=_['mapKeys'](_0x26789d,function(_0xeef33c,_0x3d89a9){var _0x572e18=_[_0x545a('0x28')](_0xeef33c[_0x545a('0x29')])?util[_0x545a('0x25')](_0x545a('0x26'),_0xeef33c['name']):_0xeef33c[_0x545a('0x29')];return _0x572e18;});for(var _0x30a8a2 in _0x3a649c){if(_0x3a649c[_0x545a('0x24')](_0x30a8a2)){if(!_0x2d6d06[_0x30a8a2]){delete _0x3a649c[_0x30a8a2];}}}}function clearVoiceCallReports(_0x9ed5ad){_0x9ed5ad[_0x545a('0x2a')]=0x0;_0x9ed5ad[_0x545a('0x2b')]=0x0;_0x9ed5ad[_0x545a('0x2c')]=0x0;_0x9ed5ad[_0x545a('0x2d')]=0x0;_0x9ed5ad[_0x545a('0x2e')]=0x0;}function clearCampaigns(_0x2cb7ff){if(!_[_0x545a('0x2f')](_0x2cb7ff)){for(var _0x4d312f in _0x2cb7ff){if(_0x2cb7ff['hasOwnProperty'](_0x4d312f)){_0x2cb7ff[_0x4d312f][_0x545a('0x30')]=0x0;_0x2cb7ff[_0x4d312f][_0x545a('0x31')]=0x0;}}}}function clearVoiceQueues(_0x2732e6){if(!_[_0x545a('0x2f')](_0x2732e6)){for(var _0x111464 in _0x2732e6){if(_0x2732e6[_0x545a('0x24')](_0x111464)){_0x2732e6[_0x111464][_0x545a('0x2a')]=0x0;_0x2732e6[_0x111464]['answered']=0x0;_0x2732e6[_0x111464]['unmanaged']=0x0;_0x2732e6[_0x111464]['abandoned']=0x0;_0x2732e6[_0x111464][_0x545a('0x2c')]=0x0;_0x2732e6[_0x111464][_0x545a('0x2d')]=0x0;_0x2732e6[_0x111464]['sumBillable']=0x0;_0x2732e6[_0x111464][_0x545a('0x32')]=0x0;_0x2732e6[_0x111464][_0x545a('0x33')]=0x0;_0x2732e6[_0x111464][_0x545a('0x34')]=0x0;_0x2732e6[_0x111464][_0x545a('0x35')]=0x0;_0x2732e6[_0x111464][_0x545a('0x36')]=0x0;_0x2732e6[_0x111464][_0x545a('0x37')]=0x0;_0x2732e6[_0x111464][_0x545a('0x38')]=0x0;_0x2732e6[_0x111464]['outboundDropCallsDayCallersExit']=0x0;_0x2732e6[_0x111464][_0x545a('0x39')]=0x0;_0x2732e6[_0x111464][_0x545a('0x3a')]=0x0;_0x2732e6[_0x111464][_0x545a('0x3b')]=0x0;_0x2732e6[_0x111464][_0x545a('0x3c')]=0x0;_0x2732e6[_0x111464]['outboundAnswerAgiCallsDay']=0x0;_0x2732e6[_0x111464][_0x545a('0x3d')]=0x0;_0x2732e6[_0x111464][_0x545a('0x3e')]=!![];}}}}Realtime['prototype'][_0x545a('0x3f')]=function(_0x52b30b,_0xc3a81f){for(var _0x453207 in _0xc3a81f){if(_0x52b30b['hasOwnProperty'](_0x453207)){_0x52b30b[_0x453207]=_0xc3a81f[_0x453207];}}};Realtime[_0x545a('0x40')][_0x545a('0x41')]=function(){var _0x1a801b=this;return function(_0x307c1f){if(_0x307c1f){freeIsNotKeyAgent(_0x307c1f,_0x1a801b['agents']);for(var _0x375004=0x0,_0x1eede6={},_0x431499={};_0x375004<_0x307c1f[_0x545a('0x42')];_0x375004+=0x1){_0x1eede6=_0x307c1f[_0x375004];var _0x3021ee=_[_0x545a('0x28')](_0x1eede6['interface'])?util[_0x545a('0x25')]('SIP/%s',_0x1eede6[_0x545a('0x27')]):_0x1eede6[_0x545a('0x29')];if(_[_0x545a('0x43')](_0x1a801b[_0x545a('0x12')][_0x3021ee])){_0x1a801b[_0x545a('0x12')][_0x3021ee]=new Agent(_0x1eede6);}else{_0x1a801b[_0x545a('0x3f')](_0x1a801b[_0x545a('0x12')][_0x3021ee],_0x1eede6);}}}return _0x1a801b['agents'];};};Realtime[_0x545a('0x40')][_0x545a('0x44')]=function(){var _0x35e123=this;return function(_0xf4ddbd){if(_0xf4ddbd){freeIsNotKeySip(_0xf4ddbd,_0x35e123['telephones']);for(var _0x30d5b5=0x0,_0x481eff={},_0x3182f0={};_0x30d5b5<_0xf4ddbd[_0x545a('0x42')];_0x30d5b5+=0x1){_0x481eff=_0xf4ddbd[_0x30d5b5];if(_['isUndefined'](_0x35e123[_0x545a('0x13')][util[_0x545a('0x25')]('SIP/%s',_0x481eff[_0x545a('0x27')])])){_0x35e123[_0x545a('0x13')][util[_0x545a('0x25')](_0x545a('0x26'),_0x481eff[_0x545a('0x27')])]=new Telephone(_0x481eff);}else{_0x35e123[_0x545a('0x3f')](_0x35e123[_0x545a('0x13')][util['format']('SIP/%s',_0x481eff['name'])],_0x481eff);}}}return _0x35e123['telephones'];};};Realtime['prototype'][_0x545a('0x45')]=function(){var _0x2e9d8d=this;return function(_0x55b1d7){if(_0x55b1d7){freeIsNotKeySip(_0x55b1d7,_0x2e9d8d['trunks']);for(var _0x3d5237=0x0,_0x10c03e={},_0x6d76b8={};_0x3d5237<_0x55b1d7['length'];_0x3d5237+=0x1){_0x10c03e=_0x55b1d7[_0x3d5237];if(_['isUndefined'](_0x2e9d8d[_0x545a('0x14')][util[_0x545a('0x25')]('SIP/%s',_0x10c03e[_0x545a('0x27')])])){_0x2e9d8d['trunks'][util[_0x545a('0x25')](_0x545a('0x26'),_0x10c03e[_0x545a('0x27')])]=new Trunk(_0x10c03e);}else{_0x2e9d8d[_0x545a('0x3f')](_0x2e9d8d[_0x545a('0x14')][util[_0x545a('0x25')](_0x545a('0x26'),_0x10c03e[_0x545a('0x27')])],_0x10c03e);}}}return _0x2e9d8d[_0x545a('0x14')];};};Realtime[_0x545a('0x40')]['initVoiceQueues']=function(){var _0x1fd972=this;return function(_0x26e904){if(_0x26e904){freeIsNotKey(_0x26e904,_0x1fd972[_0x545a('0x46')],'name');for(var _0x3e787e=0x0,_0x1965ff={},_0x4154a2={};_0x3e787e<_0x26e904[_0x545a('0x42')];_0x3e787e+=0x1){_0x1965ff=_0x26e904[_0x3e787e];if(_[_0x545a('0x43')](_0x1fd972[_0x545a('0x46')][_0x1965ff['name']])){_0x1fd972[_0x545a('0x46')][_0x1965ff['name']]=new VoiceQueue(_0x1965ff);}else{_0x1fd972[_0x545a('0x3f')](_0x1fd972[_0x545a('0x46')][_0x1965ff[_0x545a('0x27')]],_0x1965ff);}}}return _0x1fd972[_0x545a('0x46')];};};Realtime[_0x545a('0x40')][_0x545a('0x47')]=function(){var _0x21107f=this;return function(_0x105335){if(_0x105335){freeIsNotKey(_0x105335,_0x21107f['triggers'],'id');for(var _0x3ba8c9=0x0,_0x7f002f={},_0x3ac4ec={};_0x3ba8c9<_0x105335[_0x545a('0x42')];_0x3ba8c9+=0x1){_0x7f002f=_0x105335[_0x3ba8c9];if(_[_0x545a('0x43')](_0x21107f[_0x545a('0x15')][_0x7f002f['id']])){_0x21107f['triggers'][_0x7f002f['id']]=new Trigger(_0x7f002f);}else{_0x21107f[_0x545a('0x3f')](_0x21107f['triggers'][_0x7f002f['id']],_0x7f002f);}}}return _0x21107f[_0x545a('0x15')];};};Realtime[_0x545a('0x40')]['initTemplates']=function(){var _0x4476a4=this;return function(_0x37d36a){if(_0x37d36a){freeIsNotKey(_0x37d36a,_0x4476a4[_0x545a('0x48')],'id');for(var _0x76676a=0x0,_0x53f8ae={},_0x456f97={};_0x76676a<_0x37d36a[_0x545a('0x42')];_0x76676a+=0x1){_0x53f8ae=_0x37d36a[_0x76676a];if(_[_0x545a('0x43')](_0x4476a4[_0x545a('0x48')][_0x53f8ae['id']])){_0x4476a4['templates'][_0x53f8ae['id']]=new Template(_0x53f8ae);}else{_0x4476a4[_0x545a('0x3f')](_0x4476a4[_0x545a('0x48')][_0x53f8ae['id']],_0x53f8ae);}}}return _0x4476a4[_0x545a('0x48')];};};Realtime[_0x545a('0x40')][_0x545a('0x49')]=function(){var _0x32c937=this;return function(_0xc76ff8){if(_0xc76ff8){freeIsNotKey(_0xc76ff8,_0x32c937[_0x545a('0x4a')],'id');for(var _0x131e2a=0x0,_0x2615ab={},_0x2ee449={};_0x131e2a<_0xc76ff8[_0x545a('0x42')];_0x131e2a+=0x1){_0x2615ab=_0xc76ff8[_0x131e2a];if(_['isUndefined'](_0x32c937[_0x545a('0x4a')][_0x2615ab['id']])){_0x32c937[_0x545a('0x4a')][_0x2615ab['id']]=new ZendeskAccount(_0x2615ab);}else{_0x32c937[_0x545a('0x3f')](_0x32c937[_0x545a('0x4a')][_0x2615ab['id']],_0x2615ab);}}}return _0x32c937[_0x545a('0x4a')];};};Realtime[_0x545a('0x40')][_0x545a('0x4b')]=function(){var _0x5129b5=this;return function(_0x3564ce){if(_0x3564ce){freeIsNotKey(_0x3564ce,_0x5129b5[_0x545a('0x1c')],'id');for(var _0x1f18df=0x0,_0x44632e={},_0x1946f7={};_0x1f18df<_0x3564ce[_0x545a('0x42')];_0x1f18df+=0x1){_0x44632e=_0x3564ce[_0x1f18df];if(_[_0x545a('0x43')](_0x5129b5['salesforceAccounts'][_0x44632e['id']])){_0x5129b5[_0x545a('0x1c')][_0x44632e['id']]=new SalesforceAccount(_0x44632e);}else{_0x5129b5[_0x545a('0x3f')](_0x5129b5[_0x545a('0x1c')][_0x44632e['id']],_0x44632e);}}}return _0x5129b5[_0x545a('0x1c')];};};Realtime[_0x545a('0x40')][_0x545a('0x4c')]=function(){var _0x1f4c94=this;return function(_0x1dc72a){if(_0x1dc72a){freeIsNotKey(_0x1dc72a,_0x1f4c94[_0x545a('0x4d')],'id');for(var _0x2ed856=0x0,_0x12bd35={},_0x351c14={};_0x2ed856<_0x1dc72a[_0x545a('0x42')];_0x2ed856+=0x1){_0x12bd35=_0x1dc72a[_0x2ed856];if(_[_0x545a('0x43')](_0x1f4c94['freshdeskAccounts'][_0x12bd35['id']])){_0x1f4c94[_0x545a('0x4d')][_0x12bd35['id']]=new FreshdeskAccount(_0x12bd35);}else{_0x1f4c94['mergeFromDatabase'](_0x1f4c94[_0x545a('0x4d')][_0x12bd35['id']],_0x12bd35);}}}return _0x1f4c94[_0x545a('0x4d')];};};Realtime['prototype'][_0x545a('0x4e')]=function(){var _0x16a978=this;return function(_0x53970d){if(_0x53970d){freeIsNotKey(_0x53970d,_0x16a978[_0x545a('0x1e')],'id');for(var _0x841ddd=0x0,_0x2a81f6={},_0x2570a1={};_0x841ddd<_0x53970d[_0x545a('0x42')];_0x841ddd+=0x1){_0x2a81f6=_0x53970d[_0x841ddd];if(_[_0x545a('0x43')](_0x16a978[_0x545a('0x1e')][_0x2a81f6['id']])){_0x16a978[_0x545a('0x1e')][_0x2a81f6['id']]=new ZohoAccount(_0x2a81f6);}else{_0x16a978[_0x545a('0x3f')](_0x16a978[_0x545a('0x1e')][_0x2a81f6['id']],_0x2a81f6);}}}return _0x16a978[_0x545a('0x1e')];};};Realtime['prototype'][_0x545a('0x4f')]=function(){var _0x551724=this;return function(_0x554489){if(_0x554489){freeIsNotKey(_0x554489,_0x551724[_0x545a('0x1f')],'id');for(var _0x2fd32b=0x0,_0x2c358c={},_0x4b2188={};_0x2fd32b<_0x554489[_0x545a('0x42')];_0x2fd32b+=0x1){_0x2c358c=_0x554489[_0x2fd32b];if(_['isUndefined'](_0x551724['deskAccounts'][_0x2c358c['id']])){_0x551724[_0x545a('0x1f')][_0x2c358c['id']]=new DeskAccount(_0x2c358c);}else{_0x551724[_0x545a('0x3f')](_0x551724[_0x545a('0x1f')][_0x2c358c['id']],_0x2c358c);}}}return _0x551724[_0x545a('0x1f')];};};Realtime[_0x545a('0x40')]['initSugarcrmAccounts']=function(){var _0x4339ad=this;return function(_0x3da84a){if(_0x3da84a){freeIsNotKey(_0x3da84a,_0x4339ad[_0x545a('0x1d')],'id');for(var _0x205023=0x0,_0x7f65eb={},_0x3609e9={};_0x205023<_0x3da84a['length'];_0x205023+=0x1){_0x7f65eb=_0x3da84a[_0x205023];if(_[_0x545a('0x43')](_0x4339ad[_0x545a('0x1d')][_0x7f65eb['id']])){_0x4339ad['sugarcrmAccounts'][_0x7f65eb['id']]=new SugarcrmAccount(_0x7f65eb);}else{_0x4339ad[_0x545a('0x3f')](_0x4339ad[_0x545a('0x1d')][_0x7f65eb['id']],_0x7f65eb);}}}return _0x4339ad[_0x545a('0x1d')];};};Realtime[_0x545a('0x40')][_0x545a('0x50')]=function(){var _0x2cea52=this;return function(_0x5f21e0){if(_0x5f21e0){freeIsNotKey(_0x5f21e0,_0x2cea52[_0x545a('0x20')],'id');for(var _0x284e0f=0x0,_0x1af759={},_0x575935={};_0x284e0f<_0x5f21e0[_0x545a('0x42')];_0x284e0f+=0x1){_0x1af759=_0x5f21e0[_0x284e0f];if(_[_0x545a('0x43')](_0x2cea52[_0x545a('0x20')][_0x1af759['id']])){_0x2cea52[_0x545a('0x20')][_0x1af759['id']]=new VtigerAccount(_0x1af759);}else{_0x2cea52[_0x545a('0x3f')](_0x2cea52['vtigerAccounts'][_0x1af759['id']],_0x1af759);}}}return _0x2cea52[_0x545a('0x20')];};};Realtime[_0x545a('0x40')][_0x545a('0x51')]=function(){var _0x37a5b2=this;return function(_0x5b61fe){if(_0x5b61fe){freeIsNotKey(_0x5b61fe,_0x37a5b2[_0x545a('0x21')],'id');for(var _0x1630b0=0x0,_0x1eff61={},_0x2b0c79={};_0x1630b0<_0x5b61fe[_0x545a('0x42')];_0x1630b0+=0x1){_0x1eff61=_0x5b61fe[_0x1630b0];if(_[_0x545a('0x43')](_0x37a5b2[_0x545a('0x21')][_0x1eff61['id']])){_0x37a5b2['servicenowAccounts'][_0x1eff61['id']]=new ServicenowAccount(_0x1eff61);}else{_0x37a5b2['mergeFromDatabase'](_0x37a5b2[_0x545a('0x21')][_0x1eff61['id']],_0x1eff61);}}}return _0x37a5b2[_0x545a('0x21')];};};Realtime[_0x545a('0x40')][_0x545a('0x52')]=function(){var _0x45b7b4=this;return function(_0xd9d6f7){if(_0xd9d6f7){freeIsNotKey(_0xd9d6f7,_0x45b7b4[_0x545a('0x22')],'id');for(var _0x511986=0x0,_0x35af2b={},_0x22b675={};_0x511986<_0xd9d6f7['length'];_0x511986+=0x1){_0x35af2b=_0xd9d6f7[_0x511986];if(_['isUndefined'](_0x45b7b4['dynamics365Accounts'][_0x35af2b['id']])){_0x45b7b4['dynamics365Accounts'][_0x35af2b['id']]=new Dynamics365Account(_0x35af2b);}else{_0x45b7b4[_0x545a('0x3f')](_0x45b7b4[_0x545a('0x22')][_0x35af2b['id']],_0x35af2b);}}}return _0x45b7b4[_0x545a('0x22')];};};Realtime[_0x545a('0x40')][_0x545a('0x53')]=function(){var _0x1b9b08=this;return function(_0xeb0a35){for(var _0x15a119=0x0;_0x15a119<_0xeb0a35[_0x545a('0x42')];_0x15a119+=0x1){_[_0x545a('0x54')](_0x1b9b08[_0x545a('0x46')][_0xeb0a35[_0x15a119][_0x545a('0x27')]],_0xeb0a35[_0x15a119]);}return _0x1b9b08[_0x545a('0x46')];};};Realtime[_0x545a('0x40')][_0x545a('0x55')]=function(){var _0x1b0c09=this;return function(_0x2b188d){clearVoiceQueues(_0x1b0c09[_0x545a('0x46')]);if(_0x2b188d){_0x2b188d=_[_0x545a('0x56')](_0x2b188d,_0x545a('0x57'));for(var _0xc9958b in _0x2b188d){if(_0x2b188d[_0x545a('0x24')](_0xc9958b)){var _0x48d510={};for(var _0xe06384=0x0;_0xe06384<_0x2b188d[_0xc9958b]['length'];_0xe06384+=0x1){var _0xf3de7e=_0x2b188d[_0xc9958b][_0xe06384][_0x545a('0x58')];if(_0x1b0c09[_0x545a('0x46')][_0xf3de7e]){if(_0x2b188d[_0xc9958b][_0xe06384]['queuecallerexit']){_0x1b0c09[_0x545a('0x46')][_0xf3de7e]['unmanaged']+=0x1;}if(_0x2b188d[_0xc9958b][_0xe06384][_0x545a('0x59')]){_0x1b0c09[_0x545a('0x46')][_0xf3de7e][_0x545a('0x5a')]+=0x1;}_0x1b0c09[_0x545a('0x46')][_0xf3de7e]['sumHoldTime']+=moment(_0x2b188d[_0xc9958b][_0xe06384][_0x545a('0x5b')])[_0x545a('0x5c')](moment(_0x2b188d[_0xc9958b][_0xe06384][_0x545a('0x5d')]),_0x545a('0x5e'))||0x0;if(_0xe06384===_0x2b188d[_0xc9958b][_0x545a('0x42')]-0x1){_0x1b0c09['voiceQueues'][_0xf3de7e]['sumDuration']+=moment(_0x2b188d[_0xc9958b][_0xe06384][_0x545a('0x5f')]||_0x2b188d[_0xc9958b][_0xe06384][_0x545a('0x60')]||_0x2b188d[_0xc9958b][_0xe06384][_0x545a('0x61')])[_0x545a('0x5c')](moment(_0x2b188d[_0xc9958b][_0xe06384]['queuecallerjoinAt']),_0x545a('0x5e'))||0x0;_0x1b0c09[_0x545a('0x46')][_0xf3de7e][_0x545a('0x2a')]+=0x1;if(_0x2b188d[_0xc9958b][_0xe06384][_0x545a('0x62')]){_0x1b0c09[_0x545a('0x46')][_0xf3de7e][_0x545a('0x2b')]+=0x1;_0x1b0c09['voiceQueues'][_0xf3de7e][_0x545a('0x2e')]+=moment(_0x2b188d[_0xc9958b][_0xe06384]['queuecallercompleteAt'])[_0x545a('0x5c')](moment(_0x2b188d[_0xc9958b][_0xe06384][_0x545a('0x5b')]),_0x545a('0x5e'))||0x0;}}else{_0x1b0c09[_0x545a('0x46')][_0xf3de7e]['sumDuration']+=_0x1b0c09['voiceQueues'][_0xf3de7e][_0x545a('0x2c')]||0x0;}}}}}}return _0x1b0c09[_0x545a('0x46')];};};Realtime['prototype']['initVoiceCallReports']=function(){var _0x4bab9f=this;return function(_0x246357){clearVoiceCallReports(_0x4bab9f[_0x545a('0x16')]);if(_0x246357){for(var _0x41294a=0x0;_0x41294a<_0x246357['length'];_0x41294a+=0x1){_0x4bab9f['outbound'][_0x545a('0x2a')]+=0x1;_0x4bab9f[_0x545a('0x16')]['sumDuration']+=_0x246357[_0x41294a][_0x545a('0x63')];if(_0x246357[_0x41294a][_0x545a('0x64')]===_0x545a('0x65')){_0x4bab9f['outbound']['answered']+=0x1;_0x4bab9f[_0x545a('0x16')][_0x545a('0x2c')]+=_0x246357[_0x41294a]['duration']-_0x246357[_0x41294a][_0x545a('0x66')]||0x0;_0x4bab9f[_0x545a('0x16')][_0x545a('0x2e')]+=_0x246357[_0x41294a][_0x545a('0x66')];}}}return _0x4bab9f[_0x545a('0x16')];};};Realtime[_0x545a('0x40')][_0x545a('0x67')]=function(){var _0x8821a2=this;return function(_0x5753ca){if(_0x5753ca){freeIsNotKey(_0x5753ca,_0x8821a2['campaigns'],_0x545a('0x27'));for(var _0x462031=0x0,_0x3a0ab0={};_0x462031<_0x5753ca[_0x545a('0x42')];_0x462031+=0x1){_0x3a0ab0=_0x5753ca[_0x462031];if(_[_0x545a('0x43')](_0x8821a2[_0x545a('0x68')][_0x3a0ab0[_0x545a('0x27')]])){_0x8821a2[_0x545a('0x68')][_0x3a0ab0[_0x545a('0x27')]]=new Campaign(_0x3a0ab0);}else{_0x8821a2[_0x545a('0x3f')](_0x8821a2[_0x545a('0x68')][_0x3a0ab0[_0x545a('0x27')]],_0x3a0ab0);}}}return _0x8821a2[_0x545a('0x68')];};};Realtime[_0x545a('0x40')][_0x545a('0x69')]=function(){var _0x38ad9b=this;return function(_0x4a2725){if(_0x4a2725){freeIsNotKey(_0x4a2725,_0x38ad9b[_0x545a('0x17')],'id');for(var _0x7f2767=0x0,_0x4d36ac={};_0x7f2767<_0x4a2725[_0x545a('0x42')];_0x7f2767+=0x1){_0x4d36ac=_0x4a2725[_0x7f2767];if(_[_0x545a('0x43')](_0x38ad9b[_0x545a('0x17')][_0x4d36ac['id']])){_0x38ad9b['voiceExtensions'][_0x4d36ac['id']]=new VoiceExtension(_0x4d36ac);}else{_0x38ad9b[_0x545a('0x3f')](_0x38ad9b[_0x545a('0x17')][_0x4d36ac['id']],_0x4d36ac);}}}return _0x38ad9b[_0x545a('0x17')];};};Realtime['prototype'][_0x545a('0x6a')]=function(){var _0x14a9f8=this;return function(_0x3dd20a){clearCampaigns(_0x14a9f8[_0x545a('0x68')]);for(var _0x19a70b=0x0;_0x19a70b<_0x3dd20a[_0x545a('0x42')];_0x19a70b+=0x1){_['merge'](_0x14a9f8['campaigns'][_0x3dd20a[_0x19a70b]['name']],_0x3dd20a[_0x19a70b]);}return _0x14a9f8[_0x545a('0x68')];};};Realtime[_0x545a('0x40')][_0x545a('0x6b')]=function(){var _0x1dd0f9=this;return function(_0x38ea1c){if(_0x38ea1c){freeIsNotKey(_0x38ea1c,_0x1dd0f9[_0x545a('0x6c')],'id');for(var _0x168232=0x0,_0x545ede={},_0x10279d={};_0x168232<_0x38ea1c['length'];_0x168232+=0x1){_0x545ede=_0x38ea1c[_0x168232];if(_['isUndefined'](_0x1dd0f9[_0x545a('0x6c')][_0x545ede['id']])){_0x1dd0f9[_0x545a('0x6c')][_0x545ede['id']]=new FaxAccount(_0x545ede);}else{_0x1dd0f9[_0x545a('0x3f')](_0x1dd0f9['faxAccounts'][_0x545ede['id']],_0x545ede);}}}return _0x1dd0f9[_0x545a('0x6c')];};};module[_0x545a('0x6d')]=Realtime; \ No newline at end of file diff --git a/server/services/ami/report/index.js b/server/services/ami/report/index.js index 30b40aa..4f3b74f 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 _0x34fc=['voiceAgentReport','voiceDialReport','blindtransfer','attendedtransfer','attendedTransfer','findAgent','find','name','isNil','interface','format','SIP/%s','connectedlinenum','accountcode','assigned','lastAssignedTo','queuecallercomplete','queuecallercompleteAt','YYYY-MM-DD\x20HH:mm:ss','queuecallerexitAt','create','destination','dialer','queue','lastdata','context','from-voip-provider','from-sip','calleridpreview','calleridnum','originatecalleridnum','channel','destinationchannel','callerid','disposition','ANSWERED','\x22%s\x22\x20<%s>','calleridname','monitor','monitors','monitorFilename','filename','createdAt','xcally-motion-preview','connectedlinename','membername','exten','xcally-motion-dialer','isArray','forEach','startsWith','Local','substring','mobile','phone','indexOf','lastIndexOf','blindTransfer','exports','bluebird','lodash','moment','../../../config/environment','../../../config/logger','../rpc/voiceAgentReport','../rpc/voiceCallReport','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceQueueReport','../rpc/voiceRecording','./voiceCallReport','./voiceAgentReport','./voiceDialReport','./userReport','realtime','agents','telephones','prototype','sync','xdr','disabled','custom:voiceQueueReport','voiceQueueReport','bind','voiceCallReport','custom:voiceAgentReport'];(function(_0xd67723,_0x1e576f){var _0x53b62b=function(_0x2460a3){while(--_0x2460a3){_0xd67723['push'](_0xd67723['shift']());}};_0x53b62b(++_0x1e576f);}(_0x34fc,0x91));var _0xc34f=function(_0xe5a1d7,_0x16a01c){_0xe5a1d7=_0xe5a1d7-0x0;var _0x37ddee=_0x34fc[_0xe5a1d7];return _0x37ddee;};'use strict';var BPromise=require(_0xc34f('0x0'));var _=require(_0xc34f('0x1'));var moment=require(_0xc34f('0x2'));var util=require('util');var config=require(_0xc34f('0x3'));var logger=require(_0xc34f('0x4'))('ami');var ami=require('../ami');var RpcVoiceAgentReport=require(_0xc34f('0x5'));var RpcVoiceCallReport=require(_0xc34f('0x6'));var RpcVoiceDialReport=require(_0xc34f('0x7'));var RpcMemberReport=require(_0xc34f('0x8'));var RpcVoiceQueueReport=require(_0xc34f('0x9'));var RpcVoiceRecording=require(_0xc34f('0xa'));var RpcVoiceTransferReport=require('../rpc/voiceTransferReport');var VoiceQueueReport=require('./voiceQueueReport');var VoiceCallReport=require(_0xc34f('0xb'));var VoiceAgentReport=require(_0xc34f('0xc'));var VoiceDialReport=require(_0xc34f('0xd'));var UserReport=require(_0xc34f('0xe'));function Report(_0x2feeb7){this[_0xc34f('0xf')]=_0x2feeb7;this[_0xc34f('0x10')]=_0x2feeb7['agents'];this[_0xc34f('0x11')]=_0x2feeb7[_0xc34f('0x11')];}Report[_0xc34f('0x12')][_0xc34f('0x13')]=function(_0x12f8f2){var _0x3e6b33=new VoiceQueueReport(this['realtime']);var _0x584bf8=new VoiceAgentReport(this['realtime']);var _0x510b2f=new VoiceDialReport(this[_0xc34f('0xf')]);var _0x24e446=new VoiceCallReport(this[_0xc34f('0xf')]);var _0x285074=new UserReport(this[_0xc34f('0xf')]);if(config[_0xc34f('0x14')]&&config[_0xc34f('0x14')][_0xc34f('0x15')]){ami['on'](_0xc34f('0x16'),this[_0xc34f('0x17')][_0xc34f('0x18')](this));ami['on']('custom:voiceCallReport',this[_0xc34f('0x19')][_0xc34f('0x18')](this));ami['on'](_0xc34f('0x1a'),this[_0xc34f('0x1b')][_0xc34f('0x18')](this));ami['on']('custom:voiceDialReport',this[_0xc34f('0x1c')]['bind'](this));ami['on'](_0xc34f('0x1d'),this['blindTransfer'][_0xc34f('0x18')](this));ami['on'](_0xc34f('0x1e'),this[_0xc34f('0x1f')]['bind'](this));}};Report[_0xc34f('0x12')][_0xc34f('0x20')]=function(_0x246a5f){var _0x51d19f=undefined;_0x51d19f=_[_0xc34f('0x21')](this[_0xc34f('0x10')],function(_0x2e3587){return _0x2e3587['accountcode']==_0x246a5f||_0x2e3587[_0xc34f('0x22')]==_0x246a5f;});if(_[_0xc34f('0x23')](_0x51d19f)){var _0x7cb723=_[_0xc34f('0x21')](this[_0xc34f('0x11')],function(_0x142bb8){return _0x142bb8['accountcode']==_0x246a5f||_0x142bb8['name']==_0x246a5f;});if(_0x7cb723){_0x51d19f=_[_0xc34f('0x21')](this['agents'],function(_0x281306){return _0x281306[_0xc34f('0x24')]==util[_0xc34f('0x25')](_0xc34f('0x26'),_0x7cb723['name']);});}}return _0x51d19f;};Report['prototype'][_0xc34f('0x17')]=function(_0x2f4a04){for(var _0x27b8df=0x0;_0x27b8df<_0x2f4a04['length'];_0x27b8df+=0x1){var _0x369ebf=this[_0xc34f('0x20')](_0x2f4a04[_0x27b8df][_0xc34f('0x27')]);if(_0x369ebf){_0x2f4a04[_0x27b8df][_0xc34f('0x28')]=_0x369ebf[_0xc34f('0x28')];_0x2f4a04[_0x27b8df][_0xc34f('0x29')]=!![];_0x2f4a04[_0x27b8df][_0xc34f('0x2a')]=_0x369ebf[_0xc34f('0x22')];_0x2f4a04[_0x27b8df][_0xc34f('0x24')]=_[_0xc34f('0x23')](_0x369ebf[_0xc34f('0x24')])?util['format'](_0xc34f('0x26'),_0x369ebf['name']):_0x369ebf[_0xc34f('0x24')];if(_0x2f4a04[_0x27b8df][_0xc34f('0x2b')]){_0x2f4a04[_0x27b8df][_0xc34f('0x2c')]=moment()[_0xc34f('0x25')](_0xc34f('0x2d'));}if(_0x2f4a04[_0x27b8df]['queuecallerexit']){_0x2f4a04[_0x27b8df][_0xc34f('0x2e')]=moment()['format'](_0xc34f('0x2d'));}RpcMemberReport[_0xc34f('0x17')](_0x2f4a04[_0x27b8df]);}RpcVoiceQueueReport[_0xc34f('0x2f')](_0x2f4a04[_0x27b8df]);}};function extractCalleridNumber(_0x2d222a){var _0x3bd3a0=_0x2d222a['match'](/<(.*?)>/);return _0x3bd3a0?_0x3bd3a0[0x1]:_0x2d222a;}Report[_0xc34f('0x12')][_0xc34f('0x19')]=function(_0x4c5903){_0x4c5903[_0xc34f('0x30')]=_0x4c5903[_0xc34f('0x30')]||_0x4c5903['exten'];if(_0x4c5903['type']==_0xc34f('0x31')){_0x4c5903['lastapplication']=_0xc34f('0x32');_0x4c5903[_0xc34f('0x33')]=_0x4c5903[_0xc34f('0x32')];if(_0x4c5903[_0xc34f('0x34')]==_0xc34f('0x35')){_0x4c5903[_0xc34f('0x28')]='';_0x4c5903[_0xc34f('0x30')]=extractCalleridNumber(_0x4c5903['callerid']);}else if(_0x4c5903[_0xc34f('0x34')]==_0xc34f('0x36')){if(_0x4c5903['destination']=='xcally-motion-preview'){_0x4c5903['destination']=extractCalleridNumber(_0x4c5903[_0xc34f('0x37')]);_0x4c5903[_0xc34f('0x38')]=_0x4c5903[_0xc34f('0x39')];_0x4c5903['destinationchannel']=[_0x4c5903[_0xc34f('0x3a')],_0x4c5903[_0xc34f('0x3a')]=_0x4c5903[_0xc34f('0x3b')]][0x0];_0x4c5903[_0xc34f('0x3c')]=_0x4c5903[_0xc34f('0x37')];}else{_0x4c5903[_0xc34f('0x30')]=_0x4c5903[_0xc34f('0x38')];_0x4c5903[_0xc34f('0x38')]=_0x4c5903[_0xc34f('0x39')];if(_0x4c5903[_0xc34f('0x3d')]==_0xc34f('0x3e')){_0x4c5903[_0xc34f('0x28')]=_0x4c5903[_0xc34f('0x27')];}else{_0x4c5903['accountcode']='';}}}}else{_0x4c5903[_0xc34f('0x3c')]=util[_0xc34f('0x25')](_0xc34f('0x3f'),_0x4c5903[_0xc34f('0x40')],_0x4c5903[_0xc34f('0x38')]);}RpcVoiceCallReport[_0xc34f('0x2f')](_0x4c5903);if(_0x4c5903[_0xc34f('0x41')]){for(var _0x1f3b3b=0x0;_0x1f3b3b<_0x4c5903[_0xc34f('0x42')]['length'];_0x1f3b3b+=0x1){_0x4c5903[_0xc34f('0x43')]=_0x4c5903[_0xc34f('0x42')][_0x1f3b3b][_0xc34f('0x44')];_0x4c5903[_0xc34f('0x45')]=_0x4c5903[_0xc34f('0x42')][_0x1f3b3b][_0xc34f('0x45')];if(_0x4c5903['exten']==_0xc34f('0x46')){_0x4c5903[_0xc34f('0x38')]=_0x4c5903[_0xc34f('0x27')];_0x4c5903[_0xc34f('0x40')]=_0x4c5903[_0xc34f('0x47')];_0x4c5903[_0xc34f('0x27')]=_0x4c5903['accountcode'];_0x4c5903[_0xc34f('0x47')]=_0x4c5903[_0xc34f('0x48')];_0x4c5903['exten']=_0x4c5903[_0xc34f('0x39')];}else if(_0x4c5903[_0xc34f('0x49')]==_0xc34f('0x4a')){_0x4c5903[_0xc34f('0x38')]=_0x4c5903['destination'];_0x4c5903['exten']=_0x4c5903[_0xc34f('0x39')];}RpcVoiceRecording[_0xc34f('0x2f')](_0x4c5903);}}};Report['prototype'][_0xc34f('0x1b')]=function(_0x31939c){if(_[_0xc34f('0x4b')](_0x31939c)){_0x31939c[_0xc34f('0x4c')](function(_0x809d7f){RpcVoiceAgentReport[_0xc34f('0x2f')](_0x809d7f);});}else{RpcVoiceAgentReport['create'](_0x31939c);}};Report[_0xc34f('0x12')]['voiceDialReport']=function(_0x26de76){RpcVoiceDialReport[_0xc34f('0x2f')](_0x26de76);var _0x200d39=undefined;var _0x795fd2=_0x26de76[_0xc34f('0x3a')];if(_[_0xc34f('0x4d')](_0x795fd2,_0xc34f('0x4e'))){var _0x44f425=_0x795fd2[_0xc34f('0x4f')](_0x795fd2['indexOf']('/')+0x1,_0x795fd2['indexOf']('@'));_0x200d39=_[_0xc34f('0x21')](this[_0xc34f('0x10')],function(_0x39c43d){return _0x39c43d[_0xc34f('0x50')]==_0x44f425||_0x39c43d[_0xc34f('0x51')]==_0x44f425||_0x39c43d[_0xc34f('0x28')]==_0x44f425;});}else{var _0x44f425=_0x795fd2[_0xc34f('0x4f')](_0x795fd2[_0xc34f('0x52')]('/')+0x1,_0x795fd2[_0xc34f('0x53')]('-'));_0x200d39=this['findAgent'](_0x44f425);}if(_0x200d39){_0x26de76[_0xc34f('0x24')]=_[_0xc34f('0x23')](_0x200d39['interface'])?util[_0xc34f('0x25')]('SIP/%s',_0x200d39[_0xc34f('0x22')]):_0x200d39[_0xc34f('0x24')];_0x26de76[_0xc34f('0x48')]=_0x200d39[_0xc34f('0x22')];_0x26de76['accountcode']=_0x200d39[_0xc34f('0x28')];RpcMemberReport[_0xc34f('0x1c')](_0x26de76);}};Report['prototype'][_0xc34f('0x54')]=function(_0xc05550){RpcVoiceTransferReport[_0xc34f('0x54')](_0xc05550);};Report['prototype']['attendedTransfer']=function(_0x5a6483){RpcVoiceTransferReport[_0xc34f('0x1f')](_0x5a6483);};module[_0xc34f('0x55')]=Report; \ No newline at end of file +var _0xa94a=['voiceAgentReport','isArray','forEach','startsWith','Local','substring','indexOf','find','mobile','phone','lastIndexOf','membername','exports','bluebird','lodash','moment','util','../../../config/environment','../../../config/logger','ami','../rpc/voiceAgentReport','../rpc/voiceCallReport','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceQueueReport','../rpc/voiceRecording','./voiceQueueReport','./voiceCallReport','./voiceDialReport','./userReport','realtime','agents','telephones','prototype','sync','xdr','disabled','custom:voiceQueueReport','bind','custom:voiceCallReport','custom:voiceAgentReport','custom:voiceDialReport','voiceDialReport','blindtransfer','attendedtransfer','attendedTransfer','findAgent','accountcode','name','interface','format','SIP/%s','length','assigned','queuecallercomplete','YYYY-MM-DD\x20HH:mm:ss','queuecallerexit','voiceQueueReport','create','match','voiceCallReport','destination','exten','type','dialer','lastapplication','queue','lastdata','context','from-voip-provider','callerid','xcally-motion-preview','calleridpreview','originatecalleridnum','destinationchannel','channel','calleridnum','disposition','ANSWERED','connectedlinenum','\x22%s\x22\x20<%s>','calleridname','monitor','monitorFilename','monitors','filename','connectedlinename'];(function(_0x300d5d,_0x1c4daf){var _0x5f66b0=function(_0x469146){while(--_0x469146){_0x300d5d['push'](_0x300d5d['shift']());}};_0x5f66b0(++_0x1c4daf);}(_0xa94a,0xbb));var _0xaa94=function(_0x53c292,_0x442278){_0x53c292=_0x53c292-0x0;var _0x56ccf3=_0xa94a[_0x53c292];return _0x56ccf3;};'use strict';var BPromise=require(_0xaa94('0x0'));var _=require(_0xaa94('0x1'));var moment=require(_0xaa94('0x2'));var util=require(_0xaa94('0x3'));var config=require(_0xaa94('0x4'));var logger=require(_0xaa94('0x5'))(_0xaa94('0x6'));var ami=require('../ami');var RpcVoiceAgentReport=require(_0xaa94('0x7'));var RpcVoiceCallReport=require(_0xaa94('0x8'));var RpcVoiceDialReport=require(_0xaa94('0x9'));var RpcMemberReport=require(_0xaa94('0xa'));var RpcVoiceQueueReport=require(_0xaa94('0xb'));var RpcVoiceRecording=require(_0xaa94('0xc'));var RpcVoiceTransferReport=require('../rpc/voiceTransferReport');var VoiceQueueReport=require(_0xaa94('0xd'));var VoiceCallReport=require(_0xaa94('0xe'));var VoiceAgentReport=require('./voiceAgentReport');var VoiceDialReport=require(_0xaa94('0xf'));var UserReport=require(_0xaa94('0x10'));function Report(_0x502cb7){this[_0xaa94('0x11')]=_0x502cb7;this[_0xaa94('0x12')]=_0x502cb7[_0xaa94('0x12')];this[_0xaa94('0x13')]=_0x502cb7['telephones'];}Report[_0xaa94('0x14')][_0xaa94('0x15')]=function(_0x432b73){var _0x431b26=new VoiceQueueReport(this[_0xaa94('0x11')]);var _0x38054f=new VoiceAgentReport(this['realtime']);var _0x4dd5ab=new VoiceDialReport(this['realtime']);var _0x337422=new VoiceCallReport(this['realtime']);var _0x2f7d47=new UserReport(this[_0xaa94('0x11')]);if(config[_0xaa94('0x16')]&&config[_0xaa94('0x16')][_0xaa94('0x17')]){ami['on'](_0xaa94('0x18'),this['voiceQueueReport'][_0xaa94('0x19')](this));ami['on'](_0xaa94('0x1a'),this['voiceCallReport'][_0xaa94('0x19')](this));ami['on'](_0xaa94('0x1b'),this['voiceAgentReport']['bind'](this));ami['on'](_0xaa94('0x1c'),this[_0xaa94('0x1d')][_0xaa94('0x19')](this));ami['on'](_0xaa94('0x1e'),this['blindTransfer'][_0xaa94('0x19')](this));ami['on'](_0xaa94('0x1f'),this[_0xaa94('0x20')][_0xaa94('0x19')](this));}};Report[_0xaa94('0x14')][_0xaa94('0x21')]=function(_0x2d962e){var _0x3aca91=undefined;_0x3aca91=_['find'](this[_0xaa94('0x12')],function(_0x1563da){return _0x1563da[_0xaa94('0x22')]==_0x2d962e||_0x1563da[_0xaa94('0x23')]==_0x2d962e;});if(_['isNil'](_0x3aca91)){var _0x2c7fff=_['find'](this[_0xaa94('0x13')],function(_0x3170e1){return _0x3170e1[_0xaa94('0x22')]==_0x2d962e||_0x3170e1[_0xaa94('0x23')]==_0x2d962e;});if(_0x2c7fff){_0x3aca91=_['find'](this[_0xaa94('0x12')],function(_0x1bf32f){return _0x1bf32f[_0xaa94('0x24')]==util[_0xaa94('0x25')](_0xaa94('0x26'),_0x2c7fff[_0xaa94('0x23')]);});}}return _0x3aca91;};Report[_0xaa94('0x14')]['voiceQueueReport']=function(_0x527939){for(var _0x5b3c88=0x0;_0x5b3c88<_0x527939[_0xaa94('0x27')];_0x5b3c88+=0x1){var _0x23c9c2=this[_0xaa94('0x21')](_0x527939[_0x5b3c88]['connectedlinenum']);if(_0x23c9c2){_0x527939[_0x5b3c88][_0xaa94('0x22')]=_0x23c9c2[_0xaa94('0x22')];_0x527939[_0x5b3c88][_0xaa94('0x28')]=!![];_0x527939[_0x5b3c88]['lastAssignedTo']=_0x23c9c2[_0xaa94('0x23')];_0x527939[_0x5b3c88][_0xaa94('0x24')]=_['isNil'](_0x23c9c2[_0xaa94('0x24')])?util['format'](_0xaa94('0x26'),_0x23c9c2[_0xaa94('0x23')]):_0x23c9c2[_0xaa94('0x24')];if(_0x527939[_0x5b3c88][_0xaa94('0x29')]){_0x527939[_0x5b3c88]['queuecallercompleteAt']=moment()[_0xaa94('0x25')](_0xaa94('0x2a'));}if(_0x527939[_0x5b3c88][_0xaa94('0x2b')]){_0x527939[_0x5b3c88]['queuecallerexitAt']=moment()[_0xaa94('0x25')]('YYYY-MM-DD\x20HH:mm:ss');}RpcMemberReport[_0xaa94('0x2c')](_0x527939[_0x5b3c88]);}RpcVoiceQueueReport[_0xaa94('0x2d')](_0x527939[_0x5b3c88]);}};function extractCalleridNumber(_0xea7016){var _0x1cb05d=_0xea7016[_0xaa94('0x2e')](/<(.*?)>/);return _0x1cb05d?_0x1cb05d[0x1]:_0xea7016;}Report[_0xaa94('0x14')][_0xaa94('0x2f')]=function(_0x1eabc4){_0x1eabc4[_0xaa94('0x30')]=_0x1eabc4[_0xaa94('0x30')]||_0x1eabc4[_0xaa94('0x31')];if(_0x1eabc4[_0xaa94('0x32')]==_0xaa94('0x33')){_0x1eabc4[_0xaa94('0x34')]=_0xaa94('0x35');_0x1eabc4[_0xaa94('0x36')]=_0x1eabc4['queue'];if(_0x1eabc4[_0xaa94('0x37')]==_0xaa94('0x38')){_0x1eabc4[_0xaa94('0x22')]='';_0x1eabc4[_0xaa94('0x30')]=extractCalleridNumber(_0x1eabc4[_0xaa94('0x39')]);}else if(_0x1eabc4[_0xaa94('0x37')]=='from-sip'){if(_0x1eabc4[_0xaa94('0x30')]==_0xaa94('0x3a')){_0x1eabc4[_0xaa94('0x30')]=extractCalleridNumber(_0x1eabc4[_0xaa94('0x3b')]);_0x1eabc4['calleridnum']=_0x1eabc4[_0xaa94('0x3c')];_0x1eabc4[_0xaa94('0x3d')]=[_0x1eabc4[_0xaa94('0x3e')],_0x1eabc4['channel']=_0x1eabc4[_0xaa94('0x3d')]][0x0];_0x1eabc4[_0xaa94('0x39')]=_0x1eabc4[_0xaa94('0x3b')];}else{_0x1eabc4[_0xaa94('0x30')]=_0x1eabc4[_0xaa94('0x3f')];_0x1eabc4[_0xaa94('0x3f')]=_0x1eabc4[_0xaa94('0x3c')];if(_0x1eabc4[_0xaa94('0x40')]==_0xaa94('0x41')){_0x1eabc4[_0xaa94('0x22')]=_0x1eabc4[_0xaa94('0x42')];}else{_0x1eabc4[_0xaa94('0x22')]='';}}}}else{_0x1eabc4[_0xaa94('0x39')]=util[_0xaa94('0x25')](_0xaa94('0x43'),_0x1eabc4[_0xaa94('0x44')],_0x1eabc4[_0xaa94('0x3f')]);}RpcVoiceCallReport[_0xaa94('0x2d')](_0x1eabc4);if(_0x1eabc4[_0xaa94('0x45')]){for(var _0x340309=0x0;_0x340309<_0x1eabc4['monitors'][_0xaa94('0x27')];_0x340309+=0x1){_0x1eabc4[_0xaa94('0x46')]=_0x1eabc4[_0xaa94('0x47')][_0x340309][_0xaa94('0x48')];_0x1eabc4['createdAt']=_0x1eabc4[_0xaa94('0x47')][_0x340309]['createdAt'];if(_0x1eabc4[_0xaa94('0x31')]==_0xaa94('0x3a')){_0x1eabc4[_0xaa94('0x3f')]=_0x1eabc4[_0xaa94('0x42')];_0x1eabc4[_0xaa94('0x44')]=_0x1eabc4[_0xaa94('0x49')];_0x1eabc4[_0xaa94('0x42')]=_0x1eabc4[_0xaa94('0x22')];_0x1eabc4[_0xaa94('0x49')]=_0x1eabc4['membername'];_0x1eabc4[_0xaa94('0x31')]=_0x1eabc4['originatecalleridnum'];}else if(_0x1eabc4[_0xaa94('0x31')]=='xcally-motion-dialer'){_0x1eabc4[_0xaa94('0x3f')]=_0x1eabc4[_0xaa94('0x30')];_0x1eabc4[_0xaa94('0x31')]=_0x1eabc4[_0xaa94('0x3c')];}RpcVoiceRecording[_0xaa94('0x2d')](_0x1eabc4);}}};Report['prototype'][_0xaa94('0x4a')]=function(_0x34dc36){if(_[_0xaa94('0x4b')](_0x34dc36)){_0x34dc36[_0xaa94('0x4c')](function(_0x49d885){RpcVoiceAgentReport[_0xaa94('0x2d')](_0x49d885);});}else{RpcVoiceAgentReport[_0xaa94('0x2d')](_0x34dc36);}};Report['prototype'][_0xaa94('0x1d')]=function(_0x6a0782){RpcVoiceDialReport['create'](_0x6a0782);var _0x54425f=undefined;var _0x3b0cfe=_0x6a0782['channel'];if(_[_0xaa94('0x4d')](_0x3b0cfe,_0xaa94('0x4e'))){var _0x55a8a4=_0x3b0cfe[_0xaa94('0x4f')](_0x3b0cfe[_0xaa94('0x50')]('/')+0x1,_0x3b0cfe[_0xaa94('0x50')]('@'));_0x54425f=_[_0xaa94('0x51')](this[_0xaa94('0x12')],function(_0x159d6f){return _0x159d6f[_0xaa94('0x52')]==_0x55a8a4||_0x159d6f[_0xaa94('0x53')]==_0x55a8a4||_0x159d6f[_0xaa94('0x22')]==_0x55a8a4;});}else{var _0x55a8a4=_0x3b0cfe[_0xaa94('0x4f')](_0x3b0cfe[_0xaa94('0x50')]('/')+0x1,_0x3b0cfe[_0xaa94('0x54')]('-'));_0x54425f=this[_0xaa94('0x21')](_0x55a8a4);}if(_0x54425f){_0x6a0782['interface']=_['isNil'](_0x54425f[_0xaa94('0x24')])?util['format']('SIP/%s',_0x54425f[_0xaa94('0x23')]):_0x54425f[_0xaa94('0x24')];_0x6a0782[_0xaa94('0x55')]=_0x54425f['name'];_0x6a0782[_0xaa94('0x22')]=_0x54425f[_0xaa94('0x22')];RpcMemberReport[_0xaa94('0x1d')](_0x6a0782);}};Report['prototype']['blindTransfer']=function(_0x272b69){RpcVoiceTransferReport['blindTransfer'](_0x272b69);};Report['prototype'][_0xaa94('0x20')]=function(_0x37c55a){RpcVoiceTransferReport[_0xaa94('0x20')](_0x37c55a);};module[_0xaa94('0x56')]=Report; \ No newline at end of file diff --git a/server/services/ami/report/userReport.js b/server/services/ami/report/userReport.js index 128afad..39f131a 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 _0x6c3e=['ioredis','../../../config/environment','../../../config/logger','ami','../ami','redis','defaults','socket.io-emitter','trunks','agents','telephones','registryentry','syncRegistry','bind','devicestatechange','syncDeviceState','peerstatus','syncPeerStatus','loopSyncRealTimeShow','resolve','then','actionSipShowRegistry','actionDeviceStateList','actionSipPeerStatus','catch','[loopSyncRealTimeShow]','error','inspect','prototype','isNotNull','isUndefined','emit','find','username','stateRegistry','state','omit','event','format','trunk:%s','trunk:save','device','local','toLowerCase','inuse','stateTime','toNumber','updateStatusRealtime','telephone:%s','name','telephone:save','startsWith','Queue','Local','substring','indexOf','mobile','phone','accountcode','[syncDeviceState][UserReport]','peer','status','address','[syncPeerStatus][UserReport]','exports','lodash','moment','bluebird','util'];(function(_0x53b53e,_0x498437){var _0xbb6179=function(_0x3975eb){while(--_0x3975eb){_0x53b53e['push'](_0x53b53e['shift']());}};_0xbb6179(++_0x498437);}(_0x6c3e,0x86));var _0xe6c3=function(_0xfe7208,_0x5302a8){_0xfe7208=_0xfe7208-0x0;var _0x228585=_0x6c3e[_0xfe7208];return _0x228585;};'use strict';var _=require(_0xe6c3('0x0'));var moment=require(_0xe6c3('0x1'));var BPromise=require(_0xe6c3('0x2'));var util=require(_0xe6c3('0x3'));var Redis=require(_0xe6c3('0x4'));var config=require(_0xe6c3('0x5'));var logger=require(_0xe6c3('0x6'))(_0xe6c3('0x7'));var ami=require(_0xe6c3('0x8'));config[_0xe6c3('0x9')]=_[_0xe6c3('0xa')](config[_0xe6c3('0x9')],{'host':'localhost','port':0x18eb});var io=require(_0xe6c3('0xb'))(new Redis(config['redis']));function UserReport(_0x25c0a1){this[_0xe6c3('0xc')]=_0x25c0a1[_0xe6c3('0xc')];this[_0xe6c3('0xd')]=_0x25c0a1[_0xe6c3('0xd')];this[_0xe6c3('0xe')]=_0x25c0a1[_0xe6c3('0xe')];ami['on'](_0xe6c3('0xf'),this[_0xe6c3('0x10')][_0xe6c3('0x11')](this));ami['on']('registry',this[_0xe6c3('0x10')][_0xe6c3('0x11')](this));ami['on'](_0xe6c3('0x12'),this[_0xe6c3('0x13')]['bind'](this));ami['on'](_0xe6c3('0x14'),this[_0xe6c3('0x15')]['bind'](this));this[_0xe6c3('0x16')]();return BPromise[_0xe6c3('0x17')]()[_0xe6c3('0x18')](ami[_0xe6c3('0x19')]())[_0xe6c3('0x18')](ami[_0xe6c3('0x1a')]())['then'](ami[_0xe6c3('0x1b')]())[_0xe6c3('0x1c')](loggerCatch(_0xe6c3('0x1d')));}function loggerCatch(_0x4620e2){return function(_0x9b9a05){logger[_0xe6c3('0x1e')](_0x4620e2,util[_0xe6c3('0x1f')](_0x9b9a05,{'showHidden':![],'depth':null}));};}UserReport['prototype'][_0xe6c3('0x16')]=function(){setInterval(function(){BPromise[_0xe6c3('0x17')]()[_0xe6c3('0x18')](ami['actionSipShowRegistry']())[_0xe6c3('0x18')](ami[_0xe6c3('0x1a')]())[_0xe6c3('0x18')](ami[_0xe6c3('0x1b')]())[_0xe6c3('0x1c')](loggerCatch('[loopSyncRealTimeShow]'));},0x32c8);};UserReport[_0xe6c3('0x20')][_0xe6c3('0x21')]=function(_0x50807d){return _0x50807d!==null&&!_[_0xe6c3('0x22')](_0x50807d);};UserReport[_0xe6c3('0x20')]['emit']=function(_0x2c9b84,_0x747c56,_0xe139ac){io['to'](_0x2c9b84)[_0xe6c3('0x23')](_0x747c56,_0xe139ac);};UserReport[_0xe6c3('0x20')]['syncRegistry']=function(_0x1de9e3){try{if(this[_0xe6c3('0x21')](_0x1de9e3)){var _0xbf25b1=_[_0xe6c3('0x24')](this['trunks'],{'registry':_0x1de9e3[_0xe6c3('0x25')]});if(_0xbf25b1){_0x1de9e3[_0xe6c3('0x26')]=_0x1de9e3[_0xe6c3('0x27')];_['merge'](_0xbf25b1,_[_0xe6c3('0x28')](_0x1de9e3,[_0xe6c3('0x29'),'actionid',_0xe6c3('0x25'),_0xe6c3('0x27')]));this['emit'](util[_0xe6c3('0x2a')](_0xe6c3('0x2b'),_0xbf25b1['name']),_0xe6c3('0x2c'),_0xbf25b1);}}}catch(_0x3fe5d5){logger[_0xe6c3('0x1e')]('[syncRegistry][UserReport]',util[_0xe6c3('0x1f')](_0x3fe5d5,{'showHidden':![],'depth':null}));}};UserReport[_0xe6c3('0x20')][_0xe6c3('0x13')]=function(_0x19d5dd){try{if(this[_0xe6c3('0x21')](_0x19d5dd)){if(this[_0xe6c3('0xd')][_0x19d5dd[_0xe6c3('0x2d')]]){if(!this[_0xe6c3('0xd')][_0x19d5dd['device']][_0xe6c3('0x2e')]||_0x19d5dd[_0xe6c3('0x27')][_0xe6c3('0x2f')]()==_0xe6c3('0x30')){this[_0xe6c3('0xd')][_0x19d5dd[_0xe6c3('0x2d')]][_0xe6c3('0x2e')]=![];if(this[_0xe6c3('0xd')][_0x19d5dd[_0xe6c3('0x2d')]]['state']!==_0x19d5dd[_0xe6c3('0x27')][_0xe6c3('0x2f')]()){this[_0xe6c3('0xd')][_0x19d5dd[_0xe6c3('0x2d')]][_0xe6c3('0x31')]=_[_0xe6c3('0x32')](moment()[_0xe6c3('0x2a')]('x'));}this[_0xe6c3('0xd')][_0x19d5dd[_0xe6c3('0x2d')]]['state']=_0x19d5dd['state'][_0xe6c3('0x2f')]();this[_0xe6c3('0xd')][_0x19d5dd[_0xe6c3('0x2d')]][_0xe6c3('0x33')](_0x19d5dd);}}else if(this[_0xe6c3('0xe')][_0x19d5dd[_0xe6c3('0x2d')]]){if(this['telephones'][_0x19d5dd['device']][_0xe6c3('0x27')]!==_0x19d5dd[_0xe6c3('0x27')]['toLowerCase']()){this['telephones'][_0x19d5dd[_0xe6c3('0x2d')]][_0xe6c3('0x31')]=_[_0xe6c3('0x32')](moment()[_0xe6c3('0x2a')]('x'));}this[_0xe6c3('0xe')][_0x19d5dd[_0xe6c3('0x2d')]][_0xe6c3('0x27')]=_0x19d5dd[_0xe6c3('0x27')][_0xe6c3('0x2f')]();this['emit'](util[_0xe6c3('0x2a')](_0xe6c3('0x34'),this[_0xe6c3('0xe')][_0x19d5dd['device']][_0xe6c3('0x35')]),_0xe6c3('0x36'),this['telephones'][_0x19d5dd[_0xe6c3('0x2d')]]);}else if(this[_0xe6c3('0xc')][_0x19d5dd['device']]){if(this[_0xe6c3('0xc')][_0x19d5dd['device']][_0xe6c3('0x27')]!==_0x19d5dd[_0xe6c3('0x27')][_0xe6c3('0x2f')]()){this[_0xe6c3('0xc')][_0x19d5dd[_0xe6c3('0x2d')]]['stateTime']=_[_0xe6c3('0x32')](moment()[_0xe6c3('0x2a')]('x'));}this['trunks'][_0x19d5dd[_0xe6c3('0x2d')]][_0xe6c3('0x27')]=_0x19d5dd[_0xe6c3('0x27')][_0xe6c3('0x2f')]();this[_0xe6c3('0x23')](util[_0xe6c3('0x2a')](_0xe6c3('0x2b'),this['trunks'][_0x19d5dd[_0xe6c3('0x2d')]][_0xe6c3('0x35')]),_0xe6c3('0x2c'),this[_0xe6c3('0xc')][_0x19d5dd[_0xe6c3('0x2d')]]);}else if(_[_0xe6c3('0x37')](_0x19d5dd[_0xe6c3('0x2d')],_0xe6c3('0x38'))){}else if(_[_0xe6c3('0x37')](_0x19d5dd[_0xe6c3('0x2d')],_0xe6c3('0x39'))){var _0x136459=_0x19d5dd[_0xe6c3('0x2d')];var _0x5e0cfe=_0x136459[_0xe6c3('0x3a')](_0x136459[_0xe6c3('0x3b')]('/')+0x1,_0x136459[_0xe6c3('0x3b')]('@'));var _0x16d0a5=_['find'](this[_0xe6c3('0xd')],function(_0x572b08){return _0x572b08[_0xe6c3('0x3c')]==_0x5e0cfe||_0x572b08[_0xe6c3('0x3d')]==_0x5e0cfe||_0x572b08[_0xe6c3('0x3e')]==_0x5e0cfe;});if(_0x16d0a5){if(_0x16d0a5[_0xe6c3('0x27')]!==_0x19d5dd['state'][_0xe6c3('0x2f')]()){_0x16d0a5[_0xe6c3('0x31')]=_['toNumber'](moment()[_0xe6c3('0x2a')]('x'));}_0x16d0a5['state']=_0x19d5dd[_0xe6c3('0x27')][_0xe6c3('0x2f')]();_0x16d0a5['local']=!![];_0x16d0a5[_0xe6c3('0x33')](_0x19d5dd);}}else{}}}catch(_0x119aea){logger[_0xe6c3('0x1e')](_0xe6c3('0x3f'),util['inspect'](_0x119aea,{'showHidden':![],'depth':null}));}};UserReport[_0xe6c3('0x20')][_0xe6c3('0x15')]=function(_0x53eef2){try{if(this[_0xe6c3('0x21')](_0x53eef2)&&this[_0xe6c3('0x21')](_0x53eef2['peerstatus'])){if(this[_0xe6c3('0xd')][_0x53eef2[_0xe6c3('0x40')]]){if(!this[_0xe6c3('0xd')][_0x53eef2[_0xe6c3('0x40')]]['local']||_0x53eef2[_0xe6c3('0x14')][_0xe6c3('0x2f')]()=='registered'){this[_0xe6c3('0xd')][_0x53eef2['peer']][_0xe6c3('0x2e')]=![];this['agents'][_0x53eef2[_0xe6c3('0x40')]][_0xe6c3('0x41')]=_0x53eef2[_0xe6c3('0x14')][_0xe6c3('0x2f')]();this['agents'][_0x53eef2[_0xe6c3('0x40')]][_0xe6c3('0x42')]=_0x53eef2[_0xe6c3('0x42')];this[_0xe6c3('0xd')][_0x53eef2[_0xe6c3('0x40')]][_0xe6c3('0x33')](_0x53eef2);}}else if(this[_0xe6c3('0xe')][_0x53eef2[_0xe6c3('0x40')]]){this[_0xe6c3('0xe')][_0x53eef2['peer']][_0xe6c3('0x41')]=_0x53eef2[_0xe6c3('0x14')][_0xe6c3('0x2f')]();this[_0xe6c3('0xe')][_0x53eef2['peer']][_0xe6c3('0x42')]=_0x53eef2[_0xe6c3('0x42')];this[_0xe6c3('0x23')](util['format'](_0xe6c3('0x34'),this[_0xe6c3('0xe')][_0x53eef2[_0xe6c3('0x40')]][_0xe6c3('0x35')]),_0xe6c3('0x36'),this[_0xe6c3('0xe')][_0x53eef2[_0xe6c3('0x40')]]);}else if(this[_0xe6c3('0xc')][_0x53eef2[_0xe6c3('0x40')]]){this['trunks'][_0x53eef2[_0xe6c3('0x40')]][_0xe6c3('0x41')]=_0x53eef2[_0xe6c3('0x14')]['toLowerCase']();this[_0xe6c3('0xc')][_0x53eef2['peer']][_0xe6c3('0x42')]=_0x53eef2[_0xe6c3('0x42')];this[_0xe6c3('0x23')](util['format'](_0xe6c3('0x2b'),this[_0xe6c3('0xc')][_0x53eef2[_0xe6c3('0x40')]]['name']),_0xe6c3('0x2c'),this['trunks'][_0x53eef2[_0xe6c3('0x40')]]);}else{}}}catch(_0x4f12e4){logger['error'](_0xe6c3('0x43'),util[_0xe6c3('0x1f')](_0x4f12e4,{'showHidden':![],'depth':null}));}};module[_0xe6c3('0x44')]=UserReport; \ No newline at end of file +var _0xeec1=['username','stateRegistry','merge','event','actionid','state','format','trunk:%s','name','trunk:save','[syncRegistry][UserReport]','inspect','device','local','inuse','toLowerCase','stateTime','toNumber','updateStatusRealtime','telephone:%s','startsWith','substring','mobile','phone','accountcode','peer','registered','status','address','telephone:save','[syncPeerStatus][UserReport]','exports','lodash','moment','util','ioredis','../../../config/logger','ami','../ami','redis','defaults','trunks','agents','telephones','syncRegistry','bind','registry','syncDeviceState','peerstatus','syncPeerStatus','resolve','then','actionDeviceStateList','actionSipPeerStatus','error','prototype','loopSyncRealTimeShow','actionSipShowRegistry','catch','[loopSyncRealTimeShow]','isNotNull','isUndefined','emit','find'];(function(_0x1751f0,_0x15e9f7){var _0x98490=function(_0x2c1157){while(--_0x2c1157){_0x1751f0['push'](_0x1751f0['shift']());}};_0x98490(++_0x15e9f7);}(_0xeec1,0x120));var _0x1eec=function(_0x195265,_0x31300c){_0x195265=_0x195265-0x0;var _0x450c60=_0xeec1[_0x195265];return _0x450c60;};'use strict';var _=require(_0x1eec('0x0'));var moment=require(_0x1eec('0x1'));var BPromise=require('bluebird');var util=require(_0x1eec('0x2'));var Redis=require(_0x1eec('0x3'));var config=require('../../../config/environment');var logger=require(_0x1eec('0x4'))(_0x1eec('0x5'));var ami=require(_0x1eec('0x6'));config[_0x1eec('0x7')]=_[_0x1eec('0x8')](config[_0x1eec('0x7')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x1eec('0x7')]));function UserReport(_0x8e6312){this[_0x1eec('0x9')]=_0x8e6312[_0x1eec('0x9')];this['agents']=_0x8e6312[_0x1eec('0xa')];this[_0x1eec('0xb')]=_0x8e6312[_0x1eec('0xb')];ami['on']('registryentry',this[_0x1eec('0xc')][_0x1eec('0xd')](this));ami['on'](_0x1eec('0xe'),this['syncRegistry'][_0x1eec('0xd')](this));ami['on']('devicestatechange',this[_0x1eec('0xf')][_0x1eec('0xd')](this));ami['on'](_0x1eec('0x10'),this[_0x1eec('0x11')][_0x1eec('0xd')](this));this['loopSyncRealTimeShow']();return BPromise[_0x1eec('0x12')]()['then'](ami['actionSipShowRegistry']())[_0x1eec('0x13')](ami[_0x1eec('0x14')]())[_0x1eec('0x13')](ami[_0x1eec('0x15')]())['catch'](loggerCatch('[loopSyncRealTimeShow]'));}function loggerCatch(_0x332e6f){return function(_0x550b66){logger[_0x1eec('0x16')](_0x332e6f,util['inspect'](_0x550b66,{'showHidden':![],'depth':null}));};}UserReport[_0x1eec('0x17')][_0x1eec('0x18')]=function(){setInterval(function(){BPromise[_0x1eec('0x12')]()['then'](ami[_0x1eec('0x19')]())[_0x1eec('0x13')](ami['actionDeviceStateList']())[_0x1eec('0x13')](ami[_0x1eec('0x15')]())[_0x1eec('0x1a')](loggerCatch(_0x1eec('0x1b')));},0x32c8);};UserReport[_0x1eec('0x17')][_0x1eec('0x1c')]=function(_0x115b98){return _0x115b98!==null&&!_[_0x1eec('0x1d')](_0x115b98);};UserReport[_0x1eec('0x17')][_0x1eec('0x1e')]=function(_0x11338c,_0x4c2fc6,_0x5beeca){io['to'](_0x11338c)[_0x1eec('0x1e')](_0x4c2fc6,_0x5beeca);};UserReport[_0x1eec('0x17')]['syncRegistry']=function(_0x28e251){try{if(this[_0x1eec('0x1c')](_0x28e251)){var _0x264658=_[_0x1eec('0x1f')](this[_0x1eec('0x9')],{'registry':_0x28e251[_0x1eec('0x20')]});if(_0x264658){_0x28e251[_0x1eec('0x21')]=_0x28e251['state'];_[_0x1eec('0x22')](_0x264658,_['omit'](_0x28e251,[_0x1eec('0x23'),_0x1eec('0x24'),_0x1eec('0x20'),_0x1eec('0x25')]));this[_0x1eec('0x1e')](util[_0x1eec('0x26')](_0x1eec('0x27'),_0x264658[_0x1eec('0x28')]),_0x1eec('0x29'),_0x264658);}}}catch(_0x20f8e2){logger['error'](_0x1eec('0x2a'),util[_0x1eec('0x2b')](_0x20f8e2,{'showHidden':![],'depth':null}));}};UserReport[_0x1eec('0x17')]['syncDeviceState']=function(_0x260a14){try{if(this[_0x1eec('0x1c')](_0x260a14)){if(this[_0x1eec('0xa')][_0x260a14[_0x1eec('0x2c')]]){if(!this[_0x1eec('0xa')][_0x260a14[_0x1eec('0x2c')]][_0x1eec('0x2d')]||_0x260a14['state']['toLowerCase']()==_0x1eec('0x2e')){this[_0x1eec('0xa')][_0x260a14[_0x1eec('0x2c')]][_0x1eec('0x2d')]=![];if(this['agents'][_0x260a14[_0x1eec('0x2c')]][_0x1eec('0x25')]!==_0x260a14[_0x1eec('0x25')][_0x1eec('0x2f')]()){this[_0x1eec('0xa')][_0x260a14['device']][_0x1eec('0x30')]=_[_0x1eec('0x31')](moment()[_0x1eec('0x26')]('x'));}this[_0x1eec('0xa')][_0x260a14[_0x1eec('0x2c')]][_0x1eec('0x25')]=_0x260a14[_0x1eec('0x25')][_0x1eec('0x2f')]();this['agents'][_0x260a14[_0x1eec('0x2c')]][_0x1eec('0x32')](_0x260a14);}}else if(this[_0x1eec('0xb')][_0x260a14[_0x1eec('0x2c')]]){if(this[_0x1eec('0xb')][_0x260a14[_0x1eec('0x2c')]][_0x1eec('0x25')]!==_0x260a14[_0x1eec('0x25')][_0x1eec('0x2f')]()){this[_0x1eec('0xb')][_0x260a14[_0x1eec('0x2c')]][_0x1eec('0x30')]=_['toNumber'](moment()[_0x1eec('0x26')]('x'));}this[_0x1eec('0xb')][_0x260a14[_0x1eec('0x2c')]][_0x1eec('0x25')]=_0x260a14[_0x1eec('0x25')][_0x1eec('0x2f')]();this[_0x1eec('0x1e')](util['format'](_0x1eec('0x33'),this['telephones'][_0x260a14[_0x1eec('0x2c')]][_0x1eec('0x28')]),'telephone:save',this[_0x1eec('0xb')][_0x260a14[_0x1eec('0x2c')]]);}else if(this[_0x1eec('0x9')][_0x260a14['device']]){if(this[_0x1eec('0x9')][_0x260a14['device']][_0x1eec('0x25')]!==_0x260a14[_0x1eec('0x25')][_0x1eec('0x2f')]()){this[_0x1eec('0x9')][_0x260a14[_0x1eec('0x2c')]][_0x1eec('0x30')]=_[_0x1eec('0x31')](moment()[_0x1eec('0x26')]('x'));}this[_0x1eec('0x9')][_0x260a14[_0x1eec('0x2c')]][_0x1eec('0x25')]=_0x260a14[_0x1eec('0x25')]['toLowerCase']();this[_0x1eec('0x1e')](util[_0x1eec('0x26')](_0x1eec('0x27'),this[_0x1eec('0x9')][_0x260a14['device']][_0x1eec('0x28')]),'trunk:save',this[_0x1eec('0x9')][_0x260a14[_0x1eec('0x2c')]]);}else if(_[_0x1eec('0x34')](_0x260a14['device'],'Queue')){}else if(_[_0x1eec('0x34')](_0x260a14['device'],'Local')){var _0x12291a=_0x260a14['device'];var _0x4a21b5=_0x12291a[_0x1eec('0x35')](_0x12291a['indexOf']('/')+0x1,_0x12291a['indexOf']('@'));var _0x58742c=_[_0x1eec('0x1f')](this['agents'],function(_0x15d8f4){return _0x15d8f4[_0x1eec('0x36')]==_0x4a21b5||_0x15d8f4[_0x1eec('0x37')]==_0x4a21b5||_0x15d8f4[_0x1eec('0x38')]==_0x4a21b5;});if(_0x58742c){if(_0x58742c[_0x1eec('0x25')]!==_0x260a14[_0x1eec('0x25')][_0x1eec('0x2f')]()){_0x58742c[_0x1eec('0x30')]=_['toNumber'](moment()['format']('x'));}_0x58742c[_0x1eec('0x25')]=_0x260a14[_0x1eec('0x25')]['toLowerCase']();_0x58742c[_0x1eec('0x2d')]=!![];_0x58742c[_0x1eec('0x32')](_0x260a14);}}else{}}}catch(_0x3981ae){logger[_0x1eec('0x16')]('[syncDeviceState][UserReport]',util[_0x1eec('0x2b')](_0x3981ae,{'showHidden':![],'depth':null}));}};UserReport['prototype'][_0x1eec('0x11')]=function(_0x212838){try{if(this[_0x1eec('0x1c')](_0x212838)&&this[_0x1eec('0x1c')](_0x212838[_0x1eec('0x10')])){if(this[_0x1eec('0xa')][_0x212838[_0x1eec('0x39')]]){if(!this[_0x1eec('0xa')][_0x212838['peer']][_0x1eec('0x2d')]||_0x212838[_0x1eec('0x10')]['toLowerCase']()==_0x1eec('0x3a')){this[_0x1eec('0xa')][_0x212838[_0x1eec('0x39')]][_0x1eec('0x2d')]=![];this[_0x1eec('0xa')][_0x212838[_0x1eec('0x39')]][_0x1eec('0x3b')]=_0x212838['peerstatus'][_0x1eec('0x2f')]();this[_0x1eec('0xa')][_0x212838[_0x1eec('0x39')]][_0x1eec('0x3c')]=_0x212838[_0x1eec('0x3c')];this[_0x1eec('0xa')][_0x212838[_0x1eec('0x39')]]['updateStatusRealtime'](_0x212838);}}else if(this[_0x1eec('0xb')][_0x212838[_0x1eec('0x39')]]){this[_0x1eec('0xb')][_0x212838['peer']][_0x1eec('0x3b')]=_0x212838[_0x1eec('0x10')]['toLowerCase']();this['telephones'][_0x212838['peer']]['address']=_0x212838['address'];this[_0x1eec('0x1e')](util['format'](_0x1eec('0x33'),this[_0x1eec('0xb')][_0x212838[_0x1eec('0x39')]]['name']),_0x1eec('0x3d'),this[_0x1eec('0xb')][_0x212838[_0x1eec('0x39')]]);}else if(this[_0x1eec('0x9')][_0x212838[_0x1eec('0x39')]]){this[_0x1eec('0x9')][_0x212838[_0x1eec('0x39')]][_0x1eec('0x3b')]=_0x212838['peerstatus'][_0x1eec('0x2f')]();this['trunks'][_0x212838[_0x1eec('0x39')]][_0x1eec('0x3c')]=_0x212838[_0x1eec('0x3c')];this[_0x1eec('0x1e')](util['format'](_0x1eec('0x27'),this[_0x1eec('0x9')][_0x212838[_0x1eec('0x39')]][_0x1eec('0x28')]),_0x1eec('0x29'),this[_0x1eec('0x9')][_0x212838[_0x1eec('0x39')]]);}else{}}}catch(_0x3bace0){logger[_0x1eec('0x16')](_0x1eec('0x3e'),util[_0x1eec('0x2b')](_0x3bace0,{'showHidden':![],'depth':null}));}};module[_0x1eec('0x3f')]=UserReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceAgentReport.js b/server/services/ami/report/voiceAgentReport.js index 51441fb..cc56f72 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 _0x7b39=['destconnectedlinenum','user:%s','user:agentconnect','custom:agentconnect','agentringnoanswerAt','reason','answered_elsewhere','custom:agentansweredelsewhere','error','[syncAgentConnect][VoiceAgentReport]','rejected','custom:agentringnoanswer','[syncAgentRingNoAnswer][VoiceAgentReport]','abandoned','custom:agentqueuecallerabandon','[syncQueueCallerAbandon][VoiceAgentReport]','agentcomplete','agentcompleteAt','complete','talktime','transfer','agent','user:agentcomplete','addVariable','keys','variable','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','bridgepvtcallid','membercalls','memberdynamic','memberinterface','memberlastcall','memberpenalty','memberrealtime','isNil','includes','syncHangup','custom:voiceAgentReport','values','[syncHangup][VoiceAgentReport]','transfereeuniqueid','origtransfereruniqueid','diff','seconds','secondtransfereruniqueid','[syncAttendedTransfer][VoiceAgentReport]','transfereruniqueid','[syncBlindTransfer][VoiceAgentReport]','channel','substring','lastIndexOf','onhold','[syncMusicOnHoldStart][VoiceAgentReport]','[syncMusicOnHoldStop][VoiceAgentReport]','exports','lodash','moment','util','ioredis','../../../config/environment','../../../config/logger','ami','../ami','redis','defaults','localhost','socket.io-emitter','channels','voiceQueues','agents','variables','agentcalled','syncAgentCalled','bind','syncAgentConnect','agentringnoanswer','syncAgentRingNoAnswer','syncQueueCallerAbandon','syncAgentComplete','varset','syncVarSet','hangup','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','attendedtransfer','syncAttendedTransfer','syncBlindTransfer','prototype','emit','isNotNull','isUndefined','uniqueid','destuniqueid','format','YYYY-MM-DD\x20HH:mm:ss','called','queue','type','inbound','merge','omit','event','privilege','custom:agentcalled','membername','user:called','[syncAgentCalled][VoiceAgentReport]','inspect','hasOwnProperty','agentconnectAt','lastevent','connect','holdtime','connectedlinenum','connectedlinename','destchannelstate','destchannelstatedesc','interface','pick'];(function(_0x4d6c0f,_0x2c147e){var _0x2ff655=function(_0x1595b9){while(--_0x1595b9){_0x4d6c0f['push'](_0x4d6c0f['shift']());}};_0x2ff655(++_0x2c147e);}(_0x7b39,0x1be));var _0x97b3=function(_0x4d8ed9,_0x2ae284){_0x4d8ed9=_0x4d8ed9-0x0;var _0x1e2140=_0x7b39[_0x4d8ed9];return _0x1e2140;};'use strict';var _=require(_0x97b3('0x0'));var moment=require(_0x97b3('0x1'));var util=require(_0x97b3('0x2'));var Redis=require(_0x97b3('0x3'));var config=require(_0x97b3('0x4'));var logger=require(_0x97b3('0x5'))(_0x97b3('0x6'));var ami=require(_0x97b3('0x7'));config[_0x97b3('0x8')]=_[_0x97b3('0x9')](config[_0x97b3('0x8')],{'host':_0x97b3('0xa'),'port':0x18eb});var io=require(_0x97b3('0xb'))(new Redis(config[_0x97b3('0x8')]));function VoiceAgentReport(_0x3b7cff){this[_0x97b3('0xc')]={};this[_0x97b3('0xd')]=_0x3b7cff[_0x97b3('0xd')];this[_0x97b3('0xe')]=_0x3b7cff[_0x97b3('0xe')];this[_0x97b3('0xf')]={};ami['on'](_0x97b3('0x10'),this[_0x97b3('0x11')][_0x97b3('0x12')](this));ami['on']('agentconnect',this[_0x97b3('0x13')][_0x97b3('0x12')](this));ami['on'](_0x97b3('0x14'),this[_0x97b3('0x15')][_0x97b3('0x12')](this));ami['on']('queuecallerabandon',this[_0x97b3('0x16')][_0x97b3('0x12')](this));ami['on']('agentcomplete',this[_0x97b3('0x17')]['bind'](this));ami['on'](_0x97b3('0x18'),this[_0x97b3('0x19')][_0x97b3('0x12')](this));ami['on'](_0x97b3('0x1a'),this['syncHangup'][_0x97b3('0x12')](this));ami['on'](_0x97b3('0x1b'),this[_0x97b3('0x1c')][_0x97b3('0x12')](this));ami['on'](_0x97b3('0x1d'),this[_0x97b3('0x1e')]['bind'](this));ami['on'](_0x97b3('0x1f'),this[_0x97b3('0x20')][_0x97b3('0x12')](this));ami['on']('blindtransfer',this[_0x97b3('0x21')][_0x97b3('0x12')](this));}VoiceAgentReport[_0x97b3('0x22')][_0x97b3('0x23')]=function(_0x2046ca,_0x37f690,_0x58f52e){io['to'](_0x2046ca)[_0x97b3('0x23')](_0x37f690,_0x58f52e);};VoiceAgentReport[_0x97b3('0x22')]['isNotNull']=function(_0x40958f){return _0x40958f!==null&&!_['isUndefined'](_0x40958f);};VoiceAgentReport[_0x97b3('0x22')][_0x97b3('0x11')]=function(_0x328b80){try{if(this[_0x97b3('0x24')](_0x328b80)){if(_[_0x97b3('0x25')](this[_0x97b3('0xc')][_0x328b80[_0x97b3('0x26')]])){this[_0x97b3('0xc')][_0x328b80['uniqueid']]={};}if(_[_0x97b3('0x25')](this[_0x97b3('0xc')][_0x328b80[_0x97b3('0x26')]][_0x328b80[_0x97b3('0x27')]])){this['channels'][_0x328b80[_0x97b3('0x26')]][_0x328b80[_0x97b3('0x27')]]={'agentcalledAt':moment()[_0x97b3('0x28')](_0x97b3('0x29')),'lastevent':_0x97b3('0x2a'),'variables':this[_0x97b3('0xf')][_0x328b80[_0x97b3('0x26')]],'type':this[_0x97b3('0xd')][_0x328b80[_0x97b3('0x2b')]]?this[_0x97b3('0xd')][_0x328b80[_0x97b3('0x2b')]][_0x97b3('0x2c')]||'inbound':_0x97b3('0x2d')};}_[_0x97b3('0x2e')](this[_0x97b3('0xc')][_0x328b80[_0x97b3('0x26')]][_0x328b80[_0x97b3('0x27')]],_[_0x97b3('0x2f')](_0x328b80,[_0x97b3('0x30'),_0x97b3('0x31')]));ami[_0x97b3('0x23')](_0x97b3('0x32'),this[_0x97b3('0xc')][_0x328b80[_0x97b3('0x26')]][_0x328b80[_0x97b3('0x27')]]);this[_0x97b3('0x23')](util[_0x97b3('0x28')]('user:%s',_0x328b80[_0x97b3('0x33')]),_0x97b3('0x34'),this[_0x97b3('0xc')][_0x328b80['uniqueid']][_0x328b80['destuniqueid']]);}}catch(_0x53e02a){logger['error'](_0x97b3('0x35'),util[_0x97b3('0x36')](_0x53e02a,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x97b3('0x22')][_0x97b3('0x13')]=function(_0x5a5c60){try{if(this[_0x97b3('0x24')](_0x5a5c60)){if(this[_0x97b3('0xc')][_0x5a5c60[_0x97b3('0x26')]]){for(var _0x1dd924 in this[_0x97b3('0xc')][_0x5a5c60['uniqueid']]){if(this[_0x97b3('0xc')][_0x5a5c60[_0x97b3('0x26')]][_0x97b3('0x37')](_0x1dd924)){if(_0x5a5c60['destuniqueid']===_0x1dd924){this[_0x97b3('0xc')][_0x5a5c60[_0x97b3('0x26')]][_0x1dd924][_0x97b3('0x38')]=moment()[_0x97b3('0x28')](_0x97b3('0x29'));this[_0x97b3('0xc')][_0x5a5c60['uniqueid']][_0x1dd924][_0x97b3('0x39')]=_0x97b3('0x3a');this[_0x97b3('0xc')][_0x5a5c60[_0x97b3('0x26')]][_0x1dd924][_0x97b3('0x3b')]=_0x5a5c60[_0x97b3('0x3b')];this[_0x97b3('0xc')][_0x5a5c60['uniqueid']][_0x1dd924]['connectedlinenum']=_0x5a5c60[_0x97b3('0x3c')];this['channels'][_0x5a5c60['uniqueid']][_0x1dd924][_0x97b3('0x3d')]=_0x5a5c60[_0x97b3('0x3d')];this[_0x97b3('0xc')][_0x5a5c60['uniqueid']][_0x1dd924]['destchannelstate']=_0x5a5c60[_0x97b3('0x3e')];this[_0x97b3('0xc')][_0x5a5c60[_0x97b3('0x26')]][_0x1dd924][_0x97b3('0x3f')]=_0x5a5c60[_0x97b3('0x3f')];_['merge'](this[_0x97b3('0xe')][_0x5a5c60[_0x97b3('0x40')]],_[_0x97b3('0x41')](_0x5a5c60,['queue',_0x97b3('0x42')]));this[_0x97b3('0x23')](util[_0x97b3('0x28')](_0x97b3('0x43'),_0x5a5c60['membername']),_0x97b3('0x44'),this[_0x97b3('0xc')][_0x5a5c60[_0x97b3('0x26')]][_0x5a5c60['destuniqueid']]);ami[_0x97b3('0x23')](_0x97b3('0x45'),this[_0x97b3('0xc')][_0x5a5c60['uniqueid']][_0x1dd924]);}else if(!this[_0x97b3('0xc')][_0x5a5c60['uniqueid']][_0x1dd924]['agentringnoanswer']&&!this[_0x97b3('0xc')][_0x5a5c60['uniqueid']][_0x1dd924]['agentcomplete']){this['channels'][_0x5a5c60[_0x97b3('0x26')]][_0x1dd924]['agentringnoanswer']=!![];this[_0x97b3('0xc')][_0x5a5c60[_0x97b3('0x26')]][_0x1dd924][_0x97b3('0x46')]=moment()[_0x97b3('0x28')](_0x97b3('0x29'));this['channels'][_0x5a5c60[_0x97b3('0x26')]][_0x1dd924][_0x97b3('0x47')]='answered_elsewhere';this[_0x97b3('0xc')][_0x5a5c60[_0x97b3('0x26')]][_0x1dd924][_0x97b3('0x39')]=_0x97b3('0x48');this[_0x97b3('0xc')][_0x5a5c60[_0x97b3('0x26')]][_0x1dd924]['answeredelsewheredestinationuniqueid']=_0x5a5c60[_0x97b3('0x27')];this[_0x97b3('0xc')][_0x5a5c60[_0x97b3('0x26')]][_0x1dd924]['answeredelsewheremembername']=_0x5a5c60['membername'];ami['emit'](_0x97b3('0x49'),this['channels'][_0x5a5c60['uniqueid']][_0x1dd924]);}}}}}}catch(_0x1dfb4e){logger[_0x97b3('0x4a')](_0x97b3('0x4b'),util[_0x97b3('0x36')](_0x1dfb4e,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x97b3('0x22')][_0x97b3('0x15')]=function(_0x27f013){try{if(this[_0x97b3('0x24')](_0x27f013)){if(this[_0x97b3('0xc')][_0x27f013['uniqueid']]&&this[_0x97b3('0xc')][_0x27f013[_0x97b3('0x26')]][_0x27f013['destuniqueid']]){this['channels'][_0x27f013[_0x97b3('0x26')]][_0x27f013[_0x97b3('0x27')]][_0x97b3('0x14')]=!![];this[_0x97b3('0xc')][_0x27f013[_0x97b3('0x26')]][_0x27f013['destuniqueid']][_0x97b3('0x46')]=moment()[_0x97b3('0x28')](_0x97b3('0x29'));this[_0x97b3('0xc')][_0x27f013['uniqueid']][_0x27f013[_0x97b3('0x27')]][_0x97b3('0x47')]=_0x97b3('0x4c');this[_0x97b3('0xc')][_0x27f013[_0x97b3('0x26')]][_0x27f013[_0x97b3('0x27')]][_0x97b3('0x39')]=_0x97b3('0x4c');ami[_0x97b3('0x23')](_0x97b3('0x4d'),this[_0x97b3('0xc')][_0x27f013[_0x97b3('0x26')]][_0x27f013['destuniqueid']]);}}}catch(_0x3ff25c){logger[_0x97b3('0x4a')](_0x97b3('0x4e'),util[_0x97b3('0x36')](_0x3ff25c,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x97b3('0x22')][_0x97b3('0x16')]=function(_0x3ad718){try{if(this[_0x97b3('0x24')](_0x3ad718)){if(this[_0x97b3('0xc')][_0x3ad718[_0x97b3('0x26')]]){for(var _0x8a0212 in this[_0x97b3('0xc')][_0x3ad718[_0x97b3('0x26')]]){if(this[_0x97b3('0xc')][_0x3ad718[_0x97b3('0x26')]][_0x97b3('0x37')](_0x8a0212)&&!this['channels'][_0x3ad718[_0x97b3('0x26')]][_0x8a0212]['agentringnoanswer']&&!this[_0x97b3('0xc')][_0x3ad718[_0x97b3('0x26')]][_0x8a0212]['agentcomplete']){this[_0x97b3('0xc')][_0x3ad718[_0x97b3('0x26')]][_0x8a0212]['agentringnoanswer']=!![];this[_0x97b3('0xc')][_0x3ad718[_0x97b3('0x26')]][_0x8a0212]['agentringnoanswerAt']=moment()[_0x97b3('0x28')](_0x97b3('0x29'));this[_0x97b3('0xc')][_0x3ad718[_0x97b3('0x26')]][_0x8a0212][_0x97b3('0x47')]=_0x97b3('0x4f');this[_0x97b3('0xc')][_0x3ad718[_0x97b3('0x26')]][_0x8a0212][_0x97b3('0x39')]=_0x97b3('0x4f');ami[_0x97b3('0x23')](_0x97b3('0x50'),this[_0x97b3('0xc')][_0x3ad718[_0x97b3('0x26')]][_0x8a0212]);}}}}}catch(_0x5a814b){logger[_0x97b3('0x4a')](_0x97b3('0x51'),util['inspect'](_0x5a814b,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x97b3('0x22')][_0x97b3('0x17')]=function(_0x3b92ae){try{if(this[_0x97b3('0x24')](_0x3b92ae)){if(this[_0x97b3('0xc')][_0x3b92ae['uniqueid']]){for(var _0xdf7de7 in this[_0x97b3('0xc')][_0x3b92ae[_0x97b3('0x26')]]){if(this[_0x97b3('0xc')][_0x3b92ae[_0x97b3('0x26')]]['hasOwnProperty'](_0xdf7de7)){if(this['channels'][_0x3b92ae[_0x97b3('0x26')]][_0xdf7de7][_0x97b3('0x38')]&&!this[_0x97b3('0xc')][_0x3b92ae['uniqueid']][_0xdf7de7][_0x97b3('0x52')]){this['channels'][_0x3b92ae[_0x97b3('0x26')]][_0xdf7de7][_0x97b3('0x52')]=!![];this['channels'][_0x3b92ae['uniqueid']][_0xdf7de7][_0x97b3('0x53')]=moment()['format'](_0x97b3('0x29'));this['channels'][_0x3b92ae[_0x97b3('0x26')]][_0xdf7de7][_0x97b3('0x39')]=_0x97b3('0x54');this[_0x97b3('0xc')][_0x3b92ae[_0x97b3('0x26')]][_0xdf7de7]['talktime']=_0x3b92ae[_0x97b3('0x55')];this[_0x97b3('0xc')][_0x3b92ae[_0x97b3('0x26')]][_0xdf7de7][_0x97b3('0x47')]=_0x3b92ae['reason']==_0x97b3('0x56')?_0x97b3('0x57'):_0x3b92ae[_0x97b3('0x47')];if(this[_0x97b3('0xd')][_0x3b92ae[_0x97b3('0x2b')]]&&this[_0x97b3('0xd')][_0x3b92ae['queue']]['acw']){this[_0x97b3('0xc')][_0x3b92ae[_0x97b3('0x26')]][_0xdf7de7]['agentacw']=!![];this[_0x97b3('0xc')][_0x3b92ae['uniqueid']][_0xdf7de7]['acwtime']=this[_0x97b3('0xd')][_0x3b92ae[_0x97b3('0x2b')]]['acwTimeout'];}this[_0x97b3('0xe')][_0x3b92ae['interface']]=_[_0x97b3('0x2f')](this[_0x97b3('0xe')][_0x3b92ae[_0x97b3('0x40')]],[_0x97b3('0x2b'),'destconnectedlinenum']);this[_0x97b3('0x23')](util[_0x97b3('0x28')](_0x97b3('0x43'),_0x3b92ae[_0x97b3('0x33')]),_0x97b3('0x58'),this[_0x97b3('0xc')][_0x3b92ae[_0x97b3('0x26')]][_0xdf7de7]);ami[_0x97b3('0x23')]('custom:agentcomplete',this[_0x97b3('0xc')][_0x3b92ae[_0x97b3('0x26')]][_0xdf7de7]);}}}}}}catch(_0x1a38ec){logger[_0x97b3('0x4a')]('[syncAgentComplete][VoiceAgentReport]',util['inspect'](_0x1a38ec,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x97b3('0x22')][_0x97b3('0x19')]=function(_0x2b2c1f){try{if(this[_0x97b3('0x24')](_0x2b2c1f)){this[_0x97b3('0x59')](_0x2b2c1f[_0x97b3('0x26')],_[_0x97b3('0x5a')](_0x2b2c1f[_0x97b3('0x5b')])[0x0],_0x2b2c1f['value']);if(this[_0x97b3('0xc')][_0x2b2c1f[_0x97b3('0x26')]]){for(var _0x481721 in this[_0x97b3('0xc')][_0x2b2c1f[_0x97b3('0x26')]]){if(this['channels'][_0x2b2c1f[_0x97b3('0x26')]][_0x97b3('0x37')](_0x481721)){if(_[_0x97b3('0x25')](this[_0x97b3('0xc')][_0x2b2c1f[_0x97b3('0x26')]][_0x481721][_0x97b3('0xf')])){this[_0x97b3('0xc')][_0x2b2c1f['uniqueid']][_0x481721][_0x97b3('0xf')]={};}this[_0x97b3('0xc')][_0x2b2c1f[_0x97b3('0x26')]][_0x481721]['variables']=this[_0x97b3('0xf')][_0x2b2c1f[_0x97b3('0x26')]];}}}}}catch(_0x269482){logger['error']('[syncVarSet][VoiceAgentReport]',util['inspect'](_0x269482,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x97b3('0x22')][_0x97b3('0x59')]=function(_0x3aecfe,_0x43d33b,_0x58df66){var _0x45b03b=[_0x97b3('0x5c'),_0x97b3('0x5d'),'rtpaudioqosjitter',_0x97b3('0x5e'),_0x97b3('0x5f'),_0x97b3('0x60'),_0x97b3('0x61'),_0x97b3('0x62'),_0x97b3('0x63'),'sipuri','bridgepeer',_0x97b3('0x64'),_0x97b3('0x65'),_0x97b3('0x66'),_0x97b3('0x67'),_0x97b3('0x68'),_0x97b3('0x33'),_0x97b3('0x69'),_0x97b3('0x6a')];if(!_[_0x97b3('0x6b')](_0x43d33b)&&!_[_0x97b3('0x6c')](_0x45b03b,_0x43d33b)){if(_[_0x97b3('0x25')](this[_0x97b3('0xf')][_0x3aecfe])){this[_0x97b3('0xf')][_0x3aecfe]={};}this[_0x97b3('0xf')][_0x3aecfe][_0x43d33b]=_0x58df66;}};VoiceAgentReport[_0x97b3('0x22')][_0x97b3('0x6d')]=function(_0x322c13){try{if(this[_0x97b3('0x24')](_0x322c13)){if(this[_0x97b3('0xc')][_0x322c13['uniqueid']]){for(var _0x25c40d in this['channels'][_0x322c13[_0x97b3('0x26')]]){if(this['channels'][_0x322c13[_0x97b3('0x26')]][_0x97b3('0x37')](_0x25c40d)){if(this[_0x97b3('0xc')][_0x322c13['uniqueid']][_0x25c40d]['reason']=='transfer'&&this[_0x97b3('0xc')][_0x322c13[_0x97b3('0x26')]][_0x25c40d][_0x97b3('0x52')]){this[_0x97b3('0xc')][_0x322c13['uniqueid']][_0x25c40d][_0x97b3('0x53')]=moment()[_0x97b3('0x28')](_0x97b3('0x29'));}}}ami['emit'](_0x97b3('0x6e'),_[_0x97b3('0x6f')](this['channels'][_0x322c13[_0x97b3('0x26')]]));delete this[_0x97b3('0xc')][_0x322c13[_0x97b3('0x26')]];}if(this[_0x97b3('0xf')][_0x322c13[_0x97b3('0x26')]]){delete this[_0x97b3('0xf')][_0x322c13[_0x97b3('0x26')]];}}}catch(_0x4e857e){logger['error'](_0x97b3('0x70'),util[_0x97b3('0x36')](_0x4e857e,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype']['syncAttendedTransfer']=function(_0x39b4f8){try{if(this[_0x97b3('0x24')](_0x39b4f8)){if(this['channels'][_0x39b4f8[_0x97b3('0x71')]]){for(var _0xe51f85 in this['channels'][_0x39b4f8[_0x97b3('0x71')]]){if(this[_0x97b3('0xc')][_0x39b4f8[_0x97b3('0x71')]][_0x97b3('0x37')](_0xe51f85)){if(_0x39b4f8[_0x97b3('0x72')]===_0xe51f85){var _0x5a6ef2=moment();this[_0x97b3('0xc')][_0x39b4f8[_0x97b3('0x71')]][_0xe51f85][_0x97b3('0x52')]=!![];this['channels'][_0x39b4f8[_0x97b3('0x71')]][_0xe51f85][_0x97b3('0x53')]=moment()[_0x97b3('0x28')](_0x97b3('0x29'));this[_0x97b3('0xc')][_0x39b4f8[_0x97b3('0x71')]][_0xe51f85]['reason']=_0x97b3('0x56');this[_0x97b3('0xc')][_0x39b4f8['transfereeuniqueid']][_0xe51f85][_0x97b3('0x39')]='complete';this[_0x97b3('0xc')][_0x39b4f8['transfereeuniqueid']][_0xe51f85][_0x97b3('0x55')]=_0x5a6ef2[_0x97b3('0x73')](this[_0x97b3('0xc')][_0x39b4f8[_0x97b3('0x71')]][_0xe51f85][_0x97b3('0x38')],_0x97b3('0x74'));}}}}if(this[_0x97b3('0xc')][_0x39b4f8[_0x97b3('0x75')]]){var _0x83bb4b=this[_0x97b3('0xc')][_0x39b4f8['secondtransfereruniqueid']];this[_0x97b3('0xc')][_0x39b4f8[_0x97b3('0x75')]]=this['channels'][_0x39b4f8['transfereeuniqueid']];this[_0x97b3('0xc')][_0x39b4f8['transfereeuniqueid']]=_0x83bb4b;}}}catch(_0x38204c){logger[_0x97b3('0x4a')](_0x97b3('0x76'),util[_0x97b3('0x36')](_0x38204c,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x97b3('0x22')]['syncBlindTransfer']=function(_0x4a5df8){try{if(this[_0x97b3('0x24')](_0x4a5df8)){if(this[_0x97b3('0xc')][_0x4a5df8[_0x97b3('0x71')]]){for(var _0x20d176 in this[_0x97b3('0xc')][_0x4a5df8[_0x97b3('0x71')]]){if(this['channels'][_0x4a5df8[_0x97b3('0x71')]][_0x97b3('0x37')](_0x20d176)){if(_0x4a5df8[_0x97b3('0x77')]===_0x20d176){var _0x43f81b=moment();this[_0x97b3('0xc')][_0x4a5df8[_0x97b3('0x71')]][_0x20d176]['agentcomplete']=!![];this['channels'][_0x4a5df8[_0x97b3('0x71')]][_0x20d176]['agentcompleteAt']=_0x43f81b;this[_0x97b3('0xc')][_0x4a5df8['transfereeuniqueid']][_0x20d176][_0x97b3('0x47')]=_0x97b3('0x56');this['channels'][_0x4a5df8['transfereeuniqueid']][_0x20d176][_0x97b3('0x39')]=_0x97b3('0x54');this[_0x97b3('0xc')][_0x4a5df8[_0x97b3('0x71')]][_0x20d176][_0x97b3('0x55')]=_0x43f81b[_0x97b3('0x73')](this['channels'][_0x4a5df8[_0x97b3('0x71')]][_0x20d176][_0x97b3('0x38')],_0x97b3('0x74'));}}}}}}catch(_0x58a5a2){logger[_0x97b3('0x4a')](_0x97b3('0x78'),util[_0x97b3('0x36')](_0x58a5a2,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x97b3('0x22')]['syncMusicOnHoldStart']=function(_0x27e7f3){var _0x406705='';try{if(this[_0x97b3('0x24')](_0x27e7f3)){if(_0x27e7f3[_0x97b3('0x79')]){_0x406705=_0x27e7f3[_0x97b3('0x79')][_0x97b3('0x7a')](0x0,_0x27e7f3[_0x97b3('0x79')][_0x97b3('0x7b')]('-'));if(this[_0x97b3('0xe')][_0x406705]){this['agents'][_0x406705][_0x97b3('0x7c')]=!![];}}}}catch(_0x177cf0){logger[_0x97b3('0x4a')](_0x97b3('0x7d'),util[_0x97b3('0x36')](_0x177cf0,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x97b3('0x1e')]=function(_0x1fdf09){var _0x3516d1='';try{if(this[_0x97b3('0x24')](_0x1fdf09)){if(_0x1fdf09[_0x97b3('0x79')]){_0x3516d1=_0x1fdf09[_0x97b3('0x79')][_0x97b3('0x7a')](0x0,_0x1fdf09[_0x97b3('0x79')][_0x97b3('0x7b')]('-'));if(this[_0x97b3('0xe')][_0x3516d1]){this[_0x97b3('0xe')][_0x3516d1]['onhold']=![];}}}}catch(_0x167f35){logger[_0x97b3('0x4a')](_0x97b3('0x7e'),util['inspect'](_0x167f35,{'showHidden':![],'depth':null}));}};module[_0x97b3('0x7f')]=VoiceAgentReport; \ No newline at end of file +var _0x0810=['type','inbound','merge','omit','event','privilege','custom:agentcalled','user:%s','user:called','error','[syncAgentCalled][VoiceAgentReport]','inspect','hasOwnProperty','agentconnectAt','lastevent','holdtime','connectedlinenum','connectedlinename','destchannelstate','destchannelstatedesc','interface','destconnectedlinenum','membername','user:agentconnect','custom:agentconnect','reason','answered_elsewhere','answeredelsewheredestinationuniqueid','answeredelsewheremembername','custom:agentansweredelsewhere','[syncAgentConnect][VoiceAgentReport]','agentringnoanswerAt','custom:agentringnoanswer','[syncAgentRingNoAnswer][VoiceAgentReport]','abandoned','custom:agentqueuecallerabandon','[syncQueueCallerAbandon][VoiceAgentReport]','agentcompleteAt','complete','talktime','transfer','agent','acw','agentacw','acwtime','acwTimeout','user:agentcomplete','custom:agentcomplete','keys','variable','addVariable','rtpaudioqosbridged','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepeer','bridgepvtcallid','membercalls','memberdynamic','memberinterface','memberpenalty','memberrealtime','includes','custom:voiceAgentReport','syncAttendedTransfer','transfereeuniqueid','origtransfereruniqueid','secondtransfereruniqueid','transfereruniqueid','diff','seconds','[syncBlindTransfer][VoiceAgentReport]','channel','substring','lastIndexOf','onhold','[syncMusicOnHoldStop][VoiceAgentReport]','exports','lodash','util','../../../config/logger','ami','../ami','redis','defaults','socket.io-emitter','channels','voiceQueues','agents','variables','agentcalled','syncAgentCalled','bind','agentconnect','syncAgentConnect','agentringnoanswer','syncAgentRingNoAnswer','syncQueueCallerAbandon','agentcomplete','syncAgentComplete','syncVarSet','musiconholdstart','musiconholdstop','syncMusicOnHoldStop','syncBlindTransfer','emit','prototype','isNotNull','isUndefined','uniqueid','destuniqueid','format','YYYY-MM-DD\x20HH:mm:ss','called','queue'];(function(_0x53e7cb,_0x2d5c30){var _0x1327b1=function(_0x288401){while(--_0x288401){_0x53e7cb['push'](_0x53e7cb['shift']());}};_0x1327b1(++_0x2d5c30);}(_0x0810,0xc9));var _0x0081=function(_0x2ed3a6,_0x1a1bdb){_0x2ed3a6=_0x2ed3a6-0x0;var _0x3fa06f=_0x0810[_0x2ed3a6];return _0x3fa06f;};'use strict';var _=require(_0x0081('0x0'));var moment=require('moment');var util=require(_0x0081('0x1'));var Redis=require('ioredis');var config=require('../../../config/environment');var logger=require(_0x0081('0x2'))(_0x0081('0x3'));var ami=require(_0x0081('0x4'));config[_0x0081('0x5')]=_[_0x0081('0x6')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x0081('0x7'))(new Redis(config[_0x0081('0x5')]));function VoiceAgentReport(_0x56b24a){this[_0x0081('0x8')]={};this['voiceQueues']=_0x56b24a[_0x0081('0x9')];this['agents']=_0x56b24a[_0x0081('0xa')];this[_0x0081('0xb')]={};ami['on'](_0x0081('0xc'),this[_0x0081('0xd')][_0x0081('0xe')](this));ami['on'](_0x0081('0xf'),this[_0x0081('0x10')][_0x0081('0xe')](this));ami['on'](_0x0081('0x11'),this[_0x0081('0x12')][_0x0081('0xe')](this));ami['on']('queuecallerabandon',this[_0x0081('0x13')][_0x0081('0xe')](this));ami['on'](_0x0081('0x14'),this[_0x0081('0x15')][_0x0081('0xe')](this));ami['on']('varset',this[_0x0081('0x16')]['bind'](this));ami['on']('hangup',this['syncHangup'][_0x0081('0xe')](this));ami['on'](_0x0081('0x17'),this['syncMusicOnHoldStart'][_0x0081('0xe')](this));ami['on'](_0x0081('0x18'),this[_0x0081('0x19')]['bind'](this));ami['on']('attendedtransfer',this['syncAttendedTransfer'][_0x0081('0xe')](this));ami['on']('blindtransfer',this[_0x0081('0x1a')][_0x0081('0xe')](this));}VoiceAgentReport['prototype'][_0x0081('0x1b')]=function(_0xcc69d7,_0x448eda,_0x4262a3){io['to'](_0xcc69d7)[_0x0081('0x1b')](_0x448eda,_0x4262a3);};VoiceAgentReport[_0x0081('0x1c')][_0x0081('0x1d')]=function(_0x59d936){return _0x59d936!==null&&!_[_0x0081('0x1e')](_0x59d936);};VoiceAgentReport[_0x0081('0x1c')][_0x0081('0xd')]=function(_0x3730e9){try{if(this[_0x0081('0x1d')](_0x3730e9)){if(_[_0x0081('0x1e')](this['channels'][_0x3730e9[_0x0081('0x1f')]])){this['channels'][_0x3730e9[_0x0081('0x1f')]]={};}if(_[_0x0081('0x1e')](this[_0x0081('0x8')][_0x3730e9[_0x0081('0x1f')]][_0x3730e9[_0x0081('0x20')]])){this[_0x0081('0x8')][_0x3730e9['uniqueid']][_0x3730e9[_0x0081('0x20')]]={'agentcalledAt':moment()[_0x0081('0x21')](_0x0081('0x22')),'lastevent':_0x0081('0x23'),'variables':this[_0x0081('0xb')][_0x3730e9[_0x0081('0x1f')]],'type':this['voiceQueues'][_0x3730e9[_0x0081('0x24')]]?this[_0x0081('0x9')][_0x3730e9['queue']][_0x0081('0x25')]||_0x0081('0x26'):_0x0081('0x26')};}_[_0x0081('0x27')](this[_0x0081('0x8')][_0x3730e9[_0x0081('0x1f')]][_0x3730e9[_0x0081('0x20')]],_[_0x0081('0x28')](_0x3730e9,[_0x0081('0x29'),_0x0081('0x2a')]));ami[_0x0081('0x1b')](_0x0081('0x2b'),this[_0x0081('0x8')][_0x3730e9['uniqueid']][_0x3730e9['destuniqueid']]);this[_0x0081('0x1b')](util[_0x0081('0x21')](_0x0081('0x2c'),_0x3730e9['membername']),_0x0081('0x2d'),this[_0x0081('0x8')][_0x3730e9[_0x0081('0x1f')]][_0x3730e9[_0x0081('0x20')]]);}}catch(_0xcd3219){logger[_0x0081('0x2e')](_0x0081('0x2f'),util[_0x0081('0x30')](_0xcd3219,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0081('0x1c')]['syncAgentConnect']=function(_0x5718ac){try{if(this[_0x0081('0x1d')](_0x5718ac)){if(this['channels'][_0x5718ac[_0x0081('0x1f')]]){for(var _0x15990e in this[_0x0081('0x8')][_0x5718ac[_0x0081('0x1f')]]){if(this['channels'][_0x5718ac[_0x0081('0x1f')]][_0x0081('0x31')](_0x15990e)){if(_0x5718ac[_0x0081('0x20')]===_0x15990e){this[_0x0081('0x8')][_0x5718ac[_0x0081('0x1f')]][_0x15990e][_0x0081('0x32')]=moment()[_0x0081('0x21')](_0x0081('0x22'));this[_0x0081('0x8')][_0x5718ac[_0x0081('0x1f')]][_0x15990e][_0x0081('0x33')]='connect';this['channels'][_0x5718ac[_0x0081('0x1f')]][_0x15990e]['holdtime']=_0x5718ac[_0x0081('0x34')];this[_0x0081('0x8')][_0x5718ac['uniqueid']][_0x15990e][_0x0081('0x35')]=_0x5718ac[_0x0081('0x35')];this[_0x0081('0x8')][_0x5718ac['uniqueid']][_0x15990e][_0x0081('0x36')]=_0x5718ac[_0x0081('0x36')];this[_0x0081('0x8')][_0x5718ac['uniqueid']][_0x15990e][_0x0081('0x37')]=_0x5718ac[_0x0081('0x37')];this[_0x0081('0x8')][_0x5718ac['uniqueid']][_0x15990e]['destchannelstatedesc']=_0x5718ac[_0x0081('0x38')];_[_0x0081('0x27')](this[_0x0081('0xa')][_0x5718ac[_0x0081('0x39')]],_['pick'](_0x5718ac,[_0x0081('0x24'),_0x0081('0x3a')]));this[_0x0081('0x1b')](util['format'](_0x0081('0x2c'),_0x5718ac[_0x0081('0x3b')]),_0x0081('0x3c'),this['channels'][_0x5718ac[_0x0081('0x1f')]][_0x5718ac[_0x0081('0x20')]]);ami[_0x0081('0x1b')](_0x0081('0x3d'),this[_0x0081('0x8')][_0x5718ac[_0x0081('0x1f')]][_0x15990e]);}else if(!this['channels'][_0x5718ac['uniqueid']][_0x15990e][_0x0081('0x11')]&&!this['channels'][_0x5718ac[_0x0081('0x1f')]][_0x15990e][_0x0081('0x14')]){this['channels'][_0x5718ac[_0x0081('0x1f')]][_0x15990e][_0x0081('0x11')]=!![];this[_0x0081('0x8')][_0x5718ac[_0x0081('0x1f')]][_0x15990e]['agentringnoanswerAt']=moment()[_0x0081('0x21')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x0081('0x8')][_0x5718ac[_0x0081('0x1f')]][_0x15990e][_0x0081('0x3e')]=_0x0081('0x3f');this[_0x0081('0x8')][_0x5718ac['uniqueid']][_0x15990e][_0x0081('0x33')]=_0x0081('0x3f');this[_0x0081('0x8')][_0x5718ac[_0x0081('0x1f')]][_0x15990e][_0x0081('0x40')]=_0x5718ac[_0x0081('0x20')];this[_0x0081('0x8')][_0x5718ac[_0x0081('0x1f')]][_0x15990e][_0x0081('0x41')]=_0x5718ac[_0x0081('0x3b')];ami[_0x0081('0x1b')](_0x0081('0x42'),this['channels'][_0x5718ac[_0x0081('0x1f')]][_0x15990e]);}}}}}}catch(_0x1c81d8){logger['error'](_0x0081('0x43'),util['inspect'](_0x1c81d8,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0081('0x1c')][_0x0081('0x12')]=function(_0x26d76c){try{if(this[_0x0081('0x1d')](_0x26d76c)){if(this[_0x0081('0x8')][_0x26d76c[_0x0081('0x1f')]]&&this['channels'][_0x26d76c['uniqueid']][_0x26d76c[_0x0081('0x20')]]){this[_0x0081('0x8')][_0x26d76c[_0x0081('0x1f')]][_0x26d76c[_0x0081('0x20')]][_0x0081('0x11')]=!![];this[_0x0081('0x8')][_0x26d76c[_0x0081('0x1f')]][_0x26d76c[_0x0081('0x20')]][_0x0081('0x44')]=moment()[_0x0081('0x21')]('YYYY-MM-DD\x20HH:mm:ss');this['channels'][_0x26d76c[_0x0081('0x1f')]][_0x26d76c['destuniqueid']][_0x0081('0x3e')]='rejected';this[_0x0081('0x8')][_0x26d76c['uniqueid']][_0x26d76c['destuniqueid']]['lastevent']='rejected';ami['emit'](_0x0081('0x45'),this[_0x0081('0x8')][_0x26d76c['uniqueid']][_0x26d76c[_0x0081('0x20')]]);}}}catch(_0x40bb6a){logger[_0x0081('0x2e')](_0x0081('0x46'),util[_0x0081('0x30')](_0x40bb6a,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0081('0x1c')]['syncQueueCallerAbandon']=function(_0x44183b){try{if(this[_0x0081('0x1d')](_0x44183b)){if(this[_0x0081('0x8')][_0x44183b[_0x0081('0x1f')]]){for(var _0x12334f in this[_0x0081('0x8')][_0x44183b[_0x0081('0x1f')]]){if(this[_0x0081('0x8')][_0x44183b[_0x0081('0x1f')]][_0x0081('0x31')](_0x12334f)&&!this[_0x0081('0x8')][_0x44183b['uniqueid']][_0x12334f][_0x0081('0x11')]&&!this['channels'][_0x44183b[_0x0081('0x1f')]][_0x12334f][_0x0081('0x14')]){this['channels'][_0x44183b['uniqueid']][_0x12334f][_0x0081('0x11')]=!![];this[_0x0081('0x8')][_0x44183b[_0x0081('0x1f')]][_0x12334f][_0x0081('0x44')]=moment()[_0x0081('0x21')](_0x0081('0x22'));this[_0x0081('0x8')][_0x44183b[_0x0081('0x1f')]][_0x12334f][_0x0081('0x3e')]=_0x0081('0x47');this['channels'][_0x44183b[_0x0081('0x1f')]][_0x12334f][_0x0081('0x33')]=_0x0081('0x47');ami[_0x0081('0x1b')](_0x0081('0x48'),this[_0x0081('0x8')][_0x44183b['uniqueid']][_0x12334f]);}}}}}catch(_0x2f72d4){logger['error'](_0x0081('0x49'),util['inspect'](_0x2f72d4,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0081('0x1c')]['syncAgentComplete']=function(_0x565c68){try{if(this[_0x0081('0x1d')](_0x565c68)){if(this['channels'][_0x565c68[_0x0081('0x1f')]]){for(var _0x3d3b11 in this['channels'][_0x565c68[_0x0081('0x1f')]]){if(this[_0x0081('0x8')][_0x565c68[_0x0081('0x1f')]][_0x0081('0x31')](_0x3d3b11)){if(this[_0x0081('0x8')][_0x565c68['uniqueid']][_0x3d3b11]['agentconnectAt']&&!this['channels'][_0x565c68[_0x0081('0x1f')]][_0x3d3b11][_0x0081('0x14')]){this['channels'][_0x565c68[_0x0081('0x1f')]][_0x3d3b11][_0x0081('0x14')]=!![];this[_0x0081('0x8')][_0x565c68[_0x0081('0x1f')]][_0x3d3b11][_0x0081('0x4a')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this[_0x0081('0x8')][_0x565c68[_0x0081('0x1f')]][_0x3d3b11][_0x0081('0x33')]=_0x0081('0x4b');this[_0x0081('0x8')][_0x565c68[_0x0081('0x1f')]][_0x3d3b11]['talktime']=_0x565c68[_0x0081('0x4c')];this['channels'][_0x565c68[_0x0081('0x1f')]][_0x3d3b11][_0x0081('0x3e')]=_0x565c68['reason']==_0x0081('0x4d')?_0x0081('0x4e'):_0x565c68[_0x0081('0x3e')];if(this['voiceQueues'][_0x565c68[_0x0081('0x24')]]&&this[_0x0081('0x9')][_0x565c68[_0x0081('0x24')]][_0x0081('0x4f')]){this[_0x0081('0x8')][_0x565c68['uniqueid']][_0x3d3b11][_0x0081('0x50')]=!![];this[_0x0081('0x8')][_0x565c68[_0x0081('0x1f')]][_0x3d3b11][_0x0081('0x51')]=this[_0x0081('0x9')][_0x565c68['queue']][_0x0081('0x52')];}this[_0x0081('0xa')][_0x565c68['interface']]=_[_0x0081('0x28')](this[_0x0081('0xa')][_0x565c68['interface']],[_0x0081('0x24'),_0x0081('0x3a')]);this[_0x0081('0x1b')](util[_0x0081('0x21')](_0x0081('0x2c'),_0x565c68[_0x0081('0x3b')]),_0x0081('0x53'),this[_0x0081('0x8')][_0x565c68[_0x0081('0x1f')]][_0x3d3b11]);ami[_0x0081('0x1b')](_0x0081('0x54'),this[_0x0081('0x8')][_0x565c68['uniqueid']][_0x3d3b11]);}}}}}}catch(_0x3fff64){logger['error']('[syncAgentComplete][VoiceAgentReport]',util[_0x0081('0x30')](_0x3fff64,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0081('0x1c')]['syncVarSet']=function(_0x1a89fe){try{if(this[_0x0081('0x1d')](_0x1a89fe)){this['addVariable'](_0x1a89fe[_0x0081('0x1f')],_[_0x0081('0x55')](_0x1a89fe[_0x0081('0x56')])[0x0],_0x1a89fe['value']);if(this['channels'][_0x1a89fe[_0x0081('0x1f')]]){for(var _0x30d62c in this[_0x0081('0x8')][_0x1a89fe[_0x0081('0x1f')]]){if(this[_0x0081('0x8')][_0x1a89fe[_0x0081('0x1f')]][_0x0081('0x31')](_0x30d62c)){if(_[_0x0081('0x1e')](this[_0x0081('0x8')][_0x1a89fe[_0x0081('0x1f')]][_0x30d62c][_0x0081('0xb')])){this[_0x0081('0x8')][_0x1a89fe[_0x0081('0x1f')]][_0x30d62c][_0x0081('0xb')]={};}this['channels'][_0x1a89fe[_0x0081('0x1f')]][_0x30d62c]['variables']=this[_0x0081('0xb')][_0x1a89fe[_0x0081('0x1f')]];}}}}}catch(_0x593ca3){logger[_0x0081('0x2e')]('[syncVarSet][VoiceAgentReport]',util[_0x0081('0x30')](_0x593ca3,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x0081('0x57')]=function(_0x1ec35e,_0x4e675e,_0x17531e){var _0x16ed52=['rtpaudioqos',_0x0081('0x58'),'rtpaudioqosjitter',_0x0081('0x59'),_0x0081('0x5a'),_0x0081('0x5b'),_0x0081('0x5c'),_0x0081('0x5d'),_0x0081('0x5e'),_0x0081('0x5f'),_0x0081('0x60'),_0x0081('0x61'),_0x0081('0x62'),_0x0081('0x63'),_0x0081('0x64'),'memberlastcall',_0x0081('0x3b'),_0x0081('0x65'),_0x0081('0x66')];if(!_['isNil'](_0x4e675e)&&!_[_0x0081('0x67')](_0x16ed52,_0x4e675e)){if(_[_0x0081('0x1e')](this[_0x0081('0xb')][_0x1ec35e])){this[_0x0081('0xb')][_0x1ec35e]={};}this[_0x0081('0xb')][_0x1ec35e][_0x4e675e]=_0x17531e;}};VoiceAgentReport[_0x0081('0x1c')]['syncHangup']=function(_0x5c6dac){try{if(this[_0x0081('0x1d')](_0x5c6dac)){if(this[_0x0081('0x8')][_0x5c6dac[_0x0081('0x1f')]]){for(var _0x37a3af in this['channels'][_0x5c6dac[_0x0081('0x1f')]]){if(this['channels'][_0x5c6dac[_0x0081('0x1f')]][_0x0081('0x31')](_0x37a3af)){if(this[_0x0081('0x8')][_0x5c6dac[_0x0081('0x1f')]][_0x37a3af][_0x0081('0x3e')]==_0x0081('0x4d')&&this[_0x0081('0x8')][_0x5c6dac[_0x0081('0x1f')]][_0x37a3af][_0x0081('0x14')]){this[_0x0081('0x8')][_0x5c6dac['uniqueid']][_0x37a3af][_0x0081('0x4a')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}}}ami[_0x0081('0x1b')](_0x0081('0x68'),_['values'](this[_0x0081('0x8')][_0x5c6dac['uniqueid']]));delete this[_0x0081('0x8')][_0x5c6dac[_0x0081('0x1f')]];}if(this[_0x0081('0xb')][_0x5c6dac[_0x0081('0x1f')]]){delete this[_0x0081('0xb')][_0x5c6dac[_0x0081('0x1f')]];}}}catch(_0x3b2b82){logger[_0x0081('0x2e')]('[syncHangup][VoiceAgentReport]',util['inspect'](_0x3b2b82,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0081('0x1c')][_0x0081('0x69')]=function(_0x337d1e){try{if(this['isNotNull'](_0x337d1e)){if(this[_0x0081('0x8')][_0x337d1e[_0x0081('0x6a')]]){for(var _0x54ce4a in this[_0x0081('0x8')][_0x337d1e[_0x0081('0x6a')]]){if(this['channels'][_0x337d1e[_0x0081('0x6a')]][_0x0081('0x31')](_0x54ce4a)){if(_0x337d1e[_0x0081('0x6b')]===_0x54ce4a){var _0x44b6f3=moment();this[_0x0081('0x8')][_0x337d1e[_0x0081('0x6a')]][_0x54ce4a][_0x0081('0x14')]=!![];this['channels'][_0x337d1e[_0x0081('0x6a')]][_0x54ce4a][_0x0081('0x4a')]=moment()['format'](_0x0081('0x22'));this['channels'][_0x337d1e[_0x0081('0x6a')]][_0x54ce4a]['reason']=_0x0081('0x4d');this[_0x0081('0x8')][_0x337d1e[_0x0081('0x6a')]][_0x54ce4a][_0x0081('0x33')]=_0x0081('0x4b');this['channels'][_0x337d1e[_0x0081('0x6a')]][_0x54ce4a][_0x0081('0x4c')]=_0x44b6f3['diff'](this[_0x0081('0x8')][_0x337d1e[_0x0081('0x6a')]][_0x54ce4a][_0x0081('0x32')],'seconds');}}}}if(this[_0x0081('0x8')][_0x337d1e['secondtransfereruniqueid']]){var _0x34e889=this['channels'][_0x337d1e[_0x0081('0x6c')]];this[_0x0081('0x8')][_0x337d1e[_0x0081('0x6c')]]=this[_0x0081('0x8')][_0x337d1e[_0x0081('0x6a')]];this[_0x0081('0x8')][_0x337d1e['transfereeuniqueid']]=_0x34e889;}}}catch(_0x21959f){logger['error']('[syncAttendedTransfer][VoiceAgentReport]',util[_0x0081('0x30')](_0x21959f,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0081('0x1c')][_0x0081('0x1a')]=function(_0x22ae4c){try{if(this['isNotNull'](_0x22ae4c)){if(this[_0x0081('0x8')][_0x22ae4c[_0x0081('0x6a')]]){for(var _0x484a5d in this['channels'][_0x22ae4c['transfereeuniqueid']]){if(this[_0x0081('0x8')][_0x22ae4c[_0x0081('0x6a')]][_0x0081('0x31')](_0x484a5d)){if(_0x22ae4c[_0x0081('0x6d')]===_0x484a5d){var _0x1066b7=moment();this[_0x0081('0x8')][_0x22ae4c[_0x0081('0x6a')]][_0x484a5d][_0x0081('0x14')]=!![];this[_0x0081('0x8')][_0x22ae4c[_0x0081('0x6a')]][_0x484a5d][_0x0081('0x4a')]=_0x1066b7;this[_0x0081('0x8')][_0x22ae4c[_0x0081('0x6a')]][_0x484a5d][_0x0081('0x3e')]=_0x0081('0x4d');this[_0x0081('0x8')][_0x22ae4c['transfereeuniqueid']][_0x484a5d][_0x0081('0x33')]=_0x0081('0x4b');this[_0x0081('0x8')][_0x22ae4c[_0x0081('0x6a')]][_0x484a5d][_0x0081('0x4c')]=_0x1066b7[_0x0081('0x6e')](this[_0x0081('0x8')][_0x22ae4c[_0x0081('0x6a')]][_0x484a5d][_0x0081('0x32')],_0x0081('0x6f'));}}}}}}catch(_0x234011){logger['error'](_0x0081('0x70'),util[_0x0081('0x30')](_0x234011,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0081('0x1c')]['syncMusicOnHoldStart']=function(_0xbd77fe){var _0x3c689f='';try{if(this[_0x0081('0x1d')](_0xbd77fe)){if(_0xbd77fe[_0x0081('0x71')]){_0x3c689f=_0xbd77fe['channel'][_0x0081('0x72')](0x0,_0xbd77fe[_0x0081('0x71')][_0x0081('0x73')]('-'));if(this[_0x0081('0xa')][_0x3c689f]){this[_0x0081('0xa')][_0x3c689f][_0x0081('0x74')]=!![];}}}}catch(_0xab8fea){logger[_0x0081('0x2e')]('[syncMusicOnHoldStart][VoiceAgentReport]',util[_0x0081('0x30')](_0xab8fea,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0081('0x1c')]['syncMusicOnHoldStop']=function(_0x140ffa){var _0x5c1314='';try{if(this[_0x0081('0x1d')](_0x140ffa)){if(_0x140ffa[_0x0081('0x71')]){_0x5c1314=_0x140ffa[_0x0081('0x71')][_0x0081('0x72')](0x0,_0x140ffa[_0x0081('0x71')]['lastIndexOf']('-'));if(this['agents'][_0x5c1314]){this['agents'][_0x5c1314][_0x0081('0x74')]=![];}}}}catch(_0x2a6f67){logger[_0x0081('0x2e')](_0x0081('0x75'),util[_0x0081('0x30')](_0x2a6f67,{'showHidden':![],'depth':null}));}};module[_0x0081('0x76')]=VoiceAgentReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceCallReport.js b/server/services/ami/report/voiceCallReport.js index c7358b2..9365f4c 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 _0x1a8f=['onhold','queue','dial','voicemail','NO\x20ANSWER','FAILED','ANSWERED','redis','defaults','localhost','socket.io-emitter','channels','agents','coreshowchannel','syncNewExten','bind','newexten','newchannel','syncNewChannel','syncNewState','varset','syncVarSet','syncHangup','newcallerid','syncNewCallerId','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','resolve','then','actionCoreShowChannels','catch','log','isNotNull','isUndefined','prototype','linkedid','uniqueid','merge','pick','keys','error','[syncNewCallerId][VoiceCallReport]','inspect','OutgoingSpoolFailed','starttime','format','disposition','toNumber','context','from-sip','split','destconnectedlinenum','emit','channel','name','accountcode','exten','application','applicationdata','appdata','toLowerCase','duration','subtract','seconds','YYYY-MM-DD\x20HH:mm:ss','includes','lastapplication','lastdata','set','startsWith','cdr(','match','[syncNewExten][VoiceCallReport]','channelstate','answered','answertime','calleridnum','xcally-motion-preview','connectedlinenum','connectedlinename','calleridname','destinationchannel','UserId','syncMixMonitorFilename','monitor','endsWith','.wav49','replace','.WAV','monitorFilename','find','monitors','push','rec','variable','mixmonitor_filename','value','xmd-phone','xmd-callerid','type','xmd-queue','originatecalleridnum','destination','xmd-callerid-preview','calleridpreview','xmcs-queue','sipcallid','sipcalllinkedid','endtime','diff','omit','custom:voiceCallReport','[syncHangup][VoiceCallReport]','transfereeuniqueid','transfercalleridnum','origtransferercalleridnum','transferconnectedlinenum','transfertargetcalleridnum','transfertargetuniqueid','origtransfereruniqueid','[syncAttendedTransfer][VoiceCallReport]','transfererchannel','[syncBlindTransfer][VoiceCallReport]','isNil','mohstarttime','[syncMusicOnHoldStart][VoiceCallReport]','mohtime','[syncMusicOnHoldStop][VoiceCallReport]','exports','bluebird','moment','util','path','ioredis','../../../config/environment','unknown','not_inuse','inuse','invalid','ringing','ringinuse'];(function(_0x612285,_0xab4376){var _0x28a6e6=function(_0x12d04b){while(--_0x12d04b){_0x612285['push'](_0x612285['shift']());}};_0x28a6e6(++_0xab4376);}(_0x1a8f,0x87));var _0xf1a8=function(_0x15876a,_0x15383d){_0x15876a=_0x15876a-0x0;var _0xbd900f=_0x1a8f[_0x15876a];return _0xbd900f;};'use strict';var BPromise=require(_0xf1a8('0x0'));var _=require('lodash');var moment=require(_0xf1a8('0x1'));var util=require(_0xf1a8('0x2'));var path=require(_0xf1a8('0x3'));var Redis=require(_0xf1a8('0x4'));var config=require(_0xf1a8('0x5'));var logger=require('../../../config/logger')('ami');var ami=require('../ami');var Channel=require('../model/channel');var statusDesc=[_0xf1a8('0x6'),_0xf1a8('0x7'),_0xf1a8('0x8'),'busy',_0xf1a8('0x9'),'unavailable',_0xf1a8('0xa'),_0xf1a8('0xb'),_0xf1a8('0xc')];var applications=['set',_0xf1a8('0xd'),'agi',_0xf1a8('0xe'),'playback',_0xf1a8('0xf')];var dispositions=[_0xf1a8('0x10'),_0xf1a8('0x11'),_0xf1a8('0x11'),'NO\x20ANSWER',_0xf1a8('0x10'),'NO\x20ANSWER',_0xf1a8('0x12'),'BUSY',_0xf1a8('0x11'),_0xf1a8('0x11'),_0xf1a8('0x11')];var actions={};config[_0xf1a8('0x13')]=_[_0xf1a8('0x14')](config[_0xf1a8('0x13')],{'host':_0xf1a8('0x15'),'port':0x18eb});var io=require(_0xf1a8('0x16'))(new Redis(config[_0xf1a8('0x13')]));function VoiceCallReport(_0x5854c5){this[_0xf1a8('0x17')]=_0x5854c5[_0xf1a8('0x17')];this[_0xf1a8('0x18')]=_0x5854c5[_0xf1a8('0x18')];ami['on'](_0xf1a8('0x19'),this[_0xf1a8('0x1a')][_0xf1a8('0x1b')](this));ami['on'](_0xf1a8('0x1c'),this[_0xf1a8('0x1a')][_0xf1a8('0x1b')](this));ami['on'](_0xf1a8('0x1d'),this[_0xf1a8('0x1e')][_0xf1a8('0x1b')](this));ami['on']('newstate',this[_0xf1a8('0x1f')][_0xf1a8('0x1b')](this));ami['on'](_0xf1a8('0x20'),this[_0xf1a8('0x21')][_0xf1a8('0x1b')](this));ami['on']('hangup',this[_0xf1a8('0x22')]['bind'](this));ami['on'](_0xf1a8('0x23'),this[_0xf1a8('0x24')][_0xf1a8('0x1b')](this));ami['on'](_0xf1a8('0x25'),this[_0xf1a8('0x26')][_0xf1a8('0x1b')](this));ami['on'](_0xf1a8('0x27'),this[_0xf1a8('0x28')]['bind'](this));ami['on'](_0xf1a8('0x29'),this[_0xf1a8('0x2a')][_0xf1a8('0x1b')](this));ami['on'](_0xf1a8('0x2b'),this[_0xf1a8('0x2c')]['bind'](this));return BPromise[_0xf1a8('0x2d')]()[_0xf1a8('0x2e')](ami[_0xf1a8('0x2f')]())[_0xf1a8('0x30')](function(_0x4b90a5){console[_0xf1a8('0x31')](_0x4b90a5);});}VoiceCallReport['prototype'][_0xf1a8('0x32')]=function(_0xd75dfb){return _0xd75dfb!==null&&!_[_0xf1a8('0x33')](_0xd75dfb);};VoiceCallReport['prototype']['emit']=function(_0x43ba70,_0x36769c,_0x2bdc47){io['to'](_0x43ba70)['emit'](_0x36769c,_0x2bdc47);};VoiceCallReport[_0xf1a8('0x34')]['syncNewCallerId']=function(_0x1424bc){try{if(this[_0xf1a8('0x32')](_0x1424bc)){if(_0x1424bc['uniqueid']===_0x1424bc[_0xf1a8('0x35')]){if(!_['isUndefined'](this['channels'][_0x1424bc[_0xf1a8('0x36')]])){_[_0xf1a8('0x37')](this[_0xf1a8('0x17')][_0x1424bc['uniqueid']],_[_0xf1a8('0x38')](_0x1424bc,_[_0xf1a8('0x39')](this[_0xf1a8('0x17')][_0x1424bc['uniqueid']])));}}}}catch(_0x382571){logger[_0xf1a8('0x3a')](_0xf1a8('0x3b'),util[_0xf1a8('0x3c')](_0x382571,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xf1a8('0x34')][_0xf1a8('0x1e')]=function(_0x35dae3){try{if(this[_0xf1a8('0x32')](_0x35dae3)){if(_0x35dae3[_0xf1a8('0x36')]===_0x35dae3[_0xf1a8('0x35')]&&_0x35dae3['channel']!=_0xf1a8('0x3d')){if(_[_0xf1a8('0x33')](this[_0xf1a8('0x17')][_0x35dae3['uniqueid']])){this['channels'][_0x35dae3[_0xf1a8('0x36')]]=new Channel();this[_0xf1a8('0x17')][_0x35dae3[_0xf1a8('0x36')]][_0xf1a8('0x3e')]=moment()[_0xf1a8('0x3f')]('YYYY-MM-DD\x20HH:mm:ss');this[_0xf1a8('0x17')][_0x35dae3['uniqueid']][_0xf1a8('0x40')]=dispositions[_[_0xf1a8('0x41')](_0x35dae3['channelstate'])];_[_0xf1a8('0x37')](this[_0xf1a8('0x17')][_0x35dae3[_0xf1a8('0x36')]],_[_0xf1a8('0x38')](_0x35dae3,_[_0xf1a8('0x39')](this[_0xf1a8('0x17')][_0x35dae3['uniqueid']])));if(_0x35dae3[_0xf1a8('0x42')]===_0xf1a8('0x43')){if(this[_0xf1a8('0x18')][_0x35dae3['channel'][_0xf1a8('0x44')]('-')[0x0]]){this[_0xf1a8('0x18')][_0x35dae3['channel'][_0xf1a8('0x44')]('-')[0x0]][_0xf1a8('0x45')]=_0x35dae3['exten'];this[_0xf1a8('0x46')](util[_0xf1a8('0x3f')]('user:%s',this[_0xf1a8('0x18')][_0x35dae3[_0xf1a8('0x47')][_0xf1a8('0x44')]('-')[0x0]][_0xf1a8('0x48')]),'user:agentconnect',{'destaccountcode':this[_0xf1a8('0x18')][_0x35dae3[_0xf1a8('0x47')]['split']('-')[0x0]][_0xf1a8('0x49')],'destconnectedlinenum':_0x35dae3['exten']});}}}}}}catch(_0x2d28ef){logger[_0xf1a8('0x3a')]('[syncNewChannel][VoiceCallReport]',util[_0xf1a8('0x3c')](_0x2d28ef,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xf1a8('0x34')][_0xf1a8('0x1a')]=function(_0x396b3f){try{if(this[_0xf1a8('0x32')](_0x396b3f)){if(_0x396b3f[_0xf1a8('0x36')]===_0x396b3f['linkedid']&&_0x396b3f[_0xf1a8('0x4a')]!='h'&&_0x396b3f['channel']!=_0xf1a8('0x3d')){_0x396b3f[_0xf1a8('0x4b')]=_0x396b3f[_0xf1a8('0x4b')]['toLowerCase']();_0x396b3f[_0xf1a8('0x4c')]=(_0x396b3f[_0xf1a8('0x4d')]||_0x396b3f[_0xf1a8('0x4c')])[_0xf1a8('0x4e')]();if(_[_0xf1a8('0x33')](this[_0xf1a8('0x17')][_0x396b3f['uniqueid']])){this[_0xf1a8('0x17')][_0x396b3f['uniqueid']]=new Channel();this[_0xf1a8('0x17')][_0x396b3f[_0xf1a8('0x36')]][_0xf1a8('0x3e')]=_0x396b3f[_0xf1a8('0x4f')]?moment()[_0xf1a8('0x50')](moment[_0xf1a8('0x4f')](_0x396b3f[_0xf1a8('0x4f')])[_0xf1a8('0x51')](),_0xf1a8('0x51'))[_0xf1a8('0x3f')](_0xf1a8('0x52')):moment()[_0xf1a8('0x3f')](_0xf1a8('0x52'));this[_0xf1a8('0x17')][_0x396b3f[_0xf1a8('0x36')]][_0xf1a8('0x40')]=_0xf1a8('0x10');}_[_0xf1a8('0x37')](this[_0xf1a8('0x17')][_0x396b3f['uniqueid']],_[_0xf1a8('0x38')](_0x396b3f,_['keys'](this[_0xf1a8('0x17')][_0x396b3f[_0xf1a8('0x36')]])));if(_[_0xf1a8('0x53')](applications,_0x396b3f[_0xf1a8('0x4b')])){this['channels'][_0x396b3f[_0xf1a8('0x36')]][_0xf1a8('0x54')]=_0x396b3f[_0xf1a8('0x4b')];this['channels'][_0x396b3f[_0xf1a8('0x36')]][_0xf1a8('0x55')]=_0x396b3f[_0xf1a8('0x4c')];if(_0x396b3f[_0xf1a8('0x4b')]===_0xf1a8('0x56')&&_[_0xf1a8('0x57')](_0x396b3f[_0xf1a8('0x4c')],_0xf1a8('0x58'))){var _0x3e6a5d=_0x396b3f[_0xf1a8('0x4c')]['split']('=');var _0x3b4e06=_0x3e6a5d[0x0][_0xf1a8('0x59')](/cdr\((.*)\)/);if(_0x3b4e06){this['channels'][_0x396b3f[_0xf1a8('0x36')]][_0x3b4e06[0x1]]=_0x3e6a5d[0x1];}}else if(_0x396b3f[_0xf1a8('0x4b')]===_0xf1a8('0xd')){this[_0xf1a8('0x17')][_0x396b3f[_0xf1a8('0x36')]][_0xf1a8('0xd')]=_0x396b3f[_0xf1a8('0x4c')][_0xf1a8('0x44')](',')[0x0];}}}}}catch(_0x1245b7){logger['error'](_0xf1a8('0x5a'),util[_0xf1a8('0x3c')](_0x1245b7,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xf1a8('0x34')]['syncNewState']=function(_0x523957){try{if(this['isNotNull'](_0x523957)){if(_0x523957['uniqueid']!==_0x523957[_0xf1a8('0x35')]){if(this[_0xf1a8('0x17')][_0x523957[_0xf1a8('0x35')]]){if(_0x523957[_0xf1a8('0x5b')]==='6'){if(!this[_0xf1a8('0x17')][_0x523957[_0xf1a8('0x35')]][_0xf1a8('0x5c')]){var _0x1d4a3d=moment();this[_0xf1a8('0x17')][_0x523957['linkedid']][_0xf1a8('0x5c')]=!![];this[_0xf1a8('0x17')][_0x523957['linkedid']][_0xf1a8('0x5d')]=_0x1d4a3d['format'](_0xf1a8('0x52'));if(this[_0xf1a8('0x17')][_0x523957['linkedid']][_0xf1a8('0x3e')]){this[_0xf1a8('0x17')][_0x523957[_0xf1a8('0x35')]]['holdtime']=_0x1d4a3d['diff'](this[_0xf1a8('0x17')][_0x523957[_0xf1a8('0x35')]][_0xf1a8('0x3e')],_0xf1a8('0x51'));}}this[_0xf1a8('0x17')][_0x523957['linkedid']][_0xf1a8('0x35')]=_0x523957['uniqueid'];if(_0x523957[_0xf1a8('0x5e')]!==_0xf1a8('0x5f')){this[_0xf1a8('0x17')][_0x523957[_0xf1a8('0x35')]][_0xf1a8('0x60')]=_0x523957[_0xf1a8('0x5e')];}this[_0xf1a8('0x17')][_0x523957[_0xf1a8('0x35')]][_0xf1a8('0x61')]=_0x523957[_0xf1a8('0x62')];this['channels'][_0x523957['linkedid']][_0xf1a8('0x63')]=_0x523957[_0xf1a8('0x47')];this[_0xf1a8('0x17')][_0x523957['linkedid']]['disposition']=dispositions[_[_0xf1a8('0x41')](_0x523957[_0xf1a8('0x5b')])];if(this[_0xf1a8('0x18')][_0x523957['channel']['split']('-')[0x0]]){this['channels'][_0x523957['linkedid']][_0xf1a8('0x64')]=this[_0xf1a8('0x18')][_0x523957[_0xf1a8('0x47')]['split']('-')[0x0]]['id'];this['channels'][_0x523957[_0xf1a8('0x35')]]['membername']=this['agents'][_0x523957[_0xf1a8('0x47')]['split']('-')[0x0]][_0xf1a8('0x48')];}}}}else{if(this[_0xf1a8('0x17')][_0x523957['uniqueid']]){if(_0x523957[_0xf1a8('0x5b')]==='6'){if(this[_0xf1a8('0x18')][_0x523957[_0xf1a8('0x47')]['split']('-')[0x0]]){this['channels'][_0x523957[_0xf1a8('0x36')]]['UserId']=this[_0xf1a8('0x18')][_0x523957[_0xf1a8('0x47')][_0xf1a8('0x44')]('-')[0x0]]['id'];this[_0xf1a8('0x17')][_0x523957[_0xf1a8('0x36')]]['membername']=this[_0xf1a8('0x18')][_0x523957[_0xf1a8('0x47')][_0xf1a8('0x44')]('-')[0x0]][_0xf1a8('0x48')];}}}}}}catch(_0x38f22f){logger[_0xf1a8('0x3a')]('[syncNewState][VoiceCallReport]',util[_0xf1a8('0x3c')](_0x38f22f,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xf1a8('0x34')][_0xf1a8('0x65')]=function(_0x1cb8eb,_0x1c280d){if(this[_0xf1a8('0x17')][_0x1cb8eb]){this[_0xf1a8('0x17')][_0x1cb8eb][_0xf1a8('0x66')]=!![];if(_[_0xf1a8('0x67')](_0x1c280d,_0xf1a8('0x68'))){_0x1c280d=_0x1c280d[_0xf1a8('0x69')]('.wav49',_0xf1a8('0x6a'));}this[_0xf1a8('0x17')][_0x1cb8eb][_0xf1a8('0x6b')]=_0x1c280d;var _0xb74846=_[_0xf1a8('0x6c')](this[_0xf1a8('0x17')][_0x1cb8eb][_0xf1a8('0x6d')],{'filename':_0x1c280d});if(_['isNil'](_0xb74846)){this['channels'][_0x1cb8eb][_0xf1a8('0x6d')][_0xf1a8('0x6e')]({'filename':_0x1c280d,'createdAt':moment()[_0xf1a8('0x3f')](_0xf1a8('0x52')),'mixmonitorid':'','status':_0xf1a8('0x6f')});}}};VoiceCallReport[_0xf1a8('0x34')]['syncVarSet']=function(_0x551a4a){try{if(this[_0xf1a8('0x32')](_0x551a4a)){if(this[_0xf1a8('0x17')][_0x551a4a['uniqueid']]&&_0x551a4a[_0xf1a8('0x47')]!=_0xf1a8('0x3d')){if(this[_0xf1a8('0x32')](_0x551a4a[_0xf1a8('0x70')])){if(this[_0xf1a8('0x32')](_0x551a4a[_0xf1a8('0x70')][_0xf1a8('0x71')])){this[_0xf1a8('0x65')](_0x551a4a[_0xf1a8('0x36')],_0x551a4a[_0xf1a8('0x72')]);}else if(this[_0xf1a8('0x32')](_0x551a4a[_0xf1a8('0x70')][_0xf1a8('0x73')])){this['channels'][_0x551a4a[_0xf1a8('0x36')]]['calleridnum']=_0x551a4a['value'];}else if(this[_0xf1a8('0x32')](_0x551a4a[_0xf1a8('0x70')][_0xf1a8('0x74')])){this['channels'][_0x551a4a[_0xf1a8('0x36')]]['callerid']=_0x551a4a['value'];}else if(this[_0xf1a8('0x32')](_0x551a4a['variable']['xmd-cdrtype'])){this[_0xf1a8('0x17')][_0x551a4a['uniqueid']][_0xf1a8('0x75')]=_0x551a4a[_0xf1a8('0x72')];}else if(this[_0xf1a8('0x32')](_0x551a4a[_0xf1a8('0x70')][_0xf1a8('0x76')])){this[_0xf1a8('0x17')][_0x551a4a[_0xf1a8('0x36')]][_0xf1a8('0xd')]=_0x551a4a[_0xf1a8('0x72')][_0xf1a8('0x44')](',')[0x0];}else if(this[_0xf1a8('0x32')](_0x551a4a[_0xf1a8('0x70')]['xmd-originatecalleridnum'])){this['channels'][_0x551a4a[_0xf1a8('0x36')]][_0xf1a8('0x77')]=_0x551a4a[_0xf1a8('0x72')];}else if(this[_0xf1a8('0x32')](_0x551a4a[_0xf1a8('0x70')]['xmd-destination'])){this[_0xf1a8('0x17')][_0x551a4a[_0xf1a8('0x36')]][_0xf1a8('0x78')]=_0x551a4a[_0xf1a8('0x72')];}else if(this['isNotNull'](_0x551a4a['variable'][_0xf1a8('0x79')])){this[_0xf1a8('0x17')][_0x551a4a[_0xf1a8('0x36')]][_0xf1a8('0x7a')]=_0x551a4a['value'];}else if(this[_0xf1a8('0x32')](_0x551a4a[_0xf1a8('0x70')][_0xf1a8('0x7b')])){this['channels'][_0x551a4a['uniqueid']][_0xf1a8('0xd')]=_0x551a4a[_0xf1a8('0x72')];}else if(this[_0xf1a8('0x32')](_0x551a4a[_0xf1a8('0x70')][_0xf1a8('0x7c')])){this[_0xf1a8('0x17')][_0x551a4a[_0xf1a8('0x36')]]['sipcalluniqueid']=_0x551a4a[_0xf1a8('0x72')];}}}else if(this['isNotNull'](_0x551a4a[_0xf1a8('0x70')][_0xf1a8('0x71')])){if(_0x551a4a['value']){var _0x1566ef=path['parse'](_0x551a4a[_0xf1a8('0x72')])[_0xf1a8('0x48')];this[_0xf1a8('0x65')](_0x1566ef,_0x551a4a[_0xf1a8('0x72')]);}}else if(this[_0xf1a8('0x17')][_0x551a4a[_0xf1a8('0x35')]]){if(this['isNotNull'](_0x551a4a[_0xf1a8('0x70')])){if(this[_0xf1a8('0x32')](_0x551a4a[_0xf1a8('0x70')][_0xf1a8('0x7c')])){this['channels'][_0x551a4a['linkedid']][_0xf1a8('0x7d')]=_0x551a4a[_0xf1a8('0x72')];}}}}}catch(_0x452416){logger[_0xf1a8('0x3a')]('[syncVarSet][VoiceCallReport]',util[_0xf1a8('0x3c')](_0x452416,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xf1a8('0x34')][_0xf1a8('0x22')]=function(_0x4762ef){try{if(this[_0xf1a8('0x32')](_0x4762ef)){if(this[_0xf1a8('0x17')][_0x4762ef[_0xf1a8('0x36')]]){var _0x21312c=moment();this[_0xf1a8('0x17')][_0x4762ef[_0xf1a8('0x36')]][_0xf1a8('0x7e')]=_0x21312c['format']('YYYY-MM-DD\x20HH:mm:ss');this['channels'][_0x4762ef['uniqueid']][_0xf1a8('0x4f')]=_0x21312c[_0xf1a8('0x7f')](this[_0xf1a8('0x17')][_0x4762ef['uniqueid']][_0xf1a8('0x3e')],_0xf1a8('0x51'));if(this[_0xf1a8('0x17')][_0x4762ef[_0xf1a8('0x36')]][_0xf1a8('0x5c')]){this[_0xf1a8('0x17')][_0x4762ef[_0xf1a8('0x36')]]['billableseconds']=_0x21312c[_0xf1a8('0x7f')](this[_0xf1a8('0x17')][_0x4762ef[_0xf1a8('0x36')]][_0xf1a8('0x5d')],_0xf1a8('0x51'));this[_0xf1a8('0x17')][_0x4762ef['uniqueid']]['holdtime']=this[_0xf1a8('0x17')][_0x4762ef['uniqueid']]['duration']-this[_0xf1a8('0x17')][_0x4762ef[_0xf1a8('0x36')]]['billableseconds'];}if(_0x4762ef[_0xf1a8('0x42')]==='from-sip'){if(this[_0xf1a8('0x18')][_0x4762ef['channel'][_0xf1a8('0x44')]('-')[0x0]]){this[_0xf1a8('0x18')][_0x4762ef['channel'][_0xf1a8('0x44')]('-')[0x0]]=_[_0xf1a8('0x80')](this[_0xf1a8('0x18')][_0x4762ef[_0xf1a8('0x47')][_0xf1a8('0x44')]('-')[0x0]],[_0xf1a8('0x45')]);this[_0xf1a8('0x46')](util[_0xf1a8('0x3f')]('user:%s',this[_0xf1a8('0x18')][_0x4762ef[_0xf1a8('0x47')]['split']('-')[0x0]][_0xf1a8('0x48')]),'user:agentcomplete',{'destaccountcode':this['agents'][_0x4762ef[_0xf1a8('0x47')]['split']('-')[0x0]]['accountcode']});}}ami[_0xf1a8('0x46')](_0xf1a8('0x81'),this[_0xf1a8('0x17')][_0x4762ef[_0xf1a8('0x36')]]);delete this[_0xf1a8('0x17')][_0x4762ef[_0xf1a8('0x36')]];}}}catch(_0x28926e){logger[_0xf1a8('0x3a')](_0xf1a8('0x82'),util[_0xf1a8('0x3c')](_0x28926e,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xf1a8('0x34')][_0xf1a8('0x26')]=function(_0x836c5e){try{if(this[_0xf1a8('0x32')](_0x836c5e)){if(this['channels'][_0x836c5e[_0xf1a8('0x83')]]){this[_0xf1a8('0x17')][_0x836c5e['transfereeuniqueid']][_0xf1a8('0x84')]=_0x836c5e[_0xf1a8('0x85')];this['channels'][_0x836c5e['transfereeuniqueid']][_0xf1a8('0x86')]=_0x836c5e[_0xf1a8('0x87')];if(this['channels'][_0x836c5e['secondtransfereruniqueid']]){var _0x388339=this[_0xf1a8('0x17')][_0x836c5e['secondtransfereruniqueid']];this['channels'][_0x836c5e['secondtransfereruniqueid']]=this[_0xf1a8('0x17')][_0x836c5e[_0xf1a8('0x83')]];this[_0xf1a8('0x17')][_0x836c5e['transfereeuniqueid']]=_0x388339;}}else if(this['channels'][_0x836c5e[_0xf1a8('0x88')]]){this[_0xf1a8('0x17')][_0x836c5e[_0xf1a8('0x88')]][_0xf1a8('0x84')]=_0x836c5e[_0xf1a8('0x85')];this[_0xf1a8('0x17')][_0x836c5e[_0xf1a8('0x88')]][_0xf1a8('0x86')]=_0x836c5e[_0xf1a8('0x87')];if(this[_0xf1a8('0x17')][_0x836c5e[_0xf1a8('0x89')]]){var _0x388339=this['channels'][_0x836c5e[_0xf1a8('0x89')]];this[_0xf1a8('0x17')][_0x836c5e[_0xf1a8('0x89')]]=this['channels'][_0x836c5e['transfertargetuniqueid']];this['channels'][_0x836c5e[_0xf1a8('0x88')]]=_0x388339;}}}}catch(_0x27a54f){logger[_0xf1a8('0x3a')](_0xf1a8('0x8a'),util['inspect'](_0x27a54f,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xf1a8('0x34')][_0xf1a8('0x28')]=function(_0x27420a){try{if(this[_0xf1a8('0x32')](_0x27420a)){if(this['channels'][_0x27420a[_0xf1a8('0x83')]]){this['channels'][_0x27420a[_0xf1a8('0x83')]][_0xf1a8('0x84')]=_0x27420a['transfereecalleridnum'];this[_0xf1a8('0x17')][_0x27420a[_0xf1a8('0x83')]]['transferconnectedlinenum']=_0x27420a['extension'];this['syncHangup']({'event':'BlindTransfer','uniqueid':_0x27420a[_0xf1a8('0x83')],'context':_0x27420a[_0xf1a8('0x42')],'channel':_0x27420a[_0xf1a8('0x8b')]});}}}catch(_0x587dd7){logger[_0xf1a8('0x3a')](_0xf1a8('0x8c'),util['inspect'](_0x587dd7,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xf1a8('0x34')][_0xf1a8('0x2a')]=function(_0x2f1bcb){try{if(this[_0xf1a8('0x32')](_0x2f1bcb)){if(this[_0xf1a8('0x17')][_0x2f1bcb[_0xf1a8('0x36')]]){if(!_[_0xf1a8('0x8d')](this[_0xf1a8('0x17')][_0x2f1bcb[_0xf1a8('0x36')]][_0xf1a8('0x5d')])){this[_0xf1a8('0x17')][_0x2f1bcb[_0xf1a8('0x36')]][_0xf1a8('0x8e')]=moment()[_0xf1a8('0x3f')](_0xf1a8('0x52'));}}}}catch(_0x5a86e1){logger[_0xf1a8('0x3a')](_0xf1a8('0x8f'),util[_0xf1a8('0x3c')](_0x5a86e1,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xf1a8('0x34')][_0xf1a8('0x2c')]=function(_0x5b25d9){try{if(this['isNotNull'](_0x5b25d9)){if(this['channels'][_0x5b25d9[_0xf1a8('0x36')]]){if(!_[_0xf1a8('0x8d')](this[_0xf1a8('0x17')][_0x5b25d9[_0xf1a8('0x36')]][_0xf1a8('0x8e')])){this['channels'][_0x5b25d9[_0xf1a8('0x36')]][_0xf1a8('0x90')]+=moment()['milliseconds'](0x0)[_0xf1a8('0x7f')](this[_0xf1a8('0x17')][_0x5b25d9[_0xf1a8('0x36')]][_0xf1a8('0x8e')],_0xf1a8('0x51'));delete this[_0xf1a8('0x17')][_0x5b25d9[_0xf1a8('0x36')]][_0xf1a8('0x8e')];}}}}catch(_0x45c066){logger[_0xf1a8('0x3a')](_0xf1a8('0x91'),util[_0xf1a8('0x3c')](_0x45c066,{'showHidden':![],'depth':null}));}};module[_0xf1a8('0x92')]=VoiceCallReport; \ No newline at end of file +var _0x2b6d=['agi','dial','playback','voicemail','FAILED','NO\x20ANSWER','ANSWERED','BUSY','redis','socket.io-emitter','channels','coreshowchannel','syncNewExten','newexten','bind','newchannel','syncNewChannel','newstate','syncNewState','varset','syncVarSet','hangup','syncHangup','newcallerid','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','resolve','then','prototype','isNotNull','isUndefined','emit','syncNewCallerId','linkedid','merge','keys','uniqueid','error','[syncNewCallerId][VoiceCallReport]','channel','starttime','format','YYYY-MM-DD\x20HH:mm:ss','disposition','pick','context','from-sip','agents','split','destconnectedlinenum','exten','user:%s','name','user:agentconnect','accountcode','[syncNewChannel][VoiceCallReport]','inspect','OutgoingSpoolFailed','application','toLowerCase','appdata','applicationdata','subtract','duration','seconds','lastapplication','startsWith','cdr(','match','[syncNewExten][VoiceCallReport]','channelstate','answered','answertime','holdtime','diff','calleridnum','xcally-motion-preview','connectedlinenum','calleridname','destinationchannel','toNumber','UserId','membername','syncMixMonitorFilename','monitor','endsWith','.wav49','replace','.WAV','monitorFilename','find','monitors','push','rec','variable','mixmonitor_filename','value','xmd-phone','xmd-callerid','callerid','xmd-cdrtype','type','xmd-queue','xmd-originatecalleridnum','originatecalleridnum','xmd-destination','destination','xmd-callerid-preview','xmcs-queue','sipcallid','parse','sipcalllinkedid','endtime','billableseconds','omit','user:agentcomplete','custom:voiceCallReport','[syncHangup][VoiceCallReport]','transfereeuniqueid','transfercalleridnum','origtransferercalleridnum','transferconnectedlinenum','transfertargetcalleridnum','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[syncAttendedTransfer][VoiceCallReport]','transfereecalleridnum','extension','BlindTransfer','transfererchannel','[syncMusicOnHoldStart][VoiceCallReport]','syncMusicOnHoldStop','isNil','mohtime','milliseconds','mohstarttime','[syncMusicOnHoldStop][VoiceCallReport]','exports','bluebird','lodash','moment','path','ioredis','../../../config/environment','ami','../ami','../model/channel','unknown','not_inuse','inuse','busy','invalid','unavailable','ringing','onhold','set','queue'];(function(_0x40ddc0,_0x41c082){var _0x1aebf1=function(_0x3ba1f6){while(--_0x3ba1f6){_0x40ddc0['push'](_0x40ddc0['shift']());}};_0x1aebf1(++_0x41c082);}(_0x2b6d,0x1d6));var _0xd2b6=function(_0x468fe4,_0x113048){_0x468fe4=_0x468fe4-0x0;var _0x4813c9=_0x2b6d[_0x468fe4];return _0x4813c9;};'use strict';var BPromise=require(_0xd2b6('0x0'));var _=require(_0xd2b6('0x1'));var moment=require(_0xd2b6('0x2'));var util=require('util');var path=require(_0xd2b6('0x3'));var Redis=require(_0xd2b6('0x4'));var config=require(_0xd2b6('0x5'));var logger=require('../../../config/logger')(_0xd2b6('0x6'));var ami=require(_0xd2b6('0x7'));var Channel=require(_0xd2b6('0x8'));var statusDesc=[_0xd2b6('0x9'),_0xd2b6('0xa'),_0xd2b6('0xb'),_0xd2b6('0xc'),_0xd2b6('0xd'),_0xd2b6('0xe'),_0xd2b6('0xf'),'ringinuse',_0xd2b6('0x10')];var applications=[_0xd2b6('0x11'),_0xd2b6('0x12'),_0xd2b6('0x13'),_0xd2b6('0x14'),_0xd2b6('0x15'),_0xd2b6('0x16')];var dispositions=['NO\x20ANSWER',_0xd2b6('0x17'),_0xd2b6('0x17'),_0xd2b6('0x18'),_0xd2b6('0x18'),_0xd2b6('0x18'),_0xd2b6('0x19'),_0xd2b6('0x1a'),_0xd2b6('0x17'),_0xd2b6('0x17'),'FAILED'];var actions={};config[_0xd2b6('0x1b')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0xd2b6('0x1c'))(new Redis(config[_0xd2b6('0x1b')]));function VoiceCallReport(_0x326549){this[_0xd2b6('0x1d')]=_0x326549[_0xd2b6('0x1d')];this['agents']=_0x326549['agents'];ami['on'](_0xd2b6('0x1e'),this[_0xd2b6('0x1f')]['bind'](this));ami['on'](_0xd2b6('0x20'),this[_0xd2b6('0x1f')][_0xd2b6('0x21')](this));ami['on'](_0xd2b6('0x22'),this[_0xd2b6('0x23')][_0xd2b6('0x21')](this));ami['on'](_0xd2b6('0x24'),this[_0xd2b6('0x25')]['bind'](this));ami['on'](_0xd2b6('0x26'),this[_0xd2b6('0x27')][_0xd2b6('0x21')](this));ami['on'](_0xd2b6('0x28'),this[_0xd2b6('0x29')][_0xd2b6('0x21')](this));ami['on'](_0xd2b6('0x2a'),this['syncNewCallerId'][_0xd2b6('0x21')](this));ami['on'](_0xd2b6('0x2b'),this[_0xd2b6('0x2c')][_0xd2b6('0x21')](this));ami['on'](_0xd2b6('0x2d'),this[_0xd2b6('0x2e')]['bind'](this));ami['on'](_0xd2b6('0x2f'),this[_0xd2b6('0x30')]['bind'](this));ami['on'](_0xd2b6('0x31'),this['syncMusicOnHoldStop'][_0xd2b6('0x21')](this));return BPromise[_0xd2b6('0x32')]()[_0xd2b6('0x33')](ami['actionCoreShowChannels']())['catch'](function(_0x10df24){console['log'](_0x10df24);});}VoiceCallReport[_0xd2b6('0x34')][_0xd2b6('0x35')]=function(_0x4aaadf){return _0x4aaadf!==null&&!_[_0xd2b6('0x36')](_0x4aaadf);};VoiceCallReport[_0xd2b6('0x34')][_0xd2b6('0x37')]=function(_0x170955,_0x213dde,_0x23a282){io['to'](_0x170955)[_0xd2b6('0x37')](_0x213dde,_0x23a282);};VoiceCallReport[_0xd2b6('0x34')][_0xd2b6('0x38')]=function(_0x2e20a3){try{if(this['isNotNull'](_0x2e20a3)){if(_0x2e20a3['uniqueid']===_0x2e20a3[_0xd2b6('0x39')]){if(!_[_0xd2b6('0x36')](this[_0xd2b6('0x1d')][_0x2e20a3['uniqueid']])){_[_0xd2b6('0x3a')](this[_0xd2b6('0x1d')][_0x2e20a3['uniqueid']],_['pick'](_0x2e20a3,_[_0xd2b6('0x3b')](this['channels'][_0x2e20a3[_0xd2b6('0x3c')]])));}}}}catch(_0x490db4){logger[_0xd2b6('0x3d')](_0xd2b6('0x3e'),util['inspect'](_0x490db4,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xd2b6('0x34')]['syncNewChannel']=function(_0x10c679){try{if(this[_0xd2b6('0x35')](_0x10c679)){if(_0x10c679['uniqueid']===_0x10c679[_0xd2b6('0x39')]&&_0x10c679[_0xd2b6('0x3f')]!='OutgoingSpoolFailed'){if(_[_0xd2b6('0x36')](this[_0xd2b6('0x1d')][_0x10c679['uniqueid']])){this[_0xd2b6('0x1d')][_0x10c679[_0xd2b6('0x3c')]]=new Channel();this[_0xd2b6('0x1d')][_0x10c679[_0xd2b6('0x3c')]][_0xd2b6('0x40')]=moment()[_0xd2b6('0x41')](_0xd2b6('0x42'));this[_0xd2b6('0x1d')][_0x10c679[_0xd2b6('0x3c')]][_0xd2b6('0x43')]=dispositions[_['toNumber'](_0x10c679['channelstate'])];_[_0xd2b6('0x3a')](this[_0xd2b6('0x1d')][_0x10c679['uniqueid']],_[_0xd2b6('0x44')](_0x10c679,_[_0xd2b6('0x3b')](this[_0xd2b6('0x1d')][_0x10c679['uniqueid']])));if(_0x10c679[_0xd2b6('0x45')]===_0xd2b6('0x46')){if(this[_0xd2b6('0x47')][_0x10c679['channel'][_0xd2b6('0x48')]('-')[0x0]]){this['agents'][_0x10c679[_0xd2b6('0x3f')]['split']('-')[0x0]][_0xd2b6('0x49')]=_0x10c679[_0xd2b6('0x4a')];this[_0xd2b6('0x37')](util[_0xd2b6('0x41')](_0xd2b6('0x4b'),this[_0xd2b6('0x47')][_0x10c679[_0xd2b6('0x3f')][_0xd2b6('0x48')]('-')[0x0]][_0xd2b6('0x4c')]),_0xd2b6('0x4d'),{'destaccountcode':this[_0xd2b6('0x47')][_0x10c679['channel']['split']('-')[0x0]][_0xd2b6('0x4e')],'destconnectedlinenum':_0x10c679[_0xd2b6('0x4a')]});}}}}}}catch(_0x450a73){logger['error'](_0xd2b6('0x4f'),util[_0xd2b6('0x50')](_0x450a73,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xd2b6('0x34')][_0xd2b6('0x1f')]=function(_0x43dc58){try{if(this[_0xd2b6('0x35')](_0x43dc58)){if(_0x43dc58[_0xd2b6('0x3c')]===_0x43dc58['linkedid']&&_0x43dc58[_0xd2b6('0x4a')]!='h'&&_0x43dc58['channel']!=_0xd2b6('0x51')){_0x43dc58[_0xd2b6('0x52')]=_0x43dc58[_0xd2b6('0x52')][_0xd2b6('0x53')]();_0x43dc58['applicationdata']=(_0x43dc58[_0xd2b6('0x54')]||_0x43dc58[_0xd2b6('0x55')])[_0xd2b6('0x53')]();if(_[_0xd2b6('0x36')](this['channels'][_0x43dc58[_0xd2b6('0x3c')]])){this['channels'][_0x43dc58['uniqueid']]=new Channel();this[_0xd2b6('0x1d')][_0x43dc58['uniqueid']][_0xd2b6('0x40')]=_0x43dc58['duration']?moment()[_0xd2b6('0x56')](moment[_0xd2b6('0x57')](_0x43dc58['duration'])[_0xd2b6('0x58')](),_0xd2b6('0x58'))[_0xd2b6('0x41')](_0xd2b6('0x42')):moment()['format'](_0xd2b6('0x42'));this['channels'][_0x43dc58[_0xd2b6('0x3c')]]['disposition']='NO\x20ANSWER';}_[_0xd2b6('0x3a')](this[_0xd2b6('0x1d')][_0x43dc58['uniqueid']],_['pick'](_0x43dc58,_['keys'](this[_0xd2b6('0x1d')][_0x43dc58[_0xd2b6('0x3c')]])));if(_['includes'](applications,_0x43dc58['application'])){this[_0xd2b6('0x1d')][_0x43dc58[_0xd2b6('0x3c')]][_0xd2b6('0x59')]=_0x43dc58[_0xd2b6('0x52')];this['channels'][_0x43dc58[_0xd2b6('0x3c')]]['lastdata']=_0x43dc58[_0xd2b6('0x55')];if(_0x43dc58[_0xd2b6('0x52')]==='set'&&_[_0xd2b6('0x5a')](_0x43dc58[_0xd2b6('0x55')],_0xd2b6('0x5b'))){var _0x176518=_0x43dc58[_0xd2b6('0x55')][_0xd2b6('0x48')]('=');var _0x5b7602=_0x176518[0x0][_0xd2b6('0x5c')](/cdr\((.*)\)/);if(_0x5b7602){this[_0xd2b6('0x1d')][_0x43dc58[_0xd2b6('0x3c')]][_0x5b7602[0x1]]=_0x176518[0x1];}}else if(_0x43dc58[_0xd2b6('0x52')]===_0xd2b6('0x12')){this['channels'][_0x43dc58[_0xd2b6('0x3c')]]['queue']=_0x43dc58[_0xd2b6('0x55')][_0xd2b6('0x48')](',')[0x0];}}}}}catch(_0x5e151f){logger[_0xd2b6('0x3d')](_0xd2b6('0x5d'),util[_0xd2b6('0x50')](_0x5e151f,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xd2b6('0x34')][_0xd2b6('0x25')]=function(_0x5d74ac){try{if(this[_0xd2b6('0x35')](_0x5d74ac)){if(_0x5d74ac[_0xd2b6('0x3c')]!==_0x5d74ac[_0xd2b6('0x39')]){if(this[_0xd2b6('0x1d')][_0x5d74ac[_0xd2b6('0x39')]]){if(_0x5d74ac[_0xd2b6('0x5e')]==='6'){if(!this[_0xd2b6('0x1d')][_0x5d74ac['linkedid']][_0xd2b6('0x5f')]){var _0x4cb29b=moment();this[_0xd2b6('0x1d')][_0x5d74ac[_0xd2b6('0x39')]][_0xd2b6('0x5f')]=!![];this[_0xd2b6('0x1d')][_0x5d74ac[_0xd2b6('0x39')]][_0xd2b6('0x60')]=_0x4cb29b[_0xd2b6('0x41')](_0xd2b6('0x42'));if(this['channels'][_0x5d74ac[_0xd2b6('0x39')]][_0xd2b6('0x40')]){this[_0xd2b6('0x1d')][_0x5d74ac[_0xd2b6('0x39')]][_0xd2b6('0x61')]=_0x4cb29b[_0xd2b6('0x62')](this[_0xd2b6('0x1d')][_0x5d74ac[_0xd2b6('0x39')]][_0xd2b6('0x40')],'seconds');}}this[_0xd2b6('0x1d')][_0x5d74ac[_0xd2b6('0x39')]][_0xd2b6('0x39')]=_0x5d74ac[_0xd2b6('0x3c')];if(_0x5d74ac[_0xd2b6('0x63')]!==_0xd2b6('0x64')){this[_0xd2b6('0x1d')][_0x5d74ac[_0xd2b6('0x39')]][_0xd2b6('0x65')]=_0x5d74ac[_0xd2b6('0x63')];}this[_0xd2b6('0x1d')][_0x5d74ac[_0xd2b6('0x39')]]['connectedlinename']=_0x5d74ac[_0xd2b6('0x66')];this['channels'][_0x5d74ac[_0xd2b6('0x39')]][_0xd2b6('0x67')]=_0x5d74ac[_0xd2b6('0x3f')];this[_0xd2b6('0x1d')][_0x5d74ac['linkedid']][_0xd2b6('0x43')]=dispositions[_[_0xd2b6('0x68')](_0x5d74ac[_0xd2b6('0x5e')])];if(this[_0xd2b6('0x47')][_0x5d74ac[_0xd2b6('0x3f')][_0xd2b6('0x48')]('-')[0x0]]){this[_0xd2b6('0x1d')][_0x5d74ac['linkedid']][_0xd2b6('0x69')]=this['agents'][_0x5d74ac['channel']['split']('-')[0x0]]['id'];this[_0xd2b6('0x1d')][_0x5d74ac[_0xd2b6('0x39')]][_0xd2b6('0x6a')]=this[_0xd2b6('0x47')][_0x5d74ac['channel'][_0xd2b6('0x48')]('-')[0x0]][_0xd2b6('0x4c')];}}}}else{if(this[_0xd2b6('0x1d')][_0x5d74ac[_0xd2b6('0x3c')]]){if(_0x5d74ac['channelstate']==='6'){if(this[_0xd2b6('0x47')][_0x5d74ac[_0xd2b6('0x3f')][_0xd2b6('0x48')]('-')[0x0]]){this['channels'][_0x5d74ac[_0xd2b6('0x3c')]][_0xd2b6('0x69')]=this[_0xd2b6('0x47')][_0x5d74ac[_0xd2b6('0x3f')][_0xd2b6('0x48')]('-')[0x0]]['id'];this[_0xd2b6('0x1d')][_0x5d74ac[_0xd2b6('0x3c')]][_0xd2b6('0x6a')]=this[_0xd2b6('0x47')][_0x5d74ac[_0xd2b6('0x3f')]['split']('-')[0x0]][_0xd2b6('0x4c')];}}}}}}catch(_0x2dad6c){logger[_0xd2b6('0x3d')]('[syncNewState][VoiceCallReport]',util[_0xd2b6('0x50')](_0x2dad6c,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xd2b6('0x34')][_0xd2b6('0x6b')]=function(_0x330b9c,_0x6b4b27){if(this[_0xd2b6('0x1d')][_0x330b9c]){this[_0xd2b6('0x1d')][_0x330b9c][_0xd2b6('0x6c')]=!![];if(_[_0xd2b6('0x6d')](_0x6b4b27,_0xd2b6('0x6e'))){_0x6b4b27=_0x6b4b27[_0xd2b6('0x6f')]('.wav49',_0xd2b6('0x70'));}this[_0xd2b6('0x1d')][_0x330b9c][_0xd2b6('0x71')]=_0x6b4b27;var _0xff1fab=_[_0xd2b6('0x72')](this[_0xd2b6('0x1d')][_0x330b9c][_0xd2b6('0x73')],{'filename':_0x6b4b27});if(_['isNil'](_0xff1fab)){this[_0xd2b6('0x1d')][_0x330b9c][_0xd2b6('0x73')][_0xd2b6('0x74')]({'filename':_0x6b4b27,'createdAt':moment()[_0xd2b6('0x41')](_0xd2b6('0x42')),'mixmonitorid':'','status':_0xd2b6('0x75')});}}};VoiceCallReport[_0xd2b6('0x34')]['syncVarSet']=function(_0x3f922b){try{if(this[_0xd2b6('0x35')](_0x3f922b)){if(this[_0xd2b6('0x1d')][_0x3f922b[_0xd2b6('0x3c')]]&&_0x3f922b[_0xd2b6('0x3f')]!=_0xd2b6('0x51')){if(this[_0xd2b6('0x35')](_0x3f922b[_0xd2b6('0x76')])){if(this[_0xd2b6('0x35')](_0x3f922b['variable'][_0xd2b6('0x77')])){this['syncMixMonitorFilename'](_0x3f922b[_0xd2b6('0x3c')],_0x3f922b[_0xd2b6('0x78')]);}else if(this[_0xd2b6('0x35')](_0x3f922b['variable'][_0xd2b6('0x79')])){this['channels'][_0x3f922b[_0xd2b6('0x3c')]][_0xd2b6('0x63')]=_0x3f922b['value'];}else if(this[_0xd2b6('0x35')](_0x3f922b[_0xd2b6('0x76')][_0xd2b6('0x7a')])){this['channels'][_0x3f922b[_0xd2b6('0x3c')]][_0xd2b6('0x7b')]=_0x3f922b[_0xd2b6('0x78')];}else if(this[_0xd2b6('0x35')](_0x3f922b[_0xd2b6('0x76')][_0xd2b6('0x7c')])){this[_0xd2b6('0x1d')][_0x3f922b[_0xd2b6('0x3c')]][_0xd2b6('0x7d')]=_0x3f922b['value'];}else if(this[_0xd2b6('0x35')](_0x3f922b[_0xd2b6('0x76')][_0xd2b6('0x7e')])){this[_0xd2b6('0x1d')][_0x3f922b[_0xd2b6('0x3c')]][_0xd2b6('0x12')]=_0x3f922b[_0xd2b6('0x78')][_0xd2b6('0x48')](',')[0x0];}else if(this['isNotNull'](_0x3f922b['variable'][_0xd2b6('0x7f')])){this['channels'][_0x3f922b[_0xd2b6('0x3c')]][_0xd2b6('0x80')]=_0x3f922b['value'];}else if(this[_0xd2b6('0x35')](_0x3f922b['variable'][_0xd2b6('0x81')])){this[_0xd2b6('0x1d')][_0x3f922b[_0xd2b6('0x3c')]][_0xd2b6('0x82')]=_0x3f922b[_0xd2b6('0x78')];}else if(this['isNotNull'](_0x3f922b[_0xd2b6('0x76')][_0xd2b6('0x83')])){this[_0xd2b6('0x1d')][_0x3f922b[_0xd2b6('0x3c')]]['calleridpreview']=_0x3f922b[_0xd2b6('0x78')];}else if(this[_0xd2b6('0x35')](_0x3f922b[_0xd2b6('0x76')][_0xd2b6('0x84')])){this[_0xd2b6('0x1d')][_0x3f922b[_0xd2b6('0x3c')]][_0xd2b6('0x12')]=_0x3f922b[_0xd2b6('0x78')];}else if(this[_0xd2b6('0x35')](_0x3f922b[_0xd2b6('0x76')][_0xd2b6('0x85')])){this[_0xd2b6('0x1d')][_0x3f922b['uniqueid']]['sipcalluniqueid']=_0x3f922b[_0xd2b6('0x78')];}}}else if(this[_0xd2b6('0x35')](_0x3f922b[_0xd2b6('0x76')][_0xd2b6('0x77')])){if(_0x3f922b[_0xd2b6('0x78')]){var _0xc33afe=path[_0xd2b6('0x86')](_0x3f922b[_0xd2b6('0x78')])[_0xd2b6('0x4c')];this[_0xd2b6('0x6b')](_0xc33afe,_0x3f922b[_0xd2b6('0x78')]);}}else if(this['channels'][_0x3f922b[_0xd2b6('0x39')]]){if(this[_0xd2b6('0x35')](_0x3f922b[_0xd2b6('0x76')])){if(this[_0xd2b6('0x35')](_0x3f922b['variable'][_0xd2b6('0x85')])){this[_0xd2b6('0x1d')][_0x3f922b[_0xd2b6('0x39')]][_0xd2b6('0x87')]=_0x3f922b['value'];}}}}}catch(_0x57191d){logger[_0xd2b6('0x3d')]('[syncVarSet][VoiceCallReport]',util[_0xd2b6('0x50')](_0x57191d,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0xd2b6('0x29')]=function(_0x3f00a4){try{if(this[_0xd2b6('0x35')](_0x3f00a4)){if(this[_0xd2b6('0x1d')][_0x3f00a4[_0xd2b6('0x3c')]]){var _0x5ac2de=moment();this[_0xd2b6('0x1d')][_0x3f00a4['uniqueid']][_0xd2b6('0x88')]=_0x5ac2de['format'](_0xd2b6('0x42'));this[_0xd2b6('0x1d')][_0x3f00a4[_0xd2b6('0x3c')]]['duration']=_0x5ac2de[_0xd2b6('0x62')](this[_0xd2b6('0x1d')][_0x3f00a4[_0xd2b6('0x3c')]][_0xd2b6('0x40')],_0xd2b6('0x58'));if(this['channels'][_0x3f00a4[_0xd2b6('0x3c')]]['answered']){this[_0xd2b6('0x1d')][_0x3f00a4[_0xd2b6('0x3c')]][_0xd2b6('0x89')]=_0x5ac2de[_0xd2b6('0x62')](this[_0xd2b6('0x1d')][_0x3f00a4[_0xd2b6('0x3c')]]['answertime'],_0xd2b6('0x58'));this[_0xd2b6('0x1d')][_0x3f00a4[_0xd2b6('0x3c')]][_0xd2b6('0x61')]=this[_0xd2b6('0x1d')][_0x3f00a4[_0xd2b6('0x3c')]][_0xd2b6('0x57')]-this[_0xd2b6('0x1d')][_0x3f00a4[_0xd2b6('0x3c')]]['billableseconds'];}if(_0x3f00a4[_0xd2b6('0x45')]===_0xd2b6('0x46')){if(this[_0xd2b6('0x47')][_0x3f00a4[_0xd2b6('0x3f')][_0xd2b6('0x48')]('-')[0x0]]){this[_0xd2b6('0x47')][_0x3f00a4[_0xd2b6('0x3f')][_0xd2b6('0x48')]('-')[0x0]]=_[_0xd2b6('0x8a')](this[_0xd2b6('0x47')][_0x3f00a4[_0xd2b6('0x3f')][_0xd2b6('0x48')]('-')[0x0]],[_0xd2b6('0x49')]);this['emit'](util[_0xd2b6('0x41')](_0xd2b6('0x4b'),this[_0xd2b6('0x47')][_0x3f00a4[_0xd2b6('0x3f')]['split']('-')[0x0]][_0xd2b6('0x4c')]),_0xd2b6('0x8b'),{'destaccountcode':this[_0xd2b6('0x47')][_0x3f00a4['channel'][_0xd2b6('0x48')]('-')[0x0]][_0xd2b6('0x4e')]});}}ami[_0xd2b6('0x37')](_0xd2b6('0x8c'),this[_0xd2b6('0x1d')][_0x3f00a4[_0xd2b6('0x3c')]]);delete this[_0xd2b6('0x1d')][_0x3f00a4['uniqueid']];}}}catch(_0x20cec8){logger[_0xd2b6('0x3d')](_0xd2b6('0x8d'),util[_0xd2b6('0x50')](_0x20cec8,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xd2b6('0x34')][_0xd2b6('0x2c')]=function(_0x32f5e4){try{if(this[_0xd2b6('0x35')](_0x32f5e4)){if(this['channels'][_0x32f5e4[_0xd2b6('0x8e')]]){this[_0xd2b6('0x1d')][_0x32f5e4[_0xd2b6('0x8e')]][_0xd2b6('0x8f')]=_0x32f5e4[_0xd2b6('0x90')];this[_0xd2b6('0x1d')][_0x32f5e4['transfereeuniqueid']][_0xd2b6('0x91')]=_0x32f5e4[_0xd2b6('0x92')];if(this[_0xd2b6('0x1d')][_0x32f5e4[_0xd2b6('0x93')]]){var _0x247a49=this[_0xd2b6('0x1d')][_0x32f5e4[_0xd2b6('0x93')]];this[_0xd2b6('0x1d')][_0x32f5e4[_0xd2b6('0x93')]]=this[_0xd2b6('0x1d')][_0x32f5e4[_0xd2b6('0x8e')]];this[_0xd2b6('0x1d')][_0x32f5e4[_0xd2b6('0x8e')]]=_0x247a49;}}else if(this[_0xd2b6('0x1d')][_0x32f5e4[_0xd2b6('0x94')]]){this[_0xd2b6('0x1d')][_0x32f5e4[_0xd2b6('0x94')]][_0xd2b6('0x8f')]=_0x32f5e4[_0xd2b6('0x90')];this[_0xd2b6('0x1d')][_0x32f5e4[_0xd2b6('0x94')]]['transferconnectedlinenum']=_0x32f5e4[_0xd2b6('0x92')];if(this[_0xd2b6('0x1d')][_0x32f5e4[_0xd2b6('0x95')]]){var _0x247a49=this[_0xd2b6('0x1d')][_0x32f5e4[_0xd2b6('0x95')]];this[_0xd2b6('0x1d')][_0x32f5e4[_0xd2b6('0x95')]]=this[_0xd2b6('0x1d')][_0x32f5e4[_0xd2b6('0x94')]];this[_0xd2b6('0x1d')][_0x32f5e4[_0xd2b6('0x94')]]=_0x247a49;}}}}catch(_0x4a962c){logger['error'](_0xd2b6('0x96'),util[_0xd2b6('0x50')](_0x4a962c,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xd2b6('0x34')]['syncBlindTransfer']=function(_0x35e9bb){try{if(this[_0xd2b6('0x35')](_0x35e9bb)){if(this[_0xd2b6('0x1d')][_0x35e9bb[_0xd2b6('0x8e')]]){this[_0xd2b6('0x1d')][_0x35e9bb[_0xd2b6('0x8e')]][_0xd2b6('0x8f')]=_0x35e9bb[_0xd2b6('0x97')];this[_0xd2b6('0x1d')][_0x35e9bb[_0xd2b6('0x8e')]][_0xd2b6('0x91')]=_0x35e9bb[_0xd2b6('0x98')];this[_0xd2b6('0x29')]({'event':_0xd2b6('0x99'),'uniqueid':_0x35e9bb[_0xd2b6('0x8e')],'context':_0x35e9bb[_0xd2b6('0x45')],'channel':_0x35e9bb[_0xd2b6('0x9a')]});}}}catch(_0x5bc119){logger[_0xd2b6('0x3d')]('[syncBlindTransfer][VoiceCallReport]',util[_0xd2b6('0x50')](_0x5bc119,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xd2b6('0x34')][_0xd2b6('0x30')]=function(_0x4a751e){try{if(this['isNotNull'](_0x4a751e)){if(this[_0xd2b6('0x1d')][_0x4a751e[_0xd2b6('0x3c')]]){if(!_['isNil'](this[_0xd2b6('0x1d')][_0x4a751e[_0xd2b6('0x3c')]][_0xd2b6('0x60')])){this[_0xd2b6('0x1d')][_0x4a751e[_0xd2b6('0x3c')]]['mohstarttime']=moment()[_0xd2b6('0x41')](_0xd2b6('0x42'));}}}}catch(_0x4b044f){logger[_0xd2b6('0x3d')](_0xd2b6('0x9b'),util[_0xd2b6('0x50')](_0x4b044f,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xd2b6('0x34')][_0xd2b6('0x9c')]=function(_0x523be5){try{if(this[_0xd2b6('0x35')](_0x523be5)){if(this['channels'][_0x523be5['uniqueid']]){if(!_[_0xd2b6('0x9d')](this['channels'][_0x523be5['uniqueid']]['mohstarttime'])){this[_0xd2b6('0x1d')][_0x523be5[_0xd2b6('0x3c')]][_0xd2b6('0x9e')]+=moment()[_0xd2b6('0x9f')](0x0)['diff'](this[_0xd2b6('0x1d')][_0x523be5[_0xd2b6('0x3c')]][_0xd2b6('0xa0')],_0xd2b6('0x58'));delete this[_0xd2b6('0x1d')][_0x523be5[_0xd2b6('0x3c')]]['mohstarttime'];}}}}catch(_0x25ba6a){logger['error'](_0xd2b6('0xa1'),util['inspect'](_0x25ba6a,{'showHidden':![],'depth':null}));}};module[_0xd2b6('0xa2')]=VoiceCallReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceDialReport.js b/server/services/ami/report/voiceDialReport.js index 33b83e6..675457b 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 _0x9c00=['outboundChannels','outbound','dialbegin','syncDialBegin','bind','dialend','syncDialEnd','varset','syncVarSet','hangup','syncHangup','prototype','isNotNull','isUndefined','emit','uniqueid','format','YYYY-MM-DD\x20HH:mm:ss','channel','lastIndexOf','substring','omit','event','privilege','voice:outbound','voice_outbound_channel:save','custom:dialbegin','error','[syncDialBegin][VoiceDialReport]','inspect','dialstatus','ANSWER','connectedlinenum','connectedlinename','answertime','lastevent','custom:dialconnect','[syncDialEnd][VoiceDialReport]','addVariable','keys','variable','value','outboundrouteid','variables','[syncVarSet][VoiceDialReport]','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrttbridged','sipuri','bridgepvtcallid','membercalls','memberinterface','memberlastcall','memberpenalty','memberrealtime','isNil','includes','endtime','diff','starttime','seconds','total','holdtime','billableseconds','sumHoldTime','sumBillable','sumDuration','custom:voiceDialReport','custom:dialend','voice_outbound:save','voice_outbound_channel:remove','[syncHangup][VoiceDialReport]','exports','lodash','moment','../../../config/environment','../../../config/logger','../ami','redis','defaults','localhost','channels'];(function(_0x424c5f,_0x2a2721){var _0x2d2865=function(_0x287b60){while(--_0x287b60){_0x424c5f['push'](_0x424c5f['shift']());}};_0x2d2865(++_0x2a2721);}(_0x9c00,0x1a0));var _0x09c0=function(_0x25fd71,_0x493b52){_0x25fd71=_0x25fd71-0x0;var _0x15917d=_0x9c00[_0x25fd71];return _0x15917d;};'use strict';var _=require(_0x09c0('0x0'));var moment=require(_0x09c0('0x1'));var util=require('util');var Redis=require('ioredis');var config=require(_0x09c0('0x2'));var logger=require(_0x09c0('0x3'))('ami');var ami=require(_0x09c0('0x4'));config[_0x09c0('0x5')]=_[_0x09c0('0x6')](config[_0x09c0('0x5')],{'host':_0x09c0('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function VoiceDialReport(_0x1f3d7e){this[_0x09c0('0x8')]=_0x1f3d7e[_0x09c0('0x9')];this[_0x09c0('0xa')]=_0x1f3d7e[_0x09c0('0xa')];this['variables']={};ami['on'](_0x09c0('0xb'),this[_0x09c0('0xc')][_0x09c0('0xd')](this));ami['on'](_0x09c0('0xe'),this[_0x09c0('0xf')][_0x09c0('0xd')](this));ami['on'](_0x09c0('0x10'),this[_0x09c0('0x11')][_0x09c0('0xd')](this));ami['on'](_0x09c0('0x12'),this[_0x09c0('0x13')][_0x09c0('0xd')](this));}VoiceDialReport[_0x09c0('0x14')][_0x09c0('0x15')]=function(_0x3b95cc){return _0x3b95cc!==null&&!_[_0x09c0('0x16')](_0x3b95cc);};VoiceDialReport[_0x09c0('0x14')][_0x09c0('0x17')]=function(_0x342ceb,_0x3649d2,_0x16e490){io['to'](_0x342ceb)[_0x09c0('0x17')](_0x3649d2,_0x16e490);};VoiceDialReport[_0x09c0('0x14')][_0x09c0('0xc')]=function(_0x33c3d6){try{if(this[_0x09c0('0x15')](_0x33c3d6)){if(this['channels'][_0x33c3d6['uniqueid']]){_['merge'](this[_0x09c0('0x8')][_0x33c3d6[_0x09c0('0x18')]],{'starttime':moment()[_0x09c0('0x19')](_0x09c0('0x1a')),'lastevent':'called','interface':_0x33c3d6[_0x09c0('0x1b')]['substring'](0x0,_0x33c3d6['channel'][_0x09c0('0x1c')]('-')),'membername':_0x33c3d6['channel'][_0x09c0('0x1d')](_0x33c3d6[_0x09c0('0x1b')][_0x09c0('0x1c')]('/')+0x1,_0x33c3d6['channel'][_0x09c0('0x1c')]('-'))},_[_0x09c0('0x1e')](_0x33c3d6,[_0x09c0('0x1f'),_0x09c0('0x20')]));this[_0x09c0('0x17')](_0x09c0('0x21'),_0x09c0('0x22'),this['channels'][_0x33c3d6[_0x09c0('0x18')]]);ami[_0x09c0('0x17')](_0x09c0('0x23'),this[_0x09c0('0x8')][_0x33c3d6['uniqueid']]);}}}catch(_0x4f6824){logger[_0x09c0('0x24')](_0x09c0('0x25'),util[_0x09c0('0x26')](_0x4f6824,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x09c0('0x14')]['syncDialEnd']=function(_0x42ebfc){try{if(this[_0x09c0('0x15')](_0x42ebfc)){if(this['channels'][_0x42ebfc[_0x09c0('0x18')]]){this[_0x09c0('0x8')][_0x42ebfc[_0x09c0('0x18')]][_0x09c0('0x27')]=_0x42ebfc[_0x09c0('0x27')];if(_0x42ebfc[_0x09c0('0x27')]===_0x09c0('0x28')){this[_0x09c0('0x8')][_0x42ebfc[_0x09c0('0x18')]][_0x09c0('0x29')]=_0x42ebfc[_0x09c0('0x29')];this['channels'][_0x42ebfc[_0x09c0('0x18')]][_0x09c0('0x2a')]=_0x42ebfc['connectedlinename'];this[_0x09c0('0x8')][_0x42ebfc['uniqueid']][_0x09c0('0x2b')]=moment()['format'](_0x09c0('0x1a'));this[_0x09c0('0x8')][_0x42ebfc[_0x09c0('0x18')]][_0x09c0('0x2c')]='connect';ami['emit'](_0x09c0('0x2d'),this[_0x09c0('0x8')][_0x42ebfc[_0x09c0('0x18')]]);}this['emit'](_0x09c0('0x21'),'voice_outbound_channel:save',this[_0x09c0('0x8')][_0x42ebfc[_0x09c0('0x18')]]);}}}catch(_0x16cf08){logger['error'](_0x09c0('0x2e'),util[_0x09c0('0x26')](_0x16cf08,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x09c0('0x14')][_0x09c0('0x11')]=function(_0x234f07){try{if(this[_0x09c0('0x15')](_0x234f07)){this[_0x09c0('0x2f')](_0x234f07['uniqueid'],_[_0x09c0('0x30')](_0x234f07[_0x09c0('0x31')])[0x0],_0x234f07[_0x09c0('0x32')]);if(this[_0x09c0('0x15')](_0x234f07[_0x09c0('0x31')])&&this['isNotNull'](_0x234f07[_0x09c0('0x31')][_0x09c0('0x33')])){if(_[_0x09c0('0x16')](this[_0x09c0('0x8')][_0x234f07[_0x09c0('0x18')]])){this['channels'][_0x234f07[_0x09c0('0x18')]]={'routeId':_0x234f07[_0x09c0('0x32')],'variables':this[_0x09c0('0x34')][_0x234f07[_0x09c0('0x18')]]};this[_0x09c0('0x17')](_0x09c0('0x21'),_0x09c0('0x22'),this['channels'][_0x234f07[_0x09c0('0x18')]]);}}}}catch(_0x2a93d2){logger[_0x09c0('0x24')](_0x09c0('0x35'),util[_0x09c0('0x26')](_0x2a93d2,{'showHidden':![],'depth':null}));}};VoiceDialReport['prototype']['addVariable']=function(_0x5c3c09,_0x4a14dc,_0xd7a1eb){var _0x15c631=[_0x09c0('0x36'),_0x09c0('0x37'),_0x09c0('0x38'),'rtpaudioqosjitterbridged',_0x09c0('0x39'),_0x09c0('0x3a'),'rtpaudioqosrtt',_0x09c0('0x3b'),'sipcallid',_0x09c0('0x3c'),'bridgepeer',_0x09c0('0x3d'),_0x09c0('0x3e'),'memberdynamic',_0x09c0('0x3f'),_0x09c0('0x40'),'membername',_0x09c0('0x41'),_0x09c0('0x42')];if(!_[_0x09c0('0x43')](_0x4a14dc)&&!_[_0x09c0('0x44')](_0x15c631,_0x4a14dc)){if(_[_0x09c0('0x16')](this[_0x09c0('0x34')][_0x5c3c09])){this['variables'][_0x5c3c09]={};}this[_0x09c0('0x34')][_0x5c3c09][_0x4a14dc]=_0xd7a1eb;}};VoiceDialReport[_0x09c0('0x14')][_0x09c0('0x13')]=function(_0x57835c){try{if(this[_0x09c0('0x15')](_0x57835c)){if(this[_0x09c0('0x8')][_0x57835c[_0x09c0('0x18')]]){this['channels'][_0x57835c[_0x09c0('0x18')]][_0x09c0('0x45')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this[_0x09c0('0x8')][_0x57835c[_0x09c0('0x18')]]['duration']=moment(this[_0x09c0('0x8')][_0x57835c[_0x09c0('0x18')]]['endtime'])[_0x09c0('0x46')](this[_0x09c0('0x8')][_0x57835c[_0x09c0('0x18')]][_0x09c0('0x47')],_0x09c0('0x48'));this['channels'][_0x57835c[_0x09c0('0x18')]]['lastevent']='complete';this[_0x09c0('0xa')][_0x09c0('0x49')]+=0x1;if(this[_0x09c0('0x8')][_0x57835c[_0x09c0('0x18')]][_0x09c0('0x2b')]){this[_0x09c0('0xa')]['answered']+=0x1;this['channels'][_0x57835c['uniqueid']][_0x09c0('0x4a')]=moment(this[_0x09c0('0x8')][_0x57835c[_0x09c0('0x18')]]['answertime'])[_0x09c0('0x46')](this[_0x09c0('0x8')][_0x57835c[_0x09c0('0x18')]][_0x09c0('0x47')],_0x09c0('0x48'));this[_0x09c0('0x8')][_0x57835c[_0x09c0('0x18')]][_0x09c0('0x4b')]=moment(this[_0x09c0('0x8')][_0x57835c[_0x09c0('0x18')]][_0x09c0('0x45')])[_0x09c0('0x46')](this[_0x09c0('0x8')][_0x57835c[_0x09c0('0x18')]][_0x09c0('0x2b')],_0x09c0('0x48'));this[_0x09c0('0xa')][_0x09c0('0x4c')]+=this[_0x09c0('0x8')][_0x57835c[_0x09c0('0x18')]]['holdtime']||0x0;this[_0x09c0('0xa')][_0x09c0('0x4d')]+=this[_0x09c0('0x8')][_0x57835c[_0x09c0('0x18')]][_0x09c0('0x4b')];}this['outbound'][_0x09c0('0x4e')]+=this[_0x09c0('0x8')][_0x57835c[_0x09c0('0x18')]]['duration'];ami[_0x09c0('0x17')](_0x09c0('0x4f'),this[_0x09c0('0x8')][_0x57835c[_0x09c0('0x18')]]);ami[_0x09c0('0x17')](_0x09c0('0x50'),this[_0x09c0('0x8')][_0x57835c['uniqueid']]);this[_0x09c0('0x17')](_0x09c0('0x21'),_0x09c0('0x51'),this[_0x09c0('0xa')]);this[_0x09c0('0x17')](_0x09c0('0x21'),_0x09c0('0x52'),this['channels'][_0x57835c['uniqueid']]);delete this[_0x09c0('0x8')][_0x57835c[_0x09c0('0x18')]];}if(this[_0x09c0('0x34')][_0x57835c['uniqueid']]){delete this[_0x09c0('0x34')][_0x57835c['uniqueid']];}}}catch(_0x2fecec){logger[_0x09c0('0x24')](_0x09c0('0x53'),util[_0x09c0('0x26')](_0x2fecec,{'showHidden':![],'depth':null}));}};module[_0x09c0('0x54')]=VoiceDialReport; \ No newline at end of file +var _0xf109=['connect','voice_outbound_channel:save','inspect','syncVarSet','variable','value','[syncVarSet][VoiceDialReport]','addVariable','rtpaudioqos','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepeer','bridgepvtcallid','membercalls','memberdynamic','memberinterface','memberlastcall','membername','memberpenalty','memberrealtime','duration','endtime','diff','starttime','seconds','complete','total','answered','holdtime','billableseconds','sumHoldTime','sumBillable','custom:voiceDialReport','custom:dialend','[syncHangup][VoiceDialReport]','exports','lodash','moment','util','ami','../ami','redis','defaults','localhost','socket.io-emitter','channels','outboundChannels','outbound','variables','dialbegin','syncDialBegin','bind','syncDialEnd','varset','hangup','syncHangup','isNotNull','isUndefined','emit','uniqueid','YYYY-MM-DD\x20HH:mm:ss','called','substring','lastIndexOf','channel','omit','event','privilege','voice:outbound','custom:dialbegin','error','[syncDialBegin][VoiceDialReport]','prototype','ANSWER','connectedlinenum','connectedlinename','answertime','format','lastevent'];(function(_0x1f81bc,_0xbe0010){var _0x176b6e=function(_0x592d3d){while(--_0x592d3d){_0x1f81bc['push'](_0x1f81bc['shift']());}};_0x176b6e(++_0xbe0010);}(_0xf109,0xce));var _0x9f10=function(_0x11c573,_0x9e7c6e){_0x11c573=_0x11c573-0x0;var _0x6b72de=_0xf109[_0x11c573];return _0x6b72de;};'use strict';var _=require(_0x9f10('0x0'));var moment=require(_0x9f10('0x1'));var util=require(_0x9f10('0x2'));var Redis=require('ioredis');var config=require('../../../config/environment');var logger=require('../../../config/logger')(_0x9f10('0x3'));var ami=require(_0x9f10('0x4'));config[_0x9f10('0x5')]=_[_0x9f10('0x6')](config[_0x9f10('0x5')],{'host':_0x9f10('0x7'),'port':0x18eb});var io=require(_0x9f10('0x8'))(new Redis(config[_0x9f10('0x5')]));function VoiceDialReport(_0x227a29){this[_0x9f10('0x9')]=_0x227a29[_0x9f10('0xa')];this['outbound']=_0x227a29[_0x9f10('0xb')];this[_0x9f10('0xc')]={};ami['on'](_0x9f10('0xd'),this[_0x9f10('0xe')][_0x9f10('0xf')](this));ami['on']('dialend',this[_0x9f10('0x10')][_0x9f10('0xf')](this));ami['on'](_0x9f10('0x11'),this['syncVarSet']['bind'](this));ami['on'](_0x9f10('0x12'),this[_0x9f10('0x13')][_0x9f10('0xf')](this));}VoiceDialReport['prototype'][_0x9f10('0x14')]=function(_0x260606){return _0x260606!==null&&!_[_0x9f10('0x15')](_0x260606);};VoiceDialReport['prototype'][_0x9f10('0x16')]=function(_0x309f27,_0x5be443,_0x40a48a){io['to'](_0x309f27)[_0x9f10('0x16')](_0x5be443,_0x40a48a);};VoiceDialReport['prototype']['syncDialBegin']=function(_0x2b6c4c){try{if(this[_0x9f10('0x14')](_0x2b6c4c)){if(this['channels'][_0x2b6c4c[_0x9f10('0x17')]]){_['merge'](this[_0x9f10('0x9')][_0x2b6c4c[_0x9f10('0x17')]],{'starttime':moment()['format'](_0x9f10('0x18')),'lastevent':_0x9f10('0x19'),'interface':_0x2b6c4c['channel'][_0x9f10('0x1a')](0x0,_0x2b6c4c['channel'][_0x9f10('0x1b')]('-')),'membername':_0x2b6c4c['channel'][_0x9f10('0x1a')](_0x2b6c4c['channel']['lastIndexOf']('/')+0x1,_0x2b6c4c[_0x9f10('0x1c')][_0x9f10('0x1b')]('-'))},_[_0x9f10('0x1d')](_0x2b6c4c,[_0x9f10('0x1e'),_0x9f10('0x1f')]));this[_0x9f10('0x16')](_0x9f10('0x20'),'voice_outbound_channel:save',this[_0x9f10('0x9')][_0x2b6c4c['uniqueid']]);ami[_0x9f10('0x16')](_0x9f10('0x21'),this[_0x9f10('0x9')][_0x2b6c4c['uniqueid']]);}}}catch(_0x2f31fb){logger[_0x9f10('0x22')](_0x9f10('0x23'),util['inspect'](_0x2f31fb,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x9f10('0x24')][_0x9f10('0x10')]=function(_0x44b99d){try{if(this['isNotNull'](_0x44b99d)){if(this[_0x9f10('0x9')][_0x44b99d[_0x9f10('0x17')]]){this[_0x9f10('0x9')][_0x44b99d[_0x9f10('0x17')]]['dialstatus']=_0x44b99d['dialstatus'];if(_0x44b99d['dialstatus']===_0x9f10('0x25')){this['channels'][_0x44b99d[_0x9f10('0x17')]][_0x9f10('0x26')]=_0x44b99d[_0x9f10('0x26')];this[_0x9f10('0x9')][_0x44b99d[_0x9f10('0x17')]]['connectedlinename']=_0x44b99d[_0x9f10('0x27')];this[_0x9f10('0x9')][_0x44b99d[_0x9f10('0x17')]][_0x9f10('0x28')]=moment()[_0x9f10('0x29')](_0x9f10('0x18'));this['channels'][_0x44b99d[_0x9f10('0x17')]][_0x9f10('0x2a')]=_0x9f10('0x2b');ami[_0x9f10('0x16')]('custom:dialconnect',this[_0x9f10('0x9')][_0x44b99d[_0x9f10('0x17')]]);}this[_0x9f10('0x16')]('voice:outbound',_0x9f10('0x2c'),this['channels'][_0x44b99d[_0x9f10('0x17')]]);}}}catch(_0x362cab){logger[_0x9f10('0x22')]('[syncDialEnd][VoiceDialReport]',util[_0x9f10('0x2d')](_0x362cab,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x9f10('0x24')][_0x9f10('0x2e')]=function(_0x11f128){try{if(this[_0x9f10('0x14')](_0x11f128)){this['addVariable'](_0x11f128[_0x9f10('0x17')],_['keys'](_0x11f128[_0x9f10('0x2f')])[0x0],_0x11f128[_0x9f10('0x30')]);if(this[_0x9f10('0x14')](_0x11f128[_0x9f10('0x2f')])&&this[_0x9f10('0x14')](_0x11f128[_0x9f10('0x2f')]['outboundrouteid'])){if(_[_0x9f10('0x15')](this[_0x9f10('0x9')][_0x11f128[_0x9f10('0x17')]])){this['channels'][_0x11f128[_0x9f10('0x17')]]={'routeId':_0x11f128[_0x9f10('0x30')],'variables':this['variables'][_0x11f128[_0x9f10('0x17')]]};this['emit'](_0x9f10('0x20'),_0x9f10('0x2c'),this[_0x9f10('0x9')][_0x11f128[_0x9f10('0x17')]]);}}}}catch(_0x20605a){logger[_0x9f10('0x22')](_0x9f10('0x31'),util[_0x9f10('0x2d')](_0x20605a,{'showHidden':![],'depth':null}));}};VoiceDialReport['prototype'][_0x9f10('0x32')]=function(_0x622030,_0x2fa4bf,_0x5599c7){var _0x233bab=[_0x9f10('0x33'),'rtpaudioqosbridged',_0x9f10('0x34'),_0x9f10('0x35'),_0x9f10('0x36'),'rtpaudioqoslossbridged','rtpaudioqosrtt',_0x9f10('0x37'),_0x9f10('0x38'),_0x9f10('0x39'),_0x9f10('0x3a'),_0x9f10('0x3b'),_0x9f10('0x3c'),_0x9f10('0x3d'),_0x9f10('0x3e'),_0x9f10('0x3f'),_0x9f10('0x40'),_0x9f10('0x41'),_0x9f10('0x42')];if(!_['isNil'](_0x2fa4bf)&&!_['includes'](_0x233bab,_0x2fa4bf)){if(_['isUndefined'](this[_0x9f10('0xc')][_0x622030])){this['variables'][_0x622030]={};}this[_0x9f10('0xc')][_0x622030][_0x2fa4bf]=_0x5599c7;}};VoiceDialReport[_0x9f10('0x24')][_0x9f10('0x13')]=function(_0x47d25c){try{if(this[_0x9f10('0x14')](_0x47d25c)){if(this[_0x9f10('0x9')][_0x47d25c[_0x9f10('0x17')]]){this[_0x9f10('0x9')][_0x47d25c[_0x9f10('0x17')]]['endtime']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this[_0x9f10('0x9')][_0x47d25c['uniqueid']][_0x9f10('0x43')]=moment(this['channels'][_0x47d25c[_0x9f10('0x17')]][_0x9f10('0x44')])[_0x9f10('0x45')](this[_0x9f10('0x9')][_0x47d25c['uniqueid']][_0x9f10('0x46')],_0x9f10('0x47'));this['channels'][_0x47d25c[_0x9f10('0x17')]][_0x9f10('0x2a')]=_0x9f10('0x48');this[_0x9f10('0xb')][_0x9f10('0x49')]+=0x1;if(this[_0x9f10('0x9')][_0x47d25c[_0x9f10('0x17')]][_0x9f10('0x28')]){this[_0x9f10('0xb')][_0x9f10('0x4a')]+=0x1;this['channels'][_0x47d25c[_0x9f10('0x17')]][_0x9f10('0x4b')]=moment(this['channels'][_0x47d25c[_0x9f10('0x17')]][_0x9f10('0x28')])[_0x9f10('0x45')](this[_0x9f10('0x9')][_0x47d25c['uniqueid']][_0x9f10('0x46')],_0x9f10('0x47'));this[_0x9f10('0x9')][_0x47d25c[_0x9f10('0x17')]][_0x9f10('0x4c')]=moment(this[_0x9f10('0x9')][_0x47d25c['uniqueid']][_0x9f10('0x44')])[_0x9f10('0x45')](this[_0x9f10('0x9')][_0x47d25c[_0x9f10('0x17')]][_0x9f10('0x28')],_0x9f10('0x47'));this['outbound'][_0x9f10('0x4d')]+=this[_0x9f10('0x9')][_0x47d25c[_0x9f10('0x17')]][_0x9f10('0x4b')]||0x0;this[_0x9f10('0xb')][_0x9f10('0x4e')]+=this[_0x9f10('0x9')][_0x47d25c[_0x9f10('0x17')]]['billableseconds'];}this[_0x9f10('0xb')]['sumDuration']+=this[_0x9f10('0x9')][_0x47d25c['uniqueid']][_0x9f10('0x43')];ami[_0x9f10('0x16')](_0x9f10('0x4f'),this[_0x9f10('0x9')][_0x47d25c[_0x9f10('0x17')]]);ami['emit'](_0x9f10('0x50'),this[_0x9f10('0x9')][_0x47d25c[_0x9f10('0x17')]]);this[_0x9f10('0x16')]('voice:outbound','voice_outbound:save',this[_0x9f10('0xb')]);this[_0x9f10('0x16')]('voice:outbound','voice_outbound_channel:remove',this[_0x9f10('0x9')][_0x47d25c[_0x9f10('0x17')]]);delete this[_0x9f10('0x9')][_0x47d25c['uniqueid']];}if(this[_0x9f10('0xc')][_0x47d25c[_0x9f10('0x17')]]){delete this[_0x9f10('0xc')][_0x47d25c['uniqueid']];}}}catch(_0x37ae9c){logger[_0x9f10('0x22')](_0x9f10('0x51'),util['inspect'](_0x37ae9c,{'showHidden':![],'depth':null}));}};module[_0x9f10('0x52')]=VoiceDialReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceQueueReport.js b/server/services/ami/report/voiceQueueReport.js index 68a3600..9bec600 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 _0x831a=['channels','voiceQueues','flagQueueSummary','campaigns','variables','queuesummary','syncQueueSummary','bind','queuesummarycomplete','syncQueueSummaryComplete','queuecallerjoin','syncQueueCallerJoin','queuecallerabandon','syncQueueCallerAbandon','agentcomplete','syncAgentComplete','agentconnect','syncAgentConnect','varset','syncVarSet','hangup','syncHangup','syncFullyBooted','syncMusicOnHoldStart','syncMusicOnHoldStop','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','loopQueueSummary','loopQueueShow','isUndefined','isEmpty','hasOwnProperty','originated','pTalking','waiting','queueStatusComplete','unlockRR','prototype','Action','status','catch','message','No\x20such\x20channel','error','queueReports','[voiceQueueReport][checkQueueReport]','[voiceQueueReport][checkVariables]','clearQueueReport','emitVoiceQueueChannelRemove','inspect','emit','emitVoiceQueueChannelSave','voice:queue:%s','voice_queue_channel:save','format','name','voice_queue_channel:remove','emitVoiceQueueSummary','type','inbound','strategy','answered','available','sumBillable','sumDuration','sumHoldTime','talking','Trunk','active','callerid','Interval','stringify','voice_queue:save','clearZombieChannels','queues','[queues]','then','[queuesummary]','isNotNull','queue','countBy','callers','toNumber','loggedIn','loggedin','custom:queuesummary','[syncQueueSummary][VoiceQueueReport]','syncNewExten','uniqueid','queuecallerjoinAt','YYYY-MM-DD\x20HH:mm:ss','position','count','merge','pick','keys','push','last','queuecallercomplete','queuecallercompleteAt','holdtime','originalposition','queuecallerabandonAt','lastAssignedTo','[syncQueueCallerAbandon][VoiceQueueReport]','syncQueueCallerLeave','queuecallerleaveAt','connectedlinenum','connectedlinename','[syncQueueCallerLeave][VoiceQueueReport]','COMPLETEDBYAGENT','[syncAgentConnect][VoiceQueueReport]','assigned','membername','queuecallerexitAt','transfer','reason','queuecallerexitreason','COMPLETED','startsWith','local/','linkedid','add','seconds','FORWARDTRANSFER','transfertype','FORWARD','transferexten','COMPLETEDBY','toUpperCase','[syncAgentComplete][VoiceQueueReport]','addVariable','variable','value','queuestatus','CONTINUE','queuecallerexit','EXITWITHKEY','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqoslossbridged','rtpaudioqosrttbridged','sipcallid','bridgepeer','bridgepvtcallid','membercalls','memberdynamic','memberlastcall','memberpenalty','isNil','includes','length','unmanaged','abandoned','diff','total','custom:queuecallerunmanaged','lastevent','custom:queuecallerabandon','custom:voiceQueueReport','transfereeuniqueid','secondtransfererexten','transferuniqueid','ATTENDEDTRANSFER','ATTENDED','secondtransfereruniqueid','switch','transfertargetuniqueid','origtransfererexten','origtransfereruniqueid','[syncAttendedTransfer][VoiceQueueReport]','BLINDTRANSFER','BLIND','extension','BlindTransfer','context','transfererchannel','[syncBlindTransfer][VoiceQueueReport]','mohstarttime','[syncMusicOnHoldStart][VoiceQueueReport]','milliseconds','[syncMusicOnHoldStop][VoiceQueueReport]','moment','bluebird','util','md5','../../../config/environment','../../../config/logger','ami','../ami','redis','defaults','enqueue','tail','finally','sequence','agents'];(function(_0x5a2a5b,_0x3bfcb3){var _0x2b77bf=function(_0x334f2f){while(--_0x334f2f){_0x5a2a5b['push'](_0x5a2a5b['shift']());}};_0x2b77bf(++_0x3bfcb3);}(_0x831a,0xba));var _0xa831=function(_0x36bba5,_0x755637){_0x36bba5=_0x36bba5-0x0;var _0x37cdab=_0x831a[_0x36bba5];return _0x37cdab;};'use strict';var _=require('lodash');var moment=require(_0xa831('0x0'));var BPromise=require(_0xa831('0x1'));var util=require(_0xa831('0x2'));var md5=require(_0xa831('0x3'));var Redis=require('ioredis');var config=require(_0xa831('0x4'));var logger=require(_0xa831('0x5'))(_0xa831('0x6'));var ami=require(_0xa831('0x7'));var QueueReport=require('../model/queueReport');config[_0xa831('0x8')]=_[_0xa831('0x9')](config[_0xa831('0x8')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xa831('0x8')]));var Sequence=function(){};Sequence['prototype'][_0xa831('0xa')]=function(_0x204476){this['tail']=this[_0xa831('0xb')]?this['tail'][_0xa831('0xc')](_0x204476):_0x204476();};function VoiceQueueReport(_0x4716d3){this[_0xa831('0xd')]=new Sequence();this['queueReports']={};this[_0xa831('0xe')]=_0x4716d3['agents'];this[_0xa831('0xf')]=_0x4716d3['queueChannels'];this[_0xa831('0x10')]=_0x4716d3[_0xa831('0x10')];this[_0xa831('0x11')]=!![];this[_0xa831('0x12')]=_0x4716d3[_0xa831('0x12')];this[_0xa831('0x13')]={};ami['on'](_0xa831('0x14'),this[_0xa831('0x15')][_0xa831('0x16')](this));ami['on'](_0xa831('0x17'),this[_0xa831('0x18')]['bind'](this));ami['on'](_0xa831('0x19'),this[_0xa831('0x1a')]['bind'](this));ami['on'](_0xa831('0x1b'),this[_0xa831('0x1c')][_0xa831('0x16')](this));ami['on']('queuecallerleave',this['syncQueueCallerLeave'][_0xa831('0x16')](this));ami['on'](_0xa831('0x1d'),this[_0xa831('0x1e')][_0xa831('0x16')](this));ami['on'](_0xa831('0x1f'),this[_0xa831('0x20')][_0xa831('0x16')](this));ami['on'](_0xa831('0x21'),this[_0xa831('0x22')]['bind'](this));ami['on'](_0xa831('0x23'),this[_0xa831('0x24')]['bind'](this));ami['on']('fullybooted',this[_0xa831('0x25')][_0xa831('0x16')](this));ami['on']('musiconholdstart',this[_0xa831('0x26')]['bind'](this));ami['on']('musiconholdstop',this[_0xa831('0x27')][_0xa831('0x16')](this));ami['on'](_0xa831('0x28'),this[_0xa831('0x29')]['bind'](this));ami['on'](_0xa831('0x2a'),this[_0xa831('0x2b')][_0xa831('0x16')](this));this[_0xa831('0x2c')]();this[_0xa831('0x2d')]();}function isNotNull(_0xd37972){return _0xd37972!==null&&!_[_0xa831('0x2e')](_0xd37972);}function clearChannels(_0x3afd64){if(!_[_0xa831('0x2f')](_0x3afd64)){for(var _0x7ff460 in _0x3afd64){if(_0x3afd64[_0xa831('0x30')](_0x7ff460)){delete _0x3afd64[_0x7ff460];}}}}function clearCampaigns(_0x2bf838){if(!_[_0xa831('0x2f')](_0x2bf838)){for(var _0x148fbb in _0x2bf838){if(_0x2bf838['hasOwnProperty'](_0x148fbb)){_0x2bf838[_0x148fbb][_0xa831('0x31')]=0x0;}}}}function clearVoiceQueues(_0x23f207){if(!_[_0xa831('0x2f')](_0x23f207)){for(var _0x2d9c95 in _0x23f207){if(_0x23f207[_0xa831('0x30')](_0x2d9c95)){_0x23f207[_0x2d9c95][_0xa831('0x31')]=0x0;_0x23f207[_0x2d9c95]['talking']=0x0;_0x23f207[_0x2d9c95][_0xa831('0x32')]=0x0;_0x23f207[_0x2d9c95][_0xa831('0x33')]=0x0;_0x23f207[_0x2d9c95][_0xa831('0x34')]=!![];}}}}function clearAgentBooked(_0x18e61d){if(!_['isEmpty'](_0x18e61d)){for(var _0x5e89ab in _0x18e61d){if(_0x18e61d[_0xa831('0x30')](_0x5e89ab)){_0x18e61d[_0x5e89ab][_0xa831('0x35')]=!![];}}}}VoiceQueueReport[_0xa831('0x36')]['clearZombieChannels']=function(){var _0x20931c=this;for(var _0x30a89c in this[_0xa831('0xf')]){if(this[_0xa831('0xf')][_0xa831('0x30')](_0x30a89c)&&!this['channels'][_0x30a89c]['switch']){this[_0xa831('0xd')][_0xa831('0xa')](function(){if(!_['isNil'](_0x20931c['channels'][_0x30a89c])){return ami[_0xa831('0x37')]({'action':_0xa831('0x38'),'channel':_0x20931c[_0xa831('0xf')][_0x30a89c]['channel']})[_0xa831('0x39')](function(_0x139877){if(_0x139877[_0xa831('0x3a')]===_0xa831('0x3b')){setTimeout(function(){if(_0x20931c[_0xa831('0xf')][_0x30a89c]){delete _0x20931c[_0xa831('0xf')][_0x30a89c];logger[_0xa831('0x3c')]('[voiceQueueReport][checkChannel]',_0x30a89c);}if(_0x20931c[_0xa831('0x3d')][_0x30a89c]){delete _0x20931c[_0xa831('0x3d')][_0x30a89c];logger[_0xa831('0x3c')](_0xa831('0x3e'),_0x30a89c);}if(_0x20931c[_0xa831('0x13')][_0x30a89c]){delete _0x20931c[_0xa831('0x13')][_0x30a89c];logger['error'](_0xa831('0x3f'),_0x30a89c);}},0x1f40);}});}});}}};VoiceQueueReport[_0xa831('0x36')][_0xa831('0x25')]=function(){logger['error']('[FullyBooted]\x20clear\x20realtime');clearChannels(this[_0xa831('0xf')]);this[_0xa831('0x40')](this[_0xa831('0x3d')]);clearAgentBooked(this['agents']);clearVoiceQueues(this[_0xa831('0x10')]);clearCampaigns(this[_0xa831('0x12')]);};VoiceQueueReport[_0xa831('0x36')][_0xa831('0x40')]=function(_0xb82e3e){var _0x587486=this;if(!_[_0xa831('0x2f')](_0xb82e3e)){for(var _0x330162 in _0xb82e3e){if(_0xb82e3e[_0xa831('0x30')](_0x330162)){_0x587486[_0xa831('0x41')](_0xb82e3e[_0x330162]);delete _0xb82e3e[_0x330162];}}}};function loggerCatch(_0xbba08d){return function(_0x58535c){logger['error'](_0xbba08d,util[_0xa831('0x42')](_0x58535c,{'showHidden':![],'depth':null}));};}VoiceQueueReport[_0xa831('0x36')]['emit']=function(_0x29ab7,_0x54f34a,_0x3351e8){io['to'](_0x29ab7)[_0xa831('0x43')](_0x54f34a,_0x3351e8);};VoiceQueueReport[_0xa831('0x36')][_0xa831('0x44')]=function(_0xff598d){this[_0xa831('0x43')](util['format'](_0xa831('0x45'),_0xff598d['name']),_0xa831('0x46'),_0xff598d);};VoiceQueueReport[_0xa831('0x36')]['emitVoiceQueueChannelRemove']=function(_0xc44bf9){this[_0xa831('0x43')](util[_0xa831('0x47')](_0xa831('0x45'),_0xc44bf9[_0xa831('0x48')]),_0xa831('0x49'),_0xc44bf9);};VoiceQueueReport[_0xa831('0x36')][_0xa831('0x4a')]=function(_0x3b4c91){if(_0x3b4c91[_0xa831('0x4b')]===_0xa831('0x4c')){var _0x550e31={'id':_0x3b4c91['id'],'name':_0x3b4c91[_0xa831('0x48')],'strategy':_0x3b4c91[_0xa831('0x4d')],'answered':_0x3b4c91[_0xa831('0x4e')],'available':_0x3b4c91[_0xa831('0x4f')],'loggedIn':_0x3b4c91['loggedIn'],'pTalking':_0x3b4c91[_0xa831('0x32')],'sumBillable':_0x3b4c91[_0xa831('0x50')],'sumDuration':_0x3b4c91[_0xa831('0x51')],'sumHoldTime':_0x3b4c91[_0xa831('0x52')]||0x0,'talking':_0x3b4c91[_0xa831('0x53')],'total':_0x3b4c91['total'],'type':_0x3b4c91[_0xa831('0x4b')],'unmanaged':_0x3b4c91['unmanaged'],'abandoned':_0x3b4c91['abandoned'],'waiting':_0x3b4c91[_0xa831('0x33')]};if(_0x3b4c91[_0xa831('0x54')]){_0x550e31[_0xa831('0x54')]={'id':_0x3b4c91[_0xa831('0x54')]['id'],'name':_0x3b4c91[_0xa831('0x54')][_0xa831('0x48')],'active':_0x3b4c91[_0xa831('0x54')][_0xa831('0x55')],'callerid':_0x3b4c91[_0xa831('0x54')][_0xa831('0x56')]};}if(_0x3b4c91[_0xa831('0x57')]){_0x550e31[_0xa831('0x57')]={'id':_0x3b4c91[_0xa831('0x57')]['id'],'name':_0x3b4c91[_0xa831('0x57')][_0xa831('0x48')]};}var _0x2a7f22=md5(JSON[_0xa831('0x58')](_0x550e31));if(_0x3b4c91['md5']!==_0x2a7f22){_0x3b4c91['md5']=_0x2a7f22;this['emit'](util[_0xa831('0x47')](_0xa831('0x45'),_0x550e31[_0xa831('0x48')]),_0xa831('0x59'),_0x550e31);}}};VoiceQueueReport[_0xa831('0x36')]['isNotNull']=function(_0x35e0e2){return _0x35e0e2!==null&&!_[_0xa831('0x2e')](_0x35e0e2);};VoiceQueueReport['prototype'][_0xa831('0x2d')]=function(){var _0x2fb088=this;setInterval(function(){_0x2fb088[_0xa831('0x5a')]();ami[_0xa831('0x37')]({'action':_0xa831('0x5b')})[_0xa831('0x39')](loggerCatch(_0xa831('0x5c')));},0x2710);};VoiceQueueReport['prototype'][_0xa831('0x2c')]=function(){var _0xe89cc1=this;setInterval(function(){if(_0xe89cc1['flagQueueSummary']){return ami[_0xa831('0x37')]({'action':_0xa831('0x14')})[_0xa831('0x5d')](function(_0x132d8c){_0xe89cc1[_0xa831('0x11')]=![];})['catch'](loggerCatch(_0xa831('0x5e')));}},0x3e8);};VoiceQueueReport[_0xa831('0x36')]['syncQueueSummary']=function(_0xfd6621){try{if(this['isNotNull'](_0xfd6621)&&this[_0xa831('0x5f')](_0xfd6621[_0xa831('0x60')])){if(this[_0xa831('0x10')][_0xfd6621[_0xa831('0x60')]]){var _0x41017a=_[_0xa831('0x61')](this[_0xa831('0xf')],'queue')[_0xfd6621[_0xa831('0x60')]]||0x0;var _0x27fa88=_0x41017a-_0xfd6621[_0xa831('0x62')];if(this[_0xa831('0x10')][_0xfd6621[_0xa831('0x60')]]['waiting']!==_[_0xa831('0x63')](_0xfd6621[_0xa831('0x62')])||this[_0xa831('0x10')][_0xfd6621['queue']][_0xa831('0x64')]!==_[_0xa831('0x63')](_0xfd6621['loggedin'])||this[_0xa831('0x10')][_0xfd6621[_0xa831('0x60')]][_0xa831('0x4f')]!==_['toNumber'](_0xfd6621[_0xa831('0x4f')])||this[_0xa831('0x10')][_0xfd6621[_0xa831('0x60')]]['talking']!==_0x27fa88){this[_0xa831('0x10')][_0xfd6621[_0xa831('0x60')]][_0xa831('0x33')]=_[_0xa831('0x63')](_0xfd6621[_0xa831('0x62')]);this[_0xa831('0x10')][_0xfd6621['queue']][_0xa831('0x64')]=_[_0xa831('0x63')](_0xfd6621[_0xa831('0x65')]);this['voiceQueues'][_0xfd6621[_0xa831('0x60')]][_0xa831('0x4f')]=_[_0xa831('0x63')](_0xfd6621[_0xa831('0x4f')]);this[_0xa831('0x10')][_0xfd6621[_0xa831('0x60')]][_0xa831('0x53')]=_0x27fa88>0x0?_0x27fa88:0x0;this[_0xa831('0x10')][_0xfd6621[_0xa831('0x60')]][_0xa831('0x53')]=this[_0xa831('0x10')][_0xfd6621['queue']][_0xa831('0x53')]>_[_0xa831('0x63')](_0xfd6621[_0xa831('0x65')])?_[_0xa831('0x63')](_0xfd6621[_0xa831('0x65')]):this[_0xa831('0x10')][_0xfd6621[_0xa831('0x60')]][_0xa831('0x53')];this[_0xa831('0x4a')](this['voiceQueues'][_0xfd6621[_0xa831('0x60')]]);}ami[_0xa831('0x43')](_0xa831('0x66'),this[_0xa831('0x10')][_0xfd6621[_0xa831('0x60')]]);}}}catch(_0x2084f3){logger[_0xa831('0x3c')](_0xa831('0x67'),util[_0xa831('0x42')](_0x2084f3,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['syncQueueSummaryComplete']=function(_0x98640f){this[_0xa831('0x11')]=!![];};VoiceQueueReport[_0xa831('0x36')][_0xa831('0x68')]=function(_0x4a8925){};VoiceQueueReport[_0xa831('0x36')]['syncQueueCallerJoin']=function(_0x41c016){try{if(this[_0xa831('0x5f')](_0x41c016)){if(_[_0xa831('0x2e')](this[_0xa831('0x3d')][_0x41c016['uniqueid']])){this[_0xa831('0x3d')][_0x41c016[_0xa831('0x69')]]=[];this[_0xa831('0xf')][_0x41c016[_0xa831('0x69')]]={};}var _0x5724ae=new QueueReport();_0x5724ae['name']=_0x41c016['queue'];_0x5724ae['type']=this['voiceQueues'][_0x5724ae[_0xa831('0x48')]]&&this[_0xa831('0x10')][_0x5724ae[_0xa831('0x48')]][_0xa831('0x4b')]?this[_0xa831('0x10')][_0x5724ae[_0xa831('0x48')]]['type']||_0xa831('0x4c'):'inbound';_0x5724ae[_0xa831('0x60')]=_0x41c016[_0xa831('0x60')];_0x5724ae[_0xa831('0x6a')]=moment()[_0xa831('0x47')](_0xa831('0x6b'));_0x5724ae[_0xa831('0x6c')]=_0x41c016[_0xa831('0x6c')];_0x5724ae[_0xa831('0x6d')]=_0x41c016[_0xa831('0x6d')];_[_0xa831('0x6e')](_0x5724ae,_[_0xa831('0x6f')](_0x41c016,_[_0xa831('0x70')](_0x5724ae)));this[_0xa831('0x3d')][_0x41c016[_0xa831('0x69')]][_0xa831('0x71')](_0x5724ae);this[_0xa831('0xf')][_0x41c016['uniqueid']]=_0x5724ae;this['emitVoiceQueueChannelSave'](_0x5724ae);}}catch(_0x5c6018){logger[_0xa831('0x3c')]('[syncQueueCallerJoin][VoiceQueueReport]',util[_0xa831('0x42')](_0x5c6018,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xa831('0x36')]['syncQueueCallerAbandon']=function(_0x50b5bb){try{if(this['isNotNull'](_0x50b5bb)){if(this['queueReports'][_0x50b5bb[_0xa831('0x69')]]){var _0x582cd2=_[_0xa831('0x72')](this[_0xa831('0x3d')][_0x50b5bb[_0xa831('0x69')]]);_0x582cd2[_0xa831('0x73')]=![];_0x582cd2[_0xa831('0x74')]=null;_0x582cd2[_0xa831('0x75')]=_0x50b5bb[_0xa831('0x75')];_0x582cd2[_0xa831('0x76')]=_0x50b5bb[_0xa831('0x76')];_0x582cd2[_0xa831('0x1b')]=!![];_0x582cd2[_0xa831('0x77')]=moment()[_0xa831('0x47')](_0xa831('0x6b'));_0x582cd2['queuecallerexitreason']='ABANDONED';_0x582cd2[_0xa831('0x78')]=null;this['channels'][_0x50b5bb[_0xa831('0x69')]]=_0x582cd2;this[_0xa831('0x41')](_0x582cd2);}}}catch(_0x4c02c9){logger['error'](_0xa831('0x79'),util[_0xa831('0x42')](_0x4c02c9,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xa831('0x36')][_0xa831('0x7a')]=function(_0x3d60b3){try{if(this[_0xa831('0x5f')](_0x3d60b3)){if(this[_0xa831('0x3d')][_0x3d60b3[_0xa831('0x69')]]){var _0x56d59e=_[_0xa831('0x72')](this[_0xa831('0x3d')][_0x3d60b3[_0xa831('0x69')]]);_0x56d59e[_0xa831('0x7b')]=moment()[_0xa831('0x47')]('YYYY-MM-DD\x20HH:mm:ss');_0x56d59e[_0xa831('0x7c')]=_0x3d60b3[_0xa831('0x7c')];_0x56d59e[_0xa831('0x7d')]=_0x3d60b3[_0xa831('0x7d')];this[_0xa831('0xf')][_0x3d60b3[_0xa831('0x69')]]=_0x56d59e;this['emitVoiceQueueChannelSave'](_0x56d59e);}}}catch(_0x398818){logger[_0xa831('0x3c')](_0xa831('0x7e'),util[_0xa831('0x42')](_0x398818,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xa831('0x36')][_0xa831('0x20')]=function(_0x6a5ccb){try{if(this[_0xa831('0x5f')](_0x6a5ccb)){if(this[_0xa831('0x3d')][_0x6a5ccb[_0xa831('0x69')]]){var _0x3af785=_[_0xa831('0x72')](this[_0xa831('0x3d')][_0x6a5ccb['uniqueid']]);_0x3af785[_0xa831('0x73')]=!![];_0x3af785['queuecallerexitreason']=_0xa831('0x7f');}}}catch(_0x2fa4b4){logger[_0xa831('0x3c')](_0xa831('0x80'),util[_0xa831('0x42')](_0x2fa4b4,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xa831('0x36')][_0xa831('0x1e')]=function(_0xde46c5){try{if(this[_0xa831('0x5f')](_0xde46c5)){if(this[_0xa831('0x3d')][_0xde46c5[_0xa831('0x69')]]){var _0x3c97f0=_['last'](this['queueReports'][_0xde46c5[_0xa831('0x69')]]);_0x3c97f0[_0xa831('0x1b')]=![];_0x3c97f0[_0xa831('0x77')]=null;_0x3c97f0[_0xa831('0x81')]=!![];_0x3c97f0[_0xa831('0x78')]=_0xde46c5[_0xa831('0x82')];_0x3c97f0[_0xa831('0x75')]=_0xde46c5[_0xa831('0x75')];_0x3c97f0[_0xa831('0x73')]=!![];_0x3c97f0['queuecallerexit']=![];_0x3c97f0[_0xa831('0x83')]=null;if(!_0x3c97f0[_0xa831('0x84')]){if(_0xde46c5[_0xa831('0x85')]==_0xa831('0x84')){_0x3c97f0[_0xa831('0x86')]=_0xa831('0x87');}else{if(_[_0xa831('0x88')](_0xde46c5['channel']['toLowerCase'](),_0xa831('0x89'))){if(this[_0xa831('0x3d')][_0xde46c5[_0xa831('0x8a')]]){var _0x396ac5=_['last'](this[_0xa831('0x3d')][_0xde46c5[_0xa831('0x8a')]]);_0x396ac5[_0xa831('0x73')]=![];_0x396ac5['queuecallerexit']=!![];_0x396ac5['queuecallerexitAt']=moment(_0x3c97f0[_0xa831('0x6a')])[_0xa831('0x8b')](_0xde46c5[_0xa831('0x75')],_0xa831('0x8c'))[_0xa831('0x47')](_0xa831('0x6b'));_0x396ac5[_0xa831('0x86')]=_0xa831('0x8d');_0x396ac5['transfer']=!![];_0x396ac5[_0xa831('0x8e')]=_0xa831('0x8f');_0x396ac5[_0xa831('0x90')]=_0xde46c5['destexten'];_0x396ac5['transferuniqueid']=_0xde46c5[_0xa831('0x69')];var _0x2f1d89=this[_0xa831('0x3d')][_0xde46c5[_0xa831('0x8a')]];this[_0xa831('0x3d')][_0xde46c5['linkedid']]=this[_0xa831('0x3d')][_0xde46c5[_0xa831('0x69')]];this[_0xa831('0x3d')][_0xde46c5[_0xa831('0x69')]]=_0x2f1d89;}}else{_0x3c97f0[_0xa831('0x86')]=_0xa831('0x91')+_0xde46c5[_0xa831('0x85')][_0xa831('0x92')]();}}}this[_0xa831('0xf')][_0xde46c5[_0xa831('0x69')]]=_0x3c97f0;this['emitVoiceQueueChannelRemove'](_0x3c97f0);}}}catch(_0x433075){logger['error'](_0xa831('0x93'),util[_0xa831('0x42')](_0x433075,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xa831('0x22')]=function(_0x317325){try{if(this[_0xa831('0x5f')](_0x317325)){this[_0xa831('0x94')](_0x317325[_0xa831('0x69')],_[_0xa831('0x70')](_0x317325[_0xa831('0x95')])[0x0],_0x317325[_0xa831('0x96')]);if(this[_0xa831('0x3d')][_0x317325[_0xa831('0x69')]]){var _0x58076a=_['last'](this[_0xa831('0x3d')][_0x317325[_0xa831('0x69')]]);if(_0x58076a){if(this[_0xa831('0x5f')](_0x317325['variable'])&&this[_0xa831('0x5f')](_0x317325[_0xa831('0x95')][_0xa831('0x97')])){switch(_0x317325[_0xa831('0x96')]){case _0xa831('0x98'):_0x58076a[_0xa831('0x99')]=![];_0x58076a['queuecallerexitAt']=null;break;default:_0x58076a[_0xa831('0x99')]=!![];_0x58076a['queuecallerexitAt']=moment()[_0xa831('0x47')](_0xa831('0x6b'));_0x58076a[_0xa831('0x7b')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0x58076a['queuecallerabandon']=![];_0x58076a['queuecallerabandonAt']=null;_0x58076a['queuecallerexitreason']=_0x317325[_0xa831('0x96')];this[_0xa831('0xf')][_0x317325[_0xa831('0x69')]]=_0x58076a;this[_0xa831('0x41')](_0x58076a);}else if(this[_0xa831('0x5f')](_0x317325['variable'])&&this['isNotNull'](_0x317325['variable']['queueposition'])){if(!_0x58076a[_0xa831('0x1b')]){_0x58076a[_0xa831('0x99')]=!![];_0x58076a[_0xa831('0x83')]=moment()[_0xa831('0x47')](_0xa831('0x6b'));_0x58076a[_0xa831('0x86')]=_0xa831('0x9a');_0x58076a['queuecallerleaveAt']=moment()[_0xa831('0x47')]('YYYY-MM-DD\x20HH:mm:ss');this[_0xa831('0xf')][_0x317325[_0xa831('0x69')]]=_0x58076a;}}_0x58076a[_0xa831('0x13')]=this[_0xa831('0x13')][_0x317325[_0xa831('0x69')]];}}}}catch(_0x28b223){logger['error']('[syncVarSet][VoiceQueueReport]',util['inspect'](_0x28b223,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xa831('0x36')][_0xa831('0x94')]=function(_0xa52b51,_0x133ba2,_0x127c7b){var _0xa4bc71=[_0xa831('0x9b'),_0xa831('0x9c'),_0xa831('0x9d'),_0xa831('0x9e'),'rtpaudioqosloss',_0xa831('0x9f'),'rtpaudioqosrtt',_0xa831('0xa0'),_0xa831('0xa1'),'sipuri',_0xa831('0xa2'),_0xa831('0xa3'),_0xa831('0xa4'),_0xa831('0xa5'),'memberinterface',_0xa831('0xa6'),_0xa831('0x82'),_0xa831('0xa7'),'memberrealtime'];if(!_[_0xa831('0xa8')](_0x133ba2)&&!_[_0xa831('0xa9')](_0xa4bc71,_0x133ba2)){if(_[_0xa831('0x2e')](this[_0xa831('0x13')][_0xa52b51])){this[_0xa831('0x13')][_0xa52b51]={};}this[_0xa831('0x13')][_0xa52b51][_0x133ba2]=_0x127c7b;}};VoiceQueueReport[_0xa831('0x36')][_0xa831('0x24')]=function(_0x3e6f4f){try{if(this[_0xa831('0x5f')](_0x3e6f4f)){if(this['queueReports'][_0x3e6f4f['uniqueid']]){for(var _0x1207a5=0x0,_0x4fec48={};_0x1207a50x0?_0x5b5552:0x0;this['voiceQueues'][_0x5153d7[_0xda77('0x62')]][_0xda77('0x2f')]=this[_0xda77('0x15')][_0x5153d7[_0xda77('0x62')]][_0xda77('0x2f')]>_[_0xda77('0x64')](_0x5153d7[_0xda77('0x65')])?_['toNumber'](_0x5153d7[_0xda77('0x65')]):this['voiceQueues'][_0x5153d7[_0xda77('0x62')]][_0xda77('0x2f')];this[_0xda77('0x49')](this[_0xda77('0x15')][_0x5153d7['queue']]);}ami[_0xda77('0x41')]('custom:queuesummary',this[_0xda77('0x15')][_0x5153d7['queue']]);}}}catch(_0x28df6e){logger[_0xda77('0x3a')](_0xda77('0x67'),util['inspect'](_0x28df6e,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xda77('0xc')]['syncQueueSummaryComplete']=function(_0x311975){this[_0xda77('0x16')]=!![];};VoiceQueueReport[_0xda77('0xc')]['syncNewExten']=function(_0x57e2a9){};VoiceQueueReport[_0xda77('0xc')][_0xda77('0x1c')]=function(_0x2d3882){try{if(this[_0xda77('0x61')](_0x2d3882)){if(_['isUndefined'](this[_0xda77('0x11')][_0x2d3882[_0xda77('0x68')]])){this[_0xda77('0x11')][_0x2d3882[_0xda77('0x68')]]=[];this[_0xda77('0x13')][_0x2d3882[_0xda77('0x68')]]={};}var _0x4fef75=new QueueReport();_0x4fef75[_0xda77('0x45')]=_0x2d3882[_0xda77('0x62')];_0x4fef75[_0xda77('0x4a')]=this[_0xda77('0x15')][_0x4fef75[_0xda77('0x45')]]&&this[_0xda77('0x15')][_0x4fef75[_0xda77('0x45')]][_0xda77('0x4a')]?this[_0xda77('0x15')][_0x4fef75['name']]['type']||_0xda77('0x4b'):'inbound';_0x4fef75['queue']=_0x2d3882['queue'];_0x4fef75[_0xda77('0x69')]=moment()[_0xda77('0x43')](_0xda77('0x6a'));_0x4fef75[_0xda77('0x6b')]=_0x2d3882['position'];_0x4fef75[_0xda77('0x6c')]=_0x2d3882[_0xda77('0x6c')];_['merge'](_0x4fef75,_[_0xda77('0x6d')](_0x2d3882,_[_0xda77('0x6e')](_0x4fef75)));this[_0xda77('0x11')][_0x2d3882[_0xda77('0x68')]][_0xda77('0x6f')](_0x4fef75);this[_0xda77('0x13')][_0x2d3882['uniqueid']]=_0x4fef75;this[_0xda77('0x42')](_0x4fef75);}}catch(_0xaff419){logger[_0xda77('0x3a')]('[syncQueueCallerJoin][VoiceQueueReport]',util[_0xda77('0x40')](_0xaff419,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xda77('0xc')][_0xda77('0x70')]=function(_0x457068){try{if(this[_0xda77('0x61')](_0x457068)){if(this[_0xda77('0x11')][_0x457068[_0xda77('0x68')]]){var _0x3d634e=_[_0xda77('0x71')](this[_0xda77('0x11')][_0x457068['uniqueid']]);_0x3d634e[_0xda77('0x72')]=![];_0x3d634e[_0xda77('0x73')]=null;_0x3d634e['holdtime']=_0x457068[_0xda77('0x74')];_0x3d634e[_0xda77('0x75')]=_0x457068['originalposition'];_0x3d634e[_0xda77('0x1d')]=!![];_0x3d634e[_0xda77('0x76')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x3d634e[_0xda77('0x77')]='ABANDONED';_0x3d634e[_0xda77('0x78')]=null;this['channels'][_0x457068['uniqueid']]=_0x3d634e;this['emitVoiceQueueChannelRemove'](_0x3d634e);}}}catch(_0x4cd9b4){logger[_0xda77('0x3a')](_0xda77('0x79'),util[_0xda77('0x40')](_0x4cd9b4,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xda77('0xc')][_0xda77('0x7a')]=function(_0x5150a9){try{if(this[_0xda77('0x61')](_0x5150a9)){if(this[_0xda77('0x11')][_0x5150a9[_0xda77('0x68')]]){var _0x2473a6=_[_0xda77('0x71')](this[_0xda77('0x11')][_0x5150a9['uniqueid']]);_0x2473a6[_0xda77('0x7b')]=moment()[_0xda77('0x43')](_0xda77('0x6a'));_0x2473a6[_0xda77('0x7c')]=_0x5150a9[_0xda77('0x7c')];_0x2473a6[_0xda77('0x7d')]=_0x5150a9[_0xda77('0x7d')];this['channels'][_0x5150a9[_0xda77('0x68')]]=_0x2473a6;this[_0xda77('0x42')](_0x2473a6);}}}catch(_0x3a7fef){logger[_0xda77('0x3a')](_0xda77('0x7e'),util['inspect'](_0x3a7fef,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['syncAgentConnect']=function(_0x5c1ad1){try{if(this[_0xda77('0x61')](_0x5c1ad1)){if(this[_0xda77('0x11')][_0x5c1ad1[_0xda77('0x68')]]){var _0x5534f6=_[_0xda77('0x71')](this[_0xda77('0x11')][_0x5c1ad1[_0xda77('0x68')]]);_0x5534f6['queuecallercomplete']=!![];_0x5534f6[_0xda77('0x77')]=_0xda77('0x7f');}}}catch(_0x43bbbb){logger['error']('[syncAgentConnect][VoiceQueueReport]',util[_0xda77('0x40')](_0x43bbbb,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xda77('0x20')]=function(_0x5989bc){try{if(this[_0xda77('0x61')](_0x5989bc)){if(this[_0xda77('0x11')][_0x5989bc['uniqueid']]){var _0x3c87c9=_[_0xda77('0x71')](this[_0xda77('0x11')][_0x5989bc[_0xda77('0x68')]]);_0x3c87c9['queuecallerabandon']=![];_0x3c87c9[_0xda77('0x76')]=null;_0x3c87c9['assigned']=!![];_0x3c87c9[_0xda77('0x78')]=_0x5989bc['membername'];_0x3c87c9['holdtime']=_0x5989bc['holdtime'];_0x3c87c9['queuecallercomplete']=!![];_0x3c87c9[_0xda77('0x80')]=![];_0x3c87c9[_0xda77('0x81')]=null;if(!_0x3c87c9['transfer']){if(_0x5989bc[_0xda77('0x82')]==_0xda77('0x83')){_0x3c87c9[_0xda77('0x77')]='COMPLETED';}else{if(_[_0xda77('0x84')](_0x5989bc[_0xda77('0x38')][_0xda77('0x85')](),'local/')){if(this['queueReports'][_0x5989bc[_0xda77('0x86')]]){var _0x4150b4=_['last'](this[_0xda77('0x11')][_0x5989bc['linkedid']]);_0x4150b4[_0xda77('0x72')]=![];_0x4150b4[_0xda77('0x80')]=!![];_0x4150b4['queuecallerexitAt']=moment(_0x3c87c9[_0xda77('0x69')])[_0xda77('0x87')](_0x5989bc[_0xda77('0x74')],_0xda77('0x88'))[_0xda77('0x43')](_0xda77('0x6a'));_0x4150b4[_0xda77('0x77')]=_0xda77('0x89');_0x4150b4['transfer']=!![];_0x4150b4[_0xda77('0x8a')]=_0xda77('0x8b');_0x4150b4['transferexten']=_0x5989bc[_0xda77('0x8c')];_0x4150b4[_0xda77('0x8d')]=_0x5989bc['uniqueid'];var _0x32542e=this[_0xda77('0x11')][_0x5989bc[_0xda77('0x86')]];this[_0xda77('0x11')][_0x5989bc[_0xda77('0x86')]]=this[_0xda77('0x11')][_0x5989bc[_0xda77('0x68')]];this[_0xda77('0x11')][_0x5989bc[_0xda77('0x68')]]=_0x32542e;}}else{_0x3c87c9[_0xda77('0x77')]=_0xda77('0x8e')+_0x5989bc[_0xda77('0x82')][_0xda77('0x8f')]();}}}this[_0xda77('0x13')][_0x5989bc['uniqueid']]=_0x3c87c9;this[_0xda77('0x47')](_0x3c87c9);}}}catch(_0x497734){logger[_0xda77('0x3a')]('[syncAgentComplete][VoiceQueueReport]',util[_0xda77('0x40')](_0x497734,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xda77('0xc')]['syncVarSet']=function(_0x579255){try{if(this[_0xda77('0x61')](_0x579255)){this[_0xda77('0x90')](_0x579255['uniqueid'],_[_0xda77('0x6e')](_0x579255[_0xda77('0x91')])[0x0],_0x579255[_0xda77('0x92')]);if(this['queueReports'][_0x579255[_0xda77('0x68')]]){var _0xac4327=_[_0xda77('0x71')](this[_0xda77('0x11')][_0x579255[_0xda77('0x68')]]);if(_0xac4327){if(this[_0xda77('0x61')](_0x579255[_0xda77('0x91')])&&this[_0xda77('0x61')](_0x579255[_0xda77('0x91')][_0xda77('0x93')])){switch(_0x579255['value']){case _0xda77('0x94'):_0xac4327[_0xda77('0x80')]=![];_0xac4327[_0xda77('0x81')]=null;break;default:_0xac4327[_0xda77('0x80')]=!![];_0xac4327[_0xda77('0x81')]=moment()[_0xda77('0x43')](_0xda77('0x6a'));_0xac4327[_0xda77('0x7b')]=moment()[_0xda77('0x43')](_0xda77('0x6a'));}_0xac4327['queuecallerabandon']=![];_0xac4327[_0xda77('0x76')]=null;_0xac4327[_0xda77('0x77')]=_0x579255[_0xda77('0x92')];this[_0xda77('0x13')][_0x579255[_0xda77('0x68')]]=_0xac4327;this[_0xda77('0x47')](_0xac4327);}else if(this[_0xda77('0x61')](_0x579255[_0xda77('0x91')])&&this['isNotNull'](_0x579255[_0xda77('0x91')]['queueposition'])){if(!_0xac4327[_0xda77('0x1d')]){_0xac4327[_0xda77('0x80')]=!![];_0xac4327[_0xda77('0x81')]=moment()[_0xda77('0x43')]('YYYY-MM-DD\x20HH:mm:ss');_0xac4327['queuecallerexitreason']=_0xda77('0x95');_0xac4327[_0xda77('0x7b')]=moment()[_0xda77('0x43')](_0xda77('0x6a'));this['channels'][_0x579255[_0xda77('0x68')]]=_0xac4327;}}_0xac4327[_0xda77('0x3c')]=this[_0xda77('0x3c')][_0x579255[_0xda77('0x68')]];}}}}catch(_0x28e738){logger[_0xda77('0x3a')](_0xda77('0x96'),util[_0xda77('0x40')](_0x28e738,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xda77('0xc')][_0xda77('0x90')]=function(_0x4f77b8,_0x2a3b89,_0xe42115){var _0x1657ac=['rtpaudioqos','rtpaudioqosbridged',_0xda77('0x97'),_0xda77('0x98'),_0xda77('0x99'),_0xda77('0x9a'),_0xda77('0x9b'),_0xda77('0x9c'),_0xda77('0x9d'),'sipuri','bridgepeer',_0xda77('0x9e'),_0xda77('0x9f'),'memberdynamic',_0xda77('0xa0'),_0xda77('0xa1'),_0xda77('0xa2'),'memberpenalty','memberrealtime'];if(!_[_0xda77('0x36')](_0x2a3b89)&&!_[_0xda77('0xa3')](_0x1657ac,_0x2a3b89)){if(_[_0xda77('0x2b')](this[_0xda77('0x3c')][_0x4f77b8])){this['variables'][_0x4f77b8]={};}this['variables'][_0x4f77b8][_0x2a3b89]=_0xe42115;}};VoiceQueueReport[_0xda77('0xc')][_0xda77('0x25')]=function(_0x4ba589){try{if(this[_0xda77('0x61')](_0x4ba589)){if(this[_0xda77('0x11')][_0x4ba589[_0xda77('0x68')]]){for(var _0x58c80f=0x0,_0x17ff44={};_0x58c80f=0x0?moment(_0x57d909['endtime'])['diff'](_0x57d909[_0xd461('0x19')],_0xd461('0xf')):null,'data1':_0xd461('0x1c'),'data2':_0x57d909['accountcode'],'data3':_0x57d909['exten'],'data4':_0x57d909[_0xd461('0x1d')]||null,'role':_0xd461('0x14'),'internal':_0x57d909['accountcode']?_[_0xd461('0x16')](_0x57d909[_0xd461('0x15')]):undefined,'uniqueid':_0x57d909[_0xd461('0x17')]},'log':_0xd461('0x6')});}; \ No newline at end of file +var _0x5d90=['lastAssignedTo','isNil','interface','format','SIP/%s','TALKING','queuecallerleaveAt','diff','inbound','queue','agent','accountcode','toNumber','uniqueid','voiceDialReport','CreateMemberReport','membername','starttime','endtime','seconds','outbound','exten','util','../client','queuecallercompleteAt','queuecallerexitAt','Request','voice'];(function(_0x285405,_0x4ede74){var _0x2e9c1d=function(_0x59b179){while(--_0x59b179){_0x285405['push'](_0x285405['shift']());}};_0x2e9c1d(++_0x4ede74);}(_0x5d90,0xbe));var _0x05d9=function(_0x2f07c4,_0x50a530){_0x2f07c4=_0x2f07c4-0x0;var _0x307a5c=_0x5d90[_0x2f07c4];return _0x307a5c;};'use strict';var moment=require('moment');var _=require('lodash');var util=require(_0x05d9('0x0'));var client=require(_0x05d9('0x1'));exports['voiceQueueReport']=function(_0x183c3e){var _0x4a5188=_0x183c3e[_0x05d9('0x2')]||_0x183c3e[_0x05d9('0x3')];return client[_0x05d9('0x4')]('CreateMemberReport',{'body':{'channel':_0x05d9('0x5'),'membername':_0x183c3e[_0x05d9('0x6')],'interface':_[_0x05d9('0x7')](_0x183c3e[_0x05d9('0x8')])?util[_0x05d9('0x9')](_0x05d9('0xa'),_0x183c3e[_0x05d9('0x6')]):_0x183c3e['interface'],'type':_0x05d9('0xb'),'enterAt':_0x183c3e[_0x05d9('0xc')],'exitAt':_0x4a5188,'duration':moment(_0x4a5188)[_0x05d9('0xd')](_0x183c3e[_0x05d9('0xc')],'seconds'),'data1':_0x05d9('0xe'),'data2':_0x183c3e['calleridnum'],'data3':_0x183c3e['exten'],'data4':null,'data5':_0x183c3e[_0x05d9('0xf')],'role':_0x05d9('0x10'),'internal':_0x183c3e[_0x05d9('0x11')]?_[_0x05d9('0x12')](_0x183c3e[_0x05d9('0x11')]):undefined,'uniqueid':_0x183c3e[_0x05d9('0x13')]},'log':'CreateMemberReport'});};exports[_0x05d9('0x14')]=function(_0x182630){return client[_0x05d9('0x4')](_0x05d9('0x15'),{'body':{'channel':'voice','membername':_0x182630[_0x05d9('0x16')],'interface':_0x182630[_0x05d9('0x8')],'type':_0x05d9('0xb'),'enterAt':_0x182630[_0x05d9('0x17')],'exitAt':_0x182630[_0x05d9('0x18')],'duration':moment(_0x182630['endtime'])[_0x05d9('0xd')](_0x182630[_0x05d9('0x17')],_0x05d9('0x19'))>=0x0?moment(_0x182630[_0x05d9('0x18')])[_0x05d9('0xd')](_0x182630['starttime'],_0x05d9('0x19')):null,'data1':_0x05d9('0x1a'),'data2':_0x182630['accountcode'],'data3':_0x182630[_0x05d9('0x1b')],'data4':_0x182630['dialstring']||null,'role':'agent','internal':_0x182630[_0x05d9('0x11')]?_[_0x05d9('0x12')](_0x182630['accountcode']):undefined,'uniqueid':_0x182630[_0x05d9('0x13')]},'log':_0x05d9('0x15')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/template.js b/server/services/ami/rpc/template.js index 34c3d66..eaeab2d 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 _0x422f=['getTemplates','Request','name','html','GetTemplate'];(function(_0x1f7e6e,_0x1b9354){var _0x2fa98f=function(_0x1d279b){while(--_0x1d279b){_0x1f7e6e['push'](_0x1f7e6e['shift']());}};_0x2fa98f(++_0x1b9354);}(_0x422f,0x1c7));var _0xf422=function(_0xde9708,_0x118eac){_0xde9708=_0xde9708-0x0;var _0x58d460=_0x422f[_0xde9708];return _0x58d460;};'use strict';var client=require('../client');exports[_0xf422('0x0')]=function(_0x4c7d20){return function(_0x4566ff){return client[_0xf422('0x1')]('GetTemplate',{'options':{'raw':!![],'attributes':['id',_0xf422('0x2'),_0xf422('0x3')]},'log':_0xf422('0x4')});};}; \ No newline at end of file +var _0x9354=['getTemplates','Request','GetTemplate','name','html'];(function(_0x2ae9ab,_0x54da0a){var _0x5579e1=function(_0x488c5a){while(--_0x488c5a){_0x2ae9ab['push'](_0x2ae9ab['shift']());}};_0x5579e1(++_0x54da0a);}(_0x9354,0x96));var _0x4935=function(_0x1098db,_0x39ba6b){_0x1098db=_0x1098db-0x0;var _0x14f090=_0x9354[_0x1098db];return _0x14f090;};'use strict';var client=require('../client');exports[_0x4935('0x0')]=function(_0xc3c1f3){return function(_0x4896da){return client[_0x4935('0x1')](_0x4935('0x2'),{'options':{'raw':!![],'attributes':['id',_0x4935('0x3'),_0x4935('0x4')]},'log':'GetTemplate'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trigger.js b/server/services/ami/rpc/trigger.js index 7a4ef61..0343ca7 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 _0xac0c=['data5','data6','data7','getTriggers','Request','GetTrigger','name','status','field','operator','value','Condition','AnyConditions','Action','action','data1','data2','data3','data4'];(function(_0x2459b4,_0x56b89a){var _0xf1caab=function(_0x1b413b){while(--_0x1b413b){_0x2459b4['push'](_0x2459b4['shift']());}};_0xf1caab(++_0x56b89a);}(_0xac0c,0xd4));var _0xcac0=function(_0xe822a1,_0x263eb3){_0xe822a1=_0xe822a1-0x0;var _0x9183e4=_0xac0c[_0xe822a1];return _0x9183e4;};'use strict';var client=require('../client');exports[_0xcac0('0x0')]=function(_0x5391ee){return function(_0x4bd359){return client[_0xcac0('0x1')](_0xcac0('0x2'),{'options':{'raw':![],'attributes':['id',_0xcac0('0x3'),'channel',_0xcac0('0x4')],'include':[{'model':'Condition','as':'AllConditions','attributes':['id',_0xcac0('0x5'),_0xcac0('0x6'),_0xcac0('0x7')]},{'model':_0xcac0('0x8'),'as':_0xcac0('0x9'),'attributes':['id',_0xcac0('0x5'),_0xcac0('0x6'),_0xcac0('0x7')]},{'model':_0xcac0('0xa'),'as':'Actions','attributes':['id',_0xcac0('0xb'),_0xcac0('0xc'),_0xcac0('0xd'),_0xcac0('0xe'),_0xcac0('0xf'),_0xcac0('0x10'),_0xcac0('0x11'),_0xcac0('0x12')]}]},'log':_0xcac0('0x2')});};}; \ No newline at end of file +var _0xd685=['name','status','Condition','AllConditions','field','operator','value','AnyConditions','action','data2','data3','data5','data7','../client','getTriggers','Request','GetTrigger'];(function(_0xf48cce,_0x3531e4){var _0x2a5c38=function(_0x22a454){while(--_0x22a454){_0xf48cce['push'](_0xf48cce['shift']());}};_0x2a5c38(++_0x3531e4);}(_0xd685,0xfb));var _0x5d68=function(_0x1d546c,_0x2f037d){_0x1d546c=_0x1d546c-0x0;var _0x5f3f28=_0xd685[_0x1d546c];return _0x5f3f28;};'use strict';var client=require(_0x5d68('0x0'));exports[_0x5d68('0x1')]=function(_0x225610){return function(_0x3e66f4){return client[_0x5d68('0x2')](_0x5d68('0x3'),{'options':{'raw':![],'attributes':['id',_0x5d68('0x4'),'channel',_0x5d68('0x5')],'include':[{'model':_0x5d68('0x6'),'as':_0x5d68('0x7'),'attributes':['id',_0x5d68('0x8'),_0x5d68('0x9'),_0x5d68('0xa')]},{'model':'Condition','as':_0x5d68('0xb'),'attributes':['id',_0x5d68('0x8'),_0x5d68('0x9'),'value']},{'model':'Action','as':'Actions','attributes':['id',_0x5d68('0xc'),'data1',_0x5d68('0xd'),_0x5d68('0xe'),'data4',_0x5d68('0xf'),'data6',_0x5d68('0x10')]}]},'log':'GetTrigger'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trunk.js b/server/services/ami/rpc/trunk.js index 9204fb3..036d77e 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 _0x6f9f=['GetTrunk','name','registry','getTrunks','Request'];(function(_0x350343,_0x256f69){var _0x9afc1c=function(_0x47ab32){while(--_0x47ab32){_0x350343['push'](_0x350343['shift']());}};_0x9afc1c(++_0x256f69);}(_0x6f9f,0xa3));var _0xf6f9=function(_0x57874a,_0x14a2aa){_0x57874a=_0x57874a-0x0;var _0x1d0444=_0x6f9f[_0x57874a];return _0x1d0444;};'use strict';var client=require('../client');exports[_0xf6f9('0x0')]=function(_0x13f469){return function(_0x5a69c4){return client[_0xf6f9('0x1')](_0xf6f9('0x2'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0xf6f9('0x3'),_0xf6f9('0x4')]},'log':_0xf6f9('0x2')});};}; \ No newline at end of file +var _0x8532=['getTrunks','Request','GetTrunk','name','../client'];(function(_0x5c35e9,_0x3db8d3){var _0x381cfa=function(_0x251ebb){while(--_0x251ebb){_0x5c35e9['push'](_0x5c35e9['shift']());}};_0x381cfa(++_0x3db8d3);}(_0x8532,0xc2));var _0x2853=function(_0x568667,_0x3c1c32){_0x568667=_0x568667-0x0;var _0x25f1ef=_0x8532[_0x568667];return _0x25f1ef;};'use strict';var client=require(_0x2853('0x0'));exports[_0x2853('0x1')]=function(_0x1fea3b){return function(_0x5454b6){return client[_0x2853('0x2')](_0x2853('0x3'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0x2853('0x4'),'registry']},'log':_0x2853('0x3')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/user.js b/server/services/ami/rpc/user.js index 961fea8..feb3029 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 _0x4690=['interface','getTelephones','GetUser','telephone','name','accountcode','PauseUser','savePause','saveUnpause','UnpauseUser','getAgent','ShowUser','online','lastLoginAt','../client','getAgents','Request','agent','email','fullname','pauseType','lastPauseAt','voicePause','phone','mobile'];(function(_0x3ce3c,_0x319337){var _0x55a2c9=function(_0x1568d0){while(--_0x1568d0){_0x3ce3c['push'](_0x3ce3c['shift']());}};_0x55a2c9(++_0x319337);}(_0x4690,0x1b7));var _0x0469=function(_0x9b1717,_0x3a23ac){_0x9b1717=_0x9b1717-0x0;var _0x1f91d3=_0x4690[_0x9b1717];return _0x1f91d3;};'use strict';var client=require(_0x0469('0x0'));exports[_0x0469('0x1')]=function(){return function(){return client[_0x0469('0x2')]('GetUser',{'options':{'raw':![],'where':{'role':_0x0469('0x3')},'attributes':['id','name',_0x0469('0x4'),'accountcode',_0x0469('0x5'),'online','lastLoginAt',_0x0469('0x6'),_0x0469('0x7'),_0x0469('0x8'),_0x0469('0x9'),_0x0469('0xa'),_0x0469('0xb')]},'log':_0x0469('0x1')});};};exports[_0x0469('0xc')]=function(){return function(){return client[_0x0469('0x2')](_0x0469('0xd'),{'options':{'raw':!![],'where':{'role':_0x0469('0xe')},'attributes':['id',_0x0469('0xf'),_0x0469('0x10'),'internal']},'log':_0x0469('0xc')});};};exports['savePause']=function(_0x2218f2,_0x53e817,_0x40c6c2){return client[_0x0469('0x2')](_0x0469('0x11'),{'body':{'type':_0x53e817,'uniqueid':_0x40c6c2},'options':{'where':{'id':_0x2218f2['id']}},'log':_0x0469('0x12')});};exports[_0x0469('0x13')]=function(_0x3c5780){return client['Request'](_0x0469('0x14'),{'body':{},'options':{'where':{'id':_0x3c5780['id']}},'log':_0x0469('0x12')});};exports[_0x0469('0x15')]=function(_0x1130de){return client[_0x0469('0x2')](_0x0469('0x16'),{'options':{'raw':![],'where':{'role':'agent','id':_0x1130de},'attributes':['id','name',_0x0469('0x4'),_0x0469('0x10'),_0x0469('0x5'),_0x0469('0x17'),_0x0469('0x18'),_0x0469('0x6'),_0x0469('0x7'),'voicePause','interface']},'log':_0x0469('0x15')});}; \ No newline at end of file +var _0x9569=['accountcode','fullname','lastLoginAt','pauseType','lastPauseAt','mobile','getTelephones','telephone','internal','savePause','saveUnpause','UnpauseUser','getAgent','online','interface','../client','getAgents','Request','GetUser','agent','name','email'];(function(_0x8bf294,_0x1ca4ae){var _0x596021=function(_0x2d1e15){while(--_0x2d1e15){_0x8bf294['push'](_0x8bf294['shift']());}};_0x596021(++_0x1ca4ae);}(_0x9569,0x117));var _0x9956=function(_0x5c7977,_0x2982c2){_0x5c7977=_0x5c7977-0x0;var _0x12d785=_0x9569[_0x5c7977];return _0x12d785;};'use strict';var client=require(_0x9956('0x0'));exports[_0x9956('0x1')]=function(){return function(){return client[_0x9956('0x2')](_0x9956('0x3'),{'options':{'raw':![],'where':{'role':_0x9956('0x4')},'attributes':['id',_0x9956('0x5'),_0x9956('0x6'),_0x9956('0x7'),_0x9956('0x8'),'online',_0x9956('0x9'),_0x9956('0xa'),_0x9956('0xb'),'voicePause','phone',_0x9956('0xc'),'interface']},'log':'getAgents'});};};exports[_0x9956('0xd')]=function(){return function(){return client[_0x9956('0x2')](_0x9956('0x3'),{'options':{'raw':!![],'where':{'role':_0x9956('0xe')},'attributes':['id',_0x9956('0x5'),'accountcode',_0x9956('0xf')]},'log':_0x9956('0xd')});};};exports[_0x9956('0x10')]=function(_0x30a6b1,_0x55c96a,_0x591a75){return client[_0x9956('0x2')]('PauseUser',{'body':{'type':_0x55c96a,'uniqueid':_0x591a75},'options':{'where':{'id':_0x30a6b1['id']}},'log':_0x9956('0x10')});};exports[_0x9956('0x11')]=function(_0x1e1ba9){return client['Request'](_0x9956('0x12'),{'body':{},'options':{'where':{'id':_0x1e1ba9['id']}},'log':_0x9956('0x10')});};exports[_0x9956('0x13')]=function(_0x578c75){return client[_0x9956('0x2')]('ShowUser',{'options':{'raw':![],'where':{'role':_0x9956('0x4'),'id':_0x578c75},'attributes':['id','name',_0x9956('0x6'),_0x9956('0x7'),_0x9956('0x8'),_0x9956('0x14'),'lastLoginAt','pauseType',_0x9956('0xb'),'voicePause',_0x9956('0x15')]},'log':_0x9956('0x13')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceAgentReport.js b/server/services/ami/rpc/voiceAgentReport.js index 5d79c71..032add4 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 _0x62de=['CreateVoiceAgentReport','UpdateVoiceAgentReport','../client','Request'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x62de,0xe2));var _0xe62d=function(_0x1f71e3,_0x3c3ce0){_0x1f71e3=_0x1f71e3-0x0;var _0x34b5ad=_0x62de[_0x1f71e3];return _0x34b5ad;};'use strict';var client=require(_0xe62d('0x0'));exports['create']=function(_0x46a088){return client[_0xe62d('0x1')](_0xe62d('0x2'),{'body':_0x46a088,'log':_0xe62d('0x2')});};exports['update']=function(_0x30b9a2,_0x28f4b1,_0x35fee0){return client[_0xe62d('0x1')](_0xe62d('0x3'),{'body':_0x30b9a2,'options':{'where':{'uniqueid':_0x28f4b1,'interface':_0x35fee0}},'log':'UpdateVoiceAgentReport'});}; \ No newline at end of file +var _0x2f86=['Request','CreateVoiceAgentReport','update','UpdateVoiceAgentReport','../client','create'];(function(_0x533e75,_0x75a298){var _0x552f8e=function(_0x46b1d0){while(--_0x46b1d0){_0x533e75['push'](_0x533e75['shift']());}};_0x552f8e(++_0x75a298);}(_0x2f86,0x10c));var _0x62f8=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0x2f86[_0x9df060];return _0x338dfe;};'use strict';var client=require(_0x62f8('0x0'));exports[_0x62f8('0x1')]=function(_0x28b1dd){return client[_0x62f8('0x2')](_0x62f8('0x3'),{'body':_0x28b1dd,'log':_0x62f8('0x3')});};exports[_0x62f8('0x4')]=function(_0x597d55,_0x4fcfc6,_0x53e251){return client['Request']('UpdateVoiceAgentReport',{'body':_0x597d55,'options':{'where':{'uniqueid':_0x4fcfc6,'interface':_0x53e251}},'log':_0x62f8('0x5')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceCallReport.js b/server/services/ami/rpc/voiceCallReport.js index 4216923..3c29c91 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 _0xa210=['lodash','../client','Request','CreateVoiceCallReport','merge','calleridnum','callerid','GetVoiceCallReport','outbound','format','YYYY-MM-DD\x20HH:mm:ss','endOf','day','type','duration','billableseconds','moment'];(function(_0x33bc0d,_0x57aa0d){var _0x97447a=function(_0x16191a){while(--_0x16191a){_0x33bc0d['push'](_0x33bc0d['shift']());}};_0x97447a(++_0x57aa0d);}(_0xa210,0x164));var _0x0a21=function(_0x4d20e5,_0x3f00f6){_0x4d20e5=_0x4d20e5-0x0;var _0x5497c4=_0xa210[_0x4d20e5];return _0x5497c4;};'use strict';var moment=require(_0x0a21('0x0'));var util=require('util');var _=require(_0x0a21('0x1'));var client=require(_0x0a21('0x2'));exports['create']=function(_0x112b49){return client[_0x0a21('0x3')](_0x0a21('0x4'),{'body':_[_0x0a21('0x5')](_0x112b49,{'source':_0x112b49[_0x0a21('0x6')],'destinationcontext':_0x112b49['context'],'callerid':_0x112b49[_0x0a21('0x7')],'amaflags':'DOCUMENTATION'}),'log':_0x0a21('0x4')});};exports['getVoiceCallReports']=function(){return function(){return client[_0x0a21('0x3')](_0x0a21('0x8'),{'options':{'where':{'type':[_0x0a21('0x9')],'createdAt':{'$between':[moment()['startOf']('day')[_0x0a21('0xa')](_0x0a21('0xb')),moment()[_0x0a21('0xc')](_0x0a21('0xd'))['format'](_0x0a21('0xb'))]}},'attributes':[_0x0a21('0xe'),'disposition',_0x0a21('0xf'),_0x0a21('0x10')]},'log':'GetVoiceCallReports'});};}; \ No newline at end of file +var _0xdcf0=['duration','billableseconds','GetVoiceCallReports','moment','util','lodash','../client','Request','CreateVoiceCallReport','merge','calleridnum','context','callerid','getVoiceCallReports','GetVoiceCallReport','outbound','startOf','day','format','endOf','YYYY-MM-DD\x20HH:mm:ss','type'];(function(_0x176e41,_0x318085){var _0x556545=function(_0xf709d8){while(--_0xf709d8){_0x176e41['push'](_0x176e41['shift']());}};_0x556545(++_0x318085);}(_0xdcf0,0x10b));var _0x0dcf=function(_0x106e3e,_0x286363){_0x106e3e=_0x106e3e-0x0;var _0x4b5966=_0xdcf0[_0x106e3e];return _0x4b5966;};'use strict';var moment=require(_0x0dcf('0x0'));var util=require(_0x0dcf('0x1'));var _=require(_0x0dcf('0x2'));var client=require(_0x0dcf('0x3'));exports['create']=function(_0xa1e11b){return client[_0x0dcf('0x4')](_0x0dcf('0x5'),{'body':_[_0x0dcf('0x6')](_0xa1e11b,{'source':_0xa1e11b[_0x0dcf('0x7')],'destinationcontext':_0xa1e11b[_0x0dcf('0x8')],'callerid':_0xa1e11b[_0x0dcf('0x9')],'amaflags':'DOCUMENTATION'}),'log':_0x0dcf('0x5')});};exports[_0x0dcf('0xa')]=function(){return function(){return client[_0x0dcf('0x4')](_0x0dcf('0xb'),{'options':{'where':{'type':[_0x0dcf('0xc')],'createdAt':{'$between':[moment()[_0x0dcf('0xd')](_0x0dcf('0xe'))[_0x0dcf('0xf')]('YYYY-MM-DD\x20HH:mm:ss'),moment()[_0x0dcf('0x10')](_0x0dcf('0xe'))[_0x0dcf('0xf')](_0x0dcf('0x11'))]}},'attributes':[_0x0dcf('0x12'),'disposition',_0x0dcf('0x13'),_0x0dcf('0x14')]},'log':_0x0dcf('0x15')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceDialReport.js b/server/services/ami/rpc/voiceDialReport.js index 739b125..50ca4e9 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 _0xdb6a=['Request','CreateVoiceDialReport','../client','create'];(function(_0x4a5aad,_0xa25728){var _0x25e555=function(_0x37525c){while(--_0x37525c){_0x4a5aad['push'](_0x4a5aad['shift']());}};_0x25e555(++_0xa25728);}(_0xdb6a,0x76));var _0xadb6=function(_0x3d47d7,_0x472077){_0x3d47d7=_0x3d47d7-0x0;var _0x43bcc1=_0xdb6a[_0x3d47d7];return _0x43bcc1;};'use strict';var client=require(_0xadb6('0x0'));exports[_0xadb6('0x1')]=function(_0x15315d){return client[_0xadb6('0x2')](_0xadb6('0x3'),{'body':_0x15315d,'log':_0xadb6('0x3')});}; \ No newline at end of file +var _0x80e4=['create','CreateVoiceDialReport'];(function(_0xae33d1,_0x4fdce7){var _0x367bad=function(_0x360444){while(--_0x360444){_0xae33d1['push'](_0xae33d1['shift']());}};_0x367bad(++_0x4fdce7);}(_0x80e4,0x13a));var _0x480e=function(_0x577519,_0x346daf){_0x577519=_0x577519-0x0;var _0x5b12f7=_0x80e4[_0x577519];return _0x5b12f7;};'use strict';var client=require('../client');exports[_0x480e('0x0')]=function(_0x12c3d5){return client['Request'](_0x480e('0x1'),{'body':_0x12c3d5,'log':_0x480e('0x1')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceExtension.js b/server/services/ami/rpc/voiceExtension.js index f5f1c4b..ddfe5c0 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 _0x793b=['Request','GetVoiceExtension','exten','../client','getVoiceExtensions'];(function(_0x43b54c,_0x571122){var _0x1fc0f6=function(_0x2d8fee){while(--_0x2d8fee){_0x43b54c['push'](_0x43b54c['shift']());}};_0x1fc0f6(++_0x571122);}(_0x793b,0x189));var _0xb793=function(_0x577a44,_0x2d10e1){_0x577a44=_0x577a44-0x0;var _0x11ed8a=_0x793b[_0x577a44];return _0x11ed8a;};'use strict';var client=require(_0xb793('0x0'));exports[_0xb793('0x1')]=function(){return function(){return client[_0xb793('0x2')](_0xb793('0x3'),{'options':{'raw':!![],'attributes':['id',_0xb793('0x4'),'recordingFormat'],'where':{'VoiceExtensionId':null}},'log':_0xb793('0x1')});};}; \ No newline at end of file +var _0x9a28=['exten','recordingFormat','../client','getVoiceExtensions'];(function(_0xdb27ce,_0x21e4f6){var _0x2a9fcb=function(_0x4cbc6b){while(--_0x4cbc6b){_0xdb27ce['push'](_0xdb27ce['shift']());}};_0x2a9fcb(++_0x21e4f6);}(_0x9a28,0x16a));var _0x89a2=function(_0xc67528,_0x24e2fb){_0xc67528=_0xc67528-0x0;var _0x38e26d=_0x9a28[_0xc67528];return _0x38e26d;};'use strict';var client=require(_0x89a2('0x0'));exports[_0x89a2('0x1')]=function(){return function(){return client['Request']('GetVoiceExtension',{'options':{'raw':!![],'attributes':['id',_0x89a2('0x2'),_0x89a2('0x3')],'where':{'VoiceExtensionId':null}},'log':'getVoiceExtensions'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueue.js b/server/services/ami/rpc/voiceQueue.js index 6389320..f92cabc 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 _0xea63=['dialAMDMaximumWordLength','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','dialQueueProject2','monitor_format','strategy','dialCutDigit','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','Trunk','name','callerid','active','mandatoryDispositionPause','Interval','Intervals','../client','getVoiceQueues','Request','acw','acwTimeout','autopause','type','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateTimeout','dialQueueOptions','dialQueueProject','dialCongestionMaxRetry','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerRetryFrequency','dialTimezone','dialGlobalInterval','dialPrefix','dialCheckDuplicateType','dialAMDActive','dialAMDAfterGreetingSilence','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold'];(function(_0x42e9c2,_0xf71604){var _0x1e7c80=function(_0x4d0109){while(--_0x4d0109){_0x42e9c2['push'](_0x42e9c2['shift']());}};_0x1e7c80(++_0xf71604);}(_0xea63,0xd7));var _0x3ea6=function(_0x1bac4a,_0x4c1b41){_0x1bac4a=_0x1bac4a-0x0;var _0x51fd2f=_0xea63[_0x1bac4a];return _0x51fd2f;};'use strict';var client=require(_0x3ea6('0x0'));exports[_0x3ea6('0x1')]=function(){return function(){return client[_0x3ea6('0x2')]('GetVoiceQueue',{'options':{'raw':![],'attributes':['id','name',_0x3ea6('0x3'),_0x3ea6('0x4'),_0x3ea6('0x5'),'monitor_format',_0x3ea6('0x6'),'dialActive','dialMethod',_0x3ea6('0x7'),_0x3ea6('0x8'),_0x3ea6('0x9'),_0x3ea6('0xa'),_0x3ea6('0xb'),_0x3ea6('0xc'),_0x3ea6('0xd'),'dialOriginateCallerIdNumber',_0x3ea6('0xe'),_0x3ea6('0xf'),'dialQueueTimeout',_0x3ea6('0x10'),_0x3ea6('0x11'),'dialCongestionRetryFrequency',_0x3ea6('0x12'),_0x3ea6('0x13'),'dialNoAnswerMaxRetry',_0x3ea6('0x14'),'dialGlobalMaxRetry',_0x3ea6('0x15'),_0x3ea6('0x16'),_0x3ea6('0x17'),_0x3ea6('0x18'),_0x3ea6('0x19'),'dialAMDInitialSilence','dialAMDGreeting',_0x3ea6('0x1a'),'dialAMDTotalAnalysisTime','dialAMDMinWordLength',_0x3ea6('0x1b'),_0x3ea6('0x1c'),_0x3ea6('0x1d'),_0x3ea6('0x1e'),'timeout','dialRecallMeTimeout',_0x3ea6('0x1f'),_0x3ea6('0x20'),_0x3ea6('0x21'),_0x3ea6('0x22'),_0x3ea6('0x23'),_0x3ea6('0x24'),_0x3ea6('0x25'),'dialRandomLastDigitCallerIdNumber',_0x3ea6('0x26'),_0x3ea6('0x27'),_0x3ea6('0x28'),_0x3ea6('0x29')],'include':[{'model':_0x3ea6('0x2a'),'as':'Trunk','attributes':['id',_0x3ea6('0x2b'),_0x3ea6('0x2c'),_0x3ea6('0x2d')]},{'model':'Pause','as':_0x3ea6('0x2e'),'attributes':['id',_0x3ea6('0x2b')]},{'model':_0x3ea6('0x2a'),'as':'TrunkBackup','attributes':['id','name',_0x3ea6('0x2c'),_0x3ea6('0x2d')]},{'model':_0x3ea6('0x2f'),'as':_0x3ea6('0x2f'),'attributes':['id',_0x3ea6('0x2b')],'include':[{'model':_0x3ea6('0x2f'),'as':_0x3ea6('0x30'),'attributes':['id',_0x3ea6('0x2b'),'interval']}]}]},'log':_0x3ea6('0x1')});};}; \ No newline at end of file +var _0x2f9c=['GetVoiceQueue','name','acw','acwTimeout','autopause','monitor_format','type','dialActive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialGlobalMaxRetry','dialTimezone','dialGlobalInterval','dialPrefix','dialCheckDuplicateType','dialAMDActive','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','timeout','dialRecallMeTimeout','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','dialQueueProject2','strategy','dialCutDigit','mandatoryDisposition','dialPredictiveIntervalMinThreshold','callerid','active','Pause','mandatoryDispositionPause','Trunk','Interval','Intervals','interval','../client','getVoiceQueues','Request'];(function(_0x192203,_0x379b68){var _0x4754fa=function(_0x11a042){while(--_0x11a042){_0x192203['push'](_0x192203['shift']());}};_0x4754fa(++_0x379b68);}(_0x2f9c,0x1c5));var _0xc2f9=function(_0x3eda8b,_0x50bb8d){_0x3eda8b=_0x3eda8b-0x0;var _0x54ffe4=_0x2f9c[_0x3eda8b];return _0x54ffe4;};'use strict';var client=require(_0xc2f9('0x0'));exports[_0xc2f9('0x1')]=function(){return function(){return client[_0xc2f9('0x2')](_0xc2f9('0x3'),{'options':{'raw':![],'attributes':['id',_0xc2f9('0x4'),_0xc2f9('0x5'),_0xc2f9('0x6'),_0xc2f9('0x7'),_0xc2f9('0x8'),_0xc2f9('0x9'),_0xc2f9('0xa'),'dialMethod',_0xc2f9('0xb'),_0xc2f9('0xc'),_0xc2f9('0xd'),_0xc2f9('0xe'),_0xc2f9('0xf'),_0xc2f9('0x10'),_0xc2f9('0x11'),_0xc2f9('0x12'),_0xc2f9('0x13'),_0xc2f9('0x14'),'dialQueueTimeout','dialQueueProject',_0xc2f9('0x15'),_0xc2f9('0x16'),_0xc2f9('0x17'),_0xc2f9('0x18'),_0xc2f9('0x19'),'dialNoAnswerRetryFrequency',_0xc2f9('0x1a'),_0xc2f9('0x1b'),_0xc2f9('0x1c'),_0xc2f9('0x1d'),_0xc2f9('0x1e'),_0xc2f9('0x1f'),'dialAMDInitialSilence','dialAMDGreeting',_0xc2f9('0x20'),_0xc2f9('0x21'),_0xc2f9('0x22'),_0xc2f9('0x23'),_0xc2f9('0x24'),_0xc2f9('0x25'),_0xc2f9('0x26'),_0xc2f9('0x27'),_0xc2f9('0x28'),'dialRecallInQueue',_0xc2f9('0x29'),_0xc2f9('0x2a'),_0xc2f9('0x2b'),_0xc2f9('0x2c'),_0xc2f9('0x8'),_0xc2f9('0x2d'),'dialRandomLastDigitCallerIdNumber',_0xc2f9('0x2e'),_0xc2f9('0x2f'),'dialPredictiveIntervalMaxThreshold',_0xc2f9('0x30')],'include':[{'model':'Trunk','as':'Trunk','attributes':['id','name',_0xc2f9('0x31'),_0xc2f9('0x32')]},{'model':_0xc2f9('0x33'),'as':_0xc2f9('0x34'),'attributes':['id',_0xc2f9('0x4')]},{'model':_0xc2f9('0x35'),'as':'TrunkBackup','attributes':['id',_0xc2f9('0x4'),_0xc2f9('0x31'),'active']},{'model':_0xc2f9('0x36'),'as':_0xc2f9('0x36'),'attributes':['id',_0xc2f9('0x4')],'include':[{'model':_0xc2f9('0x36'),'as':_0xc2f9('0x37'),'attributes':['id',_0xc2f9('0x4'),_0xc2f9('0x38')]}]}]},'log':_0xc2f9('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueReport.js b/server/services/ami/rpc/voiceQueueReport.js index 55b9052..413fecf 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 _0x333e=['uniqueid','queue','queuecallercomplete','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','queuecallerabandon','queuecallerabandonAt','GetVoiceQueueReports','moment','lodash','Request','CreateVoiceQueueReport','getVoiceQueueReports','GetVoiceQueueReport','startOf','day','YYYY-MM-DD\x20HH:mm:ss','endOf'];(function(_0x4a9d31,_0x19dcb2){var _0x52d6b7=function(_0x4f6752){while(--_0x4f6752){_0x4a9d31['push'](_0x4a9d31['shift']());}};_0x52d6b7(++_0x19dcb2);}(_0x333e,0x113));var _0xe333=function(_0x2ac61f,_0x3f0ec0){_0x2ac61f=_0x2ac61f-0x0;var _0x5df70a=_0x333e[_0x2ac61f];return _0x5df70a;};'use strict';var moment=require(_0xe333('0x0'));var _=require(_0xe333('0x1'));var client=require('../client');exports['create']=function(_0x1ca41c){return client[_0xe333('0x2')](_0xe333('0x3'),{'body':_0x1ca41c,'log':_0xe333('0x3')});};exports[_0xe333('0x4')]=function(){return function(){return client['Request'](_0xe333('0x5'),{'options':{'where':{'createdAt':{'$between':[moment()[_0xe333('0x6')](_0xe333('0x7'))['format'](_0xe333('0x8')),moment()[_0xe333('0x9')](_0xe333('0x7'))['format'](_0xe333('0x8'))]}},'attributes':[_0xe333('0xa'),_0xe333('0xb'),'queuecallerjoinAt','queuecallerleaveAt',_0xe333('0xc'),_0xe333('0xd'),_0xe333('0xe'),_0xe333('0xf'),_0xe333('0x10'),_0xe333('0x11')]},'log':_0xe333('0x12')});};}; \ No newline at end of file +var _0xb100=['queuecallerjoinAt','queuecallerleaveAt','queuecallerexit','queuecallerexitAt','GetVoiceQueueReports','moment','lodash','CreateVoiceQueueReport','getVoiceQueueReports','Request','GetVoiceQueueReport','format','YYYY-MM-DD\x20HH:mm:ss','endOf','day','queue'];(function(_0xa24c0,_0x323566){var _0x3cc94a=function(_0x5387cd){while(--_0x5387cd){_0xa24c0['push'](_0xa24c0['shift']());}};_0x3cc94a(++_0x323566);}(_0xb100,0x75));var _0x0b10=function(_0x2da45d,_0x35397b){_0x2da45d=_0x2da45d-0x0;var _0x1012a0=_0xb100[_0x2da45d];return _0x1012a0;};'use strict';var moment=require(_0x0b10('0x0'));var _=require(_0x0b10('0x1'));var client=require('../client');exports['create']=function(_0x29cbcf){return client['Request'](_0x0b10('0x2'),{'body':_0x29cbcf,'log':_0x0b10('0x2')});};exports[_0x0b10('0x3')]=function(){return function(){return client[_0x0b10('0x4')](_0x0b10('0x5'),{'options':{'where':{'createdAt':{'$between':[moment()['startOf']('day')[_0x0b10('0x6')](_0x0b10('0x7')),moment()[_0x0b10('0x8')](_0x0b10('0x9'))[_0x0b10('0x6')]('YYYY-MM-DD\x20HH:mm:ss')]}},'attributes':['uniqueid',_0x0b10('0xa'),_0x0b10('0xb'),_0x0b10('0xc'),'queuecallercomplete','queuecallercompleteAt',_0x0b10('0xd'),_0x0b10('0xe'),'queuecallerabandon','queuecallerabandonAt']},'log':_0x0b10('0xf')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueRt.js b/server/services/ami/rpc/voiceQueueRt.js index 037b70b..2fc0a38 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 _0x8c35=['GetVoiceQueueRtPauses','getVoiceQueueRtPauses'];(function(_0x433a86,_0x175b5c){var _0x23000c=function(_0x4b1fa0){while(--_0x4b1fa0){_0x433a86['push'](_0x433a86['shift']());}};_0x23000c(++_0x175b5c);}(_0x8c35,0xa9));var _0x58c3=function(_0x2e4580,_0x514264){_0x2e4580=_0x2e4580-0x0;var _0x32df9d=_0x8c35[_0x2e4580];return _0x32df9d;};'use strict';var client=require('../client');exports[_0x58c3('0x0')]=function(_0x34ee7f){return function(){return client['Request'](_0x58c3('0x1'),{'options':{'where':{'VoiceQueueId':_0x34ee7f,'paused':!![]},'raw':!![]},'log':_0x58c3('0x0')});};}; \ No newline at end of file +var _0x3837=['../client','getVoiceQueueRtPauses','GetVoiceQueueRtPauses'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0x3837,0x162));var _0x7383=function(_0x343b8c,_0x31f553){_0x343b8c=_0x343b8c-0x0;var _0x22e714=_0x3837[_0x343b8c];return _0x22e714;};'use strict';var client=require(_0x7383('0x0'));exports[_0x7383('0x1')]=function(_0x4e2791){return function(){return client['Request'](_0x7383('0x2'),{'options':{'where':{'VoiceQueueId':_0x4e2791,'paused':!![]},'raw':!![]},'log':_0x7383('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceRecording.js b/server/services/ami/rpc/voiceRecording.js index 1cf1873..4a6051b 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 _0x18d2=['merge','monitorFilename','lodash','../client','create','Request','CreateVoiceRecording'];(function(_0x1e3c16,_0x372caa){var _0x47a0c9=function(_0x47f81d){while(--_0x47f81d){_0x1e3c16['push'](_0x1e3c16['shift']());}};_0x47a0c9(++_0x372caa);}(_0x18d2,0x1a6));var _0x218d=function(_0x193b22,_0x51bda6){_0x193b22=_0x193b22-0x0;var _0x1d0a52=_0x18d2[_0x193b22];return _0x1d0a52;};'use strict';var _=require(_0x218d('0x0'));var client=require(_0x218d('0x1'));exports[_0x218d('0x2')]=function(_0x134d5e){return client[_0x218d('0x3')](_0x218d('0x4'),{'body':_[_0x218d('0x5')](_0x134d5e,{'value':_0x134d5e[_0x218d('0x6')]}),'log':'CreateVoiceRecording'});}; \ No newline at end of file +var _0x16b2=['Request','CreateVoiceRecording','merge','lodash','../client'];(function(_0x35d096,_0x1230a0){var _0x511bad=function(_0x169eb1){while(--_0x169eb1){_0x35d096['push'](_0x35d096['shift']());}};_0x511bad(++_0x1230a0);}(_0x16b2,0x107));var _0x216b=function(_0x6dfbaa,_0x31eede){_0x6dfbaa=_0x6dfbaa-0x0;var _0xfbe02=_0x16b2[_0x6dfbaa];return _0xfbe02;};'use strict';var _=require(_0x216b('0x0'));var client=require(_0x216b('0x1'));exports['create']=function(_0x14c343){return client[_0x216b('0x2')](_0x216b('0x3'),{'body':_[_0x216b('0x4')](_0x14c343,{'value':_0x14c343['monitorFilename']}),'log':_0x216b('0x3')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceTransferReport.js b/server/services/ami/rpc/voiceTransferReport.js index e62b67e..5ae4a71 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 _0x2cd5=['origtransferercontext','origtransfererexten','../client','blindTransfer','Request','CreateVoiceTransferReport','result','transferercalleridnum','transferercalleridname','transfererconnectedlinenum','transfereraccountcode','transferercontext','transfererexten','transfererlinkedid','transfereechannel','transfereecalleridname','transfereeconnectedlinenum','transfereeaccountcode','transfereelinkedid','isexternal','extension','blind','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','transfertargetchannel','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten'];(function(_0xc8a931,_0x260690){var _0x28bd27=function(_0x591b9f){while(--_0x591b9f){_0xc8a931['push'](_0xc8a931['shift']());}};_0x28bd27(++_0x260690);}(_0x2cd5,0x14f));var _0x52cd=function(_0x3d53e5,_0x375352){_0x3d53e5=_0x3d53e5-0x0;var _0x1be6b3=_0x2cd5[_0x3d53e5];return _0x1be6b3;};'use strict';var client=require(_0x52cd('0x0'));exports[_0x52cd('0x1')]=function(_0x19b336){return client[_0x52cd('0x2')](_0x52cd('0x3'),{'body':{'result':_0x19b336[_0x52cd('0x4')],'transfererchannel':_0x19b336['transfererchannel'],'transferercalleridnum':_0x19b336[_0x52cd('0x5')],'transferercalleridname':_0x19b336[_0x52cd('0x6')],'transfererconnectedlinenum':_0x19b336[_0x52cd('0x7')],'transfererconnectedlinename':_0x19b336['transfererconnectedlinename'],'transfereraccountcode':_0x19b336[_0x52cd('0x8')],'transferercontext':_0x19b336[_0x52cd('0x9')],'transfererexten':_0x19b336[_0x52cd('0xa')],'transfererlinkedid':_0x19b336[_0x52cd('0xb')],'transfereechannel':_0x19b336[_0x52cd('0xc')],'transfereecalleridnum':_0x19b336['transfereecalleridnum'],'transfereecalleridname':_0x19b336[_0x52cd('0xd')],'transfereeconnectedlinenum':_0x19b336[_0x52cd('0xe')],'transfereeconnectedlinename':_0x19b336['transfereeconnectedlinename'],'transfereeaccountcode':_0x19b336[_0x52cd('0xf')],'transfereecontext':_0x19b336['transfereecontext'],'transfereeexten':_0x19b336['transfereeexten'],'transfereelinkedid':_0x19b336[_0x52cd('0x10')],'isexternal':_0x19b336[_0x52cd('0x11')],'context':_0x19b336['context'],'extension':_0x19b336[_0x52cd('0x12')],'type':_0x52cd('0x13')},'log':_0x52cd('0x3')});};exports['attendedTransfer']=function(_0x4df9c7){return client[_0x52cd('0x2')](_0x52cd('0x3'),{'body':{'result':_0x4df9c7[_0x52cd('0x4')],'transfererchannel':_0x4df9c7['origtransfererchannel'],'transferercalleridnum':_0x4df9c7[_0x52cd('0x14')],'transferercalleridname':_0x4df9c7[_0x52cd('0x15')],'transfererconnectedlinenum':_0x4df9c7[_0x52cd('0x16')],'transfererconnectedlinename':_0x4df9c7[_0x52cd('0x17')],'transfereraccountcode':_0x4df9c7[_0x52cd('0x18')],'transferercontext':_0x4df9c7[_0x52cd('0x19')],'transfererexten':_0x4df9c7[_0x52cd('0x1a')],'transfererlinkedid':_0x4df9c7[_0x52cd('0x1b')],'transfereechannel':_0x4df9c7[_0x52cd('0x1c')],'transfereecalleridnum':_0x4df9c7['transfertargetcalleridnum'],'transfereecalleridname':_0x4df9c7[_0x52cd('0x1d')],'transfereeconnectedlinenum':_0x4df9c7[_0x52cd('0x1e')],'transfereeconnectedlinename':_0x4df9c7[_0x52cd('0x1f')],'transfereeaccountcode':_0x4df9c7[_0x52cd('0x20')],'transfereecontext':_0x4df9c7[_0x52cd('0x21')],'transfereeexten':_0x4df9c7[_0x52cd('0x22')],'transfereelinkedid':_0x4df9c7['transfertargetlinkedid'],'isexternal':_0x4df9c7[_0x52cd('0x11')],'context':_0x4df9c7[_0x52cd('0x23')],'extension':_0x4df9c7[_0x52cd('0x24')],'type':'attended'},'log':_0x52cd('0x3')});}; \ No newline at end of file +var _0x9a58=['result','transfererchannel','transferercalleridnum','transfererconnectedlinenum','transfereraccountcode','transferercontext','transfererexten','transfererlinkedid','transfereechannel','transfereecalleridname','transfereeconnectedlinenum','transfereeconnectedlinename','transfereeaccountcode','transfereeexten','isexternal','extension','blind','attendedTransfer','origtransfererchannel','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','transfertargetchannel','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetcontext','origtransfererexten','attended','../client','Request','CreateVoiceTransferReport'];(function(_0x562d10,_0x47d488){var _0x3c4786=function(_0x5d95ca){while(--_0x5d95ca){_0x562d10['push'](_0x562d10['shift']());}};_0x3c4786(++_0x47d488);}(_0x9a58,0xdb));var _0x89a5=function(_0xd73d53,_0x598443){_0xd73d53=_0xd73d53-0x0;var _0x560148=_0x9a58[_0xd73d53];return _0x560148;};'use strict';var client=require(_0x89a5('0x0'));exports['blindTransfer']=function(_0x394d70){return client[_0x89a5('0x1')](_0x89a5('0x2'),{'body':{'result':_0x394d70[_0x89a5('0x3')],'transfererchannel':_0x394d70[_0x89a5('0x4')],'transferercalleridnum':_0x394d70[_0x89a5('0x5')],'transferercalleridname':_0x394d70['transferercalleridname'],'transfererconnectedlinenum':_0x394d70[_0x89a5('0x6')],'transfererconnectedlinename':_0x394d70['transfererconnectedlinename'],'transfereraccountcode':_0x394d70[_0x89a5('0x7')],'transferercontext':_0x394d70[_0x89a5('0x8')],'transfererexten':_0x394d70[_0x89a5('0x9')],'transfererlinkedid':_0x394d70[_0x89a5('0xa')],'transfereechannel':_0x394d70[_0x89a5('0xb')],'transfereecalleridnum':_0x394d70['transfereecalleridnum'],'transfereecalleridname':_0x394d70[_0x89a5('0xc')],'transfereeconnectedlinenum':_0x394d70[_0x89a5('0xd')],'transfereeconnectedlinename':_0x394d70[_0x89a5('0xe')],'transfereeaccountcode':_0x394d70[_0x89a5('0xf')],'transfereecontext':_0x394d70['transfereecontext'],'transfereeexten':_0x394d70[_0x89a5('0x10')],'transfereelinkedid':_0x394d70['transfereelinkedid'],'isexternal':_0x394d70[_0x89a5('0x11')],'context':_0x394d70['context'],'extension':_0x394d70[_0x89a5('0x12')],'type':_0x89a5('0x13')},'log':_0x89a5('0x2')});};exports[_0x89a5('0x14')]=function(_0x56a53c){return client[_0x89a5('0x1')](_0x89a5('0x2'),{'body':{'result':_0x56a53c[_0x89a5('0x3')],'transfererchannel':_0x56a53c[_0x89a5('0x15')],'transferercalleridnum':_0x56a53c[_0x89a5('0x16')],'transferercalleridname':_0x56a53c[_0x89a5('0x17')],'transfererconnectedlinenum':_0x56a53c[_0x89a5('0x18')],'transfererconnectedlinename':_0x56a53c[_0x89a5('0x19')],'transfereraccountcode':_0x56a53c['origtransfereraccountcode'],'transferercontext':_0x56a53c[_0x89a5('0x1a')],'transfererexten':_0x56a53c[_0x89a5('0x1b')],'transfererlinkedid':_0x56a53c[_0x89a5('0x1c')],'transfereechannel':_0x56a53c[_0x89a5('0x1d')],'transfereecalleridnum':_0x56a53c[_0x89a5('0x1e')],'transfereecalleridname':_0x56a53c[_0x89a5('0x1f')],'transfereeconnectedlinenum':_0x56a53c[_0x89a5('0x20')],'transfereeconnectedlinename':_0x56a53c[_0x89a5('0x21')],'transfereeaccountcode':_0x56a53c['transfertargetaccountcode'],'transfereecontext':_0x56a53c[_0x89a5('0x22')],'transfereeexten':_0x56a53c['transfertargetexten'],'transfereelinkedid':_0x56a53c['transfertargetlinkedid'],'isexternal':_0x56a53c[_0x89a5('0x11')],'context':_0x56a53c['origtransferercontext'],'extension':_0x56a53c[_0x89a5('0x23')],'type':_0x89a5('0x24')},'log':_0x89a5('0x2')});}; \ No newline at end of file diff --git a/server/services/ami/server/index.js b/server/services/ami/server/index.js index d0226dd..180d6f1 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 _0x72a7=['RPC\x20listening\x20on\x20port:','lodash','util','jayson/promise','validate','bluebird','moment','../properties','../ami','listen','format','%s/%s','SIP','name','timers','timer','updateAcw','agents','updateStatusRealtime','pause','QueuePause','isConnected','error','asterisk','username','ami\x20disconnected','join','action','then','catch','message','pick','command','Action','content','voiceQueues','hasOwnProperty','strategy','answered','available','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','talking','total','type','waiting','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','callerid','Interval','channels','voicechannel','length','map','find','channel','%s.%s','uniqueid','wav','MixMonitor','ai(mixmonitorid)','monitors','/var/spool/asterisk/monitor/','toLowerCase','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','status','rec','MixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','resolve','StopMixMonitor','destinationchannel','stop','filename','StopMixMonitor\x20Success','voicequeuechannel','queueChannels','voicequeuechannelhangup','Redirect','exten','context','values','telephones','outboundChannels','outbound','campaigns','run','event','Event\x20name\x20mandatory','emit','send','checkAfterSend','server','log'];(function(_0x149152,_0x2fedc2){var _0x4eac31=function(_0x22c46f){while(--_0x22c46f){_0x149152['push'](_0x149152['shift']());}};_0x4eac31(++_0x2fedc2);}(_0x72a7,0x89));var _0x772a=function(_0x43e469,_0x2ac0ec){_0x43e469=_0x43e469-0x0;var _0x260d98=_0x72a7[_0x43e469];return _0x260d98;};'use strict';var _=require(_0x772a('0x0'));var util=require(_0x772a('0x1'));var jayson=require(_0x772a('0x2'));var schema=require(_0x772a('0x3'));var BPromise=require(_0x772a('0x4'));var moment=require(_0x772a('0x5'));var config=require('../../../config/environment');var properties=require(_0x772a('0x6'));var ami=require(_0x772a('0x7'));exports[_0x772a('0x8')]=function(_0x36a7c4,_0x50a02,_0x30a2e4){return new BPromise(function(_0x3d0cb5,_0x3c6e4a){var _0x48b5d4={'QueuePause':function(_0x440608){return new Promise(function(_0x35aff0,_0x380083){var _0x48a309=util[_0x772a('0x9')](_0x772a('0xa'),_0x772a('0xb'),_0x440608[_0x772a('0xc')]);if(_0x36a7c4[_0x772a('0xd')]&&_0x36a7c4[_0x772a('0xd')][_0x48a309]&&_0x36a7c4[_0x772a('0xd')][_0x48a309][_0x772a('0xe')]){_0x36a7c4[_0x772a('0xd')][_0x48a309][_0x772a('0xf')]();}if(_0x36a7c4[_0x772a('0x10')][_0x48a309]){_0x36a7c4[_0x772a('0x10')][_0x48a309][_0x772a('0x11')]({'statePause':_0x440608[_0x772a('0x12')]?!![]:![]});}_0x35aff0({'code':0xc8,'message':_0x772a('0x13')});});},'Reload':function(_0x5ff0cf){var _0x35e9a3=this;return new Promise(function(_0x593058,_0x27868c){if(ami[_0x772a('0x14')]()==![]){return _0x27868c(_0x35e9a3[_0x772a('0x15')](0x1f4,[config[_0x772a('0x16')]['ip'],config[_0x772a('0x16')][_0x772a('0x17')],_0x772a('0x18')][_0x772a('0x19')]('\x20')));}_0x5ff0cf=_['pick'](_0x5ff0cf,_['keys'](properties['module']));_0x5ff0cf[_0x772a('0x1a')]='Reload';return ami['Action'](_0x5ff0cf)[_0x772a('0x1b')](function(_0x1b8ea1){_0x593058({'code':0xc8,'message':_0x1b8ea1['message']});})[_0x772a('0x1c')](function(_0xfa535f){_0x27868c(_0x35e9a3[_0x772a('0x15')](0x1f5,_0xfa535f[_0x772a('0x1d')]));});});},'Command':function(_0x22e517){var _0x18aa39=this;return new Promise(function(_0x1f0db4,_0x1c4b98){if(ami[_0x772a('0x14')]()==![]){return _0x1c4b98(_0x18aa39['error'](0x1f4,[config[_0x772a('0x16')]['ip'],config['asterisk'][_0x772a('0x17')],'ami\x20disconnected']['join']('\x20')));}_0x22e517=_[_0x772a('0x1e')](_0x22e517,_0x772a('0x1f'));_0x22e517[_0x772a('0x1a')]='Command';return ami[_0x772a('0x20')](_0x22e517)[_0x772a('0x1b')](function(_0x347d1d){_0x1f0db4({'code':0xc8,'message':_0x347d1d[_0x772a('0x21')]});})[_0x772a('0x1c')](function(_0x80a2b8){_0x1c4b98(_0x18aa39[_0x772a('0x15')](0x1f5,_0x80a2b8['message']));});});},'VoiceQueues':function(_0x21b431){return new Promise(function(_0x2bdf06,_0x3da006){var _0x25baee=[];for(var _0x41000f in _0x36a7c4[_0x772a('0x22')]){if(_0x36a7c4[_0x772a('0x22')][_0x772a('0x23')](_0x41000f)){var _0x2a9e8b=_0x36a7c4[_0x772a('0x22')][_0x41000f];var _0x2b9b41={'id':_0x2a9e8b['id'],'name':_0x2a9e8b[_0x772a('0xc')],'strategy':_0x2a9e8b[_0x772a('0x24')],'answered':_0x2a9e8b[_0x772a('0x25')],'available':_0x2a9e8b[_0x772a('0x26')],'loggedIn':_0x2a9e8b[_0x772a('0x27')],'pTalking':_0x2a9e8b[_0x772a('0x28')],'sumBillable':_0x2a9e8b[_0x772a('0x29')],'sumDuration':_0x2a9e8b[_0x772a('0x2a')],'sumHoldTime':_0x2a9e8b[_0x772a('0x2b')]||0x0,'talking':_0x2a9e8b[_0x772a('0x2c')],'total':_0x2a9e8b[_0x772a('0x2d')],'type':_0x2a9e8b[_0x772a('0x2e')],'unmanaged':_0x2a9e8b['unmanaged'],'abandoned':_0x2a9e8b['abandoned'],'waiting':_0x2a9e8b[_0x772a('0x2f')],'loggedInDb':_0x2a9e8b[_0x772a('0x30')]};if(_0x2a9e8b[_0x772a('0x2e')]==='outbound'){_0x2b9b41[_0x772a('0x31')]=_0x2a9e8b[_0x772a('0x31')];_0x2b9b41[_0x772a('0x32')]=_0x2a9e8b[_0x772a('0x32')];_0x2b9b41['dialOriginateCallerIdName']=_0x2a9e8b[_0x772a('0x33')];_0x2b9b41[_0x772a('0x34')]=_0x2a9e8b[_0x772a('0x34')];_0x2b9b41[_0x772a('0x35')]=_0x2a9e8b[_0x772a('0x35')];_0x2b9b41[_0x772a('0x36')]=_0x2a9e8b[_0x772a('0x36')];_0x2b9b41[_0x772a('0x37')]=_0x2a9e8b[_0x772a('0x37')];_0x2b9b41['outboundAnswerCallsDay']=_0x2a9e8b[_0x772a('0x38')];_0x2b9b41[_0x772a('0x39')]=_0x2a9e8b[_0x772a('0x39')];_0x2b9b41[_0x772a('0x3a')]=_0x2a9e8b[_0x772a('0x3a')];_0x2b9b41[_0x772a('0x3b')]=_0x2a9e8b[_0x772a('0x3b')];_0x2b9b41[_0x772a('0x3c')]=_0x2a9e8b[_0x772a('0x3c')];_0x2b9b41[_0x772a('0x3d')]=_0x2a9e8b[_0x772a('0x3d')];_0x2b9b41[_0x772a('0x3e')]=_0x2a9e8b['outboundDropCallsDayTimeout'];_0x2b9b41['outboundNoAnswerCallsDay']=_0x2a9e8b[_0x772a('0x3f')];_0x2b9b41[_0x772a('0x40')]=_0x2a9e8b[_0x772a('0x40')];_0x2b9b41[_0x772a('0x41')]=_0x2a9e8b[_0x772a('0x41')];_0x2b9b41[_0x772a('0x42')]=_0x2a9e8b[_0x772a('0x42')];_0x2b9b41[_0x772a('0x43')]=_0x2a9e8b[_0x772a('0x43')];_0x2b9b41['outboundUnknownCallsDay']=_0x2a9e8b['outboundUnknownCallsDay'];_0x2b9b41[_0x772a('0x44')]=_0x2a9e8b[_0x772a('0x44')];_0x2b9b41[_0x772a('0x45')]=_0x2a9e8b[_0x772a('0x45')];_0x2b9b41[_0x772a('0x46')]=_0x2a9e8b[_0x772a('0x46')];_0x2b9b41[_0x772a('0x47')]=_0x2a9e8b['predictiveIntervalDroppedCallsCallersExit'];_0x2b9b41[_0x772a('0x48')]=_0x2a9e8b[_0x772a('0x48')];_0x2b9b41[_0x772a('0x49')]=_0x2a9e8b[_0x772a('0x49')];_0x2b9b41[_0x772a('0x4a')]=_0x2a9e8b[_0x772a('0x4a')];_0x2b9b41[_0x772a('0x4b')]=_0x2a9e8b[_0x772a('0x4b')];_0x2b9b41[_0x772a('0x4c')]=_0x2a9e8b[_0x772a('0x4c')];_0x2b9b41['predictiveIntervalPauses']=_0x2a9e8b['predictiveIntervalPauses'];_0x2b9b41[_0x772a('0x4d')]=_0x2a9e8b[_0x772a('0x4d')];_0x2b9b41['predictiveIntervalTotalCalls']=_0x2a9e8b[_0x772a('0x4e')];_0x2b9b41[_0x772a('0x1d')]=_0x2a9e8b[_0x772a('0x1d')];_0x2b9b41[_0x772a('0x4f')]=_0x2a9e8b[_0x772a('0x4f')];_0x2b9b41[_0x772a('0x50')]=_0x2a9e8b[_0x772a('0x50')];_0x2b9b41['erlangCallToSecond']=_0x2a9e8b[_0x772a('0x51')];_0x2b9b41[_0x772a('0x52')]=_0x2a9e8b[_0x772a('0x52')];_0x2b9b41['erlangBusyFactor']=_0x2a9e8b[_0x772a('0x53')];_0x2b9b41[_0x772a('0x54')]=_0x2a9e8b['startPredictive'];_0x2b9b41[_0x772a('0x55')]=_0x2a9e8b['startProgressive'];}if(_0x2a9e8b[_0x772a('0x56')]){_0x2b9b41[_0x772a('0x56')]={'id':_0x2a9e8b[_0x772a('0x56')]['id'],'name':_0x2a9e8b[_0x772a('0x56')][_0x772a('0xc')],'active':_0x2a9e8b[_0x772a('0x56')][_0x772a('0x57')],'callerid':_0x2a9e8b[_0x772a('0x56')][_0x772a('0x58')]};}if(_0x2a9e8b[_0x772a('0x59')]){_0x2b9b41[_0x772a('0x59')]={'id':_0x2a9e8b[_0x772a('0x59')]['id'],'name':_0x2a9e8b[_0x772a('0x59')][_0x772a('0xc')]};}_0x25baee['push'](_0x2b9b41);}}_0x2bdf06({'count':_0x25baee['length'],'rows':_0x25baee});});},'VoiceChannels':function(_0x1eb1c5){return new Promise(function(_0x2c5f20,_0x57c4af){var _0x534399=_['values'](_0x36a7c4[_0x772a('0x5a')]);_0x2c5f20({'count':_0x534399['length'],'rows':_0x534399});});},'VoiceChannelMixMonitor':function(_0x3e0f32){var _0x1fee8f=this;return new Promise(function(_0x497b9f,_0x5505d9){if(ami[_0x772a('0x14')]()==![]){return _0x5505d9(_0x1fee8f[_0x772a('0x15')](0x1f4,[config['asterisk']['ip'],config[_0x772a('0x16')][_0x772a('0x17')],_0x772a('0x18')][_0x772a('0x19')]('\x20')));}var _0xe2e2ac=schema(properties[_0x772a('0x5b')])['validate'](_0x3e0f32);if(_0xe2e2ac[_0x772a('0x5c')]>0x0){return _0x5505d9(_0x1fee8f[_0x772a('0x15')](0x1f4,_[_0x772a('0x5d')](_0xe2e2ac,_0x772a('0x1d'))[_0x772a('0x19')](',\x20')));}var _0x3b35f9=_[_0x772a('0x5e')](_0x36a7c4[_0x772a('0x5a')],{'uniqueid':_0x3e0f32['uniqueid']});if(_0x3b35f9&&_0x3b35f9[_0x772a('0x5f')]){var _0x3ecabe=util[_0x772a('0x9')](_0x772a('0x60'),_0x3e0f32['filename']||_0x3e0f32[_0x772a('0x61')],_0x3e0f32['format']||_0x772a('0x62'));return ami[_0x772a('0x20')]({'action':_0x772a('0x63'),'channel':_0x3b35f9[_0x772a('0x5f')],'file':_0x3ecabe,'options':_0x772a('0x64')})[_0x772a('0x1b')](function(_0x21aa85){var _0x1d3c9b=_[_0x772a('0x5e')](_0x3b35f9[_0x772a('0x65')],{'filename':_0x772a('0x66')+_0x3ecabe[_0x772a('0x67')]()});if(_['isNil'](_0x1d3c9b)){_0x3b35f9[_0x772a('0x65')]['push']({'filename':_0x772a('0x66')+_0x3ecabe[_0x772a('0x67')](),'createdAt':moment()[_0x772a('0x9')](_0x772a('0x68')),'mixmonitorid':_0x21aa85[_0x772a('0x69')],'status':'rec'});}else{_0x1d3c9b[_0x772a('0x69')]=_0x21aa85[_0x772a('0x69')];_0x1d3c9b[_0x772a('0x6a')]=_0x772a('0x6b');}_0x497b9f({'code':0xc8,'message':[_0x3e0f32[_0x772a('0x61')],_0x772a('0x6c'),_0x21aa85[_0x772a('0x69')]]['join']('\x20'),'mixmonitorid':_0x21aa85['mixmonitorid']});})[_0x772a('0x1c')](function(_0x5dd5f3){_0x5505d9(_0x1fee8f['error'](0x1f5,[_0x3e0f32[_0x772a('0x61')],_0x5dd5f3[_0x772a('0x1d')][_0x772a('0x67')]()][_0x772a('0x19')]('\x20')));});}else{return _0x5505d9(_0x1fee8f[_0x772a('0x15')](0x1f5,_0x772a('0x6d')));}});},'VoiceChannelStopMixMonitor':function(_0x2e0658){var _0x169282=this;return new Promise(function(_0x926905,_0x59334b){if(ami[_0x772a('0x14')]()==![]){return _0x59334b(_0x169282[_0x772a('0x15')](0x1f4,[config[_0x772a('0x16')]['ip'],config[_0x772a('0x16')][_0x772a('0x17')],_0x772a('0x18')][_0x772a('0x19')]('\x20')));}var _0x499ffd=schema(properties['voicechannel'])[_0x772a('0x3')](_0x2e0658);if(_0x499ffd[_0x772a('0x5c')]>0x0){return _0x59334b(_0x169282[_0x772a('0x15')](0x1f4,_[_0x772a('0x5d')](_0x499ffd,_0x772a('0x1d'))[_0x772a('0x19')](',\x20')));}var _0x480617=_['find'](_0x36a7c4[_0x772a('0x5a')],{'uniqueid':_0x2e0658['uniqueid']});if(_0x480617){return BPromise[_0x772a('0x6e')]()[_0x772a('0x1b')](function(){if(_0x480617[_0x772a('0x5f')]){return ami['Action']({'action':_0x772a('0x6f'),'channel':_0x480617['channel'],'mixmonitorid':_0x2e0658[_0x772a('0x69')]})[_0x772a('0x1c')](function(_0x59a48b){});}})[_0x772a('0x1b')](function(){if(_0x480617[_0x772a('0x70')]){return ami[_0x772a('0x20')]({'action':_0x772a('0x6f'),'channel':_0x480617['destinationchannel'],'mixmonitorid':_0x2e0658['mixmonitorid']})[_0x772a('0x1c')](function(_0x492911){});}})[_0x772a('0x1b')](function(_0x789991){var _0x109490=_[_0x772a('0x5e')](_0x480617[_0x772a('0x65')],{'mixmonitorid':_0x2e0658[_0x772a('0x69')]});if(_0x109490){_0x109490[_0x772a('0x6a')]=_0x772a('0x71');}})[_0x772a('0x1b')](function(){var _0x5b854d=util[_0x772a('0x9')](_0x772a('0x60'),_0x2e0658[_0x772a('0x72')]||_0x2e0658[_0x772a('0x61')],_0x2e0658['format']||_0x772a('0x62'));var _0x59c612=_[_0x772a('0x5e')](_0x480617[_0x772a('0x65')],{'filename':_0x772a('0x66')+_0x5b854d['toLowerCase']()});if(_0x59c612){_0x59c612[_0x772a('0x6a')]=_0x772a('0x71');}})[_0x772a('0x1b')](function(){_0x926905({'code':0xc8,'message':[_0x2e0658[_0x772a('0x61')],_0x772a('0x73')][_0x772a('0x19')]('\x20')});})[_0x772a('0x1c')](function(_0x3d5ac3){_0x59334b(_0x169282['error'](0x1f5,[_0x2e0658[_0x772a('0x61')],_0x3d5ac3['message'][_0x772a('0x67')]()][_0x772a('0x19')]('\x20')));});}else{return _0x59334b(_0x169282['error'](0x1f5,_0x772a('0x6d')));}});},'VoiceQueuesChannels':function(_0x353f51){return new Promise(function(_0x111707,_0x367edb){var _0x35a4e1=_['values'](_0x36a7c4['queueChannels']);_0x111707({'count':_0x35a4e1['length'],'rows':_0x35a4e1});});},'VoiceQueuesChannel':function(_0x19591c){var _0x8b051f=this;return new Promise(function(_0x38e5f6,_0xcaf269){var _0xa99f69=schema(properties[_0x772a('0x74')])[_0x772a('0x3')](_0x19591c);if(_0xa99f69[_0x772a('0x5c')]>0x0){return _0xcaf269(_0x8b051f[_0x772a('0x15')](0x1f4,_[_0x772a('0x5d')](_0xa99f69,_0x772a('0x1d'))[_0x772a('0x19')](',\x20')));}var _0x2e0d88=_[_0x772a('0x5e')](_0x36a7c4[_0x772a('0x75')],{'uniqueid':_0x19591c[_0x772a('0x61')]});if(_0x2e0d88){_0x38e5f6(_0x2e0d88);}else{return _0xcaf269(_0x8b051f[_0x772a('0x15')](0x1f5,_0x772a('0x6d')));}});},'VoiceQueuesChannelHangup':function(_0x3a13f2){var _0x1ea3a1=this;return new Promise(function(_0x4f9c57,_0x13fcca){if(ami[_0x772a('0x14')]()==![]){return _0x13fcca(_0x1ea3a1['error'](0x1f4,[config['asterisk']['ip'],config['asterisk'][_0x772a('0x17')],_0x772a('0x18')][_0x772a('0x19')]('\x20')));}var _0x1ef5cc=schema(properties[_0x772a('0x76')])['validate'](_0x3a13f2);if(_0x1ef5cc['length']>0x0){return _0x13fcca(_0x1ea3a1[_0x772a('0x15')](0x1f4,_[_0x772a('0x5d')](_0x1ef5cc,_0x772a('0x1d'))[_0x772a('0x19')](',\x20')));}var _0x1726f5=_[_0x772a('0x5e')](_0x36a7c4[_0x772a('0x75')],{'uniqueid':_0x3a13f2[_0x772a('0x61')]});if(_0x1726f5&&_0x1726f5[_0x772a('0x5f')]){return ami[_0x772a('0x20')]({'action':'Hangup','channel':_0x1726f5[_0x772a('0x5f')]})[_0x772a('0x1b')](function(_0x296306){_0x4f9c57({'code':0xc8,'message':[_0x3a13f2[_0x772a('0x61')],_0x296306['message']['toLowerCase']()][_0x772a('0x19')]('\x20')});})[_0x772a('0x1c')](function(_0x3867e7){_0x13fcca(_0x1ea3a1[_0x772a('0x15')](0x1f5,[_0x3a13f2[_0x772a('0x61')],_0x3867e7[_0x772a('0x1d')][_0x772a('0x67')]()][_0x772a('0x19')]('\x20')));});}else{return _0x13fcca(_0x1ea3a1[_0x772a('0x15')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelRedirect':function(_0x52df11){var _0x5b1fcc=this;return new Promise(function(_0x28462b,_0x25a21f){if(ami[_0x772a('0x14')]()==![]){return _0x25a21f(_0x5b1fcc[_0x772a('0x15')](0x1f4,[config[_0x772a('0x16')]['ip'],config[_0x772a('0x16')][_0x772a('0x17')],'ami\x20disconnected']['join']('\x20')));}var _0x44d86b=schema(properties['voicequeuechannelredirect'])['validate'](_0x52df11);if(_0x44d86b['length']>0x0){return _0x25a21f(_0x5b1fcc[_0x772a('0x15')](0x1f4,_[_0x772a('0x5d')](_0x44d86b,_0x772a('0x1d'))[_0x772a('0x19')](',\x20')));}var _0x66a32a=_[_0x772a('0x5e')](_0x36a7c4[_0x772a('0x75')],{'uniqueid':_0x52df11[_0x772a('0x61')]});if(_0x66a32a&&_0x66a32a['channel']){return ami['Action']({'action':_0x772a('0x77'),'channel':_0x66a32a[_0x772a('0x5f')],'exten':_0x52df11[_0x772a('0x78')],'context':_0x52df11[_0x772a('0x79')]||_0x66a32a[_0x772a('0x79')],'priority':0x1})[_0x772a('0x1b')](function(_0x2cf300){_0x28462b({'code':0xc8,'message':[_0x52df11[_0x772a('0x61')],_0x2cf300[_0x772a('0x1d')][_0x772a('0x67')]()][_0x772a('0x19')]('\x20')});})[_0x772a('0x1c')](function(_0x464cfc){_0x25a21f(_0x5b1fcc[_0x772a('0x15')](0x1f5,[_0x52df11[_0x772a('0x61')],_0x464cfc[_0x772a('0x1d')][_0x772a('0x67')]()]['join']('\x20')));});}else{return _0x25a21f(_0x5b1fcc[_0x772a('0x15')](0x1f5,_0x772a('0x6d')));}});},'Agents':function(_0x6c9951){return new Promise(function(_0x120666,_0x5271a5){var _0x4f97f0=_['values'](_0x36a7c4[_0x772a('0x10')]);_0x120666({'count':_0x4f97f0[_0x772a('0x5c')],'rows':_0x4f97f0});});},'Telephones':function(_0x547f64){return new Promise(function(_0xd55455,_0x5c5dfb){var _0x14eea4=_[_0x772a('0x7a')](_0x36a7c4[_0x772a('0x7b')]);_0xd55455({'count':_0x14eea4[_0x772a('0x5c')],'rows':_0x14eea4});});},'Trunks':function(_0x29c005){return new Promise(function(_0x5ae9eb,_0x405f9c){var _0x208a46=_[_0x772a('0x7a')](_0x36a7c4['trunks']);_0x5ae9eb({'count':_0x208a46['length'],'rows':_0x208a46});});},'OutboundChannels':function(_0x259866){return new Promise(function(_0xe8036e,_0x4cddb7){var _0x49c8ba=_[_0x772a('0x7a')](_0x36a7c4[_0x772a('0x7c')]);_0xe8036e({'count':_0x49c8ba[_0x772a('0x5c')],'rows':_0x49c8ba});});},'Outbound':function(_0x1add31){return new Promise(function(_0x10f046,_0x5ddf08){_0x10f046(_0x36a7c4[_0x772a('0x7d')]);});},'Campaigns':function(_0x767402){return new Promise(function(_0x1fee1a,_0x2b9243){var _0x3aca6d=_[_0x772a('0x7a')](_0x36a7c4[_0x772a('0x7e')]);_0x1fee1a({'count':_0x3aca6d['length'],'rows':_0x3aca6d});});},'VoiceQueuesPreview':function(_0x3a2d6d){var _0x3190d1=this;return new Promise(function(_0x2460bf,_0x101526){_0x50a02[_0x772a('0x7f')](_0x3a2d6d['id'])[_0x772a('0x1b')](function(_0x4c3cf5){_0x2460bf({'code':0xc8,'message':_0x4c3cf5[_0x772a('0x1d')]});})[_0x772a('0x1c')](function(_0x44dde1){_0x101526(_0x3190d1[_0x772a('0x15')](0x1f4,_0x44dde1['message']));});});},'EventManager':function(_0x2517b6){var _0x395158=this;return new Promise(function(_0x15990c,_0x42b7c6){if(!_0x2517b6[_0x772a('0x80')]){return _0x42b7c6(_0x395158[_0x772a('0x15')](0x1f4,_0x772a('0x81')));}ami[_0x772a('0x82')]('custom:'+_0x2517b6['event'],_0x2517b6['message']);_0x15990c({'code':0xc8,'message':_0x2517b6});});},'FaxAccounts':function(_0x1419b5){return new Promise(function(_0xa01480,_0x5d701d){var _0x3c0c89=_[_0x772a('0x7a')](_0x36a7c4['faxAccounts']);_0xa01480({'count':_0x3c0c89[_0x772a('0x5c')],'rows':_0x3c0c89});});},'SendFax':function(_0x4bbd36){var _0x3bd6b3=this;return new Promise(function(_0x1452b5,_0x67733){_0x30a2e4[_0x772a('0x83')](_0x4bbd36)[_0x772a('0x1b')](function(_0x457992){_0x1452b5({'code':0xc8,'message':_0x457992[_0x772a('0x1d')]});})['catch'](function(_0x8fbaff){_0x67733(_0x3bd6b3['error'](0x1f4,_0x8fbaff[_0x772a('0x1d')]));});});},'CheckAfterSend':function(_0xe0240f){var _0xc9c37e=this;return new Promise(function(_0x540ebf,_0x5ec365){_0x30a2e4[_0x772a('0x84')](_0xe0240f)[_0x772a('0x1b')](function(_0x11edc9){_0x540ebf({'code':0xc8,'message':_0x11edc9[_0x772a('0x1d')]});})[_0x772a('0x1c')](function(_0x11ee23){_0x5ec365(_0xc9c37e['error'](0x1f4,_0x11ee23[_0x772a('0x1d')]));});});}};var _0x3d2ea1=jayson[_0x772a('0x85')](_0x48b5d4)['http']();_0x3d2ea1['on'](_0x772a('0x15'),function(_0xf0741b){return _0x3c6e4a(_0xf0741b);});_0x3d2ea1['listen'](0x232a,'127.0.0.1',function(){console[_0x772a('0x86')]('AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232a);return _0x3d0cb5(_0x772a('0x87')+0x232a);});});}; \ No newline at end of file +var _0xf64d=['checkAfterSend','server','listen','127.0.0.1','log','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','jayson/promise','bluebird','../../../config/environment','../properties','../ami','%s/%s','name','timers','updateAcw','agents','updateStatusRealtime','pause','QueuePause','isConnected','error','asterisk','username','pick','keys','action','Reload','Action','then','message','catch','ami\x20disconnected','command','content','voiceQueues','hasOwnProperty','strategy','answered','available','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','talking','total','type','unmanaged','abandoned','waiting','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','callerid','Interval','length','values','channels','join','validate','map','find','uniqueid','filename','format','wav','channel','/var/spool/asterisk/monitor/','toLowerCase','isNil','monitors','push','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','rec','status','MixMonitor\x20Success','voicechannel','resolve','StopMixMonitor','destinationchannel','stop','StopMixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','queueChannels','voicequeuechannel','voicequeuechannelhangup','Hangup','voicequeuechannelredirect','exten','context','telephones','trunks','outboundChannels','outbound','run','event','Event\x20name\x20mandatory','emit','custom:','send'];(function(_0x1e5cc3,_0x238a87){var _0x15c596=function(_0x27bb04){while(--_0x27bb04){_0x1e5cc3['push'](_0x1e5cc3['shift']());}};_0x15c596(++_0x238a87);}(_0xf64d,0x11d));var _0xdf64=function(_0x42446c,_0x106c25){_0x42446c=_0x42446c-0x0;var _0x29059d=_0xf64d[_0x42446c];return _0x29059d;};'use strict';var _=require('lodash');var util=require('util');var jayson=require(_0xdf64('0x0'));var schema=require('validate');var BPromise=require(_0xdf64('0x1'));var moment=require('moment');var config=require(_0xdf64('0x2'));var properties=require(_0xdf64('0x3'));var ami=require(_0xdf64('0x4'));exports['listen']=function(_0x4387b3,_0x9af28c,_0x2e28bb){return new BPromise(function(_0x238831,_0x1ab725){var _0x27b5ea={'QueuePause':function(_0x361bfc){return new Promise(function(_0x32dc8a,_0x3cfa49){var _0x527082=util['format'](_0xdf64('0x5'),'SIP',_0x361bfc[_0xdf64('0x6')]);if(_0x4387b3[_0xdf64('0x7')]&&_0x4387b3[_0xdf64('0x7')][_0x527082]&&_0x4387b3[_0xdf64('0x7')][_0x527082]['timer']){_0x4387b3[_0xdf64('0x7')][_0x527082][_0xdf64('0x8')]();}if(_0x4387b3[_0xdf64('0x9')][_0x527082]){_0x4387b3[_0xdf64('0x9')][_0x527082][_0xdf64('0xa')]({'statePause':_0x361bfc[_0xdf64('0xb')]?!![]:![]});}_0x32dc8a({'code':0xc8,'message':_0xdf64('0xc')});});},'Reload':function(_0x36ea88){var _0x4897e3=this;return new Promise(function(_0x611fd7,_0x308c3f){if(ami[_0xdf64('0xd')]()==![]){return _0x308c3f(_0x4897e3[_0xdf64('0xe')](0x1f4,[config[_0xdf64('0xf')]['ip'],config[_0xdf64('0xf')][_0xdf64('0x10')],'ami\x20disconnected']['join']('\x20')));}_0x36ea88=_[_0xdf64('0x11')](_0x36ea88,_[_0xdf64('0x12')](properties['module']));_0x36ea88[_0xdf64('0x13')]=_0xdf64('0x14');return ami[_0xdf64('0x15')](_0x36ea88)[_0xdf64('0x16')](function(_0x2e65ac){_0x611fd7({'code':0xc8,'message':_0x2e65ac[_0xdf64('0x17')]});})[_0xdf64('0x18')](function(_0x83f026){_0x308c3f(_0x4897e3[_0xdf64('0xe')](0x1f5,_0x83f026[_0xdf64('0x17')]));});});},'Command':function(_0x328498){var _0x4f4834=this;return new Promise(function(_0x3c2ed6,_0x526ba4){if(ami[_0xdf64('0xd')]()==![]){return _0x526ba4(_0x4f4834[_0xdf64('0xe')](0x1f4,[config[_0xdf64('0xf')]['ip'],config[_0xdf64('0xf')][_0xdf64('0x10')],_0xdf64('0x19')]['join']('\x20')));}_0x328498=_['pick'](_0x328498,_0xdf64('0x1a'));_0x328498[_0xdf64('0x13')]='Command';return ami['Action'](_0x328498)[_0xdf64('0x16')](function(_0x23e4f5){_0x3c2ed6({'code':0xc8,'message':_0x23e4f5[_0xdf64('0x1b')]});})['catch'](function(_0x2e6b78){_0x526ba4(_0x4f4834[_0xdf64('0xe')](0x1f5,_0x2e6b78['message']));});});},'VoiceQueues':function(_0x14b826){return new Promise(function(_0x28e4d5,_0x56c4de){var _0x352282=[];for(var _0x2661f4 in _0x4387b3['voiceQueues']){if(_0x4387b3[_0xdf64('0x1c')][_0xdf64('0x1d')](_0x2661f4)){var _0x58d53e=_0x4387b3[_0xdf64('0x1c')][_0x2661f4];var _0x3b5715={'id':_0x58d53e['id'],'name':_0x58d53e[_0xdf64('0x6')],'strategy':_0x58d53e[_0xdf64('0x1e')],'answered':_0x58d53e[_0xdf64('0x1f')],'available':_0x58d53e[_0xdf64('0x20')],'loggedIn':_0x58d53e[_0xdf64('0x21')],'pTalking':_0x58d53e[_0xdf64('0x22')],'sumBillable':_0x58d53e[_0xdf64('0x23')],'sumDuration':_0x58d53e[_0xdf64('0x24')],'sumHoldTime':_0x58d53e[_0xdf64('0x25')]||0x0,'talking':_0x58d53e[_0xdf64('0x26')],'total':_0x58d53e[_0xdf64('0x27')],'type':_0x58d53e[_0xdf64('0x28')],'unmanaged':_0x58d53e[_0xdf64('0x29')],'abandoned':_0x58d53e[_0xdf64('0x2a')],'waiting':_0x58d53e[_0xdf64('0x2b')],'loggedInDb':_0x58d53e[_0xdf64('0x2c')]};if(_0x58d53e[_0xdf64('0x28')]==='outbound'){_0x3b5715[_0xdf64('0x2d')]=_0x58d53e['dialActive'];_0x3b5715[_0xdf64('0x2e')]=_0x58d53e[_0xdf64('0x2e')];_0x3b5715[_0xdf64('0x2f')]=_0x58d53e['dialOriginateCallerIdName'];_0x3b5715[_0xdf64('0x30')]=_0x58d53e[_0xdf64('0x30')];_0x3b5715[_0xdf64('0x31')]=_0x58d53e[_0xdf64('0x31')];_0x3b5715['dialPrefix']=_0x58d53e[_0xdf64('0x32')];_0x3b5715[_0xdf64('0x33')]=_0x58d53e[_0xdf64('0x33')];_0x3b5715['outboundAnswerCallsDay']=_0x58d53e[_0xdf64('0x34')];_0x3b5715['outboundBlacklistCallsDay']=_0x58d53e['outboundBlacklistCallsDay'];_0x3b5715[_0xdf64('0x35')]=_0x58d53e[_0xdf64('0x35')];_0x3b5715[_0xdf64('0x36')]=_0x58d53e['outboundCongestionCallsDay'];_0x3b5715[_0xdf64('0x37')]=_0x58d53e['outboundDropCallsDayACS'];_0x3b5715['outboundDropCallsDayCallersExit']=_0x58d53e['outboundDropCallsDayCallersExit'];_0x3b5715[_0xdf64('0x38')]=_0x58d53e['outboundDropCallsDayTimeout'];_0x3b5715[_0xdf64('0x39')]=_0x58d53e[_0xdf64('0x39')];_0x3b5715[_0xdf64('0x3a')]=_0x58d53e['outboundNoSuchCallsDay'];_0x3b5715['outboundOriginateFailureCallsDay']=_0x58d53e[_0xdf64('0x3b')];_0x3b5715[_0xdf64('0x3c')]=_0x58d53e['outboundReCallsDay'];_0x3b5715[_0xdf64('0x3d')]=_0x58d53e[_0xdf64('0x3d')];_0x3b5715[_0xdf64('0x3e')]=_0x58d53e['outboundUnknownCallsDay'];_0x3b5715[_0xdf64('0x3f')]=_0x58d53e['predictiveIntervalAnsweredCalls'];_0x3b5715[_0xdf64('0x40')]=_0x58d53e[_0xdf64('0x40')];_0x3b5715['predictiveIntervalAvgTalktime']=_0x58d53e[_0xdf64('0x41')];_0x3b5715['predictiveIntervalDroppedCallsCallersExit']=_0x58d53e[_0xdf64('0x42')];_0x3b5715['predictiveIntervalDroppedCallsTimeout']=_0x58d53e[_0xdf64('0x43')];_0x3b5715[_0xdf64('0x44')]=_0x58d53e['predictiveIntervalErlangCalls'];_0x3b5715[_0xdf64('0x45')]=_0x58d53e[_0xdf64('0x45')];_0x3b5715[_0xdf64('0x46')]=_0x58d53e[_0xdf64('0x46')];_0x3b5715[_0xdf64('0x47')]=_0x58d53e['predictiveIntervalMultiplicativeFactor'];_0x3b5715['predictiveIntervalPauses']=_0x58d53e[_0xdf64('0x48')];_0x3b5715[_0xdf64('0x49')]=_0x58d53e[_0xdf64('0x49')];_0x3b5715[_0xdf64('0x4a')]=_0x58d53e[_0xdf64('0x4a')];_0x3b5715['message']=_0x58d53e[_0xdf64('0x17')];_0x3b5715['originated']=_0x58d53e[_0xdf64('0x4b')];_0x3b5715[_0xdf64('0x4c')]=_0x58d53e[_0xdf64('0x4c')];_0x3b5715[_0xdf64('0x4d')]=_0x58d53e[_0xdf64('0x4d')];_0x3b5715[_0xdf64('0x4e')]=_0x58d53e['erlangAbandonmentRate'];_0x3b5715['erlangBusyFactor']=_0x58d53e[_0xdf64('0x4f')];_0x3b5715[_0xdf64('0x50')]=_0x58d53e[_0xdf64('0x50')];_0x3b5715[_0xdf64('0x51')]=_0x58d53e[_0xdf64('0x51')];}if(_0x58d53e['Trunk']){_0x3b5715[_0xdf64('0x52')]={'id':_0x58d53e[_0xdf64('0x52')]['id'],'name':_0x58d53e[_0xdf64('0x52')][_0xdf64('0x6')],'active':_0x58d53e[_0xdf64('0x52')][_0xdf64('0x53')],'callerid':_0x58d53e[_0xdf64('0x52')][_0xdf64('0x54')]};}if(_0x58d53e[_0xdf64('0x55')]){_0x3b5715[_0xdf64('0x55')]={'id':_0x58d53e[_0xdf64('0x55')]['id'],'name':_0x58d53e[_0xdf64('0x55')][_0xdf64('0x6')]};}_0x352282['push'](_0x3b5715);}}_0x28e4d5({'count':_0x352282[_0xdf64('0x56')],'rows':_0x352282});});},'VoiceChannels':function(_0x30ff4c){return new Promise(function(_0x116e9a,_0x46232c){var _0x1cfeaf=_[_0xdf64('0x57')](_0x4387b3[_0xdf64('0x58')]);_0x116e9a({'count':_0x1cfeaf[_0xdf64('0x56')],'rows':_0x1cfeaf});});},'VoiceChannelMixMonitor':function(_0xc6348e){var _0x45c1d4=this;return new Promise(function(_0x1364eb,_0x3a2349){if(ami['isConnected']()==![]){return _0x3a2349(_0x45c1d4['error'](0x1f4,[config['asterisk']['ip'],config['asterisk'][_0xdf64('0x10')],_0xdf64('0x19')][_0xdf64('0x59')]('\x20')));}var _0x1e176a=schema(properties['voicechannel'])[_0xdf64('0x5a')](_0xc6348e);if(_0x1e176a[_0xdf64('0x56')]>0x0){return _0x3a2349(_0x45c1d4[_0xdf64('0xe')](0x1f4,_[_0xdf64('0x5b')](_0x1e176a,_0xdf64('0x17'))['join'](',\x20')));}var _0x333a8e=_[_0xdf64('0x5c')](_0x4387b3[_0xdf64('0x58')],{'uniqueid':_0xc6348e[_0xdf64('0x5d')]});if(_0x333a8e&&_0x333a8e['channel']){var _0xb59e45=util['format']('%s.%s',_0xc6348e[_0xdf64('0x5e')]||_0xc6348e['uniqueid'],_0xc6348e[_0xdf64('0x5f')]||_0xdf64('0x60'));return ami[_0xdf64('0x15')]({'action':'MixMonitor','channel':_0x333a8e[_0xdf64('0x61')],'file':_0xb59e45,'options':'ai(mixmonitorid)'})['then'](function(_0x4b0aa9){var _0x4417b0=_[_0xdf64('0x5c')](_0x333a8e['monitors'],{'filename':_0xdf64('0x62')+_0xb59e45[_0xdf64('0x63')]()});if(_[_0xdf64('0x64')](_0x4417b0)){_0x333a8e[_0xdf64('0x65')][_0xdf64('0x66')]({'filename':_0xdf64('0x62')+_0xb59e45['toLowerCase'](),'createdAt':moment()[_0xdf64('0x5f')](_0xdf64('0x67')),'mixmonitorid':_0x4b0aa9[_0xdf64('0x68')],'status':_0xdf64('0x69')});}else{_0x4417b0[_0xdf64('0x68')]=_0x4b0aa9[_0xdf64('0x68')];_0x4417b0[_0xdf64('0x6a')]='rec';}_0x1364eb({'code':0xc8,'message':[_0xc6348e[_0xdf64('0x5d')],_0xdf64('0x6b'),_0x4b0aa9[_0xdf64('0x68')]][_0xdf64('0x59')]('\x20'),'mixmonitorid':_0x4b0aa9[_0xdf64('0x68')]});})[_0xdf64('0x18')](function(_0x7fb721){_0x3a2349(_0x45c1d4[_0xdf64('0xe')](0x1f5,[_0xc6348e[_0xdf64('0x5d')],_0x7fb721['message']['toLowerCase']()][_0xdf64('0x59')]('\x20')));});}else{return _0x3a2349(_0x45c1d4[_0xdf64('0xe')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceChannelStopMixMonitor':function(_0x4e9843){var _0xce4404=this;return new Promise(function(_0x5956bb,_0x6482fe){if(ami[_0xdf64('0xd')]()==![]){return _0x6482fe(_0xce4404['error'](0x1f4,[config['asterisk']['ip'],config[_0xdf64('0xf')][_0xdf64('0x10')],'ami\x20disconnected']['join']('\x20')));}var _0x2e0846=schema(properties[_0xdf64('0x6c')])['validate'](_0x4e9843);if(_0x2e0846[_0xdf64('0x56')]>0x0){return _0x6482fe(_0xce4404['error'](0x1f4,_[_0xdf64('0x5b')](_0x2e0846,'message')[_0xdf64('0x59')](',\x20')));}var _0x107b4c=_[_0xdf64('0x5c')](_0x4387b3[_0xdf64('0x58')],{'uniqueid':_0x4e9843['uniqueid']});if(_0x107b4c){return BPromise[_0xdf64('0x6d')]()[_0xdf64('0x16')](function(){if(_0x107b4c['channel']){return ami[_0xdf64('0x15')]({'action':_0xdf64('0x6e'),'channel':_0x107b4c[_0xdf64('0x61')],'mixmonitorid':_0x4e9843[_0xdf64('0x68')]})[_0xdf64('0x18')](function(_0x39a50e){});}})[_0xdf64('0x16')](function(){if(_0x107b4c[_0xdf64('0x6f')]){return ami[_0xdf64('0x15')]({'action':_0xdf64('0x6e'),'channel':_0x107b4c['destinationchannel'],'mixmonitorid':_0x4e9843['mixmonitorid']})[_0xdf64('0x18')](function(_0x5c16a5){});}})[_0xdf64('0x16')](function(_0x111f75){var _0x344c40=_[_0xdf64('0x5c')](_0x107b4c[_0xdf64('0x65')],{'mixmonitorid':_0x4e9843[_0xdf64('0x68')]});if(_0x344c40){_0x344c40[_0xdf64('0x6a')]=_0xdf64('0x70');}})[_0xdf64('0x16')](function(){var _0x310d29=util['format']('%s.%s',_0x4e9843['filename']||_0x4e9843['uniqueid'],_0x4e9843[_0xdf64('0x5f')]||'wav');var _0x5565e7=_[_0xdf64('0x5c')](_0x107b4c['monitors'],{'filename':'/var/spool/asterisk/monitor/'+_0x310d29[_0xdf64('0x63')]()});if(_0x5565e7){_0x5565e7[_0xdf64('0x6a')]=_0xdf64('0x70');}})[_0xdf64('0x16')](function(){_0x5956bb({'code':0xc8,'message':[_0x4e9843[_0xdf64('0x5d')],_0xdf64('0x71')][_0xdf64('0x59')]('\x20')});})[_0xdf64('0x18')](function(_0x334e2d){_0x6482fe(_0xce4404[_0xdf64('0xe')](0x1f5,[_0x4e9843[_0xdf64('0x5d')],_0x334e2d[_0xdf64('0x17')][_0xdf64('0x63')]()]['join']('\x20')));});}else{return _0x6482fe(_0xce4404[_0xdf64('0xe')](0x1f5,_0xdf64('0x72')));}});},'VoiceQueuesChannels':function(_0x4118fa){return new Promise(function(_0x1da1d5,_0x166792){var _0x3875db=_[_0xdf64('0x57')](_0x4387b3[_0xdf64('0x73')]);_0x1da1d5({'count':_0x3875db[_0xdf64('0x56')],'rows':_0x3875db});});},'VoiceQueuesChannel':function(_0x1831e3){var _0x11a77d=this;return new Promise(function(_0x5dbd6b,_0x2d53a6){var _0x451390=schema(properties[_0xdf64('0x74')])['validate'](_0x1831e3);if(_0x451390[_0xdf64('0x56')]>0x0){return _0x2d53a6(_0x11a77d[_0xdf64('0xe')](0x1f4,_[_0xdf64('0x5b')](_0x451390,_0xdf64('0x17'))['join'](',\x20')));}var _0x500566=_[_0xdf64('0x5c')](_0x4387b3[_0xdf64('0x73')],{'uniqueid':_0x1831e3['uniqueid']});if(_0x500566){_0x5dbd6b(_0x500566);}else{return _0x2d53a6(_0x11a77d[_0xdf64('0xe')](0x1f5,_0xdf64('0x72')));}});},'VoiceQueuesChannelHangup':function(_0xe395a0){var _0x32bbce=this;return new Promise(function(_0x26809d,_0x412a24){if(ami['isConnected']()==![]){return _0x412a24(_0x32bbce[_0xdf64('0xe')](0x1f4,[config[_0xdf64('0xf')]['ip'],config[_0xdf64('0xf')][_0xdf64('0x10')],_0xdf64('0x19')][_0xdf64('0x59')]('\x20')));}var _0xe6e14f=schema(properties[_0xdf64('0x75')])[_0xdf64('0x5a')](_0xe395a0);if(_0xe6e14f[_0xdf64('0x56')]>0x0){return _0x412a24(_0x32bbce[_0xdf64('0xe')](0x1f4,_[_0xdf64('0x5b')](_0xe6e14f,_0xdf64('0x17'))[_0xdf64('0x59')](',\x20')));}var _0x322e10=_['find'](_0x4387b3[_0xdf64('0x73')],{'uniqueid':_0xe395a0['uniqueid']});if(_0x322e10&&_0x322e10['channel']){return ami[_0xdf64('0x15')]({'action':_0xdf64('0x76'),'channel':_0x322e10['channel']})[_0xdf64('0x16')](function(_0x2c5b79){_0x26809d({'code':0xc8,'message':[_0xe395a0[_0xdf64('0x5d')],_0x2c5b79[_0xdf64('0x17')][_0xdf64('0x63')]()]['join']('\x20')});})[_0xdf64('0x18')](function(_0x2b5557){_0x412a24(_0x32bbce['error'](0x1f5,[_0xe395a0[_0xdf64('0x5d')],_0x2b5557[_0xdf64('0x17')][_0xdf64('0x63')]()]['join']('\x20')));});}else{return _0x412a24(_0x32bbce[_0xdf64('0xe')](0x1f5,_0xdf64('0x72')));}});},'VoiceQueuesChannelRedirect':function(_0x37ec69){var _0x48990d=this;return new Promise(function(_0x36af34,_0x108b6a){if(ami['isConnected']()==![]){return _0x108b6a(_0x48990d['error'](0x1f4,[config[_0xdf64('0xf')]['ip'],config[_0xdf64('0xf')]['username'],_0xdf64('0x19')][_0xdf64('0x59')]('\x20')));}var _0x5c14c6=schema(properties[_0xdf64('0x77')])[_0xdf64('0x5a')](_0x37ec69);if(_0x5c14c6[_0xdf64('0x56')]>0x0){return _0x108b6a(_0x48990d[_0xdf64('0xe')](0x1f4,_[_0xdf64('0x5b')](_0x5c14c6,'message')[_0xdf64('0x59')](',\x20')));}var _0x3fd7fc=_[_0xdf64('0x5c')](_0x4387b3[_0xdf64('0x73')],{'uniqueid':_0x37ec69[_0xdf64('0x5d')]});if(_0x3fd7fc&&_0x3fd7fc[_0xdf64('0x61')]){return ami[_0xdf64('0x15')]({'action':'Redirect','channel':_0x3fd7fc[_0xdf64('0x61')],'exten':_0x37ec69[_0xdf64('0x78')],'context':_0x37ec69[_0xdf64('0x79')]||_0x3fd7fc[_0xdf64('0x79')],'priority':0x1})[_0xdf64('0x16')](function(_0x4f342c){_0x36af34({'code':0xc8,'message':[_0x37ec69[_0xdf64('0x5d')],_0x4f342c[_0xdf64('0x17')][_0xdf64('0x63')]()][_0xdf64('0x59')]('\x20')});})[_0xdf64('0x18')](function(_0x2a1680){_0x108b6a(_0x48990d['error'](0x1f5,[_0x37ec69['uniqueid'],_0x2a1680[_0xdf64('0x17')][_0xdf64('0x63')]()][_0xdf64('0x59')]('\x20')));});}else{return _0x108b6a(_0x48990d[_0xdf64('0xe')](0x1f5,_0xdf64('0x72')));}});},'Agents':function(_0x8eb7d5){return new Promise(function(_0x5d33d8,_0x294bdc){var _0x4a2771=_[_0xdf64('0x57')](_0x4387b3['agents']);_0x5d33d8({'count':_0x4a2771['length'],'rows':_0x4a2771});});},'Telephones':function(_0x3a89a9){return new Promise(function(_0x14f49f,_0x5d987e){var _0x40c446=_[_0xdf64('0x57')](_0x4387b3[_0xdf64('0x7a')]);_0x14f49f({'count':_0x40c446[_0xdf64('0x56')],'rows':_0x40c446});});},'Trunks':function(_0x4a6488){return new Promise(function(_0x55ce2a,_0x59788b){var _0xa86e8e=_['values'](_0x4387b3[_0xdf64('0x7b')]);_0x55ce2a({'count':_0xa86e8e[_0xdf64('0x56')],'rows':_0xa86e8e});});},'OutboundChannels':function(_0x1dc798){return new Promise(function(_0xc0920d,_0x209483){var _0x4e6f40=_[_0xdf64('0x57')](_0x4387b3[_0xdf64('0x7c')]);_0xc0920d({'count':_0x4e6f40['length'],'rows':_0x4e6f40});});},'Outbound':function(_0x133a89){return new Promise(function(_0x18171a,_0x3db173){_0x18171a(_0x4387b3[_0xdf64('0x7d')]);});},'Campaigns':function(_0x18a23e){return new Promise(function(_0x265f16,_0x44d270){var _0x559a8b=_[_0xdf64('0x57')](_0x4387b3['campaigns']);_0x265f16({'count':_0x559a8b[_0xdf64('0x56')],'rows':_0x559a8b});});},'VoiceQueuesPreview':function(_0x19247f){var _0x7f8fa0=this;return new Promise(function(_0x2f0e43,_0x217102){_0x9af28c[_0xdf64('0x7e')](_0x19247f['id'])[_0xdf64('0x16')](function(_0x39f9f7){_0x2f0e43({'code':0xc8,'message':_0x39f9f7[_0xdf64('0x17')]});})[_0xdf64('0x18')](function(_0x2cc4){_0x217102(_0x7f8fa0['error'](0x1f4,_0x2cc4[_0xdf64('0x17')]));});});},'EventManager':function(_0x2947a4){var _0x52d85c=this;return new Promise(function(_0x1e1c9a,_0x3c734b){if(!_0x2947a4[_0xdf64('0x7f')]){return _0x3c734b(_0x52d85c[_0xdf64('0xe')](0x1f4,_0xdf64('0x80')));}ami[_0xdf64('0x81')](_0xdf64('0x82')+_0x2947a4[_0xdf64('0x7f')],_0x2947a4[_0xdf64('0x17')]);_0x1e1c9a({'code':0xc8,'message':_0x2947a4});});},'FaxAccounts':function(_0x39777e){return new Promise(function(_0x13e15a,_0x3f8f69){var _0x332a03=_[_0xdf64('0x57')](_0x4387b3['faxAccounts']);_0x13e15a({'count':_0x332a03['length'],'rows':_0x332a03});});},'SendFax':function(_0x17468e){var _0x2b92d8=this;return new Promise(function(_0x5a05e8,_0x261091){_0x2e28bb[_0xdf64('0x83')](_0x17468e)['then'](function(_0x4e23d1){_0x5a05e8({'code':0xc8,'message':_0x4e23d1['message']});})[_0xdf64('0x18')](function(_0x58b7d9){_0x261091(_0x2b92d8[_0xdf64('0xe')](0x1f4,_0x58b7d9[_0xdf64('0x17')]));});});},'CheckAfterSend':function(_0x29c55e){var _0x91e608=this;return new Promise(function(_0x52f128,_0x3477a8){_0x2e28bb[_0xdf64('0x84')](_0x29c55e)['then'](function(_0x16fbe9){_0x52f128({'code':0xc8,'message':_0x16fbe9[_0xdf64('0x17')]});})['catch'](function(_0x440839){_0x3477a8(_0x91e608['error'](0x1f4,_0x440839[_0xdf64('0x17')]));});});}};var _0x2346cf=jayson[_0xdf64('0x85')](_0x27b5ea)['http']();_0x2346cf['on'](_0xdf64('0xe'),function(_0x59e177){return _0x1ab725(_0x59e177);});_0x2346cf[_0xdf64('0x86')](0x232a,_0xdf64('0x87'),function(){console[_0xdf64('0x88')](_0xdf64('0x89'),0x232a);return _0x238831(_0xdf64('0x8a')+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 e9c45ec..7bcfd8f 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 _0xb470=['bluebird','util','lodash','ioredis','../../../../config/logger','trigger','../../rpc/cmContact','defaults','redis','localhost','socket.io-emitter','autoCreate','data2','data1','calleridnum','isNil','routeId','firstName','calleridname','uniqueid','destcalleridname','','destcalleridnum','phone','then','showContact','omit','format','user:%s','action','toLowerCase','merge','resolve','createContact','xmd-contactid2','name','error','Error\x20creating\x20contact','trigger:%s'];(function(_0xc40591,_0x5b5de2){var _0x40a7c2=function(_0x4275d8){while(--_0x4275d8){_0xc40591['push'](_0xc40591['shift']());}};_0x40a7c2(++_0x5b5de2);}(_0xb470,0x75));var _0x0b47=function(_0x4941bc,_0x3b3fbd){_0x4941bc=_0x4941bc-0x0;var _0x1dd577=_0xb470[_0x4941bc];return _0x1dd577;};'use strict';var BPromise=require(_0x0b47('0x0'));var util=require(_0x0b47('0x1'));var _=require(_0x0b47('0x2'));var Redis=require(_0x0b47('0x3'));var config=require('../../../../config/environment');var logger=require(_0x0b47('0x4'))(_0x0b47('0x5'));var cmContactRpc=require(_0x0b47('0x6'));config['redis']=_[_0x0b47('0x7')](config[_0x0b47('0x8')],{'host':_0x0b47('0x9'),'port':0x18eb});var io=require(_0x0b47('0xa'))(new Redis(config[_0x0b47('0x8')]));function emit(_0x23d960,_0x201ab2,_0x37eb18){logger['info'](_0x23d960,_0x201ab2,JSON['stringify'](_0x37eb18));io['to'](_0x23d960)['emit'](_0x201ab2,_0x37eb18);}exports['exec']=function(_0x38523d,_0x2b9cd0,_0x4e5ac5){_0x4e5ac5[_0x0b47('0xb')]=0x0;if(_0x2b9cd0[_0x0b47('0xc')]&&parseInt(_0x2b9cd0[_0x0b47('0xc')],0xa)){var _0x7ba653={'ListId':parseInt(_0x2b9cd0[_0x0b47('0xd')],0xa),'phone':_0x4e5ac5[_0x0b47('0xe')]};if(_[_0x0b47('0xf')](_0x4e5ac5[_0x0b47('0x10')])){_0x7ba653[_0x0b47('0x11')]=_0x4e5ac5[_0x0b47('0x12')]&&_0x4e5ac5['calleridname']!==''?_0x4e5ac5[_0x0b47('0x12')]:_0x4e5ac5['calleridnum']||_0x4e5ac5[_0x0b47('0x13')];}else{_0x7ba653[_0x0b47('0x11')]=_0x4e5ac5['destcalleridname']&&_0x4e5ac5[_0x0b47('0x14')]!==_0x0b47('0x15')?_0x4e5ac5[_0x0b47('0x14')]:_0x4e5ac5[_0x0b47('0x16')]||_0x4e5ac5[_0x0b47('0x13')];_0x7ba653[_0x0b47('0x17')]=_0x4e5ac5[_0x0b47('0x14')]&&_0x4e5ac5[_0x0b47('0x14')]!==_0x0b47('0x15')?_0x4e5ac5[_0x0b47('0x14')]:_0x4e5ac5['destcalleridnum']||_0x4e5ac5[_0x0b47('0x13')];}BPromise['resolve']()[_0x0b47('0x18')](cmContactRpc[_0x0b47('0x19')]({'where':_[_0x0b47('0x1a')](_0x7ba653,['firstName'])}))[_0x0b47('0x18')](function(_0x5aee61){if(_0x5aee61){_0x4e5ac5['xmd-contactid2']=_0x5aee61['id'];emit(util[_0x0b47('0x1b')](_0x0b47('0x1c'),_0x38523d['name']),util[_0x0b47('0x1b')]('trigger:%s',_0x2b9cd0[_0x0b47('0x1d')][_0x0b47('0x1e')]()),_[_0x0b47('0x1f')](_0x4e5ac5,{'ListId':parseInt(_0x2b9cd0[_0x0b47('0xd')],0xa)}));return;}else{return BPromise[_0x0b47('0x20')]()[_0x0b47('0x18')](cmContactRpc[_0x0b47('0x21')](_0x7ba653));}})[_0x0b47('0x18')](function(_0x3bff28){if(_0x3bff28){_0x4e5ac5[_0x0b47('0x22')]=_0x3bff28['id'];emit(util[_0x0b47('0x1b')]('user:%s',_0x38523d[_0x0b47('0x23')]),util[_0x0b47('0x1b')]('trigger:%s',_0x2b9cd0[_0x0b47('0x1d')][_0x0b47('0x1e')]()),_[_0x0b47('0x1f')](_0x4e5ac5,{'ListId':parseInt(_0x2b9cd0[_0x0b47('0xd')],0xa)}));}})['catch'](function(_0x47d1b2){logger[_0x0b47('0x24')](_0x0b47('0x25'),JSON['stringify'](_0x47d1b2));});}else{if(_0x38523d){emit(util[_0x0b47('0x1b')](_0x0b47('0x1c'),_0x38523d[_0x0b47('0x23')]),util[_0x0b47('0x1b')](_0x0b47('0x26'),_0x2b9cd0[_0x0b47('0x1d')][_0x0b47('0x1e')]()),_[_0x0b47('0x1f')]({'ListId':parseInt(_0x2b9cd0[_0x0b47('0xd')],0xa)},_0x4e5ac5));}}}; \ No newline at end of file +var _0xb470=['bluebird','util','lodash','ioredis','../../../../config/logger','trigger','../../rpc/cmContact','defaults','redis','localhost','socket.io-emitter','autoCreate','data2','data1','calleridnum','isNil','routeId','firstName','calleridname','uniqueid','destcalleridname','','destcalleridnum','phone','then','showContact','omit','format','user:%s','action','toLowerCase','merge','resolve','createContact','xmd-contactid2','name','error','Error\x20creating\x20contact','trigger:%s'];(function(_0x4c6619,_0x123a88){var _0x283987=function(_0x464104){while(--_0x464104){_0x4c6619['push'](_0x4c6619['shift']());}};_0x283987(++_0x123a88);}(_0xb470,0x75));var _0x0b47=function(_0x2217e9,_0x3c2189){_0x2217e9=_0x2217e9-0x0;var _0x32d3c7=_0xb470[_0x2217e9];return _0x32d3c7;};'use strict';var BPromise=require(_0x0b47('0x0'));var util=require(_0x0b47('0x1'));var _=require(_0x0b47('0x2'));var Redis=require(_0x0b47('0x3'));var config=require('../../../../config/environment');var logger=require(_0x0b47('0x4'))(_0x0b47('0x5'));var cmContactRpc=require(_0x0b47('0x6'));config['redis']=_[_0x0b47('0x7')](config[_0x0b47('0x8')],{'host':_0x0b47('0x9'),'port':0x18eb});var io=require(_0x0b47('0xa'))(new Redis(config[_0x0b47('0x8')]));function emit(_0x23d960,_0x201ab2,_0x37eb18){logger['info'](_0x23d960,_0x201ab2,JSON['stringify'](_0x37eb18));io['to'](_0x23d960)['emit'](_0x201ab2,_0x37eb18);}exports['exec']=function(_0x38523d,_0x2b9cd0,_0x4e5ac5){_0x4e5ac5[_0x0b47('0xb')]=0x0;if(_0x2b9cd0[_0x0b47('0xc')]&&parseInt(_0x2b9cd0[_0x0b47('0xc')],0xa)){var _0x7ba653={'ListId':parseInt(_0x2b9cd0[_0x0b47('0xd')],0xa),'phone':_0x4e5ac5[_0x0b47('0xe')]};if(_[_0x0b47('0xf')](_0x4e5ac5[_0x0b47('0x10')])){_0x7ba653[_0x0b47('0x11')]=_0x4e5ac5[_0x0b47('0x12')]&&_0x4e5ac5['calleridname']!==''?_0x4e5ac5[_0x0b47('0x12')]:_0x4e5ac5['calleridnum']||_0x4e5ac5[_0x0b47('0x13')];}else{_0x7ba653[_0x0b47('0x11')]=_0x4e5ac5['destcalleridname']&&_0x4e5ac5[_0x0b47('0x14')]!==_0x0b47('0x15')?_0x4e5ac5[_0x0b47('0x14')]:_0x4e5ac5[_0x0b47('0x16')]||_0x4e5ac5[_0x0b47('0x13')];_0x7ba653[_0x0b47('0x17')]=_0x4e5ac5[_0x0b47('0x14')]&&_0x4e5ac5[_0x0b47('0x14')]!==_0x0b47('0x15')?_0x4e5ac5[_0x0b47('0x14')]:_0x4e5ac5['destcalleridnum']||_0x4e5ac5[_0x0b47('0x13')];}BPromise['resolve']()[_0x0b47('0x18')](cmContactRpc[_0x0b47('0x19')]({'where':_[_0x0b47('0x1a')](_0x7ba653,['firstName'])}))[_0x0b47('0x18')](function(_0x5aee61){if(_0x5aee61){_0x4e5ac5['xmd-contactid2']=_0x5aee61['id'];emit(util[_0x0b47('0x1b')](_0x0b47('0x1c'),_0x38523d['name']),util[_0x0b47('0x1b')]('trigger:%s',_0x2b9cd0[_0x0b47('0x1d')][_0x0b47('0x1e')]()),_[_0x0b47('0x1f')](_0x4e5ac5,{'ListId':parseInt(_0x2b9cd0[_0x0b47('0xd')],0xa)}));return;}else{return BPromise[_0x0b47('0x20')]()[_0x0b47('0x18')](cmContactRpc[_0x0b47('0x21')](_0x7ba653));}})[_0x0b47('0x18')](function(_0x3bff28){if(_0x3bff28){_0x4e5ac5[_0x0b47('0x22')]=_0x3bff28['id'];emit(util[_0x0b47('0x1b')]('user:%s',_0x38523d[_0x0b47('0x23')]),util[_0x0b47('0x1b')]('trigger:%s',_0x2b9cd0[_0x0b47('0x1d')][_0x0b47('0x1e')]()),_[_0x0b47('0x1f')](_0x4e5ac5,{'ListId':parseInt(_0x2b9cd0[_0x0b47('0xd')],0xa)}));}})['catch'](function(_0x47d1b2){logger[_0x0b47('0x24')](_0x0b47('0x25'),JSON['stringify'](_0x47d1b2));});}else{if(_0x38523d){emit(util[_0x0b47('0x1b')](_0x0b47('0x1c'),_0x38523d[_0x0b47('0x23')]),util[_0x0b47('0x1b')](_0x0b47('0x26'),_0x2b9cd0[_0x0b47('0x1d')][_0x0b47('0x1e')]()),_[_0x0b47('0x1f')]({'ListId':parseInt(_0x2b9cd0[_0x0b47('0xd')],0xa)},_0x4e5ac5));}}}; \ No newline at end of file diff --git a/server/services/ami/trigger/index.js b/server/services/ami/trigger/index.js index 2e8e2e5..29c666a 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 _0x032e=['emit','info','stringify','clone','interface','hasOwnProperty','checkTrigger','merge','variables','Actions','length','action','toLowerCase','contactmanager','motionbar','browser','data1','popup','TemplateId','data2','render','html','template\x20not\x20found','uri','data3','isNil','data4','uriLocation','windowWidth','data5','800','data6','winApplication','winArguments','format','user:%s','jscripty','name','trigger:%s','exec','integration','queue','routeId','buildUri','parse','query','AllConditions','every','checkConditions','channel','AnyConditions','some','field','account','chat','ChatWebsiteId','operator','upperFirst','value','AccountId','interaction','message','event','agent','membername','lastevent','util','url','mustache','./integration','./cmContact','./script','../rpc/cmContact','../../../config/environment','../../../config/logger','trigger','../ami','redis','defaults','localhost','socket.io-emitter','winapp','triggers','agents','voiceQueues','templates','voiceExtensions','zendeskAccounts','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','accounts','custom:agentcalled','syncCustomEvent','bind','custom:agentconnect','custom:agentringnoanswer','custom:agentcomplete','custom:queuecallerabandon','syncAgentDial','custom:dialconnect','custom:dialend','custom:newinteraction','custom:closedinteraction','custom:incomingmessage','custom:outgoingmessage','custom:acceptmessage','prototype'];(function(_0x2450f3,_0x1ed83f){var _0x7061a7=function(_0x18fd37){while(--_0x18fd37){_0x2450f3['push'](_0x2450f3['shift']());}};_0x7061a7(++_0x1ed83f);}(_0x032e,0x124));var _0xe032=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0x032e[_0x3054be];return _0x3df150;};'use strict';var util=require(_0xe032('0x0'));var _=require('lodash');var url=require(_0xe032('0x1'));var Mustache=require(_0xe032('0x2'));var Redis=require('ioredis');var urlforward=require('./urlforward');var integration=require(_0xe032('0x3'));var cmContact=require(_0xe032('0x4'));var script=require(_0xe032('0x5'));var cmContactRpc=require(_0xe032('0x6'));var config=require(_0xe032('0x7'));var logger=require(_0xe032('0x8'))(_0xe032('0x9'));var ami=require(_0xe032('0xa'));config[_0xe032('0xb')]=_[_0xe032('0xc')](config[_0xe032('0xb')],{'host':_0xe032('0xd'),'port':0x18eb});var io=require(_0xe032('0xe'))(new Redis(config[_0xe032('0xb')]));var operators={'equals':function(_0x3d62fa,_0x2d8a14){return _0x3d62fa==_0x2d8a14;},'not_equals':function(_0x2dc9e5,_0x167bd9){return _0x2dc9e5!=_0x167bd9;}};var barAndWebActions=['popup',_0xe032('0x1'),_0xe032('0xf')];function Trigger(_0x13c126){this[_0xe032('0x10')]=_0x13c126[_0xe032('0x10')];this[_0xe032('0x11')]=_0x13c126[_0xe032('0x11')];this['voiceQueues']=_0x13c126[_0xe032('0x12')];this[_0xe032('0x13')]=_0x13c126[_0xe032('0x13')];this[_0xe032('0x14')]=_0x13c126['voiceExtensions'];this[_0xe032('0x15')]=_0x13c126[_0xe032('0x15')];this[_0xe032('0x16')]=_0x13c126[_0xe032('0x16')];this[_0xe032('0x17')]=_0x13c126[_0xe032('0x17')];this[_0xe032('0x18')]=_0x13c126['sugarcrmAccounts'];this[_0xe032('0x19')]=_0x13c126[_0xe032('0x19')];this[_0xe032('0x1a')]=_0x13c126[_0xe032('0x1a')];this[_0xe032('0x1b')]=_0x13c126[_0xe032('0x1b')];this['servicenowAccounts']=_0x13c126[_0xe032('0x1c')];this[_0xe032('0x1d')]=_0x13c126[_0xe032('0x1d')];this[_0xe032('0x1e')]={'zendesk':this[_0xe032('0x15')],'salesforce':this['salesforceAccounts'],'freshdesk':this['freshdeskAccounts'],'sugarcrm':this['sugarcrmAccounts'],'zoho':this[_0xe032('0x19')],'desk':this['deskAccounts'],'vtiger':this[_0xe032('0x1b')],'servicenow':this[_0xe032('0x1c')],'dynamics365':this[_0xe032('0x1d')]};ami['on'](_0xe032('0x1f'),this[_0xe032('0x20')][_0xe032('0x21')](this));ami['on'](_0xe032('0x22'),this['syncCustomEvent'][_0xe032('0x21')](this));ami['on'](_0xe032('0x23'),this[_0xe032('0x20')][_0xe032('0x21')](this));ami['on'](_0xe032('0x24'),this[_0xe032('0x20')][_0xe032('0x21')](this));ami['on'](_0xe032('0x25'),this['syncCustomEvent']['bind'](this));ami['on']('custom:dialbegin',this[_0xe032('0x26')][_0xe032('0x21')](this));ami['on'](_0xe032('0x27'),this[_0xe032('0x26')][_0xe032('0x21')](this));ami['on'](_0xe032('0x28'),this[_0xe032('0x26')][_0xe032('0x21')](this));ami['on'](_0xe032('0x29'),this[_0xe032('0x20')]['bind'](this));ami['on'](_0xe032('0x2a'),this[_0xe032('0x20')][_0xe032('0x21')](this));ami['on'](_0xe032('0x2b'),this['syncCustomEvent']['bind'](this));ami['on'](_0xe032('0x2c'),this[_0xe032('0x20')][_0xe032('0x21')](this));ami['on'](_0xe032('0x2d'),this['syncCustomEvent']['bind'](this));ami['on']('custom:rejectmessage',this[_0xe032('0x20')][_0xe032('0x21')](this));}Trigger[_0xe032('0x2e')][_0xe032('0x2f')]=function(_0x50db2d,_0x3b93e3,_0x236da9){logger[_0xe032('0x30')](_0x50db2d,_0x3b93e3,JSON[_0xe032('0x31')](_0x236da9));io['to'](_0x50db2d)[_0xe032('0x2f')](_0x3b93e3,_0x236da9);};Trigger['prototype'][_0xe032('0x20')]=function(_0x33634c){var _0x319a2f=_[_0xe032('0x32')](_0x33634c);this['checkTriggers'](_0x319a2f);};Trigger[_0xe032('0x2e')]['syncAgentDial']=function(_0x2f3e59){if(this['agents'][_0x2f3e59[_0xe032('0x33')]]){this['syncCustomEvent'](_0x2f3e59);}};Trigger[_0xe032('0x2e')]['checkTriggers']=function(_0x3970e1){var _0x1d0d31;for(var _0x55fac1 in this[_0xe032('0x10')]){if(this[_0xe032('0x10')][_0xe032('0x34')](_0x55fac1)){if(this[_0xe032('0x10')][_0x55fac1]['status']){_0x1d0d31=this[_0xe032('0x35')](this['triggers'][_0x55fac1],_0x3970e1);if(_0x1d0d31){_[_0xe032('0x36')](_0x3970e1,_0x3970e1[_0xe032('0x37')]);for(var _0x5d02c1=0x0,_0x450ba4,_0x23b790,_0x4a4447;_0x5d02c10x0){_0x393a5a=_[_0x0baf('0x2e')](_0x549fd0,_0x1590b4);}return _0x393a5a;}function getCustomFields(_0x55c715,_0x29dbdf){var _0x34a58a=[];var _0x5d9d7f={'custom_fields':{}};if(_0x55c715[_0x0baf('0x2d')]>0x0){_[_0x0baf('0x2f')](_0x55c715,function(_0x478ce8){if(_0x478ce8[_0x0baf('0x30')]===_0x0baf('0x31')&&_0x478ce8[_0x0baf('0x32')]&&!_0x478ce8[_0x0baf('0x33')]){_0x5d9d7f[_0x478ce8['nameField'][_0x0baf('0x34')]()]=_0x478ce8[_0x0baf('0x35')][_0x0baf('0x24')]();}else if(_0x478ce8[_0x0baf('0x30')]===_0x0baf('0x31')&&_0x478ce8[_0x0baf('0x36')]&&_0x478ce8[_0x0baf('0x33')]){_0x5d9d7f[_0x0baf('0x37')][_0x478ce8[_0x0baf('0x36')]]=_0x478ce8[_0x0baf('0x35')][_0x0baf('0x24')]();}else if(_0x478ce8[_0x0baf('0x30')]===_0x0baf('0x38')&&_0x478ce8[_0x0baf('0x39')]&&_0x478ce8['idField']&&_0x478ce8[_0x0baf('0x33')]){_0x29dbdf[_0x478ce8['variableName']]&&(_0x5d9d7f[_0x0baf('0x37')][_0x478ce8[_0x0baf('0x36')]]=_0x29dbdf[_0x478ce8[_0x0baf('0x39')]][_0x0baf('0x24')]());}else if(_0x478ce8['type']===_0x0baf('0x3a')&&_0x478ce8[_0x0baf('0x3b')]&&_0x478ce8['Variable'][_0x0baf('0x3c')]&&_0x478ce8[_0x0baf('0x36')]&&_0x478ce8[_0x0baf('0x33')]){_0x29dbdf[_0x478ce8[_0x0baf('0x3b')][_0x0baf('0x3c')][_0x0baf('0x34')]()]&&(_0x5d9d7f[_0x0baf('0x37')][_0x478ce8[_0x0baf('0x36')]]=_0x29dbdf[_0x478ce8['Variable'][_0x0baf('0x3c')][_0x0baf('0x34')]()]['toString']());}});}if(_0x5d9d7f[_0x0baf('0x3d')]){_0x5d9d7f['priority']=Number(_0x5d9d7f['priority']);}return _0x5d9d7f;}function getTicket(_0x11bc49,_0x81af83,_0x5d3ad1,_0x49e792,_0x628603){logger[_0x0baf('0xe')](_0x0baf('0x3e'));var _0xb2d9ab=_[_0x0baf('0x3f')]({'subject':intUtil[_0x0baf('0x40')](_0x49e792[_0x0baf('0x41')],_0x628603,'\x20'),'type':_0x0baf('0x42'),'status':_0x0baf('0x43'),'labels':[_0x0baf('0x44'),_0x0baf('0x45'),_0x0baf('0x46')][_0x0baf('0x47')](getTags(_0x49e792[_0x0baf('0x48')],'name')),'description':intUtil[_0x0baf('0x40')](_0x49e792[_0x0baf('0x49')],_0x628603,'\x0a'),'_links':{'assigned_user':{'href':util['format'](_0x0baf('0x4a'),_0x81af83['id']),'class':_0x0baf('0x4b')}},'message':{'direction':'in','body':intUtil[_0x0baf('0x40')](_0x49e792[_0x0baf('0x49')],_0x628603,'\x0a')}},getCustomFields(_0x49e792[_0x0baf('0x4c')],_0x628603));return request({'uri':util[_0x0baf('0x10')]('%s/customers/%d/cases',_0x11bc49[_0x0baf('0x12')],_0x5d3ad1['id']),'method':_0x0baf('0x2b'),'body':_0xb2d9ab});}exports['queue']=function(_0x35d442,_0x412e6f,_0x45c6aa,_0x57903e,_0x504031,_0x193fd3){var _0x43919e,_0x301412;_0x193fd3[_0x0baf('0x12')]=intUtil[_0x0baf('0x4d')](_0x193fd3[_0x0baf('0x12')]);_0x193fd3[_0x0baf('0x4e')]=intUtil[_0x0baf('0x4d')](_0x193fd3[_0x0baf('0x4e')]);if(_0x504031&&_0x504031[_0x0baf('0x4f')]){logger['info'](_0x0baf('0x50'),_0x0baf('0x51'));_0x412e6f[_0x0baf('0x52')]=util[_0x0baf('0x10')](_0x0baf('0x53'),_0x193fd3['serverUrl'],_0x412e6f[_0x0baf('0x54')],md5(_0x412e6f[_0x0baf('0x54')]));}else{_0x412e6f[_0x0baf('0x52')]='';}headers[_0x0baf('0x55')]=getAuth(_0x193fd3);return getUser(_0x193fd3,_0x57903e[_0x0baf('0x56')])['then'](function(_0x2a0924){_0x43919e=_0x2a0924;logger[_0x0baf('0xe')](_0x0baf('0x57'),_0x43919e['id']);return getEndUser(_0x193fd3,_0x412e6f[_0x0baf('0x58')],_0x412e6f[_0x0baf('0x59')]);})[_0x0baf('0x13')](function(_0x178995){_0x301412=_0x178995;logger['info'](_0x0baf('0x5a'),_0x301412['id']);return getTicket(_0x193fd3,_0x43919e,_0x301412,_0x45c6aa,_0x412e6f);})[_0x0baf('0x13')](function(_0x3a6489){if(_0x3a6489){logger['info'](_0x0baf('0x5b'));logger[_0x0baf('0xe')](_0x0baf('0x5c'),_0x3a6489['id']);switch(_0x193fd3[_0x0baf('0x30')]){case _0x0baf('0x5d'):logger[_0x0baf('0xe')](_0x0baf('0x50'),'Displaying\x20ticket\x20to\x20agent...');emit(util[_0x0baf('0x10')](_0x0baf('0x5e'),_0x57903e[_0x0baf('0x3c')]),_0x0baf('0x5f'),{'recordId':_0x3a6489['id']});break;case _0x0baf('0x60'):logger[_0x0baf('0xe')](_0x0baf('0x50'),_0x0baf('0x61'));emit(util[_0x0baf('0x10')](_0x0baf('0x5e'),_0x57903e[_0x0baf('0x3c')]),'trigger:browser:url',{'uri':util['format'](_0x0baf('0x62'),_0x3a6489['id'])});break;default:logger[_0x0baf('0x63')](_0x0baf('0x50'),_0x0baf('0x64'));}}})[_0x0baf('0x65')](function(_0x17b683){console[_0x0baf('0x63')](_0x17b683);logger['error'](_0x0baf('0x50'),JSON[_0x0baf('0x1c')](_0x17b683));});};exports[_0x0baf('0x66')]=function(_0x16d9fb,_0x3fdb41,_0x1e2671,_0x5e1849,_0x3eebe5,_0x5f123c,_0x151741){var _0x59f732,_0x25a1b2;_0x5f123c['remoteUri']=intUtil[_0x0baf('0x4d')](_0x5f123c['remoteUri']);_0x5f123c[_0x0baf('0x4e')]=intUtil[_0x0baf('0x4d')](_0x5f123c[_0x0baf('0x4e')]);if(_0x151741&&_0x151741[_0x0baf('0x67')]&&_0x151741[_0x0baf('0x67')]!=='none'){logger[_0x0baf('0xe')](_0x0baf('0x68'),_0x0baf('0x51'));_0x3fdb41[_0x0baf('0x52')]=util[_0x0baf('0x10')](_0x0baf('0x53'),_0x5f123c['serverUrl'],_0x3fdb41[_0x0baf('0x54')],md5(_0x3fdb41[_0x0baf('0x54')]));}headers[_0x0baf('0x55')]=getAuth(_0x5f123c);return getUser(_0x5f123c,_0x5e1849[_0x0baf('0x56')])[_0x0baf('0x13')](function(_0x1a7ffb){_0x59f732=_0x1a7ffb;logger[_0x0baf('0xe')]('The\x20User\x20ID\x20is:',_0x59f732['id']);return getEndUser(_0x5f123c,_0x3fdb41['destcalleridname'],_0x3fdb41[_0x0baf('0x69')]);})[_0x0baf('0x13')](function(_0x371a3d){_0x25a1b2=_0x371a3d;logger[_0x0baf('0xe')](_0x0baf('0x5a'),_0x25a1b2['id']);return getTicket(_0x5f123c,_0x59f732,_0x25a1b2,_0x1e2671,_0x3fdb41);})[_0x0baf('0x13')](function(_0xaa4293){if(_0xaa4293){logger[_0x0baf('0xe')](_0x0baf('0x5b'));logger['info'](_0x0baf('0x5c'),_0xaa4293['id']);switch(_0x5f123c[_0x0baf('0x30')]){case _0x0baf('0x5d'):logger[_0x0baf('0xe')](_0x0baf('0x50'),_0x0baf('0x6a'));emit(util[_0x0baf('0x10')]('user:%s',_0x5e1849[_0x0baf('0x3c')]),_0x0baf('0x5f'),{'recordId':_0xaa4293['id']});break;case _0x0baf('0x60'):logger[_0x0baf('0xe')](_0x0baf('0x50'),_0x0baf('0x61'));emit(util[_0x0baf('0x10')](_0x0baf('0x5e'),_0x5e1849['name']),_0x0baf('0x6b'),{'uri':util['format'](_0x0baf('0x6c'),_0x5f123c['remoteUri'],_0xaa4293['id'])});break;default:logger['error'](_0x0baf('0x68'),'Desk\x20account\x20type\x20not\x20recognized');}}})[_0x0baf('0x65')](function(_0x2b17f8){logger['error'](_0x0baf('0x68'),JSON[_0x0baf('0x1c')](_0x2b17f8));});};exports[_0x0baf('0x6d')]=function(_0x5b3c1d,_0x4d89f4,_0x2438df,_0x7e8946,_0x6d789f,_0x7f49e){var _0x784e1a,_0x588b88;_0x7f49e[_0x0baf('0x12')]=intUtil['stripTrailingSlash'](_0x7f49e['remoteUri']);_0x7f49e['serverUrl']=intUtil[_0x0baf('0x4d')](_0x7f49e['serverUrl']);if(_0x6d789f&&_0x6d789f['monitor_format']){logger[_0x0baf('0xe')](_0x0baf('0x6e'),_0x0baf('0x51'));_0x4d89f4[_0x0baf('0x52')]=util[_0x0baf('0x10')](_0x0baf('0x53'),_0x7f49e['serverUrl'],_0x4d89f4[_0x0baf('0x54')],md5(_0x4d89f4[_0x0baf('0x54')]));}else{_0x4d89f4[_0x0baf('0x52')]='';}headers[_0x0baf('0x55')]=getAuth(_0x7f49e);return getUser(_0x7f49e)[_0x0baf('0x13')](function(_0x1273f4){_0x784e1a=_0x1273f4;logger['info'](_0x0baf('0x57'),_0x784e1a['id']);return getEndUser(_0x7f49e,_0x4d89f4[_0x0baf('0x58')],_0x4d89f4[_0x0baf('0x59')]);})['then'](function(_0x89484d){_0x588b88=_0x89484d;logger[_0x0baf('0xe')](_0x0baf('0x5a'),_0x588b88['id']);return getTicket(_0x7f49e,_0x784e1a,_0x588b88,_0x2438df,_0x4d89f4);})[_0x0baf('0x13')](function(_0x125906){if(_0x125906){logger[_0x0baf('0xe')](_0x0baf('0x5b'));logger['info']('The\x20Ticket\x20ID\x20is:',_0x125906['id']);}})['catch'](function(_0x6ce83c){logger[_0x0baf('0x63')](_0x0baf('0x6e'),JSON[_0x0baf('0x1c')](_0x6ce83c));});}; \ No newline at end of file +var _0xfef3=['GET','authType','basic','%s:%s','username','password','token','%s/token:%s','Basic\x20%s','toString','base64','%s/customers/search','Enduser\x20found!','_embedded','POST','length','map','type','string','nameField','content','idField','customField','custom_fields','variableName','customVariable','Variable','name','toLowerCase','priority','Creating\x20new\x20ticket...','merge','Subjects','phone','Motion','CTI','concat','Tags','getString','Descriptions','user','Fields','%s/customers/%d/cases','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','uniqueid','recordingURL','Authorization','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','trigger:desk:display','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','https://xcally.desk.com/web/agent/case/%d','error','Desk\x20account\x20type\x20not\x20recognized','catch','outbound','recordingFormat','none','[OUTBOUND]','destcalleridnum','integrationTab','newTab','%s/agent/tickets/%s','[ABANDONED]','lodash','md5','ioredis','./util','../../../../config/logger','desk','defaults','redis','socket.io-emitter','emit','application/json','validateEmail','info','Getting\x20agent\x20with\x20email','format','remoteUri','then','find','entries','Agent\x20found!','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','%s/users/me','debug','[HTTP]','stringify'];(function(_0x244862,_0x3da79e){var _0x2bce23=function(_0x235ae5){while(--_0x235ae5){_0x244862['push'](_0x244862['shift']());}};_0x2bce23(++_0x3da79e);}(_0xfef3,0x118));var _0x3fef=function(_0x53468a,_0x286986){_0x53468a=_0x53468a-0x0;var _0x205efd=_0xfef3[_0x53468a];return _0x205efd;};'use strict';var _=require(_0x3fef('0x0'));var rp=require('request-promise');var md5=require(_0x3fef('0x1'));var util=require('util');var Redis=require(_0x3fef('0x2'));var intUtil=require(_0x3fef('0x3'));var config=require('../../../../config/environment');var logger=require(_0x3fef('0x4'))(_0x3fef('0x5'));config['redis']=_[_0x3fef('0x6')](config[_0x3fef('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0x3fef('0x8'))(new Redis(config[_0x3fef('0x7')]));function emit(_0x800850,_0x33e00a,_0x1fffc5){io['to'](_0x800850)[_0x3fef('0x9')](_0x33e00a,_0x1fffc5);}var headers={'Content-Type':_0x3fef('0xa'),'Accept':_0x3fef('0xa')};function getUser(_0x31c30f,_0x307586){if(intUtil[_0x3fef('0xb')](_0x307586)===!![]){logger[_0x3fef('0xc')](_0x3fef('0xd'),_0x307586);return request({'uri':util[_0x3fef('0xe')]('%s/users',_0x31c30f[_0x3fef('0xf')])})[_0x3fef('0x10')](function(_0x11696d){if(_0x11696d['total_entries']){return _[_0x3fef('0x11')](_0x11696d['_embedded'][_0x3fef('0x12')],{'email':_0x307586});}})[_0x3fef('0x10')](function(_0x2da64b){if(_0x2da64b){logger['info'](_0x3fef('0x13'));return _0x2da64b;}else{logger['info'](_0x3fef('0x14'));return request({'uri':util[_0x3fef('0xe')]('%s/users/me',_0x31c30f[_0x3fef('0xf')])});}});}else{logger[_0x3fef('0xc')](_0x3fef('0x15'));return request({'uri':util[_0x3fef('0xe')](_0x3fef('0x16'),_0x31c30f[_0x3fef('0xf')])});}}function request(_0x5c899f){logger[_0x3fef('0x17')](_0x3fef('0x18'),JSON[_0x3fef('0x19')](_0x5c899f));return rp(_[_0x3fef('0x6')](_0x5c899f,{'method':_0x3fef('0x1a'),'headers':headers,'json':!![]}));}function getAuth(_0xaa0ae3){var _0x53d993;if(_0xaa0ae3[_0x3fef('0x1b')]===_0x3fef('0x1c')){_0x53d993=util['format'](_0x3fef('0x1d'),_0xaa0ae3[_0x3fef('0x1e')],_0xaa0ae3[_0x3fef('0x1f')]);}else if(_0xaa0ae3[_0x3fef('0x1b')]===_0x3fef('0x20')){_0x53d993=util[_0x3fef('0xe')](_0x3fef('0x21'),_0xaa0ae3[_0x3fef('0x1e')],_0xaa0ae3[_0x3fef('0x20')]);}return util[_0x3fef('0xe')](_0x3fef('0x22'),new Buffer(_0x53d993)[_0x3fef('0x23')](_0x3fef('0x24')));}function getEndUser(_0x39a8ea,_0x433a3e,_0x58f6cf){logger['info']('Searching\x20enduser\x20with\x20phone',_0x58f6cf);return request({'uri':util[_0x3fef('0xe')](_0x3fef('0x25'),_0x39a8ea[_0x3fef('0xf')]),'qs':{'phone':_0x58f6cf}})['then'](function(_0x4d462c){if(_0x4d462c['total_entries']){logger[_0x3fef('0xc')](_0x3fef('0x26'));return _0x4d462c[_0x3fef('0x27')][_0x3fef('0x12')][0x0];}else{logger[_0x3fef('0xc')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util['format']('%s/customers',_0x39a8ea[_0x3fef('0xf')]),'method':_0x3fef('0x28'),'body':{'first_name':_0x433a3e,'title':_0x433a3e,'phone_numbers':[{'type':'work','value':_0x58f6cf}]}});}});}function getTags(_0x462ee7,_0x6d08cd){var _0x4e08d8=[];if(_0x462ee7&&_0x462ee7[_0x3fef('0x29')]>0x0){_0x4e08d8=_[_0x3fef('0x2a')](_0x462ee7,_0x6d08cd);}return _0x4e08d8;}function getCustomFields(_0xf892bb,_0x2b73fb){var _0x3a1a0a=[];var _0x137849={'custom_fields':{}};if(_0xf892bb[_0x3fef('0x29')]>0x0){_['forEach'](_0xf892bb,function(_0x34576a){if(_0x34576a[_0x3fef('0x2b')]===_0x3fef('0x2c')&&_0x34576a[_0x3fef('0x2d')]&&!_0x34576a['customField']){_0x137849[_0x34576a[_0x3fef('0x2d')]['toLowerCase']()]=_0x34576a[_0x3fef('0x2e')][_0x3fef('0x23')]();}else if(_0x34576a[_0x3fef('0x2b')]===_0x3fef('0x2c')&&_0x34576a[_0x3fef('0x2f')]&&_0x34576a[_0x3fef('0x30')]){_0x137849[_0x3fef('0x31')][_0x34576a[_0x3fef('0x2f')]]=_0x34576a[_0x3fef('0x2e')][_0x3fef('0x23')]();}else if(_0x34576a['type']==='variable'&&_0x34576a[_0x3fef('0x32')]&&_0x34576a['idField']&&_0x34576a[_0x3fef('0x30')]){_0x2b73fb[_0x34576a[_0x3fef('0x32')]]&&(_0x137849[_0x3fef('0x31')][_0x34576a[_0x3fef('0x2f')]]=_0x2b73fb[_0x34576a[_0x3fef('0x32')]][_0x3fef('0x23')]());}else if(_0x34576a[_0x3fef('0x2b')]===_0x3fef('0x33')&&_0x34576a[_0x3fef('0x34')]&&_0x34576a[_0x3fef('0x34')][_0x3fef('0x35')]&&_0x34576a[_0x3fef('0x2f')]&&_0x34576a[_0x3fef('0x30')]){_0x2b73fb[_0x34576a[_0x3fef('0x34')]['name'][_0x3fef('0x36')]()]&&(_0x137849[_0x3fef('0x31')][_0x34576a[_0x3fef('0x2f')]]=_0x2b73fb[_0x34576a[_0x3fef('0x34')][_0x3fef('0x35')][_0x3fef('0x36')]()]['toString']());}});}if(_0x137849['priority']){_0x137849[_0x3fef('0x37')]=Number(_0x137849[_0x3fef('0x37')]);}return _0x137849;}function getTicket(_0x42490a,_0x12f1be,_0x69e494,_0x788b6c,_0x736045){logger[_0x3fef('0xc')](_0x3fef('0x38'));var _0x29b099=_[_0x3fef('0x39')]({'subject':intUtil['getString'](_0x788b6c[_0x3fef('0x3a')],_0x736045,'\x20'),'type':_0x3fef('0x3b'),'status':'new','labels':['xCALLY',_0x3fef('0x3c'),_0x3fef('0x3d')][_0x3fef('0x3e')](getTags(_0x788b6c[_0x3fef('0x3f')],_0x3fef('0x35'))),'description':intUtil[_0x3fef('0x40')](_0x788b6c[_0x3fef('0x41')],_0x736045,'\x0a'),'_links':{'assigned_user':{'href':util[_0x3fef('0xe')]('/api/v2/users/%d',_0x12f1be['id']),'class':_0x3fef('0x42')}},'message':{'direction':'in','body':intUtil[_0x3fef('0x40')](_0x788b6c[_0x3fef('0x41')],_0x736045,'\x0a')}},getCustomFields(_0x788b6c[_0x3fef('0x43')],_0x736045));return request({'uri':util[_0x3fef('0xe')](_0x3fef('0x44'),_0x42490a[_0x3fef('0xf')],_0x69e494['id']),'method':_0x3fef('0x28'),'body':_0x29b099});}exports[_0x3fef('0x45')]=function(_0x301f65,_0x12867c,_0x254880,_0x2e1d7f,_0x15d2c7,_0x2b1411){var _0x5b1b3d,_0x3e0d55;_0x2b1411[_0x3fef('0xf')]=intUtil[_0x3fef('0x46')](_0x2b1411[_0x3fef('0xf')]);_0x2b1411[_0x3fef('0x47')]=intUtil[_0x3fef('0x46')](_0x2b1411['serverUrl']);if(_0x15d2c7&&_0x15d2c7[_0x3fef('0x48')]){logger['info'](_0x3fef('0x49'),_0x3fef('0x4a'));_0x12867c['recordingURL']=util[_0x3fef('0xe')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2b1411[_0x3fef('0x47')],_0x12867c[_0x3fef('0x4b')],md5(_0x12867c[_0x3fef('0x4b')]));}else{_0x12867c[_0x3fef('0x4c')]='';}headers[_0x3fef('0x4d')]=getAuth(_0x2b1411);return getUser(_0x2b1411,_0x2e1d7f[_0x3fef('0x4e')])[_0x3fef('0x10')](function(_0x220488){_0x5b1b3d=_0x220488;logger[_0x3fef('0xc')](_0x3fef('0x4f'),_0x5b1b3d['id']);return getEndUser(_0x2b1411,_0x12867c[_0x3fef('0x50')],_0x12867c[_0x3fef('0x51')]);})[_0x3fef('0x10')](function(_0x4cf81c){_0x3e0d55=_0x4cf81c;logger[_0x3fef('0xc')](_0x3fef('0x52'),_0x3e0d55['id']);return getTicket(_0x2b1411,_0x5b1b3d,_0x3e0d55,_0x254880,_0x12867c);})['then'](function(_0x186e8f){if(_0x186e8f){logger[_0x3fef('0xc')](_0x3fef('0x53'));logger['info'](_0x3fef('0x54'),_0x186e8f['id']);switch(_0x2b1411[_0x3fef('0x2b')]){case'integrationTab':logger[_0x3fef('0xc')]('[QUEUE]','Displaying\x20ticket\x20to\x20agent...');emit(util[_0x3fef('0xe')]('user:%s',_0x2e1d7f[_0x3fef('0x35')]),_0x3fef('0x55'),{'recordId':_0x186e8f['id']});break;case'newTab':logger[_0x3fef('0xc')](_0x3fef('0x49'),_0x3fef('0x56'));emit(util['format'](_0x3fef('0x57'),_0x2e1d7f[_0x3fef('0x35')]),_0x3fef('0x58'),{'uri':util['format'](_0x3fef('0x59'),_0x186e8f['id'])});break;default:logger[_0x3fef('0x5a')](_0x3fef('0x49'),_0x3fef('0x5b'));}}})[_0x3fef('0x5c')](function(_0x5a3f34){console[_0x3fef('0x5a')](_0x5a3f34);logger[_0x3fef('0x5a')](_0x3fef('0x49'),JSON[_0x3fef('0x19')](_0x5a3f34));});};exports[_0x3fef('0x5d')]=function(_0x15be93,_0x3f9d35,_0x1431b8,_0x2c9f73,_0x4862a5,_0x5cdbd6,_0x436337){var _0x3b7117,_0x116c1c;_0x5cdbd6[_0x3fef('0xf')]=intUtil[_0x3fef('0x46')](_0x5cdbd6[_0x3fef('0xf')]);_0x5cdbd6[_0x3fef('0x47')]=intUtil[_0x3fef('0x46')](_0x5cdbd6[_0x3fef('0x47')]);if(_0x436337&&_0x436337[_0x3fef('0x5e')]&&_0x436337[_0x3fef('0x5e')]!==_0x3fef('0x5f')){logger['info'](_0x3fef('0x60'),_0x3fef('0x4a'));_0x3f9d35[_0x3fef('0x4c')]=util[_0x3fef('0xe')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x5cdbd6[_0x3fef('0x47')],_0x3f9d35[_0x3fef('0x4b')],md5(_0x3f9d35[_0x3fef('0x4b')]));}headers[_0x3fef('0x4d')]=getAuth(_0x5cdbd6);return getUser(_0x5cdbd6,_0x2c9f73['email'])[_0x3fef('0x10')](function(_0x26b6a8){_0x3b7117=_0x26b6a8;logger[_0x3fef('0xc')]('The\x20User\x20ID\x20is:',_0x3b7117['id']);return getEndUser(_0x5cdbd6,_0x3f9d35['destcalleridname'],_0x3f9d35[_0x3fef('0x61')]);})[_0x3fef('0x10')](function(_0x3009db){_0x116c1c=_0x3009db;logger[_0x3fef('0xc')]('The\x20Enduser\x20ID\x20is:',_0x116c1c['id']);return getTicket(_0x5cdbd6,_0x3b7117,_0x116c1c,_0x1431b8,_0x3f9d35);})[_0x3fef('0x10')](function(_0x4824d0){if(_0x4824d0){logger[_0x3fef('0xc')]('Ticket\x20created!');logger[_0x3fef('0xc')]('The\x20Ticket\x20ID\x20is:',_0x4824d0['id']);switch(_0x5cdbd6[_0x3fef('0x2b')]){case _0x3fef('0x62'):logger[_0x3fef('0xc')]('[QUEUE]','Displaying\x20ticket\x20to\x20agent...');emit(util[_0x3fef('0xe')](_0x3fef('0x57'),_0x2c9f73[_0x3fef('0x35')]),_0x3fef('0x55'),{'recordId':_0x4824d0['id']});break;case _0x3fef('0x63'):logger[_0x3fef('0xc')](_0x3fef('0x49'),_0x3fef('0x56'));emit(util['format'](_0x3fef('0x57'),_0x2c9f73['name']),'trigger:browser:url',{'uri':util[_0x3fef('0xe')](_0x3fef('0x64'),_0x5cdbd6[_0x3fef('0xf')],_0x4824d0['id'])});break;default:logger[_0x3fef('0x5a')](_0x3fef('0x60'),_0x3fef('0x5b'));}}})[_0x3fef('0x5c')](function(_0x187c0f){logger[_0x3fef('0x5a')]('[OUTBOUND]',JSON[_0x3fef('0x19')](_0x187c0f));});};exports['abandoned']=function(_0xc01327,_0x1f25f7,_0x26400f,_0x46d6c8,_0x400c45,_0x39c57f){var _0x4a4631,_0x14ebd6;_0x39c57f[_0x3fef('0xf')]=intUtil[_0x3fef('0x46')](_0x39c57f[_0x3fef('0xf')]);_0x39c57f[_0x3fef('0x47')]=intUtil[_0x3fef('0x46')](_0x39c57f[_0x3fef('0x47')]);if(_0x400c45&&_0x400c45[_0x3fef('0x48')]){logger[_0x3fef('0xc')](_0x3fef('0x65'),_0x3fef('0x4a'));_0x1f25f7['recordingURL']=util[_0x3fef('0xe')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x39c57f['serverUrl'],_0x1f25f7['uniqueid'],md5(_0x1f25f7[_0x3fef('0x4b')]));}else{_0x1f25f7['recordingURL']='';}headers[_0x3fef('0x4d')]=getAuth(_0x39c57f);return getUser(_0x39c57f)[_0x3fef('0x10')](function(_0xc6d7c9){_0x4a4631=_0xc6d7c9;logger['info'](_0x3fef('0x4f'),_0x4a4631['id']);return getEndUser(_0x39c57f,_0x1f25f7['calleridname'],_0x1f25f7[_0x3fef('0x51')]);})[_0x3fef('0x10')](function(_0x51ea04){_0x14ebd6=_0x51ea04;logger[_0x3fef('0xc')](_0x3fef('0x52'),_0x14ebd6['id']);return getTicket(_0x39c57f,_0x4a4631,_0x14ebd6,_0x26400f,_0x1f25f7);})[_0x3fef('0x10')](function(_0x134bea){if(_0x134bea){logger[_0x3fef('0xc')](_0x3fef('0x53'));logger[_0x3fef('0xc')](_0x3fef('0x54'),_0x134bea['id']);}})['catch'](function(_0x25467e){logger[_0x3fef('0x5a')](_0x3fef('0x65'),JSON[_0x3fef('0x19')](_0x25467e));});}; \ 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 e2eed45..71be0af 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 _0x0ffb=['content','ticketType','incident','incidents','assign','getString','Descriptions','/contacts(','Fields','phonecalls','Subjects','callDirection','queue','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','user:%s','emit','remoteUri','stripTrailingSlash','serverUrl','abandoned','https://login.microsoftonline.com/%s/oauth2/token','tenantId','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','[OUTBOUND]',']\x20The\x20User\x20ID\x20is:',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20Enduser\x20phone\x20is:',']\x20Call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...','name','ticketId',']\x20Error\x20running\x20Dynamics365\x20integration','inspect','lodash','bluebird','request-promise','util','./util','md5','ioredis','../../../../config/logger','dynamics365','../../../../config/environment','defaults','redis','localhost','clientId','username','password','clientSecret','then','access_token','catch','error','toUpperCase',']\x20Wrong\x20credentials!','message','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','value','isNil','validateEmail','email','userEmail','length','isdisabled','info',']\x20Agent\x20found\x20','systemuserid','internalemailaddress','userId','toLowerCase','destcalleridnum','calleridnum','POST','contacts','/systemusers(','Bearer\x20','4.0','headers','odata-entityid','substring','lastIndexOf','enduserId','contacts?$select=telephone1','outbound','telephone1',']\x20Enduser\x20Created!','type','string','customField','indexOf'];(function(_0x2235bf,_0x3a06a7){var _0x4c3a64=function(_0x3b3bb6){while(--_0x3b3bb6){_0x2235bf['push'](_0x2235bf['shift']());}};_0x4c3a64(++_0x3a06a7);}(_0x0ffb,0x151));var _0xb0ff=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x0ffb[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0xb0ff('0x0'));var BPromise=require(_0xb0ff('0x1'));var rp=require(_0xb0ff('0x2'));var util=require(_0xb0ff('0x3'));var intUtil=require(_0xb0ff('0x4'));var md5=require(_0xb0ff('0x5'));var Redis=require(_0xb0ff('0x6'));var logger=require(_0xb0ff('0x7'))(_0xb0ff('0x8'));var config=require(_0xb0ff('0x9'));config['redis']=_[_0xb0ff('0xa')](config[_0xb0ff('0xb')],{'host':_0xb0ff('0xc'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xb0ff('0xb')]));function getAuthToken(_0xa516bd,_0x4bff97,_0x5c11a2){var _0xc6a064={'method':'POST','uri':_0x4bff97,'form':{'client_id':_0xa516bd[_0xb0ff('0xd')],'resource':_0xa516bd['remoteUri'],'username':_0xa516bd[_0xb0ff('0xe')],'password':_0xa516bd[_0xb0ff('0xf')],'grant_type':_0xb0ff('0xf'),'client_secret':_0xa516bd[_0xb0ff('0x10')]},'json':!![]};return rp(_0xc6a064)[_0xb0ff('0x11')](function(_0x324b1d){return _0x324b1d[_0xb0ff('0x12')];})[_0xb0ff('0x13')](function(_0x555b83){logger[_0xb0ff('0x14')]('['+[_0x5c11a2[_0xb0ff('0x15')]()]+_0xb0ff('0x16'));return _0x555b83[_0xb0ff('0x17')];});}function getUser(_0x22591b,_0x10cc0f,_0x2b595e,_0x3bb93c,_0x463d32,_0x55906f){return new BPromise(function(_0x343a96,_0xd2bc9b){return getAuthToken(_0x10cc0f,_0x3bb93c,_0x55906f)[_0xb0ff('0x11')](function(_0x56293e){var _0x5ab51d={'method':_0xb0ff('0x18'),'uri':_0x463d32+_0xb0ff('0x19'),'headers':{'Authorization':'Bearer\x20'+_0x56293e,'OData-Version':'4.0'},'json':!![]};return rp(_0x5ab51d);})[_0xb0ff('0x11')](function(_0x43abbc){var _0x27626a=_0x43abbc[_0xb0ff('0x1a')];var _0x1f1f3a=![];var _0x25452b=null;if(!_[_0xb0ff('0x1b')](_0x2b595e)){if(intUtil[_0xb0ff('0x1c')](_0x2b595e[_0xb0ff('0x1d')])){_0x22591b[_0xb0ff('0x1e')]=_0x2b595e[_0xb0ff('0x1d')];for(_0x25452b=0x0;_0x25452b<_0x27626a[_0xb0ff('0x1f')];_0x25452b++){if(_0x27626a[_0x25452b]['internalemailaddress']===_0x2b595e[_0xb0ff('0x1d')]&&!_0x27626a[_0x25452b][_0xb0ff('0x20')]){_0x1f1f3a=!![];logger[_0xb0ff('0x21')]('['+[_0x55906f[_0xb0ff('0x15')]()]+_0xb0ff('0x22')+_0x27626a[_0x25452b][_0xb0ff('0x23')]+'!');_0x22591b['userId']=_0x27626a[_0x25452b][_0xb0ff('0x23')];}}}}if(!_0x1f1f3a){logger[_0xb0ff('0x21')]('['+[_0x55906f['toUpperCase']()]+']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');_0x22591b[_0xb0ff('0x1e')]=_0x10cc0f['username'];for(_0x25452b=0x0;_0x25452b<_0x27626a['length'];_0x25452b++){if(_0x27626a[_0x25452b][_0xb0ff('0x24')]===_0x10cc0f[_0xb0ff('0xe')]){_0x22591b[_0xb0ff('0x25')]=_0x27626a[_0x25452b][_0xb0ff('0x23')];}}}_0x343a96(_0x22591b);})[_0xb0ff('0x13')](function(_0x3a9780){_0xd2bc9b(_0x3a9780[_0xb0ff('0x17')]);});});}function createEndUser(_0x43a3b2,_0x43c5d9,_0x5d4619,_0xd98331,_0x39c9c7,_0x2da68b){return new BPromise(function(_0x4151a8,_0x2e1e5d){return getAuthToken(_0x43c5d9,_0x5d4619,_0x2da68b)['then'](function(_0x21ef4e){var _0x1fa84a=_0x2da68b[_0xb0ff('0x26')]()==='outbound'?_0x39c9c7[_0xb0ff('0x27')]:_0x39c9c7[_0xb0ff('0x28')];var _0x45a3db={'method':_0xb0ff('0x29'),'uri':_0xd98331+_0xb0ff('0x2a'),'body':{'telephone1':_0x1fa84a,'fullname':_0x1fa84a,'firstname':_0x1fa84a,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0xb0ff('0x2b')+_0x43a3b2['userId']+')'},'headers':{'Authorization':_0xb0ff('0x2c')+_0x21ef4e,'OData-Version':_0xb0ff('0x2d')},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x45a3db);})[_0xb0ff('0x11')](function(_0x2cae26){var _0x466047=_0x2cae26[_0xb0ff('0x2e')][_0xb0ff('0x2f')];var _0x4d1e10=_0x466047[_0xb0ff('0x30')](_0x466047[_0xb0ff('0x31')]('(')+0x1,_0x466047[_0xb0ff('0x31')](')'));_0x43a3b2[_0xb0ff('0x32')]=_0x4d1e10;_0x4151a8(_0x43a3b2);})[_0xb0ff('0x13')](function(_0x5cb395){_0x2e1e5d(_0x5cb395[_0xb0ff('0x17')]);});});}function getEndUser(_0x52652f,_0x2e6e79,_0x51542a,_0x46c7f1,_0x32462c,_0x19f2d2){return new BPromise(function(_0x13ab18,_0x298214){return getAuthToken(_0x2e6e79,_0x51542a,_0x19f2d2)['then'](function(_0x158a00){var _0xeac3d3={'method':'GET','uri':_0x46c7f1+_0xb0ff('0x33'),'headers':{'Authorization':_0xb0ff('0x2c')+_0x158a00,'If-None-Match':null,'OData-Version':_0xb0ff('0x2d')},'json':!![]};return rp(_0xeac3d3);})[_0xb0ff('0x11')](function(_0x5e83d2){var _0x23cbb5=null;if(_0x5e83d2){var _0x5607d0=_0x5e83d2[_0xb0ff('0x1a')];var _0x14281e=![];for(_0x23cbb5=0x0;_0x23cbb5<_0x5607d0[_0xb0ff('0x1f')];_0x23cbb5++){var _0x29a8f4=_0x19f2d2[_0xb0ff('0x26')]()===_0xb0ff('0x34')?_0x32462c[_0xb0ff('0x27')]:_0x32462c['calleridnum'];if(_0x5607d0[_0x23cbb5][_0xb0ff('0x35')]===_0x29a8f4){_0x14281e=!![];_0x52652f[_0xb0ff('0x32')]=_0x5607d0[_0x23cbb5]['contactid'];}}if(_0x14281e){_0x13ab18(_0x52652f);}else{return createEndUser(_0x52652f,_0x2e6e79,_0x51542a,_0x46c7f1,_0x32462c,_0x19f2d2)[_0xb0ff('0x11')](function(_0x20b8e2){logger[_0xb0ff('0x21')]('['+[_0x19f2d2[_0xb0ff('0x15')]()]+']\x20Enduser\x20created!',_0x20b8e2['enduserId']);_0x13ab18(_0x20b8e2);});}}else{return createEndUser(_0x52652f,_0x2e6e79,_0x51542a,_0x46c7f1,_0x32462c,_0x19f2d2)[_0xb0ff('0x11')](function(_0x10193e){logger['info']('['+[_0x19f2d2[_0xb0ff('0x15')]()]+_0xb0ff('0x36'),_0x10193e[_0xb0ff('0x32')]);_0x13ab18(_0x10193e);});}});});}function getCustomFields(_0x62519e,_0x38cb83,_0x5c26b2){var _0x1c45f3={};if(_0x62519e['length']>0x0){_['forEach'](_0x62519e,function(_0x5903fb){if(_0x5903fb[_0xb0ff('0x37')]===_0xb0ff('0x38')&&_0x5903fb['nameField']&&!_0x5903fb[_0xb0ff('0x39')]){var _0x3cb80b=_0x5903fb['idField'][_0xb0ff('0x26')]();var _0xd59882=_0x3cb80b[_0xb0ff('0x30')](0x0,_0x3cb80b[_0xb0ff('0x3a')]('_'));var _0x2638e5=_0x3cb80b[_0xb0ff('0x30')](_0x3cb80b[_0xb0ff('0x3a')]('_')+0x1);if(_0xd59882===_0x5c26b2){_0x1c45f3[_0x2638e5]=_0x5903fb[_0xb0ff('0x3b')];}}});}return _0x1c45f3;}function getTicket(_0x1f1d38,_0x6e7d4e,_0x4a8104,_0xa5f1b9,_0x238736,_0x3a62e8,_0xe4479c){return new BPromise(function(_0x153f54,_0x48d9e2){var _0xa600f9;return getAuthToken(_0x6e7d4e,_0x4a8104,_0xe4479c)['then'](function(_0x401ab9){if(_0x3a62e8[_0xb0ff('0x3c')]===_0xb0ff('0x3d')){_0xa600f9={'method':_0xb0ff('0x29'),'uri':_0xa5f1b9+_0xb0ff('0x3e'),'body':Object[_0xb0ff('0x3f')]({},{'title':intUtil[_0xb0ff('0x40')](_0x3a62e8['Subjects'],_0x238736,'\x20'),'description':intUtil[_0xb0ff('0x40')](_0x3a62e8[_0xb0ff('0x41')],_0x238736,'\x0a'),'customerid_contact@odata.bind':_0xb0ff('0x42')+_0x1f1d38[_0xb0ff('0x32')]+')','ownerid@odata.bind':'/systemusers('+_0x1f1d38[_0xb0ff('0x25')]+')','caseorigincode':'1'},getCustomFields(_0x3a62e8[_0xb0ff('0x43')],_0x238736,_0x3a62e8['ticketType'])),'headers':{'Authorization':'Bearer\x20'+_0x401ab9,'OData-Version':_0xb0ff('0x2d')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x3a62e8[_0xb0ff('0x3c')]==='phonecall'){_0xa600f9={'method':_0xb0ff('0x29'),'uri':_0xa5f1b9+_0xb0ff('0x44'),'body':Object[_0xb0ff('0x3f')]({},{'subject':intUtil[_0xb0ff('0x40')](_0x3a62e8[_0xb0ff('0x45')],_0x238736,'\x20'),'phonenumber':String(_0x238736[_0xb0ff('0x28')]),'description':intUtil[_0xb0ff('0x40')](_0x3a62e8['Descriptions'],_0x238736,'\x0a'),'regardingobjectid_contact@odata.bind':'/contacts('+_0x1f1d38[_0xb0ff('0x32')]+')','ownerid@odata.bind':_0xb0ff('0x2b')+_0x1f1d38[_0xb0ff('0x25')]+')','directioncode':_0x1f1d38[_0xb0ff('0x46')]===_0xb0ff('0x47')?![]:!![],'phonecall_activity_parties':[{'partyid_systemuser@odata.bind':_0xb0ff('0x2b')+_0x1f1d38[_0xb0ff('0x25')]+')','participationtypemask':_0x1f1d38['callDirection']==='queue'?0x2:0x1},{'partyid_contact@odata.bind':_0xb0ff('0x42')+_0x1f1d38['enduserId']+')','participationtypemask':_0x1f1d38[_0xb0ff('0x46')]===_0xb0ff('0x47')?0x1:0x2}]},getCustomFields(_0x3a62e8[_0xb0ff('0x43')],_0x238736,_0x3a62e8[_0xb0ff('0x3c')])),'headers':{'Authorization':_0xb0ff('0x2c')+_0x401ab9,'OData-Version':_0xb0ff('0x2d')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0xa600f9);})['then'](function(_0x3eb573){var _0xacae81=_0x3eb573['headers'][_0xb0ff('0x2f')];var _0x3d5109=_0xacae81['substring'](_0xacae81['lastIndexOf']('(')+0x1,_0xacae81[_0xb0ff('0x31')](')'));_0x1f1d38['ticketId']=_0x3d5109;_0x153f54(_0x1f1d38);})[_0xb0ff('0x13')](function(_0x4443da){_0x48d9e2(_0x4443da['message']);});});}function emit(_0x40f16e,_0x3f896e,_0x55efcb,_0x27b73c){var _0x580759={'uri':util[_0xb0ff('0x48')](_0xb0ff('0x49'),_0x40f16e,_0x55efcb,_0x27b73c)};io['to'](util[_0xb0ff('0x48')](_0xb0ff('0x4a'),_0x3f896e))[_0xb0ff('0x4b')]('trigger:browser:url',_0x580759);}exports['cs']=function(_0x2e69a8,_0x2b2f7a,_0x2c5f5a,_0x587cff,_0x138e3c,_0x38d388,_0x30415f,_0xb103ee){var _0x2addbd={};_0x38d388[_0xb0ff('0x4c')]=intUtil[_0xb0ff('0x4d')](_0x38d388[_0xb0ff('0x4c')]);_0x38d388[_0xb0ff('0x4e')]=intUtil[_0xb0ff('0x4d')](_0x38d388['serverUrl']);_0x2addbd['callDirection']=_0xb103ee===_0xb0ff('0x47')||_0xb103ee===_0xb0ff('0x4f')?_0xb0ff('0x47'):'outbound';var _0x2b4e87=util['format']('%s/api/data/v9.0/',_0x38d388['remoteUri']);var _0x1c9998=util['format'](_0xb0ff('0x50'),_0x38d388[_0xb0ff('0x51')]);var _0x316f26=util[_0xb0ff('0x48')](_0xb0ff('0x52'),_0x38d388[_0xb0ff('0x4e')],_0x2b2f7a[_0xb0ff('0x53')],md5(_0x2b2f7a[_0xb0ff('0x53')]));if(_0x138e3c&&_0x138e3c[_0xb0ff('0x54')]){logger['info'](_0xb0ff('0x55'),_0xb0ff('0x56'));_0x2b2f7a[_0xb0ff('0x57')]=_0x316f26;}else if(_0x30415f&&_0x30415f[_0xb0ff('0x58')]&&_0x30415f['recordingFormat']!=='none'){logger[_0xb0ff('0x21')](_0xb0ff('0x59'),'Recording\x20is\x20enabled!');_0x2b2f7a[_0xb0ff('0x57')]=_0x316f26;}else{_0x2b2f7a[_0xb0ff('0x57')]='';}return getUser(_0x2addbd,_0x38d388,_0x587cff,_0x1c9998,_0x2b4e87,_0xb103ee)[_0xb0ff('0x11')](function(_0x19639e){logger[_0xb0ff('0x21')]('['+_0xb103ee[_0xb0ff('0x15')]()+_0xb0ff('0x5a'),_0x19639e['userId']);logger[_0xb0ff('0x21')]('['+_0xb103ee['toUpperCase']()+']\x20The\x20User\x20email\x20is:',_0x19639e[_0xb0ff('0x1e')]);return getEndUser(_0x19639e,_0x38d388,_0x1c9998,_0x2b4e87,_0x2b2f7a,_0xb103ee);})[_0xb0ff('0x11')](function(_0x5bb64e){logger['info']('['+_0xb103ee[_0xb0ff('0x15')]()+_0xb0ff('0x5b'),_0x5bb64e[_0xb0ff('0x32')]);logger[_0xb0ff('0x21')]('['+_0xb103ee['toUpperCase']()+_0xb0ff('0x5c'),_0x2b2f7a[_0xb0ff('0x28')]);return getTicket(_0x5bb64e,_0x38d388,_0x1c9998,_0x2b4e87,_0x2b2f7a,_0x2c5f5a,_0xb103ee);})['then'](function(_0x48c079){logger[_0xb0ff('0x21')](util['format']('['+_0xb103ee[_0xb0ff('0x15')]()+']\x20The\x20%s\x20ID\x20is:\x20%s',_0x2c5f5a[_0xb0ff('0x3c')],_0x48c079['ticketId']));logger[_0xb0ff('0x21')](util['format']('['+_0xb103ee[_0xb0ff('0x15')]()+_0xb0ff('0x5d'),_0xb103ee));if(_0xb103ee!=='abandoned'){logger[_0xb0ff('0x21')]('['+_0xb103ee[_0xb0ff('0x15')]()+']',_0xb0ff('0x5e'));emit(_0x38d388[_0xb0ff('0x4c')],_0x587cff[_0xb0ff('0x5f')],_0x2c5f5a[_0xb0ff('0x3c')],_0x48c079[_0xb0ff('0x60')]);}})['catch'](function(_0x5a1721){logger[_0xb0ff('0x14')]('['+_0xb103ee[_0xb0ff('0x15')]()+_0xb0ff('0x61'),util[_0xb0ff('0x62')](_0x5a1721,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x3a2e=['remoteUri','stripTrailingSlash','serverUrl','abandoned','outbound','%s/api/data/v9.0/','https://login.microsoftonline.com/%s/oauth2/token','tenantId','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]',']\x20The\x20User\x20ID\x20is:',']\x20Call\x20direction:\x20%s','name',']\x20Error\x20running\x20Dynamics365\x20integration','inspect','bluebird','request-promise','util','./util','md5','ioredis','../../../../config/logger','dynamics365','../../../../config/environment','redis','localhost','socket.io-emitter','POST','clientId','username','password','clientSecret','then','access_token','catch','error',']\x20Wrong\x20credentials!','message','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','isNil','validateEmail','email','userEmail','internalemailaddress','isdisabled','info','toUpperCase','systemuserid','userId',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','length','toLowerCase','destcalleridnum','calleridnum','contacts','/systemusers(','4.0','headers','odata-entityid','substring','lastIndexOf','enduserId','value','telephone1',']\x20Enduser\x20created!','string','nameField','indexOf','content','ticketType','incident','assign','getString','Subjects','Descriptions','/contacts(','Fields','phonecall','phonecalls','callDirection','queue','ticketId','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','user:%s','emit','trigger:browser:url'];(function(_0x4e5c37,_0x170d7b){var _0x2a80d1=function(_0x118e40){while(--_0x118e40){_0x4e5c37['push'](_0x4e5c37['shift']());}};_0x2a80d1(++_0x170d7b);}(_0x3a2e,0xd0));var _0xe3a2=function(_0x3bad23,_0x21eb4b){_0x3bad23=_0x3bad23-0x0;var _0x1e1970=_0x3a2e[_0x3bad23];return _0x1e1970;};'use strict';var _=require('lodash');var BPromise=require(_0xe3a2('0x0'));var rp=require(_0xe3a2('0x1'));var util=require(_0xe3a2('0x2'));var intUtil=require(_0xe3a2('0x3'));var md5=require(_0xe3a2('0x4'));var Redis=require(_0xe3a2('0x5'));var logger=require(_0xe3a2('0x6'))(_0xe3a2('0x7'));var config=require(_0xe3a2('0x8'));config[_0xe3a2('0x9')]=_['defaults'](config['redis'],{'host':_0xe3a2('0xa'),'port':0x18eb});var io=require(_0xe3a2('0xb'))(new Redis(config[_0xe3a2('0x9')]));function getAuthToken(_0x6476d8,_0x492ba5,_0x4981e0){var _0x3d1fdc={'method':_0xe3a2('0xc'),'uri':_0x492ba5,'form':{'client_id':_0x6476d8[_0xe3a2('0xd')],'resource':_0x6476d8['remoteUri'],'username':_0x6476d8[_0xe3a2('0xe')],'password':_0x6476d8['password'],'grant_type':_0xe3a2('0xf'),'client_secret':_0x6476d8[_0xe3a2('0x10')]},'json':!![]};return rp(_0x3d1fdc)[_0xe3a2('0x11')](function(_0x32b338){return _0x32b338[_0xe3a2('0x12')];})[_0xe3a2('0x13')](function(_0x110aac){logger[_0xe3a2('0x14')]('['+[_0x4981e0['toUpperCase']()]+_0xe3a2('0x15'));return _0x110aac[_0xe3a2('0x16')];});}function getUser(_0x385524,_0x22ba31,_0x3b7594,_0x3e07b7,_0x40e0ad,_0x45c0a8){return new BPromise(function(_0x7c64be,_0x30e8d8){return getAuthToken(_0x22ba31,_0x3e07b7,_0x45c0a8)[_0xe3a2('0x11')](function(_0x414f62){var _0x516901={'method':_0xe3a2('0x17'),'uri':_0x40e0ad+_0xe3a2('0x18'),'headers':{'Authorization':_0xe3a2('0x19')+_0x414f62,'OData-Version':'4.0'},'json':!![]};return rp(_0x516901);})[_0xe3a2('0x11')](function(_0x35acd3){var _0x1e88e0=_0x35acd3['value'];var _0xd9a661=![];var _0xe1c506=null;if(!_[_0xe3a2('0x1a')](_0x3b7594)){if(intUtil[_0xe3a2('0x1b')](_0x3b7594[_0xe3a2('0x1c')])){_0x385524[_0xe3a2('0x1d')]=_0x3b7594[_0xe3a2('0x1c')];for(_0xe1c506=0x0;_0xe1c506<_0x1e88e0['length'];_0xe1c506++){if(_0x1e88e0[_0xe1c506][_0xe3a2('0x1e')]===_0x3b7594['email']&&!_0x1e88e0[_0xe1c506][_0xe3a2('0x1f')]){_0xd9a661=!![];logger[_0xe3a2('0x20')]('['+[_0x45c0a8[_0xe3a2('0x21')]()]+']\x20Agent\x20found\x20'+_0x1e88e0[_0xe1c506][_0xe3a2('0x22')]+'!');_0x385524[_0xe3a2('0x23')]=_0x1e88e0[_0xe1c506][_0xe3a2('0x22')];}}}}if(!_0xd9a661){logger[_0xe3a2('0x20')]('['+[_0x45c0a8[_0xe3a2('0x21')]()]+_0xe3a2('0x24'));_0x385524[_0xe3a2('0x1d')]=_0x22ba31[_0xe3a2('0xe')];for(_0xe1c506=0x0;_0xe1c506<_0x1e88e0[_0xe3a2('0x25')];_0xe1c506++){if(_0x1e88e0[_0xe1c506][_0xe3a2('0x1e')]===_0x22ba31[_0xe3a2('0xe')]){_0x385524[_0xe3a2('0x23')]=_0x1e88e0[_0xe1c506][_0xe3a2('0x22')];}}}_0x7c64be(_0x385524);})[_0xe3a2('0x13')](function(_0x47823d){_0x30e8d8(_0x47823d[_0xe3a2('0x16')]);});});}function createEndUser(_0x453e41,_0x2b86a8,_0x2193f9,_0x1c2b85,_0x22969d,_0x3b420d){return new BPromise(function(_0x2a0c38,_0xbe9fb4){return getAuthToken(_0x2b86a8,_0x2193f9,_0x3b420d)[_0xe3a2('0x11')](function(_0x2f8047){var _0x59dc2f=_0x3b420d[_0xe3a2('0x26')]()==='outbound'?_0x22969d[_0xe3a2('0x27')]:_0x22969d[_0xe3a2('0x28')];var _0x3735e6={'method':_0xe3a2('0xc'),'uri':_0x1c2b85+_0xe3a2('0x29'),'body':{'telephone1':_0x59dc2f,'fullname':_0x59dc2f,'firstname':_0x59dc2f,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0xe3a2('0x2a')+_0x453e41[_0xe3a2('0x23')]+')'},'headers':{'Authorization':'Bearer\x20'+_0x2f8047,'OData-Version':_0xe3a2('0x2b')},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x3735e6);})[_0xe3a2('0x11')](function(_0x5081ce){var _0x40ea1a=_0x5081ce[_0xe3a2('0x2c')][_0xe3a2('0x2d')];var _0x58327=_0x40ea1a[_0xe3a2('0x2e')](_0x40ea1a[_0xe3a2('0x2f')]('(')+0x1,_0x40ea1a[_0xe3a2('0x2f')](')'));_0x453e41[_0xe3a2('0x30')]=_0x58327;_0x2a0c38(_0x453e41);})[_0xe3a2('0x13')](function(_0x54b5e6){_0xbe9fb4(_0x54b5e6[_0xe3a2('0x16')]);});});}function getEndUser(_0x4453af,_0x31df0a,_0x3d7de4,_0x4c5319,_0x4369ec,_0x3c91c5){return new BPromise(function(_0x12583e,_0x2a63f2){return getAuthToken(_0x31df0a,_0x3d7de4,_0x3c91c5)[_0xe3a2('0x11')](function(_0x36ffe2){var _0x3087bf={'method':_0xe3a2('0x17'),'uri':_0x4c5319+'contacts?$select=telephone1','headers':{'Authorization':'Bearer\x20'+_0x36ffe2,'If-None-Match':null,'OData-Version':_0xe3a2('0x2b')},'json':!![]};return rp(_0x3087bf);})['then'](function(_0x5e06a3){var _0x4588e2=null;if(_0x5e06a3){var _0x177846=_0x5e06a3[_0xe3a2('0x31')];var _0x5606a3=![];for(_0x4588e2=0x0;_0x4588e2<_0x177846['length'];_0x4588e2++){var _0x111072=_0x3c91c5[_0xe3a2('0x26')]()==='outbound'?_0x4369ec[_0xe3a2('0x27')]:_0x4369ec[_0xe3a2('0x28')];if(_0x177846[_0x4588e2][_0xe3a2('0x32')]===_0x111072){_0x5606a3=!![];_0x4453af[_0xe3a2('0x30')]=_0x177846[_0x4588e2]['contactid'];}}if(_0x5606a3){_0x12583e(_0x4453af);}else{return createEndUser(_0x4453af,_0x31df0a,_0x3d7de4,_0x4c5319,_0x4369ec,_0x3c91c5)[_0xe3a2('0x11')](function(_0x32e83c){logger[_0xe3a2('0x20')]('['+[_0x3c91c5[_0xe3a2('0x21')]()]+_0xe3a2('0x33'),_0x32e83c[_0xe3a2('0x30')]);_0x12583e(_0x32e83c);});}}else{return createEndUser(_0x4453af,_0x31df0a,_0x3d7de4,_0x4c5319,_0x4369ec,_0x3c91c5)[_0xe3a2('0x11')](function(_0x561f5b){logger['info']('['+[_0x3c91c5[_0xe3a2('0x21')]()]+']\x20Enduser\x20Created!',_0x561f5b['enduserId']);_0x12583e(_0x561f5b);});}});});}function getCustomFields(_0x117b07,_0x155394,_0x87382a){var _0x1d4daa={};if(_0x117b07[_0xe3a2('0x25')]>0x0){_['forEach'](_0x117b07,function(_0x5af5fa){if(_0x5af5fa['type']===_0xe3a2('0x34')&&_0x5af5fa[_0xe3a2('0x35')]&&!_0x5af5fa['customField']){var _0x53f8bb=_0x5af5fa['idField'][_0xe3a2('0x26')]();var _0x30f5a6=_0x53f8bb['substring'](0x0,_0x53f8bb[_0xe3a2('0x36')]('_'));var _0x5b83f2=_0x53f8bb[_0xe3a2('0x2e')](_0x53f8bb['indexOf']('_')+0x1);if(_0x30f5a6===_0x87382a){_0x1d4daa[_0x5b83f2]=_0x5af5fa[_0xe3a2('0x37')];}}});}return _0x1d4daa;}function getTicket(_0x317d1e,_0x1f2614,_0xfb295e,_0x4ad4fa,_0x5ae7ab,_0x116010,_0x478887){return new BPromise(function(_0x446f87,_0x47b00f){var _0x26b510;return getAuthToken(_0x1f2614,_0xfb295e,_0x478887)['then'](function(_0x3a17ed){if(_0x116010[_0xe3a2('0x38')]===_0xe3a2('0x39')){_0x26b510={'method':_0xe3a2('0xc'),'uri':_0x4ad4fa+'incidents','body':Object[_0xe3a2('0x3a')]({},{'title':intUtil[_0xe3a2('0x3b')](_0x116010[_0xe3a2('0x3c')],_0x5ae7ab,'\x20'),'description':intUtil[_0xe3a2('0x3b')](_0x116010[_0xe3a2('0x3d')],_0x5ae7ab,'\x0a'),'customerid_contact@odata.bind':_0xe3a2('0x3e')+_0x317d1e[_0xe3a2('0x30')]+')','ownerid@odata.bind':'/systemusers('+_0x317d1e[_0xe3a2('0x23')]+')','caseorigincode':'1'},getCustomFields(_0x116010[_0xe3a2('0x3f')],_0x5ae7ab,_0x116010[_0xe3a2('0x38')])),'headers':{'Authorization':'Bearer\x20'+_0x3a17ed,'OData-Version':_0xe3a2('0x2b')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x116010[_0xe3a2('0x38')]===_0xe3a2('0x40')){_0x26b510={'method':_0xe3a2('0xc'),'uri':_0x4ad4fa+_0xe3a2('0x41'),'body':Object[_0xe3a2('0x3a')]({},{'subject':intUtil[_0xe3a2('0x3b')](_0x116010[_0xe3a2('0x3c')],_0x5ae7ab,'\x20'),'phonenumber':String(_0x5ae7ab[_0xe3a2('0x28')]),'description':intUtil[_0xe3a2('0x3b')](_0x116010[_0xe3a2('0x3d')],_0x5ae7ab,'\x0a'),'regardingobjectid_contact@odata.bind':_0xe3a2('0x3e')+_0x317d1e['enduserId']+')','ownerid@odata.bind':'/systemusers('+_0x317d1e['userId']+')','directioncode':_0x317d1e[_0xe3a2('0x42')]===_0xe3a2('0x43')?![]:!![],'phonecall_activity_parties':[{'partyid_systemuser@odata.bind':'/systemusers('+_0x317d1e[_0xe3a2('0x23')]+')','participationtypemask':_0x317d1e[_0xe3a2('0x42')]===_0xe3a2('0x43')?0x2:0x1},{'partyid_contact@odata.bind':_0xe3a2('0x3e')+_0x317d1e[_0xe3a2('0x30')]+')','participationtypemask':_0x317d1e[_0xe3a2('0x42')]===_0xe3a2('0x43')?0x1:0x2}]},getCustomFields(_0x116010[_0xe3a2('0x3f')],_0x5ae7ab,_0x116010['ticketType'])),'headers':{'Authorization':_0xe3a2('0x19')+_0x3a17ed,'OData-Version':_0xe3a2('0x2b')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x26b510);})[_0xe3a2('0x11')](function(_0x19a74f){var _0x1e428b=_0x19a74f['headers'][_0xe3a2('0x2d')];var _0x4a5382=_0x1e428b[_0xe3a2('0x2e')](_0x1e428b[_0xe3a2('0x2f')]('(')+0x1,_0x1e428b[_0xe3a2('0x2f')](')'));_0x317d1e[_0xe3a2('0x44')]=_0x4a5382;_0x446f87(_0x317d1e);})['catch'](function(_0x130e55){_0x47b00f(_0x130e55[_0xe3a2('0x16')]);});});}function emit(_0x3ed12a,_0x5d8f8e,_0x1a9fa7,_0x3693fe){var _0x27e31b={'uri':util[_0xe3a2('0x45')](_0xe3a2('0x46'),_0x3ed12a,_0x1a9fa7,_0x3693fe)};io['to'](util[_0xe3a2('0x45')](_0xe3a2('0x47'),_0x5d8f8e))[_0xe3a2('0x48')](_0xe3a2('0x49'),_0x27e31b);}exports['cs']=function(_0x34e8f4,_0x2bed36,_0xc0b3f6,_0x4984fe,_0x342d28,_0xac9b20,_0x3f95a2,_0x52f0cb){var _0xdee214={};_0xac9b20[_0xe3a2('0x4a')]=intUtil[_0xe3a2('0x4b')](_0xac9b20[_0xe3a2('0x4a')]);_0xac9b20[_0xe3a2('0x4c')]=intUtil[_0xe3a2('0x4b')](_0xac9b20[_0xe3a2('0x4c')]);_0xdee214[_0xe3a2('0x42')]=_0x52f0cb===_0xe3a2('0x43')||_0x52f0cb===_0xe3a2('0x4d')?_0xe3a2('0x43'):_0xe3a2('0x4e');var _0x23ab72=util['format'](_0xe3a2('0x4f'),_0xac9b20[_0xe3a2('0x4a')]);var _0x375897=util[_0xe3a2('0x45')](_0xe3a2('0x50'),_0xac9b20[_0xe3a2('0x51')]);var _0xe5a1a0=util[_0xe3a2('0x45')](_0xe3a2('0x52'),_0xac9b20[_0xe3a2('0x4c')],_0x2bed36[_0xe3a2('0x53')],md5(_0x2bed36['uniqueid']));if(_0x342d28&&_0x342d28['monitor_format']){logger[_0xe3a2('0x20')]('[QUEUE]',_0xe3a2('0x54'));_0x2bed36[_0xe3a2('0x55')]=_0xe5a1a0;}else if(_0x3f95a2&&_0x3f95a2[_0xe3a2('0x56')]&&_0x3f95a2[_0xe3a2('0x56')]!==_0xe3a2('0x57')){logger['info'](_0xe3a2('0x58'),_0xe3a2('0x54'));_0x2bed36[_0xe3a2('0x55')]=_0xe5a1a0;}else{_0x2bed36[_0xe3a2('0x55')]='';}return getUser(_0xdee214,_0xac9b20,_0x4984fe,_0x375897,_0x23ab72,_0x52f0cb)['then'](function(_0x1bf1ca){logger[_0xe3a2('0x20')]('['+_0x52f0cb[_0xe3a2('0x21')]()+_0xe3a2('0x59'),_0x1bf1ca[_0xe3a2('0x23')]);logger[_0xe3a2('0x20')]('['+_0x52f0cb[_0xe3a2('0x21')]()+']\x20The\x20User\x20email\x20is:',_0x1bf1ca[_0xe3a2('0x1d')]);return getEndUser(_0x1bf1ca,_0xac9b20,_0x375897,_0x23ab72,_0x2bed36,_0x52f0cb);})[_0xe3a2('0x11')](function(_0x41e1bb){logger[_0xe3a2('0x20')]('['+_0x52f0cb[_0xe3a2('0x21')]()+']\x20The\x20Enduser\x20ID\x20is:',_0x41e1bb['enduserId']);logger[_0xe3a2('0x20')]('['+_0x52f0cb[_0xe3a2('0x21')]()+']\x20The\x20Enduser\x20phone\x20is:',_0x2bed36[_0xe3a2('0x28')]);return getTicket(_0x41e1bb,_0xac9b20,_0x375897,_0x23ab72,_0x2bed36,_0xc0b3f6,_0x52f0cb);})['then'](function(_0x62f785){logger['info'](util['format']('['+_0x52f0cb[_0xe3a2('0x21')]()+']\x20The\x20%s\x20ID\x20is:\x20%s',_0xc0b3f6[_0xe3a2('0x38')],_0x62f785['ticketId']));logger[_0xe3a2('0x20')](util['format']('['+_0x52f0cb[_0xe3a2('0x21')]()+_0xe3a2('0x5a'),_0x52f0cb));if(_0x52f0cb!==_0xe3a2('0x4d')){logger[_0xe3a2('0x20')]('['+_0x52f0cb[_0xe3a2('0x21')]()+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0xac9b20[_0xe3a2('0x4a')],_0x4984fe[_0xe3a2('0x5b')],_0xc0b3f6[_0xe3a2('0x38')],_0x62f785[_0xe3a2('0x44')]);}})[_0xe3a2('0x13')](function(_0x338057){logger[_0xe3a2('0x14')]('['+_0x52f0cb[_0xe3a2('0x21')]()+_0xe3a2('0x5c'),util[_0xe3a2('0x5d')](_0x338057,{'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 a9f91f4..2d81e87 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 _0xb8ca=['calleridname','calleridnum','Subjects','getString','Descriptions','Tags','name','custom_fields','keyBy','value','%s/api/v2/tickets','remoteUri','POST','Ticket\x20created!','validateEmail','%s/api/v2/agents','then','Agent\x20found!','find','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','%s/api/v2/contacts','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Basic\x20%s','apiKey','toString','debug','stringify','GET','length','forEach','type','nameField','customField','string','idField','push','variable','variableName','Variable','toLowerCase','queue','stripTrailingSlash','serverUrl','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','catch','error','recordingFormat','none','Authorization','The\x20User\x20ID\x20is:','destcalleridnum','user:%s','%s/helpdesk/tickets/%d','abandoned','monitor_format','[ABANDONED]','lodash','request-promise','util','ioredis','./util','../../../../config/environment','defaults','localhost','socket.io-emitter','application/json','emit','info','merge','format'];(function(_0x1c0f95,_0x3292d4){var _0x3cbeb1=function(_0xe1dd95){while(--_0xe1dd95){_0x1c0f95['push'](_0x1c0f95['shift']());}};_0x3cbeb1(++_0x3292d4);}(_0xb8ca,0x1ea));var _0xab8c=function(_0x41686d,_0x4aa5f7){_0x41686d=_0x41686d-0x0;var _0x4cd5bb=_0xb8ca[_0x41686d];return _0x4cd5bb;};'use strict';var _=require(_0xab8c('0x0'));var rp=require(_0xab8c('0x1'));var md5=require('md5');var util=require(_0xab8c('0x2'));var Redis=require(_0xab8c('0x3'));var intUtil=require(_0xab8c('0x4'));var config=require(_0xab8c('0x5'));var logger=require('../../../../config/logger')('freshdesk');config['redis']=_[_0xab8c('0x6')](config['redis'],{'host':_0xab8c('0x7'),'port':0x18eb});var io=require(_0xab8c('0x8'))(new Redis(config['redis']));var headers={'Content-Type':_0xab8c('0x9'),'Accept':_0xab8c('0x9')};function emit(_0x5c7cee,_0x13b81d,_0x20e3e6){io['to'](_0x5c7cee)[_0xab8c('0xa')](_0x13b81d,_0x20e3e6);}function getTicket(_0x413dfe,_0x1f13f8,_0x777e57,_0x343aac,_0x124945){logger[_0xab8c('0xb')]('Creating\x20new\x20ticket...');var _0x11b74b=_[_0xab8c('0xc')]({'responder_id':_0x1f13f8['id'],'requester_id':_0x777e57['id'],'name':util[_0xab8c('0xd')]('Caller\x20-\x20%s',_0x124945[_0xab8c('0xe')]),'phone':_0x124945[_0xab8c('0xf')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil['getString'](_0x343aac[_0xab8c('0x10')],_0x124945,'\x20'),'description':intUtil[_0xab8c('0x11')](_0x343aac[_0xab8c('0x12')],_0x124945,'
'),'tags':getTags(_0x343aac[_0xab8c('0x13')],_0xab8c('0x14'))},getCustomFields(_0x343aac['Fields'],_0x124945));_0x11b74b[_0xab8c('0x15')]=_['mapValues'](_[_0xab8c('0x16')](_0x11b74b[_0xab8c('0x15')],'id'),_0xab8c('0x17'));return request({'uri':util[_0xab8c('0xd')](_0xab8c('0x18'),_0x413dfe[_0xab8c('0x19')]),'method':_0xab8c('0x1a'),'body':_0x11b74b})['then'](function(_0x4d5e7d){logger['info'](_0xab8c('0x1b'));return _0x4d5e7d;});}function getUser(_0x47d1fc,_0x5cf925){if(intUtil[_0xab8c('0x1c')](_0x5cf925)){return request({'uri':util[_0xab8c('0xd')](_0xab8c('0x1d'),_0x47d1fc[_0xab8c('0x19')]),'qs':{'email':_0x5cf925}})[_0xab8c('0x1e')](function(_0x31afd7){if(_0x31afd7['length']){logger[_0xab8c('0xb')](_0xab8c('0x1f'));return _[_0xab8c('0x20')](_0x31afd7,function(_0x50a94f){return _0x50a94f['contact']['email']===_0x5cf925;});}else{logger[_0xab8c('0xb')](_0xab8c('0x21'));return request({'uri':util[_0xab8c('0xd')](_0xab8c('0x22'),_0x47d1fc[_0xab8c('0x19')])})[_0xab8c('0x1e')](function(_0x2d27c3){logger['info'](_0xab8c('0x23'));return _0x2d27c3;});}});}else{logger['info'](_0xab8c('0x24'));return request({'uri':util[_0xab8c('0xd')]('%s/api/v2/agents/me',_0x47d1fc[_0xab8c('0x19')])})[_0xab8c('0x1e')](function(_0x25c476){logger[_0xab8c('0xb')]('Admin\x20account\x20selected.');return _0x25c476;});}}function getEndUser(_0x44474e,_0x242a8d,_0x5cc0cb){logger[_0xab8c('0xb')](_0xab8c('0x25'),_0x5cc0cb);return request({'uri':util[_0xab8c('0xd')](_0xab8c('0x26'),_0x44474e['remoteUri']),'qs':{'phone':_0x5cc0cb}})[_0xab8c('0x1e')](function(_0x1429b7){if(_0x1429b7['length']){logger[_0xab8c('0xb')](_0xab8c('0x27'));return _[_0xab8c('0x20')](_0x1429b7,{'phone':_0x5cc0cb});}else{logger[_0xab8c('0xb')](_0xab8c('0x28'));return request({'uri':util[_0xab8c('0xd')](_0xab8c('0x26'),_0x44474e['remoteUri']),'method':'POST','body':{'name':_0x242a8d,'phone':_0x5cc0cb}})[_0xab8c('0x1e')](function(_0x9c8786){logger[_0xab8c('0xb')]('Enduser\x20created.');return _0x9c8786;});}});}function getAuth(_0x377461){return util['format'](_0xab8c('0x29'),new Buffer(_0x377461[_0xab8c('0x2a')]+':X')[_0xab8c('0x2b')]('base64'));}function request(_0x1336cc){logger[_0xab8c('0x2c')]('[HTTP]',JSON[_0xab8c('0x2d')](_0x1336cc));return rp(_[_0xab8c('0x6')](_0x1336cc,{'method':_0xab8c('0x2e'),'headers':headers,'json':!![]}));}function getTags(_0x5bb227,_0x45107f){var _0x216059=[];if(_0x5bb227&&_0x5bb227[_0xab8c('0x2f')]>0x0){_0x216059=_['map'](_0x5bb227,_0x45107f);}return _0x216059;}function getCustomFields(_0x4918e9,_0x4c0b41){var _0x111003=[];var _0x37b145={'custom_fields':[]};if(_0x4918e9[_0xab8c('0x2f')]>0x0){_[_0xab8c('0x30')](_0x4918e9,function(_0x1ecc53){if(_0x1ecc53[_0xab8c('0x31')]==='string'&&_0x1ecc53[_0xab8c('0x32')]&&!_0x1ecc53[_0xab8c('0x33')]){_0x37b145[_0x1ecc53[_0xab8c('0x32')]['toLowerCase']()]=_0x1ecc53['content'][_0xab8c('0x2b')]();}else if(_0x1ecc53[_0xab8c('0x31')]===_0xab8c('0x34')&&_0x1ecc53[_0xab8c('0x35')]&&_0x1ecc53[_0xab8c('0x33')]){_0x37b145['custom_fields'][_0xab8c('0x36')]({'id':_0x1ecc53['idField'],'value':_0x1ecc53['content'][_0xab8c('0x2b')]()});}else if(_0x1ecc53[_0xab8c('0x31')]===_0xab8c('0x37')&&_0x1ecc53['variableName']&&_0x1ecc53['idField']&&_0x1ecc53[_0xab8c('0x33')]){_0x4c0b41[_0x1ecc53['variableName']]&&_0x37b145[_0xab8c('0x15')]['push']({'id':_0x1ecc53[_0xab8c('0x35')],'value':_0x4c0b41[_0x1ecc53[_0xab8c('0x38')]][_0xab8c('0x2b')]()});}else if(_0x1ecc53[_0xab8c('0x31')]==='customVariable'&&_0x1ecc53[_0xab8c('0x39')]&&_0x1ecc53['Variable'][_0xab8c('0x14')]&&_0x1ecc53['idField']&&_0x1ecc53[_0xab8c('0x33')]){_0x4c0b41[_0x1ecc53[_0xab8c('0x39')][_0xab8c('0x14')][_0xab8c('0x3a')]()]&&_0x37b145[_0xab8c('0x15')][_0xab8c('0x36')]({'id':_0x1ecc53['idField'],'value':_0x4c0b41[_0x1ecc53['Variable'][_0xab8c('0x14')][_0xab8c('0x3a')]()]['toString']()});}});}return _0x37b145;}exports[_0xab8c('0x3b')]=function(_0x4b9720,_0x4e8ce1,_0x4e3f1c,_0xa0e603,_0x3cc913,_0x1a8d24){var _0x625628,_0x1eb5dc;_0x1a8d24['remoteUri']=intUtil[_0xab8c('0x3c')](_0x1a8d24[_0xab8c('0x19')]);_0x1a8d24[_0xab8c('0x3d')]=intUtil[_0xab8c('0x3c')](_0x1a8d24[_0xab8c('0x3d')]);if(_0x3cc913&&_0x3cc913['monitor_format']){logger[_0xab8c('0xb')](_0xab8c('0x3e'),_0xab8c('0x3f'));_0x4e8ce1[_0xab8c('0x40')]=util[_0xab8c('0xd')](_0xab8c('0x41'),_0x1a8d24[_0xab8c('0x3d')],_0x4e8ce1[_0xab8c('0x42')],md5(_0x4e8ce1[_0xab8c('0x42')]));}else{_0x4e8ce1[_0xab8c('0x40')]='';}headers['Authorization']=getAuth(_0x1a8d24);return getUser(_0x1a8d24,_0xa0e603[_0xab8c('0x43')])[_0xab8c('0x1e')](function(_0xb76a4e){_0x625628=_0xb76a4e;logger[_0xab8c('0xb')]('The\x20User\x20ID\x20is:',_0x625628['id']);return getEndUser(_0x1a8d24,_0x4e8ce1['calleridname'],_0x4e8ce1['calleridnum']);})['then'](function(_0x49d09f){_0x1eb5dc=_0x49d09f;logger[_0xab8c('0xb')](_0xab8c('0x44'),_0x1eb5dc['id']);return getTicket(_0x1a8d24,_0x625628,_0x1eb5dc,_0x4e3f1c,_0x4e8ce1);})[_0xab8c('0x1e')](function(_0x254a5a){if(_0x254a5a&&_0x254a5a['id']){logger[_0xab8c('0xb')](_0xab8c('0x1b'));logger[_0xab8c('0xb')](_0xab8c('0x45'),_0x254a5a['id']);logger['info'](_0xab8c('0x3e'),_0xab8c('0x46'));emit(util[_0xab8c('0xd')]('user:%s',_0xa0e603[_0xab8c('0x14')]),_0xab8c('0x47'),{'uri':util[_0xab8c('0xd')]('%s/helpdesk/tickets/%d',_0x1a8d24[_0xab8c('0x19')],_0x254a5a['id'])});}})[_0xab8c('0x48')](function(_0x3bc47d){logger[_0xab8c('0x49')]('[QUEUE]',JSON['stringify'](_0x3bc47d));});};exports['outbound']=function(_0x16ff9b,_0x538701,_0x164cab,_0x4567b3,_0x12ed8d,_0x4de122,_0x422d05){var _0x1c9a68,_0x4b17d8;_0x4de122[_0xab8c('0x19')]=intUtil['stripTrailingSlash'](_0x4de122[_0xab8c('0x19')]);_0x4de122[_0xab8c('0x3d')]=intUtil[_0xab8c('0x3c')](_0x4de122[_0xab8c('0x3d')]);if(_0x422d05&&_0x422d05[_0xab8c('0x4a')]&&_0x422d05[_0xab8c('0x4a')]!==_0xab8c('0x4b')){logger[_0xab8c('0xb')]('[OUTBOUND]',_0xab8c('0x3f'));_0x538701[_0xab8c('0x40')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4de122['serverUrl'],_0x538701['uniqueid'],md5(_0x538701['uniqueid']));}headers[_0xab8c('0x4c')]=getAuth(_0x4de122);return getUser(_0x4de122,_0x4567b3[_0xab8c('0x43')])[_0xab8c('0x1e')](function(_0x73a485){_0x1c9a68=_0x73a485;logger['info'](_0xab8c('0x4d'),_0x1c9a68['id']);return getEndUser(_0x4de122,_0x538701['destcalleridname'],_0x538701[_0xab8c('0x4e')]);})['then'](function(_0x3890ce){_0x4b17d8=_0x3890ce;logger[_0xab8c('0xb')](_0xab8c('0x44'),_0x4b17d8['id']);return getTicket(_0x4de122,_0x1c9a68,_0x4b17d8,_0x164cab,_0x538701);})[_0xab8c('0x1e')](function(_0x1859ff){if(_0x1859ff&&_0x1859ff['id']){logger[_0xab8c('0xb')](_0xab8c('0x1b'));logger[_0xab8c('0xb')]('The\x20Ticket\x20ID\x20is:',_0x1859ff['id']);logger[_0xab8c('0xb')]('[OUTBOUND]',_0xab8c('0x46'));emit(util[_0xab8c('0xd')](_0xab8c('0x4f'),_0x4567b3['name']),_0xab8c('0x47'),{'uri':util[_0xab8c('0xd')](_0xab8c('0x50'),_0x4de122['remoteUri'],_0x1859ff['id'])});}})['catch'](function(_0x45a455){logger['error']('[OUTBOUND]',JSON[_0xab8c('0x2d')](_0x45a455));});};exports[_0xab8c('0x51')]=function(_0x3b6de9,_0x58e8c4,_0x1bc523,_0x24ab40,_0x1cc58b,_0x1f812f){var _0x570750,_0x405f4c;_0x1f812f['remoteUri']=intUtil[_0xab8c('0x3c')](_0x1f812f[_0xab8c('0x19')]);_0x1f812f['serverUrl']=intUtil[_0xab8c('0x3c')](_0x1f812f[_0xab8c('0x3d')]);if(_0x1cc58b&&_0x1cc58b[_0xab8c('0x52')]){logger['info'](_0xab8c('0x53'),_0xab8c('0x3f'));_0x58e8c4['recordingURL']=util[_0xab8c('0xd')](_0xab8c('0x41'),_0x1f812f[_0xab8c('0x3d')],_0x58e8c4['uniqueid'],md5(_0x58e8c4[_0xab8c('0x42')]));}else{_0x58e8c4[_0xab8c('0x40')]='';}headers[_0xab8c('0x4c')]=getAuth(_0x1f812f);return getUser(_0x1f812f,'')[_0xab8c('0x1e')](function(_0x273859){_0x570750=_0x273859;logger[_0xab8c('0xb')](_0xab8c('0x4d'),_0x570750['id']);return getEndUser(_0x1f812f,_0x58e8c4['calleridname'],_0x58e8c4[_0xab8c('0xf')]);})['then'](function(_0x2595c7){_0x405f4c=_0x2595c7;logger['info'](_0xab8c('0x44'),_0x405f4c['id']);return getTicket(_0x1f812f,_0x570750,_0x405f4c,_0x1bc523,_0x58e8c4);})[_0xab8c('0x1e')](function(_0x2df49a){if(_0x2df49a){logger[_0xab8c('0xb')](_0xab8c('0x1b'));logger['info'](_0xab8c('0x45'),_0x2df49a['id']);}})[_0xab8c('0x48')](function(_0x4d0fd4){logger[_0xab8c('0x49')](_0xab8c('0x53'),JSON[_0xab8c('0x2d')](_0x4d0fd4));});}; \ No newline at end of file +var _0x73c1=['mapValues','keyBy','%s/api/v2/tickets','remoteUri','POST','then','Ticket\x20created!','validateEmail','%s/api/v2/agents','Agent\x20found!','find','contact','%s/api/v2/agents/me','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','Admin\x20account\x20selected.','Searching\x20enduser\x20with\x20phone','%s/api/v2/contacts','length','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Enduser\x20created.','Basic\x20%s','apiKey','toString','base64','debug','stringify','GET','map','forEach','string','nameField','customField','toLowerCase','content','type','push','idField','variable','variableName','Variable','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','Authorization','email','The\x20User\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','catch','error','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','user:%s','trigger:browser:url','%s/helpdesk/tickets/%d','abandoned','[ABANDONED]','lodash','request-promise','util','ioredis','./util','../../../../config/environment','../../../../config/logger','freshdesk','defaults','redis','localhost','socket.io-emitter','application/json','emit','info','Creating\x20new\x20ticket...','merge','format','Caller\x20-\x20%s','calleridname','calleridnum','getString','Subjects','Descriptions','
','Tags','name','Fields','custom_fields'];(function(_0x2a1955,_0x24548b){var _0xbd319=function(_0x28814c){while(--_0x28814c){_0x2a1955['push'](_0x2a1955['shift']());}};_0xbd319(++_0x24548b);}(_0x73c1,0x16b));var _0x173c=function(_0x54d82d,_0x4e0145){_0x54d82d=_0x54d82d-0x0;var _0x2a0d7e=_0x73c1[_0x54d82d];return _0x2a0d7e;};'use strict';var _=require(_0x173c('0x0'));var rp=require(_0x173c('0x1'));var md5=require('md5');var util=require(_0x173c('0x2'));var Redis=require(_0x173c('0x3'));var intUtil=require(_0x173c('0x4'));var config=require(_0x173c('0x5'));var logger=require(_0x173c('0x6'))(_0x173c('0x7'));config['redis']=_[_0x173c('0x8')](config[_0x173c('0x9')],{'host':_0x173c('0xa'),'port':0x18eb});var io=require(_0x173c('0xb'))(new Redis(config[_0x173c('0x9')]));var headers={'Content-Type':_0x173c('0xc'),'Accept':_0x173c('0xc')};function emit(_0x319576,_0x46223c,_0x4832a7){io['to'](_0x319576)[_0x173c('0xd')](_0x46223c,_0x4832a7);}function getTicket(_0x170522,_0x59b47c,_0x3b9da4,_0x3db811,_0x3b8cdb){logger[_0x173c('0xe')](_0x173c('0xf'));var _0x4a142c=_[_0x173c('0x10')]({'responder_id':_0x59b47c['id'],'requester_id':_0x3b9da4['id'],'name':util[_0x173c('0x11')](_0x173c('0x12'),_0x3b8cdb[_0x173c('0x13')]),'phone':_0x3b8cdb[_0x173c('0x14')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0x173c('0x15')](_0x3db811[_0x173c('0x16')],_0x3b8cdb,'\x20'),'description':intUtil[_0x173c('0x15')](_0x3db811[_0x173c('0x17')],_0x3b8cdb,_0x173c('0x18')),'tags':getTags(_0x3db811[_0x173c('0x19')],_0x173c('0x1a'))},getCustomFields(_0x3db811[_0x173c('0x1b')],_0x3b8cdb));_0x4a142c[_0x173c('0x1c')]=_[_0x173c('0x1d')](_[_0x173c('0x1e')](_0x4a142c[_0x173c('0x1c')],'id'),'value');return request({'uri':util[_0x173c('0x11')](_0x173c('0x1f'),_0x170522[_0x173c('0x20')]),'method':_0x173c('0x21'),'body':_0x4a142c})[_0x173c('0x22')](function(_0x244712){logger['info'](_0x173c('0x23'));return _0x244712;});}function getUser(_0x13dd8c,_0x28dbbd){if(intUtil[_0x173c('0x24')](_0x28dbbd)){return request({'uri':util[_0x173c('0x11')](_0x173c('0x25'),_0x13dd8c['remoteUri']),'qs':{'email':_0x28dbbd}})[_0x173c('0x22')](function(_0x308634){if(_0x308634['length']){logger[_0x173c('0xe')](_0x173c('0x26'));return _[_0x173c('0x27')](_0x308634,function(_0x32a90f){return _0x32a90f[_0x173c('0x28')]['email']===_0x28dbbd;});}else{logger['info']('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0x173c('0x11')](_0x173c('0x29'),_0x13dd8c['remoteUri'])})[_0x173c('0x22')](function(_0x4eed61){logger['info']('Admin\x20account\x20selected.');return _0x4eed61;});}});}else{logger['info'](_0x173c('0x2a'));return request({'uri':util['format'](_0x173c('0x29'),_0x13dd8c[_0x173c('0x20')])})[_0x173c('0x22')](function(_0x4617cc){logger['info'](_0x173c('0x2b'));return _0x4617cc;});}}function getEndUser(_0xfd4ba1,_0x1574f7,_0x30ac11){logger['info'](_0x173c('0x2c'),_0x30ac11);return request({'uri':util['format'](_0x173c('0x2d'),_0xfd4ba1[_0x173c('0x20')]),'qs':{'phone':_0x30ac11}})[_0x173c('0x22')](function(_0x69f4ef){if(_0x69f4ef[_0x173c('0x2e')]){logger[_0x173c('0xe')](_0x173c('0x2f'));return _[_0x173c('0x27')](_0x69f4ef,{'phone':_0x30ac11});}else{logger[_0x173c('0xe')](_0x173c('0x30'));return request({'uri':util[_0x173c('0x11')]('%s/api/v2/contacts',_0xfd4ba1['remoteUri']),'method':'POST','body':{'name':_0x1574f7,'phone':_0x30ac11}})[_0x173c('0x22')](function(_0x22e619){logger[_0x173c('0xe')](_0x173c('0x31'));return _0x22e619;});}});}function getAuth(_0x4498aa){return util[_0x173c('0x11')](_0x173c('0x32'),new Buffer(_0x4498aa[_0x173c('0x33')]+':X')[_0x173c('0x34')](_0x173c('0x35')));}function request(_0x38d624){logger[_0x173c('0x36')]('[HTTP]',JSON[_0x173c('0x37')](_0x38d624));return rp(_[_0x173c('0x8')](_0x38d624,{'method':_0x173c('0x38'),'headers':headers,'json':!![]}));}function getTags(_0x500bb9,_0x552c2d){var _0x55fb3f=[];if(_0x500bb9&&_0x500bb9[_0x173c('0x2e')]>0x0){_0x55fb3f=_[_0x173c('0x39')](_0x500bb9,_0x552c2d);}return _0x55fb3f;}function getCustomFields(_0x1d5186,_0x4de926){var _0x51f1dc=[];var _0xaa5998={'custom_fields':[]};if(_0x1d5186['length']>0x0){_[_0x173c('0x3a')](_0x1d5186,function(_0x231e45){if(_0x231e45['type']===_0x173c('0x3b')&&_0x231e45[_0x173c('0x3c')]&&!_0x231e45[_0x173c('0x3d')]){_0xaa5998[_0x231e45[_0x173c('0x3c')][_0x173c('0x3e')]()]=_0x231e45[_0x173c('0x3f')][_0x173c('0x34')]();}else if(_0x231e45[_0x173c('0x40')]===_0x173c('0x3b')&&_0x231e45['idField']&&_0x231e45[_0x173c('0x3d')]){_0xaa5998[_0x173c('0x1c')][_0x173c('0x41')]({'id':_0x231e45[_0x173c('0x42')],'value':_0x231e45[_0x173c('0x3f')][_0x173c('0x34')]()});}else if(_0x231e45[_0x173c('0x40')]===_0x173c('0x43')&&_0x231e45['variableName']&&_0x231e45['idField']&&_0x231e45[_0x173c('0x3d')]){_0x4de926[_0x231e45[_0x173c('0x44')]]&&_0xaa5998[_0x173c('0x1c')]['push']({'id':_0x231e45[_0x173c('0x42')],'value':_0x4de926[_0x231e45['variableName']][_0x173c('0x34')]()});}else if(_0x231e45[_0x173c('0x40')]==='customVariable'&&_0x231e45['Variable']&&_0x231e45[_0x173c('0x45')][_0x173c('0x1a')]&&_0x231e45[_0x173c('0x42')]&&_0x231e45[_0x173c('0x3d')]){_0x4de926[_0x231e45[_0x173c('0x45')][_0x173c('0x1a')][_0x173c('0x3e')]()]&&_0xaa5998[_0x173c('0x1c')]['push']({'id':_0x231e45[_0x173c('0x42')],'value':_0x4de926[_0x231e45[_0x173c('0x45')][_0x173c('0x1a')][_0x173c('0x3e')]()][_0x173c('0x34')]()});}});}return _0xaa5998;}exports[_0x173c('0x46')]=function(_0x566942,_0x22605e,_0x18d22a,_0x23887c,_0x2cd9ad,_0x5dbb22){var _0xa4ab37,_0x180d20;_0x5dbb22[_0x173c('0x20')]=intUtil[_0x173c('0x47')](_0x5dbb22['remoteUri']);_0x5dbb22[_0x173c('0x48')]=intUtil[_0x173c('0x47')](_0x5dbb22[_0x173c('0x48')]);if(_0x2cd9ad&&_0x2cd9ad[_0x173c('0x49')]){logger['info'](_0x173c('0x4a'),_0x173c('0x4b'));_0x22605e['recordingURL']=util[_0x173c('0x11')](_0x173c('0x4c'),_0x5dbb22[_0x173c('0x48')],_0x22605e[_0x173c('0x4d')],md5(_0x22605e['uniqueid']));}else{_0x22605e[_0x173c('0x4e')]='';}headers[_0x173c('0x4f')]=getAuth(_0x5dbb22);return getUser(_0x5dbb22,_0x23887c[_0x173c('0x50')])[_0x173c('0x22')](function(_0x539a48){_0xa4ab37=_0x539a48;logger[_0x173c('0xe')](_0x173c('0x51'),_0xa4ab37['id']);return getEndUser(_0x5dbb22,_0x22605e[_0x173c('0x13')],_0x22605e[_0x173c('0x14')]);})[_0x173c('0x22')](function(_0x3225e2){_0x180d20=_0x3225e2;logger[_0x173c('0xe')]('The\x20Enduser\x20ID\x20is:',_0x180d20['id']);return getTicket(_0x5dbb22,_0xa4ab37,_0x180d20,_0x18d22a,_0x22605e);})['then'](function(_0x41eb5c){if(_0x41eb5c&&_0x41eb5c['id']){logger[_0x173c('0xe')](_0x173c('0x23'));logger[_0x173c('0xe')](_0x173c('0x52'),_0x41eb5c['id']);logger['info'](_0x173c('0x4a'),_0x173c('0x53'));emit(util[_0x173c('0x11')]('user:%s',_0x23887c['name']),'trigger:browser:url',{'uri':util[_0x173c('0x11')]('%s/helpdesk/tickets/%d',_0x5dbb22[_0x173c('0x20')],_0x41eb5c['id'])});}})[_0x173c('0x54')](function(_0x65726a){logger[_0x173c('0x55')](_0x173c('0x4a'),JSON['stringify'](_0x65726a));});};exports[_0x173c('0x56')]=function(_0x501c05,_0x52091a,_0x229aa9,_0x5bd538,_0x19112d,_0x1227c7,_0x2346e5){var _0x32f9ca,_0x1a0c48;_0x1227c7[_0x173c('0x20')]=intUtil[_0x173c('0x47')](_0x1227c7[_0x173c('0x20')]);_0x1227c7[_0x173c('0x48')]=intUtil[_0x173c('0x47')](_0x1227c7[_0x173c('0x48')]);if(_0x2346e5&&_0x2346e5['recordingFormat']&&_0x2346e5[_0x173c('0x57')]!==_0x173c('0x58')){logger[_0x173c('0xe')](_0x173c('0x59'),'Recording\x20is\x20enabled!');_0x52091a[_0x173c('0x4e')]=util['format'](_0x173c('0x4c'),_0x1227c7[_0x173c('0x48')],_0x52091a[_0x173c('0x4d')],md5(_0x52091a['uniqueid']));}headers[_0x173c('0x4f')]=getAuth(_0x1227c7);return getUser(_0x1227c7,_0x5bd538[_0x173c('0x50')])[_0x173c('0x22')](function(_0x5ecb53){_0x32f9ca=_0x5ecb53;logger['info'](_0x173c('0x51'),_0x32f9ca['id']);return getEndUser(_0x1227c7,_0x52091a[_0x173c('0x5a')],_0x52091a[_0x173c('0x5b')]);})[_0x173c('0x22')](function(_0xa3245){_0x1a0c48=_0xa3245;logger[_0x173c('0xe')](_0x173c('0x5c'),_0x1a0c48['id']);return getTicket(_0x1227c7,_0x32f9ca,_0x1a0c48,_0x229aa9,_0x52091a);})[_0x173c('0x22')](function(_0x31ea19){if(_0x31ea19&&_0x31ea19['id']){logger[_0x173c('0xe')](_0x173c('0x23'));logger[_0x173c('0xe')](_0x173c('0x52'),_0x31ea19['id']);logger[_0x173c('0xe')](_0x173c('0x59'),_0x173c('0x53'));emit(util['format'](_0x173c('0x5d'),_0x5bd538[_0x173c('0x1a')]),_0x173c('0x5e'),{'uri':util['format'](_0x173c('0x5f'),_0x1227c7[_0x173c('0x20')],_0x31ea19['id'])});}})[_0x173c('0x54')](function(_0x18d6e5){logger['error']('[OUTBOUND]',JSON[_0x173c('0x37')](_0x18d6e5));});};exports[_0x173c('0x60')]=function(_0x193d91,_0x523c85,_0x1f6513,_0x34ac8e,_0x1c0822,_0x196014){var _0x524ec1,_0x48b844;_0x196014[_0x173c('0x20')]=intUtil[_0x173c('0x47')](_0x196014[_0x173c('0x20')]);_0x196014[_0x173c('0x48')]=intUtil[_0x173c('0x47')](_0x196014[_0x173c('0x48')]);if(_0x1c0822&&_0x1c0822[_0x173c('0x49')]){logger[_0x173c('0xe')](_0x173c('0x61'),'Recording\x20is\x20enabled!');_0x523c85[_0x173c('0x4e')]=util[_0x173c('0x11')](_0x173c('0x4c'),_0x196014['serverUrl'],_0x523c85['uniqueid'],md5(_0x523c85[_0x173c('0x4d')]));}else{_0x523c85[_0x173c('0x4e')]='';}headers[_0x173c('0x4f')]=getAuth(_0x196014);return getUser(_0x196014,'')['then'](function(_0x4e5c89){_0x524ec1=_0x4e5c89;logger[_0x173c('0xe')](_0x173c('0x51'),_0x524ec1['id']);return getEndUser(_0x196014,_0x523c85['calleridname'],_0x523c85[_0x173c('0x14')]);})['then'](function(_0x728bd0){_0x48b844=_0x728bd0;logger[_0x173c('0xe')](_0x173c('0x5c'),_0x48b844['id']);return getTicket(_0x196014,_0x524ec1,_0x48b844,_0x1f6513,_0x523c85);})[_0x173c('0x22')](function(_0x39b9d7){if(_0x39b9d7){logger['info']('Ticket\x20created!');logger[_0x173c('0xe')](_0x173c('0x52'),_0x39b9d7['id']);}})[_0x173c('0x54')](function(_0x33e377){logger[_0x173c('0x55')](_0x173c('0x61'),JSON['stringify'](_0x33e377));});}; \ 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 52d9fdf..627318a 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 _0x6ca7=['./salesforce','./sugarcrm','./freshdesk','./zoho','./vtiger','./dynamics365','salesforce','sugarcrm','freshdesk','servicenow','dynamics365','exec','includes','data1','toLowerCase','data2','find','queue','outbound','log','EVENT\x20UNKNOWN','abandoned','zendesk','zoho','vtiger','error','[EXEC]','format','data3','../../../../config/logger','%s\x20account\x20#%s\x20not\x20found','lodash','util','./zendesk'];(function(_0x3682fa,_0x556fe9){var _0x925b61=function(_0x410d48){while(--_0x410d48){_0x3682fa['push'](_0x3682fa['shift']());}};_0x925b61(++_0x556fe9);}(_0x6ca7,0x1d9));var _0x76ca=function(_0x585ee5,_0x1c9dba){_0x585ee5=_0x585ee5-0x0;var _0x470808=_0x6ca7[_0x585ee5];return _0x470808;};'use strict';var _=require(_0x76ca('0x0'));var util=require(_0x76ca('0x1'));var zendesk=require(_0x76ca('0x2'));var salesforce=require(_0x76ca('0x3'));var sugarcrm=require(_0x76ca('0x4'));var freshdesk=require(_0x76ca('0x5'));var zoho=require(_0x76ca('0x6'));var desk=require('./desk');var vtiger=require(_0x76ca('0x7'));var servicenow=require('./servicenow');var dynamics365=require(_0x76ca('0x8'));var integrations=['zendesk',_0x76ca('0x9'),_0x76ca('0xa'),_0x76ca('0xb'),'zoho','desk','vtiger',_0x76ca('0xc'),_0x76ca('0xd')];exports[_0x76ca('0xe')]=function(_0x284e4b,_0x19f883,_0x5a59f2,_0x23f98e,_0x3b1c1c,_0x339dbb){if(_0x5a59f2){if(_[_0x76ca('0xf')](integrations,_0x284e4b[_0x76ca('0x10')][_0x76ca('0x11')]())){try{var _0x4e983d=null;var _0xbbb3b2='';var _0xf438aa=_0x5a59f2[_0x284e4b[_0x76ca('0x10')][_0x76ca('0x11')]()];if(_0xf438aa){var _0x12a7ec=_0xf438aa[_0x284e4b[_0x76ca('0x12')]];if(_0x12a7ec){var _0x407bf0=_[_0x76ca('0x13')](_0x12a7ec['Configurations'],{'id':parseInt(_0x284e4b['data3'],0xa)});if(_0x407bf0){if(_0x23f98e){if(_0x3b1c1c&&_0x19f883[_0x76ca('0x14')]){_0xbbb3b2=_0x76ca('0x14');}else if(_0x19f883['routeId']){_0xbbb3b2=_0x76ca('0x15');}else{console[_0x76ca('0x16')](_0x76ca('0x17'),_0x19f883);}}else{_0xbbb3b2=_0x76ca('0x18');}switch(_0x284e4b[_0x76ca('0x10')][_0x76ca('0x11')]()){case _0x76ca('0x19'):zendesk[_0xbbb3b2](_0x284e4b,_0x19f883,_0x407bf0,_0x23f98e,_0x3b1c1c,_0x12a7ec,_0x339dbb);break;case _0x76ca('0x9'):salesforce[_0xbbb3b2](_0x284e4b,_0x19f883,_0x407bf0,_0x23f98e,_0x3b1c1c,_0x12a7ec,_0x339dbb);break;case'sugarcrm':sugarcrm[_0xbbb3b2](_0x284e4b,_0x19f883,_0x407bf0,_0x23f98e,_0x3b1c1c,_0x12a7ec,_0x339dbb);break;case _0x76ca('0xb'):freshdesk[_0xbbb3b2](_0x284e4b,_0x19f883,_0x407bf0,_0x23f98e,_0x3b1c1c,_0x12a7ec,_0x339dbb);break;case _0x76ca('0x1a'):zoho[_0xbbb3b2](_0x284e4b,_0x19f883,_0x407bf0,_0x23f98e,_0x3b1c1c,_0x12a7ec,_0x339dbb);break;case'desk':desk[_0xbbb3b2](_0x284e4b,_0x19f883,_0x407bf0,_0x23f98e,_0x3b1c1c,_0x12a7ec,_0x339dbb);break;case _0x76ca('0x1b'):vtiger[_0xbbb3b2](_0x284e4b,_0x19f883,_0x407bf0,_0x23f98e,_0x3b1c1c,_0x12a7ec,_0x339dbb);break;case _0x76ca('0xc'):servicenow['cs'](_0x284e4b,_0x19f883,_0x407bf0,_0x23f98e,_0x3b1c1c,_0x12a7ec,_0x339dbb,_0xbbb3b2);break;case _0x76ca('0xd'):dynamics365['cs'](_0x284e4b,_0x19f883,_0x407bf0,_0x23f98e,_0x3b1c1c,_0x12a7ec,_0x339dbb,_0xbbb3b2);break;default:console['log']('unknown\x20integration');}}else{_0x4e983d=require('../../../../config/logger')(_0x284e4b[_0x76ca('0x10')][_0x76ca('0x11')]());_0x4e983d[_0x76ca('0x1c')](_0x76ca('0x1d'),util[_0x76ca('0x1e')]('%s\x20configuration\x20#%s\x20not\x20found',_0x284e4b[_0x76ca('0x10')]['toLowerCase'](),_0x284e4b[_0x76ca('0x1f')]));}}else{_0x4e983d=require(_0x76ca('0x20'))(_0x284e4b['data1'][_0x76ca('0x11')]());_0x4e983d[_0x76ca('0x1c')](_0x76ca('0x1d'),util[_0x76ca('0x1e')](_0x76ca('0x21'),_0x284e4b['data1'][_0x76ca('0x11')](),_0x284e4b['data2']));}}else{}}catch(_0x411ad2){console[_0x76ca('0x1c')](_0x411ad2);}}}}; \ No newline at end of file +var _0x1169=['zoho','vtiger','servicenow','exec','includes','data1','toLowerCase','data2','Configurations','data3','queue','routeId','outbound','log','abandoned','salesforce','desk','dynamics365','../../../../config/logger','error','format','%s\x20configuration\x20#%s\x20not\x20found','%s\x20account\x20#%s\x20not\x20found','lodash','util','./zendesk','./salesforce','./sugarcrm','./freshdesk','./zoho','./dynamics365','zendesk','sugarcrm','freshdesk'];(function(_0x4f4e4b,_0x46ea73){var _0x23a628=function(_0x56791){while(--_0x56791){_0x4f4e4b['push'](_0x4f4e4b['shift']());}};_0x23a628(++_0x46ea73);}(_0x1169,0x16b));var _0x9116=function(_0x26c7fb,_0x39bb80){_0x26c7fb=_0x26c7fb-0x0;var _0x117ca5=_0x1169[_0x26c7fb];return _0x117ca5;};'use strict';var _=require(_0x9116('0x0'));var util=require(_0x9116('0x1'));var zendesk=require(_0x9116('0x2'));var salesforce=require(_0x9116('0x3'));var sugarcrm=require(_0x9116('0x4'));var freshdesk=require(_0x9116('0x5'));var zoho=require(_0x9116('0x6'));var desk=require('./desk');var vtiger=require('./vtiger');var servicenow=require('./servicenow');var dynamics365=require(_0x9116('0x7'));var integrations=[_0x9116('0x8'),'salesforce',_0x9116('0x9'),_0x9116('0xa'),_0x9116('0xb'),'desk',_0x9116('0xc'),_0x9116('0xd'),'dynamics365'];exports[_0x9116('0xe')]=function(_0x404e11,_0x3702cb,_0x3ef5e5,_0x3713b2,_0x549280,_0x18c397){if(_0x3ef5e5){if(_[_0x9116('0xf')](integrations,_0x404e11[_0x9116('0x10')][_0x9116('0x11')]())){try{var _0x34e1e3=null;var _0x4222c7='';var _0x4dd7f3=_0x3ef5e5[_0x404e11['data1'][_0x9116('0x11')]()];if(_0x4dd7f3){var _0x47f6c2=_0x4dd7f3[_0x404e11[_0x9116('0x12')]];if(_0x47f6c2){var _0x847c67=_['find'](_0x47f6c2[_0x9116('0x13')],{'id':parseInt(_0x404e11[_0x9116('0x14')],0xa)});if(_0x847c67){if(_0x3713b2){if(_0x549280&&_0x3702cb['queue']){_0x4222c7=_0x9116('0x15');}else if(_0x3702cb[_0x9116('0x16')]){_0x4222c7=_0x9116('0x17');}else{console[_0x9116('0x18')]('EVENT\x20UNKNOWN',_0x3702cb);}}else{_0x4222c7=_0x9116('0x19');}switch(_0x404e11[_0x9116('0x10')][_0x9116('0x11')]()){case _0x9116('0x8'):zendesk[_0x4222c7](_0x404e11,_0x3702cb,_0x847c67,_0x3713b2,_0x549280,_0x47f6c2,_0x18c397);break;case _0x9116('0x1a'):salesforce[_0x4222c7](_0x404e11,_0x3702cb,_0x847c67,_0x3713b2,_0x549280,_0x47f6c2,_0x18c397);break;case'sugarcrm':sugarcrm[_0x4222c7](_0x404e11,_0x3702cb,_0x847c67,_0x3713b2,_0x549280,_0x47f6c2,_0x18c397);break;case _0x9116('0xa'):freshdesk[_0x4222c7](_0x404e11,_0x3702cb,_0x847c67,_0x3713b2,_0x549280,_0x47f6c2,_0x18c397);break;case _0x9116('0xb'):zoho[_0x4222c7](_0x404e11,_0x3702cb,_0x847c67,_0x3713b2,_0x549280,_0x47f6c2,_0x18c397);break;case _0x9116('0x1b'):desk[_0x4222c7](_0x404e11,_0x3702cb,_0x847c67,_0x3713b2,_0x549280,_0x47f6c2,_0x18c397);break;case'vtiger':vtiger[_0x4222c7](_0x404e11,_0x3702cb,_0x847c67,_0x3713b2,_0x549280,_0x47f6c2,_0x18c397);break;case'servicenow':servicenow['cs'](_0x404e11,_0x3702cb,_0x847c67,_0x3713b2,_0x549280,_0x47f6c2,_0x18c397,_0x4222c7);break;case _0x9116('0x1c'):dynamics365['cs'](_0x404e11,_0x3702cb,_0x847c67,_0x3713b2,_0x549280,_0x47f6c2,_0x18c397,_0x4222c7);break;default:console[_0x9116('0x18')]('unknown\x20integration');}}else{_0x34e1e3=require(_0x9116('0x1d'))(_0x404e11[_0x9116('0x10')][_0x9116('0x11')]());_0x34e1e3[_0x9116('0x1e')]('[EXEC]',util[_0x9116('0x1f')](_0x9116('0x20'),_0x404e11[_0x9116('0x10')][_0x9116('0x11')](),_0x404e11['data3']));}}else{_0x34e1e3=require(_0x9116('0x1d'))(_0x404e11[_0x9116('0x10')][_0x9116('0x11')]());_0x34e1e3[_0x9116('0x1e')]('[EXEC]',util[_0x9116('0x1f')](_0x9116('0x21'),_0x404e11[_0x9116('0x10')][_0x9116('0x11')](),_0x404e11['data2']));}}else{}}catch(_0x47576f){console['error'](_0x47576f);}}}}; \ 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 c1b6d0c..d88633f 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 _0x70eb=['redis','localhost','socket.io-emitter','emit','ticketType','Task','assign','utc','getString','Subjects','Descriptions','ContactId','create','validateEmail','sobject','then','length','find','info','Agent\x20%s\x20found.','resolve','Name','identity','user_id','display_name','moduleSearch','contact_lead','Contact','execute','Lead','contact','lead','Case','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','Phone','Enduser\x20with\x20phone\x20%s\x20found.','Enduser\x20with\x20phone\x20%s\x20not\x20found.','format','Caller\x20-\x20%s','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','Company','No\x20Company','upperFirst','type','string','idField','variable','variableName','customVariable','Variable','name','toLowerCase','toString','password','securityToken','Connection','remoteUri','login','username','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','calleridname','Fields','queue','[QUEUE]\x20Ticket\x20%s\x20created','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','trigger:salesforce:display','user:%s','trigger:browser:url','%s/%s/e','instanceUrl','error','outbound','recordingFormat','[OUTBOUND]','destcalleridname','destcalleridnum','integrationTab','Salesforce\x20account\x20type\x20not\x20recognized','catch','stringify','[ABANDONED]','isNil','calleridnum','[ABANDONED]\x20Ticket\x20%s\x20created.','[ABANDONED]\x20Integration\x20account\x20type\x20%s.','moment','bluebird','jsforce','util','./util','../../../../config/logger','salesforce'];(function(_0x4f2a9a,_0x109262){var _0x4ac78d=function(_0xa7441e){while(--_0xa7441e){_0x4f2a9a['push'](_0x4f2a9a['shift']());}};_0x4ac78d(++_0x109262);}(_0x70eb,0x18d));var _0xb70e=function(_0x494d1f,_0x3f72ff){_0x494d1f=_0x494d1f-0x0;var _0x457b6e=_0x70eb[_0x494d1f];return _0x457b6e;};'use strict';var _=require('lodash');var rp=require('request-promise');var moment=require(_0xb70e('0x0'));var BPromise=require(_0xb70e('0x1'));var md5=require('md5');var jsforce=require(_0xb70e('0x2'));var util=require(_0xb70e('0x3'));var Redis=require('ioredis');var intUtil=require(_0xb70e('0x4'));var config=require('../../../../config/environment');var logger=require(_0xb70e('0x5'))(_0xb70e('0x6'));config[_0xb70e('0x7')]=_['defaults'](config[_0xb70e('0x7')],{'host':_0xb70e('0x8'),'port':0x18eb});var io=require(_0xb70e('0x9'))(new Redis(config[_0xb70e('0x7')]));function emit(_0x403c68,_0x1213de,_0x2e172e){io['to'](_0x403c68)[_0xb70e('0xa')](_0x1213de,_0x2e172e);}function getTicket(_0xb9597d,_0x3323b3,_0x466203,_0x22aea1,_0x5241ea,_0x54ea2e,_0x41acab,_0x31626d){var _0x494766={};if(_0x22aea1[_0xb70e('0xb')]===_0xb70e('0xc')){_0x494766=Object[_0xb70e('0xd')]({},{'OwnerId':_0x3323b3['id'],'ActivityDate':moment[_0xb70e('0xe')](),'IsReminderSet':![],'IsRecurrence':![],'Subject':intUtil[_0xb70e('0xf')](_0x22aea1[_0xb70e('0x10')],_0x5241ea,'\x20'),'Description':intUtil[_0xb70e('0xf')](_0x22aea1['Descriptions'],_0x5241ea,'\x0a')},getCustomFields(_0x54ea2e,_0x5241ea));if(_0x466203){_0x494766['WhoId']=_0x466203['id'];}}else if(_0x22aea1['ticketType']==='Case'){_0x494766=Object[_0xb70e('0xd')]({},{'OwnerId':_0x3323b3['id'],'Subject':intUtil[_0xb70e('0xf')](_0x22aea1[_0xb70e('0x10')],_0x5241ea,'\x20'),'Description':intUtil[_0xb70e('0xf')](_0x22aea1[_0xb70e('0x11')],_0x5241ea,'\x0a')},getCustomFields(_0x54ea2e,_0x5241ea));if(_0x466203){_0x494766[_0xb70e('0x12')]=_0x466203['id'];}}return _0x41acab['sobject'](_0x22aea1[_0xb70e('0xb')])[_0xb70e('0x13')](_0x494766);}function getUser(_0x1da35b,_0x5cefaa,_0x4788d1){if(!_['isNil'](_0x5cefaa)&&intUtil[_0xb70e('0x14')](_0x5cefaa)){var _0x22267b={'Email':_0x5cefaa};var _0x3dbaf3={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x4788d1[_0xb70e('0x15')]('User')['find'](_0x22267b,_0x3dbaf3)['execute']()[_0xb70e('0x16')](function(_0x431840){if(_0x431840[_0xb70e('0x17')]){var _0x458f0d=_[_0xb70e('0x18')](_0x431840,function(_0x47aa90){return _0x47aa90['Email']===_0x5cefaa;});if(_0x458f0d){logger[_0xb70e('0x19')](_0xb70e('0x1a'),_0x5cefaa);return BPromise[_0xb70e('0x1b')]({'id':_0x458f0d['Id'],'name':_0x458f0d[_0xb70e('0x1c')]});}}else{logger[_0xb70e('0x19')]('Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.',_0x5cefaa);return _0x4788d1['identity']()[_0xb70e('0x16')](function(_0x5b9692){return BPromise[_0xb70e('0x1b')]({'id':_0x5b9692['user_id'],'name':_0x5b9692['display_name']});});}});}else{logger[_0xb70e('0x19')]('Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.',_0x5cefaa);return _0x4788d1[_0xb70e('0x1d')]()[_0xb70e('0x16')](function(_0x23b201){return BPromise[_0xb70e('0x1b')]({'id':_0x23b201[_0xb70e('0x1e')],'name':_0x23b201[_0xb70e('0x1f')]});});}}function getEndUser(_0x3917e4,_0x3f7c80,_0x4aceaa,_0x449769,_0x55adac){var _0x279935={'Phone':_0x449769};var _0x59642a={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0xb70e('0x1b')]()[_0xb70e('0x16')](function(){if(_0x3f7c80[_0xb70e('0xb')]==='Task'){logger['info']('Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.',_0x449769,_0x3f7c80[_0xb70e('0x20')]);switch(_0x3f7c80[_0xb70e('0x20')]){case _0xb70e('0x21'):return _0x55adac[_0xb70e('0x15')](_0xb70e('0x22'))[_0xb70e('0x18')](_0x279935,_0x59642a)[_0xb70e('0x23')]()[_0xb70e('0x16')](function(_0x1f3637){if(_0x1f3637&&_0x1f3637[_0xb70e('0x17')]){return _0x1f3637;}else{return _0x55adac['sobject'](_0xb70e('0x24'))['find'](_0x279935,_0x59642a);}});case _0xb70e('0x25'):return _0x55adac[_0xb70e('0x15')](_0xb70e('0x22'))['find'](_0x279935,_0x59642a)[_0xb70e('0x23')]();case _0xb70e('0x26'):return _0x55adac['sobject'](_0xb70e('0x24'))['find'](_0x279935,_0x59642a);default:return null;}}else if(_0x3f7c80[_0xb70e('0xb')]===_0xb70e('0x27')){logger[_0xb70e('0x19')](_0xb70e('0x28'),_0x449769,_0xb70e('0x25'));return _0x55adac[_0xb70e('0x15')](_0xb70e('0x22'))[_0xb70e('0x18')](_0x279935,_0x59642a)[_0xb70e('0x23')]();}})[_0xb70e('0x16')](function(_0x4123e5){if(_0x4123e5&&_0x4123e5[_0xb70e('0x17')]){var _0x427102=_[_0xb70e('0x18')](_0x4123e5,function(_0x16a79d){return _0x16a79d[_0xb70e('0x29')]===_0x449769;});if(_0x427102){return BPromise['resolve']({'id':_0x427102['Id'],'name':_0x427102[_0xb70e('0x1c')],'phone':_0x427102['Phone']});}}})[_0xb70e('0x16')](function(_0x338230){if(_0x338230){logger[_0xb70e('0x19')](_0xb70e('0x2a'),_0x449769);return BPromise[_0xb70e('0x1b')](_0x338230);}else{logger[_0xb70e('0x19')](_0xb70e('0x2b'),_0x449769);var _0x9f0d5b={'LastName':_0x4aceaa!==''?_0x4aceaa:util[_0xb70e('0x2c')](_0xb70e('0x2d'),_0x449769),'Phone':_0x449769};if(_0x3f7c80['moduleCreate']){if(_0x3f7c80['moduleCreate']==='contact'){logger[_0xb70e('0x19')]('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x449769,_0x3f7c80[_0xb70e('0x2e')]);}else if(_0x3f7c80[_0xb70e('0x2e')]===_0xb70e('0x26')&&_0x3f7c80['ticketType']===_0xb70e('0xc')){logger[_0xb70e('0x19')](_0xb70e('0x2f'),_0x449769,_0x3f7c80[_0xb70e('0x2e')]);_0x9f0d5b[_0xb70e('0x30')]=_0xb70e('0x31');}else{return null;}}return _0x55adac[_0xb70e('0x15')](_[_0xb70e('0x32')](_0x3f7c80['moduleCreate']))[_0xb70e('0x13')](_0x9f0d5b);}});}function getCustomFields(_0x4d6583,_0xbaf1e6){var _0x37d05a={};if(_0x4d6583[_0xb70e('0x17')]>0x0){_['forEach'](_0x4d6583,function(_0x4f76ad){if(_0x4f76ad[_0xb70e('0x33')]===_0xb70e('0x34')&&_0x4f76ad[_0xb70e('0x35')]){_0x37d05a[_0x4f76ad[_0xb70e('0x35')]]=_0x4f76ad['content']['toString']();}else if(_0x4f76ad['type']===_0xb70e('0x36')&&_0x4f76ad['variableName']&&_0x4f76ad[_0xb70e('0x35')]){_0xbaf1e6[_0x4f76ad[_0xb70e('0x37')]]&&(_0x37d05a[_0x4f76ad[_0xb70e('0x35')]]=_0xbaf1e6[_0x4f76ad[_0xb70e('0x37')]]['toString']());}else if(_0x4f76ad[_0xb70e('0x33')]===_0xb70e('0x38')&&_0x4f76ad[_0xb70e('0x39')]&&_0x4f76ad[_0xb70e('0x39')][_0xb70e('0x3a')]&&_0x4f76ad[_0xb70e('0x35')]){_0xbaf1e6[_0x4f76ad[_0xb70e('0x39')]['name'][_0xb70e('0x3b')]()]&&(_0x37d05a[_0x4f76ad[_0xb70e('0x35')]]=_0xbaf1e6[_0x4f76ad[_0xb70e('0x39')]['name'][_0xb70e('0x3b')]()][_0xb70e('0x3c')]());}});}return _0x37d05a;}function getConnection(_0x5d60bd){var _0x4cb4d0=_0x5d60bd[_0xb70e('0x3d')]['concat'](_0x5d60bd[_0xb70e('0x3e')]);var _0x677ca8=new jsforce[(_0xb70e('0x3f'))]({'oauth2':{'loginUrl':_0x5d60bd[_0xb70e('0x40')]||'https://login.salesforce.com','clientId':_0x5d60bd['clientId'],'clientSecret':_0x5d60bd['clientSecret']}});return _0x677ca8[_0xb70e('0x41')](_0x5d60bd[_0xb70e('0x42')],_0x4cb4d0)[_0xb70e('0x16')](function(){logger['info']('Connection\x20established.');return _0x677ca8;});}exports['queue']=function(_0x57ec27,_0x581ef2,_0x18a052,_0x157cb1,_0x260efb,_0x32cb05){var _0x4882fd,_0x32d443,_0x5ba48e,_0x592f14;_0x32cb05[_0xb70e('0x43')]=intUtil['stripTrailingSlash'](_0x32cb05[_0xb70e('0x43')]);_0x32cb05['remoteUri']=intUtil[_0xb70e('0x44')](_0x32cb05[_0xb70e('0x40')]);if(_0x260efb&&_0x260efb[_0xb70e('0x45')]){logger[_0xb70e('0x19')](_0xb70e('0x46'),_0xb70e('0x47'));_0x581ef2[_0xb70e('0x48')]=util[_0xb70e('0x2c')](_0xb70e('0x49'),_0x32cb05[_0xb70e('0x43')],_0x581ef2[_0xb70e('0x4a')],md5(_0x581ef2[_0xb70e('0x4a')]));}else{_0x581ef2[_0xb70e('0x48')]='';}return getConnection(_0x32cb05)[_0xb70e('0x16')](function(_0x5d986c){_0x592f14=_0x5d986c;return getUser(_0x32cb05,_0x157cb1[_0xb70e('0x4b')],_0x592f14);})['then'](function(_0x3ab277){_0x4882fd=_0x3ab277;return getEndUser(_0x32cb05,_0x18a052,_0x581ef2[_0xb70e('0x4c')],_0x581ef2['calleridnum'],_0x592f14);})[_0xb70e('0x16')](function(_0x147036){_0x32d443=_0x147036;return getTicket(_0x32cb05,_0x4882fd,_0x32d443,_0x18a052,_0x581ef2,_0x18a052[_0xb70e('0x4d')],_0x592f14,_0xb70e('0x4e'));})[_0xb70e('0x16')](function(_0x4b96f3){_0x5ba48e=_0x4b96f3;logger[_0xb70e('0x19')](_0xb70e('0x4f'),_0x5ba48e['id']);logger[_0xb70e('0x19')](_0xb70e('0x50'),_0x5ba48e['id'],_0x157cb1['name'],_0x32cb05[_0xb70e('0x33')]);switch(_0x32cb05[_0xb70e('0x33')]){case'integrationTab':emit(util[_0xb70e('0x2c')]('user:%s',_0x157cb1[_0xb70e('0x3a')]),_0xb70e('0x51'),{'recordId':_0x5ba48e['id']});break;case'newTab':emit(util[_0xb70e('0x2c')](_0xb70e('0x52'),_0x157cb1[_0xb70e('0x3a')]),_0xb70e('0x53'),{'uri':util['format'](_0xb70e('0x54'),_0x592f14[_0xb70e('0x55')],_0x5ba48e['id'])});break;default:logger[_0xb70e('0x56')]('[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.');}})['catch'](function(_0x451969){logger[_0xb70e('0x56')](_0xb70e('0x46'),JSON['stringify'](_0x451969));});};exports[_0xb70e('0x57')]=function(_0x462011,_0xd24dd4,_0x1f0a0d,_0x1f2bc2,_0x2b8849,_0x33d685,_0xd1f925){var _0x58bc2c,_0x190d03,_0x1ff224,_0x5d9871;_0x33d685[_0xb70e('0x43')]=intUtil[_0xb70e('0x44')](_0x33d685[_0xb70e('0x43')]);_0x33d685[_0xb70e('0x40')]=intUtil[_0xb70e('0x44')](_0x33d685[_0xb70e('0x40')]);if(_0xd1f925&&_0xd1f925[_0xb70e('0x58')]&&_0xd1f925['recordingFormat']!=='none'){logger[_0xb70e('0x19')](_0xb70e('0x59'),_0xb70e('0x47'));_0xd24dd4[_0xb70e('0x48')]=util[_0xb70e('0x2c')](_0xb70e('0x49'),_0x33d685[_0xb70e('0x43')],_0xd24dd4[_0xb70e('0x4a')],md5(_0xd24dd4[_0xb70e('0x4a')]));}return getConnection(_0x33d685)[_0xb70e('0x16')](function(_0x1ff815){_0x5d9871=_0x1ff815;return getUser(_0x33d685,_0x1f2bc2[_0xb70e('0x4b')],_0x5d9871);})[_0xb70e('0x16')](function(_0x6ce598){_0x58bc2c=_0x6ce598;return getEndUser(_0x33d685,_0x1f0a0d,_0xd24dd4[_0xb70e('0x5a')],_0xd24dd4[_0xb70e('0x5b')],_0x5d9871);})[_0xb70e('0x16')](function(_0x45223b){_0x190d03=_0x45223b;return getTicket(_0x33d685,_0x58bc2c,_0x190d03,_0x1f0a0d,_0xd24dd4,_0x1f0a0d[_0xb70e('0x4d')],_0x5d9871,_0xb70e('0x57'));})[_0xb70e('0x16')](function(_0xe31627){_0x1ff224=_0xe31627;logger['info']('[OUTBOUND]\x20Ticket\x20%s\x20created.',_0x1ff224['id']);logger['info']('[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.',_0x1ff224['id'],_0x1f2bc2['name'],_0x33d685[_0xb70e('0x33')]);switch(_0x33d685['type']){case _0xb70e('0x5c'):emit(util[_0xb70e('0x2c')](_0xb70e('0x52'),_0x1f2bc2['name']),_0xb70e('0x51'),{'recordId':_0x1ff224['id']});break;case'newTab':emit(util[_0xb70e('0x2c')](_0xb70e('0x52'),_0x1f2bc2[_0xb70e('0x3a')]),'trigger:browser:url',{'uri':util[_0xb70e('0x2c')](_0xb70e('0x54'),_0x5d9871['instanceUrl'],_0x1ff224['id'])});break;default:logger['error'](_0xb70e('0x59'),_0xb70e('0x5d'));}})[_0xb70e('0x5e')](function(_0x54ae5f){logger[_0xb70e('0x56')]('[OUTBOUND]',JSON[_0xb70e('0x5f')](_0x54ae5f));});};exports['abandoned']=function(_0x4e04de,_0x26b6b2,_0x13f437,_0x5cb8aa,_0x46e0f6,_0x2fa1af){var _0x126fdc,_0x1f36e1,_0x491608,_0x4549d8;_0x2fa1af[_0xb70e('0x43')]=intUtil[_0xb70e('0x44')](_0x2fa1af[_0xb70e('0x43')]);_0x2fa1af[_0xb70e('0x40')]=intUtil['stripTrailingSlash'](_0x2fa1af[_0xb70e('0x40')]);if(_0x46e0f6&&_0x46e0f6[_0xb70e('0x45')]){logger[_0xb70e('0x19')](_0xb70e('0x60'),_0xb70e('0x47'));_0x26b6b2['recordingURL']=util[_0xb70e('0x2c')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2fa1af[_0xb70e('0x43')],_0x26b6b2[_0xb70e('0x4a')],md5(_0x26b6b2[_0xb70e('0x4a')]));}else{_0x26b6b2[_0xb70e('0x48')]='';}return getConnection(_0x2fa1af)[_0xb70e('0x16')](function(_0x1d4850){_0x4549d8=_0x1d4850;if(!_[_0xb70e('0x61')](_0x5cb8aa)){return getUser(_0x2fa1af,_0x5cb8aa['name'],_0x4549d8);}else{return getUser(_0x2fa1af,null,_0x4549d8);}})[_0xb70e('0x16')](function(_0x47afbe){_0x126fdc=_0x47afbe;return getEndUser(_0x2fa1af,_0x13f437,_0x26b6b2['calleridname'],_0x26b6b2[_0xb70e('0x62')],_0x4549d8);})[_0xb70e('0x16')](function(_0x632254){_0x1f36e1=_0x632254;return getTicket(_0x2fa1af,_0x126fdc,_0x1f36e1,_0x13f437,_0x26b6b2,_0x13f437[_0xb70e('0x4d')],_0x4549d8);})[_0xb70e('0x16')](function(_0x59fe8f){_0x491608=_0x59fe8f;logger[_0xb70e('0x19')](_0xb70e('0x63'),_0x491608['id']);logger['info'](_0xb70e('0x64'),_0x2fa1af[_0xb70e('0x33')]);})[_0xb70e('0x5e')](function(_0x2ba011){logger[_0xb70e('0x56')]('[ABANDONED]',JSON[_0xb70e('0x5f')](_0x2ba011));});}; \ No newline at end of file +var _0x225c=['securityToken','Connection','remoteUri','https://login.salesforce.com','clientId','clientSecret','login','username','Connection\x20established.','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','calleridnum','Fields','queue','[QUEUE]\x20Ticket\x20%s\x20created','integrationTab','user:%s','trigger:salesforce:display','newTab','trigger:browser:url','%s/%s/e','instanceUrl','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','stringify','outbound','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','Salesforce\x20account\x20type\x20not\x20recognized','abandoned','[ABANDONED]\x20Integration\x20account\x20type\x20%s.','[ABANDONED]','lodash','request-promise','moment','bluebird','md5','jsforce','ioredis','./util','../../../../config/environment','salesforce','redis','defaults','localhost','socket.io-emitter','ticketType','Task','assign','utc','Subjects','Descriptions','Case','getString','ContactId','sobject','create','isNil','validateEmail','execute','then','find','Email','Agent\x20%s\x20found.','resolve','Name','info','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','display_name','user_id','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','contact_lead','length','Lead','contact','Contact','Phone','Enduser\x20with\x20phone\x20%s\x20not\x20found.','','format','Caller\x20-\x20%s','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','lead','Company','No\x20Company','forEach','idField','content','toString','type','variable','variableName','Variable','toLowerCase','name','password','concat'];(function(_0x273b17,_0x576bf7){var _0x26b46d=function(_0x42c5ed){while(--_0x42c5ed){_0x273b17['push'](_0x273b17['shift']());}};_0x26b46d(++_0x576bf7);}(_0x225c,0x9e));var _0xc225=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x225c[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xc225('0x0'));var rp=require(_0xc225('0x1'));var moment=require(_0xc225('0x2'));var BPromise=require(_0xc225('0x3'));var md5=require(_0xc225('0x4'));var jsforce=require(_0xc225('0x5'));var util=require('util');var Redis=require(_0xc225('0x6'));var intUtil=require(_0xc225('0x7'));var config=require(_0xc225('0x8'));var logger=require('../../../../config/logger')(_0xc225('0x9'));config[_0xc225('0xa')]=_[_0xc225('0xb')](config[_0xc225('0xa')],{'host':_0xc225('0xc'),'port':0x18eb});var io=require(_0xc225('0xd'))(new Redis(config[_0xc225('0xa')]));function emit(_0xc1f27d,_0xdfa30e,_0xae1595){io['to'](_0xc1f27d)['emit'](_0xdfa30e,_0xae1595);}function getTicket(_0x49ebb1,_0x3409fb,_0x5a51a0,_0x4857dd,_0x5470e8,_0x15ca76,_0x2b3995,_0x366219){var _0xca2a9d={};if(_0x4857dd[_0xc225('0xe')]===_0xc225('0xf')){_0xca2a9d=Object[_0xc225('0x10')]({},{'OwnerId':_0x3409fb['id'],'ActivityDate':moment[_0xc225('0x11')](),'IsReminderSet':![],'IsRecurrence':![],'Subject':intUtil['getString'](_0x4857dd[_0xc225('0x12')],_0x5470e8,'\x20'),'Description':intUtil['getString'](_0x4857dd[_0xc225('0x13')],_0x5470e8,'\x0a')},getCustomFields(_0x15ca76,_0x5470e8));if(_0x5a51a0){_0xca2a9d['WhoId']=_0x5a51a0['id'];}}else if(_0x4857dd[_0xc225('0xe')]===_0xc225('0x14')){_0xca2a9d=Object[_0xc225('0x10')]({},{'OwnerId':_0x3409fb['id'],'Subject':intUtil[_0xc225('0x15')](_0x4857dd[_0xc225('0x12')],_0x5470e8,'\x20'),'Description':intUtil[_0xc225('0x15')](_0x4857dd[_0xc225('0x13')],_0x5470e8,'\x0a')},getCustomFields(_0x15ca76,_0x5470e8));if(_0x5a51a0){_0xca2a9d[_0xc225('0x16')]=_0x5a51a0['id'];}}return _0x2b3995[_0xc225('0x17')](_0x4857dd[_0xc225('0xe')])[_0xc225('0x18')](_0xca2a9d);}function getUser(_0x4270c8,_0x50bd8e,_0x2acf2e){if(!_[_0xc225('0x19')](_0x50bd8e)&&intUtil[_0xc225('0x1a')](_0x50bd8e)){var _0x35e762={'Email':_0x50bd8e};var _0xaa0741={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x2acf2e['sobject']('User')['find'](_0x35e762,_0xaa0741)[_0xc225('0x1b')]()[_0xc225('0x1c')](function(_0x58cc70){if(_0x58cc70['length']){var _0x15419c=_[_0xc225('0x1d')](_0x58cc70,function(_0x562431){return _0x562431[_0xc225('0x1e')]===_0x50bd8e;});if(_0x15419c){logger['info'](_0xc225('0x1f'),_0x50bd8e);return BPromise[_0xc225('0x20')]({'id':_0x15419c['Id'],'name':_0x15419c[_0xc225('0x21')]});}}else{logger[_0xc225('0x22')](_0xc225('0x23'),_0x50bd8e);return _0x2acf2e[_0xc225('0x24')]()[_0xc225('0x1c')](function(_0x401625){return BPromise['resolve']({'id':_0x401625['user_id'],'name':_0x401625[_0xc225('0x25')]});});}});}else{logger[_0xc225('0x22')](_0xc225('0x23'),_0x50bd8e);return _0x2acf2e[_0xc225('0x24')]()[_0xc225('0x1c')](function(_0x1b8fb7){return BPromise[_0xc225('0x20')]({'id':_0x1b8fb7[_0xc225('0x26')],'name':_0x1b8fb7['display_name']});});}}function getEndUser(_0x4d86b9,_0x2daaa2,_0x1e2c97,_0xd9a717,_0x250906){var _0x292c17={'Phone':_0xd9a717};var _0x2d7643={'Id':!![],'Name':!![],'Phone':!![]};return BPromise['resolve']()[_0xc225('0x1c')](function(){if(_0x2daaa2[_0xc225('0xe')]==='Task'){logger[_0xc225('0x22')](_0xc225('0x27'),_0xd9a717,_0x2daaa2[_0xc225('0x28')]);switch(_0x2daaa2[_0xc225('0x28')]){case _0xc225('0x29'):return _0x250906[_0xc225('0x17')]('Contact')[_0xc225('0x1d')](_0x292c17,_0x2d7643)[_0xc225('0x1b')]()[_0xc225('0x1c')](function(_0x8ccbd2){if(_0x8ccbd2&&_0x8ccbd2[_0xc225('0x2a')]){return _0x8ccbd2;}else{return _0x250906[_0xc225('0x17')](_0xc225('0x2b'))['find'](_0x292c17,_0x2d7643);}});case _0xc225('0x2c'):return _0x250906[_0xc225('0x17')](_0xc225('0x2d'))[_0xc225('0x1d')](_0x292c17,_0x2d7643)[_0xc225('0x1b')]();case'lead':return _0x250906[_0xc225('0x17')](_0xc225('0x2b'))[_0xc225('0x1d')](_0x292c17,_0x2d7643);default:return null;}}else if(_0x2daaa2[_0xc225('0xe')]===_0xc225('0x14')){logger['info'](_0xc225('0x27'),_0xd9a717,'contact');return _0x250906[_0xc225('0x17')](_0xc225('0x2d'))['find'](_0x292c17,_0x2d7643)[_0xc225('0x1b')]();}})[_0xc225('0x1c')](function(_0x1f5e08){if(_0x1f5e08&&_0x1f5e08['length']){var _0x5557de=_[_0xc225('0x1d')](_0x1f5e08,function(_0x5be023){return _0x5be023['Phone']===_0xd9a717;});if(_0x5557de){return BPromise[_0xc225('0x20')]({'id':_0x5557de['Id'],'name':_0x5557de['Name'],'phone':_0x5557de[_0xc225('0x2e')]});}}})[_0xc225('0x1c')](function(_0x370421){if(_0x370421){logger[_0xc225('0x22')]('Enduser\x20with\x20phone\x20%s\x20found.',_0xd9a717);return BPromise['resolve'](_0x370421);}else{logger[_0xc225('0x22')](_0xc225('0x2f'),_0xd9a717);var _0xb7d052={'LastName':_0x1e2c97!==_0xc225('0x30')?_0x1e2c97:util[_0xc225('0x31')](_0xc225('0x32'),_0xd9a717),'Phone':_0xd9a717};if(_0x2daaa2['moduleCreate']){if(_0x2daaa2[_0xc225('0x33')]==='contact'){logger['info'](_0xc225('0x34'),_0xd9a717,_0x2daaa2[_0xc225('0x33')]);}else if(_0x2daaa2[_0xc225('0x33')]===_0xc225('0x35')&&_0x2daaa2[_0xc225('0xe')]===_0xc225('0xf')){logger[_0xc225('0x22')](_0xc225('0x34'),_0xd9a717,_0x2daaa2['moduleCreate']);_0xb7d052[_0xc225('0x36')]=_0xc225('0x37');}else{return null;}}return _0x250906[_0xc225('0x17')](_['upperFirst'](_0x2daaa2[_0xc225('0x33')]))[_0xc225('0x18')](_0xb7d052);}});}function getCustomFields(_0x161212,_0x1efffa){var _0x4fde83={};if(_0x161212[_0xc225('0x2a')]>0x0){_[_0xc225('0x38')](_0x161212,function(_0x2d1c08){if(_0x2d1c08['type']==='string'&&_0x2d1c08[_0xc225('0x39')]){_0x4fde83[_0x2d1c08[_0xc225('0x39')]]=_0x2d1c08[_0xc225('0x3a')][_0xc225('0x3b')]();}else if(_0x2d1c08[_0xc225('0x3c')]===_0xc225('0x3d')&&_0x2d1c08[_0xc225('0x3e')]&&_0x2d1c08['idField']){_0x1efffa[_0x2d1c08[_0xc225('0x3e')]]&&(_0x4fde83[_0x2d1c08[_0xc225('0x39')]]=_0x1efffa[_0x2d1c08[_0xc225('0x3e')]][_0xc225('0x3b')]());}else if(_0x2d1c08[_0xc225('0x3c')]==='customVariable'&&_0x2d1c08[_0xc225('0x3f')]&&_0x2d1c08['Variable']['name']&&_0x2d1c08[_0xc225('0x39')]){_0x1efffa[_0x2d1c08[_0xc225('0x3f')]['name'][_0xc225('0x40')]()]&&(_0x4fde83[_0x2d1c08[_0xc225('0x39')]]=_0x1efffa[_0x2d1c08[_0xc225('0x3f')][_0xc225('0x41')][_0xc225('0x40')]()]['toString']());}});}return _0x4fde83;}function getConnection(_0x36c5ad){var _0x2a9df4=_0x36c5ad[_0xc225('0x42')][_0xc225('0x43')](_0x36c5ad[_0xc225('0x44')]);var _0x5aa155=new jsforce[(_0xc225('0x45'))]({'oauth2':{'loginUrl':_0x36c5ad[_0xc225('0x46')]||_0xc225('0x47'),'clientId':_0x36c5ad[_0xc225('0x48')],'clientSecret':_0x36c5ad[_0xc225('0x49')]}});return _0x5aa155[_0xc225('0x4a')](_0x36c5ad[_0xc225('0x4b')],_0x2a9df4)[_0xc225('0x1c')](function(){logger['info'](_0xc225('0x4c'));return _0x5aa155;});}exports['queue']=function(_0x528d81,_0x429939,_0x1b61a8,_0x446da5,_0x21ed7f,_0x253ada){var _0x5af1c3,_0xc1e399,_0x353286,_0x1e39ff;_0x253ada['serverUrl']=intUtil[_0xc225('0x4d')](_0x253ada[_0xc225('0x4e')]);_0x253ada[_0xc225('0x46')]=intUtil[_0xc225('0x4d')](_0x253ada[_0xc225('0x46')]);if(_0x21ed7f&&_0x21ed7f[_0xc225('0x4f')]){logger[_0xc225('0x22')](_0xc225('0x50'),'Recording\x20is\x20enabled!');_0x429939[_0xc225('0x51')]=util[_0xc225('0x31')](_0xc225('0x52'),_0x253ada[_0xc225('0x4e')],_0x429939[_0xc225('0x53')],md5(_0x429939[_0xc225('0x53')]));}else{_0x429939[_0xc225('0x51')]='';}return getConnection(_0x253ada)[_0xc225('0x1c')](function(_0x455ae4){_0x1e39ff=_0x455ae4;return getUser(_0x253ada,_0x446da5[_0xc225('0x54')],_0x1e39ff);})['then'](function(_0x46ee36){_0x5af1c3=_0x46ee36;return getEndUser(_0x253ada,_0x1b61a8,_0x429939['calleridname'],_0x429939[_0xc225('0x55')],_0x1e39ff);})[_0xc225('0x1c')](function(_0x36d8ae){_0xc1e399=_0x36d8ae;return getTicket(_0x253ada,_0x5af1c3,_0xc1e399,_0x1b61a8,_0x429939,_0x1b61a8[_0xc225('0x56')],_0x1e39ff,_0xc225('0x57'));})[_0xc225('0x1c')](function(_0x513f3d){_0x353286=_0x513f3d;logger['info'](_0xc225('0x58'),_0x353286['id']);logger['info']('[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.',_0x353286['id'],_0x446da5[_0xc225('0x41')],_0x253ada['type']);switch(_0x253ada[_0xc225('0x3c')]){case _0xc225('0x59'):emit(util[_0xc225('0x31')](_0xc225('0x5a'),_0x446da5['name']),_0xc225('0x5b'),{'recordId':_0x353286['id']});break;case _0xc225('0x5c'):emit(util['format'](_0xc225('0x5a'),_0x446da5['name']),_0xc225('0x5d'),{'uri':util[_0xc225('0x31')](_0xc225('0x5e'),_0x1e39ff[_0xc225('0x5f')],_0x353286['id'])});break;default:logger[_0xc225('0x60')](_0xc225('0x61'));}})[_0xc225('0x62')](function(_0x4cf9d8){logger[_0xc225('0x60')](_0xc225('0x50'),JSON[_0xc225('0x63')](_0x4cf9d8));});};exports[_0xc225('0x64')]=function(_0x1767f3,_0x1a1f69,_0x1f44f2,_0x59cbed,_0x4b9f6,_0x219642,_0x5542cf){var _0x37fee3,_0x4a8278,_0x311904,_0x4b4c02;_0x219642['serverUrl']=intUtil['stripTrailingSlash'](_0x219642[_0xc225('0x4e')]);_0x219642[_0xc225('0x46')]=intUtil[_0xc225('0x4d')](_0x219642[_0xc225('0x46')]);if(_0x5542cf&&_0x5542cf[_0xc225('0x65')]&&_0x5542cf[_0xc225('0x65')]!==_0xc225('0x66')){logger['info'](_0xc225('0x67'),_0xc225('0x68'));_0x1a1f69[_0xc225('0x51')]=util[_0xc225('0x31')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x219642[_0xc225('0x4e')],_0x1a1f69[_0xc225('0x53')],md5(_0x1a1f69[_0xc225('0x53')]));}return getConnection(_0x219642)[_0xc225('0x1c')](function(_0x2c2622){_0x4b4c02=_0x2c2622;return getUser(_0x219642,_0x59cbed[_0xc225('0x54')],_0x4b4c02);})[_0xc225('0x1c')](function(_0x54cf08){_0x37fee3=_0x54cf08;return getEndUser(_0x219642,_0x1f44f2,_0x1a1f69[_0xc225('0x69')],_0x1a1f69[_0xc225('0x6a')],_0x4b4c02);})[_0xc225('0x1c')](function(_0x3ce8c0){_0x4a8278=_0x3ce8c0;return getTicket(_0x219642,_0x37fee3,_0x4a8278,_0x1f44f2,_0x1a1f69,_0x1f44f2[_0xc225('0x56')],_0x4b4c02,_0xc225('0x64'));})[_0xc225('0x1c')](function(_0x5115ea){_0x311904=_0x5115ea;logger[_0xc225('0x22')](_0xc225('0x6b'),_0x311904['id']);logger[_0xc225('0x22')](_0xc225('0x6c'),_0x311904['id'],_0x59cbed[_0xc225('0x41')],_0x219642['type']);switch(_0x219642['type']){case _0xc225('0x59'):emit(util[_0xc225('0x31')](_0xc225('0x5a'),_0x59cbed[_0xc225('0x41')]),'trigger:salesforce:display',{'recordId':_0x311904['id']});break;case _0xc225('0x5c'):emit(util['format']('user:%s',_0x59cbed[_0xc225('0x41')]),_0xc225('0x5d'),{'uri':util[_0xc225('0x31')]('%s/%s/e',_0x4b4c02['instanceUrl'],_0x311904['id'])});break;default:logger[_0xc225('0x60')](_0xc225('0x67'),_0xc225('0x6d'));}})[_0xc225('0x62')](function(_0x40b31d){logger['error'](_0xc225('0x67'),JSON['stringify'](_0x40b31d));});};exports[_0xc225('0x6e')]=function(_0x1a836b,_0x517058,_0x4f7023,_0x23f838,_0x5b87c9,_0x5e10bf){var _0x56e821,_0x3e7f00,_0x5bd9e8,_0x58f949;_0x5e10bf[_0xc225('0x4e')]=intUtil['stripTrailingSlash'](_0x5e10bf[_0xc225('0x4e')]);_0x5e10bf['remoteUri']=intUtil['stripTrailingSlash'](_0x5e10bf[_0xc225('0x46')]);if(_0x5b87c9&&_0x5b87c9[_0xc225('0x4f')]){logger[_0xc225('0x22')]('[ABANDONED]',_0xc225('0x68'));_0x517058[_0xc225('0x51')]=util[_0xc225('0x31')](_0xc225('0x52'),_0x5e10bf['serverUrl'],_0x517058[_0xc225('0x53')],md5(_0x517058[_0xc225('0x53')]));}else{_0x517058[_0xc225('0x51')]='';}return getConnection(_0x5e10bf)['then'](function(_0x5ba4e5){_0x58f949=_0x5ba4e5;if(!_[_0xc225('0x19')](_0x23f838)){return getUser(_0x5e10bf,_0x23f838['name'],_0x58f949);}else{return getUser(_0x5e10bf,null,_0x58f949);}})[_0xc225('0x1c')](function(_0x44d61d){_0x56e821=_0x44d61d;return getEndUser(_0x5e10bf,_0x4f7023,_0x517058['calleridname'],_0x517058[_0xc225('0x55')],_0x58f949);})[_0xc225('0x1c')](function(_0x46afa7){_0x3e7f00=_0x46afa7;return getTicket(_0x5e10bf,_0x56e821,_0x3e7f00,_0x4f7023,_0x517058,_0x4f7023[_0xc225('0x56')],_0x58f949);})[_0xc225('0x1c')](function(_0x1f1ccb){_0x5bd9e8=_0x1f1ccb;logger[_0xc225('0x22')]('[ABANDONED]\x20Ticket\x20%s\x20created.',_0x5bd9e8['id']);logger[_0xc225('0x22')](_0xc225('0x6f'),_0x5e10bf[_0xc225('0x3c')]);})[_0xc225('0x62')](function(_0x54cb19){logger['error'](_0xc225('0x70'),JSON[_0xc225('0x63')](_0x54cb19));});}; \ 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 294113b..4dc46e0 100644 --- a/server/services/ami/trigger/integration/servicenow.js +++ b/server/services/ami/trigger/integration/servicenow.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['validateEmail','userEmail','sys_user?sysparm_query=email%3D','],\x20getUser\x20rp\x20obj','then','],\x20getUser\x20entity','userId','adminEmail','],\x20getUser\x20crm','catch','],\x20createEndUser\x20input\x20crm','POST','sys_user?','user','endUserNumber','true','System','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','length','forEach','type','customField','idField','content','toString','toLowerCase','variable','variableName','Variable','name',']\x20getTicket\x20input\x20crm','outbound','incident','assign','getString','Descriptions','Fields',']\x20POST\x20incident\x20entity\x20schema',']\x20getTicket\x20crm','label','Incident','ticketId','Incident\x20-\x20','ticketNumber','push','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','Tags','map','%26sysparm_record_target%3Dincident','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%26sysparm_record_list%3Dactive%253Dtrue','%255EORDERBYDESCnumber','/nav_to.do?uri=incident.do?sys_id%3D','format','user:%s','emit','trigger:browser:url','password','sysparm_limit=1','sysparm_display_value=true','serverUrl','stripTrailingSlash','%s/api/now/table/','remoteUri','email','destcalleridnum','calleridnum','queue','abandoned','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingFormat','none','[OUTBOUND]','recordingURL','The\x20ticket\x20ID\x20is:\x20%s','call\x20direction:\x20%s',']\x20Error\x20running\x20ServiceNow\x20integration','lodash','bluebird','request-promise','ioredis','../../../../config/environment','../../../../config/logger','servicenow','redis','defaults','localhost','socket.io-emitter','GET','sys_user?sysparm_query=user_name%3Dadmin','adminId','result','sys_id','info','toUpperCase','],\x20getAdminUser\x20crm','error','message'];(function(_0x5783f4,_0x4a9e0a){var _0x28e380=function(_0x1ffc49){while(--_0x1ffc49){_0x5783f4['push'](_0x5783f4['shift']());}};_0x28e380(++_0x4a9e0a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47a7d0,_0x4e182d){_0x47a7d0=_0x47a7d0-0x0;var _0xb9bd08=_0xa9e0[_0x47a7d0];return _0xb9bd08;};'use strict';var _=require(_0x0a9e('0x0'));var Promise=require(_0x0a9e('0x1'));var rp=require(_0x0a9e('0x2'));var util=require('util');var md5=require('md5');var Redis=require(_0x0a9e('0x3'));var intUtil=require('./util');var config=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));config[_0x0a9e('0x7')]=_[_0x0a9e('0x8')](config['redis'],{'host':_0x0a9e('0x9'),'port':0x18eb});var io=require(_0x0a9e('0xa'))(new Redis(config[_0x0a9e('0x7')]));function getAdminUser(_0x5f41ea,_0x503809,_0xe42b77,_0x56465b,_0x52cace,_0x39753a){return new Promise(function(_0xf81284,_0x307b3e){var _0x3ab53f={'method':_0x0a9e('0xb'),'uri':_0x56465b+_0x0a9e('0xc')+'&'+_0x52cace+'&'+_0x39753a,'auth':_0x503809,'json':!![]};return rp(_0x3ab53f)['then'](function(_0x50dfb2){if(_0x50dfb2['result']['length']>0x0){_0xe42b77[_0x0a9e('0xd')]=_0x50dfb2[_0x0a9e('0xe')][0x0][_0x0a9e('0xf')];}logger[_0x0a9e('0x10')]('['+[_0x5f41ea[_0x0a9e('0x11')]()]+_0x0a9e('0x12'),_0xe42b77);_0xf81284(_0xe42b77);})['catch'](function(_0x4283ce){logger[_0x0a9e('0x13')]('['+[_0x5f41ea[_0x0a9e('0x11')]()]+']',_0x4283ce[_0x0a9e('0x14')]);_0x307b3e(_0x4283ce[_0x0a9e('0x14')]);});});}function getUser(_0x4d5611,_0x52a03d,_0x22dccb,_0x5d0880,_0x1985b6){return function(_0x519dfd){logger[_0x0a9e('0x10')]('['+[_0x4d5611[_0x0a9e('0x11')]()]+'],\x20getUser\x20input\x20crm',_0x519dfd);return new Promise(function(_0x225616,_0x5a0a06){if(intUtil[_0x0a9e('0x15')](_0x519dfd[_0x0a9e('0x16')])){var _0x106033={'method':_0x0a9e('0xb'),'uri':_0x22dccb+_0x0a9e('0x17')+_0x519dfd[_0x0a9e('0x16')]+'&'+_0x5d0880+'&'+_0x1985b6,'auth':_0x52a03d,'json':!![]};logger[_0x0a9e('0x10')]('['+[_0x4d5611[_0x0a9e('0x11')]()]+_0x0a9e('0x18'),_0x106033);return rp(_0x106033)[_0x0a9e('0x19')](function(_0x1c696a){logger[_0x0a9e('0x10')]('['+[_0x4d5611['toUpperCase']()]+_0x0a9e('0x1a'),_0x1c696a);if(_0x1c696a[_0x0a9e('0xe')]['length']>0x0&&String(_0x1c696a[_0x0a9e('0xe')][0x0]['active'])==='true'){_0x519dfd[_0x0a9e('0x1b')]=_0x1c696a[_0x0a9e('0xe')][0x0][_0x0a9e('0xf')];}else{_0x519dfd[_0x0a9e('0x1b')]=_0x519dfd['adminId'];_0x519dfd[_0x0a9e('0x16')]=_0x519dfd[_0x0a9e('0x1c')];}logger[_0x0a9e('0x10')]('['+[_0x4d5611[_0x0a9e('0x11')]()]+_0x0a9e('0x1d'),_0x519dfd);_0x225616(_0x519dfd);})[_0x0a9e('0x1e')](function(_0x16b1ca){logger['error']('['+[_0x4d5611['toUpperCase']()]+']',_0x16b1ca[_0x0a9e('0x14')]);_0x5a0a06(_0x16b1ca[_0x0a9e('0x14')]);});}else{logger[_0x0a9e('0x10')]('['+[_0x4d5611[_0x0a9e('0x11')]()]+']\x20using\x20admin\x20profile');_0x519dfd[_0x0a9e('0x1b')]=_0x519dfd['adminId'];_0x519dfd[_0x0a9e('0x16')]=_0x519dfd['adminEmail'];_0x225616(_0x519dfd);}});};}function createEndUser(_0x1dc186,_0x34dc65,_0x25fba9,_0x14433c,_0x140511){logger[_0x0a9e('0x10')]('['+[_0x1dc186[_0x0a9e('0x11')]()]+_0x0a9e('0x1f'),_0x25fba9);return new Promise(function(_0x5a101a,_0x3652a7){var _0x468813={'method':_0x0a9e('0x20'),'uri':_0x14433c+_0x0a9e('0x21')+_0x140511,'body':{'user_name':_0x25fba9['endUserNumber'],'roles':_0x0a9e('0x22'),'first_name':_0x25fba9[_0x0a9e('0x23')],'active':_0x0a9e('0x24'),'date_format':_0x0a9e('0x25'),'phone':_0x25fba9[_0x0a9e('0x23')]},'auth':_0x34dc65,'json':!![]};return rp(_0x468813)[_0x0a9e('0x19')](function(_0x296f41){logger[_0x0a9e('0x10')]('['+[_0x1dc186[_0x0a9e('0x11')]()]+'],\x20EndUser\x20schema',_0x296f41[_0x0a9e('0xe')]);_0x25fba9['endUserId']=_0x296f41[_0x0a9e('0xe')][_0x0a9e('0xf')];_0x5a101a(_0x25fba9);})[_0x0a9e('0x1e')](function(_0x33bdb7){logger[_0x0a9e('0x13')]('['+[_0x1dc186['toUpperCase']()]+']',_0x33bdb7[_0x0a9e('0x14')]);_0x3652a7(_0x33bdb7[_0x0a9e('0x14')]);});});}function getEndUser(_0x40cb85,_0x2da5c0,_0x2b45ea,_0x409319,_0x332d35){return function(_0x39e565){logger['info']('['+[_0x40cb85[_0x0a9e('0x11')]()]+'],\x20getEndUser\x20input\x20crm',_0x39e565);return new Promise(function(_0x2cc7a0,_0x14b13f){var _0x2b7e7f={'method':_0x0a9e('0xb'),'uri':_0x2b45ea+'sys_user?sysparm_query=phone%3D'+_0x39e565[_0x0a9e('0x23')]+'&'+_0x409319+'&'+_0x332d35,'auth':_0x2da5c0,'json':!![]};return rp(_0x2b7e7f)[_0x0a9e('0x19')](function(_0x1fa90d){if(_0x1fa90d[_0x0a9e('0xe')]['length']>0x0){_0x39e565['endUserId']=_0x1fa90d[_0x0a9e('0xe')][0x0]['sys_id'];logger[_0x0a9e('0x10')]('['+[_0x40cb85[_0x0a9e('0x11')]()]+_0x0a9e('0x26'),_0x39e565);_0x2cc7a0(_0x39e565);}else{return createEndUser(_0x40cb85,_0x2da5c0,_0x39e565,_0x2b45ea,_0x409319)[_0x0a9e('0x19')](function(_0x4f41ae){logger[_0x0a9e('0x10')]('['+[_0x40cb85[_0x0a9e('0x11')]()]+_0x0a9e('0x27'),_0x4f41ae);_0x2cc7a0(_0x4f41ae);});}})['catch'](function(_0x1dbf74){logger[_0x0a9e('0x13')]('['+[_0x40cb85[_0x0a9e('0x11')]()]+']',_0x1dbf74['message']);_0x14b13f(_0x1dbf74['message']);});});};}function getCustomFields(_0x11b61d,_0x40d766){var _0x5adda1={};if(_0x11b61d[_0x0a9e('0x28')]>0x0){_[_0x0a9e('0x29')](_0x11b61d,function(_0x2e1b3a){if(_0x2e1b3a[_0x0a9e('0x2a')]==='string'&&_0x2e1b3a['nameField']&&!_0x2e1b3a[_0x0a9e('0x2b')]){_0x5adda1[_0x2e1b3a[_0x0a9e('0x2c')]['toLowerCase']()]=_0x2e1b3a[_0x0a9e('0x2d')][_0x0a9e('0x2e')]();}else if(_0x2e1b3a[_0x0a9e('0x2a')]==='string'&&_0x2e1b3a[_0x0a9e('0x2c')]&&_0x2e1b3a[_0x0a9e('0x2b')]){_0x5adda1[_0x2e1b3a[_0x0a9e('0x2c')][_0x0a9e('0x2f')]()]=_0x2e1b3a[_0x0a9e('0x2d')][_0x0a9e('0x2e')]();}else if(_0x2e1b3a[_0x0a9e('0x2a')]===_0x0a9e('0x30')&&_0x2e1b3a[_0x0a9e('0x31')]&&_0x2e1b3a[_0x0a9e('0x2c')]&&_0x2e1b3a[_0x0a9e('0x2b')]){_0x5adda1[_0x2e1b3a[_0x0a9e('0x2c')][_0x0a9e('0x2f')]()]=_0x40d766[_0x2e1b3a[_0x0a9e('0x31')]][_0x0a9e('0x2e')]();}else if(_0x2e1b3a['type']==='customVariable'&&_0x2e1b3a[_0x0a9e('0x32')]&&_0x2e1b3a[_0x0a9e('0x32')][_0x0a9e('0x33')]&&_0x2e1b3a[_0x0a9e('0x2c')]&&_0x2e1b3a[_0x0a9e('0x2b')]){_0x5adda1[_0x2e1b3a[_0x0a9e('0x2c')][_0x0a9e('0x2f')]()]=_0x40d766[_0x2e1b3a[_0x0a9e('0x32')][_0x0a9e('0x33')][_0x0a9e('0x2f')]()][_0x0a9e('0x2e')]();}});}return _0x5adda1;}function getTicket(_0x35ed4a,_0x5026aa,_0x117c99,_0x138b8b,_0xdd268f,_0xfbd5ad){return function(_0x2e8caf){logger[_0x0a9e('0x10')]('['+[_0x35ed4a[_0x0a9e('0x11')]()]+_0x0a9e('0x34'),_0x2e8caf);return new Promise(function(_0x59afe8,_0x2e9d90){var _0x48fd45=_0x35ed4a[_0x0a9e('0x2f')]()===_0x0a9e('0x35')?_0x2e8caf[_0x0a9e('0x1b')]:_0x2e8caf['endUserId'];var _0x14bec2={'method':_0x0a9e('0x20'),'uri':_0x117c99+_0x0a9e('0x36')+'?'+_0xfbd5ad,'body':Object[_0x0a9e('0x37')]({},{'active':_0x0a9e('0x24'),'caller_id':_0x48fd45,'assigned_to':_0x2e8caf[_0x0a9e('0x1b')],'short_description':intUtil[_0x0a9e('0x38')](_0x138b8b['Subjects'],_0xdd268f,'\x20'),'description':intUtil[_0x0a9e('0x38')](_0x138b8b[_0x0a9e('0x39')],_0xdd268f,'\x0a')},getCustomFields(_0x138b8b[_0x0a9e('0x3a')],_0xdd268f)),'auth':_0x5026aa,'json':!![]};return rp(_0x14bec2)[_0x0a9e('0x19')](function(_0x409789){logger[_0x0a9e('0x10')]('['+[_0x35ed4a[_0x0a9e('0x11')]()]+_0x0a9e('0x3b'),_0x409789[_0x0a9e('0xe')]);_0x2e8caf['ticketId']=_0x409789[_0x0a9e('0xe')][_0x0a9e('0xf')];_0x2e8caf['ticketNumber']=_0x409789['result']['number'];logger[_0x0a9e('0x10')]('['+[_0x35ed4a[_0x0a9e('0x11')]()]+_0x0a9e('0x3c'),_0x2e8caf);_0x59afe8(_0x2e8caf);})[_0x0a9e('0x1e')](function(_0x61bb17){logger[_0x0a9e('0x13')]('['+[_0x35ed4a[_0x0a9e('0x11')]()]+']',_0x61bb17[_0x0a9e('0x14')]);_0x2e9d90(_0x61bb17['message']);});});};}function createRemoteTag(_0x4b1b9f,_0x53975a,_0x39d77d,_0x204173){return new Promise(function(_0x14d602,_0x5bb3ed){var _0x2b69d9={'method':_0x0a9e('0x20'),'uri':_0x39d77d+'label'+'?'+_0x204173,'body':{'short_description':_0x4b1b9f,'global':!![],'active':!![],'name':_0x4b1b9f},'auth':_0x53975a,'json':!![]};return rp(_0x2b69d9)['then'](function(_0x2ef381){var _0x59c6ff=_0x2ef381[_0x0a9e('0xe')]['sys_id'];_0x14d602(_0x59c6ff);});});}function getRemoteTag(_0x2e5e62,_0x3c20b2,_0x439340,_0x53613a,_0x2f82da){return new Promise(function(_0x1bf38a,_0x508b47){var _0x50f687={'method':_0x0a9e('0xb'),'uri':_0x439340+_0x0a9e('0x3d')+'?sysparm_query=name%3D'+_0x2e5e62+'&'+_0x53613a,'auth':_0x3c20b2,'json':!![]};return rp(_0x50f687)[_0x0a9e('0x19')](function(_0x5ce9ac){if(_0x5ce9ac[_0x0a9e('0xe')]['length']>0x0){var _0xe22ccc=_0x5ce9ac['result'][0x0]['sys_id'];_0x1bf38a(_0xe22ccc);}else{return createRemoteTag(_0x2e5e62,_0x3c20b2,_0x439340,_0x53613a)['then'](function(_0x2da03c){_0x1bf38a(_0x2da03c);});}});});}function assignTagToIncident(_0x47de4c,_0x2f7092,_0x65432,_0x3cfd00,_0x19b4df){return new Promise(function(_0x232830,_0x272738){var _0xd10662={'method':_0x0a9e('0x20'),'uri':_0x65432+'label_entry'+'?'+_0x19b4df,'body':{'label':_0x47de4c,'table':_0x0a9e('0x36'),'id_type':_0x0a9e('0x3e'),'table_key':_0x3cfd00[_0x0a9e('0x3f')],'title':_0x0a9e('0x40')+_0x3cfd00[_0x0a9e('0x41')],'id_display':_0x3cfd00[_0x0a9e('0x41')]},'auth':_0x2f7092,'json':!![]};return rp(_0xd10662)['then'](function(_0x956fbe){_0x232830();})[_0x0a9e('0x1e')](function(){_0x232830();});});}function manageTags(_0x5239ef,_0x3649cc,_0x5cc8fb,_0x20c668,_0x5ba1f9,_0x4b3c1a,_0x5674ee){return new Promise(function(_0x273cb5,_0x49d231){var _0x2244d6=[];_0x3649cc[_0x0a9e('0x29')](function(_0x261adb){_0x2244d6[_0x0a9e('0x42')](getRemoteTag(_0x261adb,_0x5cc8fb,_0x20c668,_0x4b3c1a,_0x5674ee));});return Promise[_0x0a9e('0x43')](_0x2244d6)[_0x0a9e('0x19')](function(_0x49eed0){if(_0x49eed0[_0x0a9e('0x28')]){logger['info']('['+[_0x5239ef[_0x0a9e('0x11')]()]+_0x0a9e('0x44'),_0x49eed0);var _0x51aaf7=[];_0x49eed0['forEach'](function(_0x453360){_0x51aaf7[_0x0a9e('0x42')](assignTagToIncident(_0x453360,_0x5cc8fb,_0x20c668,_0x5ba1f9,_0x4b3c1a));});return Promise[_0x0a9e('0x43')](_0x51aaf7)[_0x0a9e('0x19')](function(){_0x273cb5();})['catch'](function(){_0x273cb5();});}else{_0x273cb5();}});});}function getTags(_0x1d0dc8,_0xe05a5a,_0x54327c,_0x797b45,_0x17e88c,_0x88dcbf){return function(_0x409b29){return new Promise(function(_0x401837,_0x4d4a35){var _0x176840=[];var _0x2937e0=_0x797b45[_0x0a9e('0x45')];if(_0x2937e0&&_0x2937e0['length']>0x0){_0x176840=_[_0x0a9e('0x46')](_0x2937e0,'name');}if(_0x176840['length']>0x0){return manageTags(_0x1d0dc8,_0x176840,_0xe05a5a,_0x54327c,_0x409b29,_0x17e88c,_0x88dcbf)[_0x0a9e('0x19')](function(){_0x401837(_0x409b29);});}else{_0x401837(_0x409b29);}});};}function emit(_0x4556c5,_0x9375fb,_0x19c995){var _0x186f39=_0x0a9e('0x47')+_0x0a9e('0x48')+_0x0a9e('0x49')+_0x0a9e('0x4a');var _0x1cc4f3={'uri':_0x4556c5+_0x0a9e('0x4b')+_0x19c995+_0x186f39};io['to'](util[_0x0a9e('0x4c')](_0x0a9e('0x4d'),_0x9375fb))[_0x0a9e('0x4e')](_0x0a9e('0x4f'),_0x1cc4f3);}exports['cs']=function(_0x412a72,_0x2a28c0,_0x4257c9,_0x5150a4,_0x1b0b98,_0x295763,_0x243d12,_0x4edbb0){var _0x1148a1={};var _0x30944e={'user':_0x295763['username'],'pass':_0x295763[_0x0a9e('0x50')]};var _0x56e31e=_0x0a9e('0x51');var _0x427946=_0x0a9e('0x52');_0x295763['remoteUri']=intUtil['stripTrailingSlash'](_0x295763['remoteUri']);_0x295763[_0x0a9e('0x53')]=intUtil[_0x0a9e('0x54')](_0x295763[_0x0a9e('0x53')]);var _0x23a7d3=util[_0x0a9e('0x4c')](_0x0a9e('0x55'),_0x295763[_0x0a9e('0x56')]);_0x1148a1[_0x0a9e('0x16')]=!_['isNil'](_0x5150a4)?_0x5150a4[_0x0a9e('0x57')]:null;_0x1148a1[_0x0a9e('0x1c')]=_0x295763[_0x0a9e('0x57')];_0x1148a1['endUserNumber']=_0x4edbb0[_0x0a9e('0x2f')]()==='outbound'?_0x2a28c0[_0x0a9e('0x58')]:_0x2a28c0[_0x0a9e('0x59')];_0x1148a1['callDirection']=_0x4edbb0===_0x0a9e('0x5a')||_0x4edbb0===_0x0a9e('0x5b')?_0x0a9e('0x5a'):_0x0a9e('0x35');var _0x542ece=util[_0x0a9e('0x4c')](_0x0a9e('0x5c'),_0x295763[_0x0a9e('0x53')],_0x2a28c0[_0x0a9e('0x5d')],md5(_0x2a28c0['uniqueid']));if(_0x1b0b98&&_0x1b0b98[_0x0a9e('0x5e')]){logger[_0x0a9e('0x10')](_0x0a9e('0x5f'),_0x0a9e('0x60'));_0x2a28c0['recordingURL']=_0x542ece;}else if(_0x243d12&&_0x243d12[_0x0a9e('0x61')]&&_0x243d12[_0x0a9e('0x61')]!==_0x0a9e('0x62')){logger[_0x0a9e('0x10')](_0x0a9e('0x63'),_0x0a9e('0x60'));_0x2a28c0[_0x0a9e('0x64')]=_0x542ece;}else{_0x2a28c0[_0x0a9e('0x64')]='';}return getAdminUser(_0x4edbb0,_0x30944e,_0x1148a1,_0x23a7d3,_0x427946,_0x56e31e)[_0x0a9e('0x19')](getUser(_0x4edbb0,_0x30944e,_0x23a7d3,_0x427946,_0x56e31e))[_0x0a9e('0x19')](getEndUser(_0x4edbb0,_0x30944e,_0x23a7d3,_0x427946,_0x56e31e))[_0x0a9e('0x19')](getTicket(_0x4edbb0,_0x30944e,_0x23a7d3,_0x4257c9,_0x2a28c0,_0x427946))[_0x0a9e('0x19')](function(_0x25744a){logger[_0x0a9e('0x10')](util['format'](_0x0a9e('0x65'),_0x25744a[_0x0a9e('0x3f')]));logger[_0x0a9e('0x10')](util['format'](_0x0a9e('0x66'),_0x4edbb0));if(_0x4edbb0!==_0x0a9e('0x5b')){logger[_0x0a9e('0x10')]('['+[_0x4edbb0[_0x0a9e('0x11')]()]+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0x295763['remoteUri'],_0x5150a4[_0x0a9e('0x33')],_0x25744a[_0x0a9e('0x3f')]);}})['catch'](function(_0x45108c){logger['error']('['+[_0x4edbb0[_0x0a9e('0x11')]()]+_0x0a9e('0x67'),util['inspect'](_0x45108c,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xa9e0=['validateEmail','userEmail','sys_user?sysparm_query=email%3D','],\x20getUser\x20rp\x20obj','then','],\x20getUser\x20entity','userId','adminEmail','],\x20getUser\x20crm','catch','],\x20createEndUser\x20input\x20crm','POST','sys_user?','user','endUserNumber','true','System','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','length','forEach','type','customField','idField','content','toString','toLowerCase','variable','variableName','Variable','name',']\x20getTicket\x20input\x20crm','outbound','incident','assign','getString','Descriptions','Fields',']\x20POST\x20incident\x20entity\x20schema',']\x20getTicket\x20crm','label','Incident','ticketId','Incident\x20-\x20','ticketNumber','push','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','Tags','map','%26sysparm_record_target%3Dincident','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%26sysparm_record_list%3Dactive%253Dtrue','%255EORDERBYDESCnumber','/nav_to.do?uri=incident.do?sys_id%3D','format','user:%s','emit','trigger:browser:url','password','sysparm_limit=1','sysparm_display_value=true','serverUrl','stripTrailingSlash','%s/api/now/table/','remoteUri','email','destcalleridnum','calleridnum','queue','abandoned','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingFormat','none','[OUTBOUND]','recordingURL','The\x20ticket\x20ID\x20is:\x20%s','call\x20direction:\x20%s',']\x20Error\x20running\x20ServiceNow\x20integration','lodash','bluebird','request-promise','ioredis','../../../../config/environment','../../../../config/logger','servicenow','redis','defaults','localhost','socket.io-emitter','GET','sys_user?sysparm_query=user_name%3Dadmin','adminId','result','sys_id','info','toUpperCase','],\x20getAdminUser\x20crm','error','message'];(function(_0x47b58b,_0x41a189){var _0x46bebe=function(_0x22bbfa){while(--_0x22bbfa){_0x47b58b['push'](_0x47b58b['shift']());}};_0x46bebe(++_0x41a189);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4ea69d,_0x290f53){_0x4ea69d=_0x4ea69d-0x0;var _0x5318e0=_0xa9e0[_0x4ea69d];return _0x5318e0;};'use strict';var _=require(_0x0a9e('0x0'));var Promise=require(_0x0a9e('0x1'));var rp=require(_0x0a9e('0x2'));var util=require('util');var md5=require('md5');var Redis=require(_0x0a9e('0x3'));var intUtil=require('./util');var config=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));config[_0x0a9e('0x7')]=_[_0x0a9e('0x8')](config['redis'],{'host':_0x0a9e('0x9'),'port':0x18eb});var io=require(_0x0a9e('0xa'))(new Redis(config[_0x0a9e('0x7')]));function getAdminUser(_0x5f41ea,_0x503809,_0xe42b77,_0x56465b,_0x52cace,_0x39753a){return new Promise(function(_0xf81284,_0x307b3e){var _0x3ab53f={'method':_0x0a9e('0xb'),'uri':_0x56465b+_0x0a9e('0xc')+'&'+_0x52cace+'&'+_0x39753a,'auth':_0x503809,'json':!![]};return rp(_0x3ab53f)['then'](function(_0x50dfb2){if(_0x50dfb2['result']['length']>0x0){_0xe42b77[_0x0a9e('0xd')]=_0x50dfb2[_0x0a9e('0xe')][0x0][_0x0a9e('0xf')];}logger[_0x0a9e('0x10')]('['+[_0x5f41ea[_0x0a9e('0x11')]()]+_0x0a9e('0x12'),_0xe42b77);_0xf81284(_0xe42b77);})['catch'](function(_0x4283ce){logger[_0x0a9e('0x13')]('['+[_0x5f41ea[_0x0a9e('0x11')]()]+']',_0x4283ce[_0x0a9e('0x14')]);_0x307b3e(_0x4283ce[_0x0a9e('0x14')]);});});}function getUser(_0x4d5611,_0x52a03d,_0x22dccb,_0x5d0880,_0x1985b6){return function(_0x519dfd){logger[_0x0a9e('0x10')]('['+[_0x4d5611[_0x0a9e('0x11')]()]+'],\x20getUser\x20input\x20crm',_0x519dfd);return new Promise(function(_0x225616,_0x5a0a06){if(intUtil[_0x0a9e('0x15')](_0x519dfd[_0x0a9e('0x16')])){var _0x106033={'method':_0x0a9e('0xb'),'uri':_0x22dccb+_0x0a9e('0x17')+_0x519dfd[_0x0a9e('0x16')]+'&'+_0x5d0880+'&'+_0x1985b6,'auth':_0x52a03d,'json':!![]};logger[_0x0a9e('0x10')]('['+[_0x4d5611[_0x0a9e('0x11')]()]+_0x0a9e('0x18'),_0x106033);return rp(_0x106033)[_0x0a9e('0x19')](function(_0x1c696a){logger[_0x0a9e('0x10')]('['+[_0x4d5611['toUpperCase']()]+_0x0a9e('0x1a'),_0x1c696a);if(_0x1c696a[_0x0a9e('0xe')]['length']>0x0&&String(_0x1c696a[_0x0a9e('0xe')][0x0]['active'])==='true'){_0x519dfd[_0x0a9e('0x1b')]=_0x1c696a[_0x0a9e('0xe')][0x0][_0x0a9e('0xf')];}else{_0x519dfd[_0x0a9e('0x1b')]=_0x519dfd['adminId'];_0x519dfd[_0x0a9e('0x16')]=_0x519dfd[_0x0a9e('0x1c')];}logger[_0x0a9e('0x10')]('['+[_0x4d5611[_0x0a9e('0x11')]()]+_0x0a9e('0x1d'),_0x519dfd);_0x225616(_0x519dfd);})[_0x0a9e('0x1e')](function(_0x16b1ca){logger['error']('['+[_0x4d5611['toUpperCase']()]+']',_0x16b1ca[_0x0a9e('0x14')]);_0x5a0a06(_0x16b1ca[_0x0a9e('0x14')]);});}else{logger[_0x0a9e('0x10')]('['+[_0x4d5611[_0x0a9e('0x11')]()]+']\x20using\x20admin\x20profile');_0x519dfd[_0x0a9e('0x1b')]=_0x519dfd['adminId'];_0x519dfd[_0x0a9e('0x16')]=_0x519dfd['adminEmail'];_0x225616(_0x519dfd);}});};}function createEndUser(_0x1dc186,_0x34dc65,_0x25fba9,_0x14433c,_0x140511){logger[_0x0a9e('0x10')]('['+[_0x1dc186[_0x0a9e('0x11')]()]+_0x0a9e('0x1f'),_0x25fba9);return new Promise(function(_0x5a101a,_0x3652a7){var _0x468813={'method':_0x0a9e('0x20'),'uri':_0x14433c+_0x0a9e('0x21')+_0x140511,'body':{'user_name':_0x25fba9['endUserNumber'],'roles':_0x0a9e('0x22'),'first_name':_0x25fba9[_0x0a9e('0x23')],'active':_0x0a9e('0x24'),'date_format':_0x0a9e('0x25'),'phone':_0x25fba9[_0x0a9e('0x23')]},'auth':_0x34dc65,'json':!![]};return rp(_0x468813)[_0x0a9e('0x19')](function(_0x296f41){logger[_0x0a9e('0x10')]('['+[_0x1dc186[_0x0a9e('0x11')]()]+'],\x20EndUser\x20schema',_0x296f41[_0x0a9e('0xe')]);_0x25fba9['endUserId']=_0x296f41[_0x0a9e('0xe')][_0x0a9e('0xf')];_0x5a101a(_0x25fba9);})[_0x0a9e('0x1e')](function(_0x33bdb7){logger[_0x0a9e('0x13')]('['+[_0x1dc186['toUpperCase']()]+']',_0x33bdb7[_0x0a9e('0x14')]);_0x3652a7(_0x33bdb7[_0x0a9e('0x14')]);});});}function getEndUser(_0x40cb85,_0x2da5c0,_0x2b45ea,_0x409319,_0x332d35){return function(_0x39e565){logger['info']('['+[_0x40cb85[_0x0a9e('0x11')]()]+'],\x20getEndUser\x20input\x20crm',_0x39e565);return new Promise(function(_0x2cc7a0,_0x14b13f){var _0x2b7e7f={'method':_0x0a9e('0xb'),'uri':_0x2b45ea+'sys_user?sysparm_query=phone%3D'+_0x39e565[_0x0a9e('0x23')]+'&'+_0x409319+'&'+_0x332d35,'auth':_0x2da5c0,'json':!![]};return rp(_0x2b7e7f)[_0x0a9e('0x19')](function(_0x1fa90d){if(_0x1fa90d[_0x0a9e('0xe')]['length']>0x0){_0x39e565['endUserId']=_0x1fa90d[_0x0a9e('0xe')][0x0]['sys_id'];logger[_0x0a9e('0x10')]('['+[_0x40cb85[_0x0a9e('0x11')]()]+_0x0a9e('0x26'),_0x39e565);_0x2cc7a0(_0x39e565);}else{return createEndUser(_0x40cb85,_0x2da5c0,_0x39e565,_0x2b45ea,_0x409319)[_0x0a9e('0x19')](function(_0x4f41ae){logger[_0x0a9e('0x10')]('['+[_0x40cb85[_0x0a9e('0x11')]()]+_0x0a9e('0x27'),_0x4f41ae);_0x2cc7a0(_0x4f41ae);});}})['catch'](function(_0x1dbf74){logger[_0x0a9e('0x13')]('['+[_0x40cb85[_0x0a9e('0x11')]()]+']',_0x1dbf74['message']);_0x14b13f(_0x1dbf74['message']);});});};}function getCustomFields(_0x11b61d,_0x40d766){var _0x5adda1={};if(_0x11b61d[_0x0a9e('0x28')]>0x0){_[_0x0a9e('0x29')](_0x11b61d,function(_0x2e1b3a){if(_0x2e1b3a[_0x0a9e('0x2a')]==='string'&&_0x2e1b3a['nameField']&&!_0x2e1b3a[_0x0a9e('0x2b')]){_0x5adda1[_0x2e1b3a[_0x0a9e('0x2c')]['toLowerCase']()]=_0x2e1b3a[_0x0a9e('0x2d')][_0x0a9e('0x2e')]();}else if(_0x2e1b3a[_0x0a9e('0x2a')]==='string'&&_0x2e1b3a[_0x0a9e('0x2c')]&&_0x2e1b3a[_0x0a9e('0x2b')]){_0x5adda1[_0x2e1b3a[_0x0a9e('0x2c')][_0x0a9e('0x2f')]()]=_0x2e1b3a[_0x0a9e('0x2d')][_0x0a9e('0x2e')]();}else if(_0x2e1b3a[_0x0a9e('0x2a')]===_0x0a9e('0x30')&&_0x2e1b3a[_0x0a9e('0x31')]&&_0x2e1b3a[_0x0a9e('0x2c')]&&_0x2e1b3a[_0x0a9e('0x2b')]){_0x5adda1[_0x2e1b3a[_0x0a9e('0x2c')][_0x0a9e('0x2f')]()]=_0x40d766[_0x2e1b3a[_0x0a9e('0x31')]][_0x0a9e('0x2e')]();}else if(_0x2e1b3a['type']==='customVariable'&&_0x2e1b3a[_0x0a9e('0x32')]&&_0x2e1b3a[_0x0a9e('0x32')][_0x0a9e('0x33')]&&_0x2e1b3a[_0x0a9e('0x2c')]&&_0x2e1b3a[_0x0a9e('0x2b')]){_0x5adda1[_0x2e1b3a[_0x0a9e('0x2c')][_0x0a9e('0x2f')]()]=_0x40d766[_0x2e1b3a[_0x0a9e('0x32')][_0x0a9e('0x33')][_0x0a9e('0x2f')]()][_0x0a9e('0x2e')]();}});}return _0x5adda1;}function getTicket(_0x35ed4a,_0x5026aa,_0x117c99,_0x138b8b,_0xdd268f,_0xfbd5ad){return function(_0x2e8caf){logger[_0x0a9e('0x10')]('['+[_0x35ed4a[_0x0a9e('0x11')]()]+_0x0a9e('0x34'),_0x2e8caf);return new Promise(function(_0x59afe8,_0x2e9d90){var _0x48fd45=_0x35ed4a[_0x0a9e('0x2f')]()===_0x0a9e('0x35')?_0x2e8caf[_0x0a9e('0x1b')]:_0x2e8caf['endUserId'];var _0x14bec2={'method':_0x0a9e('0x20'),'uri':_0x117c99+_0x0a9e('0x36')+'?'+_0xfbd5ad,'body':Object[_0x0a9e('0x37')]({},{'active':_0x0a9e('0x24'),'caller_id':_0x48fd45,'assigned_to':_0x2e8caf[_0x0a9e('0x1b')],'short_description':intUtil[_0x0a9e('0x38')](_0x138b8b['Subjects'],_0xdd268f,'\x20'),'description':intUtil[_0x0a9e('0x38')](_0x138b8b[_0x0a9e('0x39')],_0xdd268f,'\x0a')},getCustomFields(_0x138b8b[_0x0a9e('0x3a')],_0xdd268f)),'auth':_0x5026aa,'json':!![]};return rp(_0x14bec2)[_0x0a9e('0x19')](function(_0x409789){logger[_0x0a9e('0x10')]('['+[_0x35ed4a[_0x0a9e('0x11')]()]+_0x0a9e('0x3b'),_0x409789[_0x0a9e('0xe')]);_0x2e8caf['ticketId']=_0x409789[_0x0a9e('0xe')][_0x0a9e('0xf')];_0x2e8caf['ticketNumber']=_0x409789['result']['number'];logger[_0x0a9e('0x10')]('['+[_0x35ed4a[_0x0a9e('0x11')]()]+_0x0a9e('0x3c'),_0x2e8caf);_0x59afe8(_0x2e8caf);})[_0x0a9e('0x1e')](function(_0x61bb17){logger[_0x0a9e('0x13')]('['+[_0x35ed4a[_0x0a9e('0x11')]()]+']',_0x61bb17[_0x0a9e('0x14')]);_0x2e9d90(_0x61bb17['message']);});});};}function createRemoteTag(_0x4b1b9f,_0x53975a,_0x39d77d,_0x204173){return new Promise(function(_0x14d602,_0x5bb3ed){var _0x2b69d9={'method':_0x0a9e('0x20'),'uri':_0x39d77d+'label'+'?'+_0x204173,'body':{'short_description':_0x4b1b9f,'global':!![],'active':!![],'name':_0x4b1b9f},'auth':_0x53975a,'json':!![]};return rp(_0x2b69d9)['then'](function(_0x2ef381){var _0x59c6ff=_0x2ef381[_0x0a9e('0xe')]['sys_id'];_0x14d602(_0x59c6ff);});});}function getRemoteTag(_0x2e5e62,_0x3c20b2,_0x439340,_0x53613a,_0x2f82da){return new Promise(function(_0x1bf38a,_0x508b47){var _0x50f687={'method':_0x0a9e('0xb'),'uri':_0x439340+_0x0a9e('0x3d')+'?sysparm_query=name%3D'+_0x2e5e62+'&'+_0x53613a,'auth':_0x3c20b2,'json':!![]};return rp(_0x50f687)[_0x0a9e('0x19')](function(_0x5ce9ac){if(_0x5ce9ac[_0x0a9e('0xe')]['length']>0x0){var _0xe22ccc=_0x5ce9ac['result'][0x0]['sys_id'];_0x1bf38a(_0xe22ccc);}else{return createRemoteTag(_0x2e5e62,_0x3c20b2,_0x439340,_0x53613a)['then'](function(_0x2da03c){_0x1bf38a(_0x2da03c);});}});});}function assignTagToIncident(_0x47de4c,_0x2f7092,_0x65432,_0x3cfd00,_0x19b4df){return new Promise(function(_0x232830,_0x272738){var _0xd10662={'method':_0x0a9e('0x20'),'uri':_0x65432+'label_entry'+'?'+_0x19b4df,'body':{'label':_0x47de4c,'table':_0x0a9e('0x36'),'id_type':_0x0a9e('0x3e'),'table_key':_0x3cfd00[_0x0a9e('0x3f')],'title':_0x0a9e('0x40')+_0x3cfd00[_0x0a9e('0x41')],'id_display':_0x3cfd00[_0x0a9e('0x41')]},'auth':_0x2f7092,'json':!![]};return rp(_0xd10662)['then'](function(_0x956fbe){_0x232830();})[_0x0a9e('0x1e')](function(){_0x232830();});});}function manageTags(_0x5239ef,_0x3649cc,_0x5cc8fb,_0x20c668,_0x5ba1f9,_0x4b3c1a,_0x5674ee){return new Promise(function(_0x273cb5,_0x49d231){var _0x2244d6=[];_0x3649cc[_0x0a9e('0x29')](function(_0x261adb){_0x2244d6[_0x0a9e('0x42')](getRemoteTag(_0x261adb,_0x5cc8fb,_0x20c668,_0x4b3c1a,_0x5674ee));});return Promise[_0x0a9e('0x43')](_0x2244d6)[_0x0a9e('0x19')](function(_0x49eed0){if(_0x49eed0[_0x0a9e('0x28')]){logger['info']('['+[_0x5239ef[_0x0a9e('0x11')]()]+_0x0a9e('0x44'),_0x49eed0);var _0x51aaf7=[];_0x49eed0['forEach'](function(_0x453360){_0x51aaf7[_0x0a9e('0x42')](assignTagToIncident(_0x453360,_0x5cc8fb,_0x20c668,_0x5ba1f9,_0x4b3c1a));});return Promise[_0x0a9e('0x43')](_0x51aaf7)[_0x0a9e('0x19')](function(){_0x273cb5();})['catch'](function(){_0x273cb5();});}else{_0x273cb5();}});});}function getTags(_0x1d0dc8,_0xe05a5a,_0x54327c,_0x797b45,_0x17e88c,_0x88dcbf){return function(_0x409b29){return new Promise(function(_0x401837,_0x4d4a35){var _0x176840=[];var _0x2937e0=_0x797b45[_0x0a9e('0x45')];if(_0x2937e0&&_0x2937e0['length']>0x0){_0x176840=_[_0x0a9e('0x46')](_0x2937e0,'name');}if(_0x176840['length']>0x0){return manageTags(_0x1d0dc8,_0x176840,_0xe05a5a,_0x54327c,_0x409b29,_0x17e88c,_0x88dcbf)[_0x0a9e('0x19')](function(){_0x401837(_0x409b29);});}else{_0x401837(_0x409b29);}});};}function emit(_0x4556c5,_0x9375fb,_0x19c995){var _0x186f39=_0x0a9e('0x47')+_0x0a9e('0x48')+_0x0a9e('0x49')+_0x0a9e('0x4a');var _0x1cc4f3={'uri':_0x4556c5+_0x0a9e('0x4b')+_0x19c995+_0x186f39};io['to'](util[_0x0a9e('0x4c')](_0x0a9e('0x4d'),_0x9375fb))[_0x0a9e('0x4e')](_0x0a9e('0x4f'),_0x1cc4f3);}exports['cs']=function(_0x412a72,_0x2a28c0,_0x4257c9,_0x5150a4,_0x1b0b98,_0x295763,_0x243d12,_0x4edbb0){var _0x1148a1={};var _0x30944e={'user':_0x295763['username'],'pass':_0x295763[_0x0a9e('0x50')]};var _0x56e31e=_0x0a9e('0x51');var _0x427946=_0x0a9e('0x52');_0x295763['remoteUri']=intUtil['stripTrailingSlash'](_0x295763['remoteUri']);_0x295763[_0x0a9e('0x53')]=intUtil[_0x0a9e('0x54')](_0x295763[_0x0a9e('0x53')]);var _0x23a7d3=util[_0x0a9e('0x4c')](_0x0a9e('0x55'),_0x295763[_0x0a9e('0x56')]);_0x1148a1[_0x0a9e('0x16')]=!_['isNil'](_0x5150a4)?_0x5150a4[_0x0a9e('0x57')]:null;_0x1148a1[_0x0a9e('0x1c')]=_0x295763[_0x0a9e('0x57')];_0x1148a1['endUserNumber']=_0x4edbb0[_0x0a9e('0x2f')]()==='outbound'?_0x2a28c0[_0x0a9e('0x58')]:_0x2a28c0[_0x0a9e('0x59')];_0x1148a1['callDirection']=_0x4edbb0===_0x0a9e('0x5a')||_0x4edbb0===_0x0a9e('0x5b')?_0x0a9e('0x5a'):_0x0a9e('0x35');var _0x542ece=util[_0x0a9e('0x4c')](_0x0a9e('0x5c'),_0x295763[_0x0a9e('0x53')],_0x2a28c0[_0x0a9e('0x5d')],md5(_0x2a28c0['uniqueid']));if(_0x1b0b98&&_0x1b0b98[_0x0a9e('0x5e')]){logger[_0x0a9e('0x10')](_0x0a9e('0x5f'),_0x0a9e('0x60'));_0x2a28c0['recordingURL']=_0x542ece;}else if(_0x243d12&&_0x243d12[_0x0a9e('0x61')]&&_0x243d12[_0x0a9e('0x61')]!==_0x0a9e('0x62')){logger[_0x0a9e('0x10')](_0x0a9e('0x63'),_0x0a9e('0x60'));_0x2a28c0[_0x0a9e('0x64')]=_0x542ece;}else{_0x2a28c0[_0x0a9e('0x64')]='';}return getAdminUser(_0x4edbb0,_0x30944e,_0x1148a1,_0x23a7d3,_0x427946,_0x56e31e)[_0x0a9e('0x19')](getUser(_0x4edbb0,_0x30944e,_0x23a7d3,_0x427946,_0x56e31e))[_0x0a9e('0x19')](getEndUser(_0x4edbb0,_0x30944e,_0x23a7d3,_0x427946,_0x56e31e))[_0x0a9e('0x19')](getTicket(_0x4edbb0,_0x30944e,_0x23a7d3,_0x4257c9,_0x2a28c0,_0x427946))[_0x0a9e('0x19')](function(_0x25744a){logger[_0x0a9e('0x10')](util['format'](_0x0a9e('0x65'),_0x25744a[_0x0a9e('0x3f')]));logger[_0x0a9e('0x10')](util['format'](_0x0a9e('0x66'),_0x4edbb0));if(_0x4edbb0!==_0x0a9e('0x5b')){logger[_0x0a9e('0x10')]('['+[_0x4edbb0[_0x0a9e('0x11')]()]+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0x295763['remoteUri'],_0x5150a4[_0x0a9e('0x33')],_0x25744a[_0x0a9e('0x3f')]);}})['catch'](function(_0x45108c){logger['error']('['+[_0x4edbb0[_0x0a9e('0x11')]()]+_0x0a9e('0x67'),util['inspect'](_0x45108c,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/sugarcrm.js b/server/services/ami/trigger/integration/sugarcrm.js index 89f1a36..6ca7ad5 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 _0xa080=['apiKey','toString','base64','get_server_info','Getting\x20agent\x20with\x20name','user_name','then','entry_list','find','name_value_list','Agent\x20found!','resolve','value','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','get_entry_list','phone_home','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Caller\x20-\x20%s','Enduser\x20created.','first_name','merge','map','string','nameField','customField','toLowerCase','content','custom_fields','push','type','variable','customVariable','Variable','username','password','PLAIN','xCALLY\x20Motion\x20integration','Account\x20%d\x20is\x20not\x20valid','set_relationship','Calls','remoteUri','serverUrl','stripTrailingSlash','uri','%s/service/v4_1/rest.php','monitor_format','recordingURL','uniqueid','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Inbound','users','contacts','version','charAt','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','user:%s','trigger:browser:url','error','outbound','recordingFormat','none','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','destcalleridname','Outbound','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','abandoned','Recording\x20is\x20enabled!','isNil','lodash','request-promise','bluebird','ioredis','./util','../../../../config/logger','redis','defaults','localhost','socket.io-emitter','POST','info','Creating\x20new\x20ticket...','getString','created_by','Descriptions','date_start','duration_hours','duration_minutes','parent_id','parent_type','Contacts','parent_name','name','length','forEach','idField','variableName','set_entry','JSON','stringify','format','Basic\x20%s'];(function(_0x5ae4f1,_0x337308){var _0x183678=function(_0x4a91f5){while(--_0x4a91f5){_0x5ae4f1['push'](_0x5ae4f1['shift']());}};_0x183678(++_0x337308);}(_0xa080,0x12c));var _0x0a08=function(_0x25b78d,_0x347586){_0x25b78d=_0x25b78d-0x0;var _0x3d04f5=_0xa080[_0x25b78d];return _0x3d04f5;};'use strict';var _=require(_0x0a08('0x0'));var rp=require(_0x0a08('0x1'));var BPromise=require(_0x0a08('0x2'));var md5=require('md5');var util=require('util');var Redis=require(_0x0a08('0x3'));var intUtil=require(_0x0a08('0x4'));var config=require('../../../../config/environment');var logger=require(_0x0a08('0x5'))('sugarcrm');config[_0x0a08('0x6')]=_[_0x0a08('0x7')](config[_0x0a08('0x6')],{'host':_0x0a08('0x8'),'port':0x18eb});var io=require(_0x0a08('0x9'))(new Redis(config[_0x0a08('0x6')]));var def={'method':_0x0a08('0xa'),'json':!![]};function emit(_0x529d30,_0x2829d7,_0x12ae58){io['to'](_0x529d30)['emit'](_0x2829d7,_0x12ae58);}function getTicket(_0x4e450a,_0x2bf15a,_0x45b3bc,_0x400200,_0x1aa9f0,_0x222809,_0x3ac96b,_0x4847ea){logger[_0x0a08('0xb')](_0x0a08('0xc'));var _0x3e524e=new Date();var _0x1f71f4=[{'name':'name','value':intUtil[_0x0a08('0xd')](_0x400200['Subjects'],_0x1aa9f0,'\x20')},{'name':'assigned_user_id','value':_0x2bf15a['id']},{'name':_0x0a08('0xe'),'value':_0x2bf15a['id']},{'name':'description','value':intUtil['getString'](_0x400200[_0x0a08('0xf')],_0x1aa9f0,'\x0a')},{'name':_0x0a08('0x10'),'value':_0x3e524e['toISOString']()['slice'](0x0,0x13)['replace']('T','\x20')},{'name':_0x0a08('0x11'),'value':'0'},{'name':_0x0a08('0x12'),'value':'15'},{'name':_0x0a08('0x13'),'value':_0x45b3bc['id']},{'name':_0x0a08('0x14'),'value':_0x0a08('0x15')},{'name':_0x0a08('0x16'),'value':_0x45b3bc[_0x0a08('0x17')]},{'name':'direction','value':_0x4847ea}];if(_0x222809[_0x0a08('0x18')]){_[_0x0a08('0x19')](_0x222809,function(_0x470c57){if(_0x1aa9f0[_0x470c57['variableName']]){_0x1f71f4['push']({'name':_0x470c57[_0x0a08('0x1a')],'value':_0x1aa9f0[_0x470c57[_0x0a08('0x1b')]]});}});}return request({'form':{'method':_0x0a08('0x1c'),'input_type':'JSON','response_type':_0x0a08('0x1d'),'rest_data':JSON[_0x0a08('0x1e')]({'session':_0x3ac96b['id'],'module_name':'Calls','name_value_list':_0x1f71f4})}});}function getAuth(_0x12524a){return util[_0x0a08('0x1f')](_0x0a08('0x20'),new Buffer(_0x12524a[_0x0a08('0x21')]+':X')[_0x0a08('0x22')](_0x0a08('0x23')));}function getServerInfo(_0x2dcba7){return request({'form':{'method':_0x0a08('0x24'),'input_type':_0x0a08('0x1d'),'response_type':'JSON','rest_data':JSON[_0x0a08('0x1e')]({'session':_0x2dcba7['id']})}});}function getUser(_0x3b7adc,_0x17cf25,_0x15634a){if(!_['isNil'](_0x17cf25)){logger[_0x0a08('0xb')](_0x0a08('0x25'),_0x17cf25);return request({'form':{'method':'get_entry_list','input_type':_0x0a08('0x1d'),'response_type':_0x0a08('0x1d'),'rest_data':JSON[_0x0a08('0x1e')]({'session':_0x15634a['id'],'module_name':'Employees','query':util['format']('INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200',_0x17cf25),'order_by':'','offset':'0','select_fields':['id',_0x0a08('0x17'),_0x0a08('0x26')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x0a08('0x27')](function(_0x23d2dc){if(_0x23d2dc[_0x0a08('0x28')][_0x0a08('0x18')]){var _0x449c30=_[_0x0a08('0x29')](_0x23d2dc['entry_list'],function(_0x2b8c51){return _0x2b8c51[_0x0a08('0x2a')]['user_name']['value']===_0x17cf25;});if(_0x449c30){logger[_0x0a08('0xb')](_0x0a08('0x2b'));return BPromise[_0x0a08('0x2c')]({'id':_0x449c30[_0x0a08('0x2a')]['id']['value'],'name':_0x449c30[_0x0a08('0x2a')]['name']['value']});}}logger[_0x0a08('0xb')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x0a08('0x2c')]({'id':_0x15634a[_0x0a08('0x2a')]['user_id'][_0x0a08('0x2d')],'name':_0x15634a[_0x0a08('0x2a')][_0x0a08('0x26')]['value']});});}else{logger[_0x0a08('0xb')](_0x0a08('0x2e'));return BPromise['resolve']({'id':_0x15634a['name_value_list']['user_id'][_0x0a08('0x2d')],'name':_0x15634a[_0x0a08('0x2a')][_0x0a08('0x26')][_0x0a08('0x2d')]});}}function getEndUser(_0x27ad30,_0x5bbcda,_0x13e217,_0x93739c){logger[_0x0a08('0xb')](_0x0a08('0x2f'),_0x13e217);return request({'form':{'method':_0x0a08('0x30'),'input_type':'JSON','response_type':_0x0a08('0x1d'),'rest_data':JSON[_0x0a08('0x1e')]({'session':_0x93739c['id'],'module_name':_0x0a08('0x15'),'query':util[_0x0a08('0x1f')]('contacts.phone_home\x20=\x20\x22%s\x22',_0x13e217),'order_by':'','offset':'0','select_fields':['id',_0x0a08('0x17'),'phone_home'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x0a08('0x27')](function(_0xdb8c84){if(_0xdb8c84['entry_list'][_0x0a08('0x18')]){var _0xcf4226=_[_0x0a08('0x29')](_0xdb8c84[_0x0a08('0x28')],function(_0x3667f4){return _0x3667f4[_0x0a08('0x2a')][_0x0a08('0x31')]['value']===_0x13e217;});if(_0xcf4226){logger['info'](_0x0a08('0x32'));return BPromise[_0x0a08('0x2c')]({'id':_0xcf4226[_0x0a08('0x2a')]['id'][_0x0a08('0x2d')],'name':_0xcf4226[_0x0a08('0x2a')][_0x0a08('0x17')]['value'],'phone':_0xcf4226['name_value_list'][_0x0a08('0x31')][_0x0a08('0x2d')]});}}else{logger['info'](_0x0a08('0x33'));return request({'form':{'method':_0x0a08('0x1c'),'input_type':_0x0a08('0x1d'),'response_type':_0x0a08('0x1d'),'rest_data':JSON[_0x0a08('0x1e')]({'session':_0x93739c['id'],'module_name':_0x0a08('0x15'),'name_value_list':[{'name':'first_name','value':_0x5bbcda!==''?_0x5bbcda:util[_0x0a08('0x1f')](_0x0a08('0x34'),_0x13e217)},{'name':_0x0a08('0x31'),'value':_0x13e217}]})}})[_0x0a08('0x27')](function(_0x22db96){logger['info'](_0x0a08('0x35'));return BPromise['resolve']({'id':_0x22db96['id'],'name':_0x22db96[_0x0a08('0x28')][_0x0a08('0x36')][_0x0a08('0x2d')],'phone':_0x22db96[_0x0a08('0x28')][_0x0a08('0x31')]['value']});});}});}function request(_0x3e63de){logger['debug']('[HTTP]',JSON[_0x0a08('0x1e')](_0x3e63de));return rp(_[_0x0a08('0x37')](def,_0x3e63de));}function getTags(_0x1f295f,_0x2857c8){var _0x2f5f57=[];if(_0x1f295f&&_0x1f295f[_0x0a08('0x18')]>0x0){_0x2f5f57=_[_0x0a08('0x38')](_0x1f295f,_0x2857c8);}return _0x2f5f57;}function getCustomFields(_0xd65925,_0x4ca527){var _0x5b3afe=[];var _0x5bad93={'custom_fields':[]};if(_0xd65925[_0x0a08('0x18')]>0x0){_[_0x0a08('0x19')](_0xd65925,function(_0x417003){if(_0x417003['type']===_0x0a08('0x39')&&_0x417003[_0x0a08('0x3a')]&&!_0x417003[_0x0a08('0x3b')]){_0x5bad93[_0x417003[_0x0a08('0x3a')][_0x0a08('0x3c')]()]=_0x417003[_0x0a08('0x3d')][_0x0a08('0x22')]();}else if(_0x417003['type']===_0x0a08('0x39')&&_0x417003[_0x0a08('0x1a')]&&_0x417003[_0x0a08('0x3b')]){_0x5bad93[_0x0a08('0x3e')][_0x0a08('0x3f')]({'id':_0x417003[_0x0a08('0x1a')],'value':_0x417003[_0x0a08('0x3d')][_0x0a08('0x22')]()});}else if(_0x417003[_0x0a08('0x40')]===_0x0a08('0x41')&&_0x417003[_0x0a08('0x1b')]&&_0x417003['idField']&&_0x417003[_0x0a08('0x3b')]){_0x4ca527[_0x417003[_0x0a08('0x1b')]]&&_0x5bad93[_0x0a08('0x3e')][_0x0a08('0x3f')]({'id':_0x417003[_0x0a08('0x1a')],'value':_0x4ca527[_0x417003[_0x0a08('0x1b')]][_0x0a08('0x22')]()});}else if(_0x417003[_0x0a08('0x40')]===_0x0a08('0x42')&&_0x417003[_0x0a08('0x43')]&&_0x417003['Variable'][_0x0a08('0x17')]&&_0x417003[_0x0a08('0x1a')]&&_0x417003[_0x0a08('0x3b')]){_0x4ca527[_0x417003[_0x0a08('0x43')][_0x0a08('0x17')][_0x0a08('0x3c')]()]&&_0x5bad93[_0x0a08('0x3e')]['push']({'id':_0x417003[_0x0a08('0x1a')],'value':_0x4ca527[_0x417003[_0x0a08('0x43')]['name'][_0x0a08('0x3c')]()][_0x0a08('0x22')]()});}});}return _0x5bad93;}function getConnection(_0x34efdd){return request({'method':_0x0a08('0xa'),'form':{'method':'login','input_type':_0x0a08('0x1d'),'response_type':_0x0a08('0x1d'),'rest_data':JSON[_0x0a08('0x1e')]({'user_auth':{'user_name':_0x34efdd[_0x0a08('0x44')],'password':_0x34efdd[_0x0a08('0x45')],'encryption':_0x0a08('0x46')},'application':_0x0a08('0x47')})}})['then'](function(_0x3e0683){var _0x43c497=_0x3e0683;if(_0x43c497['id']){def['sessionID']=_0x43c497['id'];return BPromise[_0x0a08('0x2c')](_0x43c497);}else{throw new Error(util[_0x0a08('0x1f')](_0x0a08('0x48'),_0x34efdd['id']));}});}function setRelationship(_0x144690,_0x1ae879,_0x39ae89,_0x1d25f1){return request({'form':{'method':_0x0a08('0x49'),'input_type':_0x0a08('0x1d'),'response_type':_0x0a08('0x1d'),'rest_data':JSON['stringify']({'session':_0x144690['id'],'module_name':_0x0a08('0x4a'),'module_id':_0x39ae89['id'],'link_field_name':_0x1d25f1,'related_ids':[_0x1ae879['id']]})}});}exports['queue']=function(_0x36eee6,_0x2dd54a,_0x15315f,_0x1b83b8,_0x45322e,_0x194b07){var _0x2a9968,_0x93efb7,_0x473bb2,_0x25f5d9;_0x194b07['remoteUri']=intUtil['stripTrailingSlash'](_0x194b07[_0x0a08('0x4b')]);_0x194b07[_0x0a08('0x4c')]=intUtil[_0x0a08('0x4d')](_0x194b07['serverUrl']);def[_0x0a08('0x4e')]=util['format'](_0x0a08('0x4f'),_0x194b07[_0x0a08('0x4b')]);if(_0x45322e&&_0x45322e[_0x0a08('0x50')]){logger[_0x0a08('0xb')]('[QUEUE]','Recording\x20is\x20enabled!');_0x2dd54a[_0x0a08('0x51')]=util[_0x0a08('0x1f')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x194b07['serverUrl'],_0x2dd54a[_0x0a08('0x52')],md5(_0x2dd54a[_0x0a08('0x52')]));}else{_0x2dd54a[_0x0a08('0x51')]='';}return getConnection(_0x194b07)[_0x0a08('0x27')](function(_0x55de69){_0x25f5d9=_0x55de69;return getUser(_0x194b07,_0x1b83b8[_0x0a08('0x17')],_0x25f5d9);})[_0x0a08('0x27')](function(_0x1c30b8){_0x2a9968=_0x1c30b8;logger[_0x0a08('0xb')](_0x0a08('0x53'),_0x2a9968['id']);return getEndUser(_0x194b07,_0x2dd54a[_0x0a08('0x54')],_0x2dd54a[_0x0a08('0x55')],_0x25f5d9);})[_0x0a08('0x27')](function(_0x98cfdb){_0x93efb7=_0x98cfdb;logger['info'](_0x0a08('0x56'),_0x93efb7['id']);return getTicket(_0x194b07,_0x2a9968,_0x93efb7,_0x15315f,_0x2dd54a,_0x15315f[_0x0a08('0x57')],_0x25f5d9,_0x0a08('0x58'));})['then'](function(_0x17e362){_0x473bb2=_0x17e362;logger[_0x0a08('0xb')]('Ticket\x20created!');logger[_0x0a08('0xb')]('The\x20Ticket\x20ID\x20is:',_0x473bb2['id']);return setRelationship(_0x25f5d9,_0x2a9968,_0x473bb2,_0x0a08('0x59'));})['then'](function(){return setRelationship(_0x25f5d9,_0x93efb7,_0x473bb2,_0x0a08('0x5a'));})[_0x0a08('0x27')](function(){return getServerInfo(_0x25f5d9);})[_0x0a08('0x27')](function(_0x1197c0){var _0x3a3ef8=parseInt(_0x1197c0[_0x0a08('0x5b')][_0x0a08('0x5c')](0x0));var _0x543b5d=util[_0x0a08('0x1f')]('%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s',_0x194b07['remoteUri'],_0x473bb2['id']);if(_0x3a3ef8>0x6){_0x543b5d=util[_0x0a08('0x1f')](_0x0a08('0x5d'),_0x194b07[_0x0a08('0x4b')],_0x473bb2['id']);}logger['info']('[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x0a08('0x1f')](_0x0a08('0x5e'),_0x1b83b8[_0x0a08('0x17')]),_0x0a08('0x5f'),{'uri':_0x543b5d});})['catch'](function(_0x65e5f0){logger[_0x0a08('0x60')]('[QUEUE]',JSON[_0x0a08('0x1e')](_0x65e5f0));});};exports[_0x0a08('0x61')]=function(_0x594760,_0x1d0470,_0x311edd,_0x47d57e,_0x537ad5,_0x387c8a,_0x221493){var _0x32d24a,_0x50c0a6,_0x350142,_0x48e4a3;_0x387c8a['remoteUri']=intUtil[_0x0a08('0x4d')](_0x387c8a[_0x0a08('0x4b')]);_0x387c8a[_0x0a08('0x4c')]=intUtil[_0x0a08('0x4d')](_0x387c8a['serverUrl']);def['uri']=util[_0x0a08('0x1f')](_0x0a08('0x4f'),_0x387c8a['remoteUri']);if(_0x221493&&_0x221493[_0x0a08('0x62')]&&_0x221493[_0x0a08('0x62')]!==_0x0a08('0x63')){logger[_0x0a08('0xb')](_0x0a08('0x64'),'Recording\x20is\x20enabled!');_0x1d0470['recordingURL']=util[_0x0a08('0x1f')](_0x0a08('0x65'),_0x387c8a[_0x0a08('0x4c')],_0x1d0470[_0x0a08('0x52')],md5(_0x1d0470['uniqueid']));}return getConnection(_0x387c8a)['then'](function(_0x1773ae){_0x48e4a3=_0x1773ae;return getUser(_0x387c8a,_0x47d57e['name'],_0x48e4a3);})[_0x0a08('0x27')](function(_0x3c770a){_0x32d24a=_0x3c770a;logger[_0x0a08('0xb')](_0x0a08('0x53'),_0x32d24a['id']);return getEndUser(_0x387c8a,_0x1d0470[_0x0a08('0x66')],_0x1d0470['destcalleridnum'],_0x48e4a3);})['then'](function(_0x3b9b9c){_0x50c0a6=_0x3b9b9c;logger[_0x0a08('0xb')](_0x0a08('0x56'),_0x50c0a6['id']);return getTicket(_0x387c8a,_0x32d24a,_0x50c0a6,_0x311edd,_0x1d0470,_0x311edd['Fields'],_0x48e4a3,_0x0a08('0x67'));})[_0x0a08('0x27')](function(_0x2e8cc1){_0x350142=_0x2e8cc1;logger['info'](_0x0a08('0x68'));logger[_0x0a08('0xb')](_0x0a08('0x69'),_0x350142['id']);return setRelationship(_0x48e4a3,_0x32d24a,_0x350142,_0x0a08('0x59'));})[_0x0a08('0x27')](function(){return setRelationship(_0x48e4a3,_0x50c0a6,_0x350142,'contacts');})[_0x0a08('0x27')](function(){return getServerInfo(_0x48e4a3);})[_0x0a08('0x27')](function(_0x79aaa6){var _0x48fea9=parseInt(_0x79aaa6['version'][_0x0a08('0x5c')](0x0));var _0x28cc59=util[_0x0a08('0x1f')](_0x0a08('0x6a'),_0x387c8a['remoteUri'],_0x350142['id']);if(_0x48fea9>0x6){_0x28cc59=util[_0x0a08('0x1f')](_0x0a08('0x5d'),_0x387c8a[_0x0a08('0x4b')],_0x350142['id']);}logger[_0x0a08('0xb')]('[OUTBOUND]',_0x0a08('0x6b'));emit(util['format'](_0x0a08('0x5e'),_0x47d57e['name']),_0x0a08('0x5f'),{'uri':_0x28cc59});})['catch'](function(_0x575341){logger[_0x0a08('0x60')](_0x0a08('0x64'),JSON[_0x0a08('0x1e')](_0x575341));});};exports[_0x0a08('0x6c')]=function(_0x4bd4f3,_0x457b86,_0x59e132,_0x43a709,_0xccd187,_0x247f78){var _0x16e8e4,_0x118510,_0x135d0f,_0x95d086;_0x247f78['remoteUri']=intUtil[_0x0a08('0x4d')](_0x247f78[_0x0a08('0x4b')]);_0x247f78['serverUrl']=intUtil[_0x0a08('0x4d')](_0x247f78[_0x0a08('0x4c')]);def['uri']=util[_0x0a08('0x1f')](_0x0a08('0x4f'),_0x247f78[_0x0a08('0x4b')]);if(_0xccd187&&_0xccd187['monitor_format']){logger[_0x0a08('0xb')]('[ABANDONED]',_0x0a08('0x6d'));_0x457b86[_0x0a08('0x51')]=util['format'](_0x0a08('0x65'),_0x247f78[_0x0a08('0x4c')],_0x457b86[_0x0a08('0x52')],md5(_0x457b86[_0x0a08('0x52')]));}else{_0x457b86[_0x0a08('0x51')]='';}return getConnection(_0x247f78)[_0x0a08('0x27')](function(_0xfee46f){_0x95d086=_0xfee46f;if(!_[_0x0a08('0x6e')](_0x43a709)){return getUser(_0x247f78,_0x43a709['name'],_0x95d086);}else{return getUser(_0x247f78,null,_0x95d086);}})[_0x0a08('0x27')](function(_0x3996c3){_0x16e8e4=_0x3996c3;logger[_0x0a08('0xb')]('The\x20User\x20ID\x20is:',_0x16e8e4['id']);return getEndUser(_0x247f78,_0x457b86[_0x0a08('0x54')],_0x457b86['calleridnum'],_0x95d086);})['then'](function(_0x1e2d8e){_0x118510=_0x1e2d8e;logger[_0x0a08('0xb')](_0x0a08('0x56'),_0x118510['id']);return getTicket(_0x247f78,_0x16e8e4,_0x118510,_0x59e132,_0x457b86,_0x59e132[_0x0a08('0x57')],_0x95d086,_0x0a08('0x58'));})[_0x0a08('0x27')](function(_0x41892){_0x135d0f=_0x41892;logger[_0x0a08('0xb')](_0x0a08('0x68'));logger['info'](_0x0a08('0x69'),_0x135d0f['id']);return setRelationship(_0x95d086,_0x16e8e4,_0x135d0f,'users');})[_0x0a08('0x27')](function(){return setRelationship(_0x95d086,_0x118510,_0x135d0f,'contacts');})['then'](function(){return getServerInfo(_0x95d086);})['catch'](function(_0x50950c){logger[_0x0a08('0x60')]('[ABANDONED]',JSON['stringify'](_0x50950c));});}; \ No newline at end of file +var _0x7d70=['%s/service/v4_1/rest.php','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','uniqueid','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Inbound','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','contacts','version','charAt','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','catch','error','outbound','recordingFormat','none','[OUTBOUND]','destcalleridnum','Outbound','users','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','trigger:browser:url','abandoned','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','[ABANDONED]','lodash','request-promise','bluebird','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','sugarcrm','defaults','localhost','socket.io-emitter','redis','emit','info','Creating\x20new\x20ticket...','name','Subjects','created_by','description','getString','Descriptions','date_start','toISOString','slice','replace','duration_hours','duration_minutes','parent_id','parent_type','Contacts','parent_name','length','forEach','variableName','push','idField','set_entry','stringify','Calls','format','Basic\x20%s','get_server_info','JSON','isNil','Getting\x20agent\x20with\x20name','get_entry_list','Employees','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','entry_list','user_name','value','Agent\x20found!','resolve','name_value_list','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','user_id','Searching\x20enduser\x20with\x20phone','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','then','Enduser\x20found!','first_name','','debug','[HTTP]','merge','type','string','nameField','toLowerCase','customField','custom_fields','content','variable','toString','Variable','POST','username','password','xCALLY\x20Motion\x20integration','sessionID','Account\x20%d\x20is\x20not\x20valid','set_relationship','remoteUri','stripTrailingSlash','serverUrl','uri'];(function(_0x5850b0,_0x11d1cc){var _0x28388f=function(_0x3ebf16){while(--_0x3ebf16){_0x5850b0['push'](_0x5850b0['shift']());}};_0x28388f(++_0x11d1cc);}(_0x7d70,0x118));var _0x07d7=function(_0x114fe9,_0x4af029){_0x114fe9=_0x114fe9-0x0;var _0x3d8aec=_0x7d70[_0x114fe9];return _0x3d8aec;};'use strict';var _=require(_0x07d7('0x0'));var rp=require(_0x07d7('0x1'));var BPromise=require(_0x07d7('0x2'));var md5=require(_0x07d7('0x3'));var util=require(_0x07d7('0x4'));var Redis=require(_0x07d7('0x5'));var intUtil=require(_0x07d7('0x6'));var config=require(_0x07d7('0x7'));var logger=require(_0x07d7('0x8'))(_0x07d7('0x9'));config['redis']=_[_0x07d7('0xa')](config['redis'],{'host':_0x07d7('0xb'),'port':0x18eb});var io=require(_0x07d7('0xc'))(new Redis(config[_0x07d7('0xd')]));var def={'method':'POST','json':!![]};function emit(_0x3fdc26,_0x4f8e2c,_0x5be620){io['to'](_0x3fdc26)[_0x07d7('0xe')](_0x4f8e2c,_0x5be620);}function getTicket(_0x3b18c7,_0x4a9cab,_0x349190,_0x3406a0,_0x191615,_0x13033b,_0x1e308c,_0x57b905){logger[_0x07d7('0xf')](_0x07d7('0x10'));var _0xe413d7=new Date();var _0x27044c=[{'name':_0x07d7('0x11'),'value':intUtil['getString'](_0x3406a0[_0x07d7('0x12')],_0x191615,'\x20')},{'name':'assigned_user_id','value':_0x4a9cab['id']},{'name':_0x07d7('0x13'),'value':_0x4a9cab['id']},{'name':_0x07d7('0x14'),'value':intUtil[_0x07d7('0x15')](_0x3406a0[_0x07d7('0x16')],_0x191615,'\x0a')},{'name':_0x07d7('0x17'),'value':_0xe413d7[_0x07d7('0x18')]()[_0x07d7('0x19')](0x0,0x13)[_0x07d7('0x1a')]('T','\x20')},{'name':_0x07d7('0x1b'),'value':'0'},{'name':_0x07d7('0x1c'),'value':'15'},{'name':_0x07d7('0x1d'),'value':_0x349190['id']},{'name':_0x07d7('0x1e'),'value':_0x07d7('0x1f')},{'name':_0x07d7('0x20'),'value':_0x349190['name']},{'name':'direction','value':_0x57b905}];if(_0x13033b[_0x07d7('0x21')]){_[_0x07d7('0x22')](_0x13033b,function(_0x2642c5){if(_0x191615[_0x2642c5[_0x07d7('0x23')]]){_0x27044c[_0x07d7('0x24')]({'name':_0x2642c5[_0x07d7('0x25')],'value':_0x191615[_0x2642c5[_0x07d7('0x23')]]});}});}return request({'form':{'method':_0x07d7('0x26'),'input_type':'JSON','response_type':'JSON','rest_data':JSON[_0x07d7('0x27')]({'session':_0x1e308c['id'],'module_name':_0x07d7('0x28'),'name_value_list':_0x27044c})}});}function getAuth(_0x29331e){return util[_0x07d7('0x29')](_0x07d7('0x2a'),new Buffer(_0x29331e['apiKey']+':X')['toString']('base64'));}function getServerInfo(_0xf107af){return request({'form':{'method':_0x07d7('0x2b'),'input_type':_0x07d7('0x2c'),'response_type':_0x07d7('0x2c'),'rest_data':JSON['stringify']({'session':_0xf107af['id']})}});}function getUser(_0x921124,_0x1f64e9,_0x24bb84){if(!_[_0x07d7('0x2d')](_0x1f64e9)){logger['info'](_0x07d7('0x2e'),_0x1f64e9);return request({'form':{'method':_0x07d7('0x2f'),'input_type':'JSON','response_type':_0x07d7('0x2c'),'rest_data':JSON['stringify']({'session':_0x24bb84['id'],'module_name':_0x07d7('0x30'),'query':util[_0x07d7('0x29')](_0x07d7('0x31'),_0x1f64e9),'order_by':'','offset':'0','select_fields':['id','name','user_name'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})['then'](function(_0xd79c09){if(_0xd79c09[_0x07d7('0x32')][_0x07d7('0x21')]){var _0x41fba2=_['find'](_0xd79c09[_0x07d7('0x32')],function(_0x523820){return _0x523820['name_value_list'][_0x07d7('0x33')][_0x07d7('0x34')]===_0x1f64e9;});if(_0x41fba2){logger[_0x07d7('0xf')](_0x07d7('0x35'));return BPromise[_0x07d7('0x36')]({'id':_0x41fba2[_0x07d7('0x37')]['id'][_0x07d7('0x34')],'name':_0x41fba2[_0x07d7('0x37')]['name'][_0x07d7('0x34')]});}}logger[_0x07d7('0xf')](_0x07d7('0x38'));return BPromise['resolve']({'id':_0x24bb84[_0x07d7('0x37')]['user_id'][_0x07d7('0x34')],'name':_0x24bb84[_0x07d7('0x37')][_0x07d7('0x33')][_0x07d7('0x34')]});});}else{logger[_0x07d7('0xf')]('Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!');return BPromise[_0x07d7('0x36')]({'id':_0x24bb84[_0x07d7('0x37')][_0x07d7('0x39')][_0x07d7('0x34')],'name':_0x24bb84[_0x07d7('0x37')][_0x07d7('0x33')][_0x07d7('0x34')]});}}function getEndUser(_0x15e6e1,_0x2efeaa,_0x3fb35a,_0x59cb16){logger[_0x07d7('0xf')](_0x07d7('0x3a'),_0x3fb35a);return request({'form':{'method':_0x07d7('0x2f'),'input_type':_0x07d7('0x2c'),'response_type':_0x07d7('0x2c'),'rest_data':JSON[_0x07d7('0x27')]({'session':_0x59cb16['id'],'module_name':_0x07d7('0x1f'),'query':util[_0x07d7('0x29')](_0x07d7('0x3b'),_0x3fb35a),'order_by':'','offset':'0','select_fields':['id',_0x07d7('0x11'),_0x07d7('0x3c')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x07d7('0x3d')](function(_0x1c62da){if(_0x1c62da[_0x07d7('0x32')][_0x07d7('0x21')]){var _0x124f5f=_['find'](_0x1c62da[_0x07d7('0x32')],function(_0x5e1f87){return _0x5e1f87[_0x07d7('0x37')][_0x07d7('0x3c')][_0x07d7('0x34')]===_0x3fb35a;});if(_0x124f5f){logger[_0x07d7('0xf')](_0x07d7('0x3e'));return BPromise[_0x07d7('0x36')]({'id':_0x124f5f[_0x07d7('0x37')]['id'][_0x07d7('0x34')],'name':_0x124f5f[_0x07d7('0x37')]['name'][_0x07d7('0x34')],'phone':_0x124f5f['name_value_list'][_0x07d7('0x3c')][_0x07d7('0x34')]});}}else{logger[_0x07d7('0xf')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'form':{'method':_0x07d7('0x26'),'input_type':_0x07d7('0x2c'),'response_type':_0x07d7('0x2c'),'rest_data':JSON[_0x07d7('0x27')]({'session':_0x59cb16['id'],'module_name':'Contacts','name_value_list':[{'name':_0x07d7('0x3f'),'value':_0x2efeaa!==_0x07d7('0x40')?_0x2efeaa:util[_0x07d7('0x29')]('Caller\x20-\x20%s',_0x3fb35a)},{'name':_0x07d7('0x3c'),'value':_0x3fb35a}]})}})[_0x07d7('0x3d')](function(_0x57e12e){logger[_0x07d7('0xf')]('Enduser\x20created.');return BPromise[_0x07d7('0x36')]({'id':_0x57e12e['id'],'name':_0x57e12e[_0x07d7('0x32')][_0x07d7('0x3f')]['value'],'phone':_0x57e12e['entry_list'][_0x07d7('0x3c')][_0x07d7('0x34')]});});}});}function request(_0x4b015f){logger[_0x07d7('0x41')](_0x07d7('0x42'),JSON[_0x07d7('0x27')](_0x4b015f));return rp(_[_0x07d7('0x43')](def,_0x4b015f));}function getTags(_0x3c8ea8,_0x5890c6){var _0x1c120c=[];if(_0x3c8ea8&&_0x3c8ea8['length']>0x0){_0x1c120c=_['map'](_0x3c8ea8,_0x5890c6);}return _0x1c120c;}function getCustomFields(_0x522772,_0x535d41){var _0x1c1735=[];var _0x29f5a7={'custom_fields':[]};if(_0x522772[_0x07d7('0x21')]>0x0){_['forEach'](_0x522772,function(_0x3895e6){if(_0x3895e6[_0x07d7('0x44')]===_0x07d7('0x45')&&_0x3895e6[_0x07d7('0x46')]&&!_0x3895e6['customField']){_0x29f5a7[_0x3895e6['nameField'][_0x07d7('0x47')]()]=_0x3895e6['content']['toString']();}else if(_0x3895e6[_0x07d7('0x44')]===_0x07d7('0x45')&&_0x3895e6[_0x07d7('0x25')]&&_0x3895e6[_0x07d7('0x48')]){_0x29f5a7[_0x07d7('0x49')]['push']({'id':_0x3895e6[_0x07d7('0x25')],'value':_0x3895e6[_0x07d7('0x4a')]['toString']()});}else if(_0x3895e6['type']===_0x07d7('0x4b')&&_0x3895e6[_0x07d7('0x23')]&&_0x3895e6['idField']&&_0x3895e6['customField']){_0x535d41[_0x3895e6[_0x07d7('0x23')]]&&_0x29f5a7[_0x07d7('0x49')][_0x07d7('0x24')]({'id':_0x3895e6['idField'],'value':_0x535d41[_0x3895e6[_0x07d7('0x23')]][_0x07d7('0x4c')]()});}else if(_0x3895e6[_0x07d7('0x44')]==='customVariable'&&_0x3895e6[_0x07d7('0x4d')]&&_0x3895e6[_0x07d7('0x4d')]['name']&&_0x3895e6[_0x07d7('0x25')]&&_0x3895e6['customField']){_0x535d41[_0x3895e6[_0x07d7('0x4d')][_0x07d7('0x11')][_0x07d7('0x47')]()]&&_0x29f5a7[_0x07d7('0x49')][_0x07d7('0x24')]({'id':_0x3895e6[_0x07d7('0x25')],'value':_0x535d41[_0x3895e6['Variable']['name'][_0x07d7('0x47')]()][_0x07d7('0x4c')]()});}});}return _0x29f5a7;}function getConnection(_0x4496bd){return request({'method':_0x07d7('0x4e'),'form':{'method':'login','input_type':'JSON','response_type':_0x07d7('0x2c'),'rest_data':JSON[_0x07d7('0x27')]({'user_auth':{'user_name':_0x4496bd[_0x07d7('0x4f')],'password':_0x4496bd[_0x07d7('0x50')],'encryption':'PLAIN'},'application':_0x07d7('0x51')})}})[_0x07d7('0x3d')](function(_0x40a7aa){var _0x53824a=_0x40a7aa;if(_0x53824a['id']){def[_0x07d7('0x52')]=_0x53824a['id'];return BPromise[_0x07d7('0x36')](_0x53824a);}else{throw new Error(util[_0x07d7('0x29')](_0x07d7('0x53'),_0x4496bd['id']));}});}function setRelationship(_0x3c1978,_0xe4ce9,_0x13ae14,_0x5dab27){return request({'form':{'method':_0x07d7('0x54'),'input_type':_0x07d7('0x2c'),'response_type':_0x07d7('0x2c'),'rest_data':JSON[_0x07d7('0x27')]({'session':_0x3c1978['id'],'module_name':_0x07d7('0x28'),'module_id':_0x13ae14['id'],'link_field_name':_0x5dab27,'related_ids':[_0xe4ce9['id']]})}});}exports['queue']=function(_0x168a27,_0x42dfe9,_0x4fb08c,_0x30586d,_0x1eab24,_0x2f4368){var _0x10ac90,_0x168475,_0x16004d,_0x2571e0;_0x2f4368[_0x07d7('0x55')]=intUtil[_0x07d7('0x56')](_0x2f4368[_0x07d7('0x55')]);_0x2f4368[_0x07d7('0x57')]=intUtil[_0x07d7('0x56')](_0x2f4368[_0x07d7('0x57')]);def[_0x07d7('0x58')]=util[_0x07d7('0x29')](_0x07d7('0x59'),_0x2f4368[_0x07d7('0x55')]);if(_0x1eab24&&_0x1eab24[_0x07d7('0x5a')]){logger[_0x07d7('0xf')](_0x07d7('0x5b'),_0x07d7('0x5c'));_0x42dfe9[_0x07d7('0x5d')]=util[_0x07d7('0x29')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2f4368['serverUrl'],_0x42dfe9[_0x07d7('0x5e')],md5(_0x42dfe9[_0x07d7('0x5e')]));}else{_0x42dfe9[_0x07d7('0x5d')]='';}return getConnection(_0x2f4368)[_0x07d7('0x3d')](function(_0x31cff3){_0x2571e0=_0x31cff3;return getUser(_0x2f4368,_0x30586d[_0x07d7('0x11')],_0x2571e0);})[_0x07d7('0x3d')](function(_0x19eac9){_0x10ac90=_0x19eac9;logger[_0x07d7('0xf')](_0x07d7('0x5f'),_0x10ac90['id']);return getEndUser(_0x2f4368,_0x42dfe9[_0x07d7('0x60')],_0x42dfe9[_0x07d7('0x61')],_0x2571e0);})['then'](function(_0x252d43){_0x168475=_0x252d43;logger[_0x07d7('0xf')](_0x07d7('0x62'),_0x168475['id']);return getTicket(_0x2f4368,_0x10ac90,_0x168475,_0x4fb08c,_0x42dfe9,_0x4fb08c[_0x07d7('0x63')],_0x2571e0,_0x07d7('0x64'));})[_0x07d7('0x3d')](function(_0x46e47c){_0x16004d=_0x46e47c;logger['info'](_0x07d7('0x65'));logger[_0x07d7('0xf')](_0x07d7('0x66'),_0x16004d['id']);return setRelationship(_0x2571e0,_0x10ac90,_0x16004d,'users');})['then'](function(){return setRelationship(_0x2571e0,_0x168475,_0x16004d,_0x07d7('0x67'));})[_0x07d7('0x3d')](function(){return getServerInfo(_0x2571e0);})[_0x07d7('0x3d')](function(_0xfe1223){var _0x2d6917=parseInt(_0xfe1223[_0x07d7('0x68')][_0x07d7('0x69')](0x0));var _0x3367d9=util['format']('%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s',_0x2f4368[_0x07d7('0x55')],_0x16004d['id']);if(_0x2d6917>0x6){_0x3367d9=util[_0x07d7('0x29')](_0x07d7('0x6a'),_0x2f4368['remoteUri'],_0x16004d['id']);}logger['info'](_0x07d7('0x5b'),_0x07d7('0x6b'));emit(util['format'](_0x07d7('0x6c'),_0x30586d[_0x07d7('0x11')]),'trigger:browser:url',{'uri':_0x3367d9});})[_0x07d7('0x6d')](function(_0x313b2f){logger[_0x07d7('0x6e')](_0x07d7('0x5b'),JSON[_0x07d7('0x27')](_0x313b2f));});};exports[_0x07d7('0x6f')]=function(_0x4abdb1,_0x449967,_0x24c153,_0x23259c,_0x57ccca,_0x5154d6,_0x36fa94){var _0x416647,_0x43b83c,_0x25bcdd,_0x5a699d;_0x5154d6[_0x07d7('0x55')]=intUtil[_0x07d7('0x56')](_0x5154d6['remoteUri']);_0x5154d6['serverUrl']=intUtil[_0x07d7('0x56')](_0x5154d6[_0x07d7('0x57')]);def['uri']=util['format'](_0x07d7('0x59'),_0x5154d6[_0x07d7('0x55')]);if(_0x36fa94&&_0x36fa94[_0x07d7('0x70')]&&_0x36fa94['recordingFormat']!==_0x07d7('0x71')){logger[_0x07d7('0xf')](_0x07d7('0x72'),_0x07d7('0x5c'));_0x449967[_0x07d7('0x5d')]=util[_0x07d7('0x29')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x5154d6[_0x07d7('0x57')],_0x449967[_0x07d7('0x5e')],md5(_0x449967[_0x07d7('0x5e')]));}return getConnection(_0x5154d6)[_0x07d7('0x3d')](function(_0x582f5c){_0x5a699d=_0x582f5c;return getUser(_0x5154d6,_0x23259c[_0x07d7('0x11')],_0x5a699d);})[_0x07d7('0x3d')](function(_0x100004){_0x416647=_0x100004;logger['info'](_0x07d7('0x5f'),_0x416647['id']);return getEndUser(_0x5154d6,_0x449967['destcalleridname'],_0x449967[_0x07d7('0x73')],_0x5a699d);})['then'](function(_0x444977){_0x43b83c=_0x444977;logger['info'](_0x07d7('0x62'),_0x43b83c['id']);return getTicket(_0x5154d6,_0x416647,_0x43b83c,_0x24c153,_0x449967,_0x24c153[_0x07d7('0x63')],_0x5a699d,_0x07d7('0x74'));})['then'](function(_0x43e066){_0x25bcdd=_0x43e066;logger[_0x07d7('0xf')]('Ticket\x20created!');logger[_0x07d7('0xf')](_0x07d7('0x66'),_0x25bcdd['id']);return setRelationship(_0x5a699d,_0x416647,_0x25bcdd,_0x07d7('0x75'));})[_0x07d7('0x3d')](function(){return setRelationship(_0x5a699d,_0x43b83c,_0x25bcdd,_0x07d7('0x67'));})[_0x07d7('0x3d')](function(){return getServerInfo(_0x5a699d);})[_0x07d7('0x3d')](function(_0x33c099){var _0x175ba5=parseInt(_0x33c099[_0x07d7('0x68')][_0x07d7('0x69')](0x0));var _0x4bd2ab=util['format'](_0x07d7('0x76'),_0x5154d6[_0x07d7('0x55')],_0x25bcdd['id']);if(_0x175ba5>0x6){_0x4bd2ab=util[_0x07d7('0x29')]('%s/#bwc/index.php?module=Calls&action=EditView&record=%s',_0x5154d6[_0x07d7('0x55')],_0x25bcdd['id']);}logger[_0x07d7('0xf')]('[OUTBOUND]',_0x07d7('0x6b'));emit(util['format'](_0x07d7('0x6c'),_0x23259c[_0x07d7('0x11')]),_0x07d7('0x77'),{'uri':_0x4bd2ab});})[_0x07d7('0x6d')](function(_0x265423){logger[_0x07d7('0x6e')](_0x07d7('0x72'),JSON[_0x07d7('0x27')](_0x265423));});};exports[_0x07d7('0x78')]=function(_0x556204,_0x5bdcc1,_0x4425c0,_0x2bab6e,_0x5515cc,_0x1a1e1){var _0x50ba2e,_0x4ea64d,_0x5dcd28,_0x4d00fc;_0x1a1e1[_0x07d7('0x55')]=intUtil[_0x07d7('0x56')](_0x1a1e1['remoteUri']);_0x1a1e1[_0x07d7('0x57')]=intUtil[_0x07d7('0x56')](_0x1a1e1['serverUrl']);def[_0x07d7('0x58')]=util[_0x07d7('0x29')](_0x07d7('0x59'),_0x1a1e1[_0x07d7('0x55')]);if(_0x5515cc&&_0x5515cc['monitor_format']){logger[_0x07d7('0xf')]('[ABANDONED]',_0x07d7('0x5c'));_0x5bdcc1[_0x07d7('0x5d')]=util[_0x07d7('0x29')](_0x07d7('0x79'),_0x1a1e1[_0x07d7('0x57')],_0x5bdcc1[_0x07d7('0x5e')],md5(_0x5bdcc1['uniqueid']));}else{_0x5bdcc1[_0x07d7('0x5d')]='';}return getConnection(_0x1a1e1)['then'](function(_0x29127a){_0x4d00fc=_0x29127a;if(!_[_0x07d7('0x2d')](_0x2bab6e)){return getUser(_0x1a1e1,_0x2bab6e[_0x07d7('0x11')],_0x4d00fc);}else{return getUser(_0x1a1e1,null,_0x4d00fc);}})[_0x07d7('0x3d')](function(_0x2668e4){_0x50ba2e=_0x2668e4;logger[_0x07d7('0xf')](_0x07d7('0x5f'),_0x50ba2e['id']);return getEndUser(_0x1a1e1,_0x5bdcc1['calleridname'],_0x5bdcc1[_0x07d7('0x61')],_0x4d00fc);})['then'](function(_0xe117ed){_0x4ea64d=_0xe117ed;logger[_0x07d7('0xf')](_0x07d7('0x62'),_0x4ea64d['id']);return getTicket(_0x1a1e1,_0x50ba2e,_0x4ea64d,_0x4425c0,_0x5bdcc1,_0x4425c0[_0x07d7('0x63')],_0x4d00fc,_0x07d7('0x64'));})['then'](function(_0x37ff80){_0x5dcd28=_0x37ff80;logger[_0x07d7('0xf')](_0x07d7('0x65'));logger[_0x07d7('0xf')](_0x07d7('0x66'),_0x5dcd28['id']);return setRelationship(_0x4d00fc,_0x50ba2e,_0x5dcd28,_0x07d7('0x75'));})[_0x07d7('0x3d')](function(){return setRelationship(_0x4d00fc,_0x4ea64d,_0x5dcd28,_0x07d7('0x67'));})['then'](function(){return getServerInfo(_0x4d00fc);})[_0x07d7('0x6d')](function(_0x5f2d3d){logger[_0x07d7('0x6e')](_0x07d7('0x7a'),JSON[_0x07d7('0x27')](_0x5f2d3d));});}; \ 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 3395c50..eaaa7b0 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 _0x7afa=['toString','customVariable','Variable','toLowerCase','name','keyValue','keyType','key','%s:\x20%s','keyContent','format','slice','lastIndexOf','validateEmail','isNil','test','lodash','length','sortBy','type','string','push','variableName'];(function(_0x488616,_0x516a25){var _0x217fb3=function(_0x43bd59){while(--_0x43bd59){_0x488616['push'](_0x488616['shift']());}};_0x217fb3(++_0x516a25);}(_0x7afa,0x124));var _0xa7af=function(_0x352aac,_0x5c2e22){_0x352aac=_0x352aac-0x0;var _0x3254c9=_0x7afa[_0x352aac];return _0x3254c9;};'use strict';var _=require(_0xa7af('0x0'));var util=require('util');exports['getString']=function(_0x35fd10,_0x20b32a,_0x30cfea){var _0xb58003=[];if(_0x35fd10[_0xa7af('0x1')]>0x0){var _0x263083=_[_0xa7af('0x2')](_0x35fd10,['id']);for(var _0x1be4e6=0x0;_0x1be4e6<_0x263083[_0xa7af('0x1')];_0x1be4e6++){var _0x49bf83=_0x263083[_0x1be4e6];if(_0x49bf83[_0xa7af('0x3')]===_0xa7af('0x4')){_0xb58003[_0xa7af('0x5')](_0x49bf83['content']);}else if(_0x49bf83[_0xa7af('0x3')]==='variable'&&_0x49bf83[_0xa7af('0x6')]){_0x20b32a[_0x49bf83[_0xa7af('0x6')]]&&_0xb58003[_0xa7af('0x5')](_0x20b32a[_0x49bf83[_0xa7af('0x6')]][_0xa7af('0x7')]());}else if(_0x49bf83[_0xa7af('0x3')]===_0xa7af('0x8')&&_0x49bf83[_0xa7af('0x9')]&&_0x49bf83[_0xa7af('0x9')]['name']){_0x20b32a[_0x49bf83[_0xa7af('0x9')]['name'][_0xa7af('0xa')]()]&&_0xb58003[_0xa7af('0x5')](_0x20b32a[_0x49bf83[_0xa7af('0x9')][_0xa7af('0xb')][_0xa7af('0xa')]()][_0xa7af('0x7')]());}else if(_0x49bf83[_0xa7af('0x3')]===_0xa7af('0xc')){if(_0x49bf83[_0xa7af('0xd')]===_0xa7af('0x4')&&_0x49bf83[_0xa7af('0xe')]){_0xb58003[_0xa7af('0x5')](util['format'](_0xa7af('0xf'),_0x49bf83['key'],_0x49bf83[_0xa7af('0x10')]));}else if(_0x49bf83[_0xa7af('0xd')]==='variable'&&_0x49bf83[_0xa7af('0x6')]&&_0x49bf83['key']){_0x20b32a[_0x49bf83[_0xa7af('0x6')]]&&_0xb58003[_0xa7af('0x5')](util[_0xa7af('0x11')](_0xa7af('0xf'),_0x49bf83['key'],_0x20b32a[_0x49bf83[_0xa7af('0x6')]]));}else if(_0x49bf83[_0xa7af('0xd')]===_0xa7af('0x8')&&_0x49bf83['Variable']&&_0x49bf83[_0xa7af('0x9')][_0xa7af('0xb')]&&_0x49bf83[_0xa7af('0xe')]){_0x20b32a[_0x49bf83['Variable'][_0xa7af('0xb')][_0xa7af('0xa')]()]&&_0xb58003[_0xa7af('0x5')](util[_0xa7af('0x11')](_0xa7af('0xf'),_0x49bf83[_0xa7af('0xe')],_0x20b32a[_0x49bf83[_0xa7af('0x9')][_0xa7af('0xb')][_0xa7af('0xa')]()]));}}}}return _0xb58003['join'](_0x30cfea);};exports['stripTrailingSlash']=function(_0x4af6fc){var _0xe2ac75=_0x4af6fc[_0xa7af('0x12')](-0x1);if(_0xe2ac75==='/'){_0x4af6fc=_0x4af6fc['substring'](0x0,_0x4af6fc[_0xa7af('0x13')](_0xe2ac75));}return _0x4af6fc;};exports[_0xa7af('0x14')]=function(_0x4988e0){if(!_[_0xa7af('0x15')](_0x4988e0)&&_0x4988e0!==''){var _0x5213a2=/^(([^<>()\[\]\\.,;:\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 _0x5213a2[_0xa7af('0x16')](String(_0x4988e0)[_0xa7af('0xa')]());}else{return![];}}; \ No newline at end of file +var _0xca40=['keyType','key','format','keyContent','%s:\x20%s','toLowerCase','join','stripTrailingSlash','slice','lastIndexOf','validateEmail','test','lodash','util','getString','length','sortBy','type','string','push','variable','variableName','customVariable','Variable','name','toString'];(function(_0x1ad68e,_0x16562f){var _0x82d21e=function(_0x755572){while(--_0x755572){_0x1ad68e['push'](_0x1ad68e['shift']());}};_0x82d21e(++_0x16562f);}(_0xca40,0x8e));var _0x0ca4=function(_0x33c1b1,_0x2355fb){_0x33c1b1=_0x33c1b1-0x0;var _0x2c2037=_0xca40[_0x33c1b1];return _0x2c2037;};'use strict';var _=require(_0x0ca4('0x0'));var util=require(_0x0ca4('0x1'));exports[_0x0ca4('0x2')]=function(_0x557193,_0x118e04,_0x3e06d9){var _0x415414=[];if(_0x557193[_0x0ca4('0x3')]>0x0){var _0x2ea56e=_[_0x0ca4('0x4')](_0x557193,['id']);for(var _0x3cf190=0x0;_0x3cf190<_0x2ea56e[_0x0ca4('0x3')];_0x3cf190++){var _0x25169c=_0x2ea56e[_0x3cf190];if(_0x25169c[_0x0ca4('0x5')]===_0x0ca4('0x6')){_0x415414[_0x0ca4('0x7')](_0x25169c['content']);}else if(_0x25169c[_0x0ca4('0x5')]===_0x0ca4('0x8')&&_0x25169c['variableName']){_0x118e04[_0x25169c['variableName']]&&_0x415414[_0x0ca4('0x7')](_0x118e04[_0x25169c[_0x0ca4('0x9')]]['toString']());}else if(_0x25169c[_0x0ca4('0x5')]===_0x0ca4('0xa')&&_0x25169c[_0x0ca4('0xb')]&&_0x25169c[_0x0ca4('0xb')][_0x0ca4('0xc')]){_0x118e04[_0x25169c['Variable']['name']['toLowerCase']()]&&_0x415414[_0x0ca4('0x7')](_0x118e04[_0x25169c[_0x0ca4('0xb')]['name']['toLowerCase']()][_0x0ca4('0xd')]());}else if(_0x25169c[_0x0ca4('0x5')]==='keyValue'){if(_0x25169c[_0x0ca4('0xe')]==='string'&&_0x25169c[_0x0ca4('0xf')]){_0x415414[_0x0ca4('0x7')](util[_0x0ca4('0x10')]('%s:\x20%s',_0x25169c['key'],_0x25169c[_0x0ca4('0x11')]));}else if(_0x25169c[_0x0ca4('0xe')]==='variable'&&_0x25169c[_0x0ca4('0x9')]&&_0x25169c[_0x0ca4('0xf')]){_0x118e04[_0x25169c['variableName']]&&_0x415414[_0x0ca4('0x7')](util['format'](_0x0ca4('0x12'),_0x25169c[_0x0ca4('0xf')],_0x118e04[_0x25169c['variableName']]));}else if(_0x25169c[_0x0ca4('0xe')]===_0x0ca4('0xa')&&_0x25169c['Variable']&&_0x25169c[_0x0ca4('0xb')][_0x0ca4('0xc')]&&_0x25169c[_0x0ca4('0xf')]){_0x118e04[_0x25169c[_0x0ca4('0xb')]['name']['toLowerCase']()]&&_0x415414[_0x0ca4('0x7')](util[_0x0ca4('0x10')](_0x0ca4('0x12'),_0x25169c[_0x0ca4('0xf')],_0x118e04[_0x25169c[_0x0ca4('0xb')][_0x0ca4('0xc')][_0x0ca4('0x13')]()]));}}}}return _0x415414[_0x0ca4('0x14')](_0x3e06d9);};exports[_0x0ca4('0x15')]=function(_0x325f95){var _0x10af36=_0x325f95[_0x0ca4('0x16')](-0x1);if(_0x10af36==='/'){_0x325f95=_0x325f95['substring'](0x0,_0x325f95[_0x0ca4('0x17')](_0x10af36));}return _0x325f95;};exports[_0x0ca4('0x18')]=function(_0x5265d6){if(!_['isNil'](_0x5265d6)&&_0x5265d6!==''){var _0x22bc7b=/^(([^<>()\[\]\\.,;:\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 _0x22bc7b[_0x0ca4('0x19')](String(_0x5265d6)[_0x0ca4('0x13')]());}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 3b3ead2..a09a735 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 _0xa571=['toString','customVariable','Variable','name','info','merge','Normal','Open','Descriptions','POST','format','%s/webservice.php','remoteUri','create','username','sessionName','HelpDesk','stringify','then','success','resolve','result','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','error','catch','[vTiger],\x20%s,\x20%s,\x20%s','Getting\x20agent\x20with\x20email','GET','query','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','Agent\x20found!','email1','last_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','admin','statusCode','getUser','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!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','lastname','getEndUser','getchallenge','login','token','Account\x20%d\x20is\x20not\x20valid','[HTTP]','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','email','The\x20User\x20ID\x20is:','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','serverUrl','recordingFormat','none','[OUTBOUND]','uniqueid','destcalleridname','destcalleridnum','The\x20Ticket\x20ID\x20is:','abandoned','[ABANDONED]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','calleridname','calleridnum','lodash','request-promise','bluebird','md5','ioredis','./util','vTiger','defaults','redis','localhost','socket.io-emitter','emit','length','forEach','type','string','idField','variable','variableName'];(function(_0x139a3c,_0x4fc883){var _0x2b375b=function(_0x525dbf){while(--_0x525dbf){_0x139a3c['push'](_0x139a3c['shift']());}};_0x2b375b(++_0x4fc883);}(_0xa571,0x107));var _0x1a57=function(_0x557f4e,_0x436ed7){_0x557f4e=_0x557f4e-0x0;var _0x49054c=_0xa571[_0x557f4e];return _0x49054c;};'use strict';var _=require(_0x1a57('0x0'));var rp=require(_0x1a57('0x1'));var BPromise=require(_0x1a57('0x2'));var md5=require(_0x1a57('0x3'));var util=require('util');var Redis=require(_0x1a57('0x4'));var intUtil=require(_0x1a57('0x5'));var config=require('../../../../config/environment');var logger=require('../../../../config/logger')(_0x1a57('0x6'));config['redis']=_[_0x1a57('0x7')](config[_0x1a57('0x8')],{'host':_0x1a57('0x9'),'port':0x18eb});var io=require(_0x1a57('0xa'))(new Redis(config[_0x1a57('0x8')]));function emit(_0x924873,_0x5d9f45,_0x3edb40){io['to'](_0x924873)[_0x1a57('0xb')](_0x5d9f45,_0x3edb40);}function getCustomFields(_0x3631d6,_0x58e266){var _0x3c8182={};if(_0x3631d6[_0x1a57('0xc')]>0x0){_[_0x1a57('0xd')](_0x3631d6,function(_0x289dc0){if(_0x289dc0[_0x1a57('0xe')]===_0x1a57('0xf')&&_0x289dc0[_0x1a57('0x10')]){_0x3c8182[_0x289dc0[_0x1a57('0x10')]]=_0x289dc0['content']['toString']();}else if(_0x289dc0[_0x1a57('0xe')]===_0x1a57('0x11')&&_0x289dc0[_0x1a57('0x12')]&&_0x289dc0['idField']&&_0x58e266[_0x289dc0[_0x1a57('0x12')]]){_0x3c8182[_0x289dc0[_0x1a57('0x10')]]=_0x58e266[_0x289dc0['variableName']][_0x1a57('0x13')]();}else if(_0x289dc0['type']===_0x1a57('0x14')&&_0x289dc0[_0x1a57('0x15')]&&_0x289dc0[_0x1a57('0x15')][_0x1a57('0x16')]&&_0x289dc0['idField']&&_0x58e266[_0x289dc0[_0x1a57('0x15')]['name']['toLowerCase']()]){_0x3c8182[_0x289dc0[_0x1a57('0x10')]]=_0x58e266[_0x289dc0[_0x1a57('0x15')][_0x1a57('0x16')]['toLowerCase']()][_0x1a57('0x13')]();}});}return _0x3c8182;}function createTicket(_0x1662a3,_0x80f8c1,_0x53bb20,_0x3daa66,_0x4262c8,_0x451b34,_0xcba6b7){logger[_0x1a57('0x17')]('Creating\x20new\x20ticket...');var _0x53df95=_[_0x1a57('0x18')]({'parent_id':'','assigned_user_id':_0x80f8c1['id'],'ticketpriorities':_0x1a57('0x19'),'ticketstatus':_0x1a57('0x1a'),'ticket_title':intUtil['getString'](_0x3daa66['Subjects'],_0x4262c8,'\x20'),'description':intUtil['getString'](_0x3daa66[_0x1a57('0x1b')],_0x4262c8,'\x0a'),'contact_id':_0x53bb20['id']},getCustomFields(_0x451b34,_0x4262c8));var _0x113ad4={'method':_0x1a57('0x1c'),'uri':util[_0x1a57('0x1d')](_0x1a57('0x1e'),_0x1662a3[_0x1a57('0x1f')]),'form':{'operation':_0x1a57('0x20'),'username':_0x1662a3[_0x1a57('0x21')],'sessionName':_0xcba6b7[_0x1a57('0x22')],'elementType':_0x1a57('0x23'),'element':JSON[_0x1a57('0x24')](_0x53df95)},'json':!![]};return request(_0x113ad4)[_0x1a57('0x25')](function(_0x26cdd3){if(_0x26cdd3[_0x1a57('0x26')]){return BPromise[_0x1a57('0x27')]({'id':_0x26cdd3[_0x1a57('0x28')]['id']});}else{throw new Error(util[_0x1a57('0x1d')](_0x1a57('0x29'),JSON[_0x1a57('0x24')](_0x26cdd3[_0x1a57('0x2a')])));}})[_0x1a57('0x2b')](function(_0x1dd939){var _0x5a53c8=_0x1dd939['statusCode']||0x1f4;logger[_0x1a57('0x2a')](_0x1a57('0x2c'),'createTicket',_0x5a53c8,JSON[_0x1a57('0x24')](_0x1dd939));});}function getUser(_0x54f6a5,_0x2d8738,_0x4a2901){if(intUtil['validateEmail'](_0x2d8738)){logger[_0x1a57('0x17')](_0x1a57('0x2d'),_0x2d8738);return request({'method':_0x1a57('0x2e'),'uri':util[_0x1a57('0x1d')]('%s/webservice.php',_0x54f6a5[_0x1a57('0x1f')]),'qs':{'operation':_0x1a57('0x2f'),'username':_0x54f6a5[_0x1a57('0x21')],'sessionName':_0x4a2901[_0x1a57('0x22')],'query':util['format'](_0x1a57('0x30'),_0x2d8738)},'json':!![]})[_0x1a57('0x25')](function(_0x139fc9){if(_0x139fc9[_0x1a57('0x26')]&&_0x139fc9[_0x1a57('0x28')][_0x1a57('0xc')]){logger[_0x1a57('0x17')](_0x1a57('0x31'));return BPromise[_0x1a57('0x27')]({'id':_0x139fc9['result'][0x0]['id'],'email':_0x139fc9[_0x1a57('0x28')][0x0][_0x1a57('0x32')],'name':_0x139fc9['result'][0x0]['first_name']+'\x20'+_0x139fc9[_0x1a57('0x28')][_0x1a57('0x33')]});}else{logger[_0x1a57('0x17')](_0x1a57('0x34'));return BPromise[_0x1a57('0x27')]({'id':_0x4a2901[_0x1a57('0x35')],'email':_0x54f6a5[_0x1a57('0x21')],'name':_0x1a57('0x36')});}})[_0x1a57('0x2b')](function(_0x2a6feb){var _0x4091b6=_0x2a6feb[_0x1a57('0x37')]||0x1f4;logger[_0x1a57('0x2a')](_0x1a57('0x2c'),_0x1a57('0x38'),_0x4091b6,JSON[_0x1a57('0x24')](_0x2a6feb));});}else{logger[_0x1a57('0x17')](_0x1a57('0x34'));return BPromise['resolve']({'id':_0x4a2901[_0x1a57('0x35')],'email':_0x54f6a5[_0x1a57('0x21')],'name':_0x1a57('0x36')})[_0x1a57('0x2b')](function(_0x58b7dc){var _0xf64cb5=_0x58b7dc[_0x1a57('0x37')]||0x1f4;logger[_0x1a57('0x2a')](_0x1a57('0x2c'),'getUser',_0xf64cb5,JSON['stringify'](_0x58b7dc));});}}function getEndUser(_0x5da96f,_0x50a38c,_0x333b32,_0x14d619){logger[_0x1a57('0x17')]('Searching\x20end\x20user\x20with\x20phone',_0x333b32);return request({'method':_0x1a57('0x2e'),'uri':util[_0x1a57('0x1d')](_0x1a57('0x1e'),_0x5da96f[_0x1a57('0x1f')]),'qs':{'operation':'query','username':_0x5da96f[_0x1a57('0x21')],'sessionName':_0x14d619['sessionName'],'query':util[_0x1a57('0x1d')](_0x1a57('0x39'),_0x333b32,_0x333b32,_0x333b32,_0x333b32,_0x333b32)},'json':!![]})[_0x1a57('0x25')](function(_0x534a9a){if(_0x534a9a[_0x1a57('0x26')]&&_0x534a9a[_0x1a57('0x28')][_0x1a57('0xc')]){logger[_0x1a57('0x17')](_0x1a57('0x3a'));return BPromise['resolve']({'id':_0x534a9a[_0x1a57('0x28')][0x0]['id'],'name':_0x534a9a['result'][0x0]['firstname']+'\x20'+_0x534a9a[_0x1a57('0x28')][0x0]['lastname'],'phone':_0x333b32});}else{logger[_0x1a57('0x17')](_0x1a57('0x3b'));return request({'method':_0x1a57('0x1c'),'uri':util['format'](_0x1a57('0x1e'),_0x5da96f[_0x1a57('0x1f')]),'form':{'operation':_0x1a57('0x20'),'sessionName':_0x14d619[_0x1a57('0x22')],'elementType':'Contacts','element':JSON[_0x1a57('0x24')]({'lastname':_0x50a38c,'phone':_0x333b32,'assigned_user_id':'\x20'})},'json':!![]})[_0x1a57('0x25')](function(_0x4fdd29){logger[_0x1a57('0x17')]('Enduser\x20created.');return BPromise['resolve']({'id':_0x4fdd29[_0x1a57('0x28')]['id'],'name':_0x4fdd29[_0x1a57('0x28')][_0x1a57('0x3c')],'phone':_0x4fdd29[_0x1a57('0x28')]['phone']});})[_0x1a57('0x2b')](function(_0xec234d){var _0x20517c=_0xec234d[_0x1a57('0x37')]||0x1f4;logger[_0x1a57('0x2a')]('[vTiger],\x20%s,\x20%s,\x20%s',_0x1a57('0x3d'),_0x20517c,JSON[_0x1a57('0x24')](_0xec234d));});}});}function getConnection(_0x3b9660){var _0x2dd70=_0x3b9660['username'];var _0x1f1abd=_0x3b9660['accessKey'];return request({'method':_0x1a57('0x2e'),'uri':util[_0x1a57('0x1d')](_0x1a57('0x1e'),_0x3b9660[_0x1a57('0x1f')]),'qs':{'operation':_0x1a57('0x3e'),'username':_0x2dd70},'json':!![]})[_0x1a57('0x25')](function(_0x28f629){if(_0x28f629[_0x1a57('0x26')]){return request({'method':_0x1a57('0x1c'),'uri':util[_0x1a57('0x1d')](_0x1a57('0x1e'),_0x3b9660[_0x1a57('0x1f')]),'form':{'operation':_0x1a57('0x3f'),'username':_0x2dd70,'accessKey':md5(_0x28f629['result'][_0x1a57('0x40')]+_0x1f1abd)},'json':!![]});}})[_0x1a57('0x25')](function(_0x3bf103){if(_0x3bf103[_0x1a57('0x26')]){return BPromise[_0x1a57('0x27')](_0x3bf103[_0x1a57('0x28')]);}else{throw new Error(util[_0x1a57('0x1d')](_0x1a57('0x41'),_0x3b9660['id']));}})[_0x1a57('0x2b')](function(_0x2c8daa){var _0xe82028=_0x2c8daa['statusCode']||0x1f4;logger[_0x1a57('0x2a')](_0x1a57('0x2c'),'getConnection',_0xe82028,JSON[_0x1a57('0x24')](_0x2c8daa));});}function request(_0x270a33){logger['info'](_0x1a57('0x42'),JSON[_0x1a57('0x24')](_0x270a33));return rp(_0x270a33);}exports['queue']=function(_0x4d3177,_0x5b0563,_0x2c1bac,_0x41465b,_0x509c4f,_0x1ec79c){var _0x18267c,_0x572202,_0x5e510e,_0x4b02c9;_0x1ec79c[_0x1a57('0x1f')]=intUtil[_0x1a57('0x43')](_0x1ec79c[_0x1a57('0x1f')]);if(_0x509c4f&&_0x509c4f[_0x1a57('0x44')]){logger[_0x1a57('0x17')](_0x1a57('0x45'),_0x1a57('0x46'));_0x5b0563[_0x1a57('0x47')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x1ec79c['serverUrl'],_0x5b0563['uniqueid'],md5(_0x5b0563['uniqueid']));}else{_0x5b0563[_0x1a57('0x47')]='';}return getConnection(_0x1ec79c)[_0x1a57('0x25')](function(_0xcba9f0){_0x4b02c9=_0xcba9f0;return getUser(_0x1ec79c,_0x41465b[_0x1a57('0x48')],_0x4b02c9);})[_0x1a57('0x25')](function(_0x2f09e7){_0x18267c=_0x2f09e7;logger[_0x1a57('0x17')](_0x1a57('0x49'),_0x18267c['id']);return getEndUser(_0x1ec79c,_0x5b0563['calleridname'],_0x5b0563['calleridnum'],_0x4b02c9);})['then'](function(_0x13ebc4){_0x572202=_0x13ebc4;logger['info'](_0x1a57('0x4a'),_0x572202['id']);return createTicket(_0x1ec79c,_0x18267c,_0x572202,_0x2c1bac,_0x5b0563,_0x2c1bac[_0x1a57('0x4b')],_0x4b02c9);})[_0x1a57('0x25')](function(_0x352aca){_0x5e510e=_0x352aca;logger[_0x1a57('0x17')](_0x1a57('0x4c'));logger[_0x1a57('0x17')]('The\x20Ticket\x20ID\x20is:',_0x5e510e['id']);var _0x4e56b5=util['format'](_0x1a57('0x4d'),_0x1ec79c[_0x1a57('0x1f')],_[_0x1a57('0x4e')](_0x5e510e['id'],'x')[0x1]);logger[_0x1a57('0x17')](_0x1a57('0x45'),_0x1a57('0x4f'));emit(util[_0x1a57('0x1d')]('user:%s',_0x41465b['name']),_0x1a57('0x50'),{'uri':_0x4e56b5});})[_0x1a57('0x2b')](function(_0x231154){logger[_0x1a57('0x2a')](_0x1a57('0x45'),JSON[_0x1a57('0x24')](_0x231154));});};exports['outbound']=function(_0x47db75,_0x3bf6dd,_0x388740,_0x5b0f86,_0x55c89e,_0x227844,_0x3a8806){var _0x31cb10,_0x10ceb8,_0x3ddc7e,_0x103fbe;_0x227844[_0x1a57('0x1f')]=intUtil['stripTrailingSlash'](_0x227844['remoteUri']);_0x227844[_0x1a57('0x51')]=intUtil[_0x1a57('0x43')](_0x227844[_0x1a57('0x51')]);if(_0x3a8806&&_0x3a8806[_0x1a57('0x52')]&&_0x3a8806['recordingFormat']!==_0x1a57('0x53')){logger[_0x1a57('0x17')](_0x1a57('0x54'),_0x1a57('0x46'));_0x3bf6dd[_0x1a57('0x47')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x227844['serverUrl'],_0x3bf6dd[_0x1a57('0x55')],md5(_0x3bf6dd[_0x1a57('0x55')]));}return getConnection(_0x227844)[_0x1a57('0x25')](function(_0x33ffe5){_0x103fbe=_0x33ffe5;return getUser(_0x227844,_0x5b0f86[_0x1a57('0x48')],_0x103fbe);})[_0x1a57('0x25')](function(_0x304b96){_0x31cb10=_0x304b96;logger[_0x1a57('0x17')]('The\x20User\x20ID\x20is:',_0x31cb10['id']);return getEndUser(_0x227844,_0x3bf6dd[_0x1a57('0x56')],_0x3bf6dd[_0x1a57('0x57')],_0x103fbe);})['then'](function(_0x5a7f54){_0x10ceb8=_0x5a7f54;logger[_0x1a57('0x17')]('The\x20Enduser\x20ID\x20is:',_0x10ceb8['id']);return createTicket(_0x227844,_0x31cb10,_0x10ceb8,_0x388740,_0x3bf6dd,_0x388740[_0x1a57('0x4b')],_0x103fbe);})[_0x1a57('0x25')](function(_0x28bf55){_0x3ddc7e=_0x28bf55;logger[_0x1a57('0x17')](_0x1a57('0x4c'));logger[_0x1a57('0x17')](_0x1a57('0x58'),_0x3ddc7e['id']);var _0x270331=util['format'](_0x1a57('0x4d'),_0x227844[_0x1a57('0x1f')],_['split'](_0x3ddc7e['id'],'x')[0x1]);logger[_0x1a57('0x17')](_0x1a57('0x54'),_0x1a57('0x4f'));emit(util['format']('user:%s',_0x5b0f86[_0x1a57('0x16')]),_0x1a57('0x50'),{'uri':_0x270331});})[_0x1a57('0x2b')](function(_0x26b8dc){logger['error'](_0x1a57('0x54'),JSON[_0x1a57('0x24')](_0x26b8dc));});};exports[_0x1a57('0x59')]=function(_0x246505,_0x277367,_0x58d8cc,_0x1595d9,_0x393187,_0x3dfe14){var _0x2fde6f,_0xd1e276,_0x69f3fb,_0x3c6fb4;_0x3dfe14[_0x1a57('0x1f')]=intUtil[_0x1a57('0x43')](_0x3dfe14[_0x1a57('0x1f')]);_0x3dfe14[_0x1a57('0x51')]=intUtil['stripTrailingSlash'](_0x3dfe14[_0x1a57('0x51')]);if(_0x393187&&_0x393187[_0x1a57('0x44')]){logger['info'](_0x1a57('0x5a'),_0x1a57('0x46'));_0x277367['recordingURL']=util[_0x1a57('0x1d')](_0x1a57('0x5b'),_0x3dfe14[_0x1a57('0x51')],_0x277367[_0x1a57('0x55')],md5(_0x277367[_0x1a57('0x55')]));}else{_0x277367[_0x1a57('0x47')]='';}return getConnection(_0x3dfe14)[_0x1a57('0x25')](function(_0x1484ab){_0x3c6fb4=_0x1484ab;return getUser(_0x3dfe14,'',_0x3c6fb4);})['then'](function(_0x190631){_0x2fde6f=_0x190631;logger[_0x1a57('0x17')]('The\x20User\x20ID\x20is:',_0x2fde6f['id']);return getEndUser(_0x3dfe14,_0x277367[_0x1a57('0x5c')],_0x277367[_0x1a57('0x5d')],_0x3c6fb4);})[_0x1a57('0x25')](function(_0x15e48d){_0xd1e276=_0x15e48d;logger[_0x1a57('0x17')](_0x1a57('0x4a'),_0xd1e276['id']);return createTicket(_0x3dfe14,_0x2fde6f,_0xd1e276,_0x58d8cc,_0x277367,_0x58d8cc[_0x1a57('0x4b')],_0x3c6fb4);})[_0x1a57('0x25')](function(_0x44969b){_0x69f3fb=_0x44969b;logger['info'](_0x1a57('0x4c'));logger[_0x1a57('0x17')](_0x1a57('0x58'),_0x69f3fb['id']);})[_0x1a57('0x2b')](function(_0x12ae08){logger['error'](_0x1a57('0x5a'),JSON[_0x1a57('0x24')](_0x12ae08));});}; \ No newline at end of file +var _0xbdb7=['recordingURL','destcalleridname','destcalleridnum','Ticket\x20created!','user:%s','abandoned','monitor_format','[ABANDONED]','lodash','request-promise','bluebird','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','redis','localhost','socket.io-emitter','length','forEach','type','string','idField','variable','variableName','toString','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','merge','getString','Subjects','Descriptions','POST','format','%s/webservice.php','create','username','sessionName','HelpDesk','stringify','error','catch','[vTiger],\x20%s,\x20%s,\x20%s','createTicket','validateEmail','Getting\x20agent\x20with\x20email','GET','remoteUri','query','then','success','result','resolve','first_name','userId','admin','statusCode','getUser','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','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\x20created.','phone','getEndUser','accessKey','getchallenge','login','token','Account\x20%d\x20is\x20not\x20valid','getConnection','[HTTP]','queue','stripTrailingSlash','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','email','The\x20User\x20ID\x20is:','calleridname','Fields','The\x20Ticket\x20ID\x20is:','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','[QUEUE]','outbound','recordingFormat','none','[OUTBOUND]'];(function(_0x1fa8ae,_0x1c3a78){var _0x449add=function(_0x315831){while(--_0x315831){_0x1fa8ae['push'](_0x1fa8ae['shift']());}};_0x449add(++_0x1c3a78);}(_0xbdb7,0x12e));var _0x7bdb=function(_0x47c038,_0x1f7096){_0x47c038=_0x47c038-0x0;var _0x1e0f88=_0xbdb7[_0x47c038];return _0x1e0f88;};'use strict';var _=require(_0x7bdb('0x0'));var rp=require(_0x7bdb('0x1'));var BPromise=require(_0x7bdb('0x2'));var md5=require(_0x7bdb('0x3'));var util=require(_0x7bdb('0x4'));var Redis=require(_0x7bdb('0x5'));var intUtil=require(_0x7bdb('0x6'));var config=require(_0x7bdb('0x7'));var logger=require(_0x7bdb('0x8'))('vTiger');config[_0x7bdb('0x9')]=_['defaults'](config['redis'],{'host':_0x7bdb('0xa'),'port':0x18eb});var io=require(_0x7bdb('0xb'))(new Redis(config['redis']));function emit(_0x513cba,_0x468041,_0x11a877){io['to'](_0x513cba)['emit'](_0x468041,_0x11a877);}function getCustomFields(_0x4a3116,_0xdc2ffc){var _0x1a6b61={};if(_0x4a3116[_0x7bdb('0xc')]>0x0){_[_0x7bdb('0xd')](_0x4a3116,function(_0x27297d){if(_0x27297d[_0x7bdb('0xe')]===_0x7bdb('0xf')&&_0x27297d[_0x7bdb('0x10')]){_0x1a6b61[_0x27297d['idField']]=_0x27297d['content']['toString']();}else if(_0x27297d[_0x7bdb('0xe')]===_0x7bdb('0x11')&&_0x27297d['variableName']&&_0x27297d[_0x7bdb('0x10')]&&_0xdc2ffc[_0x27297d['variableName']]){_0x1a6b61[_0x27297d['idField']]=_0xdc2ffc[_0x27297d[_0x7bdb('0x12')]][_0x7bdb('0x13')]();}else if(_0x27297d['type']==='customVariable'&&_0x27297d['Variable']&&_0x27297d[_0x7bdb('0x14')][_0x7bdb('0x15')]&&_0x27297d[_0x7bdb('0x10')]&&_0xdc2ffc[_0x27297d[_0x7bdb('0x14')][_0x7bdb('0x15')][_0x7bdb('0x16')]()]){_0x1a6b61[_0x27297d[_0x7bdb('0x10')]]=_0xdc2ffc[_0x27297d[_0x7bdb('0x14')]['name'][_0x7bdb('0x16')]()][_0x7bdb('0x13')]();}});}return _0x1a6b61;}function createTicket(_0x5723f4,_0x2aff6a,_0x4ffd4b,_0x41f540,_0x23e9eb,_0x5b8481,_0x3e5f8e){logger[_0x7bdb('0x17')](_0x7bdb('0x18'));var _0x45d552=_[_0x7bdb('0x19')]({'parent_id':'','assigned_user_id':_0x2aff6a['id'],'ticketpriorities':'Normal','ticketstatus':'Open','ticket_title':intUtil[_0x7bdb('0x1a')](_0x41f540[_0x7bdb('0x1b')],_0x23e9eb,'\x20'),'description':intUtil['getString'](_0x41f540[_0x7bdb('0x1c')],_0x23e9eb,'\x0a'),'contact_id':_0x4ffd4b['id']},getCustomFields(_0x5b8481,_0x23e9eb));var _0x118ea1={'method':_0x7bdb('0x1d'),'uri':util[_0x7bdb('0x1e')](_0x7bdb('0x1f'),_0x5723f4['remoteUri']),'form':{'operation':_0x7bdb('0x20'),'username':_0x5723f4[_0x7bdb('0x21')],'sessionName':_0x3e5f8e[_0x7bdb('0x22')],'elementType':_0x7bdb('0x23'),'element':JSON['stringify'](_0x45d552)},'json':!![]};return request(_0x118ea1)['then'](function(_0x3c423f){if(_0x3c423f['success']){return BPromise['resolve']({'id':_0x3c423f['result']['id']});}else{throw new Error(util[_0x7bdb('0x1e')]('Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s',JSON[_0x7bdb('0x24')](_0x3c423f[_0x7bdb('0x25')])));}})[_0x7bdb('0x26')](function(_0x7c09cf){var _0x2a494e=_0x7c09cf['statusCode']||0x1f4;logger[_0x7bdb('0x25')](_0x7bdb('0x27'),_0x7bdb('0x28'),_0x2a494e,JSON[_0x7bdb('0x24')](_0x7c09cf));});}function getUser(_0x371e8a,_0x2e8e65,_0x1e9996){if(intUtil[_0x7bdb('0x29')](_0x2e8e65)){logger[_0x7bdb('0x17')](_0x7bdb('0x2a'),_0x2e8e65);return request({'method':_0x7bdb('0x2b'),'uri':util[_0x7bdb('0x1e')]('%s/webservice.php',_0x371e8a[_0x7bdb('0x2c')]),'qs':{'operation':_0x7bdb('0x2d'),'username':_0x371e8a[_0x7bdb('0x21')],'sessionName':_0x1e9996[_0x7bdb('0x22')],'query':util[_0x7bdb('0x1e')]('SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;',_0x2e8e65)},'json':!![]})[_0x7bdb('0x2e')](function(_0x43054c){if(_0x43054c[_0x7bdb('0x2f')]&&_0x43054c[_0x7bdb('0x30')]['length']){logger['info']('Agent\x20found!');return BPromise[_0x7bdb('0x31')]({'id':_0x43054c['result'][0x0]['id'],'email':_0x43054c[_0x7bdb('0x30')][0x0]['email1'],'name':_0x43054c[_0x7bdb('0x30')][0x0][_0x7bdb('0x32')]+'\x20'+_0x43054c[_0x7bdb('0x30')]['last_name']});}else{logger[_0x7bdb('0x17')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise['resolve']({'id':_0x1e9996[_0x7bdb('0x33')],'email':_0x371e8a['username'],'name':_0x7bdb('0x34')});}})['catch'](function(_0x5ee47d){var _0x206c26=_0x5ee47d[_0x7bdb('0x35')]||0x1f4;logger[_0x7bdb('0x25')](_0x7bdb('0x27'),_0x7bdb('0x36'),_0x206c26,JSON[_0x7bdb('0x24')](_0x5ee47d));});}else{logger['info'](_0x7bdb('0x37'));return BPromise[_0x7bdb('0x31')]({'id':_0x1e9996[_0x7bdb('0x33')],'email':_0x371e8a[_0x7bdb('0x21')],'name':_0x7bdb('0x34')})[_0x7bdb('0x26')](function(_0x228340){var _0x2587af=_0x228340[_0x7bdb('0x35')]||0x1f4;logger['error']('[vTiger],\x20%s,\x20%s,\x20%s',_0x7bdb('0x36'),_0x2587af,JSON[_0x7bdb('0x24')](_0x228340));});}}function getEndUser(_0x2de3c1,_0x395699,_0x3732b2,_0x509e90){logger['info'](_0x7bdb('0x38'),_0x3732b2);return request({'method':'GET','uri':util[_0x7bdb('0x1e')]('%s/webservice.php',_0x2de3c1[_0x7bdb('0x2c')]),'qs':{'operation':'query','username':_0x2de3c1['username'],'sessionName':_0x509e90[_0x7bdb('0x22')],'query':util[_0x7bdb('0x1e')](_0x7bdb('0x39'),_0x3732b2,_0x3732b2,_0x3732b2,_0x3732b2,_0x3732b2)},'json':!![]})[_0x7bdb('0x2e')](function(_0x43c7d3){if(_0x43c7d3[_0x7bdb('0x2f')]&&_0x43c7d3[_0x7bdb('0x30')]['length']){logger['info'](_0x7bdb('0x3a'));return BPromise[_0x7bdb('0x31')]({'id':_0x43c7d3[_0x7bdb('0x30')][0x0]['id'],'name':_0x43c7d3[_0x7bdb('0x30')][0x0][_0x7bdb('0x3b')]+'\x20'+_0x43c7d3[_0x7bdb('0x30')][0x0][_0x7bdb('0x3c')],'phone':_0x3732b2});}else{logger['info']('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'method':_0x7bdb('0x1d'),'uri':util[_0x7bdb('0x1e')](_0x7bdb('0x1f'),_0x2de3c1[_0x7bdb('0x2c')]),'form':{'operation':'create','sessionName':_0x509e90[_0x7bdb('0x22')],'elementType':'Contacts','element':JSON[_0x7bdb('0x24')]({'lastname':_0x395699,'phone':_0x3732b2,'assigned_user_id':'\x20'})},'json':!![]})[_0x7bdb('0x2e')](function(_0x218361){logger[_0x7bdb('0x17')](_0x7bdb('0x3d'));return BPromise[_0x7bdb('0x31')]({'id':_0x218361[_0x7bdb('0x30')]['id'],'name':_0x218361[_0x7bdb('0x30')][_0x7bdb('0x3c')],'phone':_0x218361['result'][_0x7bdb('0x3e')]});})[_0x7bdb('0x26')](function(_0x4fd63c){var _0x7c784=_0x4fd63c['statusCode']||0x1f4;logger[_0x7bdb('0x25')](_0x7bdb('0x27'),_0x7bdb('0x3f'),_0x7c784,JSON[_0x7bdb('0x24')](_0x4fd63c));});}});}function getConnection(_0x2d979f){var _0x5a25f5=_0x2d979f[_0x7bdb('0x21')];var _0x2e10a6=_0x2d979f[_0x7bdb('0x40')];return request({'method':_0x7bdb('0x2b'),'uri':util[_0x7bdb('0x1e')]('%s/webservice.php',_0x2d979f[_0x7bdb('0x2c')]),'qs':{'operation':_0x7bdb('0x41'),'username':_0x5a25f5},'json':!![]})[_0x7bdb('0x2e')](function(_0xb26a9){if(_0xb26a9[_0x7bdb('0x2f')]){return request({'method':_0x7bdb('0x1d'),'uri':util[_0x7bdb('0x1e')](_0x7bdb('0x1f'),_0x2d979f[_0x7bdb('0x2c')]),'form':{'operation':_0x7bdb('0x42'),'username':_0x5a25f5,'accessKey':md5(_0xb26a9['result'][_0x7bdb('0x43')]+_0x2e10a6)},'json':!![]});}})['then'](function(_0x47cccd){if(_0x47cccd[_0x7bdb('0x2f')]){return BPromise[_0x7bdb('0x31')](_0x47cccd['result']);}else{throw new Error(util[_0x7bdb('0x1e')](_0x7bdb('0x44'),_0x2d979f['id']));}})['catch'](function(_0x54ac12){var _0x4edd0d=_0x54ac12[_0x7bdb('0x35')]||0x1f4;logger[_0x7bdb('0x25')](_0x7bdb('0x27'),_0x7bdb('0x45'),_0x4edd0d,JSON[_0x7bdb('0x24')](_0x54ac12));});}function request(_0x24b7b8){logger[_0x7bdb('0x17')](_0x7bdb('0x46'),JSON[_0x7bdb('0x24')](_0x24b7b8));return rp(_0x24b7b8);}exports[_0x7bdb('0x47')]=function(_0x5a8d4a,_0x299ef0,_0x4806e0,_0x240425,_0x27358d,_0x5d564d){var _0x457886,_0x493d23,_0x258f29,_0x5c79a8;_0x5d564d['remoteUri']=intUtil[_0x7bdb('0x48')](_0x5d564d[_0x7bdb('0x2c')]);if(_0x27358d&&_0x27358d['monitor_format']){logger['info']('[QUEUE]',_0x7bdb('0x49'));_0x299ef0['recordingURL']=util['format'](_0x7bdb('0x4a'),_0x5d564d[_0x7bdb('0x4b')],_0x299ef0[_0x7bdb('0x4c')],md5(_0x299ef0[_0x7bdb('0x4c')]));}else{_0x299ef0['recordingURL']='';}return getConnection(_0x5d564d)[_0x7bdb('0x2e')](function(_0x4c5c8c){_0x5c79a8=_0x4c5c8c;return getUser(_0x5d564d,_0x240425[_0x7bdb('0x4d')],_0x5c79a8);})[_0x7bdb('0x2e')](function(_0x82f990){_0x457886=_0x82f990;logger[_0x7bdb('0x17')](_0x7bdb('0x4e'),_0x457886['id']);return getEndUser(_0x5d564d,_0x299ef0[_0x7bdb('0x4f')],_0x299ef0['calleridnum'],_0x5c79a8);})[_0x7bdb('0x2e')](function(_0x3022ee){_0x493d23=_0x3022ee;logger[_0x7bdb('0x17')]('The\x20Enduser\x20ID\x20is:',_0x493d23['id']);return createTicket(_0x5d564d,_0x457886,_0x493d23,_0x4806e0,_0x299ef0,_0x4806e0[_0x7bdb('0x50')],_0x5c79a8);})[_0x7bdb('0x2e')](function(_0x4d813f){_0x258f29=_0x4d813f;logger[_0x7bdb('0x17')]('Ticket\x20created!');logger[_0x7bdb('0x17')](_0x7bdb('0x51'),_0x258f29['id']);var _0x4f3f8c=util['format'](_0x7bdb('0x52'),_0x5d564d[_0x7bdb('0x2c')],_['split'](_0x258f29['id'],'x')[0x1]);logger[_0x7bdb('0x17')]('[QUEUE]',_0x7bdb('0x53'));emit(util['format']('user:%s',_0x240425[_0x7bdb('0x15')]),_0x7bdb('0x54'),{'uri':_0x4f3f8c});})[_0x7bdb('0x26')](function(_0x26f1f5){logger[_0x7bdb('0x25')](_0x7bdb('0x55'),JSON[_0x7bdb('0x24')](_0x26f1f5));});};exports[_0x7bdb('0x56')]=function(_0x3aac96,_0x19f99f,_0x414ac7,_0x3f786c,_0x4b9970,_0x3e0a08,_0x2d6234){var _0x52cf54,_0x288aa8,_0x1a0f36,_0x465fa7;_0x3e0a08[_0x7bdb('0x2c')]=intUtil[_0x7bdb('0x48')](_0x3e0a08['remoteUri']);_0x3e0a08[_0x7bdb('0x4b')]=intUtil[_0x7bdb('0x48')](_0x3e0a08[_0x7bdb('0x4b')]);if(_0x2d6234&&_0x2d6234['recordingFormat']&&_0x2d6234[_0x7bdb('0x57')]!==_0x7bdb('0x58')){logger[_0x7bdb('0x17')](_0x7bdb('0x59'),_0x7bdb('0x49'));_0x19f99f[_0x7bdb('0x5a')]=util[_0x7bdb('0x1e')](_0x7bdb('0x4a'),_0x3e0a08[_0x7bdb('0x4b')],_0x19f99f['uniqueid'],md5(_0x19f99f[_0x7bdb('0x4c')]));}return getConnection(_0x3e0a08)[_0x7bdb('0x2e')](function(_0x1cf8b1){_0x465fa7=_0x1cf8b1;return getUser(_0x3e0a08,_0x3f786c[_0x7bdb('0x4d')],_0x465fa7);})[_0x7bdb('0x2e')](function(_0xc83f14){_0x52cf54=_0xc83f14;logger[_0x7bdb('0x17')](_0x7bdb('0x4e'),_0x52cf54['id']);return getEndUser(_0x3e0a08,_0x19f99f[_0x7bdb('0x5b')],_0x19f99f[_0x7bdb('0x5c')],_0x465fa7);})[_0x7bdb('0x2e')](function(_0x3dbcc8){_0x288aa8=_0x3dbcc8;logger[_0x7bdb('0x17')]('The\x20Enduser\x20ID\x20is:',_0x288aa8['id']);return createTicket(_0x3e0a08,_0x52cf54,_0x288aa8,_0x414ac7,_0x19f99f,_0x414ac7[_0x7bdb('0x50')],_0x465fa7);})['then'](function(_0x1ca2e0){_0x1a0f36=_0x1ca2e0;logger[_0x7bdb('0x17')](_0x7bdb('0x5d'));logger['info'](_0x7bdb('0x51'),_0x1a0f36['id']);var _0x2a5e6c=util['format'](_0x7bdb('0x52'),_0x3e0a08[_0x7bdb('0x2c')],_['split'](_0x1a0f36['id'],'x')[0x1]);logger[_0x7bdb('0x17')](_0x7bdb('0x59'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x7bdb('0x1e')](_0x7bdb('0x5e'),_0x3f786c['name']),_0x7bdb('0x54'),{'uri':_0x2a5e6c});})[_0x7bdb('0x26')](function(_0x5cfbfb){logger[_0x7bdb('0x25')]('[OUTBOUND]',JSON[_0x7bdb('0x24')](_0x5cfbfb));});};exports[_0x7bdb('0x5f')]=function(_0x2ff95c,_0x21dd9a,_0x1e5063,_0x5d793e,_0x590818,_0x500c88){var _0x2a795f,_0x484de6,_0x242a35,_0x1a1979;_0x500c88[_0x7bdb('0x2c')]=intUtil['stripTrailingSlash'](_0x500c88['remoteUri']);_0x500c88[_0x7bdb('0x4b')]=intUtil[_0x7bdb('0x48')](_0x500c88[_0x7bdb('0x4b')]);if(_0x590818&&_0x590818[_0x7bdb('0x60')]){logger['info'](_0x7bdb('0x61'),_0x7bdb('0x49'));_0x21dd9a[_0x7bdb('0x5a')]=util[_0x7bdb('0x1e')](_0x7bdb('0x4a'),_0x500c88[_0x7bdb('0x4b')],_0x21dd9a['uniqueid'],md5(_0x21dd9a[_0x7bdb('0x4c')]));}else{_0x21dd9a['recordingURL']='';}return getConnection(_0x500c88)[_0x7bdb('0x2e')](function(_0x569d65){_0x1a1979=_0x569d65;return getUser(_0x500c88,'',_0x1a1979);})[_0x7bdb('0x2e')](function(_0x3725a2){_0x2a795f=_0x3725a2;logger[_0x7bdb('0x17')](_0x7bdb('0x4e'),_0x2a795f['id']);return getEndUser(_0x500c88,_0x21dd9a[_0x7bdb('0x4f')],_0x21dd9a['calleridnum'],_0x1a1979);})['then'](function(_0x8cc283){_0x484de6=_0x8cc283;logger[_0x7bdb('0x17')]('The\x20Enduser\x20ID\x20is:',_0x484de6['id']);return createTicket(_0x500c88,_0x2a795f,_0x484de6,_0x1e5063,_0x21dd9a,_0x1e5063[_0x7bdb('0x50')],_0x1a1979);})[_0x7bdb('0x2e')](function(_0x5a674b){_0x242a35=_0x5a674b;logger[_0x7bdb('0x17')](_0x7bdb('0x5d'));logger['info'](_0x7bdb('0x51'),_0x242a35['id']);})['catch'](function(_0x4d1a90){logger[_0x7bdb('0x25')](_0x7bdb('0x61'),JSON['stringify'](_0x4d1a90));});}; \ 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 77b771c..9bba9bc 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 _0xfb92=['find','results','agent','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','user','type:user\x20role:end-user\x20phone:%s','length','filter','end-user','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','Caller\x20-\x20%s','Enduser\x20created.','password','%s:%s','username','authType','%s/token:%s','token','toString','base64','debug','[HTTP]','stringify','GET','map','forEach','nameField','customField','toLowerCase','content','type','string','custom_fields','push','variable','variableName','idField','Variable','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','Authorization','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','integrationTab','%s/channels/voice/agents/%d/tickets/%d/display.json','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','%s/agent/tickets/%s','error','Zendesk\x20account\x20type\x20not\x20recognized','catch','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','outbound','recordingFormat','destcalleridname','[OUTBOUND]','user:%s','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','inspect','abandoned','[ABANDONED]\x20Error\x20running\x20Zendesk\x20integration','lodash','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','zendesk','redis','defaults','localhost','emit','info','remoteUri','POST','merge','Tags','name','getString','Subjects','Descriptions','Fields','then','format','%s/search.json','type:user\x20role:agent\x20email:%s','count'];(function(_0x3454e5,_0x62084b){var _0x2c92b5=function(_0x4acd24){while(--_0x4acd24){_0x3454e5['push'](_0x3454e5['shift']());}};_0x2c92b5(++_0x62084b);}(_0xfb92,0x1e3));var _0x2fb9=function(_0x4b796b,_0x10e746){_0x4b796b=_0x4b796b-0x0;var _0x22f2f6=_0xfb92[_0x4b796b];return _0x22f2f6;};'use strict';var _=require(_0x2fb9('0x0'));var rp=require('request-promise');var md5=require(_0x2fb9('0x1'));var util=require(_0x2fb9('0x2'));var Redis=require(_0x2fb9('0x3'));var intUtil=require(_0x2fb9('0x4'));var config=require(_0x2fb9('0x5'));var logger=require(_0x2fb9('0x6'))(_0x2fb9('0x7'));config[_0x2fb9('0x8')]=_[_0x2fb9('0x9')](config[_0x2fb9('0x8')],{'host':_0x2fb9('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function emit(_0x5399f7,_0x21a33b,_0x24651f){io['to'](_0x5399f7)[_0x2fb9('0xb')](_0x21a33b,_0x24651f);}var headers={'Content-Type':'application/json','Accept':'application/json'};function getTicket(_0x44c896,_0x1773f9,_0x2eb82c,_0x32b8e4,_0x48b755){logger[_0x2fb9('0xc')]('Creating\x20new\x20ticket...');return request({'uri':util['format']('%s/tickets.json',_0x44c896[_0x2fb9('0xd')]),'method':_0x2fb9('0xe'),'body':{'ticket':_[_0x2fb9('0xf')]({'requester_id':_0x2eb82c['id'],'submitter_id':_0x1773f9?_0x1773f9['id']:undefined,'assignee_id':_0x1773f9?_0x1773f9['id']:undefined,'tags':getTags(_0x32b8e4[_0x2fb9('0x10')],_0x2fb9('0x11')),'subject':intUtil[_0x2fb9('0x12')](_0x32b8e4[_0x2fb9('0x13')],_0x48b755,'\x20'),'description':intUtil[_0x2fb9('0x12')](_0x32b8e4[_0x2fb9('0x14')],_0x48b755,'\x0a'),'comment':{'public':![],'body':intUtil['getString'](_0x32b8e4[_0x2fb9('0x14')],_0x48b755,'\x0a')}},getCustomFields(_0x32b8e4[_0x2fb9('0x15')],_0x48b755))}})[_0x2fb9('0x16')](function(_0x49cc5a){logger[_0x2fb9('0xc')]('Ticket\x20created!');return _0x49cc5a['ticket'];});}function getUser(_0x4f0aa3,_0x15202b){if(intUtil['validateEmail'](_0x15202b)){logger['info']('Getting\x20agent\x20with\x20email',_0x15202b);return request({'uri':util[_0x2fb9('0x17')](_0x2fb9('0x18'),_0x4f0aa3[_0x2fb9('0xd')]),'qs':{'query':util[_0x2fb9('0x17')](_0x2fb9('0x19'),_0x15202b)}})[_0x2fb9('0x16')](function(_0x12caa9){if(_0x12caa9[_0x2fb9('0x1a')]){logger[_0x2fb9('0xc')]('Agent\x20found!');return _[_0x2fb9('0x1b')](_0x12caa9[_0x2fb9('0x1c')],{'email':_0x15202b,'role':_0x2fb9('0x1d')});}else{logger[_0x2fb9('0xc')](_0x2fb9('0x1e'));return request({'uri':util[_0x2fb9('0x17')](_0x2fb9('0x1f'),_0x4f0aa3[_0x2fb9('0xd')])})[_0x2fb9('0x16')](function(_0x1340db){logger[_0x2fb9('0xc')]('Admin\x20account\x20selected.');return _0x1340db[_0x2fb9('0x20')];});}});}else{logger[_0x2fb9('0xc')](_0x2fb9('0x1e'));return request({'uri':util[_0x2fb9('0x17')](_0x2fb9('0x1f'),_0x4f0aa3[_0x2fb9('0xd')])})[_0x2fb9('0x16')](function(_0x395f33){logger[_0x2fb9('0xc')]('Admin\x20account\x20selected.');return _0x395f33[_0x2fb9('0x20')];});}}function getEndUser(_0x20899e,_0x56f68e,_0x1ff8d7){logger[_0x2fb9('0xc')]('Searching\x20enduser\x20with\x20phone',_0x1ff8d7);return request({'uri':util[_0x2fb9('0x17')](_0x2fb9('0x18'),_0x20899e[_0x2fb9('0xd')]),'qs':{'query':util[_0x2fb9('0x17')](_0x2fb9('0x21'),_0x1ff8d7)}})['then'](function(_0x5b4597){var _0x5f42c3;if(_0x5b4597[_0x2fb9('0x1c')][_0x2fb9('0x22')]){_0x5b4597['results']=_[_0x2fb9('0x23')](_0x5b4597[_0x2fb9('0x1c')],{'suspended':![],'role':_0x2fb9('0x24')});if(_0x5b4597[_0x2fb9('0x1c')]['length']){_0x5f42c3=_['first'](_0x5b4597['results']);}}if(_0x5f42c3){logger['info']('Enduser\x20found!');return _0x5f42c3;}else{logger['info'](_0x2fb9('0x25'));return request({'uri':util[_0x2fb9('0x17')](_0x2fb9('0x26'),_0x20899e['remoteUri']),'method':'POST','body':{'user':{'role':_0x2fb9('0x24'),'name':util[_0x2fb9('0x17')](_0x2fb9('0x27'),_0x56f68e||_0x1ff8d7),'phone':_0x1ff8d7}}})[_0x2fb9('0x16')](function(_0x557aac){logger['info'](_0x2fb9('0x28'));return _0x557aac['user'];});}});}function getAuth(_0x560cce){var _0x17cad3;if(_0x560cce['authType']===_0x2fb9('0x29')){_0x17cad3=util[_0x2fb9('0x17')](_0x2fb9('0x2a'),_0x560cce[_0x2fb9('0x2b')],_0x560cce[_0x2fb9('0x29')]);}else if(_0x560cce[_0x2fb9('0x2c')]==='token'){_0x17cad3=util[_0x2fb9('0x17')](_0x2fb9('0x2d'),_0x560cce[_0x2fb9('0x2b')],_0x560cce[_0x2fb9('0x2e')]);}return util['format']('Basic\x20%s',new Buffer(_0x17cad3)[_0x2fb9('0x2f')](_0x2fb9('0x30')));}function request(_0x23a169){logger[_0x2fb9('0x31')](_0x2fb9('0x32'),JSON[_0x2fb9('0x33')](_0x23a169));return rp(_[_0x2fb9('0x9')](_0x23a169,{'method':_0x2fb9('0x34'),'headers':headers,'json':!![]}));}function getTags(_0x145579,_0x5e4a34){var _0x340a47=[];if(_0x145579&&_0x145579[_0x2fb9('0x22')]>0x0){_0x340a47=_[_0x2fb9('0x35')](_0x145579,_0x5e4a34);}return _0x340a47;}function getCustomFields(_0x185a0c,_0x28b500){var _0x58da3c=[];var _0x3de049={'custom_fields':[]};if(_0x185a0c[_0x2fb9('0x22')]>0x0){_[_0x2fb9('0x36')](_0x185a0c,function(_0x484d5f){if(_0x484d5f['type']==='string'&&_0x484d5f[_0x2fb9('0x37')]&&!_0x484d5f[_0x2fb9('0x38')]){_0x3de049[_0x484d5f[_0x2fb9('0x37')][_0x2fb9('0x39')]()]=_0x484d5f[_0x2fb9('0x3a')]['toString']();}else if(_0x484d5f[_0x2fb9('0x3b')]===_0x2fb9('0x3c')&&_0x484d5f['idField']&&_0x484d5f[_0x2fb9('0x38')]){_0x3de049[_0x2fb9('0x3d')][_0x2fb9('0x3e')]({'id':_0x484d5f['idField'],'value':_0x484d5f[_0x2fb9('0x3a')]['toString']()});}else if(_0x484d5f[_0x2fb9('0x3b')]===_0x2fb9('0x3f')&&_0x484d5f[_0x2fb9('0x40')]&&_0x484d5f[_0x2fb9('0x41')]&&_0x484d5f[_0x2fb9('0x38')]){_0x28b500[_0x484d5f['variableName']]&&_0x3de049[_0x2fb9('0x3d')][_0x2fb9('0x3e')]({'id':_0x484d5f[_0x2fb9('0x41')],'value':_0x28b500[_0x484d5f[_0x2fb9('0x40')]]['toString']()});}else if(_0x484d5f[_0x2fb9('0x3b')]==='customVariable'&&_0x484d5f[_0x2fb9('0x42')]&&_0x484d5f[_0x2fb9('0x42')][_0x2fb9('0x11')]&&_0x484d5f[_0x2fb9('0x41')]&&_0x484d5f['customField']){_0x28b500[_0x484d5f['Variable']['name'][_0x2fb9('0x39')]()]&&_0x3de049['custom_fields'][_0x2fb9('0x3e')]({'id':_0x484d5f['idField'],'value':_0x28b500[_0x484d5f[_0x2fb9('0x42')][_0x2fb9('0x11')][_0x2fb9('0x39')]()][_0x2fb9('0x2f')]()});}});}return _0x3de049;}exports[_0x2fb9('0x43')]=function(_0x4775a7,_0x2c2fab,_0x257cdd,_0x3c2ccd,_0x41f89e,_0x46aa5e){var _0x46727e,_0x51b153;_0x46aa5e[_0x2fb9('0xd')]=intUtil[_0x2fb9('0x44')](_0x46aa5e[_0x2fb9('0xd')]);_0x46aa5e[_0x2fb9('0x45')]=intUtil[_0x2fb9('0x44')](_0x46aa5e['serverUrl']);if(_0x41f89e&&_0x41f89e[_0x2fb9('0x46')]){logger['info'](_0x2fb9('0x47'),_0x2fb9('0x48'));_0x2c2fab['recordingURL']=util['format'](_0x2fb9('0x49'),_0x46aa5e['serverUrl'],_0x2c2fab[_0x2fb9('0x4a')],md5(_0x2c2fab[_0x2fb9('0x4a')]));}else{_0x2c2fab[_0x2fb9('0x4b')]='';}headers[_0x2fb9('0x4c')]=getAuth(_0x46aa5e);return getUser(_0x46aa5e,_0x3c2ccd[_0x2fb9('0x4d')])[_0x2fb9('0x16')](function(_0x37c446){_0x46727e=_0x37c446;logger['info'](_0x2fb9('0x4e'),_0x46727e['id']);return getEndUser(_0x46aa5e,_0x2c2fab[_0x2fb9('0x4f')],_0x2c2fab[_0x2fb9('0x50')]);})[_0x2fb9('0x16')](function(_0x24147e){_0x51b153=_0x24147e;logger[_0x2fb9('0xc')](_0x2fb9('0x51'),_0x51b153['id']);return getTicket(_0x46aa5e,_0x46727e,_0x51b153,_0x257cdd,_0x2c2fab);})[_0x2fb9('0x16')](function(_0x30f4df){if(_0x30f4df){logger[_0x2fb9('0xc')](_0x2fb9('0x52'),_0x30f4df['id']);switch(_0x46aa5e['type']){case _0x2fb9('0x53'):logger[_0x2fb9('0xc')](_0x2fb9('0x47'),'Displaying\x20ticket\x20to\x20agent...');return request({'uri':util[_0x2fb9('0x17')](_0x2fb9('0x54'),_0x46aa5e[_0x2fb9('0xd')],_0x46727e['id'],_0x30f4df['id']),'method':_0x2fb9('0xe')});case _0x2fb9('0x55'):logger[_0x2fb9('0xc')]('[QUEUE]',_0x2fb9('0x56'));emit(util[_0x2fb9('0x17')]('user:%s',_0x3c2ccd['name']),_0x2fb9('0x57'),{'uri':util[_0x2fb9('0x17')](_0x2fb9('0x58'),_0x46aa5e[_0x2fb9('0xd')],_0x30f4df['id'])});break;default:logger[_0x2fb9('0x59')](_0x2fb9('0x47'),_0x2fb9('0x5a'));}}})[_0x2fb9('0x5b')](function(_0x25ab33){logger['error'](_0x2fb9('0x5c'),util['inspect'](_0x25ab33,{'showHidden':!![],'depth':null}));});};exports[_0x2fb9('0x5d')]=function(_0x26b652,_0x188b3b,_0x423b75,_0x3b0d94,_0x130ff1,_0x1067bb,_0x55bc42){var _0x25072c,_0x12df93;_0x1067bb[_0x2fb9('0xd')]=intUtil[_0x2fb9('0x44')](_0x1067bb['remoteUri']);_0x1067bb[_0x2fb9('0x45')]=intUtil[_0x2fb9('0x44')](_0x1067bb[_0x2fb9('0x45')]);if(_0x55bc42&&_0x55bc42[_0x2fb9('0x5e')]&&_0x55bc42[_0x2fb9('0x5e')]!=='none'){logger[_0x2fb9('0xc')]('[OUTBOUND]','Recording\x20is\x20enabled!');_0x188b3b[_0x2fb9('0x4b')]=util[_0x2fb9('0x17')](_0x2fb9('0x49'),_0x1067bb['serverUrl'],_0x188b3b[_0x2fb9('0x4a')],md5(_0x188b3b[_0x2fb9('0x4a')]));}headers[_0x2fb9('0x4c')]=getAuth(_0x1067bb);return getUser(_0x1067bb,_0x3b0d94['email'])['then'](function(_0xbc8f13){_0x25072c=_0xbc8f13;logger[_0x2fb9('0xc')]('The\x20User\x20ID\x20is:',_0x25072c['id']);return getEndUser(_0x1067bb,_0x188b3b[_0x2fb9('0x5f')],_0x188b3b['destcalleridnum']);})[_0x2fb9('0x16')](function(_0xb57089){_0x12df93=_0xb57089;logger[_0x2fb9('0xc')]('The\x20Enduser\x20ID\x20is:',_0x12df93['id']);return getTicket(_0x1067bb,_0x25072c,_0x12df93,_0x423b75,_0x188b3b);})[_0x2fb9('0x16')](function(_0x11e71a){if(_0x11e71a){logger[_0x2fb9('0xc')](_0x2fb9('0x52'),_0x11e71a['id']);switch(_0x1067bb[_0x2fb9('0x3b')]){case _0x2fb9('0x53'):logger['info'](_0x2fb9('0x60'),'Displaying\x20ticket\x20to\x20agent...');return request({'uri':util[_0x2fb9('0x17')](_0x2fb9('0x54'),_0x1067bb['remoteUri'],_0x25072c['id'],_0x11e71a['id']),'method':_0x2fb9('0xe')});case _0x2fb9('0x55'):logger[_0x2fb9('0xc')](_0x2fb9('0x60'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x2fb9('0x17')](_0x2fb9('0x61'),_0x3b0d94[_0x2fb9('0x11')]),_0x2fb9('0x57'),{'uri':util['format'](_0x2fb9('0x58'),_0x1067bb[_0x2fb9('0xd')],_0x11e71a['id'])});break;default:logger[_0x2fb9('0x59')]('[OUTBOUND]',_0x2fb9('0x5a'));}}})[_0x2fb9('0x5b')](function(_0x802f8){logger[_0x2fb9('0x59')](_0x2fb9('0x62'),util[_0x2fb9('0x63')](_0x802f8,{'showHidden':!![],'depth':null}));});};exports[_0x2fb9('0x64')]=function(_0x3272be,_0x1f36bf,_0x4ac274,_0xb4fb3b,_0x51936d,_0x550adc){var _0x31c45e,_0x269198;_0x550adc['remoteUri']=intUtil[_0x2fb9('0x44')](_0x550adc['remoteUri']);_0x550adc[_0x2fb9('0x45')]=intUtil[_0x2fb9('0x44')](_0x550adc[_0x2fb9('0x45')]);if(_0x51936d&&_0x51936d['monitor_format']){logger[_0x2fb9('0xc')]('[ABANDONED]',_0x2fb9('0x48'));_0x1f36bf['recordingURL']=util[_0x2fb9('0x17')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x550adc[_0x2fb9('0x45')],_0x1f36bf[_0x2fb9('0x4a')],md5(_0x1f36bf[_0x2fb9('0x4a')]));}else{_0x1f36bf[_0x2fb9('0x4b')]='';}headers['Authorization']=getAuth(_0x550adc);return getUser(_0x550adc)['then'](function(_0x2376eb){_0x31c45e=_0x2376eb;logger['info'](_0x2fb9('0x4e'),_0x31c45e['id']);return getEndUser(_0x550adc,_0x1f36bf[_0x2fb9('0x4f')],_0x1f36bf['calleridnum']);})[_0x2fb9('0x16')](function(_0x606a49){_0x269198=_0x606a49;logger[_0x2fb9('0xc')]('The\x20Enduser\x20ID\x20is:',_0x269198['id']);return getTicket(_0x550adc,_0x31c45e,_0x269198,_0x4ac274,_0x1f36bf);})[_0x2fb9('0x16')](function(_0x2d5e22){if(_0x2d5e22){logger[_0x2fb9('0xc')](_0x2fb9('0x52'),_0x2d5e22['id']);}})[_0x2fb9('0x5b')](function(_0x104e75){logger[_0x2fb9('0x59')](_0x2fb9('0x65'),util['inspect'](_0x104e75,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x1af3=['localhost','socket.io-emitter','emit','application/json','info','Creating\x20new\x20ticket...','%s/tickets.json','remoteUri','POST','merge','Tags','getString','Subjects','Descriptions','Fields','then','Ticket\x20created!','ticket','validateEmail','Getting\x20agent\x20with\x20email','format','%s/search.json','type:user\x20role:agent\x20email:%s','count','Agent\x20found!','find','results','agent','%s/users/me.json','Admin\x20account\x20selected.','user','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','type:user\x20role:end-user\x20phone:%s','filter','end-user','length','first','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','Caller\x20-\x20%s','Enduser\x20created.','password','%s:%s','username','authType','token','Basic\x20%s','toString','base64','defaults','GET','map','forEach','type','string','nameField','customField','toLowerCase','idField','custom_fields','push','content','variable','variableName','customVariable','Variable','name','queue','stripTrailingSlash','serverUrl','monitor_format','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','integrationTab','[QUEUE]','Displaying\x20ticket\x20to\x20agent...','%s/channels/voice/agents/%d/tickets/%d/display.json','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/agent/tickets/%s','error','Zendesk\x20account\x20type\x20not\x20recognized','catch','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','outbound','recordingFormat','none','[OUTBOUND]','email','destcalleridname','destcalleridnum','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','inspect','abandoned','Authorization','[ABANDONED]\x20Error\x20running\x20Zendesk\x20integration','lodash','request-promise','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','zendesk','redis'];(function(_0x249d18,_0xe3d463){var _0x43f7bc=function(_0x98906f){while(--_0x98906f){_0x249d18['push'](_0x249d18['shift']());}};_0x43f7bc(++_0xe3d463);}(_0x1af3,0x1ca));var _0x31af=function(_0x57add2,_0x4f2b7d){_0x57add2=_0x57add2-0x0;var _0x4e3670=_0x1af3[_0x57add2];return _0x4e3670;};'use strict';var _=require(_0x31af('0x0'));var rp=require(_0x31af('0x1'));var md5=require(_0x31af('0x2'));var util=require(_0x31af('0x3'));var Redis=require(_0x31af('0x4'));var intUtil=require(_0x31af('0x5'));var config=require(_0x31af('0x6'));var logger=require(_0x31af('0x7'))(_0x31af('0x8'));config[_0x31af('0x9')]=_['defaults'](config[_0x31af('0x9')],{'host':_0x31af('0xa'),'port':0x18eb});var io=require(_0x31af('0xb'))(new Redis(config[_0x31af('0x9')]));function emit(_0x485717,_0x6be8e9,_0x1833de){io['to'](_0x485717)[_0x31af('0xc')](_0x6be8e9,_0x1833de);}var headers={'Content-Type':'application/json','Accept':_0x31af('0xd')};function getTicket(_0x2f1973,_0x1cfcf6,_0x1d2cd0,_0x2888dd,_0x26c99f){logger[_0x31af('0xe')](_0x31af('0xf'));return request({'uri':util['format'](_0x31af('0x10'),_0x2f1973[_0x31af('0x11')]),'method':_0x31af('0x12'),'body':{'ticket':_[_0x31af('0x13')]({'requester_id':_0x1d2cd0['id'],'submitter_id':_0x1cfcf6?_0x1cfcf6['id']:undefined,'assignee_id':_0x1cfcf6?_0x1cfcf6['id']:undefined,'tags':getTags(_0x2888dd[_0x31af('0x14')],'name'),'subject':intUtil[_0x31af('0x15')](_0x2888dd[_0x31af('0x16')],_0x26c99f,'\x20'),'description':intUtil['getString'](_0x2888dd['Descriptions'],_0x26c99f,'\x0a'),'comment':{'public':![],'body':intUtil[_0x31af('0x15')](_0x2888dd[_0x31af('0x17')],_0x26c99f,'\x0a')}},getCustomFields(_0x2888dd[_0x31af('0x18')],_0x26c99f))}})[_0x31af('0x19')](function(_0xe7e29b){logger[_0x31af('0xe')](_0x31af('0x1a'));return _0xe7e29b[_0x31af('0x1b')];});}function getUser(_0xd431e4,_0x5a651f){if(intUtil[_0x31af('0x1c')](_0x5a651f)){logger['info'](_0x31af('0x1d'),_0x5a651f);return request({'uri':util[_0x31af('0x1e')](_0x31af('0x1f'),_0xd431e4[_0x31af('0x11')]),'qs':{'query':util[_0x31af('0x1e')](_0x31af('0x20'),_0x5a651f)}})[_0x31af('0x19')](function(_0x1684d5){if(_0x1684d5[_0x31af('0x21')]){logger['info'](_0x31af('0x22'));return _[_0x31af('0x23')](_0x1684d5[_0x31af('0x24')],{'email':_0x5a651f,'role':_0x31af('0x25')});}else{logger[_0x31af('0xe')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0x31af('0x1e')](_0x31af('0x26'),_0xd431e4[_0x31af('0x11')])})[_0x31af('0x19')](function(_0x394d13){logger[_0x31af('0xe')](_0x31af('0x27'));return _0x394d13[_0x31af('0x28')];});}});}else{logger[_0x31af('0xe')](_0x31af('0x29'));return request({'uri':util[_0x31af('0x1e')](_0x31af('0x26'),_0xd431e4[_0x31af('0x11')])})[_0x31af('0x19')](function(_0x32f189){logger['info']('Admin\x20account\x20selected.');return _0x32f189['user'];});}}function getEndUser(_0x20a50c,_0x2b3bad,_0x53d2f7){logger[_0x31af('0xe')](_0x31af('0x2a'),_0x53d2f7);return request({'uri':util['format'](_0x31af('0x1f'),_0x20a50c[_0x31af('0x11')]),'qs':{'query':util['format'](_0x31af('0x2b'),_0x53d2f7)}})[_0x31af('0x19')](function(_0x4132d9){var _0x2d71a7;if(_0x4132d9[_0x31af('0x24')]['length']){_0x4132d9[_0x31af('0x24')]=_[_0x31af('0x2c')](_0x4132d9[_0x31af('0x24')],{'suspended':![],'role':_0x31af('0x2d')});if(_0x4132d9[_0x31af('0x24')][_0x31af('0x2e')]){_0x2d71a7=_[_0x31af('0x2f')](_0x4132d9[_0x31af('0x24')]);}}if(_0x2d71a7){logger[_0x31af('0xe')](_0x31af('0x30'));return _0x2d71a7;}else{logger[_0x31af('0xe')](_0x31af('0x31'));return request({'uri':util['format'](_0x31af('0x32'),_0x20a50c[_0x31af('0x11')]),'method':'POST','body':{'user':{'role':'end-user','name':util['format'](_0x31af('0x33'),_0x2b3bad||_0x53d2f7),'phone':_0x53d2f7}}})['then'](function(_0x116bb2){logger[_0x31af('0xe')](_0x31af('0x34'));return _0x116bb2[_0x31af('0x28')];});}});}function getAuth(_0x25e8bf){var _0x4bfbe9;if(_0x25e8bf['authType']===_0x31af('0x35')){_0x4bfbe9=util[_0x31af('0x1e')](_0x31af('0x36'),_0x25e8bf[_0x31af('0x37')],_0x25e8bf[_0x31af('0x35')]);}else if(_0x25e8bf[_0x31af('0x38')]===_0x31af('0x39')){_0x4bfbe9=util[_0x31af('0x1e')]('%s/token:%s',_0x25e8bf[_0x31af('0x37')],_0x25e8bf['token']);}return util[_0x31af('0x1e')](_0x31af('0x3a'),new Buffer(_0x4bfbe9)[_0x31af('0x3b')](_0x31af('0x3c')));}function request(_0x34818a){logger['debug']('[HTTP]',JSON['stringify'](_0x34818a));return rp(_[_0x31af('0x3d')](_0x34818a,{'method':_0x31af('0x3e'),'headers':headers,'json':!![]}));}function getTags(_0x2f03bf,_0x1cfdd3){var _0xcfae18=[];if(_0x2f03bf&&_0x2f03bf[_0x31af('0x2e')]>0x0){_0xcfae18=_[_0x31af('0x3f')](_0x2f03bf,_0x1cfdd3);}return _0xcfae18;}function getCustomFields(_0x237eca,_0x4f98c6){var _0x3d7cf2=[];var _0x16f3e1={'custom_fields':[]};if(_0x237eca[_0x31af('0x2e')]>0x0){_[_0x31af('0x40')](_0x237eca,function(_0x1cc7a4){if(_0x1cc7a4[_0x31af('0x41')]===_0x31af('0x42')&&_0x1cc7a4[_0x31af('0x43')]&&!_0x1cc7a4[_0x31af('0x44')]){_0x16f3e1[_0x1cc7a4['nameField'][_0x31af('0x45')]()]=_0x1cc7a4['content'][_0x31af('0x3b')]();}else if(_0x1cc7a4['type']==='string'&&_0x1cc7a4[_0x31af('0x46')]&&_0x1cc7a4[_0x31af('0x44')]){_0x16f3e1[_0x31af('0x47')][_0x31af('0x48')]({'id':_0x1cc7a4[_0x31af('0x46')],'value':_0x1cc7a4[_0x31af('0x49')][_0x31af('0x3b')]()});}else if(_0x1cc7a4['type']===_0x31af('0x4a')&&_0x1cc7a4[_0x31af('0x4b')]&&_0x1cc7a4[_0x31af('0x46')]&&_0x1cc7a4['customField']){_0x4f98c6[_0x1cc7a4[_0x31af('0x4b')]]&&_0x16f3e1[_0x31af('0x47')][_0x31af('0x48')]({'id':_0x1cc7a4[_0x31af('0x46')],'value':_0x4f98c6[_0x1cc7a4[_0x31af('0x4b')]]['toString']()});}else if(_0x1cc7a4[_0x31af('0x41')]===_0x31af('0x4c')&&_0x1cc7a4[_0x31af('0x4d')]&&_0x1cc7a4[_0x31af('0x4d')]['name']&&_0x1cc7a4[_0x31af('0x46')]&&_0x1cc7a4[_0x31af('0x44')]){_0x4f98c6[_0x1cc7a4['Variable'][_0x31af('0x4e')][_0x31af('0x45')]()]&&_0x16f3e1[_0x31af('0x47')][_0x31af('0x48')]({'id':_0x1cc7a4[_0x31af('0x46')],'value':_0x4f98c6[_0x1cc7a4[_0x31af('0x4d')][_0x31af('0x4e')][_0x31af('0x45')]()][_0x31af('0x3b')]()});}});}return _0x16f3e1;}exports[_0x31af('0x4f')]=function(_0x52a602,_0x48f7b4,_0x19cbc0,_0x492725,_0xddf9ef,_0x406fe5){var _0x1f858a,_0x5aee85;_0x406fe5['remoteUri']=intUtil[_0x31af('0x50')](_0x406fe5['remoteUri']);_0x406fe5[_0x31af('0x51')]=intUtil[_0x31af('0x50')](_0x406fe5[_0x31af('0x51')]);if(_0xddf9ef&&_0xddf9ef[_0x31af('0x52')]){logger['info']('[QUEUE]',_0x31af('0x53'));_0x48f7b4[_0x31af('0x54')]=util[_0x31af('0x1e')](_0x31af('0x55'),_0x406fe5['serverUrl'],_0x48f7b4[_0x31af('0x56')],md5(_0x48f7b4[_0x31af('0x56')]));}else{_0x48f7b4[_0x31af('0x54')]='';}headers['Authorization']=getAuth(_0x406fe5);return getUser(_0x406fe5,_0x492725['email'])[_0x31af('0x19')](function(_0xdccf27){_0x1f858a=_0xdccf27;logger[_0x31af('0xe')](_0x31af('0x57'),_0x1f858a['id']);return getEndUser(_0x406fe5,_0x48f7b4[_0x31af('0x58')],_0x48f7b4[_0x31af('0x59')]);})[_0x31af('0x19')](function(_0x275780){_0x5aee85=_0x275780;logger[_0x31af('0xe')](_0x31af('0x5a'),_0x5aee85['id']);return getTicket(_0x406fe5,_0x1f858a,_0x5aee85,_0x19cbc0,_0x48f7b4);})['then'](function(_0x441362){if(_0x441362){logger[_0x31af('0xe')](_0x31af('0x5b'),_0x441362['id']);switch(_0x406fe5[_0x31af('0x41')]){case _0x31af('0x5c'):logger[_0x31af('0xe')](_0x31af('0x5d'),_0x31af('0x5e'));return request({'uri':util[_0x31af('0x1e')](_0x31af('0x5f'),_0x406fe5[_0x31af('0x11')],_0x1f858a['id'],_0x441362['id']),'method':_0x31af('0x12')});case _0x31af('0x60'):logger[_0x31af('0xe')]('[QUEUE]',_0x31af('0x61'));emit(util[_0x31af('0x1e')](_0x31af('0x62'),_0x492725['name']),_0x31af('0x63'),{'uri':util[_0x31af('0x1e')](_0x31af('0x64'),_0x406fe5['remoteUri'],_0x441362['id'])});break;default:logger[_0x31af('0x65')](_0x31af('0x5d'),_0x31af('0x66'));}}})[_0x31af('0x67')](function(_0x7bf54c){logger[_0x31af('0x65')](_0x31af('0x68'),util['inspect'](_0x7bf54c,{'showHidden':!![],'depth':null}));});};exports[_0x31af('0x69')]=function(_0x25f7a4,_0xaedf6f,_0x40c169,_0x58c0ff,_0x4e4960,_0x4b57bc,_0x539461){var _0x29fc4d,_0x152e4f;_0x4b57bc[_0x31af('0x11')]=intUtil[_0x31af('0x50')](_0x4b57bc[_0x31af('0x11')]);_0x4b57bc[_0x31af('0x51')]=intUtil['stripTrailingSlash'](_0x4b57bc[_0x31af('0x51')]);if(_0x539461&&_0x539461['recordingFormat']&&_0x539461[_0x31af('0x6a')]!==_0x31af('0x6b')){logger['info'](_0x31af('0x6c'),_0x31af('0x53'));_0xaedf6f['recordingURL']=util[_0x31af('0x1e')](_0x31af('0x55'),_0x4b57bc[_0x31af('0x51')],_0xaedf6f[_0x31af('0x56')],md5(_0xaedf6f['uniqueid']));}headers['Authorization']=getAuth(_0x4b57bc);return getUser(_0x4b57bc,_0x58c0ff[_0x31af('0x6d')])[_0x31af('0x19')](function(_0x5ade26){_0x29fc4d=_0x5ade26;logger[_0x31af('0xe')](_0x31af('0x57'),_0x29fc4d['id']);return getEndUser(_0x4b57bc,_0xaedf6f[_0x31af('0x6e')],_0xaedf6f[_0x31af('0x6f')]);})[_0x31af('0x19')](function(_0x197e1b){_0x152e4f=_0x197e1b;logger['info'](_0x31af('0x5a'),_0x152e4f['id']);return getTicket(_0x4b57bc,_0x29fc4d,_0x152e4f,_0x40c169,_0xaedf6f);})[_0x31af('0x19')](function(_0x453db0){if(_0x453db0){logger[_0x31af('0xe')](_0x31af('0x5b'),_0x453db0['id']);switch(_0x4b57bc[_0x31af('0x41')]){case _0x31af('0x5c'):logger['info'](_0x31af('0x6c'),_0x31af('0x5e'));return request({'uri':util[_0x31af('0x1e')](_0x31af('0x5f'),_0x4b57bc[_0x31af('0x11')],_0x29fc4d['id'],_0x453db0['id']),'method':_0x31af('0x12')});case'newTab':logger[_0x31af('0xe')]('[OUTBOUND]',_0x31af('0x61'));emit(util[_0x31af('0x1e')](_0x31af('0x62'),_0x58c0ff[_0x31af('0x4e')]),_0x31af('0x63'),{'uri':util[_0x31af('0x1e')](_0x31af('0x64'),_0x4b57bc[_0x31af('0x11')],_0x453db0['id'])});break;default:logger[_0x31af('0x65')](_0x31af('0x6c'),'Zendesk\x20account\x20type\x20not\x20recognized');}}})['catch'](function(_0x3b8d3d){logger[_0x31af('0x65')](_0x31af('0x70'),util[_0x31af('0x71')](_0x3b8d3d,{'showHidden':!![],'depth':null}));});};exports[_0x31af('0x72')]=function(_0x50d8f1,_0x1c206d,_0xa2bd9a,_0x5c03c1,_0x172f45,_0x29b7c6){var _0x1d1dc7,_0x5e81b0;_0x29b7c6[_0x31af('0x11')]=intUtil[_0x31af('0x50')](_0x29b7c6[_0x31af('0x11')]);_0x29b7c6[_0x31af('0x51')]=intUtil[_0x31af('0x50')](_0x29b7c6[_0x31af('0x51')]);if(_0x172f45&&_0x172f45['monitor_format']){logger[_0x31af('0xe')]('[ABANDONED]','Recording\x20is\x20enabled!');_0x1c206d[_0x31af('0x54')]=util[_0x31af('0x1e')](_0x31af('0x55'),_0x29b7c6['serverUrl'],_0x1c206d[_0x31af('0x56')],md5(_0x1c206d[_0x31af('0x56')]));}else{_0x1c206d[_0x31af('0x54')]='';}headers[_0x31af('0x73')]=getAuth(_0x29b7c6);return getUser(_0x29b7c6)[_0x31af('0x19')](function(_0x2a13d4){_0x1d1dc7=_0x2a13d4;logger[_0x31af('0xe')](_0x31af('0x57'),_0x1d1dc7['id']);return getEndUser(_0x29b7c6,_0x1c206d[_0x31af('0x58')],_0x1c206d[_0x31af('0x59')]);})[_0x31af('0x19')](function(_0x5ada79){_0x5e81b0=_0x5ada79;logger[_0x31af('0xe')]('The\x20Enduser\x20ID\x20is:',_0x5e81b0['id']);return getTicket(_0x29b7c6,_0x1d1dc7,_0x5e81b0,_0xa2bd9a,_0x1c206d);})[_0x31af('0x19')](function(_0x367384){if(_0x367384){logger[_0x31af('0xe')](_0x31af('0x5b'),_0x367384['id']);}})[_0x31af('0x67')](function(_0x4afc9a){logger[_0x31af('0x65')](_0x31af('0x74'),util[_0x31af('0x71')](_0x4afc9a,{'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 0cd69b0..211d55f 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 _0xd4ab=['YYYY-MM-DDTHH:mm:ss','agentcalledAt','Call_Type','Inbound','Fields','/crm/v2/Calls','err','stack','queue','host','stripTrailingSlash','serverUrl','monitor_format','Recording\x20is\x20enabled!','/api/voice/recordings/','uniqueid','/downloads?type=uniqueid&token=','recordingURL','com','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Call\x20ID\x20is:','[QUEUE]','user:%s','trigger:browser:url','https://crm.','/crm/EntityInfo.do?module=Calls&id=','outbound','recordingFormat','none','[OUTBOUND]','destcalleridnum','Outbound','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','[ABANDONED]','zoho.eu','The\x20Enduser\x20ID\x20is:','lodash','md5','./util','moment','ioredis','../../../../config/environment','../../../../config/logger','zoho','defaults','localhost','socket.io-emitter','redis','emit','debug','[HTTP]','stringify','length','forEach','type','idField','variableName','toString','customVariable','Variable','name','toLowerCase','indexOf','split','isNil','access_token','expires_in','zone','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','/oauth/v2/token','clientId','clientSecret','then','catch','error','Failing\x20creating\x20the\x20access_token','info','Search\x20user','GET','https://www.zohoapis.%s/crm/v2/users','ActiveUsers','users','isArrayLikeObject','findIndex','email','Agent\x20found!','Using\x20the\x20admin\x20account!','profile','Administrator','user','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','Search\x20end\x20user','https://www.zohoapis.','/crm/v2/Contacts/search?criteria=((Phone:equals:','Zoho-oauthtoken\x20','data','enduserType','Contacts','End\x20user\x20found\x20(Contact)','/crm/v2/Leads/search?criteria=((Phone:equals:','Leads','End\x20user\x20found\x20(Lead)','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','/crm/v2/','moduleCreate','role','first_name','last_name','code','SUCCESS','details','Error\x20on\x20Lead\x20retrieve:\x20','Creating\x20new\x20call...','administrator','getString','Subjects','Description','Descriptions','Who_Id','Full_Name','First_Name','Last_Name','What_Id','$se_module','talktime','utc','format','mm:ss','answertime','endtime','Call_Duration','lastevent','called','Call_Result','complete','connect','rejected','Rejected','abandoned'];(function(_0x45ae0d,_0x1ea3b9){var _0x371826=function(_0x20e757){while(--_0x20e757){_0x45ae0d['push'](_0x45ae0d['shift']());}};_0x371826(++_0x1ea3b9);}(_0xd4ab,0xb6));var _0xbd4a=function(_0xc42a77,_0x584a4b){_0xc42a77=_0xc42a77-0x0;var _0x38b7ca=_0xd4ab[_0xc42a77];return _0x38b7ca;};'use strict';var _=require(_0xbd4a('0x0'));var rp=require('request-promise');var md5=require(_0xbd4a('0x1'));var util=require('util');var intUtil=require(_0xbd4a('0x2'));var moment=require(_0xbd4a('0x3'));var Redis=require(_0xbd4a('0x4'));var config=require(_0xbd4a('0x5'));var logger=require(_0xbd4a('0x6'))(_0xbd4a('0x7'));config['redis']=_[_0xbd4a('0x8')](config['redis'],{'host':_0xbd4a('0x9'),'port':0x18eb});var io=require(_0xbd4a('0xa'))(new Redis(config[_0xbd4a('0xb')]));function emit(_0x298e64,_0x3aa8eb,_0x9b92cb){io['to'](_0x298e64)[_0xbd4a('0xc')](_0x3aa8eb,_0x9b92cb);}function request(_0x2ad1cc){logger[_0xbd4a('0xd')](_0xbd4a('0xe'),JSON[_0xbd4a('0xf')](_0x2ad1cc));return rp(_0x2ad1cc);}function getCustomFields(_0x236604,_0x1db2b4){var _0x2fa7be={};if(_0x236604[_0xbd4a('0x10')]>0x0){_[_0xbd4a('0x11')](_0x236604,function(_0x4a5da5){if(_0x4a5da5[_0xbd4a('0x12')]==='string'&&_0x4a5da5[_0xbd4a('0x13')]){_0x2fa7be[_0x4a5da5['idField']]=_0x4a5da5['content']['toString']();}else if(_0x4a5da5[_0xbd4a('0x12')]==='variable'&&_0x4a5da5['variableName']&&_0x4a5da5[_0xbd4a('0x13')]&&_0x1db2b4[_0x4a5da5['variableName']]){_0x2fa7be[_0x4a5da5[_0xbd4a('0x13')]]=_0x1db2b4[_0x4a5da5[_0xbd4a('0x14')]][_0xbd4a('0x15')]();}else if(_0x4a5da5[_0xbd4a('0x12')]===_0xbd4a('0x16')&&_0x4a5da5[_0xbd4a('0x17')]&&_0x4a5da5[_0xbd4a('0x17')][_0xbd4a('0x18')]&&_0x4a5da5[_0xbd4a('0x13')]&&_0x1db2b4[_0x4a5da5[_0xbd4a('0x17')]['name'][_0xbd4a('0x19')]()]){_0x2fa7be[_0x4a5da5[_0xbd4a('0x13')]]=_0x1db2b4[_0x4a5da5[_0xbd4a('0x17')][_0xbd4a('0x18')][_0xbd4a('0x19')]()][_0xbd4a('0x15')]();}});}return _0x2fa7be;}function getName(_0x11a230){if(_0x11a230[_0xbd4a('0x1a')]('\x20')>0x0){var _0x11c3d2=_0x11a230[_0xbd4a('0x1b')](/ (.+)/);if(_0x11c3d2[0x1]){return _0x11c3d2;}}return[_0x11a230,_0x11a230];}var accountsTokens={};function getAccessToken(_0x53ee98){return new Promise(function(_0x40483,_0x46c629){if(!_[_0xbd4a('0x1c')](accountsTokens[_0x53ee98['id']])&&!_['isNil'](accountsTokens[_0x53ee98['id']][_0xbd4a('0x1d')])){if(moment()['isBefore'](accountsTokens[_0x53ee98['id']][_0xbd4a('0x1e')])){_0x40483(accountsTokens[_0x53ee98['id']][_0xbd4a('0x1d')]);}}var _0x34769b;switch(_0x53ee98[_0xbd4a('0x1f')]){case'US':_0x34769b='https://accounts.zoho.com';break;case'AU':_0x34769b='https://accounts.zoho.com.au';break;case'EU':_0x34769b=_0xbd4a('0x20');break;case'IN':_0x34769b=_0xbd4a('0x21');break;case'CN':_0x34769b=_0xbd4a('0x22');break;default:_0x34769b=_0xbd4a('0x20');break;}var _0x32562c={'method':_0xbd4a('0x23'),'uri':_0x34769b+_0xbd4a('0x24'),'qs':{'refresh_token':_0x53ee98['refreshToken'],'client_id':_0x53ee98[_0xbd4a('0x25')],'client_secret':_0x53ee98[_0xbd4a('0x26')],'grant_type':'refresh_token'},'json':!![]};return rp(_0x32562c)[_0xbd4a('0x27')](function(_0x1c7953){accountsTokens[_0x53ee98['id']]={'access_token':_0x1c7953[_0xbd4a('0x1d')],'expires_in':moment()['add'](_0x1c7953['expires_in'],'seconds')};_0x40483(_0x1c7953[_0xbd4a('0x1d')]);})[_0xbd4a('0x28')](function(_0x3391d3){logger[_0xbd4a('0x29')](_0xbd4a('0x2a'),_0x3391d3['stack']);_0x46c629(_0x3391d3);});});}function getUser(_0x7c289d,_0x5322e4,_0xadc55d,_0x341711){logger[_0xbd4a('0x2b')](_0xbd4a('0x2c'));return request({'method':_0xbd4a('0x2d'),'uri':util['format'](_0xbd4a('0x2e'),_0x5322e4),'qs':{'type':_0xbd4a('0x2f')},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x7c289d},'json':!![]})[_0xbd4a('0x27')](function(_0x2f01f9){if(_0x2f01f9[_0xbd4a('0x30')]){var _0xbe5a6a=-0x1;if(_[_0xbd4a('0x31')](_0x2f01f9[_0xbd4a('0x30')])){if(!_['isNil'](_0x341711)){_0xbe5a6a=_[_0xbd4a('0x32')](_0x2f01f9[_0xbd4a('0x30')],function(_0xc904f9){return _0xc904f9[_0xbd4a('0x33')]===_0x341711;});}if(_0xbe5a6a>=0x0){logger[_0xbd4a('0x2b')](_0xbd4a('0x34'));}else{logger[_0xbd4a('0x2b')](_0xbd4a('0x35'));_0xbe5a6a=_[_0xbd4a('0x32')](_0x2f01f9[_0xbd4a('0x30')],function(_0x478d99){return _0x478d99[_0xbd4a('0x36')][_0xbd4a('0x18')]==='Administrator';});}return _0x2f01f9[_0xbd4a('0x30')][_0xbe5a6a];}else{if(_0x2f01f9['user'][_0xbd4a('0x36')][_0xbd4a('0x18')]===_0xbd4a('0x37')){logger[_0xbd4a('0x2b')](_0xbd4a('0x35'));user=_0x2f01f9[_0xbd4a('0x38')];return user;}else{logger[_0xbd4a('0x29')]('The\x20failing\x20result\x20is',JSON[_0xbd4a('0xf')](_0x2f01f9));throw new Error(_0xbd4a('0x39')+JSON[_0xbd4a('0xf')](_0x2f01f9));}}}else{logger[_0xbd4a('0x29')]('The\x20failing\x20result\x20is',JSON[_0xbd4a('0xf')](_0x2f01f9));throw new Error(_0xbd4a('0x39')+JSON[_0xbd4a('0xf')](_0x2f01f9));}})['catch'](function(_0x290046){console[_0xbd4a('0x29')](_0x290046);});}function getEndUser(_0xd6571c,_0x5e8ca2,_0x4b45c0,_0x21f9e8,_0x41829d,_0x435a2e,_0xd749eb){logger[_0xbd4a('0x2b')](_0xbd4a('0x3a'));return request({'method':'GET','uri':_0xbd4a('0x3b')+_0x5e8ca2+_0xbd4a('0x3c')+_0x41829d+'))','headers':{'Authorization':_0xbd4a('0x3d')+_0xd6571c},'json':!![]})['then'](function(_0x360279){if(_0x360279){var _0x97a659=_0x360279[_0xbd4a('0x3e')][0x0];_0x97a659[_0xbd4a('0x3f')]=_0xbd4a('0x40');logger[_0xbd4a('0x2b')](_0xbd4a('0x41'));return _0x97a659;}else{return request({'method':'GET','uri':_0xbd4a('0x3b')+_0x5e8ca2+_0xbd4a('0x42')+_0x41829d+'))','headers':{'Authorization':'Zoho-oauthtoken\x20'+_0xd6571c},'json':!![]})[_0xbd4a('0x27')](function(_0x26f60c){if(_0x26f60c){var _0x2fb580=_0x26f60c['data'][0x0];_0x2fb580[_0xbd4a('0x3f')]=_0xbd4a('0x43');logger[_0xbd4a('0x2b')](_0xbd4a('0x44'));return _0x2fb580;}else{logger[_0xbd4a('0x2b')](_0xbd4a('0x45'));_0x21f9e8=getName(_0x21f9e8);return request({'method':_0xbd4a('0x23'),'uri':_0xbd4a('0x3b')+_0x5e8ca2+_0xbd4a('0x46')+_0xd749eb[_0xbd4a('0x47')],'body':{'data':[{'Last_Name':_0x21f9e8[0x1],'First_Name':_0x21f9e8[0x0],'Phone':_0x41829d,'Owner':{'name':!_[_0xbd4a('0x1c')](_0x435a2e['role'][_0xbd4a('0x18')])?_0x435a2e[_0xbd4a('0x48')]['name']:!_[_0xbd4a('0x1c')](_0x435a2e[_0xbd4a('0x49')])?_0x435a2e[_0xbd4a('0x49')]+'\x20'+_0x435a2e[_0xbd4a('0x4a')]:_0x435a2e[_0xbd4a('0x4a')],'id':_0x435a2e['id']}}]},'headers':{'Authorization':_0xbd4a('0x3d')+_0xd6571c},'json':!![]})[_0xbd4a('0x27')](function(_0x4cd9f9){if(_0x4cd9f9&&_0x4cd9f9[_0xbd4a('0x3e')][0x0][_0xbd4a('0x4b')]===_0xbd4a('0x4c')){var _0x787116=_0x4cd9f9[_0xbd4a('0x3e')][0x0][_0xbd4a('0x4d')];_0x787116['enduserType']=_0xd749eb[_0xbd4a('0x47')];return _0x787116;}logger['error']('The\x20failing\x20result\x20is',JSON['stringify'](_0x4cd9f9));throw new Error(_0xbd4a('0x4e')+JSON['stringify'](_0x4cd9f9));});}});}});}function getCall(_0x19056c,_0x334d58,_0x48ae3c,_0x14f5bb,_0x3ec885,_0x457f69,_0x4a9e1b,_0x435077){logger[_0xbd4a('0x2b')](_0xbd4a('0x4f'));var _0x48f482={};_0x48f482['Owner']={'name':!_['isNil'](_0x14f5bb[_0xbd4a('0x48')][_0xbd4a('0x18')])&&!_[_0xbd4a('0x1c')](_0x14f5bb[_0xbd4a('0x36')][_0xbd4a('0x18')])&&_0x14f5bb[_0xbd4a('0x36')]['name']===_0xbd4a('0x50')?_0x14f5bb[_0xbd4a('0x48')][_0xbd4a('0x18')]:!_[_0xbd4a('0x1c')](_0x14f5bb[_0xbd4a('0x49')])?_0x14f5bb['first_name']+'\x20'+_0x14f5bb[_0xbd4a('0x4a')]:_0x14f5bb['last_name'],'id':_0x14f5bb['id']};_0x48f482['Subject']=intUtil[_0xbd4a('0x51')](_0x457f69[_0xbd4a('0x52')],_0x4a9e1b,'\x20');_0x48f482[_0xbd4a('0x53')]=intUtil[_0xbd4a('0x51')](_0x457f69[_0xbd4a('0x54')],_0x4a9e1b,'\x0a');if(_0x3ec885[_0xbd4a('0x3f')]==='Contacts'){_0x48f482[_0xbd4a('0x55')]={'name':!_['isNil'](_0x3ec885[_0xbd4a('0x56')])?_0x3ec885[_0xbd4a('0x56')]:!_['isNil'](_0x3ec885[_0xbd4a('0x57')])?_0x3ec885[_0xbd4a('0x57')]+'\x20'+_0x3ec885[_0xbd4a('0x58')]:_0x3ec885[_0xbd4a('0x58')],'id':_0x3ec885['id']};}if(_0x3ec885['enduserType']===_0xbd4a('0x43')){_0x48f482[_0xbd4a('0x59')]={'name':!_[_0xbd4a('0x1c')](_0x3ec885['Full_Name'])?_0x3ec885['Full_Name']:!_[_0xbd4a('0x1c')](_0x3ec885[_0xbd4a('0x57')])?_0x3ec885['First_Name']+'\x20'+_0x3ec885[_0xbd4a('0x58')]:_0x3ec885[_0xbd4a('0x58')],'id':_0x3ec885['id']};_0x48f482[_0xbd4a('0x5a')]=_0x3ec885[_0xbd4a('0x3f')];}if(_0x4a9e1b[_0xbd4a('0x5b')]){_0x48f482['Call_Duration']=moment[_0xbd4a('0x5c')](parseInt(_0x4a9e1b[_0xbd4a('0x5b')])*0x3e8)[_0xbd4a('0x5d')](_0xbd4a('0x5e'));}else if(_0x4a9e1b[_0xbd4a('0x5f')]&&_0x4a9e1b[_0xbd4a('0x60')]){_0x48f482[_0xbd4a('0x61')]=moment['utc'](moment(_0x4a9e1b[_0xbd4a('0x60')],'YYYY-MM-DDTHH:mm:ss')['diff'](moment(_0x4a9e1b['starttime'],'YYYY-MM-DDTHH:mm:ss')))[_0xbd4a('0x5d')](_0xbd4a('0x5e'));}switch(_0x4a9e1b[_0xbd4a('0x62')]){case _0xbd4a('0x63'):_0x48f482[_0xbd4a('0x64')]='Called';break;case _0xbd4a('0x65'):case _0xbd4a('0x66'):_0x48f482[_0xbd4a('0x64')]='Answered';break;case _0xbd4a('0x67'):_0x48f482[_0xbd4a('0x64')]=_0xbd4a('0x68');break;case _0xbd4a('0x69'):_0x48f482[_0xbd4a('0x64')]='Abandoned';break;default:}_0x48f482['Call_Start_Time']=(_0x435077==='outbound'?moment(_0x4a9e1b['starttime'])['format'](_0xbd4a('0x6a')):moment(_0x4a9e1b[_0xbd4a('0x6b')])[_0xbd4a('0x5d')]('YYYY-MM-DDTHH:mm:ss'))||moment()[_0xbd4a('0x5d')](_0xbd4a('0x6a'));_0x48f482[_0xbd4a('0x6c')]=_0x435077||_0xbd4a('0x6d');_0x48f482=_['merge'](_0x48f482,getCustomFields(_0x457f69[_0xbd4a('0x6e')],_0x4a9e1b));return request({'method':'POST','uri':_0xbd4a('0x3b')+_0x334d58+_0xbd4a('0x6f'),'headers':{'Authorization':_0xbd4a('0x3d')+_0x19056c},'body':{'data':[_0x48f482]},'json':!![]})[_0xbd4a('0x27')](function(_0x6c8481){if(_0x6c8481&&_0x6c8481[_0xbd4a('0x3e')][0x0][_0xbd4a('0x4b')]===_0xbd4a('0x4c')){logger[_0xbd4a('0x2b')]('Call\x20created!');return{'id':_0x6c8481[_0xbd4a('0x3e')][0x0][_0xbd4a('0x4d')]['id']};}})['catch'](function(_0x4dd9cf){logger[_0xbd4a('0x2b')](_0xbd4a('0x70'),_0x4dd9cf[_0xbd4a('0x71')]);console['log'](_0xbd4a('0x70'),_0x4dd9cf);});}exports[_0xbd4a('0x72')]=function(_0x41f609,_0x9141b8,_0x15992d,_0x3ff864,_0x335f47,_0x4d2a75){var _0x33633b,_0x591614,_0x13c598;_0x4d2a75[_0xbd4a('0x73')]=intUtil[_0xbd4a('0x74')](_0x4d2a75[_0xbd4a('0x73')]);_0x4d2a75[_0xbd4a('0x75')]=intUtil[_0xbd4a('0x74')](_0x4d2a75[_0xbd4a('0x75')]);if(_0x335f47&&_0x335f47[_0xbd4a('0x76')]){logger['info']('[QUEUE]',_0xbd4a('0x77'));_0x9141b8['recordingURL']=_0x4d2a75['serverUrl']+_0xbd4a('0x78')+_0x9141b8[_0xbd4a('0x79')]+_0xbd4a('0x7a')+md5(_0x9141b8[_0xbd4a('0x79')]);}else{_0x9141b8[_0xbd4a('0x7b')]='';}var _0x1986a1=_0x4d2a75[_0xbd4a('0x73')]==='zoho.eu'?'eu':_0xbd4a('0x7c');return getAccessToken(_0x4d2a75)[_0xbd4a('0x27')](function(_0x1a6ec1){_0x13c598=_0x1a6ec1;return getUser(_0x13c598,_0x1986a1,_0x4d2a75,_0x3ff864[_0xbd4a('0x33')]);})[_0xbd4a('0x27')](function(_0x2b0356){_0x33633b=_0x2b0356;logger[_0xbd4a('0x2b')](_0xbd4a('0x7d'),_0x33633b['id']);return getEndUser(_0x13c598,_0x1986a1,_0x4d2a75,_0x9141b8[_0xbd4a('0x7e')],_0x9141b8[_0xbd4a('0x7f')],_0x33633b,_0x15992d);})[_0xbd4a('0x27')](function(_0x135db2){_0x591614=_0x135db2;logger[_0xbd4a('0x2b')]('The\x20Enduser\x20ID\x20is:',_0x591614['id']);return getCall(_0x13c598,_0x1986a1,_0x4d2a75,_0x33633b,_0x591614,_0x15992d,_0x9141b8,_0xbd4a('0x6d'));})[_0xbd4a('0x27')](function(_0xb82c71){if(_0xb82c71){logger['info'](_0xbd4a('0x80'),_0xb82c71['id']);logger[_0xbd4a('0x2b')](_0xbd4a('0x81'),'Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xbd4a('0x5d')](_0xbd4a('0x82'),_0x3ff864[_0xbd4a('0x18')]),_0xbd4a('0x83'),{'uri':_0xbd4a('0x84')+_0x4d2a75[_0xbd4a('0x73')]+_0xbd4a('0x85')+_0xb82c71['id']});}})[_0xbd4a('0x28')](function(_0x3611be){logger['error'](_0xbd4a('0x81'),JSON[_0xbd4a('0xf')](_0x3611be));});};exports[_0xbd4a('0x86')]=function(_0x3999e3,_0x2b34ae,_0x7e5a52,_0x398d0d,_0x3c7af7,_0x59be09,_0x2a3d6c){var _0xe2484d,_0xab320b,_0x331806;_0x59be09[_0xbd4a('0x73')]=intUtil[_0xbd4a('0x74')](_0x59be09['host']);_0x59be09[_0xbd4a('0x75')]=intUtil[_0xbd4a('0x74')](_0x59be09[_0xbd4a('0x75')]);if(_0x2a3d6c&&_0x2a3d6c['recordingFormat']&&_0x2a3d6c[_0xbd4a('0x87')]!==_0xbd4a('0x88')){logger[_0xbd4a('0x2b')](_0xbd4a('0x89'),_0xbd4a('0x77'));_0x2b34ae[_0xbd4a('0x7b')]=_0x59be09[_0xbd4a('0x75')]+_0xbd4a('0x78')+_0x2b34ae[_0xbd4a('0x79')]+'/downloads?type=uniqueid&token='+md5(_0x2b34ae['uniqueid']);}var _0x342dc5=_0x59be09[_0xbd4a('0x73')]==='zoho.eu'?'eu':'com';return getAccessToken(_0x59be09)[_0xbd4a('0x27')](function(_0x36730b){_0x331806=_0x36730b;return getUser(_0x331806,_0x342dc5,_0x59be09,_0x398d0d['email']);})[_0xbd4a('0x27')](function(_0x57c85a){_0xe2484d=_0x57c85a;logger[_0xbd4a('0x2b')](_0xbd4a('0x7d'),_0xe2484d['id']);return getEndUser(_0x331806,_0x342dc5,_0x59be09,_0x2b34ae['destcalleridname'],_0x2b34ae[_0xbd4a('0x8a')],_0xe2484d,_0x7e5a52);})[_0xbd4a('0x27')](function(_0x2e9709){_0xab320b=_0x2e9709;logger['info']('The\x20Enduser\x20ID\x20is:',_0xab320b['id']);return getCall(_0x331806,_0x342dc5,_0x59be09,_0xe2484d,_0xab320b,_0x7e5a52,_0x2b34ae,_0xbd4a('0x8b'));})[_0xbd4a('0x27')](function(_0x161bad){if(_0x161bad){logger[_0xbd4a('0x2b')](_0xbd4a('0x80'),_0x161bad['id']);logger[_0xbd4a('0x2b')]('[OUTBOUND]',_0xbd4a('0x8c'));emit(util[_0xbd4a('0x5d')](_0xbd4a('0x82'),_0x398d0d[_0xbd4a('0x18')]),_0xbd4a('0x83'),{'uri':_0xbd4a('0x84')+_0x59be09[_0xbd4a('0x73')]+'/crm/EntityInfo.do?module=Calls&id='+_0x161bad['id']});}})['catch'](function(_0x4a40bf){logger[_0xbd4a('0x29')](_0xbd4a('0x89'),JSON['stringify'](_0x4a40bf));});};exports[_0xbd4a('0x69')]=function(_0x5bb71c,_0x49c938,_0x1971a8,_0x127f54,_0x4f019e,_0x432f8b){var _0x2e602e,_0x486dc5,_0xf9eb2b;_0x432f8b['host']=intUtil['stripTrailingSlash'](_0x432f8b[_0xbd4a('0x73')]);_0x432f8b[_0xbd4a('0x75')]=intUtil['stripTrailingSlash'](_0x432f8b[_0xbd4a('0x75')]);if(_0x4f019e&&_0x4f019e['monitor_format']){logger['info'](_0xbd4a('0x8d'),_0xbd4a('0x77'));_0x49c938[_0xbd4a('0x7b')]=_0x432f8b[_0xbd4a('0x75')]+_0xbd4a('0x78')+_0x49c938[_0xbd4a('0x79')]+_0xbd4a('0x7a')+md5(_0x49c938[_0xbd4a('0x79')]);}else{_0x49c938[_0xbd4a('0x7b')]='';}var _0x55f735=_0x432f8b['host']===_0xbd4a('0x8e')?'eu':'com';return getAccessToken(_0x432f8b)[_0xbd4a('0x27')](function(_0x406dcd){_0xf9eb2b=_0x406dcd;return getUser(_0xf9eb2b,_0x55f735,_0x432f8b);})['then'](function(_0x4c1da9){_0x2e602e=_0x4c1da9;logger[_0xbd4a('0x2b')](_0xbd4a('0x7d'),_0x2e602e['id']);return getEndUser(_0xf9eb2b,_0x55f735,_0x432f8b,_0x49c938[_0xbd4a('0x7e')],_0x49c938['calleridnum'],_0x2e602e,_0x1971a8);})[_0xbd4a('0x27')](function(_0x20eedb){_0x486dc5=_0x20eedb;logger[_0xbd4a('0x2b')](_0xbd4a('0x8f'),_0x486dc5['id']);return getCall(_0xf9eb2b,_0x55f735,_0x432f8b,_0x2e602e,_0x486dc5,_0x1971a8,_0x49c938,_0xbd4a('0x6d'));})[_0xbd4a('0x27')](function(_0x465c79){if(_0x465c79){logger['info'](_0xbd4a('0x80'),_0x465c79['id']);}})[_0xbd4a('0x28')](function(_0x47c167){logger[_0xbd4a('0x29')]('[ABANDONED]',JSON[_0xbd4a('0xf')](_0x47c167));});}; \ No newline at end of file +var _0xe4b6=['add','expires_in','seconds','catch','error','Failing\x20creating\x20the\x20access_token','stack','info','Search\x20user','GET','format','https://www.zohoapis.%s/crm/v2/users','ActiveUsers','users','isArrayLikeObject','findIndex','email','Using\x20the\x20admin\x20account!','profile','user','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','Search\x20end\x20user','https://www.zohoapis.','/crm/v2/Contacts/search?criteria=((Phone:equals:','Zoho-oauthtoken\x20','data','enduserType','Contacts','End\x20user\x20found\x20(Contact)','/crm/v2/Leads/search?criteria=((Phone:equals:','Leads','End\x20user\x20found\x20(Lead)','/crm/v2/','moduleCreate','role','first_name','last_name','code','SUCCESS','Creating\x20new\x20call...','administrator','Subject','getString','Subjects','Who_Id','Full_Name','First_Name','Last_Name','$se_module','talktime','mm:ss','answertime','Call_Duration','utc','endtime','YYYY-MM-DDTHH:mm:ss','diff','starttime','lastevent','called','Called','complete','Call_Result','rejected','abandoned','Abandoned','Call_Start_Time','agentcalledAt','Call_Type','Inbound','merge','Fields','/crm/v2/Calls','Call\x20created!','queue','host','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','serverUrl','uniqueid','zoho.eu','com','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=','outbound','recordingFormat','[OUTBOUND]','/api/voice/recordings/','/downloads?type=uniqueid&token=','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','[ABANDONED]','lodash','request-promise','md5','./util','moment','ioredis','../../../../config/environment','../../../../config/logger','zoho','redis','defaults','socket.io-emitter','debug','[HTTP]','stringify','length','forEach','type','string','idField','content','toString','variable','variableName','customVariable','Variable','name','toLowerCase','indexOf','split','isNil','access_token','isBefore','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','refreshToken','clientId','refresh_token','then'];(function(_0x2f757c,_0xd61f9c){var _0x3e8c19=function(_0x5c1ed8){while(--_0x5c1ed8){_0x2f757c['push'](_0x2f757c['shift']());}};_0x3e8c19(++_0xd61f9c);}(_0xe4b6,0xfa));var _0x6e4b=function(_0x425213,_0x5b0300){_0x425213=_0x425213-0x0;var _0x4c2ba2=_0xe4b6[_0x425213];return _0x4c2ba2;};'use strict';var _=require(_0x6e4b('0x0'));var rp=require(_0x6e4b('0x1'));var md5=require(_0x6e4b('0x2'));var util=require('util');var intUtil=require(_0x6e4b('0x3'));var moment=require(_0x6e4b('0x4'));var Redis=require(_0x6e4b('0x5'));var config=require(_0x6e4b('0x6'));var logger=require(_0x6e4b('0x7'))(_0x6e4b('0x8'));config[_0x6e4b('0x9')]=_[_0x6e4b('0xa')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x6e4b('0xb'))(new Redis(config[_0x6e4b('0x9')]));function emit(_0x392cf5,_0x1c2484,_0x40dcbc){io['to'](_0x392cf5)['emit'](_0x1c2484,_0x40dcbc);}function request(_0x38e05f){logger[_0x6e4b('0xc')](_0x6e4b('0xd'),JSON[_0x6e4b('0xe')](_0x38e05f));return rp(_0x38e05f);}function getCustomFields(_0x128b1a,_0x7ac50){var _0x298f4a={};if(_0x128b1a[_0x6e4b('0xf')]>0x0){_[_0x6e4b('0x10')](_0x128b1a,function(_0x17f389){if(_0x17f389[_0x6e4b('0x11')]===_0x6e4b('0x12')&&_0x17f389[_0x6e4b('0x13')]){_0x298f4a[_0x17f389[_0x6e4b('0x13')]]=_0x17f389[_0x6e4b('0x14')][_0x6e4b('0x15')]();}else if(_0x17f389[_0x6e4b('0x11')]===_0x6e4b('0x16')&&_0x17f389[_0x6e4b('0x17')]&&_0x17f389[_0x6e4b('0x13')]&&_0x7ac50[_0x17f389['variableName']]){_0x298f4a[_0x17f389[_0x6e4b('0x13')]]=_0x7ac50[_0x17f389['variableName']][_0x6e4b('0x15')]();}else if(_0x17f389[_0x6e4b('0x11')]===_0x6e4b('0x18')&&_0x17f389[_0x6e4b('0x19')]&&_0x17f389[_0x6e4b('0x19')][_0x6e4b('0x1a')]&&_0x17f389[_0x6e4b('0x13')]&&_0x7ac50[_0x17f389['Variable'][_0x6e4b('0x1a')]['toLowerCase']()]){_0x298f4a[_0x17f389[_0x6e4b('0x13')]]=_0x7ac50[_0x17f389[_0x6e4b('0x19')][_0x6e4b('0x1a')][_0x6e4b('0x1b')]()]['toString']();}});}return _0x298f4a;}function getName(_0x1ba48d){if(_0x1ba48d[_0x6e4b('0x1c')]('\x20')>0x0){var _0x7c4a1f=_0x1ba48d[_0x6e4b('0x1d')](/ (.+)/);if(_0x7c4a1f[0x1]){return _0x7c4a1f;}}return[_0x1ba48d,_0x1ba48d];}var accountsTokens={};function getAccessToken(_0x1f823e){return new Promise(function(_0xbc2b69,_0x11f48d){if(!_[_0x6e4b('0x1e')](accountsTokens[_0x1f823e['id']])&&!_[_0x6e4b('0x1e')](accountsTokens[_0x1f823e['id']][_0x6e4b('0x1f')])){if(moment()[_0x6e4b('0x20')](accountsTokens[_0x1f823e['id']]['expires_in'])){_0xbc2b69(accountsTokens[_0x1f823e['id']]['access_token']);}}var _0x2cf6e8;switch(_0x1f823e[_0x6e4b('0x21')]){case'US':_0x2cf6e8=_0x6e4b('0x22');break;case'AU':_0x2cf6e8=_0x6e4b('0x23');break;case'EU':_0x2cf6e8=_0x6e4b('0x24');break;case'IN':_0x2cf6e8=_0x6e4b('0x25');break;case'CN':_0x2cf6e8=_0x6e4b('0x26');break;default:_0x2cf6e8=_0x6e4b('0x24');break;}var _0x230561={'method':_0x6e4b('0x27'),'uri':_0x2cf6e8+'/oauth/v2/token','qs':{'refresh_token':_0x1f823e[_0x6e4b('0x28')],'client_id':_0x1f823e[_0x6e4b('0x29')],'client_secret':_0x1f823e['clientSecret'],'grant_type':_0x6e4b('0x2a')},'json':!![]};return rp(_0x230561)[_0x6e4b('0x2b')](function(_0x52f69c){accountsTokens[_0x1f823e['id']]={'access_token':_0x52f69c[_0x6e4b('0x1f')],'expires_in':moment()[_0x6e4b('0x2c')](_0x52f69c[_0x6e4b('0x2d')],_0x6e4b('0x2e'))};_0xbc2b69(_0x52f69c[_0x6e4b('0x1f')]);})[_0x6e4b('0x2f')](function(_0x4af0f4){logger[_0x6e4b('0x30')](_0x6e4b('0x31'),_0x4af0f4[_0x6e4b('0x32')]);_0x11f48d(_0x4af0f4);});});}function getUser(_0x30fd6e,_0x196b34,_0x24d115,_0x512129){logger[_0x6e4b('0x33')](_0x6e4b('0x34'));return request({'method':_0x6e4b('0x35'),'uri':util[_0x6e4b('0x36')](_0x6e4b('0x37'),_0x196b34),'qs':{'type':_0x6e4b('0x38')},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x30fd6e},'json':!![]})[_0x6e4b('0x2b')](function(_0x1fe7a6){if(_0x1fe7a6[_0x6e4b('0x39')]){var _0x356545=-0x1;if(_[_0x6e4b('0x3a')](_0x1fe7a6[_0x6e4b('0x39')])){if(!_[_0x6e4b('0x1e')](_0x512129)){_0x356545=_[_0x6e4b('0x3b')](_0x1fe7a6['users'],function(_0x410157){return _0x410157[_0x6e4b('0x3c')]===_0x512129;});}if(_0x356545>=0x0){logger[_0x6e4b('0x33')]('Agent\x20found!');}else{logger['info'](_0x6e4b('0x3d'));_0x356545=_[_0x6e4b('0x3b')](_0x1fe7a6['users'],function(_0x33439e){return _0x33439e[_0x6e4b('0x3e')][_0x6e4b('0x1a')]==='Administrator';});}return _0x1fe7a6['users'][_0x356545];}else{if(_0x1fe7a6[_0x6e4b('0x3f')][_0x6e4b('0x3e')][_0x6e4b('0x1a')]==='Administrator'){logger['info']('Using\x20the\x20admin\x20account!');user=_0x1fe7a6[_0x6e4b('0x3f')];return user;}else{logger[_0x6e4b('0x30')]('The\x20failing\x20result\x20is',JSON[_0x6e4b('0xe')](_0x1fe7a6));throw new Error(_0x6e4b('0x40')+JSON[_0x6e4b('0xe')](_0x1fe7a6));}}}else{logger[_0x6e4b('0x30')]('The\x20failing\x20result\x20is',JSON['stringify'](_0x1fe7a6));throw new Error(_0x6e4b('0x40')+JSON[_0x6e4b('0xe')](_0x1fe7a6));}})['catch'](function(_0x465870){console['error'](_0x465870);});}function getEndUser(_0xadb57b,_0x317192,_0x29f7c6,_0x3b2d1f,_0x2e9033,_0x4a701b,_0x1e93b3){logger['info'](_0x6e4b('0x41'));return request({'method':'GET','uri':_0x6e4b('0x42')+_0x317192+_0x6e4b('0x43')+_0x2e9033+'))','headers':{'Authorization':_0x6e4b('0x44')+_0xadb57b},'json':!![]})['then'](function(_0x22dcf8){if(_0x22dcf8){var _0x30c62e=_0x22dcf8[_0x6e4b('0x45')][0x0];_0x30c62e[_0x6e4b('0x46')]=_0x6e4b('0x47');logger[_0x6e4b('0x33')](_0x6e4b('0x48'));return _0x30c62e;}else{return request({'method':_0x6e4b('0x35'),'uri':'https://www.zohoapis.'+_0x317192+_0x6e4b('0x49')+_0x2e9033+'))','headers':{'Authorization':'Zoho-oauthtoken\x20'+_0xadb57b},'json':!![]})['then'](function(_0x342911){if(_0x342911){var _0x5f3137=_0x342911[_0x6e4b('0x45')][0x0];_0x5f3137['enduserType']=_0x6e4b('0x4a');logger[_0x6e4b('0x33')](_0x6e4b('0x4b'));return _0x5f3137;}else{logger[_0x6e4b('0x33')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');_0x3b2d1f=getName(_0x3b2d1f);return request({'method':_0x6e4b('0x27'),'uri':_0x6e4b('0x42')+_0x317192+_0x6e4b('0x4c')+_0x1e93b3[_0x6e4b('0x4d')],'body':{'data':[{'Last_Name':_0x3b2d1f[0x1],'First_Name':_0x3b2d1f[0x0],'Phone':_0x2e9033,'Owner':{'name':!_[_0x6e4b('0x1e')](_0x4a701b[_0x6e4b('0x4e')][_0x6e4b('0x1a')])?_0x4a701b[_0x6e4b('0x4e')][_0x6e4b('0x1a')]:!_[_0x6e4b('0x1e')](_0x4a701b[_0x6e4b('0x4f')])?_0x4a701b[_0x6e4b('0x4f')]+'\x20'+_0x4a701b[_0x6e4b('0x50')]:_0x4a701b[_0x6e4b('0x50')],'id':_0x4a701b['id']}}]},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0xadb57b},'json':!![]})[_0x6e4b('0x2b')](function(_0x5a92a7){if(_0x5a92a7&&_0x5a92a7[_0x6e4b('0x45')][0x0][_0x6e4b('0x51')]===_0x6e4b('0x52')){var _0x5be142=_0x5a92a7['data'][0x0]['details'];_0x5be142[_0x6e4b('0x46')]=_0x1e93b3[_0x6e4b('0x4d')];return _0x5be142;}logger[_0x6e4b('0x30')]('The\x20failing\x20result\x20is',JSON[_0x6e4b('0xe')](_0x5a92a7));throw new Error('Error\x20on\x20Lead\x20retrieve:\x20'+JSON[_0x6e4b('0xe')](_0x5a92a7));});}});}});}function getCall(_0x4d71c9,_0x543b15,_0x209195,_0x167316,_0x20d43a,_0x181471,_0x4f4b68,_0x4d5427){logger[_0x6e4b('0x33')](_0x6e4b('0x53'));var _0x2719d9={};_0x2719d9['Owner']={'name':!_[_0x6e4b('0x1e')](_0x167316[_0x6e4b('0x4e')][_0x6e4b('0x1a')])&&!_[_0x6e4b('0x1e')](_0x167316[_0x6e4b('0x3e')]['name'])&&_0x167316['profile'][_0x6e4b('0x1a')]===_0x6e4b('0x54')?_0x167316[_0x6e4b('0x4e')][_0x6e4b('0x1a')]:!_[_0x6e4b('0x1e')](_0x167316[_0x6e4b('0x4f')])?_0x167316[_0x6e4b('0x4f')]+'\x20'+_0x167316[_0x6e4b('0x50')]:_0x167316['last_name'],'id':_0x167316['id']};_0x2719d9[_0x6e4b('0x55')]=intUtil[_0x6e4b('0x56')](_0x181471[_0x6e4b('0x57')],_0x4f4b68,'\x20');_0x2719d9['Description']=intUtil['getString'](_0x181471['Descriptions'],_0x4f4b68,'\x0a');if(_0x20d43a[_0x6e4b('0x46')]==='Contacts'){_0x2719d9[_0x6e4b('0x58')]={'name':!_[_0x6e4b('0x1e')](_0x20d43a[_0x6e4b('0x59')])?_0x20d43a[_0x6e4b('0x59')]:!_[_0x6e4b('0x1e')](_0x20d43a[_0x6e4b('0x5a')])?_0x20d43a[_0x6e4b('0x5a')]+'\x20'+_0x20d43a['Last_Name']:_0x20d43a[_0x6e4b('0x5b')],'id':_0x20d43a['id']};}if(_0x20d43a[_0x6e4b('0x46')]===_0x6e4b('0x4a')){_0x2719d9['What_Id']={'name':!_[_0x6e4b('0x1e')](_0x20d43a[_0x6e4b('0x59')])?_0x20d43a['Full_Name']:!_[_0x6e4b('0x1e')](_0x20d43a[_0x6e4b('0x5a')])?_0x20d43a[_0x6e4b('0x5a')]+'\x20'+_0x20d43a[_0x6e4b('0x5b')]:_0x20d43a[_0x6e4b('0x5b')],'id':_0x20d43a['id']};_0x2719d9[_0x6e4b('0x5c')]=_0x20d43a[_0x6e4b('0x46')];}if(_0x4f4b68[_0x6e4b('0x5d')]){_0x2719d9['Call_Duration']=moment['utc'](parseInt(_0x4f4b68[_0x6e4b('0x5d')])*0x3e8)[_0x6e4b('0x36')](_0x6e4b('0x5e'));}else if(_0x4f4b68[_0x6e4b('0x5f')]&&_0x4f4b68['endtime']){_0x2719d9[_0x6e4b('0x60')]=moment[_0x6e4b('0x61')](moment(_0x4f4b68[_0x6e4b('0x62')],_0x6e4b('0x63'))[_0x6e4b('0x64')](moment(_0x4f4b68[_0x6e4b('0x65')],'YYYY-MM-DDTHH:mm:ss')))[_0x6e4b('0x36')](_0x6e4b('0x5e'));}switch(_0x4f4b68[_0x6e4b('0x66')]){case _0x6e4b('0x67'):_0x2719d9['Call_Result']=_0x6e4b('0x68');break;case _0x6e4b('0x69'):case'connect':_0x2719d9[_0x6e4b('0x6a')]='Answered';break;case _0x6e4b('0x6b'):_0x2719d9[_0x6e4b('0x6a')]='Rejected';break;case _0x6e4b('0x6c'):_0x2719d9[_0x6e4b('0x6a')]=_0x6e4b('0x6d');break;default:}_0x2719d9[_0x6e4b('0x6e')]=(_0x4d5427==='outbound'?moment(_0x4f4b68[_0x6e4b('0x65')])['format'](_0x6e4b('0x63')):moment(_0x4f4b68[_0x6e4b('0x6f')])[_0x6e4b('0x36')](_0x6e4b('0x63')))||moment()[_0x6e4b('0x36')](_0x6e4b('0x63'));_0x2719d9[_0x6e4b('0x70')]=_0x4d5427||_0x6e4b('0x71');_0x2719d9=_[_0x6e4b('0x72')](_0x2719d9,getCustomFields(_0x181471[_0x6e4b('0x73')],_0x4f4b68));return request({'method':'POST','uri':_0x6e4b('0x42')+_0x543b15+_0x6e4b('0x74'),'headers':{'Authorization':_0x6e4b('0x44')+_0x4d71c9},'body':{'data':[_0x2719d9]},'json':!![]})[_0x6e4b('0x2b')](function(_0x3b86ca){if(_0x3b86ca&&_0x3b86ca[_0x6e4b('0x45')][0x0][_0x6e4b('0x51')]===_0x6e4b('0x52')){logger[_0x6e4b('0x33')](_0x6e4b('0x75'));return{'id':_0x3b86ca[_0x6e4b('0x45')][0x0]['details']['id']};}})[_0x6e4b('0x2f')](function(_0x21c53e){logger['info']('err',_0x21c53e[_0x6e4b('0x32')]);console['log']('err',_0x21c53e);});}exports[_0x6e4b('0x76')]=function(_0x5e5271,_0xd01e1c,_0x52103b,_0x1a4ec6,_0x3d29d2,_0xa7f917){var _0x5114db,_0x250482,_0x1efb72;_0xa7f917[_0x6e4b('0x77')]=intUtil[_0x6e4b('0x78')](_0xa7f917[_0x6e4b('0x77')]);_0xa7f917['serverUrl']=intUtil[_0x6e4b('0x78')](_0xa7f917['serverUrl']);if(_0x3d29d2&&_0x3d29d2[_0x6e4b('0x79')]){logger[_0x6e4b('0x33')](_0x6e4b('0x7a'),_0x6e4b('0x7b'));_0xd01e1c[_0x6e4b('0x7c')]=_0xa7f917[_0x6e4b('0x7d')]+'/api/voice/recordings/'+_0xd01e1c[_0x6e4b('0x7e')]+'/downloads?type=uniqueid&token='+md5(_0xd01e1c[_0x6e4b('0x7e')]);}else{_0xd01e1c[_0x6e4b('0x7c')]='';}var _0x175f56=_0xa7f917[_0x6e4b('0x77')]===_0x6e4b('0x7f')?'eu':_0x6e4b('0x80');return getAccessToken(_0xa7f917)[_0x6e4b('0x2b')](function(_0x2182a1){_0x1efb72=_0x2182a1;return getUser(_0x1efb72,_0x175f56,_0xa7f917,_0x1a4ec6[_0x6e4b('0x3c')]);})[_0x6e4b('0x2b')](function(_0x130b7e){_0x5114db=_0x130b7e;logger[_0x6e4b('0x33')](_0x6e4b('0x81'),_0x5114db['id']);return getEndUser(_0x1efb72,_0x175f56,_0xa7f917,_0xd01e1c[_0x6e4b('0x82')],_0xd01e1c[_0x6e4b('0x83')],_0x5114db,_0x52103b);})[_0x6e4b('0x2b')](function(_0x1ada4e){_0x250482=_0x1ada4e;logger[_0x6e4b('0x33')]('The\x20Enduser\x20ID\x20is:',_0x250482['id']);return getCall(_0x1efb72,_0x175f56,_0xa7f917,_0x5114db,_0x250482,_0x52103b,_0xd01e1c,_0x6e4b('0x71'));})[_0x6e4b('0x2b')](function(_0x285691){if(_0x285691){logger[_0x6e4b('0x33')](_0x6e4b('0x84'),_0x285691['id']);logger[_0x6e4b('0x33')](_0x6e4b('0x7a'),_0x6e4b('0x85'));emit(util[_0x6e4b('0x36')](_0x6e4b('0x86'),_0x1a4ec6[_0x6e4b('0x1a')]),_0x6e4b('0x87'),{'uri':_0x6e4b('0x88')+_0xa7f917[_0x6e4b('0x77')]+_0x6e4b('0x89')+_0x285691['id']});}})[_0x6e4b('0x2f')](function(_0x2ffca1){logger['error'](_0x6e4b('0x7a'),JSON['stringify'](_0x2ffca1));});};exports[_0x6e4b('0x8a')]=function(_0x4b0a3d,_0x49395b,_0x2f0d5e,_0x20546e,_0x341095,_0x1be639,_0x20a405){var _0x12868c,_0x48bec6,_0x1fb187;_0x1be639[_0x6e4b('0x77')]=intUtil['stripTrailingSlash'](_0x1be639[_0x6e4b('0x77')]);_0x1be639[_0x6e4b('0x7d')]=intUtil[_0x6e4b('0x78')](_0x1be639[_0x6e4b('0x7d')]);if(_0x20a405&&_0x20a405[_0x6e4b('0x8b')]&&_0x20a405[_0x6e4b('0x8b')]!=='none'){logger['info'](_0x6e4b('0x8c'),'Recording\x20is\x20enabled!');_0x49395b[_0x6e4b('0x7c')]=_0x1be639[_0x6e4b('0x7d')]+_0x6e4b('0x8d')+_0x49395b[_0x6e4b('0x7e')]+_0x6e4b('0x8e')+md5(_0x49395b[_0x6e4b('0x7e')]);}var _0x1cde1d=_0x1be639[_0x6e4b('0x77')]===_0x6e4b('0x7f')?'eu':_0x6e4b('0x80');return getAccessToken(_0x1be639)[_0x6e4b('0x2b')](function(_0x1277c9){_0x1fb187=_0x1277c9;return getUser(_0x1fb187,_0x1cde1d,_0x1be639,_0x20546e[_0x6e4b('0x3c')]);})[_0x6e4b('0x2b')](function(_0x25f6c2){_0x12868c=_0x25f6c2;logger['info'](_0x6e4b('0x81'),_0x12868c['id']);return getEndUser(_0x1fb187,_0x1cde1d,_0x1be639,_0x49395b[_0x6e4b('0x8f')],_0x49395b[_0x6e4b('0x90')],_0x12868c,_0x2f0d5e);})[_0x6e4b('0x2b')](function(_0x7b4db2){_0x48bec6=_0x7b4db2;logger[_0x6e4b('0x33')](_0x6e4b('0x91'),_0x48bec6['id']);return getCall(_0x1fb187,_0x1cde1d,_0x1be639,_0x12868c,_0x48bec6,_0x2f0d5e,_0x49395b,'Outbound');})[_0x6e4b('0x2b')](function(_0x3a348e){if(_0x3a348e){logger['info'](_0x6e4b('0x84'),_0x3a348e['id']);logger[_0x6e4b('0x33')](_0x6e4b('0x8c'),'Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format']('user:%s',_0x20546e['name']),_0x6e4b('0x87'),{'uri':_0x6e4b('0x88')+_0x1be639[_0x6e4b('0x77')]+_0x6e4b('0x89')+_0x3a348e['id']});}})['catch'](function(_0x26a77d){logger[_0x6e4b('0x30')](_0x6e4b('0x8c'),JSON[_0x6e4b('0xe')](_0x26a77d));});};exports[_0x6e4b('0x6c')]=function(_0x49c51b,_0x169e43,_0x31c1c7,_0x27d98c,_0x4b7622,_0x316852){var _0x2b8f3f,_0x4a5f1c,_0x1bd836;_0x316852[_0x6e4b('0x77')]=intUtil['stripTrailingSlash'](_0x316852['host']);_0x316852[_0x6e4b('0x7d')]=intUtil['stripTrailingSlash'](_0x316852[_0x6e4b('0x7d')]);if(_0x4b7622&&_0x4b7622[_0x6e4b('0x79')]){logger['info'](_0x6e4b('0x92'),_0x6e4b('0x7b'));_0x169e43['recordingURL']=_0x316852['serverUrl']+_0x6e4b('0x8d')+_0x169e43[_0x6e4b('0x7e')]+_0x6e4b('0x8e')+md5(_0x169e43[_0x6e4b('0x7e')]);}else{_0x169e43[_0x6e4b('0x7c')]='';}var _0x408765=_0x316852[_0x6e4b('0x77')]===_0x6e4b('0x7f')?'eu':'com';return getAccessToken(_0x316852)['then'](function(_0x149580){_0x1bd836=_0x149580;return getUser(_0x1bd836,_0x408765,_0x316852);})[_0x6e4b('0x2b')](function(_0x1a96d4){_0x2b8f3f=_0x1a96d4;logger['info']('The\x20User\x20ID\x20is:',_0x2b8f3f['id']);return getEndUser(_0x1bd836,_0x408765,_0x316852,_0x169e43[_0x6e4b('0x82')],_0x169e43['calleridnum'],_0x2b8f3f,_0x31c1c7);})['then'](function(_0x5d7d20){_0x4a5f1c=_0x5d7d20;logger[_0x6e4b('0x33')]('The\x20Enduser\x20ID\x20is:',_0x4a5f1c['id']);return getCall(_0x1bd836,_0x408765,_0x316852,_0x2b8f3f,_0x4a5f1c,_0x31c1c7,_0x169e43,'Inbound');})[_0x6e4b('0x2b')](function(_0xcf26e4){if(_0xcf26e4){logger['info'](_0x6e4b('0x84'),_0xcf26e4['id']);}})[_0x6e4b('0x2f')](function(_0x4d268a){logger[_0x6e4b('0x30')](_0x6e4b('0x92'),JSON['stringify'](_0x4d268a));});}; \ 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 b4205ea..630348d 100644 --- a/server/services/ami/trigger/script/index.js +++ b/server/services/ami/trigger/script/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['mustache','trigger','exec','data2','Script','data3','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','info','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','util','shelljs'];(function(_0x367eff,_0x288c19){var _0x433875=function(_0x4c372){while(--_0x4c372){_0x367eff['push'](_0x367eff['shift']());}};_0x433875(++_0x288c19);}(_0x7a54,0x106));var _0x47a5=function(_0x507394,_0x47d36a){_0x507394=_0x507394-0x0;var _0x695625=_0x7a54[_0x507394];return _0x695625;};'use strict';var util=require(_0x47a5('0x0'));var sh=require(_0x47a5('0x1'));var Mustache=require(_0x47a5('0x2'));var logger=require('../../../../config/logger')(_0x47a5('0x3'));exports[_0x47a5('0x4')]=function(_0x4880bf,_0x5f7f12){var _0x11bf85=_0x4880bf[_0x47a5('0x5')]?_0x4880bf[_0x47a5('0x5')]:_0x47a5('0x6');var _0x545a97=_0x4880bf[_0x47a5('0x7')]?Mustache['render'](_0x4880bf[_0x47a5('0x7')],_0x5f7f12):_0x5f7f12;sh[_0x47a5('0x4')](_0x545a97,function(_0x506eda,_0x194fb0,_0x5077f3){if(_0x506eda!==0x0){logger['error'](util['format'](_0x47a5('0x8'),_0x11bf85,_0x545a97,_0x506eda,_0x5077f3));}else{logger[_0x47a5('0x9')](util['format'](_0x47a5('0xa'),_0x11bf85,_0x545a97,_0x194fb0));}});}; \ No newline at end of file +var _0x7a54=['mustache','trigger','exec','data2','Script','data3','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','info','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','util','shelljs'];(function(_0x39619a,_0x3827b8){var _0x37a627=function(_0x52fc78){while(--_0x52fc78){_0x39619a['push'](_0x39619a['shift']());}};_0x37a627(++_0x3827b8);}(_0x7a54,0x106));var _0x47a5=function(_0x5b6c29,_0xfadbb3){_0x5b6c29=_0x5b6c29-0x0;var _0x30e828=_0x7a54[_0x5b6c29];return _0x30e828;};'use strict';var util=require(_0x47a5('0x0'));var sh=require(_0x47a5('0x1'));var Mustache=require(_0x47a5('0x2'));var logger=require('../../../../config/logger')(_0x47a5('0x3'));exports[_0x47a5('0x4')]=function(_0x4880bf,_0x5f7f12){var _0x11bf85=_0x4880bf[_0x47a5('0x5')]?_0x4880bf[_0x47a5('0x5')]:_0x47a5('0x6');var _0x545a97=_0x4880bf[_0x47a5('0x7')]?Mustache['render'](_0x4880bf[_0x47a5('0x7')],_0x5f7f12):_0x5f7f12;sh[_0x47a5('0x4')](_0x545a97,function(_0x506eda,_0x194fb0,_0x5077f3){if(_0x506eda!==0x0){logger['error'](util['format'](_0x47a5('0x8'),_0x11bf85,_0x545a97,_0x506eda,_0x5077f3));}else{logger[_0x47a5('0x9')](util['format'](_0x47a5('0xa'),_0x11bf85,_0x545a97,_0x194fb0));}});}; \ No newline at end of file diff --git a/server/services/ami/trigger/urlforward/index.js b/server/services/ami/trigger/urlforward/index.js index b152030..3a2ab03 100644 --- a/server/services/ami/trigger/urlforward/index.js +++ b/server/services/ami/trigger/urlforward/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['data6','parse','stack','data1','GET','DELETE','POST','PUT','render','data7','body','error','info','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','then',',\x20request\x20body:\x20','object','stringify','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','statusCode','name','request-promise','util','lodash','../../../../config/logger','trigger','toUpperCase','data2','data5'];(function(_0x4aaae3,_0x3a9787){var _0x3e0ffa=function(_0x1a5811){while(--_0x1a5811){_0x4aaae3['push'](_0x4aaae3['shift']());}};_0x3e0ffa(++_0x3a9787);}(_0x7a54,0x106));var _0x47a5=function(_0x4ccfa1,_0xc50e4){_0x4ccfa1=_0x4ccfa1-0x0;var _0x36f74f=_0x7a54[_0x4ccfa1];return _0x36f74f;};'use strict';var rp=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var _=require(_0x47a5('0x2'));var Mustache=require('mustache');var logger=require(_0x47a5('0x3'))(_0x47a5('0x4'));exports['exec']=function(_0x5f7f12,_0x11bf85){var _0x2a1a7e,_0x3717e1;var _0xfdf934={'method':_0x5f7f12['data1'][_0x47a5('0x5')](),'uri':Mustache['render'](_0x5f7f12[_0x47a5('0x6')],_0x11bf85),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x5f7f12[_0x47a5('0x7')])==='number'&&parseInt(_0x5f7f12[_0x47a5('0x7')])>=0x3e8&&parseInt(_0x5f7f12['data5'])<=0x2710?parseInt(_0x5f7f12['data5']):0x1388};try{_0xfdf934['headers']=_0x5f7f12[_0x47a5('0x8')]?JSON[_0x47a5('0x9')](Mustache['render'](_0x5f7f12[_0x47a5('0x8')],_0x11bf85)):{};}catch(_0x49e844){logger['error'](_0x49e844[_0x47a5('0xa')]);}switch(_0x5f7f12[_0x47a5('0xb')][_0x47a5('0x5')]()){case _0x47a5('0xc'):case _0x47a5('0xd'):_0x2a1a7e=null;_0xfdf934['qs']=_0x11bf85;break;case _0x47a5('0xe'):case _0x47a5('0xf'):if(_0x5f7f12['data7']){try{_0x2a1a7e=JSON[_0x47a5('0x9')](Mustache[_0x47a5('0x10')](_0x5f7f12[_0x47a5('0x11')],_0x11bf85));_0xfdf934[_0x47a5('0x12')]=_0x2a1a7e;}catch(_0x139f25){logger[_0x47a5('0x13')](_0x139f25[_0x47a5('0xa')]);logger[_0x47a5('0x13')]('body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format');}}else{_0x2a1a7e=_0x11bf85;_0xfdf934[_0x47a5('0x12')]=_0x2a1a7e;}break;}logger[_0x47a5('0x14')](util[_0x47a5('0x15')](_0x47a5('0x16'),_0x5f7f12[_0x47a5('0xb')],_0x5f7f12['data2'],JSON['stringify'](_0xfdf934)));rp(_0xfdf934)[_0x47a5('0x17')](function(_0x4b966e){_0x2a1a7e=!_['isNil'](_0x2a1a7e)?_0x47a5('0x18')+_0x2a1a7e:'';_0x3717e1=typeof _0x4b966e[_0x47a5('0x12')]===_0x47a5('0x19')?JSON[_0x47a5('0x1a')](_0x4b966e[_0x47a5('0x12')]):_0x4b966e[_0x47a5('0x12')];logger[_0x47a5('0x14')](util[_0x47a5('0x15')](_0x47a5('0x1b'),_0x5f7f12['data1'],_0x5f7f12[_0x47a5('0x6')],_0x4b966e[_0x47a5('0x1c')],_0x3717e1));})['catch'](function(_0x2b0360){logger[_0x47a5('0x13')](util[_0x47a5('0x15')]('%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s',_0x5f7f12[_0x47a5('0xb')],_0x5f7f12[_0x47a5('0x6')],_0x2b0360[_0x47a5('0x1c')],_0x2b0360[_0x47a5('0x1d')],_0x2b0360['message']));});}; \ No newline at end of file +var _0x7a54=['data6','parse','stack','data1','GET','DELETE','POST','PUT','render','data7','body','error','info','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','then',',\x20request\x20body:\x20','object','stringify','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','statusCode','name','request-promise','util','lodash','../../../../config/logger','trigger','toUpperCase','data2','data5'];(function(_0x491478,_0x470205){var _0x2f1bd3=function(_0xa1a990){while(--_0xa1a990){_0x491478['push'](_0x491478['shift']());}};_0x2f1bd3(++_0x470205);}(_0x7a54,0x106));var _0x47a5=function(_0x1b8a07,_0x3bcea4){_0x1b8a07=_0x1b8a07-0x0;var _0x5a2202=_0x7a54[_0x1b8a07];return _0x5a2202;};'use strict';var rp=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var _=require(_0x47a5('0x2'));var Mustache=require('mustache');var logger=require(_0x47a5('0x3'))(_0x47a5('0x4'));exports['exec']=function(_0x5f7f12,_0x11bf85){var _0x2a1a7e,_0x3717e1;var _0xfdf934={'method':_0x5f7f12['data1'][_0x47a5('0x5')](),'uri':Mustache['render'](_0x5f7f12[_0x47a5('0x6')],_0x11bf85),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x5f7f12[_0x47a5('0x7')])==='number'&&parseInt(_0x5f7f12[_0x47a5('0x7')])>=0x3e8&&parseInt(_0x5f7f12['data5'])<=0x2710?parseInt(_0x5f7f12['data5']):0x1388};try{_0xfdf934['headers']=_0x5f7f12[_0x47a5('0x8')]?JSON[_0x47a5('0x9')](Mustache['render'](_0x5f7f12[_0x47a5('0x8')],_0x11bf85)):{};}catch(_0x49e844){logger['error'](_0x49e844[_0x47a5('0xa')]);}switch(_0x5f7f12[_0x47a5('0xb')][_0x47a5('0x5')]()){case _0x47a5('0xc'):case _0x47a5('0xd'):_0x2a1a7e=null;_0xfdf934['qs']=_0x11bf85;break;case _0x47a5('0xe'):case _0x47a5('0xf'):if(_0x5f7f12['data7']){try{_0x2a1a7e=JSON[_0x47a5('0x9')](Mustache[_0x47a5('0x10')](_0x5f7f12[_0x47a5('0x11')],_0x11bf85));_0xfdf934[_0x47a5('0x12')]=_0x2a1a7e;}catch(_0x139f25){logger[_0x47a5('0x13')](_0x139f25[_0x47a5('0xa')]);logger[_0x47a5('0x13')]('body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format');}}else{_0x2a1a7e=_0x11bf85;_0xfdf934[_0x47a5('0x12')]=_0x2a1a7e;}break;}logger[_0x47a5('0x14')](util[_0x47a5('0x15')](_0x47a5('0x16'),_0x5f7f12[_0x47a5('0xb')],_0x5f7f12['data2'],JSON['stringify'](_0xfdf934)));rp(_0xfdf934)[_0x47a5('0x17')](function(_0x4b966e){_0x2a1a7e=!_['isNil'](_0x2a1a7e)?_0x47a5('0x18')+_0x2a1a7e:'';_0x3717e1=typeof _0x4b966e[_0x47a5('0x12')]===_0x47a5('0x19')?JSON[_0x47a5('0x1a')](_0x4b966e[_0x47a5('0x12')]):_0x4b966e[_0x47a5('0x12')];logger[_0x47a5('0x14')](util[_0x47a5('0x15')](_0x47a5('0x1b'),_0x5f7f12['data1'],_0x5f7f12[_0x47a5('0x6')],_0x4b966e[_0x47a5('0x1c')],_0x3717e1));})['catch'](function(_0x2b0360){logger[_0x47a5('0x13')](util[_0x47a5('0x15')]('%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s',_0x5f7f12[_0x47a5('0xb')],_0x5f7f12[_0x47a5('0x6')],_0x2b0360[_0x47a5('0x1c')],_0x2b0360[_0x47a5('0x1d')],_0x2b0360['message']));});}; \ No newline at end of file diff --git a/server/services/email/client.js b/server/services/email/client.js index cf683d5..168ab7d 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 _0xac21=['catch','exports','bluebird','../../config/logger','client','Request','request','then','debug','rpc','routing','error','message'];(function(_0x4d66e9,_0x57167f){var _0x45088d=function(_0x178785){while(--_0x178785){_0x4d66e9['push'](_0x4d66e9['shift']());}};_0x45088d(++_0x57167f);}(_0xac21,0x1af));var _0x1ac2=function(_0x2aedfa,_0x2a39a8){_0x2aedfa=_0x2aedfa-0x0;var _0x6117c1=_0xac21[_0x2aedfa];return _0x6117c1;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0x1ac2('0x0'));var logger=require(_0x1ac2('0x1'))('routing');var client=jayson[_0x1ac2('0x2')]['http']({'port':0x2329});client[_0x1ac2('0x3')]=function(_0x15bc3f,_0x5b81be){return new BPromise(function(_0x454461,_0x4efe94){return client[_0x1ac2('0x4')](_0x15bc3f,_0x5b81be)[_0x1ac2('0x5')](function(_0x2c4cf2){logger[_0x1ac2('0x6')](_0x1ac2('0x7'),_0x1ac2('0x8'),_0x15bc3f,_0x5b81be,_0x2c4cf2);if(_0x2c4cf2[_0x1ac2('0x9')]){logger['error'](_0x1ac2('0x7'),_0x1ac2('0x8'),_0x15bc3f,_0x2c4cf2[_0x1ac2('0x9')][_0x1ac2('0xa')],_0x5b81be);return _0x4efe94(_0x2c4cf2[_0x1ac2('0x9')][_0x1ac2('0xa')]);}else{return _0x454461(_0x2c4cf2['result']);}})[_0x1ac2('0xb')](function(_0x332398){logger[_0x1ac2('0x9')](_0x1ac2('0x7'),_0x1ac2('0x8'),_0x15bc3f,_0x332398,_0x5b81be);return _0x4efe94(_0x332398);});});};module[_0x1ac2('0xc')]=client; \ No newline at end of file +var _0x984b=['http','then','rpc','error','message','result','catch','exports','routing','client'];(function(_0x305678,_0x2043e7){var _0x29e3db=function(_0x167a88){while(--_0x167a88){_0x305678['push'](_0x305678['shift']());}};_0x29e3db(++_0x2043e7);}(_0x984b,0xee));var _0xb984=function(_0x3d693,_0x3c05ed){_0x3d693=_0x3d693-0x0;var _0x39ad3e=_0x984b[_0x3d693];return _0x39ad3e;};'use strict';var jayson=require('jayson/promise');var BPromise=require('bluebird');var logger=require('../../config/logger')(_0xb984('0x0'));var client=jayson[_0xb984('0x1')][_0xb984('0x2')]({'port':0x2329});client['Request']=function(_0x59ea63,_0x8384b0){return new BPromise(function(_0x340f2c,_0x4d8f6a){return client['request'](_0x59ea63,_0x8384b0)[_0xb984('0x3')](function(_0x46c541){logger['debug'](_0xb984('0x4'),_0xb984('0x0'),_0x59ea63,_0x8384b0,_0x46c541);if(_0x46c541['error']){logger[_0xb984('0x5')]('rpc',_0xb984('0x0'),_0x59ea63,_0x46c541[_0xb984('0x5')][_0xb984('0x6')],_0x8384b0);return _0x4d8f6a(_0x46c541[_0xb984('0x5')][_0xb984('0x6')]);}else{return _0x340f2c(_0x46c541[_0xb984('0x7')]);}})[_0xb984('0x8')](function(_0xfca315){logger[_0xb984('0x5')](_0xb984('0x4'),_0xb984('0x0'),_0x59ea63,_0xfca315,_0x8384b0);return _0x4d8f6a(_0xfca315);});});};module[_0xb984('0x9')]=client; \ No newline at end of file diff --git a/server/services/email/index.js b/server/services/email/index.js index 6645be1..68b7e71 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 _0x7edb=['initMailAccounts','refresh','mailAccounts','listen','Setting','loginMailFrequency','catch','log','./server','./realtime','./lib/email','./rpc/mailAccount','../../mysqldb','then'];(function(_0x3083b4,_0x5aa2fd){var _0x5ace05=function(_0x49796d){while(--_0x49796d){_0x3083b4['push'](_0x3083b4['shift']());}};_0x5ace05(++_0x5aa2fd);}(_0x7edb,0x158));var _0xb7ed=function(_0x117291,_0x3f5359){_0x117291=_0x117291-0x0;var _0xc2ad51=_0x7edb[_0x117291];return _0xc2ad51;};'use strict';var BPromise=require('bluebird');var server=require(_0xb7ed('0x0'));var Realtime=require(_0xb7ed('0x1'));var EmailChannel=require(_0xb7ed('0x2'));var mailAccount=require(_0xb7ed('0x3'));var realtime=new Realtime();var email=new EmailChannel(realtime);var db=require(_0xb7ed('0x4'))['db'];function initRealtime(){return BPromise['resolve']()[_0xb7ed('0x5')](mailAccount['getMailAccounts']())['then'](realtime[_0xb7ed('0x6')]())[_0xb7ed('0x5')](function(){email[_0xb7ed('0x7')](realtime[_0xb7ed('0x8')]);return realtime;});}function main(){return server[_0xb7ed('0x9')](realtime,email)[_0xb7ed('0x5')](function(_0xac7ffe){return initRealtime();})[_0xb7ed('0x5')](function(_0x3aee5b){return db[_0xb7ed('0xa')]['findOne']({'attributes':['id',_0xb7ed('0xb')],'raw':!![]});})[_0xb7ed('0x5')](function(_0x183666){return setInterval(initRealtime,_0x183666[_0xb7ed('0xb')]*0x3e8);})[_0xb7ed('0xc')](function(_0x4104bb){console[_0xb7ed('0xd')](_0x4104bb);});}main(); \ No newline at end of file +var _0x5fd1=['bluebird','./realtime','./lib/email','./rpc/mailAccount','then','getMailAccounts','refresh','mailAccounts','listen','Setting','loginMailFrequency'];(function(_0x568ffb,_0x4fcb7a){var _0x1ed2dd=function(_0x2b5a03){while(--_0x2b5a03){_0x568ffb['push'](_0x568ffb['shift']());}};_0x1ed2dd(++_0x4fcb7a);}(_0x5fd1,0x155));var _0x15fd=function(_0x405e50,_0x5f2283){_0x405e50=_0x405e50-0x0;var _0x3f6ef6=_0x5fd1[_0x405e50];return _0x3f6ef6;};'use strict';var BPromise=require(_0x15fd('0x0'));var server=require('./server');var Realtime=require(_0x15fd('0x1'));var EmailChannel=require(_0x15fd('0x2'));var mailAccount=require(_0x15fd('0x3'));var realtime=new Realtime();var email=new EmailChannel(realtime);var db=require('../../mysqldb')['db'];function initRealtime(){return BPromise['resolve']()[_0x15fd('0x4')](mailAccount[_0x15fd('0x5')]())[_0x15fd('0x4')](realtime['initMailAccounts']())[_0x15fd('0x4')](function(){email[_0x15fd('0x6')](realtime[_0x15fd('0x7')]);return realtime;});}function main(){return server[_0x15fd('0x8')](realtime,email)[_0x15fd('0x4')](function(_0x534e63){return initRealtime();})[_0x15fd('0x4')](function(_0x1ee117){return db[_0x15fd('0x9')]['findOne']({'attributes':['id',_0x15fd('0xa')],'raw':!![]});})['then'](function(_0x3dfdbb){return setInterval(initRealtime,_0x3dfdbb[_0x15fd('0xa')]*0x3e8);})['catch'](function(_0x4883fd){console['log'](_0x4883fd);});}main(); \ No newline at end of file diff --git a/server/services/email/lib/email.js b/server/services/email/lib/email.js index e9293e1..264729c 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 _0xf55d=['name','messages','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','from','notify','Mail\x20accepted\x20from\x20routing','catch','Mail\x20not\x20accepted\x20from\x20routing\x20%s','sendMail','send','verifySmtp','Smtp','verify','then','moment','bluebird','md5','../../../config/environment','redis','defaults','localhost','./imap','./smtp','../rpc/mailAccount','info','start\x20email\x20channel','mailAccounts','imapAccounts','smtp','prototype','emit','key','active','Imap','messageStatus','total','stringify','mailAccount:update','hasOwnProperty','email','box','bind','handleImapEmail','end','handleImapEnd','error','handleImapError','isNil','status','disabled','handleImapBox','connected'];(function(_0x23e7c1,_0x35110c){var _0x1add43=function(_0x238918){while(--_0x238918){_0x23e7c1['push'](_0x23e7c1['shift']());}};_0x1add43(++_0x35110c);}(_0xf55d,0x146));var _0xdf55=function(_0x451a76,_0x52bc31){_0x451a76=_0x451a76-0x0;var _0x11330b=_0xf55d[_0x451a76];return _0x11330b;};'use strict';var _=require('lodash');var moment=require(_0xdf55('0x0'));var BPromise=require(_0xdf55('0x1'));var md5=require(_0xdf55('0x2'));var Redis=require('ioredis');var config=require(_0xdf55('0x3'));var logger=require('../../../config/logger')('email');config[_0xdf55('0x4')]=_[_0xdf55('0x5')](config[_0xdf55('0x4')],{'host':_0xdf55('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var EmailImap=require(_0xdf55('0x7'));var EmailSmtp=require(_0xdf55('0x8'));var mailAccount=require(_0xdf55('0x9'));var md5Accounts={};function EmailChannel(_0x19c2d6){logger[_0xdf55('0xa')](_0xdf55('0xb'));this[_0xdf55('0xc')]=_0x19c2d6[_0xdf55('0xc')];this[_0xdf55('0xd')]={};this[_0xdf55('0xe')]=new EmailSmtp();}EmailChannel[_0xdf55('0xf')][_0xdf55('0x10')]=function(_0x585c71){var _0x49cd51=this[_0xdf55('0xc')][_0x585c71];var _0x22b874={'id':_0x49cd51['id'],'name':_0x49cd51['name'],'key':_0x49cd51[_0xdf55('0x11')],'active':_0x49cd51[_0xdf55('0x12')],'Imap':{'status':_0x49cd51[_0xdf55('0x13')]['status'],'messageStatus':_0x49cd51[_0xdf55('0x13')][_0xdf55('0x14')],'total':_0x49cd51['Imap'][_0xdf55('0x15')]}};if(_['isNil'](md5Accounts[_0x585c71])){md5Accounts[_0x585c71]={};}var _0x2c2597=md5(JSON[_0xdf55('0x16')](_0x22b874));if(md5Accounts[_0x585c71][_0xdf55('0x2')]!==_0x2c2597){md5Accounts[_0x585c71][_0xdf55('0x2')]=_0x2c2597;io[_0xdf55('0x10')](_0xdf55('0x17'),_0x22b874);}};EmailChannel[_0xdf55('0xf')]['refresh']=function(_0x1e4bbb){for(var _0x5c54e3 in _0x1e4bbb){if(_0x1e4bbb[_0xdf55('0x18')](_0x5c54e3)){if(_0x1e4bbb[_0x5c54e3][_0xdf55('0x13')]&&_0x1e4bbb[_0x5c54e3][_0xdf55('0x12')]){var _0x21582d=_0x1e4bbb[_0x5c54e3][_0xdf55('0x13')];if(!this[_0xdf55('0xd')][_0xdf55('0x18')](_0x21582d['id'])){this[_0xdf55('0xd')][_0x21582d['id']]=new EmailImap(_0x21582d,_0x1e4bbb[_0x5c54e3][_0xdf55('0x19')]);this['imapAccounts'][_0x21582d['id']]['on'](_0xdf55('0x1a'),this['handleImapBox'][_0xdf55('0x1b')](this,_0x5c54e3));this[_0xdf55('0xd')][_0x21582d['id']]['on'](_0xdf55('0x19'),this[_0xdf55('0x1c')][_0xdf55('0x1b')](this,_0x5c54e3));this['imapAccounts'][_0x21582d['id']]['on'](_0xdf55('0x1d'),this[_0xdf55('0x1e')][_0xdf55('0x1b')](this,_0x5c54e3));this[_0xdf55('0xd')][_0x21582d['id']]['on'](_0xdf55('0x1f'),this[_0xdf55('0x20')][_0xdf55('0x1b')](this,_0x5c54e3));}}else{if(_[_0xdf55('0x21')](this[_0xdf55('0xc')][_0x5c54e3][_0xdf55('0x13')])){this['mailAccounts'][_0x5c54e3][_0xdf55('0x13')]={};}this[_0xdf55('0xc')][_0x5c54e3]['Imap'][_0xdf55('0x22')]=_0xdf55('0x23');this[_0xdf55('0xc')][_0x5c54e3]['Imap'][_0xdf55('0x14')]='';this['emit'](_0x5c54e3);}}}};EmailChannel[_0xdf55('0xf')][_0xdf55('0x24')]=function(_0x240410,_0x381693){if(this[_0xdf55('0xc')][_0x240410]){this[_0xdf55('0xc')][_0x240410][_0xdf55('0x13')][_0xdf55('0x22')]=_0xdf55('0x25');this[_0xdf55('0xc')][_0x240410][_0xdf55('0x13')][_0xdf55('0x14')]=_0x381693[_0xdf55('0x26')];if(_0x381693[_0xdf55('0x27')]){this[_0xdf55('0xc')][_0x240410][_0xdf55('0x13')][_0xdf55('0x15')]=_0x381693['messages'][_0xdf55('0x15')];}return this[_0xdf55('0x10')](_0x240410);}};EmailChannel[_0xdf55('0xf')][_0xdf55('0x1c')]=function(_0x53f09f,_0x5e6d4){logger[_0xdf55('0xa')](_0xdf55('0x28'),_0x5e6d4['firstName'],_0x5e6d4['lastName'],_0x5e6d4[_0xdf55('0x29')],_0x53f09f);if(this[_0xdf55('0xc')][_0x53f09f]){return mailAccount[_0xdf55('0x2a')](_0x53f09f,_0x5e6d4)['then'](function(_0x3eddd1){if(_0x3eddd1){logger[_0xdf55('0xa')](_0xdf55('0x2b'));}})[_0xdf55('0x2c')](function(_0x48d558){logger[_0xdf55('0x1f')](_0xdf55('0x2d'),JSON[_0xdf55('0x16')](_0x48d558));});}};EmailChannel[_0xdf55('0xf')]['handleImapEnd']=function(_0x130b44){if(this[_0xdf55('0xc')][_0x130b44]&&this[_0xdf55('0xc')][_0x130b44][_0xdf55('0x13')]){if(this[_0xdf55('0xd')][this[_0xdf55('0xc')][_0x130b44][_0xdf55('0x13')]['id']]){delete this['imapAccounts'][this[_0xdf55('0xc')][_0x130b44][_0xdf55('0x13')]['id']];}this[_0xdf55('0xc')][_0x130b44][_0xdf55('0x13')]['lastSync']=moment();this[_0xdf55('0x10')](_0x130b44);}};EmailChannel[_0xdf55('0xf')][_0xdf55('0x20')]=function(_0x30bd58,_0xe1ab70){if(this['mailAccounts'][_0x30bd58]){this[_0xdf55('0xc')][_0x30bd58][_0xdf55('0x13')]['status']=_0xdf55('0x1f');this[_0xdf55('0xc')][_0x30bd58][_0xdf55('0x13')][_0xdf55('0x14')]=_0xe1ab70;return this[_0xdf55('0x10')](_0x30bd58);}};EmailChannel[_0xdf55('0xf')][_0xdf55('0x2e')]=function(_0x30db43,_0x487aab){return this['smtp'][_0xdf55('0x2f')](_0x30db43,_0x487aab);};EmailChannel[_0xdf55('0xf')][_0xdf55('0x30')]=function(_0x2ca404){var _0x235a8c=this;if(this[_0xdf55('0xc')][_0x2ca404['id']]){if(_[_0xdf55('0x21')](this[_0xdf55('0xc')][_0x2ca404['id']][_0xdf55('0x31')])){this[_0xdf55('0xc')][_0x2ca404['id']]['Smtp']={};}this[_0xdf55('0xc')][_0x2ca404['id']][_0xdf55('0x31')]['lastSync']=moment();return new BPromise(function(_0x3c8f0f,_0x54c5e2){return _0x235a8c[_0xdf55('0xe')][_0xdf55('0x32')](_0x2ca404)[_0xdf55('0x33')](function(_0x52cc0e){_0x235a8c[_0xdf55('0xc')][_0x2ca404['id']]['Smtp'][_0xdf55('0x22')]='verified';_0x235a8c[_0xdf55('0xc')][_0x2ca404['id']][_0xdf55('0x31')][_0xdf55('0x14')]='';_0x235a8c[_0xdf55('0x10')](_0x2ca404['id']);_0x3c8f0f(_0x52cc0e);})[_0xdf55('0x2c')](function(_0x3841ba){_0x235a8c[_0xdf55('0xc')][_0x2ca404['id']]['Smtp'][_0xdf55('0x22')]=_0xdf55('0x1f');_0x235a8c[_0xdf55('0xc')][_0x2ca404['id']][_0xdf55('0x31')][_0xdf55('0x14')]=_0x3841ba;_0x235a8c['emit'](_0x2ca404['id']);_0x54c5e2(_0x3841ba);});});}return this['smtp'][_0xdf55('0x32')](_0x2ca404);};module['exports']=EmailChannel; \ No newline at end of file +var _0x1065=['moment','md5','ioredis','../../../config/environment','../../../config/logger','email','localhost','socket.io-emitter','redis','./imap','./smtp','../rpc/mailAccount','info','mailAccounts','imapAccounts','smtp','prototype','emit','name','active','status','Imap','messageStatus','total','mailAccount:update','refresh','hasOwnProperty','box','bind','handleImapEmail','end','handleImapEnd','error','handleImapError','isNil','disabled','messages','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','firstName','lastName','from','notify','then','Mail\x20accepted\x20from\x20routing','catch','stringify','verifySmtp','Smtp','verify','verified','exports','lodash'];(function(_0x20236b,_0x2f1abd){var _0x402474=function(_0x422a23){while(--_0x422a23){_0x20236b['push'](_0x20236b['shift']());}};_0x402474(++_0x2f1abd);}(_0x1065,0x137));var _0x5106=function(_0x39b333,_0x247db1){_0x39b333=_0x39b333-0x0;var _0x4d361b=_0x1065[_0x39b333];return _0x4d361b;};'use strict';var _=require(_0x5106('0x0'));var moment=require(_0x5106('0x1'));var BPromise=require('bluebird');var md5=require(_0x5106('0x2'));var Redis=require(_0x5106('0x3'));var config=require(_0x5106('0x4'));var logger=require(_0x5106('0x5'))(_0x5106('0x6'));config['redis']=_['defaults'](config['redis'],{'host':_0x5106('0x7'),'port':0x18eb});var io=require(_0x5106('0x8'))(new Redis(config[_0x5106('0x9')]));var EmailImap=require(_0x5106('0xa'));var EmailSmtp=require(_0x5106('0xb'));var mailAccount=require(_0x5106('0xc'));var md5Accounts={};function EmailChannel(_0x3539d6){logger[_0x5106('0xd')]('start\x20email\x20channel');this[_0x5106('0xe')]=_0x3539d6[_0x5106('0xe')];this[_0x5106('0xf')]={};this[_0x5106('0x10')]=new EmailSmtp();}EmailChannel[_0x5106('0x11')][_0x5106('0x12')]=function(_0x28000e){var _0x54b636=this['mailAccounts'][_0x28000e];var _0x2606fc={'id':_0x54b636['id'],'name':_0x54b636[_0x5106('0x13')],'key':_0x54b636['key'],'active':_0x54b636[_0x5106('0x14')],'Imap':{'status':_0x54b636['Imap'][_0x5106('0x15')],'messageStatus':_0x54b636[_0x5106('0x16')][_0x5106('0x17')],'total':_0x54b636['Imap'][_0x5106('0x18')]}};if(_['isNil'](md5Accounts[_0x28000e])){md5Accounts[_0x28000e]={};}var _0x50ad95=md5(JSON['stringify'](_0x2606fc));if(md5Accounts[_0x28000e][_0x5106('0x2')]!==_0x50ad95){md5Accounts[_0x28000e][_0x5106('0x2')]=_0x50ad95;io[_0x5106('0x12')](_0x5106('0x19'),_0x2606fc);}};EmailChannel[_0x5106('0x11')][_0x5106('0x1a')]=function(_0x529834){for(var _0x346677 in _0x529834){if(_0x529834[_0x5106('0x1b')](_0x346677)){if(_0x529834[_0x346677]['Imap']&&_0x529834[_0x346677][_0x5106('0x14')]){var _0x43959d=_0x529834[_0x346677]['Imap'];if(!this[_0x5106('0xf')][_0x5106('0x1b')](_0x43959d['id'])){this[_0x5106('0xf')][_0x43959d['id']]=new EmailImap(_0x43959d,_0x529834[_0x346677][_0x5106('0x6')]);this['imapAccounts'][_0x43959d['id']]['on'](_0x5106('0x1c'),this['handleImapBox'][_0x5106('0x1d')](this,_0x346677));this[_0x5106('0xf')][_0x43959d['id']]['on'](_0x5106('0x6'),this[_0x5106('0x1e')]['bind'](this,_0x346677));this['imapAccounts'][_0x43959d['id']]['on'](_0x5106('0x1f'),this[_0x5106('0x20')][_0x5106('0x1d')](this,_0x346677));this[_0x5106('0xf')][_0x43959d['id']]['on'](_0x5106('0x21'),this[_0x5106('0x22')][_0x5106('0x1d')](this,_0x346677));}}else{if(_[_0x5106('0x23')](this[_0x5106('0xe')][_0x346677][_0x5106('0x16')])){this[_0x5106('0xe')][_0x346677][_0x5106('0x16')]={};}this['mailAccounts'][_0x346677][_0x5106('0x16')][_0x5106('0x15')]=_0x5106('0x24');this['mailAccounts'][_0x346677][_0x5106('0x16')][_0x5106('0x17')]='';this[_0x5106('0x12')](_0x346677);}}}};EmailChannel[_0x5106('0x11')]['handleImapBox']=function(_0x114b3f,_0x3db6b7){if(this[_0x5106('0xe')][_0x114b3f]){this['mailAccounts'][_0x114b3f]['Imap'][_0x5106('0x15')]='connected';this[_0x5106('0xe')][_0x114b3f][_0x5106('0x16')][_0x5106('0x17')]=_0x3db6b7[_0x5106('0x13')];if(_0x3db6b7[_0x5106('0x25')]){this['mailAccounts'][_0x114b3f]['Imap']['total']=_0x3db6b7[_0x5106('0x25')][_0x5106('0x18')];}return this[_0x5106('0x12')](_0x114b3f);}};EmailChannel['prototype'][_0x5106('0x1e')]=function(_0x313012,_0x11f234){logger['info'](_0x5106('0x26'),_0x11f234[_0x5106('0x27')],_0x11f234[_0x5106('0x28')],_0x11f234[_0x5106('0x29')],_0x313012);if(this['mailAccounts'][_0x313012]){return mailAccount[_0x5106('0x2a')](_0x313012,_0x11f234)[_0x5106('0x2b')](function(_0x19532b){if(_0x19532b){logger[_0x5106('0xd')](_0x5106('0x2c'));}})[_0x5106('0x2d')](function(_0x20415b){logger[_0x5106('0x21')]('Mail\x20not\x20accepted\x20from\x20routing\x20%s',JSON[_0x5106('0x2e')](_0x20415b));});}};EmailChannel[_0x5106('0x11')][_0x5106('0x20')]=function(_0x40b209){if(this['mailAccounts'][_0x40b209]&&this[_0x5106('0xe')][_0x40b209][_0x5106('0x16')]){if(this['imapAccounts'][this['mailAccounts'][_0x40b209][_0x5106('0x16')]['id']]){delete this[_0x5106('0xf')][this[_0x5106('0xe')][_0x40b209][_0x5106('0x16')]['id']];}this[_0x5106('0xe')][_0x40b209][_0x5106('0x16')]['lastSync']=moment();this['emit'](_0x40b209);}};EmailChannel[_0x5106('0x11')][_0x5106('0x22')]=function(_0x11821c,_0x5ddbcc){if(this[_0x5106('0xe')][_0x11821c]){this['mailAccounts'][_0x11821c][_0x5106('0x16')][_0x5106('0x15')]=_0x5106('0x21');this[_0x5106('0xe')][_0x11821c][_0x5106('0x16')][_0x5106('0x17')]=_0x5ddbcc;return this[_0x5106('0x12')](_0x11821c);}};EmailChannel[_0x5106('0x11')]['sendMail']=function(_0xf19ec7,_0x41cdcd){return this[_0x5106('0x10')]['send'](_0xf19ec7,_0x41cdcd);};EmailChannel[_0x5106('0x11')][_0x5106('0x2f')]=function(_0x58b8d5){var _0x46c193=this;if(this[_0x5106('0xe')][_0x58b8d5['id']]){if(_[_0x5106('0x23')](this[_0x5106('0xe')][_0x58b8d5['id']][_0x5106('0x30')])){this[_0x5106('0xe')][_0x58b8d5['id']][_0x5106('0x30')]={};}this[_0x5106('0xe')][_0x58b8d5['id']]['Smtp']['lastSync']=moment();return new BPromise(function(_0x59fa07,_0x525c39){return _0x46c193[_0x5106('0x10')][_0x5106('0x31')](_0x58b8d5)[_0x5106('0x2b')](function(_0x29a31b){_0x46c193[_0x5106('0xe')][_0x58b8d5['id']][_0x5106('0x30')]['status']=_0x5106('0x32');_0x46c193['mailAccounts'][_0x58b8d5['id']][_0x5106('0x30')][_0x5106('0x17')]='';_0x46c193[_0x5106('0x12')](_0x58b8d5['id']);_0x59fa07(_0x29a31b);})[_0x5106('0x2d')](function(_0xcc613e){_0x46c193[_0x5106('0xe')][_0x58b8d5['id']][_0x5106('0x30')][_0x5106('0x15')]=_0x5106('0x21');_0x46c193[_0x5106('0xe')][_0x58b8d5['id']][_0x5106('0x30')][_0x5106('0x17')]=_0xcc613e;_0x46c193[_0x5106('0x12')](_0x58b8d5['id']);_0x525c39(_0xcc613e);});});}return this['smtp'][_0x5106('0x31')](_0x58b8d5);};module[_0x5106('0x33')]=EmailChannel; \ No newline at end of file diff --git a/server/services/email/lib/imap.js b/server/services/email/lib/imap.js index 53605a3..80cbbba 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 _0x4569=['handleMessageEnd','handleSimpleParser','parser','textCode','upperFirst','util','randomstring','mailparser','simpleParser','Iconv','events','EventEmitter','./utils','../../../config/logger','email','mailbox','INBOX','account','getAccount','imap','ready','handleReady','bind','end','handleEnd','error','handleError','connect','prototype','connTimeout','authTimeout','isNil','user','password','host','tls','required','service','port','anonymous@xcally.com','openBox','emit','readUnseen','search','UNSEEN','handleReadUnseen','message','once','handleFetchError','handleFetchEnd','closeBox','handleCloseBox','handleFetchMessage','handleMessageBody','handleMessageAttributes'];(function(_0x39e41c,_0x5daae7){var _0x3aa460=function(_0x48842f){while(--_0x48842f){_0x39e41c['push'](_0x39e41c['shift']());}};_0x3aa460(++_0x5daae7);}(_0x4569,0xaa));var _0x9456=function(_0x354098,_0x3cbcca){_0x354098=_0x354098-0x0;var _0x19eb37=_0x4569[_0x354098];return _0x19eb37;};'use strict';var fs=require('fs');var path=require('path');var util=require(_0x9456('0x0'));var Imap=require('imap');var _=require('lodash');var rs=require(_0x9456('0x1'));var simpleParser=require(_0x9456('0x2'))[_0x9456('0x3')];var Iconv=require('iconv')[_0x9456('0x4')];var EventEmitter=require(_0x9456('0x5'))[_0x9456('0x6')];var utils=require(_0x9456('0x7'));var logger=require(_0x9456('0x8'))(_0x9456('0x9'));function EmailImap(_0x237bab,_0x1f9309){this[_0x9456('0xa')]=_0x9456('0xb');this[_0x9456('0xc')]=this[_0x9456('0xd')](_0x237bab,_0x1f9309);this['imap']=new Imap(this['account']);this[_0x9456('0xe')]['once'](_0x9456('0xf'),this[_0x9456('0x10')][_0x9456('0x11')](this));this['imap']['once'](_0x9456('0x12'),this[_0x9456('0x13')][_0x9456('0x11')](this));this[_0x9456('0xe')]['on'](_0x9456('0x14'),this[_0x9456('0x15')][_0x9456('0x11')](this));this['imap'][_0x9456('0x16')]();}util['inherits'](EmailImap,EventEmitter);EmailImap[_0x9456('0x17')][_0x9456('0xd')]=function(_0x595c4d,_0xff5f57){var _0x464ada={'connTimeout':_0x595c4d[_0x9456('0x18')]?_0x595c4d[_0x9456('0x18')]*0x3e8:0x2710,'authTimeout':_0x595c4d[_0x9456('0x19')]?_0x595c4d[_0x9456('0x19')]*0x3e8:0x1388};if(_[_0x9456('0x1a')](_0x595c4d['service'])){if(_0x595c4d['authentication']){_0x464ada['user']=_0x595c4d[_0x9456('0x1b')];_0x464ada[_0x9456('0x1c')]=_0x595c4d[_0x9456('0x1c')];}_0x464ada[_0x9456('0x1d')]=_0x595c4d['host'];_0x464ada['port']=_0x595c4d['port']||0x3e1;if(_0x595c4d[_0x9456('0x1e')]){_0x464ada['tls']=!![];}else{_0x464ada[_0x9456('0x1e')]=![];_0x464ada['autotls']=_0x9456('0x1f');}}else{_0x464ada[_0x9456('0x1b')]=_0x595c4d['user'];_0x464ada[_0x9456('0x1c')]=_0x595c4d['password'];_0x464ada[_0x9456('0x1d')]=utils['getHost'](_0x595c4d[_0x9456('0x20')]);_0x464ada[_0x9456('0x21')]=0x3e1;_0x464ada[_0x9456('0x1e')]=!![];}_0x464ada[_0x9456('0x9')]=_0xff5f57||_0x595c4d[_0x9456('0x1b')]||_0x9456('0x22');return _0x464ada;};EmailImap[_0x9456('0x17')][_0x9456('0x10')]=function(){this[_0x9456('0xe')][_0x9456('0x23')](this[_0x9456('0xa')],![],this['handleOpenBox'][_0x9456('0x11')](this));};EmailImap[_0x9456('0x17')]['handleOpenBox']=function(_0x302e01,_0x2c1513){if(_0x302e01){this[_0x9456('0x15')](_0x302e01,!![]);}else{this[_0x9456('0x24')]('box',_0x2c1513);this['readUnseen']();}};EmailImap[_0x9456('0x17')]['handleCloseBox']=function(_0x985a1c){if(_0x985a1c){this[_0x9456('0x15')](_0x985a1c,!![]);}else{this['imap'][_0x9456('0x12')]();}};EmailImap[_0x9456('0x17')][_0x9456('0x25')]=function(){this[_0x9456('0xe')][_0x9456('0x26')]([_0x9456('0x27')],this['handleReadUnseen'][_0x9456('0x11')](this));};EmailImap[_0x9456('0x17')][_0x9456('0x28')]=function(_0x419701,_0x59d2f0){if(_0x419701){this[_0x9456('0x15')](_0x419701,!![]);}else{if(_0x59d2f0['length']){try{var _0x1130f7=this[_0x9456('0xe')]['fetch'](_0x59d2f0,{'bodies':'','markSeen':!![]});_0x1130f7['on'](_0x9456('0x29'),this['handleFetchMessage']['bind'](this));_0x1130f7[_0x9456('0x2a')]('error',this[_0x9456('0x2b')]['bind'](this));_0x1130f7[_0x9456('0x2a')](_0x9456('0x12'),this[_0x9456('0x2c')][_0x9456('0x11')](this));}catch(_0x239a66){logger[_0x9456('0x14')](_0x239a66);}}else{this[_0x9456('0xe')][_0x9456('0x2d')](!![],this[_0x9456('0x2e')][_0x9456('0x11')](this));}}};EmailImap[_0x9456('0x17')][_0x9456('0x2f')]=function(_0x4a4aca,_0x1b826c){_0x4a4aca['on']('body',this[_0x9456('0x30')][_0x9456('0x11')](this));_0x4a4aca[_0x9456('0x2a')]('attributes',this[_0x9456('0x31')][_0x9456('0x11')](this));_0x4a4aca['once'](_0x9456('0x12'),this[_0x9456('0x32')][_0x9456('0x11')](this));};EmailImap['prototype'][_0x9456('0x30')]=function(_0x21b42c,_0x6ecac4){simpleParser(_0x21b42c,{'Iconv':Iconv},this[_0x9456('0x33')]['bind'](this));};EmailImap[_0x9456('0x17')][_0x9456('0x31')]=function(_0x39f463){};EmailImap[_0x9456('0x17')][_0x9456('0x32')]=function(){};EmailImap['prototype'][_0x9456('0x33')]=function(_0x58ef4c,_0x1264f3){if(_0x58ef4c){logger[_0x9456('0x14')](_0x58ef4c);}else{var _0x591a7d=this;utils[_0x9456('0x34')](this['account'],_0x1264f3,function(_0x3658dd){_0x591a7d[_0x9456('0x24')](_0x9456('0x9'),_0x3658dd);});}};EmailImap['prototype']['handleFetchEnd']=function(){this[_0x9456('0xe')][_0x9456('0x2d')](!![],this['handleCloseBox']['bind'](this));};EmailImap[_0x9456('0x17')][_0x9456('0x2b')]=function(_0x2d84c8){this[_0x9456('0x15')](_0x2d84c8);this[_0x9456('0xe')][_0x9456('0x2d')](!![],this['handleCloseBox']['bind'](this));};EmailImap['prototype'][_0x9456('0x13')]=function(){this['emit'](_0x9456('0x12'));};EmailImap[_0x9456('0x17')][_0x9456('0x15')]=function(_0x202948,_0x3994b8){logger['error']('handleError',this[_0x9456('0xc')][_0x9456('0x9')],JSON['stringify'](_0x202948));var _0x205853='';if(_0x202948){if(_0x202948['textCode']){_0x205853=_0x202948[_0x9456('0x35')];}else{for(var _0x30c03c in _0x202948){if(_0x202948['hasOwnProperty'](_0x30c03c)){_0x205853+=_[_0x9456('0x36')](_0x30c03c)+':\x20'+_0x202948[_0x30c03c]+'\x0a';}}}}if(_0x3994b8){this[_0x9456('0xe')][_0x9456('0x12')]();}else{this['emit'](_0x9456('0x14'),_0x205853);this['emit'](_0x9456('0x12'));}};module['exports']=EmailImap; \ No newline at end of file +var _0x9da6=['INBOX','account','imap','once','ready','handleReady','bind','handleError','connect','inherits','getAccount','connTimeout','isNil','service','authentication','user','password','host','port','tls','autotls','required','getHost','anonymous@xcally.com','prototype','openBox','mailbox','handleOpenBox','emit','box','readUnseen','handleCloseBox','end','search','UNSEEN','handleReadUnseen','length','fetch','handleFetchMessage','error','handleFetchError','handleFetchEnd','body','attributes','handleSimpleParser','closeBox','handleEnd','stringify','textCode','hasOwnProperty','util','simpleParser','iconv','Iconv','events','./utils','../../../config/logger','email'];(function(_0x87506e,_0x5680ec){var _0x5496a4=function(_0x1e29ab){while(--_0x1e29ab){_0x87506e['push'](_0x87506e['shift']());}};_0x5496a4(++_0x5680ec);}(_0x9da6,0xa6));var _0x69da=function(_0x3977c4,_0x558aba){_0x3977c4=_0x3977c4-0x0;var _0x2879fb=_0x9da6[_0x3977c4];return _0x2879fb;};'use strict';var fs=require('fs');var path=require('path');var util=require(_0x69da('0x0'));var Imap=require('imap');var _=require('lodash');var rs=require('randomstring');var simpleParser=require('mailparser')[_0x69da('0x1')];var Iconv=require(_0x69da('0x2'))[_0x69da('0x3')];var EventEmitter=require(_0x69da('0x4'))['EventEmitter'];var utils=require(_0x69da('0x5'));var logger=require(_0x69da('0x6'))(_0x69da('0x7'));function EmailImap(_0x126d33,_0x22d1fb){this['mailbox']=_0x69da('0x8');this[_0x69da('0x9')]=this['getAccount'](_0x126d33,_0x22d1fb);this[_0x69da('0xa')]=new Imap(this[_0x69da('0x9')]);this[_0x69da('0xa')][_0x69da('0xb')](_0x69da('0xc'),this[_0x69da('0xd')][_0x69da('0xe')](this));this['imap'][_0x69da('0xb')]('end',this['handleEnd']['bind'](this));this[_0x69da('0xa')]['on']('error',this[_0x69da('0xf')][_0x69da('0xe')](this));this[_0x69da('0xa')][_0x69da('0x10')]();}util[_0x69da('0x11')](EmailImap,EventEmitter);EmailImap['prototype'][_0x69da('0x12')]=function(_0x500390,_0x4d9e78){var _0x5028da={'connTimeout':_0x500390[_0x69da('0x13')]?_0x500390[_0x69da('0x13')]*0x3e8:0x2710,'authTimeout':_0x500390['authTimeout']?_0x500390['authTimeout']*0x3e8:0x1388};if(_[_0x69da('0x14')](_0x500390[_0x69da('0x15')])){if(_0x500390[_0x69da('0x16')]){_0x5028da[_0x69da('0x17')]=_0x500390[_0x69da('0x17')];_0x5028da[_0x69da('0x18')]=_0x500390[_0x69da('0x18')];}_0x5028da[_0x69da('0x19')]=_0x500390['host'];_0x5028da[_0x69da('0x1a')]=_0x500390['port']||0x3e1;if(_0x500390[_0x69da('0x1b')]){_0x5028da[_0x69da('0x1b')]=!![];}else{_0x5028da[_0x69da('0x1b')]=![];_0x5028da[_0x69da('0x1c')]=_0x69da('0x1d');}}else{_0x5028da['user']=_0x500390[_0x69da('0x17')];_0x5028da[_0x69da('0x18')]=_0x500390['password'];_0x5028da[_0x69da('0x19')]=utils[_0x69da('0x1e')](_0x500390['service']);_0x5028da[_0x69da('0x1a')]=0x3e1;_0x5028da[_0x69da('0x1b')]=!![];}_0x5028da[_0x69da('0x7')]=_0x4d9e78||_0x500390[_0x69da('0x17')]||_0x69da('0x1f');return _0x5028da;};EmailImap[_0x69da('0x20')][_0x69da('0xd')]=function(){this[_0x69da('0xa')][_0x69da('0x21')](this[_0x69da('0x22')],![],this['handleOpenBox'][_0x69da('0xe')](this));};EmailImap[_0x69da('0x20')][_0x69da('0x23')]=function(_0x2e473e,_0x44223e){if(_0x2e473e){this[_0x69da('0xf')](_0x2e473e,!![]);}else{this[_0x69da('0x24')](_0x69da('0x25'),_0x44223e);this[_0x69da('0x26')]();}};EmailImap[_0x69da('0x20')][_0x69da('0x27')]=function(_0x382745){if(_0x382745){this[_0x69da('0xf')](_0x382745,!![]);}else{this[_0x69da('0xa')][_0x69da('0x28')]();}};EmailImap[_0x69da('0x20')][_0x69da('0x26')]=function(){this['imap'][_0x69da('0x29')]([_0x69da('0x2a')],this['handleReadUnseen'][_0x69da('0xe')](this));};EmailImap['prototype'][_0x69da('0x2b')]=function(_0xccd153,_0x40ab1d){if(_0xccd153){this[_0x69da('0xf')](_0xccd153,!![]);}else{if(_0x40ab1d[_0x69da('0x2c')]){try{var _0x5a5eb3=this[_0x69da('0xa')][_0x69da('0x2d')](_0x40ab1d,{'bodies':'','markSeen':!![]});_0x5a5eb3['on']('message',this[_0x69da('0x2e')][_0x69da('0xe')](this));_0x5a5eb3['once'](_0x69da('0x2f'),this[_0x69da('0x30')]['bind'](this));_0x5a5eb3[_0x69da('0xb')](_0x69da('0x28'),this[_0x69da('0x31')][_0x69da('0xe')](this));}catch(_0x156ff7){logger[_0x69da('0x2f')](_0x156ff7);}}else{this['imap']['closeBox'](!![],this[_0x69da('0x27')][_0x69da('0xe')](this));}}};EmailImap[_0x69da('0x20')]['handleFetchMessage']=function(_0x3df888,_0x316ceb){_0x3df888['on'](_0x69da('0x32'),this['handleMessageBody'][_0x69da('0xe')](this));_0x3df888['once'](_0x69da('0x33'),this['handleMessageAttributes'][_0x69da('0xe')](this));_0x3df888[_0x69da('0xb')](_0x69da('0x28'),this['handleMessageEnd'][_0x69da('0xe')](this));};EmailImap[_0x69da('0x20')]['handleMessageBody']=function(_0x568adb,_0x5c2126){simpleParser(_0x568adb,{'Iconv':Iconv},this[_0x69da('0x34')][_0x69da('0xe')](this));};EmailImap[_0x69da('0x20')]['handleMessageAttributes']=function(_0x517e4f){};EmailImap['prototype']['handleMessageEnd']=function(){};EmailImap[_0x69da('0x20')]['handleSimpleParser']=function(_0xac3791,_0x46a00f){if(_0xac3791){logger[_0x69da('0x2f')](_0xac3791);}else{var _0x1cee8e=this;utils['parser'](this[_0x69da('0x9')],_0x46a00f,function(_0x36412c){_0x1cee8e[_0x69da('0x24')](_0x69da('0x7'),_0x36412c);});}};EmailImap['prototype'][_0x69da('0x31')]=function(){this[_0x69da('0xa')][_0x69da('0x35')](!![],this[_0x69da('0x27')][_0x69da('0xe')](this));};EmailImap['prototype'][_0x69da('0x30')]=function(_0x30805e){this[_0x69da('0xf')](_0x30805e);this[_0x69da('0xa')]['closeBox'](!![],this[_0x69da('0x27')][_0x69da('0xe')](this));};EmailImap[_0x69da('0x20')][_0x69da('0x36')]=function(){this[_0x69da('0x24')](_0x69da('0x28'));};EmailImap[_0x69da('0x20')][_0x69da('0xf')]=function(_0x31cf4b,_0x3ae84e){logger[_0x69da('0x2f')](_0x69da('0xf'),this[_0x69da('0x9')]['email'],JSON[_0x69da('0x37')](_0x31cf4b));var _0x40d070='';if(_0x31cf4b){if(_0x31cf4b[_0x69da('0x38')]){_0x40d070=_0x31cf4b[_0x69da('0x38')];}else{for(var _0x304a4d in _0x31cf4b){if(_0x31cf4b[_0x69da('0x39')](_0x304a4d)){_0x40d070+=_['upperFirst'](_0x304a4d)+':\x20'+_0x31cf4b[_0x304a4d]+'\x0a';}}}}if(_0x3ae84e){this[_0x69da('0xa')][_0x69da('0x28')]();}else{this[_0x69da('0x24')](_0x69da('0x2f'),_0x40d070);this['emit'](_0x69da('0x28'));}};module['exports']=EmailImap; \ No newline at end of file diff --git a/server/services/email/lib/smtp.js b/server/services/email/lib/smtp.js index 2618338..781c923 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 _0xd75f=['nodemailer','nodemailer-plugin-inline-base64','prototype','send','createTransport','use','compile','sendMail','toString','verify','exports'];(function(_0x4fddf6,_0x252d86){var _0x1cb411=function(_0x1d5638){while(--_0x1d5638){_0x4fddf6['push'](_0x4fddf6['shift']());}};_0x1cb411(++_0x252d86);}(_0xd75f,0x129));var _0xfd75=function(_0x4bf1f9,_0x57cb75){_0x4bf1f9=_0x4bf1f9-0x0;var _0x4ce90e=_0xd75f[_0x4bf1f9];return _0x4ce90e;};'use strict';var nodemailer=require(_0xfd75('0x0'));var BPromise=require('bluebird');var inlineBase64=require(_0xfd75('0x1'));function EmailSmtp(){}EmailSmtp[_0xfd75('0x2')][_0xfd75('0x3')]=function(_0x584df1,_0x5b1e7b){return new BPromise(function(_0x256856,_0x11ba91){var _0x433f10=nodemailer[_0xfd75('0x4')](_0x584df1);_0x433f10[_0xfd75('0x5')](_0xfd75('0x6'),inlineBase64());_0x433f10[_0xfd75('0x7')](_0x5b1e7b,function(_0x330ace,_0x4b359a){if(_0x330ace){_0x11ba91(_0x330ace[_0xfd75('0x8')]());}else{_0x256856(_0x4b359a);}});});};EmailSmtp[_0xfd75('0x2')][_0xfd75('0x9')]=function(_0x4ca5ba){return new BPromise(function(_0x2689f9,_0x475cad){var _0xe2951=nodemailer[_0xfd75('0x4')](_0x4ca5ba);_0xe2951[_0xfd75('0x9')](function(_0x30a59e,_0x251ba5){if(_0x30a59e){_0x475cad(_0x30a59e['toString']());}else{if(_0x251ba5){_0x2689f9(_0x251ba5);}else{_0x475cad('Not\x20verifired');}}});});};module[_0xfd75('0xa')]=EmailSmtp; \ No newline at end of file +var _0x132b=['toString','prototype','verify','createTransport','Not\x20verifired','exports','nodemailer','bluebird','nodemailer-plugin-inline-base64','send','compile'];(function(_0x112ad7,_0x30e8ef){var _0x485052=function(_0xe5a3b6){while(--_0xe5a3b6){_0x112ad7['push'](_0x112ad7['shift']());}};_0x485052(++_0x30e8ef);}(_0x132b,0x150));var _0xb132=function(_0x5a99ab,_0x4d13cc){_0x5a99ab=_0x5a99ab-0x0;var _0xbab74a=_0x132b[_0x5a99ab];return _0xbab74a;};'use strict';var nodemailer=require(_0xb132('0x0'));var BPromise=require(_0xb132('0x1'));var inlineBase64=require(_0xb132('0x2'));function EmailSmtp(){}EmailSmtp['prototype'][_0xb132('0x3')]=function(_0x45caa2,_0x4d7c28){return new BPromise(function(_0x567b6f,_0x47fec8){var _0x382130=nodemailer['createTransport'](_0x45caa2);_0x382130['use'](_0xb132('0x4'),inlineBase64());_0x382130['sendMail'](_0x4d7c28,function(_0x19a6b4,_0x104729){if(_0x19a6b4){_0x47fec8(_0x19a6b4[_0xb132('0x5')]());}else{_0x567b6f(_0x104729);}});});};EmailSmtp[_0xb132('0x6')][_0xb132('0x7')]=function(_0x595dc8){return new BPromise(function(_0x27b8c0,_0x1a4022){var _0x46ef08=nodemailer[_0xb132('0x8')](_0x595dc8);_0x46ef08[_0xb132('0x7')](function(_0x3158b7,_0x2f0d35){if(_0x3158b7){_0x1a4022(_0x3158b7[_0xb132('0x5')]());}else{if(_0x2f0d35){_0x27b8c0(_0x2f0d35);}else{_0x1a4022(_0xb132('0x9'));}}});});};module[_0xb132('0xa')]=EmailSmtp; \ No newline at end of file diff --git a/server/services/email/lib/utils.js b/server/services/email/lib/utils.js index 3f101e9..b5bf414 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 _0x7175=['isEmpty','@xcally.com','html','test','replace','body','textAsHtml','Empty\x20message

','Attachments','Title','Data','imap.mail.yahoo.com','hotmail','outlook365','outlook.office365.com','127.0.0.1','lodash','moment','path','util','node-tnef','../../../config/logger','email','../../../config/environment','head','address','anonymous','generate','name','slice','Anonymous','split','length','pop','value'];(function(_0x2fb39f,_0x3808bd){var _0x5a3641=function(_0x44b140){while(--_0x44b140){_0x2fb39f['push'](_0x2fb39f['shift']());}};_0x5a3641(++_0x3808bd);}(_0x7175,0xe5));var _0x5717=function(_0x265773,_0x5d1b6e){_0x265773=_0x265773-0x0;var _0x4ed75d=_0x7175[_0x265773];return _0x4ed75d;};'use strict';var _=require(_0x5717('0x0'));var moment=require(_0x5717('0x1'));var random=require('randomstring');var fs=require('fs');var path=require(_0x5717('0x2'));var util=require(_0x5717('0x3'));var tnef=require(_0x5717('0x4'));var logger=require(_0x5717('0x5'))(_0x5717('0x6'));var config=require(_0x5717('0x7'));function getAddress(_0x1322d4){var _0x5bf6b7=_[_0x5717('0x8')](_0x1322d4['value']);return _0x5bf6b7&&_0x5bf6b7[_0x5717('0x9')]?_0x5bf6b7['address']:_0x5717('0xa')+random[_0x5717('0xb')](0x6)+'@xcally.com';}function getFirstName(_0x297e23){var _0x5228e1=_['head'](_0x297e23['value']);if(_0x5228e1&&_0x5228e1['name']){var _0x50d15c=_0x5228e1[_0x5717('0xc')]['split'](/\s+/);return _0x50d15c['length']?_0x50d15c[_0x5717('0xd')](0x0,-0x1)['join']('\x20'):_0x5228e1[_0x5717('0xc')];}return _0x5717('0xe');}function getLastName(_0x42e11c){var _0x4dab69=_[_0x5717('0x8')](_0x42e11c['value']);if(_0x4dab69&&_0x4dab69[_0x5717('0xc')]){var _0x14b8ee=_0x4dab69[_0x5717('0xc')][_0x5717('0xf')](/\s+/);return _0x14b8ee[_0x5717('0x10')]>0x1?_0x14b8ee[_0x5717('0x11')]():'';}return'';}function getMails(_0x14422c,_0x39aac4){var _0x177a67='';for(var _0x52ad3a=0x0;_0x52ad3a<_0x39aac4['value'][_0x5717('0x10')];_0x52ad3a+=0x1){if(_0x39aac4[_0x5717('0x12')][_0x52ad3a]['address']!==_0x14422c){if(!_[_0x5717('0x13')](_0x177a67)){_0x177a67+=',';}_0x177a67+=_0x39aac4['value'][_0x52ad3a]['name']||_0x39aac4[_0x5717('0x12')][_0x52ad3a]['address']||'';_0x177a67+='\x20<';_0x177a67+=_0x39aac4[_0x5717('0x12')][_0x52ad3a][_0x5717('0x9')]?_0x39aac4[_0x5717('0x12')][_0x52ad3a][_0x5717('0x9')]:_0x5717('0xa')+random[_0x5717('0xb')](0x6)+_0x5717('0x14');_0x177a67+='>';}}return _0x177a67;}function parseEmail(_0x3cd615,_0x1e74b1,_0x45051c){if(_0x1e74b1[_0x5717('0x15')]){var _0x27e6a8=/)<[^<]*)*<\/script>/gi;while(_0x27e6a8[_0x5717('0x16')](_0x1e74b1[_0x5717('0x15')])){_0x1e74b1['html']=_0x1e74b1[_0x5717('0x15')][_0x5717('0x17')](_0x27e6a8,'');}_0x45051c[_0x5717('0x18')]=_0x1e74b1['html'];}else{_0x45051c[_0x5717('0x18')]=_0x1e74b1[_0x5717('0x19')];}if(_0x45051c[_0x5717('0x18')]){_0x45051c[_0x5717('0x18')]=_0x45051c['body'][_0x5717('0x17')](/Empty\x20message

','Attachments','Title','Data','getHost','gmail','yahoo','imap.mail.yahoo.com','hotmail','outlook365','127.0.0.1','lodash','path','util','../../../config/logger','email','../../../config/environment','head','value','address','generate','@xcally.com','name','split','join'];(function(_0x52b589,_0x5cb893){var _0x3f1203=function(_0x59d3a7){while(--_0x59d3a7){_0x52b589['push'](_0x52b589['shift']());}};_0x3f1203(++_0x5cb893);}(_0x1d35,0xf2));var _0x51d3=function(_0x2f9e08,_0x4f503c){_0x2f9e08=_0x2f9e08-0x0;var _0x1d973a=_0x1d35[_0x2f9e08];return _0x1d973a;};'use strict';var _=require(_0x51d3('0x0'));var moment=require('moment');var random=require('randomstring');var fs=require('fs');var path=require(_0x51d3('0x1'));var util=require(_0x51d3('0x2'));var tnef=require('node-tnef');var logger=require(_0x51d3('0x3'))(_0x51d3('0x4'));var config=require(_0x51d3('0x5'));function getAddress(_0x344028){var _0x2a3e60=_[_0x51d3('0x6')](_0x344028[_0x51d3('0x7')]);return _0x2a3e60&&_0x2a3e60[_0x51d3('0x8')]?_0x2a3e60[_0x51d3('0x8')]:'anonymous'+random[_0x51d3('0x9')](0x6)+_0x51d3('0xa');}function getFirstName(_0x13b0bc){var _0x2b6585=_[_0x51d3('0x6')](_0x13b0bc[_0x51d3('0x7')]);if(_0x2b6585&&_0x2b6585[_0x51d3('0xb')]){var _0x2035c6=_0x2b6585[_0x51d3('0xb')][_0x51d3('0xc')](/\s+/);return _0x2035c6['length']?_0x2035c6['slice'](0x0,-0x1)[_0x51d3('0xd')]('\x20'):_0x2b6585['name'];}return _0x51d3('0xe');}function getLastName(_0x2d842c){var _0x55ca84=_[_0x51d3('0x6')](_0x2d842c['value']);if(_0x55ca84&&_0x55ca84[_0x51d3('0xb')]){var _0x4b8092=_0x55ca84[_0x51d3('0xb')][_0x51d3('0xc')](/\s+/);return _0x4b8092[_0x51d3('0xf')]>0x1?_0x4b8092[_0x51d3('0x10')]():'';}return'';}function getMails(_0x6e8184,_0x3601ec){var _0x252838='';for(var _0x79c6eb=0x0;_0x79c6eb<_0x3601ec[_0x51d3('0x7')][_0x51d3('0xf')];_0x79c6eb+=0x1){if(_0x3601ec[_0x51d3('0x7')][_0x79c6eb][_0x51d3('0x8')]!==_0x6e8184){if(!_['isEmpty'](_0x252838)){_0x252838+=',';}_0x252838+=_0x3601ec['value'][_0x79c6eb][_0x51d3('0xb')]||_0x3601ec[_0x51d3('0x7')][_0x79c6eb][_0x51d3('0x8')]||'';_0x252838+='\x20<';_0x252838+=_0x3601ec[_0x51d3('0x7')][_0x79c6eb][_0x51d3('0x8')]?_0x3601ec[_0x51d3('0x7')][_0x79c6eb][_0x51d3('0x8')]:_0x51d3('0x11')+random['generate'](0x6)+_0x51d3('0xa');_0x252838+='>';}}return _0x252838;}function parseEmail(_0x244da,_0x45fab6,_0x7b689e){if(_0x45fab6[_0x51d3('0x12')]){var _0x3371e1=/)<[^<]*)*<\/script>/gi;while(_0x3371e1[_0x51d3('0x13')](_0x45fab6[_0x51d3('0x12')])){_0x45fab6[_0x51d3('0x12')]=_0x45fab6[_0x51d3('0x12')][_0x51d3('0x14')](_0x3371e1,'');}_0x7b689e[_0x51d3('0x15')]=_0x45fab6['html'];}else{_0x7b689e['body']=_0x45fab6['textAsHtml'];}if(_0x7b689e[_0x51d3('0x15')]){_0x7b689e[_0x51d3('0x15')]=_0x7b689e[_0x51d3('0x15')][_0x51d3('0x14')](/0x0){if(this[_0x134c4e+_0xe9bd('0x21')]>0x0&&this[_0x134c4e+_0xe9bd('0x20')]>=this[_0x134c4e+_0xe9bd('0x21')]){return'maxcapacity';}else{return _0xe9bd('0x22');}}else{return _0xe9bd('0x23');}};Agent['prototype'][_0xe9bd('0x24')]=function(){var _0x505c23=[_0xe9bd('0x25'),_0xe9bd('0x26'),_0xe9bd('0x27'),_0xe9bd('0x28'),'sms'];for(var _0x24cf25=0x0;_0x24cf25<_0x505c23[_0xe9bd('0x29')];_0x24cf25+=0x1){var _0x2c9a57=this[_0xe9bd('0x1f')](_0x505c23[_0x24cf25]);if(this[_0x505c23[_0x24cf25]+_0xe9bd('0x2a')]!==_0x2c9a57){this[_0x505c23[_0x24cf25]+_0xe9bd('0x2b')]=_[_0xe9bd('0x2c')](moment()[_0xe9bd('0x2d')]('x'));}this[_0x505c23[_0x24cf25]+_0xe9bd('0x2a')]=_0x2c9a57;}var _0x5987af={'id':this['id'],'name':this[_0xe9bd('0x6')],'online':this[_0xe9bd('0x7')],'voicePause':this['voicePause'],'chatPause':this[_0xe9bd('0x9')],'mailPause':this[_0xe9bd('0xa')],'smsPause':this[_0xe9bd('0xc')],'faxPause':this[_0xe9bd('0xb')],'openchannelPause':this[_0xe9bd('0xd')],'chatStatus':this[_0xe9bd('0x2e')],'chatStatusTime':this['chatStatusTime'],'chatCapacity':this['chatCapacity'],'chatCurrentCapacity':this[_0xe9bd('0x2f')],'mailStatus':this['mailStatus'],'mailStatusTime':this[_0xe9bd('0x12')],'mailCapacity':this[_0xe9bd('0x13')],'mailCurrentCapacity':this[_0xe9bd('0x30')],'faxStatus':this[_0xe9bd('0x31')],'faxStatusTime':this[_0xe9bd('0x14')],'faxCapacity':this['faxCapacity'],'faxCurrentCapacity':this['faxCurrentCapacity'],'smsStatus':this[_0xe9bd('0x17')],'smsStatusTime':this[_0xe9bd('0x32')],'smsCapacity':this[_0xe9bd('0x18')],'smsCurrentCapacity':this[_0xe9bd('0x19')],'openchannelStatus':this[_0xe9bd('0x33')],'openchannelStatusTime':this[_0xe9bd('0x1a')],'openchannelCapacity':this[_0xe9bd('0x1b')],'openchannelCurrentCapacity':this[_0xe9bd('0x34')],'busy':this[_0xe9bd('0x1c')],'busyQueue':this['busyQueue']};var _0x426004=md5(JSON[_0xe9bd('0x35')](_0x5987af));if(this[_0xe9bd('0x1d')]!==_0x426004){this['md5']=_0x426004;io['emit'](_0xe9bd('0x36'),_0x5987af);}};module[_0xe9bd('0x37')]=Agent; \ No newline at end of file +var _0x4483=['prototype','CurrentCapacity','Capacity','maxcapacity','openchannel','fax','sms','length','getChannelStatus','Status','StatusTime','toNumber','format','chatPause','mailCurrentCapacity','smsStatus','busy','busyQueue','exports','lodash','moment','md5','../../../config/environment','redis','defaults','localhost','name','online','voicePause','mailPause','faxPause','smsPause','openchannelPause','chatStatus','unknown','chatStatusTime','chatCurrentCapacity','mailStatus','mailStatusTime','mailCapacity','faxStatus','faxCapacity','faxCurrentCapacity','smsStatusTime','smsCapacity','smsCurrentCapacity','openchannelStatus','openchannelStatusTime','openchannelCapacity','updateRealtime'];(function(_0x4ca966,_0x6fdc8){var _0x2312b4=function(_0x495b5d){while(--_0x495b5d){_0x4ca966['push'](_0x4ca966['shift']());}};_0x2312b4(++_0x6fdc8);}(_0x4483,0x1a3));var _0x3448=function(_0x269054,_0x27da23){_0x269054=_0x269054-0x0;var _0x3e7b21=_0x4483[_0x269054];return _0x3e7b21;};'use strict';var _=require(_0x3448('0x0'));var moment=require(_0x3448('0x1'));var md5=require(_0x3448('0x2'));var Redis=require('ioredis');var config=require(_0x3448('0x3'));config[_0x3448('0x4')]=_[_0x3448('0x5')](config[_0x3448('0x4')],{'host':_0x3448('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x3448('0x4')]));function Agent(_0x6a89b){this['id']=_0x6a89b['id']||0x0;this[_0x3448('0x7')]=_0x6a89b[_0x3448('0x7')]||'';this[_0x3448('0x8')]=_0x6a89b[_0x3448('0x8')]||!![];this[_0x3448('0x9')]=_0x6a89b[_0x3448('0x9')]||![];this['chatPause']=_0x6a89b['chatPause']||![];this[_0x3448('0xa')]=_0x6a89b[_0x3448('0xa')]||![];this[_0x3448('0xb')]=_0x6a89b[_0x3448('0xb')]||![];this[_0x3448('0xc')]=_0x6a89b[_0x3448('0xc')]||![];this[_0x3448('0xd')]=_0x6a89b[_0x3448('0xd')]||![];this[_0x3448('0xe')]=_0x3448('0xf');this[_0x3448('0x10')]=0x0;this['chatCapacity']=_0x6a89b['chatCapacity']||0x0;this[_0x3448('0x11')]=0x0;this[_0x3448('0x12')]='unknown';this[_0x3448('0x13')]=0x0;this[_0x3448('0x14')]=_0x6a89b[_0x3448('0x14')]||0x0;this['mailCurrentCapacity']=0x0;this[_0x3448('0x15')]=_0x3448('0xf');this['faxStatusTime']=0x0;this[_0x3448('0x16')]=_0x6a89b[_0x3448('0x16')]||0x0;this[_0x3448('0x17')]=0x0;this['smsStatus']=_0x3448('0xf');this[_0x3448('0x18')]=0x0;this[_0x3448('0x19')]=_0x6a89b[_0x3448('0x19')]||0x0;this[_0x3448('0x1a')]=0x0;this[_0x3448('0x1b')]=_0x3448('0xf');this[_0x3448('0x1c')]=0x0;this['openchannelCapacity']=_0x6a89b[_0x3448('0x1d')]||0x0;this['openchannelCurrentCapacity']=0x0;this['busy']=![];this['busyQueue']=undefined;this[_0x3448('0x2')]='';this[_0x3448('0x1e')]();}Agent[_0x3448('0x1f')]['getChannelStatus']=function(_0x3df082){if(this[_0x3df082+_0x3448('0x20')]>0x0){if(this[_0x3df082+_0x3448('0x21')]>0x0&&this[_0x3df082+_0x3448('0x20')]>=this[_0x3df082+_0x3448('0x21')]){return _0x3448('0x22');}else{return'working';}}else{return'idle';}};Agent['prototype'][_0x3448('0x1e')]=function(){var _0x200f72=['mail','chat',_0x3448('0x23'),_0x3448('0x24'),_0x3448('0x25')];for(var _0x4368c7=0x0;_0x4368c7<_0x200f72[_0x3448('0x26')];_0x4368c7+=0x1){var _0x566ff5=this[_0x3448('0x27')](_0x200f72[_0x4368c7]);if(this[_0x200f72[_0x4368c7]+_0x3448('0x28')]!==_0x566ff5){this[_0x200f72[_0x4368c7]+_0x3448('0x29')]=_[_0x3448('0x2a')](moment()[_0x3448('0x2b')]('x'));}this[_0x200f72[_0x4368c7]+'Status']=_0x566ff5;}var _0x329947={'id':this['id'],'name':this[_0x3448('0x7')],'online':this['online'],'voicePause':this[_0x3448('0x9')],'chatPause':this[_0x3448('0x2c')],'mailPause':this[_0x3448('0xa')],'smsPause':this[_0x3448('0xc')],'faxPause':this[_0x3448('0xb')],'openchannelPause':this[_0x3448('0xd')],'chatStatus':this[_0x3448('0xe')],'chatStatusTime':this[_0x3448('0x10')],'chatCapacity':this['chatCapacity'],'chatCurrentCapacity':this[_0x3448('0x11')],'mailStatus':this[_0x3448('0x12')],'mailStatusTime':this[_0x3448('0x13')],'mailCapacity':this['mailCapacity'],'mailCurrentCapacity':this[_0x3448('0x2d')],'faxStatus':this['faxStatus'],'faxStatusTime':this['faxStatusTime'],'faxCapacity':this['faxCapacity'],'faxCurrentCapacity':this[_0x3448('0x17')],'smsStatus':this[_0x3448('0x2e')],'smsStatusTime':this['smsStatusTime'],'smsCapacity':this['smsCapacity'],'smsCurrentCapacity':this[_0x3448('0x1a')],'openchannelStatus':this[_0x3448('0x1b')],'openchannelStatusTime':this[_0x3448('0x1c')],'openchannelCapacity':this[_0x3448('0x1d')],'openchannelCurrentCapacity':this['openchannelCurrentCapacity'],'busy':this[_0x3448('0x2f')],'busyQueue':this[_0x3448('0x30')]};var _0x41002c=md5(JSON['stringify'](_0x329947));if(this[_0x3448('0x2')]!==_0x41002c){this[_0x3448('0x2')]=_0x41002c;io['emit']('user:save',_0x329947);}};module[_0x3448('0x31')]=Agent; \ No newline at end of file diff --git a/server/services/routing/model/chatQueue.js b/server/services/routing/model/chatQueue.js index d7e305a..b133bae 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 _0xeb83=['emit','chat_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','prototype','_rr','map','updateRealtime','paused','loggedIn','chatPause','available','stringify','format','chat:queue:%s'];(function(_0x19e76b,_0x2ba886){var _0xb3a7ff=function(_0x3b58a6){while(--_0x3b58a6){_0x19e76b['push'](_0x19e76b['shift']());}};_0xb3a7ff(++_0x2ba886);}(_0xeb83,0x99));var _0x3eb8=function(_0x2f1b9e,_0x495c32){_0x2f1b9e=_0x2f1b9e-0x0;var _0x27c127=_0xeb83[_0x2f1b9e];return _0x27c127;};'use strict';var _=require(_0x3eb8('0x0'));var md5=require(_0x3eb8('0x1'));var util=require(_0x3eb8('0x2'));var Redis=require(_0x3eb8('0x3'));var config=require(_0x3eb8('0x4'));config[_0x3eb8('0x5')]=_[_0x3eb8('0x6')](config[_0x3eb8('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0x3eb8('0x7'))(new Redis(config[_0x3eb8('0x5')]));function ChatQueue(_0x251398){this['id']=_0x251398['id']||0x0;this[_0x3eb8('0x8')]=_0x251398[_0x3eb8('0x8')]||'';this[_0x3eb8('0x9')]=_0x251398[_0x3eb8('0x9')]||0xa;this['strategy']=_0x251398[_0x3eb8('0xa')]||_0x3eb8('0xb');this[_0x3eb8('0xc')]=_0x251398[_0x3eb8('0xc')];this[_0x3eb8('0xd')]={};this[_0x3eb8('0xe')]=0x0;this[_0x3eb8('0x1')]='';this[_0x3eb8('0xf')]();this['updateRealtime']();}ChatQueue[_0x3eb8('0x10')]['updateRouting']=function(){var _0x59e193=this[_0x3eb8('0xd')][_0x3eb8('0x11')];this[_0x3eb8('0xd')]=_[_0x3eb8('0x12')](this['Agents'],'id');this['mapAgentsId']['_rr']=_0x59e193;};ChatQueue['prototype'][_0x3eb8('0x13')]=function(){this['loggedIn']=0x0;this[_0x3eb8('0x14')]=0x0;for(var _0x3105c3=0x0;_0x3105c3=0x0?this[_0x3eb8('0x17')]:0x0;var _0x303fb3={'id':this['id'],'available':this[_0x3eb8('0x17')],'loggedIn':this[_0x3eb8('0x15')],'name':this['name'],'paused':this[_0x3eb8('0x14')],'waiting':this[_0x3eb8('0xe')]};var _0x272281=md5(JSON[_0x3eb8('0x18')](_0x303fb3));if(this['md5']!==_0x272281){this[_0x3eb8('0x1')]=_0x272281;io['to'](util[_0x3eb8('0x19')](_0x3eb8('0x1a'),_0x303fb3['name']))[_0x3eb8('0x1b')](_0x3eb8('0x1c'),_0x303fb3);}};module[_0x3eb8('0x1d')]=ChatQueue; \ No newline at end of file +var _0x2721=['_rr','map','loggedIn','length','online','chatPause','paused','available','name','stringify','md5','format','chat:queue:%s','chat_queue:save','exports','lodash','redis','defaults','localhost','socket.io-emitter','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x2721,0x1a5));var _0x1272=function(_0x12fc8d,_0x19ee33){_0x12fc8d=_0x12fc8d-0x0;var _0x3f9d04=_0x2721[_0x12fc8d];return _0x3f9d04;};'use strict';var _=require(_0x1272('0x0'));var md5=require('md5');var util=require('util');var Redis=require('ioredis');var config=require('../../../config/environment');config[_0x1272('0x1')]=_[_0x1272('0x2')](config[_0x1272('0x1')],{'host':_0x1272('0x3'),'port':0x18eb});var io=require(_0x1272('0x4'))(new Redis(config['redis']));function ChatQueue(_0x5d9b9){this['id']=_0x5d9b9['id']||0x0;this['name']=_0x5d9b9['name']||'';this[_0x1272('0x5')]=_0x5d9b9['timeout']||0xa;this[_0x1272('0x6')]=_0x5d9b9[_0x1272('0x6')]||_0x1272('0x7');this[_0x1272('0x8')]=_0x5d9b9['Agents'];this[_0x1272('0x9')]={};this[_0x1272('0xa')]=0x0;this['md5']='';this[_0x1272('0xb')]();this[_0x1272('0xc')]();}ChatQueue[_0x1272('0xd')][_0x1272('0xb')]=function(){var _0x21260b=this['mapAgentsId'][_0x1272('0xe')];this[_0x1272('0x9')]=_[_0x1272('0xf')](this[_0x1272('0x8')],'id');this[_0x1272('0x9')][_0x1272('0xe')]=_0x21260b;};ChatQueue[_0x1272('0xd')]['updateRealtime']=function(){this[_0x1272('0x10')]=0x0;this['paused']=0x0;for(var _0x31416a=0x0;_0x31416a=0x0?this[_0x1272('0x15')]:0x0;var _0x85353c={'id':this['id'],'available':this['available'],'loggedIn':this[_0x1272('0x10')],'name':this[_0x1272('0x16')],'paused':this[_0x1272('0x14')],'waiting':this[_0x1272('0xa')]};var _0x117d38=md5(JSON[_0x1272('0x17')](_0x85353c));if(this[_0x1272('0x18')]!==_0x117d38){this['md5']=_0x117d38;io['to'](util[_0x1272('0x19')](_0x1272('0x1a'),_0x85353c['name']))['emit'](_0x1272('0x1b'),_0x85353c);}};module[_0x1272('0x1c')]=ChatQueue; \ No newline at end of file diff --git a/server/services/routing/model/faxQueue.js b/server/services/routing/model/faxQueue.js index 8df8555..72ed431 100644 --- a/server/services/routing/model/faxQueue.js +++ b/server/services/routing/model/faxQueue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['available','stringify','format','emit','exports','lodash','md5','util','redis','localhost','socket.io-emitter','name','timeout','beepall','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','map','Agents','_rr','loggedIn','paused','length','faxPause'];(function(_0x5b0618,_0x2180f0){var _0x448611=function(_0xb159e1){while(--_0xb159e1){_0x5b0618['push'](_0x5b0618['shift']());}};_0x448611(++_0x2180f0);}(_0xa9e0,0x123));var _0x0a9e=function(_0x37bd26,_0x5ad346){_0x37bd26=_0x37bd26-0x0;var _0xe83dc4=_0xa9e0[_0x37bd26];return _0xe83dc4;};'use strict';var _=require(_0x0a9e('0x0'));var md5=require(_0x0a9e('0x1'));var util=require(_0x0a9e('0x2'));var Redis=require('ioredis');var config=require('../../../config/environment');config[_0x0a9e('0x3')]=_['defaults'](config[_0x0a9e('0x3')],{'host':_0x0a9e('0x4'),'port':0x18eb});var io=require(_0x0a9e('0x5'))(new Redis(config[_0x0a9e('0x3')]));function FaxQueue(_0x981158){this['id']=_0x981158['id']||0x0;this['name']=_0x981158[_0x0a9e('0x6')]||'';this[_0x0a9e('0x7')]=_0x981158[_0x0a9e('0x7')]||0xa;this['strategy']=_0x981158['strategy']||_0x0a9e('0x8');this['Agents']=_0x981158['Agents'];this[_0x0a9e('0x9')]={};this[_0x0a9e('0xa')]=0x0;this[_0x0a9e('0x1')]='';this[_0x0a9e('0xb')]();this[_0x0a9e('0xc')]();}FaxQueue[_0x0a9e('0xd')]['updateRouting']=function(){var _0x50dfb2=this['mapAgentsId']['_rr'];this[_0x0a9e('0x9')]=_[_0x0a9e('0xe')](this[_0x0a9e('0xf')],'id');this[_0x0a9e('0x9')][_0x0a9e('0x10')]=_0x50dfb2;};FaxQueue[_0x0a9e('0xd')]['updateRealtime']=function(){this[_0x0a9e('0x11')]=0x0;this[_0x0a9e('0x12')]=0x0;for(var _0x2b4227=0x0;_0x2b4227=0x0?this[_0x0a9e('0x15')]:0x0;var _0x478723={'id':this['id'],'available':this[_0x0a9e('0x15')],'loggedIn':this[_0x0a9e('0x11')],'name':this[_0x0a9e('0x6')],'paused':this[_0x0a9e('0x12')],'waiting':this[_0x0a9e('0xa')]};var _0x20559e=md5(JSON[_0x0a9e('0x16')](_0x478723));if(this[_0x0a9e('0x1')]!==_0x20559e){this[_0x0a9e('0x1')]=_0x20559e;io['to'](util[_0x0a9e('0x17')]('fax:queue:%s',_0x478723[_0x0a9e('0x6')]))[_0x0a9e('0x18')]('fax_queue:save',_0x478723);}};module[_0x0a9e('0x19')]=FaxQueue; \ No newline at end of file +var _0xa9e0=['available','stringify','format','emit','exports','lodash','md5','util','redis','localhost','socket.io-emitter','name','timeout','beepall','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','map','Agents','_rr','loggedIn','paused','length','faxPause'];(function(_0x564c57,_0x1d1223){var _0x3e983b=function(_0x10aa6c){while(--_0x10aa6c){_0x564c57['push'](_0x564c57['shift']());}};_0x3e983b(++_0x1d1223);}(_0xa9e0,0x123));var _0x0a9e=function(_0x9aada2,_0xd2d349){_0x9aada2=_0x9aada2-0x0;var _0x196dff=_0xa9e0[_0x9aada2];return _0x196dff;};'use strict';var _=require(_0x0a9e('0x0'));var md5=require(_0x0a9e('0x1'));var util=require(_0x0a9e('0x2'));var Redis=require('ioredis');var config=require('../../../config/environment');config[_0x0a9e('0x3')]=_['defaults'](config[_0x0a9e('0x3')],{'host':_0x0a9e('0x4'),'port':0x18eb});var io=require(_0x0a9e('0x5'))(new Redis(config[_0x0a9e('0x3')]));function FaxQueue(_0x981158){this['id']=_0x981158['id']||0x0;this['name']=_0x981158[_0x0a9e('0x6')]||'';this[_0x0a9e('0x7')]=_0x981158[_0x0a9e('0x7')]||0xa;this['strategy']=_0x981158['strategy']||_0x0a9e('0x8');this['Agents']=_0x981158['Agents'];this[_0x0a9e('0x9')]={};this[_0x0a9e('0xa')]=0x0;this[_0x0a9e('0x1')]='';this[_0x0a9e('0xb')]();this[_0x0a9e('0xc')]();}FaxQueue[_0x0a9e('0xd')]['updateRouting']=function(){var _0x50dfb2=this['mapAgentsId']['_rr'];this[_0x0a9e('0x9')]=_[_0x0a9e('0xe')](this[_0x0a9e('0xf')],'id');this[_0x0a9e('0x9')][_0x0a9e('0x10')]=_0x50dfb2;};FaxQueue[_0x0a9e('0xd')]['updateRealtime']=function(){this[_0x0a9e('0x11')]=0x0;this[_0x0a9e('0x12')]=0x0;for(var _0x2b4227=0x0;_0x2b4227=0x0?this[_0x0a9e('0x15')]:0x0;var _0x478723={'id':this['id'],'available':this[_0x0a9e('0x15')],'loggedIn':this[_0x0a9e('0x11')],'name':this[_0x0a9e('0x6')],'paused':this[_0x0a9e('0x12')],'waiting':this[_0x0a9e('0xa')]};var _0x20559e=md5(JSON[_0x0a9e('0x16')](_0x478723));if(this[_0x0a9e('0x1')]!==_0x20559e){this[_0x0a9e('0x1')]=_0x20559e;io['to'](util[_0x0a9e('0x17')]('fax:queue:%s',_0x478723[_0x0a9e('0x6')]))[_0x0a9e('0x18')]('fax_queue:save',_0x478723);}};module[_0x0a9e('0x19')]=FaxQueue; \ No newline at end of file diff --git a/server/services/routing/model/interval.js b/server/services/routing/model/interval.js index 24ba815..64b34fd 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 _0x2672=['exports','name','Intervals'];(function(_0x50eb61,_0x18a37f){var _0x51a3b0=function(_0x2860ce){while(--_0x2860ce){_0x50eb61['push'](_0x50eb61['shift']());}};_0x51a3b0(++_0x18a37f);}(_0x2672,0x1a5));var _0x2267=function(_0x38e59e,_0x4ce8f3){_0x38e59e=_0x38e59e-0x0;var _0x5cc6a2=_0x2672[_0x38e59e];return _0x5cc6a2;};'use strict';function Interval(_0x1cb3de){this['id']=_0x1cb3de['id']||0x0;this['name']=_0x1cb3de[_0x2267('0x0')]||'';this[_0x2267('0x1')]=_0x1cb3de[_0x2267('0x1')]||{};}module[_0x2267('0x2')]=Interval; \ No newline at end of file +var _0x7cc4=['exports','name','Intervals'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7cc4,0x19c));var _0x47cc=function(_0x470f24,_0x2436a9){_0x470f24=_0x470f24-0x0;var _0x2c6fc8=_0x7cc4[_0x470f24];return _0x2c6fc8;};'use strict';function Interval(_0x3e44a4){this['id']=_0x3e44a4['id']||0x0;this[_0x47cc('0x0')]=_0x3e44a4['name']||'';this[_0x47cc('0x1')]=_0x3e44a4[_0x47cc('0x1')]||{};}module[_0x47cc('0x2')]=Interval; \ No newline at end of file diff --git a/server/services/routing/model/mailQueue.js b/server/services/routing/model/mailQueue.js index cdaa538..a3f7931 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 _0x6ad8=['stringify','format','mail:queue:%s','emit','mail_queue:save','exports','md5','util','ioredis','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','mapAgentsId','waiting','updateRealtime','prototype','_rr','map','Agents','length','online','loggedIn','paused','available'];(function(_0x11d8ca,_0x20d99a){var _0x4cc297=function(_0x9aeb9d){while(--_0x9aeb9d){_0x11d8ca['push'](_0x11d8ca['shift']());}};_0x4cc297(++_0x20d99a);}(_0x6ad8,0xca));var _0x86ad=function(_0x13ee46,_0xe76b1c){_0x13ee46=_0x13ee46-0x0;var _0x1e3803=_0x6ad8[_0x13ee46];return _0x1e3803;};'use strict';var _=require('lodash');var md5=require(_0x86ad('0x0'));var util=require(_0x86ad('0x1'));var Redis=require(_0x86ad('0x2'));var config=require('../../../config/environment');config[_0x86ad('0x3')]=_[_0x86ad('0x4')](config['redis'],{'host':_0x86ad('0x5'),'port':0x18eb});var io=require(_0x86ad('0x6'))(new Redis(config[_0x86ad('0x3')]));function MailQueue(_0x25d3a5){this['id']=_0x25d3a5['id']||0x0;this[_0x86ad('0x7')]=_0x25d3a5['name']||'';this[_0x86ad('0x8')]=_0x25d3a5['timeout']||0xa;this[_0x86ad('0x9')]=_0x25d3a5[_0x86ad('0x9')]||'beepall';this['Agents']=_0x25d3a5['Agents'];this[_0x86ad('0xa')]={};this[_0x86ad('0xb')]=0x0;this['md5']='';this['updateRouting']();this[_0x86ad('0xc')]();}MailQueue[_0x86ad('0xd')]['updateRouting']=function(){var _0x10863a=this[_0x86ad('0xa')][_0x86ad('0xe')];this[_0x86ad('0xa')]=_[_0x86ad('0xf')](this[_0x86ad('0x10')],'id');this['mapAgentsId'][_0x86ad('0xe')]=_0x10863a;};MailQueue['prototype'][_0x86ad('0xc')]=function(){this['loggedIn']=0x0;this['paused']=0x0;for(var _0x12703e=0x0;_0x12703e=0x0?this[_0x86ad('0x15')]:0x0;var _0x5e4547={'id':this['id'],'available':this[_0x86ad('0x15')],'loggedIn':this[_0x86ad('0x13')],'name':this[_0x86ad('0x7')],'paused':this[_0x86ad('0x14')],'waiting':this[_0x86ad('0xb')]};var _0x254b42=md5(JSON[_0x86ad('0x16')](_0x5e4547));if(this[_0x86ad('0x0')]!==_0x254b42){this[_0x86ad('0x0')]=_0x254b42;io['to'](util[_0x86ad('0x17')](_0x86ad('0x18'),_0x5e4547['name']))[_0x86ad('0x19')](_0x86ad('0x1a'),_0x5e4547);}};module[_0x86ad('0x1b')]=MailQueue; \ No newline at end of file +var _0xcde7=['ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','beepall','Agents','waiting','updateRouting','updateRealtime','prototype','_rr','mapAgentsId','loggedIn','length','online','mailPause','paused','available','stringify','mail:queue:%s','emit','mail_queue:save','exports','lodash','md5','util'];(function(_0x180bc5,_0x17fd8d){var _0x310566=function(_0x5cf9fd){while(--_0x5cf9fd){_0x180bc5['push'](_0x180bc5['shift']());}};_0x310566(++_0x17fd8d);}(_0xcde7,0x129));var _0x7cde=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0xcde7[_0x4e676e];return _0x336a3c;};'use strict';var _=require(_0x7cde('0x0'));var md5=require(_0x7cde('0x1'));var util=require(_0x7cde('0x2'));var Redis=require(_0x7cde('0x3'));var config=require(_0x7cde('0x4'));config[_0x7cde('0x5')]=_[_0x7cde('0x6')](config[_0x7cde('0x5')],{'host':_0x7cde('0x7'),'port':0x18eb});var io=require(_0x7cde('0x8'))(new Redis(config['redis']));function MailQueue(_0xd09e89){this['id']=_0xd09e89['id']||0x0;this[_0x7cde('0x9')]=_0xd09e89[_0x7cde('0x9')]||'';this['timeout']=_0xd09e89[_0x7cde('0xa')]||0xa;this['strategy']=_0xd09e89['strategy']||_0x7cde('0xb');this[_0x7cde('0xc')]=_0xd09e89[_0x7cde('0xc')];this['mapAgentsId']={};this[_0x7cde('0xd')]=0x0;this[_0x7cde('0x1')]='';this[_0x7cde('0xe')]();this[_0x7cde('0xf')]();}MailQueue[_0x7cde('0x10')][_0x7cde('0xe')]=function(){var _0x146028=this['mapAgentsId'][_0x7cde('0x11')];this[_0x7cde('0x12')]=_['map'](this['Agents'],'id');this[_0x7cde('0x12')]['_rr']=_0x146028;};MailQueue[_0x7cde('0x10')][_0x7cde('0xf')]=function(){this[_0x7cde('0x13')]=0x0;this['paused']=0x0;for(var _0x447fc9=0x0;_0x447fc9=0x0?this[_0x7cde('0x18')]:0x0;var _0x2f14e2={'id':this['id'],'available':this['available'],'loggedIn':this[_0x7cde('0x13')],'name':this[_0x7cde('0x9')],'paused':this[_0x7cde('0x17')],'waiting':this['waiting']};var _0x29a9fc=md5(JSON[_0x7cde('0x19')](_0x2f14e2));if(this['md5']!==_0x29a9fc){this[_0x7cde('0x1')]=_0x29a9fc;io['to'](util['format'](_0x7cde('0x1a'),_0x2f14e2['name']))[_0x7cde('0x1b')](_0x7cde('0x1c'),_0x2f14e2);}};module[_0x7cde('0x1d')]=MailQueue; \ No newline at end of file diff --git a/server/services/routing/model/openchannelQueue.js b/server/services/routing/model/openchannelQueue.js index a910a11..d9c8ebd 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 _0x32cc=['util','../../../config/environment','redis','defaults','socket.io-emitter','name','timeout','strategy','beepall','Agents','waiting','updateRealtime','prototype','updateRouting','_rr','map','mapAgentsId','loggedIn','paused','online','openchannelPause','available','stringify','format','openchannel:queue:%s','emit','openchannel_queue:save','exports','lodash','md5'];(function(_0xc8a931,_0x260690){var _0x28bd27=function(_0x591b9f){while(--_0x591b9f){_0xc8a931['push'](_0xc8a931['shift']());}};_0x28bd27(++_0x260690);}(_0x32cc,0x94));var _0xc32c=function(_0x4623bd,_0x4fb98b){_0x4623bd=_0x4623bd-0x0;var _0x23df60=_0x32cc[_0x4623bd];return _0x23df60;};'use strict';var _=require(_0xc32c('0x0'));var md5=require(_0xc32c('0x1'));var util=require(_0xc32c('0x2'));var Redis=require('ioredis');var config=require(_0xc32c('0x3'));config[_0xc32c('0x4')]=_[_0xc32c('0x5')](config[_0xc32c('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0xc32c('0x6'))(new Redis(config[_0xc32c('0x4')]));function OpenchannelQueue(_0x38bbd8){this['id']=_0x38bbd8['id']||0x0;this['name']=_0x38bbd8[_0xc32c('0x7')]||'';this[_0xc32c('0x8')]=_0x38bbd8['timeout']||0xa;this[_0xc32c('0x9')]=_0x38bbd8['strategy']||_0xc32c('0xa');this[_0xc32c('0xb')]=_0x38bbd8['Agents'];this['mapAgentsId']={};this[_0xc32c('0xc')]=0x0;this['md5']='';this['updateRouting']();this[_0xc32c('0xd')]();}OpenchannelQueue[_0xc32c('0xe')][_0xc32c('0xf')]=function(){var _0x5253f8=this['mapAgentsId'][_0xc32c('0x10')];this['mapAgentsId']=_[_0xc32c('0x11')](this[_0xc32c('0xb')],'id');this[_0xc32c('0x12')][_0xc32c('0x10')]=_0x5253f8;};OpenchannelQueue[_0xc32c('0xe')]['updateRealtime']=function(){this[_0xc32c('0x13')]=0x0;this[_0xc32c('0x14')]=0x0;for(var _0x19d16b=0x0;_0x19d16b=0x0?this[_0xc32c('0x17')]:0x0;var _0x55fd2f={'id':this['id'],'available':this['available'],'loggedIn':this[_0xc32c('0x13')],'name':this[_0xc32c('0x7')],'paused':this[_0xc32c('0x14')],'waiting':this[_0xc32c('0xc')]};var _0x44b0cc=md5(JSON[_0xc32c('0x18')](_0x55fd2f));if(this[_0xc32c('0x1')]!==_0x44b0cc){this[_0xc32c('0x1')]=_0x44b0cc;io['to'](util[_0xc32c('0x19')](_0xc32c('0x1a'),_0x55fd2f[_0xc32c('0x7')]))[_0xc32c('0x1b')](_0xc32c('0x1c'),_0x55fd2f);}};module[_0xc32c('0x1d')]=OpenchannelQueue; \ No newline at end of file +var _0xb307=['paused','length','available','waiting','format','openchannel:queue:%s','emit','exports','lodash','md5','util','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','name','timeout','strategy','Agents','updateRealtime','prototype','updateRouting','_rr','mapAgentsId','map','loggedIn'];(function(_0x1c8c28,_0x3ee093){var _0x1f59b4=function(_0x29bcc0){while(--_0x29bcc0){_0x1c8c28['push'](_0x1c8c28['shift']());}};_0x1f59b4(++_0x3ee093);}(_0xb307,0xfb));var _0x7b30=function(_0x382279,_0x181b66){_0x382279=_0x382279-0x0;var _0x193f40=_0xb307[_0x382279];return _0x193f40;};'use strict';var _=require(_0x7b30('0x0'));var md5=require(_0x7b30('0x1'));var util=require(_0x7b30('0x2'));var Redis=require(_0x7b30('0x3'));var config=require(_0x7b30('0x4'));config[_0x7b30('0x5')]=_[_0x7b30('0x6')](config[_0x7b30('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0x7b30('0x7'))(new Redis(config[_0x7b30('0x5')]));function OpenchannelQueue(_0x6bd4cb){this['id']=_0x6bd4cb['id']||0x0;this[_0x7b30('0x8')]=_0x6bd4cb[_0x7b30('0x8')]||'';this[_0x7b30('0x9')]=_0x6bd4cb['timeout']||0xa;this[_0x7b30('0xa')]=_0x6bd4cb[_0x7b30('0xa')]||'beepall';this[_0x7b30('0xb')]=_0x6bd4cb[_0x7b30('0xb')];this['mapAgentsId']={};this['waiting']=0x0;this[_0x7b30('0x1')]='';this['updateRouting']();this[_0x7b30('0xc')]();}OpenchannelQueue[_0x7b30('0xd')][_0x7b30('0xe')]=function(){var _0x204cdf=this['mapAgentsId'][_0x7b30('0xf')];this[_0x7b30('0x10')]=_[_0x7b30('0x11')](this[_0x7b30('0xb')],'id');this[_0x7b30('0x10')][_0x7b30('0xf')]=_0x204cdf;};OpenchannelQueue[_0x7b30('0xd')][_0x7b30('0xc')]=function(){this[_0x7b30('0x12')]=0x0;this[_0x7b30('0x13')]=0x0;for(var _0x139ad1=0x0;_0x139ad1=0x0?this['available']:0x0;var _0xea10f5={'id':this['id'],'available':this['available'],'loggedIn':this[_0x7b30('0x12')],'name':this[_0x7b30('0x8')],'paused':this[_0x7b30('0x13')],'waiting':this[_0x7b30('0x16')]};var _0x276155=md5(JSON['stringify'](_0xea10f5));if(this[_0x7b30('0x1')]!==_0x276155){this[_0x7b30('0x1')]=_0x276155;io['to'](util[_0x7b30('0x17')](_0x7b30('0x18'),_0xea10f5[_0x7b30('0x8')]))[_0x7b30('0x19')]('openchannel_queue:save',_0xea10f5);}};module[_0x7b30('0x1a')]=OpenchannelQueue; \ No newline at end of file diff --git a/server/services/routing/model/smsQueue.js b/server/services/routing/model/smsQueue.js index c76c320..02b5017 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 _0x0713=['smsPause','paused','available','stringify','sms:queue:%s','emit','sms_queue:save','exports','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','waiting','md5','updateRouting','updateRealtime','prototype','mapAgentsId','_rr','map','loggedIn','length','online'];(function(_0x58c3bb,_0x45e1c1){var _0x13a413=function(_0x357c92){while(--_0x357c92){_0x58c3bb['push'](_0x58c3bb['shift']());}};_0x13a413(++_0x45e1c1);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var md5=require('md5');var util=require(_0x3071('0x0'));var Redis=require(_0x3071('0x1'));var config=require(_0x3071('0x2'));config[_0x3071('0x3')]=_[_0x3071('0x4')](config['redis'],{'host':_0x3071('0x5'),'port':0x18eb});var io=require(_0x3071('0x6'))(new Redis(config[_0x3071('0x3')]));function SmsQueue(_0x3137c8){this['id']=_0x3137c8['id']||0x0;this[_0x3071('0x7')]=_0x3137c8[_0x3071('0x7')]||'';this[_0x3071('0x8')]=_0x3137c8[_0x3071('0x8')]||0xa;this[_0x3071('0x9')]=_0x3137c8[_0x3071('0x9')]||_0x3071('0xa');this[_0x3071('0xb')]=_0x3137c8[_0x3071('0xb')];this['mapAgentsId']={};this[_0x3071('0xc')]=0x0;this[_0x3071('0xd')]='';this[_0x3071('0xe')]();this[_0x3071('0xf')]();}SmsQueue[_0x3071('0x10')]['updateRouting']=function(){var _0x2ace21=this[_0x3071('0x11')][_0x3071('0x12')];this[_0x3071('0x11')]=_[_0x3071('0x13')](this['Agents'],'id');this['mapAgentsId'][_0x3071('0x12')]=_0x2ace21;};SmsQueue['prototype'][_0x3071('0xf')]=function(){this[_0x3071('0x14')]=0x0;this['paused']=0x0;for(var _0x104e73=0x0;_0x104e73=0x0?this[_0x3071('0x19')]:0x0;var _0x1068d9={'id':this['id'],'available':this[_0x3071('0x19')],'loggedIn':this[_0x3071('0x14')],'name':this[_0x3071('0x7')],'paused':this[_0x3071('0x18')],'waiting':this[_0x3071('0xc')]};var _0x502a16=md5(JSON[_0x3071('0x1a')](_0x1068d9));if(this[_0x3071('0xd')]!==_0x502a16){this[_0x3071('0xd')]=_0x502a16;io['to'](util['format'](_0x3071('0x1b'),_0x1068d9['name']))[_0x3071('0x1c')](_0x3071('0x1d'),_0x1068d9);}};module[_0x3071('0x1e')]=SmsQueue; \ No newline at end of file +var _0xb7e7=['util','../../../config/environment','defaults','localhost','socket.io-emitter','redis','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','md5','updateRealtime','prototype','updateRouting','_rr','map','loggedIn','length','online','paused','available','stringify','sms:queue:%s','emit','exports','lodash'];(function(_0xe77b1c,_0x50d925){var _0x399ee6=function(_0x544a96){while(--_0x544a96){_0xe77b1c['push'](_0xe77b1c['shift']());}};_0x399ee6(++_0x50d925);}(_0xb7e7,0x121));var _0x7b7e=function(_0x5c9307,_0x5b97e4){_0x5c9307=_0x5c9307-0x0;var _0x373e29=_0xb7e7[_0x5c9307];return _0x373e29;};'use strict';var _=require(_0x7b7e('0x0'));var md5=require('md5');var util=require(_0x7b7e('0x1'));var Redis=require('ioredis');var config=require(_0x7b7e('0x2'));config['redis']=_[_0x7b7e('0x3')](config['redis'],{'host':_0x7b7e('0x4'),'port':0x18eb});var io=require(_0x7b7e('0x5'))(new Redis(config[_0x7b7e('0x6')]));function SmsQueue(_0x52047f){this['id']=_0x52047f['id']||0x0;this['name']=_0x52047f[_0x7b7e('0x7')]||'';this[_0x7b7e('0x8')]=_0x52047f[_0x7b7e('0x8')]||0xa;this['strategy']=_0x52047f[_0x7b7e('0x9')]||_0x7b7e('0xa');this[_0x7b7e('0xb')]=_0x52047f[_0x7b7e('0xb')];this[_0x7b7e('0xc')]={};this[_0x7b7e('0xd')]=0x0;this[_0x7b7e('0xe')]='';this['updateRouting']();this[_0x7b7e('0xf')]();}SmsQueue[_0x7b7e('0x10')][_0x7b7e('0x11')]=function(){var _0x29b622=this[_0x7b7e('0xc')][_0x7b7e('0x12')];this[_0x7b7e('0xc')]=_[_0x7b7e('0x13')](this[_0x7b7e('0xb')],'id');this['mapAgentsId'][_0x7b7e('0x12')]=_0x29b622;};SmsQueue[_0x7b7e('0x10')]['updateRealtime']=function(){this[_0x7b7e('0x14')]=0x0;this['paused']=0x0;for(var _0x4c6011=0x0;_0x4c6011=0x0?this[_0x7b7e('0x18')]:0x0;var _0x200ef7={'id':this['id'],'available':this[_0x7b7e('0x18')],'loggedIn':this[_0x7b7e('0x14')],'name':this[_0x7b7e('0x7')],'paused':this[_0x7b7e('0x17')],'waiting':this[_0x7b7e('0xd')]};var _0x3bec7d=md5(JSON[_0x7b7e('0x19')](_0x200ef7));if(this[_0x7b7e('0xe')]!==_0x3bec7d){this[_0x7b7e('0xe')]=_0x3bec7d;io['to'](util['format'](_0x7b7e('0x1a'),_0x200ef7[_0x7b7e('0x7')]))[_0x7b7e('0x1b')]('sms_queue:save',_0x200ef7);}};module[_0x7b7e('0x1c')]=SmsQueue; \ No newline at end of file diff --git a/server/services/routing/realtime/index.js b/server/services/routing/realtime/index.js index f7a0f34..2955bac 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 _0x1063=['initSmsQueues','initFaxQueues','exports','bluebird','lodash','../model/agent','../model/interval','../model/openchannelQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','agents','intervals','openchannelQueues','chatQueues','smsQueues','mailQueues','faxQueues','chatQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','mapKeys','prototype','mergeFromDatabase','initAgents','length','isUndefined','initIntervals','initOpenchannelQueues','updateRouting','updateRealtime','initChatQueues'];(function(_0x172133,_0x10246b){var _0x2460e5=function(_0x3c4918){while(--_0x3c4918){_0x172133['push'](_0x172133['shift']());}};_0x2460e5(++_0x10246b);}(_0x1063,0x183));var _0x3106=function(_0x86a8a0,_0x2a3460){_0x86a8a0=_0x86a8a0-0x0;var _0xc123af=_0x1063[_0x86a8a0];return _0xc123af;};'use strict';var BPromise=require(_0x3106('0x0'));var util=require('util');var _=require(_0x3106('0x1'));var moment=require('moment');var Agent=require(_0x3106('0x2'));var Interval=require(_0x3106('0x3'));var OpenchannelQueue=require(_0x3106('0x4'));var ChatQueue=require('../model/chatQueue');var SmsQueue=require(_0x3106('0x5'));var MailQueue=require(_0x3106('0x6'));var FaxQueue=require(_0x3106('0x7'));var Realtime=function(){this[_0x3106('0x8')]={};this[_0x3106('0x9')]={};this[_0x3106('0xa')]={};this[_0x3106('0xb')]={};this[_0x3106('0xc')]={};this[_0x3106('0xd')]={};this[_0x3106('0xe')]={};this[_0x3106('0xf')]={};this['mailQueuesWaitingInteractions']={};this[_0x3106('0x10')]={};this[_0x3106('0x11')]={};this['faxQueuesWaitingInteractions']={};};function freeIsNotKey(_0xb122e5,_0x577213,_0x5567fb){var _0x49c58e=_[_0x3106('0x12')](_0xb122e5,function(_0x580f6b,_0x2361f6){return _0x580f6b[_0x5567fb];});for(var _0x3965a1 in _0x577213){if(_0x577213['hasOwnProperty'](_0x3965a1)){if(!_0x49c58e[_0x3965a1]){delete _0x577213[_0x3965a1];}}}}Realtime[_0x3106('0x13')][_0x3106('0x14')]=function(_0x61e0f1,_0x1efc13){for(var _0x3a204c in _0x1efc13){if(_0x61e0f1['hasOwnProperty'](_0x3a204c)){_0x61e0f1[_0x3a204c]=_0x1efc13[_0x3a204c];}}};Realtime['prototype'][_0x3106('0x15')]=function(){var _0x3a9ac5=this;return function(_0x55ce00){if(_0x55ce00){freeIsNotKey(_0x55ce00,_0x3a9ac5['agents'],'id');for(var _0x317cea=0x0,_0x2b2b2c={},_0x5a855f={};_0x317cea<_0x55ce00[_0x3106('0x16')];_0x317cea+=0x1){_0x2b2b2c=_0x55ce00[_0x317cea];if(_[_0x3106('0x17')](_0x3a9ac5['agents'][_0x2b2b2c['id']])){_0x3a9ac5[_0x3106('0x8')][_0x2b2b2c['id']]=new Agent(_0x2b2b2c);}else{_0x3a9ac5[_0x3106('0x14')](_0x3a9ac5[_0x3106('0x8')][_0x2b2b2c['id']],_0x2b2b2c);}}}return _0x3a9ac5[_0x3106('0x8')];};};Realtime[_0x3106('0x13')][_0x3106('0x18')]=function(){var _0x5eae58=this;return function(_0x3d6eea){if(_0x3d6eea){freeIsNotKey(_0x3d6eea,_0x5eae58[_0x3106('0x9')],'id');for(var _0x46f9a7=0x0,_0xe412b0={},_0x2a9bf={};_0x46f9a7<_0x3d6eea[_0x3106('0x16')];_0x46f9a7+=0x1){_0xe412b0=_0x3d6eea[_0x46f9a7];if(_[_0x3106('0x17')](_0x5eae58[_0x3106('0x9')][_0xe412b0['id']])){_0x5eae58['intervals'][_0xe412b0['id']]=new Interval(_0xe412b0);}else{_0x5eae58[_0x3106('0x14')](_0x5eae58['intervals'][_0xe412b0['id']],_0xe412b0);}}}return _0x5eae58['intervals'];};};Realtime[_0x3106('0x13')][_0x3106('0x19')]=function(){var _0x5a672d=this;return function(_0x2eda33){if(_0x2eda33){freeIsNotKey(_0x2eda33,_0x5a672d[_0x3106('0xa')],'id');for(var _0x592b29=0x0,_0x37155c={},_0xe3d9d={};_0x592b29<_0x2eda33[_0x3106('0x16')];_0x592b29+=0x1){_0x37155c=_0x2eda33[_0x592b29];if(_[_0x3106('0x17')](_0x5a672d[_0x3106('0xa')][_0x37155c['id']])){_0x5a672d[_0x3106('0xa')][_0x37155c['id']]=new OpenchannelQueue(_0x37155c);}else{_0x5a672d[_0x3106('0x14')](_0x5a672d[_0x3106('0xa')][_0x37155c['id']],_0x37155c);}_0x5a672d[_0x3106('0xa')][_0x37155c['id']][_0x3106('0x1a')]();_0x5a672d[_0x3106('0xa')][_0x37155c['id']][_0x3106('0x1b')]();}}return _0x5a672d[_0x3106('0xa')];};};Realtime[_0x3106('0x13')][_0x3106('0x1c')]=function(){var _0xed66a3=this;return function(_0x5a4767){if(_0x5a4767){freeIsNotKey(_0x5a4767,_0xed66a3[_0x3106('0xb')],'id');for(var _0xac2e78=0x0,_0x670754={},_0xe59d99={};_0xac2e78<_0x5a4767[_0x3106('0x16')];_0xac2e78+=0x1){_0x670754=_0x5a4767[_0xac2e78];if(_[_0x3106('0x17')](_0xed66a3[_0x3106('0xb')][_0x670754['id']])){_0xed66a3[_0x3106('0xb')][_0x670754['id']]=new ChatQueue(_0x670754);}else{_0xed66a3[_0x3106('0x14')](_0xed66a3[_0x3106('0xb')][_0x670754['id']],_0x670754);}_0xed66a3[_0x3106('0xb')][_0x670754['id']]['updateRouting']();_0xed66a3[_0x3106('0xb')][_0x670754['id']][_0x3106('0x1b')]();}}return _0xed66a3[_0x3106('0xb')];};};Realtime[_0x3106('0x13')][_0x3106('0x1d')]=function(){var _0x5587aa=this;return function(_0x56d010){if(_0x56d010){freeIsNotKey(_0x56d010,_0x5587aa['smsQueues'],'id');for(var _0x4b9f43=0x0,_0x32ab56={},_0x43db01={};_0x4b9f43<_0x56d010[_0x3106('0x16')];_0x4b9f43+=0x1){_0x32ab56=_0x56d010[_0x4b9f43];if(_[_0x3106('0x17')](_0x5587aa[_0x3106('0xc')][_0x32ab56['id']])){_0x5587aa[_0x3106('0xc')][_0x32ab56['id']]=new SmsQueue(_0x32ab56);}else{_0x5587aa['mergeFromDatabase'](_0x5587aa['smsQueues'][_0x32ab56['id']],_0x32ab56);}_0x5587aa['smsQueues'][_0x32ab56['id']][_0x3106('0x1a')]();_0x5587aa[_0x3106('0xc')][_0x32ab56['id']][_0x3106('0x1b')]();}}return _0x5587aa[_0x3106('0xc')];};};Realtime[_0x3106('0x13')]['initMailQueues']=function(){var _0x2cdc33=this;return function(_0x4ac1ea){if(_0x4ac1ea){freeIsNotKey(_0x4ac1ea,_0x2cdc33[_0x3106('0xd')],'id');for(var _0x10337f=0x0,_0x278118={},_0x23af80={};_0x10337f<_0x4ac1ea[_0x3106('0x16')];_0x10337f+=0x1){_0x278118=_0x4ac1ea[_0x10337f];if(_['isUndefined'](_0x2cdc33[_0x3106('0xd')][_0x278118['id']])){_0x2cdc33[_0x3106('0xd')][_0x278118['id']]=new MailQueue(_0x278118);}else{_0x2cdc33[_0x3106('0x14')](_0x2cdc33[_0x3106('0xd')][_0x278118['id']],_0x278118);}_0x2cdc33[_0x3106('0xd')][_0x278118['id']]['updateRouting']();_0x2cdc33[_0x3106('0xd')][_0x278118['id']][_0x3106('0x1b')]();}}return _0x2cdc33[_0x3106('0xd')];};};Realtime[_0x3106('0x13')][_0x3106('0x1e')]=function(){var _0x5bc9a9=this;return function(_0x52ac08){if(_0x52ac08){freeIsNotKey(_0x52ac08,_0x5bc9a9['faxQueues'],'id');for(var _0x529967=0x0,_0x4eeaaa={},_0x46a2b9={};_0x529967<_0x52ac08[_0x3106('0x16')];_0x529967+=0x1){_0x4eeaaa=_0x52ac08[_0x529967];if(_[_0x3106('0x17')](_0x5bc9a9[_0x3106('0xe')][_0x4eeaaa['id']])){_0x5bc9a9[_0x3106('0xe')][_0x4eeaaa['id']]=new FaxQueue(_0x4eeaaa);}else{_0x5bc9a9[_0x3106('0x14')](_0x5bc9a9['faxQueues'][_0x4eeaaa['id']],_0x4eeaaa);}_0x5bc9a9['faxQueues'][_0x4eeaaa['id']][_0x3106('0x1a')]();_0x5bc9a9[_0x3106('0xe')][_0x4eeaaa['id']]['updateRealtime']();}}return _0x5bc9a9[_0x3106('0xe')];};};module[_0x3106('0x1f')]=Realtime; \ No newline at end of file +var _0xd31c=['updateRealtime','initFaxQueues','exports','bluebird','util','lodash','moment','../model/interval','../model/smsQueue','agents','intervals','openchannelQueues','chatQueues','smsQueues','mailQueues','faxQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','hasOwnProperty','prototype','mergeFromDatabase','initAgents','length','isUndefined','initIntervals','initOpenchannelQueues','initChatQueues','updateRouting','initMailQueues'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd31c,0x143));var _0xcd31=function(_0xb4ce16,_0x2bd30c){_0xb4ce16=_0xb4ce16-0x0;var _0x14055c=_0xd31c[_0xb4ce16];return _0x14055c;};'use strict';var BPromise=require(_0xcd31('0x0'));var util=require(_0xcd31('0x1'));var _=require(_0xcd31('0x2'));var moment=require(_0xcd31('0x3'));var Agent=require('../model/agent');var Interval=require(_0xcd31('0x4'));var OpenchannelQueue=require('../model/openchannelQueue');var ChatQueue=require('../model/chatQueue');var SmsQueue=require(_0xcd31('0x5'));var MailQueue=require('../model/mailQueue');var FaxQueue=require('../model/faxQueue');var Realtime=function(){this[_0xcd31('0x6')]={};this[_0xcd31('0x7')]={};this[_0xcd31('0x8')]={};this[_0xcd31('0x9')]={};this[_0xcd31('0xa')]={};this[_0xcd31('0xb')]={};this[_0xcd31('0xc')]={};this[_0xcd31('0xd')]={};this[_0xcd31('0xe')]={};this[_0xcd31('0xf')]={};this[_0xcd31('0x10')]={};this[_0xcd31('0x11')]={};};function freeIsNotKey(_0x267a94,_0x405286,_0x1acd24){var _0x134cc2=_['mapKeys'](_0x267a94,function(_0x346890,_0x2c50ab){return _0x346890[_0x1acd24];});for(var _0x458844 in _0x405286){if(_0x405286[_0xcd31('0x12')](_0x458844)){if(!_0x134cc2[_0x458844]){delete _0x405286[_0x458844];}}}}Realtime[_0xcd31('0x13')][_0xcd31('0x14')]=function(_0x33afa9,_0x212fe9){for(var _0x51349b in _0x212fe9){if(_0x33afa9['hasOwnProperty'](_0x51349b)){_0x33afa9[_0x51349b]=_0x212fe9[_0x51349b];}}};Realtime['prototype'][_0xcd31('0x15')]=function(){var _0x590648=this;return function(_0x1b3e0f){if(_0x1b3e0f){freeIsNotKey(_0x1b3e0f,_0x590648[_0xcd31('0x6')],'id');for(var _0x499735=0x0,_0xac532b={},_0x2d187c={};_0x499735<_0x1b3e0f[_0xcd31('0x16')];_0x499735+=0x1){_0xac532b=_0x1b3e0f[_0x499735];if(_[_0xcd31('0x17')](_0x590648[_0xcd31('0x6')][_0xac532b['id']])){_0x590648[_0xcd31('0x6')][_0xac532b['id']]=new Agent(_0xac532b);}else{_0x590648[_0xcd31('0x14')](_0x590648['agents'][_0xac532b['id']],_0xac532b);}}}return _0x590648[_0xcd31('0x6')];};};Realtime[_0xcd31('0x13')][_0xcd31('0x18')]=function(){var _0x40a796=this;return function(_0x15e773){if(_0x15e773){freeIsNotKey(_0x15e773,_0x40a796['intervals'],'id');for(var _0x1d90a9=0x0,_0x2f1c10={},_0x37eeba={};_0x1d90a9<_0x15e773[_0xcd31('0x16')];_0x1d90a9+=0x1){_0x2f1c10=_0x15e773[_0x1d90a9];if(_[_0xcd31('0x17')](_0x40a796[_0xcd31('0x7')][_0x2f1c10['id']])){_0x40a796[_0xcd31('0x7')][_0x2f1c10['id']]=new Interval(_0x2f1c10);}else{_0x40a796[_0xcd31('0x14')](_0x40a796[_0xcd31('0x7')][_0x2f1c10['id']],_0x2f1c10);}}}return _0x40a796[_0xcd31('0x7')];};};Realtime[_0xcd31('0x13')][_0xcd31('0x19')]=function(){var _0x3f31ff=this;return function(_0x261d55){if(_0x261d55){freeIsNotKey(_0x261d55,_0x3f31ff[_0xcd31('0x8')],'id');for(var _0x2a1aee=0x0,_0x400b03={},_0x337b71={};_0x2a1aee<_0x261d55['length'];_0x2a1aee+=0x1){_0x400b03=_0x261d55[_0x2a1aee];if(_[_0xcd31('0x17')](_0x3f31ff['openchannelQueues'][_0x400b03['id']])){_0x3f31ff['openchannelQueues'][_0x400b03['id']]=new OpenchannelQueue(_0x400b03);}else{_0x3f31ff[_0xcd31('0x14')](_0x3f31ff[_0xcd31('0x8')][_0x400b03['id']],_0x400b03);}_0x3f31ff[_0xcd31('0x8')][_0x400b03['id']]['updateRouting']();_0x3f31ff[_0xcd31('0x8')][_0x400b03['id']]['updateRealtime']();}}return _0x3f31ff[_0xcd31('0x8')];};};Realtime['prototype'][_0xcd31('0x1a')]=function(){var _0x33ff63=this;return function(_0x1be6b3){if(_0x1be6b3){freeIsNotKey(_0x1be6b3,_0x33ff63[_0xcd31('0x9')],'id');for(var _0x273309=0x0,_0x2cfd6e={},_0x258058={};_0x273309<_0x1be6b3[_0xcd31('0x16')];_0x273309+=0x1){_0x2cfd6e=_0x1be6b3[_0x273309];if(_[_0xcd31('0x17')](_0x33ff63[_0xcd31('0x9')][_0x2cfd6e['id']])){_0x33ff63['chatQueues'][_0x2cfd6e['id']]=new ChatQueue(_0x2cfd6e);}else{_0x33ff63[_0xcd31('0x14')](_0x33ff63[_0xcd31('0x9')][_0x2cfd6e['id']],_0x2cfd6e);}_0x33ff63[_0xcd31('0x9')][_0x2cfd6e['id']][_0xcd31('0x1b')]();_0x33ff63[_0xcd31('0x9')][_0x2cfd6e['id']]['updateRealtime']();}}return _0x33ff63['chatQueues'];};};Realtime[_0xcd31('0x13')]['initSmsQueues']=function(){var _0x230bba=this;return function(_0x15ee2f){if(_0x15ee2f){freeIsNotKey(_0x15ee2f,_0x230bba['smsQueues'],'id');for(var _0x29e17d=0x0,_0xe5db8c={},_0x20f307={};_0x29e17d<_0x15ee2f[_0xcd31('0x16')];_0x29e17d+=0x1){_0xe5db8c=_0x15ee2f[_0x29e17d];if(_[_0xcd31('0x17')](_0x230bba[_0xcd31('0xa')][_0xe5db8c['id']])){_0x230bba['smsQueues'][_0xe5db8c['id']]=new SmsQueue(_0xe5db8c);}else{_0x230bba[_0xcd31('0x14')](_0x230bba[_0xcd31('0xa')][_0xe5db8c['id']],_0xe5db8c);}_0x230bba[_0xcd31('0xa')][_0xe5db8c['id']][_0xcd31('0x1b')]();_0x230bba[_0xcd31('0xa')][_0xe5db8c['id']]['updateRealtime']();}}return _0x230bba[_0xcd31('0xa')];};};Realtime[_0xcd31('0x13')][_0xcd31('0x1c')]=function(){var _0x500577=this;return function(_0xc75c6){if(_0xc75c6){freeIsNotKey(_0xc75c6,_0x500577[_0xcd31('0xb')],'id');for(var _0x230305=0x0,_0x3c2721={},_0x3ef276={};_0x230305<_0xc75c6[_0xcd31('0x16')];_0x230305+=0x1){_0x3c2721=_0xc75c6[_0x230305];if(_[_0xcd31('0x17')](_0x500577['mailQueues'][_0x3c2721['id']])){_0x500577[_0xcd31('0xb')][_0x3c2721['id']]=new MailQueue(_0x3c2721);}else{_0x500577[_0xcd31('0x14')](_0x500577[_0xcd31('0xb')][_0x3c2721['id']],_0x3c2721);}_0x500577[_0xcd31('0xb')][_0x3c2721['id']][_0xcd31('0x1b')]();_0x500577['mailQueues'][_0x3c2721['id']][_0xcd31('0x1d')]();}}return _0x500577[_0xcd31('0xb')];};};Realtime[_0xcd31('0x13')][_0xcd31('0x1e')]=function(){var _0x386f27=this;return function(_0x3a2b2c){if(_0x3a2b2c){freeIsNotKey(_0x3a2b2c,_0x386f27[_0xcd31('0xc')],'id');for(var _0x2b24b1=0x0,_0x12d68a={},_0x25459c={};_0x2b24b1<_0x3a2b2c['length'];_0x2b24b1+=0x1){_0x12d68a=_0x3a2b2c[_0x2b24b1];if(_[_0xcd31('0x17')](_0x386f27[_0xcd31('0xc')][_0x12d68a['id']])){_0x386f27[_0xcd31('0xc')][_0x12d68a['id']]=new FaxQueue(_0x12d68a);}else{_0x386f27['mergeFromDatabase'](_0x386f27['faxQueues'][_0x12d68a['id']],_0x12d68a);}_0x386f27['faxQueues'][_0x12d68a['id']]['updateRouting']();_0x386f27['faxQueues'][_0x12d68a['id']][_0xcd31('0x1d')]();}}return _0x386f27[_0xcd31('0xc')];};};module[_0xcd31('0x1f')]=Realtime; \ No newline at end of file diff --git a/server/services/routing/rpc/chatInteraction.js b/server/services/routing/rpc/chatInteraction.js index 31eac50..5ce9150 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 _0x3887=['addTagsToChatInteraction','update','Request','UpdateChatInteraction','updateChatInteraction','addTags'];(function(_0x36bf8f,_0x744f27){var _0x34542a=function(_0x354062){while(--_0x354062){_0x36bf8f['push'](_0x36bf8f['shift']());}};_0x34542a(++_0x744f27);}(_0x3887,0x1f3));var _0x7388=function(_0x15d203,_0x5b93ba){_0x15d203=_0x15d203-0x0;var _0x350cf6=_0x3887[_0x15d203];return _0x350cf6;};'use strict';var client=require('../client');exports[_0x7388('0x0')]=function(_0x5d00f1,_0x22cd88){return client[_0x7388('0x1')](_0x7388('0x2'),{'body':_0x22cd88,'options':{'where':{'id':_0x5d00f1}},'log':_0x7388('0x3')});};exports[_0x7388('0x4')]=function(_0x3fc2d6,_0x10ac1a){return client['Request']('AddTagsToChatInteraction',{'body':_0x10ac1a,'options':{'where':{'id':_0x3fc2d6}},'log':_0x7388('0x5')});}; \ No newline at end of file +var _0x51e1=['addTags','AddTagsToChatInteraction','addTagsToChatInteraction','../client','update','UpdateChatInteraction'];(function(_0x565567,_0x3fc90e){var _0x3aef55=function(_0x375357){while(--_0x375357){_0x565567['push'](_0x565567['shift']());}};_0x3aef55(++_0x3fc90e);}(_0x51e1,0x1cb));var _0x151e=function(_0x138d06,_0x33edf2){_0x138d06=_0x138d06-0x0;var _0x1a01eb=_0x51e1[_0x138d06];return _0x1a01eb;};'use strict';var client=require(_0x151e('0x0'));exports[_0x151e('0x1')]=function(_0xe51982,_0x2d5795){return client['Request'](_0x151e('0x2'),{'body':_0x2d5795,'options':{'where':{'id':_0xe51982}},'log':'updateChatInteraction'});};exports[_0x151e('0x3')]=function(_0x2aeca6,_0x2351b2){return client['Request'](_0x151e('0x4'),{'body':_0x2351b2,'options':{'where':{'id':_0x2aeca6}},'log':_0x151e('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatMessage.js b/server/services/routing/rpc/chatMessage.js index e1d91a6..b718e24 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 _0x69d6=['../client','createChatMessage'];(function(_0x59409e,_0x156953){var _0x1b47bc=function(_0x446a52){while(--_0x446a52){_0x59409e['push'](_0x59409e['shift']());}};_0x1b47bc(++_0x156953);}(_0x69d6,0x9e));var _0x669d=function(_0x35db81,_0x5f1ecd){_0x35db81=_0x35db81-0x0;var _0x4ecb42=_0x69d6[_0x35db81];return _0x4ecb42;};'use strict';var client=require(_0x669d('0x0'));exports['create']=function(_0x3ad5da){return client['Request']('CreateChatMessage',{'body':_0x3ad5da,'log':_0x669d('0x1')});}; \ No newline at end of file +var _0x8287=['Request','CreateChatMessage','createChatMessage','../client','create'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8287,0x161));var _0x7828=function(_0x1deee5,_0x1d4485){_0x1deee5=_0x1deee5-0x0;var _0x1d6c3a=_0x8287[_0x1deee5];return _0x1d6c3a;};'use strict';var client=require(_0x7828('0x0'));exports[_0x7828('0x1')]=function(_0x22914a){return client[_0x7828('0x2')](_0x7828('0x3'),{'body':_0x22914a,'log':_0x7828('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueue.js b/server/services/routing/rpc/chatQueue.js index 42972ab..52902a8 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 _0x0ed5=['chatPause','../client','getChatQueues','Request','GetChatQueue','name','timeout','strategy','User','Agents'];(function(_0x364c24,_0x32bccc){var _0x4d1a73=function(_0x255038){while(--_0x255038){_0x364c24['push'](_0x364c24['shift']());}};_0x4d1a73(++_0x32bccc);}(_0x0ed5,0x17d));var _0x50ed=function(_0x30345a,_0x5b3f8c){_0x30345a=_0x30345a-0x0;var _0x264dc0=_0x0ed5[_0x30345a];return _0x264dc0;};'use strict';var client=require(_0x50ed('0x0'));exports[_0x50ed('0x1')]=function(){return function(){return client[_0x50ed('0x2')](_0x50ed('0x3'),{'options':{'raw':![],'attributes':['id',_0x50ed('0x4'),_0x50ed('0x5'),_0x50ed('0x6')],'include':[{'model':_0x50ed('0x7'),'as':_0x50ed('0x8'),'attributes':['id',_0x50ed('0x4'),'online',_0x50ed('0x9')]}]},'log':_0x50ed('0x1')});};}; \ No newline at end of file +var _0xde25=['timeout','strategy','Agents','chatPause','../client','getChatQueues','GetChatQueue'];(function(_0x4ec936,_0x32fa03){var _0x4ad59b=function(_0x5b26ee){while(--_0x5b26ee){_0x4ec936['push'](_0x4ec936['shift']());}};_0x4ad59b(++_0x32fa03);}(_0xde25,0xc8));var _0x5de2=function(_0x41a4e6,_0x30c11c){_0x41a4e6=_0x41a4e6-0x0;var _0xb27985=_0xde25[_0x41a4e6];return _0xb27985;};'use strict';var client=require(_0x5de2('0x0'));exports[_0x5de2('0x1')]=function(){return function(){return client['Request'](_0x5de2('0x2'),{'options':{'raw':![],'attributes':['id','name',_0x5de2('0x3'),_0x5de2('0x4')],'include':[{'model':'User','as':_0x5de2('0x5'),'attributes':['id','name','online',_0x5de2('0x6')]}]},'log':_0x5de2('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueueReport.js b/server/services/routing/rpc/chatQueueReport.js index ec8ac15..a114286 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 _0x35aa=['CreateChatQueueReport','update','UpdateChatQueueReport','DESC','create','Request'];(function(_0x2ffdee,_0x42beea){var _0x5561b9=function(_0x4fa1b4){while(--_0x4fa1b4){_0x2ffdee['push'](_0x2ffdee['shift']());}};_0x5561b9(++_0x42beea);}(_0x35aa,0xbe));var _0xa35a=function(_0xbcd8d9,_0x16451e){_0xbcd8d9=_0xbcd8d9-0x0;var _0x4e7d8f=_0x35aa[_0xbcd8d9];return _0x4e7d8f;};'use strict';var client=require('../client');exports[_0xa35a('0x0')]=function(_0x2d2970){return client[_0xa35a('0x1')](_0xa35a('0x2'),{'body':_0x2d2970,'log':'CreateChatQueueReport'});};exports[_0xa35a('0x3')]=function(_0x4303b4,_0x24cc2){return client[_0xa35a('0x1')](_0xa35a('0x4'),{'body':_0x24cc2,'options':{'where':{'uniqueid':_0x4303b4},'order':[['id',_0xa35a('0x5')]],'limit':0x1},'log':_0xa35a('0x4')});}; \ No newline at end of file +var _0x8a1b=['UpdateChatQueueReport','DESC','../client','create','Request','CreateChatQueueReport'];(function(_0x3e0e65,_0x476a7c){var _0x4cdfc8=function(_0x4300fa){while(--_0x4300fa){_0x3e0e65['push'](_0x3e0e65['shift']());}};_0x4cdfc8(++_0x476a7c);}(_0x8a1b,0xf8));var _0xb8a1=function(_0x2d8f91,_0x18ae9f){_0x2d8f91=_0x2d8f91-0x0;var _0x168caf=_0x8a1b[_0x2d8f91];return _0x168caf;};'use strict';var client=require(_0xb8a1('0x0'));exports[_0xb8a1('0x1')]=function(_0x50a877){return client[_0xb8a1('0x2')](_0xb8a1('0x3'),{'body':_0x50a877,'log':'CreateChatQueueReport'});};exports['update']=function(_0x3784e8,_0x3b6246){return client[_0xb8a1('0x2')](_0xb8a1('0x4'),{'body':_0x3b6246,'options':{'where':{'uniqueid':_0x3784e8},'order':[['id',_0xb8a1('0x5')]],'limit':0x1},'log':'UpdateChatQueueReport'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxInteraction.js b/server/services/routing/rpc/faxInteraction.js index 504d1c2..1552514 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 _0x1f43=['UpdateFaxInteraction','AddTagsToFaxInteraction','addTagsToFaxInteraction','../client','update','Request'];(function(_0x3a3758,_0x4dd8cf){var _0x1a9234=function(_0x3dda22){while(--_0x3dda22){_0x3a3758['push'](_0x3a3758['shift']());}};_0x1a9234(++_0x4dd8cf);}(_0x1f43,0x13b));var _0x31f4=function(_0x598ccf,_0x5d6f30){_0x598ccf=_0x598ccf-0x0;var _0x182047=_0x1f43[_0x598ccf];return _0x182047;};'use strict';var client=require(_0x31f4('0x0'));exports[_0x31f4('0x1')]=function(_0x3aa5ce,_0x2f83ad){return client[_0x31f4('0x2')](_0x31f4('0x3'),{'body':_0x2f83ad,'options':{'where':{'id':_0x3aa5ce}},'log':'updateFaxInteraction'});};exports['addTags']=function(_0x498ec6,_0x2bd238){return client['Request'](_0x31f4('0x4'),{'body':_0x2bd238,'options':{'where':{'id':_0x498ec6}},'log':_0x31f4('0x5')});}; \ No newline at end of file +var _0xa0f4=['updateFaxInteraction','AddTagsToFaxInteraction','addTagsToFaxInteraction','../client','Request','UpdateFaxInteraction'];(function(_0x5c31ad,_0x2635a2){var _0x2fae28=function(_0x45f360){while(--_0x45f360){_0x5c31ad['push'](_0x5c31ad['shift']());}};_0x2fae28(++_0x2635a2);}(_0xa0f4,0x1a1));var _0x4a0f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa0f4[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0x4a0f('0x0'));exports['update']=function(_0x54683c,_0x11b6c0){return client[_0x4a0f('0x1')](_0x4a0f('0x2'),{'body':_0x11b6c0,'options':{'where':{'id':_0x54683c}},'log':_0x4a0f('0x3')});};exports['addTags']=function(_0x2a072b,_0x2f9f8f){return client[_0x4a0f('0x1')](_0x4a0f('0x4'),{'body':_0x2f9f8f,'options':{'where':{'id':_0x2a072b}},'log':_0x4a0f('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxMessage.js b/server/services/routing/rpc/faxMessage.js index 62e25fb..c5dc5d6 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 _0x0d38=['create','Request','CreateFaxMessage','createFaxMessage'];(function(_0x424501,_0x42096d){var _0xb719af=function(_0x37adcf){while(--_0x37adcf){_0x424501['push'](_0x424501['shift']());}};_0xb719af(++_0x42096d);}(_0x0d38,0x19c));var _0x80d3=function(_0x3177f7,_0xfd504e){_0x3177f7=_0x3177f7-0x0;var _0x43a781=_0x0d38[_0x3177f7];return _0x43a781;};'use strict';var client=require('../client');exports[_0x80d3('0x0')]=function(_0x5e4036){return client[_0x80d3('0x1')](_0x80d3('0x2'),{'body':_0x5e4036,'log':_0x80d3('0x3')});}; \ No newline at end of file +var _0x1d9f=['create','Request','createFaxMessage','../client'];(function(_0x5ccec1,_0x2a2899){var _0x1a3f35=function(_0x3e77f4){while(--_0x3e77f4){_0x5ccec1['push'](_0x5ccec1['shift']());}};_0x1a3f35(++_0x2a2899);}(_0x1d9f,0x147));var _0xf1d9=function(_0x50a110,_0x82320e){_0x50a110=_0x50a110-0x0;var _0xa4dac9=_0x1d9f[_0x50a110];return _0xa4dac9;};'use strict';var client=require(_0xf1d9('0x0'));exports[_0xf1d9('0x1')]=function(_0x1acc6a){return client[_0xf1d9('0x2')]('CreateFaxMessage',{'body':_0x1acc6a,'log':_0xf1d9('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueue.js b/server/services/routing/rpc/faxQueue.js index 639a9f3..970f007 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 _0xe765=['online','../client','getFaxQueues','name','timeout','User'];(function(_0x25067e,_0x3b84fd){var _0x2cfc79=function(_0x40c888){while(--_0x40c888){_0x25067e['push'](_0x25067e['shift']());}};_0x2cfc79(++_0x3b84fd);}(_0xe765,0x79));var _0x5e76=function(_0x1fe05b,_0x5120ec){_0x1fe05b=_0x1fe05b-0x0;var _0x394877=_0xe765[_0x1fe05b];return _0x394877;};'use strict';var client=require(_0x5e76('0x0'));exports[_0x5e76('0x1')]=function(){return function(){return client['Request']('GetFaxQueue',{'options':{'raw':![],'attributes':['id',_0x5e76('0x2'),_0x5e76('0x3'),'strategy'],'include':[{'model':_0x5e76('0x4'),'as':'Agents','attributes':['id',_0x5e76('0x2'),_0x5e76('0x5'),'faxPause']}]},'log':_0x5e76('0x1')});};}; \ No newline at end of file +var _0xee9b=['getFaxQueues','Request','GetFaxQueue','strategy','User','name','online','../client'];(function(_0x416721,_0x3ddf00){var _0x5e2309=function(_0x5a264d){while(--_0x5a264d){_0x416721['push'](_0x416721['shift']());}};_0x5e2309(++_0x3ddf00);}(_0xee9b,0x13f));var _0xbee9=function(_0x2477b8,_0x2fedfb){_0x2477b8=_0x2477b8-0x0;var _0x232444=_0xee9b[_0x2477b8];return _0x232444;};'use strict';var client=require(_0xbee9('0x0'));exports[_0xbee9('0x1')]=function(){return function(){return client[_0xbee9('0x2')](_0xbee9('0x3'),{'options':{'raw':![],'attributes':['id','name','timeout',_0xbee9('0x4')],'include':[{'model':_0xbee9('0x5'),'as':'Agents','attributes':['id',_0xbee9('0x6'),_0xbee9('0x7'),'faxPause']}]},'log':'getFaxQueues'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueueReport.js b/server/services/routing/rpc/faxQueueReport.js index 3f92352..aa0acb8 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 _0x8086=['CreateFaxQueueReport','update','DESC','UpdateFaxQueueReport','../client','create','Request'];(function(_0xa6dc4a,_0x36cc61){var _0x4f5989=function(_0x4c743e){while(--_0x4c743e){_0xa6dc4a['push'](_0xa6dc4a['shift']());}};_0x4f5989(++_0x36cc61);}(_0x8086,0xac));var _0x6808=function(_0x28e23d,_0x3c9a36){_0x28e23d=_0x28e23d-0x0;var _0x5bd86d=_0x8086[_0x28e23d];return _0x5bd86d;};'use strict';var client=require(_0x6808('0x0'));exports[_0x6808('0x1')]=function(_0x55aad4){return client[_0x6808('0x2')](_0x6808('0x3'),{'body':_0x55aad4,'log':_0x6808('0x3')});};exports[_0x6808('0x4')]=function(_0x3307d7,_0x13324b){return client[_0x6808('0x2')]('UpdateFaxQueueReport',{'body':_0x13324b,'options':{'where':{'uniqueid':_0x3307d7},'order':[['id',_0x6808('0x5')]],'limit':0x1},'log':_0x6808('0x6')});}; \ No newline at end of file +var _0xaec5=['Request','UpdateFaxQueueReport','DESC','create','CreateFaxQueueReport'];(function(_0x489e1f,_0xab72f2){var _0x8a227d=function(_0x25dc66){while(--_0x25dc66){_0x489e1f['push'](_0x489e1f['shift']());}};_0x8a227d(++_0xab72f2);}(_0xaec5,0x67));var _0x5aec=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xaec5[_0x3dd15e];return _0x231fd0;};'use strict';var client=require('../client');exports[_0x5aec('0x0')]=function(_0x277681){return client['Request'](_0x5aec('0x1'),{'body':_0x277681,'log':_0x5aec('0x1')});};exports['update']=function(_0x333824,_0x25325b){return client[_0x5aec('0x2')](_0x5aec('0x3'),{'body':_0x25325b,'options':{'where':{'uniqueid':_0x333824},'order':[['id',_0x5aec('0x4')]],'limit':0x1},'log':'UpdateFaxQueueReport'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/interval.js b/server/services/routing/rpc/interval.js index 0528570..8efa348 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 _0xcecc=['../client','Request','Interval','Intervals','name','interval'];(function(_0x32bf52,_0x40739c){var _0x2b8c7f=function(_0x2ce44f){while(--_0x2ce44f){_0x32bf52['push'](_0x32bf52['shift']());}};_0x2b8c7f(++_0x40739c);}(_0xcecc,0x186));var _0xccec=function(_0x528db1,_0x53b516){_0x528db1=_0x528db1-0x0;var _0x4cab20=_0xcecc[_0x528db1];return _0x4cab20;};'use strict';var client=require(_0xccec('0x0'));exports['getIntervals']=function(){return function(){return client[_0xccec('0x1')]('GetInterval',{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id','name'],'include':[{'model':_0xccec('0x2'),'as':_0xccec('0x3'),'attributes':['id',_0xccec('0x4'),_0xccec('0x5')]}]},'log':'getIntervals'});};}; \ No newline at end of file +var _0x065e=['Interval','Intervals','getIntervals','../client','name'];(function(_0x3fa7d3,_0x37f83c){var _0x4c51bd=function(_0x59e85b){while(--_0x59e85b){_0x3fa7d3['push'](_0x3fa7d3['shift']());}};_0x4c51bd(++_0x37f83c);}(_0x065e,0x1a7));var _0xe065=function(_0x220ae9,_0x1d9cfa){_0x220ae9=_0x220ae9-0x0;var _0x164801=_0x065e[_0x220ae9];return _0x164801;};'use strict';var client=require(_0xe065('0x0'));exports['getIntervals']=function(){return function(){return client['Request']('GetInterval',{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0xe065('0x1')],'include':[{'model':_0xe065('0x2'),'as':_0xe065('0x3'),'attributes':['id','name','interval']}]},'log':_0xe065('0x4')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailInteraction.js b/server/services/routing/rpc/mailInteraction.js index 79c4cbb..e2929e7 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 _0xa1b3=['Request','AddTagsToMailInteraction','addTagsToChatInteraction','UpdateMailInteraction','updateMailInteraction','addTags'];(function(_0x3f876d,_0x1ec3d8){var _0x3f0c73=function(_0x3a28d2){while(--_0x3a28d2){_0x3f876d['push'](_0x3f876d['shift']());}};_0x3f0c73(++_0x1ec3d8);}(_0xa1b3,0xb1));var _0x3a1b=function(_0x8c9927,_0x33dc3d){_0x8c9927=_0x8c9927-0x0;var _0x5b8a9c=_0xa1b3[_0x8c9927];return _0x5b8a9c;};'use strict';var client=require('../client');exports['update']=function(_0xf3a9e,_0x11e3b2){return client['Request'](_0x3a1b('0x0'),{'body':_0x11e3b2,'options':{'where':{'id':_0xf3a9e}},'log':_0x3a1b('0x1')});};exports[_0x3a1b('0x2')]=function(_0x5a42ce,_0x3e6758){return client[_0x3a1b('0x3')](_0x3a1b('0x4'),{'body':_0x3e6758,'options':{'where':{'id':_0x5a42ce}},'log':_0x3a1b('0x5')});}; \ No newline at end of file +var _0x41b6=['addTags','AddTagsToMailInteraction','update','Request','UpdateMailInteraction','updateMailInteraction'];(function(_0x519435,_0x826087){var _0x297ac3=function(_0x136519){while(--_0x136519){_0x519435['push'](_0x519435['shift']());}};_0x297ac3(++_0x826087);}(_0x41b6,0x15e));var _0x641b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x41b6[_0x3dd15e];return _0x231fd0;};'use strict';var client=require('../client');exports[_0x641b('0x0')]=function(_0x22582c,_0x227b3a){return client[_0x641b('0x1')](_0x641b('0x2'),{'body':_0x227b3a,'options':{'where':{'id':_0x22582c}},'log':_0x641b('0x3')});};exports[_0x641b('0x4')]=function(_0x4b088e,_0x40782a){return client[_0x641b('0x1')](_0x641b('0x5'),{'body':_0x40782a,'options':{'where':{'id':_0x4b088e}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailMessage.js b/server/services/routing/rpc/mailMessage.js index 90307ec..2685e34 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 _0x12dc=['create','Request','CreateMailMessage','createMailMessage','../client'];(function(_0x226b69,_0x3d91f8){var _0x1e9884=function(_0x13a9a8){while(--_0x13a9a8){_0x226b69['push'](_0x226b69['shift']());}};_0x1e9884(++_0x3d91f8);}(_0x12dc,0xef));var _0xc12d=function(_0x23600e,_0x5dcaf3){_0x23600e=_0x23600e-0x0;var _0x3a286d=_0x12dc[_0x23600e];return _0x3a286d;};'use strict';var client=require(_0xc12d('0x0'));exports[_0xc12d('0x1')]=function(_0x4b046a){return client[_0xc12d('0x2')](_0xc12d('0x3'),{'body':_0x4b046a,'log':_0xc12d('0x4')});}; \ No newline at end of file +var _0x8978=['create','Request','CreateMailMessage','createMailMessage'];(function(_0x57f14c,_0x36cb26){var _0x41444c=function(_0x262c4b){while(--_0x262c4b){_0x57f14c['push'](_0x57f14c['shift']());}};_0x41444c(++_0x36cb26);}(_0x8978,0x6c));var _0x8897=function(_0x5bd426,_0x4878e5){_0x5bd426=_0x5bd426-0x0;var _0x23a7eb=_0x8978[_0x5bd426];return _0x23a7eb;};'use strict';var client=require('../client');exports[_0x8897('0x0')]=function(_0x355dd9){return client[_0x8897('0x1')](_0x8897('0x2'),{'body':_0x355dd9,'log':_0x8897('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueue.js b/server/services/routing/rpc/mailQueue.js index ff4e9fd..79a8610 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 _0x8027=['../client','getMailQueues','GetMailQueue','name','online','mailPause'];(function(_0x34001d,_0x53da30){var _0x38ebc3=function(_0x1dc0f1){while(--_0x1dc0f1){_0x34001d['push'](_0x34001d['shift']());}};_0x38ebc3(++_0x53da30);}(_0x8027,0xba));var _0x7802=function(_0x512eb0,_0x27edfe){_0x512eb0=_0x512eb0-0x0;var _0x1378fe=_0x8027[_0x512eb0];return _0x1378fe;};'use strict';var client=require(_0x7802('0x0'));exports[_0x7802('0x1')]=function(){return function(){return client['Request'](_0x7802('0x2'),{'options':{'raw':![],'attributes':['id',_0x7802('0x3'),'timeout','strategy'],'include':[{'model':'User','as':'Agents','attributes':['id',_0x7802('0x3'),_0x7802('0x4'),_0x7802('0x5')]}]},'log':'getMailQueues'});};}; \ No newline at end of file +var _0xfdc2=['strategy','User','Agents','name','online','mailPause','../client','getMailQueues','Request','timeout'];(function(_0x4ef8bc,_0x5eb00d){var _0x5d4d56=function(_0x57b3cd){while(--_0x57b3cd){_0x4ef8bc['push'](_0x4ef8bc['shift']());}};_0x5d4d56(++_0x5eb00d);}(_0xfdc2,0x1dc));var _0x2fdc=function(_0x37fb69,_0x4eb63d){_0x37fb69=_0x37fb69-0x0;var _0x157708=_0xfdc2[_0x37fb69];return _0x157708;};'use strict';var client=require(_0x2fdc('0x0'));exports[_0x2fdc('0x1')]=function(){return function(){return client[_0x2fdc('0x2')]('GetMailQueue',{'options':{'raw':![],'attributes':['id','name',_0x2fdc('0x3'),_0x2fdc('0x4')],'include':[{'model':_0x2fdc('0x5'),'as':_0x2fdc('0x6'),'attributes':['id',_0x2fdc('0x7'),_0x2fdc('0x8'),_0x2fdc('0x9')]}]},'log':_0x2fdc('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueueReport.js b/server/services/routing/rpc/mailQueueReport.js index daea13d..b35df6a 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 _0xac3a=['Request','CreateMailQueueReport','UpdateMailQueueReport','DESC'];(function(_0x59a342,_0x220ae7){var _0xfca82b=function(_0x310de8){while(--_0x310de8){_0x59a342['push'](_0x59a342['shift']());}};_0xfca82b(++_0x220ae7);}(_0xac3a,0x1c4));var _0xaac3=function(_0x6e1239,_0x3562ac){_0x6e1239=_0x6e1239-0x0;var _0x418150=_0xac3a[_0x6e1239];return _0x418150;};'use strict';var client=require('../client');exports['create']=function(_0x4cbdc2){return client[_0xaac3('0x0')]('CreateMailQueueReport',{'body':_0x4cbdc2,'log':_0xaac3('0x1')});};exports['update']=function(_0x13527a,_0x567f62){return client[_0xaac3('0x0')](_0xaac3('0x2'),{'body':_0x567f62,'options':{'where':{'uniqueid':_0x13527a},'order':[['id',_0xaac3('0x3')]],'limit':0x1},'log':_0xaac3('0x2')});}; \ No newline at end of file +var _0x13dd=['UpdateMailQueueReport','create','Request','CreateMailQueueReport'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x13dd,0x109));var _0xd13d=function(_0x562f3b,_0x4c65ae){_0x562f3b=_0x562f3b-0x0;var _0x1edd55=_0x13dd[_0x562f3b];return _0x1edd55;};'use strict';var client=require('../client');exports[_0xd13d('0x0')]=function(_0x2dd286){return client[_0xd13d('0x1')](_0xd13d('0x2'),{'body':_0x2dd286,'log':_0xd13d('0x2')});};exports['update']=function(_0x6175be,_0x27051e){return client['Request']('UpdateMailQueueReport',{'body':_0x27051e,'options':{'where':{'uniqueid':_0x6175be},'order':[['id','DESC']],'limit':0x1},'log':_0xd13d('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelInteraction.js b/server/services/routing/rpc/openchannelInteraction.js index e9b3a0e..fa1c082 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 _0x6aff=['../client','update','Request','UpdateOpenchannelInteraction','updateOpenchannelInteraction','AddTagsToOpenchannelInteraction','addTagsToChatInteraction'];(function(_0x6bd897,_0x325332){var _0x5ee8fe=function(_0x5ba4f8){while(--_0x5ba4f8){_0x6bd897['push'](_0x6bd897['shift']());}};_0x5ee8fe(++_0x325332);}(_0x6aff,0xd2));var _0xf6af=function(_0x448969,_0x306117){_0x448969=_0x448969-0x0;var _0x363f29=_0x6aff[_0x448969];return _0x363f29;};'use strict';var client=require(_0xf6af('0x0'));exports[_0xf6af('0x1')]=function(_0x55f826,_0x50dc69){return client[_0xf6af('0x2')](_0xf6af('0x3'),{'body':_0x50dc69,'options':{'where':{'id':_0x55f826}},'log':_0xf6af('0x4')});};exports['addTags']=function(_0x37a6c8,_0x250a11){return client[_0xf6af('0x2')](_0xf6af('0x5'),{'body':_0x250a11,'options':{'where':{'id':_0x37a6c8}},'log':_0xf6af('0x6')});}; \ No newline at end of file +var _0x2b95=['updateOpenchannelInteraction','addTags','../client','update','Request','UpdateOpenchannelInteraction'];(function(_0x50801c,_0x519c5e){var _0x7d1318=function(_0x35fd96){while(--_0x35fd96){_0x50801c['push'](_0x50801c['shift']());}};_0x7d1318(++_0x519c5e);}(_0x2b95,0x140));var _0x52b9=function(_0x44dba1,_0x270ad5){_0x44dba1=_0x44dba1-0x0;var _0x2fbd3f=_0x2b95[_0x44dba1];return _0x2fbd3f;};'use strict';var client=require(_0x52b9('0x0'));exports[_0x52b9('0x1')]=function(_0x50e3f7,_0x421957){return client[_0x52b9('0x2')](_0x52b9('0x3'),{'body':_0x421957,'options':{'where':{'id':_0x50e3f7}},'log':_0x52b9('0x4')});};exports[_0x52b9('0x5')]=function(_0x37cb3d,_0x5a3856){return client[_0x52b9('0x2')]('AddTagsToOpenchannelInteraction',{'body':_0x5a3856,'options':{'where':{'id':_0x37cb3d}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelMessage.js b/server/services/routing/rpc/openchannelMessage.js index 259c47c..9342271 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 _0x878f=['Request','CreateOpenchannelMessage','createOpenchannelMessage','create'];(function(_0x2558fe,_0x4d359c){var _0x4a05bc=function(_0x440389){while(--_0x440389){_0x2558fe['push'](_0x2558fe['shift']());}};_0x4a05bc(++_0x4d359c);}(_0x878f,0x173));var _0xf878=function(_0x3a310a,_0x5f231e){_0x3a310a=_0x3a310a-0x0;var _0x934da7=_0x878f[_0x3a310a];return _0x934da7;};'use strict';var client=require('../client');exports[_0xf878('0x0')]=function(_0x658976){return client[_0xf878('0x1')](_0xf878('0x2'),{'body':_0x658976,'log':_0xf878('0x3')});}; \ No newline at end of file +var _0x91a7=['create','Request','createOpenchannelMessage'];(function(_0x504ed7,_0x29e568){var _0xe0df38=function(_0x45d453){while(--_0x45d453){_0x504ed7['push'](_0x504ed7['shift']());}};_0xe0df38(++_0x29e568);}(_0x91a7,0xe7));var _0x791a=function(_0x369cd2,_0x2a70bf){_0x369cd2=_0x369cd2-0x0;var _0x527087=_0x91a7[_0x369cd2];return _0x527087;};'use strict';var client=require('../client');exports[_0x791a('0x0')]=function(_0x3d6eab){return client[_0x791a('0x1')]('CreateOpenchannelMessage',{'body':_0x3d6eab,'log':_0x791a('0x2')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueue.js b/server/services/routing/rpc/openchannelQueue.js index 5530966..9afe2f8 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 _0xb8b5=['getOpenchannelQueues','Request','name','timeout','strategy','User','Agents','online','openchannelPause'];(function(_0x9e0cb3,_0x9cd497){var _0x5926b7=function(_0x30e82d){while(--_0x30e82d){_0x9e0cb3['push'](_0x9e0cb3['shift']());}};_0x5926b7(++_0x9cd497);}(_0xb8b5,0x156));var _0x5b8b=function(_0x524d31,_0x589ad9){_0x524d31=_0x524d31-0x0;var _0xe80b01=_0xb8b5[_0x524d31];return _0xe80b01;};'use strict';var client=require('../client');exports[_0x5b8b('0x0')]=function(){return function(){return client[_0x5b8b('0x1')]('GetOpenchannelQueue',{'options':{'raw':![],'attributes':['id',_0x5b8b('0x2'),_0x5b8b('0x3'),_0x5b8b('0x4')],'include':[{'model':_0x5b8b('0x5'),'as':_0x5b8b('0x6'),'attributes':['id','name',_0x5b8b('0x7'),_0x5b8b('0x8')]}]},'log':_0x5b8b('0x0')});};}; \ No newline at end of file +var _0xd9c2=['strategy','Agents','online','openchannelPause','getOpenchannelQueues','../client','name','timeout'];(function(_0xd22d95,_0xc59f8f){var _0x15d7a3=function(_0x3db95c){while(--_0x3db95c){_0xd22d95['push'](_0xd22d95['shift']());}};_0x15d7a3(++_0xc59f8f);}(_0xd9c2,0x1ed));var _0x2d9c=function(_0x2445e2,_0xc4a747){_0x2445e2=_0x2445e2-0x0;var _0x1e5736=_0xd9c2[_0x2445e2];return _0x1e5736;};'use strict';var client=require(_0x2d9c('0x0'));exports['getOpenchannelQueues']=function(){return function(){return client['Request']('GetOpenchannelQueue',{'options':{'raw':![],'attributes':['id',_0x2d9c('0x1'),_0x2d9c('0x2'),_0x2d9c('0x3')],'include':[{'model':'User','as':_0x2d9c('0x4'),'attributes':['id',_0x2d9c('0x1'),_0x2d9c('0x5'),_0x2d9c('0x6')]}]},'log':_0x2d9c('0x7')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueueReport.js b/server/services/routing/rpc/openchannelQueueReport.js index 8ebb2e1..d7e180e 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 _0x1cfd=['UpdateOpenchannelQueueReport','DESC','../client','create','Request','update'];(function(_0x125fe7,_0x42398d){var _0x417568=function(_0x586c1c){while(--_0x586c1c){_0x125fe7['push'](_0x125fe7['shift']());}};_0x417568(++_0x42398d);}(_0x1cfd,0x1b2));var _0xd1cf=function(_0x4a2f9c,_0x88d18e){_0x4a2f9c=_0x4a2f9c-0x0;var _0x283eae=_0x1cfd[_0x4a2f9c];return _0x283eae;};'use strict';var client=require(_0xd1cf('0x0'));exports[_0xd1cf('0x1')]=function(_0x1a8443){return client[_0xd1cf('0x2')]('CreateOpenchannelQueueReport',{'body':_0x1a8443,'log':'CreateOpenchannelQueueReport'});};exports[_0xd1cf('0x3')]=function(_0x1103e1,_0x1a5579){return client[_0xd1cf('0x2')](_0xd1cf('0x4'),{'body':_0x1a5579,'options':{'where':{'uniqueid':_0x1103e1},'order':[['id',_0xd1cf('0x5')]],'limit':0x1},'log':_0xd1cf('0x4')});}; \ No newline at end of file +var _0xc130=['UpdateOpenchannelQueueReport','../client','create','Request','CreateOpenchannelQueueReport','update','DESC'];(function(_0x4af477,_0x305f48){var _0x498179=function(_0x45a988){while(--_0x45a988){_0x4af477['push'](_0x4af477['shift']());}};_0x498179(++_0x305f48);}(_0xc130,0xcc));var _0x0c13=function(_0x447308,_0x2c7c30){_0x447308=_0x447308-0x0;var _0x57b91f=_0xc130[_0x447308];return _0x57b91f;};'use strict';var client=require(_0x0c13('0x0'));exports[_0x0c13('0x1')]=function(_0x23aa0f){return client[_0x0c13('0x2')](_0x0c13('0x3'),{'body':_0x23aa0f,'log':_0x0c13('0x3')});};exports[_0x0c13('0x4')]=function(_0x189345,_0x300c42){return client['Request']('UpdateOpenchannelQueueReport',{'body':_0x300c42,'options':{'where':{'uniqueid':_0x189345},'order':[['id',_0x0c13('0x5')]],'limit':0x1},'log':_0x0c13('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsInteraction.js b/server/services/routing/rpc/smsInteraction.js index a7b52dd..a2b465e 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 _0x62ce=['AddTagsToSmsInteraction','addTagsToSmsInteraction','update','UpdateSmsInteraction','updateSmsInteraction','Request'];(function(_0x104b33,_0x3691da){var _0x48e0e0=function(_0x12b107){while(--_0x12b107){_0x104b33['push'](_0x104b33['shift']());}};_0x48e0e0(++_0x3691da);}(_0x62ce,0x1a6));var _0xe62c=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x62ce[_0x2dafbe];return _0x58a45a;};'use strict';var client=require('../client');exports[_0xe62c('0x0')]=function(_0x425ee8,_0x497625){return client['Request'](_0xe62c('0x1'),{'body':_0x497625,'options':{'where':{'id':_0x425ee8}},'log':_0xe62c('0x2')});};exports['addTags']=function(_0x8f16d0,_0x34632b){return client[_0xe62c('0x3')](_0xe62c('0x4'),{'body':_0x34632b,'options':{'where':{'id':_0x8f16d0}},'log':_0xe62c('0x5')});}; \ No newline at end of file +var _0x8671=['updateSmsInteraction','addTags','AddTagsToSmsInteraction','../client','Request'];(function(_0x248238,_0xe31996){var _0xb93bc4=function(_0xa7489e){while(--_0xa7489e){_0x248238['push'](_0x248238['shift']());}};_0xb93bc4(++_0xe31996);}(_0x8671,0x1ed));var _0x1867=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0x8671[_0xa1e3e3];return _0xc980e9;};'use strict';var client=require(_0x1867('0x0'));exports['update']=function(_0x36bbd5,_0x26bfe2){return client[_0x1867('0x1')]('UpdateSmsInteraction',{'body':_0x26bfe2,'options':{'where':{'id':_0x36bbd5}},'log':_0x1867('0x2')});};exports[_0x1867('0x3')]=function(_0x4873cb,_0x3cff5d){return client['Request'](_0x1867('0x4'),{'body':_0x3cff5d,'options':{'where':{'id':_0x4873cb}},'log':'addTagsToSmsInteraction'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsMessage.js b/server/services/routing/rpc/smsMessage.js index b55bdfd..6986598 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 _0xcb3d=['create','createSmsMessage','../client'];(function(_0x1679fa,_0x4ddff1){var _0x55f295=function(_0x2691ad){while(--_0x2691ad){_0x1679fa['push'](_0x1679fa['shift']());}};_0x55f295(++_0x4ddff1);}(_0xcb3d,0x71));var _0xdcb3=function(_0x237e36,_0x30d6ae){_0x237e36=_0x237e36-0x0;var _0xf89afa=_0xcb3d[_0x237e36];return _0xf89afa;};'use strict';var client=require(_0xdcb3('0x0'));exports[_0xdcb3('0x1')]=function(_0x37d996){return client['Request']('CreateSmsMessage',{'body':_0x37d996,'log':_0xdcb3('0x2')});}; \ No newline at end of file +var _0x0d17=['create','CreateSmsMessage','createSmsMessage'];(function(_0x2d1187,_0x1d0103){var _0x31bfdf=function(_0xf0f2bb){while(--_0xf0f2bb){_0x2d1187['push'](_0x2d1187['shift']());}};_0x31bfdf(++_0x1d0103);}(_0x0d17,0x93));var _0x70d1=function(_0x281a8e,_0x4acc35){_0x281a8e=_0x281a8e-0x0;var _0xa5461f=_0x0d17[_0x281a8e];return _0xa5461f;};'use strict';var client=require('../client');exports[_0x70d1('0x0')]=function(_0x1461ab){return client['Request'](_0x70d1('0x1'),{'body':_0x1461ab,'log':_0x70d1('0x2')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueue.js b/server/services/routing/rpc/smsQueue.js index b62fab5..739de99 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 _0xdccd=['GetSmsQueue','name','strategy','User','Agents','online','../client','getSmsQueues','Request'];(function(_0x3a9703,_0x49e2c8){var _0xc7ed8e=function(_0x5b79bd){while(--_0x5b79bd){_0x3a9703['push'](_0x3a9703['shift']());}};_0xc7ed8e(++_0x49e2c8);}(_0xdccd,0x102));var _0xddcc=function(_0x45703c,_0x13fea8){_0x45703c=_0x45703c-0x0;var _0x5689b7=_0xdccd[_0x45703c];return _0x5689b7;};'use strict';var client=require(_0xddcc('0x0'));exports[_0xddcc('0x1')]=function(){return function(){return client[_0xddcc('0x2')](_0xddcc('0x3'),{'options':{'raw':![],'attributes':['id',_0xddcc('0x4'),'timeout',_0xddcc('0x5')],'include':[{'model':_0xddcc('0x6'),'as':_0xddcc('0x7'),'attributes':['id',_0xddcc('0x4'),_0xddcc('0x8'),'smsPause']}]},'log':_0xddcc('0x1')});};}; \ No newline at end of file +var _0x3021=['strategy','User','Agents','online','smsPause','../client','Request','name'];(function(_0xefd519,_0xc62635){var _0x4bb882=function(_0x37e0a1){while(--_0x37e0a1){_0xefd519['push'](_0xefd519['shift']());}};_0x4bb882(++_0xc62635);}(_0x3021,0xfd));var _0x1302=function(_0x3a01f6,_0x2014fa){_0x3a01f6=_0x3a01f6-0x0;var _0x497c61=_0x3021[_0x3a01f6];return _0x497c61;};'use strict';var client=require(_0x1302('0x0'));exports['getSmsQueues']=function(){return function(){return client[_0x1302('0x1')]('GetSmsQueue',{'options':{'raw':![],'attributes':['id',_0x1302('0x2'),'timeout',_0x1302('0x3')],'include':[{'model':_0x1302('0x4'),'as':_0x1302('0x5'),'attributes':['id',_0x1302('0x2'),_0x1302('0x6'),_0x1302('0x7')]}]},'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 af4eacd..bc5989d 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 _0xd397=['UpdateSmsQueueReport','DESC','../client','create','Request','CreateSmsQueueReport','update'];(function(_0xa7d77f,_0x34bc29){var _0x4351bf=function(_0x9ba889){while(--_0x9ba889){_0xa7d77f['push'](_0xa7d77f['shift']());}};_0x4351bf(++_0x34bc29);}(_0xd397,0x113));var _0x7d39=function(_0x560b8d,_0x12ebe3){_0x560b8d=_0x560b8d-0x0;var _0x54b9bd=_0xd397[_0x560b8d];return _0x54b9bd;};'use strict';var client=require(_0x7d39('0x0'));exports[_0x7d39('0x1')]=function(_0x549bf7){return client[_0x7d39('0x2')](_0x7d39('0x3'),{'body':_0x549bf7,'log':_0x7d39('0x3')});};exports[_0x7d39('0x4')]=function(_0x5ac116,_0x36487d){return client['Request'](_0x7d39('0x5'),{'body':_0x36487d,'options':{'where':{'uniqueid':_0x5ac116},'order':[['id',_0x7d39('0x6')]],'limit':0x1},'log':_0x7d39('0x5')});}; \ No newline at end of file +var _0x98d4=['CreateSmsQueueReport','UpdateSmsQueueReport','../client','create'];(function(_0x19ed07,_0x500c9e){var _0x2d14ab=function(_0x1e716b){while(--_0x1e716b){_0x19ed07['push'](_0x19ed07['shift']());}};_0x2d14ab(++_0x500c9e);}(_0x98d4,0x13a));var _0x498d=function(_0x5a99af,_0xe409d0){_0x5a99af=_0x5a99af-0x0;var _0xd903c9=_0x98d4[_0x5a99af];return _0xd903c9;};'use strict';var client=require(_0x498d('0x0'));exports[_0x498d('0x1')]=function(_0x250a21){return client['Request'](_0x498d('0x2'),{'body':_0x250a21,'log':_0x498d('0x2')});};exports['update']=function(_0x321c33,_0x49eb1c){return client['Request'](_0x498d('0x3'),{'body':_0x49eb1c,'options':{'where':{'uniqueid':_0x321c33},'order':[['id','DESC']],'limit':0x1},'log':'UpdateSmsQueueReport'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/user.js b/server/services/routing/rpc/user.js index d44d4f2..9a5c3d4 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 _0x917d=['getAgents','agent','name','online','pauseType','voicePause','chatPause','mailPause','faxPause','openchannelPause','chatCapacity','mailCapacity','smsCapacity','openchannelCapacity','../client'];(function(_0x452968,_0x31e391){var _0xb6f9ae=function(_0x263987){while(--_0x263987){_0x452968['push'](_0x452968['shift']());}};_0xb6f9ae(++_0x31e391);}(_0x917d,0x95));var _0xd917=function(_0xf66f4b,_0x3fafe4){_0xf66f4b=_0xf66f4b-0x0;var _0x36a588=_0x917d[_0xf66f4b];return _0x36a588;};'use strict';var client=require(_0xd917('0x0'));exports[_0xd917('0x1')]=function(){return function(){return client['Request']('GetUser',{'options':{'raw':!![],'where':{'role':_0xd917('0x2')},'attributes':['id',_0xd917('0x3'),_0xd917('0x4'),_0xd917('0x5'),'lastPauseAt',_0xd917('0x6'),_0xd917('0x7'),_0xd917('0x8'),_0xd917('0x9'),'smsPause',_0xd917('0xa'),_0xd917('0xb'),_0xd917('0xc'),'faxCapacity',_0xd917('0xd'),_0xd917('0xe')]},'log':_0xd917('0x1')});};}; \ No newline at end of file +var _0x427d=['online','pauseType','lastPauseAt','chatPause','faxPause','smsPause','openchannelPause','faxCapacity','smsCapacity','openchannelCapacity','getAgents','Request','GetUser','agent','name'];(function(_0x424a9a,_0x2dd9af){var _0xa7831c=function(_0x512534){while(--_0x512534){_0x424a9a['push'](_0x424a9a['shift']());}};_0xa7831c(++_0x2dd9af);}(_0x427d,0x1a0));var _0xd427=function(_0x2d13d9,_0x1e0363){_0x2d13d9=_0x2d13d9-0x0;var _0x3a5651=_0x427d[_0x2d13d9];return _0x3a5651;};'use strict';var client=require('../client');exports['getAgents']=function(){return function(){return client[_0xd427('0x0')](_0xd427('0x1'),{'options':{'raw':!![],'where':{'role':_0xd427('0x2')},'attributes':['id',_0xd427('0x3'),_0xd427('0x4'),_0xd427('0x5'),_0xd427('0x6'),'voicePause',_0xd427('0x7'),'mailPause',_0xd427('0x8'),_0xd427('0x9'),_0xd427('0xa'),'chatCapacity','mailCapacity',_0xd427('0xb'),_0xd427('0xc'),_0xd427('0xd')]},'log':_0xd427('0xe')});};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/agent.js b/server/services/routing/server/applications/agent.js index ca1d4dd..d5ca6f6 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 _0xb927=['[%s][AGENT]\x20ROUTING\x20END','next','agent','[%s][AGENT]\x20agent\x20not\x20found\x20%s','log','[%s][QUEUE]\x20%s','stack','validate','lodash','util','seq-queue','../../../../config/logger','routing','./strategy','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','timeout\x20is\x20a\x20number','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','error','[%s][AGENT]\x20%s','map','join','agents','timeout','createQueue','atimeout','channel','format','START:%s','rules','end','info','[%s][AGENT]\x20ROUTING\x20STOPPED','stop','close'];(function(_0xfb0cfd,_0x500179){var _0x2fd8aa=function(_0xccb501){while(--_0xccb501){_0xfb0cfd['push'](_0xfb0cfd['shift']());}};_0x2fd8aa(++_0x500179);}(_0xb927,0x103));var _0x7b92=function(_0x10ee7a,_0x5e6790){_0x10ee7a=_0x10ee7a-0x0;var _0xba8756=_0xb927[_0x10ee7a];return _0xba8756;};'use strict';var schema=require(_0x7b92('0x0'));var _=require(_0x7b92('0x1'));var util=require(_0x7b92('0x2'));var seqqueue=require(_0x7b92('0x3'));var logger=require(_0x7b92('0x4'))(_0x7b92('0x5'));var strategy=require(_0x7b92('0x6'));var queue=schema({'name':{'type':'string','required':!![],'message':_0x7b92('0x7')},'timeout':{'type':'number','message':_0x7b92('0x8')}});function writeLog(_0x93eeb1,_0x484777,_0x1488b9){return logger['info'](util['format'](_0x7b92('0x9'),_0x93eeb1,_0x484777[_0x7b92('0xa')],_0x1488b9));}function handleFindAgent(_0x1d40fa){return function(_0x48d872){return _0x48d872['name'][_0x7b92('0xb')]()===_0x1d40fa['toLowerCase']();};}exports['consequence']=function(_0x3ecbb4,_0x2b189e,_0x3ffe20,_0x5cfcc1){return function(_0x2a6426){try{var _0x9c5bc0={'name':_0x2b189e[0x0],'timeout':_0x2b189e[0x1]};var _0x327356=queue['validate'](_0x9c5bc0,{'typecast':!![]});if(_0x327356['length']){logger[_0x7b92('0xc')](_0x7b92('0xd'),_0x3ecbb4,_[_0x7b92('0xe')](_0x327356,'message')[_0x7b92('0xf')](',\x20'));_0x2a6426['stop']();}else{var _0x4edf63=_['find'](_0x3ffe20[_0x7b92('0x10')],handleFindAgent(_0x9c5bc0[_0x7b92('0xa')]));if(_0x4edf63){var _0x1770cc=(_0x9c5bc0[_0x7b92('0x11')]||0xa)*0x3e8;var _0x24b15d,_0x2e374d;var _0x44851c=seqqueue[_0x7b92('0x12')](_0x1770cc);_0x44851c['id']=_0x3ecbb4;_0x44851c[_0x7b92('0x13')]=_0x1770cc;_0x44851c[_0x7b92('0x14')]=_0x5cfcc1[_0x7b92('0x14')];writeLog(_0x3ecbb4,_0x4edf63,util[_0x7b92('0x15')](_0x7b92('0x16'),_0x1770cc));_0x3ffe20[_0x7b92('0x17')][_0x3ecbb4]['on'](_0x7b92('0x18'),function(){_0x44851c['close']();clearTimeout(_0x2e374d);_0x2e374d=undefined;if(_0x3ffe20[_0x7b92('0x17')][_0x3ecbb4]){delete _0x3ffe20[_0x7b92('0x17')][_0x3ecbb4];}logger[_0x7b92('0x19')](_0x7b92('0x1a'),_0x3ecbb4);_0x2a6426[_0x7b92('0x1b')]();});_0x2e374d=setTimeout(function(){clearTimeout(_0x2e374d);_0x44851c[_0x7b92('0x1c')]();logger[_0x7b92('0x19')](_0x7b92('0x1d'),_0x3ecbb4);_0x2a6426[_0x7b92('0x1e')]();},_0x1770cc);strategy[_0x7b92('0x1f')](_0x44851c,_0x4edf63,_0x3ffe20,_0x5cfcc1);}else{logger[_0x7b92('0xc')](_0x7b92('0x20'),_0x3ecbb4,_0x9c5bc0[_0x7b92('0xa')]);_0x2a6426[_0x7b92('0x1b')]();}}}catch(_0x487a26){console[_0x7b92('0x21')](_0x487a26);logger[_0x7b92('0xc')](_0x7b92('0x22'),_0x3ecbb4,_0x487a26[_0x7b92('0x23')]);_0x2a6426['stop']();}};}; \ No newline at end of file +var _0x7f6d=['stack','validate','util','seq-queue','../../../../config/logger','routing','./strategy','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','info','format','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','error','[%s][AGENT]\x20%s','message','join','stop','find','agents','timeout','createQueue','atimeout','channel','START:%s','rules','close','[%s][AGENT]\x20ROUTING\x20STOPPED','[%s][AGENT]\x20ROUTING\x20END','next','agent','log'];(function(_0x45be81,_0x4957d0){var _0x1a09b7=function(_0x1e630c){while(--_0x1e630c){_0x45be81['push'](_0x45be81['shift']());}};_0x1a09b7(++_0x4957d0);}(_0x7f6d,0x155));var _0xd7f6=function(_0x51c819,_0xd812db){_0x51c819=_0x51c819-0x0;var _0x15c5d2=_0x7f6d[_0x51c819];return _0x15c5d2;};'use strict';var schema=require(_0xd7f6('0x0'));var _=require('lodash');var util=require(_0xd7f6('0x1'));var seqqueue=require(_0xd7f6('0x2'));var logger=require(_0xd7f6('0x3'))(_0xd7f6('0x4'));var strategy=require(_0xd7f6('0x5'));var queue=schema({'name':{'type':_0xd7f6('0x6'),'required':!![],'message':_0xd7f6('0x7')},'timeout':{'type':_0xd7f6('0x8'),'message':'timeout\x20is\x20a\x20number'}});function writeLog(_0x2c9185,_0x562a09,_0x1190e9){return logger[_0xd7f6('0x9')](util[_0xd7f6('0xa')](_0xd7f6('0xb'),_0x2c9185,_0x562a09[_0xd7f6('0xc')],_0x1190e9));}function handleFindAgent(_0x59ce7b){return function(_0x50559e){return _0x50559e[_0xd7f6('0xc')][_0xd7f6('0xd')]()===_0x59ce7b[_0xd7f6('0xd')]();};}exports['consequence']=function(_0x463029,_0xd50d6,_0x1c2deb,_0x40af5e){return function(_0x33a434){try{var _0x35002a={'name':_0xd50d6[0x0],'timeout':_0xd50d6[0x1]};var _0x29a8f9=queue['validate'](_0x35002a,{'typecast':!![]});if(_0x29a8f9['length']){logger[_0xd7f6('0xe')](_0xd7f6('0xf'),_0x463029,_['map'](_0x29a8f9,_0xd7f6('0x10'))[_0xd7f6('0x11')](',\x20'));_0x33a434[_0xd7f6('0x12')]();}else{var _0x2d5741=_[_0xd7f6('0x13')](_0x1c2deb[_0xd7f6('0x14')],handleFindAgent(_0x35002a[_0xd7f6('0xc')]));if(_0x2d5741){var _0x1376ae=(_0x35002a[_0xd7f6('0x15')]||0xa)*0x3e8;var _0x1d6bd6,_0x287c73;var _0x1c3b2c=seqqueue[_0xd7f6('0x16')](_0x1376ae);_0x1c3b2c['id']=_0x463029;_0x1c3b2c[_0xd7f6('0x17')]=_0x1376ae;_0x1c3b2c[_0xd7f6('0x18')]=_0x40af5e['channel'];writeLog(_0x463029,_0x2d5741,util['format'](_0xd7f6('0x19'),_0x1376ae));_0x1c2deb[_0xd7f6('0x1a')][_0x463029]['on']('end',function(){_0x1c3b2c[_0xd7f6('0x1b')]();clearTimeout(_0x287c73);_0x287c73=undefined;if(_0x1c2deb['rules'][_0x463029]){delete _0x1c2deb['rules'][_0x463029];}logger['info'](_0xd7f6('0x1c'),_0x463029);_0x33a434[_0xd7f6('0x12')]();});_0x287c73=setTimeout(function(){clearTimeout(_0x287c73);_0x1c3b2c[_0xd7f6('0x1b')]();logger['info'](_0xd7f6('0x1d'),_0x463029);_0x33a434[_0xd7f6('0x1e')]();},_0x1376ae);strategy[_0xd7f6('0x1f')](_0x1c3b2c,_0x2d5741,_0x1c2deb,_0x40af5e);}else{logger[_0xd7f6('0xe')]('[%s][AGENT]\x20agent\x20not\x20found\x20%s',_0x463029,_0x35002a[_0xd7f6('0xc')]);_0x33a434[_0xd7f6('0x12')]();}}}catch(_0x39b34f){console[_0xd7f6('0x20')](_0x39b34f);logger['error']('[%s][QUEUE]\x20%s',_0x463029,_0x39b34f[_0xd7f6('0x21')]);_0x33a434[_0xd7f6('0x12')]();}};}; \ 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 bb1e173..cdb0454 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 _0x75f9=['toString','postText','error','Failed','lodash','moment','aws-sdk','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','isNil','info','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','channel','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','interaction','isEmpty','body','getMustacheRender','Message','create','then','[%s][AMAZONLEX]\x20%s','catch','stringify','stop','$LATEST','message'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x75f9,0xa4));var _0x975f=function(_0x8a969d,_0x339d9f){_0x8a969d=_0x8a969d-0x0;var _0x1d8dc7=_0x75f9[_0x8a969d];return _0x1d8dc7;};'use strict';var _=require(_0x975f('0x0'));var moment=require(_0x975f('0x1'));var AWS=require(_0x975f('0x2'));var utils=require(_0x975f('0x3'));var logger=require(_0x975f('0x4'))(_0x975f('0x5'));var rpc={'chatMessage':require(_0x975f('0x6')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x975f('0x7')),'smsMessage':require(_0x975f('0x8')),'faxMessage':require(_0x975f('0x9'))};exports['consequence']=function(_0x1991e0,_0x361b97){return function(_0xa9cb00){try{if(!_[_0x975f('0xa')](this['interaction']['UserId'])){logger[_0x975f('0xb')]('[%s][AMAZONLEX]\x20%s',_0x1991e0,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0xa9cb00[_0x975f('0xc')]();}var _0x358a5f={'ContactId':this[_0x975f('0xd')]['id'],'sentAt':moment()[_0x975f('0xe')](_0x975f('0xf')),'direction':'out'};var _0x20f7f7=this[_0x975f('0x10')];if(_0x20f7f7===_0x975f('0x11')){_0x358a5f[_0x975f('0x12')]=this[_0x975f('0x13')]['id'];}else{_0x358a5f[_[_0x975f('0x14')](_0x20f7f7)+_0x975f('0x15')]=this['account']['id'];}_0x358a5f[_['upperFirst'](_0x20f7f7)+_0x975f('0x16')]=this[_0x975f('0x17')]['id'];if(this[_0x975f('0x17')]['created']){var _0x5977ec=_0x361b97[0x4];if(!_[_0x975f('0x18')](_0x5977ec)){_0x358a5f[_0x975f('0x19')]=utils[_0x975f('0x1a')](_0x5977ec,this);return rpc[_0x20f7f7+_0x975f('0x1b')][_0x975f('0x1c')](_0x358a5f)[_0x975f('0x1d')](function(_0x28e3da){logger[_0x975f('0xb')](_0x975f('0x1e'),_0x1991e0,_0x358a5f['body']);})[_0x975f('0x1f')](function(_0x35560){logger['error'](_0x975f('0x1e'),_0x1991e0,JSON[_0x975f('0x20')](_0x35560));})['finally'](function(){logger[_0x975f('0xb')]('[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0x1991e0);_0xa9cb00['stop']();});}else{logger[_0x975f('0xb')]('[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x1991e0);_0xa9cb00[_0x975f('0x21')]();}}else{var _0x27a8a9=this;var _0x193fdf=new AWS['LexRuntime']({'accessKeyId':_0x361b97[0x0],'secretAccessKey':_0x361b97[0x1],'region':_0x361b97[0x2]});var _0x1e7220={'botAlias':_0x975f('0x22'),'botName':_0x361b97[0x3],'inputText':this[_0x975f('0x23')][_0x975f('0x19')],'userId':this[_0x975f('0x17')]['id'][_0x975f('0x24')]()};_0x193fdf[_0x975f('0x25')](_0x1e7220,function(_0x214cc9,_0x304d2e){if(_0x214cc9){logger[_0x975f('0x26')](_0x975f('0x1e'),_0x1991e0,_0x214cc9[_0x975f('0x23')]);_0xa9cb00[_0x975f('0xc')]();}else if(_0x304d2e&&_0x304d2e['message']){_0x27a8a9[_0x975f('0x19')]['amazonlex']=_0x304d2e;_0x358a5f[_0x975f('0x19')]=_0x304d2e[_0x975f('0x23')];return rpc[_0x20f7f7+_0x975f('0x1b')]['create'](_0x358a5f)[_0x975f('0x1d')](function(_0x2b3738){logger[_0x975f('0xb')]('[%s][AMAZONLEX]\x20%s',_0x1991e0,_0x358a5f['body']);if(_0x304d2e['dialogState']==_0x975f('0x27')){_0xa9cb00[_0x975f('0xc')]();}else{_0xa9cb00[_0x975f('0x21')]();}})[_0x975f('0x1f')](function(_0x5aae22){logger['error']('[%s][AMAZONLEX]\x20%s',_0x1991e0,JSON['stringify'](_0x5aae22));_0xa9cb00['next']();});}else{_0xa9cb00['next']();}});}}catch(_0x47827e){logger[_0x975f('0x26')]('[%s][AMAZONLEX]\x20%s',_0x1991e0,JSON[_0x975f('0x20')](_0x47827e));_0xa9cb00[_0x975f('0x21')]();}};}; \ No newline at end of file +var _0x7aa2=['catch','error','lodash','moment','./utils','routing','../../rpc/chatMessage','../../rpc/mailMessage','consequence','isNil','interaction','UserId','[%s][AMAZONLEX]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','YYYY-MM-DD\x20HH:mm:ss','out','channel','chat','account','upperFirst','AccountId','created','isEmpty','body','getMustacheRender','Message','then','info','stringify','finally','stop','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','LexRuntime','$LATEST','message','dialogState','Failed'];(function(_0x4bf018,_0x332650){var _0x4e4504=function(_0x132753){while(--_0x132753){_0x4bf018['push'](_0x4bf018['shift']());}};_0x4e4504(++_0x332650);}(_0x7aa2,0xc5));var _0x27aa=function(_0xafcf00,_0x4429a3){_0xafcf00=_0xafcf00-0x0;var _0x513af4=_0x7aa2[_0xafcf00];return _0x513af4;};'use strict';var _=require(_0x27aa('0x0'));var moment=require(_0x27aa('0x1'));var AWS=require('aws-sdk');var utils=require(_0x27aa('0x2'));var logger=require('../../../../config/logger')(_0x27aa('0x3'));var rpc={'chatMessage':require(_0x27aa('0x4')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x27aa('0x5')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require('../../rpc/faxMessage')};exports[_0x27aa('0x6')]=function(_0x227539,_0x57180c){return function(_0x5603a6){try{if(!_[_0x27aa('0x7')](this[_0x27aa('0x8')][_0x27aa('0x9')])){logger['info'](_0x27aa('0xa'),_0x227539,_0x27aa('0xb'));return _0x5603a6[_0x27aa('0xc')]();}var _0x2b4911={'ContactId':this[_0x27aa('0xd')]['id'],'sentAt':moment()['format'](_0x27aa('0xe')),'direction':_0x27aa('0xf')};var _0x3cdbd1=this[_0x27aa('0x10')];if(_0x3cdbd1===_0x27aa('0x11')){_0x2b4911['ChatWebsiteId']=this[_0x27aa('0x12')]['id'];}else{_0x2b4911[_[_0x27aa('0x13')](_0x3cdbd1)+_0x27aa('0x14')]=this[_0x27aa('0x12')]['id'];}_0x2b4911[_[_0x27aa('0x13')](_0x3cdbd1)+'InteractionId']=this[_0x27aa('0x8')]['id'];if(this['interaction'][_0x27aa('0x15')]){var _0x257e93=_0x57180c[0x4];if(!_[_0x27aa('0x16')](_0x257e93)){_0x2b4911[_0x27aa('0x17')]=utils[_0x27aa('0x18')](_0x257e93,this);return rpc[_0x3cdbd1+_0x27aa('0x19')]['create'](_0x2b4911)[_0x27aa('0x1a')](function(_0x49a156){logger[_0x27aa('0x1b')](_0x27aa('0xa'),_0x227539,_0x2b4911['body']);})['catch'](function(_0x6ded28){logger['error'](_0x27aa('0xa'),_0x227539,JSON[_0x27aa('0x1c')](_0x6ded28));})[_0x27aa('0x1d')](function(){logger[_0x27aa('0x1b')]('[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0x227539);_0x5603a6[_0x27aa('0x1e')]();});}else{logger['info'](_0x27aa('0x1f'),_0x227539);_0x5603a6[_0x27aa('0x1e')]();}}else{var _0x16d83b=this;var _0xc46167=new AWS[(_0x27aa('0x20'))]({'accessKeyId':_0x57180c[0x0],'secretAccessKey':_0x57180c[0x1],'region':_0x57180c[0x2]});var _0x245c10={'botAlias':_0x27aa('0x21'),'botName':_0x57180c[0x3],'inputText':this['message'][_0x27aa('0x17')],'userId':this[_0x27aa('0x8')]['id']['toString']()};_0xc46167['postText'](_0x245c10,function(_0x3d94c6,_0x73a0fd){if(_0x3d94c6){logger['error'](_0x27aa('0xa'),_0x227539,_0x3d94c6[_0x27aa('0x22')]);_0x5603a6[_0x27aa('0xc')]();}else if(_0x73a0fd&&_0x73a0fd['message']){_0x16d83b[_0x27aa('0x17')]['amazonlex']=_0x73a0fd;_0x2b4911['body']=_0x73a0fd[_0x27aa('0x22')];return rpc[_0x3cdbd1+'Message']['create'](_0x2b4911)['then'](function(_0x146900){logger[_0x27aa('0x1b')](_0x27aa('0xa'),_0x227539,_0x2b4911['body']);if(_0x73a0fd[_0x27aa('0x23')]==_0x27aa('0x24')){_0x5603a6[_0x27aa('0xc')]();}else{_0x5603a6['stop']();}})[_0x27aa('0x25')](function(_0x3b94e6){logger[_0x27aa('0x26')](_0x27aa('0xa'),_0x227539,JSON['stringify'](_0x3b94e6));_0x5603a6[_0x27aa('0xc')]();});}else{_0x5603a6[_0x27aa('0xc')]();}});}}catch(_0x430bd9){logger['error'](_0x27aa('0xa'),_0x227539,JSON[_0x27aa('0x1c')](_0x430bd9));_0x5603a6[_0x27aa('0x1e')]();}};}; \ 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 60304bf..bee956c 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 _0xd8b0=['upperFirst','AccountId','InteractionId','Message','service','Smtp','host','port','secure','pass','html','replace','','messageId','create','then','stringify','catch','error','[RPC][%s][AUTOREPLY]\x20%s','finally','lodash','moment','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','interaction','created','info','[%s][AUTOREPLY]\x20%s','Autoreply\x20already\x20sent','next','channel','contact','YYYY-MM-DD\x20HH:mm:ss','out','message','from','phone','read','subject','startsWith','Re:','chat','ChatWebsiteId','account'];(function(_0x556b28,_0x46061b){var _0x23bfc1=function(_0x27bf7d){while(--_0x27bf7d){_0x556b28['push'](_0x556b28['shift']());}};_0x23bfc1(++_0x46061b);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x0d8b('0x0'));var moment=require(_0x0d8b('0x1'));var utils=require('./utils');var logger=require('../../../../config/logger')('routing');var rpc={'chatMessage':require(_0x0d8b('0x2')),'openchannelMessage':require(_0x0d8b('0x3')),'mailMessage':require(_0x0d8b('0x4')),'smsMessage':require(_0x0d8b('0x5')),'faxMessage':require(_0x0d8b('0x6'))};var mailRpc=require('../../mailRpc');exports['consequence']=function(_0x3f8b6f,_0x227c63){return function(_0x39f43a){try{if(_0x227c63[0x0]==='1'&&(_['isNil'](this[_0x0d8b('0x7')][_0x0d8b('0x8')])||!this['interaction'][_0x0d8b('0x8')])){logger[_0x0d8b('0x9')](_0x0d8b('0xa'),_0x3f8b6f,_0x0d8b('0xb'));return _0x39f43a[_0x0d8b('0xc')]();}var _0x1cac62=this[_0x0d8b('0xd')];var _0x28f87c={'body':utils['getMustacheRender'](_0x227c63[0x1],this),'ContactId':this[_0x0d8b('0xe')]['id'],'sentAt':moment()['format'](_0x0d8b('0xf')),'direction':_0x0d8b('0x10')};if(this[_0x0d8b('0x11')]){_0x28f87c['to']=this[_0x0d8b('0x11')][_0x0d8b('0x12')]||'';_0x28f87c['cc']=this[_0x0d8b('0x11')]['cc']||'';_0x28f87c[_0x0d8b('0x12')]=this[_0x0d8b('0x11')]['to']||'';_0x28f87c[_0x0d8b('0x13')]=this[_0x0d8b('0x11')][_0x0d8b('0x13')]||'';_0x28f87c[_0x0d8b('0x14')]=!![];if(this[_0x0d8b('0x11')][_0x0d8b('0x15')]){_0x28f87c['subject']='';_0x28f87c[_0x0d8b('0x15')]+=_[_0x0d8b('0x16')](this[_0x0d8b('0x11')][_0x0d8b('0x15')],_0x0d8b('0x17'))?'':'Re:\x20';_0x28f87c[_0x0d8b('0x15')]+=this[_0x0d8b('0x11')][_0x0d8b('0x15')];}}if(this[_0x0d8b('0xd')]===_0x0d8b('0x18')){_0x28f87c[_0x0d8b('0x19')]=this[_0x0d8b('0x1a')]['id'];}else{_0x28f87c[_[_0x0d8b('0x1b')](this['channel'])+_0x0d8b('0x1c')]=this[_0x0d8b('0x1a')]['id'];}_0x28f87c[_[_0x0d8b('0x1b')](this[_0x0d8b('0xd')])+_0x0d8b('0x1d')]=this[_0x0d8b('0x7')]['id'];if(rpc[this[_0x0d8b('0xd')]+_0x0d8b('0x1e')]){if(this['channel']==='mail'){var _0x33fb87={'tls':{'rejectUnauthorized':![]}};if(this['account']['Smtp']['service']){_0x33fb87[_0x0d8b('0x1f')]=this[_0x0d8b('0x1a')][_0x0d8b('0x20')][_0x0d8b('0x1f')];}else{_0x33fb87[_0x0d8b('0x21')]=this[_0x0d8b('0x1a')][_0x0d8b('0x20')][_0x0d8b('0x21')];_0x33fb87[_0x0d8b('0x22')]=this['account'][_0x0d8b('0x20')][_0x0d8b('0x22')];_0x33fb87['secure']=this[_0x0d8b('0x1a')]['Smtp'][_0x0d8b('0x23')];}if(this[_0x0d8b('0x1a')][_0x0d8b('0x20')]['authentication']){_0x33fb87['auth']={'user':this[_0x0d8b('0x1a')][_0x0d8b('0x20')]['user'],'pass':this[_0x0d8b('0x1a')]['Smtp'][_0x0d8b('0x24')]};}_0x28f87c['inReplyTo']=this[_0x0d8b('0x11')]['messageId'];_0x28f87c[_0x0d8b('0x25')]=''+_[_0x0d8b('0x26')](_0x28f87c['body'],_0x0d8b('0x27'),_0x0d8b('0x28'))+_0x0d8b('0x29');return mailRpc['sendMailMessage'](_0x33fb87,_0x28f87c)['then'](function(_0x51cf32){logger[_0x0d8b('0x9')]('[%s][AUTOREPLY]\x20SMTP\x20SENT',_0x3f8b6f);_0x28f87c[_0x0d8b('0x2a')]=_0x51cf32['message']['messageId'];return rpc[_0x1cac62+_0x0d8b('0x1e')][_0x0d8b('0x2b')](_0x28f87c);})[_0x0d8b('0x2c')](function(_0xdeee5d){logger[_0x0d8b('0x9')](_0x0d8b('0xa'),_0x3f8b6f,JSON[_0x0d8b('0x2d')](_0xdeee5d));})[_0x0d8b('0x2e')](function(_0x553e03){logger[_0x0d8b('0x2f')](_0x0d8b('0x30'),_0x3f8b6f,JSON['stringify'](_0x553e03));})[_0x0d8b('0x31')](function(){_0x39f43a[_0x0d8b('0xc')]();});}else{return rpc[this[_0x0d8b('0xd')]+'Message'][_0x0d8b('0x2b')](_0x28f87c)[_0x0d8b('0x2c')](function(_0x206157){logger[_0x0d8b('0x9')](_0x0d8b('0xa'),_0x3f8b6f,_0x28f87c['body']);})[_0x0d8b('0x2e')](function(_0x1649fc){logger['error'](_0x0d8b('0xa'),_0x3f8b6f,JSON[_0x0d8b('0x2d')](_0x1649fc));})[_0x0d8b('0x31')](function(){_0x39f43a[_0x0d8b('0xc')]();});}}}catch(_0x373544){logger['error']('[%s][AUTOREPLY]\x20%s',_0x3f8b6f,JSON[_0x0d8b('0x2d')](_0x373544));_0x39f43a['stop']();}};}; \ No newline at end of file +var _0xe706=['next','channel','getMustacheRender','YYYY-MM-DD\x20HH:mm:ss','out','message','from','read','subject','Re:','Re:\x20','chat','ChatWebsiteId','AccountId','account','upperFirst','InteractionId','Message','Smtp','service','host','port','secure','auth','user','pass','inReplyTo','messageId','html','','replace','body','';return mailRpc[_0x6e70('0x33')](_0x228350,_0x37b3e0)['then'](function(_0x259486){logger['info'](_0x6e70('0x34'),_0x1b0389);_0x37b3e0[_0x6e70('0x2c')]=_0x259486[_0x6e70('0x16')]['messageId'];return rpc[_0x743eb5+_0x6e70('0x22')][_0x6e70('0x35')](_0x37b3e0);})['then'](function(_0x13d673){logger[_0x6e70('0xe')]('[%s][AUTOREPLY]\x20%s',_0x1b0389,JSON[_0x6e70('0x36')](_0x13d673));})[_0x6e70('0x37')](function(_0x2d52bd){logger[_0x6e70('0x38')](_0x6e70('0x39'),_0x1b0389,JSON[_0x6e70('0x36')](_0x2d52bd));})[_0x6e70('0x3a')](function(){_0x36357b[_0x6e70('0x11')]();});}else{return rpc[this[_0x6e70('0x12')]+_0x6e70('0x22')]['create'](_0x37b3e0)[_0x6e70('0x3b')](function(_0x4795a0){logger[_0x6e70('0xe')](_0x6e70('0xf'),_0x1b0389,_0x37b3e0[_0x6e70('0x30')]);})[_0x6e70('0x37')](function(_0x233a83){logger[_0x6e70('0x38')](_0x6e70('0xf'),_0x1b0389,JSON[_0x6e70('0x36')](_0x233a83));})[_0x6e70('0x3a')](function(){_0x36357b[_0x6e70('0x11')]();});}}}catch(_0x2a5444){logger[_0x6e70('0x38')](_0x6e70('0xf'),_0x1b0389,JSON['stringify'](_0x2a5444));_0x36357b['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/close.js b/server/services/routing/server/applications/close.js index 74f21b7..f4b93e7 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 _0xc4dd=['../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','consequence','info','[%s][CLOSE]\x20reason\x20%s','format','YYYY-MM-DD\x20HH:mm:ss','system','channel','Interaction','interaction','then','[%s][CLOSE]\x20%s','stringify','finally','error','stop','moment','../../../../config/logger','routing'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xc4dd,0xad));var _0xdc4d=function(_0x203a7d,_0x14be27){_0x203a7d=_0x203a7d-0x0;var _0x41084e=_0xc4dd[_0x203a7d];return _0x41084e;};'use strict';var moment=require(_0xdc4d('0x0'));var logger=require(_0xdc4d('0x1'))(_0xdc4d('0x2'));var rpc={'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require(_0xdc4d('0x3')),'smsInteraction':require(_0xdc4d('0x4')),'mailInteraction':require(_0xdc4d('0x5')),'faxInteraction':require(_0xdc4d('0x6'))};exports[_0xdc4d('0x7')]=function(_0x5254db,_0x5e24cb,_0x27d6a9,_0x1696e3){return function(_0x5d4933){try{logger[_0xdc4d('0x8')](_0xdc4d('0x9'),_0x5254db,_0x5e24cb[0x0]);var _0x566564={'closed':0x1,'closedAt':moment()[_0xdc4d('0xa')](_0xdc4d('0xb')),'closeReason':_0xdc4d('0xc'),'disposition':_0x5e24cb[0x0]};if(rpc[_0x1696e3[_0xdc4d('0xd')]+_0xdc4d('0xe')]){rpc[_0x1696e3[_0xdc4d('0xd')]+_0xdc4d('0xe')]['update'](_0x1696e3[_0xdc4d('0xf')]['id'],_0x566564)[_0xdc4d('0x10')](function(_0x49a0e7){logger[_0xdc4d('0x8')]('[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!',_0x5254db,_0x1696e3[_0xdc4d('0xf')]['id']);})['catch'](function(_0x48e754){logger['error'](_0xdc4d('0x11'),_0x5254db,JSON[_0xdc4d('0x12')](_0x48e754));})[_0xdc4d('0x13')](function(){_0x5d4933['stop']();});}}catch(_0x20dfad){logger[_0xdc4d('0x14')](_0xdc4d('0x11'),_0x5254db,JSON['stringify'](_0x20dfad));_0x5d4933[_0xdc4d('0x15')]();}};}; \ No newline at end of file +var _0x9d5b=['stringify','finally','stop','../../../../config/logger','routing','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/faxInteraction','[%s][CLOSE]\x20reason\x20%s','YYYY-MM-DD\x20HH:mm:ss','system','channel','Interaction','update','then','info','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','interaction','catch','error','[%s][CLOSE]\x20%s'];(function(_0x107ded,_0x3e9e38){var _0x126588=function(_0x57125e){while(--_0x57125e){_0x107ded['push'](_0x107ded['shift']());}};_0x126588(++_0x3e9e38);}(_0x9d5b,0x14d));var _0xb9d5=function(_0x3dbd26,_0x18e2e1){_0x3dbd26=_0x3dbd26-0x0;var _0x135109=_0x9d5b[_0x3dbd26];return _0x135109;};'use strict';var moment=require('moment');var logger=require(_0xb9d5('0x0'))(_0xb9d5('0x1'));var rpc={'chatInteraction':require(_0xb9d5('0x2')),'openchannelInteraction':require(_0xb9d5('0x3')),'smsInteraction':require(_0xb9d5('0x4')),'mailInteraction':require('../../rpc/mailInteraction'),'faxInteraction':require(_0xb9d5('0x5'))};exports['consequence']=function(_0x36b546,_0xbf85ca,_0x71dbea,_0x39d8fe){return function(_0x422a92){try{logger['info'](_0xb9d5('0x6'),_0x36b546,_0xbf85ca[0x0]);var _0x35cf2={'closed':0x1,'closedAt':moment()['format'](_0xb9d5('0x7')),'closeReason':_0xb9d5('0x8'),'disposition':_0xbf85ca[0x0]};if(rpc[_0x39d8fe[_0xb9d5('0x9')]+_0xb9d5('0xa')]){rpc[_0x39d8fe['channel']+_0xb9d5('0xa')][_0xb9d5('0xb')](_0x39d8fe['interaction']['id'],_0x35cf2)[_0xb9d5('0xc')](function(_0x34b0a7){logger[_0xb9d5('0xd')](_0xb9d5('0xe'),_0x36b546,_0x39d8fe[_0xb9d5('0xf')]['id']);})[_0xb9d5('0x10')](function(_0x3e237e){logger[_0xb9d5('0x11')](_0xb9d5('0x12'),_0x36b546,JSON[_0xb9d5('0x13')](_0x3e237e));})[_0xb9d5('0x14')](function(){_0x422a92['stop']();});}}catch(_0x3bb168){logger[_0xb9d5('0x11')]('[%s][CLOSE]\x20%s',_0x36b546,JSON[_0xb9d5('0x13')](_0x3bb168));_0x422a92[_0xb9d5('0x15')]();}};}; \ 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 9fdcd88..9d0b044 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 _0xdd50=['create','info','catch','error','stringify','finally','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','textRequest','message','then','dialogflow','result','speech','metadata','endConversation','apiai-promise','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','consequence','isNil','interaction','UserId','[%s][DIALOGFLOW]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','chat','upperFirst','AccountId','account','InteractionId','isEmpty','body','getMustacheRender','Message'];(function(_0x41fe21,_0x4d400d){var _0x309446=function(_0x467b7d){while(--_0x467b7d){_0x41fe21['push'](_0x41fe21['shift']());}};_0x309446(++_0x4d400d);}(_0xdd50,0x67));var _0x0dd5=function(_0x15b399,_0x59db1a){_0x15b399=_0x15b399-0x0;var _0x199f2d=_0xdd50[_0x15b399];return _0x199f2d;};'use strict';var _=require('lodash');var moment=require('moment');var apiai=require(_0x0dd5('0x0'));var md5=require('md5');var utils=require('./utils');var logger=require('../../../../config/logger')('routing');var rpc={'chatMessage':require(_0x0dd5('0x1')),'openchannelMessage':require(_0x0dd5('0x2')),'mailMessage':require(_0x0dd5('0x3')),'smsMessage':require(_0x0dd5('0x4')),'faxMessage':require(_0x0dd5('0x5'))};exports[_0x0dd5('0x6')]=function(_0x10a889,_0x5e065e){return function(_0x1800e5){try{if(!_[_0x0dd5('0x7')](this[_0x0dd5('0x8')][_0x0dd5('0x9')])){logger['info'](_0x0dd5('0xa'),_0x10a889,_0x0dd5('0xb'));return _0x1800e5[_0x0dd5('0xc')]();}var _0x17a431={'ContactId':this['contact']['id'],'sentAt':moment()[_0x0dd5('0xd')](_0x0dd5('0xe')),'direction':_0x0dd5('0xf')};var _0x577fcd=this[_0x0dd5('0x10')];if(_0x577fcd===_0x0dd5('0x11')){_0x17a431['ChatWebsiteId']=this['account']['id'];}else{_0x17a431[_[_0x0dd5('0x12')](_0x577fcd)+_0x0dd5('0x13')]=this[_0x0dd5('0x14')]['id'];}_0x17a431[_[_0x0dd5('0x12')](_0x577fcd)+_0x0dd5('0x15')]=this['interaction']['id'];if(this[_0x0dd5('0x8')]['created']){var _0x1a5566=_0x5e065e[0x2];if(!_[_0x0dd5('0x16')](_0x1a5566)){_0x17a431[_0x0dd5('0x17')]=utils[_0x0dd5('0x18')](_0x1a5566,this);return rpc[_0x577fcd+_0x0dd5('0x19')][_0x0dd5('0x1a')](_0x17a431)['then'](function(_0x1b8e2a){logger[_0x0dd5('0x1b')](_0x0dd5('0xa'),_0x10a889,_0x17a431[_0x0dd5('0x17')]);})[_0x0dd5('0x1c')](function(_0x28792b){logger[_0x0dd5('0x1d')](_0x0dd5('0xa'),_0x10a889,JSON[_0x0dd5('0x1e')](_0x28792b));})[_0x0dd5('0x1f')](function(){logger[_0x0dd5('0x1b')](_0x0dd5('0x20'),_0x10a889);_0x1800e5[_0x0dd5('0x21')]();});}else{logger['info'](_0x0dd5('0x22'),_0x10a889);_0x1800e5[_0x0dd5('0x21')]();}}else{var _0x361b88=this;var _0x259e24=apiai(_0x5e065e[0x0],{'language':_0x5e065e[0x1]||'en'});return _0x259e24[_0x0dd5('0x23')](this[_0x0dd5('0x24')]['body'],{'sessionId':md5(this[_0x0dd5('0x8')]['id'])})[_0x0dd5('0x25')](function(_0x1fade8){_0x361b88['body'][_0x0dd5('0x26')]=_0x1fade8;_0x17a431[_0x0dd5('0x17')]=_0x1fade8[_0x0dd5('0x27')]['fulfillment'][_0x0dd5('0x28')];return rpc[_0x577fcd+_0x0dd5('0x19')][_0x0dd5('0x1a')](_0x17a431)[_0x0dd5('0x25')](function(_0x5354e7){logger[_0x0dd5('0x1b')](_0x0dd5('0xa'),_0x10a889,_0x17a431[_0x0dd5('0x17')]);if(_0x1fade8[_0x0dd5('0x27')][_0x0dd5('0x29')][_0x0dd5('0x2a')]){_0x1800e5[_0x0dd5('0xc')]();}else{_0x1800e5[_0x0dd5('0x21')]();}})[_0x0dd5('0x1c')](function(_0x21c73a){logger['error'](_0x0dd5('0xa'),_0x10a889,JSON[_0x0dd5('0x1e')](_0x21c73a));_0x1800e5[_0x0dd5('0xc')]();});})['catch'](function(_0x3f4476){logger[_0x0dd5('0x1d')](_0x0dd5('0xa'),_0x10a889,_0x3f4476['message']);_0x1800e5['next']();});}}catch(_0x4b38ef){logger[_0x0dd5('0x1d')]('[%s][DIALOGFLOW]\x20%s',_0x10a889,JSON[_0x0dd5('0x1e')](_0x4b38ef));_0x1800e5['stop']();}};}; \ No newline at end of file +var _0xff6a=['upperFirst','account','InteractionId','interaction','created','isEmpty','body','getMustacheRender','Message','create','then','info','catch','error','stringify','finally','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','textRequest','message','dialogflow','result','fulfillment','speech','metadata','next','moment','md5','./utils','../../../../config/logger','routing','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','consequence','[%s][DIALOGFLOW]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','contact','YYYY-MM-DD\x20HH:mm:ss','channel','chat'];(function(_0x41b8cc,_0x3c79b8){var _0x5b6e64=function(_0x2112ab){while(--_0x2112ab){_0x41b8cc['push'](_0x41b8cc['shift']());}};_0x5b6e64(++_0x3c79b8);}(_0xff6a,0x19e));var _0xaff6=function(_0x2c7618,_0x26be9c){_0x2c7618=_0x2c7618-0x0;var _0x5ce3f0=_0xff6a[_0x2c7618];return _0x5ce3f0;};'use strict';var _=require('lodash');var moment=require(_0xaff6('0x0'));var apiai=require('apiai-promise');var md5=require(_0xaff6('0x1'));var utils=require(_0xaff6('0x2'));var logger=require(_0xaff6('0x3'))(_0xaff6('0x4'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0xaff6('0x5')),'mailMessage':require(_0xaff6('0x6')),'smsMessage':require(_0xaff6('0x7')),'faxMessage':require(_0xaff6('0x8'))};exports[_0xaff6('0x9')]=function(_0xd3187e,_0x5c9664){return function(_0xd47173){try{if(!_['isNil'](this['interaction']['UserId'])){logger['info'](_0xaff6('0xa'),_0xd3187e,_0xaff6('0xb'));return _0xd47173['next']();}var _0x32fbc8={'ContactId':this[_0xaff6('0xc')]['id'],'sentAt':moment()['format'](_0xaff6('0xd')),'direction':'out'};var _0x27a016=this[_0xaff6('0xe')];if(_0x27a016===_0xaff6('0xf')){_0x32fbc8['ChatWebsiteId']=this['account']['id'];}else{_0x32fbc8[_[_0xaff6('0x10')](_0x27a016)+'AccountId']=this[_0xaff6('0x11')]['id'];}_0x32fbc8[_['upperFirst'](_0x27a016)+_0xaff6('0x12')]=this[_0xaff6('0x13')]['id'];if(this[_0xaff6('0x13')][_0xaff6('0x14')]){var _0x20d847=_0x5c9664[0x2];if(!_[_0xaff6('0x15')](_0x20d847)){_0x32fbc8[_0xaff6('0x16')]=utils[_0xaff6('0x17')](_0x20d847,this);return rpc[_0x27a016+_0xaff6('0x18')][_0xaff6('0x19')](_0x32fbc8)[_0xaff6('0x1a')](function(_0x2dea0a){logger[_0xaff6('0x1b')]('[%s][DIALOGFLOW]\x20%s',_0xd3187e,_0x32fbc8[_0xaff6('0x16')]);})[_0xaff6('0x1c')](function(_0x496fc4){logger[_0xaff6('0x1d')](_0xaff6('0xa'),_0xd3187e,JSON[_0xaff6('0x1e')](_0x496fc4));})[_0xaff6('0x1f')](function(){logger['info'](_0xaff6('0x20'),_0xd3187e);_0xd47173[_0xaff6('0x21')]();});}else{logger[_0xaff6('0x1b')](_0xaff6('0x22'),_0xd3187e);_0xd47173['stop']();}}else{var _0x1f8f76=this;var _0x5e13fb=apiai(_0x5c9664[0x0],{'language':_0x5c9664[0x1]||'en'});return _0x5e13fb[_0xaff6('0x23')](this[_0xaff6('0x24')][_0xaff6('0x16')],{'sessionId':md5(this['interaction']['id'])})[_0xaff6('0x1a')](function(_0x9af027){_0x1f8f76[_0xaff6('0x16')][_0xaff6('0x25')]=_0x9af027;_0x32fbc8['body']=_0x9af027[_0xaff6('0x26')][_0xaff6('0x27')][_0xaff6('0x28')];return rpc[_0x27a016+_0xaff6('0x18')][_0xaff6('0x19')](_0x32fbc8)[_0xaff6('0x1a')](function(_0x513aca){logger[_0xaff6('0x1b')](_0xaff6('0xa'),_0xd3187e,_0x32fbc8[_0xaff6('0x16')]);if(_0x9af027[_0xaff6('0x26')][_0xaff6('0x29')]['endConversation']){_0xd47173[_0xaff6('0x2a')]();}else{_0xd47173[_0xaff6('0x21')]();}})[_0xaff6('0x1c')](function(_0x46a50f){logger['error'](_0xaff6('0xa'),_0xd3187e,JSON['stringify'](_0x46a50f));_0xd47173[_0xaff6('0x2a')]();});})[_0xaff6('0x1c')](function(_0x95d307){logger[_0xaff6('0x1d')](_0xaff6('0xa'),_0xd3187e,_0x95d307[_0xaff6('0x24')]);_0xd47173[_0xaff6('0x2a')]();});}}catch(_0x235027){logger[_0xaff6('0x1d')](_0xaff6('0xa'),_0xd3187e,JSON['stringify'](_0x235027));_0xd47173[_0xaff6('0x21')]();}};}; \ 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 b903f0a..de8ca09 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 _0x3010=['number','priority\x20false\x20is\x20a\x20number','consequence','fromString','getMustacheRender','replace','length','error','[%s][GOTOIF]\x20%s','map','message','join','condition','priorityTrue','priorityFalse','info','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','findIndex','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','stop','stringify','validate','lodash','./utils','../../../../config/logger','routing','string','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','priority\x20true\x20is\x20a\x20number'];(function(_0x30f06f,_0x160eaf){var _0x7e3a80=function(_0x47fa04){while(--_0x47fa04){_0x30f06f['push'](_0x30f06f['shift']());}};_0x7e3a80(++_0x160eaf);}(_0x3010,0x1c6));var _0x0301=function(_0x9311bd,_0x14aa6c){_0x9311bd=_0x9311bd-0x0;var _0x49870d=_0x3010[_0x9311bd];return _0x49870d;};'use strict';var schema=require(_0x0301('0x0'));var _=require(_0x0301('0x1'));var htmlToText=require('html-to-text');var utils=require(_0x0301('0x2'));var logger=require(_0x0301('0x3'))(_0x0301('0x4'));var gotoif=schema({'condition':{'type':_0x0301('0x5'),'required':!![],'message':_0x0301('0x6')},'priorityTrue':{'type':'number','message':_0x0301('0x7')},'priorityFalse':{'type':_0x0301('0x8'),'message':_0x0301('0x9')}});exports[_0x0301('0xa')]=function(_0x4839bf,_0x4e6975){return function(_0x59c2fe){try{var _0x5d1d66={'condition':htmlToText[_0x0301('0xb')](utils[_0x0301('0xc')](_0x4e6975[0x0],this),{'wordwrap':![]})[_0x0301('0xd')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x4e6975[0x1],'priorityFalse':_0x4e6975[0x2]};var _0x5c83e1=gotoif[_0x0301('0x0')](_0x5d1d66,{'typecast':!![]});if(_0x5c83e1[_0x0301('0xe')]){logger[_0x0301('0xf')](_0x0301('0x10'),_0x4839bf,_[_0x0301('0x11')](_0x5c83e1,_0x0301('0x12'))[_0x0301('0x13')](',\x20'));_0x59c2fe['stop']();}else{try{var _0x4291ec=eval('('+_0x5d1d66[_0x0301('0x14')]+')');var _0x38804e=_0x4291ec?_0x5d1d66[_0x0301('0x15')]:_0x5d1d66[_0x0301('0x16')];logger[_0x0301('0x17')](_0x0301('0x18'),_0x4839bf,_0x5d1d66[_0x0301('0x14')],_0x4291ec,_0x38804e||'next');if(_0x38804e){var _0x397fe5=_[_0x0301('0x19')](_0x59c2fe[_0x0301('0x1a')](),{'p':_0x38804e});if(_0x397fe5>=0x0){logger['info'](_0x0301('0x1b'),_0x4839bf,_0x38804e||_0x0301('0x1c'),_0x397fe5);_0x59c2fe['next'](_0x397fe5);}else{logger[_0x0301('0x17')](_0x0301('0x1d'),_0x4839bf,_0x38804e||_0x0301('0x1c'));_0x59c2fe['stop']();}}else{_0x59c2fe[_0x0301('0x1c')]();}}catch(_0x3c4464){logger[_0x0301('0xf')](_0x0301('0x1e'),_0x4839bf,_0x3c4464['message']);_0x59c2fe[_0x0301('0x1f')]();}}}catch(_0x1ad506){logger[_0x0301('0xf')]('[%s][GOTOIF]\x20%s',_0x4839bf,JSON[_0x0301('0x20')](_0x1ad506));_0x59c2fe[_0x0301('0x1f')]();}};}; \ No newline at end of file +var _0x2e8a=['stringify','validate','lodash','./utils','../../../../config/logger','routing','string','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','priority\x20true\x20is\x20a\x20number','fromString','getMustacheRender','replace','length','[%s][GOTOIF]\x20%s','map','message','join','stop','priorityTrue','priorityFalse','info','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','condition','next','findIndex','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','error'];(function(_0x17c85c,_0x35237e){var _0x2d2178=function(_0x347538){while(--_0x347538){_0x17c85c['push'](_0x17c85c['shift']());}};_0x2d2178(++_0x35237e);}(_0x2e8a,0x71));var _0xa2e8=function(_0x46df63,_0x5cbc34){_0x46df63=_0x46df63-0x0;var _0x236616=_0x2e8a[_0x46df63];return _0x236616;};'use strict';var schema=require(_0xa2e8('0x0'));var _=require(_0xa2e8('0x1'));var htmlToText=require('html-to-text');var utils=require(_0xa2e8('0x2'));var logger=require(_0xa2e8('0x3'))(_0xa2e8('0x4'));var gotoif=schema({'condition':{'type':_0xa2e8('0x5'),'required':!![],'message':_0xa2e8('0x6')},'priorityTrue':{'type':_0xa2e8('0x7'),'message':_0xa2e8('0x8')},'priorityFalse':{'type':_0xa2e8('0x7'),'message':'priority\x20false\x20is\x20a\x20number'}});exports['consequence']=function(_0x135b2d,_0x39a8d8){return function(_0x2cf7d6){try{var _0x594a1a={'condition':htmlToText[_0xa2e8('0x9')](utils[_0xa2e8('0xa')](_0x39a8d8[0x0],this),{'wordwrap':![]})[_0xa2e8('0xb')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x39a8d8[0x1],'priorityFalse':_0x39a8d8[0x2]};var _0x292471=gotoif[_0xa2e8('0x0')](_0x594a1a,{'typecast':!![]});if(_0x292471[_0xa2e8('0xc')]){logger['error'](_0xa2e8('0xd'),_0x135b2d,_[_0xa2e8('0xe')](_0x292471,_0xa2e8('0xf'))[_0xa2e8('0x10')](',\x20'));_0x2cf7d6[_0xa2e8('0x11')]();}else{try{var _0x51ccc9=eval('('+_0x594a1a['condition']+')');var _0x5e43d0=_0x51ccc9?_0x594a1a[_0xa2e8('0x12')]:_0x594a1a[_0xa2e8('0x13')];logger[_0xa2e8('0x14')](_0xa2e8('0x15'),_0x135b2d,_0x594a1a[_0xa2e8('0x16')],_0x51ccc9,_0x5e43d0||_0xa2e8('0x17'));if(_0x5e43d0){var _0x5f551c=_[_0xa2e8('0x18')](_0x2cf7d6['rules'](),{'p':_0x5e43d0});if(_0x5f551c>=0x0){logger[_0xa2e8('0x14')](_0xa2e8('0x19'),_0x135b2d,_0x5e43d0||'next',_0x5f551c);_0x2cf7d6[_0xa2e8('0x17')](_0x5f551c);}else{logger[_0xa2e8('0x14')]('[%s][GOTOIF]\x20priority\x20%s\x20not\x20found',_0x135b2d,_0x5e43d0||_0xa2e8('0x17'));_0x2cf7d6[_0xa2e8('0x11')]();}}else{_0x2cf7d6[_0xa2e8('0x17')]();}}catch(_0x34f378){logger[_0xa2e8('0x1a')]('[%s][GOTOIF]\x20eval\x20error:\x20%s',_0x135b2d,_0x34f378[_0xa2e8('0xf')]);_0x2cf7d6[_0xa2e8('0x11')]();}}}catch(_0x355d8f){logger['error']('[%s][GOTOIF]\x20%s',_0x135b2d,JSON[_0xa2e8('0x1b')](_0x355d8f));_0x2cf7d6[_0xa2e8('0x11')]();}};}; \ 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 85d0cec..311faaf 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 _0x20bf=['info','[%s][GOTOP]\x20priority\x20%s','priority','findIndex','rules','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','stringify','lodash','../../../../config/logger','routing','number','consequence','validate','length','error','[%s][GOTOP]\x20%s','map','message','stop'];(function(_0x41ab68,_0x3e806f){var _0x134b6c=function(_0x4c3a80){while(--_0x4c3a80){_0x41ab68['push'](_0x41ab68['shift']());}};_0x134b6c(++_0x3e806f);}(_0x20bf,0x72));var _0xf20b=function(_0x1dcb6c,_0xe93bd2){_0x1dcb6c=_0x1dcb6c-0x0;var _0xf89381=_0x20bf[_0x1dcb6c];return _0xf89381;};'use strict';var schema=require('validate');var _=require(_0xf20b('0x0'));var logger=require(_0xf20b('0x1'))(_0xf20b('0x2'));var gotop=schema({'priority':{'type':_0xf20b('0x3'),'required':!![],'message':'priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required'}});exports[_0xf20b('0x4')]=function(_0x1da45d,_0x494555){return function(_0x43933a){try{var _0x390914={'priority':_0x494555[0x0]};var _0x528c67=gotop[_0xf20b('0x5')](_0x390914,{'typecast':!![]});if(_0x528c67[_0xf20b('0x6')]){logger[_0xf20b('0x7')](_0xf20b('0x8'),_0x1da45d,_[_0xf20b('0x9')](_0x528c67,_0xf20b('0xa'))['join'](',\x20'));_0x43933a[_0xf20b('0xb')]();}else{logger[_0xf20b('0xc')](_0xf20b('0xd'),_0x1da45d,_0x390914[_0xf20b('0xe')]);if(_0x390914['priority']){var _0x3ad7e6=_[_0xf20b('0xf')](_0x43933a[_0xf20b('0x10')](),{'p':_0x390914[_0xf20b('0xe')]});if(_0x3ad7e6>=0x0){logger[_0xf20b('0xc')](_0xf20b('0x11'),_0x1da45d,_0x390914[_0xf20b('0xe')]||_0xf20b('0x12'),_0x3ad7e6);_0x43933a[_0xf20b('0x12')](_0x3ad7e6);}else{logger[_0xf20b('0xc')](_0xf20b('0x13'),_0x1da45d,_0x390914[_0xf20b('0xe')]||_0xf20b('0x12'));_0x43933a[_0xf20b('0xb')]();}}else{_0x43933a[_0xf20b('0x12')]();}}}catch(_0x3335dd){logger[_0xf20b('0x7')](_0xf20b('0x8'),_0x1da45d,JSON[_0xf20b('0x14')](_0x3335dd));_0x43933a[_0xf20b('0xb')]();}};}; \ No newline at end of file +var _0x3e8e=['join','stop','info','[%s][GOTOP]\x20priority\x20%s','priority','findIndex','rules','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','next','lodash','../../../../config/logger','routing','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','validate','length','error','[%s][GOTOP]\x20%s','map','message'];(function(_0xdfc627,_0x138b03){var _0x219bb9=function(_0x2c903a){while(--_0x2c903a){_0xdfc627['push'](_0xdfc627['shift']());}};_0x219bb9(++_0x138b03);}(_0x3e8e,0x199));var _0xe3e8=function(_0x13df32,_0xe6c068){_0x13df32=_0x13df32-0x0;var _0x22e3ae=_0x3e8e[_0x13df32];return _0x22e3ae;};'use strict';var schema=require('validate');var _=require(_0xe3e8('0x0'));var logger=require(_0xe3e8('0x1'))(_0xe3e8('0x2'));var gotop=schema({'priority':{'type':'number','required':!![],'message':_0xe3e8('0x3')}});exports[_0xe3e8('0x4')]=function(_0x51aa89,_0xb8d077){return function(_0x3f309c){try{var _0x2a8fc9={'priority':_0xb8d077[0x0]};var _0x56d402=gotop[_0xe3e8('0x5')](_0x2a8fc9,{'typecast':!![]});if(_0x56d402[_0xe3e8('0x6')]){logger[_0xe3e8('0x7')](_0xe3e8('0x8'),_0x51aa89,_[_0xe3e8('0x9')](_0x56d402,_0xe3e8('0xa'))[_0xe3e8('0xb')](',\x20'));_0x3f309c[_0xe3e8('0xc')]();}else{logger[_0xe3e8('0xd')](_0xe3e8('0xe'),_0x51aa89,_0x2a8fc9[_0xe3e8('0xf')]);if(_0x2a8fc9[_0xe3e8('0xf')]){var _0xe4d852=_[_0xe3e8('0x10')](_0x3f309c[_0xe3e8('0x11')](),{'p':_0x2a8fc9[_0xe3e8('0xf')]});if(_0xe4d852>=0x0){logger[_0xe3e8('0xd')](_0xe3e8('0x12'),_0x51aa89,_0x2a8fc9['priority']||'next',_0xe4d852);_0x3f309c['next'](_0xe4d852);}else{logger[_0xe3e8('0xd')](_0xe3e8('0x13'),_0x51aa89,_0x2a8fc9[_0xe3e8('0xf')]||_0xe3e8('0x14'));_0x3f309c[_0xe3e8('0xc')]();}}else{_0x3f309c['next']();}}}catch(_0x3ebc0a){logger['error']('[%s][GOTOP]\x20%s',_0x51aa89,JSON['stringify'](_0x3ebc0a));_0x3f309c['stop']();}};}; \ 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 b3a6f5c..c9b3c25 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 _0x32d7=['info','[%s][MESSAGE]\x20%s','body','stringify','stop','lodash','./utils','routing','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','consequence','channel','chat','account','upperFirst','AccountId','interaction','Message','create','then'];(function(_0x4ca796,_0x10dc47){var _0x171f87=function(_0x198d29){while(--_0x198d29){_0x4ca796['push'](_0x4ca796['shift']());}};_0x171f87(++_0x10dc47);}(_0x32d7,0x17b));var _0x732d=function(_0x4dcc2d,_0x422839){_0x4dcc2d=_0x4dcc2d-0x0;var _0x1bbd79=_0x32d7[_0x4dcc2d];return _0x1bbd79;};'use strict';var _=require(_0x732d('0x0'));var utils=require(_0x732d('0x1'));var logger=require('../../../../config/logger')(_0x732d('0x2'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0x732d('0x3')),'mailMessage':require(_0x732d('0x4')),'smsMessage':require(_0x732d('0x5')),'faxMessage':require(_0x732d('0x6'))};exports[_0x732d('0x7')]=function(_0x5b7eba,_0x54b550){return function(_0x5b75f3){try{var _0x32c017={'body':utils['getMustacheRender'](_0x54b550[0x0],this),'ContactId':this['contact']['id']};if(this[_0x732d('0x8')]===_0x732d('0x9')){_0x32c017['ChatWebsiteId']=this[_0x732d('0xa')]['id'];}else{_0x32c017[_[_0x732d('0xb')](this[_0x732d('0x8')])+_0x732d('0xc')]=this[_0x732d('0xa')]['id'];}_0x32c017[_[_0x732d('0xb')](this[_0x732d('0x8')])+'InteractionId']=this[_0x732d('0xd')]['id'];if(rpc[this[_0x732d('0x8')]+_0x732d('0xe')]){return rpc[this[_0x732d('0x8')]+_0x732d('0xe')][_0x732d('0xf')](_0x32c017)[_0x732d('0x10')](function(_0xb0a8f6){logger[_0x732d('0x11')](_0x732d('0x12'),_0x5b7eba,_0x32c017[_0x732d('0x13')]);_0x5b75f3['next']();})['catch'](function(_0x9bcd8b){logger['error'](_0x732d('0x12'),_0x5b7eba,JSON[_0x732d('0x14')](_0x9bcd8b));_0x5b75f3[_0x732d('0x15')]();});}}catch(_0x42c078){logger['error'](_0x732d('0x12'),_0x5b7eba,JSON[_0x732d('0x14')](_0x42c078));_0x5b75f3['stop']();}};}; \ No newline at end of file +var _0xae95=['[%s][MESSAGE]\x20%s','next','catch','error','stringify','stop','lodash','./utils','../../../../config/logger','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','consequence','getMustacheRender','contact','chat','ChatWebsiteId','account','channel','AccountId','upperFirst','InteractionId','interaction','Message','then','info'];(function(_0xaa6a4,_0x64b067){var _0xdc31a4=function(_0x4269d8){while(--_0x4269d8){_0xaa6a4['push'](_0xaa6a4['shift']());}};_0xdc31a4(++_0x64b067);}(_0xae95,0x76));var _0x5ae9=function(_0x3fd71e,_0x38e398){_0x3fd71e=_0x3fd71e-0x0;var _0x39bc6c=_0xae95[_0x3fd71e];return _0x39bc6c;};'use strict';var _=require(_0x5ae9('0x0'));var utils=require(_0x5ae9('0x1'));var logger=require(_0x5ae9('0x2'))('routing');var rpc={'chatMessage':require(_0x5ae9('0x3')),'openchannelMessage':require(_0x5ae9('0x4')),'mailMessage':require(_0x5ae9('0x5')),'smsMessage':require(_0x5ae9('0x6')),'faxMessage':require(_0x5ae9('0x7'))};exports[_0x5ae9('0x8')]=function(_0x57a452,_0x3bf8de){return function(_0xfe2b9d){try{var _0x499da5={'body':utils[_0x5ae9('0x9')](_0x3bf8de[0x0],this),'ContactId':this[_0x5ae9('0xa')]['id']};if(this['channel']===_0x5ae9('0xb')){_0x499da5[_0x5ae9('0xc')]=this[_0x5ae9('0xd')]['id'];}else{_0x499da5[_['upperFirst'](this[_0x5ae9('0xe')])+_0x5ae9('0xf')]=this[_0x5ae9('0xd')]['id'];}_0x499da5[_[_0x5ae9('0x10')](this[_0x5ae9('0xe')])+_0x5ae9('0x11')]=this[_0x5ae9('0x12')]['id'];if(rpc[this['channel']+_0x5ae9('0x13')]){return rpc[this[_0x5ae9('0xe')]+'Message']['create'](_0x499da5)[_0x5ae9('0x14')](function(_0x9e4ac4){logger[_0x5ae9('0x15')](_0x5ae9('0x16'),_0x57a452,_0x499da5['body']);_0xfe2b9d[_0x5ae9('0x17')]();})[_0x5ae9('0x18')](function(_0xf3a879){logger[_0x5ae9('0x19')]('[%s][MESSAGE]\x20%s',_0x57a452,JSON[_0x5ae9('0x1a')](_0xf3a879));_0xfe2b9d[_0x5ae9('0x1b')]();});}}catch(_0x447e60){logger['error']('[%s][MESSAGE]\x20%s',_0x57a452,JSON[_0x5ae9('0x1a')](_0x447e60));_0xfe2b9d['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 e762fa4..441eb78 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 _0x7a70=['./utils','../../../../config/logger','consequence','[%s][NOOP]\x20%s','getMustacheRender','next','error','stringify','stop'];(function(_0x23de83,_0x39c55b){var _0x32e5f8=function(_0x8a9834){while(--_0x8a9834){_0x23de83['push'](_0x23de83['shift']());}};_0x32e5f8(++_0x39c55b);}(_0x7a70,0x1ef));var _0x07a7=function(_0x56319d,_0x5e1a09){_0x56319d=_0x56319d-0x0;var _0x3deb6c=_0x7a70[_0x56319d];return _0x3deb6c;};'use strict';var utils=require(_0x07a7('0x0'));var logger=require(_0x07a7('0x1'))('routing');exports[_0x07a7('0x2')]=function(_0x3d86ef,_0x54636c){return function(_0x25af34){try{logger['info'](_0x07a7('0x3'),_0x3d86ef,utils[_0x07a7('0x4')](_0x54636c[0x0],this));_0x25af34[_0x07a7('0x5')]();}catch(_0x352c73){logger[_0x07a7('0x6')](_0x07a7('0x3'),_0x3d86ef,JSON[_0x07a7('0x7')](_0x352c73));_0x25af34[_0x07a7('0x8')]();}};}; \ No newline at end of file +var _0xe4d2=['routing','consequence','info','[%s][NOOP]\x20%s','error','stop','../../../../config/logger'];(function(_0x631a3c,_0x1b61b6){var _0x2bdfa3=function(_0x21711b){while(--_0x21711b){_0x631a3c['push'](_0x631a3c['shift']());}};_0x2bdfa3(++_0x1b61b6);}(_0xe4d2,0xca));var _0x2e4d=function(_0x50b57f,_0x2f01e9){_0x50b57f=_0x50b57f-0x0;var _0x4386fd=_0xe4d2[_0x50b57f];return _0x4386fd;};'use strict';var utils=require('./utils');var logger=require(_0x2e4d('0x0'))(_0x2e4d('0x1'));exports[_0x2e4d('0x2')]=function(_0x3c6941,_0x14360a){return function(_0x5d7eed){try{logger[_0x2e4d('0x3')](_0x2e4d('0x4'),_0x3c6941,utils['getMustacheRender'](_0x14360a[0x0],this));_0x5d7eed['next']();}catch(_0x4628e9){logger[_0x2e4d('0x5')](_0x2e4d('0x4'),_0x3c6941,JSON['stringify'](_0x4628e9));_0x5d7eed[_0x2e4d('0x6')]();}};}; \ 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 7117250..859adf7 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 _0xbfdd=['redis','defaults','localhost','socket.io-emitter','queue_id','account','queue','joinAt','format','%sQueuesWaitingInteractions','%s:queue:%s','%s_queue_waiting_interaction:%s','save','pick','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','waiting','body','contact','list','upperFirst','QueueId','channel','InteractionId','interaction','MessageId','message','chat','name','QueueReport','error','create\x20queue\x20report','YYYY-MM-DD\x20HH:mm:ss','accepted','info','[%s][STOP:QUEUE][NAME:%s]','update','update\x20queue\x20report','[%s][END:QUEUE][NAME:%s]','catch','toLowerCase','length','[%s][QUEUE]\x20%s','map','join','stop','timeout','createQueue','atimeout','qtimeout','rules','end','[%s][QUEUE]\x20ROUTING\x20STOPPED','[%s][QUEUE]\x20ROUTING\x20END','next','strategy','rrmemory','beepall','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','stack','validate','lodash','util','seq-queue','moment','ioredis','../../../../config/environment','../../../../config/logger','routing'];(function(_0x4d1552,_0x341a8c){var _0x12198c=function(_0x5c1bf8){while(--_0x5c1bf8){_0x4d1552['push'](_0x4d1552['shift']());}};_0x12198c(++_0x341a8c);}(_0xbfdd,0x123));var _0xdbfd=function(_0x4bc65f,_0x39ec43){_0x4bc65f=_0x4bc65f-0x0;var _0x44f85f=_0xbfdd[_0x4bc65f];return _0x44f85f;};'use strict';var schema=require(_0xdbfd('0x0'));var _=require(_0xdbfd('0x1'));var util=require(_0xdbfd('0x2'));var seqqueue=require(_0xdbfd('0x3'));var moment=require(_0xdbfd('0x4'));var Redis=require(_0xdbfd('0x5'));var config=require(_0xdbfd('0x6'));var logger=require(_0xdbfd('0x7'))(_0xdbfd('0x8'));var strategy=require('./strategy');config[_0xdbfd('0x9')]=_[_0xdbfd('0xa')](config[_0xdbfd('0x9')],{'host':_0xdbfd('0xb'),'port':0x18eb});var io=require(_0xdbfd('0xc'))(new Redis(config[_0xdbfd('0x9')]));var attributes=['id',_0xdbfd('0xd'),_0xdbfd('0xe'),_0xdbfd('0xf'),'from',_0xdbfd('0x10')];function emit(_0xd625d7,_0x540c4d,_0x6c355e){io['to'](_0xd625d7)['emit'](_0x540c4d,_0x6c355e);}function emitChannelQueueInteraction(_0xb2b026,_0x162edb,_0x4d4908,_0x16c96f,_0x29774a,_0x2e2483,_0x439e3f,_0x452d47){_0x4d4908[_0xdbfd('0xd')]=_0x452d47;_0x4d4908[_0xdbfd('0xf')]=_0x162edb;_0x4d4908[_0xdbfd('0xe')]=_0x16c96f;_0x4d4908['id']=_0x29774a;if(_0x2e2483){_0x439e3f[util[_0xdbfd('0x11')]('%sQueuesWaitingInteractions',_0xb2b026)][_0x29774a]=_['pick'](_0x4d4908,attributes);}else{delete _0x439e3f[util[_0xdbfd('0x11')](_0xdbfd('0x12'),_0xb2b026)][_0x29774a];}emit(util[_0xdbfd('0x11')](_0xdbfd('0x13'),_0xb2b026,_0x162edb),util[_0xdbfd('0x11')](_0xdbfd('0x14'),_0xb2b026,_0x2e2483?_0xdbfd('0x15'):'remove'),_[_0xdbfd('0x16')](_0x4d4908,attributes));}var rpc={'openchannelQueueReport':require(_0xdbfd('0x17')),'mailQueueReport':require(_0xdbfd('0x18')),'chatQueueReport':require(_0xdbfd('0x19')),'smsQueueReport':require(_0xdbfd('0x1a')),'faxQueueReport':require(_0xdbfd('0x1b'))};var queue=schema({'name':{'type':'string','required':!![],'message':_0xdbfd('0x1c')},'timeout':{'type':_0xdbfd('0x1d'),'message':_0xdbfd('0x1e')}});function startRouting(_0x228833,_0x32fe1a,_0x2a5e52,_0x571082){if(_0x228833&&_0x32fe1a&&_0x2a5e52){_0x32fe1a[_0xdbfd('0x1f')]+=0x1;var _0x48bfb4={'uniqueid':_0x228833,'from':_0x2a5e52[_0xdbfd('0x20')]?_0x2a5e52['body']['from']:'','joinAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x2a5e52[_0xdbfd('0x21')]?_0x2a5e52[_0xdbfd('0x21')]['id']:null,'ListId':_0x2a5e52[_0xdbfd('0x22')]?_0x2a5e52[_0xdbfd('0x22')]['id']:null};_0x48bfb4[_[_0xdbfd('0x23')](_0x2a5e52['channel'])+_0xdbfd('0x24')]=_0x32fe1a['id']||null;_0x48bfb4[_['upperFirst'](_0x2a5e52[_0xdbfd('0x25')])+_0xdbfd('0x26')]=_0x2a5e52['interaction']?_0x2a5e52[_0xdbfd('0x27')]['id']:null;_0x48bfb4[_['upperFirst'](_0x2a5e52[_0xdbfd('0x25')])+_0xdbfd('0x28')]=_0x2a5e52[_0xdbfd('0x29')]?_0x2a5e52['message']['id']:null;_0x48bfb4[_[_0xdbfd('0x23')](_0x2a5e52['channel'])+(_0x2a5e52[_0xdbfd('0x25')]!==_0xdbfd('0x2a')?'AccountId':'WebsiteId')]=_0x2a5e52['account']?_0x2a5e52[_0xdbfd('0xe')]['id']:null;logger['info'](util['format']('[%s][START:QUEUE][NAME:%s]',_0x228833,_0x32fe1a[_0xdbfd('0x2b')]));emitChannelQueueInteraction(_0x2a5e52['channel'],_0x32fe1a[_0xdbfd('0x2b')],_0x48bfb4,_0x2a5e52['account'][_0xdbfd('0x2b')],_0x2a5e52[_0xdbfd('0x29')]['id'],!![],_0x571082,_0x32fe1a['id']);if(rpc[_0x2a5e52[_0xdbfd('0x25')]+_0xdbfd('0x2c')]){return rpc[_0x2a5e52[_0xdbfd('0x25')]+_0xdbfd('0x2c')]['create'](_0x48bfb4)['catch'](function(_0x5ceae3){logger[_0xdbfd('0x2d')](_0xdbfd('0x2e'));});}}}function stopRouting(_0x14dcca,_0x3cbc6a,_0x46d43d,_0xb08bd1){if(_0x14dcca&&_0x3cbc6a){_0x3cbc6a[_0xdbfd('0x1f')]-=0x1;var _0x2ba4bd={'leaveAt':moment()[_0xdbfd('0x11')](_0xdbfd('0x2f')),'acceptAt':moment()[_0xdbfd('0x11')](_0xdbfd('0x2f')),'reason':_0xdbfd('0x30')};logger[_0xdbfd('0x31')](util['format'](_0xdbfd('0x32'),_0x14dcca,_0x3cbc6a[_0xdbfd('0x2b')]));emitChannelQueueInteraction(_0x46d43d[_0xdbfd('0x25')],_0x3cbc6a[_0xdbfd('0x2b')],_0x46d43d[_0xdbfd('0x20')],_0x46d43d[_0xdbfd('0xe')][_0xdbfd('0x2b')],_0x46d43d[_0xdbfd('0x29')]['id'],![],_0xb08bd1,_0x3cbc6a['id']);if(rpc[_0x46d43d[_0xdbfd('0x25')]+_0xdbfd('0x2c')]){return rpc[_0x46d43d[_0xdbfd('0x25')]+'QueueReport'][_0xdbfd('0x33')](_0x14dcca,_0x2ba4bd)['catch'](function(_0x2f3318){logger[_0xdbfd('0x2d')](_0xdbfd('0x34'));});}}}function endRouting(_0x3ceb86,_0x5773ec,_0x1bf372,_0x535fb0){if(_0x3ceb86&&_0x5773ec){_0x5773ec[_0xdbfd('0x1f')]-=0x1;var _0x28255d={'leaveAt':moment()['format'](_0xdbfd('0x2f')),'exitAt':moment()[_0xdbfd('0x11')]('YYYY-MM-DD\x20HH:mm:ss'),'reason':'timeout'};logger['info'](util['format'](_0xdbfd('0x35'),_0x3ceb86,_0x5773ec[_0xdbfd('0x2b')]));emitChannelQueueInteraction(_0x1bf372[_0xdbfd('0x25')],_0x5773ec[_0xdbfd('0x2b')],_0x1bf372['body'],_0x1bf372[_0xdbfd('0xe')][_0xdbfd('0x2b')],_0x1bf372[_0xdbfd('0x29')]['id'],![],_0x535fb0);if(rpc[_0x1bf372[_0xdbfd('0x25')]+_0xdbfd('0x2c')]){return rpc[_0x1bf372[_0xdbfd('0x25')]+_0xdbfd('0x2c')][_0xdbfd('0x33')](_0x3ceb86,_0x28255d)[_0xdbfd('0x36')](function(_0x26363f){logger[_0xdbfd('0x2d')](_0xdbfd('0x34'));});}}}function handleFindQueue(_0x2f6b82){return function(_0x155b5e){return _0x155b5e['name'][_0xdbfd('0x37')]()===_0x2f6b82[_0xdbfd('0x37')]();};}exports['consequence']=function(_0x28dff2,_0x304c3b,_0x43c5f4,_0x1764e3){return function(_0x160ee5){try{var _0x257e79={'name':_0x304c3b[0x0],'timeout':_0x304c3b[0x1]};var _0x570a55=queue[_0xdbfd('0x0')](_0x257e79,{'typecast':!![]});if(_0x570a55[_0xdbfd('0x38')]){logger[_0xdbfd('0x2d')](_0xdbfd('0x39'),_0x28dff2,_[_0xdbfd('0x3a')](_0x570a55,'message')[_0xdbfd('0x3b')](',\x20'));_0x160ee5[_0xdbfd('0x3c')]();}else{var _0x29bdfd=_['find'](_0x43c5f4[_0x1764e3[_0xdbfd('0x25')]+'Queues'],handleFindQueue(_0x257e79['name']));if(_0x29bdfd){startRouting(_0x28dff2,_0x29bdfd,_0x1764e3,_0x43c5f4);var _0x273cc8=(_0x29bdfd['timeout']||0xa)*0x3e8;var _0x27630b=(_0x257e79[_0xdbfd('0x3d')]||0x14)*0x3e8;var _0x12f616,_0x2c4459;if(_0x273cc8>_0x27630b){_0x27630b=_0x273cc8;}var _0xce541d=seqqueue[_0xdbfd('0x3e')](_0x273cc8);_0xce541d['id']=_0x28dff2;_0xce541d[_0xdbfd('0x3f')]=_0x273cc8;_0xce541d[_0xdbfd('0x40')]=_0x27630b;_0xce541d['channel']=_0x1764e3[_0xdbfd('0x25')];_0x43c5f4[_0xdbfd('0x41')][_0x28dff2]['on'](_0xdbfd('0x42'),function(){stopRouting(_0x28dff2,_0x29bdfd,_0x1764e3,_0x43c5f4);_0xce541d['close'](!![]);clearTimeout(_0x12f616);_0x12f616=undefined;if(_0x43c5f4[_0xdbfd('0x41')][_0x28dff2]){delete _0x43c5f4[_0xdbfd('0x41')][_0x28dff2];}logger['info'](_0xdbfd('0x43'),_0x28dff2);_0x160ee5['stop']();});_0x12f616=setTimeout(function(){endRouting(_0x28dff2,_0x29bdfd,_0x1764e3,_0x43c5f4);clearTimeout(_0x12f616);_0xce541d['close'](!![]);logger[_0xdbfd('0x31')](_0xdbfd('0x44'),_0x28dff2);_0x160ee5[_0xdbfd('0x45')]();},_0x27630b);switch(_0x29bdfd[_0xdbfd('0x46')]){case _0xdbfd('0x47'):strategy['rrmemory'](_0xce541d,_0x29bdfd,_0x43c5f4,_0x1764e3);break;default:strategy[_0xdbfd('0x48')](_0xce541d,_0x29bdfd,_0x43c5f4,_0x1764e3);}}else{logger[_0xdbfd('0x2d')](_0xdbfd('0x49'),_0x28dff2,_0x257e79[_0xdbfd('0x2b')]);_0x160ee5['stop']();}}}catch(_0x7db376){console['log'](_0x7db376);logger[_0xdbfd('0x2d')](_0xdbfd('0x39'),_0x28dff2,_0x7db376[_0xdbfd('0x4a')]);_0x160ee5['stop']();}};}; \ No newline at end of file +var _0x1147=['toLowerCase','consequence','validate','length','[%s][QUEUE]\x20%s','join','find','Queues','createQueue','rules','stop','close','[%s][QUEUE]\x20ROUTING\x20END','next','strategy','rrmemory','beepall','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','log','stack','lodash','util','seq-queue','moment','ioredis','../../../../config/logger','routing','./strategy','redis','localhost','socket.io-emitter','queue_id','account','queue','from','joinAt','format','%s:queue:%s','remove','pick','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/faxQueueReport','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','waiting','body','contact','list','upperFirst','channel','QueueId','interaction','MessageId','message','chat','AccountId','info','name','QueueReport','create','error','YYYY-MM-DD\x20HH:mm:ss','accepted','[%s][STOP:QUEUE][NAME:%s]','update','catch','update\x20queue\x20report','timeout','[%s][END:QUEUE][NAME:%s]'];(function(_0x302408,_0x30de19){var _0x1679e0=function(_0x420796){while(--_0x420796){_0x302408['push'](_0x302408['shift']());}};_0x1679e0(++_0x30de19);}(_0x1147,0x1ca));var _0x7114=function(_0x3dfdf7,_0x5c48fd){_0x3dfdf7=_0x3dfdf7-0x0;var _0x476887=_0x1147[_0x3dfdf7];return _0x476887;};'use strict';var schema=require('validate');var _=require(_0x7114('0x0'));var util=require(_0x7114('0x1'));var seqqueue=require(_0x7114('0x2'));var moment=require(_0x7114('0x3'));var Redis=require(_0x7114('0x4'));var config=require('../../../../config/environment');var logger=require(_0x7114('0x5'))(_0x7114('0x6'));var strategy=require(_0x7114('0x7'));config[_0x7114('0x8')]=_['defaults'](config['redis'],{'host':_0x7114('0x9'),'port':0x18eb});var io=require(_0x7114('0xa'))(new Redis(config[_0x7114('0x8')]));var attributes=['id',_0x7114('0xb'),_0x7114('0xc'),_0x7114('0xd'),_0x7114('0xe'),_0x7114('0xf')];function emit(_0x3e215e,_0x5c8b04,_0x3051ac){io['to'](_0x3e215e)['emit'](_0x5c8b04,_0x3051ac);}function emitChannelQueueInteraction(_0x5f1af2,_0x456eba,_0x128d53,_0x216b98,_0x3d2175,_0x489757,_0x40b2d3,_0x3d03af){_0x128d53[_0x7114('0xb')]=_0x3d03af;_0x128d53[_0x7114('0xd')]=_0x456eba;_0x128d53[_0x7114('0xc')]=_0x216b98;_0x128d53['id']=_0x3d2175;if(_0x489757){_0x40b2d3[util['format']('%sQueuesWaitingInteractions',_0x5f1af2)][_0x3d2175]=_['pick'](_0x128d53,attributes);}else{delete _0x40b2d3[util[_0x7114('0x10')]('%sQueuesWaitingInteractions',_0x5f1af2)][_0x3d2175];}emit(util['format'](_0x7114('0x11'),_0x5f1af2,_0x456eba),util[_0x7114('0x10')]('%s_queue_waiting_interaction:%s',_0x5f1af2,_0x489757?'save':_0x7114('0x12')),_[_0x7114('0x13')](_0x128d53,attributes));}var rpc={'openchannelQueueReport':require(_0x7114('0x14')),'mailQueueReport':require(_0x7114('0x15')),'chatQueueReport':require(_0x7114('0x16')),'smsQueueReport':require('../../rpc/smsQueueReport'),'faxQueueReport':require(_0x7114('0x17'))};var queue=schema({'name':{'type':_0x7114('0x18'),'required':!![],'message':_0x7114('0x19')},'timeout':{'type':_0x7114('0x1a'),'message':_0x7114('0x1b')}});function startRouting(_0x1002c7,_0x2205df,_0x5afa6b,_0x2bc5fc){if(_0x1002c7&&_0x2205df&&_0x5afa6b){_0x2205df[_0x7114('0x1c')]+=0x1;var _0x47520b={'uniqueid':_0x1002c7,'from':_0x5afa6b[_0x7114('0x1d')]?_0x5afa6b[_0x7114('0x1d')]['from']:'','joinAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x5afa6b['contact']?_0x5afa6b[_0x7114('0x1e')]['id']:null,'ListId':_0x5afa6b['list']?_0x5afa6b[_0x7114('0x1f')]['id']:null};_0x47520b[_[_0x7114('0x20')](_0x5afa6b[_0x7114('0x21')])+_0x7114('0x22')]=_0x2205df['id']||null;_0x47520b[_[_0x7114('0x20')](_0x5afa6b[_0x7114('0x21')])+'InteractionId']=_0x5afa6b['interaction']?_0x5afa6b[_0x7114('0x23')]['id']:null;_0x47520b[_[_0x7114('0x20')](_0x5afa6b[_0x7114('0x21')])+_0x7114('0x24')]=_0x5afa6b['message']?_0x5afa6b[_0x7114('0x25')]['id']:null;_0x47520b[_['upperFirst'](_0x5afa6b[_0x7114('0x21')])+(_0x5afa6b[_0x7114('0x21')]!==_0x7114('0x26')?_0x7114('0x27'):'WebsiteId')]=_0x5afa6b[_0x7114('0xc')]?_0x5afa6b['account']['id']:null;logger[_0x7114('0x28')](util[_0x7114('0x10')]('[%s][START:QUEUE][NAME:%s]',_0x1002c7,_0x2205df[_0x7114('0x29')]));emitChannelQueueInteraction(_0x5afa6b[_0x7114('0x21')],_0x2205df[_0x7114('0x29')],_0x47520b,_0x5afa6b[_0x7114('0xc')][_0x7114('0x29')],_0x5afa6b[_0x7114('0x25')]['id'],!![],_0x2bc5fc,_0x2205df['id']);if(rpc[_0x5afa6b[_0x7114('0x21')]+_0x7114('0x2a')]){return rpc[_0x5afa6b[_0x7114('0x21')]+_0x7114('0x2a')][_0x7114('0x2b')](_0x47520b)['catch'](function(_0x3b6040){logger[_0x7114('0x2c')]('create\x20queue\x20report');});}}}function stopRouting(_0x176b87,_0x42166d,_0xfc6f4d,_0x1dc6ac){if(_0x176b87&&_0x42166d){_0x42166d[_0x7114('0x1c')]-=0x1;var _0x2d36c5={'leaveAt':moment()[_0x7114('0x10')]('YYYY-MM-DD\x20HH:mm:ss'),'acceptAt':moment()['format'](_0x7114('0x2d')),'reason':_0x7114('0x2e')};logger['info'](util[_0x7114('0x10')](_0x7114('0x2f'),_0x176b87,_0x42166d[_0x7114('0x29')]));emitChannelQueueInteraction(_0xfc6f4d[_0x7114('0x21')],_0x42166d[_0x7114('0x29')],_0xfc6f4d[_0x7114('0x1d')],_0xfc6f4d['account'][_0x7114('0x29')],_0xfc6f4d[_0x7114('0x25')]['id'],![],_0x1dc6ac,_0x42166d['id']);if(rpc[_0xfc6f4d[_0x7114('0x21')]+_0x7114('0x2a')]){return rpc[_0xfc6f4d[_0x7114('0x21')]+_0x7114('0x2a')][_0x7114('0x30')](_0x176b87,_0x2d36c5)[_0x7114('0x31')](function(_0xb9f9f2){logger[_0x7114('0x2c')](_0x7114('0x32'));});}}}function endRouting(_0x1185f4,_0x2705cc,_0x44cd7f,_0x3b1a4b){if(_0x1185f4&&_0x2705cc){_0x2705cc[_0x7114('0x1c')]-=0x1;var _0x166325={'leaveAt':moment()[_0x7114('0x10')](_0x7114('0x2d')),'exitAt':moment()['format'](_0x7114('0x2d')),'reason':_0x7114('0x33')};logger['info'](util[_0x7114('0x10')](_0x7114('0x34'),_0x1185f4,_0x2705cc['name']));emitChannelQueueInteraction(_0x44cd7f['channel'],_0x2705cc[_0x7114('0x29')],_0x44cd7f[_0x7114('0x1d')],_0x44cd7f[_0x7114('0xc')][_0x7114('0x29')],_0x44cd7f[_0x7114('0x25')]['id'],![],_0x3b1a4b);if(rpc[_0x44cd7f[_0x7114('0x21')]+'QueueReport']){return rpc[_0x44cd7f['channel']+'QueueReport'][_0x7114('0x30')](_0x1185f4,_0x166325)[_0x7114('0x31')](function(_0x55bcc2){logger[_0x7114('0x2c')](_0x7114('0x32'));});}}}function handleFindQueue(_0x4886b3){return function(_0x10cbb4){return _0x10cbb4[_0x7114('0x29')][_0x7114('0x35')]()===_0x4886b3[_0x7114('0x35')]();};}exports[_0x7114('0x36')]=function(_0x37ba56,_0x34e54c,_0x4c9da9,_0x58371b){return function(_0x5b4d72){try{var _0x3d7737={'name':_0x34e54c[0x0],'timeout':_0x34e54c[0x1]};var _0x29f4ad=queue[_0x7114('0x37')](_0x3d7737,{'typecast':!![]});if(_0x29f4ad[_0x7114('0x38')]){logger[_0x7114('0x2c')](_0x7114('0x39'),_0x37ba56,_['map'](_0x29f4ad,'message')[_0x7114('0x3a')](',\x20'));_0x5b4d72['stop']();}else{var _0x4625d4=_[_0x7114('0x3b')](_0x4c9da9[_0x58371b[_0x7114('0x21')]+_0x7114('0x3c')],handleFindQueue(_0x3d7737[_0x7114('0x29')]));if(_0x4625d4){startRouting(_0x37ba56,_0x4625d4,_0x58371b,_0x4c9da9);var _0x136353=(_0x4625d4[_0x7114('0x33')]||0xa)*0x3e8;var _0x32c1ff=(_0x3d7737[_0x7114('0x33')]||0x14)*0x3e8;var _0x42d125,_0x4a4a0e;if(_0x136353>_0x32c1ff){_0x32c1ff=_0x136353;}var _0x147ff6=seqqueue[_0x7114('0x3d')](_0x136353);_0x147ff6['id']=_0x37ba56;_0x147ff6['atimeout']=_0x136353;_0x147ff6['qtimeout']=_0x32c1ff;_0x147ff6['channel']=_0x58371b[_0x7114('0x21')];_0x4c9da9[_0x7114('0x3e')][_0x37ba56]['on']('end',function(){stopRouting(_0x37ba56,_0x4625d4,_0x58371b,_0x4c9da9);_0x147ff6['close'](!![]);clearTimeout(_0x42d125);_0x42d125=undefined;if(_0x4c9da9[_0x7114('0x3e')][_0x37ba56]){delete _0x4c9da9['rules'][_0x37ba56];}logger[_0x7114('0x28')]('[%s][QUEUE]\x20ROUTING\x20STOPPED',_0x37ba56);_0x5b4d72[_0x7114('0x3f')]();});_0x42d125=setTimeout(function(){endRouting(_0x37ba56,_0x4625d4,_0x58371b,_0x4c9da9);clearTimeout(_0x42d125);_0x147ff6[_0x7114('0x40')](!![]);logger[_0x7114('0x28')](_0x7114('0x41'),_0x37ba56);_0x5b4d72[_0x7114('0x42')]();},_0x32c1ff);switch(_0x4625d4[_0x7114('0x43')]){case _0x7114('0x44'):strategy[_0x7114('0x44')](_0x147ff6,_0x4625d4,_0x4c9da9,_0x58371b);break;default:strategy[_0x7114('0x45')](_0x147ff6,_0x4625d4,_0x4c9da9,_0x58371b);}}else{logger[_0x7114('0x2c')](_0x7114('0x46'),_0x37ba56,_0x3d7737[_0x7114('0x29')]);_0x5b4d72['stop']();}}}catch(_0x21dbc5){console[_0x7114('0x47')](_0x21dbc5);logger['error']('[%s][QUEUE]\x20%s',_0x37ba56,_0x21dbc5[_0x7114('0x48')]);_0x5b4d72[_0x7114('0x3f')]();}};}; \ 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 3f06d88..a3ba1f6 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 _0xfcb0=['channel','showNotification','RINGING',':FORCED','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','[%s][AGENT]\x20timeout\x20with\x20%s','busyQueue','writeLog','STOP','exports','lodash','./util','../../../../../config/logger','routing','notificationId','squeue','realtime','push','handleRun','handleTimeout','timeout','drained','handleDrained','bind','prototype','info','[%s][AGENT]\x20try\x20with\x20%s','agent','isNil','agents','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','forcedOwnership','isAgentAvailable'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xfcb0,0x8e));var _0x0fcb=function(_0x3040c9,_0x3fbff4){_0x3040c9=_0x3040c9-0x0;var _0x31df2c=_0xfcb0[_0x3040c9];return _0x31df2c;};'use strict';var _=require(_0x0fcb('0x0'));var uuid=require('uuid');var util=require(_0x0fcb('0x1'));var logger=require(_0x0fcb('0x2'))(_0x0fcb('0x3'));var Agent=function(_0xefe1d1,_0x4b2722,_0x2b2d52,_0x3cf493){this[_0x0fcb('0x4')]=uuid['v4']();this[_0x0fcb('0x5')]=_0xefe1d1;this['agent']=_0x4b2722;this[_0x0fcb('0x6')]=_0x2b2d52;this[_0x0fcb('0x3')]=_0x3cf493;this[_0x0fcb('0x5')][_0x0fcb('0x7')](this[_0x0fcb('0x8')]['bind'](this),this[_0x0fcb('0x9')]['bind'](this));this[_0x0fcb('0x5')]['on'](_0x0fcb('0xa'),this['handleTimeout']['bind'](this));this['squeue']['on'](_0x0fcb('0xb'),this[_0x0fcb('0xc')][_0x0fcb('0xd')](this));};Agent[_0x0fcb('0xe')][_0x0fcb('0x7')]=function(){this[_0x0fcb('0x5')][_0x0fcb('0x7')](this[_0x0fcb('0x8')]['bind'](this),this['handleTimeout'][_0x0fcb('0xd')](this));};Agent[_0x0fcb('0xe')][_0x0fcb('0xc')]=function(){this['handleTimeout'](!![]);};Agent[_0x0fcb('0xe')][_0x0fcb('0x8')]=function(_0x4d259f){logger[_0x0fcb('0xf')](_0x0fcb('0x10'),this[_0x0fcb('0x5')]['id'],this[_0x0fcb('0x11')]['id']);if(_[_0x0fcb('0x12')](this[_0x0fcb('0x6')][_0x0fcb('0x13')][this[_0x0fcb('0x11')]['id']])){logger['info'](_0x0fcb('0x14'),this[_0x0fcb('0x5')]['id'],this[_0x0fcb('0x11')]['id']);setTimeout(this[_0x0fcb('0x7')][_0x0fcb('0xd')](this),0x3e8);}else{if(this[_0x0fcb('0x3')][_0x0fcb('0x15')]||util[_0x0fcb('0x16')](this[_0x0fcb('0x5')]['id'],this[_0x0fcb('0x6')][_0x0fcb('0x13')][this['agent']['id']],this[_0x0fcb('0x5')][_0x0fcb('0x17')],![])){this['realtime']['agents'][this['agent']['id']]['busy']=!![];this[_0x0fcb('0x6')][_0x0fcb('0x13')][this['agent']['id']]['busyQueue']=undefined;util[_0x0fcb('0x18')](this[_0x0fcb('0x4')],this[_0x0fcb('0x5')]['id'],this[_0x0fcb('0x6')][_0x0fcb('0x13')][this[_0x0fcb('0x11')]['id']],null,this[_0x0fcb('0x3')]);util['writeLog'](this[_0x0fcb('0x5')]['id'],this[_0x0fcb('0x6')][_0x0fcb('0x13')][this[_0x0fcb('0x11')]['id']],_0x0fcb('0x19')+(this[_0x0fcb('0x3')][_0x0fcb('0x15')]?_0x0fcb('0x1a'):''));}else{logger[_0x0fcb('0xf')](_0x0fcb('0x1b'),this['squeue']['id'],this['agent']['id']);setTimeout(this[_0x0fcb('0x7')][_0x0fcb('0xd')](this),0x3e8);}}};Agent[_0x0fcb('0xe')][_0x0fcb('0x9')]=function(_0x591146){if(_[_0x0fcb('0x12')](this[_0x0fcb('0x6')]['agents'][this[_0x0fcb('0x11')]['id']])){return logger[_0x0fcb('0xf')](_0x0fcb('0x14'),this[_0x0fcb('0x5')]['id'],this[_0x0fcb('0x11')]['id']);}else{logger['info'](_0x0fcb('0x1c'),this[_0x0fcb('0x5')]['id'],this[_0x0fcb('0x11')]['id']);util['hideNotification'](this[_0x0fcb('0x4')],this['squeue']['id'],this[_0x0fcb('0x6')][_0x0fcb('0x13')][this[_0x0fcb('0x11')]['id']],null,this['routing']);this[_0x0fcb('0x6')][_0x0fcb('0x13')][this[_0x0fcb('0x11')]['id']]['busy']=![];this[_0x0fcb('0x6')][_0x0fcb('0x13')][this[_0x0fcb('0x11')]['id']][_0x0fcb('0x1d')]=undefined;util[_0x0fcb('0x1e')](this['squeue']['id'],this[_0x0fcb('0x6')][_0x0fcb('0x13')][this[_0x0fcb('0x11')]['id']],_0x591146?_0x0fcb('0x1f'):'TIMEOUT');}if(!_0x591146){setTimeout(this[_0x0fcb('0x7')][_0x0fcb('0xd')](this),0x3e8);}};function agent(_0x3f0525,_0x6f388c,_0x396df5,_0x2483b0){return new Agent(_0x3f0525,_0x6f388c,_0x396df5,_0x2483b0);}module[_0x0fcb('0x20')]=agent; \ No newline at end of file +var _0xb492=['info','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','forcedOwnership','agents','busy','showNotification','RINGING',':FORCED','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','[%s][AGENT]\x20timeout\x20with\x20%s','hideNotification','busyQueue','writeLog','STOP','TIMEOUT','lodash','uuid','./util','../../../../../config/logger','routing','notificationId','squeue','push','handleRun','bind','timeout','handleDrained','prototype','handleTimeout','isNil','realtime','agent'];(function(_0x55031f,_0x15b945){var _0x1039d4=function(_0xa5de36){while(--_0xa5de36){_0x55031f['push'](_0x55031f['shift']());}};_0x1039d4(++_0x15b945);}(_0xb492,0x14f));var _0x2b49=function(_0x12da8e,_0x945c85){_0x12da8e=_0x12da8e-0x0;var _0x1fc6ef=_0xb492[_0x12da8e];return _0x1fc6ef;};'use strict';var _=require(_0x2b49('0x0'));var uuid=require(_0x2b49('0x1'));var util=require(_0x2b49('0x2'));var logger=require(_0x2b49('0x3'))(_0x2b49('0x4'));var Agent=function(_0x708047,_0x268fac,_0x3d0a32,_0xfff954){this[_0x2b49('0x5')]=uuid['v4']();this[_0x2b49('0x6')]=_0x708047;this['agent']=_0x268fac;this['realtime']=_0x3d0a32;this[_0x2b49('0x4')]=_0xfff954;this[_0x2b49('0x6')][_0x2b49('0x7')](this[_0x2b49('0x8')]['bind'](this),this['handleTimeout'][_0x2b49('0x9')](this));this['squeue']['on'](_0x2b49('0xa'),this['handleTimeout'][_0x2b49('0x9')](this));this['squeue']['on']('drained',this[_0x2b49('0xb')][_0x2b49('0x9')](this));};Agent[_0x2b49('0xc')]['push']=function(){this[_0x2b49('0x6')][_0x2b49('0x7')](this[_0x2b49('0x8')][_0x2b49('0x9')](this),this[_0x2b49('0xd')][_0x2b49('0x9')](this));};Agent[_0x2b49('0xc')][_0x2b49('0xb')]=function(){this[_0x2b49('0xd')](!![]);};Agent[_0x2b49('0xc')]['handleRun']=function(_0x53178b){logger['info']('[%s][AGENT]\x20try\x20with\x20%s',this[_0x2b49('0x6')]['id'],this['agent']['id']);if(_[_0x2b49('0xe')](this[_0x2b49('0xf')]['agents'][this[_0x2b49('0x10')]['id']])){logger[_0x2b49('0x11')](_0x2b49('0x12'),this[_0x2b49('0x6')]['id'],this['agent']['id']);setTimeout(this[_0x2b49('0x7')][_0x2b49('0x9')](this),0x3e8);}else{if(this['routing'][_0x2b49('0x13')]||util['isAgentAvailable'](this[_0x2b49('0x6')]['id'],this[_0x2b49('0xf')][_0x2b49('0x14')][this['agent']['id']],this[_0x2b49('0x6')]['channel'],![])){this[_0x2b49('0xf')][_0x2b49('0x14')][this[_0x2b49('0x10')]['id']][_0x2b49('0x15')]=!![];this[_0x2b49('0xf')][_0x2b49('0x14')][this[_0x2b49('0x10')]['id']]['busyQueue']=undefined;util[_0x2b49('0x16')](this['notificationId'],this[_0x2b49('0x6')]['id'],this[_0x2b49('0xf')][_0x2b49('0x14')][this[_0x2b49('0x10')]['id']],null,this[_0x2b49('0x4')]);util['writeLog'](this[_0x2b49('0x6')]['id'],this[_0x2b49('0xf')][_0x2b49('0x14')][this[_0x2b49('0x10')]['id']],_0x2b49('0x17')+(this[_0x2b49('0x4')][_0x2b49('0x13')]?_0x2b49('0x18'):''));}else{logger[_0x2b49('0x11')](_0x2b49('0x19'),this[_0x2b49('0x6')]['id'],this['agent']['id']);setTimeout(this['push']['bind'](this),0x3e8);}}};Agent[_0x2b49('0xc')][_0x2b49('0xd')]=function(_0x3f8826){if(_[_0x2b49('0xe')](this[_0x2b49('0xf')]['agents'][this[_0x2b49('0x10')]['id']])){return logger[_0x2b49('0x11')](_0x2b49('0x12'),this[_0x2b49('0x6')]['id'],this['agent']['id']);}else{logger[_0x2b49('0x11')](_0x2b49('0x1a'),this['squeue']['id'],this['agent']['id']);util[_0x2b49('0x1b')](this[_0x2b49('0x5')],this['squeue']['id'],this['realtime'][_0x2b49('0x14')][this[_0x2b49('0x10')]['id']],null,this[_0x2b49('0x4')]);this['realtime'][_0x2b49('0x14')][this['agent']['id']][_0x2b49('0x15')]=![];this['realtime'][_0x2b49('0x14')][this[_0x2b49('0x10')]['id']][_0x2b49('0x1c')]=undefined;util[_0x2b49('0x1d')](this['squeue']['id'],this[_0x2b49('0xf')][_0x2b49('0x14')][this[_0x2b49('0x10')]['id']],_0x3f8826?_0x2b49('0x1e'):_0x2b49('0x1f'));}if(!_0x3f8826){setTimeout(this['push']['bind'](this),0x3e8);}};function agent(_0x4b5534,_0x3ebbd7,_0x588253,_0x18fffb){return new Agent(_0x4b5534,_0x3ebbd7,_0x588253,_0x18fffb);}module['exports']=agent; \ No newline at end of file diff --git a/server/services/routing/server/applications/strategy/beepall.js b/server/services/routing/server/applications/strategy/beepall.js index 868a3c2..c73a122 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 _0x9ed9=['STOP','TIMEOUT','exports','lodash','uuid','../../../../../config/logger','routing','notificationId','squeue','push','handleTimeout','bind','drained','prototype','handleRun','handleDrained','isNil','queue','Agents','length','realtime','agents','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','isAgentAvailable','channel','writeLog','RINGING','busy','busyQueue','name','showNotification','info','[%s][QUEUE]\x20ALL\x20AGENTS\x20ARE\x20BUSY','[%s][QUEUE]\x20EMPTY','hideNotification'];(function(_0x289fd4,_0xd34ba6){var _0x3d4a88=function(_0x2a3726){while(--_0x2a3726){_0x289fd4['push'](_0x289fd4['shift']());}};_0x3d4a88(++_0xd34ba6);}(_0x9ed9,0x1ca));var _0x99ed=function(_0x41f258,_0x28784c){_0x41f258=_0x41f258-0x0;var _0xc11a43=_0x9ed9[_0x41f258];return _0xc11a43;};'use strict';var _=require(_0x99ed('0x0'));var uuid=require(_0x99ed('0x1'));var util=require('./util');var logger=require(_0x99ed('0x2'))(_0x99ed('0x3'));var Beepall=function(_0x24980a,_0x5e343a,_0x3e4c46,_0x4c2978){this[_0x99ed('0x4')]=uuid['v4']();this[_0x99ed('0x5')]=_0x24980a;this['queue']=_0x5e343a;this['realtime']=_0x3e4c46;this[_0x99ed('0x3')]=_0x4c2978;this['squeue'][_0x99ed('0x6')](this['handleRun']['bind'](this),this[_0x99ed('0x7')][_0x99ed('0x8')](this));this['squeue']['on']('timeout',this[_0x99ed('0x7')][_0x99ed('0x8')](this));this[_0x99ed('0x5')]['on'](_0x99ed('0x9'),this['handleDrained'][_0x99ed('0x8')](this));};Beepall[_0x99ed('0xa')][_0x99ed('0x6')]=function(){this[_0x99ed('0x5')][_0x99ed('0x6')](this[_0x99ed('0xb')][_0x99ed('0x8')](this),this[_0x99ed('0x7')][_0x99ed('0x8')](this));};Beepall[_0x99ed('0xa')][_0x99ed('0xc')]=function(_0x33555f){this[_0x99ed('0x7')](!![]);};Beepall[_0x99ed('0xa')][_0x99ed('0xb')]=function(_0x582520){var _0x5b0de0=!![];if(!_[_0x99ed('0xd')](this[_0x99ed('0xe')])&&!_[_0x99ed('0xd')](this[_0x99ed('0xe')]['Agents'])&&this[_0x99ed('0xe')][_0x99ed('0xf')][_0x99ed('0x10')]>0x0){for(var _0x212246=0x0,_0x58d483;_0x2122460x0){for(var _0x35b3ec=0x0,_0x355c75;_0x35b3ec0x0&&_0x2378a7[_0x1f6811+_0xeeb3('0x23')]>=_0x2378a7[_0x1f6811+'Capacity']){writeLog(_0x8f9fe4,_0x2378a7,_0x1f6811[_0xeeb3('0x24')]()+'\x20MAXCAPACITY');return![];}}return!![];};exports['showNotification']=function(_0x132437,_0x3afdbd,_0xe0b460,_0x2611e6,_0x468076){return sendNotification(!![],_0x132437,_0x3afdbd,_0xe0b460,_0x2611e6,_0x468076);};exports[_0xeeb3('0x25')]=function(_0x20fdec,_0x47b6fd,_0x3eeb79,_0x44e5fe,_0x10b2f9){return sendNotification(![],_0x20fdec,_0x47b6fd,_0x3eeb79,_0x44e5fe,_0x10b2f9);};exports[_0xeeb3('0x26')]=writeLog; \ No newline at end of file +var _0xcd60=['user:%s','name','user:save','\x20interaction','notificationSound','notificationShake','body','queue','msg','getMustacheRender','account','notificationTemplate','I\x20can\x27t\x20render\x20your\x20template','error','format','notification:%s','save','remove','info','isAgentAvailable','busy','PAUSE','hasOwnProperty','Capacity','CurrentCapacity','toUpperCase','\x20MAXCAPACITY','showNotification','hideNotification','writeLog','lodash','util','../utils','mustache','ioredis','../../../../../config/environment','../../../../../config/logger','redis','defaults','localhost','socket.io-emitter','emit'];(function(_0x1581d8,_0x41cdf7){var _0x3a2c18=function(_0x4adb37){while(--_0x4adb37){_0x1581d8['push'](_0x1581d8['shift']());}};_0x3a2c18(++_0x41cdf7);}(_0xcd60,0xf0));var _0x0cd6=function(_0x26e0a9,_0xc9a17b){_0x26e0a9=_0x26e0a9-0x0;var _0x560d30=_0xcd60[_0x26e0a9];return _0x560d30;};'use strict';var _=require(_0x0cd6('0x0'));var util=require(_0x0cd6('0x1'));var utils=require(_0x0cd6('0x2'));var Mustache=require(_0x0cd6('0x3'));var Redis=require(_0x0cd6('0x4'));var config=require(_0x0cd6('0x5'));var logger=require(_0x0cd6('0x6'))('routing');config[_0x0cd6('0x7')]=_[_0x0cd6('0x8')](config[_0x0cd6('0x7')],{'host':_0x0cd6('0x9'),'port':0x18eb});var io=require(_0x0cd6('0xa'))(new Redis(config['redis']));function emit(_0x2ceb47,_0x460833,_0x47c8b2){io['to'](_0x2ceb47)[_0x0cd6('0xb')](_0x460833,_0x47c8b2);}function sendNotification(_0x4fb298,_0x4eae5,_0x253137,_0x14f396,_0x340015,_0x308ebe){io['to'](util['format'](_0x0cd6('0xc'),_0x14f396[_0x0cd6('0xd')]))[_0x0cd6('0xb')](_0x0cd6('0xe'),_0x14f396);var _0x1c10da=_0x308ebe||{};var _0x56acab=_0x253137['split']('.');var _0x8bbba={'uniqueid':_0x4eae5,'channel':_0x56acab[0x0],'id':_0x56acab[0x1],'title':_0x56acab[0x0]+_0x0cd6('0xf'),'interactionId':_0x56acab[0x2],'queue':_0x340015?_0x340015[_0x0cd6('0xd')]:null,'sound':_0x1c10da['account'][_0x0cd6('0x10')],'shake':_0x1c10da['account'][_0x0cd6('0x11')]};try{if(!_0x1c10da[_0x0cd6('0x12')]){_0x1c10da[_0x0cd6('0x12')]={};}if(_0x340015){_0x1c10da[_0x0cd6('0x12')][_0x0cd6('0x13')]=_0x340015;}else if(_0x1c10da[_0x0cd6('0x12')][_0x0cd6('0x13')]){delete _0x1c10da[_0x0cd6('0x12')][_0x0cd6('0x13')];}_0x8bbba[_0x0cd6('0x14')]=utils[_0x0cd6('0x15')](_0x1c10da[_0x0cd6('0x16')][_0x0cd6('0x17')],_0x1c10da);}catch(_0x1b0c3d){_0x8bbba['msg']=_0x0cd6('0x18');logger[_0x0cd6('0x19')](util['format']('[%s][QUEUE]\x20%s',_0x4eae5,_0x1b0c3d['message']));}io['to'](util[_0x0cd6('0x1a')]('user:%s',_0x14f396['name']))[_0x0cd6('0xb')](util['format'](_0x0cd6('0x1b'),_0x4fb298?_0x0cd6('0x1c'):_0x0cd6('0x1d')),_0x8bbba);}function writeLog(_0x1bb2d6,_0xab7f8c,_0x33b228){return logger[_0x0cd6('0x1e')](util[_0x0cd6('0x1a')]('[%s][QUEUE][AGENT:%s][STATUS:%s]',_0x1bb2d6,_0xab7f8c[_0x0cd6('0xd')],_0x33b228));}exports[_0x0cd6('0x1f')]=function(_0x394a22,_0x4e22f7,_0x55f68f,_0x5cacd5){if(_0x4e22f7[_0x0cd6('0x20')]){writeLog(_0x394a22,_0x4e22f7,'BUSY');return![];}if(!_0x4e22f7['online']){writeLog(_0x394a22,_0x4e22f7,'OFFLINE');return![];}if(_0x4e22f7[_0x55f68f+'Pause']){writeLog(_0x394a22,_0x4e22f7,_0x0cd6('0x21'));return![];}if(_0x5cacd5&&_0x4e22f7[_0x0cd6('0x22')](_0x55f68f+_0x0cd6('0x23'))&&_0x4e22f7[_0x0cd6('0x22')](_0x55f68f+'CurrentCapacity')){if(_0x4e22f7[_0x55f68f+'Capacity']>0x0&&_0x4e22f7[_0x55f68f+_0x0cd6('0x24')]>=_0x4e22f7[_0x55f68f+'Capacity']){writeLog(_0x394a22,_0x4e22f7,_0x55f68f[_0x0cd6('0x25')]()+_0x0cd6('0x26'));return![];}}return!![];};exports[_0x0cd6('0x27')]=function(_0x1d505a,_0x1e75ef,_0x27b771,_0x417f5c,_0x341cee){return sendNotification(!![],_0x1d505a,_0x1e75ef,_0x27b771,_0x417f5c,_0x341cee);};exports[_0x0cd6('0x28')]=function(_0x72c358,_0x1cb053,_0x28d10b,_0x3ab0e7,_0x66e0e2){return sendNotification(![],_0x72c358,_0x1cb053,_0x28d10b,_0x3ab0e7,_0x66e0e2);};exports[_0x0cd6('0x29')]=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 4009054..4828b1d 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 _0xc801=['body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','next','validate','shelljs','lodash','./utils','routing','string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','error','[%s][SYSTEM]\x20%s','map','join','info','getMustacheRender','[%s][SYSTEM]\x20commnad:\x20%s','exec','trim','[%s][SYSTEM]\x20result\x20code:\x20%s','replace','isNil','[%s][SYSTEM]\x20no\x20variable'];(function(_0x5f1391,_0x19c132){var _0x50ebe3=function(_0x3d00a3){while(--_0x3d00a3){_0x5f1391['push'](_0x5f1391['shift']());}};_0x50ebe3(++_0x19c132);}(_0xc801,0xfd));var _0x1c80=function(_0x580576,_0x2f107d){_0x580576=_0x580576-0x0;var _0x3f55a0=_0xc801[_0x580576];return _0x3f55a0;};'use strict';var schema=require(_0x1c80('0x0'));var sh=require(_0x1c80('0x1'));var _=require(_0x1c80('0x2'));var utils=require(_0x1c80('0x3'));var logger=require('../../../../config/logger')(_0x1c80('0x4'));var system=schema({'command':{'type':_0x1c80('0x5'),'required':!![],'message':_0x1c80('0x6')}});exports[_0x1c80('0x7')]=function(_0x55ec5f,_0x2a458b){return function(_0x1cc9be){try{var _0x217445={'command':_0x2a458b[0x0]};var _0xe2aac4=system[_0x1c80('0x0')](_0x217445,{'typecast':!![]});if(_0xe2aac4[_0x1c80('0x8')]){logger[_0x1c80('0x9')](_0x1c80('0xa'),_0x55ec5f,_[_0x1c80('0xb')](_0xe2aac4,'message')[_0x1c80('0xc')](',\x20'));logger[_0x1c80('0xd')]('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0x55ec5f);_0x1cc9be['next']();}else{var _0x2edcb1=this;var _0x4b8110=utils[_0x1c80('0xe')](_0x2a458b[0x0],this);logger[_0x1c80('0xd')](_0x1c80('0xf'),_0x55ec5f,_0x4b8110);sh[_0x1c80('0x10')](_[_0x1c80('0x11')](_0x4b8110),function(_0x5684ff,_0x352838){logger['info'](_0x1c80('0x12'),_0x55ec5f,_0x5684ff);if(_0x5684ff==0x0){var _0x2a852d=_0x352838[_0x1c80('0x13')](/(\r\n|\n|\r)/gm,'');if(_[_0x1c80('0x14')](_0x2a458b[0x1])||_['isEmpty'](_0x2a458b[0x1])){logger[_0x1c80('0xd')](_0x1c80('0x15'),_0x55ec5f);_0x2edcb1[_0x1c80('0x16')][_0x2a458b[0x1]]=_0x2a852d;}else{logger[_0x1c80('0xd')](_0x1c80('0x17'),_0x55ec5f,_0x2a458b[0x1],_0x2a852d);_0x2edcb1[_0x1c80('0x16')][_0x2a458b[0x1]]=_0x2a852d;}}_0x1cc9be[_0x1c80('0x18')]();});}}catch(_0xd0a6ae){logger[_0x1c80('0x9')](_0x1c80('0xa'),_0x55ec5f,_['isObject'](_0xd0a6ae)?JSON['stringify'](_0xd0a6ae):_0xd0a6ae);logger['info']('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0x55ec5f);_0x1cc9be[_0x1c80('0x18')]();}};}; \ No newline at end of file +var _0x7d64=['[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','getMustacheRender','info','[%s][SYSTEM]\x20commnad:\x20%s','exec','trim','[%s][SYSTEM]\x20no\x20variable','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','next','error','[%s][SYSTEM]\x20%s','isObject','stringify','validate','lodash','./utils','routing','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','map','join'];(function(_0x124e5a,_0x17805c){var _0x2276c3=function(_0x426398){while(--_0x426398){_0x124e5a['push'](_0x124e5a['shift']());}};_0x2276c3(++_0x17805c);}(_0x7d64,0x1c6));var _0x47d6=function(_0x1a55f4,_0x53dfc6){_0x1a55f4=_0x1a55f4-0x0;var _0x4d67f1=_0x7d64[_0x1a55f4];return _0x4d67f1;};'use strict';var schema=require(_0x47d6('0x0'));var sh=require('shelljs');var _=require(_0x47d6('0x1'));var utils=require(_0x47d6('0x2'));var logger=require('../../../../config/logger')(_0x47d6('0x3'));var system=schema({'command':{'type':'string','required':!![],'message':_0x47d6('0x4')}});exports[_0x47d6('0x5')]=function(_0x34e9b0,_0x5f55d9){return function(_0x3bbca6){try{var _0x1877b6={'command':_0x5f55d9[0x0]};var _0x5792b9=system['validate'](_0x1877b6,{'typecast':!![]});if(_0x5792b9['length']){logger['error']('[%s][SYSTEM]\x20%s',_0x34e9b0,_[_0x47d6('0x6')](_0x5792b9,'message')[_0x47d6('0x7')](',\x20'));logger['info'](_0x47d6('0x8'),_0x34e9b0);_0x3bbca6['next']();}else{var _0x116009=this;var _0x13fed8=utils[_0x47d6('0x9')](_0x5f55d9[0x0],this);logger[_0x47d6('0xa')](_0x47d6('0xb'),_0x34e9b0,_0x13fed8);sh[_0x47d6('0xc')](_[_0x47d6('0xd')](_0x13fed8),function(_0x471c8c,_0x3a0b51){logger[_0x47d6('0xa')]('[%s][SYSTEM]\x20result\x20code:\x20%s',_0x34e9b0,_0x471c8c);if(_0x471c8c==0x0){var _0x27f1df=_0x3a0b51['replace'](/(\r\n|\n|\r)/gm,'');if(_['isNil'](_0x5f55d9[0x1])||_['isEmpty'](_0x5f55d9[0x1])){logger[_0x47d6('0xa')](_0x47d6('0xe'),_0x34e9b0);_0x116009[_0x47d6('0xf')][_0x5f55d9[0x1]]=_0x27f1df;}else{logger[_0x47d6('0xa')](_0x47d6('0x10'),_0x34e9b0,_0x5f55d9[0x1],_0x27f1df);_0x116009['body'][_0x5f55d9[0x1]]=_0x27f1df;}}_0x3bbca6[_0x47d6('0x11')]();});}}catch(_0x2df33c){logger[_0x47d6('0x12')](_0x47d6('0x13'),_0x34e9b0,_[_0x47d6('0x14')](_0x2df33c)?JSON[_0x47d6('0x15')](_0x2df33c):_0x2df33c);logger[_0x47d6('0xa')](_0x47d6('0x8'),_0x34e9b0);_0x3bbca6[_0x47d6('0x11')]();}};}; \ 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 fdd8fce..0e17acc 100644 --- a/server/services/routing/server/applications/tag.js +++ b/server/services/routing/server/applications/tag.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['finally','error','validate','lodash','../../rpc/chatInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../../../config/logger','routing','number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','[%s][TAG]\x20%s','map','join','next','channel','Interaction','addTags','then','info','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','interaction','catch','stringify','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next'];(function(_0x2e669c,_0x3e4f49){var _0x4ba9e6=function(_0x1c0496){while(--_0x1c0496){_0x2e669c['push'](_0x2e669c['shift']());}};_0x4ba9e6(++_0x3e4f49);}(_0x7a54,0x106));var _0x47a5=function(_0x1ac99f,_0x460458){_0x1ac99f=_0x1ac99f-0x0;var _0x1f37ec=_0x7a54[_0x1ac99f];return _0x1f37ec;};'use strict';var schema=require(_0x47a5('0x0'));var _=require(_0x47a5('0x1'));var rpc={'chatInteraction':require(_0x47a5('0x2')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require(_0x47a5('0x3')),'mailInteraction':require(_0x47a5('0x4')),'faxInteraction':require('../../rpc/faxInteraction')};var logger=require(_0x47a5('0x5'))(_0x47a5('0x6'));var tag=schema({'tag':{'type':_0x47a5('0x7'),'required':!![],'message':_0x47a5('0x8')}});exports[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629,_0x59199c,_0x343372){return function(_0x30e405){try{var _0x506eda={'tag':_0x3d5629[0x0]};var _0x194fb0=tag['validate'](_0x506eda,{'typecast':!![]});if(_0x194fb0['length']){logger['error'](_0x47a5('0xa'),_0x545a97,_[_0x47a5('0xb')](_0x194fb0,'message')[_0x47a5('0xc')](',\x20'));logger['info']('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x545a97);_0x30e405[_0x47a5('0xd')]();}else{var _0x69e4d4={'ids':[_0x3d5629[0x0]]};if(rpc[_0x343372[_0x47a5('0xe')]+_0x47a5('0xf')]){rpc[_0x343372[_0x47a5('0xe')]+_0x47a5('0xf')][_0x47a5('0x10')](_0x343372['interaction']['id'],_0x69e4d4)[_0x47a5('0x11')](function(_0x221b54){logger[_0x47a5('0x12')](_0x47a5('0x13'),_0x545a97,_0x3d5629[0x1],_0x343372[_0x47a5('0xe')],_0x343372[_0x47a5('0x14')]['id']);})[_0x47a5('0x15')](function(_0x190faa){logger['error'](_0x47a5('0xa'),_0x545a97,JSON[_0x47a5('0x16')](_0x190faa));logger[_0x47a5('0x12')](_0x47a5('0x17'),_0x545a97);})[_0x47a5('0x18')](function(){_0x30e405['next']();});}}}catch(_0x549de3){logger[_0x47a5('0x19')]('[%s][TAG]\x20%s',_0x545a97,_['isObject'](_0x549de3)?JSON[_0x47a5('0x16')](_0x549de3):_0x549de3);logger[_0x47a5('0x12')](_0x47a5('0x17'),_0x545a97);_0x30e405[_0x47a5('0xd')]();}};}; \ No newline at end of file +var _0x9957=['join','info','next','Interaction','channel','addTags','interaction','then','catch','stringify','finally','isObject','validate','lodash','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../../../config/logger','routing','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','error','[%s][TAG]\x20%s','map','message'];(function(_0x1a574a,_0x5c1b4f){var _0x1d3ccb=function(_0x2d265a){while(--_0x2d265a){_0x1a574a['push'](_0x1a574a['shift']());}};_0x1d3ccb(++_0x5c1b4f);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'use strict';var schema=require(_0x7995('0x0'));var _=require(_0x7995('0x1'));var rpc={'chatInteraction':require(_0x7995('0x2')),'openchannelInteraction':require(_0x7995('0x3')),'smsInteraction':require('../../rpc/smsInteraction'),'mailInteraction':require(_0x7995('0x4')),'faxInteraction':require(_0x7995('0x5'))};var logger=require(_0x7995('0x6'))(_0x7995('0x7'));var tag=schema({'tag':{'type':'number','required':!![],'message':_0x7995('0x8')}});exports[_0x7995('0x9')]=function(_0x137b6b,_0x219534,_0xbda126,_0x326741){return function(_0x4996ca){try{var _0x465276={'tag':_0x219534[0x0]};var _0x1cad37=tag['validate'](_0x465276,{'typecast':!![]});if(_0x1cad37[_0x7995('0xa')]){logger[_0x7995('0xb')](_0x7995('0xc'),_0x137b6b,_[_0x7995('0xd')](_0x1cad37,_0x7995('0xe'))[_0x7995('0xf')](',\x20'));logger[_0x7995('0x10')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x137b6b);_0x4996ca[_0x7995('0x11')]();}else{var _0x41c652={'ids':[_0x219534[0x0]]};if(rpc[_0x326741['channel']+_0x7995('0x12')]){rpc[_0x326741[_0x7995('0x13')]+_0x7995('0x12')][_0x7995('0x14')](_0x326741[_0x7995('0x15')]['id'],_0x41c652)[_0x7995('0x16')](function(_0x2bbe7a){logger['info']('[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s',_0x137b6b,_0x219534[0x1],_0x326741[_0x7995('0x13')],_0x326741[_0x7995('0x15')]['id']);})[_0x7995('0x17')](function(_0x321ae8){logger[_0x7995('0xb')](_0x7995('0xc'),_0x137b6b,JSON[_0x7995('0x18')](_0x321ae8));logger[_0x7995('0x10')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x137b6b);})[_0x7995('0x19')](function(){_0x4996ca['next']();});}}}catch(_0x2f832e){logger[_0x7995('0xb')](_0x7995('0xc'),_0x137b6b,_[_0x7995('0x1a')](_0x2f832e)?JSON[_0x7995('0x18')](_0x2f832e):_0x2f832e);logger[_0x7995('0x10')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x137b6b);_0x4996ca['next']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/utils.js b/server/services/routing/server/applications/utils.js index bea6915..d46b6b6 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 _0x38df=['contact','message','account','list','mustache','lodash','exports','render'];(function(_0x17caca,_0x2bc731){var _0x1d9b18=function(_0x1c7190){while(--_0x1c7190){_0x17caca['push'](_0x17caca['shift']());}};_0x1d9b18(++_0x2bc731);}(_0x38df,0x144));var _0xf38d=function(_0x4036d4,_0x5994ab){_0x4036d4=_0x4036d4-0x0;var _0x3bc2a4=_0x38df[_0x4036d4];return _0x3bc2a4;};'use strict';var Mustache=require(_0xf38d('0x0'));var _=require(_0xf38d('0x1'));module[_0xf38d('0x2')]={'getMustacheRender':function(_0x40d0df,_0x1e3e59){return Mustache[_0xf38d('0x3')](_0x40d0df,_['merge'](_0x1e3e59['body'],{'contact':_0x1e3e59[_0xf38d('0x4')],'message':_0x1e3e59[_0xf38d('0x5')],'account':_0x1e3e59[_0xf38d('0x6')],'interaction':_0x1e3e59['interaction'],'list':_0x1e3e59[_0xf38d('0x7')]}))||'';}}; \ No newline at end of file +var _0xe77f=['interaction','list','mustache','lodash','merge','body','message','account'];(function(_0x1deb72,_0x3f6338){var _0x18bbdf=function(_0x1b4b9b){while(--_0x1b4b9b){_0x1deb72['push'](_0x1deb72['shift']());}};_0x18bbdf(++_0x3f6338);}(_0xe77f,0xba));var _0xfe77=function(_0x255211,_0x2fc18c){_0x255211=_0x255211-0x0;var _0x343a9c=_0xe77f[_0x255211];return _0x343a9c;};'use strict';var Mustache=require(_0xfe77('0x0'));var _=require(_0xfe77('0x1'));module['exports']={'getMustacheRender':function(_0x397a5c,_0x3aee7f){return Mustache['render'](_0x397a5c,_[_0xfe77('0x2')](_0x3aee7f[_0xfe77('0x3')],{'contact':_0x3aee7f['contact'],'message':_0x3aee7f[_0xfe77('0x4')],'account':_0x3aee7f[_0xfe77('0x5')],'interaction':_0x3aee7f[_0xfe77('0x6')],'list':_0x3aee7f[_0xfe77('0x7')]}))||'';}}; \ No newline at end of file diff --git a/server/services/routing/server/index.js b/server/services/routing/server/index.js index 63a0346..415301f 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 _0x2fe6=['tag','TagId','%s:%s:%s','./interval','condition','./applications/','consequence','priority','info','Push\x20new\x20rule','\x20|\x20','error','Please\x20create\x20a\x20new\x20file\x20under','.js','rules','execute','Applications\x20executed','end','No\x20applications\x20to\x20execute','stack','routing\x20is\x20empty','channel','QueueReport','update','UserId','error\x20update\x20queue\x20report','message\x20is\x20empty','agent','agents','busy','busyQueue','emit','hasOwnProperty','capacity','CurrentCapacity','updateRealtime','agent\x20not\x20found','chatQueues','loggedIn','name','paused','mailQueues','available','waiting','openchannelQueues','smsQueues','faxQueues','chatQueuesWaitingInteractions','values','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','server','stringify','127.0.0.1','log','lodash','util','path','bluebird','uuid','../../../config/logger','routing','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../lib/rule-engine','format','%s.%s.%s','isNil','IntervalId','map','Intervals','interval','listen','message','interaction','applications','isArray','length','existsSync','join','app','autoreply','appdata','split','push','slice','dialogflow','amazonlex'];(function(_0x5e1e25,_0xdc1421){var _0x548e5f=function(_0x576360){while(--_0x576360){_0x5e1e25['push'](_0x5e1e25['shift']());}};_0x548e5f(++_0xdc1421);}(_0x2fe6,0xf1));var _0x62fe=function(_0x59f987,_0x3cfa35){_0x59f987=_0x59f987-0x0;var _0x2a9cb6=_0x2fe6[_0x59f987];return _0x2a9cb6;};'use strict';var _=require(_0x62fe('0x0'));var util=require(_0x62fe('0x1'));var path=require(_0x62fe('0x2'));var fs=require('fs');var jayson=require('jayson/promise');var BPromise=require(_0x62fe('0x3'));var uuid=require(_0x62fe('0x4'));var config=require('../../../config/environment');var logger=require(_0x62fe('0x5'))(_0x62fe('0x6'));var rpc={'openchannelQueueReport':require(_0x62fe('0x7'))};var rpc={'openchannelQueueReport':require(_0x62fe('0x7')),'mailQueueReport':require(_0x62fe('0x8')),'chatQueueReport':require('../rpc/chatQueueReport'),'smsQueueReport':require(_0x62fe('0x9')),'faxQueueReport':require(_0x62fe('0xa'))};var RuleEngine=require(_0x62fe('0xb'));function getId(_0x2d243b,_0x31b2ae,_0x28245c){return util[_0x62fe('0xc')](_0x62fe('0xd'),_0x2d243b,_0x31b2ae||0x0,_0x28245c||0x0);}function getIntervals(_0x25aca2,_0x46ad09){var _0x466221=[];if(!_[_0x62fe('0xe')](_0x46ad09['IntervalId'])&&!_[_0x62fe('0xe')](_0x25aca2[_0x46ad09[_0x62fe('0xf')]])&&!_[_0x62fe('0xe')](_0x25aca2[_0x46ad09[_0x62fe('0xf')]]['Intervals'])){_0x466221=_[_0x62fe('0x10')](_0x25aca2[_0x46ad09[_0x62fe('0xf')]][_0x62fe('0x11')],'interval');}else if(!_[_0x62fe('0xe')](_0x46ad09['interval'])){_0x466221=[_0x46ad09[_0x62fe('0x12')]];}return _0x466221;}exports[_0x62fe('0x13')]=function(_0x580192){_0x580192['rules']={};return new BPromise(function(_0x4d7a5e,_0x5ec323){var _0x10938d={'Start':function(_0x62126a){var _0x3d6862=this;return new Promise(function(_0x4787d6,_0x4e77f1){if(_0x62126a){try{var _0x23f51b=[];var _0x4091f2=getId(_0x62126a['channel'],_0x62126a[_0x62fe('0x14')]?_0x62126a[_0x62fe('0x14')]['id']:0x0,_0x62126a['interaction']?_0x62126a[_0x62fe('0x15')]['id']:0x0);if(_0x62126a[_0x62fe('0x16')]&&_[_0x62fe('0x17')](_0x62126a[_0x62fe('0x16')])&&_0x62126a[_0x62fe('0x16')][_0x62fe('0x18')]){for(var _0x3a11fc=0x0;_0x3a11fc<_0x62126a[_0x62fe('0x16')]['length'];_0x3a11fc+=0x1){var _0x2fe8da=_0x62126a[_0x62fe('0x16')][_0x3a11fc];if(fs[_0x62fe('0x19')](path[_0x62fe('0x1a')](__dirname,_0x62fe('0x16'),_0x2fe8da[_0x62fe('0x1b')]+'.js'))){var _0x3309f2=[];switch(_0x2fe8da[_0x62fe('0x1b')]['toLowerCase']()){case _0x62fe('0x1c'):var _0x4d2b0e=_0x2fe8da[_0x62fe('0x1d')][_0x62fe('0x1e')](',');_0x3309f2['push'](_0x4d2b0e[0x0]);_0x3309f2[_0x62fe('0x1f')](_0x4d2b0e[_0x62fe('0x20')](0x1,_0x4d2b0e[_0x62fe('0x18')])[_0x62fe('0x1a')](','));break;case _0x62fe('0x21'):var _0x4d2b0e=_0x2fe8da[_0x62fe('0x1d')][_0x62fe('0x1e')](',');_0x3309f2[_0x62fe('0x1f')](_0x4d2b0e[0x0]);_0x3309f2[_0x62fe('0x1f')](_0x4d2b0e[0x1]);_0x3309f2['push'](_0x4d2b0e[_0x62fe('0x20')](0x2,_0x4d2b0e['length'])[_0x62fe('0x1a')](','));break;case _0x62fe('0x22'):var _0x4d2b0e=_0x2fe8da[_0x62fe('0x1d')][_0x62fe('0x1e')](',');_0x3309f2[_0x62fe('0x1f')](_0x4d2b0e[0x0]);_0x3309f2[_0x62fe('0x1f')](_0x4d2b0e[0x1]);_0x3309f2[_0x62fe('0x1f')](_0x4d2b0e[0x2]);_0x3309f2['push'](_0x4d2b0e[0x3]);_0x3309f2[_0x62fe('0x1f')](_0x4d2b0e[_0x62fe('0x20')](0x4,_0x4d2b0e[_0x62fe('0x18')])['join'](','));break;case _0x62fe('0x14'):_0x3309f2['push'](_0x2fe8da['appdata']);break;case _0x62fe('0x23'):_0x3309f2['push'](_0x2fe8da[_0x62fe('0x24')]);_0x3309f2[_0x62fe('0x1f')](_0x2fe8da[_0x62fe('0x1d')]);break;default:_0x3309f2=_[_0x62fe('0xe')](_0x2fe8da['appdata'])?[]:_0x2fe8da[_0x62fe('0x1d')][_0x62fe('0x1e')](',');}var _0x505119={'id':util['format'](_0x62fe('0x25'),_0x4091f2,_0x2fe8da['id'],_0x2fe8da[_0x62fe('0x1b')]),'condition':require(_0x62fe('0x26'))[_0x62fe('0x27')](_0x4091f2,getIntervals(_0x580192['intervals'],_0x2fe8da),_0x580192),'consequence':require(_0x62fe('0x28')+_0x2fe8da[_0x62fe('0x1b')])[_0x62fe('0x29')](_0x4091f2,_0x3309f2,_0x580192,_0x62126a),'p':_0x2fe8da[_0x62fe('0x2a')]||0x0};logger[_0x62fe('0x2b')](_0x62fe('0x2c'),_0x505119['id'],'on\x20interval',getIntervals(_0x580192['intervals'],_0x2fe8da)[_0x62fe('0x1a')](_0x62fe('0x2d')));_0x23f51b[_0x62fe('0x1f')](_0x505119);}else{logger[_0x62fe('0x2e')](_0x62fe('0x2f'),path[_0x62fe('0x1a')](__dirname,_0x62fe('0x16'),_0x2fe8da[_0x62fe('0x1b')]+_0x62fe('0x30')));}}_0x580192[_0x62fe('0x31')][_0x4091f2]=new RuleEngine(_0x23f51b);_0x580192['rules'][_0x4091f2][_0x62fe('0x32')](_0x62126a,function(_0x1c1560){logger[_0x62fe('0x2b')](_0x62fe('0x33'),JSON['stringify'](_0x1c1560['matchPath']));if(_0x580192['rules'][_0x4091f2]){_0x580192['rules'][_0x4091f2]['emit'](_0x62fe('0x34'));}});return _0x4787d6({'code':0xc8,'message':_0x62126a});}else{logger[_0x62fe('0x2b')](_0x62fe('0x35'));return _0x4787d6({'code':0xc8,'message':_0x62126a});}}catch(_0x58148a){logger[_0x62fe('0x2e')](_0x58148a[_0x62fe('0x36')]);return _0x4e77f1(_0x3d6862[_0x62fe('0x2e')](0x1f4,_0x58148a));}}return _0x4e77f1(_0x62fe('0x37'));});},'AcceptMessage':function(_0x3f83e3){var _0x402b3f=this;return new Promise(function(_0x45dec9,_0x287617){if(_0x3f83e3['message']&&_0x3f83e3[_0x62fe('0x14')]['id']){try{var _0x1e4507=getId(_0x3f83e3[_0x62fe('0x38')],_0x3f83e3[_0x62fe('0x14')]?_0x3f83e3['message']['id']:0x0,_0x3f83e3[_0x62fe('0x15')]?_0x3f83e3[_0x62fe('0x15')]['id']:0x0);if(_0x580192[_0x62fe('0x31')][_0x1e4507]){_0x580192['rules'][_0x1e4507]['emit']('end');if(rpc[_0x3f83e3[_0x62fe('0x38')]+_0x62fe('0x39')]){rpc[_0x3f83e3['channel']+'QueueReport'][_0x62fe('0x3a')](_0x1e4507,{'UserId':_0x3f83e3[_0x62fe('0x14')][_0x62fe('0x3b')]})['catch'](function(_0x48564f){logger[_0x62fe('0x2e')](_0x62fe('0x3c'));});}}return _0x45dec9({'code':0xc8,'message':_0x3f83e3});}catch(_0x4b91b7){logger[_0x62fe('0x2e')](_0x4b91b7[_0x62fe('0x36')]);return _0x287617(_0x402b3f[_0x62fe('0x2e')](0x1f4,_0x4b91b7));}}logger[_0x62fe('0x2e')](_0x62fe('0x3d'));return _0x287617(_0x402b3f[_0x62fe('0x2e')](0x1f4,'message\x20is\x20empty'));});},'RejectMessage':function(_0x4b42ef){var _0x5689b7=this;return new Promise(function(_0xc4d6b9,_0x38dd61){if(_0x4b42ef['agent']&&_0x4b42ef[_0x62fe('0x3e')]['id']){try{if(_0x580192[_0x62fe('0x3f')][_0x4b42ef['agent']['id']]){_0x580192[_0x62fe('0x3f')][_0x4b42ef[_0x62fe('0x3e')]['id']][_0x62fe('0x40')]=![];_0x580192[_0x62fe('0x3f')][_0x4b42ef[_0x62fe('0x3e')]['id']][_0x62fe('0x41')]=undefined;}return _0xc4d6b9({'code':0xc8,'message':_0x4b42ef});}catch(_0x48598d){logger[_0x62fe('0x2e')](_0x48598d[_0x62fe('0x36')]);return _0x38dd61(_0x5689b7[_0x62fe('0x2e')](0x1f4,_0x48598d));}}logger['error'](_0x62fe('0x3d'));return _0x38dd61(_0x5689b7[_0x62fe('0x2e')](0x1f4,_0x62fe('0x3d')));});},'AbandonInteraction':function(_0x4f24e9){var _0x1faddf=this;return new Promise(function(_0x1a8b8f,_0x55ad5c){if(_0x4f24e9[_0x62fe('0x38')]&&_0x4f24e9[_0x62fe('0x15')]&&_0x4f24e9[_0x62fe('0x15')]['id']){try{var _0xf26ada=getId(_0x4f24e9[_0x62fe('0x38')],_0x4f24e9[_0x62fe('0x14')]?_0x4f24e9[_0x62fe('0x14')]['id']:0x0,_0x4f24e9[_0x62fe('0x15')]?_0x4f24e9[_0x62fe('0x15')]['id']:0x0);if(_0x580192[_0x62fe('0x31')][_0xf26ada]){_0x580192['rules'][_0xf26ada][_0x62fe('0x42')]('end');}return _0x1a8b8f({'code':0xc8,'message':_0x4f24e9});}catch(_0x73e519){logger[_0x62fe('0x2e')](_0x73e519[_0x62fe('0x36')]);return _0x55ad5c(_0x1faddf[_0x62fe('0x2e')](0x1f4,_0x73e519));}}logger[_0x62fe('0x2e')](_0x62fe('0x3d'));return _0x55ad5c(_0x1faddf[_0x62fe('0x2e')](0x1f4,_0x62fe('0x3d')));});},'AgentCapacity':function(_0x2e9465){var _0x4b97bd=this;return new Promise(function(_0x7608e2,_0x36671d){if(_0x580192[_0x62fe('0x3f')][_0x62fe('0x43')](_0x2e9465['id'])){for(var _0x53caf4 in _0x2e9465[_0x62fe('0x44')]){if(_0x2e9465[_0x62fe('0x44')][_0x62fe('0x43')](_0x53caf4)){if(_0x580192[_0x62fe('0x3f')][_0x2e9465['id']][_0x62fe('0x43')](_0x53caf4+_0x62fe('0x45'))){_0x580192[_0x62fe('0x3f')][_0x2e9465['id']][_0x53caf4+'CurrentCapacity']=parseInt(_0x2e9465[_0x62fe('0x44')][_0x53caf4],0xa);}}}_0x580192[_0x62fe('0x3f')][_0x2e9465['id']][_0x62fe('0x46')]();return _0x7608e2({'code':0xc8,'message':_0x580192['agents'][_0x2e9465['id']]});}else{return _0x36671d(_0x4b97bd[_0x62fe('0x2e')](0x1f4,_0x62fe('0x47')));}});},'Agents':function(_0x372345){return new Promise(function(_0x4ac4b7,_0xfe4772){var _0x51805b=_['values'](_0x580192[_0x62fe('0x3f')]);_0x4ac4b7({'count':_0x51805b[_0x62fe('0x18')],'rows':_0x51805b});});},'ChatQueues':function(_0x58ab3b){return new Promise(function(_0x17919f,_0x4baee4){var _0x47bca6=[];for(var _0x2393c7 in _0x580192[_0x62fe('0x48')]){if(_0x580192['chatQueues'][_0x62fe('0x43')](_0x2393c7)){var _0x51b83e=_0x580192[_0x62fe('0x48')][_0x2393c7];var _0x5de0ba={'id':_0x51b83e['id'],'available':_0x51b83e['available'],'loggedIn':_0x51b83e[_0x62fe('0x49')],'name':_0x51b83e[_0x62fe('0x4a')],'paused':_0x51b83e[_0x62fe('0x4b')],'waiting':_0x51b83e['waiting']};_0x47bca6[_0x62fe('0x1f')](_0x5de0ba);}}_0x17919f({'count':_0x47bca6[_0x62fe('0x18')],'rows':_0x47bca6});});},'MailQueues':function(_0x4ea17a){return new Promise(function(_0x8466ba,_0xaecc1f){var _0x4a247f=[];for(var _0x19ab21 in _0x580192[_0x62fe('0x4c')]){if(_0x580192[_0x62fe('0x4c')][_0x62fe('0x43')](_0x19ab21)){var _0x41c924=_0x580192[_0x62fe('0x4c')][_0x19ab21];var _0x3c7dbb={'id':_0x41c924['id'],'available':_0x41c924[_0x62fe('0x4d')],'loggedIn':_0x41c924[_0x62fe('0x49')],'name':_0x41c924[_0x62fe('0x4a')],'paused':_0x41c924[_0x62fe('0x4b')],'waiting':_0x41c924[_0x62fe('0x4e')]};_0x4a247f[_0x62fe('0x1f')](_0x3c7dbb);}}_0x8466ba({'count':_0x4a247f['length'],'rows':_0x4a247f});});},'OpenchannelQueues':function(_0x1c8846){return new Promise(function(_0x1cccca,_0x490e3c){var _0x14950e=[];for(var _0x58616c in _0x580192['openchannelQueues']){if(_0x580192['openchannelQueues']['hasOwnProperty'](_0x58616c)){var _0x35cc81=_0x580192[_0x62fe('0x4f')][_0x58616c];var _0x13d98c={'id':_0x35cc81['id'],'available':_0x35cc81['available'],'loggedIn':_0x35cc81['loggedIn'],'name':_0x35cc81[_0x62fe('0x4a')],'paused':_0x35cc81[_0x62fe('0x4b')],'waiting':_0x35cc81['waiting']};_0x14950e['push'](_0x13d98c);}}_0x1cccca({'count':_0x14950e['length'],'rows':_0x14950e});});},'SmsQueues':function(_0x82faa2){return new Promise(function(_0x3c6bd7,_0xefc67c){var _0x37d480=[];for(var _0xaa9b78 in _0x580192['smsQueues']){if(_0x580192[_0x62fe('0x50')][_0x62fe('0x43')](_0xaa9b78)){var _0x48ed5a=_0x580192[_0x62fe('0x50')][_0xaa9b78];var _0xd57828={'id':_0x48ed5a['id'],'available':_0x48ed5a[_0x62fe('0x4d')],'loggedIn':_0x48ed5a[_0x62fe('0x49')],'name':_0x48ed5a[_0x62fe('0x4a')],'paused':_0x48ed5a[_0x62fe('0x4b')],'waiting':_0x48ed5a[_0x62fe('0x4e')]};_0x37d480[_0x62fe('0x1f')](_0xd57828);}}_0x3c6bd7({'count':_0x37d480[_0x62fe('0x18')],'rows':_0x37d480});});},'FaxQueues':function(_0x359860){return new Promise(function(_0x4500be,_0x51c974){var _0x244d94=[];for(var _0x58a173 in _0x580192[_0x62fe('0x51')]){if(_0x580192[_0x62fe('0x51')][_0x62fe('0x43')](_0x58a173)){var _0xe1a5d4=_0x580192[_0x62fe('0x51')][_0x58a173];var _0x18557b={'id':_0xe1a5d4['id'],'available':_0xe1a5d4[_0x62fe('0x4d')],'loggedIn':_0xe1a5d4[_0x62fe('0x49')],'name':_0xe1a5d4[_0x62fe('0x4a')],'paused':_0xe1a5d4[_0x62fe('0x4b')],'waiting':_0xe1a5d4[_0x62fe('0x4e')]};_0x244d94[_0x62fe('0x1f')](_0x18557b);}}_0x4500be({'count':_0x244d94[_0x62fe('0x18')],'rows':_0x244d94});});},'ChatQueuesWaitingInteractions':function(_0x307374){return new Promise(function(_0x441b00,_0xb1445d){var _0x591e1e=_['values'](_0x580192[_0x62fe('0x52')]);_0x441b00({'count':_0x591e1e[_0x62fe('0x18')],'rows':_0x591e1e});});},'MailQueuesWaitingInteractions':function(_0x4fcae8){return new Promise(function(_0x4cbc52,_0x4c7182){var _0x427df0=_[_0x62fe('0x53')](_0x580192[_0x62fe('0x54')]);_0x4cbc52({'count':_0x427df0['length'],'rows':_0x427df0});});},'OpenchannelQueuesWaitingInteractions':function(_0x1979b5){return new Promise(function(_0x199d0b,_0x50bd48){var _0x492776=_[_0x62fe('0x53')](_0x580192[_0x62fe('0x55')]);_0x199d0b({'count':_0x492776['length'],'rows':_0x492776});});},'SmsQueuesWaitingInteractions':function(_0xbf2f2e){return new Promise(function(_0x32bbad,_0x483fe1){var _0x2fe100=_['values'](_0x580192[_0x62fe('0x56')]);_0x32bbad({'count':_0x2fe100[_0x62fe('0x18')],'rows':_0x2fe100});});},'FaxQueuesWaitingInteractions':function(_0x49fce9){return new Promise(function(_0x140989,_0x2344bf){var _0x42fe92=_[_0x62fe('0x53')](_0x580192[_0x62fe('0x57')]);_0x140989({'count':_0x42fe92[_0x62fe('0x18')],'rows':_0x42fe92});});}};var _0x530c02=jayson[_0x62fe('0x58')](_0x10938d)['http']();_0x530c02['on']('error',function(_0x594198){logger[_0x62fe('0x2e')](JSON[_0x62fe('0x59')](_0x594198));return _0x5ec323(_0x594198);});_0x530c02[_0x62fe('0x13')](0x232c,_0x62fe('0x5a'),function(){console[_0x62fe('0x5b')]('Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232c);return _0x4d7a5e('RPC\x20listening\x20on\x20port:'+0x232c);});});}; \ No newline at end of file +var _0x9d27=['applications','isArray','length','existsSync','join','app','.js','toLowerCase','push','slice','appdata','split','tag','TagId','%s:%s:%s','./interval','condition','intervals','./applications/','Push\x20new\x20rule','on\x20interval','execute','stringify','matchPath','emit','end','info','No\x20applications\x20to\x20execute','error','stack','routing\x20is\x20empty','QueueReport','update','UserId','message\x20is\x20empty','agent','agents','busy','busyQueue','hasOwnProperty','capacity','CurrentCapacity','updateRealtime','agent\x20not\x20found','values','chatQueues','available','loggedIn','name','paused','waiting','mailQueues','openchannelQueues','smsQueues','faxQueues','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','server','http','listen','127.0.0.1','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','path','jayson/promise','bluebird','../../../config/environment','../../../config/logger','routing','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','format','%s.%s.%s','isNil','IntervalId','Intervals','map','interval','rules','channel','message','interaction'];(function(_0x9c6e38,_0x1fc24e){var _0x148e08=function(_0x415b66){while(--_0x415b66){_0x9c6e38['push'](_0x9c6e38['shift']());}};_0x148e08(++_0x1fc24e);}(_0x9d27,0x142));var _0x79d2=function(_0xb63c5b,_0x2d4a23){_0xb63c5b=_0xb63c5b-0x0;var _0x15479f=_0x9d27[_0xb63c5b];return _0x15479f;};'use strict';var _=require(_0x79d2('0x0'));var util=require(_0x79d2('0x1'));var path=require(_0x79d2('0x2'));var fs=require('fs');var jayson=require(_0x79d2('0x3'));var BPromise=require(_0x79d2('0x4'));var uuid=require('uuid');var config=require(_0x79d2('0x5'));var logger=require(_0x79d2('0x6'))(_0x79d2('0x7'));var rpc={'openchannelQueueReport':require('../rpc/openchannelQueueReport')};var rpc={'openchannelQueueReport':require('../rpc/openchannelQueueReport'),'mailQueueReport':require('../rpc/mailQueueReport'),'chatQueueReport':require(_0x79d2('0x8')),'smsQueueReport':require(_0x79d2('0x9')),'faxQueueReport':require(_0x79d2('0xa'))};var RuleEngine=require('../lib/rule-engine');function getId(_0x33e286,_0x54caef,_0x3f8c5c){return util[_0x79d2('0xb')](_0x79d2('0xc'),_0x33e286,_0x54caef||0x0,_0x3f8c5c||0x0);}function getIntervals(_0x258087,_0x3d9e89){var _0x5c2a20=[];if(!_['isNil'](_0x3d9e89['IntervalId'])&&!_[_0x79d2('0xd')](_0x258087[_0x3d9e89['IntervalId']])&&!_[_0x79d2('0xd')](_0x258087[_0x3d9e89[_0x79d2('0xe')]][_0x79d2('0xf')])){_0x5c2a20=_[_0x79d2('0x10')](_0x258087[_0x3d9e89[_0x79d2('0xe')]][_0x79d2('0xf')],'interval');}else if(!_['isNil'](_0x3d9e89[_0x79d2('0x11')])){_0x5c2a20=[_0x3d9e89[_0x79d2('0x11')]];}return _0x5c2a20;}exports['listen']=function(_0x44e20b){_0x44e20b[_0x79d2('0x12')]={};return new BPromise(function(_0x3203b9,_0x552653){var _0x43de15={'Start':function(_0x20a963){var _0x7cce64=this;return new Promise(function(_0x3d34e4,_0x5168b6){if(_0x20a963){try{var _0x19082b=[];var _0x5bbb7b=getId(_0x20a963[_0x79d2('0x13')],_0x20a963['message']?_0x20a963[_0x79d2('0x14')]['id']:0x0,_0x20a963[_0x79d2('0x15')]?_0x20a963[_0x79d2('0x15')]['id']:0x0);if(_0x20a963[_0x79d2('0x16')]&&_[_0x79d2('0x17')](_0x20a963['applications'])&&_0x20a963[_0x79d2('0x16')][_0x79d2('0x18')]){for(var _0x1278de=0x0;_0x1278de<_0x20a963['applications'][_0x79d2('0x18')];_0x1278de+=0x1){var _0x3d3e52=_0x20a963['applications'][_0x1278de];if(fs[_0x79d2('0x19')](path[_0x79d2('0x1a')](__dirname,'applications',_0x3d3e52[_0x79d2('0x1b')]+_0x79d2('0x1c')))){var _0x3d6c87=[];switch(_0x3d3e52[_0x79d2('0x1b')][_0x79d2('0x1d')]()){case'autoreply':var _0x2a12ac=_0x3d3e52['appdata']['split'](',');_0x3d6c87[_0x79d2('0x1e')](_0x2a12ac[0x0]);_0x3d6c87[_0x79d2('0x1e')](_0x2a12ac[_0x79d2('0x1f')](0x1,_0x2a12ac[_0x79d2('0x18')])[_0x79d2('0x1a')](','));break;case'dialogflow':var _0x2a12ac=_0x3d3e52[_0x79d2('0x20')][_0x79d2('0x21')](',');_0x3d6c87[_0x79d2('0x1e')](_0x2a12ac[0x0]);_0x3d6c87[_0x79d2('0x1e')](_0x2a12ac[0x1]);_0x3d6c87['push'](_0x2a12ac[_0x79d2('0x1f')](0x2,_0x2a12ac[_0x79d2('0x18')])['join'](','));break;case'amazonlex':var _0x2a12ac=_0x3d3e52[_0x79d2('0x20')][_0x79d2('0x21')](',');_0x3d6c87['push'](_0x2a12ac[0x0]);_0x3d6c87[_0x79d2('0x1e')](_0x2a12ac[0x1]);_0x3d6c87[_0x79d2('0x1e')](_0x2a12ac[0x2]);_0x3d6c87[_0x79d2('0x1e')](_0x2a12ac[0x3]);_0x3d6c87[_0x79d2('0x1e')](_0x2a12ac[_0x79d2('0x1f')](0x4,_0x2a12ac[_0x79d2('0x18')])[_0x79d2('0x1a')](','));break;case _0x79d2('0x14'):_0x3d6c87['push'](_0x3d3e52['appdata']);break;case _0x79d2('0x22'):_0x3d6c87[_0x79d2('0x1e')](_0x3d3e52[_0x79d2('0x23')]);_0x3d6c87['push'](_0x3d3e52[_0x79d2('0x20')]);break;default:_0x3d6c87=_[_0x79d2('0xd')](_0x3d3e52[_0x79d2('0x20')])?[]:_0x3d3e52['appdata'][_0x79d2('0x21')](',');}var _0x13469d={'id':util[_0x79d2('0xb')](_0x79d2('0x24'),_0x5bbb7b,_0x3d3e52['id'],_0x3d3e52['app']),'condition':require(_0x79d2('0x25'))[_0x79d2('0x26')](_0x5bbb7b,getIntervals(_0x44e20b[_0x79d2('0x27')],_0x3d3e52),_0x44e20b),'consequence':require(_0x79d2('0x28')+_0x3d3e52[_0x79d2('0x1b')])['consequence'](_0x5bbb7b,_0x3d6c87,_0x44e20b,_0x20a963),'p':_0x3d3e52['priority']||0x0};logger['info'](_0x79d2('0x29'),_0x13469d['id'],_0x79d2('0x2a'),getIntervals(_0x44e20b[_0x79d2('0x27')],_0x3d3e52)[_0x79d2('0x1a')]('\x20|\x20'));_0x19082b[_0x79d2('0x1e')](_0x13469d);}else{logger['error']('Please\x20create\x20a\x20new\x20file\x20under',path[_0x79d2('0x1a')](__dirname,'applications',_0x3d3e52[_0x79d2('0x1b')]+_0x79d2('0x1c')));}}_0x44e20b['rules'][_0x5bbb7b]=new RuleEngine(_0x19082b);_0x44e20b[_0x79d2('0x12')][_0x5bbb7b][_0x79d2('0x2b')](_0x20a963,function(_0x18baad){logger['info']('Applications\x20executed',JSON[_0x79d2('0x2c')](_0x18baad[_0x79d2('0x2d')]));if(_0x44e20b[_0x79d2('0x12')][_0x5bbb7b]){_0x44e20b[_0x79d2('0x12')][_0x5bbb7b][_0x79d2('0x2e')](_0x79d2('0x2f'));}});return _0x3d34e4({'code':0xc8,'message':_0x20a963});}else{logger[_0x79d2('0x30')](_0x79d2('0x31'));return _0x3d34e4({'code':0xc8,'message':_0x20a963});}}catch(_0x46e829){logger[_0x79d2('0x32')](_0x46e829[_0x79d2('0x33')]);return _0x5168b6(_0x7cce64[_0x79d2('0x32')](0x1f4,_0x46e829));}}return _0x5168b6(_0x79d2('0x34'));});},'AcceptMessage':function(_0x3e6da7){var _0x36a466=this;return new Promise(function(_0x46e421,_0x27ebc6){if(_0x3e6da7[_0x79d2('0x14')]&&_0x3e6da7[_0x79d2('0x14')]['id']){try{var _0x341b6d=getId(_0x3e6da7[_0x79d2('0x13')],_0x3e6da7[_0x79d2('0x14')]?_0x3e6da7[_0x79d2('0x14')]['id']:0x0,_0x3e6da7[_0x79d2('0x15')]?_0x3e6da7[_0x79d2('0x15')]['id']:0x0);if(_0x44e20b[_0x79d2('0x12')][_0x341b6d]){_0x44e20b[_0x79d2('0x12')][_0x341b6d][_0x79d2('0x2e')](_0x79d2('0x2f'));if(rpc[_0x3e6da7[_0x79d2('0x13')]+'QueueReport']){rpc[_0x3e6da7[_0x79d2('0x13')]+_0x79d2('0x35')][_0x79d2('0x36')](_0x341b6d,{'UserId':_0x3e6da7[_0x79d2('0x14')][_0x79d2('0x37')]})['catch'](function(_0x475b5e){logger[_0x79d2('0x32')]('error\x20update\x20queue\x20report');});}}return _0x46e421({'code':0xc8,'message':_0x3e6da7});}catch(_0x3f8f7f){logger[_0x79d2('0x32')](_0x3f8f7f['stack']);return _0x27ebc6(_0x36a466[_0x79d2('0x32')](0x1f4,_0x3f8f7f));}}logger['error'](_0x79d2('0x38'));return _0x27ebc6(_0x36a466[_0x79d2('0x32')](0x1f4,'message\x20is\x20empty'));});},'RejectMessage':function(_0x91b9d4){var _0x34bc67=this;return new Promise(function(_0x38a0bd,_0xa5269a){if(_0x91b9d4[_0x79d2('0x39')]&&_0x91b9d4[_0x79d2('0x39')]['id']){try{if(_0x44e20b[_0x79d2('0x3a')][_0x91b9d4['agent']['id']]){_0x44e20b[_0x79d2('0x3a')][_0x91b9d4['agent']['id']][_0x79d2('0x3b')]=![];_0x44e20b['agents'][_0x91b9d4[_0x79d2('0x39')]['id']][_0x79d2('0x3c')]=undefined;}return _0x38a0bd({'code':0xc8,'message':_0x91b9d4});}catch(_0x4f3ca9){logger[_0x79d2('0x32')](_0x4f3ca9[_0x79d2('0x33')]);return _0xa5269a(_0x34bc67[_0x79d2('0x32')](0x1f4,_0x4f3ca9));}}logger[_0x79d2('0x32')](_0x79d2('0x38'));return _0xa5269a(_0x34bc67[_0x79d2('0x32')](0x1f4,'message\x20is\x20empty'));});},'AbandonInteraction':function(_0x15ec88){var _0x4f89be=this;return new Promise(function(_0x45a585,_0x337f49){if(_0x15ec88['channel']&&_0x15ec88[_0x79d2('0x15')]&&_0x15ec88[_0x79d2('0x15')]['id']){try{var _0x1256df=getId(_0x15ec88[_0x79d2('0x13')],_0x15ec88[_0x79d2('0x14')]?_0x15ec88['message']['id']:0x0,_0x15ec88['interaction']?_0x15ec88[_0x79d2('0x15')]['id']:0x0);if(_0x44e20b['rules'][_0x1256df]){_0x44e20b[_0x79d2('0x12')][_0x1256df][_0x79d2('0x2e')](_0x79d2('0x2f'));}return _0x45a585({'code':0xc8,'message':_0x15ec88});}catch(_0x95835){logger[_0x79d2('0x32')](_0x95835[_0x79d2('0x33')]);return _0x337f49(_0x4f89be[_0x79d2('0x32')](0x1f4,_0x95835));}}logger[_0x79d2('0x32')]('message\x20is\x20empty');return _0x337f49(_0x4f89be[_0x79d2('0x32')](0x1f4,_0x79d2('0x38')));});},'AgentCapacity':function(_0x208bc6){var _0x3100c1=this;return new Promise(function(_0x554c62,_0x40389d){if(_0x44e20b[_0x79d2('0x3a')][_0x79d2('0x3d')](_0x208bc6['id'])){for(var _0x34c2d1 in _0x208bc6[_0x79d2('0x3e')]){if(_0x208bc6['capacity'][_0x79d2('0x3d')](_0x34c2d1)){if(_0x44e20b['agents'][_0x208bc6['id']][_0x79d2('0x3d')](_0x34c2d1+'CurrentCapacity')){_0x44e20b['agents'][_0x208bc6['id']][_0x34c2d1+_0x79d2('0x3f')]=parseInt(_0x208bc6[_0x79d2('0x3e')][_0x34c2d1],0xa);}}}_0x44e20b[_0x79d2('0x3a')][_0x208bc6['id']][_0x79d2('0x40')]();return _0x554c62({'code':0xc8,'message':_0x44e20b[_0x79d2('0x3a')][_0x208bc6['id']]});}else{return _0x40389d(_0x3100c1['error'](0x1f4,_0x79d2('0x41')));}});},'Agents':function(_0x5da567){return new Promise(function(_0x43f635,_0x12c7d8){var _0x56657d=_[_0x79d2('0x42')](_0x44e20b[_0x79d2('0x3a')]);_0x43f635({'count':_0x56657d[_0x79d2('0x18')],'rows':_0x56657d});});},'ChatQueues':function(_0xc18579){return new Promise(function(_0xfe5d6,_0xfd77cc){var _0x5b4273=[];for(var _0x3a33f6 in _0x44e20b[_0x79d2('0x43')]){if(_0x44e20b[_0x79d2('0x43')][_0x79d2('0x3d')](_0x3a33f6)){var _0x1c431f=_0x44e20b[_0x79d2('0x43')][_0x3a33f6];var _0x478ecb={'id':_0x1c431f['id'],'available':_0x1c431f[_0x79d2('0x44')],'loggedIn':_0x1c431f[_0x79d2('0x45')],'name':_0x1c431f[_0x79d2('0x46')],'paused':_0x1c431f[_0x79d2('0x47')],'waiting':_0x1c431f[_0x79d2('0x48')]};_0x5b4273[_0x79d2('0x1e')](_0x478ecb);}}_0xfe5d6({'count':_0x5b4273[_0x79d2('0x18')],'rows':_0x5b4273});});},'MailQueues':function(_0x155098){return new Promise(function(_0x333134,_0x4dfa1f){var _0x3e203a=[];for(var _0x27e0b8 in _0x44e20b[_0x79d2('0x49')]){if(_0x44e20b[_0x79d2('0x49')][_0x79d2('0x3d')](_0x27e0b8)){var _0x241973=_0x44e20b['mailQueues'][_0x27e0b8];var _0x5c9b8={'id':_0x241973['id'],'available':_0x241973[_0x79d2('0x44')],'loggedIn':_0x241973[_0x79d2('0x45')],'name':_0x241973[_0x79d2('0x46')],'paused':_0x241973[_0x79d2('0x47')],'waiting':_0x241973[_0x79d2('0x48')]};_0x3e203a[_0x79d2('0x1e')](_0x5c9b8);}}_0x333134({'count':_0x3e203a['length'],'rows':_0x3e203a});});},'OpenchannelQueues':function(_0x16c9a0){return new Promise(function(_0x98e6ba,_0x41c87e){var _0x40bdc5=[];for(var _0x4ebbb1 in _0x44e20b[_0x79d2('0x4a')]){if(_0x44e20b[_0x79d2('0x4a')][_0x79d2('0x3d')](_0x4ebbb1)){var _0x280809=_0x44e20b['openchannelQueues'][_0x4ebbb1];var _0x44be52={'id':_0x280809['id'],'available':_0x280809['available'],'loggedIn':_0x280809[_0x79d2('0x45')],'name':_0x280809['name'],'paused':_0x280809[_0x79d2('0x47')],'waiting':_0x280809['waiting']};_0x40bdc5[_0x79d2('0x1e')](_0x44be52);}}_0x98e6ba({'count':_0x40bdc5[_0x79d2('0x18')],'rows':_0x40bdc5});});},'SmsQueues':function(_0x2d7bea){return new Promise(function(_0x56681e,_0x187680){var _0x13fb9f=[];for(var _0x174807 in _0x44e20b[_0x79d2('0x4b')]){if(_0x44e20b[_0x79d2('0x4b')][_0x79d2('0x3d')](_0x174807)){var _0x23efb9=_0x44e20b[_0x79d2('0x4b')][_0x174807];var _0x551d90={'id':_0x23efb9['id'],'available':_0x23efb9['available'],'loggedIn':_0x23efb9[_0x79d2('0x45')],'name':_0x23efb9['name'],'paused':_0x23efb9[_0x79d2('0x47')],'waiting':_0x23efb9['waiting']};_0x13fb9f['push'](_0x551d90);}}_0x56681e({'count':_0x13fb9f['length'],'rows':_0x13fb9f});});},'FaxQueues':function(_0x4db056){return new Promise(function(_0x39738b,_0x313962){var _0x146ea7=[];for(var _0x1b69ec in _0x44e20b[_0x79d2('0x4c')]){if(_0x44e20b['faxQueues']['hasOwnProperty'](_0x1b69ec)){var _0x167196=_0x44e20b['faxQueues'][_0x1b69ec];var _0x4ff0e0={'id':_0x167196['id'],'available':_0x167196[_0x79d2('0x44')],'loggedIn':_0x167196[_0x79d2('0x45')],'name':_0x167196[_0x79d2('0x46')],'paused':_0x167196[_0x79d2('0x47')],'waiting':_0x167196[_0x79d2('0x48')]};_0x146ea7[_0x79d2('0x1e')](_0x4ff0e0);}}_0x39738b({'count':_0x146ea7['length'],'rows':_0x146ea7});});},'ChatQueuesWaitingInteractions':function(_0x47259f){return new Promise(function(_0x30d36b,_0x2b046b){var _0x390005=_[_0x79d2('0x42')](_0x44e20b['chatQueuesWaitingInteractions']);_0x30d36b({'count':_0x390005[_0x79d2('0x18')],'rows':_0x390005});});},'MailQueuesWaitingInteractions':function(_0x37b68e){return new Promise(function(_0x453dbb,_0x1d7970){var _0x28f8b1=_[_0x79d2('0x42')](_0x44e20b[_0x79d2('0x4d')]);_0x453dbb({'count':_0x28f8b1[_0x79d2('0x18')],'rows':_0x28f8b1});});},'OpenchannelQueuesWaitingInteractions':function(_0x4d41a7){return new Promise(function(_0x4d40ad,_0x1b2d9e){var _0x1af35c=_[_0x79d2('0x42')](_0x44e20b[_0x79d2('0x4e')]);_0x4d40ad({'count':_0x1af35c[_0x79d2('0x18')],'rows':_0x1af35c});});},'SmsQueuesWaitingInteractions':function(_0xc02053){return new Promise(function(_0x59c5ef,_0x4d1d48){var _0x2b94ba=_['values'](_0x44e20b['smsQueuesWaitingInteractions']);_0x59c5ef({'count':_0x2b94ba[_0x79d2('0x18')],'rows':_0x2b94ba});});},'FaxQueuesWaitingInteractions':function(_0x39a5e9){return new Promise(function(_0x2c6305,_0x246997){var _0x44ffb4=_[_0x79d2('0x42')](_0x44e20b['faxQueuesWaitingInteractions']);_0x2c6305({'count':_0x44ffb4[_0x79d2('0x18')],'rows':_0x44ffb4});});}};var _0x2c3849=jayson[_0x79d2('0x4f')](_0x43de15)[_0x79d2('0x50')]();_0x2c3849['on'](_0x79d2('0x32'),function(_0x4387e3){logger[_0x79d2('0x32')](JSON[_0x79d2('0x2c')](_0x4387e3));return _0x552653(_0x4387e3);});_0x2c3849[_0x79d2('0x51')](0x232c,_0x79d2('0x52'),function(){console[_0x79d2('0x53')](_0x79d2('0x54'),0x232c);return _0x3203b9(_0x79d2('0x55')+0x232c);});});}; \ No newline at end of file diff --git a/server/services/routing/server/interval.js b/server/services/routing/server/interval.js index 784dbe7..121fbb9 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 _0x02ed=['client','http','request','then','error','message','result','condition','rules','[%s][INTERVAL]\x20ROUTING\x20STOPPED','push','Command','format','iftime\x20%s','indexOf','catch','[%s][INTERVAL]\x20%s','all','info','[%s][INTERVAL]\x20%s\x20%s','join','\x20|\x20','when','log','stack','stop','util','bluebird','jayson/promise','lodash','../../../config/logger','routing'];(function(_0x387767,_0x1e3706){var _0x1353a5=function(_0xb541cd){while(--_0xb541cd){_0x387767['push'](_0x387767['shift']());}};_0x1353a5(++_0x1e3706);}(_0x02ed,0x13a));var _0xd02e=function(_0x2f81bb,_0x50842e){_0x2f81bb=_0x2f81bb-0x0;var _0x4b6da8=_0x02ed[_0x2f81bb];return _0x4b6da8;};'use strict';var util=require(_0xd02e('0x0'));var BPromise=require(_0xd02e('0x1'));var jayson=require(_0xd02e('0x2'));var _=require(_0xd02e('0x3'));var logger=require(_0xd02e('0x4'))(_0xd02e('0x5'));var client=jayson[_0xd02e('0x6')][_0xd02e('0x7')]({'port':0x232a});function request(_0x5a69c8,_0x557c59){return new BPromise(function(_0xa63365,_0x54ff1c){return client[_0xd02e('0x8')](_0x5a69c8,_0x557c59)[_0xd02e('0x9')](function(_0x17086f){if(_0x17086f[_0xd02e('0xa')]){return _0x54ff1c(_0x17086f['error'][_0xd02e('0xb')]);}else{return _0xa63365(_0x17086f[_0xd02e('0xc')]);}})['catch'](function(_0x1d39bb){return _0x54ff1c(_0x1d39bb);});});}exports[_0xd02e('0xd')]=function(_0xd08d28,_0x2bca92,_0x364852){return function(_0x1ebce0){if(_0x364852['rules']&&!_0x364852[_0xd02e('0xe')][_0xd08d28]){logger['info'](_0xd02e('0xf'),_0xd08d28);return _0x1ebce0['stop']();}var _0x2d3fae=[];for(var _0x5aa774=0x0;_0x5aa774<_0x2bca92['length'];_0x5aa774+=0x1){_0x2d3fae[_0xd02e('0x10')](request(_0xd02e('0x11'),{'command':util[_0xd02e('0x12')](_0xd02e('0x13'),_0x2bca92[_0x5aa774])})['then'](function(_0x52ec25){return _0x52ec25&&_0x52ec25[_0xd02e('0xb')]&&_0x52ec25[_0xd02e('0xb')][_0xd02e('0x14')]('true')>=0x0?!![]:![];})[_0xd02e('0x15')](function(_0x45be43){logger['error'](_0xd02e('0x16'),_0xd08d28,_0x2bca92[_0x5aa774]);}));}BPromise[_0xd02e('0x17')](_0x2d3fae)[_0xd02e('0x9')](function(_0x292524){var _0x3b7834=_['some'](_0x292524);logger[_0xd02e('0x18')](_0xd02e('0x19'),_0xd08d28,_0x2bca92[_0xd02e('0x1a')](_0xd02e('0x1b')),_0x3b7834);_0x1ebce0[_0xd02e('0x1c')](_0x3b7834);})[_0xd02e('0x15')](function(_0xf1e777){console[_0xd02e('0x1d')](_0xf1e777);logger[_0xd02e('0xa')](_0xd02e('0x19'),_0xd08d28,_0x2bca92[_0xd02e('0x1a')](_0xd02e('0x1b')),_0xf1e777[_0xd02e('0x1e')]);_0x1ebce0[_0xd02e('0x1f')]();});};}; \ No newline at end of file +var _0x12c9=['routing','client','http','request','then','error','result','catch','condition','rules','info','stop','length','push','format','iftime\x20%s','message','indexOf','true','all','some','[%s][INTERVAL]\x20%s\x20%s','join','\x20|\x20','when','log','stack','util','bluebird','jayson/promise','lodash'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x12c9,0xf4));var _0x912c=function(_0x369320,_0xc4d5c5){_0x369320=_0x369320-0x0;var _0x316553=_0x12c9[_0x369320];return _0x316553;};'use strict';var util=require(_0x912c('0x0'));var BPromise=require(_0x912c('0x1'));var jayson=require(_0x912c('0x2'));var _=require(_0x912c('0x3'));var logger=require('../../../config/logger')(_0x912c('0x4'));var client=jayson[_0x912c('0x5')][_0x912c('0x6')]({'port':0x232a});function request(_0x5ef9dd,_0x57d495){return new BPromise(function(_0x1553cc,_0x1f80d9){return client[_0x912c('0x7')](_0x5ef9dd,_0x57d495)[_0x912c('0x8')](function(_0x204002){if(_0x204002[_0x912c('0x9')]){return _0x1f80d9(_0x204002[_0x912c('0x9')]['message']);}else{return _0x1553cc(_0x204002[_0x912c('0xa')]);}})[_0x912c('0xb')](function(_0xc2aa83){return _0x1f80d9(_0xc2aa83);});});}exports[_0x912c('0xc')]=function(_0x3507a7,_0x1b48e0,_0xb94f14){return function(_0x21748c){if(_0xb94f14[_0x912c('0xd')]&&!_0xb94f14['rules'][_0x3507a7]){logger[_0x912c('0xe')]('[%s][INTERVAL]\x20ROUTING\x20STOPPED',_0x3507a7);return _0x21748c[_0x912c('0xf')]();}var _0x1d60ec=[];for(var _0x216081=0x0;_0x216081<_0x1b48e0[_0x912c('0x10')];_0x216081+=0x1){_0x1d60ec[_0x912c('0x11')](request('Command',{'command':util[_0x912c('0x12')](_0x912c('0x13'),_0x1b48e0[_0x216081])})[_0x912c('0x8')](function(_0x3a43c4){return _0x3a43c4&&_0x3a43c4['message']&&_0x3a43c4[_0x912c('0x14')][_0x912c('0x15')](_0x912c('0x16'))>=0x0?!![]:![];})[_0x912c('0xb')](function(_0x562e16){logger['error']('[%s][INTERVAL]\x20%s',_0x3507a7,_0x1b48e0[_0x216081]);}));}BPromise[_0x912c('0x17')](_0x1d60ec)[_0x912c('0x8')](function(_0x5c67c2){var _0x900655=_[_0x912c('0x18')](_0x5c67c2);logger[_0x912c('0xe')](_0x912c('0x19'),_0x3507a7,_0x1b48e0[_0x912c('0x1a')](_0x912c('0x1b')),_0x900655);_0x21748c[_0x912c('0x1c')](_0x900655);})[_0x912c('0xb')](function(_0x4e9084){console[_0x912c('0x1d')](_0x4e9084);logger[_0x912c('0x9')](_0x912c('0x19'),_0x3507a7,_0x1b48e0[_0x912c('0x1a')]('\x20|\x20'),_0x4e9084[_0x912c('0x1e')]);_0x21748c[_0x912c('0xf')]();});};}; \ No newline at end of file diff --git a/server/services/xdr/agents.controller.js b/server/services/xdr/agents.controller.js index 7c0b57a..5742770 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 _0x50ec=['extension','transferuniqueid','attendedtransfer','origtransfereruniqueid','origtransfererlinkedid','secondtransfereruniqueid','transfertype','ATTENDED','transferexten','transfereeuniqueid','clone','calleridname','agententerreason','secondtransfererlinkedid','secondtransfererexten','transfertargetuniqueid','agentcalledAt','hangup','diffTime','agent','lodash','util','./utils','info','format','AGENT|%s|%s|%s|%s|%s|%s|%s|%s','uniqueid','channel','membername','interface','calleridnum','connectedlinenum','lastevent','queue','getVoiceQueueByName','then','type','agentacw','agentcomplete','acw','acwtime','acwTimeout','CreateVoiceAgentReport','request','destuniqueid','now','called','stack','agentringnoanswer','isNil','agentringnoanswerAt','rejected','ringtime','talktime','error','forIn','abandoned','reason','agentconnectAt','connectedlinename','holdtime','answered_elsewhere','answeredelsewheredestinationuniqueid','answeredelsewheremembername','agentcompleteAt','complete','blindtransfer','transfereruniqueid','transfer','blind'];(function(_0x187843,_0x38faf4){var _0x273d6e=function(_0x1c6502){while(--_0x1c6502){_0x187843['push'](_0x187843['shift']());}};_0x273d6e(++_0x38faf4);}(_0x50ec,0x12c));var _0xc50e=function(_0xa55b92,_0x4ad4da){_0xa55b92=_0xa55b92-0x0;var _0x1d2e4d=_0x50ec[_0xa55b92];return _0x1d2e4d;};'use strict';var _=require(_0xc50e('0x0'));var util=require(_0xc50e('0x1'));var utils=require(_0xc50e('0x2'));var agents={};var transfers={};function writeDB(_0x225f5d,_0x2f8b88){utils[_0xc50e('0x3')](util[_0xc50e('0x4')](_0xc50e('0x5'),_0x225f5d[_0xc50e('0x6')],_0x225f5d[_0xc50e('0x7')],_0x225f5d['queue'],_0x225f5d[_0xc50e('0x8')],_0x225f5d[_0xc50e('0x9')],_0x225f5d[_0xc50e('0xa')],_0x225f5d[_0xc50e('0xb')],_0x225f5d[_0xc50e('0xc')]));if(_0x225f5d[_0xc50e('0xd')]){utils[_0xc50e('0xe')](_0x225f5d['queue'])[_0xc50e('0xf')](function(_0x7b43b8){if(_0x7b43b8){_0x225f5d[_0xc50e('0x10')]=_0x7b43b8[_0xc50e('0x10')];_0x225f5d[_0xc50e('0x11')]=_0x225f5d[_0xc50e('0x12')]?_0x7b43b8[_0xc50e('0x13')]:![];_0x225f5d[_0xc50e('0x14')]=_0x225f5d[_0xc50e('0x11')]?_0x7b43b8[_0xc50e('0x15')]:0x0;}utils['request'](_0xc50e('0x16'),_0x225f5d);});}else{utils[_0xc50e('0x17')](_0xc50e('0x16'),_0x225f5d);}if(_0x2f8b88){delete transfers[_0x225f5d[_0xc50e('0x6')]];}else{delete agents[_0x225f5d['destuniqueid']];}}exports['agentcalled']=function(_0x603f53){try{agents[_0x603f53[_0xc50e('0x18')]]=_0x603f53;agents[_0x603f53[_0xc50e('0x18')]]['agentcalledAt']=utils[_0xc50e('0x19')]();agents[_0x603f53[_0xc50e('0x18')]][_0xc50e('0xc')]=_0xc50e('0x1a');agents[_0x603f53[_0xc50e('0x18')]][_0xc50e('0xb')]=null;agents[_0x603f53[_0xc50e('0x18')]]['connectedlinename']=null;}catch(_0x160a06){utils['error'](_0x160a06[_0xc50e('0x1b')]);}};exports[_0xc50e('0x1c')]=function(_0x1db751){try{if(!_[_0xc50e('0x1d')](agents[_0x1db751['destuniqueid']])){agents[_0x1db751['destuniqueid']]['agentringnoanswer']=!![];agents[_0x1db751[_0xc50e('0x18')]][_0xc50e('0x1e')]=utils[_0xc50e('0x19')]();agents[_0x1db751[_0xc50e('0x18')]][_0xc50e('0xc')]=_0xc50e('0x1f');agents[_0x1db751[_0xc50e('0x18')]]['reason']=_0xc50e('0x1f');agents[_0x1db751[_0xc50e('0x18')]]['holdtime']=_0x1db751['ringtime']?parseInt(_0x1db751[_0xc50e('0x20')])/0x3e8:0x0;agents[_0x1db751['destuniqueid']][_0xc50e('0x21')]=0x0;writeDB(agents[_0x1db751[_0xc50e('0x18')]]);}}catch(_0x39e027){utils[_0xc50e('0x22')](_0x39e027['stack']);}};exports['queuecallerabandon']=function(_0x2127e2){try{_[_0xc50e('0x23')](agents,function(_0x48a204,_0x26d2c1){if(_0x48a204[_0xc50e('0x6')]==_0x2127e2['uniqueid']){_0x48a204[_0xc50e('0x1c')]=!![];_0x48a204[_0xc50e('0x1e')]=utils[_0xc50e('0x19')]();_0x48a204['lastevent']=_0xc50e('0x24');_0x48a204[_0xc50e('0x25')]=_0xc50e('0x24');_0x48a204['holdtime']=_0x2127e2['holdtime'];_0x48a204[_0xc50e('0x21')]=0x0;writeDB(_0x48a204);}});}catch(_0xde0026){utils['error'](_0xde0026[_0xc50e('0x1b')]);}};exports['agentconnect']=function(_0x243e98){try{if(agents[_0x243e98[_0xc50e('0x18')]]){agents[_0x243e98[_0xc50e('0x18')]][_0xc50e('0x26')]=utils[_0xc50e('0x19')]();agents[_0x243e98[_0xc50e('0x18')]]['connectedlinenum']=_0x243e98[_0xc50e('0xb')];agents[_0x243e98[_0xc50e('0x18')]][_0xc50e('0x27')]=_0x243e98[_0xc50e('0x27')];agents[_0x243e98['destuniqueid']][_0xc50e('0x28')]=_0x243e98[_0xc50e('0x20')];agents[_0x243e98['destuniqueid']][_0xc50e('0xc')]='connect';_[_0xc50e('0x23')](agents,function(_0x3a5ff3,_0x19c612){if(_0x3a5ff3[_0xc50e('0x18')]!=_0x243e98[_0xc50e('0x18')]&&_0x3a5ff3[_0xc50e('0x6')]==_0x243e98[_0xc50e('0x6')]){_0x3a5ff3[_0xc50e('0x21')]=0x0;_0x3a5ff3['holdtime']=_0x243e98[_0xc50e('0x20')];_0x3a5ff3[_0xc50e('0x1c')]=!![];_0x3a5ff3['agentringnoanswerAt']=utils['now']();_0x3a5ff3[_0xc50e('0xc')]='answered_elsewhere';_0x3a5ff3[_0xc50e('0x25')]=_0xc50e('0x29');_0x3a5ff3[_0xc50e('0x2a')]=_0x243e98[_0xc50e('0x18')];_0x3a5ff3[_0xc50e('0x2b')]=_0x243e98['membername'];writeDB(_0x3a5ff3);}});}}catch(_0x57b7e9){utils[_0xc50e('0x22')](_0x57b7e9[_0xc50e('0x1b')]);}};exports['agentcomplete']=function(_0x309352){try{if(!_[_0xc50e('0x1d')](agents[_0x309352['destuniqueid']])){agents[_0x309352[_0xc50e('0x18')]][_0xc50e('0x12')]=!![];agents[_0x309352['destuniqueid']][_0xc50e('0x2c')]=utils[_0xc50e('0x19')]();agents[_0x309352[_0xc50e('0x18')]][_0xc50e('0x21')]=utils['diffTime'](agents[_0x309352[_0xc50e('0x18')]]['agentcompleteAt'],agents[_0x309352[_0xc50e('0x18')]][_0xc50e('0x26')]);agents[_0x309352[_0xc50e('0x18')]][_0xc50e('0x25')]=_0x309352['reason'];agents[_0x309352[_0xc50e('0x18')]][_0xc50e('0xc')]=_0xc50e('0x2d');writeDB(agents[_0x309352[_0xc50e('0x18')]]);}}catch(_0x4a2ba7){utils['error'](_0x4a2ba7[_0xc50e('0x1b')]);}};exports[_0xc50e('0x2e')]=function(_0x45a09b){try{if(!_[_0xc50e('0x1d')](agents[_0x45a09b[_0xc50e('0x2f')]])){agents[_0x45a09b[_0xc50e('0x2f')]][_0xc50e('0x30')]=!![];agents[_0x45a09b['transfereruniqueid']]['transfertype']=_0xc50e('0x31');agents[_0x45a09b['transfereruniqueid']]['transferexten']=_0x45a09b[_0xc50e('0x32')];agents[_0x45a09b[_0xc50e('0x2f')]][_0xc50e('0x33')]=agents[_0x45a09b['transfereruniqueid']][_0xc50e('0x6')];}}catch(_0x45f214){utils[_0xc50e('0x22')](_0x45f214['stack']);}};exports[_0xc50e('0x34')]=function(_0x25e2a9){try{if(_0x25e2a9[_0xc50e('0x35')]==_0x25e2a9[_0xc50e('0x36')]){if(!_['isNil'](agents[_0x25e2a9[_0xc50e('0x37')]])){agents[_0x25e2a9[_0xc50e('0x37')]][_0xc50e('0x30')]=!![];agents[_0x25e2a9[_0xc50e('0x37')]][_0xc50e('0x38')]=_0xc50e('0x39');agents[_0x25e2a9[_0xc50e('0x37')]][_0xc50e('0x3a')]=_0x25e2a9['origtransfererexten'];agents[_0x25e2a9[_0xc50e('0x37')]][_0xc50e('0x33')]=_0x25e2a9[_0xc50e('0x35')];}if(_0x25e2a9[_0xc50e('0x3b')]&&agents[_0x25e2a9['transfereeuniqueid']]){agents[_0x25e2a9[_0xc50e('0x3b')]]['agententerreason']=0x1;transfers[_0x25e2a9[_0xc50e('0x3b')]]=_[_0xc50e('0x3c')](agents[_0x25e2a9[_0xc50e('0x3b')]]);transfers[_0x25e2a9[_0xc50e('0x3b')]][_0xc50e('0xa')]=agents[_0x25e2a9[_0xc50e('0x37')]][_0xc50e('0xa')];transfers[_0x25e2a9[_0xc50e('0x3b')]][_0xc50e('0x3d')]=agents[_0x25e2a9[_0xc50e('0x37')]][_0xc50e('0x3d')];transfers[_0x25e2a9[_0xc50e('0x3b')]]['agentcalledAt']=utils[_0xc50e('0x19')]();transfers[_0x25e2a9[_0xc50e('0x3b')]]['agentconnectAt']=utils[_0xc50e('0x19')]();transfers[_0x25e2a9['transfereeuniqueid']][_0xc50e('0x28')]=0x0;transfers[_0x25e2a9[_0xc50e('0x3b')]][_0xc50e('0x3e')]=0x2;}}else if(_0x25e2a9['secondtransfereruniqueid']==_0x25e2a9[_0xc50e('0x3f')]){if(!_[_0xc50e('0x1d')](agents[_0x25e2a9[_0xc50e('0x35')]])){agents[_0x25e2a9[_0xc50e('0x35')]][_0xc50e('0x30')]=!![];agents[_0x25e2a9[_0xc50e('0x35')]]['transfertype']=_0xc50e('0x39');agents[_0x25e2a9['origtransfereruniqueid']][_0xc50e('0x3a')]=_0x25e2a9[_0xc50e('0x40')];agents[_0x25e2a9['origtransfereruniqueid']][_0xc50e('0x33')]=_0x25e2a9[_0xc50e('0x37')];}if(_0x25e2a9['transfertargetuniqueid']&&agents[_0x25e2a9['transfertargetuniqueid']]){agents[_0x25e2a9['transfertargetuniqueid']]['agententerreason']=0x1;transfers[_0x25e2a9[_0xc50e('0x41')]]=_[_0xc50e('0x3c')](agents[_0x25e2a9[_0xc50e('0x41')]]);transfers[_0x25e2a9[_0xc50e('0x41')]][_0xc50e('0xa')]=agents[_0x25e2a9['origtransfereruniqueid']][_0xc50e('0xa')];transfers[_0x25e2a9[_0xc50e('0x41')]][_0xc50e('0x3d')]=agents[_0x25e2a9[_0xc50e('0x35')]][_0xc50e('0x3d')];transfers[_0x25e2a9[_0xc50e('0x41')]][_0xc50e('0x42')]=utils[_0xc50e('0x19')]();transfers[_0x25e2a9[_0xc50e('0x41')]][_0xc50e('0x26')]=utils[_0xc50e('0x19')]();transfers[_0x25e2a9['transfertargetuniqueid']][_0xc50e('0x28')]=0x0;transfers[_0x25e2a9[_0xc50e('0x41')]][_0xc50e('0x3e')]=0x2;}}}catch(_0x21b0d0){utils['error'](_0x21b0d0['stack']);}};exports[_0xc50e('0x43')]=function(_0x23cf2f){try{if(transfers[_0x23cf2f[_0xc50e('0x6')]]){transfers[_0x23cf2f['uniqueid']][_0xc50e('0x12')]=!![];transfers[_0x23cf2f[_0xc50e('0x6')]][_0xc50e('0x2c')]=utils[_0xc50e('0x19')]();transfers[_0x23cf2f['uniqueid']][_0xc50e('0x21')]=utils[_0xc50e('0x44')](transfers[_0x23cf2f[_0xc50e('0x6')]][_0xc50e('0x2c')],transfers[_0x23cf2f['uniqueid']]['agentconnectAt']);transfers[_0x23cf2f[_0xc50e('0x6')]][_0xc50e('0x25')]=_0xc50e('0x45');transfers[_0x23cf2f[_0xc50e('0x6')]][_0xc50e('0xc')]='complete';writeDB(transfers[_0x23cf2f[_0xc50e('0x6')]],!![]);}if(agents[_0x23cf2f[_0xc50e('0x6')]]&&agents[_0x23cf2f[_0xc50e('0x6')]][_0xc50e('0x26')]){agents[_0x23cf2f[_0xc50e('0x6')]][_0xc50e('0x12')]=!![];agents[_0x23cf2f[_0xc50e('0x6')]]['agentcompleteAt']=utils[_0xc50e('0x19')]();agents[_0x23cf2f[_0xc50e('0x6')]][_0xc50e('0x21')]=utils['diffTime'](agents[_0x23cf2f[_0xc50e('0x6')]][_0xc50e('0x2c')],agents[_0x23cf2f[_0xc50e('0x6')]][_0xc50e('0x26')]);agents[_0x23cf2f['uniqueid']][_0xc50e('0x25')]=agents[_0x23cf2f[_0xc50e('0x6')]][_0xc50e('0x30')]?_0xc50e('0x30'):_0xc50e('0x45');agents[_0x23cf2f[_0xc50e('0x6')]][_0xc50e('0xc')]='complete';writeDB(agents[_0x23cf2f[_0xc50e('0x6')]]);}}catch(_0x33f87a){utils[_0xc50e('0x22')](_0x33f87a[_0xc50e('0x1b')]);}}; \ No newline at end of file +var _0x9885=['agentacw','agentcomplete','acw','acwtime','acwTimeout','request','CreateVoiceAgentReport','uniqueid','destuniqueid','agentcalledAt','lastevent','called','stack','agentringnoanswer','isNil','agentringnoanswerAt','reason','holdtime','ringtime','talktime','error','queuecallerabandon','forIn','abandoned','agentconnect','agentconnectAt','now','connect','answered_elsewhere','answeredelsewheredestinationuniqueid','answeredelsewheremembername','agentcompleteAt','complete','blindtransfer','transfereruniqueid','transfer','transfertype','blind','transferexten','extension','transferuniqueid','origtransfereruniqueid','origtransfererlinkedid','secondtransfereruniqueid','origtransfererexten','transfereeuniqueid','agententerreason','clone','calleridname','secondtransfererlinkedid','ATTENDED','secondtransfererexten','transfertargetuniqueid','hangup','diffTime','agent','lodash','util','./utils','info','format','AGENT|%s|%s|%s|%s|%s|%s|%s|%s','channel','queue','membername','calleridnum','connectedlinenum','then','type'];(function(_0x5b121c,_0x5e66ee){var _0x57a2b8=function(_0x3565c3){while(--_0x3565c3){_0x5b121c['push'](_0x5b121c['shift']());}};_0x57a2b8(++_0x5e66ee);}(_0x9885,0x191));var _0x5988=function(_0x8036a1,_0x5144ed){_0x8036a1=_0x8036a1-0x0;var _0x1d711b=_0x9885[_0x8036a1];return _0x1d711b;};'use strict';var _=require(_0x5988('0x0'));var util=require(_0x5988('0x1'));var utils=require(_0x5988('0x2'));var agents={};var transfers={};function writeDB(_0x177ab1,_0x16ddaf){utils[_0x5988('0x3')](util[_0x5988('0x4')](_0x5988('0x5'),_0x177ab1['uniqueid'],_0x177ab1[_0x5988('0x6')],_0x177ab1[_0x5988('0x7')],_0x177ab1[_0x5988('0x8')],_0x177ab1['interface'],_0x177ab1[_0x5988('0x9')],_0x177ab1[_0x5988('0xa')],_0x177ab1['lastevent']));if(_0x177ab1['queue']){utils['getVoiceQueueByName'](_0x177ab1['queue'])[_0x5988('0xb')](function(_0xa697ec){if(_0xa697ec){_0x177ab1[_0x5988('0xc')]=_0xa697ec[_0x5988('0xc')];_0x177ab1[_0x5988('0xd')]=_0x177ab1[_0x5988('0xe')]?_0xa697ec[_0x5988('0xf')]:![];_0x177ab1[_0x5988('0x10')]=_0x177ab1[_0x5988('0xd')]?_0xa697ec[_0x5988('0x11')]:0x0;}utils[_0x5988('0x12')](_0x5988('0x13'),_0x177ab1);});}else{utils[_0x5988('0x12')](_0x5988('0x13'),_0x177ab1);}if(_0x16ddaf){delete transfers[_0x177ab1[_0x5988('0x14')]];}else{delete agents[_0x177ab1[_0x5988('0x15')]];}}exports['agentcalled']=function(_0x4b7fd8){try{agents[_0x4b7fd8[_0x5988('0x15')]]=_0x4b7fd8;agents[_0x4b7fd8[_0x5988('0x15')]][_0x5988('0x16')]=utils['now']();agents[_0x4b7fd8[_0x5988('0x15')]][_0x5988('0x17')]=_0x5988('0x18');agents[_0x4b7fd8[_0x5988('0x15')]][_0x5988('0xa')]=null;agents[_0x4b7fd8[_0x5988('0x15')]]['connectedlinename']=null;}catch(_0xe78550){utils['error'](_0xe78550[_0x5988('0x19')]);}};exports[_0x5988('0x1a')]=function(_0x1d8678){try{if(!_[_0x5988('0x1b')](agents[_0x1d8678['destuniqueid']])){agents[_0x1d8678[_0x5988('0x15')]][_0x5988('0x1a')]=!![];agents[_0x1d8678[_0x5988('0x15')]][_0x5988('0x1c')]=utils['now']();agents[_0x1d8678[_0x5988('0x15')]][_0x5988('0x17')]='rejected';agents[_0x1d8678[_0x5988('0x15')]][_0x5988('0x1d')]='rejected';agents[_0x1d8678[_0x5988('0x15')]][_0x5988('0x1e')]=_0x1d8678[_0x5988('0x1f')]?parseInt(_0x1d8678[_0x5988('0x1f')])/0x3e8:0x0;agents[_0x1d8678[_0x5988('0x15')]][_0x5988('0x20')]=0x0;writeDB(agents[_0x1d8678[_0x5988('0x15')]]);}}catch(_0x119f2c){utils[_0x5988('0x21')](_0x119f2c['stack']);}};exports[_0x5988('0x22')]=function(_0x457506){try{_[_0x5988('0x23')](agents,function(_0x418371,_0x5dbdf5){if(_0x418371[_0x5988('0x14')]==_0x457506[_0x5988('0x14')]){_0x418371['agentringnoanswer']=!![];_0x418371['agentringnoanswerAt']=utils['now']();_0x418371[_0x5988('0x17')]='abandoned';_0x418371[_0x5988('0x1d')]=_0x5988('0x24');_0x418371['holdtime']=_0x457506[_0x5988('0x1e')];_0x418371[_0x5988('0x20')]=0x0;writeDB(_0x418371);}});}catch(_0x109bb8){utils[_0x5988('0x21')](_0x109bb8[_0x5988('0x19')]);}};exports[_0x5988('0x25')]=function(_0x589473){try{if(agents[_0x589473[_0x5988('0x15')]]){agents[_0x589473['destuniqueid']][_0x5988('0x26')]=utils[_0x5988('0x27')]();agents[_0x589473['destuniqueid']][_0x5988('0xa')]=_0x589473[_0x5988('0xa')];agents[_0x589473[_0x5988('0x15')]]['connectedlinename']=_0x589473['connectedlinename'];agents[_0x589473[_0x5988('0x15')]]['holdtime']=_0x589473[_0x5988('0x1f')];agents[_0x589473[_0x5988('0x15')]][_0x5988('0x17')]=_0x5988('0x28');_[_0x5988('0x23')](agents,function(_0x3095b3,_0x338d7b){if(_0x3095b3[_0x5988('0x15')]!=_0x589473['destuniqueid']&&_0x3095b3[_0x5988('0x14')]==_0x589473[_0x5988('0x14')]){_0x3095b3[_0x5988('0x20')]=0x0;_0x3095b3[_0x5988('0x1e')]=_0x589473[_0x5988('0x1f')];_0x3095b3['agentringnoanswer']=!![];_0x3095b3['agentringnoanswerAt']=utils[_0x5988('0x27')]();_0x3095b3['lastevent']=_0x5988('0x29');_0x3095b3['reason']=_0x5988('0x29');_0x3095b3[_0x5988('0x2a')]=_0x589473[_0x5988('0x15')];_0x3095b3[_0x5988('0x2b')]=_0x589473[_0x5988('0x8')];writeDB(_0x3095b3);}});}}catch(_0x192b1c){utils[_0x5988('0x21')](_0x192b1c[_0x5988('0x19')]);}};exports[_0x5988('0xe')]=function(_0x413723){try{if(!_[_0x5988('0x1b')](agents[_0x413723[_0x5988('0x15')]])){agents[_0x413723[_0x5988('0x15')]][_0x5988('0xe')]=!![];agents[_0x413723[_0x5988('0x15')]][_0x5988('0x2c')]=utils[_0x5988('0x27')]();agents[_0x413723[_0x5988('0x15')]][_0x5988('0x20')]=utils['diffTime'](agents[_0x413723[_0x5988('0x15')]][_0x5988('0x2c')],agents[_0x413723[_0x5988('0x15')]][_0x5988('0x26')]);agents[_0x413723[_0x5988('0x15')]][_0x5988('0x1d')]=_0x413723[_0x5988('0x1d')];agents[_0x413723[_0x5988('0x15')]]['lastevent']=_0x5988('0x2d');writeDB(agents[_0x413723[_0x5988('0x15')]]);}}catch(_0x2311d2){utils[_0x5988('0x21')](_0x2311d2[_0x5988('0x19')]);}};exports[_0x5988('0x2e')]=function(_0x5ad6f0){try{if(!_[_0x5988('0x1b')](agents[_0x5ad6f0[_0x5988('0x2f')]])){agents[_0x5ad6f0['transfereruniqueid']][_0x5988('0x30')]=!![];agents[_0x5ad6f0['transfereruniqueid']][_0x5988('0x31')]=_0x5988('0x32');agents[_0x5ad6f0['transfereruniqueid']][_0x5988('0x33')]=_0x5ad6f0[_0x5988('0x34')];agents[_0x5ad6f0['transfereruniqueid']][_0x5988('0x35')]=agents[_0x5ad6f0[_0x5988('0x2f')]][_0x5988('0x14')];}}catch(_0x4207be){utils['error'](_0x4207be[_0x5988('0x19')]);}};exports['attendedtransfer']=function(_0x4ff875){try{if(_0x4ff875[_0x5988('0x36')]==_0x4ff875[_0x5988('0x37')]){if(!_['isNil'](agents[_0x4ff875['secondtransfereruniqueid']])){agents[_0x4ff875[_0x5988('0x38')]][_0x5988('0x30')]=!![];agents[_0x4ff875[_0x5988('0x38')]][_0x5988('0x31')]='ATTENDED';agents[_0x4ff875[_0x5988('0x38')]][_0x5988('0x33')]=_0x4ff875[_0x5988('0x39')];agents[_0x4ff875[_0x5988('0x38')]][_0x5988('0x35')]=_0x4ff875[_0x5988('0x36')];}if(_0x4ff875[_0x5988('0x3a')]&&agents[_0x4ff875['transfereeuniqueid']]){agents[_0x4ff875[_0x5988('0x3a')]][_0x5988('0x3b')]=0x1;transfers[_0x4ff875['transfereeuniqueid']]=_[_0x5988('0x3c')](agents[_0x4ff875[_0x5988('0x3a')]]);transfers[_0x4ff875['transfereeuniqueid']][_0x5988('0x9')]=agents[_0x4ff875[_0x5988('0x38')]][_0x5988('0x9')];transfers[_0x4ff875[_0x5988('0x3a')]][_0x5988('0x3d')]=agents[_0x4ff875[_0x5988('0x38')]]['calleridname'];transfers[_0x4ff875[_0x5988('0x3a')]][_0x5988('0x16')]=utils[_0x5988('0x27')]();transfers[_0x4ff875[_0x5988('0x3a')]][_0x5988('0x26')]=utils[_0x5988('0x27')]();transfers[_0x4ff875[_0x5988('0x3a')]][_0x5988('0x1e')]=0x0;transfers[_0x4ff875[_0x5988('0x3a')]][_0x5988('0x3b')]=0x2;}}else if(_0x4ff875[_0x5988('0x38')]==_0x4ff875[_0x5988('0x3e')]){if(!_[_0x5988('0x1b')](agents[_0x4ff875[_0x5988('0x36')]])){agents[_0x4ff875[_0x5988('0x36')]][_0x5988('0x30')]=!![];agents[_0x4ff875[_0x5988('0x36')]]['transfertype']=_0x5988('0x3f');agents[_0x4ff875[_0x5988('0x36')]][_0x5988('0x33')]=_0x4ff875[_0x5988('0x40')];agents[_0x4ff875[_0x5988('0x36')]]['transferuniqueid']=_0x4ff875['secondtransfereruniqueid'];}if(_0x4ff875['transfertargetuniqueid']&&agents[_0x4ff875[_0x5988('0x41')]]){agents[_0x4ff875['transfertargetuniqueid']][_0x5988('0x3b')]=0x1;transfers[_0x4ff875['transfertargetuniqueid']]=_[_0x5988('0x3c')](agents[_0x4ff875[_0x5988('0x41')]]);transfers[_0x4ff875[_0x5988('0x41')]]['calleridnum']=agents[_0x4ff875['origtransfereruniqueid']][_0x5988('0x9')];transfers[_0x4ff875[_0x5988('0x41')]][_0x5988('0x3d')]=agents[_0x4ff875['origtransfereruniqueid']][_0x5988('0x3d')];transfers[_0x4ff875[_0x5988('0x41')]]['agentcalledAt']=utils['now']();transfers[_0x4ff875['transfertargetuniqueid']]['agentconnectAt']=utils['now']();transfers[_0x4ff875[_0x5988('0x41')]][_0x5988('0x1e')]=0x0;transfers[_0x4ff875[_0x5988('0x41')]][_0x5988('0x3b')]=0x2;}}}catch(_0x30ff67){utils[_0x5988('0x21')](_0x30ff67[_0x5988('0x19')]);}};exports[_0x5988('0x42')]=function(_0x4c9b0f){try{if(transfers[_0x4c9b0f[_0x5988('0x14')]]){transfers[_0x4c9b0f[_0x5988('0x14')]][_0x5988('0xe')]=!![];transfers[_0x4c9b0f['uniqueid']][_0x5988('0x2c')]=utils[_0x5988('0x27')]();transfers[_0x4c9b0f[_0x5988('0x14')]][_0x5988('0x20')]=utils[_0x5988('0x43')](transfers[_0x4c9b0f['uniqueid']]['agentcompleteAt'],transfers[_0x4c9b0f[_0x5988('0x14')]][_0x5988('0x26')]);transfers[_0x4c9b0f[_0x5988('0x14')]][_0x5988('0x1d')]=_0x5988('0x44');transfers[_0x4c9b0f[_0x5988('0x14')]][_0x5988('0x17')]=_0x5988('0x2d');writeDB(transfers[_0x4c9b0f[_0x5988('0x14')]],!![]);}if(agents[_0x4c9b0f[_0x5988('0x14')]]&&agents[_0x4c9b0f['uniqueid']][_0x5988('0x26')]){agents[_0x4c9b0f[_0x5988('0x14')]][_0x5988('0xe')]=!![];agents[_0x4c9b0f[_0x5988('0x14')]]['agentcompleteAt']=utils['now']();agents[_0x4c9b0f[_0x5988('0x14')]]['talktime']=utils[_0x5988('0x43')](agents[_0x4c9b0f[_0x5988('0x14')]][_0x5988('0x2c')],agents[_0x4c9b0f[_0x5988('0x14')]][_0x5988('0x26')]);agents[_0x4c9b0f[_0x5988('0x14')]][_0x5988('0x1d')]=agents[_0x4c9b0f[_0x5988('0x14')]][_0x5988('0x30')]?_0x5988('0x30'):_0x5988('0x44');agents[_0x4c9b0f[_0x5988('0x14')]][_0x5988('0x17')]='complete';writeDB(agents[_0x4c9b0f[_0x5988('0x14')]]);}}catch(_0x4abae4){utils[_0x5988('0x21')](_0x4abae4[_0x5988('0x19')]);}}; \ No newline at end of file diff --git a/server/services/xdr/calls.controller.js b/server/services/xdr/calls.controller.js index 3de6c52..7095051 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 _0x0115=['xmd-queue','xmcs-queue','Queue','lastdata','ContactId','xmd-cdrtype','routeid','sipcallid','application','toLowerCase','set','startsWith','appdata','cdr','split','substring','lastIndexOf','includes','noop','execif','gotoif','lastapplication','lodash','util','NO\x20ANSWER','FAILED','BUSY','info','format','CALL|%s|%s|%s|%s|%s|%s|%s|%s','uniqueid','channel','type','source','destination','callerid','accountcode','getUserByInternal','UserId','CreateVoiceCallReport','request','newchannel','linkedid','OutgoingSpoolFailed','calleridnum','context','now','DOCUMENTATION','error','stack','channelstate','systemanswertime','isNil','transfer','answertime','disposition','ANSWERED','hangup','calleridname','endtime','duration','diffTime','starttime','billableseconds','attendedtransfer','localtwolinkedid','transfereechannel','destinationchannel','_attended','transfertargetchannel','userfield','musiconholdstart','musiconholdstartAt','musiconholdstop','mohtime','varset','variable','xmd-phone','value','\x22\x20<','xmd-callerid-preview','xmd-callerid'];(function(_0x37a009,_0x4b95f0){var _0x174b22=function(_0x336c75){while(--_0x336c75){_0x37a009['push'](_0x37a009['shift']());}};_0x174b22(++_0x4b95f0);}(_0x0115,0x1b0));var _0x5011=function(_0x3268e7,_0x2eb7ca){_0x3268e7=_0x3268e7-0x0;var _0x15a505=_0x0115[_0x3268e7];return _0x15a505;};'use strict';var _=require(_0x5011('0x0'));var util=require(_0x5011('0x1'));var utils=require('./utils');var dispositions=[_0x5011('0x2'),_0x5011('0x3'),_0x5011('0x3'),_0x5011('0x2'),_0x5011('0x2'),_0x5011('0x2'),'ANSWERED',_0x5011('0x4'),_0x5011('0x3'),'FAILED',_0x5011('0x3')];var channels={};function writeDB(_0x423ddf){utils[_0x5011('0x5')](util[_0x5011('0x6')](_0x5011('0x7'),_0x423ddf[_0x5011('0x8')],_0x423ddf[_0x5011('0x9')],_0x423ddf[_0x5011('0xa')],_0x423ddf['accountcode'],_0x423ddf[_0x5011('0xb')],_0x423ddf[_0x5011('0xc')],_0x423ddf[_0x5011('0xd')],_0x423ddf['disposition']));if(_0x423ddf[_0x5011('0xe')]){utils[_0x5011('0xf')](_0x423ddf[_0x5011('0xe')])['then'](function(_0x3415be){if(_0x3415be){_0x423ddf[_0x5011('0x10')]=_0x3415be['id'];}utils['request'](_0x5011('0x11'),_0x423ddf);});}else{utils[_0x5011('0x12')](_0x5011('0x11'),_0x423ddf);}if(channels[_0x423ddf['uniqueid']]){delete channels[_0x423ddf['uniqueid']];}}exports[_0x5011('0x13')]=function(_0x4ac3e8){try{if(_0x4ac3e8[_0x5011('0x8')]==_0x4ac3e8[_0x5011('0x14')]&&_0x4ac3e8[_0x5011('0x9')]!=_0x5011('0x15')){channels[_0x4ac3e8[_0x5011('0x8')]]={'uniqueid':_0x4ac3e8['uniqueid'],'accountcode':_0x4ac3e8[_0x5011('0xe')],'source':_0x4ac3e8[_0x5011('0x16')],'destination':_0x4ac3e8['exten'],'destinationcontext':_0x4ac3e8[_0x5011('0x17')],'channel':_0x4ac3e8['channel'],'starttime':utils[_0x5011('0x18')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0x5011('0x2'),'amaflags':_0x5011('0x19')};}}catch(_0x526530){utils[_0x5011('0x1a')](_0x526530[_0x5011('0x1b')]);}};exports['newstate']=function(_0x2ef343){try{if(!_['isNil'](channels[_0x2ef343['uniqueid']])&&_0x2ef343[_0x5011('0x1c')]==0x6){if(_['isNil'](channels[_0x2ef343[_0x5011('0x8')]][_0x5011('0x1d')])){channels[_0x2ef343[_0x5011('0x8')]][_0x5011('0x1d')]=utils[_0x5011('0x18')]();}}else if(!_[_0x5011('0x1e')](channels[_0x2ef343[_0x5011('0x14')]])&&_0x2ef343[_0x5011('0x1c')]==0x6&&_0x2ef343[_0x5011('0x17')]!=_0x5011('0x1f')){channels[_0x2ef343['linkedid']][_0x5011('0xe')]=_0x2ef343[_0x5011('0xe')];channels[_0x2ef343['linkedid']]['destinationchannel']=_0x2ef343[_0x5011('0x9')];if(_[_0x5011('0x1e')](channels[_0x2ef343['linkedid']][_0x5011('0x20')])){channels[_0x2ef343[_0x5011('0x14')]][_0x5011('0x20')]=utils[_0x5011('0x18')]();}channels[_0x2ef343[_0x5011('0x14')]][_0x5011('0x21')]=dispositions[_['toNumber'](_0x2ef343[_0x5011('0x1c')])]||_0x5011('0x22');}}catch(_0x4c34e2){utils['error'](_0x4c34e2[_0x5011('0x1b')]);}};exports[_0x5011('0x23')]=function(_0x473927){try{if(!_['isNil'](channels[_0x473927[_0x5011('0x8')]])){if(_[_0x5011('0x1e')](channels[_0x473927[_0x5011('0x8')]][_0x5011('0xd')])){channels[_0x473927[_0x5011('0x8')]]['callerid']=_0x473927[_0x5011('0x24')]+'\x20<'+_0x473927['calleridnum']+'>';}channels[_0x473927[_0x5011('0x8')]][_0x5011('0x25')]=utils[_0x5011('0x18')]();channels[_0x473927['uniqueid']][_0x5011('0x26')]=utils[_0x5011('0x27')](channels[_0x473927[_0x5011('0x8')]][_0x5011('0x25')],channels[_0x473927['uniqueid']][_0x5011('0x28')]);channels[_0x473927[_0x5011('0x8')]][_0x5011('0x29')]=channels[_0x473927[_0x5011('0x8')]]['answertime']?utils[_0x5011('0x27')](channels[_0x473927[_0x5011('0x8')]][_0x5011('0x25')],channels[_0x473927['uniqueid']][_0x5011('0x20')]):0x0;writeDB(channels[_0x473927['uniqueid']]);}}catch(_0x31f510){utils[_0x5011('0x1a')](_0x31f510[_0x5011('0x1b')]);}};exports[_0x5011('0x2a')]=function(_0x4bec22){try{if(!_[_0x5011('0x1e')](channels[_0x4bec22[_0x5011('0x2b')]])){if(channels[_0x4bec22['localtwolinkedid']][_0x5011('0x9')]==_0x4bec22[_0x5011('0x2c')]){channels[_0x4bec22[_0x5011('0x2b')]][_0x5011('0x2d')]=_0x4bec22['secondtransfererchannel'];channels[_0x4bec22[_0x5011('0x2b')]]['userfield']=_0x5011('0x2e');}else if(channels[_0x4bec22['localtwolinkedid']][_0x5011('0x9')]=_0x4bec22[_0x5011('0x2f')]){channels[_0x4bec22[_0x5011('0x2b')]]['destinationchannel']=_0x4bec22['origtransfererchannel'];channels[_0x4bec22['localtwolinkedid']][_0x5011('0x30')]='_attended';}}}catch(_0x10aa0a){utils['error'](_0x10aa0a[_0x5011('0x1b')]);}};exports[_0x5011('0x31')]=function(_0x2e9e4d){try{if(!_[_0x5011('0x1e')](channels[_0x2e9e4d[_0x5011('0x8')]])){channels[_0x2e9e4d[_0x5011('0x8')]][_0x5011('0x32')]=utils[_0x5011('0x18')]();}}catch(_0x5342db){utils['error'](_0x5342db[_0x5011('0x1b')]);}};exports[_0x5011('0x33')]=function(_0x4c9be8){try{if(!_[_0x5011('0x1e')](channels[_0x4c9be8[_0x5011('0x8')]])){if(!_[_0x5011('0x1e')](channels[_0x4c9be8[_0x5011('0x8')]][_0x5011('0x32')])){channels[_0x4c9be8[_0x5011('0x8')]][_0x5011('0x34')]+=utils[_0x5011('0x27')](utils[_0x5011('0x18')](),channels[_0x4c9be8['uniqueid']][_0x5011('0x32')]);delete channels[_0x4c9be8[_0x5011('0x8')]][_0x5011('0x32')];}}}catch(_0x51cc38){utils['error'](_0x51cc38['stack']);}};exports[_0x5011('0x35')]=function(_0xb633b4){try{if(!_[_0x5011('0x1e')](channels[_0xb633b4[_0x5011('0x8')]])){if(!_[_0x5011('0x1e')](_0xb633b4['variable']['xmd-originatecalleridnum'])){channels[_0xb633b4[_0x5011('0x8')]]['source']=_0xb633b4['value'];}if(!_['isNil'](_0xb633b4[_0x5011('0x36')][_0x5011('0x37')])){channels[_0xb633b4[_0x5011('0x8')]][_0x5011('0xc')]=_0xb633b4[_0x5011('0x38')];channels[_0xb633b4[_0x5011('0x8')]]['callerid']='\x22'+_0xb633b4['value']+_0x5011('0x39')+_0xb633b4[_0x5011('0x38')]+'>';}if(!_[_0x5011('0x1e')](_0xb633b4[_0x5011('0x36')][_0x5011('0x3a')])||!_[_0x5011('0x1e')](_0xb633b4['variable'][_0x5011('0x3b')])){channels[_0xb633b4[_0x5011('0x8')]][_0x5011('0xd')]=_0xb633b4[_0x5011('0x38')];}if(!_[_0x5011('0x1e')](_0xb633b4[_0x5011('0x36')][_0x5011('0x3c')])||!_['isNil'](_0xb633b4[_0x5011('0x36')][_0x5011('0x3d')])){channels[_0xb633b4[_0x5011('0x8')]]['lastapplication']=_0x5011('0x3e');channels[_0xb633b4['uniqueid']][_0x5011('0x3f')]=_0xb633b4[_0x5011('0x38')];channels[_0xb633b4['uniqueid']]['queue']=!![];}if(!_[_0x5011('0x1e')](_0xb633b4[_0x5011('0x36')]['xmd-contactid'])){channels[_0xb633b4[_0x5011('0x8')]][_0x5011('0x40')]=_0xb633b4[_0x5011('0x38')];}if(!_[_0x5011('0x1e')](_0xb633b4[_0x5011('0x36')][_0x5011('0x41')])){channels[_0xb633b4['uniqueid']][_0x5011('0xa')]=_0xb633b4[_0x5011('0x38')];}if(!_[_0x5011('0x1e')](_0xb633b4[_0x5011('0x36')]['outboundrouteid'])){channels[_0xb633b4[_0x5011('0x8')]][_0x5011('0x42')]=_0xb633b4[_0x5011('0x38')];}if(!_[_0x5011('0x1e')](_0xb633b4['variable']['sipcallid'])){channels[_0xb633b4[_0x5011('0x8')]][_0x5011('0x43')]=_0xb633b4[_0x5011('0x38')];}}}catch(_0x18655a){utils[_0x5011('0x1a')](_0x18655a[_0x5011('0x1b')]);}};exports['newexten']=function(_0x5e2412){try{if(!_[_0x5011('0x1e')](channels[_0x5e2412[_0x5011('0x8')]])){if(_0x5e2412[_0x5011('0x44')][_0x5011('0x45')]()==_0x5011('0x46')&&_[_0x5011('0x47')](_0x5e2412[_0x5011('0x48')]['toLowerCase'](),_0x5011('0x49'))){var _0x309e67=_0x5e2412[_0x5011('0x48')][_0x5011('0x4a')]('=');var _0x13a295=_0x309e67[0x0][_0x5011('0x4b')](_0x309e67[0x0][_0x5011('0x4c')]('(')+0x1,_0x309e67[0x0]['lastIndexOf'](')'));var _0x337b5e=_0x309e67[0x1];channels[_0x5e2412['uniqueid']][_0x13a295]=_0x337b5e;}if(!_[_0x5011('0x4d')]([_0x5011('0x23'),_0x5011('0x4e'),_0x5011('0x4f'),_0x5011('0x46'),_0x5011('0x50')],_0x5e2412[_0x5011('0x44')][_0x5011('0x45')]())){channels[_0x5e2412[_0x5011('0x8')]][_0x5011('0x51')]=_0x5e2412[_0x5011('0x44')];channels[_0x5e2412[_0x5011('0x8')]][_0x5011('0x3f')]=_0x5e2412[_0x5011('0x48')];}}}catch(_0x2ee5d0){utils[_0x5011('0x1a')](_0x2ee5d0[_0x5011('0x1b')]);}}; \ No newline at end of file +var _0x57ed=['format','CALL|%s|%s|%s|%s|%s|%s|%s|%s','uniqueid','channel','type','destination','callerid','disposition','accountcode','then','UserId','request','CreateVoiceCallReport','newchannel','linkedid','calleridnum','exten','context','now','error','stack','newstate','isNil','channelstate','systemanswertime','transfer','answertime','hangup','calleridname','endtime','duration','starttime','billableseconds','attendedtransfer','localtwolinkedid','destinationchannel','userfield','origtransfererchannel','_attended','musiconholdstart','musiconholdstartAt','musiconholdstop','mohtime','diffTime','varset','xmd-originatecalleridnum','source','variable','xmd-phone','value','\x22\x20<','xmd-callerid-preview','xmd-callerid','xmd-queue','xmcs-queue','lastapplication','lastdata','queue','ContactId','xmd-cdrtype','routeid','sipcallid','application','toLowerCase','set','startsWith','appdata','cdr','split','lastIndexOf','includes','noop','execif','gotoif','./utils','FAILED','NO\x20ANSWER','ANSWERED','BUSY','info'];(function(_0x13843f,_0x50422d){var _0x1063ae=function(_0x12fd6b){while(--_0x12fd6b){_0x13843f['push'](_0x13843f['shift']());}};_0x1063ae(++_0x50422d);}(_0x57ed,0x18a));var _0xd57e=function(_0xa2cff5,_0x2d8521){_0xa2cff5=_0xa2cff5-0x0;var _0x21863e=_0x57ed[_0xa2cff5];return _0x21863e;};'use strict';var _=require('lodash');var util=require('util');var utils=require(_0xd57e('0x0'));var dispositions=['NO\x20ANSWER',_0xd57e('0x1'),'FAILED','NO\x20ANSWER',_0xd57e('0x2'),_0xd57e('0x2'),_0xd57e('0x3'),_0xd57e('0x4'),'FAILED',_0xd57e('0x1'),'FAILED'];var channels={};function writeDB(_0x2dabac){utils[_0xd57e('0x5')](util[_0xd57e('0x6')](_0xd57e('0x7'),_0x2dabac[_0xd57e('0x8')],_0x2dabac[_0xd57e('0x9')],_0x2dabac[_0xd57e('0xa')],_0x2dabac['accountcode'],_0x2dabac['source'],_0x2dabac[_0xd57e('0xb')],_0x2dabac[_0xd57e('0xc')],_0x2dabac[_0xd57e('0xd')]));if(_0x2dabac[_0xd57e('0xe')]){utils['getUserByInternal'](_0x2dabac[_0xd57e('0xe')])[_0xd57e('0xf')](function(_0x50ffd7){if(_0x50ffd7){_0x2dabac[_0xd57e('0x10')]=_0x50ffd7['id'];}utils[_0xd57e('0x11')](_0xd57e('0x12'),_0x2dabac);});}else{utils[_0xd57e('0x11')]('CreateVoiceCallReport',_0x2dabac);}if(channels[_0x2dabac['uniqueid']]){delete channels[_0x2dabac[_0xd57e('0x8')]];}}exports[_0xd57e('0x13')]=function(_0x1fe10e){try{if(_0x1fe10e[_0xd57e('0x8')]==_0x1fe10e[_0xd57e('0x14')]&&_0x1fe10e['channel']!='OutgoingSpoolFailed'){channels[_0x1fe10e[_0xd57e('0x8')]]={'uniqueid':_0x1fe10e[_0xd57e('0x8')],'accountcode':_0x1fe10e['accountcode'],'source':_0x1fe10e[_0xd57e('0x15')],'destination':_0x1fe10e[_0xd57e('0x16')],'destinationcontext':_0x1fe10e[_0xd57e('0x17')],'channel':_0x1fe10e['channel'],'starttime':utils[_0xd57e('0x18')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':'NO\x20ANSWER','amaflags':'DOCUMENTATION'};}}catch(_0x12b66e){utils[_0xd57e('0x19')](_0x12b66e[_0xd57e('0x1a')]);}};exports[_0xd57e('0x1b')]=function(_0xc74172){try{if(!_[_0xd57e('0x1c')](channels[_0xc74172['uniqueid']])&&_0xc74172[_0xd57e('0x1d')]==0x6){if(_['isNil'](channels[_0xc74172[_0xd57e('0x8')]][_0xd57e('0x1e')])){channels[_0xc74172['uniqueid']][_0xd57e('0x1e')]=utils[_0xd57e('0x18')]();}}else if(!_[_0xd57e('0x1c')](channels[_0xc74172[_0xd57e('0x14')]])&&_0xc74172['channelstate']==0x6&&_0xc74172[_0xd57e('0x17')]!=_0xd57e('0x1f')){channels[_0xc74172[_0xd57e('0x14')]][_0xd57e('0xe')]=_0xc74172[_0xd57e('0xe')];channels[_0xc74172[_0xd57e('0x14')]]['destinationchannel']=_0xc74172[_0xd57e('0x9')];if(_[_0xd57e('0x1c')](channels[_0xc74172['linkedid']][_0xd57e('0x20')])){channels[_0xc74172[_0xd57e('0x14')]]['answertime']=utils[_0xd57e('0x18')]();}channels[_0xc74172[_0xd57e('0x14')]][_0xd57e('0xd')]=dispositions[_['toNumber'](_0xc74172[_0xd57e('0x1d')])]||_0xd57e('0x3');}}catch(_0x470047){utils['error'](_0x470047[_0xd57e('0x1a')]);}};exports[_0xd57e('0x21')]=function(_0xc3b6d8){try{if(!_[_0xd57e('0x1c')](channels[_0xc3b6d8[_0xd57e('0x8')]])){if(_[_0xd57e('0x1c')](channels[_0xc3b6d8[_0xd57e('0x8')]][_0xd57e('0xc')])){channels[_0xc3b6d8[_0xd57e('0x8')]][_0xd57e('0xc')]=_0xc3b6d8[_0xd57e('0x22')]+'\x20<'+_0xc3b6d8[_0xd57e('0x15')]+'>';}channels[_0xc3b6d8[_0xd57e('0x8')]][_0xd57e('0x23')]=utils[_0xd57e('0x18')]();channels[_0xc3b6d8[_0xd57e('0x8')]][_0xd57e('0x24')]=utils['diffTime'](channels[_0xc3b6d8[_0xd57e('0x8')]]['endtime'],channels[_0xc3b6d8['uniqueid']][_0xd57e('0x25')]);channels[_0xc3b6d8[_0xd57e('0x8')]][_0xd57e('0x26')]=channels[_0xc3b6d8[_0xd57e('0x8')]][_0xd57e('0x20')]?utils['diffTime'](channels[_0xc3b6d8[_0xd57e('0x8')]]['endtime'],channels[_0xc3b6d8[_0xd57e('0x8')]]['answertime']):0x0;writeDB(channels[_0xc3b6d8[_0xd57e('0x8')]]);}}catch(_0x4cced5){utils['error'](_0x4cced5[_0xd57e('0x1a')]);}};exports[_0xd57e('0x27')]=function(_0x5e6ccc){try{if(!_[_0xd57e('0x1c')](channels[_0x5e6ccc['localtwolinkedid']])){if(channels[_0x5e6ccc['localtwolinkedid']][_0xd57e('0x9')]==_0x5e6ccc['transfereechannel']){channels[_0x5e6ccc[_0xd57e('0x28')]][_0xd57e('0x29')]=_0x5e6ccc['secondtransfererchannel'];channels[_0x5e6ccc['localtwolinkedid']][_0xd57e('0x2a')]='_attended';}else if(channels[_0x5e6ccc['localtwolinkedid']][_0xd57e('0x9')]=_0x5e6ccc['transfertargetchannel']){channels[_0x5e6ccc['localtwolinkedid']][_0xd57e('0x29')]=_0x5e6ccc[_0xd57e('0x2b')];channels[_0x5e6ccc[_0xd57e('0x28')]][_0xd57e('0x2a')]=_0xd57e('0x2c');}}}catch(_0x4c4935){utils[_0xd57e('0x19')](_0x4c4935[_0xd57e('0x1a')]);}};exports[_0xd57e('0x2d')]=function(_0x1d574b){try{if(!_['isNil'](channels[_0x1d574b[_0xd57e('0x8')]])){channels[_0x1d574b['uniqueid']][_0xd57e('0x2e')]=utils[_0xd57e('0x18')]();}}catch(_0x1ed2cb){utils['error'](_0x1ed2cb[_0xd57e('0x1a')]);}};exports[_0xd57e('0x2f')]=function(_0xf6f23a){try{if(!_[_0xd57e('0x1c')](channels[_0xf6f23a[_0xd57e('0x8')]])){if(!_[_0xd57e('0x1c')](channels[_0xf6f23a['uniqueid']][_0xd57e('0x2e')])){channels[_0xf6f23a[_0xd57e('0x8')]][_0xd57e('0x30')]+=utils[_0xd57e('0x31')](utils[_0xd57e('0x18')](),channels[_0xf6f23a[_0xd57e('0x8')]][_0xd57e('0x2e')]);delete channels[_0xf6f23a[_0xd57e('0x8')]][_0xd57e('0x2e')];}}}catch(_0x43f0ca){utils[_0xd57e('0x19')](_0x43f0ca[_0xd57e('0x1a')]);}};exports[_0xd57e('0x32')]=function(_0x3e0b87){try{if(!_[_0xd57e('0x1c')](channels[_0x3e0b87[_0xd57e('0x8')]])){if(!_[_0xd57e('0x1c')](_0x3e0b87['variable'][_0xd57e('0x33')])){channels[_0x3e0b87[_0xd57e('0x8')]][_0xd57e('0x34')]=_0x3e0b87['value'];}if(!_[_0xd57e('0x1c')](_0x3e0b87[_0xd57e('0x35')][_0xd57e('0x36')])){channels[_0x3e0b87[_0xd57e('0x8')]][_0xd57e('0xb')]=_0x3e0b87[_0xd57e('0x37')];channels[_0x3e0b87[_0xd57e('0x8')]][_0xd57e('0xc')]='\x22'+_0x3e0b87[_0xd57e('0x37')]+_0xd57e('0x38')+_0x3e0b87[_0xd57e('0x37')]+'>';}if(!_['isNil'](_0x3e0b87[_0xd57e('0x35')][_0xd57e('0x39')])||!_[_0xd57e('0x1c')](_0x3e0b87['variable'][_0xd57e('0x3a')])){channels[_0x3e0b87[_0xd57e('0x8')]][_0xd57e('0xc')]=_0x3e0b87[_0xd57e('0x37')];}if(!_['isNil'](_0x3e0b87['variable'][_0xd57e('0x3b')])||!_[_0xd57e('0x1c')](_0x3e0b87[_0xd57e('0x35')][_0xd57e('0x3c')])){channels[_0x3e0b87[_0xd57e('0x8')]][_0xd57e('0x3d')]='Queue';channels[_0x3e0b87['uniqueid']][_0xd57e('0x3e')]=_0x3e0b87[_0xd57e('0x37')];channels[_0x3e0b87[_0xd57e('0x8')]][_0xd57e('0x3f')]=!![];}if(!_['isNil'](_0x3e0b87[_0xd57e('0x35')]['xmd-contactid'])){channels[_0x3e0b87[_0xd57e('0x8')]][_0xd57e('0x40')]=_0x3e0b87['value'];}if(!_[_0xd57e('0x1c')](_0x3e0b87['variable'][_0xd57e('0x41')])){channels[_0x3e0b87['uniqueid']]['type']=_0x3e0b87[_0xd57e('0x37')];}if(!_[_0xd57e('0x1c')](_0x3e0b87[_0xd57e('0x35')]['outboundrouteid'])){channels[_0x3e0b87[_0xd57e('0x8')]][_0xd57e('0x42')]=_0x3e0b87[_0xd57e('0x37')];}if(!_[_0xd57e('0x1c')](_0x3e0b87['variable'][_0xd57e('0x43')])){channels[_0x3e0b87['uniqueid']]['sipcallid']=_0x3e0b87['value'];}}}catch(_0x10fed){utils[_0xd57e('0x19')](_0x10fed[_0xd57e('0x1a')]);}};exports['newexten']=function(_0x4423e0){try{if(!_[_0xd57e('0x1c')](channels[_0x4423e0[_0xd57e('0x8')]])){if(_0x4423e0[_0xd57e('0x44')][_0xd57e('0x45')]()==_0xd57e('0x46')&&_[_0xd57e('0x47')](_0x4423e0[_0xd57e('0x48')][_0xd57e('0x45')](),_0xd57e('0x49'))){var _0x3f48a8=_0x4423e0[_0xd57e('0x48')][_0xd57e('0x4a')]('=');var _0x1de715=_0x3f48a8[0x0]['substring'](_0x3f48a8[0x0][_0xd57e('0x4b')]('(')+0x1,_0x3f48a8[0x0][_0xd57e('0x4b')](')'));var _0x2f5379=_0x3f48a8[0x1];channels[_0x4423e0[_0xd57e('0x8')]][_0x1de715]=_0x2f5379;}if(!_[_0xd57e('0x4c')]([_0xd57e('0x21'),_0xd57e('0x4d'),_0xd57e('0x4e'),_0xd57e('0x46'),_0xd57e('0x4f')],_0x4423e0[_0xd57e('0x44')][_0xd57e('0x45')]())){channels[_0x4423e0[_0xd57e('0x8')]][_0xd57e('0x3d')]=_0x4423e0[_0xd57e('0x44')];channels[_0x4423e0[_0xd57e('0x8')]][_0xd57e('0x3e')]=_0x4423e0[_0xd57e('0x48')];}}}catch(_0x1e1057){utils[_0xd57e('0x19')](_0x1e1057[_0xd57e('0x1a')]);}}; \ No newline at end of file diff --git a/server/services/xdr/core.controller.js b/server/services/xdr/core.controller.js index 0720373..26e6fb4 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 _0xeff8=['fullybooted','FULLYBOOTED','error','close','managerevent','./utils','lodash','info','CONNECTED','shutdown','SHUTDOWN'];(function(_0x2f7516,_0x34a7e3){var _0x32e9f5=function(_0x1221b6){while(--_0x1221b6){_0x2f7516['push'](_0x2f7516['shift']());}};_0x32e9f5(++_0x34a7e3);}(_0xeff8,0x186));var _0x8eff=function(_0x215e65,_0x183f97){_0x215e65=_0x215e65-0x0;var _0xa85842=_0xeff8[_0x215e65];return _0xa85842;};'use strict';var utils=require(_0x8eff('0x0'));var _=require(_0x8eff('0x1'));exports['connect']=function(){utils[_0x8eff('0x2')](_0x8eff('0x3'));};exports[_0x8eff('0x4')]=function(){utils['info'](_0x8eff('0x5'));};exports[_0x8eff('0x6')]=function(){utils[_0x8eff('0x2')](_0x8eff('0x7'));};exports['error']=function(_0x469641){utils[_0x8eff('0x8')](_0x469641);};exports[_0x8eff('0x9')]=function(){utils[_0x8eff('0x2')]('CLOSE');};exports[_0x8eff('0xa')]=function(_0x19557f){}; \ No newline at end of file +var _0xd046=['lodash','connect','info','shutdown','fullybooted','FULLYBOOTED','error','close','managerevent'];(function(_0x494336,_0x46f9ba){var _0x255363=function(_0x130031){while(--_0x130031){_0x494336['push'](_0x494336['shift']());}};_0x255363(++_0x46f9ba);}(_0xd046,0x129));var _0x6d04=function(_0x1196d7,_0x5f7bfb){_0x1196d7=_0x1196d7-0x0;var _0x343408=_0xd046[_0x1196d7];return _0x343408;};'use strict';var utils=require('./utils');var _=require(_0x6d04('0x0'));exports[_0x6d04('0x1')]=function(){utils[_0x6d04('0x2')]('CONNECTED');};exports[_0x6d04('0x3')]=function(){utils['info']('SHUTDOWN');};exports[_0x6d04('0x4')]=function(){utils['info'](_0x6d04('0x5'));};exports['error']=function(_0x4bacb1){utils[_0x6d04('0x6')](_0x4bacb1);};exports[_0x6d04('0x7')]=function(){utils['info']('CLOSE');};exports[_0x6d04('0x8')]=function(_0x42aa22){}; \ No newline at end of file diff --git a/server/services/xdr/dials.controller.js b/server/services/xdr/dials.controller.js index 41f38e5..e25f1d1 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 _0x77b7=['diffTime','endtime','holdtime','lodash','util','./utils','info','DIAL|%s|%s|%s|%s|%s|%s','uniqueid','channel','dialstring','calleridnum','connectedlinenum','dialstatus','request','CreateVoiceDialReport','newexten','application','set','startsWith','appdata','toLowerCase','cdr(routeid)','split','error','stack','varset','isNil','value','dialbegin','assign','starttime','lastevent','called','dialend','answertime','now','connect','hangup','complete','duration'];(function(_0x332188,_0x39d66b){var _0x2c0501=function(_0x5accb9){while(--_0x5accb9){_0x332188['push'](_0x332188['shift']());}};_0x2c0501(++_0x39d66b);}(_0x77b7,0x19d));var _0x777b=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x77b7[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0x777b('0x0'));var util=require(_0x777b('0x1'));var utils=require(_0x777b('0x2'));var dials={};function writeDB(_0x33f35c){utils[_0x777b('0x3')](util['format'](_0x777b('0x4'),_0x33f35c[_0x777b('0x5')],_0x33f35c[_0x777b('0x6')],_0x33f35c[_0x777b('0x7')],_0x33f35c[_0x777b('0x8')],_0x33f35c[_0x777b('0x9')],_0x33f35c[_0x777b('0xa')]));utils[_0x777b('0xb')](_0x777b('0xc'),_0x33f35c);delete dials[_0x33f35c[_0x777b('0x5')]];}exports[_0x777b('0xd')]=function(_0x4628ff){try{if(_0x4628ff[_0x777b('0xe')]['toLowerCase']()==_0x777b('0xf')&&_[_0x777b('0x10')](_0x4628ff[_0x777b('0x11')][_0x777b('0x12')](),_0x777b('0x13'))){var _0x280135=_0x4628ff[_0x777b('0x11')][_0x777b('0x14')]('=');dials[_0x4628ff[_0x777b('0x5')]]={'routeId':_0x280135[0x1]};}}catch(_0x17cde1){utils[_0x777b('0x15')](_0x17cde1[_0x777b('0x16')]);}};exports[_0x777b('0x17')]=function(_0x1583ed){try{if(!_[_0x777b('0x18')](_0x1583ed['variable']['outboundrouteid'])){dials[_0x1583ed[_0x777b('0x5')]]={'routeId':_0x1583ed[_0x777b('0x19')]};}}catch(_0x43eab1){utils[_0x777b('0x15')](_0x43eab1['stack']);}};exports[_0x777b('0x1a')]=function(_0x4e676e){try{if(!_[_0x777b('0x18')](dials[_0x4e676e[_0x777b('0x5')]])){dials[_0x4e676e[_0x777b('0x5')]]=_[_0x777b('0x1b')](dials[_0x4e676e[_0x777b('0x5')]],_0x4e676e);dials[_0x4e676e['uniqueid']][_0x777b('0x1c')]=utils['now']();dials[_0x4e676e[_0x777b('0x5')]][_0x777b('0x1d')]=_0x777b('0x1e');}}catch(_0x15d870){utils[_0x777b('0x15')](_0x15d870[_0x777b('0x16')]);}};exports[_0x777b('0x1f')]=function(_0x38226c){try{if(!_[_0x777b('0x18')](dials[_0x38226c['uniqueid']])){dials[_0x38226c[_0x777b('0x5')]][_0x777b('0xa')]=_0x38226c['dialstatus'];if(_0x38226c['dialstatus']=='ANSWER'){dials[_0x38226c[_0x777b('0x5')]]=_[_0x777b('0x1b')](dials[_0x38226c[_0x777b('0x5')]],_0x38226c);dials[_0x38226c[_0x777b('0x5')]][_0x777b('0x20')]=utils[_0x777b('0x21')]();dials[_0x38226c[_0x777b('0x5')]]['lastevent']=_0x777b('0x22');}}}catch(_0x3abbdf){utils[_0x777b('0x15')](_0x3abbdf[_0x777b('0x16')]);}};exports[_0x777b('0x23')]=function(_0x2fc7c4){try{if(!_['isNil'](dials[_0x2fc7c4[_0x777b('0x5')]])){dials[_0x2fc7c4['uniqueid']]=_[_0x777b('0x1b')](dials[_0x2fc7c4[_0x777b('0x5')]],{'endtime':utils[_0x777b('0x21')](),'lastevent':_0x777b('0x24')});dials[_0x2fc7c4[_0x777b('0x5')]][_0x777b('0x25')]=utils[_0x777b('0x26')](dials[_0x2fc7c4[_0x777b('0x5')]][_0x777b('0x27')],dials[_0x2fc7c4[_0x777b('0x5')]][_0x777b('0x1c')]);dials[_0x2fc7c4[_0x777b('0x5')]][_0x777b('0x28')]=utils[_0x777b('0x26')](dials[_0x2fc7c4[_0x777b('0x5')]]['answertime']||dials[_0x2fc7c4['uniqueid']][_0x777b('0x27')],dials[_0x2fc7c4[_0x777b('0x5')]][_0x777b('0x1c')]);dials[_0x2fc7c4[_0x777b('0x5')]]['billableseconds']=dials[_0x2fc7c4['uniqueid']][_0x777b('0x20')]?utils[_0x777b('0x26')](dials[_0x2fc7c4[_0x777b('0x5')]][_0x777b('0x27')],dials[_0x2fc7c4['uniqueid']][_0x777b('0x20')]):0x0;writeDB(dials[_0x2fc7c4['uniqueid']]);}}catch(_0x1ac2c2){utils[_0x777b('0x15')](_0x1ac2c2[_0x777b('0x16')]);}}; \ No newline at end of file +var _0x84f2=['lodash','util','./utils','info','uniqueid','channel','dialstring','calleridnum','connectedlinenum','dialstatus','request','CreateVoiceDialReport','application','toLowerCase','startsWith','appdata','cdr(routeid)','split','error','stack','isNil','variable','value','dialbegin','assign','starttime','now','lastevent','called','dialend','answertime','connect','hangup','duration','diffTime','holdtime','endtime','billableseconds'];(function(_0x7799b,_0x41fe65){var _0x2b9952=function(_0x53287e){while(--_0x53287e){_0x7799b['push'](_0x7799b['shift']());}};_0x2b9952(++_0x41fe65);}(_0x84f2,0x1ee));var _0x284f=function(_0x581332,_0x588a7b){_0x581332=_0x581332-0x0;var _0xfa58b4=_0x84f2[_0x581332];return _0xfa58b4;};'use strict';var _=require(_0x284f('0x0'));var util=require(_0x284f('0x1'));var utils=require(_0x284f('0x2'));var dials={};function writeDB(_0x580768){utils[_0x284f('0x3')](util['format']('DIAL|%s|%s|%s|%s|%s|%s',_0x580768[_0x284f('0x4')],_0x580768[_0x284f('0x5')],_0x580768[_0x284f('0x6')],_0x580768[_0x284f('0x7')],_0x580768[_0x284f('0x8')],_0x580768[_0x284f('0x9')]));utils[_0x284f('0xa')](_0x284f('0xb'),_0x580768);delete dials[_0x580768[_0x284f('0x4')]];}exports['newexten']=function(_0x3f7845){try{if(_0x3f7845[_0x284f('0xc')][_0x284f('0xd')]()=='set'&&_[_0x284f('0xe')](_0x3f7845[_0x284f('0xf')][_0x284f('0xd')](),_0x284f('0x10'))){var _0xe35c95=_0x3f7845[_0x284f('0xf')][_0x284f('0x11')]('=');dials[_0x3f7845[_0x284f('0x4')]]={'routeId':_0xe35c95[0x1]};}}catch(_0x3e988f){utils[_0x284f('0x12')](_0x3e988f[_0x284f('0x13')]);}};exports['varset']=function(_0x1ffb08){try{if(!_[_0x284f('0x14')](_0x1ffb08[_0x284f('0x15')]['outboundrouteid'])){dials[_0x1ffb08['uniqueid']]={'routeId':_0x1ffb08[_0x284f('0x16')]};}}catch(_0x5455ec){utils[_0x284f('0x12')](_0x5455ec[_0x284f('0x13')]);}};exports[_0x284f('0x17')]=function(_0x4b234c){try{if(!_[_0x284f('0x14')](dials[_0x4b234c[_0x284f('0x4')]])){dials[_0x4b234c['uniqueid']]=_[_0x284f('0x18')](dials[_0x4b234c[_0x284f('0x4')]],_0x4b234c);dials[_0x4b234c[_0x284f('0x4')]][_0x284f('0x19')]=utils[_0x284f('0x1a')]();dials[_0x4b234c['uniqueid']][_0x284f('0x1b')]=_0x284f('0x1c');}}catch(_0x466cf3){utils[_0x284f('0x12')](_0x466cf3['stack']);}};exports[_0x284f('0x1d')]=function(_0x1094b5){try{if(!_[_0x284f('0x14')](dials[_0x1094b5['uniqueid']])){dials[_0x1094b5[_0x284f('0x4')]][_0x284f('0x9')]=_0x1094b5[_0x284f('0x9')];if(_0x1094b5[_0x284f('0x9')]=='ANSWER'){dials[_0x1094b5[_0x284f('0x4')]]=_[_0x284f('0x18')](dials[_0x1094b5['uniqueid']],_0x1094b5);dials[_0x1094b5[_0x284f('0x4')]][_0x284f('0x1e')]=utils['now']();dials[_0x1094b5['uniqueid']][_0x284f('0x1b')]=_0x284f('0x1f');}}}catch(_0x5debda){utils[_0x284f('0x12')](_0x5debda[_0x284f('0x13')]);}};exports[_0x284f('0x20')]=function(_0x2e1240){try{if(!_[_0x284f('0x14')](dials[_0x2e1240[_0x284f('0x4')]])){dials[_0x2e1240[_0x284f('0x4')]]=_[_0x284f('0x18')](dials[_0x2e1240[_0x284f('0x4')]],{'endtime':utils[_0x284f('0x1a')](),'lastevent':'complete'});dials[_0x2e1240[_0x284f('0x4')]][_0x284f('0x21')]=utils[_0x284f('0x22')](dials[_0x2e1240[_0x284f('0x4')]]['endtime'],dials[_0x2e1240[_0x284f('0x4')]][_0x284f('0x19')]);dials[_0x2e1240['uniqueid']][_0x284f('0x23')]=utils[_0x284f('0x22')](dials[_0x2e1240[_0x284f('0x4')]][_0x284f('0x1e')]||dials[_0x2e1240['uniqueid']][_0x284f('0x24')],dials[_0x2e1240[_0x284f('0x4')]][_0x284f('0x19')]);dials[_0x2e1240[_0x284f('0x4')]][_0x284f('0x25')]=dials[_0x2e1240[_0x284f('0x4')]][_0x284f('0x1e')]?utils[_0x284f('0x22')](dials[_0x2e1240[_0x284f('0x4')]][_0x284f('0x24')],dials[_0x2e1240[_0x284f('0x4')]][_0x284f('0x1e')]):0x0;writeDB(dials[_0x2e1240['uniqueid']]);}}catch(_0x55be58){utils['error'](_0x55be58[_0x284f('0x13')]);}}; \ No newline at end of file diff --git a/server/services/xdr/index.js b/server/services/xdr/index.js index b65ecb2..ad7a803 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 _0x97d1=['XDR\x20DISABLED','./agents.controller','./calls.controller','./queues.controller','./recordings.controller','./transfers.controller','./core.controller','connect','shutdown','fullybooted','error','close','managerevent','devicestatechange','agentcalled','agentringnoanswer','agentconnect','agentcomplete','queuecallerabandon','queuecallerjoin','queuecallerleave','musiconholdstart','musiconholdstop','newstate','hangup','cdr','blindtransfer','attendedtransfer','varset','newexten','newchannel','dialbegin','dialend','asterisk-manager','../../config/environment','./utils','port','asterisk','username','password','keepConnected','xdr','disabled','info'];(function(_0x5f0089,_0x227e2c){var _0x193892=function(_0x24051f){while(--_0x24051f){_0x5f0089['push'](_0x5f0089['shift']());}};_0x193892(++_0x227e2c);}(_0x97d1,0x155));var _0x197d=function(_0x46af7e,_0x3e32c7){_0x46af7e=_0x46af7e-0x0;var _0x4c0447=_0x97d1[_0x46af7e];return _0x4c0447;};var AsteriskManager=require(_0x197d('0x0'));var config=require(_0x197d('0x1'));var utils=require(_0x197d('0x2'));var ami=new AsteriskManager(config['asterisk'][_0x197d('0x3')],config[_0x197d('0x4')]['ip'],config[_0x197d('0x4')][_0x197d('0x5')],config[_0x197d('0x4')][_0x197d('0x6')],!![]);ami[_0x197d('0x7')]();if(config[_0x197d('0x8')]&&config['xdr'][_0x197d('0x9')]){utils[_0x197d('0xa')](_0x197d('0xb'));}else{var agents=require(_0x197d('0xc'));var calls=require(_0x197d('0xd'));var queues=require(_0x197d('0xe'));var recordings=require(_0x197d('0xf'));var members=require('./members.controller');var dials=require('./dials.controller');var transfers=require(_0x197d('0x10'));var core=require(_0x197d('0x11'));ami['on'](_0x197d('0x12'),core['connect']);ami['on'](_0x197d('0x13'),core[_0x197d('0x13')]);ami['on'](_0x197d('0x14'),core[_0x197d('0x14')]);ami['on'](_0x197d('0x15'),core[_0x197d('0x15')]);ami['on'](_0x197d('0x16'),core['close']);ami['on'](_0x197d('0x17'),core['managerevent']);ami['on'](_0x197d('0x18'),function(_0x59d092){try{members[_0x197d('0x18')](_0x59d092);}catch(_0x4244c4){utils[_0x197d('0x15')](_0x4244c4);}});ami['on'](_0x197d('0x19'),function(_0x352b91){try{agents[_0x197d('0x19')](_0x352b91);}catch(_0x5d3171){utils[_0x197d('0x15')](_0x5d3171);}});ami['on'](_0x197d('0x1a'),function(_0x3be416){try{agents['agentringnoanswer'](_0x3be416);}catch(_0x158391){utils[_0x197d('0x15')](_0x158391);}});ami['on'](_0x197d('0x1b'),function(_0xdbf118){try{agents[_0x197d('0x1b')](_0xdbf118);queues[_0x197d('0x1b')](_0xdbf118);}catch(_0x22ef4a){utils[_0x197d('0x15')](_0x22ef4a);}});ami['on'](_0x197d('0x1c'),function(_0x1418df){try{agents[_0x197d('0x1c')](_0x1418df);queues[_0x197d('0x1c')](_0x1418df);members[_0x197d('0x1c')](_0x1418df);}catch(_0x31317f){utils['error'](_0x31317f);}});ami['on'](_0x197d('0x1d'),function(_0x4cea47){try{agents[_0x197d('0x1d')](_0x4cea47);queues[_0x197d('0x1d')](_0x4cea47);}catch(_0xe39be1){utils[_0x197d('0x15')](_0xe39be1);}});ami['on'](_0x197d('0x1e'),function(_0x361e93){try{queues[_0x197d('0x1e')](_0x361e93);recordings[_0x197d('0x1e')](_0x361e93);}catch(_0x5280ec){utils['error'](_0x5280ec);}});ami['on']('queuecallerleave',function(_0x58f6a7){try{queues[_0x197d('0x1f')](_0x58f6a7);}catch(_0x5c0ee7){utils[_0x197d('0x15')](_0x5c0ee7);}});ami['on'](_0x197d('0x20'),function(_0x328968){try{queues[_0x197d('0x20')](_0x328968);calls[_0x197d('0x20')](_0x328968);}catch(_0x5e9589){utils['error'](_0x5e9589);}});ami['on'](_0x197d('0x21'),function(_0x84750a){try{queues[_0x197d('0x21')](_0x84750a);calls[_0x197d('0x21')](_0x84750a);}catch(_0x1cac3f){utils[_0x197d('0x15')](_0x1cac3f);}});ami['on'](_0x197d('0x22'),function(_0x2ffe31){try{calls[_0x197d('0x22')](_0x2ffe31);recordings[_0x197d('0x22')](_0x2ffe31);}catch(_0x3d3dd3){utils[_0x197d('0x15')](_0x3d3dd3);}});ami['on']('hangup',function(_0x14fd34){try{calls['hangup'](_0x14fd34);recordings['hangup'](_0x14fd34);dials[_0x197d('0x23')](_0x14fd34);agents[_0x197d('0x23')](_0x14fd34);queues[_0x197d('0x23')](_0x14fd34);}catch(_0x36140a){utils[_0x197d('0x15')](_0x36140a);}});ami['on'](_0x197d('0x24'),function(_0x30078a){try{members[_0x197d('0x24')](_0x30078a);}catch(_0x1f5e73){utils[_0x197d('0x15')](_0x1f5e73);}});ami['on'](_0x197d('0x25'),function(_0x37a05e){try{queues[_0x197d('0x25')](_0x37a05e);agents[_0x197d('0x25')](_0x37a05e);transfers[_0x197d('0x25')](_0x37a05e);}catch(_0x51da3b){utils['error'](_0x51da3b);}});ami['on'](_0x197d('0x26'),function(_0x566f79){try{queues[_0x197d('0x26')](_0x566f79);transfers[_0x197d('0x26')](_0x566f79);agents[_0x197d('0x26')](_0x566f79);calls[_0x197d('0x26')](_0x566f79);}catch(_0x3f3d17){utils[_0x197d('0x15')](_0x3f3d17);}});ami['on']('varset',function(_0x1ad800){try{queues[_0x197d('0x27')](_0x1ad800);recordings[_0x197d('0x27')](_0x1ad800);calls[_0x197d('0x27')](_0x1ad800);dials[_0x197d('0x27')](_0x1ad800);}catch(_0x2e5833){utils[_0x197d('0x15')](_0x2e5833);}});ami['on'](_0x197d('0x28'),function(_0xcf1a26){try{calls[_0x197d('0x28')](_0xcf1a26);recordings[_0x197d('0x28')](_0xcf1a26);dials[_0x197d('0x28')](_0xcf1a26);}catch(_0x384b0b){utils[_0x197d('0x15')](_0x384b0b);}});ami['on'](_0x197d('0x29'),function(_0x5500ae){try{calls['newchannel'](_0x5500ae);recordings[_0x197d('0x29')](_0x5500ae);}catch(_0xcc48ab){utils[_0x197d('0x15')](_0xcc48ab);}});ami['on'](_0x197d('0x2a'),function(_0x28c787){try{dials[_0x197d('0x2a')](_0x28c787);}catch(_0x5f570c){utils[_0x197d('0x15')](_0x5f570c);}});ami['on'](_0x197d('0x2b'),function(_0x47fe87){try{dials['dialend'](_0x47fe87);}catch(_0x526394){utils[_0x197d('0x15')](_0x526394);}});} \ No newline at end of file +var _0x2732=['xdr','disabled','info','XDR\x20DISABLED','./agents.controller','./calls.controller','./queues.controller','./recordings.controller','./dials.controller','./transfers.controller','./core.controller','shutdown','fullybooted','error','close','managerevent','devicestatechange','agentcalled','agentringnoanswer','agentconnect','agentcomplete','queuecallerabandon','queuecallerjoin','queuecallerleave','musiconholdstart','musiconholdstop','newstate','hangup','cdr','blindtransfer','attendedtransfer','varset','newexten','newchannel','dialbegin','dialend','asterisk-manager','../../config/environment','./utils','asterisk','port','username','password','keepConnected'];(function(_0x35a140,_0x3aeac6){var _0x30ab82=function(_0x15a7c3){while(--_0x15a7c3){_0x35a140['push'](_0x35a140['shift']());}};_0x30ab82(++_0x3aeac6);}(_0x2732,0x1b0));var _0x2273=function(_0x427fe8,_0x151df3){_0x427fe8=_0x427fe8-0x0;var _0x2185da=_0x2732[_0x427fe8];return _0x2185da;};var AsteriskManager=require(_0x2273('0x0'));var config=require(_0x2273('0x1'));var utils=require(_0x2273('0x2'));var ami=new AsteriskManager(config[_0x2273('0x3')][_0x2273('0x4')],config[_0x2273('0x3')]['ip'],config[_0x2273('0x3')][_0x2273('0x5')],config[_0x2273('0x3')][_0x2273('0x6')],!![]);ami[_0x2273('0x7')]();if(config[_0x2273('0x8')]&&config[_0x2273('0x8')][_0x2273('0x9')]){utils[_0x2273('0xa')](_0x2273('0xb'));}else{var agents=require(_0x2273('0xc'));var calls=require(_0x2273('0xd'));var queues=require(_0x2273('0xe'));var recordings=require(_0x2273('0xf'));var members=require('./members.controller');var dials=require(_0x2273('0x10'));var transfers=require(_0x2273('0x11'));var core=require(_0x2273('0x12'));ami['on']('connect',core['connect']);ami['on'](_0x2273('0x13'),core[_0x2273('0x13')]);ami['on'](_0x2273('0x14'),core[_0x2273('0x14')]);ami['on'](_0x2273('0x15'),core[_0x2273('0x15')]);ami['on']('close',core[_0x2273('0x16')]);ami['on'](_0x2273('0x17'),core[_0x2273('0x17')]);ami['on'](_0x2273('0x18'),function(_0x4a5164){try{members[_0x2273('0x18')](_0x4a5164);}catch(_0x3ce27e){utils[_0x2273('0x15')](_0x3ce27e);}});ami['on'](_0x2273('0x19'),function(_0x4c2ee9){try{agents[_0x2273('0x19')](_0x4c2ee9);}catch(_0x31f8d8){utils[_0x2273('0x15')](_0x31f8d8);}});ami['on'](_0x2273('0x1a'),function(_0x21a2f4){try{agents[_0x2273('0x1a')](_0x21a2f4);}catch(_0x4bac93){utils[_0x2273('0x15')](_0x4bac93);}});ami['on']('agentconnect',function(_0x207434){try{agents['agentconnect'](_0x207434);queues[_0x2273('0x1b')](_0x207434);}catch(_0x3ec2a3){utils[_0x2273('0x15')](_0x3ec2a3);}});ami['on']('agentcomplete',function(_0x47f37b){try{agents[_0x2273('0x1c')](_0x47f37b);queues[_0x2273('0x1c')](_0x47f37b);members[_0x2273('0x1c')](_0x47f37b);}catch(_0x35eb67){utils[_0x2273('0x15')](_0x35eb67);}});ami['on']('queuecallerabandon',function(_0x1513cd){try{agents[_0x2273('0x1d')](_0x1513cd);queues['queuecallerabandon'](_0x1513cd);}catch(_0x175cfe){utils[_0x2273('0x15')](_0x175cfe);}});ami['on'](_0x2273('0x1e'),function(_0x4a2640){try{queues[_0x2273('0x1e')](_0x4a2640);recordings[_0x2273('0x1e')](_0x4a2640);}catch(_0xece0c3){utils[_0x2273('0x15')](_0xece0c3);}});ami['on'](_0x2273('0x1f'),function(_0x23e367){try{queues[_0x2273('0x1f')](_0x23e367);}catch(_0x427293){utils[_0x2273('0x15')](_0x427293);}});ami['on'](_0x2273('0x20'),function(_0x111238){try{queues[_0x2273('0x20')](_0x111238);calls['musiconholdstart'](_0x111238);}catch(_0x440fed){utils['error'](_0x440fed);}});ami['on'](_0x2273('0x21'),function(_0x3c74a3){try{queues['musiconholdstop'](_0x3c74a3);calls['musiconholdstop'](_0x3c74a3);}catch(_0x3fef63){utils['error'](_0x3fef63);}});ami['on'](_0x2273('0x22'),function(_0x638a2b){try{calls['newstate'](_0x638a2b);recordings[_0x2273('0x22')](_0x638a2b);}catch(_0x42677e){utils['error'](_0x42677e);}});ami['on'](_0x2273('0x23'),function(_0x309679){try{calls[_0x2273('0x23')](_0x309679);recordings[_0x2273('0x23')](_0x309679);dials[_0x2273('0x23')](_0x309679);agents['hangup'](_0x309679);queues[_0x2273('0x23')](_0x309679);}catch(_0x3aa96d){utils[_0x2273('0x15')](_0x3aa96d);}});ami['on'](_0x2273('0x24'),function(_0x42351f){try{members[_0x2273('0x24')](_0x42351f);}catch(_0x1afa4e){utils[_0x2273('0x15')](_0x1afa4e);}});ami['on'](_0x2273('0x25'),function(_0x4159af){try{queues[_0x2273('0x25')](_0x4159af);agents[_0x2273('0x25')](_0x4159af);transfers['blindtransfer'](_0x4159af);}catch(_0x4206e9){utils['error'](_0x4206e9);}});ami['on'](_0x2273('0x26'),function(_0x5eb874){try{queues[_0x2273('0x26')](_0x5eb874);transfers[_0x2273('0x26')](_0x5eb874);agents[_0x2273('0x26')](_0x5eb874);calls[_0x2273('0x26')](_0x5eb874);}catch(_0x260f21){utils[_0x2273('0x15')](_0x260f21);}});ami['on'](_0x2273('0x27'),function(_0x1ba7bd){try{queues[_0x2273('0x27')](_0x1ba7bd);recordings[_0x2273('0x27')](_0x1ba7bd);calls[_0x2273('0x27')](_0x1ba7bd);dials[_0x2273('0x27')](_0x1ba7bd);}catch(_0x26c913){utils['error'](_0x26c913);}});ami['on'](_0x2273('0x28'),function(_0x41e1ad){try{calls[_0x2273('0x28')](_0x41e1ad);recordings[_0x2273('0x28')](_0x41e1ad);dials['newexten'](_0x41e1ad);}catch(_0x343d77){utils['error'](_0x343d77);}});ami['on']('newchannel',function(_0x5df3c1){try{calls[_0x2273('0x29')](_0x5df3c1);recordings[_0x2273('0x29')](_0x5df3c1);}catch(_0x54c2e0){utils['error'](_0x54c2e0);}});ami['on'](_0x2273('0x2a'),function(_0x3f8fdb){try{dials[_0x2273('0x2a')](_0x3f8fdb);}catch(_0x5a4677){utils['error'](_0x5a4677);}});ami['on'](_0x2273('0x2b'),function(_0x9839b2){try{dials['dialend'](_0x9839b2);}catch(_0x53b086){utils[_0x2273('0x15')](_0x53b086);}});} \ No newline at end of file diff --git a/server/services/xdr/members.controller.js b/server/services/xdr/members.controller.js index 5399c6a..a2c7d79 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 _0x6413=['Queue:','info','MEMBER|%s|%s|%s|%s|%s|%s','uniqueid','interface','channel','data2','membername','type','getUserByInterface','then','name','internal','request','CreateMemberReport','error','some','devicestatechange','state','INUSE','BUSY','voice','TALKING','now','agent','NOT_INUSE','isNil','device','diffTime','agentcomplete','assign','split','source','data3','data1','destination','lodash','util','./utils','Local/_attended@transfer'];(function(_0x598a6f,_0x263c42){var _0x47c368=function(_0x432628){while(--_0x432628){_0x598a6f['push'](_0x598a6f['shift']());}};_0x47c368(++_0x263c42);}(_0x6413,0xc4));var _0x3641=function(_0x48f53b,_0x160136){_0x48f53b=_0x48f53b-0x0;var _0x549971=_0x6413[_0x48f53b];return _0x549971;};'use strict';var _=require(_0x3641('0x0'));var util=require(_0x3641('0x1'));var utils=require(_0x3641('0x2'));var members={};var exclude=[_0x3641('0x3'),_0x3641('0x4')];function writeDB(_0x4fc45d){utils[_0x3641('0x5')](util['format'](_0x3641('0x6'),_0x4fc45d[_0x3641('0x7')],_0x4fc45d[_0x3641('0x8')],_0x4fc45d[_0x3641('0x9')],_0x4fc45d[_0x3641('0xa')],_0x4fc45d[_0x3641('0xb')],_0x4fc45d[_0x3641('0xc')]));if(_0x4fc45d[_0x3641('0x8')]){utils[_0x3641('0xd')](_0x4fc45d[_0x3641('0x8')])[_0x3641('0xe')](function(_0x398556){if(_0x398556){_0x4fc45d[_0x3641('0xb')]=_0x398556[_0x3641('0xf')];_0x4fc45d[_0x3641('0x10')]=_0x398556[_0x3641('0x10')];utils[_0x3641('0x11')](_0x3641('0x12'),_0x4fc45d);}else{utils['getUserByName'](_0x4fc45d[_0x3641('0x8')]['split']('/')[0x1])[_0x3641('0xe')](function(_0x353e12){if(_0x353e12){_0x4fc45d[_0x3641('0xb')]=_0x353e12[_0x3641('0xf')];_0x4fc45d[_0x3641('0x10')]=_0x353e12['internal'];utils['request'](_0x3641('0x12'),_0x4fc45d);}});}})['catch'](function(_0xfe6b91){utils[_0x3641('0x13')](_0xfe6b91);});}delete members[_0x4fc45d[_0x3641('0x8')]];}function startsWith(_0x27c794,_0x4af7a4){return _[_0x3641('0x14')](_0x27c794,function(_0x442325){return _['startsWith'](_0x4af7a4,_0x442325);});}exports[_0x3641('0x15')]=function(_0x1f457b){switch(_0x1f457b[_0x3641('0x16')]){case _0x3641('0x17'):case _0x3641('0x18'):if(!startsWith(exclude,_0x1f457b['device'])){members[_0x1f457b['device']]={'channel':_0x3641('0x19'),'interface':_0x1f457b['device'],'type':_0x3641('0x1a'),'enterAt':utils[_0x3641('0x1b')](),'role':_0x3641('0x1c')};}break;case _0x3641('0x1d'):if(!_[_0x3641('0x1e')](members[_0x1f457b[_0x3641('0x1f')]])){members[_0x1f457b[_0x3641('0x1f')]]['exitAt']=utils['now']();members[_0x1f457b[_0x3641('0x1f')]]['duration']=utils[_0x3641('0x20')](members[_0x1f457b[_0x3641('0x1f')]]['exitAt'],members[_0x1f457b[_0x3641('0x1f')]]['enterAt']);if(members[_0x1f457b[_0x3641('0x1f')]]['uniqueid']){writeDB(members[_0x1f457b[_0x3641('0x1f')]]);}}default:break;}};exports[_0x3641('0x21')]=function(_0x33486a){if(!_['isNil'](members[_0x33486a[_0x3641('0x8')]])){members[_0x33486a[_0x3641('0x8')]]=_[_0x3641('0x22')](members[_0x33486a[_0x3641('0x8')]],{'data4':_0x33486a['queue'],'uniqueid':_0x33486a['uniqueid']});}};exports['cdr']=function(_0x1e07eb){if(_0x1e07eb['channel']){var _0x18433d=_0x1e07eb['channel'][_0x3641('0x23')]('-')[0x0];if(!_[_0x3641('0x1e')](members[_0x18433d])){members[_0x18433d]=_['assign'](members[_0x18433d],{'data1':members[_0x18433d]['data1']||_0x1e07eb['type'],'data2':members[_0x18433d][_0x3641('0xa')]||_0x1e07eb[_0x3641('0x24')],'data3':members[_0x18433d][_0x3641('0x25')]||_0x1e07eb['destination'],'uniqueid':members[_0x18433d][_0x3641('0x7')]||_0x1e07eb[_0x3641('0x7')]});if(members[_0x18433d]['exitAt']){writeDB(members[_0x18433d]);}}}if(_0x1e07eb['destinationchannel']){var _0x5bc9d3=_0x1e07eb['destinationchannel'][_0x3641('0x23')]('-')[0x0];if(!_[_0x3641('0x1e')](members[_0x5bc9d3])){members[_0x5bc9d3]=_['assign'](members[_0x5bc9d3],{'data1':members[_0x5bc9d3][_0x3641('0x26')]||_0x1e07eb['type'],'data2':members[_0x5bc9d3][_0x3641('0xa')]||_0x1e07eb['source'],'data3':members[_0x5bc9d3][_0x3641('0x25')]||_0x1e07eb[_0x3641('0x27')],'uniqueid':members[_0x5bc9d3]['uniqueid']||_0x1e07eb[_0x3641('0x7')]});if(members[_0x5bc9d3]['exitAt']){writeDB(members[_0x5bc9d3]);}}}}; \ No newline at end of file +var _0x53aa=['cdr','channel','source','destinationchannel','destination','lodash','util','./utils','Local/_attended@transfer','Queue:','format','data2','membername','type','interface','name','internal','request','CreateMemberReport','getUserByName','split','then','error','some','startsWith','devicestatechange','state','INUSE','BUSY','device','voice','agent','isNil','exitAt','duration','enterAt','uniqueid','agentcomplete','assign','queue'];(function(_0x2bcee0,_0x42bee1){var _0x2fce75=function(_0x370e6b){while(--_0x370e6b){_0x2bcee0['push'](_0x2bcee0['shift']());}};_0x2fce75(++_0x42bee1);}(_0x53aa,0xf5));var _0xa53a=function(_0x1cb18a,_0x33167a){_0x1cb18a=_0x1cb18a-0x0;var _0x22442e=_0x53aa[_0x1cb18a];return _0x22442e;};'use strict';var _=require(_0xa53a('0x0'));var util=require(_0xa53a('0x1'));var utils=require(_0xa53a('0x2'));var members={};var exclude=[_0xa53a('0x3'),_0xa53a('0x4')];function writeDB(_0x1929aa){utils['info'](util[_0xa53a('0x5')]('MEMBER|%s|%s|%s|%s|%s|%s',_0x1929aa['uniqueid'],_0x1929aa['interface'],_0x1929aa['channel'],_0x1929aa[_0xa53a('0x6')],_0x1929aa[_0xa53a('0x7')],_0x1929aa[_0xa53a('0x8')]));if(_0x1929aa[_0xa53a('0x9')]){utils['getUserByInterface'](_0x1929aa['interface'])['then'](function(_0x55d7f4){if(_0x55d7f4){_0x1929aa[_0xa53a('0x7')]=_0x55d7f4[_0xa53a('0xa')];_0x1929aa[_0xa53a('0xb')]=_0x55d7f4[_0xa53a('0xb')];utils[_0xa53a('0xc')](_0xa53a('0xd'),_0x1929aa);}else{utils[_0xa53a('0xe')](_0x1929aa[_0xa53a('0x9')][_0xa53a('0xf')]('/')[0x1])[_0xa53a('0x10')](function(_0x1c3c6f){if(_0x1c3c6f){_0x1929aa[_0xa53a('0x7')]=_0x1c3c6f['name'];_0x1929aa[_0xa53a('0xb')]=_0x1c3c6f['internal'];utils['request'](_0xa53a('0xd'),_0x1929aa);}});}})['catch'](function(_0x51c7bb){utils[_0xa53a('0x11')](_0x51c7bb);});}delete members[_0x1929aa[_0xa53a('0x9')]];}function startsWith(_0x4b7241,_0x51d218){return _[_0xa53a('0x12')](_0x4b7241,function(_0x125c83){return _[_0xa53a('0x13')](_0x51d218,_0x125c83);});}exports[_0xa53a('0x14')]=function(_0x2ef0df){switch(_0x2ef0df[_0xa53a('0x15')]){case _0xa53a('0x16'):case _0xa53a('0x17'):if(!startsWith(exclude,_0x2ef0df[_0xa53a('0x18')])){members[_0x2ef0df['device']]={'channel':_0xa53a('0x19'),'interface':_0x2ef0df[_0xa53a('0x18')],'type':'TALKING','enterAt':utils['now'](),'role':_0xa53a('0x1a')};}break;case'NOT_INUSE':if(!_[_0xa53a('0x1b')](members[_0x2ef0df[_0xa53a('0x18')]])){members[_0x2ef0df[_0xa53a('0x18')]][_0xa53a('0x1c')]=utils['now']();members[_0x2ef0df[_0xa53a('0x18')]][_0xa53a('0x1d')]=utils['diffTime'](members[_0x2ef0df['device']][_0xa53a('0x1c')],members[_0x2ef0df[_0xa53a('0x18')]][_0xa53a('0x1e')]);if(members[_0x2ef0df[_0xa53a('0x18')]][_0xa53a('0x1f')]){writeDB(members[_0x2ef0df[_0xa53a('0x18')]]);}}default:break;}};exports[_0xa53a('0x20')]=function(_0x4caa02){if(!_[_0xa53a('0x1b')](members[_0x4caa02[_0xa53a('0x9')]])){members[_0x4caa02[_0xa53a('0x9')]]=_[_0xa53a('0x21')](members[_0x4caa02[_0xa53a('0x9')]],{'data4':_0x4caa02[_0xa53a('0x22')],'uniqueid':_0x4caa02[_0xa53a('0x1f')]});}};exports[_0xa53a('0x23')]=function(_0x2e2ddb){if(_0x2e2ddb[_0xa53a('0x24')]){var _0x37a99f=_0x2e2ddb['channel'][_0xa53a('0xf')]('-')[0x0];if(!_[_0xa53a('0x1b')](members[_0x37a99f])){members[_0x37a99f]=_['assign'](members[_0x37a99f],{'data1':members[_0x37a99f]['data1']||_0x2e2ddb[_0xa53a('0x8')],'data2':members[_0x37a99f]['data2']||_0x2e2ddb[_0xa53a('0x25')],'data3':members[_0x37a99f]['data3']||_0x2e2ddb['destination'],'uniqueid':members[_0x37a99f][_0xa53a('0x1f')]||_0x2e2ddb[_0xa53a('0x1f')]});if(members[_0x37a99f]['exitAt']){writeDB(members[_0x37a99f]);}}}if(_0x2e2ddb[_0xa53a('0x26')]){var _0x3d96cc=_0x2e2ddb[_0xa53a('0x26')][_0xa53a('0xf')]('-')[0x0];if(!_[_0xa53a('0x1b')](members[_0x3d96cc])){members[_0x3d96cc]=_[_0xa53a('0x21')](members[_0x3d96cc],{'data1':members[_0x3d96cc]['data1']||_0x2e2ddb[_0xa53a('0x8')],'data2':members[_0x3d96cc][_0xa53a('0x6')]||_0x2e2ddb[_0xa53a('0x25')],'data3':members[_0x3d96cc]['data3']||_0x2e2ddb[_0xa53a('0x27')],'uniqueid':members[_0x3d96cc]['uniqueid']||_0x2e2ddb['uniqueid']});if(members[_0x3d96cc][_0xa53a('0x1c')]){writeDB(members[_0x3d96cc]);}}}}; \ No newline at end of file diff --git a/server/services/xdr/queues.controller.js b/server/services/xdr/queues.controller.js index fca8fb7..f4e4cc7 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 _0xda1c=['attendedtransfer','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','ATTENDED','origtransfererexten','transferuniqueid','ATTENDEDTRANSFER','transfereelinkedid','transfertargetuniqueid','calleridnum','calleridname','mohtime','secondtransfereruniqueid','secondtransfererexten','transfertargetlinkedid','clone','error','stack','musiconholdstart','musiconholdstop','musiconholdstartAt','diffTime','lodash','util','./utils','info','format','QUEUE|%s|%s|%s|%s|%s|%s|%s','uniqueid','channel','queue','lastAssignedTo','accountcode','queuecallerexitreason','getVoiceQueueByName','then','type','request','CreateVoiceQueueReport','transfereduniqueid','queuecallerjoin','assign','position','now','isNil','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt','COMPLETEDBYAGENT','queuecallerenterreason','variable','queuestatus','queuecallerabandon','queuecallerabandonAt','queuecallerexit','queuecallerexitAt','value','queueposition','EXITWITHKEY','queuecallerleave','holdtime','queuecallerjoinAt','count','connectedlinenum','connectedlinename','agentconnect','destaccountcode','membername','assigned','reason','transfer','TRANSFER','toUpperCase','blindtransfer','transfereeuniqueid','transfertype','BLIND','transferexten','extension','BLINDTRANSFER'];(function(_0x5a2da5,_0x12e6c3){var _0x477530=function(_0x4a64f5){while(--_0x4a64f5){_0x5a2da5['push'](_0x5a2da5['shift']());}};_0x477530(++_0x12e6c3);}(_0xda1c,0x68));var _0xcda1=function(_0x46bd44,_0x206a27){_0x46bd44=_0x46bd44-0x0;var _0x4c8520=_0xda1c[_0x46bd44];return _0x4c8520;};'use strict';var _=require(_0xcda1('0x0'));var util=require(_0xcda1('0x1'));var utils=require(_0xcda1('0x2'));var queues={};function writeDB(_0x1d7359){utils[_0xcda1('0x3')](util[_0xcda1('0x4')](_0xcda1('0x5'),_0x1d7359[_0xcda1('0x6')],_0x1d7359[_0xcda1('0x7')],_0x1d7359[_0xcda1('0x8')],_0x1d7359[_0xcda1('0x9')],_0x1d7359['calleridnum'],_0x1d7359[_0xcda1('0xa')],_0x1d7359[_0xcda1('0xb')]));if(_0x1d7359[_0xcda1('0x8')]){utils[_0xcda1('0xc')](_0x1d7359[_0xcda1('0x8')])[_0xcda1('0xd')](function(_0x533b08){if(_0x533b08){_0x1d7359[_0xcda1('0xe')]=_0x533b08[_0xcda1('0xe')];}utils[_0xcda1('0xf')](_0xcda1('0x10'),_0x1d7359);});}else{utils[_0xcda1('0xf')](_0xcda1('0x10'),_0x1d7359);}if(_0x1d7359[_0xcda1('0x11')]){delete queues[_0x1d7359[_0xcda1('0x11')]];}else{delete queues[_0x1d7359[_0xcda1('0x6')]];}}exports[_0xcda1('0x12')]=function(_0x4c1ae0){queues[_0x4c1ae0[_0xcda1('0x6')]]=_[_0xcda1('0x13')](_0x4c1ae0,{'originalposition':_0x4c1ae0[_0xcda1('0x14')],'queuecallerjoinAt':utils[_0xcda1('0x15')](),'mohtime':0x0});};exports['hangup']=function(_0x486ab5){if(!_[_0xcda1('0x16')](queues[_0x486ab5['uniqueid']])){if(queues[_0x486ab5['uniqueid']][_0xcda1('0x17')]){if(!queues[_0x486ab5[_0xcda1('0x6')]]['queuecallerabandon']&&!queues[_0x486ab5[_0xcda1('0x6')]]['queuecallerexit']){queues[_0x486ab5['uniqueid']][_0xcda1('0x18')]=!![];queues[_0x486ab5[_0xcda1('0x6')]][_0xcda1('0x19')]=utils[_0xcda1('0x15')]();queues[_0x486ab5[_0xcda1('0x6')]]['queuecallerexitreason']=_0xcda1('0x1a');}writeDB(queues[_0x486ab5['uniqueid']]);}else{if(queues[_0x486ab5[_0xcda1('0x6')]][_0xcda1('0x11')]){queues[queues[_0x486ab5[_0xcda1('0x6')]][_0xcda1('0x11')]]=queues[_0x486ab5[_0xcda1('0x6')]];queues[queues[_0x486ab5[_0xcda1('0x6')]][_0xcda1('0x11')]][_0xcda1('0x1b')]=0x2;delete queues[_0x486ab5['uniqueid']];}}}};exports['varset']=function(_0x547510){if(!_[_0xcda1('0x16')](_0x547510[_0xcda1('0x1c')][_0xcda1('0x1d')])){if(!_[_0xcda1('0x16')](queues[_0x547510[_0xcda1('0x6')]])){queues[_0x547510[_0xcda1('0x6')]][_0xcda1('0x1e')]=![];queues[_0x547510[_0xcda1('0x6')]][_0xcda1('0x1f')]=null;queues[_0x547510[_0xcda1('0x6')]][_0xcda1('0x20')]=!![];queues[_0x547510[_0xcda1('0x6')]][_0xcda1('0x21')]=utils['now']();queues[_0x547510['uniqueid']]['queuecallerexitreason']=_0x547510[_0xcda1('0x22')]['toUpperCase']();writeDB(queues[_0x547510['uniqueid']]);}}else if(!_[_0xcda1('0x16')](_0x547510[_0xcda1('0x1c')][_0xcda1('0x23')])){if(!_[_0xcda1('0x16')](queues[_0x547510['uniqueid']])&&!queues[_0x547510[_0xcda1('0x6')]][_0xcda1('0x1e')]){queues[_0x547510['uniqueid']]['queuecallerabandon']=![];queues[_0x547510[_0xcda1('0x6')]][_0xcda1('0x1f')]=null;queues[_0x547510[_0xcda1('0x6')]][_0xcda1('0x20')]=!![];queues[_0x547510[_0xcda1('0x6')]][_0xcda1('0x21')]=utils[_0xcda1('0x15')]();queues[_0x547510['uniqueid']][_0xcda1('0xb')]=_0xcda1('0x24');}}};exports[_0xcda1('0x1e')]=function(_0x13ef44){if(!_[_0xcda1('0x16')](queues[_0x13ef44[_0xcda1('0x6')]])){queues[_0x13ef44[_0xcda1('0x6')]][_0xcda1('0x20')]=![];queues[_0x13ef44['uniqueid']][_0xcda1('0x21')]=null;queues[_0x13ef44['uniqueid']][_0xcda1('0x1e')]=!![];queues[_0x13ef44['uniqueid']][_0xcda1('0x1f')]=utils[_0xcda1('0x15')]();queues[_0x13ef44[_0xcda1('0x6')]]['queuecallerexitreason']='ABANDONED';}};exports[_0xcda1('0x25')]=function(_0x136c08){if(!_['isNil'](queues[_0x136c08[_0xcda1('0x6')]])){queues[_0x136c08[_0xcda1('0x6')]][_0xcda1('0x25')]=!![];queues[_0x136c08[_0xcda1('0x6')]][_0xcda1('0x17')]=utils[_0xcda1('0x15')]();queues[_0x136c08[_0xcda1('0x6')]][_0xcda1('0x26')]=utils['diffTime'](queues[_0x136c08['uniqueid']]['queuecallerleaveAt'],queues[_0x136c08['uniqueid']][_0xcda1('0x27')]);queues[_0x136c08[_0xcda1('0x6')]][_0xcda1('0x14')]=_0x136c08[_0xcda1('0x14')];queues[_0x136c08[_0xcda1('0x6')]][_0xcda1('0x28')]=_0x136c08['count'];queues[_0x136c08['uniqueid']][_0xcda1('0x29')]=_0x136c08[_0xcda1('0x29')];queues[_0x136c08[_0xcda1('0x6')]][_0xcda1('0x2a')]=_0x136c08['connectedlinename'];}};exports[_0xcda1('0x2b')]=function(_0x37c350){if(!_[_0xcda1('0x16')](queues[_0x37c350['uniqueid']])){queues[_0x37c350[_0xcda1('0x6')]][_0xcda1('0x1e')]=![];queues[_0x37c350[_0xcda1('0x6')]][_0xcda1('0x1e')]=![];queues[_0x37c350['uniqueid']]['queuecallerabandonAt']=null;queues[_0x37c350['uniqueid']][_0xcda1('0x20')]=![];queues[_0x37c350[_0xcda1('0x6')]][_0xcda1('0x21')]=null;queues[_0x37c350[_0xcda1('0x6')]]['assigned']=!![];queues[_0x37c350['uniqueid']][_0xcda1('0xa')]=_0x37c350[_0xcda1('0x2c')];queues[_0x37c350[_0xcda1('0x6')]][_0xcda1('0x9')]=_0x37c350[_0xcda1('0x2d')];}};exports['agentcomplete']=function(_0x4ae219){if(!_[_0xcda1('0x16')](queues[_0x4ae219['uniqueid']])){if(queues[_0x4ae219['uniqueid']]['queuecallerleaveAt']){queues[_0x4ae219['uniqueid']][_0xcda1('0x1e')]=![];queues[_0x4ae219[_0xcda1('0x6')]][_0xcda1('0x1e')]=![];queues[_0x4ae219['uniqueid']]['queuecallerabandonAt']=null;queues[_0x4ae219[_0xcda1('0x6')]][_0xcda1('0x20')]=![];queues[_0x4ae219['uniqueid']][_0xcda1('0x21')]=null;queues[_0x4ae219['uniqueid']][_0xcda1('0x2e')]=!![];queues[_0x4ae219['uniqueid']][_0xcda1('0x9')]=_0x4ae219[_0xcda1('0x2d')];queues[_0x4ae219[_0xcda1('0x6')]][_0xcda1('0x18')]=!![];queues[_0x4ae219[_0xcda1('0x6')]][_0xcda1('0x19')]=utils[_0xcda1('0x15')]();if(_0x4ae219[_0xcda1('0x2f')]==_0xcda1('0x30')){if(!queues[_0x4ae219[_0xcda1('0x6')]][_0xcda1('0x30')]){queues[_0x4ae219[_0xcda1('0x6')]][_0xcda1('0xb')]=_0xcda1('0x31');}}else{queues[_0x4ae219[_0xcda1('0x6')]]['queuecallerexitreason']='COMPLETEDBY'+_0x4ae219[_0xcda1('0x2f')][_0xcda1('0x32')]();}writeDB(queues[_0x4ae219['uniqueid']]);}}};exports[_0xcda1('0x33')]=function(_0x305d8e){if(!_[_0xcda1('0x16')](queues[_0x305d8e['transfereeuniqueid']])){queues[_0x305d8e[_0xcda1('0x34')]][_0xcda1('0x30')]=!![];queues[_0x305d8e[_0xcda1('0x34')]][_0xcda1('0x35')]=_0xcda1('0x36');queues[_0x305d8e[_0xcda1('0x34')]][_0xcda1('0x37')]=_0x305d8e[_0xcda1('0x38')];queues[_0x305d8e['transfereeuniqueid']]['transferuniqueid']=_0x305d8e['transfereeuniqueid'];queues[_0x305d8e['transfereeuniqueid']][_0xcda1('0xb')]=_0xcda1('0x39');}};exports[_0xcda1('0x3a')]=function(_0x5752e4){try{if(_0x5752e4[_0xcda1('0x3b')]==_0x5752e4[_0xcda1('0x3c')]){if(!_['isNil'](queues[_0x5752e4[_0xcda1('0x3d')]])){queues[_0x5752e4[_0xcda1('0x3d')]]['transfer']=!![];queues[_0x5752e4[_0xcda1('0x3d')]][_0xcda1('0x35')]=_0xcda1('0x3e');queues[_0x5752e4[_0xcda1('0x3d')]][_0xcda1('0x37')]=_0x5752e4[_0xcda1('0x3f')];queues[_0x5752e4[_0xcda1('0x3d')]][_0xcda1('0x40')]=_0x5752e4['origtransfereruniqueid'];queues[_0x5752e4['secondtransfererlinkedid']]['queuecallerexitreason']=_0xcda1('0x41');}if(!_[_0xcda1('0x16')](queues[_0x5752e4[_0xcda1('0x3c')]])){if(_0x5752e4[_0xcda1('0x42')]&&queues[_0x5752e4['transfereelinkedid']]){queues[_0x5752e4[_0xcda1('0x42')]][_0xcda1('0x1b')]=0x1;queues[_0x5752e4[_0xcda1('0x34')]]=_['clone'](queues[_0x5752e4[_0xcda1('0x42')]]);queues[_0x5752e4[_0xcda1('0x34')]]['transfereduniqueid']=_0x5752e4[_0xcda1('0x43')];queues[_0x5752e4[_0xcda1('0x34')]][_0xcda1('0x1b')]=0x2;queues[_0x5752e4['transfereeuniqueid']][_0xcda1('0x44')]=queues[_0x5752e4[_0xcda1('0x3d')]][_0xcda1('0x44')];queues[_0x5752e4[_0xcda1('0x34')]][_0xcda1('0x45')]=queues[_0x5752e4[_0xcda1('0x3d')]][_0xcda1('0x45')];queues[_0x5752e4[_0xcda1('0x34')]][_0xcda1('0x27')]=utils[_0xcda1('0x15')]();queues[_0x5752e4[_0xcda1('0x34')]][_0xcda1('0x17')]=utils[_0xcda1('0x15')]();queues[_0x5752e4[_0xcda1('0x34')]][_0xcda1('0x26')]=0x0;queues[_0x5752e4[_0xcda1('0x34')]][_0xcda1('0x46')]=0x0;}else{queues[_0x5752e4[_0xcda1('0x3c')]]['transfereduniqueid']=_0x5752e4[_0xcda1('0x3d')];}}}else if(_0x5752e4[_0xcda1('0x47')]==_0x5752e4['secondtransfererlinkedid']){if(!_[_0xcda1('0x16')](queues[_0x5752e4[_0xcda1('0x3c')]])){queues[_0x5752e4['origtransfererlinkedid']]['transfer']=!![];queues[_0x5752e4[_0xcda1('0x3c')]][_0xcda1('0x35')]='ATTENDED';queues[_0x5752e4['origtransfererlinkedid']][_0xcda1('0x37')]=_0x5752e4[_0xcda1('0x48')];queues[_0x5752e4[_0xcda1('0x3c')]][_0xcda1('0x40')]=_0x5752e4[_0xcda1('0x47')];queues[_0x5752e4[_0xcda1('0x3c')]][_0xcda1('0xb')]=_0xcda1('0x41');}if(!_['isNil'](queues[_0x5752e4[_0xcda1('0x3d')]])){if(_0x5752e4[_0xcda1('0x49')]&&queues[_0x5752e4[_0xcda1('0x49')]]){queues[_0x5752e4[_0xcda1('0x49')]]['queuecallerenterreason']=0x1;queues[_0x5752e4[_0xcda1('0x43')]]=_[_0xcda1('0x4a')](queues[_0x5752e4['transfertargetlinkedid']]);queues[_0x5752e4[_0xcda1('0x43')]][_0xcda1('0x11')]=_0x5752e4[_0xcda1('0x43')];queues[_0x5752e4[_0xcda1('0x43')]][_0xcda1('0x1b')]=0x2;queues[_0x5752e4[_0xcda1('0x43')]]['calleridnum']=queues[_0x5752e4[_0xcda1('0x3c')]][_0xcda1('0x44')];queues[_0x5752e4[_0xcda1('0x43')]]['calleridname']=queues[_0x5752e4['origtransfererlinkedid']][_0xcda1('0x45')];queues[_0x5752e4[_0xcda1('0x43')]][_0xcda1('0x27')]=utils[_0xcda1('0x15')]();queues[_0x5752e4[_0xcda1('0x43')]]['queuecallerleaveAt']=utils['now']();queues[_0x5752e4[_0xcda1('0x43')]][_0xcda1('0x26')]=0x0;queues[_0x5752e4[_0xcda1('0x43')]][_0xcda1('0x46')]=0x0;}else{queues[_0x5752e4['secondtransfererlinkedid']][_0xcda1('0x11')]=_0x5752e4[_0xcda1('0x3c')];}}}}catch(_0x18b604){utils[_0xcda1('0x4b')](_0x18b604[_0xcda1('0x4c')]);}};exports[_0xcda1('0x4d')]=function(_0x31422a){if(!_[_0xcda1('0x16')](queues[_0x31422a[_0xcda1('0x6')]])){queues[_0x31422a[_0xcda1('0x6')]]['musiconholdstartAt']=utils[_0xcda1('0x15')]();}};exports[_0xcda1('0x4e')]=function(_0x3797c9){if(!_[_0xcda1('0x16')](queues[_0x3797c9[_0xcda1('0x6')]])){if(!_[_0xcda1('0x16')](queues[_0x3797c9['uniqueid']][_0xcda1('0x4f')])){queues[_0x3797c9[_0xcda1('0x6')]][_0xcda1('0x46')]+=utils[_0xcda1('0x50')](utils[_0xcda1('0x15')](),queues[_0x3797c9['uniqueid']]['musiconholdstartAt']);delete queues[_0x3797c9[_0xcda1('0x6')]][_0xcda1('0x4f')];}}}; \ No newline at end of file +var _0x3098=['request','transfereduniqueid','queuecallerjoin','assign','position','hangup','isNil','queuecallerleaveAt','queuecallerabandon','queuecallerexit','queuecallercompleteAt','now','COMPLETEDBYAGENT','queuecallerenterreason','varset','variable','queuestatus','queuecallerabandonAt','toUpperCase','queuecallerexitAt','EXITWITHKEY','queuecallerleave','queuecallerjoinAt','count','connectedlinenum','agentconnect','assigned','membername','agentcomplete','queuecallercomplete','reason','transfer','COMPLETEDBY','blindtransfer','transfereeuniqueid','transfertype','BLIND','transferexten','transferuniqueid','BLINDTRANSFER','attendedtransfer','origtransfererlinkedid','secondtransfererlinkedid','ATTENDED','origtransfererexten','transfereelinkedid','clone','transfertargetuniqueid','calleridname','holdtime','mohtime','secondtransfereruniqueid','ATTENDEDTRANSFER','transfertargetlinkedid','error','stack','musiconholdstart','musiconholdstartAt','musiconholdstop','diffTime','lodash','util','./utils','format','QUEUE|%s|%s|%s|%s|%s|%s|%s','uniqueid','channel','queue','lastAssignedTo','calleridnum','accountcode','queuecallerexitreason','type','CreateVoiceQueueReport'];(function(_0x4758a0,_0x4de0ef){var _0x5e245f=function(_0x52884b){while(--_0x52884b){_0x4758a0['push'](_0x4758a0['shift']());}};_0x5e245f(++_0x4de0ef);}(_0x3098,0x86));var _0x8309=function(_0x4f3b2d,_0x3bbf46){_0x4f3b2d=_0x4f3b2d-0x0;var _0x3dddfa=_0x3098[_0x4f3b2d];return _0x3dddfa;};'use strict';var _=require(_0x8309('0x0'));var util=require(_0x8309('0x1'));var utils=require(_0x8309('0x2'));var queues={};function writeDB(_0x189a02){utils['info'](util[_0x8309('0x3')](_0x8309('0x4'),_0x189a02[_0x8309('0x5')],_0x189a02[_0x8309('0x6')],_0x189a02[_0x8309('0x7')],_0x189a02[_0x8309('0x8')],_0x189a02[_0x8309('0x9')],_0x189a02[_0x8309('0xa')],_0x189a02[_0x8309('0xb')]));if(_0x189a02[_0x8309('0x7')]){utils['getVoiceQueueByName'](_0x189a02[_0x8309('0x7')])['then'](function(_0x421fa5){if(_0x421fa5){_0x189a02[_0x8309('0xc')]=_0x421fa5['type'];}utils['request'](_0x8309('0xd'),_0x189a02);});}else{utils[_0x8309('0xe')](_0x8309('0xd'),_0x189a02);}if(_0x189a02[_0x8309('0xf')]){delete queues[_0x189a02[_0x8309('0xf')]];}else{delete queues[_0x189a02['uniqueid']];}}exports[_0x8309('0x10')]=function(_0x1cc2fa){queues[_0x1cc2fa[_0x8309('0x5')]]=_[_0x8309('0x11')](_0x1cc2fa,{'originalposition':_0x1cc2fa[_0x8309('0x12')],'queuecallerjoinAt':utils['now'](),'mohtime':0x0});};exports[_0x8309('0x13')]=function(_0x4a05c4){if(!_[_0x8309('0x14')](queues[_0x4a05c4['uniqueid']])){if(queues[_0x4a05c4[_0x8309('0x5')]][_0x8309('0x15')]){if(!queues[_0x4a05c4[_0x8309('0x5')]][_0x8309('0x16')]&&!queues[_0x4a05c4[_0x8309('0x5')]][_0x8309('0x17')]){queues[_0x4a05c4[_0x8309('0x5')]]['queuecallercomplete']=!![];queues[_0x4a05c4['uniqueid']][_0x8309('0x18')]=utils[_0x8309('0x19')]();queues[_0x4a05c4[_0x8309('0x5')]][_0x8309('0xb')]=_0x8309('0x1a');}writeDB(queues[_0x4a05c4[_0x8309('0x5')]]);}else{if(queues[_0x4a05c4[_0x8309('0x5')]][_0x8309('0xf')]){queues[queues[_0x4a05c4['uniqueid']][_0x8309('0xf')]]=queues[_0x4a05c4[_0x8309('0x5')]];queues[queues[_0x4a05c4[_0x8309('0x5')]][_0x8309('0xf')]][_0x8309('0x1b')]=0x2;delete queues[_0x4a05c4[_0x8309('0x5')]];}}}};exports[_0x8309('0x1c')]=function(_0x158aec){if(!_[_0x8309('0x14')](_0x158aec[_0x8309('0x1d')][_0x8309('0x1e')])){if(!_[_0x8309('0x14')](queues[_0x158aec['uniqueid']])){queues[_0x158aec['uniqueid']][_0x8309('0x16')]=![];queues[_0x158aec[_0x8309('0x5')]][_0x8309('0x1f')]=null;queues[_0x158aec[_0x8309('0x5')]][_0x8309('0x17')]=!![];queues[_0x158aec[_0x8309('0x5')]]['queuecallerexitAt']=utils[_0x8309('0x19')]();queues[_0x158aec[_0x8309('0x5')]][_0x8309('0xb')]=_0x158aec['value'][_0x8309('0x20')]();writeDB(queues[_0x158aec[_0x8309('0x5')]]);}}else if(!_['isNil'](_0x158aec[_0x8309('0x1d')]['queueposition'])){if(!_[_0x8309('0x14')](queues[_0x158aec['uniqueid']])&&!queues[_0x158aec[_0x8309('0x5')]][_0x8309('0x16')]){queues[_0x158aec[_0x8309('0x5')]][_0x8309('0x16')]=![];queues[_0x158aec['uniqueid']][_0x8309('0x1f')]=null;queues[_0x158aec[_0x8309('0x5')]][_0x8309('0x17')]=!![];queues[_0x158aec['uniqueid']][_0x8309('0x21')]=utils['now']();queues[_0x158aec[_0x8309('0x5')]][_0x8309('0xb')]=_0x8309('0x22');}}};exports[_0x8309('0x16')]=function(_0x15e32a){if(!_[_0x8309('0x14')](queues[_0x15e32a[_0x8309('0x5')]])){queues[_0x15e32a[_0x8309('0x5')]][_0x8309('0x17')]=![];queues[_0x15e32a['uniqueid']]['queuecallerexitAt']=null;queues[_0x15e32a[_0x8309('0x5')]][_0x8309('0x16')]=!![];queues[_0x15e32a[_0x8309('0x5')]][_0x8309('0x1f')]=utils[_0x8309('0x19')]();queues[_0x15e32a[_0x8309('0x5')]][_0x8309('0xb')]='ABANDONED';}};exports[_0x8309('0x23')]=function(_0x1f588e){if(!_[_0x8309('0x14')](queues[_0x1f588e[_0x8309('0x5')]])){queues[_0x1f588e[_0x8309('0x5')]][_0x8309('0x23')]=!![];queues[_0x1f588e[_0x8309('0x5')]]['queuecallerleaveAt']=utils['now']();queues[_0x1f588e['uniqueid']]['holdtime']=utils['diffTime'](queues[_0x1f588e[_0x8309('0x5')]][_0x8309('0x15')],queues[_0x1f588e[_0x8309('0x5')]][_0x8309('0x24')]);queues[_0x1f588e[_0x8309('0x5')]]['position']=_0x1f588e[_0x8309('0x12')];queues[_0x1f588e[_0x8309('0x5')]]['count']=_0x1f588e[_0x8309('0x25')];queues[_0x1f588e[_0x8309('0x5')]][_0x8309('0x26')]=_0x1f588e[_0x8309('0x26')];queues[_0x1f588e[_0x8309('0x5')]]['connectedlinename']=_0x1f588e['connectedlinename'];}};exports[_0x8309('0x27')]=function(_0x4bebeb){if(!_[_0x8309('0x14')](queues[_0x4bebeb[_0x8309('0x5')]])){queues[_0x4bebeb[_0x8309('0x5')]]['queuecallerabandon']=![];queues[_0x4bebeb[_0x8309('0x5')]]['queuecallerabandon']=![];queues[_0x4bebeb[_0x8309('0x5')]][_0x8309('0x1f')]=null;queues[_0x4bebeb[_0x8309('0x5')]][_0x8309('0x17')]=![];queues[_0x4bebeb[_0x8309('0x5')]][_0x8309('0x21')]=null;queues[_0x4bebeb[_0x8309('0x5')]][_0x8309('0x28')]=!![];queues[_0x4bebeb[_0x8309('0x5')]][_0x8309('0xa')]=_0x4bebeb['destaccountcode'];queues[_0x4bebeb[_0x8309('0x5')]][_0x8309('0x8')]=_0x4bebeb[_0x8309('0x29')];}};exports[_0x8309('0x2a')]=function(_0x4ecd62){if(!_[_0x8309('0x14')](queues[_0x4ecd62['uniqueid']])){if(queues[_0x4ecd62[_0x8309('0x5')]][_0x8309('0x15')]){queues[_0x4ecd62['uniqueid']][_0x8309('0x16')]=![];queues[_0x4ecd62[_0x8309('0x5')]][_0x8309('0x16')]=![];queues[_0x4ecd62[_0x8309('0x5')]][_0x8309('0x1f')]=null;queues[_0x4ecd62[_0x8309('0x5')]][_0x8309('0x17')]=![];queues[_0x4ecd62[_0x8309('0x5')]][_0x8309('0x21')]=null;queues[_0x4ecd62[_0x8309('0x5')]][_0x8309('0x28')]=!![];queues[_0x4ecd62['uniqueid']][_0x8309('0x8')]=_0x4ecd62[_0x8309('0x29')];queues[_0x4ecd62[_0x8309('0x5')]][_0x8309('0x2b')]=!![];queues[_0x4ecd62['uniqueid']][_0x8309('0x18')]=utils[_0x8309('0x19')]();if(_0x4ecd62[_0x8309('0x2c')]==_0x8309('0x2d')){if(!queues[_0x4ecd62['uniqueid']][_0x8309('0x2d')]){queues[_0x4ecd62[_0x8309('0x5')]]['queuecallerexitreason']='TRANSFER';}}else{queues[_0x4ecd62['uniqueid']][_0x8309('0xb')]=_0x8309('0x2e')+_0x4ecd62['reason']['toUpperCase']();}writeDB(queues[_0x4ecd62[_0x8309('0x5')]]);}}};exports[_0x8309('0x2f')]=function(_0x7db781){if(!_[_0x8309('0x14')](queues[_0x7db781[_0x8309('0x30')]])){queues[_0x7db781[_0x8309('0x30')]][_0x8309('0x2d')]=!![];queues[_0x7db781[_0x8309('0x30')]][_0x8309('0x31')]=_0x8309('0x32');queues[_0x7db781[_0x8309('0x30')]][_0x8309('0x33')]=_0x7db781['extension'];queues[_0x7db781[_0x8309('0x30')]][_0x8309('0x34')]=_0x7db781['transfereeuniqueid'];queues[_0x7db781['transfereeuniqueid']][_0x8309('0xb')]=_0x8309('0x35');}};exports[_0x8309('0x36')]=function(_0x4dcf2e){try{if(_0x4dcf2e['origtransfereruniqueid']==_0x4dcf2e[_0x8309('0x37')]){if(!_[_0x8309('0x14')](queues[_0x4dcf2e[_0x8309('0x38')]])){queues[_0x4dcf2e[_0x8309('0x38')]][_0x8309('0x2d')]=!![];queues[_0x4dcf2e[_0x8309('0x38')]][_0x8309('0x31')]=_0x8309('0x39');queues[_0x4dcf2e[_0x8309('0x38')]]['transferexten']=_0x4dcf2e[_0x8309('0x3a')];queues[_0x4dcf2e[_0x8309('0x38')]][_0x8309('0x34')]=_0x4dcf2e['origtransfereruniqueid'];queues[_0x4dcf2e[_0x8309('0x38')]][_0x8309('0xb')]='ATTENDEDTRANSFER';}if(!_[_0x8309('0x14')](queues[_0x4dcf2e[_0x8309('0x37')]])){if(_0x4dcf2e[_0x8309('0x3b')]&&queues[_0x4dcf2e[_0x8309('0x3b')]]){queues[_0x4dcf2e[_0x8309('0x3b')]][_0x8309('0x1b')]=0x1;queues[_0x4dcf2e[_0x8309('0x30')]]=_[_0x8309('0x3c')](queues[_0x4dcf2e[_0x8309('0x3b')]]);queues[_0x4dcf2e[_0x8309('0x30')]]['transfereduniqueid']=_0x4dcf2e[_0x8309('0x3d')];queues[_0x4dcf2e[_0x8309('0x30')]][_0x8309('0x1b')]=0x2;queues[_0x4dcf2e['transfereeuniqueid']][_0x8309('0x9')]=queues[_0x4dcf2e[_0x8309('0x38')]][_0x8309('0x9')];queues[_0x4dcf2e[_0x8309('0x30')]][_0x8309('0x3e')]=queues[_0x4dcf2e[_0x8309('0x38')]]['calleridname'];queues[_0x4dcf2e[_0x8309('0x30')]]['queuecallerjoinAt']=utils['now']();queues[_0x4dcf2e[_0x8309('0x30')]][_0x8309('0x15')]=utils['now']();queues[_0x4dcf2e[_0x8309('0x30')]][_0x8309('0x3f')]=0x0;queues[_0x4dcf2e[_0x8309('0x30')]][_0x8309('0x40')]=0x0;}else{queues[_0x4dcf2e[_0x8309('0x37')]][_0x8309('0xf')]=_0x4dcf2e[_0x8309('0x38')];}}}else if(_0x4dcf2e[_0x8309('0x41')]==_0x4dcf2e['secondtransfererlinkedid']){if(!_[_0x8309('0x14')](queues[_0x4dcf2e[_0x8309('0x37')]])){queues[_0x4dcf2e[_0x8309('0x37')]]['transfer']=!![];queues[_0x4dcf2e[_0x8309('0x37')]][_0x8309('0x31')]=_0x8309('0x39');queues[_0x4dcf2e['origtransfererlinkedid']][_0x8309('0x33')]=_0x4dcf2e['secondtransfererexten'];queues[_0x4dcf2e[_0x8309('0x37')]][_0x8309('0x34')]=_0x4dcf2e[_0x8309('0x41')];queues[_0x4dcf2e['origtransfererlinkedid']]['queuecallerexitreason']=_0x8309('0x42');}if(!_['isNil'](queues[_0x4dcf2e['secondtransfererlinkedid']])){if(_0x4dcf2e[_0x8309('0x43')]&&queues[_0x4dcf2e['transfertargetlinkedid']]){queues[_0x4dcf2e[_0x8309('0x43')]][_0x8309('0x1b')]=0x1;queues[_0x4dcf2e[_0x8309('0x3d')]]=_[_0x8309('0x3c')](queues[_0x4dcf2e[_0x8309('0x43')]]);queues[_0x4dcf2e[_0x8309('0x3d')]][_0x8309('0xf')]=_0x4dcf2e[_0x8309('0x3d')];queues[_0x4dcf2e['transfertargetuniqueid']][_0x8309('0x1b')]=0x2;queues[_0x4dcf2e[_0x8309('0x3d')]]['calleridnum']=queues[_0x4dcf2e[_0x8309('0x37')]]['calleridnum'];queues[_0x4dcf2e[_0x8309('0x3d')]]['calleridname']=queues[_0x4dcf2e[_0x8309('0x37')]]['calleridname'];queues[_0x4dcf2e['transfertargetuniqueid']]['queuecallerjoinAt']=utils['now']();queues[_0x4dcf2e[_0x8309('0x3d')]][_0x8309('0x15')]=utils['now']();queues[_0x4dcf2e[_0x8309('0x3d')]][_0x8309('0x3f')]=0x0;queues[_0x4dcf2e[_0x8309('0x3d')]][_0x8309('0x40')]=0x0;}else{queues[_0x4dcf2e[_0x8309('0x38')]][_0x8309('0xf')]=_0x4dcf2e['origtransfererlinkedid'];}}}}catch(_0x1227cd){utils[_0x8309('0x44')](_0x1227cd[_0x8309('0x45')]);}};exports[_0x8309('0x46')]=function(_0x39430e){if(!_[_0x8309('0x14')](queues[_0x39430e[_0x8309('0x5')]])){queues[_0x39430e['uniqueid']][_0x8309('0x47')]=utils[_0x8309('0x19')]();}};exports[_0x8309('0x48')]=function(_0x46897c){if(!_[_0x8309('0x14')](queues[_0x46897c[_0x8309('0x5')]])){if(!_[_0x8309('0x14')](queues[_0x46897c[_0x8309('0x5')]][_0x8309('0x47')])){queues[_0x46897c['uniqueid']]['mohtime']+=utils[_0x8309('0x49')](utils['now'](),queues[_0x46897c['uniqueid']][_0x8309('0x47')]);delete queues[_0x46897c['uniqueid']]['musiconholdstartAt'];}}}; \ No newline at end of file diff --git a/server/services/xdr/recordings.controller.js b/server/services/xdr/recordings.controller.js index c273ed7..f9fa55a 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 _0xedd9=['UserId','request','CreateVoiceRecording','uniqueid','linkedid','context','channel','error','stack','isNil','channelstate','varset','variable','endsWith','value','.wav49','.WAV','find','monitors','calleridnum','calleridname','connectedlinenum','connectedlinename','type','outbound','clone','newexten','application','set','startsWith','appdata','cdr','split','substring','lastIndexOf','queuecallerjoin','queue','./utils','debug','accountcode','getUserByInternal','then','name'];(function(_0x36aaf7,_0x48a43a){var _0x12aecb=function(_0x501bc7){while(--_0x501bc7){_0x36aaf7['push'](_0x36aaf7['shift']());}};_0x12aecb(++_0x48a43a);}(_0xedd9,0xfc));var _0x9edd=function(_0xcee420,_0x59f5a3){_0xcee420=_0xcee420-0x0;var _0xd038bf=_0xedd9[_0xcee420];return _0xd038bf;};'use strict';var _=require('lodash');var utils=require(_0x9edd('0x0'));var recordings={};function writeDB(_0x2d7989){utils[_0x9edd('0x1')](_0x2d7989);if(_0x2d7989[_0x9edd('0x2')]){utils[_0x9edd('0x3')](_0x2d7989[_0x9edd('0x2')])[_0x9edd('0x4')](function(_0x36b53f){if(_0x36b53f){_0x2d7989['membername']=_0x36b53f[_0x9edd('0x5')];_0x2d7989[_0x9edd('0x6')]=_0x36b53f['id'];}utils[_0x9edd('0x7')](_0x9edd('0x8'),_0x2d7989);});}else{utils['request'](_0x9edd('0x8'),_0x2d7989);}}exports['newchannel']=function(_0x172522){try{if(_0x172522[_0x9edd('0x9')]==_0x172522[_0x9edd('0xa')]){recordings[_0x172522[_0x9edd('0x9')]]={'uniqueid':_0x172522['uniqueid'],'accountcode':_0x172522[_0x9edd('0x2')],'exten':_0x172522['exten'],'context':_0x172522[_0x9edd('0xb')],'channel':_0x172522[_0x9edd('0xc')],'monitors':[]};}}catch(_0x523026){utils[_0x9edd('0xd')](_0x523026[_0x9edd('0xe')]);}};exports['newstate']=function(_0x30c0d7){try{if(!_[_0x9edd('0xf')](recordings[_0x30c0d7[_0x9edd('0x9')]])&&_0x30c0d7[_0x9edd('0x10')]==0x6){}else if(!_[_0x9edd('0xf')](recordings[_0x30c0d7[_0x9edd('0xa')]])&&_0x30c0d7[_0x9edd('0x10')]==0x6&&_0x30c0d7[_0x9edd('0xb')]!='transfer'){recordings[_0x30c0d7[_0x9edd('0xa')]][_0x9edd('0x2')]=_0x30c0d7[_0x9edd('0x2')];}}catch(_0x4d9a7){utils[_0x9edd('0xd')](_0x4d9a7[_0x9edd('0xe')]);}};exports[_0x9edd('0x11')]=function(_0x75a4ab){try{if(!_['isNil'](_0x75a4ab[_0x9edd('0x12')])&&!_[_0x9edd('0xf')](_0x75a4ab[_0x9edd('0x12')]['mixmonitor_filename'])){if(_[_0x9edd('0x13')](_0x75a4ab[_0x9edd('0x14')],_0x9edd('0x15'))){_0x75a4ab['value']=_0x75a4ab[_0x9edd('0x14')]['replace'](_0x9edd('0x15'),_0x9edd('0x16'));}if(recordings[_0x75a4ab['linkedid']]){var _0x498977=_[_0x9edd('0x17')](recordings[_0x75a4ab['linkedid']][_0x9edd('0x18')],{'value':_0x75a4ab['value']});if(_['isNil'](_0x498977)){recordings[_0x75a4ab[_0x9edd('0xa')]][_0x9edd('0x18')]['push']({'value':_0x75a4ab['value']});}}}}catch(_0x341d67){utils[_0x9edd('0xd')](_0x341d67[_0x9edd('0xe')]);}};exports['hangup']=function(_0x3741c8){try{if(!_[_0x9edd('0xf')](recordings[_0x3741c8[_0x9edd('0x9')]])){recordings[_0x3741c8[_0x9edd('0x9')]][_0x9edd('0x19')]=_0x3741c8['calleridnum'];recordings[_0x3741c8[_0x9edd('0x9')]][_0x9edd('0x1a')]=_0x3741c8[_0x9edd('0x1a')];recordings[_0x3741c8[_0x9edd('0x9')]][_0x9edd('0x1b')]=_0x3741c8['connectedlinenum'];recordings[_0x3741c8['uniqueid']][_0x9edd('0x1c')]=_0x3741c8[_0x9edd('0x1c')];if(recordings[_0x3741c8[_0x9edd('0x9')]][_0x9edd('0x1d')]==_0x9edd('0x1e')&&recordings[_0x3741c8['uniqueid']]['accountcode']){recordings[_0x3741c8[_0x9edd('0x9')]][_0x9edd('0x1b')]=recordings[_0x3741c8[_0x9edd('0x9')]]['accountcode'];recordings[_0x3741c8[_0x9edd('0x9')]][_0x9edd('0x1c')]='';}recordings[_0x3741c8[_0x9edd('0x9')]][_0x9edd('0x18')]['forEach'](_0x2155a1=>{var _0x3fb556=_[_0x9edd('0x1f')](recordings[_0x3741c8[_0x9edd('0x9')]]);_0x3fb556[_0x9edd('0x14')]=_0x2155a1[_0x9edd('0x14')];writeDB(_0x3fb556);});delete recordings[_0x3741c8[_0x9edd('0x9')]];}}catch(_0x1fba7b){utils[_0x9edd('0xd')](_0x1fba7b[_0x9edd('0xe')]);}};exports[_0x9edd('0x20')]=function(_0x138002){try{if(!_[_0x9edd('0xf')](recordings[_0x138002[_0x9edd('0x9')]])){if(_0x138002[_0x9edd('0x21')]['toLowerCase']()==_0x9edd('0x22')&&_[_0x9edd('0x23')](_0x138002[_0x9edd('0x24')]['toLowerCase'](),_0x9edd('0x25'))){var _0x3990fb=_0x138002[_0x9edd('0x24')][_0x9edd('0x26')]('=');var _0x21bc30=_0x3990fb[0x0][_0x9edd('0x27')](_0x3990fb[0x0][_0x9edd('0x28')]('(')+0x1,_0x3990fb[0x0][_0x9edd('0x28')](')'));var _0xd0fd74=_0x3990fb[0x1];recordings[_0x138002[_0x9edd('0x9')]][_0x21bc30]=_0xd0fd74;}}}catch(_0x29e789){utils[_0x9edd('0xd')](_0x29e789[_0x9edd('0xe')]);}};exports[_0x9edd('0x29')]=function(_0x5757fc){try{if(!_[_0x9edd('0xf')](recordings[_0x5757fc['uniqueid']])){recordings[_0x5757fc[_0x9edd('0x9')]][_0x9edd('0x2a')]=_0x5757fc[_0x9edd('0x2a')];}}catch(_0x434d26){utils[_0x9edd('0xd')](_0x434d26['stack']);}}; \ No newline at end of file +var _0xcb91=['uniqueid','channelstate','transfer','error','varset','variable','mixmonitor_filename','endsWith','value','.wav49','replace','.WAV','find','monitors','push','hangup','calleridnum','calleridname','connectedlinenum','connectedlinename','type','outbound','clone','newexten','toLowerCase','startsWith','appdata','cdr','split','substring','lastIndexOf','queuecallerjoin','queue','debug','accountcode','getUserByInternal','then','name','UserId','CreateVoiceRecording','request','newchannel','linkedid','exten','context','channel','stack','newstate','isNil'];(function(_0x5e638d,_0xb0b04b){var _0x41f3fd=function(_0x57a32d){while(--_0x57a32d){_0x5e638d['push'](_0x5e638d['shift']());}};_0x41f3fd(++_0xb0b04b);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x3a3c17,_0x5b7b7e){_0x3a3c17=_0x3a3c17-0x0;var _0xd07f21=_0xcb91[_0x3a3c17];return _0xd07f21;};'use strict';var _=require('lodash');var utils=require('./utils');var recordings={};function writeDB(_0x26fe42){utils[_0x1cb9('0x0')](_0x26fe42);if(_0x26fe42[_0x1cb9('0x1')]){utils[_0x1cb9('0x2')](_0x26fe42['accountcode'])[_0x1cb9('0x3')](function(_0x2c17b8){if(_0x2c17b8){_0x26fe42['membername']=_0x2c17b8[_0x1cb9('0x4')];_0x26fe42[_0x1cb9('0x5')]=_0x2c17b8['id'];}utils['request'](_0x1cb9('0x6'),_0x26fe42);});}else{utils[_0x1cb9('0x7')]('CreateVoiceRecording',_0x26fe42);}}exports[_0x1cb9('0x8')]=function(_0x12567c){try{if(_0x12567c['uniqueid']==_0x12567c[_0x1cb9('0x9')]){recordings[_0x12567c['uniqueid']]={'uniqueid':_0x12567c['uniqueid'],'accountcode':_0x12567c[_0x1cb9('0x1')],'exten':_0x12567c[_0x1cb9('0xa')],'context':_0x12567c[_0x1cb9('0xb')],'channel':_0x12567c[_0x1cb9('0xc')],'monitors':[]};}}catch(_0x2fc627){utils['error'](_0x2fc627[_0x1cb9('0xd')]);}};exports[_0x1cb9('0xe')]=function(_0x3af35f){try{if(!_[_0x1cb9('0xf')](recordings[_0x3af35f[_0x1cb9('0x10')]])&&_0x3af35f['channelstate']==0x6){}else if(!_['isNil'](recordings[_0x3af35f['linkedid']])&&_0x3af35f[_0x1cb9('0x11')]==0x6&&_0x3af35f[_0x1cb9('0xb')]!=_0x1cb9('0x12')){recordings[_0x3af35f[_0x1cb9('0x9')]]['accountcode']=_0x3af35f[_0x1cb9('0x1')];}}catch(_0x6ef389){utils[_0x1cb9('0x13')](_0x6ef389[_0x1cb9('0xd')]);}};exports[_0x1cb9('0x14')]=function(_0x5806d8){try{if(!_['isNil'](_0x5806d8[_0x1cb9('0x15')])&&!_[_0x1cb9('0xf')](_0x5806d8[_0x1cb9('0x15')][_0x1cb9('0x16')])){if(_[_0x1cb9('0x17')](_0x5806d8[_0x1cb9('0x18')],_0x1cb9('0x19'))){_0x5806d8['value']=_0x5806d8['value'][_0x1cb9('0x1a')](_0x1cb9('0x19'),_0x1cb9('0x1b'));}if(recordings[_0x5806d8[_0x1cb9('0x9')]]){var _0x280a84=_[_0x1cb9('0x1c')](recordings[_0x5806d8[_0x1cb9('0x9')]]['monitors'],{'value':_0x5806d8['value']});if(_[_0x1cb9('0xf')](_0x280a84)){recordings[_0x5806d8['linkedid']][_0x1cb9('0x1d')][_0x1cb9('0x1e')]({'value':_0x5806d8['value']});}}}}catch(_0x599275){utils[_0x1cb9('0x13')](_0x599275[_0x1cb9('0xd')]);}};exports[_0x1cb9('0x1f')]=function(_0x4601b8){try{if(!_[_0x1cb9('0xf')](recordings[_0x4601b8[_0x1cb9('0x10')]])){recordings[_0x4601b8['uniqueid']]['calleridnum']=_0x4601b8[_0x1cb9('0x20')];recordings[_0x4601b8['uniqueid']][_0x1cb9('0x21')]=_0x4601b8[_0x1cb9('0x21')];recordings[_0x4601b8[_0x1cb9('0x10')]][_0x1cb9('0x22')]=_0x4601b8[_0x1cb9('0x22')];recordings[_0x4601b8['uniqueid']][_0x1cb9('0x23')]=_0x4601b8[_0x1cb9('0x23')];if(recordings[_0x4601b8['uniqueid']][_0x1cb9('0x24')]==_0x1cb9('0x25')&&recordings[_0x4601b8[_0x1cb9('0x10')]][_0x1cb9('0x1')]){recordings[_0x4601b8[_0x1cb9('0x10')]][_0x1cb9('0x22')]=recordings[_0x4601b8[_0x1cb9('0x10')]][_0x1cb9('0x1')];recordings[_0x4601b8[_0x1cb9('0x10')]][_0x1cb9('0x23')]='';}recordings[_0x4601b8['uniqueid']][_0x1cb9('0x1d')]['forEach'](_0x110282=>{var _0x4efebc=_[_0x1cb9('0x26')](recordings[_0x4601b8[_0x1cb9('0x10')]]);_0x4efebc[_0x1cb9('0x18')]=_0x110282[_0x1cb9('0x18')];writeDB(_0x4efebc);});delete recordings[_0x4601b8['uniqueid']];}}catch(_0x1c701f){utils['error'](_0x1c701f[_0x1cb9('0xd')]);}};exports[_0x1cb9('0x27')]=function(_0x4220d7){try{if(!_['isNil'](recordings[_0x4220d7[_0x1cb9('0x10')]])){if(_0x4220d7['application'][_0x1cb9('0x28')]()=='set'&&_[_0x1cb9('0x29')](_0x4220d7[_0x1cb9('0x2a')][_0x1cb9('0x28')](),_0x1cb9('0x2b'))){var _0x56c3e0=_0x4220d7[_0x1cb9('0x2a')][_0x1cb9('0x2c')]('=');var _0x3467d5=_0x56c3e0[0x0][_0x1cb9('0x2d')](_0x56c3e0[0x0][_0x1cb9('0x2e')]('(')+0x1,_0x56c3e0[0x0][_0x1cb9('0x2e')](')'));var _0xc6d5fd=_0x56c3e0[0x1];recordings[_0x4220d7[_0x1cb9('0x10')]][_0x3467d5]=_0xc6d5fd;}}}catch(_0x386e8b){utils[_0x1cb9('0x13')](_0x386e8b[_0x1cb9('0xd')]);}};exports[_0x1cb9('0x2f')]=function(_0x29f149){try{if(!_['isNil'](recordings[_0x29f149['uniqueid']])){recordings[_0x29f149[_0x1cb9('0x10')]][_0x1cb9('0x30')]=_0x29f149[_0x1cb9('0x30')];}}catch(_0x29f451){utils[_0x1cb9('0x13')](_0x29f451[_0x1cb9('0xd')]);}}; \ No newline at end of file diff --git a/server/services/xdr/transfers.controller.js b/server/services/xdr/transfers.controller.js index a284140..c65095a 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 _0x6208=['transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetlinkedid','lodash','./utils','format','type','request','CreateVoiceTransferReport','blindtransfer','blind','error','stack','attendedtransfer','assign','origtransfererchannel','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinenum','origtransfereraccountcode','secondtransferercontext','origtransferercontext','origtransfererexten','attended','isNil','transfereechannel','transfertargetcalleridnum','transfertargetconnectedlinenum'];(function(_0x182cbc,_0x19e623){var _0x22c5b4=function(_0x1a8b0d){while(--_0x1a8b0d){_0x182cbc['push'](_0x182cbc['shift']());}};_0x22c5b4(++_0x19e623);}(_0x6208,0x17d));var _0x8620=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x6208[_0x2b4411];return _0x8e41ef;};'use strict';var _=require(_0x8620('0x0'));var util=require('util');var utils=require(_0x8620('0x1'));function writeDB(_0x275639){utils['info'](util[_0x8620('0x2')]('TRANSFER|%s',_0x275639[_0x8620('0x3')]));utils[_0x8620('0x4')](_0x8620('0x5'),_0x275639);}exports[_0x8620('0x6')]=function(_0x2e6f3e){try{_0x2e6f3e[_0x8620('0x3')]=_0x8620('0x7');writeDB(_0x2e6f3e);}catch(_0x525095){utils[_0x8620('0x8')](_0x525095[_0x8620('0x9')]);}};exports[_0x8620('0xa')]=function(_0x4694f2){try{_0x4694f2=_[_0x8620('0xb')](_0x4694f2,{'transfererchannel':_0x4694f2[_0x8620('0xc')],'transferercalleridnum':_0x4694f2[_0x8620('0xd')],'transferercalleridname':_0x4694f2[_0x8620('0xe')],'transfererconnectedlinenum':_0x4694f2[_0x8620('0xf')],'transfererconnectedlinename':_0x4694f2['secondtransfererconnectedlinename'],'transfereraccountcode':_0x4694f2[_0x8620('0x10')],'transferercontext':_0x4694f2[_0x8620('0x11')],'transfererexten':_0x4694f2['secondtransfererexten'],'transfererlinkedid':_0x4694f2['origtransfererlinkedid'],'context':_0x4694f2[_0x8620('0x12')],'extension':_0x4694f2[_0x8620('0x13')],'type':_0x8620('0x14')});if(_[_0x8620('0x15')](_0x4694f2[_0x8620('0x16')])){_0x4694f2=_[_0x8620('0xb')](_0x4694f2,{'transfereechannel':_0x4694f2['transfertargetchannel'],'transfereecalleridnum':_0x4694f2[_0x8620('0x17')],'transfereecalleridname':_0x4694f2['transfertargetcalleridname'],'transfereeconnectedlinenum':_0x4694f2[_0x8620('0x18')],'transfereeconnectedlinename':_0x4694f2[_0x8620('0x19')],'transfereeaccountcode':_0x4694f2[_0x8620('0x1a')],'transfereecontext':_0x4694f2[_0x8620('0x1b')],'transfereeexten':_0x4694f2['transfertargetexten'],'transfereelinkedid':_0x4694f2[_0x8620('0x1c')]});}writeDB(_0x4694f2);}catch(_0x41ea96){utils['error'](_0x41ea96['stack']);}}; \ No newline at end of file +var _0x4fd7=['origtransfererlinkedid','origtransferercontext','origtransfererexten','attended','isNil','transfereechannel','transfertargetcalleridnum','transfertargetcalleridname','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','error','lodash','util','./utils','TRANSFER|%s','type','CreateVoiceTransferReport','blind','stack','attendedtransfer','assign','origtransfererchannel','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten'];(function(_0x11a44a,_0x38c203){var _0x1f3a32=function(_0x560f1d){while(--_0x560f1d){_0x11a44a['push'](_0x11a44a['shift']());}};_0x1f3a32(++_0x38c203);}(_0x4fd7,0xe6));var _0x74fd=function(_0x348047,_0x392857){_0x348047=_0x348047-0x0;var _0x54db9e=_0x4fd7[_0x348047];return _0x54db9e;};'use strict';var _=require(_0x74fd('0x0'));var util=require(_0x74fd('0x1'));var utils=require(_0x74fd('0x2'));function writeDB(_0x18e591){utils['info'](util['format'](_0x74fd('0x3'),_0x18e591[_0x74fd('0x4')]));utils['request'](_0x74fd('0x5'),_0x18e591);}exports['blindtransfer']=function(_0xae1ea5){try{_0xae1ea5['type']=_0x74fd('0x6');writeDB(_0xae1ea5);}catch(_0xced36a){utils['error'](_0xced36a[_0x74fd('0x7')]);}};exports[_0x74fd('0x8')]=function(_0x5e2010){try{_0x5e2010=_[_0x74fd('0x9')](_0x5e2010,{'transfererchannel':_0x5e2010[_0x74fd('0xa')],'transferercalleridnum':_0x5e2010[_0x74fd('0xb')],'transferercalleridname':_0x5e2010[_0x74fd('0xc')],'transfererconnectedlinenum':_0x5e2010[_0x74fd('0xd')],'transfererconnectedlinename':_0x5e2010[_0x74fd('0xe')],'transfereraccountcode':_0x5e2010[_0x74fd('0xf')],'transferercontext':_0x5e2010[_0x74fd('0x10')],'transfererexten':_0x5e2010[_0x74fd('0x11')],'transfererlinkedid':_0x5e2010[_0x74fd('0x12')],'context':_0x5e2010[_0x74fd('0x13')],'extension':_0x5e2010[_0x74fd('0x14')],'type':_0x74fd('0x15')});if(_[_0x74fd('0x16')](_0x5e2010[_0x74fd('0x17')])){_0x5e2010=_[_0x74fd('0x9')](_0x5e2010,{'transfereechannel':_0x5e2010['transfertargetchannel'],'transfereecalleridnum':_0x5e2010[_0x74fd('0x18')],'transfereecalleridname':_0x5e2010[_0x74fd('0x19')],'transfereeconnectedlinenum':_0x5e2010['transfertargetconnectedlinenum'],'transfereeconnectedlinename':_0x5e2010['transfertargetconnectedlinename'],'transfereeaccountcode':_0x5e2010[_0x74fd('0x1a')],'transfereecontext':_0x5e2010[_0x74fd('0x1b')],'transfereeexten':_0x5e2010[_0x74fd('0x1c')],'transfereelinkedid':_0x5e2010[_0x74fd('0x1d')]});}writeDB(_0x5e2010);}catch(_0x24639c){utils[_0x74fd('0x1e')](_0x24639c[_0x74fd('0x7')]);}}; \ No newline at end of file diff --git a/server/services/xdr/utils.js b/server/services/xdr/utils.js index 17d81f7..63a48ef 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 _0x38dc=['isBefore','jayson/promise','moment','client','http','../../config/logger','xdr','info','debug','stringify','error','stack','request','catch','GetUser','internal','then','GETUSER|','result','length','FOUND','NOTFOUND','getUserByInterface','getUserByName','getVoiceQueueByName','GetVoiceQueue','name','type','acw','acwTimeout','GETVOICEQUEUEBYNAME|','addTime','add','format','subtractTime','subtract','seconds','YYYY-MM-DD\x20HH:mm:ss','diffTime','diff','now'];(function(_0x589002,_0x1c9c42){var _0x1ebe5a=function(_0x7f9547){while(--_0x7f9547){_0x589002['push'](_0x589002['shift']());}};_0x1ebe5a(++_0x1c9c42);}(_0x38dc,0xf7));var _0xc38d=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x38dc[_0x167cc1];return _0x10bc4b;};'use strict';var jayson=require(_0xc38d('0x0'));var moment=require(_0xc38d('0x1'));var BPromise=require('bluebird');var client=jayson[_0xc38d('0x2')][_0xc38d('0x3')]({'port':0x2329});var logger=require(_0xc38d('0x4'))(_0xc38d('0x5'));exports[_0xc38d('0x6')]=function(_0xbd6aef){logger[_0xc38d('0x6')](_0xbd6aef);};exports[_0xc38d('0x7')]=function(_0x1d68b6){logger[_0xc38d('0x7')](JSON[_0xc38d('0x8')](_0x1d68b6));};exports[_0xc38d('0x9')]=function(_0x13e8e6){logger['error'](_0x13e8e6[_0xc38d('0xa')]);};exports['request']=function(_0x2e61df,_0x1aa8a0){return client[_0xc38d('0xb')](_0x2e61df,{'body':_0x1aa8a0})['then'](function(_0x22e98e){logger[_0xc38d('0x7')](JSON['stringify'](_0x22e98e));})[_0xc38d('0xc')](function(_0x467d6c){logger['error'](_0x467d6c[_0xc38d('0xa')]);});};function getUser(_0xc36bb){return client[_0xc38d('0xb')](_0xc38d('0xd'),{'options':{'raw':!![],'attributes':['id',_0xc38d('0xe'),'name','interface'],'where':_0xc36bb,'limit':0x1}})[_0xc38d('0xf')](function(_0x46338a){logger[_0xc38d('0x6')](_0xc38d('0x10')+JSON['stringify'](_0xc36bb)+'|'+(_0x46338a[_0xc38d('0x11')][_0xc38d('0x12')]?_0xc38d('0x13'):_0xc38d('0x14')));return _0x46338a[_0xc38d('0x11')][_0xc38d('0x12')]?_0x46338a[_0xc38d('0x11')][0x0]:null;});}exports['getUserByInternal']=function(_0x5e14a7){return new BPromise(function(_0x4ce4e1,_0x10ea28){if(_0x5e14a7){return getUser({'internal':_0x5e14a7})[_0xc38d('0xf')](function(_0x2d8830){return _0x4ce4e1(_0x2d8830);})['catch'](function(_0x384b95){logger['error'](_0x384b95[_0xc38d('0xa')]);return _0x4ce4e1(null);});}else{return _0x4ce4e1(null);}});};exports[_0xc38d('0x15')]=function(_0x21bfe7){return new BPromise(function(_0x3cc7bc,_0xece2){if(_0x21bfe7){return getUser({'interface':_0x21bfe7})[_0xc38d('0xf')](function(_0x203eea){return _0x3cc7bc(_0x203eea);})['catch'](function(_0x5cb9b1){logger['error'](_0x5cb9b1[_0xc38d('0xa')]);return _0x3cc7bc(null);});}else{return _0x3cc7bc(null);}});};exports[_0xc38d('0x16')]=function(_0x10400d){return new BPromise(function(_0x2865d5,_0x37b074){if(_0x10400d){return getUser({'name':_0x10400d})[_0xc38d('0xf')](function(_0x1195f3){return _0x2865d5(_0x1195f3);})[_0xc38d('0xc')](function(_0x18d688){logger['error'](_0x18d688[_0xc38d('0xa')]);return _0x2865d5(null);});}else{return _0x2865d5(null);}});};exports[_0xc38d('0x17')]=function(_0x58311b){return new BPromise(function(_0x8c5eae,_0x552906){if(_0x58311b){return client['request'](_0xc38d('0x18'),{'options':{'raw':!![],'attributes':['id',_0xc38d('0x19'),_0xc38d('0x1a'),_0xc38d('0x1b'),_0xc38d('0x1c')],'where':{'name':_0x58311b},'limit':0x1}})[_0xc38d('0xf')](function(_0x49c1c5){logger[_0xc38d('0x6')](_0xc38d('0x1d')+_0x58311b+'|'+(_0x49c1c5[_0xc38d('0x11')]['length']?_0xc38d('0x13'):_0xc38d('0x14')));return _0x8c5eae(_0x49c1c5['result'][_0xc38d('0x12')]?_0x49c1c5[_0xc38d('0x11')][0x0]:null);})[_0xc38d('0xc')](function(_0x3338ad){logger['error'](_0x3338ad[_0xc38d('0xa')]);return _0x8c5eae(null);});}else{return _0x8c5eae(null);}});};exports[_0xc38d('0x1e')]=function(_0x599a88,_0x3ea556){return moment(_0x599a88)[_0xc38d('0x1f')](_0x3ea556,'seconds')[_0xc38d('0x20')]('YYYY-MM-DD\x20HH:mm:ss');};exports[_0xc38d('0x21')]=function(_0x21f136,_0x3a202b){return moment(_0x21f136)[_0xc38d('0x22')](_0x3a202b,_0xc38d('0x23'))[_0xc38d('0x20')](_0xc38d('0x24'));};exports[_0xc38d('0x25')]=function(_0x195baf,_0x317db9){return moment(_0x195baf)[_0xc38d('0x26')](moment(_0x317db9),_0xc38d('0x23'));};exports['sumTime']=function(_0x464453,_0x408b69){return parseInt(_0x464453,0xa)+parseInt(_0x408b69,0xa);};exports[_0xc38d('0x27')]=function(){return moment()[_0xc38d('0x20')]('YYYY-MM-DD\x20HH:mm:ss');};exports['isAfter']=function(_0x263f82,_0xb9aa63){if(_0xb9aa63){return moment(_0x263f82)['isAfter'](_0xb9aa63);}else{return!![];}};exports[_0xc38d('0x28')]=function(_0x1b1ca6,_0x1c6f7a){if(_0x1c6f7a){return moment(_0x1b1ca6)[_0xc38d('0x28')](_0x1c6f7a);}else if(_0x1b1ca6){return!![];}else{return![];}}; \ No newline at end of file +var _0xaeb8=['then','result','length','FOUND','NOTFOUND','getUserByInternal','getUserByInterface','getUserByName','getVoiceQueueByName','request','GetVoiceQueue','type','acw','acwTimeout','GETVOICEQUEUEBYNAME|','addTime','add','seconds','format','subtract','YYYY-MM-DD\x20HH:mm:ss','diffTime','sumTime','now','isAfter','isBefore','jayson/promise','moment','bluebird','client','http','../../config/logger','xdr','info','debug','stringify','error','stack','catch','GetUser','name'];(function(_0x23a952,_0x3dfac6){var _0x2a841a=function(_0x2cfdd7){while(--_0x2cfdd7){_0x23a952['push'](_0x23a952['shift']());}};_0x2a841a(++_0x3dfac6);}(_0xaeb8,0x162));var _0x8aeb=function(_0x4d2f00,_0x4e94d5){_0x4d2f00=_0x4d2f00-0x0;var _0x2d7b7f=_0xaeb8[_0x4d2f00];return _0x2d7b7f;};'use strict';var jayson=require(_0x8aeb('0x0'));var moment=require(_0x8aeb('0x1'));var BPromise=require(_0x8aeb('0x2'));var client=jayson[_0x8aeb('0x3')][_0x8aeb('0x4')]({'port':0x2329});var logger=require(_0x8aeb('0x5'))(_0x8aeb('0x6'));exports[_0x8aeb('0x7')]=function(_0x367688){logger[_0x8aeb('0x7')](_0x367688);};exports[_0x8aeb('0x8')]=function(_0x241ffe){logger['debug'](JSON[_0x8aeb('0x9')](_0x241ffe));};exports[_0x8aeb('0xa')]=function(_0x7fc9ce){logger[_0x8aeb('0xa')](_0x7fc9ce[_0x8aeb('0xb')]);};exports['request']=function(_0x2337b2,_0x4f79b5){return client['request'](_0x2337b2,{'body':_0x4f79b5})['then'](function(_0x159401){logger[_0x8aeb('0x8')](JSON[_0x8aeb('0x9')](_0x159401));})[_0x8aeb('0xc')](function(_0x4c0a17){logger[_0x8aeb('0xa')](_0x4c0a17[_0x8aeb('0xb')]);});};function getUser(_0x4ac521){return client['request'](_0x8aeb('0xd'),{'options':{'raw':!![],'attributes':['id','internal',_0x8aeb('0xe'),'interface'],'where':_0x4ac521,'limit':0x1}})[_0x8aeb('0xf')](function(_0x50bbcf){logger[_0x8aeb('0x7')]('GETUSER|'+JSON[_0x8aeb('0x9')](_0x4ac521)+'|'+(_0x50bbcf[_0x8aeb('0x10')][_0x8aeb('0x11')]?_0x8aeb('0x12'):_0x8aeb('0x13')));return _0x50bbcf[_0x8aeb('0x10')][_0x8aeb('0x11')]?_0x50bbcf['result'][0x0]:null;});}exports[_0x8aeb('0x14')]=function(_0x1ed8e8){return new BPromise(function(_0x17464,_0x374249){if(_0x1ed8e8){return getUser({'internal':_0x1ed8e8})[_0x8aeb('0xf')](function(_0x517426){return _0x17464(_0x517426);})[_0x8aeb('0xc')](function(_0x37ff16){logger[_0x8aeb('0xa')](_0x37ff16[_0x8aeb('0xb')]);return _0x17464(null);});}else{return _0x17464(null);}});};exports[_0x8aeb('0x15')]=function(_0x1481f7){return new BPromise(function(_0x19be3c,_0x2f4fec){if(_0x1481f7){return getUser({'interface':_0x1481f7})[_0x8aeb('0xf')](function(_0x10eee4){return _0x19be3c(_0x10eee4);})[_0x8aeb('0xc')](function(_0x16dd42){logger[_0x8aeb('0xa')](_0x16dd42[_0x8aeb('0xb')]);return _0x19be3c(null);});}else{return _0x19be3c(null);}});};exports[_0x8aeb('0x16')]=function(_0x547205){return new BPromise(function(_0x1878f2,_0x57e156){if(_0x547205){return getUser({'name':_0x547205})[_0x8aeb('0xf')](function(_0x3a6b3e){return _0x1878f2(_0x3a6b3e);})['catch'](function(_0x3c7341){logger[_0x8aeb('0xa')](_0x3c7341[_0x8aeb('0xb')]);return _0x1878f2(null);});}else{return _0x1878f2(null);}});};exports[_0x8aeb('0x17')]=function(_0x4eee7d){return new BPromise(function(_0x3a1889,_0x4995c0){if(_0x4eee7d){return client[_0x8aeb('0x18')](_0x8aeb('0x19'),{'options':{'raw':!![],'attributes':['id',_0x8aeb('0xe'),_0x8aeb('0x1a'),_0x8aeb('0x1b'),_0x8aeb('0x1c')],'where':{'name':_0x4eee7d},'limit':0x1}})['then'](function(_0x1070ed){logger[_0x8aeb('0x7')](_0x8aeb('0x1d')+_0x4eee7d+'|'+(_0x1070ed[_0x8aeb('0x10')]['length']?_0x8aeb('0x12'):_0x8aeb('0x13')));return _0x3a1889(_0x1070ed[_0x8aeb('0x10')][_0x8aeb('0x11')]?_0x1070ed[_0x8aeb('0x10')][0x0]:null);})[_0x8aeb('0xc')](function(_0x172204){logger[_0x8aeb('0xa')](_0x172204[_0x8aeb('0xb')]);return _0x3a1889(null);});}else{return _0x3a1889(null);}});};exports[_0x8aeb('0x1e')]=function(_0x5b596f,_0x32bffd){return moment(_0x5b596f)[_0x8aeb('0x1f')](_0x32bffd,_0x8aeb('0x20'))[_0x8aeb('0x21')]('YYYY-MM-DD\x20HH:mm:ss');};exports['subtractTime']=function(_0x19a982,_0x26c4f1){return moment(_0x19a982)[_0x8aeb('0x22')](_0x26c4f1,'seconds')[_0x8aeb('0x21')](_0x8aeb('0x23'));};exports[_0x8aeb('0x24')]=function(_0x539ca5,_0x1d956a){return moment(_0x539ca5)['diff'](moment(_0x1d956a),'seconds');};exports[_0x8aeb('0x25')]=function(_0x4f812d,_0x120d03){return parseInt(_0x4f812d,0xa)+parseInt(_0x120d03,0xa);};exports[_0x8aeb('0x26')]=function(){return moment()['format'](_0x8aeb('0x23'));};exports['isAfter']=function(_0xeb65ff,_0x1ad08c){if(_0x1ad08c){return moment(_0xeb65ff)[_0x8aeb('0x27')](_0x1ad08c);}else{return!![];}};exports['isBefore']=function(_0x56697c,_0x1824fb){if(_0x1824fb){return moment(_0x56697c)[_0x8aeb('0x28')](_0x1824fb);}else if(_0x56697c){return!![];}else{return![];}}; \ No newline at end of file